pax_global_header00006660000000000000000000000064121745170010014510gustar00rootroot0000000000000052 comment=a07a15974d2a2d4ab271880daaa908f7f4a88652 qt-client-4.1.0/000077500000000000000000000000001217451700100134125ustar00rootroot00000000000000qt-client-4.1.0/.gitignore000066400000000000000000000003561217451700100154060ustar00rootroot00000000000000*.DS_Store # C++ objects and libs *.slo *.lo *.o *.a *.la *.lai *.so *.dll *.dylib # Qt-es *.pro.user *.pro.user.* moc_*.cpp qrc_*.cpp Makefile *-build-* macx.pri bin/*.* common/tmp/*.* guiclient/ui/*.* widgets/tmp/*.* widgets/tmp qt-client-4.1.0/.gitmodules000066400000000000000000000003771217451700100155760ustar00rootroot00000000000000[submodule "openrpt"] path = openrpt url = https://github.com/mikerodonnell89/openrpt [submodule "csvimp"] path = csvimp url = https://github.com/mikerodonnell89/csvimp [submodule "xtlib"] path = xtlib url = https://github.com/mikerodonnell89/xtlib qt-client-4.1.0/LICENSE.txt000066400000000000000000000672441217451700100152520ustar00rootroot00000000000000Common Public Attribution License Version 1.0 (CPAL) 1. Definitions 1.0.1 "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. 1.1 "Contributor" means each entity that creates or contributes to the creation of Modifications. 1.2 "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3 "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4 "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5 "Executable" means Covered Code in any form other than Source Code. 1.6 "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8 "License" means this document. 1.8.1 "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9 "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10 "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.10.1 "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.11 "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12 "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1 The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 2.2 Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1 Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2 Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3 Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4 Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. 3.5 Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6 Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer, Original Developer or any Contributor. You hereby agree to indemnify the Initial Developer, Original Developer and every Contributor for any liability incurred by the Initial Developer, Original Developer or such Contributor as a result of any such terms You offer. 3.7 Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. 6. Versions of the License. 6.1 New Versions. Socialtext, Inc. ("Socialtext") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2 Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Socialtext. No one other than Socialtext has the right to modify the terms applicable to Covered Code created under this License. 6.3 Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Socialtext", "CPAL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the CPAL. (Filling in the name of the Initial Developer, Original Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER, ORIGINAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. 8.1 This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 8.2 If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer, Original Developer or a Contributor (the Initial Developer, Original Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. 8.3 If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 8.4 In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ORIGINAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by Virginia law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of Virginia, with venue lying in Norfolk, Virginia, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer, Original Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer, Original Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the CPAL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. 14. ADDITIONAL TERM: ATTRIBUTION (a) As a modest attribution to the organizer of the development of the Original Code ("Original Developer"), in the hope that its promotional value may help justify the time, money and effort invested in writing the Original Code, the Original Developer may include in Exhibit B ("Attribution Information") a requirement that each time an Executable and Source Code or a Larger Work is launched or initially run (which includes initiating a session), a prominent display of the Original Developer's Attribution Information (as defined below) must occur on the graphic user interface employed by the end user to access such Covered Code (which may include display on a splash screen), if any. The size of the graphic image should be consistent with the size of the other elements of the Attribution Information. If the access by the end user to the Executable and Source Code does not create a graphic user interface for access to the Covered Code, this obligation shall not apply. If the Original Code displays such Attribution Information in a particular form (such as in the form of a splash screen, notice at login, an "about" display, or dedicated attribution area on user interface screens), continued use of such form for that Attribution Information is one way of meeting this requirement for notice. (b) Attribution information may only include a copyright notice, a brief phrase, graphic image and a URL ("Attribution Information") and is subject to the Attribution Limits as defined below. For these purposes, prominent shall mean display for sufficient duration to give reasonable notice to the user of the identity of the Original Developer and that if You include Attribution Information or similar information for other parties, You must ensure that the Attribution Information for the Original Developer shall be no less prominent than such Attribution Information or similar information for the other party. For greater certainty, the Original Developer may choose to specify in Exhibit B below that the above attribution requirement only applies to an Executable and Source Code resulting from the Original Code or any Modification, but not a Larger Work. The intent is to provide for reasonably modest attribution, therefore the Original Developer cannot require that You display, at any time, more than the following information as Attribution Information: (a) a copyright notice including the name of the Original Developer; (b) a word or one phrase (not exceeding 10 words); (c) one graphic image provided by the Original Developer; and (d) a URL (collectively, the "Attribution Limits"). (c) If Exhibit B does not include any Attribution Information, then there are no requirements for You to display any Attribution Information of the Original Developer. (d) You acknowledge that all trademarks, service marks and/or trade names contained within the Attribution Information distributed with the Covered Code are the exclusive property of their owners and may only be used with the permission of their owners, or under circumstances otherwise permitted by law or as expressly set out in this License. 15. ADDITIONAL TERM: NETWORK USE. The term "External Deployment" means the use, distribution, or communication of the Original Code or Modifications in any way such that the Original Code or Modifications may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Code or Modifications as a distribution under section 3.1 and make Source Code available under Section 3.2. EXHIBIT A. Common Public Attribution License Version 1.0. The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.xTuple.com/CPAL. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is xTuple ERP: PostBooks Edition The Original Developer is not the Initial Developer and is __________. If left blank, the Original Developer is the Initial Developer. The Initial Developer of the Original Code is OpenMFG, LLC, d/b/a xTuple. All portions of the code written by xTuple are Copyright (c) 1999-2012 OpenMFG, LLC, d/b/a xTuple. All Rights Reserved. Contributor(s): ______________________. Alternatively, the contents of this file may be used under the terms of the xTuple End-User License Agreeement (the xTuple License), in which case the provisions of the xTuple License are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the xTuple License and not to allow others to use your version of this file under the CPAL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the xTuple License. If you do not delete the provisions above, a recipient may use your version of this file under either the CPAL or the xTuple License. [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] EXHIBIT B. Attribution Information Attribution Copyright Notice: Copyright (c) 1999-2012 by OpenMFG, LLC, d/b/a xTuple Attribution Phrase (not exceeding 10 words): Powered by xTuple ERP: PostBooks Edition Attribution URL: www.xtuple.org (to be included in the "Community" menu of the application if possible) Graphic Image as provided in the Covered Code, if any. (online at www.xtuple.com/poweredby) Display of Attribution Information is required in Larger Works which are defined in the CPAL as a work which combines Covered Code or portions thereof with code not governed by the terms of the CPAL. qt-client-4.1.0/README.md000066400000000000000000000160571217451700100147020ustar00rootroot00000000000000Development for the Qt (C++) xTuple App ======== Download and Install Postgres 9.1 and the xTuple Database ------ You'll need to install Postgres 9.1. There are several different ways you can do this. Go to www.postgresql.org to get started. After you've successfully installed Postgres and you're able to get a local server running, you'll need to install the xTuple demo database so that you'll have a database to log in to and some data to work with when testing your code. Select the most recent version from the link below: http://sourceforge.net/projects/postbooks/files/03%20PostBooks-databases/ And you'll want to download the database entitled postbooks_demo-(version).backup The "demo" databases are set up with a fictional company that seems to have been running for a while, so whatever part of the application you're working on, there will surely be some data for you to test against. Use the pg_restore terminal command to install the database .backup onto your Postgres server. Download and Install Qt 4.8 ------ There are several ways to do this as well. Visit www.qt-project.org or www.developer.nokia.com to get started. Set up your Forks ------ Now that we've installed all the necessary software to develop for xTuple, we'll need the xTuple source code, along with some other code needed to compile the app. From github.com/xtuple, you'll want to "fork" the openrpt, csvimp, xtlib, and qt-client repos into your git profile. Towards the top right of the page of each repository, there's a fork button. This copies everything over to your git profile, so that you can safely manipulate the code without touching anything on the xTuple git. Clone the Code ------ After setting up our forks, we'll use terminal to clone our freshly forked repos onto our machines. When you call "git clone" from a terminal window, you pull the repository from github to your local machine. By default, it'll be created in a new directory named after the repo you're cloning. git clone https://github.com/YOUR_GIT_NAME/qt-client.git openrpt, csvimp and xtlib are submodules of the qt-client repository. When you clone qt-client, you get these repos too, and you'll see them in your file system as subdirectories of qt-client. They're special though; any manipulation or updating of these directories will be ignored by the qt-client repo - for example, changed openrpt code will not show up in a "git diff" called from the qt-client directory. If you look at the directory structure through Github, you'll notice that submodules directories are green. Submodules allow us to isolate certain subdirectories from a repository and establish these subdirectories as their own repositories. This is very useful when you have semi-independent code such as library or framework code, and you want to be able to update and manipulate this code seperately from the parent repository/directory. Branching off Master ------ When you first clone a repo, you start off in the "master" branch. We want this branch to be clean at all times, so we're not going to be writing code in it. Instead, we'll create branches based off master, then work from those. When you make changes in a branch, those changes are bound to those branch. When you switch to another branch, you'll ditch the changes in the branch you were working in, and load up the changes you've made on the branch you're switching to. Branching allows us to work on a number of different bugs and features at a time - a task that was an enormous hassle with SVN. To create a new branch, and to check it out, call git checkout -b newBranchName "checkout" is the command used to switch between branches. Use -b when you want to create a new branch. Use git branch to list your branches for the current repo. Notice that, when you create a new branch, it's based off of the current branch you're in. So when you want to start working on a new issue that you haven't touched yet, you'll want to switch to your master branch and make sure it's up to date with xTuple's master before creating a new branch to work with. It's important that each branch approaches only one issue at a time. See the section entitled "Keeping up to date with xTuple's Master" on how to keep your master up to date. After you've made some changes and you're ready to stick them in the master xTuple source, you'll want to add, commit, push, and issue a pull request. Adding, Committing and Pushing Code ------ Now you're ready to commit. Make use of git status git diff to make sure you're satisfied with the changes you've made. "git status" will tell you that there are changes, but nothing is staged for commit. To stage files for commit, you add them with git add (filenames) Then, you commit them with git commit (please use -m and leave a message detailing the commit) At this point, everything's still local. Your github page on the internet is completely unaware of this newly created and modified branch and the changes you've made to it. To get this stuff up online, use: git push origin (branchName) Origin refers to the repository that you cloned from. After pushing, you'll see on your github page for that repo that a new branch has been created. You can use Git's diff tools to see the files and code changed against your master branch. Pull Requests ------ So, you've got your new code on YOUR github, but not xTuple's. Time to issue a pull request. Click the pull request button. The left side is the side we want to merge into (in this case, xTuple's master branch) and the right side is the side where the new code is coming from (your github's newBranch). It's always a good idea to double check everything here using Github's diff tools - make sure your code looks good and make sure you're merging from the right branch into xTuple's master! Issue the pull request, but don't merge it! Someone else will look over the request using the diff tools and merge it into xTuple's master branch for you. Set the incident you fixed to Resolved/Open, and whoever does the merge and tests it will close it. Keeping up to date with xTuple's Master ------ Since everyone is pushing their code and pulling requests on xTuple code all the time, your local code will become dated pretty quickly. We need to set up an easy way to keep our code up to date with xTuple's master on github. To do this, we set up a remote. git remote add QTCLIENT git://github.com/xtuple/qt-client.git Now we have two remotes: origin (you) and QTCLIENT (xTuple). To get QTCLIENT/master code into our local masters, do the following: git checkout master git fetch QTCLIENT git merge QTCLIENT/master git submodule update --recursive git push origin master What this does is 1) checks out our local master 2) fetches QTCLIENT things 3) merges QTCLIENT's master into our local master 4) updates the submodules (in this case, openrpt, csvimp and xtlib) and 5) pushes our now up-to-date local master to our github's internet master. I recommend sticking those 5 commands in a shell script and running it a couple of times throughout the day to stay up to date. qt-client-4.1.0/bundle.sh000077500000000000000000000143201217451700100152220ustar00rootroot00000000000000# # This file is part of the xTuple ERP: PostBooks Edition, a free and # open source Enterprise Resource Planning software suite, # Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. # It is licensed to you under the Common Public Attribution License # version 1.0, the full text of which (including xTuple-specific Exhibits) # is available at www.xtuple.com/CPAL. By using this software, you agree # to be bound by its terms. # PROG=`basename $0` VERFILE=guiclient/version.cpp BUILD=false DEMO=false BASEDIR=`pwd` if [ "$BASEDIR" = . ] ; then BASEDIR=`pwd` fi usage() { echo "$PROG -h" echo "$PROG -b -d [ -x ]" echo fmt < build and bundle a demo release, including the help file named " echo " The help file for the demo is /not/ the regular application help" echo " To build a demo you must first edit some of the source files" echo "-x turn on shell debugging output" } bundle() { if [ "$#" -ne 2 ] ; then echo "Illegal call to bundle: bad arg count" echo "usage: bundle app dir_to_put_it_in" return 1 fi STARTDIR=`pwd` APPNAME="$1" if expr "$APPNAME" : ".*\.app" ; then BINARY="$APPNAME" APPNAME=`basename "$APPNAME" .app` else BINARY="${APPNAME}.app" fi if $DEMO ; then BUNDLENAME="${APPNAME}-${VERSION}Demo-MACUniversal" else BUNDLENAME="${APPNAME}-${VERSION}-MACUniversal" fi BUNDLEDIR="${2}/${BUNDLENAME}" if [ -d "$BUNDLEDIR" ] ; then rm -rf "$BUNDLEDIR" || return 3 fi mkdir "$BUNDLEDIR" || return 3 if ! $DEMO ; then cp -R -L "$BASEDIR/bin/$BINARY" "$BUNDLEDIR" || return 4 mkdir "$BUNDLEDIR/${BINARY}/Contents/Resources/helpXTupleGUIClient" || return 5 cp "$BASEDIR/share/empty_help.html" \ "$BASEDIR/share/XTupleGUIClient.adp" \ "$BUNDLEDIR"/"${BINARY}"/Contents/Resources/helpXTupleGUIClient || return 5 else mv "$BASEDIR/bin/$BINARY" "$BUNDLEDIR"/"${APPNAME}_Demo.app" || return 4 BINARY="${APPNAME}_Demo.app" if [ -d "$HELPFILE" ] ; then cp -R -L "$HELPFILE" \ "$BUNDLEDIR"/bin/"${BINARY}"/Contents/Resources/helpXTupleGUIClient || return 5 elif [ -f "$HELPFILE" ] ; then CURRDIR=`pwd` cd "$BUNDLEDIR"/"${BINARY}"/Contents/Resources || return 5 jar xf "$HELPFILE" || return 5 if [ ! -d helpXTupleGUIClient ] ; then echo "$PROG: help file $HELPFILE was not installed properly in demo client" return 5 fi cd "$CURRDIR" || return 5 fi fi cd "$BUNDLEDIR"/.. || return 5 if [ -f "$BUNDLENAME".dmg ] && ! rm "$BUNDLENAME".dmg ; then return 5 fi if ! hdiutil create -fs HFS+ -volname "$BUNDLENAME" -srcfolder "$BUNDLENAME" "$BUNDLENAME".dmg ; then return 5 fi cd $STARTDIR || return 5 } ARGS=`getopt hbd:x $*` if [ $? != 0 ] ; then usage exit 1 fi set -- $ARGS while [ "$1" != -- ] ; do case "$1" in -h) usage exit 0 ;; -b) BUILD=true ;; -d) DEMO=true HELPFILE=$2 if ! expr ${HELPFILE} : "\/" ; then HELPFILE=`pwd`/"$HELPFILE" fi if egrep -i "_evaluation.*FALSE" guiclient/main.cpp ; then echo The sources do not appear to have been modified to build a demo echo echo Change guiclient/main.cpp: set _evaluation to TRUE echo Change common/login2.cpp: set the port in _evalDatabaseURL echo Change common/login2.cpp: set the passwd to the proper value exit 1 fi shift ;; -x) set -x ;; *) usage exit 1 ;; esac shift done shift # past the -- if [ "$#" -gt 0 ] ; then echo "$PROG: ignoring extra arguments $*" fi if [ `uname -s` != Darwin ] ; then echo "$PROG: only supports Macintosh OS X (Darwin) at this time" usage exit 2 fi if [ -z "$QTDIR" ] ; then for TRYME in `echo $PATH | tr : ' '` ; do TRYME=`dirname $TRYME` if [ -e "$TRYME/bin/qmake" -a -e "$TRYME/lib/libQtCore.dylib" ] ; then export QTDIR="$TRYME" break; fi done if [ -n "QTDIR" ] ; then echo "$PROG: guessing that Qt is installed in $QTDIR" else echo "$PROG: Cannot run properly without the QTDIR environment variable set" exit 2 fi fi if [ -z "$PGDIR" ] ; then for TRYME in `echo $PATH | tr : ' '` ; do TRYME=`dirname $TRYME` if [ -e "$TRYME/bin/psql" -a -e "$TRYME/lib/libpq.a" ] ; then export PGDIR="$TRYME" break; fi done if [ -n "PGDIR" ] ; then echo "$PROG: guessing that Qt is installed in $PGDIR" else echo "$PROG: Cannot run properly without the PGDIR environment variable set" exit 2 fi fi if [ ! -e "$BASEDIR"/bin/xtuple.app ] ; then if ! $BUILD ; then echo "Building even though not explicitly told to do so" fi BUILD=true fi if [ ! -f "$VERFILE" ] ; then echo "Could not find $VERFILE" exit 2 fi VERSION=`awk '/ _Version / { split($0,vers,"\""); print vers[2]}' $VERFILE | \ tr -d [:blank:]` if $BUILD ; then cd "$BASEDIR" || exit 3 qmake || exit 3 make || exit 3 fi cd "$BASEDIR"/guiclient || exit 4 if [ `set -o | awk '/xtrace/ {print $2}'` = "on" ] ; then sh -x ./fixPackage || exit 4 else ./fixPackage || exit 4 fi cd "$BASEDIR"/bin || exit 4 bundle xtuple "${BASEDIR}/.." || exit 4 echo "DONE!" qt-client-4.1.0/common/000077500000000000000000000000001217451700100147025ustar00rootroot00000000000000qt-client-4.1.0/common/calendarcontrol.cpp000066400000000000000000000012531217451700100205610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "calendarcontrol.h" CalendarControl::CalendarControl(QObject * parent) : QObject(parent) { } CalendarControl::~CalendarControl() { } void CalendarControl::setSelectedDay(const QDate & day) { emit selectedDayChanged(day); } qt-client-4.1.0/common/calendarcontrol.h000066400000000000000000000015111217451700100202230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CALENDARCONTROL_H__ #define __CALENDARCONTROL_H__ #include #include class CalendarControl : public QObject { Q_OBJECT public: CalendarControl(QObject * parent = 0); ~CalendarControl(); virtual QString contents(const QDate &) = 0; virtual void setSelectedDay(const QDate & day); signals: void selectedDayChanged(const QDate &); }; #endif qt-client-4.1.0/common/calendargraphicsitem.cpp000066400000000000000000000254371217451700100215720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include "calendargraphicsitem.h" #include "graphicstextbuttonitem.h" #include "calendarcontrol.h" static const qreal __dpi = 72.0; static const qreal __width = 504.0; // 7.0 * __dpi static const qreal __height = 594.0; // 8.25 * __dpi static const qreal __titleHeight = 36.0; // 0.5 * __dpi static const QFont monthfont("Lucida", 24, QFont::Bold); static const QFont navfont("lucida", 20, QFont::Bold); static const QFont wdayfont("Lucida", 8); static const QFont dayfont("Lucida", 20, QFont::Bold); static const QFont notesfont("Lucida", 16); static const QBrush blackFill(Qt::SolidPattern); static const QBrush whiteFill("white"); static const QBrush nonMonthFill("lightgray"); static const QBrush nonMonthDayFill("gray"); static const QBrush weekendFill("khaki"); static const QBrush todayFill("paleturquoise"); static const QBrush selectedFill("lightgreen"); static const QPen noPen(Qt::NoPen); static const QPen defaultPen; CalendarGraphicsItem::CalendarGraphicsItem(CalendarControl * cc, QGraphicsItem * parent) : QGraphicsRectItem(0.0, 0.0, __width, __height, parent) { _controller = cc; QDate today = QDate::currentDate(); QDate firstMonthDay = QDate(today.year(), today.month(), 1); QDate firstCalendarDay = firstMonthDay.addDays(firstMonthDay.dayOfWeek() * -1); if(firstMonthDay.dayOfWeek() < 2) firstCalendarDay = firstCalendarDay.addDays(-7); _selectedDay = today; QString prev = QObject::tr("<"); QString prevprev = QObject::tr("<<"); QString next = QObject::tr(">"); QString nextnext = QObject::tr(">>"); QGraphicsSimpleTextItem * textItem; QGraphicsRectItem * rectItem; rectItem = new QGraphicsRectItem(0.0, 0.0, __width, __titleHeight, this); rectItem->setBrush(blackFill); _items.insert("titleBackground", rectItem); textItem = new QGraphicsSimpleTextItem(today.toString("MMMM yyyy"), this); textItem->setFont(monthfont); textItem->setZValue(2); textItem->setBrush(whiteFill); QPointF ct = rectItem->boundingRect().center(); QRectF rt = textItem->boundingRect(); textItem->setPos(ct.x() - (rt.width() / 2), ct.y() - (rt.height() / 2)); _items.insert("title", textItem); qreal offset = 0.1 * __dpi; qreal nw = 0; GraphicsTextButtonItem * tbtnItem = 0; tbtnItem = new GraphicsTextButtonItem(prevprev, this); tbtnItem->setFont(navfont); tbtnItem->setZValue(3); tbtnItem->setBrush(Qt::lightGray); tbtnItem->setRolloverBrush(Qt::green); tbtnItem->scale(0.5, 1); tbtnItem->setReceiver(this); rt = tbtnItem->boundingRect(); tbtnItem->setPos(offset, ct.y() - (rt.height() / 2)); nw = rt.width(); _items.insert("fastrewind", tbtnItem); tbtnItem = new GraphicsTextButtonItem(nextnext, this); tbtnItem->setFont(navfont); tbtnItem->setZValue(3); tbtnItem->setBrush(Qt::lightGray); tbtnItem->setRolloverBrush(Qt::green); tbtnItem->scale(0.5, 1); tbtnItem->setReceiver(this); rt = tbtnItem->boundingRect(); tbtnItem->setPos(rectItem->boundingRect().right() - offset - (rt.width() / 2), ct.y() - (rt.height() / 2)); nw = qMax(nw, rt.width()) / 2; offset += (nw * 1.5); _items.insert("fastforward", tbtnItem); tbtnItem = new GraphicsTextButtonItem(prev, this); tbtnItem->setFont(navfont); tbtnItem->setZValue(3); tbtnItem->setBrush(Qt::lightGray); tbtnItem->setRolloverBrush(Qt::green); tbtnItem->scale(0.5, 1); tbtnItem->setReceiver(this); rt = tbtnItem->boundingRect(); tbtnItem->setPos(offset, ct.y() - (rt.height() / 2)); _items.insert("rewind", tbtnItem); tbtnItem = new GraphicsTextButtonItem(next, this); tbtnItem->setFont(navfont); tbtnItem->setZValue(3); tbtnItem->setBrush(Qt::lightGray); tbtnItem->setRolloverBrush(Qt::green); tbtnItem->scale(0.5, 1); tbtnItem->setReceiver(this); rt = tbtnItem->boundingRect(); tbtnItem->setPos(rectItem->boundingRect().right() - offset - (rt.width() / 2), ct.y() - (rt.height() / 2)); _items.insert("forward", tbtnItem); QDate date; qreal dayWidth = __width / 7.0; QApplication::setOverrideCursor(Qt::WaitCursor); for(int wday = 0; wday < 7; wday++) { for(int week = 0; week < 6; week++) { date = firstCalendarDay.addDays((7 * week) + wday); if(0 == week) { rectItem = new QGraphicsRectItem(wday * dayWidth, 0.5 * __dpi, dayWidth, 0.25 * __dpi, this); _items.insert(QString("weekday%1").arg(week), rectItem); textItem = new QGraphicsSimpleTextItem(date.toString("dddd"), this); textItem->setFont(wdayfont); textItem->setZValue(2); ct = rectItem->boundingRect().center(); rt = textItem->boundingRect(); textItem->setPos(ct.x() - (rt.width() / 2), ct.y() - (rt.height() / 2)); _items.insert(QString("weekday%1Text").arg(week), textItem); } QBrush fill; QBrush dayFill = blackFill; if(date == _selectedDay) fill = selectedFill; else if(date.month() != today.month()) { fill = nonMonthFill; dayFill = nonMonthDayFill; } else if(date == today) fill = todayFill; else if(date.dayOfWeek() > 5) fill = weekendFill; rectItem = new QGraphicsRectItem(wday * dayWidth, (0.75 + (1.25 * week)) * __dpi, dayWidth, 1.25 * __dpi, this); rectItem->setBrush(fill); _items.insert(QString("day%1").arg((7 * week) + wday), rectItem); rt = QRectF(rectItem->pos(), rectItem->boundingRect().size()); double offset = rt.width() / 3; textItem = new QGraphicsSimpleTextItem(QString::number(date.day()), this); textItem->setFont(dayfont); textItem->setZValue(2); textItem->setBrush(dayFill); textItem->setPos(rectItem->boundingRect().topLeft()); textItem->moveBy(5.0, 5.0); _items.insert(QString("day%1Number").arg((7 * week) + wday), textItem); rt = QRectF(textItem->pos(), textItem->boundingRect().size()); QString additionalText; if(_controller) additionalText = _controller->contents(date); textItem = new QGraphicsSimpleTextItem(additionalText, this); textItem->setFont(notesfont); textItem->setZValue(2); textItem->setBrush(dayFill); textItem->setPos(rt.left() + offset, rt.top() + (rt.height() * 1.5)); _items.insert(QString("day%1Text").arg((7 * week) + wday), textItem); } } QApplication::restoreOverrideCursor(); } CalendarGraphicsItem::~CalendarGraphicsItem() { } void CalendarGraphicsItem::setCalendarControl(CalendarControl * controller) { _controller = controller; } CalendarControl * CalendarGraphicsItem::calendarControl() const { return _controller; } void CalendarGraphicsItem::setSelectedDay(const QDate & sDate) { //if(sDate == _selectedDay) // return; _selectedDay = sDate; QDate today = QDate::currentDate(); QDate firstMonthDay = QDate(_selectedDay.year(), _selectedDay.month(), 1); QDate firstCalendarDay = firstMonthDay.addDays(firstMonthDay.dayOfWeek() * -1); if(firstMonthDay.dayOfWeek() < 2) firstCalendarDay = firstCalendarDay.addDays(-7); QGraphicsRectItem * titleBackground = static_cast(_items["titleBackground"]); QGraphicsSimpleTextItem * title = static_cast(_items["title"]); if(title && titleBackground) { title->setText(_selectedDay.toString("MMMM yyyy")); QPointF ct = titleBackground->boundingRect().center(); QRectF rt = title->boundingRect(); title->setPos(ct.x() - (rt.width() / 2), ct.y() - (rt.height() / 2)); } QDate date; QApplication::setOverrideCursor(Qt::WaitCursor); for(int wday = 0; wday < 42; wday++) { date = firstCalendarDay.addDays(wday); QBrush fill; QBrush dayFill = blackFill; if(date == _selectedDay) fill = selectedFill; else if(date.month() != _selectedDay.month()) { fill = nonMonthFill; dayFill = nonMonthDayFill; } else if(date == today) fill = todayFill; else if(date.dayOfWeek() > 5) fill = weekendFill; QString additionalText; if(_controller) additionalText = _controller->contents(date); QGraphicsRectItem * ri = static_cast(_items[QString("day%1").arg(wday)]); if(ri) ri->setBrush(fill); QGraphicsSimpleTextItem * si = static_cast(_items[QString("day%1Number").arg(wday)]); if(si) { si->setText(QString::number(date.day())); si->setBrush(dayFill); } QGraphicsSimpleTextItem * si2 = static_cast(_items[QString("day%1Text").arg(wday)]); if(si2) { si2->setText(additionalText); si2->setBrush(dayFill); } } QApplication::restoreOverrideCursor(); if(_controller) _controller->setSelectedDay(_selectedDay); } // protected functions from base class that we don't want other people to change void CalendarGraphicsItem::setRect(const QRectF & rectangle) { QGraphicsRectItem::setRect(rectangle); } void CalendarGraphicsItem::setRect(qreal x, qreal y, qreal width, qreal height) { QGraphicsRectItem::setRect(x, y, width, height); } // reimplemented from GraphicsButtonReceiver void CalendarGraphicsItem::buttonMouseReleaseEvent(QGraphicsItem * origin, QGraphicsSceneMouseEvent * /*event*/) { QDate date = _selectedDay; if(origin == _items["fastforward"]) date = date.addYears(1); else if(origin == _items["forward"]) date = date.addMonths(1); else if(origin == _items["rewind"]) date = date.addMonths(-1); else if(origin == _items["fastrewind"]) date = date.addYears(-1); setSelectedDay(date); } void CalendarGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent* /*event*/) { // good enough to capture the mouse } void CalendarGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) { QGraphicsItem * item; for(int i = 0; i < 42; ++i) { item = _items[QString("day%1").arg(i)]; if(item && item->contains(item->mapFromScene(event->scenePos()))) { QDate firstMonthDay = QDate(_selectedDay.year(), _selectedDay.month(), 1); QDate firstCalendarDay = firstMonthDay.addDays(firstMonthDay.dayOfWeek() * -1); if(firstMonthDay.dayOfWeek() < 2) firstCalendarDay = firstCalendarDay.addDays(-7); setSelectedDay(firstCalendarDay.addDays(i)); return; } } } qt-client-4.1.0/common/calendargraphicsitem.h000066400000000000000000000033231217451700100212250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CALENDARGRAPHICSITEM_H__ #define __CALENDARGRAPHCISITEM_H__ #include #include #include #include "graphicstextbuttonitem.h" class CalendarControl; class CalendarGraphicsItem : public QGraphicsRectItem, protected GraphicsButtonReceiver { friend class GraphicsTextButtonItem; public: CalendarGraphicsItem(CalendarControl * = 0, QGraphicsItem * parent = 0); ~CalendarGraphicsItem(); void setCalendarControl(CalendarControl * controller); CalendarControl * calendarControl() const; void setSelectedDay(const QDate &); QDate selectedDay() const { return _selectedDay; } protected: // protect these function that were public in the base class because we do not want // then to be changed outside this class void setRect(const QRectF & rectangle); void setRect(qreal x, qreal y, qreal width, qreal height); // reimplemented from GraphicsButtonReceiver void buttonMouseReleaseEvent(QGraphicsItem * origin, QGraphicsSceneMouseEvent * event); // reimplemeted from QGraphicsItem void mousePressEvent(QGraphicsSceneMouseEvent*); void mouseReleaseEvent(QGraphicsSceneMouseEvent*); QMap _items; QDate _selectedDay; CalendarControl * _controller; }; #endif qt-client-4.1.0/common/checkForUpdates.cpp000066400000000000000000000161051217451700100204630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "checkForUpdates.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef Q_OS_WIN #include #include #endif #include "../guiclient/guiclient.h" #include #define DEBUG false #define QT_NO_URL_CAST_FROM_STRING checkForUpdates::checkForUpdates(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { QString url = "http://updates.xtuple.com/updates"; //intended http://updates.xtuple.com/updates/xTuple-4.0.1-linux-installer.run setupUi(this); progressDialog = new QProgressDialog(this); _ok = _buttonBox->button(QDialogButtonBox::Ok); _ignore = _buttonBox->button(QDialogButtonBox::Ignore); connect(_ok, SIGNAL(clicked()), this, SLOT(downloadButtonPressed())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_ignore, SIGNAL(clicked()), this, SLOT (accept())); #ifdef Q_OS_MACX OS = "osx"; suffix = "tar.gz"; #endif #ifdef Q_OS_WIN OS = "windows"; suffix = "exe"; #endif #ifdef Q_OS_LINUX OS = "linux"; suffix = "run"; #endif XSqlQuery versions, metric; versions.exec("SELECT metric_value AS dbver" " FROM metric" " WHERE (metric_name = 'ServerVersion');"); if(versions.first()) { serverVersion = versions.value("dbver").toString(); newurl = url + "/xTuple-" + serverVersion + "-" + OS + "-installer." + suffix; _label->setText(tr("Your client does not match the server version: %1. Would you like to update?").arg(serverVersion)); metric.exec("SELECT fetchMetricBool('DisallowMismatchClientVersion') as disallowed;"); metric.first(); _ignore->setEnabled(!metric.value("disallowed").toBool()); metric.exec("SELECT fetchMetricBool('AutoVersionUpdate') as allow;"); metric.first(); _ok->setEnabled(metric.value("allow").toBool()); } else if (versions.lastError().type() != QSqlError::NoError) systemError(this, versions.lastError().text(), __FILE__, __LINE__); if (DEBUG) { qDebug() << "serverVersion= " << serverVersion; qDebug() << "newurl= " << newurl; } } void checkForUpdates::downloadButtonPressed() { this->close(); QUrl url(newurl); filename = "xTuple-" + serverVersion + "-" + OS + "-installer."+ suffix; if(QFile::exists(filename)) { if(QMessageBox::question(this, tr("Update"), tr("There already exists a file called %1 in " "the current directory. Overwrite?").arg(filename), QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; QFile::remove(filename); } file = new QFile(filename); if(!file->open(QIODevice::WriteOnly)) { QMessageBox::information(this, "Update", tr("Unable to save the file %1: %2.") .arg(filename).arg(file->errorString())); delete file; file = NULL; return; } downloadRequestAborted = false; reply = manager.get(QNetworkRequest(url)); connect(reply, SIGNAL(finished()), this, SLOT(downloadFinished())); connect(reply, SIGNAL(readyRead()), this, SLOT(downloadReadyRead())); connect(reply, SIGNAL(downloadProgress(qint64,qint64)), this, SLOT(downloadProgress(qint64,qint64))); connect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelDownload())); //connect(reply, SIGNAL(downloadComplete()), this, SLOT(startUpdate())); progressDialog->setLabelText(tr("Downloading %1...").arg(filename)); _ok->setEnabled(false); progressDialog->exec(); } void checkForUpdates::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { if(downloadRequestAborted) return; progressDialog->setMaximum(bytesTotal); filesize = bytesTotal; progressDialog->setValue(bytesReceived); } void checkForUpdates::downloadReadyRead() { if(file) file->write(reply->readAll()); } void checkForUpdates::cancelDownload() { downloadRequestAborted = true; reply->abort(); _ok->setEnabled(true); } void checkForUpdates::downloadFinished() { if(downloadRequestAborted) { if(file) { file->close(); file->remove(); delete file; file = NULL; } reply->deleteLater(); progressDialog->hide(); _ok->setEnabled(true); return; } downloadReadyRead(); progressDialog->hide(); _ok->setEnabled(true); file->flush(); file->close(); if(reply->error()) { //Download failed QMessageBox::information(this, "Download failed", tr("Failed: %1").arg(reply->errorString())); } reply->deleteLater(); reply = NULL; delete file; file = NULL; startUpdate(); } void checkForUpdates::startUpdate() { QFile *updater = new QFile(filename); if(updater->exists()) { QStringList options; QProcess *installer = new QProcess(this); #ifdef Q_OS_MAC QProcess sh; sh.start("tar -xvf " + filename); sh.waitForFinished(); sh.close(); filename = "xTuple-" + serverVersion + "-" + OS + "-installer.app"; QFileInfo *path2 = new QFileInfo(filename); QString filepath = path2->absoluteFilePath() + "/Contents/MacOS/osx-intel"; if(installer->startDetached(filepath, options)) reject(); #endif #ifdef Q_OS_LINUX QFile launch(filename); launch.setPermissions(QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner|QFile::ReadGroup|QFile::WriteGroup|QFile::ExeGroup|QFile::ReadOther|QFile::WriteOther|QFile::ExeOther); QFileInfo *path = new QFileInfo(filename); if(installer->startDetached(path->absoluteFilePath(), options)) reject(); #endif #ifdef Q_OS_WIN int result = (int)::ShellExecuteA(0, "open", filename.toUtf8().constData(), 0, 0, SW_SHOWNORMAL); if (SE_ERR_ACCESSDENIED== result) { result = (int)::ShellExecuteA(0, "runas", filename.toUtf8().constData(), 0, 0, SW_SHOWNORMAL); reject(); } if (result <= 32) QMessageBox::information(this, "Download failed", tr("Failed: %1").arg(result)); #endif } } checkForUpdates::~checkForUpdates() { // no need to delete child widgets, Qt does it all for us } void checkForUpdates::languageChange() { retranslateUi(this); } qt-client-4.1.0/common/checkForUpdates.h000066400000000000000000000030221217451700100201220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHECKFORUPDATES_H #define CHECKFORUPDATES_H #include #include "tmp/ui_checkForUpdates.h" #include #include #include #include #include class checkForUpdates : public QDialog, public Ui::checkForUpdates { Q_OBJECT public: checkForUpdates(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~checkForUpdates(); QPushButton* _ok; QPushButton* _cancel; QPushButton* _ignore; public slots: void downloadButtonPressed(); void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); void downloadFinished(); void downloadReadyRead(); void cancelDownload(); void startUpdate(); protected slots: virtual void languageChange(); private: QNetworkAccessManager manager; QFile *file; QProgressDialog *progressDialog; QNetworkReply *reply; bool downloadRequestAborted; QString serverVersion; QString OS; QString suffix; QString newurl; QString filename; qint64 filesize; }; #endif // CHECKFORUPDATES_H qt-client-4.1.0/common/checkForUpdates.ui000066400000000000000000000025101217451700100203110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. checkForUpdates 0 0 446 73 Check For Updates Your client doesn't match the server. Would you like to upgrade? QDialogButtonBox::Cancel|QDialogButtonBox::Ignore|QDialogButtonBox::Ok qt-client-4.1.0/common/common.pro000066400000000000000000000030441217451700100167150ustar00rootroot00000000000000include( ../global.pri ) TARGET = xtuplecommon TEMPLATE = lib CONFIG += qt warn_on staticlib DEFINES += MAKELIB INCLUDEPATH += $(QTDIR)/src/3rdparty/zlib INCLUDEPATH += $(QTSRC)/src/3rdparty/zlib DESTDIR = ../lib OBJECTS_DIR = tmp MOC_DIR = tmp UI_DIR = tmp SOURCES = calendarcontrol.cpp \ calendargraphicsitem.cpp \ errorReporter.cpp \ exporthelper.cpp \ importhelper.cpp \ format.cpp \ graphicstextbuttonitem.cpp \ gunzip.cpp \ login2.cpp \ login2Options.cpp \ metrics.cpp \ metricsenc.cpp \ qbase64encode.cpp \ qmd5.cpp \ shortcuts.cpp \ storedProcErrorLookup.cpp \ tarfile.cpp \ xbase32.cpp \ xtupleproductkey.cpp \ xtsettings.cpp \ checkForUpdates.cpp HEADERS = calendarcontrol.h \ calendargraphicsitem.h \ errorReporter.h \ exporthelper.h \ importhelper.h \ format.h \ graphicstextbuttonitem.h \ gunzip.h \ login2.h \ login2Options.h \ metrics.h \ metricsenc.h \ qbase64encode.h \ qmd5.h \ shortcuts.h \ storedProcErrorLookup.h \ tarfile.h \ xbase32.h \ xtupleproductkey.h \ xtsettings.h \ checkForUpdates.h FORMS = login2.ui login2Options.ui checkForUpdates.ui QT += script sql xml xmlpatterns network RESOURCES += xTupleCommon.qrc qt-client-4.1.0/common/errorReporter.cpp000066400000000000000000004264061217451700100202760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "errorReporter.h" #include #include #include #include #include #include #include "storedProcErrorLookup.h" // TODO: expose to scripting // TOOD: allow extending the list to constraints in packages enum StatementType { Unknown = 0, Select = 1, Delete = 2, Update = 4, Insert = 8, Upsert = 4 + 8 }; /* short term strategy: put messages here and use storedProcErrorLookup whenever possible. longer term: combine the lists of messages and have a single lookup table */ const struct { QString constraint; int type; int lookup; // != 0 implies msg is a storedproc lookup key QString msg; } dberrs[] = { // TODO: fill in with appropriate text and uncomment //{ "accnt_accnt_company_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "accnt_accnt_company_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "accnt_accnt_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "accnt_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "accnt_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "addr_addr_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Address already exists with this address number.") }, { "addr_addr_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the address number to an empty value.") }, //{ "apapply_apapply_checkhead_id_fkey",Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "apapply_apapply_vend_id_fkey", Delete, -6, "deleteVendor" }, { "apapply_apapply_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot create an A/P Application for an invalid Vendor.") }, //{ "apapply_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apapply_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apcreditapply_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apcreditapply_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopen_apopen_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopen_apopen_status_notnull", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopen_apopen_status_notnull", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "apopen_apopen_vend_id_fkey", Delete, -5, "deleteVendor" }, { "apopen_apopen_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot create an A/P Open Item for an invalid Vendor.") }, //{ "apopen_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopen_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_taxtype_id_fkey",Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apopentax_taxhist_taxtype_id_fkey",Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apselect_apselect_apopen_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "apselect_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "apselect_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "arapply_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "arapply_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "arcreditapply_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "arcreditapply_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "aropen_aropen_cust_id_fkey", Delete, -5, "deleteCustomer" }, //{ "aropen_aropen_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "aropen_aropen_salesrep_id_fkey", Delete, -3, "deleteSalesRep" }, //{ "aropen_aropen_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropen_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropen_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "aropentax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohist_asohist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohist_asohist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohist_asohist_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohist_asohist_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohist_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohist_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "asohisttax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "atlasmap_atlasmap_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Atlas Map name is required.") }, { "atlasmap_atlasmap_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Atlas Map already exists with this name.") }, { "bankaccnt_bankaccnt_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Bank Account name is required.") }, { "bankaccnt_bankaccnt_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Bank Account already exists with this name.") }, //{ "bankaccnt_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bankaccnt_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bankadj_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bankadj_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "bankadjtype_bankadjtype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Bank Adjustment Type name is required.") }, { "bankadjtype_bankadjtype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Bank Adjustment Type already exists with this name.") }, //{ "bomhead_bomhead_batchsize_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomhead_bomhead_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomhead_bomhead_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomhist_bomhist_char_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomhist_bomhist_char_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_char_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_char_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_issuemethod_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_parent_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_parent_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_subtype_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitem_bomitem_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitemsub_bomitemsub_bomitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitemsub_bomitemsub_bomitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitemsub_bomitemsub_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomitemsub_bomitemsub_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomwork_bomwork_char_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "bomwork_bomwork_char_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "budghead_budghead_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Budget name is required.") }, { "budghead_budghead_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Budget already exists with this name.") }, //{ "budgitem_budgitem_budghead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "budgitem_budgitem_budghead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "budgitem_budgitem_period_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "budgitem_budgitem_period_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "calhead_calhead_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Calendar name is required.") }, { "calhead_calhead_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Calendar already exists with this name.") }, //{ "cashrcpt_bankaccnt_bankaccnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcpt_bankaccnt_bankaccnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cashrcpt_cashrcpt_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Cash Receipt number is required.") }, { "cashrcpt_cashrcpt_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Cash Receipt already exists with this number.") }, //{ "cashrcpt_cust_cust_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcpt_cust_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcpt_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcpt_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptitem_aropen_aropen_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptitem_aropen_aropen_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptitem_cashrcpt_cashrcpt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptitem_cashrcpt_cashrcpt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptmisc_accnt_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptmisc_accnt_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptmisc_cashrcpt_cashrcpt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cashrcptmisc_cashrcpt_cashrcpt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "ccard_ccard_cust_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "The selected Customer cannot be deleted as it has Credit Cards defined for it.") }, //{ "ccard_ccard_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ccbank_ccbank_bankaccnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ccbank_ccbank_bankaccnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ccbank_ccbank_ccard_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ccbank_ccbank_ccard_type_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, { "char_char_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Characteristic name is required.") }, { "char_char_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Characteristic already exists with this name.") }, //{ "charopt_charopt_char_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "charopt_charopt_char_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkhead_checkhead_amount_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkhead_checkhead_bankaccnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkhead_checkhead_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkhead_checkhead_expcat_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkhead_checkhead_recip_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkitem_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkitem_checkitem_apopen_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkitem_checkitem_aropen_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkitem_checkitem_checkhead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "checkitem_checkitem_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "chk_wo_cosmethod", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "chk_wo_cosmethod", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "classcode_classcode_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Class Code is required.") }, { "classcode_classcode_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Class Code already exists with this code.") }, //{ "cmdarg_cmdarg_cmd_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmdarg_cmdarg_cmd_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cmhead_cmhead_cust_id_fkey", Delete, -3, "deleteCustomer" }, //{ "cmhead_cmhead_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmhead_cmhead_freighttaxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmhead_cmhead_freighttaxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cmhead_cmhead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Credit Memo number is required.") }, { "cmhead_cmhead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Credit Memo already exists with this number.") }, //{ "cmhead_cmhead_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmhead_cmhead_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cmhead_cmhead_salesrep_id_fkey", Delete, -3, "deleteSalesRep" }, //{ "cmhead_cmhead_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmhead_cmhead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmhead_cmhead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmhead_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmhead_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmheadtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmhead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmhead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmhead_id_linenumber_unique", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmhead_id_linenumber_unique", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmitem_price_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmitem_price_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmitem_qty_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmitem_qty_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmitem_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitem_cmitem_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cmitemtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cmnttype_cmnttype_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Comment Type name is required.") }, { "cmnttype_cmnttype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Comment Type already exists with this name.") }, //{ "cntct_cntct_addr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cntct_cntct_addr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cntct_cntct_crmacct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot delete a CRM Account with attached Contacts.") }, { "cntct_cntct_crmacct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot attach a Contact to an invalid CRM Account.") }, { "cntct_cntct_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Contact already exists with this number.") }, //{ "cntcteml_cntcteml_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cntcteml_cntcteml_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cntctmrgd_cntctmrgd_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cntctmrgd_cntctmrgd_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cntctsel_cntctsel_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cntctsel_cntctsel_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobill_cobill_invcitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobill_cobill_invcitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobill_cobill_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobill_cobill_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobilltax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_cobmisc_invchead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_cobmisc_invchead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_cobmisc_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_cobmisc_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_cobmisc_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_cobmisc_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisc_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cobmisctax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_billto_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_billto_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_cust_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_misc_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_misc_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cohead_cohead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Sales Order number is required.") }, { "cohead_cohead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Sales Order already exists with this Sales Order number.") }, //{ "cohead_cohead_ophead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_ophead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cohead_cohead_salesrep_id_fkey", Delete, -3, "deleteSalesRep" }, //{ "cohead_cohead_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_shipform_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_shipform_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_shipto_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_shipto_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cohead_cohead_shipto_id_fkey", Delete, -2, "deleteShipto" }, //{ "cohead_cohead_shipto_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_terms_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_terms_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_cohead_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cohead_number_idx", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Sales Order already exists with this Sales Order number.") }, //{ "cohead_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohead_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cohist_cohist_cust_id_fkey", Delete, -2, "deleteCustomer" }, //{ "cohist_cohist_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "cohist_cohist_salesrep_id_fkey", Delete, -3, "deleteSalesRep" }, { "cohist_cohist_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save Sales Order History for an invalid Sales Rep.") }, //{ "cohist_cohist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohist_cohist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohist_cohist_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohist_cohist_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohist_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohist_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cohisttax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_cohead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_cohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_cos_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_cos_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_itemsite_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_itemsite_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_price_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_price_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_qty_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_qty_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_substitute_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_substitute_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "coitem_coitem_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "comment_comment_cmnttype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "comment_comment_cmnttype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_dscrp_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_dscrp_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_gainloss_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_gainloss_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "company_company_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Company Number is required.") }, { "company_company_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Company already exists with this number.") }, //{ "company_company_unrlzgainloss_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_unrlzgainloss_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_yearend_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "company_company_yearend_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "costcat_costcat_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Cost Category code is required.") }, { "costcat_costcat_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Cost Category already exists with this code.") }, { "costelem_costelem_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Cost Element type is required.") }, { "costelem_costelem_type_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Cost Element already exists with this type.") }, //{ "costhist_new_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "costhist_new_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "costhist_old_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "costhist_old_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "costupdate_costupdate_item_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, { "country_country_abbr_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the country abbreviation to an empty string.") }, { "country_country_abbr_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Country already exists with this abbreviation.") }, { "country_country_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the country name to an empty string.") }, { "country_country_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Country already exists with this name.") }, { "crmacct_crmacct_cntct_id_1_fkey", Delete, -1, "deleteContact" }, //{ "crmacct_crmacct_cntct_id_1_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "crmacct_crmacct_cntct_id_2_fkey", Delete, -1, "deleteContact" }, //{ "crmacct_crmacct_cntct_id_2_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "crmacct_crmacct_cust_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot delete the CRM Account since it is still associated with a Customer.") }, { "crmacct_crmacct_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the CRM Account to an invalid Customer.") }, { "crmacct_crmacct_emp_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the CRM Account to an invalid Employee.") }, { "crmacct_crmacct_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The CRM Account number is required.") }, { "crmacct_crmacct_number_key", Upsert, -1, "createCrmAcct" }, { "crmacct_crmacct_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "The delete the CRM Account because it is the parent of another CRM Account.") }, { "crmacct_crmacct_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save a CRM Account with an invalid parent CRM Account.") }, { "crmacct_crmacct_prospect_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot delete the CRM Account since it is still associated with a Prospect.") }, { "crmacct_crmacct_prospect_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the CRM Account to an invalid Prospect.") }, { "crmacct_crmacct_salesrep_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "The Sales Rep cannot be deleted as s/he is still associated with a CRM Account.") }, { "crmacct_crmacct_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the CRM Account to an invalid Sales Rep.") }, { "crmacct_crmacct_taxauth_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the CRM Account to an invalid Tax Authority.") }, //{ "crmacct_crmacct_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "crmacct_crmacct_usr_username_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "crmacct_crmacct_vend_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot delete the CRM Account since it is still associated with a Vendor.") }, { "crmacct_crmacct_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot set the CRM Account to an invalid Vendor.") }, //{ "crmacct_owner_username_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "curr_rate_curr_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "curr_rate_curr_rate_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "curr_rate_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "curr_rate_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "curr_symbol_curr_abbr_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "curr_symbol_curr_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "cust_creditlmt_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cust_creditlmt_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cust_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "cust_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "custgrp_custgrp_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Customer Group name is required.") }, { "custgrp_custgrp_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Customer Gropu already exists with this name.") }, //{ "custinfo_balmethod_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_creditstatus_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "custinfo_cust_cntct_id_fkey", Delete, -2, "deleteContact" }, //{ "custinfo_cust_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "custinfo_cust_corrcntct_id_fkey", Delete, -2, "deleteContact" }, //{ "custinfo_cust_corrcntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_cust_custtype_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_cust_custtype_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "custinfo_cust_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Customer number is required.") }, { "custinfo_cust_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Customer already exists with this number.") }, { "custinfo_cust_salesrep_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save the Customer with an invalid Sales Rep." ) }, //{ "custinfo_cust_shipform_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_cust_shipform_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_cust_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_cust_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_cust_terms_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "custinfo_cust_terms_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "custtype_custtype_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Customer Type code is required.") }, { "custtype_custtype_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Customer Type already exists with this code.") }, { "dept_dept_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Department number is required.") }, { "dept_dept_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Department already exists with this number.") }, //{ "docass_docass_purpose_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "emp_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Employee Type is invalid.") }, { "emp_emp_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "This Contact cannot be deleted as s/he is the Contact for an Employee.") }, { "emp_emp_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "This Employee cannot be connected to what seems to be a non-existent Contact.") }, { "emp_emp_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Employee code is required.") }, { "emp_emp_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Employee already exists with this code.") }, //{ "emp_emp_dept_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_dept_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_image_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_image_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_mgr_emp_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_mgr_emp_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "emp_emp_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Employee number is required.") }, { "emp_emp_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Employee already exists with this Employee Number.") }, //{ "emp_emp_shift_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_shift_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_wage_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_wage_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "emp_emp_wage_period_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The selected Employee Wage Period is invalid.") }, //{ "emp_emp_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "emp_emp_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "empgrp_empgrp_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Employee Group name is required.") }, { "empgrp_empgrp_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Employee Group already exists with this name.") }, //{ "empgrpitem_empgrpitem_emp_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "empgrpitem_empgrpitem_emp_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "empgrpitem_empgrpitem_empgrp_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "empgrpitem_empgrpitem_empgrp_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "evnttype_evnttype_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Event Type name is required.") }, { "evnttype_evnttype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Event Type already exists with this name.") }, { "expcat_expcat_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Expense Category code is required.") }, { "expcat_expcat_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Expense Category already exists with this code.") }, //{ "fkey_flcol_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, { "flhead_flhead_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Financial Report name is required.") }, { "flhead_flhead_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Financial Report already exists with this name.") }, //{ "flnotes_flnotes_flhead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "flnotes_flnotes_flhead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "flnotes_flnotes_flhead_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "flnotes_flnotes_period_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "flnotes_flnotes_period_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "form_form_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Form name is required.") }, { "form_form_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Form already exists with this name.") }, { "freightclass_freightclass_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Freight Class code is required.") }, { "freightclass_freightclass_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Freight Class already exists with this code.") }, //{ "gltranssync_gltranssync_company_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "gltranssync_gltranssync_company_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "gltranssync_gltranssync_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "gltranssync_gltranssync_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "gltranssync_gltranssync_period_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "gltranssync_gltranssync_period_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "grp_grp_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Group name is required.") }, { "grp_grp_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Group already exists with this name.") }, //{ "grppriv_grppriv_grp_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "grppriv_grppriv_grp_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "hnfc_hnfc_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Honorific (Title) code is required.") }, { "hnfc_hnfc_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Honorific (Title) already exists with this code.") }, { "image_image_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Image name is required.") }, { "image_image_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Image already exists with this name.") }, //{ "imageass_imageass_image_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "imageass_imageass_image_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "imageass_imageass_purpose_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_aropen_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_aropen_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "incdt_incdt_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "This Contact cannot be deleted as s/he is the Contact for an Incident.") }, //{ "incdt_incdt_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "incdt_incdt_crmacct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("ErrorReporter", "The selected CRM Account cannot be deleted as it has related Incidents.") }, { "incdt_incdt_crmacct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save the Incident with an invalid CRM Account.") }, //{ "incdt_incdt_incdtcat_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_incdtcat_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_incdtpriority_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_incdtpriority_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_incdtresolution_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_incdtresolution_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_incdtseverity_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_incdtseverity_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "incdt_incdt_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_recurring_incdt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdt_incdt_recurring_incdt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "incdtcat_incdtcat_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Incident Category name is required.") }, { "incdtcat_incdtcat_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Incident Category already exists with this name.") }, //{ "incdthist_incdthist_incdt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "incdthist_incdthist_incdt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "incdtpriority_incdtpriority_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Incident Priority name is required.") }, { "incdtpriority_incdtpriority_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Incident Priority already exists with this name.") }, { "incdtresolution_incdtresolution_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Incident Resolution name is required.") }, { "incdtresolution_incdtresolution_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Incident Resolution already exists with this name.") }, { "incdtseverity_incdtseverity_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Incident Severity name is required.") }, { "incdtseverity_incdtseverity_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Incident Severity already exists with this name.") }, //{ "invchead_invchead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invchead_invchead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "invchead_invchead_invcnumber_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Invoice number is required.") }, { "invchead_invcnumber_unique", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Invoice already exists with this number.") }, //{ "invchead_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invchead_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcheadtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invchead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invchead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invchead_id_linenumber_unique", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invchead_id_linenumber_unique", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invcitem_price_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invcitem_price_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invcitem_qty_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invcitem_qty_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invcitem_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitem_invcitem_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invcitemtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invdetail_invdetail_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "invdetail_invdetail_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsass_ipsass_ipshead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsass_ipsass_ipshead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsass_ipsass_ipshead_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "ipsfreight_ipsfreight_freightclass_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsfreight_ipsfreight_freightclass_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsfreight_ipsfreight_ipshead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsfreight_ipsfreight_ipshead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsfreight_ipsfreight_shipzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsfreight_ipsfreight_shipzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsfreight_ipsfreight_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsfreight_ipsfreight_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "ipshead_ipshead_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Pricing Schedule name is required.") }, { "ipshead_ipshead_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Pricing Schedule already exists with this name.") }, //{ "ipshead_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipshead_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_ipshead_id_fk", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_ipshead_id_fk", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_ipsitem_ipshead_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "ipsitem_ipsitem_price_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_ipsitem_price_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_ipsitem_qty_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_ipsitem_qty_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_item_id_fk", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitem_item_id_fk", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitemchar_ipsitemchar_char_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitemchar_ipsitemchar_char_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitemchar_ipsitemchar_ipsitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitemchar_ipsitemchar_ipsitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ipsitemchar_ipsitemchar_ipsitem_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "ipsitemchar_ipsitemchar_ipsitem_id_key1", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "ipsitemchar_ipsitemchar_ipsitem_id_key1", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "item_item_classcode_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_item_classcode_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_item_freightclass_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_item_freightclass_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_item_inv_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_item_inv_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "item_item_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Item number is required.") }, { "item_item_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Item already exists with this number.") }, //{ "item_item_price_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_item_price_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_item_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "item_sold_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemalias_itemalias_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemalias_itemalias_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "itemalias_itemalias_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Item Alias number is required.") }, { "itemalias_itemalias_item_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Item Alias with this number already exists with this item.") }, //{ "itemcost_itemcost_costelem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemcost_itemcost_costelem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemcost_itemcost_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemcost_itemcost_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemcost_itemcost_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemcost_itemcost_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemcost_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemcost_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "itemgrp_itemgrp_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Item Group name is required.") }, { "itemgrp_itemgrp_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Item Group already exists with this name.") }, //{ "itemloc_itemloc_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemloc_itemloc_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemlocdist_itemlocdist_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemlocdist_itemlocdist_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemlocrsrv_itemlocrsrv_itemloc_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemlocrsrv_itemlocrsrv_itemloc_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_abcclass_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_controlmethod_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_costcat_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_costcat_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_costmethod_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_ordergroup_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_plancode_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_plancode_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsite_itemsite_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrc_itemsrc_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrc_itemsrc_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrc_itemsrc_vend_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrc_itemsrc_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrc_itemsrc_vend_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "itemsrcp_itemsrcp_itemsrc_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrcp_itemsrcp_itemsrc_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrcp_itemsrcp_itemsrc_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "itemsrcp_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsrcp_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsub_itemsub_parent_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsub_itemsub_parent_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsub_itemsub_parent_item_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "itemsub_itemsub_sub_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemsub_itemsub_sub_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtax_itemtax_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtax_itemtax_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtax_itemtax_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtax_itemtax_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtax_itemtax_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtax_itemtax_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtrans_itemtrans_source_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtrans_itemtrans_source_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtrans_itemtrans_source_item_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "itemtrans_itemtrans_target_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemtrans_itemtrans_target_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuom_itemuom_itemuomconv_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuom_itemuom_itemuomconv_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuom_itemuom_uomtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuom_itemuom_uomtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_itemuomconv_from_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_itemuomconv_from_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_itemuomconv_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_itemuomconv_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_itemuomconv_to_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_itemuomconv_to_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_uom", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "itemuomconv_uom", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "labelform_labelform_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Label Form name is required.") }, { "labelform_labelform_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Label Form already exists with this name.") }, { "locale_locale_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Locale code is required.") }, { "locale_locale_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Locale already exists with this code.") }, //{ "ls_ls_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ls_ls_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ls_ls_item_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "lsdetail_lsdetail_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsdetail_lsdetail_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_cohead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_cohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_crmacct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_crmacct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "lsreg_lsreg_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Registration number is required.") }, { "lsreg_lsreg_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Registration already exists with this number.") }, //{ "lsreg_lsreg_regtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_regtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_shiphead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lsreg_lsreg_shiphead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "lsseq_lsseq_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Lot/Serial Sequence number is required.") }, { "lsseq_lsseq_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Lot/Serial Sequence already exists with this number.") }, //{ "lsseq_lsseq_seqlen_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lswarr_lswarr_crmacct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lswarr_lswarr_crmacct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lswarr_lswarr_regtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "lswarr_lswarr_regtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "metric_metric_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Metric name is required.") }, { "metric_metric_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Metric already exists with this name.") }, { "metricenc_metricenc_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Encrypted Metric name is required.") }, { "metricenc_metricenc_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Encrypted Metric already exists with this name.") }, //{ "metasql_metasql_group_name_grade_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "mrghist_mrghist_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "mrghist_mrghist_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "mrgundo_mrgundo_schema_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "There is a merge in progress that overlaps with this one. Either complete all merges in progress, delete merge history, or both.") }, //{ "ophead_ophead_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_crmacct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_crmacct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "ophead_ophead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Opportunity number is required.") }, { "ophead_ophead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Opportunity already exists with this number.") }, //{ "ophead_ophead_opsource_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_opsource_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_opstage_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_opstage_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_optype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_optype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_priority_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "ophead_ophead_priority_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "opsource_opsource_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Opportunity Source name is required.") }, { "opsource_opsource_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Opportunity Source already exists with this name.") }, { "opstage_opstage_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Opportunity Stage name is required.") }, { "opstage_opstage_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Opportunity Stage already exists with this name.") }, { "optype_optype_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Opportunity Type name is required.") }, { "optype_optype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Opportunity Type already exists with this name.") }, { "orderseq_orderseq_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Order Sequence name is required.") }, { "orderseq_orderseq_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An Order Sequence already exists with this name.") }, //{ "pack_pack_head_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pack_pack_shiphead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pack_pack_shiphead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "payco_payco_ccpay_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "payco_payco_ccpay_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "payco_payco_cohead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "payco_payco_cohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pkgdep_pkgdep_parent_pkghead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pkgdep_pkgdep_parent_pkghead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pkgdep_pkgdep_pkghead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pkgdep_pkgdep_pkghead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "pkghead_pkghead_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Package name is required.") }, { "pkghead_pkghead_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Package already exists with this name.") }, //{ "pkgitem_pkgitem_pkghead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pkgitem_pkgitem_pkghead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pkgitem_pkgitem_pkghead_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "pkgitem_pkgitem_pkghead_id_key1", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "pkgitem_pkgitem_pkghead_id_key1", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "pkgitem_pkgitem_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "plancode_plancode_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Planner Code code is required.") }, { "plancode_plancode_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Planner Code already exists with this code.") }, //{ "planord_planord_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, { "pohead_pohead_cohead_id_fkey", Delete,-10, "deleteSO" }, //{ "pohead_pohead_cohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "pohead_pohead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Purchase Order number is required.") }, { "pohead_pohead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Purchase Order already exists with this number.") }, //{ "pohead_pohead_shipto_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_shipto_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_shiptoddress_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_shiptoddress_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_terms_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_terms_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_vend_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_vend_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "pohead_pohead_vend_id_fkey", Delete, -1, "deleteVendor" }, { "pohead_pohead_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save the Purchase Order with an invalid Vendor.") }, //{ "pohead_pohead_vendaddr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_vendaddr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_pohead_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "pohead_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_expcat_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_expcat_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_itemsite_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_itemsite_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_itemsrc_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_itemsrc_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_pohead_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "poitem_poitem_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_order_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "poitem_poitem_order_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "poreject_poreject_vend_id_fkey", Delete, -3, "deleteVendor" }, { "poreject_poreject_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save this P/O Return with an invalid Vendor.") }, { "prftcntr_prftcntr_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Profit Center number is required.") }, { "prftcntr_prftcntr_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Profit Center already exists with this number.") }, { "priv_priv_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Privilege name is required.") }, { "priv_priv_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Privilege already exists with this name.") }, { "prj_prj_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Project number is required.") }, { "prj_prj_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Project already exists with this number.") }, //{ "prj_prj_recurring_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prj_prj_recurring_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prj_prj_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prjtask_prjtask_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prjtask_prjtask_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prjtask_prjtask_prj_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "prjtask_prjtask_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "prodcat_prodcat_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Product Category code is required.") }, { "prodcat_prodcat_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Product Category already exists with this code.") }, //{ "prospect_prospect_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prospect_prospect_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "prospect_prospect_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Prospect number is required.") }, { "prospect_prospect_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Prospect already exists with this number.") }, { "prospect_prospect_salesrep_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "The Sales Rep cannot be deleted as s/he is still assigned to one or more Prospects.") }, //{ "prospect_prospect_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prospect_prospect_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prospect_prospect_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prospect_prospect_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "prospect_prospect_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "qryhead_qryhead_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Query Head name is required.") }, { "qryhead_qryhead_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Query Head already exists with this name.") }, //{ "qryitem_qryitem_detail_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "qryitem_qryitem_qryhead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "qryitem_qryitem_qryhead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "qryitem_qryitem_qryhead_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "qryitem_qryitem_qryhead_id_key1", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "qryitem_qryitem_qryhead_id_key1", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "qryitem_qryitem_src_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "quhead_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Miscellaneous Account and Miscellaneous Amount must either both be set or neither can be set when saving a Quote.") }, //{ "quhead_quhead_billto_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_billto_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_misc_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_misc_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "quhead_quhead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Quote number is required.") }, { "quhead_quhead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Quote already exists with this number.") }, //{ "quhead_quhead_ophead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_ophead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "quhead_quhead_salesrep_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "The Sales Rep cannot be deleted as s/he is still associated with one or more Quotes.") }, //{ "quhead_quhead_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_shipto_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_shipto_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "quhead_quhead_shipto_id_fkey", Delete, -5, "deleteShipto" }, //{ "quhead_quhead_shipto_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_terms_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_terms_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_quhead_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quhead_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_itemsrc_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_itemsrc_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_price_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_price_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_qty_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_qty_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "quitem_quitem_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_creditmethod_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_cust_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_disposition_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_incdt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_incdt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_misc_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_misc_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "rahead_rahead_new_cohead_id_fkey", Delete, -103, "deleteSO" }, //{ "rahead_rahead_new_cohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "rahead_rahead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Return Authorization number is required.") }, { "rahead_rahead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Return Authorization already exists with this number.") }, { "rahead_rahead_orig_cohead_id_fkey", Delete, -103, "deleteSO" }, //{ "rahead_rahead_orig_cohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_rsncode_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_rsncode_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "rahead_rahead_salesrep_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "The Sales Rep cannot be deleted as s/he is still associated with one or more Return Authorizations.") }, //{ "rahead_rahead_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_shipto_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_shipto_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahead_rahead_timing_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahist_rahist_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahist_rahist_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahist_rahist_itemsite_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahist_rahist_itemsite_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahist_rahist_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "rahist_rahist_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_coitem_itemsite_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_coitem_itemsite_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_cos_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_cos_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_disposition_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_itemsite_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_itemsite_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_new_coitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_new_coitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_orig_coitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_orig_coitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_price_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_price_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_qty_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_qty_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_rahead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_rahead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_rsncode_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_rsncode_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitem_raitem_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitemls_raitemls_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitemls_raitemls_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitemls_raitemls_raitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitemls_raitemls_raitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "raitemls_raitemls_raitem_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "recur_recur_parent_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "recur_recur_period_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recurtype_recurtype_type_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "recv_recv_freight_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_freight_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_itemsite_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_itemsite_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_order_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_purchcost_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_purchcost_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_recvcost_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_recvcost_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_splitfrom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_splitfrom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "recv_recv_vend_id_fkey", Delete, -2, "deleteVendor" }, { "recv_recv_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot receive materials from an invalid Vendor.") }, //{ "recv_recv_vohead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_vohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_voitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "recv_recv_voitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "regtype_regtype_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Registration Type code is required.") }, { "regtype_regtype_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Registration Type already exists with this code.") }, //{ "rev_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "rev_rev_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Revision number is required.") }, { "rev_rev_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Revision with this number already exists for this object.") }, { "rjctcode_rjctcode_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Rejection code is required.") }, { "rjctcode_rjctcode_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Rejection Code already exists with this code.") }, { "rsncode_rsncode_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Reason code is required.") }, { "rsncode_rsncode_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Reason Code already exists with this code.") }, { "sale_sale_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Sale name is required.") }, { "sale_sale_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Sale name already exists with this name.") }, { "salescat_salescat_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorcatorter", "The Sales Category number is required.") }, { "salescat_salescat_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorcatorter", "A Sales Category already exists with this number.") }, { "salesrep_salesrep_emp_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot delete this Sales Rep as it is associated with an Employee.") }, //{ "salesrep_salesrep_emp_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "salesrep_salesrep_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Sales Rep number is required.") }, { "salesrep_salesrep_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save this Sales Rep as there is another Sales Rep with this number.") }, { "schemaord_schemaord_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Schema name is required.") }, { "schemaord_schemaord_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Schema Order record already exists with this name.") }, { "schemaord_schemaord_order_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Schema Order record already exists with this order number.") }, //{ "scprp_scprp_screc_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "scprp_scprp_screc_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_create_priv_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_create_priv_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_delete_priv_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_delete_priv_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_edit_priv_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_edit_priv_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_view_priv_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screc_screc_view_priv_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screl_screl_screc_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screl_screl_screc_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screl_screl_screc_rel_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "screl_screl_screc_rel_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "shift_shift_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Shift number is required.") }, { "shift_shift_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Shift already exists with this number.") }, { "shipchrg_shipchrg_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Shipping Charge name is required.") }, { "shipchrg_shipchrg_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Shipping Charge already exists with this name.") }, //{ "shipdata_shipdata_base_freight_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdata_shipdata_base_freight_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdata_shipdata_shiphead_number_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdata_shipdata_shiphead_number_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdata_shipdata_total_freight_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdata_shipdata_total_freight_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdatasum_shipdatasum_base_freight_curr_id_fkey",Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdatasum_shipdatasum_base_freight_curr_id_fkey",Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdatasum_shipdatasum_shiphead_number_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdatasum_shipdatasum_shiphead_number_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdatasum_shipdatasum_total_freight_curr_id_fkey",Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipdatasum_shipdatasum_total_freight_curr_id_fkey",Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "shipform_shipform_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Shipping Form name is required.") }, { "shipform_shipform_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Shipping Form already exists with this name.") }, //{ "shiphead_shiphead_freight_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiphead_shiphead_freight_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "shiphead_shiphead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Shipment number is required.") }, { "shiphead_shiphead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Shipment already exists with this number.") }, //{ "shiphead_shiphead_order_type_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiphead_shiphead_sfstatus_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiphead_shiphead_shipchrg_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiphead_shiphead_shipchrg_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiphead_shiphead_shipform_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiphead_shiphead_shipform_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitem_shipitem_invcitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitem_shipitem_invcitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitem_shipitem_invhist_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitem_shipitem_invhist_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitem_shipitem_shiphead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitem_shipitem_shiphead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_itemsite_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_itemsite_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_location_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_location_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_ls_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_ls_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_shipitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemlocrsrv_shipitemlocrsrv_shipitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemrsrv_shipitemrsrv_shipitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipitemrsrv_shipitemrsrv_shipitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipto_num_cust_unique", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shipto_num_cust_unique", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_addr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_addr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "shiptoinfo_shipto_cntct_id_fkey", Delete, -4, "deleteContact" }, //{ "shiptoinfo_shipto_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "shiptoinfo_shipto_cust_id_fkey", Delete, -1, "deleteCustomer" }, { "shiptoinfo_shipto_cust_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save this Ship-To with an invalid Customer.") }, { "shiptoinfo_shipto_salesrep_fkey", Delete, -2, "deleteSalesRep" }, { "shiptoinfo_shipto_salesrep_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save this Ship-To with an invalid Sales Rep.") }, { "shiptoinfo_shipto_salesrep_id_fkey", Delete, -2, "deleteSalesRep" }, { "shiptoinfo_shipto_salesrep_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save this Ship-To with an invalid Sales Rep.") }, //{ "shiptoinfo_shipto_shipform_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_shipform_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_shipform_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_shipform_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_shipzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_shipzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "shiptoinfo_shipto_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "shipvia_shipvia_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Ship-Via code is required.") }, { "shipvia_shipvia_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Ship-Via already exists with this code.") }, { "shipzone_shipzone_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Shipping Zone name is required.") }, { "shipzone_shipzone_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Shipping Zone already exists with this name.") }, { "sitetype_sitetype_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Site Type name is required.") }, { "sitetype_sitetype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Site Type already exists with this name.") }, { "source_source_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Source name is required.") }, { "source_source_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Source already exists with this name.") }, //{ "state_state_country_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "state_state_country_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "state_state_country_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A State with this name already exists for this Country.") }, { "state_state_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The State name is required.") }, //{ "status_status_type_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, { "stdjrnl_stdjrnl_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Standard Journal name is required.") }, { "stdjrnl_stdjrnl_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Standard Journal already exists with this name.") }, { "stdjrnlgrp_stdjrnlgrp_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Standard Journal Group name is required.") }, { "stdjrnlgrp_stdjrnlgrp_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Standard Journal Group already exists with this name.") }, { "subaccnt_subaccnt_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Subaccount number is required.") }, { "subaccnt_subaccnt_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Subaccount already exists with this number.") }, //{ "tax_tax_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tax_tax_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tax_tax_sales_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tax_tax_sales_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "tax_tax_taxauth_id_fkey", Delete, -1, "deleteTaxAuthority" }, { "tax_tax_taxauth_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save this Tax Code with an invalid Tax Authority.") }, //{ "tax_tax_taxclass_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tax_tax_taxclass_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxass_taxass_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxass_taxass_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxass_taxass_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxass_taxass_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxass_taxass_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxass_taxass_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxass_taxass_taxzone_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "taxauth_taxauth_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxauth_taxauth_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxauth_taxauth_addr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxauth_taxauth_addr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxauth_taxauth_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "taxauth_taxauth_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxauth_taxauth_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "taxauth_taxauth_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Tax Authority code is required.") }, { "taxauth_taxauth_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Tax Authority already exists with this code.") }, { "taxclass_taxclass_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Tax Class code is required.") }, { "taxclass_taxclass_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Tax Class already exists with this code.") }, //{ "taxhist_taxhist_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxhist_taxhist_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxhist_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxhist_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxhist_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxhist_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxrate_taxrate_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxrate_taxrate_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxrate_taxrate_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxrate_taxrate_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "taxreg_taxreg_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Tax Registration number is required.") }, { "taxreg_taxreg_taxauth_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot delete this Tax Authority as there are still Tax Registrations associated with it.") }, //{ "taxreg_taxreg_taxauth_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxreg_taxreg_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "taxreg_taxreg_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "taxtype_taxtype_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Tax Type name is required.") }, { "taxtype_taxtype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Tax Type already exists with this name.") }, { "taxzone_taxzone_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Tax Zone code is required.") }, { "taxzone_taxzone_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Tax Zone already exists with this code.") }, { "terms_terms_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Terms code is required.") }, { "terms_terms_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Terms already exists with this code.") }, //{ "todoitem_todoitem_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "todoitem_todoitem_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "todoitem_todoitem_crmacct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "The selected CRM Account cannot be deleted as it has To-Do Items.") }, //{ "todoitem_todoitem_crmacct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "todoitem_todoitem_incdt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "todoitem_todoitem_incdt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "todoitem_todoitem_ophead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "todoitem_todoitem_ophead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "todoitem_todoitem_recurring_todoitem_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "todoitem_todoitem_recurring_todoitem_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_dest_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_dest_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_destcntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_destcntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_freight_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_freight_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "tohead_tohead_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Transfer Order number is required.") }, { "tohead_tohead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Transfer Order already exists with this number.") }, //{ "tohead_tohead_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_shipchrg_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_shipchrg_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_shipform_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_shipform_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_src_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_src_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_srccntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_srccntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_trns_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "tohead_tohead_trns_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toheadtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_freight_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_freight_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_item_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_item_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_prj_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_prj_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_status_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_tohead_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitem_toitem_tohead_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "toitemtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "trgthist_trgthist_src_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "trgthist_trgthist_src_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "trgthist_trgthist_trgt_cntct_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "trgthist_trgthist_trgt_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "trialbalsync_trialbal_period_id_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "trialbalsync_trialbalsync_curr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "trialbalsync_trialbalsync_curr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "uom_uom_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The UOM name is required.") }, { "uom_uom_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A UOM already exists with this name.") }, //{ "uomconv_uomconv_from_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "uomconv_uomconv_from_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "uomconv_uomconv_to_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "uomconv_uomconv_to_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "uomtype_uomtype_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The UOM Type name is required.") }, { "uomtype_uomtype_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A UOM Type already exists with this name.") }, //{ "usr_usr_username_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "usrgrp_usrgrp_grp_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "usrgrp_usrgrp_grp_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "usrsite_usrsite_warehous_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "usrsite_usrsite_warehous_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vend_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vend_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendaddrinfo_vendaddr_addr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendaddrinfo_vendaddr_addr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "vendaddrinfo_vendaddr_cntct_id_fkey", Delete, -5, "deleteContact" }, //{ "vendaddrinfo_vendaddr_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendaddrinfo_vendaddr_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendaddrinfo_vendaddr_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendinfo_vend_ach_accnttype_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendinfo_vend_addr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendinfo_vend_addr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "vendinfo_vend_cntct1_id_fkey", Delete, -3, "deleteContact" }, //{ "vendinfo_vend_cntct1_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "vendinfo_vend_cntct2_id_fkey", Delete, -3, "deleteContact" }, //{ "vendinfo_vend_cntct2_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "vendinfo_vend_number_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Vendor Number is required.") }, { "vendinfo_vend_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "This Vendor Number cannot be used as it is in use by another Vendor.") }, //{ "vendinfo_vend_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendinfo_vend_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendinfo_vend_vendtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vendinfo_vend_vendtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "vendtype_vendtype_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Vendor Type code is required.") }, { "vendtype_vendtype_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Vendor Type already exists with this code.") }, //{ "vohead_to_curr_symbol", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_to_curr_symbol", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_adjtaxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_adjtaxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_freighttaxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_freighttaxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_number_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A XXX already exists with this XXX.") }, //{ "vohead_vohead_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "vohead_vohead_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "vohead_vohead_vend_id_fkey", Delete, -4, "deleteVendor" }, { "vohead_vohead_vend_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "Cannot save this Voucher with an invalid Vendor.") }, //{ "voheadtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voheadtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voheadtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voheadtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voheadtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voheadtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voheadtax_taxhist_taxtype_id_fkey" Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voheadtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitem_voitem_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitem_voitem_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_basis_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_basis_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_parent_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_parent_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_tax_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_tax_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_taxtype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "voitemtax_taxhist_taxtype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_accnt_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_accnt_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_addr_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_addr_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "whsinfo_warehous_cntct_id_fkey", Delete, -6, "deleteContact" }, //{ "whsinfo_warehous_cntct_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "whsinfo_warehous_code_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The Site code is required.") }, { "whsinfo_warehous_code_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "A Site already exists with this code.") }, //{ "whsinfo_warehous_costcat_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_costcat_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_shipform_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_shipform_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_shipvia_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_shipvia_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_sitetype_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_sitetype_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_taxzone_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "whsinfo_warehous_taxzone_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "wo_wo_womatl_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "wo_wo_womatl_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "womatl_womatl_uom_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "womatl_womatl_uom_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "womatlpost_womatlpost_invhist_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "womatlpost_womatlpost_invhist_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "womatlpost_womatlpost_womatl_id_fkey", Delete, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "womatlpost_womatlpost_womatl_id_fkey", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "xsltmap_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, { "xsltmap_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "The XSLT Map name is required.") }, { "xsltmap_name_key", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "An XSLT Map already exists with this name.") }, //{ "xsltmap_xsltmap_importexport_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, //{ "xsltmap_xsltmap_name_check", Upsert, 0, QT_TRANSLATE_NOOP("errorReporter", "") }, }; // TODO: consider using a QAbstractMessageHandler instead of QMessageBox class ErrorReporterPrivate : public QObject { public: ErrorReporterPrivate(ErrorReporter *parent); ~ErrorReporterPrivate(); static QRegExp _xtupleError; QString text(QSqlError err, StatementType); QString text(QString err, StatementType); private: ErrorReporter *_parent; }; ErrorReporterPrivate::ErrorReporterPrivate(ErrorReporter *parent) : QObject(parent) { _parent = parent; } ErrorReporterPrivate::~ErrorReporterPrivate() { } /* look for [xtuple: majorkey, minorkey [, context [, ...] ] ] in first pass, majorkey is the stored proc name and minorkey is the old negative return code indicating an error one or more context values that can be inserted in the message once the messages are expanded appropriately */ QRegExp ErrorReporterPrivate::_xtupleError( // "\\[\\s*xtuple\\s*:\\s*([^, ]+)\\s*,\\s*([^, \\]])\\s*(\\[^\\]]*)\\]" "\\[\\s*xtuple:\\s*([^, ]+),\\s*([^, \\]]+)(.*)\\]" ); QString ErrorReporterPrivate::text(QSqlError err, StatementType type) { return text(err.text(), type); } // TODO: find a better way to handle the lookups - binary search or hash table QString ErrorReporterPrivate::text(QString msg, StatementType type) { if (msg.isEmpty()) return msg; if (_xtupleError.indexIn(msg) >= 0) { if (_xtupleError.cap(3).length() > 0) qWarning("ErrorReporterPrivate::text() found %d captures for error: %s", _xtupleError.captureCount(), qPrintable(_xtupleError.cap(3))); return storedProcErrorLookup(_xtupleError.cap(1), _xtupleError.cap(2).toInt()); } else { for (unsigned int i = 0; i < sizeof(dberrs) / sizeof(dberrs[0]); i++) { if (dberrs[i].type & type && msg.contains(dberrs[i].constraint)) { if (dberrs[i].lookup) return storedProcErrorLookup(dberrs[i].msg, dberrs[i].lookup); else if (! dberrs[i].msg.isEmpty()) return dberrs[i].msg; } } } return msg; } /////////////////////////////////////////////////////////////////////////// ErrorReporter *ErrorReporter::_singleton = 0; ErrorReporter *ErrorReporter::reporter() { if (! _singleton) _singleton = new ErrorReporter(QApplication::instance()); return _singleton; } ErrorReporter::ErrorReporter(QObject *parent) : QObject(parent) { _private = new ErrorReporterPrivate(this); } ErrorReporter::~ErrorReporter() { } bool ErrorReporter::error(const QString &err, const QString file, int line) { if (err.isEmpty()) return false; return error(QtCriticalMsg, 0, tr("Error"), err, QString(), file, line); } bool ErrorReporter::error(QtMsgType type, QWidget *parent, const QString title, const QSqlError &err, const QString file, int line) { if (err.type() == QSqlError::NoError) return false; return error(type, parent, title, QString(), reporter()->_private->text(err, Unknown), file, line); } bool ErrorReporter::error(QtMsgType type, QWidget *parent, const QString title, const QString &userMessage, const QSqlError &err, const QString file, int line) { if (err.type() == QSqlError::NoError) return false; return error(type, parent, title, userMessage, reporter()->_private->text(err, Unknown), file, line); } bool ErrorReporter::error(QtMsgType type, QWidget *parent, const QString title, const QSqlQuery &qry, const QString file, int line) { return error(type, parent, title, QString(), qry, file, line); } bool ErrorReporter::error(QtMsgType type, QWidget *parent, const QString title, const QString &userMessage, const QSqlQuery &qry, const QString file, int line) { if (qry.lastError().type() == QSqlError::NoError) return false; QMessageBox::Icon icon; switch (type) { case QtDebugMsg: icon = QMessageBox::Information; break; case QtWarningMsg: icon = QMessageBox::Warning; break; case QtCriticalMsg: case QtFatalMsg: default: icon = QMessageBox::Critical; break; } StatementType stmttype = Unknown; QString querystr = qry.lastQuery(); if (querystr.startsWith("SELECT", Qt::CaseInsensitive)) stmttype = Select; else if (querystr.startsWith("DELETE", Qt::CaseInsensitive)) stmttype = Delete; else if (querystr.startsWith("UPDATE", Qt::CaseInsensitive)) stmttype = Update; else if (querystr.startsWith("INSERT", Qt::CaseInsensitive)) stmttype = Insert; QMessageBox dlg(icon, title, userMessage, QMessageBox::Ok, parent); if (! file.isEmpty()) { if (line >= 0) dlg.setInformativeText(tr("File %1, line %2").arg(file).arg(line)); else dlg.setInformativeText(tr("File %1").arg(file)); } QStringList bindings; QMapIterator i(qry.boundValues()); while (i.hasNext()) { i.next(); bindings << QString("%1:\t%2").arg(i.key(), i.value().toString()); } if (userMessage.isEmpty()) dlg.setText(reporter()->_private->text(qry.lastError().text(), stmttype)); dlg.setDetailedText(QString("%1\n\nThe Query:\n%2\n\nBound Values:\n%3") .arg(qry.lastError().text(), querystr, bindings.join("\n"))); dlg.exec(); return true; } bool ErrorReporter::error(QtMsgType type, QWidget *parent, const QString title, const QString &err, const QString file, int line) { return error(type, parent, title, QString(), err, file, line); } bool ErrorReporter::error(QtMsgType type, QWidget *parent, const QString title, const QString &userMessage, const QString &err, const QString file, int line) { if (err.isEmpty()) return false; QMessageBox::Icon icon; switch (type) { case QtDebugMsg: icon = QMessageBox::Information; break; case QtWarningMsg: icon = QMessageBox::Warning; break; case QtCriticalMsg: case QtFatalMsg: default: icon = QMessageBox::Critical; break; } QMessageBox dlg(icon, title, userMessage, QMessageBox::Ok, parent); if (! file.isEmpty()) { if (line >= 0) dlg.setInformativeText(tr("File %1, line %2").arg(file).arg(line)); else dlg.setInformativeText(tr("File %1").arg(file)); } if (userMessage.isEmpty()) dlg.setText(err); else dlg.setDetailedText(err); dlg.exec(); return true; } qt-client-4.1.0/common/errorReporter.h000066400000000000000000000034511217451700100177320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include class ErrorReporterPrivate; class QWidget; class ErrorReporter : public QObject { Q_OBJECT public: static bool error(const QString &err, const QString file = QString(), int line = -1); static bool error(QtMsgType type, QWidget *parent, const QString title, const QString &err, const QString file = QString(), int line = -1); static bool error(QtMsgType type, QWidget *parent, const QString title, const QString &userMessage, const QString &err, const QString file, int line); static bool error(QtMsgType type, QWidget *parent, const QString title, const QSqlError &err, const QString file = QString(), int line = -1); static bool error(QtMsgType type, QWidget *parent, const QString title, const QString &userMessage, const QSqlError &err, const QString file = QString(), int line = -1); static bool error(QtMsgType type, QWidget *parent, const QString title, const QSqlQuery &qry, const QString file = QString(), int line = -1); static bool error(QtMsgType type, QWidget *parent, const QString title, const QString &userMessage, const QSqlQuery &qry, const QString file = QString(), int line = -1); protected: ErrorReporter(QObject *parent = 0); ~ErrorReporter(); static ErrorReporter *reporter(); ErrorReporterPrivate *_private; static ErrorReporter *_singleton; }; qt-client-4.1.0/common/exporthelper.cpp000066400000000000000000000745021217451700100201370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "exporthelper.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "metasql.h" #include "mqlutil.h" #include "xsqlquery.h" #define DEBUG false bool ExportHelper::exportHTML(const int qryheadid, ParameterList ¶ms, QString &filename, QString &errmsg) { if (DEBUG) qDebug("ExportHelper::exportHTML(%d, %d params, %s, errmsg) entered", qryheadid, params.size(), qPrintable(filename)); bool returnVal = false; XSqlQuery setq; setq.prepare("SELECT * FROM qryhead WHERE qryhead_id=:id;"); setq.bindValue(":id", qryheadid); setq.exec(); if (setq.first()) { if (filename.isEmpty()) { QFileInfo fileinfo(setq.value("qryhead_name").toString()); filename = fileinfo.absoluteFilePath(); } QFile *exportfile = new QFile(filename); if (! exportfile->open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) errmsg = tr("Could not open %1: %2.") .arg(filename, exportfile->errorString()); else { if (exportfile->write(generateHTML(qryheadid, params, errmsg).toUtf8()) < 0) errmsg = tr("Error writing to %1: %2") .arg(filename, exportfile->errorString()); exportfile->close(); } } else if (setq.lastError().type() != QSqlError::NoError) errmsg = setq.lastError().text(); else errmsg = tr("

Cannot export data because the query set with " "id %1 was not found.").arg(qryheadid); if (DEBUG) qDebug("ExportHelper::exportHTML returning %d, filename %s, and errmsg %s", returnVal, qPrintable(filename), qPrintable(errmsg)); return returnVal; } /** \brief Export the results of a query set to an XML file. Run all of the queries in the given Query Set in the given order and write the results to an XML file. The XML file is constructed very simply: \verbatim columnvalue columnvalue ... \endverbatim If the caller passes in an XSLT map id, the simple XML will be processed using the export XSLT. \param qryheadid The internal ID of the query set (qryhead record) to run. \param params A list of parameters and values to use when building SQL statements from MetaSQL statements. \param[in,out] filename The name of the file to create. If passed in empty, a file named after the query set will be created in the current directory (context-dependent) and this filename will be passed back out. \param[out] errmsg An message describing why the processing failed if there was a problem. \param xsltmapid An optional parameter. If this is set, it should be the internal ID of an xsltmap record. The xsltmap_export field of this record and the XSLTDefaultDir will be used to find the XSLT script to run on the generated XML. */ bool ExportHelper::exportXML(const int qryheadid, ParameterList ¶ms, QString &filename, QString &errmsg, const int xsltmapid) { if (DEBUG) qDebug("ExportHelper::exportXML(%d, %d params, %s, errmsg, %d) entered", qryheadid, params.size(), qPrintable(filename), xsltmapid); bool returnVal = false; XSqlQuery setq; setq.prepare("SELECT * FROM qryhead WHERE qryhead_id=:id;"); setq.bindValue(":id", qryheadid); setq.exec(); if (setq.first()) { if (filename.isEmpty()) { QFileInfo fileinfo(setq.value("qryhead_name").toString()); filename = fileinfo.absoluteFilePath(); } QFile exportfile(filename); if (! exportfile.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) errmsg = tr("Could not open %1 (%2).").arg(filename,exportfile.error()); else { exportfile.write(generateXML(qryheadid, params, errmsg, xsltmapid).toUtf8()); exportfile.close(); } } else if (setq.lastError().type() != QSqlError::NoError) errmsg = setq.lastError().text(); else errmsg = tr("

Cannot export data because the query set with " "id %1 was not found.").arg(qryheadid); if (DEBUG) qDebug("ExportHelper::exportXML returning %d, filename %s, and errmsg %s", returnVal, qPrintable(filename), qPrintable(errmsg)); returnVal = errmsg.isEmpty(); return returnVal; } QString ExportHelper::generateDelimited(const int qryheadid, ParameterList ¶ms, QString &errmsg) { if (DEBUG) qDebug("ExportHelper::exportDelimited(%d, %d params, errmsgd) entered", qryheadid, params.size()); QStringList result; XSqlQuery itemq; itemq.prepare("SELECT *" " FROM qryitem" " WHERE qryitem_qryhead_id=:id" " ORDER BY qryitem_order;"); itemq.bindValue(":id", qryheadid); itemq.exec(); while (itemq.next()) { QString qtext; if (itemq.value("qryitem_src").toString() == "REL") { QString schemaName = itemq.value("qryitem_group").toString(); qtext = "SELECT * FROM " + (schemaName.isEmpty() ? QString("") : schemaName + QString(".")) + itemq.value("qryitem_detail").toString(); } else if (itemq.value("qryitem_src").toString() == "MQL") { QString tmpmsg; bool valid; qtext = MQLUtil::mqlLoad(itemq.value("qryitem_group").toString(), itemq.value("qryitem_detail").toString(), tmpmsg, &valid); if (! valid) errmsg = tmpmsg; } else if (itemq.value("qryitem_src").toString() == "CUSTOM") qtext = itemq.value("qryitem_detail").toString(); if (! qtext.isEmpty()) { QString oneresult = generateDelimited(qtext, params, errmsg); if (! oneresult.isEmpty()) result.append(oneresult); } } if (itemq.lastError().type() != QSqlError::NoError) errmsg = itemq.lastError().text(); return result.join("\n"); } QString ExportHelper::generateDelimited(QString qtext, ParameterList ¶ms, QString &errmsg) { if (DEBUG) qDebug("ExportHelper::generateDelimited(%s..., %d params, errmsg) entered", qPrintable(qtext.left(80)), params.size()); if (qtext.isEmpty()) return QString::null; if (DEBUG) { QStringList plist; for (int i = 0; i < params.size(); i++) plist.append("\t" + params.name(i) + ":\t" + params.value(i).toString()); qDebug("generateDelimited parameters:\n%s", qPrintable(plist.join("\n"))); } bool valid; QString delim = params.value("delim", &valid).toString(); if (! valid) delim = ","; if (DEBUG) qDebug("generateDelimited(qtest, params, errmsg) delim = %s, valid = %d", qPrintable(delim), valid); QVariant includeheaderVar = params.value("includeHeaderLine", &valid); bool includeheader = (valid ? includeheaderVar.toBool() : false); if (DEBUG) qDebug("generateDelimited(qtest, params, errmsg) includeheader = %d, valid = %d", includeheader, valid); QStringList line; MetaSQLQuery mql(qtext); XSqlQuery qry = mql.toQuery(params); if (qry.first()) { QStringList field; int cols = qry.record().count(); if (includeheader) { for (int p = 0; p < cols; p++) field.append(qry.record().fieldName(p)); line.append(field.join(delim)); } QString tmp; do { field.clear(); for (int p = 0; p < cols; p++) { tmp = qry.value(p).toString(); if (tmp.contains(delim)) { tmp.replace("\"", "\"\""); tmp = "\"" + tmp + "\""; } field.append(tmp); } line.append(field.join(delim)); } while (qry.next()); } if (qry.lastError().type() != QSqlError::NoError) errmsg = qry.lastError().text(); return line.join("\n"); } QString ExportHelper::generateHTML(const int qryheadid, ParameterList ¶ms, QString &errmsg) { if (DEBUG) qDebug("ExportHelper::generateHTML(%d, %d params, errmsg) entered", qryheadid, params.size()); QTextDocument doc(0); QTextCursor cursor(&doc); XSqlQuery itemq; itemq.prepare("SELECT * FROM qryitem WHERE qryitem_qryhead_id=:id ORDER BY qryitem_order;"); itemq.bindValue(":id", qryheadid); itemq.exec(); while (itemq.next()) { QString qtext; if (itemq.value("qryitem_src").toString() == "REL") { QString schemaName = itemq.value("qryitem_group").toString(); qtext = "SELECT * FROM " + (schemaName.isEmpty() ? QString("") : schemaName + QString(".")) + itemq.value("qryitem_detail").toString(); } else if (itemq.value("qryitem_src").toString() == "MQL") { QString tmpmsg; bool valid; qtext = MQLUtil::mqlLoad(itemq.value("qryitem_group").toString(), itemq.value("qryitem_detail").toString(), tmpmsg, &valid); if (! valid) errmsg = tmpmsg; } else if (itemq.value("qryitem_src").toString() == "CUSTOM") qtext = itemq.value("qryitem_detail").toString(); if (! qtext.isEmpty()) cursor.insertHtml(generateHTML(qtext, params, errmsg)); } if (itemq.lastError().type() != QSqlError::NoError) errmsg = itemq.lastError().text(); return doc.toHtml(); } QString ExportHelper::generateHTML(QString qtext, ParameterList ¶ms, QString &errmsg) { if (DEBUG) qDebug("ExportHelper::generateHTML(%s..., %d params, errmsg) entered", qPrintable(qtext.left(80)), params.size()); if (qtext.isEmpty()) return QString::null; QTextDocument doc(0); QTextCursor cursor(&doc); QTextTableFormat tablefmt; bool valid; QVariant includeheaderVar = params.value("includeHeaderLine", &valid); bool includeheader = (valid ? includeheaderVar.toBool() : false); if (DEBUG) qDebug("generateHTML(qtest, params, errmsg) includeheader = %d, valid = %d", includeheader, valid); MetaSQLQuery mql(qtext); XSqlQuery qry = mql.toQuery(params); if (qry.first()) { int cols = qry.record().count(); int expected = qry.size(); if (includeheader) expected++; // presize the table cursor.insertTable((expected < 0 ? 1 : expected), cols, tablefmt); if (includeheader) { tablefmt.setHeaderRowCount(1); for (int p = 0; p < cols; p++) { cursor.insertText(qry.record().fieldName(p)); cursor.movePosition(QTextCursor::NextCell); } } do { for (int i = 0; i < cols; i++) { cursor.insertText(qry.value(i).toString()); cursor.movePosition(QTextCursor::NextCell); } } while (qry.next()); } if (qry.lastError().type() != QSqlError::NoError) errmsg = qry.lastError().text(); return doc.toHtml(); } QString ExportHelper::generateXML(const int qryheadid, ParameterList ¶ms, QString &errmsg, int xsltmapid) { if (DEBUG) qDebug("ExportHelper::generateXML(%d, %d params, errmsg, %d) entered", qryheadid, params.size(), xsltmapid); if (DEBUG) { QStringList plist; for (int i = 0; i < params.size(); i++) plist.append("\t" + params.name(i) + ":\t" + params.value(i).toString()); qDebug("generateXML parameters:\n%s", qPrintable(plist.join("\n"))); } QDomDocument xmldoc("xtupleimport"); QDomElement rootelem = xmldoc.createElement("xtupleimport"); xmldoc.appendChild(rootelem); XSqlQuery itemq; QString tableElemName; QString schemaName; itemq.prepare("SELECT * FROM qryitem WHERE qryitem_qryhead_id=:id ORDER BY qryitem_order;"); itemq.bindValue(":id", qryheadid); itemq.exec(); while (itemq.next()) { QString qtext; tableElemName = itemq.value("qryitem_name").toString(); if (itemq.value("qryitem_src").toString() == "REL") { schemaName = itemq.value("qryitem_group").toString(); qtext = "SELECT * FROM " + (schemaName.isEmpty() ? QString("") : schemaName + QString(".")) + itemq.value("qryitem_detail").toString(); } else if (itemq.value("qryitem_src").toString() == "MQL") { QString tmpmsg; bool valid; qtext = MQLUtil::mqlLoad(itemq.value("qryitem_group").toString(), itemq.value("qryitem_detail").toString(), tmpmsg, &valid); if (! valid) errmsg = tmpmsg; } else if (itemq.value("qryitem_src").toString() == "CUSTOM") qtext = itemq.value("qryitem_detail").toString(); if (! qtext.isEmpty()) { MetaSQLQuery mql(qtext); XSqlQuery qry = mql.toQuery(params); if (qry.first()) { do { QDomElement tableElem = xmldoc.createElement(tableElemName); if (DEBUG) qDebug("exportXML starting %s", qPrintable(tableElemName)); if (! schemaName.isEmpty()) tableElem.setAttribute("schema", schemaName); for (int i = 0; i < qry.record().count(); i++) { QDomElement fieldElem = xmldoc.createElement(qry.record().fieldName(i)); if (qry.record().value(i).isNull()) fieldElem.appendChild(xmldoc.createTextNode("[NULL]")); else fieldElem.appendChild(xmldoc.createTextNode(qry.record().value(i).toString())); tableElem.appendChild(fieldElem); } rootelem.appendChild(tableElem); } while (qry.next()); } if (qry.lastError().type() != QSqlError::NoError) errmsg = qry.lastError().text(); } } if (itemq.lastError().type() != QSqlError::NoError) errmsg = itemq.lastError().text(); if (xsltmapid < 0) return xmldoc.toString(); else return XSLTConvertString(xmldoc.toString(), xsltmapid, errmsg); } QString ExportHelper::generateXML(QString qtext, QString tableElemName, ParameterList ¶ms, QString &errmsg, int xsltmapid) { if (DEBUG) qDebug("ExportHelper::generateXML(%s..., %s, %d params, errmsg, %d) entered", qPrintable(qtext.left(80)), qPrintable(tableElemName), params.size(), xsltmapid); if (DEBUG) { QStringList plist; for (int i = 0; i < params.size(); i++) plist.append("\t" + params.name(i) + ":\t" + params.value(i).toString()); qDebug("generateXML parameters:\n%s", qPrintable(plist.join("\n"))); } QDomDocument xmldoc("xtupleimport"); QDomElement rootelem = xmldoc.createElement("xtupleimport"); xmldoc.appendChild(rootelem); if (! qtext.isEmpty()) { MetaSQLQuery mql(qtext); XSqlQuery qry = mql.toQuery(params); if (qry.first()) { do { QDomElement tableElem = xmldoc.createElement(tableElemName); if (DEBUG) qDebug("generateXML starting %s", qPrintable(tableElemName)); for (int i = 0; i < qry.record().count(); i++) { QDomElement fieldElem = xmldoc.createElement(qry.record().fieldName(i)); if (qry.record().value(i).isNull()) fieldElem.appendChild(xmldoc.createTextNode("[NULL]")); else fieldElem.appendChild(xmldoc.createTextNode(qry.record().value(i).toString())); tableElem.appendChild(fieldElem); } rootelem.appendChild(tableElem); } while (qry.next()); } if (qry.lastError().type() != QSqlError::NoError) errmsg = qry.lastError().text(); } if (xsltmapid < 0) return xmldoc.toString(); else return XSLTConvertString(xmldoc.toString(), xsltmapid, errmsg); } bool ExportHelper::XSLTConvertFile(QString inputfilename, QString outputfilename, int xsltmapid, QString &errmsg) { if (DEBUG) qDebug("ExportHelper::XSLTConvertFile(%s, %s, %d, errmsg) entered", qPrintable(inputfilename), qPrintable(outputfilename), xsltmapid); bool returnVal = false; XSqlQuery xsltq; xsltq.prepare("SELECT xsltmap_export" " FROM xsltmap" " WHERE xsltmap_id=:id;"); xsltq.bindValue(":id", xsltmapid); xsltq.exec(); if (xsltq.first()) return XSLTConvertFile(inputfilename, outputfilename, xsltq.value("xsltmap_export").toString(), errmsg); else if (xsltq.lastError().type() != QSqlError::NoError) errmsg = xsltq.lastError().text(); else errmsg = tr("Could not find XSLT mapping with internal id %1.") .arg(xsltmapid); return returnVal; } bool ExportHelper::XSLTConvertFile(QString inputfilename, QString outputfilename, QString xsltfilename, QString &errmsg) { QString xsltdir; QString xsltcmd; XSqlQuery q; q.prepare("SELECT fetchMetricText(:xsltdir) AS dir," " fetchMetricText(:xsltcmd) AS cmd;"); #if defined Q_WS_MACX q.bindValue(":xsltdir", "XSLTDefaultDirMac"); q.bindValue(":xsltcmd", "XSLTProcessorMac"); #elif defined Q_WS_WIN q.bindValue(":xsltdir", "XSLTDefaultDirWindows"); q.bindValue(":xsltcmd", "XSLTProcessorWindows"); #elif defined Q_WS_X11 q.bindValue(":xsltdir", "XSLTDefaultDirLinux"); q.bindValue(":xsltcmd", "XSLTProcessorLinux"); #endif q.exec(); if (q.first()) { xsltdir = q.value("dir").toString(); xsltcmd = q.value("cmd").toString(); } else if (q.lastError().type() != QSqlError::NoError) { errmsg = q.lastError().text(); return false; } else { errmsg = tr("Could not find the XSLT directory and command metrics."); return false; } QStringList args = xsltcmd.split(" ", QString::SkipEmptyParts); QString command = args[0]; args.removeFirst(); args.replaceInStrings("%f", inputfilename); if (QFile::exists(xsltfilename)) args.replaceInStrings("%x", xsltfilename); else if (QFile::exists(xsltdir + QDir::separator() + xsltfilename)) args.replaceInStrings("%x", xsltdir + QDir::separator() + xsltfilename); else { errmsg = tr("Cannot find the XSLT file as either %1 or %2") .arg(xsltfilename, xsltdir + QDir::separator() + xsltfilename); return false; } QProcess xslt; xslt.setStandardOutputFile(outputfilename); xslt.start(command, args); QString commandline = command + " " + args.join(" "); errmsg = ""; /* TODO: make the file-processing asynchronous this will keep the UI snappy and handle spurious errors like the occasional waitForFinished failure if the processing runs faster than expected. */ if (! xslt.waitForStarted()) errmsg = tr("Error starting XSLT Processing: %1\n%2") .arg(commandline) .arg(QString(xslt.readAllStandardError())); if (! xslt.waitForFinished()) errmsg = tr("The XSLT Processor encountered an error: %1\n%2") .arg(commandline) .arg(QString(xslt.readAllStandardError())); if (xslt.exitStatus() != QProcess::NormalExit) errmsg = tr("The XSLT Processor did not exit normally: %1\n%2") .arg(commandline) .arg(QString(xslt.readAllStandardError())); if (xslt.exitCode() != 0) errmsg = tr("The XSLT Processor returned an error code: %1\nreturned %2\n%3") .arg(commandline) .arg(xslt.exitCode()) .arg(QString(xslt.readAllStandardError())); return errmsg.isEmpty(); } QString ExportHelper::XSLTConvertString(QString input, int xsltmapid, QString &errmsg) { if (DEBUG) qDebug("ExportHelper::XSLTConvertString(%s..., %d, errmsg) entered", qPrintable(input.left(200)), xsltmapid); QString returnVal; XSqlQuery xsltq; xsltq.prepare("SELECT xsltmap_name, xsltmap_export" " FROM xsltmap" " WHERE xsltmap_id=:id;"); xsltq.bindValue(":id", xsltmapid); xsltq.exec(); if (xsltq.first()) { /* tempfile handling is messy because windows doesn't handle them as you might expect. TODO: find a simpler way */ QString xsltmap = xsltq.value("xsltmap_name").toString(); QTemporaryFile *inputfile = new QTemporaryFile(QDir::tempPath() + QDir::separator() + xsltmap + "Input.XXXXXX.xml"); inputfile->setAutoRemove(false); if (! inputfile->open()) errmsg = tr("Could not open temporary input file (%1).") .arg(inputfile->error()); else { QString inputfileName = inputfile->fileName(); inputfile->write(input.toUtf8()); inputfile->close(); delete inputfile; inputfile = 0; QTemporaryFile *outputfile = new QTemporaryFile(QDir::tempPath() + QDir::separator() + xsltmap + "Output.XXXXXX.xml"); outputfile->setAutoRemove(false); if (! outputfile->open()) errmsg = tr("Could not open temporary output file (%1).") .arg(outputfile->error()); else { QString outputfileName = outputfile->fileName(); if (DEBUG) qDebug("ExportHelper::XSLTConvertString writing from %s to %s", qPrintable(inputfileName), qPrintable(outputfileName)); if (XSLTConvertFile(inputfileName, outputfileName, xsltq.value("xsltmap_export").toString(), errmsg)) returnVal = outputfile->readAll(); outputfile->close(); delete outputfile; outputfile = 0; if (errmsg.isEmpty()) { QFile::remove(outputfileName); QFile::remove(inputfileName); } } } } else if (xsltq.lastError().type() != QSqlError::NoError) errmsg = xsltq.lastError().text(); else errmsg = tr("Could not find XSLT mapping with internal id %1.") .arg(xsltmapid); if (! errmsg.isEmpty()) qWarning("%s", qPrintable(errmsg)); return returnVal; } // scripting exposure ////////////////////////////////////////////////////////// Q_DECLARE_METATYPE(ParameterList) static QScriptValue exportHTML(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() < 1) context->throwError(QScriptContext::UnknownError, "not enough args passed to exportHTML"); int qryheadid = context->argument(0).toInt32(); ParameterList params; QString filename; QString errmsg; if (context->argumentCount() >= 2) params = qscriptvalue_cast(context->argument(1)); if (context->argumentCount() >= 3) filename = context->argument(2).toString(); if (context->argumentCount() >= 4) errmsg = context->argument(3).toString(); if (DEBUG) qDebug("exportHTML(%d, %d params, %s, %s) called with %d args", qryheadid, params.size(), qPrintable(filename), qPrintable(errmsg), context->argumentCount()); bool result = ExportHelper::exportHTML(qryheadid, params, filename, errmsg); // TODO: how to we pass back filename and errmsg output parameters? return QScriptValue(result); } static QScriptValue exportXML(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() < 1) context->throwError(QScriptContext::UnknownError, "not enough args passed to exportXML"); int qryheadid = context->argument(0).toInt32(); ParameterList params; QString filename; QString errmsg; int xsltmapid = -1; if (context->argumentCount() >= 2) params = qscriptvalue_cast(context->argument(1)); if (context->argumentCount() >= 3) filename = context->argument(2).toString(); if (context->argumentCount() >= 4) errmsg = context->argument(3).toString(); if (context->argumentCount() >= 5) xsltmapid = context->argument(4).toInt32(); if (DEBUG) qDebug("exportXML(%d, %d params, %s, %s, %d) called with %d args", qryheadid, params.size(), qPrintable(filename), qPrintable(errmsg), xsltmapid, context->argumentCount()); bool result = ExportHelper::exportXML(qryheadid, params, filename, errmsg, xsltmapid); // TODO: how to we pass back filename and errmsg output parameters? return QScriptValue(result); } static QScriptValue generateDelimited(QScriptContext *context, QScriptEngine * /*engine*/) { QString result = QString::null; QString errmsg = QString::null; if (context->argumentCount() < 2) context->throwError(QScriptContext::UnknownError, "not enough args passed to generateHTML"); if (context->argument(0).isNumber()) { int qryheadid = context->argument(0).toInt32(); ParameterList params = qscriptvalue_cast(context->argument(1)); result = ExportHelper::generateDelimited(qryheadid, params, errmsg); } else { QString qtext = context->argument(0).toString(); ParameterList params = qscriptvalue_cast(context->argument(1)); result = ExportHelper::generateDelimited(qtext, params, errmsg); } // TODO: how to we pass back errmsg output parameter? return QScriptValue(result); } static QScriptValue generateHTML(QScriptContext *context, QScriptEngine * /*engine*/) { QString result = QString::null; QString errmsg = QString::null; if (context->argumentCount() < 2) context->throwError(QScriptContext::UnknownError, "not enough args passed to generateHTML"); if (context->argument(0).isNumber()) { int qryheadid = context->argument(0).toInt32(); ParameterList params = qscriptvalue_cast(context->argument(1)); result = ExportHelper::generateHTML(qryheadid, params, errmsg); } else { QString qtext = context->argument(0).toString(); ParameterList params = qscriptvalue_cast(context->argument(1)); result = ExportHelper::generateHTML(qtext, params, errmsg); } // TODO: how to we pass back errmsg output parameter? return QScriptValue(result); } static QScriptValue generateXML(QScriptContext *context, QScriptEngine * /*engine*/) { QString result = QString::null; QString errmsg = QString::null; if (context->argument(0).isNumber() && context->argumentCount() == 3) { int qryheadid = context->argument(0).toInt32(); ParameterList params = qscriptvalue_cast(context->argument(1)); result = ExportHelper::generateXML(qryheadid, params, errmsg); } else if (context->argument(0).isNumber() && context->argumentCount() == 4) { int qryheadid = context->argument(0).toInt32(); ParameterList params = qscriptvalue_cast(context->argument(1)); int xsltmapid = context->argument(3).toInt32(); result = ExportHelper::generateXML(qryheadid, params, errmsg, xsltmapid); } else if (context->argumentCount() >= 3) { QString qtext = context->argument(0).toString(); QString tableElemName = context->argument(1).toString(); ParameterList params = qscriptvalue_cast(context->argument(2)); if (context->argumentCount() >= 5) { int xsltmapid = context->argument(4).toInt32(); result = ExportHelper::generateXML(qtext, tableElemName, params, errmsg, xsltmapid); } else result = ExportHelper::generateXML(qtext, tableElemName, params, errmsg); } else context->throwError(QScriptContext::UnknownError, "Don't know which version of generateXML to call"); // TODO: how to we pass back errmsg output parameter? return QScriptValue(result); } static QScriptValue XSLTConvertFile(QScriptContext *context, QScriptEngine * /*engine*/) { QString inputfilename = context->argument(0).toString(); QString outputfilename = context->argument(1).toString(); QString errmsg; bool result = false; if (context->argument(2).isNumber()) result = ExportHelper::XSLTConvertFile(inputfilename, outputfilename, context->argument(2).toInt32(), errmsg); else result = ExportHelper::XSLTConvertFile(inputfilename, outputfilename, context->argument(2).toString(), errmsg); // TODO: how to we pass back errmsg output parameter? return QScriptValue(result); } static QScriptValue XSLTConvertString(QScriptContext *context, QScriptEngine * /*engine*/) { QString input = context->argument(0).toString(); int xsltmapid = context->argument(1).toInt32(); QString errmsg; QString result = ExportHelper::XSLTConvertString(input, xsltmapid, errmsg); // TODO: how to we pass back errmsg output parameter? return QScriptValue(result); } void setupExportHelper(QScriptEngine *engine) { QScriptValue obj = engine->newObject(); obj.setProperty("exportHTML", engine->newFunction(exportHTML), QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("exportXML", engine->newFunction(exportXML), QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("generateDelimited", engine->newFunction(generateDelimited),QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("generateHTML", engine->newFunction(generateHTML),QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("generateXML", engine->newFunction(generateXML), QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("XSLTConvertFile", engine->newFunction(XSLTConvertFile), QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("XSLTConvertString", engine->newFunction(XSLTConvertString), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ExportHelper", obj, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/common/exporthelper.h000066400000000000000000000036011217451700100175740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __EXPORTHELPER_H__ #define __EXPORTHELPER_H__ #include #include #include #include #include class QScriptEngine; class ExportHelper : public QObject { Q_OBJECT public: static bool exportHTML(const int qryheadid, ParameterList ¶ms, QString &filename, QString &errmsg); static bool exportXML(const int qryheadid, ParameterList ¶ms, QString &filename, QString &errmsg, const int xsltmapid = -1); static QString generateDelimited(const int qryheadid, ParameterList ¶ms, QString &errmsg); static QString generateDelimited(QString qtext, ParameterList ¶ms, QString &errmsg); static QString generateHTML(const int qryheadid, ParameterList ¶ms, QString &errmsg); static QString generateHTML(QString qtext, ParameterList ¶ms, QString &errmsg); static QString generateXML(const int qryheadid, ParameterList ¶ms, QString &errmsg, int xsltmapid = -1); static QString generateXML(QString qtext, QString tableElemName, ParameterList ¶ms, QString &errmsg, int xsltmapid = -1); static bool XSLTConvertFile(QString inputfilename, QString outputfilename, QString xsltfilename, QString &errmsg); static bool XSLTConvertFile(QString inputfilename, QString outputfilename, int xsltmapid, QString &errmsg); static QString XSLTConvertString(QString input, int xsltmapid, QString &errmsg); }; void setupExportHelper(QScriptEngine *engine); #endif qt-client-4.1.0/common/format.cpp000066400000000000000000000204741217451700100167050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include "format.h" #include "xsqlquery.h" #define MONEYSCALE 2 #define COSTEXTRASCALE 2 #define WEIGHTSCALE 2 #define QTYSCALE 2 #define QTYPERSCALE 6 #define SALESPRICEEXTRASCALE 2 #define PURCHPRICEEXTRASCALE 2 #define UOMRATIOSCALE 6 #define PERCENTSCALE 2 #define DEBUG false static QColor error("red"); static QColor warning("orange"); static QColor emphasis("blue"); static QColor altemphasis("green"); static QColor expired("red"); static QColor future("blue"); static int costscale = MONEYSCALE + COSTEXTRASCALE; static int currvalscale = MONEYSCALE; static int extpricescale = MONEYSCALE; static int percentscale = PERCENTSCALE; static int purchpricescale = MONEYSCALE + PURCHPRICEEXTRASCALE; static int qtyscale = QTYSCALE; static int qtyperscale = QTYPERSCALE; static int salespricescale = MONEYSCALE + SALESPRICEEXTRASCALE; static int uomratioscale = UOMRATIOSCALE; static int weightscale = WEIGHTSCALE; static bool loadedLocales = false; static bool loadLocale() { if (!loadedLocales) { QString user; XSqlQuery userq("SELECT getEffectiveXtUser() AS user;"); if (userq.lastError().type() != QSqlError::NoError) userq.exec("SELECT CURRENT_USER AS user;"); if (userq.first()) user = userq.value("user").toString(); else if (userq.lastError().type() != QSqlError::NoError) { QMessageBox::critical(0, QObject::tr("A System Error Occurred at %1::%2.") .arg(__FILE__).arg(__LINE__), userq.lastError().databaseText()); return false; } XSqlQuery localeq; localeq.prepare("SELECT * " "FROM usr, locale LEFT OUTER JOIN" " lang ON (locale_lang_id=lang_id) LEFT OUTER JOIN" " country ON (locale_country_id=country_id) " "WHERE ( (usr_username=:user)" " AND (usr_locale_id=locale_id) );" ); localeq.bindValue(":user", user); localeq.exec(); if (localeq.first()) { if (!localeq.value("locale_error_color").toString().isEmpty()) error = QColor(localeq.value("locale_error_color").toString()); if (!localeq.value("locale_warning_color").toString().isEmpty()) warning = QColor(localeq.value("locale_warning_color").toString()); if (!localeq.value("locale_emphasis_color").toString().isEmpty()) emphasis = QColor(localeq.value("locale_emphasis_color").toString()); if (!localeq.value("locale_altemphasis_color").toString().isEmpty()) altemphasis = QColor(localeq.value("locale_altemphasis_color").toString()); if (!localeq.value("locale_expired_color").toString().isEmpty()) expired = QColor(localeq.value("locale_expired_color").toString()); if (!localeq.value("locale_future_color").toString().isEmpty()) future = QColor(localeq.value("locale_future_color").toString()); if (!localeq.value("locale_cost_scale").toString().isEmpty()) costscale = localeq.value("locale_cost_scale").toInt(); if (!localeq.value("locale_curr_scale").toString().isEmpty()) currvalscale = localeq.value("locale_curr_scale").toInt(); if (!localeq.value("locale_extprice_scale").toString().isEmpty()) extpricescale = localeq.value("locale_extprice_scale").toInt(); if (!localeq.value("locale_percent_scale").toString().isEmpty()) percentscale = localeq.value("locale_percent_scale").toInt(); if (!localeq.value("locale_purchprice_scale").toString().isEmpty()) purchpricescale = localeq.value("locale_purchprice_scale").toInt(); if (!localeq.value("locale_qty_scale").toString().isEmpty()) qtyscale = localeq.value("locale_qty_scale").toInt(); if (!localeq.value("locale_qtyper_scale").toString().isEmpty()) qtyperscale = localeq.value("locale_qtyper_scale").toInt(); if (!localeq.value("locale_salesprice_scale").toString().isEmpty()) salespricescale = localeq.value("locale_salesprice_scale").toInt(); if (!localeq.value("locale_uomratio_scale").toString().isEmpty()) uomratioscale = localeq.value("locale_uomratio_scale").toInt(); if (!localeq.value("locale_weight_scale").toString().isEmpty()) weightscale = localeq.value("locale_weight_scale").toInt(); // TODO: add locale_percent_scale } else if (localeq.lastError().type() != QSqlError::NoError) { QMessageBox::critical(0, QObject::tr("A System Error Occurred at %1::%2.") .arg(__FILE__).arg(__LINE__), localeq.lastError().databaseText()); return false; } loadedLocales = true; } return true; } int decimalPlaces(QString pName) { int returnVal = MONEYSCALE; if (!loadedLocales) loadLocale(); QByteArray tba = pName.toAscii(); char *ptr = tba.data(); // the following order is based on the relative frequencies of usage // for xtnumericrole in the .cpp and .mql files except for the final // else, which ranked 7th overall if (strcmp(ptr, "qty") == 0) returnVal = qtyscale; else if (strncmp(ptr, "curr", 4) == 0) returnVal = currvalscale; // TODO: change this to currency-specific value? else if (strcmp(ptr, "percent") == 0) returnVal = percentscale; else if (strcmp(ptr, "cost") == 0) returnVal = costscale; else if (strcmp(ptr, "qtyper") == 0) returnVal = qtyperscale; else if (strcmp(ptr, "salesprice") == 0) returnVal = salespricescale; else if (strcmp(ptr, "purchprice") == 0) returnVal = purchpricescale; else if (strcmp(ptr, "uomratio") == 0) returnVal = uomratioscale; else if (strcmp(ptr, "extprice") == 0) returnVal = extpricescale; else if (strcmp(ptr, "weight") == 0) returnVal = weightscale; else { bool ok = false; returnVal = pName.toInt(&ok); if (!ok) returnVal = MONEYSCALE; } return returnVal; } QColor namedColor(QString pName) { (void)loadLocale(); if (pName == "error") return error; else if (pName == "warning") return warning; else if (pName == "emphasis") return emphasis; else if (pName == "altemphasis") return altemphasis; else if (pName == "expired") return expired; else if (pName == "future") return future; return QColor(pName); } QString formatNumber(double value, int decimals) { if (DEBUG) qDebug("formatNumber(%f, %d)", value, decimals); return QLocale().toString(value, 'f', decimals); } /* different currencies have different rounding conventions, so we need the currency id to find the right rounding rules. we need extra decimal places for some data because some monetary values, like unit costs, are stored with extra precision. */ QString formatMoney(double value, int /* curr_id */, int extraDecimals) { return QLocale().toString(value, 'f', currvalscale + extraDecimals); } QString formatCost(double value, int /* curr_id */) { return formatNumber(value, costscale); } QString formatExtPrice(double value, int /* curr_id */) { return formatNumber(value, extpricescale); } QString formatWeight(double value) { return formatNumber(value, weightscale); } QString formatQty(double value) { return formatNumber(value, qtyscale); } QString formatQtyPer(double value) { return formatNumber(value, qtyperscale); } QString formatSalesPrice(double value, int /* curr_id */) { return formatNumber(value, salespricescale); } QString formatPurchPrice(double value, int /* curr_id */) { return formatNumber(value, purchpricescale); } QString formatUOMRatio(double value) { return formatNumber(value, uomratioscale); } QString formatPercent(double value) { return formatNumber(value * 100.0, percentscale); } qt-client-4.1.0/common/format.h000066400000000000000000000023041217451700100163420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef format_h #define format_h #include #include #include int decimalPlaces(QString); QString formatNumber(double, int); QString formatMoney(double, int = -1, int = 0); QString formatCost(double, int = -1); QString formatExtPrice(double, int = -1); QString formatWeight(double); QString formatQty(double); QString formatQtyPer(double); QString formatSalesPrice(double, int = -1); QString formatPurchPrice(double, int = -1); QString formatUOMRatio(double); QString formatPercent(double); QColor namedColor(QString); inline QString formatDate(const QDate &pDate) { return QLocale().toString(pDate, QLocale::ShortFormat); } #endif qt-client-4.1.0/common/graphicstextbuttonitem.cpp000066400000000000000000000042531217451700100222320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "graphicstextbuttonitem.h" #include #include GraphicsTextButtonItem::GraphicsTextButtonItem(QGraphicsItem * parent) : QGraphicsSimpleTextItem(parent) { setAcceptsHoverEvents(true); _receiver = 0; } GraphicsTextButtonItem::GraphicsTextButtonItem(const QString & text, QGraphicsItem * parent) : QGraphicsSimpleTextItem(text, parent) { setAcceptsHoverEvents(true); _receiver = 0; } GraphicsTextButtonItem::~GraphicsTextButtonItem() { } void GraphicsTextButtonItem::setRolloverBrush(const QBrush & rollover) { _rolloverBrush = rollover; } QBrush GraphicsTextButtonItem::rolloverBrush() const { return _rolloverBrush; } void GraphicsTextButtonItem::setReceiver(GraphicsButtonReceiver * receiver) { _receiver = receiver; } void GraphicsTextButtonItem::hoverEnterEvent(QGraphicsSceneHoverEvent * event) { _normalBrush = brush(); setBrush(_rolloverBrush); QGraphicsSimpleTextItem::hoverEnterEvent(event); } void GraphicsTextButtonItem::hoverLeaveEvent(QGraphicsSceneHoverEvent * event) { setBrush(_normalBrush); QGraphicsSimpleTextItem::hoverLeaveEvent(event); } void GraphicsTextButtonItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event) { if(_receiver) _receiver->buttonMouseDoubleClickEvent(this, event); //QGraphicsSimpleTextItem::mouseDoubleClickEvent(event); } void GraphicsTextButtonItem::mousePressEvent(QGraphicsSceneMouseEvent * event) { if(_receiver) _receiver->buttonMousePressEvent(this, event); //QGraphicsSimpleTextItem::mousePressEvent(event); } void GraphicsTextButtonItem::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) { if(_receiver) _receiver->buttonMouseReleaseEvent(this, event); //QGraphicsSimpleTextItem::mouseReleaseEvent(event); } qt-client-4.1.0/common/graphicstextbuttonitem.h000066400000000000000000000034201217451700100216720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __GRAPHICSTEXTBUTTONITEM_H__ #define __GRAPHICSTEXTBUTTONITEM_H__ #include #include class GraphicsButtonReceiver { public: virtual ~GraphicsButtonReceiver() {}; virtual void buttonMouseDoubleClickEvent(QGraphicsItem * /*origin*/, QGraphicsSceneMouseEvent * /*event*/) {} virtual void buttonMousePressEvent(QGraphicsItem * /*origin*/, QGraphicsSceneMouseEvent * /*event*/) {} virtual void buttonMouseReleaseEvent(QGraphicsItem * /*origin*/, QGraphicsSceneMouseEvent * /*event*/) {} }; class GraphicsTextButtonItem : public QGraphicsSimpleTextItem { public: GraphicsTextButtonItem(QGraphicsItem * parent = 0); GraphicsTextButtonItem(const QString & text, QGraphicsItem * parent = 0); ~GraphicsTextButtonItem(); void setRolloverBrush(const QBrush & rollover); QBrush rolloverBrush() const; void setReceiver(GraphicsButtonReceiver * receiver); protected: void hoverEnterEvent(QGraphicsSceneHoverEvent * event); void hoverLeaveEvent(QGraphicsSceneHoverEvent * event); void mouseDoubleClickEvent(QGraphicsSceneMouseEvent * event); void mousePressEvent(QGraphicsSceneMouseEvent * event); void mouseReleaseEvent(QGraphicsSceneMouseEvent * event); QBrush _normalBrush; QBrush _rolloverBrush; GraphicsButtonReceiver * _receiver; }; #endif qt-client-4.1.0/common/gunzip.cpp000066400000000000000000000020031217451700100167150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "gunzip.h" #include #include QByteArray gunzipFile(const QString & file) { QByteArray data; gzFile fin = gzopen(file.toLatin1().data(), "rb"); if(!fin) return data; QBuffer fout(&data); if(!fout.open(QIODevice::WriteOnly)) { gzclose(fin); return data; } char bytes[1024]; int byte_count; while(!gzeof(fin)) { byte_count = gzread(fin, &bytes[0], 1024); if(byte_count == -1) break; if(byte_count > 0) fout.write(&bytes[0], byte_count); } fout.close(); gzclose(fin); return data; } qt-client-4.1.0/common/gunzip.h000066400000000000000000000010601217451700100163640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __GUNZIP_H__ #define __GUNZIP_H__ #include QByteArray gunzipFile(const QString & file); #endif qt-client-4.1.0/common/images/000077500000000000000000000000001217451700100161475ustar00rootroot00000000000000qt-client-4.1.0/common/images/splashXTuple.png000066400000000000000000000430731217451700100213200ustar00rootroot00000000000000‰PNG  IHDR@€õm'ý pHYs  šœ IDATxí}œű÷Îæx9ét’N9‹ @€@ÀüH& Ææöççç€mÞ#ƒcƒm¢Á€ lÀdŠ(K']tI—oï6ïÌìÌ|ÿêÙÛxAº•Lÿæözzº««««ºª«{z8EQ zÐ) SàФ€ñÐD[ÇZ§€N¢€.À:è8„)  ð!Üy:ê:tÖy@§À!L]€áÎÓQ×)  °Î:a è|wžŽºN]€uÐ)pS@àC¸ótÔu è¬ó€NC˜º§£®S@`t ÂÐøî<uºë< Sঀ.À‡pçé¨ëÐXç‡0t>„;OG]§€.À:è8„)  ð!Üy:ê:tÖy@§À!L]€áÎÓQ×)  °Î:a è|wžŽºN³N‚d ü¹!pT¹ÕnâdÅ 8?†¡ˆ–s˜GiySKADˆˆ–®¥hÙTàÉUh‘hâ ’¬¬ê¾:ÕåÄÍ> ‡VvG'ºLv“½–¨CS@ZRn·}ÆVTRú#’ +fÎPd7{,cîP]€Szü±OZ·Ö–Np™Å¬¼’7åÆÈeç-Óˆ´œÃGÌFn—^­ï»`ò§É4|æ/ÂStÔ=·Í(qO.¶ÅRz §9.,ÈÏïè}ÿÒY6Ûg…b{C±çëÿ¹Ëß|²â4r…Ó“ÝÎ/Y\a}ÇéœB+[”ºÁ+Û,r +¤äæÜ! óx,Ò@i·ªå˜4)û`=–ê¼Ëþ;x«Ë¦¢2g0sœÈqVƒç8Él²Æ¤©¾ uÌê-_Tø{ƒÿæ˜üÕž f^jk ‰;ÃÏïö=Þ8ø­9Å·PiEÃFtN!ô[™‘#!ùÔÂÌFK!wfJJ5£»Ñ€ ‚ªÕ­à†£ÍZÜÏW.¢»Ñ0Áh°ã4at¹ˆBàoÉÄñf‹‰3¦Îfþº}ðò;®¨ñüßñ•sK0ÈÄÃ¥s‹~©|fëÀ7ôHQéÎÓ&ZFað뜠û/EqŠíkÌñÉ((XUâ79¨2¦=eÒE?j6U-kñ´²j©dhˆ#Q¢öcBŒ1£SL@=N+õ½E‡¡ËdFÝ@.¢£:«¬ˆVî? cÞ¦®¤÷Æù¥7W!)/O–:úÂmá*¦ëŽ)[\a?ùÍÖ¦›–UØ¡º§È"£óIÉR$n0ÞSö›Hú¯=Õ’´D¢HfÙÌ­+G5jº—á$õ§º Â)ÓÈFdI&žÀž’LF’’ƒà²úÁ{{Ï-sÜzBesPúêK»!¿†cଦZï\6áÈ ûIµîÇ–T]½¦ëì¹E‡—Û‡ÇzJzxŸ¯§ÆmÐR&Ç´\úoZ:ØBK!a—š’\\ͦý¦eÓòk ´²™)œ¤˜HÕ¤réç«ÆÜ]ÆzM¥­ök’‰P°EñtÌ`Ç»À§{Cû…Ÿ.­Â˜2“„Ø·fþã‚Ú¿W{Ãq•;}üÿ¾»7#<¿º x±Óò—ý#¢ kàÁ~&1cƨ¶nò/¡ŸML§&[ÂÉq bZÁ´[-[Z$3[J 0e. ! Öã½Fë~¸˜6ÓM²Ë RSŸ!ï þ<Ö£+*†^Åpx…cV1ùœ–ÚÞÙí_Ûö ’Ól†9}Åœâû·ôݧfÍý« p m ÚÈØÂ/ÓqèøLM– ;¥Í»’–?í6µDö»Ì"HAP«Cã3Œ.XŒº =DA’\üÁˆŽwècäR/䤡ù Q6lëÎ-±[Y¢ûJŒ\]o´ºÐ T;CÒê®ðÂ[©=.’5…È8r'ëœÞ«&#g1Ò€¿ÄÆÂž«Â‰¨:õ¨ZQ»UÙ|$ÃÄ¥)4óçvœp&£ –D jÁ®ÄIP1H°«Ÿœñ<ðµiC‡š®ÿ‚^tì&˜ŸgD‰ÿr¬hŒºä àÓ©Àïrüó¹{·{ïÞæu¢s9ÃYÓ ®;º\ó<û9£{¬ pJ¯võ÷oëºÌ&h9z@ìÚÆ’h O$¤Ý"cYQQAe©ddc,)Õš(¯ýW”@÷@__¯"I¤ZU€iYYªš¥S]¬8Ä^”¤"»…× ~¡#êć&D¡6!¢Î8¸3˜Ì&oD]‘ ÆðJÊmG”ž6«èÞõ}ÿØå?mŠg’GÕ„¨[–üðSÆG€•ˆ× ñœ³Ì ÇñËV/°ª8©fŠš¬ã8 áe0w~¶úÓÓ(7þÚ±©Õ°¹hºç”ÂXL–ãb«!›^6õžµÌbPÖ´wwøž"ip†Š #)ËB¥°3(æ]ýíçNvHFhë„hª “oÕxò/Š+Øvg¶{\XÙTKè¿°M ÜŒ S˜D^{Æ5Xíà Ž«%•Žö¢¢n™äeBur従&ÄÂÒ·Þmÿ´|nU<7vG F±a$‡ê39v®Ûa‡*§lÉÊMÅ*‘b´˜@ËWÞ¯?|rÁ÷Ϙ­Â¼åò¥™ÀGŸòëW·<¼Á×±†ÓÅqÞ‰lÆ‹§6ù·ß:nôõœÃP@U³$½ã±ÜŒû˜fn¿a ˜GgÍ*üÙvï§{ƒ§Ôz`/Ä !F˜Ùh¸ê˜òÇ_òÿꓮߟ1 #swXúCýÀM JFDl|˜³:f_uß?zyó;ßY4ÏBz…Ë A.Äá+²;͵‡IƒÍÎc¯7@ïSè K×oò÷ø£ÿlë§þ#—6åÁVXX*´DD£Iæ…m›¶^qÔ„žyô>U›¥h±›Œ…©Ò«þ&g…J@ÓM¶¸+2ù‘ß7 @lië+¤4U€A|â3IbÊyß`g©Ã*—U:þïãÎ÷'º'bã˜Ëj·Æpq¹í†¹%÷·¯éQax]/$ü²…J€ÑJ“Õ~Æ/Ÿxã–«ë¶lž;]âàÆÅô1a·gI¯šBŒÀ)r WšgÝøˆýÈoŒCs€QR. ÈßÛàë÷ó=M=A$oÏHÁh4Šb´aKÝ–VÿæÛ§”} ϱŒ“ÔALýÕ `|…„[±µ@ãDŒÎÉdO† ™æ0žÆ°ÀŸ° “Ø8ºþîÓj¦?×ôý7Ún;µºãÒé°«Õ€ÿ?;±ê—"1ù7k{^×ÿ÷«'&M‰sa:žlduœ~Ëö§4´˜ì('ßMOH\ˆÆoUt°† Çv­‹õl‰|ú§Š;òHïuŸoS·‘ ¼7²^fxtÙ#3¬j!ÖWWÿíEEw_sªjPç¬`ŒÐJì¬ögó.YýUh¿T>à y<é>F$?‡ÙÙ’FääifI6Ƥƒî…VÉ>±ÀòñY“_ì }啿ZCA,.%BLQvz£×¿¿÷§zsdå ŠO†û?>&´Vƒ³°ììß<ýê¿jléœ1…Z£ø8©Ï¯68Ktý#öÅ×ÂÖácÊO?lô Þú.%*îÕìæŒb‰É'•)¶·®áŒ™Žß_wŽy¼Õ )^º ºTæÐÓ–b4ÒÓÑÐ%£zB Éeì…ÆÚfL¤8´Àì£(á©–vp#G׸>¸`ê t|ûß­%6Ó¢2{um—wô†÷ɸĉÕߘ_”Py# ;ÎŒÚ\%•gÜþø¿~r…¹­ê$Xò !i¦tD(þHÞ7 [6Æ™ßúœmÑeé™3î±­ôGëšTé ó ¦ñÝêd­'Õ¦ÞâžH(ÀSkÌýä\K^¦¥¦Âƒ0¡µqHC)´•yÈÉ•Ñ0=a(€ey6&ÂÈhÔ&H$Û¤„Ó’ÇZ ޹Ĕ¨$CeBU’tÇÌ›¬&Îfâœ&£¶Š;<|ìp~áü©ï´°ûª®_¨ë‰˜LÆiEÖ¯Ï+9k†§Ú5©CÖáqJ~Z\3ýÌ{Ÿþ×÷/1rÁÚI©½YBr2æÃÝ=œy'f± ¹í°Ë³äO$ ’r÷úÁzŸÐ_ßiD°);„“…6‘1é?ö?(rWÓîc*ä'o¾Øiód; VÎ(ýè]6÷‡œ’¸²‘‹©D„†šH¤°YNˆŸß˜jà À ÒFº}l.MØhVBc4‰1zBƒFs™}"xXRº#Ò  …D¥/,öû„Á`ÌEDbŒ ?N«©Àn*r[Ê m¥N“ËÄ•ØÍe6£e؀͒çÏ(ÀE›Ÿ 9Îa&çëXC^H”ÔL?ý®ÇÞ½áj‹)4i"y8QVMdgš²«Ó`¶‹0‡\U–§%ФüG¯ßº~`u¿0Pß©øB^rQ° VÂ:5ëJ–ÎT<×»§åðÌM_sÙ÷ÑÝ‚G¶êÖ •0›µ>‰G€Ö™öŸ²Õ9æ4 ¡•µ¼š!+ª³6´bø‡—«“! `H”1…—d¬žˆŠ"*ãðž=^^·š ‹×(_dO©Ô/š„íiÉ-#qOC*3°ÙMJ¹an0;mô‹m¹×'Ôw†»‚­ƒaˆn,&©]¬GàÅb—mr‰cV•{z…½Üi®v˜fZ!¥ÃT¡>r’#käl¹àäK€Q_åì#N¾ó‘w~ô ³I™0ÁFƒ`,†ÐW¬†ÎNƒÕ­{Ñ F-sÏI+æ{`ãÀú~ÞWß% MØóŸÓuÈ© äaµá#Ò×Ò6ÇzöŽK Ý#¼Ÿ•VãØnÁ+ØOmDsŒ&d,ä$F–b/l÷ÖT¸*lFmRÍ8-£Z  ÂGÍÁÓkÝ5#M+v î H§L÷°5È,Õ™Ê'Íá‰nó—¦y2¿±¹gGPþÒüX•êÓ´¦`ðBëŸü°íG'UÏ)w"„¡=$uñ±A^éä÷ ^_4ÕUP‡ÅXâ¶N(qL*³9-UvÓ4vók™‰BFŠê¡L²‡r ÜŠiXåÈÛÒϯñ }ئfýÞÁP˜·Aßr6?ÂÜËR@’bþp} ²u¯ÏUèœ;±`Q•s“W8²ÄvxY~É££Õs/»í?ûαfse•K‚µUæS%‰Qm¸x¸Ž®Öm|“s•™'«Ñ ó‡ ¯ö ÁÆn¡ßo4±b£>UÿÅ9Z+˜Ì®¿½£–ï{ò®+ ÝÄOy Ô>ÅHæz¶nf“i€…Ÿ>^ßÚÍ›ÔÓ"7 q’±8ÀA^_Ñ´ä{GF!À½}_ßµ~áDàÉp!(*:¸¥ˆ,¯ÛÞõó§² p[÷à´²«ZÕzl:Hv‡fS,Ï‹uuíwž1ønö ›½ü`DÚÙÇïìöû£rTàbf­¨ AÁñ7œÑXä¶Ï©.XPã*qšqݼ’Q³>›¶˜L–NvÜÃb3ä8«0šåüoå{B[ýB{¿°iWñ‡1×*2'Ì©œå¨b˜N¨z_¨>"4x݇ո[âÎë¹S].m½(7„}{’_NµKNÝüÛÕ?ÿÑñfKYEL›r¢JÌBÄŒ†Î.ÓdGxíãNÙ`®ËðªÍ7?ôÁ”éS¹¨ze. ¤FhƒÎΉRßòû.ŸPV³âñzÀ×l„3%7»@AÓH“†ìp`Sûkõ]›¼rÒd RRLãÜ\ ðWìñBfÈLûi¤€°áþ€;ÏM(uð¡h‡7¤É ƒÍš@é¸ÃG0Ú«tMôÚ·|Ò{ÇÒ2OÎÄ<Œ&Í9íB1Xõ»ÛOXj+©(•D¸0Òh3t‹' „/bäú¼\uuøã]§ßh,›Žž¸ïç(á–¯ßQ>sä„ÖýX9FÎ!ˆÁµàëî+ ´ýõ¾¯O›Xžò,o7hdÂf6Ƈ–¤ŠØ CÈr¶et$~J*JÖ)†0¨¦å’Ÿ’ò›F3a“Ÿe‹Ÿ‘Î_D)Ã-‰„4ˆ3e&€ Á5cQ™;G'Byïí ßÿ!ß;U"‚r ,iîIKª(:èÃ\¢(õ–‚:Ñpý{÷œ:ƒF¶¼ñ4 5,fláÍ0Õšáa Ž ·¿×±–7¸%™ë XaAÁ5•FôÁäï¨Ir$‰|1QƒY.›ÇãtZÉ®”hÀS;MEQÀ4Ey©Ó L*è’å¼µ÷‘s& ßD…cø€-<ÿJ‘çWþéî“Ou¹Š‹•üðÙ¥­'o d8d0Ìå¡·îr}«±¨Úë×?¹Ðû³g?ܳ«¤v¬#2ûR” Òýý®Ž¦Çï¹ì€I/°@O[˜¤!¢µ ɸ/Þ©f³‘§Hm€ÜÂ:´šM`@IŒG@'¨¶Qat0‘KQàì%LKÕ6dxÒl”m„%ðY5Œ RxÎ}à¦ö"кZ#5XáŽB •Lç!˜¶Š'²J ·1<"IÇAVBLê ×x¶DÿðáÞïŸR“•DÄ &‡ÙH,§6=C B¾j1îr†×7ö¾ÜžWæä{Cf —˜N3œ1âl฾֮î†úØ@ƒÃô@äî À›ìÅ“k«Ìv8­˜8Ð0šh¬Ú¼¸é—׸ëù‡?Øûßÿ1\Crâ—ûÁ`àpäW¯ƒÁŸûã²ÓsÇ‘iƒtìTJƒUÉXñÉ&‡h¨ª½ñKÏ9?7x*6ËnýÚå×?µ¡ywÉ”©zÕ¾‘è%w* ö øMÝ ¹÷²Ãg3½ÒqM»'ëÔà4ÖËÉ.`Ú3Æ4HÉ·P¯Ø °Y50TÀ¤o25NjWVì@ª)•­èI‡ f§@£9±´@¬š=à$[Ÿ4ÎBa£ãÜÌ’½8r!¯1"È^~~•ó¡MÝK'{OÏ= ’+g´[è-î´ª Òˆeâ`n Ü;Èÿô½ÖEs'˜}ÌË[IâÁl1fÝŠu|sÓ•çyÞiçL©.±[,ÕÁ@xc]ëžýpû›móNYVZQ$D±4–2X±¤Añ°‰®û×î]:Å}øtøÆ-PÖKþë:1\õÚ³'ž}¬ÝS A†Ó˜(©iZ}êÌN¡¢"øÚî ï0Ø œöÇïøú%?x¬±¥¥dÒd¢7$t#‰çƒsÛÎ?ÝqÑá³'%; QE_C6ÀIY›…ÁÒƒ :œ—+S€‚ÌÃû.í!á4“IUÄÕhZŽŒ[p˜Œqz¼™ÈÅÆ&ɘ’ JVà Ã( žGò4õÆPF#  Ë1-7š­f—ÛYè²Xͤµ˜h¥‘‹Ú…¬ˆ³ÈºtZÑO_¨û×uÇØ±Xœ5 EècŒ‘ì¥ p1š”f,|ÛóÛ+ËÜ%ŠDhr¼Ü§PçI,æµo~T.ö?ðÐÕ‡ÍJÑn§­¦²øÔãæÞñ‡×žyçƒ%_þÏ‚B‡ÅW=†˜ZmˆäØ ­ÇN-ºá¥¯^·däY}z#rÞh"'üÏ-ï‡"+ÞxeÙ§XÝJ/6Ó«=0Çš =KM™¡œ üýfÏ%¿6XœåEîçî¿êÒï?ÒØÎ•TYÁX2 ùƒrûއ~~áÉGÎÌÙè¼=@CÀb8؈³p ¬ «ÕdEc3$g¤ÀždBgI69Γɭa2 5™40X•HŸ o»ÙLäL¤æc"6‘_(Áë) Ø à`ÒØ×9ØRWçíh—ùH‘Ój‡áH¬?À; ‹&Κ=mÑ,ø2blE˜Lƒ¤ƒ)1?k’»n›ñ¯¶\uú´¤çCQpŠ3»ÌF‘²ô1Úä Ï¦]¯µÎ^Zi ñ˜V°ñQÀl6¹JÜŸ¼µ¶*Úû·¯­,Ín8íÖ_^w‘YZþì‡k¿tÑ`!>&ª›eâ˜PCpÔ’/:rÑòí]¯¯l»àÄÉéXîëýA` zÒOnÛç[ýúGÇ_t¦ÅS,Ey[Ö}Z"BŸÃ¦Ã^ô¾ˆ¹f\~¡—îºàvƒÅ^YRðð/¿ñõï=ÜßmvWTb¨ ùÒ®­¿¿ý¢S»¯Ù¯r[›Dz'* (°¤Ãf£dÅ,XfeX$°Úþ®DVÈb§A3´s"OÚ6%Åp`džüt,1ØœÃí¢Àà|Ü6³"Ò®¤4àê-t{L”ëVmܳeëñ‹&\øý/-š]SYZ`t£b­Þ÷Víxîå5«[ZŽ;ã”’W$,d 'Ƭ¢rÌìòÇßÝýµ“¦`ëbfkp ŠÓjä,O1NÁšÕ©ŽÆ?þFÜ EEFÖ3l­×`‰xJœí¾®íÛÿõй¤WCæ{ÿuÆòËêÞÓ;g~5vl¥9½©!BÌ*qÇÍ.{ðͦsŽŸ4^J8ˈ¥á”¿ˆÑl>ýö¤¹Ç¯|åm GyŠVgqBµ¦]ŠÅ)›ŠÉnÀ(Ú´TÍ4Øí¡×î2Ä ó†™“+žúÝÕ…{‚½½!XlÚüÛŸwö‰‹ò‡ùð¡*!À.« óUHAÊeæp‹ƒpÜ69r(„¬ða–ƒ1 lLv €N¬OÀ4ÍZ8#¦l`HB$!6÷:Hg*gõÐL·ÝŒeÞ|X‘âÆg„ØÇ¯¿génzæÞËÿúÛï\ü¥Å³¦TºN»Ånµ ²pæÄ|ã´>õ£Óæ½ÿÂkÑ _VhGÁ€#2Phaá´’¤¬ÚÒÑJ-aÔ€¶iŵ[(þ¬#fKWðŸ ýó'ZĘÍHn0­H¡ÓRXèØ¼bãy˦͛1ò\¬¢¤à«g-ÚS¿Sq—ͬÁQ#€ ÆüÜi¥{ÃâÆ†‘|ÎÚÒÌÄQvzfÁýM!þÅïøòùk_zU6£Û‹Œ6‡ÑêÀáÉ—š"™í’ѪðβM; óá7Pmí¹S'¿Ú]ÿÑ–Š2Ú‚âZëBE /6«üͽþ„J< ²ƒ¤̆¶OÐ:k—0†¾º²mVUÛÄÁ#€ºâD@ÙÌ¥ÎÎ†Ž©•îyÓ«SŠå¾™VS†aH E œ S‘AC0Á6‰òs+_×£ð¬C8˜ ô­×™÷?Öpoxþ9ƒÍÁÙÝF«]±àbl¶ãå$Ål‡#¹!ÒJ ÎA—mñyŠ·_ñ¬Jƒ³N\øƒ+Nzìº`}M‡ÀpR/t^Ü<³ hDrTÚREêJØm%‘ P… Q$Lu‰ÊZM*4Mù hEn8ÆÞ&Y)«s¶DñD3 áFxqÜ…îQÒÒb6Ýøƒ³7mØð†Š=6!€Äc±Qæ¥ÙÓŠ«È… ‰ IDATíæº–Á,`Ù›„OjÁ8>ÒÀtbVjhé ìò†kq0$[ùCf—(Ì,óvN8fÐK-—󮢨UQY"†x•’› ÆiòÁK3&âm¬¦®@N@cyppœXÉ:ŠJ¾üôó«®½<´écÏÒsc~ñ" 21ùÇ/\—ð‹`ök„×Úá$õÍe3¢o?íì.üÊuÌá• õàÄIH¹q12T3‘ÀÒ«ÇA³ÈQ › ³V(vX¼x (\w.»É,K¦¤763ëMNÁàÚÁ¦v‹Q"™ðE-V> `&/yZU lš€½´D-Ÿ¤Ú…6ƒwË3ÊE-õ„#gÍœàØ±¡ùËç-êag79ä:„8g┺§9×6õ7¿"J⿌eä#Pp1²«Åñ‡Ý„½q4QN ;Û}ÅVSM…1«Q3S&PSV¬-—¸J'•ö†i¡‹V®‡µpð*“fÌ­…ï Ù2´6Ž `é.&—ØËíæM}‹jGuhN*Öéw_€‘Ýá˜;³Àl·+V§ÑŠ×Eã´¦M0Ÿ@§Ûà.ƒƒÂî­±¦-âžÃ`¿·¶ËŽhõÒ %ìsKoÙÁ¸'U [—$mh÷i¹ø‚Ã`Ãó¼ÛqPуÆÖ‘é Öíè6œ7/*-#æ2÷œVP%ÍŒwnñ†gZ©]Ín;ÞdPD¢˜Nác§0 ûQZ½QtÚ¶T5Ð0¦&~™hsI9lî„ v¨‡e6FµNu0#ÄÈÔ·™Ê\¶¦öl¦DŠ£¸ý ð½‰þíŽâù³,‹NSÐs6'ÛHZìÉÙw‘ܽ‡ÿèe~ãJ¹Ë‡m–|FnS‡".9þÔ;ùŒH/Q›í'ÁDN#+8}ׯ°ôlæRí…†Ølä^¸`æ0¨!F vÁn! kØiPVdéFư þjEÁ´Üi£Ò䘅nK1>σj†D(9 %C‡Z€gÙãá¡ff1¬“eÉìÛ{×ËŽžùÔkM±0Ó-BxÓ)Aµ±v¸…̆) V¯éÁØ’±_C„»-rb[°bèÕηfE&}VÕw×–»1ž†R['¯"ÏÀ xヶwq’(á]%€Ç©ÿ§p¬3Té§•ÃW$ä@ÖrÙÔ±± Ze‘£»?˜ô|ߣ§í;ˆý*)Ká—+[Ìöc.ÀkàÆXP6Ã) ºvÅU$õï¾ô ¿ò#y€çÀø’^m{‡œ·àË÷<o6 roP¨-ÓìæÙ £ï`W–YûúDlª³Y¹èG‹™ç%dž`¿®Ý4Åm†öãÇ¢ÙVJ¥ÈEÁ‘PØí6c9¶Ð¤aa³ce²!•ž†¬@;[õ!z˜¤Ø–©˜¨p¼KaÀD6õ?v%ÛŒ¥EVŸÇê÷ñ>? ðʈ¢]ŠÕè´bÇØXkbe±fðEKk‹0Ž«*|o2sX¯./³cŽÐÑð°]JJß’%+0zjÊì…N2¡±¡g" ÈU^bowaçcJpëóE¦M-IÉþNV­f« ¶0íÊâ̤{áz·I nÉöŸ‰ØõL²¡™Æ¯¡@‡¶É\}Dó@Šaåp˜+ÜV¼XÖÙý9ÐÀr,¼ü^9°Ÿtg±q¡€bu@é¬vÎ],£oü9úÎërWÄà4UÙdsÀºnCÏô™ç?ô” ¦µÁÐëþ¸¢#÷ÔzLÎrˆÄuóÃF¼îð¯ÝÕ9ˆuà€êBÇás*—9¡ºÊm1sBT~wEÛ†ÆÞ9sGëãÊ0è ¡‘¸~sWkû`G_ЈªÊ†É0>2—ʡ÷T–1†ªÄæ.0‘Üf,.ràx§ú}~i[£7Œ³’ƒ¡§/¼©®ws}ÏîNÿ@X‰x‡ô™žÁàX_»)ò@ü¬Ñ/½ÄScÀ 6›Éã¶@€6lèxñ͆µmÞB‹„ ¶!u;*ň¶qCgÃn/vwºÖ©“ kªÝ8fî´†ºÞV5ãs!ÉÍ]„·š èhu£"Á' ˜¬z}hp0ÚÒ<Ø× â]žvU!ÐL‚^‡ÅS`¯(q¸°èw† ã3JÇ•8I/rS—‘Tãÿ!·dMš8QûûÃýhχÛ:fWŽÖ7–Œvf|lÃdfù}OÁÖÓו|}Î3®2zJ Ñ€âòÀÕ,Û<НGxÿ¹È¿_’z øâŠ‹*ÆRí´F/··´êÜžÀVj¤£Òm¯íníôÃ|zgGÁ½çN5ØwÌö½$LÊí=þÆ€€9(‹ âžþлz+ßo¨tÛ >¼ØàýÁè¢ùc`ˆÅæ¶ŸÞó~›ç~ÓÙ.à'0ªÀ¦Q§³£B †­”XràâZ³™óùøµ«ÚV¬m}·¡Ÿ¨eZšgLÈ;Ñïþúýö zmØzÉX£x"„W¾i{úX–—pÇ)riD LoÀù-íÁOV4²±}]‹³Ç±¢ bdL£Ã¨ü}Mó ëZÉÓÑðút™ÃŠ=xg¨7,øøXMêÀ¥c`h`›‰ŒººúþÍÛ;ëöôwú"ÑöRAäA• 5îÔ6bË-8ÙÌ›¥Ôc+-t¸mn—² Ë ·µø“ ¼8Žˆ¤o º»Ó×â u‡ŒAójKÇBžœy’+Jøå?ÊÝ»ç\ƒ} ²`p—b–"µmç?ùsôÃ7¥†>Ìœƒ1AÂûÙíãêÏùO<멨B›à»¹á…úæ¾pó–Vl"Ÿµhòë{¾wBÕÔòƒöá¼JêBß1V†ç “/ˆ_ˆÕã Cv)–4èúT…³â”Þ0’ Nz‰7=/$™\,4î2(04¡!}ƒÑ®žPK»o箾{w„EÅ€÷õ ÍÆ æèì…ô†…Ø—jÌ¥–ˆR1LÚÉ×=–-åtÚ"±µy°©y°~W}³·¾ÛßÐ@ÎbX°PÀª%ÃÆ”ö8­lɇDé ò¨@-@öÀ_ §¬»"YÆÉ/†ŠRÇ'«Û—ÿsÇÚVoP”°bŒM]0¼©Õvá–FÈ”æÀÑ ò^îÅ·ÊÐÃ4z1¸1¸2݋Žp0"Pïc³—ÑX`1…%9Äç¤prÓFŒæß_.÷·».ù1WZ­ôí•z[Åúõüú±­Û¤NƒÖu2ÞHlïeQZ¹:ÙqÎò¿WÓÖ6Ø6·½ÜØÖiÛÜ‚I@»]ÛÚà_½+Ìÿâ¬Úªâƒ1VgEÔa*åU×'}Ì—V"1„£k!º$cé?¶•]…²¬˜&,`PbªOµŽØëþ¨xËï> ‹0ôCÐé› àZ†Laˆ_N dËHô¾!3ÚÑ" $€‹3¿‹” Ðw°0ÿðÊVá¥-!†µp‡a—µM“@6SaLGSJâ†ÜrÀƒä$!;´Û„áÃÁ'Š&Rs’PLvÈòs/Ö=øêVhc|S¶˜^¡€"ˆš p¼5Ž=Pí vôâÃûÐ+DøC 8ß+ž5ñÞ]Aœ¥Ãé@‰ ¤ (‰¼cþ8úÁßù•oaªøóíRg›ÔÕ-õú >F]lÝñ0:'ÑZm{Ç qSÔxæ_Ÿ,Ÿ6 )ŒöÂΦîp󦿍?Šù zgõîØÔ ·+†›Ï®pÀe˜ ™ª]‘„ÖЙxÆ:|¥1ú¾"qb`ITXAŠ€c˜àÒ95$oäš%L˜põ=AÚáÄT òʨ0‘Œ)uNQ+ÄÔ8ªÃjůzB#=}€V÷ÅþˆŒ¹"¶Ñ2ŒÚ@êXBC”$;ðÚQæ‰ü„:‘²"™jÇÙÀh õ@Âc8‘¿ÝeZþV]+ŽÌÄ´î 4 Åú0xAœdîž1É¡$>§ŽÖá¤\ö¢#Ö¢pkE°ERšÞðh„'zVlQƒrøôñ™èh>}›_óNlOSlK—‚©°€c¥5]Ÿ0Žv…¸u}ÒiÏ?Q½€ÇBw<üæî†ÎPËÖÖð`Ò‹y`€zhOGCÔÝÍ‚t÷Wf–zà¹>€}‡C’˜*PÍdü‚—Ø`«ö+¾!A‚œÑËÃ" s2ejO…ŒšâKŒGµÀ%5,”øCp*dë.€G„¸Ž†¦§(N E¨X ‚雨 åÑ)è:õ–ÐŒMÃ`Øõ…e¼ã¨mÔ$È­©šžè†©u‘ƒVbÒš‰ÁòRéC¥H\I¾T¬°§S9’Ziª,±ÒÐïò`#B  +_/&¿–$ŸtÚQ·ýàÌ´ê>S·T€…FÞXkm’¶wqãÈ—2>2Rƒ‚d•)=¼qm¿ìÙG§ßêüÄ[»ß©hÝÖè Ò+`ø,3äTÊ‚Zwtཱུ;_án½pVÁX>T±Ÿ}VÁhOúÂÀxˆX‰E4Ȳ¢ÇbB—; ‚€Ep5ZªB@8"›¨hðG'TŒ|ò&1$€Cù“¡QhBÎ{•}>&©©(á}ClÑ[ÀÆÆ¨ ;m%­Y©Å#F«+ÜlŽ™œI(QžI}œ§CÅŠæaèuò‘TnîŒrëŠ.NqiOQ èB‹Å¼q¨£7m´â,2V:ï;bâ–UÑý-ÖÞÛº{óAkºÈâIЍ·‰tY_ĸz/ü#÷Ï\ßêüì»-oÕõwÖµû{°gHý°€ñS `=HHóöö =·¾XCÈöé1—$á ˜ôP›Gœ˜BäKm7˜|ÑÑ€ D1·¨äÒˆ–‚0XV힬à€x¢…(ž A‹¥³YKçJ\½µË?G` %n|dþ¬Ê,ÀC¹ÉŽGtibš(?kj…I a®0ÄC‰š‘óm8’ÛC[šÆíÕ¿DÍãùÿ p¬ikø•§àaŒml¦Ó%ˆ âWœUØmr:ÜÞ·ºO<öO÷Í=ó4Y^ú°õµ-=;;ú:aSÑ'‘ˆ®Å!ùØ/¾gK[CSï/ÖG…4ý>žLEAçÇ !“À0žç'´f´¡ºªÈ$òdhä¸@P™3ínƒ»eä°¡Þ‹·r1ÐZ.<ÑŠ\&4Òi«\¢x25NxÊ’Ç=†…ŒMo¯i·á%¨6= 5SŽ$Í$çΘÙB†Éeµ8Ê’ðgØófU›Ä–•“kQK!&7ŽûÁÊø“/Õ[Žw/B€ÅúÍÁ§€¿*¶q7ìœÒËA)&.ĵۡˆlðñÜš.aÑ­7Î;ûB•z7µ\Ë3öô´ÀIó–Ü™UöM·Õ5öþò…ú d•ÂZ#Æ<,'n*3¡+JÜFŽÜ0c²ÝnykUÛˆl ‹¯­l³Û,àrc¨BÙ1?—º387ìz€Ñ0ê°³ëXÂ''ÝðYؘÕš9•–Óég £þ¦cE“cp†®(+œ3ÕÃ…x®’"­×ð%B)"à3++6v¥×¸÷8ânWOø£O;öÆPѼ °Ô¾+üÜÃÊ@¸¶‘ªÍìÖ NF– À­îçÿêgG~ãj Ù…ó'žuLQxËJl#„øCLð©–a.øýD,ÀnjÝÒÐ{×ó;à'Ô@å)BZ Ì (ÀJEé*B2 [Õ@2•å0HñE0 ƒÖÞ$€#6T¬jðÖ5Ž`ï=øÌfÅjpà#á9„•M°i|FÇÄ©FÂŒ†ZD…†_Ùì âÄÑÑì ½õñõ8E€Ò> š_[CÔ?oVYuUI¨l†×´²ê-¡„Ù~Fk°×â’s²z°N«åLTǺÌ`xâ/üÄÇíníÍRÔÔZÙäû㓟6nÝ5ÆÒÙ³çW€åîöПîVúº…5;â;À·i(›”‚Ó¢¢"·®Gœü?W-þúUÉXép÷×sL…¹ov¸å¬C0ذùˆÞ¹»ÿ7/îÈ·- Mw(Œ=èƒ4 7t‹=Ì2¾p—ÁPÉMMºj*œV!«šx “El()r>¸|{®q ¾µ¦cMG8ŒBTˆe“Ô ©¦¯rbH_mH"²ZD…†_)&—U?óvóh¨ 4þòzÀbÄñôž@JZˆ@È͡޳N;ŒvÚføÕÙUL´‚ê-ã¢Qf¹“O9Êhôs½‡RZq­ Šìméïjê~wKï{[ú‚ûô>€ûBB}G`UÃÀ+Û}òÓWÞØ`¶å$o&žÃ¤äÑ -÷u¿Oò +·Á„áhíŸ0AŸeíq¯^vÝ™xÃöûÓïòk~µu[]´lím–xˆ™r8ÈoÝÐ~ð¥úë.™›G§"í(€”Å[JÍh<æÞll˜‘5‘€½DK×î|¡A°¸²¶Í„ñò{Ų?ÿ»ùÒ“'{œ)=ÇVÔõ¿»µ¯»¹ï©c±üšŸþL±˜Ç•cŽyÚ¡³´&‘“`àQÐñEågßo»hiu‘;¶‘î¥Oö®Øíóîõ†<4Ÿ+l£Nsðìÿ<:©žä(ÍJh¸ÎÖ&BOÆÊYfW ÏÏûò/½º+R<-¹ hOiØÙŇy“ EÅÙ5žêb;]qŠ€Í꘸Aæ½!¡½;¼e{ïêõ-[w÷ËaÑŠbZ¤Õ²?‘”nÞ@ie•À`ð÷wIýÝüš- mA"w¾@hŠƒâÉKEQæÖxcÅW^|âÿ/‘9ý¿Ãn}ì¡_óÝ_mÞQ/ÍÄÈ–ÆJV¹ ë†|€ß¹©‹RþÃô_çâ(ÓôRi@öí@Á+˜J¡x&j AzÆä…F‘SO:ì©gVq±Jµ½i¡Ų́Ÿ¯ßÒ:©ÈþQ¹samÎ]Æ[;´;?$ÔµW­ß»âÃÆÞN?”ÔÚ@ %aüéClxÊi¡<} "ABõ2JÀdóº=Å6SËrÄôB¼sëÄI`ø6Q ó± ¸½-°­¾wÛÚ=ƒ]R­ŒnX%Â{üíç^tTyŽƒ]1 Âm“Lm”VP»e«bÙ„Û`øÞ5ç¾üâõ–hYÌ—¨4šŒ ÍÍÞ>ï–]õG^3gFɤ2{‘Ëj³ÒKxu ‡ ÛbœðÓ¯~åæöÁ&¾p I¹ ¤63øø{D";6µ‰ð¾ø÷.™‡”q¤Zk¤YÑPÛ˲1ÌFÁ‘‡Í˜6ʧ{@°£dzavºFúï¼¾µqGçÑ ª&×ÚíæpXlnó­§mú^|¯[%h‰ˆÑ âDÿ°âÿÙ?œ¯,ÐY¿Ù):ué%åi %‚¶‘ÈkolßÕÐݸ¸fтʉU (8v%ˆ†.o¤®¡oŪ–Õ[:ä°¬†F´$@ˆBœÌbЬô^s%Î]É ÀÞ$íM0’à Cð U¥?þñ…÷üê5¹òpxòãåeU8ø¡ÁÈ'ëZñ&Ù”š’Ùó&̨-¨öØ ±y­eƒO“‹3ÚÛholïlé ø}Q‹€ï¤ámMcLUÌ£öÙ`…„¹Wêêä×lÂû ¹f© ºh‘„ÆðÉmôKÆsN>ó7ЧhF ¥%yöç—]y[wß.Á3mTã^sí5ljÅ2ÖsoX.=sf†ò©Ö‘žÓ¸Áx˜@fHKk$ ¦ú¯¸\öÕ“ï¼ó£¥J8ëðȰrL¢Ô¸­W ïÕƒo0{dÞ;¼æ ÁÂd³ÆèeÔ˜©g¼d‚"©†<%)4í—fÈ8Z»ÏÁ®¸˜¼k{WãÎn›ÇVYì,-°¹ìØ%iDb]áξ/x€§V* T­áÃÐÀp/qÞúýïù5ÕeYëA" šaðX"G2Jckâaúÿ+/;ã½÷ÖoØØ ÏŽë–% ÝŠ ßÜÙÞÒÜg+qÔºlÓ`ZE£À—Ý$ˆ^¼è ¼MÄQætì­u²÷iç)ãÿ„ͨ C:>cº¡Æ ™•h$xÿ/äî~íF9(Ñg¼¨Øž{ФjH!i³O ->ìü{4á„Ñ…êªÒ'½ék_¹i0ÈÅ\SGSŒ õ†ê7·ƒ”˜^{ñÜñUç3 '¨‘`¸,Ù›rÉ'?óÌ[­]í¢kRÖÎWÛ‚G]V‹b‚S•ãp‡ÈŠY£]å…E]b }fÔFeÉÆÎ|²"™&×ãp*&‚/ºw ÒÁà¡»QßüÄ«ó˜ƒhR=¨Z»S›cöíš»°ôŠKÿ3nú 3|’PJ†ƒ¼´Yhž=` êïïÿáùßÐëm fhcHø-IrõŒÝ,uÐØ@Š€‘dãÈ-ãú´&±ú˜):ø(¾ý6!ѵ㠌#†ÿòéÞµëe_Œy­¨³¨OX¯eüÒ‡¡A€-9pÜ¢óþò¤Õ1†Õ \;¹ò™¿Ýæ±ôZ‚Í4c´f"9âø2¼ìö5nm_µµû_ï7K»‡€0U€îF¼ìG†"Ú-1,9\R{uDΘÍf¹ÿžïÅ‚»,<>¯`³^j§OÒ—qÕ Åí}õwÝ~ÕäÉ¥8'Èh¸iÂ¥ÄÙƒ*-TP-«ÁOÐV–'Fnw|ÈÁb ËŠ Æ$@“Da,ÓJ¥b‚tÙÜ]äüñã%Û츨©LÁ¢:µ Úod‚6 „’â‚åÏÞVU1ÔáXúdò&·‘A¦¡ &qÌb`'™1bÔâWfÛ\…µ=¹ßÑXÅÌ÷)Ýëæ,ô,[6>Ÿ?–$ÿïÍoÛùt£ÐÓ. ŒãÙ/<‚FƦÌm÷Ë=S§œóÇÇlîÔw®‡¡wÒ£Ó&>öÈ f©Ínc2Œ®Òhò¥Åé)Îh vx¶µ=÷ή¾·' Ø~GÁI2U vI h·ìäj8~ʅǼ¹µwÝum´s£9Ò‰ž#…)¼×J—˜í¢GLáッ’9¸'Ü·ù·}ké± ÉrE)’Ÿt Ɉ€Ëž}0%æ&c•Ú¨–EÓÔÖ©ŠKQS¨ÙéÂ|›%¦SC«”uP¼¸–;Øš‚»ÌRûßXY‘mí7™FŒÏ¨ù$>xI£4ÈB¥ ;d¼‹˜¤ “Ë&âUUeÏ<}ÛÄJYêY1äh¤µ‹Ý¦7œ5Pm˜m¨-¬jòÜè`潜ws¤kÝE_Y‚ŠÊËŠ5ï×ÿa¶ÑCVÿòÇ# ¶mr7Ogï©ü 5ƒh¿IQfwvñRÛô‰/ÿ›³x¤NÊÌa §?úè ß¼òv,pvõÌÑ\ú ذ`2Û{[8åi!V豞pôÄÜàÇðD’R)XHš¥¦cBŒ… ¦˜å€òÑÔtñ'Ãáù£þÎì¨1º&rFl9kª&"xN *Û P@Ý󽢿µ¬Òüà}7œzòbd’E‰NÁB7ejZ2"Ÿ}g5µ‡I8ëÌx}Ú?2­ékb+¿¶à7×ô òŠ£š‘ ûN8Ê4‡~‰ÛRDl,*}äsgOÑ€çŠ`å ‡¥à!”4ª3’Ác0YµÔì&V—½°ü®»îùËò¿½kwW›\5²…)mÓ˪8k€Ro©x„D‡UðÞX¨3Ì÷/]¶ð¿¿óÝ¥Ç.ÐJídXŽF:î¾­ñ_ÿöÃ1¿@–“Hò‹N¡_ryRV#=¢2ÁbQ¾fâµÏüÕ]Z¾Ÿ-9öèy?qãå_¿Aâð9ø¸Y*‚O«ŠÒSJ£¿ÈVn Íýýu«¯þæ—¾}űxGt?ÑÀÄF¶ÁWÆúO…2@0zxÜ B$Ú÷ëËg/›:µæŽ;]±r¥ÃYn±—p&̼X»TÊAe,hDcB@Œz Lß¼öKÿuÕpþ©m4™câ@gÅ;üÀþ¨K(€Ûqhž_ˆä˜¤8yŒâ<­ŠŸZRýÅ×x1Š}ô¼ .8éâK® z­Xíc®Œ³]Y}TÞ7ü@*ÑŽð@ÓY_>êg7^ ± søß€¯_ðï6X¬hv"¨QÖ,·$ÒÊ]ÒóD¾´ÿ%Åž{~ùßçsâoîzÍêÝŽ*³§š³+ô‘&@S!€(GM§ÎEPiHQ•ˆ²!2ƒb´?éu¹Œ_>÷„K¿vÆQGÌ¡ÌãÆA€ý M»D«tæù°MÔŒ·˜58§<Ì‚ä¸%W\^8a´Ÿ®Ð`fÀ,|æé;Þzk%£!ÑV ìâ&³$p–¹¾¶}ý$„´bÕIDATs++öת™6¥äˆÃ‹Ñà–DU`ÕÍÁ„„<$0?m³gd{«&QfÄÿ æM{î¯w½ýîê_z{å*¼Þá·š&|·ßÐb‚‹Ã˜b1¾¼¼`É’9'/;óœsN,-MiÝ1‹'w·í± ¡H~P1†<à«”VOÌ!<è: Åĸaˆ{rŸ«qbë€/4ëä#ÿþÂÝ7ÝüûÕ«Wº k¶rÎdÇ`ÆZ—Ü#1# ÞHpom­û»7]û•‹â/ŸH d˜?·J õ‘C›dTe5´°Sù®¥òвÑoà9áøEÇ{÷­{éå·ß~çÓHŸÁf)2Û 8‹‹3; FœöºÁÊfØAðF„¨HYÅÄ€Àû…X ¼Òsæ9K–,¹è¤y0švfËCÃm¶t=í¡@0nÚÕÖÜÜÑÖÞíõú°á´¢¼dâÄŠI5U“'WhG%ŒO‹>^Uÿï>ÁÙ«hNcÈ R0ˆ}wÞòŸçw¢Z嫯}øÈ#߸i·Õг¤ÝFˆÆRõ°xI ãûß8Röˆ#f\~ÙYç{²Í6Ú•ˆñiÒ°PúûV­ÙºjÕ¦ŸlìèðCN˜„GìØ euÚ»ƒüp¨Ý”ÚÊY³§.Z4kÉÑ fΘTP0>Û­†APàaˆ£?ÊBWíüÎÿ{œ³U¦Ko"/˜[½àóÏ_–H£ÿ[¶6~ôñúM›v¶µ÷aì}4›-EÅ®©Sª:jþ’%‹fÏš’œÿ³çy!Žt÷xü=}ƒÐfÇ ‚Óå„‚Åܤ¼¬¸°È“åÄŸ|¶dLè|¢§ÃþÌQŽˆ.y¶ÓÔo¦äÇföxRšaÑ™¸ÔQÄ»CðôGÿé°dP%»WqqáA©=W¥ºç¢Œžž4É„ô&œX92©Óþì‘ ;?ç3ýÁX( Óq,ÔÒó‚PtÆrÜ™ƒ$ºc%aÆ;Yàñ¦è-eÇ—‘Ð\Õ”Ž;Ù雀³¯ú~hs€Û¨ ð&ø¡_)Wü Íã+BšÒ%QVWsýÆ~æ[  ðg¾‹>ƒ’Î%šÖ€AÝŠD..Z Õ¤9ñXÿŸ 蜺~®¡²í$Ã$®I!~ éÕ8‰,yêœWò~N“ˆª&tB‚Õ-Zs“fÈZšÉtÎU?ß0U;äÄ¢Ö¦¨\]8ÐøÀÑúsT6“f›øÓ¤—I3{ø9jïg·)ºvûæ3ŠM~! Ì„NXÐI¨Ò«Hê{I‰z4_Ð8_”ýÃÅN¶+S÷Âv“šô³òOø«³ù¯H¯ásBZä…xÒ2û7K“ØÒ]~Toëø@QúsUO²ô¦iZÜêëÀ®³u |àhýù¨‰Ô+LtslðÈvòFŽÜzò~Q@àý"ß³°zŽ*„8©ù°¬Õ‹„;îNz¬GóDÝ„Îa?·`c¢ôw™Bì3ˆä²J j:ƒJrœ‰—š[¿Û_ 輿ü¢•Ÿ:­êÿ~v9> K9Ñvrl!®ªdúâΩZ4-ñTÿŸG èGê䑸:hù¦€>Î7…uø:òH]€óH\´N|S@à|SX‡¯S Ð8ÄÕAëÈ7tÎ7…uø:òH]€óH\´N|S@à|SX‡¯S Ð8ÄÕAëÈ7tÎ7…uø:òH]€óH\´N|S@à|SX‡¯S Ð8ÄÕAëÈ7tÎ7…uø:òH]€óH\´N|S@à|SX‡¯S Ð8ÄÕAëÈ7tÎ7…uø:òH]€óH\´N|S@à|SX‡¯S Ð8ÄÕAëÈ7tÎ7…uø:òH]€óH\´N|S@à|SX‡¯S øÿ{``‚ŽZ¡úIEND®B`‚qt-client-4.1.0/common/importhelper.cpp000066400000000000000000000604751217451700100201340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "importhelper.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "exporthelper.h" #define MAXCSVFIRSTLINE 2048 #define DEFAULT_SAVE_DIR "done" #define DEFAULT_ERR_DIR "error" #define DEFAULT_SAVE_SUFFIX ".done" #define DEFAULT_ERR_SUFFIX ".err" #define DEBUG false static QString getUniqueFileName(QString poriginalname) { QString newname = poriginalname; if (QFile::exists(newname)) newname = newname + QDate::currentDate().toString(".yyyy.MM.dd"); if (QFile::exists(newname)) newname = newname + QDateTime::currentDateTime().toString(".hh.mm"); if (QFile::exists(newname)) newname = newname + QDateTime::currentDateTime().toString(".ss"); for (int i = 0; QFile::exists(newname) ; i++) newname = newname + "." + QString::number(i); if (DEBUG) qDebug("getUniqueFileName returning %s", qPrintable(newname)); return newname; } CSVImpPluginInterface *ImportHelper::_csvimpplugin = 0; CSVImpPluginInterface *ImportHelper::getCSVImpPlugin(QObject *parent) { if (! _csvimpplugin) { if (! parent) parent = QApplication::instance(); foreach (QPluginLoader *loader, parent->findChildren()) { QObject *plugin = loader->instance(); if (plugin) { _csvimpplugin = qobject_cast(plugin); if (_csvimpplugin) { XSqlQuery defq; defq.prepare("SELECT fetchMetricText(:datadir) AS datadir," " fetchMetricText(:atlasdir) AS atlasdir;"); #if defined Q_WS_MACX defq.bindValue(":datadir", "XMLDefaultDirMac"); defq.bindValue(":atlasdir", "CSVAtlasDefaultDirMac"); #elif defined Q_WS_WIN defq.bindValue(":datadir", "XMLDefaultDirWindows"); defq.bindValue(":atlasdir", "CSVAtlasDefaultDirWindows"); #elif defined Q_WS_X11 defq.bindValue(":datadir", "XMLDefaultDirLinux"); defq.bindValue(":atlasdir", "CSVAtlasDefaultDirLinux"); #endif defq.exec(); if (defq.first()) { _csvimpplugin->setCSVDir(defq.value("datadir").toString()); _csvimpplugin->setAtlasDir(defq.value("atlasdir").toString()); } else if (defq.lastError().type() != QSqlError::NoError) qWarning("%s", qPrintable(defq.lastError().text())); break; // out of foreach } } } } if (DEBUG) qDebug("ImportHelper::getCSVImpPlugin(%p) returning %p", parent, _csvimpplugin); return _csvimpplugin; } /** \brief Obey the import file configuration and remove or rename the file that has just been imported. \param[in] pfilename The name of the file that has just been imported. \param[in] success An indication of whether the import succeeded or not. This controls whether the import file pfilename will be handled using the configuration for successful imports or failed imports. \param[out] errmsg Any error message generated during file handling. \param[in] saveToErrorFile If this is not an empty string, the string is saved to an error file using the configuration for handling error files. \return true if the file was handled successfully, false if there was an error moving or deleting the file. */ bool ImportHelper::handleFilePostImport(const QString &pfilename, bool success, QString &errmsg, const QString &saveToErrorFile) { if (DEBUG) qDebug("handleFilePostImport(%s, %d, errmsg, %s)", qPrintable(pfilename), success, qPrintable(saveToErrorFile)); bool returnValue = false; QString xmldir; QString destdir; QString suffix; QString filetreatment; QString errfiledir; QString errfilesuffix; QString errtreatment; XSqlQuery q; q.prepare("SELECT fetchMetricText(:xmldir) AS xmldir," " fetchMetricText('XMLSuccessDir') AS successdir," " fetchMetricText('XMLSuccessSuffix') AS successsuffix," " fetchMetricText('XMLSuccessTreatment') AS successtreatment," " fetchMetricText('ImportFailureDir') AS failuredir," " fetchMetricText('ImportFailureSuffix') AS failuresuffix," " fetchMetricText('ImportFailureTreatment') AS failuretreatment;"); #if defined Q_WS_MACX q.bindValue(":xmldir", "XMLDefaultDirMac"); #elif defined Q_WS_WIN q.bindValue(":xmldir", "XMLDefaultDirWindows"); #elif defined Q_WS_X11 q.bindValue(":xmldir", "XMLDefaultDirLinux"); #endif q.exec(); if (q.first()) { xmldir = q.value("xmldir").toString(); if (success) { destdir = q.value("successdir").toString(); suffix = q.value("successsuffix").toString(); filetreatment = q.value("successtreatment").toString(); } else { destdir = q.value("failuredir").toString(); suffix = q.value("failuresuffix").toString(); filetreatment = q.value("failuretreatment").toString(); } errfiledir = q.value("failuredir").toString(); errfilesuffix = q.value("failuresuffix").toString(); errtreatment = q.value("failuretreatment").toString(); } else if (q.lastError().type() != QSqlError::NoError) { errmsg = q.lastError().text(); return false; } else { errmsg = tr("Could not find the metrics for handling import results."); return false; } if (xmldir.isEmpty()) xmldir = "."; if (destdir.isEmpty()) destdir = success ? DEFAULT_SAVE_DIR : DEFAULT_ERR_DIR; if (suffix.isEmpty()) suffix = success ? DEFAULT_SAVE_SUFFIX : DEFAULT_ERR_SUFFIX; if (errfiledir.isEmpty()) errfiledir = DEFAULT_ERR_DIR; if (errfilesuffix.isEmpty()) errfilesuffix = DEFAULT_ERR_SUFFIX; QFile file(pfilename); // handle error file first. if it fails, don't delete the primary import file if (! saveToErrorFile.isEmpty() && errtreatment != "Delete" && errtreatment != "None") { if (errtreatment == "Move") errfilesuffix = ""; else if (errtreatment == "Rename") errfiledir = "."; /* else if (errtreatment == "Delete") ; // should never reach here else if (errtreatment == "None") ; // should never reach here */ if (QDir::isRelativePath(errfiledir)) errfiledir = xmldir + QDir::separator() + errfiledir; QString errname = errfiledir + QDir::separator() + QFileInfo(file).fileName() + errfilesuffix; errname = getUniqueFileName(errname); if (DEBUG) qDebug("handleFilePostImport about to try saving err file %s", qPrintable(errname)); QFile *errorfile = new QFile(errname); if (! errorfile->open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text) || ! (errorfile->write(saveToErrorFile.toUtf8()) >= saveToErrorFile.length())) { // don't delete the original import file if we couldn't save the error file errmsg += (errmsg.isEmpty() ? "" : "\n") + tr("

Could not write error file %1 after processing %2 (%3). %4") .arg(errname, pfilename, errorfile->errorString(), (filetreatment == "Delete" ? tr("Trying to save backup copy.") : QString())); if (filetreatment == "Delete") { filetreatment == "Rename"; suffix = DEFAULT_ERR_SUFFIX; } } errorfile->close(); } if (filetreatment == "Delete") { if (file.remove()) returnValue = true; else errmsg = tr("Could not remove %1 after successful processing (%2).") .arg(pfilename, file.error()); } else if (filetreatment == "Rename") { QString newname = pfilename + suffix; newname = getUniqueFileName(newname); if (file.rename(newname)) returnValue = true; else errmsg = tr("Could not rename %1 to %2 after successful processing (%3).") .arg(pfilename, newname).arg(file.error()); } else if (filetreatment == "Move") { if (QDir::isRelativePath(destdir)) destdir = xmldir + QDir::separator() + destdir; QDir donedir(destdir); if (! donedir.exists()) donedir.mkpath(destdir); QString newname = destdir + QDir::separator() + QFileInfo(file).fileName(); newname = getUniqueFileName(newname); if (file.rename(newname)) returnValue = true; else errmsg = tr("

Could not move %1 to %2 after successful processing (%3).") .arg(pfilename, newname).arg(file.error()); } else if (filetreatment == "None") returnValue = true; else errmsg = tr("

Don't know what to do %1 after import " "so leaving it where it was.").arg(pfilename); if (DEBUG) qDebug("ImportHelper::handleFilePostImport returning %d", returnValue); return returnValue; } bool ImportHelper::importCSV(const QString &pFileName, QString &errmsg) { errmsg = QString::null; QFile file(pFileName); if (! file.open(QIODevice::ReadOnly)) { errmsg = tr("Could not open %1: %2").arg(pFileName, file.errorString()); return false; } QString firstline(file.readLine(MAXCSVFIRSTLINE)); file.close(); if (firstline.isEmpty()) { errmsg = tr("Could not read the first line from %1").arg(pFileName); return false; } XSqlQuery mapq; mapq.prepare("SELECT atlasmap_name, atlasmap_atlas," " atlasmap_map, atlasmap_headerline," " CASE WHEN (:filename ~ atlasmap_filter) THEN 0" " WHEN (:firstline ~ atlasmap_filter) THEN 1" " END AS seq" " FROM atlasmap" " WHERE ((:filename ~ atlasmap_filter AND atlasmap_filtertype='filename')" " OR (:firstline ~ atlasmap_filter AND atlasmap_filtertype='firstline'))" " ORDER BY seq LIMIT 1;"); mapq.bindValue(":filename", pFileName); mapq.bindValue(":firstline", firstline); mapq.exec(); if (mapq.first()) { QString atlasfile = mapq.value("atlasmap_atlas").toString(); QString map = mapq.value("atlasmap_map").toString(); CSVImpPluginInterface *csvplugin = getCSVImpPlugin(); if (csvplugin) { if (! csvplugin->openAtlas(atlasfile)) errmsg = tr("Could not open Atlas %1").arg(atlasfile); else if (! csvplugin->setAtlasMap(map)) errmsg = tr("Could not set Map to %1").arg(map); else if (! csvplugin->openCSV(pFileName)) errmsg = tr("Could not open CSV File %1").arg(pFileName); else if (! csvplugin->setFirstLineHeader(mapq.value("atlasmap_headerline").toBool())) errmsg = tr("Could not set first line status"); else if (! csvplugin->importCSV()) errmsg = tr("Could not import the CSV data from %1").arg(pFileName); errmsg += (errmsg.isEmpty() ? "" : "\n") + csvplugin->lastError(); } } else if (mapq.lastError().type() != QSqlError::NoError) errmsg = mapq.lastError().text(); else errmsg = tr("Could not find a Map or Atlas for %1").arg(pFileName); if (! handleFilePostImport(pFileName, errmsg.isEmpty(), errmsg)) return false; return errmsg.isEmpty(); } bool ImportHelper::importXML(const QString &pFileName, QString &errmsg, QString &warnmsg) { if (DEBUG) qDebug("ImportHelper::importXML(%s, errmsg)", qPrintable(pFileName)); QString xmldir; QString xsltdir; QString xsltcmd; QStringList errors; QStringList warnings; bool saveErrorXML = false; XSqlQuery q; q.prepare("SELECT fetchMetricText(:xmldir) AS xmldir," " fetchMetricText(:xsltdir) AS xsltdir," " fetchMetricText(:xsltcmd) AS xsltcmd," " fetchMetricBool('ImportXMLCreateErrorFile') AS createerr;"); #if defined Q_WS_MACX q.bindValue(":xmldir", "XMLDefaultDirMac"); q.bindValue(":xsltdir", "XSLTDefaultDirMac"); q.bindValue(":xsltcmd", "XSLTProcessorMac"); #elif defined Q_WS_WIN q.bindValue(":xmldir", "XMLDefaultDirWindows"); q.bindValue(":xsltdir", "XSLTDefaultDirWindows"); q.bindValue(":xsltcmd", "XSLTProcessorWindows"); #elif defined Q_WS_X11 q.bindValue(":xmldir", "XMLDefaultDirLinux"); q.bindValue(":xsltdir", "XSLTDefaultDirLinux"); q.bindValue(":xsltcmd", "XSLTProcessorLinux"); #endif q.exec(); if (q.first()) { xmldir = q.value("xmldir").toString(); xsltdir = q.value("xsltdir").toString(); xsltcmd = q.value("xsltcmd").toString(); saveErrorXML = q.value("createerr").toBool(); } else if (q.lastError().type() != QSqlError::NoError) { errmsg = q.lastError().text(); return false; } else { errmsg = tr("Could not find the XSLT directory and command metrics."); return false; } if (xmldir.isEmpty()) xmldir = "."; QDomDocument doc(pFileName); if (!openDomDocument(pFileName, doc, errmsg)) return false; QString doctype = doc.doctype().name(); if (DEBUG) qDebug("initial doctype = %s", qPrintable(doctype)); if (doctype.isEmpty()) { doctype = doc.documentElement().tagName(); if (DEBUG) qDebug("changed doctype to %s", qPrintable(doctype)); } QString tmpfileName; if (doctype != "xtupleimport") { QString xsltfile; XSqlQuery q; q.prepare("SELECT xsltmap_import FROM xsltmap " "WHERE ((xsltmap_doctype=:doctype OR xsltmap_doctype='')" " AND (xsltmap_system=:system OR xsltmap_system=''));"); q.bindValue(":doctype", doctype); q.bindValue(":system", doc.doctype().systemId()); q.exec(); if (q.first()) xsltfile = q.value("xsltmap_import").toString(); else if (q.lastError().type() != QSqlError::NoError) { errmsg = q.lastError().databaseText(); return false; } else { errmsg = tr("

Could not find a map for doctype '%1' and system id '%2'" ". Write an XSLT stylesheet to convert this to valid xtuple " "import XML and add it to the Map of XSLT Import Filters.") .arg(doctype, doc.doctype().systemId()); return false; } tmpfileName = xmldir + QDir::separator() + doctype + "TOxtupleimport"; if (! ExportHelper::XSLTConvertFile(pFileName, tmpfileName, q.value("xsltmap_import").toString(), errmsg)) return false; if (! openDomDocument(tmpfileName, doc, errmsg)) return false; } /* xtupleimport format is very straightforward: top level element is xtupleimport second level elements are all table/view names (default to api schema) third level elements are all column names and there are no text nodes until third level wrap the import of an entire file in a single transaction so we can reimport files which have failures. however, if a view-level element has the ignore attribute set to true then rollback just that view-level element if it generates an error. */ // the silent attribute provides the user the option to turn off // the interactive message for the view-level element QDomDocument errorDoc; QDomElement errorRoot = errorDoc.appendChild(errorDoc.createElement("xtupleimport")).toElement(); q.exec("BEGIN;"); if (q.lastError().type() != QSqlError::NoError) { errmsg = q.lastError().databaseText(); return false; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); QRegExp apos("\\\\*'"); for (QDomElement viewElem = doc.documentElement().firstChildElement(); ! viewElem.isNull(); viewElem = viewElem.nextSiblingElement()) { QStringList columnNameList; QStringList columnValueList; bool ignoreErr = (viewElem.attribute("ignore", "false").isEmpty() || viewElem.attribute("ignore", "false") == "true"); bool silent = (viewElem.attribute("silent", "false").isEmpty() || viewElem.attribute("silent", "false") == "true"); QString mode = viewElem.attribute("mode", "insert"); QStringList keyList; if (! viewElem.attribute("key").isEmpty()) keyList = viewElem.attribute("key").split(QRegExp(",\\s*")); QString viewName = viewElem.tagName(); if (viewName.indexOf(".") > 0) ; // viewName contains . so accept that it's schema-qualified else if (! viewElem.attribute("schema").isEmpty()) viewName = viewElem.attribute("schema") + "." + viewName; else // backwards compatibility - must be in the api schema viewName = "api." + viewName; QString savepointName = viewName; savepointName.remove("."); XSqlQuery rollbacktosavepoint; if (ignoreErr || saveErrorXML) { q.exec("SAVEPOINT " + savepointName + ";"); rollbacktosavepoint.prepare("ROLLBACK TO SAVEPOINT " + savepointName + ";"); } bool haveSavepoint = (ignoreErr || saveErrorXML); if (mode.isEmpty()) mode = "insert"; else if (mode == "update" && keyList.isEmpty()) { if (! viewElem.namedItem(viewName + "_number").isNull()) keyList.append(viewName + "_number"); else if (! viewElem.namedItem("order_number").isNull()) keyList.append("order_number"); else { if (haveSavepoint) rollbacktosavepoint.exec(); if (ignoreErr || saveErrorXML) { warnings.append(tr("Cannot process %1 element without a key attribute")); if (saveErrorXML) errorRoot.appendChild(errorDoc.importNode(viewElem, true)); } else errors.append(tr("Cannot process %1 element without a key attribute")); continue; // back to top of viewElem for loop } if (! viewElem.namedItem("line_number").isNull()) keyList.append("line_number"); } for (QDomElement columnElem = viewElem.firstChildElement(); ! columnElem.isNull(); columnElem = columnElem.nextSiblingElement()) { QString value = columnElem.attribute("value").isEmpty() ? columnElem.text() : columnElem.attribute("value"); if (DEBUG) qDebug("%s before transformation: /%s/", qPrintable(columnElem.tagName()), qPrintable(value)); columnNameList.append(columnElem.tagName()); if (value.trimmed() == "[NULL]") columnValueList.append("NULL"); else if (value.trimmed().startsWith("SELECT")) columnValueList.append("(" + value.trimmed() + ")"); else if (columnElem.attribute("quote") == "false") columnValueList.append(value); else columnValueList.append("'" + value.replace(apos, "''") + "'"); if (DEBUG) qDebug("%s after transformation: /%s/", qPrintable(columnElem.tagName()), qPrintable(value)); } QString sql; if (mode == "update") { QStringList whereList; for (int i = 0; i < keyList.size(); i++) whereList.append("(" + keyList[i] + "=" + columnValueList[columnNameList.indexOf(keyList[i])] + ")"); for (int i = 0; i < columnNameList.size(); i++) columnNameList[i].append("=" + columnValueList[i]); sql = "UPDATE " + viewName + " SET " + columnNameList.join(", ") + " WHERE (" + whereList.join(" AND ") + ");"; } else if (mode == "insert") sql = "INSERT INTO " + viewName + " (" + columnNameList.join(", ") + " ) SELECT " + columnValueList.join(", ") + ";" ; else { if (haveSavepoint) rollbacktosavepoint.exec(); if (! ignoreErr) errors.append(tr("Could not process %1: invalid mode %2") .arg(viewElem.tagName(), mode)); continue; // back to top of viewElem for loop } if (DEBUG) qDebug("About to run this: %s", qPrintable(sql)); q.exec(sql); if (q.lastError().type() != QSqlError::NoError) { if (haveSavepoint) rollbacktosavepoint.exec(); if (ignoreErr) { if (! silent) warnings.append(tr("Ignored error while importing %1:\n%2") .arg(viewElem.tagName(), q.lastError().text())); } else if (saveErrorXML) { warnings.append(tr("Error processing %1. Saving to retry later:\t%2") .arg(viewElem.tagName(), q.lastError().text())); QDomNode nodecopy = errorDoc.importNode(viewElem, true); nodecopy.appendChild(errorDoc.createComment(q.lastError().text())); errorRoot.appendChild(nodecopy); } else { errors.append(tr("Error importing %1: %2") .arg(pFileName, q.lastError().databaseText())); continue; // back to top of viewElem for loop } } else if (haveSavepoint) q.exec("RELEASE SAVEPOINT " + savepointName + ";"); } q.exec("COMMIT;"); if (q.lastError().type() != QSqlError::NoError) { rollback.exec(); errmsg = q.lastError().databaseText(); return false; } if (! tmpfileName.isEmpty()) QFile::remove(tmpfileName); if (warnings.size() > 0) warnmsg = warnings.join("\n"); QString fileerrmsg; if (! handleFilePostImport(pFileName, errors.size() == 0, fileerrmsg, errorRoot.hasChildNodes() ? errorDoc.toString() : QString())) { errors.append(fileerrmsg); return false; } errmsg = errors.join(tr("\n")); return errors.size() == 0; } bool ImportHelper::openDomDocument(const QString &pFileName, QDomDocument &pDoc, QString &errmsg) { QFile file(pFileName); if (!file.open(QIODevice::ReadOnly)) { errmsg = tr("

Could not open file %1 (error %2)") .arg(pFileName, file.error()); return false; } QString errMsg; int errLine; int errColumn; if (!pDoc.setContent(&file, false, &errMsg, &errLine, &errColumn)) { file.close(); errmsg = tr("Problem reading %1, line %2 column %3:
%4") .arg(pFileName, errLine).arg(errColumn).arg(errMsg); return false; } file.close(); return true; } // scripting exposure ////////////////////////////////////////////////////////// Q_DECLARE_METATYPE(QDomDocument) static QScriptValue openDomDocument(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() < 2) context->throwError(QScriptContext::UnknownError, "not enough args passed to openDomDocument"); QDomDocument domdoc = qscriptvalue_cast(context->argument(1)); QString errmsg; bool result = ImportHelper::openDomDocument(context->argument(0).toString(), domdoc, errmsg); // TODO: how to we pass back errmsg output parameter? return QScriptValue(result); } static QScriptValue importXML(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() < 1) context->throwError(QScriptContext::UnknownError, "not enough args passed to importXML"); QString errmsg; QString warnmsg; bool result = ImportHelper::importXML(context->argument(0).toString(), errmsg, warnmsg); // TODO: how to we pass back errmsg and warnmsg output parameter? return QScriptValue(result); } void setupImportHelper(QScriptEngine *engine) { QScriptValue obj = engine->newObject(); obj.setProperty("importXML", engine->newFunction(importXML), QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("openDomDocument", engine->newFunction(openDomDocument),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ImportHelper", obj, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/common/importhelper.h000066400000000000000000000024201217451700100175630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __IMPORTHELPER_H__ #define __IMPORTHELPER_H__ #include #include #include #include #include class QScriptEngine; class ImportHelper : public QObject { Q_OBJECT public: static CSVImpPluginInterface *getCSVImpPlugin(QObject *parent = 0); static bool handleFilePostImport(const QString &pFileName, bool success, QString &errmsg, const QString &saveToErrorFile = QString::null); static bool importCSV(const QString &pFileName, QString &errmsg); static bool importXML(const QString &pFileName, QString &errmsg, QString &warnmsg); static bool openDomDocument(const QString &pFileName, QDomDocument &pDoc, QString &errmsg); protected: static CSVImpPluginInterface *_csvimpplugin; }; void setupImportHelper(QScriptEngine *engine); #endif qt-client-4.1.0/common/login2.cpp000066400000000000000000000400071217451700100166010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "login2.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dbtools.h" #include "login2Options.h" #include "qmd5.h" #include "storedProcErrorLookup.h" #include "xsqlquery.h" #include "xtsettings.h" #include "splashconst.h" /* TODO: rename _nonxTupleDB to _isxTupleDB internally and set it based on db contents, not command line parameter input */ login2::login2(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { setObjectName(name); Q_INIT_RESOURCE(xTupleCommon); setupUi(this); //_options = _buttonBox->addButton(tr("Options..."), QDialogButtonBox::ActionRole); _recent = _buttonBox->addButton(tr("Recent"), QDialogButtonBox::ActionRole); //_options->setEnabled(false); _recent->setEnabled(false); _buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Login")); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sLogin())); connect(_buttonBox, SIGNAL(helpRequested()), this, SLOT(sOpenHelp())); //connect(_options, SIGNAL(clicked()), this, SLOT(sOptions())); connect(_server, SIGNAL(editingFinished()), this, SLOT(sChangeURL())); connect(_database, SIGNAL(editTextChanged(QString)), this, SLOT(sChangeURL())); connect(_port, SIGNAL(editingFinished()), this, SLOT(sChangeURL())); //connect(_otherOption, SIGNAL(toggled(bool)), _options, SLOT(setEnabled(bool))); //connect(_otherOption, SIGNAL(toggled(bool)), _recent, SLOT(setEnabled(bool))); //connect(_otherOption, SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); _splash = 0; _captive = false; _nonxTupleDB = false; _multipleConnections = false; _setSearchPath = false; _cloudDatabaseURL= "pgsql://%1.xtuplecloud.com:5432/%1_%2"; _password->setEchoMode(QLineEdit::Password); //updateRecentOptionsActions(); _databaseURL = xtsettingsValue("/xTuple/_databaseURL", "pgsql://:5432/demo").toString(); /* if(xtsettingsValue("/xTuple/_demoOption", false).toBool()) _demoOption->setChecked(true); else _prodOption->setChecked(true); if(xtsettingsValue("/xTuple/_cloudOption", false).toBool()) _cloudOption->setChecked(true); else _otherOption->setChecked(true); _company->setText(xtsettingsValue("/xTuple/cloud_company", "").toString()); */ adjustSize(); } login2::~login2() { // no need to delete child widgets, Qt does it all for us } void login2::languageChange() { retranslateUi(this); } int login2::set(const ParameterList &pParams) { return set(pParams, 0); } int login2::set(const ParameterList &pParams, QSplashScreen *pSplash) { _splash = pSplash; QVariant param; bool valid; param = pParams.value("username", &valid); if (valid) { _username->setText(param.toString()); _password->setFocus(); _captive = TRUE; } else { _username->setFocus(); _captive = FALSE; } param = pParams.value("password", &valid); if (valid) { _password->setText(param.toString()); _captive = TRUE; } param = pParams.value("copyright", &valid); if (valid) _copyrightLit->setText(param.toString()); param = pParams.value("version", &valid); if (valid) _versionLit->setText(tr("Version ") + param.toString()); param = pParams.value("build", &valid); if (valid) _build->setText(param.toString()); /* param = pParams.value("cloud", &valid); if (valid) _cloudOption->setChecked(true); */ /* param = pParams.value("company", &valid); if (valid) _company->setText(param.toString()); */ param = pParams.value("name", &valid); if (valid) _nameLit->setText(param.toString()); param = pParams.value("databaseURL", &valid); if (valid) _databaseURL = param.toString(); populateDatabaseInfo(); param = pParams.value("nonxTupleDB", &valid); if (valid) _nonxTupleDB = true; param = pParams.value("multipleConnections", &valid); if (valid) _multipleConnections = true; param = pParams.value("setSearchPath", &valid); if (valid) _setSearchPath = true; if(pParams.inList("login")) sLogin(); sChangeURL(); updateRecentOptions(); updateRecentOptionsActions(); return 0; } void login2::sChangeURL() { buildDatabaseURL(_databaseURL, "psql", _server->text(), _database->lineEdit()->text(), _port->text()); _databaseURL.replace("https://", ""); _databaseURL.replace("http://", ""); populateDatabaseInfo(); } void login2::sHandleButton() { /* if (_otherOption->isChecked()) _loginModeStack->setCurrentWidget(_serverPage); else _loginModeStack->setCurrentWidget(_cloudPage); */ } void login2::sOpenHelp() { QString helpurl = "http://www.xtuple.com/how-do-I-login-to-xTuple-PostBooks"; QUrl url(helpurl); QDesktopServices::openUrl(url); } void login2::sLogin() { QSqlDatabase db; QString databaseURL; databaseURL = _databaseURL; /* if(_cloudOption->isChecked()) { if(_demoOption->isChecked()) databaseURL = _cloudDatabaseURL.arg(_company->text().trimmed(), "demo"); else databaseURL = _cloudDatabaseURL.arg(_company->text().trimmed(), "quickstart"); } */ QString protocol; QString hostName; QString dbName; QString port; parseDatabaseURL(databaseURL, protocol, hostName, dbName, port); if (_splash) { _splash->show(); _splash->raise(); _splash->showMessage(tr("Initializing the Database Connector"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); } // Open the Database Driver if (_multipleConnections) db = QSqlDatabase::addDatabase("QPSQL7", dbName); else db = QSqlDatabase::addDatabase("QPSQL7"); if (!db.isValid()) { if (_splash) _splash->hide(); QMessageBox::warning( this, tr("No Database Driver"), tr("

A connection could not be established with " "the specified Database as the Proper Database " "Drivers have not been installed. Contact your " "Systems Administator.")); return; } if(hostName.isEmpty() || dbName.isEmpty()) { if (_splash) _splash->hide(); QMessageBox::warning(this, tr("Incomplete Connection Options"), tr("

One or more connection options are missing. " "Please check that you have specified the host " "name, database name, and any other required " "options.") ); return; } db.setDatabaseName(dbName); db.setHostName(hostName); db.setPort(port.toInt()); _cUsername = _username->text().trimmed(); _cPassword = _password->text().trimmed(); //_cCompany = _company->text().trimmed(); setCursor(QCursor(Qt::WaitCursor)); qApp->processEvents(); if (_splash) { _splash->showMessage(tr("Connecting to the Database"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); } /* if(_cloudOption->isChecked()) { if(_cCompany.isEmpty()) { QMessageBox::warning(this, tr("Incomplete Connection Options"), tr("

You must specify the Cloud ID name to connect to the cloud.")); return; } } */ db.setUserName(_cUsername); QRegExp xtuplecloud(".*\\.xtuplecloud\\.com"); QRegExp xtuple(".*\\.xtuple\\.com"); bool isCloud = xtuplecloud.exactMatch(hostName); bool isXtuple = xtuple.exactMatch(hostName); QString salt; if(isCloud || isXtuple) { salt = "private"; } else { salt = "xTuple"; } // try connecting to the database in each of the following ways in this order QList > method; method << QPair("requiressl=1", QMd5(QString(_cPassword + salt + _cUsername))) << QPair("requiressl=1", _cPassword) << QPair("requiressl=1", QMd5(QString(_cPassword + "OpenMFG" + _cUsername))) << QPair("", QMd5(QString(_cPassword + salt + _cUsername))) << QPair("", _cPassword) << QPair("", QMd5(QString(_cPassword + "OpenMFG" + _cUsername))) ; int methodidx; // not declared in for () because we'll need it later for (methodidx = 0; methodidx < method.size(); methodidx++) { db.setConnectOptions(method.at(methodidx).first); db.setPassword(method.at(methodidx).second); if (db.open()) break; // break instead of for-loop condition to preserve methodidx } // if connected using OpenMFG enhanced auth, remangle the password if (db.isOpen() && (methodidx == 2 || methodidx == 5)) XSqlQuery chgpass(QString("ALTER USER \"%1\" WITH PASSWORD '%2'") .arg(_cUsername, QMd5(QString(_cPassword + salt + _cUsername)))); else if (db.isOpen() && method.at(methodidx).first.isEmpty()) { XSqlQuery sslq("SHOW ssl;"); //TODO: Add SSL to installer and require it by default for all xTuple users /*if (sslq.first() && sslq.value("ssl").toString() != "on") QMessageBox::warning(this, tr("Could Not Enforce Security"), tr("The connection to the xTuple ERP Server is not " "secure. Please ask your administrator to set " "the 'ssl' configuration option to 'on'."));*/ } if (! db.isOpen()) { if (_splash) _splash->hide(); setCursor(QCursor(Qt::ArrowCursor)); QMessageBox::critical(this, tr("Cannot Connect to xTuple ERP Server"), tr("

Sorry, can't connect to the specified xTuple ERP server. " "

This may be due to a problem with your user name, password, or server connection information. " "

Below is more detail on the connection problem: " "

%1" ).arg(db.lastError().text())); if (!_captive) { _username->setText(""); _username->setFocus(); } else _password->setFocus(); _password->setText(""); return; } /* xtsettingsSetValue("/xTuple/_demoOption", (bool)_demoOption->isChecked()); xtsettingsSetValue("/xTuple/_cloudOption", (bool)_cloudOption->isChecked()); xtsettingsSetValue("/xTuple/cloud_company", _company->text()); */ if (_splash) { _splash->showMessage(tr("Logging into the Database"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); } if(!_nonxTupleDB) { QString loginqry = ""; if (_setSearchPath) loginqry="SELECT login(true) AS result, CURRENT_USER AS user;"; else loginqry="SELECT login() AS result, CURRENT_USER AS user;"; XSqlQuery login( loginqry ); setCursor(QCursor(Qt::ArrowCursor)); if (login.first()) { int result = login.value("result").toInt(); if (result < 0) { if (_splash) _splash->hide(); QMessageBox::critical(this, tr("Error Logging In"), storedProcErrorLookup("login", result)); return; } _user = login.value("user").toString(); _databaseURL = databaseURL; updateRecentOptions(); if (login.exec("SELECT getEffectiveXtUser() AS user;") && login.first() && ! login.value("user").toString().isEmpty()) _user = login.value("user").toString(); // no error check - older databases don't have getEffectiveXtUser accept(); } else if (login.lastError().type() != QSqlError::NoError) { if (_splash) _splash->hide(); QMessageBox::critical(this, tr("System Error"), tr("A System Error occurred at %1::%2:\n%3") .arg(__FILE__).arg(__LINE__) .arg(login.lastError().databaseText())); } else { if (_splash) _splash->hide(); QMessageBox::critical(this, tr("System Error"), tr("

An unknown error occurred at %1::%2. You may" " not log in to the specified xTuple ERP Server " "at this time.") .arg(__FILE__).arg(__LINE__)); } } else { setCursor(QCursor(Qt::ArrowCursor)); _databaseURL = databaseURL; updateRecentOptions(); accept(); } } void login2::sOptions() { ParameterList params; params.append("databaseURL", _databaseURL); if (_multipleConnections) params.append("dontSaveSettings"); login2Options newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) { updateRecentOptions(); _databaseURL = newdlg._databaseURL; populateDatabaseInfo(); updateRecentOptions(); updateRecentOptionsActions(); _username->setFocus(); } } void login2::populateDatabaseInfo() { QString protocol; QString hostName; QString dbName; QString port; parseDatabaseURL(_databaseURL, protocol, hostName, dbName, port); _server->setText(hostName); _database->lineEdit()->setText(dbName); _port->setText(port); } QString login2::username() { return _cUsername; } QString login2::password() { return _cPassword; } QString login2::company() { return _cCompany; } bool login2::useCloud() const { //return _cloudOption->isChecked(); return false; } void login2::setLogo(const QImage & img) { if(img.isNull()) _logo->setPixmap(QPixmap(":/login/images/splashXTuple.png")); else _logo->setPixmap(QPixmap::fromImage(img)); } void login2::updateRecentOptions() { //if (_cloudOption->isChecked()) // return; QStringList list = xtsettingsValue("/xTuple/_recentOptionsList").toStringList(); _recent->setEnabled(list.size()); list.removeAll(_databaseURL); list.prepend(_databaseURL); xtsettingsSetValue("/xTuple/_recentOptionsList", list); xtsettingsSetValue("/xTuple/_databaseURL", _databaseURL); } void login2::updateRecentOptionsActions() { QMenu * recentMenu = new QMenu; QStringList list = xtsettingsValue("/xTuple/_recentOptionsList").toStringList(); if (list.size()) { list.takeFirst(); int size = list.size(); if (size > 5) size = 5; QString protocol; QString hostName; QString dbName; QString port; int alreadyExists; if (size) { //if (_otherOption->isChecked()) _recent->setEnabled(true); QAction *act; for (int i = 0; i < size; ++i) { act = new QAction(list.value(i).remove("psql://"),this); connect(act, SIGNAL(triggered()), this, SLOT(selectRecentOptions())); recentMenu->addAction(act); parseDatabaseURL(list.value(i), protocol, hostName, dbName, port); alreadyExists = _database->findText(dbName); if (alreadyExists == -1) _database->addItem(dbName); } recentMenu->addSeparator(); act = new QAction(tr("Clear &Menu"), this); act->setObjectName(QLatin1String("__xt_action_clear_menu_")); connect(act, SIGNAL(triggered()), this, SLOT(clearRecentOptions())); recentMenu->addAction(act); } else _recent->setEnabled(false); } else _recent->setEnabled(false); _recent->setMenu(recentMenu); } void login2::selectRecentOptions() { if (const QAction *action = qobject_cast(sender())) { _databaseURL = action->iconText().prepend("psql://"); populateDatabaseInfo(); updateRecentOptions(); updateRecentOptionsActions(); } } void login2::clearRecentOptions() { QStringList list; xtsettingsSetValue("/xTuple/_recentOptionsList", list); updateRecentOptionsActions(); } qt-client-4.1.0/common/login2.h000066400000000000000000000037041217451700100162510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __LOGIN2_H__ #define __LOGIN2_H__ #include "tmp/ui_login2.h" class QSplashScreen; class QImage; class QWidget; #include #include #include "parameter.h" class login2 : public QDialog, public Ui::login2 { Q_OBJECT public: login2(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~login2(); QString _databaseURL; QString _user; virtual int set(const ParameterList & pParams, QSplashScreen * pSplash); virtual void populateDatabaseInfo(); virtual QString username(); virtual QString password(); virtual QString company(); virtual bool useCloud() const; QPushButton* _recent; QPushButton* _options; public slots: virtual int set(const ParameterList & pParams); virtual void setLogo( const QImage & ); virtual void updateRecentOptions(); virtual void updateRecentOptionsActions(); virtual void selectRecentOptions(); virtual void clearRecentOptions(); protected slots: virtual void languageChange(); virtual void sChangeURL(); virtual void sHandleButton(); virtual void sOpenHelp(); virtual void sLogin(); virtual void sOptions(); private: bool _captive; bool _nonxTupleDB; bool _multipleConnections; bool _saveSettings; bool _setSearchPath; QSplashScreen *_splash; QString _cUsername; QString _cPassword; QString _cServer; QString _cDatabase; QString _cPort; QString _cloudDatabaseURL; QString _cCompany; }; #endif qt-client-4.1.0/common/login2.ui000066400000000000000000002612351217451700100164440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. login2 0 0 437 399 0 0 Log In 0 :/login/images/splashXTuple.png true Qt::AlignVCenter 0 0 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 128 128 128 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 199 199 199 255 255 255 128 128 128 2 61 137 2 61 137 0 0 0 86 117 148 255 255 255 0 0 238 82 24 139 232 232 232 true Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 128 128 128 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 199 199 199 255 255 255 128 128 128 2 61 137 2 61 137 0 0 0 86 117 148 255 255 255 0 0 238 82 24 139 232 232 232 true Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 128 128 128 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 199 199 199 255 255 255 128 128 128 2 61 137 2 61 137 0 0 0 86 117 148 255 255 255 0 0 238 82 24 139 232 232 232 true 0 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 128 128 128 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 199 199 199 255 255 255 128 128 128 2 61 137 2 61 137 0 0 0 86 117 148 255 255 255 0 0 238 82 24 139 232 232 232 true Build: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 0 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 255 255 255 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 0 0 0 255 255 255 0 0 0 255 255 255 2 61 137 0 0 0 103 141 178 255 255 255 0 0 238 82 24 139 232 232 232 128 128 128 221 223 228 255 255 255 255 255 255 85 85 85 199 199 199 199 199 199 255 255 255 128 128 128 2 61 137 2 61 137 0 0 0 86 117 148 255 255 255 0 0 238 82 24 139 232 232 232 true Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter QLayout::SetDefaultConstraint Password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Server: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 true Qt::StrongFocus true demo quickstart Port: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Database: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Minimum 20 10 0 0 Qt::StrongFocus Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::Ok _username _password _server _port _database _buttonBox _buttonBox rejected() login2 reject() 446 153 249 199 qt-client-4.1.0/common/login2Options.cpp000066400000000000000000000033031217451700100201530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "login2Options.h" #include #include "xtsettings.h" #include "dbtools.h" login2Options::login2Options(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { setObjectName(name); setupUi(this); connect(_buttonBox2, SIGNAL(accepted()), this, SLOT(sSave())); _saveSettings = true; } login2Options::~login2Options() { // no need to delete child widgets, Qt does it all for us } void login2Options::languageChange() { retranslateUi(this); } void login2Options::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("databaseURL", &valid); if (valid) { _databaseURL = param.toString(); QString protocol; QString server; QString database; QString port; parseDatabaseURL(_databaseURL, protocol, server, database, port); _server->setText(server); _database->setText(database); _port->setText(port); } if (pParams.inList("dontSaveSettings")) _saveSettings = false; } void login2Options::sSave() { buildDatabaseURL(_databaseURL, "psql", _server->text(), _database->text(), _port->text()); if (_saveSettings) { xtsettingsSetValue("/xTuple/_databaseURL", _databaseURL); } accept(); } qt-client-4.1.0/common/login2Options.h000066400000000000000000000020341217451700100176200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __LOGINOPTIONS_H__ #define __LOGINOPTIONS_H__ class QWidget; #include #include #include "parameter.h" #include "tmp/ui_login2Options.h" class login2Options : public QDialog, public Ui::login2Options { Q_OBJECT public: login2Options(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~login2Options(); QString _databaseURL; public slots: virtual void set(const ParameterList & pParams ); protected slots: virtual void languageChange(); virtual void sSave(); private: bool _saveSettings; }; #endif qt-client-4.1.0/common/login2Options.ui000066400000000000000000000164141217451700100200150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. login2Options 0 0 388 101 Login Options 5 5 0 5 0 0 0 25 S&erver: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _server 0 0 0 25 0 0 0 25 &Database: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _database 0 0 0 25 0 0 0 25 &Port: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _port 0 0 0 0 25 80 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save _username _password _database _server _port _buttonBox2 rejected() login2Options reject() 342 70 193 70 qt-client-4.1.0/common/metrics.cpp000066400000000000000000000120221217451700100170510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "metrics.h" #include #include #include #include #include "xsqlquery.h" #include Parameters::Parameters(QObject * parent) : QObject(parent) { _dirty = FALSE; } void Parameters::load() { _values.clear(); XSqlQuery q; q.prepare(_readSql); q.bindValue(":username", _username); q.exec(); while (q.next()) _values[q.value("key").toString()] = q.value("value").toString(); _dirty = FALSE; emit loaded(); } void Parameters::sSetDirty(const QString ¬e) { if(note == _notifyName) _dirty = true; } QString Parameters::value(const char *pName) { return value(QString(pName)); } QString Parameters::value(const QString &pName) { MetricMap::iterator it = _values.find(pName); if (it == _values.end()) return QString::null; else return it.value(); } bool Parameters::boolean(const char *pName) { return boolean(QString(pName)); } bool Parameters::boolean(const QString &pName) { MetricMap::iterator it = _values.find(pName); if (it == _values.end()) return FALSE; else if (it.value() == "t") return TRUE; return FALSE; } void Parameters::set(const char *pName, bool pValue) { set(pName, QString(pValue ? "t" : "f")); } void Parameters::set(const QString &pName, bool pValue) { set(pName, QString(pValue ? "t" : "f")); } void Parameters::set(const char *pName, int pValue) { set(QString(pName), pValue); } void Parameters::set(const QString &pName, int pValue) { set(QString(pName), QString::number(pValue)); } void Parameters::set(const char *pName, const QString &pValue) { set(QString(pName), pValue); } void Parameters::set(const QString &pName, const QString &pValue) { MetricMap::iterator it = _values.find(pName); if (it != _values.end()) { if (it.value() == pValue) return; else it.value() = pValue; } else _values[pName] = pValue; _set(pName, pValue); } void Parameters::_set(const QString &pName, QVariant pValue) { XSqlQuery q; q.prepare(_setSql); q.bindValue(":username", _username); q.bindValue(":name", pName); q.bindValue(":value", pValue); q.exec(); _dirty = TRUE; } QString Parameters::parent(const QString &pValue) { for (MetricMap::iterator it = _values.begin(); it != _values.end(); it++) if (it.value() == pValue) return it.key(); return QString::null; } Metrics::Metrics() { _notifyName = "metricsUpdated"; _readSql = "SELECT metric_name AS key, metric_value AS value FROM metric;"; _setSql = "SELECT setMetric(:name, :value);"; load(); } Preferences::Preferences(const QString &pUsername) { _notifyName = "preferencesUpdated"; _readSql = "SELECT usrpref_name AS key, usrpref_value AS value " "FROM usrpref " "WHERE (usrpref_username=:username);"; _setSql = "SELECT setUserPreference(:username, :name, :value);"; _username = pUsername; load(); } void Preferences::remove(const QString &pPrefName) { XSqlQuery q; q.prepare("SELECT deleteUserPreference(:prefname);"); q.bindValue(":prefname", pPrefName); q.exec(); _dirty = TRUE; } Privileges::Privileges() { _notifyName = "usrprivUpdated"; QString user; XSqlQuery userq("SELECT getEffectiveXtUser() AS user;"); if (userq.lastError().type() != QSqlError::NoError) userq.exec("SELECT CURRENT_USER AS user;"); if (userq.first()) user = userq.value("user").toString(); _readSql = QString("SELECT priv_name AS key, TEXT('t') AS value " " FROM usrpriv, priv " " WHERE((usrpriv_priv_id=priv_id)" " AND (usrpriv_username='%1')) " " UNION " "SELECT priv_name AS key, TEXT('t') AS value " " FROM priv, grppriv, usrgrp" " WHERE((usrgrp_grp_id=grppriv_grp_id)" " AND (grppriv_priv_id=priv_id)" " AND (usrgrp_username='%1'));").arg(user); QSqlDatabase::database().driver()->subscribeToNotification("usrprivUpdated"); QObject::connect(QSqlDatabase::database().driver(), SIGNAL(notification(const QString&)), this, SLOT(sSetDirty(const QString &))); load(); } bool Privileges::check(const QString &pName) { if(_dirty) load(); MetricMap::iterator it = _values.find(pName); if (it == _values.end()) return FALSE; else return TRUE; } bool Privileges::isDba() { XSqlQuery su("SELECT isDBA() AS issuper;"); su.exec(); if (su.first()) return su.value("issuper").toBool(); else if (su.lastError().type() != QSqlError::NoError) qWarning("SQL error in Privileges::isDba(): %s", qPrintable(su.lastError().text())); return false; } qt-client-4.1.0/common/metrics.h000066400000000000000000000035671217451700100165340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef metrics_h #define metrics_h #include #include #include typedef QMap MetricMap; class Parameters : public QObject { Q_OBJECT protected: MetricMap _values; QString _readSql; QString _setSql; QString _username; bool _dirty; QString _notifyName; public: Parameters(QObject * parent = 0); virtual ~Parameters() {}; void load(); QString value(const char *); bool boolean(const char *); Q_INVOKABLE void set(const char *, bool); Q_INVOKABLE void set(const QString &, bool); Q_INVOKABLE void set(const char *, int); Q_INVOKABLE void set(const QString &, int); Q_INVOKABLE void set(const char *, const QString &); Q_INVOKABLE void set(const QString &, const QString &); QString parent(const QString &); public slots: QString value(const QString &); bool boolean(const QString &); void sSetDirty(const QString &); protected: void _set(const QString &, QVariant); signals: void loaded(); }; class Metrics : public Parameters { Q_OBJECT public: Metrics(); }; class Preferences : public Parameters { Q_OBJECT public: Preferences() {}; Preferences(const QString &); void remove(const QString &); }; class Privileges : public Parameters { Q_OBJECT public: Privileges(); public slots: bool check(const QString &); bool isDba(); }; #endif qt-client-4.1.0/common/metricsenc.cpp000066400000000000000000000062351217451700100175500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "metricsenc.h" #include "xsqlquery.h" Parametersenc::Parametersenc(QObject * parent) : QObject(parent) { _dirty = FALSE; } void Parametersenc::load() { _values.clear(); XSqlQuery q; q.prepare(_readSql); // q.bindValue(":username", _username); q.bindValue(":key", _key); q.exec(); while (q.next()) _values[q.value("key").toString()] = q.value("value").toString(); _dirty = FALSE; } QString Parametersenc::value(const char *pName) { return value(QString(pName)); } QString Parametersenc::value(const QString &pName) { MetricMap::iterator it = _values.find(pName); if (it == _values.end()) return QString::null; else return it.value(); } bool Parametersenc::boolean(const char *pName) { return boolean(QString(pName)); } bool Parametersenc::boolean(const QString &pName) { MetricMap::iterator it = _values.find(pName); if (it == _values.end()) return FALSE; else if (it.value() == "t") return TRUE; return FALSE; } void Parametersenc::set(const char *pName, bool pValue) { set(QString(pName), pValue); } void Parametersenc::set(const QString &pName, bool pValue) { MetricMap::iterator it = _values.find(pName); if ( (it != _values.end()) && (it.value() == ((pValue) ? "t" : "f")) ) return; _set(pName, ((pValue) ? QString("t") : QString("f"))); } void Parametersenc::set(const char *pName, int pValue) { set(QString(pName), pValue); } void Parametersenc::set(const QString &pName, int pValue) { MetricMap::iterator it = _values.find(pName); if ( (it != _values.end()) && (it.value().toInt() == pValue) ) return; _set(pName, pValue); } void Parametersenc::set(const char *pName, const QString &pValue) { set(QString(pName), pValue); } void Parametersenc::set(const QString &pName, const QString &pValue) { MetricMap::iterator it = _values.find(pName); if (it != _values.end()) { if (it.value() == pValue) return; else it.value() = pValue; } else _values[pName] = pValue; _set(pName, pValue); } void Parametersenc::_set(const QString &pName, QVariant pValue) { XSqlQuery q; q.prepare(_setSql); // q.bindValue(":username", _username); q.bindValue(":name", pName); q.bindValue(":value", pValue); q.bindValue(":key", _key); q.exec(); _dirty = TRUE; } QString Parametersenc::parent(const QString &pValue) { for (MetricMap::iterator it = _values.begin(); it != _values.end(); it++) if (it.value() == pValue) return it.key(); return QString::null; } Metricsenc::Metricsenc(const QString &pKey) { _readSql = "SELECT metricenc_name AS key, decrypt(setbytea(metricenc_value), setbytea(:key), 'bf') AS value FROM metricenc;"; _setSql = "SELECT setMetricEnc(:name, :value, :key);"; _key = pKey; load(); } qt-client-4.1.0/common/metricsenc.h000066400000000000000000000030051217451700100172050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef metricsenc_h #define metricsenc_h #include #include #include #include typedef QMap MetricMap; class Parametersenc : public QObject { Q_OBJECT protected: MetricMap _values; QString _readSql; QString _setSql; QString _username; QString _key; bool _dirty; public: Parametersenc(QObject * parent = 0); virtual ~Parametersenc() {}; void load(); QString value(const char *); bool boolean(const char *); void set(const char *, bool); void set(const QString &, bool); void set(const char *, int); void set(const QString &, int); void set(const char *, const QString &); void set(const QString &, const QString &); QString parent(const QString &); public slots: QString value(const QString &); bool boolean(const QString &); protected: void _set(const QString &, QVariant); }; class Metricsenc : public Parametersenc { public: // metricsenc(); Metricsenc() {}; Metricsenc(const QString &); }; #endif qt-client-4.1.0/common/qbase64encode.cpp000066400000000000000000000073511217451700100200370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qbase64encode.h" #include #include #include #include static const char _base64Table[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static char getValue(char c) { int i = 0; while(_base64Table[i] != '\0') { if(_base64Table[i] == c) return (char)i; i++; } return (char)-1; } QString QBase64Encode(QIODevice & iod) { QString value; // the string that holds the final encoded values int packet = 0; // there are 19 packets per line (packet=3 bytes in) char _in[3]; unsigned char in[3]; char out[4]; qint64 didRead = 0; while(!iod.atEnd()) { // set the values to 0 in case we don't read all 3 _in[0] = _in[1] = _in[2] = (char)0; // read in up to the next 3 chars didRead = iod.read(&_in[0], 3); in[0] = (unsigned char)_in[0]; in[1] = (unsigned char)_in[1]; in[2] = (unsigned char)_in[2]; if(didRead > 0) { // determine the encoded chars out[0] = _base64Table[ in[0] >> 2 ]; out[1] = _base64Table[ ((in[0] & 0x03) << 4) | (in[1] >> 4) ]; out[2] = _base64Table[ ((in[1] & 0x0F) << 2) | (in[2] >> 6) ]; out[3] = _base64Table[ in[2] & 0x3F ]; // modify the chars if we were short if(didRead < 3) { out[3] = '='; if(didRead < 2) { out[2] = '='; } } // place the final chars in the value value += out[0]; value += out[1]; value += out[2]; value += out[3]; } if(++packet >= 19) { packet = 0; // reset the packet count value += '\n'; // add a newline to the value } } value += '\n'; // throw one last newline onto the end return value; } QByteArray QBase64Decode(const QString & _source) { QString source = _source; QByteArray value; // empty string -- nothing to do if(source.isEmpty()) return value; QTextStream in(&source, QIODevice::ReadOnly); QBuffer buf(&value); buf.open(QIODevice::WriteOnly); char a[4], b[4], o[3]; qint64 n = 0; int p = 0; // current position in string int l = source.length(); // length of string char c = 0; while (p < l) { // read in the next 4 valid bytes n = 0; while(n < 4 && p < l) { c = ((QChar)source.at(p++)).toAscii(); a[n] = c; b[n] = (c == '=' ? 0 : getValue(c)); if(b[n] != -1) { n++; } } if(n < 4 && n != 0) { // whoops we have a mismatch in the number of bytes we need } // convert from base64 to binary o[0] = (b[0] << 2) | (b[1] >> 4); o[1] = (b[1] << 4) | (b[2] >> 2); o[2] = (b[2] << 6) | b[3]; // determine how many bytes we should be reading if(a[2] == '=') n = 1; else if(a[3] == '=') n = 2; else n = 3; if(n != buf.write(&o[0], n)) { // eek we didn't write the number of block we were supposed to } if(n < 3) break; // we've reached the end of the data we have to read so just stop } return value; } qt-client-4.1.0/common/qbase64encode.h000066400000000000000000000011661217451700100175020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QBASE64ENCODE_H__ #define __QBASE64ENCODE_H__ #include class QIODevice; QString QBase64Encode(QIODevice &); QByteArray QBase64Decode(const QString &); #endif qt-client-4.1.0/common/qmd5.cpp000066400000000000000000000175411217451700100162640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qmd5.h" #include enum Operation { OperationF, OperationG, OperationH, OperationI }; // these values are taken from RFC1321 static const quint32 T[64] = { 0xd76aa478, // 1, 0 based accessed 0xe8c7b756, // 2 0x242070db, // 3 0xc1bdceee, // 4 0xf57c0faf, // 5 0x4787c62a, // 6 0xa8304613, // 7 0xfd469501, // 8 0x698098d8, // 9 0x8b44f7af, // 10 0xffff5bb1, // 11 0x895cd7be, // 12 0x6b901122, // 13 0xfd987193, // 14 0xa679438e, // 15 0x49b40821, // 16 0xf61e2562, // 17 0xc040b340, // 18 0x265e5a51, // 19 0xe9b6c7aa, // 20 0xd62f105d, // 21 0x02441453, // 22 0xd8a1e681, // 23 0xe7d3fbc8, // 24 0x21e1cde6, // 25 0xc33707d6, // 26 0xf4d50d87, // 27 0x455a14ed, // 28 0xa9e3e905, // 29 0xfcefa3f8, // 30 0x676f02d9, // 31 0x8d2a4c8a, // 32 0xfffa3942, // 33 0x8771f681, // 34 0x6d9d6122, // 35 0xfde5380c, // 36 0xa4beea44, // 37 0x4bdecfa9, // 38 0xf6bb4b60, // 39 0xbebfbc70, // 40 0x289b7ec6, // 41 0xeaa127fa, // 42 0xd4ef3085, // 43 0x04881d05, // 44 0xd9d4d039, // 45 0xe6db99e5, // 46 0x1fa27cf8, // 47 0xc4ac5665, // 48 0xf4292244, // 49 0x432aff97, // 50 0xab9423a7, // 51 0xfc93a039, // 52 0x655b59c3, // 53 0x8f0ccc92, // 54 0xffeff47d, // 55 0x85845dd1, // 56 0x6fa87e4f, // 57 0xfe2ce6e0, // 58 0xa3014314, // 59 0x4e0811a1, // 60 0xf7537e82, // 61 0xbd3af235, // 62 0x2ad7d2bb, // 63 0xeb86d391 // 64 }; static void md5Round( Operation func, quint32 & a, quint32 & b, quint32 & c, quint32 & d, quint32 k, int s, int i) { quint32 o = 0, t = 0; switch(func) { case OperationF: o = (b & c) | (~b & d); break; case OperationG: o = (b & d) | (c & ~d); break; case OperationH: o = b ^ c ^ d; break; case OperationI: o = c ^ (b | ~d); break; }; t = a + o + k + T[i-1]; t = ((t << s) | (t >> (32 - s))); a = b + t; } QString QMd5(const QString & message) { QByteArray msg = message.toUtf8(); return QMd5(msg); } QString QMd5(const QByteArray & message) { // create the data array and input stream for it QByteArray data; QDataStream dataIN(&data, QIODevice::WriteOnly); dataIN.setByteOrder(QDataStream::LittleEndian); // add the data to the stream quint32 len = message.size(); dataIN.writeRawData(message.data(), len); // Calculate the size of the pad required. // The pad must be at least 1 bit long and // should make the overall data size a multiple // of 512 bits minus the size for the 64 bit // length value. qint32 pad = 64 - (len % 64) - 8; if(pad <= 0) pad += 64; // populate the data array with the pad values int i; dataIN << (quint8)0x80; for(pad--; pad > 0; pad--) dataIN << (quint8)0x00; // create a 64bit count of the number of bits in the data array quint64 bitLen = (quint64)len << 3; dataIN << bitLen; // Initialize the MD state variables quint32 stateA = 0x67452301; quint32 stateB = 0xefcdab89; quint32 stateC = 0x98badcfe; quint32 stateD = 0x10325476; // setup a data stream for reading the data QDataStream dataOUT(&data, QIODevice::ReadOnly); dataOUT.setByteOrder(QDataStream::LittleEndian); // process the message in 16-word blocks quint32 X[16]; for(i = 0; i * 64 < data.size(); i++) { quint32 a = stateA; quint32 b = stateB; quint32 c = stateC; quint32 d = stateD; for(int j = 0; j < 16; j++) dataOUT >> X[j]; // round 1 md5Round( OperationF, a, b, c, d, X[ 0], 7, 1); md5Round( OperationF, d, a, b, c, X[ 1], 12, 2); md5Round( OperationF, c, d, a, b, X[ 2], 17, 3); md5Round( OperationF, b, c, d, a, X[ 3], 22, 4); md5Round( OperationF, a, b, c, d, X[ 4], 7, 5); md5Round( OperationF, d, a, b, c, X[ 5], 12, 6); md5Round( OperationF, c, d, a, b, X[ 6], 17, 7); md5Round( OperationF, b, c, d, a, X[ 7], 22, 8); md5Round( OperationF, a, b, c, d, X[ 8], 7, 9); md5Round( OperationF, d, a, b, c, X[ 9], 12, 10); md5Round( OperationF, c, d, a, b, X[10], 17, 11); md5Round( OperationF, b, c, d, a, X[11], 22, 12); md5Round( OperationF, a, b, c, d, X[12], 7, 13); md5Round( OperationF, d, a, b, c, X[13], 12, 14); md5Round( OperationF, c, d, a, b, X[14], 17, 15); md5Round( OperationF, b, c, d, a, X[15], 22, 16); // round 2 md5Round( OperationG, a, b, c, d, X[ 1], 5, 17); md5Round( OperationG, d, a, b, c, X[ 6], 9, 18); md5Round( OperationG, c, d, a, b, X[11], 14, 19); md5Round( OperationG, b, c, d, a, X[ 0], 20, 20); md5Round( OperationG, a, b, c, d, X[ 5], 5, 21); md5Round( OperationG, d, a, b, c, X[10], 9, 22); md5Round( OperationG, c, d, a, b, X[15], 14, 23); md5Round( OperationG, b, c, d, a, X[ 4], 20, 24); md5Round( OperationG, a, b, c, d, X[ 9], 5, 25); md5Round( OperationG, d, a, b, c, X[14], 9, 26); md5Round( OperationG, c, d, a, b, X[ 3], 14, 27); md5Round( OperationG, b, c, d, a, X[ 8], 20, 28); md5Round( OperationG, a, b, c, d, X[13], 5, 29); md5Round( OperationG, d, a, b, c, X[ 2], 9, 30); md5Round( OperationG, c, d, a, b, X[ 7], 14, 31); md5Round( OperationG, b, c, d, a, X[12], 20, 32); // round 3 md5Round( OperationH, a, b, c, d, X[ 5], 4, 33); md5Round( OperationH, d, a, b, c, X[ 8], 11, 34); md5Round( OperationH, c, d, a, b, X[11], 16, 35); md5Round( OperationH, b, c, d, a, X[14], 23, 36); md5Round( OperationH, a, b, c, d, X[ 1], 4, 37); md5Round( OperationH, d, a, b, c, X[ 4], 11, 38); md5Round( OperationH, c, d, a, b, X[ 7], 16, 39); md5Round( OperationH, b, c, d, a, X[10], 23, 40); md5Round( OperationH, a, b, c, d, X[13], 4, 41); md5Round( OperationH, d, a, b, c, X[ 0], 11, 42); md5Round( OperationH, c, d, a, b, X[ 3], 16, 43); md5Round( OperationH, b, c, d, a, X[ 6], 23, 44); md5Round( OperationH, a, b, c, d, X[ 9], 4, 45); md5Round( OperationH, d, a, b, c, X[12], 11, 46); md5Round( OperationH, c, d, a, b, X[15], 16, 47); md5Round( OperationH, b, c, d, a, X[ 2], 23, 48); // round 4 md5Round( OperationI, a, b, c, d, X[ 0], 6, 49); md5Round( OperationI, d, a, b, c, X[ 7], 10, 50); md5Round( OperationI, c, d, a, b, X[14], 15, 51); md5Round( OperationI, b, c, d, a, X[ 5], 21, 52); md5Round( OperationI, a, b, c, d, X[12], 6, 53); md5Round( OperationI, d, a, b, c, X[ 3], 10, 54); md5Round( OperationI, c, d, a, b, X[10], 15, 55); md5Round( OperationI, b, c, d, a, X[ 1], 21, 56); md5Round( OperationI, a, b, c, d, X[ 8], 6, 57); md5Round( OperationI, d, a, b, c, X[15], 10, 58); md5Round( OperationI, c, d, a, b, X[ 6], 15, 59); md5Round( OperationI, b, c, d, a, X[13], 21, 60); md5Round( OperationI, a, b, c, d, X[ 4], 6, 61); md5Round( OperationI, d, a, b, c, X[11], 10, 62); md5Round( OperationI, c, d, a, b, X[ 2], 15, 63); md5Round( OperationI, b, c, d, a, X[ 9], 21, 64); stateA += a; stateB += b; stateC += c; stateD += d; } // encode the hash from 4 quint32 to 16 quint8 QByteArray digest; QDataStream digestIN(&digest, QIODevice::WriteOnly); digestIN.setByteOrder(QDataStream::LittleEndian); digestIN << (quint32)stateA; digestIN << (quint32)stateB; digestIN << (quint32)stateC; digestIN << (quint32)stateD; // encode the 16 quint8 into a HexString QString hex; for(i = 0; i < digest.size(); i++) hex = hex.sprintf("%s%02x", hex.toLatin1().data(), (quint8)digest.at(i)); return hex; } qt-client-4.1.0/common/qmd5.h000066400000000000000000000012341217451700100157210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* * Header containing the prototypes of the MD5 Hash * code, based on RFC1321. */ #ifndef __QMD5_H__ #define __QMD5_H__ #include QString QMd5(const QString &); QString QMd5(const QByteArray &); #endif qt-client-4.1.0/common/shortcuts.cpp000066400000000000000000000115011217451700100174420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "shortcuts.h" TabWidgetNavigtor::TabWidgetNavigtor(QTabWidget* tabWidget, QObject* parent) : QObject(parent) { _tab = tabWidget; } void TabWidgetNavigtor::pageDown() { int curridx = _tab->currentIndex(); if (curridx < _tab->count()) _tab->setCurrentIndex(curridx + 1); } void TabWidgetNavigtor::pageUp() { int curridx = _tab->currentIndex(); if (curridx) _tab->setCurrentIndex(curridx - 1); } //////////////////////////////// void shortcuts::setStandardKeys(QWidget* widget) { if (!widget) return; // Add standard shortcuts to applicable buttons bool hasShortcut = false; QPushButton* button; // For Save button = widget->findChild("_save"); if (button) { button->setShortcut(QKeySequence::Save); button->setToolTip(button->text().remove("&") + " " + button->shortcut().toString(QKeySequence::NativeText)); hasShortcut = true; } if (!hasShortcut) // Because some screens have both { // For Post button = widget->findChild("_post"); if (button) { button->setShortcut(QKeySequence::Save); button->setToolTip(button->text().remove("&") + " " + button->shortcut().toString(QKeySequence::NativeText)); } } if (!hasShortcut) { QDialogButtonBox* bb = widget->findChild(); if (bb) { QList buttons = bb->buttons(); for (int i = 0; i < buttons.size(); ++i) { QAbstractButton *bbutton = buttons.at(i); QDialogButtonBox::ButtonRole btnrole = bb->buttonRole(buttons.at(i)); if (btnrole == QDialogButtonBox::AcceptRole) { bbutton->setShortcut(QKeySequence::Save); bbutton->setToolTip(bbutton->text().remove("&") + " " + bbutton->shortcut().toString(QKeySequence::NativeText)); } else if (btnrole == QDialogButtonBox::RejectRole) { bbutton->setShortcut(QKeySequence::Close); bbutton->setToolTip(bbutton->text().remove("&") + " " + bbutton->shortcut().toString(QKeySequence::NativeText)); } } } } // For Close hasShortcut = false; button = widget->findChild("_close"); if (button) { button->setShortcut(QKeySequence::Close); button->setToolTip(button->text().remove("&") + " " + button->shortcut().toString(QKeySequence::NativeText)); hasShortcut = true; } if (!hasShortcut) // Because some screens have both { // For Post button = widget->findChild("_cancel"); if (button) { button->setShortcut(QKeySequence::Close); button->setToolTip(button->text().remove("&") + " " + button->shortcut().toString(QKeySequence::NativeText)); } } // For New button = widget->findChild("_new"); if (button) { button->setShortcut(QKeySequence::New); button->setToolTip(button->text().remove("&") + " " + button->shortcut().toString(QKeySequence::NativeText)); hasShortcut = true; } // For Print button = widget->findChild("_print"); if (button) { button->setShortcut(QKeySequence::Print); button->setToolTip(button->text().remove("&") + " " + button->shortcut().toString(QKeySequence::NativeText)); hasShortcut = true; } // For Query button = widget->findChild("_query"); if (button) { button->setShortcut(QKeySequence::Refresh); button->setToolTip(button->text().remove("&") + " " + button->shortcut().toString(QKeySequence::NativeText)); hasShortcut = true; } // Page up/down for tab widgets QTabWidget* tab = widget->findChild(); if (tab) { TabWidgetNavigtor* tabNav = new TabWidgetNavigtor(tab, widget); QAction* pagedownAct = new QAction(tab); pagedownAct->setShortcut(QKeySequence::MoveToNextPage); pagedownAct->connect(pagedownAct, SIGNAL(triggered()), tabNav, SLOT(pageDown())); tab->addAction(pagedownAct); QAction* pageupAct = new QAction(tab); pageupAct->setShortcut(QKeySequence::MoveToPreviousPage); pageupAct->connect(pageupAct, SIGNAL(triggered()), tabNav, SLOT(pageUp())); tab->addAction(pageupAct); } } qt-client-4.1.0/common/shortcuts.h000066400000000000000000000015171217451700100171150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef shortcuts_h #define shortcuts_h #include #include #include class TabWidgetNavigtor : public QObject { Q_OBJECT public: TabWidgetNavigtor(QTabWidget* tabWidget, QObject* parent = 0); public slots: void pageDown(); void pageUp(); private: QTabWidget* _tab; }; class shortcuts { public: static void setStandardKeys(QWidget* widget); }; #endif qt-client-4.1.0/common/splashconst.h000066400000000000000000000011731217451700100174160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SPLASHCONST_H__ #define __SPLASHCONST_H__ static const int SplashTextAlignment = Qt::AlignHCenter | Qt::AlignBottom; static const QColor SplashTextColor = QColor("black"); #endif qt-client-4.1.0/common/storedProcErrorLookup.cpp000066400000000000000000003146751217451700100217560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include /* try to address bug 4218 This code assumes that stored procedures return zero or positive integers on success return negative integers on failure */ QMultiHash< QString, QPair > ErrorLookupHash; /* developers add error messages to an array for ease of adding new ones. initErrorLookupHash then inserts these into a QMultiHash(key, value). The key is the stored procedure name. The value is a QPair* of (return value, error message). */ const struct { QString procName; // name of the stored procedure int retVal; // return value from the stored procedure const char* msg; // msg to display, but see msgPtr and proxyName int msgPtr; // if <> 0 then look up (procName, msgPtr) QString proxyName; // look up (proxyName, retVal) } errors[] = { { "attachQuoteToOpportunity", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Quote cannot be attached because " "the Quote cannot be found."), 0, "" }, { "attachQuoteToOpportunity", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Quote cannot be attached because " "the Opportunity cannot be found."), 0, "" }, { "attachQuoteToOpportunity", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Quote cannot be attached because " "it is already associated with an Opportunity. You must " "detach this Quote before you may attach it."), 0, "" }, { "attachSalesOrderToOpportunity", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order cannot be attached because " "the Sales Order cannot be found."), 0, "" }, { "attachSalesOrderToOpportunity", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order cannot be attached because " "the Opportunity cannot be found."), 0, "" }, { "attachSalesOrderToOpportunity", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order cannot be attached because " "it is already associated with an Opportunity. You must " "detach this Sales Order before you may attach it."), 0, "" }, { "changeCMHeadTaxAuth", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Credit Memo was not found."), 0, "" }, { "changeCMHeadTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."), 0, "" }, { "changeInvoiceTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Invoice was not found."), 0, "" }, { "changeInvoiceTaxZone", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Freight Tax Type was not found."),0, "" }, { "changeCobTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bill was not found."), 0, "" }, { "changeCobTaxZone", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Freight Tax Type was not found."),0, "" }, { "changeQuoteTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Quote was not found."), 0, "" }, // { "changeQuoteTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."), 0, "" }, { "changeSOTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order was not found."), 0, "" }, // { "changeSOTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."), 0, "" }, { "changeTOTax", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order was not found."), 0, "" }, { "changeTOTaxAuth", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority was not found."), 0, "" }, { "closeAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be " "closed because it is already closed."), 0, "" }, { "closeAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be " "closed because there is a gap between the " "end of the previous Period and the start " "of this Period. You must edit either the " "previous Perod or this Period to " "eliminate the gap."), 0, "" }, { "closeAccountingPeriod", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be " "closed because the previous Period is not " "closed. You must close the previous Period" " before you may close this Period."), 0, "" }, { "closeAccountingPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be " "closed because there is a gap between the " "end of this Period and the start of the " "next Period. You must edit either this " "Period or the next Period to eliminate " "the gap."), 0, "" }, { "closeAccountingPeriod", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be " "closed because it ends in the future."), 0, "" }, { "closeAccountingPeriod", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period cannot be " "closed because it is the last period in " "the Fiscal Year and the next Fiscal Year " "has not been defined yet. Create the " "next Fiscal Year before closing this " "Accounting Period."), 0, "" }, { "closeAccountingYearPeriod", -1, "", -1, "closeAccountingPeriod" }, { "closeAccountingYearPeriod", -2, "", -2, "closeAccountingPeriod" }, { "closeAccountingYearPeriod", -3, "", -3, "closeAccountingPeriod" }, { "closeAccountingYearPeriod", -4, "", -4, "closeAccountingPeriod" }, { "closeAccountingYearPeriod", -5, "", -5, "closeAccountingPeriod" }, { "closeAccountingYearPeriod", -6, "", -6, "closeAccountingPeriod" }, { "closeAccountingYearPeriod", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed " "because you have not specified a Year End Equity Account " "in the accounting configuration."), 0, "" }, { "closeAccountingYearPeriod", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be " "closed because there does not seem to " "be an Accounting Period defined for " "the beginning of the next Fiscal " "Year."), 0, "" }, { "closeAccountingYearPeriod", -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed " "because there is no Trial Balance record for " "the account in the required Period. Or you have " "not specified a Year End Equity Account in the " "accounting configuration."), 0, "" }, { "closeAccountingYearPeriod", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed " "because there are periods within the year that are still open."), 0, "" }, { "closeAccountingYearPeriod", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be closed " "because there are prior years that are still open."), 0, "" }, { "closeToItem", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The item cannot be Closed at this time " "as there is inventory at shipping."), 0, "" }, { "convertCustomerToProspect", -1, "", -1, "deleteCustomer" }, { "convertCustomerToProspect", -2, "", -2, "deleteCustomer" }, { "convertCustomerToProspect", -3, "", -3, "deleteCustomer" }, { "convertCustomerToProspect", -4, "", -4, "deleteCustomer" }, { "convertCustomerToProspect", -5, "", -5, "deleteCustomer" }, { "convertCustomerToProspect", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not convert Customer to Prospect to " "because there is already a Prospect with " "this internal ID."), 0, "" }, { "convertProspectToCustomer", -1, "", -1, "deleteProspect" }, { "convertProspectToCustomer", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not convert Prospect to Customer " "because there is already a Customer with " "this internal ID."), 0, "" }, { "convertQuote", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 has one or more line items without a " "warehouse specified. These line items must be " "fixed before you may convert this quote." ), 0, "" }, { "convertQuote", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot find the Customer data for Quote #%1."), 0, "" }, { "convertQuote", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 is associated with a Prospect, " "not a Customer. Convert the Prospect to a " "Customer first."), 0, "" }, { "convertQuote", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 is for a Customer that has been " "placed on a Credit Hold and you do not have " "privilege to create Sales Orders for Customers on " "Credit Hold. The selected Customer must be taken " "off of Credit Hold before you may create convert " "this Quote."), 0, "" }, { "convertQuote", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 is for a Customer that has been " "placed on a Credit Warning and you do not have " "privilege to create Sales Orders for Customers on " "Credit Warning. The selected Customer must be " "taken off of Credit Warning before you may create " "convert this Quote."), 0, "" }, { "convertQuote", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Quote #%1 has expired and can not be converted."), 0, "" }, { "copyItemSite", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not copy the Item Site because it " "does not appear to exist."), 0, "" }, { "copyItemSite", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not copy the Item Site because the " "warehouse for the new Item Site record " "does not appear to exist."), 0, "" }, { "copyItemSite", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You do not have sufficient privilege to " "create an Item Site."), 0, "" }, { "copyBOM", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not find the Source BOM to copy."), 0, "" }, { "copyBOM", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected source Item does not " "have any Bill of Material Component Items associated with it."), 0, "" }, { "copyBOM", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected target Item already has a " "Bill of Materials associated with it.\n" "You must first delete the Bill of Materials for the selected target item before " "attempting to copy an existing Bill of Materials."), 0, "" }, { "copyBOM", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Item you are trying to copy " "this Bill of Material to is a " "component item which would cause a recursive Bill of Material."), 0, "" }, { "copyPO", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not find the P/O to copy."), 0, "" }, { "copyPO", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Vendor of the original P/O does not match " "the Vendor for the copy. Changing the Vendor " "is not yet supported when copying a P/O."), 0, "" }, { "copyPO", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The system does not allow purchases of Items for this " "Vendor without Item Sources and at least one line item " "item in the original P/O does not have an active " "Item Source."), 0, "" }, { "copyPO", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "At least one line item in the original P/O does not have " "an active Item Source Price for this Vendor."), 0, "" }, { "copyPrj", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Copying an existing project failed, possibly because " "the source project does not exist."), 0, "" }, { "copyPrj", -10, "", -10, "saveAlarm" }, { "correctOperationPosting", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not correct a quantity greater than the amount " "originally posted."), 0, "" }, { "correctReceipt", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The receipt has been split and may not be corrected. " "Correct Receipt."), 0, "" }, { "createAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start Date falls within another " "Accounting Period."), 0, "" }, { "createAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The End Date falls within another " "Accounting Period."), 0, "" }, { "createAccountingPeriod", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start and End Dates enclose another " "Accounting Period."), 0, "" }, { "createAccountingPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Period dates are outside the " "selected Fiscal Year."), 0, "" }, { "createAccountingPeriod", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start Date must be prior " "to the End Date."), 0, "" }, { "createAccountingYearPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Year is closed." ), 0, "" }, { "createAccountingYearPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Year dates may not overlap another year." ), 0, "" }, { "createAccountingYearPeriod", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Year dates may not overlap another year." ), 0, "" }, { "createAccountingYearPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Periods exist for this " "year outside the proposed dates." ), 0, "" }, { "createAccountingYearPeriod", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Start Date must be prior to the End Date" ), 0, "" }, { "createAPCreditMemoApplication", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not apply more than the balance due " "to this document."), 0, "" }, { "createAPCreditMemoApplication", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not apply more than the amount " "available to apply for this Credit Memo."), 0, "" }, { "createARCreditMemo", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either the Prepaid Account or the A/R Account" " for this Customer could not be found."), 0, "" }, { "createARDebitMemo", -1, "", -1, "createARCreditMemo" }, { "createBOMItem", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You may not create a BOM Item that defines a " "Parent that is composed of itself."), 0, "" }, { "createBOMItem", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Component that you have selected for this" "BOM Item is a manufactured or phantom Item " "that uses the Parent Item as a Component " "Item in its own BOM. You may not create a " "recursive BOM."), 0, "" }, { "createCrmAcct", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This CRM Account Number is already in use by " "an existing CRM Account. Please choose a " "different number and save again."), 0, "" }, { "createCrmAcct", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This CRM Account Number is already in use by " "an existing Customer. Please choose a different" " number and save again."), 0, "" }, { "createCrmAcct", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This CRM Account Number is already in use by " "an existing Prospect. Please choose a different" " number and save again."), 0, "" }, { "createCrmAcct", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This CRM Account Number is already in use by " "an existing Vendor. Please choose a different" " number and save again."), 0, "" }, { "createCrmAcct", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This CRM Account Number is already in use by " "an existing Tax Authority. Please choose a " "different number and save again."), 0, "" }, { "createProspect", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create a Prospect because there is no " "CRM Account to tie it to."), 0, "" }, { "createProspect", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create a Prospect for this CRM Account " "because it is already a Customer."), 0, "" }, { "createProspect", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create a Prospect for this CRM Account " "because it is already a Prospect."), 0, "" }, { "createPurchaseToSale", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "SO Header Information related to this SO Item not found!"), 0, "" }, { "createPurchaseToSale", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Item Source Information not found!"), 0, "" }, { "createRecurringItems", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create recurring items with an " "unrecognized object type."), 0, "" }, { "CreateRevision", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Revision control not enabled."), 0, "" }, { "createTodoItem", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be created as " "there is no assigned User."), 0, "" }, { "createTodoItem", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be created as " "the Task Name is blank."), 0, "" }, { "createTodoItem", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be created as " "there is no Due Date."), 0, "" }, { "createWo", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order can not be created because Site " "not allowed to Manufacture this Item."), 0, "" }, { "createWo", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order can not be exploded because items on " "the BOM exist without itemsites."), 0, "" }, { "deleteAccount", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Cost Categories." " You must reassign these Cost Category " "assignments before you may delete the selected " "G/L Account."), 0, "" }, { "deleteAccount", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Sales Account " "Assignment. You must reassign these Sales " "Account Assignments before you may delete " "the selected G/L Account."), 0, "" }, { "deleteAccount", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Customer A/R " "Account assignments. You must reassign these " "Customer A/R Account assignments before you may " "delete the selected G/L Account."), 0, "" }, { "deleteAccount", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used as the default Account one or " "more Sites. You must reassign the default " "Account for these Sites before you may delete " "the selected G/L Account."), 0, "" }, { "deleteAccount", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Bank Accounts. " "You must reassign these Bank Accounts before you " "may delete the selected G/L Account."), 0, "" }, { "deleteAccount", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Expense " "Categories. You must reassign these Expense " "Categories before you may delete the selected " "G/L Account."), 0, "" }, { "deleteAccount", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Tax Codes. " "You must reassign these Tax Codes before you " "may delete the selected G/L Account."), 0, "" }, { "deleteAccount", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Standard " "Journals. You must reassign these Standard " "Journal Items before you may delete the selected " "G/L Account."), 0, "" }, { "deleteAccount", -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Customer A/P " "Account assignments. You must reassign these " "Customer A/P Account assignments before you may " "delete the selected G/L Account."), 0, "" }, { "deleteAccount", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more Currency " "definition. You must reassign these Currency " "definitions before you may delete the selected " "G/L Account."), 0, "" }, { "deleteAccount", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as it " "is currently used in one or more A/R Open Items. " "You must reassign these Currency definitions " "before you may delete the selected G/L Account."), 0, "" }, { "deleteAccount", -99, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected G/L Account cannot be deleted as " "there have been G/L Transactions posted " "against it."), 0, "" }, { "deleteAccountingPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period has G/L " "Transactions posted against it and, thus, " "cannot be deleted."), 0, "" }, { "deleteAccountingPeriod", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Accounting Period is not " "the last accounting period and " "cannot be deleted."), 0, "" }, { "deleteAccountingYearPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be " "deleted because it is closed."), 0, "" }, { "deleteAccountingYearPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Fiscal Year cannot be " "deleted because there are Accounting " "Periods defined for it."), 0, "" }, { "deleteAddress", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as " "it is used by an active Contact."), 0, "" }, { "deleteAddress", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as " "it is used by an active Vendor."), 0, "" }, { "deleteAddress", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as " "it is used by an active Ship-To Address."), 0, "" }, { "deleteAddress", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as " "it is used by an active Vendor Address."), 0, "" }, { "deleteAddress", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Address cannot be deleted as " "it is used by an active Site."), 0, "" }, { "deleteBankAdjustmentType", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Bank Adjustment Type " "cannot be deleted because it is " "currently used by a Bank Adjustment."), 0, "" }, { "deleteCashrcpt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be deleted " "because it is a Customer Deposit made with " "a Credit Card and the card has already been " "charged."), 0, "" }, { "deleteCharacteristic", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted " "because there are Items assigned to " "it. You must remove these assignments before " "you may delete the selected Characteristic."), 0, "" }, { "deleteCharacteristic", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted " "because there are Customers assigned to " "it. You must remove these assignments before " "you may delete the selected Characteristic."), 0, "" }, { "deleteCharacteristic", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted " "because there are Addresses assigned to " "it. You must remove these assignments before " "you may delete the selected Characteristic."), 0, "" }, { "deleteCharacteristic", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted " "because there are Contacts assigned to " "it. You must remove these assignments before " "you may delete the selected Characteristic."), 0, "" }, { "deleteCharacteristic", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted " "because there are CRM Accounts assigned to " "it. You must remove these assignments before " "you may delete the selected Characteristic."), 0, "" }, { "deleteCharacteristic", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted " "because there are Incidents assigned to " "it. You must remove these assignments before " "you may delete the selected Characteristic."), 0, "" }, { "deleteCharacteristic", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Characteristic cannot be deleted " "because there are Employees assigned to " "it. You must remove these assignments before " "you may delete the selected Characteristic."), 0, "" }, { "deleteCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot delete this check because either it has not " "been voided, it has already been posted or replaced," " or it has been transmitted electronically."), 0, "" }, { "deleteClassCode", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Class Code cannot be deleted " "because there are Items that are assigned to " "it. You must reassign these Items before you " "may delete the selected Class Code." ), 0, ""}, { "deleteCompany", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Company cannot be deleted as it " "is in use by existing Account. You must reclass " "these Accounts before you may delete the selected " "Company." ), 0, "" }, { "deleteContact", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as " "s/he is the primary or secondary Contact " " for a CRM Account."), 0, "" }, { "deleteContact", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as " "s/he is the Correspondence or Billing " "Contact for a Customer."), 0, "" }, { "deleteContact", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as " "s/he is the primary or secondary " "Contact for a Vendor."), 0, "" }, { "deleteContact", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as " "s/he is the Contact for a Ship-To Address."), 0, "" }, { "deleteContact", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as " "s/he is the Contact for a Vendor Address."), 0, "" }, { "deleteContact", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Contact cannot be deleted as " "s/he is the Contact for a Site."), 0, "" }, { "deleteCRMAccount", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it is a Customer."), 0, "" }, { "deleteCRMAccount", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it is a Vendor."), 0, "" }, { "deleteCRMAccount", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it is a Prospect."), 0, "" }, { "deleteCRMAccount", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it has Contacts. You may Detach the Contacts " "from this CRM Account and try deleting it " "again or set its status to inactive"), 0, "" }, { "deleteCRMAccount", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it is a Tax Authority."), 0, "" }, { "deleteCRMAccount", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it is a Sales Rep."), 0, "" }, { "deleteCRMAccount", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it is a Employee."), 0, "" }, { "deleteCRMAccount", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected CRM Account cannot be deleted as " "it is a User."), 0, "" }, { "deleteCustomer", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as there " "are still Ship-Tos assigned to it. You must " "delete all of the selected Customer's Ship-Tos " "before you may delete it."), 0, "" }, { "deleteCustomer", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted " "as there has been Sales History recorded " "for this Customer. You may Edit the " "selected Customer and set its status to " "inactive."), 0, "" }, //Purchase Orders { "deleteCustomer", -3, "Credit Memos", -2, "" }, { "deleteCustomer", -4, "custhist", -2, "" }, { "deleteCustomer", -5, "A/R Open", -2, "" }, { "deleteCustomer", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as " "Checks have been written to it."), 0, "" }, { "deleteCustomer", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as there " "are still Invoices assigned to it. You must " "delete all of the selected Customer's Invoices " "before you may delete it"), 0, "" }, { "deleteCustomer", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer cannot be deleted as there " "are still Quotes assigned to it. You must " "delete all of the selected Customer's Quotes " "before you may delete it"), 0, "" }, { "deleteCustomerType", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Customer Type cannot be deleted " "as there are one or more Customers assigned " "to it. You must reassign these Customers " "before you may delete the selected Customer " "Type."), 0, "" }, { "deleteEmpgrp", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Employee Group cannot be deleted " "as there are one or more Employees assigned " "to it. You must reassign these Employees " "before you may delete the selected Employee " "Group."), 0, "" }, { "deleteForm", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Check Format cannot be deleted as it is " "used by one or more Bank Accounts. You must reassign " "these Bank Accounts before you may delete the " "selected Check Form." ), 0, "" }, { "deleteFreightClass", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Freight Class cannot be deleted " "because there are Items that are assigned to " "it. You must reassign these Items before you " "may delete the selected Freight Class." ), 0, ""}, { "deleteIncident", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Incident cannot be deleted as there are " "To-Do List Items associated with it."), 0, "" }, { "deleteIncident", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Incident cannot be deleted as there are " "Comments associated with it."), 0, "" }, { "deleteItem", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as it is used " "in one or more bills of materials."), 0, "" }, { "deleteItem", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are " "Item Site records associated with it."), 0, "" }, { "deleteItem", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are " "Substitute records associated with it."), 0, "" }, { "deleteItem", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are " "Breeder BOM records associated with it."), 0, "" }, { "deleteItem", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are " "assignement records associated with it."), 0, "" }, { "deleteItem", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Item cannot be deleted as there are " "Revision Control records associated with it."), 0, "" }, { "deleteItemSite", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "there is Inventory History posted against it. " "You may edit the Item Site and deactivate it."), 0, "" }, { "deleteItemSite", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "there is Work Order History posted against it. " "You may edit the Item Site and deactivate it."), 0, "" }, { "deleteItemSite", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "there is Sales History posted against it. " "You may edit the Item Site and deactivate it."), 0, "" }, { "deleteItemSite", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "there is Purchasing History posted against it. " "You may edit the Item Site and deactivate it."), 0, "" }, { "deleteItemSite", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "there is Planning History posted against it. " "You may edit the Item Site and deactivate it."), 0, "" }, { "deleteItemSite", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "there are Production Plans associated with it."), 0, "" }, { "deleteItemSite", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "it is used as a Supplied from Site."), 0, "" }, { "deleteItemSite", -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Item Site cannot be deleted as " "there is a non-zero Inventory Quantity posted " "against it."), 0, "" }, { "deleteItemUOMConv", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This UOM Conversion cannot be deleted as " "there are records for this Item which use this " "UOM."), 0, "" }, { "deleteOpenRecurringItems", -1, "", -1, "deleteIncident" }, { "deleteOpenRecurringItems", -2, "", -2, "deleteIncident" }, { "deleteOpenRecurringItems", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot delete open recurring items " "with an invalid type."), 0, "" }, { "deleteOpenRecurringItems", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot delete open recurring items " "without a valid parent item."),0, "" }, { "deleteOpportunity", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Opportunity cannot be deleted because " "there are ToDo Items assigned to it. You must " "delete or reassign these ToDo Items " "before you may delete it."), 0, "" }, { "deleteOpportunity", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Opportunity cannot be deleted because " "there are Quotes assigned to it. You must " "delete or reassign these Quotes " "before you may delete it."), 0, "" }, { "deleteOpportunity", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Opportunity cannot be deleted because " "there are Sales Orders assigned to it. You must " "delete or reassign these Sales Orders " "before you may delete it."), 0, "" }, { "deletePackage", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Package cannot be deleted because " "there are other packages that depend on it to " "function properly."), 0, "" }, { "deleteProfitCenter", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Profit Center cannot be deleted as it " "is in use by existing Account. You must reclass " "these Accounts before you may delete the selected " "Profit Center." ), 0, "" }, { "deleteProspect", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Prospect cannot be deleted as " "there are still Quotes for it. You must delete " "all of this Prospect's Quotes before you may " "delete the Prospect."), 0, "" }, { "deleteSalesRep", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Rep. cannot be deleted as " "he/she is still assigned to one or more " "Customers. You must reassign different Sales " "Reps. to all Customers to which the selected " "Sales Rep. is assigned before you may delete " "the selected Sales Rep." ), 0, "" }, { "deleteSalesRep", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Rep. cannot be deleted as " "he/she is still assigned to one or more " "Ship-tos. You must reassign different Sales " "Reps. to all Ship-tos to which the selected " "Sales Rep. is assigned before you may delete " "the selected Sales Rep." ), 0, "" }, { "deleteSalesRep", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Rep. cannot be deleted as " "there has been sales history recorded against " "him/her. You may edit and set the selected " "Sales Rep's active status to inactive." ), 0, "" }, { "deleteShipto", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Shipto cannot be deleted as there " "is still Archived Sales History assigned to it. You must " "delete all of the selected Customer's Ship-Tos " "before you may delete it."), 0, "" }, { "deleteShipto", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Shipto cannot be deleted " "as there has been Sales History recorded " "for this Shipto. You may Edit the " "selected Shipto and set its status to " "inactive."), 0, "" }, { "deleteShipto", -3, "The selected Shipto cannot be deleted " "as there has been Credit Memos recorded " "for this Shipto. You may Edit the " "selected Shipto and set its status to " "inactive.", -2, "" }, { "deleteShipto", -4, "The selected Shipto cannot be deleted " "as there has been Sales History recorded " "for this Shipto. You may Edit the " "selected Shipto and set its status to " "inactive.", -2, "" }, { "deleteShipto", -5, "The selected Shipto cannot be deleted " "as there has been Quote History recorded " "for this Shipto. You may Edit the " "selected Shipto and set its status to " "inactive.", -2, "" }, { "deleteShipto", -6, "The selected Shipto cannot be deleted " "as there has been Invoice History recorded " "for this Shipto. You may Edit the " "selected Shipto and set its status to " "inactive.", 0, "" }, { "deleteSO", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted because a Credit " "Card has been charged for it."), 0, "" }, { "deleteSO", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted because there is " "Credit Card transaction history for it."), 0, "" }, /* uncomment this when releaseSoNumber returns INTEGER instead of BOOLEAN { "deleteSO", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted because there was " "an internal error releasing the Sales Order Number."), 0, "" }, */ { "deleteSO", -101, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its " "line items have already been shipped."), 0, "" }, { "deleteSO", -102, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its " "line items have already been issued to shipping. "), 0, "" }, { "deleteSO", -103, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its " "line items are linked to a Return Authorization. " "You must resolve this conflict before " "you may delete this Sales Order."), 0, "" }, { "deleteSO", -104, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its " "line items are linked to an In Process Work Order. " "You must resolve this conflict before " "you may delete this Sales Order."), 0, "" }, { "deleteSO", -105, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as some of its " "line items have transaction history. "), 0, "" }, { "deleteSO", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order cannot be deleted as one or more " "of its Line items have associated Purchase Order Line Items which are either closed or " "have receipts associated with them. You may want to consider cancelling this Sales " "Order instead."), 0, "" }, { "deleteSO", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Sales Order was deleted successfully. However, " "the Released Purchase Orders associated with one or more line items of this Sales Order " "could not be deleted. You must delete these Purchase Orders seperately if desired."), 0, "" }, { "deleteSOItem", -101, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has already been shipped."), 0, "" }, { "deleteSOItem", -102, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has already been issued to shipping."), 0, "" }, { "deleteSOItem", -103, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it is linked to a Return Authorization. " "You must resolve this conflict before " "you may delete this Sales Order Item."), 0, "" }, { "deleteSOItem", -104, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it is linked to an In Process Work Order. " "You must resolve this conflict before " "you may delete this Sales Order Item."), 0, "" }, { "deleteSOItem", -105, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has generated Inventory History. " "You may want to consider cancelling this Sales Order Item."), 0, "" }, { "deleteSOItem", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order Item cannot be deleted as it has associated Purchase Order Line Item " "which is either closed or has receipts associated with it. You may want to consider cancelling this Sales Order Item instead."), 0, "" }, { "deleteSOItem", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Sales Order Item was deleted successfully. However, the Purchase Order Line Item " "associated with this Sales Line could not be deleted. You must delete this Purchase Line Item seperately if desired."), 0, "" }, { "deleteSubaccount", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Subaccount cannot be deleted as it " "is in use by existing Account. You must reclass " "these Accounts before you may delete the selected " "Subaccount."), 0, "" }, { "deleteTO", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as some of " "its line items have already been shipped."), 0, "" }, { "deleteTO", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as some of " "its line items have already been issued to " "shipping. You must return this stock before " "you may delete this Transfer Order."), 0, "" }, { "deleteTax", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Code cannot be deleted as there are " "Tax Assignments that refer to it. Change those " "Tax Assignments before trying to delete this " "Tax Code."), 0, "" }, { "deleteTaxAuthority", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority cannot be deleted as " "there are Tax Selections for it. Change or " "delete those Tax Selections before deleting " "this Tax Authority."), 0, "" }, { "deleteTaxAuthority", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Authority cannot be deleted as " "Checks have been written to it."), 0, "" }, { "deleteTaxClass", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Class cannot be deleted as there are " "Tax Codes that refer to it."), 0, "" }, { "deleteTaxZone", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Zone cannot be deleted as there are " "Tax Assignments that refer to it."), 0, "" }, { "deleteTaxZone", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Tax Zone cannot be deleted as there are " "Tax Registrations that refer to it."), 0, "" }, { "deleteTo", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as line " "items for it have already been shipped."), 0, "" }, { "deleteTo", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as line " "items for it have been issued to shipping."),0, "" }, { "deleteTo", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order cannot be deleted as the " "order number cannot be released."), 0, "" }, { "deleteVendor", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there" "have been P/Os created against it. " "You may deactivate this Vendor instead."), 0, "" }, { "deleteVendor", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there" "has been P/O Material Receipt History posted " "against it. " "You may deactivate this Vendor instead."), 0, "" }, { "deleteVendor", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there" "has been P/O Material Return History posted " "against it. " "You may deactivate this Vendor instead."), 0, "" }, { "deleteVendor", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there" "have been Vouchers posted against it. " "You may deactivate this Vendor instead."), 0, "" }, { "deleteVendor", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there" "have been A/P Open Items posted against it. " "You may deactivate this Vendor instead."), 0, "" }, { "deleteVendor", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there" "have been A/P Applications posted against it. " "You may deactivate this Vendor instead."), 0, "" }, { "deleteVendor", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Vendor cannot be deleted as there " "have been Checks posted against it. " "You may deactivate this Vendor instead."), 0, "" }, { "deleteWo", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Work Order cannot be deleted because time " "clock entries exist for it. Please Close it " "instead of trying to Delete it."), 0, "" }, { "deleteWo", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Work Order cannot be deleted for Job Item Types. " "Please close the associated Sales Order " "instead of trying to Delete it."), 0, "" }, { "deleteWo", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Work Order cannot be deleted in the current status. " "Please close the associated Sales Order " "instead of trying to Delete it."), 0, "" }, { "disablePackage", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This version of the PostgreSQL database server " "does not support package enabling or disabling. " "Upgrade to PostgreSQL 8.2 or later."), 0, "" }, { "disablePackage", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not find a package with the internal id % " "to enable or disable."), 0, "" }, { "distributeVoucherLine", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Distribution would result in zero " "quantity and amount." "Please distribute manually."), 0, "" }, { "distributeVoucherLine", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The purchase order and voucher have " "different currencies. " "Please distribute manually."), 0, "" }, { "distributeVoucherLine", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Distribution would result in a negative " "amount. " "Please distribute manually."), 0, "" }, { "distributeVoucherLine", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Item has multiple cost elements. " "Please distribute manually."), 0, "" }, { "editccnumber", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You must select Master Card, Visa, American " "Express or Discover as the credit card type."), 0, "" }, { "editccnumber", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of a Master Card credit card number " "has to be 16 digits."), 0, "" }, { "editccnumber", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of a Visa credit card number " "has to be either 13 or 16 digits."), 0, "" }, { "editccnumber", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of an American Express credit card " "number has to be 15 digits."), 0, "" }, { "editccnumber", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The length of a Discover credit card number " "has to be 16 digits."), 0, "" }, { "editccnumber", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first two digits for a valid Master Card " "number must be between 51 and 55"), 0, "" }, { "editccnumber", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first digit for a valid Visa number must " "be 4"), 0, "" }, { "editccnumber", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first two digits for a valid American " "Express number must be 34 or 37."), 0, "" }, { "editccnumber", -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The first four digits for a valid Discover " "Express number must be 6011."), 0, "" }, { "editccnumber", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The credit card number that you have provided " "is not valid."), 0, "" }, { "enablePackage", -1, "", -1, "disablePackage" }, { "enablePackage", -2, "", -2, "disablePackage" }, { "enterReceipt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Information for this order line item could not " "be found. If it is a Purchase Order Item then " "it does not appear to exist. If it is a " "Transfer Order Item then either the Transfer " "Order does not exist or there is no Item Site " "for this line item."), 0, "" }, { "explodeWo", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as there is no " "valid Bill of Materials on file for the Work Order " "Item. You must create a valid Bill of Materials " "for the Work Order Item before you may explode the " "Work Order."), 0, "" }, { "explodeWo", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as there are one " "or more Component Items on the Bill of Materials for " "the Work Order Item that are not valid in the Work " "Order Site. You must create a valid Item Site " "for all of the Component Items before you may " "explode this Work Order."), 0, "" }, { "explodeWo", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as there are one " "or more Co-Product/By-Product Items on the Breeder " "Bill of Materials for the Work Order Item that do " "not exist in the Work Order Site. You must " "create a valid Item Site for all of the Co-Product/" "By-Product Items before you may explode this " "Work Order."), 0, "" }, { "explodeWo", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded because it is not " "Open."), 0, "" }, { "explodeWo", -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded because the quantity" "ordered is not valid."), 0, "" }, { "fkeycheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot check dependencies when the " "contact is one of multiple foreign " "key columns."), 0, "" }, { "freezeAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot freeze this Accounting Period " "because it is still open."), 0, "" }, { "freezeAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot freeze this Accounting Period " "because it is already frozen."), 0, "" }, { "insertGLTransaction", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Nothing to do as the value to post to the " "G/L is 0."), 0, "" }, { "insertGLTransaction", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post a G/L transaction to a " "closed period."), 0, "" }, { "insertIntoGLSeries", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot add to a G/L Series because the " "Account is NULL or -1."), 0, "" }, { "insertIntoGLSeries", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot add to a G/L Series because the " "Accounting Period is closed."), 0, "" }, { "issueAllBalanceToShipping", -1, "", -1, "issueToShipping" }, { "issueAllBalanceToShipping", -10, "", -10, "issueToShipping" }, { "issueAllBalanceToShipping", -12, "", -12, "issueToShipping" }, { "issueAllBalanceToShipping", -13, "", -13, "issueToShipping" }, { "issueAllBalanceToShipping", -14, "", -14, "issueToShipping" }, { "issueAllBalanceToShipping", -15, "", -15, "issueToShipping" }, { "issueAllBalanceToShipping", -20, "", -20, "issueToShipping" }, { "issueLineBalanceToShipping", -1, "", -1, "issueToShipping" }, { "issueLineBalanceToShipping", -10, "", -10, "issueToShipping" }, { "issueLineBalanceToShipping", -12, "", -12, "issueToShipping" }, { "issueLineBalanceToShipping", -13, "", -13, "issueToShipping" }, { "issueLineBalanceToShipping", -14, "", -14, "issueToShipping" }, { "issueLineBalanceToShipping", -15, "", -15, "issueToShipping" }, { "issueLineBalanceToShipping", -20, "", -20, "issueToShipping" }, { "issueToShipping", -1, "", -1, "postInvTrans" }, { "issueToShipping", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Next Shipment Number has not been set in " "the Configure S/R window. Set that value and " "try issuing to shipping again."), 0, "" }, { "issueToShipping", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is on Credit Hold and " "must be taken off of Credit Hold before any " "inventory may be issued to it."), 0, "" }, { "issueToShipping", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is on Packing Hold " "and must be taken off of Packing Hold before " "any inventory may be issued to it."), 0, "" }, { "issueToShipping", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is on Return Hold. " "The Customer must return all materials for a " "related Return Authorization before any inven" "tory may be issued to this Order."), 0, "" }, { "issueToShipping", -15, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Sales Order is configured for Auto Registration. " "The Customer Account does not have a Primary Contact. " "A Primary Contact must be assigned to this Customer Account before any inven" "tory may be issued to this Order."), 0, "" }, { "issueToShipping", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory to " "issue the amount required of one " "of the Average Cost items requested. " "Average Cost items may not have a negative quantity on hand."),0, ""}, { "login", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The specified Username does not exist in the specified " "Database. Contact your Systems Administrator to report " "this issue"), 0, "" }, { "login", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The specified Username exists in the specified Database " "but is not Active. Contact your Systems Administrator " "to report this issue."), 0, "" }, { "login", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The specified Database is currently in Maintenance Mode " "and can only be accessed by System Administators. " "Contact your Systems Administrator to report this issue."), 0, "" }, { "massReplaceBomitem", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot make this BOM Item replacement " "because it would create a recursive BOM."), 0, "" }, { "openAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because " "it is already open."), 0, "" }, { "openAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because " "it is frozen."), 0, "" }, { "openAccountingPeriod", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because " "subsequent periods are closed."), 0, "" }, { "openAccountingPeriod", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Period because " "the fiscal year is closed."), 0, "" }, { "openAccountingYearPeriod", -1, "", -1, "openAccountingPeriod" }, { "openAccountingYearPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot open this Accounting Year because " "subsequent years are closed."), 0, "" }, { "openRecurringItems", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot count open recurring items with an " "invalid type."), 0, "" }, { "openRecurringItems", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot count open recurring items without " "a valid parent item."), 0, "" }, { "openRecurringItems", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Don't know how to count open recurring " "invoices."), 0, "" }, { "postAPCreditMemoApplication", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There are no A/P Credit Memo applications to post."), 0, "" }, { "postAPCreditMemoApplication", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There are no A/P Credit Memo applications to post."), 0, "" }, { "postAPCreditMemoApplication", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The total value of the applications that are you attempting to post " "is greater than the value of the A/P Credit Memo itself." ), 0, "" }, { "postAPCreditMemoApplication", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "At least one A/P Credit Memo application cannot be posted because " "there is no current exchange rate for its currency."), 0, "" }, { "postAPCreditMemoApplication", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The A/P Credit Memo to apply was not found."), 0, "" }, { "postAPCreditMemoApplication", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The amount to apply for this A/P Credit Memo is NULL."), 0, "" }, { "postARCreditMemoApplication", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There are no A/R Credit Memo applications to post."), 0, "" }, { "postARCreditMemoApplication", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either there are no A/R Credit Memo applications to post or there" " is no exchange rate for one of the applications."), 0, "" }, { "postARCreditMemoApplication", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The total value of the applications that you are attempting to " "post is greater than the value of the A/R Credit Memo itself. " "Please reduce the applications to total less than the value " "of the Credit Memo."), 0, "" }, { "postARCreditMemoApplication", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "At least one A/R Credit Memo application cannot be posted " "because there is no current exchange rate for its currency."), 0, "" }, { "postARCreditMemoApplication", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The A/R Credit Memo to apply was not found."), 0, "" }, { "postBankAdjustment", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bank Adjustment could not be posted " "because the one or more required records do " "not exist."), 0, "" }, { "postBankAdjustment", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bank Adjustment could not be posted " "because the total adjustment is 0 so there " "is nothing to post."), 0, "" }, { "postBankReconciliation", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Bank Reconciliation could not be " "posted because the G/L Account could not " "be verified."), 0, "" }, { "createInvoice", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Billing Selection cannot be posted " "because it has already been posted."), 0, "" }, { "createInvoices", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The G/L Account Assignments for one or more of the " "Billing Selections that you are trying to post are not " "configured correctly. Therefore, G/L Transactions " "cannot be posted for these. You must contact your " "Systems Administrator to have this corrected before " "you may post these Billing Selections."), 0, "" }, { "postCashReceipt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as " "the amount distributed is greater than the " "amount received. You must correct this before " "you may post this Cash Receipt."), 0, "" }, { "postCashReceipt", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as " "the amount received must be greater than zero. You must correct this before " "you may post this Cash Receipt."), 0, "" }, { "postCashReceipt", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as " "the A/R Account cannot be determined. You must " "make an A/R Account Assignment for the " "Customer Type to which this Customer is " "assigned before you may post this Cash " "Receipt."), 0, "" }, { "postCashReceipt", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted as " "the Bank Account cannot be determined. You must " "make a Bank Account Assignment for this Cash " "Receipt before you may post it." ), 0, "" }, { "postCashReceipt", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be posted, " "probably because the Customer's Prepaid Account " "was not found."), 0, "" }, { "postCashReceipt", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Cash Receipt because the " "credit card records could not be found."), 0, "" }, { "postCCCashReceipt", -1, "", -1, "createARCreditMemo" }, { "postCCCashReceipt", -10, "", -1, "postCCcredit" }, { "postCCCashReceipt", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Cash Receipt because the " "record of the credit card transaction either " "does not exist or is not consistent."), 0, "" }, { "postCCcredit", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because the " "default Bank Account for this Credit Card " "could not be found."), 0, "" }, { "postCCcredit", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because an " "invalid id/reference-type pair was passed."), 0, "" }, { "postCCcredit", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because the " "credit card and refund records could not be " "found."), 0, "" }, { "postCCcredit", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Credit Card refund because the " "credit card payment records is not for a refund."), 0, "" }, { "postCheck", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Check because it has already " "been posted."), 0, "" }, { "postCheck", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Check because the recipient " "type is not valid."), 0, "" }, { "postCheck", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Check because the Expense " "Category could not be found."), 0, "" }, { "postCheck", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Check because the G/L Account " "against which it is to be posted is not valid."), 0, "" }, { "postCountTag", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Count Tag because The total Count " "Slip quantity is greater than the Count Tag " "quantity."), 0, "" }, { "postCountTag", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Count Tag because the total Count " "Slip quantity is less than the Count Tag quantity " "for a Lot/Serial-controlled Item Site."), 0, "" }, { "postCountTag", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Count Tag because the total Count " "Slip quantity is less than the Count Tag quantity " "and there is no default location."), 0, "" }, { "postCountTag", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot post this Count Tag because the total Count " "Slip quantity is less than the Count Tag quantity " "and we don't post to default locations."), 0, "" }, { "postCountTagLocation", -1, "", -1, "postCountTag" }, { "postCountTagLocation", -2, "", -2, "postCountTag" }, { "postCountTagLocation", -3, "", -3, "postCountTag" }, { "postCountTagLocation", -4, "", -4, "postCountTag" }, { "postCreditMemo", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Credit Memo cannot be posted because it " "has already been posted."), 0, "" }, { "postCreditMemo", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Credit Memo is on Hold and, thus, cannot " "be posted."), 0, "" }, { "postCreditMemo", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Sales Account Assignment for this Credit " "Memo is not configured correctly. Because of " "this, G/L Transactions cannot be posted for " "this Credit Memo. You must contact your " "Systems Administrator to have this corrected " "before you may post this Credit Memo."), 0, "" }, { "postCreditMemo", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Misc. Charge Account Assignment for this Credit " "Memo is not configured correctly. Because of " "this, G/L Transactions cannot be posted for " "this Credit Memo. You must contact your " "Systems Administrator to have this corrected " "before you may post this Credit Memo."), 0, "" }, { "postCreditMemo", -16, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Freight Account Assignment for this Credit " "Memo is not configured correctly. Because of " "this, G/L Transactions cannot be posted for " "this Credit Memo. You must contact your " "Systems Administrator to have this corrected " "before you may post this Credit Memo."), 0, "" }, { "postCreditMemo", -18, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The A/R Account Assignment for this Credit " "Memo is not configured correctly. Because of " "this, G/L Transactions cannot be posted for " "this Credit Memo. You must contact your " "Systems Administrator to have this corrected " "before you may post this Credit Memo."), 0, "" }, { "postGLSeries", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post this G/L Series because the " "Accounting Period is closed."), 0, "" }, { "postGLSeries", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post this G/L Series because the G/L " "Series Discrepancy Account was not found."), 0, "" }, { "postGLSeriesNoSumm", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post this G/L Series because the " "Debits and Credits are unbalanced."), 0, "" }, { "postGLSeriesNoSumm", -4, "", -4, "postGLSeries" }, { "postGLSeriesNoSumm", -5, "", -5, "postGLSeries" }, { "postInvoice", -1, "", -1, "insertIntoGLSeries" }, { "postInvoice", -4, "", -4, "insertIntoGLSeries" }, { "postInvoice", -5, "", -5, "postGLSeries" }, { "postInvoice", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because it has " "already been posted."), 0, "" }, { "postInvoice", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because the Sales " "Account was not found."), 0, "" }, { "postInvoice", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an " "error processing Line Item taxes."), 0, "" }, { "postInvoice", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an " "error processing Misc. Line Item taxes."), 0, "" }, { "postInvoice", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because the Freight " "Account was not found."), 0, "" }, { "postInvoice", -15, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an " "error processing Freight taxes."), 0, "" }, { "postInvoice", -16, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because there was an " "error processing Tax Adjustments."), 0, "" }, { "postInvoice", -17, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Invoice because the A/R " "Account was not found."), 0, "" }, { "postInvTrans", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post an inventory transaction because" " the Item Site has no Control Method or the " "Item has an Item Type of Reference."), 0, "" }, { "postInvTrans", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Could not post an inventory transaction because" " the transaction will cause an Average Costed " "Item to go negative which is not allowed."), 0, "" }, { "postInvTrans", -3, "", -3, "insertGLTransaction" }, { "postInvTrans", -4, "", -4, "insertGLTransaction" }, { "postPoReceipt", -1, "", -1, "postReceipt" }, { "postPoReceipt", -2, "", -2, "postReceipt" }, { "postPoReceipt", -3, "", -3, "postReceipt" }, { "postPoReceipt", -4, "", -4, "postReceipt" }, { "postPoReceipt", -10, "", -10, "postReceipt" }, { "postPoReceipt", -11, "", -11, "postReceipt" }, { "postPoReceipt", -12, "", -12, "postReceipt" }, { "postProduction", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Production because the Work Order " "status is not Exploded, Released, or InProcess."), 0, "" }, { "postProduction", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Production because backflushing " "component usage could not be completed due " "to missing Item Sites."), 0, "" }, { "postProduction", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to post this Production because of missing " "Item Site or Cost Category."), 0, "" }, { "postReceipt", -1, "", -1, "postInvTrans" }, { "postReceipt", -2, "", -2, "postInvTrans" }, { "postReceipt", -3, "", -3, "insertGLTransaction" }, { "postReceipt", -4, "", -4, "insertGLTransaction" }, { "postReceipt", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Receipt Line has already been posted."), 0, "" }, { "postReceipt", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Receipt Line cannot be " "posted because it has a quantity of 0."), 0, "" }, { "postReceipt", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Purchase Order Receipt Line has no " "Standard Cost assigned to it."), 0, "" }, { "postReceipt", -16, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot not issue item to shipping. " "No Sales Order item found against this PO Item."), 0, "" }, { "postReceipt", -17, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot not issue item to shipping. " "Inventory history not found."), 0, "" }, { "postReceipt", -20, "", -1, "issueToShipping" }, { "postReceipt", -21, "", -10, "issueToShipping" }, { "postReceipt", -22, "", -12, "issueToShipping" }, { "postReceipt", -23, "", -13, "issueToShipping" }, { "postReceipt", -24, "", -14, "issueToShipping" }, { "postReceipt", -25, "", -15, "issueToShipping" }, { "postReceipt", -26, "", -12, "shipShipment" }, { "postReceipt", -27, "", -13, "shipShipment" }, { "postReceipt", -28, "", -14, "shipShipment" }, { "postReceipt", -29, "", -15, "shipShipment" }, { "postReceipt", -30, "", -1, "shipShipment" }, { "postReceipt", -31, "", -3, "shipShipment" }, { "postReceipt", -32, "", -4, "shipShipment" }, { "postReceipt", -33, "", -5, "shipShipment" }, { "postReceipt", -34, "", -6, "shipShipment" }, { "postReceipt", -35, "", -8, "shipShipment" }, { "postReceipt", -36, "", -50, "shipShipment" }, { "postReceipt", -37, "", -99, "shipShipment" }, { "postPoReceipts", -1, "", -1, "postPoReceipt" }, { "postPoReceipts", -3, "", -3, "postPoReceipt" }, { "postPoReceipts", -4, "", -4, "postPoReceipt" }, { "postPoReceipts", -10, "", -10, "postPoReceipt" }, { "postPoReceipts", -12, "", -12, "postPoReceipt" }, { "postPoReturns", -1, "", -1, "postInvTrans" }, { "postPoReturns", -3, "", -3, "insertGLTransaction" }, { "postPoReturns", -4, "", -4, "insertGLTransaction" }, { "postVoucher", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The Cost Category for one or more Item Sites " "for the Purchase Order covered by this Voucher " "is not configured with Purchase Price Variance " "or P/O Liability Clearing Account Numbers or " "the Vendor of this Voucher is not configured " "with an A/P Account Number. Because of this, " "G/L Transactions cannot be posted for this " "Voucher."), 0, "" }, { "recallShipment", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it " "does not appear to have been shipped."), 0, "" }, { "recallShipment", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it " "appears to have been invoiced."), 0, "" }, { "recallShipment", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled " "because it has already been received " "at its destination."), 0, "" }, { "recallShipment", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it " "appears to have been invoiced and the invoice has been posted."), 0, "" }, { "recallShipment", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled because it " "contains one or more Line Items with Site/" "Product Category/Customer combinations that " "have not been properly described in Sales " "Account Assignments. These assignments must be " "made before G/L Transactions can be posted and" "this Sales Order is allowed to be recalled."), 0, "" }, { "recallShipment", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This shipment cannot be recalled " "because the associated Transfer Order is closed."), 0, "" }, { "releasePurchaseOrder", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Purchase Order because it " "does not have any unreleased Purchase Order Items."), 0, "" }, { "releaseTransferOrder", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Transfer Order because " "it does not have any line items."), 0, "" }, { "releaseUnusedBillingHeader", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Billing Header because it " "has already been posted."), 0, "" }, { "releaseUnusedBillingHeader", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot release this Billing Header because it " "has Line Items."), 0, "" }, { "relocateInventory", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "You cannot Relocate more inventory than is " "available."), 0, "" }, { "replaceAllVoidedChecks", -1, "", -1, "replaceVoidedCheck" }, { "replaceVoidedCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot replace this voided check because " "either it has not been voided, it has " "already been posted, or it has already been" "replaced."), 0, "" }, { "returnCompleteShipment", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either a Cost Category for the Items you are " "trying to Return is not configured with a " "Shipping Asset Account Number or a Customer " "Type/Product Category/Site Sales Account " "assignment does not exist . Because of this, " "G/L Transactions cannot be posted for this " "Return. You must contact your Systems " "Administrator to have this corrected before " "you may Return this Shipment."), 0, "" }, { "returnItemShipments", -1, "", -1, "postInvTrans" }, { "returnItemShipments", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either a Cost Category for the Items you are " "trying to Return is not configured with a " "Shipping Asset Account Number or a Customer " "Type/Product Category/Site Sales Account " "assignment does not exist . Because of this, " "G/L Transactions cannot be posted for this " "Return. You must contact your Systems " "Administrator to have this corrected before " "you may Return this Shipment."), 0, "" }, { "returnShipmentTransaction", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Either a Cost Category for the Items you are " "trying to Return is not configured with a " "Shipping Asset Account Number or a Customer " "Type/Product Category/Site Sales Account " "assignment does not exist . Because of this, " "G/L Transactions cannot be posted for this " "Return. You must contact your Systems " "Administrator to have this corrected before " "you may Return this Shipment."), 0, "" }, { "reverseCashReceipt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as " "the amount distributed is greater than the " "amount received."), 0, "" }, { "reverseCashReceipt", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as " "the amount received must be greater than zero."), 0, "" }, { "reverseCashReceipt", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as " "the A/R Account cannot be determined. You must " "make an A/R Account Assignment for the " "Customer Type to which this Customer is " "assigned before you may reverse this Cash " "Receipt."), 0, "" }, { "reverseCashReceipt", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed as " "the Bank Account cannot be determined. You must " "make a Bank Account Assignment for this Cash " "Receipt before you may reverse it." ), 0, "" }, { "reverseCashReceipt", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Cash Receipt cannot be reversed, " "probably because the Customer's Prepaid Account " "was not found."), 0, "" }, { "reverseCashReceipt", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reverse this Cash Receipt because the " "credit card records could not be found."), 0, "" }, { "saveAlarm", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "An alarm for this item already exists."), 0, "" }, { "selectForBilling", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The quantity you have selected for Billing is " "less than the quantity shipped. You may not " "bill for less than the quantity shipped."), 0, "" }, { "shipShipment", -1, "", -1, "postInvTrans" }, { "shipShipment", -3, "", -3, "insertGLTransaction" }, { "shipShipment", -4, "", -4, "insertGLTransaction" }, { "shipShipment", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Sales Order may not be shipped as it " "contains one or more Line Items that have " "Site/Product Category/Customer combinations " "that have not been properly described in Sales " "Account Assignments. These assignments must be " "made before G/L Transactions can be posted and " "this Sales Order is allowed to ship."), 0, "" }, { "shipShipment", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Transfer Order may not be shipped " "because there is no Item Site for the " "Transit Site."), 0, "" }, { "shipShipment", -8, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Shipment cannot be shipped because it " "appears to have already shipped."), 0, "" }, { "shipShipment", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Credit Hold and must be " "taken off of Credit Hold before it " "may be shipped."), 0, "" }, { "shipShipment", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Packing Hold and must be " "taken off of Packing Hold before it " "may be shipped."), 0, "" }, { "shipShipment", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Return Hold. The Customer" " must return all materials for a related Return " "Authorization before this order may be shipped."), 0, "" }, { "shipShipment", -15, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The selected Order is on Shipping Hold and must " "be taken off of Shipping Hold before it " "may be shipped."), 0, "" }, { "shipShipment", -50, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Shipment cannot be shipped because it " "does not appear to exist."), 0, "" }, { "shipShipment", -99, QT_TRANSLATE_NOOP("storedProcErrorLookup", "This Order may not be shipped because it has been " "marked as Ship Complete and quantities for one or " "more Line Items are still not completely issued. " "Please correct this before shipping the Order."), 0, "" }, { "splitReceipt", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Only Purchase Order Receipts may be split."), 0, "" }, { "splitReceipt", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Only posted receipts may be split."), 0, "" }, { "splitReceipt", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Vouchered receitps may not be split."), 0, "" }, { "splitReceipt", -4, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Split quantity must me less than original receipt quantity."), 0, "" }, { "splitReceipt", -5, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Split freight may not be greater than original freight."), 0, "" }, { "splitReceipt", -6, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Receipt not found."), 0, "" }, { "splitReceipt", -7, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The split quantity must be a positive number."), 0, "" }, { "splitRecurrence", -10, "", -10, "createRecurringItems" }, { "splitRecurrence", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot create recurring items without a valid " "parent item to copy."), 0, "" }, { "sufficientInventoryToShipItem", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot figure out which line item to issue."), 0, "" }, { "sufficientInventoryToShipItem", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory to issue the amount required of " "Item %1 in Site %2."), 0, "" }, { "sufficientInventoryToShipItem", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Item Number %1 in Site %2 is a Multiple Location or " "Lot/Serial controlled Item which is short on Inventory. " "This transaction cannot be completed as is. Please make " "sure there is sufficient Quantity on Hand before proceeding."), 0, "" }, { "sufficientInventoryToShipItem", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Invalid Order Type. Only Sales Orders and Transfer Orders " "may be shipped from this window."), 0, "" }, { "sufficientInventoryToShipOrder", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot check inventory levels for" "an invalid item."), 0, ""}, { "sufficientInventoryToShipOrder", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "There is not enough Inventory to " "issue the amount required of one " "of the items requested."),0, ""}, { "sufficientInventoryToShipOrder", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "One of the requested items is a " "Multiple Location or Lot/Serial " "controlled Item which is sort on " "Inventory."), 0, ""}, { "sufficientInventoryToShipOrder",-11, "",-11, "sufficientInventoryToShipItem"}, { "thawAccountingPeriod", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot thaw this Accounting Period " "because it is closed."), 0, "" }, { "thawAccountingPeriod", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot thaw this Accounting Period " "because it is not frozen."), 0, "" }, { "todoItemMove", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot change the Sequence of a non-existent " "To-Do List Item. Possible cause: no To-Do " "List Item was selected."), 0, "" }, { "updateTodoItem", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as " "there is no assigned User."), 0, "" }, { "updateTodoItem", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as " "the Task Name is blank."), 0, "" }, { "updateTodoItem", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as " "there is no Due Date."), 0, "" }, { "updateTodoItem", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "The To-Do List Item cannot be updated as " "an invalid internal ID was supplied ."), 0, "" }, { "voidCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this check because either it has already " "been voided, posted, or replaced, or it has been " "transmitted electronically. If this check has been " "posted, try Void Posted Check with the Check Register " "window."), 0, "" }, { "voidCreditMemo", -1, "", -1, "insertIntoGLSeries" }, { "voidCreditMemo", -4, "", -4, "insertIntoGLSeries" }, { "voidCreditMemo", -5, "", -5, "postGLSeries" }, { "voidCreditMemo", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Credit Memo because it has " "not been posted."), 0, "" }, { "voidCreditMemo", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Credit Memo because the Sales " "Account was not found."), 0, "" }, { "voidCreditMemo", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Credit Memo because there " "A/R Applications posted against this Credit Memo."), 0, "" }, { "voidInvoice", -1, "", -1, "insertIntoGLSeries" }, { "voidInvoice", -4, "", -4, "insertIntoGLSeries" }, { "voidInvoice", -5, "", -5, "postGLSeries" }, { "voidInvoice", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Invoice because it has " "not been posted."), 0, "" }, { "voidInvoice", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Invoice because the Sales " "Account was not found."), 0, "" }, { "voidInvoice", -20, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Unable to void this Invoice because there " "A/R Applications posted against this Invoice."), 0, "" }, { "voidPostedCheck", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this check because it has already " "been voided."), 0, "" }, { "voidPostedCheck", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this check because the recipient " "type is not valid."), 0, "" }, { "voidPostedCheck", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this check because the Expense " "Category could not be found."), 0, "" }, { "voidPostedCheck", -13, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this check because the G/L account " "to which the funds should be credited is not " "valid."), 0, "" }, { "voidPostedCheck", -14, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot void this check because the check has " "has been reconciled in Bank Reconciliation."), 0, "" }, { "replaceVoidedCheck", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot replace a check that is not voided " "or has already been posted or replaced."), 0, "" }, { "replaceVoidedCheck", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot replace this voided check because " "one of its line items has been reselected " "for billing and is represented on another " "check."), 0, "" }, { "reserveSoLineBalance", -1, "", -1, "reserveSoLineQty" }, { "reserveSoLineBalance", -2, "", -2, "reserveSoLineQty" }, { "reserveSoLineBalance", -3, "", -3, "reserveSoLineQty" }, { "reserveSoLineQty", -1, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reserve more quantity than remaining on order."), 0, ""}, { "reserveSoLineQty", -2, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reserve negative quantities."), 0, ""}, { "reserveSoLineQty", -3, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Cannot reserve more quantity than currently on hand and already reserved."), 0, ""}, { "woClockIn", -1, "", -1, "explodeWo" }, { "woClockIn", -2, "", -2, "explodeWo" }, { "woClockIn", -3, "", -3, "explodeWo" }, { "woClockIn", -9, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 cannot be Exploded as it seems to have " "an invalid Order Quantity."), 0, "" }, { "woClockIn", -10, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 has at least one Item in its Bill of " "Materials with the Push issue method that has not " "yet been issued. You must issue all Push Items " "to this Work Order."), 0, "" }, { "woClockIn", -11, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 has at least one Item in its Bill of " "Materials with the Push issue method that does not " "have the required quantity issued. You must issue " "all Push Items to this Work Order."), 0, "" }, { "woClockIn", -12, QT_TRANSLATE_NOOP("storedProcErrorLookup", "Work Order %1 is closed."), 0, "" }, }; void initErrorLookupHash() { if (! ErrorLookupHash.isEmpty()) { QMessageBox::critical(0, QCoreApplication::translate("storedProcErrorLookup", "ErrorLookupHash initialization error"), QCoreApplication::translate("storedProcErrorLookup", "ErrorLookupHash has already been initialized.")); return; } unsigned int numElems = sizeof(errors) / sizeof(errors[0]); for (unsigned int i = 0; i < numElems; i++) { QPair currPair; if (errors[i].msgPtr == 0) currPair = qMakePair(errors[i].retVal, QCoreApplication::translate("storedProcErrorLookup", errors[i].msg)); else { QList > proxyList; QString proxyname; if (errors[i].proxyName.isEmpty()) proxyname = errors[i].procName.toUpper(); else proxyname = errors[i].proxyName.toUpper(); proxyList = ErrorLookupHash.values(proxyname); if (proxyList.size() > 0) { int proxyIndex; for (proxyIndex = 0; proxyIndex < proxyList.size(); proxyIndex++) { if (proxyList.at(proxyIndex).first == errors[i].msgPtr) { currPair = qMakePair(errors[i].retVal, QString(proxyList.at(proxyIndex).second)); break; } } if (proxyIndex >= proxyList.size()) { QMessageBox::critical(0, QCoreApplication::translate("storedProcErrorLookup", "Lookup Error"), QCoreApplication::translate("storedProcErrorLookup", "Could not find (%1, %2) in ErrorLookupHash " "when trying to insert proxy entry for " "(%3, %4).") .arg(proxyname).arg(errors[i].msgPtr) .arg(errors[i].procName).arg(errors[i].retVal)); continue; } } else // couldn't find proxyList => forward reference { unsigned int j; for (j = i + 1; j < numElems; j++) { if (errors[j].retVal == errors[i].msgPtr && errors[j].procName.toUpper() == proxyname) { currPair = qMakePair(errors[i].retVal, QString(QCoreApplication::translate("storedProcErrorLookup", errors[j].msg))); break; } } if (j >= numElems) { QMessageBox::critical(0, QCoreApplication::translate("storedProcErrorLookup", "Lookup Error"), QCoreApplication::translate("storedProcErrorLookup", "Could not find (%1, %2) in ErrorLookupHash " "when trying to insert proxy entry for " "(%3, %4).") .arg(errors[i].proxyName).arg(errors[i].msgPtr) .arg(errors[i].procName).arg(errors[i].retVal)); continue; } } } ErrorLookupHash.insert(errors[i].procName.toUpper(), currPair); } // for } QString storedProcErrorLookup(const QString procName, const int retVal) { QString returnStr = ""; if (ErrorLookupHash.isEmpty()) initErrorLookupHash(); QList > list = ErrorLookupHash.values(procName.toUpper()); for (int i = 0; i < list.size(); i++) { if (list.at(i).first == retVal) { returnStr = list.at(i).second; break; } } if (returnStr.isEmpty()) returnStr = QCoreApplication::translate("storedProcErrorLookup", "A Stored Procedure failed to run properly."); returnStr = QString("

") + returnStr + QString("
(%1, %2)
").arg(procName).arg(retVal); return returnStr; } qt-client-4.1.0/common/storedProcErrorLookup.h000066400000000000000000000011551217451700100214050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STOREDPROCERRORLOOKUP_H #define STOREDPROCERRORLOOKUP_H #include QString storedProcErrorLookup(const QString, const int); #endif // STOREDPROCERRORLOOKUP_H qt-client-4.1.0/common/tarfile.cpp000066400000000000000000000060341217451700100170370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "tarfile.h" #include #include struct tarHeaderBlock { char name[100]; // name of file char mode[8]; // file mode char uid[8]; // owner user ID char gid[8]; // owner group ID char size[12]; // length of file in bytes char mtime[12]; // modified time of file char chksum[8]; // header checksum char typeflag; // see type constants char linkname[100]; // name of linked file char magic[8]; // "ustar " + null terminator char uname[32]; // owner user name char gname[32]; // owner group name char devmajor[8]; // device major number char devminor[8]; // device minor number char prefix[155]; // prefix for file names longer than 100 bytes char filler[12]; // filler to make header even 512 bytes }; const char TYPE_REGULAR_ALT = '\0'; // old compatible flag for regular file const char TYPE_REGULAR = '0'; // regular file const char TYPE_LINK = '1'; // link to another file in archive const char TYPE_SYMLINK = '2'; // Symbolic link const char TYPE_CHAR = '3'; // Character special device const char TYPE_BLOCK = '4'; // Block special device const char TYPE_DIR = '5'; // Directory const char TYPE_FIFO = '6'; // FIFO special file const char TYPE_CONTIGUOS = '7'; // RESERVERED/Contiguous file TarFile::TarFile(const QByteArray & bytes) { _valid = false; QByteArray localBytes(bytes); QBuffer fin(&localBytes); if(!fin.open(QIODevice::ReadOnly)) return; bool valid = false; long size = 0; long blocks = 0; char block[512]; QString name, str; while(!fin.atEnd()) { tarHeaderBlock head; fin.read((char*)&head, sizeof(head)); if(head.name[0] == '\0' && head.size[0] == '\0' && head.typeflag == '\0') continue; QString magic(head.magic); if(magic != "ustar ") return; name = QString(head.name); str = QString(head.size); size = str.toLong(&valid, 8); if(head.typeflag == TYPE_REGULAR_ALT) head.typeflag = TYPE_REGULAR; blocks = (size + 511) / 512; if(head.typeflag == TYPE_REGULAR) { QByteArray mybytes; QBuffer fout(&mybytes); fout.open(QIODevice::WriteOnly); for(int i = 0; i < blocks; i++) { fin.read(&block[0], 512); fout.write(&block[0], qMin(size,512L)); size -= 512; } fout.close(); _list.insert(name, mybytes); } else { for(int i = 0; i < blocks; i++) fin.read(&block[0], 512); } } _valid = true; } TarFile::~TarFile() { } qt-client-4.1.0/common/tarfile.h000066400000000000000000000013261217451700100165030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __TARFILE_H__ #define __TARFILE_H__ #include #include class TarFile { public: TarFile(const QByteArray &); virtual ~TarFile(); QMap _list; bool isValid() { return _valid; } private: bool _valid; }; #endif qt-client-4.1.0/common/xTupleCommon.qrc000066400000000000000000000001621217451700100200420ustar00rootroot00000000000000 images/splashXTuple.png qt-client-4.1.0/common/xbase32.cpp000066400000000000000000000114431217451700100166600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xbase32.h" #include #include #include #include // This is based on base64 but modified to use a set of 32 chars instead static const char _base32Table[] = "ABCDEFGHJKMNPQRSTVWXYZ0123456789"; // I = 1 // L = 1 // O = 0 (zero) // U Place holder static char getValue(char c) { int i = 0; if('I' == c || 'L' == c) c = '1'; else if('O' == c) c = '0'; while(_base32Table[i] != '\0') { if(_base32Table[i] == c) return (char)i; i++; } return (char)-1; } QString XBase32Encode(QIODevice & iod) { QString value; // the string that holds the final encoded values int packet = 0; // there are 9 packets per line (packet=5 bytes in) char _in[5]; unsigned char in[5]; char out[8]; qint64 didRead = 0; while(!iod.atEnd()) { // set the values to 0 in case we don't read all 5 _in[0] = _in[1] = _in[2] = _in[3] = _in[4] = (char)0; // read in up to the next 5 chars didRead = iod.read(&_in[0], 5); in[0] = (unsigned char)_in[0]; in[1] = (unsigned char)_in[1]; in[2] = (unsigned char)_in[2]; in[3] = (unsigned char)_in[3]; in[4] = (unsigned char)_in[4]; if(didRead > 0) { // determine the encoded chars out[0] = _base32Table[ in[0] >> 3 ]; out[1] = _base32Table[ ((in[0] & 0x07) << 2) | (in[1] >> 6) ]; out[2] = _base32Table[ ((in[1] & 0x3E) >> 1) ]; out[3] = _base32Table[ ((in[1] & 0x01) << 4) | (in[2] >> 4) ]; out[4] = _base32Table[ ((in[2] & 0x0F) << 1) | (in[3] >> 7) ]; out[5] = _base32Table[ ((in[3] & 0x7C) >> 2) ]; out[6] = _base32Table[ ((in[3] & 0x03) << 3) | (in[4] >> 5) ]; out[7] = _base32Table[ ((in[4] & 0x1F)) ]; // modify the chars if we were short if(didRead < 5) { out[7] = 'U'; if(didRead < 4) { out[6] = 'U'; out[5] = 'U'; } if(didRead < 3) out[4] = 'U'; if(didRead < 2) { out[3] = 'U'; out[2] = 'U'; } } // place the final chars in the value value += out[0]; value += out[1]; value += out[2]; value += out[3]; value += out[4]; value += out[5]; value += out[6]; value += out[7]; } if(++packet >= 9) { packet = 0; // reset the packet count value += '\n'; // add a newline to the value } } value += '\n'; // throw one last newline onto the end return value; } QByteArray XBase32Decode(const QString & _source) { QString source = _source; QByteArray value; // empty string -- nothing to do if(source.isEmpty()) return value; QTextStream in(&source, QIODevice::ReadOnly); QBuffer buf(&value); buf.open(QIODevice::WriteOnly); char a[8], b[8], o[5]; qint64 n = 0; int p = 0; // current position in string int l = source.length(); // length of string char c = 0; while (p < l) { // read in the next 8 valid bytes n = 0; while(n < 8 && p < l) { c = ((QChar)source.at(p++)).toUpper().toAscii(); a[n] = c; b[n] = (c == 'U' ? 0 : getValue(c)); if(b[n] != -1) { n++; } } if(n < 8 && n != 0) { // whoops we have a mismatch in the number of bytes we need } if(n == 0) break; // convert from base32 to binary o[0] = (b[0] << 3) | (b[1] >> 2); o[1] = (b[1] << 6) | (b[2] << 1) | (b[3] >> 4); o[2] = (b[3] << 4) | (b[4] >> 1); o[3] = (b[4] << 7) | (b[5] << 2) | (b[6] >> 3); o[4] = (b[6] << 5) | b[7]; // determine how many bytes we should be reading if(a[2] == 'U') n = 1; else if(a[4] == 'U') n = 2; else if(a[5] == 'U') n = 3; else if(a[7] == 'U') n = 4; else n = 5; if(n != buf.write(&o[0], n)) { // eek we didn't write the number of block we were supposed to } if(n < 5) break; // we've reached the end of the data we have to read so just stop } return value; } qt-client-4.1.0/common/xbase32.h000066400000000000000000000011521217451700100163210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XBASE32_H__ #define __XBASE32_H__ #include class QIODevice; QString XBase32Encode(QIODevice &); QByteArray XBase32Decode(const QString &); #endif qt-client-4.1.0/common/xtsettings.cpp000066400000000000000000000023711217451700100176250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xtsettings.h" #include QVariant xtsettingsValue(const QString & key, const QVariant & defaultValue) { QSettings settings(QSettings::UserScope, "xTuple.com", "xTuple"); QString key2 = key; if(key.startsWith("/xTuple/")) key2 = key2.replace(0, 8, QString("/OpenMFG/")); if(settings.contains(key)) return settings.value(key, defaultValue); else { QSettings oldsettings(QSettings::UserScope, "OpenMFG.com", "OpenMFG"); if(oldsettings.contains(key2)) { QVariant val = oldsettings.value(key2, defaultValue); xtsettingsSetValue(key, val); return val; } } return defaultValue; } void xtsettingsSetValue(const QString & key, const QVariant & value) { QSettings settings(QSettings::UserScope, "xTuple.com", "xTuple"); settings.setValue(key, value); } qt-client-4.1.0/common/xtsettings.h000066400000000000000000000013021217451700100172630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTSETTINGS_H__ #define __XTSETTINGS_H__ #include #include QVariant xtsettingsValue(const QString & key, const QVariant & defaultValue = QVariant()); void xtsettingsSetValue(const QString & key, const QVariant & value); #endif qt-client-4.1.0/common/xtupleproductkey.cpp000066400000000000000000000070311217451700100210420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xtupleproductkey.h" #include "xbase32.h" #include QString keyNormalize(const QString & key) { QString nkey = key.toUpper(); nkey = nkey.replace("-", ""); nkey = nkey.replace("I", "1", Qt::CaseInsensitive); nkey = nkey.replace("L", "1", Qt::CaseInsensitive); nkey = nkey.replace("O", "0", Qt::CaseInsensitive); return nkey; } bool keyCheck(const QString & key) { QString nkey = keyNormalize(key); QString csChar = nkey.left(1); int cs = 0; for(int i = 1; i < nkey.size(); ++i) cs += nkey.at(i).toAscii(); cs = cs % 32; static const char _base32Table[] = "ABCDEFGHJKMNPQRSTVWXYZ0123456789"; return ((csChar.size() > 0) && (csChar.at(0).toAscii() == _base32Table[cs])); } class XTupleProductKeyPrivate { public: XTupleProductKeyPrivate(const QString &); QString key; bool valid; int version; QDate expiration; quint8 users; QString custid; bool perpetual; }; XTupleProductKeyPrivate::XTupleProductKeyPrivate(const QString & k) { key = k; valid = keyCheck(key); version = -1; expiration.setDate(2000, 1, 1); users = -1; perpetual = false; int tmp = 0; if(!valid) { return; } QByteArray data = XBase32Decode(key.mid(1)); if(data.size() != 15) { valid = false; return; } version = (data.at(0) >> 4); if(version != 1 && version != 2 && version != 3) { valid = false; return; } int expM = data.at(0) & 0x0F; int expY = data.at(1); if(expM >= 1 && expM <= 12 && expY >= 0 && expY <= 255) { expiration.setDate(2000 + expY, expM, 1); expiration.setDate(expiration.year(), expiration.month(), expiration.daysInMonth()); } else { valid = false; return; } users = data.at(2); tmp = data.at(3); if(version == 2 || version == 3) { perpetual = (tmp & 0x01) == 0x01; tmp = tmp & 0xFE; } if(tmp != 0x42) { valid = false; return; } custid = ""; for(int i = 4; i < 12; ++i) custid.append(data.at(i)); qint8 b; b = (data.at(11) & 0xC0) |(data.at(10) & 0x30) |(data.at(9) & 0x0C) |(data.at(8) & 0x03); if(data.at(12) != b) { valid = false; return; } b = (data.at(7) & 0xC0) |(data.at(6) & 0x30) |(data.at(5) & 0x0C) |(data.at(4) & 0x03); if(data.at(13) != b) { valid = false; return; } b = (data.at(3) & 0xC0) |(data.at(2) & 0x30) |(data.at(1) & 0x0C) |(data.at(0) & 0x03); if(data.at(14) != b) { valid = false; return; } } XTupleProductKey::XTupleProductKey(const QString & key) { _private = new XTupleProductKeyPrivate(key); } XTupleProductKey::~XTupleProductKey() { if(_private) delete _private; _private = 0; } bool XTupleProductKey::valid() const { return _private->valid; } int XTupleProductKey::version() const { return _private->version; } QDate XTupleProductKey::expiration() const { return _private->expiration; } int XTupleProductKey::users() const { return _private->users; } QString XTupleProductKey::customerId() const { return _private->custid; } bool XTupleProductKey::perpetual() const { return _private->perpetual; } qt-client-4.1.0/common/xtupleproductkey.h000066400000000000000000000015761217451700100205170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __KEYTOOLS_H__ #define __KEYTOOLS_H__ #include #include class XTupleProductKeyPrivate; class XTupleProductKey { public: XTupleProductKey(const QString &); virtual ~XTupleProductKey(); bool valid() const; int version() const; QDate expiration() const; int users() const; QString customerId() const; bool perpetual() const; private: XTupleProductKeyPrivate * _private; }; #endif qt-client-4.1.0/csvimp/000077500000000000000000000000001217451700100147135ustar00rootroot00000000000000qt-client-4.1.0/global.pri000066400000000000000000000046601217451700100153740ustar00rootroot00000000000000# # This file is part of the xTuple ERP: PostBooks Edition, a free and # open source Enterprise Resource Planning software suite, # Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. # It is licensed to you under the Common Public Attribution License # version 1.0, the full text of which (including xTuple-specific Exhibits) # is available at www.xtuple.com/CPAL. By using this software, you agree # to be bound by its terms. # # # This file is included by all the other project files # and is where options or configurations that affect all # of the projects can be place. # # # This is the relative directory path to the openrpt project. # exists(../../../openrpt) { OPENRPT_DIR = ../../../openrpt } exists(../../openrpt) { OPENRPT_DIR = ../../openrpt } exists(../openrpt) { OPENRPT_DIR = ../openrpt } !exists(openrpt) { exists(../openrpt) { OPENRPT_DIR = ../openrpt } } ! exists($${OPENRPT_DIR}) { error("Could not set the OPENRPT_DIR qmake variable.") } OPENRPT_BLD = $${OPENRPT_DIR} exists($${OPENRPT_DIR}-build-desktop) { OPENRPT_BLD = $${OPENRPT_DIR}-build-desktop } exists(../../../csvimp) { CSVIMP_DIR = ../../../csvimp } exists(../../csvimp) { CSVIMP_DIR = ../../csvimp } exists(../csvimp) { CSVIMP_DIR = ../csvimp } !exists(csvimp) { exists(../csvimp) { CSVIMP_DIR = ../csvimp } } ! exists($${CSVIMP_DIR}) { error("Could not set the CSVIMP_DIR qmake variable.") } CSVIMP_BLD = $${CSVIMP_DIR} exists($${CSVIMP_DIR}-build-desktop) { CSVIMP_BLD = $${CSVIMP_DIR}-build-desktop } INCLUDEPATH += ../$${OPENRPT_DIR}/common ../$${OPENRPT_BLD}/common \ ../$${OPENRPT_DIR}/OpenRPT/renderer ../$${OPENRPT_BLD}/OpenRPT/renderer \ ../$${OPENRPT_DIR}/OpenRPT/wrtembed ../$${OPENRPT_BLD}/OpenRPT/wrtembed \ ../$${OPENRPT_DIR}/MetaSQL ../$${OPENRPT_BLD}/MetaSQL \ ../$${OPENRPT_DIR}/MetaSQL/tmp ../$${OPENRPT_BLD}/MetaSQL/tmp \ ../$${CSVIMP_DIR}/csvimpcommon ../$${CSVIMP_BLD}/csvimpcommon INCLUDEPATH = $$unique(INCLUDEPATH) XTUPLE_DIR=../../qt-client ! exists(../qt-client) { XTUPLE_DIR=../../xtuple } XTUPLE_BLD=$${XTUPLE_DIR} exists(../xtuple-build-desktop) { XTUPLE_BLD=../../xtuple-build-desktop } DEPENDPATH += $${INCLUDEPATH} CONFIG += release thread #CONFIG += debug macx:exists(macx.pri) { include(macx.pri) } win32:exists(win32.pri) { include(win32.pri) } unix:exists(unix.pri) { include(unix.pri) } qt-client-4.1.0/guiclient/000077500000000000000000000000001217451700100153755ustar00rootroot00000000000000qt-client-4.1.0/guiclient/Info.plist000066400000000000000000000010111217451700100173360ustar00rootroot00000000000000 CFBundleIconFile @ICON@ CFBundlePackageType APPL CFBundleGetInfoString 4.1.0 CFBundleSignature omfg CFBundleExecutable @EXECUTABLE@ CFBundleIdentifier com.xtuple.xTuple qt-client-4.1.0/guiclient/SaveSizePositionEventFilter.h000066400000000000000000000015211217451700100231730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SAVESIZEPOSITIONEVENTFILTER_H #define SAVESIZEPOSITIONEVENTFILTER_H #include class SaveSizePositionEventFilter : public QObject { Q_OBJECT public: SaveSizePositionEventFilter(QObject * parent = 0) : QObject(parent) {}; virtual ~SaveSizePositionEventFilter() {}; protected: bool eventFilter(QObject *obj, QEvent* event); }; #endif // SAVESIZEPOSITIONEVENTFILTER_H qt-client-4.1.0/guiclient/absoluteCalendarItem.cpp000066400000000000000000000107451217451700100221770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "absoluteCalendarItem.h" #include absoluteCalendarItem::absoluteCalendarItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); } absoluteCalendarItem::~absoluteCalendarItem() { // no need to delete child widgets, Qt does it all for us } void absoluteCalendarItem::languageChange() { retranslateUi(this); } enum SetResponse absoluteCalendarItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("calhead_id", &valid); if (valid) _calheadid = param.toInt(); else _calheadid = -1; XSqlQuery setCalendarItem; param = pParams.value("calendarName", &valid); if (valid) _calendarName->setText(param.toString()); else if (_calheadid != -1) { setCalendarItem.prepare( "SELECT calhead_name " "FROM calhead " "WHERE (calhead_id=:calhead_id);" ); setCalendarItem.bindValue(":calhead_id", _calheadid); setCalendarItem.exec(); if (setCalendarItem.first()) _calendarName->setText(setCalendarItem.value("calhead_name").toString()); } param = pParams.value("calitem_id", &valid); if (valid) { _calitemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } } return NoError; } void absoluteCalendarItem::sSave() { XSqlQuery saveCalendarItem; if (_mode == cNew) { saveCalendarItem.exec("SELECT NEXTVAL('xcalitem_xcalitem_id_seq') AS _calitem_id"); if (saveCalendarItem.first()) _calitemid = saveCalendarItem.value("_calitem_id").toInt(); // ToDo saveCalendarItem.prepare( "INSERT INTO acalitem " "( acalitem_id, acalitem_calhead_id, acalitem_name," " acalitem_periodstart, acalitem_periodlength )" "VALUES " "( :acalitem_id, :acalitem_calhead_id, :acalitem_name," " :acalitem_periodstart, :acalitem_periodlength )" ); } else saveCalendarItem.prepare( "UPDATE acalitem " "SET acalitem_name=:acalitem_name," " acalitem_periodstart=:acalitem_periodstart, acalitem_periodlength=:acalitem_periodlength " "WHERE (acalitem_id=:acalitem_id);" ); saveCalendarItem.bindValue(":acalitem_id", _calitemid); saveCalendarItem.bindValue(":acalitem_calhead_id", _calheadid); saveCalendarItem.bindValue(":acalitem_name", _name->text()); saveCalendarItem.bindValue(":acalitem_periodstart", _startDate->date()); saveCalendarItem.bindValue(":acalitem_periodlength", _periodLength->value()); saveCalendarItem.exec(); done (_calitemid); } void absoluteCalendarItem::populate() { XSqlQuery populateCalendarItem; populateCalendarItem.prepare( "SELECT calhead_id, calhead_name " "FROM calhead, acalitem " "WHERE ( (acalitem_calhead_id=calhead_id)" " AND (acalitem_id=:acalitem_id));" ); populateCalendarItem.bindValue(":acalitem_id", _calitemid); populateCalendarItem.exec(); if (populateCalendarItem.first()) { _calheadid = populateCalendarItem.value("calhead_id").toInt(); _calendarName->setText(populateCalendarItem.value("calhead_name").toString()); } populateCalendarItem.prepare( "SELECT acalitem_name," " acalitem_periodstart, acalitem_periodlength " "FROM acalitem " "WHERE (acalitem_id=:acalitem_id);" ); populateCalendarItem.bindValue(":acalitem_id", _calitemid); populateCalendarItem.exec(); if (populateCalendarItem.first()) { _name->setText(populateCalendarItem.value("acalitem_name").toString()); _startDate->setDate(populateCalendarItem.value("acalitem_periodstart").toDate()); _periodLength->setValue(populateCalendarItem.value("acalitem_periodlength").toInt()); } // ToDo } qt-client-4.1.0/guiclient/absoluteCalendarItem.h000066400000000000000000000021701217451700100216350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ABSOLUTECALENDARITEM_H #define ABSOLUTECALENDARITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_absoluteCalendarItem.h" class absoluteCalendarItem : public XDialog, public Ui::absoluteCalendarItem { Q_OBJECT public: absoluteCalendarItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~absoluteCalendarItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _calitemid; int _calheadid; }; #endif // ABSOLUTECALENDARITEM_H qt-client-4.1.0/guiclient/absoluteCalendarItem.ui000066400000000000000000000106161217451700100220270ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. absoluteCalendarItem 0 0 371 144 Absolute Calendar Item Calendar Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Period Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Period Length: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 999 Qt::Horizontal QSizePolicy::Expanding 2 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save DLineEdit QWidget

datecluster.h
1 XLineEdit QLineEdit
xlineedit.h
1
_name _startDate _periodLength qt-client-4.1.0/guiclient/accountNumber.cpp000066400000000000000000000300021217451700100207010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "accountNumber.h" #include #include #include #include #include accountNumber::accountNumber(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_type, SIGNAL(activated(int)), this, SLOT(populateSubTypes())); _currency->setLabel(_currencyLit); // Until we find out what use there is for an account-level currency, hide it _currencyLit->hide(); _currency->hide(); _subType->setAllowNull(TRUE); populateSubTypes(); if (_metrics->value("GLCompanySize").toInt() == 0) { _company->hide(); _sep1Lit->hide(); } if (_metrics->value("GLProfitSize").toInt() == 0) { _profit->hide(); _sep2Lit->hide(); } if (_metrics->value("GLSubaccountSize").toInt() == 0) { _sub->hide(); _sep3Lit->hide(); } if (!_metrics->boolean("ManualForwardUpdate")) _forwardUpdate->hide(); _wasActive = false; } accountNumber::~accountNumber() { // no need to delete child widgets, Qt does it all for us } void accountNumber::languageChange() { retranslateUi(this); } enum SetResponse accountNumber::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("accnt_id", &valid); if (valid) { _accntid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _number->setValidator(new QRegExpValidator(QRegExp(QString("\\S{0,%1}").arg(_metrics->value("GLMainSize").toInt())), _number)); } else if (param.toString() == "edit") { _mode = cEdit; _company->setEnabled(FALSE); _profit->setEnabled(FALSE); _number->setEnabled(FALSE); _sub->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _company->setEnabled(FALSE); _profit->setEnabled(FALSE); _number->setEnabled(FALSE); _sub->setEnabled(FALSE); _description->setEnabled(FALSE); _extReference->setEnabled(FALSE); _forwardUpdate->setEnabled(FALSE); _active->setEnabled(FALSE); _comments->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } return NoError; } void accountNumber::sSave() { XSqlQuery accountSave; if (_mode == cEdit && _wasActive && !_active->isChecked()) { QString glsum("SELECT trialbal_ending AS bal" " FROM trialbal, period" " WHERE((period_id=trialbal_period_id)" " AND (NOT period_closed)" " AND (trialbal_accnt_id=))" " ORDER BY period_start DESC" " LIMIT 1;"); ParameterList pl; pl.append("accnt_id", _accntid); MetaSQLQuery mm(glsum); accountSave = mm.toQuery(pl); if(accountSave.first() && accountSave.value("bal").toInt() != 0) { if(QMessageBox::warning(this, tr("Account has Balance"), tr("

This Account has a balance. " "Are you sure you want to mark it inactive?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return; } } } QString sql("SELECT accnt_id " "FROM ONLY accnt " "WHERE ( (accnt_number=)" "" " AND (accnt_company=)" "" "" " AND (accnt_profit=)" "" "" " AND (accnt_sub=)" "" "" " AND (accnt_id<>)" "" " );" ); ParameterList params; params.append("accnt_number", _number->text().trimmed()); if (_metrics->value("GLCompanySize").toInt()) params.append("accnt_company", _company->currentText()); if (_metrics->value("GLProfitSize").toInt()) params.append("accnt_profit", _profit->currentText()); if (_metrics->value("GLSubaccountSize").toInt()) params.append("accnt_sub", _sub->currentText()); if (_mode == cEdit) params.append("accnt_id", _accntid); MetaSQLQuery mql(sql); accountSave = mql.toQuery(params); if (accountSave.first()) { QMessageBox::warning( this, tr("Cannot Save Account"), tr("

This Account cannot be saved as an Account " "with the same number already exists.") ); return; } else if (accountSave.lastError().type() != QSqlError::NoError) { systemError(this, accountSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cNew) { if(_number->text().trimmed().isEmpty()) { QMessageBox::warning(this, tr("No Account Number"), tr("

You must specify an account number before " "you may save this record.")); return; } accountSave.exec("SELECT NEXTVAL('accnt_accnt_id_seq') AS _accnt_id;"); if (accountSave.first()) _accntid = accountSave.value("_accnt_id").toInt(); else if (accountSave.lastError().type() != QSqlError::NoError) { systemError(this, accountSave.lastError().databaseText(), __FILE__, __LINE__); return; } accountSave.prepare( "INSERT INTO accnt " "( accnt_id," " accnt_company, accnt_profit, accnt_number, accnt_sub," " accnt_forwardupdate, accnt_active," " accnt_type, accnt_descrip, accnt_extref, accnt_comments, " " accnt_subaccnttype_code, accnt_curr_id ) " "VALUES " "( :accnt_id," " :accnt_company, :accnt_profit, :accnt_number, :accnt_sub," " :accnt_forwardupdate, :accnt_active," " :accnt_type, :accnt_descrip, :accnt_extref, :accnt_comments," " (SELECT subaccnttype_code FROM subaccnttype WHERE subaccnttype_id=:accnt_subaccnttype_id), " " :accnt_curr_id );" ); } else if (_mode == cEdit) accountSave.prepare( "UPDATE accnt " "SET accnt_company=:accnt_company, accnt_profit=:accnt_profit," " accnt_number=:accnt_number, accnt_sub=:accnt_sub," " accnt_forwardupdate=:accnt_forwardupdate," " accnt_active=:accnt_active," " accnt_type=:accnt_type, accnt_descrip=:accnt_descrip, accnt_extref=:accnt_extref," " accnt_comments=:accnt_comments," " accnt_subaccnttype_code=(SELECT subaccnttype_code FROM subaccnttype WHERE subaccnttype_id=:accnt_subaccnttype_id)," " accnt_curr_id=:accnt_curr_id " "WHERE (accnt_id=:accnt_id);" ); accountSave.bindValue(":accnt_id", _accntid); accountSave.bindValue(":accnt_company", _company->currentText()); accountSave.bindValue(":accnt_profit", _profit->currentText()); accountSave.bindValue(":accnt_number", _number->text()); accountSave.bindValue(":accnt_sub", _sub->currentText()); accountSave.bindValue(":accnt_descrip", _description->text()); accountSave.bindValue(":accnt_extref", _extReference->text()); accountSave.bindValue(":accnt_forwardupdate", QVariant(_forwardUpdate->isChecked())); accountSave.bindValue(":accnt_active", QVariant(_active->isChecked())); accountSave.bindValue(":accnt_comments", _comments->toPlainText()); accountSave.bindValue(":accnt_curr_id", _currency->id()); accountSave.bindValue(":accnt_subaccnttype_id", _subType->id()); if (_type->currentIndex() == 0) accountSave.bindValue(":accnt_type", "A"); else if (_type->currentIndex() == 1) accountSave.bindValue(":accnt_type", "L"); else if (_type->currentIndex() == 2) accountSave.bindValue(":accnt_type", "E"); else if (_type->currentIndex() == 3) accountSave.bindValue(":accnt_type", "R"); else if (_type->currentIndex() == 4) accountSave.bindValue(":accnt_type", "Q"); accountSave.exec(); if (accountSave.lastError().type() != QSqlError::NoError) { systemError(this, accountSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_accntid); } void accountNumber::populate() { XSqlQuery populateAccount; populateAccount.prepare( "SELECT accnt.*, subaccnttype_id, " " CASE WHEN (gltrans_id IS NULL) THEN false ELSE true END AS used " "FROM accnt " " LEFT OUTER JOIN subaccnttype ON (subaccnttype_code=accnt_subaccnttype_code) " " LEFT OUTER JOIN gltrans ON (accnt_id=gltrans_accnt_id) " "WHERE (accnt_id=:accnt_id)" "LIMIT 1" ); populateAccount.bindValue(":accnt_id", _accntid); populateAccount.exec(); if (populateAccount.first()) { if (_metrics->value("GLCompanySize").toInt()) _company->setText(populateAccount.value("accnt_company")); if (_metrics->value("GLProfitSize").toInt()) _profit->setText(populateAccount.value("accnt_profit")); if (_metrics->value("GLSubaccountSize").toInt()) _sub->setText(populateAccount.value("accnt_sub")); _number->setText(populateAccount.value("accnt_number")); _description->setText(populateAccount.value("accnt_descrip")); _extReference->setText(populateAccount.value("accnt_extref")); _forwardUpdate->setChecked(populateAccount.value("accnt_forwardupdate").toBool()); _active->setChecked(populateAccount.value("accnt_active").toBool()); _wasActive = _active->isChecked(); _comments->setText(populateAccount.value("accnt_comments").toString()); _currency->setId(populateAccount.value("accnt_curr_id").toInt()); if (populateAccount.value("accnt_type").toString() == "A") _type->setCurrentIndex(0); else if (populateAccount.value("accnt_type").toString() == "L") _type->setCurrentIndex(1); else if (populateAccount.value("accnt_type").toString() == "E") _type->setCurrentIndex(2); else if (populateAccount.value("accnt_type").toString() == "R") _type->setCurrentIndex(3); else if (populateAccount.value("accnt_type").toString() == "Q") _type->setCurrentIndex(4); _type->setDisabled(populateAccount.value("used").toBool()); populateSubTypes(); _subType->setId(populateAccount.value("subaccnttype_id").toInt()); } else if (populateAccount.lastError().type() != QSqlError::NoError) { systemError(this, populateAccount.lastError().databaseText(), __FILE__, __LINE__); return; } } void accountNumber::populateSubTypes() { XSqlQuery sub; sub.prepare("SELECT subaccnttype_id, (subaccnttype_code||'-'||subaccnttype_descrip) " "FROM subaccnttype " "WHERE (subaccnttype_accnt_type=:subaccnttype_accnt_type) " "ORDER BY subaccnttype_code; "); if (_type->currentIndex() == 0) sub.bindValue(":subaccnttype_accnt_type", "A"); else if (_type->currentIndex() == 1) sub.bindValue(":subaccnttype_accnt_type", "L"); else if (_type->currentIndex() == 2) sub.bindValue(":subaccnttype_accnt_type", "E"); else if (_type->currentIndex() == 3) sub.bindValue(":subaccnttype_accnt_type", "R"); else if (_type->currentIndex() == 4) sub.bindValue(":subaccnttype_accnt_type", "Q"); sub.exec(); _subType->populate(sub); if (sub.lastError().type() != QSqlError::NoError) { systemError(this, sub.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/accountNumber.h000066400000000000000000000021411217451700100203510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ACCOUNTNUMBER_H #define ACCOUNTNUMBER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_accountNumber.h" class accountNumber : public XDialog, public Ui::accountNumber { Q_OBJECT public: accountNumber(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~accountNumber(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); virtual void populateSubTypes(); private: int _mode; int _accntid; bool _wasActive; }; #endif // ACCOUNTNUMBER_H qt-client-4.1.0/guiclient/accountNumber.ui000066400000000000000000000253121217451700100205440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. accountNumber 0 0 625 364 Account Number &Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number 0 0 XComboBox::Companies 0 0 - Qt::AlignCenter XComboBox::ProfitCenters 0 0 - Qt::AlignCenter 0 0 - Qt::AlignCenter XComboBox::Subaccounts Qt::Horizontal QSizePolicy::Expanding 25 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description E&xt. Reference: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _extReference 5 5 Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Asset Liability Expense Revenue Equity Qt::Horizontal QSizePolicy::Minimum 16 20 5 Sub Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 20 5 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Currencies Qt::Horizontal QSizePolicy::Expanding 40 20 Automatically Forward Update Trial Balances Co&mments: _comments Active true XComboBox QComboBox

xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_company _profit _number _sub _description _extReference _type _subType _currency _forwardUpdate _active _comments _buttonBox qt-client-4.1.0/guiclient/accountNumbers.cpp000066400000000000000000000137151217451700100211000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "accountNumbers.h" #include #include #include #include #include #include #include "accountNumber.h" #include "storedProcErrorLookup.h" accountNumbers::accountNumbers(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); connect(_account, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_showExternal, SIGNAL(toggled(bool)), this, SLOT(sBuildList())); connect(_showInactive, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(configureGLUpdated()), this, SLOT(sBuildList())); _showExternal->setVisible(_metrics->boolean("MultiCompanyFinancialConsolidation")); _externalCol = -1; sBuildList(); } accountNumbers::~accountNumbers() { // no need to delete child widgets, Qt does it all for us } void accountNumbers::languageChange() { retranslateUi(this); } void accountNumbers::sDelete() { XSqlQuery deleteAccount; deleteAccount.prepare("SELECT deleteAccount(:accnt_id) AS result;"); deleteAccount.bindValue(":accnt_id", _account->id()); deleteAccount.exec(); if (deleteAccount.first()) { int result = deleteAccount.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteAccount", result), __FILE__, __LINE__); return; } sFillList(); } else if (deleteAccount.lastError().type() != QSqlError::NoError) { systemError(this, deleteAccount.lastError().databaseText(), __FILE__, __LINE__); return; } } void accountNumbers::sNew() { ParameterList params; params.append("mode", "new"); accountNumber newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void accountNumbers::sEdit() { ParameterList params; // don't allow editing external accounts if (_externalCol >= 0 && _account->currentItem()->rawValue("company_external").toBool()) params.append("mode", "view"); else params.append("mode", "edit"); params.append("accnt_id", _account->id()); accountNumber newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } bool accountNumbers::setParams(ParameterList &pParams) { if (_metrics->boolean("MultiCompanyFinancialConsolidation") && _showExternal->isChecked()) pParams.append("showExternal"); if (_showInactive->isChecked()) pParams.append("showInactive"); pParams.append("asset", tr("Asset")); pParams.append("expense", tr("Expense")); pParams.append("liability", tr("Liability")); pParams.append("equity", tr("Equity")); pParams.append("revenue", tr("Revenue")); return true; } void accountNumbers::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("AccountNumberMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void accountNumbers::sFillList() { XSqlQuery accountFillList; ParameterList params; if (! setParams(params)) return; bool ok = true; QString errorString; MetaSQLQuery mql = MQLUtil::mqlLoad("accountNumbers", "detail", errorString, &ok); if(!ok) { systemError(this, errorString, __FILE__, __LINE__); return; } accountFillList = mql.toQuery(params); _account->populate(accountFillList); if (accountFillList.lastError().type() != QSqlError::NoError) { systemError(this, accountFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void accountNumbers::sBuildList() { _account->setColumnCount(0); _externalCol = -1; if (_metrics->value("GLCompanySize").toInt() > 0) { _account->addColumn(tr("Company"), 50, Qt::AlignCenter, true, "accnt_company"); _externalCol++; } if (_metrics->value("GLProfitSize").toInt() > 0) { _account->addColumn(tr("Profit"), 50, Qt::AlignCenter, true, "accnt_profit"); _externalCol++; } _account->addColumn(tr("Main Segment"), 100, Qt::AlignCenter, true, "accnt_number"); _externalCol++; if (_metrics->value("GLSubaccountSize").toInt() > 0) { _account->addColumn(tr("Sub."), 50, Qt::AlignCenter, true, "accnt_sub"); _externalCol++; } _account->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "accnt_descrip"); _externalCol++; _account->addColumn(tr("Type"), 75, Qt::AlignLeft , true, "accnt_type"); _externalCol++; _account->addColumn(tr("Sub. Type Code"), 75, Qt::AlignLeft, false, "subaccnttype_code"); _externalCol++; _account->addColumn(tr("Sub. Type"), 100, Qt::AlignLeft, false, "subaccnttype_descrip"); _externalCol++; _account->addColumn(tr("Active"), 75, Qt::AlignLeft, false, "accnt_active"); _externalCol++; if (_metrics->value("Application") != "PostBooks") { _account->addColumn(tr("External"), _ynColumn, Qt::AlignCenter, false, "company_external"); _externalCol++; } else _externalCol = -1; sFillList(); } void accountNumbers::sHandleButtons() { // don't allow editing external accounts if (_externalCol >= 0 && _account->currentItem() && _account->currentItem()->rawValue("company_external").toBool()) _edit->setText(tr("View")); else _edit->setText(tr("Edit")); } qt-client-4.1.0/guiclient/accountNumbers.h000066400000000000000000000022421217451700100205360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ACCOUNTNUMBERS_H #define ACCOUNTNUMBERS_H #include "guiclient.h" #include #include "xwidget.h" #include "ui_accountNumbers.h" class accountNumbers : public XWidget, public Ui::accountNumbers { Q_OBJECT public: accountNumbers(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~accountNumbers(); public slots: virtual bool setParams(ParameterList &); virtual void sBuildList(); virtual void sHandleButtons(); protected slots: virtual void languageChange(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sPrint(); virtual void sFillList(); private: int _externalCol; }; #endif // ACCOUNTNUMBERS_H qt-client-4.1.0/guiclient/accountNumbers.ui000066400000000000000000000137211217451700100207300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. accountNumbers 0 0 571 451 Chart of Accounts &G/L Account Numbers: _account Qt::Horizontal 40 20 Show External Companies Show Inactive 0 0 5 &Close &Print 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XCheckBox QCheckBox
xcheckbox.h
XTreeWidget QTreeWidget
xtreewidget.h
_showExternal _showInactive _account _new _edit _delete _close _print _account valid(bool) _delete setEnabled(bool) 20 20 20 20 _account itemSelected(int) _edit animateClick() 20 20 20 20 _account valid(bool) _edit setEnabled(bool) 20 20 20 20 _close clicked() accountNumbers close() 20 20 20 20
qt-client-4.1.0/guiclient/accountingPeriod.cpp000066400000000000000000000325221217451700100214020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "accountingPeriod.h" #include #include #include #include "storedProcErrorLookup.h" #include "unpostedGLTransactions.h" accountingPeriod::accountingPeriod(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _year->setType(XComboBox::FiscalYears); } accountingPeriod::~accountingPeriod() { // no need to delete child widgets, Qt does it all for us } void accountingPeriod::languageChange() { retranslateUi(this); } enum SetResponse accountingPeriod::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("period_id", &valid); if (valid) { _periodid = param.toInt(); populate(); } XSqlQuery setAccounting; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; setAccounting.exec("SELECT period_id " "FROM period " "WHERE (period_closed) " "LIMIT 1; "); if (setAccounting.first()) { _startDate->setEnabled(false); _year->setEnabled(false); } setAccounting.exec("SELECT (LAST(period_end) + 1) AS start_date " "FROM (SELECT period_end " " FROM period " " ORDER BY period_end) AS data; "); if (setAccounting.first()) { _startDate->setDate(setAccounting.value("start_date").toDate()); int pmonth = _startDate->date().month(); QDate pdate = _startDate->date(); if(pdate.isValid()) { while (pmonth == _startDate->date().month()) { _endDate->setDate(pdate); pdate = pdate.addDays(1); pmonth = pdate.month(); } } sHandleNumber(); connect(_year, SIGNAL(newID(int)), this, SLOT(sHandleNumber())); } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _startDate->setEnabled(FALSE); _endDate->setEnabled(FALSE); _closed->setEnabled(FALSE); _frozen->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } return NoError; } void accountingPeriod::sHandleNumber() { XSqlQuery handleNumberAccounting; handleNumberAccounting.prepare("SELECT COALESCE(MAX(period_number),0) + 1 AS number " "FROM period " "WHERE (period_yearperiod_id=:yearperiod_id);"); handleNumberAccounting.bindValue(":yearperiod_id", _year->id()); handleNumberAccounting.exec(); if (handleNumberAccounting.first()) _number->setValue(handleNumberAccounting.value("number").toInt()); else if (handleNumberAccounting.lastError().type() != QSqlError::NoError) { systemError(this, handleNumberAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } void accountingPeriod::sSave() { if (_startDate->date() >= _endDate->date()) { QMessageBox::critical( this, tr("Cannot Save Period"), tr("The start date must be less than the end date.") ); return; } XSqlQuery saveAccounting; if (_mode == cNew) { saveAccounting.prepare("SELECT createAccountingPeriod(:startDate, :endDate, :yearperiod_id, :quarter) AS _period_id;"); saveAccounting.bindValue(":startDate", _startDate->date()); saveAccounting.bindValue(":endDate", _endDate->date()); saveAccounting.bindValue(":yearperiod_id", _year->id()); saveAccounting.bindValue(":quarter", _quarter->value()); saveAccounting.exec(); if (saveAccounting.first()) { _periodid = saveAccounting.value("_period_id").toInt(); if (_periodid < 0) { systemError(this, storedProcErrorLookup("createAccountingPeriod", _periodid), __FILE__, __LINE__); return; } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (_mode == cEdit) { if ( (_cachedFrozen) && (!_frozen->isChecked()) ) { saveAccounting.prepare("SELECT thawAccountingPeriod(:period_id) AS result;"); saveAccounting.bindValue(":period_id", _periodid); saveAccounting.exec(); if (saveAccounting.first()) { int result = saveAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("thawAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } if ( (_cachedClosed) && (!_closed->isChecked()) ) { bool reallyOpen = false; saveAccounting.prepare("SELECT COUNT(gltrans_sequence) AS count " "FROM gltrans, period " "WHERE ( (NOT gltrans_posted) " "AND (NOT gltrans_deleted) " "AND (gltrans_date BETWEEN period_start AND period_end) " "AND (period_id=:period_id) );"); saveAccounting.bindValue(":period_id", _periodid); saveAccounting.exec(); if (saveAccounting.first()) { if (saveAccounting.value("count").toInt() <= 0) reallyOpen = true; else { ParameterList params; unpostedGLTransactions newdlg(this, "", true); params.append("period_id", _periodid); newdlg.set(params); reallyOpen = (newdlg.exec() == XDialog::Accepted); } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } if (reallyOpen) { saveAccounting.prepare("SELECT openAccountingPeriod(:period_id) AS result;"); saveAccounting.bindValue(":period_id", _periodid); saveAccounting.exec(); if (saveAccounting.first()) { int result = saveAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("openAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } else return; } if ( (_cachedStartDate != _startDate->date()) || (_cachedEndDate != _endDate->date()) ) { saveAccounting.prepare("SELECT changeAccountingPeriodDates(:period_id, :startDate, :endDate) AS result;"); saveAccounting.bindValue(":period_id", _periodid); saveAccounting.bindValue(":startDate", _startDate->date()); saveAccounting.bindValue(":endDate", _endDate->date()); saveAccounting.exec(); if (saveAccounting.first()) { int result = saveAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("changeAccountingPeriodDates", result), __FILE__, __LINE__); return; } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } if ( (!_cachedFrozen) && (_frozen->isChecked()) ) { saveAccounting.prepare("SELECT freezeAccountingPeriod(:period_id) AS result;"); saveAccounting.bindValue(":period_id", _periodid); saveAccounting.exec(); if (saveAccounting.first()) { int result = saveAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("freezeAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } if ( (!_cachedClosed) && (_closed->isChecked()) ) { saveAccounting.prepare("SELECT closeAccountingPeriod(:period_id) AS result;"); saveAccounting.bindValue(":period_id", _periodid); saveAccounting.exec(); if (saveAccounting.first()) { int result = saveAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("closeAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } } if( (_cachedName != _name->text()) || (_cachedYearPeriodId != _year->id()) || (_cachedQuarter != _quarter->value()) ) { saveAccounting.prepare("SELECT yearperiod_id " "FROM yearperiod " "WHERE ((yearperiod_id=:yearperiod_id) " "AND (:startDate>=yearperiod_start) " " AND (:endDate<=yearperiod_end)); "); saveAccounting.bindValue(":yearperiod_id", _year->id()); saveAccounting.bindValue(":startDate", _startDate->date()); saveAccounting.bindValue(":endDate", _endDate->date()); saveAccounting.exec(); if (saveAccounting.first()) { saveAccounting.prepare("UPDATE period SET period_name=:period_name," " period_yearperiod_id=:yearperiod_id," " period_quarter=:quarter" " WHERE (period_id=:period_id); "); saveAccounting.bindValue(":period_id", _periodid); saveAccounting.bindValue(":period_name", _name->text()); saveAccounting.bindValue(":yearperiod_id", _year->id()); saveAccounting.bindValue(":quarter", _quarter->value()); saveAccounting.exec(); if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (saveAccounting.lastError().type() != QSqlError::NoError) { systemError(this, saveAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::critical( this, tr("Cannot Save Period"), tr("Period dates are outside the selected Fiscal Year.") ); return; } } done(_periodid); } void accountingPeriod::populate() { XSqlQuery populateAccounting; populateAccounting.exec( "SELECT FIRST(period_id) AS first_period_id, " " LAST(period_id) AS last_period_id " "FROM (SELECT period_id FROM period " " ORDER BY period_start) AS data; "); if (populateAccounting.first()) { if (populateAccounting.value("first_period_id").toInt() != _periodid) _startDate->setEnabled(false); if (populateAccounting.value("last_period_id").toInt() != _periodid) _endDate->setEnabled(false); } populateAccounting.prepare( "SELECT period_start, period_end, period_closed, period_freeze," " period_name, period_yearperiod_id, period_quarter, " " period_number, " " (COUNT(trialbal_id) > 0) AS hasTrialBal " "FROM period " " LEFT OUTER JOIN trialbal ON (period_id = trialbal_period_id) " "WHERE (period_id=:period_id) " "GROUP BY period_start, period_end, period_closed, period_freeze," " period_number, period_name, period_yearperiod_id, period_quarter;" ); populateAccounting.bindValue(":period_id", _periodid); populateAccounting.exec(); if (populateAccounting.first()) { if (populateAccounting.value("hasTrialBal").toBool()) { _startDate->setEnabled(false); _endDate->setEnabled(false); _year->setEnabled(false); } _cachedStartDate = populateAccounting.value("period_start").toDate(); _cachedEndDate = populateAccounting.value("period_end").toDate(); _cachedClosed = populateAccounting.value("period_closed").toBool(); _cachedFrozen = populateAccounting.value("period_freeze").toBool(); _cachedName = populateAccounting.value("period_name").toString(); _cachedYearPeriodId = populateAccounting.value("period_yearperiod_id").toInt(); _cachedQuarter = populateAccounting.value("period_quarter").toInt(); _startDate->setDate(populateAccounting.value("period_start").toDate()); _endDate->setDate(populateAccounting.value("period_end").toDate()); _closed->setChecked(populateAccounting.value("period_closed").toBool()); _frozen->setChecked(populateAccounting.value("period_freeze").toBool()); _name->setText(populateAccounting.value("period_name").toString()); _year->setId(populateAccounting.value("period_yearperiod_id").toInt()); _number->setValue(populateAccounting.value("period_number").toInt()); _quarter->setValue(populateAccounting.value("period_quarter").toInt()); } else if (populateAccounting.lastError().type() != QSqlError::NoError) { systemError(this, populateAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/accountingPeriod.h000066400000000000000000000024011217451700100210400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ACCOUNTINGPERIOD_H #define ACCOUNTINGPERIOD_H #include "guiclient.h" #include "xdialog.h" #include "ui_accountingPeriod.h" class accountingPeriod : public XDialog, public Ui::accountingPeriod { Q_OBJECT public: accountingPeriod(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~accountingPeriod(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sHandleNumber(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: bool _cachedFrozen; bool _cachedClosed; QDate _cachedEndDate; QDate _cachedStartDate; QString _cachedName; int _periodid; int _mode; int _cachedYearPeriodId; int _cachedQuarter; }; #endif // ACCOUNTINGPERIOD_H qt-client-4.1.0/guiclient/accountingPeriod.ui000066400000000000000000000167671217451700100212520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. accountingPeriod 0 0 360 260 Accounting Period QFormLayout::FieldsStayAtSizeHint Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _startDate End Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _endDate Fiscal Year: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _year false Quarter: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _quarter 1 4 Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _quarter Closed Frozen Qt::Horizontal QSizePolicy::Expanding 56 10 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save DLineEdit QWidget
datecluster.h
1
XComboBox QComboBox
xcombobox.h
_name _startDate _endDate _year _number _quarter _closed _frozen _buttonBox
qt-client-4.1.0/guiclient/accountingPeriods.cpp000066400000000000000000000240271217451700100215660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "accountingPeriods.h" #include #include #include #include #include "accountingPeriod.h" #include "storedProcErrorLookup.h" #include "unpostedGLTransactions.h" accountingPeriods::accountingPeriods(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_period, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem *))); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_closePeriod, SIGNAL(clicked()), this, SLOT(sClosePeriod())); connect(_freezePeriod, SIGNAL(clicked()), this, SLOT(sFreezePeriod())); _period->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "period_name"); _period->addColumn(tr("Start"), _dateColumn, Qt::AlignCenter, true, "period_start"); _period->addColumn(tr("End"), _dateColumn, Qt::AlignCenter, true, "period_end"); _period->addColumn(tr("Number"), _ynColumn, Qt::AlignRight, false, "period_number"); _period->addColumn(tr("Qtr"), _statusColumn, Qt::AlignCenter, true, "qtr"); _period->addColumn(tr("Year"), _dateColumn, Qt::AlignCenter, true, "year"); _period->addColumn(tr("Closed"), _ynColumn+3, Qt::AlignCenter, true, "closed"); _period->addColumn(tr("Frozen"), _ynColumn+3, Qt::AlignCenter, true, "frozen"); if (_privileges->check("MaintainAccountingPeriods")) { connect(_period, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_period, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_period, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_period, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(_period, SIGNAL(valid(bool)), _closePeriod, SLOT(setEnabled(bool))); connect(_period, SIGNAL(valid(bool)), _freezePeriod, SLOT(setEnabled(bool))); sFillList(); } accountingPeriods::~accountingPeriods() { // no need to delete child widgets, Qt does it all for us } void accountingPeriods::languageChange() { retranslateUi(this); } void accountingPeriods::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { QAction *menuItem; int altId = ((XTreeWidgetItem *)pSelected)->altId(); if (altId == 0) { menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainAccountingPeriods")); } menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); if (altId == 0) { menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainAccountingPeriods")); } pMenu->addSeparator(); if (altId == 0) { menuItem = pMenu->addAction(tr("Freeze..."), this, SLOT(sFreezePeriod())); menuItem = pMenu->addAction(tr("Close..."), this, SLOT(sClosePeriod())); } else if (altId == 1) { menuItem = pMenu->addAction(tr("Thaw..."), this, SLOT(sThawPeriod())); menuItem = pMenu->addAction(tr("Close..."), this, SLOT(sClosePeriod())); } else if (altId == 2 || altId == 3) { menuItem = pMenu->addAction(tr("Open..."), this, SLOT(sOpenPeriod())); } } void accountingPeriods::sNew() { ParameterList params; params.append("mode", "new"); accountingPeriod newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void accountingPeriods::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("period_id", _period->id()); accountingPeriod newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void accountingPeriods::sView() { ParameterList params; params.append("mode", "view"); params.append("period_id", _period->id()); accountingPeriod newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void accountingPeriods::sDelete() { XSqlQuery deleteAccounting; deleteAccounting.prepare("SELECT deleteAccountingPeriod(:period_id) AS result;"); deleteAccounting.bindValue(":period_id", _period->id()); deleteAccounting.exec(); if (deleteAccounting.first()) { int result = deleteAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteAccountingPeriod", result)); return; } } else if (deleteAccounting.lastError().type() != QSqlError::NoError) { systemError(this, deleteAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void accountingPeriods::sClosePeriod() { XSqlQuery closeAccounting; closeAccounting.prepare("SELECT closeAccountingPeriod(:period_id) AS result;"); closeAccounting.bindValue(":period_id", _period->id()); closeAccounting.exec(); if (closeAccounting.first()) { int result = closeAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("closeAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (closeAccounting.lastError().type() != QSqlError::NoError) { systemError(this, closeAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void accountingPeriods::sOpenPeriod() { bool reallyOpen = false; XSqlQuery openAccounting; openAccounting.prepare("SELECT COUNT(gltrans_sequence) AS count " "FROM gltrans, period " "WHERE ( (NOT gltrans_posted) " "AND (gltrans_date BETWEEN period_start AND period_end) " "AND (period_id=:period_id) );"); openAccounting.bindValue(":period_id", _period->id()); openAccounting.exec(); if (openAccounting.first()) { if (openAccounting.value("count").toInt() <= 0) reallyOpen = true; else { ParameterList params; unpostedGLTransactions newdlg(this, "", true); params.append("period_id", _period->id()); newdlg.set(params); reallyOpen = (newdlg.exec() == XDialog::Accepted); } } else if (openAccounting.lastError().type() != QSqlError::NoError) { systemError(this, openAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } if (reallyOpen) { openAccounting.prepare("SELECT openAccountingPeriod(:period_id) AS result;"); openAccounting.bindValue(":period_id", _period->id()); openAccounting.exec(); if (openAccounting.first()) { int result = openAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("openAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (openAccounting.lastError().type() != QSqlError::NoError) { systemError(this, openAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void accountingPeriods::sFreezePeriod() { XSqlQuery freezeAccounting; freezeAccounting.prepare("SELECT freezeAccountingPeriod(:period_id) AS result;"); freezeAccounting.bindValue(":period_id", _period->id()); freezeAccounting.exec(); if (freezeAccounting.first()) { int result = freezeAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("freezeAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (freezeAccounting.lastError().type() != QSqlError::NoError) { systemError(this, freezeAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void accountingPeriods::sThawPeriod() { XSqlQuery thawAccounting; thawAccounting.prepare("SELECT thawAccountingPeriod(:period_id) AS result;"); thawAccounting.bindValue(":period_id", _period->id()); thawAccounting.exec(); if (thawAccounting.first()) { int result = thawAccounting.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("thawAccountingPeriod", result), __FILE__, __LINE__); return; } } else if (thawAccounting.lastError().type() != QSqlError::NoError) { systemError(this, thawAccounting.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void accountingPeriods::sPrint() { orReport report("AccountingPeriodsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void accountingPeriods::sFillList() { _period->clear(); _period->populate( "SELECT period_id," " CASE WHEN ( (NOT period_freeze) AND (NOT period_closed) ) THEN 0" " WHEN ( (period_freeze) AND (NOT period_closed) ) THEN 1" " WHEN ( (NOT period_freeze) AND (period_closed) ) THEN 2" " WHEN ( (period_freeze) AND (period_closed) ) THEN 3" " ELSE 0" " END," " period_number, period_name," " period_start, period_end," " COALESCE(to_char(period_quarter,'9'),'?') AS qtr," " COALESCE(to_char(EXTRACT(year FROM yearperiod_end),'9999'),'?') AS year," " formatBoolYN(period_closed) AS closed," " formatBoolYN(period_freeze) AS frozen " " FROM period LEFT OUTER JOIN yearperiod " " ON (period_yearperiod_id=yearperiod_id) " " ORDER BY period_start;", TRUE ); } qt-client-4.1.0/guiclient/accountingPeriods.h000066400000000000000000000023751217451700100212350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ACCOUNTINGPERIODS_H #define ACCOUNTINGPERIODS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_accountingPeriods.h" class accountingPeriods : public XWidget, public Ui::accountingPeriods { Q_OBJECT public: accountingPeriods(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~accountingPeriods(); public slots: virtual void sPopulateMenu( QMenu *, QTreeWidgetItem * ); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sClosePeriod(); virtual void sOpenPeriod(); virtual void sFreezePeriod(); virtual void sThawPeriod(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // ACCOUNTINGPERIODS_H qt-client-4.1.0/guiclient/accountingPeriods.ui000066400000000000000000000130251217451700100214150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. accountingPeriods 0 0 600 400 List Accounting Periods 0 Accounting Periods: &Close &Print true &New false &Edit false &View Qt::Vertical QSizePolicy::Fixed 20 5 false Close Period false Freeze Period Qt::Vertical QSizePolicy::Fixed 20 5 false &Delete Qt::Vertical QSizePolicy::Expanding 20 181 XTreeWidget QTreeWidget
xtreewidget.h
1
_period _print _close parameter.h _close clicked() accountingPeriods close() 20 20 20 20 _period valid(bool) _view setEnabled(bool) 20 20 20 20
qt-client-4.1.0/guiclient/accountingYearPeriod.cpp000066400000000000000000000160261217451700100222240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "accountingYearPeriod.h" #include #include #include #include "storedProcErrorLookup.h" accountingYearPeriod::accountingYearPeriod(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); } accountingYearPeriod::~accountingYearPeriod() { // no need to delete child widgets, Qt does it all for us } void accountingYearPeriod::languageChange() { retranslateUi(this); } enum SetResponse accountingYearPeriod::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("yearperiod_id", &valid); if (valid) { _periodid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { XSqlQuery check; check.exec("SELECT yearperiod_id " "FROM yearperiod " "WHERE (yearperiod_closed) " "LIMIT 1; "); if (check.first()) { _startDate->setEnabled(false); } if (param.toString() == "new") { _mode = cNew; check.exec("SELECT yearperiod_end + 1 AS start_date " "FROM yearperiod " "ORDER BY yearperiod_end DESC " "LIMIT 1; "); if (check.first()) { _startDate->setDate(check.value("start_date").toDate()); _endDate->setDate(check.value("start_date").toDate().addYears(1).addDays(-1)); } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _startDate->setEnabled(FALSE); _endDate->setEnabled(FALSE); _closed->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } return NoError; } void accountingYearPeriod::sSave() { XSqlQuery saveAccountingYear; if (_mode == cNew) { saveAccountingYear.prepare("SELECT createAccountingYearPeriod(:startDate, :endDate) AS _period_id;"); saveAccountingYear.bindValue(":startDate", _startDate->date()); saveAccountingYear.bindValue(":endDate", _endDate->date()); saveAccountingYear.exec(); if (saveAccountingYear.first()) { _periodid = saveAccountingYear.value("_period_id").toInt(); if (_periodid < 0) { systemError(this, storedProcErrorLookup("createAccountingYearPeriod", _periodid), __FILE__, __LINE__); return; } } else if (saveAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, saveAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (_mode == cEdit) { if ( (_cachedClosed) && (!_closed->isChecked()) ) { saveAccountingYear.prepare("SELECT openAccountingYearPeriod(:period_id) AS result;"); saveAccountingYear.bindValue(":period_id", _periodid); saveAccountingYear.exec(); if (saveAccountingYear.first()) { int result = saveAccountingYear.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("openAccountingYearPeriod", result), __FILE__, __LINE__); return; } } else if (saveAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, saveAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } if ( (_cachedStartDate != _startDate->date()) || (_cachedEndDate != _endDate->date()) ) { saveAccountingYear.prepare("SELECT changeAccountingYearPeriodDates(:period_id, :startDate, :endDate) AS result;"); saveAccountingYear.bindValue(":period_id", _periodid); saveAccountingYear.bindValue(":startDate", _startDate->date()); saveAccountingYear.bindValue(":endDate", _endDate->date()); saveAccountingYear.exec(); if (saveAccountingYear.first()) { int result = saveAccountingYear.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("createAccountingYearPeriod", result), __FILE__, __LINE__); return; } } else if (saveAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, saveAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } if ( (!_cachedClosed) && (_closed->isChecked()) ) { saveAccountingYear.prepare("SELECT closeAccountingYearPeriod(:period_id) AS result;"); saveAccountingYear.bindValue(":period_id", _periodid); saveAccountingYear.exec(); if (saveAccountingYear.first()) { int result = saveAccountingYear.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("closeAccountingYearPeriod", result), __FILE__, __LINE__); return; } } else if (saveAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, saveAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } } done(_periodid); } void accountingYearPeriod::populate() { XSqlQuery populateAccountingYear; populateAccountingYear.exec( "SELECT FIRST(yearperiod_id) AS first_yearperiod_id, " " LAST(yearperiod_id) AS last_yearperiod_id " "FROM (SELECT yearperiod_id FROM yearperiod " " ORDER BY yearperiod_start) AS data; "); if (populateAccountingYear.first()) { if (populateAccountingYear.value("first_yearperiod_id").toInt() != _periodid) _startDate->setEnabled(false); if (populateAccountingYear.value("last_yearperiod_id").toInt() != _periodid) _endDate->setEnabled(false); } populateAccountingYear.prepare( "SELECT yearperiod_start, yearperiod_end, yearperiod_closed " "FROM yearperiod " "WHERE (yearperiod_id=:period_id);" ); populateAccountingYear.bindValue(":period_id", _periodid); populateAccountingYear.exec(); if (populateAccountingYear.first()) { _cachedStartDate = populateAccountingYear.value("yearperiod_start").toDate(); _cachedEndDate = populateAccountingYear.value("yearperiod_end").toDate(); _cachedClosed = populateAccountingYear.value("yearperiod_closed").toBool(); _startDate->setDate(populateAccountingYear.value("yearperiod_start").toDate()); _endDate->setDate(populateAccountingYear.value("yearperiod_end").toDate()); _closed->setChecked(populateAccountingYear.value("yearperiod_closed").toBool()); } else if (populateAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, populateAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/accountingYearPeriod.h000066400000000000000000000023101217451700100216600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ACCOUNTINGYEARPERIOD_H #define ACCOUNTINGYEARPERIOD_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_accountingYearPeriod.h" class accountingYearPeriod : public XDialog, public Ui::accountingYearPeriod { Q_OBJECT public: accountingYearPeriod(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~accountingYearPeriod(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: bool _cachedFrozen; bool _cachedClosed; QDate _cachedEndDate; QDate _cachedStartDate; int _periodid; int _mode; }; #endif // ACCOUNTINGYEARPERIOD_H qt-client-4.1.0/guiclient/accountingYearPeriod.ui000066400000000000000000000047071217451700100220620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. accountingYearPeriod 0 0 343 105 Fiscal Year Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save End Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Closed DLineEdit QWidget
datecluster.h
1
_startDate _endDate
qt-client-4.1.0/guiclient/accountingYearPeriods.cpp000066400000000000000000000146661217451700100224170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "accountingYearPeriods.h" #include #include #include #include #include "accountingYearPeriod.h" #include "storedProcErrorLookup.h" accountingYearPeriods::accountingYearPeriods(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_period, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_closePeriod, SIGNAL(clicked()), this, SLOT(sClosePeriod())); _period->addColumn(tr("Start"), _dateColumn, Qt::AlignCenter, true, "yearperiod_start"); _period->addColumn(tr("End"), _dateColumn, Qt::AlignCenter, true, "yearperiod_end"); _period->addColumn(tr("Closed"), -1 , Qt::AlignCenter, true, "closed"); if (_privileges->check("MaintainAccountingPeriods")) { connect(_period, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_period, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_period, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_period, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } accountingYearPeriods::~accountingYearPeriods() { // no need to delete child widgets, Qt does it all for us } void accountingYearPeriods::languageChange() { retranslateUi(this); } void accountingYearPeriods::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { QAction *menuItem; int altId = ((XTreeWidgetItem *)pSelected)->altId(); if (altId == 0) { menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainAccountingPeriods")); } menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); if (altId == 0) { menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainAccountingPeriods")); } pMenu->addSeparator(); if (altId == 0) { menuItem = pMenu->addAction(tr("Close..."), this, SLOT(sClosePeriod())); } else if (altId == 1) { menuItem = pMenu->addAction(tr("Open..."), this, SLOT(sOpenPeriod())); } } void accountingYearPeriods::sNew() { ParameterList params; params.append("mode", "new"); accountingYearPeriod newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void accountingYearPeriods::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("yearperiod_id", _period->id()); accountingYearPeriod newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void accountingYearPeriods::sView() { ParameterList params; params.append("mode", "view"); params.append("yearperiod_id", _period->id()); accountingYearPeriod newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void accountingYearPeriods::sDelete() { XSqlQuery deleteAccountingYear; deleteAccountingYear.prepare("SELECT deleteAccountingYearPeriod(:period_id) AS result;"); deleteAccountingYear.bindValue(":period_id", _period->id()); deleteAccountingYear.exec(); if (deleteAccountingYear.first()) { int result = deleteAccountingYear.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteAccountingYearPeriod", result), __FILE__, __LINE__); return; } sFillList(); } else if (deleteAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, deleteAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } void accountingYearPeriods::sClosePeriod() { XSqlQuery closeAccountingYear; closeAccountingYear.prepare("SELECT closeAccountingYearPeriod(:period_id) AS result;"); closeAccountingYear.bindValue(":period_id", _period->id()); closeAccountingYear.exec(); if (closeAccountingYear.first()) { int result = closeAccountingYear.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("closeAccountingYearPeriod", result), __FILE__, __LINE__); return; } sFillList(); } else if (closeAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, closeAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } void accountingYearPeriods::sOpenPeriod() { XSqlQuery openAccountingYear; openAccountingYear.prepare("SELECT openAccountingYearPeriod(:period_id) AS result;"); openAccountingYear.bindValue(":period_id", _period->id()); openAccountingYear.exec(); if (openAccountingYear.first()) { int result = openAccountingYear.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("openAccountingYearPeriod", result), __FILE__, __LINE__); return; } sFillList(); } else if (openAccountingYear.lastError().type() != QSqlError::NoError) { systemError(this, openAccountingYear.lastError().databaseText(), __FILE__, __LINE__); return; } } void accountingYearPeriods::sPrint() { orReport report("AccountingYearPeriodsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void accountingYearPeriods::sFillList() { _period->clear(); _period->populate( "SELECT yearperiod_id," " CASE WHEN (NOT yearperiod_closed) THEN 0" " ELSE 1" " END," " *, " " formatBoolYN(yearperiod_closed) AS closed " "FROM yearperiod " "ORDER BY yearperiod_start;", TRUE ); } qt-client-4.1.0/guiclient/accountingYearPeriods.h000066400000000000000000000023521217451700100220510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ACCOUNTINGYEARPERIODS_H #define ACCOUNTINGYEARPERIODS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_accountingYearPeriods.h" class accountingYearPeriods : public XWidget, public Ui::accountingYearPeriods { Q_OBJECT public: accountingYearPeriods(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~accountingYearPeriods(); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sClosePeriod(); virtual void sOpenPeriod(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // ACCOUNTINGYEARPERIODS_H qt-client-4.1.0/guiclient/accountingYearPeriods.ui000066400000000000000000000140501217451700100222350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. accountingYearPeriods 0 0 459 423 List Fiscal Years 0 0 Fiscal Years: 0 0 0 5 &Close &Print 0 0 true &New false &Edit false &View 0 0 false Close Year false &Delete Qt::Vertical QSizePolicy::Expanding 20 181 XTreeWidget QTreeWidget
xtreewidget.h
_period _new _edit _view _closePeriod _delete _print _close _close clicked() accountingYearPeriods close() 20 20 20 20 _period valid(bool) _view setEnabled(bool) 20 20 20 20 _period valid(bool) _closePeriod setEnabled(bool) 170 219 398 200
qt-client-4.1.0/guiclient/addPoComment.cpp000066400000000000000000000020651217451700100204560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "addPoComment.h" #include addPoComment::addPoComment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); } addPoComment::~addPoComment() { // no need to delete child widgets, Qt does it all for us } void addPoComment::languageChange() { retranslateUi(this); } enum SetResponse addPoComment::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _po->setId(param.toInt()); _po->setReadOnly(true); } return NoError; } qt-client-4.1.0/guiclient/addPoComment.h000066400000000000000000000016771217451700100201330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ADDPOCOMMENT_H #define ADDPOCOMMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_addPoComment.h" class addPoComment : public XDialog, public Ui::addPoComment { Q_OBJECT public: addPoComment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~addPoComment(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); protected slots: virtual void languageChange(); }; #endif // ADDPOCOMMENT_H qt-client-4.1.0/guiclient/addPoComment.ui000066400000000000000000000061121217451700100203060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. addPoComment 0 0 529 267 Add Purchase Order Comment 0 5 7 OrderLineEdit::Purchase Qt::Vertical QDialogButtonBox::Close Comments::PurchaseOrder Comments QWidget
comments.h
OrderCluster QWidget
ordercluster.h
_po newId(int,QString) _comments setId(int) 20 20 20 20 _buttonBox accepted() addPoComment accept() 485 46 264 133 _buttonBox rejected() addPoComment reject() 485 46 264 133
qt-client-4.1.0/guiclient/address.cpp000066400000000000000000000336441217451700100175400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "address.h" #include #include #include #include #include #include #include #include "addresscluster.h" #include "characteristicAssignment.h" #include "contact.h" #include "inputManager.h" #include "shipTo.h" #include "vendor.h" #include "vendorAddress.h" #include "warehouse.h" address::address(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_editAddrUse, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_viewAddrUse, SIGNAL(clicked()), this, SLOT(sView())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_uses, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic())); connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic())); _uses->addColumn(tr("Used by"), 50, Qt::AlignLeft, true, "type"); _uses->addColumn(tr("First Name\nor Number"),50, Qt::AlignLeft, true, "cntct_first_name"); _uses->addColumn(tr("Last Name\nor Name"), -1, Qt::AlignLeft, true, "cntct_last_name"); _uses->addColumn(tr("CRM Account"), 80, Qt::AlignLeft, true, "crmacct_number"); _uses->addColumn(tr("Phone"), 100, Qt::AlignLeft, true, "cntct_phone"); _uses->addColumn(tr("Alternate"), 100, Qt::AlignLeft, true, "cntct_phone2"); _uses->addColumn(tr("Fax"), 100, Qt::AlignLeft, true, "cntct_fax"); _uses->addColumn(tr("E-Mail"), 100, Qt::AlignLeft, true, "cntct_email"); _uses->addColumn(tr("Web Address"), 100, Qt::AlignLeft, true, "cntct_webaddr"); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name"); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value"); } address::~address() { // no need to delete child widgets, Qt does it all for us } void address::languageChange() { retranslateUi(this); } enum SetResponse address::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("addr_id", &valid); if (valid) { _captive = TRUE; _addr->setId(param.toInt()); sPopulate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _addr->setLine1("Address" + QDateTime::currentDateTime().toString()); int addrSaveResult = _addr->save(AddressCluster::CHANGEONE); if (addrSaveResult < 0) { systemError(this, tr("There was an error creating a new address (%).\n" "Check the database server log for errors.") .arg(addrSaveResult), __FILE__, __LINE__); return UndefinedError; } _comments->setId(_addr->id()); _addr->setLine1(""); connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _mode = cEdit; connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); } else if (param.toString() == "view") { _mode = cView; _editAddrUse->hide(); disconnect(_uses, SIGNAL(itemSelected(int)), _editAddrUse, SLOT(animateClick())); connect(_uses, SIGNAL(itemSelected(int)), _viewAddrUse, SLOT(animateClick())); _addr->setEnabled(FALSE); _notes->setEnabled(FALSE); _comments->setReadOnly(true); _newCharacteristic->setEnabled(FALSE); _editCharacteristic->setEnabled(FALSE); _deleteCharacteristic->setEnabled(FALSE); _editAddrUse->setEnabled(FALSE); _charass->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } return NoError; } void address::sSave() { internalSave(); done(_addr->id()); } void address::internalSave(AddressCluster::SaveFlags flag) { _addr->setNotes(_notes->toPlainText()); int saveResult = _addr->save(flag); if (-2 == saveResult) { int answer = QMessageBox::question(this, tr("Saving Shared Address"), tr("There are multiple Contacts sharing this Address.\n" "If you save this Address, the Address for all " "of these Contacts will be changed. Would you like to " "save this Address?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes); if (QMessageBox::No == answer) return; saveResult = _addr->save(AddressCluster::CHANGEALL); } if (0 > saveResult) // NOT else if { systemError(this, tr("There was an error saving this address (%1).\n" "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); } } void address::reject() { XSqlQuery rejectAddress; if (cNew == _mode) { rejectAddress.prepare("SELECT deleteAddress(:addr_id) AS result;" "SELECT releaseNumber('AddressNumber', :number); "); rejectAddress.bindValue(":addr_id", _addr->id()); rejectAddress.bindValue(":number", _addr->number().toInt()); rejectAddress.exec(); if (rejectAddress.lastError().type() != QSqlError::NoError) { systemError(this, rejectAddress.lastError().databaseText(), __FILE__, __LINE__); return; } } XDialog::reject(); } void address::sNewCharacteristic() { internalSave(); ParameterList params; params.append("mode", "new"); params.append("addr_id", _addr->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sGetCharacteristics(); } void address::sEditCharacteristic() { internalSave(); ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sGetCharacteristics(); } void address::sDeleteCharacteristic() { internalSave(); XSqlQuery deleteAddress; deleteAddress.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); deleteAddress.bindValue(":charass_id", _charass->id()); deleteAddress.exec(); sGetCharacteristics(); } void address::sGetCharacteristics() { XSqlQuery getAddress; getAddress.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value " "FROM charass, char " "WHERE ( (charass_target_type='ADDR')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:addr_id) ) " "ORDER BY char_order, char_name;" ); getAddress.bindValue(":addr_id", _addr->id()); getAddress.exec(); _charass->populate(getAddress); } void address::sPopulate() { _notes->setText(_addr->notes()); _comments->setId(_addr->id()); sGetCharacteristics(); XSqlQuery usesQ; usesQ.prepare("SELECT cntct_id, 1, :contact AS type, cntct_first_name, " " cntct_last_name, crmacct_number, cntct_phone, " " cntct_phone2, cntct_fax, cntct_email, cntct_webaddr " "FROM cntct LEFT OUTER JOIN crmacct ON (cntct_crmacct_id=crmacct_id) " "WHERE (cntct_addr_id=:addr_id) " "UNION " "SELECT shipto_id, 2, :shipto, shipto_name, " " shipto_name, crmacct_number, ''," " '', '', '', '' " "FROM shiptoinfo LEFT OUTER JOIN crmacct ON (shipto_cust_id=crmacct_cust_id) " "WHERE (shipto_addr_id=:addr_id) " "UNION " "SELECT vend_id, 3, :vendor, vend_number, " " vend_name, crmacct_number, ''," " '', '', '', '' " "FROM vendinfo LEFT OUTER JOIN crmacct ON (vend_id=crmacct_vend_id) " "WHERE (vend_addr_id=:addr_id) " "UNION " "SELECT vendaddr_id, 4, :vendaddr, vendaddr_code, " " vendaddr_name, crmacct_number, ''," " '', '', '', '' " "FROM vendaddrinfo LEFT OUTER JOIN crmacct ON (vendaddr_vend_id=crmacct_vend_id) " "WHERE (vendaddr_addr_id=:addr_id) " "UNION " "SELECT warehous_id, 5, :whs, warehous_code, " " warehous_descrip, '', ''," " '', '', '', '' " "FROM whsinfo " "WHERE (warehous_addr_id=:addr_id) " "ORDER BY 3, 5, 4;"); usesQ.bindValue(":addr_id", _addr->id()); usesQ.bindValue(":contact", tr("Contact")); usesQ.bindValue(":shipto", tr("Ship-To")); usesQ.bindValue(":vendor", tr("Vendor")); usesQ.bindValue(":vendaddr", tr("Vendor Address")); usesQ.bindValue(":whs", tr("Site")); usesQ.exec(); _uses->populate(usesQ, true); // true => use alt id (to distinguish types) } void address::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; QString editStr = tr("Edit..."); QString viewStr = tr("View..."); switch (_uses->altId()) { case 1: if (_privileges->check("MaintainAllContacts") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->addAction(editStr, this, SLOT(sEditContact())); else if (_privileges->check("ViewAllContacts")) menuItem = pMenu->addAction(viewStr, this, SLOT(sViewContact())); break; case 2: // ship-to if (_privileges->check("MaintainShiptos") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->addAction(editStr, this, SLOT(sEditShipto())); else if (_privileges->check("ViewShiptos")) menuItem = pMenu->addAction(viewStr, this, SLOT(sViewShipto())); break; case 3: // vendor /* comment out until we make vendor a XDialog or address a XMainWindow if (_privileges->check("MaintainVendors") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->addAction(editStr, this, SLOT(sEditVendor())); else if (_privileges->check("ViewVendors")) menuItem = pMenu->addAction(viewStr, this, SLOT(sViewVendor())); */ break; case 4: // vendaddr if (_privileges->check("MaintainVendorAddresses") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->addAction(editStr, this, SLOT(sEditVendorAddress())); else if (_privileges->check("ViewVendorAddresses")) menuItem = pMenu->addAction(viewStr, this, SLOT(sViewVendorAddress())); break; case 5: // warehouse if (_privileges->check("MaintainWarehouses") && (cNew == _mode || cEdit == _mode)) menuItem = pMenu->addAction(editStr, this, SLOT(sEditWarehouse())); else if (_privileges->check("ViewWarehouses")) menuItem = pMenu->addAction(viewStr, this, SLOT(sViewWarehouse())); break; default: break; } } void address::sEdit() { internalSave(); switch (_uses->altId()) { case 1: sEditContact(); break; case 2: sEditShipto(); break; case 3: sEditVendor(); break; case 4: sEditVendorAddress(); break; case 5: sEditWarehouse(); break; default: break; } // force AddressCluster to reload its data int tmpAddrId = _addr->id(); _addr->setId(-1); _addr->setId(tmpAddrId); sPopulate(); } void address::sView() { switch (_uses->altId()) { case 1: sViewContact(); break; case 2: sViewShipto(); break; case 3: sViewVendor(); break; case 4: sViewVendorAddress(); break; case 5: sViewWarehouse(); break; default: break; } } void address::sEditContact() { ParameterList params; params.append("mode", "edit"); params.append("cntct_id", _uses->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void address::sViewContact() { ParameterList params; params.append("mode", "view"); params.append("cntct_id", _uses->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void address::sEditShipto() { ParameterList params; shipTo newdlg(this, "", TRUE); params.append("mode", "edit"); params.append("shipto_id", _uses->id()); newdlg.set(params); newdlg.exec(); } void address::sViewShipto() { ParameterList params; shipTo newdlg(this, "", TRUE); params.append("mode", "view"); params.append("shipto_id", _uses->id()); newdlg.set(params); newdlg.exec(); } void address::sEditVendor() { ParameterList params; vendor * newdlg = new vendor(this); params.append("mode", "edit"); params.append("vend_id", _uses->id()); newdlg->set(params); newdlg->show(); } void address::sViewVendor() { ParameterList params; vendor * newdlg = new vendor(this); params.append("mode", "view"); params.append("vend_id", _uses->id()); newdlg->set(params); newdlg->show(); } void address::sEditVendorAddress() { ParameterList params; vendorAddress newdlg(this, "", TRUE); params.append("mode", "edit"); params.append("vendaddr_id", _uses->id()); newdlg.set(params); newdlg.exec(); } void address::sViewVendorAddress() { ParameterList params; vendorAddress newdlg(this, "", TRUE); params.append("mode", "view"); params.append("vendaddr_id", _uses->id()); newdlg.set(params); newdlg.exec(); } void address::sEditWarehouse() { ParameterList params; warehouse newdlg(this, "", TRUE); params.append("mode", "edit"); params.append("warehous_id", _uses->id()); newdlg.set(params); newdlg.exec(); } void address::sViewWarehouse() { ParameterList params; warehouse newdlg(this, "", TRUE); params.append("mode", "view"); params.append("warehous_id", _uses->id()); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/address.h000066400000000000000000000033421217451700100171750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ADDRESS_H #define ADDRESS_H #include "guiclient.h" #include "xdialog.h" #include #include #include "addresscluster.h" class address : public XDialog, public Ui::address { Q_OBJECT public: address(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~address(); public slots: virtual SetResponse set(const ParameterList &pParams); protected slots: virtual void languageChange(); virtual void reject(); virtual void sDeleteCharacteristic(); virtual void sEdit(); virtual void sEditCharacteristic(); virtual void sEditContact(); virtual void sEditShipto(); virtual void sEditVendor(); virtual void sEditVendorAddress(); virtual void sEditWarehouse(); virtual void sGetCharacteristics(); virtual void sNewCharacteristic(); virtual void sPopulate(); virtual void sPopulateMenu(QMenu *); virtual void sSave(); virtual void sView(); virtual void sViewContact(); virtual void sViewShipto(); virtual void sViewVendor(); virtual void sViewVendorAddress(); virtual void sViewWarehouse(); private: int _mode; int _addrid; bool _captive; virtual void internalSave(AddressCluster::SaveFlags = AddressCluster::CHECK); }; #endif // ADDRESS_H qt-client-4.1.0/guiclient/address.ui000066400000000000000000000210771217451700100173700ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. address 0 0 624 495 Address 0 0 true false Qt::Horizontal 0 153 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 Notes true Comments Comments::Address Characteristics 0 New false Edit false Delete Qt::Vertical 20 40 Uses of the Address 0 Edit View Qt::Vertical 20 40 AddressCluster QWidget
addresscluster.h
Comments QWidget
comments.h
XTreeWidget QTreeWidget
xtreewidget.h
1
XTextEdit QTextEdit
xtextedit.h
_tab _charass _newCharacteristic _editCharacteristic _deleteCharacteristic _uses _editAddrUse _notes _uses itemSelected(int) _editAddrUse animateClick() 380 511 380 511 _uses valid(bool) _editAddrUse setEnabled(bool) 380 511 380 511 _uses valid(bool) _viewAddrUse setEnabled(bool) 380 511 380 511 _charass itemSelected(int) _editCharacteristic animateClick() 380 511 380 511 _charass valid(bool) _deleteCharacteristic setEnabled(bool) 380 511 380 511 _charass valid(bool) _editCharacteristic setEnabled(bool) 380 511 380 511
qt-client-4.1.0/guiclient/addresses.cpp000066400000000000000000000073741217451700100200710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "addresses.h" #include #include #include #include #include #include #include #include "addresses.h" #include "address.h" #include "characteristic.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" addresses::addresses(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "addresses", fl) { setReportName("AddressesMasterList"); setWindowTitle(tr("Addresses")); setMetaSQLOptions("addresses", "detail"); setNewVisible(true); setQueryOnStartEnabled(true); setParameterWidgetVisible(true); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); list()->addColumn(tr("Line 1"), -1, Qt::AlignLeft, true, "addr_line1"); list()->addColumn(tr("Line 2"), 75, Qt::AlignLeft, true, "addr_line2"); list()->addColumn(tr("Line 3"), 75, Qt::AlignLeft, true, "addr_line3"); list()->addColumn(tr("City"), 75, Qt::AlignLeft, true, "addr_city"); list()->addColumn(tr("State"), 50, Qt::AlignLeft, true, "addr_state"); list()->addColumn(tr("Country"), 50, Qt::AlignLeft, true, "addr_country"); list()->addColumn(tr("Postal Code"),50,Qt::AlignLeft, true, "addr_postalcode"); setupCharacteristics(characteristic::Addresses); parameterWidget()->applyDefaultFilterSet(); if (_privileges->check("MaintainAddresses")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } } void addresses::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainAddresses")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("ViewAddresses")); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainAddresses")); } void addresses::sNew() { ParameterList params; params.append("mode", "new"); address newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void addresses::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("addr_id", list()->id()); address newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void addresses::sView() { ParameterList params; params.append("mode", "view"); params.append("addr_id", list()->id()); address newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void addresses::sDelete() { XSqlQuery deleteAddress; deleteAddress.prepare("SELECT deleteAddress(:addr_id) AS result;"); deleteAddress.bindValue(":addr_id", list()->id()); deleteAddress.exec(); if (deleteAddress.first()) { int result = deleteAddress.value("result").toInt(); if (result < 0) { QMessageBox::warning(this, tr("Cannot Delete Selected Address"), storedProcErrorLookup("deleteAddress", result)); return; } else sFillList(); } else if (deleteAddress.lastError().type() != QSqlError::NoError) { systemError(this, deleteAddress.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/addresses.h000066400000000000000000000015771217451700100175350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ADDRESSES_H #define ADDRESSES_H #include "display.h" #include class addresses : public display { Q_OBJECT public: addresses(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sPopulateMenu(QMenu *, QTreeWidgetItem* = NULL, int = 0); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); }; #endif // ADDRESSES_H qt-client-4.1.0/guiclient/addresses.ui000066400000000000000000000021501217451700100177070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. addresses 0 0 217 37 List Addresses Show Active Addresses Only qt-client-4.1.0/guiclient/adjustInvValue.cpp000066400000000000000000000166001217451700100210500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "adjustInvValue.h" #include #include "mqlutil.h" #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "storedProcErrorLookup.h" adjustInvValue::adjustInvValue(QWidget* parent, const char * name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_altAccnt, SIGNAL(toggled(bool)), this, SLOT(sToggleAltAccnt(bool))); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_site, SIGNAL(newID(int)), this, SLOT(sValidateSite(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulate())); connect(_newValue, SIGNAL(textChanged(QString)), this, SLOT(sUpdateCost())); _captive = FALSE; _item->setType(ItemLineEdit::cActive); _item->addExtraClause( QString("(itemsite_active)") ); // ItemLineEdit::cActive doesn't compare against the itemsite record _item->addExtraClause( QString("(itemsite_costmethod='A')") ); _item->addExtraClause( QString("(itemsite_qtyonhand <> 0.0)") ); _site->setType(WComboBox::AllActiveInventory); _newValue->setValidator(omfgThis->costVal()); if (!_metrics->boolean("MultiWhs")) { _siteLit->hide(); _site->hide(); } _itemsiteid = -1; _qtyonhand = -0; sValidateSite(_site->id()); } adjustInvValue::~adjustInvValue() { // no need to delete child widgets, Qt does it all for us } void adjustInvValue::languageChange() { retranslateUi(this); } enum SetResponse adjustInvValue::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _site->setEnabled(FALSE); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _site->setEnabled(FALSE); _post->hide(); _close->setText(tr("&Close")); } } return NoError; } void adjustInvValue::sPopulate() { XSqlQuery adjustPopulate; if (_item->id() == -1) { _itemsiteid = -1; _qoh->setText("0.0"); _qtyonhand = 0.0; _currentValue->setText("0.0"); _currentCost->setText("0.0"); _newCost->setText("0.0"); _post->setEnabled(false); } else { QString sql = "SELECT itemsite_id, itemsite_qtyonhand, " " formatQty(itemsite_qtyonhand) AS f_qoh, " " formatMoney(itemsite_value) AS f_value, " " CASE WHEN itemsite_qtyonhand > 0 THEN " " formatCost(itemsite_value / itemsite_qtyonhand) " " ELSE formatCost(0) END AS f_cost " "FROM itemsite " "WHERE ((itemsite_warehous_id=)" " AND (itemsite_item_id=))"; ParameterList params; params.append("warehous_id", _site->id()); params.append("item_id", _item->id()); MetaSQLQuery mql(sql); adjustPopulate = mql.toQuery(params); if (adjustPopulate.first()) { _itemsiteid = adjustPopulate.value("itemsite_id").toInt(); _qtyonhand = adjustPopulate.value("itemsite_qtyonhand").toDouble(); _qoh->setText(adjustPopulate.value("f_qoh").toString()); _currentValue->setText(adjustPopulate.value("f_value").toString()); _currentCost->setText(adjustPopulate.value("f_cost").toString()); _post->setEnabled(true); } else { _itemsiteid = -1; _qoh->setText("0.0"); _qtyonhand = 0.0; _currentValue->setText("0.0"); _currentCost->setText("0.0"); _newCost->setText("0.0"); _post->setEnabled(false); } if (adjustPopulate.lastError().type() != QSqlError::NoError) { systemError(this, adjustPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } } void adjustInvValue::sPost() { XSqlQuery adjustPost; QList errors; errors << GuiErrorCheck(_itemsiteid == -1, _item, tr("You must select a valid Itemsite before posting this transaction.") ) << GuiErrorCheck(_newValue->text().length() == 0, _newValue, tr("

You must enter a valid New Value before posting this transaction.") ) << GuiErrorCheck(_altAccnt->isChecked() && ! _accnt->isValid(), _accnt, tr("

You must enter a valid Alternate G/L Account before posting this transaction.") ) << GuiErrorCheck(_qtyonhand <= 0.0, _item, tr("You must select an Itemsite with a positive Qty on Hand before posting this transaction.") ) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Post Transaction"), errors)) return; ParameterList params; params.append("newValue", _newValue->toDouble()); params.append("itemsite_id", _itemsiteid); if (_altAccnt->isChecked() && _accnt->id() != -1) params.append("accnt_id", _accnt->id()); QString sql = "SELECT adjustInvValue(, " " , " " ) AS result;"; MetaSQLQuery mql(sql); adjustPost = mql.toQuery(params); if (adjustPost.lastError().type() != QSqlError::NoError) { systemError(this, adjustPost.lastError().databaseText(), __FILE__, __LINE__); return; } QMessageBox::information( this, tr("Post Successful"), tr( "

Value successfully updated. ") ); sPopulate(); _newValue->clear(); } void adjustInvValue::sUpdateCost() { XSqlQuery adjustUpdateCost; QString sql = "SELECT " " CASE WHEN itemsite_qtyonhand > 0 THEN " " formatCost( / itemsite_qtyonhand) " " ELSE formatCost(0) END AS f_cost " "FROM itemsite " "WHERE ((itemsite_warehous_id=)" " AND (itemsite_item_id=))"; ParameterList params; params.append("warehous_id", _site->id()); params.append("item_id", _item->id()); params.append("newvalue", _newValue->toDouble()); MetaSQLQuery mql(sql); adjustUpdateCost = mql.toQuery(params); if (adjustUpdateCost.first()) { _newCost->setText(adjustUpdateCost.value("f_cost").toString()); } if (adjustUpdateCost.lastError().type() != QSqlError::NoError) { systemError(this, adjustUpdateCost.lastError().databaseText(), __FILE__, __LINE__); return; } } void adjustInvValue::sValidateSite(int siteid) { if (siteid != -1) { _item->setEnabled(true); } else { _item->setId(-1); _item->setEnabled(false); } sPopulate(); } void adjustInvValue::sToggleAltAccnt(bool checked) { _accnt->setReadOnly(!checked); } qt-client-4.1.0/guiclient/adjustInvValue.h000066400000000000000000000023231217451700100205120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ADJUSTINVVALUE_H #define ADJUSTINVVALUE_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_adjustInvValue.h" class adjustInvValue : public XWidget, public Ui::adjustInvValue { Q_OBJECT public: adjustInvValue(QWidget* parent = 0, const char * = 0, Qt::WindowFlags fl = Qt::Window); ~adjustInvValue(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPost(); virtual void sPopulate(); virtual void sUpdateCost(); virtual void sValidateSite(int siteid); virtual void sToggleAltAccnt(bool checked); protected slots: virtual void languageChange(); private: int _mode; int _itemsiteid; double _qtyonhand; bool _captive; }; #endif // ADJUSTINVVALUE_H qt-client-4.1.0/guiclient/adjustInvValue.ui000066400000000000000000000175131217451700100207070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. adjustInvValue 0 0 536 364 Adjust Inventory Value Site: Qt::Horizontal 40 20 false Post true Close Qt::Vertical 20 0 false Qty on Hand: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.00 Current Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.00 Current Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.00 New Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter New Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.00 Use alternate adjustment account Account #: true GLCluster QWidget

glcluster.h
ItemCluster QWidget
itemcluster.h
1
WComboBox XComboBox
wcombobox.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_site _item _newValue _altAccnt _accnt _post _close _close clicked(bool) adjustInvValue close() 485 61 267 181 qt-client-4.1.0/guiclient/adjustmentTrans.cpp000066400000000000000000000270731217451700100213000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "adjustmentTrans.h" #include #include #include #include #include "distributeInventory.h" #include "inputManager.h" #include "storedProcErrorLookup.h" adjustmentTrans::adjustmentTrans(QWidget* parent, const char * name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); _adjustmentTypeGroupInt = new QButtonGroup(this); connect(_absolute, SIGNAL(toggled(bool)), this, SLOT(sPopulateQty())); connect(_adjustmentTypeGroupInt,SIGNAL(buttonClicked(int)), this, SLOT(sPopulateQty())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_qty, SIGNAL(textChanged(const QString&)), this, SLOT(sPopulateQty())); connect(_qty, SIGNAL(textChanged(const QString&)), this, SLOT(sCostUpdated())); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateQOH())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateQOH())); connect(_cost, SIGNAL(textChanged(const QString&)), this, SLOT(sCostUpdated())); connect(_costManual, SIGNAL(toggled(bool)), this, SLOT(sPopulateQty())); _captive = FALSE; _item->setType((ItemLineEdit::cGeneralInventory ^ ItemLineEdit::cBreeder) | ItemLineEdit::cActive); _item->addExtraClause( QString("(item_type NOT IN ('R', 'F'))") ); _item->addExtraClause( QString("(itemsite_costmethod != 'J')") ); _warehouse->setType(WComboBox::AllActiveInventory); _afterQty->setPrecision(omfgThis->qtyVal()); _beforeQty->setPrecision(omfgThis->qtyVal()); _cost->setValidator(omfgThis->costVal()); _qty->setValidator(omfgThis->transQtyVal()); _unitCost->setPrecision(omfgThis->costVal()); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } if (!_metrics->boolean("AllowAvgCostMethod")) _tab->removeTab(0); } adjustmentTrans::~adjustmentTrans() { // no need to delete child widgets, Qt does it all for us } void adjustmentTrans::languageChange() { retranslateUi(this); } enum SetResponse adjustmentTrans::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; int invhistid = -1; bool noQty = TRUE; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); } param = pParams.value("qty", &valid); if (valid) { _captive = TRUE; _qty->setDouble(param.toDouble()); _qty->setEnabled(FALSE); _afterQty->setDouble(param.toDouble()); _absolute->setChecked(TRUE); _adjustmentTypeGroup->setEnabled(FALSE); noQty = FALSE; } param = pParams.value("invhist_id", &valid); if (valid) invhistid = param.toInt(); param = pParams.value("mode", &valid); XSqlQuery setAdjustment; if (valid) { if (param.toString() == "new") { _mode = cNew; _usernameLit->clear(); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); } else if (param.toString() == "view") { _mode = cView; _transDate->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _adjustmentTypeGroup->setEnabled(FALSE); _qty->setEnabled(FALSE); _documentNum->setEnabled(FALSE); _notes->setEnabled(FALSE); _post->hide(); _close->setText(tr("&Close")); setAdjustment.prepare( "SELECT * " "FROM invhist " "WHERE (invhist_id=:invhist_id);" ); setAdjustment.bindValue(":invhist_id", invhistid); setAdjustment.exec(); if (setAdjustment.first()) { _transDate->setDate(setAdjustment.value("invhist_transdate").toDate()); _username->setText(setAdjustment.value("invhist_user").toString()); _qty->setDouble(setAdjustment.value("invhist_invqty").toDouble()); _beforeQty->setDouble(setAdjustment.value("invhist_qoh_before").toDouble()); _afterQty->setDouble(setAdjustment.value("invhist_qoh_after").toDouble()); _documentNum->setText(setAdjustment.value("invhist_ordnumber")); _notes->setText(setAdjustment.value("invhist_comments").toString()); _item->setItemsiteid(setAdjustment.value("invhist_itemsite_id").toInt()); } else if (setAdjustment.lastError().type() != QSqlError::NoError) { systemError(this, setAdjustment.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } } return NoError; } void adjustmentTrans::sPost() { XSqlQuery adjustmentPost; double qty = _qty->toDouble(); double cost = _cost->toDouble(); if (_absolute->isChecked()) { qty = (_qty->toDouble() - _cachedQOH); cost = (_cost->toDouble() - _cachedValue); } struct { bool condition; QString msg; QWidget *widget; } error[] = { { ! _item->isValid(), tr("You must select an Item before posting this transaction."), _item }, { _qty->text().length() == 0 || qty == 0, tr("

You must enter a Quantity before posting this Transaction."), _qty }, { _costAdjust->isEnabled() && _costAdjust->isChecked() && _costManual->isChecked() && (_cost->text().length() == 0 || cost == 0), tr("

You must enter a total cost value for the inventory to be transacted."), _cost }, { _costMethod == "A" && _afterQty->toDouble() < 0, tr("

Average cost adjustments may not result in a negative quantity on hand."), _qty }, { true, "", NULL } }; int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Post Transaction"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); adjustmentPost.exec("BEGIN;"); // because of possible distribution cancelations adjustmentPost.prepare( "SELECT invAdjustment(itemsite_id, :qty, :docNumber," " :comments, :date, :cost) AS result " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); adjustmentPost.bindValue(":qty", qty); adjustmentPost.bindValue(":docNumber", _documentNum->text()); adjustmentPost.bindValue(":comments", _notes->toPlainText()); adjustmentPost.bindValue(":item_id", _item->id()); adjustmentPost.bindValue(":warehous_id", _warehouse->id()); adjustmentPost.bindValue(":date", _transDate->date()); if(!_costAdjust->isChecked()) adjustmentPost.bindValue(":cost", 0.0); else if(_costManual->isChecked()) adjustmentPost.bindValue(":cost", cost); adjustmentPost.exec(); if (adjustmentPost.first()) { int result = adjustmentPost.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("invAdjustment", result), __FILE__, __LINE__); } else if (adjustmentPost.lastError().type() != QSqlError::NoError) { systemError(this, adjustmentPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(adjustmentPost.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information(this, tr("Inventory Adjustment"), tr("Transaction Canceled") ); return; } adjustmentPost.exec("COMMIT;"); if (_captive) close(); else { _item->setId(-1); _qty->clear(); _documentNum->clear(); _notes->clear(); _beforeQty->clear(); _afterQty->clear(); _cost->clear(); _transDate->setDate(omfgThis->dbDate()); _item->setFocus(); } } else if (adjustmentPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, adjustmentPost.lastError().databaseText(), __FILE__, __LINE__); return; } else { rollback.exec(); systemError( this, tr("

No transaction was done because Item %1 " "was not found at Site %2.") .arg(_item->itemNumber()).arg(_warehouse->currentText())); } } void adjustmentTrans::sPopulateQOH() { XSqlQuery populateAdjustment; if (_mode != cView) { populateAdjustment.prepare( "SELECT itemsite_freeze, itemsite_qtyonhand, itemsite_costmethod, itemsite_value " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id));" ); populateAdjustment.bindValue(":item_id", _item->id()); populateAdjustment.bindValue(":warehous_id", _warehouse->id()); populateAdjustment.exec(); _absolute->setStyleSheet(""); if (populateAdjustment.first()) { _cachedValue = populateAdjustment.value("itemsite_value").toDouble(); _cachedQOH = populateAdjustment.value("itemsite_qtyonhand").toDouble(); if(_cachedQOH == 0.0) _costManual->setChecked(true); _beforeQty->setDouble(populateAdjustment.value("itemsite_qtyonhand").toDouble()); _costAdjust->setChecked(true); _costAdjust->setEnabled(populateAdjustment.value("itemsite_costmethod").toString() == "A"); _costMethod = populateAdjustment.value("itemsite_costmethod").toString(); if (populateAdjustment.value("itemsite_freeze").toBool()) _absolute->setStyleSheet(QString("* { color: %1; }") .arg(namedColor("error").name())); if (_item->isFractional()) _qty->setValidator(omfgThis->transQtyVal()); else _qty->setValidator(new QIntValidator(this)); } else if (populateAdjustment.lastError().type() != QSqlError::NoError) { systemError(this, populateAdjustment.lastError().databaseText(), __FILE__, __LINE__); return; } sPopulateQty(); } } void adjustmentTrans::sPopulateQty() { if (_mode == cNew) { if (_qty->text().trimmed().length()) { if (_absolute->isChecked()) _afterQty->setDouble(_qty->toDouble()); else if (_relative->isChecked()) _afterQty->setDouble(_cachedQOH + _qty->toDouble()); } else _afterQty->clear(); bool neg = ((_afterQty->toDouble() < _cachedQOH) || (_afterQty->toDouble() == 0)); if(neg) _costCalculated->setChecked(true); _costManual->setEnabled(!neg); _cost->setEnabled(!neg && _costManual->isChecked()); _lblCost->setEnabled(!neg); _unitCost->setEnabled(!neg); _unitCostLit->setEnabled(!neg); if (_afterQty->toDouble() == 0) { _costAdjust->setChecked(true); _costAdjust->setEnabled(false); } else _costAdjust->setEnabled(_costMethod == "A"); } } void adjustmentTrans::sCostUpdated() { if(_cost->toDouble() == 0.0 || _qty->toDouble() == 0.0) _unitCost->setText(tr("N/A")); else _unitCost->setDouble(_cost->toDouble() / _qty->toDouble()); } qt-client-4.1.0/guiclient/adjustmentTrans.h000066400000000000000000000023531217451700100207370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ADJUSTMENTTRANS_H #define ADJUSTMENTTRANS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_adjustmentTrans.h" class adjustmentTrans : public XWidget, public Ui::adjustmentTrans { Q_OBJECT public: adjustmentTrans(QWidget* parent = 0, const char * = 0, Qt::WindowFlags fl = Qt::Window); ~adjustmentTrans(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPost(); virtual void sPopulateQOH(); virtual void sPopulateQty(); virtual void sCostUpdated(); protected slots: virtual void languageChange(); private: int _mode; double _cachedQOH; double _cachedValue; bool _captive; QButtonGroup* _adjustmentTypeGroupInt; QString _costMethod; }; #endif // ADJUSTMENTTRANS_H qt-client-4.1.0/guiclient/adjustmentTrans.ui000066400000000000000000000417561217451700100211370ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. adjustmentTrans 0 0 500 528 Adjustment Transaction 12 5 Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal 40 20 5 Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 5 &Cancel false &Post Qt::Vertical QSizePolicy::Expanding 20 35 5 Qt::StrongFocus &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Adjustment Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty 0 0 80 32767 Qt::AlignRight Before: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter After: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 &Absolute &Relative true 0 0 &Document #: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _documentNum Qt::Horizontal 40 20 0 Cost Adjust Value true Calculated true Manual Total Cost: false Unit Cost: N/A Qt::Horizontal 40 20 Qt::Vertical 20 1 Notes 0 1 true true DLineEdit QWidget

datecluster.h
ItemCluster QWidget
itemcluster.h
1
WComboBox XComboBox
wcombobox.h
XComboBox QComboBox
xcombobox.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
XTextEdit QTextEdit
xtextedit.h
_transDate _item _warehouse _qty _relative _absolute _documentNum _costAdjust _costCalculated _costManual _cost _tab _notes _post _close _item valid(bool) _post setEnabled(bool) 20 20 20 20 _close clicked() adjustmentTrans close() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 qt-client-4.1.0/guiclient/allocateARCreditMemo.cpp000066400000000000000000000257561217451700100221000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "allocateARCreditMemo.h" #include #include #include #include "metasql.h" #include "mqlutil.h" allocateARCreditMemo::allocateARCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _aropen->setRootIsDecorated(true); _aropen->addColumn(tr("Doc. Type"), -1, Qt::AlignLeft, true, "doctype"); _aropen->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignLeft, true, "docnumber"); _aropen->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, true, "docdate"); _aropen->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "duedate"); _aropen->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "amount"); _aropen->addColumn(tr("Paid"), _moneyColumn, Qt::AlignRight, true, "paid"); _aropen->addColumn(tr("Balance"), _moneyColumn, Qt::AlignRight, true, "balance"); _aropen->addColumn(tr("This Alloc."), _moneyColumn, Qt::AlignRight, true, "allocated"); _aropen->addColumn(tr("Total Alloc."), _moneyColumn, Qt::AlignRight, true, "totalallocated"); connect(omfgThis, SIGNAL(creditMemosUpdated()), this, SLOT(sPopulate())); if (omfgThis->singleCurrency()) { _aropen->hideColumn("currAbbr"); _aropen->hideColumn("balance"); } connect(_aropen, SIGNAL(valid(bool)), this, SLOT(sHandleButton())); connect(_allocate, SIGNAL(clicked()), this, SLOT(sAllocate())); connect(_cancel, SIGNAL(clicked()), this, SLOT(sCancel())); _coheadid = -1; _invcheadid = -1; } allocateARCreditMemo::~allocateARCreditMemo() { // no need to delete child widgets, Qt does it all for us } void allocateARCreditMemo::languageChange() { retranslateUi(this); } enum SetResponse allocateARCreditMemo::set(const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("effective", &valid); if (valid) { _total->setEffective(param.toDate()); _balance->setEffective(param.toDate()); } param = pParams.value("curr_id", &valid); if (valid) { _total->setId(param.toInt()); _balance->setId(param.toInt()); } param = pParams.value("total", &valid); if (valid) _total->setLocalValue(param.toDouble()); param = pParams.value("balance", &valid); if (valid) _balance->setLocalValue(param.toDouble()); param = pParams.value("cust_id", &valid); if (valid) _custid = param.toInt(); param = pParams.value("cohead_id", &valid); if (valid) _coheadid = param.toInt(); param = pParams.value("invchead_id", &valid); if (valid) _invcheadid = param.toInt(); param = pParams.value("doctype", &valid); if (valid) _doctype = param.toString(); sPopulate(); return NoError; } void allocateARCreditMemo::sCancel() { accept(); } void allocateARCreditMemo::sPopulate() { XSqlQuery populateCM; if (_coheadid == -1) { // get the cohead_id associated with the invoice populateCM.prepare("SELECT cohead_id " " FROM invchead JOIN cohead ON (cohead_number=invchead_ordernumber)" " WHERE (invchead_id=:invchead_id);"); populateCM.bindValue(":invchead_id", _invcheadid); populateCM.exec(); if (populateCM.first()) _coheadid = populateCM.value("cohead_id").toInt(); if (populateCM.lastError().type() != QSqlError::NoError) { systemError(this, populateCM.lastError().databaseText(), __FILE__, __LINE__); return; } } // Get the list of Unallocated CM's with amount populateCM.prepare("SELECT aropen_id, " " docnumber, doctype, docdate, duedate," " amount, paid, balance, allocated, totalallocated, " " CASE WHEN (doctype='C') THEN :creditmemo" " WHEN (doctype='R') THEN :cashdeposit" " WHEN (doctype='S') THEN :salesorder" " WHEN (doctype='I') THEN :invoice" " END AS doctype_qtdisplayrole, " " indent AS xtindentrole " " FROM ( " "SELECT aropen_id, 0 AS indent, " " aropen_docnumber AS docnumber, aropen_doctype AS doctype, " " aropen_docdate AS docdate, aropen_duedate AS duedate," " currToCurr(aropen_curr_id, :curr_id, aropen_amount, :effective) AS amount," " currToCurr(aropen_curr_id, :curr_id, aropen_paid, :effective) AS paid," " currToCurr(aropen_curr_id, :curr_id, noNeg(aropen_amount - aropen_paid), :effective) AS balance," " COALESCE(SUM(CASE WHEN ((aropenalloc_doctype='S' AND aropenalloc_doc_id=:cohead_id) OR " " (aropenalloc_doctype='I' AND aropenalloc_doc_id=:invchead_id)) THEN " " currToCurr(aropenalloc_curr_id, :curr_id, aropenalloc_amount, :effective)" " ELSE 0.00 END), 0.0) AS allocated," " COALESCE(SUM(currToCurr(aropenalloc_curr_id, :curr_id, aropenalloc_amount, :effective)), 0.0) AS totalallocated " " FROM aropen LEFT OUTER JOIN aropenalloc ON (aropenalloc_aropen_id=aropen_id)" " WHERE ( (aropen_cust_id=:cust_id)" " AND (aropen_doctype IN ('C', 'R'))" " AND (aropen_open) )" " GROUP BY aropen_id, aropen_docnumber, aropen_doctype, aropen_docdate, aropen_duedate," " aropen_curr_id, aropen_amount, aropen_paid " "UNION " "SELECT aropen_id, 1 AS indent, " " cohead_number AS docnumber, 'S' AS doctype, " " cohead_orderdate AS docdate, NULL AS duedate," " NULL AS amount," " NULL AS paid," " NULL AS balance," " NULL AS allocated," " COALESCE(currToCurr(aropenalloc_curr_id, :curr_id, aropenalloc_amount, :effective), 0.0) AS totalallocated " " FROM aropen JOIN aropenalloc ON (aropenalloc_aropen_id=aropen_id AND aropenalloc_doctype='S')" " JOIN cohead ON (cohead_id=aropenalloc_doc_id) " " WHERE ( (aropen_cust_id=:cust_id)" " AND (aropen_doctype IN ('C', 'R'))" " AND (aropen_open) ) " "UNION " "SELECT aropen_id, 1 AS indent, " " invchead_invcnumber AS docnumber, 'I' AS doctype, " " invchead_invcdate AS docdate, NULL AS duedate," " NULL AS amount," " NULL AS paid," " NULL AS balance," " NULL AS allocated," " COALESCE(currToCurr(aropenalloc_curr_id, :curr_id, aropenalloc_amount, :effective), 0.0) AS totalallocated " " FROM aropen JOIN aropenalloc ON (aropenalloc_aropen_id=aropen_id AND aropenalloc_doctype='I')" " JOIN invchead ON (invchead_id=aropenalloc_doc_id) " " WHERE ( (aropen_cust_id=:cust_id)" " AND (aropen_doctype IN ('C', 'R'))" " AND (aropen_open) )" " ) AS data " " ORDER BY aropen_id, indent, duedate;"); populateCM.bindValue(":cohead_id", _coheadid); populateCM.bindValue(":invchead_id", _invcheadid); populateCM.bindValue(":cust_id", _custid); populateCM.bindValue(":curr_id", _total->id()); populateCM.bindValue(":effective", _total->effective()); populateCM.bindValue(":creditmemo", tr("Credit Memo")); populateCM.bindValue(":cashdeposit", tr("Customer Deposit")); populateCM.bindValue(":salesorder", tr("Sales Order")); populateCM.bindValue(":invoice", tr("Invoice")); populateCM.exec(); if (populateCM.lastError().type() != QSqlError::NoError) { systemError(this, populateCM.lastError().databaseText(), __FILE__, __LINE__); return; } _aropen->populate(populateCM, false); } void allocateARCreditMemo::sAllocate() { if (_allocateMode && _balance->localValue() > 0.0) { double amount = _aropen->rawValue("balance").toDouble() - _aropen->rawValue("totalallocated").toDouble(); if (amount > _balance->localValue()) // make sure we don't apply more to a credit memo than we have left. amount = _balance->localValue(); XSqlQuery allocCM; allocCM.prepare("INSERT INTO aropenalloc" " (aropenalloc_aropen_id, aropenalloc_doctype, aropenalloc_doc_id, " " aropenalloc_amount, aropenalloc_curr_id)" "VALUES(:aropen_id, :doctype, :doc_id, :amount, :curr_id);"); allocCM.bindValue(":doctype", _doctype); if (_doctype == "S") allocCM.bindValue(":doc_id", _coheadid); else allocCM.bindValue(":doc_id", _invcheadid); allocCM.bindValue(":aropen_id", _aropen->id()); allocCM.bindValue(":amount", amount); allocCM.bindValue(":curr_id", _total->id()); allocCM.exec(); if (!allocCM.lastError().type() == QSqlError::NoError) systemError(this, allocCM.lastError().databaseText(), __FILE__, __LINE__); double newbalance = _balance->localValue() - amount; _balance->setLocalValue(newbalance); } else { double amount = _aropen->rawValue("allocated").toDouble(); XSqlQuery allocCM; allocCM.prepare("DELETE FROM aropenalloc " "WHERE ((aropenalloc_aropen_id=:aropen_id)" " AND ((aropenalloc_doctype='S' AND aropenalloc_doc_id=:cohead_id) OR" " (aropenalloc_doctype='I' AND aropenalloc_doc_id=:invchead_id)));"); allocCM.bindValue(":cohead_id", _coheadid); allocCM.bindValue(":invchead_id", _invcheadid); allocCM.bindValue(":aropen_id", _aropen->id()); allocCM.exec(); if (!allocCM.lastError().type() == QSqlError::NoError) systemError(this, allocCM.lastError().databaseText(), __FILE__, __LINE__); double newbalance = _balance->localValue() + amount; _balance->setLocalValue(newbalance); } sPopulate(); } void allocateARCreditMemo::sHandleButton() { if (_aropen->rawValue("allocated").toDouble() == 0.0 && _balance->localValue() && (_aropen->rawValue("balance").toDouble() - _aropen->rawValue("totalallocated").toDouble()) > 0.0) { // Allocate mode _allocateMode = true; _allocate->setText("Allocate"); _allocate->setEnabled(true); } else if (_aropen->rawValue("allocated").toDouble() > 0.0) { // Deallocate mode _allocateMode = false; _allocate->setText("Clear"); _allocate->setEnabled(true); } else _allocate->setEnabled(false); } qt-client-4.1.0/guiclient/allocateARCreditMemo.h000066400000000000000000000024001217451700100215220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ALLOCATEARCREDITMEMO_H #define ALLOCATEARCREDITMEMO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_allocateARCreditMemo.h" class allocateARCreditMemo : public XDialog, public Ui::allocateARCreditMemo { Q_OBJECT public: allocateARCreditMemo(QWidget* = 0, const char* = 0, bool = false, Qt::WFlags = 0); ~allocateARCreditMemo(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCancel(); virtual void sPopulate(); virtual void sAllocate(); virtual void sHandleButton(); protected: bool _readonly; bool _allocateMode; int _custid; int _coheadid; int _invcheadid; QString _doctype; protected slots: virtual void languageChange(); }; #endif // ALLOCATEARCREDITMEMO_H qt-client-4.1.0/guiclient/allocateARCreditMemo.ui000066400000000000000000000165521217451700100217250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. allocateARCreditMemo 0 0 456 400 Allocate A/R Credit Memos 12 12 Document Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Unallocated Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Vertical 305 0 Qt::Horizontal 13 57 0 0 &Close Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 Credits 0 false Allocate Qt::Vertical 20 40 CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
XLabel QLabel
xlabel.h
XTreeWidget QTreeWidget
xtreewidget.h
1
_cancel
qt-client-4.1.0/guiclient/allocateReservations.cpp000066400000000000000000000044571217451700100223040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "allocateReservations.h" #include #include allocateReservations::allocateReservations(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sAllocate())); connect(_cust, SIGNAL(newId(int)), this, SLOT(sCustomerSelected())); _customerTypes->setType(XComboBox::CustomerTypes); } allocateReservations::~allocateReservations() { // no need to delete child widgets, Qt does it all for us } void allocateReservations::languageChange() { retranslateUi(this); } void allocateReservations::sAllocate() { if(!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("You must specify a valid date range.")); return; } XSqlQuery allocateRes; allocateRes.prepare("SELECT reserveAllSo(:addpackinglist, :startDate, :endDate, :cust_id, :shipto_id, :custtype_id, :custtype_pattern) AS result;"); allocateRes.bindValue(":addpackinglist", _addPackingList->isChecked()); _dates->bindValue(allocateRes); if (_selectedCustomer->isChecked()) allocateRes.bindValue(":cust_id", _cust->id()); if (_selectedCustomerShipto->isChecked()) allocateRes.bindValue(":shipto_id", _customerShipto->id()); if (_selectedCustomerType->isChecked()) allocateRes.bindValue(":custtype_id", _customerTypes->id()); if (_customerTypePattern->isChecked()) allocateRes.bindValue(":custtype_pattern", _customerType->text()); allocateRes.exec(); accept(); } void allocateReservations::sCustomerSelected() { XSqlQuery selectedRes; _customerShipto->clear(); selectedRes.prepare("SELECT shipto_id, shipto_num" " FROM shiptoinfo" " WHERE (shipto_cust_id=:cust_id); "); selectedRes.bindValue(":cust_id", _cust->id()); selectedRes.exec(); _customerShipto->populate(selectedRes); } qt-client-4.1.0/guiclient/allocateReservations.h000066400000000000000000000017511217451700100217430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ALLOCATERESERVATIONS_H #define ALLOCATERESERVATIONS_H #include "guiclient.h" #include "xdialog.h" #include "ui_allocateReservations.h" class allocateReservations : public XDialog, public Ui::allocateReservations { Q_OBJECT public: allocateReservations(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~allocateReservations(); public slots: virtual void sAllocate(); protected slots: virtual void sCustomerSelected(); virtual void languageChange(); }; #endif // ALLOCATERESERVATIONS_H qt-client-4.1.0/guiclient/allocateReservations.ui000066400000000000000000000222051217451700100221260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. allocateReservations 0 0 496 317 0 0 Allocate Reservations Selected true false false 5 Selected Customer Ship-To: false 0 0 5 Selected Customer Type: false 0 0 5 Customer Type Pattern: false Qt::StrongFocus Automatically Add to Packing List Batch Qt::Vertical 20 0 Qt::Horizontal 0 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok CustCluster QWidget
custcluster.h
DateCluster QWidget
datecluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_selectedCustomer _selectedCustomerShipto _customerShipto _selectedCustomerType _customerTypes _customerTypePattern _customerType _dates _addPackingList _selectedCustomerShipto toggled(bool) _customerShipto setEnabled(bool) 145 57 226 60 _selectedCustomerType toggled(bool) _customerTypes setEnabled(bool) 130 87 246 89 _customerTypePattern toggled(bool) _customerType setEnabled(bool) 117 109 231 115 _buttonBox rejected() allocateReservations reject() 526 97 286 141 _selectedCustomer toggled(bool) _cust setEnabled(bool) 71 48 237 47
qt-client-4.1.0/guiclient/apAccountAssignment.cpp000066400000000000000000000156271217451700100220620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "errorReporter.h" #include "guiErrorCheck.h" #include "apAccountAssignment.h" #include apAccountAssignment::apAccountAssignment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_selectedVendorType, SIGNAL(toggled(bool)), _vendorTypes, SLOT(setEnabled(bool))); connect(_vendorTypePattern, SIGNAL(toggled(bool)), _vendorType, SLOT(setEnabled(bool))); _vendorTypes->setType(XComboBox::VendorTypes); _ap->setType(GLCluster::cLiability); _prepaid->setType(GLCluster::cAsset); _discount->setType(GLCluster::cRevenue | GLCluster::cExpense); } apAccountAssignment::~apAccountAssignment() { // no need to delete child widgets, Qt does it all for us } void apAccountAssignment::languageChange() { retranslateUi(this); } enum SetResponse apAccountAssignment::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("apaccnt_id", &valid); if (valid) { _apaccntid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _vendorTypeGroup->setEnabled(FALSE); _ap->setReadOnly(TRUE); _prepaid->setReadOnly(TRUE); _discount->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void apAccountAssignment::sSave() { QList errors; if (_metrics->boolean("InterfaceAPToGL")) { errors << GuiErrorCheck(!_ap->isValid(), _ap, tr("

You must select an A/P Account before saving this A/P Account Assignment.")) << GuiErrorCheck(!_prepaid->isValid(), _prepaid, tr("

You must select a Prepaid Account before saving this A/P Account Assignment.")) << GuiErrorCheck(!_discount->isValid(), _discount, tr("

You must select a Discount Account before saving this A/P Account Assignment.")) ; } XSqlQuery saveAssign; if (_mode == cNew) { saveAssign.prepare( "SELECT apaccnt_id " "FROM apaccnt " "WHERE ( (apaccnt_vendtype_id=:apaccnt_vendtype_id)" " AND (apaccnt_vendtype=:apaccnt_vendtype) );" ); if (_allVendorTypes->isChecked()) { saveAssign.bindValue(":apaccnt_vendtype_id", -1); saveAssign.bindValue(":apaccnt_vendtype", ".*"); } else if (_selectedVendorType->isChecked()) { saveAssign.bindValue(":apaccnt_vendtype_id", _vendorTypes->id()); saveAssign.bindValue(":apaccnt_vendtype", ""); } else if (_vendorTypePattern->isChecked()) { saveAssign.bindValue(":apaccnt_vendtype_id", -1); saveAssign.bindValue(":apaccnt_vendtype", _vendorType->text().trimmed()); } saveAssign.exec(); if (saveAssign.first()) { errors << GuiErrorCheck(true, _allVendorTypes, tr("

You may not save this A/P Account Assignment as it already exists.")); } } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save A/P Account Assignment"), errors)) return; if (_mode == cNew) { saveAssign.exec("SELECT NEXTVAL('apaccnt_apaccnt_id_seq') AS _apaccnt_id;"); if (saveAssign.first()) _apaccntid = saveAssign.value("_apaccnt_id").toInt(); // ToDo saveAssign.prepare( "INSERT INTO apaccnt " "( apaccnt_id, apaccnt_vendtype_id, apaccnt_vendtype," " apaccnt_ap_accnt_id, apaccnt_prepaid_accnt_id," " apaccnt_discount_accnt_id ) " "VALUES " "( :apaccnt_id, :apaccnt_vendtype_id, :apaccnt_vendtype," " :apaccnt_ap_accnt_id, :apaccnt_prepaid_accnt_id," " :apaccnt_discount_accnt_id ) " ); } else if (_mode == cEdit) saveAssign.prepare( "UPDATE apaccnt " "SET apaccnt_vendtype_id=:apaccnt_vendtype_id," " apaccnt_vendtype=:apaccnt_vendtype," " apaccnt_ap_accnt_id=:apaccnt_ap_accnt_id," " apaccnt_prepaid_accnt_id=:apaccnt_prepaid_accnt_id," " apaccnt_discount_accnt_id=:apaccnt_discount_accnt_id " "WHERE (apaccnt_id=:apaccnt_id);" ); saveAssign.bindValue(":apaccnt_id", _apaccntid); saveAssign.bindValue(":apaccnt_ap_accnt_id", _ap->id()); saveAssign.bindValue(":apaccnt_prepaid_accnt_id", _prepaid->id()); saveAssign.bindValue(":apaccnt_discount_accnt_id", _discount->id()); if (_allVendorTypes->isChecked()) { saveAssign.bindValue(":apaccnt_vendtype_id", -1); saveAssign.bindValue(":apaccnt_vendtype", ".*"); } else if (_selectedVendorType->isChecked()) { saveAssign.bindValue(":apaccnt_vendtype_id", _vendorTypes->id()); saveAssign.bindValue(":apaccnt_vendtype", ""); } else if (_vendorTypePattern->isChecked()) { saveAssign.bindValue(":apaccnt_vendtype_id", -1); saveAssign.bindValue(":apaccnt_vendtype", _vendorType->text().trimmed()); } saveAssign.exec(); done(_apaccntid); } void apAccountAssignment::populate() { XSqlQuery populateAssign; populateAssign.prepare( "SELECT apaccnt_vendtype_id, apaccnt_vendtype," " apaccnt_ap_accnt_id, apaccnt_prepaid_accnt_id," " apaccnt_discount_accnt_id " "FROM apaccnt " "WHERE (apaccnt_id=:apaccnt_id);" ); populateAssign.bindValue(":apaccnt_id", _apaccntid); populateAssign.exec(); if (populateAssign.first()) { if (populateAssign.value("apaccnt_vendtype_id").toInt() == -1) { if (populateAssign.value("apaccnt_vendtype").toString() == ".*") _allVendorTypes->setChecked(TRUE); else { _vendorTypePattern->setChecked(TRUE); _vendorType->setText(populateAssign.value("apaccnt_vendtype").toString()); } } else { _selectedVendorType->setChecked(TRUE); _vendorTypes->setId(populateAssign.value("apaccnt_vendtype_id").toInt()); } _ap->setId(populateAssign.value("apaccnt_ap_accnt_id").toInt()); _prepaid->setId(populateAssign.value("apaccnt_prepaid_accnt_id").toInt()); _discount->setId(populateAssign.value("apaccnt_discount_accnt_id").toInt()); } } qt-client-4.1.0/guiclient/apAccountAssignment.h000066400000000000000000000021271217451700100215160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APACCOUNTASSIGNMENT_H #define APACCOUNTASSIGNMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_apAccountAssignment.h" class apAccountAssignment : public XDialog, public Ui::apAccountAssignment { Q_OBJECT public: apAccountAssignment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~apAccountAssignment(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _apaccntid; }; #endif // APACCOUNTASSIGNMENT_H qt-client-4.1.0/guiclient/apAccountAssignment.ui000066400000000000000000000151621217451700100217070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. apAccountAssignment 0 0 574 277 Payables Account Assignment All Vendor Types: Selected Vendor Type: false 0 0 Vendor Type Pattern: true true Prepaid Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discount Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Payables Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Vertical QSizePolicy::Expanding 20 0 GLCluster QWidget

glcluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_allVendorTypes _selectedVendorType _vendorTypes _vendorTypePattern _vendorType _ap _prepaid _discount _buttonBox _selectedVendorType toggled(bool) _vendorTypes setEnabled(bool) 20 20 20 20 _vendorTypePattern toggled(bool) _vendorType setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/apAccountAssignments.cpp000066400000000000000000000102271217451700100222340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "apAccountAssignments.h" #include #include #include #include #include "apAccountAssignment.h" apAccountAssignments::apAccountAssignments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _apaccnt->addColumn(tr("Vendor Type"), -1, Qt::AlignCenter,true, "vendtypecode"); _apaccnt->addColumn(tr("A/P Account"), 120, Qt::AlignLeft, true, "apaccnt"); _apaccnt->addColumn(tr("Prepaid Account"), 120, Qt::AlignLeft, true, "prepaidaccnt"); _apaccnt->addColumn(tr("Discount Account"),120, Qt::AlignLeft, true, "discountaccnt"); if (_privileges->check("MaintainVendorAccounts")) { connect(_apaccnt, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_apaccnt, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_apaccnt, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_apaccnt, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } apAccountAssignments::~apAccountAssignments() { // no need to delete child widgets, Qt does it all for us } void apAccountAssignments::languageChange() { retranslateUi(this); } void apAccountAssignments::sPrint() { orReport report("APAssignmentsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void apAccountAssignments::sNew() { ParameterList params; params.append("mode", "new"); apAccountAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void apAccountAssignments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("apaccnt_id", _apaccnt->id()); apAccountAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void apAccountAssignments::sView() { ParameterList params; params.append("mode", "view"); params.append("apaccnt_id", _apaccnt->id()); apAccountAssignment newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void apAccountAssignments::sDelete() { XSqlQuery deleteAssign; deleteAssign.prepare( "DELETE FROM apaccnt " "WHERE (apaccnt_id=:apaccnt_id);" ); deleteAssign.bindValue(":apaccnt_id", _apaccnt->id()); deleteAssign.exec(); sFillList(); } void apAccountAssignments::sFillList() { XSqlQuery fillAssign; fillAssign.prepare( "SELECT apaccnt_id," " CASE WHEN (apaccnt_vendtype='.*') THEN :all" " WHEN (apaccnt_vendtype<> '') THEN apaccnt_vendtype" " ELSE (SELECT vendtype_code FROM vendtype WHERE (vendtype_id=apaccnt_vendtype_id))" " END AS vendtypecode," " CASE WHEN (apaccnt_ap_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(apaccnt_ap_accnt_id) END AS apaccnt," " CASE WHEN (apaccnt_prepaid_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(apaccnt_prepaid_accnt_id) END AS prepaidaccnt," " CASE WHEN (apaccnt_discount_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(apaccnt_discount_accnt_id) END AS discountaccnt " "FROM apaccnt " "ORDER BY vendtypecode;" ); fillAssign.bindValue(":all", tr("All")); fillAssign.exec(); _apaccnt->populate(fillAssign); } qt-client-4.1.0/guiclient/apAccountAssignments.h000066400000000000000000000020751217451700100217030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APACCOUNTASSIGNMENTS_H #define APACCOUNTASSIGNMENTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_apAccountAssignments.h" class apAccountAssignments : public XWidget, public Ui::apAccountAssignments { Q_OBJECT public: apAccountAssignments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~apAccountAssignments(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // APACCOUNTASSIGNMENTS_H qt-client-4.1.0/guiclient/apAccountAssignments.ui000066400000000000000000000111101217451700100220570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. apAccountAssignments 0 0 400 400 List Payables Account Assignments 0 Payables Account Assignments: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
1
_apaccnt _new _view _delete _print _close _close clicked() apAccountAssignments close() 20 20 20 20 _apaccnt valid(bool) _view setEnabled(bool) 20 20 20 20
qt-client-4.1.0/guiclient/apCreditMemoApplication.cpp000066400000000000000000000160031217451700100226360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "apCreditMemoApplication.h" #include #include #include #include #include "storedProcErrorLookup.h" apCreditMemoApplication::apCreditMemoApplication(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _vend->setReadOnly(TRUE); adjustSize(); } apCreditMemoApplication::~apCreditMemoApplication() { // no need to delete child widgets, Qt does it all for us } void apCreditMemoApplication::languageChange() { retranslateUi(this); } enum SetResponse apCreditMemoApplication::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("sourceApopenid", &valid); if (valid) _sourceApopenid = param.toInt(); param = pParams.value("targetApopenid", &valid); if (valid) { _targetApopenid = param.toInt(); populate(); } return NoError; } void apCreditMemoApplication::sSave() { XSqlQuery saveCMA; saveCMA.prepare("SELECT createAPCreditMemoApplication(:source, :target, " " :amount, :curr_id) AS result;"); saveCMA.bindValue(":source", _sourceApopenid); saveCMA.bindValue(":target", _targetApopenid); saveCMA.bindValue(":amount", _amountToApply->localValue()); saveCMA.bindValue(":curr_id", _amountToApply->id()); saveCMA.exec(); if (saveCMA.first()) { int result = saveCMA.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("createApCreditMemoApplication", result), __FILE__, __LINE__); return; } } else if (saveCMA.lastError().type() != QSqlError::NoError) { systemError(this, saveCMA.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void apCreditMemoApplication::populate() { XSqlQuery populateCMA; populateCMA.prepare( "SELECT apopen_vend_id, apopen_docnumber, apopen_doctype," " apopen_docdate, apopen_duedate," " apopen_amount," " apopen_paid," " (apopen_amount - apopen_paid - COALESCE(selected,0.0) - COALESCE(prepared,0.0)) AS f_balance, " " apopen_curr_id " " FROM apopen" " LEFT OUTER JOIN (SELECT apopen_id AS selected_apopen_id," " SUM(currToCurr(apselect_curr_id, apopen_curr_id, apselect_amount + apselect_discount, apselect_date)) AS selected" " FROM apselect JOIN apopen ON (apselect_apopen_id=apopen_id)" " WHERE (apopen_id=:apopen_id)" " GROUP BY apopen_id) AS sub1" " ON (apopen_id=selected_apopen_id)" " LEFT OUTER JOIN (SELECT apopen_id AS prepared_apopen_id," " SUM(currToCurr(checkitem_curr_id, apopen_curr_id, checkitem_amount + checkitem_discount, checkitem_docdate)) AS prepared" " FROM checkhead JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)" " JOIN apopen ON (checkitem_apopen_id=apopen_id)" " WHERE ((NOT checkhead_posted)" " AND (NOT checkhead_void)" " AND (apopen_id=:apopen_id))" " GROUP BY apopen_id) AS sub2" " ON (prepared_apopen_id=apopen_id)" " WHERE (apopen_id=:apopen_id);" ); populateCMA.bindValue(":apopen_id", _targetApopenid); populateCMA.exec(); if (populateCMA.first()) { _vend->setId(populateCMA.value("apopen_vend_id").toInt()); _docNumber->setText(populateCMA.value("apopen_docnumber").toString()); _docType->setText(populateCMA.value("apopen_doctype").toString()); _docDate->setDate(populateCMA.value("apopen_docdate").toDate(), true); _dueDate->setDate(populateCMA.value("apopen_duedate").toDate()); _targetAmount->set(populateCMA.value("apopen_amount").toDouble(), populateCMA.value("apopen_curr_id").toInt(), populateCMA.value("apopen_docdate").toDate(), false); _targetPaid->setLocalValue(populateCMA.value("apopen_paid").toDouble()); _targetBalance->setLocalValue(populateCMA.value("f_balance").toDouble()); } else if (populateCMA.lastError().type() != QSqlError::NoError) systemError(this, populateCMA.lastError().databaseText(), __FILE__, __LINE__); populateCMA.prepare( "SELECT COALESCE(apcreditapply_curr_id,apopen_curr_id) AS curr_id," " currToCurr(apopen_curr_id," " COALESCE(apcreditapply_curr_id,apopen_curr_id)," " apopen_amount - apopen_paid, apopen_docdate) -" " COALESCE(SUM(apcreditapply_amount), 0) AS available," " apopen_docdate " "FROM apopen LEFT OUTER JOIN apcreditapply ON (apcreditapply_source_apopen_id=apopen_id) " "WHERE (apopen_id=:apopen_id) " "GROUP BY apopen_amount, apopen_paid, apopen_docdate," " apcreditapply_curr_id, apopen_curr_id;" ); populateCMA.bindValue(":apopen_id", _sourceApopenid); populateCMA.exec(); if (populateCMA.first()) { _availableToApply->set(populateCMA.value("available").toDouble(), populateCMA.value("curr_id").toInt(), populateCMA.value("apopen_docdate").toDate(), false); } else if (populateCMA.lastError().type() != QSqlError::NoError) systemError(this, populateCMA.lastError().databaseText(), __FILE__, __LINE__); populateCMA.prepare( "SELECT currToCurr(apcreditapply_curr_id, :curr_id, " " apcreditapply_amount, :effective) AS apcreditapply_amount " "FROM apcreditapply " "WHERE ( (apcreditapply_source_apopen_id=:source_apopen_id)" " AND (apcreditapply_target_apopen_id=:target_apopen_id) );" ); populateCMA.bindValue(":source_apopen_id", _sourceApopenid); populateCMA.bindValue(":target_apopen_id", _targetApopenid); populateCMA.bindValue(":curr_id", _amountToApply->id()); populateCMA.bindValue(":effective", _amountToApply->effective()); populateCMA.exec(); if (populateCMA.first()) _amountToApply->setLocalValue(populateCMA.value("apcreditapply_amount").toDouble()); else if (populateCMA.lastError().type() != QSqlError::NoError) systemError(this, populateCMA.lastError().databaseText(), __FILE__, __LINE__); } qt-client-4.1.0/guiclient/apCreditMemoApplication.h000066400000000000000000000022401217451700100223010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APCREDITMEMOAPPLICATION_H #define APCREDITMEMOAPPLICATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_apCreditMemoApplication.h" class apCreditMemoApplication : public XDialog, public Ui::apCreditMemoApplication { Q_OBJECT public: apCreditMemoApplication(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~apCreditMemoApplication(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _sourceApopenid; int _targetApopenid; int _arcreditapplyid; }; #endif // APCREDITMEMOAPPLICATION_H qt-client-4.1.0/guiclient/apCreditMemoApplication.ui000066400000000000000000000403211217451700100224710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. apCreditMemoApplication 0 0 378 419 A/P Credit Memo Application Vendor #: Qt::Horizontal QSizePolicy::Expanding 27 13 Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Apply-To Information 0 0 false 0 0 100 32767 false 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 0 16 0 7 100 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 5 Doc. Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 0 16 0 Doc. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Doc. Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 false false false false false Paid: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 0 20 Available to Apply: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Amount to Apply: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Qt::Horizontal QSizePolicy::Expanding 0 16 CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
DLineEdit QWidget
datecluster.h
1
VendorCluster QWidget
vendorcluster.h
_vend _docDate _dueDate parameter.h _availableToApply idChanged(int) _amountToApply setId(int) 20 20 20 20 _targetAmount idChanged(int) _targetBalance setId(int) 20 20 20 20 _targetAmount idChanged(int) _targetPaid setId(int) 20 20 20 20 _availableToApply effectiveChanged(QDate) _amountToApply setEffective(QDate) 20 20 20 20 _targetAmount effectiveChanged(QDate) _targetBalance setEffective(QDate) 20 20 20 20 _targetAmount effectiveChanged(QDate) _targetPaid setEffective(QDate) 20 20 20 20 _docDate newDate(QDate) _targetAmount setEffective(QDate) 20 20 20 20
qt-client-4.1.0/guiclient/apOpenItem.cpp000066400000000000000000000514471217451700100201550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "apOpenItem.h" #include #include #include #include "taxDetail.h" apOpenItem::apOpenItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_docDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDueDate())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate())); connect(_vend, SIGNAL(newId(int)), this, SLOT(sPopulateVendInfo(int))); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_docNumber, SIGNAL(textEdited(QString)), this, SLOT(sReleaseNumber())); _cAmount = 0.0; _apopenid = -1; _seqiss = 0; _apapply->addColumn( tr("Type"), _dateColumn, Qt::AlignCenter,true, "doctype"); _apapply->addColumn( tr("Doc. #"), -1, Qt::AlignLeft, true, "docnumber"); _apapply->addColumn( tr("Apply Date"), _dateColumn, Qt::AlignCenter,true, "apapply_postdate"); _apapply->addColumn( tr("Amount"), _moneyColumn, Qt::AlignRight, true, "apapply_amount"); _apapply->addColumn( tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "currabbr"); if (omfgThis->singleCurrency()) _apapply->hideColumn("currabbr"); _terms->setType(XComboBox::APTerms); _journalNumber->setEnabled(FALSE); _altAccntid->setType(GLCluster::cRevenue | GLCluster::cExpense); } apOpenItem::~apOpenItem() { // no need to delete child widgets, Qt does it all for us } void apOpenItem::languageChange() { retranslateUi(this); } enum SetResponse apOpenItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("docType", &valid); if (valid) { if (param.toString() == "creditMemo") { setWindowTitle(windowTitle() + tr(" - Enter Misc. Credit Memo")); _docType->setCurrentIndex(0); _status->setEnabled(false); } else if (param.toString() == "debitMemo") { setWindowTitle(windowTitle() + tr(" - Enter Misc. Debit Memo")); _docType->setCurrentIndex(1); } else if (param.toString() == "voucher") _docType->setCurrentIndex(2); else return UndefinedError; // ToDo - better error return types _docType->setEnabled(FALSE); } param = pParams.value("mode", &valid); XSqlQuery setOpenItem; if (valid) { if (param.toString() == "new") { _mode = cNew; setOpenItem.exec("SELECT fetchAPMemoNumber() AS number;"); if (setOpenItem.first()) { _docNumber->setText(setOpenItem.value("number").toString()); _seqiss = setOpenItem.value("number").toInt(); } _paid->clear(); _buttonBox->button(QDialogButtonBox::Save)->setText(tr("Post")); populateStatus(); } else if (param.toString() == "edit") { _mode = cEdit; _vend->setReadOnly(TRUE); _docDate->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _docType->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _poNumber->setEnabled(FALSE); _journalNumber->setEnabled(FALSE); _terms->setEnabled(FALSE); _notes->setReadOnly(FALSE); _useAltPrepaid->setEnabled(FALSE); _altAccntid->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _vend->setReadOnly(TRUE); _docDate->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _docType->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _poNumber->setEnabled(FALSE); _journalNumber->setEnabled(FALSE); _amount->setEnabled(FALSE); _terms->setEnabled(FALSE); _terms->setType(XComboBox::Terms); _notes->setReadOnly(TRUE); _useAltPrepaid->setEnabled(FALSE); _altAccntid->setEnabled(FALSE); _status->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } param = pParams.value("vend_id", &valid); if (valid) _vend->setId(param.toInt()); param = pParams.value("apopen_id", &valid); if (valid) { _apopenid = param.toInt(); populate(); } return NoError; } void apOpenItem::sSave() { XSqlQuery saveOpenItem; if (_mode == cNew) { if (!_docDate->isValid()) { QMessageBox::critical( this, tr("Cannot Save A/P Memo"), tr("

You must enter a date for this A/P Memo " "before you may save it") ); _docDate->setFocus(); return; } if (!_dueDate->isValid()) { QMessageBox::critical( this, tr("Cannot Save A/P Memo"), tr("

You must enter a date for this A/P Memo " "before you may save it") ); _dueDate->setFocus(); return; } if (_amount->isZero()) { QMessageBox::critical( this, tr("Cannot Save A/P Memo"), tr("

You must enter an amount for this A/P Memo " "before you may save it") ); _amount->setFocus(); return; } if(_tax->localValue() > _amount->localValue()) { QMessageBox::critical( this, tr("Cannot Save A/P Memo"), tr("The tax amount may not be greater than the total A/P Memo amount.") ); return; } if (_useAltPrepaid->isChecked() && (!_altAccntid->isValid())) { QMessageBox::critical( this, tr("Cannot Save A/P Memo"), tr("

You must choose a valid Alternate Prepaid " "Account Number for this A/P Memo before you " "may save it.") ); return; } QString tmpFunctionName; QString queryStr; if (_docType->currentIndex() == 0) tmpFunctionName = "createAPCreditMemo"; else if (_docType->currentIndex() == 1) tmpFunctionName = "createAPDebitMemo"; else { systemError(this, tr("Internal Error: _docType has an invalid document type %1") .arg(_docType->currentIndex()), __FILE__, __LINE__); return; } queryStr = "SELECT " + tmpFunctionName + "( :apopen_id, :vend_id, " + (_journalNumber->text().isEmpty() ? QString("fetchJournalNumber('AP-MISC')") : _journalNumber->text()) + ", :apopen_docnumber, :apopen_ponumber, :apopen_docdate," " :apopen_amount, :apopen_notes, :apopen_accnt_id," " :apopen_duedate, :apopen_terms_id, :curr_id ) AS result;"; saveOpenItem.prepare(queryStr); saveOpenItem.bindValue(":vend_id", _vend->id()); saveOpenItem.bindValue(":apopen_docdate", _docDate->date()); } else if (_mode == cEdit) { if (_cAmount != _amount->localValue()) if ( QMessageBox::warning( this, tr("A/P Open Amount Changed"), tr( "

You are changing the open amount of " "this A/P Open Item. If you do not post a " "G/L Transaction to distribute this change " "then the A/P Open Item total will be out " "of balance with the A/P Trial Balance(s). " "Are you sure that you want to save this " "change?" ), tr("Yes"), tr("No"), QString::null ) == 1 ) return; saveOpenItem.prepare( "UPDATE apopen " "SET apopen_doctype=:apopen_doctype," " apopen_ponumber=:apopen_ponumber, apopen_docnumber=:apopen_docnumber," " apopen_amount=:apopen_amount," " apopen_terms_id=:apopen_terms_id, " " apopen_notes=:apopen_notes, " " apopen_curr_id=:curr_id, " " apopen_status = :apopen_status " "WHERE (apopen_id=:apopen_id);" ); } if (_apopenid != -1) saveOpenItem.bindValue(":apopen_id", _apopenid); saveOpenItem.bindValue(":apopen_docnumber", _docNumber->text()); saveOpenItem.bindValue(":apopen_duedate", _dueDate->date()); saveOpenItem.bindValue(":apopen_ponumber", _poNumber->text()); saveOpenItem.bindValue(":apopen_amount", _amount->localValue()); saveOpenItem.bindValue(":apopen_notes", _notes->toPlainText()); saveOpenItem.bindValue(":curr_id", _amount->id()); saveOpenItem.bindValue(":apopen_terms_id", _terms->id()); QString temp; if (_status->id() == 1) temp = "O" ; else temp = "H" ; saveOpenItem.bindValue(":apopen_status", temp); if(_useAltPrepaid->isChecked()) saveOpenItem.bindValue(":apopen_accnt_id", _altAccntid->id()); else saveOpenItem.bindValue(":apopen_accnt_id", -1); switch (_docType->currentIndex()) { case 0: saveOpenItem.bindValue(":apopen_doctype", "C"); break; case 1: saveOpenItem.bindValue(":apopen_doctype", "D"); break; case 2: saveOpenItem.bindValue(":apopen_doctype", "V"); break; } saveOpenItem.exec(); if (saveOpenItem.first()) { if (_mode == cNew) { if (saveOpenItem.value("result").toInt() == -1) { QMessageBox::critical( this, tr("Cannot Create A/P Memo"), tr( "

The A/P Memo cannot be created as there " "are missing A/P Account Assignments for the " "selected Vendor. You must create an A/P " "Account Assignment for the selected " "Vendor's Vendor Type before you may create " "this A/P Memo." ) ); return; } } } else if (saveOpenItem.lastError().type() != QSqlError::NoError) { systemError(this, saveOpenItem.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cEdit) done(_apopenid); else done(saveOpenItem.value("result").toInt()); } void apOpenItem::sClose() { if (_mode == cNew) sReleaseNumber(); reject(); } void apOpenItem::sReleaseNumber() { XSqlQuery releaseOpenItem; if(_seqiss) { releaseOpenItem.prepare("SELECT releaseAPMemoNumber(:docNumber);"); releaseOpenItem.bindValue(":docNumber", _seqiss); releaseOpenItem.exec(); } } void apOpenItem::populate() { populateStatus(); XSqlQuery populateOpenItem; populateOpenItem.prepare( "SELECT apopen_vend_id, apopen_docdate, apopen_duedate," " apopen_doctype, apopen_docnumber," " apopen_ponumber, apopen_journalnumber," " apopen_amount, apopen_paid, " " (apopen_amount - apopen_paid) AS f_balance," " apopen_terms_id, apopen_notes, apopen_accnt_id, " " apopen_curr_id, " " CASE WHEN apopen_status ='O' THEN 1 " " ELSE CASE WHEN apopen_status = 'H' THEN 2 " " END " " END AS status_id, apopen_status, " " (SELECT COALESCE(SUM(taxhist_tax),0) " " FROM apopentax " " WHERE (taxhist_parent_id=apopen_id)) AS tax, " " CASE WHEN (apopen_doctype IN ('D', 'C')) THEN TRUE " " ELSE FALSE " " END AS showTax " "FROM apopen " "WHERE ( (apopen_id=:apopen_id)" " AND (apopen_void = FALSE) );" ); populateOpenItem.bindValue(":apopen_id", _apopenid); populateOpenItem.exec(); if (populateOpenItem.first()) { _vend->setId(populateOpenItem.value("apopen_vend_id").toInt()); _docDate->setDate(populateOpenItem.value("apopen_docdate").toDate(), true); _dueDate->setDate(populateOpenItem.value("apopen_duedate").toDate()); _docNumber->setText(populateOpenItem.value("apopen_docnumber").toString()); _poNumber->setText(populateOpenItem.value("apopen_ponumber").toString()); _journalNumber->setText(populateOpenItem.value("apopen_journalnumber").toString()); _amount->setId(populateOpenItem.value("apopen_curr_id").toInt()); _amount->setLocalValue(populateOpenItem.value("apopen_amount").toDouble()); _paid->setLocalValue(populateOpenItem.value("apopen_paid").toDouble()); _balance->setLocalValue(populateOpenItem.value("f_balance").toDouble()); _terms->setId(populateOpenItem.value("apopen_terms_id").toInt()); if (populateOpenItem.value("apopen_status").toString() == "C") { QString status; status = " SELECT DISTINCT " " CASE WHEN apopen_status ='C' THEN 0 " " END AS status_id, " " CASE WHEN apopen_status ='C' THEN TEXT('Closed') " " END AS status, " " CASE WHEN apopen_status ='C' THEN TEXT('Closed') " " END AS status " " FROM apopen " " WHERE apopen_status <> '' " ; _status->populate(status, -1); _status->setEnabled(FALSE); } _status->setId(populateOpenItem.value("status_id").toInt()); XSqlQuery selectpayment; selectpayment.prepare("SELECT * FROM apselect WHERE apselect_apopen_id = :apopen_id;"); selectpayment.bindValue(":apopen_id", _apopenid); selectpayment.exec(); if (selectpayment.first()) _status->setEnabled(FALSE); _notes->setText(populateOpenItem.value("apopen_notes").toString()); if (populateOpenItem.value("showTax").toBool()) _tax->setLocalValue(populateOpenItem.value("tax").toDouble()); else { _taxLit->hide(); _tax->hide(); } if(!populateOpenItem.value("apopen_accnt_id").isNull() && populateOpenItem.value("apopen_accnt_id").toInt() != -1) { _useAltPrepaid->setChecked(true); _altAccntid->setId(populateOpenItem.value("apopen_accnt_id").toInt()); } QString docType = populateOpenItem.value("apopen_doctype").toString(); if (docType == "C") _docType->setCurrentIndex(0); else if (docType == "D") _docType->setCurrentIndex(1); else if (docType == "V") _docType->setCurrentIndex(2); _cAmount = _amount->localValue(); if ( (docType == "V") || (docType == "D") ) { populateOpenItem.prepare( "SELECT apapply_id, apapply_source_apopen_id," " CASE WHEN (apapply_source_doctype='C') THEN :creditMemo" " WHEN (apapply_source_doctype='K') THEN :check" " ELSE :other" " END AS doctype," " apapply_source_docnumber AS docnumber," " apapply_postdate, apapply_amount," " currConcat(apapply_curr_id) AS currabbr," " 'curr' AS apapply_amount_xtnumericrole " "FROM apapply " "WHERE (apapply_target_apopen_id=:apopen_id) " "ORDER BY apapply_postdate;" ); populateOpenItem.bindValue(":creditMemo", tr("Credit Memo")); populateOpenItem.bindValue(":check", tr("Check")); } else if (docType == "C") { populateOpenItem.prepare( "SELECT apapply_id, apapply_target_apopen_id," " CASE WHEN (apapply_target_doctype='V') THEN :voucher" " WHEN (apapply_target_doctype='D') THEN :debitMemo" " ELSE :other" " END AS doctype," " apapply_target_docnumber AS docnumber," " apapply_postdate, apapply_amount," " currConcat(apapply_curr_id) AS currabbr," " 'curr' AS apapply_amount_xtnumericrole " "FROM apapply " "WHERE (apapply_source_apopen_id=:apopen_id) " "ORDER BY apapply_postdate;" ); populateOpenItem.bindValue(":voucher", tr("Voucher")); populateOpenItem.bindValue(":debitMemo", tr("Debit Memo")); } populateOpenItem.bindValue(":apopen_id", _apopenid); populateOpenItem.bindValue(":other", tr("Other")); populateOpenItem.exec(); if (populateOpenItem.lastError().type() != QSqlError::NoError) systemError(this, populateOpenItem.lastError().databaseText(), __FILE__, __LINE__); _apapply->populate(populateOpenItem, TRUE); if (populateOpenItem.lastError().type() != QSqlError::NoError) { systemError(this, populateOpenItem.lastError().databaseText(), __FILE__, __LINE__); return; } } } void apOpenItem::sPopulateVendInfo(int vend_id) { XSqlQuery vendor; vendor.prepare("SELECT vend_curr_id," " vend_terms_id " " FROM vendinfo" " WHERE(vend_id = :vend_id);"); vendor.bindValue(":vend_id", vend_id); vendor.exec(); if (vendor.first()) { _amount->setId(vendor.value("vend_curr_id").toInt()); _tax->setId(vendor.value("vend_curr_id").toInt()); _terms->setId(vendor.value("vend_terms_id").toInt()); } } void apOpenItem::sPopulateDueDate() { if ( (_terms->isValid()) && (_docDate->isValid()) && (!_dueDate->isValid()) ) { XSqlQuery dueq; dueq.prepare("SELECT determineDueDate(:terms_id, :docDate) AS duedate;"); dueq.bindValue(":terms_id", _terms->id()); dueq.bindValue(":docDate", _docDate->date()); dueq.exec(); if (dueq.first()) _dueDate->setDate(dueq.value("duedate").toDate()); else if (dueq.lastError().type() != QSqlError::NoError) { systemError(this, dueq.lastError().databaseText(), __FILE__, __LINE__); return; } } } void apOpenItem::sTaxDetail() { XSqlQuery ap; if (_apopenid == -1) { if (!_docDate->isValid() || !_dueDate->isValid()) { QMessageBox::critical( this, tr("Cannot set tax amounts"), tr("You must enter document and due dates for this A/P Memo before you may set tax amounts.") ); _docDate->setFocus(); return; } ap.prepare("SELECT nextval('apopen_apopen_id_seq') AS result;"); ap.exec(); if (ap.first()) _apopenid = ap.value("result").toInt(); else if (ap.lastError().type() != QSqlError::NoError) { systemError(this, ap.lastError().databaseText(), __FILE__, __LINE__); return; } else return; ap.prepare("INSERT INTO apopen " "( apopen_id, apopen_docdate, apopen_duedate, apopen_doctype, " " apopen_docnumber, apopen_curr_id, apopen_posted, apopen_amount ) " "VALUES " "( :apopen_id, :docDate, :dueDate, :docType, :docNumber, :currId, false, 0 ); "); ap.bindValue(":apopen_id",_apopenid); ap.bindValue(":docDate", _docDate->date()); ap.bindValue(":dueDate", _dueDate->date()); if (_docType->currentIndex()) ap.bindValue(":docType", "D" ); else ap.bindValue(":docType", "C" ); ap.bindValue(":docNumber", _docNumber->text()); ap.bindValue(":currId", _amount->id()); ap.exec(); if (ap.lastError().type() != QSqlError::NoError) { ap.exec("ROLLBACK;"); systemError(this, ap.lastError().databaseText(), __FILE__, __LINE__); return; } } taxDetail newdlg(this, "", true); ParameterList params; params.append("curr_id", _tax->id()); params.append("date", _tax->effective()); if (_mode != cNew) params.append("readOnly"); ap.exec("SELECT getadjustmenttaxtypeid() as taxtype;"); if(ap.first()) params.append("taxtype_id", ap.value("taxtype").toInt()); params.append("order_type", "AP"); params.append("order_id", _apopenid); params.append("display_type", "A"); params.append("subtotal", _amount->localValue()); params.append("adjustment"); if (_docType->currentIndex()) params.append("sense",-1); if (newdlg.set(params) == NoError) { newdlg.exec(); XSqlQuery taxq; taxq.prepare( "SELECT SUM(taxhist_tax) AS tax " "FROM apopentax " "WHERE (taxhist_parent_id=:apopen_id);" ); taxq.bindValue(":apopen_id", _apopenid); taxq.exec(); if (taxq.first()) { if (_docType->currentIndex()) _tax->setLocalValue(taxq.value("tax").toDouble() * -1); else _tax->setLocalValue(taxq.value("tax").toDouble()); } else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } } } void apOpenItem::populateStatus() { QString status; status = "SELECT 1 AS status_id, TEXT('Open') AS status, TEXT('Open') AS status " "UNION " "SELECT 2 AS status_id, TEXT('On Hold') AS status, TEXT('On Hold') AS status;"; _status->populate(status, -1); } qt-client-4.1.0/guiclient/apOpenItem.h000066400000000000000000000024121217451700100176060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APOPENITEM_H #define APOPENITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_apOpenItem.h" class apOpenItem : public XDialog, public Ui::apOpenItem { Q_OBJECT public: apOpenItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~apOpenItem(); virtual void populate(); virtual void populateStatus(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sClose(); virtual void sPopulateVendInfo( int vend_id ); virtual void sPopulateDueDate(); virtual void sTaxDetail(); virtual void sReleaseNumber(); protected slots: virtual void languageChange(); private: int _mode; int _apopenid; double _cAmount; int _seqiss; }; #endif // APOPENITEM_H qt-client-4.1.0/guiclient/apOpenItem.ui000066400000000000000000000510021217451700100177730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. apOpenItem 0 0 600 547 A/P Open Item 5 0 Vendor #: Qt::Horizontal QSizePolicy::Expanding 104 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Document Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 100 20 Status: Qt::AlignCenter Document Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Credit Memo Debit Memo Voucher Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::AlignRight P/O #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::AlignRight Journal #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::AlignRight Qt::Vertical 20 40 Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Paid: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Vertical 20 0 false Tax: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 0 1 0 Notes 0 0 true Account 0 0 false false Alternate Prepaid Account: false Qt::Vertical 20 0 Use Alternate Prepaid Account Applications 0 0 0 100 CurrCluster CurrDisplay

currcluster.h
CurrDisplay QWidget
currcluster.h
DLineEdit QWidget
datecluster.h
1
GLCluster QWidget
glcluster.h
VendorCluster QWidget
vendorcluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
XURLLabel QLabel
xurllabel.h
XTextEdit QTextEdit
xtextedit.h
_vend _docDate _dueDate _docType _docNumber _poNumber _journalNumber _terms _amount _altAccntid _notes _apapply _paid _amount idChanged(int) _paid setId(int) 20 20 20 20 _amount idChanged(int) _balance setId(int) 20 20 20 20 _amount effectiveChanged(QDate) _paid setEffective(QDate) 20 20 20 20 _amount effectiveChanged(QDate) _balance setEffective(QDate) 20 20 20 20 _docDate newDate(QDate) _amount setEffective(QDate) 20 20 20 20 _useAltPrepaid toggled(bool) _altAccntid setEnabled(bool) 290 451 374 493 _amount idChanged(int) _tax setId(int) 476 228 476 336 _amount effectiveChanged(QDate) _tax setEffective(QDate) 476 228 476 336 qt-client-4.1.0/guiclient/apWorkBench.cpp000066400000000000000000000064541217451700100203150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "apWorkBench.h" #include #include #include "openVouchers.h" #include "selectPayments.h" #include "selectedPayments.h" #include "viewCheckRun.h" #include "unappliedAPCreditMemos.h" apWorkBench::apWorkBench(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); QWidget *hideme = 0; _vouchers = new openVouchers(this, "openVouchers", Qt::Widget); _vouchersTab->layout()->addWidget(_vouchers); hideme = _vouchers->findChild("_close"); if (hideme) hideme->hide(); _vouchers->show(); _vendorgroup->synchronize((VendorGroup*)(_vouchers->findChild("_vendorgroup"))); _payables = new selectPayments(this, "selectPayments", Qt::Widget, false); _payablesTab->layout()->addWidget(_payables); hideme = _payables->findChild("_close"); if (hideme) hideme->hide(); _payables->show(); _vendorgroup->synchronize((VendorGroup*)(_payables->findChild("_vendorgroup"))); _credits = new unappliedAPCreditMemos(this, "creditMemos", Qt::Widget); _creditsTab->layout()->addWidget(_credits); hideme = _credits->findChild("_close"); if (hideme) hideme->hide(); _credits->show(); _vendorgroup->synchronize((VendorGroup*)(_credits->findChild("_vendorgroup"))); _selectedPayments = new selectedPayments(this, "selectedPayments", Qt::Widget); _selectionsTab->layout()->addWidget(_selectedPayments); hideme = _selectedPayments->findChild("_close"); if (hideme) hideme->hide(); _selectedPayments->show(); _vendorgroup->synchronize((VendorGroup*)(_selectedPayments->findChild("_vendorgroup"))); QWidget * _checkRun = new viewCheckRun(this, "viewCheckRun", Qt::Widget); _checkRunTab->layout()->addWidget(_checkRun); hideme = _checkRun->findChild("_close"); if (hideme) hideme->hide(); _checkRun->setWindowFlags(Qt::Widget); _checkRun->show(); _vendorgroup->synchronize((VendorGroup*)(_checkRun->findChild("_vendorgroup"))); if (!_privileges->check("MaintainPayments")) _checkRun->setEnabled(false); connect(_query, SIGNAL(clicked()), _vouchers, SLOT(sFillList())); connect(_query, SIGNAL(clicked()), _payables, SLOT(sFillList())); connect(_query, SIGNAL(clicked()), _credits, SLOT(sFillList())); connect(_query, SIGNAL(clicked()), _selectedPayments, SLOT(sFillList())); connect(_query, SIGNAL(clicked()), _checkRun, SLOT(sFillList())); _payables->sFillList(); } apWorkBench::~apWorkBench() { // no need to delete child widgets, Qt does it all for us } void apWorkBench::languageChange() { retranslateUi(this); } enum SetResponse apWorkBench::set(const ParameterList & pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) _vendorgroup->setVendId(param.toInt()); return NoError; } qt-client-4.1.0/guiclient/apWorkBench.h000066400000000000000000000024251217451700100177540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APWORKBENCH_H #define APWORKBENCH_H #include "guiclient.h" #include "xwidget.h" #include #include #include "ui_apWorkBench.h" class openVouchers; class selectPayments; class selectedPayments; class unappliedAPCreditMemos; class viewCheckRun; #include "vendorgroup.h" class apWorkBench : public XWidget, public Ui::apWorkBench { Q_OBJECT public: apWorkBench(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~apWorkBench(); virtual SetResponse set(const ParameterList & pParams); protected slots: virtual void languageChange(); protected: viewCheckRun *_checkRun; unappliedAPCreditMemos *_credits; selectPayments *_payables; openVouchers *_vouchers; selectedPayments *_selectedPayments; }; #endif // APWORKBENCH_H qt-client-4.1.0/guiclient/apWorkBench.ui000066400000000000000000000131371217451700100201440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. apWorkBench 0 0 800 600 Payables Workbench 12 12 Qt::Horizontal 161 48 Qt::Vertical 20 0 0 &Close false false &Query Qt::Vertical 20 0 0 1 0 Open Vouchers Payables Credits Selections Checks CurrDisplay QWidget
currcluster.h
VendorGroup QWidget
vendorgroup.h
XLabel QLabel
xlabel.h
_tab _close _apopenTotal _close clicked() apWorkBench close() 794 70 20 20
qt-client-4.1.0/guiclient/applyAPCreditMemo.cpp000066400000000000000000000244351217451700100214300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "applyAPCreditMemo.h" #include #include #include #include "apCreditMemoApplication.h" #include "storedProcErrorLookup.h" applyAPCreditMemo::applyAPCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_apply, SIGNAL(clicked()), this, SLOT(sApply())); connect(_applyToBalance, SIGNAL(clicked()), this, SLOT(sApplyBalance())); connect(_available, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup())); connect(_clear, SIGNAL(clicked()), this, SLOT(sClear())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sPost())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _buttonBox->button(QDialogButtonBox::Save)->setText(tr("Post")); _captive = FALSE; _apopen->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter,true, "doctype"); _apopen->addColumn(tr("Doc. Number"), -1, Qt::AlignCenter,true, "apopen_docnumber"); _apopen->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter,true, "apopen_docdate"); _apopen->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter,true, "apopen_duedate"); _apopen->addColumn(tr("Open"), _moneyColumn, Qt::AlignRight, true, "openamount"); _apopen->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "opencurrabbr"); _apopen->addColumn(tr("Applied"), _moneyColumn, Qt::AlignRight, true, "apcreditapply_amount"); _apopen->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "appliedcurrabbr"); if (_privileges->check("ApplyAPMemos")) connect(_apopen, SIGNAL(valid(bool)), _apply, SLOT(setEnabled(bool))); if (omfgThis->singleCurrency()) { _apopen->hideColumn("opencurrabbr"); _apopen->hideColumn("appliedcurrabbr"); } _vend->setReadOnly(TRUE); sPriceGroup(); adjustSize(); } applyAPCreditMemo::~applyAPCreditMemo() { // no need to delete child widgets, Qt does it all for us } void applyAPCreditMemo::languageChange() { retranslateUi(this); } enum SetResponse applyAPCreditMemo::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("apopen_id", &valid); if (valid) { _captive = TRUE; _apopenid = param.toInt(); populate(); } return NoError; } void applyAPCreditMemo::sPost() { XSqlQuery applyPost; applyPost.exec("BEGIN;"); if (applyPost.lastError().type() != QSqlError::NoError) { systemError(this, applyPost.lastError().databaseText(), __FILE__, __LINE__); return; } applyPost.prepare("SELECT postAPCreditMemoApplication(:apopen_id) AS result;"); applyPost.bindValue(":apopen_id", _apopenid); applyPost.exec(); if (applyPost.first()) { int result = applyPost.value("result").toInt(); if (result < 0) { applyPost.exec("ROLLBACK;"); systemError(this, storedProcErrorLookup("postAPCreditMemoApplication", result), __FILE__, __LINE__); return; } } else if (applyPost.lastError().type() != QSqlError::NoError) { QString msg = applyPost.lastError().databaseText(); applyPost.exec("ROLLBACK;"); systemError(this, msg, __FILE__, __LINE__); return; } applyPost.exec("COMMIT;"); if (applyPost.lastError().type() != QSqlError::NoError) { systemError(this, applyPost.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void applyAPCreditMemo::sApplyBalance() { XSqlQuery applyApplyBalance; applyApplyBalance.prepare("SELECT applyAPCreditMemoToBalance(:apopen_id) AS result;"); applyApplyBalance.bindValue(":apopen_id", _apopenid); applyApplyBalance.exec(); if (applyApplyBalance.first()) { int result = applyApplyBalance.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("applyAPCreditMemoToBalance", result), __FILE__, __LINE__); return; } } else if (applyApplyBalance.lastError().type() != QSqlError::NoError) { systemError(this, applyApplyBalance.lastError().databaseText(), __FILE__, __LINE__); return; } populate(); } void applyAPCreditMemo::sApply() { ParameterList params; params.append("sourceApopenid", _apopenid); params.append("targetApopenid", _apopen->id()); apCreditMemoApplication newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) populate(); } void applyAPCreditMemo::sClear() { XSqlQuery applyClear; applyClear.prepare( "DELETE FROM apcreditapply " "WHERE ( (apcreditapply_source_apopen_id=:sourceApopenid) " " AND (apcreditapply_target_apopen_id=:targetApopenid) );" ); applyClear.bindValue(":sourceApopenid", _apopenid); applyClear.bindValue(":targetApopenid", _apopen->id()); applyClear.exec(); if (applyClear.lastError().type() != QSqlError::NoError) systemError(this, applyClear.lastError().databaseText(), __FILE__, __LINE__); populate(); } void applyAPCreditMemo::sClose() { XSqlQuery applyClose; applyClose.prepare( "DELETE FROM apcreditapply " "WHERE (apcreditapply_source_apopen_id=:sourceApopenid);" ); applyClose.bindValue(":sourceApopenid", _apopenid); applyClose.exec(); if (applyClose.lastError().type() != QSqlError::NoError) { systemError(this, applyClose.lastError().databaseText(), __FILE__, __LINE__); return; } reject(); } void applyAPCreditMemo::populate() { XSqlQuery applypopulate; applypopulate.prepare( "SELECT apopen_vend_id, apopen_docnumber, apopen_docdate," " (apopen_amount - apopen_paid) AS available, apopen_curr_id, " " COALESCE(SUM(currToCurr(apcreditapply_curr_id," " apopen_curr_id, apcreditapply_amount, " " CURRENT_DATE)), 0) AS f_applied " "FROM apopen LEFT OUTER JOIN apcreditapply ON (apcreditapply_source_apopen_id=apopen_id) " "WHERE (apopen_id=:apopen_id) " "GROUP BY apopen_vend_id, apopen_docnumber, apopen_docdate," " apopen_curr_id, apopen_amount, apopen_paid;" ); applypopulate.bindValue(":apopen_id", _apopenid); applypopulate.exec(); if (applypopulate.first()) { _vend->setId(applypopulate.value("apopen_vend_id").toInt()); _docDate->setDate(applypopulate.value("apopen_docdate").toDate(), true); _available->setId(applypopulate.value("apopen_curr_id").toInt()); _available->setLocalValue(applypopulate.value("available").toDouble()); _applied->setLocalValue(applypopulate.value("f_applied").toDouble()); _balance->setLocalValue(_available->localValue() - _applied->localValue()); _docNumber->setText(applypopulate.value("apopen_docnumber").toString()); _cachedAmount = applypopulate.value("available").toDouble(); } else if (applypopulate.lastError().type() != QSqlError::NoError) systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__); applypopulate.prepare( "SELECT apopen_id," " CASE WHEN (apopen_doctype='V') THEN :voucher" " WHEN (apopen_doctype='D') THEN :debitMemo" " END AS doctype," " apopen_docnumber," " apopen_docdate, apopen_duedate," " (apopen_amount - apopen_paid - COALESCE(selected,0.0) -" " COALESCE(prepared,0.0)) AS openamount," " currConcat(apopen_curr_id) AS opencurrabbr, " " apcreditapply_amount, " " currConcat(apcreditapply_curr_id) AS appliedcurrabbr," " 'curr' AS openamount_xtnumericrole," " 'curr' AS apcreditapply_amount_xtnumericrole" " FROM apopen LEFT OUTER JOIN apcreditapply " " ON ( (apcreditapply_source_apopen_id=:parentApopenid) AND (apcreditapply_target_apopen_id=apopen_id) ) " " LEFT OUTER JOIN (SELECT apopen_id AS selected_apopen_id," " SUM(currToCurr(apselect_curr_id, apopen_curr_id, apselect_amount + apselect_discount, apselect_date)) AS selected" " FROM apselect JOIN apopen ON (apselect_apopen_id=apopen_id)" " GROUP BY apopen_id) AS sub1" " ON (apopen_id=selected_apopen_id)" " LEFT OUTER JOIN (SELECT apopen_id AS prepared_apopen_id," " SUM(checkitem_amount + checkitem_discount) AS prepared" " FROM checkhead JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)" " JOIN apopen ON (checkitem_apopen_id=apopen_id)" " WHERE ((NOT checkhead_posted)" " AND (NOT checkhead_void))" " GROUP BY apopen_id) AS sub2" " ON (prepared_apopen_id=apopen_id)" " WHERE ( (apopen_doctype IN ('V', 'D'))" " AND (apopen_open)" " AND ((apopen_amount - apopen_paid - COALESCE(selected,0.0) - COALESCE(prepared,0.0)) > 0.0)" " AND (apopen_vend_id=:vend_id) ) " " ORDER BY apopen_duedate, apopen_docnumber;" ); applypopulate.bindValue(":parentApopenid", _apopenid); applypopulate.bindValue(":vend_id", _vend->id()); applypopulate.bindValue(":voucher", tr("Voucher")); applypopulate.bindValue(":debitMemo", tr("Debit Memo")); applypopulate.exec(); _apopen->populate(applypopulate); if (applypopulate.lastError().type() != QSqlError::NoError) systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__); } void applyAPCreditMemo::sPriceGroup() { if (! omfgThis->singleCurrency()) _priceGroup->setTitle(tr("In %1:").arg(_available->currAbbr())); } qt-client-4.1.0/guiclient/applyAPCreditMemo.h000066400000000000000000000024231217451700100210660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APPLYAPCREDITMEMO_H #define APPLYAPCREDITMEMO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_applyAPCreditMemo.h" class applyAPCreditMemo : public XDialog, public Ui::applyAPCreditMemo { Q_OBJECT public: applyAPCreditMemo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~applyAPCreditMemo(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sPost(); virtual void sApplyBalance(); virtual void sApply(); virtual void sClear(); virtual void sClose(); virtual void sPriceGroup(); protected slots: virtual void languageChange(); private: bool _captive; int _apopenid; double _cachedAmount; double _cachedApplied; }; #endif // APPLYAPCREDITMEMO_H qt-client-4.1.0/guiclient/applyAPCreditMemo.ui000066400000000000000000000261211217451700100212550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. applyAPCreditMemo 0 0 588 440 Apply A/P Credit Memo Vendor #: Qt::Horizontal QSizePolicy::Expanding 0 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 11 Available to Apply: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Applied: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 100 0 Qt::Horizontal QSizePolicy::Expanding 36 10 Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 false 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 25 16 Qt::Vertical 16 13 Apply to &Balance false &Apply false Clear Application Qt::Vertical QSizePolicy::Expanding 13 0 CurrDisplay QWidget
currcluster.h
DLineEdit QWidget
datecluster.h
1
VendorCluster QWidget
vendorcluster.h
XTreeWidget QTreeWidget
xtreewidget.h
1
_vend _docDate _apopen _applyToBalance _apply _clear _apopen valid(bool) _apply setEnabled(bool) 20 20 20 20 _apopen valid(bool) _clear setEnabled(bool) 20 20 20 20 _docDate newDate(QDate) _available setEffective(QDate) 20 20 20 20 _available idChanged(int) _applied setId(int) 20 20 20 20 _available idChanged(int) _balance setId(int) 20 20 20 20 _available effectiveChanged(QDate) _applied setEffective(QDate) 20 20 20 20 _available effectiveChanged(QDate) _balance setEffective(QDate) 20 20 20 20
qt-client-4.1.0/guiclient/applyARCreditMemo.cpp000066400000000000000000000256701217451700100214340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "applyARCreditMemo.h" #include #include #include #include #include "arCreditMemoApplication.h" #include "mqlutil.h" #include "storedProcErrorLookup.h" applyARCreditMemo::applyARCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_apply, SIGNAL(clicked()), this, SLOT(sApply())); connect(_applyLineBalance, SIGNAL(clicked()), this, SLOT(sApplyLineBalance())); connect(_applyToBalance, SIGNAL(clicked()), this, SLOT(sApplyBalance())); connect(_available, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup())); connect(_clear, SIGNAL(clicked()), this, SLOT(sClear())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sPost())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_searchDocNum, SIGNAL(textChanged(const QString&)), this, SLOT(sSearchDocNumChanged(const QString&))); _buttonBox->button(QDialogButtonBox::Save)->setText(tr("Post")); _captive = FALSE; _aropen->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter, true, "doctype"); _aropen->addColumn(tr("Doc. Number"), -1, Qt::AlignCenter, true, "aropen_docnumber"); _aropen->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, true, "aropen_docdate"); _aropen->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "aropen_duedate"); _aropen->addColumn(tr("Open"), _moneyColumn, Qt::AlignRight, true, "balance"); _aropen->addColumn(tr("Currency"), _currencyColumn,Qt::AlignLeft, !omfgThis->singleCurrency(), "balance_curr"); _aropen->addColumn(tr("Applied"), _moneyColumn, Qt::AlignRight, true, "applied"); _aropen->addColumn(tr("Currency"), _currencyColumn,Qt::AlignLeft, !omfgThis->singleCurrency(), "applied_curr"); _aropen->addColumn(tr("All Pending"), _moneyColumn, Qt::AlignRight, true, "pending"); _aropen->addColumn(tr("Currency"), _currencyColumn,Qt::AlignLeft, !omfgThis->singleCurrency(), "balance_curr"); _cust->setReadOnly(TRUE); if(_metrics->boolean("HideApplyToBalance")) _applyToBalance->hide(); sPriceGroup(); adjustSize(); } applyARCreditMemo::~applyARCreditMemo() { // no need to delete child widgets, Qt does it all for us } void applyARCreditMemo::languageChange() { retranslateUi(this); } enum SetResponse applyARCreditMemo::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("aropen_id", &valid); if (valid) { _captive = TRUE; _aropenid = param.toInt(); populate(); } return NoError; } void applyARCreditMemo::sPost() { XSqlQuery applyPost; populate(); // repeat in case someone else has updated applications XSqlQuery rollback; rollback.prepare("ROLLBACK;"); applyPost.exec("BEGIN;"); if (applyPost.lastError().type() != QSqlError::NoError) { systemError(this, applyPost.lastError().databaseText(), __FILE__, __LINE__); return; } applyPost.prepare("SELECT postARCreditMemoApplication(:aropen_id) AS result;"); applyPost.bindValue(":aropen_id", _aropenid); applyPost.exec(); if (applyPost.first()) { QString msg; int result = applyPost.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postARCreditMemoApplication", result), __FILE__, __LINE__); return; } } else if (applyPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, applyPost.lastError().databaseText(), __FILE__, __LINE__); return; } applyPost.exec("COMMIT;"); if (applyPost.lastError().type() != QSqlError::NoError) { systemError(this, applyPost.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void applyARCreditMemo::sApplyBalance() { XSqlQuery applyApplyBalance; applyApplyBalance.prepare("SELECT applyARCreditMemoToBalance(:aropen_id) AS result;"); applyApplyBalance.bindValue(":aropen_id", _aropenid); applyApplyBalance.exec(); if (applyApplyBalance.first()) { int result = applyApplyBalance.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("applyARCreditMemoToBalance", result)); return; } } else if (applyApplyBalance.lastError().type() != QSqlError::NoError) { systemError(this, applyApplyBalance.lastError().databaseText(), __FILE__, __LINE__); return; } populate(); } void applyARCreditMemo::sApplyLineBalance() { XSqlQuery applyApplyLineBalance; applyApplyLineBalance.prepare("SELECT applyARCreditMemoToBalance(:sourceAropenid, :targetAropenid) AS result;"); applyApplyLineBalance.bindValue(":sourceAropenid", _aropenid); applyApplyLineBalance.bindValue(":targetAropenid", _aropen->id()); applyApplyLineBalance.exec(); if (applyApplyLineBalance.first()) { int result = applyApplyLineBalance.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("applyARCreditMemoToBalance", result)); return; } } else if (applyApplyLineBalance.lastError().type() != QSqlError::NoError) { systemError(this, applyApplyLineBalance.lastError().databaseText(), __FILE__, __LINE__); return; } populate(); } void applyARCreditMemo::sApply() { ParameterList params; params.append("sourceAropenid", _aropenid); params.append("targetAropenid", _aropen->id()); arCreditMemoApplication newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) populate(); } void applyARCreditMemo::sClear() { XSqlQuery applyClear; applyClear.prepare( "DELETE FROM arcreditapply " "WHERE ( (arcreditapply_source_aropen_id=:sourceAropenid) " " AND (arcreditapply_target_aropen_id=:targetAropenid) );" ); applyClear.bindValue(":sourceAropenid", _aropenid); applyClear.bindValue(":targetAropenid", _aropen->id()); applyClear.exec(); if (applyClear.lastError().type() != QSqlError::NoError) systemError(this, applyClear.lastError().databaseText(), __FILE__, __LINE__); populate(); } void applyARCreditMemo::sClose() { XSqlQuery applyClose; applyClose.prepare( "DELETE FROM arcreditapply " "WHERE (arcreditapply_source_aropen_id=:sourceAropenid);" ); applyClose.bindValue(":sourceAropenid", _aropenid); applyClose.exec(); if (applyClose.lastError().type() != QSqlError::NoError) systemError(this, applyClose.lastError().databaseText(), __FILE__, __LINE__); reject(); } void applyARCreditMemo::populate() { XSqlQuery applypopulate; applypopulate.prepare( "SELECT aropen_cust_id, aropen_docnumber, aropen_docdate," " (aropen_amount - aropen_paid - COALESCE(prepared,0.0) - COALESCE(cashapplied,0.0)) AS available," " COALESCE(SUM(currToCurr(arcreditapply_curr_id, " " aropen_curr_id, " " arcreditapply_amount, " " current_date)), 0) AS f_applied, " " aropen_curr_id " "FROM aropen LEFT OUTER JOIN arcreditapply ON (arcreditapply_source_aropen_id=aropen_id) " " LEFT OUTER JOIN (SELECT aropen_id AS prepared_aropen_id," " COALESCE(SUM(checkitem_amount + checkitem_discount),0) AS prepared" " FROM checkhead JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)" " JOIN aropen ON (checkitem_aropen_id=aropen_id)" " WHERE ((NOT checkhead_posted)" " AND (NOT checkhead_void))" " GROUP BY aropen_id) AS sub1" " ON (prepared_aropen_id=aropen_id)" " LEFT OUTER JOIN (SELECT aropen_id AS cash_aropen_id," " SUM(cashrcptitem_amount + cashrcptitem_discount) * -1.0 AS cashapplied" " FROM cashrcpt JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)" " JOIN aropen ON (cashrcptitem_aropen_id=aropen_id)" " WHERE ((NOT cashrcpt_posted)" " AND (NOT cashrcpt_void))" " GROUP BY aropen_id ) AS sub2" " ON (cash_aropen_id=aropen_id)" "WHERE (aropen_id=:aropen_id) " "GROUP BY aropen_cust_id, aropen_docnumber, aropen_docdate," " aropen_amount, aropen_paid, aropen_curr_id, prepared, cashapplied;" ); applypopulate.bindValue(":aropen_id", _aropenid); applypopulate.exec(); if (applypopulate.first()) { _available->set(applypopulate.value("available").toDouble(), applypopulate.value("aropen_curr_id").toInt(), applypopulate.value("aropen_docdate").toDate(), false); _cust->setId(applypopulate.value("aropen_cust_id").toInt()); _applied->setLocalValue(applypopulate.value("f_applied").toDouble()); _balance->setLocalValue(_available->localValue() - _applied->localValue()); _docNumber->setText(applypopulate.value("aropen_docnumber").toString()); _docDate->setDate(applypopulate.value("aropen_docdate").toDate(), true); } else systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__); MetaSQLQuery mql = mqlLoad("arOpenApplications", "detail"); ParameterList params; params.append("cust_id", _cust->id()); params.append("debitMemo", tr("Debit Memo")); params.append("invoice", tr("Invoice")); params.append("source_aropen_id", _aropenid); applypopulate = mql.toQuery(params); _aropen->populate(applypopulate); if (applypopulate.lastError().type() != QSqlError::NoError) { systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void applyARCreditMemo::sPriceGroup() { if (! omfgThis->singleCurrency()) _priceGroup->setTitle(tr("In %1:").arg(_available->currAbbr())); } void applyARCreditMemo::sSearchDocNumChanged(const QString &pTarget) { _aropen->clearSelection(); if (pTarget.isEmpty()) return; int i; for (i = 0; i < _aropen->topLevelItemCount(); i++) { if (_aropen->topLevelItem(i)->text(1).startsWith(pTarget)) break; } if (i < _aropen->topLevelItemCount()) { _aropen->setCurrentItem(_aropen->topLevelItem(i)); _aropen->scrollToItem(_aropen->topLevelItem(i)); } } qt-client-4.1.0/guiclient/applyARCreditMemo.h000066400000000000000000000025101217451700100210650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APPLYARCREDITMEMO_H #define APPLYARCREDITMEMO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_applyARCreditMemo.h" class applyARCreditMemo : public XDialog, public Ui::applyARCreditMemo { Q_OBJECT public: applyARCreditMemo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~applyARCreditMemo(); virtual void populate(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPost(); virtual void sApplyBalance(); virtual void sApplyLineBalance(); virtual void sApply(); virtual void sClear(); virtual void sClose(); virtual void sPriceGroup(); protected slots: virtual void languageChange(); virtual void sSearchDocNumChanged(const QString &); private: int _aropenid; bool _captive; }; #endif // APPLYARCREDITMEMO_H qt-client-4.1.0/guiclient/applyARCreditMemo.ui000066400000000000000000000337301217451700100212630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. applyARCreditMemo 0 0 567 481 Apply A/R Credit Memo Qt::Horizontal QSizePolicy::Expanding 0 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 5 5 false false Available to Apply: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Applied: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Credit Information Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 100 0 Qt::Horizontal QSizePolicy::Expanding 0 10 Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 false 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 0 16 Qt::Vertical 17 18 5 Find Document: 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Apply to &Balance false &Apply false Apply Line Bal. false Clear Application Qt::Vertical QSizePolicy::Expanding 13 26 CurrDisplay QWidget
currcluster.h
CustCluster QWidget
custcluster.h
DLineEdit QWidget
datecluster.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
_cust _docDate _searchDocNum _aropen _applyToBalance _apply _clear _aropen valid(bool) _apply setEnabled(bool) 20 20 20 20 _aropen valid(bool) _clear setEnabled(bool) 20 20 20 20 _available idChanged(int) _applied setId(int) 20 20 20 20 _available idChanged(int) _balance setId(int) 20 20 20 20 _available effectiveChanged(QDate) _applied setEffective(QDate) 20 20 20 20 _available effectiveChanged(QDate) _balance setEffective(QDate) 20 20 20 20 _docDate newDate(QDate) _available setEffective(QDate) 20 20 20 20 _aropen itemSelected(int) _apply animateClick() 206 352 443 302 _aropen valid(bool) _applyLineBalance setEnabled(bool) 203 356 468 337
qt-client-4.1.0/guiclient/applyARDiscount.cpp000066400000000000000000000102001217451700100211530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "applyARDiscount.h" #include #include applyARDiscount::applyARDiscount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sApply())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _discprcnt->setPrecision(omfgThis->percentVal()); _aropenid = -1; adjustSize(); } applyARDiscount::~applyARDiscount() { // no need to delete child widgets, Qt does it all for us } void applyARDiscount::languageChange() { retranslateUi(this); } enum SetResponse applyARDiscount::set( const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("aropen_id", &valid); if (valid) { _aropenid = param.toInt(); populate(); } param = pParams.value("curr_id", &valid); if (valid) _amount->setId(param.toInt()); param = pParams.value("amount", &valid); if (valid) _amount->setLocalValue(param.toDouble()); return NoError; } void applyARDiscount::sApply() { accept(); } void applyARDiscount::populate() { XSqlQuery applypopulate; applypopulate.prepare("SELECT cust_name, aropen_docnumber, aropen_docdate," " CASE WHEN (aropen_doctype='I') THEN :invoice " " WHEN (aropen_doctype='C') THEN :creditmemo " " ELSE aropen_doctype " " END AS f_doctype, " " (terms_code || '-' || terms_descrip) AS f_terms, " " determineDiscountDate(terms_id, aropen_docdate) AS discdate, " " terms_discprcnt, applied, " " aropen_amount,aropen_curr_id, " " (determineDiscountDate(terms_id, aropen_docdate) < CURRENT_DATE) AS past " "FROM aropen LEFT OUTER JOIN terms ON (aropen_terms_id=terms_id) " " JOIN custinfo ON (cust_id=aropen_cust_id), " " ( SELECT COALESCE(SUM(arapply_applied),0) AS applied " " FROM arapply, aropen " " WHERE ((arapply_target_aropen_id=:aropen_id) " " AND (arapply_source_aropen_id=aropen_id) " " AND (aropen_discount)) ) AS data " "WHERE (aropen_id=:aropen_id);"); applypopulate.bindValue(":aropen_id", _aropenid); applypopulate.bindValue(":invoice", tr("Invoice")); applypopulate.bindValue(":creditmemo", tr("Credit Memo")); applypopulate.exec(); if(applypopulate.first()) { _cust->setText(applypopulate.value("cust_name").toString()); _doctype->setText(applypopulate.value("f_doctype").toString()); _docnum->setText(applypopulate.value("aropen_docnumber").toString()); _docdate->setDate(applypopulate.value("aropen_docdate").toDate()); _terms->setText(applypopulate.value("f_terms").toString()); _discdate->setDate(applypopulate.value("discdate").toDate()); if(applypopulate.value("past").toBool()) { QPalette tmpPalette = _discdate->palette(); tmpPalette.setColor(QPalette::HighlightedText, namedColor("error")); _discdate->setPalette(tmpPalette); _discdate->setForegroundRole(QPalette::HighlightedText); _discdateLit->setPalette(tmpPalette); _discdateLit->setForegroundRole(QPalette::HighlightedText); } _discprcnt->setDouble(applypopulate.value("terms_discprcnt").toDouble() * 100); _owed->setLocalValue(applypopulate.value("aropen_amount").toDouble()); _applieddiscounts->setLocalValue(applypopulate.value("applied").toDouble()); } else if (applypopulate.lastError().type() != QSqlError::NoError) systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__); } qt-client-4.1.0/guiclient/applyARDiscount.h000066400000000000000000000021121217451700100206230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APPLYARDISCOUNT_H #define APPLYARDISCOUNT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_applyARDiscount.h" class applyARDiscount : public XDialog, public Ui::applyARDiscount { Q_OBJECT public: applyARDiscount(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~applyARDiscount(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sApply(); protected: int _aropenid; int _cashrcptitemid; protected slots: virtual void languageChange(); virtual void populate(); }; #endif // APPLYARDISCOUNT_H qt-client-4.1.0/guiclient/applyARDiscount.ui000066400000000000000000000201071217451700100210150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. applyARDiscount 0 0 441 310 Apply A/R Discount Customer: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _cust Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Doc. Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _doctype Doc. #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Doc. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docdate false Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discount Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _discdate false Discount %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Owed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discounts Applied: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discount Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _amount false CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
DLineEdit QWidget
datecluster.h
1
XLabel QLabel
xlabel.h
_amount parameter.h _amount idChanged(int) _owed setId(int) 170 329 170 273 _amount effectiveChanged(QDate) _owed setEffective(QDate) 170 329 170 273 _amount idChanged(int) _applieddiscounts setId(int) 170 329 170 301 _amount effectiveChanged(QDate) _applieddiscounts setEffective(QDate) 170 329 170 301
qt-client-4.1.0/guiclient/applyDiscount.cpp000066400000000000000000000134771217451700100207530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "applyDiscount.h" #include "voucher.h" #include "miscVoucher.h" #include #include #include applyDiscount::applyDiscount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sApply())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _discprcnt->setPrecision(omfgThis->percentVal()); _apopenid = -1; adjustSize(); } applyDiscount::~applyDiscount() { // no need to delete child widgets, Qt does it all for us } void applyDiscount::languageChange() { retranslateUi(this); } enum SetResponse applyDiscount::set( const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("apopen_id", &valid); if (valid) { _apopenid = param.toInt(); populate(); } param = pParams.value("curr_id", &valid); if (valid) _amount->setId(param.toInt()); param = pParams.value("amount", &valid); if (valid) _amount->setLocalValue(param.toDouble()); return NoError; } void applyDiscount::sApply() { accept(); } void applyDiscount::populate() { XSqlQuery applypopulate; applypopulate.prepare("SELECT (vend_number|| '-' || vend_name) as f_vend," " CASE WHEN (apopen_doctype='V') THEN :voucher" " WHEN (apopen_doctype='D') THEN :debitmemo" " ELSE apopen_doctype" " END AS f_doctype," " apopen_docnumber," " apopen_docdate, " " (terms_code || '-' || terms_descrip) AS f_terms," " determineDiscountDate(apopen_terms_id, apopen_docdate) AS discdate," " terms_discprcnt," " apopen_amount, apopen_discountable_amount, apopen_curr_id, applied, " " noNeg(apopen_discountable_amount *" " CASE WHEN (CURRENT_DATE <= determineDiscountDate(terms_id, apopen_docdate)) THEN terms_discprcnt" " ELSE 0.0 END - applied) AS amount," " (determineDiscountDate(terms_id, apopen_docdate) < CURRENT_DATE) AS past" " FROM apopen LEFT OUTER JOIN terms ON (apopen_terms_id=terms_id)" " JOIN vendinfo ON (apopen_vend_id=vend_id), " " (SELECT COALESCE(SUM(apapply_amount),0) AS applied" " FROM apapply, apopen" " WHERE ((apapply_target_apopen_id=:apopen_id)" " AND (apapply_source_apopen_id=apopen_id)" " AND (apopen_discount)) ) AS data" " WHERE (apopen_id=:apopen_id); "); applypopulate.bindValue(":apopen_id", _apopenid); applypopulate.bindValue(":voucher", tr("Voucher")); applypopulate.bindValue(":debitmemo", tr("Debit Memo")); applypopulate.exec(); if(applypopulate.first()) { _vend->setText(applypopulate.value("f_vend").toString()); _doctype->setText(applypopulate.value("f_doctype").toString()); _docnum->setText(applypopulate.value("apopen_docnumber").toString()); _docdate->setDate(applypopulate.value("apopen_docdate").toDate()); _terms->setText(applypopulate.value("f_terms").toString()); _discdate->setDate(applypopulate.value("discdate").toDate()); if(applypopulate.value("past").toBool()) { QPalette tmpPalette = _discdate->palette(); tmpPalette.setColor(QPalette::HighlightedText, namedColor("error")); _discdate->setPalette(tmpPalette); _discdate->setForegroundRole(QPalette::HighlightedText); // why doesn't the date turn ERROR? _discdateLit->setPalette(tmpPalette); _discdateLit->setForegroundRole(QPalette::HighlightedText); } _discprcnt->setDouble(applypopulate.value("terms_discprcnt").toDouble() * 100); _owed->setLocalValue(applypopulate.value("apopen_amount").toDouble()); _discountableOwed->setLocalValue(applypopulate.value("apopen_discountable_amount").toDouble()); _applieddiscounts->setLocalValue(applypopulate.value("applied").toDouble()); _amount->set(applypopulate.value("amount").toDouble(), applypopulate.value("apopen_curr_id").toInt(), applypopulate.value("apopen_docdate").toDate(), false); } else if (applypopulate.lastError().type() != QSqlError::NoError) systemError(this, applypopulate.lastError().databaseText(), __FILE__, __LINE__); } void applyDiscount::sViewVoucher() { XSqlQuery applyViewVoucher; applyViewVoucher.prepare("SELECT vohead_id, COALESCE(pohead_id, -1) AS pohead_id" " FROM apopen, vohead LEFT OUTER JOIN pohead ON (vohead_pohead_id=pohead_id)" " WHERE((vohead_number=apopen_docnumber)" " AND (apopen_id=:apopen_id));"); applyViewVoucher.bindValue(":apopen_id", _apopenid); applyViewVoucher.exec(); if(applyViewVoucher.first()) { ParameterList params; params.append("mode", "view"); params.append("vohead_id", applyViewVoucher.value("vohead_id").toInt()); if (applyViewVoucher.value("pohead_id").toInt() == -1) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } else systemError( this, applyViewVoucher.lastError().databaseText(), __FILE__, __LINE__); } qt-client-4.1.0/guiclient/applyDiscount.h000066400000000000000000000020741217451700100204070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef APPLYDISCOUNT_H #define APPLYDISCOUNT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_applyDiscount.h" class applyDiscount : public XDialog, public Ui::applyDiscount { Q_OBJECT public: applyDiscount(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~applyDiscount(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sApply(); virtual void sViewVoucher(); protected: int _apopenid; protected slots: virtual void languageChange(); virtual void populate(); }; #endif // APPLYDISCOUNT_H qt-client-4.1.0/guiclient/applyDiscount.ui000066400000000000000000000205611217451700100205760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. applyDiscount 0 0 483 346 Apply A/P Discount Vendor: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _vend Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Doc. Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _doctype Doc. #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Doc. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docdate false Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discount Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _discdate false Discount %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Owed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Discountable Owed: Discounts Applied: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discount Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _amount false CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
DLineEdit QWidget
datecluster.h
1
XLabel QLabel
xlabel.h
_amount parameter.h _amount idChanged(int) _owed setId(int) 170 329 170 273 _amount effectiveChanged(QDate) _owed setEffective(QDate) 170 329 170 273 _amount idChanged(int) _applieddiscounts setId(int) 170 329 170 301 _amount effectiveChanged(QDate) _applieddiscounts setEffective(QDate) 170 329 170 301
qt-client-4.1.0/guiclient/arAccountAssignment.cpp000066400000000000000000000173251217451700100220610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "errorReporter.h" #include "guiErrorCheck.h" #include "arAccountAssignment.h" #include #include arAccountAssignment::arAccountAssignment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _araccntid = -1; // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_selectedCustomerType, SIGNAL(toggled(bool)), _customerTypes, SLOT(setEnabled(bool))); connect(_customerTypePattern, SIGNAL(toggled(bool)), _customerType, SLOT(setEnabled(bool))); _customerTypes->setType(XComboBox::CustomerTypes); if(!_metrics->boolean("EnableCustomerDeposits")) { _deferred->hide(); _deferredLit->hide(); } _ar->setType(GLCluster::cAsset); _prepaid->setType(GLCluster::cRevenue); _freight->setType(GLCluster::cRevenue | GLCluster::cLiability); _deferred->setType(GLCluster::cLiability); _discount->setType(GLCluster::cRevenue | GLCluster::cExpense); } arAccountAssignment::~arAccountAssignment() { // no need to delete child widgets, Qt does it all for us } void arAccountAssignment::languageChange() { retranslateUi(this); } enum SetResponse arAccountAssignment::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("araccnt_id", &valid); if (valid) { _araccntid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _customerTypeGroup->setEnabled(FALSE); _ar->setReadOnly(TRUE); _prepaid->setReadOnly(TRUE); _freight->setReadOnly(TRUE); _deferred->setReadOnly(TRUE); _discount->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void arAccountAssignment::sSave() { XSqlQuery arSave; QList errors; if (_metrics->boolean("InterfaceARToGL")) { errors << GuiErrorCheck(!_ar->isValid(), _ar, tr("

You must select a A/R Account before saving this A/R Account Assignment.")) << GuiErrorCheck(!_prepaid->isValid(), _prepaid, tr("

You must select a Prepaid Receivables Account before saving this A/R Account Assignment.")) << GuiErrorCheck(!_freight->isValid(), _freight, tr("

You must select a Freight Account before saving this A/R Account Assignment.")) << GuiErrorCheck(_metrics->boolean("EnableCustomerDeposits") && !_deferred->isValid(), _deferred, tr("

You must select a Deferred Revenue Account before saving this A/R Account Assignment.")) << GuiErrorCheck(!_discount->isValid(), _discount, tr("

You must select a Discount Account before saving this A/R Account Assignment.")) ; } arSave.prepare("SELECT araccnt_id" " FROM araccnt" " WHERE((araccnt_custtype_id=:araccnt_custtype_id)" " AND (araccnt_custtype=:araccnt_custtype)" " AND (araccnt_id != :araccnt_id))"); arSave.bindValue(":araccnt_id", _araccntid); if (_selectedCustomerType->isChecked()) { arSave.bindValue(":araccnt_custtype_id", _customerTypes->id()); arSave.bindValue(":araccnt_custtype", "^[a-zA-Z0-9_]"); } else if (_customerTypePattern->isChecked()) { arSave.bindValue(":araccnt_custtype_id", -1); arSave.bindValue(":araccnt_custtype", _customerType->text()); } arSave.exec(); if(arSave.first()) { errors << GuiErrorCheck(true, _customerTypePattern, tr("

You may not save this A/R Account Assignment as it already exists.")); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save A/R Account Assignment"), errors)) return; if (_mode == cNew) { arSave.exec("SELECT NEXTVAL('araccnt_araccnt_id_seq') AS _araccntid;"); if (arSave.first()) _araccntid = arSave.value("_araccntid").toInt(); // ToDo arSave.prepare( "INSERT INTO araccnt " "( araccnt_id, araccnt_custtype_id, araccnt_custtype," " araccnt_ar_accnt_id, araccnt_prepaid_accnt_id, araccnt_freight_accnt_id," " araccnt_deferred_accnt_id, araccnt_discount_accnt_id ) " "VALUES " "( :araccnt_id, :araccnt_custtype_id, :araccnt_custtype," " :araccnt_ar_accnt_id, :araccnt_prepaid_accnt_id, :araccnt_freight_accnt_id," " :araccnt_deferred_accnt_id, :araccnt_discount_accnt_id );" ); } else if (_mode == cEdit) arSave.prepare( "UPDATE araccnt " "SET araccnt_custtype_id=:araccnt_custtype_id, araccnt_custtype=:araccnt_custtype," " araccnt_ar_accnt_id=:araccnt_ar_accnt_id," " araccnt_prepaid_accnt_id=:araccnt_prepaid_accnt_id," " araccnt_freight_accnt_id=:araccnt_freight_accnt_id," " araccnt_deferred_accnt_id=:araccnt_deferred_accnt_id," " araccnt_discount_accnt_id=:araccnt_discount_accnt_id " "WHERE (araccnt_id=:araccnt_id);" ); arSave.bindValue(":araccnt_id", _araccntid); if (_selectedCustomerType->isChecked()) { arSave.bindValue(":araccnt_custtype_id", _customerTypes->id()); arSave.bindValue(":araccnt_custtype", "^[a-zA-Z0-9_]"); } else if (_customerTypePattern->isChecked()) { arSave.bindValue(":araccnt_custtype_id", -1); arSave.bindValue(":araccnt_custtype", _customerType->text()); } arSave.bindValue(":araccnt_ar_accnt_id", _ar->id()); arSave.bindValue(":araccnt_prepaid_accnt_id", _prepaid->id()); arSave.bindValue(":araccnt_freight_accnt_id", _freight->id()); arSave.bindValue(":araccnt_deferred_accnt_id", _deferred->id()); arSave.bindValue(":araccnt_discount_accnt_id", _discount->id()); arSave.exec(); done(_araccntid); } void arAccountAssignment::populate() { XSqlQuery arpopulate; arpopulate.prepare( "SELECT araccnt_custtype_id, araccnt_custtype," " araccnt_ar_accnt_id, araccnt_prepaid_accnt_id," " araccnt_freight_accnt_id, araccnt_deferred_accnt_id, " " araccnt_discount_accnt_id " "FROM araccnt " "WHERE (araccnt_id=:araccnt_id);" ); arpopulate.bindValue(":araccnt_id", _araccntid); arpopulate.exec(); if (arpopulate.first()) { if (arpopulate.value("araccnt_custtype_id").toInt() == -1) { _customerTypePattern->setChecked(TRUE); _customerType->setText(arpopulate.value("araccnt_custtype").toString()); } else { _selectedCustomerType->setChecked(TRUE); _customerTypes->setId(arpopulate.value("araccnt_custtype_id").toInt()); } _ar->setId(arpopulate.value("araccnt_ar_accnt_id").toInt()); _prepaid->setId(arpopulate.value("araccnt_prepaid_accnt_id").toInt()); _freight->setId(arpopulate.value("araccnt_freight_accnt_id").toInt()); _deferred->setId(arpopulate.value("araccnt_deferred_accnt_id").toInt()); _discount->setId(arpopulate.value("araccnt_discount_accnt_id").toInt()); } } qt-client-4.1.0/guiclient/arAccountAssignment.h000066400000000000000000000021341217451700100215160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ARACCOUNTASSIGNMENT_H #define ARACCOUNTASSIGNMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_arAccountAssignment.h" class arAccountAssignment : public XDialog, public Ui::arAccountAssignment { Q_OBJECT public: arAccountAssignment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~arAccountAssignment(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _araccntid; }; #endif // ARACCOUNTASSIGNMENT_H qt-client-4.1.0/guiclient/arAccountAssignment.ui000066400000000000000000000152121217451700100217050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. arAccountAssignment 0 0 468 286 A/R Account Assignment Selected Customer Type: false 0 0 Customer Type Pattern: true true Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save A/R Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Prepaid Receivables Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Freight Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Deferred Revenue Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discount Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 16 0 GLCluster QWidget

glcluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_ar _prepaid _freight _selectedCustomerType toggled(bool) _customerTypes setEnabled(bool) 20 20 20 20 _customerTypePattern toggled(bool) _customerType setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/arAccountAssignments.cpp000066400000000000000000000112751217451700100222420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "arAccountAssignments.h" #include #include #include #include #include "arAccountAssignment.h" #include "guiclient.h" arAccountAssignments::arAccountAssignments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _araccnt->addColumn(tr("Customer Type"), -1, Qt::AlignCenter, true, "custtypecode"); _araccnt->addColumn(tr("A/R Account"), 120, Qt::AlignLeft, true, "araccnt"); _araccnt->addColumn(tr("Prepaid Account"), 120, Qt::AlignLeft, true, "prepaidaccnt"); _araccnt->addColumn(tr("Freight Account"), 120, Qt::AlignLeft, true, "freightaccnt"); _araccnt->addColumn(tr("Discount Account"),120, Qt::AlignLeft, true, "discountaccnt"); if(_metrics->boolean("EnableCustomerDeposits")) _araccnt->addColumn(tr("Deferred Rev. Account"), 120, Qt::AlignLeft, true, "deferredaccnt"); if (_privileges->check("MaintainSalesAccount")) { connect(_araccnt, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_araccnt, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_araccnt, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_araccnt, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } arAccountAssignments::~arAccountAssignments() { // no need to delete child widgets, Qt does it all for us } void arAccountAssignments::languageChange() { retranslateUi(this); } void arAccountAssignments::sPrint() { orReport report("FreightAccountAssignmentsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void arAccountAssignments::sNew() { ParameterList params; params.append("mode", "new"); arAccountAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void arAccountAssignments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("araccnt_id", _araccnt->id()); arAccountAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void arAccountAssignments::sView() { ParameterList params; params.append("mode", "view"); params.append("araccnt_id", _araccnt->id()); arAccountAssignment newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void arAccountAssignments::sDelete() { XSqlQuery arDelete; arDelete.prepare( "DELETE FROM araccnt " "WHERE (araccnt_id=:araccnt_id);" ); arDelete.bindValue(":araccnt_id", _araccnt->id()); arDelete.exec(); sFillList(); } void arAccountAssignments::sFillList() { _araccnt->populate( "SELECT araccnt_id," " CASE WHEN araccnt_custtype_id=-1 THEN araccnt_custtype" " ELSE (SELECT custtype_code FROM custtype WHERE (custtype_id=araccnt_custtype_id))" " END AS custtypecode," " CASE WHEN (araccnt_ar_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(araccnt_ar_accnt_id) END AS araccnt," " CASE WHEN (araccnt_prepaid_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(araccnt_prepaid_accnt_id) END AS prepaidaccnt," " CASE WHEN (araccnt_freight_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(araccnt_freight_accnt_id) END AS freightaccnt," " CASE WHEN (araccnt_deferred_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(araccnt_deferred_accnt_id) END AS deferredaccnt, " " CASE WHEN (araccnt_discount_accnt_id = -1) THEN 'N/A' " " ELSE formatGLAccount(araccnt_discount_accnt_id) END AS discountaccnt " " FROM araccnt " " ORDER BY custtypecode;" ); } qt-client-4.1.0/guiclient/arAccountAssignments.h000066400000000000000000000021231217451700100216770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ARACCOUNTASSIGNMENTS_H #define ARACCOUNTASSIGNMENTS_H #include "xwidget.h" #include "ui_arAccountAssignments.h" class arAccountAssignments : public XWidget, public Ui::arAccountAssignments { Q_OBJECT public: arAccountAssignments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~arAccountAssignments(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); private: int _mode; int _araccntid; }; #endif // ARACCOUNTASSIGNMENTS_H qt-client-4.1.0/guiclient/arAccountAssignments.ui000066400000000000000000000111121217451700100220630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. arAccountAssignments 0 0 400 400 List Receivables Account Assignments 0 Receivables Account Assignments: &Close &Print Qt::Vertical QSizePolicy::Fixed 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
1
_araccnt _new _view _delete _print _close _close clicked() arAccountAssignments close() 20 20 20 20 _araccnt valid(bool) _view setEnabled(bool) 20 20 20 20
qt-client-4.1.0/guiclient/arCreditMemoApplication.cpp000066400000000000000000000271431217451700100226470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "arCreditMemoApplication.h" #include #include #include #include arCreditMemoApplication::arCreditMemoApplication(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _cust->setReadOnly(TRUE); adjustSize(); } arCreditMemoApplication::~arCreditMemoApplication() { // no need to delete child widgets, Qt does it all for us } void arCreditMemoApplication::languageChange() { retranslateUi(this); } enum SetResponse arCreditMemoApplication::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("sourceAropenid", &valid); if (valid) _sourceAropenid = param.toInt(); param = pParams.value("targetAropenid", &valid); if (valid) { _targetAropenid = param.toInt(); populate(); } return NoError; } void arCreditMemoApplication::sSave() { XSqlQuery arSave; double amountToApply = _amountToApply->localValue(); // check to make sure the amount being applied does not exceed // the balance due on the target item. arSave.prepare( "SELECT ROUND(currToCurr(aropen_curr_id, :curr_id," " (aropen_amount - aropen_paid - calcpendingarapplications(aropen_id)), current_date), 2) AS balance " " FROM aropen " " WHERE (aropen_id=:aropen_id);"); arSave.bindValue(":aropen_id", _targetAropenid); arSave.bindValue(":curr_id", _amountToApply->id()); arSave.exec(); double targetBalance = 0.0; if(arSave.first()) targetBalance = arSave.value("balance").toDouble(); else if (arSave.lastError().type() != QSqlError::NoError) { systemError(this, arSave.lastError().databaseText(), __FILE__, __LINE__); return; } if(amountToApply > targetBalance) { QMessageBox::warning(this, tr("Invalid Application"), tr("You may not apply more than the balance due to this Document.") ); return; } // check to make sure the mount being applied does not exceed // the remaining balance of the source item. arSave.prepare( "SELECT round((aropen_amount - aropen_paid) - " " COALESCE(SUM(currToCurr(arcreditapply_curr_id, " " aropen_curr_id, " " arcreditapply_amount, " " aropen_docdate)), 0), 2) - COALESCE(prepared,0.0) - COALESCE(cashapplied,0.0) AS available " "FROM aropen LEFT OUTER JOIN arcreditapply " " ON ((arcreditapply_source_aropen_id=aropen_id) " " AND (arcreditapply_target_aropen_id<>:targetAropenid)) " " LEFT OUTER JOIN (SELECT aropen_id AS prepared_aropen_id," " SUM(checkitem_amount + checkitem_discount) AS prepared" " FROM checkhead JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)" " JOIN aropen ON (checkitem_aropen_id=aropen_id)" " WHERE ((NOT checkhead_posted)" " AND (NOT checkhead_void))" " GROUP BY aropen_id) AS sub1" " ON (prepared_aropen_id=aropen_id)" " LEFT OUTER JOIN (SELECT aropen_id AS cash_aropen_id," " SUM(cashrcptitem_amount + cashrcptitem_discount) * -1.0 AS cashapplied" " FROM cashrcpt JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)" " JOIN aropen ON (cashrcptitem_aropen_id=aropen_id)" " WHERE (NOT cashrcpt_posted)" " GROUP BY aropen_id ) AS sub2" " ON (cash_aropen_id=aropen_id)" "WHERE (aropen_id=:sourceAropenid) " "GROUP BY aropen_amount, aropen_paid, prepared, cashapplied;" ); arSave.bindValue(":sourceAropenid", _sourceAropenid); arSave.bindValue(":targetAropenid", _targetAropenid); arSave.exec(); double sourceBalance = 0.0; if(arSave.first()) sourceBalance = arSave.value("available").toDouble(); else if (arSave.lastError().type() != QSqlError::NoError) { systemError(this, arSave.lastError().databaseText(), __FILE__, __LINE__); return; } if(amountToApply > sourceBalance) { QMessageBox::warning(this, tr("Invalid Application"), tr("You may not apply more than the amount available to apply for this Credit Memo.") ); return; } arSave.prepare( "SELECT arcreditapply_id " "FROM arcreditapply " "WHERE ( (arcreditapply_source_aropen_id=:sourceAropenid)" " AND (arcreditapply_target_aropen_id=:targetAropenid) );" ); arSave.bindValue(":sourceAropenid", _sourceAropenid); arSave.bindValue(":targetAropenid", _targetAropenid); arSave.exec(); if (arSave.first()) { int arcreditapplyid = arSave.value("arcreditapply_id").toInt(); arSave.prepare( "UPDATE arcreditapply " "SET arcreditapply_amount=:arcreditapply_amount, " " arcreditapply_curr_id = :arcreditapply_curr_id " "WHERE (arcreditapply_id=:arcreditapply_id);" ); arSave.bindValue(":arcreditapply_id", arcreditapplyid); } else if (arSave.lastError().type() != QSqlError::NoError) { systemError(this, arSave.lastError().databaseText(), __FILE__, __LINE__); return; } else { arSave.prepare( "INSERT INTO arcreditapply " "( arcreditapply_source_aropen_id, arcreditapply_target_aropen_id, " " arcreditapply_amount, arcreditapply_curr_id ) " "VALUES " "( :sourceAropenid, :targetAropenid, " " :arcreditapply_amount, :arcreditapply_curr_id );" ); arSave.bindValue(":sourceAropenid", _sourceAropenid); arSave.bindValue(":targetAropenid", _targetAropenid); } arSave.bindValue(":arcreditapply_amount", amountToApply); arSave.bindValue(":arcreditapply_curr_id", _amountToApply->id()); arSave.exec(); if (arSave.lastError().type() != QSqlError::NoError) { systemError(this, arSave.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void arCreditMemoApplication::populate() { XSqlQuery arpopulate; arpopulate.prepare( "SELECT aropen_cust_id, aropen_docnumber, aropen_doctype," " aropen_docdate, aropen_duedate, " " aropen_amount, " " aropen_paid, " " calcpendingarapplications(aropen_id) AS pending, " " (aropen_amount - aropen_paid - calcpendingarapplications(aropen_id)) AS f_balance, " " aropen_curr_id " "FROM aropen " "WHERE (aropen_id=:aropen_id);" ); arpopulate.bindValue(":aropen_id", _targetAropenid); arpopulate.exec(); if (arpopulate.first()) { _cust->setId(arpopulate.value("aropen_cust_id").toInt()); _docNumber->setText(arpopulate.value("aropen_docnumber").toString()); _docType->setText(arpopulate.value("aropen_doctype").toString()); _docDate->setDate(arpopulate.value("aropen_docdate").toDate(), true); _dueDate->setDate(arpopulate.value("aropen_duedate").toDate()); _targetAmount->set(arpopulate.value("aropen_amount").toDouble(), arpopulate.value("aropen_curr_id").toInt(), arpopulate.value("aropen_docdate").toDate(), false); _targetPaid->setLocalValue(arpopulate.value("aropen_paid").toDouble()); _targetPending->setLocalValue(arpopulate.value("pending").toDouble()); _targetBalance->setLocalValue(arpopulate.value("f_balance").toDouble()); } else if (arpopulate.lastError().type() != QSqlError::NoError) { systemError(this, arpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } arpopulate.prepare( "SELECT COALESCE(arcreditapply_curr_id,aropen_curr_id) AS curr_id," " currToCurr(aropen_curr_id," " COALESCE(arcreditapply_curr_id,aropen_curr_id)," " aropen_amount - aropen_paid, aropen_docdate) - " " COALESCE(SUM(arcreditapply_amount), 0) - COALESCE(prepared,0.0) - COALESCE(cashapplied,0.0) AS available," " current_date AS docdate " "FROM aropen LEFT OUTER JOIN arcreditapply ON (arcreditapply_source_aropen_id=aropen_id) " " LEFT OUTER JOIN (SELECT aropen_id AS prepared_aropen_id," " SUM(checkitem_amount + checkitem_discount) AS prepared" " FROM checkhead JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)" " JOIN aropen ON (checkitem_aropen_id=aropen_id)" " WHERE ((NOT checkhead_posted)" " AND (NOT checkhead_void))" " GROUP BY aropen_id) AS sub1 " " ON (prepared_aropen_id=aropen_id)" " LEFT OUTER JOIN (SELECT aropen_id AS cash_aropen_id," " SUM(cashrcptitem_amount + cashrcptitem_discount) * -1.0 AS cashapplied" " FROM cashrcpt JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)" " JOIN aropen ON (cashrcptitem_aropen_id=aropen_id)" " WHERE ((NOT cashrcpt_posted)" " AND (NOT cashrcpt_void))" " GROUP BY aropen_id ) AS sub2" " ON (cash_aropen_id=aropen_id)" "WHERE (aropen_id=:aropen_id) " "GROUP BY aropen_amount, aropen_paid, aropen_docdate," " arcreditapply_curr_id, aropen_curr_id, prepared, cashapplied;" ); arpopulate.bindValue(":aropen_id", _sourceAropenid); arpopulate.exec(); if (arpopulate.first()) { _availableToApply->set(arpopulate.value("available").toDouble(), arpopulate.value("curr_id").toInt(), arpopulate.value("docdate").toDate(), false); } else if (arpopulate.lastError().type() != QSqlError::NoError) systemError(this, arpopulate.lastError().databaseText(), __FILE__, __LINE__); arpopulate.prepare( "SELECT currToCurr(arcreditapply_curr_id, :curr_id, " " arcreditapply_amount, :effective) AS arcreditapply_amount " "FROM arcreditapply " "WHERE ( (arcreditapply_source_aropen_id=:source_aropen_id)" " AND (arcreditapply_target_aropen_id=:target_aropen_id) );" ); arpopulate.bindValue(":source_aropen_id", _sourceAropenid); arpopulate.bindValue(":target_aropen_id", _targetAropenid); arpopulate.bindValue(":curr_id", _amountToApply->id()); arpopulate.bindValue(":effective", _amountToApply->effective()); arpopulate.exec(); if (arpopulate.first()) _amountToApply->setLocalValue(arpopulate.value("arcreditapply_amount").toDouble()); else if (arpopulate.lastError().type() != QSqlError::NoError) systemError(this, arpopulate.lastError().databaseText(), __FILE__, __LINE__); } qt-client-4.1.0/guiclient/arCreditMemoApplication.h000066400000000000000000000022371217451700100223110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ARCREDITMEMOAPPLICATION_H #define ARCREDITMEMOAPPLICATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_arCreditMemoApplication.h" class arCreditMemoApplication : public XDialog, public Ui::arCreditMemoApplication { Q_OBJECT public: arCreditMemoApplication(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~arCreditMemoApplication(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _sourceAropenid; int _targetAropenid; int _arcreditapplyid; }; #endif // ARCREDITMEMOAPPLICATION_H qt-client-4.1.0/guiclient/arCreditMemoApplication.ui000066400000000000000000000431141217451700100224760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. arCreditMemoApplication 0 0 562 478 Receivables Credit Memo Application Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 13 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Apply-To Information Doc. Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 5 Doc. Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 155 16 Doc. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 260 16 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 32767 Qt::Horizontal 40 20 Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Qt::Horizontal 40 20 Paid: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Pending: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 5 Available To Apply: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Amount To Apply: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Qt::Horizontal QSizePolicy::Expanding 132 16 CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
CustCluster QWidget
custcluster.h
DLineEdit QWidget
datecluster.h
1
_cust _dueDate _availableToApply idChanged(int) _amountToApply setId(int) 20 20 20 20 _targetAmount idChanged(int) _targetPaid setId(int) 20 20 20 20 _targetAmount idChanged(int) _targetBalance setId(int) 20 20 20 20 _availableToApply effectiveChanged(QDate) _amountToApply setEffective(QDate) 20 20 20 20 _targetAmount effectiveChanged(QDate) _targetPaid reset() 20 20 20 20 _targetAmount effectiveChanged(QDate) _targetBalance setEffective(QDate) 20 20 20 20 _docDate newDate(QDate) _targetAmount setEffective(QDate) 20 20 20 20 _targetAmount effectiveChanged(QDate) _availableToApply setEffective(QDate) 156 204 216 317 _targetAmount effectiveChanged(QDate) _amountToApply setEffective(QDate) 156 204 216 364 _targetAmount idChanged(int) _targetPending setId(int) 234 242 199 317 _targetAmount effectiveChanged(QDate) _targetPending setEffective(QDate) 234 242 199 317
qt-client-4.1.0/guiclient/arOpenItem.cpp000066400000000000000000000654731217451700100201630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "arOpenItem.h" #include #include #include #include #include "printArOpenItem.h" #include "storedProcErrorLookup.h" #include "taxDetail.h" #include "currcluster.h" arOpenItem::arOpenItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _commprcnt = 0.0; _save = _buttonBox->button(QDialogButtonBox::Save); _save->setDisabled(true); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustInfo(int))); connect(_cust, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate())); connect(_docDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDueDate())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_amount, SIGNAL(valueChanged()), this, SLOT(sCalculateCommission())); connect(_docNumber, SIGNAL(textEdited(QString)), this, SLOT(sReleaseNumber())); _last = -1; _aropenid = -1; _seqiss = 0; _arapply->addColumn(tr("Type"), _dateColumn, Qt::AlignCenter,true, "doctype"); _arapply->addColumn(tr("Doc. #"), -1, Qt::AlignLeft, true, "docnumber"); _arapply->addColumn(tr("Apply Date"), _dateColumn, Qt::AlignCenter,true, "arapply_postdate"); _arapply->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter,true, "arapply_distdate"); _arapply->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "arapply_applied"); _arapply->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currabbr"); _arapply->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight, true, "baseapplied"); _printOnPost->setVisible(false); if (omfgThis->singleCurrency()) _arapply->hideColumn("currabbr"); _cust->setType(CLineEdit::ActiveCustomers); _terms->setType(XComboBox::ARTerms); _salesrep->setType(XComboBox::SalesReps); _altSalescatid->setType(XComboBox::SalesCategoriesActive); _rsnCode->setType(XComboBox::ReasonCodes); _journalNumber->setEnabled(FALSE); _altAccntid->setType(GLCluster::cRevenue | GLCluster::cExpense); } arOpenItem::~arOpenItem() { // no need to delete child widgets, Qt does it all for us } void arOpenItem::languageChange() { retranslateUi(this); } enum SetResponse arOpenItem::set( const ParameterList &pParams ) { XSqlQuery aret; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("docType", &valid); if (valid) { if (param.toString() == "creditMemo") { setWindowTitle(windowTitle() + tr(" - Enter Misc. Credit Memo")); _docType->setCurrentIndex(0); _rsnCode->setType(XComboBox::ARCMReasonCodes); } else if (param.toString() == "debitMemo") { setWindowTitle(windowTitle() + tr(" - Enter Misc. Debit Memo")); _docType->setCurrentIndex(1); _rsnCode->setType(XComboBox::ARDMReasonCodes); } else if (param.toString() == "invoice") _docType->setCurrentIndex(2); else if (param.toString() == "customerDeposit") _docType->setCurrentIndex(3); else return UndefinedError; // ToDo - better error return types _docType->setEnabled(FALSE); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; aret.exec("SELECT fetchARMemoNumber() AS number;"); if (aret.first()) { _docNumber->setText(aret.value("number").toString()); _seqiss = aret.value("number").toInt(); } else if (aret.lastError().type() != QSqlError::NoError) { systemError(this, aret.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _paid->clear(); _save->setText(tr("Post")); _printOnPost->setVisible(true); } else if (param.toString() == "edit") { _mode = cEdit; _cust->setReadOnly(TRUE); _docDate->setEnabled(FALSE); _docType->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _orderNumber->setEnabled(FALSE); _journalNumber->setEnabled(FALSE); _terms->setEnabled(FALSE); _useAltPrepaid->setEnabled(FALSE); _altPrepaid->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _cust->setReadOnly(TRUE); _docDate->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _docType->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _orderNumber->setEnabled(FALSE); _journalNumber->setEnabled(FALSE); _amount->setEnabled(FALSE); _terms->setEnabled(FALSE); _terms->setType(XComboBox::Terms); _salesrep->setEnabled(FALSE); _commissionDue->setEnabled(FALSE); _rsnCode->setEnabled(FALSE); _useAltPrepaid->setEnabled(FALSE); _altPrepaid->setEnabled(FALSE); _notes->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } else return UndefinedError; } param = pParams.value("cust_id", &valid); if (valid) { _cust->setId(param.toInt()); populate(); } param = pParams.value("aropen_id", &valid); if (valid) { _aropenid = param.toInt(); populate(); } return NoError; } void arOpenItem::sSave() { XSqlQuery arSave; QString storedProc; if (_mode == cNew) { if (!_docDate->isValid()) { QMessageBox::critical( this, tr("Cannot Save Receivable Memo"), tr("You must enter a date for this Receivable Memo before you may save it") ); _docDate->setFocus(); return; } if (!_dueDate->isValid()) { QMessageBox::critical( this, tr("Cannot Save Receivable Memo"), tr("You must enter a date for this Receivable Memo before you may save it") ); _dueDate->setFocus(); return; } if (_amount->isZero()) { QMessageBox::critical( this, tr("Cannot Save Receivable Memo"), tr("You must enter an amount for this Receivable Memo before you may save it") ); _amount->setFocus(); return; } if(_tax->localValue() > _amount->localValue()) { QMessageBox::critical( this, tr("Cannot Save Receivable Memo"), tr("The tax amount may not be greater than the total Receivable Memo amount.") ); return; } if (_useAltPrepaid->isChecked()) { if(_altSalescatidSelected->isChecked() && !_altSalescatid->isValid()) { QMessageBox::critical( this, tr("Cannot Save Receivable Memo"), tr("You must choose a valid Alternate Sales Category for this Receivable Memo before you may save it") ); return; } if(_altAccntidSelected->isChecked() && !_altAccntid->isValid()) { QMessageBox::critical( this, tr("Cannot Save Receivable Memo"), tr("You must choose a valid Alternate Prepaid Account Number for this Receivable Memo before you may save it.") ); return; } } if (_docType->currentIndex() == 0) { arSave.prepare( "SELECT createARCreditMemo( :aropen_id, :cust_id, :aropen_docnumber, :aropen_ordernumber," " :aropen_docdate, :aropen_amount, :aropen_notes, :aropen_rsncode_id," " :aropen_salescat_id, :aropen_accnt_id, :aropen_duedate," " :aropen_terms_id, :aropen_salesrep_id, :aropen_commission_due," " NULL, :curr_id ) AS result;" ); storedProc = "createARCreditMemo"; } else if (_docType->currentIndex() == 1) { arSave.prepare( "SELECT createARDebitMemo( :aropen_id,:cust_id, NULL, :aropen_docnumber, :aropen_ordernumber," " :aropen_docdate, :aropen_amount, :aropen_notes, :aropen_rsncode_id," " :aropen_salescat_id, :aropen_accnt_id, :aropen_duedate," " :aropen_terms_id, :aropen_salesrep_id, :aropen_commission_due, " " :curr_id ) AS result;" ); storedProc = "createARDebitMemo"; } arSave.bindValue(":cust_id", _cust->id()); } else if (_mode == cEdit) { if (_cAmount != _amount->localValue()) if ( QMessageBox::warning( this, tr("A/R Open Amount Changed"), tr( "You are changing the open amount of this A/R Open Item. If you do not post a G/L Transaction\n" "to distribute this change then the A/R Open Item total will be out of balance with the\n" "A/R Trial Balance(s).\n" "Are you sure that you want to save this change?" ), tr("Yes"), tr("No"), QString::null ) == 1 ) return; arSave.prepare( "UPDATE aropen " "SET aropen_duedate=:aropen_duedate," " aropen_terms_id=:aropen_terms_id, aropen_salesrep_id=:aropen_salesrep_id," " aropen_amount=:aropen_amount," " aropen_commission_due=:aropen_commission_due, aropen_notes=:aropen_notes," " aropen_rsncode_id=:aropen_rsncode_id, " " aropen_curr_id=:curr_id " "WHERE (aropen_id=:aropen_id);" ); } if (_aropenid != -1) arSave.bindValue(":aropen_id", _aropenid); arSave.bindValue(":aropen_docdate", _docDate->date()); arSave.bindValue(":aropen_duedate", _dueDate->date()); arSave.bindValue(":aropen_docnumber", _docNumber->text()); arSave.bindValue(":aropen_ordernumber", _orderNumber->text()); arSave.bindValue(":aropen_terms_id", _terms->id()); if (_salesrep->isValid()) arSave.bindValue(":aropen_salesrep_id", _salesrep->id()); arSave.bindValue(":aropen_amount", _amount->localValue()); arSave.bindValue(":aropen_commission_due", _commissionDue->baseValue()); arSave.bindValue(":aropen_notes", _notes->toPlainText()); arSave.bindValue(":aropen_rsncode_id", _rsnCode->id()); arSave.bindValue(":curr_id", _amount->id()); if(_useAltPrepaid->isChecked() && _altSalescatidSelected->isChecked()) arSave.bindValue(":aropen_salescat_id", _altSalescatid->id()); else arSave.bindValue(":aropen_salescat_id", -1); if(_useAltPrepaid->isChecked() && _altAccntidSelected->isChecked()) arSave.bindValue(":aropen_accnt_id", _altAccntid->id()); else arSave.bindValue(":aropen_accnt_id", -1); switch (_docType->currentIndex()) { case 0: arSave.bindValue(":aropen_doctype", "C"); break; case 1: arSave.bindValue(":aropen_doctype", "D"); break; case 2: arSave.bindValue(":aropen_doctype", "I"); break; case 3: arSave.bindValue(":aropen_doctype", "R"); break; } if (arSave.exec()) { if (_mode == cEdit) done(_aropenid); else { arSave.first(); if (arSave.lastError().type() != QSqlError::NoError) { systemError(this, arSave.lastError().databaseText(), __FILE__, __LINE__); reset(); return; } _last = arSave.value("result").toInt(); if (_last < 0) { systemError(this, storedProc.isEmpty() ? tr("Saving Credit Memo Failed: %1").arg(_last) : storedProcErrorLookup(storedProc, _last), __FILE__, __LINE__); reset(); return; } if(_printOnPost->isChecked()) sPrintOnPost(_last); reset(); } } else if (arSave.lastError().type() != QSqlError::NoError) { systemError(this, arSave.lastError().databaseText(), __FILE__, __LINE__); if (_mode == cNew) reset(); return; } } void arOpenItem::sClose() { if (_mode == cNew) { if(_seqiss) sReleaseNumber(); if(_last != -1) { done(_last); return; } } reject(); } void arOpenItem::sReleaseNumber() { XSqlQuery arReleaseNumber; if(_seqiss) { arReleaseNumber.prepare("SELECT releaseARMemoNumber(:docNumber);"); arReleaseNumber.bindValue(":docNumber", _seqiss); arReleaseNumber.exec(); if (arReleaseNumber.lastError().type() != QSqlError::NoError) { systemError(this, arReleaseNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } } void arOpenItem::sPopulateCustInfo(int pCustid) { if ( (pCustid != -1) && (_mode == cNew) ) { XSqlQuery c; c.prepare( "SELECT cust_terms_id, cust_salesrep_id, cust_curr_id, cust_commprcnt " "FROM custinfo " "WHERE (cust_id=:cust_id);" ); c.bindValue(":cust_id", pCustid); c.exec(); if (c.first()) { _terms->setId(c.value("cust_terms_id").toInt()); _salesrep->setId(c.value("cust_salesrep_id").toInt()); _amount->setId(c.value("cust_curr_id").toInt()); _tax->setId(c.value("cust_curr_id").toInt()); _commprcnt = c.value("cust_commprcnt").toDouble(); } else if (c.lastError().type() != QSqlError::NoError) { systemError(this, c.lastError().databaseText(), __FILE__, __LINE__); return; } } } void arOpenItem::populate() { XSqlQuery arpopulate; arpopulate.prepare( "SELECT aropen_cust_id, aropen_docdate, aropen_duedate," " aropen_doctype, aropen_docnumber," " aropen_ordernumber, aropen_journalnumber," " aropen_amount, aropen_amount," " aropen_paid, " " (aropen_amount - aropen_paid) AS f_balance," " aropen_terms_id, aropen_salesrep_id," " aropen_commission_due, cust_commprcnt," " aropen_notes, aropen_rsncode_id, aropen_salescat_id, " " aropen_accnt_id, aropen_curr_id, " " COALESCE(SUM(taxhist_tax),0) AS tax, " " CASE WHEN (aropen_doctype = 'D' OR " " (aropen_doctype='C' AND cmhead_id IS NULL)) THEN " " TRUE " " ELSE " " FALSE " " END AS showTax " "FROM aropen " " JOIN custinfo ON (cust_id=aropen_cust_id) " " LEFT OUTER JOIN aropentax ON (aropen_id=taxhist_parent_id) " " LEFT OUTER JOIN cmhead ON ((aropen_doctype='C') " " AND (aropen_docnumber=cmhead_number)) " "WHERE (aropen_id=:aropen_id) " "GROUP BY aropen_cust_id, aropen_docdate, aropen_duedate, " " aropen_doctype, aropen_docnumber, aropen_ordernumber, aropen_journalnumber, " " aropen_amount, aropen_amount, aropen_paid, f_balance, aropen_terms_id, " " aropen_salesrep_id, aropen_commission_due, cust_commprcnt, aropen_notes, aropen_rsncode_id, " " aropen_salescat_id, aropen_accnt_id, aropen_curr_id, cmhead_id;" ); arpopulate.bindValue(":aropen_id", _aropenid); arpopulate.exec(); if (arpopulate.first()) { _cust->setId(arpopulate.value("aropen_cust_id").toInt()); _docDate->setDate(arpopulate.value("aropen_docdate").toDate(), true); _dueDate->setDate(arpopulate.value("aropen_duedate").toDate()); _docNumber->setText(arpopulate.value("aropen_docnumber").toString()); _orderNumber->setText(arpopulate.value("aropen_ordernumber").toString()); _journalNumber->setText(arpopulate.value("aropen_journalnumber").toString()); _amount->set(arpopulate.value("aropen_amount").toDouble(), arpopulate.value("aropen_curr_id").toInt(), arpopulate.value("aropen_docdate").toDate(), false); _paid->setLocalValue(arpopulate.value("aropen_paid").toDouble()); _balance->setLocalValue(arpopulate.value("f_balance").toDouble()); _terms->setId(arpopulate.value("aropen_terms_id").toInt()); _salesrep->setId(arpopulate.value("aropen_salesrep_id").toInt()); _commissionDue->setBaseValue(arpopulate.value("aropen_commission_due").toDouble()); _commprcnt = arpopulate.value("cust_commprcnt").toDouble(); _notes->setText(arpopulate.value("aropen_notes").toString()); if (arpopulate.value("showTax").toBool()) _tax->setLocalValue(arpopulate.value("tax").toDouble()); else { _taxLit->hide(); _tax->hide(); } if(!arpopulate.value("aropen_rsncode_id").isNull() && arpopulate.value("aropen_rsncode_id").toInt() != -1) _rsnCode->setId(arpopulate.value("aropen_rsncode_id").toInt()); if(!arpopulate.value("aropen_accnt_id").isNull() && arpopulate.value("aropen_accnt_id").toInt() != -1) { _useAltPrepaid->setChecked(TRUE); _altAccntidSelected->setChecked(TRUE); _altAccntid->setId(arpopulate.value("aropen_accnt_id").toInt()); } if(!arpopulate.value("aropen_salescat_id").isNull() && arpopulate.value("aropen_salescat_id").toInt() != -1) { _useAltPrepaid->setChecked(TRUE); _altSalescatidSelected->setChecked(TRUE); _altSalescatid->setId(arpopulate.value("aropen_salescat_id").toInt()); } QString docType = arpopulate.value("aropen_doctype").toString(); if (docType == "C") _docType->setCurrentIndex(0); else if (docType == "D") _docType->setCurrentIndex(1); else if (docType == "I") _docType->setCurrentIndex(2); else if (docType == "R") _docType->setCurrentIndex(3); _cAmount = arpopulate.value("aropen_amount").toDouble(); if ( (docType == "I") || (docType == "D") ) { arpopulate.prepare( "SELECT arapply_id, arapply_source_aropen_id," " CASE WHEN (arapply_source_doctype = 'C') THEN :creditMemo" " WHEN (arapply_source_doctype = 'R') THEN :cashdeposit" " WHEN (arapply_fundstype='C') THEN :check" " WHEN (arapply_fundstype='T') THEN :certifiedCheck" " WHEN (arapply_fundstype='M') THEN :masterCard" " WHEN (arapply_fundstype='V') THEN :visa" " WHEN (arapply_fundstype='A') THEN :americanExpress" " WHEN (arapply_fundstype='D') THEN :discoverCard" " WHEN (arapply_fundstype='R') THEN :otherCreditCard" " WHEN (arapply_fundstype='K') THEN :cash" " WHEN (arapply_fundstype='W') THEN :wireTransfer" " WHEN (arapply_fundstype='O') THEN :other" " END AS doctype," " CASE WHEN (arapply_source_doctype IN ('C','R')) THEN arapply_source_docnumber" " WHEN (arapply_source_doctype = 'K') THEN arapply_refnumber" " ELSE :other" " END AS docnumber, arapply_distdate," " arapply_postdate, arapply_applied, " " currConcat(arapply_curr_id) AS currabbr," " currToBase(arapply_curr_id, arapply_applied, arapply_postdate) AS baseapplied," " 'curr' AS arapply_applied_xtnumericrole," " 'curr' AS baseapplied_xtnumericrole " "FROM arapply " "WHERE (arapply_target_aropen_id=:aropen_id) " "ORDER BY arapply_postdate;" ); arpopulate.bindValue(":creditMemo", tr("Credit Memo")); arpopulate.bindValue(":cashdeposit", tr("Cash Deposit")); arpopulate.bindValue(":check", tr("Check")); arpopulate.bindValue(":certifiedCheck", tr("Certified Check")); arpopulate.bindValue(":masterCard", tr("Master Card")); arpopulate.bindValue(":visa", tr("Visa")); arpopulate.bindValue(":americanExpress", tr("American Express")); arpopulate.bindValue(":discoverCard", tr("Discover Card")); arpopulate.bindValue(":otherCreditCard", tr("Other Credit Card")); arpopulate.bindValue(":cash", tr("Cash")); arpopulate.bindValue(":wireTransfer", tr("Wire Transfer")); arpopulate.bindValue(":other", tr("Other")); } else if (docType == "C" || docType == "R") { arpopulate.prepare( "SELECT arapply_id, arapply_target_aropen_id," " CASE WHEN (arapply_target_doctype = 'I') THEN :invoice" " WHEN (arapply_target_doctype = 'D') THEN :debitMemo" " WHEN (arapply_target_doctype = 'K') THEN :apcheck" " WHEN (arapply_target_doctype = 'R') THEN :cashreceipt" " ELSE :other" " END AS doctype," " arapply_target_docnumber AS docnumber," " arapply_distdate, arapply_postdate, arapply_applied," " currConcat(arapply_curr_id) AS currabbr," " currToBase(arapply_curr_id, arapply_applied, arapply_postdate) AS baseapplied," " 'curr' AS arapply_applied_xtnumericrole," " 'curr' AS baseapplied_xtnumericrole " "FROM arapply " "WHERE (arapply_source_aropen_id=:aropen_id) " "ORDER BY arapply_postdate;" ); arpopulate.bindValue(":invoice", tr("Invoice")); arpopulate.bindValue(":debitMemo", tr("Debit Memo")); arpopulate.bindValue(":apcheck", tr("A/P Check")); arpopulate.bindValue(":cashreceipt", tr("Cash Receipt")); } arpopulate.bindValue(":error", tr("Error")); arpopulate.bindValue(":aropen_id", _aropenid); arpopulate.exec(); _arapply->populate(arpopulate, TRUE); if (arpopulate.lastError().type() != QSqlError::NoError) systemError(this, arpopulate.lastError().databaseText(), __FILE__, __LINE__); } else if (arpopulate.lastError().type() != QSqlError::NoError) { systemError(this, arpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void arOpenItem::reset() { _aropenid = -1; _cust->setId(-1); _docDate->clear(); _dueDate->clear(); _docNumber->clear(); _orderNumber->clear(); _journalNumber->clear(); _terms->setId(-1); _salesrep->setId(-1); _tax->clear(); _commissionDue->clear(); _amount->clear(); _paid->clear(); _balance->clear(); _rsnCode->setId(-1); _useAltPrepaid->setChecked(false); _notes->clear(); _arapply->clear(); _cust->setFocus(); ParameterList params; params.append("mode", "new"); set(params); } void arOpenItem::sCalculateCommission() { _commissionDue->setBaseValue(_amount->baseValue() * _commprcnt); } void arOpenItem::sPopulateDueDate() { XSqlQuery arPopulateDueDate; if ( (_terms->isValid()) && (_docDate->isValid()) && (!_dueDate->isValid()) ) { arPopulateDueDate.prepare("SELECT determineDueDate(:terms_id, :docDate) AS duedate;"); arPopulateDueDate.bindValue(":terms_id", _terms->id()); arPopulateDueDate.bindValue(":docDate", _docDate->date()); arPopulateDueDate.exec(); if (arPopulateDueDate.first()) _dueDate->setDate(arPopulateDueDate.value("duedate").toDate()); } } void arOpenItem::sPrintOnPost(int temp_id) { ParameterList params; params.append("aropen_id", temp_id); printArOpenItem newdlg(this, "", true); if (newdlg.set(params) == NoError) newdlg.exec(); } void arOpenItem::sTaxDetail() { XSqlQuery ar; if (_aropenid == -1) { if (!_docDate->isValid() || !_dueDate->isValid()) { QMessageBox::critical( this, tr("Cannot set tax amounts"), tr("You must enter document and due dates for this Receivable Memo before you may set tax amounts.") ); _docDate->setFocus(); return; } if (_amount->isZero()) { QMessageBox::critical( this, tr("Cannot set tax amounts"), tr("You must enter an amount for this Receivable Memo before you may set tax amounts.") ); _amount->setFocus(); return; } ar.prepare("SELECT nextval('aropen_aropen_id_seq') AS result;"); ar.exec(); if (ar.first()) _aropenid = ar.value("result").toInt(); else if (ar.lastError().type() != QSqlError::NoError) { systemError(this, ar.lastError().databaseText(), __FILE__, __LINE__); return; } else return; ar.prepare("INSERT INTO aropen " "( aropen_id, aropen_docdate, aropen_duedate, aropen_doctype, " " aropen_docnumber, aropen_curr_id, aropen_open, aropen_posted, aropen_amount ) " "VALUES " "( :aropen_id, :docDate, :dueDate, :docType, :docNumber, :currId, true, false, :amount ); "); ar.bindValue(":aropen_id",_aropenid); ar.bindValue(":docDate", _docDate->date()); ar.bindValue(":dueDate", _dueDate->date()); ar.bindValue(":amount", _amount->localValue()); if (_docType->currentIndex()) ar.bindValue(":docType", "D" ); else ar.bindValue(":docType", "C" ); ar.bindValue(":docNumber", _docNumber->text()); ar.bindValue(":currId", _amount->id()); ar.exec(); if (ar.lastError().type() != QSqlError::NoError) { systemError(this, ar.lastError().databaseText(), __FILE__, __LINE__); reset(); return; } } taxDetail newdlg(this, "", true); ParameterList params; params.append("curr_id", _tax->id()); params.append("date", _tax->effective()); if (!_docType->currentIndex()) params.append("sense",-1); if (_mode != cNew) params.append("readOnly"); ar.exec("SELECT getadjustmenttaxtypeid() as taxtype;"); if(ar.first()) params.append("taxtype_id", ar.value("taxtype").toInt()); params.append("order_type", "AR"); params.append("order_id", _aropenid); params.append("display_type", "A"); params.append("subtotal", _amount->localValue()); params.append("adjustment"); if (!_docType->currentIndex()) params.append("sense",-1); if (newdlg.set(params) == NoError) { newdlg.exec(); XSqlQuery taxq; taxq.prepare( "SELECT SUM(taxhist_tax) AS tax " "FROM aropentax " "WHERE (taxhist_parent_id=:aropen_id);" ); taxq.bindValue(":aropen_id", _aropenid); taxq.exec(); if (taxq.first()) { if (!_docType->currentIndex()) _tax->setLocalValue(taxq.value("tax").toDouble() * -1); else _tax->setLocalValue(taxq.value("tax").toDouble()); } else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/arOpenItem.h000066400000000000000000000026301217451700100176120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef AROPENITEM_H #define AROPENITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_arOpenItem.h" class arOpenItem : public XDialog, public Ui::arOpenItem { Q_OBJECT public: arOpenItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~arOpenItem(); virtual void populate(); QPushButton* _save; public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sClose(); virtual void sPopulateCustInfo( int pCustid ); virtual void reset(); virtual void sCalculateCommission(); virtual void sPopulateDueDate(); virtual void sPrintOnPost(int temp_id); virtual void sTaxDetail(); virtual void sReleaseNumber(); protected slots: virtual void languageChange(); private: int _mode; int _aropenid; int _last; double _cAmount; double _commprcnt; int _seqiss; }; #endif // AROPENITEM_H qt-client-4.1.0/guiclient/arOpenItem.ui000066400000000000000000000725361217451700100200140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. arOpenItem 0 0 661 700 A/R Open Item 12 5 0 Qt::Horizontal QSizePolicy::Expanding 66 10 0 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Vertical QSizePolicy::Expanding 81 0 Document Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Qt::Horizontal 0 20 Sales Rep.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Qt::Horizontal 0 20 Document Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 150 16777215 Credit Memo Debit Memo Invoice Customer Deposit Qt::Horizontal 40 20 Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::AlignRight Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::AlignRight Journal #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::AlignRight Reason Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 150 16777215 true Qt::Horizontal 40 20 Qt::Vertical 20 0 Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Paid: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Commission Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false false Tax: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 Qt::Vertical 20 0 0 1 0 Notes Account true 0 115 false false false 0 0 false From Sales Category: true false Account Number: false Qt::Vertical 20 0 Use Alternate Prepaid Account Applications 0 0 0 100 Print on post CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
CustCluster QWidget
custcluster.h
DLineEdit QWidget
datecluster.h
1
GLCluster QWidget
glcluster.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
XURLLabel QLabel
xurllabel.h
XTextEdit QTextEdit
xtextedit.h
_docDate _dueDate _docType _docNumber _orderNumber _journalNumber _rsnCode _terms _salesrep _amount _commissionDue _tab _altPrepaid _altSalescatidSelected _altSalescatid _altAccntidSelected _notes _arapply _altSalescatidSelected toggled(bool) _altSalescatid setEnabled(bool) 69 500 223 498 _docDate newDate(QDate) _amount setEffective(QDate) 158 137 467 237 _amount idChanged(int) _paid setId(int) 467 237 467 274 _amount idChanged(int) _balance setId(int) 467 237 467 312 _amount effectiveChanged(QDate) _paid setEffective(QDate) 467 237 467 274 _amount effectiveChanged(QDate) _balance setEffective(QDate) 467 237 467 312 _amount idChanged(int) _commissionDue setId(int) 467 237 467 349 _amount effectiveChanged(QDate) _commissionDue setEffective(QDate) 467 237 467 349 _altAccntidSelected toggled(bool) _altAccntid setEnabled(bool) 110 528 209 527 _amount idChanged(int) _tax setId(int) 556 235 438 785 _amount effectiveChanged(QDate) _tax setEffective(QDate) 556 235 438 785 _useAltPrepaid toggled(bool) _altSalescatidSelected setEnabled(bool) 334 495 120 552 _useAltPrepaid toggled(bool) _altAccntidSelected setEnabled(bool) 334 495 109 592 _useAltPrepaid toggled(bool) _altSalescatid setEnabled(bool) 70 486 78 513
qt-client-4.1.0/guiclient/arWorkBench.cpp000066400000000000000000000327011217451700100203110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "arWorkBench.h" #include #include #include #include #include #include "mqlutil.h" #include "cashReceipt.h" #include "storedProcErrorLookup.h" #include "xtreewidget.h" arWorkBench::arWorkBench(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _aritems = new dspAROpenItems(this, "_aritems", Qt::Widget); _aropenFrame->layout()->addWidget(_aritems); _aritems->setCloseVisible(false); _aritems->findChild("_customerSelector")->hide(); _aritems->queryAction()->setVisible(false); _aritems->findChild("_asofGroup")->hide(); _aritems->findChild("_asOf")->setDate(omfgThis->endOfTime()); _aritems->findChild("_dateGroup")->hide(); _aritems->findChild("_showGroup")->hide(); _aritems->findChild("_printGroup")->hide(); _aritems->findChild("_dueDate")->click(); _cctrans = new dspCreditCardTransactions(this, "_cctrans", Qt::Widget); _creditCardTab->layout()->addWidget(_cctrans); _cctrans->findChild("_close")->hide(); _cctrans->findChild("_customerSelector")->hide(); _cctrans->findChild("_query")->hide(); _cctrans->findChild("_alltrans")->hide(); _cctrans->findChild("_pending")->hide(); _cctrans->findChild("_processed")->hide(); _cctrans->findChild("_preauth")->hideColumn("type"); _cctrans->findChild("_preauth")->hideColumn("status"); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_newCashrcpt, SIGNAL(clicked()), this, SLOT(sNewCashrcpt())); connect(_editCashrcpt, SIGNAL(clicked()), this, SLOT(sEditCashrcpt())); connect(_viewCashrcpt, SIGNAL(clicked()), this, SLOT(sViewCashrcpt())); connect(_deleteCashrcpt, SIGNAL(clicked()), this, SLOT(sDeleteCashrcpt())); connect(_postCashrcpt, SIGNAL(clicked()), this, SLOT(sPostCashrcpt())); connect(_cashrcpt, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*)), this, SLOT(sPopulateCashRcptMenu(QMenu*))); connect(_customerSelector, SIGNAL(newState(int)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newCustId(int)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newCustTypeId(int)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newTypePattern(QString)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newCustGroupId(int)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newState(int)), _aritems->findChild("_customerSelector"), SLOT(setState(int))); connect(_customerSelector, SIGNAL(newCustId(int)), _aritems->findChild("_customerSelector"), SLOT(setCustId(int))); connect(_customerSelector, SIGNAL(newCustTypeId(int)), _aritems->findChild("_customerSelector"), SLOT(setCustTypeId(int))); connect(_customerSelector, SIGNAL(newCustGroupId(int)), _aritems->findChild("_customerSelector"), SLOT(setCustGroupId(int))); connect(_customerSelector, SIGNAL(newTypePattern(QString)), _aritems->findChild("_customerSelector"), SLOT(setTypePattern(QString))); connect(_customerSelector, SIGNAL(newState(int)), _cctrans->findChild("_customerSelector"), SLOT(setState(int))); connect(_customerSelector, SIGNAL(newCustId(int)), _cctrans->findChild("_customerSelector"), SLOT(setCustId(int))); connect(_customerSelector, SIGNAL(newCustTypeId(int)), _cctrans->findChild("_customerSelector"), SLOT(setCustTypeId(int))); connect(_customerSelector, SIGNAL(newCustGroupId(int)), _cctrans->findChild("_customerSelector"), SLOT(setCustGroupId(int))); connect(_customerSelector, SIGNAL(newTypePattern(QString)), _cctrans->findChild("_customerSelector"), SLOT(setTypePattern(QString))); connect(_debits, SIGNAL(clicked()), _aritems->findChild("_debits"), SLOT(click())); connect(_credits, SIGNAL(clicked()), _aritems->findChild("_credits"), SLOT(click())); connect(_both, SIGNAL(clicked()), _aritems->findChild("_both"), SLOT(click())); connect(_searchDocNum, SIGNAL(textChanged(const QString&)), this, SLOT(sSearchDocNumChanged())); _cashrcpt->addColumn(tr("Cust. #"), _bigMoneyColumn, Qt::AlignLeft, true, "cust_number"); _cashrcpt->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name"); _cashrcpt->addColumn(tr("Check/Doc. #"), _orderColumn, Qt::AlignLeft, true, "cashrcpt_docnumber"); _cashrcpt->addColumn(tr("Bank Account"), _orderColumn, Qt::AlignLeft, true, "bankaccnt_name"); _cashrcpt->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter,true, "cashrcpt_distdate"); _cashrcpt->addColumn(tr("Funds Type"), _bigMoneyColumn, Qt::AlignCenter,true, "cashrcpt_fundstype"); _cashrcpt->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight, true, "cashrcpt_amount"); _cashrcpt->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currabbr"); if (_privileges->check("MaintainCashReceipts")) { connect(_cashrcpt, SIGNAL(valid(bool)), _editCashrcpt, SLOT(setEnabled(bool))); connect(_cashrcpt, SIGNAL(valid(bool)), _deleteCashrcpt, SLOT(setEnabled(bool))); if (_privileges->check("PostCashReceipts")) connect(_cashrcpt, SIGNAL(valid(bool)), _postCashrcpt, SLOT(setEnabled(bool))); } else { _newCashrcpt->setEnabled(FALSE); connect(_cashrcpt, SIGNAL(itemSelected(int)), _viewCashrcpt, SLOT(animateClick())); } if(_privileges->check("PostCashReceipts")) connect(_cashrcpt, SIGNAL(itemSelected(int)), _editCashrcpt, SLOT(animateClick())); connect(omfgThis, SIGNAL(cashReceiptsUpdated(int, bool)), this, SLOT(sFillList())); if (omfgThis->singleCurrency()) _cashrcpt->hideColumn(2); if (!_metrics->boolean("CCAccept") || !_privileges->check("ProcessCreditCards")) _tab->removeTab(_tab->indexOf(_creditCardTab)); } arWorkBench::~arWorkBench() { // no need to delete child widgets, Qt does it all for us } void arWorkBench::languageChange() { retranslateUi(this); } enum SetResponse arWorkBench::set( const ParameterList & pParams ) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) { _customerSelector->setCustId(param.toInt()); sFillList(); } return NoError; } bool arWorkBench::setParams(ParameterList ¶ms) { _customerSelector->appendValue(params); params.append("invoice", tr("Invoice")); params.append("creditMemo", tr("Credit Memo")); params.append("debitMemo", tr("Debit Memo")); params.append("cashdeposit", tr("Customer Deposit")); params.append("other", tr("Other")); params.append("orderByDocDate"); return true; } void arWorkBench::sFillList() { if (_selectDate->currentIndex()==0) { _aritems->findChild("_dates")->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _aritems->findChild("_dates")->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); } else if (_selectDate->currentIndex()==1) { _aritems->findChild("_dates")->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _aritems->findChild("_dates")->setEndDate(_onOrBeforeDate->date()); } else { _aritems->findChild("_dates")->setStartDate(_startDate->date()); _aritems->findChild("_dates")->setEndDate(_endDate->date()); } _aritems->findChild("_unposted")->setChecked(_unposted->isChecked()); _aritems->findChild("_dateGroup")->hide(); _aritems->findChild("_dateGroup")->hide(); _aritems->sFillList(); sFillCashrcptList(); _cctrans->sFillList(); } void arWorkBench::sClear() { _aritems->list()->clear(); _cashrcpt->clear(); _cctrans->findChild("_preauth")->clear(); } void arWorkBench::sFillCashrcptList() { XSqlQuery arFillCashrcptList; MetaSQLQuery mql = mqlLoad("unpostedCashReceipts", "detail"); ParameterList params; setParams(params); params.append("check", tr("Check")); params.append("certifiedCheck", tr("Certified Check")); params.append("masterCard", tr("Master Card")); params.append("visa", tr("Visa")); params.append("americanExpress", tr("American Express")); params.append("discoverCard", tr("Discover Card")); params.append("otherCreditCard", tr("Other Credit Card")); params.append("cash", tr("Cash")); params.append("wireTransfer", tr("Wire Transfer")); params.append("other", tr("Other")); arFillCashrcptList = mql.toQuery(params); _cashrcpt->populate(arFillCashrcptList); } void arWorkBench::sNewCashrcpt() { ParameterList params; params.append("mode", "new"); if (_customerSelector->isSelectedCust()) params.append("cust_id", _customerSelector->custId()); cashReceipt *newdlg = new cashReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void arWorkBench::sEditCashrcpt() { ParameterList params; params.append("mode", "edit"); params.append("cashrcpt_id", _cashrcpt->id()); cashReceipt *newdlg = new cashReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void arWorkBench::sViewCashrcpt() { ParameterList params; params.append("mode", "view"); params.append("cashrcpt_id", _cashrcpt->id()); cashReceipt *newdlg = new cashReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void arWorkBench::sDeleteCashrcpt() { XSqlQuery arDeleteCashrcpt; arDeleteCashrcpt.prepare("SELECT deleteCashrcpt(:cashrcpt_id) AS result;"); arDeleteCashrcpt.bindValue(":cashrcpt_id", _cashrcpt->id()); arDeleteCashrcpt.exec(); if (arDeleteCashrcpt.first()) { int result = arDeleteCashrcpt.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteCashrcpt", result)); return; } } else if (arDeleteCashrcpt.lastError().type() != QSqlError::NoError) { systemError(this, arDeleteCashrcpt.lastError().databaseText(), __FILE__, __LINE__); return; } sFillCashrcptList(); } void arWorkBench::sPostCashrcpt() { XSqlQuery arPostCashrcpt; int journalNumber = -1; arPostCashrcpt.exec("BEGIN;"); arPostCashrcpt.exec("SELECT fetchJournalNumber('C/R') AS journalnumber;"); if (arPostCashrcpt.first()) journalNumber = arPostCashrcpt.value("journalnumber").toInt(); else if (arPostCashrcpt.lastError().type() != QSqlError::NoError) { systemError(this, arPostCashrcpt.lastError().databaseText(), __FILE__, __LINE__); return; } QList selected = _cashrcpt->selectedItems(); for (int i = 0; i < selected.size(); i++) { arPostCashrcpt.prepare("SELECT postCashReceipt(:cashrcpt_id, :journalNumber) AS result;"); arPostCashrcpt.bindValue(":cashrcpt_id", ((XTreeWidgetItem*)(selected[i]))->id()); arPostCashrcpt.bindValue(":journalNumber", journalNumber); arPostCashrcpt.exec(); if (arPostCashrcpt.first()) { int result = arPostCashrcpt.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postCashReceipt", result), __FILE__, __LINE__); arPostCashrcpt.exec("ROLLBACK;"); return; } } else if (arPostCashrcpt.lastError().type() != QSqlError::NoError) { systemError(this, arPostCashrcpt.lastError().databaseText(), __FILE__, __LINE__); arPostCashrcpt.exec("ROLLBACK;"); return; } } arPostCashrcpt.exec("COMMIT;"); sFillList(); } void arWorkBench::sPopulateCashRcptMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Cash Receipt..."), this, SLOT(sEditCashrcpt())); if (! _privileges->check("MaintainCashReceipts") && ! _privileges->check("ViewCashReceipts")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View Cash Receipt..."), this, SLOT(sViewCashrcpt())); if (! _privileges->check("ViewCashReceipts")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Delete Cash Receipt..."), this, SLOT(sDeleteCashrcpt())); if (! _privileges->check("MaintainCashReceipts")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post Cash Receipt..."), this, SLOT(sPostCashrcpt())); if (! _privileges->check("PostCashReceipts")) menuItem->setEnabled(false); } void arWorkBench::sSearchDocNumChanged() { XTreeWidget *aropen = _aritems->list(); QString sub = _searchDocNum->text().trimmed(); if(sub.isEmpty()) return; QList list = aropen->findItems(sub, Qt::MatchFixedString|Qt::MatchCaseSensitive, 4); if(list.isEmpty()) list = aropen->findItems(sub, Qt::MatchFixedString|Qt::MatchStartsWith|Qt::MatchCaseSensitive, 4); if(!list.isEmpty()) { aropen->setCurrentItem(list.at(0)); aropen->scrollTo(aropen->currentIndex()); } } qt-client-4.1.0/guiclient/arWorkBench.h000066400000000000000000000027611217451700100177610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ARWORKBENCH_H #define ARWORKBENCH_H #include "guiclient.h" #include "xwidget.h" #include #include #include "ui_arWorkBench.h" #include "dspAROpenItems.h" #include "dspCreditCardTransactions.h" class arWorkBench : public XWidget, public Ui::arWorkBench { Q_OBJECT public: arWorkBench(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~arWorkBench(); virtual SetResponse set( const ParameterList & pParams ); public slots: virtual bool setParams(ParameterList ¶ms); virtual void sDeleteCashrcpt(); virtual void sEditCashrcpt(); virtual void sFillCashrcptList(); virtual void sFillList(); virtual void sNewCashrcpt(); virtual void sPopulateCashRcptMenu(QMenu*); virtual void sPostCashrcpt(); virtual void sViewCashrcpt(); virtual void sClear(); virtual void sSearchDocNumChanged(); protected: dspAROpenItems *_aritems; dspCreditCardTransactions *_cctrans; protected slots: virtual void languageChange(); }; #endif // ARWORKBENCH_H qt-client-4.1.0/guiclient/arWorkBench.ui000066400000000000000000000353671217451700100201570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. arWorkBench 0 0 800 600 Receivables Workbench Qt::Horizontal 40 20 &Close &Query Qt::Vertical QSizePolicy::MinimumExpanding 20 0 0 1 0 Receivables Find Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter All On or Before Between 0 true Qt::Horizontal 40 20 and Qt::Horizontal 40 20 0 1 QFrame::NoFrame QFrame::Raised 0 0 12 Debits Credits Both true Unposted Qt::Horizontal 40 20 Cash Receipts 1 0 QAbstractItemView::ExtendedSelection 0 New false Edit false View false Delete false Post Qt::Vertical QSizePolicy::Expanding 82 41 Credit Card CustomerSelector QWidget
customerselector.h
DLineEdit QWidget
datecluster.h
1
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
_cashrcpt _newCashrcpt _editCashrcpt _viewCashrcpt _deleteCashrcpt _postCashrcpt _close _close clicked() arWorkBench close() 717 46 20 20 _cashrcpt valid(bool) _viewCashrcpt setEnabled(bool) 388 421 388 421 _selectDate currentIndexChanged(int) _duedateStack setCurrentIndex(int) 372 189 592 188
qt-client-4.1.0/guiclient/archRestoreSalesHistory.cpp000066400000000000000000000121551217451700100227400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "archRestoreSalesHistory.h" #include #include "metasql.h" #include "errorReporter.h" #define cArchive 0x01 #define cRestore 0x02 archRestoreSalesHistory::archRestoreSalesHistory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSelect())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _customerType->setType(ParameterGroup::CustomerType); _productCategory->setType(ParameterGroup::ProductCategory); } archRestoreSalesHistory::~archRestoreSalesHistory() { // no need to delete child widgets, Qt does it all for us } void archRestoreSalesHistory::languageChange() { retranslateUi(this); } enum SetResponse archRestoreSalesHistory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("archieve", &valid); if (valid) { _mode = cArchive; setWindowTitle(tr("Archive Sales History")); _miscItems->setText(tr("Archive Freight, Sales Tax and Misc. Items")); } param = pParams.value("restore", &valid); if (valid) { _mode = cRestore; setWindowTitle(tr("Restore Sales History")); _miscItems->setText(tr("Restore Freight, Sales Tax and Misc. Items")); } return NoError; } void archRestoreSalesHistory::sSelect() { // TODO: can we reduce the diffs between archive and restore cases? // TODO: can we reduce the diffs between miscitems and else cases? MetaSQLQuery mql("" "SELECT archiveSalesHistory(cohist_id) " " FROM custinfo" " JOIN custtype ON (cust_custtype_id=custtype_id)" " JOIN cohist ON (cohist_cust_id=cust_id)" " LEFT OUTER JOIN itemsite ON (cohist_itemsite_id=itemsite_id)" " LEFT OUTER JOIN item ON (itemsite_item_id=item_id)" " LEFT OUTER JOIN prodcat ON (item_prodcat_id=prodcat_id)" " WHERE (cohist_invcdate BETWEEN AND )" "" "SELECT restoreSalesHistory(asohist_id) " " FROM custinfo" " JOIN custtype ON (cust_custtype_id=custtype_id)" " JOIN asohist ON (asohist_cust_id=cust_id)" " LEFT OUTER JOIN itemsite ON (asohist_itemsite_id=itemsite_id) " " LEFT OUTER JOIN item ON (itemsite_item_id=item_id)" " LEFT OUTER JOIN prodcat ON (item_prodcat_id=prodcat_id)" "WHERE (asohist_invcdate BETWEEN AND )" "" "" " " " AND ( (itemsite_id IS NULL) OR (itemsite_warehous_id=:warehous_id) )" " " " " " AND ( (itemsite_id IS NULL) OR (prodcat_id=) )" " " " AND ( (itemsite_id IS NULL) OR (prodcat_code ~ ) )" "" " AND (itemsite_id IS NOT NULL)" " " " AND (itemsite_warehous_id=:warehous_id)" " " " " " AND (prodcat_id=)" " " " AND (prodcat_code ~ )" " " "" "" " AND (custtype_id=)" "" " AND (custtype_code ~ )" " );"); ParameterList params; if (_mode == cArchive) params.append("archive"); else if (_mode == cRestore) params.append("restore"); if (_miscItems->isChecked()) params.append("miscitems"); _warehouse->appendValue(params); _customerType->appendValue(params); _productCategory->appendValue(params); _dates->appendValue(params); XSqlQuery qry = mql.toQuery(params); qry.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Processing Error"), qry, __FILE__, __LINE__)) reject(); accept(); } qt-client-4.1.0/guiclient/archRestoreSalesHistory.h000066400000000000000000000021101217451700100223730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ARCHRESTORESALESHISTORY_H #define ARCHRESTORESALESHISTORY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_archRestoreSalesHistory.h" class archRestoreSalesHistory : public XDialog, public Ui::archRestoreSalesHistory { Q_OBJECT public: archRestoreSalesHistory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~archRestoreSalesHistory(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSelect(); protected slots: virtual void languageChange(); private: int _mode; }; #endif // ARCHRESTORESALESHISTORY_H qt-client-4.1.0/guiclient/archRestoreSalesHistory.ui000066400000000000000000000061621217451700100225740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. archRestoreSalesHistory 0 0 703 305 Archive/Restore Sales History false false Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok false Act on Miscellaneous Items true DateCluster QWidget
datecluster.h
ParameterGroup QGroupBox
parametergroup.h
WarehouseGroup QGroupBox
warehousegroup.h
_customerType _miscItems
qt-client-4.1.0/guiclient/assignClassCodeToPlannerCode.cpp000066400000000000000000000044161217451700100235710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "assignClassCodeToPlannerCode.h" #include #include assignClassCodeToPlannerCode::assignClassCodeToPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sAssign())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _classCode->setType(ParameterGroup::ClassCode); _planCode->setAllowNull(TRUE); _planCode->setType(XComboBox::PlannerCodes); } assignClassCodeToPlannerCode::~assignClassCodeToPlannerCode() { // no need to delete child widgets, Qt does it all for us } void assignClassCodeToPlannerCode::languageChange() { retranslateUi(this); } void assignClassCodeToPlannerCode::sAssign() { XSqlQuery assignAssign; if(!_planCode->isValid()) { QMessageBox::warning(this, tr("No Planner Code Selected"), tr("You must select a Planner Code to assign before continuing.") ); return; } QString sql( "UPDATE itemsite " "SET itemsite_plancode_id=:plancode_id " "FROM item " "WHERE ( (itemsite_item_id=item_id)" ); if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ");"; assignAssign.prepare(sql); assignAssign.bindValue(":plancode_id", _planCode->id()); assignAssign.bindValue(":classcode_id", _classCode->id()); assignAssign.bindValue(":classcode_pattern", _classCode->pattern()); assignAssign.bindValue(":warehous_id", _warehouse->id()); assignAssign.exec(); accept(); } qt-client-4.1.0/guiclient/assignClassCodeToPlannerCode.h000066400000000000000000000020021217451700100232230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ASSIGNCLASSCODETOPLANNERCODE_H #define ASSIGNCLASSCODETOPLANNERCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_assignClassCodeToPlannerCode.h" class assignClassCodeToPlannerCode : public XDialog, public Ui::assignClassCodeToPlannerCode { Q_OBJECT public: assignClassCodeToPlannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~assignClassCodeToPlannerCode(); public slots: virtual void sAssign(); protected slots: virtual void languageChange(); }; #endif // ASSIGNCLASSCODETOPLANNERCODE_H qt-client-4.1.0/guiclient/assignClassCodeToPlannerCode.ui000066400000000000000000000065001217451700100234200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. assignClassCodeToPlannerCode 0 0 413 278 Assign Items to Planner Code by Class Code false Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save false 5 Planner Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 ParameterGroup QGroupBox
parametergroup.h
WarehouseGroup QGroupBox
warehousegroup.h
XComboBox QComboBox
xcombobox.h
_planCode
qt-client-4.1.0/guiclient/assignItemToPlannerCode.cpp000066400000000000000000000036731217451700100226330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "assignItemToPlannerCode.h" #include #include assignItemToPlannerCode::assignItemToPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_item, SIGNAL(valid(bool)), _buttonBox->button(QDialogButtonBox::Ok), SLOT(setEnabled(bool))); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sAssign())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _plannerCode->setAllowNull(TRUE); _plannerCode->setType(XComboBox::PlannerCodes); } assignItemToPlannerCode::~assignItemToPlannerCode() { // no need to delete child widgets, Qt does it all for us } void assignItemToPlannerCode::languageChange() { retranslateUi(this); } void assignItemToPlannerCode::sAssign() { XSqlQuery assignAssign; if(!_plannerCode->isValid()) { QMessageBox::warning(this, tr("No Planner Code Selected"), tr("You must select a Planner Code to assign before continuing.") ); return; } QString sql( "UPDATE itemsite " "SET itemsite_plancode_id=:plancode_id " "WHERE ( (itemsite_item_id=:item_id)" ); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ");"; assignAssign.prepare(sql); _warehouse->bindValue(assignAssign); assignAssign.bindValue(":plancode_id", _plannerCode->id()); assignAssign.bindValue(":item_id", _item->id()); assignAssign.exec(); accept(); } qt-client-4.1.0/guiclient/assignItemToPlannerCode.h000066400000000000000000000017321217451700100222720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ASSIGNITEMTOPLANNERCODE_H #define ASSIGNITEMTOPLANNERCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_assignItemToPlannerCode.h" class assignItemToPlannerCode : public XDialog, public Ui::assignItemToPlannerCode { Q_OBJECT public: assignItemToPlannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~assignItemToPlannerCode(); public slots: virtual void sAssign(); protected slots: virtual void languageChange(); }; #endif // ASSIGNITEMTOPLANNERCODE_H qt-client-4.1.0/guiclient/assignItemToPlannerCode.ui000066400000000000000000000105571217451700100224650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. assignItemToPlannerCode 0 0 476 250 Assign Item to Planner Code Qt::Horizontal QSizePolicy::Expanding 13 61 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok 0 false Qt::Horizontal QSizePolicy::Expanding 222 20 5 &Planner Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _plannerCode 0 0 Qt::Horizontal 40 20 ItemCluster QWidget
itemcluster.h
1
WarehouseGroup QGroupBox
warehousegroup.h
XComboBox QComboBox
xcombobox.h
_item _warehouse _plannerCode
qt-client-4.1.0/guiclient/assignLotSerial.cpp000066400000000000000000000256641217451700100212210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "assignLotSerial.h" #include #include #include #include #include #include "createLotSerial.h" #include "printOptions.h" #include "xtsettings.h" #include #include assignLotSerial::assignLotSerial(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _print = _buttonBox->addButton(tr("Print"), QDialogButtonBox::ActionRole); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sAssign())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_options, SIGNAL(clicked()), this, SLOT(sPrintOptions())); _itemlocSeries = -1; _trapClose = TRUE; _item->setReadOnly(TRUE); _itemlocdist->addColumn( tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "ls_number"); _itemlocdist->addColumn( tr("Expires"), _dateColumn, Qt::AlignCenter,true, "itemlocdist_expiration"); _itemlocdist->addColumn( tr("Warranty"),_dateColumn, Qt::AlignCenter,true, "itemlocdist_warranty"); _itemlocdist->addColumn( tr("Qty."), _qtyColumn, Qt::AlignRight, true, "itemlocdist_qty"); _qtyToAssign->setPrecision(omfgThis->qtyVal()); _qtyAssigned->setPrecision(omfgThis->qtyVal()); _qtyBalance->setPrecision(omfgThis->qtyVal()); } assignLotSerial::~assignLotSerial() { // no need to delete child widgets, Qt does it all for us } void assignLotSerial::languageChange() { retranslateUi(this); } enum SetResponse assignLotSerial::set(const ParameterList &pParams) { XSqlQuery assignet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemlocseries", &valid); if (valid) _itemlocSeries = param.toInt(); param = pParams.value("itemlocdist_id", &valid); if (valid) { _itemlocdistid = param.toInt(); if (_itemlocSeries == -1) { assignet.exec("SELECT NEXTVAL('itemloc_series_seq') AS _itemloc_series;"); if (assignet.lastError().type() != QSqlError::NoError) { systemError(this, assignet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } else { assignet.first(); _itemlocSeries = assignet.value("_itemloc_series").toInt(); } } XSqlQuery ild; ild.prepare( "SELECT p.itemlocdist_itemsite_id AS itemlocdist_itemsite_id, " " p.itemlocdist_qty AS trans_qty, " " COALESCE(SUM(c.itemlocdist_qty),0) AS assigned_qty " "FROM itemlocdist p " " LEFT OUTER JOIN itemlocdist c ON ((c.itemlocdist_source_id=p.itemlocdist_id) " " AND (c.itemlocdist_source_type='D')) " "WHERE (p.itemlocdist_id=:itemlocdist_id) " "GROUP BY p.itemlocdist_itemsite_id, p.itemlocdist_qty;" ); ild.bindValue(":itemlocdist_id", _itemlocdistid); ild.exec(); if (ild.first()) _item->setItemsiteid(ild.value("itemlocdist_itemsite_id").toInt()); else if (ild.lastError().type() != QSqlError::NoError) { systemError(this, ild.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } sFillList(); if (ild.value("trans_qty").toDouble() > ild.value("assigned_qty").toDouble()) sNew(); } return NoError; } void assignLotSerial::closeEvent(QCloseEvent *pEvent) { if (_trapClose) { QMessageBox::critical( this, tr("Cannot Cancel Distribution"), tr("

You must indicate the Lot/Serial # to " "assign and select the 'Assign' button. You may " "not cancel this action." ) ); pEvent->ignore(); } else pEvent->accept(); } void assignLotSerial::sNew() { ParameterList params; params.append("itemloc_series", _itemlocSeries); params.append("itemlocdist_id", _itemlocdistid); params.append("qtyRemaining", _qtyBalance->text()); createLotSerial newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillList(); if (_qtyBalance->toDouble() > 0) sNew(); } } void assignLotSerial::sDelete() { XSqlQuery assignDelete; assignDelete.prepare( "SELECT deleteItemlocdist(:itemlocdist_id);" ); assignDelete.bindValue(":itemlocdist_id", _itemlocdist->id()); assignDelete.exec(); if (assignDelete.lastError().type() != QSqlError::NoError) { systemError(this, assignDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void assignLotSerial::sClose() { XSqlQuery assignClose; assignClose.prepare( "DELETE FROM itemlocdist " "WHERE ( (itemlocdist_source_type='D')" " AND (itemlocdist_source_id=:source_id) );" ); assignClose.bindValue(":source_id", _itemlocdistid); assignClose.exec(); if (assignClose.lastError().type() != QSqlError::NoError) { systemError(this, assignClose.lastError().databaseText(), __FILE__, __LINE__); return; } reject(); } void assignLotSerial::sAssign() { XSqlQuery assignAssign; if (_qtyBalance->toDouble() != 0.0) { QMessageBox::warning( this, tr("Incomplete Assignment"), tr( "

You must assign a Lot/Serial # to the " "remaining Quantity before saving this " "assignment." ) ); _new->setFocus(); return; } if (xtsettingsValue(QString("%1.autoPrint").arg(objectName())).toBool()) sPrint(); assignAssign.prepare( "UPDATE itemlocdist " "SET itemlocdist_source_type='O' " "WHERE (itemlocdist_series=:itemlocdist_series);" "DELETE FROM itemlocdist " "WHERE (itemlocdist_id=:itemlocdist_id);" ); assignAssign.bindValue(":itemlocdist_series", _itemlocSeries); assignAssign.bindValue(":itemlocdist_id", _itemlocdistid); assignAssign.exec(); if (assignAssign.lastError().type() != QSqlError::NoError) { systemError(this, assignAssign.lastError().databaseText(), __FILE__, __LINE__); return; } _trapClose = FALSE; done(_itemlocSeries); } void assignLotSerial::sFillList() { XSqlQuery assignFillList; double openQty = 0; assignFillList.prepare( "SELECT itemlocdist_qty AS qty " "FROM itemlocdist " "WHERE (itemlocdist_id=:itemlocdist_id);" ); assignFillList.bindValue(":itemlocdist_id", _itemlocdistid); assignFillList.exec(); if (assignFillList.first()) { openQty = assignFillList.value("qty").toDouble(); _qtyToAssign->setDouble(openQty); } else if (assignFillList.lastError().type() != QSqlError::NoError) { systemError(this, assignFillList.lastError().databaseText(), __FILE__, __LINE__); return; } assignFillList.prepare( "SELECT COALESCE(SUM(itemlocdist_qty), 0) AS totalqty " "FROM itemlocdist " "WHERE (itemlocdist_series=:itemlocdist_series);" ); assignFillList.bindValue(":itemlocdist_series", _itemlocSeries); assignFillList.exec(); if (assignFillList.first()) { _qtyAssigned->setDouble(assignFillList.value("totalqty").toDouble()); _qtyBalance->setDouble(openQty - assignFillList.value("totalqty").toDouble()); } else if (assignFillList.lastError().type() != QSqlError::NoError) { systemError(this, assignFillList.lastError().databaseText(), __FILE__, __LINE__); return; } assignFillList.prepare( "SELECT itemlocdist_id, itemlocdist_ls_id, " " itemlocdist_qty,itemlocdist_expiration, " " itemlocdist_warranty, ls_number," " CASE WHEN (NOT itemsite_perishable) THEN :na " " END AS itemlocdist_expiration_qtdisplayrole, " " CASE WHEN (NOT itemsite_warrpurc) THEN :na " " END AS itemlocdist_warranty_qtdisplayrole, " " 'qty' AS itemlocdist_qty_xtnumericrole " "FROM itemlocdist " "LEFT OUTER JOIN itemsite ON (itemlocdist_itemsite_id = itemsite_id), " "ls " "WHERE (itemlocdist_series=:itemlocdist_series) " "AND (itemlocdist_ls_id=ls_id) " "ORDER BY ls_number;" ); assignFillList.bindValue(":itemlocdist_series", _itemlocSeries); assignFillList.bindValue(":na", "N/A"); assignFillList.exec(); _itemlocdist->populate(assignFillList, true); if (assignFillList.lastError().type() != QSqlError::NoError) { systemError(this, assignFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void assignLotSerial::sPrint() { QPrinter printer(QPrinter::HighResolution); bool setupPrinter = true; bool userCanceled = false; QString label; QString presetPrinter(xtsettingsValue(QString("%1.defaultPrinter").arg(objectName())).toString()); XSqlQuery qlabel; qlabel.prepare("SELECT ls_id, itemsite_controlmethod " "FROM itemlocdist " "LEFT OUTER JOIN itemsite ON (itemlocdist_itemsite_id = itemsite_id) " "JOIN ls ON (itemlocdist_ls_id=ls_id) " "WHERE (itemlocdist_series=:itemlocdist_series) " "ORDER BY ls_number;"); qlabel.bindValue(":itemlocdist_series", _itemlocSeries); qlabel.exec(); if (qlabel.first()) { if (qlabel.value("itemsite_controlmethod").toString() == "L") label = tr("Lot#:"); else label = tr("Serial#:"); if (presetPrinter.isEmpty()) { if (orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) { systemError(this, tr("

Could not initialize printing system for " "multiple reports.")); return; } } } else { printer.setPrinterName(presetPrinter); orReport::beginMultiPrint(&printer); } for (int i = 0; i < qlabel.size(); i++) { ParameterList params; params.append("label", label); params.append("ls_id", qlabel.value("ls_id").toInt()); orReport report("LotSerialLabel", params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = false; else { report.reportError(this); break; } qlabel.next(); } orReport::endMultiPrint(&printer); } else if (qlabel.lastError().type() != QSqlError::NoError) { systemError(this, qlabel.lastError().databaseText(), __FILE__, __LINE__); return; } } void assignLotSerial::sPrintOptions() { ParameterList params; params.append("parentName", objectName()); printOptions newdlg(this); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/assignLotSerial.h000066400000000000000000000024731217451700100206570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ASSIGNLOTSERIAL_H #define ASSIGNLOTSERIAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_assignLotSerial.h" class assignLotSerial : public XDialog, public Ui::assignLotSerial { Q_OBJECT public: assignLotSerial(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~assignLotSerial(); QPushButton* _print; public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sNew(); virtual void sDelete(); virtual void sClose(); virtual void sAssign(); virtual void sFillList(); virtual void sPrint(); virtual void sPrintOptions(); protected slots: virtual void languageChange(); private: int _itemlocSeries; int _itemlocdistid; bool _trapClose; }; #endif // ASSIGNLOTSERIAL_H qt-client-4.1.0/guiclient/assignLotSerial.ui000066400000000000000000000220071217451700100210400ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. assignLotSerial 0 0 516 518 Assign Lot/Serial # Qty. to Assign: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Assigned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Remaining: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 13 20 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Lot/Serial # Assignment 7 &New false &Delete Qt::Vertical QSizePolicy::Expanding 20 16 Qt::Horizontal 40 20 Options... ItemCluster QWidget

itemcluster.h
1 XLabel QLabel
xlabel.h
XTreeWidget QTreeWidget
xtreewidget.h
1
_item _itemlocdist _new _delete _itemlocdist valid(bool) _delete setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/atlasMap.cpp000066400000000000000000000246711217451700100176550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "atlasMap.h" #include #include #include #include #include #include #include "storedProcErrorLookup.h" #define DEBUG false // TODO: replace with XMessageBoxMessageHandler class AtlasMapMessageHandler : public QAbstractMessageHandler { public: AtlasMapMessageHandler(QObject *p = 0) : QAbstractMessageHandler(p) { } protected: virtual void handleMessage(QtMsgType type, const QString &description, const QUrl &identifier, const QSourceLocation &sourceLocation) { QString msg = atlasMap::tr("

There was a problem reading the Atlas file, " "line %1 column %2: %3
(%4)") .arg(sourceLocation.line()) .arg(sourceLocation.column()) .arg(description) .arg(identifier.toString()); switch (type) { case QtDebugMsg: QMessageBox::information(0, atlasMap::tr("XML Error"), msg); break; case QtWarningMsg: QMessageBox::warning(0, atlasMap::tr("XML Error"), msg); break; case QtCriticalMsg: case QtFatalMsg: default: QMessageBox::critical(0, atlasMap::tr("XML Error"), msg); break; } } }; bool atlasMap::userHasPriv() { return _privileges->check("ConfigureImportExport"); } int atlasMap::exec() { if (userHasPriv()) return XDialog::exec(); else { systemError(this, tr("You do not have sufficient privilege to view this window"), __FILE__, __LINE__); return XDialog::Rejected; } } atlasMap::atlasMap(QWidget* parent, const char * name, Qt::WFlags fl) : XDialog(parent, name, fl) { setupUi(this); connect(_atlas, SIGNAL(editingFinished()), this, SLOT(sHandleAtlas())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); QString filter = tr("Atlas Files (*.xml)"); _atlas->setFilter(filter); _filtertype->append(0, tr("File name"), "filename"); _filtertype->append(1, tr("First line of file"), "firstline"); _mode = cNew; _atlasmapId = -1; _msghandler = new AtlasMapMessageHandler(this); #if defined Q_WS_MACX _defaultDir = _metrics->value("CSVAtlasDefaultDirMac"); #elif defined Q_WS_WIN _defaultDir = _metrics->value("CSVAtlasDefaultDirWindows"); #elif defined Q_WS_X11 _defaultDir = _metrics->value("CSVAtlasDefaultDirLinux"); #endif } atlasMap::~atlasMap() { // no need to delete child widgets, Qt does it all for us } void atlasMap::languageChange() { retranslateUi(this); } enum SetResponse atlasMap::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("defaultDir", &valid); if (valid) _defaultDir = param.toString(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(false); _filter->setEnabled(false); _filtertype->setEnabled(false); _atlas->setEnabled(false); _map->setEnabled(false); _firstLine->setEnabled(false); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } param = pParams.value("atlasmap_id", &valid); if (valid) { _atlasmapId = param.toInt(); sPopulate(); } return NoError; } void atlasMap::sSave() { QString errorCaption = tr("Cannot Save Atlas Map"); struct { bool condition; QString msg; QWidget* widget; } error[] = { { _name->text().trimmed().isEmpty(), tr("

Please enter a name for this Atlas Map before saving it."), _name }, { _filter->text().trimmed().isEmpty(), tr("

Please enter a filter before saving this Atlas Map."), _filter }, { _filtertype->currentText().trimmed().isEmpty(), tr("

Please select a filter type before saving this Atlas Map."), _filtertype }, { _atlas->text().trimmed().isEmpty(), tr("

Please enter an Atlas File Name before saving this Atlas Map."), _atlas }, { _map->id() <= -1, tr("Please select a Map Name before saving this Atlas Map."), _map }, { true, "", NULL } }; // error[] int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, errorCaption, error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery dupq; dupq.prepare( "SELECT atlasmap_name " "FROM atlasmap " "WHERE ((atlasmap_name=:name)" " AND (atlasmap_id<>:atlasmap_id) );" ); dupq.bindValue(":atlasmap_id", _atlasmapId); dupq.bindValue(":name", _name->text()); dupq.exec(); if (dupq.first()) { QMessageBox::critical(this, errorCaption, tr("

This Name is already in use by another " "Atlas Map.")); _name->setFocus(); return; } else if (dupq.lastError().type() != QSqlError::NoError) { systemError(this, dupq.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery upsq; if (cNew == _mode) upsq.prepare("INSERT INTO atlasmap (" " atlasmap_name, atlasmap_filter, atlasmap_filtertype," " atlasmap_atlas, atlasmap_map, atlasmap_headerline" ") VALUES (" " :name, :filter, :filtertype," " :atlas, :map, :headerline" ") RETURNING atlasmap_id;"); else if (cEdit == _mode) { upsq.prepare("UPDATE atlasmap SET" " atlasmap_name=:name," " atlasmap_filter=:filter," " atlasmap_filtertype=:filtertype," " atlasmap_atlas=:atlas," " atlasmap_map=:map," " atlasmap_headerline=:headerline" " WHERE (atlasmap_id=:id)" " RETURNING atlasmap_id;"); upsq.bindValue(":id", _atlasmapId); } upsq.bindValue(":name", _name->text()); upsq.bindValue(":filter", _filter->text()); upsq.bindValue(":filtertype", _filtertype->code()); upsq.bindValue(":atlas", _atlas->text()); upsq.bindValue(":map", _map->currentText()); upsq.bindValue(":headerline", _firstLine->isChecked()); upsq.exec(); if (upsq.first()) _atlasmapId = upsq.value("atlasmap_id").toInt(); else if (upsq.lastError().type() != QSqlError::NoError) { systemError(this, upsq.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void atlasMap::sPopulate() { XSqlQuery atlasPopulate; if (_atlasmapId <= 0) { _name->clear(); _filter->clear(); _filtertype->setId(-1); _atlas->clear(); _map->setId(-1); _firstLine->setChecked(false); } else { atlasPopulate.prepare("SELECT * FROM atlasmap WHERE (atlasmap_id=:id);"); atlasPopulate.bindValue(":id", _atlasmapId); atlasPopulate.exec(); if (atlasPopulate.first()) { _name->setText(atlasPopulate.value("atlasmap_name").toString()); _filter->setText(atlasPopulate.value("atlasmap_filter").toString()); _filtertype->setCode(atlasPopulate.value("atlasmap_filtertype").toString()); _atlas->setText(atlasPopulate.value("atlasmap_atlas").toString()); sHandleAtlas(); if (! atlasPopulate.value("atlasmap_map").toString().isEmpty()) _map->setCode(atlasPopulate.value("atlasmap_map").toString()); _firstLine->setChecked(atlasPopulate.value("atlasmap_headerline").toBool()); } else if (atlasPopulate.lastError().type() != QSqlError::NoError) { systemError(this, atlasPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } } void atlasMap::sHandleAtlas() { _map->clear(); if (_atlas->text().isEmpty()) return; if (DEBUG) qDebug("atlasMap::sHandleAtlas() entered with %s and %s", qPrintable(_atlas->text()), qPrintable(_defaultDir)); if (! _defaultDir.isEmpty() && _atlas->text().startsWith(_defaultDir)) _atlas->setText(_atlas->text().remove(0, _defaultDir.length() + 1)); QFile atlasfile; if (QFile::exists(_atlas->text())) atlasfile.setFileName(_atlas->text()); else if (QFile::exists(_defaultDir + QDir::separator() + _atlas->text())) atlasfile.setFileName(_defaultDir + QDir::separator() + _atlas->text()); else { QMessageBox::warning(this, tr("Could not find Atlas"), tr("

Could not find the Atlas file to open to look " "for CSV import Maps.")); return; } if (! atlasfile.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Could not open Atlas"), tr("

Could not open the Atlas file %1 (error %2).") .arg(atlasfile.fileName(), atlasfile.errorString())); return; } QXmlQuery mapq; mapq.setMessageHandler(_msghandler); if (! mapq.setFocus(&atlasfile)) { QMessageBox::critical(this, tr("No Focus"), tr("

Could not set focus on the Atlas %1") .arg(atlasfile.fileName())); return; } // string() at the end tells the query to generate a sequence of values mapq.setQuery("/CSVAtlas/CSVMap/Name/text()/string()"); if (! mapq.isValid()) { QMessageBox::critical(this, tr("Invalid Query"), tr("

The query is not valid for some reason")); return; } QStringList maplist; if (! mapq.evaluateTo(&maplist)) { QMessageBox::warning(this, tr("No Maps"), tr("

Could not find any Maps in the Atlas %1") .arg(atlasfile.fileName())); return; } else for (int i = 0; i < maplist.size(); i++) _map->append(i, maplist.at(i)); } qt-client-4.1.0/guiclient/atlasMap.h000066400000000000000000000023031217451700100173060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ATLASMAP_H #define ATLASMAP_H #include "guiclient.h" #include "xdialog.h" #include "ui_atlasMap.h" #include class QAbstractMessageHandler; class atlasMap : public XDialog, public Ui::atlasMap { Q_OBJECT public: atlasMap(QWidget* parent = 0, const char * = 0, Qt::WFlags fl = 0); ~atlasMap(); static bool userHasPriv(); public slots: virtual int exec(); virtual enum SetResponse set(const ParameterList&); virtual void sPopulate(); protected slots: virtual void languageChange(); virtual void sHandleAtlas(); virtual void sSave(); private: int _mode; int _atlasmapId; QString _defaultDir; QAbstractMessageHandler *_msghandler; }; #endif // ATLASMAP_H qt-client-4.1.0/guiclient/atlasMap.ui000066400000000000000000000115501217451700100175000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. atlasMap 0 0 484 217 CSV File to Atlas Map Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Pattern: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Apply Pattern to: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Atlas File: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Map: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 true [ Select how to apply the Pattern ] true [ Select a Map from the Atlas ] Treat first row as header information true Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save FileCluster QWidget

filecluster.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
_name _filter _filtertype _atlas _map _firstLine qt-client-4.1.0/guiclient/authorizedotnetprocessor.cpp000066400000000000000000000614721217451700100233030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* TODO: support Visa ECI, MasterCard UCAF for x_authentication_indicator? support Visa CAVV or MasterCard UCAF for x_cardholder_authentication_value? */ /** @ingroup creditcards @class AuthorizeDotNetProcessor @brief The implementation of Authorize.Net-specific credit card handling */ #include #include #include "guiclient.h" #include "authorizedotnetprocessor.h" #define DEBUG false // convenience macro to add Name and Content to the Request // outbound delimiter is always & #define APPENDFIELD(Request, Name, Content) \ { \ if (! Request.isEmpty()) \ Request += "&"; \ Request += QString(Name) + "=" + QString(Content); \ } AuthorizeDotNetProcessor::AuthorizeDotNetProcessor() : CreditCardProcessor() { _company = "Authorize.Net"; _defaultLivePort = 443; _defaultLiveServer = "https://secure.authorize.net/gateway/transact.dll"; _defaultTestPort = 443; _defaultTestServer = "https://certification.authorize.net/gateway/transact.dll"; _msgHash.insert(-200, tr("A Login is required.")); _msgHash.insert(-201, tr("The Login must be 20 characters or less.")); _msgHash.insert(-202, tr("The Transaction Key must be 16 characters or less.")); _msgHash.insert(-203, tr("The Delimiting Character must be exactly 1 character.")); _msgHash.insert(-204, tr("The Delimiting Character must be exactly 1 character.")); _msgHash.insert(-205, tr("The response from the Gateway appears to be " "incorrectly formatted (could not find field %1 " "as there are only %2 fields present).")); _msgHash.insert(-206, tr("The response from the Gateway failed the MD5 " "security check.")); _msgHash.insert( 206, tr("The response from the Gateway has failed the MD5 " "security check but will be processed anyway.")); _msgHash.insert(-207, tr("The Gateway returned the following error: %1")); _msgHash.insert(-208, tr("& (ampersand) is not a valid Delimiting Character.")); _msgHash.insert(-209, tr("The Delimiting Character and the Encapsulating " "Character cannot be the same. Please change one or " "the other.")); _ignoreSslErrors = _metrics->boolean("CCIgnoreSSLErrors") || _metrics->boolean("CCANIgnoreSSLErrors"); } int AuthorizeDotNetProcessor::buildCommon(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &prequest, QString pordertype) { // TODO: if check and not credit card transaction do something else XSqlQuery anq; anq.prepare( "SELECT ccard_active," " formatbytea(decrypt(setbytea(ccard_number), setbytea(:key),'bf')) AS ccard_number," " formatccnumber(decrypt(setbytea(ccard_number),setbytea(:key),'bf')) AS ccard_number_x," " formatbytea(decrypt(setbytea(ccard_name), setbytea(:key),'bf')) AS ccard_name," " formatbytea(decrypt(setbytea(ccard_address1), setbytea(:key),'bf')) AS ccard_address1," " formatbytea(decrypt(setbytea(ccard_address2), setbytea(:key),'bf')) AS ccard_address2," " formatbytea(decrypt(setbytea(ccard_city), setbytea(:key),'bf')) AS ccard_city," " formatbytea(decrypt(setbytea(ccard_state), setbytea(:key),'bf')) AS ccard_state," " formatbytea(decrypt(setbytea(ccard_zip), setbytea(:key),'bf')) AS ccard_zip," " formatbytea(decrypt(setbytea(ccard_country), setbytea(:key),'bf')) AS ccard_country," " formatbytea(decrypt(setbytea(ccard_month_expired),setbytea(:key),'bf')) AS ccard_month_expired," " formatbytea(decrypt(setbytea(ccard_year_expired),setbytea(:key), 'bf')) AS ccard_year_expired," " custinfo.*, cntct_phone, cntct_email" " FROM ccard" " JOIN custinfo ON (ccard_cust_id=cust_id)" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" "WHERE (ccard_id=:ccardid);"); anq.bindValue(":ccardid", pccardid); anq.bindValue(":key", omfgThis->_key); anq.exec(); if (anq.first()) { if (!anq.value("ccard_active").toBool()) { _errorMsg = errorMsg(-10); return -10; } } else if (anq.lastError().type() != QSqlError::NoError) { _errorMsg = anq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } if (! _metrics->value("CCANDelim").isEmpty()) APPENDFIELD(prequest, "x_delim_char", _metrics->value("CCANDelim")); APPENDFIELD(prequest, "x_version", _metrics->value("CCANVer")); APPENDFIELD(prequest, "x_delim_data", "TRUE"); if (! _metrics->value("CCANEncap").isEmpty()) APPENDFIELD(prequest, "x_encap_char", _metrics->value("CCANEncap")); APPENDFIELD(prequest, "x_login", _metricsenc->value("CCLogin")); APPENDFIELD(prequest, "x_tran_key", _metricsenc->value("CCPassword")); APPENDFIELD(prequest, "x_amount", QString::number(pamount, 'f', 2)); // TODO: if check and not credit card transaction do something else APPENDFIELD(prequest, "x_card_num", anq.value("ccard_number").toString()); APPENDFIELD(prequest, "x_test_request", isLive() ? "FALSE" : "TRUE"); // TODO: if check and not credit card transaction do something else QString work_month; work_month.setNum(anq.value("ccard_month_expired").toDouble()); if (work_month.length() == 1) work_month = "0" + work_month; APPENDFIELD(prequest, "x_exp_date", work_month + anq.value("ccard_year_expired").toString().right(2)); APPENDFIELD(prequest, "x_relay_response", "FALSE"); APPENDFIELD(prequest, "x_duplicate_window", _metrics->value("CCANDuplicateWindow")); QStringList name = anq.value("ccard_name").toString().split(QRegExp("\\s+")); APPENDFIELD(prequest, "x_first_name", name.at(0)); APPENDFIELD(prequest, "x_last_name", name.at(name.size() - 1)); APPENDFIELD(prequest, "x_company", anq.value("cust_name").toString()); APPENDFIELD(prequest, "x_address", anq.value("ccard_address1").toString()); APPENDFIELD(prequest, "x_city", anq.value("ccard_city").toString()); APPENDFIELD(prequest, "x_state", anq.value("ccard_state").toString()); APPENDFIELD(prequest, "x_zip", anq.value("ccard_zip").toString()); APPENDFIELD(prequest, "x_country", anq.value("ccard_country").toString()); if (_metrics->boolean("CCANWellsFargoSecureSource")) { APPENDFIELD(prequest, "x_phone", anq.value("cntct_phone").toString()); APPENDFIELD(prequest, "x_email", anq.value("cntct_email").toString()); } anq.prepare("SELECT curr_abbr FROM curr_symbol WHERE (curr_id=:currid);"); anq.bindValue(":currid", pcurrid); anq.exec(); if (anq.first()) { APPENDFIELD(prequest, "x_currency_code", anq.value("curr_abbr").toString()); } else if (anq.lastError().type() != QSqlError::NoError) { _errorMsg = anq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } // TODO: if check and not credit card transaction do something else APPENDFIELD(prequest, "x_method", "CC"); APPENDFIELD(prequest, "x_type", pordertype); if (! pcvv.isEmpty() && pcvv.toInt() != -2) APPENDFIELD(prequest, "x_card_code", pcvv); if (DEBUG) qDebug("AN:buildCommon built %s\n", prequest.toAscii().data()); return 0; } int AuthorizeDotNetProcessor::doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("AN:doAuthorize(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); int returnValue = 0; double amount = pamount; double tax = ptax; double freight = pfreight; double duty = pduty; int currid = pcurrid; if (_metrics->value("CCANCurrency") != "TRANS") { currid = _metrics->value("CCANCurrency").toInt(); amount = currToCurr(pcurrid, currid, pamount, &returnValue); if (returnValue < 0) return returnValue; tax = currToCurr(pcurrid, currid, ptax, &returnValue); if (returnValue < 0) return returnValue; freight = currToCurr(pcurrid, currid, pfreight, &returnValue); if (returnValue < 0) return returnValue; duty = currToCurr(pcurrid, currid, pduty, &returnValue); if (returnValue < 0) return returnValue; } QString request; returnValue = buildCommon(pccardid, pcvv, amount, currid, request, "AUTH_ONLY"); if (returnValue != 0) return returnValue; APPENDFIELD(request, "x_tax", QString::number(tax, 'f', 2)); APPENDFIELD(request, "x_tax_exempt", ptaxexempt ? "TRUE" : "FALSE"); APPENDFIELD(request, "x_freight", QString::number(freight, 'f', 2)); APPENDFIELD(request, "x_duty", QString::number(duty, 'f', 2)); if (! preforder.isEmpty()) APPENDFIELD(request, "x_po_num", preforder.left(20)); QString response; returnValue = sendViaHTTP(request, response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "A", amount, currid, pneworder, preforder, pccpayid, pparams); return returnValue; } int AuthorizeDotNetProcessor::doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("AN:doCharge(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); int returnValue = 0; double amount = pamount; double tax = ptax; double freight = pfreight; double duty = pduty; int currid = pcurrid; if (_metrics->value("CCANCurrency") != "TRANS") { currid = _metrics->value("CCANCurrency").toInt(); amount = currToCurr(pcurrid, currid, pamount, &returnValue); if (returnValue < 0) return returnValue; tax = currToCurr(pcurrid, currid, ptax, &returnValue); if (returnValue < 0) return returnValue; freight = currToCurr(pcurrid, currid, pfreight, &returnValue); if (returnValue < 0) return returnValue; duty = currToCurr(pcurrid, currid, pduty, &returnValue); if (returnValue < 0) return returnValue; } QString request; returnValue = buildCommon(pccardid, pcvv, amount, currid, request, "AUTH_CAPTURE"); if (returnValue != 0) return returnValue; APPENDFIELD(request, "x_tax", QString::number(tax, 'f', 2)); APPENDFIELD(request, "x_tax_exempt", ptaxexempt ? "TRUE" : "FALSE"); APPENDFIELD(request, "x_freight", QString::number(freight, 'f', 2)); APPENDFIELD(request, "x_duty", QString::number(duty, 'f', 2)); if (! preforder.isEmpty()) APPENDFIELD(request, "x_po_num", preforder); QString response; returnValue = sendViaHTTP(request, response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "C", amount, currid, pneworder, preforder, pccpayid, pparams); return returnValue; } int AuthorizeDotNetProcessor::doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("AN:doChargePreauthorized(%d, pcvv, %f, %d, %s, %s, %d)", pccardid, pamount, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); int returnValue = 0; double amount = pamount; int currid = pcurrid; if (_metrics->value("CCANCurrency") != "TRANS") { currid = _metrics->value("CCANCurrency").toInt(); amount = currToCurr(pcurrid, currid, pamount, &returnValue); if (returnValue < 0) return returnValue; } QString request; returnValue = buildCommon(pccardid, pcvv, amount, currid, request, "PRIOR_AUTH_CAPTURE"); if (returnValue != 0) return returnValue; APPENDFIELD(request, "x_trans_id", preforder); QString response; returnValue = sendViaHTTP(request, response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "CP", amount, currid, pneworder, preforder, pccpayid, pparams); return returnValue; } int AuthorizeDotNetProcessor::doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("AN:doCredit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); int returnValue = 0; double amount = pamount; double tax = ptax; double freight = pfreight; double duty = pduty; int currid = pcurrid; if (_metrics->value("CCANCurrency") != "TRANS") { currid = _metrics->value("CCANCurrency").toInt(); amount = currToCurr(pcurrid, currid, pamount, &returnValue); if (returnValue < 0) return returnValue; tax = currToCurr(pcurrid, currid, ptax, &returnValue); if (returnValue < 0) return returnValue; freight = currToCurr(pcurrid, currid, pfreight, &returnValue); if (returnValue < 0) return returnValue; duty = currToCurr(pcurrid, currid, pduty, &returnValue); if (returnValue < 0) return returnValue; } QString request; returnValue = buildCommon(pccardid, pcvv, amount, currid, request, "CREDIT"); if (returnValue != 0) return returnValue; APPENDFIELD(request, "x_trans_id", preforder); APPENDFIELD(request, "x_tax", QString::number(tax, 'f', 2)); APPENDFIELD(request, "x_tax_exempt", ptaxexempt ? "TRUE" : "FALSE"); APPENDFIELD(request, "x_freight", QString::number(freight, 'f', 2)); APPENDFIELD(request, "x_duty", QString::number(duty, 'f', 2)); QString response; returnValue = sendViaHTTP(request, response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "R", amount, currid, pneworder, preforder, pccpayid, pparams); return returnValue; } int AuthorizeDotNetProcessor::doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("AN:doVoidPrevious(%d, pcvv, %f, %d, %s, %s, %s, %d)", pccardid, pamount, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), papproval.toAscii().data(), pccpayid); QString tmpErrorMsg = _errorMsg; int returnValue = 0; double amount = pamount; int currid = pcurrid; if (_metrics->value("CCANCurrency") != "TRANS") { currid = _metrics->value("CCANCurrency").toInt(); amount = currToCurr(pcurrid, currid, pamount, &returnValue); if (returnValue < 0) { _errorMsg = tmpErrorMsg; return returnValue; } } QString request; returnValue = buildCommon(pccardid, pcvv, amount, currid, request, "VOID"); if (returnValue != 0) return returnValue; APPENDFIELD(request, "x_trans_id", preforder); QString response; returnValue = sendViaHTTP(request, response); _errorMsg = tmpErrorMsg; if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "V", amount, currid, pneworder, preforder, pccpayid, pparams); if (! tmpErrorMsg.isEmpty()) _errorMsg = tmpErrorMsg; return returnValue; } int AuthorizeDotNetProcessor::fieldValue(const QStringList plist, const int pindex, QString &pvalue) { if (plist.size() < pindex) { _errorMsg = errorMsg(-205).arg(pindex).arg(plist.size()); return -205; } if (_metrics->value("CCANEncap").isEmpty()) pvalue = plist.at(pindex - 1); else { pvalue = plist.at(pindex - 1); // now strip of the encapsulating char from front and back int firstPos = plist.at(pindex - 1).indexOf(_metrics->value("CCANEncap")); int lastPos = plist.at(pindex - 1).lastIndexOf(_metrics->value("CCANEncap")); pvalue = pvalue.mid(firstPos + 1, lastPos - firstPos - 1); } if (DEBUG) qDebug("AN:fieldValue of %d is %s", pindex, pvalue.toAscii().data()); return 0; } int AuthorizeDotNetProcessor::handleResponse(const QString &presponse, const int pccardid, const QString &ptype, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("AN::handleResponse(%s, %d, %s, %f, %d, %s, %d, pparams)", presponse.toAscii().data(), pccardid, ptype.toAscii().data(), pamount, pcurrid, preforder.toAscii().data(), pccpayid); // if we got an error msg very early on if (presponse.startsWith("")) { _errorMsg = errorMsg(-207).arg(presponse); return -207; } QString delim = _metrics->value("CCANDelim").isEmpty() ? "," : _metrics->value("CCANDelim"); QString encap = _metrics->value("CCANEncap"); QString r_approved; QString r_avs; QString r_code; QString r_cvv; QString r_error; QString r_message; QString r_ordernum; QString r_reason; // not stored QString r_ref; QString r_shipping; QString r_tax; QString status; // TODO: explore using encap here and code from CSV Import to properly split /* add an extra field at the beginning. otherwise we'll be off by one because the Advanced Integration Method (AIM) Implementation Guide numbers fields starting at 1 but QString::split() creates a list starting at 0. */ QStringList responseFields = presponse.split(delim); QString r_response; int returnValue = fieldValue(responseFields, 1, r_response); if (returnValue < 0) return returnValue; if (r_response.toInt() == 1) r_approved = "APPROVED"; else if (r_response.toInt() == 2) r_approved = "DECLINED"; else if (r_response.toInt() == 3) r_approved = "ERROR"; else if (r_response.toInt() == 4) r_approved = "HELDFORREVIEW"; // fieldValue(responseFields, 2); // subcode returnValue = fieldValue(responseFields, 3, r_reason); // reason code if (returnValue < 0) return returnValue; returnValue = fieldValue(responseFields, 4, r_message); // reason text if (returnValue < 0) return returnValue; returnValue = fieldValue(responseFields, 5, r_code); // approval code if (returnValue < 0) return returnValue; returnValue = fieldValue(responseFields, 6, r_avs); // avs result if (returnValue < 0) return returnValue; returnValue = fieldValue(responseFields, 7, r_ordernum); // transaction id if (returnValue < 0) return returnValue; // fieldValue(responseFields, 8-10); // echo invoice_number description amount // fieldValue(responseFields, 11-13); // echo method type cust_id // fieldValue(responseFields, 14-24); // echo name, company, and address info // fieldValue(responseFields, 25-32); // echo ship_to fields returnValue = fieldValue(responseFields, 33, r_tax); // echo x_tax if (returnValue < 0) return returnValue; // fieldValue(responseFields, 34); // echo x_duty returnValue = fieldValue(responseFields, 35, r_shipping); // echo x_freight if (returnValue < 0) return returnValue; // fieldValue(responseFields, 36); // echo x_tax_exempt // fieldValue(responseFields, 37); // echo x_po_num returnValue = fieldValue(responseFields, 39, r_cvv); // ccv response code if (returnValue < 0) return returnValue; // fieldValue(responseFields, 40); // cavv response code // fieldValue(responseFields, 41-68); // reserved for future use // fieldValue(responseFields, 69+); // echo of merchant-defined fields /* treat heldforreview as approved because the AIM doc says response reason codes 252 and 253 are both approved but being reviewed. the intent of the other heldforreview, 193, is ambiguous. */ if (r_approved == "APPROVED" || r_approved == "HELDFORREVIEW") { _errorMsg = errorMsg(0).arg(r_code); if (ptype == "A") status = "A"; // Authorized else if (ptype == "V") status = "V"; // Voided else status = "C"; // Completed/Charged } else if (r_approved == "DECLINED") { _errorMsg = errorMsg(-92).arg(r_message); returnValue = -92; status = "D"; } else if (r_approved == "ERROR") { r_error = r_message; _errorMsg = errorMsg(-12).arg(r_error).arg(_company); returnValue = -12; status = "X"; } else if (r_approved.isEmpty() && ! r_message.isEmpty()) { _errorMsg = errorMsg(-95).arg(r_message).arg(_company); returnValue = -95; status = "X"; } else if (r_approved.isEmpty()) { _errorMsg = errorMsg(-100).arg(r_error).arg(r_message).arg(presponse); returnValue = -100; status = "X"; } // always use the AVS checking configured on the gateway _passedAvs = ((r_reason.toInt() != 27) && (r_reason.toInt() != 127)); // always use the CVV checking configured on the gateway _passedCvv = (r_reason.toInt() != 78); if (DEBUG) qDebug("AN:%s _passedAvs %d\t%s _passedCvv %d", qPrintable(r_avs), _passedAvs, qPrintable(r_cvv), _passedCvv); pparams.append("ccard_id", pccardid); pparams.append("currid", pcurrid); pparams.append("auth_charge", ptype); pparams.append("type", ptype); pparams.append("reforder", (preforder.isEmpty()) ? pneworder : preforder); pparams.append("status", status); pparams.append("avs", r_avs); pparams.append("ordernum", pneworder); pparams.append("xactionid", r_ordernum); pparams.append("error", r_error); pparams.append("approved", r_approved); pparams.append("code", r_code); pparams.append("shipping", r_shipping); pparams.append("tax", r_tax); pparams.append("ref", r_ref); pparams.append("message", r_message); pparams.append("auth", QVariant(ptype == "A")); if (DEBUG) qDebug("AN:r_error.isEmpty() = %d", r_error.isEmpty()); if (returnValue == 0) pparams.append("amount", pamount); else pparams.append("amount", 0); // no money changed hands this attempt // don't bother checking MD5 if we hit a bigger problem if (returnValue == 0 && _metrics->boolean("CCANMD5HashSetOnGateway")) { QString expected_hash; QString r_hash; returnValue = fieldValue(responseFields, 38, r_hash); // md5 hash XSqlQuery anq; anq.prepare("SELECT UPPER(MD5(:inputstr)) AS expected;"); anq.bindValue(":inputstr", _metricsenc->value("CCANMD5Hash") + _metricsenc->value("CCLogin") + r_ordernum + QString::number(pamount, 'f', 2)); anq.exec(); if (anq.first()) expected_hash = anq.value("expected").toString(); else if (anq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(-1).arg(anq.lastError().databaseText()); returnValue = -1; } if (DEBUG) qDebug("AN:handleResponse expected md5 %s and got %s", expected_hash.toAscii().data(), r_hash.toAscii().data()); if (_metrics->value("CCANMD5HashAction") == "F" && expected_hash != r_hash) { _errorMsg = errorMsg(-206); returnValue = -206; } else if (_metrics->value("CCANMD5HashAction") == "W" && expected_hash != r_hash) { _errorMsg = errorMsg(206); returnValue = 206; } } if (DEBUG) qDebug("AN::handleResponse returning %d %s", returnValue, errorMsg().toAscii().data()); return returnValue; } int AuthorizeDotNetProcessor::doTestConfiguration() { if (DEBUG) qDebug("AN:doTestConfiguration()"); int returnValue = 0; if (_metricsenc->value("CCLogin").isEmpty()) { _errorMsg = errorMsg(-200); returnValue = -200; } else if (_metricsenc->value("CCLogin").size() > 20) { _errorMsg = errorMsg(-201); returnValue = -201; } else if (_metricsenc->value("CCPassword").size() > 16) { _errorMsg = errorMsg(-202); returnValue = -202; } else if (_metrics->value("CCANDelim").size() > 1) { _errorMsg = errorMsg(-203); returnValue = -203; } else if (_metrics->value("CCANDelim") == "&") { _errorMsg = errorMsg(-208); returnValue = -208; } else if (_metrics->value("CCANDelim") == _metrics->value("CCANEncap") && ! _metrics->value("CCANDelim").isEmpty()) { _errorMsg = errorMsg(-209); returnValue = -209; } return returnValue; } bool AuthorizeDotNetProcessor::handlesCreditCards() { return true; } qt-client-4.1.0/guiclient/authorizedotnetprocessor.h000066400000000000000000000037551217451700100227500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef AUTHORIZEDOTNETPROCESSOR_H #define AUTHORIZEDOTNETPROCESSOR_H #include #include #include "creditcardprocessor.h" class AuthorizeDotNetProcessor : public CreditCardProcessor { Q_OBJECT public: AuthorizeDotNetProcessor(); protected: virtual int buildCommon(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &prequest, QString pordertype); virtual int doTestConfiguration(); virtual int doAuthorize(const int, const QString &pcvv, double&, const double, const bool, const double, const double, const int, QString&, QString&, int&, ParameterList &); virtual int doCharge(const int, const QString &pcvv, const double, const double, const bool, const double, const double, const int, QString&, QString&, int&, ParameterList &); virtual int doChargePreauthorized(const int, const QString &pcvv, const double, const int, QString&, QString&, int&, ParameterList &); virtual int doCredit(const int, const QString &pcvv, const double, const double, const bool, const double, const double, const int, QString&, QString&, int&, ParameterList &); virtual int doVoidPrevious(const int, const QString &pcvv, const double, const int, QString&, QString&, QString&, int&, ParameterList &); virtual bool handlesCreditCards(); virtual int handleResponse(const QString&, const int, const QString&, const double, const int, QString&, QString&, int&, ParameterList&); private: int fieldValue(const QStringList, const int, QString &); }; #endif // AUTHORIZEDOTNETPROCESSOR_H qt-client-4.1.0/guiclient/bankAccount.cpp000066400000000000000000000450051217451700100203350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bankAccount.h" #include #include #include #include bankAccount::bankAccount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery bankbankAccount; setupUi(this); connect(_bankName,SIGNAL(textChanged(QString)), this, SLOT(sNameChanged(QString))); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_transmitGroup, SIGNAL(toggled(bool)), this, SLOT(sHandleTransmitGroup())); _nextCheckNum->setValidator(omfgThis->orderVal()); QRegExp tmpregex = QRegExp(_metrics->value("EFTAccountRegex")); _accountValidator = new QRegExpValidator (tmpregex, this); tmpregex = QRegExp(_metrics->value("EFTRoutingRegex")); _routingValidator = new QRegExpValidator(tmpregex, this); _routing->setValidator(_routingValidator); _federalReserveDest->setValidator(_routingValidator); _assetAccount->setType(GLCluster::cAsset | GLCluster::cLiability); _currency->setType(XComboBox::Currencies); _currency->setLabel(_currencyLit); _form->setAllowNull(TRUE); _form->populate( "SELECT form_id, form_name, form_name " "FROM form " "WHERE form_key='Chck' " "ORDER BY form_name;" ); if (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")) { bankbankAccount.prepare("SELECT fetchMetricText('ACHCompanyName') AS name," " formatACHCompanyId() AS number;"); bankbankAccount.exec(); if (bankbankAccount.first()) { _useCompanyIdOrigin->setText(bankbankAccount.value("name").toString()); _defaultOrigin->setText(bankbankAccount.value("number").toString()); } else if (bankbankAccount.lastError().type() != QSqlError::NoError) systemError(this, bankbankAccount.lastError().databaseText(), __FILE__, __LINE__); if (omfgThis->_key.isEmpty()) _transmitTab->setEnabled(false); } else _tab->removeTab(_tab->indexOf(_transmitTab)); _bankaccntid = -1; } bankAccount::~bankAccount() { // no need to delete child widgets, Qt does it all for us } void bankAccount::languageChange() { retranslateUi(this); } enum SetResponse bankAccount::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("bankaccnt_id", &valid); if (valid) { _bankaccntid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _useCompanyIdOrigin->setChecked(true); } else if (param.toString() == "edit") { _mode = cEdit; _currency->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _bankName->setEnabled(FALSE); _accountNumber->setEnabled(FALSE); _type->setEnabled(FALSE); _currency->setEnabled(FALSE); _ap->setEnabled(FALSE); _nextCheckNum->setEnabled(FALSE); _form->setEnabled(FALSE); _ar->setEnabled(FALSE); _assetAccount->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void bankAccount::sCheck() { XSqlQuery bankCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length())) { bankCheck.exec( "SELECT bankaccnt_id " "FROM bankaccnt " "WHERE (UPPER(bankaccnt_name)=UPPER(:bankaccnt_name));" ); bankCheck.bindValue(":bankaccnt_name", _name->text()); bankCheck.exec(); if (bankCheck.first()) { _bankaccntid = bankCheck.value("bankaccnt_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } else if (bankCheck.lastError().type() != QSqlError::NoError) { systemError(this, bankCheck.lastError().databaseText(), __FILE__, __LINE__); return; } } } void bankAccount::sSave() { XSqlQuery bankSave; struct { bool condition; QString msg; QWidget *widget; } error[] = { { !_assetAccount->isValid(), tr("

Select an G/L Account for this Bank Account before saving it."), _assetAccount }, { _transmitGroup->isChecked() && ! _routing->hasAcceptableInput(), tr("

The bank's Routing Number is not valid."), _routing }, { _transmitGroup->isChecked() && ! (_useCompanyIdOrigin->isChecked() || _useRoutingNumberOrigin->isChecked() || _useOtherOrigin->isChecked()), tr("

You must choose which value to use for the Immediate Origin."), _useCompanyIdOrigin }, { _transmitGroup->isChecked() && _useOtherOrigin->isChecked() && _otherOriginName->text().trimmed().isEmpty(), tr("

You must enter an Immediate Origin Name if you choose 'Other'."), _otherOriginName }, { _transmitGroup->isChecked() && _useOtherOrigin->isChecked() && _otherOrigin->text().trimmed().isEmpty(), tr("

You must enter an Immediate Origin if you choose 'Other'."), _otherOrigin }, { _transmitGroup->isChecked() && ! (_useRoutingNumberDest->isChecked() || _useFederalReserveDest->isChecked() || _useOtherDest->isChecked()), tr("

You must choose which value to use for the Immediate Destination."), _useRoutingNumberDest }, { _transmitGroup->isChecked() && _useFederalReserveDest->isChecked() && ! _federalReserveDest->hasAcceptableInput(), tr("

The Federal Reserve Routing Number is not valid."), _federalReserveDest }, { _transmitGroup->isChecked() && _useOtherDest->isChecked() && _otherDestName->text().trimmed().isEmpty(), tr("

You must enter an Immediate Destination Name if you choose " "'Other'."), _otherDestName }, { _transmitGroup->isChecked() && _useOtherDest->isChecked() && _otherDest->text().trimmed().isEmpty(), tr("

You must enter an Immediate Destination number if you choose " "'Other'."), _otherDest }, { _transmitGroup->isChecked() && ! _accountNumber->hasAcceptableInput(), tr("

The Account Number is not valid for EFT purposes."), _accountNumber } }; for (unsigned int i = 0; i < sizeof(error) / sizeof(error[0]); i++) if (error[i].condition) { QMessageBox::critical(this, tr("Cannot Save Bank Account"), error[i].msg); error[i].widget->setFocus(); return; } if (_transmitGroup->isChecked()) { if (_useOtherOrigin->isChecked() && _otherOrigin->text().size() < 10 && QMessageBox::question(this, tr("Immediate Origin Too Small?"), tr("

The Immediate Origin is usually either a " "10 digit Company Id number or a space followed " "by a 9 digit Routing Number. Does %1 " "match what your bank told you to enter here?") .arg(_otherOrigin->text()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { _otherOrigin->setFocus(); return; } if (_useRoutingNumberOrigin->isChecked() && _useRoutingNumberDest->isChecked() && QMessageBox::question(this, tr("Use Bank Routing Number twice?"), tr("

Are you sure your bank expects the " "Bank Routing Number as both the Immediate " "Origin and the Immediate Destination?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { _useRoutingNumberDest->setFocus(); return; } if (_useOtherDest->isChecked() && _otherDest->text().size() < 10 && QMessageBox::question(this, tr("Immediate Destination Too Small?"), tr("

The Immediate Destination is usually either " "a 10 digit Company Id number or a space " "followed by a 9 digit Routing Number. Does %1 " "match what your bank told you to enter here?") .arg(_otherDest->text()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { _otherOrigin->setFocus(); return; } } bankSave.prepare( "SELECT bankaccnt_id FROM bankaccnt " "WHERE ((bankaccnt_name = :bankaccnt_name) " "AND (bankaccnt_id != :bankaccnt_id));"); bankSave.bindValue(":bankaccnt_name", _name->text()); bankSave.bindValue(":bankaccnt_id", _bankaccntid); bankSave.exec(); if (bankSave.first()) { QMessageBox::critical( this, tr("Cannot Save Bank Account"), tr("

Bank Account name is already in use. Please " "enter a unique name.") ); _name->setFocus(); return; } if (_mode == cNew) { bankSave.exec("SELECT NEXTVAL('bankaccnt_bankaccnt_id_seq') AS _bankaccnt_id"); if (bankSave.first()) _bankaccntid = bankSave.value("_bankaccnt_id").toInt(); bankSave.prepare( "INSERT INTO bankaccnt " "( bankaccnt_id, bankaccnt_name, bankaccnt_descrip," " bankaccnt_bankname, bankaccnt_accntnumber," " bankaccnt_type, bankaccnt_ap, bankaccnt_ar," " bankaccnt_accnt_id, bankaccnt_notes," " bankaccnt_nextchknum, bankaccnt_check_form_id, " " bankaccnt_curr_id, bankaccnt_ach_enabled," " bankaccnt_routing, bankaccnt_ach_origintype," " bankaccnt_ach_originname, bankaccnt_ach_origin," " bankaccnt_ach_desttype, bankaccnt_ach_fed_dest," " bankaccnt_ach_destname, bankaccnt_ach_dest," " bankaccnt_ach_genchecknum, bankaccnt_ach_leadtime)" "VALUES " "( :bankaccnt_id, :bankaccnt_name, :bankaccnt_descrip," " :bankaccnt_bankname, :bankaccnt_accntnumber," " :bankaccnt_type, :bankaccnt_ap, :bankaccnt_ar," " :bankaccnt_accnt_id, :bankaccnt_notes," " :bankaccnt_nextchknum, :bankaccnt_check_form_id, " " :bankaccnt_curr_id, :bankaccnt_ach_enabled," " :bankaccnt_routing, :bankaccnt_ach_origintype," " :bankaccnt_ach_originname, :bankaccnt_ach_origin," " :bankaccnt_ach_desttype, :bankaccnt_ach_fed_dest," " :bankaccnt_ach_destname, :bankaccnt_ach_dest," " :bankaccnt_ach_genchecknum, :bankaccnt_ach_leadtime);" ); } else if (_mode == cEdit) bankSave.prepare( "UPDATE bankaccnt " "SET bankaccnt_name=:bankaccnt_name," " bankaccnt_descrip=:bankaccnt_descrip," " bankaccnt_bankname=:bankaccnt_bankname," " bankaccnt_accntnumber=:bankaccnt_accntnumber," " bankaccnt_type=:bankaccnt_type," " bankaccnt_ap=:bankaccnt_ap," " bankaccnt_ar=:bankaccnt_ar," " bankaccnt_accnt_id=:bankaccnt_accnt_id," " bankaccnt_nextchknum=:bankaccnt_nextchknum, " " bankaccnt_check_form_id=:bankaccnt_check_form_id, " " bankaccnt_curr_id=:bankaccnt_curr_id," " bankaccnt_notes=:bankaccnt_notes," " bankaccnt_ach_enabled=:bankaccnt_ach_enabled," " bankaccnt_routing=:bankaccnt_routing," " bankaccnt_ach_origintype=:bankaccnt_ach_origintype," " bankaccnt_ach_originname=:bankaccnt_ach_originname," " bankaccnt_ach_origin=:bankaccnt_ach_origin," " bankaccnt_ach_desttype=:bankaccnt_ach_desttype," " bankaccnt_ach_fed_dest=:bankaccnt_ach_fed_dest," " bankaccnt_ach_destname=:bankaccnt_ach_destname," " bankaccnt_ach_dest=:bankaccnt_ach_dest," " bankaccnt_ach_genchecknum=:bankaccnt_ach_genchecknum," " bankaccnt_ach_leadtime=:bankaccnt_ach_leadtime " "WHERE (bankaccnt_id=:bankaccnt_id);" ); bankSave.bindValue(":bankaccnt_id", _bankaccntid); bankSave.bindValue(":bankaccnt_name", _name->text()); bankSave.bindValue(":bankaccnt_descrip", _description->text().trimmed()); bankSave.bindValue(":bankaccnt_bankname", _bankName->text()); bankSave.bindValue(":bankaccnt_accntnumber", _accountNumber->text()); bankSave.bindValue(":bankaccnt_ap", QVariant(_ap->isChecked())); bankSave.bindValue(":bankaccnt_ar", QVariant(_ar->isChecked())); bankSave.bindValue(":bankaccnt_accnt_id", _assetAccount->id()); bankSave.bindValue(":bankaccnt_curr_id", _currency->id()); bankSave.bindValue(":bankaccnt_notes", _notes->toPlainText().trimmed()); bankSave.bindValue(":bankaccnt_ach_enabled", _transmitGroup->isChecked()); bankSave.bindValue(":bankaccnt_routing", _routing->text()); if (_useCompanyIdOrigin->isChecked()) bankSave.bindValue(":bankaccnt_ach_origintype", "I"); else if (_useRoutingNumberOrigin->isChecked()) bankSave.bindValue(":bankaccnt_ach_origintype", "B"); else if (_useOtherOrigin->isChecked()) bankSave.bindValue(":bankaccnt_ach_origintype", "O"); bankSave.bindValue(":bankaccnt_ach_originname", _otherOriginName->text()); bankSave.bindValue(":bankaccnt_ach_origin", _otherOrigin->text()); bankSave.bindValue(":bankaccnt_ach_genchecknum", _genCheckNumber->isChecked()); bankSave.bindValue(":bankaccnt_ach_leadtime", _settlementLeadtime->value()); if (_useRoutingNumberDest->isChecked()) bankSave.bindValue(":bankaccnt_ach_desttype", "B"); else if (_useFederalReserveDest->isChecked()) bankSave.bindValue(":bankaccnt_ach_desttype", "F"); else if (_useOtherDest->isChecked()) bankSave.bindValue(":bankaccnt_ach_desttype", "O"); bankSave.bindValue(":bankaccnt_ach_fed_dest", _federalReserveDest->text()); bankSave.bindValue(":bankaccnt_ach_destname", _otherDestName->text()); bankSave.bindValue(":bankaccnt_ach_dest", _otherDest->text()); bankSave.bindValue(":bankaccnt_nextchknum", _nextCheckNum->text().toInt()); bankSave.bindValue(":bankaccnt_check_form_id", _form->id()); if (_type->currentIndex() == 0) bankSave.bindValue(":bankaccnt_type", "K"); else if (_type->currentIndex() == 1) bankSave.bindValue(":bankaccnt_type", "C"); else if (_type->currentIndex() == 2) bankSave.bindValue(":bankaccnt_type", "R"); bankSave.exec(); if (bankSave.lastError().type() != QSqlError::NoError) { systemError(this, bankSave.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sBankAccountsUpdated(); done(_bankaccntid); } void bankAccount::populate() { XSqlQuery bankpopulate; bankpopulate.prepare( "SELECT * " "FROM bankaccnt " "WHERE (bankaccnt_id=:bankaccnt_id);" ); bankpopulate.bindValue(":bankaccnt_id", _bankaccntid); bankpopulate.exec(); if (bankpopulate.first()) { _name->setText(bankpopulate.value("bankaccnt_name")); _description->setText(bankpopulate.value("bankaccnt_descrip")); _bankName->setText(bankpopulate.value("bankaccnt_bankname")); _accountNumber->setText(bankpopulate.value("bankaccnt_accntnumber")); _ap->setChecked(bankpopulate.value("bankaccnt_ap").toBool()); _ar->setChecked(bankpopulate.value("bankaccnt_ar").toBool()); _nextCheckNum->setText(bankpopulate.value("bankaccnt_nextchknum")); _form->setId(bankpopulate.value("bankaccnt_check_form_id").toInt()); _assetAccount->setId(bankpopulate.value("bankaccnt_accnt_id").toInt()); _currency->setId(bankpopulate.value("bankaccnt_curr_id").toInt()); _notes->setText(bankpopulate.value("bankaccnt_notes").toString()); _transmitGroup->setChecked(bankpopulate.value("bankaccnt_ach_enabled").toBool()); _routing->setText(bankpopulate.value("bankaccnt_routing").toString()); _genCheckNumber->setChecked(bankpopulate.value("bankaccnt_ach_genchecknum").toBool()); _settlementLeadtime->setValue(bankpopulate.value("bankaccnt_ach_leadtime").toInt()); if (bankpopulate.value("bankaccnt_ach_origintype").toString() == "I") _useCompanyIdOrigin->setChecked(true); else if (bankpopulate.value("bankaccnt_ach_origintype").toString() == "B") _useRoutingNumberOrigin->setChecked(true); else if (bankpopulate.value("bankaccnt_ach_origintype").toString() == "O") _useOtherOrigin->setChecked(true); _otherOriginName->setText(bankpopulate.value("bankaccnt_ach_originname").toString()); _otherOrigin->setText(bankpopulate.value("bankaccnt_ach_origin").toString()); if (bankpopulate.value("bankaccnt_ach_desttype").toString() == "B") _useRoutingNumberDest->setChecked(true); else if (bankpopulate.value("bankaccnt_ach_desttype").toString() == "F") _useFederalReserveDest->setChecked(true); else if (bankpopulate.value("bankaccnt_ach_desttype").toString() == "O") _useOtherDest->setChecked(true); _federalReserveDest->setText(bankpopulate.value("bankaccnt_ach_fed_dest").toString()); _otherDestName->setText(bankpopulate.value("bankaccnt_ach_destname").toString()); _otherDest->setText(bankpopulate.value("bankaccnt_ach_dest").toString()); if (bankpopulate.value("bankaccnt_type").toString() == "K") _type->setCurrentIndex(0); else if (bankpopulate.value("bankaccnt_type").toString() == "C") _type->setCurrentIndex(1); else if (bankpopulate.value("bankaccnt_type").toString() == "R") _type->setCurrentIndex(2); } else if (bankpopulate.lastError().type() != QSqlError::NoError) { systemError(this, bankpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void bankAccount::sNameChanged(QString pName) { _useRoutingNumberDest->setText(pName); _useRoutingNumberOrigin->setText(pName); } void bankAccount::sHandleTransmitGroup() { _accountNumber->setValidator(_transmitGroup->isChecked() ? _accountValidator : 0); } qt-client-4.1.0/guiclient/bankAccount.h000066400000000000000000000023341217451700100200000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BANKACCOUNT_H #define BANKACCOUNT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_bankAccount.h" class bankAccount : public XDialog, public Ui::bankAccount { Q_OBJECT public: bankAccount(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~bankAccount(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sNameChanged(QString); virtual void sSave(); virtual void populate(); protected: QValidator *_accountValidator; QValidator *_routingValidator; protected slots: virtual void languageChange(); virtual void sHandleTransmitGroup(); private: int _mode; int _bankaccntid; }; #endif // BANKACCOUNT_H qt-client-4.1.0/guiclient/bankAccount.ui000066400000000000000000000600671217451700100201750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bankAccount 0 0 700 638 Bank Account Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 0 Qt::Horizontal QSizePolicy::Expanding 76 10 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Bank Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _bankName Account Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _accountNumber Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _type Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _currency Checking Cash Credit Card Used in Accounts Payable Qt::Horizontal QSizePolicy::Fixed 20 20 false Next Check #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 false 0 0 100 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 42 16 false Check Format: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal 40 20 Used in Accounts Receivable Asset Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 0 1 0 Notes Transmission Enable EFT Check Printing true false Routing Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _routing Create Check Number for EFT Checks Immediate Origin Name and Number Company Name true default Bank Name false 10 false 23 Routing Number Settlement Lead Time: 1 2 Immediate Destination Name and Number Bank Name true Federal Reserve false false 10 false 23 Routing Number Qt::Vertical 20 0 GLCluster QWidget

glcluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_name _description _bankName _accountNumber _type _currency _ap _nextCheckNum _form _ar _tab _notes _transmitGroup _routing _settlementLeadtime _genCheckNumber _useCompanyIdOrigin _useRoutingNumberOrigin _useOtherOrigin _otherOriginName _otherOrigin _useRoutingNumberDest _useFederalReserveDest _federalReserveDest _useOtherDest _otherDestName _otherDest _ap toggled(bool) _nextCheckNumLit setEnabled(bool) 45 221 76 248 _ap toggled(bool) _nextCheckNum setEnabled(bool) 45 221 176 249 _ap toggled(bool) _checkFormatLit setEnabled(bool) 45 221 76 282 _ap toggled(bool) _form setEnabled(bool) 45 221 175 282 _useOtherOrigin toggled(bool) _otherOrigin setEnabled(bool) 80 558 335 559 _useCompanyIdOrigin toggled(bool) _defaultOrigin setEnabled(bool) 195 505 335 502 _useFederalReserveDest toggled(bool) _federalReserveDest setEnabled(bool) 523 532 642 531 _useOtherDest toggled(bool) _otherDest setEnabled(bool) 405 561 642 562 _useOtherDest toggled(bool) _otherDestName setEnabled(bool) 405 561 523 562 _routing textChanged(QString) _routingNumberOrigin setText(QString) 285 421 282 523 _routing textChanged(QString) _routingNumberDest setText(QString) 350 415 562 499 _useOtherOrigin toggled(bool) _otherOriginName setEnabled(bool) 65 549 97 552 _buttonBox rejected() bankAccount reject() 647 46 349 318 qt-client-4.1.0/guiclient/bankAccounts.cpp000066400000000000000000000132401217451700100205140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bankAccounts.h" #include #include #include #include #include #include "bankAccount.h" bankAccounts::bankAccounts(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_bankaccnt, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _bankaccnt->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "bankaccnt_name" ); _bankaccnt->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "bankaccnt_descrip" ); _bankaccnt->addColumn(tr("Type"), _dateColumn, Qt::AlignCenter,true, "type"); _bankaccnt->addColumn(tr("A/P"), _ynColumn, Qt::AlignCenter,true, "bankaccnt_ap"); _bankaccnt->addColumn(tr("A/R"), _ynColumn, Qt::AlignCenter,true, "bankaccnt_ar"); _bankaccnt->addColumn(tr("Currency"),_currencyColumn, Qt::AlignCenter,true, "currabbr"); if (omfgThis->singleCurrency()) _bankaccnt->hideColumn("currabbr"); if (_privileges->check("MaintainBankAccounts")) { connect(_bankaccnt, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_bankaccnt, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_bankaccnt, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_bankaccnt, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } bankAccounts::~bankAccounts() { // no need to delete child widgets, Qt does it all for us } void bankAccounts::languageChange() { retranslateUi(this); } void bankAccounts::sNew() { ParameterList params; params.append("mode", "new"); bankAccount newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void bankAccounts::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("bankaccnt_id", _bankaccnt->id()); bankAccount newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void bankAccounts::sView() { ParameterList params; params.append("mode", "view"); params.append("bankaccnt_id", _bankaccnt->id()); bankAccount newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void bankAccounts::sFillList() { XSqlQuery bankFillList; bankFillList.prepare( "SELECT bankaccnt_id, bankaccnt_name, bankaccnt_descrip," " CASE WHEN (bankaccnt_type='K') THEN :checking" " WHEN (bankaccnt_type='C') THEN :cash" " WHEN (bankaccnt_type='R') THEN :creditcard" " ELSE '?'" " END AS type," " bankaccnt_ap, bankaccnt_ar, " " currConcat(bankaccnt_curr_id) AS currabbr " "FROM bankaccnt " "ORDER BY bankaccnt_name;" ); bankFillList.bindValue(":checking", tr("Checking")); bankFillList.bindValue(":cash", tr("Cash")); bankFillList.bindValue(":creditcard", tr("Credit Card")); bankFillList.exec(); _bankaccnt->populate(bankFillList); if (bankFillList.lastError().type() != QSqlError::NoError) { systemError(this, bankFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void bankAccounts::sDelete() { XSqlQuery bankDelete; // TODO: put all of this into a stored proc bankDelete.prepare( "SELECT cashrcpt_id " "FROM cashrcpt " "WHERE (cashrcpt_bankaccnt_id=:bankaccnt_id) " "LIMIT 1;" ); bankDelete.bindValue(":bankaccnt_id", _bankaccnt->id()); bankDelete.exec(); if (bankDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Bank Account"), tr("

The selected Bank Account cannot be deleted " "as Cash Receipts have been posted against it.")); return; } bankDelete.prepare( "SELECT checkhead_id " "FROM checkhead " "WHERE (checkhead_bankaccnt_id=:bankaccnt_id) " "LIMIT 1;" ); bankDelete.bindValue(":bankaccnt_id", _bankaccnt->id()); bankDelete.exec(); if (bankDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Bank Account"), tr("

The selected Bank Account cannot be delete " "as Checks have been posted against it.") ); return; } bankDelete.prepare( "DELETE FROM bankaccnt " "WHERE (bankaccnt_id=:bankaccnt_id);" ); bankDelete.bindValue(":bankaccnt_id", _bankaccnt->id()); bankDelete.exec(); if (bankDelete.lastError().type() != QSqlError::NoError) { systemError(this, bankDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); omfgThis->sBankAccountsUpdated(); } void bankAccounts::sPopulateMenu( QMenu * ) { } void bankAccounts::sPrint() { orReport report("BankAccountsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/bankAccounts.h000066400000000000000000000020621217451700100201610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BANKACCOUNTS_H #define BANKACCOUNTS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_bankAccounts.h" class bankAccounts : public XWidget, public Ui::bankAccounts { Q_OBJECT public: bankAccounts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~bankAccounts(); protected slots: virtual void languageChange(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); }; #endif // BANKACCOUNTS_H qt-client-4.1.0/guiclient/bankAccounts.ui000066400000000000000000000115421217451700100203520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bankAccounts 0 0 600 400 List Bank Accounts 0 Bank Accounts: 0 0 &Close &Print Qt::Vertical QSizePolicy::Fixed 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 83 XTreeWidget QTreeWidget

xtreewidget.h
1 _bankaccnt _new _edit _view _delete _print _close parameter.h _close clicked() bankAccounts close() 20 20 20 20 _bankaccnt valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/bankAdjustment.cpp000066400000000000000000000141421217451700100210550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bankAdjustment.h" #include #include #include #include bankAdjustment::bankAdjustment(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sBankAccount(int))); _bankaccnt->populate("SELECT bankaccnt_id," " (bankaccnt_name || '-' || bankaccnt_descrip)," " bankaccnt_name " "FROM bankaccnt " "ORDER BY bankaccnt_name;"); _bankadjtype->populate("SELECT bankadjtype_id," " (bankadjtype_name || '-' || bankadjtype_descrip)," " bankadjtype_name " "FROM bankadjtype " "ORDER BY bankadjtype_name;"); _bankadjid = -1; } bankAdjustment::~bankAdjustment() { // no need to delete child widgets, Qt does it all for us } void bankAdjustment::languageChange() { retranslateUi(this); } SetResponse bankAdjustment::set( const ParameterList & pParams ) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("bankaccnt_id", &valid); if (valid) { _bankaccnt->setId(param.toInt()); //_bankaccnt->setEnabled(FALSE); } param = pParams.value("bankadj_id", &valid); if(valid) { _bankadjid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _bankaccnt->setEnabled(FALSE); _bankadjtype->setEnabled(FALSE); _date->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _amount->setEnabled(FALSE); _notes->setReadOnly(TRUE); _save->hide(); } } return NoError; } void bankAdjustment::sSave() { XSqlQuery bankSave; if (!_date->isValid()) { QMessageBox::information( this, tr("Cannot Post Bank Adjustment"), tr("You must enter a date before posting this Bank Adjustment.") ); _date->setFocus(); return; } if (_amount->isZero()) { QMessageBox::information( this, tr("Cannot Post Bank Adjustment"), tr("You must enter an amount before posting this Bank Adjustment.") ); _amount->setFocus(); return; } if (_mode == cNew) bankSave.prepare( "INSERT INTO bankadj " "(bankadj_bankaccnt_id, bankadj_bankadjtype_id," " bankadj_date, bankadj_docnumber, bankadj_amount, " " bankadj_notes, bankadj_curr_id ) " "VALUES " "(:bankaccnt_id, :bankadjtype_id," " :date, :docnumber, :amount, :notes, :curr_id);" ); else if (_mode == cEdit) { bankSave.prepare ( "UPDATE bankadj " "SET bankadj_bankaccnt_id=:bankaccnt_id," " bankadj_bankadjtype_id=:bankadjtype_id," " bankadj_date=:date," " bankadj_docnumber=:docnumber," " bankadj_amount=:amount," " bankadj_notes=:notes, " " bankadj_curr_id=:curr_id " "WHERE ((bankadj_id=:bankadj_id)" " AND (NOT bankadj_posted) ); "); bankSave.bindValue(":bankadj_id", _bankadjid); } bankSave.bindValue(":bankaccnt_id", _bankaccnt->id()); bankSave.bindValue(":bankadjtype_id", _bankadjtype->id()); bankSave.bindValue(":date", _date->date()); bankSave.bindValue(":docnumber", _docNumber->text()); bankSave.bindValue(":amount", _amount->localValue()); bankSave.bindValue(":notes", _notes->toPlainText()); bankSave.bindValue(":curr_id", _amount->id()); if(!bankSave.exec()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } omfgThis->sBankAdjustmentsUpdated(_bankadjid, TRUE); close(); } void bankAdjustment::populate() { XSqlQuery bankpopulate; bankpopulate.prepare( "SELECT bankadj_bankaccnt_id, bankadj_bankadjtype_id," " bankadj_date, bankadj_docnumber, bankadj_amount," " bankadj_notes, bankadj_curr_id " "FROM bankadj " "WHERE (bankadj_id=:bankadj_id);" ); bankpopulate.bindValue(":bankadj_id", _bankadjid); bankpopulate.exec(); if(bankpopulate.first()) { _bankaccnt->setId(bankpopulate.value("bankadj_bankaccnt_id").toInt()); _bankadjtype->setId(bankpopulate.value("bankadj_bankadjtype_id").toInt()); _date->setDate(bankpopulate.value("bankadj_date").toDate()); _docNumber->setText(bankpopulate.value("bankadj_docnumber").toString()); _amount->set(bankpopulate.value("bankadj_amount").toDouble(), bankpopulate.value("bankadj_curr_id").toInt(), bankpopulate.value("bankadj_date").toDate(), false); _notes->setText(bankpopulate.value("bankadj_notes").toString()); } } void bankAdjustment::sBankAccount(int accountId) { XSqlQuery bankQ; bankQ.prepare("SELECT bankaccnt_curr_id " "FROM bankaccnt WHERE bankaccnt_id = :accntId;"); bankQ.bindValue(":accntId", accountId); bankQ.exec(); if (bankQ.first()) _amount->setId(bankQ.value("bankaccnt_curr_id").toInt()); if (bankQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), bankQ.lastError().databaseText()); } qt-client-4.1.0/guiclient/bankAdjustment.h000066400000000000000000000021401217451700100205150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BANKADJUSTMENT_H #define BANKADJUSTMENT_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_bankAdjustment.h" class bankAdjustment : public XWidget, public Ui::bankAdjustment { Q_OBJECT public: bankAdjustment(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~bankAdjustment(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sBankAccount( int accountId ); protected: virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _bankadjid; }; #endif // BANKADJUSTMENT_H qt-client-4.1.0/guiclient/bankAdjustment.ui000066400000000000000000000250201217451700100207050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bankAdjustment 0 0 491 411 Bank Adjustment 0 Adjustment Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 Qt::Horizontal QSizePolicy::Expanding 40 20 0 0 0 Qt::Horizontal QSizePolicy::Expanding 40 20 Qt::Vertical QSizePolicy::Preferred 20 0 0 5 true &Save true true &Cancel Qt::Vertical QSizePolicy::Preferred 10 0 Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 40 20 Qt::AlignLeading true false Qt::Horizontal QSizePolicy::Expanding 260 20 0 Notes: 0 0 true CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
DLineEdit QWidget
datecluster.h
1
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_bankaccnt _bankadjtype _date _docNumber _amount _notes _close _close clicked() bankAdjustment close() 20 20 20 20
qt-client-4.1.0/guiclient/bankAdjustmentEditList.cpp000066400000000000000000000145141217451700100225220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bankAdjustmentEditList.h" #include #include #include #include #include #include #include #include "guiclient.h" #include "bankAdjustment.h" #include "storedProcErrorLookup.h" bankAdjustmentEditList::bankAdjustmentEditList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_adjustments, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); _bankaccnt->populate("SELECT bankaccnt_id," " (bankaccnt_name || '-' || bankaccnt_descrip)," " bankaccnt_name " "FROM bankaccnt " "ORDER BY bankaccnt_name;"); _adjustments->addColumn(tr("Bank Account"),_itemColumn, Qt::AlignLeft, true, "f_bank"); _adjustments->addColumn(tr("Adj. Type"), _orderColumn, Qt::AlignLeft, true, "bankadjtype_name"); _adjustments->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter,true, "bankadj_date"); _adjustments->addColumn(tr("Doc. Number"), -1, Qt::AlignRight, true, "bankadj_docnumber"); _adjustments->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight, true, "bankadj_amount"); _adjustments->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "currabbr"); if (omfgThis->singleCurrency()) _adjustments->hideColumn("currabbr"); if (_privileges->check("MaintainBankAdjustments")) { connect(_adjustments, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_adjustments, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_adjustments, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_adjustments, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(omfgThis, SIGNAL(bankAdjustmentsUpdated(int, bool)), this, SLOT(sFillList())); sFillList(); } bankAdjustmentEditList::~bankAdjustmentEditList() { // no need to delete child widgets, Qt does it all for us } void bankAdjustmentEditList::languageChange() { retranslateUi(this); } void bankAdjustmentEditList::sPrint() { ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); orReport report("BankAdjustmentEditList", params); if (report.isValid()) report.print(); else report.reportError(this); } void bankAdjustmentEditList::sNew() { ParameterList params; params.append("mode", "new"); params.append("bankaccnt_id", _bankaccnt->id()); bankAdjustment *newdlg = new bankAdjustment(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void bankAdjustmentEditList::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("bankadj_id", _adjustments->id()); bankAdjustment *newdlg = new bankAdjustment(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void bankAdjustmentEditList::sView() { ParameterList params; params.append("mode", "view"); params.append("bankadj_id", _adjustments->id()); bankAdjustment *newdlg = new bankAdjustment(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void bankAdjustmentEditList::sDelete() { XSqlQuery bankDelete; bankDelete.prepare( "DELETE FROM bankadj " "WHERE ( (bankadj_id=:bankadj_id)" " AND (NOT bankadj_posted) ); "); bankDelete.bindValue(":bankadj_id", _adjustments->id()); bankDelete.exec(); sFillList(); } void bankAdjustmentEditList::sFillList() { XSqlQuery bankFillList; bankFillList.prepare( "SELECT *," " (bankaccnt_name || '-' || bankaccnt_descrip) AS f_bank," " 'curr' AS bankadj_amount_xtnumericrole, " " currConcat(bankadj_curr_id) AS currabbr " "FROM bankadj LEFT OUTER JOIN bankaccnt ON (bankadj_bankaccnt_id=bankaccnt_id)" " LEFT OUTER JOIN bankadjtype ON (bankadj_bankadjtype_id=bankadjtype_id) " "WHERE ( (NOT bankadj_posted)" " AND (bankadj_bankaccnt_id=:bankaccnt_id) ); "); bankFillList.bindValue(":bankaccnt_id", _bankaccnt->id()); bankFillList.exec(); _adjustments->populate(bankFillList); if (bankFillList.lastError().type() != QSqlError::NoError) { systemError(this, bankFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void bankAdjustmentEditList::sPopulateMenu( QMenu * pMenu ) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainBankAdjustments")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("ViewBankAdjustments")); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainBankAdjustments")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostBankAdjustments")); } void bankAdjustmentEditList::sPost() { XSqlQuery bankPost; bankPost.prepare("SELECT postBankAdjustment(:bankadjid) AS result;"); bankPost.bindValue(":bankadjid", _adjustments->id()); bankPost.exec(); if (bankPost.first()) { int result = bankPost.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postBankAdjustment", result), __FILE__, __LINE__); return; } sFillList(); } else if (bankPost.lastError().type() != QSqlError::NoError) { systemError(this, bankPost.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/bankAdjustmentEditList.h000066400000000000000000000022011217451700100221550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BANKADJUSTMENTEDITLIST_H #define BANKADJUSTMENTEDITLIST_H #include "xwidget.h" #include "ui_bankAdjustmentEditList.h" class bankAdjustmentEditList : public XWidget, public Ui::bankAdjustmentEditList { Q_OBJECT public: bankAdjustmentEditList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~bankAdjustmentEditList(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sPost(); }; #endif // BANKADJUSTMENTEDITLIST_H qt-client-4.1.0/guiclient/bankAdjustmentEditList.ui000066400000000000000000000172371217451700100223620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bankAdjustmentEditList 0 0 584 311 Bank Adjustments Edit List 0 0 Bank Account: Qt::AlignVCenter|Qt::AlignRight 0 0 40 20 Expanding Horizontal 0 0 Adjustments 7 7 0 0 0 &Close &Print 0 0 &New false &Edit false &View false &Delete 20 60 Expanding Vertical XComboBox QComboBox
xcombobox.h
0
XTreeWidget QTreeWidget
xtreewidget.h
0
_close clicked() bankAdjustmentEditList close() _adjustments valid(bool) _view setEnabled(bool)
qt-client-4.1.0/guiclient/bankAdjustmentType.cpp000066400000000000000000000115021217451700100217140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bankAdjustmentType.h" #include #include bankAdjustmentType::bankAdjustmentType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } bankAdjustmentType::~bankAdjustmentType() { // no need to delete child widgets, Qt does it all for us } void bankAdjustmentType::languageChange() { retranslateUi(this); } enum SetResponse bankAdjustmentType::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("bankadjtype_id", &valid); if (valid) { _bankadjtypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _accnt->setEnabled(FALSE); _senseGroup->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void bankAdjustmentType::sSave() { XSqlQuery bankSave; if (_name->text().length() == 0) { QMessageBox::information( this, tr("Cannot Save Adjustment Type"), tr("You must enter a valid name for this Adjustment Type.") ); _name->setFocus(); return; } if (_accnt->id() == -1) { QMessageBox::information( this, tr("Cannot Save Adjustment Type"), tr("You must select a valid account for this Adjustment Type.") ); return; } if (_mode == cNew) { bankSave.exec("SELECT NEXTVAL('bankadjtype_bankadjtype_id_seq') AS bankadjtype_id"); if (bankSave.first()) _bankadjtypeid = bankSave.value("bankadjtype_id").toInt(); bankSave.prepare( "INSERT INTO bankadjtype " "(bankadjtype_id, bankadjtype_name, bankadjtype_descrip, bankadjtype_accnt_id, bankadjtype_iscredit) " "VALUES " "(:bankadjtype_id, :bankadjtype_name, :bankadjtype_descrip, :bankadjtype_accnt_id, :bankadjtype_iscredit);" ); } else if (_mode == cEdit) bankSave.prepare( "UPDATE bankadjtype " "SET bankadjtype_name=:bankadjtype_name," " bankadjtype_descrip=:bankadjtype_descrip, " " bankadjtype_accnt_id=:bankadjtype_accnt_id," " bankadjtype_iscredit=:bankadjtype_iscredit " "WHERE (bankadjtype_id=:bankadjtype_id);" ); bankSave.bindValue(":bankadjtype_id", _bankadjtypeid); bankSave.bindValue(":bankadjtype_name", _name->text()); bankSave.bindValue(":bankadjtype_descrip", _description->text().trimmed()); bankSave.bindValue(":bankadjtype_accnt_id", _accnt->id()); bankSave.bindValue(":bankadjtype_iscredit", _credit->isChecked()); bankSave.exec(); done(_bankadjtypeid); } void bankAdjustmentType::sCheck() { XSqlQuery bankCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length())) { bankCheck.prepare( "SELECT bankadjtype_id " "FROM bankadjtype " "WHERE (UPPER(bankadjtype_name)=UPPER(:bankadjtype_name));" ); bankCheck.bindValue(":bankadjtype_name", _name->text()); bankCheck.exec(); if (bankCheck.first()) { _bankadjtypeid = bankCheck.value("bankadjtype_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void bankAdjustmentType::populate() { XSqlQuery bankpopulate; bankpopulate.prepare( "SELECT bankadjtype_name, bankadjtype_descrip," " bankadjtype_accnt_id, bankadjtype_iscredit " "FROM bankadjtype " "WHERE (bankadjtype_id=:bankadjtype_id);" ); bankpopulate.bindValue(":bankadjtype_id", _bankadjtypeid); bankpopulate.exec(); if (bankpopulate.first()) { _name->setText(bankpopulate.value("bankadjtype_name")); _description->setText(bankpopulate.value("bankadjtype_descrip")); _accnt->setId(bankpopulate.value("bankadjtype_accnt_id").toInt()); if(bankpopulate.value("bankadjtype_iscredit").toBool()) _credit->setChecked(true); } } qt-client-4.1.0/guiclient/bankAdjustmentType.h000066400000000000000000000021601217451700100213610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BANKADJUSTMENTTYPE_H #define BANKADJUSTMENTTYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_bankAdjustmentType.h" class bankAdjustmentType : public XDialog, public Ui::bankAdjustmentType { Q_OBJECT public: bankAdjustmentType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~bankAdjustmentType(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); private: int _bankadjtypeid; int _mode; }; #endif // BANKADJUSTMENTTYPE_H qt-client-4.1.0/guiclient/bankAdjustmentType.ui000066400000000000000000000143041217451700100215520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bankAdjustmentType 0 0 505 191 Adjustment Type 0 5 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 Type 5 5 Debit true Credit Qt::Horizontal QSizePolicy::Expanding 40 20 Adj. Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Qt::Vertical QSizePolicy::Expanding 20 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save GLCluster QWidget
glcluster.h
XLineEdit QLineEdit
xlineedit.h
1
_name _description _accnt _debit _credit
qt-client-4.1.0/guiclient/bankAdjustmentTypes.cpp000066400000000000000000000074661217451700100221150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bankAdjustmentTypes.h" #include #include #include #include #include #include #include "bankAdjustmentType.h" #include "storedProcErrorLookup.h" bankAdjustmentTypes::bankAdjustmentTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_bankadjtype, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); if (_privileges->check("MaintainAdjustmentTypes")) { connect(_bankadjtype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_bankadjtype, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_bankadjtype, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_bankadjtype, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _bankadjtype->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "bankadjtype_name"); _bankadjtype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "bankadjtype_descrip"); sFillList(); } bankAdjustmentTypes::~bankAdjustmentTypes() { // no need to delete child widgets, Qt does it all for us } void bankAdjustmentTypes::languageChange() { retranslateUi(this); } void bankAdjustmentTypes::sNew() { ParameterList params; params.append("mode", "new"); bankAdjustmentType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void bankAdjustmentTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("bankadjtype_id", _bankadjtype->id()); bankAdjustmentType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void bankAdjustmentTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("bankadjtype_id", _bankadjtype->id()); bankAdjustmentType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void bankAdjustmentTypes::sDelete() { XSqlQuery bankDelete; bankDelete.prepare( "SELECT deleteBankAdjustmentType(:bankadjtype_id) AS result;" ); bankDelete.bindValue(":bankadjtype_id", _bankadjtype->id()); bankDelete.exec(); if (bankDelete.first()) { int result = bankDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteBankAdjustmentType", result), __FILE__, __LINE__); return; } } else if (bankDelete.lastError().type() != QSqlError::NoError) { systemError(this, bankDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void bankAdjustmentTypes::sFillList() { _bankadjtype->populate( "SELECT bankadjtype_id, bankadjtype_name, bankadjtype_descrip " "FROM bankadjtype " "ORDER BY bankadjtype_name;" ); } void bankAdjustmentTypes::sPopulateMenu( QMenu * ) { } void bankAdjustmentTypes::sPrint() { orReport report("AdjustmentTypes"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/bankAdjustmentTypes.h000066400000000000000000000021231217451700100215430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BANKADJUSTMENTTYPES_H #define BANKADJUSTMENTTYPES_H #include "guiclient.h" #include "xwidget.h" #include "ui_bankAdjustmentTypes.h" class bankAdjustmentTypes : public XWidget, public Ui::bankAdjustmentTypes { Q_OBJECT public: bankAdjustmentTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~bankAdjustmentTypes(); protected slots: virtual void languageChange(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); }; #endif // BANKADJUSTMENTTYPES_H qt-client-4.1.0/guiclient/bankAdjustmentTypes.ui000066400000000000000000000110711217451700100217330ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bankAdjustmentTypes 0 0 600 400 List Adjustment Types 0 Adjustment Types: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
_bankadjtype _new _edit _view _delete _print _close _bankadjtype valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() bankAdjustmentTypes close() 20 20 20 20
qt-client-4.1.0/guiclient/bom.cpp000066400000000000000000000476351217451700100166750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bom.h" #include #include #include #include #include #include #include #include #include "mqlutil.h" #include #include "bomItem.h" BOM::BOM(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_moveUp, SIGNAL(clicked()), this, SLOT(sMoveUp())); connect(_moveDown, SIGNAL(clicked()), this, SLOT(sMoveDown())); connect(_item, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_revision, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_showExpired, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_showFuture, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_bomitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_expire, SIGNAL(clicked()), this, SLOT(sExpire())); _totalQtyPerCache = 0.0; _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cPhantom | ItemLineEdit::cKit | ItemLineEdit::cPlanning | ItemLineEdit::cTooling); _batchSize->setValidator(omfgThis->qtyVal()); _requiredQtyPer->setValidator(omfgThis->qtyPerVal()); _nonPickNumber->setPrecision(omfgThis->qtyVal()); _nonPickQtyPer->setPrecision(omfgThis->qtyPerVal()); _pickNumber->setPrecision(omfgThis->qtyVal()); _pickQtyPer->setPrecision(omfgThis->qtyPerVal()); _totalNumber->setPrecision(omfgThis->qtyVal()); _totalQtyPer->setPrecision(omfgThis->qtyPerVal()); _currentStdCost->setPrecision(omfgThis->costVal()); _currentActCost->setPrecision(omfgThis->costVal()); _maxCost->setPrecision(omfgThis->costVal()); _bomitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "bomitem_seqnumber"); _bomitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); _bomitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_description"); _bomitem->addColumn(tr("Type"), _itemColumn, Qt::AlignCenter, true, "itemtype"); _bomitem->addColumn(tr("Issue UOM"), _uomColumn, Qt::AlignCenter, true, "issueuom"); _bomitem->addColumn(tr("Issue Method"), _itemColumn, Qt::AlignCenter, true, "issuemethod"); _bomitem->addColumn(tr("Fixd. Qty."), _qtyColumn, Qt::AlignRight, true, "bomitem_qtyfxd" ); _bomitem->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "bomitem_qtyper" ); _bomitem->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomitem_scrap" ); _bomitem->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter, true, "effective"); _bomitem->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter, true, "expires"); _bomitem->addColumn(tr("Notes"), _itemColumn, Qt::AlignLeft, false, "bomitem_notes" ); _bomitem->addColumn(tr("Reference"), _itemColumn, Qt::AlignLeft, false, "bomitem_ref" ); _bomitem->setDragString("bomid="); _bomitem->setAltDragString("itemid="); if (!_privileges->check("ViewCosts")) { _currentStdCostLit->hide(); _currentActCostLit->hide(); _maxCostLit->hide(); _currentStdCost->hide(); _currentActCost->hide(); _maxCost->hide(); } connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), SLOT(sFillList(int, bool))); _revision->setMode(RevisionLineEdit::Maintain); _revision->setType("BOM"); } BOM::~BOM() { // no need to delete child widgets, Qt does it all for us } void BOM::languageChange() { retranslateUi(this); } enum SetResponse BOM::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _new->setEnabled(FALSE); _revision->setId(-1); } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(TRUE); } else if (param.toString() == "view") { _mode = cView; _new->setEnabled(FALSE); _item->setReadOnly(TRUE); _documentNum->setEnabled(FALSE); _revision->setEnabled(FALSE); _revisionDate->setEnabled(FALSE); _batchSize->setEnabled(FALSE); _doRequireQtyPer->setEnabled(FALSE); _requiredQtyPer->setEnabled(FALSE); _save->setEnabled(FALSE); connect(_bomitem, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); { param = pParams.value("revision_id", &valid); if (valid) _revision->setId(param.toInt()); } } return NoError; } bool BOM::sSave() { XSqlQuery BSave; if(_item->id() == -1) { QMessageBox::warning( this, tr("Item Number Required"), tr("You must specify a valid item number to continue.")); return false; } if(_batchSize->text().length() == 0) _batchSize->setDouble(1.0); else if(_batchSize->toDouble() == 0.0) { QMessageBox::warning( this, tr("Batch Size Error"), tr("

The Batch Size quantity must be greater than zero.") ); return false; } if(!sCheckRequiredQtyPer()) return false; BSave.prepare( "SELECT bomhead_id " "FROM bomhead " "WHERE ((bomhead_item_id=:item_id) " "AND (bomhead_rev_id=:bomhead_rev_id));" ); BSave.bindValue(":item_id", _item->id()); BSave.bindValue(":bomhead_rev_id", _revision->id()); BSave.exec(); if (BSave.first()) { BSave.prepare( "UPDATE bomhead " "SET bomhead_docnum=:bomhead_docnum," " bomhead_revision=:bomhead_revision, bomhead_revisiondate=:bomhead_revisiondate," " bomhead_batchsize=:bomhead_batchsize," " bomhead_requiredqtyper=:bomhead_requiredqtyper " "WHERE ((bomhead_item_id=:bomhead_item_id) " "AND (bomhead_rev_id=:bomhead_rev_id));" ); BSave.bindValue(":bomhead_item_id", _item->id()); BSave.bindValue(":bomhead_rev_id", _revision->id()); } else { BSave.prepare( "INSERT INTO bomhead " "( bomhead_item_id, bomhead_docnum," " bomhead_revision, bomhead_revisiondate," " bomhead_batchsize, bomhead_requiredqtyper ) " "VALUES " "( :bomhead_item_id, :bomhead_docnum," " :bomhead_revision, :bomhead_revisiondate, " " :bomhead_batchsize, :bomhead_requiredqtyper ) " ); BSave.bindValue(":bomhead_item_id", _item->id()); } BSave.bindValue(":bomhead_docnum", _documentNum->text()); BSave.bindValue(":bomhead_revision", _revision->number()); BSave.bindValue(":bomhead_revisiondate", _revisionDate->date()); BSave.bindValue(":bomhead_batchsize", _batchSize->toDouble()); if(_doRequireQtyPer->isChecked()) BSave.bindValue(":bomhead_requiredqtyper", _requiredQtyPer->text().toDouble()); BSave.exec(); close(); return true; } bool BOM::setParams(ParameterList &pParams) { pParams.append("item_id", _item->id()); pParams.append("revision_id", _revision->id()); pParams.append("push", tr("Push")); pParams.append("pull", tr("Pull")); pParams.append("mixed", tr("Mixed")); pParams.append("error", tr("Error")); pParams.append("always", tr("'Always'")); pParams.append("never", tr("'Never'")); if (_showExpired->isChecked()) { pParams.append("showExpired"); pParams.append("expiredDays", 999); } if (_showFuture->isChecked()) { pParams.append("showFuture"); pParams.append("futureDays", 999); } pParams.append("purchased", tr("Purchased")); pParams.append("manufactured", tr("Manufactured")); pParams.append("job", tr("Job")); pParams.append("phantom", tr("Phantom")); pParams.append("breeder", tr("Breeder")); pParams.append("coProduct", tr("Co-Product")); pParams.append("byProduct", tr("By-Product")); pParams.append("reference", tr("Reference")); pParams.append("costing", tr("Costing")); pParams.append("tooling", tr("Tooling")); pParams.append("outside", tr("Outside Process")); pParams.append("planning", tr("Planning")); pParams.append("assortment", tr("Assortment")); pParams.append("kit", tr("Kit")); pParams.append("error", tr("Error")); return true; } void BOM::sPrint() { ParameterList params; setParams(params); orReport report("SingleLevelBOM", params); if (report.isValid()) report.print(); else report.reportError(this); } void BOM::sPopulateMenu(QMenu *menuThis) { menuThis->addAction(tr("View"), this, SLOT(sView())); if ((_mode == cNew) || (_mode == cEdit)) { menuThis->addAction(tr("Edit"), this, SLOT(sEdit())); menuThis->addAction(tr("Expire"), this, SLOT(sExpire())); menuThis->addAction(tr("Replace"), this, SLOT(sReplace())); if (_metrics->boolean("AllowBOMItemDelete")) { menuThis->addSeparator(); menuThis->addAction(tr("Delete"), this, SLOT(sDelete())); } menuThis->addSeparator(); menuThis->addAction(tr("Move Up"), this, SLOT(sMoveUp())); menuThis->addAction(tr("Move Down"), this, SLOT(sMoveDown())); } } void BOM::sNew() { ParameterList params; params.append("mode", "new"); params.append("item_id", _item->id()); params.append("revision_id", _revision->id()); bomItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void BOM::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("bomitem_id", _bomitem->id()); bomItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void BOM::sView() { ParameterList params; params.append("mode", "view"); params.append("bomitem_id", _bomitem->id()); bomItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void BOM::sExpire() { XSqlQuery BExpire; BExpire.prepare( "UPDATE bomitem " "SET bomitem_expires=CURRENT_DATE " "WHERE (bomitem_id=:bomitem_id);" ); BExpire.bindValue(":bomitem_id", _bomitem->id()); BExpire.exec(); omfgThis->sBOMsUpdated(_item->id(), TRUE); } void BOM::sDelete() { XSqlQuery BDelete; if (QMessageBox::question(this, tr("Delete Item?"), tr("

This action can not be undone. " "Are you sure you want to delete this Item?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { BDelete.prepare( "DELETE FROM bomitem " "WHERE (bomitem_id=:bomitem_id);" ); BDelete.bindValue(":bomitem_id", _bomitem->id()); BDelete.exec(); omfgThis->sBOMsUpdated(_item->id(), TRUE); } } void BOM::sReplace() { ParameterList params; params.append("mode", "replace"); params.append("bomitem_id", _bomitem->id()); params.append("revision_id", _revision->id()); bomItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void BOM::sMoveUp() { XSqlQuery BMoveUp; BMoveUp.prepare("SELECT moveBomitemUp(:bomitem_id) AS result;"); BMoveUp.bindValue(":bomitem_id", _bomitem->id()); BMoveUp.exec(); omfgThis->sBOMsUpdated(_item->id(), TRUE); } void BOM::sMoveDown() { XSqlQuery BMoveDown; BMoveDown.prepare("SELECT moveBomitemDown(:bomitem_id) AS result;"); BMoveDown.bindValue(":bomitem_id", _bomitem->id()); BMoveDown.exec(); omfgThis->sBOMsUpdated(_item->id(), TRUE); } void BOM::sFillList() { XSqlQuery BFillList; sFillList(_item->id(), TRUE); } void BOM::sFillList(int pItemid, bool) { XSqlQuery BFillList; if (_item->isValid() && (pItemid == _item->id())) { BFillList.prepare( "SELECT * " "FROM bomhead " "WHERE ( (bomhead_item_id=:item_id) " "AND (bomhead_rev_id=:revision_id) );" ); BFillList.bindValue(":item_id", _item->id()); BFillList.bindValue(":revision_id", _revision->id()); BFillList.exec(); if (BFillList.first()) { _documentNum->setText(BFillList.value("bomhead_docnum")); _revisionDate->setDate(BFillList.value("bomhead_revisiondate").toDate()); _batchSize->setDouble(BFillList.value("bomhead_batchsize").toDouble()); if(BFillList.value("bomhead_requiredqtyper").toDouble()!=0) { _doRequireQtyPer->setChecked(true); _requiredQtyPer->setDouble(BFillList.value("bomhead_requiredqtyper").toDouble()); } _revision->setNumber(BFillList.value("bomhead_revision").toString()); if ( (_revision->description() == "Inactive") || (_mode == cView) ) { _save->setEnabled(FALSE); _documentNum->setEnabled(FALSE); _revisionDate->setEnabled(FALSE); _batchSize->setEnabled(FALSE); _new->setEnabled(FALSE); _edit->setEnabled(FALSE); _expire->setEnabled(FALSE); _moveUp->setEnabled(FALSE); _moveDown->setEnabled(FALSE); disconnect(_bomitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); disconnect(_bomitem, SIGNAL(valid(bool)), _expire, SLOT(setEnabled(bool))); disconnect(_bomitem, SIGNAL(valid(bool)), _moveUp, SLOT(setEnabled(bool))); disconnect(_bomitem, SIGNAL(valid(bool)), _moveDown, SLOT(setEnabled(bool))); disconnect(_bomitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _save->setEnabled(TRUE); _documentNum->setEnabled(TRUE); _revisionDate->setEnabled(TRUE); _batchSize->setEnabled(TRUE); _new->setEnabled(TRUE); _edit->setEnabled(FALSE); _expire->setEnabled(FALSE); _moveUp->setEnabled(FALSE); _moveDown->setEnabled(FALSE); connect(_bomitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(valid(bool)), _expire, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(valid(bool)), _moveUp, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(valid(bool)), _moveDown, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } } else { if (_mode != cView) { _save->setEnabled(TRUE); _documentNum->setEnabled(TRUE); _revisionDate->setEnabled(TRUE); _batchSize->setEnabled(TRUE); _new->setEnabled(TRUE); _edit->setEnabled(FALSE); _expire->setEnabled(FALSE); _moveUp->setEnabled(FALSE); _moveDown->setEnabled(FALSE); connect(_bomitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(valid(bool)), _expire, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(valid(bool)), _moveUp, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(valid(bool)), _moveDown, SLOT(setEnabled(bool))); connect(_bomitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); _documentNum->clear(); _revisionDate->clear(); _batchSize->clear(); } } ParameterList params; setParams(params); MetaSQLQuery mql = mqlLoad("bomItems", "detail"); BFillList = mql.toQuery(params); _bomitem->populate(BFillList); if (BFillList.lastError().type() != QSqlError::NoError) { systemError(this, BFillList.lastError().databaseText(), __FILE__, __LINE__); return; } MetaSQLQuery picklistmql("SELECT item_picklist," " COUNT(*) AS total," " COALESCE(SUM(bomitem_qtyper * (1 + bomitem_scrap))) AS qtyper " "FROM bomitem(," " ), item " "WHERE ( (bomitem_item_id=item_id)" "" " AND (bomitem_expires > CURRENT_DATE)" "" "" " AND (bomitem_effective <= CURRENT_DATE)" "" " ) " "GROUP BY item_picklist;"); BFillList = picklistmql.toQuery(params); bool foundPick = FALSE; bool foundNonPick = FALSE; int totalNumber = 0; double totalQtyPer = 0.0; while (BFillList.next()) { totalNumber += BFillList.value("total").toInt(); totalQtyPer += BFillList.value("qtyper").toDouble(); if (BFillList.value("item_picklist").toBool()) { foundPick = TRUE; _pickNumber->setDouble(BFillList.value("total").toDouble()); _pickQtyPer->setDouble(BFillList.value("qtyper").toDouble()); } else { foundNonPick = TRUE; _nonPickNumber->setDouble(BFillList.value("total").toDouble()); _nonPickQtyPer->setDouble(BFillList.value("qtyper").toDouble()); } } if (BFillList.lastError().type() != QSqlError::NoError) { systemError(this, BFillList.lastError().databaseText(), __FILE__, __LINE__); return; } if (!foundPick) { _pickNumber->setDouble(0); _pickQtyPer->setDouble(0.0); } if (!foundNonPick) { _nonPickNumber->setDouble(0); _nonPickQtyPer->setDouble(0.0); } _totalNumber->setDouble(totalNumber); _totalQtyPer->setDouble(totalQtyPer); _totalQtyPerCache = totalQtyPer; if (_privileges->check("ViewCosts")) { MetaSQLQuery costsmql("SELECT p.item_maxcost," " COALESCE(SUM(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper * (1 + bomitem_scrap)) * stdCost(c.item_id))) AS stdcost," " COALESCE(SUM(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper * (1 + bomitem_scrap)) * ROUND(actCost(c.item_id),4))) AS actcost " "FROM bomitem(," " ), item AS c, item AS p " "WHERE ( (bomitem_item_id=c.item_id)" " AND (p.item_id=)" "" " AND (bomitem_expires > CURRENT_DATE)" "" "" " AND (bomitem_effective <= CURRENT_DATE)" "" " ) " "GROUP BY p.item_maxcost;"); BFillList = costsmql.toQuery(params); if (BFillList.first()) { _currentStdCost->setDouble(BFillList.value("stdcost").toDouble()); _currentActCost->setDouble(BFillList.value("actcost").toDouble()); _maxCost->setDouble(BFillList.value("item_maxcost").toDouble()); } if (BFillList.lastError().type() != QSqlError::NoError) { systemError(this, BFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (!_item->isValid()) { _documentNum->clear(); _revision->clear(); _revisionDate->clear(); _batchSize->clear(); _bomitem->clear(); } } void BOM::sClose() { if(sCheckRequiredQtyPer()) close(); } bool BOM::sCheckRequiredQtyPer() { if(cView == _mode || !_doRequireQtyPer->isChecked() || _totalQtyPerCache == 0.0) return true; if(_requiredQtyPer->toDouble() != _totalQtyPerCache) { QMessageBox::warning( this, tr("Total Qty. Per Required"), tr("

A required total Qty. Per was specified but not met. " "Please correct the problem before continuing.") ); return false; } return true; } qt-client-4.1.0/guiclient/bom.h000066400000000000000000000026701217451700100163300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BOM_H #define BOM_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_bom.h" class BOM : public XWidget, public Ui::BOM { Q_OBJECT public: BOM(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~BOM(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool setParams(ParameterList &pParams); virtual bool sSave(); virtual void sPrint(); virtual void sPopulateMenu( QMenu * menuThis ); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sExpire(); virtual void sDelete(); virtual void sReplace(); virtual void sMoveUp(); virtual void sMoveDown(); virtual void sFillList(); virtual void sFillList( int pItemid, bool ); virtual void sClose(); virtual bool sCheckRequiredQtyPer(); protected slots: virtual void languageChange(); private: int _mode; double _totalQtyPerCache; int _revid; }; #endif // BOM_H qt-client-4.1.0/guiclient/bom.ui000066400000000000000000000525421217451700100165210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. BOM 0 0 800 600 Bill of Materials 0 1 QFrame::NoFrame 0 &New true false &Edit true false &View true false E&xpire true false Move &Up true false Move Do&wn true Qt::Vertical QSizePolicy::Expanding 20 0 Item #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal Revision: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal RevisionLineEdit::Maintain RevisionLineEdit::BOM Qt::Horizontal 13 20 Docu&ment #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _documentNum Batch Size: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _revisionDate 0 0 80 16777215 Qt::AlignRight 12 0 0 Show Expi&red 0 0 Show &Future Qt::Horizontal QSizePolicy::Fixed 20 20 Da&te: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _revisionDate &Save true Cancel Qt::Vertical QSizePolicy::Expanding 20 0 &Print Number of Items Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Total Qty. Per Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Pick List Items: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Non-Pick List Items: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Totals: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Standard Material Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Actual Material Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Maximum Desired Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Total Qty. Per should equal frame_2 _totalsGroup _costsGroup DLineEdit QWidget

datecluster.h
1 ItemCluster QWidget
itemcluster.h
RevisionCluster QWidget
revisioncluster.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
_close _bomitem _requiredQtyPer _doRequireQtyPer toggled(bool) _requiredQtyPer setEnabled(bool) 20 20 20 20 _item newId(int) _revision setTargetId(int) 181 46 532 39 _bomitem valid(bool) _view setEnabled(bool) 334 292 715 241 qt-client-4.1.0/guiclient/bomItem.cpp000066400000000000000000000661611217451700100175070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bomItem.h" #include #include #include #include #include #include "itemSubstitute.h" #include "itemCost.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "storedProcErrorLookup.h" #include "mqlutil.h" const char *_issueMethods[] = { "S", "L", "M" }; bomItem::bomItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); QButtonGroup* _substituteGroupInt = new QButtonGroup(this); _substituteGroupInt->addButton(_noSubstitutes); _substituteGroupInt->addButton(_itemDefinedSubstitutes); _substituteGroupInt->addButton(_bomDefinedSubstitutes); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSaveClick())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_item, SIGNAL(typeChanged(const QString&)), this, SLOT(sItemTypeChanged(const QString&))); connect(_item, SIGNAL(newId(int)), this, SLOT(sItemIdChanged())); connect(_newSubstitution, SIGNAL(clicked()), this, SLOT(sNewSubstitute())); connect(_editSubstitution, SIGNAL(clicked()), this, SLOT(sEditSubstitute())); connect(_deleteSubstitution, SIGNAL(clicked()), this, SLOT(sDeleteSubstitute())); connect(_itemcost, SIGNAL(itemSelectionChanged()), this, SLOT(sCostSelectionChanged())); connect(_newCost, SIGNAL(clicked()), this, SLOT(sNewCost())); connect(_editCost, SIGNAL(clicked()), this, SLOT(sEditCost())); connect(_deleteCost, SIGNAL(clicked()), this, SLOT(sDeleteCost())); connect(_char, SIGNAL(activated(int)), this, SLOT(sCharIdChanged())); if (_metrics->boolean("AllowInactiveBomItems")) _item->setType(ItemLineEdit::cGeneralComponents); else _item->setType(ItemLineEdit::cGeneralComponents | ItemLineEdit::cActive); _dates->setStartNull(tr("Always"), omfgThis->startOfTime(), TRUE); _dates->setStartCaption(tr("Effective")); _dates->setEndNull(tr("Never"), omfgThis->endOfTime(), TRUE); _dates->setEndCaption(tr("Expires")); _qtyFxd->setValidator(omfgThis->qtyVal()); _qtyPer->setValidator(omfgThis->qtyPerVal()); _scrap->setValidator(omfgThis->scrapVal()); _bomitemsub->addColumn(tr("Rank"), _whsColumn, Qt::AlignCenter, true, "bomitemsub_rank"); _bomitemsub->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); _bomitemsub->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip1"); _bomitemsub->addColumn(tr("Ratio"), _qtyColumn, Qt::AlignRight, true, "bomitemsub_uomratio"); _itemcost->addColumn(tr("Element"), -1, Qt::AlignLeft, true, "costelem_type"); _itemcost->addColumn(tr("Lower"), _costColumn, Qt::AlignCenter, true, "itemcost_lowlevel" ); _itemcost->addColumn(tr("Std. Cost"), _costColumn, Qt::AlignRight, true, "itemcost_stdcost" ); _itemcost->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft,true, "baseCurr" ); _itemcost->addColumn(tr("Posted"), _dateColumn, Qt::AlignCenter, true, "itemcost_posted" ); _itemcost->addColumn(tr("Act. Cost"), _costColumn, Qt::AlignRight, true, "itemcost_actcost" ); _itemcost->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft,true, "costCurr" ); _itemcost->addColumn(tr("Updated"), _dateColumn, Qt::AlignCenter, true, "itemcost_updated" ); if (omfgThis->singleCurrency()) { _itemcost->hideColumn(3); _itemcost->hideColumn(6); } _parentitemid=0; _saved=FALSE; adjustSize(); } bomItem::~bomItem() { // no need to delete child widgets, Qt does it all for us } void bomItem::languageChange() { retranslateUi(this); } enum SetResponse bomItem::set(const ParameterList &pParams) { XSqlQuery bomet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("bomitem_id", &valid); if (valid) { _bomitemid = param.toInt(); populate(); } param = pParams.value("item_id", &valid); if (valid) _parentitemid = param.toInt(); param = pParams.value("revision_id", &valid); if (valid) _revisionid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; QString issueMethod = _metrics->value("DefaultWomatlIssueMethod"); for (int counter = 0; counter < _issueMethod->count(); counter++) { if (issueMethod == _issueMethods[counter]) { _issueMethod->setCurrentIndex(counter); } } bomet.exec("SELECT NEXTVAL('bomitem_bomitem_id_seq') AS bomitem_id"); if (bomet.first()) _bomitemid = bomet.value("bomitem_id").toInt(); else if (bomet.lastError().type() != QSqlError::NoError) { systemError(this, bomet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } //Set up configuration tab if parent item is configured or kit bomet.prepare("SELECT item_config, item_type " "FROM item " "WHERE (item_id=:item_id); "); bomet.bindValue(":item_id", _parentitemid); bomet.exec(); if (bomet.first()) { if (bomet.value("item_config").toBool()) { MetaSQLQuery mql = mqlLoad("charass", "populate"); ParameterList params; params.append("name", true); params.append("type", "I"); params.append("id", _parentitemid); XSqlQuery qry = mql.toQuery(params); _char->populate(qry); } else _tab->removeTab(_tab->indexOf(_configurationTab)); if (bomet.value("item_type").toString() == "K") { if (_metrics->boolean("AllowInactiveBomItems")) _item->setType(ItemLineEdit::cKitComponents); else _item->setType(ItemLineEdit::cKitComponents | ItemLineEdit::cActive); } } connect(_bomDefinedCosts, SIGNAL(toggled(bool)), this, SLOT(sHandleBomitemCost())); } else if (param.toString() == "replace") { _mode = cReplace; _item->setId(-1); _dates->setStartDate(omfgThis->dbDate()); _sourceBomitemid = _bomitemid; bomet.exec("SELECT NEXTVAL('bomitem_bomitem_id_seq') AS bomitem_id"); if (bomet.first()) _bomitemid = bomet.value("bomitem_id").toInt(); else if (bomet.lastError().type() != QSqlError::NoError) { systemError(this, bomet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(TRUE); connect(_bomDefinedCosts, SIGNAL(toggled(bool)), this, SLOT(sHandleBomitemCost())); } else if (param.toString() == "copy") { _mode = cCopy; _sourceBomitemid = _bomitemid; bomet.exec("SELECT NEXTVAL('bomitem_bomitem_id_seq') AS bomitem_id"); if (bomet.first()) _bomitemid = bomet.value("bomitem_id").toInt(); else if (bomet.lastError().type() != QSqlError::NoError) { systemError(this, bomet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _dates->setStartDate(omfgThis->dbDate()); } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _qtyFxd->setEnabled(FALSE); _qtyPer->setEnabled(FALSE); _scrap->setEnabled(FALSE); _dates->setEnabled(FALSE); _createWo->setEnabled(FALSE); _issueWo->setEnabled(FALSE); _issueMethod->setEnabled(FALSE); _uom->setEnabled(FALSE); _comments->setReadOnly(TRUE); _ecn->setEnabled(FALSE); _substituteGroup->setEnabled(FALSE); _notes->setEnabled(FALSE); _ref->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); _newCost->setEnabled(false); _deleteCost->setEnabled(false); _editCost->setText("&View"); connect(_bomDefinedCosts, SIGNAL(toggled(bool)), this, SLOT(sHandleBomitemCost())); } } // Check the parent item type and if it is a Kit then change some widgets bomet.prepare("SELECT item_type " "FROM item " "WHERE (item_id=:item_id); "); bomet.bindValue(":item_id", _parentitemid); bomet.exec(); if (bomet.first() && (bomet.value("item_type").toString() == "K")) { _createWo->setChecked(false); _createWo->setEnabled(false); _issueMethod->setCurrentIndex(0); _issueMethod->setEnabled(false); _tab->setTabEnabled(_tab->indexOf(_substitutionsTab), false); } return NoError; } void bomItem::sSave() { QList errors; errors << GuiErrorCheck(_qtyPer->toDouble() == 0.0 && _qtyFxd->toDouble() == 0.0, _qtyPer, tr("You must enter a Quantity Per value before saving this BOM Item.")) << GuiErrorCheck(_scrap->text().length() == 0, _scrap, tr("You must enter a Scrap value before saving this BOM Item.")) << GuiErrorCheck(_dates->endDate() < _dates->startDate(), _dates, tr("The expiration date cannot be earlier than the effective date.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Bill of Material Item"), errors)) return; // Check the component item type and if it is a Reference then issue a warning // if (_item->type() == ItemLineEdit::cReference) XSqlQuery itemtype; itemtype.prepare("SELECT item_type FROM item WHERE (item_id=:item_id); "); itemtype.bindValue(":item_id", _item->id()); itemtype.exec(); if (itemtype.first() && itemtype.value("item_type").toString() == "R") { int answer = QMessageBox::question(this, tr("Reference Item"), tr("

Adding a Reference Item to a Bill of Material " "may cause W/O variances.

" "OK to continue? "), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); if (answer == QMessageBox::No) return; } XSqlQuery bomitem; if ( (_mode == cNew && !_saved) || (_mode == cCopy) || (_mode == cReplace) ) bomitem.prepare( "INSERT INTO bomitem" " ( bomitem_id, bomitem_parent_item_id, bomitem_seqnumber," " bomitem_item_id, bomitem_qtyper, bomitem_scrap," " bomitem_status, bomitem_effective, bomitem_expires," " bomitem_createwo, bomitem_issuemethod, bomitem_schedatwooper," " bomitem_ecn, bomitem_moddate, bomitem_subtype," " bomitem_uom_id, bomitem_rev_id, bomitem_booitem_seq_id," " bomitem_char_id, bomitem_value, bomitem_notes," " bomitem_ref, bomitem_qtyfxd, bomitem_issuewo )" " VALUES" " ( :bomitem_id, :bomitem_parent_item_id, :bomitem_seqnumber," " :bomitem_item_id, :bomitem_qtyper, :bomitem_scrap," " :bomitem_status, :bomitem_effective, :bomitem_expires," " :bomitem_createwo, :bomitem_issuemethod, :bomitem_schedatwooper," " :bomitem_ecn, :bomitem_moddate, :bomitem_subtype," " :bomitem_uom_id, :bomitem_rev_id, :bomitem_booitem_seq_id," " :bomitem_char_id, :bomitem_value, :bomitem_notes," " :bomitem_ref, :bomitem_qtyfxd, :bomitem_issuewo )" ";" ); else if (_mode == cEdit || _saved) bomitem.prepare( "UPDATE bomitem " "SET bomitem_qtyfxd=:bomitem_qtyfxd, bomitem_qtyper=:bomitem_qtyper," " bomitem_scrap=:bomitem_scrap, bomitem_effective=:bomitem_effective," " bomitem_expires=:bomitem_expires, bomitem_createwo=:bomitem_createwo," " bomitem_issuewo=:bomitem_issuewo, bomitem_issuemethod=:bomitem_issuemethod," " bomitem_uom_id=:bomitem_uom_id, bomitem_ecn=:bomitem_ecn," " bomitem_moddate=CURRENT_DATE, bomitem_subtype=:bomitem_subtype," " bomitem_char_id=:bomitem_char_id, bomitem_value=:bomitem_value," " bomitem_notes=:bomitem_notes, bomitem_ref=:bomitem_ref " "WHERE (bomitem_id=:bomitem_id);" ); else // ToDo return; bomitem.bindValue(":bomitem_id", _bomitemid); bomitem.bindValue(":bomitem_parent_item_id", _parentitemid); bomitem.bindValue(":bomitem_rev_id", _revisionid); bomitem.bindValue(":bomitem_item_id", _item->id()); bomitem.bindValue(":bomitem_uom_id", _uom->id()); bomitem.bindValue(":bomitem_qtyfxd", _qtyFxd->toDouble()); bomitem.bindValue(":bomitem_qtyper", _qtyPer->toDouble()); bomitem.bindValue(":bomitem_scrap", (_scrap->toDouble() / 100)); bomitem.bindValue(":bomitem_effective", _dates->startDate()); bomitem.bindValue(":bomitem_expires", _dates->endDate()); bomitem.bindValue(":bomitem_ecn", _ecn->text()); bomitem.bindValue(":bomitem_notes", _notes->toPlainText()); bomitem.bindValue(":bomitem_ref", _ref->toPlainText()); bomitem.bindValue(":bomitem_createwo", QVariant(_createWo->isChecked())); bomitem.bindValue(":bomitem_issuewo", QVariant(_createWo->isChecked() && _issueWo->isChecked())); bomitem.bindValue(":bomitem_issuemethod", _issueMethods[_issueMethod->currentIndex()]); bomitem.bindValue(":bomitem_schedatwooper", false); if (_noSubstitutes->isChecked()) bomitem.bindValue(":bomitem_subtype", "N"); else if (_itemDefinedSubstitutes->isChecked()) bomitem.bindValue(":bomitem_subtype", "I"); else if (_bomDefinedSubstitutes->isChecked()) bomitem.bindValue(":bomitem_subtype", "B"); if (_char->id() != -1) { bomitem.bindValue(":bomitem_char_id", _char->id()); bomitem.bindValue(":bomitem_value", _value->currentText()); } // Not used? // bomitem.bindValue(":configType", "N"); // bomitem.bindValue(":configId", -1); // bomitem.bindValue(":configFlag", QVariant(FALSE)); bomitem.exec(); if (bomitem.lastError().type() != QSqlError::NoError) { systemError(this, bomitem.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cReplace || _mode == cCopy) { // update the sequence number and revision of the new bomitemitem XSqlQuery replace; replace.prepare( "UPDATE bomitem " "SET bomitem_seqnumber=(SELECT bomitem_seqnumber" " FROM bomitem" " WHERE bomitem_id=:sourcebomitemid), " " bomitem_rev_id=(SELECT bomitem_rev_id" " FROM bomitem" " WHERE bomitem_id=:sourcebomitemid) " "WHERE (bomitem_id=:bomitem_id);" ); replace.bindValue(":sourcebomitemid", _sourceBomitemid); replace.bindValue(":bomitem_id", _bomitemid); replace.exec(); if (replace.lastError().type() != QSqlError::NoError) { systemError(this, replace.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_mode == cReplace) { // update the expiration date of the source item XSqlQuery replace; replace.prepare( "UPDATE bomitem " "SET bomitem_expires=:bomitem_expires " "WHERE (bomitem_id=:sourcebomitemid);" ); replace.bindValue(":bomitem_expires", _dates->startDate()); replace.bindValue(":sourcebomitemid", _sourceBomitemid); replace.exec(); if (replace.lastError().type() != QSqlError::NoError) { systemError(this, replace.lastError().databaseText(), __FILE__, __LINE__); return; } } omfgThis->sBOMsUpdated(_parentitemid, TRUE); emit saved(_bomitemid); _saved=TRUE; } void bomItem::sSaveClick() { sSave(); if (_saved) done(_bomitemid); } void bomItem::sClose() { XSqlQuery bomClose; if (_mode == cNew) { bomClose.prepare( "DELETE FROM bomitemsub " "WHERE (bomitemsub_bomitem_id=:bomitem_id);" "DELETE FROM bomitemcost " "WHERE (bomitemcost_bomitem_id=:bomitem_id);" ); bomClose.bindValue("bomitem_id", _bomitemid); bomClose.exec(); if (bomClose.lastError().type() != QSqlError::NoError) { systemError(this, bomClose.lastError().databaseText(), __FILE__, __LINE__); return; } } reject(); } void bomItem::sItemTypeChanged(const QString &type) { if (type == "M") _createWo->setEnabled(TRUE); else { _createWo->setEnabled(FALSE); _createWo->setChecked(FALSE); } } void bomItem::populate() { XSqlQuery qbomitem; qbomitem.prepare( "SELECT bomitem.*, item.* " "FROM bomitem JOIN item ON (item_id=bomitem_parent_item_id) " "WHERE (bomitem_id=:bomitem_id);" ); qbomitem.bindValue(":bomitem_id", _bomitemid); qbomitem.exec(); if (qbomitem.lastError().type() != QSqlError::NoError) { systemError(this, qbomitem.lastError().databaseText(), __FILE__, __LINE__); return; } if (qbomitem.first()) { _parentitemid = qbomitem.value("bomitem_parent_item_id").toInt(); _parentitemtype = qbomitem.value("item_type").toString(); _item->setId(qbomitem.value("bomitem_item_id").toInt()); _uom->setId(qbomitem.value("bomitem_uom_id").toInt()); _notes->setText(qbomitem.value("bomitem_notes").toString()); _ref->setText(qbomitem.value("bomitem_ref").toString()); for (int counter = 0; counter < _issueMethod->count(); counter++) { if (QString(qbomitem.value("bomitem_issuemethod").toString()[0]) == _issueMethods[counter]) { _issueMethod->setCurrentIndex(counter); } } if (_parentitemtype == "M" || _parentitemtype == "F") { _createWo->setChecked(qbomitem.value("bomitem_createwo").toBool()); _issueWo->setChecked(qbomitem.value("bomitem_issuewo").toBool()); } _dates->setStartDate(qbomitem.value("bomitem_effective").toDate()); _dates->setEndDate(qbomitem.value("bomitem_expires").toDate()); _qtyFxd->setDouble(qbomitem.value("bomitem_qtyfxd").toDouble()); _qtyPer->setDouble(qbomitem.value("bomitem_qtyper").toDouble()); _scrap->setDouble(qbomitem.value("bomitem_scrap").toDouble() * 100); if (_mode != cCopy) _ecn->setText(qbomitem.value("bomitem_ecn").toString()); _comments->setId(_bomitemid); if (qbomitem.value("item_config").toBool()) { MetaSQLQuery mql = mqlLoad("charass", "populate"); ParameterList params; params.append("name", true); params.append("type", "I"); params.append("id", _parentitemid); XSqlQuery qry = mql.toQuery(params); _char->populate(qry); _char->setId(qbomitem.value("bomitem_char_id").toInt()); sCharIdChanged(); _value->setText(qbomitem.value("bomitem_value").toString()); } else _tab->removeTab(_tab->indexOf(_configurationTab)); if (qbomitem.value("bomitem_subtype").toString() == "I") _itemDefinedSubstitutes->setChecked(true); else if (qbomitem.value("bomitem_subtype").toString() == "B") _bomDefinedSubstitutes->setChecked(true); else _noSubstitutes->setChecked(true); sFillSubstituteList(); sFillCostList(); } } void bomItem::sNewSubstitute() { sSave(); ParameterList params; params.append("mode", "new"); params.append("bomitem_id", _bomitemid); if (_mode == cNew) params.append("bomitem_item_id", _item->id()); itemSubstitute newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillSubstituteList(); } void bomItem::sEditSubstitute() { ParameterList params; params.append("mode", "edit"); params.append("bomitemsub_id", _bomitemsub->id()); itemSubstitute newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillSubstituteList(); } void bomItem::sDeleteSubstitute() { XSqlQuery bomDeleteSubstitute; bomDeleteSubstitute.prepare( "DELETE FROM bomitemsub " "WHERE (bomitemsub_id=:bomitemsub_id);" ); bomDeleteSubstitute.bindValue(":bomitemsub_id", _bomitemsub->id()); bomDeleteSubstitute.exec(); if (bomDeleteSubstitute.lastError().type() != QSqlError::NoError) { systemError(this, bomDeleteSubstitute.lastError().databaseText(), __FILE__, __LINE__); return; } sFillSubstituteList(); } void bomItem::sFillSubstituteList() { XSqlQuery bomFillSubstituteList; bomFillSubstituteList.prepare( "SELECT bomitemsub.*, item_number, item_descrip1," " 'ratio' AS bomitemsub_uomratio_xtnumericrole " "FROM bomitemsub, item " "WHERE ( (bomitemsub_item_id=item_id)" " AND (bomitemsub_bomitem_id=:bomitem_id) ) " "ORDER BY bomitemsub_rank, item_number" ); bomFillSubstituteList.bindValue(":bomitem_id", _bomitemid); bomFillSubstituteList.exec(); _bomitemsub->populate(bomFillSubstituteList); if (bomFillSubstituteList.lastError().type() != QSqlError::NoError) { systemError(this, bomFillSubstituteList.lastError().databaseText(), __FILE__, __LINE__); return; } } void bomItem::sItemIdChanged() { MetaSQLQuery muom = mqlLoad("uoms", "item"); ParameterList params; params.append("uomtype", "MaterialIssue"); params.append("item_id", _item->id()); XSqlQuery quom = muom.toQuery(params); _uom->populate(quom); XSqlQuery qitem; qitem.prepare("SELECT item_inv_uom_id, item_type " " FROM item" " WHERE(item_id=:item_id);"); qitem.bindValue(":item_id", _item->id()); qitem.exec(); if(qitem.first()) { _uom->setId(qitem.value("item_inv_uom_id").toInt()); if (qitem.value("item_type").toString() != "T" && qitem.value("item_type").toString() != "R") { if (_qtyPer->text().length() == 0) { _qtyFxd->setDouble(0.0); _qtyPer->setDouble(1.0); } } else if (_qtyPer->text().length() == 0) { _qtyFxd->setDouble(1.0); _qtyPer->setDouble(0.0); } if (_scrap->text().length() == 0) _scrap->setDouble(0.0); } } void bomItem::sCharIdChanged() { MetaSQLQuery mql = mqlLoad("charass", "populate"); ParameterList params; params.append("value", true); params.append("char", _char->id()); params.append("type", "I"); params.append("id", _parentitemid); XSqlQuery qry = mql.toQuery(params); _value->populate(qry); } void bomItem::sFillCostList() { if (_item->isValid() && _bomitemid > 0) { _itemcost->clear(); double standardCost = 0.0; double actualCostBase = 0.0; double actualCostLocal = 0.0; MetaSQLQuery mql = mqlLoad("itemCost", "list"); ParameterList params; params.append("error", tr("!ERROR!")); params.append("never", tr("Never")); params.append("bomitem_id", _bomitemid); XSqlQuery qry = mql.toQuery(params); if (qry.first()) { _bomDefinedCosts->setChecked(true); if (_privileges->check("CreateCosts") && _mode != cView) _newCost->setEnabled(true); } else { params.append("item_id", _item->id()); qry = mql.toQuery(params); _bomDefinedCosts->setChecked(false); _newCost->setEnabled(false); } _itemcost->populate(qry, true); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } bool multipleCurrencies = false; int firstCurrency = 0; bool baseKnown = true; if (qry.first()) { firstCurrency = qry.value("itemcost_curr_id").toInt(); do { standardCost += qry.value("itemcost_stdcost").toDouble(); if (qry.value("itemcost_actcost").isNull()) baseKnown = false; else actualCostBase += qry.value("actcostBase").toDouble(); actualCostLocal += qry.value("itemcost_actcost").toDouble(); if (! multipleCurrencies && qry.value("itemcost_curr_id").toInt() != firstCurrency) multipleCurrencies = true; } while (qry.next()); } XSqlQuery convert; double actualCost = 0; if (multipleCurrencies) { actualCost = actualCostBase; convert.prepare("SELECT currConcat(baseCurrId()) AS baseConcat, " " currConcat(baseCurrId()) AS currConcat;"); } else { actualCost = actualCostLocal; baseKnown = true; // not necessarily but we can trust actualCost convert.prepare("SELECT currConcat(baseCurrId()) AS baseConcat, " " currConcat(:firstCurrency) AS currConcat;" ); convert.bindValue(":firstCurrency", firstCurrency); } convert.exec(); if (convert.first()) new XTreeWidgetItem(_itemcost, _itemcost->topLevelItem(_itemcost->topLevelItemCount() - 1), -1, QVariant(tr("Totals")), "", formatCost(standardCost), convert.value("baseConcat"), "", baseKnown ? formatCost(actualCost) : tr("?????"), convert.value("currConcat")); else if (convert.lastError().type() != QSqlError::NoError) systemError(this, convert.lastError().databaseText(), __FILE__, __LINE__); } else _itemcost->clear(); } void bomItem::sHandleBomitemCost() { XSqlQuery qry; qry.prepare("SELECT toggleBomitemCost(:bomitem_id, :enabled);"); qry.bindValue(":bomitem_id", _bomitemid); qry.bindValue(":enabled", _bomDefinedCosts->isChecked()); qry.exec(); if (qry.lastError().type() != QSqlError::NoError) systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); sFillCostList(); } void bomItem::sCostSelectionChanged() { bool yes = (_itemcost->id() != -1); if (_privileges->check("EnterActualCosts")) _editCost->setEnabled(yes); if (_privileges->check("DeleteCosts") && _mode != cView) _deleteCost->setEnabled(yes); } void bomItem::sNewCost() { ParameterList params; params.append("bomitem_id", _bomitemid); params.append("mode", "new"); if (_mode == cNew) params.append("bomitem_item_id", _item->id()); itemCost newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec()) sFillCostList(); } void bomItem::sEditCost() { ParameterList params; params.append("bomitemcost_id", _itemcost->id()); if (_mode == cEdit) params.append("mode", "edit"); if (_mode == cView) params.append("mode", "view"); itemCost newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec()) sFillCostList(); } void bomItem::sDeleteCost() { XSqlQuery bomDeleteCost; bomDeleteCost.prepare( "DELETE FROM bomitemcost WHERE (bomitemcost_id=:bomitemcost_id);" ); bomDeleteCost.bindValue(":bomitemcost_id", _itemcost->id()); bomDeleteCost.exec(); if (bomDeleteCost.lastError().type() != QSqlError::NoError) systemError(this, bomDeleteCost.lastError().databaseText(), __FILE__, __LINE__); sFillCostList(); } qt-client-4.1.0/guiclient/bomItem.h000066400000000000000000000032461217451700100171470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BOMITEM_H #define BOMITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_bomItem.h" class bomItem : public XDialog, public Ui::bomItem { Q_OBJECT public: bomItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~bomItem(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sSaveClick(); virtual void sClose(); virtual void sItemTypeChanged( const QString & type ); virtual void populate(); virtual void sNewSubstitute(); virtual void sEditSubstitute(); virtual void sDeleteSubstitute(); virtual void sFillSubstituteList(); virtual void sItemIdChanged(); virtual void sCharIdChanged(); virtual void sFillCostList(); virtual void sHandleBomitemCost(); virtual void sCostSelectionChanged(); virtual void sNewCost(); virtual void sEditCost(); virtual void sDeleteCost(); signals: void saved(int); protected slots: virtual void languageChange(); private: int _mode; int _bomitemid; int _sourceBomitemid; int _parentitemid; QString _parentitemtype; int _revisionid; bool _saved; }; #endif // BOMITEM_H qt-client-4.1.0/guiclient/bomItem.ui000066400000000000000000000641671217451700100173460ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bomItem 0 0 683 669 Bill of Materials Item 12 Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Effectivity Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 40 20 &Qty. Per: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyPer 0 0 80 32767 Qt::AlignRight Issue UOM: 0 0 Qt::Horizontal 0 20 Sc&rap %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _scrap 0 0 80 32767 Qt::AlignRight Qt::Horizontal 40 20 Issue Method: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _issueMethod 0 Push Pull Mixed Qt::Horizontal QSizePolicy::Expanding 36 10 ECN #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ecn Qt::Horizontal QSizePolicy::Expanding 20 20 Fixed Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyFxd 80 16777215 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 0 1 0 Notes 0 3 true Reference Substitutions 0 5 No Substitutions Item-Defined Substitutions true BOM-Defined Substitutions 5 false 0 false New false Edit false Delete Qt::Vertical QSizePolicy::Expanding 16 16 Comments 0 5 Qt::StrongFocus Comments::BOMItem Configuration Characteristic: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::Horizontal 40 20 Qt::Vertical 20 40 Costs Costs are specific to this Bill of Material Item 0 0 0 0 20 Costing &Elements: _itemcost 7 false 0 0 false &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Create Child W/O at Parent W/O Explosion true false 0 0 Issue Child W/O to Parent W/O at Receipt Comments QWidget

comments.h
DateCluster QWidget
datecluster.h
ItemCluster QWidget
itemcluster.h
1
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
XTextEdit QTextEdit
xtextedit.h
_item _dates _qtyFxd _qtyPer _uom _issueMethod _ecn _tab _notes _ref _noSubstitutes _itemDefinedSubstitutes _bomDefinedSubstitutes _bomitemsub _newSubstitution _editSubstitution _deleteSubstitution _comments _char _value _bomDefinedSubstitutes toggled(bool) _bomitemsub setEnabled(bool) 352 655 352 655 _bomitemsub valid(bool) _editSubstitution setEnabled(bool) 352 655 451 655 _bomitemsub valid(bool) _deleteSubstitution setEnabled(bool) 352 655 451 655 _bomDefinedSubstitutes toggled(bool) _newSubstitution setEnabled(bool) 352 655 451 655 _bomitemsub itemDoubleClicked(QTreeWidgetItem*,int) _editSubstitution animateClick() 352 655 451 655 _bomDefinedCosts toggled(bool) _itemcost setEnabled(bool) 312 426 264 545 _itemcost itemDoubleClicked(XTreeWidgetItem*,int) _editCost animateClick() 264 545 548 514 _createWo toggled(bool) _issueWo setEnabled(bool) 341 226 344 235 qt-client-4.1.0/guiclient/bomList.cpp000066400000000000000000000117371217451700100175230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "bomList.h" #include #include #include #include "bom.h" #include "copyBOM.h" bomList::bomList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); connect(_showInactive, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_showComponent, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _bom->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); _bom->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), SLOT(sFillList(int, bool))); if (_privileges->check("MaintainBOMs")) { connect(_bom, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_bom, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_bom, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_bom, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_bom, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(-1, FALSE); } bomList::~bomList() { // no need to delete child widgets, Qt does it all for us } void bomList::languageChange() { retranslateUi(this); } void bomList::sCopy() { ParameterList params; params.append("item_id", _bom->id()); copyBOM newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void bomList::sDelete() { XSqlQuery bomDelete; if (QMessageBox::critical( this, tr("Delete Bill of Materials"), tr( "Are you sure that you want to delete the selected Bill of Materials?"), tr("&Yes"), tr("&No"), QString::null, 0, 1) == 0) { bomDelete.prepare( "SELECT deletebom(:item_id);" ); bomDelete.bindValue(":item_id", _bom->id()); bomDelete.exec(); omfgThis->sBOMsUpdated(-1, TRUE); } } void bomList::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("item_id", _bom->id()); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void bomList::sFillList( int pItemid, bool pLocal ) { QString sql; sql = "SELECT DISTINCT item_id, " " CASE WHEN " " COALESCE(bomitem_rev_id, -1)=-1 THEN " " 0 " " ELSE 1 " " END AS revcontrol, " " item_number, (item_descrip1 || ' ' || item_descrip2) AS descrip " "FROM item " " LEFT OUTER JOIN bomitem ON (item_id=bomitem_parent_item_id) " " LEFT OUTER JOIN bomhead ON (item_id=bomhead_item_id) " "WHERE (((bomitem_id IS NOT NULL) " "OR (bomhead_id IS NOT NULL)) "; if (!_showInactive->isChecked()) sql += " AND (item_active)"; if (_showComponent->isChecked()) sql += " AND (bomitem_id is not null)"; sql += ") " "ORDER BY item_number;"; if ((pItemid != -1) && (pLocal)) _bom->populate(sql, TRUE, pItemid); else _bom->populate(sql, TRUE); } void bomList::sNew() { ParameterList params; params.append("mode", "new"); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void bomList::sPrint() { ParameterList params; params.append( "item_id", _bom->id() ); orReport report("SingleLevelBOM", params); if (report.isValid()) report.print(); else report.reportError(this); } void bomList::sSearch( const QString &pTarget ) { _bom->clearSelection(); int i; for (i = 0; i < _bom->topLevelItemCount(); i++) { if (_bom->topLevelItem(i)->text(0).startsWith(pTarget, Qt::CaseInsensitive)) break; } if (i < _bom->topLevelItemCount()) { _bom->setCurrentItem(_bom->topLevelItem(i)); _bom->scrollToItem(_bom->topLevelItem(i)); } } void bomList::sView() { ParameterList params; params.append("mode", "view"); params.append("item_id", _bom->id()); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void bomList::sFillList() { sFillList(-1, TRUE); } void bomList::sHandleButtons() { if (_bom->altId() == 0) _delete->setEnabled(TRUE); else _delete->setEnabled(FALSE); } qt-client-4.1.0/guiclient/bomList.h000066400000000000000000000021771217451700100171660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BOMLIST_H #define BOMLIST_H #include "guiclient.h" #include "xwidget.h" #include "ui_bomList.h" class bomList : public XWidget, public Ui::bomList { Q_OBJECT public: bomList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~bomList(); public slots: virtual void sCopy(); virtual void sDelete(); virtual void sEdit(); virtual void sFillList( int pItemid, bool pLocal ); virtual void sNew(); virtual void sPrint(); virtual void sSearch( const QString & pTarget ); virtual void sView(); virtual void sFillList(); virtual void sHandleButtons(); protected slots: virtual void languageChange(); }; #endif // BOMLIST_H qt-client-4.1.0/guiclient/bomList.ui000066400000000000000000000173541217451700100173570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. bomList 0 0 800 600 Bills of Materials 12 12 7 5 S&earch for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _searchFor Show BOMs for &Inactive Items BOMs with &Component Items &Close 0 Bills of Materials: Qt::AlignVCenter 7 0 0 &New false &Edit false &View false &Print false Co&py false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XCheckBox QCheckBox
xcheckbox.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
_searchFor _showInactive _bom _new _edit _view _print _copy _delete _close _close clicked() bomList close() 20 20 20 20 _bom valid(bool) _view setEnabled(bool) 20 20 20 20 _bom valid(bool) _print setEnabled(bool) 20 20 20 20
qt-client-4.1.0/guiclient/budgets.cpp000066400000000000000000000112021217451700100175320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "budgets.h" #include #include #include #include #include #include "copyBudget.h" #include "guiclient.h" #include "maintainBudget.h" #include "storedProcErrorLookup.h" budgets::budgets(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _budget->addColumn(tr("Start Date"),_dateColumn, Qt::AlignLeft, true, "startdate"); _budget->addColumn(tr("End Date"), _dateColumn, Qt::AlignLeft, true, "enddate"); _budget->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "budghead_name"); _budget->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "budghead_descrip"); if (_privileges->check("MaintainBudgets")) { connect(_budget, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_budget, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_budget, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_budget, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_budget, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } connect(omfgThis, SIGNAL(budgetsUpdated(int, bool)), this, SLOT(sFillList())); sFillList(); } budgets::~budgets() { // no need to delete child widgets, Qt does it all for us } void budgets::languageChange() { retranslateUi(this); } void budgets::sDelete() { XSqlQuery budgetsDelete; budgetsDelete.prepare( "SELECT deleteBudget(:budghead_id) AS result;"); budgetsDelete.bindValue(":budghead_id", _budget->id()); budgetsDelete.exec(); if (budgetsDelete.first()) { int result = budgetsDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteBudget", result), __FILE__, __LINE__); return; } } else if (budgetsDelete.lastError().type() != QSqlError::NoError) { systemError(this, budgetsDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void budgets::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("budghead_id", _budget->id()); maintainBudget *newdlg = new maintainBudget(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void budgets::sView() { ParameterList params; params.append("mode", "view"); params.append("budghead_id", _budget->id()); maintainBudget *newdlg = new maintainBudget(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void budgets::sFillList() { XSqlQuery budgetsFillList; budgetsFillList.prepare("SELECT budghead_id, " " MIN(period_start) AS startdate," " MAX(period_end) AS enddate," " budghead_name, budghead_descrip " " FROM budghead LEFT OUTER JOIN budgitem " " JOIN period ON (budgitem_period_id=period_id) " " ON (budgitem_budghead_id=budghead_id) " " GROUP BY budghead_id, budghead_name, budghead_descrip " " ORDER BY startdate DESC, budghead_name;" ); budgetsFillList.exec(); _budget->populate(budgetsFillList); if (budgetsFillList.lastError().type() != QSqlError::NoError) { systemError(this, budgetsFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void budgets::sNew() { ParameterList params; params.append("mode", "new"); maintainBudget *newdlg = new maintainBudget(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void budgets::sPrint() { orReport report("BudgetsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void budgets::sCopy() { ParameterList params; params.append("budghead_id", _budget->id()); copyBudget newdlg(this, "", true); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } qt-client-4.1.0/guiclient/budgets.h000066400000000000000000000017271217451700100172120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BUDGETS_H #define BUDGETS_H #include "xwidget.h" #include "ui_budgets.h" class budgets : public XWidget, public Ui::budgets { Q_OBJECT public: budgets(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~budgets(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); virtual void sCopy(); protected slots: virtual void languageChange(); }; #endif // BUDGETS_H qt-client-4.1.0/guiclient/budgets.ui000066400000000000000000000120111217451700100173640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. budgets 0 0 530 421 List Budgets 0 0 Budgets: _budget 0 5 &Close &Print 0 0 &New false &Edit false &View false Cop&y false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
_budget _new _edit _view _copy _delete _print _close _budget valid(bool) _view setEnabled(bool) 26 43 468 145 _close clicked() budgets close() 467 26 20 20
qt-client-4.1.0/guiclient/buyCard.cpp000066400000000000000000000143231217451700100174750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "buyCard.h" #include #include #include #include #include #include "guiclient.h" buyCard::buyCard(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_vendor, SIGNAL(newId(int)), this, SLOT(sHandleVendor(int))); connect(_itemSource, SIGNAL(newID(int)), this, SLOT(sHandleItemSource(int))); _item->setReadOnly(TRUE); _poitem->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "pohead_number"); _poitem->addColumn(tr("Line"), _whsColumn, Qt::AlignCenter,true, "poitem_linenumber"); _poitem->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter,true, "poitemstatus"); _poitem->addColumn(tr("Due Date"), _dateColumn, Qt::AlignRight, true, "poitem_duedate"); _poitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered"); _poitem->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "qty_received"); _poitem->addColumn(tr("Unit Cost"), _priceColumn, Qt::AlignRight, true, "poitem_unitprice"); } buyCard::~buyCard() { // no need to delete child widgets, Qt does it all for us } void buyCard::languageChange() { retranslateUi(this); } enum SetResponse buyCard::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("itemsrc_id", &valid); if (valid) { XSqlQuery vendid; vendid.prepare( "SELECT itemsrc_vend_id " "FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); vendid.bindValue(":itemsrc_id", param.toInt()); vendid.exec(); if (vendid.first()) { _vendor->setReadOnly(TRUE); _item->setReadOnly(TRUE); _itemSource->setEnabled(FALSE); _vendor->setId(vendid.value("itemsrc_vend_id").toInt()); _itemSource->setId(param.toInt()); } } return NoError; } bool buyCard::setParams(ParameterList &pparams) { pparams.append("vend_id", _vendor->id()); pparams.append("itemsrc_id", _itemSource->id()); pparams.append("itemNumber", _itemSource->currentText()); pparams.append("closed", tr("Closed")); pparams.append("unposted", tr("Unposted")); pparams.append("partial", tr("Partial")); pparams.append("received", tr("Received")); pparams.append("open", tr("Open")); return true; } void buyCard::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("BuyCard", params); if (report.isValid()) report.print(); else report.reportError(this); } void buyCard::sHandleVendor(int pVendorid) { XSqlQuery itemSource; itemSource.prepare( "SELECT itemsrc_id, itemsrc_vend_item_number " "FROM itemsrc " "WHERE (itemsrc_vend_id=:vend_id) " "ORDER BY itemsrc_vend_item_number;" ); itemSource.bindValue(":vend_id", pVendorid); itemSource.exec(); _itemSource->populate(itemSource); } void buyCard::sHandleItemSource(int pItemsrcid) { XSqlQuery item; item.prepare( "SELECT itemsrc_vend_item_descrip, itemsrc_item_id, itemsrc_comments " "FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); item.bindValue(":itemsrc_id", pItemsrcid); item.exec(); if (item.first()) { _vendorDescription->setText(item.value("itemsrc_vend_item_descrip").toString()); _item->setId(item.value("itemsrc_item_id").toInt()); _notes->setText(item.value("itemsrc_comments").toString()); QString sql("SELECT poitem_id, pohead_number, poitem_linenumber," " CASE WHEN(poitem_status='C') THEN " " WHEN(poitem_status='U') THEN " " WHEN(poitem_status='O' AND ((poitem_qty_received-poitem_qty_returned) > 0) AND (poitem_qty_ordered>(poitem_qty_received-poitem_qty_returned))) THEN " " WHEN(poitem_status='O' AND ((poitem_qty_received-poitem_qty_returned) > 0) AND (poitem_qty_ordered=(poitem_qty_received-poitem_qty_returned))) THEN " " WHEN(poitem_status='O') THEN " " ELSE poitem_status" " END AS poitemstatus," " poitem_duedate," " poitem_qty_ordered," " COALESCE(SUM(recv_qty), 0) AS qty_received," " poitem_unitprice," " 'qty' AS poitem_qty_ordered_xtnumericrole," " 'qty' AS qty_received_xtnumericrole," " 'purchprice' AS poitem_unitprice_xtnumericrole " "FROM pohead, poitem LEFT OUTER JOIN recv ON (recv_orderitem_id=poitem_id) " "WHERE ( (poitem_pohead_id=pohead_id)" " AND (pohead_vend_id=)" " AND (poitem_vend_item_number=) ) " "GROUP BY poitem_id, pohead_number, poitem_linenumber," " poitem_status, poitem_qty_received, poitem_qty_returned," " poitem_duedate, poitem_qty_ordered, poitem_unitprice " "ORDER BY pohead_number, poitem_linenumber;" ); MetaSQLQuery mql(sql); ParameterList params; if (!setParams(params)) return; XSqlQuery poitem = mql.toQuery(params); _poitem->populate(poitem); if (poitem.lastError().type() != QSqlError::NoError) { systemError(this, poitem.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/buyCard.h000066400000000000000000000021011217451700100171310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef BUYCARD_H #define BUYCARD_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_buyCard.h" class buyCard : public XWidget, public Ui::buyCard { Q_OBJECT public: buyCard(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~buyCard(); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPrint(); virtual void sHandleVendor( int pVendorid ); virtual void sHandleItemSource( int pItemsrcid ); protected slots: virtual void languageChange(); }; #endif // BUYCARD_H qt-client-4.1.0/guiclient/buyCard.ui000066400000000000000000000221571217451700100173340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. buyCard 0 0 648 580 Buy Card 7 0 Vendor: Qt::Vertical QSizePolicy::Expanding 20 0 0 Qt::Horizontal QSizePolicy::Expanding 188 16 5 Close &Print 7 5 Vendor Part Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 Vendor Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 16 80 16777215 120 true 0 Qt::Vertical QSizePolicy::Expanding 10 41 0 1 QFrame::NoFrame QFrame::Plain 0 0 Purchase History: 0 1 0 Notes: 16777215 120 true ItemCluster QWidget
itemcluster.h
VendorCluster QWidget
vendorcluster.h
XComboBox QComboBox
xcombobox.h
XTreeWidget QTreeWidget
xtreewidget.h
1
XTextEdit QTextEdit
xtextedit.h
_vendor _itemSource _vendorDescription _item _poitem _notes _print _close _close clicked() buyCard close() 20 20 20 20
qt-client-4.1.0/guiclient/calendar.cpp000066400000000000000000000265431217451700100176640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "calendar.h" #include #include #include #include "absoluteCalendarItem.h" #include "relativeCalendarItem.h" static const char *originTypes[] = { "D", "E", "W", "X", "M", "N", "L", "Y", "Z" }; calendar::calendar(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); } calendar::~calendar() { // no need to delete child widgets, Qt does it all for us } void calendar::languageChange() { retranslateUi(this); } enum SetResponse calendar::set(const ParameterList &pParams) { XSqlQuery calendaret; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("calhead_id", &valid); if (valid) { _calheadid = param.toInt(); populate(); } param = pParams.value("type", &valid); if (valid) { if (param.toString() == "absolute") { _type = 'A'; _absolute->setChecked(TRUE); _relative->setEnabled(FALSE); _absolute->setEnabled(FALSE); } else if (param.toString() == "relative") { _type = 'R'; _relative->setChecked(TRUE); _relative->setEnabled(FALSE); _absolute->setEnabled(FALSE); } } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; calendaret.exec("SELECT NEXTVAL('calhead_calhead_id_seq') AS _calhead_id;"); if (calendaret.first()) _calheadid = calendaret.value("_calhead_id").toInt(); else if (calendaret.lastError().type() != QSqlError::NoError) { systemError(this, calendaret.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; _relative->setEnabled(FALSE); _absolute->setEnabled(FALSE); } } return NoError; } void calendar::sSave() { XSqlQuery calendarSave; if(_name->text().length() == 0) { QMessageBox::critical(this, tr("Calendar Name Required"), tr("You must enter a Calendar Name to continue.") ); _name->setFocus(); return; } calendarSave.prepare("SELECT calhead_id" " FROM calhead" " WHERE((calhead_id != :calhead_id)" " AND (calhead_name=:calhead_name))"); calendarSave.bindValue(":calhead_id", _calheadid); calendarSave.bindValue(":calhead_name", _name->text()); calendarSave.exec(); if(calendarSave.first()) { QMessageBox::critical(this, tr("Duplicate Calendar Name"), tr("A Calendar already exists for the Name specified.") ); _name->setFocus(); return; } if (_mode == cNew) { if (_type =='R') calendarSave.prepare( "INSERT INTO calhead " "(calhead_id, calhead_name, calhead_descrip, calhead_type, calhead_origin) " "VALUES " "(:calhead_id, :calhead_name, :calhead_descrip, 'R', :calhead_origin);" ); else calendarSave.prepare( "INSERT INTO calhead " "(calhead_id, calhead_name, calhead_descrip, calhead_type) " "VALUES " "(:calhead_id, :calhead_name, :calhead_descrip, 'A');" ); } else if (_mode == cEdit) { if (_type =='R') calendarSave.prepare( "UPDATE calhead " "SET calhead_name=:calhead_name, calhead_descrip=:calhead_descrip, calhead_origin=:calhead_origin " "WHERE (calhead_id=:calhead_id);" ); else calendarSave.prepare( "UPDATE calhead " "SET calhead_name=:calhead_name, calhead_descrip=:calhead_descrip " "WHERE (calhead_id=:calhead_id);" ); } calendarSave.bindValue(":calhead_id", _calheadid); calendarSave.bindValue(":calhead_name", _name->text()); calendarSave.bindValue(":calhead_descrip", _descrip->text()); calendarSave.bindValue(":calhead_origin", originTypes[_origin->currentIndex()]); calendarSave.exec(); if (calendarSave.lastError().type() != QSqlError::NoError) { systemError(this, calendarSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_calheadid); } void calendar::sNew() { ParameterList params; params.append("mode", "new"); params.append("calhead_id", _calheadid); if (_mode == cNew) params.append("calendarName", _name->text()); if (_type == 'A') { absoluteCalendarItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } else if (_type == 'R') { relativeCalendarItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } } void calendar::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("calitem_id", _calitem->id()); if (_type == 'A') { absoluteCalendarItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } else if (_type == 'R') { relativeCalendarItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } } void calendar::sDelete() { XSqlQuery calendarDelete; if (_type == 'A') calendarDelete.prepare( "DELETE FROM acalitem " "WHERE (acalitem_id=:xcalitem_id);" ); else if (_type == 'R') calendarDelete.prepare( "DELETE FROM rcalitem " "WHERE (rcalitem_id=:xcalitem_id);" ); calendarDelete.bindValue(":xcalitem_id", _calitem->id()); calendarDelete.exec(); if (calendarDelete.lastError().type() != QSqlError::NoError) { systemError(this, calendarDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void calendar::sFillList() { XSqlQuery calendarFillList; _calitem->setColumnCount(0); _calitem->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "name"); if (_type == 'A') { _calitem->addColumn(tr("Start Date"), _dateColumn, Qt::AlignCenter, true, "acalitem_periodstart"); _calitem->addColumn(tr("Period"), _qtyColumn, Qt::AlignRight, true, "periodlength"); calendarFillList.prepare( "SELECT acalitem_id, acalitem_name AS name, acalitem_periodstart," " (TEXT(acalitem_periodlength) || TEXT(:days)) AS periodlength " "FROM acalitem " "WHERE (acalitem_calhead_id=:calhead_id) " "ORDER BY acalitem_periodstart;" ); calendarFillList.bindValue(":days", tr("Day(s)")); } else if (_type == 'R') { _calitem->addColumn(tr("Offset"), _itemColumn, Qt::AlignRight, true, "offsetdays"); _calitem->addColumn(tr("Period Length"), -1, Qt::AlignLeft, true, "periodlength"); calendarFillList.prepare( "SELECT rcalitem_id, rcalitem_name AS name," " CASE WHEN (rcalitem_periodtype='D') THEN (TEXT(rcalitem_periodcount) || :days)" " WHEN (rcalitem_periodtype='B') THEN (TEXT(rcalitem_periodcount) || :businessDays)" " WHEN (rcalitem_periodtype='W') THEN (TEXT(rcalitem_periodcount) || :weeks)" " WHEN (rcalitem_periodtype='M') THEN (TEXT(rcalitem_periodcount) || :months)" " WHEN (rcalitem_periodtype='Q') THEN (TEXT(rcalitem_periodcount) || :quarters)" " WHEN (rcalitem_periodtype='Y') THEN (TEXT(rcalitem_periodcount) || :years)" " ELSE :userDefined" " END AS periodlength," " CASE WHEN (rcalitem_offsettype='D') THEN (rcalitem_offsetcount)" " WHEN (rcalitem_offsettype='B') THEN (rcalitem_offsetcount)" " WHEN (rcalitem_offsettype='W') THEN (rcalitem_offsetcount * 7)" " WHEN (rcalitem_offsettype='M') THEN (rcalitem_offsetcount * 30)" " WHEN (rcalitem_offsettype='Q') THEN (rcalitem_offsetcount * 120)" " WHEN (rcalitem_offsettype='Y') THEN (rcalitem_offsetcount * 365)" " ELSE (rcalitem_offsetcount)" " END AS offsetdays," " CASE WHEN (rcalitem_offsettype='D') THEN (TEXT(rcalitem_offsetcount) || :days)" " WHEN (rcalitem_offsettype='B') THEN (TEXT(rcalitem_offsetcount) || :businessDays)" " WHEN (rcalitem_offsettype='W') THEN (TEXT(rcalitem_offsetcount) || :weeks)" " WHEN (rcalitem_offsettype='M') THEN (TEXT(rcalitem_offsetcount) || :months)" " WHEN (rcalitem_offsettype='Q') THEN (TEXT(rcalitem_offsetcount) || :quarters)" " WHEN (rcalitem_offsettype='Y') THEN (TEXT(rcalitem_offsetcount) || :years)" " ELSE :userDefined" " END AS offsetdays_qtdisplayrole " "FROM rcalitem " "WHERE (rcalitem_calhead_id=:calhead_id) " "ORDER BY offsetdays;" ); calendarFillList.bindValue(":days", tr("Day(s)")); calendarFillList.bindValue(":businessDays", tr("Business Day(s)")); calendarFillList.bindValue(":weeks", tr("Week(s)")); calendarFillList.bindValue(":months", tr("Month(s)")); calendarFillList.bindValue(":quarters", tr("Quarter(s)")); calendarFillList.bindValue(":years", tr("Year(s)")); calendarFillList.bindValue(":userDefined", tr("User-Defined")); } calendarFillList.bindValue(":calhead_id", _calheadid); calendarFillList.exec(); _calitem->populate(calendarFillList); if (calendarFillList.lastError().type() != QSqlError::NoError) { systemError(this, calendarFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void calendar::populate() { XSqlQuery calendarpopulate; calendarpopulate.prepare( "SELECT calhead_name, calhead_descrip, calhead_type, calhead_origin " "FROM calhead " "WHERE (calhead_id=:calhead_id);"); calendarpopulate.bindValue(":calhead_id", _calheadid); calendarpopulate.exec(); if (calendarpopulate.first()) { _name->setText(calendarpopulate.value("calhead_name")); _descrip->setText(calendarpopulate.value("calhead_descrip")); _type = calendarpopulate.value("calhead_type").toString()[0].toAscii(); if (_type == 'A') { _absolute->setChecked(TRUE); } else if (_type == 'R') { _relative->setChecked(TRUE); for (int counter = 0; counter < _origin->count(); counter++) if (calendarpopulate.value("calhead_origin").toString() == originTypes[counter]) { _origin->setCurrentIndex(counter); break; } } sFillList(); } else if (calendarpopulate.lastError().type() != QSqlError::NoError) { systemError(this, calendarpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/calendar.h000066400000000000000000000022231217451700100173160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CALENDAR_H #define CALENDAR_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_calendar.h" class calendar : public XDialog, public Ui::calendar { Q_OBJECT public: calendar(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~calendar(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _calitemid; int _calheadid; char _type; }; #endif // CALENDAR_H qt-client-4.1.0/guiclient/calendar.ui000066400000000000000000000245011217451700100175070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. calendar 0 0 563 446 Calendar Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Calendar Type: A&bsolute true Qt::Horizontal 40 20 5 &Relative Origin: false 0 0 Current Day Tomorrow Beginning of Current Week Beginning of Next Week Beginning of Current Month Beginning of Next Month Beginning of Last Year Beginning of Current Year Beginning of Next Year 0 Calendar Items: 7 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
_name _descrip _absolute _relative _origin _calitem _new _edit _delete _relative toggled(bool) _origin setEnabled(bool) 20 20 20 20 _calitem valid(bool) _edit setEnabled(bool) 20 20 20 20 _calitem itemSelected(int) _edit animateClick() 20 20 20 20 _calitem valid(bool) _delete setEnabled(bool) 20 20 20 20 _buttonBox rejected() calendar reject() 516 96 281 222
qt-client-4.1.0/guiclient/calendars.cpp000066400000000000000000000057721217451700100200500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "calendars.h" #include #include #include #include "calendar.h" calendars::calendars(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _calhead->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "calhead_name"); _calhead->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "calhead_descrip"); sFillList(); } calendars::~calendars() { // no need to delete child widgets, Qt does it all for us } void calendars::languageChange() { retranslateUi(this); } void calendars::sNew() { int calType = QMessageBox::information( this, tr("New Calendar Type?"), tr("What type of Calendar do you want to create?"), tr("Cancel"), tr("Absolute"), tr("Relative"), 1, 0 ); if (calType != 0) { ParameterList params; params.append("mode", "new"); if (calType == 1) params.append("type", "absolute"); else if (calType == 2) params.append("type", "relative"); calendar newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } } void calendars::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("calhead_id", _calhead->id()); calendar newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void calendars::sDelete() { XSqlQuery calendarsDelete; QString sql( "DELETE FROM calhead " "WHERE (calhead_id=:calhead_id);" ); if (_calhead->altId() == 1) sql += "DELETE FROM acalitem " "WHERE (acalitem_calhead_id=:calhead_id);"; else if (_calhead->altId() == 2) sql += "DELETE FROM rcalitem " "WHERE (rcalitem_calhead_id=:calhead_id);"; calendarsDelete.prepare(sql); calendarsDelete.bindValue(":calhead_id", _calhead->id()); calendarsDelete.exec(); sFillList(); } void calendars::sFillList() { _calhead->populate( "SELECT calhead_id," " CASE WHEN (calhead_type='A') THEN 1" " WHEN (calhead_type='R') THEN 2" " ELSE 3" " END," " calhead_name, calhead_descrip " "FROM calhead " "ORDER BY calhead_name;", TRUE ); } qt-client-4.1.0/guiclient/calendars.h000066400000000000000000000016621217451700100175070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CALENDARS_H #define CALENDARS_H #include "guiclient.h" #include "xwidget.h" #include "ui_calendars.h" class calendars : public XWidget, public Ui::calendars { Q_OBJECT public: calendars(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~calendars(); public slots: virtual void sFillList(); protected slots: virtual void languageChange(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); }; #endif // CALENDARS_H qt-client-4.1.0/guiclient/calendars.ui000066400000000000000000000116611217451700100176750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. calendars 0 0 600 400 List Calendars 0 Calendars: 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
1
_calhead _new _edit _delete _close _calhead valid(bool) _delete setEnabled(bool) 20 20 20 20 _calhead itemSelected(int) _edit animateClick() 20 20 20 20 _calhead valid(bool) _edit setEnabled(bool) 20 20 20 20 _close clicked() calendars close() 20 20 20 20
qt-client-4.1.0/guiclient/cashReceipt.cpp000066400000000000000000001123711217451700100203400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "cashReceipt.h" #include #include #include #include #include #include "cashReceiptItem.h" #include "cashReceiptMiscDistrib.h" #include "creditCard.h" #include "creditcardprocessor.h" #include "errorReporter.h" #include "mqlutil.h" #include "storedProcErrorLookup.h" const struct { const char * full; QString abbr; bool cc; } _fundsTypes[] = { { QT_TRANSLATE_NOOP("cashReceipt", "Check"), "C", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Certified Check"), "T", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Master Card"), "M", true }, { QT_TRANSLATE_NOOP("cashReceipt", "Visa"), "V", true }, { QT_TRANSLATE_NOOP("cashReceipt", "American Express"), "A", true }, { QT_TRANSLATE_NOOP("cashReceipt", "Discover Card"), "D", true }, { QT_TRANSLATE_NOOP("cashReceipt", "Other Credit Card"),"R", true }, { QT_TRANSLATE_NOOP("cashReceipt", "Cash"), "K", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Wire Transfer"), "W", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Other"), "O", false } }; cashReceipt::cashReceipt(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustomerInfo(int))); connect(_received, SIGNAL(editingFinished()), this, SLOT(sUpdateBalance())); connect(_applyToBalance, SIGNAL(clicked()), this, SLOT(sApplyToBalance())); connect(_apply, SIGNAL(clicked()), this, SLOT(sApply())); connect(_applyLineBalance, SIGNAL(clicked()), this, SLOT(sApplyLineBalance())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_clear, SIGNAL(clicked()), this, SLOT(sClear())); connect(_searchDocNum, SIGNAL(textChanged(const QString&)), this, SLOT(sSearchDocNumChanged())); connect(_applied, SIGNAL(valueChanged()), this, SLOT(sUpdateBalance())); connect(_miscDistribs, SIGNAL(valueChanged()), this, SLOT(sUpdateBalance())); connect(_received, SIGNAL(valueChanged()), this, SLOT(sUpdateBalance())); connect(_received, SIGNAL(idChanged(int)), this, SLOT(sFillApplyList())); connect(_received, SIGNAL(idChanged(int)), this, SLOT(sFillMiscList())); connect(_received, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(sFillApplyList())); connect(_received, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(sFillMiscList())); connect(_received, SIGNAL(idChanged(int)), this, SLOT(sChangeCurrency(int))); connect(_distDate, SIGNAL(newDate(QDate)), this, SLOT(sDateChanged())); connect(_applDate, SIGNAL(newDate(QDate)), this, SLOT(sDateChanged())); connect(_credits, SIGNAL(toggled(bool)), this, SLOT(sFillApplyList())); if (!_metrics->boolean("CCAccept") || !_privileges->check("ProcessCreditCards")) { _tab->removeTab(_tab->indexOf(_creditCardTab)); } else { connect(_newCC, SIGNAL(clicked()), this, SLOT(sNewCreditCard())); connect(_editCC, SIGNAL(clicked()), this, SLOT(sEditCreditCard())); connect(_viewCC, SIGNAL(clicked()), this, SLOT(sViewCreditCard())); connect(_upCC, SIGNAL(clicked()), this, SLOT(sMoveUp())); connect(_downCC, SIGNAL(clicked()), this, SLOT(sMoveDown())); connect(_fundsType, SIGNAL(activated(int)), this, SLOT(setCreditCard())); } QButtonGroup * bg = new QButtonGroup(this); bg->addButton(_balCreditMemo); bg->addButton(_balCustomerDeposit); _applied->clear(); _CCCVV->setValidator(new QIntValidator(100, 9999, this)); _cust->setType(CLineEdit::ActiveCustomers); _bankaccnt->setType(XComboBox::ARBankAccounts); _salescat->setType(XComboBox::SalesCategoriesActive); _aropen->addColumn(tr("Doc. Type"), -1, Qt::AlignCenter, true, "doctype"); _aropen->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "aropen_docnumber"); _aropen->addColumn(tr("Ord. #"), _orderColumn, Qt::AlignCenter, true, "aropen_ordernumber"); _aropen->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, true, "aropen_docdate"); _aropen->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "aropen_duedate"); _aropen->addColumn(tr("Balance"), _bigMoneyColumn, Qt::AlignRight, true, "balance"); _aropen->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, !omfgThis->singleCurrency(), "balance_curr"); _aropen->addColumn(tr("Applied"), _bigMoneyColumn, Qt::AlignRight, true, "applied"); _aropen->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, !omfgThis->singleCurrency(), "applied_curr"); _aropen->addColumn(tr("Discount"), _moneyColumn, Qt::AlignRight , true, "discount" ); _aropen->addColumn(tr("All Pending"),_moneyColumn, Qt::AlignRight, true, "pending"); _aropen->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, !omfgThis->singleCurrency(), "pending_curr"); _cashrcptmisc->addColumn(tr("Account #"), _itemColumn, Qt::AlignCenter, true, "account"); _cashrcptmisc->addColumn(tr("Notes"), -1, Qt::AlignLeft, true, "firstline"); _cashrcptmisc->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight, true, "cashrcptmisc_amount"); _cc->addColumn(tr("Sequence"),_itemColumn, Qt::AlignLeft, true, "ccard_seq"); _cc->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "type"); _cc->addColumn(tr("Number"), _itemColumn, Qt::AlignRight,true, "f_number"); _cc->addColumn(tr("Active"), _itemColumn, Qt::AlignLeft, true, "ccard_active"); _cc->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "ccard_name"); _cc->addColumn(tr("Expiration Date"), -1, Qt::AlignLeft, true, "expiration"); for (unsigned int i = 0; i < sizeof(_fundsTypes) / sizeof(_fundsTypes[1]); i++) { // only show credit card funds types if the user can process cc transactions if (! _fundsTypes[i].cc || (_fundsTypes[i].cc && _metrics->boolean("CCAccept") && _privileges->check("ProcessCreditCards")) ) _fundsType->append(i, tr(_fundsTypes[i].full), _fundsTypes[i].abbr); } if (!_metrics->boolean("CCAccept") || ! _privileges->check("ProcessCreditCards")) _tab->removeTab(_tab->indexOf(_creditCardTab)); if(_metrics->boolean("HideApplyToBalance")) _applyToBalance->hide(); if(_metrics->boolean("EnableCustomerDeposits")) _balCustomerDeposit->setChecked(true); else { _applyBalLit->hide(); _balCreditMemo->hide(); _balCustomerDeposit->hide(); } _overapplied = false; _cashrcptid = -1; _posted = false; } cashReceipt::~cashReceipt() { // no need to delete child widgets, Qt does it all for us } void cashReceipt::languageChange() { retranslateUi(this); } enum SetResponse cashReceipt::set(const ParameterList &pParams) { XSqlQuery cashet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("cashrcpt_id", &valid); if (valid) { _cashrcptid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _transType = cNew; cashet.exec("SELECT fetchCashRcptNumber() AS number;"); if (cashet.first()) _number->setText(cashet.value("number").toString()); else if (cashet.lastError().type() != QSqlError::NoError) { systemError(this, cashet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } cashet.exec("SELECT NEXTVAL('cashrcpt_cashrcpt_id_seq') AS cashrcpt_id;"); if (cashet.first()) _cashrcptid = cashet.value("cashrcpt_id").toInt(); else if (cashet.lastError().type() != QSqlError::NoError) { systemError(this, cashet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _applDate->setDate(omfgThis->dbDate(), true); _distDate->setDate(omfgThis->dbDate(), true); } else if (param.toString() == "edit") { _mode = cEdit; _transType = cEdit; _cust->setReadOnly(TRUE); } else if (param.toString() == "view") { _mode = cView; _transType = cView; _cust->setReadOnly(TRUE); _received->setEnabled(FALSE); _fundsType->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _docDate->setEnabled(FALSE); _bankaccnt->setEnabled(FALSE); _distDate->setEnabled(FALSE); _applDate->setEnabled(false); _aropen->setEnabled(FALSE); _searchDocNum->setEnabled(false); _cashrcptmisc->setEnabled(FALSE); _notes->setReadOnly(TRUE); _applyToBalance->setEnabled(FALSE); _add->setEnabled(FALSE); _balCreditMemo->setEnabled(false); _balCustomerDeposit->setEnabled(false); _save->hide(); _close->setText(tr("&Close")); _altAccnt->setEnabled(false); _newCC->setEnabled(FALSE); _editCC->setEnabled(FALSE); disconnect(_cashrcptmisc, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); disconnect(_cashrcptmisc, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } // if this cash receipt was by credit card cash then prevent changes _ccEdit = (_mode == cEdit) && (_origFunds == "A" || _origFunds == "D" || _origFunds == "M" || _origFunds == "V"); if(_ccEdit) { _received->setEnabled(FALSE); _fundsType->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _docDate->setEnabled(FALSE); _bankaccnt->setEnabled(FALSE); _distDate->setEnabled(FALSE); _applDate->setEnabled(FALSE); } } param = pParams.value("cust_id", &valid); if(cNew == _mode && valid) _cust->setId(param.toInt()); param = pParams.value("docnumber", & valid); if (valid) _searchDocNum->setText(param.toString()); return NoError; } void cashReceipt::sApplyToBalance() { if(!save(true)) return; XSqlQuery applyToBal; applyToBal.prepare( "UPDATE cashrcpt " "SET cashrcpt_cust_id=:cust_id, " " cashrcpt_curr_id=:curr_id, " " cashrcpt_docdate=:docdate " "WHERE (cashrcpt_id=:cashrcpt_id);" ); applyToBal.bindValue(":cust_id", _cust->id()); applyToBal.bindValue(":cashrcpt_id", _cashrcptid); applyToBal.bindValue(":curr_id", _received->id()); applyToBal.bindValue(":docdate", _docDate->date()); applyToBal.exec(); applyToBal.prepare("SELECT applyCashReceiptToBalance(:cashrcpt_id, " " :amount, :curr_id, :inclCredits) AS result;"); applyToBal.bindValue(":cashrcpt_id", _cashrcptid); applyToBal.bindValue(":amount", _received->localValue()); applyToBal.bindValue(":curr_id", _received->id()); applyToBal.bindValue(":inclCredits", _credits->isChecked()); applyToBal.exec(); if (applyToBal.lastError().type() != QSqlError::NoError) systemError(this, applyToBal.lastError().databaseText(), __FILE__, __LINE__); sFillApplyList(); } void cashReceipt::sApply() { if(_mode == cNew) { if(!save(TRUE)) { return; } } bool update = FALSE; QList list = _aropen->selectedItems(); XTreeWidgetItem *cursor = 0; for(int i = 0; i < list.size(); i++) { cursor = (XTreeWidgetItem*)list.at(i); ParameterList params; if(cursor->altId() != -1) { params.append("mode", "edit"); params.append("cashrcptitem_id", cursor->altId()); params.append("amount_to_apply", _received->localValue()); } else { params.append("mode", "new"); params.append("amount_to_apply", _balance->localValue()); } params.append("cashrcpt_id", _cashrcptid); params.append("aropen_id", cursor->id()); params.append("curr_id", _received->id()); cashReceiptItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) update = TRUE; } if (update) sFillApplyList(); } void cashReceipt::sApplyLineBalance() { if(!save(true)) return; XSqlQuery applyToBal; applyToBal.prepare( "UPDATE cashrcpt " "SET cashrcpt_cust_id=:cust_id, " " cashrcpt_curr_id=:curr_id, " " cashrcpt_docdate=:docdate " "WHERE (cashrcpt_id=:cashrcpt_id);" ); applyToBal.bindValue(":cust_id", _cust->id()); applyToBal.bindValue(":cashrcpt_id", _cashrcptid); applyToBal.bindValue(":curr_id", _received->id()); applyToBal.bindValue(":docdate", _docDate->date()); applyToBal.exec(); XSqlQuery applyq; applyq.prepare("SELECT applycashreceiptlinebalance(:cashrcpt_id," " :cashrcptitem_aropen_id,:amount,:curr_id) AS result;"); applyq.bindValue(":cashrcpt_id", _cashrcptid); applyq.bindValue(":curr_id", _received->id()); // loop twice - first collect the credits, then apply them to debits // stop when we hit a hard error, then refresh the list to show what happened bool crediterr = false; foreach (XTreeWidgetItem *cursor, _aropen->selectedItems()) { if (cursor->rawValue("doctype").toString() == "C" || cursor->rawValue("doctype").toString() == "R") { double credit = _received->convert(cursor->rawValue("balance_curr").toInt(), _received->id(), cursor->rawValue("balance").toDouble(), _distDate->date()); applyq.bindValue(":amount", credit); applyq.bindValue(":cashrcptitem_aropen_id", cursor->id()); applyq.exec(); if (applyq.first()) { double result = applyq.value("result").toDouble(); if (result < 0) ErrorReporter::error(QtCriticalMsg, this, tr("Error Applying Credits"), tr("Could not apply %1 %2 to Cash Receipt (%3)") .arg(cursor->text("doctype"), cursor->text("aropen_docnumber")).arg(result), __FILE__, __LINE__); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Applying Credits"), applyq, __FILE__, __LINE__)) { crediterr = true; break; } } } if (! crediterr) { foreach (XTreeWidgetItem *cursor, _aropen->selectedItems()) { if (cursor->rawValue("doctype").toString() == "I" || cursor->rawValue("doctype").toString() == "D") { applyq.bindValue(":amount", _received->localValue()); applyq.bindValue(":cashrcptitem_aropen_id", cursor->id()); applyq.exec(); if (applyq.first()) { double result = applyq.value("result").toDouble(); if (result < 0) ErrorReporter::error(QtCriticalMsg, this, tr("Error Applying Debits"), tr("Could not apply %1 %2 to Cash Receipt (%3)") .arg(cursor->text("doctype"), cursor->text("aropen_docnumber")).arg(result), __FILE__, __LINE__); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Applying Debits"), applyq, __FILE__, __LINE__)) break; } } } sFillApplyList(); } void cashReceipt::sClear() { XSqlQuery cashClear; QList list = _aropen->selectedItems(); XTreeWidgetItem *cursor = 0; for(int i = 0; i < list.size(); i++) { cursor = (XTreeWidgetItem*)list.at(i); cashClear.prepare( "DELETE FROM cashrcptitem " " WHERE ((cashrcptitem_aropen_id=:aropen_id) " " AND (cashrcptitem_cashrcpt_id=:cashrcpt_id));" ); cashClear.bindValue(":cashrcpt_id", _cashrcptid); cashClear.bindValue(":aropen_id", cursor->id()); cashClear.exec(); if (cashClear.lastError().type() != QSqlError::NoError) { systemError(this, cashClear.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillApplyList(); sUpdateBalance(); } void cashReceipt::sAdd() { if(_mode == cNew) if(!save(true)) return; ParameterList params; params.append("mode", "new"); params.append("cashrcpt_id", _cashrcptid); params.append("curr_id", _received->id()); params.append("effective", _received->effective()); cashReceiptMiscDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillMiscList(); } void cashReceipt::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("cashrcptmisc_id", _cashrcptmisc->id()); params.append("curr_id", _received->id()); params.append("effective", _received->effective()); cashReceiptMiscDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillMiscList(); } void cashReceipt::sDelete() { XSqlQuery cashDelete; cashDelete.prepare( "DELETE FROM cashrcptmisc " "WHERE (cashrcptmisc_id=:cashrcptmisc_id);" ); cashDelete.bindValue(":cashrcptmisc_id", _cashrcptmisc->id()); cashDelete.exec(); if (cashDelete.lastError().type() != QSqlError::NoError) { systemError(this, cashDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillMiscList(); } void cashReceipt::close() { XSqlQuery cashclose; if (_transType == cNew && _cashrcptid >= 0) { cashclose.prepare("SELECT deleteCashRcpt(:cashrcpt_id) AS result;"); cashclose.bindValue(":cashrcpt_id", _cashrcptid); cashclose.exec(); if (cashclose.first()) { int result = cashclose.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteCashRcpt", result)); return; } } else if (cashclose.lastError().type() != QSqlError::NoError) { systemError(this, cashclose.lastError().databaseText(), __FILE__, __LINE__); return; } cashclose.prepare("SELECT releaseCashRcptNumber(:number);"); cashclose.bindValue(":number", _number->text().toInt()); cashclose.exec(); if (cashclose.lastError().type() != QSqlError::NoError) { systemError(this, cashclose.lastError().databaseText(), __FILE__, __LINE__); return; } } XWidget::close(); } void cashReceipt::sSave() { if (save(false)) { omfgThis->sCashReceiptsUpdated(_cashrcptid, TRUE); _cashrcptid = -1; close(); } } bool cashReceipt::save(bool partial) { XSqlQuery cashave; if (_overapplied && QMessageBox::question(this, tr("Overapplied?"), tr("This Cash Receipt appears to apply too much to" " at least one of the Open Items. Do you want " "to save the current applications anyway?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return FALSE; int _bankaccnt_curr_id = -1; QString _bankaccnt_currAbbr; cashave.prepare( "SELECT bankaccnt_curr_id, " " currConcat(bankaccnt_curr_id) AS currAbbr " " FROM bankaccnt " " WHERE (bankaccnt_id=:bankaccnt_id);"); cashave.bindValue(":bankaccnt_id", _bankaccnt->id()); cashave.exec(); if (cashave.first()) { _bankaccnt_curr_id = cashave.value("bankaccnt_curr_id").toInt(); _bankaccnt_currAbbr = cashave.value("currAbbr").toString(); } else if (cashave.lastError().type() != QSqlError::NoError) { systemError(this, cashave.lastError().databaseText(), __FILE__, __LINE__); return FALSE; } if (_received->currencyEnabled() && _received->id() != _bankaccnt_curr_id && QMessageBox::question(this, tr("Cash Receipt Transaction Not In Bank Currency"), tr("

This transaction is specified in %1 while the " "Bank Account is specified in %2. Do you wish to " "convert at the current Exchange Rate?" "

If not, click NO " "and change the Bank Account in the POST TO field.") .arg(_received->currAbbr()) .arg(_bankaccnt_currAbbr), QMessageBox::Yes|QMessageBox::Escape, QMessageBox::No |QMessageBox::Default) != QMessageBox::Yes) { _received->setFocus(); return FALSE; } _received->setCurrencyDisabled(true); if (!partial) { if (!_ccEdit && (_fundsType->code() == "A" || _fundsType->code() == "D" || _fundsType->code() == "M" || _fundsType->code() == "V")) { if (_cc->id() <= -1) { QMessageBox::warning(this, tr("Select a Credit Card"), tr("Please select a Credit Card from the list " "before continuing.")); _tab->setCurrentIndex(_tab->indexOf(_creditCardTab)); _cc->setFocus(); return FALSE; } CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (! cardproc) { QMessageBox::critical(this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); return FALSE; } _save->setEnabled(false); int ccpayid = -1; QString neworder = _docNumber->text().isEmpty() ? QString::number(_cashrcptid) : _docNumber->text(); QString reforder = neworder; // 2 sep variables because they're passed by ref int returnVal = cardproc->charge(_cc->id(), _CCCVV->text(), _received->localValue(), 0, false, 0, 0, _received->id(), neworder, reforder, ccpayid, QString("cashrcpt"), _cashrcptid); if (returnVal < 0) QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); else if (returnVal > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (! cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); _save->setEnabled(true); if (returnVal < 0) return FALSE; } } if (!_distDate->isValid()) _distDate->setDate(omfgThis->dbDate()); if (_mode == cNew) cashave.prepare( "INSERT INTO cashrcpt " "( cashrcpt_id, cashrcpt_cust_id, cashrcpt_distdate, cashrcpt_amount," " cashrcpt_fundstype, cashrcpt_bankaccnt_id, cashrcpt_curr_id, " " cashrcpt_usecustdeposit, cashrcpt_docnumber, cashrcpt_docdate, " " cashrcpt_notes, cashrcpt_salescat_id, cashrcpt_number, cashrcpt_applydate, cashrcpt_discount ) " "VALUES " "( :cashrcpt_id, :cashrcpt_cust_id, :cashrcpt_distdate, :cashrcpt_amount," " :cashrcpt_fundstype, :cashrcpt_bankaccnt_id, :curr_id, " " :cashrcpt_usecustdeposit, :cashrcpt_docnumber, :cashrcpt_docdate, " " :cashrcpt_notes, :cashrcpt_salescat_id, :cashrcpt_number, :cashrcpt_applydate, :cashrcpt_discount );" ); else cashave.prepare( "UPDATE cashrcpt " "SET cashrcpt_cust_id=:cashrcpt_cust_id," " cashrcpt_amount=:cashrcpt_amount," " cashrcpt_fundstype=:cashrcpt_fundstype," " cashrcpt_docnumber=:cashrcpt_docnumber," " cashrcpt_docdate=:cashrcpt_docdate," " cashrcpt_bankaccnt_id=:cashrcpt_bankaccnt_id," " cashrcpt_distdate=:cashrcpt_distdate," " cashrcpt_notes=:cashrcpt_notes, " " cashrcpt_salescat_id=:cashrcpt_salescat_id, " " cashrcpt_curr_id=:curr_id," " cashrcpt_usecustdeposit=:cashrcpt_usecustdeposit," " cashrcpt_applydate=:cashrcpt_applydate," " cashrcpt_discount=:cashrcpt_discount, " " cashrcpt_curr_rate=null " // force a curr rate re-evaluation "WHERE (cashrcpt_id=:cashrcpt_id);" ); cashave.bindValue(":cashrcpt_id", _cashrcptid); cashave.bindValue(":cashrcpt_number", _number->text()); cashave.bindValue(":cashrcpt_cust_id", _cust->id()); cashave.bindValue(":cashrcpt_amount", _received->localValue()); cashave.bindValue(":cashrcpt_fundstype", _fundsType->code()); cashave.bindValue(":cashrcpt_docnumber", _docNumber->text()); cashave.bindValue(":cashrcpt_docdate", _docDate->date()); cashave.bindValue(":cashrcpt_bankaccnt_id", _bankaccnt->id()); cashave.bindValue(":cashrcpt_distdate", _distDate->date()); cashave.bindValue(":cashrcpt_applydate", _applDate->date()); cashave.bindValue(":cashrcpt_notes", _notes->toPlainText().trimmed()); cashave.bindValue(":cashrcpt_usecustdeposit", QVariant(_balCustomerDeposit->isChecked())); cashave.bindValue(":cashrcpt_discount", _discount->localValue()); cashave.bindValue(":curr_id", _received->id()); if(_altAccnt->isChecked()) cashave.bindValue(":cashrcpt_salescat_id", _salescat->id()); else cashave.bindValue(":cashrcpt_salescat_id", -1); cashave.exec(); if (cashave.lastError().type() != QSqlError::NoError) { systemError(this, cashave.lastError().databaseText(), __FILE__, __LINE__); return FALSE; } _mode=cEdit; return TRUE; } void cashReceipt::sPopulateCustomerInfo(int) { if (_mode == cNew) { XSqlQuery cust; cust.prepare("SELECT cust_curr_id FROM custinfo WHERE cust_id = :cust_id;"); cust.bindValue(":cust_id", _cust->id()); cust.exec(); if (cust.first()) _received->setId(cust.value("cust_curr_id").toInt()); else if (cust.lastError().type() != QSqlError::NoError) { systemError(this, cust.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillApplyList(); } void cashReceipt::sFillApplyList() { if (_cust->isValid()) { _cust->setReadOnly(TRUE); _aropen->clear(); MetaSQLQuery mql = mqlLoad("arOpenApplications", "detail"); ParameterList params; params.append("cashrcpt_id", _cashrcptid); params.append("cust_id", _cust->id()); params.append("debitMemo", tr("Debit Memo")); params.append("invoice", tr("Invoice")); params.append("creditMemo", tr("Credit Memo")); params.append("cashdeposit", tr("Customer Deposit")); if (_posted) params.append("posted", true); else if (!_credits->isChecked()) params.append("noCredits"); XSqlQuery apply; apply = mql.toQuery(params); _aropen->populate(apply, true); if (apply.lastError().type() != QSqlError::NoError) { systemError(this, apply.lastError().databaseText(), __FILE__, __LINE__); return; } _overapplied = false; XTreeWidgetItem *last; for (int i = 0; i < _aropen->topLevelItemCount(); i++) { last = _aropen->topLevelItem(i); if (last->data(9, Qt::UserRole).toMap().value("raw").toDouble() > last->data(5, Qt::UserRole).toMap().value("raw").toDouble()) { _overapplied = true; break; } } apply.prepare( "SELECT SUM(COALESCE(cashrcptitem_amount, 0)) AS total " "FROM cashrcptitem " "WHERE (cashrcptitem_cashrcpt_id=:cashrcpt_id);" ); apply.bindValue(":cashrcpt_id", _cashrcptid); apply.exec(); if (apply.first()) _applied->setLocalValue(apply.value("total").toDouble()); else if (apply.lastError().type() != QSqlError::NoError) { systemError(this, apply.lastError().databaseText(), __FILE__, __LINE__); return; } apply.prepare("select max(aropen_docdate) AS mindate FROM aropen, cashrcptitem WHERE cashrcptitem_aropen_id=aropen_id AND cashrcptitem_cashrcpt_id=:id;"); apply.bindValue(":id", _cashrcptid); apply.exec(); if(apply.first()) { _mindate = apply.value("mindate").toDate(); if(_mindate > _applDate->date()) _applDate->setDate(_mindate); } XSqlQuery discount ; discount.prepare( "SELECT SUM(COALESCE(cashrcptitem_discount, 0.00)) AS disc " "FROM cashrcptitem " "WHERE (cashrcptitem_cashrcpt_id=:cashrcpt_id);" ); discount.bindValue(":cashrcpt_id", _cashrcptid); discount.exec(); if (discount.first()) { _discount->setLocalValue(discount.value("disc").toDouble()); sUpdateBalance(); } else if (discount.lastError().type() != QSqlError::NoError) { systemError(this, discount.lastError().databaseText(), __FILE__, __LINE__); return; } } _received->setCurrencyEditable(_applied->isZero() && _miscDistribs->isZero()); } void cashReceipt::sFillMiscList() { XSqlQuery cashFillMiscList; XSqlQuery misc; misc.prepare("SELECT cashrcptmisc_id," " formatGLAccount(cashrcptmisc_accnt_id) AS account," " firstLine(cashrcptmisc_notes) AS firstline, " " cashrcptmisc_amount," " 'curr' AS cashrcptmisc_amount_xtnumericrole " "FROM cashrcptmisc " "WHERE (cashrcptmisc_cashrcpt_id=:cashrcpt_id);" ); misc.bindValue(":cashrcpt_id", _cashrcptid); misc.exec(); _cashrcptmisc->populate(misc); if (misc.lastError().type() != QSqlError::NoError) { systemError(this, cashFillMiscList.lastError().databaseText(), __FILE__, __LINE__); return; } misc.prepare( "SELECT SUM(cashrcptmisc_amount) AS total " "FROM cashrcptmisc " "WHERE (cashrcptmisc_cashrcpt_id=:cashrcpt_id);" ); misc.bindValue(":cashrcpt_id", _cashrcptid); misc.exec(); if (misc.first()) _miscDistribs->setLocalValue(misc.value("total").toDouble()); else if (misc.lastError().type() != QSqlError::NoError) { systemError(this, cashFillMiscList.lastError().databaseText(), __FILE__, __LINE__); return; } else _miscDistribs->clear(); _received->setCurrencyEditable(_applied->isZero() && _miscDistribs->isZero()); } void cashReceipt::sUpdateBalance() { _balance->setLocalValue(_received->localValue() - _applied->localValue() - _miscDistribs->localValue()); if (!_balance->isZero()) _balance->setPaletteForegroundColor(QColor("red")); else _balance->setPaletteForegroundColor(QColor("black")); } void cashReceipt::populate() { XSqlQuery cashpopulate; cashpopulate.prepare( "SELECT *," " COALESCE(cashrcpt_applydate, cashrcpt_distdate) AS applydate " "FROM cashrcpt " "WHERE (cashrcpt_id=:cashrcpt_id);" ); cashpopulate.bindValue(":cashrcpt_id", _cashrcptid); cashpopulate.exec(); if (cashpopulate.first()) { _cust->setId(cashpopulate.value("cashrcpt_cust_id").toInt()); _number->setText(cashpopulate.value("cashrcpt_number").toString()); _received->set(cashpopulate.value("cashrcpt_amount").toDouble(), cashpopulate.value("cashrcpt_curr_id").toInt(), cashpopulate.value("cashrcpt_distdate").toDate(), false); _docNumber->setText(cashpopulate.value("cashrcpt_docnumber").toString()); _docDate->setDate(cashpopulate.value("cashrcpt_docdate").toDate(), true); _bankaccnt->setId(cashpopulate.value("cashrcpt_bankaccnt_id").toInt()); _received->setCurrencyDisabled(true); _applDate->setDate(cashpopulate.value("applydate").toDate(), true); _distDate->setDate(cashpopulate.value("cashrcpt_distdate").toDate(), true); _notes->setText(cashpopulate.value("cashrcpt_notes").toString()); _posted = cashpopulate.value("cashrcpt_posted").toBool(); if(cashpopulate.value("cashrcpt_salescat_id").toInt() != -1) { _altAccnt->setChecked(TRUE); _salescat->setId(cashpopulate.value("cashrcpt_salescat_id").toInt()); } if(cashpopulate.value("cashrcpt_usecustdeposit").toBool()) _balCustomerDeposit->setChecked(true); else _balCreditMemo->setChecked(true); _origFunds = cashpopulate.value("cashrcpt_fundstype").toString(); _fundsType->setCode(_origFunds); _cust->setId(cashpopulate.value("cashrcpt_cust_id").toInt()); sFillApplyList(); sFillMiscList(); setCreditCard(); } else if (cashpopulate.lastError().type() != QSqlError::NoError) { systemError(this, cashpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void cashReceipt::sSearchDocNumChanged() { QString sub = _searchDocNum->text().trimmed(); if(sub.isEmpty()) return; QList list = _aropen->findItems(sub, Qt::MatchFixedString|Qt::MatchCaseSensitive, 1); if(list.isEmpty()) list = _aropen->findItems(sub, Qt::MatchFixedString|Qt::MatchStartsWith|Qt::MatchCaseSensitive, 1); if(!list.isEmpty()) { _aropen->setCurrentItem(list.at(0)); _aropen->scrollTo(_aropen->currentIndex()); } } void cashReceipt::sChangeCurrency( int newId) { if (_received->isEnabled()) { XSqlQuery id; id.prepare( "UPDATE cashrcpt " "SET cashrcpt_curr_id=:curr_id, " " cashrcpt_curr_rate=null " "WHERE (cashrcpt_id=:cashrcpt_id);" ); id.bindValue(":cashrcpt_id", _cashrcptid); id.bindValue(":curr_id", newId); id.exec(); if (id.lastError().type() != QSqlError::NoError) systemError(this, id.lastError().databaseText(), __FILE__, __LINE__); } } void cashReceipt::setCreditCard() { XSqlQuery cashetCreditCard; if (! _metrics->boolean("CCAccept")) return; if (! _fundsTypes[_fundsType->id()].cc) return; XSqlQuery bankq; bankq.prepare("SELECT ccbank_bankaccnt_id" " FROM ccbank" " WHERE (ccbank_ccard_type=:cardtype);"); bankq.bindValue(":cardtype", _fundsType->code()); bankq.exec(); if (bankq.first()) _bankaccnt->setId(bankq.value("ccbank_bankaccnt_id").toInt()); else if (bankq.lastError().type() != QSqlError::NoError) { systemError(this, bankq.lastError().text(), __FILE__, __LINE__); return; } else { QMessageBox::warning(this, tr("No Bank Account"), tr("

Cannot find the Bank Account to post this " "transaction against. Either this card type is not " "accepted or the Credit Card configuration is not " "complete.")); return; } cashetCreditCard.prepare( "SELECT expireCreditCard(:cust_id, setbytea(:key)) AS result;"); cashetCreditCard.bindValue(":cust_id", _cust->id()); cashetCreditCard.bindValue(":key", omfgThis->_key); cashetCreditCard.exec(); if (cashetCreditCard.first()) { int result = cashetCreditCard.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("expireCreditCard", result), __FILE__, __LINE__); return; } } else if (cashetCreditCard.lastError().type() != QSqlError::NoError) { systemError(this, cashetCreditCard.lastError().databaseText(), __FILE__, __LINE__); return; } MetaSQLQuery mql = mqlLoad("creditCards", "detail"); ParameterList params; params.append("cust_id", _cust->id()); params.append("ccard_type", _fundsType->code()); params.append("masterCard", tr("MasterCard")); params.append("visa", tr("VISA")); params.append("americanExpress", tr("American Express")); params.append("discover", tr("Discover")); params.append("other", tr("Other")); params.append("key", omfgThis->_key); params.append("activeonly", true); cashetCreditCard = mql.toQuery(params); _cc->populate(cashetCreditCard); if (cashetCreditCard.lastError().type() != QSqlError::NoError) { systemError(this, cashetCreditCard.lastError().databaseText(), __FILE__, __LINE__); return; } if (_cc->topLevelItemCount() == 1) _cc->setCurrentItem(_cc->topLevelItem(0)); } void cashReceipt::sNewCreditCard() { ParameterList params; params.append("mode", "new"); params.append("cust_id", _cust->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) setCreditCard(); } void cashReceipt::sEditCreditCard() { ParameterList params; params.append("mode", "edit"); params.append("cust_id", _cust->id()); params.append("ccard_id", _cc->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) setCreditCard(); } void cashReceipt::sViewCreditCard() { ParameterList params; params.append("mode", "view"); params.append("cust_id", _cust->id()); params.append("ccard_id", _cc->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void cashReceipt::sMoveUp() { XSqlQuery cashMoveUp; cashMoveUp.prepare("SELECT moveCcardUp(:ccard_id) AS result;"); cashMoveUp.bindValue(":ccard_id", _cc->id()); cashMoveUp.exec(); setCreditCard(); } void cashReceipt::sMoveDown() { XSqlQuery cashMoveDown; cashMoveDown.prepare("SELECT moveCcardDown(:ccard_id) AS result;"); cashMoveDown.bindValue(":ccard_id", _cc->id()); cashMoveDown.exec(); setCreditCard(); } void cashReceipt::sDateChanged() { if(_applDate->date() < _mindate) _applDate->setDate(_mindate); if(_distDate->date() > _applDate->date()) _distDate->setDate(_applDate->date()); else if(_distDate->date() < _applDate->date()) _applyBalLit->setText(tr("Record Receipt as:")); else _applyBalLit->setText(tr("Apply Balance As:")); } qt-client-4.1.0/guiclient/cashReceipt.h000066400000000000000000000036061217451700100200050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CASHRECEIPT_H #define CASHRECEIPT_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_cashReceipt.h" class cashReceipt : public XWidget, public Ui::cashReceipt { Q_OBJECT public: cashReceipt(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~cashReceipt(); virtual bool save( bool partial ); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void close(); virtual void populate(); virtual void sAdd(); virtual void sApply(); virtual void sApplyLineBalance(); virtual void sApplyToBalance(); virtual void sChangeCurrency( int newId ); virtual void sClear(); virtual void sDelete(); virtual void sEdit(); virtual void sEditCreditCard(); virtual void sFillApplyList(); virtual void sFillMiscList(); virtual void sMoveDown(); virtual void sMoveUp(); virtual void sNewCreditCard(); virtual void sPopulateCustomerInfo( int ); virtual void sSave(); virtual void sUpdateBalance(); virtual void sViewCreditCard(); virtual void setCreditCard(); virtual void sDateChanged(); protected slots: virtual void languageChange(); virtual void sSearchDocNumChanged(); private: int _mode; int _transType; int _cashrcptid; bool _ccEdit; QString _origFunds; bool _overapplied; bool _posted; QDate _mindate; }; #endif // CASHRECEIPT_H qt-client-4.1.0/guiclient/cashReceipt.ui000066400000000000000000001164551217451700100202020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. cashReceipt 0 0 600 400 Cash Receipt 12 0 0 Qt::StrongFocus 3 Number: 100 0 Qt::Vertical 20 40 Qt::Horizontal QSizePolicy::Expanding 0 20 false &Save &Cancel Qt::Vertical QSizePolicy::Expanding 81 16 Amount Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true 0 0 Amount Applied: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::NoFocus 0 0 Misc. Distributions: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::NoFocus Discount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::NoFocus 0 0 Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Apply Balance As: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 12 Credit Memo true Customer Deposit Qt::Vertical 20 13 Qt::Horizontal 13 20 Funds Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Check/Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docNumber Qt::AlignLeading Post to: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _distDate 0 Qt::Horizontal QSizePolicy::Expanding 25 16 Application Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _applDate 0 Qt::Horizontal QSizePolicy::Expanding 25 16 0 Qt::Horizontal QSizePolicy::Expanding 25 16 Check/Document Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docNumber true Qt::TabFocus Use Alternate A/R Account true false Sales Category: 0 0 Qt::Horizontal 40 20 0 1 0 Applications Find Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Include Credits Qt::Horizontal QSizePolicy::Expanding 0 24 1 0 0 100 QAbstractItemView::ExtendedSelection false &Apply false Apply &Line Bal. false Clear Qt::Vertical QSizePolicy::Fixed 20 5 false Apply to &Balance Qt::Vertical QSizePolicy::MinimumExpanding 13 0 Misc. Distributions 0 0 0 0 false Add false &Edit false &Delete Qt::Vertical 20 40 Credit Card false New false Edit false View false Move Up false Move Down 0 CVV Code 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 Notes 0 0 true CurrCluster CurrDisplay

currcluster.h
CurrDisplay QWidget
currcluster.h
CustCluster QWidget
custcluster.h
DLineEdit QWidget
datecluster.h
1
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
XTextEdit QTextEdit
xtextedit.h
_cust _received _balCreditMemo _balCustomerDeposit _fundsType _docNumber _docDate _bankaccnt _distDate _applDate _altAccnt _salescat _tab _searchDocNum _credits _aropen _apply _applyLineBalance _clear _applyToBalance _cashrcptmisc _add _edit _delete _cc _newCC _editCC _viewCC _upCC _downCC _CCCVV _notes _close _save _cust valid(bool) _save setEnabled(bool) 20 20 753 64 _aropen valid(bool) _apply setEnabled(bool) 32 364 706 368 _aropen valid(bool) _clear setEnabled(bool) 32 364 706 386 _aropen itemSelected(int) _apply animateClick() 32 364 706 368 _cust valid(bool) _applyToBalance setEnabled(bool) 20 20 705 396 _cust valid(bool) _add setEnabled(bool) 20 20 733 476 _received idChanged(int) _miscDistribs setId(int) 195 105 195 152 _received idChanged(int) _applied setId(int) 195 105 195 179 _received idChanged(int) _discount setId(int) 195 105 195 206 _received effectiveChanged(QDate) _miscDistribs setEffective(QDate) 195 105 195 152 _received effectiveChanged(QDate) _applied setEffective(QDate) 195 105 195 179 _received effectiveChanged(QDate) _discount setEffective(QDate) 195 105 195 206 _cust valid(bool) _newCC setEnabled(bool) 20 20 31 285 _cc valid(bool) _editCC setEnabled(bool) 31 285 31 285 _cc valid(bool) _viewCC setEnabled(bool) 31 285 31 285 _cc valid(bool) _downCC setEnabled(bool) 31 285 31 285 _cc valid(bool) _upCC setEnabled(bool) 31 285 31 285 _distDate newDate(QDate) _received setEffective(QDate) 551 190 195 105 _aropen valid(bool) _applyLineBalance setEnabled(bool) 364 463 794 385 _cashrcptmisc valid(bool) _edit setEnabled(bool) 31 285 31 285 _cashrcptmisc valid(bool) _delete setEnabled(bool) 31 285 31 285 qt-client-4.1.0/guiclient/cashReceiptItem.cpp000066400000000000000000000206241217451700100211560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "cashReceiptItem.h" #include "applyARDiscount.h" #include #include #include /* * Constructs a cashReceiptItem as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ cashReceiptItem::cashReceiptItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_discount, SIGNAL(clicked()), this, SLOT(sDiscount())); _cust->setReadOnly(TRUE); adjustSize(); } /* * Destroys the object and frees any allocated resources */ cashReceiptItem::~cashReceiptItem() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void cashReceiptItem::languageChange() { retranslateUi(this); } enum SetResponse cashReceiptItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } } param = pParams.value("curr_id", &valid); if (valid) _openAmount->setId(param.toInt()); param = pParams.value("cashrcpt_id", &valid); if (valid) _cashrcptid = param.toInt(); else _cashrcptid = -1; param = pParams.value("aropen_id", &valid); if (valid) { _aropenid = param.toInt(); populate(); } else _aropenid = -1; param = pParams.value("cashrcptitem_id", &valid); if (valid) { _cashrcptitemid = param.toInt(); populate(); } else _cashrcptitemid = -1; param = pParams.value("amount_to_apply", &valid); if (valid) { _amttoapply = param.toDouble(); populate(); } return NoError; } void cashReceiptItem::sSave() { if (_amountToApply->localValue() > _openAmount->localValue()) { QMessageBox::warning( this, tr("Cannot Apply"), tr("You may not apply more than the balance of this item.") ); _amountToApply->setFocus(); return; } int sense = 1; if (_docType->text() == "C" || _docType->text() == "R") sense = -1; if (_mode == cNew) { XSqlQuery cashrcptitemid("SELECT NEXTVAL('cashrcptitem_cashrcptitem_id_seq') AS _cashrcptitem_id;"); if (cashrcptitemid.first()) _cashrcptitemid = cashrcptitemid.value("_cashrcptitem_id").toInt(); XSqlQuery newReceipt; newReceipt.prepare( "INSERT INTO cashrcptitem " "( cashrcptitem_id, cashrcptitem_cashrcpt_id," " cashrcptitem_aropen_id, cashrcptitem_amount, cashrcptitem_discount ) " "VALUES " "( :cashrcptitem_id, :cashrcptitem_cashrcpt_id," " :cashrcptitem_aropen_id, :cashrcptitem_amount, :cashrcptitem_discount );" ); newReceipt.bindValue(":cashrcptitem_id", _cashrcptitemid); newReceipt.bindValue(":cashrcptitem_cashrcpt_id", _cashrcptid); newReceipt.bindValue(":cashrcptitem_aropen_id", _aropenid); newReceipt.bindValue(":cashrcptitem_amount", _amountToApply->localValue() * sense); newReceipt.bindValue(":cashrcptitem_discount", _discountAmount->localValue() * sense); newReceipt.exec(); } else if (_mode == cEdit) { XSqlQuery updateReceipt; updateReceipt.prepare( "UPDATE cashrcptitem " "SET cashrcptitem_amount=:cashrcptitem_amount, " "cashrcptitem_discount=:cashrcptitem_discount " "WHERE (cashrcptitem_id=:cashrcptitem_id);" ); updateReceipt.bindValue(":cashrcptitem_id", _cashrcptitemid); updateReceipt.bindValue(":cashrcptitem_amount", _amountToApply->localValue() * sense); updateReceipt.bindValue(":cashrcptitem_discount", _discountAmount->localValue() * sense); updateReceipt.exec(); } done(_cashrcptitemid); } void cashReceiptItem::populate() { XSqlQuery query; if (_mode == cNew) { query.prepare( "SELECT aropen_cust_id, aropen_docnumber, aropen_doctype, " " aropen_docdate, aropen_duedate, " " cashrcpt_curr_id, cashrcpt_distdate, " " currToCurr(aropen_curr_id, cashrcpt_curr_id, (aropen_amount - aropen_paid), " " cashrcpt_distdate) AS f_amount, " " COALESCE(ABS(cashrcptitem_discount), 0.00) AS discount " "FROM cashrcpt, aropen LEFT OUTER JOIN cashrcptitem ON (aropen_id=cashrcptitem_aropen_id) " "WHERE ( (aropen_id=:aropen_id)" " AND (cashrcpt_id=:cashrcpt_id))" ); query.bindValue(":aropen_id", _aropenid); query.bindValue(":cashrcpt_id", _cashrcptid); query.exec(); if (query.first()) { _cust->setId(query.value("aropen_cust_id").toInt()); _docNumber->setText(query.value("aropen_docnumber").toString()); _docType->setText(query.value("aropen_doctype").toString()); _docDate->setDate(query.value("aropen_docdate").toDate(), true); _dueDate->setDate(query.value("aropen_duedate").toDate()); _discountAmount->setLocalValue(query.value("discount").toDouble()); _openAmount->set(query.value("f_amount").toDouble(), query.value("cashrcpt_curr_id").toInt(), query.value("cashrcpt_distdate").toDate(), false); _discount->setEnabled(query.value("aropen_doctype").toString() == "I" || query.value("aropen_doctype").toString() == "D"); } } else if (_mode == cEdit) { query.prepare( "SELECT aropen_cust_id, aropen_docnumber, aropen_doctype, " " aropen_docdate, aropen_duedate, " " currToCurr(aropen_curr_id, cashrcpt_curr_id, (aropen_amount - aropen_paid), " " cashrcpt_distdate) AS balance, " " ABS(cashrcptitem_amount) AS cashrcptitem_amount, " " cashrcpt_curr_id, cashrcpt_distdate, " " ABS(cashrcptitem_discount) AS discount " "FROM cashrcptitem, cashrcpt, aropen " "WHERE ( (cashrcptitem_cashrcpt_id=cashrcpt_id)" " AND (cashrcptitem_aropen_id=aropen_id)" " AND (cashrcptitem_id=:cashrcptitem_id) );" ); query.bindValue(":cashrcptitem_id", _cashrcptitemid); query.exec(); if (query.first()) { _cust->setId(query.value("aropen_cust_id").toInt()); _docNumber->setText(query.value("aropen_docnumber").toString()); _docType->setText(query.value("aropen_doctype").toString()); _docDate->setDate(query.value("aropen_docdate").toDate(), true); _dueDate->setDate(query.value("aropen_duedate").toDate()); _openAmount->set(query.value("balance").toDouble(), query.value("cashrcpt_curr_id").toInt(), query.value("cashrcpt_distdate").toDate(), false); _amountToApply->setLocalValue(query.value("cashrcptitem_amount").toDouble()); _discountAmount->setLocalValue(query.value("discount").toDouble()); _discount->setEnabled(query.value("aropen_doctype").toString() == "I" || query.value("aropen_doctype").toString() == "D"); } // ToDo } } void cashReceiptItem::sDiscount() { ParameterList params; params.append("aropen_id", _aropenid); params.append("curr_id", _openAmount->id()); if(_discountAmount->localValue() != 0.0) params.append("amount", _discountAmount->localValue()); applyARDiscount newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() != XDialog::Rejected) { _discountAmount->setLocalValue(newdlg._amount->localValue()); _amountToApply->setLocalValue(_openAmount->localValue() - _discountAmount->localValue()); } } qt-client-4.1.0/guiclient/cashReceiptItem.h000066400000000000000000000022331217451700100206170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CASHRECEIPTITEM_H #define CASHRECEIPTITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_cashReceiptItem.h" class cashReceiptItem : public XDialog, public Ui::cashReceiptItem { Q_OBJECT public: cashReceiptItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~cashReceiptItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); virtual void sDiscount(); protected slots: virtual void languageChange(); private: int _cashrcptid; int _cashrcptitemid; int _aropenid; int _mode; double _amttoapply; }; #endif // CASHRECEIPTITEM_H qt-client-4.1.0/guiclient/cashReceiptItem.ui000066400000000000000000000266741217451700100210240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. cashReceiptItem 0 0 502 337 Cash Receipt Application Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Doc. Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 7 100 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 5 Doc. Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 0 0 Doc. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 16 0 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 32767 Qt::Horizontal 0 20 Discount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 13 18 Open Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Amount to Apply: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false true Qt::Horizontal 0 20 Edit Discount CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
CustCluster QWidget
custcluster.h
DLineEdit QWidget
datecluster.h
1
_cust _docDate _dueDate _openAmount _amountToApply parameter.h _openAmount idChanged(int) _amountToApply setId(int) 20 20 20 20 _openAmount effectiveChanged(QDate) _amountToApply setEffective(QDate) 20 20 20 20
qt-client-4.1.0/guiclient/cashReceiptMiscDistrib.cpp000066400000000000000000000111011217451700100224620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "cashReceiptMiscDistrib.h" #include #include #include cashReceiptMiscDistrib::cashReceiptMiscDistrib(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); _account->setType(GLCluster::cRevenue | GLCluster::cExpense | GLCluster::cAsset | GLCluster::cLiability); adjustSize(); } cashReceiptMiscDistrib::~cashReceiptMiscDistrib() { // no need to delete child widgets, Qt does it all for us } void cashReceiptMiscDistrib::languageChange() { retranslateUi(this); } enum SetResponse cashReceiptMiscDistrib::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cashrcpt_id", &valid); if (valid) _cashrcptid = param.toInt(); param = pParams.value("curr_id", &valid); if (valid) _amount->setId(param.toInt()); param = pParams.value("effective", &valid); if (valid) _amount->setEffective(param.toDate()); param = pParams.value("cashrcptmisc_id", &valid); if (valid) { _cashrcptmiscid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; } } return NoError; } void cashReceiptMiscDistrib::populate() { XSqlQuery cashpopulate; cashpopulate.prepare( "SELECT cashrcptmisc_accnt_id, cashrcptmisc_notes," " cashrcptmisc_amount, cashrcpt_curr_id, cashrcpt_distdate " "FROM cashrcptmisc JOIN cashrcpt ON (cashrcptmisc_cashrcpt_id = cashrcpt_id) " "WHERE (cashrcptmisc_id=:cashrcptmisc_id);" ); cashpopulate.bindValue(":cashrcptmisc_id", _cashrcptmiscid); cashpopulate.exec(); if (cashpopulate.first()) { _account->setId(cashpopulate.value("cashrcptmisc_accnt_id").toInt()); _amount->set(cashpopulate.value("cashrcptmisc_amount").toDouble(), cashpopulate.value("cashrcpt_curr_id").toInt(), cashpopulate.value("cashrcpt_distdate").toDate(), false); _notes->setText(cashpopulate.value("cashrcptmisc_notes").toString()); } } void cashReceiptMiscDistrib::sSave() { XSqlQuery cashSave; if (!_account->isValid()) { QMessageBox::warning( this, tr("Select Account"), tr("You must select an Account to post this Miscellaneous Distribution to.") ); _account->setFocus(); return; } if (_amount->isZero()) { QMessageBox::warning( this, tr("Enter Amount"), tr("You must enter an amount for this Miscellaneous Distribution.") ); _amount->setFocus(); return; } if (_mode == cNew) { cashSave.exec("SELECT NEXTVAL('cashrcptmisc_cashrcptmisc_id_seq') AS _cashrcptmisc_id;"); if (cashSave.first()) _cashrcptmiscid = cashSave.value("_cashrcptmisc_id").toInt(); // ToDo cashSave.prepare( "INSERT INTO cashrcptmisc " "( cashrcptmisc_id, cashrcptmisc_cashrcpt_id," " cashrcptmisc_accnt_id, cashrcptmisc_amount," " cashrcptmisc_notes ) " "VALUES " "( :cashrcptmisc_id, :cashrcptmisc_cashrcpt_id," " :cashrcptmisc_accnt_id, :cashrcptmisc_amount," " :cashrcptmisc_notes );" ); } else if (_mode == cEdit) cashSave.prepare( "UPDATE cashrcptmisc " "SET cashrcptmisc_accnt_id=:cashrcptmisc_accnt_id," " cashrcptmisc_amount=:cashrcptmisc_amount, cashrcptmisc_notes=:cashrcptmisc_notes " "WHERE (cashrcptmisc_id=:cashrcptmisc_id);" ); cashSave.bindValue(":cashrcptmisc_id", _cashrcptmiscid); cashSave.bindValue(":cashrcptmisc_cashrcpt_id", _cashrcptid); cashSave.bindValue(":cashrcptmisc_accnt_id", _account->id()); cashSave.bindValue(":cashrcptmisc_amount", _amount->localValue()); cashSave.bindValue(":cashrcptmisc_notes", _notes->toPlainText().trimmed()); cashSave.exec(); done(_cashrcptmiscid); } qt-client-4.1.0/guiclient/cashReceiptMiscDistrib.h000066400000000000000000000022111217451700100221310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CASHRECEIPTMISCDISTRIB_H #define CASHRECEIPTMISCDISTRIB_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_cashReceiptMiscDistrib.h" class cashReceiptMiscDistrib : public XDialog, public Ui::cashReceiptMiscDistrib { Q_OBJECT public: cashReceiptMiscDistrib(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~cashReceiptMiscDistrib(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _cashrcptmiscid; int _cashrcptid; }; #endif // CASHRECEIPTMISCDISTRIB_H qt-client-4.1.0/guiclient/cashReceiptMiscDistrib.ui000066400000000000000000000103741217451700100223300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. cashReceiptMiscDistrib 0 0 496 308 Miscellaneous Cash Receipt Distribution Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Amount To Distribute: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true false Qt::Horizontal QSizePolicy::Expanding 20 0 0 Notes: Qt::AlignVCenter Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save CurrCluster CurrDisplay
currcluster.h
CurrDisplay QWidget
currcluster.h
GLCluster QWidget
glcluster.h
XTextEdit QTextEdit
xtextedit.h
_account _amount _notes parameter.h
qt-client-4.1.0/guiclient/cashReceiptsEditList.cpp000066400000000000000000000167551217451700100221760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "cashReceiptsEditList.h" #include #include #include #include #include #include "mqlutil.h" #include #include #include "guiclient.h" #include "cashReceipt.h" #include "storedProcErrorLookup.h" cashReceiptsEditList::cashReceiptsEditList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_cashrcpt, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _cashrcpt->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, true, "cashrcpt_number"); _cashrcpt->addColumn(tr("Cust. #"), _bigMoneyColumn, Qt::AlignLeft, true, "cust_number"); _cashrcpt->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name"); _cashrcpt->addColumn(tr("Check/Doc. #"), _orderColumn, Qt::AlignLeft, true, "cashrcpt_docnumber"); _cashrcpt->addColumn(tr("Bank Account"), _orderColumn, Qt::AlignLeft, true, "bankaccnt_name"); _cashrcpt->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter,true, "cashrcpt_distdate"); _cashrcpt->addColumn(tr("Funds Type"), _bigMoneyColumn, Qt::AlignCenter,true, "cashrcpt_fundstype"); _cashrcpt->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight, true, "cashrcpt_amount"); _cashrcpt->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currabbr"); if (omfgThis->singleCurrency()) _cashrcpt->hideColumn("cashrcpt_curr_id"); if (_privileges->check("PostCashReceipts")) connect(_cashrcpt, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); if (_privileges->check("MaintainCashReceipts")) { connect(_cashrcpt, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_cashrcpt, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_cashrcpt, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_cashrcpt, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(omfgThis, SIGNAL(cashReceiptsUpdated(int, bool)), this, SLOT(sFillList())); sFillList(); } cashReceiptsEditList::~cashReceiptsEditList() { // no need to delete child widgets, Qt does it all for us } void cashReceiptsEditList::languageChange() { retranslateUi(this); } void cashReceiptsEditList::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCashReceipts")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainCashReceipts")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostCashReceipts")); } void cashReceiptsEditList::sNew() { ParameterList params; params.append("mode", "new"); cashReceipt *newdlg = new cashReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void cashReceiptsEditList::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("cashrcpt_id", _cashrcpt->id()); cashReceipt *newdlg = new cashReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void cashReceiptsEditList::sView() { ParameterList params; params.append("mode", "view"); params.append("cashrcpt_id", _cashrcpt->id()); cashReceipt *newdlg = new cashReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void cashReceiptsEditList::sDelete() { XSqlQuery cashDelete; cashDelete.prepare( "SELECT deleteCashRcpt(:cashrcpt_id) AS result;"); cashDelete.bindValue(":cashrcpt_id", _cashrcpt->id()); cashDelete.exec(); if (cashDelete.first()) { int result = cashDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteCashRcpt", result)); return; } } else if (cashDelete.lastError().type() != QSqlError::NoError) { systemError(this, cashDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void cashReceiptsEditList::sPost() { XSqlQuery cashPost; int journalNumber = -1; XSqlQuery tx; tx.exec("BEGIN;"); cashPost.exec("SELECT fetchJournalNumber('C/R') AS journalnumber;"); if (cashPost.first()) journalNumber = cashPost.value("journalnumber").toInt(); else if (cashPost.lastError().type() != QSqlError::NoError) { systemError(this, cashPost.lastError().databaseText(), __FILE__, __LINE__); return; } QList selected = _cashrcpt->selectedItems(); XTreeWidgetItem *cursor = 0; for (int i = 0; i < selected.size(); i++) { cursor = (XTreeWidgetItem*)selected.at(i); cashPost.prepare("SELECT postCashReceipt(:cashrcpt_id, :journalNumber) AS result;"); cashPost.bindValue(":cashrcpt_id", cursor->id()); cashPost.bindValue(":journalNumber", journalNumber); cashPost.exec(); if (cashPost.first()) { int result = cashPost.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postCashReceipt", result), __FILE__, __LINE__); tx.exec("ROLLBACK;"); return; } } else if (cashPost.lastError().type() != QSqlError::NoError) { systemError(this, cashPost.lastError().databaseText(), __FILE__, __LINE__); tx.exec("ROLLBACK;"); return; } } tx.exec("COMMIT;"); omfgThis->sCashReceiptsUpdated(-1, TRUE); sFillList(); } bool cashReceiptsEditList::setParams(ParameterList &pParams) { pParams.append("check", tr("Check")); pParams.append("certifiedCheck", tr("Certified Check")); pParams.append("masterCard", tr("Master Card")); pParams.append("visa", tr("Visa")); pParams.append("americanExpress", tr("American Express")); pParams.append("discoverCard", tr("Discover Card")); pParams.append("otherCreditCard", tr("Other Credit Card")); pParams.append("cash", tr("Cash")); pParams.append("wireTransfer", tr("Wire Transfer")); pParams.append("other", tr("Other")); return true; } void cashReceiptsEditList::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("CashReceiptsEditList", params); if (report.isValid()) report.print(); else report.reportError(this); } void cashReceiptsEditList::sFillList() { XSqlQuery cashFillList; ParameterList params; if (! setParams(params)) return; MetaSQLQuery mql = mqlLoad("unpostedCashReceipts", "detail"); cashFillList = mql.toQuery(params); _cashrcpt->populate(cashFillList); } qt-client-4.1.0/guiclient/cashReceiptsEditList.h000066400000000000000000000022361217451700100216300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CASHRECEIPTSEDITLIST_H #define CASHRECEIPTSEDITLIST_H #include "xwidget.h" #include "ui_cashReceiptsEditList.h" class cashReceiptsEditList : public XWidget, public Ui::cashReceiptsEditList { Q_OBJECT public: cashReceiptsEditList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~cashReceiptsEditList(); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu( QMenu * pMenu ); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPost(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // CASHRECEIPTSEDITLIST_H qt-client-4.1.0/guiclient/cashReceiptsEditList.ui000066400000000000000000000142041217451700100220140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. cashReceiptsEditList 0 0 800 600 Cash Receipts Edit List 12 12 12 12 12 12 0 Cash Receipts 0 0 QAbstractItemView::ExtendedSelection 5 &Close &Print false P&ost 0 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
_cashrcpt _new _edit _view _delete _print _close parameter.h _close clicked() cashReceiptsEditList close() 20 20 20 20 _cashrcpt valid(bool) _view setEnabled(bool) 20 20 20 20
qt-client-4.1.0/guiclient/changePoitemQty.cpp000066400000000000000000000166561217451700100212200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "changePoitemQty.h" #include #include #include #include "storedProcErrorLookup.h" changePoitemQty::changePoitemQty(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sChangeQty())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_newQty, SIGNAL(editingFinished()), this, SLOT(sQtyChanged())); connect(_po, SIGNAL(newId(int, QString)), this, SLOT(sPopulatePoitem(int))); connect(_poitem, SIGNAL(newID(int)), this, SLOT(sPopulate(int))); _captive = false; _cacheFreight = 0.0; _commentGroup->setEnabled(_postComment->isChecked()); _newQty->setValidator(omfgThis->qtyVal()); _newQtyReceived->setPrecision(omfgThis->qtyVal()); _currentQtyOrdered->setPrecision(omfgThis->qtyVal()); _currentQtyReceived->setPrecision(omfgThis->qtyVal()); _currentQtyBalance->setPrecision(omfgThis->qtyVal()); _newQtyBalance->setPrecision(omfgThis->qtyVal()); _cmnttype->setType(XComboBox::AllCommentTypes); adjustSize(); } changePoitemQty::~changePoitemQty() { // no need to delete child widgets, Qt does it all for us } void changePoitemQty::languageChange() { retranslateUi(this); } enum SetResponse changePoitemQty::set(const ParameterList &pParams) { XSqlQuery changeet; XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _po->setId(param.toInt()); _po->setReadOnly(true); } param = pParams.value("poitem_id", &valid); if (valid) { changeet.prepare( "SELECT poitem_pohead_id " "FROM poitem " "WHERE (poitem_id=:poitem_id);" ); changeet.bindValue(":poitem_id", param.toInt()); changeet.exec(); if (changeet.first()) { _po->setId(changeet.value("poitem_pohead_id").toInt()); _po->setReadOnly(true); _poitem->setId(param.toInt()); _poitem->setEnabled(false); } } param = pParams.value("newQty", &valid); if (valid) _newQty->setDouble(param.toDouble()); return NoError; } void changePoitemQty::sPopulatePoitem(int pPoheadid) { XSqlQuery changePopulatePoitem; changePopulatePoitem.prepare( "SELECT poitem_id," " ( poitem_linenumber || '-' ||" " COALESCE(item_number, poitem_vend_item_number) || ' (' ||" " COALESCE(item_descrip1, firstLine(poitem_vend_item_descrip)) || ')' ) " "FROM poitem LEFT OUTER JOIN " " ( itemsite JOIN item " " ON (itemsite_item_id=item_id)" " ) ON (poitem_itemsite_id=itemsite_id) " "WHERE ( (poitem_status <> 'C')" " AND (poitem_pohead_id=:pohead_id) ) " "ORDER BY poitem_linenumber;" ); changePopulatePoitem.bindValue(":pohead_id", pPoheadid); changePopulatePoitem.exec(); _poitem->populate(changePopulatePoitem); } void changePoitemQty::sPopulate(int pPoitemid) { XSqlQuery changePopulate; if (pPoitemid == -1) { _currentQtyReceived->clear(); _newQtyReceived->clear(); _currentQtyOrdered->clear(); _newQty->clear(); _currentQtyBalance->clear(); _newQtyBalance->clear(); _freight->clear(); } else { changePopulate.prepare( "SELECT poitem_qty_ordered, poitem_qty_received," " poitem_qty_returned, poitem_freight, pohead_curr_id," " CURRENT_DATE AS date " "FROM poitem, pohead " "WHERE ((poitem_pohead_id=pohead_id)" " AND (poitem_id=:poitem_id));" ); changePopulate.bindValue(":poitem_id", pPoitemid); changePopulate.exec(); if (changePopulate.first()) { _currentQtyOrdered->setDouble(changePopulate.value("poitem_qty_ordered").toDouble()); _currentQtyReceived->setDouble(changePopulate.value("poitem_qty_received").toDouble()); _currentQtyBalance->setDouble(changePopulate.value("poitem_qty_ordered").toDouble() - changePopulate.value("poitem_qty_received").toDouble()); _newQtyReceived->setDouble(changePopulate.value("poitem_qty_received").toDouble()); _cacheFreight = changePopulate.value("poitem_freight").toDouble(); _freight->set(changePopulate.value("poitem_freight").toDouble(), changePopulate.value("pohead_curr_id").toInt(), changePopulate.value("date").toDate()); sQtyChanged(); } } } void changePoitemQty::sChangeQty() { XSqlQuery changeChangeQty; if (_newQty->toDouble() <= 0 && QMessageBox::question(this, tr("Quantity 0?"), tr("

You have changed the quantity to 0 or less. " "Are you sure you want to do this?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No) return; changeChangeQty.prepare("SELECT changePoitemQty(:poitem_id, :qty) AS result;"); changeChangeQty.bindValue(":poitem_id", _poitem->id()); changeChangeQty.bindValue(":qty", _newQty->toDouble()); changeChangeQty.exec(); if (changeChangeQty.first()) { int result = changeChangeQty.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("changePoitemQty", result), __FILE__, __LINE__); return; } } else if (changeChangeQty.lastError().type() != QSqlError::NoError) { systemError(this, changeChangeQty.lastError().databaseText(), __FILE__, __LINE__); return; } if (_postComment->isChecked()) { changeChangeQty.prepare("SELECT postComment(:cmnttype_id, 'PI', :poitem_id, :comment) AS result"); changeChangeQty.bindValue(":cmnttype_id", _cmnttype->id()); changeChangeQty.bindValue(":poitem_id", _poitem->id()); changeChangeQty.bindValue(":comment", _comment->toPlainText()); changeChangeQty.exec(); if (changeChangeQty.first()) { int result = changeChangeQty.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postcomment", result), __FILE__, __LINE__); return; } } else if (changeChangeQty.lastError().type() != QSqlError::NoError) { systemError(this, changeChangeQty.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_freight->localValue() != _cacheFreight) { changeChangeQty.prepare("UPDATE poitem SET poitem_freight=:poitem_freight" " WHERE (poitem_id=:poitem_id); "); changeChangeQty.bindValue(":poitem_id", _poitem->id()); changeChangeQty.bindValue(":poitem_freight", _freight->localValue()); changeChangeQty.exec(); if (changeChangeQty.lastError().type() != QSqlError::NoError) { systemError(this, changeChangeQty.lastError().databaseText(), __FILE__, __LINE__); return; } } omfgThis->sPurchaseOrdersUpdated(_po->id(), true); accept(); } void changePoitemQty::sQtyChanged() { double qtyBalance = (_newQty->toDouble() - _newQtyReceived->toDouble()); if (qtyBalance < 0) qtyBalance = 0; _newQtyBalance->setDouble(qtyBalance); } qt-client-4.1.0/guiclient/changePoitemQty.h000066400000000000000000000022501217451700100206460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHANGEPOITEMQTY_H #define CHANGEPOITEMQTY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_changePoitemQty.h" class changePoitemQty : public XDialog, public Ui::changePoitemQty { Q_OBJECT public: changePoitemQty(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~changePoitemQty(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sPopulatePoitem( int pPoheadid ); virtual void sPopulate( int pPoitemid ); virtual void sChangeQty(); virtual void sQtyChanged(); protected slots: virtual void languageChange(); private: bool _captive; double _cacheFreight; }; #endif // CHANGEPOITEMQTY_H qt-client-4.1.0/guiclient/changePoitemQty.ui000066400000000000000000000244641217451700100210470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. changePoitemQty 0 0 463 420 Change P/O Item Quantity OrderLineEdit::Open|OrderLineEdit::Unposted OrderLineEdit::Purchase Line Item: false 0 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter New Qt::AlignCenter Qt::AlignRight Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Current Qt::AlignCenter Qty. Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Line Item Freight: false false Post Comment false 0 0 0 5 Comment Type: Qt::Horizontal QSizePolicy::Expanding 51 10 CurrCluster CurrDisplay

currcluster.h
CurrDisplay QWidget
currcluster.h
OrderCluster QWidget
ordercluster.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_po _poitem _newQty _postComment _comment _cmnttype _po valid(bool) _poitem setEnabled(bool) 20 20 20 20 _postComment toggled(bool) _commentGroup setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/changeWoQty.cpp000066400000000000000000000130531217451700100203340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "changeWoQty.h" #include #include #include #include #include "storedProcErrorLookup.h" changeWoQty::changeWoQty(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sChangeQty())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_newQtyOrdered, SIGNAL(textChanged(const QString&)), this, SLOT(sQtyChanged(const QString&))); _captive = FALSE; _wo->setType(cWoOpen | cWoExploded); _newQtyOrdered->setValidator(omfgThis->qtyVal()); _newQtyReceived->setPrecision(omfgThis->qtyVal()); _newQtyBalance->setPrecision(omfgThis->qtyVal()); _currentQtyOrdered->setPrecision(omfgThis->qtyVal()); _currentQtyReceived->setPrecision(omfgThis->qtyVal()); _currentQtyBalance->setPrecision(omfgThis->qtyVal()); _cmnttype->setType(XComboBox::AllCommentTypes); _commentGroup->setEnabled(_postComment->isChecked()); adjustSize(); } changeWoQty::~changeWoQty() { // no need to delete child widgets, Qt does it all for us } void changeWoQty::languageChange() { retranslateUi(this); } enum SetResponse changeWoQty::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } param = pParams.value("newQty", &valid); if (valid) _newQtyOrdered->setDouble(param.toDouble()); return NoError; } void changeWoQty::sChangeQty() { XSqlQuery changeChangeQty; if (_wo->status() == 'R') { QMessageBox::warning( this, tr("Cannot Reschedule Released W/O"), tr( "

The selected Work Order has been Released. " "Rescheduling it." ) ); return; } double newQty = 0.0; if (_wo->method() == "D") newQty = _newQtyOrdered->toDouble() * -1.0; else newQty = _newQtyOrdered->toDouble(); if(newQty == 0 && QMessageBox::question(this, tr("Zero Qty. Value"), tr("The current value specified is 0. Are you sure you want to continue?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; if (newQty > 0.0) { changeChangeQty.prepare( "SELECT validateOrderQty(wo_itemsite_id, :qty, TRUE) AS qty " "FROM wo " "WHERE (wo_id=:wo_id);" ); changeChangeQty.bindValue(":wo_id", _wo->id()); changeChangeQty.bindValue(":qty", _newQtyOrdered->toDouble()); changeChangeQty.exec(); if (changeChangeQty.first()) { if (changeChangeQty.value("qty").toDouble() != newQty) { if ( QMessageBox::warning( this, tr("Invalid Order Qty"), tr("

The new Order Quantity that you have " "entered does not meet the Order Parameters " "set for the parent Item Site for this Work " "Order. In order to meet the Item Site " "Order Parameters the new Order Quantity " "must be increased to %1. Do you want to " "change the Order Quantity for this Work " "Order to %2?" ) .arg(formatQty(changeChangeQty.value("qty").toDouble())) .arg(formatQty(changeChangeQty.value("qty").toDouble())), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 1 ) return; else newQty = changeChangeQty.value("qty").toDouble(); } } else if (changeChangeQty.lastError().type() != QSqlError::NoError) { systemError(this, changeChangeQty.lastError().databaseText(), __FILE__, __LINE__); return; } } changeChangeQty.prepare("SELECT changeWoQty(:wo_id, :qty, TRUE);"); changeChangeQty.bindValue(":wo_id", _wo->id()); changeChangeQty.bindValue(":qty", newQty); changeChangeQty.exec(); if (_postComment->isChecked()) { changeChangeQty.prepare("SELECT postComment(:cmnttype_id, 'W', :wo_id, :comment) AS result"); changeChangeQty.bindValue(":cmnttype_id", _cmnttype->id()); changeChangeQty.bindValue(":wo_id", _wo->id()); changeChangeQty.bindValue(":comment", _comment->toPlainText()); changeChangeQty.exec(); if (changeChangeQty.first()) { int result = changeChangeQty.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postComment", result), __FILE__, __LINE__); return; } } else if (changeChangeQty.lastError().type() != QSqlError::NoError) { systemError(this, changeChangeQty.lastError().databaseText(), __FILE__, __LINE__); return; } } omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); accept(); } void changeWoQty::sQtyChanged(const QString &pNewQty) { double qtyBalance = (pNewQty.toDouble() - _newQtyReceived->toDouble()); if (qtyBalance < 0) qtyBalance = 0; _newQtyBalance->setDouble(qtyBalance); } qt-client-4.1.0/guiclient/changeWoQty.h000066400000000000000000000020521217451700100177760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHANGEWOQTY_H #define CHANGEWOQTY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_changeWoQty.h" class changeWoQty : public XDialog, public Ui::changeWoQty { Q_OBJECT public: changeWoQty(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~changeWoQty(); public slots: virtual SetResponse set( const ParameterList & pParams ); protected slots: virtual void languageChange(); virtual void sChangeQty(); virtual void sQtyChanged( const QString & pNewQty ); private: bool _captive; }; #endif // CHANGEWOQTY_H qt-client-4.1.0/guiclient/changeWoQty.ui000066400000000000000000000320341217451700100201670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. changeWoQty 0 0 411 483 Change W/O Quantity Ordered 5 2 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok 0 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter New Qt::AlignCenter 80 32767 Qt::AlignRight Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Current Qt::AlignCenter Qty. Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 126 20 0 0 Post Comment Qt::Horizontal QSizePolicy::Expanding 46 10 false 0 0 0 5 0 5 Comment Type: Qt::Horizontal QSizePolicy::Expanding 51 10 WoCluster QWidget

wocluster.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_wo _newQtyOrdered _postComment _cmnttype _comment _wo qtyOrderedChanged(double) _currentQtyOrdered setDouble(double) 20 20 20 20 _wo qtyReceivedChanged(double) _currentQtyReceived setDouble(double) 20 20 20 20 _wo valid(bool) _newQtyOrdered setEnabled(bool) 20 20 20 20 _wo qtyReceivedChanged(double) _newQtyReceived setDouble(double) 20 20 20 20 _wo qtyBalanceChanged(double) _newQtyBalance setDouble(double) 20 20 20 20 _wo qtyBalanceChanged(double) _currentQtyBalance setDouble(double) 20 20 20 20 _postComment toggled(bool) _commentGroup setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/characteristic.cpp000066400000000000000000000277411217451700100211040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "characteristic.h" #include #include #include #include #include #include #include #include characteristic::characteristic(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _charid = -1; _charoptModel = new QSqlTableModel; _charoptModel->setTable("charopt"); _charoptModel->setEditStrategy(QSqlTableModel::OnManualSubmit); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_charoptView, SIGNAL(clicked(QModelIndex)), this, SLOT(sCharoptClicked(QModelIndex))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); } characteristic::~characteristic() { // no need to delete child widgets, Qt does it all for us } void characteristic::languageChange() { retranslateUi(this); } enum SetResponse characteristic::set(const ParameterList &pParams) { XSqlQuery characteristicet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("char_id", &valid); if (valid) { _charid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; characteristicet.exec("SELECT NEXTVAL('char_char_id_seq') AS char_id;"); if (characteristicet.first()) _charid = characteristicet.value("char_id").toInt(); sFillList(); } else if (param.toString() == "edit") { _mode = cEdit; // TODO // _mask->setEnabled(FALSE); // _validator->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(false); _search->setEnabled(false); _useGroup->setEnabled(false); _order->setEnabled(false); _mask->setEnabled(false); _validator->setEnabled(false); _items->setEnabled(FALSE); _customers->setEnabled(FALSE); _lotSerial->setEnabled(FALSE); _addresses->setEnabled(FALSE); _crmaccounts->setEnabled(FALSE); _contacts->setEnabled(FALSE); _opportunity->setEnabled(FALSE); _employees->setEnabled(FALSE); _incidents->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void characteristic::sSave() { XSqlQuery characteristicSave; if (_name->text().trimmed().isEmpty()) { QMessageBox::critical(this, tr("Missing Name"), tr("

You must name this Characteristic before " "saving it.")); _name->setFocus(); return; } if (! (_items->isChecked() || _customers->isChecked() || _lotSerial->isChecked() || _addresses->isChecked() || _crmaccounts->isChecked() || _contacts->isChecked() || _opportunity->isChecked() || _employees->isChecked() || _incidents->isChecked())) { QMessageBox::critical(this, tr("Apply Characteristic"), tr("

You must apply this Characteristic to at " "least one type of application object.")); _items->setFocus(); return; } QStringList values; for (int i = 0; i < _charoptModel->rowCount(); i++) { QString data = _charoptModel->data(_charoptModel->index(i,2), Qt::EditRole).toString(); if (values.contains(data)) { QMessageBox::critical(this, tr("Error"), tr("Option list may not contain duplicates.")); return; } values.append(data); } if (_mode == cNew) { characteristicSave.prepare( "INSERT INTO char " "( char_id, char_name, char_items, char_customers, " " char_contacts, char_crmaccounts, char_addresses, " " char_options, char_opportunity," " char_attributes, char_lotserial, char_employees," " char_incidents, " " char_notes, char_mask, char_validator, char_type, " " char_order, char_search ) " "VALUES " "( :char_id, :char_name, :char_items, :char_customers, " " :char_contacts, :char_crmaccounts, :char_addresses, " " :char_options, :char_opportunity," " :char_attributes, :char_lotserial, :char_employees," " :char_incidents, " " :char_notes, :char_mask, :char_validator, :char_type, " " :char_order, :char_search );" ); characteristicSave.bindValue(":char_type", _type->currentIndex()); } else if (_mode == cEdit) characteristicSave.prepare( "UPDATE char " "SET char_name=:char_name, char_items=:char_items, " " char_customers=:char_customers, " " char_contacts=:char_contacts, " " char_crmaccounts=:char_crmaccounts, " " char_addresses=:char_addresses, " " char_options=:char_options," " char_attributes=:char_attributes, " " char_opportunity=:char_opportunity," " char_lotserial=:char_lotserial," " char_employees=:char_employees," " char_incidents=:char_incidents," " char_notes=:char_notes," " char_mask=:char_mask," " char_validator=:char_validator, " " char_order=:char_order, " " char_search=:char_search " "WHERE (char_id=:char_id);" ); characteristicSave.bindValue(":char_id", _charid); characteristicSave.bindValue(":char_name", _name->text()); characteristicSave.bindValue(":char_items", QVariant(_items->isChecked())); characteristicSave.bindValue(":char_customers", QVariant(_customers->isChecked())); characteristicSave.bindValue(":char_crmaccounts", QVariant(_crmaccounts->isChecked())); characteristicSave.bindValue(":char_contacts", QVariant(_contacts->isChecked())); characteristicSave.bindValue(":char_addresses", QVariant(_addresses->isChecked())); characteristicSave.bindValue(":char_options", QVariant(FALSE)); characteristicSave.bindValue(":char_attributes", QVariant(FALSE)); characteristicSave.bindValue(":char_lotserial", QVariant(_lotSerial->isChecked())); characteristicSave.bindValue(":char_opportunity", QVariant(_opportunity->isChecked())); characteristicSave.bindValue(":char_employees", QVariant(_employees->isChecked())); characteristicSave.bindValue(":char_incidents", QVariant(_incidents->isChecked())); characteristicSave.bindValue(":char_notes", _description->toPlainText().trimmed()); if (_mask->currentText().trimmed().size() > 0) characteristicSave.bindValue(":char_mask", _mask->currentText()); if (_validator->currentText().trimmed().size() > 0) characteristicSave.bindValue(":char_validator", _validator->currentText()); characteristicSave.bindValue(":char_order", _order->value()); characteristicSave.bindValue(":char_search", QVariant(_search->isChecked())); characteristicSave.exec(); if (characteristicSave.lastError().type() != QSqlError::NoError) { systemError(this, characteristicSave.lastError().databaseText(), __FILE__, __LINE__); return; } _charoptModel->submitAll(); done(_charid); } void characteristic::sCheck() { XSqlQuery characteristicCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().trimmed().length())) { characteristicCheck.prepare( "SELECT char_id " "FROM char " "WHERE (UPPER(char_name)=UPPER(:char_name));" ); characteristicCheck.bindValue(":char_name", _name->text()); characteristicCheck.exec(); if (characteristicCheck.first()) { _charid = characteristicCheck.value("char_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void characteristic::populate() { XSqlQuery characteristicpopulate; characteristicpopulate.prepare( "SELECT * " "FROM char " "WHERE (char_id=:char_id);" ); characteristicpopulate.bindValue(":char_id", _charid); characteristicpopulate.exec(); if (characteristicpopulate.first()) { _name->setText(characteristicpopulate.value("char_name").toString()); _items->setChecked(characteristicpopulate.value("char_items").toBool()); _customers->setChecked(characteristicpopulate.value("char_customers").toBool()); _contacts->setChecked(characteristicpopulate.value("char_contacts").toBool()); _crmaccounts->setChecked(characteristicpopulate.value("char_crmaccounts").toBool()); _addresses->setChecked(characteristicpopulate.value("char_addresses").toBool()); _lotSerial->setChecked(characteristicpopulate.value("char_lotserial").toBool()); _opportunity->setChecked(characteristicpopulate.value("char_opportunity").toBool()); _employees->setChecked(characteristicpopulate.value("char_employees").toBool()); _incidents->setChecked(characteristicpopulate.value("char_incidents").toBool()); _description->setText(characteristicpopulate.value("char_notes").toString()); _mask->setText(characteristicpopulate.value("char_mask").toString()); _validator->setText(characteristicpopulate.value("char_validator").toString()); _type->setCurrentIndex(characteristicpopulate.value("char_type").toInt()); _type->setEnabled(false); _order->setValue(characteristicpopulate.value("char_order").toInt()); _search->setChecked(characteristicpopulate.value("char_search").toBool()); } else if (characteristicpopulate.lastError().type() != QSqlError::NoError) { systemError(this, characteristicpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void characteristic::sFillList() { QString filter = QString("charopt_char_id=%1").arg(_charid); _charoptModel->setFilter(filter); _charoptModel->setSort(3, Qt::AscendingOrder); _charoptModel->select(); _charoptModel->setHeaderData(2, Qt::Horizontal, QVariant(tr("Value"))); _charoptModel->setHeaderData(3, Qt::Horizontal, QVariant(tr("Order"))); _charoptView->setModel(_charoptModel); _charoptView->setColumnHidden(0, true); _charoptView->setColumnHidden(1, true); } void characteristic::sNew() { int row = _charoptModel->rowCount(); _charoptModel->insertRows(row,1); _charoptModel->setData(_charoptModel->index(row,1), QVariant(_charid)); _charoptModel->setData(_charoptModel->index(row,3), 0); QModelIndex idx = _charoptModel->index(row,0); _charoptView->selectionModel()->select(QItemSelection(idx, idx), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); } void characteristic::sDelete() { int row = _charoptView->selectionModel()->currentIndex().row(); QVariant value = _charoptModel->data(_charoptModel->index(row,2)); // Validate XSqlQuery qry; qry.prepare("SELECT charass_id " "FROM charass " "WHERE ((charass_char_id=:char_id) " " AND (charass_value=:value));"); qry.bindValue(":char_id", _charid); qry.bindValue(":value", value); qry.exec(); if (qry.first()) { QMessageBox::critical(this, tr("Error"), tr("This value is in use and can not be deleted.")); return; } else if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } _charoptModel->removeRows(row, 1); _charoptView->setRowHidden(row, QModelIndex(), true); } void characteristic::sCharoptClicked(QModelIndex idx) { _delete->setEnabled(idx.isValid()); } qt-client-4.1.0/guiclient/characteristic.h000066400000000000000000000033111217451700100205340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHARACTERISTIC_H #define CHARACTERISTIC_H #include #include "guiclient.h" #include "xdialog.h" #include #include "ui_characteristic.h" class characteristic : public XDialog, public Ui::characteristic { Q_OBJECT public: characteristic(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~characteristic(); enum Type { Text, List, Date }; enum Use { Addresses = 0x00000001, Contacts = 0x00000002, CRMAccounts = 0x00000004, Customers = 0x00000008, Employees = 0x00000010, Incidents = 0x00000020, Items = 0x00000040, LotSerial = 0x00000080, Opportunities = 0x00000100, }; public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void populate(); virtual void sFillList(); virtual void sNew(); virtual void sDelete(); virtual void sCharoptClicked(QModelIndex idx); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _mode; int _charid; QSqlTableModel *_charoptModel; }; #endif // CHARACTERISTIC_H qt-client-4.1.0/guiclient/characteristic.ui000066400000000000000000000350221217451700100207260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. characteristic 0 0 505 452 Characteristic 12 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Text List Date Order: Qt::Horizontal 40 20 Include in searches true Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save May be used on: Address Contact Customer Opportunity Lot/Serial Item Incident Employee CRM Account 0 Options 0 0 Input Mask: true true 00/00/0000 ###-###-#### ###-##-#### 00,000.00 Validator: true true [Y|N] \S+ [1-9]\d{0,3} [A-Z]\d{5}[1-9] Qt::Horizontal 0 20 Qt::Vertical 20 40 0 New false Delete Qt::Vertical 20 40 No Options Qt::AlignCenter Description XComboBox QComboBox

xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_name _type _order _addresses _contacts _customers _crmaccounts _employees _incidents _items _lotSerial _opportunity _tab _mask _validator _charoptView _new _delete _description _buttonBox _buttonBox rejected() characteristic close() 420 99 233 223 _type currentIndexChanged(int) _stackedWidget setCurrentIndex(int) 549 25 309 287 qt-client-4.1.0/guiclient/characteristicAssignment.cpp000066400000000000000000000332511217451700100231260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "characteristicAssignment.h" #include #include #include #include #include "characteristic.h" characteristicAssignment::characteristicAssignment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_char, SIGNAL(currentIndexChanged(int)), this, SLOT(sHandleChar())); _listpriceLit->hide(); _listprice->hide(); _listprice->setValidator(omfgThis->priceVal()); _template = false; adjustSize(); } characteristicAssignment::~characteristicAssignment() { // no need to delete child widgets, Qt does it all for us } void characteristicAssignment::languageChange() { retranslateUi(this); } enum SetResponse characteristicAssignment::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "I"; handleTargetType(); } param = pParams.value("cust_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "C"; handleTargetType(); } param = pParams.value("crmacct_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "CRMACCT"; handleTargetType(); } param = pParams.value("addr_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "ADDR"; handleTargetType(); } param = pParams.value("cntct_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "CNTCT"; handleTargetType(); } param = pParams.value("custtype_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "CT"; handleTargetType(); } param = pParams.value("ls_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "LS"; handleTargetType(); } param = pParams.value("lsreg_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "LSR"; handleTargetType(); } param = pParams.value("ophead_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "OPP"; handleTargetType(); } param = pParams.value("emp_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "EMP"; handleTargetType(); } param = pParams.value("incdt_id", &valid); if (valid) { _targetId = param.toInt(); _targetType = "INCDT"; handleTargetType(); } param = pParams.value("charass_id", &valid); if (valid) { _charassid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _char->setEnabled(FALSE); _value->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } param = pParams.value("showPrices", &valid); if (valid) { _listpriceLit->show(); _listprice->show(); } param = pParams.value("char_id", &valid); if (valid) { for (int i = 0; i < _char->model()->rowCount(); i++) { QModelIndex idx = _char->model()->index(i, 0); if (_char->model()->data(idx) == param) _char->setCurrentIndex(i); } } return NoError; } void characteristicAssignment::sSave() { if(_targetType == "I") { if ( ((_stackedWidget->currentIndex() == characteristic::Text) && (_value->text().trimmed() == "")) || ((_stackedWidget->currentIndex() == characteristic::List) && (_listValue->currentText() == "")) || ((_stackedWidget->currentIndex() == characteristic::Date) && (_dateValue->date().toString() == "")) ) { QMessageBox::information( this, tr("No Value Entered"), tr("You must enter a value before saving this Item Characteristic.") ); return; } } XSqlQuery characteristicSave; if (_char->model()->data(_char->model()->index(_char->currentIndex(), 0)) == -1) { QMessageBox::information( this, tr("No Characteristic Selected"), tr("You must select a Characteristic before saving this Item Characteristic.") ); _char->setFocus(); return; } if (_mode == cNew && _template && _stackedWidget->currentIndex() == characteristic::Date) { characteristicSave.prepare("SELECT charass_id " "FROM charass " "WHERE ((charass_char_id=:charass_char_id) " " AND (charass_target_id=:charass_target_id) " " AND (charass_target_type=:charass_target_type));"); characteristicSave.bindValue(":charass_target_id", _targetId); characteristicSave.bindValue(":charass_target_type", _targetType); characteristicSave.bindValue(":charass_char_id", _char->model()->data(_char->model()->index(_char->currentIndex(), 0))); characteristicSave.exec(); if (characteristicSave.first()) { QMessageBox::critical(this, tr("Error"), tr("You can not use the same characteristic " "for date type characteristics more than " "once in this context.")); return; } } if (_mode == cNew) { characteristicSave.exec("SELECT NEXTVAL('charass_charass_id_seq') AS charass_id;"); if (characteristicSave.first()) { _charassid = characteristicSave.value("charass_id").toInt(); characteristicSave.prepare( "INSERT INTO charass " "( charass_id, charass_target_id, charass_target_type, charass_char_id, charass_value, charass_price, charass_default ) " "VALUES " "( :charass_id, :charass_target_id, :charass_target_type, :charass_char_id, :charass_value, :charass_price, :charass_default );" ); } } else if (_mode == cEdit) characteristicSave.prepare( "UPDATE charass " "SET charass_char_id=:charass_char_id, charass_value=:charass_value, " "charass_price=:charass_price, charass_default=:charass_default " "WHERE (charass_id=:charass_id);" ); characteristicSave.bindValue(":charass_id", _charassid); characteristicSave.bindValue(":charass_target_id", _targetId); characteristicSave.bindValue(":charass_target_type", _targetType); characteristicSave.bindValue(":charass_char_id", _char->model()->data(_char->model()->index(_char->currentIndex(), 0))); if (_stackedWidget->currentIndex() == characteristic::Text) characteristicSave.bindValue(":charass_value", _value->text()); else if (_stackedWidget->currentIndex() == characteristic::List) characteristicSave.bindValue(":charass_value", _listValue->currentText()); else if (_stackedWidget->currentIndex() == characteristic::Date) characteristicSave.bindValue(":charass_value", _dateValue->date()); characteristicSave.bindValue(":charass_price", _listprice->toDouble()); characteristicSave.bindValue(":charass_default", QVariant(_default->isChecked())); characteristicSave.exec(); done(_charassid); } void characteristicAssignment::sCheck() { XSqlQuery characteristicCheck; if ((_mode == cNew) || (_char->model()->data(_char->model()->index(_char->currentIndex(), 0)) == -1)) { characteristicCheck.prepare( "SELECT charass_id " "FROM charass " "WHERE ( (charass_target_type=:charass_target_id)" " AND (charass_target_id=:charass_target_id)" " AND (charass_char_id=:char_id) );" ); characteristicCheck.bindValue(":charass_target_type", _targetType); characteristicCheck.bindValue(":charass_target_id", _targetId); characteristicCheck.bindValue(":char_id", _char->model()->data(_char->model()->index(_char->currentIndex(), 0))); characteristicCheck.exec(); if (characteristicCheck.first()) { _charassid = characteristicCheck.value("charass_id").toInt(); _mode = cEdit; populate(); } } } void characteristicAssignment::populate() { XSqlQuery characteristicpopulate; characteristicpopulate.prepare( "SELECT charass.*, char_type " "FROM charass " " JOIN char ON (charass_char_id=char_id) " "WHERE (charass_id=:charass_id);" ); characteristicpopulate.bindValue(":charass_id", _charassid); characteristicpopulate.exec(); if (characteristicpopulate.first()) { _targetId = characteristicpopulate.value("charass_target_id").toInt(); _targetType = characteristicpopulate.value("charass_target_type").toString(); handleTargetType(); for (int i = 0; i < _char->model()->rowCount(); i++) { QModelIndex idx = _char->model()->index(i, 0); if (_char->model()->data(idx) == characteristicpopulate.value("charass_char_id").toInt()) _char->setCurrentIndex(i); } _listprice->setDouble(characteristicpopulate.value("charass_price").toDouble()); _default->setChecked(characteristicpopulate.value("charass_default").toBool()); int chartype = _char->model()->data(_char->model()->index(_char->currentIndex(),16)).toInt(); if (chartype == characteristic::Text) _value->setText(characteristicpopulate.value("charass_value").toString()); else if (chartype == characteristic::List) { int idx = _listValue->findText(characteristicpopulate.value("charass_value").toString()); _listValue->setCurrentIndex(idx); } else if (chartype == characteristic::Date) _dateValue->setDate(characteristicpopulate.value("charass_value").toDate()); } else if (characteristicpopulate.lastError().type() != QSqlError::NoError) { systemError(this, characteristicpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void characteristicAssignment::sHandleChar() { QModelIndex midx = _char->model()->index(_char->currentIndex(), 16); int sidx = _char->model()->data(midx).toInt(); _stackedWidget->setCurrentIndex(sidx); if (sidx == characteristic::Text) // Handle input mask for text { XSqlQuery mask; mask.prepare( "SELECT COALESCE(char_mask, '') AS char_mask," " COALESCE(char_validator, '.*') AS char_validator " "FROM char " "WHERE (char_id=:char_id);" ); mask.bindValue(":char_id", _char->model()->data(_char->model()->index(_char->currentIndex(), 0)).toInt()); mask.exec(); if (mask.first()) { _value->setInputMask(mask.value("char_mask").toString()); QRegExp rx(mask.value("char_validator").toString()); QValidator *validator = new QRegExpValidator(rx, this); _value->setValidator(validator); } else if (mask.lastError().type() != QSqlError::NoError) { systemError(this, mask.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (sidx == characteristic::List) // Handle options for list { QSqlQuery qry; qry.prepare("SELECT charopt_id, charopt_value " "FROM charopt " "WHERE (charopt_char_id=:char_id) " "ORDER BY charopt_order, charopt_value;"); qry.bindValue(":char_id", _char->model()->data(_char->model()->index(_char->currentIndex(), 0)).toInt()); qry.exec(); _listValue->populate(qry); } if (sidx != characteristic::Date && _template) _default->setVisible(true); else { _default->setVisible(false); _default->setChecked(false); } } void characteristicAssignment::handleTargetType() { if((_targetType == "I") || (_targetType == "CT")) _template=true; else _default->hide(); if(_targetType != "I") _listprice->hide(); QString boolColumn; if ((_targetType == "C") || (_targetType == "CT")) { setWindowTitle(tr("Customer Characteristic")); boolColumn = "char_customers"; } else if (_targetType == "I") { setWindowTitle(tr("Item Characteristic")); boolColumn = "char_items"; } else if (_targetType == "CNTCT") { setWindowTitle(tr("Contact Characteristic")); boolColumn = "char_contacts"; } else if (_targetType == "ADDR") { setWindowTitle(tr("Address Characteristic")); boolColumn = "char_addresses"; } else if (_targetType == "CRMACCT") { setWindowTitle(tr("CRM Account Characteristic")); boolColumn = "char_crmaccounts"; } else if (_targetType == "LS") { setWindowTitle(tr("Lot Serial Characteristic")); boolColumn = "char_lotserial"; } else if (_targetType == "LSR") { setWindowTitle(tr("Lot/Serial Registration Characteristic")); boolColumn = "char_lotserial"; } else if (_targetType == "OPP") { setWindowTitle(tr("Opportunity Characteristic")); boolColumn = "char_opportunity"; } else if (_targetType == "EMP") { setWindowTitle(tr("Employee Characteristic")); boolColumn = "char_employees"; } else if (_targetType == "INCDT") { setWindowTitle(tr("Incident Characteristic")); boolColumn = "char_incidents"; } QSqlTableModel *model = new QSqlTableModel; model->setTable("char"); model->setFilter(boolColumn); model->setSort(1, Qt::AscendingOrder); model->setSort(17, Qt::AscendingOrder); model->select(); _char->setModel(model); _char->setModelColumn(1); sHandleChar(); } qt-client-4.1.0/guiclient/characteristicAssignment.h000066400000000000000000000024341217451700100225720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHARACTERISTICASSIGNMENT_H #define CHARACTERISTICASSIGNMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_characteristicAssignment.h" class characteristicAssignment : public XDialog, public Ui::characteristicAssignment { Q_OBJECT public: characteristicAssignment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~characteristicAssignment(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sCheck(); virtual void populate(); virtual void sHandleChar(); protected slots: virtual void languageChange(); private: bool _template; int _mode; int _charassid; int _targetId; QString _targetType; void handleTargetType(); }; #endif // CHARACTERISTICASSIGNMENT_H qt-client-4.1.0/guiclient/characteristicAssignment.ui000066400000000000000000000103031217451700100227520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. characteristicAssignment 0 0 366 137 Item Characteristic Characteristic: &Value: _value 0 0 0 0 &List Price: _value Default Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save DLineEdit QWidget
datecluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_value _listprice _default
qt-client-4.1.0/guiclient/characteristicPrice.cpp000066400000000000000000000206101217451700100220530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "characteristicPrice.h" #include #include #include characteristicPrice::characteristicPrice(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_char, SIGNAL(newID(int)), this, SLOT(sCharIdChanged())); connect(_char, SIGNAL(newID(int)), this, SLOT(sCheck())); connect(_value, SIGNAL(activated(int)), this, SLOT(sCheck())); _char->setAllowNull(TRUE); _rejectedMsg = tr("The application has encountered an error and must " "stop editing this Pricing Schedule.\n%1"); } characteristicPrice::~characteristicPrice() { // no need to delete child widgets, Qt does it all for us } void characteristicPrice::languageChange() { retranslateUi(this); } enum SetResponse characteristicPrice::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _char->populate(QString( "SELECT DISTINCT charass_char_id, char_name " "FROM charass, char " "WHERE ((charass_char_id=char_id) " "AND (charass_target_type='I') " "AND (charass_target_id= %1)) " "ORDER BY char_name; ").arg(param.toInt())); param = pParams.value("item_id", &valid); if (valid) _itemid = param.toInt(); param = pParams.value("ipsitem_id", &valid); if (valid) _ipsitemid = param.toInt(); param = pParams.value("ipsitemchar_id", &valid); if (valid) _ipsitemcharid = param.toInt(); param = pParams.value("curr_id", &valid); if (valid) _price->setId(param.toInt()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; populate(); populateItemcharInfo(); } else if (param.toString() == "view") { _mode = cView; _char->setEnabled(FALSE); _value->setEnabled(FALSE); _price->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); populate(); } } return NoError; } void characteristicPrice::sSave() { XSqlQuery characteristicSave; if (_char->id() == -1) { QMessageBox::information( this, tr("No Characteristic Selected"), tr("You must select a Characteristic before saving this Item Characteristic.") ); _char->setFocus(); return; } if (_mode == cNew) { characteristicSave.exec("SELECT nextval('ipsitemchar_ipsitemchar_id_seq') AS result;"); if (characteristicSave.first()) _ipsitemcharid=characteristicSave.value("result").toInt(); characteristicSave.prepare( "INSERT INTO ipsitemchar " "( ipsitemchar_id, ipsitemchar_ipsitem_id, ipsitemchar_char_id, ipsitemchar_value, ipsitemchar_price ) " "VALUES " "( :ipsitemchar_id, :ipsitem_id, :ipsitemchar_char_id, :ipsitemchar_value, :ipsitemchar_price );" ); } else if (_mode == cEdit) characteristicSave.prepare( "UPDATE ipsitemchar " "SET ipsitemchar_char_id=:ipsitemchar_char_id, ipsitemchar_value=:ipsitemchar_value, ipsitemchar_price=:ipsitemchar_price " "WHERE (ipsitemchar_id=:ipsitemchar_id);" ); characteristicSave.bindValue(":ipsitem_id", _ipsitemid); characteristicSave.bindValue(":ipsitemchar_id", _ipsitemcharid); characteristicSave.bindValue(":ipsitemchar_char_id", _char->id()); characteristicSave.bindValue(":ipsitemchar_value", _value->currentText()); characteristicSave.bindValue(":ipsitemchar_price", _price->localValue()); characteristicSave.exec(); if (characteristicSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(characteristicSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } done(_ipsitemcharid); } void characteristicPrice::sCheck() { XSqlQuery characteristicCheck; characteristicCheck.prepare( "SELECT ipsitemchar_id " "FROM ipsitemchar " "WHERE ( (ipsitemchar_char_id=:char_id)" " AND (ipsitemchar_value=:ipsitemchar_value) " " AND (ipsitemchar_ipsitem_id=:ipsitem_id));" ); characteristicCheck.bindValue(":ipsitem_id", _ipsitemid); characteristicCheck.bindValue(":char_id", _char->id()); characteristicCheck.bindValue(":ipsitemchar_value", _value->currentText()); characteristicCheck.exec(); if (characteristicCheck.first()) { _ipsitemcharid = characteristicCheck.value("ipsitemchar_id").toInt(); _mode = cEdit; populate(); } else if (characteristicCheck.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(characteristicCheck.lastError().databaseText()), __FILE__, __LINE__); done(-1); } else _mode = cNew; populateItemcharInfo(); } void characteristicPrice::populate() { XSqlQuery characteristicpopulate; disconnect(_char, SIGNAL(newID(int)), this, SLOT(sCheck())); disconnect(_value, SIGNAL(activated(int)), this, SLOT(sCheck())); characteristicpopulate.prepare( "SELECT ipsitemchar_char_id, ipsitemchar_value, ipsitemchar_price " "FROM ipsitemchar " "WHERE (ipsitemchar_id=:ipsitemchar_id);" ); characteristicpopulate.bindValue(":ipsitemchar_id", _ipsitemcharid); characteristicpopulate.exec(); if (characteristicpopulate.first()) { _char->setId(characteristicpopulate.value("ipsitemchar_char_id").toInt()); _value->setText(characteristicpopulate.value("ipsitemchar_value").toString()); _price->setLocalValue(characteristicpopulate.value("ipsitemchar_price").toDouble()); } else if (characteristicpopulate.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(characteristicpopulate.lastError().databaseText()), __FILE__, __LINE__); done(-1); } connect(_char, SIGNAL(newID(int)), this, SLOT(sCheck())); connect(_value, SIGNAL(activated(int)), this, SLOT(sCheck())); } void characteristicPrice::populateItemcharInfo() { XSqlQuery characteristicpopulateItemcharInfo; characteristicpopulateItemcharInfo.prepare("SELECT charass_price " "FROM charass " "WHERE ((charass_target_type='I') " "AND (charass_target_id=:item_id) " "AND (charass_char_id=:char_id) " "AND (charass_value=:value)) "); characteristicpopulateItemcharInfo.bindValue(":item_id", _itemid); characteristicpopulateItemcharInfo.bindValue(":char_id", _char->id()); characteristicpopulateItemcharInfo.bindValue(":value", _value->currentText()); characteristicpopulateItemcharInfo.exec(); if (characteristicpopulateItemcharInfo.first()) _listPrice->setLocalValue(characteristicpopulateItemcharInfo.value("charass_price").toDouble()); else if (characteristicpopulateItemcharInfo.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(characteristicpopulateItemcharInfo.lastError().databaseText()), __FILE__, __LINE__); done(-1); } else _listPrice->setLocalValue(0); } void characteristicPrice::sCharIdChanged() { XSqlQuery characteristicCharIdChanged; XSqlQuery charass; charass.prepare("SELECT charass_id, charass_value " "FROM charass " "WHERE ((charass_target_type='I') " "AND (charass_target_id=:item_id) " "AND (charass_char_id=:char_id) " "AND (COALESCE(charass_value,'')!='')); "); charass.bindValue(":item_id", _itemid); charass.bindValue(":char_id", _char->id()); charass.exec(); if (characteristicCharIdChanged.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(characteristicCharIdChanged.lastError().databaseText()), __FILE__, __LINE__); done(-1); } _value->populate(charass); } qt-client-4.1.0/guiclient/characteristicPrice.h000066400000000000000000000024051217451700100215220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHARACTERISTICPRICE_H #define CHARACTERISTICPRICE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_characteristicPrice.h" class characteristicPrice : public XDialog, public Ui::characteristicPrice { Q_OBJECT public: characteristicPrice(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~characteristicPrice(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); virtual void populateItemcharInfo(); virtual void sCheck(); virtual void sCharIdChanged(); protected slots: virtual void languageChange(); private: int _mode; int _itemid; int _ipsitemid; int _ipsitemcharid; QString _rejectedMsg; }; #endif // CHARACTERISTICPRICE_H qt-client-4.1.0/guiclient/characteristicPrice.ui000066400000000000000000000122131217451700100217060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. characteristicPrice 0 0 455 176 Characteristic Price Characteristic: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _char &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 77 16 Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::Cost false List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice false false Qt::Vertical QSizePolicy::Expanding 332 16 CurrCluster CurrDisplay
currcluster.h
XComboBox QComboBox
xcombobox.h
_char _value _price _listPrice _save _close _close clicked() characteristicPrice reject() 370 30 20 20
qt-client-4.1.0/guiclient/characteristics.cpp000066400000000000000000000103031217451700100212510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "characteristics.h" #include #include #include #include #include #include #include "characteristic.h" #include "storedProcErrorLookup.h" characteristics::characteristics(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_char, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainCharacteristics")) { connect(_char, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_char, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_char, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_char, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); } else { _new->setEnabled(FALSE); connect(_char, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); connect(_char, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); } _char->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "char_name"); _char->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "char_notes"); sFillList(); } characteristics::~characteristics() { // no need to delete child widgets, Qt does it all for us } void characteristics::languageChange() { retranslateUi(this); } void characteristics::sNew() { ParameterList params; params.append("mode", "new"); characteristic newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void characteristics::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("char_id", _char->id()); characteristic newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void characteristics::sView() { ParameterList params; params.append("mode", "view"); params.append("char_id", _char->id()); characteristic newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void characteristics::sDelete() { XSqlQuery characteristicsDelete; characteristicsDelete.prepare("SELECT deleteCharacteristic(:char_id) AS result;"); characteristicsDelete.bindValue(":char_id", _char->id()); characteristicsDelete.exec(); if (characteristicsDelete.first()) { int returnVal = characteristicsDelete.value("result").toInt(); if (returnVal < 0) { QMessageBox::critical( this, tr("Cannot Delete Characteristic"), storedProcErrorLookup("deleteCharacteristic", returnVal)); return; } sFillList(); } else if (characteristicsDelete.lastError().type() != QSqlError::NoError) { systemError(this, characteristicsDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void characteristics::sPrint() { orReport report("CharacteristicsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void characteristics::sFillList() { XSqlQuery characteristicsFillList; characteristicsFillList.prepare("SELECT char_id, char_name, char_notes " "FROM char " "ORDER BY char_name;"); characteristicsFillList.exec(); _char->populate(characteristicsFillList); if (characteristicsFillList.lastError().type() != QSqlError::NoError) { systemError(this, characteristicsFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void characteristics::sPopulateMenu(QMenu *) { } qt-client-4.1.0/guiclient/characteristics.h000066400000000000000000000021001217451700100207120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHARACTERISTICS_H #define CHARACTERISTICS_H #include "guiclient.h" #include "xwidget.h" #include "ui_characteristics.h" class characteristics : public XWidget, public Ui::characteristics { Q_OBJECT public: characteristics(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~characteristics(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // CHARACTERISTICS_H qt-client-4.1.0/guiclient/characteristics.ui000066400000000000000000000115461217451700100211160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. characteristics 0 0 600 400 List Characteristics 0 0 0 0 20 Characteristics: Qt::AlignVCenter 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
_char _new _edit _view _delete _print _close _close clicked() characteristics close() 20 20 20 20
qt-client-4.1.0/guiclient/check.cpp000066400000000000000000000137361217451700100171700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "check.h" #include #include #include check::check(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _items->addColumn(tr("P/O"), _orderColumn, Qt::AlignRight, true, "checkitem_ponumber"); _items->addColumn(tr("Voucher"), _orderColumn, Qt::AlignRight, true, "checkitem_vouchernumber"); _items->addColumn(tr("Invoice"), _orderColumn, Qt::AlignRight, true, "checkitem_invcnumber"); _items->addColumn(tr("C/M"), _orderColumn, Qt::AlignRight, true, "checkitem_cmnumber"); if (_metrics->boolean("EnableReturnAuth")) _items->addColumn(tr("R/A"), _orderColumn, Qt::AlignRight, true, "checkitem_ranumber"); _items->addColumn(tr("A/P Doc."), _orderColumn, Qt::AlignRight, true, "apopen_docnumber"); _items->addColumn(tr("A/R Doc."), _orderColumn, Qt::AlignRight, true, "aropen_docnumber"); _items->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter,true, "checkitem_docdate"); _items->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "checkitem_amount"); _items->addColumn(tr("Discount"), _itemColumn, Qt::AlignRight, true, "checkitem_discount"); _items->addColumn(tr("Amount (in %1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, true, "baseamount"); _achBatchNumber->setVisible(_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")); _checkid = -1; } check::~check() { // no need to delete child widgets, Qt does it all for us } void check::languageChange() { retranslateUi(this); } enum SetResponse check::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("checkhead_id", &valid); if (valid) { _checkid = param.toInt(); sPopulate(); } return NoError; } void check::sPopulate() { XSqlQuery checkPopulate; MetaSQLQuery mql("SELECT * " "FROM checkhead" " JOIN checkrecip ON (checkhead_recip_id=checkrecip_id" " AND checkhead_recip_type=checkrecip_type)" "WHERE (checkhead_id=);"); ParameterList params; params.append("checkid", _checkid); checkPopulate = mql.toQuery(params); if (checkPopulate.first()) { _checkNumber->setText(checkPopulate.value("checkhead_number").toString()); _bankaccnt->setId(checkPopulate.value("checkhead_bankaccnt_id").toInt()); _recipNumber->setText(checkPopulate.value("checkrecip_number").toString()); _recipName->setText(checkPopulate.value("checkrecip_name").toString()); _amount->set(checkPopulate.value("checkhead_amount").toDouble(), checkPopulate.value("checkhead_curr_id").toInt(), checkPopulate.value("checkhead_checkdate").toDate()); _checkdate->setDate(checkPopulate.value("checkhead_checkdate").toDate()); _achBatchNumber->setText(checkPopulate.value("checkhead_ach_batch").toString()); _recipType->setText(checkPopulate.value("checkrecip_type").toString()); _void->setChecked(checkPopulate.value("checkhead_void").toBool()); _replaced->setChecked(checkPopulate.value("checkhead_replaced").toBool()); _deleted->setChecked(checkPopulate.value("checkhead_deleted").toBool()); _posted->setChecked(checkPopulate.value("checkhead_posted").toBool()); _misc->setChecked(checkPopulate.value("checkhead_misc").toBool()); _expcat->setId(checkPopulate.value("checkhead_expcat_id").toInt()); _for->setText(checkPopulate.value("checkhead_for").toString()); _notes->setPlainText(checkPopulate.value("checkhead_notes").toString()); sFillList(); } else if (checkPopulate.lastError().type() != QSqlError::NoError) { systemError(this, checkPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } else clear(); } void check::clear() { _checkNumber->setText(""); _bankaccnt->setId(-1); _recipNumber->setText(""); _recipName->setText(""); _checkdate->clear(); _achBatchNumber->setText(""); _recipType->setText(""); _void->setChecked(false); _replaced->setChecked(false); _deleted->setChecked(false); _posted->setChecked(false); _misc->setChecked(false); _expcat->setId(-1); _for->setText(""); _notes->setPlainText(""); _items->clear(); } void check::sFillList() { XSqlQuery checkFillList; if (_misc->isChecked()) _items->clear(); else { MetaSQLQuery mql("SELECT checkitem.*," " apopen_docnumber, aropen_docnumber," " currToBase(, checkitem_amount," " checkitem_docdate) AS baseamount," " 'curr' AS checkitem_amount_xtnumericrole," " 'curr' AS checkitem_discount_xtnumericrole," " 'curr' AS baseamount_xtnumericrole " "FROM checkitem" " LEFT OUTER JOIN apopen ON (checkitem_apopen_id=apopen_id)" " LEFT OUTER JOIN aropen ON (checkitem_aropen_id=aropen_id) " "WHERE (checkitem_checkhead_id=);"); ParameterList params; params.append("checkid", _checkid); params.append("curr_id", _amount->id()); checkFillList = mql.toQuery(params); _items->populate(checkFillList, true); if (checkFillList.lastError().type() != QSqlError::NoError) { systemError(this, checkFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/check.h000066400000000000000000000017451217451700100166320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHECK_H #define CHECK_H #include "guiclient.h" #include "xwidget.h" #include "ui_check.h" class ParameterList; class check : public XWidget, public Ui::check { Q_OBJECT public: check(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~check(); enum SetResponse set(const ParameterList &); public slots: virtual void clear(); virtual void sFillList(); virtual void sPopulate(); protected slots: virtual void languageChange(); private: int _checkid; }; #endif // CHECK_H qt-client-4.1.0/guiclient/check.ui000066400000000000000000000204371217451700100170170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. check 0 0 754 483 Check Information Check Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter # Written To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Recipient # Recipient Name 0 1 true 0 Memo: _notes 0 10 Check Items: _items For false Batch # Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Recipient Type Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _bankaccnt XComboBox::APBankAccounts false Close false Posted false Void false false Replaced false Miscellaneous Expense: false XComboBox::ExpenseCategories false Deleted _checkNumberLit _checkNumber _recipLit _recipNumber _recipName _notes _notesLit _items _itemsLit _for _checkdate _achBatchNumber _recipType _bankaccntLit _bankaccnt _close _posted _void _amount _replaced _misc _expcat _deleted CurrCluster CurrDisplay
currcluster.h
DLineEdit QWidget
datecluster.h
1
XComboBox QComboBox
xcombobox.h
XTreeWidget QTreeWidget
xtreewidget.h
_notes _items _close _close clicked() check close() 662 28 662 56
qt-client-4.1.0/guiclient/checkFormat.cpp000066400000000000000000000110531217451700100203270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "checkFormat.h" #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" checkFormat::checkFormat(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); _report->setCurrentIndex(-1); } checkFormat::~checkFormat() { // no need to delete child widgets, Qt does it all for us } void checkFormat::languageChange() { retranslateUi(this); } enum SetResponse checkFormat::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("form_id", &valid); if (valid) { _formid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _report->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void checkFormat::sSave() { XSqlQuery checkSave; QList errors; errors << GuiErrorCheck(_name->text().trimmed().isEmpty(), _name, tr("You must enter a valid Name for this Check Format " "before continuing")) << GuiErrorCheck(_report->id() == -1, _report, tr("You must select a Report for this Check Format " "before continuing")) ; if (_mode == cNew) { checkSave.prepare( "SELECT form_id " "FROM form " "WHERE (form_name=:form_name);" ); checkSave.bindValue(":form_name", _name->text()); checkSave.exec(); if (checkSave.first()) errors << GuiErrorCheck(true, _name, tr( "A Form has already been defined with the selected Name.\n" "You may not create duplicate Forms." ) ); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Check Format"), errors)) return; if (_mode == cNew) { checkSave.exec("SELECT NEXTVAL('form_form_id_seq') AS _form_id"); if (checkSave.first()) _formid = checkSave.value("_form_id").toInt(); else if (checkSave.lastError().type() != QSqlError::NoError) { systemError(this, checkSave.lastError().databaseText(), __FILE__, __LINE__); return; } checkSave.prepare( "INSERT INTO form " "(form_id, form_name, form_descrip, form_report_name, form_key) " "VALUES " "(:form_id, :form_name, :form_descrip, :form_report_name, 'Chck');" ); } else if (_mode == cEdit) checkSave.prepare( "UPDATE form " "SET form_name=:form_name, form_descrip=:form_descrip," " form_report_name=:form_report_name " "WHERE (form_id=:form_id);" ); checkSave.bindValue(":form_id", _formid); checkSave.bindValue(":form_name", _name->text()); checkSave.bindValue(":form_descrip", _descrip->text()); checkSave.bindValue(":form_report_name", _report->code()); checkSave.exec(); if (checkSave.lastError().type() != QSqlError::NoError) { systemError(this, checkSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_formid); } void checkFormat::populate() { XSqlQuery checkpopulate; checkpopulate.prepare( "SELECT form_name, form_descrip, form_report_name " "FROM form " "WHERE (form_id=:form_id);" ); checkpopulate.bindValue(":form_id", _formid); checkpopulate.exec(); if (checkpopulate.first()) { _name->setText(checkpopulate.value("form_name").toString()); _descrip->setText(checkpopulate.value("form_descrip").toString()); _report->setCode(checkpopulate.value("form_report_name").toString()); } else if (checkpopulate.lastError().type() != QSqlError::NoError) { systemError(this, checkpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/checkFormat.h000066400000000000000000000020301217451700100177670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHECKFORMAT_H #define CHECKFORMAT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_checkFormat.h" class checkFormat : public XDialog, public Ui::checkFormat { Q_OBJECT public: checkFormat(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~checkFormat(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _formid; }; #endif // CHECKFORMAT_H qt-client-4.1.0/guiclient/checkFormat.ui000066400000000000000000000130121217451700100201570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. checkFormat 0 0 437 109 Check Format 0 5 5 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report &Report: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 XComboBox::Reports Qt::Vertical QSizePolicy::Expanding 20 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
_name _descrip _report _buttonBox rejected() checkFormat reject() 390 56 218 54
qt-client-4.1.0/guiclient/checkFormats.cpp000066400000000000000000000063651217451700100205240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "checkFormats.h" #include #include #include #include #include "checkFormat.h" #include "guiclient.h" #include "storedProcErrorLookup.h" checkFormats::checkFormats(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); if (_privileges->check("MaintainCheckFormats")) connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); else _new->setEnabled(false); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_form, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(sHandleButtons())); _form->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "form_name"); _form->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "form_descrip"); sFillList(); } checkFormats::~checkFormats() { // no need to delete child widgets, Qt does it all for us } void checkFormats::languageChange() { retranslateUi(this); } void checkFormats::sHandleButtons() { XTreeWidgetItem *selected = (XTreeWidgetItem*)_form->currentItem(); if (selected && _privileges->check("MaintainCheckFormats")) { _edit->setEnabled(true); _delete->setEnabled(true); } else { _edit->setEnabled(false); _delete->setEnabled(false); } } void checkFormats::sNew() { ParameterList params; params.append("mode", "new"); checkFormat newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void checkFormats::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("form_id", _form->id()); checkFormat newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void checkFormats::sView() { ParameterList params; params.append("mode", "view"); params.append("form_id", _form->id()); checkFormat newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void checkFormats::sDelete() { XSqlQuery checkDelete; checkDelete.prepare("SELECT deleteForm(:form_id) AS result;"); checkDelete.bindValue(":form_id", _form->id()); checkDelete.exec(); if (checkDelete.first()) { int result = checkDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteForm", result), __FILE__, __LINE__); return; } } else if (checkDelete.lastError().type() != QSqlError::NoError) { systemError(this, checkDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void checkFormats::sFillList() { _form->populate( "SELECT form_id, form_name, form_descrip " "FROM form " "WHERE form_key='Chck' " "ORDER BY form_name;" ); } qt-client-4.1.0/guiclient/checkFormats.h000066400000000000000000000017571217451700100201710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CHECKFORMATS_H #define CHECKFORMATS_H #include "xwidget.h" #include "ui_checkFormats.h" class checkFormats : public XWidget, public Ui::checkFormats { Q_OBJECT public: checkFormats(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~checkFormats(); public slots: virtual void sFillList(); virtual void sHandleButtons(); protected slots: virtual void languageChange(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); }; #endif // CHECKFORMATS_H qt-client-4.1.0/guiclient/checkFormats.ui000066400000000000000000000104101217451700100203410ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. checkFormats 0 0 600 400 List Check Formats 0 Forms: 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
xtreewidget.h
_form _new _edit _delete _close _form itemSelected(int) _edit animateClick() 20 20 20 20 _close clicked() checkFormats close() 20 20 20 20
qt-client-4.1.0/guiclient/classCode.cpp000066400000000000000000000102721217451700100200030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "classCode.h" #include #include #include "errorReporter.h" #include "guiErrorCheck.h" classCode::classCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_classCode, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); } classCode::~classCode() { // no need to delete child widgets, Qt does it all for us } void classCode::languageChange() { retranslateUi(this); } enum SetResponse classCode::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("classcode_id", &valid); if (valid) { _classcodeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _classCode->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void classCode::sSave() { XSqlQuery classSave; QList errors; errors << GuiErrorCheck(_classCode->text().length() == 0, _classCode, tr("You must enter a valid Class Code " "before continuing")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Class Code"), errors)) return; if (_mode == cEdit) classSave.prepare( "UPDATE classcode " "SET classcode_code=:classcode_code, classcode_descrip=:classcode_descrip " "WHERE (classcode_id=:classcode_id);" ); else if (_mode == cNew) { classSave.exec("SELECT NEXTVAL('classcode_classcode_id_seq') AS classcode_id"); if (classSave.first()) _classcodeid = classSave.value("classcode_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } classSave.prepare( "INSERT INTO classcode " "( classcode_id, classcode_code, classcode_descrip ) " "VALUES " "( :classcode_id, :classcode_code, :classcode_descrip );" ); } classSave.bindValue(":classcode_id", _classcodeid); classSave.bindValue(":classcode_code", _classCode->text()); classSave.bindValue(":classcode_descrip", _description->text()); classSave.exec(); done(_classcodeid); } void classCode::sCheck() { XSqlQuery classCheck; _classCode->setText(_classCode->text().trimmed()); if ( (_mode == cNew) && (_classCode->text().length()) ) { classCheck.prepare( "SELECT classcode_id " "FROM classcode " "WHERE (UPPER(classcode_code)=UPPER(:classcode_code));" ); classCheck.bindValue(":classcode_code", _classCode->text()); classCheck.exec(); if (classCheck.first()) { _classcodeid = classCheck.value("classcode_id").toInt(); _mode = cEdit; populate(); _classCode->setEnabled(FALSE); } } } void classCode::populate() { XSqlQuery classpopulate; classpopulate.prepare( "SELECT classcode_code, classcode_descrip " "FROM classcode " "WHERE (classcode_id=:classcode_id);" ); classpopulate.bindValue(":classcode_id", _classcodeid); classpopulate.exec(); if (classpopulate.first()) { _classCode->setText(classpopulate.value("classcode_code")); _description->setText(classpopulate.value("classcode_descrip")); } } qt-client-4.1.0/guiclient/classCode.h000066400000000000000000000020531217451700100174460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CLASSCODE_H #define CLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_classCode.h" class classCode : public XDialog, public Ui::classCode { Q_OBJECT public: classCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~classCode(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _classcodeid; int _mode; }; #endif // CLASSCODE_H qt-client-4.1.0/guiclient/classCode.ui000066400000000000000000000101521217451700100176330ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. classCode 0 0 400 100 Class Code C&lass Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _classCode 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
xlineedit.h
1
_classCode _description parameter.h _buttonBox rejected() classCode reject() 353 51 199 49
qt-client-4.1.0/guiclient/classCodes.cpp000066400000000000000000000111511217451700100201630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "classCodes.h" #include #include #include #include #include #include "classCode.h" #include "storedProcErrorLookup.h" classCodes::classCodes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deleteUnused, SIGNAL(clicked()), this, SLOT(sDeleteUnused())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainClassCodes")) { connect(_classcode, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_classcode, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_classcode, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_classcode, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); _deleteUnused->setEnabled(FALSE); } _classcode->addColumn(tr("Class Code"), 70, Qt::AlignLeft, true, "classcode_code"); _classcode->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "classcode_descrip"); sFillList(-1); } classCodes::~classCodes() { // no need to delete child widgets, Qt does it all for us } void classCodes::languageChange() { retranslateUi(this); } void classCodes::sNew() { ParameterList params; params.append("mode", "new"); classCode newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void classCodes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("classcode_id", _classcode->id()); classCode newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void classCodes::sView() { ParameterList params; params.append("mode", "view"); params.append("classcode_id", _classcode->id()); classCode newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void classCodes::sDelete() { XSqlQuery classDelete; classDelete.prepare("SELECT deleteClassCode(:classcode_id) AS result;"); classDelete.bindValue(":classcode_id", _classcode->id()); classDelete.exec(); if (classDelete.first()) { int result = classDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteClassCode", result), __FILE__, __LINE__); return; } } else if (classDelete.lastError().type() != QSqlError::NoError) { systemError(this, classDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(-1); } void classCodes::sPrint() { orReport report("ClassCodesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void classCodes::sDeleteUnused() { XSqlQuery classDeleteUnused; if ( QMessageBox::warning( this, tr("Delete Unused Class Codes"), tr("

Are you sure that you wish to delete all " "unused Class Codes?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { classDeleteUnused.exec("SELECT deleteUnusedClassCodes() AS result;"); if (classDeleteUnused.first()) { int result = classDeleteUnused.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteUnusedClassCodes", result), __FILE__, __LINE__); return; } } else if (classDeleteUnused.lastError().type() != QSqlError::NoError) { systemError(this, classDeleteUnused.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(-1); } } void classCodes::sFillList(int pId) { _classcode->populate( "SELECT classcode_id, classcode_code, classcode_descrip " "FROM classcode " "ORDER BY classcode_code;", pId ); } qt-client-4.1.0/guiclient/classCodes.h000066400000000000000000000017771217451700100176450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CLASSCODES_H #define CLASSCODES_H #include "xwidget.h" #include "ui_classCodes.h" class classCodes : public XWidget, public Ui::classCodes { Q_OBJECT public: classCodes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~classCodes(); public slots: virtual void sFillList(int pId); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPrint(); virtual void sDeleteUnused(); protected slots: virtual void languageChange(); }; #endif // CLASSCODES_H qt-client-4.1.0/guiclient/classCodes.ui000066400000000000000000000122171217451700100200220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. classCodes 0 0 600 400 List Class Codes 0 Class Codes: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Preferred 20 5 Delete &Unused Qt::Vertical QSizePolicy::Expanding 20 0 XTreeWidget QTreeWidget

xtreewidget.h
_classcode _new _edit _view _delete _deleteUnused _print _close _close clicked() classCodes close() 20 20 20 20 _classcode valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/closePurchaseOrder.cpp000066400000000000000000000070321217451700100216770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "closePurchaseOrder.h" #include #include closePurchaseOrder::closePurchaseOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_closePo, SIGNAL(clicked()), this, SLOT(sClosePo())); _captive = FALSE; _po->addColumn(tr("Number"), _orderColumn, Qt::AlignRight, true, "pohead_number" ); _po->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name" ); _po->addColumn(tr("Agent"), _itemColumn, Qt::AlignCenter, true, "pohead_agent_username" ); _po->addColumn(tr("Order Date"), _dateColumn, Qt::AlignLeft, true, "pohead_orderdate" ); _po->addColumn(tr("First Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); sFillList(); } closePurchaseOrder::~closePurchaseOrder() { // no need to delete child widgets, Qt does it all for us } void closePurchaseOrder::languageChange() { retranslateUi(this); } enum SetResponse closePurchaseOrder::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _po->setId(param.toInt()); } return NoError; } void closePurchaseOrder::sClosePo() { XSqlQuery closeClosePo; closeClosePo.prepare("SELECT closePo(:pohead_id) AS result;"); QListselected = _po->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { closeClosePo.bindValue(":pohead_id", ((XTreeWidgetItem*)selected[i])->id()); closeClosePo.exec(); } } if (_captive) accept(); else { _close->setText(tr("&Close")); sFillList(); } } void closePurchaseOrder::sFillList() { QString sql( "SELECT pohead_id, pohead_number," " vend_name, pohead_agent_username," " pohead_orderdate," " item_number " "FROM vendinfo, pohead LEFT OUTER JOIN" " poitem ON (poitem_pohead_id=pohead_id AND poitem_linenumber=1)" " LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id)" " LEFT OUTER JOIN item ON (itemsite_item_id=item_id) " "WHERE ( (pohead_vend_id=vend_id)" " AND (pohead_status='O') " " ) " "ORDER BY pohead_number DESC;" ); _po->populate(sql); } bool closePurchaseOrder::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkPOSitePrivs(:poheadid) AS result;"); check.bindValue(":poheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not close this Purchase Order as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/closePurchaseOrder.h000066400000000000000000000021671217451700100213500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CLOSEPURCHASEORDER_H #define CLOSEPURCHASEORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_closePurchaseOrder.h" class closePurchaseOrder : public XDialog, public Ui::closePurchaseOrder { Q_OBJECT public: closePurchaseOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~closePurchaseOrder(); virtual bool checkSitePrivs(int orderid); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sClosePo(); virtual void sFillList(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // CLOSEPURCHASEORDER_H qt-client-4.1.0/guiclient/closePurchaseOrder.ui000066400000000000000000000106551217451700100215370ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. closePurchaseOrder 0 0 450 253 Close Purchase Order 9 6 0 6 Qt::Horizontal QSizePolicy::Expanding 20 21 0 5 &Cancel false Close &P/O true true 0 0 Purchase Order: _po QAbstractItemView::ExtendedSelection XTreeWidget QTreeWidget
xtreewidget.h
_po _closePo _close _close clicked() closePurchaseOrder reject() 255 31 20 20 _po valid(bool) _closePo setEnabled(bool) 161 129 283 49 _po itemSelected(int) _closePo animateClick() 210 196 253 68
qt-client-4.1.0/guiclient/closeWo.cpp000066400000000000000000000174471217451700100175310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "closeWo.h" #include #include #include #include "inputManager.h" #include "returnWoMaterialItem.h" closeWo::closeWo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_closeWo, SIGNAL(clicked()), this, SLOT(sCloseWo())); _captive = FALSE; _transDate->setDate(omfgThis->dbDate(), true); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _wo->setType(cWoOpen | cWoExploded | cWoReleased | cWoIssued); _postMaterialVariance->setChecked(_metrics->boolean("PostMaterialVariances")); } closeWo::~closeWo() { // no need to delete child widgets, Qt does it all for us } void closeWo::languageChange() { retranslateUi(this); } enum SetResponse closeWo::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("transDate", &valid); if (valid) _transDate->setDate(param.toDate()); param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } return NoError; } bool closeWo::okToSave() { XSqlQuery closeokToSave; if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return false; } // Return any tools that have been issued XSqlQuery tool; tool.prepare( "SELECT womatl_id" " FROM womatl " " JOIN itemsite ON (womatl_itemsite_id = itemsite_id) " " JOIN item ON ((itemsite_item_id = item_id) AND (item_type = 'T')) " " WHERE ((womatl_wo_id=:wo_id)" " AND (womatl_qtyiss > 0 ));"); tool.bindValue(":wo_id", _wo->id()); tool.exec(); if (tool.first()) { do { returnWoMaterialItem newdlg(this); ParameterList params; params.append("womatl_id", tool.value("womatl_id").toInt()); if (newdlg.set(params) == NoError) newdlg.exec(); } while (tool.next()); } XSqlQuery type; type.prepare( "SELECT itemsite_costmethod " "FROM itemsite,wo " "WHERE ((wo_id=:wo_id) " "AND (wo_itemsite_id=itemsite_id)); "); type.bindValue(":wo_id", _wo->id()); type.exec(); if (type.first()) { if (type.value("itemsite_costmethod").toString() == "J") { QMessageBox::critical(this, tr("Invalid Work Order"), tr("

Work Orders for item sites with the Job cost " "method are posted when shipping the Sales Order " "they are associated with.") ); _wo->setFocus(); return false; } else { closeokToSave.prepare("SELECT wo_qtyrcv, womatl_issuemethod, womatl_qtyiss " " FROM wo " " JOIN womatl ON (womatl_wo_id = wo_id) " " JOIN itemsite ON (womatl_itemsite_id = itemsite_id) " " JOIN item ON ((itemsite_item_id = item_id) AND (NOT item_type = 'T')) " " WHERE (wo_id=:wo_id);" ); closeokToSave.bindValue(":wo_id", _wo->id()); closeokToSave.exec(); if (closeokToSave.first()) { if (closeokToSave.value("wo_qtyrcv").toDouble() == 0.0) QMessageBox::warning(this, tr("No Production Posted"), tr("

There has not been any Production " "received from this Work Order. This " "probably means Production Postings for " "this Work Order have been overlooked." )); bool unissuedMaterial = FALSE; bool unpushedMaterial = FALSE; do { if (! unissuedMaterial && (closeokToSave.value("womatl_issuemethod") == "S") && (closeokToSave.value("womatl_qtyiss").toDouble() == 0.0) ) { QMessageBox::warning(this, tr("Unissued Push Items"), tr("

The selected Work Order has Material " "Requirements that are Push-Issued but " "have not had any material issued to them. " "This probably means that required manual " "material issues have been overlooked.")); unissuedMaterial = TRUE; } else if (! unpushedMaterial && ( (closeokToSave.value("womatl_issuemethod") == "L") || (closeokToSave.value("womatl_issuemethod") == "M") ) && (closeokToSave.value("womatl_qtyiss").toDouble() == 0.0) ) { QMessageBox::warning(this, tr("Unissued Pull Items"), tr("

The selected Work Order has Material " "Requirements that are Pull-Issued but " "have not had any material issued to them. " "This probably means that Production was " "posted for this Work Order through " "posting Operations. The BOM for this Item " "should be modified to list Used At " "selections for each BOM Item." ) ); unpushedMaterial = TRUE; } } while (closeokToSave.next()); } else if (closeokToSave.lastError().type() != QSqlError::NoError) { systemError(this, closeokToSave.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; // this is the only successful case } } else if (type.lastError().type() != QSqlError::NoError) { systemError(this, type.lastError().databaseText(), __FILE__, __LINE__); return false; } else // type not found { systemError(this, tr("Cannot close Work Order %1 because the Item does not " "appear to have an Item Type! Please check the Item " "definition. You may need to reset the Type and save " "the Item record.").arg(_wo->woNumber())); return false; } return false; } void closeWo::sCloseWo() { XSqlQuery closeCloseWo; if (okToSave() && QMessageBox::question(this, tr("Close Work Order"), tr("

Are you sure you want to close this " "Work Order?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { closeCloseWo.prepare("SELECT closeWo(:wo_id, :postMatVar, :date);"); closeCloseWo.bindValue(":wo_id", _wo->id()); closeCloseWo.bindValue(":postMatVar", QVariant(_postMaterialVariance->isChecked())); closeCloseWo.bindValue(":date", _transDate->date()); closeCloseWo.exec(); if (closeCloseWo.lastError().type() != QSqlError::NoError) { systemError(this, closeCloseWo.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); if (_captive) close(); else { clear(); } } } void closeWo::clear() { _wo->setId(-1); _close->setText(tr("&Close")); _wo->setFocus(); } qt-client-4.1.0/guiclient/closeWo.h000066400000000000000000000020261217451700100171610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CLOSEWO_H #define CLOSEWO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_closeWo.h" class closeWo : public XDialog, public Ui::closeWo { Q_OBJECT public: closeWo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~closeWo(); Q_INVOKABLE virtual bool okToSave(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void clear(); protected slots: virtual void languageChange(); virtual void sCloseWo(); private: bool _captive; }; #endif // CLOSEWO_H qt-client-4.1.0/guiclient/closeWo.ui000066400000000000000000000153411217451700100173530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. closeWo 0 0 625 481 Close Work Order Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 290 130 0 0 Post &Material Usage Variances Qt::Horizontal QSizePolicy::Expanding 7 188 Cancel false Close W/O true Qt::Vertical 20 0 0 Comments Comments::WorkOrder Comments QWidget

comments.h
DLineEdit QWidget
datecluster.h
1
WoCluster QWidget
wocluster.h
_wo _postMaterialVariance _closeWo _close _wo valid(bool) _closeWo setEnabled(bool) 20 20 20 20 _close clicked() closeWo reject() 20 20 20 20 _wo newId(int) _comments setId(int) 174 87 312 347 qt-client-4.1.0/guiclient/commentType.cpp000066400000000000000000000252321217451700100204110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "commentType.h" #include #include #include #include "storedProcErrorLookup.h" commentType::commentType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery commentcommentType; setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_addAll, SIGNAL(clicked()), this, SLOT(sAddAll())); connect(_revoke, SIGNAL(clicked()), this, SLOT(sRevoke())); connect(_revokeAll, SIGNAL(clicked()), this, SLOT(sRevokeAll())); connect(_module, SIGNAL(activated(const QString&)), this, SLOT(sModuleSelected(const QString&))); connect(_granted, SIGNAL(itemSelected(int)), this, SLOT(sRevoke())); connect(_available, SIGNAL(itemSelected(int)), this, SLOT(sAdd())); _available->addColumn("Available Sources", -1, Qt::AlignLeft); _granted->addColumn("Granted Sources", -1, Qt::AlignLeft); commentcommentType.exec( "SELECT DISTINCT source_module " "FROM source " "ORDER BY source_module;" ); for (int i = 0; commentcommentType.next(); i++) _module->insertItem(i, commentcommentType.value("source_module").toString()); } commentType::~commentType() { // no need to delete child widgets, Qt does it all for us } void commentType::languageChange() { retranslateUi(this); } enum SetResponse commentType::set(const ParameterList &pParams) { XSqlQuery commentet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cmnttype_id", &valid); if (valid) { _cmnttypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; commentet.exec("SELECT NEXTVAL('cmnttype_cmnttype_id_seq') AS cmnttype_id"); if (commentet.first()) _cmnttypeid = commentet.value("cmnttype_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } _module->setCurrentIndex(0); sModuleSelected(_module->itemText(0)); } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _editable->setEnabled(FALSE); _order->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void commentType::sSave() { XSqlQuery commentSave; if (_name->text().length() == 0) { QMessageBox::information( this, tr("Cannot Save Comment Type"), tr("You must enter a valid Comment Type before saving this Item Type.") ); _name->setFocus(); return; } if (_mode == cNew) { commentSave.prepare( "INSERT INTO cmnttype " "( cmnttype_id, cmnttype_name, cmnttype_descrip, cmnttype_editable, cmnttype_order ) " "VALUES " "( :cmnttype_id, :cmnttype_name, :cmnttype_descrip, :cmnttype_editable, :cmnttype_order );" ); } else if (_mode == cEdit) commentSave.prepare( "UPDATE cmnttype " "SET cmnttype_name=:cmnttype_name," " cmnttype_descrip=:cmnttype_descrip," " cmnttype_editable=:cmnttype_editable," " cmnttype_order=:cmnttype_order " "WHERE (cmnttype_id=:cmnttype_id);" ); commentSave.bindValue(":cmnttype_id", _cmnttypeid); commentSave.bindValue(":cmnttype_name", _name->text()); commentSave.bindValue(":cmnttype_descrip", _description->text()); commentSave.bindValue(":cmnttype_editable", _editable->isChecked()); commentSave.bindValue(":cmnttype_order", _order->value()); commentSave.exec(); done(_cmnttypeid); } void commentType::sCheck() { XSqlQuery commentCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { commentCheck.prepare( "SELECT cmnttype_id " "FROM cmnttype " "WHERE (UPPER(cmnttype_name)=UPPER(:cmnttype_name));" ); commentCheck.bindValue(":cmnttype_name", _name->text()); commentCheck.exec(); if (commentCheck.first()) { _cmnttypeid = commentCheck.value("cmnttype_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void commentType::populate() { XSqlQuery commentpopulate; commentpopulate.prepare( "SELECT * " "FROM cmnttype " "WHERE (cmnttype_id=:cmnttype_id);" ); commentpopulate.bindValue(":cmnttype_id", _cmnttypeid); commentpopulate.exec(); if (commentpopulate.first()) { _name->setText(commentpopulate.value("cmnttype_name")); _description->setText(commentpopulate.value("cmnttype_descrip")); _editable->setChecked(commentpopulate.value("cmnttype_editable").toBool()); _order->setValue(commentpopulate.value("cmnttype_order").toInt()); if(commentpopulate.value("cmnttype_sys").toBool()) { _name->setEnabled(false); if(_name->text() == "ChangeLog") _editable->setEnabled(false); } commentpopulate.prepare( "SELECT source_module " "FROM cmnttypesource, source " "WHERE ( (cmnttypesource_source_id=source_id)" " AND (cmnttypesource_cmnttype_id=:cmnttype_id) ) " "ORDER BY source_module " "LIMIT 1;" ); commentpopulate.bindValue(":cmnttype_id", _cmnttypeid); commentpopulate.exec(); if (commentpopulate.first()) { for (int counter = 0; counter < _module->count(); counter++) { if (_module->itemText(counter) == commentpopulate.value("source_module").toString()) { _module->setCurrentIndex(counter); sModuleSelected(_module->itemText(counter)); } } } else { _module->setCurrentIndex(0); sModuleSelected(_module->itemText(0)); } } } void commentType::sModuleSelected(const QString &pModule) { XTreeWidgetItem *granted = NULL; XTreeWidgetItem *available = NULL; _available->clear(); _granted->clear(); XSqlQuery sources; sources.prepare( "SELECT source_id, source_descrip " "FROM source " "WHERE (source_module=:source_module) " "ORDER BY source_descrip;" ); sources.bindValue(":source_module", pModule); sources.exec(); if (sources.first()) { granted = NULL; available = NULL; // Insert each source into either the available or granted list XSqlQuery cmnttypesource; cmnttypesource.prepare( "SELECT source_id " "FROM source, cmnttypesource " "WHERE ( (cmnttypesource_source_id=source_id)" " AND (cmnttypesource_cmnttype_id=:cmnttype_id)" " AND (source_module=:source_module) );" ); cmnttypesource.bindValue(":cmnttype_id", _cmnttypeid); cmnttypesource.bindValue(":source_module", _module->currentText()); cmnttypesource.exec(); do { if (cmnttypesource.findFirst("source_id", sources.value("source_id").toInt()) == -1) available = new XTreeWidgetItem(_available, available, sources.value("source_id").toInt(), sources.value("source_descrip")); else { granted = new XTreeWidgetItem(_granted, granted, sources.value("source_id").toInt(), sources.value("source_descrip")); } } while (sources.next()); } } void commentType::sAdd() { XSqlQuery commentAdd; commentAdd.prepare("SELECT grantCmnttypeSource(:cmnttype_id, :source_id) AS result;"); commentAdd.bindValue(":cmnttype_id", _cmnttypeid); commentAdd.bindValue(":source_id", _available->id()); commentAdd.exec(); // no storedProcErrorLookup because the function returns bool, not int if (commentAdd.lastError().type() != QSqlError::NoError) { systemError(this, commentAdd.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); } void commentType::sAddAll() { XSqlQuery commentAddAll; commentAddAll.prepare("SELECT grantAllModuleCmnttypeSource(:cmnttype_id, :module) AS result;"); commentAddAll.bindValue(":cmnttype_id", _cmnttypeid); commentAddAll.bindValue(":module", _module->currentText()); commentAddAll.exec(); if (commentAddAll.first()) { int result = commentAddAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("grantAllModuleCmnttypeSource", result), __FILE__, __LINE__); return; } } else if (commentAddAll.lastError().type() != QSqlError::NoError) { systemError(this, commentAddAll.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); } void commentType::sRevoke() { XSqlQuery commentRevoke; commentRevoke.prepare("SELECT revokeCmnttypeSource(:cmnttype_id, :source_id) AS result;"); commentRevoke.bindValue(":cmnttype_id", _cmnttypeid); commentRevoke.bindValue(":source_id", _granted->id()); commentRevoke.exec(); // no storedProcErrorLookup because the function returns bool, not int if (commentRevoke.lastError().type() != QSqlError::NoError) { systemError(this, commentRevoke.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); } void commentType::sRevokeAll() { XSqlQuery commentRevokeAll; commentRevokeAll.prepare("SELECT revokeAllModuleCmnttypeSource(:cmnttype_id, :module) AS result;"); commentRevokeAll.bindValue(":cmnttype_id", _cmnttypeid); commentRevokeAll.bindValue(":module", _module->currentText()); commentRevokeAll.exec(); if (commentRevokeAll.first()) { int result = commentRevokeAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("revokeAllModuleCmnttypeSource", result), __FILE__, __LINE__); return; } } else if (commentRevokeAll.lastError().type() != QSqlError::NoError) { systemError(this, commentRevokeAll.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); } qt-client-4.1.0/guiclient/commentType.h000066400000000000000000000023461217451700100200570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COMMENTTYPE_H #define COMMENTTYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_commentType.h" class commentType : public XDialog, public Ui::commentType { Q_OBJECT public: commentType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~commentType(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); virtual void sModuleSelected( const QString & pModule ); virtual void sAdd(); virtual void sAddAll(); virtual void sRevoke(); virtual void sRevokeAll(); private: int _cmnttypeid; int _mode; }; #endif // COMMENTTYPE_H qt-client-4.1.0/guiclient/commentType.ui000066400000000000000000000242061217451700100202440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. commentType 0 0 686 352 Comment Type &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Editable &Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _order Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save &Module: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _module Qt::Horizontal QSizePolicy::Expanding 20 20 0 1 QFrame::NoFrame QFrame::Raised 0 5 5 0 Qt::Vertical 20 20 Add-> Add All->> 0 <-Revoke <<-Revoke All Qt::Vertical QSizePolicy::Expanding 20 20 XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTreeWidget QTreeWidget
xtreewidget.h
1
_name _description _order _editable _module _available _add _addAll _revoke _revokeAll _granted _buttonBox parameter.h _available valid(bool) _add setEnabled(bool) 27 404 338 314 _granted valid(bool) _revoke setEnabled(bool) 576 404 338 371 _buttonBox rejected() commentType reject() 639 55 342 175
qt-client-4.1.0/guiclient/commentTypes.cpp000066400000000000000000000101471217451700100205730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "commentTypes.h" #include #include #include #include #include "commentType.h" commentTypes::commentTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); if (_privileges->check("MaintainCommentTypes")) connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); else _new->setEnabled(false); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_cmnttype, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(sHandleButtons())); _cmnttype->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "cmnttype_name"); _cmnttype->addColumn(tr("Sys."), _ynColumn, Qt::AlignCenter,true, "cmnttype_sys"); _cmnttype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "cmnttype_descrip"); _cmnttype->addColumn(tr("Order"), _ynColumn, Qt::AlignLeft, false, "cmnttype_order"); sFillList(); } commentTypes::~commentTypes() { // no need to delete child widgets, Qt does it all for us } void commentTypes::languageChange() { retranslateUi(this); } void commentTypes::sFillList() { XSqlQuery commentFillList; commentFillList.prepare( "SELECT cmnttype_id, cmnttype_name," " cmnttype_sys, cmnttype_descrip, cmnttype_order " "FROM cmnttype " "ORDER BY cmnttype_order, cmnttype_name;" ); commentFillList.exec(); _cmnttype->populate(commentFillList); if (commentFillList.lastError().type() != QSqlError::NoError) { systemError(this, commentFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void commentTypes::sHandleButtons() { XTreeWidgetItem *selected = (XTreeWidgetItem*)_cmnttype->currentItem(); if (selected && _privileges->check("MaintainCommentTypes")) { _edit->setEnabled(true); _delete->setEnabled(!selected->rawValue("cmnttype_sys").toBool()); } else { _edit->setEnabled(false); _delete->setEnabled(false); } } void commentTypes::sNew() { ParameterList params; params.append("mode", "new"); commentType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void commentTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("cmnttype_id", _cmnttype->id()); commentType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void commentTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("cmnttype_id", _cmnttype->id()); commentType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void commentTypes::sDelete() { XSqlQuery commentDelete; commentDelete.prepare( "SELECT comment_id " "FROM comment " "WHERE (comment_cmnttype_id=:cmnttype_id) " "LIMIT 1;" ); commentDelete.bindValue(":cmnttype_id", _cmnttype->id()); commentDelete.exec(); if (commentDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Comment Type"), tr("The selected Comment Type cannot be deleted because there are Comments that are assigned to it.\n") ); return; } else { commentDelete.prepare( "DELETE FROM cmnttypesource " "WHERE (cmnttypesource_cmnttype_id=:cmnttype_id);" ); commentDelete.bindValue(":cmnttype_id", _cmnttype->id()); commentDelete.exec(); commentDelete.prepare( "DELETE FROM cmnttype " "WHERE (cmnttype_id=:cmnttype_id);" ); commentDelete.bindValue(":cmnttype_id", _cmnttype->id()); commentDelete.exec(); sFillList(); } } qt-client-4.1.0/guiclient/commentTypes.h000066400000000000000000000020341217451700100202340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COMMENTTYPES_H #define COMMENTTYPES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_commentTypes.h" class commentTypes : public XWidget, public Ui::commentTypes { Q_OBJECT public: commentTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~commentTypes(); public slots: virtual void sFillList(); virtual void sHandleButtons(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); protected slots: virtual void languageChange(); }; #endif // COMMENTTYPES_H qt-client-4.1.0/guiclient/commentTypes.ui000066400000000000000000000102561217451700100204270ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. commentTypes 0 0 600 400 List Comment Types 0 Comment Types: &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 133 XTreeWidget QTreeWidget
xtreewidget.h
1
_cmnttype _new _edit _delete _close parameter.h _close clicked() commentTypes close() 303 31 20 20 _cmnttype doubleClicked(QModelIndex) _edit animateClick() 239 50 309 73
qt-client-4.1.0/guiclient/companies.cpp000066400000000000000000000077341217451700100200720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "companies.h" #include #include #include #include #include #include "company.h" #include "storedProcErrorLookup.h" companies::companies(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_company, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainChartOfAccounts")) { connect(_company, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_company, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_company, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_company, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _company->addColumn(tr("Number"), _itemColumn, Qt::AlignCenter,true, "company_number" ); _company->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "company_descrip"); sFillList(); } companies::~companies() { // no need to delete child widgets, Qt does it all for us } void companies::languageChange() { retranslateUi(this); } void companies::sNew() { ParameterList params; params.append("mode", "new"); company *newdlg = new company(this, "", TRUE); newdlg->set(params); if (newdlg->exec() != XDialog::Rejected) sFillList(); } void companies::sEdit() { ParameterList params; params.append("company_id", _company->id()); params.append("mode", "edit"); company *newdlg = new company(this, "", TRUE); newdlg->set(params); if (newdlg->exec() != XDialog::Rejected) sFillList(); } void companies::sView() { ParameterList params; params.append("company_id", _company->id()); params.append("mode", "view"); company *newdlg = new company(this, "", TRUE); newdlg->set(params); newdlg->exec(); } void companies::sDelete() { XSqlQuery companiesDelete; companiesDelete.prepare("SELECT deleteCompany(:id) AS result;"); companiesDelete.bindValue(":id", _company->id()); companiesDelete.exec(); if (companiesDelete.first()) { int result = companiesDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteCompany", result), __FILE__, __LINE__); return; } } else if (companiesDelete.lastError().type() != QSqlError::NoError) { systemError(this, companiesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void companies::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainChartOfAccounts")); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainChartOfAccounts")); } void companies::sFillList() { XSqlQuery companiesFillList; companiesFillList.prepare( "SELECT * " "FROM company " "ORDER BY company_number;" ); companiesFillList.exec(); _company->populate(companiesFillList); if (companiesFillList.lastError().type() != QSqlError::NoError) { systemError(this, companiesFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/companies.h000066400000000000000000000017731217451700100175340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COMPANIES_H #define COMPANIES_H #include "guiclient.h" #include "xwidget.h" #include "ui_companies.h" class companies : public XWidget, public Ui::companies { Q_OBJECT public: companies(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~companies(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // COMPANIES_H qt-client-4.1.0/guiclient/companies.ui000066400000000000000000000122201217451700100177070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. companies 0 0 418 264 List Companies 0 0 Companies: 0 5 &Close 0 0 &New false &Edit false &View false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
xtreewidget.h
0
_company _new _edit _view _delete _close _close clicked() companies close() _company valid(bool) _view setEnabled(bool)
qt-client-4.1.0/guiclient/company.cpp000066400000000000000000000503211217451700100175500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "company.h" #include #include #include #include #include #include "login2.h" #include "currcluster.h" #define DEBUG false company::company(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_extDB, SIGNAL(editingFinished()), this, SLOT(sHandleTest())); connect(_extPort, SIGNAL(editingFinished()), this, SLOT(sHandleTest())); connect(_extServer, SIGNAL(editingFinished()), this, SLOT(sHandleTest())); connect(_extTest, SIGNAL(clicked()), this, SLOT(sTest())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(_currency, SIGNAL(newID(int)), this, SLOT(sCurrencyChanged())); _number->setMaxLength(_metrics->value("GLCompanySize").toInt()); _cachedNumber = ""; _cachedCurrid = CurrCluster::baseId(); _external->setVisible(_metrics->boolean("MultiCompanyFinancialConsolidation")); _authGroup->setVisible(_metrics->boolean("MultiCompanyFinancialConsolidation")); _currency->setId(CurrCluster::baseId()); _unrlzgainloss->setType(GLCluster::cRevenue | GLCluster::cExpense); _unrlzgainloss->setShowExternal(true); _unrlzgainloss->setIgnoreCompany(true); _yearend->setShowExternal(true); _yearend->setType(GLCluster::cEquity); _yearend->setIgnoreCompany(true); _gainloss->setType(GLCluster::cExpense); _gainloss->setShowExternal(true); _gainloss->setIgnoreCompany(true); _discrepancy->setType(GLCluster::cExpense); _discrepancy->setShowExternal(true); _discrepancy->setIgnoreCompany(true); } company::~company() { // no need to delete child widgets, Qt does it all for us } void company::languageChange() { retranslateUi(this); } enum SetResponse company::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("company_id", &valid); if (valid) { _companyid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(FALSE); _descrip->setEnabled(FALSE); _external->setEnabled(FALSE); _authGroup->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } return NoError; } void company::sSave() { XSqlQuery companySave; if (_number->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Company"), tr("You must enter a valid Number.") ); _number->setFocus(); return; } struct { bool condition; QString msg; QWidget* widget; } error[] = { { _external->isChecked() && _extServer->text().isEmpty(), tr("

You must enter a Server if this is an external Company."), _extServer }, { _external->isChecked() && _extPort->value() == 0, tr("

You must enter a Port if this is an external Company."), _extPort }, { _external->isChecked() && _extDB->text().isEmpty(), tr("

You must enter a Database if this is an external Company."), _extDB }, { true, "", NULL } }; // error[] int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Save Company"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } companySave.prepare("SELECT company_id" " FROM company" " WHERE((company_id != :company_id)" " AND (company_number=:company_number))"); companySave.bindValue(":company_id", _companyid); companySave.bindValue(":company_number", _number->text()); companySave.exec(); if(companySave.first()) { QMessageBox::critical(this, tr("Duplicate Company Number"), tr("A Company Number already exists for the one specified.") ); _number->setFocus(); return; } if (_yearend->isValid() && _companyid != _yearend->companyId()) { QMessageBox::critical(this, tr("Company Account Mismatch"), tr("The Retained Earnings Account must belong to this Company.") ); _yearend->setFocus(); return; } if (_gainloss->isValid() && _companyid != _gainloss->companyId()) { QMessageBox::critical(this, tr("Company Account Mismatch"), tr("The Currency Gain/Loss Account must belong to this Company.") ); _gainloss->setFocus(); return; } if (_discrepancy->isValid() && _companyid != _discrepancy->companyId()) { QMessageBox::critical(this, tr("Company Account Mismatch"), tr("The G/L Discrepancy Account must belong to this Company.") ); _discrepancy->setFocus(); return; } if (_unrlzgainloss->isValid() && _companyid != _unrlzgainloss->companyId()) { QMessageBox::critical(this, tr("Company Account Mismatch"), tr("The Unrealized Currency Gain/Loss Account must belong to this Company.") ); _unrlzgainloss->setFocus(); return; } if (_mode == cNew) { companySave.exec("SELECT NEXTVAL('company_company_id_seq') AS company_id;"); if (companySave.first()) _companyid = companySave.value("company_id").toInt(); else if (companySave.lastError().type() != QSqlError::NoError) { systemError(this, companySave.lastError().databaseText(), __FILE__, __LINE__); return; } companySave.prepare( "INSERT INTO company " "( company_id, company_number, company_descrip," " company_external, company_server, company_port," " company_database, company_curr_id, company_yearend_accnt_id, " " company_gainloss_accnt_id, company_dscrp_accnt_id, " " company_unrlzgainloss_accnt_id) " "VALUES " "( :company_id, :company_number, :company_descrip," " :company_external, :company_server, :company_port, " " :company_database, :company_curr_id, :company_yearend_accnt_id, " " :company_gainloss_accnt_id, :company_dscrp_accnt_id, " " :company_unrlzgainloss_accnt_id);" ); } else if (_mode == cEdit) { if (_number->text() != _cachedNumber && QMessageBox::question(this, tr("Change All Accounts?"), _external->isChecked() ? tr("

The old Company Number %1 might be used " "by existing Accounts, including Accounts in " "the %2 child database. Would you like to " "change all accounts in the current database " "that use it to Company Number %3?

If you " "answer 'No' then either Cancel or change the " "Number back to %4 and Save again. If you " "answer 'Yes' then change the Company Number " "in the child database as well.") .arg(_cachedNumber) .arg(_extDB->text()) .arg(_number->text()) .arg(_cachedNumber) : tr("

The old Company Number %1 might be used " "by existing Accounts. Would you like to " "change all accounts that use it to Company " "Number %2?

If you answer 'No' then either " "Cancel or change " "the Number back to %3 and Save again.") .arg(_cachedNumber) .arg(_number->text()) .arg(_cachedNumber), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; companySave.prepare( "UPDATE company " "SET company_number=:company_number," " company_descrip=:company_descrip," " company_external=:company_external," " company_server=:company_server," " company_port=:company_port," " company_database=:company_database, " " company_curr_id=:company_curr_id, " " company_yearend_accnt_id=:company_yearend_accnt_id, " " company_gainloss_accnt_id=:company_gainloss_accnt_id, " " company_dscrp_accnt_id=:company_dscrp_accnt_id, " " company_unrlzgainloss_accnt_id=:company_unrlzgainloss_accnt_id " "WHERE (company_id=:company_id);" ); } companySave.bindValue(":company_id", _companyid); companySave.bindValue(":company_number", _number->text()); companySave.bindValue(":company_descrip", _descrip->toPlainText()); companySave.bindValue(":company_external", _external->isChecked()); companySave.bindValue(":company_server", _extServer->text()); companySave.bindValue(":company_port", _extPort->cleanText()); companySave.bindValue(":company_database", _extDB->text()); if (_gainloss->isValid()) companySave.bindValue(":company_gainloss_accnt_id", _gainloss->id()); if (_discrepancy->isValid()) companySave.bindValue(":company_dscrp_accnt_id", _discrepancy->id()); if (_yearend->isValid()) companySave.bindValue(":company_yearend_accnt_id", _yearend->id()); if (_external->isChecked()) { companySave.bindValue(":company_curr_id", _currency->id()); if (_unrlzgainloss->isValid()) companySave.bindValue(":company_unrlzgainloss_accnt_id", _unrlzgainloss->id()); } companySave.exec(); if (companySave.lastError().type() != QSqlError::NoError) { systemError(this, companySave.lastError().databaseText(), __FILE__, __LINE__); return; } if ((!_yearend->isValid()) || (!_gainloss->isValid()) || (!_discrepancy->isValid()) || (_external->isChecked() && _currency->id() != CurrCluster::baseId() && !_unrlzgainloss->isValid())) { QMessageBox::warning( this, tr("Accounts Required"), tr("You will need to return to this window to set " "required Accounts before you can use Accounts " "for this company in the system.") ); } done(_companyid); } void company::populate() { XSqlQuery companypopulate; companypopulate.prepare( "SELECT * " "FROM company " "WHERE (company_id=:company_id);" ); companypopulate.bindValue(":company_id", _companyid); companypopulate.exec(); if (companypopulate.first()) { _number->setText(companypopulate.value("company_number").toString()); _descrip->setText(companypopulate.value("company_descrip").toString()); _external->setChecked(companypopulate.value("company_external").toBool()); _extServer->setText(companypopulate.value("company_server").toString()); _extPort->setValue(companypopulate.value("company_port").toInt()); _extDB->setText(companypopulate.value("company_database").toString()); _yearend->setId(companypopulate.value("company_yearend_accnt_id").toInt()); _gainloss->setId(companypopulate.value("company_gainloss_accnt_id").toInt()); _discrepancy->setId(companypopulate.value("company_dscrp_accnt_id").toInt()); if (_external->isChecked()) { _cachedCurrid = companypopulate.value("company_curr_id").toInt(); _currency->setId(companypopulate.value("company_curr_id").toInt()); _unrlzgainloss->setId(companypopulate.value("company_unrlzgainloss_accnt_id").toInt()); } _cachedNumber = companypopulate.value("company_number").toString(); companypopulate.prepare("SELECT COUNT(*) AS result " "FROM accnt " "WHERE (accnt_company=:number);"); companypopulate.bindValue(":number", _cachedNumber); companypopulate.exec(); if (companypopulate.first()) _external->setEnabled(companypopulate.value("result").toInt() == 0); else if (companypopulate.lastError().type() != QSqlError::NoError) { systemError(this, companypopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (companypopulate.lastError().type() != QSqlError::NoError) { systemError(this, companypopulate.lastError().databaseText(), __FILE__, __LINE__); return; } sHandleTest(); } void company::sHandleTest() { _extTest->setEnabled(! _extServer->text().isEmpty() && _extPort->value() != 0 && ! _extDB->text().isEmpty()); } void company::sTest() { XSqlQuery companyTest; if (DEBUG) qDebug("company::sTest()"); QString dbURL; QString protocol = "psql"; QString host = _extServer->text(); QString db = _extDB->text(); QString port = _extPort->cleanText(); buildDatabaseURL(dbURL, protocol, host, db, port); if (DEBUG) qDebug("company::sTest() dbURL before login2 = %s", qPrintable(dbURL)); ParameterList params; params.append("databaseURL", dbURL); params.append("multipleConnections"); login2 newdlg(this, "testLogin", false); newdlg.set(params); if (newdlg.exec() == QDialog::Rejected) return; dbURL = newdlg._databaseURL; if (DEBUG) qDebug("company::sTest() dbURL after login2 = %s", qPrintable(dbURL)); parseDatabaseURL(dbURL, protocol, host, db, port); QSqlDatabase testDB = QSqlDatabase::addDatabase("QPSQL7", db); testDB.setHostName(host); testDB.setDatabaseName(db); testDB.setUserName(newdlg.username()); testDB.setPassword(newdlg.password()); testDB.setPort(port.toInt()); if (testDB.open()) { if (DEBUG) qDebug("company::sTest() opened testDB!"); XSqlQuery rmq(testDB); rmq.prepare("SELECT fetchMetricText('ServerVersion') AS result;"); rmq.exec(); if (rmq.first()) { if (rmq.value("result").toString() != _metrics->value("ServerVersion")) { QMessageBox::warning(this, tr("Versions Incompatible"), tr("

The version of the child database is not " "the same as the version of the parent " "database (%1 vs. %2). The data cannot safely " "be synchronized.") .arg(rmq.value("result").toString()) .arg(_metrics->value("ServerVersion"))); return; } } else if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); return; } rmq.exec("SELECT * FROM curr_symbol WHERE curr_base;"); if (_external->isChecked()) { companyTest.prepare("SELECT * FROM curr_symbol WHERE curr_id=:curr_id;"); companyTest.bindValue(":curr_id", _currency->id()); companyTest.exec(); } else companyTest.exec("SELECT * FROM curr_symbol WHERE curr_base;"); if (companyTest.first() && rmq.first()) { if (rmq.value("curr_symbol").toString() != companyTest.value("curr_symbol").toString() && rmq.value("curr_abbr").toString() != companyTest.value("curr_abbr").toString()) { QMessageBox::warning(this, tr("Currencies Incompatible"), tr("

The currency of the child database does " "not appear to match the selected currency for " "the company (%1 %2 %3 vs. %4 %5 %6). The data may " "not synchronize properly.") .arg(rmq.value("curr_name").toString()) .arg(rmq.value("curr_symbol").toString()) .arg(rmq.value("curr_abbr").toString()) .arg(companyTest.value("curr_name").toString()) .arg(companyTest.value("curr_symbol").toString()) .arg(companyTest.value("curr_abbr").toString())); return; } } else if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); return; } else if (companyTest.lastError().type() != QSqlError::NoError) { systemError(this, companyTest.lastError().databaseText(), __FILE__, __LINE__); return; } else if (!rmq.first()) { QMessageBox::warning(this, tr("No Base Currency"), tr("

The child database does not appear to have " "a base currency defined. The data cannot safely " "be synchronized.")); return; } else if (!companyTest.first()) { QMessageBox::warning(this, tr("No Base Currency"), tr("

The parent database does not appear to have " "a base currency defined. The data cannot safely " "be synchronized.")); return; } rmq.prepare("SELECT * FROM company WHERE (company_number=:number);"); rmq.bindValue(":number", _number->text()); rmq.exec(); if (rmq.first()) { QMessageBox::warning(this, windowTitle(), tr("Test Successful.")); return; } else if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::warning(this, tr("No Corresponding Company"), tr("

The child database does not appear to have " "a Company %1 defined. The data cannot safely " "be synchronized.").arg(_number->text())); return; } } } void company::sCurrencyChanged() { if (!_external->isChecked()) return; if (_currency->id() != _cachedCurrid) { XSqlQuery qry; qry.prepare("SELECT count(trialbal_id) " "FROM trialbal " " JOIN accnt ON (trialbal_accnt_id=accnt_id) " "WHERE (accnt_company=:company_number);"); qry.bindValue(":company_number", _number->text()); qry.exec(); qry.first(); if (qry.value("count").toInt()) { if (QMessageBox::question(this, tr("Delete Imported Data?"), tr("Financial history has already been imported " "for this company. Changing the currency will delete " "this data. This action is not reversible. Are you " "sure this is what you want to do?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { qry.prepare("DELETE FROM gltranssync " "WHERE (gltranssync_company_id=:company_id); " "DELETE FROM trialbal " "WHERE (trialbal_accnt_id IN (" " SELECT accnt_id " " FROM accnt " " JOIN company ON (accnt_company=company_number) " " WHERE (company_id=:company_id)));"); qry.bindValue(":company_id", _companyid); qry.exec(); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } } else _currency->setId(_cachedCurrid); } } _unrlzgainloss->setEnabled(_currency->id() != CurrCluster::baseId()); } qt-client-4.1.0/guiclient/company.h000066400000000000000000000022101217451700100172070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COMPANY_H #define COMPANY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_company.h" class company : public XDialog, public Ui::company { Q_OBJECT public: company(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~company(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); virtual void sHandleTest(); virtual void sTest(); virtual void sCurrencyChanged(); private: int _mode; int _companyid; QString _cachedNumber; int _cachedCurrid; }; #endif // COMPANY_H qt-client-4.1.0/guiclient/company.ui000066400000000000000000000275611217451700100174150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. company 0 0 600 476 Company Number Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number Qt::Horizontal QSizePolicy::Expanding 51 13 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Description: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing _descrip 0 Qt::Horizontal QSizePolicy::Fixed 10 10 External Company false Server: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _extServer Port: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _extPort Database: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _extDB false false false Test false 1024 65535 5432 Qt::Horizontal 40 20 Qt::Horizontal Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false XComboBox::Currencies Qt::Horizontal 40 20 Unrealized Gain/Loss: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Retained Earnings: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Currency Gain/Loss: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter G/L Series Discrepancy : Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter GLCluster QWidget

glcluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_number _descrip _authGroup _extServer _extPort _extDB _extTest _external toggled(bool) _extServer setEnabled(bool) 265 170 232 206 _external toggled(bool) _extPort setEnabled(bool) 265 170 232 244 _external toggled(bool) _extDB setEnabled(bool) 265 170 232 277 _external toggled(bool) _currency setEnabled(bool) 265 170 226 326 qt-client-4.1.0/guiclient/configauthorizedotnetprocessor.cpp000066400000000000000000000072161217451700100244650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configauthorizedotnetprocessor.h" #include #include /** \ingroup creditcards \class ConfigAuthorizeDotNetProcessor \brief Configuration UI for the Authorize.Net credit card processor */ ConfigAuthorizeDotNetProcessor::ConfigAuthorizeDotNetProcessor(QWidget* parent, Qt::WindowFlags fl) : ConfigCreditCardProcessor(parent, fl) { setupUi(this); connect(_anDuplicateWindow, SIGNAL(valueChanged(int)), this, SLOT(sDuplicateWindow(int))); if (_metrics->value("CCANVer").isEmpty()) _anVersion->setItemText(0, "3.1"); else _anVersion->setItemText(0, _metrics->value("CCANVer")); _anDelim->setText(_metrics->value("CCANDelim")); _anEncap->setText(_metrics->value("CCANEncap")); _anDuplicateWindow->setValue(_metrics->value("CCANDuplicateWindow").toInt()); _anMD5Hash->setText(_metrics->value("CCANMD5Hash")); _anMD5HashSetOnGateway->setChecked(_metrics->boolean("CCANMD5HashSetOnGateway")); _anMD5HashWarn->setChecked(_metrics->value("CCANMD5HashAction") == "W"); _anMD5HashFail->setChecked(_metrics->value("CCANMD5HashAction") == "F"); if (_metrics->value("CCANCurrency") == "TRANS") _anCurrTransaction->setChecked(true); else if (! _metrics->value("CCANCurrency").isEmpty()) { _anCurrFixed->setChecked(true); _anCurrFixedValue->setId(_metrics->value("CCANCurrency").toInt()); } _anUsingWellsFargoSecureSource->setChecked(_metrics->boolean("CCANWellsFargoSecureSource")); _anIgnoreSSLErrors->setChecked(_metrics->boolean("CCANIgnoreSSLErrors")); if (0 != _metricsenc) _anMD5Hash->setText(_metricsenc->value("CCANMD5Hash")); else _anMD5Hash->setEnabled(false); sDuplicateWindow(_anDuplicateWindow->value()); } ConfigAuthorizeDotNetProcessor::~ConfigAuthorizeDotNetProcessor() { // no need to delete child widgets, Qt does it all for us } void ConfigAuthorizeDotNetProcessor::languageChange() { retranslateUi(this); } bool ConfigAuthorizeDotNetProcessor::sSave() { _metrics->set("CCANVer", _anVersion->currentText()); _metrics->set("CCANDelim", _anDelim->text()); _metrics->set("CCANEncap", _anEncap->text()); _metrics->set("CCANDuplicateWindow", _anDuplicateWindow->cleanText()); _metrics->set("CCANMD5HashSetOnGateway", _anMD5HashSetOnGateway->isChecked()); if (_anMD5HashWarn->isChecked()) _metrics->set("CCANMD5HashAction", QString("W")); else if (_anMD5HashFail->isChecked()) _metrics->set("CCANMD5HashAction", QString("F")); if (_anCurrFixed->isChecked()) _metrics->set("CCANCurrency", _anCurrFixedValue->id()); else // if (_anCurrTransaction->isChecked()) _metrics->set("CCANCurrency", QString("TRANS")); _metrics->set("CCANWellsFargoSecureSource", _anUsingWellsFargoSecureSource->isChecked()); _metrics->set("CCANMD5HashSetOnGateway", _anMD5HashSetOnGateway->isChecked()); _metrics->set("CCANIgnoreSSLErrors", _anIgnoreSSLErrors->isChecked()); _metrics->load(); if (0 != _metricsenc) { _metricsenc->set("CCANMD5Hash", _anMD5Hash->text()); _metricsenc->load(); } return true; } void ConfigAuthorizeDotNetProcessor::sDuplicateWindow(int p) { QTime time; time.addSecs(p); _anDuplicateWindowAsHMS->setText(time.toString("HH:mm:ss")); } qt-client-4.1.0/guiclient/configauthorizedotnetprocessor.h000066400000000000000000000021021217451700100241170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGAUTHORIZEDOTNETPROCESSOR_H #define CONFIGAUTHORIZEDOTNETPROCESSOR_H #include "xwidget.h" #include "configcreditcardprocessor.h" #include "ui_configauthorizedotnetprocessor.h" class ConfigAuthorizeDotNetProcessor : public ConfigCreditCardProcessor, public Ui::ConfigAuthorizeDotNetProcessor { Q_OBJECT public: ConfigAuthorizeDotNetProcessor(QWidget *parent = 0, Qt::WindowFlags flags = 0); virtual ~ConfigAuthorizeDotNetProcessor(); public slots: virtual void sDuplicateWindow(int); virtual bool sSave(); protected slots: virtual void languageChange(); }; #endif qt-client-4.1.0/guiclient/configauthorizedotnetprocessor.ui000066400000000000000000000222501217451700100243130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. ConfigAuthorizeDotNetProcessor 0 0 432 472 Authorize.Net-Specific Configuration Authorize.Net Options: Qt::Horizontal 0 20 Transaction Version: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _anVersion false 3.1 Delimiting Character: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _anDelim , 1 Encapsulating Character: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _anEncapLit 1 Duplicate Window: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _anDuplicateWindow 28000 120 00:00:00 MD5 Hash: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _anMD5Hash QLineEdit::PasswordEchoOnEdit Set on Gateway true false 12 Fail if MD5 check fails Warn if MD5 check fails Qt::Horizontal 40 20 Currency of Transactions: 12 Same as Order true Always Use: false XComboBox::Currencies Qt::Horizontal 40 20 Additional Options: Using Wells Fargo SecureSource Ignore SSL Errors true Qt::Vertical 20 6 XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
qt-client-4.1.0/guiclient/configcreditcardprocessor.cpp000066400000000000000000000013751217451700100233410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configcreditcardprocessor.h" #include "configcreditcardprocessor.h" ConfigCreditCardProcessor::ConfigCreditCardProcessor(QWidget* parent, Qt::WindowFlags fl) : XWidget(parent, fl) { } ConfigCreditCardProcessor::~ConfigCreditCardProcessor() { // no need to delete child widgets, Qt does it all for us } qt-client-4.1.0/guiclient/configcreditcardprocessor.h000066400000000000000000000040221217451700100227760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGCREDITCARDPROCESSOR_H #define CONFIGCREDITCARDPROCESSOR_H #include "xwidget.h" /** @ingroup creditcards @class ConfigCreditCardProcessor @brief An abstract class for showing and saving configuration information for a specific credit card processor. Each credit card processing company has its own API and requirements for communicating with it over the Internet. The commonalities are encapsulated in the configureCC class. The ConfigCreditCardProcessor class abstracts a simple interface that configureCC can use to save the details specific to individual processing companies. Subclasses of ConfigCreditCardProcessor are expected to load the specific details in their constructors, present them in a UI for the user to view and change, and save these changes with the sSave slot. @see CreditCardProcessor @see configureCC */ class ConfigCreditCardProcessor : public XWidget { Q_OBJECT public: ConfigCreditCardProcessor(QWidget *parent = 0, Qt::WindowFlags flags = 0); virtual ~ConfigCreditCardProcessor(); public slots: /** @brief Save the details required for a specific credit card processing company. An abstract method. Child classes are expected to save the details specific to their own credit card processing companies with the sSave slot. @returns true if successful; false if there was an error, such as a missing required field. */ virtual bool sSave() = 0; protected slots: virtual void languageChange() = 0; }; #endif qt-client-4.1.0/guiclient/configcybersourceprocessor.cpp000066400000000000000000000021241217451700100235530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configcybersourceprocessor.h" #include #include /** \ingroup creditcards \class ConfigCyberSourceProcessor \brief Configuration UI for the CyberSource credit card processor */ ConfigCyberSourceProcessor::ConfigCyberSourceProcessor(QWidget* parent, Qt::WindowFlags fl) : ConfigCreditCardProcessor(parent, fl) { setupUi(this); } ConfigCyberSourceProcessor::~ConfigCyberSourceProcessor() { // no need to delete child widgets, Qt does it all for us } void ConfigCyberSourceProcessor::languageChange() { retranslateUi(this); } bool ConfigCyberSourceProcessor::sSave() { _metrics->load(); return true; } qt-client-4.1.0/guiclient/configcybersourceprocessor.h000066400000000000000000000017761217451700100232340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGCYBERSOURCEPROCESSOR_H #define CONFIGCYBERSOURCEPROCESSOR_H #include "xwidget.h" #include "configcreditcardprocessor.h" #include "ui_configcybersourceprocessor.h" class ConfigCyberSourceProcessor : public ConfigCreditCardProcessor, public Ui::ConfigCyberSourceProcessor { Q_OBJECT public: ConfigCyberSourceProcessor(QWidget *parent = 0, Qt::WindowFlags flags = 0); virtual ~ConfigCyberSourceProcessor(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); }; #endif qt-client-4.1.0/guiclient/configcybersourceprocessor.ui000066400000000000000000000030471217451700100234130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. ConfigCyberSourceProcessor 0 0 400 300 CyberSource-Specific Configuration QFormLayout::FieldsStayAtSizeHint CyberSource Options: None XLabel QLabel
xlabel.h
qt-client-4.1.0/guiclient/configureCC.cpp000066400000000000000000000365021217451700100202760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ // TODO: move individual credit card config to separate classes like cybersource #include "configureCC.h" #include #include #include "configauthorizedotnetprocessor.h" #include "configcybersourceprocessor.h" #include "configureEncryption.h" #include "creditcardprocessor.h" bool shownEncryptedMsg = false; /** @ingroup creditcards @class configureCC @brief This is the master setup window for configuring the credit card subsystem. */ configureCC::configureCC(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { setupUi(this); if (name) setObjectName(name); connect(_ccCompany, SIGNAL(currentIndexChanged(int)), this, SLOT(sCCCompanyChanged(int))); _enableChargePreauth->setVisible(false); _enableCredit->setVisible(false); // these ids must match the pages in the stack widget _ccCompany->append(0, "Authorize.Net", "AN"); _ccCompany->append(1, "YourPay", "YP"); _ccCompany->append(2, "CyberSource", "CS"); _ccCompany->append(3, "External", "EXT"); if (_metrics->boolean("CCEnablePaymentech")) _ccCompany->append(4, "Paymentech", "PT"); ConfigAuthorizeDotNetProcessor *an = new ConfigAuthorizeDotNetProcessor(this); _configcclist.append(an); _ccWidgetStack->insertWidget(_ccWidgetStack->indexOf(_yourPayStack), an); ConfigCyberSourceProcessor *cs = new ConfigCyberSourceProcessor(this); _configcclist.append(cs); _ccWidgetStack->insertWidget(_ccWidgetStack->indexOf(_externalStack), cs); _ccAccept->setChecked(_metrics->boolean("CCAccept")); _ccTest->setChecked(_metrics->boolean("CCTest")); _ccValidDays->setValue(_metrics->value("CCValidDays").toInt()); _ccCompany->setCurrentIndex(_ccCompany->findText(_metrics->value("CCCompany"))); _ccWidgetStack->setCurrentIndex(_ccCompany->currentIndex()); sCCCompanyChanged(_ccCompany->currentIndex()); _ccServer->setText(_metrics->value("CCServer")); _ccPort->setText(_metrics->value("CCPort")); _ccUseProxyServer->setChecked(_metrics->boolean("CCUseProxyServer")); _ccProxyServer->setText(_metrics->value("CCProxyServer")); _ccProxyPort->setText(_metrics->value("CCProxyPort")); XSqlQuery ccbankq("SELECT * FROM ccbank;"); ccbankq.exec(); while (ccbankq.next()) { if (ccbankq.value("ccbank_ccard_type").toString() == "A") _amexBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); else if (ccbankq.value("ccbank_ccard_type").toString() == "D") _discoverBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); else if (ccbankq.value("ccbank_ccard_type").toString() == "M") _mastercardBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); /* TODO: wait until we support paypal? else if (ccbankq.value("ccbank_ccard_type").toString() == "P") _paypalBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); */ else if (ccbankq.value("ccbank_ccard_type").toString() == "V") _visaBank->setId(ccbankq.value("ccbank_bankaccnt_id").toInt()); } if (ccbankq.lastError().type() != QSqlError::NoError) systemError(this, ccbankq.lastError().text(), __FILE__, __LINE__); _ccYPWinPathPEM->setText(_metrics->value("CCYPWinPathPEM")); _ccYPLinPathPEM->setText(_metrics->value("CCYPLinPathPEM")); _ccYPMacPathPEM->setText(_metrics->value("CCYPMacPathPEM")); _ccYPLinkShield->setChecked(_metrics->boolean("CCYPLinkShield")); _ccYPLinkShieldMax->setValue(_metrics->value("CCYPLinkShieldMax").toInt()); _confirmPreauth->setChecked(_metrics->boolean("CCConfirmPreauth")); _confirmCharge->setChecked(_metrics->boolean("CCConfirmCharge")); _confirmChargePreauth->setChecked(_metrics->boolean("CCConfirmChargePreauth")); _confirmCredit->setChecked(_metrics->boolean("CCConfirmCredit")); _enablePreauth->setChecked(_metrics->boolean("CCEnablePreauth")); _enableCharge->setChecked(_metrics->boolean("CCEnableCharge")); _enableChargePreauth->setChecked(_metrics->boolean("CCEnableChargePreauth")); _enableCredit->setChecked(_metrics->boolean("CCEnableCredit")); _printReceipt->setChecked(_metrics->boolean("CCPrintReceipt")); _cvvRequired->setChecked(_metrics->boolean("CCRequireCVV")); QString str = _metrics->value("CCCVVCheck"); if (str == "F") _cvvReject->setChecked(true); else if (str == "W") _cvvWarn->setChecked(true); else // if (str == "X") _cvvNone->setChecked(true); str = _metrics->value("CCCVVErrors"); _cvvNotMatch->setChecked(str.contains("N")); _cvvNotProcessed->setChecked(str.contains("P")); _cvvNotOnCard->setChecked(str.contains("S")); _cvvInvalidIssuer->setChecked(str.contains("U")); str = _metrics->value("CCAvsCheck"); if (str == "F") _avsReject->setChecked(true); else if (str == "W") _avsWarn->setChecked(true); else // if (str == "X") _avsNone->setChecked(true); str = _metrics->value("CCAvsAddr"); _avsAddrNotMatch->setChecked(str.contains("N")); _avsAddrNotAvail->setChecked(str.contains("X")); str = _metrics->value("CCAvsZIP"); _avsZIPNotMatch->setChecked(str.contains("N")); _avsZIPNotAvail->setChecked(str.contains("X")); str = _metrics->value("CCTestResult"); if (str == "F") _testsAllFail->setChecked(true); else if (str == "S") _testsSomeFail->setChecked(true); else // if (str == "P") _testsAllPass->setChecked(true); if (0 != _metricsenc) { _ccLogin->setText(_metricsenc->value("CCLogin")); _ccPassword->setText(_metricsenc->value("CCPassword")); _ccProxyLogin->setText(_metricsenc->value("CCProxyLogin")); _ccProxyPassword->setText(_metricsenc->value("CCProxyPassword")); _ccYPStoreNum->setText(_metricsenc->value("CCYPStoreNum")); _ccPTDivisionNumber->setText(_metricsenc->value("CCPTDivisionNumber")); } else { _ccLogin->setEnabled(false); _ccPassword->setEnabled(false); _ccProxyLogin->setEnabled(false); _ccProxyPassword->setEnabled(false); _ccYPStoreNum->setEnabled(false); _ccPTDivisionNumber->setEnabled(false); } XAbstractConfigure *encryption = new configureEncryption(this); if (encryption) { encryption->setObjectName("_encryption"); _keyPage->layout()->addWidget(encryption); QPushButton *encbutton = encryption->findChild("_save"); if (encbutton) encbutton->hide(); encbutton = encryption->findChild("_close"); if (encbutton) encbutton->hide(); encryption->show(); } else if (_metricsenc == 0 && !shownEncryptedMsg) { QMessageBox::critical( this, tr("Cannot Read Configuration"), tr("

Cannot read encrypted information from database.")); shownEncryptedMsg = true; } } configureCC::~configureCC() { // no need to delete child widgets, Qt does it all for us } void configureCC::languageChange() { retranslateUi(this); } bool configureCC::sSave() { emit saving(); _metrics->set("CCAccept", _ccAccept->isChecked()); _metrics->set("CCTest", _ccTest->isChecked()); _metrics->set("CCValidDays", _ccValidDays->value()); _metrics->set("CCCompany", _ccCompany->currentText()); _metrics->set("CCServer", _ccServer->text()); _metrics->set("CCPort", _ccPort->text()); _metrics->set("CCUseProxyServer", _ccUseProxyServer->isChecked()); _metrics->set("CCProxyServer", _ccProxyServer->text()); _metrics->set("CCProxyPort", _ccProxyPort->text()); XSqlQuery ccbankq; ccbankq.prepare("SELECT setCCBankAccnt(:cctype, :bankaccnt_id) AS result;"); ccbankq.bindValue(":cctype", "A"); if (_amexBank->isValid()) ccbankq.bindValue(":bankaccnt_id", _amexBank->id()); else ccbankq.bindValue(":bankaccnt_id", QVariant()); ccbankq.exec(); if (ccbankq.lastError().type() != QSqlError::NoError) { systemError(this, ccbankq.lastError().text(), __FILE__, __LINE__); _amexBank->setFocus(); return false; } ccbankq.bindValue(":cctype", "D"); if (_discoverBank->isValid()) ccbankq.bindValue(":bankaccnt_id", _discoverBank->id()); else ccbankq.bindValue(":bankaccnt_id", QVariant()); ccbankq.exec(); if (ccbankq.lastError().type() != QSqlError::NoError) { systemError(this, ccbankq.lastError().text(), __FILE__, __LINE__); _discoverBank->setFocus(); return false; } ccbankq.bindValue(":cctype", "M"); if (_mastercardBank->isValid()) ccbankq.bindValue(":bankaccnt_id", _mastercardBank->id()); else ccbankq.bindValue(":bankaccnt_id", QVariant()); ccbankq.exec(); if (ccbankq.lastError().type() != QSqlError::NoError) { systemError(this, ccbankq.lastError().text(), __FILE__, __LINE__); _mastercardBank->setFocus(); return false; } /* ccbankq.bindValue(":cctype", "P"); if (_paypalBank->isValid()) ccbankq.bindValue(":bankaccnt_id", _paypalBank->id()); else ccbankq.bindValue(":bankaccnt_id", QVariant()); ccbankq.exec(); if (ccbankq.lastError().type() != QSqlError::NoError) { systemError(this, ccbankq.lastError().text(), __FILE__, __LINE__); _paypalBank->setFocus(); return false; } */ ccbankq.bindValue(":cctype", "V"); if (_visaBank->isValid()) ccbankq.bindValue(":bankaccnt_id", _visaBank->id()); else ccbankq.bindValue(":bankaccnt_id", QVariant()); ccbankq.exec(); if (ccbankq.lastError().type() != QSqlError::NoError) { systemError(this, ccbankq.lastError().text(), __FILE__, __LINE__); _visaBank->setFocus(); return false; } _metrics->set("CCYPWinPathPEM", _ccYPWinPathPEM->text()); _metrics->set("CCYPLinPathPEM", _ccYPLinPathPEM->text()); _metrics->set("CCYPMacPathPEM", _ccYPMacPathPEM->text()); _metrics->set("CCYPLinkShield", _ccYPLinkShield->isChecked()); _metrics->set("CCYPLinkShieldMax", _ccYPLinkShieldMax->text()); _metrics->set("CCConfirmPreauth", _confirmPreauth->isChecked()); _metrics->set("CCConfirmCharge", _confirmCharge->isChecked()); _metrics->set("CCConfirmChargePreauth", _confirmChargePreauth->isChecked()); _metrics->set("CCConfirmCredit", _confirmCredit->isChecked()); _metrics->set("CCEnablePreauth", _enablePreauth->isChecked()); _metrics->set("CCEnableCharge", _enableCharge->isChecked()); _metrics->set("CCEnableChargePreauth", _enableChargePreauth->isChecked()); _metrics->set("CCEnableCredit", _enableCredit->isChecked()); _metrics->set("CCPrintReceipt", _printReceipt->isChecked()); _metrics->set("CCRequireCVV", _cvvRequired->isChecked()); if(_cvvNone->isChecked()) _metrics->set("CCCVVCheck", QString("X")); else if(_cvvWarn->isChecked()) _metrics->set("CCCVVCheck", QString("W")); else if(_cvvReject->isChecked()) _metrics->set("CCCVVCheck", QString("F")); if(_avsNone->isChecked()) _metrics->set("CCAvsCheck", QString("X")); else if(_avsWarn->isChecked()) _metrics->set("CCAvsCheck", QString("W")); else if(_avsReject->isChecked()) _metrics->set("CCAvsCheck", QString("F")); QString str; if (_cvvNotMatch->isChecked()) str += "N"; if (_cvvNotProcessed->isChecked()) str += "P"; if (_cvvNotOnCard->isChecked()) str += "S"; if (_cvvInvalidIssuer->isChecked()) str += "U"; _metrics->set("CCCVVErrors", str); if (_avsAddrNotMatch->isChecked() && _avsAddrNotAvail->isChecked()) _metrics->set("CCAvsAddr", QString("NX")); else if (_avsAddrNotMatch->isChecked()) _metrics->set("CCAvsAddr", QString("N")); else if (_avsAddrNotAvail->isChecked()) _metrics->set("CCAvsAddr", QString("X")); if (_avsZIPNotMatch->isChecked() && _avsZIPNotAvail->isChecked()) _metrics->set("CCAvsZIP", QString("NX")); else if (_avsZIPNotMatch->isChecked()) _metrics->set("CCAvsZIP", QString("N")); else if (_avsZIPNotAvail->isChecked()) _metrics->set("CCAvsZIP", QString("X")); if(_testsAllFail->isChecked()) _metrics->set("CCTestResult", QString("F")); else if(_testsSomeFail->isChecked()) _metrics->set("CCTestResult", QString("S")); else if(_testsAllPass->isChecked()) _metrics->set("CCTestResult", QString("P")); _metrics->load(); if (0 != _metricsenc) { _metricsenc->set("CCLogin", _ccLogin->text()); _metricsenc->set("CCPassword", _ccPassword->text()); _metricsenc->set("CCProxyLogin", _ccProxyLogin->text()); _metricsenc->set("CCProxyPassword", _ccProxyPassword->text()); _metricsenc->set("CCYPStoreNum", _ccYPStoreNum->text()); _metricsenc->set("CCPTDivisionNumber", _ccPTDivisionNumber->text()); _metricsenc->load(); } for (int i = 0; i < _configcclist.size(); i++) if (! _configcclist.at(i)->sSave()) return false; if (_ccAccept->isChecked()) { CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(_ccCompany->currentText()); if (! cardproc) { QMessageBox::warning(this, tr("Error getting Credit Card Processor"), tr("

Internal error finding the right Credit Card " "Processor. The application saved what it could " "but you should re-open this window and double-" "check all of the settings before continuing.")); } else if (cardproc && cardproc->testConfiguration() != 0) { if (QMessageBox::question(this, tr("Invalid Credit Card Configuration"), tr("

The configuration has been saved but " "at least one configuration option appears " "to be invalid:

%1" "

Would you like to fix it now?") .arg(cardproc->errorMsg()), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes) return false; } } configureEncryption *encryption = _keyPage->findChild("_encryption"); if (encryption && ! encryption->sSave()) return false; return true; } // TODO: move this to the Config*Processor classes void configureCC::sCCCompanyChanged(const int /*pindex*/) { if (_ccCompany->code() == "AN") { _fraudDetectionIgnoredLit->setText(tr("For Authorize.Net please configure " "CVV and AVS using the Merchant " "Interface.")); _ccPasswordLit->setText(tr("Transaction Key:")); _cvvCheckGroup->setEnabled(false); _cvvFailGroup->setEnabled(false); _avsCheckGroup->setEnabled(false); _avsFailGroup->setEnabled(false); } else if (_ccCompany->code() == "YP") { _fraudDetectionIgnoredLit->setText(""); _ccPasswordLit->setText(tr("Password:")); _cvvCheckGroup->setEnabled(true); _cvvFailGroup->setEnabled(true); _avsCheckGroup->setEnabled(true); _avsFailGroup->setEnabled(true); } else if (_ccCompany->code() == "PT") { _fraudDetectionIgnoredLit->setText(""); _ccPasswordLit->setText(tr("Password:")); } else if (_ccCompany->code() == "CS") { _ccLoginLit->setText(tr("Merchant Id:")); _ccPasswordLit->setText(tr("Transaction Key:")); } else if (_ccCompany->code() == "EXT") { } } qt-client-4.1.0/guiclient/configureCC.h000066400000000000000000000021211217451700100177310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGURECC_H #define CONFIGURECC_H #include #include "guiclient.h" #include "xabstractconfigure.h" #include "ui_configureCC.h" class ConfigCreditCardProcessor; class configureCC : public XAbstractConfigure, public Ui::configureCC { Q_OBJECT public: configureCC(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureCC(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); virtual void sCCCompanyChanged(const int); protected: QList _configcclist; signals: void saving(); }; #endif // CONFIGURECC_H qt-client-4.1.0/guiclient/configureCC.ui000066400000000000000000001271411217451700100201310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureCC 0 0 671 616 Credit Card Configuration 12 Accept Credit Cards Work in Test Mode 5 Verification Service: 0 0 0 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 3 General Confirm Transaction Pre-Authorization Direct Charge Charge Pre-Authorization Credit Enable Transaction on Sales Order 0 Pre-Authorization Direct Charge false Charge Pre-Authorization false Credit General Options Print Receipts Qt::Vertical 20 0 5 Number of days Pre-Authorizations are valid for: 1 30 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 5 5 Default Bank Accounts: American Express: _amexBank true [ Don't accept this card ] XComboBox::ARBankAccounts Discover: _discoverBank true [ Don't accept this card ] XComboBox::ARBankAccounts MasterCard: _mastercardBank true [ Don't accept this card ] XComboBox::ARBankAccounts Visa: _visaBank true [ Don't accept this card ] XComboBox::ARBankAccounts Qt::Horizontal 40 20 Qt::Vertical 20 94 Fraud Detection Require Card Verification Value/Code (CVV) Card Verification Do not check true Warn if failure Reject if failure true Address Verification Service Do not check true Warn on failed AVS check Reject on failed AVS check Fail CVV Check If: Code does not match CVV was not processed Card has no code Card issuer is not certified Fail AVS check If: Address does not match Address comparison not available ZIP does not match ZIP comparison not available Qt::Vertical 0 0 Qt::Vertical 0 0 Server Server Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 0 Qt::Horizontal QSizePolicy::Preferred 5 20 Port: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Login: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::PasswordEchoOnEdit Use Proxy Server true false Server Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 0 Qt::Horizontal QSizePolicy::Preferred 5 20 Port: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Login: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::PasswordEchoOnEdit Qt::Horizontal 176 20 Qt::Vertical 20 0 Service Options 0 YourPay Options: 5 0 true Link Shield: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Store Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Enabled Qt::Horizontal QSizePolicy::Fixed 10 20 false Reject if Score Exceeds: false 100 Digital Certificate (PEM File) Location: Windows: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Linux: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Mac: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter In Test Mode, transactions should <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">tooltip</p></body></html> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">whatsthis</p></body></html> Always Fail (Be Declined or Marked as Duplicates) Sometimes Fail Always Succeed If Possible true Qt::Vertical QSizePolicy::Expanding 20 0 External Processing Options: None Qt::AlignCenter Qt::Vertical 20 40 Paymentech Options: Division Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical 20 40 Key File 0 0 XComboBox QComboBox

xcombobox.h
XLabel QLabel
xlabel.h
_ccAccept _ccTest _ccCompany tabWidget _confirmPreauth _confirmCharge _confirmChargePreauth _confirmCredit _enablePreauth _ccYPLinkShield _enableCharge _enableChargePreauth _enableCredit _printReceipt _ccValidDays _amexBank _discoverBank _mastercardBank _visaBank _cvvRequired _cvvNone _cvvWarn _cvvReject _cvvNotMatch _cvvNotProcessed _cvvNotOnCard _cvvInvalidIssuer _avsNone _avsWarn _avsReject _avsAddrNotMatch _avsAddrNotAvail _avsZIPNotMatch _avsZIPNotAvail _ccServer _ccPort _ccLogin _ccPassword _ccUseProxyServer _ccProxyServer _ccProxyPort _ccProxyLogin _ccProxyPassword _testsAllFail _testsSomeFail _testsAllPass _ccYPWinPathPEM _ccPTDivisionNumber _ccYPMacPathPEM _ccYPLinPathPEM _ccYPStoreNum _ccYPLinkShieldMax _ccCompany activated(int) _ccWidgetStack setCurrentIndex(int) 176 100 47 161 _ccYPLinkShield toggled(bool) _ccYPLinkShieldMaxLit setEnabled(bool) 112 166 123 169 _ccYPLinkShield toggled(bool) _ccYPLinkShieldMax setEnabled(bool) 112 166 131 169 qt-client-4.1.0/guiclient/configureCRM.cpp000066400000000000000000000231611217451700100204270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureCRM.h" #include #include #include #include #include "guiclient.h" #include "mqlutil.h" configureCRM::configureCRM(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { XSqlQuery configureconfigureCRM; setupUi(this); if (name) setObjectName(name); _nextInNumber->setValidator(omfgThis->orderVal()); _nextAcctNumber->setValidator(omfgThis->orderVal()); configureconfigureCRM.exec( "SELECT orderseq_number AS innumber " " FROM orderseq" " WHERE (orderseq_name='IncidentNumber');" ); if (configureconfigureCRM.first()) _nextInNumber->setText(configureconfigureCRM.value("innumber")); configureconfigureCRM.exec( "SELECT orderseq_number AS acnumber " " FROM orderseq" " WHERE (orderseq_name='CRMAccountNumber');" ); if (configureconfigureCRM.first()) _nextAcctNumber->setText(configureconfigureCRM.value("acnumber")); QString metric = _metrics->value("CRMAccountNumberGeneration"); if (metric == "M") _acctGeneration->setCurrentIndex(0); else if (metric == "A") _acctGeneration->setCurrentIndex(1); else if (metric == "O") _acctGeneration->setCurrentIndex(2); _useProjects->setChecked(_metrics->boolean("UseProjects")); _autoCreate->setChecked(_metrics->boolean("AutoCreateProjectsForOrders")); _opportunityChangeLog->setChecked(_metrics->boolean("OpportunityChangeLog")); if (! _metrics->value("DefaultAddressCountry").isEmpty()) _country->setText(_metrics->value("DefaultAddressCountry")); _strictCountries->setChecked(_metrics->boolean("StrictAddressCountry")); _strictCountries->setEnabled(! _strictCountries->isChecked()); if (! _strictCountries->isChecked()) { connect(_strictCountries, SIGNAL(toggled(bool)), this, SLOT(sStrictCountryChanged(bool))); } _incidentsPublicShow->setChecked(_metrics->boolean("IncidentsPublicPrivate")); _incidentsPublicDefault->setChecked(_metrics->boolean("IncidentPublicDefault")); if (_metrics->boolean("EnableBatchManager")) { _incdtEmailProfile->populate("SELECT ediprofile_id, ediprofile_name " "FROM xtbatch.ediprofile " "WHERE (ediprofile_type='email');"); _incdtEmailProfile->setId(_metrics->value("CRMIncidentEmailProfile").toInt()); _incdtCreated->setChecked(_metrics->boolean("CRMIncidentEmailCreated")); _incdtAssigned->setChecked(_metrics->boolean("CRMIncidentEmailAssigned")); _incdtStatus->setChecked(_metrics->boolean("CRMIncidentEmailStatus")); _incdtUpdated->setChecked(_metrics->boolean("CRMIncidentEmailUpdated")); _incdtComments->setChecked(_metrics->boolean("CRMIncidentEmailComments")); } else { _incdtEmailProfileLit->hide(); _incdtEmailProfile->hide(); _incdtDelGroup->hide(); } configureconfigureCRM.exec("SELECT * FROM status WHERE (status_type='INCDT') ORDER BY status_seq;"); configureconfigureCRM.first(); _new->setText(configureconfigureCRM.value("status_color")); configureconfigureCRM.next(); _feedback->setText(configureconfigureCRM.value("status_color")); configureconfigureCRM.next(); _confirmed->setText(configureconfigureCRM.value("status_color")); configureconfigureCRM.next(); _assigned->setText(configureconfigureCRM.value("status_color")); configureconfigureCRM.next(); _resolved->setText(configureconfigureCRM.value("status_color")); configureconfigureCRM.next(); _closed->setText(configureconfigureCRM.value("status_color")); adjustSize(); } configureCRM::~configureCRM() { // no need to delete child widgets, Qt does it all for us } void configureCRM::languageChange() { retranslateUi(this); } bool configureCRM::sSave() { emit saving(); const char *numberGenerationTypes[] = { "M", "A", "O" }; XSqlQuery configq; configq.prepare( "SELECT setNextIncidentNumber(:innumber);" ); configq.bindValue(":innumber", _nextInNumber->text().toInt()); configq.exec(); configq.prepare( "SELECT setNextCRMAccountNumber(:acnumber);" ); configq.bindValue(":acnumber", _nextAcctNumber->text().toInt()); configq.exec(); _metrics->set("CRMAccountNumberGeneration", QString(numberGenerationTypes[_acctGeneration->currentIndex()])); _metrics->set("UseProjects", _useProjects->isChecked()); _metrics->set("AutoCreateProjectsForOrders", (_autoCreate->isChecked() && _useProjects->isChecked())); _metrics->set("OpportunityChangeLog", _opportunityChangeLog->isChecked()); if (_country->isValid()) _metrics->set("DefaultAddressCountry", _country->currentText()); else _metrics->set("DefaultAddressCountry", QString("")); _metrics->set("StrictAddressCountry", _strictCountries->isChecked()); _metrics->set("IncidentsPublicPrivate", _incidentsPublicShow->isChecked()); _metrics->set("IncidentPublicDefault", _incidentsPublicDefault->isChecked()); if (_metrics->boolean("EnableBatchManager")) { _metrics->set("CRMIncidentEmailProfile", _incdtEmailProfile->id()); _metrics->set("CRMIncidentEmailCreated" , _incdtCreated->isChecked()); _metrics->set("CRMIncidentEmailAssigned" , _incdtAssigned->isChecked()); _metrics->set("CRMIncidentEmailStatus" , _incdtStatus->isChecked()); _metrics->set("CRMIncidentEmailUpdated" , _incdtUpdated->isChecked()); _metrics->set("CRMIncidentEmailComments" , _incdtComments->isChecked()); } configq.prepare("UPDATE status SET status_color = :color " "WHERE ((status_type='INCDT') " " AND (status_code=:code));"); configq.bindValue(":code", "N"); configq.bindValue(":color", _new->text()); configq.exec(); configq.bindValue(":code", "F"); configq.bindValue(":color", _feedback->text()); configq.exec(); configq.bindValue(":code", "C"); configq.bindValue(":color", _confirmed->text()); configq.exec(); configq.bindValue(":code", "A"); configq.bindValue(":color", _assigned->text()); configq.exec(); configq.bindValue(":code", "R"); configq.bindValue(":color", _resolved->text()); configq.exec(); configq.bindValue(":code", "L"); configq.bindValue(":color", _closed->text()); configq.exec(); return true; } /* TODO: introduced option in 3.4.0beta2. deprecate it in the future with strict as the standard. */ void configureCRM::sStrictCountryChanged(bool p) { if (p) { bool mqlloaded; MetaSQLQuery mql = mqlLoad("crm", "strictcountrycheck", &mqlloaded); if (! mqlloaded) { QMessageBox::critical(this, tr("Query Not Found"), tr("

The application could not find the MetaSQL " "query crm-strictcountrycheck.")); _strictCountries->setChecked(false); return; } ParameterList params; params.append("count"); XSqlQuery activeq = mql.toQuery(params); params.append("showAll"); XSqlQuery allq = mql.toQuery(params); if (activeq.first()) { int result = activeq.value("counter").toInt(); if (result > 0) { QMessageBox::warning(this, tr("Invalid Countries"), tr("

The database contains invalid countries in " "active records, such as addresses and open " "sales orders. Please correct these records " "before turning on strict country checking. " "You may download and install the " "fixCountry.gz package " "to help with this task.")); _strictCountries->setChecked(false); return; } } else if (activeq.lastError().type() != QSqlError::NoError) { systemError(this, activeq.lastError().databaseText(), __FILE__, __LINE__); return; } if (allq.first()) { int result = allq.value("counter").toInt(); if (result > 0) { QMessageBox::StandardButton answer = QMessageBox::question(this, tr("Invalid Countries"), tr("

The database contains invalid countries " "in historical records, such as closed " "sales orders and posted invoices. If you " "do not correct these countries before " "turning on strict country checking, you " "may lose country values if you open these " "documents and save them again. You may " "download and install the fixCountry.gz " "package to help update your records." "

Are you sure you want to turn on " "strict country checking?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if (answer == QMessageBox::No) { _strictCountries->setChecked(false); return; } } } else if (allq.lastError().type() != QSqlError::NoError) { systemError(this, allq.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/configureCRM.h000066400000000000000000000017121217451700100200720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGURECRM_H #define CONFIGURECRM_H #include "xabstractconfigure.h" #include "ui_configureCRM.h" class configureCRM : public XAbstractConfigure, public Ui::configureCRM { Q_OBJECT public: configureCRM(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureCRM(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); virtual void sStrictCountryChanged(bool); signals: void saving(); }; #endif // CONFIGURECRM_H qt-client-4.1.0/guiclient/configureCRM.ui000066400000000000000000000417501217451700100202660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureCRM 0 0 709 425 CRM Configuration Account # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _acctGeneration Manual Automatic Automatic, Allow Override Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextAcctNumber 100 0 100 16777215 Incident # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _incidentGeneration false Automatic Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextInNumber 100 0 100 16777215 Qt::Horizontal 40 20 Use Projects false Automatically create Projects for Sales Orders Post Opportunity Changes to the Change Log Show Incident Public checkbox Incidents Public by Default Default Incident Email Delivery Profile: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _incdtEmailProfile true Qt::Horizontal 0 20 true Email Delivery when Incident Created Assigned Status Changed Updated Comments added Incident Status Colors New: Assigned: Feedback: Resolved: Confirmed: Closed: Default Country for Addresses: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _country true [ no default ] XComboBox::Countries Qt::Horizontal 40 20 Enforce Valid Country Names true Qt::Vertical 20 0 Qt::Horizontal 0 20 XCheckBox QCheckBox

xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
1
_acctGeneration _nextAcctNumber _incidentGeneration _nextInNumber _useProjects _autoCreate _opportunityChangeLog _incidentsPublicShow _incidentsPublicDefault _incdtEmailProfile _incdtCreated _incdtAssigned _incdtStatus _incdtUpdated _incdtComments _new _feedback _confirmed _assigned _resolved _closed _country _strictCountries _useProjects toggled(bool) _autoCreate setEnabled(bool) 269 93 246 117 qt-client-4.1.0/guiclient/configureEncryption.cpp000066400000000000000000000033261217451700100221410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureEncryption.h" #include extern bool shownEncryptedMsg; configureEncryption::configureEncryption(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { setupUi(this); if (name) setObjectName(name); if (_metricsenc == 0 && !shownEncryptedMsg) { QMessageBox::critical( this, tr("Cannot Read Configuration"), tr("

Cannot read encrypted information from database.")); shownEncryptedMsg = true; } _ccEncKeyName->setText(_metrics->value("CCEncKeyName")); _ccWinEncKey->setText(_metrics->value("CCWinEncKey")); _ccLinEncKey->setText(_metrics->value("CCLinEncKey")); _ccMacEncKey->setText(_metrics->value("CCMacEncKey")); } configureEncryption::~configureEncryption() { // no need to delete child widgets, Qt does it all for us } void configureEncryption::languageChange() { retranslateUi(this); } bool configureEncryption::sSave() { emit saving(); _metrics->set("CCEncKeyName", _ccEncKeyName->text()); _metrics->set("CCWinEncKey", _ccWinEncKey->text()); _metrics->set("CCLinEncKey", _ccLinEncKey->text()); _metrics->set("CCMacEncKey", _ccMacEncKey->text()); _metrics->load(); if (0 != _metricsenc) _metricsenc->load(); return true; } qt-client-4.1.0/guiclient/configureEncryption.h000066400000000000000000000017531217451700100216100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREENCRYPTION_H #define CONFIGUREENCRYPTION_H #include "guiclient.h" #include "xabstractconfigure.h" #include "ui_configureEncryption.h" class configureEncryption : public XAbstractConfigure, public Ui::configureEncryption { Q_OBJECT public: configureEncryption(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureEncryption(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); signals: void saving(); }; #endif // CONFIGUREENCRYPTION_H qt-client-4.1.0/guiclient/configureEncryption.ui000066400000000000000000000127061217451700100217760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureEncryption 0 0 415 218 Encryption Configuration Encryption Key location for Credit Card and EFT processing: Key File Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ccEncKeyName keyfile.txt <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">whatsthis for a label with a buddy that's an empty text field</p></body></html> Windows Location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Linux Location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::Directory Mac Location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::Directory Qt::Vertical 40 0 Qt::Horizontal 0 20 FileCluster QWidget

filecluster.h
_ccEncKeyName qt-client-4.1.0/guiclient/configureGL.cpp000066400000000000000000000762461217451700100203240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureGL.h" #include #include #include #include "configureEncryption.h" #include "guiclient.h" configureGL::configureGL(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { XSqlQuery configureconfigureGL; setupUi(this); if (name) setObjectName(name); _yearend->setType(GLCluster::cEquity); _gainLoss->setType(GLCluster::cExpense); _discrepancy->setType(GLCluster::cExpense); // AP _nextAPMemoNumber->setValidator(omfgThis->orderVal()); configureconfigureGL.exec("SELECT currentAPMemoNumber() AS result;"); if (configureconfigureGL.first()) _nextAPMemoNumber->setText(configureconfigureGL.value("result")); _achGroup->setVisible(_metrics->boolean("ACHSupported")); if (_metrics->boolean("ACHSupported")) { _achGroup->setChecked(_metrics->boolean("ACHEnabled")); _nextACHBatchNumber->setValidator(omfgThis->orderVal()); if (! _metrics->value("ACHCompanyId").trimmed().isEmpty()) _companyId->setText(_metrics->value("ACHCompanyId")); if (! _metrics->value("ACHCompanyIdType").trimmed().isEmpty()) { if (_metrics->value("ACHCompanyIdType").trimmed() == "D") _companyIdIsDUNS->setChecked(true); else if (_metrics->value("ACHCompanyIdType").trimmed() == "E") _companyIdIsEIN->setChecked(true); else if (_metrics->value("ACHCompanyIdType").trimmed() == "O") _companyIdIsOther->setChecked(true); } if (! _metrics->value("ACHCompanyName").trimmed().isEmpty()) _companyName->setText(_metrics->value("ACHCompanyName")); QString eftsuffix = _metrics->value("ACHDefaultSuffix").trimmed(); QString eftRregex = _metrics->value("EFTRoutingRegex").trimmed(); QString eftAregex = _metrics->value("EFTAccountRegex").trimmed(); QString eftproc = _metrics->value("EFTFunction").trimmed(); if (eftsuffix.isEmpty()) _eftAch->setChecked(true); else if (eftsuffix == ".ach" && eftRregex == _eftAchRoutingRegex->text() && eftAregex == _eftAchAccountRegex->text() && eftproc == _eftAchFunction->text()) _eftAch->setChecked(true); else if (eftsuffix == ".aba" && eftRregex == _eftAbaRoutingRegex->text() && eftAregex == _eftAbaAccountRegex->text() && eftproc == _eftAbaFunction->text()) _eftAba->setChecked(true); else { _eftCustom->setChecked(true); _eftCustomRoutingRegex->setText(eftRregex); _eftCustomAccountRegex->setText(eftAregex); _eftCustomFunction->setText(eftproc); int suffixidx = _eftCustomSuffix->findText(_metrics->value("ACHDefaultSuffix")); if (suffixidx < 0) { _eftCustomSuffix->insertItem(0, _metrics->value("ACHDefaultSuffix")); _eftCustomSuffix->setCurrentIndex(0); } else _eftCustomSuffix->setCurrentIndex(suffixidx); } configureconfigureGL.exec("SELECT currentNumber('ACHBatch') AS result;"); if (configureconfigureGL.first()) _nextACHBatchNumber->setText(configureconfigureGL.value("result")); } _reqInvoiceReg->setChecked(_metrics->boolean("ReqInvRegVoucher")); _reqInvoiceMisc->setChecked(_metrics->boolean("ReqInvMiscVoucher")); _recurringVoucherBuffer->setValue(_metrics->value("RecurringVoucherBuffer").toInt()); // AR _nextARMemoNumber->setValidator(omfgThis->orderVal()); _nextCashRcptNumber->setValidator(omfgThis->orderVal()); configureconfigureGL.exec("SELECT currentARMemoNumber() AS result;"); if (configureconfigureGL.first()) _nextARMemoNumber->setText(configureconfigureGL.value("result")); else if (configureconfigureGL.lastError().type() != QSqlError::NoError) systemError(this, configureconfigureGL.lastError().databaseText(), __FILE__, __LINE__); configureconfigureGL.exec("SELECT currentCashRcptNumber() AS result;"); if (configureconfigureGL.first()) _nextCashRcptNumber->setText(configureconfigureGL.value("result")); else if (configureconfigureGL.lastError().type() != QSqlError::NoError) systemError(this, configureconfigureGL.lastError().databaseText(), __FILE__, __LINE__); _hideApplyto->setChecked(_metrics->boolean("HideApplyToBalance")); _customerDeposits->setChecked(_metrics->boolean("EnableCustomerDeposits")); _discountTax->setChecked(_metrics->boolean("CreditTaxDiscount")); _name->setText(_metrics->value("remitto_name")); _address->setLine1(_metrics->value("remitto_address1")); _address->setLine2(_metrics->value("remitto_address2")); _address->setLine3(_metrics->value("remitto_address3")); _address->setCity(_metrics->value("remitto_city")); _address->setState(_metrics->value("remitto_state")); _address->setPostalCode(_metrics->value("remitto_zipcode")); _address->setCountry(_metrics->value("remitto_country")); _phone->setText(_metrics->value("remitto_phone")); _warnLate->setChecked(_metrics->boolean("AutoCreditWarnLateCustomers")); if(!_metrics->value("DefaultAutoCreditWarnGraceDays").isEmpty()) _graceDays->setValue(_metrics->value("DefaultAutoCreditWarnGraceDays").toInt()); _incdtCategory->setId(_metrics->value("DefaultARIncidentStatus").toInt()); _closeARIncdt->setChecked(_metrics->boolean("AutoCloseARIncident")); _recurringBuffer->setValue(_metrics->value("RecurringInvoiceBuffer").toInt()); // GL _mainSize->setValue(_metrics->value("GLMainSize").toInt()); bool extConsolAllowed = _metrics->value("Application") != "PostBooks"; _externalConsolidation->setVisible(extConsolAllowed); if (_metrics->value("GLCompanySize").toInt() == 0) { _useCompanySegment->setChecked(FALSE); _externalConsolidation->setChecked(FALSE); _yearend->setId(_metrics->value("YearEndEquityAccount").toInt()); _gainLoss->setId(_metrics->value("CurrencyGainLossAccount").toInt()); _discrepancy->setId(_metrics->value("GLSeriesDiscrepancyAccount").toInt()); } else { _useCompanySegment->setChecked(TRUE); _companySegmentSize->setValue(_metrics->value("GLCompanySize").toInt()); _externalConsolidation->setChecked(_metrics->boolean("MultiCompanyFinancialConsolidation") && extConsolAllowed); } if (_metrics->value("GLProfitSize").toInt() == 0) { _useProfitCenters->setChecked(FALSE); _cacheuseProfitCenters = false; } else { _useProfitCenters->setChecked(TRUE); _profitCenterSize->setValue(_metrics->value("GLProfitSize").toInt()); _ffProfitCenters->setChecked(_metrics->boolean("GLFFProfitCenters")); _cacheuseProfitCenters = true; } if (_metrics->value("GLSubaccountSize").toInt() == 0) { _useSubaccounts->setChecked(FALSE); _cacheuseSubaccounts = false; } else { _useSubaccounts->setChecked(TRUE); _subaccountSize->setValue(_metrics->value("GLSubaccountSize").toInt()); _ffSubaccounts->setChecked(_metrics->boolean("GLFFSubaccounts")); _cacheuseSubaccounts = true; } switch(_metrics->value("CurrencyExchangeSense").toInt()) { case 1: _localToBase->setChecked(TRUE); break; case 0: default: _baseToLocal->setChecked(TRUE); } _mandatoryNotes->setChecked(_metrics->boolean("MandatoryGLEntryNotes")); _manualFwdUpdate->setChecked(_metrics->boolean("ManualForwardUpdate")); _taxauth->setId(_metrics->value("DefaultTaxAuthority").toInt()); // TODO hide default tax authority, not used? _taxGroup->setVisible(FALSE); _int2gl->setChecked(_metrics->boolean("InterfaceToGL")); _cacheint2gl = _int2gl->isChecked(); _intap2gl->setChecked(_metrics->boolean("InterfaceAPToGL")); _cacheintap2gl = _intap2gl->isChecked(); _intar2gl->setChecked(_metrics->boolean("InterfaceARToGL")); _cacheintar2gl = _intar2gl->isChecked(); if (_metrics->boolean("UseJournals")) { _journal->setChecked(true); XSqlQuery qry; qry.exec("SELECT count(sltrans_id) > 0 AS result FROM sltrans WHERE (NOT sltrans_posted);"); qry.first(); if (qry.value("result").toBool()) _postGroup->setEnabled(false); } else _generalLedger->setChecked(true); XSqlQuery check; check.exec("SELECT accnt_id FROM accnt WHERE LENGTH(accnt_company) > 0 LIMIT 1;"); if (check.first()) { _useCompanySegment->setChecked(true); _useCompanySegment->setEnabled(false); } check.exec("SELECT accnt_id FROM accnt WHERE LENGTH(accnt_profit) > 0 LIMIT 1;"); if (check.first()) { _useProfitCenters->setChecked(true); _cacheuseProfitCenters = true; } check.exec("SELECT accnt_id FROM accnt WHERE LENGTH(accnt_sub) > 0 LIMIT 1;"); if (check.first()) { _useSubaccounts->setChecked(true); _cacheuseSubaccounts = true; } adjustSize(); } configureGL::~configureGL() { // no need to delete child widgets, Qt does it all for us } void configureGL::languageChange() { retranslateUi(this); } bool configureGL::sSave() { XSqlQuery configureSave; emit saving(); if (!_cacheint2gl && _int2gl->isChecked()) { configureSave.exec("SELECT costcat_id " "FROM costcat " "WHERE (costcat_asset_accnt_id IS NULL) " " OR (costcat_liability_accnt_id IS NULL) " " OR (costcat_adjustment_accnt_id IS NULL) " " OR (costcat_purchprice_accnt_id IS NULL) " " OR (costcat_scrap_accnt_id IS NULL) " " OR (costcat_invcost_accnt_id IS NULL) " " OR (costcat_wip_accnt_id IS NULL) " " OR (costcat_shipasset_accnt_id IS NULL) " " OR (costcat_mfgscrap_accnt_id IS NULL) " " OR (costcat_freight_accnt_id IS NULL) " " OR (costcat_exp_accnt_id IS NULL) " " OR (costcat_asset_accnt_id = -1) " " OR (costcat_liability_accnt_id = -1) " " OR (costcat_adjustment_accnt_id = -1) " " OR (costcat_purchprice_accnt_id = -1) " " OR (costcat_scrap_accnt_id = -1) " " OR (costcat_invcost_accnt_id = -1) " " OR (costcat_wip_accnt_id = -1) " " OR (costcat_shipasset_accnt_id = -1) " " OR (costcat_mfgscrap_accnt_id = -1) " " OR (costcat_freight_accnt_id = -1) " " OR (costcat_exp_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign G/L Accounts to all Cost Categories"); return false; } if (_metrics->boolean("MultiWhs") && _metrics->boolean("Transforms")) { configureSave.exec("SELECT costcat_id " "FROM costcat " "WHERE (costcat_transform_accnt_id IS NULL) " " OR (costcat_transform_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign a Transform Clearing G/L Account to all Cost Categories"); return false; } } if (_metrics->boolean("MultiWhs")) { configureSave.exec("SELECT costcat_id " "FROM costcat " "WHERE (costcat_toliability_accnt_id IS NULL) " " OR (costcat_toliability_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign a Transfer Order Liability Clearing G/L Account to all Cost Categories"); return false; } } if (_metrics->boolean("Routings")) { configureSave.exec("SELECT costcat_id " "FROM costcat " "WHERE (costcat_laboroverhead_accnt_id IS NULL) " " OR (costcat_laboroverhead_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign a Labor and Overhead Costs G/L Account to all Cost Categories"); return false; } } } if (!_cacheintap2gl && _intap2gl->isChecked()) { configureSave.exec("SELECT expcat_id " "FROM expcat " "WHERE (expcat_exp_accnt_id IS NULL) " " OR (expcat_liability_accnt_id IS NULL) " " OR (expcat_freight_accnt_id IS NULL) " " OR (expcat_purchprice_accnt_id IS NULL) " " OR (expcat_exp_accnt_id = -1) " " OR (expcat_liability_accnt_id = -1) " " OR (expcat_freight_accnt_id = -1) " " OR (expcat_purchprice_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign G/L Accounts to all Expense Categories"); return false; } configureSave.exec("SELECT apaccnt_id " "FROM apaccnt " "WHERE (apaccnt_ap_accnt_id IS NULL) " " OR (apaccnt_prepaid_accnt_id IS NULL) " " OR (apaccnt_discount_accnt_id IS NULL) " " OR (apaccnt_ap_accnt_id = -1) " " OR (apaccnt_prepaid_accnt_id = -1) " " OR (apaccnt_discount_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign G/L Accounts to all Payables Assignments"); return false; } } if (!_cacheintar2gl && _intar2gl->isChecked()) { configureSave.exec("SELECT araccnt_id " "FROM araccnt " "WHERE (araccnt_ar_accnt_id IS NULL) " " OR (araccnt_prepaid_accnt_id IS NULL) " " OR (araccnt_discount_accnt_id IS NULL) " " OR (araccnt_freight_accnt_id IS NULL) " " OR (araccnt_ar_accnt_id = -1) " " OR (araccnt_prepaid_accnt_id = -1) " " OR (araccnt_discount_accnt_id = -1) " " OR (araccnt_freight_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign G/L Accounts to all Receivables Assignments"); return false; } if (_metrics->boolean("EnableCustomerDeposits")) { configureSave.exec("SELECT araccnt_id " "FROM araccnt " "WHERE (araccnt_deferred_accnt_id IS NULL) " " OR (araccnt_deferred_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign a Deferred Revenue G/L Account to all Receivables Assignments"); return false; } } configureSave.exec("SELECT salesaccnt_id " "FROM salesaccnt " "WHERE (salesaccnt_sales_accnt_id IS NULL) " " OR (salesaccnt_credit_accnt_id IS NULL) " " OR (salesaccnt_cos_accnt_id IS NULL) " " OR (salesaccnt_sales_accnt_id = -1) " " OR (salesaccnt_credit_accnt_id = -1) " " OR (salesaccnt_cos_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign G/L Accounts to all Sales Assignments"); return false; } if (_metrics->boolean("EnableReturnAuth")) { configureSave.exec("SELECT salesaccnt_id " "FROM salesaccnt " "WHERE (salesaccnt_returns_accnt_id IS NULL) " " OR (salesaccnt_cor_accnt_id IS NULL) " " OR (salesaccnt_cow_accnt_id IS NULL) " " OR (salesaccnt_returns_accnt_id = -1) " " OR (salesaccnt_cor_accnt_id = -1) " " OR (salesaccnt_cow_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign a Returns G/L Account to all Sales Assignments"); return false; } } configureSave.exec("SELECT salescat_id " "FROM salescat " "WHERE (salescat_sales_accnt_id IS NULL) " " OR (salescat_prepaid_accnt_id IS NULL) " " OR (salescat_ar_accnt_id IS NULL) " " OR (salescat_sales_accnt_id = -1) " " OR (salescat_prepaid_accnt_id = -1) " " OR (salescat_ar_accnt_id = -1) " "LIMIT 1;"); if (configureSave.first()) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), "You must assign G/L Accounts to all Sales Categories"); return false; } } if (_metrics->boolean("ACHSupported")) { QString tmpCompanyId = _companyId->text(); struct { bool condition; QString msg; QWidget *widget; } error[] = { { _achGroup->isChecked() && _companyId->text().isEmpty(), tr("Please enter a default Company Id if you are going to create " "ACH files."), _companyId }, { _achGroup->isChecked() && (_companyIdIsEIN->isChecked() || _companyIdIsDUNS->isChecked()) && tmpCompanyId.remove("-").size() != 9, tr("EIN, TIN, and DUNS numbers are all 9 digit numbers. Other " "characters (except dashes for readability) are not allowed."), _companyId }, { _achGroup->isChecked() && _companyIdIsOther->isChecked() && _companyId->text().size() > 10, tr("Company Ids must be 10 characters or shorter (not counting dashes " "in EIN's, TIN's, and DUNS numbers)."), _companyId }, { _achGroup->isChecked() && ! (_companyIdIsEIN->isChecked() || _companyIdIsDUNS->isChecked() || _companyIdIsOther->isChecked()), tr("Please mark whether the Company Id is an EIN, TIN, DUNS number, " "or Other."), _companyIdIsEIN } }; for (unsigned int i = 0; i < sizeof(error) / sizeof(error[0]); i++) if (error[i].condition) { QMessageBox::critical(this, tr("Cannot Save Accounting Configuration"), error[i].msg); error[i].widget->setFocus(); return false; } } if (!_useProfitCenters->isChecked() && _cacheuseProfitCenters) { // Turning off Profit Centers segment, perform some checks if (QMessageBox::question(this, tr("Use Profit Centers?"), tr("You are turning off the use of " "Profit Centers. This will clear " "the Profit Centers from your " "Chart of Accounts. Are you sure " "you want to do this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No ) == QMessageBox::Yes) { XSqlQuery check; check.exec("SELECT flitem_id FROM flitem " "WHERE (LENGTH(flitem_profit) > 0) " " AND (flitem_profit <> 'All') " "LIMIT 1;"); if (check.first()) { QMessageBox::critical(this, tr("Cannot turn off Profit Centers"), "You must remove Profit Centers from all Financial Reports " "before you can turn off Profit Centers."); return false; } check.exec("SELECT accnt_id FROM accnt o WHERE EXISTS " "( SELECT 'x' FROM accnt i " " WHERE i.accnt_number=o.accnt_number" " AND i.accnt_company=o.accnt_company" " AND i.accnt_sub=o.accnt_sub" " AND i.accnt_id <> o.accnt_id );"); if (check.first()) { QMessageBox::critical(this, tr("Cannot turn off Profit Centers"), "Turning off Profit Centers would result in duplicate G/L Accounts."); return false; } } else return false; } if (!_useSubaccounts->isChecked() && _cacheuseSubaccounts) { // Turning off Subaccounts segment, perform some checks if (QMessageBox::question(this, tr("Use Subaccounts?"), tr("You are turning off the use of " "Subaccounts. This will clear " "the Subaccounts from your " "Chart of Accounts. Are you sure " "you want to do this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No ) == QMessageBox::Yes) { XSqlQuery check; check.exec("SELECT flitem_id FROM flitem " "WHERE (LENGTH(flitem_sub) > 0) " " AND (flitem_sub <> 'All') " "LIMIT 1;"); if (check.first()) { QMessageBox::critical(this, tr("Cannot turn off Subaccounts"), "You must remove Subaccounts from all Financial Reports " "before you can turn off Subaccounts."); return false; } check.exec("SELECT accnt_id FROM accnt o WHERE EXISTS " "( SELECT 'x' FROM accnt i " " WHERE i.accnt_number=o.accnt_number" " AND i.accnt_company=o.accnt_company" " AND i.accnt_profit=o.accnt_profit" " AND i.accnt_id <> o.accnt_id );"); if (check.first()) { QMessageBox::critical(this, tr("Cannot turn off Subaccounts"), "Turning off Subaccounts would result in duplicate G/L Accounts."); return false; } } else return false; } if (!_useProfitCenters->isChecked() && _cacheuseProfitCenters && !_useSubaccounts->isChecked() && _cacheuseSubaccounts) { // Turning off both Profit Centers and Subaccounts segments, perform some checks XSqlQuery check; check.exec("SELECT accnt_id FROM accnt o WHERE EXISTS " "( SELECT 'x' FROM accnt i " " WHERE i.accnt_number=o.accnt_number" " AND i.accnt_company=o.accnt_company" " AND i.accnt_id <> o.accnt_id );"); if (check.first()) { QMessageBox::critical(this, tr("Cannot turn off Profit Centers and Subaccounts"), "Turning off both Profit Centers and Subaccounts would result in duplicate G/L Accounts."); return false; } } // AP configureSave.prepare("SELECT setNextAPMemoNumber(:armemo_number) AS result;"); configureSave.bindValue(":armemo_number", _nextAPMemoNumber->text().toInt()); configureSave.exec(); if (_metrics->boolean("ACHSupported")) { _metrics->set("ACHEnabled", _achGroup->isChecked()); if (_achGroup->isChecked()) { _metrics->set("ACHCompanyId", _companyId->text().trimmed()); if (_companyId->text().trimmed().length() > 0) { if (_companyIdIsDUNS->isChecked()) _metrics->set("ACHCompanyIdType", QString("D")); else if (_companyIdIsEIN->isChecked()) _metrics->set("ACHCompanyIdType", QString("E")); else if (_companyIdIsOther->isChecked()) _metrics->set("ACHCompanyIdType", QString("O")); } _metrics->set("ACHCompanyName", _companyName->text().trimmed()); if (_eftAch->isChecked()) { _metrics->set("ACHDefaultSuffix", _eftAchSuffix->text().trimmed()); _metrics->set("EFTRoutingRegex", _eftAchRoutingRegex->text()); _metrics->set("EFTAccountRegex", _eftAchAccountRegex->text()); _metrics->set("EFTFunction", _eftAchFunction->text()); } else if (_eftAba->isChecked()) { _metrics->set("ACHDefaultSuffix", _eftAbaSuffix->text().trimmed()); _metrics->set("EFTRoutingRegex", _eftAbaRoutingRegex->text()); _metrics->set("EFTAccountRegex", _eftAbaAccountRegex->text()); _metrics->set("EFTFunction", _eftAbaFunction->text()); } else { _metrics->set("ACHDefaultSuffix", _eftCustomSuffix->currentText().trimmed()); _metrics->set("EFTRoutingRegex", _eftCustomRoutingRegex->text().trimmed()); _metrics->set("EFTAccountRegex", _eftCustomAccountRegex->text().trimmed()); _metrics->set("EFTFunction", _eftCustomFunction->text().trimmed()); } configureSave.prepare("SELECT setNextNumber('ACHBatch', :number) AS result;"); configureSave.bindValue(":number", _nextACHBatchNumber->text().toInt()); configureSave.exec(); } } _metrics->set("ReqInvRegVoucher", _reqInvoiceReg->isChecked()); _metrics->set("ReqInvMiscVoucher", _reqInvoiceMisc->isChecked()); _metrics->set("RecurringVoucherBuffer", _recurringVoucherBuffer->value()); // AR configureSave.prepare("SELECT setNextARMemoNumber(:armemo_number) AS result;"); configureSave.bindValue(":armemo_number", _nextARMemoNumber->text().toInt()); configureSave.exec(); if (configureSave.lastError().type() != QSqlError::NoError) { systemError(this, configureSave.lastError().databaseText(), __FILE__, __LINE__); _nextARMemoNumber->setFocus(); return false; } configureSave.prepare("SELECT setNextCashRcptNumber(:cashrcpt_number) AS result;"); configureSave.bindValue(":cashrcpt_number", _nextCashRcptNumber->text().toInt()); configureSave.exec(); if (configureSave.lastError().type() != QSqlError::NoError) { systemError(this, configureSave.lastError().databaseText(), __FILE__, __LINE__); _nextCashRcptNumber->setFocus(); return false; } _metrics->set("HideApplyToBalance", _hideApplyto->isChecked()); _metrics->set("EnableCustomerDeposits", _customerDeposits->isChecked()); _metrics->set("CreditTaxDiscount", _discountTax->isChecked()); _metrics->set("remitto_name", _name->text().trimmed()); _metrics->set("remitto_address1", _address->line1().trimmed()); _metrics->set("remitto_address2", _address->line2().trimmed()); _metrics->set("remitto_address3", _address->line3().trimmed()); _metrics->set("remitto_city", _address->city().trimmed()); _metrics->set("remitto_state", _address->state().trimmed()); _metrics->set("remitto_zipcode", _address->postalCode().trimmed()); _metrics->set("remitto_country", _address->country().trimmed()); _metrics->set("remitto_phone", _phone->text().trimmed()); _address->save(AddressCluster::CHANGEONE); _metrics->set("AutoCreditWarnLateCustomers", _warnLate->isChecked()); if(_warnLate->isChecked()) _metrics->set("DefaultAutoCreditWarnGraceDays", _graceDays->value()); _metrics->set("RecurringInvoiceBuffer", _recurringBuffer->value()); _metrics->set("DefaultARIncidentStatus", _incdtCategory->id()); _metrics->set("AutoCloseARIncident", _closeARIncdt->isChecked()); // GL QAction *profitcenter = omfgThis->findChild("gl.profitCenterNumber"); QAction *subaccounts = omfgThis->findChild("gl.subaccountNumbers"); QAction *companyseg = omfgThis->findChild("gl.companies"); _metrics->set("GLMainSize", _mainSize->value()); if (_useCompanySegment->isChecked()) { _metrics->set("GLCompanySize", _companySegmentSize->value()); _metrics->set("MultiCompanyFinancialConsolidation", _externalConsolidation->isChecked()); } else { _metrics->set("GLCompanySize", 0); _metrics->set("MultiCompanyFinancialConsolidation", 0); _metrics->set("YearEndEquityAccount", _yearend->id()); _metrics->set("CurrencyGainLossAccount", _gainLoss->id()); _metrics->set("GLSeriesDiscrepancyAccount", _discrepancy->id()); } if(companyseg) companyseg->setEnabled(_useCompanySegment->isChecked()); if (_useProfitCenters->isChecked()) { _metrics->set("GLProfitSize", _profitCenterSize->value()); _metrics->set("GLFFProfitCenters", _ffProfitCenters->isChecked()); if(profitcenter) profitcenter->setEnabled(_privileges->check("MaintainChartOfAccounts")); } else { _metrics->set("GLProfitSize", 0); _metrics->set("GLFFProfitCenters", FALSE); if(profitcenter) profitcenter->setEnabled(FALSE); XSqlQuery update; update.exec("UPDATE accnt SET accnt_profit=NULL," " accnt_sub=CASE WHEN (accnt_sub='') THEN NULL ELSE accnt_sub END;"); if (update.lastError().type() != QSqlError::NoError) systemError(this, update.lastError().databaseText(), __FILE__, __LINE__); } if (_useSubaccounts->isChecked()) { _metrics->set("GLSubaccountSize", _subaccountSize->value()); _metrics->set("GLFFSubaccounts", _ffSubaccounts->isChecked()); if(subaccounts) subaccounts->setEnabled(_privileges->check("MaintainChartOfAccounts")); } else { _metrics->set("GLSubaccountSize", 0); _metrics->set("GLFFSubaccounts", FALSE); if(subaccounts) subaccounts->setEnabled(FALSE); XSqlQuery update; update.exec("UPDATE accnt SET accnt_sub=NULL," " accnt_profit=CASE WHEN (accnt_profit='') THEN NULL ELSE accnt_profit END;"); if (update.lastError().type() != QSqlError::NoError) systemError(this, update.lastError().databaseText(), __FILE__, __LINE__); } _metrics->set("UseJournals", _journal->isChecked()); if(_localToBase->isChecked()) _metrics->set("CurrencyExchangeSense", 1); else // if(_baseToLocal->isChecked()) _metrics->set("CurrencyExchangeSense", 0); _metrics->set("MandatoryGLEntryNotes", _mandatoryNotes->isChecked()); _metrics->set("ManualForwardUpdate", _manualFwdUpdate->isChecked()); _metrics->set("DefaultTaxAuthority", _taxauth->id()); _metrics->set("InterfaceToGL", _int2gl->isChecked()); _metrics->set("InterfaceAPToGL", _intap2gl->isChecked()); _metrics->set("InterfaceARToGL", _intar2gl->isChecked()); omfgThis->sConfigureGLUpdated(); if (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled") && omfgThis->_key.isEmpty()) { if (_privileges->check("ConfigureEncryption")) { if (QMessageBox::question(this, tr("Set Encryption?"), tr("Your encryption key is not set. You will " "not be able to configure electronic " "checking information for Vendors until you " "configure encryption. Would you like to do " "this now?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No ) == QMessageBox::Yes) return false; } else QMessageBox::question(this, tr("Set Encryption?"), tr("Your encryption key is not set. You will " "not be able to configure electronic " "checking information for Vendors until the " "system is configured to perform encryption.")); } return true; } qt-client-4.1.0/guiclient/configureGL.h000066400000000000000000000020471217451700100177550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREGL_H #define CONFIGUREGL_H #include "xabstractconfigure.h" #include "ui_configureGL.h" class configureGL : public XAbstractConfigure, public Ui::configureGL { Q_OBJECT public: configureGL(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureGL(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); private: bool _cacheint2gl; bool _cacheintap2gl; bool _cacheintar2gl; bool _cacheuseProfitCenters; bool _cacheuseSubaccounts; signals: void saving(); }; #endif // CONFIGUREGL_H qt-client-4.1.0/guiclient/configureGL.ui000066400000000000000000001611121217451700100201420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureGL 0 0 757 582 Accounting Configuration 0 General Ledger 0 Qt::Horizontal QSizePolicy::Fixed 10 20 Use Company Segment false 0 1 false Company Segment Size: _companySegmentSize 1 10 Qt::Horizontal 40 20 Enable External Company Consolidation 0 Qt::Horizontal QSizePolicy::Fixed 10 20 Use Profit Centers false 0 1 false Profit Center Segment Size: _profitCenterSize 1 10 1 Allow Free-Form Profit Centers Main 0 5 true Main Segment Size: _mainSize true 3 10 Qt::Horizontal QSizePolicy::Expanding 20 20 0 Qt::Horizontal QSizePolicy::Fixed 10 20 Use Subaccounts false 0 1 false 1 10 Allow Free-Form Subaccounts Subaccount Segment Size: _subaccountSize Transactions Post to Journal General Ledger Options: Manual Forward Update Trial Balances Mandatory notes for Manual Journal Entries Assignments true Retained Earnings: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Currency Gain/Loss: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus G/L Series Discrepancy : Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Accounts Payable Next Accounts Payable Memo #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextAPMemoNumber 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Enable EFT Check Printing true false Next Batch #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextACHBatchNumber 0 0 1 Company ID: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _companyId Company Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _companyName 23 is a(n): EIN/TIN DUNS Number Other Select an EFT Format ACH true ABA Custom .ach .aba Default Suffix false true .aba .ach .dat .txt false ^\d+$ ^(\d{3}-\d{3})|(\d{6}000)$ ^\d{9}$ Routing # Format Formatting Procedure formatAchChecks formatAbaChecks false stored procedure name Account # Format ^\d{4,17}$ ^\d{1,9}$ ^\d+$ Qt::Horizontal 0 20 Require Vendor Invoice # on: Regular Vouchers Miscellaneous Vouchers Qt::Horizontal 40 20 Recurring Voucher Buffer: _recurringVoucherBuffer 999 0 0 days Qt::Vertical QSizePolicy::Expanding 40 0 Accounts Receivable Next Receivables Memo #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextARMemoNumber 0 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 34 20 Next Cash Receipt #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextARMemoNumber 0 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 34 20 Hide 'Apply to Balance' button Enable Customer Deposits Remit-To Address 5 5 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus 5 Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Credit Warn Customers when Late true false 5 Default Grace Period Days: _graceDays 9999 30 Qt::Horizontal 40 20 Recurring Invoice Buffer: _recurringBuffer 999 0 0 days Default Incident Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::IncidentCategory Auto Close Incidents when Invoice Paid Qt::Horizontal 40 20 Credit Taxes for Early Payment Discounts Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 Global Meaning of Currency Exchange Rates: Base × Exchange Rate = Foreign Foreign × Exchange Rate = Base Default Tax Authority: _taxauth true None XComboBox::TaxAuths Qt::Horizontal QSizePolicy::MinimumExpanding 40 20 Interface Control Interface Inventory to General Ledger Interface A/P to General Ledger Interface A/R to General Ledger Qt::Vertical 20 40 Qt::Horizontal 335 20 AddressCluster QWidget
addresscluster.h
GLCluster QWidget
glcluster.h
XComboBox QComboBox
xcombobox.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
1
_tab _useCompanySegment _companySegmentSize _externalConsolidation _useProfitCenters _profitCenterSize _ffProfitCenters _mainSize _useSubaccounts _subaccountSize _ffSubaccounts _journal _mandatoryNotes _manualFwdUpdate _yearend _gainLoss _discrepancy _nextAPMemoNumber _achGroup _nextACHBatchNumber _companyId _companyIdIsEIN _companyIdIsDUNS _companyIdIsOther _companyName _eftAch _eftAba _eftCustom _eftCustomSuffix _eftCustomRoutingRegex _eftCustomAccountRegex _eftCustomFunction _reqInvoiceReg _reqInvoiceMisc _nextARMemoNumber _nextCashRcptNumber _hideApplyto _customerDeposits _name _address _phone _warnLate _graceDays _recurringBuffer _incdtCategory _closeARIncdt _baseToLocal _localToBase _taxauth _generalLedger _recurringVoucherBuffer _discountTax _int2gl _eftCustom toggled(bool) _eftCustomFunction setEnabled(bool) 113 385 562 384 _eftCustom toggled(bool) _eftCustomRoutingRegex setEnabled(bool) 113 385 376 384 _eftCustom toggled(bool) _eftCustomSuffix setEnabled(bool) 113 385 209 385 _useCompanySegment toggled(bool) _assignGroup setDisabled(bool) 208 61 378 446 _useCompanySegment toggled(bool) _useCompanySegmentGroup setEnabled(bool) 208 61 200 121 _useProfitCenters toggled(bool) _useProfitCentersGroup setEnabled(bool) 569 61 561 121 _useSubaccounts toggled(bool) _useSubaccountsGroup setEnabled(bool) 569 188 561 248
qt-client-4.1.0/guiclient/configureIE.cpp000066400000000000000000000310171217451700100203020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureIE.h" #include #include #include #include "storedProcErrorLookup.h" #include "atlasMap.h" #include "xsltMap.h" bool configureIE::userHasPriv() { return _privileges->check("ConfigureImportExport"); } configureIE::configureIE(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { setupUi(this); if (name) setObjectName(name); connect(_atlasMap, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sEditAtlasMap())); connect(_atlasMap, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_deleteAtlasMap, SIGNAL(clicked()), this, SLOT(sDeleteAtlasMap())); connect(_deleteMap, SIGNAL(clicked()), this, SLOT(sDeleteMap())); connect(_editAtlasMap, SIGNAL(clicked()), this, SLOT(sEditAtlasMap())); connect(_editMap, SIGNAL(clicked()), this, SLOT(sEditMap())); connect(_map, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sEditMap())); connect(_map, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_newAtlasMap, SIGNAL(clicked()), this, SLOT(sNewAtlasMap())); connect(_newMap, SIGNAL(clicked()), this, SLOT(sNewMap())); _map->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "xsltmap_name"); _map->addColumn(tr("Document Type"), -1, Qt::AlignLeft, true, "xsltmap_doctype"); _map->addColumn(tr("System Identifier"),-1, Qt::AlignLeft, true, "xsltmap_system"); _map->addColumn(tr("Import XSLT File"), -1, Qt::AlignLeft, true, "xsltmap_import"); _map->addColumn(tr("Export XSLT File"), -1, Qt::AlignLeft, true, "xsltmap_export"); _atlasMap->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "atlasmap_name"); _atlasMap->addColumn(tr("Type"), -1, Qt::AlignLeft, true, "atlasmap_filtertype"); _atlasMap->addColumn(tr("Matches"), -1, Qt::AlignLeft, true, "atlasmap_filter"); _atlasMap->addColumn(tr("Atlas File"), -1, Qt::AlignLeft, true, "atlasmap_atlas"); _atlasMap->addColumn(tr("CSV Map"), -1, Qt::AlignLeft, true, "atlasmap_map"); // TODO: fix these when support for an internal XSLT processor is enabled _internal->setEnabled(false); _internal->setVisible(false); _external->setVisible(false); #ifdef Q_WS_WIN _os->setCurrentIndex(1); #endif #ifdef Q_WS_MAC _os->setCurrentIndex(2); #endif sPopulate(); } configureIE::~configureIE() { // no need to delete child widgets, Qt does it all for us } void configureIE::languageChange() { retranslateUi(this); } bool configureIE::sSave() { emit saving(); if (_importErrorXMLHandling->isChecked() && _importErrorSelector->option() != FileMoveSelector::Suffix && _importErrorSelector->option() != FileMoveSelector::ChangeDir) { QMessageBox::critical(this, tr("Inconsistent Selection"), tr("

Please choose to add a suffix after errors, " "move the import file after errors, or " "uncheck '%1'.") .arg(_importErrorXMLHandling->text())); return false; } _metrics->set("XMLSuccessTreatment", _importSuccessSelector->code()); if (_internal->isChecked()) _metrics->set("XSLTLibrary", _internal->isChecked()); else if (_external->isChecked()) { if (_linuxCmd->text().isEmpty() && _macCmd->text().isEmpty() && _windowsCmd->text().isEmpty() && QMessageBox::question(this, tr("Incomplete Data"), tr("

XSLT is not configured. Some XML imports may fail. " "Would you like to fix this now?

"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes) { _tabs->setCurrentIndex(_tabs->indexOf(_mappingTab)); _linuxCmd->setFocus(); return false; } _metrics->set("XSLTLibrary", ! _external->isChecked()); } else { QMessageBox::critical(this, tr("Incomplete Data"), tr("

Please choose whether to use the internal " "XSLT processor or an external XSLT processor.")); _tabs->setCurrentIndex(_tabs->indexOf(_importTab)); _internal->setFocus(); return false; } _metrics->set("XSLTDefaultDirLinux", _xsltLinuxDir->text()); _metrics->set("XSLTDefaultDirMac", _xsltMacDir->text()); _metrics->set("XSLTDefaultDirWindows", _xsltWindowsDir->text()); _metrics->set("XSLTProcessorLinux", _linuxCmd->text()); _metrics->set("XSLTProcessorMac", _macCmd->text()); _metrics->set("XSLTProcessorWindows", _windowsCmd->text()); _metrics->set("XMLDefaultDirLinux", _importLinuxDir->text()); _metrics->set("XMLDefaultDirMac", _importMacDir->text()); _metrics->set("XMLDefaultDirWindows", _importWindowsDir->text()); _metrics->set("CSVAtlasDefaultDirLinux", _atlasLinuxDir->text()); _metrics->set("CSVAtlasDefaultDirMac", _atlasMacDir->text()); _metrics->set("CSVAtlasDefaultDirWindows", _atlasWindowsDir->text()); _metrics->set("XMLSuccessSuffix", _importSuccessSelector->suffix()); _metrics->set("XMLSuccessDir", _importSuccessSelector->destdir()); _metrics->set("ImportFailureTreatment", _importErrorSelector->code()); _metrics->set("ImportFailureSuffix", _importErrorSelector->suffix()); _metrics->set("ImportFailureDir", _importErrorSelector->destdir()); _metrics->set("ImportXMLCreateErrorFile", _importErrorXMLHandling->isChecked()); _metrics->set("XMLExportDefaultDirLinux", _exportLinuxDir->text()); _metrics->set("XMLExportDefaultDirMac", _exportMacDir->text()); _metrics->set("XMLExportDefaultDirWindows", _exportWindowsDir->text()); return true; } void configureIE::sPopulate() { _xsltLinuxDir->setText(_metrics->value("XSLTDefaultDirLinux")); _xsltMacDir->setText(_metrics->value("XSLTDefaultDirMac")); _xsltWindowsDir->setText(_metrics->value("XSLTDefaultDirWindows")); // TODO: start using Qt's XSLT processor _external->setChecked(TRUE); _linuxCmd->setText(_metrics->value("XSLTProcessorLinux")); _macCmd->setText(_metrics->value("XSLTProcessorMac")); _windowsCmd->setText(_metrics->value("XSLTProcessorWindows")); _importLinuxDir->setText(_metrics->value("XMLDefaultDirLinux")); _importMacDir->setText(_metrics->value("XMLDefaultDirMac")); _importWindowsDir->setText(_metrics->value("XMLDefaultDirWindows")); _atlasLinuxDir->setText(_metrics->value("CSVAtlasDefaultDirLinux")); _atlasMacDir->setText(_metrics->value("CSVAtlasDefaultDirMac")); _atlasWindowsDir->setText(_metrics->value("CSVAtlasDefaultDirWindows")); _importSuccessSelector->setCode(_metrics->value("XMLSuccessTreatment")); _importSuccessSelector->setDestdir(_metrics->value("XMLSuccessDir")); _importSuccessSelector->setSuffix(_metrics->value("XMLSuccessSuffix")); _importErrorSelector->setCode(_metrics->value("ImportFailureTreatment")); _importErrorSelector->setDestdir(_metrics->value("ImportFailureDir")); _importErrorSelector->setSuffix(_metrics->value("ImportFailureSuffix")); _importErrorXMLHandling->setChecked(_metrics->boolean("ImportXMLCreateErrorFile")); _exportLinuxDir->setText(_metrics->value("XMLExportDefaultDirLinux")); _exportMacDir->setText(_metrics->value("XMLExportDefaultDirMac")); _exportWindowsDir->setText(_metrics->value("XMLExportDefaultDirWindows")); sFillList(); } void configureIE::sFillList() { XSqlQuery xsltq("SELECT * FROM xsltmap ORDER BY xsltmap_name;"); xsltq.exec(); _map->populate(xsltq); if (xsltq.lastError().type() != QSqlError::NoError) { systemError(this, xsltq.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery atlasq("SELECT * FROM atlasmap ORDER BY atlasmap_name;"); atlasq.exec(); _atlasMap->populate(atlasq); if (atlasq.lastError().type() != QSqlError::NoError) { systemError(this, atlasq.lastError().databaseText(), __FILE__, __LINE__); return; } } void configureIE::sDeleteAtlasMap() { if (QMessageBox::question(this, tr("Delete Map?"), tr("Are you sure you want to delete this CSV Atlas Map?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("DELETE FROM atlasmap WHERE (atlasmap_id=:mapid);"); delq.bindValue(":mapid", _atlasMap->id()); delq.exec(); if (delq.lastError().type() != QSqlError::NoError) { systemError(this, delq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void configureIE::sDeleteMap() { if (QMessageBox::question(this, tr("Delete Map?"), tr("Are you sure you want to delete this XSLT Map?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("DELETE FROM xsltmap WHERE (xsltmap_id=:mapid);"); delq.bindValue(":mapid", _map->id()); delq.exec(); if (delq.lastError().type() != QSqlError::NoError) { systemError(this, delq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void configureIE::sEditAtlasMap() { ParameterList params; params.append("mode", "edit"); params.append("atlasmap_id", _atlasMap->id()); #if defined Q_WS_MACX params.append("defaultDir", _atlasMacDir->text()); #elif defined Q_WS_WIN params.append("defaultDir", _atlasWindowsDir->text()); #elif defined Q_WS_X11 params.append("defaultDir", _atlasLinuxDir->text()); #endif atlasMap newdlg(this); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) sFillList(); } void configureIE::sEditMap() { ParameterList params; params.append("mode", "edit"); params.append("xsltmap_id", _map->id()); #if defined Q_WS_MACX params.append("defaultDir", _atlasMacDir->text()); #elif defined Q_WS_WIN params.append("defaultDir", _atlasWindowsDir->text()); #elif defined Q_WS_X11 params.append("defaultDir", _atlasLinuxDir->text()); #endif xsltMap newdlg(this); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) sFillList(); } void configureIE::sNewAtlasMap() { ParameterList params; params.append("mode", "new"); #if defined Q_WS_MACX params.append("defaultDir", _atlasMacDir->text()); #elif defined Q_WS_WIN params.append("defaultDir", _atlasWindowsDir->text()); #elif defined Q_WS_X11 params.append("defaultDir", _atlasLinuxDir->text()); #endif atlasMap newdlg(this); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) sFillList(); } void configureIE::sNewMap() { ParameterList params; params.append("mode", "new"); #if defined Q_WS_MACX params.append("defaultDir", _atlasMacDir->text()); #elif defined Q_WS_WIN params.append("defaultDir", _atlasWindowsDir->text()); #elif defined Q_WS_X11 params.append("defaultDir", _atlasLinuxDir->text()); #endif xsltMap newdlg(this); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) sFillList(); } void configureIE::sPopulateMenu(QMenu* pMenu, QTreeWidgetItem* /* pItem */) { QAction *newAct = pMenu->addAction(tr("New...")); QAction *editAct = pMenu->addAction(tr("Edit...")); QAction *delAct = pMenu->addAction(tr("Delete")); if (sender() == _map) { newAct->setEnabled(xsltMap::userHasPriv()); editAct->setEnabled(xsltMap::userHasPriv()); delAct->setEnabled(xsltMap::userHasPriv()); connect(newAct, SIGNAL(triggered()), this, SLOT(sNewMap())); connect(editAct, SIGNAL(triggered()), this, SLOT(sEditMap())); connect(delAct, SIGNAL(triggered()), this, SLOT(sDeleteMap())); } else if (sender() == _atlasMap) { newAct->setEnabled(atlasMap::userHasPriv()); editAct->setEnabled(atlasMap::userHasPriv()); delAct->setEnabled(atlasMap::userHasPriv()); connect(newAct, SIGNAL(triggered()), this, SLOT(sNewAtlasMap())); connect(editAct, SIGNAL(triggered()), this, SLOT(sEditAtlasMap())); connect(delAct, SIGNAL(triggered()), this, SLOT(sDeleteAtlasMap())); } } qt-client-4.1.0/guiclient/configureIE.h000066400000000000000000000024001217451700100177410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREIE_H #define CONFIGUREIE_H #include "guiclient.h" #include "xabstractconfigure.h" #include "ui_configureIE.h" class configureIE : public XAbstractConfigure, public Ui::configureIE { Q_OBJECT public: configureIE(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureIE(); static bool userHasPriv(); public slots: virtual void sDeleteAtlasMap(); virtual void sDeleteMap(); virtual void sEditAtlasMap(); virtual void sEditMap(); virtual void sFillList(); virtual void sNewAtlasMap(); virtual void sNewMap(); virtual void sPopulate(); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*); virtual bool sSave(); protected slots: virtual void languageChange(); signals: void saving(); }; #endif // CONFIGUREIE_H qt-client-4.1.0/guiclient/configureIE.ui000066400000000000000000001073621217451700100201440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureIE 0 0 646 487 Configure Import and Export 12 Show file Paths for: Linux Windows Macintosh Qt::Horizontal 40 20 0 XSLT Settings Default XSLT File Directory 0 Linux Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Windows Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Macintosh Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Map of XSLT import and export filters: 0 0 New false Edit false Delete Qt::Vertical 20 0 XSLT Processor: Use Internal XSLT Processor true Use External XSLT Processor. Commands: false Qt::Horizontal 40 0 Qt::Horizontal QSizePolicy::Fixed 16 40 0 Linux Processor: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Windows Processor: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Macintosh Processor: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Import Settings 0 1 0 Directories Default Import File Directory 0 Linux Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Windows Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Macintosh Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Qt::Vertical 20 160 General Import Options Successful Imports: After successful import: Error Handling: QFormLayout::FieldsStayAtSizeHint After error during import: Note: If this is selected, XML files will always be handled as though they were successfully imported, even though an error file may have been produced. Save failed XML elements to a separate file true Qt::Vertical 20 0 CSV Import Options CSV Atlas Directory 0 QFileDialog::DirectoryOnly Linux Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Windows Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Macintosh Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Map of CSV file properties and CSV Atlas files: 10 New false Edit false Delete Qt::Vertical 20 40 XML Export Default Export File Directory 0 Linux Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Windows Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Macintosh Directory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFileDialog::DirectoryOnly Qt::Vertical 20 40 FileCluster QWidget

filecluster.h
FileMoveSelector QWidget
filemoveselector.h
XCheckBox QCheckBox
xcheckbox.h
XLabel QLabel
xlabel.h
XTreeWidget QTreeWidget
xtreewidget.h
1
_map _newMap _editMap _deleteMap _internal _external _linuxCmd _windowsCmd _macCmd _importTabs _atlasMap _newAtlasMap _editAtlasMap _deleteAtlasMap _map valid(bool) _editMap setEnabled(bool) 280 354 657 285 _map valid(bool) _deleteMap setEnabled(bool) 280 354 657 319 _external toggled(bool) _macCmd setEnabled(bool) 544 454 176 494 _external toggled(bool) _windowsCmd setEnabled(bool) 544 454 176 494 _external toggled(bool) _linuxCmd setEnabled(bool) 544 454 631 498 _atlasMap valid(bool) _editAtlasMap setEnabled(bool) 83 132 193 162 _atlasMap valid(bool) _deleteAtlasMap setEnabled(bool) 83 132 193 162 _os currentIndexChanged(int) _xsltDefaultDirStack setCurrentIndex(int) 256 38 381 162 _os currentIndexChanged(int) _processorStack setCurrentIndex(int) 256 38 415 467 _os currentIndexChanged(int) _importFileStack setCurrentIndex(int) 256 38 369 197 _os currentIndexChanged(int) _csvImportStack setCurrentIndex(int) 256 38 150 132 _os currentIndexChanged(int) _exportFileStack setCurrentIndex(int) 256 38 135 100 qt-client-4.1.0/guiclient/configureIM.cpp000066400000000000000000000274231217451700100203200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureIM.h" #include #include #include #include "guiclient.h" #include "errorReporter.h" #include "storedProcErrorLookup.h" configureIM::configureIM(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { XSqlQuery configureconfigureIM; setupUi(this); if (name) setObjectName(name); //Inventory //Disable multi-warehouse if PostBooks if (_metrics->value("Application") == "PostBooks") _multiWhs->hide(); else { configureconfigureIM.exec("SELECT * " "FROM whsinfo"); if (configureconfigureIM.size() > 1) { _multiWhs->setCheckable(FALSE); _multiWhs->setTitle("Multiple Sites"); } else _multiWhs->setChecked(_metrics->boolean("MultiWhs")); if (_metrics->value("TONumberGeneration") == "M") _toNumGeneration->setCurrentIndex(0); else if (_metrics->value("TONumberGeneration") == "A") _toNumGeneration->setCurrentIndex(1); else if (_metrics->value("TONumberGeneration") == "O") _toNumGeneration->setCurrentIndex(2); _toNextNum->setValidator(omfgThis->orderVal()); configureconfigureIM.exec( "SELECT orderseq_number AS tonumber " "FROM orderseq " "WHERE (orderseq_name='ToNumber');" ); if (configureconfigureIM.first()) _toNextNum->setText(configureconfigureIM.value("tonumber").toString()); else if (configureconfigureIM.lastError().type() != QSqlError::NoError) systemError(this, configureconfigureIM.lastError().databaseText(), __FILE__, __LINE__); _enableToShipping->setChecked(_metrics->boolean("EnableTOShipping")); _transferOrderChangeLog->setChecked(_metrics->boolean("TransferOrderChangeLog")); } _eventFence->setValue(_metrics->value("DefaultEventFence").toInt()); _itemSiteChangeLog->setChecked(_metrics->boolean("ItemSiteChangeLog")); _warehouseChangeLog->setChecked(_metrics->boolean("WarehouseChangeLog")); if (_metrics->boolean("PostCountTagToDefault")) _postToDefault->setChecked(TRUE); else _doNotPost->setChecked(TRUE); _defaultTransWhs->setId(_metrics->value("DefaultTransitWarehouse").toInt()); QString countSlipAuditing = _metrics->value("CountSlipAuditing"); if (countSlipAuditing == "N") _noSlipChecks->setChecked(TRUE); else if (countSlipAuditing == "W") _checkOnUnpostedWarehouse->setChecked(TRUE); else if (countSlipAuditing == "A") _checkOnUnposted->setChecked(TRUE); else if (countSlipAuditing == "X") _checkOnAllWarehouse->setChecked(TRUE); else if (countSlipAuditing == "B") _checkOnAll->setChecked(TRUE); QString avgCostingMethod = _metrics->value("CountAvgCostMethod"); if (avgCostingMethod == "STD") _useStdCost->setChecked(TRUE); else if (avgCostingMethod == "ACT") { _useAvgCost->setChecked(TRUE); _useActCost->setChecked(TRUE); } else if (avgCostingMethod == "AVG") _useAvgCost->setChecked(TRUE); else _useStdCost->setChecked(TRUE); if(_metrics->value("Application") != "PostBooks") { configureconfigureIM.exec("SELECT DISTINCT itemsite_controlmethod " "FROM itemsite " "WHERE (itemsite_controlmethod IN ('L','S'));"); if (configureconfigureIM.first()) { _lotSerial->setChecked(TRUE); _lotSerial->setEnabled(FALSE); } else _lotSerial->setChecked(_metrics->boolean("LotSerialControl")); } else _lotSerial->hide(); _setDefLoc->setChecked(_metrics->boolean("SetDefaultLocations")); // Shipping and Receiving QString metric = _metrics->value("ShipmentNumberGeneration"); if (metric == "A") _shipmentNumGeneration->setCurrentIndex(0); _nextShipmentNum->setValidator(omfgThis->orderVal()); configureconfigureIM.exec("SELECT setval('shipment_number_seq', nextval('shipment_number_seq') -1); " "SELECT currval('shipment_number_seq') AS shipment_number;"); if (configureconfigureIM.first()) _nextShipmentNum->setText(configureconfigureIM.value("shipment_number")); else if (configureconfigureIM.lastError().type() != QSqlError::NoError) systemError(this, configureconfigureIM.lastError().databaseText(), __FILE__, __LINE__); _kitInheritCOS->setChecked(_metrics->boolean("KitComponentInheritCOS")); _disallowReceiptExcess->setChecked(_metrics->boolean("DisallowReceiptExcessQty")); _warnIfReceiptDiffers->setChecked(_metrics->boolean("WarnIfReceiptQtyDiffers")); _recordPpvOnReceipt->setChecked(_metrics->boolean("RecordPPVonReceipt")); _tolerance->setValidator(omfgThis->percentVal()); _tolerance->setText(_metrics->value("ReceiptQtyTolerancePct")); _costAvg->setChecked(_metrics->boolean("AllowAvgCostMethod")); _costStd->setChecked(_metrics->boolean("AllowStdCostMethod")); _costJob->setChecked(_metrics->boolean("AllowJobCostMethod")); configureconfigureIM.prepare("SELECT count(*) AS result FROM itemsite WHERE(itemsite_costmethod='A');"); configureconfigureIM.exec(); if(configureconfigureIM.first() && configureconfigureIM.value("result").toInt() > 0) { _costAvg->setChecked(true); _costAvg->setEnabled(false); } configureconfigureIM.prepare("SELECT count(*) AS result FROM itemsite WHERE(itemsite_costmethod='S');"); configureconfigureIM.exec(); if(configureconfigureIM.first() && configureconfigureIM.value("result").toInt() > 0) { _costStd->setChecked(true); _costStd->setEnabled(false); } if(!_costAvg->isChecked() && !_costStd->isChecked()) _costStd->isChecked(); _asOfQOH->setChecked(_metrics->boolean("EnableAsOfQOH")); // Jobs at this time should always be checked and disabled // when this is changed in the future this should be replaced with // similar code checks as for Avg and Std cost _costJob->setChecked(true); _costJob->setEnabled(false); // Receipt Cost Override _receiptCostOverride->setChecked(_metrics->boolean("AllowReceiptCostOverride")); connect(_receiptCostOverride, SIGNAL(toggled(bool)), this, SLOT(sReceiptCostOverrideWarning())); this->setWindowTitle("Inventory Configuration"); // Requires Consolidated shipping package _shipByGroup->hide(); adjustSize(); } configureIM::~configureIM() { // no need to delete child widgets, Qt does it all for us } void configureIM::languageChange() { retranslateUi(this); } bool configureIM::sSave() { XSqlQuery configureSave; emit saving(); if(!_costAvg->isChecked() && !_costStd->isChecked()) { QMessageBox::warning(this, tr("No Cost selected"), tr("

You must have checked Standard Cost, " "Average Cost or both before saving.")); return false; } // Inventory _metrics->set("DefaultEventFence", _eventFence->value()); _metrics->set("ItemSiteChangeLog", _itemSiteChangeLog->isChecked()); _metrics->set("WarehouseChangeLog", _warehouseChangeLog->isChecked()); _metrics->set("PostCountTagToDefault", _postToDefault->isChecked()); _metrics->set("MultiWhs", ((!_multiWhs->isCheckable()) || (_multiWhs->isChecked()))); _metrics->set("LotSerialControl", _lotSerial->isChecked()); _metrics->set("SetDefaultLocations", _setDefLoc->isChecked()); _metrics->set("AllowAvgCostMethod", _costAvg->isChecked()); _metrics->set("AllowStdCostMethod", _costStd->isChecked()); _metrics->set("AllowJobCostMethod", _costJob->isChecked()); _metrics->set("AllowReceiptCostOverride", _receiptCostOverride->isChecked()); if (_toNumGeneration->currentIndex() == 0) _metrics->set("TONumberGeneration", QString("M")); else if (_toNumGeneration->currentIndex() == 1) _metrics->set("TONumberGeneration", QString("A")); else if (_toNumGeneration->currentIndex() == 2) _metrics->set("TONumberGeneration", QString("O")); if (_metrics->boolean("MultiWhs")) { configureSave.prepare("SELECT setNextNumber('ToNumber', :next) AS result;"); configureSave.bindValue(":next", _toNextNum->text()); configureSave.exec(); if (configureSave.first()) { int result = configureSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("setNextNumber", result), __FILE__, __LINE__); _toNextNum->setFocus(); return false; } } else if (configureSave.lastError().type() != QSqlError::NoError) { systemError(this, configureSave.lastError().databaseText(), __FILE__, __LINE__); _toNextNum->setFocus(); return false; } _metrics->set("DefaultTransitWarehouse", _defaultTransWhs->id()); _metrics->set("EnableTOShipping", _enableToShipping->isChecked()); _metrics->set("TransferOrderChangeLog", _transferOrderChangeLog->isChecked()); } if (_noSlipChecks->isChecked()) _metrics->set("CountSlipAuditing", QString("N")); else if (_checkOnUnpostedWarehouse->isChecked()) _metrics->set("CountSlipAuditing", QString("W")); else if (_checkOnUnposted->isChecked()) _metrics->set("CountSlipAuditing", QString("A")); else if (_checkOnAllWarehouse->isChecked()) _metrics->set("CountSlipAuditing", QString("X")); else if (_checkOnAll->isChecked()) _metrics->set("CountSlipAuditing", QString("B")); if (_useStdCost->isChecked()) _metrics->set("CountAvgCostMethod", QString("STD")); else if (_useActCost->isChecked()) _metrics->set("CountAvgCostMethod", QString("ACT")); else if (_useAvgCost->isChecked()) _metrics->set("CountAvgCostMethod", QString("AVG")); //Shipping and Receiving const char *numberGenerationTypes[] = { "A" }; _metrics->set("ShipmentNumberGeneration", QString(numberGenerationTypes[_shipmentNumGeneration->currentIndex()])); if (! _shipformCopies->save()) return false; _metrics->set("KitComponentInheritCOS", _kitInheritCOS->isChecked()); _metrics->set("DisallowReceiptExcessQty", _disallowReceiptExcess->isChecked()); _metrics->set("WarnIfReceiptQtyDiffers", _warnIfReceiptDiffers->isChecked()); _metrics->set("ReceiptQtyTolerancePct", _tolerance->text()); _metrics->set("RecordPPVonReceipt", _recordPpvOnReceipt->isChecked()); configureSave.prepare("SELECT setval('shipment_number_seq', :shipmentnumber);"); configureSave.bindValue(":shipmentnumber", _nextShipmentNum->text().toInt()); configureSave.exec(); if (configureSave.lastError().type() != QSqlError::NoError) { systemError(this, configureSave.lastError().databaseText(), __FILE__, __LINE__); _nextShipmentNum->setFocus(); return false; } if(_asOfQOH->isChecked() && !_metrics->boolean("EnableAsOfQOH")) { if(QMessageBox::question(this, tr("Enable As-Of QOH Reporting"), tr("

Enabling As-Of QOH reporting requires some processing to occur " "for it to work correctly. This may take some time. Would you like to continue?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { XSqlQuery qq; qq.exec("SELECT buildInvbal(itemsite_id)" " FROM itemsite;"); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Enabing As-Of Reporting"), qq, __FILE__, __LINE__)) return false; } else return false; } _metrics->set("EnableAsOfQOH", _asOfQOH->isChecked()); return true; } void configureIM::sReceiptCostOverrideWarning() { if (!_receiptCostOverride->isChecked()) QMessageBox::warning(this, tr("Receipt Cost Override Warning"), tr("Unposted or uninvoiced receipts could be negatively affected if this feature is disabled.")); } qt-client-4.1.0/guiclient/configureIM.h000066400000000000000000000017121217451700100177560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREIM_H #define CONFIGUREIM_H #include "xabstractconfigure.h" #include "ui_configureIM.h" class configureIM : public XAbstractConfigure, public Ui::configureIM { Q_OBJECT public: configureIM(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureIM(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); virtual void sReceiptCostOverrideWarning(); signals: void saving(); }; #endif // CONFIGUREIM_H qt-client-4.1.0/guiclient/configureIM.ui000066400000000000000000000731221217451700100201500ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureIM 0 0 711 656 I/M Module Configuration 0 Inventory 0 0 Defaults 5 5 5 Event Fence: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _eventFence 999 1 Days 0 0 Post Site Changes to the Change Log 0 0 Post Item Site Changes to the Change Log Enable Multiple Sites true false 6 0 0 0 Enable Shipping Interface from Transfer Order screen 0 0 Post Transfer Order Changes to the Change Log 0 0 0 0 WComboBox::Transit 0 0 Manual Automatic Automatic, Allow Override Transfer Order # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _toNumGeneration Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _toNextNum Default Transit Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _defaultTransWhs Qt::Horizontal 0 20 12 Enable Lot/Serial Control Set default Location while transacting Location-controlled Items Qt::Horizontal 0 20 Enable As-Of QOH reporting Costing Methods Allowed Average Standard true Job false When Count Tag Qty. exceeds Slip Qty. 0 5 Post Difference to Default Location, if any Do Not Post Count Tag true Count Slip # Auditing 0 5 Allow Duplications No Unposted Slip # Duplications in a Site true No Unposted Slip # Duplications No Slip # Duplications within a Site No Slip # Duplications When Posting a Count Tag for Avg. Cost Items Use Standard Cost true Use Average Cost Qt::Horizontal QSizePolicy::Fixed 5 20 false Use Actual Cost if no Average Cost Allow Inventory Receipt Cost Override (Average costing method only) Qt::Vertical QSizePolicy::Expanding 17 0 Shipping and Receiving Shipment # Generation: _shipmentNumGeneration Next #: _nextShipmentNum false 0 0 Automatic 0 0 Enable Shipping by Customer true false By default Print and Issue by: Customer Order Qt::Horizontal 40 20 0 0 Kit Components Inherit COS from Kit Parent 0 0 Disallow Purchase Order Receipt of Qty greater than ordered 0 0 Warn if Purchase Order Receipt Qty differs from receivable Qty 2 Qt::Horizontal QSizePolicy::Fixed 40 20 By the following amount: _tolerance % _tolerance false 200 16777215 Qt::Horizontal QSizePolicy::Expanding 0 20 0 0 Record Purchase Price Variance on Receipt Default Shipping Form Copies: ShippingFormCopies ShippingFormShowPrices ShippingFormWatermark WComboBox XComboBox

wcombobox.h
XComboBox QComboBox
xcombobox.h
XDocCopySetter QWidget
xdoccopysetter.h
XLineEdit QLineEdit
xlineedit.h
1
_tab _eventFence _warehouseChangeLog _itemSiteChangeLog _multiWhs _toNumGeneration _toNextNum _defaultTransWhs _enableToShipping _transferOrderChangeLog _lotSerial _setDefLoc _asOfQOH _costAvg _costStd _costJob _postToDefault _doNotPost _noSlipChecks _checkOnUnpostedWarehouse _checkOnUnposted _checkOnAllWarehouse _checkOnAll _shipmentNumGeneration _nextShipmentNum _shipByGroup _shipBy _kitInheritCOS _disallowReceiptExcess _warnIfReceiptDiffers _tolerance _useStdCost _useAvgCost _useActCost _recordPpvOnReceipt _warnIfReceiptDiffers toggled(bool) _tolerance setEnabled(bool) 409 108 363 135 _useAvgCost toggled(bool) _useActCost setEnabled(bool) 186 416 213 446 qt-client-4.1.0/guiclient/configureMS.cpp000066400000000000000000000030721217451700100203240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureMS.h" #include #include configureMS::configureMS(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { XSqlQuery configureconfigureMS; setupUi(this); if (name) setObjectName(name); _nextPlanNumber->setValidator(omfgThis->orderVal()); configureconfigureMS.exec("SELECT currentPlanNumber() AS result;"); if (configureconfigureMS.first()) _nextPlanNumber->setText(configureconfigureMS.value("result").toString()); int cid = _metrics->value("DefaultMSCalendar").toInt(); if(cid > 0) _calendar->setId(cid); this->setWindowTitle("Schedule Configuration"); } configureMS::~configureMS() { // no need to delete child widgets, Qt does it all for us } void configureMS::languageChange() { retranslateUi(this); } bool configureMS::sSave() { emit saving(); XSqlQuery configq; configq.prepare("SELECT setNextPlanNumber(:planord_number) AS result;"); configq.bindValue(":planord_number", _nextPlanNumber->text().toInt()); configq.exec(); _metrics->set("DefaultMSCalendar", _calendar->id()); return true; } qt-client-4.1.0/guiclient/configureMS.h000066400000000000000000000016521217451700100177730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREMS_H #define CONFIGUREMS_H #include "guiclient.h" #include "xabstractconfigure.h" #include "ui_configureMS.h" class configureMS : public XAbstractConfigure, public Ui::configureMS { Q_OBJECT public: configureMS(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureMS(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); signals: void saving(); }; #endif // CONFIGUREMS_H qt-client-4.1.0/guiclient/configureMS.ui000066400000000000000000000067061217451700100201660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureMS 0 0 355 135 M/S Module Configuration Next Planned Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight Default Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Qt::Horizontal 40 20 CalendarComboBox XComboBox
calendarTools.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_nextPlanNumber
qt-client-4.1.0/guiclient/configurePD.cpp000066400000000000000000000114751217451700100203160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configurePD.h" #include #include #include #include "storedProcErrorLookup.h" #include "guiclient.h" configurePD::configurePD(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { XSqlQuery configureconfigurePD; setupUi(this); if (name) setObjectName(name); _inactiveBomItems->setChecked(_metrics->boolean("AllowInactiveBomItems")); _exclusive->setChecked(_metrics->boolean("DefaultSoldItemsExclusive")); _changeLog->setChecked(_metrics->boolean("ItemChangeLog")); _allowDelete->setChecked(_metrics->boolean("AllowBOMItemDelete")); QString issueMethod = _metrics->value("DefaultWomatlIssueMethod"); if (issueMethod == "S") _issueMethod->setCurrentIndex(0); else if (issueMethod == "L") _issueMethod->setCurrentIndex(1); else if (issueMethod == "M") _issueMethod->setCurrentIndex(2); if(_metrics->value("Application") == "PostBooks") { _revControl->hide(); _transforms->hide(); } else { configureconfigurePD.exec("SELECT * FROM itemtrans LIMIT 1;"); if (configureconfigurePD.first()) { _transforms->setChecked(TRUE); _transforms->setEnabled(FALSE); } else _transforms->setChecked(_metrics->boolean("Transforms")); configureconfigurePD.exec("SELECT * FROM rev LIMIT 1;"); if (configureconfigurePD.first()) { _revControl->setChecked(TRUE); _revControl->setEnabled(FALSE); } else _revControl->setChecked(_metrics->boolean("RevControl")); } this->setWindowTitle("Products Configuration"); //adjustSize(); } configurePD::~configurePD() { // no need to delete child widgets, Qt does it all for us } void configurePD::languageChange() { retranslateUi(this); } bool configurePD::sSave() { XSqlQuery configureSave; emit saving(); if (!_metrics->boolean("RevControl") && (_revControl->isChecked())) { if (QMessageBox::warning(this, tr("Enable Revision Control"), tr("Enabling revision control will create control records " "for products that contain revision number data. This " "change can not be undone. Do you wish to proceed?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { _metrics->set("RevControl", TRUE); QString rsql = "SELECT createbomrev(bomhead_item_id,bomhead_revision) AS result " " FROM bomhead " " WHERE((COALESCE(bomhead_revision,'') <> '') " " AND (bomhead_rev_id=-1))"; if (_metrics->value("Application") != "Standard" && _metrics->value("Application") != "PostBooks") rsql += " UNION " "SELECT createboorev(boohead_item_id,boohead_revision) " " FROM boohead " " WHERE((COALESCE(boohead_revision,'') <> '') " " AND (boohead_rev_id=-1));"; configureSave.exec(rsql); if (configureSave.first() && (configureSave.value("result").toInt() < 0)) { systemError(this, storedProcErrorLookup("CreateRevision", configureSave.value("result").toInt()), __FILE__, __LINE__); _metrics->set("RevControl", FALSE); return false; } if (configureSave.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), configureSave.lastError().databaseText()); _metrics->set("RevControl", FALSE); return false; } } else return false; } _metrics->set("Transforms", ((_transforms->isChecked()) && (!_transforms->isHidden()))); _metrics->set("RevControl", ((_revControl->isChecked()) && (!_revControl->isHidden()))); _metrics->set("AllowInactiveBomItems", _inactiveBomItems->isChecked()); _metrics->set("DefaultSoldItemsExclusive", _exclusive->isChecked()); _metrics->set("ItemChangeLog", _changeLog->isChecked()); _metrics->set("AllowBOMItemDelete", _allowDelete->isChecked()); if (_issueMethod->currentIndex() == 0) _metrics->set("DefaultWomatlIssueMethod", QString("S")); else if (_issueMethod->currentIndex() == 1) _metrics->set("DefaultWomatlIssueMethod", QString("L")); else if (_issueMethod->currentIndex() == 2) _metrics->set("DefaultWomatlIssueMethod", QString("M")); return true; } qt-client-4.1.0/guiclient/configurePD.h000066400000000000000000000016231217451700100177550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREPD_H #define CONFIGUREPD_H #include "xabstractconfigure.h" #include "ui_configurePD.h" class configurePD : public XAbstractConfigure, public Ui::configurePD { Q_OBJECT public: configurePD(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configurePD(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); signals: void saving(); }; #endif // CONFIGUREPD_H qt-client-4.1.0/guiclient/configurePD.ui000066400000000000000000000113741217451700100201470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configurePD 0 0 385 254 P/D Module Configuration Enable Transforms Enable Revision Control Post Item Changes to the Change Log Allow Inactive Items to be Added to BOMs Allow deletion of Items from Bill of Material Defaults Set Sold Items as E&xclusive 5 W/O Material &Issue Method: _issueMethod Push Pull Mixed Qt::Vertical QSizePolicy::Expanding 16 13 Qt::Horizontal 40 20 _transforms _revControl _changeLog _inactiveBomItems _exclusive _issueMethod qt-client-4.1.0/guiclient/configurePO.cpp000066400000000000000000000133521217451700100203250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configurePO.h" #include #include configurePO::configurePO(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { setupUi(this); if (name) setObjectName(name); XSqlQuery configq; if (_metrics->value("Application") == "PostBooks") { _enableDropShip->hide(); _billDropShip->hide(); } else { configq.prepare("SELECT pohead_id FROM pohead " "WHERE ( (pohead_dropship = 'TRUE') " " AND (pohead_status = 'O') )"); configq.exec(); if (configq.first()) { _enableDropShip->setChecked(TRUE); _enableDropShip->setEnabled(FALSE); _billDropShip->setChecked(_metrics->boolean("BillDropShip")); _billDropShip->setEnabled(FALSE); } else { _enableDropShip->setChecked(_metrics->boolean("EnableDropShipments")); _billDropShip->setChecked(_metrics->boolean("BillDropShip")); } } if (_metrics->value("PONumberGeneration") == "M") _orderNumGeneration->setCurrentIndex(0); else if (_metrics->value("PONumberGeneration") == "A") _orderNumGeneration->setCurrentIndex(1); else if (_metrics->value("PONumberGeneration") == "O") _orderNumGeneration->setCurrentIndex(2); #if 0 if (_metrics->value("VoucherNumberGeneration") == "M") _voucherNumGeneration->setCurrentIndex(0); else if (_metrics->value("VoucherNumberGeneration") == "A") _voucherNumGeneration->setCurrentIndex(1); else if (_metrics->value("VoucherNumberGeneration") == "O") _voucherNumGeneration->setCurrentIndex(2); #endif // ToDo if (_metrics->value("PrNumberGeneration") == "M") _prNumberGeneration->setCurrentIndex(0); else if (_metrics->value("PrNumberGeneration") == "A") _prNumberGeneration->setCurrentIndex(1); else if (_metrics->value("PrNumberGeneration") == "O") _prNumberGeneration->setCurrentIndex(2); _nextPoNumber->setValidator(omfgThis->orderVal()); _nextVcNumber->setValidator(omfgThis->orderVal()); _nextPrNumber->setValidator(omfgThis->orderVal()); configq.exec( "SELECT ponumber.orderseq_number AS ponumber," " vcnumber.orderseq_number AS vcnumber," " prnumber.orderseq_number AS prnumber " "FROM orderseq AS ponumber," " orderseq AS vcnumber," " orderseq AS prnumber " "WHERE ( (ponumber.orderseq_name='PoNumber')" " AND (vcnumber.orderseq_name='VcNumber')" " AND (prnumber.orderseq_name='PrNumber') );" ); if (configq.first()) { _nextPoNumber->setText(configq.value("ponumber").toString()); _nextVcNumber->setText(configq.value("vcnumber").toString()); _nextPrNumber->setText(configq.value("prnumber").toString()); } _poChangeLog->setChecked(_metrics->boolean("POChangeLog")); _vendorChangeLog->setChecked(_metrics->boolean("VendorChangeLog")); _earliestPO->setChecked(_metrics->boolean("UseEarliestAvailDateOnPOItem")); _printPO->setChecked(_metrics->boolean("DefaultPrintPOOnSave")); _requirePoitemStdCost->setChecked(_metrics->boolean("RequireStdCostForPOItem")); _requirePOTax->setChecked(_metrics->boolean("RequirePOTax")); _notes->setChecked(_metrics->boolean("CopyPRtoPOItem")); _defaultShipVia->setText(_metrics->value("DefaultPOShipVia")); this->setWindowTitle("Purchase Configuration"); } configurePO::~configurePO() { // no need to delete child widgets, Qt does it all for us } void configurePO::languageChange() { retranslateUi(this); } bool configurePO::sSave() { emit saving(); if (! _poCopies->save()) return false; if (_orderNumGeneration->currentIndex() == 0) _metrics->set("PONumberGeneration", QString("M")); else if (_orderNumGeneration->currentIndex() == 1) _metrics->set("PONumberGeneration", QString("A")); else if (_orderNumGeneration->currentIndex() == 2) _metrics->set("PONumberGeneration", QString("O")); _metrics->set("VoucherNumberGeneration", QString("A")); if (_prNumberGeneration->currentIndex() == 0) _metrics->set("PrNumberGeneration", QString("M")); if (_prNumberGeneration->currentIndex() == 1) _metrics->set("PrNumberGeneration", QString("A")); if (_prNumberGeneration->currentIndex() == 2) _metrics->set("PrNumberGeneration", QString("O")); _metrics->set("POChangeLog", _poChangeLog->isChecked()); _metrics->set("VendorChangeLog", _vendorChangeLog->isChecked()); _metrics->set("UseEarliestAvailDateOnPOItem", _earliestPO->isChecked()); _metrics->set("DefaultPrintPOOnSave", _printPO->isChecked()); _metrics->set("EnableDropShipments", _enableDropShip->isChecked()); _metrics->set("BillDropShip", _billDropShip->isChecked()); _metrics->set("RequireStdCostForPOItem", _requirePoitemStdCost->isChecked()); _metrics->set("RequirePOTax", _requirePOTax->isChecked()); _metrics->set("CopyPRtoPOItem", _notes->isChecked()); _metrics->set("DefaultPOShipVia", _defaultShipVia->text().trimmed()); XSqlQuery configq; configq.prepare("SELECT setNextPoNumber(:poNumber), setNextVcNumber(:vcNumber), setNextPrNumber(:prNumber);"); configq.bindValue(":poNumber", _nextPoNumber->text().toInt()); configq.bindValue(":vcNumber", _nextVcNumber->text().toInt()); configq.bindValue(":prNumber", _nextPrNumber->text().toInt()); configq.exec(); return true; } qt-client-4.1.0/guiclient/configurePO.h000066400000000000000000000016531217451700100177730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREPO_H #define CONFIGUREPO_H #include "guiclient.h" #include "xabstractconfigure.h" #include "ui_configurePO.h" class configurePO : public XAbstractConfigure, public Ui::configurePO { Q_OBJECT public: configurePO(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configurePO(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); signals: void saving(); }; #endif // CONFIGUREPO_H qt-client-4.1.0/guiclient/configurePO.ui000066400000000000000000000363311217451700100201620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configurePO 0 0 657 564 P/O Module Configuration 0 0 Manual Automatic Automatic, Allow Override Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextPoNumber Voucher # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _voucherNumGeneration Order # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderNumGeneration Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextVcNumber Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _nextPrNumber Purchase Request # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _prNumberGeneration false 0 0 Automatic 0 0 Manual Automatic Automatic, Allow Override Qt::Horizontal 40 20 Options Post Purchase Order Changes to the Change Log Post Vendor Changes to the Change Log Use Earliest Avail. as Due Date for Purchase Order Item Prevent Purchase Order Items when no Std. Cost Exists Check Print Purchase Order on Save by Default Copy Purchase Request notes to Purchase Order Item notes Enable Drop Shipments Qt::Horizontal QSizePolicy::Fixed 5 10 false Select Drop Shipped Orders for Billing on Receipt Require Tax on Purchase Orders Default Purchase Order Copies: POCopies POShowPrices POWatermark Vendor Defaults 5 5 Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _defaultShipVia Qt::Vertical 20 40 Qt::Vertical 20 13 Qt::Horizontal 13 20 XDocCopySetter QWidget
xdoccopysetter.h
XLineEdit QLineEdit
xlineedit.h
1
_orderNumGeneration _nextPoNumber _voucherNumGeneration _nextVcNumber _prNumberGeneration _nextPrNumber _defaultShipVia _poChangeLog _vendorChangeLog _earliestPO _requirePoitemStdCost _printPO _notes _enableDropShip _billDropShip _enableDropShip toggled(bool) _billDropShip setEnabled(bool) 374 183 380 203
qt-client-4.1.0/guiclient/configureSO.cpp000066400000000000000000000375001217451700100203310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureSO.h" #include #include configureSO::configureSO(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { XSqlQuery configureconfigureSO; setupUi(this); if (name) setObjectName(name); connect(_creditLimit, SIGNAL(editingFinished()), this, SLOT(sEditCreditLimit())); connect(_askUpdatePrice, SIGNAL(toggled(bool)), _ignoreCustDisc, SLOT(setEnabled(bool))); _nextSoNumber->setValidator(omfgThis->orderVal()); _nextQuNumber->setValidator(omfgThis->orderVal()); _nextRaNumber->setValidator(omfgThis->orderVal()); _nextCmNumber->setValidator(omfgThis->orderVal()); _nextInNumber->setValidator(omfgThis->orderVal()); _creditLimit->setValidator(omfgThis->moneyVal()); _orderNumGeneration->setMethod(_metrics->value("CONumberGeneration")); _quoteNumGeneration->setMethod(_metrics->value("QUNumberGeneration")); _creditMemoNumGeneration->setMethod(_metrics->value("CMNumberGeneration")); _invoiceNumGeneration->setMethod(_metrics->value("InvcNumberGeneration")); QString metric; metric = _metrics->value("InvoiceDateSource"); if (metric == "scheddate") _invcScheddate->setChecked(true); else if (metric == "shipdate") _invcShipdate->setChecked(true); else _invcCurrdate->setChecked(true); configureconfigureSO.exec( "SELECT sonumber.orderseq_number AS sonumber," " qunumber.orderseq_number AS qunumber," " cmnumber.orderseq_number AS cmnumber," " innumber.orderseq_number AS innumber " "FROM orderseq AS sonumber," " orderseq AS qunumber," " orderseq AS cmnumber," " orderseq AS innumber " "WHERE ( (sonumber.orderseq_name='SoNumber')" " AND (qunumber.orderseq_name='QuNumber')" " AND (cmnumber.orderseq_name='CmNumber')" " AND (innumber.orderseq_name='InvcNumber') );" ); if (configureconfigureSO.first()) { _nextSoNumber->setText(configureconfigureSO.value("sonumber")); _nextQuNumber->setText(configureconfigureSO.value("qunumber")); _nextCmNumber->setText(configureconfigureSO.value("cmnumber")); _nextInNumber->setText(configureconfigureSO.value("innumber")); } else if (configureconfigureSO.lastError().type() != QSqlError::NoError) { systemError(this, configureconfigureSO.lastError().databaseText(), __FILE__, __LINE__); return; } _allowDiscounts->setChecked(_metrics->boolean("AllowDiscounts")); _allowASAP->setChecked(_metrics->boolean("AllowASAPShipSchedules")); _customerChangeLog->setChecked(_metrics->boolean("CustomerChangeLog")); _salesOrderChangeLog->setChecked(_metrics->boolean("SalesOrderChangeLog")); _restrictCreditMemos->setChecked(_metrics->boolean("RestrictCreditMemos")); _autoSelectForBilling->setChecked(_metrics->boolean("AutoSelectForBilling")); _saveAndAdd->setChecked(_metrics->boolean("AlwaysShowSaveAndAdd")); _firmAndAdd->setChecked(_metrics->boolean("FirmSalesOrderPackingList")); _priceOverride->setChecked(_metrics->boolean("DisableSalesOrderPriceOverride")); _autoAllocateCM->setChecked(_metrics->boolean("AutoAllocateCreditMemos")); _hideSOMiscChrg->setChecked(_metrics->boolean("HideSOMiscCharge")); _enableSOShipping->setChecked(_metrics->boolean("EnableSOShipping")); _printSO->setChecked(_metrics->boolean("DefaultPrintSOOnSave")); _enablePromiseDate->setChecked(_metrics->boolean("UsePromiseDate")); _calcFreight->setChecked(_metrics->boolean("CalculateFreight")); _includePkgWeight->setChecked(_metrics->boolean("IncludePackageWeight")); _quoteafterSO->setChecked(_metrics->boolean("ShowQuotesAfterSO")); _itemPricingPrecedence->setChecked(_metrics->boolean("ItemPricingPrecedence")); _wholesalePriceCosting->setChecked(_metrics->boolean("WholesalePriceCosting")); _long30Markups->setChecked(_metrics->boolean("Long30Markups")); _shipform->setId(_metrics->value("DefaultShipFormId").toInt()); _shipvia->setId(_metrics->value("DefaultShipViaId").toInt()); if (_metrics->value("DefaultBalanceMethod") == "B") _balanceMethod->setCurrentIndex(0); else if (_metrics->value("DefaultBalanceMethod") == "O") _balanceMethod->setCurrentIndex(1); _custtype->setId(_metrics->value("DefaultCustType").toInt()); _salesrep->setId(_metrics->value("DefaultSalesRep").toInt()); _terms->setId(_metrics->value("DefaultTerms").toInt()); _partial->setChecked(_metrics->boolean("DefaultPartialShipments")); _backorders->setChecked(_metrics->boolean("DefaultBackOrders")); _freeFormShiptos->setChecked(_metrics->boolean("DefaultFreeFormShiptos")); _creditLimit->setText(_metrics->value("SOCreditLimit")); _creditRating->setText(_metrics->value("SOCreditRate")); if (_metrics->value("soPriceEffective") == "OrderDate") _priceOrdered->setChecked(true); else if (_metrics->value("soPriceEffective") == "ScheduleDate") _priceScheduled->setChecked(true); if(_metrics->value("UpdatePriceLineEdit").toInt() == 1) _dontUpdatePrice->setChecked(true); else if (_metrics->value("UpdatePriceLineEdit").toInt() == 2) _askUpdatePrice->setChecked(true); else if(_metrics->value("UpdatePriceLineEdit").toInt() == 3) _updatePrice->setChecked(true); _ignoreCustDisc->setChecked(_askUpdatePrice->isChecked() && _metrics->boolean("IgnoreCustDisc")); this->setWindowTitle("Sales Configuration"); //Set status of Returns Authorization based on context if(_metrics->value("Application") == "PostBooks") { _authNumGenerationLit->setVisible(false); _returnAuthorizationNumGeneration->setVisible(false); _nextRaNumberLit->setVisible(false); _nextRaNumber->setVisible(false); _tab->removeTab(_tab->indexOf(_returns)); _enableReturns->setChecked(false); _enableReservations->hide(); _enableReservations->setChecked(false); _locationGroup->hide(); _locationGroup->setChecked(false); _lowest->setChecked(false); _highest->setChecked(false); _alpha->setChecked(false); } else { configureconfigureSO.exec("SELECT rahead_id FROM rahead LIMIT 1;"); if (configureconfigureSO.first()) _enableReturns->setCheckable(false); else _enableReturns->setChecked(_metrics->boolean("EnableReturnAuth")); configureconfigureSO.exec( "SELECT ranumber.orderseq_number AS ranumber " "FROM orderseq AS ranumber " "WHERE (ranumber.orderseq_name='RaNumber');" ); if (configureconfigureSO.first()) { _nextRaNumber->setText(configureconfigureSO.value("ranumber")); } else _nextRaNumber->setText("10000"); metric = _metrics->value("RANumberGeneration"); if (metric == "M") _returnAuthorizationNumGeneration->setCurrentIndex(0); else if (metric == "A") _returnAuthorizationNumGeneration->setCurrentIndex(1); else if (metric == "O") _returnAuthorizationNumGeneration->setCurrentIndex(2); metric = _metrics->value("DefaultRaDisposition"); if (metric == "C") _disposition->setCurrentIndex(0); else if (metric == "R") _disposition->setCurrentIndex(1); else if (metric == "P") _disposition->setCurrentIndex(2); else if (metric == "V") _disposition->setCurrentIndex(3); else if (metric == "M") _disposition->setCurrentIndex(4); else _disposition->setCurrentIndex(5); metric = _metrics->value("DefaultRaTiming"); if (metric == "I") _timing->setCurrentIndex(0); else if (metric == "R") _timing->setCurrentIndex(1); else _timing->setCurrentIndex(2); metric = _metrics->value("DefaultRaCreditMethod"); if (metric == "N") _creditBy->setCurrentIndex(0); else if (metric == "M") _creditBy->setCurrentIndex(1); else if (metric == "K") _creditBy->setCurrentIndex(2); else if (metric == "C") _creditBy->setCurrentIndex(3); else _creditBy->setCurrentIndex(4); _returnAuthChangeLog->setChecked(_metrics->boolean("ReturnAuthorizationChangeLog")); _printRA->setChecked(_metrics->boolean("DefaultPrintRAOnSave")); _enableReservations->setChecked(_metrics->boolean("EnableSOReservations")); _locationGroup->setChecked(_metrics->boolean("EnableSOReservationsByLocation")); if(_metrics->value("SOReservationLocationMethod").toInt() == 1) _lowest->setChecked(true); else if (_metrics->value("SOReservationLocationMethod").toInt() == 2) _highest->setChecked(true); else if(_metrics->value("SOReservationLocationMethod").toInt() == 3) _alpha->setChecked(true); } adjustSize(); } configureSO::~configureSO() { // no need to delete child widgets, Qt does it all for us } void configureSO::languageChange() { retranslateUi(this); } bool configureSO::sSave() { XSqlQuery configureSave; emit saving(); const char *dispositionTypes[] = { "C", "R", "P", "V", "M", "" }; const char *timingTypes[] = { "I", "R", "" }; const char *creditMethodTypes[] = { "N", "M", "K", "C", "" }; if ( (_metrics->boolean("EnableSOReservationsByLocation")) && (!_locationGroup->isChecked()) ) { if (QMessageBox::warning(this, tr("Reserve by Location Disabled"), tr("

All existing location reservations will be removed. Are you sure you want to continue?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return false; } else { configureSave.prepare("DELETE FROM itemlocrsrv " " WHERE (itemlocrsrv_source='SO');"); configureSave.exec(); } } _metrics->set("ShowQuotesAfterSO", _quoteafterSO->isChecked()); _metrics->set("AllowDiscounts", _allowDiscounts->isChecked()); _metrics->set("AllowASAPShipSchedules", _allowASAP->isChecked()); _metrics->set("CustomerChangeLog", _customerChangeLog->isChecked()); _metrics->set("SalesOrderChangeLog", _salesOrderChangeLog->isChecked()); _metrics->set("RestrictCreditMemos", _restrictCreditMemos->isChecked()); _metrics->set("AutoSelectForBilling", _autoSelectForBilling->isChecked()); _metrics->set("AlwaysShowSaveAndAdd", _saveAndAdd->isChecked()); _metrics->set("FirmSalesOrderPackingList", _firmAndAdd->isChecked()); _metrics->set("DisableSalesOrderPriceOverride", _priceOverride->isChecked()); _metrics->set("AutoAllocateCreditMemos", _autoAllocateCM->isChecked()); _metrics->set("HideSOMiscCharge", _hideSOMiscChrg->isChecked()); _metrics->set("EnableSOShipping", _enableSOShipping->isChecked()); _metrics->set("CONumberGeneration", _orderNumGeneration->methodCode()); _metrics->set("QUNumberGeneration", _quoteNumGeneration->methodCode()); _metrics->set("CMNumberGeneration", _creditMemoNumGeneration->methodCode()); _metrics->set("InvcNumberGeneration", _invoiceNumGeneration->methodCode()); _metrics->set("DefaultShipFormId", _shipform->id()); _metrics->set("DefaultShipViaId", _shipvia->id()); _metrics->set("DefaultCustType", _custtype->id()); _metrics->set("DefaultSalesRep", _salesrep->id()); _metrics->set("DefaultTerms", _terms->id()); _metrics->set("DefaultPartialShipments", _partial->isChecked()); _metrics->set("DefaultBackOrders", _backorders->isChecked()); _metrics->set("DefaultFreeFormShiptos", _freeFormShiptos->isChecked()); _metrics->set("DefaultPrintSOOnSave", _printSO->isChecked()); _metrics->set("UsePromiseDate", _enablePromiseDate->isChecked()); _metrics->set("CalculateFreight", _calcFreight->isChecked()); _metrics->set("IncludePackageWeight", _includePkgWeight->isChecked()); _metrics->set("EnableReturnAuth", _enableReturns->isChecked()); _metrics->set("EnableSOReservations", _enableReservations->isChecked()); _metrics->set("ItemPricingPrecedence", _itemPricingPrecedence->isChecked()); _metrics->set("WholesalePriceCosting", _wholesalePriceCosting->isChecked()); _metrics->set("Long30Markups", _long30Markups->isChecked()); _metrics->set("EnableSOReservationsByLocation", _locationGroup->isChecked()); //SOReservationLocationMethod are three Options Either // Lowest quantity first, // Highest quantity first, // Alpha by Location Name if(_lowest->isChecked()) _metrics->set("SOReservationLocationMethod", 1); else if (_highest->isChecked()) _metrics->set("SOReservationLocationMethod", 2); else if(_alpha->isChecked()) _metrics->set("SOReservationLocationMethod", 3); _metrics->set("SOCreditLimit", _creditLimit->text()); _metrics->set("SOCreditRate", _creditRating->text()); if (_priceOrdered->isChecked()) _metrics->set("soPriceEffective", QString("OrderDate")); else if (_priceScheduled->isChecked()) _metrics->set("soPriceEffective", QString("ScheduleDate")); else _metrics->set("soPriceEffective", QString("CurrentDate")); //UpdatePriceLineEdit are three Options Either // Don't Update price // Ask to Update Price, // Update Price if(_dontUpdatePrice->isChecked()) _metrics->set("UpdatePriceLineEdit", 1); else if (_askUpdatePrice->isChecked()) _metrics->set("UpdatePriceLineEdit", 2); else if(_updatePrice->isChecked()) _metrics->set("UpdatePriceLineEdit", 3); _metrics->set("IgnoreCustDisc", _askUpdatePrice->isChecked() && _ignoreCustDisc->isChecked()); if(_invcScheddate->isChecked()) _metrics->set("InvoiceDateSource", QString("scheddate")); else if(_invcShipdate->isChecked()) _metrics->set("InvoiceDateSource", QString("shipdate")); else _metrics->set("InvoiceDateSource", QString("currdate")); if (! _invoiceCopies->save()) return false; if (! _creditMemoCopies->save()) return false; switch (_balanceMethod->currentIndex()) { case 0: _metrics->set("DefaultBalanceMethod", QString("B")); break; case 1: _metrics->set("DefaultBalanceMethod", QString("O")); break; } configureSave.prepare( "SELECT setNextSoNumber(:sonumber), setNextQuNumber(:qunumber)," " setNextCmNumber(:cmnumber), setNextInvcNumber(:innumber);" ); configureSave.bindValue(":sonumber", _nextSoNumber->text().toInt()); configureSave.bindValue(":qunumber", _nextQuNumber->text().toInt()); configureSave.bindValue(":cmnumber", _nextCmNumber->text().toInt()); configureSave.bindValue(":innumber", _nextInNumber->text().toInt()); configureSave.exec(); if (configureSave.lastError().type() != QSqlError::NoError) { systemError(this, configureSave.lastError().databaseText(), __FILE__, __LINE__); return false; } if (_enableReturns->isChecked() || !_enableReturns->isCheckable()) { _metrics->set("DefaultRaDisposition", QString(dispositionTypes[_disposition->currentIndex()])); _metrics->set("DefaultRaTiming", QString(timingTypes[_timing->currentIndex()])); _metrics->set("DefaultRaCreditMethod", QString(creditMethodTypes[_creditBy->currentIndex()])); _metrics->set("ReturnAuthorizationChangeLog", _returnAuthChangeLog->isChecked()); _metrics->set("DefaultPrintRAOnSave", _printRA->isChecked()); _metrics->set("RANumberGeneration", _returnAuthorizationNumGeneration->methodCode()); configureSave.prepare( "SELECT setNextRaNumber(:ranumber);" ); configureSave.bindValue(":ranumber", _nextRaNumber->text().toInt()); configureSave.exec(); if (configureSave.lastError().type() != QSqlError::NoError) { systemError(this, configureSave.lastError().databaseText(), __FILE__, __LINE__); return false; } } _metrics->set("EnableReturnAuth", (_enableReturns->isChecked() || !_enableReturns->isCheckable())); return true; } void configureSO::sEditCreditLimit() { _creditLimit->setDouble((double)qRound(_creditLimit->toDouble())); } qt-client-4.1.0/guiclient/configureSO.h000066400000000000000000000017301217451700100177720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGURESO_H #define CONFIGURESO_H #include "guiclient.h" #include "xabstractconfigure.h" #include "ui_configureSO.h" class configureSO : public XAbstractConfigure, public Ui::configureSO { Q_OBJECT public: configureSO(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureSO(); public slots: virtual bool sSave(); virtual void sEditCreditLimit(); protected slots: virtual void languageChange(); signals: void saving(); }; #endif // CONFIGURESO_H qt-client-4.1.0/guiclient/configureSO.ui000066400000000000000000001464431217451700100201730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureSO 0 0 714 661 S/O Module Configuration 12 Sales Order # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 NumberGenComboBox::Automatic|NumberGenComboBox::Manual|NumberGenComboBox::Override Quote # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Automatic, Use Quote #'s Automatic, Use Quote #'s, Allow Override Automatic, Use S/O #'s Return Auth. # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 NumberGenComboBox::Automatic|NumberGenComboBox::Manual|NumberGenComboBox::Override Automatic, Use R/A #'s Automatic, Use R/A #'s, Allow Override Credit Memo # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Automatic, Use C/M #'s Automatic, Use C/M #'s, Allow Override Automatic, Use S/O #'s Invoice # Generation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Next #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 100 32767 100 0 100 32767 true 100 0 100 32767 100 0 100 32767 100 0 100 32767 NumberGenComboBox::Automatic|NumberGenComboBox::Override 0 1 0 General Print Sales Order on Save by Default Enable Sales Reservations Date Control Allow ASAP Schedule Dates Enable Promise Dates false Reserve by Location true false Highest Quantity First Alpha by Location Name false Lowest Quantity First true Change Log Post Customer Changes Post Sales Order Changes Ship Control Show 'Save and Add to Packing List' button on Sales Order Firm Sales Orders when added to Packing List Batch Enable Shipping interface from Sales Order screen Check 'Select for Billing' option on Ship Order Credit Control Restrict Credit Memos to Items on their Apply-To Document Allocate Credit Memos to New Sales Order on Save Show Quotes After Converted Qt::Vertical 20 0 Qt::Horizontal 0 20 Pricing Price Control Disallow Override of Sales Price on Sales Order Use Wholesale Price as Unit Cost for Markups Allow Price Discounts Use "Long 30" Method for Markups Hide Misc. Charges on Sales Order screen Item Precedence Over Product Category Pricing Pricing on Line Item Edits Update Price Do not Update Price Prompt before Updating true Qt::Horizontal QSizePolicy::Fixed 5 10 Ignore if Discounted Freight Pricing Use calculated Freight values by default Include Package Weight in Freight Calculation Price Effective Date Current true Order Scheduled Qt::Vertical 20 40 Qt::Horizontal 40 20 Invoice Invoice Date Source 12 Current Date Shipped Date true Scheduled Date Qt::Horizontal 40 20 Default Invoice Copies: InvoiceCopies InvoiceShowPrices InvoiceWatermark Default Credit Memo Copies: CreditMemoCopies CreditMemoShowPrices CreditMemoWatermark Customer Defaults Customer Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::CustomerTypes Sales Rep: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::SalesReps Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::ShipVias Shipping Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::ShippingForms XComboBox::None Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::ARTerms Balance Method: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Balance Forward Open Item Qt::Horizontal 0 20 12 Accepts Partial Shipments Accepts Backorders Allow Free Form Ship-Tos Qt::Horizontal QSizePolicy::MinimumExpanding 16 20 Credit Limit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Credit Rating: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 Returns 5 5 0 0 Qt::ClickFocus Enable Return Authorizations true false Qt::ClickFocus Post Return Authorization Changes to the Change Log Default Disposition: Qt::ClickFocus Credit Return Replace Service Substitute [ no default ] Credit/Ship: Qt::ClickFocus Immediately Upon Receipt [ no default ] Default Credit Method: Qt::ClickFocus None Credit Memo Check Credit Card [ no default ] Qt::ClickFocus Check Print On Save by Default Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::MinimumExpanding 140 0 NumberGenComboBox QComboBox

numbergencombobox.h
XComboBox QComboBox
xcombobox.h
XDocCopySetter QWidget
xdoccopysetter.h
XLineEdit QLineEdit
xlineedit.h
1
_orderNumGeneration _nextSoNumber _quoteNumGeneration _nextQuNumber _returnAuthorizationNumGeneration _nextRaNumber _creditMemoNumGeneration _nextCmNumber _invoiceNumGeneration _nextInNumber _tab _printSO _allowASAP _enablePromiseDate _enableReservations _locationGroup _lowest _highest _alpha _customerChangeLog _salesOrderChangeLog _saveAndAdd _firmAndAdd _enableSOShipping _autoSelectForBilling _restrictCreditMemos _autoAllocateCM _quoteafterSO _allowDiscounts _priceOverride _hideSOMiscChrg _updatePrice _dontUpdatePrice _askUpdatePrice _ignoreCustDisc _calcFreight _includePkgWeight _priceCurrent _priceOrdered _priceScheduled _invcCurrdate _invcShipdate _invcScheddate _custtype _salesrep _shipvia _shipform _terms _balanceMethod _partial _backorders _freeFormShiptos _creditLimit _creditRating _enableReturns _returnAuthChangeLog _disposition _timing _creditBy _printRA _enableReservations toggled(bool) _locationGroup setEnabled(bool) 444 195 645 271 _calcFreight toggled(bool) _includePkgWeight setEnabled(bool) 234 584 234 606 _calcFreight toggled(bool) _includePkgWeight setChecked(bool) 234 584 234 606 qt-client-4.1.0/guiclient/configureSearchPath.cpp000066400000000000000000000200671217451700100220320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureSearchPath.h" #include #include #include "errorReporter.h" class configureSearchPathPrivate { public: configureSearchPathPrivate() { } }; configureSearchPath::configureSearchPath(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : XAbstractConfigure(parent, fl), _private(0) { Q_UNUSED(modal); setupUi(this); if (name) setObjectName(name); _excluded->addColumn(tr("Schema"), -1, Qt::AlignLeft, true, "nspname"); _excluded->addColumn(tr("Package"), _ynColumn, Qt::AlignCenter,true, "ispkg"); _excluded->addColumn(tr("Enabled"), _ynColumn, Qt::AlignCenter,true, "isenabled"); _included->addColumn(tr("Order"), -1, Qt::AlignRight, true, "seq"); _included->addColumn(tr("Schema"), -1, Qt::AlignLeft, true, "nspname"); _included->addColumn(tr("Package"), _ynColumn, Qt::AlignCenter,true, "ispkg"); _included->addColumn(tr("Enabled"), _ynColumn, Qt::AlignCenter,true, "isenabled"); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_addAll, SIGNAL(clicked()), this, SLOT(sAddAll())); connect(_excluded, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_included, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_moveDown, SIGNAL(clicked()), this, SLOT(sMoveDown())); connect(_moveUp, SIGNAL(clicked()), this, SLOT(sMoveUp())); connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove())); connect(_removeAll, SIGNAL(clicked()), this, SLOT(sRemoveAll())); connect(_showAll, SIGNAL(toggled(bool)), this, SLOT(sPopulate())); _addAll->setEnabled(_privileges->isDba()); _removeAll->setEnabled(_privileges->isDba()); sPopulate(); } configureSearchPath::~configureSearchPath() { if (_private) { delete _private; _private = 0; } } void configureSearchPath::languageChange() { retranslateUi(this); } bool configureSearchPath::sSave() { emit saving(); XSqlQuery pathq("SELECT buildsearchpath() AS path;"); if (pathq.first()) pathq.exec(QString("SET SEARCH_PATH TO %1;") .arg(pathq.value("path").toString())); if (ErrorReporter::error(QtCriticalMsg, this, tr("Setting Search Path"), pathq, __FILE__, __LINE__)) return false; return true; } void configureSearchPath::sAdd() { XSqlQuery addq; addq.prepare("INSERT INTO schemaord (schemaord_name, schemaord_order)" " SELECT :name, COALESCE(MAX(schemaord_order), 0) + 1" " FROM schemaord;"); foreach (XTreeWidgetItem *item, _excluded->selectedItems()) { addq.bindValue(":name", item->text("nspname")); addq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Adding to Search Path"), addq, __FILE__, __LINE__)) return; } sPopulate(); } void configureSearchPath::sAddAll() { XSqlQuery addq; addq.prepare("INSERT INTO schemaord (schemaord_name, schemaord_order)" " SELECT :name, COALESCE(MAX(schemaord_order), 0) + 1" " FROM schemaord;"); int namecol = _excluded->column("nspname"); while (XTreeWidgetItem *item = dynamic_cast(_excluded->takeTopLevelItem(0))) { addq.bindValue(":name", item->text(namecol)); addq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Adding to Search Path"), addq, __FILE__, __LINE__); } sPopulate(); } void configureSearchPath::sHandleButtons() { _add->setEnabled(_excluded->id() >= 0); _addAll->setEnabled(_excluded->topLevelItemCount() > 0); _moveDown->setEnabled(_included->itemBelow(_included->currentItem()));//exists _moveUp->setEnabled(_included->itemAbove(_included->currentItem())); //exists _remove->setEnabled(_included->id() >= 0); _removeAll->setEnabled(_included->topLevelItemCount() > 0); } void configureSearchPath::sMoveDown() { XSqlQuery moveq; moveq.prepare("SELECT moveUpDown(:id, 'public', 'schemaord'," " 'schemaord_order', NULL," " NULL, 'DOWN');"); moveq.bindValue(":id", _included->id()); moveq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Changing Order"), moveq, __FILE__, __LINE__); sPopulate(); } void configureSearchPath::sMoveUp() { XSqlQuery moveq; moveq.prepare("SELECT moveUpDown(:id, 'public', 'schemaord'," " 'schemaord_order', NULL," " NULL, 'UP');"); moveq.bindValue(":id", _included->id()); moveq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Changing Order"), moveq, __FILE__, __LINE__); sPopulate(); } void configureSearchPath::sPopulate() { MetaSQLQuery emql("SELECT pg_namespace.oid, nspname," " (pkghead_id IS NOT NULL) AS ispkg," " (pkghead IS NULL OR packageisenabled(pkghead_id))" " AS isenabled," " CASE nspname WHEN 'public' THEN 0" " WHEN 'api' THEN 1" " ELSE 2" " END AS seq" " FROM pg_namespace" " LEFT OUTER JOIN pkghead ON (nspname=pkghead_name)" " WHERE (nspname NOT IN (SELECT schemaord_name" " FROM schemaord)" " " " AND ((nspname IN ('public', 'api'))" " OR (pkghead_id IS NOT NULL))" " " " )" " ORDER BY seq, nspname;"); ParameterList params; if (_showAll->isChecked()) params.append("showall"); XSqlQuery eqry = emql.toQuery(params); _excluded->populate(eqry); ErrorReporter::error(QtCriticalMsg, this, tr("Getting Excluded Schemas"), eqry, __FILE__, __LINE__); XSqlQuery iqry("SELECT schemaord_id, schemaord_name AS nspname," " (pkghead_id IS NOT NULL) AS ispkg," " (pkghead IS NULL OR packageisenabled(pkghead_id))" " AS isenabled," " schemaord_order AS seq" " FROM schemaord" " LEFT OUTER JOIN pkghead ON (schemaord_name=pkghead_name)" " ORDER BY seq;"); _included->populate(iqry); ErrorReporter::error(QtCriticalMsg, this, tr("Getting Included Schemas"), iqry, __FILE__, __LINE__); XSqlQuery pathq("SELECT buildsearchpath() AS path;"); if (pathq.first()) _result->setPlainText(pathq.value("path").toString()); ErrorReporter::error(QtCriticalMsg, this, tr("Showing New Search Path"), pathq, __FILE__, __LINE__); } void configureSearchPath::sRemove() { XSqlQuery delq; delq.prepare("DELETE FROM schemaord WHERE schemaord_id=:id;"); foreach (XTreeWidgetItem *item, _included->selectedItems()) { delq.bindValue(":id", item->id()); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Removing Schema"), delq, __FILE__, __LINE__); } sPopulate(); } void configureSearchPath::sRemoveAll() { XSqlQuery delq; delq.prepare("DELETE FROM schemaord WHERE schemaord_id=:id;"); while (XTreeWidgetItem *item = dynamic_cast(_included->takeTopLevelItem(0))) { delq.bindValue(":id", item->id()); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Removing Schema"), delq, __FILE__, __LINE__); } sPopulate(); } qt-client-4.1.0/guiclient/configureSearchPath.h000066400000000000000000000024071217451700100214750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGURESEARCHPATH_H #define CONFIGURESEARCHPATH_H #include "xabstractconfigure.h" #include "ui_configureSearchPath.h" class configureSearchPathPrivate; class configureSearchPath : public XAbstractConfigure, public Ui::configureSearchPath { Q_OBJECT public: configureSearchPath(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureSearchPath(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); virtual void sAdd(); virtual void sAddAll(); virtual void sHandleButtons(); virtual void sMoveDown(); virtual void sMoveUp(); virtual void sPopulate(); virtual void sRemove(); virtual void sRemoveAll(); signals: void saving(); private: configureSearchPathPrivate *_private; }; #endif qt-client-4.1.0/guiclient/configureSearchPath.ui000066400000000000000000000160631217451700100216660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureSearchPath 0 0 564 344 Set Search Path Schemas Not in Order: Schemas in Order: 0 4 Qt::Vertical 119 47 false Add -> false Add All ->> Qt::Vertical QSizePolicy::Fixed 20 10 false <-Remove false <<-Remove All Qt::Vertical 110 40 0 4 Qt::Vertical 20 40 false Move Up false Move Down Qt::Vertical 20 40 Show all schemas 0 1 true Qt::Vertical 20 40 New Search Path: XCheckBox QCheckBox
xcheckbox.h
XLabel QLabel
xlabel.h
XTreeWidget QTreeWidget
xtreewidget.h
1
_excluded _add _addAll _remove _removeAll _included _moveUp _moveDown _showAll _result
qt-client-4.1.0/guiclient/configureWO.cpp000066400000000000000000000063451217451700100203400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "configureWO.h" #include #include #include "guiclient.h" configureWO::configureWO(QWidget* parent, const char* name, bool /*modal*/, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { XSqlQuery configureconfigureWO; setupUi(this); if (name) setObjectName(name); connect(_autoExplode, SIGNAL(toggled(bool)), _WOExplosionGroup, SLOT(setDisabled(bool))); connect(_autoExplode, SIGNAL(toggled(bool)), _multiLevel, SLOT(setChecked(bool))); _nextWoNumber->setValidator(omfgThis->orderVal()); configureconfigureWO.exec( "SELECT orderseq_number " "FROM orderseq " "WHERE (orderseq_name='WoNumber')" ); if (configureconfigureWO.first()) _nextWoNumber->setText(configureconfigureWO.value("orderseq_number").toString()); _autoExplode->setChecked(_metrics->boolean("AutoExplodeWO")); _workOrderChangeLog->setChecked(_metrics->boolean("WorkOrderChangeLog")); _woNumGeneration->append(0, tr("Automatic"), "A"); _woNumGeneration->append(1, tr("Manual"), "M"); _woNumGeneration->append(2, tr("Automatic, Allow Override"), "O"); _woNumGeneration->setCode(_metrics->value("WONumberGeneration")); if (_metrics->value("ExplodeWOEffective") == "E") _explodeDateEffective->setChecked(TRUE); else _startDateEffective->setChecked(TRUE); if (_metrics->value("WOExplosionLevel") == "S") _singleLevel->setChecked(TRUE); else if (_metrics->value("WOExplosionLevel") == "M") _multiLevel->setChecked(TRUE); _materialVariances->setChecked(_metrics->boolean("PostMaterialVariances")); if (_metrics->value("JobItemCosDefault") == "P") _proportional->setChecked(TRUE); else _todate->setChecked(TRUE); this->setWindowTitle("Manufacture Configuration"); } configureWO::~configureWO() { // no need to delete child widgets, Qt does it all for us } void configureWO::languageChange() { retranslateUi(this); } bool configureWO::sSave() { XSqlQuery configureSave; emit saving(); configureSave.prepare("SELECT setNextWoNumber(:woNumber) AS result;"); configureSave.bindValue(":woNumber", _nextWoNumber->text().toInt()); configureSave.exec(); _metrics->set("AutoExplodeWO", _autoExplode->isChecked()); _metrics->set("WorkOrderChangeLog", _workOrderChangeLog->isChecked()); _metrics->set("WONumberGeneration", _woNumGeneration->code()); _metrics->set("ExplodeWOEffective", ((_explodeDateEffective->isChecked()) ? QString("E") : QString("S"))); _metrics->set("WOExplosionLevel", ((_singleLevel->isChecked()) ? QString("S") : QString("M"))); _metrics->set("PostMaterialVariances", _materialVariances->isChecked()); if (_todate->isChecked()) _metrics->set("JobItemCosDefault", QString("D")); else _metrics->set("JobItemCosDefault", QString("P")); return true; } qt-client-4.1.0/guiclient/configureWO.h000066400000000000000000000016241217451700100200000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIGUREWO_H #define CONFIGUREWO_H #include "xabstractconfigure.h" #include "ui_configureWO.h" class configureWO : public XAbstractConfigure, public Ui::configureWO { Q_OBJECT public: configureWO(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~configureWO(); public slots: virtual bool sSave(); protected slots: virtual void languageChange(); signals: void saving(); }; #endif // CONFIGUREWO_H qt-client-4.1.0/guiclient/configureWO.ui000066400000000000000000000155261217451700100201740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. configureWO 0 0 577 294 W/O Module Configuration Next Work Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 16777215 Work Order Number Creation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 true Automatically Explode Work Orders Post Work Order Changes to the Change Log Explode Work Order's Effective as of: Date of Explosion Work Order Start Date Default Work Order Explosion Level: Qt::AlignLeading Single Level Multiple Level Inventory Item Cost Defaults Post Material Usage Variances Work Order Cost Recognition Defaults To Date Proportional XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_nextWoNumber _woNumGeneration _autoExplode _workOrderChangeLog _explodeDateEffective _startDateEffective _singleLevel _multiLevel _materialVariances _todate _proportional
qt-client-4.1.0/guiclient/confirmAchOK.cpp000066400000000000000000000023631217451700100204100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "confirmAchOK.h" confirmAchOK::confirmAchOK(QWidget* parent, const char* name, Qt::WFlags fl) : XDialog(parent, name, fl) { setupUi(this); QFont fixedFont("Courier"); fixedFont.setStyleHint(QFont::TypeWriter); fixedFont.setPointSize(fixedFont.pointSize() - 2); _fileContents->setFont(fixedFont); } confirmAchOK::~confirmAchOK() { // no need to delete child widgets, Qt does it all for us } void confirmAchOK::languageChange() { retranslateUi(this); } bool confirmAchOK::askOK(QWidget *parent, QFile &pfile) { confirmAchOK newdlg(parent, "confirmAchOK"); newdlg._filename->setText(pfile.fileName()); if (! pfile.open(QIODevice::ReadOnly)) return false; newdlg._fileContents->setPlainText(QString(pfile.readAll())); pfile.close(); return (newdlg.exec() == QDialog::Accepted); } qt-client-4.1.0/guiclient/confirmAchOK.h000066400000000000000000000015561217451700100200600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONFIRMACHOK_H #define CONFIRMACHOK_H #include "xdialog.h" #include #include "ui_confirmAchOK.h" class confirmAchOK : public XDialog, public Ui::confirmAchOK { Q_OBJECT public: confirmAchOK(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); ~confirmAchOK(); static bool askOK(QWidget *parent, QFile &); protected slots: virtual void languageChange(); }; #endif // CONFIRMACHOK_H qt-client-4.1.0/guiclient/confirmAchOK.ui000066400000000000000000000061551217451700100202460ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. confirmAchOK 0 0 640 434 ACH File OK? Was the EFT file created OK? File Name QTextEdit::FixedColumnWidth 94 Qt::TextSelectableByMouse 5 5 Qt::Horizontal 40 20 Yes true No _yes clicked() confirmAchOK accept() 565 421 362 378 _no clicked() confirmAchOK reject() 627 421 282 363 qt-client-4.1.0/guiclient/contact.cpp000066400000000000000000001227271217451700100175470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "contact.h" #include #include #include #include #include "characteristicAssignment.h" #include "contactcluster.h" #include "crmaccount.h" #include "customer.h" #include "employee.h" #include "errorReporter.h" #include "incident.h" #include "inputManager.h" #include "lotSerialRegistration.h" #include "opportunity.h" #include "prospect.h" #include "purchaseOrder.h" #include "salesOrder.h" #include "shipTo.h" #include "storedProcErrorLookup.h" #include "todoItem.h" #include "transferOrder.h" #include "vendor.h" #include "vendorAddress.h" #include "warehouse.h" #include "xsqlquery.h" #include struct privSet { bool canEdit; bool canView; bool canDetach; }; class contactPrivate { public: contactPrivate(contact *parent) : _parent(parent) { _activeCache = false; _mode = cView; }; ~contactPrivate() { }; bool _activeCache; int _mode; contact *_parent; struct privSet rowPrivs(XTreeWidgetItem *row) { struct privSet privs = {false, false, false}; if (! row) return privs; QString owner = row->rawValue("owner").toString(); switch (row->altId()) { case 1: case 2: privs.canEdit = _privileges->check("MaintainAllCRMAccounts") || (omfgThis->username() == owner && _privileges->check("MaintainPersonalCRMAccounts")); privs.canView = _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == owner && _privileges->check("ViewPersonalCRMAccounts")); privs.canDetach = privs.canEdit; break; case 3: case 4: privs.canEdit = _privileges->check("MaintainCustomerMasters"); privs.canView = _privileges->check("ViewCustomerMasters"); privs.canDetach = privs.canEdit; break; case 5: case 6: privs.canEdit = _privileges->check("MaintainVendors"); privs.canView = _privileges->check("ViewVendors"); privs.canDetach = privs.canEdit; break; case 7: privs.canEdit = _privileges->check("MaintainProspectMasters"); privs.canView = _privileges->check("ViewProspectMasters"); privs.canDetach = privs.canEdit; break; case 8: privs.canEdit = _privileges->check("MaintainShiptos"); privs.canView = _privileges->check("ViewShiptos"); privs.canDetach = privs.canEdit; break; case 9: privs.canEdit = _privileges->check("MaintainVendorAddresses"); privs.canView = _privileges->check("ViewVendorAddresses"); privs.canDetach = privs.canEdit; break; case 10: privs.canEdit = _privileges->check("MaintainWarehouses"); privs.canView = _privileges->check("ViewWarehouses"); privs.canDetach = privs.canEdit; break; case 11: privs.canEdit = _privileges->check("MaintainEmployees"); privs.canView = _privileges->check("ViewEmployees"); privs.canDetach = privs.canEdit; break; case 12: case 13: privs.canEdit = _privileges->check("MaintainSalesOrders"); privs.canView = _privileges->check("ViewSalesOrders"); privs.canDetach = privs.canEdit; break; case 14: privs.canEdit = _privileges->check("MaintainAllIncidents") || (omfgThis->username() == owner && _privileges->check("MaintainPersonalIncidents")); privs.canView = _privileges->check("ViewAllIncidents") || (omfgThis->username() == owner && _privileges->check("ViewPersonalIncidents")); privs.canDetach = false; // cntct is required break; case 15: privs.canEdit = _metrics->boolean("LotSerialControl"); privs.canView = _metrics->boolean("LotSerialControl"); privs.canDetach = false; // cntct is required break; case 16: privs.canEdit = _privileges->check("MaintainAllOpportunities") || (omfgThis->username() == owner && _privileges->check("MaintainPersonalOpportunities")); privs.canView = _privileges->check("ViewAllOpportunities") || (omfgThis->username() == owner && _privileges->check("ViewPersonalOpportunities")); privs.canDetach = privs.canEdit; break; case 17: case 18: privs.canEdit = _privileges->check("MaintainPurchaseOrders"); privs.canView = _privileges->check("ViewPurchaseOrders"); privs.canDetach = privs.canEdit; break; case 19: case 20: privs.canEdit = _privileges->check("MaintainQuotes"); privs.canView = _privileges->check("ViewQuotes"); privs.canDetach = privs.canEdit; break; case 21: privs.canEdit = _privileges->check("MaintainAllToDoItems") || (omfgThis->username() == owner && _privileges->check("MaintainPersonalToDoItems")); privs.canView = _privileges->check("ViewAllToDoItems") || (omfgThis->username() == owner && _privileges->check("ViewPersonalToDoItems")); privs.canDetach = privs.canEdit; break; case 22: case 23: privs.canEdit = _privileges->check("MaintainTransferOrders"); privs.canView = _privileges->check("ViewTransferOrders"); privs.canDetach = privs.canEdit; break; default: break; } return privs; }; }; contact::contact(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _data = new contactPrivate(this); // Legacy compatibility removed // For legacy compatibility //_save = _buttonBox->button(QDialogButtonBox::Save); //_save->setObjectName("_save"); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_crmAccount, SIGNAL(newId(int)), _contact, SLOT(setSearchAcct(int))); connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharass())); connect(_detachUse, SIGNAL(clicked()), this, SLOT(sDetachUse())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharass())); connect(_editUse, SIGNAL(clicked()), this, SLOT(sEditUse())); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharass())); connect(_showOrders, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_uses, SIGNAL(valid(bool)), this, SLOT(sHandleValidUse(bool))); connect(_uses, SIGNAL(populateMenu(QMenu*, XTreeWidgetItem*)), this, SLOT(sPopulateUsesMenu(QMenu*))); connect(_viewUse, SIGNAL(clicked()), this, SLOT(sViewUse())); connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(customersUpdated(int,bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(employeeUpdated(int)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(prospectsUpdated()), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(purchaseOrdersUpdated(int,bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(quotesUpdated(int,bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(salesOrdersUpdated(int,bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(transferOrdersUpdated(int)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(vendorsUpdated()), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(warehousesUpdated()), this, SLOT(sFillList())); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name"); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value"); _uses->addColumn(tr("Used by"), 100, Qt::AlignLeft, true, "type"); _uses->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, true, "number"); _uses->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "name"); _uses->addColumn(tr("Role"), -1, Qt::AlignLeft, true, "role"); _uses->addColumn(tr("Active"), _ynColumn, Qt::AlignCenter,true, "active"); _uses->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false,"owner"); _contact->setMinimalLayout(false); _contact->setAccountVisible(false); _contact->setInitialsVisible(false); _contact->setActiveVisible(false); _contact->setOwnerVisible(false); _contact->setListVisible(false); _owner->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _owner->setEnabled(_privileges->check("EditOwner")); } contact::~contact() { // no need to delete child widgets, Qt does it all for us } void contact::languageChange() { retranslateUi(this); } enum SetResponse contact::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cntct_id", &valid); if (valid) { _contact->setId(param.toInt()); _comments->setId(_contact->id()); _documents->setId(_contact->id()); sPopulate(); } param = pParams.value("crmacct_id", &valid); if (valid) _crmAccount->setId(param.toInt()); param = pParams.value("addr_line1", &valid); if (valid) _contact->addressWidget()->setLine1(param.toString()); param = pParams.value("addr_line2", &valid); if (valid) _contact->addressWidget()->setLine2(param.toString()); param = pParams.value("addr_line3", &valid); if (valid) _contact->addressWidget()->setLine3(param.toString()); param = pParams.value("addr_city", &valid); if (valid) _contact->addressWidget()->setCity(param.toString()); param = pParams.value("addr_state", &valid); if (valid) _contact->addressWidget()->setState(param.toString()); param = pParams.value("addr_postalcode", &valid); if (valid) _contact->addressWidget()->setPostalCode(param.toString()); param = pParams.value("addr_country", &valid); if (valid) _contact->addressWidget()->setCountry(param.toString()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _data->_mode = cNew; XSqlQuery getq; getq.exec("SELECT fetchNextNumber('ContactNumber') AS result;"); getq.first(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Number"), getq, __FILE__, __LINE__)) return UndefinedError; _number->setText(getq.value("result").toString()); _contact->setNumber(_number->text()); _contact->setFirst("Contact" + QDateTime::currentDateTime().toString()); int cntctSaveResult = _contact->save(AddressCluster::CHANGEONE); if (cntctSaveResult < 0) { ErrorReporter::error(QtCriticalMsg, this, tr("Saving Placeholder"), tr("

There was an error creating a new contact (%). " "Check the database server log for errors.") .arg(cntctSaveResult), __FILE__, __LINE__); return UndefinedError; } _comments->setId(_contact->id()); _documents->setId(_contact->id()); _contact->setFirst(""); connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); _contact->setOwnerUsername(omfgThis->username()); } else if (param.toString() == "edit") { _data->_mode = cEdit; connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); } else if (param.toString() == "view") { _data->_mode = cView; _buttonBox->setStandardButtons(QDialogButtonBox::Close); _contact->setEnabled(FALSE); _notes->setEnabled(FALSE); _comments->setReadOnly(true); _documents->setReadOnly(true); _newCharacteristic->setEnabled(FALSE); _editCharacteristic->setEnabled(FALSE); _deleteCharacteristic->setEnabled(FALSE); _charass->setEnabled(FALSE); } } return NoError; } void contact::sPopulateUsesMenu(QMenu* pMenu) { QAction *editAction = 0; QAction *viewAction = 0; QString editStr = tr("Edit..."); QString viewStr = tr("View..."); switch (_uses->altId()) { case 1: case 2: editAction = pMenu->addAction(editStr, this, SLOT(sEditCRMAccount())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewCRMAccount())); break; case 3: case 4: editAction = pMenu->addAction(editStr, this, SLOT(sEditCustomer())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewCustomer())); break; case 5: case 6: editAction = pMenu->addAction(editStr, this, SLOT(sEditVendor())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewVendor())); break; case 7: editAction = pMenu->addAction(editStr, this, SLOT(sEditProspect())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewProspect())); break; case 8: editAction = pMenu->addAction(editStr, this, SLOT(sEditShipto())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewShipto())); break; case 9: editAction = pMenu->addAction(editStr, this, SLOT(sEditVendorAddress())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewVendorAddress())); break; case 10: editAction = pMenu->addAction(editStr, this, SLOT(sEditWarehouse())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewWarehouse())); break; case 11: editAction = pMenu->addAction(editStr, this, SLOT(sEditEmployee())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewEmployee())); break; case 12: case 13: editAction = pMenu->addAction(editStr, this, SLOT(sEditSalesOrder())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewSalesOrder())); break; case 14: editAction = pMenu->addAction(editStr, this, SLOT(sEditIncident())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewIncident())); break; case 15: editAction = pMenu->addAction(editStr, this, SLOT(sEditLSReg())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewLSReg())); break; case 16: editAction = pMenu->addAction(editStr, this, SLOT(sEditOpportunity())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewOpportunity())); break; case 17: case 18: editAction = pMenu->addAction(editStr, this, SLOT(sEditPurchaseOrder())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewPurchaseOrder())); break; case 19: case 20: editAction = pMenu->addAction(editStr, this, SLOT(sEditQuote())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewQuote())); break; case 21: editAction = pMenu->addAction(editStr, this, SLOT(sEditTodoItem())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewTodoItem())); break; case 22: case 23: editAction = pMenu->addAction(editStr, this, SLOT(sEditTransferOrder())); viewAction = pMenu->addAction(viewStr, this, SLOT(sViewTransferOrder())); break; default: break; } struct privSet privs = _data->rowPrivs(_uses->currentItem()); editAction->setEnabled(privs.canEdit && (cView != _data->_mode)); viewAction->setEnabled(privs.canView); QAction *detachAction = pMenu->addAction(tr("Detach"), this, SLOT(sDetachUse())); detachAction->setEnabled(privs.canDetach && (cView != _data->_mode)); } void contact::sClose() { if (_data->_mode == cNew) { XSqlQuery delq; delq.prepare("DELETE FROM cntct WHERE (cntct_id=:cntct_id);" "SELECT releaseNumber('ContactNumber',:number);"); delq.bindValue(":cntct_id", _contact->id()); delq.bindValue(":number", _contact->number().toInt()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Cleaning up Contact"), delq, __FILE__, __LINE__)) return; } reject(); } void contact::sSave() { if (_contact->first().isEmpty() && _contact->last().isEmpty()) { QMessageBox::information(this, tr("Contact Blank"), tr("

You must fill in a contact first or last name as a minimum before saving.")); return; } if (_data->_activeCache && ! _contact->active()) { QString errmsg; bool ok = false; MetaSQLQuery getm = MQLUtil::mqlLoad("contact", "muststayactive", errmsg, &ok); if (! ok) { ErrorReporter::error(QtCriticalMsg, this, tr("In Use"), errmsg, __FILE__, __LINE__); return; } ParameterList getp; getp.append("id", _contact->id()); XSqlQuery getq = getm.toQuery(getp); getq.exec(); if (getq.first() && getq.value("inuse").toBool()) { QMessageBox::information(this, tr("Cannot make Contact inactive"), tr("

You may not mark this Contact as not " "Active when this person is a Contact " "for an active CRM Account, Customer, " "Vendor, or Prospect.")); return; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("In Use"), getq, __FILE__, __LINE__)) return; } /* save the address first so we can check for multiple uses, then save the contact with less error checking because this is contact maintenance */ AddressCluster* addr = _contact->addressWidget(); int saveResult = addr->save(AddressCluster::CHECK); if (-2 == saveResult) { int answer = 2; // Cancel answer = QMessageBox::question(this, tr("Question Saving Address"), tr("

There are multiple Contacts sharing this Address. " "What would you like to do?"), tr("Change This One"), tr("Change Address for All"), tr("Cancel"), 2, 2); if (0 == answer) saveResult = addr->save(AddressCluster::CHANGEONE); else if (1 == answer) saveResult = addr->save(AddressCluster::CHANGEALL); else return; } if (saveResult < 0) // check from errors for CHECK and CHANGE* saves { ErrorReporter::error(QtCriticalMsg, this, tr("Saving Address"), tr("

There was an error saving this Address (%1). " "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); return; } _contact->setAddress(saveResult); _contact->setNotes(_notes->toPlainText()); _contact->setOwnerUsername(_owner->username()); _contact->setCrmAcctId(_crmAccount->id()); _contact->setActive(_active->isChecked()); saveResult = _contact->save(AddressCluster::CHANGEALL); if (saveResult < 0) { ErrorReporter::error(QtCriticalMsg, this, tr("Saving Contact"), tr("

There was an error saving this Contact (%1). " "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); return; } done(_contact->id()); } void contact::sPopulate() { _number->setText(_contact->number()); _active->setChecked(_contact->active()); _crmAccount->setId(_contact->crmAcctId()); _owner->setUsername(_contact->owner()); _notes->setText(_contact->notes()); _data->_activeCache = _contact->active(); sFillList(); } void contact::sNewCharass() { ParameterList params; params.append("mode", "new"); params.append("cntct_id", _contact->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void contact::sEditCharass() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void contact::sDeleteCharass() { XSqlQuery delq; delq.prepare("DELETE FROM charass WHERE (charass_id=:charass_id);"); delq.bindValue(":charass_id", _charass->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Characteristic"), delq, __FILE__, __LINE__)) return; sFillList(); } void contact::sFillList() { XSqlQuery charq; charq.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value " "FROM charass, char " "WHERE ((charass_target_type='CNTCT')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:cntct_id) ) " "ORDER BY char_order, char_name;" ); charq.bindValue(":cntct_id", _contact->id()); charq.exec(); _charass->populate(charq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Characteristics"), charq, __FILE__, __LINE__)) return; QString errmsg; bool ok = false; MetaSQLQuery getm = MQLUtil::mqlLoad("contact", "uses", errmsg, &ok); if (! ok) { ErrorReporter::error(QtCriticalMsg, this, tr("Getting Contact Uses"), errmsg, __FILE__, __LINE__); return; } ParameterList getp; getp.append("core"); getp.append("id", _contact->id()); getp.append("billing", tr("Billing Contact")); getp.append("cohead", tr("Sales Order")); getp.append("correspond", tr("Correspondence Contact")); getp.append("crmacct", tr("CRM Account")); getp.append("cust", tr("Customer")); getp.append("emp", tr("Employee")); getp.append("ophead", tr("Opportunity")); getp.append("pohead", tr("Purchase Order")); getp.append("primary", tr("Primary Contact")); getp.append("prospect", tr("Prospect")); getp.append("quhead", tr("Quote")); getp.append("secondary", tr("Secondary Contact")); getp.append("shipto", tr("Ship-To Address")); getp.append("todo", tr("To-Do Item")); getp.append("vend", tr("Vendor")); getp.append("vendaddr", tr("Vendor Address")); getp.append("vendcntct", tr("Vendor Contact")); getp.append("whs", tr("Site")); getp.append("incdt", tr("Incident")); if (_metrics->boolean("LotSerialControl")) getp.append("lsreg", tr("Lot/Serial Registration")); if (_metrics->boolean("MultiWhs")) { getp.append("tohead", tr("Transfer Order")); getp.append("from", tr("Source Contact")); getp.append("dest", tr("Destination Contact")); } if (_showOrders->isChecked()) getp.append("showOrders"); XSqlQuery getq = getm.toQuery(getp); _uses->populate(getq, true); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Contact Uses"), getq, __FILE__, __LINE__)) return; } void contact::sDetachUse() { QString question; XSqlQuery detachq; switch (_uses->altId()) { case 1: question = tr("Are you sure that you want to remove this Contact as " "the Primary Contact for this CRM Account?"); detachq.prepare("UPDATE crmacct SET crmacct_cntct_id_1 = NULL " "WHERE (crmacct_id=:id);"); break; case 2: question = tr("Are you sure that you want to remove this Contact as " "the Secondary Contact for this CRM Account?"); detachq.prepare("UPDATE crmacct SET crmacct_cntct_id_2 = NULL " "WHERE (crmacct_id=:id);"); break; case 3: question = tr("Are you sure that you want to remove this Contact as " "the Billing Contact for this Customer?"); detachq.prepare("UPDATE custinfo SET cust_cntct_id = NULL " "WHERE (cust_id=:id);"); break; case 4: question = tr("Are you sure that you want to remove this Contact as " "the Correspondence Contact for this Customer?"); detachq.prepare("UPDATE custinfo SET cust_corrcntct_id = NULL " "WHERE (cust_id=:id);"); break; case 5: question = tr("Are you sure that you want to remove this Contact as " "the Primary Contact for this Vendor?"); detachq.prepare("UPDATE vendinfo SET vend_cntct1_id = NULL " "WHERE (vend_id=:id);"); break; case 6: question = tr("Are you sure that you want to remove this Contact as " "the Secondary Contact for this Vendor?"); detachq.prepare("UPDATE vendinfo SET vend_cntct2_id = NULL " "WHERE (vend_id=:id);"); break; case 7: question = tr("Are you sure that you want to remove this Contact as " "the Contact for this Prospect?"); detachq.prepare("UPDATE prospect SET prospect_cntct_id = NULL " "WHERE (prospect_id=:id);"); break; case 8: question = tr("Are you sure that you want to remove this Contact as " "the Contact for this Ship-To Address?"); detachq.prepare("UPDATE shiptoinfo SET shipto_cntct_id = NULL " "WHERE (shipto_id=:id);"); break; case 9: question = tr("Are you sure that you want to remove this Contact as " "the Contact for this Vendor Address?"); detachq.prepare("UPDATE vendaddrinfo SET vendaddr_cntct_id = NULL " "WHERE (vendaddr_id=:id);"); break; case 10: question = tr("Are you sure that you want to remove this Contact as " "the Contact for this Site?"); detachq.prepare("UPDATE whsinfo SET warehous_cntct_id = NULL " "WHERE (warehous_id=:id);"); break; case 11: question = tr("Are you sure that you want to remove this Contact as " "the Contact for this Employee?"); detachq.prepare("UPDATE emp SET emp_cntct_id = NULL " "WHERE (emp_id=:id);"); break; case 12: question = tr("Are you sure that you want to remove the link between " "this Contact and this Sales Order? The name and address " "will still be kept in the order for future reference."); detachq.prepare("UPDATE cohead SET cohead_billto_cntct_id = NULL" " WHERE (cohead_id=:id);"); break; case 13: question = tr("Are you sure that you want to remove the link between " "this Contact and this Sales Order? The name and address " "will still be kept in the order for future reference."); detachq.prepare("UPDATE cohead SET cohead_shipto_cntct_id = NULL" " WHERE (cohead_id=:id);"); break; case 14: question = tr("Are you sure you want to remove this Contact as " "the Contact for this Incident?"); detachq.prepare("UPDATE incdt SET incdt_cntct_id = NULL" " WHERE (incdt_id=:id);"); break; case 15: question = tr("Are you sure you want to remove this Contact as " "the Contact for this Lot/Serial Registration?"); detachq.prepare("UPDATE lsreg SET lsreg_cntct_id = NULL" " WHERE lsreg_id=:id;"); break; case 16: question = tr("Are you sure you want to remove this Contact as " "the Contact for this Opportunity?"); detachq.prepare("UPDATE ophead SET ophead_cntct_id = NULL" " WHERE ophead_id=:id;"); break; case 17: question = tr("Are you sure you want to remove the link between " "this Contact and this Purchase Order? The name and address " "will still be kept in the order for future reference."); detachq.prepare("UPDATE pohead SET pohead_vend_cntct_id = NULL" " WHERE pohead_id=:id;"); break; case 18: question = tr("Are you sure you want to remove the link between " "this Contact and this Purchase Order? The name and address " "will still be kept in the order for future reference."); detachq.prepare("UPDATE pohead SET pohead_shipto_cntct_id = NULL" " WHERE pohead_id=:id;"); break; case 19: question = tr("Are you sure you want to remove the link between " "this Contact and this Quote? The name and address " "will still be kept in the quote for future reference."); detachq.prepare("UPDATE quhead SET quhead_billto_cntct_id = NULL" " WHERE quhead_id=:id;"); break; case 20: question = tr("Are you sure you want to remove the link between " "this Contact and this Quote? The name and address " "will still be kept in the quote for future reference."); detachq.prepare("UPDATE quhead SET quhead_shipto_cntct_id = NULL" " WHERE quhead_id=:id;"); break; case 21: question = tr("Are you sure you want to remove this Contact as " "the Contact for this To-Do Item?"); detachq.prepare("UPDATE todoitem SET todoitem_cntct_id = NULL" " WHERE todoitem_id=:id;"); break; case 22: question = tr("Are you sure you want to remove the link between " "this Contact and this Transfer Order? The name and address " "will still be kept in the order for future reference."); detachq.prepare("UPDATE tohead SET tohead_srccntct_id = NULL" " WHERE tohead_id=:id;"); break; case 23: question = tr("Are you sure you want to remove the link between " "this Contact and this Transfer Order? The name and address " "will still be kept in the order for future reference."); detachq.prepare("UPDATE tohead SET tohead_destcntct_id = NULL" " WHERE tohead_id=:id;"); break; default: break; } if (! question.isEmpty() && QMessageBox::question(this, tr("Detach Contact?"), question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; detachq.bindValue(":id", _uses->id()); detachq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Detaching"), detachq, __FILE__, __LINE__)) return; sFillList(); } void contact::sEditUse() { switch (_uses->altId()) { case 1: case 2: sEditCRMAccount(); break; case 3: case 4: sEditCustomer(); break; case 5: case 6: sEditVendor(); break; case 7: sEditProspect(); break; case 8: sEditShipto(); break; case 9: sEditVendorAddress(); break; case 10: sEditWarehouse(); break; case 11: sEditEmployee(); break; case 12: case 13: sEditSalesOrder(); break; case 14: sEditIncident(); break; case 15: sEditLSRegistration(); break; case 16: sEditOpportunity(); break; case 17: case 18: sEditPurchaseOrder(); break; case 19: case 20: sEditQuote(); break; case 21: sEditTodoItem(); break; case 22: case 23: sEditTransferOrder(); break; default: break; } } void contact::sViewUse() { switch (_uses->altId()) { case 1: case 2: sViewCRMAccount(); break; case 3: case 4: sViewCustomer(); break; case 5: case 6: sViewVendor(); break; case 7: sViewProspect(); break; case 8: sViewShipto(); break; case 9: sViewVendorAddress(); break; case 10: sViewWarehouse(); break; case 11: sViewEmployee(); break; case 12: case 13: sViewSalesOrder(); break; case 14: sViewIncident(); break; case 15: sViewLSRegistration(); break; case 16: sViewOpportunity(); break; case 17: case 18: sViewPurchaseOrder(); break; case 19: case 20: sViewQuote(); break; case 21: sViewTodoItem(); break; case 22: case 23: sViewTransferOrder(); break; default: break; } } void contact::sHandleValidUse(bool valid) { disconnect(_uses, SIGNAL(itemSelected(int)), _editUse, SLOT(animateClick())); disconnect(_uses, SIGNAL(itemSelected(int)), _viewUse, SLOT(animateClick())); struct privSet privs = _data->rowPrivs(_uses->currentItem()); _detachUse->setEnabled(valid && privs.canDetach && _data->_mode != cView); _editUse->setEnabled(valid && privs.canEdit && _data->_mode != cView); _viewUse->setEnabled(valid && privs.canView); if (_editUse->isEnabled()) connect(_uses, SIGNAL(itemSelected(int)), _editUse, SLOT(animateClick())); else if (_viewUse->isEnabled()) connect(_uses, SIGNAL(itemSelected(int)), _viewUse, SLOT(animateClick())); } void contact::sEditCRMAccount() { ParameterList params; params.append("mode", "edit"); params.append("crmacct_id", _uses->id()); params.append("modal"); crmaccount *newdlg = new crmaccount(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void contact::sViewCRMAccount() { ParameterList params; params.append("mode", "view"); params.append("crmacct_id", _uses->id()); params.append("modal"); crmaccount *newdlg = new crmaccount(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void contact::sEditCustomer() { ParameterList params; params.append("mode", "edit"); params.append("cust_id", _uses->id()); customer *newdlg = new customer(0, "custForContact", Qt::Dialog); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sViewCustomer() { ParameterList params; params.append("mode", "view"); params.append("cust_id", _uses->id()); customer *newdlg = new customer(0, "custForContact", Qt::Dialog); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sEditEmployee() { ParameterList params; params.append("mode", "edit"); params.append("emp_id", _uses->id()); employee newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewEmployee() { ParameterList params; params.append("mode", "view"); params.append("emp_id", _uses->id()); employee newdlg(this); newdlg.set(params); newdlg.exec(); } void contact::sEditIncident() { ParameterList params; params.append("mode", "edit"); params.append("incdt_id", _uses->id()); incident newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewIncident() { ParameterList params; params.append("mode", "view"); params.append("incdt_id", _uses->id()); incident newdlg(this); newdlg.set(params); newdlg.exec(); } void contact::sEditLSRegistration() { ParameterList params; params.append("mode", "edit"); params.append("lsreg_id", _uses->id()); lotSerialRegistration newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewLSRegistration() { ParameterList params; params.append("mode", "view"); params.append("lsreg_id", _uses->id()); lotSerialRegistration newdlg(this); newdlg.set(params); newdlg.exec(); } void contact::sEditOpportunity() { ParameterList params; params.append("mode", "edit"); params.append("ophead_id", _uses->id()); opportunity newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewOpportunity() { ParameterList params; params.append("mode", "view"); params.append("ophead_id", _uses->id()); opportunity newdlg(this); newdlg.set(params); newdlg.exec(); } void contact::sEditProspect() { ParameterList params; params.append("mode", "edit"); params.append("prospect_id", _uses->id()); prospect *newdlg = new prospect(0, "prospectForContact", Qt::Dialog); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sViewProspect() { ParameterList params; params.append("mode", "view"); params.append("prospect_id", _uses->id()); prospect *newdlg = new prospect(0, "prospectForContact", Qt::Dialog); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sEditPurchaseOrder() { ParameterList params; params.append("mode", "edit"); params.append("pohead_id", _uses->id()); purchaseOrder *newdlg = new purchaseOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sViewPurchaseOrder() { ParameterList params; params.append("mode", "view"); params.append("pohead_id", _uses->id()); purchaseOrder *newdlg = new purchaseOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sEditQuote() { ParameterList params; params.append("mode", "edit"); params.append("quhead_id", _uses->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sViewQuote() { ParameterList params; params.append("mode", "view"); params.append("quhead_id", _uses->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sEditSalesOrder() { ParameterList params; params.append("mode", "edit"); params.append("sohead_id", _uses->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sViewSalesOrder() { ParameterList params; params.append("mode", "view"); params.append("sohead_id", _uses->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sEditShipto() { ParameterList params; params.append("mode", "edit"); params.append("shipto_id", _uses->id()); shipTo newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewShipto() { ParameterList params; params.append("mode", "view"); params.append("shipto_id", _uses->id()); shipTo newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void contact::sEditTodoItem() { ParameterList params; params.append("mode", "edit"); params.append("todoitem_id", _uses->id()); todoItem newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewTodoItem() { ParameterList params; params.append("mode", "view"); params.append("todoitem_id", _uses->id()); todoItem newdlg(this); newdlg.set(params); newdlg.exec(); } void contact::sEditTransferOrder() { ParameterList params; params.append("mode", "edit"); params.append("tohead_id", _uses->id()); transferOrder *newdlg = new transferOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sViewTransferOrder() { ParameterList params; params.append("mode", "view"); params.append("tohead_id", _uses->id()); transferOrder *newdlg = new transferOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sEditVendorAddress() { ParameterList params; params.append("mode", "edit"); params.append("vendaddr_id", _uses->id()); vendorAddress newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewVendorAddress() { ParameterList params; params.append("mode", "view"); params.append("vendaddr_id", _uses->id()); vendorAddress newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void contact::sEditVendor() { ParameterList params; params.append("mode", "edit"); params.append("vend_id", _uses->id()); vendor *newdlg = new vendor(0, "vendorForContact", Qt::Dialog); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sViewVendor() { ParameterList params; params.append("mode", "view"); params.append("vend_id", _uses->id()); vendor *newdlg = new vendor(0, "vendorForContact", Qt::Dialog); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void contact::sEditWarehouse() { ParameterList params; params.append("mode", "edit"); params.append("warehous_id", _uses->id()); warehouse newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void contact::sViewWarehouse() { ParameterList params; params.append("mode", "view"); params.append("warehous_id", _uses->id()); warehouse newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/contact.h000066400000000000000000000050371217451700100172060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONTACT_H #define CONTACT_H #include "guiclient.h" #include "xdialog.h" #include #include #include #include "addresscluster.h" #include "contactcluster.h" class contactPrivate; class contact : public XDialog, public Ui::contact { Q_OBJECT public: contact(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~contact(); QPushButton *_save; public slots: virtual SetResponse set(const ParameterList &pParams); protected slots: virtual void languageChange(); virtual void sClose(); virtual void sDeleteCharass(); virtual void sDetachUse(); virtual void sEditCRMAccount(); virtual void sEditCharass(); virtual void sEditCustomer(); virtual void sEditEmployee(); virtual void sEditIncident(); virtual void sEditLSRegistration(); virtual void sEditOpportunity(); virtual void sEditProspect(); virtual void sEditPurchaseOrder(); virtual void sEditQuote(); virtual void sEditSalesOrder(); virtual void sEditShipto(); virtual void sEditTodoItem(); virtual void sEditTransferOrder(); virtual void sEditUse(); virtual void sEditVendor(); virtual void sEditVendorAddress(); virtual void sEditWarehouse(); virtual void sFillList(); virtual void sHandleValidUse(bool); virtual void sNewCharass(); virtual void sPopulate(); virtual void sPopulateUsesMenu(QMenu*); virtual void sSave(); virtual void sViewCRMAccount(); virtual void sViewCustomer(); virtual void sViewEmployee(); virtual void sViewIncident(); virtual void sViewLSRegistration(); virtual void sViewOpportunity(); virtual void sViewProspect(); virtual void sViewPurchaseOrder(); virtual void sViewQuote(); virtual void sViewSalesOrder(); virtual void sViewShipto(); virtual void sViewTodoItem(); virtual void sViewTransferOrder(); virtual void sViewUse(); virtual void sViewVendor(); virtual void sViewVendorAddress(); virtual void sViewWarehouse(); protected: contactPrivate *_data; }; #endif // CONTACT_H qt-client-4.1.0/guiclient/contact.ui000066400000000000000000000332501217451700100173720ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. contact 0 0 818 674 0 0 Contact 12 Number: 100 0 Active true Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 1 QFrame::NoFrame QFrame::Raised 0 true false true true false true 0 1 Qt::WheelFocus 0 General Qt::StrongFocus Account #: Qt::StrongFocus Owner: Qt::Vertical 20 40 0 1 Notes true Comments Qt::StrongFocus Comments::Contact Characteristics true New false Edit false Delete Qt::Vertical 20 40 Uses of the Contact Edit View Detach Qt::Vertical 20 40 Show Orders Documents Documents::Contact Comments QWidget

comments.h
ContactWidget QWidget
contactwidget.h
CRMAcctCluster QWidget
crmacctcluster.h
Documents QWidget
documents.h
UsernameCluster QWidget
usernamecluster.h
XCheckBox QCheckBox
xcheckbox.h
XTreeWidget QTreeWidget
xtreewidget.h
1
XTextEdit QTextEdit
xtextedit.h
_contact _tabWidget _crmAccount _owner _notes _comments _charass _newCharacteristic _editCharacteristic _deleteCharacteristic _uses _editUse _viewUse _detachUse _active _charass itemSelected(int) _editCharacteristic animateClick() 376 604 376 604 _charass valid(bool) _deleteCharacteristic setEnabled(bool) 376 604 376 604 _charass valid(bool) _editCharacteristic setEnabled(bool) 376 604 376 604 qt-client-4.1.0/guiclient/contactMerge.cpp000066400000000000000000000472511217451700100205250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "contactMerge.h" #include "contact.h" #include #include #include #include "mqlutil.h" contactMerge::contactMerge(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_mode, SIGNAL(currentIndexChanged(int)), this, SLOT(sHandleMode())); connect(_process, SIGNAL(clicked()), this, SLOT(sProcess())); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_cntct, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *)), this, SLOT(sPopulateCntctMenu(QMenu *))); connect(_srccntct, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateSrcMenu(QMenu *,QTreeWidgetItem *, int))); connect(_cntct, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sCntctEdit())); connect(_srccntct, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sSrcCntctEdit())); connect(_target, SIGNAL(valid(bool)), this, SLOT(sHandleProcess())); _cntct->addColumn(tr("Contact#"), 100, Qt::AlignLeft, true, "cntct_number"); _cntct->addColumn(tr("Active"), 50, Qt::AlignLeft, true, "cntct_active"); _cntct->addColumn(tr("Acct.#"), 100, Qt::AlignLeft, false, "crmacct_number"); _cntct->addColumn(tr("Acct. Name"), 100, Qt::AlignLeft, false, "crmacct_name"); _cntct->addColumn(tr("Hnrfc"), 50, Qt::AlignLeft, false, "cntct_honorific"); _cntct->addColumn(tr("First"), 80, Qt::AlignLeft, true, "cntct_first_name"); _cntct->addColumn(tr("Middle"), 50, Qt::AlignLeft, false, "cntct_middle"); _cntct->addColumn(tr("Last"), -1, Qt::AlignLeft, true, "cntct_last_name"); _cntct->addColumn(tr("Suffix"), 80, Qt::AlignLeft, false, "cntct_suffix"); _cntct->addColumn(tr("Initials"), 80, Qt::AlignLeft, false, "cntct_initials"); _cntct->addColumn(tr("Phone"), 100, Qt::AlignLeft, true, "cntct_phone"); _cntct->addColumn(tr("Alt. Phone"), 100, Qt::AlignLeft, false, "cntct_phone2"); _cntct->addColumn(tr("Fax"), 100, Qt::AlignLeft, true, "cntct_fax"); _cntct->addColumn(tr("Email"), 100, Qt::AlignLeft, true, "cntct_email"); _cntct->addColumn(tr("Web"), 100, Qt::AlignLeft, false, "cntct_webaddr"); _cntct->addColumn(tr("Title"), 100, Qt::AlignLeft, true, "cntct_title"); _cntct->addColumn(tr("Owner"), 80, Qt::AlignLeft, true, "cntct_owner_username"); _cntct->addColumn(tr("Notes"), 100, Qt::AlignLeft, false, "cntct_notes"); _cntct->addColumn(tr("Address1"), 100, Qt::AlignLeft, false, "addr_line1"); _cntct->addColumn(tr("Address2"), 100, Qt::AlignLeft, false, "addr_line2"); _cntct->addColumn(tr("Address3"), 100, Qt::AlignLeft, false, "addr_line3"); _cntct->addColumn(tr("City"), 100, Qt::AlignLeft, false, "addr_city"); _cntct->addColumn(tr("State"), 50, Qt::AlignLeft, false, "addr_state"); _cntct->addColumn(tr("Postal"), 80, Qt::AlignLeft, false, "addr_postalcode"); _cntct->addColumn(tr("Country"), 100, Qt::AlignLeft, false, "addr_country"); _srccntct->addColumn(tr("Contact#"), 100, Qt::AlignLeft, true, "cntct_number"); _srccntct->addColumn(tr("Active"), 50, Qt::AlignLeft, true, "cntct_active"); _srccntct->addColumn(tr("Acct.#"), 100, Qt::AlignLeft, false, "crmacct_number"); _srccntct->addColumn(tr("Acct. Name"), 100, Qt::AlignLeft, false, "crmacct_name"); _srccntct->addColumn(tr("Hnrfc"), 50, Qt::AlignLeft, false, "cntct_honorific"); _srccntct->addColumn(tr("First"), 80, Qt::AlignLeft, true, "cntct_first_name"); _srccntct->addColumn(tr("Middle"), 50, Qt::AlignLeft, false, "cntct_middle"); _srccntct->addColumn(tr("Last"), -1, Qt::AlignLeft, true, "cntct_last_name"); _srccntct->addColumn(tr("Suffix"), 80, Qt::AlignLeft, false, "cntct_suffix"); _srccntct->addColumn(tr("Initials"), 80, Qt::AlignLeft, false, "cntct_initials"); _srccntct->addColumn(tr("Phone"), 100, Qt::AlignLeft, true, "cntct_phone"); _srccntct->addColumn(tr("Alt. Phone"), 100, Qt::AlignLeft, false, "cntct_phone2"); _srccntct->addColumn(tr("Fax"), 100, Qt::AlignLeft, true, "cntct_fax"); _srccntct->addColumn(tr("Email"), 100, Qt::AlignLeft, true, "cntct_email"); _srccntct->addColumn(tr("Web"), 100, Qt::AlignLeft, false, "cntct_webaddr"); _srccntct->addColumn(tr("Title"), 100, Qt::AlignLeft, true, "cntct_title"); _srccntct->addColumn(tr("Owner"), 80, Qt::AlignLeft, true, "cntct_owner_username"); _srccntct->addColumn(tr("Notes"), 100, Qt::AlignLeft, false, "cntct_notes"); _srccntct->addColumn(tr("Address1"), 100, Qt::AlignLeft, false, "addr_line1"); _srccntct->addColumn(tr("Address2"), 100, Qt::AlignLeft, false, "addr_line2"); _srccntct->addColumn(tr("Address3"), 100, Qt::AlignLeft, false, "addr_line3"); _srccntct->addColumn(tr("City"), 100, Qt::AlignLeft, false, "addr_city"); _srccntct->addColumn(tr("State"), 50, Qt::AlignLeft, false, "addr_state"); _srccntct->addColumn(tr("Postal"), 80, Qt::AlignLeft, false, "addr_postalcode"); _srccntct->addColumn(tr("Country"), 100, Qt::AlignLeft, false, "addr_country"); _target->setAccountVisible(true); _target->setOwnerVisible(true); _target->setActiveVisible(false); _target->setInitialsVisible(false); sPopulateSources(); sPopulateTarget(); } contactMerge::~contactMerge() { // no need to delete child widgets, Qt does it all for us } void contactMerge::languageChange() { retranslateUi(this); } void contactMerge::sAdd() { sSelect(false); } void contactMerge::sCntctEdit() { ParameterList params; params.append("mode", "edit"); params.append("cntct_id", _cntct->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void contactMerge::sCntctView() { ParameterList params; params.append("mode", "view"); params.append("cntct_id", _cntct->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void contactMerge::sCntctDelete() { XSqlQuery contactCntctDelete; QString question = tr("The delete action cannot be undone. " "Are you sure you want to proceed?"); if (QMessageBox::question(this, tr("Delete Contact Merg?"), question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; MetaSQLQuery mql = mqlLoad("contactmerge", "delete"); ParameterList params; params.append("cntct_id", _cntct->id()); contactCntctDelete = mql.toQuery(params); if (contactCntctDelete.lastError().type() != QSqlError::NoError) { systemError(this, contactCntctDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void contactMerge::sCntctDoubleClicked() { if ((_cntct->altId() == 0) || (_cntct->altId() == 4)) // cNone or cError { sSelect(false); } else if ((_cntct->altId() == 1) || (_cntct->altId() == 2)) // cTarget or cSource { sDeselect(_cntct->id()); } } void contactMerge::sDeselect(int id) { XSqlQuery contactDeselect; MetaSQLQuery mql = mqlLoad("contactmerge", "deselect"); ParameterList params; params.append("cntct_id", id); contactDeselect = mql.toQuery(params); if (contactDeselect.lastError().type() != QSqlError::NoError) { systemError(this, contactDeselect.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void contactMerge::sDeselectCntct() { sDeselect(_cntct->id()); } void contactMerge::sDeselectSource() { sDeselect(_srccntct->id()); } void contactMerge::sFillList() { if ((_mode->currentIndex() == 0) || (_mode->currentIndex() == 2)) // cMerge or cMergePurge { ParameterList params; params.append("searchText", _search->text()); params.append("searchContactName", QVariant(_searchContact->isChecked())); params.append("searchPhone", QVariant(_searchPhone->isChecked())); params.append("searchEmail", QVariant(_searchEmail->isChecked())); params.append("searchNumber", QVariant(_searchNumber->isChecked())); params.append("searchName", QVariant(_searchName->isChecked())); params.append("showInactive", QVariant(_showInactive->isChecked())); params.append("ignoreBlanks", QVariant(!_blanks->isChecked())); params.append("IndentedDups", QVariant(_showGroup->isChecked())); params.append("CheckHnfc", QVariant(_showGroup->isChecked() && _checkHonorific->isChecked())); params.append("CheckFirst", QVariant(_showGroup->isChecked() && _checkFirst->isChecked())); params.append("CheckMiddle", QVariant(_showGroup->isChecked() && _checkMiddle->isChecked())); params.append("CheckLast", QVariant(_showGroup->isChecked() && _checkLast->isChecked())); params.append("CheckSuffix", QVariant(_showGroup->isChecked() && _checkSuffix->isChecked())); params.append("CheckPhone", QVariant(_showGroup->isChecked() && _checkPhone->isChecked())); params.append("CheckEmail", QVariant(_showGroup->isChecked() && _checkEmail->isChecked())); MetaSQLQuery mql = mqlLoad("contactmerge", "search"); XSqlQuery qry = mql.toQuery(params); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } _cntct->populate(qry, true); } else { ParameterList params; MetaSQLQuery mql = mqlLoad("contactmerge", "merged"); XSqlQuery qry = mql.toQuery(params); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } _cntct->populate(qry, true); } _cntct->expandAll(); sPopulateSources(); sPopulateTarget(); } void contactMerge::sHandleMode() { bool canSearch = ((_mode->currentIndex() == 0) || (_mode->currentIndex() == 2)); // cMerge or cMergePurge _searchLit->setVisible(canSearch); _search->setVisible(canSearch); _showGroup->setVisible(canSearch); _searchGroup->setVisible(canSearch); sHandleProcess(); _process->setText(_mode->currentText()); _tab->setTabEnabled(_tab->indexOf(_selTab), canSearch); if (canSearch) _cntct->clear(); else sFillList(); } void contactMerge::sHandleProcess() { bool valid = (_target->isValid()); _process->setEnabled((valid && (_mode->currentIndex() == 0 || //cMerge _mode->currentIndex() == 2)) || //cMergePurge (_mode->currentIndex() == 3 || //cMerged _mode->currentIndex() == 1)); //cPurge } void contactMerge::sPopulateCntctMenu(QMenu *pMenu) { XSqlQuery contactPopulateCntctMenu; if (_cntct->id() == -1) return; QAction *menuItem; if (_cntct->altId() == 0 || // cNone _cntct->altId() == 4) // cError { menuItem = pMenu->addAction(tr("Set as Source..."), this, SLOT(sAdd())); } if (_cntct->altId() != 1) // cTarget { menuItem = pMenu->addAction(tr("Set as Target..."), this, SLOT(sSetTarget())); } if (_cntct->altId() == 1 || // cTarget _cntct->altId() == 2) // cSource { menuItem = pMenu->addAction(tr("Deselect..."), this, SLOT(sDeselectCntct())); } if (_cntct->altId() == 3) // cMerged { menuItem = pMenu->addAction(tr("Restore..."), this, SLOT(sRestore())); menuItem = pMenu->addAction(tr("Purge..."), this, SLOT(sPurge())); } pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sCntctEdit())); menuItem->setEnabled(_privileges->check("MaintainAllContacts") || (_cntct->currentItem()->rawValue("cntct_owner_username") == omfgThis->username() && _privileges->check("MaintainPersonalContacts"))); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sCntctView())); menuItem->setEnabled(_privileges->check("MaintainAllContacts") || (_cntct->currentItem()->rawValue("cntct_owner_username") == omfgThis->username() && _privileges->check("MaintainPersonalContacts")) || _privileges->check("ViewAllContacts") || (_cntct->currentItem()->rawValue("cntct_owner_username") == omfgThis->username() && _privileges->check("ViewPersonalContacts"))); if (_cntct->altId() != 3) // cMerged { // Check to see if this contact is used, if not add delete action ParameterList params; params.append("cntct_id", _cntct->id()); MetaSQLQuery mql = mqlLoad("contactmerge", "contactused"); contactPopulateCntctMenu = mql.toQuery(params); if (contactPopulateCntctMenu.lastError().type() != QSqlError::NoError) { systemError(this, contactPopulateCntctMenu.lastError().databaseText(), __FILE__, __LINE__); return; } if (contactPopulateCntctMenu.first() && !contactPopulateCntctMenu.value("used").toBool()) { menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sCntctDelete())); menuItem->setEnabled(_privileges->check("MaintainAllContacts")); } } } void contactMerge::sPopulateSrcMenu(QMenu *pMenu, QTreeWidgetItem *pItem, int pCol) { Q_UNUSED(pItem); QAction *menuItem; QString col = ""; QString menuStr; if (pCol == 2 || pCol == 3) col = tr("CRM Account"); else if (pCol == 4) col = tr("Honorific"); else if (pCol == 5) col = tr("First Name"); else if (pCol == 6) col = tr("Middle Initial"); else if (pCol == 7) col = tr("Last Name"); else if (pCol == 8) col = tr("Suffix"); else if (pCol == 9) col = tr("Initials"); else if (pCol == 10) col = tr("Phone"); else if (pCol == 11) col = tr("Alt. Phone"); else if (pCol == 12) col = tr("Fax"); else if (pCol == 13) col = tr("Email"); else if (pCol == 14) col = tr("Web Address"); else if (pCol == 15) col = tr("Title"); else if (pCol == 16) col = tr("Owner"); else if (pCol == 17) col = tr("Notes"); else if (pCol >= 18) col = tr("Address"); menuStr = tr("Merge ") + col + tr(" to target"); _selectCol = pCol; menuItem = pMenu->addAction(tr("Deselect"), this, SLOT(sDeselectSource())); if (col.length() > 0) menuItem = pMenu->addAction(menuStr, this, SLOT(sSelectCol())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sCntctEdit())); menuItem->setEnabled(_privileges->check("MaintainAllContacts")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sCntctView())); menuItem->setEnabled(_privileges->check("MaintainAllContacts") || _privileges->check("ViewAllContacts")); } void contactMerge::sPopulateSources() { XSqlQuery contactPopulateSources; ParameterList params; params.append("target", QVariant(false)); MetaSQLQuery mql = mqlLoad("contactmerge", "populate"); contactPopulateSources = mql.toQuery(params); if (contactPopulateSources.lastError().type() != QSqlError::NoError) { systemError(this, contactPopulateSources.lastError().databaseText(), __FILE__, __LINE__); return; } _srccntct->populate(contactPopulateSources); } void contactMerge::sPopulateTarget() { XSqlQuery contactPopulateTarget; QString grpTitle = tr("Target Contact"); ParameterList params; params.append("target", QVariant(true)); MetaSQLQuery mql = mqlLoad("contactmerge", "populate"); contactPopulateTarget = mql.toQuery(params); if (contactPopulateTarget.lastError().type() != QSqlError::NoError) { systemError(this, contactPopulateTarget.lastError().databaseText(), __FILE__, __LINE__); return; } if (contactPopulateTarget.first()) { _target->setId(contactPopulateTarget.value("cntct_id").toInt()); _targetGroup->setTitle(grpTitle + " (#" + contactPopulateTarget.value("cntct_number").toString() + ")"); } else { _target->setId(-1); _targetGroup->setTitle(grpTitle); } sHandleProcess(); } void contactMerge::sProcess() { XSqlQuery contactProcess; ParameterList params; QString qry; if ((_mode->currentIndex() == 0) || (_mode->currentIndex() == 2)) // cMerge or cMergePurge { if (_mode->currentIndex() == 2 && !purgeConfirm()) // cMergePurge return; qry = "merge"; if (_mode->currentIndex() == 2) params.append("purge", true); else params.append("purge", false); } else if (_mode->currentIndex() == 1) // cPurge { if (!purgeConfirm()) return; qry = "purge"; } else { qry = "restore"; } MetaSQLQuery mql = mqlLoad("contactmerge", qry); contactProcess = mql.toQuery(params); if (contactProcess.lastError().type() != QSqlError::NoError) { systemError(this, contactProcess.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void contactMerge::sPurge() { XSqlQuery contactPurge; if (!purgeConfirm()) return; MetaSQLQuery mql = mqlLoad("contactmerge", "purge"); ParameterList params; params.append("cntct_id", _cntct->id()); contactPurge = mql.toQuery(params); if (contactPurge.lastError().type() != QSqlError::NoError) { systemError(this, contactPurge.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } bool contactMerge::purgeConfirm() { QString question = tr("The purge action cannot be undone. " "Are you sure you want to proceed?"); if (QMessageBox::question(this, tr("Purge Contact Merge?"), question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return false; return true; } void contactMerge::sRestore() { XSqlQuery contactRestore; MetaSQLQuery mql = mqlLoad("contactmerge", "restore"); ParameterList params; params.append("cntct_id", _cntct->id()); contactRestore = mql.toQuery(params); if (contactRestore.lastError().type() != QSqlError::NoError) { systemError(this, contactRestore.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void contactMerge::sSelect(bool target) { XSqlQuery contactSelect; MetaSQLQuery mql = mqlLoad("contactmerge", "select"); ParameterList params; params.append("cntct_id", _cntct->id()); params.append("target", QVariant(target)); contactSelect = mql.toQuery(params); if (contactSelect.lastError().type() != QSqlError::NoError) { systemError(this, contactSelect.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void contactMerge::sSelectCol() { XSqlQuery contactSelectCol; MetaSQLQuery mql = mqlLoad("contactmerge", "selectcol"); ParameterList params; params.append("cntct_id", _srccntct->id()); params.append("col_number", _selectCol); contactSelectCol = mql.toQuery(params); if (contactSelectCol.lastError().type() != QSqlError::NoError) { systemError(this, contactSelectCol.lastError().databaseText(), __FILE__, __LINE__); return; } sPopulateSources(); } void contactMerge::sSetTarget() { sSelect(true); } void contactMerge::sSrcCntctEdit() { ParameterList params; params.append("mode", "edit"); params.append("cntct_id", _srccntct->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void contactMerge::sSrcCntctView() { ParameterList params; params.append("mode", "view"); params.append("cntct_id", _srccntct->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } qt-client-4.1.0/guiclient/contactMerge.h000066400000000000000000000032761217451700100201710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONTACTMERGE_H #define CONTACTMERGE_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_contactMerge.h" class contactMerge : public XWidget, public Ui::contactMerge { Q_OBJECT public: contactMerge(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~contactMerge(); protected slots: virtual void languageChange(); virtual void sAdd(); virtual void sCntctDelete(); virtual void sCntctDoubleClicked(); virtual void sCntctEdit(); virtual void sCntctView(); virtual void sSrcCntctEdit(); virtual void sSrcCntctView(); virtual void sFillList(); virtual void sHandleMode(); virtual void sHandleProcess(); virtual void sPopulateCntctMenu(QMenu *); virtual void sPopulateSrcMenu(QMenu *, QTreeWidgetItem *, int); virtual void sPopulateSources(); virtual void sPopulateTarget(); virtual void sProcess(); virtual void sPurge(); virtual bool purgeConfirm(); virtual void sRestore(); virtual void sSelect(bool); virtual void sSelectCol(); virtual void sSetTarget(); virtual void sDeselect(int); virtual void sDeselectCntct(); virtual void sDeselectSource(); private: int _selectCol; }; #endif // CONTACTMERGE_H qt-client-4.1.0/guiclient/contactMerge.ui000066400000000000000000000376151217451700100203630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2009 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. contactMerge 0 0 800 600 Contact Merge Utility Mode: Merge Purge Merge and Purge Restore Qt::Horizontal 40 20 false Merge &Close 0 Contacts Search for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 0 20 Query false Search Through 12 Name true true Blank Contact Names true Phone # true true Account Number true true &Inactive true true Email true true Account Name true true Find duplicates with matching criteria: true false 12 Honorific false true First true true Middle true Last true true Suffix true Phone # true Email true Qt::Horizontal 0 20 0 Contacts 0 1 QFrame::NoFrame QFrame::Raised 0 0 2 Right click for selection options Selections 0 1 Source Contacts Right click for selection options Target Contact false ContactCluster QWidget
contactcluster.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
XTreeWidget QTreeWidget
xtreewidget.h
_search _searchName _searchContact
qt-client-4.1.0/guiclient/contacts.cpp000066400000000000000000000267331217451700100177320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "contacts.h" #include #include #include #include #include #include #include "characteristic.h" #include "contact.h" #include "errorReporter.h" #include "parameterwidget.h" #include "storedProcErrorLookup.h" contacts::contacts(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "contacts", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Contacts")); setReportName("ContactsMasterList"); setMetaSQLOptions("contacts", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); _crmacctid = -1; _attachAct = 0; _detachAct = 0; if (_privileges->check("MaintainAllContacts") || _privileges->check("ViewAllContacts")) { parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User); parameterWidget()->append(tr("Owner Pattern"), "owner_usr_pattern", ParameterWidget::Text); } parameterWidget()->append(tr("CRM Account"), "crmacct_id", ParameterWidget::Crmacct); parameterWidget()->append(tr("Name Pattern"), "cntct_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Phone Pattern"), "cntct_phone_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Email Pattern"), "cntct_email_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text); parameterWidget()->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text); parameterWidget()->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Postal Code Pattern"), "addr_postalcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text); parameterWidget()->applyDefaultFilterSet(); list()->addColumn(tr("First Name"), 80, Qt::AlignLeft, true, "cntct_first_name"); list()->addColumn(tr("Last Name"), 100, Qt::AlignLeft, true, "cntct_last_name"); list()->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false, "cntct_owner_username"); list()->addColumn(tr("Account #"), 80, Qt::AlignLeft, true, "crmacct_number"); list()->addColumn(tr("Account Name"), -1, Qt::AlignLeft, true, "crmacct_name"); list()->addColumn(tr("Title"), -1, Qt::AlignLeft, true, "cntct_title"); list()->addColumn(tr("Phone"), 100, Qt::AlignLeft, true, "cntct_phone"); list()->addColumn(tr("Alternate"), 100, Qt::AlignLeft, true, "cntct_phone2"); list()->addColumn(tr("Fax"), 100, Qt::AlignLeft, false, "cntct_fax"); list()->addColumn(tr("E-Mail"), 100, Qt::AlignLeft, true, "cntct_email"); list()->addColumn(tr("Web Address"), 100, Qt::AlignLeft, false, "cntct_webaddr"); list()->addColumn(tr("Address"), -1, Qt::AlignLeft, false, "addr_line1"); list()->addColumn(tr("City"), 75, Qt::AlignLeft, false, "addr_city"); list()->addColumn(tr("State"), 50, Qt::AlignLeft, false, "addr_state"); list()->addColumn(tr("Country"), 100, Qt::AlignLeft, false, "addr_country"); list()->addColumn(tr("Postal Code"), 75, Qt::AlignLeft, false, "addr_postalcode"); list()->setSelectionMode(QAbstractItemView::ExtendedSelection); setupCharacteristics(characteristic::Contacts); parameterWidget()->applyDefaultFilterSet(); QToolButton * attachBtn = new QToolButton(this); attachBtn->setText(tr("Attach")); _attachAct = toolBar()->insertWidget(filterSeparator(), attachBtn); _attachAct->setEnabled(false); _attachAct->setVisible(false); QToolButton * detachBtn = new QToolButton(this); detachBtn->setText(tr("Detach")); _detachAct = toolBar()->insertWidget(filterSeparator(), detachBtn); _detachAct->setEnabled(false); _detachAct->setVisible(false); connect(attachBtn, SIGNAL(clicked()), this, SLOT(sAttach())); connect(detachBtn, SIGNAL(clicked()), this, SLOT(sDetach())); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen())); if (_privileges->check("MaintainAllContacts") || _privileges->check("MaintainPersonalContacts")) { _attachAct->setEnabled(true); connect(list(), SIGNAL(valid(bool)), _detachAct, SLOT(setEnabled(bool))); } else { newAction()->setEnabled(false); } } enum SetResponse contacts::set(const ParameterList& pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "view") { _attachAct->setEnabled(false); disconnect(list(), SIGNAL(valid(bool)), _detachAct, SLOT(setEnabled(bool))); } } param = pParams.value("run", &valid); if (valid) sFillList(); return NoError; } void contacts::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("cntct_owner_username") && _privileges->check("MaintainPersonalContacts")) || (_privileges->check("MaintainAllContacts")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("cntct_owner_username") && _privileges->check("ViewPersonalContacts")) || (_privileges->check("ViewAllContacts")); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(viewPriv); XSqlQuery chk; chk.prepare("SELECT cntctused(:cntct_id) AS inUse;"); chk.bindValue(":cntct_id", list()->id()); chk.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Usage"), chk, __FILE__, __LINE__)) return; menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(editPriv && chk.first() && ! chk.value("inUse").toBool()); } void contacts::sNew() { ParameterList params; setParams(params); params.append("mode", "new"); contact newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void contacts::sEdit() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("mode", "edit"); params.append("cntct_id", ((XTreeWidgetItem*)(selected[i]))->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } sFillList(); } void contacts::sView() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("mode", "view"); params.append("cntct_id", ((XTreeWidgetItem*)(selected[i]))->id()); contact newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void contacts::sDelete() { if ( QMessageBox::warning(this, tr("Delete Contact?"), tr("

Are you sure that you want to completely " "delete the selected contact?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("DELETE FROM cntct WHERE (cntct_id=:cntct_id);"); foreach (XTreeWidgetItem *selected, list()->selectedItems()) { delq.bindValue(":cntct_id", selected->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Contact"), delq, __FILE__, __LINE__)) return; } } sFillList(); } void contacts::sAttach() { ContactCluster attached(this, "attached"); attached.sEllipses(); if (attached.id() > 0) { int answer = QMessageBox::Yes; if (attached.crmAcctId() > 0 && attached.crmAcctId() != _crmacctid) answer = QMessageBox::question(this, tr("Detach Contact?"), tr("

This Contact is currently attached to a " "different CRM Account. Are you sure you want " "to change the CRM Account for this person?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::Yes) { XSqlQuery attq; attq.prepare("SELECT attachContact(:cntct_id, :crmacct_id) AS returnVal;"); attq.bindValue(":cntct_id", attached.id()); attq.bindValue(":crmacct_id", _crmacctid); attq.exec(); if (attq.first()) { int returnVal = attq.value("returnVal").toInt(); if (returnVal < 0) { systemError(this, storedProcErrorLookup("attachContact", returnVal), __FILE__, __LINE__); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Attaching Contact"), attq, __FILE__, __LINE__)) return; } sFillList(); } } void contacts::sDetach() { int answer = QMessageBox::question(this, tr("Detach Contact?"), tr("

Are you sure you want to detach this Contact " "from this CRM Account?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::Yes) { int cntctId = list()->id(); XSqlQuery detq; detq.prepare("SELECT detachContact(:cntct_id, :crmacct_id) AS returnVal;"); detq.bindValue(":cntct_id", cntctId); detq.bindValue(":crmacct_id", _crmacctid); detq.exec(); if (detq.first()) { int returnVal = detq.value("returnVal").toInt(); if (returnVal < 0) { systemError(this, tr("Error detaching Contact from CRM Account (%1).") .arg(returnVal), __FILE__, __LINE__); return; } emit cntctDetached(cntctId); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Detaching Contact"), detq, __FILE__, __LINE__)) return; sFillList(); } } void contacts::setCrmacctid(int crmacctId) { _crmacctid = crmacctId; if (_crmacctid == -1) { parameterWidget()->setDefault(tr("CRM Account"), QVariant(), true); _attachAct->setVisible(false); _detachAct->setVisible(false); } else { parameterWidget()->setDefault(tr("CRM Account"), _crmacctid, true); _attachAct->setVisible(true); _detachAct->setVisible(true); } } int contacts::crmacctId() { return _crmacctid; } QAction* contacts::attachAction() { return _attachAct; } QAction* contacts::detachAction() { return _detachAct; } bool contacts::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; if (_activeOnly->isChecked()) params.append("activeOnly",true); return true; } void contacts::sOpen() { bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("cntct_owner_username") && _privileges->check("MaintainPersonalContacts")) || (_privileges->check("MaintainAllContacts")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("cntct_owner_username") && _privileges->check("ViewPersonalContacts")) || (_privileges->check("ViewAllContacts")); if (editPriv) sEdit(); else if (viewPriv) sView(); else QMessageBox::information(this, tr("Restricted Access"), tr("You have not been granted privileges to open this Contact.")); } qt-client-4.1.0/guiclient/contacts.h000066400000000000000000000025631217451700100173720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONTACTS_H #define CONTACTS_H #include "guiclient.h" #include "display.h" #include #include "ui_contacts.h" class contacts : public display, public Ui::contacts { Q_OBJECT public: contacts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual void setCrmacctid(int crmacctId); virtual int crmacctId(); QAction * attachAction(); QAction * detachAction(); public slots: virtual enum SetResponse set(const ParameterList&); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sAttach(); virtual void sDetach(); virtual void sOpen(); virtual bool setParams(ParameterList &); signals: void cntctDetached(int); private: int _crmacctid; QAction * _attachAct; QAction * _detachAct; }; #endif // CONTACTS_H qt-client-4.1.0/guiclient/contacts.ui000066400000000000000000000024061217451700100175540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. contacts 0 0 248 37 List Contacts Show Active Contacts Only XCheckBox QCheckBox

xcheckbox.h
qt-client-4.1.0/guiclient/contract.cpp000066400000000000000000000224231217451700100177210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2011 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "contract.h" #include #include #include #include #include #include #include "crmacctcluster.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include #include #include "mqlutil.h" contract::contract(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSaveClicked())); connect(this, SIGNAL(rejected()), this, SLOT(sRejected())); _dates->setStartNull(tr("Always"), omfgThis->startOfTime(), TRUE); _dates->setStartCaption(tr("Effective")); _dates->setEndNull(tr("Never"), omfgThis->endOfTime(), TRUE); _dates->setEndCaption(tr("Expires")); _captive = false; _new = false; } contract::~contract() { // no need to delete child widgets, Qt does it all for us } void contract::languageChange() { retranslateUi(this); } enum SetResponse contract::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("contrct_id", &valid); if (valid) { _contrctid = param.toInt(); _documents->setId(_contrctid); populate(); } param = pParams.value("vend_id", &valid); if (valid) { _vendor->setId(param.toInt()); _vendor->setEnabled(FALSE); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _new = true; itemet.exec("SELECT NEXTVAL('contrct_contrct_id_seq') AS contrct_id;"); if (itemet.first()) { _contrctid = itemet.value("contrct_id").toInt(); _documents->setId(_contrctid); } else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, itemet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _captive = true; } else if (param.toString() == "edit") { _mode = cEdit; _vendor->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _vendor->setEnabled(FALSE); _dates->setEnabled(FALSE); _number->setEnabled(FALSE); _descrip->setEnabled(FALSE); _documents->setReadOnly(true); _close->setText(tr("&Close")); _save->hide(); } if (param.toString() == "copy") { _mode = cCopy; _new = true; _captive = true; // int contrctidold = _contrctid; itemet.exec("SELECT NEXTVAL('contrct_contrct_id_seq') AS contrct_id;"); if (itemet.first()) _contrctid = itemet.value("contrct_id").toInt(); else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, itemet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _dates->setStartDate(omfgThis->dbDate()); sSave(); } } return NoError; } void contract::sSaveClicked() { _captive = false; if (sSave()) done(_contrctid); } bool contract::sSave() { XSqlQuery itemSave; QList errors; errors << GuiErrorCheck(!_vendor->isValid(), _vendor, tr( "You must select a Vendor before you may save this Contract." ) ) << GuiErrorCheck(_dates->endDate() < _dates->startDate(), _dates, tr("The expiration date cannot be earlier than the effective date.") ) << GuiErrorCheck(_number->isNull(), _number, tr( "You must enter a Contract Number before you may save this Contract." ) ) << GuiErrorCheck(_descrip->isNull(), _descrip, tr( "You must enter a Description before you may save this Contract." ) ) ; /* TODO - need this? itemSave.prepare( "SELECT count(*) AS numberOfOverlaps " "FROM contrct " "WHERE (contrct_vend_id = :contrct_vend_id)" " AND (contrct_id != :contrct_id)" " AND ( (contrct_effective BETWEEN :contrct_effective AND :contrct_expires OR" " contrct_expires BETWEEN :contrct_effective AND :contrct_expires)" " OR (contrct_effective <= :contrct_effective AND" " contrct_expires >= :contrct_expires) );" ); itemSave.bindValue(":contrct_id", _contrctid); itemSave.bindValue(":contrct_vend_id", _vendor->id()); itemSave.bindValue(":contrct_effective", _dates->startDate()); itemSave.bindValue(":contrct_expires", _dates->endDate()); itemSave.exec(); if (itemSave.first()) { if (itemSave.value("numberOfOverlaps").toInt() > 0) { errors << GuiErrorCheck(true, _dates, tr("The date range overlaps with another date range.\n" "Please check the values of these dates.")); } } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return false; } */ if(_mode == cNew || _mode == cCopy) { itemSave.prepare( "SELECT contrct_id " " FROM contrct " " WHERE ((contrct_vend_id=:vend_id) " " AND (contrct_number=:contrct_number));" ); itemSave.bindValue(":vend_id", _vendor->id()); itemSave.bindValue(":contrct_number", _number->text()); itemSave.exec(); if(itemSave.first()) { errors << GuiErrorCheck(true, _vendor, tr("A Contract already exists for the Vendor,\n" "Contract Number you have specified.")); } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return false; } } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Contract"), errors)) return false; if (_mode == cNew || _mode == cCopy) itemSave.prepare( "INSERT INTO contrct " "( contrct_id, contrct_vend_id," " contrct_number, contrct_descrip," " contrct_effective, contrct_expires," " contrct_note ) " "VALUES " "( :contrct_id, :contrct_vend_id," " :contrct_number, :contrct_descrip," " :contrct_effective, :contrct_expires," " :contrct_note );" ); if (_mode == cEdit) itemSave.prepare( "UPDATE contrct " "SET contrct_number=:contrct_number," " contrct_descrip=:contrct_descrip," " contrct_effective=:contrct_effective," " contrct_expires=:contrct_expires," " contrct_note=:contrct_note " "WHERE (contrct_id=:contrct_id);" ); itemSave.bindValue(":contrct_id", _contrctid); itemSave.bindValue(":contrct_vend_id", _vendor->id()); itemSave.bindValue(":contrct_effective", _dates->startDate()); itemSave.bindValue(":contrct_expires", _dates->endDate()); itemSave.bindValue(":contrct_number", _number->text()); itemSave.bindValue(":contrct_descrip", _descrip->text()); itemSave.bindValue(":contrct_note", _notes->toPlainText()); itemSave.exec(); if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return false; } if (_captive) { if (_mode != cCopy) { _vendor->setEnabled(FALSE); } _mode = cEdit; _captive = false; } return true; } void contract::populate() { XSqlQuery contrctQ; contrctQ.prepare( "SELECT * " "FROM contrct " "WHERE (contrct_id=:contrct_id);" ); contrctQ.bindValue(":contrct_id", _contrctid); contrctQ.exec(); if (contrctQ.first()) { _vendor->setId(contrctQ.value("contrct_vend_id").toInt()); _dates->setStartDate(contrctQ.value("contrct_effective").toDate()); _dates->setEndDate(contrctQ.value("contrct_expires").toDate()); _number->setText(contrctQ.value("contrct_number").toString()); _descrip->setText(contrctQ.value("contrct_descrip").toString()); _notes->setText(contrctQ.value("contrct_note").toString()); } else if (contrctQ.lastError().type() != QSqlError::NoError) { systemError(this, contrctQ.lastError().databaseText(), __FILE__, __LINE__); return; } } void contract::sRejected() { XSqlQuery itemRejected; if (_new) { itemRejected.prepare( "DELETE FROM contrct " "WHERE (contrct_id=:contrct_id);" ); itemRejected.bindValue(":contrct_id", _contrctid); itemRejected.exec(); if (itemRejected.lastError().type() != QSqlError::NoError) { systemError(this, itemRejected.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/contract.h000066400000000000000000000021431217451700100173630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONTRACT_H #define CONTRACT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_contract.h" class contract : public XDialog, public Ui::contract { Q_OBJECT public: contract(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~contract(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool sSave(); virtual void sSaveClicked(); virtual void populate(); virtual void sRejected(); protected slots: virtual void languageChange(); private: int _mode; int _contrctid; bool _captive; bool _new; }; #endif // CONTRACT_H qt-client-4.1.0/guiclient/contract.ui000066400000000000000000000224211217451700100175520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2011 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. contract 0 0 636 524 Contract 0 200 Qt::StrongFocus Vendor #: Qt::Horizontal QSizePolicy::Expanding 236 21 Contract #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::Horizontal 40 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 40 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 0 5 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 0 1 0 &Notes 5 5 true &Documents Documents::Contract qPixmapFromMimeSource DateCluster QWidget
datecluster.h
Documents QWidget
documents.h
VendorCluster QWidget
vendorcluster.h
XLineEdit QLineEdit
xlineedit.h
1
XTextEdit QTextEdit
xtextedit.h
_vendor _number _descrip _dates _tab _notes _save _close
qt-client-4.1.0/guiclient/contracts.cpp000066400000000000000000000140761217451700100201110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "contracts.h" #include #include #include #include #include #include "contract.h" #include "copyContract.h" #include "guiclient.h" #include "parameterwidget.h" contracts::contracts(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "contracts", fl) { setWindowTitle(tr("Contracts")); setReportName("Contracts"); setMetaSQLOptions("contracts", "detail"); setUseAltId(false); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Vendor"), "vend_id", ParameterWidget::Vendor); parameterWidget()->append(tr("Effective Start"), "effectiveStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Effective End"), "effectiveEndDate", ParameterWidget::Date); parameterWidget()->append(tr("Expires Start"), "expireStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Expires End"), "expireEndDate", ParameterWidget::Date); list()->addColumn(tr("Vendor Number"), -1, Qt::AlignLeft, true, "vend_number" ); list()->addColumn(tr("Vendor Name"), -1, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Contract Number"), _itemColumn, Qt::AlignLeft, true, "contrct_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "contrct_descrip" ); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter, true, "contrct_effective" ); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignLeft, true, "contrct_expires" ); list()->addColumn(tr("Item Count"), _itemColumn, Qt::AlignLeft, true, "item_count" ); if (_privileges->check("MaintainItemSources")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } } bool contracts::setParams(ParameterList & params) { if (!display::setParams(params)) return false; params.append("always", tr("Always")); params.append("never", tr("Never")); return true; } void contracts::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = menuThis->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuItem = menuThis->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainItemSources") || _privileges->check("ViewItemSource")); menuItem = menuThis->addAction(tr("Copy..."), this, SLOT(sCopy())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuItem = menuThis->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); } void contracts::sNew() { ParameterList params; params.append("mode", "new"); contract newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void contracts::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("contrct_id", list()->id()); contract newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void contracts::sView() { ParameterList params; params.append("mode", "view"); params.append("contrct_id", list()->id()); contract newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void contracts::sCopy() { ParameterList params; params.append("contrct_id", list()->id()); copyContract newdlg(this, "", TRUE); newdlg.set(params); // if (newdlg.exec() != XDialog::Rejected) // sFillList(); newdlg.exec(); } void contracts::sDelete() { XSqlQuery itemDelete; if (QMessageBox::question(this, tr("Delete Contract"), tr( "Are you sure that you want to delete the selected Contract?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { if (QMessageBox::question(this, tr("Delete Contract"), tr( "Do you want to deactivate the associated Item Sources?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { // itemsrcp deleted on cascade itemDelete.prepare( "UPDATE itemsrc SET itemsrc_active=FALSE, " " itemsrc_contrct_id=NULL " "WHERE (itemsrc_contrct_id=:contrct_id);"); itemDelete.bindValue(":contrct_id", list()->id()); itemDelete.exec(); if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, itemDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } else { itemDelete.prepare( "UPDATE itemsrc SET itemsrc_contrct_id=NULL " "WHERE (itemsrc_contrct_id=:contrct_id);"); itemDelete.bindValue(":contrct_id", list()->id()); itemDelete.exec(); if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, itemDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } itemDelete.prepare( "DELETE FROM contrct " "WHERE (contrct_id=:contrct_id);"); itemDelete.bindValue(":contrct_id", list()->id()); itemDelete.exec(); if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, itemDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } qt-client-4.1.0/guiclient/contracts.h000066400000000000000000000016711217451700100175530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONTRACTS_H #define CONTRACTS_H #include "display.h" class contracts : public display { Q_OBJECT public: contracts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); Q_INVOKABLE virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sCopy(); virtual void sDelete(); }; #endif // CONTRACTS_H qt-client-4.1.0/guiclient/convert.sh000077500000000000000000000013141217451700100174130ustar00rootroot00000000000000#!/bin/sh UI_DIR=ui if [ -z $1 ]; then echo "$0: No file to convert specified." exit fi base=`basename $1 .ui` uifile=$base.ui if [ ! -f $uifile ]; then echo "$0: Could not find UI file $uifile." exit; fi cppfile=$UI_DIR/$base.cpp hfile=$UI_DIR/$base.h if [ ! -f $cppfile ]; then echo "$0: Could not find CPP file $cppfile." exit fi if [ ! -f $hfile ]; then echo "$0: Could not find H file $hfile." exit fi uihfile=$base.ui.h if [ ! -f $uihfile ]; then uihfile= fi mv $uifile $uifile.3 uic3 -convert $uifile.3 > $uifile mv $cppfile $base.cpp mv $hfile $base.h if [ $uihfile ]; then mv $uihfile $uihfile.3 cat $uihfile.3 >> $base.cpp cvs rm $uihfile fi cvs add $base.cpp $base.h qt-client-4.1.0/guiclient/copyBOM.cpp000066400000000000000000000063521217451700100174170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "copyBOM.h" #include #include #include #include "storedProcErrorLookup.h" copyBOM::copyBOM(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_source, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_target, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _captive = FALSE; _source->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cPhantom | ItemLineEdit::cKit | ItemLineEdit::cPlanning); _target->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cPhantom | ItemLineEdit::cKit | ItemLineEdit::cPlanning); } copyBOM::~copyBOM() { // no need to delete child widgets, Qt does it all for us } void copyBOM::languageChange() { retranslateUi(this); } enum SetResponse copyBOM::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _source->setId(param.toInt()); _source->setEnabled(FALSE); } return NoError; } void copyBOM::sCopy() { XSqlQuery copyCopy; copyCopy.prepare("SELECT bomitem_id " "FROM bomitem(:item_id) " "WHERE ( (bomitem_booitem_seq_id != -1) " " AND (bomitem_booitem_seq_id IS NOT NULL) ) " "LIMIT 1;" ); copyCopy.bindValue(":item_id", _source->id()); copyCopy.exec(); if (copyCopy.first()) QMessageBox::information( this, tr("Dependent BOO Data"), tr("One or more of the components for this Bill of Materials make reference to a\n" "Bill of Operations. These references cannot be copied and must be added manually.") ); copyCopy.prepare("SELECT copyBOM(:sourceid, :targetid) AS result;"); copyCopy.bindValue(":sourceid", _source->id()); copyCopy.bindValue(":targetid", _target->id()); copyCopy.exec(); if (copyCopy.first()) { int result = copyCopy.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("copyBOM", result), __FILE__, __LINE__); return; } } else if (copyCopy.lastError().type() != QSqlError::NoError) { systemError(this, copyCopy.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sBOMsUpdated(_target->id(), TRUE); if (_captive) close(); else { _source->setId(-1); _target->setId(-1); _source->setFocus(); } } void copyBOM::sHandleButtons() { _copy->setEnabled(_source->isValid() && _target->isValid()); } qt-client-4.1.0/guiclient/copyBOM.h000066400000000000000000000017621217451700100170640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COPYBOM_H #define COPYBOM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_copyBOM.h" class copyBOM : public XDialog, public Ui::copyBOM { Q_OBJECT public: copyBOM(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~copyBOM(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCopy(); virtual void sHandleButtons(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // COPYBOM_H qt-client-4.1.0/guiclient/copyBOM.ui000066400000000000000000000122131217451700100172430ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. copyBOM 0 0 410 200 Copy Bill of Materials 5 0 0 3 0 5 0 0 Source Item: 0 0 Target Item: Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Close false Co&py true true Qt::Vertical 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 ItemCluster QWidget
itemcluster.h
1
_source _target _copy _close _close clicked() copyBOM reject() 20 20 20 20
qt-client-4.1.0/guiclient/copyBudget.cpp000066400000000000000000000053771217451700100202220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "copyBudget.h" #include #include #include /* * Constructs a copyBudget as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ copyBudget::copyBudget(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _budgheadid = -1; // signals and slots connections connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); } /* * Destroys the object and frees any allocated resources */ copyBudget::~copyBudget() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void copyBudget::languageChange() { retranslateUi(this); } enum SetResponse copyBudget::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("budghead_id", &valid); if (valid) { _budgheadid = param.toInt(); _copy->setEnabled(true); } return NoError; } void copyBudget::sCopy() { XSqlQuery copyCopy; if(_name->text().trimmed().isEmpty()) { QMessageBox::warning(this, tr("Name Required"), tr("Budget Name is a required field.")); _name->setFocus(); return; } copyCopy.prepare("SELECT copyBudget(:budghead_id, :name, :descrip, :interval) AS result;"); copyCopy.bindValue(":budghead_id", _budgheadid); copyCopy.bindValue(":name", _name->text()); copyCopy.bindValue(":descrip", _descrip->text()); copyCopy.bindValue(":interval", _interval->value()); copyCopy.exec(); if(copyCopy.first() && copyCopy.value("result").toInt() < 0) { QMessageBox::information( this, tr("Error Copying Budget"), tr( "There was an error copying the budget. Make sure there are valid periods\n" "In the future to match the current periods of the budget being copied plus\n" "the period inteval." )); return; } else if(copyCopy.lastError().type() != QSqlError::NoError) { systemError(this, copyCopy.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/copyBudget.h000066400000000000000000000017521217451700100176600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COPYBUDGET_H #define COPYBUDGET_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_copyBudget.h" class copyBudget : public XDialog, public Ui::copyBudget { Q_OBJECT public: copyBudget(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~copyBudget(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); protected slots: virtual void languageChange(); virtual void sCopy(); private: int _budgheadid; }; #endif // COPYBUDGET_H qt-client-4.1.0/guiclient/copyBudget.ui000066400000000000000000000136361217451700100200520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. copyBudget 0 0 452 111 Copy Budget 9 6 0 0 0 6 0 6 999 0 periods Qt::Horizontal 40 20 Period Interval: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _interval Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _descrip New Budget Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Qt::Vertical QSizePolicy::Expanding 301 16 0 5 &Close false Co&py Qt::Vertical QSizePolicy::Expanding 20 20 _name _descrip _interval _copy _close _close clicked() copyBudget reject() 20 20 20 20 qt-client-4.1.0/guiclient/copyContract.cpp000066400000000000000000000137201217451700100205540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "copyContract.h" #include #include #include "inputManager.h" #include "errorReporter.h" #include "guiErrorCheck.h" copyContract::copyContract(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sCopy())); _contrctid = -1; _vendid = -1; _captive = FALSE; } copyContract::~copyContract() { // no need to delete child widgets, Qt does it all for us } void copyContract::languageChange() { retranslateUi(this); } enum SetResponse copyContract::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("contrct_id", &valid); if (valid) { _captive = TRUE; _contrctid = param.toInt(); sPopulateContractInfo(); } return NoError; } void copyContract::sPopulateContractInfo() { XSqlQuery copyPopulate; if (_contrctid != -1) { copyPopulate.prepare( "SELECT contrct.*, vend_name," " (contrct_expires + 1) AS neweffective " " FROM contrct " " JOIN vendinfo ON (contrct_vend_id=vend_id)" " WHERE (contrct_id=:contrct_id);" ); copyPopulate.bindValue(":contrct_id", _contrctid); copyPopulate.exec(); if (copyPopulate.first()) { _oldContract->setText(copyPopulate.value("contrct_number").toString()); _oldEffective->setDate(copyPopulate.value("contrct_effective").toDate()); _oldExpires->setDate(copyPopulate.value("contrct_expires").toDate()); _vendid = copyPopulate.value("contrct_vend_id").toInt(); _vendName->setText(copyPopulate.value("vend_name").toString()); _effective->setDate(copyPopulate.value("neweffective").toDate()); } else if (copyPopulate.lastError().type() != QSqlError::NoError) { systemError(this, copyPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _contract->clear(); _oldEffective->clear(); _oldEffective->clear(); _vendName->clear(); } } void copyContract::sCopy() { XSqlQuery copyq; QList errors; errors << GuiErrorCheck(!_effective->isValid(), _effective, tr( "You must select an Effective Date before you may copy this Contract." ) ) << GuiErrorCheck(!_expires->isValid(), _expires, tr( "You must select an Expiration Date before you may copy this Contract." ) ) << GuiErrorCheck(_expires->date() < _effective->date(), _effective, tr("The expiration date cannot be earlier than the effective date.") ) << GuiErrorCheck(_contract->isNull(), _contract, tr( "You must enter a Contract Number before you may save this Contract." ) ) ; copyq.prepare( "SELECT count(*) AS numberOfOverlaps " "FROM contrct " "WHERE (contrct_vend_id = :contrct_vend_id)" " AND (contrct_id != :contrct_id)" " AND ( (contrct_effective BETWEEN :contrct_effective AND :contrct_expires OR" " contrct_expires BETWEEN :contrct_effective AND :contrct_expires)" " OR (contrct_effective <= :contrct_effective AND" " contrct_expires >= :contrct_expires) );" ); copyq.bindValue(":contrct_id", _contrctid); copyq.bindValue(":contrct_vend_id", _vendid); copyq.bindValue(":contrct_effective", _effective->date()); copyq.bindValue(":contrct_expires", _expires->date()); copyq.exec(); if (copyq.first()) { if (copyq.value("numberOfOverlaps").toInt() > 0) { errors << GuiErrorCheck(true, _effective, tr("The date range overlaps with another date range.\n" "Please check the values of these dates.")); } } else if (copyq.lastError().type() != QSqlError::NoError) { systemError(this, copyq.lastError().databaseText(), __FILE__, __LINE__); return; } copyq.prepare( "SELECT contrct_id " " FROM contrct " " WHERE ((contrct_vend_id=:vend_id) " " AND (contrct_number=:contrct_number));" ); copyq.bindValue(":vend_id", _vendid); copyq.bindValue(":contrct_number", _contract->text()); copyq.exec(); if(copyq.first()) { errors << GuiErrorCheck(true, _contract, tr("A Contract already exists for the Vendor,\n" "Contract Number you have specified.")); } else if (copyq.lastError().type() != QSqlError::NoError) { systemError(this, copyq.lastError().databaseText(), __FILE__, __LINE__); return; } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Contract"), errors)) return; copyq.prepare("SELECT copyContract(:contrct_id, :contrct_number, :contrct_effective, :contrct_expires) AS contrct_id;"); copyq.bindValue(":contrct_id", _contrctid); copyq.bindValue(":contrct_number", _contract->text()); copyq.bindValue(":contrct_effective", _effective->date()); copyq.bindValue(":contrct_expires", _expires->date()); copyq.exec(); if (_captive) { if (copyq.first()) { int contrctid = copyq.value("contrct_id").toInt(); done(contrctid); } else if (copyq.lastError().type() != QSqlError::NoError) { systemError(this, copyq.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/copyContract.h000066400000000000000000000020771217451700100202240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COPYCONTRACT_H #define COPYCONTRACT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_copyContract.h" class copyContract : public XDialog, public Ui::copyContract { Q_OBJECT public: copyContract(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~copyContract(); public slots: virtual SetResponse set(const ParameterList & pParams); virtual void sPopulateContractInfo(); virtual void sCopy(); protected slots: virtual void languageChange(); private: bool _captive; int _contrctid; int _vendid; }; #endif // COPYCONTRACT_H qt-client-4.1.0/guiclient/copyContract.ui000066400000000000000000000171141217451700100204100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. copyContract 0 0 742 164 Copy Contract Contract #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Vendor Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignVCenter New Contract #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Vendor Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignVCenter Effective: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false New Effective: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Expires: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false New Expires: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok DLineEdit QWidget
datecluster.h
1
XLineEdit QLineEdit
xlineedit.h
1
_buttonBox _oldContract _contract _oldEffective _effective _oldExpires _expires
qt-client-4.1.0/guiclient/copyItem.cpp000066400000000000000000000107361217451700100177010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "copyItem.h" #include #include #include #include "itemSite.h" #include "storedProcErrorLookup.h" copyItem::copyItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_source, SIGNAL(typeChanged(const QString&)), this, SLOT(sHandleItemType(const QString&))); _captive = FALSE; } copyItem::~copyItem() { // no need to delete child widgets, Qt does it all for us } void copyItem::languageChange() { retranslateUi(this); } enum SetResponse copyItem::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _source->setId(param.toInt()); _source->setEnabled(FALSE); } return NoError; } void copyItem::sHandleItemType(const QString &pItemType) { if (pItemType == "M" || pItemType == "B" || pItemType == "F" || pItemType == "K" || pItemType == "P" || pItemType == "O" || pItemType == "L" || pItemType == "J") { _copyBOM->setChecked(TRUE); _copyBOM->setEnabled(TRUE); } else { _copyBOM->setChecked(FALSE); _copyBOM->setEnabled(FALSE); } } bool copyItem::okToSave() { XSqlQuery copyokToSave; _targetItemNumber->setText(_targetItemNumber->text().trimmed().toUpper()); if (_targetItemNumber->text().length() == 0) { QMessageBox::warning(this, tr("Enter Item Number"), tr("

Please enter a Target Item Number.")); _targetItemNumber->setFocus(); return false; } copyokToSave.prepare( "SELECT item_number " "FROM item " "WHERE item_number=:item_number;" ); copyokToSave.bindValue(":item_number", _targetItemNumber->text()); copyokToSave.exec(); if (copyokToSave.first()) { QMessageBox::critical(this, tr("Item Number Exists"), tr("

An Item with the item number '%1' already " "exists. You may not copy over an existing item.") .arg(_targetItemNumber->text())); _targetItemNumber->clear(); _targetItemNumber->setFocus(); return false; } return true; } void copyItem::createItemSites(int pItemid) { if (QMessageBox::question(this,tr("Create New Item Sites"), tr("

Would you like to create new Item Sites " "for the newly created Item?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) { ParameterList params; params.append("mode", "new"); params.append("item_id", pItemid); itemSite newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void copyItem::sCopy() { XSqlQuery copyCopy; if (! okToSave()) return; int itemid = -1; copyCopy.prepare("SELECT copyItem(:source_item_id, :newItemNumber, :copyBOM, :copyItemCosts) AS itemid;"); copyCopy.bindValue(":source_item_id", _source->id()); copyCopy.bindValue(":newItemNumber", _targetItemNumber->text()); copyCopy.bindValue(":copyBOM", QVariant(_copyBOM->isChecked())); copyCopy.bindValue(":copyItemCosts", QVariant(_copyCosts->isChecked())); copyCopy.exec(); if (copyCopy.first()) { itemid = copyCopy.value("itemid").toInt(); if (itemid < 0) { systemError(this, storedProcErrorLookup("copyItem", itemid), __FILE__, __LINE__); return; } omfgThis->sItemsUpdated(itemid, TRUE); if (_copyBOM->isChecked()) omfgThis->sBOMsUpdated(itemid, TRUE); createItemSites(itemid); } else if (copyCopy.lastError().type() != QSqlError::NoError) { systemError(this, copyCopy.lastError().databaseText(), __FILE__, __LINE__); return; } if (_captive) done(itemid); else clear(); } void copyItem::clear() { _source->setId(-1); _targetItemNumber->clear(); _source->setFocus(); _copyBOM->setEnabled(TRUE); _close->setText(tr("&Close")); } qt-client-4.1.0/guiclient/copyItem.h000066400000000000000000000023341217451700100173410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COPYITEM_H #define COPYITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_copyItem.h" class copyItem : public XDialog, public Ui::copyItem { Q_OBJECT public: copyItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~copyItem(); Q_INVOKABLE inline bool captive() const { return _captive; } Q_INVOKABLE virtual void createItemSites(int pItemid); Q_INVOKABLE virtual bool okToSave(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void clear(); virtual void sHandleItemType(const QString & pItemType); virtual void sCopy(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // COPYITEM_H qt-client-4.1.0/guiclient/copyItem.ui000066400000000000000000000121271217451700100175300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. copyItem 0 0 483 211 Copy Item 0 Source Item: Qt::StrongFocus &Target Item Number: _targetItemNumber Copy &Item Costs true Copy &Bill of Materials true Qt::Vertical QSizePolicy::Expanding 151 16 &Cancel false Co&py true Qt::Vertical QSizePolicy::Expanding 87 0 ItemCluster QWidget

itemcluster.h
XLineEdit QLineEdit
xlineedit.h
_source _targetItemNumber _copyCosts _copyBOM _copy _close _source valid(bool) _copy setEnabled(bool) 20 20 20 20 _close clicked() copyItem reject() 20 20 20 20 qt-client-4.1.0/guiclient/copyPurchaseOrder.cpp000066400000000000000000000133731217451700100215510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "copyPurchaseOrder.h" #include #include #include #include "inputManager.h" #include "purchaseOrderList.h" #include "storedProcErrorLookup.h" copyPurchaseOrder::copyPurchaseOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sCopy())); connect(_po, SIGNAL(newId(int, QString)), this, SLOT(sPopulatePoInfo(int))); connect(_reschedule, SIGNAL(toggled(bool)), _scheduleDate, SLOT(setEnabled(bool))); _captive = false; //omfgThis->inputManager()->notify(cBCPurchaseOrder, this, _po, SLOT(setId(int))); _poitem->addColumn(tr("#"), _seqColumn, Qt::AlignRight,true, "poitem_linenumber" ); _poitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); _poitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); _poitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _poitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered"); _poitem->addColumn(tr("Price"), _qtyColumn, Qt::AlignRight, true, "poitem_unitprice"); _poitem->addColumn(tr("Extended"),_qtyColumn, Qt::AlignRight, true, "extended"); _currency->setType(XComboBox::Currencies); _currency->setLabel(_currencyLit); } copyPurchaseOrder::~copyPurchaseOrder() { // no need to delete child widgets, Qt does it all for us } void copyPurchaseOrder::languageChange() { retranslateUi(this); } enum SetResponse copyPurchaseOrder::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _captive = true; _po->setId(param.toInt()); _po->setEnabled(false); } return NoError; } void copyPurchaseOrder::sPopulatePoInfo(int) { XSqlQuery copyPopulatePoInfo; if (_po->id() != -1) { copyPopulatePoInfo.prepare( "SELECT pohead_orderdate," " vend_id, cntct_phone, pohead_curr_id " "FROM pohead, vendinfo " "LEFT OUTER JOIN cntct ON (vend_cntct1_id=cntct_id) " "WHERE ( (pohead_vend_id=vend_id)" " AND (pohead_id=:pohead_id) );" ); copyPopulatePoInfo.bindValue(":pohead_id", _po->id()); copyPopulatePoInfo.exec(); if (copyPopulatePoInfo.first()) { _orderDate->setDate(copyPopulatePoInfo.value("pohead_orderdate").toDate()); _vend->setId(copyPopulatePoInfo.value("vend_id").toInt()); _vendPhone->setText(copyPopulatePoInfo.value("cntct_phone").toString()); _currency->setId(copyPopulatePoInfo.value("pohead_curr_id").toInt()); } else if (copyPopulatePoInfo.lastError().type() != QSqlError::NoError) { systemError(this, copyPopulatePoInfo.lastError().databaseText(), __FILE__, __LINE__); return; } copyPopulatePoInfo.prepare( "SELECT poitem.*," " COALESCE(item_number,poitem_vend_item_number) AS item_number," " COALESCE((item_descrip1 || ' ' || item_descrip2),poitem_vend_item_descrip) AS item_descrip," " warehous_code," " poitem_qty_ordered * poitem_unitprice AS extended," " 'qty' AS poitem_qty_ordered_xtnumericrole," " 'price' AS poitem_unitprice_xtnumericrole," " 'curr' AS extended_xtnumericrole " "FROM poitem LEFT OUTER JOIN " " (itemsite JOIN item ON (itemsite_item_id=item_id) " " JOIN whsinfo ON (itemsite_warehous_id=warehous_id) ) " " ON (poitem_itemsite_id=itemsite_id) " "WHERE (poitem_pohead_id=:pohead_id) " "ORDER BY poitem_linenumber;" ); copyPopulatePoInfo.bindValue(":pohead_id", _po->id()); copyPopulatePoInfo.exec(); _poitem->populate(copyPopulatePoInfo); if (copyPopulatePoInfo.lastError().type() != QSqlError::NoError) { systemError(this, copyPopulatePoInfo.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _orderDate->clear(); _vend->setId(-1); _vendPhone->clear(); _poitem->clear(); } } void copyPurchaseOrder::sCopy() { XSqlQuery copyCopy; copyCopy.prepare("SELECT copyPo(:pohead_id, :vend_id, :scheddate, :recheck) AS pohead_id;"); copyCopy.bindValue(":pohead_id", _po->id()); copyCopy.bindValue(":vend_id", _vend->id()); if (_reschedule->isChecked()) copyCopy.bindValue(":scheddate", _scheduleDate->date()); else copyCopy.bindValue(":scheddate", QDate::currentDate()); copyCopy.bindValue(":recheck", QVariant(_recheck->isChecked())); int poheadid = 0; copyCopy.exec(); if (copyCopy.first()) { poheadid = copyCopy.value("pohead_id").toInt(); if (poheadid < 0) { QMessageBox::critical(this, tr("Could Not Copy Purchase Order"), storedProcErrorLookup("copyPo", poheadid)); return; } } else if (copyCopy.lastError().type() != QSqlError::NoError) { systemError(this, copyCopy.lastError().databaseText(), __FILE__, __LINE__); return; } if (_captive) { omfgThis->sPurchaseOrdersUpdated(poheadid, true); done(poheadid); } else { _po->setId(-1); _po->setFocus(); } } qt-client-4.1.0/guiclient/copyPurchaseOrder.h000066400000000000000000000021101217451700100212010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COPYPURCHASEORDER_H #define COPYPURCHASEORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_copyPurchaseOrder.h" class copyPurchaseOrder : public XDialog, public Ui::copyPurchaseOrder { Q_OBJECT public: copyPurchaseOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~copyPurchaseOrder(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sCopy(); virtual void sPopulatePoInfo( int pSoid ); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // COPYPURCHASEORDER_H qt-client-4.1.0/guiclient/copyPurchaseOrder.ui000066400000000000000000000212371217451700100214020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. copyPurchaseOrder 0 0 694 378 Copy Purchase Order OrderLineEdit::Purchase Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _currency false Purchase Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QFormLayout::FieldsStayAtSizeHint Vendor Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Qt::AlignVCenter 0 Original Line Items: 0 0 2 Use Today's Date true 5 Schedule Purchase Order for: false Use latest Item Sources and Prices Qt::Horizontal QSizePolicy::Expanding 0 10 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save DLineEdit QWidget
datecluster.h
OrderCluster QWidget
ordercluster.h
VendorCluster QWidget
vendorcluster.h
XComboBox QComboBox
xcombobox.h
XTreeWidget QTreeWidget
xtreewidget.h
1
_po _orderDate _currency _poitem _useCurrentDate _reschedule _scheduleDate _recheck _reschedule toggled(bool) _scheduleDate setEnabled(bool) 20 20 20 20 _buttonBox rejected() copyPurchaseOrder reject() 552 57 346 188
qt-client-4.1.0/guiclient/copySalesOrder.cpp000066400000000000000000000123561217451700100210460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "copySalesOrder.h" #include #include #include "inputManager.h" #include "salesOrderList.h" copySalesOrder::copySalesOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _so->setAllowedTypes(OrderLineEdit::Sales); connect(_so, SIGNAL(newId(int,QString)), this, SLOT(sPopulateSoInfo(int))); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sCopy())); _captive = FALSE; omfgThis->inputManager()->notify(cBCSalesOrder, this, _so, SLOT(setId(int))); _soitem->addColumn(tr("#"), _seqColumn, Qt::AlignRight, true, "coitem_linenumber" ); _soitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); _soitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); _soitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _soitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyord"); _soitem->addColumn(tr("Price"), _qtyColumn, Qt::AlignRight, true, "coitem_price"); _soitem->addColumn(tr("Extended"), _qtyColumn, Qt::AlignRight, true, "extended"); } copySalesOrder::~copySalesOrder() { // no need to delete child widgets, Qt does it all for us } void copySalesOrder::languageChange() { retranslateUi(this); } enum SetResponse copySalesOrder::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("sohead_id", &valid); if (valid) { _captive = TRUE; _so->setId(param.toInt()); _so->setEnabled(FALSE); } return NoError; } void copySalesOrder::sPopulateSoInfo(int) { XSqlQuery copyPopulateSoInfo; if (_so->id() != -1) { copyPopulateSoInfo.prepare( "SELECT cohead_number," " cohead_orderdate," " cohead_custponumber, cust_name, cntct_phone " " FROM cohead " " JOIN custinfo ON (cohead_cust_id=cust_id)" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" " WHERE (cohead_id=:sohead_id);" ); copyPopulateSoInfo.bindValue(":sohead_id", _so->id()); copyPopulateSoInfo.exec(); if (copyPopulateSoInfo.first()) { _orderDate->setDate(copyPopulateSoInfo.value("cohead_orderdate").toDate()); _poNumber->setText(copyPopulateSoInfo.value("cohead_custponumber").toString()); _custName->setText(copyPopulateSoInfo.value("cust_name").toString()); _custPhone->setText(copyPopulateSoInfo.value("cntct_phone").toString()); } else if (copyPopulateSoInfo.lastError().type() != QSqlError::NoError) { systemError(this, copyPopulateSoInfo.lastError().databaseText(), __FILE__, __LINE__); return; } copyPopulateSoInfo.prepare( "SELECT coitem.*, item_number," " (item_descrip1 || ' ' || item_descrip2) AS item_descrip," " warehous_code," " ((coitem_qtyord * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio)) AS extended," " 'qty' AS coitem_qtyord_xtnumericrole," " 'price' AS coitem_price_xtnumericrole," " 'curr' AS extended_xtnumericrole " "FROM coitem, itemsite, item, whsinfo " "WHERE ( (coitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (coitem_status != 'X')" " AND (coitem_cohead_id=:sohead_id) " " AND (coitem_subnumber = 0) ) " "ORDER BY coitem_linenumber;" ); copyPopulateSoInfo.bindValue(":sohead_id", _so->id()); copyPopulateSoInfo.exec(); _soitem->populate(copyPopulateSoInfo); if (copyPopulateSoInfo.lastError().type() != QSqlError::NoError) { systemError(this, copyPopulateSoInfo.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _orderDate->clear(); _poNumber->clear(); _custName->clear(); _custPhone->clear(); _soitem->clear(); } } void copySalesOrder::sCopy() { XSqlQuery copyCopy; copyCopy.prepare("SELECT copySo(:sohead_id, :scheddate) AS sohead_id;"); copyCopy.bindValue(":sohead_id", _so->id()); if (_reschedule->isChecked()) copyCopy.bindValue(":scheddate", _scheduleDate->date()); copyCopy.exec(); if (_captive) { if (copyCopy.first()) { int soheadid = copyCopy.value("sohead_id").toInt(); omfgThis->sSalesOrdersUpdated(soheadid); done(soheadid); } else if (copyCopy.lastError().type() != QSqlError::NoError) { systemError(this, copyCopy.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _so->setId(-1); _so->setFocus(); } } qt-client-4.1.0/guiclient/copySalesOrder.h000066400000000000000000000020571217451700100205100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COPYSALESORDER_H #define COPYSALESORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_copySalesOrder.h" class copySalesOrder : public XDialog, public Ui::copySalesOrder { Q_OBJECT public: copySalesOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~copySalesOrder(); public slots: virtual SetResponse set(const ParameterList & pParams); virtual void sPopulateSoInfo( int pSoid ); virtual void sCopy(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // COPYSALESORDER_H qt-client-4.1.0/guiclient/copySalesOrder.ui000066400000000000000000000202671217451700100207010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. copySalesOrder 0 0 600 358 Copy Sales Order Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false 0 0 Cust. Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignVCenter Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal QSizePolicy::MinimumExpanding 13 20 Cust. Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignVCenter P/O Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 Line Items: Use Source Schedule Dates true Qt::Horizontal 40 20 Reschedule all Schedule Dates to: false Qt::Horizontal 40 20 DLineEdit QWidget
datecluster.h
1
OrderCluster QWidget
ordercluster.h
XTreeWidget QTreeWidget
xtreewidget.h
1
_reschedule toggled(bool) _scheduleDate setEnabled(bool) 20 20 20 20
qt-client-4.1.0/guiclient/copyTransferOrder.cpp000066400000000000000000000072721217451700100215640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "copyTransferOrder.h" #include #include #include #include "inputManager.h" #include "storedProcErrorLookup.h" #include "transferOrder.h" copyTransferOrder::copyTransferOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sCopy())); connect(_to, SIGNAL(newId(int)), this, SLOT(populate())); _captive = FALSE; _to->setAllowedTypes(OrderLineEdit::Transfer); _to->setLabel(""); _item->addColumn(tr("#"), _seqColumn, Qt::AlignRight, true, "toitem_linenumber"); _item->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); _item->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); _item->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "toitem_qty_ordered"); } copyTransferOrder::~copyTransferOrder() { // no need to delete child widgets, Qt does it all for us } void copyTransferOrder::languageChange() { retranslateUi(this); } enum SetResponse copyTransferOrder::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("tohead_id", &valid); if (valid) { _captive = TRUE; _to->setAllowedType("TO"); _to->setId(param.toInt()); _to->setEnabled(FALSE); populate(); } return NoError; } void copyTransferOrder::populate() { XSqlQuery copypopulate; _item->clear(); if (_to->id() == -1) _orderDate->clear(); else { _orderDate->setDate(omfgThis->dbDate(), true); copypopulate.prepare("SELECT toitem.*," " item_number," " (item_descrip1 || ' ' || item_descrip2) AS description," " 'qty' AS toitem_qty_ordered_xtnumericrole " "FROM toitem JOIN item ON (item_id=toitem_item_id) " "WHERE ((toitem_status <> 'X')" " AND (toitem_tohead_id=:tohead_id)) " "ORDER BY toitem_linenumber;" ); copypopulate.bindValue(":tohead_id", _to->id()); copypopulate.exec(); _item->populate(copypopulate); if (copypopulate.lastError().type() != QSqlError::NoError) { systemError(this, copypopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } } void copyTransferOrder::sCopy() { XSqlQuery copyCopy; copyCopy.prepare("SELECT copyTransferOrder(:tohead_id, :scheddate) AS result;"); copyCopy.bindValue(":tohead_id", _to->id()); if (_reschedule->isChecked()) copyCopy.bindValue(":scheddate", _scheduleDate->date()); else copyCopy.bindValue(":scheddate", QDate::currentDate()); int toheadid = 0; copyCopy.exec(); if (copyCopy.first()) { toheadid = copyCopy.value("result").toInt(); if (toheadid < 0) { QMessageBox::critical(this, tr("Could Not Copy Transfer Order"), storedProcErrorLookup("copyTransferOrder", toheadid)); return; } transferOrder::editTransferOrder(toheadid, true); } else if (copyCopy.lastError().type() != QSqlError::NoError) { systemError(this, copyCopy.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sTransferOrdersUpdated(toheadid); if (_captive) done(toheadid); else { _to->setId(-1); _to->setFocus(); } } qt-client-4.1.0/guiclient/copyTransferOrder.h000066400000000000000000000020661217451700100212250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COPYTRANSFERORDER_H #define COPYTRANSFERORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_copyTransferOrder.h" class copyTransferOrder : public XDialog, public Ui::copyTransferOrder { Q_OBJECT public: copyTransferOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~copyTransferOrder(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void populate(); virtual void sCopy(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // COPYTRANSFERORDER_H qt-client-4.1.0/guiclient/copyTransferOrder.ui000066400000000000000000000173771217451700100214260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. copyTransferOrder 0 0 600 400 Copy Transfer Order 4 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 13 Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal QSizePolicy::MinimumExpanding 13 20 Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok 0 1 QFrame::NoFrame QFrame::Raised 0 2 0 Original Line Items: Use Today's Date true Schedule Transfer Order for: false Qt::Horizontal 40 20 DLineEdit QWidget
datecluster.h
OrderCluster QWidget
ordercluster.h
XTreeWidget QTreeWidget
xtreewidget.h
_orderDate _item _useCurrentDate _reschedule _scheduleDate _reschedule toggled(bool) _scheduleDate setEnabled(bool) 20 20 20 20 _buttonBox rejected() copyTransferOrder reject() 552 57 299 199
qt-client-4.1.0/guiclient/correctProductionPosting.cpp000066400000000000000000000137731217451700100231700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "correctProductionPosting.h" #include #include #include #include "closeWo.h" #include "distributeInventory.h" #include "inputManager.h" #include "storedProcErrorLookup.h" correctProductionPosting::correctProductionPosting(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_correct, SIGNAL(clicked()), this, SLOT(sCorrect())); connect(_wo, SIGNAL(newId(int)), this, SLOT(populate())); _captive = FALSE; _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); _qtyReceivedCache = 0.0; omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _wo->setType(cWoIssued); _qty->setValidator(omfgThis->qtyVal()); _qtyOrdered->setPrecision(omfgThis->transQtyVal()); _qtyReceived->setPrecision(omfgThis->transQtyVal()); _qtyBalance->setPrecision(omfgThis->transQtyVal()); if (_preferences->boolean("XCheckBox/forgetful")) _backFlush->setChecked(true); _nonPickItems->setEnabled(_backFlush->isChecked() && _privileges->check("ChangeNonPickItems")); // TODO: unhide as part of implementation of 5847 _nonPickItems->hide(); adjustSize(); } correctProductionPosting::~correctProductionPosting() { // no need to delete child widgets, Qt does it all for us } void correctProductionPosting::languageChange() { retranslateUi(this); } enum SetResponse correctProductionPosting::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _captive = TRUE; _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } return NoError; } bool correctProductionPosting::okToPost() { if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return false; } else if (_qty->toDouble() > _qtyReceivedCache) { QMessageBox::warning( this, tr("Cannot Post Correction"), tr( "The Quantity to correct must be less than or equal to the Quantity already Posted." ) ); _qty->setFocus(); return false; } XSqlQuery itemtypeq; itemtypeq.prepare( "SELECT itemsite_costmethod " "FROM wo, itemsite " "WHERE ( (wo_itemsite_id=itemsite_id)" " AND (wo_id=:wo_id) );" ); itemtypeq.bindValue(":wo_id", _wo->id()); itemtypeq.exec(); if (itemtypeq.first() && (itemtypeq.value("itemsite_costmethod").toString() == "J")) { QMessageBox::warning(this, tr("Cannot Post Correction"), tr("You may not post a correction to a Work Order for a " "Item Site with the Job cost method. You must, " "instead, adjust shipped quantities.")); return false; } else if (itemtypeq.lastError().type() != QSqlError::NoError) { systemError(this, itemtypeq.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void correctProductionPosting::clear() { _wo->setId(-1); _qty->clear(); _close->setText(tr("&Close")); _wo->setFocus(); } void correctProductionPosting::sCorrect() { XSqlQuery correctCorrect; if (! okToPost()) return; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); correctCorrect.exec("BEGIN;"); // handle cancel of lot, serial, or loc distribution correctCorrect.prepare("SELECT correctProduction(:wo_id, :qty, :backflushMaterials, 0, :date)" " AS result;"); correctCorrect.bindValue(":wo_id", _wo->id()); if (_wo->method() == "A") correctCorrect.bindValue(":qty", _qty->toDouble()); else correctCorrect.bindValue(":qty", _qty->toDouble() * -1); correctCorrect.bindValue(":backflushMaterials", QVariant(_backFlush->isChecked())); correctCorrect.bindValue(":date", _transDate->date()); correctCorrect.exec(); if (correctCorrect.first()) { int result = correctCorrect.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("correctProduction", result), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Correct Production Posting"), tr("Transaction Canceled") ); return; } correctCorrect.exec("COMMIT;"); omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); } else if (correctCorrect.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, correctCorrect.lastError().databaseText(), __FILE__, __LINE__); return; } if (_captive) accept(); else clear(); } void correctProductionPosting::populate() { if (_wo->id() != -1) { if (_wo->method() == "D") { _backFlush->setEnabled(false); _backFlush->setChecked(false); _qtyOrderedLit->setText(tr("Qty. to Disassemble:")); _qtyReceivedLit->setText(tr("Qty. Disassembled:")); } else { _backFlush->setEnabled(true); _qtyOrderedLit->setText(tr("Qty. Ordered:")); _qtyReceivedLit->setText(tr("Qty. Received:")); } _qtyOrdered->setText(_wo->qtyOrdered()); _qtyReceived->setText(_wo->qtyReceived()); _qtyBalance->setText(_wo->qtyBalance()); _qtyReceivedCache = _wo->qtyReceived(); } else { _qtyOrdered->clear(); _qtyReceived->clear(); _qtyBalance->clear(); _qtyReceivedCache = 0; } } qt-client-4.1.0/guiclient/correctProductionPosting.h000066400000000000000000000024341217451700100226250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CORRECTPRODUCTIONPOSTING_H #define CORRECTPRODUCTIONPOSTING_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_correctProductionPosting.h" class correctProductionPosting : public XDialog, public Ui::correctProductionPosting { Q_OBJECT public: correctProductionPosting(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~correctProductionPosting(); Q_INVOKABLE virtual bool captive() const { return _captive; } Q_INVOKABLE virtual bool okToPost(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void clear(); protected slots: virtual void languageChange(); virtual void sCorrect(); virtual void populate(); private: double _qtyReceivedCache; bool _captive; }; #endif // CORRECTPRODUCTIONPOSTING_H qt-client-4.1.0/guiclient/correctProductionPosting.ui000066400000000000000000000273501217451700100230170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. correctProductionPosting 0 0 635 387 Correct Production Posting 12 12 Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 0 20 &Cancel false &Post Qt::Vertical QSizePolicy::Expanding 20 20 0 0 290 130 Qt::StrongFocus Qt::Horizontal 0 20 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Qty. to Correct: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty 100 32767 Qt::AlignRight Backflush &Materials 0 Qt::Horizontal QSizePolicy::Fixed 10 0 &Return Items not on Pick List Qt::Vertical QSizePolicy::Preferred 20 28 DLineEdit QWidget
datecluster.h
WoCluster QWidget
wocluster.h
XCheckBox QCheckBox
xcheckbox.h
XLabel QLabel
xlabel.h
XLineEdit QLineEdit
xlineedit.h
_transDate _wo _qty _backFlush _nonPickItems _correct _close _backFlush toggled(bool) _nonPickItems setEnabled(bool) 20 20 20 20 _wo valid(bool) _correct setEnabled(bool) 20 20 20 20 _close clicked() correctProductionPosting reject() 20 20 20 20
qt-client-4.1.0/guiclient/costCategories.cpp000066400000000000000000000133751217451700100210700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "costCategories.h" #include #include #include #include #include #include #include "costCategory.h" #include "itemSites.h" costCategories::costCategories(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_costcat, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); _costcat->addColumn(tr("Category"), _itemColumn, Qt::AlignLeft, true, "costcat_code"); _costcat->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "costcat_descrip"); if (_privileges->check("MaintainCostCategories")) { connect(_costcat, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_costcat, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_costcat, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_costcat, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_costcat, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } costCategories::~costCategories() { // no need to delete child widgets, Qt does it all for us } void costCategories::languageChange() { retranslateUi(this); } void costCategories::sPrint() { orReport report("CostCategoriesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void costCategories::sNew() { ParameterList params; params.append("mode", "new"); costCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void costCategories::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("costcat_id", _costcat->id()); costCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void costCategories::sView() { ParameterList params; params.append("mode", "view"); params.append("costcat_id", _costcat->id()); costCategory newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void costCategories::sCopy() { ParameterList params; params.append("mode", "copy"); params.append("costcat_id", _costcat->id()); costCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void costCategories::sDelete() { XSqlQuery costDelete; if ( QMessageBox::question(this, tr("Delete Cost Category"), tr("

Are you sure that you want to delete the selected Cost Category?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { costDelete.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE (itemsite_costcat_id=:costcat_id) " "LIMIT 1;" ); costDelete.bindValue(":costcat_id", _costcat->id()); costDelete.exec(); if (costDelete.first()) QMessageBox::information( this, tr("Cost Category in Use"), tr("

The selected Cost Category cannot be " "deleted as it still contains Items. You " "must reassign these Items before deleting " "this Cost Category.") ); else if (costDelete.lastError().type() != QSqlError::NoError) { systemError(this, costDelete.lastError().databaseText(), __FILE__, __LINE__); return; } else { costDelete.prepare( "DELETE FROM costcat " "WHERE (costcat_id=:costcat_id);" ); costDelete.bindValue(":costcat_id", _costcat->id()); costDelete.exec(); sFillList(); } } } void costCategories::sPopulateMenu(QMenu *menu) { QAction *menuItem; menuItem = menu->addAction(tr("Edit Inventory Cost Cateogry..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCostCategories")); menuItem = menu->addAction(tr("View Inventory Cost Category..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainCostCategories") || _privileges->check("ViewCostCategories")); menuItem = menu->addAction(tr("Delete Inventory Cost Category..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainCostCategories")); menu->addSeparator(); menuItem = menu->addAction(tr("List Items in this Inventory Cost Category..."), this, SLOT(sListItemSites())); menuItem->setEnabled(_privileges->check("ViewItemSites")); } void costCategories::sListItemSites() { ParameterList params; params.append("run"); params.append("costcat_id", _costcat->id()); itemSites *newdlg = new itemSites(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void costCategories::sFillList() { _costcat->populate( "SELECT costcat_id, costcat_code, costcat_descrip " "FROM costcat " "ORDER BY costcat_code" ); } qt-client-4.1.0/guiclient/costCategories.h000066400000000000000000000022211217451700100205210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COSTCATEGORIES_H #define COSTCATEGORIES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_costCategories.h" class costCategories : public XWidget, public Ui::costCategories { Q_OBJECT public: costCategories(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~costCategories(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sCopy(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * menu ); virtual void sFillList(); virtual void sListItemSites(); protected slots: virtual void languageChange(); }; #endif // COSTCATEGORIES_H qt-client-4.1.0/guiclient/costCategories.ui000066400000000000000000000123171217451700100207160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. costCategories 0 0 400 400 List Cost Categories 0 Cost Categories: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 true &New false &Edit false &View false Co&py false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

xtreewidget.h
_costcat _new _edit _view _copy _delete _print _close parameter.h _close clicked() costCategories close() 20 20 20 20 _costcat valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/costCategory.cpp000066400000000000000000000334361217451700100205600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "errorReporter.h" #include "guiErrorCheck.h" #include "costCategory.h" #include #include #include costCategory::costCategory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _costcatid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_category, SIGNAL(editingFinished()), this, SLOT(sCheck())); _asset->setType(GLCluster::cAsset); _expense->setType(GLCluster::cExpense); _wip->setType(GLCluster::cAsset); _inventoryCost->setType(GLCluster::cExpense | GLCluster::cAsset); _adjustment->setType(GLCluster::cExpense); _invScrap->setType(GLCluster::cExpense); _mfgScrap->setType(GLCluster::cExpense); _transformClearing->setType(GLCluster::cExpense | GLCluster::cAsset); _purchasePrice->setType(GLCluster::cExpense | GLCluster::cAsset); _liability->setType(GLCluster::cLiability); _freight->setType(GLCluster::cExpense); _shippingAsset->setType(GLCluster::cAsset); _toLiabilityClearing->setType(GLCluster::cLiability); _transformClearingLit->setVisible(_metrics->boolean("Transforms")); _transformClearing->setVisible(_metrics->boolean("Transforms")); _toLiabilityClearingLit->setVisible(_metrics->boolean("MultiWhs")); _toLiabilityClearing->setVisible(_metrics->boolean("MultiWhs")); // This should all be generated as part of the UI but it was the only // way I could get the tab order to work exactly as it was supposed to. QWidget::setTabOrder(_category, _description); QWidget::setTabOrder(_description, _asset); QWidget::setTabOrder(_asset, _expense); QWidget::setTabOrder(_expense, _wip); QWidget::setTabOrder(_wip, _inventoryCost); QWidget::setTabOrder(_inventoryCost, _transformClearing); QWidget::setTabOrder(_transformClearing, _purchasePrice); QWidget::setTabOrder(_purchasePrice, _adjustment); QWidget::setTabOrder(_adjustment, _invScrap); QWidget::setTabOrder(_invScrap, _mfgScrap); QWidget::setTabOrder(_mfgScrap, _liability); QWidget::setTabOrder(_liability, _shippingAsset); QWidget::setTabOrder(_shippingAsset, _freight); QWidget::setTabOrder(_freight, _toLiabilityClearing); QWidget::setTabOrder(_toLiabilityClearing, _buttonBox->button(QDialogButtonBox::Save)); QWidget::setTabOrder(_buttonBox->button(QDialogButtonBox::Save), _buttonBox->button(QDialogButtonBox::Cancel)); } costCategory::~costCategory() { // no need to delete child widgets, Qt does it all for us } void costCategory::languageChange() { retranslateUi(this); } enum SetResponse costCategory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("costcat_id", &valid); if (valid) { _costcatid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "copy") { _mode = cCopy; _costcatid = -1; } else if (param.toString() == "view") { _mode = cView; _category->setEnabled(FALSE); _description->setEnabled(FALSE); _asset->setReadOnly(TRUE); _expense->setReadOnly(TRUE); _wip->setReadOnly(TRUE); _inventoryCost->setReadOnly(TRUE); _adjustment->setReadOnly(TRUE); _invScrap->setReadOnly(TRUE); _mfgScrap->setReadOnly(TRUE); _transformClearing->setReadOnly(TRUE); _purchasePrice->setReadOnly(TRUE); _liability->setReadOnly(TRUE); _freight->setReadOnly(TRUE); _shippingAsset->setReadOnly(TRUE); _toLiabilityClearing->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void costCategory::sCheck() { XSqlQuery costCheck; if ((_mode == cNew) && (_category->text().length() != 0)) { costCheck.prepare( "SELECT costcat_id" " FROM costcat" " WHERE((UPPER(costcat_code)=UPPER(:costcat_code))" " AND (costcat_id != :costcat_id));" ); costCheck.bindValue(":costcat_code", _category->text().trimmed()); costCheck.bindValue(":costcat_id", _costcatid); costCheck.exec(); if (costCheck.first()) { _costcatid = costCheck.value("costcat_id").toInt(); _mode = cEdit; populate(); _category->setEnabled(FALSE); } else if (costCheck.lastError().type() != QSqlError::NoError) { systemError(this, costCheck.lastError().databaseText(), __FILE__, __LINE__); return; } } } void costCategory::sSave() { XSqlQuery costSave; QList errors; errors << GuiErrorCheck(_category->text().trimmed().isEmpty(), _category, tr("

You must enter a name for this Cost Category before saving it.")); if (_metrics->boolean("InterfaceToGL")) { errors << GuiErrorCheck(!_asset->isValid(), _asset, tr("

You must select an Inventory Asset Account before saving.")) << GuiErrorCheck(!_expense->isValid(), _expense, tr("

You must select an Expense Asset Account before saving.")) << GuiErrorCheck(!_wip->isValid(), _wip, tr("

You must select a WIP Asset Account before saving.")) << GuiErrorCheck(!_inventoryCost->isValid(), _inventoryCost, tr("

You must select an Inventory Cost Variance Account before saving.")) << GuiErrorCheck(_metrics->boolean("MultiWhs") && _metrics->boolean("Transforms") && !_transformClearing->isValid(), _transformClearing, tr("

You must select a Transform Clearing Account before saving.")) << GuiErrorCheck(!_purchasePrice->isValid(), _purchasePrice, tr("

You must select a Purchase Price Variance Account before saving.")) << GuiErrorCheck(!_adjustment->isValid(), _adjustment, tr("

You must select an Inventory Adjustment Account before saving.")) << GuiErrorCheck(!_invScrap->isValid(), _invScrap, tr("

You must select an Inventory Scrap Account before saving.")) << GuiErrorCheck(!_mfgScrap->isValid(), _mfgScrap, tr("

You must select a Manufacturing Scrap Account before saving.")) << GuiErrorCheck(!_liability->isValid(), _liability, tr("

You must select a P/O Liability Clearing Account before saving.")) << GuiErrorCheck(!_shippingAsset->isValid(), _shippingAsset, tr("

You must select a Shipping Asset Account before saving.")) << GuiErrorCheck(!_freight->isValid(), _freight, tr("

You must select a Line Item Freight Expense Account before saving.")) << GuiErrorCheck(_metrics->boolean("MultiWhs") && !_toLiabilityClearing->isValid(), _toLiabilityClearing, tr("

You must select a Transfer Order Liability Clearing Account before saving.")) ; } costSave.prepare( "SELECT costcat_id" " FROM costcat" " WHERE((UPPER(costcat_code)=UPPER(:costcat_code))" " AND (costcat_id != :costcat_id));" ); costSave.bindValue(":costcat_code", _category->text().trimmed()); costSave.bindValue(":costcat_id", _costcatid); costSave.exec(); if (costSave.first()) { errors << GuiErrorCheck(true, _category, tr("

The Name you have entered for this Cost Category is already in use.")); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Cost Category"), errors)) return; QSqlQuery newCostCategory; if ( (_mode == cNew) || (_mode == cCopy) ) { costSave.exec("SELECT NEXTVAL('costcat_costcat_id_seq') AS costcat_id"); if (costSave.first()) _costcatid = costSave.value("costcat_id").toInt(); else { systemError(this, costSave.lastError().databaseText(), __FILE__, __LINE__); return; } costSave.prepare( "INSERT INTO costcat" "( costcat_id, costcat_code, costcat_descrip," " costcat_asset_accnt_id, costcat_invcost_accnt_id," " costcat_liability_accnt_id, costcat_freight_accnt_id," " costcat_adjustment_accnt_id, costcat_scrap_accnt_id, costcat_mfgscrap_accnt_id," " costcat_transform_accnt_id, costcat_wip_accnt_id," " costcat_purchprice_accnt_id," " costcat_shipasset_accnt_id, costcat_toliability_accnt_id, " " costcat_exp_accnt_id) " "VALUES " "( :costcat_id, :costcat_code, :costcat_descrip," " :costcat_asset_accnt_id, :costcat_invcost_accnt_id," " :costcat_liability_accnt_id, :costcat_freight_accnt_id," " :costcat_adjustment_accnt_id, :costcat_scrap_accnt_id, :costcat_mfgscrap_accnt_id," " :costcat_transform_accnt_id, :costcat_wip_accnt_id," " :costcat_purchprice_accnt_id," " :costcat_shipasset_accnt_id, :costcat_toliability_accnt_id," " :costcat_exp_accnt_id);" ); } else if (_mode == cEdit) costSave.prepare( "UPDATE costcat " "SET costcat_code=:costcat_code, costcat_descrip=:costcat_descrip," " costcat_asset_accnt_id=:costcat_asset_accnt_id," " costcat_invcost_accnt_id=:costcat_invcost_accnt_id," " costcat_liability_accnt_id=:costcat_liability_accnt_id," " costcat_freight_accnt_id=:costcat_freight_accnt_id," " costcat_adjustment_accnt_id=:costcat_adjustment_accnt_id," " costcat_scrap_accnt_id=:costcat_scrap_accnt_id," " costcat_mfgscrap_accnt_id=:costcat_mfgscrap_accnt_id," " costcat_transform_accnt_id=:costcat_transform_accnt_id," " costcat_wip_accnt_id=:costcat_wip_accnt_id," " costcat_purchprice_accnt_id=:costcat_purchprice_accnt_id," " costcat_shipasset_accnt_id=:costcat_shipasset_accnt_id," " costcat_toliability_accnt_id=:costcat_toliability_accnt_id, " " costcat_exp_accnt_id=:costcat_exp_accnt_id " "WHERE (costcat_id=:costcat_id);" ); costSave.bindValue(":costcat_id", _costcatid); costSave.bindValue(":costcat_code", _category->text().trimmed()); costSave.bindValue(":costcat_descrip", _description->text().trimmed()); costSave.bindValue(":costcat_asset_accnt_id", _asset->id()); costSave.bindValue(":costcat_invcost_accnt_id", _inventoryCost->id()); costSave.bindValue(":costcat_liability_accnt_id", _liability->id()); costSave.bindValue(":costcat_freight_accnt_id", _freight->id()); costSave.bindValue(":costcat_adjustment_accnt_id", _adjustment->id()); costSave.bindValue(":costcat_scrap_accnt_id", _invScrap->id()); costSave.bindValue(":costcat_mfgscrap_accnt_id", _mfgScrap->id()); costSave.bindValue(":costcat_transform_accnt_id", _transformClearing->id()); costSave.bindValue(":costcat_wip_accnt_id", _wip->id()); costSave.bindValue(":costcat_purchprice_accnt_id", _purchasePrice->id()); costSave.bindValue(":costcat_shipasset_accnt_id", _shippingAsset->id()); costSave.bindValue(":costcat_exp_accnt_id", _expense->id()); if (_toLiabilityClearing->isValid()) costSave.bindValue(":costcat_toliability_accnt_id", _toLiabilityClearing->id()); costSave.exec(); if (costSave.lastError().type() != QSqlError::NoError) { systemError(this, costSave.lastError().databaseText(), __FILE__, __LINE__); return; } emit saved(_costcatid); done(_costcatid); } void costCategory::populate() { XSqlQuery costpopulate; costpopulate.prepare( "SELECT * " "FROM costcat " "WHERE (costcat_id=:costcat_id);" ); costpopulate.bindValue(":costcat_id", _costcatid); costpopulate.exec(); if (costpopulate.first()) { if (_mode != cCopy) { _category->setText(costpopulate.value("costcat_code").toString()); _description->setText(costpopulate.value("costcat_descrip").toString()); } _asset->setId(costpopulate.value("costcat_asset_accnt_id").toInt()); _expense->setId(costpopulate.value("costcat_exp_accnt_id").toInt()); _inventoryCost->setId(costpopulate.value("costcat_invcost_accnt_id").toInt()); _liability->setId(costpopulate.value("costcat_liability_accnt_id").toInt()); _freight->setId(costpopulate.value("costcat_freight_accnt_id").toInt()); _adjustment->setId(costpopulate.value("costcat_adjustment_accnt_id").toInt()); _invScrap->setId(costpopulate.value("costcat_scrap_accnt_id").toInt()); _mfgScrap->setId(costpopulate.value("costcat_mfgscrap_accnt_id").toInt()); _wip->setId(costpopulate.value("costcat_wip_accnt_id").toInt()); _transformClearing->setId(costpopulate.value("costcat_transform_accnt_id").toInt()); _purchasePrice->setId(costpopulate.value("costcat_purchprice_accnt_id").toInt()); _shippingAsset->setId(costpopulate.value("costcat_shipasset_accnt_id").toInt()); _toLiabilityClearing->setId(costpopulate.value("costcat_toliability_accnt_id").toInt()); emit populated(_costcatid); } else if (costpopulate.lastError().type() != QSqlError::NoError) { systemError(this, costpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/costCategory.h000066400000000000000000000022121217451700100202110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COSTCATEGORY_H #define COSTCATEGORY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_costCategory.h" class costCategory : public XDialog, public Ui::costCategory { Q_OBJECT public: costCategory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~costCategory(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); signals: void populated(int costcatid); void saved(int costcatid); protected slots: virtual void languageChange(); private: int _mode; int _costcatid; }; #endif // COSTCATEGORY_H qt-client-4.1.0/guiclient/costCategory.ui000066400000000000000000000247461217451700100204170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. costCategory 0 0 394 442 Cost Category Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 3 Inventory Asset: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Expense: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter WIP Asset: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Inventory Cost Variance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Transform Clearing: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Purchase Price Variance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Inventory Adjustment: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Inventory Scrap: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Manufacturing Scrap: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter P/O Liability Clearing: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Shipping Asset: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Line Item Freight Expense: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Transfer Order Liability Clearing: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _toLiabilityClearing Qt::Vertical QSizePolicy::Expanding 20 0 GLCluster QWidget

glcluster.h
XLineEdit QLineEdit
xlineedit.h
_category _description _asset _expense _wip _inventoryCost _transformClearing _purchasePrice _adjustment _invScrap _mfgScrap _liability _shippingAsset _freight _toLiabilityClearing _buttonBox _buttonBox rejected() costCategory reject() 520 48 283 302 qt-client-4.1.0/guiclient/costingElements.cpp000066400000000000000000000070431217451700100212500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "costingElements.h" #include #include #include #include #include "userCostingElement.h" costingElements::costingElements(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _costelem->addColumn(tr("Costing Element"), -1, Qt::AlignLeft, true, "costelem_type"); sFillList(); } costingElements::~costingElements() { // no need to delete child widgets, Qt does it all for us } void costingElements::languageChange() { retranslateUi(this); } void costingElements::sNew() { ParameterList params; params.append("mode", "new"); userCostingElement newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void costingElements::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("costelem_id", _costelem->id()); userCostingElement newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void costingElements::sDelete() { XSqlQuery costingDelete; costingDelete.prepare( "SELECT itemcost_id " "FROM itemcost " "WHERE (itemcost_costelem_id=:costelem_id) " "LIMIT 1;" ); costingDelete.bindValue(":costelem_id", _costelem->id()); costingDelete.exec(); if (costingDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Selected User Costing Element"), tr( "

The selected User Costing Element cannot be " "deleted as it is being used by an existing Item " "Cost. You must first delete all Item Costs " "assigned to the selected User Costing Element " "before you may delete it." ) ); return; } costingDelete.prepare( "SELECT costhist_id " "FROM costhist " "WHERE (costhist_costelem_id=:costelem_id) " "LIMIT 1;" ); costingDelete.bindValue(":costelem_id", _costelem->id()); costingDelete.exec(); if (costingDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Selected User Costing Element"), tr( "

The selected User Costing Element cannot be " "deleted as it is there is Costing History " "assigned to it. You may only deactivate the " "selected User Costing Element." ) ); return; } costingDelete.prepare( "DELETE FROM costelem " "WHERE (costelem_id=:costelem_id);" ); costingDelete.bindValue(":costelem_id", _costelem->id()); costingDelete.exec(); sFillList(); } void costingElements::sFillList() { _costelem->populate( "SELECT costelem_id, costelem_type " "FROM costelem " "WHERE (NOT costelem_sys) " "ORDER BY costelem_type" ); } qt-client-4.1.0/guiclient/costingElements.h000066400000000000000000000017371217451700100207210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COSTINGELEMENTS_H #define COSTINGELEMENTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_costingElements.h" class costingElements : public XWidget, public Ui::costingElements { Q_OBJECT public: costingElements(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~costingElements(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // COSTINGELEMENTS_H qt-client-4.1.0/guiclient/costingElements.ui000066400000000000000000000116421217451700100211030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. costingElements 0 0 397 333 List User-Defined Costing Elements 0 0 User Costing Elements: 0 5 &Close 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

xtreewidget.h
0 _costelem _new _edit _delete _close _costelem valid(bool) _delete setEnabled(bool) 20 20 20 20 _costelem itemSelected(int) _edit animateClick() 20 20 20 20 _costelem valid(bool) _edit setEnabled(bool) 20 20 20 20 _close clicked() costingElements close() 20 20 20 20 qt-client-4.1.0/guiclient/countSlip.cpp000066400000000000000000000434541217451700100200730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "countSlip.h" #include #include #include #include "inputManager.h" #include "countTagList.h" #include "errorReporter.h" #include "guiErrorCheck.h" countSlip::countSlip(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_item, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int))); connect(_countTagList, SIGNAL(clicked()), this, SLOT(sCountTagList())); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemSiteInfo())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateItemSiteInfo())); _captive = FALSE; #ifndef Q_WS_MAC _countTagList->setMaximumWidth(25); #endif _item->setReadOnly(TRUE); _qty->setValidator(omfgThis->qtyVal()); _expiration->setAllowNullDate(true); _expiration->setAllowNullDate(false); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } /* * Destroys the object and frees any allocated resources */ countSlip::~countSlip() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void countSlip::languageChange() { retranslateUi(this); } enum SetResponse countSlip::set(const ParameterList &pParams) { XSqlQuery countet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cnttag_id", &valid); if (valid) { _captive = TRUE; _cnttagid = param.toInt(); populateTagInfo(); } param = pParams.value("cntslip_id", &valid); if (valid) { _captive = TRUE; _cntslipid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; omfgThis->inputManager()->notify(cBCCountTag, this, this, SLOT(sCatchCounttagid(int))); } else if (param.toString() == "edit") { _mode = cEdit; _captive = TRUE; countet.prepare( "SELECT cntslip_posted " "FROM cntslip " "WHERE (cntslip_id=:cntslip_id);" ); countet.bindValue(":cntslip_id", _cntslipid); countet.exec(); if (countet.first()) { if (countet.value("cntslip_posted").toBool()) { // ToDo reject(); } } _countTagList->hide(); _number->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _countTagList->hide(); _number->setEnabled(FALSE); _qty->setEnabled(FALSE); _comments->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } else if (param.toString() == "post") { _mode = cPost; _location->setEnabled(FALSE); _lotSerial->setEnabled(FALSE); _countTagList->hide(); _number->setEnabled(FALSE); _qty->setEnabled(FALSE); _comments->setEnabled(FALSE); _save->setText(tr("&Post")); _expiration->setEnabled(FALSE); _warranty->setEnabled(FALSE); } } return NoError; } void countSlip::sCatchCounttagid(int pCnttagid) { _cnttagid = pCnttagid; populate(); _number->setFocus(); } void countSlip::sSave() { XSqlQuery countSave; QString slipNumber = _number->text().trimmed().toUpper(); QList errors; errors << GuiErrorCheck(slipNumber.length() == 0, _number, tr("You must enter a Count Slip # for this Count Slip.")) << GuiErrorCheck(_qty->text().trimmed().length() == 0, _qty, tr("You must enter a counted quantity for this Count Slip.")) ; if (_mode == cNew) { QString countSlipAuditing = _metrics->value("CountSlipAuditing"); if (countSlipAuditing == "W") { countSave.prepare( "SELECT cntslip_id " "FROM cntslip, " " invcnt AS newtag, invcnt AS oldtag," " itemsite AS newsite, itemsite AS oldsite " "WHERE ( (cntslip_cnttag_id=oldtag.invcnt_id)" " AND (oldtag.invcnt_itemsite_id=oldsite.itemsite_id)" " AND (newtag.invcnt_itemsite_id=newsite.itemsite_id)" " AND (oldsite.itemsite_warehous_id=newsite.itemsite_warehous_id)" " AND (NOT cntslip_posted)" " AND (newtag.invcnt_id=:cnttag_id)" " AND (cntslip_number=:cntslip_number) );" ); countSave.bindValue(":cnttag_id", _cnttagid); countSave.bindValue(":cntslip_number", slipNumber); countSave.exec(); if (countSave.first()) { errors << GuiErrorCheck(true, _number, tr( "An unposted Count Slip for this Site has already been entered\n" "with this #. The I/M Module has been configured to disallow the\n" "duplication of unposted Count Slip #s within a given Site.\n" "Please verify the # of the Count Slip you are entering." )); } } else if (countSlipAuditing == "A") { countSave.prepare( "SELECT cntslip_id " "FROM cntslip " "WHERE ( (NOT cntslip_posted)" " AND (cntslip_number=:cntslip_number));" ); countSave.bindValue(":cntslip_number", slipNumber); countSave.exec(); if (countSave.first()) { errors << GuiErrorCheck(true, _number, tr( "An unposted Count Slip has already been entered with this #.\n" "The I/M Module has been configured to disallow the\n" "duplication of unposted Count Slip #s.\n" "Please verify the # of the Count Slip you are entering." )); } } else if (countSlipAuditing == "X") { countSave.prepare( "SELECT cntslip_id " "FROM cntslip, " " invcnt AS newtag, invcnt AS oldtag," " itemsite AS newsite, itemsite AS oldsite " "WHERE ( (cntslip_cnttag_id=oldtag.invcnt_id)" " AND (oldtag.invcnt_itemsite_id=oldsite.itemsite_id)" " AND (newtag.invcnt_itemsite_id=newsite.itemsite_id)" " AND (oldsite.itemsite_warehous_id=newsite.itemsite_warehous_id)" " AND (newtag.invcnt_id=:cnttag_id)" " AND (cntslip_number=:cntslip_number));" ); countSave.bindValue(":cnttag_id", _cnttagid); countSave.bindValue(":cntslip_number", slipNumber); countSave.exec(); if (countSave.first()) { errors << GuiErrorCheck(true, _number, tr( "An Count Slip for this Site has already been entered with this #.\n" "The I/M Module has been configured to disallow the duplication\n" "of Count Slip #s within a given Site.\n" "Please verify the # of the Count Slip you are entering." )); } } else if (countSlipAuditing == "B") { countSave.prepare( "SELECT cntslip_id " "FROM cntslip " "WHERE (cntslip_number=:cntslip_number);" ); countSave.bindValue(":cntslip_number", slipNumber); countSave.exec(); if (countSave.first()) { errors << GuiErrorCheck(true, _number, tr( "An Count Slip has already been entered with this #. The\n" "I/M Module has been configured to disallow the duplication of Count Slip #s.\n" "Please verify the # of the Count Slip you are entering." )); } } // Check for duplicate Serial # countSave.prepare( "SELECT cntslip_id " "FROM invcnt JOIN itemsite ON (itemsite_id=invcnt_itemsite_id)" " JOIN cntslip ON (cntslip_cnttag_id=invcnt_id)" "WHERE ( (invcnt_id=:cnttag_id)" " AND (itemsite_controlmethod='S')" " AND (cntslip_lotserial=:cntslip_lotserial) );" ); countSave.bindValue(":cnttag_id", _cnttagid); countSave.bindValue(":cntslip_lotserial", _lotSerial->text()); countSave.exec(); if (countSave.first()) { errors << GuiErrorCheck(true, _lotSerial, tr( "A Count Slip has already been entered with this Serial #.\n" "Please verify the Serial # of the Count Slip you are entering." )); } // Check for duplicate Serial # in different Location from Location being counted if (_metrics->boolean("MultiWhs")) { countSave.prepare( "SELECT itemloc_id " "FROM invcnt JOIN itemsite ON (itemsite_id=invcnt_itemsite_id)" " JOIN itemloc ON (itemloc_itemsite_id=itemsite_id)" " JOIN ls ON (ls_id=itemloc_ls_id)" "WHERE ( (invcnt_id=:cnttag_id)" " AND (invcnt_location_id IS NOT NULL)" " AND (itemsite_controlmethod='S')" " AND (itemloc_location_id <> :cntslip_location_id)" " AND (ls_number=:cntslip_lotserial) );" ); countSave.bindValue(":cnttag_id", _cnttagid); countSave.bindValue(":cntslip_location_id", _location->id()); countSave.bindValue(":cntslip_lotserial", _lotSerial->text()); countSave.exec(); if (countSave.first()) { errors << GuiErrorCheck(true, _lotSerial, tr( "This Serial # exists in a different Location.\n" "Please verify the Serial # of the Count Slip you are entering." )); } } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Count Slip"), errors)) return; countSave.exec("SELECT NEXTVAL('cntslip_cntslip_id_seq') AS cntslip_id"); if (countSave.first()) _cntslipid = countSave.value("cntslip_id").toInt(); // ToDo countSave.prepare( "INSERT INTO cntslip " "( cntslip_id, cntslip_cnttag_id," " cntslip_username, cntslip_entered, cntslip_posted," " cntslip_number, cntslip_qty," " cntslip_location_id, cntslip_lotserial," " cntslip_lotserial_expiration," " cntslip_lotserial_warrpurc," " cntslip_comments ) " "SELECT :cntslip_id, :cnttag_id," " getEffectiveXtUser(), CURRENT_TIMESTAMP, FALSE," " :cntslip_number, :cntslip_qty," " :cntslip_location_id, :cntslip_lotserial," " :cntslip_lotserial_expiration," " :cntslip_lotserial_warrpurc," " :cntslip_comments;" ); } else if (_mode == cEdit) countSave.prepare( "UPDATE cntslip " "SET cntslip_username=getEffectiveXtUser(), cntslip_qty=:cntslip_qty, cntslip_comments=:cntslip_comments," " cntslip_entered=CURRENT_TIMESTAMP," " cntslip_location_id=:cntslip_location_id, cntslip_lotserial=:cntslip_lotserial," " cntslip_lotserial_expiration=:cntslip_lotserial_expiration, " " cntslip_lotserial_warrpurc=:cntslip_lotserial_warrpurc " "WHERE (cntslip_id=:cntslip_id);" ); else if (_mode == cPost) countSave.prepare("SELECT postCountSlip(:cntslip_id) AS result;"); countSave.bindValue(":cntslip_id", _cntslipid); countSave.bindValue(":cnttag_id", _cnttagid); countSave.bindValue(":cntslip_number", slipNumber); countSave.bindValue(":cntslip_qty", _qty->toDouble()); countSave.bindValue(":cntslip_location_id", _location->id()); countSave.bindValue(":cntslip_lotserial", _lotSerial->text()); countSave.bindValue(":cntslip_comments", _comments->toPlainText()); if(_expiration->isEnabled()) countSave.bindValue(":cntslip_lotserial_expiration", _expiration->date()); else countSave.bindValue(":cntslip_lotserial_expiration", QVariant()); if(_warranty->isEnabled()) countSave.bindValue(":cntslip_lotserial_warrpurc", _warranty->date()); countSave.exec(); if (_mode == cPost) { if (countSave.first()) { if (countSave.value("result").toInt() == -1) _cntslipid = XDialog::Rejected; } // ToDo } if (_captive) done(_cntslipid); else { _cnttagid = -1; _countTagNumber->clear(); _item->setId(-1); _number->clear(); _qty->clear(); _comments->clear(); _location->clear(); _location->setEnabled(FALSE); _lotSerial->clear(); _lotSerial->setEnabled(FALSE); _close->setText(tr("&Close")); _countTagList->setFocus(); } } void countSlip::sCountTagList() { ParameterList params; params.append("cnttag_id", _cnttagid); params.append("tagType", cUnpostedCounts); countTagList newdlg(this, "", TRUE); newdlg.set(params); _cnttagid = newdlg.exec(); populateTagInfo(); } void countSlip::populate() { XSqlQuery r; r.prepare( "SELECT cntslip_cnttag_id, invcnt_tagnumber, invcnt_itemsite_id," " cntslip_number, cntslip_comments," " cntslip_location_id, cntslip_lotserial," " cntslip_lotserial_expiration," " cntslip_lotserial_warrpurc," " cntslip_qty " "FROM cntslip, invcnt " "WHERE ( (cntslip_cnttag_id=invcnt_id)" " AND (cntslip_id=:cntslip_id) );" ); r.bindValue(":cntslip_id", _cntslipid); r.exec(); if (r.first()) { _cnttagid = r.value("cntslip_cnttag_id").toInt(); _countTagNumber->setText(r.value("invcnt_tagnumber").toString()); _number->setText(r.value("cntslip_number").toString()); _qty->setDouble(r.value("cntslip_qty").toDouble()); _comments->setText(r.value("cntslip_comments").toString()); _lotSerial->setText(r.value("cntslip_lotserial").toString()); if(r.value("cntslip_lotserial_expiration").toString().isEmpty()) _expiration->clear(); else _expiration->setDate(r.value("cntslip_lotserial_expiration").toDate()); if(r.value("cntslip_lotserial_warrpurc").toString().isEmpty()) _warranty->clear(); else _warranty->setDate(r.value("cntslip_lotserial_warrpurc").toDate()); _item->setItemsiteid(r.value("invcnt_itemsite_id").toInt()); _location->setId(r.value("cntslip_location_id").toInt()); } } void countSlip::sPopulateItemSiteInfo() { XSqlQuery countPopulateItemSiteInfo; countPopulateItemSiteInfo.prepare( "SELECT itemsite_loccntrl, itemsite_controlmethod, itemsite_location_id, " " itemsite_perishable, itemsite_warrpurc " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); countPopulateItemSiteInfo.bindValue(":item_id", _item->id()); countPopulateItemSiteInfo.bindValue(":warehous_id", _warehouse->id()); countPopulateItemSiteInfo.exec(); if (countPopulateItemSiteInfo.first()) { QString controlMethod(countPopulateItemSiteInfo.value("itemsite_controlmethod").toString()); _expiration->setEnabled(countPopulateItemSiteInfo.value("itemsite_perishable").toBool()); _warranty->setEnabled(countPopulateItemSiteInfo.value("itemsite_warrpurc").toBool()); if (countPopulateItemSiteInfo.value("itemsite_loccntrl").toBool()) { XSqlQuery location; location.prepare( "SELECT location_id, formatLocationName(location_id) AS locationname " "FROM location, itemsite " "WHERE ( (validLocation(location_id, itemsite_id))" " AND (itemsite_warehous_id=:warehous_id)" " AND (itemsite_item_id=:item_id) ) " "ORDER BY locationname;" ); location.bindValue(":warehous_id", _warehouse->id()); location.bindValue(":item_id", _item->id()); location.exec(); _location->populate(location); _location->setId(countPopulateItemSiteInfo.value("itemsite_location_id").toInt()); _location->setEnabled(TRUE); } else { _location->clear(); _location->setEnabled(FALSE); } if (controlMethod == "L") { _lotSerial->setEnabled(TRUE); _qty->setEnabled(TRUE); } else if (controlMethod == "S") { _lotSerial->setEnabled(TRUE); _qty->setText("1.0"); _qty->setEnabled(FALSE); } else { _lotSerial->setEnabled(FALSE); _qty->setEnabled(TRUE); } } } void countSlip::populateTagInfo() { XSqlQuery countpopulateTagInfo; countpopulateTagInfo.prepare( "SELECT invcnt_tagnumber, invcnt_itemsite_id," " COALESCE(invcnt_location_id, -1) AS location " "FROM invcnt " "WHERE (invcnt_id=:cnttag_id);" ); countpopulateTagInfo.bindValue(":cnttag_id", _cnttagid); countpopulateTagInfo.exec(); if (countpopulateTagInfo.first()) { int locationid = countpopulateTagInfo.value("location").toInt(); _countTagNumber->setText(countpopulateTagInfo.value("invcnt_tagnumber").toString()); _item->setItemsiteid(countpopulateTagInfo.value("invcnt_itemsite_id").toInt()); if(locationid != -1) { _location->setId(locationid); _location->setEnabled(false); } } } qt-client-4.1.0/guiclient/countSlip.h000066400000000000000000000023261217451700100175310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COUNTSLIP_H #define COUNTSLIP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_countSlip.h" class countSlip : public XDialog, public Ui::countSlip { Q_OBJECT public: countSlip(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~countSlip(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCatchCounttagid( int pCnttagid ); virtual void sSave(); virtual void sCountTagList(); virtual void populate(); virtual void sPopulateItemSiteInfo(); virtual void populateTagInfo(); protected slots: virtual void languageChange(); private: int _mode; int _cntslipid; int _cnttagid; bool _captive; }; #endif // COUNTSLIP_H qt-client-4.1.0/guiclient/countSlip.ui000066400000000000000000000424201217451700100177160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. countSlip 0 0 468 463 Count Slip 7 5 5 Count &Tag #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _countTagList false ... Qt::Horizontal QSizePolicy::Preferred 20 20 Qt::StrongFocus 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 &Cancel false &Save true Qt::Vertical QSizePolicy::Expanding 20 0 0 7 5 0 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Counted Qty. TD: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty 0 0 false Qt::Horizontal QSizePolicy::Preferred 20 20 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Slip #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Slip &Qty: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty 0 100 32767 Qt::AlignLeading 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 20 Location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Lot/Serial #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 0 Qt::AlignLeading Lot Expiration: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 30 16 Warranty Expiration: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 30 16 Qt::Horizontal 40 20 0 1 QFrame::NoFrame QFrame::Plain 0 0 0 0 0 0 0 0 20 Co&mments: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _comments DLineEdit XLineEdit
datecluster.h
ItemCluster QWidget
itemcluster.h
WComboBox XComboBox
wcombobox.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
XTextEdit QTextEdit
xtextedit.h
_countTagNumber _countTagList _item _warehouse _number _qty _location _lotSerial _expiration _warranty _comments _close _save _close clicked() countSlip reject() 20 20 20 20 _item valid(bool) _save setEnabled(bool) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
qt-client-4.1.0/guiclient/countTag.cpp000066400000000000000000000260101217451700100176640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "countTag.h" #include #include #include #include #include #include "inputManager.h" #include "countTagList.h" countTag::countTag(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_countTagList, SIGNAL(clicked()), this, SLOT(sCountTagList())); connect(_enter, SIGNAL(clicked()), this, SLOT(sEnter())); connect(_countTagNumber, SIGNAL(editingFinished()), this, SLOT(sParseCountTagNumber())); _item->setReadOnly(TRUE); #ifndef Q_WS_MAC _countTagList->setMaximumWidth(25); #endif _qty->setValidator(omfgThis->qtyVal()); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } countTag::~countTag() { // no need to delete child widgets, Qt does it all for us } void countTag::languageChange() { retranslateUi(this); } enum SetResponse countTag::set(const ParameterList &pParams) { XSqlQuery countet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cnttag_id", &valid); if (valid) { _captive = TRUE; _cnttagid = param.toInt(); populate(); _countTagNumber->setEnabled(FALSE); _countTagList->hide(); } param = pParams.value("invhist_id", &valid); if (valid) { _captive = TRUE; countet.prepare( "SELECT invcnt_id " "FROM invcnt " "WHERE (invcnt_invhist_id=:invhist_id);" ); countet.bindValue(":invhist_id", param.toInt()); countet.exec(); if (countet.first()) { _cnttagid = countet.value("invcnt_id").toInt(); populate(); } // ToDo } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "edit" || param.toString() == "new") { _mode = cEdit; omfgThis->inputManager()->notify(cBCCountTag, this, this, SLOT(sCatchCounttagid(int))); _thaw->hide(); if(param.toString() == "edit") _countTagNumber->setEnabled(false); } else if (param.toString() == "post") { _mode = cPost; _captive = TRUE; setWindowTitle("Post Count Tag"); _countTagNumber->setEnabled(false); _qty->setEnabled(false); _enter->setText(tr("&Post Count")); } else if (param.toString() == "view") { _mode = cView; setWindowTitle("Count Tag"); _qty->setEnabled(FALSE); _thaw->hide(); _newComments->setEnabled(FALSE); _enter->hide(); _close->setText(tr("&Close")); _close->setFocus(); } } return NoError; } void countTag::sCatchCounttagid(int pCnttagid) { _cnttagid = pCnttagid; populate(); _qty->setFocus(); } void countTag::sEnter() { XSqlQuery countEnter; if (_mode == cEdit) { countEnter.prepare("SELECT enterCount(:cnttagid, :qty, :comments);"); countEnter.bindValue(":cnttagid", _cnttagid); countEnter.bindValue(":qty", _qty->toDouble()); countEnter.bindValue(":comments", _newComments->toPlainText()); countEnter.exec(); if (countEnter.lastError().type() != QSqlError::NoError) { systemError(this, countEnter.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (_mode == cPost) { // Make sure that there aren't any unposted Slips for this Tag countEnter.prepare( "SELECT cntslip_id " "FROM cntslip " "WHERE ( (NOT cntslip_posted)" " AND (cntslip_cnttag_id=:cnttag_id) ) " "LIMIT 1;" ); countEnter.bindValue(":cnttag_id", _cnttagid); countEnter.exec(); if (countEnter.first()) { QMessageBox::critical( this, tr("Cannot Post Count Tag"), tr( "There are unposted Count Slips for this Count Tag.\n" "You must either post or delete unposted Count Slips for this Count Tag before you may post this Tag." ) ); return; } else if (countEnter.lastError().type() != QSqlError::NoError) { systemError(this, countEnter.lastError().databaseText(), __FILE__, __LINE__); return; } countEnter.prepare("SELECT postCountTag(:cnttag_id, :thaw) AS result;"); countEnter.bindValue(":cnttag_id", _cnttagid); countEnter.bindValue(":thaw", QVariant(_thaw->isChecked())); countEnter.exec(); if (countEnter.first()) { switch (countEnter.value("result").toInt()) { case -1: QMessageBox::critical(this, tr("Cannot Post Count Tag"), tr("The total quantity indicated by posted " "Count Slips for this Count Tag is greater " "than the quantity entered for this Count " "Tag. Please verify the Count Tag quantity " "and attempt to post this Count Tag again.") ); return; case -2: QMessageBox::critical( this, tr("Cannot Post Count Tag"), tr( "This Item Site is Lot/Serial # controlled, which means the\n" "Count Tag Qty. must match the Qty. of Count Slips posted to it.\n" "\n" "Please verify the Count Tag Qty. and attempt to post again." ) ); return; case -3: QMessageBox::critical( this, tr("Cannot Post Count Tag"), tr( "Either total quantity indicated by posted Count Slips for this Count Tag\n" "is less than the quantity entered for this Count Tag or there are no Count\n" "Slips posted to this Count Tag. The Item Site in question does not have a\n" "default Location into which the remaining quantity may be distributed.\n" "Please verify the Count Tag quantity and attempt to post this Count Tag again." ) ); return; case -4: QMessageBox::critical( this, tr("Cannot Post Count Tag"), tr( "Either total quantity indicated by posted Count Slips for this Count Tag\n" "is less than the quantity entered for this Count Tag or there are no Count\n" "Slips posted to this Count Tag. This database has been configured to disallow\n" "default Count Tag posting into the default Location for an Item Site.\n" "Please verify the Count Tag quantity and attempt to post this Count Tag again." ) ); return; case 0: break; default: QMessageBox::critical( this, tr("Cannot Post Count Tag"), tr( "An unknown error occurred while posting this Count Tag.\n" "Please contact your Systems Administrator and report this issue." ) ); break; } } else if (countEnter.lastError().type() != QSqlError::NoError) { systemError(this, countEnter.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_captive) accept(); else clear(); } void countTag::sCountTagList() { ParameterList params; params.append("cnttag_id", _cnttagid); params.append("tagType", cUnpostedCounts); countTagList newdlg(this, "", TRUE); newdlg.set(params); _cnttagid = newdlg.exec(); populate(); _qty->setFocus(); } void countTag::sParseCountTagNumber() { XSqlQuery countParseCountTagNumber; QString sql( "SELECT invcnt_id " "FROM invcnt " "JOIN itemsite ON (invcnt_itemsite_id=itemsite_id) " "JOIN site() ON (itemsite_warehous_id=warehous_id) " "WHERE ( (NOT invcnt_posted)" " AND (UPPER(invcnt_tagnumber)=UPPER()) );" ); ParameterList ctp; ctp.append("cnttag_tagnumber", _countTagNumber->text().trimmed()); MetaSQLQuery ctq(sql); countParseCountTagNumber = ctq.toQuery(ctp); if (countParseCountTagNumber.first()) { _cnttagid = countParseCountTagNumber.value("invcnt_id").toInt(); populate(); } else if (countParseCountTagNumber.lastError().type() != QSqlError::NoError) { systemError(this, countParseCountTagNumber.lastError().databaseText(), __FILE__, __LINE__); return; } else clear(); } void countTag::populate() { XSqlQuery countpopulate; countpopulate.prepare( "SELECT invcnt_tagnumber, invcnt_itemsite_id," " invcnt_comments, itemsite_freeze," " warehous_useslips," " invcnt_qoh_after," " COALESCE( (SELECT CASE WHEN (LENGTH(location_descrip) > 0) THEN (formatLocationName(location_id) || '-' || location_descrip)" " ELSE formatLocationName(location_id)" " END " " FROM location" " WHERE (location_id=invcnt_location_id)), :na) AS f_location " "FROM invcnt, itemsite, whsinfo " "WHERE ( (invcnt_itemsite_id=itemsite_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (invcnt_id=:cnttag_id) );" ); countpopulate.bindValue(":cnttag_id", _cnttagid); countpopulate.bindValue(":na", tr("N/A")); countpopulate.exec(); if (countpopulate.first()) { if ((_mode == cView) && (countpopulate.value("invcnt_tagnumber").toString() == "") ) _countTagNumber->setText("Misc."); else _countTagNumber->setText(countpopulate.value("invcnt_tagnumber").toString()); _item->setItemsiteid(countpopulate.value("invcnt_itemsite_id").toInt()); _qty->setDouble(countpopulate.value("invcnt_qoh_after").toDouble()); _qty->setEnabled(!countpopulate.value("warehous_useslips").toBool()); _thaw->setChecked(countpopulate.value("itemsite_freeze").toBool()); _currentComments->setText(countpopulate.value("invcnt_comments").toString()); _location->setText(countpopulate.value("f_location").toString()); } else if (countpopulate.lastError().type() != QSqlError::NoError) { systemError(this, countpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } else clear(); } void countTag::clear() { _cnttagid = -1; _countTagNumber->clear(); _item->setItemsiteid(-1); _qty->clear(); _thaw->setChecked(FALSE); _currentComments->clear(); _newComments->clear(); _countTagNumber->setFocus(); _location->setText(tr("N/A")); } qt-client-4.1.0/guiclient/countTag.h000066400000000000000000000022571217451700100173400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COUNTTAG_H #define COUNTTAG_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_countTag.h" class countTag : public XDialog, public Ui::countTag { Q_OBJECT public: countTag(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~countTag(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCatchCounttagid( int pCnttagid ); virtual void sEnter(); virtual void sCountTagList(); virtual void sParseCountTagNumber(); virtual void populate(); virtual void clear(); protected slots: virtual void languageChange(); private: int _mode; int _cnttagid; bool _captive; }; #endif // COUNTTAG_H qt-client-4.1.0/guiclient/countTag.ui000066400000000000000000000340771217451700100175330ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. countTag 0 0 401 431 Count Tag 9 6 0 6 0 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 Count &Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _qty Qt::Vertical 20 40 0 6 0 6 false Qt::Horizontal 40 0 0 0 100 32767 Qt::AlignRight Qt::Vertical 100 16 Qt::Horizontal QSizePolicy::Preferred 20 20 0 0 0 0 Thaw Inventory Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Preferred 20 20 0 0 New Co&mments: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _newComments 0 0 Current Comments: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true true 0 5 Only for Specific Location: 7 5 0 0 N/A 0 5 0 5 0 5 Count &Tag #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _countTagList true Qt::NoFocus ... Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel false &Save true Qt::Vertical QSizePolicy::Preferred 20 20 XLineEdit QLineEdit
xlineedit.h
ItemCluster QWidget
itemcluster.h
WComboBox XComboBox
wcombobox.h
_countTagNumber _item _warehouse _qty _thaw _currentComments _newComments _enter _close _close clicked() countTag reject() 20 20 20 20 _item valid(bool) _enter setEnabled(bool) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
qt-client-4.1.0/guiclient/countTagList.cpp000066400000000000000000000063501217451700100205250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "countTagList.h" #include #include countTagList::countTagList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); _cnttag->addColumn(tr("Tag #"), _orderColumn, Qt::AlignLeft, true, "invcnt_tagnumber"); _cnttag->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); _cnttag->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip1"); _cnttag->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); } countTagList::~countTagList() { // no need to delete child widgets, Qt does it all for us } void countTagList::languageChange() { retranslateUi(this); } enum SetResponse countTagList::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cnttag_id", &valid); if (valid) _cnttagid = param.toInt(); param = pParams.value("tagType", &valid); if (valid) _type = param.toInt(); sFillList(); return NoError; } void countTagList::sFillList() { XSqlQuery countFillList; QString sql( "SELECT invcnt_id, invcnt_tagnumber, item_number, item_descrip1, warehous_code " "FROM invcnt, itemsite, item, whsinfo " "WHERE ((invcnt_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" ); if (_warehouse->isSelected()) sql += " AND (warehous_id=:warehous_id)"; if (_type & cPostedCounts) sql += " AND (invcnt_posted)"; else if (_type & cUnpostedCounts) sql += " AND (NOT invcnt_posted)"; sql += ") " "ORDER BY invcnt_tagnumber"; countFillList.prepare(sql); _warehouse->bindValue(countFillList); countFillList.exec(); _cnttag->populate(countFillList, _cnttagid); if (countFillList.lastError().type() != QSqlError::NoError) { systemError(this, countFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void countTagList::sClose() { done(_cnttagid); } void countTagList::sSelect() { done(_cnttag->id()); } void countTagList::sSearch(const QString &pTarget) { _cnttag->clearSelection(); int i; for (i = 0; i < _cnttag->topLevelItemCount(); i++) { if (_cnttag->topLevelItem(i)->text(1).contains(pTarget, Qt::CaseInsensitive)) break; } if (i < _cnttag->topLevelItemCount()) { _cnttag->setCurrentItem(_cnttag->topLevelItem(i)); _cnttag->scrollToItem(_cnttag->topLevelItem(i)); } } qt-client-4.1.0/guiclient/countTagList.h000066400000000000000000000021661217451700100201730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COUNTTAGLIST_H #define COUNTTAGLIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_countTagList.h" class countTagList : public XDialog, public Ui::countTagList { Q_OBJECT public: countTagList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~countTagList(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sFillList(); virtual void sSearch( const QString & pTarget ); protected slots: virtual void languageChange(); virtual void sClose(); virtual void sSelect(); private: int _cnttagid; int _type; }; #endif // COUNTTAGLIST_H qt-client-4.1.0/guiclient/countTagList.ui000066400000000000000000000165401217451700100203620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. countTagList 0 0 800 600 Count Tag List 12 12 7 5 0 false Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Cancel false &Select true Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Count Tags: 5 S&earch for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _searchFor Qt::Horizontal 40 20 WarehouseGroup QGroupBox
warehousegroup.h
XLineEdit QLineEdit
xlineedit.h
XTreeWidget QTreeWidget
xtreewidget.h
_searchFor _warehouse _cnttag _select _close parameter.h _cnttag valid(bool) _select setEnabled(bool) 20 20 20 20 _cnttag itemSelected(int) _select animateClick() 20 20 20 20
qt-client-4.1.0/guiclient/countries.cpp000066400000000000000000000112171217451700100201160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "countries.h" #include #include #include #include #include #include #include "country.h" countries::countries(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_countries, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); if (_privileges->check("MaintainCountries")) { connect(_countries, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_countries, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_countries, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_countries, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _countries->addColumn( tr("Abbreviation"), 50, Qt::AlignCenter,true, "country_abbr"); _countries->addColumn( tr("Name"), -1, Qt::AlignLeft, true, "country_name"); _countries->addColumn( tr("Currency Abbr"),100, Qt::AlignCenter,true, "country_curr_abbr"); _countries->addColumn( tr("Currency Name"),100, Qt::AlignLeft, true, "country_curr_name"); _countries->addColumn( tr("Symbol"), 50, Qt::AlignLeft, true, "country_curr_symbol"); sFillList(); } countries::~countries() { // no need to delete child widgets, Qt does it all for us } void countries::languageChange() { retranslateUi(this); } void countries::sNew() { ParameterList params; params.append("mode", "new"); country *newdlg = new country(this, "", TRUE); newdlg->set(params); newdlg->exec(); sFillList(); } void countries::sEdit() { ParameterList params; params.append("country_id", _countries->id()); params.append("mode", "edit"); country *newdlg = new country(this, "", TRUE); newdlg->set(params); newdlg->exec(); sFillList(); } void countries::sView() { ParameterList params; params.append("country_id", _countries->id()); params.append("mode", "view"); country *newdlg = new country(this, "", TRUE); newdlg->set(params); newdlg->exec(); } void countries::sDelete() { XSqlQuery countriesDelete; int answer = QMessageBox::question(this, tr("Confirm Delete"), tr("

This is a master table used for " "selecting country names for Addresses " "and default currency symbols for the " "Currency window. Are you sure you " "want to delete this country and its " "associated information?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (QMessageBox::Yes == answer) { countriesDelete.prepare("DELETE FROM country WHERE country_id = :country_id;"); countriesDelete.bindValue(":country_id", _countries->id()); countriesDelete.exec(); if (countriesDelete.lastError().type() != QSqlError::NoError) systemError(this, countriesDelete.lastError().databaseText(), __FILE__, __LINE__); sFillList(); } } void countries::sFillList() { XSqlQuery countriesFillList; countriesFillList.prepare( "SELECT country_id, country_abbr, country_name," " country_curr_abbr, country_curr_name, " " country_curr_symbol " "FROM country " "ORDER BY country_name;" ); countriesFillList.exec(); _countries->populate(countriesFillList); if (countriesFillList.lastError().type() != QSqlError::NoError) { systemError(this, countriesFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void countries::sPopulateMenu(QMenu* pMenu) { QAction *menuItem; pMenu->addAction("View...", this, SLOT(sView())); menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCountries")); menuItem = pMenu->addAction("Delete...", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainCountries")); } qt-client-4.1.0/guiclient/countries.h000066400000000000000000000017721217451700100175700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COUNTRIES_H #define COUNTRIES_H #include "guiclient.h" #include "xwidget.h" #include "ui_countries.h" class countries : public XWidget, public Ui::countries { Q_OBJECT public: countries(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~countries(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * pMenu ); protected slots: virtual void languageChange(); }; #endif // COUNTRIES_H qt-client-4.1.0/guiclient/countries.ui000066400000000000000000000105261217451700100177530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. countries 0 0 600 400 List Countries 0 Countries: &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

xtreewidget.h
1 _countries _close _new _edit _view _delete _close clicked() countries close() 20 20 20 20 _countries valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/country.cpp000066400000000000000000000127561217451700100176170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "country.h" #include #include #include #include #include country::country(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_abbr, SIGNAL(editingFinished()), this, SLOT(sToUpper())); connect(_currAbbr, SIGNAL(editingFinished()), this, SLOT(sToUpper())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); _currNumber->setValidator(new QRegExpValidator(QRegExp("[0-9][0-9][0-9]"), this)); } country::~country() { // no need to delete child widgets, Qt does it all for us } void country::languageChange() { retranslateUi(this); } enum SetResponse country::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("country_id", &valid); if (valid) { _countryId = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(false); _abbr->setEnabled(false); _currAbbr->setEnabled(false); _currName->setEnabled(false); _currSymbol->setEnabled(false); _currNumber->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void country::sSave() { XSqlQuery countrySave; sToUpper(); struct { bool condition; QString msg; QWidget* widget; } error[] = { { _name->text().isEmpty(), tr("Country name is required."), _name }, { _abbr->text().isEmpty(), tr("Country abbreviation is required."), _abbr }, { _abbr->text().length() != 2, tr("Country abbreviation must be 2 " "characters long."), _abbr }, { _currAbbr->text().length() != 3, tr("Currency abbreviations must be " "3 characters long."), _currAbbr}, { ! _currNumber->text().isEmpty() && _currNumber->text().length() != 3, tr("Currency numbers must be 3 digits long."), _currNumber }, { true, "", NULL } }; // error[] int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot save Country"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } if (_mode == cNew) { countrySave.prepare( "INSERT INTO country (" " country_abbr, country_name, country_curr_abbr, " " country_curr_name, country_curr_number, country_curr_symbol " ") VALUES (" " :country_abbr, :country_name, :country_curr_abbr, " " :country_curr_name, :country_curr_number, :country_curr_symbol " ");" ); } else if (_mode == cEdit) { countrySave.prepare( "UPDATE country SET " " country_abbr=:country_abbr, country_name=:country_name, " " country_curr_abbr=:country_curr_abbr, " " country_curr_name=:country_curr_name, " " country_curr_number=:country_curr_number, " " country_curr_symbol=:country_curr_symbol " "WHERE (country_id=:country_id);" ); countrySave.bindValue(":country_id", _countryId); } countrySave.bindValue(":country_abbr", _abbr->text()); countrySave.bindValue(":country_name", _name->text()); countrySave.bindValue(":country_curr_abbr", _currAbbr->text()); countrySave.bindValue(":country_curr_name", _currName->text()); countrySave.bindValue(":country_curr_number", _currNumber->text()); countrySave.bindValue(":country_curr_symbol", _currSymbol->text()); countrySave.exec(); if (countrySave.lastError().type() != QSqlError::NoError) { systemError(this, countrySave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_countryId); } void country::populate() { XSqlQuery countrypopulate; countrypopulate.prepare( "SELECT country_abbr, country_name, country_curr_abbr, " " country_curr_name, country_curr_number, country_curr_symbol " "FROM country " "WHERE (country_id=:country_id);" ); countrypopulate.bindValue(":country_id", _countryId); countrypopulate.exec(); if (countrypopulate.first()) { _abbr->setText(countrypopulate.value("country_abbr").toString()); _name->setText(countrypopulate.value("country_name").toString()); _currAbbr->setText(countrypopulate.value("country_curr_abbr").toString()); _currName->setText(countrypopulate.value("country_curr_name").toString()); _currNumber->setText(countrypopulate.value("country_curr_number").toString()); _currSymbol->setText(countrypopulate.value("country_curr_symbol").toString()); } else if (countrypopulate.lastError().type() != QSqlError::NoError) { systemError(this, countrypopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void country::sToUpper() { _abbr->setText(_abbr->text().toUpper()); _currAbbr->setText(_currAbbr->text().toUpper()); } qt-client-4.1.0/guiclient/country.h000066400000000000000000000020421217451700100172470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef COUNTRY_H #define COUNTRY_H #include "guiclient.h" #include "xdialog.h" #include "parameter.h" #include "ui_country.h" class country : public XDialog, public Ui::country { Q_OBJECT public: country(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~country(); virtual SetResponse set(const ParameterList & pParams ); public slots: virtual void populate(); virtual void sSave(); virtual void sToUpper(); protected slots: virtual void languageChange(); private: int _mode; int _countryId; private slots: }; #endif // COUNTRY qt-client-4.1.0/guiclient/country.ui000066400000000000000000000170321217451700100174420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. country 0 0 442 195 400 130 Country 0 5 5 Qt::Horizontal QSizePolicy::Expanding 20 10 Country Abbreviation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 Qt::Horizontal QSizePolicy::Expanding 20 10 Qt::Horizontal 20 10 Currency Symbol: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Currency Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Country Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Currency Abbreviation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Currency Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 20 10 Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save _name _abbr _currName _currSymbol _currAbbr _currNumber _buttonBox rejected() country reject() 395 99 220 97 qt-client-4.1.0/guiclient/createCountTagsByItem.cpp000066400000000000000000000115041217451700100223070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createCountTagsByItem.h" #include #include #include createCountTagsByItem::createCountTagsByItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_create, SIGNAL(clicked()), this, SLOT(sCreate())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateLocations())); _freeze->setEnabled(_privileges->check("FreezeInventory")); _item->setType(ItemLineEdit::cPurchased | ItemLineEdit::cManufactured | ItemLineEdit::cBreeder | ItemLineEdit::cCoProduct | ItemLineEdit::cByProduct | ItemLineEdit::cCosting | ItemLineEdit::cTooling | ItemLineEdit::cOutsideProcess | ItemLineEdit::cActive); _captive = FALSE; if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } sPopulateLocations(); } createCountTagsByItem::~createCountTagsByItem() { // no need to delete child widgets, Qt does it all for us } void createCountTagsByItem::languageChange() { retranslateUi(this); } enum SetResponse createCountTagsByItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); } return NoError; } void createCountTagsByItem::sCreate() { XSqlQuery createCreate; int invcnt_id = 0; createCreate.prepare( "SELECT createCountTag(itemsite_id, :comments, :priority," " :freeze, :location_id) AS invcnt_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); createCreate.bindValue(":comments", _comments->toPlainText()); createCreate.bindValue(":priority", QVariant(_priority->isChecked())); createCreate.bindValue(":freeze", QVariant(_freeze->isChecked())); createCreate.bindValue(":item_id", _item->id()); createCreate.bindValue(":warehous_id", _warehouse->id()); if(_byLocation->isChecked()) createCreate.bindValue(":location_id", _location->id()); createCreate.exec(); if (createCreate.first()) { invcnt_id = createCreate.value("invcnt_id").toInt(); if (invcnt_id == 0) QMessageBox::information(this, tr("No Count Tags Created"), tr("No Count Tags were created. Likely causes " "are the Item Site has Control Method: None " "or the Item is not a countable Type.")); } if (createCreate.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("Error Creating Count Tags"), createCreate.lastError().text()); if (_captive) done(invcnt_id); else { _item->setId(-1); _comments->clear(); _item->setFocus(); } } void createCountTagsByItem::sPopulateLocations() { XSqlQuery createPopulateLocations; createPopulateLocations.prepare("SELECT itemsite_loccntrl" " FROM itemsite" " WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id));"); createPopulateLocations.bindValue(":item_id", _item->id()); createPopulateLocations.bindValue(":warehous_id", _warehouse->id()); createPopulateLocations.exec(); if(createPopulateLocations.first() && createPopulateLocations.value("itemsite_loccntrl").toBool()) { createPopulateLocations.prepare( "SELECT location_id," " formatLocationName(location_id) AS locationname" " FROM location, itemsite" " WHERE ((validLocation(location_id, itemsite_id))" " AND (itemsite_warehous_id=:warehous_id)" " AND (itemsite_item_id=:item_id)) " " ORDER BY locationname;"); createPopulateLocations.bindValue(":item_id", _item->id()); createPopulateLocations.bindValue(":warehous_id", _warehouse->id()); createPopulateLocations.exec(); _location->populate(createPopulateLocations); _byLocation->setEnabled(true); } else { _location->clear(); _byLocation->setChecked(false); _location->setEnabled(false); _byLocation->setEnabled(false); } } qt-client-4.1.0/guiclient/createCountTagsByItem.h000066400000000000000000000021451217451700100217550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATECOUNTTAGSBYITEM_H #define CREATECOUNTTAGSBYITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_createCountTagsByItem.h" class createCountTagsByItem : public XDialog, public Ui::createCountTagsByItem { Q_OBJECT public: createCountTagsByItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createCountTagsByItem(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCreate(); protected slots: virtual void languageChange(); virtual void sPopulateLocations(); private: bool _captive; }; #endif // CREATECOUNTTAGSBYITEM_H qt-client-4.1.0/guiclient/createCountTagsByItem.ui000066400000000000000000000312621217451700100221450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createCountTagsByItem 0 0 468 339 Create Count Tag by Item/Site 0 0 0 20 20 Expanding Horizontal 0 0 0 &Close false Create &Tag true 20 4 Fixed Vertical 0 0 0 0 Site: Qt::AlignVCenter|Qt::AlignRight 20 0 Preferred Vertical 0 0 0 0 Mark Created Count Tag as Priority true 20 20 Expanding Horizontal 0 0 Free&ze Inventory 20 20 Expanding Horizontal 0 Only for Specified Location: 0 0 false 51 20 MinimumExpanding Horizontal 0 0 Comments: WComboBox QComboBox
wcombobox.h
0
XComboBox QComboBox
xcombobox.h
0
XTextEdit QTextEdit
xtextedit.h
_item _warehouse _priority _freeze _byLocation _location _comments _create _close parameter.h _close clicked() createCountTagsByItem reject() _item valid(bool) _create setEnabled(bool) _item warehouseIdChanged(int) _warehouse setId(int) _item newId(int) _warehouse findItemsites(int) _byLocation toggled(bool) _location setEnabled(bool)
qt-client-4.1.0/guiclient/createCountTagsByParameterList.cpp000066400000000000000000000101321217451700100241610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createCountTagsByParameterList.h" #include #include #include #include #include "mqlutil.h" createCountTagsByParameterList::createCountTagsByParameterList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_create, SIGNAL(clicked()), this, SLOT(sCreate())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateLocations())); connect(_byLocation, SIGNAL(toggled(bool)), _location, SLOT(setEnabled(bool))); _parameter->setType(ParameterGroup::ClassCode); _freeze->setEnabled(_privileges->check("FreezeInventory")); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } if (_preferences->boolean("XCheckBox/forgetful")) _priority->setChecked(true); sPopulateLocations(); } createCountTagsByParameterList::~createCountTagsByParameterList() { // no need to delete child widgets, Qt does it all for us } void createCountTagsByParameterList::languageChange() { retranslateUi(this); } enum SetResponse createCountTagsByParameterList::set(const ParameterList & pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("classcode", &valid); if (valid) _parameter->setType(ParameterGroup::ClassCode); param = pParams.value("plancode", &valid); if (valid) _parameter->setType(ParameterGroup::PlannerCode); switch (_parameter->type()) { case ParameterGroup::ClassCode: setWindowTitle(tr("Create Count Tags by Class Code")); break; case ParameterGroup::PlannerCode: setWindowTitle(tr("Create Count Tags by Planner Code")); break; default: break; } return NoError; } void createCountTagsByParameterList::sCreate() { ParameterList params; _parameter->appendValue(params); params.append("comments", _comments->toPlainText()); params.append("priority", QVariant(_priority->isChecked())); params.append("freeze", QVariant(_freeze->isChecked())); params.append("warehous_id", _warehouse->id()); if(_byLocation->isChecked()) params.append("location_id", _location->id()); if(_ignoreZeroBalance->isChecked()) params.append("ignoreZeroBalance"); XSqlQuery createq; MetaSQLQuery mql = mqlLoad("countTags", "create"); createq = mql.toQuery(params); int count = 0; while (createq.next()) { if (createq.value(0).toInt() > 0) count++; } if (createq.lastError().type() != QSqlError::NoError) { systemError(this, createq.lastError().databaseText(), __FILE__, __LINE__); return; } if (count <= 0) QMessageBox::information( this, tr("No Count Tags Created"), tr("

No Count Tags were created. Either no " "Item Sites matched the criteria, the matching " "Item Sites all have Control Method: None, " "or the Items are not countable Items.")); accept(); } void createCountTagsByParameterList::sPopulateLocations() { XSqlQuery createPopulateLocations; createPopulateLocations.prepare( "SELECT location_id, " " CASE WHEN (LENGTH(location_descrip) > 0) THEN (formatLocationName(location_id) || '-' || location_descrip)" " ELSE formatLocationName(location_id)" " END AS locationname " "FROM location " "WHERE (location_warehous_id=:warehous_id) " "ORDER BY locationname;" ); createPopulateLocations.bindValue(":warehous_id", _warehouse->id()); createPopulateLocations.exec(); _location->populate(createPopulateLocations); } qt-client-4.1.0/guiclient/createCountTagsByParameterList.h000066400000000000000000000022231217451700100236300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATECOUNTTAGSBYPARAMETERLIST_H #define CREATECOUNTTAGSBYPARAMETERLIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_createCountTagsByParameterList.h" class createCountTagsByParameterList : public XDialog, public Ui::createCountTagsByParameterList { Q_OBJECT public: createCountTagsByParameterList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createCountTagsByParameterList(); public slots: virtual void sCreate(); virtual void sPopulateLocations(); virtual enum SetResponse set( const ParameterList & pParams ); protected slots: virtual void languageChange(); }; #endif // CREATECOUNTTAGSBYPARAMETERLIST_H qt-client-4.1.0/guiclient/createCountTagsByParameterList.ui000066400000000000000000000340751217451700100240300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createCountTagsByParameterList 0 0 445 382 Create Count Tags by Parameter List/Site 12 12 false Qt::Horizontal 40 20 0 0 0 0 &Cancel true Create &Tags true true Qt::Vertical QSizePolicy::Expanding 20 16 0 1 0 Options Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 0 0 0 0 Mark Created Count Tag as Priority Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Freeze Inventory Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Ignore Zero Balance Item Sites Qt::Horizontal QSizePolicy::Expanding 20 20 Only for Specified Location true false 0 0 Qt::Horizontal QSizePolicy::MinimumExpanding 51 20 Qt::Vertical 20 0 Notes 0 1 ParameterGroup QGroupBox

parametergroup.h
WComboBox XComboBox
wcombobox.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XTextEdit QTextEdit
xtextedit.h
_parameter _warehouse _priority _freeze _ignoreZeroBalance _location _comments _create _close _close clicked() createCountTagsByParameterList reject() 20 20 20 20 qt-client-4.1.0/guiclient/createCycleCountTags.cpp000066400000000000000000000140471217451700100221620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createCycleCountTags.h" #include #include #include "storedProcErrorLookup.h" createCycleCountTags::createCycleCountTags(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _codeGroup = new QButtonGroup(this); _codeGroup->addButton(_plancode); _codeGroup->addButton(_classcode); connect(_create, SIGNAL(clicked()), this, SLOT(sCreate())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateLocations())); connect(_codeGroup, SIGNAL(buttonClicked(int)), this, SLOT(sParameterTypeChanged())); _parameter->setType(ParameterGroup::ClassCode); _freeze->setEnabled(_privileges->check("CreateReceiptTrans")); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } if (_preferences->boolean("XCheckBox/forgetful")) _priority->setChecked(true); sPopulateLocations(); } createCycleCountTags::~createCycleCountTags() { // no need to delete child widgets, Qt does it all for us } void createCycleCountTags::languageChange() { retranslateUi(this); } enum SetResponse createCycleCountTags::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("maxTags", &valid); if (valid) _maxTags->setValue(param.toInt()); _priority->setChecked(pParams.inList("priority")); _freeze->setChecked(pParams.inList("freeze")); param = pParams.value("warehous_id", &valid); if (valid) _warehouse->setId(param.toInt()); param = pParams.value("classcode_id", &valid); _parameter->setId(param.toInt()); param = pParams.value("classcode_pattern", &valid); if (valid) _parameter->setPattern(param.toString()); param = pParams.value("comments", &valid); if (valid) _comments->setText(param.toString()); if (pParams.inList("run")) sCreate(); return NoError; } void createCycleCountTags::sCreate() { XSqlQuery createCreate; QString fname; if ((_parameter->type() == ParameterGroup::ClassCode) && _parameter->isSelected()) { createCreate.prepare("SELECT createCycleCountsByWarehouseByClassCode(:warehous_id, :classcode_id, :maxTags, :comments, :priority, :freeze, :location_id, :ignore) AS result;"); fname = "createCycleCountsByWarehouseByClassCode"; } else if ((_parameter->type() == ParameterGroup::ClassCode) && _parameter->isPattern()) { createCreate.prepare("SELECT createCycleCountsByWarehouseByClassCode(:warehous_id, :classcode_pattern, :maxTags, :comments, :priority, :freeze, :location_id, :ignore) AS result;"); fname = "createCycleCountsByWarehouseByClassCode"; } else if ((_parameter->type() == ParameterGroup::PlannerCode) && _parameter->isSelected()) { createCreate.prepare("SELECT createCycleCountsByWarehouseByPlannerCode(:warehous_id, :plancode_id, :maxTags, :comments, :priority, :freeze, :location_id, :ignore) AS result;"); fname = "createCycleCountsByWarehouseByPlannerCode"; } else if ((_parameter->type() == ParameterGroup::PlannerCode) && _parameter->isPattern()) { createCreate.prepare("SELECT createCycleCountsByWarehouseByPlannerCode(:warehous_id, :plancode_pattern, :maxTags, :comments, :priority, :freeze, :location_id, :ignore) AS result;"); fname = "createCycleCountsByWarehouseByPlannerCode"; } else //if (_parameter->isAll()) { createCreate.prepare("SELECT createCycleCountsByWarehouse(:warehous_id, :maxTags, :comments, :priority, :freeze, :location_id, :ignore) AS result;"); fname = "createCycleCountsByWarehouse"; } _parameter->bindValue(createCreate); createCreate.bindValue(":warehous_id", _warehouse->id()); createCreate.bindValue(":maxTags", _maxTags->value()); createCreate.bindValue(":comments", _comments->toPlainText()); createCreate.bindValue(":priority", QVariant(_priority->isChecked())); createCreate.bindValue(":freeze", QVariant(_freeze->isChecked())); createCreate.bindValue(":ignore", QVariant(_ignoreZeroBalance->isChecked())); if(_byLocation->isChecked()) createCreate.bindValue(":location_id", _location->id()); createCreate.exec(); if (createCreate.first()) { int result = createCreate.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup(fname, result), __FILE__, __LINE__); return; } } else if (createCreate.lastError().type() != QSqlError::NoError) { systemError(this, createCreate.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void createCycleCountTags::sPopulateLocations() { XSqlQuery createPopulateLocations; createPopulateLocations.prepare( "SELECT location_id, " " CASE WHEN (LENGTH(location_descrip) > 0) THEN (formatLocationName(location_id) || '-' || location_descrip)" " ELSE formatLocationName(location_id)" " END AS locationname " "FROM location " "WHERE (location_warehous_id=:warehous_id) " "ORDER BY locationname;" ); createPopulateLocations.bindValue(":warehous_id", _warehouse->id()); createPopulateLocations.exec(); _location->populate(createPopulateLocations); if (createPopulateLocations.lastError().type() != QSqlError::NoError) { systemError(this, createPopulateLocations.lastError().databaseText(), __FILE__, __LINE__); return; } } void createCycleCountTags::sParameterTypeChanged() { if(_plancode->isChecked()) _parameter->setType(ParameterGroup::PlannerCode); else //if(_classcode->isChecked()) _parameter->setType(ParameterGroup::ClassCode); } qt-client-4.1.0/guiclient/createCycleCountTags.h000066400000000000000000000022201217451700100216150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATECYCLECOUNTTAGS_H #define CREATECYCLECOUNTTAGS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_createCycleCountTags.h" class createCycleCountTags : public XDialog, public Ui::createCycleCountTags { Q_OBJECT public: createCycleCountTags(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createCycleCountTags(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sCreate(); protected slots: virtual void languageChange(); virtual void sPopulateLocations(); virtual void sParameterTypeChanged(); private: QButtonGroup* _codeGroup; }; #endif // CREATECYCLECOUNTTAGS_H qt-client-4.1.0/guiclient/createCycleCountTags.ui000066400000000000000000000446701217451700100220220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createCycleCountTags 0 0 405 473 Create Cycle Count Tags 12 12 Item Sites in 12 Class Code true Planner Code Qt::Horizontal 40 20 false Qt::Horizontal 0 20 0 0 &Cancel true Create &Tags true true Qt::Vertical QSizePolicy::Expanding 20 0 0 1 0 Options &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::Horizontal 40 20 5 0 0 0 0 0 Mark Created Count Tag as &Priority Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Freeze Inventory Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Ignore Zero Balance Item Sites Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 5 0 Ma&ximum Number of Tags to Create: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _maxTags QAbstractSpinBox::UpDownArrows 1000 10 Qt::Horizontal QSizePolicy::Expanding 20 20 Only for Specified Location true false 0 0 Qt::Horizontal QSizePolicy::Expanding 0 17 Qt::Vertical 20 0 Notes ParameterGroup QGroupBox
parametergroup.h
WComboBox XComboBox
wcombobox.h
XCheckBox QCheckBox
xcheckbox.h
XComboBox QComboBox
xcombobox.h
XTextEdit QTextEdit
xtextedit.h
_warehouse _priority _freeze _ignoreZeroBalance _maxTags _location _create _close _close clicked() createCycleCountTags reject() 20 20 20 20
qt-client-4.1.0/guiclient/createInvoices.cpp000066400000000000000000000041461217451700100210510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createInvoices.h" #include #include #include #include #include "storedProcErrorLookup.h" createInvoices::createInvoices(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); _customerType->setType(ParameterGroup::CustomerType); } createInvoices::~createInvoices() { // no need to delete child widgets, Qt does it all for us } void createInvoices::languageChange() { retranslateUi(this); } void createInvoices::sPost() { XSqlQuery createPost; QString sql("SELECT createInvoices(custtype_id, :consolidate) AS result" " FROM custtype" ); if (_customerType->isSelected()) sql += " WHERE (custtype_id=:custtype_id)"; else if (_customerType->isPattern()) sql += " WHERE (custtype_code ~ :custtype_pattern)"; createPost.prepare(sql); _customerType->bindValue(createPost); createPost.bindValue(":consolidate", _consolidate->isChecked()); createPost.exec(); if (createPost.first()) { int result = createPost.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("createInvoices", result), __FILE__, __LINE__); return; } omfgThis->sInvoicesUpdated(-1, TRUE); omfgThis->sBillingSelectionUpdated(-1, TRUE); omfgThis->sSalesOrdersUpdated(-1); } else if (createPost.lastError().type() != QSqlError::NoError) { systemError(this, createPost.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/createInvoices.h000066400000000000000000000016171217451700100205160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATEINVOICES_H #define CREATEINVOICES_H #include "guiclient.h" #include "xdialog.h" #include "ui_createInvoices.h" class createInvoices : public XDialog, public Ui::createInvoices { Q_OBJECT public: createInvoices(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createInvoices(); public slots: virtual void sPost(); protected slots: virtual void languageChange(); }; #endif // CREATEINVOICES_H qt-client-4.1.0/guiclient/createInvoices.ui000066400000000000000000000110061217451700100206750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createInvoices 0 0 373 197 Create Invoices 12 12 0 Qt::StrongFocus false Consolidate By Customer Qt::Vertical 20 40 0 0 5 0 &Cancel &Create Invoices true Qt::Vertical QSizePolicy::Expanding 20 20 ParameterGroup QGroupBox
parametergroup.h
XCheckBox QCheckBox
xcheckbox.h
_customerType _consolidate _post _close _close clicked() createInvoices close() 20 20 20 20
qt-client-4.1.0/guiclient/createItemSitesByClassCode.cpp000066400000000000000000000445171217451700100232620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createItemSitesByClassCode.h" #include #include #include #include createItemSitesByClassCode::createItemSitesByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _locationGroupInt = new QButtonGroup(this); _locationGroupInt->addButton(_location); _locationGroupInt->addButton(_miscLocation); connect(_create, SIGNAL(clicked()), this, SLOT(sSave())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(populateLocations())); connect(_controlMethod, SIGNAL(activated(int)), this, SLOT(sHandleControlMethod())); connect(_planningType, SIGNAL(activated(int)), this, SLOT(sHandlePlanningType())); connect(_poSupply, SIGNAL(toggled(bool)), this, SLOT(sHandlePOSupply(bool))); connect(_woSupply, SIGNAL(toggled(bool)), this, SLOT(sHandleWOSupply(bool))); _planningType->append(0, "None", "N"); _mpsTimeFenceLit->hide(); _mpsTimeFence->hide(); _mpsTimeFenceDaysLit->hide(); _orderGroup->setMinimum(1); if(_metrics->value("Application") == "PostBooks") { _planningType->setCurrentIndex(0); _planningType->hide(); _planningTypeLit->hide(); _createPlannedTransfers->hide(); _orderGroupLit->hide(); _orderGroup->hide(); _orderGroupDaysLit->hide(); _orderGroupFirst->hide(); _create->setEnabled(true); } else _planningType->append(1, "MRP", "M"); if (!_metrics->boolean("MultiWhs")) _createPlannedTransfers->hide(); sHandlePlanningType(); _reorderLevel->setValidator(omfgThis->qtyVal()); _orderUpToQty->setValidator(omfgThis->qtyVal()); _minimumOrder->setValidator(omfgThis->qtyVal()); _maximumOrder->setValidator(omfgThis->qtyVal()); _orderMultiple->setValidator(omfgThis->qtyVal()); _safetyStock->setValidator(omfgThis->qtyVal()); _classCode->setType(ParameterGroup::ClassCode); _plannerCode->setAllowNull(TRUE); _plannerCode->setType(XComboBox::PlannerCodes); _costcat->setAllowNull(TRUE); _costcat->setType(XComboBox::CostCategories); _controlMethod->append(0, "None", "N"); _controlMethod->append(1, "Regular", "R"); _controlMethod->append(2, "Lot #", "L"); _controlMethod->append(3, "Serial #", "S"); _controlMethod->setCurrentIndex(-1); _reorderLevel->setDouble(0.0); _orderUpToQty->setDouble(0.0); _minimumOrder->setDouble(0.0); _maximumOrder->setDouble(0.0); _orderMultiple->setDouble(0.0); _safetyStock->setDouble(0.0); _cycleCountFreq->setValue(0); _leadTime->setValue(0); _eventFence->setValue(_metrics->value("DefaultEventFence").toInt()); // _costcat->setEnabled(_metrics->boolean("InterfaceToGL")); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); _create->setEnabled(true); } else { _warehouse->setAllowNull(TRUE); _warehouse->setNull(); } //If not lot serial control, remove options if (!_metrics->boolean("LotSerialControl")) { _controlMethod->removeItem(3); _controlMethod->removeItem(2); _autoNumberGroup->hide(); _tab->removeTab(_tab->indexOf(_expireTab)); } //If routings disabled, hide options if (!_metrics->boolean("Routings")) { _disallowBlankWIP->hide(); } _costAvg->setVisible(_metrics->boolean("AllowAvgCostMethod")); _costStd->setVisible(_metrics->boolean("AllowStdCostMethod")); adjustSize(); } createItemSitesByClassCode::~createItemSitesByClassCode() { // no need to delete child widgets, Qt does it all for us } void createItemSitesByClassCode::languageChange() { retranslateUi(this); } void createItemSitesByClassCode::sSave() { XSqlQuery createSave; if (_warehouse->id() == -1) { QMessageBox::critical( this, tr("Select a Site"), tr("

You must select a Site for this Item Site " "before creating it." ) ); _warehouse->setFocus(); return; } // if ( (_metrics->boolean("InterfaceToGL")) && (_costcat->id() == -1) ) if (_costcat->id() == -1) { QMessageBox::critical( this, tr("Cannot Create Item Sites"), tr("

You must select a Cost Category for these " "Item Sites before you may create them.") ); _costcat->setFocus(); return; } if (_plannerCode->id() == -1) { QMessageBox::critical( this, tr("Cannot Create Item Sites"), tr("

You must select a Planner Code for these " "Item Sites before you may create them.") ); _plannerCode->setFocus(); return; } if (_controlMethod->currentIndex() == -1) { QMessageBox::critical( this, tr("Cannot Create Item Sites"), tr("

You must select a Control Method for these " "Item Sites before you may create them.") ); _controlMethod->setFocus(); return; } if(!_costNone->isChecked() && !_costAvg->isChecked() && !_costStd->isChecked()) { QMessageBox::critical(this, tr("Cannot Save Item Site"), tr("

You must select a Cost Method for this " "Item Site before you may save it.") ); return; } if (_stocked->isChecked() && _reorderLevel->toDouble() == 0) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr("

You must set a reorder level " "for a stocked item before you may save it.") ); _reorderLevel->setFocus(); return; } if ( _locationControl->isChecked() ) { XSqlQuery locationid; locationid.prepare( "SELECT location_id " "FROM location " "WHERE (location_warehous_id=:warehous_id)" "LIMIT 1;" ); locationid.bindValue(":warehous_id", _warehouse->id()); locationid.exec(); if (!locationid.first()) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr( "You must first create at least one valid " "Location for this Site before items may be " "multiply located." ) ); return; } } QString sql( "INSERT INTO itemsite " "( itemsite_item_id," " itemsite_warehous_id, itemsite_qtyonhand, itemsite_value," " itemsite_useparams, itemsite_useparamsmanual," " itemsite_reorderlevel, itemsite_ordertoqty," " itemsite_minordqty, itemsite_maxordqty, itemsite_multordqty," " itemsite_safetystock, itemsite_cyclecountfreq," " itemsite_leadtime, itemsite_eventfence," " itemsite_plancode_id, itemsite_costcat_id," " itemsite_supply_itemsite_id," " itemsite_posupply, itemsite_wosupply," " itemsite_createpr, itemsite_createwo," " itemsite_sold, itemsite_soldranking," " itemsite_stocked, itemsite_disallowblankwip," " itemsite_controlmethod, itemsite_perishable, itemsite_active," " itemsite_loccntrl, itemsite_location_id, itemsite_location," " itemsite_location_comments, itemsite_notes," " itemsite_abcclass, itemsite_freeze, itemsite_datelastused," " itemsite_ordergroup, itemsite_ordergroup_first, itemsite_mps_timefence, " " itemsite_autoabcclass, itemsite_planning_type, itemsite_costmethod, " " itemsite_cosdefault, itemsite_lsseq_id ) " "SELECT item_id," " :warehous_id, 0.0, 0.0," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') THEN FALSE " " ELSE :itemsite_useparams END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') THEN FALSE " " ELSE :itemsite_useparamsmanual END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') THEN 0" " ELSE :itemsite_reorderlevel END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') THEN 0" " ELSE :itemsite_ordertoqty END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') THEN 0" " ELSE :itemsite_minordqty END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') THEN 0" " ELSE :itemsite_maxordqty END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') THEN 0" " ELSE :itemsite_multordqty END," " :itemsite_safetystock, :itemsite_cyclecountfreq," " :itemsite_leadtime, :itemsite_eventfence," " :itemsite_plancode_id, :itemsite_costcat_id," " CASE WHEN COALESCE(:supplywhsid,-1) < 0 THEN NULL " " ELSE (SELECT itemsite_id" " FROM itemsite" " WHERE ((itemsite_item_id=item_id)" " AND (itemsite_warehous_id=:supplywhsid)))" " END," " :itemsite_posupply, :itemsite_wosupply," " :itemsite_createpr, :itemsite_createwo," " :itemsite_sold, :itemsite_soldranking," " :itemsite_stocked, :itemsite_disallowblankwip," " :itemsite_controlmethod, :itemsite_perishable, TRUE," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') " " THEN FALSE " " ELSE :itemsite_loccntrl END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') " " THEN -1 " " ELSE :itemsite_location_id END," " CASE WHEN item_type IN ('B', 'F', 'R', 'L', 'K') " " THEN '' " " ELSE :itemsite_location END," " :itemsite_location_comments, ''," " :itemsite_abcclass, FALSE, startOfTime()," " :itemsite_ordergroup, :itemsite_ordergroup_first, :itemsite_mps_timefence, " " FALSE, " " CASE WHEN(item_type='L') THEN 'M' ELSE :itemsite_planning_type END, " " CASE WHEN(item_type='R') THEN 'N' ELSE :itemsite_costmethod END, " " :itemsite_cosdefault, :itemsite_lsseq_id " "FROM item " "WHERE ( (item_id NOT IN ( SELECT itemsite_item_id" " FROM itemsite" " WHERE (itemsite_warehous_id=:warehous_id) ) )" ); if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += ");"; createSave.prepare(sql); createSave.bindValue(":itemsite_reorderlevel", _reorderLevel->toDouble()); createSave.bindValue(":itemsite_ordertoqty", _orderUpToQty->toDouble()); createSave.bindValue(":itemsite_minordqty", _minimumOrder->toDouble()); createSave.bindValue(":itemsite_maxordqty", _maximumOrder->toDouble()); createSave.bindValue(":itemsite_multordqty", _orderMultiple->toDouble()); createSave.bindValue(":itemsite_safetystock", _safetyStock->toDouble()); createSave.bindValue(":itemsite_cyclecountfreq", _cycleCountFreq->value()); createSave.bindValue(":itemsite_leadtime", _leadTime->value()); createSave.bindValue(":itemsite_eventfence", _eventFence->value()); createSave.bindValue(":itemsite_plancode_id", _plannerCode->id()); createSave.bindValue(":itemsite_costcat_id", _costcat->id()); if (_createPlannedTransfers->isChecked()) createSave.bindValue(":supplywhsid", _suppliedFromSite->id()); createSave.bindValue(":itemsite_useparams", QVariant(_useParameters->isChecked())); createSave.bindValue(":itemsite_useparamsmanual", QVariant(_useParametersOnManual->isChecked())); createSave.bindValue(":itemsite_posupply", QVariant(_poSupply->isChecked())); createSave.bindValue(":itemsite_wosupply", QVariant(_woSupply->isChecked())); // createSave.bindValue(":itemsite_createpr", QVariant(_createPr->isChecked())); createSave.bindValue(":itemsite_createwo", QVariant(_createWo->isChecked())); createSave.bindValue(":itemsite_sold", QVariant(_sold->isChecked())); createSave.bindValue(":itemsite_stocked", QVariant(_stocked->isChecked())); createSave.bindValue(":itemsite_loccntrl", QVariant(_locationControl->isChecked())); createSave.bindValue(":itemsite_disallowblankwip", QVariant((_locationControl->isChecked() && _disallowBlankWIP->isChecked()))); createSave.bindValue(":itemsite_perishable", QVariant(_perishable->isChecked())); createSave.bindValue(":itemsite_soldranking", _soldRanking->value()); createSave.bindValue(":itemsite_location_comments", _locationComments->text().trimmed()); createSave.bindValue(":itemsite_abcclass", _abcClass->currentText()); createSave.bindValue(":itemsite_planning_type", _planningType->code()); createSave.bindValue(":itemsite_ordergroup", _orderGroup->value()); createSave.bindValue(":itemsite_ordergroup_first", QVariant(_orderGroupFirst->isChecked())); createSave.bindValue(":itemsite_mps_timefence", _mpsTimeFence->value()); if (_useDefaultLocation->isChecked()) { if (_location->isChecked()) { createSave.bindValue(":itemsite_location", ""); createSave.bindValue(":itemsite_location_id", _locations->id()); } else if (_miscLocation->isChecked()) { createSave.bindValue(":itemsite_location", _miscLocationName->text().trimmed()); createSave.bindValue(":itemsite_location_id", -1); } } else { createSave.bindValue(":itemsite_location", ""); createSave.bindValue(":itemsite_location_id", -1); } createSave.bindValue(":itemsite_controlmethod", _controlMethod->code()); if(_costNone->isChecked()) createSave.bindValue(":itemsite_costmethod", "N"); else if(_costAvg->isChecked()) createSave.bindValue(":itemsite_costmethod", "A"); else if(_costStd->isChecked()) createSave.bindValue(":itemsite_costmethod", "S"); if (_woCostGroup->isChecked()) { if (_todate->isChecked()) createSave.bindValue(":itemsite_cosdefault", QString("D")); else createSave.bindValue(":itemsite_cosdefault", QString("P")); } if (_sequence->isValid()) createSave.bindValue(":itemsite_lsseq_id", _sequence->id()); createSave.bindValue(":warehous_id", _warehouse->id()); _classCode->bindValue(createSave); createSave.exec(); omfgThis->sItemsitesUpdated(); accept(); } void createItemSitesByClassCode::sHandlePOSupply(bool /*pSupplied*/) { /* if (pSupplied) _createPr->setEnabled(TRUE); else { _createPr->setEnabled(FALSE); _createPr->setChecked(FALSE); } */ } void createItemSitesByClassCode::sHandleWOSupply(bool pSupplied) { if (pSupplied) _createWo->setEnabled(TRUE); else { _createWo->setEnabled(FALSE); _createWo->setChecked(FALSE); } } void createItemSitesByClassCode::sHandleControlMethod() { if (_controlMethod->currentIndex() == 0) { _costNone->setChecked(true); _costNone->setEnabled(true); _costAvg->setEnabled(false); _costStd->setEnabled(false); } else { if(_costStd->isVisibleTo(this) && !_costAvg->isChecked()) _costStd->setChecked(true); else _costAvg->setChecked(true); _costNone->setEnabled(false); _costAvg->setEnabled(true); _costStd->setEnabled(true); } if ( (_controlMethod->currentIndex() == 2) || (_controlMethod->currentIndex() == 3) ) _perishable->setEnabled(TRUE); else { _perishable->setChecked(FALSE); _perishable->setEnabled(FALSE); } } void createItemSitesByClassCode::sHandlePlanningType() { if (_planningType->code() == "M" || _planningType->code() == "S") { _createPlannedTransfers->setEnabled(TRUE); _orderGroup->setEnabled(TRUE); _orderGroupFirst->setEnabled(TRUE); if (_planningType->code() == "S") _mpsTimeFence->setEnabled(TRUE); else _mpsTimeFence->setEnabled(FALSE); } else { _createPlannedTransfers->setEnabled(FALSE); _orderGroup->setEnabled(FALSE); _orderGroupFirst->setEnabled(FALSE); _mpsTimeFence->setEnabled(FALSE); } } void createItemSitesByClassCode::populateLocations() { XSqlQuery createpopulateLocations; createpopulateLocations.prepare( "SELECT location_id, formatLocationName(location_id) AS locationname " "FROM location " "WHERE ( (location_warehous_id=:warehous_id)" " AND (NOT location_restrict) ) " "ORDER BY locationname;" ); createpopulateLocations.bindValue(":warehous_id", _warehouse->id()); createpopulateLocations.exec(); _locations->populate(createpopulateLocations); if (_locations->count()) { _location->setEnabled(TRUE); _locations->setEnabled(TRUE); } else { _location->setEnabled(FALSE); _locations->setEnabled(FALSE); } } void createItemSitesByClassCode::clear() { _useParameters->setChecked(FALSE); _useParametersOnManual->setChecked(FALSE); _reorderLevel->setDouble(0.0); _orderUpToQty->setDouble(0.0); _minimumOrder->setDouble(0.0); _maximumOrder->setDouble(0.0); _orderMultiple->setDouble(0.0); _safetyStock->setDouble(0.0); _orderGroup->setValue(1); _orderGroupFirst->setChecked(FALSE); _cycleCountFreq->setValue(0); _leadTime->setValue(0); _eventFence->setValue(_metrics->value("DefaultEventFence").toInt()); _controlMethod->setCurrentIndex(1); sHandleControlMethod(); _poSupply->setChecked(TRUE); _woSupply->setChecked(TRUE); _sold->setChecked(TRUE); _stocked->setChecked(FALSE); _locationControl->setChecked(FALSE); _useDefaultLocation->setChecked(FALSE); _miscLocationName->clear(); _locationComments->clear(); _costcat->setId(-1); _woCostGroup->setChecked(FALSE); populateLocations(); } qt-client-4.1.0/guiclient/createItemSitesByClassCode.h000066400000000000000000000024271217451700100227210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATEITEMSITESBYCLASSCODE_H #define CREATEITEMSITESBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_createItemSitesByClassCode.h" class createItemSitesByClassCode : public XDialog, public Ui::createItemSitesByClassCode { Q_OBJECT public: createItemSitesByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createItemSitesByClassCode(); public slots: virtual void sSave(); virtual void sHandlePOSupply( bool pSupplied ); virtual void sHandleWOSupply( bool pSupplied ); virtual void sHandleControlMethod(); virtual void sHandlePlanningType(); virtual void populateLocations(); virtual void clear(); protected slots: virtual void languageChange(); private: QButtonGroup* _locationGroupInt; }; #endif // CREATEITEMSITESBYCLASSCODE_H qt-client-4.1.0/guiclient/createItemSitesByClassCode.ui000066400000000000000000001525021217451700100231070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createItemSitesByClassCode 0 0 800 600 Create Item Sites by Class Code 12 12 Qt::StrongFocus false 0 5 &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 0 &Cancel false C&reate true Qt::Vertical QSizePolicy::Expanding 20 20 Site can manufacture this Item true false 0 0 Create Work Orders linked to Sales Orders Qt::TabFocus Site can Purchase this item true false Create Purchase Requests for Sales Orders Create Purchase Orders linked to Sales Orders Qt::Horizontal QSizePolicy::Fixed 13 13 Drop ship items by default Create Purchase Requests for Work Order requirements Qt::Vertical 20 0 Sold from this site true Ranking: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 10 Qt::Horizontal QSizePolicy::Expanding 0 17 0 Inventory C&ontrol Method: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _controlMethod 0 0 &Planner Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _plannerCode 0 0 Cost Cate&gory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _costcat 0 0 Qt::Horizontal 0 13 Stocked Allow automatic ABC updates ABC Class: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _abcClass A B C Cycl. Cnt. Fre&q.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _cycleCountFreq 999 Days Qt::Horizontal 0 20 Event &Fence: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _eventFence Days Costing Method 0 0 None 0 0 Standard 0 0 Average Qt::Horizontal 0 20 Over-ride Work Order Cost Default true false To Date true Proportional Qt::Horizontal 0 20 Automatic Lot/Serial Numbering false Qt::StrongFocus Sequence #: Qt::Vertical 20 40 Location true Multiple Location Control false 0 0 Use Default Location true false Location: true false 0 0 Qt::Horizontal 0 20 Qt::Horizontal 0 20 User-Defined: Location Comment: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _locationComments Disallow Blank WIP Locations Qt::Vertical 20 0 Qt::Horizontal 40 20 Planning Enforce Order Parameters true false &Reorder Level: _reorderLevel 0 0 80 32767 Qt::AlignRight Order &Up To: _orderUpToQty 0 0 80 32767 Qt::AlignRight Minimum Order: _minimumOrder 0 0 80 32767 Qt::AlignRight Maximum Order: _maximumOrder 0 0 80 32767 Qt::AlignRight Order &Multiple: _orderMultiple 0 0 80 32767 Qt::AlignRight Enforce on Manual Orders Qt::Vertical 20 13 1 0 Scheduling Planning System: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _planningType Qt::Horizontal 0 20 32767 20 Safety Stock: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _safetyStock true 80 32767 Qt::AlignRight Group MRP Orders Every: _orderGroup 0 999 0 Days First Group &Lead Time: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _leadTime Days MPS Time Fence: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _mpsTimeFence 0 999 0 Days Create Planned Transfer Orders true false Supplied from Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 17 Qt::Horizontal 0 20 Qt::Vertical 20 0 Expiration false Perishable Requires Warranty when Purchased Auto Register Lot/Serial at Shipping Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 17 ParameterGroup QGroupBox

parametergroup.h
WComboBox XComboBox
wcombobox.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
1
_classCode _warehouse _reorderLevel _orderUpToQty _minimumOrder _maximumOrder _orderMultiple _orderGroup _safetyStock _abcClass _cycleCountFreq _eventFence _locationControl _location _locations _miscLocation _miscLocationName _locationComments _close clicked() createItemSitesByClassCode reject() 713 45 20 20 _location toggled(bool) _locations setEnabled(bool) 78 500 171 502 _miscLocation toggled(bool) _miscLocationName setEnabled(bool) 78 536 202 529 _locationControl toggled(bool) _useDefaultLocation setEnabled(bool) 358 458 357 483 _useDefaultLocation toggled(bool) _location setEnabled(bool) 226 513 116 506 _useDefaultLocation toggled(bool) _miscLocation setEnabled(bool) 226 513 131 542 _warehouse valid(bool) _create setEnabled(bool) 504 54 736 83 qt-client-4.1.0/guiclient/createLotSerial.cpp000066400000000000000000000332031217451700100211640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createLotSerial.h" #include #include #include #include #include #include createLotSerial::createLotSerial(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_assign, SIGNAL(clicked()), this, SLOT(sAssign())); connect(_lotSerial, SIGNAL(textChanged(QString)), this, SLOT(sHandleLotSerial())); _item->setReadOnly(TRUE); _serial = false; _itemsiteid = -1; _preassigned = false; adjustSize(); _qtyToAssign->setValidator(omfgThis->qtyVal()); } createLotSerial::~createLotSerial() { // no need to delete child widgets, Qt does it all for us } void createLotSerial::languageChange() { retranslateUi(this); } enum SetResponse createLotSerial::set(const ParameterList &pParams) { XSqlQuery createet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemloc_series", &valid); if (valid) _itemlocSeries = param.toInt(); param = pParams.value("itemlocdist_id", &valid); if (valid) { _itemlocdistid = param.toInt(); createet.prepare( "SELECT item_fractional, itemsite_controlmethod, itemsite_item_id," " itemsite_id, itemsite_perishable, itemsite_warrpurc, " " COALESCE(itemsite_lsseq_id,-1) AS itemsite_lsseq_id, " " invhist_ordtype, invhist_transtype, invhist_ordnumber " "FROM itemlocdist, itemsite, item, invhist " "WHERE ( (itemlocdist_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (itemlocdist_invhist_id=invhist_id) " " AND (itemlocdist_id=:itemlocdist_id) );" ); createet.bindValue(":itemlocdist_id", _itemlocdistid); createet.exec(); if (createet.first()) { if (createet.value("itemsite_controlmethod").toString() == "S") { _serial = true; _qtyToAssign->setText("1"); _qtyToAssign->setEnabled(FALSE); } else _serial = false; _item->setItemsiteid(createet.value("itemsite_id").toInt()); _itemsiteid = createet.value("itemsite_id").toInt(); _expiration->setEnabled(createet.value("itemsite_perishable").toBool()); _warranty->setEnabled(createet.value("itemsite_warrpurc").toBool() && createet.value("invhist_ordtype").toString() == "PO"); _fractional = createet.value("item_fractional").toBool(); //If there is preassigned trace info for an associated order, force user to select from list XSqlQuery preassign; preassign.prepare("SELECT lsdetail_id,ls_number,ls_number " "FROM lsdetail,ls " "WHERE ( (lsdetail_source_number=:docnumber) " "AND (lsdetail_source_type=:transtype) " "AND (lsdetail_ls_id=ls_id) " "AND (lsdetail_qtytoassign > 0) )"); preassign.bindValue(":transtype", createet.value("invhist_transtype").toString()); preassign.bindValue(":docnumber", createet.value("invhist_ordnumber").toString()); preassign.exec(); if (preassign.first()) { _lotSerial->setAllowNull(true); _lotSerial->populate(preassign); _preassigned = true; } else if (preassign.lastError().type() != QSqlError::NoError) { systemError(this, preassign.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } else if (createet.value("itemsite_lsseq_id").toInt() != -1) { // Auto sequence XSqlQuery fetchlsnum; fetchlsnum.prepare("SELECT fetchlsnumber(:lsseq_id) AS lotserial;"); fetchlsnum.bindValue(":lsseq_id", createet.value("itemsite_lsseq_id").toInt()); fetchlsnum.exec(); if (fetchlsnum.first()) { _lotSerial->setAllowNull(true); _lotSerial->setText(fetchlsnum.value("lotserial").toString()); } else if (fetchlsnum.lastError().type() != QSqlError::NoError) { systemError(this, fetchlsnum.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (!_serial) { XSqlQuery lots; lots.prepare("SELECT itemloc_id, ls_number, ls_number " "FROM ls " " JOIN itemloc ON (itemloc_ls_id=ls_id) " "WHERE (itemloc_itemsite_id=:itemsite_id);"); lots.bindValue(":itemsite_id", createet.value("itemsite_id").toInt()); lots.exec(); if (lots.lastError().type() != QSqlError::NoError) { systemError(this, lots.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } else { _lotSerial->setAllowNull(true); _lotSerial->populate(lots); connect(_lotSerial, SIGNAL(newID(int)), this, SLOT(sLotSerialSelected())); } } } else if (createet.lastError().type() != QSqlError::NoError) { systemError(this, createet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("qtyRemaining", &valid); if (valid) _qtyRemaining->setText(param.toString()); return NoError; } void createLotSerial::sHandleLotSerial() { _lotSerial->setText(_lotSerial->currentText().toUpper()); } void createLotSerial::sAssign() { XSqlQuery createAssign; int lsid=-1; if (_lotSerial->currentText().isEmpty()) { QMessageBox::critical( this, tr("Enter Lot/Serial Number"), tr("

You must enter a Lot/Serial number.")); _lotSerial->setFocus(); return; } else if (_lotSerial->currentText().contains(QRegExp("\\s")) && QMessageBox::question(this, tr("Lot/Serial Number Contains Spaces"), tr("

The Lot/Serial Number contains spaces. Do " "you want to save it anyway?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { _lotSerial->setFocus(); return; } if (_qtyToAssign->toDouble() == 0.0) { QMessageBox::critical( this, tr("Enter Quantity"), tr("

You must enter a positive value to assign to " "this Lot/Serial number.") ); _qtyToAssign->setFocus(); return; } if ( (_expiration->isEnabled()) && (!_expiration->isValid()) ) { QMessageBox::critical( this, tr("Enter Expiration Date"), tr("

You must enter an expiration date to this " "Perishable Lot/Serial number.") ); _expiration->setFocus(); return; } if ( (_warranty->isEnabled()) && (!_warranty->isValid()) ) { QMessageBox::critical( this, tr("Enter Warranty Expire Date"), tr("

You must enter a warranty expiration date for this " "Lot/Serial number.") ); _warranty->setFocus(); return; } if (!_fractional) { if (_qtyToAssign->toDouble() != _qtyToAssign->text().toInt()) { QMessageBox::critical( this, tr("Item is Non-Fractional"), tr( "

The Item in question is not stored in " "fractional quantities. You must enter a " "whole value to assign to this Lot/Serial " "number." ) ); _qtyToAssign->setFocus(); return; } } if (_preassigned) { createAssign.prepare("SELECT lsdetail_qtytoassign " "FROM lsdetail " "WHERE (lsdetail_id=:lsdetail_id);"); createAssign.bindValue(":lsdetail_id", _lotSerial->id()); createAssign.exec(); if (createAssign.first()) { if ( _qtyToAssign->toDouble() > createAssign.value("lsdetail_qtytoassign").toDouble() ) { QMessageBox::critical( this, tr("Invalid Qty"), tr( "

The quantity being assigned is greater than the " " quantity preassigned to the order being received." ) ); return; } } else { QMessageBox::critical( this, tr("Invalid Number"), tr( "

The number entered is not valid. Please select from the list " "of valid numbers." ) ); _lotSerial->removeItem(_lotSerial->currentIndex()); _lotSerial->setCurrentIndex(0); return; } } if (_serial) { createAssign.prepare("SELECT COUNT(*) AS count FROM " "(SELECT itemloc_id AS count " "FROM itemloc,itemsite,ls " "WHERE ((itemloc_itemsite_id=:itemsite_id)" " AND (itemloc_itemsite_id=itemsite_id)" " AND (itemsite_item_id=ls_item_id)" " AND (itemloc_ls_id=ls_id)" " AND (UPPER(ls_number)=UPPER(:lotserial)))" "UNION " "SELECT itemlocdist_id " "FROM itemlocdist,itemsite,ls " "WHERE ((itemlocdist_itemsite_id=:itemsite_id) " " AND (itemlocdist_itemsite_id=itemsite_id)" " AND (itemlocdist_ls_id=ls_id)" " AND (UPPER(ls_number)=UPPER(:lotserial)) " " AND (itemlocdist_source_type='D'))) as data;"); createAssign.bindValue(":itemsite_id", _itemsiteid); createAssign.bindValue(":lotserial", _lotSerial->currentText()); createAssign.exec(); if (createAssign.first()) { if (createAssign.value("count").toInt() > 0) { QMessageBox::critical(this, tr("Duplicate Serial Number"), tr("This Serial Number has already been used " "and cannot be reused.")); return; } } else if (createAssign.lastError().type() != QSqlError::NoError) { systemError(this, createAssign.lastError().databaseText(), __FILE__, __LINE__); return; } } else { createAssign.prepare("SELECT ls_id, ls_number " "FROM ls,itemsite " "WHERE ( (UPPER(ls_number)=UPPER(:lotserial)) " "AND (ls_item_id=itemsite_item_id) " "AND (itemsite_id=:itemsiteid) );"); createAssign.bindValue(":itemsiteid", _itemsiteid); createAssign.bindValue(":lotserial", _lotSerial->currentText()); createAssign.exec(); if (createAssign.first()) { if (!_serial) if (QMessageBox::question(this, tr("Use Existing?"), tr("

A record with for lot number %1 for this item already exists. " "Reference existing lot?").arg(createAssign.value("ls_number").toString().toUpper()), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::No) return; lsid=createAssign.value("ls_id").toInt(); } else if (createAssign.lastError().type() != QSqlError::NoError) { systemError(this, createAssign.lastError().databaseText(), __FILE__, __LINE__); return; } } QString sql; if (_preassigned) sql = "SELECT createlotserial(:itemsite_id,:lotserial,:itemlocseries,lsdetail_source_type,lsdetail_source_id,:itemlocdist_id,:qty,:expiration,:warranty) " "FROM lsdetail,itemlocdist " "WHERE ((lsdetail_id=:lsdetail_id)" "AND (itemlocdist_id=:itemlocdist_id));"; else sql = "SELECT createlotserial(:itemsite_id,:lotserial,:itemlocseries,'I',NULL,itemlocdist_id,:qty,:expiration,:warranty) " "FROM itemlocdist " "WHERE (itemlocdist_id=:itemlocdist_id);"; createAssign.prepare(sql); createAssign.bindValue(":itemsite_id", _itemsiteid); createAssign.bindValue(":lotserial", _lotSerial->currentText().toUpper()); createAssign.bindValue(":itemlocseries", _itemlocSeries); createAssign.bindValue(":lsdetail_id", _lotSerial->id()); createAssign.bindValue(":qty", _qtyToAssign->toDouble()); if (_expiration->isEnabled()) createAssign.bindValue(":expiration", _expiration->date()); else createAssign.bindValue(":expiration", omfgThis->endOfTime()); if (_warranty->isEnabled()) createAssign.bindValue(":warranty", _warranty->date()); createAssign.bindValue(":itemlocdist_id", _itemlocdistid); createAssign.exec(); if (createAssign.lastError().type() != QSqlError::NoError) { systemError(this, createAssign.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void createLotSerial::sLotSerialSelected() { if (!_expiration->isEnabled() && !_warranty->isEnabled()) return; XSqlQuery itemloc; itemloc.prepare("SELECT itemloc_expiration, itemloc_warrpurc " "FROM itemloc " "WHERE itemloc_id=:itemloc_id;"); itemloc.bindValue(":itemloc_id", _lotSerial->id()); itemloc.exec(); if (itemloc.first()) { if (_expiration->isEnabled() && itemloc.value("itemloc_expiration").toDate() != omfgThis->endOfTime()) _expiration->setDate(itemloc.value("itemloc_expiration").toDate()); if (_warranty->isEnabled()) _warranty->setDate(itemloc.value("itemloc_warrpurc").toDate()); } } qt-client-4.1.0/guiclient/createLotSerial.h000066400000000000000000000023171217451700100206330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATELOTSERIAL_H #define CREATELOTSERIAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_createLotSerial.h" class createLotSerial : public XDialog, public Ui::createLotSerial { Q_OBJECT public: createLotSerial(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createLotSerial(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sAssign(); virtual void sHandleLotSerial(); virtual void sLotSerialSelected(); protected slots: virtual void languageChange(); private: bool _fractional; int _itemlocSeries; int _itemlocdistid; int _itemsiteid; bool _serial; bool _preassigned; }; #endif // CREATELOTSERIAL_H qt-client-4.1.0/guiclient/createLotSerial.ui000066400000000000000000000157571217451700100210350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createLotSerial 0 0 575 226 Create Lot/Serial # true Qty. Remaining: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 0 &OK true true &Cancel Qt::Vertical QSizePolicy::Expanding 20 0 Lot/Serial #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Expiration Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty To Assign: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Warranty Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter DLineEdit QWidget

datecluster.h
1 ItemCluster QWidget
itemcluster.h
XComboBox QComboBox
xcombobox.h
XLineEdit QLineEdit
xlineedit.h
_lotSerial _qtyToAssign _expiration _warranty _close _close clicked() createLotSerial reject() 20 20 20 20 qt-client-4.1.0/guiclient/createPlannedOrdersByItem.cpp000066400000000000000000000072011217451700100231370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createPlannedOrdersByItem.h" #include #include #include createPlannedOrdersByItem::createPlannedOrdersByItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _item->setType(ItemLineEdit::cPlanningMRP); connect(_item, SIGNAL(valid(bool)), _create, SLOT(setEnabled(bool))); connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_create, SIGNAL(clicked()), this, SLOT(sCreate())); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } _captive = FALSE; } createPlannedOrdersByItem::~createPlannedOrdersByItem() { // no need to delete child widgets, Qt does it all for us } void createPlannedOrdersByItem::languageChange() { retranslateUi(this); } enum SetResponse createPlannedOrdersByItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); } return NoError; } void createPlannedOrdersByItem::sCreate() { XSqlQuery createCreate; if (!_cutOffDate->isValid()) { QMessageBox::warning( this, tr("Enter Cut Off Date"), tr( "You must enter a valid Cut Off Date before\n" "creating Planned Orders." )); _cutOffDate->setFocus(); return; } if(!_explodeChildren->isChecked()) { createCreate.prepare( "SELECT createPlannedOrders(itemsite_id, :cutOffDate, :deleteFirmed, FALSE) " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_active)" " AND (itemsite_warehous_id=:warehous_id) );" ); createCreate.bindValue(":cutOffDate", _cutOffDate->date()); createCreate.bindValue(":deleteFirmed", QVariant(_deleteFirmed->isChecked())); createCreate.bindValue(":item_id", _item->id()); createCreate.bindValue(":warehous_id", _warehouse->id()); createCreate.exec(); if (createCreate.lastError().type() != QSqlError::NoError) { systemError(this, createCreate.lastError().databaseText(), __FILE__, __LINE__); return; } } else { createCreate.prepare( "SELECT createAndExplodePlannedOrders(itemsite_id, :cutOffDate, :deleteFirmed, false)" "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_active)" " AND (itemsite_warehous_id=:warehous_id) );" ); createCreate.bindValue(":cutOffDate", _cutOffDate->date()); createCreate.bindValue(":deleteFirmed", QVariant(_deleteFirmed->isChecked())); createCreate.bindValue(":item_id", _item->id()); createCreate.bindValue(":warehous_id", _warehouse->id()); createCreate.exec(); if (createCreate.lastError().type() != QSqlError::NoError) { systemError(this, createCreate.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_captive) accept(); else { _close->setText(tr("&Close")); _item->setId(-1); _item->setFocus(); } } qt-client-4.1.0/guiclient/createPlannedOrdersByItem.h000066400000000000000000000021431217451700100226040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATEPLANNEDORDERSBYITEM_H #define CREATEPLANNEDORDERSBYITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_createPlannedOrdersByItem.h" class createPlannedOrdersByItem : public XDialog, public Ui::createPlannedOrdersByItem { Q_OBJECT public: createPlannedOrdersByItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createPlannedOrdersByItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); protected slots: virtual void languageChange(); virtual void sCreate(); private: bool _captive; }; #endif // CREATEPLANNEDORDERSBYITEM_H qt-client-4.1.0/guiclient/createPlannedOrdersByItem.ui000066400000000000000000000215721217451700100230010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createPlannedOrdersByItem 0 0 406 211 Run MRP by Item 0 Qt::StrongFocus &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _warehouse 0 0 0 0 0 true Qt::Horizontal QSizePolicy::Preferred 20 0 Cut&off Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _cutOffDate 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 &Explode Children &Delete Existing Firmed MRP Orders Qt::Vertical QSizePolicy::Expanding 20 16 5 0 0 0 0 &Cancel false C&reate true Qt::Vertical QSizePolicy::Expanding 20 20 DLineEdit XLineEdit
datecluster.h
ItemCluster QWidget
itemcluster.h
WComboBox XComboBox
wcombobox.h
XCheckBox QCheckBox
xcheckbox.h
_item _warehouse _cutOffDate _explodeChildren _deleteFirmed _create _close _item valid(bool) _create setEnabled(bool) 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _close clicked() createPlannedOrdersByItem reject() 20 20 20 20
qt-client-4.1.0/guiclient/createPlannedOrdersByPlannerCode.cpp000066400000000000000000000067021217451700100244400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createPlannedOrdersByPlannerCode.h" #include #include #include #include #include "mqlutil.h" createPlannedOrdersByPlannerCode::createPlannedOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sCreate())); _plannerCode->setType(ParameterGroup::PlannerCode); } createPlannedOrdersByPlannerCode::~createPlannedOrdersByPlannerCode() { // no need to delete child widgets, Qt does it all for us } void createPlannedOrdersByPlannerCode::languageChange() { retranslateUi(this); } void createPlannedOrdersByPlannerCode::sCreate() { XSqlQuery createCreate; ParameterList params; if (! setParams(params)) return; sCreate(params); } void createPlannedOrdersByPlannerCode::sCreate(ParameterList params) { XSqlQuery createCreate; QProgressDialog progress; progress.setWindowModality(Qt::ApplicationModal); MetaSQLQuery mql = mqlLoad("schedule", "load"); createCreate = mql.toQuery(params); if (createCreate.lastError().type() != QSqlError::NoError) { systemError(this, createCreate.lastError().databaseText(), __FILE__, __LINE__); return; } int count=0; progress.setMaximum(createCreate.size()); XSqlQuery create; while (createCreate.next()) { progress.setLabelText(tr("Site: %1\n" "Item: %2 - %3") .arg(createCreate.value("warehous_code").toString()) .arg(createCreate.value("item_number").toString()) .arg(createCreate.value("item_descrip1").toString())); ParameterList rparams = params; rparams.append("itemsite_id", createCreate.value("itemsite_id")); MetaSQLQuery mql2 = mqlLoad("schedule", "create"); create = mql2.toQuery(rparams); if (create.lastError().type() != QSqlError::NoError) { systemError(this, create.lastError().databaseText(), __FILE__, __LINE__); return; } if (progress.wasCanceled()) break; count++; progress.setValue(count); } accept(); } bool createPlannedOrdersByPlannerCode::setParams(ParameterList &pParams) { if (!_cutOffDate->isValid()) { QMessageBox::warning( this, tr("Enter Cut Off Date"), tr( "You must enter a valid Cut Off Date before\n" "creating Planned Orders." )); _cutOffDate->setFocus(); return false; } pParams.append("action_name", "RunMRP"); pParams.append("MPS", QVariant(false)); pParams.append("planningType", "M"); _plannerCode->appendValue(pParams); _warehouse->appendValue(pParams); pParams.append("cutOffDate", _cutOffDate->date()); pParams.append("cutoff_offset", QDate::currentDate().daysTo(_cutOffDate->date())); pParams.append("deleteFirmed", QVariant(_deleteFirmed->isChecked())); return true; } qt-client-4.1.0/guiclient/createPlannedOrdersByPlannerCode.h000066400000000000000000000022421217451700100241000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATEPLANNEDORDERSBYPLANNERCODE_H #define CREATEPLANNEDORDERSBYPLANNERCODE_H #include #include "guiclient.h" #include "xdialog.h" #include #include "ui_createPlannedOrdersByPlannerCode.h" class createPlannedOrdersByPlannerCode : public XDialog, public Ui::createPlannedOrdersByPlannerCode { Q_OBJECT public: createPlannedOrdersByPlannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createPlannedOrdersByPlannerCode(); virtual bool setParams(ParameterList&); protected slots: virtual void languageChange(); virtual void sCreate(); virtual void sCreate(ParameterList params); }; #endif // CREATEPLANNEDORDERSBYPLANNERCODE_H qt-client-4.1.0/guiclient/createPlannedOrdersByPlannerCode.ui000066400000000000000000000106041217451700100242670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createPlannedOrdersByPlannerCode 0 0 474 339 Run MRP by Planner Code Qt::StrongFocus false Qt::StrongFocus false false Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::StrongFocus &Delete Existing Firmed MRP Orders Qt::Horizontal 76 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok DLineEdit QWidget
datecluster.h
ParameterGroup QGroupBox
parametergroup.h
WarehouseGroup QGroupBox
warehousegroup.h
XCheckBox QCheckBox
xcheckbox.h
_plannerCode _warehouse _cutOffDate _deleteFirmed
qt-client-4.1.0/guiclient/createRecurringInvoices.cpp000066400000000000000000000031151217451700100227250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createRecurringInvoices.h" #include #include #include #include "storedProcErrorLookup.h" createRecurringInvoices::createRecurringInvoices(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); } createRecurringInvoices::~createRecurringInvoices() { // no need to delete child widgets, Qt does it all for us } void createRecurringInvoices::languageChange() { retranslateUi(this); } void createRecurringInvoices::sUpdate() { XSqlQuery createUpdate; createUpdate.exec("SELECT createRecurringItems(NULL, 'I') AS result;"); if (createUpdate.first()) { int result = createUpdate.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("createRecurringInvoices", result), __FILE__, __LINE__); return; } } else if (createUpdate.lastError().type() != QSqlError::NoError) { systemError(this, createUpdate.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/createRecurringInvoices.h000066400000000000000000000017311217451700100223740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATERECURRINGINVOICES_H #define CREATERECURRINGINVOICES_H #include "guiclient.h" #include "xdialog.h" #include "ui_createRecurringInvoices.h" class createRecurringInvoices : public XDialog, public Ui::createRecurringInvoices { Q_OBJECT public: createRecurringInvoices(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~createRecurringInvoices(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); }; #endif // CREATERECURRINGINVOCIES_H qt-client-4.1.0/guiclient/createRecurringInvoices.ui000066400000000000000000000061171217451700100225650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createRecurringInvoices 0 0 626 133 0 0 Create Recurring Invoices Create Recurring Invoices within the defined buffer period for all Customers. Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop Qt::Horizontal 16 63 &Cancel &Create true Qt::Vertical QSizePolicy::Expanding 20 16 _close clicked() createRecurringInvoices reject() 525 23 20 20 qt-client-4.1.0/guiclient/createRecurringItems.cpp000066400000000000000000000120541217451700100222310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "createRecurringItems.h" #include #include #include #include "storedProcErrorLookup.h" #include "submitAction.h" createRecurringItems::createRecurringItems(QWidget* parent, const char* name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_create, SIGNAL(clicked()), this, SLOT(sCreate())); connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit())); connect(_invoices, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_vouchers, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_incidents, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_projects, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_todoItems, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); } createRecurringItems::~createRecurringItems() { // no need to delete child widgets, Qt does it all for us } void createRecurringItems::languageChange() { retranslateUi(this); } void createRecurringItems::sHandleButtons() { _create->setEnabled(_invoices->isChecked() || _vouchers->isChecked() || _incidents->isChecked() || _projects->isChecked() || _todoItems->isChecked()); _submit->setEnabled(_invoices->isChecked() || _vouchers->isChecked() || _incidents->isChecked() || _projects->isChecked() || _todoItems->isChecked()); } void createRecurringItems::sCreate() { struct { XCheckBox *widget; QString arg; // to createRecurringItems() } list[] = { { _invoices, "I" }, { _vouchers, "V" }, { _incidents, "INCDT" }, { _projects, "J" }, { _todoItems, "TODO" } }; QStringList errors; int count = 0; XSqlQuery createq; createq.prepare("SELECT createRecurringItems(NULL, :what) AS result;"); for (unsigned int i = 0; i < sizeof(list) / sizeof(list[0]); i++) { if (list[i].widget->isChecked()) { createq.bindValue(":what", list[i].arg); createq.exec(); if (createq.first()) { int result = createq.value("result").toInt(); if (result < 0) errors.append(storedProcErrorLookup("createRecurringItems", result)); else count += result; } else if (createq.lastError().type() != QSqlError::NoError) errors.append(createq.lastError().text()); } } if (! errors.isEmpty()) { QMessageBox::critical(this, tr("Processing Errors"), tr("

%n error(s) occurred during processing:" "

  • %1
", "", errors.size()) .arg(errors.join("
  • "))); return; } else QMessageBox::information(this, tr("Processing Complete"), tr("

    %n record(s) were created.", "", count)); close(); } void createRecurringItems::sSubmit() { struct { XCheckBox *widget; QString arg; // to createRecurringItems() } list[] = { { _invoices, "I" }, { _vouchers, "V" }, { _incidents, "INCDT" }, { _projects, "J" }, { _todoItems, "TODO" } }; QStringList errors; int count = 0; for (unsigned int i = 0; i < sizeof(list) / sizeof(list[0]); i++) { if (list[i].widget->isChecked()) { ParameterList params; if (list[i].arg == "I") params.append("action_name", "CreateRecurringInvoices"); else if (list[i].arg == "V") params.append("action_name", "CreateRecurringVouchers"); else if (list[i].arg == "INCDT") params.append("action_name", "CreateRecurringIncidents"); else if (list[i].arg == "J") params.append("action_name", "CreateRecurringProjects"); else if (list[i].arg == "TODO") params.append("action_name", "CreateRecurringTodos"); params.append("type", list[i].arg); submitAction newdlg(this, "", TRUE); newdlg.set(params); if(! newdlg.exec() == XDialog::Accepted) errors.append("Submit cancelled"); else count += 1; } } if (! errors.isEmpty()) { QMessageBox::critical(this, tr("Processing Errors"), tr("

    %n error(s) occurred during processing:" "

    • %1
    ", "", errors.size()) .arg(errors.join("
  • "))); return; } else QMessageBox::information(this, tr("Processing Complete"), tr("

    %n record(s) were created.", "", count)); close(); } qt-client-4.1.0/guiclient/createRecurringItems.h000066400000000000000000000017611217451700100217010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREATERECURRINGITEMS_H #define CREATERECURRINGITEMS_H #include "guiclient.h" #include "xwidget.h" #include "ui_createRecurringItems.h" class createRecurringItems : public XWidget, public Ui::createRecurringItems { Q_OBJECT public: createRecurringItems(QWidget* parent = 0, const char* name = 0, Qt::WindowFlags fl = 0); ~createRecurringItems(); public slots: virtual void sCreate(); virtual void sSubmit(); virtual void sHandleButtons(); protected slots: virtual void languageChange(); }; #endif // CREATERECURRINGITEMS_H qt-client-4.1.0/guiclient/createRecurringItems.ui000066400000000000000000000116501217451700100220650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. createRecurringItems 0 0 358 184 0 0 Create Recurring Items Create Recurring Items: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop &Cancel false &Create true false &Schedule Qt::Vertical QSizePolicy::Expanding 20 16 Incidents Qt::Horizontal 0 0 To-Do Items Projects Invoices Qt::Vertical 0 0 Vouchers XCheckBox QCheckBox

    xcheckbox.h
    _invoices _incidents _todoItems _projects _create _close _close clicked() createRecurringItems close() 525 23 20 20 qt-client-4.1.0/guiclient/creditCard.cpp000066400000000000000000000454251217451700100201570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "creditCard.h" #include #include #include #include #include #include "storedProcErrorLookup.h" #define DEBUG false int creditCard::saveCreditCard(QWidget *parent, int &custId, QString &ccName, QString &ccAddress1, QString &ccAddress2, QString &ccCity, QString &ccState, QString &ccZip, QString &ccCountry, QString &ccNumber, QString &ccType, QString &ccExpireMonth, QString &ccExpireYear, int &ccId, bool ccActive) { XSqlQuery creditaveCreditCard; bool everythingOK; everythingOK = true; int mode = cNew; int seq = 0; if (ccId > 0) mode = cEdit; ccName = ccName.trimmed(); ccAddress1 = ccAddress1.trimmed(); ccAddress2 = ccAddress2.trimmed(); ccCity = ccCity.trimmed(); ccState = ccState.trimmed(); ccZip = ccZip.trimmed(); ccCountry = ccCountry.trimmed(); ccExpireMonth = ccExpireMonth.trimmed(); ccExpireYear = ccExpireYear.trimmed(); if (ccExpireMonth.length() == 1) ccExpireMonth = "0" + ccExpireMonth; int mymonth = ccExpireMonth.toInt(); int myyear = ccExpireYear.toInt(); struct { bool condition; QString msg; int result; } error[] = { { ccName.length() == 0 || ccName.isEmpty(), tr("The name of the card holder must be entered"), -3 }, { ccAddress1.length() == 0 || ccAddress1.isEmpty(), tr("The first address line must be entered"), -4 }, { ccCity.length() == 0 || ccCity.isEmpty(), tr("The city must be entered"), -4 }, { ccState.length() == 0 || ccState.isEmpty(), tr("The state must be entered"), -4 }, { ccZip.length() == 0 || ccZip.isEmpty(), tr("The zip code must be entered"), -4 }, { ccCountry.length() == 0 || ccCountry.isEmpty(), tr("The country must be entered"), -4 }, { ccExpireMonth.length() == 0 || ccExpireMonth.isEmpty() || ccExpireMonth.length() > 2, tr("The Expiration Month must be entered"), -5 }, { mymonth < 1 || mymonth > 12, tr("Valid Expiration Months are 01 through 12"), -5 }, { ccExpireYear.length() != 4, tr("Valid Expiration Years are CCYY in format"), -5 }, { myyear < 1970 || myyear > 2100, tr("Valid Expiration Years are 1970 through 2100"), -6 }, { true, "", -1 } }; int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(parent, tr("Cannot Save Credit Card Information"), error[errIndex].msg); return error[errIndex].result; } QString key; key = omfgThis->_key; ccNumber = ccNumber.trimmed().remove(QRegExp("[-\\s]")); bool allNumeric = QRegExp( "[0-9]{13,16}" ).exactMatch(ccNumber); bool hasBeenFormatted = QRegExp( "\\**([0-9]){4}" ).exactMatch(ccNumber); // tricky - repeated *s if (DEBUG) qDebug("creditCard::sSave() %s allNumeric %d, hasBeenFormatted %d", qPrintable(ccNumber.left(4)), allNumeric, hasBeenFormatted); if (mode == cNew || (mode == cEdit && ! hasBeenFormatted)) { if (!allNumeric || ccNumber.length() == 14) { QMessageBox::warning( parent, tr("Invalid Credit Card Number"), tr("The credit card number must be all numeric and must be 13, 15 or 16 characters in length") ); return -1; } } // See if this card exists on file if (mode == cNew) { creditaveCreditCard.prepare("SELECT ccard_id FROM ccard " "WHERE ((ccard_cust_id=:cust_id) " "AND (ccard_type=:type) " "AND (ccard_number=encrypt(setbytea(:number), setbytea(:key), 'bf'))) "); creditaveCreditCard.bindValue(":cust_id", custId); creditaveCreditCard.bindValue(":type" , ccType); creditaveCreditCard.bindValue(":number", ccNumber); creditaveCreditCard.bindValue(":key", key); creditaveCreditCard.exec(); if (creditaveCreditCard.first()) { ccId = creditaveCreditCard.value("ccard_id").toInt(); mode = cEdit; } } int cceditreturn = 0; if (mode == cEdit && ! hasBeenFormatted) { // editccnumber validates but does not modify db creditaveCreditCard.prepare("SELECT editccnumber(text(:ccnum), text(:cctype)) AS cc_back;"); creditaveCreditCard.bindValue(":ccnum", ccNumber); creditaveCreditCard.bindValue(":cctype", ccType); creditaveCreditCard.exec(); if (creditaveCreditCard.first()) cceditreturn = creditaveCreditCard.value("cc_back").toInt(); else if (creditaveCreditCard.lastError().type() != QSqlError::NoError) { systemError(parent, creditaveCreditCard.lastError().databaseText(), __FILE__, __LINE__); return -2; } } if (cceditreturn == -10) { // don't combine into (-10 && !CCtest): continue on -10 if not strict if (!_metrics->boolean("CCTest")) { QMessageBox::warning( parent, tr("Invalid Credit Card Number"), storedProcErrorLookup("editccnumber", cceditreturn)); return -1; } } else if (cceditreturn < 0) { QMessageBox::warning(parent, tr("Invalid Credit Card Information"), storedProcErrorLookup("editccnumber", cceditreturn)); return -1; } if (mode == cNew) { creditaveCreditCard.exec("SELECT NEXTVAL('ccard_ccard_id_seq') AS ccard_id;"); if (creditaveCreditCard.first()) ccId = creditaveCreditCard.value("ccard_id").toInt(); else if (creditaveCreditCard.lastError().type() != QSqlError::NoError) { systemError(parent, creditaveCreditCard.lastError().databaseText(), __FILE__, __LINE__); return -2; } creditaveCreditCard.prepare("SELECT COALESCE(MAX(ccard_seq), 0) + 10 AS ccard_seq FROM ccard WHERE ccard_cust_id =:ccard_cust_id;"); creditaveCreditCard.bindValue(":ccard_cust_id", custId); creditaveCreditCard.exec(); if (creditaveCreditCard.first()) seq = creditaveCreditCard.value("ccard_seq").toInt(); else if (creditaveCreditCard.lastError().type() != QSqlError::NoError) { systemError(parent, creditaveCreditCard.lastError().databaseText(), __FILE__, __LINE__); return -2; } creditaveCreditCard.prepare( "INSERT INTO ccard " "( ccard_id, ccard_seq, ccard_cust_id, " " ccard_active, ccard_name, ccard_address1," " ccard_address2," " ccard_city, ccard_state, ccard_zip," " ccard_country, ccard_number," " ccard_month_expired, ccard_year_expired, ccard_type)" "VALUES " "( :ccard_id," " :ccard_seq," " :ccard_cust_id," " :ccard_active, " " encrypt(setbytea(:ccard_name), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_address1), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_address2), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_city), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_state), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_zip), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_country), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_number), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_month_expired), setbytea(:key), 'bf')," " encrypt(setbytea(:ccard_year_expired), setbytea(:key), 'bf')," " :ccard_type );" ); } else if (mode == cEdit) creditaveCreditCard.prepare( "UPDATE ccard " "SET ccard_active=:ccard_active, " " ccard_name=encrypt(setbytea(:ccard_name), setbytea(:key), 'bf')," " ccard_address1=encrypt(setbytea(:ccard_address1), setbytea(:key), 'bf')," " ccard_address2=encrypt(setbytea(:ccard_address2), setbytea(:key), 'bf'), " " ccard_city=encrypt(setbytea(:ccard_city), setbytea(:key), 'bf')," " ccard_state=encrypt(setbytea(:ccard_state), setbytea(:key), 'bf')," " ccard_zip=encrypt(setbytea(:ccard_zip), setbytea(:key), 'bf')," " ccard_country=encrypt(setbytea(:ccard_country), setbytea(:key), 'bf')," " ccard_month_expired=encrypt(setbytea(:ccard_month_expired), setbytea(:key), 'bf')," " ccard_year_expired=encrypt(setbytea(:ccard_year_expired), setbytea(:key), 'bf')," " ccard_type=:ccard_type " "WHERE (ccard_id=:ccard_id);" ); creditaveCreditCard.bindValue(":ccard_id", ccId); creditaveCreditCard.bindValue(":ccard_seq", seq); creditaveCreditCard.bindValue(":ccard_cust_id", custId); creditaveCreditCard.bindValue(":ccard_active", QVariant(ccActive)); creditaveCreditCard.bindValue(":ccard_number", ccNumber); creditaveCreditCard.bindValue(":ccard_name", ccName); creditaveCreditCard.bindValue(":ccard_address1", ccAddress1); creditaveCreditCard.bindValue(":ccard_address2", ccAddress2); creditaveCreditCard.bindValue(":ccard_city", ccCity); creditaveCreditCard.bindValue(":ccard_state", ccState); creditaveCreditCard.bindValue(":ccard_zip", ccZip); creditaveCreditCard.bindValue(":ccard_country", ccCountry); creditaveCreditCard.bindValue(":ccard_month_expired",ccExpireMonth); creditaveCreditCard.bindValue(":ccard_year_expired",ccExpireYear); creditaveCreditCard.bindValue(":key", key); creditaveCreditCard.bindValue(":ccard_type", ccType); creditaveCreditCard.exec(); if (creditaveCreditCard.lastError().type() != QSqlError::NoError) { systemError(parent, creditaveCreditCard.lastError().databaseText(), __FILE__, __LINE__); return -2; } // TODO: combine with UPDATE above? if (mode == cEdit && ! hasBeenFormatted) // user wants to change the cc number { creditaveCreditCard.prepare("UPDATE ccard SET ccard_number=encrypt(setbytea(:ccard_number), setbytea(:key), 'bf') " "WHERE (ccard_id=:ccard_id);" ); creditaveCreditCard.bindValue(":ccard_number", ccNumber); creditaveCreditCard.bindValue(":key", key); creditaveCreditCard.bindValue(":ccard_id", ccId); creditaveCreditCard.exec(); if (creditaveCreditCard.lastError().type() != QSqlError::NoError) { systemError(parent, creditaveCreditCard.lastError().databaseText(), __FILE__, __LINE__); return -2; } } return ccId; } //////////////////////////////////////////////// creditCard::creditCard(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _ccardid = 0; connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); } creditCard::~creditCard() { // no need to delete child widgets, Qt does it all for us } void creditCard::languageChange() { retranslateUi(this); } const char *_fundsTypes2[] = { "M", "V", "A", "D" }; const int _fundsTypeCount2 = 4; enum SetResponse creditCard::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) _custid = param.toInt(); param = pParams.value("ccard_id", &valid); if (valid) { _ccardid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { XSqlQuery cust; cust.prepare( "SELECT cust_number, cust_name " "FROM custinfo " "WHERE (cust_id=:cust_id);" ); cust.bindValue(":cust_id", _custid); cust.exec(); if (cust.first()) { _custNum->setText(cust.value("cust_number").toString()); _custName->setText(cust.value("cust_name").toString()); } else if (cust.lastError().type() != QSqlError::NoError) systemError(this, cust.lastError().databaseText(), __FILE__, __LINE__); if (param.toString() == "new") { _mode = cNew; _address->setCountry("United States"); cust.prepare( "SELECT cust_number, cust_name," " addr_line1, addr_line2, addr_line3," " addr_city, addr_state, addr_country," " addr_postalcode " " FROM custinfo, cntct, addr " " WHERE((cust_id=:cust_id)" " AND (cust_cntct_id=cntct_id)" " AND (cntct_addr_id=addr_id));" ); cust.bindValue(":cust_id", _custid); cust.exec(); if (cust.first()) { _address->setLine1(cust.value("addr_line1").toString()); _address->setLine3(cust.value("addr_line3").toString()); _address->setLine2(cust.value("addr_line2").toString()); _address->setCity(cust.value("addr_city").toString()); _address->setState(cust.value("addr_state").toString()); _address->setPostalCode(cust.value("addr_postalcode").toString()); _address->setCountry(cust.value("addr_country").toString()); } } else if (param.toString() == "edit") { _mode = cEdit; _fundsType2->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _fundsType2->setEnabled(FALSE); _creditCardNumber->setEnabled(FALSE); _active->setEnabled(FALSE); _name->setEnabled(FALSE); _address->setEnabled(FALSE); _expireMonth->setEnabled(FALSE); _expireYear->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void creditCard::sSave() { if (! _address->line3().isEmpty()) { int answer = QMessageBox::question(this, tr("Third Address Line Ignored"), tr("

    The third line of the street " "address will not be saved as part " "of the credit card address. The " "xTuple credit card interface " "supports only 2 lines of street " "address.

    Continue processing?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::No) { _address->setFocus(); return; } } bool ccActive = _active->isChecked(); QString ccName = _name->text(); QString ccAddress1 = _address->line1(); QString ccAddress2 = _address->line2(); QString ccCity = _address->city(); QString ccState = _address->state(); QString ccZip = _address->postalCode(); QString ccCountry = _address->country(); QString ccNumber = _creditCardNumber->text(); QString ccType = QString(*(_fundsTypes2 + _fundsType2->currentIndex())); QString ccExpireMonth = _expireMonth->text(); QString ccExpireYear = _expireYear->text(); int result = saveCreditCard(this, _custid, ccName, ccAddress1, ccAddress2, ccCity, ccState, ccZip, ccCountry, ccNumber, ccType, ccExpireMonth, ccExpireYear, _ccardid, ccActive); switch (result) { case -1: _creditCardNumber->setFocus(); break; case -2: break; case -3: _name->setFocus(); break; case -4: _address->setFocus(); break; case -5: _expireMonth->setFocus(); break; case -6: _expireYear->setFocus(); break; default: done(result); } } void creditCard::populate() { XSqlQuery creditpopulate; QString key; key = omfgThis->_key; creditpopulate.prepare( "SELECT ccard_active," " formatbytea(decrypt(setbytea(ccard_name), setbytea(:key), 'bf')) AS ccard_name," " formatbytea(decrypt(setbytea(ccard_address1), setbytea(:key), 'bf')) AS ccard_address1," " formatbytea(decrypt(setbytea(ccard_address2), setbytea(:key), 'bf')) AS ccard_address2," " formatbytea(decrypt(setbytea(ccard_city), setbytea(:key), 'bf')) AS ccard_city," " formatbytea(decrypt(setbytea(ccard_state), setbytea(:key), 'bf')) AS ccard_state," " formatbytea(decrypt(setbytea(ccard_zip), setbytea(:key), 'bf')) AS ccard_zip," " formatbytea(decrypt(setbytea(ccard_country), setbytea(:key), 'bf')) AS ccard_country," " formatccnumber(decrypt(setbytea(ccard_number), setbytea(:key), 'bf')) AS ccard_number," " ccard_debit," " formatbytea(decrypt(setbytea(ccard_month_expired), setbytea(:key), 'bf')) AS ccard_month_expired," " formatbytea(decrypt(setbytea(ccard_year_expired), setbytea(:key), 'bf')) AS ccard_year_expired," " ccard_type " "FROM ccard " "WHERE (ccard_id=:ccard_id);" ); creditpopulate.bindValue(":ccard_id", _ccardid); creditpopulate.bindValue(":key",key); creditpopulate.exec(); if (creditpopulate.first()) { // _custNum->setText(creditpopulate.value("cust_number").toString()); // _custName->setText(creditpopulate.value("cust_name").toString()); _active->setChecked(creditpopulate.value("ccard_active").toBool()); _creditCardNumber->setText(creditpopulate.value("ccard_number")); _name->setText(creditpopulate.value("ccard_name")); _address->setLine1(creditpopulate.value("ccard_address1").toString()); _address->setLine2(creditpopulate.value("ccard_address2").toString()); _address->setCity(creditpopulate.value("ccard_city").toString()); _address->setState(creditpopulate.value("ccard_state").toString()); _address->setPostalCode(creditpopulate.value("ccard_zip").toString()); _address->setCountry(creditpopulate.value("ccard_country").toString()); _expireMonth->setText(creditpopulate.value("ccard_month_expired").toString()); _expireYear->setText(creditpopulate.value("ccard_year_expired").toString()); for (int counter = 0; counter < _fundsType2->count(); counter++) if (QString(creditpopulate.value("ccard_type").toString()[0]) == _fundsTypes2[counter]) _fundsType2->setCurrentIndex(counter); } else if (creditpopulate.lastError().type() != QSqlError::NoError) { systemError(this, creditpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/creditCard.h000066400000000000000000000033721217451700100176170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREDITCARD_H #define CREDITCARD_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_creditCard.h" class creditCard : public XDialog, public Ui::creditCard { Q_OBJECT public: creditCard(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~creditCard(); virtual SetResponse set(const ParameterList & pParams ); static int saveCreditCard(QWidget *parent, int &custId, QString &ccName, QString &ccAddress1, QString &ccAddress2, QString &ccCity, QString &ccState, QString &ccZip, QString &ccCountry, QString &ccNumber, QString &ccType, QString &ccExpireMonth, QString &ccExpireYear, int &ccId, bool ccActive = true ); public slots: virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _ccardid; int _custid; int _mode; }; #endif // CREDITCARD_H qt-client-4.1.0/guiclient/creditCard.ui000066400000000000000000000342421217451700100200050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. creditCard 0 0 533 369 0 0 Credit Card 5 5 0 5 0 0 0 5 0 0 Customer #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _custNum Qt::Vertical QSizePolicy::Preferred 20 20 0 0 7 5 0 0 7 5 0 0 Qt::Vertical QSizePolicy::Preferred 20 20 0 5 &Cancel &Save true true 0 0 0 5 0 5 5 0 0 0 Expiration Year: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _expireYear 0 5 0 0 0 0 0 0 Active true Qt::Horizontal QSizePolicy::Preferred 0 10 Qt::Vertical QSizePolicy::Expanding 20 20 Credit Card Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _creditCardNumber 0 5 Credit Card Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _creditCardNumber &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Master Card Visa American Express Discover 5 0 0 0 Expiration Month: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _expireMonth Qt::StrongFocus Qt::Vertical QSizePolicy::Expanding 20 21 AddressCluster QWidget

    addresscluster.h
    0 XComboBox QComboBox
    xcombobox.h
    0
    XLineEdit QLineEdit
    xlineedit.h
    0
    _fundsType2 _creditCardNumber _name _address _active _expireMonth _expireYear _save _close _close clicked() creditCard reject() 20 20 20 20 qt-client-4.1.0/guiclient/creditMemo.cpp000066400000000000000000001077501217451700100202030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "creditMemo.h" #include #include #include #include #include #include "creditMemoItem.h" #include "invoiceList.h" #include "storedProcErrorLookup.h" #include "taxBreakdown.h" creditMemo::creditMemo(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_memoNumber, SIGNAL(editingFinished()), this, SLOT(sCheckCreditMemoNumber())); connect(_copyToShipto, SIGNAL(clicked()), this, SLOT(sCopyToShipto())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_invoiceList, SIGNAL(clicked()), this, SLOT(sInvoiceList())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_shipTo, SIGNAL(newId(int)), this, SLOT(populateShipto(int))); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_subtotal, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_tax, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_miscCharge, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); connect(_taxzone, SIGNAL(newID(int)), this, SLOT(sTaxZoneChanged())); connect(_cust, SIGNAL(newCrmacctId(int)), _billToAddr, SLOT(setSearchAcct(int))); connect(_cust, SIGNAL(newCrmacctId(int)), _shipToAddr, SLOT(setSearchAcct(int))); connect(_cust, SIGNAL(newId(int)), _shipTo, SLOT(setCustid(int))); connect(_shipToName, SIGNAL(textChanged(QString)), this, SLOT(sConvertShipto())); connect(_shipToAddr, SIGNAL(changed()), this, SLOT(sConvertShipto())); #ifndef Q_WS_MAC _invoiceList->setMaximumWidth(25); #endif _custtaxzoneid = -1; _freightCache = 0; _taxzoneidCache = -1; _NumberGen = -1; _memoNumber->setValidator(omfgThis->orderVal()); _commission->setValidator(omfgThis->scrapVal()); _currency->setLabel(_currencyLit); _shipTo->setNameVisible(false); _shipTo->setDescriptionVisible(false); _cmitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "cmitem_linenumber" ); _cmitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _cmitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); _cmitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _cmitem->addColumn(tr("Qty UOM"), _uomColumn, Qt::AlignLeft, true, "qtyuom" ); _cmitem->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, true, "cmitem_qtyreturned" ); _cmitem->addColumn(tr("Credited"), _qtyColumn, Qt::AlignRight, true, "cmitem_qtycredit" ); _cmitem->addColumn(tr("Price UOM"), _uomColumn, Qt::AlignLeft, true, "priceuom" ); _cmitem->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "cmitem_unitprice" ); _cmitem->addColumn(tr("Extended"), _moneyColumn, Qt::AlignRight, true, "extprice" ); _miscChargeAccount->setType(GLCluster::cRevenue | GLCluster::cExpense); } creditMemo::~creditMemo() { // no need to delete child widgets, Qt does it all for us } void creditMemo::languageChange() { retranslateUi(this); } enum SetResponse creditMemo::set(const ParameterList &pParams) { XSqlQuery creditet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("cmhead_id", &valid); if (valid) { _cmheadid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { _mode = cNew; if (param.toString() == "new") { creditet.prepare("SELECT NEXTVAL('cmhead_cmhead_id_seq') AS cmhead_id;"); creditet.exec(); if (creditet.first()) _cmheadid = creditet.value("cmhead_id").toInt(); else if (creditet.lastError().type() != QSqlError::NoError) { systemError(this, creditet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } setNumber(); _memoDate->setDate(omfgThis->dbDate(), true); creditet.prepare("INSERT INTO cmhead (" " cmhead_id, cmhead_number, cmhead_docdate, cmhead_posted" ") VALUES (" " :cmhead_id, :cmhead_number, :cmhead_docdate, false" ");"); creditet.bindValue(":cmhead_id", _cmheadid); creditet.bindValue(":cmhead_number", (!_memoNumber->text().isEmpty() ? _memoNumber->text() : QString("tmp%1").arg(_cmheadid))); creditet.bindValue(":cmhead_docdate", _memoDate->date()); creditet.exec(); if (creditet.lastError().type() != QSqlError::NoError) { systemError(this, creditet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustomerInfo())); connect(_cust, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _mode = cEdit; _memoNumber->setEnabled(FALSE); _cust->setReadOnly(TRUE); _invoiceNumber->setEnabled(FALSE); _invoiceList->hide(); _new->setEnabled(TRUE); } else if (param.toString() == "view") { _mode = cView; _memoNumber->setEnabled(FALSE); _memoDate->setEnabled(FALSE); _cust->setReadOnly(TRUE); _invoiceNumber->setEnabled(FALSE); _salesRep->setEnabled(FALSE); _commission->setEnabled(FALSE); _billtoName->setEnabled(FALSE); _billToAddr->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _rsnCode->setEnabled(FALSE); _customerPO->setEnabled(FALSE); _hold->setEnabled(FALSE); _miscCharge->setEnabled(FALSE); _miscChargeDescription->setEnabled(FALSE); _miscChargeAccount->setReadOnly(TRUE); _freight->setEnabled(FALSE); _comments->setEnabled(FALSE); _invoiceList->hide(); _shipTo->setEnabled(FALSE); _shipToName->setEnabled(FALSE); _shipToAddr->setEnabled(FALSE); _currency->setEnabled(FALSE); _shippingZone->setEnabled(FALSE); _saleType->setEnabled(FALSE); _save->hide(); _new->hide(); _delete->hide(); _edit->setText(tr("&View")); disconnect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_edit, SIGNAL(clicked()), this, SLOT(sView())); } } param = pParams.value("cust_id", &valid); if(cNew == _mode && valid) _cust->setId(param.toInt()); return NoError; } void creditMemo::setNumber() { XSqlQuery creditetNumber; if ( (_metrics->value("CMNumberGeneration") == "A") || (_metrics->value("CMNumberGeneration") == "O") ) { creditetNumber.prepare("SELECT fetchCmNumber() AS cmnumber;"); creditetNumber.exec(); if (creditetNumber.first()) { _memoNumber->setText(creditetNumber.value("cmnumber").toString()); _NumberGen = creditetNumber.value("cmnumber").toInt(); if (_metrics->value("CMNumberGeneration") == "A") _memoNumber->setEnabled(FALSE); } else if (creditetNumber.lastError().type() != QSqlError::NoError) { systemError(this, creditetNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (_metrics->value("CMNumberGeneration") == "S") { creditetNumber.prepare("SELECT fetchSoNumber() AS cmnumber;"); creditetNumber.exec(); if (creditetNumber.first()) { _memoNumber->setText(creditetNumber.value("cmnumber").toString()); _NumberGen = creditetNumber.value("cmnumber").toInt(); _memoNumber->setEnabled(FALSE); } else if (creditetNumber.lastError().type() != QSqlError::NoError) { systemError(this, creditetNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } else _memoNumber->setFocus(); } void creditMemo::sSave() { // Make sure that all of the required field have been populated if (_memoNumber->text().length() == 0) { QMessageBox::warning( this, tr("Invalid Memo # Entered"), tr( "

    You must enter a valid Memo # for this Credit " "Memo before you may save it." ) ); _memoNumber->setFocus(); return; } if ( _mode == cNew && ( (_metrics->value("CMNumberGeneration") == "O") || (_metrics->value("CMNumberGeneration") == "M") ) ) { XSqlQuery query; query.prepare( "SELECT cmhead_id " "FROM cmhead " "WHERE (cmhead_number=:cmhead_number)" " AND (cmhead_id !=:cmhead_id);" ); query.bindValue(":cmhead_number", _memoNumber->text()); query.bindValue(":cmhead_id", _cmheadid); query.exec(); if (query.first()) { QMessageBox::warning( this, tr("Invalid Memo # Entered"), tr( "

    The Memo # is already in use. " "You must enter an unused Memo # for this Credit " "Memo before you may save it." ) ); _memoNumber->setFocus(); return; } } if (!_cust->isValid()) { QMessageBox::information(this, tr("Select a Customer"), tr("Please select a Customer before continuing.") ); _cust->setFocus(); return; } if ( ! _miscCharge->isZero() && (!_miscChargeAccount->isValid()) ) { QMessageBox::warning( this, tr("No Misc. Charge Account Number"), tr("

    You may not enter a Misc. Charge without " "indicating the G/L Sales Account number for the " "charge. Please set the Misc. Charge amount to 0 " "or select a Misc. Charge Sales Account." ) ); _creditMemoInformation->setCurrentIndex(_creditMemoInformation->indexOf(_itemsTab)); _miscChargeAccount->setFocus(); return; } if (_total->localValue() < 0 ) { QMessageBox::information(this, tr("Total Less than Zero"), tr("

    The Total must be a positive value.") ); _cust->setFocus(); return; } // save address info in case someone wants to use 'em again later // but don't make any global changes to the data and ignore errors _billToAddr->save(AddressCluster::CHANGEONE); _shipToAddr->save(AddressCluster::CHANGEONE); // finally save the cmhead if (!save()) return; omfgThis->sCreditMemosUpdated(); _cmheadid = -1; close(); } bool creditMemo::save() { XSqlQuery creditave; creditave.prepare( "UPDATE cmhead " "SET cmhead_invcnumber=:cmhead_invcnumber, cmhead_cust_id=:cmhead_cust_id," " cmhead_number=:cmhead_number," " cmhead_custponumber=:cmhead_custponumber, cmhead_hold=:cmhead_hold," " cmhead_billtoname=:cmhead_billtoname, cmhead_billtoaddress1=:cmhead_billtoaddress1," " cmhead_billtoaddress2=:cmhead_billtoaddress2, cmhead_billtoaddress3=:cmhead_billtoaddress3," " cmhead_billtocity=:cmhead_billtocity, cmhead_billtostate=:cmhead_billtostate," " cmhead_billtozip=:cmhead_billtozip," " cmhead_billtocountry=:cmhead_billtocountry," " cmhead_shipto_id=:cmhead_shipto_id," " cmhead_shipto_name=:cmhead_shipto_name, cmhead_shipto_address1=:cmhead_shipto_address1," " cmhead_shipto_address2=:cmhead_shipto_address2, cmhead_shipto_address3=:cmhead_shipto_address3," " cmhead_shipto_city=:cmhead_shipto_city, cmhead_shipto_state=:cmhead_shipto_state," " cmhead_shipto_zipcode=:cmhead_shipto_zipcode," " cmhead_shipto_country=:cmhead_shipto_country," " cmhead_docdate=:cmhead_docdate," " cmhead_salesrep_id=:cmhead_salesrep_id, cmhead_commission=:cmhead_commission," " cmhead_misc=:cmhead_misc, cmhead_misc_accnt_id=:cmhead_misc_accnt_id," " cmhead_misc_descrip=:cmhead_misc_descrip," " cmhead_freight=:cmhead_freight," " cmhead_taxzone_id=:cmhead_taxzone_id," " cmhead_comments=:cmhead_comments, " " cmhead_rsncode_id=:cmhead_rsncode_id, " " cmhead_curr_id=:cmhead_curr_id, " " cmhead_prj_id=:cmhead_prj_id," " cmhead_shipzone_id=:cmhead_shipzone_id," " cmhead_saletype_id=:cmhead_saletype_id " "WHERE (cmhead_id=:cmhead_id);" ); creditave.bindValue(":cmhead_id", _cmheadid); creditave.bindValue(":cmhead_cust_id", _cust->id()); creditave.bindValue(":cmhead_number", _memoNumber->text()); creditave.bindValue(":cmhead_invcnumber", _invoiceNumber->invoiceNumber()); creditave.bindValue(":cmhead_custponumber", _customerPO->text().trimmed()); creditave.bindValue(":cmhead_billtoname", _billtoName->text().trimmed()); creditave.bindValue(":cmhead_billtoaddress1", _billToAddr->line1()); creditave.bindValue(":cmhead_billtoaddress2", _billToAddr->line2()); creditave.bindValue(":cmhead_billtoaddress3", _billToAddr->line3()); creditave.bindValue(":cmhead_billtocity", _billToAddr->city()); creditave.bindValue(":cmhead_billtostate", _billToAddr->state()); creditave.bindValue(":cmhead_billtozip", _billToAddr->postalCode()); creditave.bindValue(":cmhead_billtocountry", _billToAddr->country()); if (_shipTo->id() > 0) creditave.bindValue(":cmhead_shipto_id", _shipTo->id()); creditave.bindValue(":cmhead_shipto_name", _shipToName->text().trimmed()); creditave.bindValue(":cmhead_shipto_address1", _shipToAddr->line1()); creditave.bindValue(":cmhead_shipto_address2", _shipToAddr->line2()); creditave.bindValue(":cmhead_shipto_address3", _shipToAddr->line3()); creditave.bindValue(":cmhead_shipto_city", _shipToAddr->city()); creditave.bindValue(":cmhead_shipto_state", _shipToAddr->state()); creditave.bindValue(":cmhead_shipto_zipcode", _shipToAddr->postalCode()); creditave.bindValue(":cmhead_shipto_country", _shipToAddr->country()); creditave.bindValue(":cmhead_docdate", _memoDate->date()); creditave.bindValue(":cmhead_comments", _comments->toPlainText()); creditave.bindValue(":cmhead_salesrep_id", _salesRep->id()); creditave.bindValue(":cmhead_rsncode_id", _rsnCode->id()); creditave.bindValue(":cmhead_hold", QVariant(_hold->isChecked())); creditave.bindValue(":cmhead_commission", (_commission->toDouble() / 100)); creditave.bindValue(":cmhead_misc", _miscCharge->localValue()); creditave.bindValue(":cmhead_misc_accnt_id", _miscChargeAccount->id()); creditave.bindValue(":cmhead_misc_descrip", _miscChargeDescription->text()); creditave.bindValue(":cmhead_freight", _freight->localValue()); if (_taxzone->isValid()) creditave.bindValue(":cmhead_taxzone_id", _taxzone->id()); creditave.bindValue(":cmhead_curr_id", _currency->id()); if (_project->isValid()) creditave.bindValue(":cmhead_prj_id", _project->id()); if(_shippingZone->isValid()) creditave.bindValue(":cmhead_shipzone_id", _shippingZone->id()); if(_saleType->isValid()) creditave.bindValue(":cmhead_saletype_id", _saleType->id()); creditave.exec(); if (creditave.lastError().type() != QSqlError::NoError) { systemError(this, creditave.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void creditMemo::sInvoiceList() { ParameterList params; params.append("cust_id", _cust->id()); params.append("invoiceNumber", _invoiceNumber->invoiceNumber()); invoiceList newdlg(this, "", TRUE); newdlg.set(params); int invoiceid = newdlg.exec(); if (invoiceid != 0) { XSqlQuery sohead; sohead.prepare( "SELECT invchead.* " "FROM invchead " "WHERE (invchead_id=:invcid) " "LIMIT 1;" ); sohead.bindValue(":invcid", invoiceid); sohead.exec(); if (sohead.first()) { _cust->setEnabled(FALSE); _billtoName->setEnabled(FALSE); _billToAddr->setEnabled(FALSE); _cust->setId(sohead.value("invchead_cust_id").toInt()); _billtoName->setText(sohead.value("invchead_billto_name")); _billToAddr->setLine1(sohead.value("invchead_billto_address1").toString()); _billToAddr->setLine2(sohead.value("invchead_billto_address2").toString()); _billToAddr->setLine3(sohead.value("invchead_billto_address3").toString()); _billToAddr->setCity(sohead.value("invchead_billto_city").toString()); _billToAddr->setState(sohead.value("invchead_billto_state").toString()); _billToAddr->setPostalCode(sohead.value("invchead_billto_zipcode").toString()); _billToAddr->setCountry(sohead.value("invchead_billto_country").toString()); _shipTo->setEnabled(FALSE); _shipToName->setEnabled(FALSE); _shipToAddr->setEnabled(FALSE); _ignoreShiptoSignals = TRUE; _shipToName->setText(sohead.value("invchead_shipto_name")); _shipToAddr->setLine1(sohead.value("invchead_shipto_address1").toString()); _shipToAddr->setLine2(sohead.value("invchead_shipto_address2").toString()); _shipToAddr->setLine3(sohead.value("invchead_shipto_address3").toString()); _shipToAddr->setCity(sohead.value("invchead_shipto_city").toString()); _shipToAddr->setState(sohead.value("invchead_shipto_state").toString()); _shipToAddr->setPostalCode(sohead.value("invchead_shipto_zipcode").toString()); _shipToAddr->setCountry(sohead.value("invchead_shipto_country").toString()); _ignoreShiptoSignals = FALSE; _invoiceNumber->setInvoiceNumber(sohead.value("invchead_invcnumber").toString()); _salesRep->setId(sohead.value("invchead_salesrep_id").toInt()); _commission->setDouble(sohead.value("invchead_commission").toDouble() * 100); _taxzoneidCache = sohead.value("invchead_taxzone_id").toInt(); _taxzone->setId(sohead.value("invchead_taxzone_id").toInt()); _customerPO->setText(sohead.value("invchead_ponumber")); _project->setId(sohead.value("invchead_prj_id").toInt()); } else if (sohead.lastError().type() != QSqlError::NoError) { systemError(this, sohead.lastError().databaseText(), __FILE__, __LINE__); return; } } } void creditMemo::populateShipto(int pShiptoid) { if (pShiptoid != -1) { XSqlQuery query; query.prepare( "SELECT * " "FROM shiptoinfo " "WHERE (shipto_id=:shipto_id);" ); query.bindValue(":shipto_id", pShiptoid); query.exec(); if (query.first()) { _ignoreShiptoSignals = true; _shipTo->setId(query.value("shipto_id").toInt()); _shipToName->setText(query.value("shipto_name")); _shipToAddr->setId(query.value("shipto_addr_id").toInt()); _ignoreShiptoSignals = false; _taxzoneidCache = query.value("shipto_taxzone_id").toInt(); _taxzone->setId(query.value("shipto_taxzone_id").toInt()); _salesRep->setId(query.value("shipto_salesrep_id").toInt()); _commission->setDouble(query.value("shipto_commission").toDouble() * 100); _shippingZone->setId(query.value("shipto_shipzone_id").toInt()); } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _shipTo->setId(-1); _shipToName->clear(); _shipToAddr->clear(); } } void creditMemo::sPopulateCustomerInfo() { if (!_invoiceNumber->isValid()) { if (_cust->isValid()) { XSqlQuery query; query.prepare( "SELECT cust_salesrep_id," " cust_commprcnt," " cust_taxzone_id, cust_curr_id, " " cust_name, cntct_addr_id, " " cust_ffshipto, cust_ffbillto, " " COALESCE(shipto_id, -1) AS shiptoid " "FROM custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) " " LEFT OUTER JOIN shiptoinfo ON ((shipto_cust_id=cust_id) " " AND (shipto_default)) " "WHERE (cust_id=:cust_id);" ); query.bindValue(":cust_id", _cust->id()); query.exec(); if (query.first()) { _ffShipto = query.value("cust_ffshipto").toBool(); _copyToShipto->setEnabled(_ffShipto); _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _salesRep->setId(query.value("cust_salesrep_id").toInt()); _commission->setDouble(query.value("cust_commprcnt").toDouble() * 100); _taxzoneidCache = query.value("cust_taxzone_id").toInt(); _custtaxzoneid = query.value("cust_taxzone_id").toInt(); _taxzone->setId(query.value("cust_taxzone_id").toInt()); _currency->setId(query.value("cust_curr_id").toInt()); _billtoName->setText(query.value("cust_name")); _billToAddr->setId(query.value("cntct_addr_id").toInt()); bool ffBillTo; if ( (_mode == cNew) || (_mode == cEdit) ) ffBillTo = query.value("cust_ffbillto").toBool(); else ffBillTo = FALSE; _billtoName->setEnabled(ffBillTo); _billToAddr->setEnabled(ffBillTo); if ((cNew == _mode) && (query.value("shiptoid").toInt() != -1)) populateShipto(query.value("shiptoid").toInt()); } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _salesRep->setCurrentIndex(-1); _taxzoneidCache = -1; _custtaxzoneid = -1; _taxzone->setId(-1); _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _shipTo->setId(-1); _shipToName->clear(); _shipToAddr->clear(); } } } void creditMemo::sCheckCreditMemoNumber() { qDebug("_numbergen->%d, memo#->%d", _NumberGen, _memoNumber->text().toInt()); if (-1 != _NumberGen && _NumberGen != _memoNumber->text().toInt()) sReleaseNumber(); if ( (_memoNumber->text().length()) && _mode != cNew && ( (_metrics->value("CMNumberGeneration") == "O") || (_metrics->value("CMNumberGeneration") == "M") ) ) { _memoNumber->setEnabled(FALSE); XSqlQuery query; query.prepare( "SELECT cmhead_id, cmhead_posted " "FROM cmhead " "WHERE (cmhead_number=:cmhead_number)" ); query.bindValue(":cmhead_number", _memoNumber->text()); query.exec(); if (query.first()) { _cmheadid = query.value("cmhead_id").toInt(); _cust->setReadOnly(TRUE); populate(); if (query.value("cmhead_posted").toBool()) { _memoDate->setEnabled(FALSE); _invoiceNumber->setEnabled(FALSE); _salesRep->setEnabled(FALSE); _commission->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _customerPO->setEnabled(FALSE); _hold->setEnabled(FALSE); _miscCharge->setEnabled(FALSE); _miscChargeDescription->setEnabled(FALSE); _miscChargeAccount->setReadOnly(TRUE); _freight->setEnabled(FALSE); _comments->setReadOnly(TRUE); _invoiceList->hide(); _shipTo->setEnabled(FALSE); _shipToName->setEnabled(FALSE); _cmitem->setEnabled(FALSE); _save->hide(); _new->hide(); _delete->hide(); _edit->hide(); _mode = cView; } else _mode = cEdit; } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } } void creditMemo::sConvertShipto() { if (!_ignoreShiptoSignals) { // Convert the captive shipto to a free-form shipto _shipTo->blockSignals(true); _shipTo->setId(-1); _shipTo->setCustid(_cust->id()); _shipTo->blockSignals(false); } } void creditMemo::sCopyToShipto() { _shipTo->setId(-1); _shipToName->setText(_billtoName->text()); if (_billToAddr->id() > 0) _shipToAddr->setId(_billToAddr->id()); else { _shipToAddr->setLine1(_billToAddr->line1()); _shipToAddr->setLine2(_billToAddr->line2()); _shipToAddr->setLine3(_billToAddr->line1()); _shipToAddr->setCity(_billToAddr->city()); _shipToAddr->setState(_billToAddr->state()); _shipToAddr->setPostalCode(_billToAddr->postalCode()); _shipToAddr->setCountry(_billToAddr->country()); } _taxzoneidCache = _custtaxzoneid; _taxzone->setId(_custtaxzoneid); } void creditMemo::sNew() { if (!save()) return; ParameterList params; params.append("mode", "new"); params.append("cmhead_id", _cmheadid); creditMemoItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void creditMemo::sEdit() { if (!save()) return; ParameterList params; params.append("mode", "edit"); params.append("cmhead_id", _cmheadid); params.append("cmitem_id", _cmitem->id()); creditMemoItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void creditMemo::sView() { ParameterList params; params.append("mode", "view"); params.append("cmhead_id", _cmheadid); params.append("cmitem_id", _cmitem->id()); creditMemoItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void creditMemo::sDelete() { XSqlQuery creditDelete; creditDelete.prepare( "SELECT cmhead_posted " "FROM cmitem, cmhead " "WHERE ( (cmitem_cmhead_id=cmhead_id)" " AND (cmitem_id=:cmitem_id) );" ); creditDelete.bindValue(":cmitem_id", _cmitem->id()); creditDelete.exec(); if (creditDelete.first()) { if (creditDelete.value("cmhead_posted").toBool()) { QMessageBox::information(this, "Line Item cannot be delete", tr("

    This Credit Memo has been Posted and " "this cannot be modified.") ); return; } } else if (creditDelete.lastError().type() != QSqlError::NoError) { systemError(this, creditDelete.lastError().databaseText(), __FILE__, __LINE__); return; } if (QMessageBox::question(this, "Delete current Line Item?", tr("

    Are you sure that you want to delete the " "current Line Item?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { creditDelete.prepare( "DELETE FROM cmitem " "WHERE (cmitem_id=:cmitem_id);" ); creditDelete.bindValue(":cmitem_id", _cmitem->id()); creditDelete.exec(); if (creditDelete.lastError().type() != QSqlError::NoError) { systemError(this, creditDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void creditMemo::sFillList() { XSqlQuery creditFillList; creditFillList.prepare( "SELECT cmitem_id, cmitem_linenumber, item_number," " (item_descrip1 || ' ' || item_descrip2) AS description," " warehous_code, quom.uom_name AS qtyuom," " cmitem_qtyreturned, cmitem_qtycredit," " puom.uom_name AS priceuom," " cmitem_unitprice," " (cmitem_qtycredit * cmitem_qty_invuomratio) *" " (cmitem_unitprice / cmitem_price_invuomratio) AS extprice," " 'qty' AS cmitem_qtyreturned_xtnumericrole," " 'qty' AS cmitem_qtycredit_xtnumericrole," " 'salesprice' AS cmitem_unitprice_xtnumericrole," " 'curr' AS extprice_xtnumericrole " "FROM cmitem, itemsite, item, whsinfo, uom AS quom, uom AS puom " "WHERE ( (cmitem_itemsite_id=itemsite_id)" " AND (cmitem_qty_uom_id=quom.uom_id)" " AND (cmitem_price_uom_id=puom.uom_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (cmitem_cmhead_id=:cmhead_id) ) " "ORDER BY cmitem_linenumber;" ); creditFillList.bindValue(":cmhead_id", _cmheadid); creditFillList.exec(); if (creditFillList.lastError().type() != QSqlError::NoError) systemError(this, creditFillList.lastError().databaseText(), __FILE__, __LINE__); _cmitem->populate(creditFillList); if (creditFillList.lastError().type() != QSqlError::NoError) { systemError(this, creditFillList.lastError().databaseText(), __FILE__, __LINE__); return; } sCalculateSubtotal(); sCalculateTax(); _currency->setEnabled(_cmitem->topLevelItemCount() == 0); } void creditMemo::sCalculateSubtotal() { // Determine the subtotal and line item tax XSqlQuery query; query.prepare( "SELECT SUM(round((cmitem_qtycredit * cmitem_qty_invuomratio) * (cmitem_unitprice / cmitem_price_invuomratio), 2)) AS subtotal " "FROM cmitem, itemsite, item " "WHERE ( (cmitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (cmitem_cmhead_id=:cmhead_id) );" ); query.bindValue(":cmhead_id", _cmheadid); query.exec(); if (query.first()) _subtotal->setLocalValue(query.value("subtotal").toDouble()); } void creditMemo::sCalculateTotal() { _total->setLocalValue(_subtotal->localValue() + _tax->localValue() + _freight->localValue() + _miscCharge->localValue() ); } void creditMemo::populate() { XSqlQuery cmhead; cmhead.prepare( "SELECT cmhead.*," " cust_name, cust_ffbillto, cust_ffshipto " "FROM custinfo, cmhead " "WHERE ( (cmhead_cust_id=cust_id)" " AND (cmhead_id=:cmhead_id) );" ); cmhead.bindValue(":cmhead_id", _cmheadid); cmhead.exec(); if (cmhead.first()) { if (cmhead.value("cmhead_posted").toBool()) _status->setText(tr("Posted")); else _status->setText(tr("Unposted")); _cust->setId(cmhead.value("cmhead_cust_id").toInt()); _shipTo->setId(cmhead.value("cmhead_shipto_id").toInt()); _salesRep->setId(cmhead.value("cmhead_salesrep_id").toInt()); _commission->setDouble(cmhead.value("cmhead_commission").toDouble() * 100); // do taxauth first so we can overwrite the result of the signal cascade _taxzoneidCache = cmhead.value("cmhead_taxzone_id").toInt(); if (!cmhead.value("cmhead_taxzone_id").isNull() && cmhead.value("cmhead_taxzone_id").toInt() != -1) _taxzone->setId(cmhead.value("cmhead_taxzone_id").toInt()); _memoNumber->setText(cmhead.value("cmhead_number")); _memoDate->setDate(cmhead.value("cmhead_docdate").toDate(), true); _customerPO->setText(cmhead.value("cmhead_custponumber")); _hold->setChecked(cmhead.value("cmhead_hold").toBool()); _currency->setId(cmhead.value("cmhead_curr_id").toInt()); _freightCache = cmhead.value("cmhead_freight").toDouble(); _freight->setLocalValue(cmhead.value("cmhead_freight").toDouble()); _miscCharge->setLocalValue(cmhead.value("cmhead_misc").toDouble()); _miscChargeDescription->setText(cmhead.value("cmhead_misc_descrip")); _miscChargeAccount->setId(cmhead.value("cmhead_misc_accnt_id").toInt()); _comments->setText(cmhead.value("cmhead_comments").toString()); bool ffBillTo = cmhead.value("cust_ffbillto").toBool(); _billtoName->setEnabled(ffBillTo); _billToAddr->setEnabled(ffBillTo); _billtoName->setText(cmhead.value("cmhead_billtoname")); _billToAddr->setLine1(cmhead.value("cmhead_billtoaddress1").toString()); _billToAddr->setLine2(cmhead.value("cmhead_billtoaddress2").toString()); _billToAddr->setLine3(cmhead.value("cmhead_billtoaddress3").toString()); _billToAddr->setCity(cmhead.value("cmhead_billtocity").toString()); _billToAddr->setState(cmhead.value("cmhead_billtostate").toString()); _billToAddr->setPostalCode(cmhead.value("cmhead_billtozip").toString()); _billToAddr->setCountry(cmhead.value("cmhead_billtocountry").toString()); _ffShipto = cmhead.value("cust_ffshipto").toBool(); _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _shipToName->setText(cmhead.value("cmhead_shipto_name")); _shipToAddr->setLine1(cmhead.value("cmhead_shipto_address1").toString()); _shipToAddr->setLine2(cmhead.value("cmhead_shipto_address2").toString()); _shipToAddr->setLine3(cmhead.value("cmhead_shipto_address3").toString()); _shipToAddr->setCity(cmhead.value("cmhead_shipto_city").toString()); _shipToAddr->setState(cmhead.value("cmhead_shipto_state").toString()); _shipToAddr->setPostalCode(cmhead.value("cmhead_shipto_zipcode").toString()); _shipToAddr->setCountry(cmhead.value("cmhead_shipto_country").toString()); if (!cmhead.value("cmhead_rsncode_id").isNull() && cmhead.value("cmhead_rsncode_id").toInt() != -1) _rsnCode->setId(cmhead.value("cmhead_rsncode_id").toInt()); if (! cmhead.value("cmhead_invcnumber").toString().isEmpty()) _invoiceNumber->setInvoiceNumber(cmhead.value("cmhead_invcnumber").toString()); if (!cmhead.value("cmhead_prj_id").isNull()) _project->setId(cmhead.value("cmhead_prj_id").toInt()); _shippingZone->setId(cmhead.value("cmhead_shipzone_id").toInt()); _saleType->setId(cmhead.value("cmhead_saletype_id").toInt()); sCalculateTax(); } else if (cmhead.lastError().type() != QSqlError::NoError) { systemError(this, cmhead.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void creditMemo::closeEvent(QCloseEvent *pEvent) { XSqlQuery creditcloseEvent; if ( (_mode == cNew) && (_cmheadid != -1) ) { creditcloseEvent.prepare("SELECT deleteCreditMemo(:cmhead_id) AS result;"); creditcloseEvent.bindValue(":cmhead_id", _cmheadid); creditcloseEvent.exec(); if (creditcloseEvent.first()) ; // TODO: add error checking when function returns int instead of boolean else if (creditcloseEvent.lastError().type() != QSqlError::NoError) { systemError(this, creditcloseEvent.lastError().databaseText(), __FILE__, __LINE__); return; } if (-1 != _NumberGen) sReleaseNumber(); } XWidget::closeEvent(pEvent); } void creditMemo::sReleaseNumber() { XSqlQuery creditReleaseNumber; if ( (_metrics->value("CMNumberGeneration") == "A") || (_metrics->value("CMNumberGeneration") == "O") ) creditReleaseNumber.prepare("SELECT releaseCmNumber(:number) AS result;"); else if (_metrics->value("CMNumberGeneration") == "S") creditReleaseNumber.prepare("SELECT releaseSoNumber(:number) AS result;"); creditReleaseNumber.bindValue(":number", _NumberGen); creditReleaseNumber.exec(); if (creditReleaseNumber.lastError().type() != QSqlError::NoError) { systemError(this, creditReleaseNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } void creditMemo::sTaxDetail() { if (!save()) return; ParameterList params; params.append("order_id", _cmheadid); params.append("order_type", "CM"); params.append("sense", -1); if(cView == _mode) params.append("mode", "view"); else params.append("mode", "edit"); taxBreakdown newdlg(this, "", TRUE); if (newdlg.set(params) == NoError) { newdlg.exec(); populate(); } } void creditMemo::sCalculateTax() { XSqlQuery taxq; taxq.prepare( "SELECT SUM(tax) * -1 AS tax " "FROM (" "SELECT ROUND(SUM(taxdetail_tax),2) AS tax " "FROM tax " " JOIN calculateTaxDetailSummary('CM', :cmhead_id, 'T') ON (taxdetail_tax_id=tax_id)" "GROUP BY tax_id) AS data;" ); taxq.bindValue(":cmhead_id", _cmheadid); taxq.exec(); if (taxq.first()) _tax->setLocalValue(taxq.value("tax").toDouble()); else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } // changing _tax fires sCalculateTotal() } void creditMemo::sTaxZoneChanged() { if (_cmheadid != -1 && _taxzoneidCache != _taxzone->id()) { if (!save()) return; _taxzoneidCache = _taxzone->id(); sCalculateTax(); } } void creditMemo::sFreightChanged() { if (_cmheadid != -1 && _freightCache != _freight->localValue()) { if (!save()) return; _freightCache = _freight->localValue(); sCalculateTax(); sCalculateTotal(); } } qt-client-4.1.0/guiclient/creditMemo.h000066400000000000000000000036231217451700100176420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREDITMEMO_H #define CREDITMEMO_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_creditMemo.h" class creditMemo : public XWidget, public Ui::creditMemo { Q_OBJECT public: creditMemo(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~creditMemo(); virtual void setNumber(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCalculateTax(); virtual void sSave(); virtual void sInvoiceList(); virtual void populateShipto( int pShiptoid ); virtual void sPopulateCustomerInfo(); virtual void sCheckCreditMemoNumber(); virtual void sConvertShipto(); virtual void sCopyToShipto(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sCalculateSubtotal(); virtual void sCalculateTotal(); virtual void populate(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sTaxZoneChanged(); virtual void sTaxDetail(); virtual void sFreightChanged(); virtual void sReleaseNumber(); protected slots: virtual void languageChange(); private: int _mode; int _cmheadid; int _custtaxzoneid; bool _ffBillto; bool _ffShipto; bool _ignoreShiptoSignals; double _subtotalCache; double _freightCache; int _taxzoneidCache; bool save(); int _NumberGen; }; #endif // CREDITMEMO_H qt-client-4.1.0/guiclient/creditMemo.ui000066400000000000000000001235671217451700100200420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. creditMemo 0 0 994 593 Credit Memo 0 Qt::Horizontal QSizePolicy::Expanding 212 20 &Save &Close 0 Header Information 0 0 0 0 Memo #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 16777215 Apply To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 16777215 Qt::NoFocus ... Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 0 0 Memo Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billToAddr Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 0 Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billToAddr 0 0 true None XComboBox::TaxZones Reason Code: true XComboBox::ARCMReasonCodes Commission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 40 20 Qt::AlignRight 0 0 % Qt::AlignVCenter _billToAddr Qt::Horizontal QSizePolicy::Expanding 20 20 Sales Rep.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 XComboBox::SalesReps &Place on Hold Qt::Horizontal 0 20 Qt::Horizontal 0 20 Qt::Horizontal 0 20 Project: false XComboBox::SaleTypes true XComboBox::ShippingZones Sale Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Shipping Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Bill To 0 false false Qt::Horizontal QSizePolicy::Expanding 20 32 false Copy to Ship-to -> Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billtoName false Ship From 5 Ship From# false false Qt::Horizontal QSizePolicy::Expanding 20 0 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipToName false Cust. PO #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QSizePolicy::Expanding 20 13 Line Items 0 0 0 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Currencies Qt::Horizontal 40 20 Qt::Horizontal QSizePolicy::Expanding 41 20 Subtotal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Misc. Charge Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Misc. Charge: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true false false false Misc. Charge Credit Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false false &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Notes 5 5 true AddressCluster QWidget

    addresscluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    CustCluster QWidget
    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    GLCluster QWidget
    glcluster.h
    InvoiceLineEdit XLineEdit
    invoicelineedit.h
    ProjectCluster QWidget
    projectcluster.h
    ShiptoCluster QWidget
    shiptocluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _memoNumber _invoiceNumber _memoDate _salesRep _commission _taxzone _rsnCode _hold _project _cust _copyToShipto _billtoName _billToAddr _shipTo _shipToName _shipToAddr _customerPO _cmitem _new _edit _delete _currency _miscChargeDescription _miscChargeAccount _miscCharge _freight _total _comments _save _close _creditMemoInformation _cmitem itemSelected(int) _edit animateClick() 20 20 20 20 _close clicked() creditMemo close() 20 20 20 20 _memoDate newDate(QDate) _miscCharge setEffective(QDate) 20 20 20 20 _memoDate newDate(QDate) _total setEffective(QDate) 20 20 20 20 _memoDate newDate(QDate) _tax setEffective(QDate) 20 20 20 20 _memoDate newDate(QDate) _freight setEffective(QDate) 20 20 20 20 _memoDate newDate(QDate) _subtotal setEffective(QDate) 20 20 20 20 _cmitem valid(bool) _delete setEnabled(bool) 20 20 20 20 _cmitem valid(bool) _edit setEnabled(bool) 20 20 20 20 _currency newID(int) _total setId(int) 20 20 20 20 _currency newID(int) _tax setId(int) 20 20 20 20 _currency newID(int) _subtotal setId(int) 20 20 20 20 _currency newID(int) _miscCharge setId(int) 20 20 20 20 _currency newID(int) _freight setId(int) 20 20 20 20 qt-client-4.1.0/guiclient/creditMemoEditList.cpp000066400000000000000000000106651217451700100216430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "creditMemoEditList.h" #include #include #include #include #include #include #include #include "selectOrderForBilling.h" #include "selectBillingQty.h" #include "printInvoices.h" #include "creditMemo.h" #include "creditMemoItem.h" #include "mqlutil.h" creditMemoEditList::creditMemoEditList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_cmhead, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _cmhead->addColumn(tr("Document #"), (_itemColumn+_cmhead->indentation()), Qt::AlignLeft, true, "docnumber"); _cmhead->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "ordernumber"); _cmhead->addColumn(tr("Cust./Item #"), _itemColumn, Qt::AlignLeft, true, "custitemnumber"); _cmhead->addColumn(tr("Name/Description"), -1, Qt::AlignLeft, true, "namedescrip"); _cmhead->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); _cmhead->addColumn(tr("Qty. to Bill"), _qtyColumn, Qt::AlignRight, true, "qtytobill"); _cmhead->addColumn(tr("Price"), _costColumn, Qt::AlignRight, true, "price"); _cmhead->addColumn(tr("Ext. Price"), _moneyColumn, Qt::AlignRight, true, "extprice"); _cmhead->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currabbr"); connect(omfgThis, SIGNAL(creditMemosUpdated()), this, SLOT(sFillList())); sFillList(); } creditMemoEditList::~creditMemoEditList() { // no need to delete child widgets, Qt does it all for us } void creditMemoEditList::languageChange() { retranslateUi(this); } void creditMemoEditList::sEditCreditMemo() { if (!checkSitePrivs(_cmhead->id())) return; ParameterList params; params.append("mode", "edit"); params.append("cmhead_id", _cmhead->id()); creditMemo *newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void creditMemoEditList::sEditCreditMemoItem() { if (!checkSitePrivs(_cmhead->id())) return; ParameterList params; params.append("mode", "edit"); params.append("cmitem_id", _cmhead->altId()); creditMemoItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void creditMemoEditList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { _orderid = _cmhead->id(); pMenu->addAction(tr("Edit Credit Memo..."), this, SLOT(sEditCreditMemo())); if (((XTreeWidgetItem *)pSelected)->altId() != -1) pMenu->addAction(tr("Edit Credit Memo Item..."), this, SLOT(sEditCreditMemoItem())); } void creditMemoEditList::sFillList() { XSqlQuery creditFillList; ParameterList params; params.append("notassigned", tr("Not Assigned")); params.append("taxes", tr("Taxes")); params.append("debit", tr("Debit")); params.append("credit", tr("Credit")); MetaSQLQuery mql = mqlLoad("creditMemo", "editlist"); creditFillList = mql.toQuery(params); _cmhead->populate(creditFillList, true); if (creditFillList.lastError().type() != QSqlError::NoError) { systemError(this, creditFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void creditMemoEditList::sPrint() { orReport report("CreditMemoEditList"); if (report.isValid()) report.print(); else report.reportError(this); } bool creditMemoEditList::checkSitePrivs(int ordid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkCreditMemoSitePrivs(:cmheadid) AS result;"); check.bindValue(":cmheadid", ordid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Credit Memo as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/creditMemoEditList.h000066400000000000000000000023251217451700100213020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREDITMEMOEDITLIST_H #define CREDITMEMOEDITLIST_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_creditMemoEditList.h" class creditMemoEditList : public XWidget, public Ui::creditMemoEditList { Q_OBJECT public: creditMemoEditList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~creditMemoEditList(); virtual bool checkSitePrivs(int orderid); public slots: virtual void sEditCreditMemo(); virtual void sEditCreditMemoItem(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sFillList(); virtual void sPrint(); protected slots: virtual void languageChange(); private: int _orderid; int _itemtype; }; #endif // CREDITMEMOEDITLIST_H qt-client-4.1.0/guiclient/creditMemoEditList.ui000066400000000000000000000105611217451700100214710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. creditMemoEditList 0 0 773 351 Credit Memo Edit List 0 0 20 20 Expanding Horizontal 0 5 &Close &Print 0 0 Billing List: 7 7 0 0 0 100 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _cmhead _print _close parameter.h _close clicked() creditMemoEditList close()
    qt-client-4.1.0/guiclient/creditMemoItem.cpp000066400000000000000000000671621217451700100210240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "creditMemoItem.h" #include #include #include #include #include "priceList.h" #include "taxDetail.h" #include "xdoublevalidator.h" creditMemoItem::creditMemoItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); #ifndef Q_WS_MAC _listPrices->setMaximumWidth(25); #endif connect(_discountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_extendedPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateTax())); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateItemsiteInfo())); connect(_listPrices, SIGNAL(clicked()), this, SLOT(sListPrices())); connect(_netUnitPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateDiscountPrcnt())); connect(_netUnitPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateExtendedPrice())); connect(_netUnitPrice, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup())); connect(_qtyToCredit, SIGNAL(textChanged(const QString&)), this, SLOT(sCalculateExtendedPrice())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_taxType, SIGNAL(newID(int)), this, SLOT(sCalculateTax())); connect(_qtyUOM, SIGNAL(newID(int)), this, SLOT(sQtyUOMChanged())); connect(_pricingUOM, SIGNAL(newID(int)), this, SLOT(sPriceUOMChanged())); _mode = cNew; _cmitemid = -1; _cmheadid = -1; _custid = -1; _invoiceNumber = -1; _priceRatio = 1.0; _qtyShippedCache = 0.0; _shiptoid = -1; _taxzoneid = -1; _qtyinvuomratio = 1.0; _priceinvuomratio = 1.0; _invuomid = -1; _saved = false; _qtyToCredit->setValidator(omfgThis->qtyVal()); _qtyReturned->setValidator(omfgThis->qtyVal()); _qtyShipped->setPrecision(omfgThis->qtyVal()); _discountFromList->setPrecision(omfgThis->percentVal()); _discountFromSale->setValidator(new XDoubleValidator(-9999, 100, 2, this)); _taxType->setEnabled(_privileges->check("OverrideTax")); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } adjustSize(); } creditMemoItem::~creditMemoItem() { // no need to delete child widgets, Qt does it all for us } void creditMemoItem::languageChange() { retranslateUi(this); } enum SetResponse creditMemoItem::set(const ParameterList &pParams) { XSqlQuery creditet; XDialog::set(pParams); QVariant param; bool valid; bool vrestrict = FALSE; param = pParams.value("cmhead_id", &valid); if (valid) { _cmheadid = param.toInt(); creditet.prepare("SELECT cmhead_cust_id, cmhead_shipto_id, " " cmhead_number, COALESCE(cmhead_invcnumber, '-1') AS cmhead_invcnumber, " " cmhead_docdate, cmhead_curr_id, " " cmhead_taxzone_id, cmhead_rsncode_id " "FROM cmhead " "WHERE (cmhead_id=:cmhead_id);"); creditet.bindValue(":cmhead_id", _cmheadid); creditet.exec(); if (creditet.first()) { _custid = creditet.value("cmhead_cust_id").toInt(); _shiptoid = creditet.value("cmhead_shipto_id").toInt(); _orderNumber->setText(creditet.value("cmhead_number").toString()); _invoiceNumber = creditet.value("cmhead_invcnumber").toInt(); if ( (_invoiceNumber != -1) && (_metrics->boolean("RestrictCreditMemos")) ) vrestrict = TRUE; _taxzoneid = creditet.value("cmhead_taxzone_id").toInt(); _tax->setId(creditet.value("cmhead_curr_id").toInt()); _tax->setEffective(creditet.value("cmhead_docdate").toDate()); _netUnitPrice->setId(creditet.value("cmhead_curr_id").toInt()); _netUnitPrice->setEffective(creditet.value("cmhead_docdate").toDate()); _rsnCode->setId(creditet.value("cmhead_rsncode_id").toInt()); } else if (creditet.lastError().type() != QSqlError::NoError) { systemError(this, creditet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("cmitem_id", &valid); if (valid) { _cmitemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; creditet.prepare( "SELECT (COALESCE(MAX(cmitem_linenumber), 0) + 1) AS n_linenumber " "FROM cmitem " "WHERE (cmitem_cmhead_id=:cmhead_id);" ); creditet.bindValue(":cmhead_id", _cmheadid); creditet.exec(); if (creditet.first()) _lineNumber->setText(creditet.value("n_linenumber").toString()); else if (creditet.lastError().type() == QSqlError::NoError) { systemError(this, creditet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } connect(_discountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_item, SIGNAL(valid(bool)), _listPrices, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); connect(_discountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_item, SIGNAL(valid(bool)), _listPrices, SLOT(setEnabled(bool))); } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _qtyReturned->setEnabled(FALSE); _qtyToCredit->setEnabled(FALSE); _netUnitPrice->setEnabled(FALSE); _discountFromSale->setEnabled(FALSE); _comments->setReadOnly(TRUE); _taxType->setEnabled(FALSE); _rsnCode->setEnabled(FALSE); _save->hide(); _close->setText(tr("&Close")); } } if (vrestrict) _item->setQuery( QString( "SELECT DISTINCT item_id, item_number," " (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " item_upccode," " item_descrip1, item_descrip2," " item_active, item_config, item_type, uom_name, item_upccode " "FROM invchead, invcitem, item, uom " "WHERE ( (invcitem_invchead_id=invchead_id)" " AND (invcitem_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (invchead_invcnumber='%1') ) " "ORDER BY item_number" ) .arg(_invoiceNumber) ); else _item->addExtraClause( QString("(item_id IN (SELECT custitem FROM custitem(%1, %2) ) )").arg(_custid).arg(_shiptoid) ); return NoError; } void creditMemoItem::sSave() { XSqlQuery creditSave; if (_qtyToCredit->toDouble() == 0.0) { QMessageBox::warning(this, tr("Invalid Credit Quantity"), tr("

    You have not selected a quantity of the " "selected item to credit. If you wish to return a " "quantity to stock but not issue a Credit Memo " "then you should enter a Return to Stock " "transaction from the I/M module. Otherwise, you " "must enter a quantity to credit." )); _qtyToCredit->setFocus(); return; } if (_mode == cNew) { creditSave.exec("SELECT NEXTVAL('cmitem_cmitem_id_seq') AS _cmitem_id"); if (creditSave.first()) _cmitemid = creditSave.value("_cmitem_id").toInt(); else if (creditSave.lastError().type() != QSqlError::NoError) { systemError(this, creditSave.lastError().databaseText(), __FILE__, __LINE__); return; } creditSave.prepare( "INSERT INTO cmitem " "( cmitem_id, cmitem_cmhead_id, cmitem_linenumber, cmitem_itemsite_id," " cmitem_qtyreturned, cmitem_qtycredit, cmitem_updateinv," " cmitem_qty_uom_id, cmitem_qty_invuomratio," " cmitem_price_uom_id, cmitem_price_invuomratio," " cmitem_unitprice, cmitem_taxtype_id," " cmitem_comments, cmitem_rsncode_id ) " "SELECT :cmitem_id, :cmhead_id, :cmitem_linenumber, itemsite_id," " :cmitem_qtyreturned, :cmitem_qtycredit, :cmitem_updateinv," " :qty_uom_id, :qty_invuomratio," " :price_uom_id, :price_invuomratio," " :cmitem_unitprice, :cmitem_taxtype_id," " :cmitem_comments, :cmitem_rsncode_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); } else creditSave.prepare( "UPDATE cmitem " "SET cmitem_qtyreturned=:cmitem_qtyreturned," " cmitem_qtycredit=:cmitem_qtycredit," " cmitem_updateinv=:cmitem_updateinv," " cmitem_qty_uom_id=:qty_uom_id," " cmitem_qty_invuomratio=:qty_invuomratio," " cmitem_price_uom_id=:price_uom_id," " cmitem_price_invuomratio=:price_invuomratio," " cmitem_unitprice=:cmitem_unitprice," " cmitem_taxtype_id=:cmitem_taxtype_id," " cmitem_comments=:cmitem_comments," " cmitem_rsncode_id=:cmitem_rsncode_id " "WHERE (cmitem_id=:cmitem_id);" ); creditSave.bindValue(":cmitem_id", _cmitemid); creditSave.bindValue(":cmhead_id", _cmheadid); creditSave.bindValue(":cmitem_linenumber", _lineNumber->text().toInt()); creditSave.bindValue(":cmitem_qtyreturned", _qtyReturned->toDouble()); creditSave.bindValue(":cmitem_qtycredit", _qtyToCredit->toDouble()); creditSave.bindValue(":cmitem_updateinv", QVariant(_updateInv->isChecked())); creditSave.bindValue(":qty_uom_id", _qtyUOM->id()); creditSave.bindValue(":qty_invuomratio", _qtyinvuomratio); creditSave.bindValue(":price_uom_id", _pricingUOM->id()); creditSave.bindValue(":price_invuomratio", _priceinvuomratio); creditSave.bindValue(":cmitem_unitprice", _netUnitPrice->localValue()); if (_taxType->isValid()) creditSave.bindValue(":cmitem_taxtype_id", _taxType->id()); creditSave.bindValue(":cmitem_comments", _comments->toPlainText()); creditSave.bindValue(":cmitem_rsncode_id", _rsnCode->id()); creditSave.bindValue(":item_id", _item->id()); creditSave.bindValue(":warehous_id", _warehouse->id()); creditSave.exec(); if (creditSave.lastError().type() != QSqlError::NoError) { systemError(this, creditSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_cmitemid); } void creditMemoItem::sPopulateItemInfo() { XSqlQuery uom; uom.prepare("SELECT uom_id, uom_name" " FROM item" " JOIN uom ON (item_inv_uom_id=uom_id)" " WHERE(item_id=:item_id)" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_to_uom_id=uom_id)" " WHERE((itemuomconv_from_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_from_uom_id=uom_id)" " WHERE((itemuomconv_to_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " ORDER BY uom_name;"); uom.bindValue(":item_id", _item->id()); uom.exec(); _qtyUOM->populate(uom); _pricingUOM->populate(uom); XSqlQuery item; item.prepare( "SELECT item_inv_uom_id, item_price_uom_id," " iteminvpricerat(item_id) AS iteminvpricerat," " item_listprice, " " stdCost(item_id) AS f_cost," " getItemTaxType(item_id, :taxzone) AS taxtype_id " " FROM item" " WHERE (item_id=:item_id);" ); item.bindValue(":item_id", _item->id()); item.bindValue(":taxzone", _taxzoneid); item.exec(); if (item.first()) { _invuomid = item.value("item_inv_uom_id").toInt(); _priceRatio = item.value("iteminvpricerat").toDouble(); _qtyUOM->setId(item.value("item_inv_uom_id").toInt()); _pricingUOM->setId(item.value("item_price_uom_id").toInt()); _priceinvuomratio = item.value("iteminvpricerat").toDouble(); _qtyinvuomratio = 1.0; _ratio=item.value("iteminvpricerat").toDouble(); // {_listPrice,_unitCost}->setBaseValue() because they're stored in base _listPrice->setBaseValue(item.value("item_listprice").toDouble()); _unitCost->setBaseValue(item.value("f_cost").toDouble()); _taxType->setId(item.value("taxtype_id").toInt()); } else if (item.lastError().type() != QSqlError::NoError) { systemError(this, item.lastError().databaseText(), __FILE__, __LINE__); return; } if (_invoiceNumber != -1) { XSqlQuery cmitem; cmitem.prepare( "SELECT invcitem_warehous_id," " invcitem_qty_uom_id, invcitem_qty_invuomratio," " invcitem_price_uom_id, invcitem_price_invuomratio," " invcitem_billed * invcitem_qty_invuomratio AS f_billed," " currToCurr(invchead_curr_id, :curr_id, " " invcitem_price / invcitem_price_invuomratio, invchead_invcdate) AS invcitem_price_local " "FROM invchead, invcitem " "WHERE ( (invcitem_invchead_id=invchead_id)" " AND (invchead_invcnumber=text(:invoiceNumber))" " AND (invcitem_item_id=:item_id) ) " "LIMIT 1;" ); cmitem.bindValue(":invoiceNumber", _invoiceNumber); cmitem.bindValue(":item_id", _item->id()); cmitem.bindValue(":curr_id", _netUnitPrice->id()); cmitem.exec(); if (cmitem.first()) { _qtyUOM->setId(cmitem.value("invcitem_qty_uom_id").toInt()); _pricingUOM->setId(cmitem.value("invcitem_price_uom_id").toInt()); _priceinvuomratio = cmitem.value("invcitem_price_invuomratio").toDouble(); _ratio=_priceinvuomratio; _salePrice->setLocalValue(cmitem.value("invcitem_price_local").toDouble() * _priceinvuomratio); if (_mode == cNew) _netUnitPrice->setLocalValue(cmitem.value("invcitem_price_local").toDouble() * _priceinvuomratio); _warehouse->setId(cmitem.value("invcitem_warehous_id").toInt()); _qtyShippedCache = cmitem.value("f_billed").toDouble(); _qtyShipped->setDouble(cmitem.value("f_billed").toDouble() / _qtyinvuomratio); } else if (cmitem.lastError().type() != QSqlError::NoError) { systemError(this, cmitem.lastError().databaseText(), __FILE__, __LINE__); _salePrice->clear(); return; } } } void creditMemoItem::sPopulateItemsiteInfo() { XSqlQuery itemsite; itemsite.prepare( "SELECT itemsite_controlmethod, itemsite_costmethod" " FROM itemsite" " WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); itemsite.bindValue(":item_id", _item->id()); itemsite.bindValue(":warehous_id", _warehouse->id()); itemsite.exec(); if (itemsite.first()) { if (itemsite.value("itemsite_controlmethod").toString() == "N" || itemsite.value("itemsite_costmethod").toString() == "J") { _qtyReturned->setDouble(0.0); _qtyReturned->setEnabled(false); _updateInv->setChecked(false); _updateInv->setEnabled(false); } else { _qtyReturned->clear(); _qtyReturned->setEnabled(true); _updateInv->setChecked(true); _updateInv->setEnabled(true); } } else if (itemsite.lastError().type() != QSqlError::NoError) { systemError(this, itemsite.lastError().databaseText(), __FILE__, __LINE__); return; } } void creditMemoItem::populate() { XSqlQuery cmitem; cmitem.prepare("SELECT cmitem.*, " " cmhead_taxzone_id, cmhead_curr_id, " " (SELECT SUM(taxhist_tax * -1) " " FROM cmitemtax WHERE (cmitem_id=taxhist_parent_id)) AS tax," " itemsite_costmethod " "FROM cmhead, cmitem " "LEFT OUTER JOIN itemsite ON (cmitem_itemsite_id=itemsite_id)" "WHERE ( (cmitem_cmhead_id=cmhead_id)" " AND (cmitem_id=:cmitem_id) );" ); cmitem.bindValue(":cmitem_id", _cmitemid); cmitem.exec(); if (cmitem.first()) { _cmheadid = cmitem.value("cmitem_cmhead_id").toInt(); _taxzoneid = cmitem.value("cmhead_taxzone_id").toInt(); _rsnCode->setId(cmitem.value("cmitem_rsncode_id").toInt()); _item->setItemsiteid(cmitem.value("cmitem_itemsite_id").toInt()); _lineNumber->setText(cmitem.value("cmitem_linenumber").toString()); _netUnitPrice->setLocalValue(cmitem.value("cmitem_unitprice").toDouble()); _qtyToCredit->setDouble(cmitem.value("cmitem_qtycredit").toDouble()); _qtyReturned->setDouble(cmitem.value("cmitem_qtyreturned").toDouble()); // TODO: should this include itemsite_ if (cmitem.value("cmitem_raitem_id").toInt() > 0 || cmitem.value("itemsite_costmethod").toString() == "J") { _updateInv->setChecked(false); _updateInv->setEnabled(false); } else { _updateInv->setChecked(cmitem.value("cmitem_updateinv").toBool()); _updateInv->setEnabled(true); } _qtyUOM->setId(cmitem.value("cmitem_qty_uom_id").toInt()); _ratio=cmitem.value("cmitem_qty_invuomratio").toDouble(); _pricingUOM->setId(cmitem.value("cmitem_price_uom_id").toInt()); _priceinvuomratio = cmitem.value("cmitem_price_invuomratio").toDouble(); _comments->setText(cmitem.value("cmitem_comments").toString()); _taxType->setId(cmitem.value("cmitem_taxtype_id").toInt()); _tax->setId(cmitem.value("cmhead_curr_id").toInt()); _tax->setLocalValue(cmitem.value("tax").toDouble()); sCalculateDiscountPrcnt(); _listPrices->setEnabled(true); _saved=true; } else if (cmitem.lastError().type() != QSqlError::NoError) { systemError(this, cmitem.lastError().databaseText(), __FILE__, __LINE__); return; } } void creditMemoItem::sCalculateExtendedPrice() { _extendedPrice->setLocalValue(((_qtyToCredit->toDouble() * _qtyinvuomratio) / _priceinvuomratio) * _netUnitPrice->localValue()); sCalculateTax(); } void creditMemoItem::sCalculateDiscountPrcnt() { double unitPrice = _netUnitPrice->localValue(); if (unitPrice == 0.0) { _discountFromList->setText("N/A"); _discountFromSale->setText("N/A"); } else { if (_listPrice->isZero()) _discountFromList->setText("N/A"); else _discountFromList->setDouble((1 - (unitPrice / _listPrice->localValue())) * 100); if (_salePrice->isZero()) _discountFromSale->setText("N/A"); else _discountFromSale->setDouble((1 - (unitPrice / _salePrice->localValue())) * 100); } } void creditMemoItem::sCalculateFromDiscount() { double discount = _discountFromSale->toDouble() / 100.0; if (_salePrice->isZero()) _discountFromSale->setText(tr("N/A")); else _netUnitPrice->setLocalValue(_salePrice->localValue() - (_salePrice->localValue() * discount)); } void creditMemoItem::sPriceGroup() { if (! omfgThis->singleCurrency()) _priceGroup->setTitle(tr("In %1:").arg(_netUnitPrice->currAbbr())); } void creditMemoItem::sListPrices() { XSqlQuery creditListPrices; creditListPrices.prepare( "SELECT currToCurr(ipshead_curr_id, :curr_id, ipsprice_price, :effective) AS price" " FROM ipsass, ipshead, ipsprice " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_cust_id=:cust_id)" " AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) = 0)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1) ) )" " UNION SELECT ipsprice_price AS price" " FROM ipsass, ipshead, ipsprice " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_shipto_id=:shipto_id)" " AND (ipsass_shipto_id != -1)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT ipsprice_price AS price" " FROM ipsass, ipshead, ipsprice, custinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_custtype_id=cust_custtype_id)" " AND (cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT ipsprice_price AS price" " FROM ipsass, ipshead, ipsprice, custtype, custinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (coalesce(length(ipsass_custtype_pattern), 0) > 0)" " AND (custtype_code ~ ipsass_custtype_pattern)" " AND (cust_custtype_id=custtype_id)" " AND (cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)))" " UNION SELECT ipsprice_price AS price" " FROM ipsass, ipshead, ipsprice, shiptoinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (shipto_id=:shipto_id)" " AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) > 0)" " AND (shipto_num ~ ipsass_shipto_pattern)" " AND (ipsass_cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT ipsprice_price AS price" " FROM sale, ipshead, ipsprice " " WHERE ((sale_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (CURRENT_DATE BETWEEN sale_startdate AND (sale_enddate - 1)) ) " " UNION SELECT (item_listprice - (item_listprice * cust_discntprcnt)) AS price " " FROM item, custinfo " " WHERE ( (item_sold)" " AND (NOT item_exclusive)" " AND (item_id=:item_id)" " AND (cust_id=:cust_id) );"); creditListPrices.bindValue(":item_id", _item->id()); creditListPrices.bindValue(":cust_id", _custid); creditListPrices.bindValue(":shipto_id", _shiptoid); creditListPrices.bindValue(":curr_id", _netUnitPrice->id()); creditListPrices.bindValue(":effective", _netUnitPrice->effective()); creditListPrices.exec(); if (creditListPrices.size() == 1) { creditListPrices.first(); _netUnitPrice->setLocalValue(creditListPrices.value("price").toDouble() * (_priceinvuomratio / _priceRatio)); } else { ParameterList params; params.append("cust_id", _custid); params.append("shipto_id", _shiptoid); params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); // don't params.append("qty", ...) as we don't know how many were purchased params.append("curr_id", _netUnitPrice->id()); params.append("effective", _netUnitPrice->effective()); priceList newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) { _netUnitPrice->setLocalValue(newdlg._selectedPrice * (_priceinvuomratio / _priceRatio)); sCalculateDiscountPrcnt(); } } } void creditMemoItem::sCalculateTax() { _saved = false; XSqlQuery calcq; calcq.prepare( "SELECT calculateTax(cmhead_taxzone_id,:taxtype_id,cmhead_docdate,cmhead_curr_id,ROUND(:ext,2)) AS tax " "FROM cmhead " "WHERE (cmhead_id=:cmhead_id); "); calcq.bindValue(":cmhead_id", _cmheadid); calcq.bindValue(":taxtype_id", _taxType->id()); calcq.bindValue(":ext", _extendedPrice->localValue()); calcq.exec(); if (calcq.first()) _tax->setLocalValue(calcq.value("tax").toDouble()); else if (calcq.lastError().type() != QSqlError::NoError) { systemError(this, calcq.lastError().databaseText(), __FILE__, __LINE__); return; } } void creditMemoItem::sTaxDetail() { taxDetail newdlg(this, "", true); ParameterList params; params.append("taxzone_id", _taxzoneid); params.append("taxtype_id", _taxType->id()); params.append("date", _netUnitPrice->effective()); params.append("subtotal", _extendedPrice->localValue()); params.append("curr_id", _tax->id()); params.append("sense", -1); if(cView == _mode) params.append("readOnly"); if(_saved == true) { params.append("order_id", _cmitemid); params.append("order_type", "CI"); } newdlg.set(params); if (newdlg.set(params) == NoError && newdlg.exec()) { if (_taxType->id() != newdlg.taxtype()) _taxType->setId(newdlg.taxtype()); } } void creditMemoItem::sQtyUOMChanged() { if(_qtyUOM->id() == _invuomid) _qtyinvuomratio = 1.0; else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio" " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _qtyUOM->id()); invuom.exec(); if(invuom.first()) _qtyinvuomratio = invuom.value("ratio").toDouble(); else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } if(_qtyUOM->id() != _invuomid) { _pricingUOM->setId(_qtyUOM->id()); _pricingUOM->setEnabled(false); } else _pricingUOM->setEnabled(true); sCalculateExtendedPrice(); } void creditMemoItem::sPriceUOMChanged() { if(_pricingUOM->id() == -1 || _qtyUOM->id() == -1) return; if(_pricingUOM->id() == _invuomid) _priceinvuomratio = 1.0; else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio" " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _pricingUOM->id()); invuom.exec(); if(invuom.first()) _priceinvuomratio = invuom.value("ratio").toDouble(); else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } _ratio=_priceinvuomratio; updatePriceInfo(); } void creditMemoItem::updatePriceInfo() { XSqlQuery item; item.prepare("SELECT item_listprice" " FROM item" " WHERE(item_id=:item_id);"); item.bindValue(":item_id", _item->id()); item.exec(); item.first(); _listPrice->setBaseValue(item.value("item_listprice").toDouble() * (_priceinvuomratio / _priceRatio)); } qt-client-4.1.0/guiclient/creditMemoItem.h000066400000000000000000000034601217451700100204600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREDITMEMOITEM_H #define CREDITMEMOITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_creditMemoItem.h" class creditMemoItem : public XDialog, public Ui::creditMemoItem { Q_OBJECT public: creditMemoItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~creditMemoItem(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sPopulateItemInfo(); virtual void sPopulateItemsiteInfo(); virtual void populate(); virtual void sCalculateDiscountPrcnt(); virtual void sCalculateFromDiscount(); virtual void sListPrices(); virtual void sCalculateTax(); virtual void sPriceGroup(); virtual void sTaxDetail(); virtual void sQtyUOMChanged(); virtual void sPriceUOMChanged(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCalculateExtendedPrice(); virtual void updatePriceInfo(); private: int _mode; int _cmitemid; int _cmheadid; int _custid; int _invoiceNumber; int _shiptoid; double _priceRatio; double _listPriceCache; double _salePriceCache; double _qtyShippedCache; int _taxzoneid; int _invuomid; double _qtyinvuomratio; double _priceinvuomratio; double _ratio; bool _saved; }; #endif // CREDITMEMOITEM_H qt-client-4.1.0/guiclient/creditMemoItem.ui000066400000000000000000001004141217451700100206430ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. creditMemoItem 0 0 600 400 Credit Memo Item 12 12 12 12 Memo #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 71 21 0 true &Cancel false &Save true Qt::Vertical QSizePolicy::Expanding 20 0 Qt::StrongFocus Recv. &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::Vertical 20 40 Qt::Horizontal 0 20 QFrame::NoFrame QFrame::Plain Reason Code: true XComboBox::ARCMReasonCodes Qt::Horizontal QSizePolicy::Expanding 0 20 Qty. &Returned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyReturned 0 0 80 22 Qt::AlignRight 0 25 &Qty. To Credit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyToCredit 0 0 80 22 Qt::AlignRight Qty. UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 16777215 20 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Update Inventory true Discount % from Sale: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::ClickFocus Qt::AlignRight Net Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 160 0 CurrDisplay::SalesPrice false false 60 16777215 Qt::NoFocus ... Pricing UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 101 20 Extended Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::ExtPrice false false false 0 Detail Costs 0 24 List Discount % Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 24 Sale Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice false 0 24 List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::Cost false 0 22 Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::Cost false Qt::Vertical 20 40 Qt::Horizontal 40 20 Tax false true None XComboBox::TaxTypes true 0 24 Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice false 0 24 Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Qt::Horizontal 0 20 Notes CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _rsnCode _qtyReturned _qtyToCredit _qtyUOM _discountFromSale _netUnitPrice _pricingUOM _extendedPrice tabWidget _taxType _tax _comments _close _save _close clicked() creditMemoItem reject() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item valid(bool) _save setEnabled(bool) 20 20 20 20 _netUnitPrice idChanged(int) _extendedPrice setId(int) 20 20 20 20 _netUnitPrice idChanged(int) _unitCost setId(int) 20 20 20 20 _netUnitPrice idChanged(int) _listPrice setId(int) 20 20 20 20 _netUnitPrice idChanged(int) _salePrice setId(int) 20 20 20 20 _netUnitPrice effectiveChanged(QDate) _extendedPrice setEffective(QDate) 20 20 20 20 _netUnitPrice effectiveChanged(QDate) _unitCost setEffective(QDate) 20 20 20 20 _netUnitPrice effectiveChanged(QDate) _salePrice setEffective(QDate) 20 20 20 20 _netUnitPrice effectiveChanged(QDate) _listPrice setEffective(QDate) 20 20 20 20 _netUnitPrice effectiveChanged(QDate) _tax setEffective(QDate) 176 240 176 321 qt-client-4.1.0/guiclient/creditcardprocessor.cpp000066400000000000000000003134571217451700100221620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "guiclient.h" #include "creditcardprocessor.h" #include "storedProcErrorLookup.h" #include "authorizedotnetprocessor.h" #include "externalccprocessor.h" #include "verisignprocessor.h" #include "yourpayprocessor.h" #include "paymentechprocessor.h" #include "cybersourceprocessor.h" #define DEBUG false /* TODO: split this into CreditCardProcessor and CreditCardTransaction. the _passedAvs and _passedCvv flags are examples of why the current structure is problematic. bug 8215 might be another example. */ /** @defgroup creditcards Credit Card API The xTuple Credit Card subsystem contains the internal code for processing credit card transactions and the user interface for configuring the credit card handling. */ /** @ingroup creditcards @class CreditCardProcessor @brief This is a generic class that defines the interface between xTuple ERP and credit card processing services. CreditCardProcessor encapsulates the common functionality shared across different services, including interaction with the database server and the proper stored procedures to call. It should be subclassed once for each credit card processing %company to be supported. Subclasses should override the following methods: @li doAuthorize @li doCharge @li doChargePreauthorized @li doCredit @li doReversePreauthorized @li doVoidPrevious @li doTestConfiguration Subclasses should also set @li _defaultLiveServer @li _defaultTestServer @li _defaultLivePort @li _defaultTestPort It is the subclass' responsibility to ensure that all of the configuration options available on the Credit Card Configuration window are implemented either here or in the subclass. An example of an option that @b must be implemented in each subclass is @c CCTestResult since the method for requesting error responses from the credit card processing service is different for every service. In addition to subclassing CreditCardProcessor, alternate credit card processing services require changing CreditCardProcessor::getProcessor and configureCC, and to subclass ConfigCreditCardProcessor. CreditCardProcessor::getProcessor must be modified to instantiate the right subclass of CreditCardProcessor based on the @c CCCompany metric or its QString argument. configureCC must be modified to store the service-specific @c CCCompany value checked by getProcessor and to instantiate a ConfigCreditCardProcessor, which allows editing and saving service-specific metrics @b Error @b handling: The following rules are followed by CreditCardProcessor, which also expects its subclasses to follow them. It is the subclass' responsibility to follow these conventions. If they are not followed, the database will not represent what really happened and the %user will not be informed of problems. Each method in CreditCardProcessor and its subclasses involved in processing credit card transactions is expected to return an integer conforming to the following pattern and set _errorMsg to the string associated with this integer in the _msgHash:
    If the function returns:It means this:
    greater than 0 The interaction with the credit card processing service was successful but either there is a warning from the service, like the credit card processing %company denied the transaction, or local post-processing generated an error, such as a database failure
    0 the transaction succeeded in its entirety
    less than 0 preprocessing failed or the credit card %company returned an error, like a malformed message or communications could not be established to process the transaction
    Error codes between -100 and 100 inclusive are reserved for the CreditCardProcessor class itself. Values less than -100 or greater than 100 are available for use by subclasses and should be loaded into _msgHash in the subclass' constructor. @see AuthorizeDotNetProcessor @see CyberSourceProcessor @see ExternalCCProcessor @see PaymentechProcessor @see YourPayProcessor @see configureCC @todo expose portions of this in the scriptapi doxygen module @todo use qabstractmessagehandler instead of qmessagebox */ QString CreditCardProcessor::_errorMsg = ""; QHash CreditCardProcessor::_msgHash; static struct { int code; const char* text; } messages[] = { { 0, QT_TRANSLATE_NOOP("CreditCardProcessor", "This transaction was approved.\n%1") }, { -1, QT_TRANSLATE_NOOP("CreditCardProcessor", "Database Error") }, { -2, QT_TRANSLATE_NOOP("CreditCardProcessor", "You don't have permission to process Credit Card transactions.") }, { -3, QT_TRANSLATE_NOOP("CreditCardProcessor", "The application is not set up to process credit cards.") }, { -4, QT_TRANSLATE_NOOP("CreditCardProcessor", "The Bank Accounts are not set for all Credit Card types.") }, { -5, QT_TRANSLATE_NOOP("CreditCardProcessor", "The encryption key is not defined.") }, { -6, QT_TRANSLATE_NOOP("CreditCardProcessor", "The login for the proxy server is not defined.") }, { -7, QT_TRANSLATE_NOOP("CreditCardProcessor", "The password for the proxy server is not defined.") }, { -8, QT_TRANSLATE_NOOP("CreditCardProcessor", "The proxy server is not defined.") }, { -9, QT_TRANSLATE_NOOP("CreditCardProcessor", "The port to use for the proxy server is not defined.") }, { -10, QT_TRANSLATE_NOOP("CreditCardProcessor", "Credit Card %1 is not active. Make it active or select " "another Credit Card.") }, { -11, QT_TRANSLATE_NOOP("CreditCardProcessor", "Credit Card %1 has expired.") }, { -12, QT_TRANSLATE_NOOP("CreditCardProcessor", "%2 reported an error:\n%1") }, { -13, QT_TRANSLATE_NOOP("CreditCardProcessor", "The Credit Card configuration is inconsistent and the application " "cannot determine whether to run in Test or Live mode.") }, { -14, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not figure out which Credit Card Processing Company " "to set up (based on %1).") }, { -15, QT_TRANSLATE_NOOP("CreditCardProcessor", "The digital certificate (.pem file) is not set.") }, { -16, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not open digital certificate (.pem file) %1.") }, { -17, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not find a Credit Card with internal ID %1.") }, { -18, QT_TRANSLATE_NOOP("CreditCardProcessor", "Error with message transfer program:\n%1 %2\n\n%3") }, { -19, QT_TRANSLATE_NOOP("CreditCardProcessor", "%1 is not implemented.") }, { -20, QT_TRANSLATE_NOOP("CreditCardProcessor", "The application does not support either Credit Cards or " "Checks with %1. Please choose a different company.") }, // preauthorizing charges { -21, QT_TRANSLATE_NOOP("CreditCardProcessor", "The amount to charge must be greater than 0.00.") }, { -24, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not generate a sequence number while preauthorizing.") }, // processing charges based on a pre-authorization { -30, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not find the Credit Card preauthorization to charge.") }, { -32, QT_TRANSLATE_NOOP("CreditCardProcessor", "You must select a preauthorization to charge.") }, { -33, QT_TRANSLATE_NOOP("CreditCardProcessor", "The preauthorization (for %1) is not sufficient to cover " "the desired transaction amount (%2).") }, { -34, QT_TRANSLATE_NOOP("CreditCardProcessor", "No Preauthorization found") }, { -35, QT_TRANSLATE_NOOP("CreditCardProcessor", "This preauthorization may not be charged. It was created " "for a Sales Order which has been canceled.") }, // stand-alone charges { -40, QT_TRANSLATE_NOOP("CreditCardProcessor", "Inconsistent data passed to charge(): [%1] [%2]") }, { -44, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not generate a sequence number while charging.") }, // credits { -50, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not find original Credit Card payment to credit.") }, // voids { -60, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not find the Credit Card transaction to void.") }, // user chose to cancel { -70, QT_TRANSLATE_NOOP("CreditCardProcessor", "User chose not to process the preauthorization.") }, { -71, QT_TRANSLATE_NOOP("CreditCardProcessor", "User chose not to post-authorize process the charge.") }, { -72, QT_TRANSLATE_NOOP("CreditCardProcessor", "User chose not to process the charge.") }, { -73, QT_TRANSLATE_NOOP("CreditCardProcessor", "User chose not to process the credit.") }, { -74, QT_TRANSLATE_NOOP("CreditCardProcessor", "User chose not to process the void.") }, { -75, QT_TRANSLATE_NOOP("CreditCardProcessor", "User chose not to proceed without CVV code.") }, // scripting errors { -81, QT_TRANSLATE_NOOP("CreditCardProcessor", "Scripting error in %1: Input parameter %2 is not a(n) %3") }, // transaction was processed fine but was not successful { -90, QT_TRANSLATE_NOOP("CreditCardProcessor", "This Credit Card transaction was denied.\n%1") }, { -91, QT_TRANSLATE_NOOP("CreditCardProcessor", "This Credit Card transaction is a duplicate.\n%1") }, { -92, QT_TRANSLATE_NOOP("CreditCardProcessor", "This Credit Card transaction was declined.\n%1") }, { -93, QT_TRANSLATE_NOOP("CreditCardProcessor", "This Credit Card transaction was denied " "because of possible fraud.\n%1") }, // other misc errors { -94, QT_TRANSLATE_NOOP("CreditCardProcessor", "The Bank Account is not set for Credit Card type %1. Either this " "card type is not accepted or the Credit Card configuration is not " "complete.") }, { -95, QT_TRANSLATE_NOOP("CreditCardProcessor", "%2 returned an error: %1") }, { -96, QT_TRANSLATE_NOOP("CreditCardProcessor", "This transaction failed the CVV check.") }, { -97, QT_TRANSLATE_NOOP("CreditCardProcessor", "This transaction failed the Address Verification check.") }, { -98, QT_TRANSLATE_NOOP("CreditCardProcessor", "You may not process this transaction without a CVV code. " "Please enter one and try again.") }, { -99, QT_TRANSLATE_NOOP("CreditCardProcessor", "The CVV value is not valid.") }, {-100, QT_TRANSLATE_NOOP("CreditCardProcessor", "No approval code was received:\n%1\n%2\n%3") }, // positive values: credit card company successfully processed the // transaction but there was a local failure { 1, QT_TRANSLATE_NOOP("CreditCardProcessor", "Database Error") }, { 2, QT_TRANSLATE_NOOP("CreditCardProcessor", "Could not generate a unique key for the ccpay table.") }, { 3, QT_TRANSLATE_NOOP("CreditCardProcessor", "Stored Procedure Error") }, { 4, QT_TRANSLATE_NOOP("CreditCardProcessor", "The Credit Card transaction completed successfully but " "it was not recorded correctly:\n%1") }, { 5, QT_TRANSLATE_NOOP("CreditCardProcessor", "The Server is %2 and is expected to be %3 in %1 mode, " "while the Port is %4 and is expected to be %5. Credit Card " "processing transactions may fail.") }, { 6, QT_TRANSLATE_NOOP("CreditCardProcessor", "The Server is %2 and is expected to be %3 in %1 mode." "Credit Card processing transactions may fail.") }, { 7, QT_TRANSLATE_NOOP("CreditCardProcessor", "The Port is %2 and is expected to be %3 in %1 mode. " "Credit Card processing transactions may fail.") }, { 94, QT_TRANSLATE_NOOP("CreditCardProcessor", "There was a problem printing the credit card receipt.") }, { 96, QT_TRANSLATE_NOOP("CreditCardProcessor", "This transaction failed the CVV check but will be " "processed anyway.") }, { 97, QT_TRANSLATE_NOOP("CreditCardProcessor", "This transaction failed the Address Verification check " "but will be processed anyway.") }, }; CreditCardProcessor::FraudCheckResult::FraudCheckResult(QChar pcode, int /*TODO: FraudChecks*/ psev, QString ptext) { code = pcode; sev = psev; text = ptext; } /** @brief Construct and initialize a default CreditCardProcessor. This should never be called except by the constructor of a subclass. This should always be called by the constructor of a subclass. This constructor initializes _msgHash as well as some private and protected fields. */ CreditCardProcessor::CreditCardProcessor() : _company(tr("The Credit Card Processing Company")), _defaultLiveServer("live.creditcardprocessor.com"), _defaultTestServer("test.creditcardprocessor.com"), _defaultLivePort(0), _defaultTestPort(0), _http(0) { if (DEBUG) qDebug("CCP:CreditCardProcessor()"); _errorMsg = ""; _ignoreSslErrors = _metrics->boolean("CCIgnoreSSLErrors"); for (unsigned int i = 0; i < sizeof(messages) / sizeof(messages[0]); i++) _msgHash.insert(messages[i].code, tr(messages[i].text)); _avsCodes.append(new FraudCheckResult('A', NoMatch | PostalCode, tr("Street Address matches but not Postal Code"))); _avsCodes.append(new FraudCheckResult('B', NotAvail | Address, tr("Address not provided for AVS check"))); _avsCodes.append(new FraudCheckResult('E', Invalid, tr("Address Verification error"))); _avsCodes.append(new FraudCheckResult('G', Unsupported, tr("Card issuing bank is not a U.S. bank"))); _avsCodes.append(new FraudCheckResult('N', NoMatch | Address | PostalCode, tr("No match on Street Address or Postal Code"))); _avsCodes.append(new FraudCheckResult('P', Unsupported, tr("Address Verification does not apply to this transaction"))); _avsCodes.append(new FraudCheckResult('R', ServiceUnavailable, tr("Retry - system unavailable or timed out"))); _avsCodes.append(new FraudCheckResult('S', Unsupported, tr("Address Verification service not supported"))); _avsCodes.append(new FraudCheckResult('U', NotAvail | Address, tr("Address information not available"))); _avsCodes.append(new FraudCheckResult('W', NoMatch | Address, tr("9-Digit Postal Code matches but not Street Address"))); _avsCodes.append(new FraudCheckResult('X', Match, tr("Street Address and 9-digit Postal Code match"))); _avsCodes.append(new FraudCheckResult('Y', Match, tr("Street Address and 5-digit Postal Code match"))); _avsCodes.append(new FraudCheckResult('Z', NoMatch | Address, tr("5-Digit Postal Code matches but not Street Address"))); _cvvCodes.append(new FraudCheckResult('M', Match, tr("CVV matches"))); _cvvCodes.append(new FraudCheckResult('N', NoMatch, tr("CVV does not match"))); _cvvCodes.append(new FraudCheckResult('P', NotProcessed, tr("CVV was not processed"))); _cvvCodes.append(new FraudCheckResult('S', NotAvail, tr("CVV should be on the card but was not supplied"))); _cvvCodes.append(new FraudCheckResult('U', Unsupported, tr("Card issuing bank was not certified for CVV"))); _cvvCodes.append(new FraudCheckResult('X', Unsupported, tr("Card Verification is not supported for this processor or card type"))); } CreditCardProcessor::~CreditCardProcessor() { while (! _avsCodes.isEmpty()) delete _avsCodes.takeFirst(); while (! _cvvCodes.isEmpty()) delete _cvvCodes.takeFirst(); } /** @brief Get a new instance of a specific CreditCardProcessor subclass. This method is used to retrieve a CreditCardProcessor for actual use by the application, rather than calling CreditCardProcessor::CreditCardProcessor. getProcessor retrieves the right subclass for the current configuration. @param pcompany This causes the method to instantiate the subclass for the named service, rather than the configured service. pcompany should be an empty string except when checking for errors in configCC @return An instance of a CreditCardProcessor subclass @see configCC */ CreditCardProcessor * CreditCardProcessor::getProcessor(const QString pcompany) { if (DEBUG) qDebug("CCP:getProcessor(%s)", pcompany.toAscii().data()); if (pcompany == "Authorize.Net") return new AuthorizeDotNetProcessor(); else if (pcompany == "Verisign") return new VerisignProcessor(); else if (pcompany == "YourPay") return new YourPayProcessor(); else if (pcompany == "Paymentech") return new PaymentechProcessor(); else if (pcompany == "CyberSource") return new CyberSourceProcessor(); else if (pcompany == "External") return new ExternalCCProcessor(); else if (! pcompany.isEmpty()) { _errorMsg = errorMsg(-14).arg(pcompany); return 0; } CreditCardProcessor *processor = 0; if (_metrics->value("CCCompany") == "Authorize.Net") processor = new AuthorizeDotNetProcessor(); else if (_metrics->value("CCCompany") == "Verisign") processor = new VerisignProcessor(); else if ((_metrics->value("CCCompany") == "YourPay")) processor = new YourPayProcessor(); else if ((_metrics->value("CCCompany") == "Paymentech")) processor = new PaymentechProcessor(); else if ((_metrics->value("CCCompany") == "CyberSource")) processor = new CyberSourceProcessor(); else if ((_metrics->value("CCCompany") == "External")) processor = new ExternalCCProcessor(); else _errorMsg = errorMsg(-14).arg(_metrics->value("CCServer")); // reset to 0 if the config is bad and we're not configuring the system if (processor && processor->testConfiguration() < 0 && pcompany.isEmpty()) { delete processor; processor = 0; } if (processor) processor->reset(); return processor; } /** @brief Processes pre-authorization transactions. This method performs application-level error checking and all of the database work required to handle a pre-authorization transaction. It calls doAuthorize to handle the direct communication with the service. @warning This method should never be overridden. Service-specific functionality should be implemented in the doAuthorize method of the service' subclass. @param[in] pccardid The internal id of the credit card to preauthorize @param[in] pcvv The CVV/CCV code of the credit card to preauthorize @param[in] pamount The total amount to preauthorize. If the credit card processor does not preauthorize the full amount requested, the database will store the actual amount that was authorized If this occurs, the application will display an error if the amount authorized is 0 or a warning if the amount authorized is greater than 0. @param[in] ptax The subportion of the total which is tax @param[in] ptaxexempt Whether or not this transaction is tax exempt @param[in] pfreight The subportion of the total which is freight @param[in] pduty The subportion of the total which is customs duty @param[in] pcurrid The %currency of the amount to preauthorize @param[in,out] pneworder The order number associated with this preauthorization @param[out] preforder The reference number associated with this preauthorization (may be required to 'capture' the preauthorization) @param[out] pccpayid The ccpay_id of the record created by this transaction @param[in] preftype Either @c cohead or @c cashrcpt or blank @param[in,out] prefid The cashrcpt_id or cohead_id associated with this transaction @return An index into _errMsg; 0 indicates success */ int CreditCardProcessor::authorize(const int pccardid, const QString &pcvv, const double pamount, double ptax, bool ptaxexempt, double pfreight, double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid) { if (DEBUG) qDebug("CCP:authorize(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid, preftype.toAscii().data(), prefid); reset(); if (pamount <= 0) { _errorMsg = errorMsg(-21); return -21; } QString ccard_x; int returnVal = checkCreditCard(pccardid, pcvv, ccard_x); if (returnVal < 0) return returnVal; if (_metrics->boolean("CCConfirmPreauth") && QMessageBox::question(0, tr("Confirm Preauthorization of Credit Card Purchase"), tr("

    Are you sure that you want to preauthorize " "a charge to credit card %1 in the amount of %2 %3?") .arg(ccard_x) .arg(CurrDisplay::currSymbol(pcurrid)) .arg(QString::number(pamount, 'f', 2)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::No) { _errorMsg = errorMsg(-70); return -70; } ParameterList dbupdateinfo; double amount = pamount; returnVal = doAuthorize(pccardid, pcvv, amount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder, preforder, pccpayid, dbupdateinfo); if (returnVal == -70) return -70; else if (returnVal > 0) _errorMsg = errorMsg(4).arg(_errorMsg); int ccpayReturn = updateCCPay(pccpayid, dbupdateinfo); if (returnVal == 0 && ccpayReturn != 0) returnVal = ccpayReturn; if (returnVal >= 0) { returnVal = fraudChecks(); if (returnVal < 0) { int voidReturnVal = voidPrevious(pccpayid); return (voidReturnVal < 0) ? voidReturnVal : returnVal; } XSqlQuery cashq; if (preftype == "cashrcpt") { if (prefid <= 0) { cashq.exec("SELECT NEXTVAL('cashrcpt_cashrcpt_id_seq') AS cashrcpt_id;"); if (cashq.first()) prefid = cashq.value("cashrcpt_id").toInt(); else if (cashq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cashq.lastError().databaseText()); // TODO: log an event? return 1; } cashq.prepare("INSERT INTO cashrcpt (cashrcpt_id," " cashrcpt_cust_id, cashrcpt_amount, cashrcpt_curr_id," " cashrcpt_fundstype, cashrcpt_docnumber," " cashrcpt_bankaccnt_id, cashrcpt_notes, cashrcpt_distdate, cashrcpt_usecustdeposit) " "SELECT :cashrcptid," " ccpay_cust_id, :amount, :curr_id," " ccard_type, ccpay_r_ordernum," " ccbank_bankaccnt_id, :notes, current_date, :custdeposit" " FROM ccpay, ccard LEFT OUTER JOIN ccbank ON (ccard_type=ccbank_ccard_type)" " WHERE (ccpay_ccard_id=ccard_id);"); } else cashq.prepare( "UPDATE cashrcpt " "SET cashrcpt_cust_id=ccard_cust_id," " cashrcpt_amount=:amount," " cashrcpt_fundstype=ccard_type," " cashrcpt_bankaccnt_id=ccbank_bankaccnt_id," " cashrcpt_distdate=CURRENT_DATE," " cashrcpt_notes=:notes, " " cashrcpt_curr_id=:curr_id," " cashrcpt_usecustdeposit=:custdeposit " "FROM ccard LEFT OUTER JOIN ccbank ON (ccard_type=ccbank_ccard_type) " "WHERE ((cashrcpt_id=:cashrcptid)" " AND (ccard_id=:ccardid));" ); cashq.bindValue(":cashrcptid", prefid); cashq.bindValue(":ccardid", pccardid); cashq.bindValue(":amount", amount); cashq.bindValue(":curr_id", pcurrid); cashq.bindValue(":notes", "Credit Card Pre-Authorization"); cashq.bindValue(":custdeposit", _metrics->boolean("EnableCustomerDeposits")); cashq.exec(); if (cashq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cashq.lastError().databaseText()); // TODO: log an event? returnVal = 1; } } else if (preftype == "cohead") { cashq.prepare("INSERT INTO payco VALUES" " (:payco_ccpay_id, :payco_cohead_id," " :payco_amount, :payco_curr_id);"); cashq.bindValue(":payco_ccpay_id", pccpayid); cashq.bindValue(":payco_cohead_id", prefid); cashq.bindValue(":payco_amount", amount); cashq.bindValue(":payco_curr_id", pcurrid); cashq.exec(); if (cashq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cashq.lastError().databaseText()); // TODO: log an event? returnVal = 1; } } if (_metrics->boolean("CCPrintReceipt")) { int receiptReturn = printReceipt(pccpayid); if (receiptReturn != 0 && returnVal == 0) returnVal = receiptReturn; } } return returnVal; } /** @brief Processes charge transactions. This method performs application-level error checking and all of the database work required to handle a credit card charge transaction. It calls doCharge to handle the direct communication with the service. @warning This method should never be overridden. Service-specific functionality should be implemented in the doCharge method of the service' subclass. @param[in] pccardid The internal id of the credit card to charge @param[in] pcvv The CVV/CCV code of the credit card to charge @param[in] pamount The total amount to charge @param[in] ptax The subportion of the total which is tax @param[in] ptaxexempt Whether or not this transaction is tax exempt @param[in] pfreight The subportion of the total which is freight @param[in] pduty The subportion of the total which is customs duty @param[in] pcurrid The %currency of the amount to charge @param[in,out] pneworder The order number associated with this charge @param[out] preforder The reference number associated with this charge @param[out] pccpayid The ccpay_id of the record created by this transaction @param[in] preftype Either @c cohead or @c cashrcpt or blank @param[in,out] prefid The cashrcpt_id or cohead_id associated with this transaction @return An index into _errMsg; 0 indicates success */ int CreditCardProcessor::charge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid) { if (DEBUG) qDebug("CCP:charge(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid, preftype.toAscii().data(), prefid); reset(); if (pamount <= 0) { _errorMsg = errorMsg(-21); return -21; } if (preftype == "cohead" && prefid < 0) { _errorMsg = errorMsg(-40).arg(preftype).arg(prefid); return -40; } QString ccard_x; int returnVal = checkCreditCard(pccardid, pcvv, ccard_x); if (returnVal < 0) return returnVal; if (_metrics->boolean("CCConfirmCharge") && QMessageBox::question(0, tr("Confirm Charge of Credit Card Purchase"), tr("Are you sure that you want to charge credit card %1 " "in the amount of %2 %3?") .arg(ccard_x) .arg(CurrDisplay::currSymbol(pcurrid)) .arg(QString::number(pamount, 'f', 2)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::No) { _errorMsg = errorMsg(-72); return -72; } ParameterList dbupdateinfo; returnVal = doCharge(pccardid, pcvv, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder, preforder, pccpayid, dbupdateinfo); if (returnVal == -72) return -72; else if (returnVal > 0) _errorMsg = errorMsg(4).arg(_errorMsg); int ccpayReturn = updateCCPay(pccpayid, dbupdateinfo); if (returnVal == 0 && ccpayReturn != 0) returnVal = ccpayReturn; if (returnVal >= 0) { returnVal = fraudChecks(); if (returnVal < 0) { int voidReturnVal = voidPrevious(pccpayid); return (voidReturnVal < 0) ? voidReturnVal : returnVal; } XSqlQuery cashq; cashq.prepare("SELECT postCCcashReceipt(:ccpayid," " :docid, :doctype) AS cm_id;"); cashq.bindValue(":ccpayid", pccpayid); cashq.bindValue(":doctype", preftype); cashq.bindValue(":docid", prefid); cashq.exec(); if (cashq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cashq.lastError().databaseText()); // TODO: log an event? returnVal = 1; } if (preftype == "cohead") { XSqlQuery cashq; cashq.prepare("INSERT INTO payco VALUES" " (:payco_ccpay_id, :payco_cohead_id," " :payco_amount, :payco_curr_id);"); cashq.bindValue(":payco_ccpay_id", pccpayid); cashq.bindValue(":payco_cohead_id", prefid); cashq.bindValue(":payco_amount", pamount); cashq.bindValue(":payco_curr_id", pcurrid); cashq.exec(); if (cashq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cashq.lastError().databaseText()); // TODO: log an event? returnVal = 1; } } } if (_metrics->boolean("CCPrintReceipt")) { int receiptReturn = printReceipt(pccpayid); if (receiptReturn != 0 && returnVal == 0) returnVal = receiptReturn; } return returnVal; } /** @brief Processes 'capture' transactions, or charges against a prior preauthorization. This method performs application-level error checking and all of the database work required to 'capture' or complete the charge against a prior preauthorization. It calls doChargePreauthorized to handle the direct communication with the service. @warning This method should never be overridden. Service-specific functionality should be implemented in the doChargePreauthorized method of the service' subclass. @param[in] pcvv The CVV/CCV code of the credit card to charge @param[in] pamount The total amount to charge @param[in] pcurrid The %currency of the amount to charge @param[in,out] pneworder The order number associated with this charge @param[in,out] preforder The reference number (preforder) generated by the preauthorization transaction @param[in,out] pccpayid When calling the method, pccpayid should be the ccpay_id of the preauthorization record. On return, this is the ccpay_id of the charge record, which may be the same as the preauthorization record. @return An index into _errMsg; 0 indicates success */ int CreditCardProcessor::chargePreauthorized(const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid) { if (DEBUG) qDebug("CCP:chargePreauthorized(pcvv, %f, %d, %s, %s, %d)", pamount, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); reset(); int ccValidDays = _metrics->value("CCValidDays").toInt(); if (ccValidDays < 1) ccValidDays = 7; if (pamount <= 0) { _errorMsg = errorMsg(-21); return -21; } if (pccpayid < 0) { _errorMsg = errorMsg(-32); return -32; } XSqlQuery ccq; ccq.prepare("SELECT *," " currToCurr(ccpay_curr_id, :curr_id, ccpay_amount," " CURRENT_DATE) AS ccpay_amount_converted " "FROM ccpay " "WHERE ((ccpay_status = 'A')" " AND (date_part('day', CURRENT_TIMESTAMP - " " ccpay_transaction_datetime) < " " :ccValidDays)" " AND (ccpay_id=:id));"); ccq.bindValue(":id", pccpayid); ccq.bindValue(":curr_id", pcurrid); ccq.bindValue(":ccValidDays", ccValidDays); ccq.exec(); if (ccq.first()) { if (pamount > ccq.value("ccpay_amount_converted").toDouble()) { _errorMsg = errorMsg(-33) .arg(ccq.value("ccpay_amount").toString()) .arg(pamount); return -33; } } else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-34); return -34; } int ccardid = ccq.value("ccpay_ccard_id").toInt(); preforder = ccq.value("ccpay_r_ordernum").toString(); QString doctype = "cashrcpt"; int coheadid = -1; ccq.prepare("SELECT payco_cohead_id," " EXISTS(SELECT 1" " FROM coitem " " WHERE ((coitem_status IN ('O', 'C'))" " AND (coitem_cohead_id=payco_cohead_id))) AS ok" " FROM payco WHERE (payco_ccpay_id=:ccpayid)"); ccq.bindValue(":ccpayid", pccpayid); ccq.exec(); if (ccq.first()) { if (ccq.value("ok").toBool()) { doctype = "cohead"; coheadid = ccq.value("payco_cohead_id").toInt(); } else // found payco but no coitems for it { _errorMsg = errorMsg(-35); return -35; } } else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } QString ccard_x; int returnVal = checkCreditCard(ccardid, pcvv, ccard_x); if (returnVal < 0) return returnVal; if (_metrics->boolean("CCConfirmChargePreauth") && QMessageBox::question(0, tr("Confirm Post-authorization of Credit Card Purchase"), tr("Are you sure that you want to charge a pre-authorized " "transaction to credit card %1 in the amount of %2 %3?") .arg(ccard_x) .arg(CurrDisplay::currSymbol(pcurrid)) .arg(QString::number(pamount, 'f', 2)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::No) { _errorMsg = errorMsg(-71); return -71; } ParameterList dbupdateinfo; returnVal = doChargePreauthorized(ccardid, pcvv, pamount, pcurrid, pneworder, preforder, pccpayid, dbupdateinfo); if (returnVal == -71) return -71; else if (returnVal > 0) _errorMsg = errorMsg(4).arg(_errorMsg); int ccpayReturn = updateCCPay(pccpayid, dbupdateinfo); if (returnVal == 0 && ccpayReturn != 0) returnVal = ccpayReturn; if (returnVal >= 0) { returnVal = fraudChecks(); if (returnVal < 0) { int voidReturnVal = voidPrevious(pccpayid); return (voidReturnVal < 0) ? voidReturnVal : returnVal; } ccq.prepare("SELECT postCCcashReceipt(:pccpayid, :docid," " :doctype, :amount) AS id;"); ccq.bindValue(":pccpayid", pccpayid); ccq.bindValue(":doctype", doctype); ccq.bindValue(":amount", pamount); if (doctype == "cohead") ccq.bindValue(":docid", coheadid); ccq.exec(); if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(ccq.lastError().databaseText()); // TODO: log an event? returnVal = 1; } if (_metrics->boolean("CCPrintReceipt")) { int receiptReturn = printReceipt(pccpayid); if (receiptReturn != 0 && returnVal == 0) returnVal = receiptReturn; } } return returnVal; } /** @brief Test whether common credit card processing configuration options are consistent. Calls toTestConfiguration to check if service-specific options are set. */ int CreditCardProcessor::testConfiguration() { if (DEBUG) qDebug("CCP:testConfiguration()"); reset(); if (!_privileges->check("ProcessCreditCards")) { _errorMsg = errorMsg(-2); return -2; } if(!_metrics->boolean("CCAccept")) { _errorMsg = errorMsg(-3); return -3; } XSqlQuery ccbankq("SELECT ccbank_id" " FROM ccbank" " WHERE (ccbank_bankaccnt_id IS NOT NULL);"); if (ccbankq.first()) ; // we're ok - we can accept at least one credit card else if (ccbankq.lastError().type() != QSqlError::NoError) { _errorMsg = ccbankq.lastError().text(); return -1; } else { _errorMsg = errorMsg(-4); return -4; } if (omfgThis->_key.isEmpty()) { _errorMsg = errorMsg(-5); return -5; } if(_metrics->boolean("CCUseProxyServer")) { _plogin = _metricsenc->value("CCProxyLogin"); if (_plogin.isEmpty()) { _errorMsg = errorMsg(-6); return -6; } _ppassword = _metricsenc->value("CCPassword"); if (_ppassword.isEmpty()) { _errorMsg = errorMsg(-7); return -7; } _pserver = _metrics->value("CCProxyServer"); if (_pserver.isEmpty()) { _errorMsg = errorMsg(-8); return -8; } _pport = _metrics->value("CCProxyPort"); if (_pport.isEmpty()) { _errorMsg = errorMsg(-9); return -9; } } if (! handlesChecks() && ! handlesCreditCards()) { _errorMsg = errorMsg(-20); return -20; } if (isLive() == isTest()) // if both true or both false { _errorMsg = errorMsg(-13); return -13; } int returnValue = doTestConfiguration(); // now handle warnings if (returnValue >= 0) { QString serverStr = buildURL(_metrics->value("CCServer"), _metrics->value("CCPort"), false); QString defaultStr = buildURL(defaultServer(), QString(defaultPort(isLive())), false); if (serverStr != defaultStr && _metrics->value("CCPort").toInt() != defaultPort(isLive()) && _metrics->value("CCPort").toInt() != 0) { _errorMsg = errorMsg(5).arg(isLive() ? tr("Live") : tr("Test")) .arg(_metrics->value("CCServer")) .arg(defaultServer()) .arg(_metrics->value("CCPort")) .arg(defaultPort(isLive())); returnValue = 5; } else if (serverStr != defaultStr) { _errorMsg = errorMsg(6).arg(isLive() ? tr("Live") : tr("Test")) .arg(_metrics->value("CCServer")) .arg(defaultServer()); returnValue = 6; } else if (_metrics->value("CCPort").toInt() != defaultPort(isLive()) && _metrics->value("CCPort").toInt() != 0 && ! _metrics->value("CCPort").isEmpty()) { _errorMsg = errorMsg(7).arg(isLive() ? tr("Live") : tr("Test")) .arg(_metrics->value("CCPort")) .arg(defaultPort(isLive())); returnValue = 7; } } return returnValue; } /** @brief Processes credit transactions. This method performs application-level error checking and all of the database work required to credit a prior charge. It calls doCredit to handle the direct communication with the service. @warning This method should never be overridden. Service-specific functionality should be implemented in the doCredit method of the service' subclass. @param[in] pccardid The internal id of the credit card to credit @param[in] pcvv The CVV/CCV code of the credit card to credit @param[in] pamount The total amount to credit @param[in] ptax The subportion of the total which is tax @param[in] ptaxexempt Whether or not this transaction is tax exempt @param[in] pfreight The subportion of the total which is freight @param[in] pduty The subportion of the total which is customs duty @param[in] pcurrid The %currency of the amount to credit @param[in,out] pneworder The order number associated with this credit @param[in,out] preforder The reference number (preforder) generated by the charge transaction @param[in,out] pccpayid When calling the method, pccpayid should be the ccpay_id of the original charge record. On return, this is the ccpay_id of the credit record. @param[in] preftype Either @c cohead or @c cashrcpt or blank @param[in,out] prefid The cashrcpt_id or cohead_id associated with this transaction @return An index into _errMsg; 0 indicates success */ int CreditCardProcessor::credit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid) { if (DEBUG) qDebug("CCP:credit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid, preftype.toAscii().data(), prefid); reset(); if (preftype == "cohead" && prefid < 0) { _errorMsg = errorMsg(-40).arg(preftype).arg(prefid); return -40; } QString ccard_x; int returnVal = checkCreditCard(pccardid, pcvv, ccard_x); if (returnVal < 0) return returnVal; if (_metrics->boolean("CCConfirmCredit") && QMessageBox::question(0, tr("Confirm Credit Card Credit"), tr("Are you sure that you want to refund %2 %3 to credit card %1?") .arg(ccard_x) .arg(CurrDisplay::currSymbol(pcurrid)) .arg(QString::number(pamount, 'f', 2)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::No) { _errorMsg = errorMsg(-73); return -73; } if (pccpayid > 0) { int oldccpayid = pccpayid; XSqlQuery ccq; ccq.exec("SELECT NEXTVAL('ccpay_ccpay_id_seq') AS ccpay_id;"); if (ccq.first()) pccpayid = ccq.value("ccpay_id").toInt(); else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } else // no rows found is fatal because we haven't processed the credit yet { _errorMsg = errorMsg(2); return -1; } int next_seq = -1; ccq.prepare("SELECT MAX(COALESCE(ccpay_order_number_seq, -1)) + 1" " AS next_seq " " FROM ccpay " " WHERE (ccpay_order_number=:ccpay_order_number);"); ccq.bindValue(":ccpay_order_number", preforder); ccq.exec(); if (ccq.first()) next_seq = ccq.value("next_seq").toInt(); else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } ccq.prepare( "INSERT INTO ccpay (" " ccpay_id, ccpay_ccard_id, ccpay_cust_id," " ccpay_auth_charge, ccpay_auth," " ccpay_amount," " ccpay_curr_id, ccpay_type, ccpay_status," " ccpay_order_number, ccpay_order_number_seq, " " ccpay_ccpay_id " ") SELECT " " :newccpayid, ccpay_ccard_id, ccpay_cust_id," " ccpay_auth_charge, ccpay_auth," " :amount, :currid, 'R', 'X'," " ccpay_order_number, :nextseq, ccpay_id " "FROM ccpay " "WHERE (ccpay_id=:oldccpayid);"); ccq.bindValue(":newccpayid", pccpayid); ccq.bindValue(":currid", pcurrid); ccq.bindValue(":amount", pamount); ccq.bindValue(":nextseq", next_seq); ccq.bindValue(":oldccpayid", oldccpayid); ccq.exec(); if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } ccq.prepare("SELECT ccpay_r_ordernum FROM ccpay WHERE (ccpay_id=:ccpayid);"); ccq.bindValue(":ccpayid", oldccpayid); ccq.exec(); if (ccq.first()) preforder = ccq.value("ccpay_r_ordernum").toString(); else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-50); return -50; } } ParameterList dbupdateinfo; returnVal = doCredit(pccardid, pcvv, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder, preforder, pccpayid, dbupdateinfo); if (returnVal < 0) return returnVal; else if (returnVal > 0) _errorMsg = errorMsg(4).arg(_errorMsg); int ccpayReturn = updateCCPay(pccpayid, dbupdateinfo); if (returnVal == 0 && ccpayReturn != 0) returnVal = ccpayReturn; if (returnVal >= 0) { returnVal = fraudChecks(); if (returnVal < 0) { int voidReturnVal = voidPrevious(pccpayid); return (voidReturnVal < 0) ? voidReturnVal : returnVal; } if (pccpayid > 0) { XSqlQuery cq; cq.prepare("SELECT postCCCredit(:ccpayid, :reftype, :refid) AS result;"); cq.bindValue(":ccpayid", pccpayid); cq.bindValue(":reftype", preftype); cq.bindValue(":refid", prefid); cq.exec(); if (cq.first()) { int result = cq.value("result").toInt(); if (result < 0) { _errorMsg = "

    " + errorMsg(4).arg(storedProcErrorLookup("postCCCredit", result)); returnVal = 1; } } else if (cq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cq.lastError().databaseText()); returnVal = 1; } } if (_metrics->boolean("CCPrintReceipt")) { int receiptReturn = printReceipt(pccpayid); if (receiptReturn != 0 && returnVal == 0) returnVal = receiptReturn; } } return returnVal; } /** @brief Reverse a preauthorization. This method performs application-level error checking and all of the database work required to reverse a prior preauthorization. This makes available to the card holder the funds that have been reserved by that preauthorization. @warning This method should never be overridden. Service-specific functionality should be implemented in the doReversePreauthorized method of the service' subclass. @param pamount The amount to be reversed, not necessarily the same as the amount originally authorized. @param pcurrid The currency of the amount. @param pneworder The order number associated with the preauthorization @param preforder The reference number (preforder) generated by the preauthorization transaction @param pccpayid The internal id of the preauthorization transaction @param preftype Either @c cohead or @c cashrcpt or blank @param prefid The cashrcpt_id or cohead_id associated with the preauthorization transaction @return An index into _errMsg; 0 indicates success */ int CreditCardProcessor::reversePreauthorized(const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int prefid) { if (DEBUG) qDebug("CCP:reversePreauthorized(%f, %d, %s, %s, %d)", pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); reset(); XSqlQuery ccq; ccq.prepare("SELECT * FROM ccpay WHERE (ccpay_id=:ccpayid AND ccpay_status = 'A');"); ccq.bindValue(":ccpayid", pccpayid); ccq.exec(); int ccardid; if (ccq.first()) ccardid = ccq.value("ccpay_ccard_id").toInt(); else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-60); return -60; } // don't checkCreditCard because we want to reverse the authorization regardless QString neworder = ccq.value("ccpay_order_number").toString(); QString reforder = ccq.value("ccpay_r_ordernum").toString(); QString approval = ccq.value("ccpay_r_ref").toString(); ParameterList dbupdateinfo; int returnVal = doReversePreauthorized(ccq.value("ccpay_amount").toDouble(), ccq.value("ccpay_curr_id").toInt(), neworder, reforder, pccpayid, dbupdateinfo); if (returnVal == -74) return -74; else if (returnVal < 0) return returnVal; else if (returnVal > 0) _errorMsg = errorMsg(4).arg(_errorMsg); returnVal = updateCCPay(pccpayid, dbupdateinfo); if (returnVal < 0) return returnVal; double newamount = 0.0; ccq.prepare("UPDATE ccpay SET ccpay_amount = ccpay_amount - :revamount," " ccpay_status = CASE WHEN ccpay_amount - :revamount = 0 THEN 'R'" " ELSE ccpay_status END" " WHERE ccpay_id = :ccpayid RETURNING ccpay_amount;"); ccq.bindValue(":ccpayid", pccpayid); ccq.bindValue(":revamount", pamount); ccq.exec(); if (ccq.first()) { newamount = ccq.value("ccpay_amount").toDouble(); if (DEBUG) qDebug("CCP::reverseAuthorization() set ccpay_amount to %f", newamount); } else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(ccq.lastError().databaseText()); returnVal = 1; } XSqlQuery cashq; if (preftype == "cashrcpt") { cashq.prepare( "UPDATE cashrcpt " "SET cashrcpt_cust_id=ccard_cust_id," " cashrcpt_amount=:amount," " cashrcpt_fundstype=ccard_type," " cashrcpt_bankaccnt_id=ccbank_bankaccnt_id," " cashrcpt_distdate=CURRENT_DATE," " cashrcpt_notes=cashrcpt || E'\\n' || :notes, " " cashrcpt_curr_id=:curr_id," " cashrcpt_usecustdeposit=:custdeposit " "FROM ccard LEFT OUTER JOIN ccbank ON (ccard_type=ccbank_ccard_type) " "WHERE ((cashrcpt_id=:cashrcptid)" " AND (ccard_id=:ccardid)" " AND NOT cashrcpt_posted);" ); cashq.bindValue(":cashrcptid", prefid); cashq.bindValue(":ccardid", ccardid); cashq.bindValue(":amount", newamount); cashq.bindValue(":curr_id", pcurrid); cashq.bindValue(":notes", tr("Credit Card Pre-Authorization %1 reversed") .arg(newamount == 0.0 ? tr("fully") : tr("partially"))); cashq.bindValue(":custdeposit", _metrics->boolean("EnableCustomerDeposits")); cashq.exec(); if (cashq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cashq.lastError().databaseText()); // TODO: log an event? returnVal = 1; } } else if (preftype == "cohead") { if (newamount == 0.0) cashq.prepare("DELETE FROM payco" " WHERE ((payco_ccpay_id=:payco_ccpay_id)" " AND (payco_cohead_id=:payco_cohead_id));"); else { cashq.prepare("INSERT INTO payco VALUES" " (:payco_ccpay_id, :payco_cohead_id," " :payco_amount, :payco_curr_id);"); cashq.bindValue(":payco_amount", pamount); cashq.bindValue(":payco_curr_id", pcurrid); } cashq.bindValue(":payco_ccpay_id", pccpayid); cashq.bindValue(":payco_cohead_id", prefid); cashq.exec(); if (cashq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(cashq.lastError().databaseText()); // TODO: log an event? returnVal = 1; } } if (_metrics->boolean("CCPrintReceipt")) { int receiptReturn = printReceipt(pccpayid); if (receiptReturn != 0 && returnVal == 0) returnVal = receiptReturn; } return returnVal; } /** @brief Processes void transactions. This method performs application-level error checking and all of the database work required to void a prior transaction. It calls doVoid to handle the direct communication with the service. @warning This method should never be overridden. Service-specific functionality should be implemented in the doVoid method of the service' subclass. @param pccpayid This should be the ccpay_id of the original transaction record. @return An index into _errMsg; 0 indicates success */ int CreditCardProcessor::voidPrevious(int &pccpayid) { if (DEBUG) qDebug("CCP:voidPrevious(%d)", pccpayid); // don't reset(); because we're probably voiding because of a previous error XSqlQuery ccq; ccq.prepare("SELECT * FROM ccpay WHERE (ccpay_id=:ccpayid);"); ccq.bindValue(":ccpayid", pccpayid); ccq.exec(); int ccardid; if (ccq.first()) ccardid = ccq.value("ccpay_ccard_id").toInt(); else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-60); return -60; } // don't checkCreditCard because we want to void the transaction regardless QString neworder = ccq.value("ccpay_order_number").toString(); QString reforder = ccq.value("ccpay_r_ordernum").toString(); QString approval = ccq.value("ccpay_r_ref").toString(); ParameterList dbupdateinfo; int returnVal = doVoidPrevious(ccardid, "-2", ccq.value("ccpay_amount").toDouble(), ccq.value("ccpay_curr_id").toInt(), neworder, reforder, approval, pccpayid, dbupdateinfo); if (returnVal == -74) return -74; else if (returnVal < 0) return returnVal; else if (returnVal > 0) _errorMsg = errorMsg(4).arg(_errorMsg); returnVal = updateCCPay(pccpayid, dbupdateinfo); if (returnVal < 0) return returnVal; ccq.prepare("SELECT postCCVoid(:ccpayid) AS result;"); ccq.bindValue(":ccpayid", pccpayid); ccq.exec(); if (ccq.first()) { int result = ccq.value("result").toInt(); if (result < 0) { _errorMsg = "

    " + errorMsg(4).arg(storedProcErrorLookup("postCCVoid", result)); returnVal = 1; } } else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(4).arg(ccq.lastError().databaseText()); returnVal = 1; } if (_metrics->boolean("CCPrintReceipt")) { int receiptReturn = printReceipt(pccpayid); if (receiptReturn != 0 && returnVal == 0) returnVal = receiptReturn; } return returnVal; } /** @brief Returns whether credit card processing is configured in live mode. */ bool CreditCardProcessor::isLive() { return (!_metrics->boolean("CCTest")); } /** @brief Returns whether credit card processing is configured in test mode. */ bool CreditCardProcessor::isTest() { return (_metrics->boolean("CCTest")); } /** @brief Returns the most recent error message set by CreditCardProcessor or one of its subclasses. */ QString CreditCardProcessor::errorMsg() { return _errorMsg; } /** @brief Returns the error message associated with the given pcode. */ QString CreditCardProcessor::errorMsg(const int pcode) { return _msgHash.value(pcode); } /** @brief Check if the given credit card is consistent and active. This consistency %check is used in a number of places before executing a credit card transaction. It confirms that the given card is marked as active in the system and has not expired. If the card has expired based on the expiration month and year, then it is marked as expired in the database. It also makes sure that the CVV has been entered if the system is configured to require it. @param pccid The ccard_id of the credit card to %check @param pcvv The CVV from the card holder, -1 if not known, -2 if the caller knows it is not required or available (such as for void transactions). @param[out] pccard_x The credit card number, with most of the digits replaced with @c X. Used for reporting errors. */ int CreditCardProcessor::checkCreditCard(const int pccid, const QString &pcvv, QString &pccard_x) { XSqlQuery checkCredit; if (DEBUG) qDebug("CCP:checkCreditCard(%d, pcvv)", pccid); reset(); if(omfgThis->_key.isEmpty()) { _errorMsg = errorMsg(-5); return -5; } checkCredit.prepare( "SELECT ccard_active, ccard_cust_id, " " formatbytea(decrypt(setbytea(ccard_month_expired)," " setbytea(:key), 'bf')) AS ccard_month_expired," " formatbytea(decrypt(setbytea(ccard_year_expired)," " setbytea(:key), 'bf')) AS ccard_year_expired," " formatccnumber(decrypt(setbytea(ccard_number)," " setbytea(:key), 'bf')) AS ccard_number_x," " ccard_type, ccbank_bankaccnt_id " " FROM ccard" " LEFT OUTER JOIN ccbank ON (ccard_type=ccbank_ccard_type)" " WHERE (ccard_id=:ccardid);"); checkCredit.bindValue(":ccardid", pccid); checkCredit.bindValue(":key", omfgThis->_key); checkCredit.exec(); if (checkCredit.first()) { pccard_x = checkCredit.value("ccard_number_x").toString(); if (!checkCredit.value("ccard_active").toBool()) { _errorMsg = errorMsg(-10).arg(pccard_x); return -10; } if (checkCredit.value("ccbank_bankaccnt_id").isNull()) { _errorMsg = errorMsg(-94).arg(checkCredit.value("ccard_type").toString()); return -94; } if (checkCredit.value("ccard_year_expired").toInt() < QDate::currentDate().year() || ((checkCredit.value("ccard_year_expired").toInt() == QDate::currentDate().year()) && checkCredit.value("ccard_month_expired").toInt() < QDate::currentDate().month())) { XSqlQuery xpq; xpq.prepare("SELECT expireCreditCard(:custid, setbytea(:key)) AS result;"); xpq.bindValue(":custid", xpq.value("ccard_cust_id")); xpq.bindValue(":key", omfgThis->_key); xpq.exec(); // ignore errors from expirecreditcard() _errorMsg = errorMsg(-11).arg(pccard_x); return -11; } } if (pcvv.isEmpty() && _metrics->boolean("CCRequireCVV")) { _errorMsg = errorMsg(-98); return -98; } else if (pcvv.isEmpty()) { if (QMessageBox::question(0, tr("Confirm No CVV Code"), tr("

    You must confirm that you wish to proceed " "without a CVV code. Would you like to continue?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::No) { _errorMsg = errorMsg(-75); return -75; } } else if (pcvv.toInt() == -2) // TODO: this doesn't feel right ; // the caller knows that this transaction doesn't have cvv available else if (pcvv.length() > 4) { _errorMsg = errorMsg(-99); return -99; } return 0; } /** @brief Placeholder for subclasses to override. @see authorize */ int CreditCardProcessor::doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pParams) { Q_UNUSED(pcvv); Q_UNUSED(pParams); if (DEBUG) qDebug("CCP:doAuthorize(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); _errorMsg = errorMsg(-19).arg("doAuthorize"); return -19; } /** @brief Placeholder for subclasses to override. @see charge */ int CreditCardProcessor::doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pParams) { Q_UNUSED(pcvv); Q_UNUSED(pParams); if (DEBUG) qDebug("CCP:doCharge(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); _errorMsg = errorMsg(-19).arg("doCharge"); return -19; } /** @brief Placeholder for subclasses to override. @see chargePreauthorized */ int CreditCardProcessor::doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pParams) { Q_UNUSED(pcvv); Q_UNUSED(pParams); if (DEBUG) qDebug("CCP:doChargePreauthorized(%d, pcvv, %f, %d, %s, %s, %d)", pccardid, pamount, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); _errorMsg = errorMsg(-19).arg("doChargePreauthorized"); return -19; } /** @brief Placeholder for subclasses to override. @see testConfiguration */ int CreditCardProcessor::doTestConfiguration() { if (DEBUG) qDebug("CCP:doTestConfiguration()"); return 0; // assume that subclasses will override IFF they need to } /** @brief Placeholder for subclasses to override. @see credit */ int CreditCardProcessor::doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pParams) { Q_UNUSED(pcvv); Q_UNUSED(pParams); if (DEBUG) qDebug("CCP:doCredit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); _errorMsg = errorMsg(-19).arg("doCredit"); return -19; } /** @brief Placeholder for subclasses to override. @see reversePreauthorized */ int CreditCardProcessor::doReversePreauthorized(const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int pccpayid, ParameterList &/*pparams*/) { if (DEBUG) qDebug("CCP:doReversePreauthorized(%f, %d, %s, %s, %d)", pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); _errorMsg = errorMsg(-19).arg("doReversePreauthorized"); return -19; } /** @brief Placeholder for subclasses to override. @see voidPrevious */ int CreditCardProcessor::doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pParams) { Q_UNUSED(pcvv); Q_UNUSED(pParams); if (DEBUG) qDebug("CCP:doVoidPrevious(%d, pcvv, %f, %d, %s, %s, %s, %d)", pccardid, pamount, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), papproval.toAscii().data(), pccpayid); _errorMsg = errorMsg(-19).arg("doVoidPrevious"); return -19; } /** @brief Send an HTTP request to the configured credit card service and wait for its response. This method is intended to be called by subclasses of CreditCardProcessor. It sends a message to the service using HTTP or HTTPS, as set by the configuration, and waits for a response. If necessary it applies a local certificate for bidirectional encryption. It is the caller's responsibility to format an appropriate message and decode the response. @param[in] prequest The string to send via HTTP @param[out] presponse The string returned by the service */ int CreditCardProcessor::sendViaHTTP(const QString &prequest, QString &presponse) { if (DEBUG) qDebug("CCP:sendViaHTTP(input, output) with input:\n%s", prequest.toAscii().data()); // TODO: find a better place to save this if (isTest()) _metrics->set("CCOrder", prequest); QString pemfile; #ifdef Q_WS_WIN pemfile = _metrics->value("CCYPWinPathPEM"); #elif defined Q_WS_MACX pemfile = _metrics->value("CCYPMacPathPEM"); #elif defined Q_WS_X11 pemfile = _metrics->value("CCYPLinPathPEM"); #endif #ifndef QT_NO_OPENSSL /* TODO: specific references to YourPay should be replaced with checking a config option indicating that a PEM file is required. http://bugreports.qt.nokia.com/browse/QTBUG-13418 means we must use cURL to handle certificates in some Qt versions. */ if(!_metrics->boolean("CCUseCurl") && (_metrics->value("CCCompany") != "YourPay" || (_metrics->value("CCCompany") == "YourPay" && QT_VERSION > 0x040600))) { if (!pemfile.isEmpty() && (_metrics->value("CCCompany") == "YourPay")) { QFile pemio(pemfile); if (! pemio.exists()) QMessageBox::warning(0, tr("Could not find PEM file"), tr("

    Failed to find the PEM file %1") .arg(pemfile)); else { QList certlist = QSslCertificate::fromPath(pemfile); if (DEBUG) qDebug("%d certificates", certlist.size()); if (certlist.isEmpty()) QMessageBox::warning(0, tr("Failed to load Certificate"), tr("

    There are no Certificates in %1. " "This may cause communication problems.") .arg(pemfile)); else if (certlist.at(0).isNull()) QMessageBox::warning(0, tr("Failed to load Certificate"), tr("

    Failed to load a Certificate from " "the PEM file %1. " "This may cause communication problems.") .arg(pemfile)); else if (certlist.at(0).isValid()) { if (DEBUG) qDebug("Certificate details: valid from %s to %s, issued to %s @ %s in %s, %s", qPrintable(certlist.at(0).effectiveDate().toString("MMM-dd-yyyy")), qPrintable(certlist.at(0).expiryDate().toString("MMM-dd-yyyy")), qPrintable(certlist.at(0).issuerInfo(QSslCertificate::CommonName)), qPrintable(certlist.at(0).issuerInfo(QSslCertificate::Organization)), qPrintable(certlist.at(0).issuerInfo(QSslCertificate::LocalityName)), qPrintable(certlist.at(0).issuerInfo(QSslCertificate::CountryName))); QSslConfiguration sslconf = QSslConfiguration::defaultConfiguration(); sslconf.setLocalCertificate(certlist.at(0)); QSslConfiguration::setDefaultConfiguration(sslconf); } else { QMessageBox::warning(0, tr("Invalid Certificate"), tr("

    The Certificate in %1 appears to be invalid. " "This may cause communication problems.") .arg(pemfile)); } } } QHttp::ConnectionMode cmode = QHttp::ConnectionModeHttps; QUrl ccurl(buildURL(_metrics->value("CCServer"), _metrics->value("CCPort"), true)); if(ccurl.scheme().compare("https", Qt::CaseInsensitive) != 0) cmode = QHttp::ConnectionModeHttp; _http = new QHttp(ccurl.host(), cmode, _metrics->value("CCPort").toInt()); connect(_http, SIGNAL(sslErrors(const QList &)), this, SLOT(sslErrors(const QList &))); if(_metrics->boolean("CCUseProxyServer")) { _http->setProxy(_metrics->value("CCProxyServer"), _metrics->value("CCProxyPort").toInt(), _metricsenc->value("CCProxyLogin"), _metricsenc->value("CCPassword")); } QHttpRequestHeader request("POST", ccurl.encodedPath()); if(!_extraHeaders.isEmpty()) { request.setValues(_extraHeaders); } request.setValue("Host", ccurl.host()); QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); _http->request(request, prequest.toUtf8()); while(_http->hasPendingRequests() || _http->currentId() != 0) { QApplication::processEvents(QEventLoop::WaitForMoreEvents); } QApplication::restoreOverrideCursor(); if(_http->error() != QHttp::NoError) { _errorMsg = errorMsg(-18) .arg(ccurl.toString()) .arg(_http->error()) .arg(_http->errorString()); return -18; } presponse = _http->readAll(); } else #endif // QT_NO_OPENSSL { // TODO: why have a hard-coded path to curl? QProcess proc(this); QString curl_path; #ifdef Q_WS_WIN curl_path = qApp->applicationDirPath() + "\\curl"; #elif defined Q_WS_MACX curl_path = "/usr/bin/curl"; #elif defined Q_WS_X11 curl_path = "/usr/bin/curl"; #endif QStringList curl_args; curl_args.append( "-k" ); curl_args.append( "-d" ); curl_args.append( prequest ); if (!pemfile.isEmpty() && (_metrics->value("CCCompany") == "YourPay")) // This is currently only used for YourPay { curl_args.append( "-E" ); curl_args.append(pemfile); } curl_args.append(buildURL(_metrics->value("CCServer"), _metrics->value("CCPort"), true)); if(_metrics->boolean("CCUseProxyServer")) { curl_args.append( "-x" ); curl_args.append(_metrics->value("CCProxyServer") + QString(_metrics->value("CCProxyPort").toInt() == 0 ? "" : (":" + _metrics->value("CCProxyPort")))); curl_args.append( "-U" ); curl_args.append(_metricsenc->value("CCProxyLogin") + ":" + _metricsenc->value("CCPassword")); } if(!_extraHeaders.isEmpty()) { for(int i = 0; i < _extraHeaders.size(); ++i) { curl_args.append("-H"); curl_args.append(_extraHeaders.at(i).first + ": " + _extraHeaders.at(i).second); } } QString curlCmd = curl_path + ((DEBUG) ? (" " + curl_args.join(" ")) : ""); if (DEBUG) qDebug("%s", curlCmd.toAscii().data()); QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); /* TODO: consider changing to the original implementation: start the proc in a separate thread capture the output as it's generated while (proc->isRunning()) qApp->processEvents(); */ proc.start(curl_path, curl_args); if ( !proc.waitForStarted() ) { QApplication::restoreOverrideCursor(); _errorMsg = errorMsg(-18) .arg(curlCmd) .arg("") .arg(QString(proc.readAllStandardError())); return -18; } if (! proc.waitForFinished()) { QApplication::restoreOverrideCursor(); _errorMsg = errorMsg(-18) .arg(curlCmd) .arg("") .arg(QString(proc.readAllStandardError())); return -18; } QApplication::restoreOverrideCursor(); if (proc.exitStatus() != QProcess::NormalExit) { _errorMsg = errorMsg(-18) .arg(curlCmd) .arg("") .arg(QString(proc.readAllStandardError())); return -18; } if (proc.exitCode() != 0) { _errorMsg = errorMsg(-18) .arg(curlCmd) .arg(proc.exitCode()) .arg(QString(proc.readAllStandardError())); return -18; } presponse = proc.readAllStandardOutput(); } if (isTest()) _metrics->set("CCTestMe", presponse); return 0; } /** @brief Insert into or update the ccpay table based on parameters extracted from the credit card processing service' response to a transaction request. @todo document the parameter names and expected values to help subclassers */ int CreditCardProcessor::updateCCPay(int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("updateCCPay(%d, %d params)", pccpayid, pparams.size()); QString sql; XSqlQuery ccq; bool valid; QVariant param; QString r_error; param = pparams.value("r_error", &valid); if (valid) r_error = param.toString(); if (pccpayid > 0) { param = pparams.value("status", &valid); QString r_status; if (valid) r_status = param.toString(); if (r_status == "X" || r_status == "D") { // ccpay_r_ordernum because it's used to build postauth/capture messages ccq.prepare("INSERT INTO ccpay (" " ccpay_ccard_id, ccpay_cust_id, ccpay_amount," " ccpay_status, ccpay_type, ccpay_auth_charge," " ccpay_order_number, ccpay_order_number_seq," " ccpay_by_username, ccpay_curr_id, ccpay_r_ordernum " ") SELECT " " ccpay_ccard_id, ccpay_cust_id, ccpay_amount," " ccpay_status, ccpay_type, ccpay_auth_charge," " ccpay_order_number, ccpay_order_number_seq + 1," " ccpay_by_username, ccpay_curr_id, ccpay_r_ordernum " " FROM ccpay" " WHERE ((ccpay_id=:id)" " AND (ccpay_type='A'));"); ccq.bindValue(":id", pccpayid); ccq.exec(); } sql = "UPDATE ccpay SET" "" " ccpay_amount=ROUND(currToCurr(," " ," " ," " CURRENT_DATE), 2)," " ccpay_curr_id=," "" " ccpay_amount=ROUND(, 2)," " ccpay_curr_id=," "" " ccpay_auth=," " ccpay_r_approved=," " ccpay_r_avs=," " ccpay_r_code=," " ccpay_r_error=," " ccpay_r_message=," " ccpay_r_ordernum=," " ccpay_r_ref=," "" " ccpay_r_shipping=," "" "" " ccpay_yp_r_score=," "" "" " ccpay_r_tax=," "" "" " ccpay_yp_r_tdate=," "" "" " ccpay_yp_r_time=," "" " ccpay_status=" " WHERE (ccpay_id=);" ; } else { ccq.exec("SELECT NEXTVAL('ccpay_ccpay_id_seq') AS ccpay_id;"); if (ccq.first()) pccpayid = ccq.value("ccpay_id").toInt(); else if (ccq.lastError().type() != QSqlError::NoError && r_error.isEmpty()) { _errorMsg = errorMsg(4).arg(ccq.lastError().databaseText()); return 1; } else if (ccq.lastError().type() == QSqlError::NoError && r_error.isEmpty()) { _errorMsg = errorMsg(4).arg(errorMsg(2)); return 2; } else // no rows found and YP reported an error { _errorMsg = errorMsg(-12).arg(r_error).arg(_company); return -12; } if (pparams.inList("ordernum") && pparams.value("ordernum").toInt() > 0) { QString maxs("SELECT MAX(COALESCE(ccpay_order_number_seq, -1)) + 1" " AS next_seq " " FROM ccpay " " WHERE (ccpay_order_number=);"); MetaSQLQuery maxm(maxs); ccq = maxm.toQuery(pparams); if (ccq.first()) pparams.append("next_seq", ccq.value("next_seq")); else pparams.append("next_seq", 0); } else pparams.append("next_seq", 0); sql = "INSERT INTO ccpay (" " ccpay_id, ccpay_ccard_id, ccpay_cust_id," " ccpay_type," " ccpay_amount," " ccpay_curr_id," " ccpay_auth, ccpay_auth_charge," " ccpay_order_number," " ccpay_order_number_seq," " ccpay_r_approved, ccpay_r_avs," " ccpay_r_code, ccpay_r_error," " ccpay_r_message, ccpay_r_ordernum," " ccpay_r_ref," " ccpay_yp_r_score, " " ccpay_r_shipping, " " ccpay_r_tax, " " ccpay_yp_r_tdate, " " ccpay_yp_r_time, " " ccpay_status" ") SELECT , ccard_id, cust_id," " ," "" " ROUND(currToCurr(," " ," " ,CURRENT_DATE), 2)," " ," "" " ROUND(, 2)," " ," "" " , ," " ," " COALESCE(, 1)," " , ," " , ," " , ," " ," " , " " ," " , " " , " " , " " " " FROM ccard, custinfo" " WHERE ((ccard_cust_id=cust_id)" " AND (ccard_id=));"; } pparams.append("ccpay_id", pccpayid); MetaSQLQuery mql(sql); ccq = mql.toQuery(pparams); if (ccq.lastError().type() != QSqlError::NoError) { pccpayid = -1; _errorMsg = errorMsg(4).arg(ccq.lastError().databaseText()); return 1; } return 0; } /** @brief Return the default port expected by the subclass. This can differ depending on whether running in live or test mode. It is the subclass' responsibility to set both default ports. */ int CreditCardProcessor::defaultPort(bool ptestmode) { if (ptestmode) return _defaultTestPort; else return _defaultLivePort; } /** @brief Return the default server expected by the subclass. This can differ depending on whether running in live or test mode. It is the subclass' responsibility to set both default servers. */ QString CreditCardProcessor::defaultServer() { if (isTest()) return _defaultTestServer; else if (isLive()) return _defaultLiveServer; else return ""; } /** @brief Reset error handling internal settings so previous transactions don't interfere with new transactions. @internal */ void CreditCardProcessor::reset() { _errorMsg = ""; _passedAvs = true; _passedCvv = true; } /** @brief Handle fraud checking as determined by the system configuration. @internal */ int CreditCardProcessor::fraudChecks() { if (DEBUG) qDebug("CCP:fraudChecks()"); int returnValue = 0; if (! _passedAvs && _metrics->value("CCAvsCheck") == "F") { _errorMsg = errorMsg(-97); returnValue = -97; } else if (! _passedAvs && _metrics->value("CCAvsCheck") == "W") { _errorMsg = errorMsg(97) + "\n" + _errorMsg; returnValue = 97; } // not "else if" - maybe this next check will be fatal if (! _passedCvv && _metrics->value("CCCVVCheck") == "F") { _errorMsg = errorMsg(-96); returnValue = -96; } else if (! _passedCvv && _metrics->value("CCCVVCheck") == "W") { _errorMsg = errorMsg(96) + "\n" + _errorMsg; returnValue = 96; } if (DEBUG) qDebug("CCP:fraudChecks() returning %d with _errorMsg %s", returnValue, _errorMsg.toAscii().data()); return returnValue; } /** @brief Print the CCReceipt report for a credit card transaction. @param pccpayid The internal id of the transaction for which to print the receipt */ int CreditCardProcessor::printReceipt(const int pccpayid) { if (DEBUG) qDebug("CCP:printReceipt()"); int returnValue = 0; ParameterList params; params.append("ccpay_id", pccpayid); params.append("preauth", tr("Preauthorization")); params.append("charge", tr("Charge")); params.append("refund", tr("Refund")); params.append("authorized",tr("Authorized")); params.append("approved", tr("Approved")); params.append("declined", tr("Declined")); params.append("reversed", tr("Reversed")); params.append("voided", tr("Voided")); params.append("noapproval",tr("No Approval Code")); params.append("key", omfgThis->_key); orReport report("CCReceipt", params); if (report.isValid()) report.print(); else { report.reportError(0); _errorMsg = errorMsg(94); returnValue = 94; } if (DEBUG) qDebug("CCP:printReceipt() returning %d with _errorMsg %s", returnValue, _errorMsg.toAscii().data()); return returnValue; } QString CreditCardProcessor::typeToCode(CCTransaction ptranstype) { // TODO: do we need to distinguish between Capture and Charge? Reverse and Void switch (ptranstype) { case Authorize: return QString("A"); case Capture: return QString("C"); case Charge: return QString("C"); case Credit: return QString("R"); case Reverse: return QString("V"); case Void: return QString("V"); } return QString::null; } /** @brief Convert between two %currencies. This is slightly different than the version in the CurrDisplay widget because credit card processing has special error reporting needs. @param pfrom The source %currency @param pto The destination %currency @param pamount The value of the transaction in the source %currency @param[out] perror The CreditCardProcessor error code for a failed conversion @return The value of the transaction in the destination %currency */ double CreditCardProcessor::currToCurr(const int pfrom, const int pto, const double pamount, int *perror) { if (pfrom == pto) return pamount; XSqlQuery ccq; ccq.prepare("SELECT ROUND(currToCurr(:fromid, :toid," " :amount, CURRENT_DATE), 2) AS result;"); ccq.bindValue(":fromid", pfrom); ccq.bindValue(":toid", pto); ccq.bindValue(":amount", pamount); ccq.exec(); if (ccq.first()) return ccq.value("result").toDouble(); else if (ccq.lastError().type() != QSqlError::NoError) { _errorMsg = ccq.lastError().databaseText(); if (perror) *perror = -1; } return 0; } /** @brief Returns whether the subclass handles checks. */ bool CreditCardProcessor::handlesChecks() { return false; } /** @brief Returns whether the subclass handles credit cards. */ bool CreditCardProcessor::handlesCreditCards() { return false; } /** @brief Construct a valid URL from the information in the configuration. Handle the case where someone leaves off a piece of the URL when entering the basic configuration. Note that a lot of people are used to typing in web browsers, which fill in some parts for them. If the %user did not enter values for the server or the port on the configuration, use the defaults provided by the service' subclass. @param pserver Use this server, or the defaultServer if blank @param pport Use this port, or the defaultPort if blank @param pinclport Flag whether the port should be part of the constructed URL or not @see defaultServer @see defaultPort */ QString CreditCardProcessor::buildURL(const QString pserver, const QString pport, const bool pinclport) { if (DEBUG) qDebug("buildURL(%s, %s, %d)", pserver.toAscii().data(), pport.toAscii().data(), pinclport); QString defaultprotocol = "https"; QString serverStr = pserver.isEmpty() ? defaultServer() : pserver; QString protocol = serverStr; protocol.remove(QRegExp("://.*")); if (protocol == serverStr) protocol = ""; if (DEBUG) qDebug("protocol: %s", protocol.toAscii().data()); if (protocol.isEmpty()) protocol = defaultprotocol; QString host = serverStr; host.remove(QRegExp("^.*://")).remove(QRegExp("[/:].*")); if (DEBUG) qDebug("host: %s", host.toAscii().data()); QString port = serverStr; port.remove(QRegExp("^([^:/]+://)?[^:]*:")).remove(QRegExp("/.*")); if (port == serverStr || port == host) port = ""; if (DEBUG) qDebug("port: %s", port.toAscii().data()); if (! pinclport) port = ""; else if (port.isEmpty()) port = pport.toInt() == 0 ? QString::number(defaultPort()) : pport; QString remainder = serverStr; remainder.remove(QRegExp("^([^:/]+://)?[^:/]*(:[0-9]+)?/")); if (remainder == serverStr) remainder = ""; if (DEBUG) qDebug("remainder: %s", remainder.toAscii().data()); serverStr = protocol + "://" + host; if (! port.isEmpty() && ! (protocol == "https" && port == "443")) serverStr += ":" + port; serverStr += "/" + remainder; if (DEBUG) qDebug("buildURL: returning %s", serverStr.toAscii().data()); return serverStr; } /** @brief Processes pre-authorization transactions. This version of authorize is intended for use by %scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to authorize(const int pccardid, const int pcvv, const double pamount, double ptax, bool ptaxexempt, double pfreight, double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid): @code var params = new Object; params.ccard_id = _ccardid; params.cvv = _cvv.text; ... var processor = toolbox.getProcessor(); var result = processor.authorize(params); if (result.returnVal < 0) // handle errors else if (result.returnVal > 0) // handle warnings ... @endcode @param pinput The parameter list to unpack and use to call authorize @return A parameter list containing the output parameters, plus one called returnVal holding the return value of authorize */ // TODO: memory leak of poutput! ParameterList CreditCardProcessor::authorize(const ParameterList &pinput) { if (DEBUG) qDebug("authorize(ParameterList&) entered"); ParameterList *poutput = new ParameterList; QVariant param; bool valid; QString context = "authorize"; int ccard_id = -1; QString cvv; double amount = 0.0; double tax = 0.0; bool taxExempt= true; double freight = 0.0; double duty = 0.0; int curr_id = -1; int ccpay_id = -1; int ref_id = -1; QString neworder; QString reforder; QString reftype; param = pinput.value("ccard_id", &valid); if (valid) { ccard_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("ccard_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("cvv", &valid); if (valid) cvv = param.toString(); param = pinput.value("amount", &valid); if (valid) { amount = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("amount").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("tax", &valid); if (valid) { tax = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("tax").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("taxExempt", &valid); if (valid) taxExempt = param.toBool(); param = pinput.value("freight", &valid); if (valid) { freight = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("freight").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("duty", &valid); if (valid) { duty = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("duty").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("curr_id", &valid); if (valid) { curr_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("curr_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("neworder", &valid); if (valid) neworder = param.toString(); param = pinput.value("reforder", &valid); if (valid) reforder = param.toString(); param = pinput.value("reftype", &valid); if (valid) reftype = param.toString(); param = pinput.value("refid", &valid); if (valid) { ref_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("refid").arg("int"); poutput->append("returnVal", -81); return *poutput; } } int returnVal = getProcessor()->authorize(ccard_id, cvv, amount, tax, taxExempt, freight, duty, curr_id, neworder, reforder, ccpay_id, reftype, ref_id); poutput->append("returnVal", returnVal); poutput->append("neworder", neworder); poutput->append("reforder", reforder); poutput->append("ccpayid", ccpay_id); poutput->append("refid", ref_id); return *poutput; } /** @brief Processes charge transactions. This version of charge is intended for use by %scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to charge. @param pinput The parameter list to unpack and use to call charge @return A parameter list containing the output parameters, plus one called returnVal holding the return value of charge @see authorize(const ParameterList &pinput) */ // TODO: memory leak of poutput! ParameterList CreditCardProcessor::charge(const ParameterList &pinput) { if (DEBUG) qDebug("charge(ParameterList&) entered"); ParameterList *poutput = new ParameterList; QVariant param; bool valid; QString context = "charge"; int ccard_id = -1; QString cvv; double amount = 0.0; double tax = 0.0; bool taxExempt= true; double freight = 0.0; double duty = 0.0; int curr_id = -1; int ccpay_id = -1; int ref_id = -1; QString neworder; QString reforder; QString reftype; param = pinput.value("ccard_id", &valid); if (valid) { ccard_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("ccard_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("cvv", &valid); if (valid) cvv = param.toString(); param = pinput.value("amount", &valid); if (valid) { amount = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("amount").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("tax", &valid); if (valid) { tax = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("tax").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("taxExempt", &valid); if (valid) taxExempt = param.toBool(); param = pinput.value("freight", &valid); if (valid) { freight = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("freight").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("duty", &valid); if (valid) { duty = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("duty").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("curr_id", &valid); if (valid) { curr_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("curr_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("neworder", &valid); if (valid) neworder = param.toString(); param = pinput.value("reforder", &valid); if (valid) reforder = param.toString(); param = pinput.value("reftype", &valid); if (valid) reftype = param.toString(); param = pinput.value("refid", &valid); if (valid) { ref_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("refid").arg("int"); poutput->append("returnVal", -81); return *poutput; } } int returnVal = getProcessor()->charge(ccard_id, cvv, amount, tax, taxExempt, freight, duty, curr_id, neworder, reforder, ccpay_id, reftype, ref_id); poutput->append("returnVal", returnVal); poutput->append("neworder", neworder); poutput->append("reforder", reforder); poutput->append("ccpayid", ccpay_id); poutput->append("refid", ref_id); return *poutput; } /** @brief Captures preauthorized transactions. This version of chargePreauthorized is intended for use by %scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to chargePreauthorized. @param pinput The parameter list to unpack and use to call chargePreauthorized @return A parameter list containing the output parameters, plus one called returnVal holding the return value of chargePreauthorized @see authorize(const ParameterList &pinput) */ // TODO: memory leak of poutput! ParameterList CreditCardProcessor::chargePreauthorized(const ParameterList &pinput) { if (DEBUG) qDebug("chargePreauthorized(ParameterList&) entered"); ParameterList *poutput = new ParameterList; QVariant param; bool valid; QString context = "chargePreauthorized"; QString cvv; double amount = 0.0; int curr_id = -1; int ccpay_id = -1; QString neworder; QString reforder; param = pinput.value("cvv", &valid); if (valid) cvv = param.toString(); param = pinput.value("amount", &valid); if (valid) { amount = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("amount").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("curr_id", &valid); if (valid) { curr_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("curr_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("neworder", &valid); if (valid) neworder = param.toString(); param = pinput.value("reforder", &valid); if (valid) reforder = param.toString(); param = pinput.value("ccpay_id", &valid); if (valid) { ccpay_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("ccpay_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } int returnVal = getProcessor()->chargePreauthorized(cvv, amount, curr_id, neworder, reforder, ccpay_id); poutput->append("returnVal", returnVal); poutput->append("neworder", neworder); poutput->append("reforder", reforder); poutput->append("ccpayid", ccpay_id); return *poutput; } /** @brief Processes credit transactions. This version of credit is intended for use by %scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to credit. @param pinput The parameter list to unpack and use to call credit @return A parameter list containing the output parameters, plus one called returnVal holding the return value of credit @see authorize(const ParameterList &pinput) */ // TODO: memory leak of poutput! ParameterList CreditCardProcessor::credit(const ParameterList &pinput) { if (DEBUG) qDebug("credit(ParameterList&) entered"); ParameterList *poutput = new ParameterList; QVariant param; bool valid; QString context = "credit"; int ccard_id = -1; QString cvv; double amount = 0.0; double tax = 0.0; bool taxExempt= true; double freight = 0.0; double duty = 0.0; int curr_id = -1; int ccpay_id = -1; int ref_id = -1; QString neworder; QString reforder; QString reftype; param = pinput.value("ccard_id", &valid); if (valid) { ccard_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("ccard_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("cvv", &valid); if (valid) cvv = param.toString(); param = pinput.value("amount", &valid); if (valid) { amount = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("amount").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("tax", &valid); if (valid) { tax = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("tax").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("taxExempt", &valid); if (valid) taxExempt = param.toBool(); param = pinput.value("freight", &valid); if (valid) { freight = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("freight").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("duty", &valid); if (valid) { duty = param.toDouble(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("duty").arg("double"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("curr_id", &valid); if (valid) { curr_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("curr_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("neworder", &valid); if (valid) neworder = param.toString(); param = pinput.value("reforder", &valid); if (valid) reforder = param.toString(); param = pinput.value("ccpay_id", &valid); if (valid) { ccpay_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("ccpay_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } param = pinput.value("reftype", &valid); if (valid) reftype = param.toString(); param = pinput.value("refid", &valid); if (valid) { ref_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("refid").arg("int"); poutput->append("returnVal", -81); return *poutput; } } int returnVal = getProcessor()->credit(ccard_id, cvv, amount, tax, taxExempt, freight, duty, curr_id, neworder, reforder, ccpay_id, reftype, ref_id); poutput->append("returnVal", returnVal); poutput->append("neworder", neworder); poutput->append("reforder", reforder); poutput->append("ccpayid", ccpay_id); poutput->append("refid", ref_id); return *poutput; } /** @brief Processes void transactions. This version of voidPrevious is intended for use by %scripts. Instead of passing all of the arguments in order, this method allows creating a QtScript object and setting properties on this object by name. Then the script can pass this object to voidPrevious. @param pinput The parameter list to unpack and use to call voidPrevious @return A parameter list containing the output parameters, plus one called returnVal holding the return value of voidPrevious @see authorize(const ParameterList &pinput) */ // TODO: memory leak of poutput! ParameterList CreditCardProcessor::voidPrevious(const ParameterList &pinput) { if (DEBUG) qDebug("voidPrevious(ParameterList&) entered"); ParameterList *poutput = new ParameterList; QVariant param; bool valid; QString context = "voidPrevious"; int ccpay_id = -1; param = pinput.value("ccpay_id", &valid); if (valid) { ccpay_id = param.toInt(&valid); if (!valid) { _errorMsg = errorMsg(-81).arg(context).arg("ccpay_id").arg("int"); poutput->append("returnVal", -81); return *poutput; } } int returnVal = getProcessor()->voidPrevious(ccpay_id); poutput->append("returnVal", returnVal); poutput->append("ccpayid", ccpay_id); return *poutput; } CreditCardProcessor::FraudCheckResult *CreditCardProcessor::avsCodeLookup(QChar pcode) { for (int i = 0; i < _avsCodes.length(); i++) if (_avsCodes.at(i)->code == pcode) return _avsCodes.at(i); return 0; } CreditCardProcessor::FraudCheckResult *CreditCardProcessor::cvvCodeLookup(QChar pcode) { for (int i = 0; i < _cvvCodes.length(); i++) if (_cvvCodes.at(i)->code == pcode) return _cvvCodes.at(i); return 0; } void CreditCardProcessor::sslErrors(const QList &errors) { if (DEBUG) qDebug() << "CreditCardProcessor::sslErrors(" << errors << ")"; QHttp *httpobj = qobject_cast(sender()); if (errors.size() > 0 && httpobj) { QString errlist; for (int i = 0; i < errors.size(); i++) errlist += QString("

  • %1
  • ").arg(errors.at(i).errorString()); if (_ignoreSslErrors || QMessageBox::question(0, tr("Questionable Security"), tr("

    The security of this transaction may be compromised." " The following SSL errors have been reported:" "

      %1

    " "

    Would you like to continue anyway?

    ") .arg(errlist), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) httpobj->ignoreSslErrors(); } } qt-client-4.1.0/guiclient/creditcardprocessor.h000066400000000000000000000155331217451700100216210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CREDITCARDPROCESSOR_H #define CREDITCARDPROCESSOR_H #include #include #include #include #include class CreditCardProcessor : public QObject { Q_OBJECT Q_ENUMS(CCTransaction) Q_ENUMS(CreditCardProcessor::FraudCheck) Q_FLAGS(CreditCardProcessor::FraudChecks) public: enum CCTransaction { Authorize, Reverse, Capture, Charge, Credit, Void }; enum FraudCheck { Match = 0x0000, NoMatch = 0x0001, NotAvail = 0x0002, Address = 0x0004, PostalCode = 0x0008, Name = 0x0010, NotProcessed = 0x0020, Invalid = 0x0040, ServiceUnavailable = 0x0080, IssuerNotCertified = 0x0100, Suspicious = 0x0200, Unsupported = 0x0400 }; Q_DECLARE_FLAGS(FraudChecks, FraudCheck) class FraudCheckResult { public: QChar code; int sev; /*TODO: FraudChecks sev; */ QString text; FraudCheckResult(QChar pcode, int /*TODO: FraudChecks*/ psev, QString ptext); }; virtual ~CreditCardProcessor(); // no public constructor for abstract class, just a factory Q_INVOKABLE static CreditCardProcessor *getProcessor(const QString = QString()); // these are the primary transaction handlers and should not be overridden: virtual int authorize(const int pccardid, const QString &pcvv, const double pamount, double ptax, bool ptaxexempt, double pfreight, double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid); virtual int charge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid); virtual int chargePreauthorized(const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid); virtual int credit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int &prefid); virtual int reversePreauthorized(const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, QString preftype, int prefid); virtual int voidPrevious(int &); // methods for script access Q_INVOKABLE static ParameterList authorize(const ParameterList &); Q_INVOKABLE static ParameterList charge(const ParameterList &); Q_INVOKABLE static ParameterList chargePreauthorized(const ParameterList &); Q_INVOKABLE static ParameterList credit(const ParameterList &); Q_INVOKABLE static ParameterList voidPrevious(const ParameterList &); // these are support methods that typically won't be overridden Q_INVOKABLE virtual int testConfiguration(); Q_INVOKABLE virtual int defaultPort(bool = false); Q_INVOKABLE virtual QString defaultServer(); Q_INVOKABLE virtual bool handlesChecks(); Q_INVOKABLE virtual bool handlesCreditCards(); Q_INVOKABLE virtual bool isLive(); Q_INVOKABLE virtual bool isTest(); Q_INVOKABLE virtual void reset(); Q_INVOKABLE static QString errorMsg(); // most recent error Q_INVOKABLE static QString errorMsg(const int); Q_INVOKABLE static int printReceipt(const int); Q_INVOKABLE static QString typeToCode(CCTransaction ptranstype); protected: CreditCardProcessor(); // do* handle the processor-specific processing and are expected to be overridden virtual int doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams); virtual int doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doReversePreauthorized(const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int pccpayid, ParameterList &pparams); virtual int doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams); virtual int doTestConfiguration(); virtual FraudCheckResult *avsCodeLookup(QChar pcode); virtual QString buildURL(const QString, const QString, const bool); virtual int checkCreditCard(const int pccid, const QString &pcvv, QString &pccard_x); virtual int checkCreditCardProcessor() { return false; }; virtual FraudCheckResult *cvvCodeLookup(QChar pcode); static double currToCurr(const int, const int, const double, int * = 0); virtual int fraudChecks(); virtual int sendViaHTTP(const QString&, QString&); virtual int updateCCPay(int &, ParameterList &); QList _avsCodes; QList _cvvCodes; QString _company; QString _defaultLiveServer; QString _defaultTestServer; int _defaultLivePort; int _defaultTestPort; static QString _errorMsg; bool _ignoreSslErrors; static QHash _msgHash; bool _passedAvs; bool _passedCvv; QString _plogin; QString _ppassword; QString _pport; QString _pserver; QHttp * _http; QList > _extraHeaders; protected slots: void sslErrors(const QList &errors); }; #endif // CREDITCARDPROCESSOR_H qt-client-4.1.0/guiclient/crmaccount.cpp000066400000000000000000001417441217451700100202520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmaccount.h" #include #include #include #include #include #include "characteristicAssignment.h" #include "customer.h" #include "employee.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "incident.h" #include "lotSerialRegistration.h" #include "mqlutil.h" #include "parameterwidget.h" #include "prospect.h" #include "salesRep.h" #include "storedProcErrorLookup.h" #include "taxAuthority.h" #include "user.h" #include "vendor.h" #include "vendorWorkBench.h" #define DEBUG false crmaccount::crmaccount(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _todoList = new todoList(this, "todoList", Qt::Widget); _todoListTab->layout()->addWidget(_todoList); _todoList->setCloseVisible(false); _todoList->list()->hideColumn("crmacct_number"); _todoList->list()->hideColumn("crmacct_name"); _todoList->parameterWidget()->setDefault(tr("User"), QVariant(), true); _todoList->parameterWidget()->append("", "hasContext", ParameterWidget::Exists, true); _todoList->setParameterWidgetVisible(false); _todoList->setQueryOnStartEnabled(false); _todoList->_projects->setForgetful(true); _todoList->_projects->setVisible(false); _todoList->_projects->setChecked(false); _contacts = new contacts(this, "contacts", Qt::Widget); _allPage->layout()->addWidget(_contacts); _contacts->setCloseVisible(false); _contacts->list()->hideColumn("crmacct_number"); _contacts->list()->hideColumn("crmacct_name"); _contacts->parameterWidget()->append("", "hasContext", ParameterWidget::Exists, true); _contacts->setParameterWidgetVisible(false); _contacts->setQueryOnStartEnabled(false); _owner->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_competitor, SIGNAL(clicked()), this, SLOT(sCompetitor())); connect(_customerButton, SIGNAL(clicked()), this, SLOT(sCustomer())); connect(_deleteCharacteristic,SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic())); connect(_deleteReg, SIGNAL(clicked()), this, SLOT(sDeleteReg())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic())); connect(_editReg, SIGNAL(clicked()), this, SLOT(sEditReg())); connect(_employeeButton, SIGNAL(clicked()), this, SLOT(sEmployee())); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic())); connect(_newReg, SIGNAL(clicked()), this, SLOT(sNewReg())); connect(_partner, SIGNAL(clicked()), this, SLOT(sPartner())); connect(_prospectButton, SIGNAL(clicked()), this, SLOT(sProspect())); connect(_salesrepButton, SIGNAL(clicked()), this, SLOT(sSalesRep())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxauthButton, SIGNAL(clicked()), this, SLOT(sTaxAuth())); connect(_userButton, SIGNAL(clicked()), this, SLOT(sUser())); connect(_vendorButton, SIGNAL(clicked()), this, SLOT(sEditVendor())); connect(omfgThis, SIGNAL(customersUpdated(int, bool)), this, SLOT(sUpdateRelationships())); connect(omfgThis, SIGNAL(employeeUpdated(int)), this, SLOT(sUpdateRelationships())); connect(omfgThis, SIGNAL(prospectsUpdated()), this, SLOT(sUpdateRelationships())); connect(omfgThis, SIGNAL(salesRepUpdated(int)), this, SLOT(sUpdateRelationships())); connect(omfgThis, SIGNAL(taxAuthsUpdated(int)), this, SLOT(sUpdateRelationships())); connect(omfgThis, SIGNAL(vendorsUpdated()), this, SLOT(sUpdateRelationships())); connect(omfgThis, SIGNAL(userUpdated(QString)), this, SLOT(sUpdateRelationships())); connect(_customer, SIGNAL(toggled(bool)), this, SLOT(sCustomerToggled())); connect(_prospect, SIGNAL(toggled(bool)), this, SLOT(sProspectToggled())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sCheckNumber())); connect(_primaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_secondaryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_allButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_contacts, SIGNAL(cntctDetached(int)), this, SLOT(sHandleCntctDetach(int))); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name"); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value"); _reg->addColumn(tr("Lot/Serial") , _itemColumn, Qt::AlignLeft, true, "ls_number" ); _reg->addColumn(tr("Item") , _itemColumn, Qt::AlignLeft, true, "item_number" ); _reg->addColumn(tr("Description") , -1, Qt::AlignLeft, true, "item_descrip1" ); _reg->addColumn(tr("Qty" ) , _qtyColumn, Qt::AlignLeft, true, "lsreg_qty" ); _reg->addColumn(tr("Sold" ), _dateColumn, Qt::AlignLeft, true, "lsreg_solddate" ); _reg->addColumn(tr("Registered" ), _dateColumn, Qt::AlignLeft, true, "lsreg_regdate" ); _reg->addColumn(tr("Expires" ) , _dateColumn, Qt::AlignLeft, true, "lsreg_expiredate" ); if (_preferences->boolean("XCheckBox/forgetful")) _active->setChecked(true); _NumberGen = -1; _mode = cView; _crmacctId = -1; // TODO: setId(-1)? _competitorId = -1; _custId = -1; _empId = -1; _partnerId = -1; _prospectId = -1; _salesrepId = -1; _taxauthId = -1; _username = ""; _vendId = -1; _comments->setId(-1); _documents->setId(-1); _modal = parent && (parent->inherits("customer") || parent->inherits("employee") || parent->inherits("prospect") || parent->inherits("salesRep") || parent->inherits("taxAuthority") || parent->inherits("user") || parent->inherits("vendor")); if (_modal) setWindowModality(Qt::WindowModal); _canCreateUsers = false; if (!_metrics->boolean("LotSerialControl")) _tab->removeTab(_tab->indexOf(_registrationsTab)); if(_metrics->value("CRMAccountNumberGeneration") == "A") { _number->setFocusPolicy(Qt::NoFocus); _active->setFocusPolicy(Qt::NoFocus); } } crmaccount::~crmaccount() { // no need to delete child widgets, Qt does it all for us } void crmaccount::languageChange() { retranslateUi(this); } enum SetResponse crmaccount::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _number->clear(); if(((_metrics->value("CRMAccountNumberGeneration") == "A") || (_metrics->value("CRMAccountNumberGeneration") == "O")) && _number->text().isEmpty() ) { XSqlQuery numq; numq.exec("SELECT fetchCRMAccountNumber() AS number;"); if (numq.first()) { _number->setText(numq.value("number")); _NumberGen = numq.value("number").toInt(); } } XSqlQuery insq; insq.prepare("INSERT INTO crmacct(crmacct_number, crmacct_name," " crmacct_active, crmacct_type)" " SELECT CASE WHEN :number > 1 THEN " " CAST(:number AS TEXT) " " ELSE 'TEMPORARY' || (last_value + 1) " " END, " " '', true, 'O' " " FROM crmacct_crmacct_id_seq" " RETURNING crmacct_id AS result;"); insq.bindValue(":number", _NumberGen); insq.exec(); if (insq.first()) { setId(insq.value("result").toInt()); if (_NumberGen <= 0) _number->clear(); // don't show TEMPORARY# _primary->setSearchAcct(-1); _secondary->setSearchAcct(-1); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error creating Initial Account"), insq, __FILE__, __LINE__)) return UndefinedError; _mode = cNew; connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _mode = cEdit; connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); } else if (param.toString() == "view") { _mode = cView; _save->hide(); disconnect(_reg, SIGNAL(valid(bool)), _editReg, SLOT(setEnabled(bool))); disconnect(_reg, SIGNAL(valid(bool)), _deleteReg, SLOT(setEnabled(bool))); disconnect(_reg, SIGNAL(valid(bool)), _editReg, SLOT(animateClick())); ParameterList params; params.append("mode", "view"); _contacts->set(params); } } param = pParams.value("crmacct_id", &valid); if (valid) setId(param.toInt()); /* TODO: "scripted" was added for issue 6804 but a) no xtuple scripts seem to use it and b) it isn't sufficiently precise to be useful anyway why don't scripts just call setCurrentIndex if they care? */ if(pParams.inList("scripted")) _tab->setCurrentIndex(_tab->indexOf(_todoListTab)); bool canEdit = (_mode == cNew || _mode == cEdit); _active->setEnabled(canEdit); _comments->setReadOnly(! canEdit); _documents->setReadOnly(! canEdit); _name->setEnabled(canEdit); _newCharacteristic->setEnabled(canEdit); _newReg->setEnabled(canEdit); _notes->setEnabled(canEdit); _number->setEnabled(canEdit && _metrics->value("CRMAccountNumberGeneration") != "A"); _owner->setEnabled(canEdit && _privileges->check("EditOwner")); _parentCrmacct->setEnabled(canEdit); _primary->setEnabled(canEdit); _secondary->setEnabled(canEdit); _typeBox->setEnabled(canEdit); sHandleChildButtons(); return NoError; } void crmaccount::sClose() { if (_mode == cNew) { if (QMessageBox::question(this, tr("Close without saving?"), tr("

    Are you sure you want to close this window " "without saving the new CRM Account?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); XSqlQuery detachq; detachq.prepare("SELECT MIN(detachContact(cntct_id, :crmacct_id)) AS returnVal " "FROM cntct " "WHERE (cntct_crmacct_id=:crmacct_id);"); detachq.bindValue(":crmacct_id", _crmacctId); detachq.exec(); if (detachq.first()) { int returnVal = detachq.value("returnVal").toInt(); if (returnVal < 0) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error detaching Contact from CRM Account."), storedProcErrorLookup("detachContact", returnVal), __FILE__, __LINE__); return; } } else if (detachq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error detaching Contact from CRM Account"), detachq, __FILE__, __LINE__); return; } // TODO: handle _username // can't delete in alpha order because of dependencies struct { QString table; QString keycol; int keyval; } toDelete[] = { { "emp", "emp_id", _empId }, { "salesrep", "salesrep_id", _salesrepId }, { "custinfo", "cust_id", _custId }, { "prospect", "prospect_id", _prospectId }, { "vendinfo", "vend_id", _vendId }, { "taxauth", "taxauth_id", _taxauthId } }; XSqlQuery deleteq; for (unsigned int i = 0; i < sizeof(toDelete) / sizeof(toDelete[0]); i++) { if (toDelete[i].keyval <= 0) continue; deleteq.prepare(QString("DELETE FROM %1 WHERE %2=%3") .arg(toDelete[i].table, toDelete[i].keycol) .arg(toDelete[i].keyval)); deleteq.exec(); if (deleteq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting a child record"), deleteq, __FILE__, __LINE__); return; } } // for each thing to delete deleteq.prepare("DELETE FROM crmacct WHERE crmacct_id=:crmacct_id;"); deleteq.bindValue(":crmacct_id", _crmacctId); deleteq.exec(); if (deleteq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting the initial CRM Account record"), deleteq, __FILE__, __LINE__); return; } XSqlQuery commit("COMMIT;"); omfgThis->sCrmAccountsUpdated(_crmacctId); } // if cNew close(); } void crmaccount::sSave() { bool numberIsUsed = false; XSqlQuery dupq; dupq.prepare( "SELECT crmacct_number " "FROM crmacct " "WHERE ((crmacct_number=:number)" " AND (crmacct_id<>:crmacct_id) );" ); dupq.bindValue(":crmacct_id", _crmacctId); dupq.bindValue(":number", _number->text()); dupq.exec(); if (dupq.first()) numberIsUsed = true; else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error looking for duplicate CRM Account Number"), dupq, __FILE__, __LINE__)) return; QString incomplete = tr("The %1 relationship is selected but no appropriate " "data have been created. Either click the %2 button " " to enter the data or unselect the check box."); QList errors; errors<< GuiErrorCheck(numberIsUsed, _number, tr("This CRM Account Number is already in use by an " "existing CRM Account. Please choose a different " "number and save again.")) << GuiErrorCheck(_number->text().isEmpty(), _number, tr("You must enter a number for this CRM Account " "before saving it.")) << GuiErrorCheck(_name->text().isEmpty(), _name, tr("You must enter a name for this CRM Account before " "saving it.")) << GuiErrorCheck(_parentCrmacct->id() == _crmacctId, _parentCrmacct, tr("This CRM Account cannot be a parent " "to itself.")) << GuiErrorCheck(_customer->isChecked() && _prospectId > 0, _customerButton, tr("This CRM Account is a Prospect but it is marked " "as a Customer. Either mark it as a Prospect or " "click %1 to convert it before saving.") .arg(_customerButton->text())) << GuiErrorCheck(_customer->isChecked() && _custId <= 0, _customerButton, incomplete.arg(tr("Customer"), _customerButton->text())) << GuiErrorCheck(_employee->isChecked() && _empId <= 0, _employeeButton, incomplete.arg(tr("Employee"), _employeeButton->text())) << GuiErrorCheck(_prospect->isChecked() && _custId > 0, _prospectButton, tr("This CRM Account is a Customer but it is marked " "as a Prospect. Either mark it as a Customer or " "click %1 to convert it before saving.") .arg(_prospectButton->text())) << GuiErrorCheck(_prospect->isChecked() && _prospectId <= 0, _prospectButton, incomplete.arg(tr("Prospect"), _prospectButton->text())) << GuiErrorCheck(_salesrep->isChecked() && _salesrepId <= 0, _salesrepButton, incomplete.arg(tr("Sales Rep"), _salesrepButton->text())) << GuiErrorCheck(_taxauth->isChecked() && _taxauthId <= 0, _taxauthButton, incomplete.arg(tr("Tax Authority"), _taxauthButton->text())) << GuiErrorCheck(_user->isChecked() && _username.isEmpty(), _userButton, incomplete.arg(tr("User"), _userButton->text())) << GuiErrorCheck(_vendor->isChecked() && _vendId <= 0, _vendorButton, incomplete.arg(tr("Vendor"), _vendorButton->text())) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save CRM Account"), errors)) return; // TODO: handle _username // this must be ordered to avoid foreign key dependency errors struct { QString type; QString table; QString keycol; QCheckBox *box; int *idvar; } toDelete[] = { { tr("Employee"), "emp", "emp_id", _employee, &_empId }, { tr("Sales Rep"), "salesrep", "salesrep_id", _salesrep, &_salesrepId }, { tr("Customer"), "custinfo", "cust_id", _customer, &_custId }, { tr("Prospect"), "prospect", "prospect_id", _prospect, &_prospectId }, { tr("Vendor"), "vendinfo", "vend_id", _vendor, &_vendId }, { tr("Tax Auth"), "taxauth", "taxauth_id", _taxauth, &_taxauthId } }; for (unsigned int i = 0; i < sizeof(toDelete) / sizeof(toDelete[0]); i++) { if (*(toDelete[i].idvar) > 0 && ! toDelete[i].box->isChecked() && QMessageBox::question(this, tr("Delete %1?").arg(toDelete[i].type), tr("

    Are you sure you want to delete %1 as a %2?") .arg(_number->text(), toDelete[i].type), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { toDelete[i].box->setChecked(true); return; } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), begin, __FILE__, __LINE__)) return; XSqlQuery deleteq; for (unsigned int i = 0; i < sizeof(toDelete) / sizeof(toDelete[0]); i++) { if (toDelete[i].box->isChecked()) continue; deleteq.prepare(QString("DELETE FROM %1 WHERE (%2=%3);") .arg(toDelete[i].table, toDelete[i].keycol) .arg(*(toDelete[i].idvar))); deleteq.exec(); if (deleteq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting %1").arg(toDelete[i].type), deleteq, __FILE__, __LINE__); return; } *(toDelete[i].idvar) = -1; } // for each thing to delete QSqlError err = saveNoErrorCheck(true); if (err.type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__); return; } XSqlQuery commit("COMMIT;"); _NumberGen = -1; if (commit.lastError().type() != QSqlError::NoError) { ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), commit, __FILE__, __LINE__); return; } omfgThis->sCrmAccountsUpdated(_crmacctId); omfgThis->sCustomersUpdated(-1, TRUE); omfgThis->sEmployeeUpdated(-1); omfgThis->sProspectsUpdated(); omfgThis->sTaxAuthsUpdated(-1); omfgThis->sSalesRepUpdated(-1); omfgThis->sUserUpdated(""); omfgThis->sVendorsUpdated(); emit saved(_crmacctId); close(); } QSqlError crmaccount::saveNoErrorCheck(bool pInTxn) { XSqlQuery updateq; updateq.prepare("UPDATE crmacct " "SET crmacct_id=:crmacct_id," " crmacct_number=UPPER(:crmacct_number)," " crmacct_name=:crmacct_name," " crmacct_parent_id=:crmacct_parent_id," " crmacct_active=:crmacct_active," " crmacct_type=:crmacct_type," " crmacct_cust_id=:crmacct_cust_id," " crmacct_competitor_id=:crmacct_competitor_id," " crmacct_partner_id=:crmacct_partner_id," " crmacct_prospect_id=:crmacct_prospect_id," " crmacct_taxauth_id=:crmacct_taxauth_id," " crmacct_vend_id=:crmacct_vend_id," " crmacct_cntct_id_1=:crmacct_cntct_id_1," " crmacct_cntct_id_2 =:crmacct_cntct_id_2," " crmacct_owner_username =:crmacct_owner_username," " crmacct_notes=:crmacct_notes," " crmacct_emp_id=:crmacct_emp_id," " crmacct_salesrep_id=:crmacct_salesrep_id," " crmacct_usr_username=:crmacct_usr_username" " WHERE (crmacct_id=:crmacct_id);" ); updateq.bindValue(":crmacct_id", _crmacctId); updateq.bindValue(":crmacct_number", _number->text()); updateq.bindValue(":crmacct_name", _name->text()); updateq.bindValue(":crmacct_active", QVariant(_active->isChecked())); updateq.bindValue(":crmacct_type", _organization->isChecked() ? "O" : "I"); updateq.bindValue(":crmacct_notes", _notes->toPlainText()); if (_custId > 0) updateq.bindValue(":crmacct_cust_id", _custId); if (_competitorId > 0) updateq.bindValue(":crmacct_competitor_id", _competitorId); if (_partnerId > 0) updateq.bindValue(":crmacct_partner_id", _partnerId); if (_prospectId > 0) updateq.bindValue(":crmacct_prospect_id", _prospectId); if (_taxauthId > 0) updateq.bindValue(":crmacct_taxauth_id", _taxauthId); if (_vendId > 0) updateq.bindValue(":crmacct_vend_id", _vendId); if (_primary->id() > 0) updateq.bindValue(":crmacct_cntct_id_1", _primary->id()); if (_secondary->id() > 0) updateq.bindValue(":crmacct_cntct_id_2", _secondary->id()); if (_parentCrmacct->id() > 0) updateq.bindValue(":crmacct_parent_id", _parentCrmacct->id()); if (_empId > 0) updateq.bindValue(":crmacct_emp_id", _empId); if (_salesrepId > 0) updateq.bindValue(":crmacct_salesrep_id", _salesrepId); if (! _username.isEmpty()) updateq.bindValue(":crmacct_usr_username", _username); if (! _owner->username().isEmpty()) updateq.bindValue(":crmacct_owner_username", _owner->username()); updateq.exec(); // no error check here. this method is specifically "saveNoErrorCheck()" if (! pInTxn) omfgThis->sCrmAccountsUpdated(_crmacctId); return updateq.lastError(); } void crmaccount::sNewCharacteristic() { ParameterList params; params.append("mode", "new"); params.append("crmacct_id", _crmacctId); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sGetCharacteristics(); } void crmaccount::sEditCharacteristic() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sGetCharacteristics(); } void crmaccount::sDeleteCharacteristic() { XSqlQuery delcaq; delcaq.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); delcaq.bindValue(":charass_id", _charass->id()); delcaq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting Characteristic Assignment"), delcaq, __FILE__, __LINE__)) return; sGetCharacteristics(); } void crmaccount::sGetCharacteristics() { XSqlQuery getcaq; getcaq.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value " "FROM charass, char " "WHERE ( (charass_target_type='CRMACCT')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:crmacct_id) ) " "ORDER BY char_order, char_name;" ); getcaq.bindValue(":crmacct_id", _crmacctId); getcaq.exec(); _charass->populate(getcaq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error getting Characteristic Assignments"), getcaq, __FILE__, __LINE__)) return; } int crmaccount::id() { return _crmacctId; } void crmaccount::setId(int id) { _crmacctId = id; _todoList->parameterWidget()->setDefault(tr("CRM Account"), _crmacctId, true); _contacts->setCrmacctid(_crmacctId); sPopulate(); if (cView != _mode) _mode = cEdit; emit newId(_crmacctId); } void crmaccount::sPopulate() { XSqlQuery getq; getq.prepare( "SELECT *, userCanCreateUsers(getEffectiveXtUser()) AS cancreateusers " "FROM crmacct " "WHERE (crmacct_id=:crmacct_id);" ); getq.bindValue(":crmacct_id", _crmacctId); getq.exec(); if (getq.first()) { _number->setText(getq.value("crmacct_number").toString()); _name->setText(getq.value("crmacct_name").toString()); _active->setChecked(getq.value("crmacct_active").toBool()); QString acctType = getq.value("crmacct_type").toString(); if (acctType == "O") _organization->setChecked(true); else if (acctType == "I") _individual->setChecked(true); else qWarning("crmaccount::sPopulate() - acctType '%s' incorrect", qPrintable(acctType)); _canCreateUsers = getq.value("cancreateusers").toBool(); _competitorId = getq.value("crmacct_competitor_id").toInt(); _custId = getq.value("crmacct_cust_id").toInt(); _empId = getq.value("crmacct_emp_id").toInt(); _partnerId = getq.value("crmacct_partner_id").toInt(); _prospectId = getq.value("crmacct_prospect_id").toInt(); _salesrepId = getq.value("crmacct_salesrep_id").toInt(); _taxauthId = getq.value("crmacct_taxauth_id").toInt(); _username = getq.value("crmacct_usr_username").toString(); _vendId = getq.value("crmacct_vend_id").toInt(); _primary->setId(getq.value("crmacct_cntct_id_1").toInt()); _secondary->setId(getq.value("crmacct_cntct_id_2").toInt()); _notes->setText(getq.value("crmacct_notes").toString()); _parentCrmacct->setId(getq.value("crmacct_parent_id").toInt()); _comments->setId(_crmacctId); _documents->setId(_crmacctId); _primary->setSearchAcct(_crmacctId); _secondary->setSearchAcct(_crmacctId); _owner->setUsername(getq.value("crmacct_owner_username").toString()); sHandleChildButtons(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error reading the CRM Account"), getq, __FILE__, __LINE__)) return; else { _number->clear(); _name->clear(); _NumberGen = -1; _crmacctId = -1; _competitorId = -1; _custId = -1; _empId = -1; _partnerId = -1; _prospectId = -1; _salesrepId = -1; _taxauthId = -1; _username = ""; _vendId = -1; _comments->setId(-1); _documents->setId(-1); _canCreateUsers = false; sHandleChildButtons(); } sGetCharacteristics(); sPopulateRegistrations(); _contacts->sFillList(); _todoList->sFillList(); } void crmaccount::sCompetitor() { _competitorId = (_competitor->isChecked() ? 1 : 0); } void crmaccount::sCustomer() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; if (_prospectId > 0 && (cNew == _mode || cEdit == _mode) && _privileges->check("MaintainProspectMasters") && _privileges->check("MaintainCustomerMasters")) { int quotecount = 0; if (_privileges->check("ConvertQuotes")) { XSqlQuery quq; quq.prepare("SELECT COUNT(*) AS quotecount" " FROM quhead" " WHERE (COALESCE(quhead_expire, endOfTime()) >= CURRENT_DATE)" " AND (quhead_cust_id=:id);"); quq.bindValue(":id", _custId); quq.exec(); if (quq.first()) quotecount = quq.value("quotecount").toInt(); // ignore errors } if (QMessageBox::question(this, tr("Convert"), tr("

    Are you sure you want to convert this " "Prospect to a Customer?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; bool convertquotes = quotecount != 0 && (QMessageBox::question(this, tr("Convert"), tr("

    Do you want to convert all of the " "Quotes for the Prospect to " "Sales Orders?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes); XSqlQuery convertq; convertq.prepare("SELECT convertProspectToCustomer(:id, :convertquotes);"); convertq.bindValue(":id", _prospectId); convertq.bindValue(":convertquotes", convertquotes); convertq.exec(); if (convertq.first()) { _custId = _prospectId; _prospectId = -1; omfgThis->sProspectsUpdated(); omfgThis->sCustomersUpdated(_custId, true); } // convert prospect to customer else if (ErrorReporter::error(QtCriticalMsg, this, tr("Convert Error"), convertq, __FILE__, __LINE__)) return; params.append("cust_id", _custId); params.append("mode", "edit"); } else if (_custId <= 0 && (cNew == _mode || cEdit == _mode) && _privileges->check("MaintainCustomerMasters")) { params.append("crmacct_id", _crmacctId); params.append("mode", "new"); } else if (_custId > 0) { params.append("cust_id", _custId); params.append("mode", (_privileges->check("MaintainCustomerMasters") && (cNew == _mode || cEdit == _mode)) ? "edit" : "view"); } customer *newdlg = new customer(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccount::sPartner() { _partnerId = (_partner->isChecked() ? 1 : 0); } void crmaccount::sProspect() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; if (_custId > 0 && (cNew == _mode || cEdit == _mode) && _privileges->check("MaintainProspectMasters") && _privileges->check("MaintainCustomerMasters")) { if (QMessageBox::question(this, tr("Convert"), tr("

    Are you sure you want to convert this Customer to " "a Prospect and delete its Customer information?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery createq; createq.prepare("SELECT convertCustomerToProspect(:id) AS prospect_id;"); createq.bindValue(":id", _custId); createq.exec(); if (createq.first()) { _prospectId = createq.value("prospect_id").toInt(); _custId = -1; omfgThis->sProspectsUpdated(); omfgThis->sCustomersUpdated(_prospectId, true); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error creating Prospect"), createq, __FILE__, __LINE__)) return; params.append("prospect_id", _prospectId); params.append("mode", "edit"); } else if (_prospectId <= 0 && (cNew == _mode || cEdit == _mode) && _privileges->check("MaintainProspectMasters")) { params.append("crmacct_id", _crmacctId); params.append("mode", "new"); } else if (_prospectId > 0) { params.append("prospect_id", _prospectId); params.append("mode", (_privileges->check("MaintainProspectMasters") && (cNew == _mode || cEdit == _mode)) ? "edit" : "view"); } prospect *newdlg = new prospect(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccount::sTaxAuth() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; if (_taxauthId <= 0 && _privileges->check("MaintainTaxAuthorities") && (cNew == _mode || cEdit == _mode)) { params.append("crmacct_id", _crmacctId); params.append("mode", "new"); } else { params.append("taxauth_id", _taxauthId); params.append("mode", (_privileges->check("MaintainTaxAuthorities") && (cNew == _mode || cEdit == _mode)) ? "edit" : "view"); } taxAuthority *newdlg = new taxAuthority(this); newdlg->set(params); newdlg->exec(); } void crmaccount::sEditVendor() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; if (_vendId <= 0 && _privileges->check("MaintainVendors") && (cNew == _mode || cEdit == _mode)) { params.append("crmacct_id", _crmacctId); params.append("mode", "new"); } else { params.append("vend_id", _vendId); params.append("mode", (_privileges->check("MaintainVendors") && (cNew == _mode || cEdit == _mode)) ? "edit" : "view"); } vendor *newdlg = new vendor(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccount::sViewVendor() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; params.append("vend_id", _vendId); params.append("mode", "view"); vendor *newdlg = new vendor(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccount::sUpdateRelationships() { if (DEBUG) qDebug("crmaccount::sUpdateRelationships() entered"); XSqlQuery getq; getq.prepare("SELECT * FROM crmacct WHERE (crmacct_id=:crmacct_id);" ); getq.bindValue(":crmacct_id", _crmacctId); getq.exec(); if (getq.first()) { _number->setText(getq.value("crmacct_number").toString()); _name->setText(getq.value("crmacct_name").toString()); _competitorId = getq.value("crmacct_competitor_id").toInt(); _custId = getq.value("crmacct_cust_id").toInt(); _empId = getq.value("crmacct_emp_id").toInt(); _partnerId = getq.value("crmacct_partner_id").toInt(); _prospectId = getq.value("crmacct_prospect_id").toInt(); _salesrepId = getq.value("crmacct_salesrep_id").toInt(); _taxauthId = getq.value("crmacct_taxauth_id").toInt(); _username = getq.value("crmacct_usr_username").toString(); _vendId = getq.value("crmacct_vend_id").toInt(); sHandleChildButtons(); _owner->setUsername(getq.value("crmacct_owner_username").toString()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error reading the CRM Account"), getq, __FILE__, __LINE__)) return; _contacts->sFillList(); } void crmaccount::doDialog(QWidget *parent, const ParameterList & pParams) { crmaccount * ci = new crmaccount(parent); ci->set(pParams); omfgThis->handleNewWindow(ci); } void crmaccount::sVendorInfo() { ParameterList params; params.append("vend_id", _vendId); vendorWorkBench *newdlg = new vendorWorkBench(this, "vendorWorkBench", Qt::Window); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccount::sCustomerToggled() { if (_customer->isChecked()) _prospect->setChecked(FALSE); } void crmaccount::sProspectToggled() { if (_prospect->isChecked()) _customer->setChecked(FALSE); } void crmaccount::sPopulateRegistrations() { if (_metrics->boolean("LotSerialControl")) { XSqlQuery lsq; lsq.prepare( "SELECT lsreg_id,ls_number,item_number, item_descrip1, " "lsreg_qty,'qty' AS lsreg_qty_xtnumericrole,lsreg_solddate," "lsreg_regdate,lsreg_expiredate, " "CASE WHEN lsreg_expiredate <= current_date THEN " " 'expired' " "END AS lsreg_expiredate_qtforegroundrole " "FROM lsreg,ls,item " "WHERE ((lsreg_ls_id=ls_id) " "AND (ls_item_id=item_id) " "AND (lsreg_crmacct_id=:crmacct_id));"); lsq.bindValue(":crmacct_id", _crmacctId); lsq.exec(); _reg->clear(); _reg->populate(lsq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error collecting Lot/Serial data"), lsq, __FILE__, __LINE__)) return; } } void crmaccount::sNewReg() { ParameterList params; params.append("mode", "new"); params.append("crmacct_id", _crmacctId); lotSerialRegistration newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sPopulateRegistrations(); } void crmaccount::sEditReg() { ParameterList params; params.append("mode", "edit"); params.append("lsreg_id", _reg->id()); lotSerialRegistration newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sPopulateRegistrations(); } void crmaccount::sDeleteReg() { XSqlQuery delq; delq.prepare( "DELETE FROM lsreg " "WHERE (lsreg_id=:lsreg_id);" "DELETE FROM charass " "WHERE ((charass_target_type='LSR') " "AND (charass_target_id=:lsreg_id))" ); delq.bindValue(":lsreg_id", _reg->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting Lot/Serial data"), delq, __FILE__, __LINE__)) return; sPopulateRegistrations(); } void crmaccount::sCheckNumber() { if (DEBUG) qDebug("crmaccount::sCheckNumber()"); if (_number->text().length()) { _number->setText(_number->text().trimmed().toUpper()); XSqlQuery query; if(-1 != _NumberGen && _number->text().toInt() != _NumberGen) { query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } XSqlQuery newq; newq.prepare("SELECT crmacct_id " "FROM crmacct " "WHERE ((UPPER(crmacct_number)=UPPER(:crmacct_number))" " AND (crmacct_id!=:crmacct_id));" ); newq.bindValue(":crmacct_number", _number->text()); newq.bindValue(":crmacct_id", _crmacctId); newq.exec(); if (newq.first()) { // Delete temporary query.prepare( "DELETE FROM crmacct WHERE (crmacct_id=:crmacct_id);" ); query.bindValue(":crmacct_id", _crmacctId); query.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting temporary CRM Account"), query, __FILE__, __LINE__)) return; setId(newq.value("crmacct_id").toInt()); sPopulate(); connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); _number->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), newq, __FILE__, __LINE__)) return; } } void crmaccount::closeEvent(QCloseEvent *pEvent) { if(-1 != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), query, __FILE__, __LINE__); _NumberGen = -1; } XWidget::closeEvent(pEvent); } void crmaccount::sHandleButtons() { if (_primaryButton->isChecked()) _widgetStack->setCurrentIndex(_widgetStack->indexOf(_primaryPage)); else if (_secondaryButton->isChecked()) _widgetStack->setCurrentIndex(_widgetStack->indexOf(_secondaryPage)); else _widgetStack->setCurrentIndex(_widgetStack->indexOf(_allPage)); } void crmaccount::sHandleChildButtons() { bool canEdit = (_mode == cNew || _mode == cEdit); if (DEBUG) qDebug("sHandleChildButtons() entered with competitor %d, customer %d, " "employee %d, partner %d, prospect %d, salesrep %d, taxauth %d, " "user %s, vendor %d\tcanEdit %d and _modal %d", _competitorId, _custId, _empId, _partnerId, _prospectId, _salesrepId, _taxauthId, qPrintable(_username), _vendId, canEdit, _modal); _competitor->setChecked(_competitorId > 0); _competitor->setEnabled(canEdit && _privileges->check("MaintainCompetitorMasters")); _customer->setChecked(_custId > 0); _customer->setEnabled(canEdit && !_modal && _privileges->check("MaintainCustomerMasters")); _customerButton->setEnabled(_custId > 0 && ! (parent() && parent()->inherits("customer")) && (_privileges->check("MaintainCustomerMasters") || _privileges->check("ViewCustomerMasters") )); _employee->setChecked(_empId > 0); _employee->setEnabled(canEdit && !_modal && _privileges->check("MaintainEmployees")); _employeeButton->setEnabled(_empId > 0 && ! (parent() && parent()->inherits("employee")) && (_privileges->check("MaintainEmployees") || _privileges->check("ViewEmployees"))); _partner->setChecked(_partnerId > 0); _partner->setEnabled(canEdit && _privileges->check("MaintainPartners")); _prospect->setChecked(_prospectId > 0); _prospect->setEnabled(canEdit && !_modal && _privileges->check("MaintainProspectMasters")); _prospectButton->setEnabled(_prospectId > 0 && ! (parent() && parent()->inherits("prospect")) && (_privileges->check("MaintainProspectMasters") || _privileges->check("ViewProspectMasters"))); _salesrep->setChecked(_salesrepId > 0); _salesrep->setEnabled(canEdit && !_modal && _privileges->check("MaintainSalesReps")); _salesrepButton->setEnabled(_salesrepId > 0 && ! (parent() && parent()->inherits("salesRep")) && (_privileges->check("MaintainSalesReps") || _privileges->check("ViewSalesReps"))); _taxauth->setChecked(_taxauthId > 0); _taxauth->setEnabled(canEdit && !_modal && _privileges->check("MaintainTaxAuthorities")); _taxauthButton->setEnabled(_taxauthId > 0 && ! (parent() && parent()->inherits("taxAuthority")) && (_privileges->check("MaintainTaxAuthorities") || _privileges->check("ViewTaxAuthorities"))); // only allow turning ON the _user checkbox from here, never off _user->setChecked(! _username.isEmpty()); _user->setEnabled(canEdit && !_modal && _privileges->check("MaintainUsers") && _canCreateUsers && _username.isEmpty()); _userButton->setEnabled(! _username.isEmpty() && ! (parent() && parent()->inherits("user")) && _privileges->check("MaintainUsers")); _vendor->setChecked(_vendId > 0); _vendor->setEnabled(canEdit && !_modal && ! (parent() && parent()->inherits("vendor")) && _privileges->check("MaintainVendors")); if (_vendId > 0 && (_privileges->check("MaintainVendors") || _privileges->check("ViewVendors"))) { _vendorButton->setText(tr("Vendor")); disconnect(_vendorButton, SIGNAL(clicked()), this, SLOT(sEditVendor())); QMenu * vendorMenu = new QMenu; QAction *menuItem; menuItem=vendorMenu->addAction(tr("Edit..."), this, SLOT(sEditVendor())); menuItem->setEnabled(_privileges->check("MaintainVendors") && (_mode == cEdit)); menuItem=vendorMenu->addAction(tr("View..."), this, SLOT(sViewVendor())); menuItem->setEnabled(_privileges->check("ViewVendors") || _privileges->check("MaintainVendors")); menuItem=vendorMenu->addAction(tr("Workbench..."), this, SLOT(sVendorInfo())); menuItem->setEnabled(_privileges->check("MaintainVendors")); _vendorButton->setMenu(vendorMenu); } else _vendorButton->setEnabled(false); } void crmaccount::sHandleCntctDetach(int cntctId) { if (_primary->id() == cntctId) _primary->clear(); if (_secondary->id() == cntctId) _secondary->clear(); } void crmaccount::sEmployee() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; if (_empId <= 0 && _privileges->check("MaintainEmployees") && (cNew == _mode || cEdit == _mode)) { params.append("crmacct_id", _crmacctId); params.append("mode", "new"); } else { params.append("emp_id", _empId); params.append("mode", (_privileges->check("MaintainEmployees") && (cNew == _mode || cEdit == _mode)) ? "edit" : "view"); } employee *newdlg = new employee(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccount::sSalesRep() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; if (_salesrepId <= 0 && _privileges->check("MaintainSalesReps") && (cNew == _mode || cEdit == _mode)) { params.append("crmacct_id", _crmacctId); params.append("mode", "new"); } else { params.append("salesrep_id", _salesrepId); params.append("mode", (_privileges->check("MaintainSalesReps") && (cNew == _mode || cEdit == _mode)) ? "edit" : "view"); } salesRep *newdlg = new salesRep(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccount::sUser() { if ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainAllCRMAccounts")) { QSqlError err = saveNoErrorCheck(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving CRM Account"), err, __FILE__, __LINE__)) return; } ParameterList params; if (_username.isEmpty() && _privileges->check("MaintainUsers") && (cNew == _mode || cEdit == _mode)) { params.append("crmacct_id", _crmacctId); params.append("mode", "new"); } else { params.append("username", _username); params.append("mode", (_privileges->check("MaintainUsers") && (cNew == _mode || cEdit == _mode)) ? "edit" : "view"); } user *newdlg = new user(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/crmaccount.h000066400000000000000000000052711217451700100177110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNT_H #define CRMACCOUNT_H #include "contacts.h" #include "guiclient.h" #include "todoList.h" #include "xwidget.h" #include #include "ui_crmaccount.h" class crmaccount : public XWidget, public Ui::crmaccount { Q_OBJECT public: crmaccount(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~crmaccount(); static void doDialog(QWidget *, const ParameterList &); Q_INVOKABLE int id(); public slots: virtual enum SetResponse set(const ParameterList&); virtual void sPopulate(); virtual void sPopulateRegistrations(); virtual void setId(int id); signals: int newId(int id); protected slots: virtual void languageChange(); virtual void sClose(); virtual void sCompetitor(); virtual void sCustomer(); virtual void sDeleteCharacteristic(); virtual void sDeleteReg(); virtual void sEditCharacteristic(); virtual void sEditReg(); virtual void sEmployee(); virtual void sGetCharacteristics(); virtual void sNewCharacteristic(); virtual void sNewReg(); virtual void sPartner(); virtual void sProspect(); virtual void sSave(); virtual void sSalesRep(); virtual void sTaxAuth(); virtual void sUser(); virtual void sUpdateRelationships(); virtual void sEditVendor(); virtual void sViewVendor(); virtual void sCustomerToggled(); virtual void sProspectToggled(); virtual void sCheckNumber(); virtual void sHandleButtons(); virtual void sHandleChildButtons(); virtual void sVendorInfo(); virtual void sHandleCntctDetach(int cntctId); protected: virtual void closeEvent(QCloseEvent*); todoList *_todoList; contacts *_contacts; signals: void saved(int); private: bool _modal; int _mode; int _crmacctId; int _competitorId; int _custId; int _empId; int _partnerId; int _prospectId; int _salesrepId; int _taxauthId; QString _username; int _vendId; int _cntct1Id; int _cntct2Id; int _NumberGen; bool _canCreateUsers; QSqlError saveNoErrorCheck(bool pInTxn = false); }; #endif // CRMACCOUNT_H qt-client-4.1.0/guiclient/crmaccount.ui000066400000000000000000001062501217451700100200760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. crmaccount 0 0 763 539 Account 12 Account Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number Active true Qt::Horizontal 40 20 Account Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Save Close Qt::Vertical 20 0 0 0 Type 12 Organization true Individual Qt::Horizontal 40 16 Roles 12 false 0 0 Prospect... 12 false 0 0 Sales Rep... 12 false 0 0 Customer... 12 false 0 0 Employee... 12 false false 0 0 Vendor... 12 false 0 0 User... 12 false false 0 0 Tax Authority... 12 false 0 0 0 23 Competitor 12 false 0 0 0 23 Partner Qt::StrongFocus Qt::Horizontal Qt::StrongFocus Qt::Horizontal Parent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Owner: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 1 QTabWidget::Rounded 0 Contacts 12 Primary true Secondary All Qt::Horizontal 40 20 0 false false false Qt::Vertical 20 0 Qt::Horizontal 0 20 false true false false Qt::Vertical 20 0 Qt::Horizontal 0 20 Notes true Comments Qt::StrongFocus Comments::CRMAccount Characteristics 0 New false Edit false Delete Qt::Vertical 20 40 Activities Registrations Qt::ClickFocus 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Documents Documents::CRMAccount Comments QWidget

    comments.h
    ContactCluster QWidget
    contactcluster.h
    CRMAcctCluster QWidget
    crmacctcluster.h
    Documents QWidget
    documents.h
    UsernameCluster QWidget
    usernamecluster.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _active _name _organization _individual _parentCrmacct _owner _tab _primaryButton _secondaryButton _allButton _primary _notes _comments _charass _newCharacteristic _editCharacteristic _deleteCharacteristic _reg _newReg _editReg _deleteReg _prospect _prospectButton _customer _customerButton _vendor _vendorButton _taxauth _taxauthButton _competitor _partner _salesrep _salesrepButton _employee _employeeButton _user _userButton _save _close _secondary _vendor toggled(bool) _vendorButton setEnabled(bool) 530 158 573 151 _taxauth toggled(bool) _taxauthButton setEnabled(bool) 530 183 573 174 _customer toggled(bool) _customerButton setEnabled(bool) 530 133 573 128 _prospect toggled(bool) _prospectButton setEnabled(bool) 530 108 573 105 _charass itemSelected(int) _editCharacteristic animateClick() 71 327 181 351 _reg valid(bool) _editReg setEnabled(bool) 71 327 181 351 _reg valid(bool) _deleteReg setEnabled(bool) 71 327 181 351 _reg itemSelected(int) _editReg animateClick() 71 327 181 351 _employee toggled(bool) _employeeButton setEnabled(bool) 723 133 836 142 _user toggled(bool) _userButton setEnabled(bool) 723 158 836 167 _salesrep toggled(bool) _salesrepButton setEnabled(bool) 707 99 742 98 qt-client-4.1.0/guiclient/crmaccountMerge.cpp000066400000000000000000000047121217451700100212230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmaccountMerge.h" #include #include #include "crmaccountMergePickAccountsPage.h" #include "crmaccountMergePickDataPage.h" #include "crmaccountMergePickTaskPage.h" #include "crmaccountMergePurgePage.h" #include "crmaccountMergeResultPage.h" class crmaccountMergePrivate { public: crmaccountMergePrivate(QWidget *parent = 0) : _parent(parent), _selectCol(-1) { _oldpage = crmaccountMerge::Page_PickTask; } ~crmaccountMergePrivate() { } int _oldpage; QWidget *_parent; int _selectCol; }; crmaccountMerge::crmaccountMerge(QWidget* parent, const char* name, Qt::WFlags fl) : QWizard(parent, fl) { setupUi(this); if (name) setObjectName(name); _data = new crmaccountMergePrivate(this); QPixmap *pixmap = new QPixmap(":/images/icon128x32.png"); if (pixmap) { #ifdef Q_WS_MAC setPixmap(BackgroundPixmap, *pixmap); #else setPixmap(BannerPixmap, *pixmap); #endif } QWizardPage *picktaskpage = new CrmaccountMergePickTaskPage(this); QWizardPage *pickacctpage = new CrmaccountMergePickAccountsPage(this); QWizardPage *pickdatapage = new CrmaccountMergePickDataPage(this); QWizardPage *mergerespage = new CrmaccountMergeResultPage(this); QWizardPage *mergeprgpage = new CrmaccountMergePurgePage(this); setPage(Page_PickTask, picktaskpage); setPage(Page_PickAccounts, pickacctpage); setPage(Page_PickData, pickdatapage); setPage(Page_Result, mergerespage); setPage(Page_Purge, mergeprgpage); setButtonText(CancelButton, tr("Close")); setDefaultProperty("XComboBox", "text", SIGNAL(currentIndexChanged(QString))); connect(mergeprgpage, SIGNAL(mergeSetChanged()), picktaskpage, SLOT(sUpdateComboBoxes())); connect(mergeprgpage, SIGNAL(mergeSetChanged()), mergerespage, SLOT(clearIfPurged())); } crmaccountMerge::~crmaccountMerge() { // no need to delete child widgets, Qt does it all for us } void crmaccountMerge::languageChange() { retranslateUi(this); } qt-client-4.1.0/guiclient/crmaccountMerge.h000066400000000000000000000021061217451700100206630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNTMERGE_H #define CRMACCOUNTMERGE_H #include "guiclient.h" #include "xwidget.h" #include class crmaccount; class crmaccountMergePrivate; #include "ui_crmaccountMerge.h" class crmaccountMerge : public QWizard, public Ui::crmaccountMerge { Q_OBJECT public: crmaccountMerge(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~crmaccountMerge(); enum { Page_PickTask, Page_PickAccounts, Page_PickData, Page_Result, Page_Purge }; protected slots: virtual void languageChange(); protected: crmaccountMergePrivate *_data; }; #endif // CRMACCOUNTMERGE_H qt-client-4.1.0/guiclient/crmaccountMerge.ui000066400000000000000000000016761217451700100210640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. crmaccountMerge 0 0 500 360 Merge CRM Accounts QWizard::NoBackButtonOnStartPage|QWizard::NoDefaultButton qt-client-4.1.0/guiclient/crmaccountMergePickAccountsPage.cpp000066400000000000000000000321471217451700100243320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmaccountMergePickAccountsPage.h" #include #include #include #include #include "crmaccountMerge.h" #include "errorReporter.h" class CrmaccountMergePickAccountsPagePrivate { public: CrmaccountMergePickAccountsPagePrivate(QWidget *parent) : _parent(parent), _targetid_cache(-1) { QString errmsg; bool ok = false; _mqlstr = MQLUtil::mqlLoad("crmaccounts", "detail", errmsg, &ok); if (!ok) ErrorReporter::error(QtCriticalMsg, _parent, QT_TRANSLATE_NOOP("CrmaccountMergePickAccountsPage", "Error Getting CRM Accounts"), errmsg, __FILE__, __LINE__); } QWidget *_parent; QString _mqlstr; int _targetid_cache; }; CrmaccountMergePickAccountsPage::CrmaccountMergePickAccountsPage(QWidget *parent) : QWizardPage(parent), _data(0) { setupUi(this); _data = new CrmaccountMergePickAccountsPagePrivate(this); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_sources,SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); connect(_target, SIGNAL(valid(bool)), this, SIGNAL(completeChanged())); _sources->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, true, "crmacct_number"); _sources->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "crmacct_name"); _sources->addColumn(tr("First"), 50, Qt::AlignLeft, true, "cntct_first_name" ); _sources->addColumn(tr("Last"), -1, Qt::AlignLeft, true, "cntct_last_name" ); _sources->addColumn(tr("Phone"), 100, Qt::AlignLeft, true, "cntct_phone" ); _sources->addColumn(tr("Email"), 100, Qt::AlignLeft, true, "cntct_email" ); _sources->addColumn(tr("Address"), -1, Qt::AlignLeft, false, "addr_line1" ); _sources->addColumn(tr("City"), 75, Qt::AlignLeft, false, "addr_city" ); _sources->addColumn(tr("State"), 50, Qt::AlignLeft, false, "addr_state" ); _sources->addColumn(tr("Country"), 100, Qt::AlignLeft, false, "addr_country" ); _sources->addColumn(tr("Postal Code"), 75, Qt::AlignLeft, false, "addr_postalcode" ); _sources->addColumn(tr("Customer"), _ynColumn, Qt::AlignCenter,true, "cust"); _sources->addColumn(tr("Prospect"), _ynColumn, Qt::AlignCenter,true, "prospect"); _sources->addColumn(tr("Vendor"), _ynColumn, Qt::AlignCenter,true, "vend"); _sources->addColumn(tr("Competitor"),_ynColumn, Qt::AlignCenter,false, "competitor"); _sources->addColumn(tr("Partner"), _ynColumn, Qt::AlignCenter,false, "partner"); _sources->addColumn(tr("Tax Auth."), _ynColumn, Qt::AlignCenter,false, "taxauth"); _sources->addColumn(tr("User"), _ynColumn, Qt::AlignCenter,false, "usr"); _sources->addColumn(tr("Employee"), _ynColumn, Qt::AlignCenter,false, "emp"); _sources->addColumn(tr("Sales Rep"), _ynColumn, Qt::AlignCenter,false, "salesrep"); _filter->append(tr("Hide Merges in Progress"),"excludeMergeWIP", ParameterWidget::Exists, true); _filter->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists, true); _filter->append(tr("Account Number Pattern"), "crmacct_number_pattern", ParameterWidget::Text); _filter->append(tr("Account Name Pattern"), "crmacct_name_pattern", ParameterWidget::Text); _filter->append(tr("Contact Name Pattern"), "cntct_name_pattern", ParameterWidget::Text); _filter->append(tr("Phone Pattern"), "cntct_phone_pattern", ParameterWidget::Text); _filter->append(tr("Email Pattern"), "cntct_email_pattern", ParameterWidget::Text); _filter->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text); _filter->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text); _filter->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text); _filter->append(tr("Postal Code Pattern"), "addr_postalcode_pattern",ParameterWidget::Text); _filter->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text); _filter->applyDefaultFilterSet(); } CrmaccountMergePickAccountsPage::~CrmaccountMergePickAccountsPage() { if (_data) delete _data; } void CrmaccountMergePickAccountsPage::cleanupPage() { _data->_targetid_cache = _target->id(); } void CrmaccountMergePickAccountsPage::initializePage() { _data->_targetid_cache = _target->id(); sFillList(); } bool CrmaccountMergePickAccountsPage::isComplete() const { return _sources->selectedItems().size() > 1 && _target->isValid(); } bool CrmaccountMergePickAccountsPage::validatePage() { XSqlQuery begin("BEGIN;"); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); MetaSQLQuery delm("DELETE FROM crmacctsel" " WHERE (crmacctsel_dest_crmacct_id=)" " " " AND crmacctsel_src_crmacct_id NOT IN (-1" " " " , " " " ")" " " ";"); ParameterList delp; delp.append("destid", _data->_targetid_cache); QStringList idlist; foreach (XTreeWidgetItem *item, _sources->selectedItems()) idlist << QString::number(item->id()); if (idlist.size()) delp.append("idlist", idlist.join(", ")); XSqlQuery delq = delm.toQuery(delp); if (delq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Clearing Old Selections"), delq, __FILE__, __LINE__); return false; } if (_target->id() != _data->_targetid_cache) { XSqlQuery updq; updq.prepare("UPDATE crmacctsel SET crmacctsel_dest_crmacct_id=:new," " crmacctsel_mrg_crmacct_number = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_active = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_cntct_id_1 = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_cntct_id_2 = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_competitor_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_cust_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_emp_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_name = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_notes = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_owner_username = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_parent_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_partner_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_prospect_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_salesrep_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_taxauth_id = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_type = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_usr_username = (crmacctsel_src_crmacct_id=:new)," " crmacctsel_mrg_crmacct_vend_id = (crmacctsel_src_crmacct_id=:new) " " WHERE crmacctsel_dest_crmacct_id=:old;"); updq.bindValue(":new", _target->id()); updq.bindValue(":old", _data->_targetid_cache); updq.exec(); if (updq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Updating Selections"), updq, __FILE__, __LINE__); return false; } } MetaSQLQuery insm("INSERT INTO crmacctsel (" " crmacctsel_src_crmacct_id, crmacctsel_dest_crmacct_id," " crmacctsel_mrg_crmacct_number," " crmacctsel_mrg_crmacct_active," " crmacctsel_mrg_crmacct_cntct_id_1," " crmacctsel_mrg_crmacct_cntct_id_2," " crmacctsel_mrg_crmacct_competitor_id," " crmacctsel_mrg_crmacct_cust_id," " crmacctsel_mrg_crmacct_emp_id," " crmacctsel_mrg_crmacct_name," " crmacctsel_mrg_crmacct_notes," " crmacctsel_mrg_crmacct_owner_username," " crmacctsel_mrg_crmacct_parent_id," " crmacctsel_mrg_crmacct_partner_id," " crmacctsel_mrg_crmacct_prospect_id," " crmacctsel_mrg_crmacct_salesrep_id," " crmacctsel_mrg_crmacct_taxauth_id," " crmacctsel_mrg_crmacct_type," " crmacctsel_mrg_crmacct_usr_username," " crmacctsel_mrg_crmacct_vend_id" ") SELECT , ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " " " WHERE NOT IN" " (SELECT crmacctsel_src_crmacct_id" " FROM crmacctsel);"); foreach (XTreeWidgetItem *item, _sources->selectedItems()) { ParameterList insp; insp.append("destid", _target->id()); insp.append("srcid", item->id()); insp.append("istarget", QVariant(_target->id() == item->id())); XSqlQuery insq = insm.toQuery(insp); if (insq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Inserting New Selections"), insq, __FILE__, __LINE__); return false; } } XSqlQuery commit("COMMIT;"); _data->_targetid_cache = _target->id(); wizard()->page(crmaccountMerge::Page_PickTask)->initializePage(); setField("_existingMerge", _target->currentText()); return true; } void CrmaccountMergePickAccountsPage::sFillList() { // save the current target and selection int prevtarget = _target->id(); QList ids; for (int i = 0; i < _target->count(); i++) ids.append(_target->id(i)); // repopulate _target->clear(); MetaSQLQuery mql(_data->_mqlstr); XSqlQuery qry = mql.toQuery(_filter->parameters()); _sources->populate(qry); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting CRM Account"), qry, __FILE__, __LINE__)) return; // restore the selection disconnect(_sources,SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); for (int j = 0; j < ids.size(); j++) { for (int i = 0; i < _sources->topLevelItemCount(); i++) { XTreeWidgetItem *item = dynamic_cast(_sources->topLevelItem(i)); if (item && item->id() == ids[j]) { _sources->setCurrentItem(item, 0, QItemSelectionModel::Select | QItemSelectionModel::Rows); _target->append(item->id(), item->text("crmacct_number")); } } } connect(_sources,SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); sHandleButtons(); _target->setId(prevtarget); } void CrmaccountMergePickAccountsPage::sHandleButtons() { QList items = _sources->selectedItems(); _target->setEnabled(items.size() > 0); int targetid = _target->id(); _target->clear(); for (int i = 0; i < items.size(); i++) _target->append(items[i]->id(), items[i]->text("crmacct_number")); _target->setId(targetid); emit completeChanged(); } qt-client-4.1.0/guiclient/crmaccountMergePickAccountsPage.h000066400000000000000000000023061217451700100237710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNTMERGEPICKACCOUNTSPAGE_H #define CRMACCOUNTMERGEPICKACCOUNTSPAGE_H #include #include #include "ui_crmaccountMergePickAccountsPage.h" class CrmaccountMergePickAccountsPagePrivate; class CrmaccountMergePickAccountsPage : public QWizardPage, public Ui::crmaccountMergePickAccountsPage { Q_OBJECT public: CrmaccountMergePickAccountsPage(QWidget *parent = 0); ~CrmaccountMergePickAccountsPage(); Q_INVOKABLE virtual void cleanupPage(); Q_INVOKABLE virtual void initializePage(); Q_INVOKABLE virtual bool isComplete() const; Q_INVOKABLE virtual bool validatePage(); protected slots: void sFillList(); void sHandleButtons(); protected: CrmaccountMergePickAccountsPagePrivate *_data; }; #endif qt-client-4.1.0/guiclient/crmaccountMergePickAccountsPage.ui000066400000000000000000000077161217451700100241710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. crmaccountMergePickAccountsPage 0 0 481 238 WizardPage Select the CRM Accounts to Merge Select the CRM Accounts you want to merge together from the list below. Then, at the bottom of the screen, choose which of those Accounts they should be merged into. Accounts to Merge: _sources 0 5 QAbstractItemView::MultiSelection false Destination Account: false true [ Keep this CRM Account ] Query Qt::Vertical 20 0 Qt::Horizontal 40 20 ParameterWidget QWidget
    parameterwidget.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    qt-client-4.1.0/guiclient/crmaccountMergePickDataPage.cpp000066400000000000000000000341541217451700100234240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmaccountMergePickDataPage.h" #include #include #include #include #include "crmaccount.h" #include "errorReporter.h" #include "format.h" // funky struct[] here so we can be consistent in addColumn, select, & deselect static struct { QString title; // user-visible column header in xtreewidget int width; // column width in xtreewidget int align; // column alignment in xtreewidget QString querycol; // column in the query that populates the xtreewidget QString mergecol; // column in the merge-selection table (e.g. crmacctsel_mrg_crmacct_active) bool multiple; // merge can combine data from multiple records for this column } mergeUiDesc[] = { { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Number"), _orderColumn, Qt::AlignLeft, "crmacct_number", "crmacctsel_mrg_crmacct_number", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Name"), -1, Qt::AlignLeft, "crmacct_name", "crmacctsel_mrg_crmacct_name", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Active"), _ynColumn, Qt::AlignCenter, "crmacct_active", "crmacctsel_mrg_crmacct_active", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Type"), -1, Qt::AlignLeft, "crmacct_type", "crmacctsel_mrg_crmacct_type", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Primary Contact"), -1, Qt::AlignLeft, "primary", "crmacctsel_mrg_crmacct_cntct_id_1", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Secondary Contact"), -1, Qt::AlignLeft, "secondary", "crmacctsel_mrg_crmacct_cntct_id_2", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Owner"), _orderColumn, Qt::AlignLeft, "owner", "crmacctsel_mrg_crmacct_owner_username", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Parent"), _orderColumn, Qt::AlignLeft, "parent", "crmacctsel_mrg_crmacct_parent_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Customer"), _ynColumn, Qt::AlignCenter, "cust", "crmacctsel_mrg_crmacct_cust_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Prospect"), _ynColumn, Qt::AlignCenter, "prospect", "crmacctsel_mrg_crmacct_prospect_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Vendor"), _ynColumn, Qt::AlignCenter, "vend", "crmacctsel_mrg_crmacct_vend_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Competitor"), _ynColumn, Qt::AlignCenter, "competitor", "crmacctsel_mrg_crmacct_competitor_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Partner"), _ynColumn, Qt::AlignCenter, "partner", "crmacctsel_mrg_crmacct_partner_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Tax Auth."), _ynColumn, Qt::AlignCenter, "taxauth", "crmacctsel_mrg_crmacct_taxauth_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "User"), _orderColumn, Qt::AlignCenter, "usr", "crmacctsel_mrg_crmacct_usr_username", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Employee"), _ynColumn, Qt::AlignCenter, "emp", "crmacctsel_mrg_crmacct_emp_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Sales Rep"), _ynColumn, Qt::AlignCenter, "salesrep", "crmacctsel_mrg_crmacct_salesrep_id", false }, { QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Notes"), -1, Qt::AlignLeft, "notes", "crmacctsel_mrg_crmacct_notes", true } }; class CrmaccountMergePickDataPagePrivate { public: CrmaccountMergePickDataPagePrivate(QWidget *parent = 0) : _destid(-1), _itemForMenu(0), _parent(parent) { QString errmsg; bool ok = false; _mqlstr = MQLUtil::mqlLoad("crmaccountmerge", "pickdatasources", errmsg, &ok); if (!ok) ErrorReporter::error(QtCriticalMsg, _parent, QT_TRANSLATE_NOOP("CrmaccountMergePickDataPage", "Getting CRM Accounts"), errmsg, __FILE__, __LINE__); } static bool isSelected(XTreeWidgetItem *item, int col) { return item->data(col, Qt::ForegroundRole).isValid(); } int _destid; QString _destnumber; XTreeWidgetItem *_itemForMenu; QString _mqlstr; QWidget *_parent; }; CrmaccountMergePickDataPage::CrmaccountMergePickDataPage(QWidget *parent) : QWizardPage(parent), _data(0) { setupUi(this); _data = new CrmaccountMergePickDataPagePrivate(this); for (unsigned int i = 0; i < sizeof(mergeUiDesc) / sizeof(mergeUiDesc[0]); i++) _sources->addColumn(mergeUiDesc[i].title, mergeUiDesc[i].width, mergeUiDesc[i].align, true, mergeUiDesc[i].querycol); connect(_deselect, SIGNAL(clicked()), this, SLOT(sDeselect())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_sources, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(sSelect(QTreeWidgetItem*, int))); connect(_sources, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); connect(_sources, SIGNAL(populateMenu(QMenu *, XTreeWidgetItem *)), this, SLOT(sPopulateMenu(QMenu *, XTreeWidgetItem *))); _selectedColorIndicator->setStyleSheet(QString("* { color: %1; }") .arg(namedColor("emphasis").name())); setCommitPage(true); } CrmaccountMergePickDataPage::~CrmaccountMergePickDataPage() { if (_data) delete _data; } void CrmaccountMergePickDataPage::cleanupPage() { disconnect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList())); } void CrmaccountMergePickDataPage::initializePage() { XSqlQuery getq; getq.prepare("SELECT crmacct_id FROM crmacct WHERE crmacct_number=:number;"); getq.bindValue(":number", field("_existingMerge").toString()); getq.exec(); if (getq.first()) { _data->_destid = getq.value("crmacct_id").toInt(); _data->_destnumber = field("_existingMerge").toString(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting CRM Account"), getq, __FILE__, __LINE__)) return; sFillList(); connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList())); } bool CrmaccountMergePickDataPage::isComplete() const { for (int col = 0; col < _sources->columnCount(); col++) { bool found = false; for (int row = 0; ! found && row < _sources->topLevelItemCount(); row++) found = _data->isSelected(_sources->topLevelItem(row), col); if (! found) return false; } return true; } bool CrmaccountMergePickDataPage::validatePage() { if (QMessageBox::question(this, tr("Perform this merge?"), tr("

    Are you sure you want to merge the " "CRM Accounts as described here?

    " "

    If you click YES then the merge will " "be run immediately. You will have a chance " "to undo it later.

    "), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No) return false; XSqlQuery mrgq; mrgq.prepare("SELECT mergecrmaccts(:destid, FALSE) AS result;"); mrgq.bindValue(":destid", _data->_destid); mrgq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Merging"), mrgq, __FILE__, __LINE__)) return false; disconnect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList())); omfgThis->sCrmAccountsUpdated(_data->_destid); setField("_completedMerge", _data->_destnumber); return true; } void CrmaccountMergePickDataPage::sDeselect() { MetaSQLQuery srcm("UPDATE crmacctsel" " SET =" " WHERE (crmacctsel_src_crmacct_id=);"); foreach(QModelIndex cell, _sources->selectionModel()->selectedIndexes()) { ParameterList params; params.append("colname", mergeUiDesc[cell.column()].mergecol); params.append("value", QVariant(false)); params.append("srcid", _sources->topLevelItem(cell.row())->id()); XSqlQuery srcq = srcm.toQuery(params); ErrorReporter::error(QtCriticalMsg, this, tr("Updating Merge Sources"), srcq, __FILE__, __LINE__); } _sources->selectionModel()->clear(); sFillList(); } bool CrmaccountMergePickDataPage::sDelete() { if (QMessageBox::question(this, tr("Delete CRM Account?"), tr("Are you sure you want to delete CRM Account %1?") .arg(_sources->currentItem()->text("crmacct_number")), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No) return false; XSqlQuery begin("BEGIN;"); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery delq; delq.prepare("DELETE FROM crmacctsel WHERE crmacctsel_src_crmacct_id=:id;"); delq.bindValue(":id", _data->_itemForMenu->id()); delq.exec(); if (delq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting Merge Data"), delq, __FILE__, __LINE__); return false; } delq.prepare("DELETE FROM crmacct WHERE crmacct_id=:id;"); delq.bindValue(":id", _data->_itemForMenu->id()); delq.exec(); if (delq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting CRM Account"), delq, __FILE__, __LINE__); return false; } XSqlQuery commit("COMMIT;"); omfgThis->sCrmAccountsUpdated(_data->_itemForMenu->id()); return true; } void CrmaccountMergePickDataPage::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("crmacct_id", _data->_itemForMenu->id()); crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void CrmaccountMergePickDataPage::sFillList() { ParameterList params; params.append("destid", _data->_destid); params.append("individual", tr("Individual")); params.append("organization", tr("Organization")); params.append("na", tr("[N/A]")); MetaSQLQuery mql(_data->_mqlstr); XSqlQuery getq; getq = mql.toQuery(params); _sources->populate(getq, true); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting CRM Account"), getq, __FILE__, __LINE__)) return; } void CrmaccountMergePickDataPage::sHandleButtons() { _deselect->setEnabled(_sources->selectionModel()->selectedIndexes().size()); _select->setEnabled(_sources->selectionModel()->selectedIndexes().size()); } void CrmaccountMergePickDataPage::sPopulateMenu(QMenu *pMenu, XTreeWidgetItem *pItem) { Q_UNUSED(pItem); _data->_itemForMenu = pItem; QAction *menuItem; menuItem = pMenu->addAction(tr("Edit CRM Account"), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainAllCRMAccounts")); menuItem = pMenu->addAction(tr("View CRM Account"), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("ViewAllCRMAccounts")); menuItem = pMenu->addAction(tr("Delete CRM Account"), this, SLOT(sDelete())); menuItem->setEnabled(pItem->id() != _data->_destid && _privileges->check("MaintainAllCRMAccounts")); } bool CrmaccountMergePickDataPage::sSelect(QTreeWidgetItem *pitem, int col, bool clearSelection) { XTreeWidgetItem *item = dynamic_cast(pitem); if (! item) return false; MetaSQLQuery srcm("UPDATE crmacctsel" " SET =" " WHERE (crmacctsel_src_crmacct_id=);"); MetaSQLQuery destm("UPDATE crmacctsel" " SET =" " WHERE ((crmacctsel_dest_crmacct_id=)" " AND (crmacctsel_src_crmacct_id!=));"); ParameterList params; params.append("colname", mergeUiDesc[col].mergecol); params.append("srcval", QVariant(true)); params.append("srcid", item->id()); params.append("destval", QVariant(false)); params.append("destid", item->altId()); XSqlQuery srcq = srcm.toQuery(params); if (ErrorReporter::error(QtCriticalMsg, this, tr("Updating Merge Sources"), srcq, __FILE__, __LINE__)) return false; if (! mergeUiDesc[col].multiple) { XSqlQuery destq = destm.toQuery(params); if (ErrorReporter::error(QtCriticalMsg, this, tr("Updating Merge Destination"), destq, __FILE__, __LINE__)) return false; } if (clearSelection) { _sources->selectionModel()->clear(); sFillList(); } return true; } void CrmaccountMergePickDataPage::sSelect() { foreach(QModelIndex cell, _sources->selectionModel()->selectedIndexes()) { if (mergeUiDesc[cell.column()].mergecol.isEmpty()) continue; sSelect(_sources->topLevelItem(cell.row()), cell.column(), false); } _sources->selectionModel()->clear(); sFillList(); } void CrmaccountMergePickDataPage::sView() { ParameterList params; params.append("mode", "view"); params.append("crmacct_id", _data->_itemForMenu->id()); crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/crmaccountMergePickDataPage.h000066400000000000000000000025731217451700100230710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNTMERGEPICKDATAPAGE_H #define CRMACCOUNTMERGEPICKDATAPAGE_H #include "ui_crmaccountMergePickDataPage.h" class CrmaccountMergePickDataPagePrivate; class CrmaccountMergePickDataPage : public QWizardPage, public Ui::crmaccountMergePickDataPage { Q_OBJECT public: CrmaccountMergePickDataPage(QWidget *parent = 0); ~CrmaccountMergePickDataPage(); virtual void cleanupPage(); virtual void initializePage(); virtual bool isComplete() const; virtual bool validatePage(); protected slots: virtual void sDeselect(); virtual bool sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sPopulateMenu(QMenu *pMenu, XTreeWidgetItem *); virtual void sSelect(); virtual bool sSelect(QTreeWidgetItem *pitem, int col, bool clearSelection = true); virtual void sView(); protected: CrmaccountMergePickDataPagePrivate *_data; }; #endif qt-client-4.1.0/guiclient/crmaccountMergePickDataPage.ui000066400000000000000000000072641217451700100232610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. crmaccountMergePickDataPage 0 0 743 522 WizardPage Pick the Details to Add to the Target Double-click in the table below to indicate what you want in the final merged CRM Account. Alternatively, click once on values in the table then click Select or Deselect to record your choices. Continue when there is one value highlighted in each column. You can select more than one Notes. You may choose either one Customer or one Prospect, but not one of each. Source CRM Accounts: QAbstractItemView::MultiSelection QAbstractItemView::SelectItems false Select false Deselect Qt::Vertical 137 1 [ Selected values are in this color ] Qt::Horizontal 40 20 XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _sources _select _deselect
    qt-client-4.1.0/guiclient/crmaccountMergePickTaskPage.cpp000066400000000000000000000073721217451700100234570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "crmaccountMerge.h" #include "crmaccountMergePickTaskPage.h" #include "errorReporter.h" CrmaccountMergePickTaskPage::CrmaccountMergePickTaskPage(QWidget *parent) : QWizardPage(parent) { setupUi(this); connect(_continue, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_existingMerge, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_revert, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_purge, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(omfgThis,SIGNAL(crmAccountsUpdated(int)), this, SLOT(sUpdateComboBoxes())); registerField("_completedMerge", _completedMerge, "text", "currentIndexChanged(QString)"); registerField("_existingMerge", _existingMerge, "text", "currentIndexChanged(QString)"); } void CrmaccountMergePickTaskPage::initializePage() { sUpdateComboBoxes(); } bool CrmaccountMergePickTaskPage::isComplete() const { if (_continue->isChecked() || _revert->isChecked()) return _existingMerge->isValid(); return true; } int CrmaccountMergePickTaskPage::nextId() const { int result = -1; if (_start->isChecked()) result = crmaccountMerge::Page_PickAccounts; else if (_continue->isChecked()) result = crmaccountMerge::Page_PickData; else if (_revert->isChecked()) result = crmaccountMerge::Page_Result; else if (_purge->isChecked()) result = crmaccountMerge::Page_Purge; if (result == -1) { QMessageBox::warning(0, tr("Where next?"), tr("Try selecting one of the tasks before going on.")); result = crmaccountMerge::Page_PickTask; } return result; } void CrmaccountMergePickTaskPage::sHandleButtons() { _continue->setEnabled(_existingMerge->count()); _revert->setEnabled(_completedMerge->count()); _purge->setEnabled(_existingMerge->count() || _completedMerge->count()); _completedMerge->setEnabled(_revert->isEnabled()); _existingMerge->setEnabled(_continue->isEnabled()); if ((!_continue->isEnabled() && _continue->isChecked()) || (!_revert->isEnabled() && _revert->isChecked()) || (!_purge->isEnabled() && _purge->isChecked())) _start->setChecked(true); emit completeChanged(); } void CrmaccountMergePickTaskPage::sUpdateComboBoxes() { XSqlQuery contq("SELECT crmacct_id, crmacct_number" " FROM crmacct" " WHERE crmacct_id IN (SELECT crmacctsel_dest_crmacct_id" " FROM crmacctsel)" " ORDER BY crmacct_number;"); _existingMerge->populate(contq); ErrorReporter::error(QtCriticalMsg, this, tr("Looking for Merges"), contq, __FILE__, __LINE__); XSqlQuery undoq("SELECT crmacct_id, crmacct_number" " FROM crmacct" " WHERE crmacct_id IN (SELECT mrgundo_base_id" " FROM mrgundo" " WHERE mrgundo_base_schema='public'" " AND mrgundo_base_table='crmacct')" " ORDER BY crmacct_number;"); _completedMerge->populate(undoq); ErrorReporter::error(QtCriticalMsg, this, tr("Looking for Merges"), undoq, __FILE__, __LINE__); sHandleButtons(); } qt-client-4.1.0/guiclient/crmaccountMergePickTaskPage.h000066400000000000000000000017651217451700100231240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNTMERGEPICKTASKPAGE_H #define CRMACCOUNTMERGEPICKTASKPAGE_H #include #include "ui_crmaccountMergePickTaskPage.h" class CrmaccountMergePickTaskPage : public QWizardPage, public Ui::crmaccountMergePickTaskPage { Q_OBJECT public: CrmaccountMergePickTaskPage(QWidget *parent = 0); Q_INVOKABLE virtual void initializePage(); Q_INVOKABLE virtual bool isComplete() const; Q_INVOKABLE virtual int nextId() const; protected slots: virtual void sHandleButtons(); virtual void sUpdateComboBoxes(); }; #endif qt-client-4.1.0/guiclient/crmaccountMergePickTaskPage.ui000066400000000000000000000071011217451700100233000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. crmaccountMergePickTaskPage 0 0 353 149 WizardPage Pick a Task This Wizard guides you through the steps of merging CRM Accounts. You can close at any time. The work in progress will be saved for you to come back to later. Start a new merge true false Continue an existing merge false Revert a completed merge false Purge old records Qt::Vertical 20 40 Qt::Horizontal 40 20 false false XComboBox QComboBox
    xcombobox.h
    _start _continue _existingMerge _revert _completedMerge _purge
    qt-client-4.1.0/guiclient/crmaccountMergePurgePage.cpp000066400000000000000000000120471217451700100230230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmaccountMergePurgePage.h" #include #include #include #include "errorReporter.h" class CrmaccountMergePurgePagePrivate { public: CrmaccountMergePurgePagePrivate(QWizardPage *parent) : _parent(parent), _mergedKey(1), _selectedKey(2) { QString errmsg; bool ok = false; _mqlstr = MQLUtil::mqlLoad("crmaccountmerge", "wip", errmsg, &ok); if (!ok) ErrorReporter::error(QtCriticalMsg, _parent, QT_TRANSLATE_NOOP("CrmaccountMergePurgePage", "Getting List of Merges"), errmsg, __FILE__, __LINE__); } QWizardPage *_parent; int _mergedKey; QString _mqlstr; int _selectedKey; }; CrmaccountMergePurgePage::CrmaccountMergePurgePage(QWidget *parent) : QWizardPage(parent), _data(0) { setupUi(this); _data = new CrmaccountMergePurgePagePrivate(this); _completed->addColumn(tr("CRM Account Number"), _orderColumn, Qt::AlignLeft, true, "crmacct_number"); _completed->addColumn(tr("CRM Account Name"), -1, Qt::AlignLeft, true, "crmacct_name"); _completed->addColumn(tr("Status"), -1, Qt::AlignLeft, true, "status"); connect(_completed, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deleteAll, SIGNAL(clicked()), this, SLOT(sDeleteAll())); setFinalPage(true); } CrmaccountMergePurgePage::~CrmaccountMergePurgePage() { if (_data) { delete _data; _data = 0; } } void CrmaccountMergePurgePage::initializePage() { sFillList(); } void CrmaccountMergePurgePage::sDelete() { if (QMessageBox::question(this, tr("Delete?"), tr("

    Are you sure you want to delete the " "selected merge records?

    Note that " "obsolete CRM Accounts will be deleted " "when purging completed merges.

    "), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No) return; QList selected = _completed->selectedItems(); foreach (XTreeWidgetItem *item, selected) { XSqlQuery delq; delq.prepare("SELECT purgecrmacctmerge(:destcrmacctid) AS RESULT;"); delq.bindValue(":destcrmacctid", item->id()); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Purge Error"), delq, __FILE__, __LINE__); } emit mergeSetChanged(); sFillList(); } void CrmaccountMergePurgePage::sDeleteAll() { if (QMessageBox::question(this, tr("Delete?"), tr("

    Are you sure you want to delete all " "of these merge records?

    Note that " "obsolete CRM Accounts will be deleted " "when purging completed merges.

    "), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No) return; for (int i = 0; i < _completed->topLevelItemCount(); i++) { XTreeWidgetItem *item = _completed->topLevelItem(i); XSqlQuery delq; delq.prepare("SELECT purgecrmacctmerge(:destcrmacctid) AS RESULT;"); delq.bindValue(":destcrmacctid", item->id()); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Purge Error"), delq, __FILE__, __LINE__); } emit mergeSetChanged(); sFillList(); } void CrmaccountMergePurgePage::sFillList() { ParameterList params; params.append("merged", tr("Obsolete - will be deleted by purge")); params.append("mergedParent", tr("Merge complete")); params.append("mergedKey", _data->_mergedKey); params.append("selected", tr("Data selection in progress")); params.append("selectedKey", _data->_selectedKey); MetaSQLQuery mql(_data->_mqlstr); XSqlQuery getq = mql.toQuery(params); _completed->populate(getq, true); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting List of Merges"), getq, __FILE__, __LINE__)) return; _completed->expandAll(); sHandleButtons(); } void CrmaccountMergePurgePage::sHandleButtons() { foreach (XTreeWidgetItem *item, _completed->selectedItems()) { if (item->id() != item->altId()) item->setSelected(false); } _delete->setEnabled(_completed->selectedItems().size() > 0); _deleteAll->setEnabled(_completed->topLevelItemCount() > 0); } qt-client-4.1.0/guiclient/crmaccountMergePurgePage.h000066400000000000000000000021121217451700100224600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNTMERGEPICKPURGEPAGE_H #define CRMACCOUNTMERGEPICKPURGEPAGE_H #include "ui_crmaccountMergePurgePage.h" class CrmaccountMergePurgePagePrivate; class CrmaccountMergePurgePage : public QWizardPage, public Ui::crmaccountMergePurgePage { Q_OBJECT public: CrmaccountMergePurgePage(QWidget *parent = 0); ~CrmaccountMergePurgePage(); virtual void initializePage(); signals: virtual void mergeSetChanged(); protected slots: virtual void sDelete(); virtual void sDeleteAll(); virtual void sFillList(); virtual void sHandleButtons(); protected: CrmaccountMergePurgePagePrivate *_data; }; #endif qt-client-4.1.0/guiclient/crmaccountMergePurgePage.ui000066400000000000000000000054211217451700100226540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. crmaccountMergePurgePage 0 0 412 353 WizardPage Purge Completed Merges The following CRM Accounts have been merged. Pick a parent account and click Purge Selected to remove the obsolete CRM Accounts and merge data. You should do this as soon as you have confirmed that the merge was successful. Completed Merges: false Purge false Purge All Qt::Vertical 118 0 XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _completed _delete _deleteAll
    qt-client-4.1.0/guiclient/crmaccountMergeResultPage.cpp000066400000000000000000000137651217451700100232270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmaccountMergeResultPage.h" #include #include #include #include "crmaccount.h" #include "crmaccountMerge.h" #include "errorReporter.h" class CrmaccountMergeResultPagePrivate { public: CrmaccountMergeResultPagePrivate(QWizardPage *parent) : _parent(parent) { _crmaccount = new crmaccount(); _crmaccount->_save->setVisible(false); _crmaccount->_close->setVisible(false); QString errmsg; bool ok = false; _obsoletemqlstr = MQLUtil::mqlLoad("crmaccountmerge", "wip", errmsg, &ok); if (!ok) ErrorReporter::error(QtCriticalMsg, _parent, QT_TRANSLATE_NOOP("CrmaccountMergeResultPage", "Getting Source CRM Accounts"), errmsg, __FILE__, __LINE__); ParameterList params; params.append("mode", "view"); _crmaccount->set(params); QWidget *sa = _parent->findChild("_resultScrollAreaContents"); QLayout *lyt = sa ? sa->layout() : 0; if (lyt) lyt->addWidget(_crmaccount); else ErrorReporter::error(QtWarningMsg, _parent, QT_TRANSLATE_NOOP("CrmaccountMergeResultPage", "Could not draw CRM Account"), QT_TRANSLATE_NOOP("CrmaccountMergeResultPage", "Could not find the portion of the window " "in which to draw the target CRM Account.")); }; crmaccount *_crmaccount; QString _obsoletemqlstr; QWidget *_parent; }; CrmaccountMergeResultPage::CrmaccountMergeResultPage(QWidget *parent) : QWizardPage(parent), _data(0) { setupUi(this); _data = new CrmaccountMergeResultPagePrivate(this); _source->addColumn(tr("CRM Account Number"), -1, Qt::AlignLeft, true, "crmacct_number"); _source->addColumn(tr("CRM Account Name"), -1, Qt::AlignLeft, true, "crmacct_name"); } CrmaccountMergeResultPage::~CrmaccountMergeResultPage() { if (_data) delete _data; } void CrmaccountMergeResultPage::initializePage() { XSqlQuery idq; idq.prepare("SELECT crmacct_id" " FROM crmacct" " WHERE (crmacct_number=:number);"); idq.bindValue(":number", field("_completedMerge")); idq.exec(); if (idq.first()) _data->_crmaccount->setId(idq.value("crmacct_id").toInt()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting CRM Account"), idq, __FILE__, __LINE__)) return; else { QMessageBox::warning(this, tr("Could Not Find CRM Account"), tr("Could not find the merged CRM Account (%1).") .arg(field("_completedMerge").toString())); _data->_crmaccount->setId(-1); } ParameterList params; params.append("destid", _data->_crmaccount->id()); MetaSQLQuery mql(_data->_obsoletemqlstr); XSqlQuery srcq = mql.toQuery(params); _source->populate(srcq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Obsolete CRM Accounts"), srcq, __FILE__, __LINE__)) return; _keep->setChecked(true); _undo->setEnabled(_data->_crmaccount->id() > 0); } int CrmaccountMergeResultPage::nextId() const { int nextpage = crmaccountMerge::Page_Result; if (_keep->isChecked()) nextpage = crmaccountMerge::Page_Purge; // else if (_undo->isChecked()) then handled in validatepage() below else qWarning("BUG: CrmaccountMergeResultPage couldn't figure out what the " "next wizard page should be."); return nextpage; } bool CrmaccountMergeResultPage::validatePage() { if (_undo->isChecked()) { if (QMessageBox::question(this, tr("Revert?"), tr("

    Are you sure you want to undo this " "CRM Account Merge?

    The CRM Accounts " "will be restored and you will need to " "start the merge from the beginning.

    "), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No) return false; XSqlQuery undoq; undoq.prepare("SELECT undomerge('public', 'crmacct', :id) AS result;"); undoq.bindValue(":id", _data->_crmaccount->id()); undoq.exec(); if (undoq.first()) qWarning("undomerge(%d) returned %d", _data->_crmaccount->id(), undoq.value("result").toInt()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Undoing Merge"), undoq, __FILE__, __LINE__)) return false; omfgThis->sCrmAccountsUpdated(_data->_crmaccount->id()); wizard()->restart(); } return true; } void CrmaccountMergeResultPage::clearIfPurged() { XSqlQuery getq; getq.prepare("SELECT EXISTS(" " SELECT 1 FROM mrgundo" " WHERE ((mrgundo_base_table='crmacct')" " AND (mrgundo_base_id=:crmacctid))) AS stillthere;"); getq.bindValue(":crmacctid", _data->_crmaccount->id()); getq.exec(); if (getq.first()) { if (! getq.value("stillthere").toBool()) { _data->_crmaccount->setId(-1); _source->clear(); _keep->setChecked(true); _undo->setEnabled(false); } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Undo Status"), getq, __FILE__, __LINE__)) return; } qt-client-4.1.0/guiclient/crmaccountMergeResultPage.h000066400000000000000000000020401217451700100226540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNTMERGEPICKRESULTPAGE_H #define CRMACCOUNTMERGEPICKRESULTPAGE_H #include #include "ui_crmaccountMergeResultPage.h" class CrmaccountMergeResultPagePrivate; class CrmaccountMergeResultPage : public QWizardPage, public Ui::crmaccountMergeResultPage { Q_OBJECT public: CrmaccountMergeResultPage(QWidget *parent = 0); ~CrmaccountMergeResultPage(); virtual void initializePage(); virtual int nextId() const; virtual bool validatePage(); public slots: virtual void clearIfPurged(); protected: CrmaccountMergeResultPagePrivate *_data; }; #endif qt-client-4.1.0/guiclient/crmaccountMergeResultPage.ui000066400000000000000000000071611217451700100230530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. crmaccountMergeResultPage 0 0 439 447 WizardPage Result of Merge To keep this merge result, make sure Keep is selected below and click the Continue or Next Page button. To undo the merge, make sure the Undo button is selected and click Next Page or Continue. Result of CRM Account Merge: 0 4 true 0 0 411 271 Source CRM Accounts: 0 1 Undo Keep true XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    qt-client-4.1.0/guiclient/crmaccounts.cpp000066400000000000000000000173341217451700100204320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmaccounts.h" #include #include #include #include #include #include "characteristic.h" #include "crmaccount.h" #include "errorReporter.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" crmaccounts::crmaccounts(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "crmaccounts", fl) { setWindowTitle(tr("Accounts")); setReportName("CRMAccountMasterList"); setMetaSQLOptions("crmaccounts", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); if (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts")) { parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User); parameterWidget()->append(tr("Owner Pattern"), "owner_usr_pattern", ParameterWidget::Text); } parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); parameterWidget()->append(tr("Account Number Pattern"), "crmacct_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Account Name Pattern"), "crmacct_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Contact Name Pattern"), "cntct_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Phone Pattern"), "cntct_phone_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Email Pattern"), "cntct_email_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text); parameterWidget()->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text); parameterWidget()->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Postal Code Pattern"), "addr_postalcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text); parameterWidget()->applyDefaultFilterSet(); connect(omfgThis, SIGNAL(crmAccountsUpdated(int)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(customersUpdated(int, bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(employeeUpdated(int)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(prospectsUpdated()), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(salesRepUpdated(int)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(taxAuthsUpdated(int)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(userUpdated(QString)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(vendorsUpdated()), this, SLOT(sFillList())); list()->addColumn(tr("Number"), 80, Qt::AlignLeft, true, "crmacct_number"); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "crmacct_name"); list()->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false, "crmacct_owner_username"); list()->addColumn(tr("First"), 50, Qt::AlignLeft , true, "cntct_first_name" ); list()->addColumn(tr("Last"), -1, Qt::AlignLeft , true, "cntct_last_name" ); list()->addColumn(tr("Phone"), 100, Qt::AlignLeft , true, "cntct_phone" ); list()->addColumn(tr("Email"), 100, Qt::AlignLeft , true, "cntct_email" ); list()->addColumn(tr("Address"), -1, Qt::AlignLeft , false, "addr_line1" ); list()->addColumn(tr("City"), 75, Qt::AlignLeft , false, "addr_city" ); list()->addColumn(tr("State"), 50, Qt::AlignLeft , false, "addr_state" ); list()->addColumn(tr("Country"), 100, Qt::AlignLeft , false, "addr_country" ); list()->addColumn(tr("Postal Code"), 75, Qt::AlignLeft , false, "addr_postalcode" ); list()->addColumn(tr("Customer"), 70, Qt::AlignCenter, true, "cust"); list()->addColumn(tr("Prospect"), 70, Qt::AlignCenter, true, "prospect"); list()->addColumn(tr("Vendor"), 70, Qt::AlignCenter, true, "vend"); list()->addColumn(tr("Competitor"), 70, Qt::AlignCenter, false, "competitor"); list()->addColumn(tr("Partner"), 70, Qt::AlignCenter, false, "partner"); list()->addColumn(tr("Tax Auth."), 70, Qt::AlignCenter, false, "taxauth"); list()->addColumn(tr("User"), 70, Qt::AlignCenter, false, "usr"); list()->addColumn(tr("Employee"), 70, Qt::AlignCenter, false, "emp"); list()->addColumn(tr("Sales Rep"), 70, Qt::AlignCenter, false, "salesrep"); setupCharacteristics(characteristic::CRMAccounts); parameterWidget()->applyDefaultFilterSet(); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen())); if (!_privileges->check("MaintainAllCRMAccounts") && !_privileges->check("MaintainPersonalCRMAccounts")) newAction()->setEnabled(FALSE); } void crmaccounts::sNew() { ParameterList params; params.append("mode", "new"); crmaccount* newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccounts::sView() { ParameterList params; params.append("mode", "view"); params.append("crmacct_id", list()->id()); crmaccount* newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccounts::sDelete() { if (QMessageBox::question(this, tr("Delete?"), tr("Are you sure you want to delete this CRM Account?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM crmacct WHERE crmacct_id = :crmacct_id;"); delq.bindValue(":crmacct_id", list()->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting CRM Account"), delq, __FILE__, __LINE__)) return; sFillList(); } void crmaccounts::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("crmacct_id", list()->id()); crmaccount* newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void crmaccounts::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("crmacct_owner_username") && _privileges->check("MaintainPersonalCRMAccounts")) || (_privileges->check("MaintainAllCRMAccounts")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("crmacct_owner_username") && _privileges->check("ViewPersonalCRMAccounts")) || (_privileges->check("ViewAllCRMAccounts")); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(editPriv); } void crmaccounts::sOpen() { bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("crmacct_owner_username") && _privileges->check("MaintainPersonalCRMAccounts")) || (_privileges->check("MaintainAllCRMAccounts")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("crmacct_owner_username") && _privileges->check("ViewPersonalCRMAccounts")) || (_privileges->check("ViewAllCRMAccounts")); if (editPriv) sEdit(); else if (viewPriv) sView(); } qt-client-4.1.0/guiclient/crmaccounts.h000066400000000000000000000016301217451700100200670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CRMACCOUNTS_H #define CRMACCOUNTS_H #include "display.h" #include class crmaccounts : public display { Q_OBJECT public: crmaccounts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sNew(); virtual void sView(); virtual void sOpen(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // CRMACCOUNTS_H qt-client-4.1.0/guiclient/currencies.cpp000066400000000000000000000136101217451700100202440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "currencies.h" #include #include #include #include #include #include "currency.h" currencies::currencies(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_curr, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); if (_privileges->check("MaintainCurrencies")) { connect(_curr, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_curr, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_curr, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_curr, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _curr->addColumn( tr("Base"), _ynColumn, Qt::AlignCenter, true, "flag"); _curr->addColumn( tr("Name"), -1, Qt::AlignLeft, true, "curr_name"); _curr->addColumn( tr("Symbol"), _currencyColumn, Qt::AlignCenter, true, "curr_symbol"); _curr->addColumn( tr("Abbreviation"), _currencyColumn, Qt::AlignLeft, true, "curr_abbr"); sFillList(); } currencies::~currencies() { // no need to delete child widgets, Qt does it all for us } void currencies::languageChange() { retranslateUi(this); } void currencies::sNew() { XSqlQuery currenciesNew; bool single = omfgThis->singleCurrency(); ParameterList params; params.append("mode", "new"); currency *newdlg = new currency(this, "", TRUE); newdlg->set(params); newdlg->exec(); sFillList(); if(single && !omfgThis->singleCurrency() && _metrics->value("GLCompanySize").toInt() == 0) { // Check for the gain/loss and discrep accounts currenciesNew.prepare("SELECT COUNT(*) = 2 AS result" " FROM accnt " " WHERE accnt_id IN (fetchMetricValue('CurrencyGainLossAccount')," " fetchMetricValue('GLSeriesDiscrepancyAccount'));"); currenciesNew.exec(); if(currenciesNew.first() && currenciesNew.value("result").toBool() != true) { QMessageBox::warning( this, tr("Additional Configuration Required"), tr("

    Your system is configured to use multiple Currencies, but the " "Currency Gain/Loss Account and/or the G/L Series Discrepancy Account " "does not appear to be configured correctly. You should define these " "Accounts in 'System | Configure Modules | Configure G/L...' before " "posting any transactions in the system.") ); } else if (currenciesNew.lastError().type() != QSqlError::NoError) { systemError(this, currenciesNew.lastError().databaseText(), __FILE__, __LINE__); return; } } } void currencies::sEdit() { ParameterList params; params.append("curr_id", _curr->id()); params.append("mode", "edit"); currency *newdlg = new currency(this, "", TRUE); newdlg->set(params); newdlg->exec(); sFillList(); } void currencies::sView() { ParameterList params; params.append("curr_id", _curr->id()); params.append("mode", "view"); currency *newdlg = new currency(this, "", TRUE); newdlg->set(params); newdlg->exec(); } void currencies::sDelete() { XSqlQuery currenciesDelete; currenciesDelete.prepare("SELECT curr_base FROM curr_symbol " "WHERE curr_id = :curr_id"); currenciesDelete.bindValue(":curr_id", _curr->id()); currenciesDelete.exec(); if (currenciesDelete.first() && currenciesDelete.value("curr_base").toBool()) { QMessageBox::critical(this, tr("Cannot delete base currency"), tr("You cannot delete the base currency.")); return; } else if (currenciesDelete.lastError().type() != QSqlError::NoError) { systemError(this, currenciesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } currenciesDelete.prepare("DELETE FROM curr_symbol WHERE curr_id = :curr_id"); currenciesDelete.bindValue(":curr_id", _curr->id()); currenciesDelete.exec(); if (currenciesDelete.lastError().type() != QSqlError::NoError) { systemError(this, currenciesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void currencies::sFillList() { XSqlQuery currenciesFillList; currenciesFillList.prepare( "SELECT *, " " CASE WHEN curr_base = TRUE THEN 'Y' " " ELSE '' END AS flag " "FROM curr_symbol " "ORDER BY flag DESC, curr_name;" ); currenciesFillList.exec(); _curr->populate(currenciesFillList); if (currenciesFillList.lastError().type() != QSqlError::NoError) { systemError(this, currenciesFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void currencies::sPopulateMenu(QMenu* pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("View...")); connect(menuItem, SIGNAL(triggered()), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Edit...")); connect(menuItem, SIGNAL(triggered()), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCurrencies")); menuItem = pMenu->addAction(tr("Delete...")); connect(menuItem, SIGNAL(triggered()), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainCurrencies")); } qt-client-4.1.0/guiclient/currencies.h000066400000000000000000000020031217451700100177030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CURRENCIES_H #define CURRENCIES_H #include "guiclient.h" #include "xwidget.h" #include "ui_currencies.h" class currencies : public XWidget, public Ui::currencies { Q_OBJECT public: currencies(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~currencies(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * pMenu ); protected slots: virtual void languageChange(); }; #endif // CURRENCIES_H qt-client-4.1.0/guiclient/currencies.ui000066400000000000000000000105151217451700100201000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. currencies 0 0 600 400 List Currencies 0 Currencies: &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

    xtreewidget.h
    1 _curr _close _new _edit _view _delete _close clicked() currencies close() 20 20 20 20 _curr valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/currenciesDialog.cpp000066400000000000000000000022061217451700100213630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "currenciesDialog.h" #include "currencies.h" currenciesDialog::currenciesDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { if (name) setObjectName(name); this->setFixedSize(400, 400); _layout = new QBoxLayout(QBoxLayout::TopToBottom, this); _currencies = new currencies(this, "", Qt::Widget); _msg = new QLabel(tr("Please select a base currency for this database."), this); _layout->addWidget(_msg); _layout->addWidget(_currencies); connect(_currencies->_close, SIGNAL(clicked()), this, SLOT(close())); } currenciesDialog::~currenciesDialog() { // no need to delete child widgets, Qt does it all for us } qt-client-4.1.0/guiclient/currenciesDialog.h000066400000000000000000000016041217451700100210310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CURRENCIESDIALOG_H___ #define __CURRENCIESDIALOG_H___ class QWidget; class QBoxLayout; class currencies; #include #include class currenciesDialog : public QDialog { Q_OBJECT public: currenciesDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~currenciesDialog(); protected: currencies *_currencies; QBoxLayout *_layout; QLabel *_msg; }; #endif qt-client-4.1.0/guiclient/currency.cpp000066400000000000000000000155411217451700100177410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "currency.h" #include #include #include #include "currencySelect.h" currency::currency(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _select = _buttonBox->addButton(tr("Select"), QDialogButtonBox::ActionRole); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); // connect(_currBase, SIGNAL(toggled(bool)), this, SLOT(sConfirmBaseFlag())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); // avoid sConfirmBaseFlag() when calling populate for editing base currency // baseOrig gets set in set() for cNew and in populate() for cEdit and cView baseOrig = TRUE; } currency::~currency() { // no need to delete child widgets, Qt does it all for us } void currency::languageChange() { retranslateUi(this); } bool currency::isBaseSet() { XSqlQuery currencyisBaseSet; int numSet = 0; currencyisBaseSet.prepare("SELECT count(*) AS numSet " "FROM curr_symbol WHERE curr_base = TRUE"); currencyisBaseSet.exec(); if (currencyisBaseSet.first()) { numSet = currencyisBaseSet.value("numSet").toInt(); } else if (currencyisBaseSet.lastError().type() != QSqlError::NoError) { systemError(this, currencyisBaseSet.lastError().databaseText(), __FILE__, __LINE__); } return numSet != 0; } enum SetResponse currency::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("curr_id", &valid); if (valid) { _currid = param.toInt(); populate(); } else baseOrig = FALSE; // see comments in constructor param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _currBase->setEnabled(! isBaseSet()); } else if (param.toString() == "edit") { _mode = cEdit; _currBase->setEnabled(! isBaseSet()); } else if (param.toString() == "view") { _mode = cView; _currName->setEnabled(FALSE); _currSymbol->setEnabled(FALSE); _currAbbr->setEnabled(FALSE); _currBase->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void currency::sSave() { XSqlQuery currencySave; sConfirmBaseFlag(); if (_currName->text().isEmpty()) { QMessageBox::critical(this, tr("Name Required") .arg(__FILE__) .arg(__LINE__), tr("Currency name is required.")); _currName->setFocus(); return; } if (_currAbbr->text().isEmpty() && _currSymbol->text().isEmpty()) { QMessageBox::critical(this, tr("Symbol or Abbreviation Required") .arg(__FILE__) .arg(__LINE__), tr("Either the currency symbol or abbreviation must be " "supplied.\n(Both would be better.)") ); _currSymbol->setFocus(); return; } if (_currAbbr->text().length() > 3) { QMessageBox::critical(this, tr("Abbreviation Too Long") .arg(__FILE__) .arg(__LINE__), tr("The currency abbreviation must have " "3 or fewer characters.\n" "ISO abbreviations are exactly 3 characters long.") ); return; } if (_mode == cNew) { currencySave.prepare( "INSERT INTO curr_symbol " "( curr_name, curr_symbol, curr_abbr, curr_base ) " "VALUES " "( :curr_name, :curr_symbol, :curr_abbr, :curr_base );" ); } else if (_mode == cEdit) { currencySave.prepare( "UPDATE curr_symbol " "SET curr_name=:curr_name, curr_symbol=:curr_symbol, " " curr_abbr=:curr_abbr, curr_base = :curr_base " "WHERE (curr_id=:curr_id);" ); currencySave.bindValue(":curr_id", _currid); } currencySave.bindValue(":curr_name", _currName->text()); currencySave.bindValue(":curr_symbol", _currSymbol->text()); currencySave.bindValue(":curr_abbr", _currAbbr->text()); currencySave.bindValue(":curr_base", QVariant(_currBase->isChecked())); currencySave.exec(); if (currencySave.lastError().type() != QSqlError::NoError) { systemError(this, currencySave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_currid); } void currency::populate() { XSqlQuery currencypopulate; currencypopulate.prepare( "SELECT curr_name, curr_symbol, curr_base, curr_abbr " "FROM curr_symbol " "WHERE (curr_id=:curr_id);" ); currencypopulate.bindValue(":curr_id", _currid); currencypopulate.exec(); if (currencypopulate.first()) { _currName->setText(currencypopulate.value("curr_name").toString()); _currSymbol->setText(currencypopulate.value("curr_symbol").toString()); _currBase->setChecked(currencypopulate.value("curr_base").toBool()); _currAbbr->setText(currencypopulate.value("curr_abbr").toString()); baseOrig = _currBase->isChecked(); } else if (currencypopulate.lastError().type() != QSqlError::NoError) { systemError(this, currencypopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void currency::sConfirmBaseFlag() { if (_currBase->isChecked() && !baseOrig) { int response = QMessageBox::warning (this, tr("Set Base Currency?"), tr("You cannot change the base currency " "after it is set. Are you sure you want " "%1 to be the base currency?") .arg(_currName->text()), QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default); if (response != QMessageBox::Yes) { _currBase->setChecked(FALSE); } } } void currency::sClose() { close(); } void currency::sSelect() { XSqlQuery cs; currencySelect *newdlg = new currencySelect(this, "", true); int country_id = newdlg->exec(); if (country_id > 0) { cs.prepare("SELECT * FROM country WHERE country_id = :country_id;"); cs.bindValue(":country_id", country_id); cs.exec(); if (cs.first()) { _currName->setText(cs.value("country_curr_name").toString()); _currAbbr->setText(cs.value("country_curr_abbr").toString()); _currSymbol->setText(cs.value("country_curr_symbol").toString()); } else if (cs.lastError().type() != QSqlError::NoError) { systemError(this, cs.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/currency.h000066400000000000000000000022631217451700100174030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CURRENCY_H #define CURRENCY_H #include "guiclient.h" #include "xdialog.h" #include "parameter.h" #include "ui_currency.h" class currency : public XDialog, public Ui::currency { Q_OBJECT public: currency(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~currency(); virtual bool isBaseSet(); virtual SetResponse set(const ParameterList & pParams ); public slots: virtual void sSave(); virtual void sSelect(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _currid; bool baseOrig; QPushButton* _select; private slots: virtual void sConfirmBaseFlag(); virtual void sClose(); }; #endif // CURRENCY_H qt-client-4.1.0/guiclient/currency.ui000066400000000000000000000125461217451700100175760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. currency 0 0 418 140 400 130 Currency 5 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 Qt::Horizontal QSizePolicy::Expanding 61 21 5 Qt::Horizontal QSizePolicy::Expanding 41 20 Symbol: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Abbreviation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 Base Currency Qt::Horizontal QSizePolicy::Expanding 71 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save _currName _currSymbol _currAbbr _currBase qt-client-4.1.0/guiclient/currencyConversion.cpp000066400000000000000000000207731217451700100220120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "currencyConversion.h" #include #include #include #include #include "xcombobox.h" // perhaps this should be a generalized XDoubleValidator, but for now // it should match the definition of the curr_rate column in curr_rate table // with one difference - the number of decimal places should be one less than // the scale of curr_rate.curr_rate (see Mantis bug 3901). class RateValidator : public QDoubleValidator { public: RateValidator(QObject*, const char* = 0); void fixup(QString& ) const; }; RateValidator::RateValidator(QObject* parent, const char* name) : QDoubleValidator(0.00001, 99999.99999, 5, parent) { if (name) setObjectName(name); } void RateValidator::fixup ( QString & input ) const { if (input.isEmpty()) return; double rateDouble = QLocale().toDouble(input); if (rateDouble < bottom()) rateDouble = bottom(); else if (rateDouble > top()) rateDouble = top(); //input.setNum(rateDouble, 'f', decimals()); } currencyConversion::currencyConversion(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(_sClose())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(_sSave())); connect(_rate, SIGNAL(editingFinished()), this, SLOT(sFixRate())); _currency->setType(XComboBox::CurrenciesNotBase); _rate->setValidator(new RateValidator (_rate) ); } currencyConversion::~currencyConversion() { // no need to delete child widgets, Qt does it all for us } void currencyConversion::languageChange() { retranslateUi(this); } enum SetResponse currencyConversion::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("curr_rate_id", &valid); if (valid) { _curr_rate_id = param.toInt(); } else _curr_rate_id = 0; param = pParams.value("curr_id", &valid); if (valid) { _curr_id = param.toInt(); } else { _curr_id = 0; } populate(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _currency->setEnabled(FALSE); _rate->setEnabled(FALSE); _dateCluster->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void currencyConversion::_sClose() { done(_curr_rate_id); } void currencyConversion::_sSave() { XSqlQuery currency_sSave; if (! _currency->isValid()) { QMessageBox::warning(this, tr("Missing Currency"), tr("Please specify a currency for this exchange rate.")); _currency->setFocus(); return; } if (_rate->toDouble() == 0) { QMessageBox::warning(this, tr("No Rate Specified"), tr("You must specify a Rate that is not zero.") ); return; } if (!_dateCluster->startDate().isValid()) { QMessageBox::warning( this, tr("Missing Start Date"), tr("Please specify a Start Date for this exchange rate.")); _dateCluster->setFocus(); return; } if (!_dateCluster->endDate().isValid()) { QMessageBox::warning( this, tr("Missing End Date"), tr("Please specify an End Date for this exchange rate. ")); _dateCluster->setFocus(); return; } if (_dateCluster->startDate() > _dateCluster->endDate()) { QMessageBox::warning(this, tr("Invalid Date Order"), tr("The Start Date for this exchange rate is " "later than the End Date.\n" "Please check the values of these dates.")); _dateCluster->setFocus(); return; } currency_sSave.prepare( "SELECT count(*) AS numberOfOverlaps " "FROM curr_rate " "WHERE curr_id = :curr_id" " AND curr_rate_id != :curr_rate_id" " AND ( (curr_effective BETWEEN :curr_effective AND :curr_expires OR" " curr_expires BETWEEN :curr_effective AND :curr_expires)" " OR (curr_effective <= :curr_effective AND" " curr_expires >= :curr_expires) );" ); currency_sSave.bindValue(":curr_rate_id", _curr_rate_id); currency_sSave.bindValue(":curr_id", _currency->id()); currency_sSave.bindValue(":curr_effective", _dateCluster->startDate()); currency_sSave.bindValue(":curr_expires", _dateCluster->endDate()); currency_sSave.exec(); if (currency_sSave.first()) { if (currency_sSave.value("numberOfOverlaps").toInt() > 0) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("The date range overlaps with " "another date range.\n" "Please check the values of these dates.")); _dateCluster->setFocus(); return; } } QString inverter(""); if (_metrics->value("CurrencyExchangeSense").toInt() == 1) inverter = "1 / "; QString sql; if (_mode == cNew) sql = QString("INSERT INTO curr_rate " "(curr_id, curr_rate, curr_effective, curr_expires) " "VALUES " "(:curr_id, %1 CAST(:curr_rate AS NUMERIC), " " :curr_effective, :curr_expires)") .arg(inverter); else if (_mode == cEdit) sql = QString("UPDATE curr_rate SET " "curr_id = :curr_id, " "curr_rate = %1 CAST(:curr_rate AS NUMERIC), " "curr_effective = :curr_effective, " "curr_expires = :curr_expires " "WHERE curr_rate_id = :curr_rate_id") .arg(inverter); _rate->setText(_rate->text().replace(',', '.')); currency_sSave.prepare(sql); currency_sSave.bindValue(":curr_rate_id", _curr_rate_id); currency_sSave.bindValue(":curr_id", _currency->id()); currency_sSave.bindValue(":curr_rate", _rate->toDouble()); currency_sSave.bindValue(":curr_effective", _dateCluster->startDate()); currency_sSave.bindValue(":curr_expires", _dateCluster->endDate()); currency_sSave.exec(); if (currency_sSave.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), currency_sSave.lastError().databaseText()); return; } done(_curr_rate_id); } void currencyConversion::populate() { XSqlQuery currencypopulate; QString rateString; if (_curr_rate_id) { QString inverter(""); if (_metrics->value("CurrencyExchangeSense").toInt() == 1) inverter = "1 / "; QString sql = QString("SELECT curr_id, %1 curr_rate AS curr_rate, " "curr_effective, curr_expires " "FROM curr_rate " "WHERE curr_rate_id = :curr_rate_id;") .arg(inverter); currencypopulate.prepare(sql); currencypopulate.bindValue(":curr_rate_id", _curr_rate_id); currencypopulate.exec(); { if (currencypopulate.first()) { _currency->setId(currencypopulate.value("curr_id").toInt()); _dateCluster->setStartDate(currencypopulate.value("curr_effective").toDate()); _dateCluster->setEndDate(currencypopulate.value("curr_expires").toDate()); _rate->setText(rateString.setNum(currencypopulate.value("curr_rate").toDouble(), 'f', 5)); } } } if (_curr_id) { _currency->setId(_curr_id); } } void currencyConversion::sFixRate() { QString rateStr = _rate->text(); RateValidator* rateValidator = new RateValidator(_rate); int dummy = 0; if (rateValidator->validate(rateStr, dummy) == QValidator::Intermediate) { rateValidator->fixup(rateStr); _rate->setText(rateStr); } } qt-client-4.1.0/guiclient/currencyConversion.h000066400000000000000000000022351217451700100214500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CURRENCYCONVERSION_H #define CURRENCYCONVERSION_H #include "guiclient.h" #include "xdialog.h" #include "parameter.h" #include "ui_currencyConversion.h" class currencyConversion : public XDialog, public Ui::currencyConversion { Q_OBJECT public: currencyConversion(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~currencyConversion(); virtual SetResponse set(const ParameterList & pParams); public slots: virtual void _sClose(); virtual void _sSave(); virtual void populate(); virtual void sFixRate(); protected slots: virtual void languageChange(); private: int _curr_rate_id; int _mode; int _curr_id; }; #endif // CURRENCYCONVERSION_H qt-client-4.1.0/guiclient/currencyConversion.ui000066400000000000000000000062331217451700100216400ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. currencyConversion 0 0 353 149 330 110 Currency Exchange Rate 4 Exchange Rate: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save DateCluster QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _currency _rate _dateCluster parameter.h
    qt-client-4.1.0/guiclient/currencyConversions.cpp000066400000000000000000000173641217451700100221770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "currencyConversions.h" #include #include #include #include #include #include #include #include "mqlutil.h" #include "currencyConversion.h" #include "currency.h" #include "datecluster.h" #include "xcombobox.h" currencyConversions::currencyConversions(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_conversionRates, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_newCurrency, SIGNAL(clicked()), this, SLOT(sNewCurrency())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); setBaseCurrency(); _conversionRates->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "f_curr"); _conversionRates->addColumn(tr("Exchange Rate"), -1, Qt::AlignRight,true, "rate"); _conversionRates->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter,true, "curr_effective"); _conversionRates->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter,true, "curr_expires"); _newCurrency->setEnabled(_privileges->check("CreateNewCurrency")); bool maintainPriv = _privileges->check("MaintainCurrencyRates"); _new->setEnabled(maintainPriv); if (maintainPriv) { connect(_conversionRates, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_conversionRates, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_conversionRates, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } else { connect(_conversionRates, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(_conversionRates, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); _dateCluster->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _dateCluster->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); _queryParameters->setType(ParameterGroup::CurrencyNotBase); switch (_metrics->value("CurrencyExchangeSense").toInt()) { case 0: _exchSenseLit->setText(tr("Base x Exchange Rate = Foreign")); break; case 1: _exchSenseLit->setText(tr("Foreign x Exchange Rate = Base")); break; case -1: default: QMessageBox::warning(this, tr("No Exchange Rate Direction Defined"), tr("

    No selection has yet been made for " "whether exchange rates convert from " "the base currency to foreign currencies " "or from foreign to base. Go to " "System | Configure Modules | Configure " "G/L and make your selection.")); close(); } sFillList(); } currencyConversions::~currencyConversions() { // no need to delete child widgets, Qt does it all for us } void currencyConversions::languageChange() { retranslateUi(this); } void currencyConversions::sNew() { if (omfgThis->singleCurrency()) QMessageBox::warning(this, tr("No Foreign Currencies Defined"), tr("

    There is only a base currency defined. " "You must add more currencies before you " "can create an exchange rate. Click the " "NEW CURRENCY button to add another " "currency.")); else { ParameterList params; params.append("mode", "new"); if (_queryParameters->isSelected()) params.append("curr_id", _queryParameters->id()); currencyConversion newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } } void currencyConversions::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("curr_rate_id", _conversionRates->id()); currencyConversion newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void currencyConversions::sView() { ParameterList params; params.append("mode", "view"); params.append("curr_rate_id", _conversionRates->id()); currencyConversion newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void currencyConversions::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("CurrencyConversionList", params); if (report.isValid()) report.print(); else report.reportError(this); } void currencyConversions::sClose() { close(); } void currencyConversions::sDelete() { XSqlQuery currencyDelete; currencyDelete.prepare("DELETE FROM curr_rate " "WHERE curr_rate_id = :curr_rate_id"); currencyDelete.bindValue(":curr_rate_id", _conversionRates->id()); currencyDelete.exec(); if (currencyDelete.lastError().type() != QSqlError::NoError) { systemError(this, currencyDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void currencyConversions::sNewCurrency() { ParameterList params; params.append("mode", "new"); currency newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); setBaseCurrency(); _queryParameters->repopulateSelected(); } bool currencyConversions::setParams(ParameterList ¶ms) { if (_metrics->value("CurrencyExchangeSense").toInt() == 1) params.append("invert"); _queryParameters->appendValue(params); _dateCluster->appendValue(params); return true; } void currencyConversions::sFillList() { XSqlQuery currencyFillList; MetaSQLQuery mql = mqlLoad("currencyConversions", "detail"); ParameterList params; if (! setParams(params)) return; currencyFillList = mql.toQuery(params); _conversionRates->populate(currencyFillList); if (currencyFillList.lastError().type() != QSqlError::NoError) { systemError(this, currencyFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void currencyConversions::sPopulateMenu( QMenu* pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCurrencyRates")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainCurrencyRates")); } void currencyConversions::setBaseCurrency() { XSqlQuery currencyetBaseCurrency; currencyetBaseCurrency.prepare("SELECT currConcat(curr_abbr, curr_symbol) AS baseCurrency " "FROM curr_symbol " "WHERE curr_base = TRUE"); currencyetBaseCurrency.exec(); if (currencyetBaseCurrency.first()) { _baseCurrency->setText(currencyetBaseCurrency.value("baseCurrency").toString()); } else if (currencyetBaseCurrency.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), currencyetBaseCurrency.lastError().databaseText()); } } qt-client-4.1.0/guiclient/currencyConversions.h000066400000000000000000000024241217451700100216330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CURRENCYCONVERSIONS_H #define CURRENCYCONVERSIONS_H #include "guiclient.h" #include "xwidget.h" #include "parameter.h" #include "ui_currencyConversions.h" class currencyConversions : public XWidget, public Ui::currencyConversions { Q_OBJECT public: currencyConversions(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~currencyConversions(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPrint(); virtual void sClose(); virtual void sDelete(); virtual void sNewCurrency(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void setBaseCurrency(); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); private: }; #endif // CURRENCYCONVERSIONS_H qt-client-4.1.0/guiclient/currencyConversions.ui000066400000000000000000000234721217451700100220270ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. currencyConversions 0 0 620 442 365 361 List Currency Exchange Rates false Base Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter NONE DEFINED Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::AlignCenter Qt::Horizontal 0 20 &Close Query true &Print Qt::Vertical QSizePolicy::Expanding 74 13 0 1 QFrame::NoFrame QFrame::Raised 0 0 true Foreign Currencies: 2 0 true &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Fixed 74 13 New Currency Qt::Vertical QSizePolicy::Expanding 21 61 DateCluster QWidget

    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _queryParameters _dateCluster _conversionRates _close _query _print _new _edit _view _delete _newCurrency parameter.h qt-client-4.1.0/guiclient/currencySelect.cpp000066400000000000000000000037211217451700100210760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "currencySelect.h" #include currencySelect::currencySelect(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_country, SIGNAL(newID(int)), this, SLOT(sPopulate())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); _country->clear(); XSqlQuery country; country.prepare("SELECT country_id, country_name FROM country ORDER BY country_name;"); country.exec(); _country->populate(country, 0); } currencySelect::~currencySelect() { // no need to delete child widgets, Qt does it all for us } void currencySelect::languageChange() { retranslateUi(this); } void currencySelect::sSelect() { done(_country->id()); } void currencySelect::sClose() { done(-1); } void currencySelect::sPopulate() { XSqlQuery currencyPopulate; currencyPopulate.prepare("SELECT * FROM country WHERE country_id = :country_id;"); currencyPopulate.bindValue(":country_id", _country->id()); currencyPopulate.exec(); if (currencyPopulate.first()) { _currName->setText(currencyPopulate.value("country_curr_name").toString()); _currAbbr->setText(currencyPopulate.value("country_curr_abbr").toString()); _currSymbol->setText(currencyPopulate.value("country_curr_symbol").toString()); } else if (currencyPopulate.lastError().type() != QSqlError::NoError) { systemError(this, currencyPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/currencySelect.h000066400000000000000000000017741217451700100205510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CURRENCYSELECT_H #define CURRENCYSELECT_H #include "guiclient.h" #include "xdialog.h" #include "parameter.h" #include "ui_currencySelect.h" class currencySelect : public XDialog, public Ui::currencySelect { Q_OBJECT public: currencySelect(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~currencySelect(); public slots: virtual void sClose(); virtual void sPopulate(); virtual void sSelect(); protected slots: virtual void languageChange(); private: private slots: }; #endif // CURRENCYSELECT_H qt-client-4.1.0/guiclient/currencySelect.ui000066400000000000000000000175311217451700100207350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. currencySelect 0 0 443 130 400 130 Currency Selection 5 5 0 5 0 6 Country: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 0 2 Currency Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 5 false Qt::Horizontal QSizePolicy::Expanding 61 21 0 5 false Qt::Horizontal QSizePolicy::Expanding 41 20 Symbol: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Abbreviation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 0 5 0 0 &Cancel &Select true true Qt::Vertical QSizePolicy::Expanding 20 21 XComboBox QComboBox
    xcombobox.h
    0
    _currName _currSymbol _currAbbr _select _close
    qt-client-4.1.0/guiclient/custCharacteristicDelegate.cpp000066400000000000000000000077511217451700100233750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "characteristic.h" #include "custCharacteristicDelegate.h" #include "datecluster.h" #include "guiclient.h" #include "xt.h" CustCharacteristicDelegate::CustCharacteristicDelegate(QObject *parent) : QItemDelegate(parent) { } QWidget *CustCharacteristicDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem & /*style*/, const QModelIndex & index) const { if(index.column()!=1) return 0; QModelIndex idx = index.sibling(index.row(), 0); characteristic::Type chartype = characteristic::Text; // Determine what type we have XSqlQuery qry; qry.prepare("SELECT char_id, char_type " "FROM char " "WHERE (char_id=:char_id); "); qry.bindValue(":char_id", idx.model()->data(idx, Qt::UserRole)); qry.exec(); if (qry.first()) chartype = (characteristic::Type)qry.value("char_type").toInt(); if (chartype == characteristic::Text || chartype == characteristic::List) { qry.prepare("SELECT charass_value " "FROM char, charass " " LEFT OUTER JOIN charopt ON ((charopt_char_id=charass_char_id) " " AND (charopt_value=charass_value)) " "WHERE ((charass_char_id=char_id)" " AND (charass_target_type='CT')" " AND (charass_target_id=:custtype_id)" " AND (char_id=:char_id) ) " "ORDER BY COALESCE(charopt_order,0), charass_value;"); qry.bindValue(":char_id", idx.model()->data(idx, Qt::UserRole)); qry.bindValue(":custtype_id", index.model()->data(index, Xt::IdRole)); qry.exec(); QComboBox *editor = new QComboBox(parent); editor->setEditable(chartype == characteristic::Text); #ifdef Q_WS_MAC QFont boxfont = editor->font(); boxfont.setPointSize((boxfont.pointSize() == -1) ? boxfont.pixelSize() - 3 : boxfont.pointSize() - 3); editor->setFont(boxfont); #endif while(qry.next()) editor->addItem(qry.value("charass_value").toString()); editor->installEventFilter(const_cast(this)); return editor; } else if (chartype == characteristic::Date) { DLineEdit *editor = new DLineEdit(parent); return editor; } return 0; } void CustCharacteristicDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { if (editor->inherits("QComboBox")) { QString value = index.model()->data(index, Qt::DisplayRole).toString(); QComboBox *comboBox = static_cast(editor); int curIdx = comboBox->findText(value); if(curIdx != -1) comboBox->setCurrentIndex(curIdx); else comboBox->setEditText(value); } else if (editor->inherits("DLineEdit")) { QDate date = index.model()->data(index, Qt::UserRole).toDate(); DLineEdit *dlineedit = static_cast(editor); dlineedit->setDate(date); } } void CustCharacteristicDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { if (editor->inherits("QComboBox")) { QComboBox *comboBox = static_cast(editor); model->setData(index, comboBox->currentText()); } else if (editor->inherits("DLineEdit")) { DLineEdit *dlineedit = static_cast(editor); model->setData(index, dlineedit->date()); } } void CustCharacteristicDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const { editor->setGeometry(option.rect); } qt-client-4.1.0/guiclient/custCharacteristicDelegate.h000066400000000000000000000022601217451700100230300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CUSTCHARACTERISTICDELEGATE_H__ #define __CUSTCHARACTERISTICDELEGATE_H__ #include #include #include class CustCharacteristicDelegate : public QItemDelegate { Q_OBJECT public: CustCharacteristicDelegate(QObject * parent = 0); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; }; #endif qt-client-4.1.0/guiclient/customCommand.cpp000066400000000000000000000226211217451700100207150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customCommand.h" #include #include #include #include #include "customCommandArgument.h" customCommand::customCommand(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_accept, SIGNAL(clicked()), this, SLOT(sSave())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _mode = cNew; _cmdid = -1; _saved = false; _arguments->addColumn(tr("Order"), _whsColumn, Qt::AlignCenter,true, "cmdarg_order"); _arguments->addColumn(tr("Argument"), -1, Qt::AlignLeft, true, "cmdarg_arg"); _module->clear(); int i = 0; _module->append(i++, "Products"); _module->append(i++, "Inventory"); if (_metrics->value("Application") != "PostBooks") _module->append(i++, "Schedule"); _module->append(i++, "Purchase"); _module->append(i++, "Manufacture"); _module->append(i++, "CRM"); _module->append(i++, "Sales"); _module->append(i++, "Accounting"); _module->append(i++, "System"); } customCommand::~customCommand() { // no need to delete child widgets, Qt does it all for us } void customCommand::languageChange() { retranslateUi(this); } enum SetResponse customCommand::set( const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if(valid) { QString mode = param.toString(); if("new" == mode) setMode(cNew); else if("edit" == mode) setMode(cEdit); else if("view" == mode) setMode(cView); } // after setMode because populate() may change mode param = pParams.value("cmd_id", &valid); if(valid) { _cmdid = param.toInt(); populate(); } return NoError; } void customCommand::setMode(const int pmode) { XSqlQuery custometMode; switch (pmode) { case cNew: custometMode.prepare("SELECT nextval('cmd_cmd_id_seq') AS result;"); custometMode.exec(); if(custometMode.first()) _cmdid = custometMode.value("result").toInt(); else if (custometMode.lastError().type() != QSqlError::NoError) { systemError(this, custometMode.lastError().databaseText(), __FILE__, __LINE__); return; } /* fallthru */ case cEdit: _module->setEnabled(true); _title->setEnabled(true); _privname->setEnabled(true); _name->setEnabled(true); _description->setEnabled(true); _executable->setEnabled(true); _accept->show(); _close->setText(tr("&Cancel")); if (pmode == cNew) _module->setFocus(); else _accept->setFocus(); break; case cView: default: _module->setEnabled(false); _title->setEnabled(false); _privname->setEnabled(false); _name->setEnabled(false); _description->setEnabled(false); _executable->setEnabled(false); _accept->hide(); _close->setText(tr("&Close")); _close->setFocus(); break; } _mode = pmode; } void customCommand::sSave() { XSqlQuery customSave; if(!save()) return; // make sure the custom privs get updated customSave.exec("SELECT updateCustomPrivs();"); if (customSave.lastError().type() != QSqlError::NoError) { systemError(this, customSave.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } bool customCommand::save() { XSqlQuery customave; if(_title->text().trimmed().isEmpty()) { QMessageBox::warning( this, tr("Cannot Save"), tr("You must enter in a Menu Label for this command.") ); return false; } if(_executable->text().trimmed().isEmpty()) { QMessageBox::warning( this, tr("Cannot Save"), tr("You must enter in a program to execute.") ); return false; } if(_privname->text().trimmed().contains(QRegExp("\\s"))) { QMessageBox::warning( this, tr("Cannot Save"), tr("Priv Name may not contain spaces.") ); return false; } if((cNew == _mode) && !_saved) customave.prepare("INSERT INTO cmd" " (cmd_id, cmd_module, cmd_title, cmd_privname," " cmd_name, cmd_descrip, cmd_executable) " "VALUES(:cmd_id, :cmd_module, :cmd_title, :cmd_privname," " :cmd_name, :cmd_descrip, :cmd_executable);"); else if(cEdit == _mode || ((cNew == _mode) && _saved)) customave.prepare("UPDATE cmd" " SET cmd_module=:cmd_module," " cmd_title=:cmd_title," " cmd_privname=:cmd_privname," " cmd_name=:cmd_name," " cmd_descrip=:cmd_descrip," " cmd_executable=:cmd_executable " " WHERE (cmd_id=:cmd_id);"); customave.bindValue(":cmd_id", _cmdid); customave.bindValue(":cmd_module", _module->code()); customave.bindValue(":cmd_title", _title->text()); customave.bindValue(":cmd_privname", _privname->text().trimmed()); if(!_name->text().isEmpty()) customave.bindValue(":cmd_name", _name->text()); customave.bindValue(":cmd_descrip", _description->toPlainText()); customave.bindValue(":cmd_executable", _executable->text()); customave.exec(); if (customave.lastError().type() != QSqlError::NoError) { systemError(this, customave.lastError().databaseText(), __FILE__, __LINE__); return false; } _saved = true; return true; } void customCommand::reject() { if(cNew == _mode) { QSqlQuery query; query.prepare("DELETE FROM cmdarg WHERE (cmdarg_cmd_id=:cmd_id);"); query.bindValue(":cmd_id", _cmdid); query.exec(); if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } query.prepare("DELETE FROM cmd WHERE (cmd_id=:cmd_id);"); query.bindValue(":cmd_id", _cmdid); query.exec(); if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } XDialog::reject(); } void customCommand::sNew() { if(!save()) return; ParameterList params; params.append("mode", "new"); params.append("cmd_id", _cmdid); customCommandArgument newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void customCommand::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("cmdarg_id", _arguments->id()); customCommandArgument newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void customCommand::sDelete() { XSqlQuery customDelete; customDelete.prepare("DELETE FROM cmdarg WHERE (cmdarg_id=:cmdarg_id);"); customDelete.bindValue(":cmdarg_id", _arguments->id()); if(customDelete.exec()) sFillList(); else if (customDelete.lastError().type() != QSqlError::NoError) { systemError(this, customDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void customCommand::populate() { XSqlQuery custompopulate; custompopulate.prepare("SELECT cmd.*, COALESCE(pkghead_indev,true) AS editable " " FROM cmd, pg_class, pg_namespace " " LEFT OUTER JOIN pkghead ON (nspname=pkghead_name) " " WHERE ((cmd.tableoid=pg_class.oid)" " AND (relnamespace=pg_namespace.oid) " " AND (cmd_id=:cmd_id));"); custompopulate.bindValue(":cmd_id", _cmdid); custompopulate.exec(); if(custompopulate.first()) { _module->setCode(custompopulate.value("cmd_module").toString()); if (_module->id() < 0) { _module->append(_module->count(), custompopulate.value("cmd_module").toString()); _module->setCode(custompopulate.value("cmd_module").toString()); } _title->setText(custompopulate.value("cmd_title").toString()); _oldPrivname = custompopulate.value("cmd_privname").toString(); _privname->setText(custompopulate.value("cmd_privname").toString()); _name->setText(custompopulate.value("cmd_name").toString()); _executable->setText(custompopulate.value("cmd_executable").toString()); _description->setText(custompopulate.value("cmd_descrip").toString()); if (!custompopulate.value("editable").toBool()) setMode(cView); sFillList(); } else if (custompopulate.lastError().type() != QSqlError::NoError) { systemError(this, custompopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void customCommand::sFillList() { XSqlQuery customFillList; customFillList.prepare("SELECT cmdarg_id, cmdarg_order, cmdarg_arg" " FROM cmdarg" " WHERE (cmdarg_cmd_id=:cmd_id)" " ORDER BY cmdarg_order, cmdarg_id;"); customFillList.bindValue(":cmd_id", _cmdid); customFillList.exec(); _arguments->populate(customFillList); if (customFillList.lastError().type() != QSqlError::NoError) { systemError(this, customFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/customCommand.h000066400000000000000000000024201217451700100203550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMCOMMAND_H #define CUSTOMCOMMAND_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_customCommand.h" class customCommand : public XDialog, public Ui::customCommand { Q_OBJECT public: customCommand(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~customCommand(); virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); public slots: virtual void reject(); virtual void sSave(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); protected: int _cmdid; int _mode; QString _oldPrivname; bool _saved; bool save(); protected slots: virtual void languageChange(); virtual void setMode(const int); }; #endif // CUSTOMCOMMAND_H qt-client-4.1.0/guiclient/customCommand.ui000066400000000000000000000341061217451700100205510ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customCommand 0 0 447 390 Custom Command Module: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _module 0 0 0 0 0 A/P A/R C/P CRM G/L I/M M/S P/D P/M P/O S/A S/O S/R W/O Sys Qt::Horizontal QSizePolicy::Expanding 40 20 Menu Label: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _title Priv. Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _privname Action Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Executable: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _executable 0 0 0 0 0 5 0 0 0 0 &Cancel &OK Qt::Vertical QSizePolicy::Expanding 20 51 0 Description 5 0 0 0 0 Arguments 5 0 0 0 0 0 0 0 0 0 5 0 0 0 0 New false Edit false Delete Qt::Vertical QSizePolicy::Expanding 20 40 XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    XTextEdit QTextEdit
    xtextedit.h
    _module _title _privname _name _executable _tab _arguments _new _edit _delete _accept _close _description _close clicked() customCommand reject() 20 20 20 20 _arguments valid(bool) _delete setEnabled(bool) 20 20 20 20 _arguments valid(bool) _edit setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/customCommandArgument.cpp000066400000000000000000000064071217451700100224240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customCommandArgument.h" #include #include #include customCommandArgument::customCommandArgument(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_accept, SIGNAL(clicked()), this, SLOT(sSave())); _mode = cNew; _cmdargid = -1; _cmdid = -1; } customCommandArgument::~customCommandArgument() { // no need to delete child widgets, Qt does it all for us } void customCommandArgument::languageChange() { retranslateUi(this); } enum SetResponse customCommandArgument::set( const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cmd_id", &valid); if(valid) _cmdid = param.toInt(); param = pParams.value("cmdarg_id", &valid); if(valid) { _cmdargid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if(valid) { QString mode = param.toString(); if("new" == mode) _mode = cNew; else if("edit" == mode) _mode = cEdit; } return NoError; } void customCommandArgument::sSave() { XSqlQuery customSave; if(_argument->text().trimmed().isEmpty()) { QMessageBox::warning(this, tr("No Argument Specified"), tr("You must specify an argument in order to save.") ); return; } if(cNew == _mode) customSave.prepare("INSERT INTO cmdarg" " (cmdarg_cmd_id, cmdarg_order, cmdarg_arg) " "VALUES(:cmd_id, :order, :argument);"); else if(cEdit == _mode) customSave.prepare("UPDATE cmdarg" " SET cmdarg_order=:order," " cmdarg_arg=:argument" " WHERE (cmdarg_id=:cmdarg_id); "); customSave.bindValue(":cmd_id", _cmdid); customSave.bindValue(":cmdarg_id", _cmdargid); customSave.bindValue(":order", _order->value()); customSave.bindValue(":argument", _argument->text()); if(customSave.exec()) accept(); else if (customSave.lastError().type() != QSqlError::NoError) { systemError(this, customSave.lastError().databaseText(), __FILE__, __LINE__); return; } } void customCommandArgument::populate() { XSqlQuery custompopulate; custompopulate.prepare("SELECT cmdarg_cmd_id, cmdarg_order, cmdarg_arg" " FROM cmdarg" " WHERE (cmdarg_id=:cmdarg_id);"); custompopulate.bindValue(":cmdarg_id", _cmdargid); custompopulate.exec(); if(custompopulate.first()) { _cmdid = custompopulate.value("cmdarg_cmd_id").toInt(); _order->setValue(custompopulate.value("cmdarg_order").toInt()); _argument->setText(custompopulate.value("cmdarg_arg").toString()); } else if (custompopulate.lastError().type() != QSqlError::NoError) { systemError(this, custompopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/customCommandArgument.h000066400000000000000000000022041217451700100220600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMCOMMANDARGUMENT_H #define CUSTOMCOMMANDARGUMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_customCommandArgument.h" class customCommandArgument : public XDialog, public Ui::customCommandArgument { Q_OBJECT public: customCommandArgument(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~customCommandArgument(); virtual SetResponse set( const ParameterList & pParams ); public slots: virtual void sSave(); protected: int _mode; int _cmdid; int _cmdargid; virtual void populate(); protected slots: virtual void languageChange(); private: }; #endif // CUSTOMCOMMANDARGUMENT_H qt-client-4.1.0/guiclient/customCommandArgument.ui000066400000000000000000000134031217451700100222510ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customCommandArgument 0 0 488 89 Custom Command Argument 0 0 0 Order: Qt::AlignVCenter|Qt::AlignRight Argument: Qt::AlignVCenter|Qt::AlignRight 0 0 21 20 Expanding Horizontal 20 40 Expanding Vertical 0 0 0 &Cancel &OK 20 51 Expanding Vertical _order _argument _accept _close parameter.h _close clicked() customCommandArgument reject() qt-client-4.1.0/guiclient/customCommands.cpp000066400000000000000000000061101217451700100210730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customCommands.h" #include #include #include "customCommand.h" #include "guiclient.h" customCommands::customCommands(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); _commands->addColumn(tr("Module"), _itemColumn, Qt::AlignCenter,true, "cmd_module"); _commands->addColumn(tr("Menu Label"), -1, Qt::AlignLeft, true, "cmd_title"); _commands->addColumn(tr("Package"),_itemColumn, Qt::AlignLeft, false,"nspname"); sFillList(); } customCommands::~customCommands() { // no need to delete child widgets, Qt does it all for us } void customCommands::languageChange() { retranslateUi(this); } void customCommands::sNew() { ParameterList params; params.append("mode", "new"); customCommand newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void customCommands::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("cmd_id", _commands->id()); customCommand newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void customCommands::sDelete() { XSqlQuery customDelete; customDelete.prepare("BEGIN; " "DELETE FROM cmdarg WHERE (cmdarg_cmd_id=:cmd_id); " "DELETE FROM cmd WHERE (cmd_id=:cmd_id); " "SELECT updateCustomPrivs(); " "COMMIT; "); customDelete.bindValue(":cmd_id", _commands->id()); if(customDelete.exec()) sFillList(); else if (customDelete.lastError().type() != QSqlError::NoError) { systemError(this, customDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void customCommands::sFillList() { XSqlQuery customFillList; customFillList.exec("SELECT cmd.*," " CASE WHEN nspname='public' THEN ''" " ELSE nspname END AS nspname" " FROM cmd, pg_class, pg_namespace" " WHERE ((cmd.tableoid=pg_class.oid)" " AND (relnamespace=pg_namespace.oid)" " AND (cmd_module IN (" " 'Products','Inventory','Schedule','Purchase', " " 'Manufacture','CRM','Sales','Accounting','System'))) " " ORDER BY cmd_module, cmd_title;"); _commands->populate(customFillList); if (customFillList.lastError().type() != QSqlError::NoError) { systemError(this, customFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/customCommands.h000066400000000000000000000017131217451700100205440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMCOMMANDS_H #define CUSTOMCOMMANDS_H #include "xwidget.h" #include "ui_customCommands.h" class customCommands : public XWidget, public Ui::customCommands { Q_OBJECT public: customCommands(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~customCommands(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); private: }; #endif // CUSTOMCOMMANDS_H qt-client-4.1.0/guiclient/customCommands.ui000066400000000000000000000122771217451700100207410ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customCommands 0 0 461 319 List Custom Commands 0 0 Commands _commands 7 7 0 0 0 5 &Close 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _commands _new _edit _delete _close _close clicked() customCommands close() 20 20 20 20 _commands valid(bool) _edit setEnabled(bool) 20 20 20 20 _commands valid(bool) _delete setEnabled(bool) 20 20 20 20 _commands itemDoubleClicked(QTreeWidgetItem*,int) _edit animateClick() 20 20 20 20
    qt-client-4.1.0/guiclient/customer.cpp000066400000000000000000002004711217451700100177460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customer.h" #include #include #include #include #include #include #include #include "addresscluster.h" #include "characteristicAssignment.h" #include "creditCard.h" #include "crmaccount.h" #include "custCharacteristicDelegate.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "mqlutil.h" #include "shipTo.h" #include "storedProcErrorLookup.h" #include "taxRegistration.h" #include "xcombobox.h" #include "parameterwidget.h" customer::customer(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _number->setShowInactive(true); _todoList = new todoList(this, "todoList", Qt::Widget); _todoListPage->layout()->addWidget(_todoList); _todoList->setCloseVisible(false); _todoList->setParameterWidgetVisible(false); _todoList->setQueryOnStartEnabled(false); _todoList->parameterWidget()->setDefault(tr("User"), QVariant(), true); _todoList->parameterWidget()->append("", "hasContext", ParameterWidget::Exists, true); _todoList->list()->hideColumn("crmacct_number"); _todoList->list()->hideColumn("crmacct_name"); _todoList->_projects->setForgetful(true); _todoList->_projects->setVisible(false); _todoList->_projects->setChecked(false); _contacts = new contacts(this, "contacts", Qt::Widget); _contactsPage->layout()->addWidget(_contacts); _contacts->setCloseVisible(false); _contacts->list()->hideColumn("crmacct_number"); _contacts->list()->hideColumn("crmacct_name"); _contacts->parameterWidget()->append("", "hasContext", ParameterWidget::Exists, true); _contacts->setParameterWidgetVisible(false); _contacts->setQueryOnStartEnabled(false); _quotes = new quotes(this, "quotes", Qt::Widget); _quotesPage->layout()->addWidget(_quotes); _quotes->setCloseVisible(false); _quotes->setParameterWidgetVisible(false); _quotes->setQueryOnStartEnabled(false); if (_metrics->boolean("ShowQuotesAfterSO")) { _quotes->findChild("_convertedtoSo")->show(); _quotes->findChild("_convertedtoSo")->setForgetful(true); _quotes->findChild("_convertedtoSo")->setChecked(false); } _quotes->list()->hideColumn("quhead_billtoname"); _orders = new openSalesOrders(this, "openSalesOrders", Qt::Widget); _ordersPage->layout()->addWidget(_orders); _orders->setCloseVisible(false); _orders->setParameterWidgetVisible(false); _orders->setQueryOnStartEnabled(false); _orders->setAutoUpdateEnabled(false); _orders->optionsWidget()->show(); _orders->list()->hideColumn("cust_number"); _orders->list()->hideColumn("cohead_billtoname"); _returns = new returnAuthorizationWorkbench(this, "returnAuthorizationWorkbench", Qt::Widget); _returnsPage->layout()->addWidget(_returns); _returns->findChild("_close")->hide(); _returns->findChild("_customerSelector")->hide(); _returns->findChild("_ra")->hideColumn("cust_name"); _returns->findChild("_radue")->hideColumn("cust_name"); _aritems = new dspAROpenItems(this, "dspAROpenItems", Qt::Widget); _aritems->setObjectName("dspAROpenItems"); _aritemsPage->layout()->addWidget(_aritems); _aritems->setCloseVisible(false); _aritems->findChild("_customerSelector")->hide(); // _aritems->findChild("_asofGroup")->hide(); _aritems->findChild("_asOf")->setDate(omfgThis->dbDate(), true); _aritems->findChild("_closed")->show(); _aritems->list()->hideColumn("cust_number"); _aritems->list()->hideColumn("cust_name"); _cashreceipts = new dspCashReceipts(this, "dspCashReceipts", Qt::Widget); _cashreceiptsPage->layout()->addWidget(_cashreceipts); _cashreceipts->setCloseVisible(false); _cashreceipts->findChild("_customerSelector")->hide(); _cashreceipts->findChild("_dates")->setStartDate(QDate().currentDate().addDays(-90)); _cashreceipts->list()->hideColumn("cust_number"); _cashreceipts->list()->hideColumn("cust_name"); _cctrans = new dspCreditCardTransactions(this, "dspCreditCardTransactions", Qt::Widget); _cctransPage->layout()->addWidget(_cctrans); _cctrans->findChild("_close")->hide(); _cctrans->findChild("_customerSelector")->hide(); _cctrans->findChild("_preauth")->hideColumn("cust_number"); _cctrans->findChild("_preauth")->hideColumn("cust_name"); connect(_close, SIGNAL(clicked()), this, SLOT(sCancel())); connect(_crmacct, SIGNAL(clicked()), this, SLOT(sCrmAccount())); connect(_save, SIGNAL(clicked()), this, SLOT(sSaveClicked())); connect(_number, SIGNAL(newId(int)), this, SLOT(setId(int))); connect(_number, SIGNAL(editingFinished()), this, SLOT(sNumberEdited())); connect(_number, SIGNAL(editable(bool)), this, SLOT(sNumberEditable(bool))); connect(_salesrep, SIGNAL(newID(int)), this, SLOT(sPopulateCommission())); connect(_newShipto, SIGNAL(clicked()), this, SLOT(sNewShipto())); connect(_editShipto, SIGNAL(clicked()), this, SLOT(sEditShipto())); connect(_viewShipto, SIGNAL(clicked()), this, SLOT(sViewShipto())); connect(_deleteShipto, SIGNAL(clicked()), this, SLOT(sDeleteShipto())); connect(_shipto, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateShiptoMenu(QMenu*))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_printShipto, SIGNAL(clicked()), this, SLOT(sPrintShipto())); connect(_downCC, SIGNAL(clicked()), this, SLOT(sMoveDown())); connect(_upCC, SIGNAL(clicked()), this, SLOT(sMoveUp())); connect(_viewCC, SIGNAL(clicked()), this, SLOT(sViewCreditCard())); connect(_editCC, SIGNAL(clicked()), this, SLOT(sEditCreditCard())); connect(_newCC, SIGNAL(clicked()), this, SLOT(sNewCreditCard())); connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic())); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic())); connect(_deleteTaxreg, SIGNAL(clicked()), this, SLOT(sDeleteTaxreg())); connect(_editTaxreg, SIGNAL(clicked()), this, SLOT(sEditTaxreg())); connect(_newTaxreg, SIGNAL(clicked()), this, SLOT(sNewTaxreg())); connect(_viewTaxreg, SIGNAL(clicked()), this, SLOT(sViewTaxreg())); connect(_custtype, SIGNAL(currentIndexChanged(int)), this, SLOT(sFillCharacteristicList())); connect(_billingButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_correspButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_shiptoButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_generalButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_termsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_taxButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_creditcardsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sCheckRequired())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheckRequired())); connect(_salesrep, SIGNAL(newID(int)), this, SLOT(sCheckRequired())); connect(_terms, SIGNAL(newID(int)), this, SLOT(sCheckRequired())); connect(_custtype, SIGNAL(newID(int)), this, SLOT(sCheckRequired())); connect(_contactsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_todoListButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_notesButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_commentsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_summaryButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_quotesButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_ordersButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_returnsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_aritemsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_cctransButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_cashreceiptsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_tab, SIGNAL(currentChanged(int)), this, SLOT(currentTabChanged(int))); _custid = -1; _crmacctid = -1; _NumberGen = -1; _autoSaved = false; _captive = false; _charfilled = false; _mode = -1; _sellingWarehouse->setId(-1); _currency->setLabel(_currencyLit); _balanceMethod->append(0, tr("Balance Forward"), "B"); _balanceMethod->append(1, tr("Open Items"), "O"); _taxreg->addColumn(tr("Tax Authority"), 100, Qt::AlignLeft, true, "taxauth_code"); _taxreg->addColumn(tr("Registration #"), -1, Qt::AlignLeft, true, "taxreg_number"); _shipto->addColumn(tr("Default"), _itemColumn, Qt::AlignLeft, true, "shipto_default"); _shipto->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft, true, "shipto_num"); _shipto->addColumn(tr("Name"), 150, Qt::AlignLeft, true, "shipto_name"); _shipto->addColumn(tr("Address"), 150, Qt::AlignLeft, true, "addr_line1"); _shipto->addColumn(tr("City, State, Zip"), -1, Qt::AlignLeft, true, "shipto_csz"); _cc->addColumn(tr("Sequence"),_itemColumn, Qt::AlignLeft, true, "ccard_seq"); _cc->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "type"); _cc->addColumn(tr("Number"), 150, Qt::AlignRight,true, "f_number"); _cc->addColumn(tr("Active"), -1, Qt::AlignLeft, true, "ccard_active"); _charass->addColumn(tr("Characteristic"), _itemColumn*2, Qt::AlignLeft, true, "char_name"); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value"); _defaultCommissionPrcnt->setValidator(omfgThis->percentVal()); _defaultDiscountPrcnt->setValidator(omfgThis->negPercentVal()); _custchar = new QStandardItemModel(0, 2, this); _custchar->setHeaderData( 0, Qt::Horizontal, tr("Characteristic"), Qt::DisplayRole); _custchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole); _chartempl->setModel(_custchar); CustCharacteristicDelegate * delegate = new CustCharacteristicDelegate(this); _chartempl->setItemDelegate(delegate); key = omfgThis->_key; if(!_metrics->boolean("CCAccept") || !_privileges->check("ProcessCreditCards")) { _creditcardsButton->hide(); _cctransButton->hide(); } //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _sellingWarehouseLit->hide(); _sellingWarehouse->hide(); } if(!_metrics->boolean("AutoCreditWarnLateCustomers")) _warnLate->hide(); else _graceDays->setValue(_metrics->value("DefaultAutoCreditWarnGraceDays").toInt()); if (!_privileges->check("MaintainQuotes") && !_privileges->check("ViewQuotes")) _quotesButton->setEnabled(false); if (!_privileges->check("MaintainSalesOrders") && !_privileges->check("ViewSalesOrders")) _ordersButton->setEnabled(false); if (!_privileges->check("MaintainReturns") && !_privileges->check("ViewReturns")) _returnsButton->setEnabled(false); if (!_metrics->boolean("EnableReturnAuth")) _returnsButton->hide(); setValid(false); _backlog->setPrecision(omfgThis->moneyVal()); _lastYearSales->setPrecision(omfgThis->moneyVal()); _lateBalance->setPrecision(omfgThis->moneyVal()); _openBalance->setPrecision(omfgThis->moneyVal()); _ytdSales->setPrecision(omfgThis->moneyVal()); _chartempl->setAlternatingRowColors(true); } customer::~customer() { // no need to delete child widgets, Qt does it all for us } void customer::languageChange() { retranslateUi(this); } /* because the customer window is a workbench, which allows switching between customers and changing customer numbers and all that stuff, we can't handle crmaccount creation via set() and populate() the way we do with other crmaccount types. */ enum SetResponse customer::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) { _number->setEditMode(true); setId(param.toInt()); _captive=true; } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _salesrep->setType(XComboBox::SalesRepsActive); sClear(); connect(_shipto, SIGNAL(valid(bool)), _editShipto, SLOT(setEnabled(bool))); connect(_shipto, SIGNAL(valid(bool)), _deleteShipto, SLOT(setEnabled(bool))); connect(_shipto, SIGNAL(itemSelected(int)), _editShipto, SLOT(animateClick())); connect(_cc, SIGNAL(valid(bool)), _editCC, SLOT(setEnabled(bool))); connect(_cc, SIGNAL(itemSelected(int)), _editCC, SLOT(animateClick())); connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); connect(_backorders, SIGNAL(toggled(bool)), _partialShipments, SLOT(setEnabled(bool))); connect(_backorders, SIGNAL(toggled(bool)), _partialShipments, SLOT(setChecked(bool))); emit newMode(_mode); emit newId(_custid); } else if (param.toString() == "edit") { _mode = cEdit; connect(_shipto, SIGNAL(valid(bool)), _editShipto, SLOT(setEnabled(bool))); connect(_shipto, SIGNAL(valid(bool)), _deleteShipto, SLOT(setEnabled(bool))); connect(_shipto, SIGNAL(itemSelected(int)), _editShipto, SLOT(animateClick())); connect(_cc, SIGNAL(valid(bool)), _editCC, SLOT(setEnabled(bool))); connect(_cc, SIGNAL(itemSelected(int)), _editCC, SLOT(animateClick())); connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); connect(_backorders, SIGNAL(toggled(bool)), _partialShipments, SLOT(setEnabled(bool))); connect(_backorders, SIGNAL(toggled(bool)), _partialShipments, SLOT(setChecked(bool))); emit newMode(_mode); } else if (param.toString() == "view") { _mode = cView; _number->setCanEdit(FALSE); _name->setEnabled(FALSE); _custtype->setEnabled(FALSE); _active->setEnabled(FALSE); _corrCntct->setEnabled(FALSE); _billCntct->setEnabled(FALSE); _terms->setEnabled(FALSE); _balanceMethod->setEnabled(FALSE); _defaultDiscountPrcnt->setEnabled(FALSE); _creditLimit->setEnabled(FALSE); _creditRating->setEnabled(FALSE); _creditStatusGroup->setEnabled(FALSE); _autoUpdateStatus->setEnabled(FALSE); _autoHoldOrders->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _sellingWarehouse->setEnabled(FALSE); _salesrep->setEnabled(FALSE); _defaultCommissionPrcnt->setEnabled(FALSE); _shipvia->setEnabled(FALSE); _shipform->setEnabled(FALSE); _shipchrg->setEnabled(FALSE); _backorders->setEnabled(FALSE); _usesPOs->setEnabled(FALSE); _blanketPos->setEnabled(FALSE); _allowFFShipto->setEnabled(FALSE); _allowFFBillto->setEnabled(FALSE); _notes->setReadOnly(TRUE); _comments->setReadOnly(TRUE); _newShipto->setEnabled(FALSE); _newCharacteristic->setEnabled(FALSE); _newTaxreg->setEnabled(FALSE); _currency->setEnabled(FALSE); _partialShipments->setEnabled(FALSE); _save->hide(); _newCC->setEnabled(false); _editCC->setEnabled(false); _upCC->setEnabled(false); _downCC->setEnabled(false); _warnLate->setEnabled(false); _charass->setEnabled(false); _chartempl->setEnabled(false); connect(_shipto, SIGNAL(itemSelected(int)), _viewShipto, SLOT(animateClick())); connect(_cc, SIGNAL(itemSelected(int)), _viewCC, SLOT(animateClick())); disconnect(_taxreg, SIGNAL(valid(bool)), _deleteTaxreg, SLOT(setEnabled(bool))); disconnect(_taxreg, SIGNAL(valid(bool)), _editTaxreg, SLOT(setEnabled(bool))); disconnect(_taxreg, SIGNAL(itemSelected(int)), _editTaxreg, SLOT(animateClick())); connect(_taxreg, SIGNAL(itemSelected(int)), _viewTaxreg, SLOT(animateClick())); ParameterList params; params.append("mode", "view"); _contacts->set(params); emit newMode(_mode); } } param = pParams.value("crmacct_id", &valid); if (valid) { _number->setEditMode(true); sLoadCrmAcct(param.toInt()); _captive=true; } return NoError; } int customer::id() const { return _custid; } /** \return one of cNew, cEdit, cView, ... \todo change possible modes to an enum in guiclient.h (and add cUnknown?) */ int customer::mode() const { return _mode; } void customer::setValid(bool valid) { _print->setEnabled(valid); _shiptoPage->setEnabled(valid); _taxPage->setEnabled(valid); _creditcardsPage->setEnabled(valid); _comments->setEnabled(valid); _tab->setTabEnabled(_tab->indexOf(_documentsTab),valid); _tab->setTabEnabled(_tab->indexOf(_crmTab),valid); _tab->setTabEnabled(_tab->indexOf(_salesTab),valid); _tab->setTabEnabled(_tab->indexOf(_accountingTab),valid); if (!_privileges->check("MaintainAllContacts") && !_privileges->check("ViewAllContacts") && !_privileges->check("MaintainPersonalContacts") && !_privileges->check("ViewPersonalContacts")) { _contactsButton->setEnabled(false); _todoListButton->setChecked(true); sHandleButtons(); } if (!_privileges->check("MaintainAllToDoItems") && !_privileges->check("ViewAllToDoItems") && !_privileges->check("MaintainPersonalToDoItems") && !_privileges->check("ViewPersonalToDoItems")) { _todoListButton->setEnabled(false); if (_todoListButton->isChecked()) _tab->setTabEnabled(_tab->indexOf(_crmTab),false); } if (!_privileges->check("EditAROpenItems") && !_privileges->check("ViewAROpenItems")) { if (_cctransButton->isHidden()) _tab->setTabEnabled(_tab->indexOf(_accountingTab),false); else { _aritemsButton->setEnabled(false); _cashreceiptsButton->setEnabled(false); _cctransButton->setChecked(true); sHandleButtons(); } } if (!valid) { _documents->setId(-1); _todoList->list()->clear(); _contacts->list()->clear(); _quotes->list()->clear(); _orders->list()->clear(); _returns->findChild("_ra")->clear(); _returns->findChild("_radue")->clear(); _aritems->list()->clear(); _cashreceipts->list()->clear(); _cctrans->findChild("_preauth")->clear(); } } bool customer::sSave() { XSqlQuery customerSave; QList errors; errors << GuiErrorCheck(_number->number().trimmed().isEmpty(), _number, tr("You must enter a number for this Customer " "before continuing")) << GuiErrorCheck(_name->text().trimmed().isEmpty(), _name, tr("You must enter a name for this Customer " "before continuing")) << GuiErrorCheck(_custtype->id() == -1, _custtype, tr("You must select a Customer Type code for this " "Customer before continuing.")) << GuiErrorCheck(_terms->id() == -1, _terms, tr("You must select a Terms code for this " "Customer before continuing.")) << GuiErrorCheck(_salesrep->id() == -1, _salesrep, tr("You must select a Sales Rep. for this " "Customer before continuing.")) ; if (_number->number().trimmed() != _cachedNumber) { XSqlQuery dupq; dupq.prepare("SELECT cust_name " "FROM custinfo " "WHERE (UPPER(cust_number)=UPPER(:cust_number)) " " AND (cust_id<>:cust_id);" ); dupq.bindValue(":cust_name", _number->number().trimmed()); dupq.bindValue(":cust_id", _custid); dupq.exec(); if (dupq.first()) errors << GuiErrorCheck(true, _number, tr("

    The newly entered Customer Number cannot " "be used as it is currently in use by the " "Customer '%1'. Please correct or enter a " "new Customer Number." ) .arg(dupq.value("cust_name").toString()) ); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Customer"), errors)) return false; if (_mode == cEdit) { customerSave.prepare( "UPDATE custinfo SET " " cust_number=:cust_number, cust_name=:cust_name," " cust_salesrep_id=:cust_salesrep_id," " cust_corrcntct_id=:cust_corrcntct_id, cust_cntct_id=:cust_cntct_id," " cust_custtype_id=:cust_custtype_id, cust_balmethod=:cust_balmethod," " cust_creditlmt=:cust_creditlmt, cust_creditlmt_curr_id=:cust_creditlmt_curr_id," " cust_creditrating=:cust_creditrating," " cust_autoupdatestatus=:cust_autoupdatestatus, cust_autoholdorders=:cust_autoholdorders," " cust_creditstatus=:cust_creditstatus," " cust_backorder=:cust_backorder, cust_ffshipto=:cust_ffshipto, cust_ffbillto=:cust_ffbillto," " cust_commprcnt=:cust_commprcnt," " cust_partialship=:cust_partialship, cust_shipvia=:cust_shipvia," " cust_shipchrg_id=:cust_shipchrg_id, cust_shipform_id=:cust_shipform_id," " cust_terms_id=:cust_terms_id," " cust_discntprcnt=:cust_discntprcnt," " cust_taxzone_id=:cust_taxzone_id, " " cust_active=:cust_active, cust_usespos=:cust_usespos," " cust_blanketpos=:cust_blanketpos, cust_comments=:cust_comments," " cust_preferred_warehous_id=:cust_preferred_warehous_id, " " cust_gracedays=:cust_gracedays," " cust_curr_id=:cust_curr_id " "WHERE (cust_id=:cust_id);" ); } else customerSave.prepare( "INSERT INTO custinfo " "( cust_id, cust_number," " cust_salesrep_id, cust_name," " cust_corrcntct_id, cust_cntct_id," " cust_custtype_id, cust_balmethod," " cust_creditlmt, cust_creditlmt_curr_id," " cust_creditrating, cust_creditstatus," " cust_autoupdatestatus, cust_autoholdorders," " cust_backorder, cust_ffshipto, cust_ffbillto," " cust_commprcnt, cust_partialship," " cust_shipvia," " cust_shipchrg_id, cust_shipform_id, cust_terms_id," " cust_discntprcnt, cust_taxzone_id, " " cust_active, cust_usespos, cust_blanketpos, cust_comments," " cust_preferred_warehous_id, " " cust_gracedays, cust_curr_id ) " "VALUES " "( :cust_id, :cust_number," " :cust_salesrep_id, :cust_name," " :cust_corrcntct_id, :cust_cntct_id," " :cust_custtype_id, :cust_balmethod," " :cust_creditlmt, :cust_creditlmt_curr_id," " :cust_creditrating, :cust_creditstatus," " :cust_autoupdatestatus, :cust_autoholdorders," " :cust_backorder, :cust_ffshipto, :cust_ffbillto," " :cust_commprcnt, :cust_partialship," " :cust_shipvia," " :cust_shipchrg_id, :cust_shipform_id, :cust_terms_id," " :cust_discntprcnt, :cust_taxzone_id," " :cust_active, :cust_usespos, :cust_blanketpos, :cust_comments," " :cust_preferred_warehous_id, " " :cust_gracedays, :cust_curr_id ) " ); customerSave.bindValue(":cust_id", _custid); customerSave.bindValue(":cust_number", _number->number().trimmed()); customerSave.bindValue(":cust_name", _name->text().trimmed()); customerSave.bindValue(":cust_salesrep_id", _salesrep->id()); if (_corrCntct->id() > 0) customerSave.bindValue(":cust_corrcntct_id", _corrCntct->id()); // else NULL if (_billCntct->id() > 0) customerSave.bindValue(":cust_cntct_id", _billCntct->id()); // else NULL customerSave.bindValue(":cust_custtype_id", _custtype->id()); customerSave.bindValue(":cust_balmethod", _balanceMethod->code()); if (_inGoodStanding->isChecked()) customerSave.bindValue(":cust_creditstatus", "G"); else if (_onCreditWarning->isChecked()) customerSave.bindValue(":cust_creditstatus", "W"); else if (_onCreditHold->isChecked()) customerSave.bindValue(":cust_creditstatus", "H"); else customerSave.bindValue(":cust_creditstatus", "U"); customerSave.bindValue(":cust_creditlmt_curr_id", _creditLimit->id()); customerSave.bindValue(":cust_creditlmt", _creditLimit->localValue()); customerSave.bindValue(":cust_creditrating", _creditRating->text()); customerSave.bindValue(":cust_autoupdatestatus", QVariant(_autoUpdateStatus->isChecked())); customerSave.bindValue(":cust_autoholdorders", QVariant(_autoHoldOrders->isChecked())); customerSave.bindValue(":cust_commprcnt", (_defaultCommissionPrcnt->toDouble() / 100.0)); customerSave.bindValue(":cust_terms_id", _terms->id()); customerSave.bindValue(":cust_discntprcnt", (_defaultDiscountPrcnt->toDouble() / 100.0)); if (_taxzone->isValid()) customerSave.bindValue(":cust_taxzone_id", _taxzone->id()); customerSave.bindValue(":cust_shipvia", _shipvia->currentText()); customerSave.bindValue(":cust_shipchrg_id", _shipchrg->id()); if(_shipform->id() > 0) customerSave.bindValue(":cust_shipform_id", _shipform->id()); customerSave.bindValue(":cust_active", QVariant(_active->isChecked())); customerSave.bindValue(":cust_usespos", QVariant(_usesPOs->isChecked())); customerSave.bindValue(":cust_blanketpos", QVariant(_blanketPos->isChecked())); customerSave.bindValue(":cust_partialship",QVariant(_partialShipments->isChecked())); customerSave.bindValue(":cust_backorder", QVariant(_backorders->isChecked())); customerSave.bindValue(":cust_ffshipto", QVariant(_allowFFShipto->isChecked())); customerSave.bindValue(":cust_ffbillto", QVariant(_allowFFBillto->isChecked())); customerSave.bindValue(":cust_comments", _notes->toPlainText()); customerSave.bindValue(":cust_preferred_warehous_id", _sellingWarehouse->id()); customerSave.bindValue(":cust_curr_id", _currency->id()); if(_warnLate->isChecked()) customerSave.bindValue(":cust_gracedays", _graceDays->value()); customerSave.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving"), customerSave, __FILE__, __LINE__)) return false; if (_mode == cNew) { _mode = cEdit; emit newMode(_mode); emit newId(_custid); // custcluster listeners couldn't handle set()'s emit } //Save characteristics if (_widgetStack->currentIndex() == 1) { customerSave.prepare("SELECT updateCharAssignment('C', :target_id, :char_id, :char_value);"); QModelIndex idx1, idx2; for(int i = 0; i < _custchar->rowCount(); i++) { idx1 = _custchar->index(i, 0); idx2 = _custchar->index(i, 1); customerSave.bindValue(":target_id", _custid); customerSave.bindValue(":char_id", _custchar->data(idx1, Qt::UserRole)); customerSave.bindValue(":char_value", _custchar->data(idx2, Qt::DisplayRole)); customerSave.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Saving Characteristic"), customerSave, __FILE__, __LINE__); } } setValid(true); populate(); omfgThis->sCustomersUpdated(_custid, TRUE); _autoSaved = true; return true; } void customer::sSaveClicked() { _save->setFocus(); if (!sSave()) return; _autoSaved=false; _NumberGen = -1; omfgThis->sCustomersUpdated(_custid, TRUE); emit saved(_custid); if (_captive || isModal()) close(); else sClear(); } void customer::sCheck() { XSqlQuery customerCheck; _number->setNumber(_number->number().trimmed().toUpper()); if (_cachedNumber == _number->number()) return; if(cNew == _mode && -1 != _NumberGen && _number->number().toInt() != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } customerCheck.prepare( "SELECT cust_id, 1 AS type " "FROM custinfo " "WHERE (cust_number=:cust_number) " "UNION " "SELECT prospect_id, 2 AS type " "FROM prospect " "WHERE (prospect_number=:cust_number) " "UNION " "SELECT crmacct_id, 3 AS type " "FROM crmacct " "WHERE (crmacct_number=:cust_number) " "ORDER BY type; "); customerCheck.bindValue(":cust_number", _number->number()); customerCheck.exec(); if (customerCheck.first()) { if ((customerCheck.value("type").toInt() == 1) && (_notice)) { if (QMessageBox::question(this, tr("Customer Exists"), tr("

    This number is currently used by an existing Customer. " "Do you want to edit that Customer?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { _number->setNumber(_cachedNumber); _number->setFocus(); return; } _number->setId(customerCheck.value("cust_id").toInt()); _mode = cEdit; _name->setFocus(); emit newMode(_mode); } else if ( (_mode == cEdit) && ((customerCheck.value("type").toInt() == 2) || (customerCheck.value("type").toInt() == 3)) && (_notice)) { if (QMessageBox::critical(this, tr("Invalid Number"), tr("

    This number is currently " "assigned to another CRM account."))) { _number->setNumber(_cachedNumber); _number->setFocus(); _notice = false; return; } } else if ((customerCheck.value("type").toInt() == 2) && (_notice)) { int quotecount = 0; if (_privileges->check("ConvertQuotes")) { XSqlQuery quoteq; quoteq.prepare("SELECT COUNT(*) AS quotecount" " FROM quhead" " WHERE (quhead_cust_id=:id);"); quoteq.bindValue(":id", customerCheck.value("cust_id")); quoteq.exec(); if (quoteq.first()) quotecount = quoteq.value("quotecount").toInt(); // ignore errors } if (QMessageBox::question(this, tr("Convert"), tr("

    This number is currently assigned to " "a Prospect. Do you want to convert the " "Prospect to a Customer?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { _number->setId(-1); _number->setFocus(); return; } bool convertquotes = quotecount != 0 && (QMessageBox::question(this, tr("Convert"), tr("

    Do you want to convert all of the " "Quotes for the Prospect to " "Sales Orders?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes); XSqlQuery convertq; convertq.prepare("SELECT convertProspectToCustomer(:id, :convertquotes) AS result;"); convertq.bindValue(":id", customerCheck.value("cust_id")); convertq.bindValue(":convertquotes", convertquotes); convertq.exec(); if (convertq.first()) { int result = convertq.value("result").toInt(); _name->setFocus(); setId(result); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Convert Error"), convertq, __FILE__, __LINE__)) return; } // number in use by prospect else if ((customerCheck.value("type").toInt() == 3) && (_notice)) { if (QMessageBox::question(this, tr("Convert"), tr("

    This number is currently assigned to CRM Account. " "Do you want to convert the CRM Account to a Customer?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { _number->setId(-1); _number->setFocus(); return; } sLoadCrmAcct(customerCheck.value("cust_id").toInt()); } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Number"), customerCheck, __FILE__, __LINE__)) return; } bool customer::sCheckRequired() { if ( ( _number->number().trimmed().length() == 0) || (_name->text().trimmed().length() == 0) || (_custtype->id() == -1) || (_terms->id() == -1) || (_salesrep->id() == -1) || (_custid == -1) ) { setValid(false); return false; } setValid(true); return true; } void customer::sCrmAccount() { ParameterList params; params.append("crmacct_id", _crmacctid); if ((cView == _mode && _privileges->check("ViewAllCRMAccounts")) || (cView == _mode && _privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner) || (cEdit == _mode && _privileges->check("ViewAllCRMAccounts") && ! _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("ViewPersonalCRMAccounts") && ! _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else if ((cEdit == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if ((cNew == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cNew == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else { qWarning("tried to open CRM Account window without privilege"); return; } crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void customer::sPrintShipto() { ParameterList params; params.append("cust_id", _custid); orReport report("ShipToMasterList", params); if (report.isValid()) report.print(); else report.reportError(this); } void customer::sNewShipto() { if (_mode == cNew) { if (!sSave()) return; } ParameterList params; params.append("mode", "new"); params.append("cust_id", _custid); shipTo newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillShiptoList(); } void customer::sEditShipto() { ParameterList params; params.append("mode", "edit"); params.append("shipto_id", _shipto->id()); shipTo newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillShiptoList(); } void customer::sViewShipto() { ParameterList params; params.append("mode", "view"); params.append("shipto_id", _shipto->id()); shipTo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void customer::sDeleteShipto() { if (QMessageBox::question(this, tr("Delete Ship To?"), tr("Are you sure that you want to delete this Ship To?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("SELECT deleteShipTo(:shipto_id) AS result;"); delq.bindValue(":shipto_id", _shipto->id()); delq.exec(); if (delq.first()) { int result = delq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteShipTo", result), __FILE__, __LINE__); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Ship To"), delq, __FILE__, __LINE__)) return; sFillShiptoList(); } void customer::sNewCharacteristic() { if (_mode == cNew) { if (!sSave()) return; } ParameterList params; params.append("mode", "new"); params.append("cust_id", _custid); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharacteristicList(); } void customer::sEditCharacteristic() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharacteristicList(); } void customer::sDeleteCharacteristic() { XSqlQuery delq; delq.prepare( "DELETE FROM charass WHERE (charass_id=:charass_id);" ); delq.bindValue(":charass_id", _charass->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Characteristic"), delq, __FILE__, __LINE__)) return; sFillCharacteristicList(); } void customer::sFillCharacteristicList() { XSqlQuery customerFillCharacteristicList; customerFillCharacteristicList.prepare( "SELECT custtype_char " "FROM custtype " "WHERE (custtype_id=:custtype_id);"); customerFillCharacteristicList.bindValue(":custtype_id",_custtype->id()); customerFillCharacteristicList.exec(); customerFillCharacteristicList.first(); if (customerFillCharacteristicList.value("custtype_char").toBool()) { if (_charfilled) return; _widgetStack->setCurrentIndex(1); _custchar->removeRows(0, _custchar->rowCount()); customerFillCharacteristicList.prepare( "SELECT char_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " " END AS f_charass_value, " "charass_value " "FROM ( " "SELECT DISTINCT char_id, char_name, char_type, char_order, " " COALESCE(b.charass_value, (SELECT c.charass_value FROM charass c WHERE ((c.charass_target_type='CT') AND (c.charass_target_id=:custtype_id) AND (c.charass_default) AND (c.charass_char_id=char_id)) LIMIT 1)) AS charass_value" " FROM charass a, char " " LEFT OUTER JOIN charass b" " ON (b.charass_target_type='C'" " AND b.charass_target_id=:cust_id" " AND b.charass_char_id=char_id) " " WHERE ( (a.charass_char_id=char_id)" " AND (a.charass_target_type='CT')" " AND (a.charass_target_id=:custtype_id) ) " " ORDER BY char_order, char_name) data;" ); customerFillCharacteristicList.bindValue(":custtype_id", _custtype->id()); customerFillCharacteristicList.bindValue(":cust_id", _custid); customerFillCharacteristicList.exec(); int row = 0; QModelIndex idx; while(customerFillCharacteristicList.next()) { _custchar->insertRow(_custchar->rowCount()); idx = _custchar->index(row, 0); _custchar->setData(idx, customerFillCharacteristicList.value("char_name"), Qt::DisplayRole); _custchar->setData(idx, customerFillCharacteristicList.value("char_id"), Qt::UserRole); idx = _custchar->index(row, 1); _custchar->setData(idx, customerFillCharacteristicList.value("f_charass_value"), Qt::DisplayRole); _custchar->setData(idx, customerFillCharacteristicList.value("charass_value"), Qt::UserRole); _custchar->setData(idx, _custtype->id(), Xt::IdRole); row++; } _charfilled=true; } else { _widgetStack->setCurrentIndex(0); XSqlQuery r; r.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value " "FROM charass, char " "WHERE ( (charass_target_type='C')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:cust_id) ) " "ORDER BY char_order, char_name;" ); r.bindValue(":custtype_id", _custtype->id()); r.bindValue(":cust_id", _custid); r.exec(); _charass->populate(r); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Characteristics"), r, __FILE__, __LINE__)) return; _charfilled=false; } } void customer::sPopulateShiptoMenu(QMenu *menuThis) { menuThis->addAction(tr("Edit..."), this, SLOT(sEditShipto())); menuThis->addAction(tr("View..."), this, SLOT(sViewShipto())); menuThis->addAction(tr("Delete..."), this, SLOT(sDeleteShipto())); } void customer::sFillShiptoList() { XSqlQuery r; r.prepare( "SELECT shipto_id, shipto_default," " shipto_num, shipto_name, addr_line1," " (addr_city || ', ' || addr_state || ' ' || addr_postalcode) AS shipto_csz " " FROM shiptoinfo LEFT OUTER JOIN addr ON shipto_addr_id=addr_id" " WHERE (shipto_cust_id=:cust_id) " "ORDER BY shipto_num;" ); r.bindValue(":cust_id", _custid); r.exec(); _shipto->populate(r); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Ship Tos"), r, __FILE__, __LINE__)) return; } void customer::sNewTaxreg() { if (_mode == cNew) { if (!sSave()) return; } ParameterList params; params.append("mode", "new"); params.append("taxreg_rel_id", _custid); params.append("taxreg_rel_type", "C"); taxRegistration newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() != XDialog::Rejected) sFillTaxregList(); } void customer::sEditTaxreg() { ParameterList params; params.append("mode", "edit"); params.append("taxreg_id", _taxreg->id()); taxRegistration newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.set(params) == NoError && newdlg.exec() != XDialog::Rejected) sFillTaxregList(); } void customer::sViewTaxreg() { ParameterList params; params.append("mode", "view"); params.append("taxreg_id", _taxreg->id()); taxRegistration newdlg(this, "", TRUE); if (newdlg.set(params) == NoError) newdlg.exec(); } void customer::sDeleteTaxreg() { XSqlQuery delq; delq.prepare("DELETE FROM taxreg WHERE (taxreg_id=:taxreg_id);"); delq.bindValue(":taxreg_id", _taxreg->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Tax Registrations"), delq, __FILE__, __LINE__)) return; sFillTaxregList(); } void customer::sFillTaxregList() { XSqlQuery taxreg; taxreg.prepare("SELECT taxreg_id, taxreg_taxauth_id, " " taxauth_code, taxreg_number " "FROM taxreg, taxauth " "WHERE ((taxreg_rel_type='C') " " AND (taxreg_rel_id=:cust_id) " " AND (taxreg_taxauth_id=taxauth_id));"); taxreg.bindValue(":cust_id", _custid); taxreg.exec(); _taxreg->populate(taxreg, true); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Tax Registrations"), taxreg, __FILE__, __LINE__)) return; } void customer::sPopulateCommission() { if (_mode != cView) { XSqlQuery s; s.prepare( "SELECT salesrep_commission " "FROM salesrep " "WHERE (salesrep_id=:salesrep_id);" ); s.bindValue(":salesrep_id", _salesrep->id()); s.exec(); if (s.first()) _defaultCommissionPrcnt->setDouble(s.value("salesrep_commission").toDouble() * 100); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Commission"), s, __FILE__, __LINE__)) return; } } void customer::populate() { XSqlQuery cust; _notice = FALSE; cust.prepare( "SELECT custinfo.*, " " cust_commprcnt, cust_discntprcnt," " (cust_gracedays IS NOT NULL) AS hasGraceDays," " crmacct_id, crmacct_owner_username " "FROM custinfo LEFT OUTER JOIN " " crmacct ON (cust_id=crmacct_cust_id) " "WHERE (cust_id=:cust_id);" ); cust.bindValue(":cust_id", _custid); cust.exec(); if (cust.first()) { if (_mode == cNew) { _mode = cEdit; emit newMode(_mode); } setValid(true); _crmacctid = cust.value("crmacct_id").toInt(); _crmowner = cust.value("crmacct_owner_username").toString(); _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); _number->setNumber(cust.value("cust_number").toString()); _cachedNumber = cust.value("cust_number").toString(); _name->setText(cust.value("cust_name")); _corrCntct->setId(cust.value("cust_corrcntct_id").toInt()); _corrCntct->setSearchAcct(cust.value("crmacct_id").toInt()); _billCntct->setId(cust.value("cust_cntct_id").toInt()); _billCntct->setSearchAcct(cust.value("crmacct_id").toInt()); _creditLimit->set(cust.value("cust_creditlmt").toDouble(), cust.value("cust_creditlmt_curr_id").toInt(), QDate::currentDate(), false); _creditRating->setText(cust.value("cust_creditrating")); _autoUpdateStatus->setChecked(cust.value("cust_autoupdatestatus").toBool()); _autoHoldOrders->setChecked(cust.value("cust_autoholdorders").toBool()); _defaultDiscountPrcnt->setDouble(cust.value("cust_discntprcnt").toDouble() * 100); if(cust.value("hasGraceDays").toBool()) { _warnLate->setChecked(true); _graceDays->setValue(cust.value("cust_gracedays").toInt()); } else { _warnLate->setChecked(false); _graceDays->setValue(_metrics->value("DefaultAutoCreditWarnGraceDays").toInt()); } _notes->setText(cust.value("cust_comments").toString()); _custtype->setId(cust.value("cust_custtype_id").toInt()); if((!_privileges->check("MaintainCustomerMastersCustomerType")) && (_custtype->id() != -1)) _custtype->setEnabled(false); _salesrep->setId(cust.value("cust_salesrep_id").toInt()); _defaultCommissionPrcnt->setDouble(cust.value("cust_commprcnt").toDouble() * 100); _terms->setId(cust.value("cust_terms_id").toInt()); _taxzone->setId(cust.value("cust_taxzone_id").toInt()); _shipform->setId(cust.value("cust_shipform_id").toInt()); _shipchrg->setId(cust.value("cust_shipchrg_id").toInt()); _shipvia->setText(cust.value("cust_shipvia").toString()); _sellingWarehouse->setId(cust.value("cust_preferred_warehous_id").toInt()); _balanceMethod->setCode(cust.value("cust_balmethod").toString()); _active->setChecked(cust.value("cust_active").toBool()); _backorders->setChecked(cust.value("cust_backorder").toBool()); _partialShipments->setChecked(cust.value("cust_partialship").toBool()); _partialShipments->setEnabled(cust.value("cust_backorder").toBool()); _allowFFShipto->setChecked(cust.value("cust_ffshipto").toBool()); _allowFFBillto->setChecked(cust.value("cust_ffbillto").toBool()); _usesPOs->setChecked(cust.value("cust_usespos").toBool()); _blanketPos->setEnabled(cView != _mode && _usesPOs->isChecked()); _blanketPos->setChecked(cust.value("cust_blanketpos").toBool()); _currency->setId(cust.value("cust_curr_id").toInt()); if (cust.value("cust_creditstatus").toString() == "G") _inGoodStanding->setChecked(TRUE); else if (cust.value("cust_creditstatus").toString() == "W") _onCreditWarning->setChecked(TRUE); else _onCreditHold->setChecked(TRUE); _comments->setId(_crmacctid); _documents->setId(_crmacctid); _todoList->parameterWidget()->setDefault(tr("CRM Account"), _crmacctid, true); _contacts->setCrmacctid(_crmacctid); _quotes->parameterWidget()->setDefault(tr("Customer"), _custid, true); _orders->setCustId(_custid); _returns->findChild("_customerSelector")->setCustId(_custid); _aritems->findChild("_customerSelector")->setCustId(_custid); _cashreceipts->findChild("_customerSelector")->setCustId(_custid); _cctrans->findChild("_customerSelector")->setCustId(_custid); sFillList(); emit populated(); _autoSaved=false; return; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Customer"), cust, __FILE__, __LINE__)) return; sClear(); } void customer::sPopulateSummary() { XSqlQuery query; query.prepare( "SELECT MIN(cohist_invcdate) AS firstdate," " MAX(cohist_invcdate) AS lastdate " "FROM cohist " "WHERE (cohist_cust_id=:cust_id) " "AND (cohist_doctype='I');" ); query.bindValue(":cust_id", _custid); query.exec(); if (query.first()) { _firstSaleDate->setDate(query.value("firstdate").toDate()); _lastSaleDate->setDate(query.value("lastdate").toDate()); } // exclude some credit card charges so they don't cancel the actual sales figures query.prepare( "SELECT COALESCE(SUM(round(cohist_qtyshipped * cohist_unitprice,2)), 0) AS lysales " "FROM cohist " "WHERE ( (cohist_invcdate BETWEEN (DATE_TRUNC('year', CURRENT_TIMESTAMP) - INTERVAL '1 year') AND" " (DATE_TRUNC('year', CURRENT_TIMESTAMP) - INTERVAL '1 day'))" " AND (cohist_cohead_ccpay_id IS NULL)" " AND (cohist_cust_id=:cust_id) );" ); query.bindValue(":cust_id", _custid); query.exec(); if (query.first()) _lastYearSales->setDouble(query.value("lysales").toDouble()); query.prepare( "SELECT COALESCE(SUM(round(cohist_qtyshipped * cohist_unitprice,2)), 0) AS ytdsales " "FROM cohist " "WHERE ( (cohist_invcdate>=DATE_TRUNC('year', CURRENT_TIMESTAMP))" " AND (cohist_cohead_ccpay_id IS NULL)" " AND (cohist_cust_id=:cust_id) );" ); query.bindValue(":cust_id", _custid); query.exec(); if (query.first()) _ytdSales->setDouble(query.value("ytdsales").toDouble()); query.prepare( "SELECT COALESCE( SUM( (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) *" " (coitem_price / coitem_price_invuomratio) ), 0 ) AS backlog " "FROM cohead, coitem, itemsite, item " "WHERE ( (coitem_cohead_id=cohead_id)" " AND (coitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (coitem_status='O')" " AND (cohead_cust_id=:cust_id) );" ); query.bindValue(":cust_id", _custid); query.exec(); if (query.first()) _backlog->setDouble(query.value("backlog").toDouble()); query.prepare( "SELECT COALESCE( SUM( CASE WHEN (aropen_doctype IN ('I', 'D')) THEN (aropen_amount - aropen_paid)" " ELSE ((aropen_amount - aropen_paid) * -1)" " END ), 0 ) AS balance " "FROM aropen " "WHERE ( (aropen_open)" " AND (aropen_cust_id=:cust_id) );" ); query.bindValue(":cust_id", _custid); query.exec(); if (query.first()) _openBalance->setDouble(query.value("balance").toDouble()); query.prepare( "SELECT noNeg( COALESCE( SUM( CASE WHEN (aropen_doctype IN ('I', 'D')) THEN (aropen_amount - aropen_paid)" " ELSE ((aropen_amount - aropen_paid) * -1)" " END ), 0 ) ) AS balance " "FROM aropen " "WHERE ( (aropen_open)" " AND (aropen_duedate < CURRENT_DATE)" " AND (aropen_cust_id=:cust_id) );" ); query.bindValue(":cust_id", _custid); query.exec(); if (query.first()) _lateBalance->setDouble(query.value("balance").toDouble()); } void customer::sPrint() { ParameterList params; params.append("cust_id", _custid); orReport report("CustomerInformation", params); if (report.isValid()) report.print(); else report.reportError(this); } void customer::sNewCreditCard() { if (_mode == cNew) { if (!sSave()) return; } ParameterList params; params.append("mode", "new"); params.append("cust_id", _custid); creditCard newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCcardList(); } void customer::sEditCreditCard() { ParameterList params; params.append("mode", "edit"); params.append("cust_id", _custid); params.append("ccard_id", _cc->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCcardList(); } void customer::sViewCreditCard() { ParameterList params; params.append("mode", "view"); params.append("cust_id", _custid); params.append("ccard_id", _cc->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void customer::sMoveUp() { XSqlQuery m; m.prepare("SELECT moveCcardUp(:ccard_id) AS result;"); m.bindValue(":ccard_id", _cc->id()); m.exec(); sFillCcardList(); } void customer::sMoveDown() { XSqlQuery m; m.prepare("SELECT moveCcardDown(:ccard_id) AS result;"); m.bindValue(":ccard_id", _cc->id()); m.exec(); sFillCcardList(); } void customer::sFillList() { if (_tab->currentIndex() == _tab->indexOf(_addressTab)) { if (_shiptoButton->isChecked()) sFillShiptoList(); } else if (_tab->currentIndex() == _tab->indexOf(_settingsTab)) { if (_taxButton->isChecked()) sFillTaxregList(); else if (_creditcardsButton->isChecked()) sFillCcardList(); } else if (_tab->currentIndex() == _tab->indexOf(_characteristicsTab)) sFillCharacteristicList(); else if (_tab->currentIndex() == _tab->indexOf(_crmTab)) { if (_contactsButton->isChecked()) _contacts->sFillList(); else if (_todoListButton->isChecked()) _todoList->sFillList(); } else if (_tab->currentIndex() == _tab->indexOf(_salesTab)) { if (_summaryButton->isChecked()) sPopulateSummary(); else if (_quotesButton->isChecked()) _quotes->sFillList(); else if (_ordersButton->isChecked()) _orders->sFillList(); else if (_returnsButton->isChecked()) _returns->sFillLists(); } else if (_tab->currentIndex() == _tab->indexOf(_accountingTab)) { if (_aritemsButton->isChecked()) _aritems->sFillList(); else if (_cashreceiptsButton->isChecked()) _cashreceipts->sFillList(); else if (_cctransButton->isChecked()) _cctrans->sFillList(); } } void customer::sFillCcardList() { key = omfgThis->_key; XSqlQuery r; r.prepare( "SELECT expireCreditCard(:cust_id, setbytea(:key));"); r.bindValue(":cust_id", _custid); r.bindValue(":key", key); r.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Expiring Credit Card"), r, __FILE__, __LINE__)) return; MetaSQLQuery mql = mqlLoad("creditCards", "detail"); ParameterList params; params.append("cust_id", _custid); params.append("masterCard", tr("MasterCard")); params.append("visa", tr("VISA")); params.append("americanExpress", tr("American Express")); params.append("discover", tr("Discover")); params.append("other", tr("Other")); params.append("key", key); r = mql.toQuery(params); _cc->populate(r); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Credit Cards"), r, __FILE__, __LINE__)) return; } void customer::sLoadCrmAcct(int crmacctId) { _notice = FALSE; _crmacctid = crmacctId; _billCntct->setSearchAcct(_crmacctid); _corrCntct->setSearchAcct(_crmacctid); XSqlQuery getq; getq.prepare("SELECT * FROM crmacct WHERE (crmacct_id=:crmacct_id);"); getq.bindValue(":crmacct_id", crmacctId); getq.exec(); if (getq.first()) { _crmowner = getq.value("crmacct_owner_username").toString(); _number->setCanEdit(true); _number->setEditMode(true); _number->setNumber(getq.value("crmacct_number").toString()); _cachedNumber=_number->number().trimmed().toUpper(); // _number->setEditMode(false); // _number->setCanEdit(false); _name->setText(getq.value("crmacct_name").toString()); _active->setChecked(getq.value("crmacct_active").toBool()); _billCntct->setId(getq.value("crmacct_cntct_id_1").toInt()); _corrCntct->setId(getq.value("crmacct_cntct_id_1").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting CRM Account"), getq, __FILE__, __LINE__)) return; _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); _name->setFocus(); } void customer::sNumberEdited() { _notice = TRUE; sCheck(); } void customer::closeEvent(QCloseEvent *pEvent) { if(cNew == _mode && -1 != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } XWidget::closeEvent(pEvent); } void customer::currentTabChanged(int index) { if ( (index == _tab->indexOf(_crmTab) || index == _tab->indexOf(_salesTab) || index == _tab->indexOf(_accountingTab)) && (_mode == cNew) ) sSave(); else sFillList(); } void customer::sHandleButtons() { if (_billingButton->isChecked()) _addressStack->setCurrentIndex(0); else if (_correspButton->isChecked()) _addressStack->setCurrentIndex(1); else _addressStack->setCurrentIndex(2); if (_notesButton->isChecked()) _remarksStack->setCurrentIndex(0); else _remarksStack->setCurrentIndex(1); if (_generalButton->isChecked()) _settingsStack->setCurrentIndex(0); else if (_termsButton->isChecked()) _settingsStack->setCurrentIndex(1); else if (_taxButton->isChecked()) _settingsStack->setCurrentIndex(2); else if (_creditcardsButton->isVisible()) _settingsStack->setCurrentIndex(3); if (_contactsButton->isChecked()) _crmStack->setCurrentIndex(0); else if (_todoListButton->isChecked()) _crmStack->setCurrentIndex(1); else _crmStack->setCurrentIndex(2); if (_summaryButton->isChecked()) _salesStack->setCurrentIndex(0); else if (_quotesButton->isChecked()) _salesStack->setCurrentIndex(1); else if (_ordersButton->isChecked()) _salesStack->setCurrentIndex(2); else _salesStack->setCurrentIndex(3); if (_aritemsButton->isChecked()) _receivablesStack->setCurrentIndex(0); else if (_cashreceiptsButton->isChecked()) _receivablesStack->setCurrentIndex(1); else if (_cctransButton->isVisible()) _receivablesStack->setCurrentIndex(2); sFillList(); } void customer::sCancel() { if (_autoSaved) QMessageBox::information( this, tr("Customer Saved"), tr("The customer record was automatically " "saved to the database. The committed changes" "will not be cancelled.") ); close(); } void customer::setId(int p) { if (_custid==p) return; _charfilled = false; _custid=p; populate(); emit newId(_custid); } void customer::sClear() { _custid = -1; _crmacctid = -1; _crmacct->setEnabled(false); disconnect(_number, SIGNAL(newId(int)), this, SLOT(setId(int))); _number->clear(); connect(_number, SIGNAL(newId(int)), this, SLOT(setId(int))); _cachedNumber=""; _name->clear(); _corrCntct->setId(-1); _billCntct->setId(-1); _creditLimit->clear(); _creditRating->clear(); _autoUpdateStatus->setChecked(false); _autoHoldOrders->setChecked(false); _defaultDiscountPrcnt->clear(); _warnLate->setChecked(false); _graceDays->setValue(_metrics->value("DefaultAutoCreditWarnGraceDays").toInt()); _notes->clear(); _salesrep->setId(_metrics->value("DefaultSalesRep").toInt()); _terms->setId(_metrics->value("DefaultTerms").toInt()); _taxzone->setCurrentIndex(-1); _shipform->setId(_metrics->value("DefaultShipFormId").toInt()); _shipvia->setId(_metrics->value("DefaultShipViaId").toInt()); _custtype->setId(_metrics->value("DefaultCustType").toInt()); _backorders->setChecked(_metrics->boolean("DefaultBackOrders")); _partialShipments->setEnabled(_metrics->boolean("DefaultBackOrders")); _partialShipments->setChecked(_metrics->boolean("DefaultPartialShipments")); _allowFFShipto->setChecked(_metrics->boolean("DefaultFreeFormShiptos")); _creditLimit->setId(CurrCluster::baseId()); _creditLimit->setBaseValue(_metrics->value("SOCreditLimit").toDouble()); _creditRating->setText(_metrics->value("SOCreditRate")); _balanceMethod->setCode(_metrics->value("DefaultBalanceMethod")); if(!_privileges->check("MaintainCustomerMastersCustomerType") && !_privileges->check("MaintainCustomerMastersCustomerTypeOnCreate") && (_custtype->id() != -1)) _custtype->setEnabled(false); _defaultCommissionPrcnt->setDouble(0); _shipchrg->setId(-1); _sellingWarehouse->setId(-1); _active->setChecked(true); _allowFFBillto->setChecked(false); _usesPOs->setChecked(false); _blanketPos->setEnabled(cView != _mode && _usesPOs->isChecked()); _blanketPos->setChecked(false); _currency->setId(CurrCluster::baseId()); _inGoodStanding->setChecked(true); _shipto->clear(); _custchar->removeRows(0, _custchar->rowCount()); _charass->clear(); _widgetStack->setCurrentIndex(0); _todoList->parameterWidget()->setDefault(tr("CRM Account"), -1, true); _contacts->setCrmacctid(_crmacctid); _quotes->parameterWidget()->setDefault(tr("Customer"), -1, true); _orders->setCustId(-1); _returns->findChild("_customerSelector")->setCustId(-1); _aritems->findChild("_customerSelector")->setCustId(-1); _cashreceipts->findChild("_customerSelector")->setCustId(-1); _cctrans->findChild("_customerSelector")->setCustId(-1); _comments->setId(_crmacctid); _documents->setId(_crmacctid); _print->setEnabled(false); sFillList(); _charfilled = false; setValid(false); if (_number->editMode() || _mode == cNew) sPrepare(); } void customer::sNumberEditable(bool p) { if (p && _number->id() == -1) sClear(); } void customer::sPrepare() { if (_mode == cEdit) { _mode = cNew; emit newMode(_mode); } XSqlQuery idq; idq.exec("SELECT NEXTVAL('cust_cust_id_seq') AS cust_id"); if (idq.first()) { _custid = idq.value("cust_id").toInt(); emit newId(_custid); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting new id"), idq, __FILE__, __LINE__)) return; disconnect(_number, SIGNAL(editable(bool)), this, SLOT(sNumberEditable(bool))); _number->clear(); _number->setCanEdit(true); _number->setEditMode(true); connect(_number, SIGNAL(editable(bool)), this, SLOT(sNumberEditable(bool))); // Handle Auto numbering if(((_x_metrics && _x_metrics->value("CRMAccountNumberGeneration") == "A") || (_x_metrics->value("CRMAccountNumberGeneration") == "O")) && _number->number().isEmpty() ) { XSqlQuery num; num.exec("SELECT fetchCRMAccountNumber() AS number;"); if (num.first()) _number->setNumber(num.value("number").toString()); _custtype->setFocus(); } _NumberGen = _number->number().toInt(); } qt-client-4.1.0/guiclient/customer.h000066400000000000000000000064561217451700100174220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMER_H #define CUSTOMER_H #include "guiclient.h" #include "xwidget.h" #include "contacts.h" #include "todoList.h" #include "quotes.h" #include "openSalesOrders.h" #include "returnAuthorizationWorkbench.h" #include "dspAROpenItems.h" #include "dspCashReceipts.h" #include "dspCreditCardTransactions.h" #include #include #include "ui_customer.h" class customer : public XWidget, public Ui::customer { Q_OBJECT public: customer(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~customer(); Q_INVOKABLE virtual int id() const; Q_INVOKABLE virtual int mode() const; public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void setId(int); virtual void currentTabChanged(int index); virtual void populate(); virtual void sCancel(); virtual void sCheck(); virtual bool sCheckRequired(); virtual void sDeleteCharacteristic(); virtual void sDeleteShipto(); virtual void sDeleteTaxreg(); virtual void sEditCharacteristic(); virtual void sEditCreditCard(); virtual void sEditShipto(); virtual void sEditTaxreg(); virtual void sFillList(); virtual void sFillCcardList(); virtual void sFillCharacteristicList(); virtual void sFillShiptoList(); virtual void sFillTaxregList(); virtual void sMoveDown(); virtual void sMoveUp(); virtual void sNewCharacteristic(); virtual void sNewCreditCard(); virtual void sNewShipto(); virtual void sNewTaxreg(); virtual void sPopulateCommission(); virtual void sPopulateShiptoMenu( QMenu * menuThis ); virtual void sPopulateSummary(); virtual void sPrint(); virtual void sPrintShipto(); virtual bool sSave(); virtual void sSaveClicked(); virtual void sViewCreditCard(); virtual void sViewShipto(); virtual void sViewTaxreg(); virtual void sLoadCrmAcct(int); virtual void sHandleButtons(); virtual void sClear(); virtual void sNumberEditable(bool); virtual void sPrepare(); protected slots: virtual void languageChange(); virtual void sCrmAccount(); virtual void sNumberEdited(); signals: void populated(); void newId(int); void newMode(int); void saved(int); protected: virtual void closeEvent(QCloseEvent*); virtual void setValid(bool valid); todoList *_todoList; contacts *_contacts; quotes *_quotes; openSalesOrders *_orders; returnAuthorizationWorkbench *_returns; dspAROpenItems *_aritems; dspCashReceipts *_cashreceipts; dspCreditCardTransactions *_cctrans; private: int _mode; int _custid; int _crmacctid; QString _crmowner; int _NumberGen; QString _cachedNumber; QString key; bool _notice; bool _autoSaved; bool _captive; bool _charfilled; QStandardItemModel * _custchar; }; #endif // CUSTOMER_H qt-client-4.1.0/guiclient/customer.ui000066400000000000000000002526271217451700100176130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customer 0 0 600 400 Customer Customer #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false true Qt::Horizontal 0 20 Customer Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::CustomerTypes false CRM Account... Customer Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Active true Qt::Vertical QSizePolicy::Expanding 20 0 0 &Cancel &Save true false false &Print Qt::Vertical QSizePolicy::Expanding 10 0 0 1 QTabWidget::Rounded 0 Addresses 12 Billing Contact true Correspondence Contact Ship To Qt::Horizontal 40 20 0 false false false Qt::Vertical 20 0 Qt::Horizontal 40 20 false false false Qt::Vertical 20 40 Qt::Horizontal 40 20 0 0 5 Print 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Settings 12 General true settingsButtonGroup Terms settingsButtonGroup Tax settingsButtonGroup Credit Cards settingsButtonGroup Qt::Horizontal 40 20 0 false Sales Rep: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::SalesReps Qt::Horizontal 40 20 Commission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 0 0 80 32767 Qt::AlignRight % Qt::Horizontal QSizePolicy::Expanding 20 20 false Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true XComboBox::ShipVias Qt::Horizontal 40 20 false Shipping Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true XComboBox::ShippingForms XComboBox::None Qt::Horizontal 40 20 false Shipping Charges: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true XComboBox::ShippingCharges Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 20 0 Accepts Backorders Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Horizontal QSizePolicy::Preferred 20 10 5 false Accepts Partial Shipments Qt::Horizontal QSizePolicy::Expanding 20 20 Allow Free-Form Ship-Tos Qt::Horizontal QSizePolicy::Expanding 20 20 Allow Free-Form Bill-To Qt::Horizontal QSizePolicy::Expanding 20 20 5 Preferred Selling Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::Horizontal 20 20 Qt::Vertical 20 0 Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _terms true XComboBox::ARTerms Qt::Horizontal 40 20 Discount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight % Qt::Horizontal QSizePolicy::Expanding 20 20 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _currency XComboBox::Currencies Qt::Horizontal 40 20 In Good Standing true On Credit Warning On Credit Hold Uses Purchase Orders Qt::Horizontal QSizePolicy::Preferred 20 20 Qt::Horizontal QSizePolicy::Fixed 20 20 false Uses Blanket P/O's Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical 20 0 0 1 Balance Method: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _balanceMethod Qt::Horizontal 40 20 Alternate Late Grace Days true false Grace Days: 9999 Credit Limit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 250 32767 Credit Rating: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Place on Credit Warning when Credit Limit/Grace Days is Exceeded Qt::Horizontal QSizePolicy::Expanding 20 16 Place open Sales Orders on Credit Hold when Credit Limit is Exceeded Qt::Horizontal QSizePolicy::Expanding 20 16 Qt::Vertical 20 16 0 Tax Registration Numbers: 0 New false Edit false View false Delete Qt::Vertical 20 0 5 Default Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::TaxZones Qt::Horizontal 40 20 0 New Edit View Move Up Move Down Qt::Vertical QSizePolicy::Expanding 21 10 Characteristics 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 10 10 661 463 QAbstractItemView::AllEditTriggers false false CRM 12 Contacts true Activities Qt::Horizontal 40 20 true 0 Sales 12 Summary true Quotes false Orders Returns Qt::Horizontal 40 20 0 First Sales Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Last Sales Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Backlog: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Last Year Sales: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Year To Date Sales: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Open Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Late Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Horizontal 40 20 Accounting 12 Receivables true accountingButtonGroup Cash Receipts accountingButtonGroup Credit Cards accountingButtonGroup Qt::Horizontal 40 20 0 Documents Documents::CRMAccount Remarks 12 Notes true Comments Qt::Horizontal 40 20 0 false Comments::CRMAccount Comments QWidget

    comments.h
    ContactCluster QWidget
    contactcluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    CustCluster QWidget
    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    Documents QWidget
    documents.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _custtype _name _active _tab _billingButton _billCntct _correspButton _corrCntct _shiptoButton _shipto _printShipto _newShipto _editShipto _viewShipto _deleteShipto _generalButton _salesrep _defaultCommissionPrcnt _shipvia _shipform _shipchrg _backorders _partialShipments _allowFFShipto _allowFFBillto _sellingWarehouse _termsButton _terms _defaultDiscountPrcnt _currency _inGoodStanding _onCreditWarning _onCreditHold _usesPOs _blanketPos _balanceMethod _creditLimit _creditRating _autoUpdateStatus _autoHoldOrders _warnLate _graceDays _taxButton _taxzone _taxreg _newTaxreg _editTaxreg _viewTaxreg _deleteTaxreg _creditcardsButton _cc _newCC _editCC _viewCC _upCC _downCC _charass _newCharacteristic _editCharacteristic _deleteCharacteristic _chartempl _notesButton _notes _commentsButton _contactsButton _todoListButton _summaryButton _quotesButton _ordersButton _returnsButton _aritemsButton _cashreceiptsButton _close _save _lastSaleDate _firstSaleDate _taxreg valid(bool) _editTaxreg setEnabled(bool) 57 207 131 207 _taxreg valid(bool) _viewTaxreg setEnabled(bool) 57 207 131 207 _taxreg valid(bool) _deleteTaxreg setEnabled(bool) 57 207 131 207 _taxreg itemSelected(int) _editTaxreg animateClick() 57 207 131 207 _charass itemSelected(int) _editCharacteristic animateClick() 78 168 184 186 _autoUpdateStatus toggled(bool) _warnLate setEnabled(bool) 182 433 575 371 _shipto valid(bool) _viewShipto setEnabled(bool) 131 207 131 207 _usesPOs clicked(bool) _blanketPos setEnabled(bool) 548 210 557 234 qt-client-4.1.0/guiclient/customerFormAssignment.cpp000066400000000000000000000162151217451700100226240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customerFormAssignment.h" #include #include #include customerFormAssignment::customerFormAssignment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); } customerFormAssignment::~customerFormAssignment() { // no need to delete child widgets, Qt does it all for us } void customerFormAssignment::languageChange() { retranslateUi(this); } enum SetResponse customerFormAssignment::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("custform_id", &valid); if (valid) { _custformid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _customerTypeGroup->setEnabled(FALSE); _invoiceForm->setEnabled(FALSE); _creditMemoForm->setEnabled(FALSE); _statementForm->setEnabled(FALSE); _quoteForm->setEnabled(FALSE); _packingListForm->setEnabled(FALSE); _soPickListForm->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void customerFormAssignment::sSave() { XSqlQuery customerSave; int custtypeid = -1; QString custtype = ""; if (_selectedCustomerType->isChecked()) custtypeid = _customerTypes->id(); else if (_customerTypePattern->isChecked()) custtype = _customerType->text().trimmed(); customerSave.prepare("SELECT custform_id" " FROM custform" " WHERE((custform_id != :custform_id)" " AND (custform_custtype = :custform_custtype)" " AND (custform_custtype_id=:custform_custtype_id))"); customerSave.bindValue(":custform_id", _custformid); customerSave.bindValue(":custform_custtype", custtype); customerSave.bindValue(":custform_custtype_id", custtypeid); customerSave.exec(); if(customerSave.first()) { QMessageBox::critical(this, tr("Duplicate Entry"), tr("The Customer Type specified is already in the database.") ); return; } if (_mode == cNew) { customerSave.exec("SELECT NEXTVAL('custform_custform_id_seq') AS _custformid"); if (customerSave.first()) _custformid = customerSave.value("_custformid").toInt(); else if (customerSave.lastError().type() != QSqlError::NoError) { systemError(this, customerSave.lastError().databaseText(), __FILE__, __LINE__); return; } customerSave.prepare( "INSERT INTO custform " "( custform_id, custform_custtype, custform_custtype_id," " custform_invoice_report_name, custform_creditmemo_report_name," " custform_statement_report_name, custform_quote_report_name," " custform_packinglist_report_name, custform_sopicklist_report_name ) " "VALUES " "( :custform_id, :custform_custtype, :custform_custtype_id," " :custform_invoice_report_name, :custform_creditmemo_report_name," " :custform_statement_report_name, :custform_quote_report_name," " :custform_packinglist_report_name, :custform_sopicklist_report_name );" ); } else if (_mode == cEdit) customerSave.prepare( "UPDATE custform " "SET custform_custtype=:custform_custtype, custform_custtype_id=:custform_custtype_id," " custform_invoice_report_name=:custform_invoice_report_name," " custform_creditmemo_report_name=:custform_creditmemo_report_name," " custform_statement_report_name=:custform_statement_report_name," " custform_quote_report_name=:custform_quote_report_name," " custform_packinglist_report_name=:custform_packinglist_report_name," " custform_sopicklist_report_name=:custform_sopicklist_report_name " "WHERE (custform_id=:custform_id);" ); customerSave.bindValue(":custform_id", _custformid); customerSave.bindValue(":custform_custtype", custtype); customerSave.bindValue(":custform_custtype_id", custtypeid); customerSave.bindValue(":custform_invoice_report_name", _invoiceForm->code()); customerSave.bindValue(":custform_creditmemo_report_name", _creditMemoForm->code()); customerSave.bindValue(":custform_statement_report_name", _statementForm->code()); customerSave.bindValue(":custform_quote_report_name", _quoteForm->code()); customerSave.bindValue(":custform_packinglist_report_name", _packingListForm->code()); customerSave.bindValue(":custform_sopicklist_report_name", _soPickListForm->code()); customerSave.exec(); if (customerSave.lastError().type() != QSqlError::NoError) { systemError(this, customerSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_custformid); } void customerFormAssignment::populate() { XSqlQuery customerpopulate; customerpopulate.prepare( "SELECT custform_custtype_id, custform_custtype," " custform_invoice_report_name, custform_creditmemo_report_name," " custform_statement_report_name, custform_quote_report_name," " custform_packinglist_report_name, custform_sopicklist_report_name " "FROM custform " "WHERE (custform_id=:custform_id);" ); customerpopulate.bindValue(":custform_id", _custformid); customerpopulate.exec(); if (customerpopulate.first()) { if (customerpopulate.value("custform_custtype_id").toInt() == -1) { _customerTypePattern->setChecked(TRUE); _customerType->setText(customerpopulate.value("custform_custtype").toString()); } else { _selectedCustomerType->setChecked(TRUE); _customerTypes->setId(customerpopulate.value("custform_custtype_id").toInt()); } _invoiceForm->setCode(customerpopulate.value("custform_invoice_report_name").toString()); _creditMemoForm->setCode(customerpopulate.value("custform_creditmemo_report_name").toString()); _statementForm->setCode(customerpopulate.value("custform_statement_report_name").toString()); _quoteForm->setCode(customerpopulate.value("custform_quote_report_name").toString()); _packingListForm->setCode(customerpopulate.value("custform_packinglist_report_name").toString()); _soPickListForm->setCode(customerpopulate.value("custform_sopicklist_report_name").toString()); } else if (customerpopulate.lastError().type() != QSqlError::NoError) { systemError(this, customerpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/customerFormAssignment.h000066400000000000000000000021641217451700100222670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERFORMASSIGNMENT_H #define CUSTOMERFORMASSIGNMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_customerFormAssignment.h" class customerFormAssignment : public XDialog, public Ui::customerFormAssignment { Q_OBJECT public: customerFormAssignment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~customerFormAssignment(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _custformid; }; #endif // CUSTOMERFORMASSIGNMENT_H qt-client-4.1.0/guiclient/customerFormAssignment.ui000066400000000000000000000250571217451700100224630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customerFormAssignment 0 0 524 316 Customer Form Assignment Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Selected Customer Type: false 0 0 XComboBox::CustomerTypes Customer Type Pattern: true true Invoice Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Default XComboBox::Reports Credit Memo Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Default XComboBox::Reports Statement Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Default XComboBox::Reports Quote Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Default XComboBox::Reports Packing List Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Default XComboBox::Reports Sales Order Pick List Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Default XComboBox::Reports Qt::Vertical QSizePolicy::Expanding 20 138 XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _selectedCustomerType _customerTypes _customerTypePattern _customerType _invoiceForm _creditMemoForm _statementForm _quoteForm _packingListForm _soPickListForm _buttonBox _selectedCustomerType toggled(bool) _customerTypes setEnabled(bool) 20 20 20 20 _customerTypePattern toggled(bool) _customerType setEnabled(bool) 20 20 20 20 _buttonBox rejected() customerFormAssignment reject() 553 134 299 132
    qt-client-4.1.0/guiclient/customerFormAssignments.cpp000066400000000000000000000111171217451700100230030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customerFormAssignments.h" #include #include #include #include #include #include "customerFormAssignment.h" customerFormAssignments::customerFormAssignments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _custform->addColumn(tr("Customer Type"), -1, Qt::AlignCenter, true, "custtypecode"); _custform->addColumn(tr("Invoice"), 100, Qt::AlignCenter, true, "invoice"); _custform->addColumn(tr("Credit Memo"), 100, Qt::AlignCenter, true, "creditmemo"); _custform->addColumn(tr("Statement"), 100, Qt::AlignCenter, true, "statement"); _custform->addColumn(tr("Quote"), 100, Qt::AlignCenter, true, "quote"); _custform->addColumn(tr("Packing List"), 100, Qt::AlignCenter, true, "packinglist"); _custform->addColumn(tr("S/O Pick List"),100, Qt::AlignCenter, true, "sopicklist"); if (_privileges->check("MaintainSalesAccount")) { connect(_custform, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_custform, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_custform, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_custform, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } customerFormAssignments::~customerFormAssignments() { // no need to delete child widgets, Qt does it all for us } void customerFormAssignments::languageChange() { retranslateUi(this); } void customerFormAssignments::sNew() { ParameterList params; params.append("mode", "new"); customerFormAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerFormAssignments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("custform_id", _custform->id()); customerFormAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerFormAssignments::sView() { ParameterList params; params.append("mode", "view"); params.append("custform_id", _custform->id()); customerFormAssignment newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void customerFormAssignments::sDelete() { XSqlQuery customerDelete; customerDelete.prepare( "DELETE FROM custform " "WHERE (custform_id=:custform_id);" ); customerDelete.bindValue(":custform_id", _custform->id()); customerDelete.exec(); if (customerDelete.lastError().type() != QSqlError::NoError) { systemError(this, customerDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void customerFormAssignments::sFillList() { XSqlQuery customerFillList; customerFillList.prepare( "SELECT custform_id," " CASE WHEN custform_custtype_id=-1 THEN custform_custtype" " ELSE (SELECT custtype_code FROM custtype WHERE (custtype_id=custform_custtype_id))" " END AS custtypecode," " COALESCE(custform_invoice_report_name, :default) AS invoice," " COALESCE(custform_creditmemo_report_name, :default) AS creditmemo," " COALESCE(custform_statement_report_name, :default) AS statement," " COALESCE(custform_quote_report_name, :default) AS quote," " COALESCE(custform_packinglist_report_name, :default) AS packinglist," " COALESCE(custform_sopicklist_report_name, :default) AS sopicklist " "FROM custform " "ORDER BY custtypecode;" ); customerFillList.bindValue(":default", tr("Default")); customerFillList.exec(); _custform->populate(customerFillList); if (customerFillList.lastError().type() != QSqlError::NoError) { systemError(this, customerFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/customerFormAssignments.h000066400000000000000000000020721217451700100224500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERFORMASSIGNMENTS_H #define CUSTOMERFORMASSIGNMENTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_customerFormAssignments.h" class customerFormAssignments : public XWidget, public Ui::customerFormAssignments { Q_OBJECT public: customerFormAssignments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~customerFormAssignments(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // CUSTOMERFORMASSIGNMENTS_H qt-client-4.1.0/guiclient/customerFormAssignments.ui000066400000000000000000000117061217451700100226420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customerFormAssignments 0 0 600 400 List Customer Form Assignments 0 0 0 0 20 Customer Form Assignments: 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &View false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 XTreeWidget QTreeWidget
    xtreewidget.h
    _custform _new _view _edit _delete _close _close clicked() customerFormAssignments close() 20 20 20 20 _custform valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/customerGroup.cpp000066400000000000000000000210271217451700100207610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customerGroup.h" #include #include #include #include "crmacctcluster.h" #include "customerGroup.h" customerGroup::customerGroup(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); _custgrpitem->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft, true, "cust_number"); _custgrpitem->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name"); } customerGroup::~customerGroup() { // no need to delete child widgets, Qt does it all for us } void customerGroup::languageChange() { retranslateUi(this); } enum SetResponse customerGroup::set(const ParameterList &pParams) { XSqlQuery customeret; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("custgrp_id", &valid); if (valid) { _custgrpid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; customeret.exec("SELECT NEXTVAL('custgrp_custgrp_id_seq') AS _custgrp_id;"); if (customeret.first()) _custgrpid = customeret.value("_custgrp_id").toInt(); else if (customeret.lastError().type() != QSqlError::NoError) { systemError(this, customeret.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } connect(_custgrpitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _mode = cEdit; sFillList(); connect(_custgrpitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _new->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); sFillList(); } } return NoError; } void customerGroup::sCheck() { XSqlQuery customerCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length())) { customerCheck.prepare( "SELECT custgrp_id " "FROM custgrp " "WHERE (UPPER(custgrp_name)=UPPER(:custgrp_name));" ); customerCheck.bindValue(":custgrp_name", _name->text()); customerCheck.exec(); if (customerCheck.first()) { _custgrpid = customerCheck.value("custgrp_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } else if (customerCheck.lastError().type() != QSqlError::NoError) { systemError(this, customerCheck.lastError().databaseText(), __FILE__, __LINE__); return; } } } void customerGroup::sClose() { XSqlQuery customerClose; if (_mode == cNew) { customerClose.prepare( "DELETE FROM custgrpitem " "WHERE (custgrpitem_custgrp_id=:custgrp_id);" "DELETE FROM custgrp " "WHERE (custgrp_id=:custgrp_id);" ); customerClose.bindValue(":custgrp_id", _custgrpid); customerClose.exec(); if (customerClose.lastError().type() != QSqlError::NoError) { systemError(this, customerClose.lastError().databaseText(), __FILE__, __LINE__); } } reject(); } void customerGroup::sSave() { XSqlQuery customerSave; if(_name->text().trimmed().isEmpty()) { QMessageBox::warning(this, tr("Cannot Save Customer Group"), tr("You cannot have an empty name.")); _name->setFocus(); return; } customerSave.prepare("SELECT custgrp_id" " FROM custgrp" " WHERE((custgrp_name=:custgrp_name)" " AND (custgrp_id != :custgrp_id))"); customerSave.bindValue(":custgrp_id", _custgrpid); customerSave.bindValue(":custgrp_name", _name->text()); customerSave.exec(); if(customerSave.first()) { QMessageBox::warning(this, tr("Cannot Save Customer Group"), tr("You cannot have a duplicate name.")); _name->setFocus(); return; } if (_mode == cNew) customerSave.prepare( "INSERT INTO custgrp " "(custgrp_id, custgrp_name, custgrp_descrip) " "VALUES " "(:custgrp_id, :custgrp_name, :custgrp_descrip);" ); else if (_mode == cEdit) customerSave.prepare( "UPDATE custgrp " "SET custgrp_name=:custgrp_name, custgrp_descrip=:custgrp_descrip " "WHERE (custgrp_id=:custgrp_id);" ); customerSave.bindValue(":custgrp_id", _custgrpid); customerSave.bindValue(":custgrp_name", _name->text()); customerSave.bindValue(":custgrp_descrip", _descrip->text().trimmed()); customerSave.exec(); if (customerSave.lastError().type() != QSqlError::NoError) { systemError(this, customerSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_custgrpid); } void customerGroup::sDelete() { XSqlQuery customerDelete; customerDelete.prepare( "DELETE FROM custgrpitem " "WHERE (custgrpitem_id=:custgrpitem_id);" ); customerDelete.bindValue(":custgrpitem_id", _custgrpitem->id()); customerDelete.exec(); if (customerDelete.lastError().type() != QSqlError::NoError) { systemError(this, customerDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void customerGroup::sNew() { XSqlQuery customerNew; ParameterList params; CRMAcctList *newdlg = new CRMAcctList(this); newdlg->setSubtype(CRMAcctLineEdit::Cust); int custid; if ((custid = newdlg->exec()) != XDialog::Rejected) { customerNew.prepare( "SELECT custgrpitem_id " "FROM custgrpitem " "WHERE ( (custgrpitem_custgrp_id=:custgrpitem_custgrp_id)" " AND (custgrpitem_cust_id=:custgrpitem_cust_id) );" ); customerNew.bindValue(":custgrpitem_custgrp_id", _custgrpid); customerNew.bindValue(":custgrpitem_cust_id", custid); customerNew.exec(); if (customerNew.first()) return; else if (customerNew.lastError().type() != QSqlError::NoError) { systemError(this, customerNew.lastError().databaseText(), __FILE__, __LINE__); return; } customerNew.prepare( "INSERT INTO custgrpitem " "(custgrpitem_custgrp_id, custgrpitem_cust_id) " "VALUES " "(:custgrpitem_custgrp_id, :custgrpitem_cust_id);" ); customerNew.bindValue(":custgrpitem_custgrp_id", _custgrpid); customerNew.bindValue(":custgrpitem_cust_id", custid); customerNew.exec(); if (customerNew.lastError().type() != QSqlError::NoError) { systemError(this, customerNew.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void customerGroup::sFillList() { XSqlQuery customerFillList; customerFillList.prepare( "SELECT custgrpitem_id, cust_number, cust_name " "FROM custgrpitem, custinfo " "WHERE ( (custgrpitem_cust_id=cust_id) " " AND (custgrpitem_custgrp_id=:custgrp_id) ) " "ORDER BY cust_number;" ); customerFillList.bindValue(":custgrp_id", _custgrpid); customerFillList.exec(); _custgrpitem->populate(customerFillList); if (customerFillList.lastError().type() != QSqlError::NoError) { systemError(this, customerFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void customerGroup::populate() { XSqlQuery customerpopulate; customerpopulate.prepare( "SELECT custgrp_name, custgrp_descrip " "FROM custgrp " "WHERE (custgrp_id=:custgrp_id);" ); customerpopulate.bindValue(":custgrp_id", _custgrpid); customerpopulate.exec(); if (customerpopulate.first()) { _name->setText(customerpopulate.value("custgrp_name").toString()); _descrip->setText(customerpopulate.value("custgrp_descrip").toString()); } else if (customerpopulate.lastError().type() != QSqlError::NoError) { systemError(this, customerpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/customerGroup.h000066400000000000000000000022641217451700100204300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERGROUP_H #define CUSTOMERGROUP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_customerGroup.h" class customerGroup : public XDialog, public Ui::customerGroup { Q_OBJECT public: customerGroup(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~customerGroup(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sClose(); virtual void sSave(); virtual void sDelete(); virtual void sNew(); virtual void sFillList(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _custgrpid; }; #endif // CUSTOMERGROUP_H qt-client-4.1.0/guiclient/customerGroup.ui000066400000000000000000000216561217451700100206240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customerGroup 0 0 517 292 Customer Group 5 5 0 7 5 7 0 5 0 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Save true true Qt::Vertical QSizePolicy::Preferred 20 40 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 45 0 0 Member Customers: 0 7 0 0 0 0 &New false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    XLineEdit QLineEdit
    xlineedit.h
    0
    _name _descrip _custgrpitem _delete _new _save _close
    qt-client-4.1.0/guiclient/customerGroups.cpp000066400000000000000000000056461217451700100211550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customerGroups.h" #include #include #include #include "customerGroup.h" #include "guiclient.h" customerGroups::customerGroups(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _custgrp->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "custgrp_name"); _custgrp->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "custgrp_descrip"); if (_privileges->check("MaintainCustomerGroups")) { connect(_custgrp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_custgrp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_custgrp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_custgrp, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } customerGroups::~customerGroups() { // no need to delete child widgets, Qt does it all for us } void customerGroups::languageChange() { retranslateUi(this); } void customerGroups::sDelete() { XSqlQuery customerDelete; customerDelete.prepare( "DELETE FROM custgrpitem " "WHERE (custgrpitem_custgrp_id=:custgrp_id); " "DELETE FROM custgrp " "WHERE (custgrp_id=:custgrp_id);" ); customerDelete.bindValue(":custgrp_id", _custgrp->id()); customerDelete.exec(); sFillList(); } void customerGroups::sNew() { ParameterList params; params.append("mode", "new"); customerGroup newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerGroups::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("custgrp_id", _custgrp->id()); customerGroup newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerGroups::sView() { ParameterList params; params.append("mode", "view"); params.append("custgrp_id", _custgrp->id()); customerGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void customerGroups::sFillList() { _custgrp->populate( "SELECT custgrp_id, custgrp_name, custgrp_descrip " "FROM custgrp " "ORDER BY custgrp_name;" ); } qt-client-4.1.0/guiclient/customerGroups.h000066400000000000000000000017331217451700100206130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERGROUPS_H #define CUSTOMERGROUPS_H #include "xwidget.h" #include "ui_customerGroups.h" class customerGroups : public XWidget, public Ui::customerGroups { Q_OBJECT public: customerGroups(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~customerGroups(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // CUSTOMERGROUPS_H qt-client-4.1.0/guiclient/customerGroups.ui000066400000000000000000000121151217451700100207750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customerGroups 0 0 357 281 List Customer Groups 0 0 Customer Groups: 0 5 &Close 0 0 &New false &Edit false &View false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _custgrp _new _edit _view _delete _close _close clicked() customerGroups close() _custgrp valid(bool) _view setEnabled(bool)
    qt-client-4.1.0/guiclient/customerType.cpp000066400000000000000000000172011217451700100206050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customerType.h" #include "characteristicAssignment.h" #include #include #include customerType::customerType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _custtypeid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name"); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value"); _charass->addColumn(tr("Default"), _ynColumn, Qt::AlignCenter,true, "charass_default"); } customerType::~customerType() { // no need to delete child widgets, Qt does it all for us } void customerType::languageChange() { retranslateUi(this); } enum SetResponse customerType::set(const ParameterList &pParams) { XSqlQuery customeret; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("custtype_id", &valid); if (valid) { _custtypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; customeret.exec("SELECT NEXTVAL('custtype_custtype_id_seq') AS custtype_id;"); if (customeret.first()) _custtypeid = customeret.value("custtype_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void customerType::sCheck() { XSqlQuery customerCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().length())) { customerCheck.prepare( "SELECT custtype_id" " FROM custtype " " WHERE((UPPER(custtype_code)=UPPER(:custtype_code))" " AND (custtype_id != :custtype_id));" ); customerCheck.bindValue(":custtype_code", _code->text()); customerCheck.bindValue(":custtype_id", _custtypeid); customerCheck.exec(); if (customerCheck.first()) { _custtypeid = customerCheck.value("custtype_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void customerType::sNew() { ParameterList params; params.append("mode", "new"); params.append("custtype_id", _custtypeid); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerType::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerType::sDelete() { XSqlQuery customerDelete; customerDelete.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); customerDelete.bindValue(":charass_id", _charass->id()); customerDelete.exec(); if (customerDelete.lastError().type() != QSqlError::NoError) { systemError(this, customerDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void customerType::sFillList() { XSqlQuery customerFillList; customerFillList.prepare( "SELECT charass_id, char_name, charass_value, charass_default " "FROM charass, char " "WHERE ( (charass_target_type='CT')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:custtype_id) ) " "ORDER BY char_order, char_name;" ); customerFillList.bindValue(":custtype_id", _custtypeid); customerFillList.exec(); _charass->populate(customerFillList); if (customerFillList.lastError().type() != QSqlError::NoError) { systemError(this, customerFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void customerType::sSave() { XSqlQuery customerSave; if (_code->text().trimmed().length() == 0) { QMessageBox::information( this, tr("Invalid Customer Type Code"), tr("You must enter a valid Code for this Customer Type before creating it.") ); _code->setFocus(); return; } customerSave.prepare("SELECT custtype_id" " FROM custtype" " WHERE((custtype_id != :custtype_id)" " AND (custtype_code=:custtype_name))"); customerSave.bindValue(":custtype_id", _custtypeid); customerSave.bindValue(":custtype_name", _code->text().trimmed()); customerSave.exec(); if(customerSave.first()) { QMessageBox::critical(this, tr("Cannot Save Customer Type"), tr("You have entered a duplicate Code for this Customer Type. " "Please select a different Code before saving.")); _code->setFocus(); return; } if (_mode == cNew) { customerSave.prepare( "INSERT INTO custtype " "(custtype_id, custtype_code, custtype_descrip, custtype_char) " "VALUES " "(:custtype_id, :custtype_code, :custtype_descrip, :custtype_char);" ); } else if (_mode == cEdit) customerSave.prepare( "UPDATE custtype " "SET custtype_code=:custtype_code," " custtype_descrip=:custtype_descrip, custtype_char=:custtype_char " "WHERE (custtype_id=:custtype_id);" ); customerSave.bindValue(":custtype_id", _custtypeid); customerSave.bindValue(":custtype_code", _code->text().trimmed()); customerSave.bindValue(":custtype_descrip", _description->text().trimmed()); customerSave.bindValue(":custtype_char", QVariant(_characteristicGroup->isChecked())); customerSave.exec(); if (customerSave.lastError().type() != QSqlError::NoError) { systemError(this, customerSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_custtypeid); } void customerType::populate() { XSqlQuery customerpopulate; customerpopulate.prepare( "SELECT custtype_code, custtype_descrip, custtype_char " "FROM custtype " "WHERE (custtype_id=:custtype_id);" ); customerpopulate.bindValue(":custtype_id", _custtypeid); customerpopulate.exec(); if (customerpopulate.first()) { _code->setText(customerpopulate.value("custtype_code").toString()); _description->setText(customerpopulate.value("custtype_descrip").toString()); _characteristicGroup->setChecked(customerpopulate.value("custtype_char").toBool()); } else if (customerpopulate.lastError().type() != QSqlError::NoError) { systemError(this, customerpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } qt-client-4.1.0/guiclient/customerType.h000066400000000000000000000022541217451700100202540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERTYPE_H #define CUSTOMERTYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_customerType.h" class customerType : public XDialog, public Ui::customerType { Q_OBJECT public: customerType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~customerType(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _custtypeid; }; #endif // CUSTOMERTYPE_H qt-client-4.1.0/guiclient/customerType.ui000066400000000000000000000156551217451700100204530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customerType 0 0 600 400 600 400 Customer Type 7 5 C&ode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Enable Characteristics Profile true false 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _code _description _charass valid(bool) _edit setEnabled(bool) 187 236 409 151 _charass valid(bool) _delete setEnabled(bool) 187 236 409 188 _charass itemSelected(int) _edit animateClick() 187 236 409 151
    qt-client-4.1.0/guiclient/customerTypeList.cpp000066400000000000000000000035221217451700100214420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customerTypeList.h" #include customerTypeList::customerTypeList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_clear, SIGNAL(clicked()), this, SLOT(sClear())); _custtype->addColumn(tr("Code"), _itemColumn, Qt::AlignCenter,true, "custtype_code"); _custtype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "custtype_descrip"); } customerTypeList::~customerTypeList() { // no need to delete child widgets, Qt does it all for us } void customerTypeList::languageChange() { retranslateUi(this); } enum SetResponse customerTypeList::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("custtype_id", &valid); if (valid) _custtypeid = param.toInt(); else _custtypeid = -1; sFillList(); return NoError; } void customerTypeList::sClose() { done(_custtypeid); } void customerTypeList::sClear() { done(-1); } void customerTypeList::sSelect() { done(_custtype->id()); } void customerTypeList::sFillList() { _custtype->populate( "SELECT custtype_id, custtype_code, custtype_descrip " "FROM custtype " "ORDER BY custtype_code;", _custtypeid ); } qt-client-4.1.0/guiclient/customerTypeList.h000066400000000000000000000021561217451700100211110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERTYPELIST_H #define CUSTOMERTYPELIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_customerTypeList.h" class customerTypeList : public XDialog, public Ui::customerTypeList { Q_OBJECT public: customerTypeList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~customerTypeList(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sClose(); virtual void sClear(); virtual void sSelect(); virtual void sFillList(); protected slots: virtual void languageChange(); private: int _custtypeid; }; #endif // CUSTOMERTYPELIST_H qt-client-4.1.0/guiclient/customerTypeList.ui000066400000000000000000000110011217451700100212640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customerTypeList 0 0 435 373 Customer Types 5 7 0 0 Customer Types: 0 0 5 0 &Cancel Clea&r false &Select true 11 66 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _custtype _select _clear _close parameter.h _custtype itemSelected(int) _select animateClick() _custtype valid(bool) _select setEnabled(bool)
    qt-client-4.1.0/guiclient/customerTypes.cpp000066400000000000000000000070751217451700100210000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customerTypes.h" #include #include #include #include #include #include #include "customerType.h" #include "guiclient.h" #include "storedProcErrorLookup.h" customerTypes::customerTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_custtype, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); if (_privileges->check("MaintainCustomerTypes")) { connect(_custtype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_custtype, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_custtype, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); } _custtype->addColumn(tr("Code"), 70, Qt::AlignLeft, true, "custtype_code"); _custtype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "custtype_descrip"); sFillList(); } customerTypes::~customerTypes() { // no need to delete child widgets, Qt does it all for us } void customerTypes::languageChange() { retranslateUi(this); } void customerTypes::sNew() { ParameterList params; params.append("mode", "new"); customerType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("custtype_id", _custtype->id()); customerType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void customerTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("custtype_id", _custtype->id()); customerType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void customerTypes::sFillList() { _custtype->populate( "SELECT custtype_id, custtype_code, custtype_descrip " "FROM custtype " "ORDER BY custtype_code;" ); } void customerTypes::sDelete() { XSqlQuery customerDelete; customerDelete.prepare("SELECT deleteCustomerType(:custtype_id) AS result;"); customerDelete.bindValue(":custtype_id", _custtype->id()); customerDelete.exec(); if (customerDelete.first()) { int result = customerDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteCustomerType", result), __FILE__, __LINE__); return; } } else if (customerDelete.lastError().type() != QSqlError::NoError) { systemError(this, customerDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void customerTypes::sPopulateMenu(QMenu *) { } void customerTypes::sPrint() { orReport report("CustomerTypesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/customerTypes.h000066400000000000000000000020311217451700100204300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERTYPES_H #define CUSTOMERTYPES_H #include "xwidget.h" #include "ui_customerTypes.h" class customerTypes : public XWidget, public Ui::customerTypes { Q_OBJECT public: customerTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~customerTypes(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // CUSTOMERTYPES_H qt-client-4.1.0/guiclient/customerTypes.ui000066400000000000000000000102361217451700100206240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. customerTypes 0 0 600 400 List Customer Types 0 Customer Types: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _custtype _new _edit _delete _print _close _close clicked() customerTypes close() 20 20 20 20
    qt-client-4.1.0/guiclient/customers.cpp000066400000000000000000000174251217451700100201360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "customers.h" #include #include #include #include "characteristic.h" #include "customer.h" #include "customerTypeList.h" #include "errorReporter.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" customers::customers(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "customers", fl) { setUseAltId(true); setWindowTitle(tr("Customers")); setMetaSQLOptions("customers", "detail"); setReportName("Customers"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); parameterWidget()->append(tr("Customer Number Pattern"), "cust_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Customer Name Pattern"), "cust_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_code_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Contact Name Pattern"), "cntct_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Phone Pattern"), "cntct_phone_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Email Pattern"), "cntct_email_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text); parameterWidget()->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text); parameterWidget()->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Postal Code Pattern"), "addr_postalcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesReps); if (_privileges->check("MaintainCustomerMasters")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } list()->addColumn(tr("Number"), _orderColumn,Qt::AlignLeft,true, "cust_number"); list()->addColumn(tr("Active"),_ynColumn, Qt::AlignCenter, false, "cust_active"); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name"); list()->addColumn(tr("Type"),_itemColumn, Qt::AlignLeft, true, "custtype_code"); list()->addColumn(tr("Bill First"), 50, Qt::AlignLeft , true, "bill_first_name" ); list()->addColumn(tr("Bill Last"), -1, Qt::AlignLeft , true, "bill_last_name" ); list()->addColumn(tr("Bill Title"), 100, Qt::AlignLeft , true, "bill_title" ); list()->addColumn(tr("Bill Phone"), 100, Qt::AlignLeft , true, "bill_phone" ); list()->addColumn(tr("Bill Fax"), 100, Qt::AlignLeft , false, "bill_fax" ); list()->addColumn(tr("Bill Email"), 100, Qt::AlignLeft , true, "bill_email" ); list()->addColumn(tr("Bill Addr. 1"), -1, Qt::AlignLeft , true, "bill_line1" ); list()->addColumn(tr("Bill Addr. 2"), -1, Qt::AlignLeft , false, "bill_line2" ); list()->addColumn(tr("Bill Addr. 3"), -1, Qt::AlignLeft , false, "bill_line3" ); list()->addColumn(tr("Bill City"), 75, Qt::AlignLeft , false, "bill_city" ); list()->addColumn(tr("Bill State"), 50, Qt::AlignLeft , false, "bill_state" ); list()->addColumn(tr("Bill Country"),100, Qt::AlignLeft , false, "bill_country" ); list()->addColumn(tr("Bill Postal"), 75, Qt::AlignLeft , false, "bill_postalcode" ); list()->addColumn(tr("Corr. First"), 50, Qt::AlignLeft , false, "corr_first_name" ); list()->addColumn(tr("Corr. Last"), -1, Qt::AlignLeft , false, "corr_last_name" ); list()->addColumn(tr("Corr. Phone"), 100, Qt::AlignLeft , false, "corr_phone" ); list()->addColumn(tr("Corr. Fax"), 100, Qt::AlignLeft , false, "corr_fax" ); list()->addColumn(tr("Corr. Email"), 100, Qt::AlignLeft , false, "corr_email" ); list()->addColumn(tr("Corr. Addr. 1"),-1, Qt::AlignLeft , false, "corr_line1" ); list()->addColumn(tr("Corr. Addr. 2"),-1, Qt::AlignLeft , false, "corr_line2" ); list()->addColumn(tr("Corr. Addr. 3"),-1, Qt::AlignLeft , false, "corr_line3" ); list()->addColumn(tr("Corr. City"), 75, Qt::AlignLeft , false, "corr_city" ); list()->addColumn(tr("Corr. State"), 50, Qt::AlignLeft , false, "corr_state" ); list()->addColumn(tr("Corr. Postal"), 75, Qt::AlignLeft , false, "corr_postalcode" ); list()->addColumn(tr("Corr. Country"),100, Qt::AlignLeft , false, "corr_country" ); setupCharacteristics(characteristic::Customers); parameterWidget()->applyDefaultFilterSet(); connect(omfgThis, SIGNAL(customersUpdated(int, bool)), SLOT(sFillList())); } void customers::sNew() { ParameterList params; params.append("mode", "new"); customer *newdlg = new customer(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void customers::sEdit() { ParameterList params; params.append("cust_id", list()->id()); params.append("mode", "edit"); customer *newdlg = new customer(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void customers::sView() { ParameterList params; params.append("cust_id", list()->id()); params.append("mode", "view"); customer *newdlg = new customer(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void customers::sReassignCustomerType() { ParameterList params; params.append("custtype_id", list()->altId()); customerTypeList *newdlg = new customerTypeList(this, "", TRUE); newdlg->set(params); int custtypeid = newdlg->exec(); if ( (custtypeid != -1) && (custtypeid != XDialog::Rejected) ) { XSqlQuery infoq; infoq.prepare( "UPDATE custinfo " "SET cust_custtype_id=:custtype_id " "WHERE (cust_id=:cust_id);" ); infoq.bindValue(":cust_id", list()->id()); infoq.bindValue(":custtype_id", custtypeid); infoq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Setting Customer Type"), infoq, __FILE__, __LINE__)) return; omfgThis->sCustomersUpdated(list()->id(), TRUE); sFillList(); } } void customers::sDelete() { if (QMessageBox::question(this, tr("Delete Customer?"), tr("

    Are you sure that you want to completely " "delete the selected Customer?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM custinfo WHERE (cust_id=:cust_id);"); delq.bindValue(":cust_id", list()->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting"), delq, __FILE__, __LINE__)) return; omfgThis->sCustomersUpdated(list()->id(), TRUE); // TODO: TRUE or FALSE???? } void customers::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction("View...", this, SLOT(sView())); menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCustomerMasters")); menuItem = pMenu->addAction("Delete", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainCustomerMasters")); pMenu->addSeparator(); menuItem = pMenu->addAction("Reassign Customer Type", this, SLOT(sReassignCustomerType())); menuItem->setEnabled(_privileges->check("MaintainCustomerMasters")); } qt-client-4.1.0/guiclient/customers.h000066400000000000000000000016361217451700100176000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERS_H #define CUSTOMERS_H #include "guiclient.h" #include "display.h" class customers : public display { Q_OBJECT public: customers(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sNew(); virtual void sEdit(); virtual void sReassignCustomerType(); virtual void sView(); virtual void sDelete(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // CUSTOMERS_H qt-client-4.1.0/guiclient/cybersourceprocessor.cpp000066400000000000000000001240101217451700100223640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include "guiclient.h" #include "cybersourceprocessor.h" #include "version.h" #include "xmessageboxmessagehandler.h" #define DEBUG false /** @ingroup creditcards @class CyberSourceProcessor @brief The implementation of CyberSource-specific credit card handling */ #define CPDATA_NS "ns3" #define CPTP_NS "ns1" #define SOAP_ENC_NS "SOAP-ENC" #define SOAP_ENV_NS "SOAP-ENV" #define WSSE_NS "wsse" #define CPDATA_NSVAL "urn:schemas-cybersource-com:transaction-data-1.53" #define CPTP_NSVAL "urn:schemas-cybersource-com:transaction-data:TransactionProcessor" #define SOAP_ENC_NSVAL "http://schemas.xmlsoap.org/soap/encoding/" #define SOAP_ENV_NSVAL "http://schemas.xmlsoap.org/soap/envelope/" #define WSSE_NSVAL "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" // convenience function to add Content to the Parent node /* TODO: put this in a generic XMLCCProcessor, subclass of creditcardprocessor? make a generic XMLHelper class and make CyberSourceProcessor and YourPayProcessor inherit both CreditCardProcessor and XMLHelper? */ static QDomElement createChildTextNode(QDomElement parent, QString childName, QString content) { QDomElement child; child = parent.ownerDocument().createElement(childName); child.appendChild(parent.ownerDocument().createTextNode(content)); parent.appendChild(child); return child; } static QString get_r_ref(int pccpayid) { XSqlQuery refq; refq.prepare("SELECT ccpay_r_ref FROM ccpay WHERE ccpay_id=:ccpay_id;"); refq.bindValue(":ccpay_id", pccpayid); refq.exec(); if (refq.first()) return refq.value("ccpay_r_ref").toString(); return QString(); /* deal with errors if we learn that requestToken is required. else if (refq.lastError().type() != QSqlError::NoError) { _errorMsg = refq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } */ } CyberSourceProcessor::CyberSourceProcessor() : CreditCardProcessor() { _company = "CyberSource"; _extraHeaders.append(qMakePair(QString("Content-Type"), QString("text/xml; charset=uft-8; action='runTransaction'"))); _extraHeaders.append(qMakePair(QString("SOAPAction"), QString("runTransaction"))); _defaultLivePort = 0; _defaultLiveServer = "https://ics2ws.ic3.com/commerce/1.x/transactionProcessor"; _defaultTestPort = 0; _defaultTestServer = "https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor"; _msgHash.insert(-300, tr("The Merchant ID is required")); _msgHash.insert(-301, tr("The message sent to CyberSource was incomplete: %1")); _msgHash.insert(-302, tr("The message sent to CyberSource had invalid data in the following field: %1")); _msgHash.insert(-303, tr("CyberSource rejected this request (code %1)")); _msgHash.insert(-304, tr("CyberSource reports a general system failure")); _msgHash.insert(-305, tr("The Merchant ID %1 is too long")); _msgHash.insert(-306, tr("SOAP error (probably an xTuple ERP bug): %1")); _msgHash.insert(-307, tr("Error reading response XML: %1")); _msgHash.insert(-308, tr("CyberSource returned an error for this request (code %1)")); _msgHash.insert(-310, tr("The amount authorized was 0.")); _msgHash.insert( 310, tr("Only a portion of the total amount requested was authorized")); if (FraudCheckResult *b = avsCodeLookup('B')) { b->sev = NoMatch | PostalCode; b->text = tr("Street Address matches but Postal Code is not verified"); } _avsCodes.append(new FraudCheckResult('C', NoMatch | Address | PostalCode, tr("Street Address and Postal Code do not match"))); _avsCodes.append(new FraudCheckResult('D', Match, tr("Street Address and Postal Code match"))); if (FraudCheckResult *e = avsCodeLookup('E')) e->text = tr("AVS data are invalid or AVS not allowed for this card type"); _avsCodes.append(new FraudCheckResult('F', NoMatch | Name, tr("Card holder's name does not match but Postal Code matches"))); _avsCodes.append(new FraudCheckResult('H', NoMatch | Name, tr("Card holder's name does not match but Street Address and Postal Code match"))); _avsCodes.append(new FraudCheckResult('I', NotProcessed | Address, tr("Address not verified"))); _avsCodes.append(new FraudCheckResult('K', NoMatch | Address | PostalCode, tr("Card holder's name matches but Billing Street Address and Postal Code do not match"))); _avsCodes.append(new FraudCheckResult('L', NoMatch | Address, tr("Card holder's name and Billing Postal Code match but Street Address does not match"))); _avsCodes.append(new FraudCheckResult('M', Match, tr("Street Address and Postal Code match"))); _avsCodes.append(new FraudCheckResult('O', NoMatch | PostalCode, tr("Card holder's name and Billing Street Address match but Postal Code does not match"))); if (FraudCheckResult *p = avsCodeLookup('P')) { p->sev = NotProcessed | Address; p->text = tr("Postal Code matches but Street Address was not verified"); } _avsCodes.append(new FraudCheckResult('T', NoMatch | Name, tr("Card holder's name does not match but Street Address matches"))); _avsCodes.append(new FraudCheckResult('U', NotProcessed | Address, tr("Address information unavailable; either the US bank does not support non-US AVS or the AVS at a US bank is not functioning properly"))); _avsCodes.append(new FraudCheckResult('V', Match, tr("Card holder's name, Street Address, and Postal Code match"))); _avsCodes.append(new FraudCheckResult('1', Unsupported, tr("AVS is not supported for this processor or card type"))); _avsCodes.append(new FraudCheckResult('2', Invalid, tr("The processor returned an unrecognized AVS response"))); _cvvCodes.append(new FraudCheckResult('D', Suspicious, tr("The bank thinks this transaction is suspicious"))); _cvvCodes.append(new FraudCheckResult('I', NoMatch, tr("The CVV failed the processor's data validation check"))); _cvvCodes.append(new FraudCheckResult('1', Unsupported, tr("CVV is not supported by the card association"))); _cvvCodes.append(new FraudCheckResult('2', Invalid, tr("The processor returned an unrecognized CVV response"))); _cvvCodes.append(new FraudCheckResult('3', NotAvail, tr("The processor did not return a CVV result"))); _doc = 0; } CyberSourceProcessor::~CyberSourceProcessor() { if (_doc) { delete _doc; _doc = 0; } } int CyberSourceProcessor::buildCommon(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString & /*preforder*/, const CCTransaction ptranstype) { XSqlQuery csq; csq.prepare( "SELECT ccard_active," " formatbytea(decrypt(setbytea(ccard_number), setbytea(:key),'bf')) AS ccard_number," " formatccnumber(decrypt(setbytea(ccard_number),setbytea(:key),'bf')) AS ccard_number_x," " formatbytea(decrypt(setbytea(ccard_name), setbytea(:key),'bf')) AS ccard_name," " formatbytea(decrypt(setbytea(ccard_address1), setbytea(:key),'bf')) AS ccard_address1," " formatbytea(decrypt(setbytea(ccard_address2), setbytea(:key),'bf')) AS ccard_address2," " formatbytea(decrypt(setbytea(ccard_city), setbytea(:key),'bf')) AS ccard_city," " formatbytea(decrypt(setbytea(ccard_state), setbytea(:key),'bf')) AS ccard_state," " formatbytea(decrypt(setbytea(ccard_zip), setbytea(:key),'bf')) AS ccard_zip," " formatbytea(decrypt(setbytea(ccard_country), setbytea(:key),'bf')) AS ccard_country," " formatbytea(decrypt(setbytea(ccard_month_expired),setbytea(:key),'bf')) AS ccard_month_expired," " formatbytea(decrypt(setbytea(ccard_year_expired),setbytea(:key), 'bf')) AS ccard_year_expired," " ccard_type, cust_name, cntct_email" " FROM ccard" " JOIN custinfo ON (ccard_cust_id=cust_id)" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" "WHERE (ccard_id=:ccardid);"); csq.bindValue(":ccardid", pccardid); csq.bindValue(":key", omfgThis->_key); csq.exec(); if (csq.first()) { if (!csq.value("ccard_active").toBool()) { _errorMsg = errorMsg(-10); return -10; } } else if (csq.lastError().type() != QSqlError::NoError) { _errorMsg = csq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } if (_doc) delete _doc; _doc = new QDomDocument(); QDomNode xmlNode = _doc->createProcessingInstruction("xml", "version='1.0' " "encoding='UTF-8'"); _doc->appendChild(xmlNode); QDomElement envelope = _doc->createElement(SOAP_ENV_NS ":Envelope"); envelope.setAttribute("xmlns:" CPDATA_NS, CPDATA_NSVAL); envelope.setAttribute("xmlns:" CPTP_NS, CPTP_NSVAL); envelope.setAttribute("xmlns:" SOAP_ENC_NS, SOAP_ENC_NSVAL); envelope.setAttribute("xmlns:" SOAP_ENV_NS, SOAP_ENV_NSVAL); envelope.setAttribute("xmlns:" WSSE_NS, WSSE_NSVAL); _doc->appendChild(envelope); QDomElement header = _doc->createElement(SOAP_ENV_NS ":Header"); envelope.appendChild(header); QDomElement security = _doc->createElement(WSSE_NS ":Security"); security.setAttribute(SOAP_ENV_NS ":mustUnderstand", "1"); header.appendChild(security); QDomElement usernametoken = _doc->createElement(WSSE_NS ":UsernameToken"); security.appendChild(usernametoken); createChildTextNode(usernametoken, WSSE_NS ":Username", _metricsenc->value("CCLogin").toLower()); QDomElement password = createChildTextNode(usernametoken, WSSE_NS ":Password", _metricsenc->value("CCPassword")); password.setAttribute("Type", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"); QDomElement body = _doc->createElement(SOAP_ENV_NS ":Body"); envelope.appendChild(body); _requestMessage = _doc->createElement(CPDATA_NS ":requestMessage"); body.appendChild(_requestMessage); createChildTextNode(_requestMessage, CPDATA_NS ":merchantID", _metricsenc->value("CCLogin")); createChildTextNode(_requestMessage, CPDATA_NS ":merchantReferenceCode", pneworder); createChildTextNode(_requestMessage, CPDATA_NS ":clientLibrary", "xTuple ERP"); createChildTextNode(_requestMessage, CPDATA_NS ":clientLibraryVersion", _Version); createChildTextNode(_requestMessage, CPDATA_NS ":clientEnvironment", #ifdef Q_WS_MAC "Mac OS X" #elif defined Q_WS_WIN "Windows" #elif defined Q_WS_X11 "X Windows" #else "undefined Qt client" #endif ); QString country; if (ptranstype == Authorize || ptranstype == Charge || ptranstype == Credit) { country = csq.value("ccard_country").toString(); if (country.length() > 2) { XSqlQuery countryq; countryq.prepare("SELECT country_abbr FROM country WHERE country_name=:name;"); countryq.bindValue(":name", country); countryq.exec(); if (countryq.first()) country = countryq.value("country_abbr").toString(); else if (csq.lastError().type() != QSqlError::NoError) { _errorMsg = csq.lastError().databaseText(); return -1; } } QDomElement billto = _doc->createElement(CPDATA_NS ":billTo"); _requestMessage.appendChild(billto); QStringList name = csq.value("ccard_name").toString().split(QRegExp("\\s+")); createChildTextNode(billto, CPDATA_NS ":firstName", name.at(0).left(60)); createChildTextNode(billto, CPDATA_NS ":lastName", name.at(name.size() - 1).left(60)); createChildTextNode(billto, CPDATA_NS ":street1", csq.value("ccard_address1").toString().left(60)); createChildTextNode(billto, CPDATA_NS ":city", csq.value("ccard_city").toString().left(50)); createChildTextNode(billto, CPDATA_NS ":state", csq.value("ccard_state").toString().left(2)); createChildTextNode(billto, CPDATA_NS ":postalCode", csq.value("ccard_zip").toString().left(10)); createChildTextNode(billto, CPDATA_NS ":country", country.left(2)); createChildTextNode(billto, CPDATA_NS ":company", csq.value("cust_name").toString().left(40)); createChildTextNode(billto, CPDATA_NS ":email", csq.value("cntct_email").toString().left(255)); } if (ptranstype == Authorize || ptranstype == Reverse || ptranstype == Capture || ptranstype == Charge || ptranstype == Credit) { QDomElement purchasetotals = _doc->createElement(CPDATA_NS ":purchaseTotals"); _requestMessage.appendChild(purchasetotals); XSqlQuery currq; currq.prepare("SELECT curr_abbr FROM curr_symbol WHERE (curr_id=:currid);"); currq.bindValue(":currid", pcurrid); currq.exec(); if (currq.first()) createChildTextNode(purchasetotals, CPDATA_NS ":currency", currq.value("curr_abbr").toString()); else if (currq.lastError().type() != QSqlError::NoError) { _errorMsg = currq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } createChildTextNode(purchasetotals, CPDATA_NS ":grandTotalAmount", QString::number(pamount, 'f', 2)); } if (ptranstype == Authorize || ptranstype == Charge || ptranstype == Credit) { QString rawcardtype = csq.value("ccard_type").toString(); QString cardtype; if (rawcardtype == "A") cardtype = "003"; else if (rawcardtype == "D") cardtype = "004"; else if (rawcardtype == "M") cardtype = "002"; else if (rawcardtype == "V") cardtype = "001"; else if (rawcardtype == "Diners Club") cardtype = "005"; else if (rawcardtype == "Carte Blanche") cardtype = "006"; else if (rawcardtype == "JCB") cardtype = "007"; else cardtype = rawcardtype; QDomElement card = _doc->createElement(CPDATA_NS ":card"); _requestMessage.appendChild(card); QString accountNumber = csq.value("ccard_number").toString(); accountNumber.remove(QRegExp("[^0-9]")); QString month = csq.value("ccard_month_expired").toString(); if (month.length() == 1) month = "0" + month; createChildTextNode(card, CPDATA_NS ":accountNumber", accountNumber.left(20)); createChildTextNode(card, CPDATA_NS ":expirationMonth", month.left(2)); createChildTextNode(card, CPDATA_NS ":expirationYear", csq.value("ccard_year_expired").toString().left(4)); if (! pcvv.isEmpty()) createChildTextNode(card, CPDATA_NS ":cvNumber", pcvv.trimmed()); createChildTextNode(card, CPDATA_NS ":cardType", cardtype.left(3)); } if (DEBUG) qDebug("CS:buildCommon built %s\n", qPrintable(_doc->toString())); return 0; } int CyberSourceProcessor::doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("CS:doAuthorize(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = buildCommon(pccardid, pcvv, pamount, pcurrid, pneworder, preforder, Authorize); if (returnValue != 0) return returnValue; QDomElement auth = _doc->createElement(CPDATA_NS ":ccAuthService"); auth.setAttribute("run", "true"); _requestMessage.appendChild(auth); if (DEBUG) qDebug("CS::doAuthorize sending %s", qPrintable(_doc->toString())); QString response; returnValue = sendViaHTTP(_doc->toString(), response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, Authorize, pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int CyberSourceProcessor::doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("CS:doCharge(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = buildCommon(pccardid, pcvv, pamount, pcurrid, pneworder, preforder, Charge); if (returnValue != 0) return returnValue; QDomElement auth = _doc->createElement(CPDATA_NS ":ccAuthService"); auth.setAttribute("run", "true"); _requestMessage.appendChild(auth); QDomElement capture = _doc->createElement(CPDATA_NS ":ccCaptureService"); capture.setAttribute("run", "true"); _requestMessage.appendChild(capture); if (_metrics->value("CCAvsCheck") == "W" || _metrics->value("CCAvsCheck") == "X" || _metrics->value("CCCVVCheck") == "W" || _metrics->value("CCCVVCheck") == "X") { QDomElement rules = _doc->createElement(CPDATA_NS ":businessRules"); _requestMessage.appendChild(rules); if (_metrics->value("CCAvsCheck") == "W" || _metrics->value("CCAvsCheck") == "X") createChildTextNode(rules, CPDATA_NS ":ignoreAVSResult", "true"); if (_metrics->value("CCCVVCheck") == "W" || _metrics->value("CCCVVCheck") == "X") createChildTextNode(rules, CPDATA_NS ":ignoreCVResult", "true"); } if (DEBUG) qDebug("CS::doCharge sending %s", qPrintable(_doc->toString())); QString response; returnValue = sendViaHTTP(_doc->toString(), response); if (returnValue < 0) return returnValue; double amount = pamount; returnValue = handleResponse(response, pccardid, Charge, amount, pcurrid, pneworder, preforder, pccpayid, pparams); if (DEBUG) qDebug("CS:doCharge() returning %d", returnValue); return returnValue; } int CyberSourceProcessor::doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("CS:doChargePreauthorized(%d, pcvv, %f, %d, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = buildCommon(pccardid, pcvv, pamount, pcurrid, pneworder, preforder, Capture); if (returnValue != 0) return returnValue; QDomElement capture = _doc->createElement(CPDATA_NS ":ccCaptureService"); capture.setAttribute("run", "true"); _requestMessage.appendChild(capture); /* TODO: test server returns an XML parse error with it, passes without it QString requestToken = get_r_ref(pccpayid); if (! requestToken.isEmpty()) createChildTextNode(_requestMessage, CPDATA_NS ":orderRequestToken", requestToken); */ createChildTextNode(capture, CPDATA_NS ":authRequestID", preforder); if (DEBUG) qDebug("CS::doChargePreauthorized sending %s", qPrintable(_doc->toString())); QString response; returnValue = sendViaHTTP(_doc->toString(), response); if (returnValue < 0) return returnValue; double amount = pamount; returnValue = handleResponse(response, pccardid, Capture, amount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int CyberSourceProcessor::doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("CS:doCredit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = buildCommon(pccardid, pcvv, pamount, pcurrid, pneworder, preforder, Credit); if (returnValue != 0) return returnValue; QDomElement capture = _doc->createElement(CPDATA_NS ":ccCreditService"); capture.setAttribute("run", "true"); _requestMessage.appendChild(capture); createChildTextNode(capture, CPDATA_NS ":captureRequestID", preforder); QString requestToken = get_r_ref(pccpayid); if (! requestToken.isEmpty()) createChildTextNode(_requestMessage, CPDATA_NS ":orderRequestToken", requestToken); if (DEBUG) qDebug("CS::doCredit sending %s", qPrintable(_doc->toString())); QString response; returnValue = sendViaHTTP(_doc->toString(), response); if (returnValue < 0) return returnValue; double amount = pamount; returnValue = handleResponse(response, pccardid, Credit, amount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int CyberSourceProcessor::doReverseAuthorize(const int pccardid, const double pamount, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("CS::doReverseAuthorize(%d, %f, %d, %s, %s, %d, pparams", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); QString tmpErrorMsg = _errorMsg; int returnValue = buildCommon(pccardid, "-2", pamount, pcurrid, pneworder, preforder, Reverse); if (returnValue != 0) return returnValue; QDomElement reverse = _doc->createElement(CPDATA_NS ":CCAuthReversalService"); reverse.setAttribute("run", "true"); _requestMessage.appendChild(reverse); createChildTextNode(reverse, CPDATA_NS ":authRequestID", preforder); QString requestToken = get_r_ref(pccpayid); if (! requestToken.isEmpty()) createChildTextNode(_requestMessage, CPDATA_NS ":orderRequestToken", requestToken); if (DEBUG) qDebug("CS::doReverseAuthorize sending %s", qPrintable(_doc->toString())); QString response; returnValue = sendViaHTTP(_doc->toString(), response); _errorMsg = tmpErrorMsg; if (returnValue < 0) return returnValue; double amount = pamount; returnValue = handleResponse(response, pccardid, Reverse, amount, pcurrid, pneworder, preforder, pccpayid, pparams); if (! tmpErrorMsg.isEmpty()) _errorMsg = tmpErrorMsg; return returnValue; } int CyberSourceProcessor::doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("CS::doVoidPrevious(%d, pcvv, %f, %d, %s, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), qPrintable(papproval), pccpayid); QString requestId; XSqlQuery refq; refq.prepare("SELECT ccpay_r_ref FROM ccpay WHERE ccpay_id=:ccpay_id;"); refq.bindValue(":ccpay_id", pccpayid); refq.exec(); if (refq.first()) requestId = refq.value("ccpay_r_ref").toString(); else if (refq.lastError().type() != QSqlError::NoError) { _errorMsg = refq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } QString tmpErrorMsg = _errorMsg; int returnValue = buildCommon(pccardid, pcvv, pamount, pcurrid, pneworder, preforder, Void); if (returnValue != 0) return returnValue; QDomElement voidsvc = _doc->createElement(CPDATA_NS ":voidService"); voidsvc.setAttribute("run", "true"); _requestMessage.appendChild(voidsvc); createChildTextNode(voidsvc, CPDATA_NS ":voidRequestID", preforder); /* TODO: test server returns an XML parse error with it, passes without it QString requestToken = get_r_ref(pccpayid); if (! requestToken.isEmpty()) createChildTextNode(_requestMessage, CPDATA_NS ":orderRequestToken", requestToken); */ if (DEBUG) qDebug("CS::doVoidPrevious sending %s", qPrintable(_doc->toString())); QString response; returnValue = sendViaHTTP(_doc->toString(), response); _errorMsg = tmpErrorMsg; if (returnValue < 0) return returnValue; double amount = pamount; returnValue = handleResponse(response, pccardid, Void, amount, pcurrid, pneworder, preforder, pccpayid, pparams); if (! tmpErrorMsg.isEmpty()) _errorMsg = tmpErrorMsg; return returnValue; } /** @brief Return the result of extracting a given value from an XML response from CyberSource. The input query can specify a full or relative path within the XML stream. If it starts with a slash ('/') then it's treated as a full path. Otherwise it's treated as a relative path with respect to @c soap:Envelope/soap:Body/c:replyMessage Queries with relative paths always return the text() value. Queries with full paths must completely specify what they want returned. In either case, the query is wrapped with namespace handling. The xq parameter is expected to be an initialized QXmlQuery with focus already set on the XML to be queried. */ QVariant CyberSourceProcessor::xqresult(QXmlQuery *xq, QString query, QVariant::Type type) { if (DEBUG) qDebug("xqresult(%p, %s, %d)", xq, qPrintable(query), type); QVariant result; QString text; QString fullq = (query.startsWith("/") ? QString("{%3}") : QString("" "{/soap:Envelope/soap:Body/c:replyMessage/%3/text()}" "") ).arg(SOAP_ENV_NSVAL, CPDATA_NSVAL, query); xq->setQuery(fullq); if (xq->isValid() && type == QVariant::StringList) { QStringList listresult; if (xq->evaluateTo(&listresult)) { if (DEBUG) qDebug() << "xqresult() evaluateTo evaluated to" << listresult; result = listresult; } else if (xq->evaluateTo(&text)) { text = text.remove(QRegExp("]*>")).simplified(); result = text; } } else if (xq->isValid() && xq->evaluateTo(&text)) { text = text.remove(QRegExp("]*>")).simplified(); if (DEBUG) qDebug("xqresult() evaluated to %s", qPrintable(text)); bool ok = false; switch (type) { case QVariant::Bool: result = text.compare("true", Qt::CaseInsensitive); break; case QVariant::Date: case QVariant::DateTime: case QVariant::Time: { QDateTime tmp = QDateTime::fromString(text.left(19), Qt::ISODate); ok = tmp.isValid(); if (ok) { tmp.setTimeSpec(Qt::UTC); switch (type) { case QVariant::Date: result = tmp.date(); break; case QVariant::Time: result = tmp.time(); break; default: result = tmp; break; } } } break; case QVariant::Double: result = text.toDouble(&ok); break; case QVariant::Int: result = text.toInt(&ok); break; case QVariant::String: result = text; ok = true; break; default: result = text; break; } if (! ok) xq->messageHandler()->message(QtCriticalMsg, tr("Could not convert '%1' to %2") .arg(text, QVariant::typeToName(type)), tr("CyberSource XML response")); } if (DEBUG) qDebug("xqresult() returning %s", qPrintable(result.toString())); return result; } int CyberSourceProcessor::handleResponse(const QString &presponse, const int pccardid, const CCTransaction ptype, double &pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("CS::handleResponse(%s, %d, %d, %f, %d, %s, %d, pparams)", qPrintable(presponse), pccardid, ptype, pamount, pcurrid, qPrintable(preforder), pccpayid); QString r_approved; QString r_avs; QString r_code; QString r_cvv; QString r_error; QString r_message; QString r_ordernum; QString r_ref; QString r_shipping; QString r_tax; QString r_tdate; QString status; int reasonCode = -1; QStringList missing; QStringList invalid; int returnValue = 0; QString requestedAmtStr; QString approvedAmtStr; XMessageBoxMessageHandler msghandler(this); msghandler.setTitle(tr("CyberSource XML Error")); msghandler.setPrefix(tr("

    There was an error processing the response from " "CyberSource, line %1 column %2: %3
    (%4)")); QXmlQuery valueq; valueq.setMessageHandler(&msghandler); if (! valueq.setFocus(presponse)) { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } else { QVariant fieldVal; fieldVal = xqresult(&valueq, "/soap:Envelope/soap:Body/soap:Fault/faultstring/text()"); if (! valueq.isValid()) { _errorMsg = errorMsg(-306).arg(msghandler.lastMessage()); returnValue = -306; } else if (fieldVal.isValid() && ! fieldVal.toString().isEmpty()) { _errorMsg = errorMsg(-306).arg(fieldVal.toString()); returnValue = -306; } else { fieldVal = xqresult(&valueq, "c:reasonCode", QVariant::Int); if (valueq.isValid() && fieldVal.isValid()) reasonCode = fieldVal.toInt(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } fieldVal = xqresult(&valueq, "c:decision", QVariant::String); if (valueq.isValid() && fieldVal.isValid()) r_approved = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } fieldVal = xqresult(&valueq, "c:requestToken"); if (valueq.isValid() && fieldVal.isValid()) { preforder = fieldVal.toString(); r_ref = fieldVal.toString(); } else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } fieldVal = xqresult(&valueq, "c:requestID"); if (valueq.isValid() && fieldVal.isValid()) r_ordernum = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } if (r_approved == "REJECT") { fieldVal = xqresult(&valueq, "/soap:Envelope/soap:Body/c:replyMessage/c:invalidField", QVariant::StringList); if (valueq.isValid() && fieldVal.isValid()) invalid = fieldVal.toStringList(); fieldVal = xqresult(&valueq, "/soap:Envelope/soap:Body/c:replyMessage/c:missingField", QVariant::StringList); if (valueq.isValid() && fieldVal.isValid()) missing = fieldVal.toStringList(); } else if (r_approved == "ACCEPT") { switch (ptype) { case Authorize: { fieldVal = xqresult(&valueq, "c:ccAuthReply/c:amount"); if (valueq.isValid() && fieldVal.isValid()) approvedAmtStr = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } fieldVal = xqresult(&valueq, "c:ccAuthReply/c:authorizationCode"); if (valueq.isValid() && fieldVal.isValid()) r_code = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } fieldVal = xqresult(&valueq, "c:ccAuthReply/c:authorizedDateTime", QVariant::DateTime); if (valueq.isValid() && fieldVal.isValid()) r_tdate = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } // not always present fieldVal = xqresult(&valueq, "c:ccAuthReply/c:requestAmount"); if (valueq.isValid() && fieldVal.isValid()) requestedAmtStr = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } } break; case Reverse: { fieldVal = xqresult(&valueq, "c:ccAuthReversalReply/c:amount"); if (valueq.isValid() && fieldVal.isValid()) approvedAmtStr = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } fieldVal = xqresult(&valueq, "c:ccAuthReversalReply/c:authorizationCode"); if (valueq.isValid() && fieldVal.isValid()) r_code = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } } break; case Capture: { fieldVal = xqresult(&valueq, "c:ccCaptureReply/c:amount"); if (valueq.isValid() && fieldVal.isValid()) approvedAmtStr = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } } break; case Charge: break; case Credit: { fieldVal = xqresult(&valueq, "c:ccCreditReply/c:amount"); if (valueq.isValid() && fieldVal.isValid()) approvedAmtStr = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } } break; case Void: { fieldVal = xqresult(&valueq, "c:ccVoidReply/c:amount"); if (valueq.isValid() && fieldVal.isValid()) approvedAmtStr = fieldVal.toString(); else { _errorMsg = errorMsg(-307).arg(msghandler.lastMessage()); returnValue = -307; } } break; } } // ACCEPT or REJECT; the reasonCode switch below handles ERROR fieldVal = xqresult(&valueq, "c:ccAuthReply/c:avsCode"); if (valueq.isValid() && fieldVal.isValid()) r_avs = fieldVal.toString(); fieldVal = xqresult(&valueq, "c:ccAuthReply/c:cvCode"); if (valueq.isValid() && fieldVal.isValid()) r_cvv = fieldVal.toString(); } } switch (reasonCode) { case 100: _errorMsg = r_message = errorMsg(0).arg(r_approved); break; case 101: _errorMsg = r_message = errorMsg(-301).arg(missing.join(tr(", "))); returnValue = -301; break; case 102: { returnValue = -302; if (r_avs == "2") _errorMsg = r_message = avsCodeLookup('2')->text; else if (r_cvv == "2") _errorMsg = r_message = cvvCodeLookup('2')->text; else if (invalid.isEmpty()) _errorMsg = r_message = errorMsg(returnValue).arg(tr("[no invalid fields listed]")); else _errorMsg = r_message = errorMsg(returnValue).arg(invalid.join(tr(", "))); } break; case 110: // partial approval { pamount = approvedAmtStr.toDouble(); ParameterList reverseParams; int reverseResult = doReverseAuthorize(pccardid, pamount, pcurrid, pneworder, preforder, pccpayid, reverseParams); if (reverseResult) returnValue = reverseResult; else if (pamount == 0) { _errorMsg = r_message = errorMsg(-310).arg(r_approved); returnValue = -310; } else { _errorMsg = r_message = errorMsg(310).arg(r_approved); returnValue = 310; } } break; case 150: _errorMsg = r_message = errorMsg(-304); break; case -1: // assume _errorMsg and returnValue have already been set break; default: returnValue = (r_approved == "REJECT") ? -303 : (r_approved == "ERROR") ? -308 : -95; _errorMsg = r_message = errorMsg(returnValue).arg(reasonCode) .arg(_company); break; } if (r_approved == "ACCEPT" || r_approved == "REVIEW") { _errorMsg = errorMsg(0).arg(r_code); if (ptype == Authorize) status = "A"; else if (ptype == Void) status = "V"; else status = "C"; } else if (r_approved == "REJECT") { _errorMsg = errorMsg(-90).arg(r_message); if (returnValue >= 0) returnValue = -90; status = "D"; } else if (r_approved == "ERROR") { r_error = r_message; _errorMsg = errorMsg(-12).arg(r_message).arg(_company); returnValue = -12; status = "X"; } else // assume _errorMsg and returnValue have already been set { r_error = _errorMsg; status = "X"; } // TODO: move this up to CreditCardProcessor::fraudChecks() // TODO: change avs and cvv failure check configuration FraudCheckResult *avsresult = avsCodeLookup(r_avs.at(0)); if (avsresult) { bool addrMustMatch = _metrics->value("CCAvsAddr").contains("N"); bool addrMustBeAvail = _metrics->value("CCAvsAddr").contains("X"); bool zipMustMatch = _metrics->value("CCAvsZip").contains("N"); bool zipMustBeAvail = _metrics->value("CCAvsZip").contains("X"); if (avsresult->sev & Name & NoMatch) _passedAvs = false; else if ((avsresult->sev & Address & NoMatch) && addrMustMatch) _passedAvs = false; else if ((avsresult->sev & Address & NotAvail) && addrMustBeAvail) _passedAvs = false; else if ((avsresult->sev & PostalCode & NoMatch) && zipMustMatch) _passedAvs = false; else if ((avsresult->sev & PostalCode & NotAvail) && zipMustBeAvail) _passedAvs = false; else if (avsresult->sev != Match) _passedAvs = false; else _passedAvs = true; } else { _passedAvs = true; } FraudCheckResult *cvvresult = cvvCodeLookup(r_cvv.at(0)); if (cvvresult) { bool cvvMustMatch = _metrics->value("CCCVVErrors").contains("N"); bool cvvMustBeProcessed = _metrics->value("CCCVVErrors").contains("P"); bool cvvMustBeOnCard = _metrics->value("CCCVVErrors").contains("S"); bool cvvIssuerMustBeValid = _metrics->value("CCCVVErrors").contains("U"); if ((cvvresult->sev & NoMatch) && cvvMustMatch) _passedCvv = false; else if ((cvvresult->sev & NotProcessed) && cvvMustBeProcessed) _passedCvv = false; else if ((cvvresult->sev & NotAvail) && cvvMustBeOnCard) _passedCvv = false; else if ((cvvresult->sev & IssuerNotCertified) && cvvIssuerMustBeValid) _passedCvv = false; else if (cvvresult->sev != Match) _passedCvv = false; else _passedCvv = true; } else { _passedCvv = true; } if (DEBUG) qDebug("CS::%s _passedAvs %d\t%s _passedCvv %d", qPrintable(r_avs), _passedAvs, qPrintable(r_cvv), _passedCvv); // end TODO if (r_approved.isEmpty() && ! r_message.isEmpty()) { _errorMsg = errorMsg(-95).arg(r_message).arg(_company); returnValue = -95; status = "X"; } else if (r_approved.isEmpty()) { _errorMsg = errorMsg(-100).arg(r_error).arg(r_message).arg(presponse); returnValue = -100; status = "X"; } pparams.append("ccard_id", pccardid); pparams.append("currid", pcurrid); pparams.append("auth_charge", typeToCode(ptype)); pparams.append("type", typeToCode(ptype)); pparams.append("reforder", (preforder.isEmpty()) ? pneworder : preforder); pparams.append("status", status); pparams.append("avs", r_avs); pparams.append("ordernum", pneworder); pparams.append("xactionid", r_ordernum); pparams.append("error", r_error); pparams.append("approved", r_approved); pparams.append("code", r_code); pparams.append("shipping", r_shipping); pparams.append("tax", r_tax); pparams.append("ref", r_ref); pparams.append("message", r_message); pparams.append("tdate", r_tdate); pparams.append("auth", QVariant(ptype == Authorize)); if (DEBUG) qDebug("CS::r_error.isEmpty() = %d", r_error.isEmpty()); if (returnValue >= 0) pparams.append("amount", pamount); else pparams.append("amount", 0); // no money changed hands this attempt if (DEBUG) qDebug("CS::handleResponse returning %d %s", returnValue, qPrintable(errorMsg())); return returnValue; } int CyberSourceProcessor::doTestConfiguration() { if (DEBUG) qDebug("CS::doTestConfiguration() entered"); int returnValue = 0; if (_metricsenc->value("CCLogin").isEmpty()) { _errorMsg = errorMsg(-300); returnValue = -300; } else if (_metricsenc->value("CCLogin").size() > 30) { _errorMsg = errorMsg(-305).arg(_metricsenc->value("CCLogin")); returnValue = -305; } if (DEBUG) qDebug("CS::doTestConfiguration() returning %d", returnValue); return returnValue; } bool CyberSourceProcessor::handlesCreditCards() { return true; } qt-client-4.1.0/guiclient/cybersourceprocessor.h000066400000000000000000000055021217451700100220350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CYBERSOURCEPROCESSOR_H #define CYBERSOURCEPROCESSOR_H #include #include #include #include #include "creditcardprocessor.h" class QDomDocument; class QXmlQuery; class CyberSourceProcessor : public CreditCardProcessor { Q_OBJECT public: CyberSourceProcessor(); virtual ~CyberSourceProcessor(); protected: virtual int buildCommon(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, const CCTransaction ptranstype); virtual int doTestConfiguration(); virtual int doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams); virtual int doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams); virtual int doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doReverseAuthorize(const int pccardid, const double pamount, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams); virtual int doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams); virtual bool handlesCreditCards(); virtual int handleResponse(const QString &presponse, const int pccardid, const CCTransaction ptype, double &pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual QVariant xqresult(QXmlQuery *xq, QString query, QVariant::Type type = QVariant::String); QDomDocument *_doc; QDomElement _requestMessage; }; #endif qt-client-4.1.0/guiclient/databaseInformation.cpp000066400000000000000000000074031217451700100220570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "databaseInformation.h" #include #include #include "xtupleproductkey.h" databaseInformation::databaseInformation(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { Q_UNUSED(modal); XSqlQuery databasedatabaseInformation; setupUi(this); if (name) setObjectName(name); QString server; QString database; QString port; if(_metrics->value("Application") != "PostBooks") { XTupleProductKey pk(_metrics->value("RegistrationKey")); if(pk.valid()) { if(pk.users() == 0) _numOfServerLicencesLit->setText(tr("Open")); else _numOfServerLicencesLit->setText(QString("%1").arg(pk.users())); } else _numOfServerLicencesLit->setText(tr("Unknown")); } else _forceLicense->hide(); // doesn't apply to postbooks _description->setText(_metrics->value("DatabaseName")); _comments->setText(_metrics->value("DatabaseComments")); _version->setText(_metrics->value("ServerVersion")); _patch->setText(_metrics->value("ServerPatchVersion")); _disallowMismatchClient->setChecked(_metrics->boolean("DisallowMismatchClientVersion")); _forceLicense->setChecked(_metrics->boolean("ForceLicenseLimit")); QString access = _metrics->value("AllowedUserLogins"); if("AdminOnly" == access) _access->setCurrentIndex(1); else if("Any" == access) _access->setCurrentIndex(2); else _access->setCurrentIndex(0); int val = _metrics->value("updateTickInterval").toInt(); if(val < 1) val = 1; _interval->setValue(val); QString protocol; parseDatabaseURL(omfgThis->databaseURL(), protocol, server, database, port); _application->setText(_metrics->value("Application")); _server->setText(server); _name->setText(database); _disableAutoComplete->setChecked(_metrics->boolean("DisableAutoComplete")); databasedatabaseInformation.exec( "SELECT numOfDatabaseUsers() AS databaseusers," " numOfServerUsers() AS serverusers;" ); if (databasedatabaseInformation.first()) { _numOfDatabaseUsers->setText(databasedatabaseInformation.value("databaseusers").toString()); _numOfServerUsers->setText(databasedatabaseInformation.value("serverusers").toString()); } // ToDo if (!_privileges->check("ConfigDatabaseInfo")) { _description->setEnabled(FALSE); _comments->setEnabled(FALSE); } } databaseInformation::~databaseInformation() { // no need to delete child widgets, Qt does it all for us } void databaseInformation::languageChange() { retranslateUi(this); } bool databaseInformation::sSave() { emit saving(); _metrics->set("DatabaseName", _description->text().trimmed()); _metrics->set("DatabaseComments", _comments->toPlainText().trimmed()); _metrics->set("DisallowMismatchClientVersion", _disallowMismatchClient->isChecked()); _metrics->set("ForceLicenseLimit", _forceLicense->isChecked()); _metrics->set("updateTickInterval", _interval->value()); if(_access->currentIndex() == 1) _metrics->set("AllowedUserLogins", QString("AdminOnly")); else if(_access->currentIndex() == 2) _metrics->set("AllowedUserLogins", QString("Any")); else _metrics->set("AllowedUserLogins", QString("ActiveOnly")); _metrics->set("DisableAutoComplete", _disableAutoComplete->isChecked()); _metrics->load(); omfgThis->setWindowTitle(); return true; } qt-client-4.1.0/guiclient/databaseInformation.h000066400000000000000000000017401217451700100215220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DATABASEINFORMATION_H #define DATABASEINFORMATION_H #include "guiclient.h" #include "xabstractconfigure.h" #include "ui_databaseInformation.h" class databaseInformation : public XAbstractConfigure, public Ui::databaseInformation { Q_OBJECT public: databaseInformation(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~databaseInformation(); protected slots: virtual void languageChange(); virtual bool sSave(); signals: void saving(); }; #endif // DATABASEINFORMATION_H qt-client-4.1.0/guiclient/databaseInformation.ui000066400000000000000000000352061217451700100217140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. databaseInformation 0 0 593 521 Database Information Database &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 Qt::Vertical QSizePolicy::Expanding 20 0 0 Application: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Server Address: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Database Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Database Version: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Patch: 0 0 Auto Update Signal &Interval: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _interval 1 999 0 0 minutes Disallow mismatched client versions Access Mode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _access Active Users Only Admin Users Only (Maintenance Mode) Any Users not Inactive Qt::Horizontal 0 20 0 1 QFrame::NoFrame QFrame::Plain 0 0 C&omments: _comments 0 7 5 0 Number of Database Users: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Number of Server Users: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 Qt::Vertical QSizePolicy::Expanding 20 0 5 Number of Server Licenses: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Open Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 105 16 Disable Auto Completer List Do not allow user logins that exceed licensed user count. XLineEdit QLineEdit

    xlineedit.h
    1 XTextEdit QTextEdit
    xtextedit.h
    _description _interval _disallowMismatchClient _disableAutoComplete _forceLicense _access _comments qt-client-4.1.0/guiclient/deletePlannedOrder.cpp000066400000000000000000000034601217451700100216440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "deletePlannedOrder.h" #include #include "plCluster.h" deletePlannedOrder::deletePlannedOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_planord, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); _captive = FALSE; } deletePlannedOrder::~deletePlannedOrder() { // no need to delete child widgets, Qt does it all for us } void deletePlannedOrder::languageChange() { retranslateUi(this); } enum SetResponse deletePlannedOrder::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("planord_id", &valid); if (valid) { _planord->setId(param.toInt()); _planord->setReadOnly(TRUE); } return NoError; } void deletePlannedOrder::sDelete() { XSqlQuery deleteDelete; deleteDelete.prepare( "SELECT deletePlannedOrder(:planord_id, :deleteChildren);" ); deleteDelete.bindValue(":planord_id", _planord->id()); deleteDelete.bindValue(":deleteChildren", QVariant(_deleteChildren->isChecked())); deleteDelete.exec(); if (_captive) accept(); else { _planord->setId(-1); _close->setText(tr("&Close")); _planord->setFocus(); } } qt-client-4.1.0/guiclient/deletePlannedOrder.h000066400000000000000000000020531217451700100213060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DELETEPLANNEDORDER_H #define DELETEPLANNEDORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_deletePlannedOrder.h" class deletePlannedOrder : public XDialog, public Ui::deletePlannedOrder { Q_OBJECT public: deletePlannedOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~deletePlannedOrder(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); protected slots: virtual void languageChange(); virtual void sDelete(); private: bool _captive; }; #endif // DELETEPLANNEDORDER_H qt-client-4.1.0/guiclient/deletePlannedOrder.ui000066400000000000000000000144321217451700100215000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. deletePlannedOrder 0 0 463 182 Delete Planned Order 5 0 0 5 0 7 290 130 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 0 5 Cancel false &Delete true Qt::Vertical 20 20 0 0 Delete &Child Orders Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 0 PlanOrdCluster QWidget
    plCluster.h
    0
    _planord _deleteChildren _delete _close _close clicked() deletePlannedOrder reject() 20 20 20 20 _planord valid(bool) _delete setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/deletePlannedOrdersByPlannerCode.cpp000066400000000000000000000054631217451700100244420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "deletePlannedOrdersByPlannerCode.h" #include #include deletePlannedOrdersByPlannerCode::deletePlannedOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _captive = FALSE; _plannerCode->setType(ParameterGroup::PlannerCode); } deletePlannedOrdersByPlannerCode::~deletePlannedOrdersByPlannerCode() { // no need to delete child widgets, Qt does it all for us } void deletePlannedOrdersByPlannerCode::languageChange() { retranslateUi(this); } void deletePlannedOrdersByPlannerCode::sDelete() { XSqlQuery deleteDelete; if (!_cutoffDate->isValid()) { QMessageBox::critical( this, tr("Enter Cut Off Date"), tr( "You must enter a cut off date for the Planned Orders\n" "to be deleted." ) ); _cutoffDate->setFocus(); return; } if (!(_both->isChecked() || _mps->isChecked() || _mrp->isChecked())) { QMessageBox::critical( this, tr("Select Planning System"), tr("You must select which Planning System(s) to delete from.") ); return; } QString sql = "SELECT deletePlannedOrder(planord_id, :deleteChildren) " "FROM planord, itemsite " "WHERE ( (planord_itemsite_id=itemsite_id)" " AND (planord_startdate<=:cutOffDate)"; if (!_deleteFirmed->isChecked()) sql += " AND (NOT planord_firm)"; if (_plannerCode->isSelected()) sql += " AND (itemsite_plancode_id=:plancode_id)"; else if (_plannerCode->isPattern()) sql + " AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ :plancode_pattern)))"; if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_mps->isChecked()) sql += " AND (planord_mps)"; else if (_mrp->isChecked()) sql += " AND (NOT planord_mps)"; sql += ");"; deleteDelete.prepare(sql); deleteDelete.bindValue(":deleteChildren", QVariant(_deleteChildren->isChecked())); deleteDelete.bindValue(":cutOffDate", _cutoffDate->date()); _warehouse->bindValue(deleteDelete); _plannerCode->bindValue(deleteDelete); deleteDelete.exec(); accept(); } qt-client-4.1.0/guiclient/deletePlannedOrdersByPlannerCode.h000066400000000000000000000021261217451700100241000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DELETEPLANNEDORDERSBYPLANNERCODE_H #define DELETEPLANNEDORDERSBYPLANNERCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_deletePlannedOrdersByPlannerCode.h" class deletePlannedOrdersByPlannerCode : public XDialog, public Ui::deletePlannedOrdersByPlannerCode { Q_OBJECT public: deletePlannedOrdersByPlannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~deletePlannedOrdersByPlannerCode(); public slots: virtual void sDelete(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // DELETEPLANNEDORDERSBYPLANNERCODE_H qt-client-4.1.0/guiclient/deletePlannedOrdersByPlannerCode.ui000066400000000000000000000227021217451700100242700ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. deletePlannedOrdersByPlannerCode 0 0 418 378 418 378 Delete Planned Orders by Planner Code 12 12 Qt::TabFocus false Qt::TabFocus false Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Delete Firmed Orders Delete Child Orders Planning System 12 MPS and MRP MPS MRP Qt::Horizontal 40 20 Qt::Horizontal QSizePolicy::Expanding 0 10 0 0 0 0 &Cancel &Delete true true Qt::Vertical 20 20 Qt::Vertical QSizePolicy::Expanding 206 0 DLineEdit QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _plannerCode _warehouse _deleteFirmed _deleteChildren _both _mps _mrp _delete _close _close clicked() deletePlannedOrdersByPlannerCode reject() 532 27 20 20
    qt-client-4.1.0/guiclient/department.cpp000066400000000000000000000113401217451700100202430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "department.h" #include #include #include department::department(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); _deptid = -1; } department::~department() { // no need to delete child widgets, Qt does it all for us } void department::languageChange() { retranslateUi(this); } enum SetResponse department::set(const ParameterList& pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("dept_id", &valid); if (valid) { _deptid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(false); _name->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void department::sSave() { XSqlQuery departmentSave; QString number = _number->text().trimmed().toUpper(); if (number.isEmpty()) { QMessageBox::critical(this, tr("Cannot Save Department"), tr("You must enter a Department Number")); _number->setFocus(); return; } if (_name->text().trimmed().isEmpty()) { QMessageBox::critical(this, tr("Cannot Save Department"), tr("You must enter a Department Name")); _name->setFocus(); return; } departmentSave.prepare("SELECT dept_id" " FROM dept" " WHERE((dept_id != :dept_id)" " AND (dept_number=:dept_number));"); departmentSave.bindValue(":dept_id", _deptid); departmentSave.bindValue(":dept_number", number); departmentSave.exec(); if(departmentSave.first()) { QMessageBox::critical(this, tr("Cannot Save Department"), tr("The Number you entered already exists. Please choose a different Number.")); return; } if (_mode == cNew) { departmentSave.exec("SELECT NEXTVAL('dept_dept_id_seq') AS dept_id;"); if (departmentSave.first()) _deptid = departmentSave.value("dept_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2\n\n%3") .arg(__FILE__) .arg(__LINE__) .arg(departmentSave.lastError().databaseText())); return; } departmentSave.prepare("INSERT INTO dept ( dept_id, dept_number, dept_name ) " " VALUES (:dept_id, :dept_number, :dept_name );"); } else if (_mode == cEdit) { departmentSave.prepare("UPDATE dept " "SET dept_id=:dept_id, " " dept_number=:dept_number, " " dept_name=:dept_name " "WHERE (dept_id=:dept_id);"); } departmentSave.bindValue(":dept_id", _deptid); departmentSave.bindValue(":dept_number", number); departmentSave.bindValue(":dept_name", _name->text().trimmed()); departmentSave.exec(); if (departmentSave.lastError().type() != QSqlError::NoError) { systemError(this, tr("A System Error occurred at %1::%2\n\n%3") .arg(__FILE__) .arg(__LINE__) .arg(departmentSave.lastError().databaseText())); return; } done(_deptid); } void department::sClose() { close(); } void department::populate() { XSqlQuery departmentpopulate; departmentpopulate.prepare("SELECT dept_number, dept_name " "FROM dept " "WHERE (dept_id=:dept_id);"); departmentpopulate.bindValue(":dept_id", _deptid); departmentpopulate.exec(); if (departmentpopulate.first()) { _number->setText(departmentpopulate.value("dept_number")); _name->setText(departmentpopulate.value("dept_name")); } else systemError(this, tr("A System Error occurred at %1::%2\n\n%3") .arg(__FILE__) .arg(__LINE__) .arg(departmentpopulate.lastError().databaseText())); } qt-client-4.1.0/guiclient/department.h000066400000000000000000000020361217451700100177120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DEPARTMENT_H #define DEPARTMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_department.h" class department : public XDialog, public Ui::department { Q_OBJECT public: department(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~department(); public slots: virtual SetResponse set( const ParameterList & ); virtual void sSave(); virtual void sClose(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _deptid; }; #endif // DEPARTMENT_H qt-client-4.1.0/guiclient/department.ui000066400000000000000000000060131217451700100200770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. department 0 0 384 100 Department Department Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Department Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _number _name parameter.h
    qt-client-4.1.0/guiclient/departments.cpp000066400000000000000000000102231217451700100204250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "departments.h" #include #include #include #include #include #include #include "department.h" departments::departments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deptList, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); _deptList->addColumn(tr("Dept. Number"),_userColumn, Qt::AlignLeft, true, "dept_number"); _deptList->addColumn(tr("Dept. Name"), -1, Qt::AlignLeft, true, "dept_name"); if (_privileges->check("MaintainDepartments")) { connect(_deptList, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_deptList, SIGNAL(valid(bool)), _delete,SLOT(setEnabled(bool))); connect(_deptList, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(false); _edit->setEnabled(false); _delete->setEnabled(false); connect(_deptList, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(_deptList, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); sFillList(); } departments::~departments() { // no need to delete child widgets, Qt does it all for us } void departments::languageChange() { retranslateUi(this); } void departments::sClose() { close(); } void departments::sPrint() { orReport report("DepartmentsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void departments::sNew() { ParameterList params; params.append("mode", "new"); department newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); //if (newdlg.exec() != XDialog::Rejected) sFillList(); } void departments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("dept_id", _deptList->id()); department newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); //if (newdlg.exec() != XDialog::Rejected) sFillList(); } void departments::sView() { ParameterList params; params.append("mode", "view"); params.append("dept_id", _deptList->id()); department* newdlg = new department(this, "", TRUE); newdlg->set(params); newdlg->show(); } void departments::sDelete() { XSqlQuery departmentsDelete; departmentsDelete.prepare("DELETE FROM dept WHERE dept_id = :dept_id;"); departmentsDelete.bindValue(":dept_id", _deptList->id()); departmentsDelete.exec(); if (departmentsDelete.lastError().type() != QSqlError::NoError) systemError(this, tr("A System Error occurred at %1::%2\n\n%3") .arg(__FILE__) .arg(__LINE__) .arg(departmentsDelete.lastError().databaseText())); sFillList(); } void departments::sFillList() { _deptList->populate("SELECT dept_id, dept_number, dept_name " "FROM dept " "ORDER BY dept_number;"); } void departments::sPopulateMenu(QMenu *pMenu ) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit"), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainDepartments")); menuItem = pMenu->addAction(tr("View"), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("ViewDepartments") || _privileges->check("MaintainDepartments")); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainDepartments")); } qt-client-4.1.0/guiclient/departments.h000066400000000000000000000021241217451700100200730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DEPARTMENTS_H #define DEPARTMENTS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_departments.h" class departments : public XWidget, public Ui::departments { Q_OBJECT public: departments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~departments(); public slots: virtual void sClose(); virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); protected slots: virtual void languageChange(); }; #endif // DEPARTMENTS_H qt-client-4.1.0/guiclient/departments.ui000066400000000000000000000067611217451700100202740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. departments 0 0 600 400 List Departments 0 Departments: Close Print Qt::Vertical QSizePolicy::Preferred 20 5 New Edit View Delete Qt::Vertical QSizePolicy::Expanding 21 140 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    parameter.h
    qt-client-4.1.0/guiclient/dictionaries.cpp000066400000000000000000000116411217451700100205610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dictionaries.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include dictionaries::dictionaries(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _state = Idle; nwam = new QNetworkAccessManager(this); _nwrep = 0; connect(nwam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*))); connect(_button, SIGNAL(clicked()), this, SLOT(sAction())); langext = QLocale().name().toLower(); } dictionaries::~dictionaries() { // no need to delete child widgets, Qt does it all for us } void dictionaries::languageChange() { retranslateUi(this); } void dictionaries::finished(QNetworkReply * nwrep) { if(nwrep->header(QNetworkRequest::LocationHeader).isValid()) { QNetworkReply * newrep = nwam->get(QNetworkRequest(QUrl(nwrep->header(QNetworkRequest::LocationHeader).toString()))); connect(newrep, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); _nwrep = newrep; } else { if(nwrep->error() == QNetworkReply::NoError) { QByteArray ba = nwrep->readAll(); if(!ba.isEmpty()) { QDir dir(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); if(!dir.exists()) dir.mkpath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); QFile file(QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/spell." + langext + ".tar.gz"); if(file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { file.write(ba); file.close(); QByteArray data = gunzipFile(file.fileName()); if(!data.isEmpty()) { TarFile *_files = new TarFile(data); if(_files->isValid()) { bool error = false; QMapIterator i(_files->_list); while (i.hasNext()) { i.next(); //cout << i.key() << ": " << i.value() << endl; QFile ff(QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/" + i.key()); if(ff.open(QIODevice::WriteOnly | QIODevice::Truncate)) { ff.write(i.value()); ff.close(); } else { error = true; } } if(error) { _label->setText(tr("Could not save one or more files.")); } else { _label->setText(tr("Dictionaries downloaded.")); xtHelp::reload(); } } else { _label->setText(tr("Could not read archive format.")); } delete _files; } else { _label->setText(tr("Could not uncompress file.")); } } else { _label->setText(tr("Could not save file.")); } } else { _label->setText(tr("No dictionary is currently available.")); } } else { qDebug() << "Error: " << nwrep->error(); _label->setText(tr("Could not retrieve dictionaries at this time.")); } _progress->setRange(0, 100); _progress->setValue(100); _button->setText(tr("Start")); _state = Idle; } if(nwrep == _nwrep) _nwrep = 0; nwrep->deleteLater(); } void dictionaries::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { if(bytesTotal == -1) bytesTotal = 5000000; // chose some number that is reasonable _progress->setRange(0, bytesTotal); _progress->setValue(bytesReceived); } void dictionaries::sAction() { if(_state == Busy) { if(_nwrep) { _nwrep->abort(); _nwrep->deleteLater(); _nwrep = 0; } _button->setText(tr("Start")); _state = Idle; } else { _nwrep = nwam->get(QNetworkRequest(QUrl("http://www.xtuple.org/xttranslate/guiexport/spell/" + langext + "/current"))); connect(_nwrep, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); _label->setText(tr("Downloading...")); _button->setText(tr("Cancel")); _state = Busy; } } qt-client-4.1.0/guiclient/dictionaries.h000066400000000000000000000022511217451700100202230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DICTIONARIES_H #define DICTIONARIES_H #include "guiclient.h" #include "xwidget.h" #include "ui_dictionaries.h" class QNetworkAccessManager; class QNetworkReply; class dictionaries : public XWidget, public Ui::dictionaries { Q_OBJECT enum State { Idle = 0, Busy }; public: dictionaries(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dictionaries(); public slots: virtual void sAction(); protected slots: virtual void languageChange(); virtual void finished(QNetworkReply*); virtual void downloadProgress(qint64, qint64); private: QString langext; State _state; QNetworkAccessManager * nwam; QNetworkReply * _nwrep; }; #endif // DICTIONARIES_H qt-client-4.1.0/guiclient/dictionaries.ui000066400000000000000000000066521217451700100204220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dictionaries 0 0 312 102 Dictionaries Check for available spell check dictionaries? Qt::Horizontal 40 20 1 0 100 0 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Start Qt::Horizontal 40 20 Qt::Vertical 20 15 qt-client-4.1.0/guiclient/display.cpp000066400000000000000000000535631217451700100175620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "characteristic.h" #include "display.h" #include "xlineedit.h" #include "ui_display.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../scriptapi/parameterlistsetup.h" class displayPrivate : public Ui::display { public: displayPrivate(::display * parent) : _parent(parent) { setupUi(_parent); _parameterWidget->setVisible(false); _queryonstart->hide(); // hide until query on start enabled _autoupdate->hide(); // hide until auto update is enabled _search->hide(); _searchLit->hide(); _listLabelFrame->setVisible(false); _useAltId = false; _queryOnStartEnabled = false; _autoUpdateEnabled = false; // Build Toolbar even if we hide it so we get actions _newBtn = new QToolButton(_toolBar); _newBtn->setObjectName("_newBtn"); _newBtn->setFocusPolicy(Qt::NoFocus); _newAct = _toolBar->addWidget(_newBtn); _newAct->setVisible(false); _closeBtn = new QToolButton(_toolBar); _closeBtn->setObjectName("_closeBtn"); _closeBtn->setFocusPolicy(Qt::NoFocus); _closeAct = _toolBar->addWidget(_closeBtn); _sep1 = _toolBar->addSeparator(); // Move parameter widget controls into toolbar _moreBtn = new QToolButton(_toolBar); _moreBtn->setObjectName("_moreBtn"); _moreBtn->setFocusPolicy(Qt::NoFocus); _moreBtn->setCheckable(true); _moreAct = _toolBar->addWidget(_moreBtn); _moreAct->setVisible(false); QLabel* filterListLit = _parent->findChild("_filterListLit"); filterListLit->setContentsMargins(3,0,3,0); XComboBox* filterList = _parent->findChild("_filterList"); _filterLitAct = _toolBar->insertWidget(_moreAct, filterListLit); _filterLitAct->setVisible(false); _filterAct = _toolBar->insertWidget(_moreAct, filterList); _filterAct->setVisible(false); _sep2 = _toolBar->addSeparator(); _sep2->setVisible(false); // Print buttons _printBtn = new QToolButton(_toolBar); _printBtn->setObjectName("_printBtn"); _printBtn->setFocusPolicy(Qt::NoFocus); _printAct = _toolBar->addWidget(_printBtn); _printAct->setVisible(false); // hide the print button until a reportName is set _previewBtn = new QToolButton(_toolBar); _previewBtn->setObjectName("_previewBtn"); _printBtn->setFocusPolicy(Qt::NoFocus); _previewAct = _toolBar->addWidget(_previewBtn); _previewAct->setVisible(false); // hide the preview button until a reportName is set _sep3 = _toolBar->addSeparator(); _sep3->setVisible(false); // Optional search widget in toolbar _search->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); _searchAct = _toolBar->addWidget(_search); _searchAct->setVisible(false); // Remaining buttons in toolbar _queryBtn = new QToolButton(_toolBar); _queryBtn->setObjectName("_queryBtn"); _queryBtn->setFocusPolicy(Qt::NoFocus); _queryAct = _toolBar->addWidget(_queryBtn); // Menu actions for query options _queryMenu = new QMenu(_queryBtn); _queryOnStartAct = new QAction(_queryMenu); _queryOnStartAct->setCheckable(true); _queryOnStartAct->setVisible(false); _queryMenu->addAction(_queryOnStartAct); _autoUpdateAct = new QAction(_queryMenu); _autoUpdateAct->setCheckable(true); _autoUpdateAct->setVisible(false); _queryMenu->addAction(_autoUpdateAct); _parent->layout()->setContentsMargins(0,0,0,0); _parent->layout()->setSpacing(0); } bool setParams(ParameterList &); void setupCharacteristics(unsigned int use); void print(ParameterList, bool, bool); QString reportName; QString metasqlName; QString metasqlGroup; bool _useAltId; bool _queryOnStartEnabled; bool _autoUpdateEnabled; QAction* _newAct; QAction* _closeAct; QAction* _sep1; QAction* _filterLitAct; QAction* _filterAct; QAction* _moreAct; QAction* _sep2; QAction* _printAct; QAction* _previewAct; QAction* _sep3; QAction* _searchAct; QAction* _queryAct; QAction* _queryOnStartAct; QAction* _autoUpdateAct; QMenu* _queryMenu; QToolButton * _newBtn; QToolButton * _closeBtn; QToolButton * _moreBtn; QToolButton * _queryBtn; QToolButton * _previewBtn; QToolButton * _printBtn; QList _charidstext; QList _charidslist; QList _charidsdate; private: ::display * _parent; }; void displayPrivate::print(ParameterList pParams, bool showPreview, bool forceSetParams) { int numCopies = 1; ParameterList params = pParams; if (forceSetParams || !params.count()) { if(!_parent->setParams(params)) return; } params.append("isReport", true); XSqlQuery report; report.prepare("SELECT report_grade, report_source " " FROM report " " WHERE (report_name=:report_name)" " ORDER BY report_grade DESC LIMIT 1"); report.bindValue(":report_name", reportName); report.exec(); QDomDocument _doc; if (report.first()) { QString errorMessage; int errorLine; if (!_doc.setContent(report.value("report_source").toString(), &errorMessage, &errorLine)) { QMessageBox::critical(_parent, ::display::tr("Error Parsing Report"), ::display::tr("There was an error Parsing the report definition. %1 %2").arg(errorMessage).arg(errorLine)); return; } } else { QMessageBox::critical(_parent, ::display::tr("Report Not Found"), ::display::tr("The report %1 does not exist.").arg(reportName)); return; } ORPreRender pre; pre.setDom(_doc); pre.setParamList(params); ORODocument * doc = pre.generate(); if(doc) { ReportPrinter printer(QPrinter::HighResolution); printer.setNumCopies( numCopies ); ORPrintRender render; render.setupPrinter(doc, &printer); if(showPreview) { QPrinter * tPrinter = &printer; QPrinter pdfPrinter(QPrinter::HighResolution); if(!printer.isValid()) { render.setupPrinter(doc, &pdfPrinter); pdfPrinter.setOutputFormat(QPrinter::PdfFormat); tPrinter = &pdfPrinter; } PreviewDialog preview (doc, tPrinter, _parent); if (preview.exec() == QDialog::Rejected) return; } QPrintDialog pd(&printer); pd.setMinMax(1, doc->pages()); if(pd.exec() == QDialog::Accepted) { render.render(doc, &printer); } delete doc; } } void displayPrivate::setupCharacteristics(unsigned int use) { QStringList uses; if (use & characteristic::Addresses) uses << "char_addresses"; if (use & characteristic::Contacts) uses << "char_contacts"; if (use & characteristic::CRMAccounts) uses << "char_crmaccounts"; if (use & characteristic::Customers) uses << "char_customers"; if (use & characteristic::Employees) uses << "char_employees"; if (use & characteristic::Incidents) uses << "char_incidents"; if (use & characteristic::Items) uses << "char_items"; if (use & characteristic::LotSerial) uses << "char_lotserial"; if (use & characteristic::Opportunities) uses << "char_opportunity"; // Add columns and parameters for characteristics QString column; QString name; QString sql = QString("SELECT char_id, char_name, char_type " "FROM char " "WHERE (%1) " " AND (char_search) " "ORDER BY char_name;").arg(uses.join(" AND ")); XSqlQuery chars; chars.exec(sql); while (chars.next()) { characteristic::Type chartype = (characteristic::Type)chars.value("char_type").toInt(); column = QString("char%1").arg(chars.value("char_id").toString()); name = chars.value("char_name").toString(); _list->addColumn(name, -1, Qt::AlignLeft , false, column ); if (chartype == characteristic::Text) { _charidstext.append(chars.value("char_id").toInt()); _parameterWidget->append(name, column, ParameterWidget::Text); } else if (chartype == characteristic::List) { _charidslist.append(chars.value("char_id").toInt()); QString sql = QString("SELECT charopt_value, charopt_value " "FROM charopt " "WHERE (charopt_char_id=%1);") .arg(chars.value("char_id").toInt()); _parameterWidget->append(name, column, ParameterWidget::Multiselect, QVariant(), false, sql); } else if (chartype == characteristic::Date) { _charidsdate.append(chars.value("char_id").toInt()); QString start = QApplication::translate("display", "Start Date", 0, QApplication::UnicodeUTF8); QString end = QApplication::translate("display", "End Date", 0, QApplication::UnicodeUTF8); _parameterWidget->append(name + " " + start, column + "startDate", ParameterWidget::Date); _parameterWidget->append(name + " " + end, column + "endDate", ParameterWidget::Date); } } } bool displayPrivate::setParams(ParameterList ¶ms) { QString filter = _parameterWidget->filter(); _parameterWidget->appendValue(params); if (!_search->isNull()) { params.append("search_pattern", _search->text()); QString searchon = QApplication::translate("display", "Search On:", 0, QApplication::UnicodeUTF8); filter.prepend(searchon + " " + _search->text() + "\n"); } params.append("filter", filter); // Handle characteristics QVariant param; bool valid; QString column; QStringList clauses; // Put together the list of text and date based charids used to build joins params.append("char_id_text_list", _charidstext); params.append("char_id_list_list", _charidslist); params.append("char_id_date_list", _charidsdate); // Handle text based sections of clause for (int i = 0; i < _charidstext.count(); i++) { column = QString("char%1").arg(_charidstext.at(i).toString()); param = params.value(column, &valid); if (valid) clauses.append(QString("charass_alias%1.charass_value ~* '%2'").arg(_charidstext.at(i).toString()).arg(param.toString())); } // Handle text based sections of clause for (int i = 0; i < _charidslist.count(); i++) { column = QString("char%1").arg(_charidslist.at(i).toString()); param = params.value(column, &valid); if (valid) { QStringList list = param.toStringList(); clauses.append(QString("charass_alias%1.charass_value IN ('%2') ").arg(_charidslist.at(i).toString()).arg(list.join("','"))); } } // Handle date based sections of clause for (int i = 0; i < _charidsdate.count(); i++) { // Look for start date column = QString("char%1startDate").arg(_charidsdate.at(i).toString()); param = params.value(column, &valid); if (valid) clauses.append(QString("charass_alias%1.charass_value::date >= '%2'").arg(_charidsdate.at(i).toString()).arg(param.toString())); // Look for end date column = QString("char%1endDate").arg(_charidsdate.at(i).toString()); param = params.value(column, &valid); if (valid) clauses.append(QString("charass_alias%1.charass_value::date <= '%2'").arg(_charidsdate.at(i).toString()).arg(param.toString())); } if (clauses.count()) params.append("charClause", clauses.join(" AND ").prepend(" AND ")); return true; } display::display(QWidget* parent, const char* name, Qt::WindowFlags flags) : XWidget(parent, name, flags) { _data = new displayPrivate(this); QPushButton* filterButton = findChild("_filterButton"); // Set text _data->_newBtn->setText(tr("New")); _data->_closeBtn->setText(tr("Close")); _data->_moreBtn->setText(tr("More")); _data->_printBtn->setText(tr("Print")); _data->_previewBtn->setText(tr("Preview")); _data->_queryBtn->setText(tr("Query")); _data->_queryOnStartAct->setText(tr("Query on start")); _data->_autoUpdateAct->setText(tr("Automatically Update")); // Set shortcuts _data->_newAct->setShortcut(QKeySequence::New); _data->_closeAct->setShortcut(QKeySequence::Close); _data->_queryAct->setShortcut(QKeySequence::Refresh); _data->_printAct->setShortcut(QKeySequence::Print); _data->_search->setNullStr(tr("search")); _data->_searchAct->setShortcut(QKeySequence::InsertParagraphSeparator); _data->_searchAct->setShortcutContext(Qt::WidgetWithChildrenShortcut); // Set tooltips _data->_newBtn->setToolTip(_data->_newBtn->text() + " " + _data->_newAct->shortcut().toString(QKeySequence::NativeText)); _data->_closeBtn->setToolTip(_data->_closeBtn->text() + " " + _data->_closeAct->shortcut().toString(QKeySequence::NativeText)); _data->_queryBtn->setToolTip(_data->_queryBtn->text() + " " + _data->_queryAct->shortcut().toString(QKeySequence::NativeText)); _data->_printBtn->setToolTip(_data->_printBtn->text() + " " + _data->_printAct->shortcut().toString(QKeySequence::NativeText)); connect(_data->_newBtn, SIGNAL(clicked()), _data->_newAct, SLOT(trigger())); connect(_data->_closeBtn, SIGNAL(clicked()), _data->_closeAct, SLOT(trigger())); connect(_data->_moreBtn, SIGNAL(clicked(bool)), filterButton, SLOT(setChecked(bool))); connect(_data->_printBtn, SIGNAL(clicked()), _data->_printAct, SLOT(trigger())); connect(_data->_previewBtn, SIGNAL(clicked()), _data->_previewAct, SLOT(trigger())); connect(_data->_queryBtn, SIGNAL(clicked()), _data->_queryAct, SLOT(trigger())); // Connect these two simply so checkbox takes care of pref. memory. Could separate out later. connect(_data->_autoupdate, SIGNAL(toggled(bool)), _data->_autoUpdateAct, SLOT(setChecked(bool))); connect(_data->_autoUpdateAct, SIGNAL(triggered(bool)), _data->_autoupdate, SLOT(setChecked(bool))); connect(_data->_queryonstart, SIGNAL(toggled(bool)), _data->_queryOnStartAct, SLOT(setChecked(bool))); connect(_data->_queryOnStartAct, SIGNAL(triggered(bool)), _data->_queryonstart, SLOT(setChecked(bool))); // Connect Actions connect(_data->_newAct, SIGNAL(triggered()), this, SLOT(sNew())); connect(_data->_closeAct, SIGNAL(triggered()), this, SLOT(close())); connect(_data->_queryAct, SIGNAL(triggered()), this, SLOT(sFillList())); connect(_data->_printAct, SIGNAL(triggered()), this, SLOT(sPrint())); connect(_data->_previewAct, SIGNAL(triggered()), this, SLOT(sPreview())); connect(_data->_searchAct, SIGNAL(triggered()), this, SLOT(sFillList())); connect(this, SIGNAL(fillList()), this, SLOT(sFillList())); connect(_data->_list, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*,int))); connect(_data->_autoupdate, SIGNAL(toggled(bool)), this, SLOT(sAutoUpdateToggled())); connect(filterButton, SIGNAL(toggled(bool)), _data->_moreBtn, SLOT(setChecked(bool))); } display::~display() { delete _data; _data = 0; } void display::languageChange() { _data->retranslateUi(this); } void display::showEvent(QShowEvent * e) { XWidget::showEvent(e); if (_data->_queryOnStartEnabled && _data->_queryonstart->isChecked()) emit fillList(); } QWidget * display::optionsWidget() { return _data->_optionsFrame; } XTreeWidget * display::list() { return _data->_list; } ParameterWidget * display::parameterWidget() { return _data->_parameterWidget; } QToolBar * display::toolBar() { return _data->_toolBar; } QAction * display::newAction() { return _data->_newAct; } QAction * display::closeAction() { return _data->_closeAct; } QAction * display::filterSeparator() { return _data->_sep1; } QAction * display::printSeparator() { return _data->_sep2; } QAction * display::printAction() { return _data->_printAct; } QAction * display::previewAction() { return _data->_previewAct; } QAction * display::querySeparator() { return _data->_sep3; } QAction * display::searchAction() { return _data->_searchAct; } QAction * display::queryAction() { return _data->_queryAct; } QString display::searchText() { if (!_data->_search->isNull()) return _data->_search->text().trimmed(); return QString(""); } bool display::setParams(ParameterList & params) { bool ret = _data->setParams(params); if(engine() && engine()->globalObject().property("setParams").isFunction()) { QScriptValue paramArg = ParameterListtoScriptValue(engine(), params); QScriptValue tmp = engine()->globalObject().property("setParams").call(QScriptValue(), QScriptValueList() << paramArg); ret = ret && tmp.toBool(); params.clear(); ParameterListfromScriptValue(paramArg, params); } return ret; } void display::setupCharacteristics(unsigned int uses) { _data->setupCharacteristics(uses); } void display::setReportName(const QString & reportName) { _data->reportName = reportName; _data->_printAct->setVisible(!reportName.isEmpty()); _data->_previewAct->setVisible(!reportName.isEmpty()); _data->_sep3->setVisible(!reportName.isEmpty()); } QString display::reportName() const { return _data->reportName; } void display::setMetaSQLOptions(const QString & group, const QString & name) { _data->metasqlName = name; _data->metasqlGroup = group; } void display::setListLabel(const QString & pText) { _data->_listLabelFrame->setHidden(pText.isEmpty()); _data->_listLabel->setText(pText); } void display::setUseAltId(bool on) { _data->_useAltId = on; } bool display::useAltId() const { return _data->_useAltId; } void display::setNewVisible(bool show) { _data->_newAct->setVisible(show); _data->_sep1->setVisible(show || _data->_closeAct->isVisible()); } bool display::newVisible() const { return _data->_newAct->isVisible(); } void display::setCloseVisible(bool show) { _data->_closeAct->setVisible(show); _data->_sep1->setVisible(show || _data->_newAct->isVisible()); } bool display::closeVisible() const { return _data->_closeAct->isVisible(); } void display::setParameterWidgetVisible(bool show) { _data->_parameterWidget->setVisible(show); _data->_parameterWidget->_filterButton->hide(); // _moreBtn is what you see here _data->_moreAct->setVisible(show); _data->_filterLitAct->setVisible(show); _data->_filterAct->setVisible(show); _data->_sep2->setVisible(show); } bool display::parameterWidgetVisible() const { return _data->_parameterWidget->_filterGroup->isVisible(); } bool display::searchVisible() const { return _data->_search->isVisible(); } void display::setSearchVisible(bool show) { _data->_search->setVisible(show); _data->_searchAct->setVisible(show); } void display::setQueryOnStartEnabled(bool on) { _data->_queryOnStartEnabled = on; _data->_queryOnStartAct->setVisible(on); if (_data->_queryOnStartEnabled || _data->_autoUpdateEnabled) { _data->_queryBtn->setPopupMode(QToolButton::MenuButtonPopup); _data->_queryBtn->setMenu(_data->_queryMenu); } else { _data->_queryBtn->setPopupMode(QToolButton::DelayedPopup); _data->_queryBtn->setMenu(0); } _data->_queryonstart->setForgetful(!on); // Ensure query on start is checked by default if (on) { QString prefname = window()->objectName() + "/" + _data->_queryonstart->objectName() + "/checked"; XSqlQuery qry; qry.prepare("SELECT usrpref_id " "FROM usrpref " "WHERE ((usrpref_username=getEffectiveXtUser()) " " AND (usrpref_name=:prefname));"); qry.bindValue(":prefname", prefname); qry.exec(); if (!qry.first()) _preferences->set(prefname, 2); } } bool display::queryOnStartEnabled() const { return _data->_queryonstart->isVisible(); } void display::setAutoUpdateEnabled(bool on) { _data->_autoUpdateEnabled = on; _data->_autoUpdateAct->setVisible(on); if (_data->_queryOnStartEnabled || _data->_autoUpdateEnabled) { _data->_queryBtn->setPopupMode(QToolButton::MenuButtonPopup); _data->_queryBtn->setMenu(_data->_queryMenu); } else { _data->_queryBtn->setPopupMode(QToolButton::DelayedPopup); _data->_queryBtn->setMenu(0); } sAutoUpdateToggled(); } bool display::autoUpdateEnabled() const { return _data->_autoUpdateEnabled; } void display::sNew() { } void display::sPrint() { sPrint(ParameterList()); } void display::sPrint(ParameterList pParams, bool forceSetParams) { _data->print(pParams, false, forceSetParams); } void display::sPreview() { sPreview(ParameterList()); } void display::sPreview(ParameterList pParams, bool forceSetParams) { _data->print(pParams, true, forceSetParams); } void display::sFillList() { sFillList(ParameterList()); } void display::sFillList(ParameterList pParams, bool forceSetParams) { emit fillListBefore(); if (forceSetParams || !pParams.count()) { if (!setParams(pParams)) return; } int itemid = _data->_list->id(); bool ok = true; QString errorString; MetaSQLQuery mql = MQLUtil::mqlLoad(_data->metasqlGroup, _data->metasqlName, errorString, &ok); if(!ok) { systemError(this, errorString, __FILE__, __LINE__); return; } XSqlQuery xq = mql.toQuery(pParams); _data->_list->populate(xq, itemid, _data->_useAltId); if (xq.lastError().type() != QSqlError::NoError) { systemError(this, xq.lastError().databaseText(), __FILE__, __LINE__); return; } emit fillListAfter(); } void display::sPopulateMenu(QMenu *, QTreeWidgetItem *, int) { } void display::sAutoUpdateToggled() { bool update = _data->_autoUpdateEnabled && _data->_autoupdate->isChecked(); if (update) connect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); else disconnect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); } ParameterList display::getParams() { ParameterList params; bool ret = setParams(params); params.append("checkParamsReturn", ret); return params; } qt-client-4.1.0/guiclient/display.h000066400000000000000000000057631217451700100172260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DISPLAY_H__ #define __DISPLAY_H__ #include "xwidget.h" class QTreeWidgetItem; class XTreeWidget; class displayPrivate; class ParameterWidget; class display : public XWidget { Q_OBJECT friend class displayPrivate; public: display(QWidget* = 0, const char* = 0, Qt::WindowFlags = 0); ~display(); Q_INVOKABLE virtual bool setParams(ParameterList &); Q_INVOKABLE void setReportName(const QString &); Q_INVOKABLE QString reportName() const; Q_INVOKABLE void setMetaSQLOptions(const QString &, const QString &); Q_INVOKABLE void setListLabel(const QString &); Q_INVOKABLE void setUseAltId(bool); Q_INVOKABLE bool useAltId() const; Q_INVOKABLE void setNewVisible(bool); Q_INVOKABLE bool newVisible() const; Q_INVOKABLE void setCloseVisible(bool); Q_INVOKABLE bool closeVisible() const; Q_INVOKABLE void setParameterWidgetVisible(bool); Q_INVOKABLE bool parameterWidgetVisible() const; Q_INVOKABLE void setSearchVisible(bool); Q_INVOKABLE bool searchVisible() const; Q_INVOKABLE void setQueryOnStartEnabled(bool); Q_INVOKABLE bool queryOnStartEnabled() const; Q_INVOKABLE void setAutoUpdateEnabled(bool); Q_INVOKABLE bool autoUpdateEnabled() const; Q_INVOKABLE XTreeWidget * list(); Q_INVOKABLE ParameterWidget * parameterWidget(); Q_INVOKABLE QWidget * optionsWidget(); Q_INVOKABLE QToolBar * toolBar(); Q_INVOKABLE QAction * newAction(); Q_INVOKABLE QAction * closeAction(); Q_INVOKABLE QAction * filterSeparator(); Q_INVOKABLE QAction * printSeparator(); Q_INVOKABLE QAction * printAction(); Q_INVOKABLE QAction * previewAction(); Q_INVOKABLE QAction * querySeparator(); Q_INVOKABLE QAction * searchAction(); Q_INVOKABLE QAction * queryAction(); Q_INVOKABLE QString searchText(); Q_INVOKABLE void setupCharacteristics(unsigned int uses); public slots: virtual void sNew(); virtual void sPrint(); virtual void sPrint(ParameterList, bool = false); virtual void sPreview(); virtual void sPreview(ParameterList, bool = false); virtual void sFillList(); virtual void sFillList(ParameterList, bool = false); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); protected: Q_INVOKABLE ParameterList getParams(); virtual void showEvent(QShowEvent*); protected slots: virtual void languageChange(); virtual void sAutoUpdateToggled(); signals: void fillList(); void fillListBefore(); void fillListAfter(); private: displayPrivate * _data; }; #endif // __DISPLAY_H__ qt-client-4.1.0/guiclient/display.ui000066400000000000000000000150771217451700100174130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. display 0 0 800 600 display Qt::Horizontal Qt::ToolButtonTextBesideIcon 0 6 6 0 0 QFrame::NoFrame QFrame::Plain Qt::Vertical 20 0 Search: Qt::Horizontal 40 0 QFrame::NoFrame QFrame::Raised 3 3 Results _list Qt::Horizontal 40 0 0 1 false qt_scrollarea_viewport Automatically Update Query on start true Qt::Horizontal 40 0 ParameterWidget QWidget
    parameterwidget.h
    XCheckBox QCheckBox
    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _list
    qt-client-4.1.0/guiclient/displayTimePhased.cpp000066400000000000000000000057531217451700100215240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "displayTimePhased.h" #include "ui_displayTimePhased.h" #include #include #include class displayTimePhasedPrivate : public Ui::displayTimePhased { public: displayTimePhasedPrivate(::displayTimePhased * parent) : _parent(parent) { setupUi(_parent->display::optionsWidget()); _baseColumns = -1; } int _baseColumns; private: ::displayTimePhased * _parent; }; displayTimePhased::displayTimePhased(QWidget* parent, const char* name, Qt::WindowFlags flags) : display(parent, name, flags) { _data = new displayTimePhasedPrivate(this); connect(_data->_calendar, SIGNAL(newCalendarId(int)), _data->_periods, SLOT(populate(int))); connect(_data->_calendar, SIGNAL(select(ParameterList&)), _data->_periods, SLOT(load(ParameterList&))); _column = 0; } displayTimePhased::~displayTimePhased() { delete _data; _data = 0; } void displayTimePhased::languageChange() { display::languageChange(); _data->retranslateUi(this); } QWidget * displayTimePhased::optionsWidget() { return _data->_optionsFrame2; } bool displayTimePhased::setParams(ParameterList ¶ms) { if (_data->_calendar->id() == -1) { QMessageBox::critical(this, tr("Calendar Required"), tr("You must select a Calendar")); _data->_calendar->setFocus(); return false; } if (_data->_periods->selectedItems().length() == 0) { QMessageBox::critical(this, tr("Periods Required"), tr("You must select at least one Calendar Period")); _data->_calendar->setFocus(); return false; } params.append("period_id_list", _data->_periods->periodList()); params.append("calendar_id", _data->_calendar->id()); return setParamsTP(params); } void displayTimePhased::setBaseColumns(int columns) { _data->_baseColumns = columns; } void displayTimePhased::sFillList() { ParameterList params; if(!setParams(params)) return; if(_data->_baseColumns == -1) _data->_baseColumns = list()->columnCount(); list()->clear(); list()->setColumnCount(_data->_baseColumns); _columnDates.clear(); _column = 0; QList selected = _data->_periods->selectedItems(); for (int i = 0; i < selected.size(); i++) { PeriodListViewItem *cursor = (PeriodListViewItem*)selected[i]; QString bucketname = QString("bucket_%1").arg(cursor->id()); list()->addColumn(formatDate(cursor->startDate()), _qtyColumn, Qt::AlignRight, true, bucketname); _columnDates.append(DatePair(cursor->startDate(), cursor->endDate())); } display::sFillList(); } qt-client-4.1.0/guiclient/displayTimePhased.h000066400000000000000000000023141217451700100211570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DISPLAYTIMEPHASED_H__ #define __DISPLAYTIMEPHASED_H__ #include "display.h" #include "calendarTools.h" class displayTimePhasedPrivate; class displayTimePhased : public display { Q_OBJECT friend class displayTimePhasedPrivate; public: displayTimePhased(QWidget* = 0, const char* = 0, Qt::WindowFlags = 0); ~displayTimePhased(); virtual bool setParams(ParameterList &); public slots: virtual void sFillList(); protected: Q_INVOKABLE QWidget * optionsWidget(); virtual bool setParamsTP(ParameterList &) = 0; virtual void setBaseColumns(int); int _column; QList _columnDates; protected slots: virtual void languageChange(); private: displayTimePhasedPrivate * _data; }; #endif // __DISPLAYTIMEPHASED_H__ qt-client-4.1.0/guiclient/displayTimePhased.ui000066400000000000000000000117761217451700100213610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. displayTimePhased 0 0 365 169 Time-Phased Report QFrame::NoFrame QFrame::Plain 0 5 Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 0 0 0 120 Qt::Vertical 20 0 Qt::Horizontal 0 20 CalendarComboBox XComboBox
    calendarTools.h
    PeriodsListView XTreeWidget
    calendarTools.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _periods _calendar newCalendarId(int) _periods populate(int) 162 129 383 213 _calendar select(ParameterList&) _periods load(ParameterList&) 162 129 383 213
    qt-client-4.1.0/guiclient/displays/000077500000000000000000000000001217451700100172255ustar00rootroot00000000000000qt-client-4.1.0/guiclient/displays/displays.pri000066400000000000000000000421631217451700100215770ustar00rootroot00000000000000 INCLUDEPATH += displays FORMS += displays/dspAllocations.ui \ displays/dspAPApplications.ui \ displays/dspAPOpenItemsByVendor.ui \ displays/dspARApplications.ui \ displays/dspBOMBase.ui \ displays/dspBriefEarnedCommissions.ui \ displays/dspCapacityUOMsByParameter.ui \ displays/dspCostedBOMBase.ui \ displays/dspCostedSummarizedBOM.ui \ displays/dspCountSlipsByWarehouse.ui \ displays/dspCountTagsBase.ui \ displays/dspCustomerARHistory.ui \ displays/dspDepositsRegister.ui \ displays/dspDetailedInventoryHistoryByLocation.ui \ displays/dspDetailedInventoryHistoryByLotSerial.ui \ displays/dspEarnedCommissions.ui \ displays/dspExpediteExceptionsByPlannerCode.ui \ displays/dspExpiredInventoryByClassCode.ui \ displays/dspFreightPricesByCustomer.ui \ displays/dspFreightPricesByCustomerType.ui \ displays/dspFrozenItemSites.ui \ displays/dspGLSeries.ui \ displays/dspGLTransactions.ui \ displays/dspIndentedWhereUsed.ui \ displays/dspInvalidBillsOfMaterials.ui \ displays/dspInventoryAvailability.ui \ displays/dspInventoryAvailabilityByCustomerType.ui \ displays/dspInventoryAvailabilityBySalesOrder.ui \ displays/dspInventoryAvailabilityByWorkOrder.ui \ displays/dspInventoryLocator.ui \ displays/dspInvoiceRegister.ui \ displays/dspItemCostDetail.ui \ displays/dspItemCostHistory.ui \ displays/dspItemCostSummary.ui \ displays/dspItemCostsByClassCode.ui \ displays/dspJobCosting.ui \ displays/dspMaterialUsageVarianceByBOMItem.ui \ displays/dspMaterialUsageVarianceByComponentItem.ui \ displays/dspMaterialUsageVarianceByItem.ui \ displays/dspMaterialUsageVarianceByWarehouse.ui \ displays/dspMaterialUsageVarianceByWorkOrder.ui \ displays/dspOrderActivityByProject.ui \ displays/dspOrders.ui \ displays/dspPartiallyShippedOrders.ui \ displays/dspPendingAvailability.ui \ displays/dspPendingBOMChanges.ui \ displays/dspPoDeliveryDateVariancesByItem.ui \ displays/dspPoDeliveryDateVariancesByVendor.ui \ displays/dspPoHistory.ui \ displays/dspPoItemReceivingsByDate.ui \ displays/dspPoItemReceivingsByItem.ui \ displays/dspPoItemReceivingsByVendor.ui \ displays/dspPoItemsByDate.ui \ displays/dspPoItemsByItem.ui \ displays/dspPoItemsByVendor.ui \ displays/dspPoPriceVariancesByItem.ui \ displays/dspPoPriceVariancesByVendor.ui \ displays/dspPoReturnsByVendor.ui \ displays/dspPOsByDate.ui \ displays/dspPOsByVendor.ui \ displays/dspPricesByCustomer.ui \ displays/dspPricesByCustomerType.ui \ displays/dspPricesByItem.ui \ displays/dspPurchaseReqsByItem.ui \ displays/dspPurchaseReqsByPlannerCode.ui \ displays/dspQOH.ui \ displays/dspQOHByLocation.ui \ displays/dspQuotesByCustomer.ui \ displays/dspQuotesByItem.ui \ displays/dspReorderExceptionsByPlannerCode.ui \ displays/dspReservations.ui \ displays/dspRunningAvailability.ui \ displays/dspSalesOrdersByCustomer.ui \ displays/dspSalesOrdersByCustomerPO.ui \ displays/dspSalesOrdersByItem.ui \ displays/dspSalesOrdersByParameterList.ui \ displays/dspSalesOrderStatus.ui \ displays/dspShipmentsBase.ui \ displays/dspShipmentsByDate.ui \ displays/dspSingleLevelWhereUsed.ui \ displays/dspSlowMovingInventoryByClassCode.ui \ displays/dspStandardJournalHistory.ui \ displays/dspSubstituteAvailabilityByItem.ui \ displays/dspSummarizedBacklogByWarehouse.ui \ displays/dspSummarizedBankrecHistory.ui \ displays/dspSummarizedGLTransactions.ui \ displays/dspSummarizedSales.ui \ displays/dspTimePhasedAvailability.ui \ displays/dspTimePhasedBookings.ui \ displays/dspTimePhasedOpenAPItems.ui \ displays/dspTimePhasedOpenARItems.ui \ displays/dspTimePhasedUsageStatisticsByItem.ui \ displays/dspUnbalancedQOHByClassCode.ui \ displays/dspUndefinedManufacturedItems.ui \ displays/dspUninvoicedReceivings.ui \ displays/dspUnusedPurchasedItems.ui \ displays/dspValidLocationsByItem.ui \ displays/dspVendorAPHistory.ui \ displays/dspVoucherRegister.ui \ displays/dspWoHistoryByClassCode.ui \ displays/dspWoHistoryByItem.ui \ displays/dspWoHistoryByNumber.ui \ displays/dspWoMaterialsByItem.ui \ displays/dspWoMaterialsByWorkOrder.ui \ HEADERS += displays/dspAllocations.h \ displays/dspAPApplications.h \ displays/dspAPOpenItemsByVendor.h \ displays/dspARApplications.h \ displays/dspBOMBase.h \ displays/dspBacklog.h \ displays/dspBookings.h \ displays/dspBriefEarnedCommissions.h \ displays/dspBriefSalesHistory.h \ displays/dspCapacityUOMsByClassCode.h \ displays/dspCapacityUOMsByParameter.h \ displays/dspCapacityUOMsByProductCategory.h \ displays/dspCostedBOMBase.h \ displays/dspCostedIndentedBOM.h \ displays/dspCostedSingleLevelBOM.h \ displays/dspCostedSummarizedBOM.h \ displays/dspCountSlipsByWarehouse.h \ displays/dspCountTagsBase.h \ displays/dspCountTagsByClassCode.h \ displays/dspCountTagsByItem.h \ displays/dspCountTagsByWarehouse.h \ displays/dspCustomerARHistory.h \ displays/dspDepositsRegister.h \ displays/dspDetailedInventoryHistoryByLocation.h \ displays/dspDetailedInventoryHistoryByLotSerial.h \ displays/dspEarnedCommissions.h \ displays/dspExpediteExceptionsByPlannerCode.h \ displays/dspExpiredInventoryByClassCode.h \ displays/dspFreightPricesByCustomer.h \ displays/dspFreightPricesByCustomerType.h \ displays/dspFrozenItemSites.h \ displays/dspGLSeries.h \ displays/dspGLTransactions.h \ displays/dspIndentedBOM.h \ displays/dspIndentedWhereUsed.h \ displays/dspInvalidBillsOfMaterials.h \ displays/dspInventoryAvailability.h \ displays/dspInventoryAvailabilityByCustomerType.h \ displays/dspInventoryAvailabilityBySalesOrder.h \ displays/dspInventoryAvailabilityByWorkOrder.h \ displays/dspInventoryHistory.h \ displays/dspInventoryLocator.h \ displays/dspInvoiceRegister.h \ displays/dspItemCostDetail.h \ displays/dspItemCostHistory.h \ displays/dspItemCostSummary.h \ displays/dspItemCostsByClassCode.h \ displays/dspItemSources.h \ displays/dspItemsWithoutItemSources.h \ displays/dspJobCosting.h \ displays/dspJournals.h \ displays/dspMaterialUsageVarianceByBOMItem.h \ displays/dspMaterialUsageVarianceByComponentItem.h \ displays/dspMaterialUsageVarianceByItem.h \ displays/dspMaterialUsageVarianceByWarehouse.h \ displays/dspMaterialUsageVarianceByWorkOrder.h \ displays/dspOrderActivityByProject.h \ displays/dspOrders.h \ displays/dspPartiallyShippedOrders.h \ displays/dspPendingAvailability.h \ displays/dspPendingBOMChanges.h \ displays/dspPlannedOrders.h \ displays/dspPoDeliveryDateVariancesByItem.h \ displays/dspPoDeliveryDateVariancesByVendor.h \ displays/dspPoHistory.h \ displays/dspPoItemReceivingsByDate.h \ displays/dspPoItemReceivingsByItem.h \ displays/dspPoItemReceivingsByVendor.h \ displays/dspPoItemsByDate.h \ displays/dspPoItemsByItem.h \ displays/dspPoItemsByVendor.h \ displays/dspPoPriceVariancesByItem.h \ displays/dspPoPriceVariancesByVendor.h \ displays/dspPoReturnsByVendor.h \ displays/dspPOsByDate.h \ displays/dspPOsByVendor.h \ displays/dspPricesByCustomer.h \ displays/dspPricesByCustomerType.h \ displays/dspPricesByItem.h \ displays/dspPurchaseReqsByItem.h \ displays/dspPurchaseReqsByPlannerCode.h \ displays/dspQOH.h \ displays/dspQOHByLocation.h \ displays/dspQuotesByCustomer.h \ displays/dspQuotesByItem.h \ displays/dspReorderExceptionsByPlannerCode.h \ displays/dspReservations.h \ displays/dspRunningAvailability.h \ displays/dspSalesHistory.h \ displays/dspSalesOrdersByCustomer.h \ displays/dspSalesOrdersByCustomerPO.h \ displays/dspSalesOrdersByItem.h \ displays/dspSalesOrdersByParameterList.h \ displays/dspSalesOrderStatus.h \ displays/dspShipmentsBase.h \ displays/dspShipmentsByDate.h \ displays/dspShipmentsBySalesOrder.h \ displays/dspShipmentsByShipment.h \ displays/dspSingleLevelBOM.h \ displays/dspSingleLevelWhereUsed.h \ displays/dspSlowMovingInventoryByClassCode.h \ displays/dspStandardJournalHistory.h \ displays/dspSubstituteAvailabilityByItem.h \ displays/dspSummarizedBacklogByWarehouse.h \ displays/dspSummarizedBankrecHistory.h \ displays/dspSummarizedBOM.h \ displays/dspSummarizedGLTransactions.h \ displays/dspSummarizedSales.h \ displays/dspTimePhasedAvailability.h \ displays/dspTimePhasedBookings.h \ displays/dspTimePhasedOpenAPItems.h \ displays/dspTimePhasedOpenARItems.h \ displays/dspTimePhasedSales.h \ displays/dspTimePhasedUsageStatisticsByItem.h \ displays/dspTrialBalances.h \ displays/dspUnbalancedQOHByClassCode.h \ displays/dspUndefinedManufacturedItems.h \ displays/dspUninvoicedReceivings.h \ displays/dspUnusedPurchasedItems.h \ displays/dspUsageStatistics.h \ displays/dspValidLocationsByItem.h \ displays/dspVendorAPHistory.h \ displays/dspVoucherRegister.h \ displays/dspWoHistoryByClassCode.h \ displays/dspWoHistoryByItem.h \ displays/dspWoHistoryByNumber.h \ displays/dspWoMaterialsByItem.h \ displays/dspWoMaterialsByWorkOrder.h \ displays/dspWoSchedule.h \ SOURCES += displays/dspAllocations.cpp \ displays/dspAPApplications.cpp \ displays/dspAPOpenItemsByVendor.cpp \ displays/dspARApplications.cpp \ displays/dspBOMBase.cpp \ displays/dspBacklog.cpp \ displays/dspBookings.cpp \ displays/dspBriefEarnedCommissions.cpp \ displays/dspBriefSalesHistory.cpp \ displays/dspCapacityUOMsByClassCode.cpp \ displays/dspCapacityUOMsByParameter.cpp \ displays/dspCapacityUOMsByProductCategory.cpp \ displays/dspCostedBOMBase.cpp \ displays/dspCostedIndentedBOM.cpp \ displays/dspCostedSingleLevelBOM.cpp \ displays/dspCostedSummarizedBOM.cpp \ displays/dspCountSlipsByWarehouse.cpp \ displays/dspCountTagsBase.cpp \ displays/dspCountTagsByClassCode.cpp \ displays/dspCountTagsByItem.cpp \ displays/dspCountTagsByWarehouse.cpp \ displays/dspCustomerARHistory.cpp \ displays/dspDepositsRegister.cpp \ displays/dspDetailedInventoryHistoryByLocation.cpp \ displays/dspDetailedInventoryHistoryByLotSerial.cpp \ displays/dspEarnedCommissions.cpp \ displays/dspExpediteExceptionsByPlannerCode.cpp \ displays/dspExpiredInventoryByClassCode.cpp \ displays/dspFreightPricesByCustomer.cpp \ displays/dspFreightPricesByCustomerType.cpp \ displays/dspFrozenItemSites.cpp \ displays/dspGLSeries.cpp \ displays/dspGLTransactions.cpp \ displays/dspIndentedBOM.cpp \ displays/dspIndentedWhereUsed.cpp \ displays/dspInvalidBillsOfMaterials.cpp \ displays/dspInventoryAvailability.cpp \ displays/dspInventoryAvailabilityByCustomerType.cpp \ displays/dspInventoryAvailabilityBySalesOrder.cpp \ displays/dspInventoryAvailabilityByWorkOrder.cpp \ displays/dspInventoryHistory.cpp \ displays/dspInventoryLocator.cpp \ displays/dspInvoiceRegister.cpp \ displays/dspItemCostDetail.cpp \ displays/dspItemCostHistory.cpp \ displays/dspItemCostSummary.cpp \ displays/dspItemCostsByClassCode.cpp \ displays/dspItemSources.cpp \ displays/dspItemsWithoutItemSources.cpp \ displays/dspJobCosting.cpp \ displays/dspJournals.cpp \ displays/dspMaterialUsageVarianceByBOMItem.cpp \ displays/dspMaterialUsageVarianceByComponentItem.cpp \ displays/dspMaterialUsageVarianceByItem.cpp \ displays/dspMaterialUsageVarianceByWarehouse.cpp \ displays/dspMaterialUsageVarianceByWorkOrder.cpp \ displays/dspTimePhasedOpenAPItems.cpp \ displays/dspTimePhasedOpenARItems.cpp \ displays/dspOrderActivityByProject.cpp \ displays/dspOrders.cpp \ displays/dspPartiallyShippedOrders.cpp \ displays/dspPendingAvailability.cpp \ displays/dspPendingBOMChanges.cpp \ displays/dspPlannedOrders.cpp \ displays/dspPoDeliveryDateVariancesByItem.cpp \ displays/dspPoDeliveryDateVariancesByVendor.cpp \ displays/dspPoHistory.cpp \ displays/dspPoItemReceivingsByDate.cpp \ displays/dspPoItemReceivingsByItem.cpp \ displays/dspPoItemReceivingsByVendor.cpp \ displays/dspPoItemsByDate.cpp \ displays/dspPoItemsByItem.cpp \ displays/dspPoItemsByVendor.cpp \ displays/dspPoPriceVariancesByItem.cpp \ displays/dspPoPriceVariancesByVendor.cpp \ displays/dspPoReturnsByVendor.cpp \ displays/dspPOsByDate.cpp \ displays/dspPOsByVendor.cpp \ displays/dspPricesByCustomer.cpp \ displays/dspPricesByCustomerType.cpp \ displays/dspPricesByItem.cpp \ displays/dspPurchaseReqsByItem.cpp \ displays/dspPurchaseReqsByPlannerCode.cpp \ displays/dspQOH.cpp \ displays/dspQOHByLocation.cpp \ displays/dspQuotesByCustomer.cpp \ displays/dspQuotesByItem.cpp \ displays/dspReorderExceptionsByPlannerCode.cpp \ displays/dspReservations.cpp \ displays/dspRunningAvailability.cpp \ displays/dspSalesHistory.cpp \ displays/dspSalesOrdersByCustomer.cpp \ displays/dspSalesOrdersByCustomerPO.cpp \ displays/dspSalesOrdersByItem.cpp \ displays/dspSalesOrdersByParameterList.cpp \ displays/dspSalesOrderStatus.cpp \ displays/dspShipmentsBase.cpp \ displays/dspShipmentsByDate.cpp \ displays/dspShipmentsBySalesOrder.cpp \ displays/dspShipmentsByShipment.cpp \ displays/dspSingleLevelBOM.cpp \ displays/dspSingleLevelWhereUsed.cpp \ displays/dspSlowMovingInventoryByClassCode.cpp \ displays/dspStandardJournalHistory.cpp \ displays/dspSubstituteAvailabilityByItem.cpp \ displays/dspSummarizedBacklogByWarehouse.cpp \ displays/dspSummarizedBankrecHistory.cpp \ displays/dspSummarizedBOM.cpp \ displays/dspSummarizedGLTransactions.cpp \ displays/dspSummarizedSales.cpp \ displays/dspTimePhasedAvailability.cpp \ displays/dspTimePhasedBookings.cpp \ displays/dspTimePhasedSales.cpp \ displays/dspTimePhasedUsageStatisticsByItem.cpp \ displays/dspTrialBalances.cpp \ displays/dspUnbalancedQOHByClassCode.cpp \ displays/dspUndefinedManufacturedItems.cpp \ displays/dspUninvoicedReceivings.cpp \ displays/dspUnusedPurchasedItems.cpp \ displays/dspUsageStatistics.cpp \ displays/dspValidLocationsByItem.cpp \ displays/dspVendorAPHistory.cpp \ displays/dspVoucherRegister.cpp \ displays/dspWoHistoryByClassCode.cpp \ displays/dspWoHistoryByItem.cpp \ displays/dspWoHistoryByNumber.cpp \ displays/dspWoMaterialsByItem.cpp \ displays/dspWoMaterialsByWorkOrder.cpp \ displays/dspWoSchedule.cpp \ qt-client-4.1.0/guiclient/displays/dspAPApplications.cpp000066400000000000000000000201131217451700100233040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspAPApplications.h" #include #include #include #include #include "apOpenItem.h" #include "check.h" #include "voucher.h" dspAPApplications::dspAPApplications(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspAPApplications", fl) { setupUi(optionsWidget()); setWindowTitle(tr("A/P Applications")); setListLabel(tr("Accounts Payable Applications")); setReportName("APApplications"); setMetaSQLOptions("apApplications", "detail"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Vend. #"), _orderColumn, Qt::AlignLeft, true, "vend_number"); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name"); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter,true, "apapply_postdate"); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignCenter,true, "apapply_source_doctype"); list()->addColumn(tr("Doc #"), _orderColumn, Qt::AlignRight, true, "apapply_source_docnumber"); list()->addColumn(tr("Apply-To"), _itemColumn, Qt::AlignCenter,true, "apapply_target_doctype"); list()->addColumn(tr("Doc #"), _orderColumn, Qt::AlignRight, true, "apapply_target_docnumber"); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "apapply_amount"); list()->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "currAbbr"); list()->addColumn(tr("Amount (in %1)").arg(CurrDisplay::baseCurrAbbr()),_moneyColumn, Qt::AlignRight, true, "base_applied"); } void dspAPApplications::languageChange() { display::languageChange(); retranslateUi(this); } void dspAPApplications::sViewCheck() { int checkid = list()->currentItem()->id("apapply_source_docnumber"); if ((checkid == -1) || (checkid == 0)) { XSqlQuery countq; countq.prepare("SELECT COUNT(*) AS count " "FROM checkhead " "JOIN checkitem ON (checkhead_id=checkitem_checkhead_id) " "WHERE ((checkhead_number=:number)" " AND (checkitem_amount=:amount));"); countq.bindValue(":number", list()->currentItem()->text("apapply_source_docnumber")); countq.bindValue(":amount", list()->currentItem()->rawValue("apapply_amount")); countq.exec(); if (countq.first()) { if (countq.value("count").toInt() > 1) { QMessageBox::warning(this, tr("Check Look-Up Failed"), tr("Found multiple checks with this check number.")); return; } else if (countq.value("count").toInt() < 1) { QMessageBox::warning(this, tr("Check Look-Up Failed"), tr("Could not find the record for this check.")); return; } } else if (countq.lastError().type() != QSqlError::NoError) { systemError(this, countq.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery chkq; chkq.prepare("SELECT checkhead_id " "FROM checkhead " "JOIN checkitem ON (checkhead_id=checkitem_checkhead_id) " "WHERE ((checkhead_number=:number)" " AND (checkitem_amount=:amount));"); chkq.bindValue(":number", list()->currentItem()->text("apapply_source_docnumber")); chkq.bindValue(":amount", list()->currentItem()->rawValue("apapply_amount")); chkq.exec(); if (chkq.first()) checkid = chkq.value("checkhead_id").toInt(); else if (chkq.lastError().type() != QSqlError::NoError) { systemError(this, chkq.lastError().databaseText(), __FILE__, __LINE__); return; } } ParameterList params; params.append("checkhead_id", checkid); check *newdlg = new check(this, "check"); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAPApplications::sViewCreditMemo() { ParameterList params; params.append("mode", "view"); params.append("apopen_id", list()->id("apapply_source_docnumber")); params.append("docType", "creditMemo"); apOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspAPApplications::sViewDebitMemo() { ParameterList params; params.append("mode", "view"); params.append("apopen_id", list()->id("apapply_target_docnumber")); params.append("docType", "debitMemo"); apOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspAPApplications::sViewVoucher() { ParameterList params; params.append("mode", "view"); params.append("vohead_id", list()->id("apapply_target_docnumber")); voucher *newdlg = new voucher(this, "voucher"); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAPApplications::sPopulateMenu(QMenu* pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if (list()->currentItem()->rawValue("apapply_source_doctype") == "C") { menuItem = pMenu->addAction(tr("View Source Credit Memo..."), this, SLOT(sViewCreditMemo())); menuItem->setEnabled(_privileges->check("MaintainAPMemos") || _privileges->check("ViewAPMemos")); } else if (list()->currentItem()->rawValue("apapply_source_doctype") == "K") { menuItem = pMenu->addAction(tr("View Source Check..."), this, SLOT(sViewCheck())); menuItem->setEnabled(_privileges->check("MaintainPayments")); } if (list()->currentItem()->rawValue("apapply_target_doctype") == "D") { menuItem = pMenu->addAction(tr("View Apply-To Debit Memo..."), this, SLOT(sViewDebitMemo())); menuItem->setEnabled(_privileges->check("MaintainAPMemos") || _privileges->check("ViewAPMemos")); } else if (list()->currentItem()->rawValue("apapply_target_doctype") == "V") { menuItem = pMenu->addAction(tr("View Apply-To Voucher..."), this, SLOT(sViewVoucher())); menuItem->setEnabled(_privileges->check("MaintainVouchers") || _privileges->check("ViewVouchers")); } } bool dspAPApplications::setParams(ParameterList & params) { if (! _vendorgroup->isValid()) { QMessageBox::warning( this, tr("Select Vendor"), tr("You must select the Vendor(s) whose A/R Applications you wish to view.") ); _vendorgroup->setFocus(); return false; } if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Start Date"), tr("You must enter a valid Start Date.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter End Date"), tr("You must enter a valid End Date.") ); _dates->setFocus(); return false; } if ( !_showChecks->isChecked() && !_showCreditMemos->isChecked()) { //TODO ?? //if (windowFlags() & (Qt::Window | Qt::Dialog)) QMessageBox::critical( this, tr("Select Document Type"), tr("You must indicate which Document Type(s) you wish to view.") ); _showChecks->setFocus(); return false; } if (_showChecks->isChecked() && _showCreditMemos->isChecked()) params.append("doctypeList", "'C', 'K'"); else if (_showChecks->isChecked()) params.append("doctypeList", "'K'"); else if (_showCreditMemos->isChecked()) params.append("doctypeList", "'C'"); if (_showChecks->isChecked()) params.append("showChecks"); if (_showCreditMemos->isChecked()) params.append("showCreditMemos"); _dates->appendValue(params); params.append("creditMemo", tr("Credit")); params.append("debitMemo", tr("Debit")); params.append("check", tr("Check")); params.append("voucher", tr("Voucher")); _vendorgroup->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspAPApplications.h000066400000000000000000000021441217451700100227550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPAPAPPLICATIONS_H #define DSPAPAPPLICATIONS_H #include "guiclient.h" #include "display.h" #include "ui_dspAPApplications.h" class dspAPApplications : public display, public Ui::dspAPApplications { Q_OBJECT public: dspAPApplications(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*, int); virtual void sViewCheck(); virtual void sViewCreditMemo(); virtual void sViewDebitMemo(); virtual void sViewVoucher(); protected slots: virtual void languageChange(); }; #endif // DSPARAPPLICATIONS_H qt-client-4.1.0/guiclient/displays/dspAPApplications.ui000066400000000000000000000102521217451700100231420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspAPApplications 0 0 455 156 A/P Applications Qt::Horizontal 0 20 Qt::Vertical 20 0 Show Checks Show Credit Memos Qt::Vertical 20 0 Qt::Horizontal 0 20 DateCluster QWidget
    datecluster.h
    VendorGroup QWidget
    vendorgroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _dates
    qt-client-4.1.0/guiclient/displays/dspAPOpenItemsByVendor.cpp000066400000000000000000000154211217451700100242400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspAPOpenItemsByVendor.h" #include #include #include #include #include "apOpenItem.h" dspAPOpenItemsByVendor::dspAPOpenItemsByVendor(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspAPOpenItemsByVendor", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Open Payables")); setListLabel(tr("Payables")); setReportName("APOpenItemsByVendor"); setMetaSQLOptions("apOpenItems", "detail"); setUseAltId(true); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Doc. Type"), _orderColumn, Qt::AlignLeft, true, "f_doctype" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignLeft, true, "apopen_docnumber" ); list()->addColumn(tr("Vendor#"), _orderColumn, Qt::AlignLeft, true, "vend_number" ); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignLeft, true, "apopen_ponumber" ); list()->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignLeft, true, "invoicenumber" ); list()->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, false, "apopen_docdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "apopen_duedate" ); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "apopen_amount" ); list()->addColumn(tr("Paid"), _moneyColumn, Qt::AlignRight, true, "paid" ); list()->addColumn(tr("Balance"), -1, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currAbbr" ); list()->addColumn(tr("Base Balance"), _moneyColumn, Qt::AlignRight, true, "base_balance" ); list()->addColumn(tr("Status"), _moneyColumn, Qt::AlignCenter, false, "apopen_status" ); if (omfgThis->singleCurrency()) { list()->hideColumn(10); list()->hideColumn(11); } else { XSqlQuery qq; qq.prepare("SELECT currConcat(baseCurrId()) AS currConcat;"); qq.exec(); QString currConcat; if (qq.first()) currConcat = qq.value("currConcat").toString(); else currConcat = tr("?????"); list()->headerItem()->setText(12, tr("Balance\n(in %1)").arg(currConcat)); } _asOf->setDate(omfgThis->dbDate(), true); if(_preferences->value("APAgingDefaultDate") == "doc") _useDocDate->setChecked(true); else _useDistDate->setChecked(true); } void dspAPOpenItemsByVendor::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspAPOpenItemsByVendor::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) _vendorGroup->setVendId(param.toInt()); param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); param = pParams.value("asofDate", &valid); if (valid) { _asOf->setDate(param.toDate()); _asOf->setEnabled(false); } param = pParams.value("useDocDate", &valid); if (valid) _useDocDate->setChecked(param.toBool()); param = pParams.value("useDistDate", &valid); if (valid) _useDistDate->setChecked(param.toBool()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspAPOpenItemsByVendor::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int) { QString status(selected->text(1)); QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); if (!_privileges->check("EditAPOpenItem")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); XSqlQuery menu; menu.prepare("SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;"); menu.bindValue(":apopen_id", list()->id()); menu.exec(); if (menu.first()) { if(menu.value("apopen_status").toString() == "O") { menuItem = pMenu->addAction(tr("On Hold"), this, SLOT(sOnHold())); menuItem->setEnabled(_privileges->check("EditAPOpenItem")); } if(menu.value("apopen_status").toString() == "H") { menuItem = pMenu->addAction(tr("Open"), this, SLOT(sOpen())); menuItem->setEnabled(_privileges->check("EditAPOpenItem")); } } } void dspAPOpenItemsByVendor::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("apopen_id", list()->id()); apOpenItem newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspAPOpenItemsByVendor::sView() { ParameterList params; params.append("mode", "view"); params.append("apopen_id", list()->id()); apOpenItem newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } bool dspAPOpenItemsByVendor::setParams(ParameterList & params) { _vendorGroup->appendValue(params); _dates->appendValue(params); params.append("asofDate", _asOf->date()); // have both in case we add a third option params.append("useDocDate", QVariant(_useDocDate->isChecked())); params.append("useDistDate", QVariant(_useDistDate->isChecked())); params.append("creditMemo", tr("Credit Memo")); params.append("debitMemo", tr("Debit Memo")); params.append("voucher", tr("Voucher")); return true; } void dspAPOpenItemsByVendor::sOpen() { XSqlQuery open; open.prepare("UPDATE apopen SET apopen_status = 'O' WHERE apopen_id=:apopen_id;"); open.bindValue(":apopen_id", list()->id()); open.exec(); sFillList(); } void dspAPOpenItemsByVendor::sOnHold() { XSqlQuery selectpayment; selectpayment.prepare("SELECT * FROM apselect WHERE apselect_apopen_id = :apopen_id;"); selectpayment.bindValue(":apopen_id", list()->id()); selectpayment.exec(); if (selectpayment.first()) { QMessageBox::critical( this, tr("Can not change Status"), tr( "You cannot set this item as On Hold.\nThis Item is already selected for payment." ) ); return; } XSqlQuery onhold; onhold.prepare("UPDATE apopen SET apopen_status = 'H' WHERE apopen_id=:apopen_id;"); onhold.bindValue(":apopen_id", list()->id()); onhold.exec(); sFillList(); } qt-client-4.1.0/guiclient/displays/dspAPOpenItemsByVendor.h000066400000000000000000000023131217451700100237010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPAPOPENITEMSBYVENDOR_H #define DSPAPOPENITEMSBYVENDOR_H #include "guiclient.h" #include "display.h" #include #include "ui_dspAPOpenItemsByVendor.h" class dspAPOpenItemsByVendor : public display, public Ui::dspAPOpenItemsByVendor { Q_OBJECT public: dspAPOpenItemsByVendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int); virtual void sEdit(); virtual void sView(); virtual void sOnHold(); virtual void sOpen(); protected slots: virtual void languageChange(); }; #endif // DSPAPOPENITEMSBYVENDOR_H qt-client-4.1.0/guiclient/displays/dspAPOpenItemsByVendor.ui000066400000000000000000000072171217451700100240770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspAPOpenItemsByVendor 0 0 746 177 Open Payables Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::StrongFocus Document Date Distribution Date As of Date: Qt::Horizontal 40 20 DateCluster QWidget
    datecluster.h
    DLineEdit QWidget
    datecluster.h
    1
    VendorGroup QWidget
    vendorgroup.h
    _dates _asOf
    qt-client-4.1.0/guiclient/displays/dspARApplications.cpp000066400000000000000000000202611217451700100233120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspARApplications.h" #include #include #include #include #include #include "arOpenItem.h" #include "creditMemo.h" #include "dspInvoiceInformation.h" dspARApplications::dspARApplications(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspARApplications", fl) { setupUi(optionsWidget()); setWindowTitle(tr("A/R Applications")); setListLabel(tr("A/R Applications")); setReportName("ARApplications"); setMetaSQLOptions("arApplications", "detail"); _cust->setType(CLineEdit::ActiveCustomers); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignCenter, true, "cust_number" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter, true, "arapply_postdate" ); list()->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter, true, "arapply_distdate" ); list()->addColumn(tr("Source Doc Type"), 10, Qt::AlignCenter, true, "arapply_source_doctype" ); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignCenter, true, "doctype" ); list()->addColumn(tr("Doc #"), _orderColumn, Qt::AlignCenter, true, "source" ); list()->addColumn(tr("Apply-To Doc Type"), 10, Qt::AlignCenter, true, "arapply_target_doctype" ); list()->addColumn(tr("Apply-To"), _itemColumn, Qt::AlignCenter, true, "targetdoctype" ); list()->addColumn(tr("Doc #"), _orderColumn, Qt::AlignCenter, true, "target" ); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "arapply_applied" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currAbbr" ); list()->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight, true, "base_applied" ); list()->hideColumn(4); list()->hideColumn(7); } void dspARApplications::languageChange() { display::languageChange(); retranslateUi(this); } void dspARApplications::sViewCreditMemo() { XSqlQuery dspViewCreditMemo; ParameterList params; params.append("mode", "view"); dspViewCreditMemo.prepare("SELECT 1 AS type, cmhead_id AS id " "FROM cmhead " "WHERE (cmhead_number=:docnum) " "UNION " "SELECT 2 AS type, aropen_id AS id " "FROM aropen " "WHERE ((aropen_docnumber=:docnum)" " AND (aropen_doctype IN ('C', 'R')) " ") ORDER BY type LIMIT 1;"); dspViewCreditMemo.bindValue(":docnum", list()->currentItem()->text(6)); dspViewCreditMemo.exec(); if (dspViewCreditMemo.first()) { if (dspViewCreditMemo.value("type").toInt() == 1) { params.append("cmhead_id", dspViewCreditMemo.value("id")); creditMemo* newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (dspViewCreditMemo.value("type").toInt() == 2) { params.append("aropen_id", dspViewCreditMemo.value("id")); params.append("docType", "creditMemo"); arOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } else if (dspViewCreditMemo.lastError().type() != QSqlError::NoError) { systemError(this, dspViewCreditMemo.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::information(this, tr("Credit Memo Not Found"), tr("

    The Credit Memo #%1 could not be found.") .arg(list()->currentItem()->text(6))); return; } } void dspARApplications::sViewDebitMemo() { XSqlQuery dspViewDebitMemo; ParameterList params; params.append("mode", "view"); dspViewDebitMemo.prepare("SELECT aropen_id " "FROM aropen " "WHERE ((aropen_docnumber=:docnum) AND (aropen_doctype='D'));"); dspViewDebitMemo.bindValue(":docnum", list()->currentItem()->text(9)); dspViewDebitMemo.exec(); if (dspViewDebitMemo.first()) { params.append("aropen_id", dspViewDebitMemo.value("aropen_id")); params.append("docType", "debitMemo"); arOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } else if (dspViewDebitMemo.lastError().type() != QSqlError::NoError) { systemError(this, dspViewDebitMemo.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspARApplications::sViewInvoice() { ParameterList params; params.append("mode", "view"); params.append("invoiceNumber", list()->currentItem()->text(9)); dspInvoiceInformation* newdlg = new dspInvoiceInformation(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspARApplications::sPopulateMenu(QMenu* pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if (list()->currentItem()->text(4) == "C") { menuItem = pMenu->addAction(tr("View Source Credit Memo..."), this, SLOT(sViewCreditMemo())); if (! _privileges->check("MaintainARMemos") && ! _privileges->check("ViewARMemos")) menuItem->setEnabled(false); } if (list()->currentItem()->text(7) == "D") { menuItem = pMenu->addAction(tr("View Apply-To Debit Memo..."), this, SLOT(sViewDebitMemo())); if (! _privileges->check("MaintainARMemos") && ! _privileges->check("ViewARMemos")) menuItem->setEnabled(false); } else if (list()->currentItem()->text(7) == "I") { menuItem = pMenu->addAction(tr("View Apply-To Invoice..."), this, SLOT(sViewInvoice())); if (! _privileges->check("MaintainMiscInvoices") && ! _privileges->check("ViewMiscInvoices")) menuItem->setEnabled(false); } } bool dspARApplications::setParams(ParameterList & params) { if ( (_selectedCustomer->isChecked()) && (!_cust->isValid()) ) { QMessageBox::warning( this, tr("Select Customer"), tr("You must select a Customer whose A/R Applications you wish to view.") ); _cust->setFocus(); return false; } if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Start Date"), tr("You must enter a valid Start Date.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter End Date"), tr("You must enter a valid End Date.") ); _dates->setFocus(); return false; } if ( (!_cashReceipts->isChecked()) && (!_creditMemos->isChecked()) ) { QMessageBox::critical( this, tr("Select Document Type"), tr("You must indicate which Document Type(s) you wish to view.") ); _cashReceipts->setFocus(); return false; } if (_cashReceipts->isChecked()) params.append("includeCashReceipts"); if (_creditMemos->isChecked()) params.append("includeCreditMemos"); _dates->appendValue(params); params.append("creditMemo", tr("C/M")); params.append("debitMemo", tr("D/M")); params.append("cashdeposit", tr("Cash Deposit")); params.append("invoice", tr("Invoice")); params.append("cash", tr("C/R")); params.append("check", tr("Check")); params.append("certifiedCheck", tr("Cert. Check")); params.append("masterCard", tr("M/C")); params.append("visa", tr("Visa")); params.append("americanExpress", tr("AmEx")); params.append("discoverCard", tr("Discover")); params.append("otherCreditCard", tr("Other C/C")); params.append("cash", tr("Cash")); params.append("wireTransfer", tr("Wire Trans.")); params.append("other", tr("Other")); params.append("apcheck", tr("A/P Check")); if (_selectedCustomer->isChecked()) params.append("cust_id", _cust->id()); else if (_selectedCustomerType->isChecked()) params.append("custtype_id", _customerTypes->id()); else if (_customerTypePattern->isChecked()) params.append("custtype_pattern", _customerType->text()); return true; } qt-client-4.1.0/guiclient/displays/dspARApplications.h000066400000000000000000000021201217451700100227510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPARAPPLICATIONS_H #define DSPARAPPLICATIONS_H #include "guiclient.h" #include "display.h" #include #include "ui_dspARApplications.h" class dspARApplications : public display, public Ui::dspARApplications { Q_OBJECT public: dspARApplications(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*, int); virtual void sViewCreditMemo(); virtual void sViewDebitMemo(); virtual void sViewInvoice(); protected slots: virtual void languageChange(); }; #endif // DSPARAPPLICATIONS_H qt-client-4.1.0/guiclient/displays/dspARApplications.ui000066400000000000000000000164721217451700100231560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspARApplications 0 0 703 196 A/R Applications 0 0 All Customers true Selected Customer: false false false Selected Customer Type: false 0 0 XComboBox::CustomerTypes Customer Type Pattern: false Qt::Vertical QSizePolicy::Preferred 420 18 Show Cash Receipts Show Credit Memos Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 7 20 CustCluster QWidget

    custcluster.h
    DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _allCustomers _selectedCustomer _selectedCustomerType _customerTypes _customerTypePattern _customerType _dates _cashReceipts _creditMemos _selectedCustomerType toggled(bool) _customerTypes setEnabled(bool) 20 20 20 20 _customerTypePattern toggled(bool) _customerType setEnabled(bool) 20 20 20 20 _selectedCustomer toggled(bool) _cust setEnabled(bool) 20 20 294 66 qt-client-4.1.0/guiclient/displays/dspAllocations.cpp000066400000000000000000000156141217451700100227170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspAllocations.h" #include #include #include #include "salesOrder.h" #include "transferOrder.h" #include "workOrder.h" dspAllocations::dspAllocations(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspAllocations", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Item Allocations")); setListLabel(tr("Item Allocations")); setMetaSQLOptions("allocations", "detail"); _item->setReadOnly(true); _warehouse->setEnabled(false); list()->addColumn(tr("Type"), _docTypeColumn, Qt::AlignCenter,true, "type"); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "order_number"); list()->addColumn(tr("Parent Item"), -1, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Total Qty."), _qtyColumn, Qt::AlignRight, true, "totalqty"); list()->addColumn(tr("Relieved"), _qtyColumn, Qt::AlignRight, true, "relievedqty"); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balanceqty"); list()->addColumn(tr("Running Bal."), _qtyColumn, Qt::AlignRight, true, "runningbal"); list()->addColumn(tr("Required"), _dateColumn, Qt::AlignCenter,true, "duedate"); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } void dspAllocations::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspAllocations::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) _item->setItemsiteid(param.toInt()); _leadTime->setChecked(pParams.inList("byLeadTime")); param = pParams.value("byDate", &valid); if (valid) { _byDate->setChecked(true); _date->setDate(param.toDate()); } param = pParams.value("byDays", &valid); if (valid) { _byDays->setChecked(true); _days->setValue(param.toInt()); } _byRange->setChecked(pParams.inList("byRange")); param = pParams.value("startDate", &valid); if (valid) _startDate->setDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _endDate->setDate(param.toDate()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspAllocations::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; if (QString(pSelected->text(0)) == "W/O") { menuItem = pMenu->addAction(tr("View Work Order..."), this, SLOT(sViewWorkOrder())); menuItem->setEnabled(_privileges->check("ViewWorkOrders")); } else if (QString(pSelected->text(0)) == "S/O") { menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewCustomerOrder())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditCustomerOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); } else if (QString(pSelected->text(0)) == "T/O") { menuItem = pMenu->addAction(tr("View Transfer Order..."), this, SLOT(sViewTransferOrder())); menuItem->setEnabled(_privileges->check("ViewTransferOrders")); menuItem = pMenu->addAction(tr("Edit Transfer Order..."), this, SLOT(sEditTransferOrder())); menuItem->setEnabled(_privileges->check("MaintainTransferOrders")); } } void dspAllocations::sViewWorkOrder() { XSqlQuery dspViewWorkOrder; dspViewWorkOrder.prepare( "SELECT womatl_wo_id " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); dspViewWorkOrder.bindValue(":womatl_id", list()->id()); dspViewWorkOrder.exec(); if (dspViewWorkOrder.first()) { ParameterList params; params.append("mode", "view"); params.append("wo_id", dspViewWorkOrder.value("womatl_wo_id").toInt()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspAllocations::sViewCustomerOrder() { XSqlQuery dspViewCustomerOrder; dspViewCustomerOrder.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:coitem_id);" ); dspViewCustomerOrder.bindValue(":coitem_id", list()->id()); dspViewCustomerOrder.exec(); if (dspViewCustomerOrder.first()) salesOrder::viewSalesOrder(dspViewCustomerOrder.value("coitem_cohead_id").toInt()); } void dspAllocations::sEditCustomerOrder() { XSqlQuery dspEditCustomerOrder; dspEditCustomerOrder.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:coitem_id);" ); dspEditCustomerOrder.bindValue(":coitem_id", list()->id()); dspEditCustomerOrder.exec(); if (dspEditCustomerOrder.first()) salesOrder::editSalesOrder(dspEditCustomerOrder.value("coitem_cohead_id").toInt(), false); } void dspAllocations::sViewTransferOrder() { XSqlQuery dspViewTransferOrder; dspViewTransferOrder.prepare( "SELECT toitem_tohead_id " "FROM toitem " "WHERE (toitem_id=:toitem_id);" ); dspViewTransferOrder.bindValue(":toitem_id", list()->id()); dspViewTransferOrder.exec(); if (dspViewTransferOrder.first()) transferOrder::viewTransferOrder(dspViewTransferOrder.value("toitem_tohead_id").toInt()); } void dspAllocations::sEditTransferOrder() { XSqlQuery dspEditTransferOrder; dspEditTransferOrder.prepare( "SELECT toitem_tohead_id " "FROM toitem " "WHERE (toitem_id=:toitem_id);" ); dspEditTransferOrder.bindValue(":toitem_id", list()->id()); dspEditTransferOrder.exec(); if (dspEditTransferOrder.first()) transferOrder::editTransferOrder(dspEditTransferOrder.value("toitem_tohead_id").toInt(), false); } bool dspAllocations::setParams(ParameterList ¶ms) { if (!( (_item->isValid()) && ( (_leadTime->isChecked()) || (_byDays->isChecked()) || ((_byDate->isChecked()) && (_date->isValid())) || ((_byRange->isChecked()) && (_startDate->isValid()) && (_endDate->isValid())) ) )) return false; params.append("warehous_id", _warehouse->id()); params.append("item_id", _item->id()); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_leadTime->isChecked()) params.append("leadTime"); else if (_byDays->isChecked()) params.append("days", _days->value()); else if (_byDate->isChecked()) params.append("date", _date->date()); else if (_byRange->isChecked()) { params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } return true; } qt-client-4.1.0/guiclient/displays/dspAllocations.h000066400000000000000000000023561217451700100223630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPALLOCATIONS_H #define DSPALLOCATIONS_H #include "guiclient.h" #include "display.h" #include #include "ui_dspAllocations.h" class dspAllocations : public display, public Ui::dspAllocations { Q_OBJECT public: dspAllocations(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sEditCustomerOrder(); virtual void sEditTransferOrder(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected, int ); virtual void sViewCustomerOrder(); virtual void sViewTransferOrder(); virtual void sViewWorkOrder(); protected slots: virtual void languageChange(); }; #endif // DSPALLOCATIONS_H qt-client-4.1.0/guiclient/displays/dspAllocations.ui000066400000000000000000000231161217451700100225460ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspAllocations 0 0 800 256 Item Allocations 32767 32767 Show Availability as of: Item Site Lead Time true 5 Look Ahead Days: 0 false 0 1000 Qt::Horizontal QSizePolicy::MinimumExpanding 20 20 5 Date: 0 false Qt::Horizontal QSizePolicy::MinimumExpanding 20 20 5 Date Range: false to Qt::AlignCenter false 0 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 197 20 DLineEdit QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    _item privateIdChanged(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _byDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _byDate toggled(bool) _date setEnabled(bool) 20 20 20 20 _byRange toggled(bool) _startDate setEnabled(bool) 20 20 20 20 _byRange toggled(bool) _endDate setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspBOMBase.cpp000066400000000000000000000062361217451700100216570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspBOMBase.h" #include #include #include "item.h" dspBOMBase::dspBOMBase(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { setupUi(optionsWidget()); setListLabel(tr("Bill Of Materials")); setMetaSQLOptions("bom", "detail"); connect(_item, SIGNAL(valid(bool)), _revision, SLOT(setEnabled(bool))); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), this, SLOT(sFillList())); _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cPhantom | ItemLineEdit::cKit | ItemLineEdit::cPlanning | ItemLineEdit::cTooling); _expiredDaysLit->setEnabled(_showExpired->isChecked()); _expiredDays->setEnabled(_showExpired->isChecked()); _effectiveDaysLit->setEnabled(_showFuture->isChecked()); _effectiveDays->setEnabled(_showFuture->isChecked()); _revision->setEnabled(false); _revision->setMode(RevisionLineEdit::View); _revision->setType("BOM"); _revision->setVisible(_metrics->boolean("RevControl")); } void dspBOMBase::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspBOMBase::set(const ParameterList &pParams) { display::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); param = pParams.value("revision_id", &valid); if (valid) _revision->setId(param.toInt()); } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspBOMBase::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Invalid Item"), tr("You must specify a valid item.") ); return false; } params.append("item_id", _item->id()); params.append("revision_id", _revision->id()); if (_showExpired->isChecked()) params.append("expiredDays", _expiredDays->value()); else params.append("expiredDays", 0); if(_showFuture->isChecked()) { params.append("futureDays", _effectiveDays->value()); params.append("effectiveDays", _effectiveDays->value()); // used by dspSingleBOM } else params.append("futureDays", 0); params.append("always", tr("Always")); params.append("never", tr("Never")); return true; } void dspBOMBase::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));; if (!_privileges->check("MaintainItemMasters")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView()));; } void dspBOMBase::sEdit() { item::editItem(list()->id()); } void dspBOMBase::sView() { item::viewItem(list()->id()); } qt-client-4.1.0/guiclient/displays/dspBOMBase.h000066400000000000000000000021041217451700100213120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DSPBOMBASE_H__ #define __DSPBOMBASE_H__ #include "display.h" #include "guiclient.h" #include #include "ui_dspBOMBase.h" class dspBOMBase : public display, public Ui::dspBOMBase { Q_OBJECT public: dspBOMBase(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual enum SetResponse set(const ParameterList & pParams); protected slots: virtual void languageChange(); }; #endif //__DSPBOMBASE_H__ qt-client-4.1.0/guiclient/displays/dspBOMBase.ui000066400000000000000000000222221217451700100215030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspBOMBase 0 0 537 185 Bill of Materials 0 0 Qt::StrongFocus Qt::Vertical QSizePolicy::Expanding 20 0 Qt::StrongFocus false RevisionLineEdit::View RevisionLineEdit::BOM Show &Expired Components Qt::Horizontal QSizePolicy::Preferred 15 20 false Threshold Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 999 10 Qt::Horizontal QSizePolicy::Expanding 0 16 Show &Future Components Qt::Horizontal QSizePolicy::Preferred 15 20 false Threshold Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 999 10 Qt::Horizontal QSizePolicy::Expanding 0 16 Qt::Vertical 20 13 Qt::Horizontal QSizePolicy::Expanding 0 20 ItemCluster QWidget
    itemcluster.h
    1
    RevisionCluster QWidget
    revisioncluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _item _revision _showExpired _expiredDays _showFuture _effectiveDays _showExpired toggled(bool) _expiredDays setEnabled(bool) 20 20 20 20 _showExpired toggled(bool) _expiredDaysLit setEnabled(bool) 20 20 20 20 _showFuture toggled(bool) _effectiveDays setEnabled(bool) 20 20 20 20 _showFuture toggled(bool) _effectiveDaysLit setEnabled(bool) 20 20 20 20 _item newId(int) _revision setTargetId(int) 136 57 359 25
    qt-client-4.1.0/guiclient/displays/dspBacklog.cpp000066400000000000000000000176451217451700100220170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspBacklog.h" #include #include #include #include #include "salesOrder.h" #include "salesOrderItem.h" #include "parameterwidget.h" #include "printPackingList.h" dspBacklog::dspBacklog(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspBacklog", fl) { setWindowTitle(tr("Backlog")); setReportName("Backlog"); setMetaSQLOptions("backlog", "detail"); setUseAltId(true); setParameterWidgetVisible(true); parameterWidget()->append(tr("Start Order Date"), "startDate", ParameterWidget::Date); parameterWidget()->append(tr("End Order Date"), "endDate", ParameterWidget::Date); parameterWidget()->append(tr("Start Schedule Date"), "startDateSched", ParameterWidget::Date); parameterWidget()->append(tr("End Schedule Date"), "endDateSched", ParameterWidget::Date); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->appendComboBox(tr("Customer Group"), "custgrp_id", XComboBox::CustomerGroups); parameterWidget()->append(tr("Customer Group Pattern"), "custgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Customer Ship-To"), "shipto_id", ParameterWidget::Shipto); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Sales Order"), "cohead_id", ParameterWidget::SalesOrder); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesRepsActive); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); list()->setSelectionMode(QAbstractItemView::ExtendedSelection); list()->addColumn(tr("S/O #/Line #"),_itemColumn, Qt::AlignLeft, true, "coitem_linenumber"); list()->addColumn(tr("Customer/Item Number"), -1, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Order"), _dateColumn, Qt::AlignCenter,true, "cohead_orderdate"); list()->addColumn(tr("Ship/Sched."), _dateColumn, Qt::AlignCenter,true, "coitem_scheddate"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyord"); list()->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyshipped"); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "qtybalance"); if (_privileges->check("ViewCustomerPrices") || _privileges->check("MaintainCustomerPrices")) list()->addColumn(tr("Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "baseextpricebalance"); list()->addColumn(tr("Firm"), _ynColumn, Qt::AlignCenter,false, "coitem_firm"); list()->setPopulateLinear(true); } enum SetResponse dspBacklog::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("custtype_id", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Type"), param); param = pParams.value("custtype_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Type Pattern"), param); param = pParams.value("custgrp_id", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Group"), param); param = pParams.value("custgrp_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Group Pattern"), param); param = pParams.value("prodcat_id", &valid); if (valid) parameterWidget()->setDefault(tr("Product Category"), param); param = pParams.value("prodcat_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Product Category Pattern"), param); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param); param = pParams.value("sohead_id", &valid); if (valid) parameterWidget()->setDefault(tr("Sales Order"), param); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspBacklog::sEditOrder() { salesOrder::editSalesOrder(list()->id(), false); } void dspBacklog::sViewOrder() { salesOrder::viewSalesOrder(list()->id()); } void dspBacklog::sEditItem() { ParameterList params; params.append("mode", "edit"); params.append("soitem_id", list()->altId()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } void dspBacklog::sViewItem() { ParameterList params; params.append("mode", "view"); params.append("soitem_id", list()->altId()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } void dspBacklog::sPrintPackingList() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("sohead_id", ((XTreeWidgetItem*)(selected[i]))->id()); printPackingList newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } void dspBacklog::sAddToPackingListBatch() { XSqlQuery dspAddToPackingListBatch; QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { dspAddToPackingListBatch.prepare("SELECT addToPackingListBatch(:sohead_id) AS result;"); dspAddToPackingListBatch.bindValue(":sohead_id", ((XTreeWidgetItem*)(selected[i]))->id()); dspAddToPackingListBatch.exec(); if (dspAddToPackingListBatch.lastError().type() != QSqlError::NoError) { systemError(this, dspAddToPackingListBatch.lastError().databaseText(), __FILE__, __LINE__); return; } } } void dspBacklog::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { if (list()->id() <= 0) return; QList selected = list()->selectedItems(); QAction *menuItem; if (selected.size() == 1) { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); if (!_privileges->check("MaintainSalesOrders")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder())); if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders"))) menuItem->setEnabled(false); if (list()->altId() != -1) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem())); if (!_privileges->check("MaintainSalesOrders") || list()->rawValue("coitem_firm").toBool()) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View Item..."), this, SLOT(sViewItem())); if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders"))) menuItem->setEnabled(false); } } if (list()->id() > 0) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList())); if (!_privileges->check("PrintPackingLists")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Add to Packing List Batch"), this, SLOT(sAddToPackingListBatch())); if (!_privileges->check("MaintainPackingListBatch")) menuItem->setEnabled(false); } } void dspBacklog::sFillList() { display::sFillList(); list()->expandAll(); } qt-client-4.1.0/guiclient/displays/dspBacklog.h000066400000000000000000000020731217451700100214510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPBACKLOG_H #define DSPBACKLOG_H #include "guiclient.h" #include "display.h" class dspBacklog : public display { Q_OBJECT public: dspBacklog(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sEditItem(); virtual void sViewItem(); virtual void sPrintPackingList(); virtual void sAddToPackingListBatch(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sFillList(); }; #endif // DSPBACKLOG_H qt-client-4.1.0/guiclient/displays/dspBookings.cpp000066400000000000000000000151501217451700100222150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspBookings.h" #include "salesOrder.h" #include "salesOrderItem.h" #include #include #include "xcombobox.h" #include "xtreewidget.h" #include "parameterwidget.h" dspBookings::dspBookings(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspBookings", fl) { setWindowTitle(tr("Bookings")); setReportName("Bookings"); setMetaSQLOptions("bookings", "detail"); setParameterWidgetVisible(true); setUseAltId(true); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date, QDate::currentDate(), true ); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->append(tr("Customer Ship-to"), "shipto_id", ParameterWidget::Shipto); parameterWidget()->appendComboBox(tr("Customer Group"), "custgrp_id", XComboBox::CustomerGroups); parameterWidget()->append(tr("Customer Group Pattern"), "custgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesReps); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number" ); list()->addColumn(tr("Line #"), _seqColumn, Qt::AlignLeft, true, "f_linenumber" ); list()->addColumn(tr("Ord. Date"), _dateColumn, Qt::AlignCenter, true, "cohead_orderdate"); list()->addColumn(tr("Cust. #"), _itemColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, false, "cust_name" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyord" ); list()->addColumn(tr("Unit Price"), _priceColumn, Qt::AlignRight, false, "coitem_price" ); list()->addColumn(tr("Ext. Price"), _bigMoneyColumn, Qt::AlignRight, false, "extprice" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter, false, "currAbbr" ); list()->addColumn(tr("Base Unit Price"), _priceColumn, Qt::AlignRight, true, "baseunitprice" ); list()->addColumn(tr("Base Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "baseextprice" ); } enum SetResponse dspBookings::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; parameterWidget()->setSavedFilters(); param = pParams.value("cust_id", &valid); if (valid) parameterWidget()->setDefault(tr("Customer"), param.toInt()); param = pParams.value("custtype_id", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Type"), param.toInt()); param = pParams.value("custtype_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Type Pattern"), param.toString()); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param.toInt()); param = pParams.value("prodcat_id", &valid); if (valid) parameterWidget()->setDefault(tr("Product Category"), param.toInt()); param = pParams.value("prodcat_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Product Category Pattern"), param.toString()); param = pParams.value("salesrep_id", &valid); if (valid) parameterWidget()->setDefault(tr("Sales Rep."), param.toString()); param = pParams.value("warehous_id", &valid); if (valid) parameterWidget()->setDefault(tr("Site"), param.toInt()); param = pParams.value("startDate", &valid); if (valid) parameterWidget()->setDefault(tr("Start Date"), param.toDate()); param = pParams.value("endDate", &valid); if (valid) parameterWidget()->setDefault(tr("End Date"), param.toDate()); parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspBookings::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int pColumn) { Q_UNUSED(pSelected); Q_UNUSED(pColumn); QAction* viewSoAct = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewOrder())); viewSoAct->setEnabled(_privileges->check("ViewSalesOrders") || _privileges->check("MaintainSalesOrders")); QAction* editSoAct = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditOrder())); editSoAct->setEnabled(_privileges->check("MaintainSalesOrders")); pMenu->addSeparator(); QAction* viewItemAct = pMenu->addAction(tr("View Sales Order Item..."), this, SLOT(sViewItem())); viewItemAct->setEnabled(_privileges->check("ViewSalesOrders") || _privileges->check("MaintainSalesOrders")); QAction* editItemAct = pMenu->addAction(tr("Edit Sales Order Item..."), this, SLOT(sEditItem())); editItemAct->setEnabled(_privileges->check("MaintainSalesOrders")); } void dspBookings::sEditOrder() { salesOrder::editSalesOrder(list()->altId(), false); } void dspBookings::sViewOrder() { salesOrder::viewSalesOrder(list()->altId(), false); } void dspBookings::sEditItem() { ParameterList params; params.append("mode", "edit"); params.append("soitem_id", list()->id()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } void dspBookings::sViewItem() { ParameterList params; params.append("mode", "view"); params.append("soitem_id", list()->id()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/displays/dspBookings.h000066400000000000000000000017531217451700100216660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPBOOKINGS_H #define DSPBOOKINGS_H #include "guiclient.h" #include "display.h" class dspBookings : public display { Q_OBJECT public: dspBookings(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int pColumn); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sEditItem(); virtual void sViewItem(); }; #endif // DSPBOOKINGS_H qt-client-4.1.0/guiclient/displays/dspBriefEarnedCommissions.cpp000066400000000000000000000062211217451700100250330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspBriefEarnedCommissions.h" #include #include #include "xtreewidget.h" dspBriefEarnedCommissions::dspBriefEarnedCommissions(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspBriefEarnedCommissions", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Brief Earned Commissions")); setListLabel(tr("Earned Commissions")); setReportName("BriefEarnedCommissions"); setMetaSQLOptions("briefEarnedCommission", "detail"); connect(_selectedSalesrep, SIGNAL(toggled(bool)), _salesrep, SLOT(setEnabled(bool))); _salesrep->setType(XComboBox::SalesReps); list()->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "salesrep_number" ); list()->addColumn(tr("Sales Rep."), _itemColumn, Qt::AlignLeft, true, "salesrep_name" ); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("S/O #"), _orderColumn, Qt::AlignLeft, true, "cohist_ordernumber" ); list()->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignLeft, true, "cohist_invcnumber" ); list()->addColumn(tr("Invc. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_invcdate" ); list()->addColumn(tr("Ext. Price"), _moneyColumn, Qt::AlignRight, true, "sumextprice" ); list()->addColumn(tr("Commission"), _moneyColumn, Qt::AlignRight, true, "sumcommission" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter, true, "currAbbr" ); list()->addColumn(tr("Base Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "sumbaseextprice" ); list()->addColumn(tr("Base Commission"), _bigMoneyColumn, Qt::AlignRight, true, "sumbasecommission" ); } void dspBriefEarnedCommissions::languageChange() { display::languageChange(); retranslateUi(this); } bool dspBriefEarnedCommissions::setParams(ParameterList ¶ms) { if (!_dates->allValid()) { if (!_dates->startDate().isValid() && isVisible()) { QMessageBox::warning( this, tr("Enter Start Date"), tr("Please enter a valid Start Date.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid() && isVisible()) { QMessageBox::warning( this, tr("Enter End Date"), tr("Please enter a valid End Date.") ); _dates->setFocus(); return false; } } else _dates->appendValue(params); if (_includeMisc->isChecked()) params.append("includeMisc"); if (_selectedSalesrep->isChecked()) params.append("salesrep_id", _salesrep->id()); return true; } qt-client-4.1.0/guiclient/displays/dspBriefEarnedCommissions.h000066400000000000000000000016511217451700100245020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPBRIEFEARNEDCOMMISSIONS_H #define DSPBRIEFEARNEDCOMMISSIONS_H #include "display.h" #include "ui_dspBriefEarnedCommissions.h" class dspBriefEarnedCommissions : public display, public Ui::dspBriefEarnedCommissions { Q_OBJECT public: dspBriefEarnedCommissions(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPBRIEFEARNEDCOMMISSIONS_H qt-client-4.1.0/guiclient/displays/dspBriefEarnedCommissions.ui000066400000000000000000000112061217451700100246650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspBriefEarnedCommissions 0 0 523 106 Brief Earned Commissions All Sales Reps. true Selected Sales Rep. false 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 Include Misc. Charges and Items Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 6 20 DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _allSalesreps _selectedSalesrep _salesrep _includeMisc _selectedSalesrep toggled(bool) _salesrep setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspBriefSalesHistory.cpp000066400000000000000000000067241217451700100240520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspBriefSalesHistory.h" #include #include #include "parameterwidget.h" #include "xtreewidget.h" #include "dspSalesHistory.h" dspBriefSalesHistory::dspBriefSalesHistory(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspBriefSalesHistory", fl) { setWindowTitle(tr("Brief Sales History")); setReportName("BriefSalesHistory"); setMetaSQLOptions("briefSalesHistory", "detail"); setParameterWidgetVisible(true); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date, QDate::currentDate(), true ); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->append(tr("Customer Ship-to"), "shipto_id", ParameterWidget::Shipto); parameterWidget()->appendComboBox(tr("Customer Group"), "custgrp_id", XComboBox::CustomerGroups); parameterWidget()->append(tr("Customer Group Pattern"), "custgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesReps); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); list()->addColumn(tr("Cust. #"), _itemColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Cust. Type"), _orderColumn, Qt::AlignLeft, true, "custtype_code" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignLeft, true, "cohist_ordernumber" ); list()->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignLeft, true, "invoicenumber" ); list()->addColumn(tr("Ord. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_orderdate" ); list()->addColumn(tr("Invc. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_invcdate" ); list()->addColumn(tr("Total"), _bigMoneyColumn, Qt::AlignRight, true, "extended" ); } void dspBriefSalesHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if (list()->id() > -1) menuItem = pMenu->addAction(tr("View Sales Detail..."), this, SLOT(sViewHistory())); } void dspBriefSalesHistory::sViewHistory() { ParameterList params; params.append("cohead_id", list()->id()); params.append("run"); dspSalesHistory *newdlg = new dspSalesHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/displays/dspBriefSalesHistory.h000066400000000000000000000015251217451700100235110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPBRIEFSALESHISTORY_H #define DSPBRIEFSALESHISTORY_H #include "display.h" class dspBriefSalesHistory : public display { Q_OBJECT public: dspBriefSalesHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sViewHistory(); }; #endif // DSPBRIEFSALESHISTORY_H qt-client-4.1.0/guiclient/displays/dspCapacityUOMsByClassCode.cpp000066400000000000000000000033141217451700100250160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCapacityUOMsByClassCode.h" #include "guiclient.h" #include "xtreewidget.h" dspCapacityUOMsByClassCode::dspCapacityUOMsByClassCode(QWidget* parent, const char*, Qt::WFlags fl) : dspCapacityUOMsByParameter(parent, "dspCapacityUOMsByClassCode", fl) { setWindowTitle(tr("Capacity UOMs by Class Code")); setReportName("CapacityUOMsByClassCode"); _parameter->setType(ParameterGroup::ClassCode); list()->addColumn(tr("Class Code"), _itemColumn, Qt::AlignCenter,true, "classcode_code"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("Inv. UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("Cap. UOM"), _uomColumn, Qt::AlignCenter,true, "capuom"); list()->addColumn(tr("Cap./Inv. Rat."),_qtyColumn, Qt::AlignRight, true, "capinvrat"); list()->addColumn(tr("Alt. UOM"), _uomColumn, Qt::AlignCenter,true, "altcapuom"); list()->addColumn(tr("Alt/Inv Ratio"), _qtyColumn, Qt::AlignRight, true, "altcapinvrat"); } bool dspCapacityUOMsByClassCode::setParams(ParameterList ¶ms) { params.append("getclasscode"); return dspCapacityUOMsByParameter::setParams(params); } qt-client-4.1.0/guiclient/displays/dspCapacityUOMsByClassCode.h000066400000000000000000000015161217451700100244650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCAPACITYUOMSBYCLASSCODE_H #define DSPCAPACITYUOMSBYCLASSCODE_H #include "dspCapacityUOMsByParameter.h" class dspCapacityUOMsByClassCode : public dspCapacityUOMsByParameter { Q_OBJECT public: dspCapacityUOMsByClassCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); }; #endif // DSPCAPACITYUOMSBYCLASSCODE_H qt-client-4.1.0/guiclient/displays/dspCapacityUOMsByParameter.cpp000066400000000000000000000025661217451700100251060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCapacityUOMsByParameter.h" #include #include #include #include "item.h" dspCapacityUOMsByParameter::dspCapacityUOMsByParameter(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { setupUi(optionsWidget()); setListLabel(tr("Capacity UOMs")); setMetaSQLOptions("capacityUOMs", "detail"); } void dspCapacityUOMsByParameter::languageChange() { display::languageChange(); retranslateUi(this); } bool dspCapacityUOMsByParameter::setParams(ParameterList ¶ms) { _parameter->appendValue(params); return true; } void dspCapacityUOMsByParameter::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem()));; if (!_privileges->check("MaintainItemMasters")) menuItem->setEnabled(false); } void dspCapacityUOMsByParameter::sEditItem() { item::editItem(list()->id()); } qt-client-4.1.0/guiclient/displays/dspCapacityUOMsByParameter.h000066400000000000000000000020461217451700100245440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DSPCAPACITYUOMSBYPARAMETER_H__ #define __DSPCAPACITYUOMSBYPARAMETER_H__ #include "display.h" #include "ui_dspCapacityUOMsByParameter.h" class dspCapacityUOMsByParameter : public display, public Ui::dspCapacityUOMsByParameter { Q_OBJECT public: dspCapacityUOMsByParameter(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sEditItem(); protected slots: virtual void languageChange(); }; #endif // DSPCAPACITYUOMSBYPARAMETER_H qt-client-4.1.0/guiclient/displays/dspCapacityUOMsByParameter.ui000066400000000000000000000043161217451700100247340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCapacityUOMsByParameter 0 0 283 124 Capacity UOMs by Class Code false Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 ParameterGroup QGroupBox
    parametergroup.h
    _paremeter
    qt-client-4.1.0/guiclient/displays/dspCapacityUOMsByProductCategory.cpp000066400000000000000000000027561217451700100263050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCapacityUOMsByProductCategory.h" #include "xtreewidget.h" dspCapacityUOMsByProductCategory::dspCapacityUOMsByProductCategory(QWidget* parent, const char*, Qt::WFlags fl) : dspCapacityUOMsByParameter(parent, "dspCapacityUOMsByProductCategory", fl) { setWindowTitle(tr("Capacity UOMs by Product Category")); setReportName("CapacityUOMsByProductCategory"); _parameter->setType(ParameterGroup::ProductCategory); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("Inv. UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("Cap. UOM"), _uomColumn, Qt::AlignCenter,true, "capuom"); list()->addColumn(tr("Cap./Inv. Rat."), _qtyColumn, Qt::AlignRight, true, "capinvrat"); list()->addColumn(tr("Alt. UOM"), _uomColumn, Qt::AlignCenter,true, "altcapuom"); list()->addColumn(tr("Alt/Inv Ratio"), _qtyColumn, Qt::AlignRight, true, "altcapinvrat"); } qt-client-4.1.0/guiclient/displays/dspCapacityUOMsByProductCategory.h000066400000000000000000000014761217451700100257500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCAPACITYUOMSBYPRODUCTCATEGORY_H #define DSPCAPACITYUOMSBYPRODUCTCATEGORY_H #include "dspCapacityUOMsByParameter.h" class dspCapacityUOMsByProductCategory : public dspCapacityUOMsByParameter { Q_OBJECT public: dspCapacityUOMsByProductCategory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); }; #endif // DSPCAPACITYUOMSBYPRODUCTCATEGORY_H qt-client-4.1.0/guiclient/displays/dspCostedBOMBase.cpp000066400000000000000000000115011217451700100230100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCostedBOMBase.h" #include #include #include #include #include #include #include #include #include "dspItemCostSummary.h" #include "maintainItemCosts.h" dspCostedBOMBase::dspCostedBOMBase(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { setupUi(optionsWidget()); setListLabel(tr("Costed Bill of Materials")); setMetaSQLOptions("costedBOM", "detail"); setUseAltId(true); QButtonGroup* _costsGroupInt = new QButtonGroup(this); _costsGroupInt->addButton(_useStandardCosts); _costsGroupInt->addButton(_useActualCosts); _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cPhantom | ItemLineEdit::cKit | ItemLineEdit::cPlanning |ItemLineEdit::cTooling); list()->addColumn(tr("Seq #"), _itemColumn, Qt::AlignLeft, true, "bomdata_bomwork_seqnumber"); list()->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "bomdata_item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "bomdata_itemdescription"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "bomdata_uom_name"); list()->addColumn(tr("Batch Sz."), _qtyColumn, Qt::AlignRight, true, "bomdata_batchsize"); list()->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "bomdata_qtyfxd"); list()->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "bomdata_qtyper"); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomdata_scrap"); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter,true, "bomdata_effective"); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter,true, "bomdata_expires"); list()->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "unitcost"); list()->addColumn(tr("Ext. Cost"), _priceColumn,Qt::AlignRight, true, "extendedcost"); list()->setPopulateLinear(); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), this, SLOT(sFillList(int, bool))); _revision->setMode(RevisionLineEdit::View); _revision->setType("BOM"); _revision->setVisible(_metrics->boolean("RevControl")); } void dspCostedBOMBase::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspCostedBOMBase::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); { _item->setId(param.toInt()); _item->setReadOnly(true); param = pParams.value("revision_id", &valid); if (valid) _revision->setId(param.toInt()); } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspCostedBOMBase::setParams(ParameterList ¶ms) { if (! _item->isValid()) { QMessageBox::critical(this, tr("Need Item Number"), tr("You must select an Item to see its BOM.")); _item->setFocus(); return false; } params.append("item_id", _item->id()); params.append("revision_id", _revision->id()); if(_useStandardCosts->isChecked()) params.append("useStandardCosts"); if(_useActualCosts->isChecked()) params.append("useActualCosts"); params.append("always", tr("Always")); params.append("never", tr("Never")); return true; } void dspCostedBOMBase::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { if (((XTreeWidgetItem *)pSelected)->id() != -1) pMenu->addAction(tr("Maintain Item Costs..."), this, SLOT(sMaintainItemCosts())); if (((XTreeWidgetItem *)pSelected)->id() != -1) pMenu->addAction(tr("View Item Costing..."), this, SLOT(sViewItemCosting())); } void dspCostedBOMBase::sMaintainItemCosts() { ParameterList params; params.append("item_id", list()->altId()); maintainItemCosts *newdlg = new maintainItemCosts(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspCostedBOMBase::sViewItemCosting() { ParameterList params; params.append( "item_id", list()->altId() ); params.append( "run", true ); dspItemCostSummary *newdlg = new dspItemCostSummary(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspCostedBOMBase::sFillList() { display::sFillList(); } void dspCostedBOMBase::sFillList(int pItemid, bool) { if (pItemid != _item->id()) return; sFillList(); } qt-client-4.1.0/guiclient/displays/dspCostedBOMBase.h000066400000000000000000000022721217451700100224620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DSPCOSTEDBOMBASE_H__ #define __DSPCOSTEDBOMBASE_H__ #include "display.h" #include "ui_dspCostedBOMBase.h" class dspCostedBOMBase : public display, public Ui::dspCostedBOMBase { Q_OBJECT public: dspCostedBOMBase(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sMaintainItemCosts(); virtual void sViewItemCosting(); virtual void sFillList(); virtual void sFillList( int pItemid, bool ); protected slots: virtual void languageChange(); }; #endif // __DSPCOSTEDBOMBASE_H__ qt-client-4.1.0/guiclient/displays/dspCostedBOMBase.ui000066400000000000000000000114241217451700100226470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCostedBOMBase 0 0 535 148 Costed Single Level Bill of Materials Qt::StrongFocus Qt::Vertical 20 0 Qt::StrongFocus false RevisionLineEdit::View RevisionLineEdit::BOM Use Standard Costs true Use Actual Costs Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 ItemCluster QWidget
    itemcluster.h
    1
    RevisionCluster QWidget
    revisioncluster.h
    _item _revision _useStandardCosts _useActualCosts _item newId(int) _revision setTargetId(int) 163 59 410 25
    qt-client-4.1.0/guiclient/displays/dspCostedIndentedBOM.cpp000066400000000000000000000046431217451700100237010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCostedIndentedBOM.h" #include #include dspCostedIndentedBOM::dspCostedIndentedBOM(QWidget* parent, const char*, Qt::WFlags fl) : dspCostedBOMBase(parent, "dspCostedIndentedBOM", fl) { setWindowTitle(tr("Costed Indented Bill of Materials")); setReportName("CostedIndentedBOM"); list()->setRootIsDecorated(true); list()->setIndentation(10); list()->setPopulateLinear(true); } bool dspCostedIndentedBOM::setParams(ParameterList ¶ms) { params.append("indentedBOM"); return dspCostedBOMBase::setParams(params); } void dspCostedIndentedBOM::sFillList() { dspCostedBOMBase::sFillList(); XSqlQuery qq; qq.prepare( "SELECT formatCost(SUM(bomdata_actextendedcost)) AS actextendedcost," " formatCost(SUM(bomdata_stdextendedcost)) AS stdextendedcost," " formatCost(actcost(:item_id)) AS actual," " formatCost(stdcost(:item_id)) AS standard " "FROM indentedbom(:item_id," " :revision_id,0,0)" "WHERE (bomdata_bomwork_level=1) " "GROUP BY actual, standard;" ); qq.bindValue(":item_id", _item->id()); qq.bindValue(":revision_id",_revision->id()); qq.exec(); if (qq.first()) { XTreeWidgetItem *last = new XTreeWidgetItem(list(), -1, -1); last->setText(1, tr("Total Cost")); if(_useStandardCosts->isChecked()) last->setText(11, qq.value("stdextendedcost").toString()); else last->setText(11, qq.value("actextendedcost").toString()); last = new XTreeWidgetItem( list(), -1, -1); last->setText(1, tr("Actual Cost")); last->setText(11, qq.value("actual").toString()); last = new XTreeWidgetItem( list(), -1, -1); last->setText(1, tr("Standard Cost")); last->setText(11, qq.value("standard").toString()); } else if (qq.lastError().type() != QSqlError::NoError) { systemError(this, qq.lastError().databaseText(), __FILE__, __LINE__); return; } list()->expandAll(); } qt-client-4.1.0/guiclient/displays/dspCostedIndentedBOM.h000066400000000000000000000015161217451700100233420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOSTEDINDENTEDBOM_H #define DSPCOSTEDINDENTEDBOM_H #include "dspCostedBOMBase.h" class dspCostedIndentedBOM : public dspCostedBOMBase { Q_OBJECT public: dspCostedIndentedBOM(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual void sFillList(); }; #endif // DSPCOSTEDINDENTEDBOM_H qt-client-4.1.0/guiclient/displays/dspCostedSingleLevelBOM.cpp000066400000000000000000000032151217451700100243520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCostedSingleLevelBOM.h" #include #include dspCostedSingleLevelBOM::dspCostedSingleLevelBOM(QWidget* parent, const char*, Qt::WFlags fl) : dspCostedBOMBase(parent, "dspCostedSingleLevelBOM", fl) { setWindowTitle(tr("Costed Single Level Bill of Materials")); setReportName("CostedSingleLevelBOM"); } bool dspCostedSingleLevelBOM::setParams(ParameterList ¶ms) { params.append("singleLevelBOM"); return dspCostedBOMBase::setParams(params); } void dspCostedSingleLevelBOM::sFillList() { dspCostedBOMBase::sFillList(); XSqlQuery qq; qq.prepare( "SELECT formatCost(actcost(:item_id)) AS actual," " formatCost(stdcost(:item_id)) AS standard;" ); qq.bindValue(":item_id", _item->id()); qq.exec(); if (qq.first()) { XTreeWidgetItem *last = new XTreeWidgetItem(list(), -1, -1, tr("Actual Cost"), ""); last->setText(11, qq.value("actual").toString()); last = new XTreeWidgetItem(list(), last, -1, -1, tr("Standard Cost"), "" ); last->setText(11, qq.value("standard").toString()); } else if (qq.lastError().type() != QSqlError::NoError) { systemError(this, qq.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/displays/dspCostedSingleLevelBOM.h000066400000000000000000000015361217451700100240230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOSTEDSINGLELEVELBOM_H #define DSPCOSTEDSINGLELEVELBOM_H #include "dspCostedBOMBase.h" class dspCostedSingleLevelBOM : public dspCostedBOMBase { Q_OBJECT public: dspCostedSingleLevelBOM(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual void sFillList(); }; #endif // DSPCOSTEDSINGLELEVELBOM_H qt-client-4.1.0/guiclient/displays/dspCostedSummarizedBOM.cpp000066400000000000000000000074451217451700100242720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCostedSummarizedBOM.h" #include #include dspCostedSummarizedBOM::dspCostedSummarizedBOM(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspCostedSummarizedBOM", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Costed Summarized Bill of Materials")); setListLabel(tr("Costed Bill of Material")); setReportName("CostedSummarizedBOM"); setMetaSQLOptions("costedBOM", "detail"); QButtonGroup* _costsGroupInt = new QButtonGroup(this); _costsGroupInt->addButton(_useStandardCosts); _costsGroupInt->addButton(_useActualCosts); _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cPhantom | ItemLineEdit::cKit | ItemLineEdit::cPlanning | ItemLineEdit::cTooling); list()->setRootIsDecorated(true); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "bomdata_item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "bomdata_itemdescription"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "bomdata_uom_name"); list()->addColumn(tr("Qty. Req."), _qtyColumn, Qt::AlignRight, true, "bomdata_qtyreq"); list()->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "unitcost"); list()->addColumn(tr("Ext. Cost"), _priceColumn, Qt::AlignRight, true, "extendedcost"); list()->setIndentation(10); _expiredDaysLit->setEnabled(_showExpired->isChecked()); _expiredDays->setEnabled(_showExpired->isChecked()); _effectiveDaysLit->setEnabled(_showFuture->isChecked()); _effectiveDays->setEnabled(_showFuture->isChecked()); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), this, SLOT(sFillList(int, bool))); _revision->setMode(RevisionLineEdit::View); _revision->setType("BOM"); _revision->setVisible(_metrics->boolean("RevControl")); } void dspCostedSummarizedBOM::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspCostedSummarizedBOM::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); param = pParams.value("revision_id", &valid); if (valid) _revision->setId(param.toInt()); } if (pParams.inList("run")) { sFillList(); return NoError_Print; } return NoError; } bool dspCostedSummarizedBOM::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } params.append("item_id", _item->id()); params.append("revision_id", _revision->id()); if(_showExpired->isChecked()) params.append("expiredDays", _expiredDays->value()); else params.append("expiredDays", 0); if(_showFuture->isChecked()) params.append("futureDays", _effectiveDays->value()); else params.append("futureDays", 0); if (_useStandardCosts->isChecked()) params.append("useStandardCosts"); if (_useActualCosts->isChecked()) params.append("useActualCosts"); params.append("summarizedBOM"); return true; } void dspCostedSummarizedBOM::sFillList() { display::sFillList(); list()->collapseAll(); } void dspCostedSummarizedBOM::sFillList(int pid, bool) { if (pid == _item->id()) sFillList(); } qt-client-4.1.0/guiclient/displays/dspCostedSummarizedBOM.h000066400000000000000000000021101217451700100237170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOSTEDSUMMARIZEDBOM_H #define DSPCOSTEDSUMMARIZEDBOM_H #include "guiclient.h" #include "display.h" #include "ui_dspCostedSummarizedBOM.h" class dspCostedSummarizedBOM : public display, public Ui::dspCostedSummarizedBOM { Q_OBJECT public: dspCostedSummarizedBOM(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sFillList(); virtual void sFillList(int, bool); protected slots: virtual void languageChange(); }; #endif // DSPCOSTEDSUMMARIZEDBOM_H qt-client-4.1.0/guiclient/displays/dspCostedSummarizedBOM.ui000066400000000000000000000304261217451700100241200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCostedSummarizedBOM 0 0 624 176 Costed Summarized Bill of Materials Qt::StrongFocus 0 Qt::StrongFocus RevisionLineEdit::View RevisionLineEdit::BOM Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Show &Expired Components Qt::Horizontal QSizePolicy::Fixed 20 13 false Threshold Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 999 10 Qt::Horizontal QSizePolicy::Preferred 13 16 Show &Future Components Qt::Horizontal QSizePolicy::Fixed 20 13 false Threshold Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 999 10 Qt::Horizontal QSizePolicy::Preferred 13 13 0 Use Standard Costs true Use Actual Costs Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 0 ItemCluster QWidget
    itemcluster.h
    1
    RevisionCluster QWidget
    revisioncluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _item _revision _showExpired _expiredDays _showFuture _effectiveDays _useStandardCosts _useActualCosts _showExpired toggled(bool) _expiredDaysLit setEnabled(bool) 20 20 20 20 _showExpired toggled(bool) _expiredDays setEnabled(bool) 20 20 20 20 _showFuture toggled(bool) _effectiveDaysLit setEnabled(bool) 20 20 20 20 _showFuture toggled(bool) _effectiveDays setEnabled(bool) 20 20 20 20 _item newId(int) _revision setTargetId(int) 126 41 339 25
    qt-client-4.1.0/guiclient/displays/dspCountSlipsByWarehouse.cpp000066400000000000000000000112221217451700100247170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCountSlipsByWarehouse.h" #include #include #include "xtreewidget.h" #define DEBUG false dspCountSlipsByWarehouse::dspCountSlipsByWarehouse(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, "dspCountSlipsByWarehouse", fl) { if (name) setObjectName(name); setupUi(optionsWidget()); setWindowTitle(tr("Count Slips by Site")); setListLabel(tr("Count Slips")); setReportName("CountSlipsByWarehouse"); setMetaSQLOptions("countSlip", "detail"); // before connect so we don't repeatedly trigger the query if (_preferences->boolean("XCheckBox/forgetful")) _showUnposted->setChecked(true); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Slip #"), _itemColumn, Qt::AlignLeft, true, "cntslip_number"); list()->addColumn(tr("Tag #"), _orderColumn, Qt::AlignLeft, true, "invcnt_tagnumber"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("Entered"), _dateColumn, Qt::AlignCenter,true, "cntslip_entered"); list()->addColumn(tr("By"), _userColumn, Qt::AlignCenter,true, "user"); list()->addColumn(tr("Qty. Counted"),_qtyColumn, Qt::AlignRight, true, "cntslip_qty"); list()->addColumn(tr("Posted"), _dateColumn, Qt::AlignCenter,true, "cntslip_posted"); list()->setPopulateLinear(); sFillList(); } void dspCountSlipsByWarehouse::languageChange() { display::languageChange(); retranslateUi(this); } void dspCountSlipsByWarehouse::sFillList() { if (DEBUG) qDebug("dspCountSlipsByWarehouse::sFillList() about to populate _cntslip"); display::sFillList(); if (_numericSlips->isChecked() && list()->topLevelItemCount() > 1) { if (DEBUG) qDebug("dspCountSlipsByWarehouse::sFillList() looking for slip # gaps " "in %d items", list()->topLevelItemCount()); XTreeWidgetItem *last =list()->topLevelItem(0); int slipNumber = last->rawValue("slipnumber").toInt(); for (int i = 1; i < list()->topLevelItemCount(); i++) { XTreeWidgetItem *curr = list()->topLevelItem(i); if (DEBUG) qDebug("row %d has slipNumber %d and current %d", i, slipNumber, curr->rawValue("slipnumber").toInt()); if (slipNumber == (curr->rawValue("slipnumber").toInt() - 1) || slipNumber == -1) slipNumber = curr->rawValue("slipnumber").toInt(); else if (slipNumber >= 0) { if (slipNumber == curr->rawValue("slipnumber").toInt() - 2) curr = new XTreeWidgetItem( list(), last, -1, QVariant("----"), "----", "----", "----", tr("Missing Slip #%1").arg(slipNumber + 1), "----", "----", "----" ); else curr = new XTreeWidgetItem( list(), last, -1, QVariant("----"), "----", "----", "----", tr("Missing Slips #%1 to #%2").arg(slipNumber + 1).arg(curr->rawValue("slipnumber").toInt() - 1), "----", "----", "----" ); curr->setTextColor(namedColor("error")); slipNumber = -1; //i++; // 'cause we just added an item! } last = curr; } } } bool dspCountSlipsByWarehouse::setParams(ParameterList ¶ms) { if (isVisible()) { if (!_dates->startDate().isValid()) { QMessageBox::warning( this, tr("Enter Start Date"), tr("Please enter a valid Start Date.") ); _dates->setFocus(); return false; } else if (!_dates->endDate().isValid()) { QMessageBox::warning( this, tr("Enter End Date"), tr("Please enter a valid End Date.") ); _dates->setFocus(); return false; } else _dates->appendValue(params); } _warehouse->appendValue(params); if (_showUnposted->isChecked()) params.append("showUnposted"); params.append("byWarehouse"); return true; } qt-client-4.1.0/guiclient/displays/dspCountSlipsByWarehouse.h000066400000000000000000000017171217451700100243740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOUNTSLIPSBYWAREHOUSE_H #define DSPCOUNTSLIPSBYWAREHOUSE_H #include "display.h" #include "ui_dspCountSlipsByWarehouse.h" class dspCountSlipsByWarehouse : public display, public Ui::dspCountSlipsByWarehouse { Q_OBJECT public: dspCountSlipsByWarehouse(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPCOUNTSLIPSBYWAREHOUSE_H qt-client-4.1.0/guiclient/displays/dspCountSlipsByWarehouse.ui000066400000000000000000000105531217451700100245600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCountSlipsByWarehouse 0 0 478 152 Count Slips by Site 0 false Qt::Vertical 20 0 Qt::Horizontal 0 20 Show Unposted Count Slips Treat Slip &Numbers as Numeric Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 0 DateCluster QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _warehouse
    qt-client-4.1.0/guiclient/displays/dspCountTagsBase.cpp000066400000000000000000000061111217451700100231410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCountTagsBase.h" #include #include #include #include #include "countTag.h" dspCountTagsBase::dspCountTagsBase(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { setupUi(optionsWidget()); setListLabel(tr("Count Tags")); setMetaSQLOptions("countTags", "detail"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Tag #"), -1, Qt::AlignLeft, true, "invcnt_tagnumber"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Created"), _dateColumn, Qt::AlignCenter,true, "invcnt_tagdate"); list()->addColumn(tr("Created By"), _dateColumn, Qt::AlignCenter,true, "creator"); list()->addColumn(tr("Entered"), _dateColumn, Qt::AlignCenter,true, "invcnt_cntdate"); list()->addColumn(tr("Entered By"), _dateColumn, Qt::AlignCenter,true, "counter"); list()->addColumn(tr("Posted"), _dateColumn, Qt::AlignCenter,true, "invcnt_postdate"); list()->addColumn(tr("Posted By"), _dateColumn, Qt::AlignCenter,true, "poster"); list()->addColumn(tr("QOH Before"), _qtyColumn, Qt::AlignRight, true, "qohbefore"); list()->addColumn(tr("Qty. Counted"),_qtyColumn, Qt::AlignRight, true, "invcnt_qoh_after"); list()->addColumn(tr("Variance"), _qtyColumn, Qt::AlignRight, true, "variance"); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "percent"); if (_preferences->boolean("XCheckBox/forgetful")) _showUnposted->setChecked(true); sFillList(); } void dspCountTagsBase::languageChange() { display::languageChange(); retranslateUi(this); } bool dspCountTagsBase::setParams(ParameterList ¶ms) { if(_item->isVisibleTo(this)) { if (! _item->isValid()) { return false; } params.append("item_id", _item->id()); } if (! _dates->allValid()) { return false; } if(_parameter->isVisibleTo(this)) _parameter->appendValue(params); _warehouse->appendValue(params); _dates->appendValue(params); if (_showUnposted->isChecked()) params.append("showUnposted"); return true; } void dspCountTagsBase::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { pMenu->addAction(tr("View Count Tag..."), this, SLOT(sView())); } void dspCountTagsBase::sView() { ParameterList params; params.append("mode", "view"); params.append("cnttag_id", list()->id()); countTag newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/displays/dspCountTagsBase.h000066400000000000000000000017451217451700100226160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DSPCOUNTTAGSBASE_H__ #define __DSPCOUNTTAGSBASE_H__ #include "display.h" #include "ui_dspCountTagsBase.h" class dspCountTagsBase : public display, public Ui::dspCountTagsBase { Q_OBJECT public: dspCountTagsBase(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sView(); protected slots: virtual void languageChange(); }; #endif // __DSPCOUNTTAGSBASE_H__ qt-client-4.1.0/guiclient/displays/dspCountTagsBase.ui000066400000000000000000000136251217451700100230040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCountTagsBase 0 0 546 258 Count Tags by Class Code false 0 0 Qt::Horizontal QSizePolicy::Expanding 0 0 0 false Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Show Unposted Count Tags Qt::Horizontal QSizePolicy::Expanding 0 13 Qt::Vertical QSizePolicy::Expanding 20 0 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _parameter _showUnposted _warehouse _dates
    qt-client-4.1.0/guiclient/displays/dspCountTagsByClassCode.cpp000066400000000000000000000014431217451700100244250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCountTagsByClassCode.h" dspCountTagsByClassCode::dspCountTagsByClassCode(QWidget* parent, const char*, Qt::WFlags fl) : dspCountTagsBase(parent, "dspCountTagsByClassCode", fl) { setWindowTitle(tr("Count Tags by Class Code")); setReportName("CountTagsByClassCode"); _parameter->setType(ParameterGroup::ClassCode); _itemGroup->hide(); } qt-client-4.1.0/guiclient/displays/dspCountTagsByClassCode.h000066400000000000000000000013751217451700100240760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOUNTTAGSBYCLASSCODE_H #define DSPCOUNTTAGSBYCLASSCODE_H #include "dspCountTagsBase.h" class dspCountTagsByClassCode : public dspCountTagsBase { Q_OBJECT public: dspCountTagsByClassCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); }; #endif // DSPCOUNTTAGSBYCLASSCODE_H qt-client-4.1.0/guiclient/displays/dspCountTagsByItem.cpp000066400000000000000000000013251217451700100234620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCountTagsByItem.h" dspCountTagsByItem::dspCountTagsByItem(QWidget* parent, const char*, Qt::WFlags fl) : dspCountTagsBase(parent, "dspCountTagsByItem", fl) { setWindowTitle(tr("Count Tags by Item")); setReportName("CountTagsByItem"); _parameter->hide(); } qt-client-4.1.0/guiclient/displays/dspCountTagsByItem.h000066400000000000000000000013441217451700100231300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOUNTTAGSBYITEM_H #define DSPCOUNTTAGSBYITEM_H #include "dspCountTagsBase.h" class dspCountTagsByItem : public dspCountTagsBase { Q_OBJECT public: dspCountTagsByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); }; #endif // DSPCOUNTTAGSBYITEM_H qt-client-4.1.0/guiclient/displays/dspCountTagsByWarehouse.cpp000066400000000000000000000014011217451700100245210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCountTagsByWarehouse.h" dspCountTagsByWarehouse::dspCountTagsByWarehouse(QWidget* parent, const char*, Qt::WFlags fl) : dspCountTagsBase(parent, "dspCountTagsByWarehouse", fl) { setWindowTitle(tr("Count Tags by Site")); setReportName("CountTagsByWarehouse"); _parameter->hide(); _itemGroup->hide(); } qt-client-4.1.0/guiclient/displays/dspCountTagsByWarehouse.h000066400000000000000000000013751217451700100242000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOUNTTAGSBYWAREHOUSE_H #define DSPCOUNTTAGSBYWAREHOUSE_H #include "dspCountTagsBase.h" class dspCountTagsByWarehouse : public dspCountTagsBase { Q_OBJECT public: dspCountTagsByWarehouse(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); }; #endif // DSPCOUNTTAGSBYWAREHOUSE_H qt-client-4.1.0/guiclient/displays/dspCustomerARHistory.cpp000066400000000000000000000117121217451700100240500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCustomerARHistory.h" #include #include #include #include #include "arOpenItem.h" dspCustomerARHistory::dspCustomerARHistory(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, "dspCustomerARHistory", fl) { Q_UNUSED(name); setupUi(optionsWidget()); setWindowTitle(tr("Customer History")); setListLabel(tr("Customer History")); setReportName("CustomerARHistory"); setMetaSQLOptions("arHistory", "detail"); setUseAltId(true); list()->setRootIsDecorated(true); list()->addColumn(tr("Open"), _dateColumn, Qt::AlignCenter, true, "open" ); list()->addColumn(tr("Doc. Type"), _itemColumn, Qt::AlignCenter, true, "documenttype" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignRight, true, "docnumber" ); list()->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, true, "docdate" ); list()->addColumn(tr("Due/Dist Date"), _dateColumn, Qt::AlignCenter, true, "duedate" ); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "amount" ); list()->addColumn(tr("Balance"), _moneyColumn, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter, true, "currAbbr" ); list()->addColumn(tr("Base Balance"), _bigMoneyColumn, Qt::AlignRight, true, "base_balance" ); _cust->setType(CLineEdit::ActiveCustomers); } void dspCustomerARHistory::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspCustomerARHistory::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) _cust->setId(param.toInt()); param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspCustomerARHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; if (((XTreeWidgetItem *)pSelected)->id() != -1) { menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("EditAROpenItem")); pMenu->addAction(tr("View..."), this, SLOT(sView())); } } void dspCustomerARHistory::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("aropen_id", list()->id()); arOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspCustomerARHistory::sView() { ParameterList params; params.append("mode", "view"); if (list()->id() == -1) params.append("aropen_id", list()->altId()); else params.append("aropen_id", list()->id()); arOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } bool dspCustomerARHistory::setParams(ParameterList ¶ms) { if (!_cust->isValid()) { if (isVisible()) { QMessageBox::warning( this, tr("Enter Customer Number"), tr("Please enter a valid Customer Number.") ); _cust->setFocus(); } return false; } if (!_dates->startDate().isValid()) { if (isVisible()) { QMessageBox::warning( this, tr("Enter Start Date"), tr("Please enter a valid Start Date.") ); _dates->setFocus(); } return false; } if (!_dates->endDate().isValid()) { if (isVisible()) { QMessageBox::warning( this, tr("Enter End Date"), tr("Please enter a valid End Date.") ); _dates->setFocus(); } return false; } _dates->appendValue(params); params.append("invoice", tr("Invoice")); params.append("zeroinvoice", tr("Zero Invoice")); params.append("creditMemo", tr("Credit Memo")); params.append("debitMemo", tr("Debit Memo")); params.append("check", tr("Check")); params.append("certifiedCheck", tr("Certified Check")); params.append("masterCard", tr("Master Card")); params.append("visa", tr("Visa")); params.append("americanExpress", tr("American Express")); params.append("discoverCard", tr("Discover Card")); params.append("otherCreditCard", tr("Other Credit Card")); params.append("cash", tr("Cash")); params.append("wireTransfer", tr("Wire Transfer")); params.append("cashdeposit", tr("Customer Deposit")); params.append("other", tr("Other")); params.append("cust_id", _cust->id()); return true; } qt-client-4.1.0/guiclient/displays/dspCustomerARHistory.h000066400000000000000000000021631217451700100235150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCUSTOMERARHISTORY_H #define DSPCUSTOMERARHISTORY_H #include "guiclient.h" #include "display.h" #include "ui_dspCustomerARHistory.h" class dspCustomerARHistory : public display, public Ui::dspCustomerARHistory { Q_OBJECT public: dspCustomerARHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sEdit(); virtual void sView(); protected slots: virtual void languageChange(); }; #endif // DSPCUSTOMERARHISTORY_H qt-client-4.1.0/guiclient/displays/dspCustomerARHistory.ui000066400000000000000000000074241217451700100237100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCustomerARHistory 0 0 569 133 Customer History 0 Selection 0 0 270 75 Qt::Vertical QSizePolicy::Expanding 20 0 0 Document Date Range Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 1 20 CustCluster QWidget
    custcluster.h
    DateCluster QWidget
    datecluster.h
    _cust _dates
    qt-client-4.1.0/guiclient/displays/dspDepositsRegister.cpp000066400000000000000000000064441217451700100237470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspDepositsRegister.h" #include #include #include "xtreewidget.h" dspDepositsRegister::dspDepositsRegister(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspDepositsRegister", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Deposits Register")); setListLabel(tr("Transactions")); setReportName("DepositsRegister"); setMetaSQLOptions("depositesRegister", "detail"); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "trans_date" ); list()->addColumn(tr("Source"), _orderColumn, Qt::AlignCenter, true, "trans_source" ); list()->addColumn(tr("Doc Type"), _orderColumn, Qt::AlignLeft, true, "doctype" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "trans_docnumber" ); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, true, "f_notes" ); list()->addColumn(tr("Account"), _itemColumn, Qt::AlignLeft, true, "f_accnt" ); list()->addColumn(tr("Amount Rcv'd"), _moneyColumn, Qt::AlignRight, true, "debit" ); list()->addColumn(tr("Credit to A/R"), _moneyColumn, Qt::AlignRight, true, "credit" ); list()->addColumn(tr("Balance"), _moneyColumn, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter, true, "currAbbr" ); list()->addColumn(tr("Base Balance"), _bigMoneyColumn, Qt::AlignRight, true, "base_balance" ); } void dspDepositsRegister::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspDepositsRegister::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); param = pParams.value("period_id", &valid); if (valid) { XSqlQuery qq; qq.prepare( "SELECT period_start, period_end " "FROM period " "WHERE (period_id=:period_id);" ); qq.bindValue(":period_id", param.toInt()); qq.exec(); if (qq.first()) { _dates->setStartDate(qq.value("period_start").toDate()); _dates->setEndDate(qq.value("period_end").toDate()); } } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspDepositsRegister::setParams(ParameterList ¶ms) { if (!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date(s)"), tr("You must specify a valid date range.") ); _dates->setFocus(); return false; } else _dates->appendValue(params); params.append("invoice", tr("Invoice")); params.append("creditmemo", tr("Credit Memo")); return true; } qt-client-4.1.0/guiclient/displays/dspDepositsRegister.h000066400000000000000000000017501217451700100234070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPDEPOSITSREGISTER_H #define DSPDEPOSITSREGISTER_H #include "guiclient.h" #include "display.h" #include "ui_dspDepositsRegister.h" class dspDepositsRegister : public display, public Ui::dspDepositsRegister { Q_OBJECT public: dspDepositsRegister(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); protected slots: virtual void languageChange(); }; #endif // DSPDEPOSITSREGISTER_H qt-client-4.1.0/guiclient/displays/dspDepositsRegister.ui000066400000000000000000000040601217451700100235720ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspDepositsRegister 0 0 259 79 Deposits Register Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 9 20 DateCluster QWidget
    datecluster.h
    _dates
    qt-client-4.1.0/guiclient/displays/dspDetailedInventoryHistoryByLocation.cpp000066400000000000000000000162411217451700100274430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspDetailedInventoryHistoryByLocation.h" #include #include #include #include #include "adjustmentTrans.h" #include "transferTrans.h" #include "scrapTrans.h" #include "expenseTrans.h" #include "materialReceiptTrans.h" #include "countTag.h" dspDetailedInventoryHistoryByLocation::dspDetailedInventoryHistoryByLocation(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspDetailedInventoryHistoryByLocation", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Detailed Inventory History by Location")); setListLabel(tr("Inventory History")); setReportName("DetailedInventoryHistoryByLocation"); setMetaSQLOptions("detailedInventoryHistory", "detail"); setUseAltId(true); connect(_location, SIGNAL(newID(int)), this, SLOT(sPopulateLocationInfo(int))); connect(_warehouse, SIGNAL(updated()), this, SLOT(sPopulateLocations())); _transType->append(cTransAll, tr("All Transactions") ); _transType->append(cTransReceipts, tr("Receipts") ); _transType->append(cTransIssues, tr("Issues") ); _transType->append(cTransShipments, tr("Shipments") ); _transType->append(cTransAdjCounts, tr("Adjustments and Counts") ); if (_metrics->value("Application") != "PostBooks") _transType->append(cTransTransfers, tr("Transfers") ); _transType->append(cTransScraps, tr("Scraps") ); _transType->setCurrentIndex(0); list()->addColumn(tr("Date"), (_dateColumn + 30), Qt::AlignRight, true, "invhist_transdate"); list()->addColumn(tr("Type"), _transColumn, Qt::AlignCenter,true, "invhist_transtype"); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "ordernumber"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "lotserial"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "invhist_invuom"); list()->addColumn(tr("Trans-Qty"), _qtyColumn, Qt::AlignRight, true, "transqty"); list()->addColumn(tr("Qty. Before"), _qtyColumn, Qt::AlignRight, true, "qohbefore"); list()->addColumn(tr("Qty. After"), _qtyColumn, Qt::AlignRight, true, "qohafter"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); sPopulateLocations(); } void dspDetailedInventoryHistoryByLocation::languageChange() { display::languageChange(); retranslateUi(this); } void dspDetailedInventoryHistoryByLocation::sPopulateLocations() { _location->clear(); _location->setId(-1); if (_warehouse->isAll()) _location->populate( "SELECT location_id," " CASE WHEN (LENGTH(location_descrip) > 0) THEN (warehous_code || '-' || formatLocationName(location_id) || '-' || location_descrip)" " ELSE (warehous_code || '-' || formatLocationName(location_id))" " END AS locationname " "FROM location, whsinfo " "WHERE (location_warehous_id=warehous_id) " "ORDER BY locationname;" ); else { XSqlQuery qq; qq.prepare( "SELECT location_id, " " CASE WHEN (LENGTH(location_descrip) > 0) THEN (formatLocationName(location_id) || '-' || location_descrip)" " ELSE formatLocationName(location_id)" " END AS locationname " "FROM location " "WHERE (location_warehous_id=:warehous_id) " "ORDER BY locationname;" ); _warehouse->bindValue(qq); qq.exec(); _location->populate(qq); } } void dspDetailedInventoryHistoryByLocation::sPopulateLocationInfo(int pLocationid) { XSqlQuery qq; qq.prepare( "SELECT formatBoolYN(location_netable) AS netable," " formatBoolYN(location_restrict) AS restricted " "FROM location, whsinfo " "WHERE ( (location_warehous_id=warehous_id)" " AND (location_id=:location_id) );" ); qq.bindValue(":location_id", pLocationid); qq.exec(); if (qq.first()) { _netable->setText(qq.value("netable").toString()); _restricted->setText(qq.value("restricted").toString()); } } void dspDetailedInventoryHistoryByLocation::sViewTransInfo() { QString transType(((XTreeWidgetItem *)list()->currentItem())->text(1)); ParameterList params; params.append("mode", "view"); params.append("invhist_id", list()->id()); if (transType == "AD") { adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "TW") { transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "SI") { scrapTrans *newdlg = new scrapTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "EX") { expenseTrans *newdlg = new expenseTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "RX") { materialReceiptTrans *newdlg = new materialReceiptTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "CC") { countTag newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } void dspDetailedInventoryHistoryByLocation::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { QString transType(((XTreeWidgetItem *)list()->currentItem())->text(1)); if ( (transType == "AD") || (transType == "TW") || (transType == "SI") || (transType == "EX") || (transType == "RX") || (transType == "CC") ) menuThis->addAction(tr("View Transaction Information..."), this, SLOT(sViewTransInfo())); } bool dspDetailedInventoryHistoryByLocation::setParams(ParameterList ¶ms) { params.append("byLocation"); if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Start Date"), tr("Please enter a valid Start Date.") ); _dates->setFocus(); return false; } else if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter End Date"), tr("Please enter a valid End Date.") ); _dates->setFocus(); return false; } else _dates->appendValue(params); if (_location->id() == -1) { QMessageBox::critical( this, tr("Enter Location"), tr("Please enter a valid Location.") ); _location->setFocus(); return false; } else params.append("location_id", _location->id()); params.append("transType", _transType->id()); return true; } qt-client-4.1.0/guiclient/displays/dspDetailedInventoryHistoryByLocation.h000066400000000000000000000023321217451700100271040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPDETAILEDINVENTORYHISTORYBYLOCATION_H #define DSPDETAILEDINVENTORYHISTORYBYLOCATION_H #include "display.h" #include "ui_dspDetailedInventoryHistoryByLocation.h" class dspDetailedInventoryHistoryByLocation : public display, public Ui::dspDetailedInventoryHistoryByLocation { Q_OBJECT public: dspDetailedInventoryHistoryByLocation(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateLocations(); virtual void sPopulateLocationInfo( int pLocationid ); virtual void sViewTransInfo(); virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); protected slots: virtual void languageChange(); }; #endif // DSPDETAILEDINVENTORYHISTORYBYLOCATION_H qt-client-4.1.0/guiclient/displays/dspDetailedInventoryHistoryByLocation.ui000066400000000000000000000152471217451700100273030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspDetailedInventoryHistoryByLocation 0 0 880 180 Detailed Inventory History by Location Location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 0 Netable: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 0 0 Restricted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Transaction Types: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Qt::Horizontal 40 20 false DateCluster QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _location _transType _dates
    qt-client-4.1.0/guiclient/displays/dspDetailedInventoryHistoryByLotSerial.cpp000066400000000000000000000165111217451700100275710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspDetailedInventoryHistoryByLotSerial.h" #include #include #include #include "adjustmentTrans.h" #include "transferTrans.h" #include "scrapTrans.h" #include "expenseTrans.h" #include "materialReceiptTrans.h" #include "countTag.h" #include "parameterwidget.h" dspDetailedInventoryHistoryByLotSerial::dspDetailedInventoryHistoryByLotSerial(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspDetailedInventoryHistoryByLotSerial", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Detailed Inventory History by Lot/Serial #")); setListLabel(tr("Inventory History")); setReportName("DetailedInventoryHistoryByLotSerial"); setMetaSQLOptions("detailedInventoryHistory", "detail"); setUseAltId(true); setParameterWidgetVisible(true); connect(_selected, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_pattern, SIGNAL(clicked()), this, SLOT(sSelect())); QString qryTransType = QString("SELECT %1 AS id, '%8' AS type UNION " "SELECT %2 AS id, '%9' AS type UNION " "SELECT %3 AS id, '%10' AS type UNION " "SELECT %4 AS id, '%11' AS type UNION " "SELECT %5 AS id, '%12' AS type UNION " "SELECT %6 AS id, '%13' AS type UNION " "SELECT %7 AS id, '%14' AS type;") .arg(cTransAll) .arg(cTransReceipts) .arg(cTransIssues) .arg(cTransShipments) .arg(cTransAdjCounts) .arg(cTransTransfers) .arg(cTransScraps) .arg(tr("All Transactions")) .arg(tr("Receipts")) .arg(tr("Issues") ) .arg(tr("Shipments")) .arg(tr("Adjustments and Counts")) .arg(tr("Transfers")) .arg(tr("Scraps") ); QString qryTrace = QString("SELECT 0 AS id, '%1' AS type " "UNION " "SELECT 1 AS id, '%2' AS type; ") .arg(tr("Forward")) .arg(tr("Backward")); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "lshist_warehous_code" ); list()->addColumn(tr("Date"), (_dateColumn + 30), Qt::AlignRight, true, "lshist_transdate" ); list()->addColumn(tr("Type"), _transColumn, Qt::AlignCenter, true, "lshist_transtype" ); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "lshist_ordernumber" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "lshist_item_number" ); list()->addColumn(tr("Location"), _dateColumn, Qt::AlignLeft, true, "lshist_locationname" ); list()->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "lshist_lotserial" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "lshist_invuom" ); list()->addColumn(tr("Trans-Qty"), _qtyColumn, Qt::AlignRight, true, "lshist_transqty" ); list()->addColumn(tr("Qty. Before"), _qtyColumn, Qt::AlignRight, true, "lshist_qty_before" ); list()->addColumn(tr("Qty. After"), _qtyColumn, Qt::AlignRight, true, "lshist_qty_after" ); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehouseid", ParameterWidget::Site); parameterWidget()->appendComboBox(tr("Transaction Type"), "transType", qryTransType); parameterWidget()->appendComboBox(tr("Multi-Level Trace"), "traceId", qryTrace); } void dspDetailedInventoryHistoryByLotSerial::languageChange() { display::languageChange(); retranslateUi(this); } void dspDetailedInventoryHistoryByLotSerial::sViewTransInfo() { QString transType(((XTreeWidgetItem *)list()->currentItem())->text(2)); ParameterList params; params.append("mode", "view"); params.append("invhist_id", list()->id()); if (transType == "AD") { adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "TW") { transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "SI") { scrapTrans *newdlg = new scrapTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "EX") { expenseTrans *newdlg = new expenseTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "RX") { materialReceiptTrans *newdlg = new materialReceiptTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "CC") { countTag newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } void dspDetailedInventoryHistoryByLotSerial::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { QString transType(((XTreeWidgetItem *)list()->currentItem())->text(2)); if ( (transType == "AD") || (transType == "TW") || (transType == "SI") || (transType == "EX") || (transType == "RX") || (transType == "CC") ) menuThis->addAction(tr("View Transaction Information..."), this, SLOT(sViewTransInfo())); } void dspDetailedInventoryHistoryByLotSerial::sFillList() { display::sFillList(); list()->expandAll(); } void dspDetailedInventoryHistoryByLotSerial::sSelect() { if (_selected->isChecked()) { _lotSerial->setEnabled(true); _lotSerialPattern->setEnabled(false); } else if (_pattern->isChecked()) { _lotSerial->setEnabled(false); _lotSerialPattern->setEnabled(true); } } bool dspDetailedInventoryHistoryByLotSerial::setParams(ParameterList ¶ms) { QString trace = "N"; params = parameterWidget()->parameters(); if ( ((_selected->isChecked() && _lotSerial->number().trimmed().length() == 0) || (_pattern->isChecked() && _lotSerialPattern->text().trimmed().length() == 0)) && (!_item->isValid()) ) { QMessageBox::warning( this, tr("Enter Lot/Serial #"), tr("

    You must enter a Lot/Serial or Item criteria to print Inventory " "Detail by Lot/Serial #.

    ") ); _lotSerial->setFocus(); return false; } bool valid; QVariant param; param = params.value("traceId", &valid); if (valid) { int traceid = param.toInt(); if (traceid) trace = "B"; else trace = "F"; } if (_item->isValid()) params.append("itemid", _item->id()); params.append("trace", trace); if (_selected->isChecked()) { if (_lotSerial->number().trimmed().length() > 0) params.append("lotSerial", _lotSerial->number().trimmed()); } else { params.append("pattern", "t"); params.append("lotSerial", _lotSerialPattern->text().trimmed()); } return true; } qt-client-4.1.0/guiclient/displays/dspDetailedInventoryHistoryByLotSerial.h000066400000000000000000000022711217451700100272340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPDETAILEDINVENTORYHISTORYBYLOTSERIAL_H #define DSPDETAILEDINVENTORYHISTORYBYLOTSERIAL_H #include "display.h" #include "ui_dspDetailedInventoryHistoryByLotSerial.h" class dspDetailedInventoryHistoryByLotSerial : public display, public Ui::dspDetailedInventoryHistoryByLotSerial { Q_OBJECT public: dspDetailedInventoryHistoryByLotSerial(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sViewTransInfo(); virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sFillList(); virtual void sSelect(); protected slots: virtual void languageChange(); }; #endif // DSPDETAILEDINVENTORYHISTORYBYLOTSERIAL_H qt-client-4.1.0/guiclient/displays/dspDetailedInventoryHistoryByLotSerial.ui000066400000000000000000000106711217451700100274250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspDetailedInventoryHistoryByLotSerial 0 0 685 126 0 0 Detailed Inventory History by Lot/Serial # Item 0 0 Qt::StrongFocus Number: Lot/Serial # Selected true Qt::StrongFocus Pattern false ItemCluster QWidget
    itemcluster.h
    1
    LotserialCluster QWidget
    lotserialcluster.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _item _lotSerial _pattern _lotSerialPattern _pattern toggled(bool) _lotSerialPattern setEnabled(bool) 58 219 147 219 _item privateIdChanged(int) _lotSerial setItemId(int) 166 46 173 164
    qt-client-4.1.0/guiclient/displays/dspEarnedCommissions.cpp000066400000000000000000000062301217451700100240630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspEarnedCommissions.h" #include #include #include "guiclient.h" #include "xtreewidget.h" dspEarnedCommissions::dspEarnedCommissions(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspEarnedCommissions", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Earned Commissions")); setListLabel(tr("Earned Commissions")); setReportName("EarnedCommissions"); setMetaSQLOptions("salesHistory", "detail"); connect(_selectedSalesrep, SIGNAL(toggled(bool)), _salesrep, SLOT(setEnabled(bool))); _salesrep->setType(XComboBox::SalesReps); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Sales Rep."), 100, Qt::AlignLeft, true, "salesrep_name" ); list()->addColumn(tr("S/O #"), _orderColumn, Qt::AlignLeft, true, "cohist_ordernumber" ); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Ship-To"), -1, Qt::AlignLeft, true, "cohist_shiptoname" ); list()->addColumn(tr("Invc. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_invcdate" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "cohist_qtyshipped" ); list()->addColumn(tr("Ext. Price"), _moneyColumn, Qt::AlignRight, true, "extprice" ); list()->addColumn(tr("Commission"), _moneyColumn, Qt::AlignRight, true, "cohist_commission" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter, true, "currAbbr" ); list()->addColumn(tr("Base Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "baseextprice" ); list()->addColumn(tr("Base Commission"), _bigMoneyColumn, Qt::AlignRight, true, "basecommission" ); list()->addColumn(tr("Paid"), _ynColumn, Qt::AlignCenter, true, "cohist_commissionpaid" ); } void dspEarnedCommissions::languageChange() { display::languageChange(); retranslateUi(this); } bool dspEarnedCommissions::setParams(ParameterList ¶ms) { if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter a Valid Start and End Date"), tr("You must enter a valid Start and End Date for this report.") ); _dates->setFocus(); return false; } _dates->appendValue(params); if (_selectedSalesrep->isChecked()) params.append("salesrep_id", _salesrep->id()); if (_includeMisc->isChecked()) params.append("includeMisc"); params.append("orderBySalesRepInvcdate"); // metasql only? return true; } qt-client-4.1.0/guiclient/displays/dspEarnedCommissions.h000066400000000000000000000016051217451700100235310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPEARNEDCOMMISSIONS_H #define DSPEARNEDCOMMISSIONS_H #include "display.h" #include "ui_dspEarnedCommissions.h" class dspEarnedCommissions : public display, public Ui::dspEarnedCommissions { Q_OBJECT public: dspEarnedCommissions(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); protected slots: virtual void languageChange(); }; #endif // DSPEARNEDCOMMISSIONS_H qt-client-4.1.0/guiclient/displays/dspEarnedCommissions.ui000066400000000000000000000116241217451700100237210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspEarnedCommissions 0 0 506 94 Earned Commissions 0 0 5 All Sales Reps. true Selected Sales Rep. false 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 0 Include Misc. Charges and Items Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 1 20 DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _allSalesreps _selectedSalesrep _salesrep _includeMisc _selectedSalesrep toggled(bool) _salesrep setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspExpediteExceptionsByPlannerCode.cpp000066400000000000000000000042071217451700100266620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspExpediteExceptionsByPlannerCode.h" #include #include "xtreewidget.h" dspExpediteExceptionsByPlannerCode::dspExpediteExceptionsByPlannerCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspExpediteExceptionsByPlannerCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Expedite Exceptions by Planner Code")); setListLabel(tr("Expedite Exceptions")); setReportName("ExpediteExceptionsByPlannerCode"); setMetaSQLOptions("schedule", "expedite"); setUseAltId(true); _plannerCode->setType(ParameterGroup::PlannerCode); list()->addColumn(tr("Order Type/#"), _itemColumn, Qt::AlignCenter,true, "order_number"); list()->addColumn(tr("To Site"), _whsColumn, Qt::AlignCenter,true, "to_warehous"); list()->addColumn(tr("From Site"), _whsColumn, Qt::AlignCenter,true, "from_warehous"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Descriptions"), -1, Qt::AlignLeft, true, "item_descrip"); list()->addColumn(tr("Start/Due Date"), _itemColumn, Qt::AlignLeft, true, "keydate"); list()->addColumn(tr("Exception"), 120, Qt::AlignLeft, true, "exception"); } void dspExpediteExceptionsByPlannerCode::languageChange() { display::languageChange(); retranslateUi(this); } bool dspExpediteExceptionsByPlannerCode::setParams(ParameterList & params) { _plannerCode->appendValue(params); _warehouse->appendValue(params); params.append("releaseOrder", tr("Release Order")); params.append("startProduction", tr("Start Production")); params.append("expediteProduction", tr("Expedite Production")); params.append("days", _days->value()); return true; } qt-client-4.1.0/guiclient/displays/dspExpediteExceptionsByPlannerCode.h000066400000000000000000000017511217451700100263300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPEXPEDITEEXCEPTIONSBYPLANNERCODE_H #define DSPEXPEDITEEXCEPTIONSBYPLANNERCODE_H #include "display.h" #include "ui_dspExpediteExceptionsByPlannerCode.h" class dspExpediteExceptionsByPlannerCode : public display, public Ui::dspExpediteExceptionsByPlannerCode { Q_OBJECT public: dspExpediteExceptionsByPlannerCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPEXPEDITEEXCEPTIONSBYPLANNERCODE_H qt-client-4.1.0/guiclient/displays/dspExpediteExceptionsByPlannerCode.ui000066400000000000000000000131451217451700100265160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspExpediteExceptionsByPlannerCode 0 0 426 200 Expedite Exceptions by Planner Code 0 false false 0 0 5 0 Look Ahead Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 999 Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 0 Qt::Horizontal 0 20 Qt::Vertical 20 0 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _plannerCode _warehouse _days
    qt-client-4.1.0/guiclient/displays/dspExpiredInventoryByClassCode.cpp000066400000000000000000000145031217451700100260350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspExpiredInventoryByClassCode.h" #include #include #include #include #include #include "mqlutil.h" #include "adjustmentTrans.h" #include "enterMiscCount.h" #include "transferTrans.h" #include "createCountTagsByItem.h" #include "guiclient.h" #define COST_COL 6 #define VALUE_COL 7 #define METHOD_COL 8 dspExpiredInventoryByClassCode::dspExpiredInventoryByClassCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspExpiredInventoryByClassCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Expired Inventory")); setListLabel(tr("Expired Inventory")); setReportName("ExpiredInventoryByClassCode"); setMetaSQLOptions("expiredInventory", "detail"); _costsGroupInt = new QButtonGroup(this); _costsGroupInt->addButton(_useStandardCosts); _costsGroupInt->addButton(_useActualCosts); _costsGroupInt->addButton(_usePostedCosts); connect(_showValue, SIGNAL(toggled(bool)), this, SLOT(sHandleValue(bool))); _classCode->setType(ParameterGroup::ClassCode); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "ls_number" ); list()->addColumn(tr("Expiration"), _dateColumn, Qt::AlignCenter, true, "itemloc_expiration" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "itemloc_qty" ); list()->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "cost" ); list()->addColumn(tr("Value"), _costColumn, Qt::AlignRight, true, "value" ); list()->addColumn(tr("Cost Method"), _costColumn, Qt::AlignCenter, true, "costmethod" ); _showValue->setEnabled(_privileges->check("ViewInventoryValue")); if (! _privileges->check("ViewInventoryValue") || ! _showValue->isChecked()) { list()->hideColumn(COST_COL); list()->hideColumn(VALUE_COL); list()->hideColumn(METHOD_COL); } } void dspExpiredInventoryByClassCode::languageChange() { display::languageChange(); retranslateUi(this); } void dspExpiredInventoryByClassCode::sPopulateMenu(QMenu *, QTreeWidgetItem *, int) { #if 0 int menuItem; if (((XTreeWidgetItem *)pSelected)->id() != -1) { menuItem = pMenu->insertItem(tr("Transfer to another Site..."), this, SLOT(sTransfer()), 0); if (!_privileges->check("CreateInterWarehouseTrans")) pMenu->setItemEnabled(menuItem, false); menuItem = pMenu->insertItem(tr("Adjust this QOH..."), this, SLOT(sAdjust()), 0); if (!_privileges->check("CreateAdjustmentTrans")) pMenu->setItemEnabled(menuItem, false); menuItem = pMenu->insertItem(tr("Reset this QOH to 0..."), this, SLOT(sReset()), 0); if (!_privileges->check("CreateAdjustmentTrans")) pMenu->setItemEnabled(menuItem, false); pMenu->insertSeparator(); menuItem = pMenu->insertItem(tr("Enter Misc. Count..."), this, SLOT(sMiscCount()), 0); if (!_privileges->check("EnterMiscCounts")) pMenu->setItemEnabled(menuItem, false); pMenu->insertSeparator(); menuItem = pMenu->insertItem(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()), 0); if (!_privileges->check("IssueCountTags")) pMenu->setItemEnabled(menuItem, false); } #endif } void dspExpiredInventoryByClassCode::sTransfer() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspExpiredInventoryByClassCode::sAdjust() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspExpiredInventoryByClassCode::sReset() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); params.append("qty", 0.0); adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspExpiredInventoryByClassCode::sMiscCount() { ParameterList params; params.append("itemsite_id", list()->id()); enterMiscCount newdlg(this, "", true); newdlg.set(params); if (newdlg.exec()) sFillList(); } void dspExpiredInventoryByClassCode::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspExpiredInventoryByClassCode::sHandleValue(bool pShowValue) { if (pShowValue) { list()->showColumn(COST_COL); list()->showColumn(VALUE_COL); list()->showColumn(METHOD_COL); } else { list()->hideColumn(COST_COL); list()->hideColumn(VALUE_COL); list()->hideColumn(METHOD_COL); } } void dspExpiredInventoryByClassCode::sFillList() { list()->clear(); list()->setColumnVisible(METHOD_COL, _showValue->isChecked() && _usePostedCosts->isChecked()); display::sFillList(); } bool dspExpiredInventoryByClassCode::setParams(ParameterList ¶ms) { if (_perishability->isChecked()) { params.append("perishability"); params.append("expiretype", tr("Perishability")); } else { params.append("warranty"); params.append("expiretype", tr("Warranty")); } params.append("thresholdDays", _thresholdDays->value()); _warehouse->appendValue(params); _classCode->appendValue(params); if(_showValue->isChecked()) params.append("showValue"); if (_useStandardCosts->isChecked()) params.append("useStandardCosts"); else if (_useActualCosts->isChecked()) params.append("useActualCosts"); else if (_usePostedCosts->isChecked()) params.append("usePostedCosts"); return true; } qt-client-4.1.0/guiclient/displays/dspExpiredInventoryByClassCode.h000066400000000000000000000024571217451700100255070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPEXPIREDINVENTORYBYCLASSCODE_H #define DSPEXPIREDINVENTORYBYCLASSCODE_H #include "display.h" #include "ui_dspExpiredInventoryByClassCode.h" class dspExpiredInventoryByClassCode : public display, public Ui::dspExpiredInventoryByClassCode { Q_OBJECT public: dspExpiredInventoryByClassCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sTransfer(); virtual void sAdjust(); virtual void sReset(); virtual void sMiscCount(); virtual void sIssueCountTag(); virtual void sHandleValue( bool pShowValue ); virtual void sFillList(); protected slots: virtual void languageChange(); private: QButtonGroup* _costsGroupInt; }; #endif // DSPEXPIREDINVENTORYBYCLASSCODE_H qt-client-4.1.0/guiclient/displays/dspExpiredInventoryByClassCode.ui000066400000000000000000000122561217451700100256730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspExpiredInventoryByClassCode 0 0 527 257 Expired Inventory Qt::StrongFocus Class Code false 0 0 Qt::StrongFocus Site: false Expired By Perishability true Warranty Threshold Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter -999 999 true Show Inventory Value true false Use Posted Costs true Use Standard Costs false Use Actual Costs ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _classCode _perishability _warranty _warehouse _showValue _useStandardCosts _useActualCosts _thresholdDays
    qt-client-4.1.0/guiclient/displays/dspFreightPricesByCustomer.cpp000066400000000000000000000054651217451700100252250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspFreightPricesByCustomer.h" #include "xtreewidget.h" #include dspFreightPricesByCustomer::dspFreightPricesByCustomer(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspFreightPricesByCustomer", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Freight Prices by Customer")); setListLabel(tr("Freight Prices")); setReportName("FreightPricesByCustomer"); setMetaSQLOptions("freightPrices", "detail"); setUseAltId(true); list()->addColumn(tr("Schedule"), _itemColumn, Qt::AlignLeft, true, "ipshead_name" ); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignLeft, true, "source" ); list()->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "ipsfreight_qtybreak" ); list()->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "ipsfreight_price" ); list()->addColumn(tr("Method"), _itemColumn, Qt::AlignLeft, true, "method" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currConcat"); list()->addColumn(tr("From"), _itemColumn, Qt::AlignLeft, true, "warehous_code" ); list()->addColumn(tr("To"), _itemColumn, Qt::AlignLeft, true, "shipzone_name" ); list()->addColumn(tr("Freight Class"), _itemColumn, Qt::AlignLeft, true, "freightclass_code" ); list()->addColumn(tr("Ship Via"), _itemColumn, Qt::AlignLeft, true, "ipsfreight_shipvia" ); } void dspFreightPricesByCustomer::languageChange() { display::languageChange(); retranslateUi(this); } bool dspFreightPricesByCustomer::setParams(ParameterList ¶ms) { if(!_cust->isValid()) { QMessageBox::warning(this, tr("Customer Required"), tr("You must specify a valid Customer.")); return false; } params.append("byCust"); params.append("na", tr("N/A")); params.append("any", tr("Any")); params.append("flatrate", tr("Flat Rate")); params.append("peruom", tr("Per UOM")); params.append("customer", tr("Customer")); params.append("custType", tr("Cust. Type")); params.append("custTypePattern", tr("Cust. Type Pattern")); params.append("sale", tr("Sale")); if (_cust->isValid()) params.append("cust_id", _cust->id()); if (_showExpired->isChecked()) params.append("showExpired"); if (_showFuture->isChecked()) params.append("showFuture"); return true; } qt-client-4.1.0/guiclient/displays/dspFreightPricesByCustomer.h000066400000000000000000000016601217451700100246630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPFREIGHTPRICESBYCUSTOMER_H #define DSPFREIGHTPRICESBYCUSTOMER_H #include "display.h" #include "ui_dspFreightPricesByCustomer.h" class dspFreightPricesByCustomer : public display, public Ui::dspFreightPricesByCustomer { Q_OBJECT public: dspFreightPricesByCustomer(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPFREIGHTPRICESBYCUSTOMER_H qt-client-4.1.0/guiclient/displays/dspFreightPricesByCustomer.ui000066400000000000000000000063651217451700100250600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspFreightPricesByCustomer 0 0 447 100 Freight Prices by Customer 0 Qt::Vertical QSizePolicy::Expanding 20 0 0 Show E&xpired Prices Show &Future Prices Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 5 20 CustCluster QWidget
    custcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _cust _showExpired _showFuture
    qt-client-4.1.0/guiclient/displays/dspFreightPricesByCustomerType.cpp000066400000000000000000000053401217451700100260570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspFreightPricesByCustomerType.h" #include "xtreewidget.h" dspFreightPricesByCustomerType::dspFreightPricesByCustomerType(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, "dspFreightPricesByCustomerType", fl) { if (name) setObjectName(name); setupUi(optionsWidget()); setWindowTitle(tr("Freight Prices by Customer Type")); setListLabel(tr("Freight Prices")); setReportName("FreightPricesByCustomerType"); setMetaSQLOptions("freightPrices", "detail"); setUseAltId(true); _custtype->setType(XComboBox::CustomerTypes); list()->addColumn(tr("Schedule"), _itemColumn, Qt::AlignLeft, true, "ipshead_name" ); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignLeft, true, "source" ); list()->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "ipsfreight_qtybreak" ); list()->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "ipsfreight_price" ); list()->addColumn(tr("Method"), _itemColumn, Qt::AlignLeft, true, "method" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currConcat"); list()->addColumn(tr("From"), _itemColumn, Qt::AlignLeft, true, "warehous_code" ); list()->addColumn(tr("To"), _itemColumn, Qt::AlignLeft, true, "shipzone_name" ); list()->addColumn(tr("Freight Class"), _itemColumn, Qt::AlignLeft, true, "freightclass_code" ); list()->addColumn(tr("Ship Via"), _itemColumn, Qt::AlignLeft, true, "ipsfreight_shipvia" ); } void dspFreightPricesByCustomerType::languageChange() { display::languageChange(); retranslateUi(this); } bool dspFreightPricesByCustomerType::setParams(ParameterList ¶ms) { params.append("byCustType"); params.append("na", tr("N/A")); params.append("any", tr("Any")); params.append("flatrate", tr("Flat Rate")); params.append("peruom", tr("Per UOM")); params.append("custType", tr("Cust. Type")); params.append("custTypePattern", tr("Cust. Type Pattern")); params.append("sale", tr("Sale")); if (_custtype->isValid()) params.append("custtype_id", _custtype->id()); if (_showExpired->isChecked()) params.append("showExpired"); if (_showFuture->isChecked()) params.append("showFuture"); return true; } qt-client-4.1.0/guiclient/displays/dspFreightPricesByCustomerType.h000066400000000000000000000017141217451700100255250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef dspFreightPricesByCustomerType_H #define dspFreightPricesByCustomerType_H #include "display.h" #include "ui_dspFreightPricesByCustomerType.h" class dspFreightPricesByCustomerType : public display, public Ui::dspFreightPricesByCustomerType { Q_OBJECT public: dspFreightPricesByCustomerType(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // dspFreightPricesByCustomerType_H qt-client-4.1.0/guiclient/displays/dspFreightPricesByCustomerType.ui000066400000000000000000000100251217451700100257060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspFreightPricesByCustomerType 0 0 347 62 Freight Prices by Customer Type 0 5 Customer Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _custtype 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 0 Show E&xpired Prices Show &Future Prices Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 1 20 XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _custtype _showExpired _showFuture
    qt-client-4.1.0/guiclient/displays/dspFrozenItemSites.cpp000066400000000000000000000035151217451700100235360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspFrozenItemSites.h" #include #include #include "xtreewidget.h" dspFrozenItemSites::dspFrozenItemSites(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspFrozenItemSites", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Frozen Item Sites")); setListLabel(tr("Count Tags")); setReportName("FrozenItemSites"); setMetaSQLOptions("frozenItemSites", "detail"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("Count Tag #"), _qtyColumn, Qt::AlignRight, true, "cnttag"); sFillList(); } void dspFrozenItemSites::languageChange() { display::languageChange(); retranslateUi(this); } void dspFrozenItemSites::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Thaw"), this, SLOT(sThaw())); menuItem->setEnabled(_privileges->check("ThawInventory")); } void dspFrozenItemSites::sThaw() { XSqlQuery qq; qq.prepare("SELECT thawItemsite(:itemsite_id) AS result;"); qq.bindValue(":itemsite_id", list()->id()); qq.exec(); sFillList(); } bool dspFrozenItemSites::setParams(ParameterList ¶ms) { _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspFrozenItemSites.h000066400000000000000000000017501217451700100232020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPFROZENITEMSITES_H #define DSPFROZENITEMSITES_H #include "display.h" #include "ui_dspFrozenItemSites.h" class dspFrozenItemSites : public display, public Ui::dspFrozenItemSites { Q_OBJECT public: dspFrozenItemSites(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sThaw(); protected slots: virtual void languageChange(); }; #endif // DSPFROZENITEMSITES_H qt-client-4.1.0/guiclient/displays/dspFrozenItemSites.ui000066400000000000000000000043741217451700100233750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspFrozenItemSites 0 0 235 98 Frozen Item Sites false Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 0 WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse parameter.h
    qt-client-4.1.0/guiclient/displays/dspGLSeries.cpp000066400000000000000000000212631217451700100221210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspGLSeries.h" #include "glSeries.h" #include #include #include #include #include #include #include "mqlutil.h" #include "reverseGLSeries.h" #include "dspJournals.h" dspGLSeries::dspGLSeries(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspGLSeries", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Journal Series")); setListLabel(tr("Journal Transactions")); setReportName("GLSeries"); setMetaSQLOptions("glseries", "detail"); setUseAltId(true); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter,true, "transdate"); list()->addColumn(tr("Journal #"),_orderColumn, Qt::AlignRight, true, "journalnumber"); list()->addColumn(tr("Source"), _orderColumn, Qt::AlignCenter,true, "source"); list()->addColumn(tr("Doc. Type"), _itemColumn, Qt::AlignCenter,true, "doctype"); list()->addColumn(tr("Doc. Num."),_orderColumn, Qt::AlignCenter,true, "docnumber"); list()->addColumn(tr("Notes/Account"), -1, Qt::AlignLeft, true, "accnt_id"); list()->addColumn(tr("Debit"), _bigMoneyColumn, Qt::AlignRight, true, "debit"); list()->addColumn(tr("Credit"),_bigMoneyColumn, Qt::AlignRight, true, "credit"); list()->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter,true, "posted"); _source->setAllowNull(false); _source->append(0, tr("A/P"), "A/P"); _source->append(1, tr("A/R"), "A/R"); _source->append(2, tr("G/L"), "G/L"); _source->append(3, tr("I/M"), "I/M"); _source->append(4, tr("P/D"), "P/D"); _source->append(5, tr("P/O"), "P/O"); _source->append(6, tr("S/O"), "S/O"); _source->append(7, tr("S/R"), "S/R"); _source->append(8, tr("W/O"), "W/O"); if (!_metrics->boolean("UseJournals")) _typeGroup->hide(); _isJournal = false; _journal->setEnabled(_privileges->boolean("ViewJournals")); } void dspGLSeries::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspGLSeries::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("startDate", &valid); if(valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if(valid) _dates->setEndDate(param.toDate()); param = pParams.value("journalnumber", &valid); if(valid) { _jrnlGroup->setChecked(true); _startJrnlnum->setText(param.toString()); _endJrnlnum->setText(param.toString()); } param = pParams.value("journal", &valid); if(valid) { _typeGroup->show(); _journal->setChecked(true); } sFillList(); return NoError; } void dspGLSeries::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int) { QAction *menuItem; bool editable = false; bool deletable = false; bool reversible = false; XTreeWidgetItem * item = (XTreeWidgetItem*)list()->currentItem(); if(0 != item) { if(item->altId() != -1) item = (XTreeWidgetItem*)item->QTreeWidgetItem::parent(); if(0 != item) { if (_journal->isChecked() && !item->rawValue("posted").toBool()) { menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostJournals")); return; } else { if(item->rawValue("doctype").toString() == "ST" || item->rawValue("doctype").toString() == "JE") reversible = _privileges->check("PostStandardJournals"); // Make sure there is nothing to restricting edits ParameterList params; params.append("glSequence", list()->id()); MetaSQLQuery mql = mqlLoad("glseries", "checkeditable"); XSqlQuery qry = mql.toQuery(params); if (!qry.first()) { editable = _privileges->check("EditPostedJournals") && item->rawValue("doctype").toString() == "JE"; deletable = (_privileges->check("DeletePostedJournals") && (reversible || item->rawValue("doctype").toString() == "JP")); } } } } if (!_isJournal) { menuItem = pMenu->addAction(tr("Edit Journal..."), this, SLOT(sEdit())); menuItem->setEnabled(editable); menuItem = pMenu->addAction(tr("Delete Journal..."), this, SLOT(sDelete())); menuItem->setEnabled(deletable); pMenu->addSeparator(); } menuItem = pMenu->addAction(tr("Reverse Journal..."), this, SLOT(sReverse())); menuItem->setEnabled(reversible); if (item->rawValue("doctype").toString() == "JP") { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Journal..."), this, SLOT(sViewJournal())); menuItem->setEnabled(_privileges->check("ViewJournals")); } } bool dspGLSeries::setParams(ParameterList ¶ms) { if(!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("You must first specify a valid date range.") ); _dates->setFocus(); return false; } _dates->appendValue(params); if(_selectedSource->isChecked()) params.append("source", _source->code()); if(_jrnlGroup->isChecked()) { params.append("startJrnlnum", _startJrnlnum->text().toInt()); params.append("endJrnlnum", _endJrnlnum->text().toInt()); } if (_journal->isChecked()) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); _isJournal=true; } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); _isJournal=false; } return true; } void dspGLSeries::sEdit() { ParameterList params; ParameterList params2; params.append("glSequence", list()->id()); MetaSQLQuery mql("SELECT copyGlSeries(gltrans_sequence) AS sequence," " gltrans_journalnumber " "FROM gltrans " "WHERE (gltrans_sequence=) " "LIMIT 1;"); XSqlQuery qry; qry = mql.toQuery(params); if (qry.first()) { params2.append("glSequence", qry.value("sequence")); params2.append("journalnumber", qry.value("gltrans_journalnumber")); } else if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } else return; glSeries newdlg(this); if(newdlg.set(params2) != NoError) return; if(newdlg.exec() == XDialog::Accepted) sDelete(true); } void dspGLSeries::sReverse() { ParameterList params; params.append("glseries", list()->id()); reverseGLSeries newdlg(this); if(newdlg.set(params) != NoError) return; if(newdlg.exec() == XDialog::Accepted) sFillList(); } void dspGLSeries::sDelete(bool edited) { QString action = tr("deleted"); if (edited) action = tr("edited"); ParameterList params; params.append("glSequence", list()->id()); params.append("notes", tr("Journal %1 by %2 on %3") .arg(action) .arg(omfgThis->username()) .arg(omfgThis->dbDate().toString())); MetaSQLQuery mql("SELECT deleteGlSeries(, " " ) AS result;"); XSqlQuery del; del = mql.toQuery(params); if (del.lastError().type() != QSqlError::NoError) { systemError(this, del.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sGlSeriesUpdated(); sFillList(); } void dspGLSeries::sPost() { ParameterList params; params.append("sequence", list()->id()); MetaSQLQuery mql = mqlLoad("glseries", "postjournal"); XSqlQuery qry = mql.toQuery(params); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspGLSeries::sViewJournal() { ParameterList params; params.append("startDate", omfgThis->startOfTime()); params.append("endDate", omfgThis->endOfTime()); if (list()->rawValue("accnt_id").toInt() == -1) params.append("journalnumber", list()->rawValue("journalnumber")); else { params.append("journalnumber", list()->rawValue("docnumber")); params.append("accnt_id", list()->rawValue("accnt_id").toInt()); } params.append("run"); dspJournals *newdlg = new dspJournals(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/displays/dspGLSeries.h000066400000000000000000000022461217451700100215660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPGLSERIES_H #define DSPGLSERIES_H #include "guiclient.h" #include "display.h" #include "ui_dspGLSeries.h" class dspGLSeries : public display, public Ui::dspGLSeries { Q_OBJECT public: dspGLSeries(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set(const ParameterList &); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem*, int); virtual void sReverse(); virtual void sEdit(); virtual void sDelete(bool edited = false); virtual void sPost(); virtual void sViewJournal(); protected slots: virtual void languageChange(); private: bool _isJournal; }; #endif // DSPGLSERIES_H qt-client-4.1.0/guiclient/displays/dspGLSeries.ui000066400000000000000000000167251217451700100217630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspGLSeries 0 0 544 238 Journal Series 0 All Sources true Selected Source: false Qt::StrongFocus true Journal Number Range true false Start: 0 0 Qt::Horizontal 40 20 End: 0 0 Type Journal General Ledger true Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 17 DateCluster QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    _allSources _selectedSource _source _dates _startJrnlnum _endJrnlnum _selectedSource toggled(bool) _source setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspGLTransactions.cpp000066400000000000000000000540251217451700100233410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspGLTransactions.h" #include #include #include #include #include #include "glTransactionDetail.h" #include "dspGLSeries.h" #include "invoice.h" #include "purchaseOrder.h" #include "voucher.h" #include "miscVoucher.h" #include "dspShipmentsByShipment.h" #include "apOpenItem.h" #include "arOpenItem.h" #include "salesOrder.h" #include "dspWoHistoryByNumber.h" #include "transactionInformation.h" #include "storedProcErrorLookup.h" #include "dspJournals.h" #include "creditMemo.h" dspGLTransactions::dspGLTransactions(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspGLTransactions", fl) { setupUi(optionsWidget()); setWindowTitle(tr("General Ledger Transactions")); setListLabel(tr("Transactions")); setReportName("GLTransactions"); setMetaSQLOptions("gltransactions", "detail"); setUseAltId(true); setParameterWidgetVisible(true); QString qryType = QString( "SELECT 1, '%1' UNION " "SELECT 2, '%2' UNION " "SELECT 3, '%3' UNION " "SELECT 4, '%4' UNION " "SELECT 5, '%5'") .arg(tr("Asset")) .arg(tr("Expense")) .arg(tr("Liability")) .arg(tr("Equity")) .arg(tr("Revenue")); QString qrySubType = QString("SELECT subaccnttype_id, " " (subaccnttype_code || '-' || subaccnttype_descrip) " "FROM subaccnttype " "ORDER BY subaccnttype_code;"); QString qrySource = QString("SELECT 1 AS id, 'A/P' AS source UNION " "SELECT 2 AS id, 'A/R' AS source UNION " "SELECT 3 AS id, 'G/L' AS source UNION " "SELECT 4 AS id, 'I/M' AS source UNION " "SELECT 5 AS id, 'P/D' AS source UNION " "SELECT 6 AS id, 'P/O' AS source UNION " "SELECT 7 AS id, 'S/O' AS source UNION " "SELECT 8 AS id, 'S/R' AS source UNION " "SELECT 9 AS id, 'W/O' AS source;"); QString qryAccNum = QString("SELECT min(accnt_id) as num_id," " accnt_number AS num_number " "FROM accnt " "GROUP BY accnt_number " "ORDER BY accnt_number;"); connect(parameterWidget(), SIGNAL(filterChanged()), this, SLOT(handleTotalCheckbox())); connect(_showRunningTotal, SIGNAL(toggled(bool)), this, SLOT(handleTotalCheckbox())); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "gltrans_date"); list()->addColumn(tr("Date Created"), _timeDateColumn, Qt::AlignCenter, true, "gltrans_created"); list()->addColumn(tr("Source"), _orderColumn, Qt::AlignCenter, true, "gltrans_source"); list()->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter, !_metrics->boolean("UseJournals"), "gltrans_doctype"); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "docnumber"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, !_metrics->boolean("UseJournals"), "notes"); list()->addColumn(tr("Journal #"), _orderColumn, Qt::AlignLeft, false,"gltrans_journalnumber"); list()->addColumn(tr("Account"), -1, Qt::AlignLeft, true, "account"); list()->addColumn(tr("Debit"), _moneyColumn, Qt::AlignRight, true, "debit"); list()->addColumn(tr("Credit"), _moneyColumn, Qt::AlignRight, true, "credit"); list()->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter, false, "gltrans_posted"); list()->addColumn(tr("Username"), _userColumn, Qt::AlignLeft, false, "gltrans_username"); list()->addColumn(tr("Running Total"), _moneyColumn, Qt::AlignRight,false,"running"); _beginningBalance->setPrecision(omfgThis->moneyVal()); _beginningBalanceLit->setVisible(_showRunningTotal->isChecked()); _beginningBalance->setVisible(_showRunningTotal->isChecked()); if (_showRunningTotal->isChecked()) list()->showColumn("running"); else list()->hideColumn("running"); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->append(tr("GL Account"), "accnt_id", ParameterWidget::GLAccount); parameterWidget()->append(tr("Document #"), "docnum", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Source"), "source_id", qrySource); if (_metrics->value("GLCompanySize").toInt() > 0) parameterWidget()->appendComboBox(tr("Company"), "company_id", XComboBox::Companies); if (_metrics->value("GLProfitSize").toInt() > 0) parameterWidget()->appendComboBox(tr("Profit Center"), "prfcntr_id", XComboBox::ProfitCenters); parameterWidget()->appendComboBox(tr("Main Segment"), "num_id", qryAccNum); if (_metrics->value("GLSubaccountSize").toInt() > 0) parameterWidget()->appendComboBox(tr("Sub Account"), "subaccnt_id", XComboBox::Subaccounts); parameterWidget()->appendComboBox(tr("Account Type"), "accnttype_id", qryType); parameterWidget()->appendComboBox(tr("Sub Type"), "subType", qrySubType); parameterWidget()->append(tr("Show Deleted"), "showDeleted", ParameterWidget::Exists); parameterWidget()->applyDefaultFilterSet(); _sources << "None" << "A/P" << "A/R" << "G/L" << "I/M" << "P/D" << "P/O" << "S/O" << "S/R" << "W/O"; } void dspGLTransactions::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspGLTransactions::set(const ParameterList &pParams) { XSqlQuery dspet; XWidget::set(pParams); parameterWidget()->setSavedFilters(); QVariant param; bool valid; param = pParams.value("accnt_id", &valid); if (valid) parameterWidget()->setDefault(tr("GL Account"), param.toInt()); param = pParams.value("startDate", &valid); if (valid) parameterWidget()->setDefault(tr("Start Date"), param.toDate()); param = pParams.value("endDate", &valid); if (valid) parameterWidget()->setDefault(tr("End Date"), param.toDate()); param = pParams.value("period_id", &valid); if (valid) { dspet.prepare( "SELECT period_start, period_end " "FROM period " "WHERE (period_id=:period_id);" ); dspet.bindValue(":period_id", param.toInt()); dspet.exec(); if (dspet.first()) { parameterWidget()->setDefault(tr("Start Date"), dspet.value("period_start").toDate()); parameterWidget()->setDefault(tr("End Date"), dspet.value("period_end").toDate()); } } parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { emit fillList(); return NoError_Run; } return NoError; } void dspGLTransactions::sPopulateMenu(QMenu * menuThis, QTreeWidgetItem* pItem, int) { XTreeWidgetItem * item = (XTreeWidgetItem*)pItem; if(0 == item) return; menuThis->addAction(tr("View..."), this, SLOT(sViewTrans())); if (item->rawValue("gltrans_journalnumber").toInt() > 0) { QAction* viewSeriesAct = menuThis->addAction(tr("View Journal Series..."), this, SLOT(sViewSeries())); viewSeriesAct->setDisabled(item->data(0, Xt::DeletedRole).toBool()); } if(item->rawValue("gltrans_doctype").toString() == "VO") menuThis->addAction(tr("View Voucher..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "IN") menuThis->addAction(tr("View Invoice..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "PO") menuThis->addAction(tr("View Purchase Order..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "SH") menuThis->addAction(tr("View Shipment..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "CM") menuThis->addAction(tr("View Credit Memo..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "DM") menuThis->addAction(tr("View Debit Memo..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "SO") menuThis->addAction(tr("View Sales Order..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "WO") menuThis->addAction(tr("View WO History..."), this, SLOT(sViewDocument())); else if(item->rawValue("gltrans_doctype").toString() == "JP") menuThis->addAction(tr("View Journal..."), this, SLOT(sViewJournal())); else if(item->rawValue("gltrans_source").toString() == "I/M") menuThis->addAction(tr("View Inventory History..."), this, SLOT(sViewDocument())); } bool dspGLTransactions::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; bool valid; QVariant param; param = params.value("accnttype_id", &valid); if (valid) { int typid = param.toInt(); QString type; if (typid == 1) type = "A"; else if (typid ==2) type = "E"; else if (typid ==3) type = "L"; else if (typid ==4) type = "Q"; else if (typid ==5) type = "R"; params.append("accntType", type); } param = params.value("source_id", &valid); if (valid) params.append("source", _sources.at(param.toInt())); param = params.value("num_id", &valid); if (valid) { XSqlQuery num; num.prepare("SELECT accnt_number " "FROM accnt " "WHERE (accnt_id=:accnt_id);"); num.bindValue(":accnt_id", params.value("num_id").toInt()); num.exec(); if (num.first()) params.append("accnt_number", num.value("accnt_number").toString()); } param = params.value("accnt_id", &valid); if (valid) { if (_showRunningTotal->isChecked() && _showRunningTotal->isVisible()) { double beginning = 0; QDate periodStart = params.value("startDate").toDate(); XSqlQuery begq; begq.prepare("SELECT " " CASE WHEN accnt_type IN ('A','E') THEN " " trialbal_beginning * -1 " " ELSE trialbal_beginning END AS trialbal_beginning," " period_start " "FROM trialbal " " JOIN accnt ON (trialbal_accnt_id=accnt_id), " " period " "WHERE ((trialbal_period_id=period_id)" " AND (trialbal_accnt_id=:accnt_id)" " AND (:start BETWEEN period_start AND period_end));"); begq.bindValue(":accnt_id", params.value("accnt_id").toInt()); begq.bindValue(":start", params.value("startDate").toDate()); begq.exec(); if (begq.first()) { beginning = begq.value("trialbal_beginning").toDouble(); periodStart = begq.value("period_start").toDate(); } else if (begq.lastError().type() != QSqlError::NoError) { systemError(this, begq.lastError().databaseText(), __FILE__, __LINE__); return false; } XSqlQuery glq; glq.prepare("SELECT CASE WHEN accnt_type IN ('A','E') THEN " " COALESCE(SUM(gltrans_amount),0) * -1" " ELSE COALESCE(SUM(gltrans_amount),0) END AS glamount " "FROM gltrans " " JOIN accnt ON (gltrans_accnt_id=accnt_id) " "WHERE ((gltrans_date BETWEEN :periodstart AND date :querystart - interval '1 day')" " AND (gltrans_accnt_id=:accnt_id)) " "GROUP BY accnt_type;"); glq.bindValue(":periodstart", periodStart); glq.bindValue(":querystart", params.value("startDate").toDate()); glq.bindValue(":accnt_id", params.value("accnt_id").toInt()); glq.exec(); if (glq.first()) beginning += glq.value("glamount").toDouble(); else if (glq.lastError().type() != QSqlError::NoError) { systemError(this, glq.lastError().databaseText(), __FILE__, __LINE__); return false; } params.append("beginningBalance", beginning); } } return true; } void dspGLTransactions::sPrint() { if (!_metrics->boolean("ManualForwardUpdate") && _showRunningTotal->isChecked()) { if (!forwardUpdate()) return; } display::sPrint(); } void dspGLTransactions::sFillList(ParameterList pParams, bool forceSetParams) { if (!_metrics->boolean("ManualForwardUpdate") && _showRunningTotal->isChecked() && _showRunningTotal->isVisible()) { if (!forwardUpdate()) return; } if (! setParams(pParams)) return; if (_showRunningTotal->isChecked() && _showRunningTotal->isVisible()) { list()->showColumn("running"); _beginningBalance->setDouble(pParams.value("beginningBalance").toDouble()); } else list()->hideColumn("running"); display::sFillList(pParams, forceSetParams); } void dspGLTransactions::sViewTrans() { ParameterList params; params.append("gltrans_id", list()->id()); glTransactionDetail newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void dspGLTransactions::sViewSeries() { XSqlQuery dspViewSeries; dspViewSeries.prepare("SELECT gltrans_date, gltrans_journalnumber" " FROM gltrans" " WHERE (gltrans_id=:gltrans_id)"); dspViewSeries.bindValue(":gltrans_id", list()->id()); dspViewSeries.exec(); if(!dspViewSeries.first()) return; ParameterList params; params.append("startDate", dspViewSeries.value("gltrans_date").toDate()); params.append("endDate", dspViewSeries.value("gltrans_date").toDate()); params.append("journalnumber", dspViewSeries.value("gltrans_journalnumber").toString()); dspGLSeries *newdlg = new dspGLSeries(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } void dspGLTransactions::sViewDocument() { XSqlQuery dspViewDocument; XTreeWidgetItem * item = (XTreeWidgetItem*)list()->currentItem(); if(0 == item) return; ParameterList params; if(item->rawValue("gltrans_doctype").toString() == "VO") { dspViewDocument.prepare("SELECT vohead_id, vohead_misc" " FROM vohead" " WHERE (vohead_number=:vohead_number)"); dspViewDocument.bindValue(":vohead_number", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("vohead_id", dspViewDocument.value("vohead_id").toInt()); params.append("mode", "view"); if(dspViewDocument.value("vohead_misc").toBool()) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } } else if(item->rawValue("gltrans_doctype").toString() == "IN") { dspViewDocument.prepare("SELECT invchead_id" " FROM invchead" " WHERE (invchead_invcnumber=:invchead_invcnumber)"); dspViewDocument.bindValue(":invchead_invcnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; invoice::viewInvoice(dspViewDocument.value("invchead_id").toInt()); } else if(item->rawValue("gltrans_doctype").toString() == "PO") { QStringList docnumber = item->rawValue("docnumber").toString().split("-"); dspViewDocument.prepare("SELECT pohead_id" " FROM pohead" " WHERE (pohead_number=:docnumber)"); dspViewDocument.bindValue(":docnumber", docnumber[0]); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("pohead_id", dspViewDocument.value("pohead_id").toInt()); params.append("mode", "view"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } else if(item->rawValue("gltrans_doctype").toString() == "SH") { dspViewDocument.prepare("SELECT shiphead_id" " FROM shiphead" " WHERE (shiphead_number=:shiphead_number)"); dspViewDocument.bindValue(":shiphead_number", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("shiphead_id", dspViewDocument.value("shiphead_id").toInt()); dspShipmentsByShipment *newdlg = new dspShipmentsByShipment(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } else if( (item->rawValue("gltrans_doctype").toString() == "CM") || (item->rawValue("gltrans_doctype").toString() == "DM") ) { if(item->rawValue("gltrans_source").toString() == "A/P") { dspViewDocument.prepare("SELECT apopen_id" " FROM apopen" " WHERE ( (apopen_docnumber=:docnumber) " " AND (apopen_doctype IN ('C', 'D')) );"); dspViewDocument.bindValue(":docnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("apopen_id", dspViewDocument.value("apopen_id").toInt()); apOpenItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else if(item->rawValue("gltrans_source").toString() == "A/R") { dspViewDocument.prepare("SELECT aropen_id" " FROM aropen" " WHERE ((aropen_docnumber=:docnumber) " " AND (aropen_doctype IN ('C', 'D')) );"); dspViewDocument.bindValue(":docnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("aropen_id", dspViewDocument.value("aropen_id").toInt()); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else if(item->rawValue("gltrans_source").toString() == "S/O") { dspViewDocument.prepare("SELECT cmhead_id" " FROM cmhead" " WHERE (cmhead_number=:docnumber);"); dspViewDocument.bindValue(":docnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("cmhead_id", dspViewDocument.value("cmhead_id").toInt()); creditMemo *newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } } else if(item->rawValue("gltrans_doctype").toString() == "SO") { QStringList docnumber = item->rawValue("docnumber").toString().split("-"); dspViewDocument.prepare("SELECT cohead_id" " FROM cohead" " WHERE (cohead_number=:docnumber)"); dspViewDocument.bindValue(":docnumber", docnumber[0]); dspViewDocument.exec(); if(dspViewDocument.first()) salesOrder::viewSalesOrder(dspViewDocument.value("cohead_id").toInt()); } else if(item->rawValue("gltrans_doctype").toString() == "WO") { QStringList docnumber = item->rawValue("docnumber").toString().split("-"); params.append("wo_number", docnumber[0]); dspWoHistoryByNumber *newdlg = new dspWoHistoryByNumber(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } else if(item->rawValue("gltrans_source").toString() == "I/M") { dspViewDocument.prepare("SELECT gltrans_misc_id" " FROM gltrans" " WHERE (gltrans_id=:gltrans_id)"); dspViewDocument.bindValue(":gltrans_id", item->id()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("invhist_id", dspViewDocument.value("gltrans_misc_id").toInt()); transactionInformation newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void dspGLTransactions::sViewJournal() { ParameterList params; params.append("startDate", omfgThis->startOfTime()); params.append("endDate", omfgThis->endOfTime()); params.append("journalnumber", list()->rawValue("gltrans_journalnumber")); params.append("accnt_id", list()->altId()); params.append("run"); dspJournals *newdlg = new dspJournals(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } bool dspGLTransactions::forwardUpdate() { QString sql( "SELECT MIN(forwardUpdateAccount(accnt_id)) AS result " "FROM accnt " "" " WHERE (accnt_id=)" "" ";" ); ParameterList params; setParams(params); MetaSQLQuery mql(sql); XSqlQuery mq = mql.toQuery(params); if (mq.first()) { int result = mq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("forwardUpdateTrialBalance", result), __FILE__, __LINE__); return false; } } else if (mq.lastError().type() != QSqlError::NoError) { systemError(this, mq.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void dspGLTransactions::handleTotalCheckbox() { ParameterList params; parameterWidget()->appendValue(params); _showRunningTotal->setVisible(params.inList("accnt_id") && !params.inList("source_id") && !params.inList("docnum")); _beginningBalanceLit->setVisible(_showRunningTotal->isChecked() && _showRunningTotal->isVisible()); _beginningBalance->setVisible(_showRunningTotal->isChecked() && _showRunningTotal->isVisible()); } qt-client-4.1.0/guiclient/displays/dspGLTransactions.h000066400000000000000000000025531217451700100230050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPGLTRANSACTIONS_H #define DSPGLTRANSACTIONS_H #include "guiclient.h" #include "display.h" #include "ui_dspGLTransactions.h" class dspGLTransactions : public display, public Ui::dspGLTransactions { Q_OBJECT public: dspGLTransactions(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*, int); virtual void sPrint(); virtual void sFillList(ParameterList, bool = false); virtual void sViewTrans(); virtual void sViewSeries(); virtual void sViewDocument(); virtual void sViewJournal(); protected slots: virtual void languageChange(); virtual bool forwardUpdate(); private slots: void handleTotalCheckbox(); private: QStringList _sources; }; #endif // DSPGLTRANSACTIONS_H qt-client-4.1.0/guiclient/displays/dspGLTransactions.ui000066400000000000000000000053731217451700100231760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspGLTransactions 0 0 368 51 General Ledger Transactions 0 Qt::Vertical QSizePolicy::Expanding 20 0 Show Running Total Qt::Horizontal 0 0 Beginning Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XCheckBox QCheckBox
    xcheckbox.h
    XLabel QLabel
    xlabel.h
    qt-client-4.1.0/guiclient/displays/dspIndentedBOM.cpp000066400000000000000000000037161217451700100225370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspIndentedBOM.h" #include dspIndentedBOM::dspIndentedBOM(QWidget* parent, const char*, Qt::WFlags fl) : dspBOMBase(parent, "dspIndentedBOM", fl) { setWindowTitle(tr("Indented Bill of Materials")); setReportName("IndentedBOM"); list()->setRootIsDecorated(true); list()->addColumn(tr("Seq #"), 80, Qt::AlignCenter,true, "bomdata_bomwork_seqnumber"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "bomdata_item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "bomdata_itemdescription"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "bomdata_uom_name"); list()->addColumn(tr("Qty. Req."), _qtyColumn, Qt::AlignRight, true, "bomdata_qtyreq"); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomdata_scrap"); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter,true, "bomdata_effective"); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter,true, "bomdata_expires"); list()->addColumn(tr("Notes"), _itemColumn, Qt::AlignCenter,false, "bomdata_notes"); list()->addColumn(tr("Reference"), _itemColumn, Qt::AlignCenter,false, "bomdata_ref"); list()->setIndentation(10); list()->setPopulateLinear(); } bool dspIndentedBOM::setParams(ParameterList ¶ms) { params.append("byIndented"); return dspBOMBase::setParams(params); } void dspIndentedBOM::sFillList() { dspBOMBase::sFillList(); list()->expandAll(); } qt-client-4.1.0/guiclient/displays/dspIndentedBOM.h000066400000000000000000000014371217451700100222020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINDENTEDBOM_H #define DSPINDENTEDBOM_H #include "dspBOMBase.h" class dspIndentedBOM : public dspBOMBase { Q_OBJECT public: dspIndentedBOM(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sFillList(); }; #endif // DSPINDENTEDBOM_H qt-client-4.1.0/guiclient/displays/dspIndentedWhereUsed.cpp000066400000000000000000000107121217451700100240070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspIndentedWhereUsed.h" #include #include #include #include #include "dspInventoryHistory.h" dspIndentedWhereUsed::dspIndentedWhereUsed(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspIndentedWhereUsed", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Indented Where Used")); setListLabel(tr("Bill of Materials Items")); setReportName("IndentedWhereUsed"); setMetaSQLOptions("whereUsed", "detail"); setUseAltId(true); _worksetid = 0; if (_metrics->boolean("AllowInactiveBomItems")) _item->setType(ItemLineEdit::cGeneralComponents); else _item->setType(ItemLineEdit::cGeneralComponents | ItemLineEdit::cActive); list()->setRootIsDecorated(true); list()->addColumn(tr("Seq. #"), 80, Qt::AlignRight, true, "bomwork_seqnumber"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "bomwork_qtyfxd"); list()->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "bomwork_qtyper"); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomwork_scrap"); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter,true, "bomwork_effective"); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter,true, "bomwork_expires"); list()->setPopulateLinear(); } void dspIndentedWhereUsed::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspIndentedWhereUsed::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); if (pParams.inList("run")) { sFillList(); return NoError_Print; } return NoError; } bool dspIndentedWhereUsed::setParams(ParameterList ¶ms) { if (!_item->isValid()) { QMessageBox::warning( this, tr("Enter a Valid Item Number"), tr("You must enter a valid Item Number.") ); _item->setFocus(); return false; } params.append("item_id", _item->id()); if(_showExpired->isChecked()) params.append("showExpired"); if(_showFuture->isChecked()) params.append("showFuture"); params.append("byIndented"); params.append("bomworkset_id", _worksetid); return true; } void dspIndentedWhereUsed::sViewInventoryHistory() { ParameterList params; params.append("item_id", list()->altId()); params.append("run"); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspIndentedWhereUsed::sPopulateMenu(QMenu *menu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = menu->addAction(tr("View Item Inventory History..."), this, SLOT(sViewInventoryHistory())); menuItem->setEnabled(_privileges->check("ViewInventoryHistory")); } void dspIndentedWhereUsed::sPreview() { worksetWrapper(0); } void dspIndentedWhereUsed::sPrint() { worksetWrapper(1); } void dspIndentedWhereUsed::sFillList() { worksetWrapper(2); } void dspIndentedWhereUsed::worksetWrapper(int action) { XSqlQuery qq; qq.prepare("SELECT indentedWhereUsed(:item_id) AS workset_id;"); qq.bindValue(":item_id", _item->id()); qq.exec(); if (qq.first()) { _worksetid = qq.value("workset_id").toInt(); if(action == 0) display::sPreview(); else if(action == 1) display::sPrint(); else //if(action == 2) { display::sFillList(); list()->expandAll(); } qq.prepare("SELECT deleteBOMWorkset(:bomworkset_id) AS result;"); qq.bindValue(":bomworkset_id", _worksetid); qq.exec(); } else QMessageBox::critical( this, tr("Error Executing Report"), tr( "Was unable to create/collect the required information to create this report." ) ); } qt-client-4.1.0/guiclient/displays/dspIndentedWhereUsed.h000066400000000000000000000024071217451700100234560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINDENTEDWHEREUSED_H #define DSPINDENTEDWHEREUSED_H #include "guiclient.h" #include "display.h" #include #include "ui_dspIndentedWhereUsed.h" class dspIndentedWhereUsed : public display, public Ui::dspIndentedWhereUsed { Q_OBJECT public: dspIndentedWhereUsed(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sViewInventoryHistory(); virtual void sPopulateMenu(QMenu * menu, QTreeWidgetItem *, int); virtual void sPreview(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); private: void worksetWrapper(int); int _worksetid; }; #endif // DSPINDENTEDWHEREUSED_H qt-client-4.1.0/guiclient/displays/dspIndentedWhereUsed.ui000066400000000000000000000063661217451700100236540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspIndentedWhereUsed 0 0 506 88 Indented Where Used 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 Show &Expired Components Show &Future Components Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 ItemCluster QWidget
    itemcluster.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    _item _showExpired _showFuture
    qt-client-4.1.0/guiclient/displays/dspInvalidBillsOfMaterials.cpp000066400000000000000000000074431217451700100251530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInvalidBillsOfMaterials.h" #include #include #include #include #include #include #include "mqlutil.h" #include "item.h" #include "itemSite.h" dspInvalidBillsOfMaterials::dspInvalidBillsOfMaterials(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspInvalidBillsOfMaterials", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Bills of Materials without Component Item Sites")); setListLabel(tr("Invalid Bill of Material Items")); setMetaSQLOptions("invalidBillsofMaterials", "detail"); setUseAltId(true); connect(_update, SIGNAL(toggled(bool)), this, SLOT(sHandleUpdate())); list()->addColumn("componentItemid", 0, Qt::AlignCenter,true, "pitem_id"); list()->addColumn("componentSiteId", 0, Qt::AlignCenter,true, "citem_id"); list()->addColumn("warehousId", 0, Qt::AlignCenter,true, "warehous_id"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("Parent Item #"), _itemColumn, Qt::AlignLeft, true, "parentitem"); list()->addColumn(tr("Component Item #"), _itemColumn, Qt::AlignLeft, true, "componentitem"); list()->addColumn(tr("Component Item Description"), -1, Qt::AlignLeft, true, "descrip"); if (_preferences->boolean("XCheckBox/forgetful")) _update->setChecked(true); } void dspInvalidBillsOfMaterials::languageChange() { display::languageChange(); retranslateUi(this); } void dspInvalidBillsOfMaterials::sEditItem() { item::editItem(list()->altId()); } void dspInvalidBillsOfMaterials::sCreateItemSite() { ParameterList params; params.append("mode", "new"); params.append("item_id", list()->currentItem()->rawValue("citem_id").toInt()); params.append("warehous_id", list()->currentItem()->rawValue("warehous_id").toInt()); itemSite newdlg(this, "", true); newdlg.set(params); newdlg.exec(); sFillList(); } void dspInvalidBillsOfMaterials::sEditItemSite() { ParameterList params; params.append("mode", "edit"); params.append("itemsite_id", list()->id()); itemSite newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInvalidBillsOfMaterials::sHandleUpdate() { if (_update->isChecked()) { connect(omfgThis, SIGNAL(itemsUpdated(int, bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(itemsitesUpdated()), this, SLOT(sFillList())); } else { disconnect(omfgThis, SIGNAL(itemsUpdated(int, bool)), this, SLOT(sFillList())); disconnect(omfgThis, SIGNAL(itemsitesUpdated()), this, SLOT(sFillList())); } } bool dspInvalidBillsOfMaterials::setParams(ParameterList ¶ms) { if (_warehouse->isSelected()) params.append("warehous_id", _warehouse->id()); return true; } void dspInvalidBillsOfMaterials::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Parent Item..."), this, SLOT(sEditItem())); menuItem->setEnabled(_privileges->check("MaintainItemMasters")); menuItem = pMenu->addAction(tr("Edit Parent Item Site..."), this, SLOT(sEditItemSite())); menuItem->setEnabled(_privileges->check("MaintainItemSites")); menuItem = pMenu->addAction(tr("Create Component Item Site..."), this, SLOT(sCreateItemSite())); menuItem->setEnabled(_privileges->check("MaintainItemSites")); } qt-client-4.1.0/guiclient/displays/dspInvalidBillsOfMaterials.h000066400000000000000000000022431217451700100246110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVALIDBILLSOFMATERIALS_H #define DSPINVALIDBILLSOFMATERIALS_H #include "guiclient.h" #include "display.h" #include "ui_dspInvalidBillsOfMaterials.h" class dspInvalidBillsOfMaterials : public display, public Ui::dspInvalidBillsOfMaterials { Q_OBJECT public: dspInvalidBillsOfMaterials(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sEditItem(); virtual void sCreateItemSite(); virtual void sEditItemSite(); virtual void sHandleUpdate(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); protected slots: virtual void languageChange(); }; #endif // DSPINVALIDBILLSOFMATERIALS_H qt-client-4.1.0/guiclient/displays/dspInvalidBillsOfMaterials.ui000066400000000000000000000050011217451700100247720ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInvalidBillsOfMaterials 0 0 338 125 Bills of Materials without Component Item Sites false Update when Items or Item Sites are Changed Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _warehouse
    qt-client-4.1.0/guiclient/displays/dspInventoryAvailability.cpp000066400000000000000000000345331217451700100250000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInventoryAvailability.h" #include #include #include #include #include #include "createCountTagsByItem.h" #include "dspAllocations.h" #include "dspInventoryHistory.h" #include "dspOrders.h" #include "dspRunningAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "enterMiscCount.h" #include "postMiscProduction.h" #include "purchaseOrder.h" #include "purchaseRequest.h" #include "workOrder.h" #include "parameterwidget.h" dspInventoryAvailability::dspInventoryAvailability(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspInventoryAvailability", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Inventory Availability")); setReportName("InventoryAvailability"); setMetaSQLOptions("inventoryAvailability", "general"); setUseAltId(true); setParameterWidgetVisible(true); _forgetful = true; if(window()) _settingsName = window()->objectName() + "/asof"; _asof->setCurrentIndex(_preferences->value(_settingsName).toInt()); _forgetful = false; parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->append(tr("Class Code Pattern"), "classcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Item Group"), "itemgrp_id", XComboBox::ItemGroups); parameterWidget()->append(tr("Item Group Pattern"), "itemgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Planner Code"), "plancode_id", XComboBox::PlannerCodes); parameterWidget()->append(tr("Planner Code Pattern"), "plancode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Source Vendor"), "vend_id", ParameterWidget::Vendor); parameterWidget()->appendComboBox(tr("Source Vendor Type"), "vendtype_id", XComboBox::VendorTypes); parameterWidget()->append(tr("Source Vendor Type Pattern"), "vendtype_pattern", ParameterWidget::Text); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); sHandleShowReorder(_showReorder->isChecked()); sByVendorChanged(); connect(_showReorder, SIGNAL(toggled(bool)), this, SLOT(sHandleShowReorder(bool))); connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList())); connect(_byVendor, SIGNAL(toggled(bool)), this, SLOT(sByVendorChanged())); connect(_asof, SIGNAL(currentIndexChanged(int)), this, SLOT(sAsofChanged(int))); } void dspInventoryAvailability::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspInventoryAvailability::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; parameterWidget()->setSavedFilters(); param = pParams.value("classcode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code"), param); param = pParams.value("classcode_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code Pattern"), param); param = pParams.value("plancode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code"), param); param = pParams.value("plancode_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code Pattern"), param); param = pParams.value("itemgrp_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item Group"), param); param = pParams.value("itemgrp_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Item Group Pattern"), param); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param); param = pParams.value("itemsite_id", &valid); if (valid) { XSqlQuery qry; qry.prepare("SELECT itemsite_item_id, itemsite_warehous_id " "FROM itemsite " "WHERE itemsite_id=:itemsite_id;"); qry.bindValue(":itemsite_id", param.toInt()); qry.exec(); if (qry.first()) { parameterWidget()->setDefault(tr("Item"), qry.value("itemsite_item_id")); parameterWidget()->setDefault(tr("Site"), qry.value("itemsite_warehous_id")); } } param = pParams.value("warehous_id", &valid); if (valid) parameterWidget()->setDefault(tr("Site"), param); param = pParams.value("byDays", &valid); if (valid) { _forgetful = true; _asof->setCurrentIndex(LOOKAHEADDAYS); _days->setValue(param.toInt()); } param = pParams.value("byDate", &valid); if (valid) { _forgetful = true; _asof->setCurrentIndex(CUTOFFDATE); _date->setDate(param.toDate()); } // sources may not exist, so turn by Vendor off to avoid confusion _byVendor->setForgetful(true); _byVendor->setChecked(false); parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspInventoryAvailability::setParams(ParameterList ¶ms) { if ((_asof->currentIndex() == CUTOFFDATE) && (!_date->isValid())) { QMessageBox::critical(this, tr("Enter Valid Date"), tr("Please enter a valid date.")); _date->setFocus(); return false; } else if ((_asof->currentIndex() == DATES) && (!_startDate->isValid() || !_endDate->isValid())) { QMessageBox::critical(this, tr("Enter Valid Dates"), tr("Please select a valid date range.")); _date->setFocus(); return false; } if (!display::setParams(params)) return false; if (_asof->currentIndex() == ITEMSITELEADTIME) params.append("byLeadTime"); else if (_asof->currentIndex() == LOOKAHEADDAYS) params.append("byDays", _days->text().toInt()); else if (_asof->currentIndex() == CUTOFFDATE) params.append("byDate", _date->date()); else if (_asof->currentIndex() == DATES) { params.append("byDates"); params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } if(_showReorder->isChecked()) params.append("showReorder"); if(_ignoreReorderAtZero->isChecked()) params.append("ignoreReorderAtZero"); if(_showShortages->isChecked()) params.append("showShortages"); if(_byVendor->isChecked()) params.append("byVend"); return true; } void dspInventoryAvailability::sPopulateMenu(QMenu *menu, QTreeWidgetItem *selected, int) { XTreeWidgetItem * item = (XTreeWidgetItem*)selected; QAction *menuItem; menuItem = menu->addAction(tr("View Inventory History..."), this, SLOT(sViewHistory())); menuItem->setEnabled(_privileges->check("ViewInventoryHistory")); menu->addSeparator(); menuItem = menu->addAction(tr("View Allocations..."), this, SLOT(sViewAllocations())); menuItem->setEnabled(item->rawValue("allocated").toDouble() != 0.0); menuItem = menu->addAction(tr("View Orders..."), this, SLOT(sViewOrders())); menuItem->setEnabled(item->rawValue("ordered").toDouble() != 0.0); menuItem = menu->addAction(tr("Running Availability..."), this, SLOT(sRunningAvailability())); menu->addSeparator(); if (((XTreeWidgetItem *)selected)->altId() == 1) { menuItem = menu->addAction(tr("Create Purchase Request..."), this, SLOT(sCreatePR())); menuItem->setEnabled(_privileges->check("MaintainPurchaseRequests")); menuItem = menu->addAction(tr("Create Purchase Order..."), this, SLOT(sCreatePO())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menu->addSeparator(); } else if (((XTreeWidgetItem *)selected)->altId() == 2) { menuItem = menu->addAction(tr("Create W/O..."), this, SLOT(sCreateWO())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); menuItem = menu->addAction(tr("Post Misc. Production..."), this, SLOT(sPostMiscProduction())); menuItem->setEnabled(_privileges->check("PostMiscProduction")); menu->addSeparator(); } menu->addAction(tr("View Substitute Availability..."), this, SLOT(sViewSubstituteAvailability())); menu->addSeparator(); menuItem = menu->addAction(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag())); menuItem->setEnabled(_privileges->check("IssueCountTags")); menuItem = menu->addAction(tr("Enter Misc. Inventory Count..."), this, SLOT(sEnterMiscCount())); menuItem->setEnabled(_privileges->check("EnterMiscCounts")); } void dspInventoryAvailability::sViewHistory() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailability::sViewAllocations() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); if (_asof->currentIndex() == ITEMSITELEADTIME) params.append("byLeadTime", true); else if (_asof->currentIndex() == LOOKAHEADDAYS) params.append("byDays", _days->value()); else if (_asof->currentIndex() == CUTOFFDATE) params.append("byDate", _date->date()); else if (_asof->currentIndex() == DATES) { params.append("byRange"); params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailability::sViewOrders() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); if (_asof->currentIndex() == ITEMSITELEADTIME) params.append("byLeadTime", true); else if (_asof->currentIndex() == LOOKAHEADDAYS) params.append("byDays", _days->value()); else if (_asof->currentIndex() == CUTOFFDATE) params.append("byDate", _date->date()); else if (_asof->currentIndex() == DATES) { params.append("byRange"); params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailability::sRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailability::sCreateWO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailability::sPostMiscProduction() { ParameterList params; params.append("itemsite_id", list()->id()); postMiscProduction newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryAvailability::sCreatePR() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseRequest newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryAvailability::sCreatePO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailability::sViewSubstituteAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); if (_asof->currentIndex() == ITEMSITELEADTIME) params.append("byLeadTime", true); else if (_asof->currentIndex() == LOOKAHEADDAYS) params.append("byDays", _days->value()); else if (_asof->currentIndex() == CUTOFFDATE) params.append("byDate", _date->date()); dspSubstituteAvailabilityByItem *newdlg = new dspSubstituteAvailabilityByItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailability::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryAvailability::sEnterMiscCount() { ParameterList params; params.append("itemsite_id", list()->id()); enterMiscCount newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryAvailability::sHandleShowReorder(bool pValue) { _ignoreReorderAtZero->setEnabled(pValue); if (pValue && _preferences->boolean("XCheckBox/forgetful")) _showShortages->setChecked(true); } void dspInventoryAvailability::sByVendorChanged() { list()->clear(); list()->setColumnCount(0); if (_byVendor->isChecked()) { list()->addColumn(tr("Vendor #"), _itemColumn, Qt::AlignLeft, true, "vend_number"); setReportName("InventoryAvailabilityBySourceVendor"); } else setReportName("InventoryAvailability"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("LT"), _whsColumn, Qt::AlignCenter,true, "itemsite_leadtime"); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh"); list()->addColumn(tr("Allocated"), _qtyColumn, Qt::AlignRight, true, "allocated"); list()->addColumn(tr("Unallocated"), _qtyColumn, Qt::AlignRight, true, "unallocated"); list()->addColumn(tr("On Order"), _qtyColumn, Qt::AlignRight, true, "ordered"); list()->addColumn(tr("PO Requests"), _qtyColumn, Qt::AlignRight, true, "requests"); list()->addColumn(tr("Reorder Lvl."), _qtyColumn, Qt::AlignRight, true, "reorderlevel"); list()->addColumn(tr("OUT Level"), _qtyColumn, Qt::AlignRight, false, "outlevel"); list()->addColumn(tr("Available"), _qtyColumn, Qt::AlignRight, true, "available"); } void dspInventoryAvailability::sAsofChanged(int index) { if (!_forgetful) _preferences->set(_settingsName, index); } qt-client-4.1.0/guiclient/displays/dspInventoryAvailability.h000066400000000000000000000034041217451700100244360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVENTORYAVAILABILITY_H #define DSPINVENTORYAVAILABILITY_H #include "guiclient.h" #include "display.h" #include "ui_dspInventoryAvailability.h" #define ITEMSITELEADTIME 0 #define LOOKAHEADDAYS 1 #define CUTOFFDATE 2 #define DATES 3 class dspInventoryAvailability : public display, public Ui::dspInventoryAvailability { Q_OBJECT public: dspInventoryAvailability(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * menu, QTreeWidgetItem * selected, int); virtual void sViewHistory(); virtual void sViewAllocations(); virtual void sViewOrders(); virtual void sRunningAvailability(); virtual void sCreateWO(); virtual void sPostMiscProduction(); virtual void sCreatePR(); virtual void sCreatePO(); virtual void sViewSubstituteAvailability(); virtual void sIssueCountTag(); virtual void sEnterMiscCount(); virtual void sHandleShowReorder( bool pValue ); virtual void sByVendorChanged(); virtual void sAsofChanged(int index); protected slots: virtual void languageChange(); private: bool _forgetful; QString _settingsName; }; #endif // DSPINVENTORYAVAILABILITY_H qt-client-4.1.0/guiclient/displays/dspInventoryAvailability.ui000066400000000000000000000165251217451700100246340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInventoryAvailability 0 0 617 125 Inventory Availability As of: Item Site Lead Time Look Ahead Days Cutoff Date Dates 0 0 0 1000 Qt::Horizontal QSizePolicy::MinimumExpanding 290 13 0 Qt::Horizontal QSizePolicy::Expanding 40 20 0 to Qt::Horizontal 15 20 Show 12 Shortages Reorder Exceptions false Ignore Reorder at 0 Qt::Horizontal QSizePolicy::Expanding 20 20 By Source Vendor _asof _asofLit horizontalSpacer_2 _stackedWidget _stackedWidget _asofLit _asof _stackedWidget DLineEdit QWidget
    datecluster.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _days _date _showReorder _showShortages _asof currentIndexChanged(int) _stackedWidget setCurrentIndex(int) 152 44 444 44
    qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityByCustomerType.cpp000066400000000000000000000263601217451700100276560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInventoryAvailabilityByCustomerType.h" #include #include #include #include "createCountTagsByItem.h" #include "dspAllocations.h" #include "dspOrders.h" #include "dspReservations.h" #include "dspRunningAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "inputManager.h" #include "purchaseOrder.h" #include "reserveSalesOrderItem.h" #include "storedProcErrorLookup.h" #include "workOrder.h" dspInventoryAvailabilityByCustomerType::dspInventoryAvailabilityByCustomerType(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspInventoryAvailabilityByCustomerType", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Inventory Availability by Customer Type")); setListLabel(tr("Availability")); setReportName("InventoryAvailabilityByCustomerType"); setMetaSQLOptions("inventoryAvailability", "byCustOrSO"); setUseAltId(true); setAutoUpdateEnabled(true); _custtype->setType(ParameterGroup::CustomerType); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh"); list()->addColumn(tr("This Alloc."), _qtyColumn, Qt::AlignRight, true, "sobalance"); list()->addColumn(tr("Total Alloc."), _qtyColumn, Qt::AlignRight, true, "allocated"); list()->addColumn(tr("Orders"), _qtyColumn, Qt::AlignRight, true, "ordered"); list()->addColumn(tr("This Avail."), _qtyColumn, Qt::AlignRight, true, "orderavail"); list()->addColumn(tr("Total Avail."), _qtyColumn, Qt::AlignRight, true, "totalavail"); list()->addColumn(tr("At Shipping"), _qtyColumn, Qt::AlignRight, true, "atshipping"); list()->addColumn(tr("Order/Start Date"),_dateColumn, Qt::AlignCenter,true, "orderdate"); list()->addColumn(tr("Sched./Due Date"), _dateColumn, Qt::AlignCenter,true, "duedate"); list()->setIndentation(10); list()->setPopulateLinear(true); if(!_metrics->boolean("EnableSOReservations")) { _useReservationNetting->hide(); _useReservationNetting->setEnabled(false); } else { connect(_useReservationNetting, SIGNAL(toggled(bool)), this, SLOT(sHandleReservationNetting(bool))); if(_useReservationNetting->isChecked()) sHandleReservationNetting(true); } connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList())); sFillList(); } void dspInventoryAvailabilityByCustomerType::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspInventoryAvailabilityByCustomerType::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("onlyShowShortages", &valid); if (valid) _onlyShowShortages->setChecked(true); return NoError; } bool dspInventoryAvailabilityByCustomerType::setParams(ParameterList ¶ms) { _custtype->appendValue(params); if(_onlyShowShortages->isChecked()) params.append("onlyShowShortages"); if (_showWoSupply->isChecked()) params.append("showWoSupply"); if (_useReservationNetting->isChecked()) params.append("useReservationNetting"); return true; } void dspInventoryAvailabilityByCustomerType::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int) { XTreeWidgetItem * item = (XTreeWidgetItem*)selected; QAction *menuItem; if (list()->altId() == -2) { menuItem = pMenu->addAction(tr("Add to Packing List Batch"), this, SLOT(sAddToPackingListBatch())); } else if (list()->altId() != -1) { menuItem = pMenu->addAction("View Allocations...", this, SLOT(sViewAllocations())); if (item->rawValue("allocated").toDouble() == 0.0) menuItem->setEnabled(false); menuItem = pMenu->addAction("View Orders...", this, SLOT(sViewOrders())); if (item->rawValue("ordered").toDouble() == 0.0) menuItem->setEnabled(false); menuItem = pMenu->addAction("Running Availability...", this, SLOT(sRunningAvailability())); menuItem = pMenu->addAction("Substitute Availability...", this, SLOT(sViewSubstituteAvailability())); XSqlQuery qq; qq.prepare ("SELECT item_type " "FROM itemsite,item " "WHERE ((itemsite_id=:itemsite_id)" "AND (itemsite_item_id=item_id)" "AND (itemsite_wosupply));"); qq.bindValue(":itemsite_id", list()->id()); qq.exec(); if (qq.next()) { if (qq.value("item_type") == "P") { pMenu->addSeparator(); menuItem = pMenu->addAction("Issue Purchase Order...", this, SLOT(sIssuePO())); if (!_privileges->check("MaintainPurchaseOrders")) menuItem->setEnabled(false); } else if (qq.value("item_type") == "M") { pMenu->addSeparator(); menuItem = pMenu->addAction("Issue Work Order...", this, SLOT(sIssueWO())); if (!_privileges->check("MaintainWorkOrders")) menuItem->setEnabled(false); } } if(_metrics->boolean("EnableSOReservations")) { pMenu->addSeparator(); pMenu->addAction(tr("Show Reservations..."), this, SLOT(sShowReservations())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Unreserve Stock"), this, SLOT(sUnreserveStock())); menuItem->setEnabled(_privileges->check("MaintainReservations")); menuItem = pMenu->addAction(tr("Reserve Stock..."), this, SLOT(sReserveStock())); menuItem->setEnabled(_privileges->check("MaintainReservations")); menuItem = pMenu->addAction(tr("Reserve Line Balance"), this, SLOT(sReserveLineBalance())); menuItem->setEnabled(_privileges->check("MaintainReservations")); } pMenu->addSeparator(); menuItem = pMenu->addAction("Issue Count Tag...", this, SLOT(sIssueCountTag())); if (!_privileges->check("IssueCountTags")) menuItem->setEnabled(false); } } void dspInventoryAvailabilityByCustomerType::sViewAllocations() { XSqlQuery qq; qq.prepare( "SELECT coitem_scheddate " "FROM coitem " "WHERE (coitem_id=:soitem_id);" ); qq.bindValue(":soitem_id", list()->altId()); qq.exec(); if (qq.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", qq.value("coitem_scheddate")); params.append("run"); dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspInventoryAvailabilityByCustomerType::sViewOrders() { XSqlQuery qq; qq.prepare( "SELECT coitem_scheddate " "FROM coitem " "WHERE (coitem_id=:soitem_id);" ); qq.bindValue(":soitem_id", list()->altId()); qq.exec(); if (qq.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", qq.value("coitem_scheddate")); params.append("run"); dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspInventoryAvailabilityByCustomerType::sRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityByCustomerType::sViewSubstituteAvailability() { XSqlQuery qq; qq.prepare( "SELECT coitem_scheddate " "FROM coitem " "WHERE (coitem_id=:soitem_id);" ); qq.bindValue(":soitem_id", list()->altId()); qq.exec(); if (qq.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", qq.value("coitem_scheddate")); params.append("run"); dspSubstituteAvailabilityByItem *newdlg = new dspSubstituteAvailabilityByItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } // ToDo } void dspInventoryAvailabilityByCustomerType::sIssuePO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityByCustomerType::sIssueWO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityByCustomerType::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryAvailabilityByCustomerType::sFillList() { display::sFillList(); list()->expandAll(); } void dspInventoryAvailabilityByCustomerType::sHandleReservationNetting(bool yn) { if(yn) list()->headerItem()->setText(7, tr("This Reserve")); else list()->headerItem()->setText(7, tr("This Avail.")); sFillList(); } void dspInventoryAvailabilityByCustomerType::sReserveStock() { ParameterList params; params.append("soitem_id", list()->altId()); reserveSalesOrderItem newdlg(this, "", true); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void dspInventoryAvailabilityByCustomerType::sReserveLineBalance() { XSqlQuery qq; qq.prepare("SELECT reserveSoLineBalance(:soitem_id) AS result;"); qq.bindValue(":soitem_id", list()->altId()); qq.exec(); if (qq.first()) { int result = qq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("reserveSoLineBalance", result), __FILE__, __LINE__); return; } } else if (qq.lastError().type() != QSqlError::NoError) { systemError(this, tr("Error\n") + qq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspInventoryAvailabilityByCustomerType::sUnreserveStock() { XSqlQuery qq; qq.prepare("UPDATE coitem SET coitem_qtyreserved=0 WHERE coitem_id=:soitem_id;"); qq.bindValue(":soitem_id", list()->altId()); qq.exec(); if (qq.lastError().type() != QSqlError::NoError) { systemError(this, tr("Error\n") + qq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspInventoryAvailabilityByCustomerType::sShowReservations() { ParameterList params; params.append("soitem_id", list()->altId()); params.append("run"); dspReservations * newdlg = new dspReservations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityByCustomerType::sAddToPackingListBatch() { XSqlQuery qq; qq.prepare("SELECT addToPackingListBatch(:sohead_id) AS result;"); qq.bindValue(":sohead_id", list()->id()); qq.exec(); sFillList(); } qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityByCustomerType.h000066400000000000000000000033571217451700100273240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVENTORYAVAILABILITYBYCUSTOMERTYPE_H #define DSPINVENTORYAVAILABILITYBYCUSTOMERTYPE_H #include "guiclient.h" #include "display.h" #include "ui_dspInventoryAvailabilityByCustomerType.h" class dspInventoryAvailabilityByCustomerType : public display, public Ui::dspInventoryAvailabilityByCustomerType { Q_OBJECT public: dspInventoryAvailabilityByCustomerType(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * selected, int); virtual void sViewAllocations(); virtual void sViewOrders(); virtual void sRunningAvailability(); virtual void sViewSubstituteAvailability(); virtual void sIssuePO(); virtual void sIssueWO(); virtual void sIssueCountTag(); virtual void sHandleReservationNetting(bool); virtual void sReserveStock(); virtual void sReserveLineBalance(); virtual void sUnreserveStock(); virtual void sShowReservations(); virtual void sAddToPackingListBatch(); virtual void sFillList(); protected slots: virtual void languageChange(); private: QButtonGroup* _showByGroupInt; }; #endif // DSPINVENTORYAVAILABILITYBYCUSTOMERTYPE_H qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityByCustomerType.ui000066400000000000000000000072121217451700100275040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInventoryAvailabilityByCustomerType 0 0 466 124 Inventory Availability by Customer Type Qt::StrongFocus false Qt::Vertical 20 0 Only Show Shortages Use Reservation Netting Show Work Order Supply Qt::Vertical 20 0 Qt::Horizontal 2 20 ParameterGroup QGroupBox
    parametergroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _custtype _onlyShowShortages _useReservationNetting _showWoSupply
    qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityBySalesOrder.cpp000066400000000000000000000307131217451700100272530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInventoryAvailabilityBySalesOrder.h" #include #include #include #include "createCountTagsByItem.h" #include "dspAllocations.h" #include "dspOrders.h" #include "dspReservations.h" #include "dspRunningAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "inputManager.h" #include "purchaseOrder.h" #include "reserveSalesOrderItem.h" #include "storedProcErrorLookup.h" #include "workOrder.h" dspInventoryAvailabilityBySalesOrder::dspInventoryAvailabilityBySalesOrder(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspInventoryAvailabilityBySalesOrder", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Inventory Availability by Sales Order")); setListLabel(tr("Availability")); setReportName("InventoryAvailabilityBySalesOrder"); setMetaSQLOptions("inventoryAvailability", "byCustOrSO"); setUseAltId(true); setAutoUpdateEnabled(true); _so->setAllowedTypes(OrderLineEdit::Sales); _so->setAllowedStatuses(OrderLineEdit::Open); omfgThis->inputManager()->notify(cBCSalesOrder, this, _so, SLOT(setId(int))); list()->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh"); list()->addColumn(tr("This Alloc."), _qtyColumn, Qt::AlignRight, true, "sobalance"); list()->addColumn(tr("Total Alloc."),_qtyColumn, Qt::AlignRight, true, "allocated"); list()->addColumn(tr("Orders"), _qtyColumn, Qt::AlignRight, true, "ordered"); list()->addColumn(tr("This Avail."), _qtyColumn, Qt::AlignRight, true, "orderavail"); list()->addColumn(tr("Total Avail."),_qtyColumn, Qt::AlignRight, true, "totalavail"); list()->addColumn(tr("At Shipping"), _qtyColumn, Qt::AlignRight, true, "atshipping"); list()->addColumn(tr("Start Date"), _dateColumn, Qt::AlignCenter,true, "orderdate"); list()->addColumn(tr("Sched. Date"),_dateColumn, Qt::AlignCenter,true, "duedate"); list()->setIndentation(10); if(!_metrics->boolean("EnableSOReservations")) { _useReservationNetting->hide(); _useReservationNetting->setEnabled(false); } else { connect(_useReservationNetting, SIGNAL(toggled(bool)), this, SLOT(sHandleReservationNetting(bool))); if(_useReservationNetting->isChecked()) sHandleReservationNetting(true); } connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList())); } void dspInventoryAvailabilityBySalesOrder::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspInventoryAvailabilityBySalesOrder::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("onlyShowShortages", &valid); if (valid) _onlyShowShortages->setChecked(true); param = pParams.value("sohead_id", &valid); if (valid) _so->setId(param.toInt(),"SO"); return NoError; } bool dspInventoryAvailabilityBySalesOrder::setParams(ParameterList ¶ms) { if(!_so->isValid()) { QMessageBox::warning(this, tr("No Sales Order Selected"), tr("You must select a valid Sales Order.") ); return false; } params.append("sohead_id", _so->id()); if(_onlyShowShortages->isChecked()) params.append("onlyShowShortages"); if (_showWoSupply->isChecked()) params.append("showWoSupply"); if (_useReservationNetting->isChecked()) params.append("useReservationNetting"); return true; } void dspInventoryAvailabilityBySalesOrder::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int) { XSqlQuery dspPopulateMenu; XTreeWidgetItem * item = (XTreeWidgetItem*)selected; QAction *menuItem; if (list()->altId() != -1) { menuItem = pMenu->addAction("View Allocations...", this, SLOT(sViewAllocations())); if (item->rawValue("allocated").toDouble() == 0.0) menuItem->setEnabled(false); menuItem = pMenu->addAction("View Orders...", this, SLOT(sViewOrders())); if (item->rawValue("ordered").toDouble() == 0.0) menuItem->setEnabled(false); menuItem = pMenu->addAction("Running Availability...", this, SLOT(sRunningAvailability())); menuItem = pMenu->addAction("Substitute Availability...", this, SLOT(sViewSubstituteAvailability())); dspPopulateMenu.prepare ("SELECT item_type " "FROM itemsite,item " "WHERE ((itemsite_id=:itemsite_id)" "AND (itemsite_item_id=item_id)" "AND (itemsite_wosupply));"); dspPopulateMenu.bindValue(":itemsite_id", list()->id()); dspPopulateMenu.exec(); if (dspPopulateMenu.next()) { if (dspPopulateMenu.value("item_type") == "P") { pMenu->addSeparator(); menuItem = pMenu->addAction("Issue Purchase Order...", this, SLOT(sIssuePO())); if (!_privileges->check("MaintainPurchaseOrders")) menuItem->setEnabled(false); } else if (dspPopulateMenu.value("item_type") == "M") { pMenu->addSeparator(); menuItem = pMenu->addAction("Issue Work Order...", this, SLOT(sIssueWO())); if (!_privileges->check("MaintainWorkOrders")) menuItem->setEnabled(false); } } if(_metrics->boolean("EnableSOReservations")) { pMenu->addSeparator(); pMenu->addAction(tr("Show Reservations..."), this, SLOT(sShowReservations())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Unreserve Stock"), this, SLOT(sUnreserveStock())); menuItem->setEnabled(_privileges->check("MaintainReservations")); menuItem = pMenu->addAction(tr("Reserve Stock..."), this, SLOT(sReserveStock())); menuItem->setEnabled(_privileges->check("MaintainReservations")); menuItem = pMenu->addAction(tr("Reserve Line Balance"), this, SLOT(sReserveLineBalance())); menuItem->setEnabled(_privileges->check("MaintainReservations")); } pMenu->addSeparator(); menuItem = pMenu->addAction("Issue Count Tag...", this, SLOT(sIssueCountTag())); if (!_privileges->check("IssueCountTags")) menuItem->setEnabled(false); } } void dspInventoryAvailabilityBySalesOrder::sViewAllocations() { XSqlQuery dspViewAllocations; dspViewAllocations.prepare( "SELECT coitem_scheddate " "FROM coitem " "WHERE (coitem_id=:soitem_id);" ); dspViewAllocations.bindValue(":soitem_id", list()->altId()); dspViewAllocations.exec(); if (dspViewAllocations.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", dspViewAllocations.value("coitem_scheddate")); params.append("run"); dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspInventoryAvailabilityBySalesOrder::sViewOrders() { XSqlQuery dspViewOrders; dspViewOrders.prepare( "SELECT coitem_scheddate " "FROM coitem " "WHERE (coitem_id=:soitem_id);" ); dspViewOrders.bindValue(":soitem_id", list()->altId()); dspViewOrders.exec(); if (dspViewOrders.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", dspViewOrders.value("coitem_scheddate")); params.append("run"); dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspInventoryAvailabilityBySalesOrder::sRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityBySalesOrder::sViewSubstituteAvailability() { XSqlQuery dspViewSubstituteAvailability; dspViewSubstituteAvailability.prepare( "SELECT coitem_scheddate " "FROM coitem " "WHERE (coitem_id=:soitem_id);" ); dspViewSubstituteAvailability.bindValue(":soitem_id", list()->altId()); dspViewSubstituteAvailability.exec(); if (dspViewSubstituteAvailability.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", dspViewSubstituteAvailability.value("coitem_scheddate")); params.append("run"); dspSubstituteAvailabilityByItem *newdlg = new dspSubstituteAvailabilityByItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } // ToDo } void dspInventoryAvailabilityBySalesOrder::sIssuePO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityBySalesOrder::sIssueWO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityBySalesOrder::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryAvailabilityBySalesOrder::sFillList() { XSqlQuery qq; qq.prepare("SELECT cohead_number," " cohead_orderdate," " cohead_custponumber," " cust_name, cntct_phone " " FROM cohead" " JOIN custinfo ON (cohead_cust_id=cust_id)" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" " WHERE (cohead_id=:sohead_id);" ); qq.bindValue(":sohead_id", _so->id()); qq.exec(); if (qq.first()) { _orderDate->setDate(qq.value("cohead_orderdate").toDate()); _poNumber->setText(qq.value("cohead_custponumber").toString()); _custName->setText(qq.value("cust_name").toString()); _custPhone->setText(qq.value("cntct_phone").toString()); } display::sFillList(); list()->expandAll(); } void dspInventoryAvailabilityBySalesOrder::sHandleReservationNetting(bool yn) { if(yn) list()->headerItem()->setText(7, tr("This Reserve")); else list()->headerItem()->setText(7, tr("This Avail.")); sFillList(); } void dspInventoryAvailabilityBySalesOrder::sReserveStock() { ParameterList params; params.append("soitem_id", list()->altId()); reserveSalesOrderItem newdlg(this, "", true); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void dspInventoryAvailabilityBySalesOrder::sReserveLineBalance() { XSqlQuery dspReserveLineBalance; dspReserveLineBalance.prepare("SELECT reserveSoLineBalance(:soitem_id) AS result;"); dspReserveLineBalance.bindValue(":soitem_id", list()->altId()); dspReserveLineBalance.exec(); if (dspReserveLineBalance.first()) { int result = dspReserveLineBalance.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("reserveSoLineBalance", result), __FILE__, __LINE__); return; } } else if (dspReserveLineBalance.lastError().type() != QSqlError::NoError) { systemError(this, tr("Error\n") + dspReserveLineBalance.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspInventoryAvailabilityBySalesOrder::sUnreserveStock() { XSqlQuery dspUnreserveStock; dspUnreserveStock.prepare("UPDATE coitem SET coitem_qtyreserved=0 WHERE coitem_id=:soitem_id;"); dspUnreserveStock.bindValue(":soitem_id", list()->altId()); dspUnreserveStock.exec(); if (dspUnreserveStock.lastError().type() != QSqlError::NoError) { systemError(this, tr("Error\n") + dspUnreserveStock.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspInventoryAvailabilityBySalesOrder::sShowReservations() { ParameterList params; params.append("soitem_id", list()->altId()); params.append("run"); dspReservations * newdlg = new dspReservations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityBySalesOrder.h000066400000000000000000000032721217451700100267200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVENTORYAVAILABILITYBYSALESORDER_H #define DSPINVENTORYAVAILABILITYBYSALESORDER_H #include "guiclient.h" #include "display.h" #include "ui_dspInventoryAvailabilityBySalesOrder.h" class dspInventoryAvailabilityBySalesOrder : public display, public Ui::dspInventoryAvailabilityBySalesOrder { Q_OBJECT public: dspInventoryAvailabilityBySalesOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * selected, int); virtual void sViewAllocations(); virtual void sViewOrders(); virtual void sRunningAvailability(); virtual void sViewSubstituteAvailability(); virtual void sIssuePO(); virtual void sIssueWO(); virtual void sIssueCountTag(); virtual void sHandleReservationNetting(bool); virtual void sReserveStock(); virtual void sReserveLineBalance(); virtual void sUnreserveStock(); virtual void sShowReservations(); virtual void sFillList(); protected slots: virtual void languageChange(); private: QButtonGroup* _showByGroupInt; }; #endif // DSPINVENTORYAVAILABILITYBYSALESORDER_H qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityBySalesOrder.ui000066400000000000000000000175731217451700100271170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInventoryAvailabilityBySalesOrder 0 0 582 108 Inventory Availability by Sales Order Sales Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderDate false Qt::Horizontal QSizePolicy::MinimumExpanding 13 20 Qt::Vertical 20 0 Cust. Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Cust. Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter P/O Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 0 0 0 0 0 Qt::Vertical 20 0 Only Show Shortages Use Reservation Netting Show W/O Supply Qt::Vertical 20 0 Qt::Horizontal 30 20 DLineEdit QWidget
    datecluster.h
    1
    OrderCluster QWidget
    ordercluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _onlyShowShortages _useReservationNetting _showWoSupply _orderDate
    qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityByWorkOrder.cpp000066400000000000000000000264631217451700100271350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInventoryAvailabilityByWorkOrder.h" #include #include #include #include #include #include "createCountTagsByItem.h" #include "dspAllocations.h" #include "dspInventoryHistory.h" #include "dspOrders.h" #include "dspRunningAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "enterMiscCount.h" #include "postMiscProduction.h" #include "inputManager.h" #include "purchaseOrder.h" #include "purchaseRequest.h" #include "workOrder.h" dspInventoryAvailabilityByWorkOrder::dspInventoryAvailabilityByWorkOrder(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspInventoryAvailabilityByWorkOrder", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Inventory Availability by Work Order")); setListLabel(tr("Work Order Material Availability")); setReportName("WOMaterialAvailabilityByWorkOrder"); setMetaSQLOptions("inventoryAvailabilitybyWorkorder", "detail"); setUseAltId(true); _wo->setType(cWoExploded | cWoIssued | cWoReleased); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); list()->addColumn(tr("WO/Item#"), 120, Qt::AlignLeft, true, "woinvav_item_wo_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "woinvav_descrip"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "woinvav_uomname"); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "woinvav_qoh"); list()->addColumn(tr("This Alloc."), _qtyColumn, Qt::AlignRight, true, "woinvav_balance"); list()->addColumn(tr("Total Alloc."),_qtyColumn, Qt::AlignRight, true, "woinvav_allocated"); list()->addColumn(tr("Orders"), _qtyColumn, Qt::AlignRight, true, "woinvav_ordered"); list()->addColumn(tr("This Avail."), _qtyColumn, Qt::AlignRight, true, "woinvav_woavail"); list()->addColumn(tr("Total Avail."),_qtyColumn, Qt::AlignRight, true, "woinvav_totalavail"); list()->addColumn(tr("Type"), 0, Qt::AlignLeft, false, "woinvav_type"); connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList())); } void dspInventoryAvailabilityByWorkOrder::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspInventoryAvailabilityByWorkOrder::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) _wo->setId(param.toInt()); _onlyShowShortages->setChecked(pParams.inList("onlyShowShortages")); _onlyShowInsufficientInventory->setChecked(pParams.inList("onlyShowInsufficientInventory")); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspInventoryAvailabilityByWorkOrder::setParams(ParameterList ¶ms) { if(!_wo->isValid()) { QMessageBox::warning(this, tr("Invalid W/O Selected"), tr("

    You must specify a valid Work Order Number.") ); _wo->setFocus(); return false; } params.append("wo_id", _wo->id()); if(_onlyShowShortages->isChecked()) params.append("onlyShowShortages"); if(_onlyShowInsufficientInventory->isChecked()) params.append("onlyShowInsufficientInventory"); if(_sumParentChild->isChecked()) params.append("summarizedParentChild"); if(_indentedWo->isChecked()) params.append("IndentedParentChild"); return true; } void dspInventoryAvailabilityByWorkOrder::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int) { XSqlQuery dspPopulateMenu; XTreeWidgetItem * item = (XTreeWidgetItem*)selected; QAction *menuItem; menuItem = pMenu->addAction(tr("View Inventory History..."), this, SLOT(sViewHistory())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction("View Allocations...", this, SLOT(sViewAllocations())); if (item->rawValue("woinvav_allocated").toDouble() == 0.0) menuItem->setEnabled(false); menuItem = pMenu->addAction("View Orders...", this, SLOT(sViewOrders())); if (item->rawValue("woinvav_ordered").toDouble() == 0.0) menuItem->setEnabled(false); menuItem = pMenu->addAction("Running Availability...", this, SLOT(sRunningAvailability())); pMenu->addSeparator(); dspPopulateMenu.prepare( "SELECT itemsite_posupply as result " "FROM itemsite " "WHERE (itemsite_id=:womatl_id);" ); dspPopulateMenu.bindValue(":womatl_id", list()->id()); dspPopulateMenu.exec(); if (dspPopulateMenu.first()) { if (dspPopulateMenu.value("result").toBool()) { menuItem = pMenu->addAction(tr("Create P/R..."), this, SLOT(sCreatePR())); if (!_privileges->check("MaintainPurchaseRequests")) menuItem->setEnabled(false); menuItem = pMenu->addAction("Create P/O...", this, SLOT(sCreatePO())); if (!_privileges->check("MaintainPurchaseOrders")) menuItem->setEnabled(false); pMenu->addSeparator(); } } dspPopulateMenu.prepare( "SELECT itemsite_wosupply as result " "FROM itemsite " "WHERE (itemsite_id=:womatl_id);" ); dspPopulateMenu.bindValue(":womatl_id", list()->id()); dspPopulateMenu.exec(); if (dspPopulateMenu.first()) { if (dspPopulateMenu.value("result").toBool()) { if(list()->altId() != -1) { menuItem = pMenu->addAction("Create W/O...", this, SLOT(sCreateWO())); if (!_privileges->check("MaintainWorkOrders")) menuItem->setEnabled(false); } menuItem = pMenu->addAction(tr("Post Misc. Production..."), this, SLOT(sPostMiscProduction())); if (!_privileges->check("PostMiscProduction")) menuItem->setEnabled(false); pMenu->addSeparator(); } } // } menuItem = pMenu->addAction("View Substitute Availability...", this, SLOT(sViewSubstituteAvailability())); pMenu->addSeparator(); menuItem = pMenu->addAction("Issue Count Tag...", this, SLOT(sIssueCountTag())); if (!_privileges->check("IssueCountTags")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Enter Misc. Inventory Count..."), this, SLOT(sEnterMiscCount())); if (!_privileges->check("EnterMiscCounts")) menuItem->setEnabled(false); } void dspInventoryAvailabilityByWorkOrder::sViewHistory() { ParameterList params; params.append("itemsite_id", list()->id()); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityByWorkOrder::sViewAllocations() { XSqlQuery dspViewAllocations; dspViewAllocations.prepare( "SELECT womatl_duedate " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); dspViewAllocations.bindValue(":womatl_id", list()->altId()); dspViewAllocations.exec(); if (dspViewAllocations.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", dspViewAllocations.value("womatl_duedate")); params.append("run"); dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspInventoryAvailabilityByWorkOrder::sViewOrders() { XSqlQuery dspViewOrders; dspViewOrders.prepare( "SELECT womatl_duedate " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); dspViewOrders.bindValue(":womatl_id", list()->altId()); dspViewOrders.exec(); if (dspViewOrders.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", dspViewOrders.value("womatl_duedate")); params.append("run"); dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspInventoryAvailabilityByWorkOrder::sRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspInventoryAvailabilityByWorkOrder::sViewSubstituteAvailability() { XSqlQuery dspViewSubstituteAvailability; dspViewSubstituteAvailability.prepare( "SELECT womatl_duedate " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); dspViewSubstituteAvailability.bindValue(":womatl_id", list()->altId()); dspViewSubstituteAvailability.exec(); if (dspViewSubstituteAvailability.first()) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", dspViewSubstituteAvailability.value("womatl_duedate")); params.append("run"); dspSubstituteAvailabilityByItem *newdlg = new dspSubstituteAvailabilityByItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } // ToDo } void dspInventoryAvailabilityByWorkOrder::sCreatePR() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseRequest newdlg(this, "", true); newdlg.set(params); newdlg.exec(); int currentId = list()->id(); int currentAltId = list()->altId(); sFillList(); list()->setId(currentId,currentAltId); } void dspInventoryAvailabilityByWorkOrder::sCreatePO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); int currentId = list()->id(); int currentAltId = list()->altId(); sFillList(); list()->setId(currentId,currentAltId); } void dspInventoryAvailabilityByWorkOrder::sCreateWO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); int currentId = list()->id(); int currentAltId = list()->altId(); sFillList(); list()->setId(currentId,currentAltId); } void dspInventoryAvailabilityByWorkOrder::sPostMiscProduction() { ParameterList params; params.append("itemsite_id", list()->id()); postMiscProduction newdlg(this, "", true); newdlg.set(params); newdlg.exec(); int currentId = list()->id(); int currentAltId = list()->altId(); sFillList(); list()->setId(currentId,currentAltId); } void dspInventoryAvailabilityByWorkOrder::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryAvailabilityByWorkOrder::sEnterMiscCount() { ParameterList params; params.append("itemsite_id", list()->id()); enterMiscCount newdlg(this, "", true); newdlg.set(params); newdlg.exec(); int currentId = list()->id(); int currentAltId = list()->altId(); sFillList(); list()->setId(currentId,currentAltId); } void dspInventoryAvailabilityByWorkOrder::sFillList() { display::sFillList(); if(_indentedWo->isChecked()) list()->expandAll(); } qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityByWorkOrder.h000066400000000000000000000031161217451700100265700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVENTORYAVAILABILITYBYWORKORDER_H #define DSPINVENTORYAVAILABILITYBYWORKORDER_H #include "guiclient.h" #include "display.h" #include "ui_dspInventoryAvailabilityByWorkOrder.h" class dspInventoryAvailabilityByWorkOrder : public display, public Ui::dspInventoryAvailabilityByWorkOrder { Q_OBJECT public: dspInventoryAvailabilityByWorkOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * selected, int); virtual void sViewHistory(); virtual void sViewAllocations(); virtual void sViewOrders(); virtual void sRunningAvailability(); virtual void sViewSubstituteAvailability(); virtual void sCreatePR(); virtual void sCreatePO(); virtual void sCreateWO(); virtual void sPostMiscProduction(); virtual void sIssueCountTag(); virtual void sEnterMiscCount(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPINVENTORYAVAILABILITYBYWORKORDER_H qt-client-4.1.0/guiclient/displays/dspInventoryAvailabilityByWorkOrder.ui000066400000000000000000000104471217451700100267630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInventoryAvailabilityByWorkOrder 0 0 655 194 Inventory Availability by Work Order 0 0 290 130 Qt::Vertical 20 0 5 0 0 All Materials true Shortages Insufficient Inventory 5 Parent Work Order Only true Summarized Parent/Child Work Orders Indented Work Orders WoCluster QWidget

    wocluster.h
    qt-client-4.1.0/guiclient/displays/dspInventoryHistory.cpp000066400000000000000000000301371217451700100240230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInventoryHistory.h" #include #include #include #include #include #include "adjustmentTrans.h" #include "countTag.h" #include "expenseTrans.h" #include "materialReceiptTrans.h" #include "scrapTrans.h" #include "transactionInformation.h" #include "transferTrans.h" #include "workOrder.h" #include "parameterwidget.h" dspInventoryHistory::dspInventoryHistory(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { this->setWindowTitle(tr("Inventory History")); setReportName("InventoryHistory"); setMetaSQLOptions("inventoryHistory", "detail"); setUseAltId(true); setParameterWidgetVisible(true); QString qryType; if (_metrics->boolean("MultiWhs")) qryType = QString( "SELECT 1, '%1' UNION " "SELECT 2, '%2' UNION " "SELECT 4, '%3' UNION " "SELECT 8, '%4' UNION " "SELECT 16, '%5' UNION " "SELECT 32, '%6'") .arg(tr("Receipts")) .arg(tr("Issues")) .arg(tr("Shipments")) .arg(tr("Adjustments and Counts")) .arg(tr("Transfers")) .arg(tr("Scraps")); else qryType = QString( "SELECT 1, '%1' UNION " "SELECT 2, '%2' UNION " "SELECT 4, '%3' UNION " "SELECT 8, '%4' UNION " "SELECT 32, '%5'") .arg(tr("Receipts")) .arg(tr("Issues")) .arg(tr("Shipments")) .arg(tr("Adjustments and Counts")) .arg(tr("Scraps")); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->append(tr("Class Code Pattern"), "classcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Item Group"), "itemgrp_id", XComboBox::ItemGroups); parameterWidget()->append(tr("Item Group Pattern"), "itemgrp_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Order Number Pattern"), "orderNumber", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Planner Code"), "plancode_id", XComboBox::PlannerCodes); parameterWidget()->append(tr("Planner Code Pattern"), "plancode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Sales Order"), "cohead_id", ParameterWidget::SalesOrder); parameterWidget()->appendComboBox(tr("Transaction Type"), "transType", qryType); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Transfer Order"), "tohead_id", ParameterWidget::TransferOrder); parameterWidget()->append(tr("Work Order"), "wo_id", ParameterWidget::WorkOrder); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); list()->setRootIsDecorated(true); list()->addColumn(tr("Transaction Time"),_timeDateColumn, Qt::AlignLeft, true, "invhist_transdate"); list()->addColumn(tr("Created Time"), _timeDateColumn, Qt::AlignLeft, false, "invhist_created"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("Item Number"), -1, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Type"), _transColumn, Qt::AlignCenter,true, "invhist_transtype"); list()->addColumn(tr("Order #"), _itemColumn, Qt::AlignCenter,true, "orderlocation"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "invhist_invuom"); list()->addColumn(tr("Qty"), _qtyColumn, Qt::AlignRight, true, "transqty"); list()->addColumn(tr("Value"), _moneyColumn, Qt::AlignRight, true, "transvalue"); list()->addColumn(tr("From Area"), _orderColumn, Qt::AlignLeft, true, "locfrom"); list()->addColumn(tr("QOH Before"), _qtyColumn, Qt::AlignRight, false, "qohbefore"); list()->addColumn(tr("To Area"), _orderColumn, Qt::AlignLeft, true, "locto"); list()->addColumn(tr("QOH After"), _qtyColumn, Qt::AlignRight, false, "qohafter"); list()->addColumn(tr("Cost Method"), _qtyColumn, Qt::AlignLeft, false, "costmethod"); list()->addColumn(tr("Value Before"), _qtyColumn, Qt::AlignRight, false, "invhist_value_before"); list()->addColumn(tr("Value After"), _qtyColumn, Qt::AlignRight, false, "invhist_value_after"); list()->addColumn(tr("User"), _orderColumn, Qt::AlignCenter,false, "invhist_user"); } enum SetResponse dspInventoryHistory::set(const ParameterList &pParams) { XWidget::set(pParams); parameterWidget()->setSavedFilters(); QVariant param; bool valid; param = pParams.value("classcode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code"), param); param = pParams.value("classcode_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code Pattern"), param); param = pParams.value("plancode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code"), param); param = pParams.value("plancode_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code Pattern"), param); param = pParams.value("itemgrp_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item Group"), param); param = pParams.value("itemgrp_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Item Group Pattern"), param); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param); param = pParams.value("warehous_id", &valid); if (valid) { if (param.toInt() > 0) parameterWidget()->setDefault(tr("Site"), param); } param = pParams.value("itemsite_id", &valid); if (valid) { XSqlQuery qry; qry.prepare("SELECT itemsite_item_id, itemsite_warehous_id " "FROM itemsite " "WHERE itemsite_id=:itemsite_id;"); qry.bindValue(":itemsite_id", param.toInt()); qry.exec(); if (qry.first()) { parameterWidget()->setDefault(tr("Item"), qry.value("itemsite_item_id")); parameterWidget()->setDefault(tr("Site"), qry.value("itemsite_warehous_id")); } } param = pParams.value("startDate", &valid); if (valid) parameterWidget()->setDefault(tr("Start Date"), param); param = pParams.value("endDate", &valid); if (valid) parameterWidget()->setDefault(tr("End Date"), param); param = pParams.value("transtype", &valid); if (valid) { QString transtype = param.toString(); if (transtype == "R") parameterWidget()->setDefault(tr("Transaction Type"), 1); else if (transtype == "I") parameterWidget()->setDefault(tr("Transaction Type"), 2); else if (transtype == "S") parameterWidget()->setDefault(tr("Transaction Type"), 4); else if (transtype == "A") parameterWidget()->setDefault(tr("Transaction Type"), 8); else if (transtype == "T") parameterWidget()->setDefault(tr("Transaction Type"), 16); else if (transtype == "SC") parameterWidget()->setDefault(tr("Transaction Type"), 32); } parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) sFillList(); return NoError; } bool dspInventoryHistory::setParams(ParameterList & params) { if (!display::setParams(params)) return false; params.append("average", tr("Average")); params.append("standard", tr("Standard")); params.append("job", tr("Job")); params.append("none", tr("None")); params.append("unknown", tr("Unknown")); return true; } void dspInventoryHistory::sViewTransInfo() { QString transType(((XTreeWidgetItem *)list()->currentItem())->text(list()->column("invhist_transtype"))); ParameterList params; params.append("mode", "view"); params.append("invhist_id", list()->id()); if (transType == "AD") { adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "TW") { transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "SI") { scrapTrans *newdlg = new scrapTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "EX") { expenseTrans *newdlg = new expenseTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "RX") { materialReceiptTrans *newdlg = new materialReceiptTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "CC") { countTag newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } else { transactionInformation newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } void dspInventoryHistory::sEditTransInfo() { ParameterList params; params.append("mode", "edit"); params.append("invhist_id", list()->id()); transactionInformation newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspInventoryHistory::sViewWOInfo() { QString orderNumber = list()->currentItem()->text(list()->column("orderlocation")); int sep1 = orderNumber.indexOf('-'); int sep2 = orderNumber.indexOf('-', (sep1 + 1)); int mainNumber = orderNumber.mid((sep1 + 1), ((sep2 - sep1) - 1)).toInt(); int subNumber = orderNumber.right((orderNumber.length() - sep2) - 1).toInt(); XSqlQuery qq; qq.prepare( "SELECT wo_id " "FROM wo " "WHERE ( (wo_number=:wo_number)" " AND (wo_subnumber=:wo_subnumber) );" ); qq.bindValue(":wo_number", mainNumber); qq.bindValue(":wo_subnumber", subNumber); qq.exec(); if (qq.first()) { ParameterList params; params.append("mode", "view"); params.append("wo_id", qq.value("wo_id")); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspInventoryHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pItem, int) { XSqlQuery dspPopulateMenu; QAction *menuItem; menuItem = pMenu->addAction(tr("View Transaction Information..."), this, SLOT(sViewTransInfo())); menuItem = pMenu->addAction(tr("Edit Transaction Information..."), this, SLOT(sEditTransInfo())); if ( (pItem->text(list()->column("warehous_code")).length()) && ( (pItem->text(list()->column("invhist_transtype")) == "RM") || (pItem->text(list()->column("invhist_transtype")) == "IM") ) ) { QString orderNumber = list()->currentItem()->text(list()->column("orderlocation")); int sep1 = orderNumber.indexOf('-'); int sep2 = orderNumber.indexOf('-', (sep1 + 1)); int mainNumber = orderNumber.mid((sep1 + 1), ((sep2 - sep1) - 1)).toInt(); int subNumber = orderNumber.right((orderNumber.length() - sep2) - 1).toInt(); if ( (mainNumber) && (subNumber) ) { dspPopulateMenu.prepare( "SELECT wo_id " "FROM wo " "WHERE ( (wo_number=:wo_number)" " AND (wo_subnumber=:wo_subnumber) );" ); dspPopulateMenu.bindValue(":wo_number", mainNumber); dspPopulateMenu.bindValue(":wo_subnumber", subNumber); dspPopulateMenu.exec(); if (dspPopulateMenu.first()) { menuItem = pMenu->addAction(tr("View Work Order Information..."), this, SLOT(sViewWOInfo())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders")); } } } } qt-client-4.1.0/guiclient/displays/dspInventoryHistory.h000066400000000000000000000021041217451700100234610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DSPINVENTORYHISTORY_H__ #define __DSPINVENTORYHISTORY_H__ #include "guiclient.h" #include "display.h" #include class dspInventoryHistory : public display { Q_OBJECT public: dspInventoryHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList & params); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sEditTransInfo(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pItem, int); virtual void sViewTransInfo(); virtual void sViewWOInfo(); }; #endif // __DSPINVENTORYHISTORY_H__ qt-client-4.1.0/guiclient/displays/dspInventoryLocator.cpp000066400000000000000000000071741217451700100237720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInventoryLocator.h" #include #include #include #include #include "relocateInventory.h" #include "reassignLotSerial.h" dspInventoryLocator::dspInventoryLocator(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspInventoryLocator", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Location/Lot/Serial # Detail")); setListLabel(tr("Locations")); setReportName("LocationLotSerialNumberDetail"); setMetaSQLOptions("inventoryLocator", "detail"); setUseAltId(true); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("Location"), 200, Qt::AlignLeft, true, "locationname"); list()->addColumn(tr("Netable"), _orderColumn, Qt::AlignCenter,true, "netable"); list()->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "lotserial"); list()->addColumn(tr("Expiration"),_dateColumn, Qt::AlignCenter,true, "expiration"); list()->addColumn(tr("Warranty"), _dateColumn, Qt::AlignCenter,true, "warranty"); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qoh"); } void dspInventoryLocator::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspInventoryLocator::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); param = pParams.value("warehous_id", &valid); if (valid) _warehouse->setId(param.toInt()); param = pParams.value("itemsite_id", &valid); if (valid) _item->setItemsiteid(param.toInt()); return NoError; } bool dspInventoryLocator::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning( this, tr("Enter a Valid Item Number"), tr("You must enter a valid Item Number for this report.") ); return false; } _warehouse->appendValue(params); params.append("item_id", _item->id()); params.append("yes", tr("Yes")); params.append("no", tr("No")); params.append("na", tr("N/A")); //if (_showZeroLevel->isChecked()) // params.append("showZeroLevel"); return true; } void dspInventoryLocator::sRelocateInventory() { ParameterList params; params.append("itemloc_id", list()->id()); relocateInventory newdlg(this, "", true); newdlg.set(params); if (newdlg.exec()) sFillList(); } void dspInventoryLocator::sReassignLotSerial() { ParameterList params; params.append("itemloc_id", list()->id()); reassignLotSerial newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspInventoryLocator::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; if (((XTreeWidgetItem *)pSelected)->altId() == -1) { menuItem = pMenu->addAction(tr("Relocate..."), this, SLOT(sRelocateInventory()));; if (!_privileges->check("RelocateInventory")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Reassign Lot/Serial #..."), this, SLOT(sReassignLotSerial()));; if (!_privileges->check("ReassignLotSerial")) menuItem->setEnabled(false); } } qt-client-4.1.0/guiclient/displays/dspInventoryLocator.h000066400000000000000000000022071217451700100234270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVENTORYLOCATOR_H #define DSPINVENTORYLOCATOR_H #include "guiclient.h" #include "display.h" #include "ui_dspInventoryLocator.h" class dspInventoryLocator : public display, public Ui::dspInventoryLocator { Q_OBJECT public: dspInventoryLocator(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sRelocateInventory(); virtual void sReassignLotSerial(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); protected slots: virtual void languageChange(); }; #endif // DSPINVENTORYLOCATOR_H qt-client-4.1.0/guiclient/displays/dspInventoryLocator.ui000066400000000000000000000051131217451700100236140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInventoryLocator 0 0 609 120 Location/Lot/Serial # Detail false ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    _item _warehouse _item warehouseIdChanged(int) _warehouse setId(int) 20 20 324 27 _item newId(int) _warehouse findItemSites(int) 20 20 324 27
    qt-client-4.1.0/guiclient/displays/dspInvoiceRegister.cpp000066400000000000000000000210631217451700100235430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInvoiceRegister.h" #include #include #include #include #include #include "arOpenItem.h" #include "creditMemo.h" #include "dspInvoiceInformation.h" dspInvoiceRegister::dspInvoiceRegister(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspInvoiceRegister", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Invoice Register")); setListLabel(tr("Transactions")); setReportName("InvoiceRegister"); setMetaSQLOptions("invoiceRegister", "detail"); setUseAltId(true); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter,true, "transdate"); list()->addColumn(tr("Source"), _orderColumn, Qt::AlignCenter,true, "gltrans_source"); list()->addColumn(tr("Doc Type"),_orderColumn, Qt::AlignLeft, true, "doctype"); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter,true, "gltrans_docnumber"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, true, "notes"); list()->addColumn(tr("Account"), _itemColumn, Qt::AlignLeft, true, "account"); list()->addColumn(tr("Debit"), _moneyColumn, Qt::AlignRight, true, "debit"); list()->addColumn(tr("Credit"), _moneyColumn, Qt::AlignRight, true, "credit"); list()->setPopulateLinear(); } void dspInvoiceRegister::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspInvoiceRegister::set(const ParameterList &pParams) { XSqlQuery dspet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("accnt_id", &valid); if (valid) { _selectedAccount->setChecked(true); _account->setId(param.toInt()); } param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); param = pParams.value("period_id", &valid); if (valid) { dspet.prepare( "SELECT period_start, period_end " "FROM period " "WHERE (period_id=:period_id);" ); dspet.bindValue(":period_id", param.toInt()); dspet.exec(); if (dspet.first()) { _dates->setStartDate(dspet.value("period_start").toDate()); _dates->setEndDate(dspet.value("period_end").toDate()); } else if (dspet.lastError().type() != QSqlError::NoError) { systemError(this, dspet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspInvoiceRegister::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if (list()->altId() == 1) { menuItem = pMenu->addAction(tr("View Invoice..."), this, SLOT(sViewInvoice())); if (! _privileges->check("MaintainMiscInvoices") && ! _privileges->check("ViewMiscInvoices")) menuItem->setEnabled(false); } else if (list()->altId() == 2) { menuItem = pMenu->addAction(tr("View Credit Memo..."), this, SLOT(sViewCreditMemo())); if (! _privileges->check("MaintainARMemos") && ! _privileges->check("ViewARMemos")) menuItem->setEnabled(false); } else if (list()->altId() == 3) { menuItem = pMenu->addAction(tr("View Debit Memo..."), this, SLOT(sViewCreditMemo())); if (! _privileges->check("MaintainARMemos") && ! _privileges->check("ViewARMemos")) menuItem->setEnabled(false); } else if (list()->altId() == 4) { menuItem = pMenu->addAction(tr("View Customer Deposit..."), this, SLOT(sViewCreditMemo())); if (! _privileges->check("MaintainARMemos") && ! _privileges->check("ViewARMemos")) menuItem->setEnabled(false); } } void dspInvoiceRegister::sViewCreditMemo() { XSqlQuery dspViewCreditMemo; ParameterList params; params.append("mode", "view"); dspViewCreditMemo.prepare("SELECT 1 AS type, cmhead_id AS id " "FROM cmhead " "WHERE (cmhead_number=:docnum) " "UNION " "SELECT 2 AS type, aropen_id AS id " "FROM aropen " "WHERE ((aropen_docnumber=:docnum)" " AND (aropen_doctype=:doctype)" ") ORDER BY type LIMIT 1;"); dspViewCreditMemo.bindValue(":docnum", list()->currentItem()->text(3)); if(list()->altId()==1) dspViewCreditMemo.bindValue(":doctype", "I"); else if(list()->altId()==2) dspViewCreditMemo.bindValue(":doctype", "C"); else if(list()->altId()==3) dspViewCreditMemo.bindValue(":doctype", "D"); else if(list()->altId()==4) dspViewCreditMemo.bindValue(":doctype", "R"); dspViewCreditMemo.exec(); if (dspViewCreditMemo.first()) { if (dspViewCreditMemo.value("type").toInt() == 1) { params.append("cmhead_id", dspViewCreditMemo.value("id")); creditMemo* newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (dspViewCreditMemo.value("type").toInt() == 2) { params.append("aropen_id", dspViewCreditMemo.value("id")); arOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } else if (dspViewCreditMemo.lastError().type() != QSqlError::NoError) { systemError(this, dspViewCreditMemo.lastError().databaseText(), __FILE__, __LINE__); return; } else { if (list()->altId() == 2) QMessageBox::information(this, tr("Credit Memo Not Found"), tr("

    The Credit Memo #%1 could not be found.") .arg(list()->currentItem()->text(3))); else if (list()->altId() == 3) QMessageBox::information(this, tr("Debit Memo Not Found"), tr("

    The Debit Memo #%1 could not be found.") .arg(list()->currentItem()->text(3))); else QMessageBox::information(this, tr("Document Not Found"), tr("

    The Document #%1 could not be found.") .arg(list()->currentItem()->text(3))); return; } } void dspInvoiceRegister::sViewInvoice() { ParameterList params; params.append("invoiceNumber", list()->currentItem()->text(3)); dspInvoiceInformation* newdlg = new dspInvoiceInformation(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspInvoiceRegister::setParams(ParameterList ¶ms) { if(!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("You must specify a valid date range.") ); return false; } _dates->appendValue(params); if (_selectedAccount->isChecked()) params.append("accnt_id", _account->id()); params.append("invoice", tr("Invoice")); params.append("creditmemo", tr("Credit Memo")); params.append("debitmemo", tr("Debit Memo")); params.append("cashdeposit", tr("Customer Deposit")); return true; } void dspInvoiceRegister::sFillList() { display::sFillList(); list()->expandAll(); // calculate subtotals and grand total for debit and credit columns and add rows for them double debittotal = 0.0; double credittotal = 0.0; for (int i = 0; i < list()->topLevelItemCount(); i++) { double debitsum = 0.0; double creditsum = 0.0; XTreeWidgetItem *item = 0; for (int j = 0; j < list()->topLevelItem(i)->childCount(); j++) { item = list()->topLevelItem(i)->child(j); // qDebug("in loop @ %d %p", j, item); if (item) { debitsum += item->rawValue("debit").toDouble(); creditsum += item->rawValue("credit").toDouble(); debittotal += item->rawValue("debit").toDouble(); credittotal += item->rawValue("credit").toDouble(); } } if (item) { // qDebug("adding subtotal %p", item); item = new XTreeWidgetItem(list()->topLevelItem(i), -1, -1, tr("Subtotal")); item->setData(list()->column("debit"), Qt::EditRole, formatMoney(debitsum)); item->setData(list()->column("credit"), Qt::EditRole, formatMoney(creditsum)); } } XTreeWidgetItem *item = new XTreeWidgetItem(list(), -1, -1, tr("Total")); item->setData(list()->column("debit"), Qt::EditRole, formatMoney(debittotal)); item->setData(list()->column("credit"), Qt::EditRole, formatMoney(credittotal)); } qt-client-4.1.0/guiclient/displays/dspInvoiceRegister.h000066400000000000000000000022121217451700100232030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVOICEREGISTER_H #define DSPINVOICEREGISTER_H #include "guiclient.h" #include "display.h" #include "ui_dspInvoiceRegister.h" class dspInvoiceRegister : public display, public Ui::dspInvoiceRegister { Q_OBJECT public: dspInvoiceRegister(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem*, int); virtual void sViewCreditMemo(); virtual void sViewInvoice(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPINVOICEREGISTER_H qt-client-4.1.0/guiclient/displays/dspInvoiceRegister.ui000066400000000000000000000105611217451700100233770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInvoiceRegister 0 0 590 84 Invoice Register 0 0 5 All Accounts true 5 Selected Account: false Qt::Vertical QSizePolicy::Expanding 20 0 0 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 13 20 DateCluster QWidget

    datecluster.h
    GLCluster QWidget
    glcluster.h
    _allAccounts _selectedAccount _account _dates _selectedAccount toggled(bool) _account setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/displays/dspItemCostDetail.cpp000066400000000000000000000113301217451700100233100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspItemCostDetail.h" #include #include #include dspItemCostDetail::dspItemCostDetail(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspItemCostDetail", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Detailed Item Costs")); setListLabel(tr("Costing Detail")); setReportName("ItemCostDetail"); setMetaSQLOptions("itemcostdetail", "detail"); setUseAltId(true); QButtonGroup* _costTypeGroupInt = new QButtonGroup(this); _costTypeGroupInt->addButton(_standardCosts); _costTypeGroupInt->addButton(_actualCosts); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulate())); list()->addColumn(tr("#"), _seqColumn, Qt::AlignCenter,true, "seqnumber"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "qtyper"); list()->addColumn(tr("Scrap/Absorb. %"), _itemColumn, Qt::AlignRight, true, "scrap" ); list()->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "cost"); list()->addColumn(tr("Ext'd Cost"), _moneyColumn, Qt::AlignRight, true, "extendedcost"); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), SLOT(sFillList())); } void dspItemCostDetail::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspItemCostDetail::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(true); } param = pParams.value("costtype", &valid); if (valid) { for (int cursor = 0; cursor < _costType->count(); cursor++) { if (_costType->itemText(cursor) == param.toString()) { _costType->setCurrentIndex(cursor); break; } } } param = pParams.value("itemcost_id", &valid); if (valid) { XSqlQuery qq; qq.prepare( "SELECT itemcost_item_id, itemcost_costelem_id " "FROM itemcost " "WHERE (itemcost_id=:itemcost_id)" ); qq.bindValue(":itemcost_id", param.toInt()); qq.exec(); if (qq.first()) { _item->setId(qq.value("itemcost_item_id").toInt()); _item->setReadOnly(true); _costType->setId(qq.value("itemcost_costelem_id").toInt()); _costType->setEnabled(false); } else if (qq.lastError().type() != QSqlError::NoError) { systemError(this, qq.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspItemCostDetail::sPopulate() { XSqlQuery qq; qq.prepare( "SELECT costelem_id, costelem_type, costelem_type " "FROM costelem, itemcost " "WHERE ( (itemcost_costelem_id=costelem_id)" " AND (itemcost_lowlevel)" " AND (itemcost_item_id=:item_id) );" ); qq.bindValue(":item_id", _item->id()); qq.exec(); _costType->populate(qq); if (qq.lastError().type() != QSqlError::NoError) { systemError(this, qq.lastError().databaseText(), __FILE__, __LINE__); return; } } bool dspItemCostDetail::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning( this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } params.append("item_id", _item->id()); params.append("costelem_id", _costType->id()); if (_standardCosts->isChecked()) params.append("standardCost"); else params.append("actualCost"); if ( (_item->itemType() == "M") || (_item->itemType() == "F") || (_item->itemType() == "B") || (_item->itemType() == "T") || (_item->itemType() == "Y") || (_item->itemType() == "R") || (_item->itemType() == "O") || (_item->itemType() == "P") ) params.append("useBOM"); else if (_item->itemType() == "C") params.append("useBBOM"); if (_metrics->value("Application") != "PostBooks") params.append("includeRevisionControl"); return true; } qt-client-4.1.0/guiclient/displays/dspItemCostDetail.h000066400000000000000000000020021217451700100227510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPITEMCOSTDETAIL_H #define DSPITEMCOSTDETAIL_H #include "guiclient.h" #include "display.h" #include "ui_dspItemCostDetail.h" class dspItemCostDetail : public display, public Ui::dspItemCostDetail { Q_OBJECT public: dspItemCostDetail(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); Q_INVOKABLE virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sPopulate(); protected slots: virtual void languageChange(); }; #endif // DSPITEMCOSTDETAIL_H qt-client-4.1.0/guiclient/displays/dspItemCostDetail.ui000066400000000000000000000120301217451700100231410ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspItemCostDetail 0 0 481 124 Detailed Item Costs Qt::Vertical QSizePolicy::Expanding 20 0 Cost Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 Qt::AlignRight Show Standard Costs true Show Actual Costs Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 ItemCluster QWidget
    itemcluster.h
    1
    XComboBox QComboBox
    xcombobox.h
    _item _costType _standardCosts
    qt-client-4.1.0/guiclient/displays/dspItemCostHistory.cpp000066400000000000000000000044301217451700100235520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspItemCostHistory.h" #include dspItemCostHistory::dspItemCostHistory(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspItemCostHistory", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Item Costs History")); setListLabel(tr("Costing History")); setReportName("ItemCostHistory"); setMetaSQLOptions("itemCost", "detail"); setUseAltId(true); list()->addColumn(tr("Element"), -1, Qt::AlignLeft, true, "costelem_type"); list()->addColumn(tr("Lower"), _costColumn, Qt::AlignCenter,true, "lowlevel"); list()->addColumn(tr("Type"), _costColumn, Qt::AlignLeft, true, "type"); list()->addColumn(tr("Time"), _timeDateColumn, Qt::AlignCenter,true, "costhist_date"); list()->addColumn(tr("User"), _qtyColumn, Qt::AlignCenter,true, "username"); list()->addColumn(tr("Old"), _costColumn, Qt::AlignRight, true, "costhist_oldcost"); list()->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "oldcurr"); list()->addColumn(tr("New"), _costColumn, Qt::AlignRight, true, "costhist_newcost"); list()->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "newcurr"); if (omfgThis->singleCurrency()) { list()->hideColumn("oldcurr"); list()->hideColumn("newcurr"); } } void dspItemCostHistory::languageChange() { display::languageChange(); retranslateUi(this); } bool dspItemCostHistory::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning( this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } params.append("byHistory"); params.append("actual", tr("Actual")); params.append("standard", tr("Standard")); params.append("delete", tr("Delete")); params.append("new", tr("New")); params.append("item_id", _item->id()); return true; } qt-client-4.1.0/guiclient/displays/dspItemCostHistory.h000066400000000000000000000015701217451700100232210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPITEMCOSTHISTORY_H #define DSPITEMCOSTHISTORY_H #include "display.h" #include "ui_dspItemCostHistory.h" class dspItemCostHistory : public display, public Ui::dspItemCostHistory { Q_OBJECT public: dspItemCostHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPITEMCOSTHISTORY_H qt-client-4.1.0/guiclient/displays/dspItemCostHistory.ui000066400000000000000000000037721217451700100234150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspItemCostHistory 0 0 319 94 Item Costs History Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 34 ItemCluster QWidget
    itemcluster.h
    _item
    qt-client-4.1.0/guiclient/displays/dspItemCostSummary.cpp000066400000000000000000000055251217451700100235540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspItemCostSummary.h" #include #include #include #include #include #include #include "mqlutil.h" #include "dspItemCostDetail.h" #include "itemCost.h" dspItemCostSummary::dspItemCostSummary(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspItemCostSummary", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Item Costs Summary")); setListLabel(tr("Costing &Elements")); setReportName("ItemCostSummary"); setMetaSQLOptions("itemCost", "detail"); setUseAltId(true); list()->addColumn(tr("Element"), -1, Qt::AlignLeft, true, "costelem_type" ); list()->addColumn(tr("Lower"), _costColumn, Qt::AlignCenter, true, "lowlevel" ); list()->addColumn(tr("Std. Cost"), _costColumn, Qt::AlignRight, true, "itemcost_stdcost" ); list()->addColumn(tr("Posted"), _dateColumn, Qt::AlignCenter, true, "itemcost_posted" ); list()->addColumn(tr("Act. Cost"), _costColumn, Qt::AlignRight, true, "itemcost_actcost" ); list()->addColumn(tr("Updated"), _dateColumn, Qt::AlignCenter, true, "itemcost_updated" ); } void dspItemCostSummary::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspItemCostSummary::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(true); } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspItemCostSummary::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { if (pSelected->text(1) == "Yes") { pMenu->addAction(tr("View Costing Detail..."), this, SLOT(sViewDetail())); pMenu->addSeparator(); } } void dspItemCostSummary::sViewDetail() { ParameterList params; params.append("itemcost_id", list()->id()); params.append("run"); dspItemCostDetail *newdlg = new dspItemCostDetail(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspItemCostSummary::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } params.append("bySummrey"); params.append("item_id", _item->id()); params.append("never", tr("Never")); return true; } qt-client-4.1.0/guiclient/displays/dspItemCostSummary.h000066400000000000000000000021221217451700100232070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPITEMCOSTSUMMARY_H #define DSPITEMCOSTSUMMARY_H #include "guiclient.h" #include "display.h" #include "ui_dspItemCostSummary.h" class dspItemCostSummary : public display, public Ui::dspItemCostSummary { Q_OBJECT public: dspItemCostSummary(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sViewDetail(); protected slots: virtual void languageChange(); }; #endif // DSPITEMCOSTSUMMARY_H qt-client-4.1.0/guiclient/displays/dspItemCostSummary.ui000066400000000000000000000041051217451700100234000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspItemCostSummary 0 0 313 94 Item Costs Summary Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 12 ItemCluster QWidget
    itemcluster.h
    _item parameter.h
    qt-client-4.1.0/guiclient/displays/dspItemCostsByClassCode.cpp000066400000000000000000000110421217451700100244240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspItemCostsByClassCode.h" #include #include #include #include #include #include #include "dspItemCostSummary.h" #include "maintainItemCosts.h" #include "updateActualCostsByItem.h" #include "postCostsByItem.h" dspItemCostsByClassCode::dspItemCostsByClassCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspItemCostsByClassCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Item Costs by Class Code")); setListLabel(tr("Items")); setReportName("ItemCostsByClassCode"); setMetaSQLOptions("itemCost", "detail"); _classCode->setType(ParameterGroup::ClassCode); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Active"), _ynColumn, Qt::AlignCenter ,true, "item_active" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Std. Cost"), _costColumn, Qt::AlignRight, true, "scost" ); list()->addColumn(tr("Act. Cost"), _costColumn, Qt::AlignRight, true, "acost" ); list()->addColumn(tr("% Var."), _costColumn, Qt::AlignRight, false, "percent_variance" ); } void dspItemCostsByClassCode::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspItemCostsByClassCode::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("classcode_id", &valid); if (valid) _classCode->setId(param.toInt()); param = pParams.value("classcode_pattern", &valid); if (valid) _classCode->setPattern(param.toString()); if (pParams.inList("run")) sFillList(); return NoError; } bool dspItemCostsByClassCode::setParams(ParameterList ¶ms) { params.append("byClassCode"); _classCode->appendValue(params); if(_onlyShowZero->isChecked()) params.append("onlyShowZeroCosts"); if(_onlyShowDiff->isChecked()) params.append("onlyShowDiffCosts"); if(!_showInactive->isChecked()) params.append("onlyShowActive"); XSqlQuery qq; qq.exec("SELECT locale_cost_scale " "FROM locale, usr " "WHERE ((usr_locale_id=locale_id) AND (usr_username=getEffectiveXtUser()));"); if (qq.first()) params.append("costscale", qq.value("locale_cost_scale").toInt()); else params.append("costscale", decimalPlaces("cost")); return true; } void dspItemCostsByClassCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; pMenu->addAction(tr("Maintain Item Costs..."), this, SLOT(sMaintainItemCosts())); pMenu->addAction(tr("View Item Costing Summary..."), this, SLOT(sViewItemCostingSummary())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Update Actual Costs..."), this, SLOT(sUpdateCosts()));; menuItem->setEnabled(_privileges->check("UpdateActualCosts")); menuItem = pMenu->addAction(tr("Post Actual Costs..."), this, SLOT(sPostCosts()));; menuItem->setEnabled(_privileges->check("PostActualCosts")); } void dspItemCostsByClassCode::sMaintainItemCosts() { ParameterList params; params.append("item_id", list()->id()); params.append("run"); maintainItemCosts *newdlg = new maintainItemCosts(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspItemCostsByClassCode::sViewItemCostingSummary() { ParameterList params; params.append("item_id", list()->id()); params.append("run"); dspItemCostSummary *newdlg = new dspItemCostSummary(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspItemCostsByClassCode::sUpdateCosts() { ParameterList params; params.append("item_id", list()->id()); updateActualCostsByItem newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspItemCostsByClassCode::sPostCosts() { ParameterList params; params.append("item_id", list()->id()); postCostsByItem newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } qt-client-4.1.0/guiclient/displays/dspItemCostsByClassCode.h000066400000000000000000000023501217451700100240730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPITEMCOSTSBYCLASSCODE_H #define DSPITEMCOSTSBYCLASSCODE_H #include "guiclient.h" #include "display.h" #include "ui_dspItemCostsByClassCode.h" class dspItemCostsByClassCode : public display, public Ui::dspItemCostsByClassCode { Q_OBJECT public: dspItemCostsByClassCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); Q_INVOKABLE bool setParams(ParameterList ¶ms); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sMaintainItemCosts(); virtual void sViewItemCostingSummary(); virtual void sUpdateCosts(); virtual void sPostCosts(); protected slots: virtual void languageChange(); }; #endif // DSPITEMCOSTSBYCLASSCODE_H qt-client-4.1.0/guiclient/displays/dspItemCostsByClassCode.ui000066400000000000000000000055071217451700100242700ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspItemCostsByClassCode 0 0 403 219 Item Costs by Class Code false Qt::Horizontal 0 20 Only Show &Zero Cost Items Only Show Items where Actual and Standard are different Show Inactive Items Qt::Vertical 20 7 ParameterGroup QGroupBox
    parametergroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _classCode _onlyShowZero
    qt-client-4.1.0/guiclient/displays/dspItemSources.cpp000066400000000000000000000260721217451700100227110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspItemSources.h" #include #include #include #include #include #include "itemSource.h" #include "buyCard.h" #include "dspPoItemsByVendor.h" #include "dspPoItemReceivingsByItem.h" #include "guiclient.h" #include "parameterwidget.h" dspItemSources::dspItemSources(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspItemSources", fl) { setWindowTitle(tr("Item Sources")); setReportName("ItemSources"); setMetaSQLOptions("itemSources", "prices"); setUseAltId(true); setParameterWidgetVisible(true); // setNewVisible(true); // setQueryOnStartEnabled(true); if (_metrics->boolean("MultiWhs")) { parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->append(tr("Drop Ship Only"), "showDropShip", ParameterWidget::Exists); } parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->append(tr("Item Number Pattern"), "item_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item Description"), "item_descrip_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Vendor"), "vend_id", ParameterWidget::Vendor); parameterWidget()->append(tr("Vendor Name"), "vend_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Vendor Item Number Pattern"), "vend_item_number_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Contract"), "contrct_id", XComboBox::Contracts); parameterWidget()->append(tr("Contract Number Pattern"), "contract_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Manufacturer Pattern"), "manuf_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Manufacturer Item Number Pattern"), "manuf_item_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Effective Start"), "effectiveStartDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Effective End"), "effectiveEndDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Expires Start"), "expireStartDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Expires End"), "expireEndDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); if (_metrics->boolean("MultiWhs")) { list()->addColumn(tr("Site"), _qtyColumn, Qt::AlignCenter, true, "warehous_code"); list()->addColumn(tr("Order Type"), -1, Qt::AlignCenter, true, "itemsrcp_dropship"); } list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, false, "item_descrip" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, false, "uom_name" ); list()->addColumn(tr("Vendor #"), _itemColumn, Qt::AlignLeft, true, "vend_number" ); list()->addColumn(tr("Vendor Name"), -1, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Contract #"), _itemColumn, Qt::AlignLeft, true, "contrct_number" ); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter, false, "itemsrc_effective" ); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter, false, "itemsrc_expires" ); list()->addColumn(tr("Vendor Currency"), _itemColumn, Qt::AlignCenter, false, "vend_curr" ); list()->addColumn(tr("Vendor Item Number"), _itemColumn, Qt::AlignLeft, true, "itemsrc_vend_item_number" ); list()->addColumn(tr("Manufacturer"), _itemColumn, Qt::AlignLeft, false, "itemsrc_manuf_name" ); list()->addColumn(tr("Manuf. Item#"), _itemColumn, Qt::AlignLeft, false, "itemsrc_manuf_item_number" ); list()->addColumn(tr("Default"), _uomColumn, Qt::AlignCenter, true, "itemsrc_default" ); list()->addColumn(tr("Vendor UOM"), _uomColumn, Qt::AlignCenter, false, "itemsrc_vend_uom" ); list()->addColumn(tr("UOM Ratio"), _qtyColumn, Qt::AlignRight, false, "itemsrc_invvendoruomratio" ); list()->addColumn(tr("Min. Order"), _qtyColumn, Qt::AlignRight, false, "itemsrc_minordqty" ); list()->addColumn(tr("Order Mult."), _qtyColumn, Qt::AlignRight, false, "itemsrc_multordqty" ); list()->addColumn(tr("Vendor Ranking"), _qtyColumn, Qt::AlignRight, false, "itemsrc_ranking" ); list()->addColumn(tr("Lead Time"), _qtyColumn, Qt::AlignRight, false, "itemsrc_leadtime" ); list()->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "itemsrcp_qtybreak" ); list()->addColumn(tr("Base Unit Price"), _moneyColumn,Qt::AlignRight, true, "price_base" ); list()->addColumn(tr("Item Currency"), _itemColumn, Qt::AlignRight, false, "item_curr" ); list()->addColumn(tr("Unit Price"), _moneyColumn,Qt::AlignRight, false, "price_local" ); if (_privileges->check("MaintainItemSources")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } } void dspItemSources::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = menuThis->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuItem = menuThis->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainItemSources") || _privileges->check("ViewItemSource")); menuItem = menuThis->addAction(tr("Set as Default..."), this, SLOT(sDefault())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); // menuItem = menuThis->addAction(tr("Copy..."), this, SLOT(sCopy())); // menuItem->setEnabled(_privileges->check("MaintainItemSources")); // menuItem = menuThis->addAction(tr("Delete..."), this, SLOT(sDelete())); // menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuThis->addSeparator(); // menuThis->addAction("View Buy Card...", this, SLOT(sBuyCard())); // menuThis->addAction("View Receipts and Returns...", this, SLOT(sReceipts())); } void dspItemSources::sNew() { ParameterList params; params.append("mode", "new"); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspItemSources::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("itemsrc_id", list()->altId()); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspItemSources::sView() { ParameterList params; params.append("mode", "view"); params.append("itemsrc_id", list()->altId()); itemSource newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void dspItemSources::sDefault() { XSqlQuery itemSave; itemSave.prepare( "UPDATE itemsrc " "SET itemsrc_default=TRUE " "WHERE (itemsrc_id=:itemsrc_id);" ); itemSave.bindValue(":itemsrc_id", list()->altId()); itemSave.exec(); if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspItemSources::sCopy() { ParameterList params; params.append("mode", "copy"); params.append("itemsrc_id", list()->altId()); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspItemSources::sDelete() { XSqlQuery itemDelete; itemDelete.prepare("SELECT poitem_id, itemsrc_active " "FROM poitem, itemsrc " "WHERE ((poitem_itemsrc_id=:itemsrc_id) " "AND (itemsrc_id=:itemsrc_id)); "); itemDelete.bindValue(":itemsrc_id", list()->altId()); itemDelete.exec(); if (itemDelete.first()) { if (itemDelete.value("itemsrc_active").toBool()) { if (QMessageBox::question(this, tr("Delete Item Source"), tr("

    This item source is used by existing " "purchase order records and may not be " "deleted. Would you like to deactivate it " "instead?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { itemDelete.prepare( "UPDATE itemsrc SET " " itemsrc_active=false " "WHERE (itemsrc_id=:itemsrc_id);" ); itemDelete.bindValue(":itemsrc_id", list()->altId()); itemDelete.exec(); } } else QMessageBox::critical(this, tr("Delete Item Source"), tr("

    This item source is used by existing " "purchase order records and may not be deleted.")); return; } itemDelete.prepare( "SELECT item_number " "FROM itemsrc, item " "WHERE ( (itemsrc_item_id=item_id)" " AND (itemsrc_id=:itemsrc_id) );" ); itemDelete.bindValue(":itemsrc_id", list()->altId()); itemDelete.exec(); if (itemDelete.first()) { if (QMessageBox::question(this, tr("Delete Item Source"), tr( "Are you sure that you want to delete the " "Item Source for %1?") .arg(itemDelete.value("item_number").toString()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { itemDelete.prepare( "DELETE FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" "DELETE FROM itemsrcp " "WHERE (itemsrcp_itemsrc_id=:itemsrc_id);" ); itemDelete.bindValue(":itemsrc_id", list()->altId()); itemDelete.exec(); } } } void dspItemSources::sBuyCard() { ParameterList params; params.append("itemsrc_id", list()->altId()); buyCard *newdlg = new buyCard(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspItemSources::sReceipts() { ParameterList params; params.append("itemsrc_id", list()->id()); dspPoItemReceivingsByItem *newdlg = new dspPoItemReceivingsByItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspItemSources::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; params.append("always", tr("'Always'")); params.append("never", tr("'Never'")); params.append("all", tr("All")); params.append("stock", tr("Into Stock")); params.append("dropship", tr("Drop Ship")); return true; } qt-client-4.1.0/guiclient/displays/dspItemSources.h000066400000000000000000000020361217451700100223500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPITEMSOURCES_H #define DSPITEMSOURCES_H #include "display.h" class dspItemSources : public display { Q_OBJECT public: dspItemSources(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sCopy(); virtual void sDefault(); virtual void sDelete(); virtual void sBuyCard(); virtual void sReceipts(); }; #endif // DSPITEMSOURCES_H qt-client-4.1.0/guiclient/displays/dspItemsWithoutItemSources.cpp000066400000000000000000000042711217451700100252740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspItemsWithoutItemSources.h" #include #include #include #include "guiclient.h" #include "item.h" #include "itemSource.h" dspItemsWithoutItemSources::dspItemsWithoutItemSources(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspItemsWithoutItemSources", fl) { setWindowTitle(tr("Items without Item Sources")); setListLabel(tr("Items without Item Sources")); setMetaSQLOptions("itemsWithoutItemSources", "detail"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("Type"), _itemColumn, Qt::AlignCenter,true, "type"); connect(omfgThis, SIGNAL(itemsUpdated(int, bool)), this, SLOT(sFillList())); } void dspItemsWithoutItemSources::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Create Item Source..."), this, SLOT(sCreateItemSource()));; if (!_privileges->check("MaintainItemSources")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem()));; if (!_privileges->check("MaintainItemMasters")) menuItem->setEnabled(false); } void dspItemsWithoutItemSources::sCreateItemSource() { ParameterList params; params.append("mode", "new"); params.append("item_id", list()->id()); itemSource newdlg(this, "", true); newdlg.set(params); if (newdlg.exec()) sFillList(); } void dspItemsWithoutItemSources::sEditItem() { item::editItem(list()->id()); } bool dspItemsWithoutItemSources::setParams(ParameterList ¶ms) { params.append("purchased", tr("Purchased")); params.append("outside", tr("Outside")); return true; } qt-client-4.1.0/guiclient/displays/dspItemsWithoutItemSources.h000066400000000000000000000017021217451700100247350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPITEMSWITHOUTITEMSOURCES_H #define DSPITEMSWITHOUTITEMSOURCES_H #include "display.h" class dspItemsWithoutItemSources : public display { Q_OBJECT public: dspItemsWithoutItemSources(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sCreateItemSource(); virtual void sEditItem(); }; #endif // DSPITEMSWITHOUTITEMSOURCES_H qt-client-4.1.0/guiclient/displays/dspJobCosting.cpp000066400000000000000000000044041217451700100225030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspJobCosting.h" #include #include dspJobCosting::dspJobCosting(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspJobCosting", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Work Order Costing")); setListLabel(tr("Posted Costs")); setReportName("JobCosting"); setMetaSQLOptions("manufacture", "jobcosting"); setUseAltId(true); list()->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "type"); list()->addColumn(tr("Work Center/Item"),_itemColumn, Qt::AlignLeft, true, "code"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qty"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom"); list()->addColumn(tr("Cost"),_moneyColumn, Qt::AlignRight, true, "cost"); } void dspJobCosting::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspJobCosting::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) _wo->setId(param.toInt()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspJobCosting::setParams(ParameterList ¶ms) { if (! _wo->isValid()) { QMessageBox::warning(this, tr("Select Options"), tr("

    You must select a Work Order.")); _wo->setFocus(); return false; } params.append("wo_id", _wo->id()); params.append("showsu", true); params.append("showrt", true); params.append("showmatl", true); params.append("setup", tr("Setup")); params.append("runtime", tr("Run Time")); params.append("material", tr("Material")); params.append("timeuom", tr("Hours")); return true; } qt-client-4.1.0/guiclient/displays/dspJobCosting.h000066400000000000000000000016751217451700100221570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPJOBCOSTING_H #define DSPJOBCOSTING_H #include "guiclient.h" #include "display.h" #include "ui_dspJobCosting.h" class dspJobCosting : public display, public Ui::dspJobCosting { Q_OBJECT public: dspJobCosting(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set(const ParameterList & pParams ); protected slots: virtual void languageChange(); }; #endif // DSPJOBCOSTING_H qt-client-4.1.0/guiclient/displays/dspJobCosting.ui000066400000000000000000000041231217451700100223340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspJobCosting 0 0 292 112 Work Order Costing 0 Qt::StrongFocus Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 20 20 WoCluster QWidget

    wocluster.h
    qt-client-4.1.0/guiclient/displays/dspJournals.cpp000066400000000000000000000406631217451700100222460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspJournals.h" #include #include #include #include "glTransactionDetail.h" #include "dspGLSeries.h" #include "invoice.h" #include "purchaseOrder.h" #include "voucher.h" #include "miscVoucher.h" #include "dspShipmentsByShipment.h" #include "apOpenItem.h" #include "arOpenItem.h" #include "salesOrder.h" #include "dspWoHistoryByNumber.h" #include "transactionInformation.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" #include "creditMemo.h" dspJournals::dspJournals(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspJournals", fl) { setWindowTitle(tr("Journals")); setListLabel(tr("Journal Entries")); setReportName("Journals"); setMetaSQLOptions("journals", "detail"); setParameterWidgetVisible(true); QString qryType = QString( "SELECT 1, '%1' UNION " "SELECT 2, '%2' UNION " "SELECT 3, '%3' UNION " "SELECT 4, '%4' UNION " "SELECT 5, '%5'") .arg(tr("Asset")) .arg(tr("Expense")) .arg(tr("Liability")) .arg(tr("Equity")) .arg(tr("Revenue")); QString qrySubType = QString("SELECT subaccnttype_id, " " (subaccnttype_code || '-' || subaccnttype_descrip) " "FROM subaccnttype " "ORDER BY subaccnttype_code;"); QString qrySource = QString("SELECT 1 AS id, 'A/P' AS source UNION " "SELECT 2 AS id, 'A/R' AS source UNION " "SELECT 3 AS id, 'G/L' AS source UNION " "SELECT 4 AS id, 'I/M' AS source UNION " "SELECT 5 AS id, 'P/D' AS source UNION " "SELECT 6 AS id, 'P/O' AS source UNION " "SELECT 7 AS id, 'S/O' AS source UNION " "SELECT 8 AS id, 'S/R' AS source UNION " "SELECT 9 AS id, 'W/O' AS source;"); QString qryAccNum = QString("SELECT min(accnt_id) as num_id," " accnt_number AS num_number " "FROM accnt " "GROUP BY accnt_number " "ORDER BY accnt_number;"); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "sltrans_date"); list()->addColumn(tr("Source"), _orderColumn, Qt::AlignCenter, true, "sltrans_source"); list()->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter, true, "sltrans_doctype"); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "docnumber"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, true, "notes"); list()->addColumn(tr("Journal#"), _orderColumn, Qt::AlignLeft, false,"sltrans_journalnumber"); list()->addColumn(tr("Account"), -1, Qt::AlignLeft, true, "account"); list()->addColumn(tr("Debit"), _moneyColumn, Qt::AlignRight, true, "debit"); list()->addColumn(tr("Credit"), _moneyColumn, Qt::AlignRight, true, "credit"); list()->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter, true, "sltrans_posted"); list()->addColumn(tr("GL Journal #"),_orderColumn, Qt::AlignLeft, false, "sltrans_gltrans_journalnumber"); list()->addColumn(tr("Username"), _userColumn, Qt::AlignLeft, false, "sltrans_username"); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->append(tr("GL Account"), "accnt_id", ParameterWidget::GLAccount); parameterWidget()->append(tr("Document #"), "docnum", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Source"), "source_id", qrySource); parameterWidget()->append(tr("Source Pattern"), "source_pattern", ParameterWidget::Text); if (_metrics->value("GLCompanySize").toInt() > 0) parameterWidget()->appendComboBox(tr("Company"), "company_id", XComboBox::Companies); if (_metrics->value("GLProfitSize").toInt() > 0) parameterWidget()->appendComboBox(tr("Profit Center"), "prfcntr_id", XComboBox::ProfitCenters); parameterWidget()->appendComboBox(tr("Main Segment"), "num_id", qryAccNum); if (_metrics->value("GLSubaccountSize").toInt() > 0) parameterWidget()->appendComboBox(tr("Sub Account"), "subaccnt_id", XComboBox::Subaccounts); parameterWidget()->appendComboBox(tr("Account Type"), "accnttype_id", qryType); parameterWidget()->appendComboBox(tr("Sub Type"), "subType", qrySubType); parameterWidget()->append(tr("Posted"), "posted", ParameterWidget::CheckBox); parameterWidget()->append(tr("GL Journal"), "journalnumber", ParameterWidget::Text); parameterWidget()->applyDefaultFilterSet(); _sources << "None" << "A/P" << "A/R" << "G/L" << "I/M" << "P/D" << "P/O" << "S/O" << "S/R" << "W/O"; } enum SetResponse dspJournals::set(const ParameterList &pParams) { XSqlQuery dspet; XWidget::set(pParams); parameterWidget()->setSavedFilters(); QVariant param; bool valid; param = pParams.value("accnt_id", &valid); if (valid) parameterWidget()->setDefault(tr("GL Account"), param); param = pParams.value("startDate", &valid); if (valid) parameterWidget()->setDefault(tr("Start Date"), param); param = pParams.value("endDate", &valid); if (valid) parameterWidget()->setDefault(tr("End Date"), param); param = pParams.value("posted", &valid); if (valid) parameterWidget()->setDefault(tr("Posted"), param); param = pParams.value("journalnumber", &valid); if (valid) parameterWidget()->setDefault(tr("GL Journal"), param); param = pParams.value("source", &valid); if (valid) parameterWidget()->setDefault(tr("Source Pattern"), param.toString()); param = pParams.value("period_id", &valid); if (valid) { dspet.prepare( "SELECT period_start, period_end " "FROM period " "WHERE (period_id=:period_id);" ); dspet.bindValue(":period_id", param.toInt()); dspet.exec(); if (dspet.first()) { parameterWidget()->setDefault(tr("Start Date"), dspet.value("period_start").toDate()); parameterWidget()->setDefault(tr("End Date"), dspet.value("period_end").toDate()); } } parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspJournals::sPopulateMenu(QMenu * menuThis, QTreeWidgetItem* pItem, int) { XTreeWidgetItem * item = (XTreeWidgetItem*)pItem; if(0 == item) return; menuThis->addAction(tr("View..."), this, SLOT(sViewTrans())); QAction* viewSeriesAct = menuThis->addAction(tr("View Journal Series..."), this, SLOT(sViewSeries())); viewSeriesAct->setDisabled(item->data(0, Xt::DeletedRole).toBool()); if(item->rawValue("sltrans_doctype").toString() == "VO") menuThis->addAction(tr("View Voucher..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_doctype").toString() == "IN") menuThis->addAction(tr("View Invoice..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_doctype").toString() == "PO") menuThis->addAction(tr("View Purchase Order..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_doctype").toString() == "SH") menuThis->addAction(tr("View Shipment..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_doctype").toString() == "CM") menuThis->addAction(tr("View Credit Memo..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_doctype").toString() == "DM") menuThis->addAction(tr("View Debit Memo..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_doctype").toString() == "SO") menuThis->addAction(tr("View Sales Order..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_doctype").toString() == "WO") menuThis->addAction(tr("View WO History..."), this, SLOT(sViewDocument())); else if(item->rawValue("sltrans_source").toString() == "I/M") menuThis->addAction(tr("View Inventory History..."), this, SLOT(sViewDocument())); } bool dspJournals::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; bool valid; QVariant param; param = params.value("accnttype_id", &valid); if (valid) { int typid = param.toInt(); QString type; if (typid == 1) type = "A"; else if (typid ==2) type = "E"; else if (typid ==3) type = "L"; else if (typid ==4) type = "Q"; else if (typid ==5) type = "R"; params.append("accntType", type); } param = params.value("source_id", &valid); if (valid) params.append("source", _sources.at(param.toInt())); param = params.value("num_id", &valid); if (valid) { XSqlQuery num; num.prepare("SELECT accnt_number " "FROM accnt " "WHERE (accnt_id=:accnt_id);"); num.bindValue(":accnt_id", params.value("num_id").toInt()); num.exec(); if (num.first()) params.append("accnt_number", num.value("accnt_number").toString()); } return true; } void dspJournals::sViewTrans() { ParameterList params; params.append("sltrans_id", list()->id()); glTransactionDetail newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspJournals::sViewSeries() { XSqlQuery dspViewSeries; dspViewSeries.prepare("SELECT sltrans_date, sltrans_journalnumber" " FROM sltrans" " WHERE (sltrans_id=:sltrans_id)"); dspViewSeries.bindValue(":sltrans_id", list()->id()); dspViewSeries.exec(); if(!dspViewSeries.first()) return; ParameterList params; params.append("startDate", dspViewSeries.value("SLtrans_date").toDate()); params.append("endDate", dspViewSeries.value("SLtrans_date").toDate()); params.append("journalnumber", dspViewSeries.value("SLtrans_journalnumber").toString()); params.append("journal", true); dspGLSeries *newdlg = new dspGLSeries(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspJournals::sViewDocument() { XSqlQuery dspViewDocument; XTreeWidgetItem * item = (XTreeWidgetItem*)list()->currentItem(); if(0 == item) return; ParameterList params; if(item->rawValue("sltrans_doctype").toString() == "VO") { dspViewDocument.prepare("SELECT vohead_id, vohead_misc" " FROM vohead" " WHERE (vohead_number=:vohead_number)"); dspViewDocument.bindValue(":vohead_number", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("vohead_id", dspViewDocument.value("vohead_id").toInt()); params.append("mode", "view"); if(dspViewDocument.value("vohead_misc").toBool()) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } else if(item->rawValue("sltrans_doctype").toString() == "IN") { dspViewDocument.prepare("SELECT invchead_id" " FROM invchead" " WHERE (invchead_invcnumber=:invchead_invcnumber)"); dspViewDocument.bindValue(":invchead_invcnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; invoice::viewInvoice(dspViewDocument.value("invchead_id").toInt()); } else if(item->rawValue("sltrans_doctype").toString() == "PO") { QStringList docnumber = item->rawValue("docnumber").toString().split("-"); dspViewDocument.prepare("SELECT pohead_id" " FROM pohead" " WHERE (pohead_number=:docnumber)"); dspViewDocument.bindValue(":docnumber", docnumber[0]); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("pohead_id", dspViewDocument.value("pohead_id").toInt()); params.append("mode", "view"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(item->rawValue("sltrans_doctype").toString() == "SH") { dspViewDocument.prepare("SELECT shiphead_id" " FROM shiphead" " WHERE (shiphead_number=:shiphead_number)"); dspViewDocument.bindValue(":shiphead_number", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("shiphead_id", dspViewDocument.value("shiphead_id").toInt()); dspShipmentsByShipment *newdlg = new dspShipmentsByShipment(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if( (item->rawValue("sltrans_doctype").toString() == "CM") || (item->rawValue("sltrans_doctype").toString() == "DM") ) { if(item->rawValue("sltrans_source").toString() == "A/P") { dspViewDocument.prepare("SELECT apopen_id" " FROM apopen" " WHERE ( (apopen_docnumber=:docnumber) " " AND (apopen_doctype IN ('C', 'D')) );"); dspViewDocument.bindValue(":docnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("apopen_id", dspViewDocument.value("apopen_id").toInt()); apOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } else if(item->rawValue("sltrans_source").toString() == "A/R") { dspViewDocument.prepare("SELECT aropen_id" " FROM aropen" " WHERE ( (aropen_docnumber=:docnumber) " " AND (aropen_doctype IN ('C', 'D')) );"); dspViewDocument.bindValue(":docnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("aropen_id", dspViewDocument.value("aropen_id").toInt()); arOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } else if(item->rawValue("sltrans_source").toString() == "S/O") { dspViewDocument.prepare("SELECT cmhead_id" " FROM cmhead" " WHERE (cmhead_number=:docnumber);"); dspViewDocument.bindValue(":docnumber", item->rawValue("docnumber").toString()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("cmhead_id", dspViewDocument.value("cmhead_id").toInt()); creditMemo *newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } else if(item->rawValue("sltrans_doctype").toString() == "SO") { QStringList docnumber = item->rawValue("docnumber").toString().split("-"); dspViewDocument.prepare("SELECT cohead_id" " FROM cohead" " WHERE (cohead_number=:docnumber)"); dspViewDocument.bindValue(":docnumber", docnumber[0]); dspViewDocument.exec(); if(dspViewDocument.first()) salesOrder::viewSalesOrder(dspViewDocument.value("cohead_id").toInt(), this); } else if(item->rawValue("sltrans_doctype").toString() == "WO") { QStringList docnumber = item->rawValue("docnumber").toString().split("-"); params.append("wo_number", docnumber[0]); dspWoHistoryByNumber *newdlg = new dspWoHistoryByNumber(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(item->rawValue("sltrans_source").toString() == "I/M") { dspViewDocument.prepare("SELECT sltrans_misc_id" " FROM sltrans" " WHERE (sltrans_id=:sltrans_id)"); dspViewDocument.bindValue(":sltrans_id", item->id()); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("mode", "view"); params.append("invhist_id", dspViewDocument.value("sltrans_misc_id").toInt()); transactionInformation newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } qt-client-4.1.0/guiclient/displays/dspJournals.h000066400000000000000000000020201217451700100216740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPJOURNALS_H #define DSPJOURNALS_H #include "guiclient.h" #include "display.h" class dspJournals : public display { Q_OBJECT public: dspJournals(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*, int); virtual void sViewTrans(); virtual void sViewSeries(); virtual void sViewDocument(); private: QStringList _sources; }; #endif // DSPJOURNALS_H qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByBOMItem.cpp000066400000000000000000000074531217451700100263150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspMaterialUsageVarianceByBOMItem.h" #include #include dspMaterialUsageVarianceByBOMItem::dspMaterialUsageVarianceByBOMItem(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, "dspMaterialUsageVarianceByBOMItem", fl) { if (name) setObjectName(name); setupUi(optionsWidget()); setWindowTitle(tr("Material Usage Variance by Bill of Materials Item")); setListLabel(tr("Material Usage Variance")); setReportName("MaterialUsageVarianceByBOMItem"); setMetaSQLOptions("workOrderVariance", "material"); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateComponentItems(int))); _item->setType(ItemLineEdit::cGeneralManufactured); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter, true, "posted" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "ordered" ); list()->addColumn(tr("Produced"), _qtyColumn, Qt::AlignRight, true, "received" ); list()->addColumn(tr("Proj. Req."), _qtyColumn, Qt::AlignRight, true, "projreq" ); list()->addColumn(tr("Proj. Qty. per"), _qtyColumn, Qt::AlignRight, true, "projqtyper" ); list()->addColumn(tr("Act. Iss."), _qtyColumn, Qt::AlignRight, true, "actiss" ); list()->addColumn(tr("Act. Qty. per"), _qtyColumn, Qt::AlignRight, true, "actqtyper" ); list()->addColumn(tr("Qty. per Var."), _qtyColumn, Qt::AlignRight, true, "qtypervar" ); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "qtypervarpercent" ); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, false, "womatlvar_notes"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, false, "womatlvar_ref"); } void dspMaterialUsageVarianceByBOMItem::languageChange() { display::languageChange(); retranslateUi(this); } void dspMaterialUsageVarianceByBOMItem::sPopulateComponentItems(int pItemid) { XSqlQuery dspPopulateComponentItems; if (pItemid != -1) { dspPopulateComponentItems.prepare( "SELECT bomitem_id," " (bomitem_seqnumber || '-' || item_number || ' ' || item_descrip1 || ' ' || item_descrip2) " "FROM bomitem, item " "WHERE ( (bomitem_item_id=item_id)" " AND (bomitem_parent_item_id=:item_id) ) " "ORDER BY bomitem_seqnumber;" ); dspPopulateComponentItems.bindValue(":item_id", pItemid); dspPopulateComponentItems.exec(); _componentItem->populate(dspPopulateComponentItems); } else _componentItem->clear(); } bool dspMaterialUsageVarianceByBOMItem::setParams(ParameterList ¶ms) { if(!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("You must specify a valid date range.") ); return false; } if(!_item->isValid()) { QMessageBox::warning(this, tr("Invalid Item"), tr("You must specify an Item.") ); return false; } if(!_componentItem->isValid()) { QMessageBox::warning(this, tr("Invalid BOM Item"), tr("You must specify a BOM Item.") ); return false; } params.append("item_id", _item->id()); params.append("bomitem_id", _componentItem->id()); _dates->appendValue(params); _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByBOMItem.h000066400000000000000000000020511217451700100257470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPMATERIALUSAGEVARIANCEBYBOMITEM_H #define DSPMATERIALUSAGEVARIANCEBYBOMITEM_H #include "display.h" #include "ui_dspMaterialUsageVarianceByBOMItem.h" class dspMaterialUsageVarianceByBOMItem : public display, public Ui::dspMaterialUsageVarianceByBOMItem { Q_OBJECT public: dspMaterialUsageVarianceByBOMItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateComponentItems( int pItemid ); protected slots: virtual void languageChange(); }; #endif // DSPMATERIALUSAGEVARIANCEBYBOMITEM_H qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByBOMItem.ui000066400000000000000000000135541217451700100261470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspMaterialUsageVarianceByBOMItem 0 0 498 187 Material Usage Variance by Bill of Materials Item 0 false 5 Component Item: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Qt::Vertical 20 0 Qt::Horizontal 4 20 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _item _componentItem _warehouse _dates _item warehouseIdChanged(int) _warehouse setId(int) 20 20 317 27 _item newId(int) _warehouse findItemSites(int) 20 20 317 27
    qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByComponentItem.cpp000066400000000000000000000061571217451700100276420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspMaterialUsageVarianceByComponentItem.h" #include #include dspMaterialUsageVarianceByComponentItem::dspMaterialUsageVarianceByComponentItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspMaterialUsageVarianceByComponentItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Material Usage Variance by Component Item")); setListLabel(tr("Material Usage Variance")); setReportName("MaterialUsageVarianceByComponentItem"); setMetaSQLOptions("workOrderVariance", "material"); connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int))); connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemSites(int))); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter, true, "posted" ); list()->addColumn(tr("Parent Item"), _itemColumn, Qt::AlignLeft, true, "parentitemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "parentdescrip"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "ordered" ); list()->addColumn(tr("Produced"), _qtyColumn, Qt::AlignRight, true, "received" ); list()->addColumn(tr("Proj. Req."), _qtyColumn, Qt::AlignRight, true, "projreq" ); list()->addColumn(tr("Proj. Qty. per"), _qtyColumn, Qt::AlignRight, true, "projqtyper" ); list()->addColumn(tr("Act. Iss."), _qtyColumn, Qt::AlignRight, true, "actiss" ); list()->addColumn(tr("Act. Qty. per"), _qtyColumn, Qt::AlignRight, true, "actqtyper" ); list()->addColumn(tr("Qty. per Var."), _qtyColumn, Qt::AlignRight, true, "qtypervar" ); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "qtypervarpercent" ); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, false, "womatlvar_notes"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, false, "womatlvar_ref"); } void dspMaterialUsageVarianceByComponentItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspMaterialUsageVarianceByComponentItem::setParams(ParameterList ¶ms) { if(!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("You must specify a valid date range.") ); return false; } if(!_item->isValid()) { QMessageBox::warning(this, tr("Invalid Item"), tr("You must specify an Item.") ); return false; } params.append("component_item_id", _item->id()); _dates->appendValue(params); _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByComponentItem.h000066400000000000000000000020131217451700100272720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPMATERIALUSAGEVARIANCEBYCOMPONENTITEM_H #define DSPMATERIALUSAGEVARIANCEBYCOMPONENTITEM_H #include "display.h" #include "ui_dspMaterialUsageVarianceByComponentItem.h" class dspMaterialUsageVarianceByComponentItem : public display, public Ui::dspMaterialUsageVarianceByComponentItem { Q_OBJECT public: dspMaterialUsageVarianceByComponentItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPMATERIALUSAGEVARIANCEBYCOMPONENTITEM_H qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByComponentItem.ui000066400000000000000000000110461217451700100274660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspMaterialUsageVarianceByComponentItem 0 0 472 198 Material Usage Variance by Component Item 0 Qt::Horizontal 0 20 false Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _item _warehouse _dates _item warehouseIdChanged(int) _warehouse setId(int) 20 20 315 27 _item newId(int) _warehouse findItemSites(int) 20 20 315 27
    qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByItem.cpp000066400000000000000000000062611217451700100257530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspMaterialUsageVarianceByItem.h" #include #include dspMaterialUsageVarianceByItem::dspMaterialUsageVarianceByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspMaterialUsageVarianceByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Material Usage Variance by Item")); setListLabel(tr("Material Usage Variance")); setReportName("MaterialUsageVarianceByItem"); setMetaSQLOptions("workOrderVariance", "material"); connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemSites(int))); connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int))); _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased); _item->setDefaultType(ItemLineEdit::cGeneralManufactured); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), 0); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), 0); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter, true, "posted" ); list()->addColumn(tr("Component Item"), _itemColumn, Qt::AlignLeft, true, "componentitemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "componentdescrip"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "ordered" ); list()->addColumn(tr("Produced"), _qtyColumn, Qt::AlignRight, true, "received" ); list()->addColumn(tr("Proj. Req."), _qtyColumn, Qt::AlignRight, true, "projreq" ); list()->addColumn(tr("Proj. Qty. per"), _qtyColumn, Qt::AlignRight, true, "projqtyper" ); list()->addColumn(tr("Act. Iss."), _qtyColumn, Qt::AlignRight, true, "actiss" ); list()->addColumn(tr("Act. Qty. per"), _qtyColumn, Qt::AlignRight, true, "actqtyper" ); list()->addColumn(tr("Qty. per Var."), _qtyColumn, Qt::AlignRight, true, "qtypervar" ); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "qtypervarpercent" ); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, false, "womatlvar_notes"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, false, "womatlvar_ref"); } void dspMaterialUsageVarianceByItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspMaterialUsageVarianceByItem::setParams(ParameterList ¶ms) { if(!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("You must specify a valid date range.") ); return false; } if(!_item->isValid()) { QMessageBox::warning(this, tr("Invalid Item"), tr("You must specify an Item.") ); return false; } params.append("item_id", _item->id()); _dates->appendValue(params); _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByItem.h000066400000000000000000000017141217451700100254160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPMATERIALUSAGEVARIANCEBYITEM_H #define DSPMATERIALUSAGEVARIANCEBYITEM_H #include "display.h" #include "ui_dspMaterialUsageVarianceByItem.h" class dspMaterialUsageVarianceByItem : public display, public Ui::dspMaterialUsageVarianceByItem { Q_OBJECT public: dspMaterialUsageVarianceByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPMATERIALUSAGEVARIANCEBYITEM_H qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByItem.ui000066400000000000000000000110121217451700100255740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspMaterialUsageVarianceByItem 0 0 472 198 Material Usage Variance by Item 0 Qt::Horizontal 0 20 false Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 4 20 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _item _warehouse _dates _item newId(int) _warehouse findItemSites(int) 20 20 318 27 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 318 27
    qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByWarehouse.cpp000066400000000000000000000055711217451700100270220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspMaterialUsageVarianceByWarehouse.h" #include #include #include "xtreewidget.h" dspMaterialUsageVarianceByWarehouse::dspMaterialUsageVarianceByWarehouse(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspMaterialUsageVarianceByWarehouse", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Material Usage Variance by Site")); setListLabel(tr("Material Usage Variance")); setReportName("MaterialUsageVarianceByWarehouse"); setMetaSQLOptions("workOrderVariance", "material"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), 0); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), 0); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter, true, "posted" ); list()->addColumn(tr("Parent Item"), _itemColumn, Qt::AlignLeft, true, "parentitemnumber" ); list()->addColumn(tr("Component Item"), _itemColumn, Qt::AlignLeft, true, "componentitemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "componentdescrip"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "ordered" ); list()->addColumn(tr("Produced"), _qtyColumn, Qt::AlignRight, true, "received" ); list()->addColumn(tr("Proj. Req."), _qtyColumn, Qt::AlignRight, true, "projreq" ); list()->addColumn(tr("Proj. Qty. per."), _qtyColumn, Qt::AlignRight, true, "projqtyper" ); list()->addColumn(tr("Act. Iss."), _qtyColumn, Qt::AlignRight, true, "actiss" ); list()->addColumn(tr("Act. Qty. per."), _qtyColumn, Qt::AlignRight, true, "actqtyper" ); list()->addColumn(tr("Qty. per Var."), _qtyColumn, Qt::AlignRight, true, "qtypervar" ); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "qtypervarpercent" ); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, false, "womatlvar_notes"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, false, "womatlvar_ref"); } void dspMaterialUsageVarianceByWarehouse::languageChange() { display::languageChange(); retranslateUi(this); } bool dspMaterialUsageVarianceByWarehouse::setParams(ParameterList ¶ms) { if(!_dates->allValid()) { QMessageBox::warning(this, tr("Invalid Date Range"), tr("You must specify a valid date range.") ); return false; } _dates->appendValue(params); _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByWarehouse.h000066400000000000000000000017571217451700100264710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPMATERIALUSAGEVARIANCEBYWAREHOUSE_H #define DSPMATERIALUSAGEVARIANCEBYWAREHOUSE_H #include "display.h" #include "ui_dspMaterialUsageVarianceByWarehouse.h" class dspMaterialUsageVarianceByWarehouse : public display, public Ui::dspMaterialUsageVarianceByWarehouse { Q_OBJECT public: dspMaterialUsageVarianceByWarehouse(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPMATERIALUSAGEVARIANCEBYWAREHOUSE_H qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByWarehouse.ui000066400000000000000000000063441217451700100266540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspMaterialUsageVarianceByWarehouse 0 0 467 95 Material Usage Variance by Site 0 false Qt::Vertical 20 0 0 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DateCluster QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _dates
    qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByWorkOrder.cpp000066400000000000000000000053671217451700100270010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspMaterialUsageVarianceByWorkOrder.h" #include #include #include "inputManager.h" dspMaterialUsageVarianceByWorkOrder::dspMaterialUsageVarianceByWorkOrder(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspMaterialUsageVarianceByWorkOrder", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Material Usage Variance by Work Order")); setListLabel(tr("Material Usage Variance")); setReportName("MaterialUsageVarianceByWorkOrder"); setMetaSQLOptions("workOrderVariance", "material"); _wo->setType(cWoClosed); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter, true, "posted" ); list()->addColumn(tr("Component Item"), -1, Qt::AlignLeft, true, "componentitemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "componentdescrip"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "ordered" ); list()->addColumn(tr("Produced"), _qtyColumn, Qt::AlignRight, true, "received" ); list()->addColumn(tr("Proj. Req."), _qtyColumn, Qt::AlignRight, true, "projreq" ); list()->addColumn(tr("Proj. Qty. per"), _qtyColumn, Qt::AlignRight, true, "projqtyper" ); list()->addColumn(tr("Act. Iss."), _qtyColumn, Qt::AlignRight, true, "actiss" ); list()->addColumn(tr("Act. Qty. per"), _qtyColumn, Qt::AlignRight, true, "actqtyper" ); list()->addColumn(tr("Qty. per Var."), _qtyColumn, Qt::AlignRight, true, "qtypervar" ); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "qtypervarpercent"); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, false, "womatlvar_notes"); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, false, "womatlvar_ref"); } void dspMaterialUsageVarianceByWorkOrder::languageChange() { display::languageChange(); retranslateUi(this); } bool dspMaterialUsageVarianceByWorkOrder::setParams(ParameterList ¶ms) { if(!_wo->isValid()) { QMessageBox::warning(this, tr("Invalid W/O"), tr("You must specify a Work Order.") ); return false; } params.append("wo_id", _wo->id()); return true; } qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByWorkOrder.h000066400000000000000000000017571217451700100264450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPMATERIALUSAGEVARIANCEBYWORKORDER_H #define DSPMATERIALUSAGEVARIANCEBYWORKORDER_H #include "display.h" #include "ui_dspMaterialUsageVarianceByWorkOrder.h" class dspMaterialUsageVarianceByWorkOrder : public display, public Ui::dspMaterialUsageVarianceByWorkOrder { Q_OBJECT public: dspMaterialUsageVarianceByWorkOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPMATERIALUSAGEVARIANCEBYWORKORDER_H qt-client-4.1.0/guiclient/displays/dspMaterialUsageVarianceByWorkOrder.ui000066400000000000000000000050211217451700100266170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspMaterialUsageVarianceByWorkOrder 0 0 316 150 Material Usage Variance by Work Order 0 0 0 290 130 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 2 20 WoCluster QWidget
    wocluster.h
    _wo
    qt-client-4.1.0/guiclient/displays/dspOrderActivityByProject.cpp000066400000000000000000000302401217451700100250510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspOrderActivityByProject.h" #include #include #include #include #include "guiclient.h" #include "salesOrder.h" #include "salesOrderItem.h" #include "invoice.h" #include "invoiceItem.h" #include "workOrder.h" #include "purchaseRequest.h" #include "purchaseOrder.h" #include "purchaseOrderItem.h" dspOrderActivityByProject::dspOrderActivityByProject(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspOrderActivityByProject", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Order Activity by Project")); setListLabel(tr("Orders")); setReportName("OrderActivityByProject"); setMetaSQLOptions("orderActivityByProject", "detail"); setUseAltId(true); _run = false; list()->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "name" ); list()->addColumn(tr("Status"), _orderColumn, Qt::AlignLeft, true, "status" ); list()->addColumn(tr("Item #"), _itemColumn, Qt::AlignLeft, true, "item" ); list()->addColumn(tr("Description"), -1 , Qt::AlignLeft, true, "descrip" ); list()->addColumn(tr("Qty"), _qtyColumn, Qt::AlignRight, true, "qty" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom" ); list()->addColumn(tr("Value"), _qtyColumn, Qt::AlignRight, true, "value" ); list()->setPopulateLinear(true); } void dspOrderActivityByProject::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspOrderActivityByProject::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("prj_id", &valid); if (valid) _project->setId(param.toInt()); if (pParams.inList("run")) { _run = true; return NoError_Run; } return NoError; } void dspOrderActivityByProject::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if(list()->altId() == 15) { menuItem = pMenu->addAction(tr("Edit Quote..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainQuotes")); menuItem = pMenu->addAction(tr("View Quote..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainQuotes") || _privileges->check("ViewQuotes") ); } if(list()->altId() == 17) { menuItem = pMenu->addAction(tr("Edit Quote Item..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainQuotes")); menuItem = pMenu->addAction(tr("View Quote Item..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainQuotes") || _privileges->check("ViewQuotes")); } if(list()->altId() == 25) { menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders")); } if(list()->altId() == 27) { menuItem = pMenu->addAction(tr("Edit Sales Order Item..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); menuItem = pMenu->addAction(tr("View Sales Order Item..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders")); } if(list()->altId() == 35) { menuItem = pMenu->addAction(tr("Edit Invoice..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices")); menuItem = pMenu->addAction(tr("View Invoice..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices") || _privileges->check("ViewMiscInvoices")); } if(list()->altId() == 37) { menuItem = pMenu->addAction(tr("Edit Invoice Item..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices")); menuItem = pMenu->addAction(tr("View Invoice Item..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices") || _privileges->check("ViewMiscInvoices")); } if(list()->altId() == 45) { menuItem = pMenu->addAction(tr("Edit Work Order..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); menuItem = pMenu->addAction(tr("View Work Order..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders")); } if(list()->altId() == 55) { menuItem = pMenu->addAction(tr("View Purchase Request..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainPurchaseRequests") || _privileges->check("ViewPurchaseRequests")); } if(list()->altId() == 65) { menuItem = pMenu->addAction(tr("Edit Purchase Order..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = pMenu->addAction(tr("View Purchase Order..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); } if(list()->altId() == 67) { menuItem = pMenu->addAction(tr("Edit Purchase Order Item..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = pMenu->addAction(tr("View Purchase Order Item..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); } } void dspOrderActivityByProject::sEdit() { ParameterList params; if(list()->altId() == 15) { params.append("mode", "editQuote"); params.append("quhead_id", list()->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(list()->altId() == 17) { params.append("mode", "editQuote"); params.append("soitem_id", list()->id()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } else if(list()->altId() == 25) { params.append("mode", "edit"); params.append("sohead_id", list()->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } else if(list()->altId() == 27) { params.append("mode", "edit"); params.append("soitem_id", list()->id()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } else if(list()->altId() == 35) { invoice::editInvoice(list()->id(), this); } else if(list()->altId() == 37) { params.append("mode", "edit"); params.append("invcitem_id", list()->id()); invoiceItem newdlg(this); newdlg.set(params); newdlg.exec(); } else if(list()->altId() == 45) { params.append("mode", "edit"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(list()->altId() == 65) { params.append("mode", "edit"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(list()->altId() == 67) { ParameterList params; params.append("mode", "edit"); params.append("poitem_id", list()->id()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } void dspOrderActivityByProject::sView() { ParameterList params; if(list()->altId() == 15) { params.append("mode", "viewQuote"); params.append("quhead_id", list()->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(list()->altId() == 17) { params.append("mode", "viewQuote"); params.append("soitem_id", list()->id()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } else if(list()->altId() == 25) { params.append("mode", "view"); params.append("sohead_id", list()->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } else if(list()->altId() == 27) { params.append("mode", "view"); params.append("soitem_id", list()->id()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } else if(list()->altId() == 35) { invoice::viewInvoice(list()->id(), this); } else if(list()->altId() == 37) { params.append("mode", "view"); params.append("invcitem_id", list()->id()); invoiceItem newdlg(this); newdlg.set(params); newdlg.exec(); } else if(list()->altId() == 45) { params.append("mode", "view"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(list()->altId() == 55) { params.append("mode", "view"); params.append("pr_id", list()->id()); purchaseRequest newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } else if(list()->altId() == 65) { params.append("mode", "view"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if(list()->altId() == 67) { ParameterList params; params.append("mode", "view"); params.append("poitem_id", list()->id()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } } bool dspOrderActivityByProject::setParams(ParameterList ¶ms) { if(_project->id() == -1) { QMessageBox::warning(this, tr("Project Required"), tr("You must specify a Project.")); return false; } if (!_showWo->isChecked() && !_showPo->isChecked() && !_showSo->isChecked()) { list()->clear(); return false; } params.append("prj_id", _project->id()); params.append("so", tr("Sales Order")); params.append("wo", tr("Work Order")); params.append("po", tr("Purchase Order")); params.append("pr", tr("Purchase Request")); params.append("sos", tr("Sales Orders")); params.append("wos", tr("Work Orders")); params.append("pos", tr("Purchase Orders")); params.append("prs", tr("Purchase Requests")); params.append("quote", tr("Quote")); params.append("quotes", tr("Quotes")); params.append("invoice", tr("Invoice")); params.append("invoices", tr("Invoices")); params.append("open", tr("Open")); params.append("closed", tr("Closed")); params.append("converted", tr("Converted")); params.append("canceled", tr("Canceled")); params.append("expired", tr("Expired")); params.append("unposted", tr("Unposted")); params.append("posted", tr("Posted")); params.append("exploded", tr("Exploded")); params.append("released", tr("Released")); params.append("inprocess", tr("In Process")); params.append("unreleased", tr("Unreleased")); params.append("total", tr("Total")); if(_showSo->isChecked()) params.append("showSo"); if(_showWo->isChecked()) params.append("showWo"); if(_showPo->isChecked()) params.append("showPo"); if (! _privileges->check("ViewAllProjects") && ! _privileges->check("MaintainAllProjects")) params.append("owner_username", omfgThis->username()); return true; } void dspOrderActivityByProject::sFillList() { display::sFillList(); list()->expandAll(); } void dspOrderActivityByProject::showEvent(QShowEvent *event) { display::showEvent(event); if (_run) sFillList(); } qt-client-4.1.0/guiclient/displays/dspOrderActivityByProject.h000066400000000000000000000023621217451700100245220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPORDERACTIVITYBYPROJECT_H #define DSPORDERACTIVITYBYPROJECT_H #include #include "display.h" #include "ui_dspOrderActivityByProject.h" class dspOrderActivityByProject : public display, public Ui::dspOrderActivityByProject { Q_OBJECT public: dspOrderActivityByProject(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem*, int); virtual void sEdit(); virtual void sView(); virtual void sFillList(); protected slots: virtual void languageChange(); protected: virtual void showEvent(QShowEvent *event); private: bool _run; }; #endif // DSPORDERACTIVITYBYPROJECT_H qt-client-4.1.0/guiclient/displays/dspOrderActivityByProject.ui000066400000000000000000000071241217451700100247110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspOrderActivityByProject 0 0 430 129 Order Activity by Project Qt::Horizontal Show Types 12 Sales Orders Work Orders Purchase Orders Qt::Horizontal 0 20 Qt::Vertical 20 0 ProjectCluster QWidget
    projectcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _project _showWo
    qt-client-4.1.0/guiclient/displays/dspOrders.cpp000066400000000000000000000150401217451700100216760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspOrders.h" #include #include #include #include "changePoitemQty.h" #include "changeWoQty.h" #include "printWoTraveler.h" #include "reprioritizeWo.h" #include "reschedulePoitem.h" #include "rescheduleWo.h" dspOrders::dspOrders(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspOrders", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Item Orders")); setListLabel(tr("Item Orders")); setMetaSQLOptions("orders", "detail"); setUseAltId(true); _item->setReadOnly(true); _warehouse->setEnabled(false); list()->addColumn(tr("Type"), _docTypeColumn, Qt::AlignCenter, true, "order_type" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "order_status" ); list()->addColumn(tr("Order #"), -1, Qt::AlignLeft, true, "order_number" ); list()->addColumn(tr("Total"), _qtyColumn, Qt::AlignRight, true, "totalqty" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "relievedqty" ); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balanceqty" ); list()->addColumn(tr("Running Bal."), _qtyColumn, Qt::AlignRight, true, "runningbalanceqty" ); list()->addColumn(tr("Required"), _dateColumn, Qt::AlignCenter, true, "duedate" ); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } void dspOrders::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspOrders::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) _item->setItemsiteid(param.toInt()); _leadTime->setChecked(pParams.inList("byLeadTime")); param = pParams.value("byDate", &valid); if (valid) { _byDate->setChecked(true); _date->setDate(param.toDate()); } param = pParams.value("byDays", &valid); if (valid) { _byDays->setChecked(true); _days->setValue(param.toInt()); } _byRange->setChecked(pParams.inList("byRange")); param = pParams.value("startDate", &valid); if (valid) _startDate->setDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _endDate->setDate(param.toDate()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspOrders::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if (list()->altId() == 1) { menuItem = pMenu->addAction(tr("Reschedule P/O Item..."), this, SLOT(sReschedulePoitem())); if (!_privileges->check("ReschedulePurchaseOrders")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Change P/O Item Quantity..."), this, SLOT(sChangePoitemQty())); if (!_privileges->check("ChangePurchaseOrderQty")) menuItem->setEnabled(false); } else if (list()->altId() == 2) { menuItem = pMenu->addAction(tr("Reprioritize W/O..."), this, SLOT(sReprioritizeWo())); if (!_privileges->check("ReprioritizeWorkOrders")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Reschedule W/O..."), this, SLOT(sRescheduleWO())); if (!_privileges->check("RescheduleWorkOrders") || (list()->rawValue("order_status") != "O" && list()->rawValue("order_status") != "E")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Change W/O Quantity..."), this, SLOT(sChangeWOQty())); if (!_privileges->check("ChangeWorkOrderQty")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Print Traveler..."), this, SLOT(sPrintTraveler())); if (!_privileges->check("PrintWorkOrderPaperWork")) menuItem->setEnabled(false); } } void dspOrders::sReprioritizeWo() { ParameterList params; params.append("wo_id", list()->id()); reprioritizeWo newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspOrders::sRescheduleWO() { ParameterList params; params.append("wo_id", list()->id()); rescheduleWo newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspOrders::sChangeWOQty() { ParameterList params; params.append("wo_id", list()->id()); changeWoQty newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspOrders::sPrintTraveler() { ParameterList params; params.append("wo_id", list()->id()); printWoTraveler newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspOrders::sReschedulePoitem() { ParameterList params; params.append("poitem_id", list()->id()); reschedulePoitem newdlg(this, "", true); if(newdlg.set(params) != UndefinedError) if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspOrders::sChangePoitemQty() { ParameterList params; params.append("poitem_id", list()->id()); changePoitemQty newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } bool dspOrders::setParams(ParameterList & params) { if ( !((_item->isValid()) && ( (_leadTime->isChecked()) || (_byDays->isChecked()) || ((_byDate->isChecked()) && (_date->isValid())) || (_byRange->isChecked() && _startDate->isValid() && _endDate->isValid()) ) ) ) { return false; } params.append("warehous_id", _warehouse->id()); params.append("item_id", _item->id()); params.append("itemType", _item->itemType()); if (_leadTime->isChecked()) params.append("useLeadTime"); else if (_byDays->isChecked()) params.append("days", _days->value()); else if (_byDate->isChecked()) params.append("date", _date->date()); else if (_byRange->isChecked()) { params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } if (_metrics->value("Application") == "Standard") params.append("Standard"); XSqlQuery xtmfg; xtmfg.exec("SELECT pkghead_name FROM pkghead WHERE pkghead_name='xtmfg'"); if (xtmfg.first()) params.append("Manufacturing"); return true; } qt-client-4.1.0/guiclient/displays/dspOrders.h000066400000000000000000000022721217451700100213460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPORDERS_H #define DSPORDERS_H #include "guiclient.h" #include "display.h" #include "ui_dspOrders.h" class dspOrders : public display, public Ui::dspOrders { Q_OBJECT public: dspOrders(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * menu, QTreeWidgetItem*, int); virtual void sReprioritizeWo(); virtual void sRescheduleWO(); virtual void sChangeWOQty(); virtual void sPrintTraveler(); virtual void sReschedulePoitem(); virtual void sChangePoitemQty(); protected slots: virtual void languageChange(); }; #endif // DSPORDERS_H qt-client-4.1.0/guiclient/displays/dspOrders.ui000066400000000000000000000257011217451700100215360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspOrders 0 0 559 229 Item Orders 5 0 Show Availability as of: 0 5 Item Site Lead Time true 5 0 true Look Ahead Days: 0 0 false 0 1000 Qt::Horizontal QSizePolicy::Expanding 20 20 5 0 Date: 0 0 false Qt::Horizontal QSizePolicy::MinimumExpanding 20 20 5 0 Date Range: false to Qt::AlignCenter false Qt::Vertical 20 0 0 0 5 0 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 DLineEdit QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    _item _warehouse _leadTime _byDays _days _byDate _date _byRange _startDate _endDate _item privateIdChanged(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _byDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _byDate toggled(bool) _date setEnabled(bool) 20 20 20 20 _byRange toggled(bool) _startDate setEnabled(bool) 20 20 20 20 _byRange toggled(bool) _endDate setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPOsByDate.cpp000066400000000000000000000075631217451700100222450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPOsByDate.h" #include #include "guiclient.h" #include "purchaseOrder.h" dspPOsByDate::dspPOsByDate(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPOsByDate", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Orders by Date")); setListLabel(tr("Purchase Orders")); setReportName("POsByDate"); setMetaSQLOptions("purchaseOrders", "detail"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Order Date:")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Order Date:")); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "pohead_number"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehousecode"); list()->addColumn(tr("Status"), _dateColumn, Qt::AlignCenter,true, "poitem_status"); list()->addColumn(tr("Vendor"), _itemColumn, Qt::AlignLeft, true, "vend_name"); list()->addColumn(tr("Order Date"), _dateColumn, Qt::AlignCenter,true, "pohead_orderdate"); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter,true, "minDueDate"); } void dspPOsByDate::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPOsByDate::setParams(ParameterList &pParams) { pParams.append("byDate"); if (!_dates->startDate().isValid()) { QMessageBox::warning( this, tr("Enter Start Date"), tr( "Please enter a valid Start Date." ) ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::warning( this, tr("Enter End Date"), tr( "Please eneter a valid End Date." ) ); _dates->setFocus(); return false; } _dates->appendValue(pParams); _warehouse->appendValue(pParams); if (_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); if (_showClosed->isChecked()) pParams.append("showClosed"); pParams.append("closed", tr("Closed")); pParams.append("unposted", tr("Unposted")); pParams.append("partial", tr("Partial")); pParams.append("received", tr("Received")); pParams.append("open", tr("Open")); return true; } void dspPOsByDate::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; if (dynamic_cast(pSelected) && dynamic_cast(pSelected)->rawValue("poitem_status").toString() == "U") { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); } void dspPOsByDate::sEditOrder() { ParameterList params; params.append("mode", "edit"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPOsByDate::sViewOrder() { ParameterList params; params.append("mode", "view"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/displays/dspPOsByDate.h000066400000000000000000000017541217451700100217060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOSBYDATE_H #define DSPPOSBYDATE_H #include "display.h" #include "ui_dspPOsByDate.h" class dspPOsByDate : public display, public Ui::dspPOsByDate { Q_OBJECT public: dspPOsByDate(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sEditOrder(); virtual void sViewOrder(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); protected slots: virtual void languageChange(); }; #endif // DSPPOSBYDATE_H qt-client-4.1.0/guiclient/displays/dspPOsByDate.ui000066400000000000000000000157721217451700100221010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPOsByDate 0 0 490 206 Purchase Orders by Date 0 0 Qt::StrongFocus 0 0 All Purchasing Agents true Selected Purchasing Agent 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _agent false 0 0 Qt::StrongFocus false Show Closed Purchase Orders Qt::Vertical 20 0 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 8 20 DateCluster QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _dates _allPurchasingAgents _selectedPurchasingAgent _agent _warehouse _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 265 62 371 86
    qt-client-4.1.0/guiclient/displays/dspPOsByVendor.cpp000066400000000000000000000066441217451700100226240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPOsByVendor.h" #include "guiclient.h" #include "purchaseOrder.h" dspPOsByVendor::dspPOsByVendor(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPOsByVendor", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Orders by Vendor")); setListLabel(tr("Purchase Orders")); setReportName("POsByVendor"); setMetaSQLOptions("purchaseOrders", "detail"); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "pohead_number" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehousecode" ); list()->addColumn(tr("Status"), _dateColumn, Qt::AlignCenter, true, "poitem_status" ); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_number" ); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "sortDate" ); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _descrip->setEnabled(_searchDescrip->isChecked()); } void dspPOsByVendor::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPOsByVendor::setParams(ParameterList ¶ms) { _dates->appendValue(params); _warehouse->appendValue(params); _vend->appendValue(params); if(_showClosed->isChecked()) params.append("showClosed"); if(_byReceiptDate->isChecked()) params.append("byReceiptDate"); else if(_byDueDate->isChecked()) params.append("byDueDate"); else //if(_byOrderDate->isChecked()) params.append("byOrderDate"); if(_searchDescrip->isChecked()) params.append("descrip_pattern", _descrip->text()); params.append("closed", tr("Closed")); params.append("unposted", tr("Unposted")); params.append("partial", tr("Partial")); params.append("received", tr("Received")); params.append("open", tr("Open")); return true; } void dspPOsByVendor::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; if (dynamic_cast(pSelected) && dynamic_cast(pSelected)->rawValue("poitem_status").toString() == "U") { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); } void dspPOsByVendor::sEditOrder() { ParameterList params; params.append("mode", "edit"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPOsByVendor::sViewOrder() { ParameterList params; params.append("mode", "view"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/displays/dspPOsByVendor.h000066400000000000000000000017721217451700100222660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOSBYVENDOR_H #define DSPPOSBYVENDOR_H #include "display.h" #include "ui_dspPOsByVendor.h" class dspPOsByVendor : public display, public Ui::dspPOsByVendor { Q_OBJECT public: dspPOsByVendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sEditOrder(); virtual void sViewOrder(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); protected slots: virtual void languageChange(); }; #endif // DSPPOSBYVENDOR_H qt-client-4.1.0/guiclient/displays/dspPOsByVendor.ui000066400000000000000000000155771217451700100224640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPOsByVendor 0 0 544 270 Purchase Orders by Vendor 0 Qt::StrongFocus Qt::Horizontal 0 20 Qt::StrongFocus false Qt::StrongFocus Order Date true Due Date Receipt Date Show Closed Where Item Description contains false Qt::Horizontal 40 20 Qt::Vertical 20 0 Qt::Horizontal 66 20 DateCluster QWidget
    datecluster.h
    VendorGroup QWidget
    vendorgroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _dates _byOrderDate _byDueDate _byReceiptDate _searchDescrip toggled(bool) _descrip setEnabled(bool) 368 178 553 178
    qt-client-4.1.0/guiclient/displays/dspPartiallyShippedOrders.cpp000066400000000000000000000112551217451700100251010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPartiallyShippedOrders.h" #include #include #include #include "guiclient.h" #include "printPackingList.h" #include "salesOrder.h" #define AMOUNT_COL 7 #define AMOUNT_CURR_COL 8 #define BASEAMOUNT_COL 9 dspPartiallyShippedOrders::dspPartiallyShippedOrders(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPartiallyShippedOrders", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Partially Shipped Orders")); setListLabel(tr("Sales Orders")); setReportName("PartiallyShippedOrders"); setMetaSQLOptions("partiallyShippedOrders", "detail"); setUseAltId(true); connect(_showPrices, SIGNAL(toggled(bool)), this, SLOT(sHandlePrices(bool))); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Hold"), 0, Qt::AlignCenter,true, "cohead_holdtype"); list()->addColumn(tr("S/O #"), _orderColumn, Qt::AlignRight, true, "cohead_number"); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name"); list()->addColumn(tr("Hold Type"), _dateColumn, Qt::AlignCenter,true, "f_holdtype"); list()->addColumn(tr("Ordered"), _dateColumn, Qt::AlignRight, true, "cohead_orderdate"); list()->addColumn(tr("Scheduled"), _dateColumn, Qt::AlignRight, true, "minscheddate"); list()->addColumn(tr("Pack Date"), _dateColumn, Qt::AlignRight, true, "cohead_packdate"); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "extprice"); list()->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "currAbbr"); list()->addColumn(tr("Amount\n(%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, true, "extprice_base"); list()->setDragString("soheadid="); sHandlePrices(_showPrices->isChecked()); if ( (!_privileges->check("ViewCustomerPrices")) && (!_privileges->check("MaintainCustomerPrices")) ) _showPrices->setEnabled(false); } void dspPartiallyShippedOrders::languageChange() { display::languageChange(); retranslateUi(this); } void dspPartiallyShippedOrders::sHandlePrices(bool pShowPrices) { if (pShowPrices) { list()->showColumn(AMOUNT_COL); if (!omfgThis->singleCurrency()) list()->showColumn(AMOUNT_CURR_COL); if (!omfgThis->singleCurrency()) list()->showColumn(BASEAMOUNT_COL); } else { list()->hideColumn(AMOUNT_COL); list()->hideColumn(AMOUNT_CURR_COL); list()->hideColumn(BASEAMOUNT_COL); } } bool dspPartiallyShippedOrders::setParams(ParameterList ¶ms) { _warehouse->appendValue(params); if (_dates->allValid()) _dates->appendValue(params); else return false; if(_showPrices->isChecked()) params.append("showPrices"); params.append("none", tr("None")); params.append("credit", tr("Credit")); params.append("pack", tr("Pack")); params.append("return", tr("Return")); params.append("ship", tr("Ship")); params.append("other", tr("Other")); if (omfgThis->singleCurrency()) params.append("singlecurrency"); return true; } void dspPartiallyShippedOrders::sEditOrder() { salesOrder::editSalesOrder(list()->altId(), false); } void dspPartiallyShippedOrders::sViewOrder() { salesOrder::viewSalesOrder(list()->altId()); } void dspPartiallyShippedOrders::sPrintPackingList() { ParameterList params; params.append("sohead_id", list()->altId()); printPackingList newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspPartiallyShippedOrders::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders")); pMenu->addSeparator(); if ( (list()->currentItem()->text(0) != "P") && (list()->currentItem()->text(0) != "C") ) { menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList())); menuItem->setEnabled(_privileges->check("PrintPackingLists")); } } qt-client-4.1.0/guiclient/displays/dspPartiallyShippedOrders.h000066400000000000000000000022251217451700100245430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPARTIALLYSHIPPEDORDERS_H #define DSPPARTIALLYSHIPPEDORDERS_H #include "display.h" #include "ui_dspPartiallyShippedOrders.h" class dspPartiallyShippedOrders : public display, public Ui::dspPartiallyShippedOrders { Q_OBJECT public: dspPartiallyShippedOrders(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual void sHandlePrices( bool pShowPrices ); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sPrintPackingList(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); protected slots: virtual void languageChange(); }; #endif // DSPPARTIALLYSHIPPEDORDERS_H qt-client-4.1.0/guiclient/displays/dspPartiallyShippedOrders.ui000066400000000000000000000072411217451700100247340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPartiallyShippedOrders 0 0 487 168 Partially Shipped Orders false Qt::Horizontal 0 20 Show Prices Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 1 DateCluster QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _dates _showPrices _warehouse
    qt-client-4.1.0/guiclient/displays/dspPendingAvailability.cpp000066400000000000000000000064231217451700100243640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPendingAvailability.h" #include #include dspPendingAvailability::dspPendingAvailability(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPendingAvailability", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Pending W/O Material Availability")); setListLabel(tr("Material Requirements")); setReportName("PendingWOMaterialAvailability"); setMetaSQLOptions("pendingAvailability", "detail"); setUseAltId(true); connect(_item, SIGNAL(privateIdChanged(int)), _warehouse, SLOT(findItemsites(int))); _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cTooling); _item->setDefaultType(ItemLineEdit::cGeneralManufactured); _effective->setNullString(tr("Now")); _effective->setNullDate(QDate::currentDate()); _effective->setAllowNullDate(true); _effective->setNull(); _buildDate->setNullString(tr("Latest")); _buildDate->setNullDate(omfgThis->endOfTime()); _buildDate->setAllowNullDate(true); _buildDate->setNull(); _qtyToBuild->setValidator(omfgThis->qtyVal()); _qtyToBuild->setText("1.0"); list()->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "bomitem_seqnumber" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Pend. Alloc."), _qtyColumn, Qt::AlignRight, true, "pendalloc" ); list()->addColumn(tr("Total Alloc."), _qtyColumn, Qt::AlignRight, true, "totalalloc" ); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh" ); list()->addColumn(tr("Availability"), _qtyColumn, Qt::AlignRight, true, "totalavail" ); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } void dspPendingAvailability::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPendingAvailability::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } if(!_warehouse->isValid()) { QMessageBox::warning(this, tr("Site Required"), tr("You must specify a Site.")); return false; } params.append("buildQty", _qtyToBuild->toDouble()); params.append("buildDate", _buildDate->date()); params.append("warehous_id", _warehouse->id()); params.append("item_id", _item->id()); if (!(_effective->isNull())) params.append("effective", _effective->date()); if (_showShortages->isChecked()) params.append("showShortages"); params.append("showIndented"); return true; } qt-client-4.1.0/guiclient/displays/dspPendingAvailability.h000066400000000000000000000016241217451700100240270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPENDINGAVAILABILITY_H #define DSPPENDINGAVAILABILITY_H #include "display.h" #include "ui_dspPendingAvailability.h" class dspPendingAvailability : public display, public Ui::dspPendingAvailability { Q_OBJECT public: dspPendingAvailability(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPPENDINGAVAILABILITY_H qt-client-4.1.0/guiclient/displays/dspPendingAvailability.ui000066400000000000000000000222401217451700100242120ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPendingAvailability 0 0 598 121 Pending W/O Material Availability 5 0 5 0 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 Qt::Vertical 20 0 0 0 5 0 5 0 &Qty. to Build: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyToBuild &Effective: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _effective &Build Date Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _effective 5 0 0 0 80 32767 0 0 80 32767 0 0 80 32767 Qt::Vertical QSizePolicy::Expanding 20 0 Only Show Shortages Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 1 20 DLineEdit QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _item _warehouse _qtyToBuild _effective _buildDate _showShortages _item privateIdChanged(int) _warehouse findItemsites(int) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPendingBOMChanges.cpp000066400000000000000000000075151217451700100236630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPendingBOMChanges.h" #include #include #include #include #include "bomItem.h" dspPendingBOMChanges::dspPendingBOMChanges(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPendingBOMChanges", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Pending Bill of Materials Changes")); setListLabel(tr("Pending Bill of Materials Changes")); setReportName("PendingBOMChanges"); setMetaSQLOptions("pendingBOMChanges", "detail"); _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased | ItemLineEdit::cPhantom | ItemLineEdit::cKit | ItemLineEdit::cPlanning | ItemLineEdit::cTooling); _cutoff->setNullString(tr("Latest")); _cutoff->setNullDate(omfgThis->endOfTime().addDays(-1)); _cutoff->setAllowNullDate(true); _cutoff->setNull(); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "actiondate" ); list()->addColumn(tr("Action"), _itemColumn, Qt::AlignCenter, true, "action" ); list()->addColumn(tr("Seq #"), 40, Qt::AlignCenter, true, "bomitem_seqnumber" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignCenter, true, "description" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "qtyfxd" ); list()->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "qtyper" ); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomitem_scrap" ); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), SLOT(sFillList())); _revision->setMode(RevisionLineEdit::View); _revision->setType("BOM"); //If not Revision Control, hide control _revision->setVisible(_metrics->boolean("RevControl")); } void dspPendingBOMChanges::languageChange() { display::languageChange(); retranslateUi(this); } void dspPendingBOMChanges::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit BOM Item..."), this, SLOT(sEdit()));; if (!_privileges->check("MaintainBOMs")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View BOM Item..."), this, SLOT(sView()));; if ( (!_privileges->check("MaintainBOMs")) && (!_privileges->check("ViewBOMs")) ) menuItem->setEnabled(false); } void dspPendingBOMChanges::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("bomitem_id", list()->id()); bomItem newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPendingBOMChanges::sView() { ParameterList params; params.append("mode", "view"); params.append("bomitem_id", list()->id()); bomItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } bool dspPendingBOMChanges::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning( this, tr("Item Required"), tr("You must specify a valid item.")); return false; } params.append("effective", tr("Effective")); params.append("expires", tr("Expires")); params.append("item_id", _item->id()); params.append("revision_id", _revision->id()); params.append("cutOffDate", _cutoff->date()); return true; } qt-client-4.1.0/guiclient/displays/dspPendingBOMChanges.h000066400000000000000000000020121217451700100233130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPENDINGBOMCHANGES_H #define DSPPENDINGBOMCHANGES_H #include "display.h" #include "ui_dspPendingBOMChanges.h" class dspPendingBOMChanges : public display, public Ui::dspPendingBOMChanges { Q_OBJECT public: dspPendingBOMChanges(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sEdit(); virtual void sView(); protected slots: virtual void languageChange(); }; #endif // DSPPENDINGBOMCHANGES_H qt-client-4.1.0/guiclient/displays/dspPendingBOMChanges.ui000066400000000000000000000104651217451700100235140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPendingBOMChanges 0 0 515 105 Pending Bill of Materials Changes Qt::StrongFocus Qt::Vertical QSizePolicy::Expanding 20 0 Qt::StrongFocus false RevisionLineEdit::View RevisionLineEdit::BOM Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    RevisionCluster QWidget
    revisioncluster.h
    _item _revision _cutoff _item newId(int) _revision setTargetId(int) 167 43 422 25
    qt-client-4.1.0/guiclient/displays/dspPlannedOrders.cpp000066400000000000000000000222741217451700100232070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPlannedOrders.h" #include #include #include #include "guiclient.h" #include "deletePlannedOrder.h" #include "dspRunningAvailability.h" #include "dspUsageStatistics.h" #include "plannedOrder.h" #include "firmPlannedOrder.h" #include "purchaseRequest.h" #include "transferOrder.h" #include "workOrder.h" #include "parameterwidget.h" dspPlannedOrders::dspPlannedOrders(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPlannedOrders", fl) { setWindowTitle(tr("Planned Orders")); setReportName("PlannedOrders"); setMetaSQLOptions("schedule", "plannedorders"); setNewVisible(true); setUseAltId(true); setParameterWidgetVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); QString qryType = QString( "SELECT 'P', '%1' UNION " "SELECT 'W', '%2'") .arg(tr("Purchase")) .arg(tr("Manufacture")); if (_metrics->boolean("MultiWhs")) qryType.append(QString( " UNION " "SELECT 'T', '%1'") .arg(tr("Transfers"))); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->append(tr("Order Types"), "type_list", ParameterWidget::Multiselect, QVariant(), false, qryType ); parameterWidget()->appendComboBox(tr("Planner Code"), "plancode_id", XComboBox::PlannerCodes); parameterWidget()->append(tr("Planner Code Pattern"), "plancode_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->appendComboBox(tr("Item Group"), "itemgrp_id", XComboBox::ItemGroups); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "ordernum"); list()->addColumn(tr("Type"), _uomColumn, Qt::AlignCenter,true, "ordtype"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); list()->addColumn(tr("From Site"), _whsColumn, Qt::AlignCenter,true, "supply_warehous_code"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); list()->addColumn(tr("Class Code"), -1, Qt::AlignLeft, true, "f_classcode"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); list()->addColumn(tr("Start Date"), _dateColumn, Qt::AlignCenter,true, "planord_startdate"); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter,true, "planord_duedate"); list()->addColumn(tr("Qty"), _qtyColumn, Qt::AlignRight, true, "planord_qty"); list()->addColumn(tr("Firm"), _ynColumn, Qt::AlignCenter,true, "planord_firm"); if (_privileges->check("CreatePlannedOrders")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEditOrder())); else newAction()->setEnabled(false); } enum SetResponse dspPlannedOrders::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; parameterWidget()->setSavedFilters(); param = pParams.value("plancode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code"), param); param = pParams.value("warehous_id", &valid); if (valid) parameterWidget()->setDefault(tr("Site"), param); param = pParams.value("type", &valid); if (valid) { QVariantList list; list.append(param.toString()); parameterWidget()->setDefault(tr("Order Types"), list); } parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspPlannedOrders::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sDspRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); menuItem = pMenu->addAction(tr("Usage Statistics..."), this, SLOT(sDspUsageStatistics())); menuItem->setEnabled(_privileges->check("ViewInventoryHistory")); pMenu->addSeparator(); if (pSelected->text(11) == "No") { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("CreatePlannedOrders")); menuItem = pMenu->addAction(tr("Firm Order..."), this, SLOT(sFirmOrder())); menuItem->setEnabled(_privileges->check("FirmPlannedOrders")); } else { menuItem = pMenu->addAction(tr("Soften Order..."), this, SLOT(sSoftenOrder())); menuItem->setEnabled(_privileges->check("SoftenPlannedOrders")); } menuItem = pMenu->addAction(tr("Release Order..."), this, SLOT(sReleaseOrder())); if ( (!_privileges->check("ReleasePlannedOrders")) || ((pSelected->text(1) == "T/O") && (!_privileges->check("MaintainTransferOrders")) ) || ((pSelected->text(1) == "W/O") && (!_privileges->check("MaintainWorkOrders")) ) || ((pSelected->text(1) == "P/O") && (!_privileges->check("MaintainPurchaseRequests")) ) ) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Delete Order..."), this, SLOT(sDeleteOrder())); menuItem->setEnabled(_privileges->check("DeletePlannedOrders")); } void dspPlannedOrders::sDspRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->altId()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPlannedOrders::sNew() { ParameterList params; params.append("mode", "new"); plannedOrder newdlg(this, "", true); newdlg.set(params); newdlg.exec(); sFillList(); } void dspPlannedOrders::sEditOrder() { ParameterList params; params.append("mode", "edit"); params.append("planord_id", list()->id()); plannedOrder newdlg(this, "", true); newdlg.set(params); newdlg.exec(); sFillList(); } void dspPlannedOrders::sFirmOrder() { ParameterList params; params.append("planord_id", list()->id()); firmPlannedOrder newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPlannedOrders::sSoftenOrder() { XSqlQuery dspSoftenOrder; dspSoftenOrder.prepare( "UPDATE planord " "SET planord_firm=false " "WHERE (planord_id=:planord_id);" ); dspSoftenOrder.bindValue(":planord_id", list()->id()); dspSoftenOrder.exec(); sFillList(); } void dspPlannedOrders::sReleaseOrder() { if (list()->currentItem()->text(1) == "W/O") { ParameterList params; params.append("mode", "release"); params.append("planord_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (list()->currentItem()->text(1) == "P/O") { ParameterList params; params.append("mode", "release"); params.append("planord_id", list()->id()); purchaseRequest newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() == XDialog::Rejected) return; } else if (list()->currentItem()->text(1) == "T/O") { ParameterList params; params.append("mode", "releaseTO"); params.append("planord_id", list()->id()); transferOrder *newdlg = new transferOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else delete newdlg; } QTreeWidgetItem * ci = list()->currentItem(); if(ci) delete ci; } void dspPlannedOrders::sDeleteOrder() { ParameterList params; params.append("planord_id", list()->id()); deletePlannedOrder newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() == XDialog::Rejected) return; QTreeWidgetItem * ci = list()->currentItem(); if(ci) delete ci; } void dspPlannedOrders::sDspUsageStatistics() { XSqlQuery dspDspUsageStatistics; dspDspUsageStatistics.prepare("SELECT itemsite_item_id " "FROM itemsite " "WHERE (itemsite_id=:itemsite_id);"); dspDspUsageStatistics.bindValue(":itemsite_id", list()->altId()); dspDspUsageStatistics.exec(); if (dspDspUsageStatistics.first()) { ParameterList params = parameterWidget()->parameters(); params.append("item_id", dspDspUsageStatistics.value("itemsite_item_id")); params.append("run"); dspUsageStatistics *newdlg = new dspUsageStatistics(); SetResponse setresp = newdlg->set(params); if (setresp == NoError || setresp == NoError_Run) omfgThis->handleNewWindow(newdlg); } else if (dspDspUsageStatistics.lastError().type() != QSqlError::NoError) { systemError(this, dspDspUsageStatistics.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/displays/dspPlannedOrders.h000066400000000000000000000021641217451700100226500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPLANNEDORDERS_H #define DSPPLANNEDORDERS_H #include "display.h" class dspPlannedOrders : public display { Q_OBJECT public: dspPlannedOrders(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sDeleteOrder(); virtual void sDspRunningAvailability(); virtual void sDspUsageStatistics(); virtual void sNew(); virtual void sEditOrder(); virtual void sFirmOrder(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sReleaseOrder(); virtual void sSoftenOrder(); }; #endif // DSPPLANNEDORDERS_H qt-client-4.1.0/guiclient/displays/dspPoDeliveryDateVariancesByItem.cpp000066400000000000000000000056641217451700100263010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoDeliveryDateVariancesByItem.h" #include dspPoDeliveryDateVariancesByItem::dspPoDeliveryDateVariancesByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoDeliveryDateVariancesByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Order Delivery Date Variances by Item")); setListLabel(tr("Purchase Item Receipts")); setReportName("DeliveryDateVariancesByItem"); setMetaSQLOptions("poDeliveryDateVariances", "detail"); _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured); _item->setDefaultType(ItemLineEdit::cGeneralPurchased); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "recv_order_number"); list()->addColumn(tr("Vendor"), _orderColumn, Qt::AlignLeft, true, "vend_name"); list()->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "itemnumber"); list()->addColumn(tr("Vendor Description"), -1, Qt::AlignLeft, true, "itemdescrip"); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "recv_qty"); list()->addColumn(tr("Req. Due"), _dateColumn, Qt::AlignCenter,true, "release_duedate" ); list()->addColumn(tr("Req. Leadtime"), _dateColumn, Qt::AlignRight, true, "req_leadtime" ); list()->addColumn(tr("Agrd. Due"), _dateColumn, Qt::AlignCenter,true, "argd_duedate" ); list()->addColumn(tr("Agrd. Leadtime"),_dateColumn, Qt::AlignRight, true, "agrd_leadtime" ); list()->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter,true, "receivedate" ); list()->addColumn(tr("Real Leadtime"), _dateColumn, Qt::AlignRight, true, "real_leadtime" ); list()->addColumn(tr("Req. Diff"), _dateColumn, Qt::AlignRight, true, "req_diff" ); list()->addColumn(tr("Agrd. Diff"), _dateColumn, Qt::AlignRight, true, "argd_diff" ); } void dspPoDeliveryDateVariancesByItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoDeliveryDateVariancesByItem::setParams(ParameterList &pParams) { pParams.append("byItem"); pParams.append("item_id", _item->id()); _warehouse->appendValue(pParams); _dates->appendValue(pParams); if (_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); return true; } qt-client-4.1.0/guiclient/displays/dspPoDeliveryDateVariancesByItem.h000066400000000000000000000017321217451700100257360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPODELIVERYDATEVARIANCESBYITEM_H #define DSPPODELIVERYDATEVARIANCESBYITEM_H #include "display.h" #include "ui_dspPoDeliveryDateVariancesByItem.h" class dspPoDeliveryDateVariancesByItem : public display, public Ui::dspPoDeliveryDateVariancesByItem { Q_OBJECT public: dspPoDeliveryDateVariancesByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPPODELIVERYDATEVARIANCESBYITEM_H qt-client-4.1.0/guiclient/displays/dspPoDeliveryDateVariancesByItem.ui000066400000000000000000000140411217451700100261210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoDeliveryDateVariancesByItem 0 0 562 205 Purchase Order Delivery Date Variances by Item Qt::Vertical QSizePolicy::Preferred 20 0 All Purchasing Agents true Selected Purchasing Agent 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal 0 20 false Qt::Horizontal 0 20 Qt::Vertical 20 1 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _item _warehouse _dates _allPurchasingAgents _agent _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 534 58 640 82
    qt-client-4.1.0/guiclient/displays/dspPoDeliveryDateVariancesByVendor.cpp000066400000000000000000000075471217451700100266420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoDeliveryDateVariancesByVendor.h" #include #include dspPoDeliveryDateVariancesByVendor::dspPoDeliveryDateVariancesByVendor(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoDeliveryDateVariancesByVendor", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Order Delivery Date Variances by Vendor")); setListLabel(tr("Purchase Item Receipts")); setReportName("DeliveryDateVariancesByVendor"); setMetaSQLOptions("poDeliveryDateVariances", "detail"); connect(_selectedPurchasingAgent, SIGNAL(toggled(bool)), _agent, SLOT(setEnabled(bool))); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "recv_order_number" ); list()->addColumn(tr("Vendor"), _orderColumn, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "receivedate" ); list()->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "venditemnumber" ); list()->addColumn(tr("Vendor Description"), -1, Qt::AlignLeft, true, "venditemdescrip" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "recv_qty" ); list()->addColumn(tr("Req. Due"), _dateColumn, Qt::AlignCenter, true, "release_duedate" ); list()->addColumn(tr("Req. Leadtime"), _dateColumn, Qt::AlignRight, true, "req_leadtime" ); list()->addColumn(tr("Agrd. Due"), _dateColumn, Qt::AlignCenter, true, "argd_duedate" ); list()->addColumn(tr("Agrd. Leadtime"), _dateColumn, Qt::AlignRight, true, "agrd_leadtime" ); list()->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter, true, "receivedate" ); list()->addColumn(tr("Real Leadtime"), _dateColumn, Qt::AlignRight, true, "real_leadtime" ); list()->addColumn(tr("Req. Diff"), _dateColumn, Qt::AlignRight, true, "req_diff" ); list()->addColumn(tr("Agrd. Diff"), _dateColumn, Qt::AlignRight, true, "argd_diff" ); } void dspPoDeliveryDateVariancesByVendor::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoDeliveryDateVariancesByVendor::setParams(ParameterList ¶ms) { if (!_vendor->isValid()) { QMessageBox::warning(this, tr("Vendor Required"), tr("You must specify a Vendor.")); return false; } if (!_dates->startDate().isValid()) { if (isVisible()) { QMessageBox::warning( this, tr("Enter Start Date"), tr("Please enter a valid Start Date.") ); _dates->setFocus(); } return false; } else if (!_dates->endDate().isValid()) { if (isVisible()) { QMessageBox::warning( this, tr("Enter End Date"), tr("Please enter a valid End Date.") ); _dates->setFocus(); } return false; } params.append("vend_id", _vendor->id()); params.append("username", _agent->currentText()); // metasql only? _dates->appendValue(params); _warehouse->appendValue(params); if (_selectedPurchasingAgent->isChecked()) params.append("agentUsername", _agent->currentText()); // report only? params.append("byVendor"); // metasql only? return true; } qt-client-4.1.0/guiclient/displays/dspPoDeliveryDateVariancesByVendor.h000066400000000000000000000017501217451700100262750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPODELIVERYDATEVARIANCESBYVENDOR_H #define DSPPODELIVERYDATEVARIANCESBYVENDOR_H #include "display.h" #include "ui_dspPoDeliveryDateVariancesByVendor.h" class dspPoDeliveryDateVariancesByVendor : public display, public Ui::dspPoDeliveryDateVariancesByVendor { Q_OBJECT public: dspPoDeliveryDateVariancesByVendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPPODELIVERYDATEVARIANCESBYVENDOR_H qt-client-4.1.0/guiclient/displays/dspPoDeliveryDateVariancesByVendor.ui000066400000000000000000000150111217451700100264560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoDeliveryDateVariancesByVendor 0 0 550 233 Purchase Order Delivery Date Variances by Vendor 0 Vendor: Qt::Vertical 20 0 All Purchasing Agents true Selected Purchasing Agent false 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 false Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 50 DateCluster QWidget
    datecluster.h
    VendorCluster QWidget
    vendorcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _vendor _warehouse _dates _allPurchasingAgents _agent _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 515 58 621 82
    qt-client-4.1.0/guiclient/displays/dspPoHistory.cpp000066400000000000000000000050601217451700100224010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoHistory.h" #include #include #include #include "copyPurchaseOrder.h" dspPoHistory::dspPoHistory(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoHistory", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Order History")); setListLabel(tr("P/O Items")); setReportName("POHistory"); setMetaSQLOptions("poHistory", "detail"); setUseAltId(true); list()->addColumn(tr("#"), _whsColumn, Qt::AlignCenter, true, "poitem_linenumber"); list()->addColumn(tr("Item/Doc. #"), _itemColumn, Qt::AlignLeft, true, "itemnumber"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uomname"); list()->addColumn(tr("Due/Recvd."), _dateColumn, Qt::AlignCenter, true, "poitem_duedate"); list()->addColumn(tr("Vend. Item #"), -1, Qt::AlignLeft, true, "poitem_vend_item_number"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "poitem_vend_uom"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered"); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_received"); list()->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_returned"); } void dspPoHistory::languageChange() { display::languageChange(); retranslateUi(this); } void dspPoHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { pMenu->addAction(tr("Copy P/O..."), this, SLOT(sCopy())); } void dspPoHistory::sCopy() { ParameterList params; params.append("pohead_id", _po->id()); copyPurchaseOrder newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } bool dspPoHistory::setParams(ParameterList ¶ms) { if(!_po->isValid()) { QMessageBox::warning(this, tr("P/O Required"), tr("You must specify a P/O Number.")); return false; } params.append("nonInventory", tr("Non-Inventory")); params.append("na", tr("N/A")); params.append("pohead_id", _po->id()); return true; } qt-client-4.1.0/guiclient/displays/dspPoHistory.h000066400000000000000000000016661217451700100220560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOHISTORY_H #define DSPPOHISTORY_H #include "display.h" #include "ui_dspPoHistory.h" class dspPoHistory : public display, public Ui::dspPoHistory { Q_OBJECT public: dspPoHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*, int); virtual void sCopy(); protected slots: virtual void languageChange(); }; #endif // DSPPOHISTORY_H qt-client-4.1.0/guiclient/displays/dspPoHistory.ui000066400000000000000000000044221217451700100222350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoHistory 0 0 253 94 Purchase Order History 0 OrderLineEdit::Closed|OrderLineEdit::Open OrderLineEdit::Purchase Qt::Vertical QSizePolicy::Preferred 20 0 Qt::Horizontal QSizePolicy::Expanding 2 20 OrderCluster QWidget
    ordercluster.h
    qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByDate.cpp000066400000000000000000000065231217451700100247530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoItemReceivingsByDate.h" #include #include #include "guiclient.h" #include "xtreewidget.h" dspPoItemReceivingsByDate::dspPoItemReceivingsByDate(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoItemReceivingsByDate", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Receipts and Returns by Date")); setListLabel(tr("Purchase Order &Receipts and Returns")); setReportName("ReceiptsReturnsByDate"); setMetaSQLOptions("receivings", "detail"); connect(_showVariances, SIGNAL(toggled(bool)), this, SLOT(sHandleVariance(bool))); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "ponumber"); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name"); list()->addColumn(tr("Sched. Date"), _dateColumn, Qt::AlignCenter,true, "duedate"); list()->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter,true, "recvdate"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "venditemnumber"); list()->addColumn(tr("Rcvd/Rtnd"), _qtyColumn, Qt::AlignRight, true, "sense"); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qty"); if (_privileges->check("ViewCosts")) { list()->addColumn(tr("Purch. Cost"),_priceColumn, Qt::AlignRight,true, "purchcost"); list()->addColumn(tr("Recv. Cost"), _priceColumn, Qt::AlignRight,true, "recvcost"); list()->addColumn(tr("Value"), _priceColumn, Qt::AlignRight,true, "value"); } _showVariances->setEnabled(_privileges->check("ViewCosts")); sHandleVariance(_showVariances->isChecked()); } void dspPoItemReceivingsByDate::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoItemReceivingsByDate::setParams(ParameterList &pParams) { if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter Valid Dates"), tr( "Please enter a valid Start and End Date." ) ); _dates->setFocus(); return false; } _warehouse->appendValue(pParams); _dates->appendValue(pParams); pParams.append("received", tr("Received")); pParams.append("returned", tr("Returned")); pParams.append("unvouchered", tr("Not Vouchered")); pParams.append("nonInv", tr("NonInv - ")); pParams.append("na", tr("N/A")); if (_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); if (_showVariances->isChecked()) pParams.append("showVariances"); if (_showUnvouchered->isChecked()) pParams.append("showUnvouchered"); return true; } void dspPoItemReceivingsByDate::sHandleVariance(bool pShowVariances) { if (pShowVariances) { list()->showColumn(7); list()->showColumn(8); list()->showColumn(9); } else { list()->hideColumn(7); list()->hideColumn(8); list()->hideColumn(9); } } qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByDate.h000066400000000000000000000017601217451700100244160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOITEMRECEIVINGSBYDATE_H #define DSPPOITEMRECEIVINGSBYDATE_H #include "display.h" #include "ui_dspPoItemReceivingsByDate.h" class dspPoItemReceivingsByDate : public display, public Ui::dspPoItemReceivingsByDate { Q_OBJECT public: dspPoItemReceivingsByDate(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual void sHandleVariance( bool pShowVariances ); protected slots: virtual void languageChange(); }; #endif // DSPPOITEMRECEIVINGSBYDATE_H qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByDate.ui000066400000000000000000000143061217451700100246040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoItemReceivingsByDate 0 0 497 188 Receipts and Returns by Date 0 0 0 All Purchasing Agents true Selected Purchasing Agent 5 true Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Show Costs Unvouchered Qt::Vertical 20 0 Qt::Horizontal 0 20 DateCluster QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _dates _warehouse _allPurchasingAgents _agent _showVariances _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByItem.cpp000066400000000000000000000074521217451700100247760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoItemReceivingsByItem.h" #include #include #include "guiclient.h" dspPoItemReceivingsByItem::dspPoItemReceivingsByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoItemReceivingsByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Receipts and Returns by Item")); setListLabel(tr("Purchase &Receipts and Returns:")); setReportName("ReceiptsReturnsByItem"); setMetaSQLOptions("receivings", "detail"); connect(_showVariances, SIGNAL(toggled(bool)), this, SLOT(sHandleVariance(bool))); _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured); _item->setDefaultType(ItemLineEdit::cGeneralPurchased); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); _showVariances->setEnabled(_privileges->check("ViewCosts")); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "ponumber"); list()->addColumn(tr("Vendor"), 120, Qt::AlignLeft, true, "vend_name"); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter,true, "duedate"); list()->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter,true, "recvdate"); list()->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "venditemnumber"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "venditemdescrip"); list()->addColumn(tr("Rcvd/Rtnd"), _qtyColumn, Qt::AlignRight, true, "sense"); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qty"); if (_privileges->check("ViewCosts")) { list()->addColumn(tr("Purch. Cost"),_priceColumn, Qt::AlignRight,true, "purchcost"); list()->addColumn(tr("Recv. Cost"), _priceColumn, Qt::AlignRight,true, "recvcost"); list()->addColumn(tr("Value"), _priceColumn, Qt::AlignRight,true, "value"); } sHandleVariance(_showVariances->isChecked()); } void dspPoItemReceivingsByItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoItemReceivingsByItem::setParams(ParameterList &pParams) { if (!_item->isValid()) { QMessageBox::warning( this, tr("Enter Item Number"), tr( "Please enter a valid Item Number." ) ); _item->setFocus(); return false; } if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter Valid Dates"), tr( "Please enter a valid Start and End Date." ) ); _dates->setFocus(); return false; } _warehouse->appendValue(pParams); _dates->appendValue(pParams); pParams.append("item_id", _item->id() ); pParams.append("received", tr("Received")); pParams.append("returned", tr("Returned")); pParams.append("unvouchered", tr("Not Vouchered")); pParams.append("nonInv", tr("NonInv - ")); pParams.append("na", tr("N/A")); if (_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); if (_showVariances->isChecked()) pParams.append("showVariances"); if (_showUnvouchered->isChecked()) pParams.append("showUnvouchered"); return true; } void dspPoItemReceivingsByItem::sHandleVariance(bool pShowVariances) { if (pShowVariances) { list()->showColumn(8); list()->showColumn(9); list()->showColumn(10); } else { list()->hideColumn(8); list()->hideColumn(9); list()->hideColumn(10); } } qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByItem.h000066400000000000000000000017611217451700100244400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOITEMRECEIVINGSBYITEM_H #define DSPPOITEMRECEIVINGSBYITEM_H #include "display.h" #include "ui_dspPoItemReceivingsByItem.h" class dspPoItemReceivingsByItem : public display, public Ui::dspPoItemReceivingsByItem { Q_OBJECT public: dspPoItemReceivingsByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sHandleVariance( bool pShowVariances ); protected slots: virtual void languageChange(); }; #endif // DSPPOITEMRECEIVINGSBYITEM_H qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByItem.ui000066400000000000000000000155571217451700100246360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoItemReceivingsByItem 0 0 572 277 Receipts and Returns by Item 0 0 All Purchasing Agents true Selected Purchasing Agent 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Qt::Horizontal 0 20 Show Costs Unvouchered Qt::Horizontal 0 20 Qt::Vertical 20 0 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _item _dates _warehouse _allPurchasingAgents _agent _showVariances _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByVendor.cpp000066400000000000000000000167671217451700100253460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoItemReceivingsByVendor.h" #include #include #include #include #include "enterPoitemReceipt.h" #include "guiclient.h" #include "poLiabilityDistrib.h" #include "voucher.h" dspPoItemReceivingsByVendor::dspPoItemReceivingsByVendor(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoItemReceivingsByVendor", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Receipts and Returns by Vendor")); setListLabel(tr("Purchase Order &Receipts and Returns")); setReportName("ReceiptsReturnsByVendor"); setMetaSQLOptions("receivings", "detail"); setUseAltId(true); connect(_showVariances, SIGNAL(toggled(bool)), this, SLOT(sHandleVariance(bool))); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "ponumber"); list()->addColumn(tr("Sched. Date"), _dateColumn, Qt::AlignCenter,true, "duedate"); list()->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter,true, "recvdate"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "venditemnumber"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "venditemdescrip"); list()->addColumn(tr("Rcvd/Rtnd"), _qtyColumn, Qt::AlignRight, true, "sense"); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qty"); list()->addColumn(tr("Invoiced"), _ynColumn, Qt::AlignRight, false,"invoiced"); if (_privileges->check("ViewCosts")) { list()->addColumn(tr("Purch. Cost"),_priceColumn, Qt::AlignRight,true, "purchcost"); list()->addColumn(tr("Recv. Cost"), _priceColumn, Qt::AlignRight,true, "recvcost"); list()->addColumn(tr("Value"), _priceColumn, Qt::AlignRight,true, "value"); } _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _showVariances->setEnabled(_privileges->check("ViewCosts")); sHandleVariance(_showVariances->isChecked()); } void dspPoItemReceivingsByVendor::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoItemReceivingsByVendor::setParams(ParameterList &pParams) { if (!_vendor->isValid() && _vendor->isVisible()) { QMessageBox::warning( this, tr("Enter Vendor Number"), tr( "Please enter a valid Vendor Number." ) ); _vendor->setFocus(); return false; } if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter Valid Dates"), tr( "Please enter a valid Start and End Date." ) ); _dates->setFocus(); return false; } _warehouse->appendValue(pParams); _dates->appendValue(pParams); pParams.append("vend_id", _vendor->id()); if (_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); if (_showVariances->isChecked()) pParams.append("showVariances"); if (_showUnvouchered->isChecked()) pParams.append("showUnvouchered"); pParams.append("received", tr("Received")); pParams.append("returned", tr("Returned")); pParams.append("unvouchered", tr("Not Vouchered")); pParams.append("nonInv", tr("NonInv - ")); pParams.append("na", tr("N/A")); return true; } void dspPoItemReceivingsByVendor::sPopulateMenu(QMenu *menu, QTreeWidgetItem *, int) { QAction *markInvoiced = 0; QAction *correctReceipt = 0; QAction *createVoucher = 0; switch (list()->altId()) { case 1: // id = recv_id markInvoiced = new QAction(tr("Mark As Invoiced..."), this); correctReceipt = new QAction(tr("Correct Receiving..."), this); markInvoiced->setEnabled(_privileges->check("MaintainUninvoicedReceipts") && ! list()->currentItem()->rawValue("invoiced").isNull() && ! list()->currentItem()->rawValue("invoiced").toBool()); correctReceipt->setEnabled(_privileges->check("MaintainUninvoicedReceipts")); connect(markInvoiced, SIGNAL(triggered()), this, SLOT(sMarkAsInvoiced())); connect(correctReceipt, SIGNAL(triggered()), this, SLOT(sCorrectReceiving())); menu->addAction(markInvoiced); menu->addAction(correctReceipt); break; case 2: // id = poreject_id break; case 3: // id = unvouchered pohead_id createVoucher = new QAction(tr("Create Voucher..."), this); createVoucher->setEnabled(_privileges->check("MaintainVouchers")); connect(createVoucher, SIGNAL(triggered()), this, SLOT(sCreateVoucher())); menu->addAction(createVoucher); break; default: break; } } void dspPoItemReceivingsByVendor::sHandleVariance(bool pShowVariances) { if (pShowVariances) { list()->showColumn("purchcost"); list()->showColumn("recvcost"); list()->showColumn("value"); } else { list()->hideColumn("purchcost"); list()->hideColumn("recvcost"); list()->hideColumn("value"); } } void dspPoItemReceivingsByVendor::sCorrectReceiving() { if (enterPoitemReceipt::correctReceipt(list()->id(), this) != XDialog::Rejected) sFillList(); } void dspPoItemReceivingsByVendor::sCreateVoucher() { ParameterList params; params.append("mode", "new"); params.append("pohead_id", list()->id()); voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPoItemReceivingsByVendor::sMarkAsInvoiced() { XSqlQuery dspMarkAsInvoiced; if (list()->currentItem()->rawValue("invoiced").toBool() || list()->currentItem()->rawValue("invoiced").isNull()) return; bool update = true; if (recvHasValue()) { ParameterList params; params.append("recv_id", list()->id()); poLiabilityDistrib newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() == XDialog::Rejected) update = false; } else if (dspMarkAsInvoiced.lastError().type() != QSqlError::NoError) { systemError(this, dspMarkAsInvoiced.lastError().databaseText(), __FILE__, __LINE__); return; } if (update) { dspMarkAsInvoiced.prepare("UPDATE recv " "SET recv_invoiced=true " "WHERE (recv_id=:recv_id); "); dspMarkAsInvoiced.bindValue(":recv_id",list()->id()); dspMarkAsInvoiced.exec(); if (dspMarkAsInvoiced.lastError().type() != QSqlError::NoError) { systemError(this, dspMarkAsInvoiced.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } bool dspPoItemReceivingsByVendor::recvHasValue() { bool hasValue = false; if (_privileges->check("ViewCosts")) hasValue = list()->currentItem()->rawValue("value").toDouble() != 0; else { XSqlQuery valq; valq.prepare("SELECT * " "FROM recv " "WHERE ((recv_value <> 0)" " AND (recv_id=:recv_id));"); valq.bindValue(":recv_id",list()->id()); valq.exec(); if (valq.first()) hasValue = true; else if (valq.lastError().type() != QSqlError::NoError) { systemError(this, valq.lastError().databaseText(), __FILE__, __LINE__); return false; } } return hasValue; } qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByVendor.h000066400000000000000000000023241217451700100247730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOITEMRECEIVINGSBYVENDOR_H #define DSPPOITEMRECEIVINGSBYVENDOR_H #include "display.h" #include "ui_dspPoItemReceivingsByVendor.h" class dspPoItemReceivingsByVendor : public display, public Ui::dspPoItemReceivingsByVendor { Q_OBJECT public: dspPoItemReceivingsByVendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual void sCorrectReceiving(); virtual void sCreateVoucher(); virtual void sHandleVariance( bool pShowVariances ); virtual void sMarkAsInvoiced(); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*, int); protected slots: virtual void languageChange(); private: virtual bool recvHasValue(); }; #endif // DSPPOITEMRECEIVINGSBYVENDOR_H qt-client-4.1.0/guiclient/displays/dspPoItemReceivingsByVendor.ui000066400000000000000000000154501217451700100251650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoItemReceivingsByVendor 0 0 660 232 Receipts and Returns by Vendor Vendor#: All Purchasing Agents true Selected: false 0 0 false Show Unvouchered Costs Qt::Vertical 20 1 Qt::Horizontal 0 20 DateCluster QWidget
    datecluster.h
    VendorCluster QWidget
    vendorcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _allPurchasingAgents _selectedPurchasingAgent _agent _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoItemsByDate.cpp000066400000000000000000000217271217451700100231220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoItemsByDate.h" #include #include #include #include #include #include #include #include #include "changePoitemQty.h" #include "dspRunningAvailability.h" #include "purchaseOrder.h" #include "purchaseOrderItem.h" #include "reschedulePoitem.h" dspPoItemsByDate::dspPoItemsByDate(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoItemsByDate", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Order Items by Date")); setListLabel(tr("Purchase Order Items")); setReportName("POLineItemsByDate"); setMetaSQLOptions("poItems", "detail"); setUseAltId(true); connect(_selectedPurchasingAgent, SIGNAL(toggled(bool)), _agent, SLOT(setEnabled(bool))); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Due Date:")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Due Date:")); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "pohead_number" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Status"), 0, Qt::AlignCenter, true, "poitem_status" ); list()->addColumn(tr("Status"), _dateColumn, Qt::AlignCenter, true, "f_poitem_status" ); list()->addColumn(tr("Vendor"), _itemColumn, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "poitem_duedate" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "itemnumber" ); list()->addColumn(tr("Description"), _itemColumn, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "poitem_vend_item_number"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "itemuom" ); list()->addColumn(tr("Vend. UOM"), _uomColumn, Qt::AlignCenter, true, "poitem_vend_uom" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_received" ); list()->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_returned" ); } void dspPoItemsByDate::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoItemsByDate::setParams(ParameterList ¶ms) { if (!_dates->startDate().isValid()) { QMessageBox::warning( this, tr("Enter Start Date"), tr( "Please enter a valid Start Date." ) ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::warning( this, tr("Enter End Date"), tr( "Please eneter a valid End Date." ) ); _dates->setFocus(); return false; } params.append("byDate"); _warehouse->appendValue(params); _dates->appendValue(params); if (_selectedPurchasingAgent->isChecked()) params.append("agentUsername", _agent->currentText()); if (_openItems->isChecked()) params.append("openItems"); else if (_closedItems->isChecked()) params.append("closedItems"); params.append("nonInv", tr("NonInv - ")); params.append("closed", tr("Closed")); params.append("unposted", tr("Unposted")); params.append("partial", tr("Partial")); params.append("received", tr("Received")); params.append("open", tr("Open")); return true; } void dspPoItemsByDate::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; XTreeWidgetItem *item = dynamic_cast(pSelected); if (item && item->rawValue("poitem_status") == "U") { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); pMenu->addSeparator(); if (item && item->rawValue("poitem_status") == "U") { menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Item..."), this, SLOT(sViewItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); if (item && item->rawValue("poitem_status") != "C") { menuItem = pMenu->addAction(tr("Reschedule..."), this, SLOT(sReschedule())); menuItem->setEnabled(_privileges->check("ReschedulePurchaseOrders")); menuItem = pMenu->addAction(tr("Change Qty..."), this, SLOT(sChangeQty())); menuItem->setEnabled(_privileges->check("ChangePurchaseOrderQty")); pMenu->addSeparator(); } if (item && item->rawValue("poitem_status") == "O") { menuItem = pMenu->addAction(tr("Close Item..."), this, SLOT(sCloseItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } else if (item && item->rawValue("poitem_status") == "C") { menuItem = pMenu->addAction(tr("Open Item..."), this, SLOT(sOpenItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } } void dspPoItemsByDate::sRunningAvailability() { XSqlQuery availq; availq.prepare("SELECT poitem_itemsite_id" " FROM poitem" " WHERE (poitem_id=:poitemid); "); availq.bindValue(":poitemid", list()->altId()); availq.exec(); if (availq.first()) { ParameterList params; params.append("itemsite_id", availq.value("poitem_itemsite_id").toInt()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (availq.lastError().type() != QSqlError::NoError) { systemError(this, availq.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspPoItemsByDate::sEditOrder() { ParameterList params; params.append("mode", "edit"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPoItemsByDate::sViewOrder() { ParameterList params; params.append("mode", "view"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPoItemsByDate::sEditItem() { ParameterList params; params.append("mode", "edit"); params.append("poitem_id", list()->altId()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspPoItemsByDate::sViewItem() { ParameterList params; params.append("mode", "view"); params.append("poitem_id", list()->altId()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspPoItemsByDate::sReschedule() { ParameterList params; params.append("poitem_id", list()->altId()); reschedulePoitem newdlg(this, "", true); if(newdlg.set(params) != UndefinedError) if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPoItemsByDate::sChangeQty() { ParameterList params; params.append("poitem_id", list()->altId()); changePoitemQty newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPoItemsByDate::sCloseItem() { XSqlQuery closeq; closeq.prepare("UPDATE poitem" " SET poitem_status='C' " " WHERE (poitem_id=:poitem_id);" ); closeq.bindValue(":poitem_id", list()->altId()); closeq.exec(); if (closeq.lastError().type() != QSqlError::NoError) { systemError(this, closeq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspPoItemsByDate::sOpenItem() { XSqlQuery openq; openq.prepare("UPDATE poitem" " SET poitem_status='O'" " WHERE (poitem_id=:poitem_id);" ); openq.bindValue(":poitem_id", list()->altId()); openq.exec(); if (openq.lastError().type() != QSqlError::NoError) { systemError(this, openq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } qt-client-4.1.0/guiclient/displays/dspPoItemsByDate.h000066400000000000000000000023561217451700100225640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOITEMSBYDATE_H #define DSPPOITEMSBYDATE_H #include "display.h" #include "ui_dspPoItemsByDate.h" class dspPoItemsByDate : public display, public Ui::dspPoItemsByDate { Q_OBJECT public: dspPoItemsByDate(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); public slots: virtual void sPopulateMenu(QMenu *pMenu, QTreeWidgetItem * pSelected, int); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sEditItem(); virtual void sViewItem(); virtual void sReschedule(); virtual void sChangeQty(); virtual void sCloseItem(); virtual void sOpenItem(); virtual void sRunningAvailability(); protected slots: virtual void languageChange(); }; #endif // DSPPOITEMSBYDATE_H qt-client-4.1.0/guiclient/displays/dspPoItemsByDate.ui000066400000000000000000000153501217451700100227500ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoItemsByDate 0 0 497 219 Purchase Order Items by Date 0 0 0 All Purchasing Agents true Selected Purchasing Agent 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 XComboBox::Agent false All Items true Open Items Closed Items Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 4 DateCluster QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _dates _warehouse _allPurchasingAgents _agent _allItems _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoItemsByItem.cpp000066400000000000000000000221251217451700100231340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoItemsByItem.h" #include #include #include #include #include #include "guiclient.h" #include "changePoitemQty.h" #include "dspRunningAvailability.h" #include "purchaseOrder.h" #include "purchaseOrderItem.h" #include "reschedulePoitem.h" dspPoItemsByItem::dspPoItemsByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoItemsByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Order Items by Item")); setListLabel(tr("Purchase Order Items")); setReportName("POLineItemsByItem"); setMetaSQLOptions("poItems", "detail"); setUseAltId(true); _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured); _item->setDefaultType(ItemLineEdit::cGeneralPurchased); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "pohead_number" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Status"), 0, Qt::AlignCenter, true, "poitem_status" ); list()->addColumn(tr("Status"), _dateColumn, Qt::AlignCenter, true, "f_poitem_status" ); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "poitem_duedate" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "itemuom" ); list()->addColumn(tr("Vend. UOM"), _uomColumn, Qt::AlignCenter, true, "poitem_vend_uom" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_received" ); list()->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_returned" ); } void dspPoItemsByItem::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspPoItemsByItem::set(const ParameterList &pParams) { XSqlQuery dspet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); param = pParams.value("itemsrc_id", &valid); if (valid) { dspet.prepare( "SELECT itemsrc_item_id " "FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); dspet.bindValue(":itemsrc_id", param.toInt()); dspet.exec(); if (dspet.first()) _item->setId(dspet.value("itemsrc_item_id").toInt()); else if (dspet.lastError().type() != QSqlError::NoError) { systemError(this, dspet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspPoItemsByItem::setParams(ParameterList ¶ms) { if (!_item->isValid()) { QMessageBox::warning( this, tr("Enter Item Number"), tr( "Please enter a valid Item Number." ) ); _item->setFocus(); return false; } params.append("byItem"); params.append("item_id", _item->id() ); _warehouse->appendValue(params); if (_selectedPurchasingAgent->isChecked()) params.append("agentUsername", _agent->currentText()); if (_closedItems->isChecked()) params.append("closedItems"); else if (_openItems->isChecked()) params.append("openItems"); params.append("closed", tr("Closed")); params.append("unposted", tr("Unposted")); params.append("partial", tr("Partial")); params.append("received", tr("Received")); params.append("open", tr("Open")); return true; } void dspPoItemsByItem::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; XTreeWidgetItem *item = dynamic_cast(pSelected); if (item && item->rawValue("poitem_status") == "U") { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); pMenu->addSeparator(); if (item && item->rawValue("poitem_status") == "U") { menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Item..."), this, SLOT(sViewItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); if (item && item->rawValue("poitem_status") != "C") { menuItem = pMenu->addAction(tr("Reschedule..."), this, SLOT(sReschedule())); menuItem->setEnabled(_privileges->check("ReschedulePurchaseOrders")); menuItem = pMenu->addAction(tr("Change Qty..."), this, SLOT(sChangeQty())); menuItem->setEnabled(_privileges->check("ChangePurchaseOrderQty")); pMenu->addSeparator(); } if (item && item->rawValue("poitem_status") == "O") { menuItem = pMenu->addAction(tr("Close Item..."), this, SLOT(sCloseItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } else if (item && item->rawValue("poitem_status") == "C") { menuItem = pMenu->addAction(tr("Open Item..."), this, SLOT(sOpenItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } } void dspPoItemsByItem::sRunningAvailability() { XSqlQuery dspRA; dspRA.prepare("SELECT poitem_itemsite_id " "FROM poitem " "WHERE (poitem_id=:poitemid); "); dspRA.bindValue(":poitemid", list()->altId()); dspRA.exec(); if (dspRA.first()) { ParameterList params; params.append("itemsite_id", dspRA.value("poitem_itemsite_id").toInt()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (dspRA.lastError().type() != QSqlError::NoError) { systemError(this, dspRA.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspPoItemsByItem::sEditOrder() { ParameterList params; params.append("mode", "edit"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPoItemsByItem::sViewOrder() { ParameterList params; params.append("mode", "view"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPoItemsByItem::sEditItem() { ParameterList params; params.append("mode", "edit"); params.append("poitem_id", list()->altId()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspPoItemsByItem::sViewItem() { ParameterList params; params.append("mode", "view"); params.append("poitem_id", list()->altId()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspPoItemsByItem::sReschedule() { ParameterList params; params.append("poitem_id", list()->altId()); reschedulePoitem newdlg(this, "", true); if(newdlg.set(params) != UndefinedError) if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPoItemsByItem::sChangeQty() { ParameterList params; params.append("poitem_id", list()->altId()); changePoitemQty newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPoItemsByItem::sCloseItem() { XSqlQuery dspCloseItem; dspCloseItem.prepare( "UPDATE poitem " "SET poitem_status='C' " "WHERE (poitem_id=:poitem_id);" ); dspCloseItem.bindValue(":poitem_id", list()->altId()); dspCloseItem.exec(); if (dspCloseItem.lastError().type() != QSqlError::NoError) { systemError(this, dspCloseItem.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspPoItemsByItem::sOpenItem() { XSqlQuery dspOpenItem; dspOpenItem.prepare( "UPDATE poitem " "SET poitem_status='O' " "WHERE (poitem_id=:poitem_id);" ); dspOpenItem.bindValue(":poitem_id", list()->altId()); dspOpenItem.exec(); if (dspOpenItem.lastError().type() != QSqlError::NoError) { systemError(this, dspOpenItem.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } qt-client-4.1.0/guiclient/displays/dspPoItemsByItem.h000066400000000000000000000025011217451700100225750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOITEMSBYITEM_H #define DSPPOITEMSBYITEM_H #include "guiclient.h" #include "display.h" #include "ui_dspPoItemsByItem.h" class dspPoItemsByItem : public display, public Ui::dspPoItemsByItem { Q_OBJECT public: dspPoItemsByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sEditItem(); virtual void sViewItem(); virtual void sReschedule(); virtual void sChangeQty(); virtual void sCloseItem(); virtual void sOpenItem(); virtual void sRunningAvailability(); protected slots: virtual void languageChange(); }; #endif // DSPPOITEMSBYITEM_H qt-client-4.1.0/guiclient/displays/dspPoItemsByItem.ui000066400000000000000000000157251217451700100227770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoItemsByItem 0 0 508 213 Purchase Order Items by Item 0 Qt::StrongFocus All Purchasing Agents true 5 Selected: false 0 0 XComboBox::Agent Qt::StrongFocus false All Items true Open Items Closed Items Qt::Horizontal 0 20 Qt::Vertical 20 17 ItemCluster QWidget
    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _item _warehouse _selectedPurchasingAgent _agent _allItems _openItems _closedItems _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20 _item newId(int) _warehouse findItemSites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoItemsByVendor.cpp000066400000000000000000000253621217451700100235010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoItemsByVendor.h" #include #include #include #include #include #include "guiclient.h" #include "purchaseOrder.h" #include "purchaseOrderItem.h" #include "reschedulePoitem.h" #include "changePoitemQty.h" #include "dspRunningAvailability.h" dspPoItemsByVendor::dspPoItemsByVendor(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoItemsByVendor", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Order Items by Vendor")); setListLabel(tr("Purchase Order Items")); setReportName("POLineItemsByVendor"); setMetaSQLOptions("poItems", "detail"); setUseAltId(true); connect(_vendor, SIGNAL(updated()), this, SLOT(sPopulatePo())); connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); connect(_next, SIGNAL(clicked()), this, SLOT(sSearchNext())); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "pohead_number" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Status"), 0, Qt::AlignCenter, true, "poitem_status" ); list()->addColumn(tr("Status"), _dateColumn, Qt::AlignCenter, true, "f_poitem_status" ); list()->addColumn(tr("Vendor"), _itemColumn, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "poitem_duedate" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "itemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "poitem_vend_item_number"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "itemuom" ); list()->addColumn(tr("Vend. UOM"), _uomColumn, Qt::AlignCenter, true, "poitem_vend_uom" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_received" ); list()->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_returned" ); } void dspPoItemsByVendor::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoItemsByVendor::setParams(ParameterList & params) { if (!_vendor->isValid()) { QMessageBox::warning( this, tr("Enter Vendor Number"), tr( "Please enter a valid Vendor Number." ) ); _vendor->setFocus(); return false; } params.append("byVendor"); _warehouse->appendValue(params); _vendor->appendValue(params); if (_selectedPurchasingAgent->isChecked()) params.append("agentUsername", _agent->currentText()); if (_selectedPO->isChecked()) params.append("poNumber", _poNumber->currentText()); if (_closedItems->isChecked()) params.append("closedItems"); else if (_openItems->isChecked()) params.append("openItems"); params.append("nonInv", tr("Non Inventory")); params.append("closed", tr("Closed")); params.append("unposted", tr("Unposted")); params.append("partial", tr("Partial")); params.append("received", tr("Received")); params.append("open", tr("Open")); return true; } void dspPoItemsByVendor::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; XTreeWidgetItem *item = dynamic_cast(pSelected); if (item && item->rawValue("poitem_status") == "U") { menuItem = pMenu->addAction(tr("Edit Order..."), this, SLOT(sEditOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Order..."), this, SLOT(sViewOrder())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); pMenu->addSeparator(); if (item && item->rawValue("poitem_status") == "U") { menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } menuItem = pMenu->addAction(tr("View Item..."), this, SLOT(sViewItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders") || _privileges->check("ViewPurchaseOrders")); if (item && item->rawValue("poitem_status") != "C") { menuItem = pMenu->addAction(tr("Reschedule..."), this, SLOT(sReschedule())); menuItem->setEnabled(_privileges->check("ReschedulePurchaseOrders")); menuItem = pMenu->addAction(tr("Change Qty..."), this, SLOT(sChangeQty())); menuItem->setEnabled(_privileges->check("ChangePurchaseOrderQty")); pMenu->addSeparator(); } if (item && item->rawValue("poitem_status") == "O") { menuItem = pMenu->addAction(tr("Close Item..."), this, SLOT(sCloseItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } else if (item && item->rawValue("poitem_status") == "C") { menuItem = pMenu->addAction(tr("Open Item..."), this, SLOT(sOpenItem())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } } void dspPoItemsByVendor::sRunningAvailability() { XSqlQuery raq; raq.prepare("SELECT poitem_itemsite_id " "FROM poitem " "WHERE (poitem_id=:poitemid); "); raq.bindValue(":poitemid", list()->altId()); raq.exec(); if (raq.first()) { ParameterList params; params.append("itemsite_id", raq.value("poitem_itemsite_id").toInt()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (raq.lastError().type() != QSqlError::NoError) { systemError(this, raq.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspPoItemsByVendor::sEditOrder() { ParameterList params; params.append("mode", "edit"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPoItemsByVendor::sViewOrder() { ParameterList params; params.append("mode", "view"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPoItemsByVendor::sEditItem() { ParameterList params; params.append("mode", "edit"); params.append("poitem_id", list()->altId()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspPoItemsByVendor::sViewItem() { ParameterList params; params.append("mode", "view"); params.append("poitem_id", list()->altId()); purchaseOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspPoItemsByVendor::sReschedule() { ParameterList params; params.append("poitem_id", list()->altId()); reschedulePoitem newdlg(this, "", true); if(newdlg.set(params) != UndefinedError) if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPoItemsByVendor::sChangeQty() { ParameterList params; params.append("poitem_id", list()->altId()); changePoitemQty newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspPoItemsByVendor::sCloseItem() { XSqlQuery closeq; closeq.prepare("UPDATE poitem " "SET poitem_status='C' " "WHERE (poitem_id=:poitem_id);" ); closeq.bindValue(":poitem_id", list()->altId()); closeq.exec(); if (closeq.lastError().type() != QSqlError::NoError) { systemError(this, closeq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspPoItemsByVendor::sOpenItem() { XSqlQuery openq; openq.prepare( "UPDATE poitem " "SET poitem_status='O' " "WHERE (poitem_id=:poitem_id);" ); openq.bindValue(":poitem_id", list()->altId()); openq.exec(); if (openq.lastError().type() != QSqlError::NoError) { systemError(this, openq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspPoItemsByVendor::sPopulatePo() { _poNumber->clear(); if (_vendor->isSelectedVend()) { XSqlQuery poq; poq.prepare( "SELECT pohead_id, pohead_number " "FROM pohead " "WHERE ( (pohead_vend_id=:vend_id) ) " "ORDER BY pohead_number;" ); poq.bindValue(":vend_id", _vendor->vendId()); poq.exec(); _poNumber->populate(poq); if (poq.lastError().type() != QSqlError::NoError) { systemError(this, poq.lastError().databaseText(), __FILE__, __LINE__); return; } } } void dspPoItemsByVendor::sSearch( const QString &pTarget ) { list()->clearSelection(); int i; for (i = 0; i < list()->topLevelItemCount(); i++) { if ( list()->topLevelItem(i)->text(list()->column("itemnumber")).startsWith(pTarget, Qt::CaseInsensitive) || list()->topLevelItem(i)->text(list()->column("itemdescrip")).contains(pTarget, Qt::CaseInsensitive) || list()->topLevelItem(i)->text(list()->column("poitem_vend_item_number")).startsWith(pTarget, Qt::CaseInsensitive) ) break; } if (i < list()->topLevelItemCount()) { list()->setCurrentItem(list()->topLevelItem(i)); list()->scrollToItem(list()->topLevelItem(i)); } } void dspPoItemsByVendor::sSearchNext() { QString target = _searchFor->text(); int i; int currentIndex = list()->indexOfTopLevelItem(list()->currentItem()) + 1; if(currentIndex < 0 || currentIndex > list()->topLevelItemCount()) currentIndex = 0; for (i = currentIndex; i < list()->topLevelItemCount(); i++) { if ( list()->topLevelItem(i)->text(list()->column("itemnumber")).startsWith(target, Qt::CaseInsensitive) || list()->topLevelItem(i)->text(list()->column("itemdescrip")).contains(target, Qt::CaseInsensitive) || list()->topLevelItem(i)->text(list()->column("poitem_vend_item_number")).startsWith(target, Qt::CaseInsensitive) ) break; } if (i < list()->topLevelItemCount()) { list()->setCurrentItem(list()->topLevelItem(i)); list()->scrollToItem(list()->topLevelItem(i)); } } qt-client-4.1.0/guiclient/displays/dspPoItemsByVendor.h000066400000000000000000000025541217451700100231440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOITEMSBYVENDOR_H #define DSPPOITEMSBYVENDOR_H #include "display.h" #include "ui_dspPoItemsByVendor.h" class dspPoItemsByVendor : public display, public Ui::dspPoItemsByVendor { Q_OBJECT public: dspPoItemsByVendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sRunningAvailability(); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sEditItem(); virtual void sViewItem(); virtual void sReschedule(); virtual void sChangeQty(); virtual void sCloseItem(); virtual void sOpenItem(); virtual void sPopulatePo(); virtual void sSearch( const QString & pTarget ); virtual void sSearchNext(); protected slots: virtual void languageChange(); }; #endif // DSPPOITEMSBYVENDOR_H qt-client-4.1.0/guiclient/displays/dspPoItemsByVendor.ui000066400000000000000000000233121217451700100233250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoItemsByVendor 0 0 651 236 Purchase Order Items by Vendor All Purchasing Agents true Selected: false 0 0 XComboBox::Agent Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 false All Purchase Orders true Selected: false false All Items true Open Items Closed Items Qt::Horizontal 0 20 QLayout::SetDefaultConstraint Search for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _searchFor 0 0 200 0 Next Qt::Horizontal 0 20 Qt::Vertical 20 0 VendorGroup QWidget
    vendorgroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _vendor _allItems _warehouse _allPurchasingAgents _selectedPurchasingAgent _agent _allPOs _selectedPO _poNumber _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20 _selectedPO toggled(bool) _poNumber setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoPriceVariancesByItem.cpp000066400000000000000000000100431217451700100247450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoPriceVariancesByItem.h" #include #include #include "guiclient.h" dspPoPriceVariancesByItem::dspPoPriceVariancesByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoPriceVariancesByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Price Variances by Item")); setListLabel(tr("Price Variances")); setReportName("PurchasePriceVariancesByItem"); setMetaSQLOptions("poPriceVariances", "detail"); connect(_selectedPurchasingAgent, SIGNAL(toggled(bool)), _agent, SLOT(setEnabled(bool))); _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured); _item->setDefaultType(ItemLineEdit::cGeneralPurchased); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "recv_order_number" ); list()->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter, true, "distdate" ); list()->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter, false, "receivedate" ); list()->addColumn(tr("Vendor Number"), _itemColumn, Qt::AlignLeft, true, "vend_number" ); list()->addColumn(tr("Vendor Name"), -1, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "recv_qty" ); list()->addColumn(tr("Purch. Cost"), _priceColumn, Qt::AlignRight, false, "recv_purchcost" ); if (!omfgThis->singleCurrency()) list()->addColumn(tr("Purch. Curr."), _priceColumn, Qt::AlignRight, false, "poCurrAbbr" ); list()->addColumn(tr("Rcpt. Cost"), _priceColumn, Qt::AlignRight, false, "recv_recvcost" ); list()->addColumn(tr("Received"), _moneyColumn, Qt::AlignRight, true, "recv_value" ); list()->addColumn(tr("Vouch. Cost"), _priceColumn, Qt::AlignRight, false, "vouchercost" ); list()->addColumn(tr("Vouchered"), _moneyColumn, Qt::AlignRight, true, "voucher_value" ); list()->addColumn(tr("Variance"), _moneyColumn, Qt::AlignRight, true, "variance" ); if (!omfgThis->singleCurrency()) list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight, true, "currAbbr" ); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "varprcnt" ); _currencyGroup->setHidden(omfgThis->singleCurrency()); } void dspPoPriceVariancesByItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoPriceVariancesByItem::setParams(ParameterList &pParams) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter Valid Dates"), tr( "Please enter a valid Start and End Date." ) ); _dates->setFocus(); return false; } if (_notZero->isChecked()) pParams.append("notZero"); pParams.append("item_id", _item->id()); _warehouse->appendValue(pParams); _dates->appendValue(pParams); if (_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); if (_baseCurr->isChecked()) pParams.append("baseCurr"); pParams.append("nonInv", tr("NonInv - ")); pParams.append("na", tr("N/A")); pParams.append("includeFormatted"); // report only? return true; } qt-client-4.1.0/guiclient/displays/dspPoPriceVariancesByItem.h000066400000000000000000000016501217451700100244160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOPRICEVARIANCESBYITEM_H #define DSPPOPRICEVARIANCESBYITEM_H #include "display.h" #include "ui_dspPoPriceVariancesByItem.h" class dspPoPriceVariancesByItem : public display, public Ui::dspPoPriceVariancesByItem { Q_OBJECT public: dspPoPriceVariancesByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); protected slots: virtual void languageChange(); }; #endif // DSPPOPRICEVARIANCESBYITEM_H qt-client-4.1.0/guiclient/displays/dspPoPriceVariancesByItem.ui000066400000000000000000000200271217451700100246030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoPriceVariancesByItem 0 0 552 249 Purchase Price Variances by Item 0 Only show variances not equal to zero All Purchasing Agents true Selected Purchasing Agent 5 0 0 0 0 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Site false Voucher Distribution Qt::Horizontal 0 20 Currency Base true Voucher Qt::Vertical 20 0 Qt::Horizontal 34 20 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _item _warehouse _dates _allPurchasingAgents _agent _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoPriceVariancesByVendor.cpp000066400000000000000000000100171217451700100253050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoPriceVariancesByVendor.h" #include #include #include "guiclient.h" dspPoPriceVariancesByVendor::dspPoPriceVariancesByVendor(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoPriceVariancesByVendor", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Price Variances by Vendor")); setListLabel(tr("Price Variances")); setReportName("PurchasePriceVariancesByVendor"); setMetaSQLOptions("poPriceVariances", "detail"); connect(_selectedPurchasingAgent, SIGNAL(toggled(bool)), _agent, SLOT(setEnabled(bool))); _agent->populate( "SELECT usesysid, usename " "FROM pg_user, usr " "WHERE ( (usename=usr_username)" " AND (usr_active)" " AND (usr_agent) ) " "ORDER BY usename;" ); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "recv_order_number" ); list()->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter, true, "distdate" ); list()->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter, false, "receivedate" ); list()->addColumn(tr("Vendor Number"), _itemColumn, Qt::AlignLeft, false, "vend_number" ); list()->addColumn(tr("Vendor Name"), -1, Qt::AlignLeft, false, "vend_name" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "itemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "recv_qty" ); list()->addColumn(tr("Purch. Cost"), _priceColumn, Qt::AlignRight, false, "recv_purchcost" ); if (!omfgThis->singleCurrency()) list()->addColumn(tr("Purch. Curr."), _priceColumn, Qt::AlignRight, false, "poCurrAbbr" ); list()->addColumn(tr("Rcpt. Cost"), _priceColumn, Qt::AlignRight, false, "recv_recvcost" ); list()->addColumn(tr("Received"), _moneyColumn, Qt::AlignRight, true, "recv_value" ); list()->addColumn(tr("Vouch. Cost"), _priceColumn, Qt::AlignRight, false, "vouchercost" ); list()->addColumn(tr("Vouchered"), _moneyColumn, Qt::AlignRight, true, "voucher_value" ); list()->addColumn(tr("Variance"), _moneyColumn, Qt::AlignRight, true, "variance" ); if (!omfgThis->singleCurrency()) list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight, true, "currAbbr" ); list()->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "varprcnt" ); _currencyGroup->setHidden(omfgThis->singleCurrency()); } void dspPoPriceVariancesByVendor::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoPriceVariancesByVendor::setParams(ParameterList &pParams) { if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter Valid Dates"), tr( "Please enter a valid Start and End Date." ) ); _dates->setFocus(); return false; } if (_notZero->isChecked()) pParams.append("notZero"); _vendorGroup->appendValue(pParams); _warehouse->appendValue(pParams); _dates->appendValue(pParams); if (_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); if (_baseCurr->isChecked()) pParams.append("baseCurr"); pParams.append("nonInv", tr("NonInv - ")); pParams.append("na", tr("N/A")); pParams.append("includeFormatted"); // report only? return true; } qt-client-4.1.0/guiclient/displays/dspPoPriceVariancesByVendor.h000066400000000000000000000016661217451700100247640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPOPRICEVARIANCESBYVENDOR_H #define DSPPOPRICEVARIANCESBYVENDOR_H #include "display.h" #include "ui_dspPoPriceVariancesByVendor.h" class dspPoPriceVariancesByVendor : public display, public Ui::dspPoPriceVariancesByVendor { Q_OBJECT public: dspPoPriceVariancesByVendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); protected slots: virtual void languageChange(); }; #endif // DSPPOPRICEVARIANCESBYVENDOR_H qt-client-4.1.0/guiclient/displays/dspPoPriceVariancesByVendor.ui000066400000000000000000000171251217451700100251470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoPriceVariancesByVendor 0 0 576 225 Purchase Price Variances by Vendor 0 Only show variances not equal to zero All Purchasing Agents true Selected Purchasing Agent 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Site false Voucher Distribution Qt::Horizontal 40 20 Currency Base true Voucher Qt::Vertical 20 0 Qt::Horizontal 63 20 DateCluster QWidget
    datecluster.h
    VendorGroup QWidget
    vendorgroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _warehouse _dates _allPurchasingAgents _agent _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPoReturnsByVendor.cpp000066400000000000000000000055561217451700100240650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPoReturnsByVendor.h" #include #include #include "guiclient.h" dspPoReturnsByVendor::dspPoReturnsByVendor(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPoReturnsByVendor", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Rejected Material by Vendor")); setListLabel(tr("Rejected Material")); setReportName("RejectedMaterialByVendor"); setMetaSQLOptions("poReturns", "detail"); setUseAltId(true); connect(_selectedPurchasingAgent, SIGNAL(toggled(bool)), _agent, SLOT(setEnabled(bool))); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "poreject_ponumber" ); list()->addColumn(tr("Vendor"), _orderColumn, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "poreject_date" ); list()->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "poreject_vend_item_number" ); list()->addColumn(tr("Vendor Description"), -1, Qt::AlignLeft, true, "poreject_vend_item_descrip" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "poreject_qty" ); list()->addColumn(tr("Reject Code"), _itemColumn, Qt::AlignRight, true, "rjctcode_code" ); } void dspPoReturnsByVendor::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPoReturnsByVendor::setParams(ParameterList ¶ms) { if(!_vendor->isValid()) { QMessageBox::warning(this, tr("Vendor Required"), tr("You must specify a Vendor.")); return false; } if (!_dates->startDate().isValid()) { QMessageBox::warning( this, tr("Enter Start Date"), tr( "Please enter a valid Start Date." ) ); _dates->setFocus(); return false ; } else if (!_dates->endDate().isValid()) { QMessageBox::warning( this, tr("Enter End Date"), tr( "Please eneter a valid End Date." ) ); _dates->setFocus(); return false ; } else _dates->appendValue(params); if (_selectedPurchasingAgent->isChecked()) { params.append("username", _agent->currentText()); // metasql only? params.append("agentUsername", _agent->currentText()); // report only? } params.append("vend_id", _vendor->id()); _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspPoReturnsByVendor.h000066400000000000000000000016061217451700100235220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPORETURNSBYVENDOR_H #define DSPPORETURNSBYVENDOR_H #include "display.h" #include "ui_dspPoReturnsByVendor.h" class dspPoReturnsByVendor : public display, public Ui::dspPoReturnsByVendor { Q_OBJECT public: dspPoReturnsByVendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPPORETURNSBYVENDOR_H qt-client-4.1.0/guiclient/displays/dspPoReturnsByVendor.ui000066400000000000000000000150231217451700100237060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPoReturnsByVendor 0 0 550 233 Rejected Material by Vendor 0 Vendor: Qt::Vertical 20 0 0 0 All Purchasing Agents true Selected Purchasing Agent 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 false Qt::Vertical 20 0 Qt::Horizontal 6 20 DateCluster QWidget
    datecluster.h
    VendorCluster QWidget
    vendorcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _vendor _warehouse _dates _allPurchasingAgents _agent _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPricesByCustomer.cpp000066400000000000000000000070231217451700100237040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPricesByCustomer.h" #include #include "guiclient.h" #define CURR_COL 7 #define COST_COL 8 #define MARGIN_COL 9 dspPricesByCustomer::dspPricesByCustomer(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPricesByCustomer", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Prices by Customer")); setListLabel(tr("Prices")); setReportName("PricesByCustomer"); setMetaSQLOptions("prices", "detail"); setUseAltId(true); connect(_showCosts, SIGNAL(toggled(bool)), this, SLOT(sHandleCosts(bool))); list()->addColumn(tr("Schedule"), _itemColumn, Qt::AlignLeft, true, "schedulename" ); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignLeft, true, "type" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "itemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Price UOM"), _uomColumn, Qt::AlignCenter, true, "priceuom"); list()->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "f_qtybreak" ); list()->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "price" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currConcat"); list()->addColumn(tr("Ext. Cost"), _costColumn, Qt::AlignRight, true, "f_cost" ); list()->addColumn(tr("Mar. %"), _prcntColumn, Qt::AlignRight, true, "f_margin" ); if (omfgThis->singleCurrency()) list()->hideColumn(CURR_COL); sHandleCosts(_showCosts->isChecked()); } void dspPricesByCustomer::languageChange() { display::languageChange(); retranslateUi(this); } void dspPricesByCustomer::sHandleCosts(bool pShowCosts) { if (pShowCosts) { list()->showColumn(COST_COL); list()->showColumn(MARGIN_COL); } else { list()->hideColumn(COST_COL); list()->hideColumn(MARGIN_COL); } _costsGroup->setEnabled(_showCosts->isChecked()); } bool dspPricesByCustomer::setParams(ParameterList & params) { if(!_cust->isValid()) { QMessageBox::warning(this, tr("Customer Required"), tr("You must specify a Customer.")); return false; } params.append("na", tr("N/A")); params.append("costna", tr("?????")); params.append("customer", tr("Customer")); params.append("custType", tr("Cust. Type")); params.append("custTypePattern", tr("Cust. Type Pattern")); params.append("sale", tr("Sale")); params.append("listPrice", tr("List Price")); params.append("cust_id", _cust->id()); params.append("byCustomer"); if (_showCosts->isChecked()) { params.append("showCosts"); if (_useStandardCosts->isChecked()) { params.append("useStandardCosts"); // metasql only? params.append("standardCosts"); // report only? } else if (_useActualCosts->isChecked()) { params.append("useActualCosts"); // metasql only? params.append("actualCosts"); // report only? } } if (_showExpired->isChecked()) params.append("showExpired"); if (_showFuture->isChecked()) params.append("showFuture"); return true; } qt-client-4.1.0/guiclient/displays/dspPricesByCustomer.h000066400000000000000000000017001217451700100233450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPRICESBYCUSTOMER_H #define DSPPRICESBYCUSTOMER_H #include "display.h" #include "ui_dspPricesByCustomer.h" class dspPricesByCustomer : public display, public Ui::dspPricesByCustomer { Q_OBJECT public: dspPricesByCustomer(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sHandleCosts( bool pShowCosts ); protected slots: virtual void languageChange(); }; #endif // DSPPRICESBYCUSTOMER_H qt-client-4.1.0/guiclient/displays/dspPricesByCustomer.ui000066400000000000000000000126451217451700100235450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPricesByCustomer 0 0 600 101 Prices by Customer Qt::Vertical 20 0 0 Show E&xpired Prices Show &Future Prices Qt::Vertical QSizePolicy::Expanding 20 0 0 Show Costs and Margins 0 false 0 5 Use Standard Costs true Use Actual Costs Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 CustCluster QWidget
    custcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _cust _showExpired _showFuture _showCosts _useStandardCosts _showCosts toggled(bool) _costsGroup setEnabled(bool) 397 27 398 50
    qt-client-4.1.0/guiclient/displays/dspPricesByCustomerType.cpp000066400000000000000000000071461217451700100245540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPricesByCustomerType.h" #include #include "guiclient.h" #include "xtreewidget.h" #define CURR_COL 7 #define COST_COL 8 #define MARGIN_COL 9 dspPricesByCustomerType::dspPricesByCustomerType(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPricesByCustomerType", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Prices by Customer Type")); setListLabel(tr("Prices")); setReportName("PricesByCustomerType"); setMetaSQLOptions("prices", "detail"); setUseAltId(true); connect(_showCosts, SIGNAL(toggled(bool)), this, SLOT(sHandleCosts(bool))); _custtype->setType(XComboBox::CustomerTypes); list()->addColumn(tr("Schedule"), _itemColumn, Qt::AlignLeft, true, "schedulename" ); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignLeft, true, "type" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "itemnumber" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Price UOM"), _uomColumn, Qt::AlignCenter, true, "priceuom" ); list()->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "f_qtybreak" ); list()->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "price" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currConcat" ); list()->addColumn(tr("Ext. Cost"), _costColumn, Qt::AlignRight, true, "f_cost" ); list()->addColumn(tr("Mar. %"), _prcntColumn, Qt::AlignRight, true, "f_margin" ); if (omfgThis->singleCurrency()) list()->hideColumn(CURR_COL); sHandleCosts(_showCosts->isChecked()); } void dspPricesByCustomerType::languageChange() { display::languageChange(); retranslateUi(this); } void dspPricesByCustomerType::sHandleCosts(bool pShowCosts) { if (pShowCosts) { list()->showColumn(COST_COL); list()->showColumn(MARGIN_COL); } else { list()->hideColumn(COST_COL); list()->hideColumn(MARGIN_COL); } _costsGroup->setEnabled(pShowCosts); } bool dspPricesByCustomerType::setParams(ParameterList & params) { if(!_custtype->isValid()) { QMessageBox::warning(this, tr("Customer Type Required"), tr("You must specify a Customer Type.")); return false; } params.append("na", tr("N/A")); params.append("costna", tr("?????")); params.append("custType", tr("Cust. Type")); params.append("custTypePattern", tr("Cust. Type Pattern")); params.append("sale", tr("Sale")); params.append("listPrice", tr("List Price")); params.append("custtype_id", _custtype->id()); if (_showCosts->isChecked()) { params.append("showCosts"); if (_useStandardCosts->isChecked()) { params.append("useStandardCosts"); // metasql only? params.append("standardCosts"); // report only? } else if (_useActualCosts->isChecked()) { params.append("useActualCosts"); // metasql only? params.append("actualCosts"); // report only? } } if (_showExpired->isChecked()) params.append("showExpired"); if (_showFuture->isChecked()) params.append("showFuture"); params.append("byCustomerType"); return true; } qt-client-4.1.0/guiclient/displays/dspPricesByCustomerType.h000066400000000000000000000017341217451700100242160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPRICESBYCUSTOMERTYPE_H #define DSPPRICESBYCUSTOMERTYPE_H #include "display.h" #include "ui_dspPricesByCustomerType.h" class dspPricesByCustomerType : public display, public Ui::dspPricesByCustomerType { Q_OBJECT public: dspPricesByCustomerType(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sHandleCosts( bool pShowCosts ); protected slots: virtual void languageChange(); }; #endif // DSPPRICESBYCUSTOMERTYPE_H qt-client-4.1.0/guiclient/displays/dspPricesByCustomerType.ui000066400000000000000000000153321217451700100244030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPricesByCustomerType 0 0 523 101 Prices by Customer Type 0 0 5 0 Customer Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _custtype 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 0 0 Show E&xpired Prices Show &Future Prices Qt::Vertical QSizePolicy::Expanding 20 0 0 0 Show Costs and Margins 0 0 false 0 5 Use Standard Costs true Use Actual Costs Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _custtype _showExpired _showFuture _showCosts _useStandardCosts _showCosts toggled(bool) _costsGroup setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspPricesByItem.cpp000066400000000000000000000076031217451700100230050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPricesByItem.h" #include #include "guiclient.h" #define CURR_COL 5 #define COST_COL 6 #define MARGIN_COL 7 dspPricesByItem::dspPricesByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPricesByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Prices by Item")); setListLabel(tr("Prices")); setReportName("PricesByItem"); setMetaSQLOptions("prices", "detail"); setUseAltId(true); connect(_showCosts, SIGNAL(toggled(bool)), this, SLOT(sHandleCosts(bool))); _item->setType(ItemLineEdit::cSold); list()->addColumn(tr("Schedule"), _itemColumn, Qt::AlignLeft, true, "schedulename" ); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignLeft, true, "type" ); list()->addColumn(tr("Customer/Customer Type"), -1, Qt::AlignLeft, true, "typename" ); list()->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "f_qtybreak" ); list()->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "price" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currConcat" ); list()->addColumn(tr("Cost"), _costColumn, Qt::AlignRight, true, "f_cost" ); list()->addColumn(tr("Margin"), _prcntColumn, Qt::AlignRight, true, "f_margin" ); if (omfgThis->singleCurrency()) list()->hideColumn(CURR_COL); sHandleCosts(_showCosts->isChecked()); } void dspPricesByItem::languageChange() { display::languageChange(); retranslateUi(this); } void dspPricesByItem::sHandleCosts(bool pShowCosts) { if (pShowCosts) { list()->showColumn(COST_COL); list()->showColumn(MARGIN_COL); } else { list()->hideColumn(COST_COL); list()->hideColumn(MARGIN_COL); } _costsGroup->setEnabled(pShowCosts); } bool dspPricesByItem::setParams(ParameterList & params) { XSqlQuery dspetParams; double cost = 0.0; if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } if (_showCosts->isChecked()) { if (_useStandardCosts->isChecked()) { dspetParams.prepare( "SELECT (stdCost(item_id) * iteminvpricerat(item_id)) AS cost " "FROM item " "WHERE (item_id=:item_id);"); params.append("standardCosts"); // report only? } else if (_useActualCosts->isChecked()) { dspetParams.prepare( "SELECT (actCost(item_id) * iteminvpricerat(item_id)) AS cost " "FROM item " "WHERE (item_id=:item_id);"); params.append("actualCosts"); // report only? } dspetParams.bindValue(":item_id", _item->id()); dspetParams.exec(); if (dspetParams.first()) cost = dspetParams.value("cost").toDouble(); else return false; } params.append("na", tr("N/A")); params.append("customer", tr("Customer")); params.append("shipTo", tr("Cust. Ship-To")); params.append("shipToPattern", tr("Cust. Ship-To Pattern")); params.append("custType", tr("Cust. Type")); params.append("custTypePattern", tr("Cust. Type Pattern")); params.append("sale", tr("Sale")); params.append("listPrice", tr("List Price")); params.append("item_id", _item->id()); params.append("cost", cost); if (_showCosts->isChecked()) params.append("showCosts"); if (_showExpired->isChecked()) params.append("showExpired"); if (_showFuture->isChecked()) params.append("showFuture"); params.append("byItem"); return true; } qt-client-4.1.0/guiclient/displays/dspPricesByItem.h000066400000000000000000000016441217451700100224510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPRICESBYITEM_H #define DSPPRICESBYITEM_H #include "display.h" #include "ui_dspPricesByItem.h" class dspPricesByItem : public display, public Ui::dspPricesByItem { Q_OBJECT public: dspPricesByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sHandleCosts( bool pShowCosts ); protected slots: virtual void languageChange(); }; #endif // DSPPRICESBYITEM_H qt-client-4.1.0/guiclient/displays/dspPricesByItem.ui000066400000000000000000000146121217451700100226360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPricesByItem 0 0 615 101 Prices by Item Qt::Vertical 20 0 0 0 0 Show E&xpired Prices 0 Show &Future Prices Qt::Horizontal QSizePolicy::Preferred 20 20 Qt::Vertical QSizePolicy::Expanding 20 0 0 0 0 Show Costs and Margins 0 false 0 5 Use Standard Costs true Use Actual Costs Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 ItemCluster QWidget
    itemcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _item _showExpired _showFuture _showCosts _useStandardCosts _showCosts toggled(bool) _costsGroup setEnabled(bool) 459 27 460 50
    qt-client-4.1.0/guiclient/displays/dspPurchaseReqsByItem.cpp000066400000000000000000000074521217451700100241670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPurchaseReqsByItem.h" #include #include #include #include #include "guiclient.h" #include "dspRunningAvailability.h" #include "purchaseOrder.h" dspPurchaseReqsByItem::dspPurchaseReqsByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPurchaseReqsByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Requests by Item")); setListLabel(tr("Purchase Requests")); setReportName("PurchaseRequestsByItem"); setMetaSQLOptions("purchase", "purchaserequests"); setUseAltId(true); list()->addColumn(tr("P/R #"), _orderColumn, Qt::AlignLeft, true, "pr_number"); list()->addColumn(tr("Sub #"), _orderColumn, Qt::AlignLeft, true, "pr_subnumber"); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "pr_status" ); list()->addColumn(tr("Parent Order"), -1, Qt::AlignLeft, true, "parent" ); list()->addColumn(tr("Create Date"), -1, Qt::AlignLeft, true, "pr_createdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "pr_duedate" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "pr_qtyreq" ); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, true, "pr_releasenote" ); connect(omfgThis, SIGNAL(purchaseRequestsUpdated()), this, SLOT(sFillList())); } void dspPurchaseReqsByItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPurchaseReqsByItem::setParams(ParameterList ¶ms) { if (! _item->isValid()) { QMessageBox::information(this, tr("Item Required"), tr("

    Item is required.")); _item->setFocus(); return false; } _warehouse->appendValue(params); params.append("item_id", _item->id()); params.append("manual", tr("Manual")); params.append("other", tr("Other")); return true; } void dspPurchaseReqsByItem::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sDspRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Release P/R..."), this, SLOT(sRelease())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = pMenu->addAction(tr("Delete P/R..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainPurchaseRequests")); } void dspPurchaseReqsByItem::sDspRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->altId()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPurchaseReqsByItem::sRelease() { ParameterList params; params.append("mode", "releasePr"); params.append("pr_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else delete newdlg; sFillList(); omfgThis->sPurchaseRequestsUpdated(); } void dspPurchaseReqsByItem::sDelete() { XSqlQuery dspDelete; dspDelete.prepare("SELECT deletePr(:pr_id) AS _result;"); dspDelete.bindValue(":pr_id", list()->id()); dspDelete.exec(); sFillList(); omfgThis->sPurchaseRequestsUpdated(); } qt-client-4.1.0/guiclient/displays/dspPurchaseReqsByItem.h000066400000000000000000000021101217451700100236160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPURCHASEREQSBYITEM_H #define DSPPURCHASEREQSBYITEM_H #include "display.h" #include "ui_dspPurchaseReqsByItem.h" class dspPurchaseReqsByItem : public display, public Ui::dspPurchaseReqsByItem { Q_OBJECT public: dspPurchaseReqsByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sDspRunningAvailability(); virtual void sRelease(); virtual void sDelete(); protected slots: virtual void languageChange(); }; #endif // DSPPURCHASEREQSBYITEM_H qt-client-4.1.0/guiclient/displays/dspPurchaseReqsByItem.ui000066400000000000000000000072761217451700100240260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPurchaseReqsByItem 0 0 564 115 0 0 564 60 Purchase Requests by Item 0 false Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 6 ItemCluster QWidget

    itemcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _item _warehouse _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _item newId(int) _warehouse findItemSites(int) 20 20 20 20 qt-client-4.1.0/guiclient/displays/dspPurchaseReqsByPlannerCode.cpp000066400000000000000000000104421217451700100254540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspPurchaseReqsByPlannerCode.h" #include #include #include #include #include "guiclient.h" #include "xtreewidget.h" #include "dspRunningAvailability.h" #include "purchaseOrder.h" dspPurchaseReqsByPlannerCode::dspPurchaseReqsByPlannerCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspPurchaseReqsByPlannerCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Purchase Requests by Planner Code")); setListLabel(tr("Purchase Requests")); setReportName("PurchaseReqsByPlannerCode"); setMetaSQLOptions("purchase", "purchaserequests"); setUseAltId(true); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _plannerCode->setType(ParameterGroup::PlannerCode); list()->addColumn(tr("P/R #"), _orderColumn, Qt::AlignLeft, true, "pr_number"); list()->addColumn(tr("Sub #"), _orderColumn, Qt::AlignLeft, true, "pr_subnumber"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "pr_status" ); list()->addColumn(tr("Parent Order"), _itemColumn, Qt::AlignLeft, true, "parent" ); list()->addColumn(tr("Create Date"), -1, Qt::AlignLeft, true, "pr_createdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "pr_duedate" ); list()->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "pr_qtyreq" ); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, true, "pr_releasenote" ); } void dspPurchaseReqsByPlannerCode::languageChange() { display::languageChange(); retranslateUi(this); } bool dspPurchaseReqsByPlannerCode::setParams(ParameterList ¶ms) { if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter a Valid Start Date and End Date"), tr("You must enter a valid Start Date and End Date for this report.") ); _dates->setFocus(); return false; } _plannerCode->appendValue(params); _warehouse->appendValue(params); _dates->appendValue(params); params.append("manual", tr("Manual")); params.append("other", tr("Other")); return true; } void dspPurchaseReqsByPlannerCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sDspRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Release P/R..."), this, SLOT(sRelease())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = pMenu->addAction(tr("Delete P/R..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainPurchaseRequests")); } void dspPurchaseReqsByPlannerCode::sDspRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->altId()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspPurchaseReqsByPlannerCode::sRelease() { ParameterList params; params.append("mode", "releasePr"); params.append("pr_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else delete newdlg; sFillList(); omfgThis->sPurchaseRequestsUpdated(); } void dspPurchaseReqsByPlannerCode::sDelete() { XSqlQuery dspDelete; dspDelete.prepare("SELECT deletePr(:pr_id) AS _result;"); dspDelete.bindValue(":pr_id", list()->id()); dspDelete.exec(); sFillList(); omfgThis->sPurchaseRequestsUpdated(); } qt-client-4.1.0/guiclient/displays/dspPurchaseReqsByPlannerCode.h000066400000000000000000000021711217451700100251210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPPURCHASEREQSBYPLANNERCODE_H #define DSPPURCHASEREQSBYPLANNERCODE_H #include "display.h" #include "ui_dspPurchaseReqsByPlannerCode.h" class dspPurchaseReqsByPlannerCode : public display, public Ui::dspPurchaseReqsByPlannerCode { Q_OBJECT public: dspPurchaseReqsByPlannerCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sDspRunningAvailability(); virtual void sRelease(); virtual void sDelete(); protected slots: virtual void languageChange(); }; #endif // DSPPURCHASEREQSBYPLANNERCODE_H qt-client-4.1.0/guiclient/displays/dspPurchaseReqsByPlannerCode.ui000066400000000000000000000064541217451700100253170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspPurchaseReqsByPlannerCode 0 0 491 209 Purchase Requests by Planner Code 0 false false Qt::Vertical 20 0 Qt::Horizontal 19 20 DateCluster QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _dates _plannerCode
    qt-client-4.1.0/guiclient/displays/dspQOH.cpp000066400000000000000000000220021217451700100210630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspQOH.h" #include #include #include #include "adjustmentTrans.h" #include "enterMiscCount.h" #include "transferTrans.h" #include "createCountTagsByItem.h" #include "dspInventoryLocator.h" #include "parameterwidget.h" dspQOH::dspQOH(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspQOH", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Quantities on Hand")); setReportName("QOH"); setMetaSQLOptions("qoh", "detail"); setUseAltId(true); setParameterWidgetVisible(true); _costsGroupInt = new QButtonGroup(this); _costsGroupInt->addButton(_useStandardCosts); _costsGroupInt->addButton(_useActualCosts); _costsGroupInt->addButton(_usePostedCosts); _showGroupInt = new QButtonGroup(this); _showGroupInt->addButton(_showAll); _showGroupInt->addButton(_showPositive); _showGroupInt->addButton(_showNegative); parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->append(tr("Class Code Pattern"), "classcode_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Cost Category"), "costcat_id", XComboBox::CostCategories); parameterWidget()->append(tr("Cost Category Pattern"), "costcat_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Item Group"), "itemgrp_id", XComboBox::ItemGroups); parameterWidget()->append(tr("Item Group Pattern"), "itemgrp_pattern", ParameterWidget::Text); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); if (_metrics->boolean("EnableAsOfQOH")) parameterWidget()->appendComboBox(tr("As Of"), "asOf", XComboBox::AccountingPeriods); connect(_showValue, SIGNAL(toggled(bool)), this, SLOT(sHandleValue(bool))); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Class Code"), _itemColumn, Qt::AlignLeft, true, "classcode_code" ); list()->addColumn(tr("Cost Category"), _itemColumn, Qt::AlignLeft, false, "costcat_code" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Default Location"), _itemColumn, Qt::AlignLeft, true, "defaultlocation" ); list()->addColumn(tr("Reorder Lvl."), _qtyColumn, Qt::AlignRight, true, "reorderlevel" ); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh" ); list()->addColumn(tr("Non-Netable"), _qtyColumn, Qt::AlignRight, true, "nnqoh" ); list()->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "cost" ); list()->addColumn(tr("Value"), _costColumn, Qt::AlignRight, true, "value" ); list()->addColumn(tr("NN Value"), _costColumn, Qt::AlignRight, true, "nnvalue" ); list()->addColumn(tr("Cost Method"), _costColumn, Qt::AlignCenter, true, "costmethod" ); sHandleValue(_showValue->isChecked()); _showValue->setEnabled(_privileges->check("ViewInventoryValue")); } void dspQOH::languageChange() { display::languageChange(); retranslateUi(this); } SetResponse dspQOH::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; parameterWidget()->setSavedFilters(); param = pParams.value("classcode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code"), param); param = pParams.value("classcode_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code Pattern"), param); param = pParams.value("costcat_id", &valid); if (valid) parameterWidget()->setDefault(tr("Cost Category"), param); param = pParams.value("costcat_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Cost Category Pattern"), param); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param); param = pParams.value("itemgrp_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item Group"), param); param = pParams.value("itemgrp_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Item Group Pattern"), param); param = pParams.value("warehous_id", &valid); if (valid) parameterWidget()->setDefault(tr("Site"), param); parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) sFillList(); return NoError; } void dspQOH::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { if (((XTreeWidgetItem *)pSelected)->id() != -1) { QAction *menuItem; if (((XTreeWidgetItem *)pSelected)->altId()) { pMenu->addAction(tr("View Location/Lot/Serial # Detail..."), this, SLOT(sViewDetail())); pMenu->addSeparator(); } if (_metrics->boolean("MultiWhs")) { menuItem = pMenu->addAction(tr("Transfer to another Site..."), this, SLOT(sTransfer()));; if (!_privileges->check("CreateInterWarehouseTrans")) menuItem->setEnabled(false); } menuItem = pMenu->addAction(tr("Adjust this Quantity..."), this, SLOT(sAdjust()));; if (!_privileges->check("CreateAdjustmentTrans")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Reset this Quanity to 0..."), this, SLOT(sReset()));; if (!_privileges->check("CreateAdjustmentTrans")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Enter Misc. Count..."), this, SLOT(sMiscCount()));; if (!_privileges->check("EnterMiscCounts")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()));; if (!_privileges->check("IssueCountTags")) menuItem->setEnabled(false); } } void dspQOH::sViewDetail() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); dspInventoryLocator *newdlg = new dspInventoryLocator(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspQOH::sTransfer() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspQOH::sAdjust() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspQOH::sReset() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); params.append("qty", 0.0); adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspQOH::sMiscCount() { ParameterList params; params.append("itemsite_id", list()->id()); enterMiscCount newdlg(this, "", true); newdlg.set(params); if (newdlg.exec()) sFillList(); } void dspQOH::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspQOH::sHandleValue(bool pShowValue) { list()->setColumnHidden(list()->column("cost"), !pShowValue); list()->setColumnHidden(list()->column("value"), !pShowValue); list()->setColumnHidden(list()->column("nnvalue"), !pShowValue); list()->setColumnHidden(list()->column("costmethod"), !pShowValue); } void dspQOH::sFillList() { list()->clear(); list()->setColumnVisible(list()->column("costmethod"), _showValue->isChecked() && _usePostedCosts->isChecked()); display::sFillList(); } bool dspQOH::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; params.append("none", tr("None")); params.append("na", tr("N/A")); if (_useStandardCosts->isChecked()) params.append("useStandardCosts"); else if (_useActualCosts->isChecked()) params.append("useActualCosts"); else if (_usePostedCosts->isChecked()) params.append("usePostedCosts"); if (_showPositive->isChecked()) { params.append("showPositive"); params.append("onlyShowPositive"); // report } else if (_showNegative->isChecked()) { params.append("showNegative"); params.append("onlyShowNegative"); // report } if (_showValue->isChecked()) params.append("showValue"); return true; } qt-client-4.1.0/guiclient/displays/dspQOH.h000066400000000000000000000024541217451700100205410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPQOH_H #define DSPQOH_H #include "guiclient.h" #include "display.h" #include "ui_dspQOH.h" class dspQOH : public display, public Ui::dspQOH { Q_OBJECT public: dspQOH(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); virtual SetResponse set( const ParameterList & pParams ); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sViewDetail(); virtual void sTransfer(); virtual void sAdjust(); virtual void sReset(); virtual void sMiscCount(); virtual void sIssueCountTag(); virtual void sHandleValue( bool pShowValue ); virtual void sFillList(); protected slots: virtual void languageChange(); private: QButtonGroup* _costsGroupInt; QButtonGroup* _showGroupInt; }; #endif // dspQOH_H qt-client-4.1.0/guiclient/displays/dspQOH.ui000066400000000000000000000062161217451700100207270ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspQOH 0 0 563 120 Quantities on Hand Show All Quantities true Only Show Positive Quantities Only Show Negative Quantities false Show Inventory Value true false Use Posted Costs true Use Standard Costs Use Actual Costs _showAll _showPositive _showNegative _usePostedCosts _useStandardCosts _useActualCosts qt-client-4.1.0/guiclient/displays/dspQOHByLocation.cpp000066400000000000000000000127531217451700100230630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspQOHByLocation.h" #include #include #include #include #include "inputManager.h" #include "relocateInventory.h" dspQOHByLocation::dspQOHByLocation(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspQOHByLocation", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Quantities on Hand by Location")); setListLabel(tr("Location")); setReportName("QOHByLocation"); setMetaSQLOptions("qoh", "detail"); connect(_warehouse, SIGNAL(updated()), this, SLOT(sPopulateLocations())); omfgThis->inputManager()->notify(cBCLocation, this, this, SLOT(set(int))); _location->setAllowNull(true); _asOf->setDate(omfgThis->dbDate(), true); list()->setRootIsDecorated(true); list()->addColumn(tr("Site"), _itemColumn, Qt::AlignLeft, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "f_descrip" ); list()->addColumn(tr("Lot/Serial #"), 150, Qt::AlignLeft, true, "f_lotserial" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh" ); list()->addColumn(tr("Reserved"), _qtyColumn, Qt::AlignRight, false, "reservedqty" ); if(_metrics->boolean("EnableSOReservationsByLocation")) list()->showColumn(6); _asofGroup->hide();; // Issue #11793 - Not ready for this yet. sPopulateLocations(); } void dspQOHByLocation::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspQOHByLocation::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("location_id", &valid); if (valid) { XSqlQuery qq; qq.prepare( "SELECT location_warehous_id " "FROM location " "WHERE (location_id=:location_id);" ); qq.bindValue(":location_id", param.toInt()); qq.exec(); if (qq.first()) { _warehouse->setId(qq.value("location_warehous_id").toInt()); _location->setId(param.toInt()); } } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspQOHByLocation::sPopulateLocations() { if (_warehouse->isAll()) _location->populate( "SELECT location_id," " CASE WHEN (LENGTH(location_descrip) > 0) THEN (warehous_code || '-' || formatLocationName(location_id) || '-' || location_descrip)" " ELSE (warehous_code || '-' || formatLocationName(location_id))" " END AS locationname " "FROM location, whsinfo " "WHERE (location_warehous_id=warehous_id) " "ORDER BY locationname;" ); else { XSqlQuery qq; qq.prepare( "SELECT location_id, " " CASE WHEN (LENGTH(location_descrip) > 0) THEN (formatLocationName(location_id) || '-' || location_descrip)" " ELSE formatLocationName(location_id)" " END AS locationname " "FROM location " "WHERE (location_warehous_id=:warehous_id) " "ORDER BY locationname;" ); qq.bindValue(":warehous_id", _warehouse->id()); qq.exec(); _location->populate(qq); } } void dspQOHByLocation::sRelocate() { ParameterList params; params.append("itemloc_id", list()->id()); relocateInventory newdlg(this, "", true); newdlg.set(params); if (newdlg.exec()) sFillList(); } void dspQOHByLocation::sPopulateMenu(QMenu *menu, QTreeWidgetItem*, int) { QAction *menuItem; if (list()->id() != -1) { menuItem = menu->addAction(tr("Relocate..."), this, SLOT(sRelocate())); menuItem->setEnabled(_privileges->check("RelocateInventory")); } } void dspQOHByLocation::sFillList() { list()->clear(); if (_location->id() != -1) { XSqlQuery qq; qq.prepare( "SELECT formatBoolYN(location_netable) AS netable," " formatBoolYN(location_restrict) AS restricted " "FROM location, whsinfo " "WHERE ( (location_warehous_id=warehous_id)" " AND (location_id=:location_id));" ); qq.bindValue(":location_id", _location->id()); qq.exec(); if (qq.first()) { _netable->setText(qq.value("netable").toString()); _restricted->setText(qq.value("restricted").toString()); } display::sFillList(); } else { _netable->clear(); _restricted->clear(); list()->clear(); } } bool dspQOHByLocation::setParams(ParameterList ¶ms) { params.append("byLocation"); params.append("asOf", _asOf->date()); params.append("na", tr("N/A")); _warehouse->appendValue(params); if (_location->id() != -1) params.append("location_id", _location->id()); if (_metrics->boolean("EnableSOReservationsByLocation")) params.append("EnableSOReservationsByLocation"); return true; } qt-client-4.1.0/guiclient/displays/dspQOHByLocation.h000066400000000000000000000021741217451700100225240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPQOHBYLOCATION_H #define DSPQOHBYLOCATION_H #include "guiclient.h" #include "display.h" #include "ui_dspQOHByLocation.h" class dspQOHByLocation : public display, public Ui::dspQOHByLocation { Q_OBJECT public: dspQOHByLocation(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateLocations(); virtual void sRelocate(); virtual void sPopulateMenu(QMenu * menu, QTreeWidgetItem *, int); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPQOHBYLOCATION_H qt-client-4.1.0/guiclient/displays/dspQOHByLocation.ui000066400000000000000000000121311217451700100227040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspQOHByLocation 0 0 569 180 Quantities on Hand by Location false 0 0 As of Date: Location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Netable: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Restricted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter DLineEdit QWidget
    datecluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _warehouse _location
    qt-client-4.1.0/guiclient/displays/dspQuotesByCustomer.cpp000066400000000000000000000164431217451700100237450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspQuotesByCustomer.h" #include #include #include "errorReporter.h" #include "salesOrder.h" #include "storedProcErrorLookup.h" dspQuotesByCustomer::dspQuotesByCustomer(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspQuotesByCustomer", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Quote Lookup by Customer")); setListLabel(tr("Quotes")); setMetaSQLOptions("quotes", "detail"); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulatePo())); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Order Date")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Order Date")); list()->addColumn(tr("Quote #"), _orderColumn, Qt::AlignLeft, true, "quhead_number" ); list()->addColumn(tr("Quote Date"), _dateColumn, Qt::AlignRight, true, "quhead_quotedate" ); list()->addColumn(tr("Ship-to"), -1, Qt::AlignLeft, true, "quhead_shiptoname" ); list()->addColumn(tr("Cust. P/O #"), 200, Qt::AlignLeft, true, "quhead_custponumber" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "quhead_status" ); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList()) ); } void dspQuotesByCustomer::languageChange() { display::languageChange(); retranslateUi(this); } void dspQuotesByCustomer::sPopulatePo() { _poNumber->clear(); if ((_cust->isValid()) && (_dates->allValid())) { XSqlQuery minq; minq.prepare("SELECT MIN(quhead_id), quhead_custponumber " "FROM quhead " "WHERE ( (quhead_cust_id=:cust_id)" " AND (quhead_quotedate BETWEEN :startDate AND :endDate) ) " "GROUP BY quhead_custponumber " "ORDER BY quhead_custponumber;" ); _dates->bindValue(minq); minq.bindValue(":cust_id", _cust->id()); minq.exec(); _poNumber->populate(minq); } } void dspQuotesByCustomer::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { menuThis->addAction(tr("Edit..."), this, SLOT(sEditOrder())); menuThis->addAction(tr("View..."), this, SLOT(sViewOrder())); if (_privileges->check("ConvertQuotes")) { menuThis->addSeparator(); menuThis->addAction(tr("Convert..."), this, SLOT(sConvert())); } } void dspQuotesByCustomer::sEditOrder() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("mode", "editQuote"); params.append("quhead_id", list()->id()); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspQuotesByCustomer::sViewOrder() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("mode", "viewQuote"); params.append("quhead_id", list()->id()); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspQuotesByCustomer::setParams(ParameterList & params) { if (! _dates->allValid()) { QMessageBox::warning(this, tr("Invalid Dates"), tr("Enter valid Start and End dates.")); _dates->setFocus(); return false; } if (_selectedPO->isChecked() && ! _poNumber->isValid()) { QMessageBox::warning(this, tr("Invalid Options"), tr("One or more options are not complete.")); return false; } _dates->appendValue(params); params.append("cust_id", _cust->id()); params.append("showExpired"); params.append("customersOnly"); if (_selectedPO->isChecked()) params.append("poNumber", _poNumber->currentText()); if (_showConverted->isChecked()) params.append("showConverted", true); return true; } void dspQuotesByCustomer::sConvert() { if (QMessageBox::question(this, tr("Convert Selected Quote(s)"), tr("

    Are you sure that you want to convert the " "selected Quote(s) to Sales Order(s)?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery check; check.prepare("SELECT quhead_number, quhead_status, cust_creditstatus " " FROM quhead" " JOIN custinfo ON (quhead_cust_id=cust_id)" " WHERE (quhead_id=:quhead_id);" ); XSqlQuery convert; convert.prepare("SELECT convertQuote(:quhead_id) AS sohead_id;"); int counter = 0; int soheadid = -1; foreach (XTreeWidgetItem *cursor, list()->selectedItems()) { if (checkSitePrivs(cursor->id())) { check.bindValue(":quhead_id", cursor->id()); check.exec(); if (check.first()) { // TODO: add this check to convertquote if (check.value("quhead_status").toString() == "C") { QMessageBox::warning(this, tr("Cannot Convert Quote"), tr("

    Quote #%1 has already been converted " "to a Sales Order." ) .arg(cursor->text("quhead_number"))); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Quote"), check, __FILE__, __LINE__)) continue; convert.bindValue(":quhead_id", cursor->id()); convert.exec(); if (convert.first()) { soheadid = convert.value("sohead_id").toInt(); if(soheadid < 0) { QMessageBox::warning(this, tr("Cannot Convert Quote"), storedProcErrorLookup("convertQuote", soheadid) .arg(check.value("quhead_number").toString())); continue; } counter++; omfgThis->sSalesOrdersUpdated(soheadid); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Converting Error"), convert, __FILE__, __LINE__)) continue; } } if (counter) omfgThis->sQuotesUpdated(-1); if (counter == 1) salesOrder::editSalesOrder(soheadid, true); } } bool dspQuotesByCustomer::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkQuoteSitePrivs(:quheadid) AS result;"); check.bindValue(":quheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view, edit, or convert this Quote as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/displays/dspQuotesByCustomer.h000066400000000000000000000022551217451700100234060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPQUOTESBYCUSTOMER_H #define DSPQUOTESBYCUSTOMER_H #include "guiclient.h" #include "display.h" #include #include "ui_dspQuotesByCustomer.h" class dspQuotesByCustomer : public display, public Ui::dspQuotesByCustomer { Q_OBJECT public: dspQuotesByCustomer(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); virtual bool setParams(ParameterList&); public slots: virtual void sPopulatePo(); virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sConvert(); protected slots: virtual void languageChange(); }; #endif // DSPQUOTESBYCUSTOMER_H qt-client-4.1.0/guiclient/displays/dspQuotesByCustomer.ui000066400000000000000000000135261217451700100235770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspQuotesByCustomer 0 0 541 165 Quote Lookup by Customer 0 Qt::Vertical QSizePolicy::Expanding 20 0 5 0 0 0 5 All P/O #s false 5 Selected P/O #: true 0 0 Show Converted 0 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 Qt::Vertical 20 0 Qt::Horizontal 0 20 CustCluster QWidget

    custcluster.h
    DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _cust _allPOs _selectedPO _poNumber _dates _selectedPO toggled(bool) _poNumber setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/displays/dspQuotesByItem.cpp000066400000000000000000000102761217451700100230400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspQuotesByItem.h" #include #include #include #include "salesOrder.h" dspQuotesByItem::dspQuotesByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspQuotesByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Quote Lookup by Item")); setListLabel(tr("Quotes")); setMetaSQLOptions("quoteItems", "detail"); setUseAltId(true); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Order Date")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Order Date")); _item->setType(ItemLineEdit::cSold); list()->addColumn(tr("Quote #"), _orderColumn, Qt::AlignLeft, true, "quhead_number" ); list()->addColumn(tr("Quote Date"), _dateColumn, Qt::AlignCenter, true, "quhead_quotedate" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "quhead_status" ); list()->addColumn(tr("Quoted"), _qtyColumn, Qt::AlignRight, true, "quitem_qtyord" ); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList())); } void dspQuotesByItem::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspQuotesByItem::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); return NoError; } void dspQuotesByItem::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { menuThis->addAction(tr("Edit..."), this, SLOT(sEditOrder())); menuThis->addAction(tr("View..."), this, SLOT(sViewOrder())); } void dspQuotesByItem::sEditOrder() { if (!checkSitePrivs(list()->altId())) return; ParameterList params; params.append("mode", "editQuote"); params.append("quhead_id", list()->altId()); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspQuotesByItem::sViewOrder() { if (!checkSitePrivs(list()->altId())) return; ParameterList params; params.append("mode", "viewQuote"); params.append("quhead_id", list()->altId()); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspQuotesByItem::setParams(ParameterList & params) { if (!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number")); return false; } if(!_dates->allValid()) { QMessageBox::warning(this, tr("Dates Required"), tr("You must specify a Start Date and End Date.")); return false; } _dates->appendValue(params); params.append("item_id", _item->id()); if (_showConverted->isChecked()) params.append("showConverted", true); return true; } bool dspQuotesByItem::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkQuoteSitePrivs(:quheadid) AS result;"); check.bindValue(":quheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view, edit, or convert this Quote as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/displays/dspQuotesByItem.h000066400000000000000000000021711217451700100225000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPQUOTESBYITEM_H #define DSPQUOTESBYITEM_H #include "guiclient.h" #include "display.h" #include "ui_dspQuotesByItem.h" class dspQuotesByItem : public display, public Ui::dspQuotesByItem { Q_OBJECT public: dspQuotesByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); virtual bool setParams(ParameterList&); public slots: virtual SetResponse set(const ParameterList & pParams); virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sEditOrder(); virtual void sViewOrder(); protected slots: virtual void languageChange(); }; #endif // DSPQUOTESBYITEM_H qt-client-4.1.0/guiclient/displays/dspQuotesByItem.ui000066400000000000000000000060611217451700100226700ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspQuotesByItem 0 0 614 102 Quote Lookup by Item Qt::Vertical 20 0 0 Show Converted Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    _item _dates
    qt-client-4.1.0/guiclient/displays/dspReorderExceptionsByPlannerCode.cpp000066400000000000000000000061541217451700100265200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspReorderExceptionsByPlannerCode.h" #include #include #include #include "dspRunningAvailability.h" #include "workOrder.h" dspReorderExceptionsByPlannerCode::dspReorderExceptionsByPlannerCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspReorderExceptionsByPlannerCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Reorder Exceptions by Planner Code")); setListLabel(tr("Expedite Exceptions")); setReportName("ReorderExceptionsByPlannerCode"); setMetaSQLOptions("reorderExceptionsByPlannerCode", "detail"); setUseAltId(true); _plannerCode->setType(ParameterGroup::PlannerCode); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Exception Date"), _dateColumn, Qt::AlignCenter, true, "reorderdate" ); list()->addColumn(tr("Reorder Level"), _qtyColumn, Qt::AlignRight, true, "reorderlevel" ); list()->addColumn(tr("Proj. Avail."), _qtyColumn, Qt::AlignRight, true, "projavail" ); } void dspReorderExceptionsByPlannerCode::languageChange() { display::languageChange(); retranslateUi(this); } bool dspReorderExceptionsByPlannerCode::setParams(ParameterList ¶ms) { params.append("lookAheadDays", _days->value()); _warehouse->appendValue(params); _plannerCode->appendValue(params); if (_includePlanned->isChecked()) params.append("includePlannedOrders"); return true; } void dspReorderExceptionsByPlannerCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("View Running Availability..."), this, SLOT(sRunningAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); if (list()->altId() == 1) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Create Work Order..."), this, SLOT(sCreateWorkOrder())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); } } void dspReorderExceptionsByPlannerCode::sRunningAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspReorderExceptionsByPlannerCode::sCreateWorkOrder() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/displays/dspReorderExceptionsByPlannerCode.h000066400000000000000000000022031217451700100261540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPREORDEREXCEPTIONSBYPLANNERCODE_H #define DSPREORDEREXCEPTIONSBYPLANNERCODE_H #include "display.h" #include "ui_dspReorderExceptionsByPlannerCode.h" class dspReorderExceptionsByPlannerCode : public display, public Ui::dspReorderExceptionsByPlannerCode { Q_OBJECT public: dspReorderExceptionsByPlannerCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sRunningAvailability(); virtual void sCreateWorkOrder(); protected slots: virtual void languageChange(); }; #endif // DSPREORDEREXCEPTIONSBYPLANNERCODE_H qt-client-4.1.0/guiclient/displays/dspReorderExceptionsByPlannerCode.ui000066400000000000000000000124631217451700100263530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspReorderExceptionsByPlannerCode 0 0 490 204 0 1 Reorder Exceptions by Planner Code false 5 Look Ahead Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 999 &Include Planned Orders Qt::Vertical QSizePolicy::MinimumExpanding 20 0 Qt::Horizontal 0 20 false Qt::Horizontal 0 20 Qt::Vertical 20 0 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _plannerCode _warehouse _days
    qt-client-4.1.0/guiclient/displays/dspReservations.cpp000066400000000000000000000162041217451700100231270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspReservations.h" #include #include #include #include #include #include "metasql.h" #include "mqlutil.h" #include "salesOrder.h" #include "transferOrder.h" #include "workOrder.h" dspReservations::dspReservations(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspReservations", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Item Reservations")); setListLabel(tr("Item Reservations")); setMetaSQLOptions("reservations", "detail"); _qoh->setPrecision(omfgThis->qtyVal()); _available->setPrecision(omfgThis->qtyVal()); list()->setRootIsDecorated(true); list()->addColumn(tr("Order/Location LotSerial"), -1, Qt::AlignLeft, true, "order_number" ); list()->addColumn(tr("Total Qty."), _qtyColumn, Qt::AlignRight, true, "totalqty" ); list()->addColumn(tr("Relieved"), _qtyColumn, Qt::AlignRight, true, "relievedqty" ); list()->addColumn(tr("Reserved"), _qtyColumn, Qt::AlignRight, true, "reservedqty" ); list()->addColumn(tr("Running Bal."), _qtyColumn, Qt::AlignRight, true, "balanceqty" ); list()->addColumn(tr("Required"), _dateColumn, Qt::AlignCenter, true, "scheddate" ); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } void dspReservations::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspReservations::set(const ParameterList &pParams) { XSqlQuery dspet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("soitem_id", &valid); if (valid) { dspet.prepare("SELECT coitem_itemsite_id" " FROM coitem" " WHERE(coitem_id=:soitem_id);"); dspet.bindValue(":soitem_id", param.toInt()); dspet.exec(); if(dspet.first()) _item->setItemsiteid(dspet.value("coitem_itemsite_id").toInt()); } param = pParams.value("itemsite_id", &valid); if (valid) _item->setItemsiteid(param.toInt()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspReservations::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; if (QString(pSelected->text(0)) == "W/O") { menuItem = pMenu->addAction(tr("View Work Order..."), this, SLOT(sViewWorkOrder())); menuItem->setEnabled(_privileges->check("ViewWorkOrders")); } else if (QString(pSelected->text(0)) == "S/O") { menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewCustomerOrder())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditCustomerOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); } else if (QString(pSelected->text(0)) == "T/O") { menuItem = pMenu->addAction(tr("View Transfer Order..."), this, SLOT(sViewTransferOrder())); menuItem->setEnabled(_privileges->check("ViewTransferOrders")); menuItem = pMenu->addAction(tr("Edit Transfer Order..."), this, SLOT(sEditTransferOrder())); menuItem->setEnabled(_privileges->check("MaintainTransferOrders")); } } void dspReservations::sViewWorkOrder() { XSqlQuery dspViewWorkOrder; dspViewWorkOrder.prepare( "SELECT womatl_wo_id " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); dspViewWorkOrder.bindValue(":womatl_id", list()->id()); dspViewWorkOrder.exec(); if (dspViewWorkOrder.first()) { ParameterList params; params.append("mode", "view"); params.append("wo_id", dspViewWorkOrder.value("womatl_wo_id").toInt()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspReservations::sViewCustomerOrder() { XSqlQuery dspViewCustomerOrder; dspViewCustomerOrder.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:coitem_id);" ); dspViewCustomerOrder.bindValue(":coitem_id", list()->id()); dspViewCustomerOrder.exec(); if (dspViewCustomerOrder.first()) salesOrder::viewSalesOrder(dspViewCustomerOrder.value("coitem_cohead_id").toInt()); } void dspReservations::sEditCustomerOrder() { XSqlQuery dspEditCustomerOrder; dspEditCustomerOrder.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:coitem_id);" ); dspEditCustomerOrder.bindValue(":coitem_id", list()->id()); dspEditCustomerOrder.exec(); if (dspEditCustomerOrder.first()) salesOrder::editSalesOrder(dspEditCustomerOrder.value("coitem_cohead_id").toInt(), false); } void dspReservations::sViewTransferOrder() { XSqlQuery dspViewTransferOrder; dspViewTransferOrder.prepare( "SELECT toitem_tohead_id " "FROM toitem " "WHERE (toitem_id=:toitem_id);" ); dspViewTransferOrder.bindValue(":toitem_id", list()->id()); dspViewTransferOrder.exec(); if (dspViewTransferOrder.first()) transferOrder::viewTransferOrder(dspViewTransferOrder.value("toitem_tohead_id").toInt()); } void dspReservations::sEditTransferOrder() { XSqlQuery dspEditTransferOrder; dspEditTransferOrder.prepare( "SELECT toitem_tohead_id " "FROM toitem " "WHERE (toitem_id=:toitem_id);" ); dspEditTransferOrder.bindValue(":toitem_id", list()->id()); dspEditTransferOrder.exec(); if (dspEditTransferOrder.first()) transferOrder::editTransferOrder(dspEditTransferOrder.value("toitem_tohead_id").toInt(), false); } bool dspReservations::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } params.append("warehous_id", _warehouse->id()); params.append("item_id", _item->id()); return true; } void dspReservations::sFillList() { XSqlQuery dspFillList; ParameterList params; if(setParams(params)) { display::sFillList(); QString avails("SELECT itemsite_qtyonhand," " qtyunreserved(itemsite_id) AS unreserved " "FROM itemsite " "WHERE ((itemsite_item_id=)" " AND (itemsite_warehous_id=));"); MetaSQLQuery availm(avails); dspFillList = availm.toQuery(params); if (dspFillList.first()) { _qoh->setDouble(dspFillList.value("itemsite_qtyonhand").toDouble()); _available->setDouble(dspFillList.value("unreserved").toDouble()); } else if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/displays/dspReservations.h000066400000000000000000000023711217451700100225740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPRESERVATIONS_H #define DSPRESERVATIONS_H #include "guiclient.h" #include "display.h" #include "ui_dspReservations.h" class dspReservations : public display, public Ui::dspReservations { Q_OBJECT public: dspReservations(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sEditCustomerOrder(); virtual void sEditTransferOrder(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sViewCustomerOrder(); virtual void sViewTransferOrder(); virtual void sViewWorkOrder(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPRESERVATIONS_H qt-client-4.1.0/guiclient/displays/dspReservations.ui000066400000000000000000000141311217451700100227570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspReservations 0 0 451 93 Item Reservations 5 0 Qt::StrongFocus Qt::Vertical 20 0 0 0 5 0 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse QOH: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qoh Available To Reserve: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _available Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 4 20 ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    _item _warehouse _item privateIdChanged(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspRunningAvailability.cpp000066400000000000000000000265341217451700100244250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspRunningAvailability.h" #include #include #include #include #include #include "dspWoSchedule.h" #include "firmPlannedOrder.h" #include "purchaseRequest.h" #include "salesOrder.h" #include "transferOrder.h" #include "workOrder.h" #include "purchaseOrder.h" dspRunningAvailability::dspRunningAvailability(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspRunningAvailability", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Running Availability")); setListLabel(tr("Running Availability")); setReportName("RunningAvailability"); setMetaSQLOptions("runningAvailability", "detail"); setUseAltId(true); _ready = true; connect(list(), SIGNAL(populated()), this, SLOT(sHandleResort())); connect(list(), SIGNAL(resorted()), this, SLOT(sHandleResort())); list()->addColumn(tr("Order Type"), _itemColumn, Qt::AlignLeft, true, "ordertype"); list()->addColumn(tr("Order #"), _itemColumn, Qt::AlignLeft, true, "ordernumber"); list()->addColumn(tr("Source/Destination"), -1, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft, true, "duedate"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "qtyordered"); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "qtyreceived"); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balance"); list()->addColumn(tr("Running Avail."), _qtyColumn, Qt::AlignRight, true, "runningavail"); _qoh->setValidator(omfgThis->qtyVal()); _reorderLevel->setValidator(omfgThis->qtyVal()); _orderMultiple->setValidator(omfgThis->qtyVal()); _orderToQty->setValidator(omfgThis->qtyVal()); connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList())); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } void dspRunningAvailability::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspRunningAvailability::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _ready = false; _item->setItemsiteid(param.toInt()); _item->setReadOnly(true); _showPlanned->setFocus(); _showPlanned->init(); _ready = true; sFillList(); } return NoError; } bool dspRunningAvailability::setParams(ParameterList & params) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); params.append("firmPo", tr("Planned P/O (firmed)")); params.append("plannedPo", tr("Planned P/O")); params.append("firmWo", tr("Planned W/O (firmed)")); params.append("plannedWo", tr("Planned W/O")); params.append("firmTo", tr("Planned T/O (firmed)")); params.append("plannedTo", tr("Planned T/O")); params.append("firmWoReq", tr("Planned W/O Req. (firmed)")); params.append("plannedWoReq", tr("Planned W/O Req.")); params.append("pr", tr("Purchase Request")); if (_showPlanned->isChecked()) params.append("showPlanned"); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_metrics->value("Application") == "Standard") { XSqlQuery xtmfg; xtmfg.exec("SELECT pkghead_name FROM pkghead WHERE pkghead_name='xtmfg'"); if (xtmfg.first()) params.append("Manufacturing"); params.append("showMRPplan"); } params.append("qoh", _qoh->toDouble()); // metasql only? return true; } void dspRunningAvailability::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; QString ordertype = pSelected->text(list()->column("ordertype")); if (ordertype == tr("Planned W/O (firmed)") || ordertype == tr("Planned W/O") || ordertype == tr("Planned P/O (firmed)") || ordertype == tr("Planned P/O") ) { if (ordertype == tr("Planned W/O (firmed)") || ordertype == tr("Planned P/O (firmed)") ) pMenu->addAction(tr("Soften Order..."), this, SLOT(sSoftenOrder())); else pMenu->addAction(tr("Firm Order..."), this, SLOT(sFirmOrder())); pMenu->addAction(tr("Release Order..."), this, SLOT(sReleaseOrder())); pMenu->addAction(tr("Delete Order..."), this, SLOT(sDeleteOrder())); } else if (ordertype.contains("W/O") && !(ordertype == tr("Planned W/O Req. (firmed)") || ordertype == tr("Planned W/O Req."))) { pMenu->addAction(tr("View Work Order Details..."), this, SLOT(sViewWo())); menuItem = pMenu->addAction(tr("Work Order Schedule by Item..."), this, SLOT(sDspWoScheduleByWorkOrder())); menuItem->setEnabled( _privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders")); } else if (ordertype == "S/O") { menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewSo())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); } else if (ordertype == "T/O") { menuItem = pMenu->addAction(tr("View Transfer Order..."), this, SLOT(sViewTo())); menuItem->setEnabled(_privileges->check("ViewTransferOrders")); } else if (ordertype == "P/O") { menuItem = pMenu->addAction(tr("View Purchase Order..."), this, SLOT(sViewPo())); menuItem->setEnabled(_privileges->check("ViewPurchaseOrders") || _privileges->check("MaintainPurchaseOrders")); } } void dspRunningAvailability::sFirmOrder() { ParameterList params; params.append("planord_id", list()->id()); firmPlannedOrder newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspRunningAvailability::sSoftenOrder() { XSqlQuery dspSoftenOrder; dspSoftenOrder.prepare( "UPDATE planord " "SET planord_firm=false " "WHERE (planord_id=:planord_id);" ); dspSoftenOrder.bindValue(":planord_id", list()->id()); dspSoftenOrder.exec(); if (dspSoftenOrder.lastError().type() != QSqlError::NoError) { systemError(this, dspSoftenOrder.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspRunningAvailability::sReleaseOrder() { // TODO if (list()->currentItem()->text(list()->column("ordertype")) == tr("Planned W/O (firmed)") || list()->currentItem()->text(list()->column("ordertype")) == tr("Planned W/O")) { ParameterList params; params.append("mode", "release"); params.append("planord_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); #if 0 if (newdlg.exec() != XDialog::Rejected) { sDeleteOrder(); sFillList(); } #endif } else if (list()->currentItem()->text(list()->column("ordertype")) == tr("Planned P/O (firmed)") || list()->currentItem()->text(list()->column("ordertype")) == tr("Planned P/O")) { ParameterList params; params.append("mode", "release"); params.append("planord_id", list()->id()); purchaseRequest newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } } void dspRunningAvailability::sDeleteOrder() { XSqlQuery dspDeleteOrder; dspDeleteOrder.prepare( "SELECT deletePlannedOrder(:planord_id, false) AS result;" ); dspDeleteOrder.bindValue(":planord_id", list()->id()); dspDeleteOrder.exec(); if (dspDeleteOrder.first()) { /* TODO: uncomment when deletePlannedOrder returns INTEGER instead of BOOLEAN int result = dspDeleteOrder.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deletePlannedOrder", result), __FILE__, __LINE__); return; } */ } else if (dspDeleteOrder.lastError().type() != QSqlError::NoError) { systemError(this, dspDeleteOrder.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspRunningAvailability::sViewSo() { ParameterList params; salesOrder::viewSalesOrder(list()->id()); } void dspRunningAvailability::sViewTo() { ParameterList params; transferOrder::viewTransferOrder(list()->id()); } void dspRunningAvailability::sViewWo() { ParameterList params; params.append("mode", "view"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspRunningAvailability::sViewPo() { ParameterList params; params.append("mode", "view"); params.append("pohead_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspRunningAvailability::sFillList() { XSqlQuery dspFillList; ParameterList params; if (setParams(params) && _ready) { dspFillList.prepare( "SELECT itemsite_qtyonhand," " CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel," " CASE WHEN(itemsite_useparams) THEN itemsite_ordertoqty ELSE 0.0 END AS ordertoqty," " CASE WHEN(itemsite_useparams) THEN itemsite_multordqty ELSE 0.0 END AS multorderqty " "FROM item, itemsite " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (item_id=:item_id) );" ); dspFillList.bindValue(":item_id", _item->id()); dspFillList.bindValue(":warehous_id", _warehouse->id()); dspFillList.exec(); if (dspFillList.first()) { _qoh->setDouble(dspFillList.value("itemsite_qtyonhand").toDouble()); _reorderLevel->setDouble(dspFillList.value("reorderlevel").toDouble()); _orderMultiple->setDouble(dspFillList.value("multorderqty").toDouble()); _orderToQty->setDouble(dspFillList.value("ordertoqty").toDouble()); display::sFillList(); } else if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } } void dspRunningAvailability::sDspWoScheduleByWorkOrder() { ParameterList params; params.append("item_id", _item->id()); params.append("run"); dspWoSchedule *newdlg = new dspWoSchedule(); SetResponse setresp = newdlg->set(params); if (setresp == NoError || setresp == NoError_Run) omfgThis->handleNewWindow(newdlg); } void dspRunningAvailability::sHandleResort() { for (int i = 0; i < list()->topLevelItemCount(); i++) { XTreeWidgetItem *item = list()->topLevelItem(i); if (item->data(list()->column("runningavail"), Qt::DisplayRole).toDouble() < 0) item->setTextColor(list()->column("runningavail"), namedColor("error")); else if (item->data(list()->column("runningavail"), Qt::DisplayRole).toDouble() < _reorderLevel->toDouble()) item->setTextColor(list()->column("runningavail"), namedColor("warning")); else item->setTextColor(list()->column("runningavail"), namedColor("")); } } qt-client-4.1.0/guiclient/displays/dspRunningAvailability.h000066400000000000000000000027071217451700100240660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPRUNNINGAVAILABILITY_H #define DSPRUNNINGAVAILABILITY_H #include "guiclient.h" #include "display.h" #include "ui_dspRunningAvailability.h" class dspRunningAvailability : public display, public Ui::dspRunningAvailability { Q_OBJECT public: dspRunningAvailability(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sDeleteOrder(); virtual void sDspWoScheduleByWorkOrder(); virtual void sFirmOrder(); virtual void sHandleResort(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sReleaseOrder(); virtual void sSoftenOrder(); virtual void sViewSo(); virtual void sViewTo(); virtual void sViewWo(); virtual void sViewPo(); virtual void sFillList(); protected slots: virtual void languageChange(); private: bool _ready; }; #endif // DSPRUNNINGAVAILABILITY_H qt-client-4.1.0/guiclient/displays/dspRunningAvailability.ui000066400000000000000000000255421217451700100242560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspRunningAvailability 0 0 655 159 Running Availability Qt::Horizontal QSizePolicy::Expanding 0 20 0 7 0 5 0 1 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Preferred 0 20 Show Planned Orders Qt::Vertical QSizePolicy::Preferred 10 0 5 0 QOH: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Multiple: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 false 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Reorder Level: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Up To Qty: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 false 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 137 20 Qt::Vertical 20 17 ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _item _warehouse _showPlanned _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspSalesHistory.cpp000066400000000000000000000203751217451700100231000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSalesHistory.h" #include #include #include #include #include #include "parameterwidget.h" #include "salesHistoryInformation.h" dspSalesHistory::dspSalesHistory(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSalesHistory", fl) { setWindowTitle(tr("Sales History")); setReportName("SalesHistory"); setMetaSQLOptions("salesHistory", "detail"); setParameterWidgetVisible(true); parameterWidget()->append(tr("Invoice Start Date"), "startDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Invoice End Date"), "endDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Ship Start Date"), "shipStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Ship End Date"), "shipEndDate", ParameterWidget::Date); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->append(tr("Customer Ship-to"), "shipto_id", ParameterWidget::Shipto); parameterWidget()->appendComboBox(tr("Customer Group"), "custgrp_id", XComboBox::CustomerGroups); parameterWidget()->append(tr("Customer Group Pattern"), "custgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Sales Order"), "cohead_id", ParameterWidget::SalesOrder); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesReps); parameterWidget()->appendComboBox(tr("Shipping Zone"), "shipzone_id", XComboBox::ShippingZones); parameterWidget()->appendComboBox(tr("Sale Type"), "saletype_id", XComboBox::SaleTypes); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignLeft, true, "cohist_ordernumber" ); list()->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignLeft, true, "invoicenumber" ); list()->addColumn(tr("Ord. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_orderdate" ); list()->addColumn(tr("Invc. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_invcdate" ); list()->addColumn(tr("Sale Type"), _orderColumn, Qt::AlignLeft, true, "saletype_code" ); list()->addColumn(tr("Shipping Zone"), _orderColumn, Qt::AlignLeft, true, "shipzone_name" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription" ); list()->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "cohist_qtyshipped" ); if (_privileges->check("ViewCustomerPrices")) { list()->addColumn(tr("Unit Price"), _priceColumn, Qt::AlignRight, true, "cohist_unitprice" ); list()->addColumn(tr("Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "extprice" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight, true, "currAbbr" ); list()->addColumn(tr("Base Unit Price"), _bigMoneyColumn, Qt::AlignRight, true, "baseunitprice" ); list()->addColumn(tr("Base Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "baseextprice" ); } if (_privileges->check("ViewCosts")) { list()->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "cohist_unitcost" ); list()->addColumn(tr("Ext. Cost"), _bigMoneyColumn, Qt::AlignRight, true, "extcost" ); } } enum SetResponse dspSalesHistory::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; parameterWidget()->setSavedFilters(); param = pParams.value("cohead_id", &valid); if (valid) parameterWidget()->setDefault(tr("Sales Order"), param.toInt()); param = pParams.value("cust_id", &valid); if (valid) parameterWidget()->setDefault(tr("Customer"), param.toInt()); param = pParams.value("custtype_id", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Type"), param.toInt()); param = pParams.value("custtype_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Customer Type Pattern"), param.toString()); param = pParams.value("shipzone_id", &valid); if (valid) parameterWidget()->setDefault(tr("Shipping Zone"), param.toInt()); param = pParams.value("saletype_id", &valid); if (valid) parameterWidget()->setDefault(tr("Sale Type"), param.toInt()); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param.toInt()); param = pParams.value("prodcat_id", &valid); if (valid) parameterWidget()->setDefault(tr("Product Category"), param.toInt()); param = pParams.value("prodcat_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Product Category Pattern"), param.toString()); param = pParams.value("salesrep_id", &valid); if (valid) parameterWidget()->setDefault(tr("Sales Rep."), param.toInt()); param = pParams.value("startDate", &valid); if (valid) parameterWidget()->setDefault(tr("Invoice Start Date"), param.toDate()); else parameterWidget()->setDefault(tr("Invoice Start Date"), QVariant()); param = pParams.value("endDate", &valid); if (valid) parameterWidget()->setDefault(tr("Invoice End Date"), param.toDate()); else parameterWidget()->setDefault(tr("Invoice End Date"), QVariant()); param = pParams.value("shipStartDate", &valid); if (valid) parameterWidget()->setDefault(tr("Ship Start Date"), param.toDate()); else parameterWidget()->setDefault(tr("Ship Start Date"), QVariant()); param = pParams.value("shipEndDate", &valid); if (valid) parameterWidget()->setDefault(tr("Ship End Date"), param.toDate()); else parameterWidget()->setDefault(tr("Ship End Date"), QVariant()); param = pParams.value("shipzone_id", &valid); if (valid) parameterWidget()->setDefault(tr("Shipping Zones"), param.toInt()); param = pParams.value("warehous_id", &valid); if (valid) parameterWidget()->setDefault(tr("Site"), param.toInt()); parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspSalesHistory::setParams(ParameterList & params) { if (!display::setParams(params)) return false; if (_privileges->check("ViewCustomerPrices")) params.append("showPrices"); return true; } void dspSalesHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); if (!_privileges->check("EditSalesHistory")) menuItem->setEnabled(false); pMenu->addAction(tr("View..."), this, SLOT(sView())); } void dspSalesHistory::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("sohist_id", list()->id()); salesHistoryInformation newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspSalesHistory::sView() { ParameterList params; params.append("mode", "view"); params.append("sohist_id", list()->id()); salesHistoryInformation newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/displays/dspSalesHistory.h000066400000000000000000000017401217451700100225400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSALESHISTORY_H #define DSPSALESHISTORY_H #include "guiclient.h" #include "display.h" class dspSalesHistory : public display { Q_OBJECT public: dspSalesHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); Q_INVOKABLE virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sEdit(); virtual void sView(); }; #endif // dspSalesHistory_H qt-client-4.1.0/guiclient/displays/dspSalesOrderStatus.cpp000066400000000000000000000110611217451700100237060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSalesOrderStatus.h" #include #include "errorReporter.h" #include "inputManager.h" #include "salesOrderList.h" dspSalesOrderStatus::dspSalesOrderStatus(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSalesOrderStatus", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Sales Order Status")); setListLabel(tr("Shipment Status")); setReportName("SalesOrderStatus"); setMetaSQLOptions("salesOrderStatus", "detail"); _so->setAllowedTypes(OrderLineEdit::Sales); omfgThis->inputManager()->notify(cBCSalesOrder, this, _so, SLOT(setId(int))); list()->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "coitem_linenumber" ); list()->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyord" ); list()->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyshipped" ); list()->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyreturned" ); list()->addColumn(tr("Invoiced"), _qtyColumn, Qt::AlignRight, true, "invoiced" ); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Close Date"), _dateColumn, Qt::AlignLeft, true, "closedate" ); list()->addColumn(tr("Close User"), _itemColumn, Qt::AlignLeft, true, "closeuser" ); list()->addColumn(tr("Child Ord. #/Status"), _itemColumn, Qt::AlignCenter, true, "childinfo" ); } void dspSalesOrderStatus::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspSalesOrderStatus::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("sohead_id", &valid); if (valid) _so->setId(param.toInt()); return NoError; } bool dspSalesOrderStatus::setParams(ParameterList ¶ms) { params.append("sohead_id", _so->id()); return true; } void dspSalesOrderStatus::sFillList() { if (_so->id() != -1) { XSqlQuery coq; coq.prepare( "SELECT cohead_number," " cohead_orderdate," " cohead_custponumber," " cust_name, cntct_phone" " FROM cohead" " JOIN custinfo ON (cohead_cust_id=cust_id)" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" "WHERE (cohead_id=:sohead_id);" ); coq.bindValue(":sohead_id", _so->id()); coq.exec(); if (coq.first()) { _orderDate->setDate(coq.value("cohead_orderdate").toDate()); _poNumber->setText(coq.value("cohead_custponumber").toString()); _custName->setText(coq.value("cust_name").toString()); _custPhone->setText(coq.value("cntct_phone").toString()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting S/O"), coq, __FILE__, __LINE__)) return; coq.prepare( "SELECT MAX(lastupdated) AS lastupdated " " FROM (SELECT cohead_lastupdated AS lastupdated " " FROM cohead " " WHERE (cohead_id=:sohead_id) " " UNION " " SELECT coitem_lastupdated AS lastupdated " " FROM coitem " " WHERE (coitem_cohead_id=:sohead_id) ) AS data; " ); coq.bindValue(":sohead_id", _so->id()); coq.exec(); if (coq.first()) _lastUpdated->setDate(coq.value("lastupdated").toDate()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Dates"), coq, __FILE__, __LINE__)) return; display::sFillList(); } else { _orderDate->clear(); _poNumber->clear(); _custName->clear(); _custPhone->clear(); list()->clear(); } } qt-client-4.1.0/guiclient/displays/dspSalesOrderStatus.h000066400000000000000000000020061217451700100233520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSALESORDERSTATUS_H #define DSPSALESORDERSTATUS_H #include "guiclient.h" #include "display.h" #include "ui_dspSalesOrderStatus.h" class dspSalesOrderStatus : public display, public Ui::dspSalesOrderStatus { Q_OBJECT public: dspSalesOrderStatus(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPSALESORDERSTATUS_H qt-client-4.1.0/guiclient/displays/dspSalesOrderStatus.ui000066400000000000000000000117321217451700100235460ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSalesOrderStatus true 0 0 501 110 Sales Order Status Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Cust. Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Cust. Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Last Updated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false P/O Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Vertical 20 40 DLineEdit QWidget
    datecluster.h
    1
    OrderCluster QWidget
    ordercluster.h
    _orderDate
    qt-client-4.1.0/guiclient/displays/dspSalesOrdersByCustomer.cpp000066400000000000000000000141241217451700100247050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSalesOrdersByCustomer.h" #include #include #include #include #include "guiclient.h" #include "dspSalesOrderStatus.h" #include "dspShipmentsBySalesOrder.h" #include "returnAuthorization.h" #include "salesOrder.h" dspSalesOrdersByCustomer::dspSalesOrdersByCustomer(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSalesOrdersByCustomer", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Sales Order Lookup by Customer")); setListLabel(tr("Sales Orders")); setMetaSQLOptions("salesOrders", "detail"); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulatePo())); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Order Date:")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Order Date:")); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number" ); list()->addColumn(tr("Ordered"), _dateColumn, Qt::AlignRight, true, "cohead_orderdate" ); list()->addColumn(tr("Scheduled"), _dateColumn, Qt::AlignRight, true, "min_scheddate" ); list()->addColumn(tr("Status"), _itemColumn, Qt::AlignCenter, true, "order_status" ); list()->addColumn(tr("Ship-to"), -1, Qt::AlignLeft, true, "cohead_shiptoname" ); list()->addColumn(tr("Cust. P/O #"), 200, Qt::AlignLeft, true, "cohead_custponumber" ); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList()) ); } void dspSalesOrdersByCustomer::languageChange() { display::languageChange(); retranslateUi(this); } void dspSalesOrdersByCustomer::sPopulatePo() { XSqlQuery dspPopulatePo; _poNumber->clear(); if ((_cust->isValid()) && (_dates->allValid())) { dspPopulatePo.prepare( "SELECT MIN(cohead_id), cohead_custponumber " "FROM cohead " "WHERE ( (cohead_cust_id=:cust_id)" " AND (cohead_orderdate BETWEEN :startDate AND :endDate) ) " "GROUP BY cohead_custponumber " "ORDER BY cohead_custponumber;" ); _dates->bindValue(dspPopulatePo); dspPopulatePo.bindValue(":cust_id", _cust->id()); dspPopulatePo.exec(); _poNumber->populate(dspPopulatePo); } } void dspSalesOrdersByCustomer::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { if(_privileges->check("MaintainSalesOrders")) menuThis->addAction(tr("Edit..."), this, SLOT(sEditOrder())); menuThis->addAction(tr("View..."), this, SLOT(sViewOrder())); menuThis->addSeparator(); menuThis->addAction(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus())); menuThis->addAction(tr("Shipments..."), this, SLOT(sDspShipments())); if ( (_metrics->boolean("EnableReturnAuth")) && (_privileges->check("MaintainReturns")) ) { menuThis->addSeparator(); menuThis->addAction(tr("Create Return Authorization..."), this, SLOT(sCreateRA())); } } void dspSalesOrdersByCustomer::sEditOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::editSalesOrder(list()->id(), false); } void dspSalesOrdersByCustomer::sViewOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::viewSalesOrder(list()->id()); } void dspSalesOrdersByCustomer::sCreateRA() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("mode", "new"); params.append("sohead_id", list()->id()); returnAuthorization *newdlg = new returnAuthorization(); if (newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else QMessageBox::critical(this, tr("Could Not Open Window"), tr("The new Return Authorization could not be created")); } void dspSalesOrdersByCustomer::sDspShipmentStatus() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspSalesOrderStatus *newdlg = new dspSalesOrderStatus(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSalesOrdersByCustomer::sDspShipments() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspShipmentsBySalesOrder *newdlg = new dspShipmentsBySalesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspSalesOrdersByCustomer::setParams(ParameterList ¶ms) { if ( !(( (_allPOs->isChecked()) || ( (_selectedPO->isChecked()) && (_poNumber->currentIndex() != -1) ) ) && (_dates->allValid()) )) { QMessageBox::warning(this, tr("Incomplete Options"), tr("One or more of the options are incomplete.")); return false; } _dates->appendValue(params); params.append("noLines", tr("No Lines")); params.append("closed", tr("Closed")); params.append("open", tr("Open")); params.append("partial", tr("Partial")); params.append("cust_id", _cust->id()); if (_selectedPO->isChecked()) params.append("poNumber", _poNumber->currentText()); return true; } bool dspSalesOrdersByCustomer::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkSOSitePrivs(:coheadid) AS result;"); check.bindValue(":coheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Sales Order as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/displays/dspSalesOrdersByCustomer.h000066400000000000000000000023551217451700100243550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSALESORDERSBYCUSTOMER_H #define DSPSALESORDERSBYCUSTOMER_H #include "display.h" #include "ui_dspSalesOrdersByCustomer.h" class dspSalesOrdersByCustomer : public display, public Ui::dspSalesOrdersByCustomer { Q_OBJECT public: dspSalesOrdersByCustomer(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); virtual bool setParams(ParameterList&); public slots: virtual void sPopulatePo(); virtual void sPopulateMenu( QMenu * menuThis, QTreeWidgetItem*, int); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sCreateRA(); virtual void sDspShipmentStatus(); virtual void sDspShipments(); protected slots: virtual void languageChange(); }; #endif // DSPSALESORDERSBYCUSTOMER_H qt-client-4.1.0/guiclient/displays/dspSalesOrdersByCustomer.ui000066400000000000000000000112551217451700100245420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSalesOrdersByCustomer 0 0 541 152 Sales Order Lookup by Customer Qt::Vertical QSizePolicy::Expanding 20 0 0 5 All P/O #s false Selected P/O #: true Qt::Horizontal 0 20 Qt::Vertical 20 0 Qt::Horizontal 0 20 CustCluster QWidget
    custcluster.h
    DateCluster QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    _cust _allPOs _selectedPO _poNumber _dates _selectedPO toggled(bool) _poNumber setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspSalesOrdersByCustomerPO.cpp000066400000000000000000000130401217451700100251400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSalesOrdersByCustomerPO.h" #include #include #include #include "dspSalesOrderStatus.h" #include "dspShipmentsBySalesOrder.h" #include "returnAuthorization.h" #include "salesOrder.h" dspSalesOrdersByCustomerPO::dspSalesOrdersByCustomerPO(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSalesOrdersByCustomerPO", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Sales Order Lookup by Customer PO")); setListLabel(tr("Sales Orders")); setMetaSQLOptions("salesOrders", "detail"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Order Date:")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Order Date:")); list()->addColumn(tr("Cust #"), _itemColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Customer"), _itemColumn, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number" ); list()->addColumn(tr("Ordered"), _dateColumn, Qt::AlignRight, true, "cohead_orderdate" ); list()->addColumn(tr("Scheduled"), _dateColumn, Qt::AlignRight, true, "min_scheddate" ); list()->addColumn(tr("Status"), _itemColumn, Qt::AlignCenter, true, "order_status" ); list()->addColumn(tr("Ship-to"), -1, Qt::AlignLeft, true, "cohead_shiptoname" ); list()->addColumn(tr("Cust. P/O #"), 200, Qt::AlignLeft, true, "cohead_custponumber" ); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList()) ); } void dspSalesOrdersByCustomerPO::languageChange() { display::languageChange(); retranslateUi(this); } void dspSalesOrdersByCustomerPO::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { if(_privileges->check("MaintainSalesOrders")) menuThis->addAction(tr("Edit..."), this, SLOT(sEditOrder())); menuThis->addAction(tr("View..."), this, SLOT(sViewOrder())); menuThis->addSeparator(); menuThis->addAction(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus())); menuThis->addAction(tr("Shipments..."), this, SLOT(sDspShipments())); if ( (_metrics->boolean("EnableReturnAuth")) && (_privileges->check("MaintainReturns")) ) { menuThis->addSeparator(); menuThis->addAction(tr("Create Return Authorization..."), this, SLOT(sCreateRA())); } } void dspSalesOrdersByCustomerPO::sEditOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::editSalesOrder(list()->id(), false); } void dspSalesOrdersByCustomerPO::sViewOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::viewSalesOrder(list()->id()); } void dspSalesOrdersByCustomerPO::sCreateRA() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("mode", "new"); params.append("sohead_id", list()->id()); returnAuthorization *newdlg = new returnAuthorization(); if (newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else QMessageBox::critical(this, tr("Could Not Open Window"), tr("The new Return Authorization could not be created")); } void dspSalesOrdersByCustomerPO::sDspShipmentStatus() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspSalesOrderStatus *newdlg = new dspSalesOrderStatus(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSalesOrdersByCustomerPO::sDspShipments() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspShipmentsBySalesOrder *newdlg = new dspShipmentsBySalesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspSalesOrdersByCustomerPO::setParams(ParameterList ¶ms) { if (_poNumber->text().trimmed().length() == 0) { QMessageBox::warning(this, tr("P/O Number Required"), tr("You must specify a P/O Number.")); return false; } if (!_dates->allValid()) { QMessageBox::warning(this, tr("Dates Required"), tr("You must specify a valid Date Range.")); return false; } _dates->appendValue(params); params.append("noLines", tr("No Lines")); params.append("closed", tr("Closed")); params.append("open", tr("Open")); params.append("partial", tr("Partial")); params.append("poNumber", _poNumber->text()); return true; } bool dspSalesOrdersByCustomerPO::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkSOSitePrivs(:coheadid) AS result;"); check.bindValue(":coheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Sales Order as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/displays/dspSalesOrdersByCustomerPO.h000066400000000000000000000023321217451700100246070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSALESORDERSBYCUSTOMERPO_H #define DSPSALESORDERSBYCUSTOMERPO_H #include "display.h" #include "ui_dspSalesOrdersByCustomerPO.h" class dspSalesOrdersByCustomerPO : public display, public Ui::dspSalesOrdersByCustomerPO { Q_OBJECT public: dspSalesOrdersByCustomerPO(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); virtual bool setParams(ParameterList&); public slots: virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sCreateRA(); virtual void sDspShipmentStatus(); virtual void sDspShipments(); protected slots: virtual void languageChange(); }; #endif // DSPSALESORDERSBYCUSTOMERPO_H qt-client-4.1.0/guiclient/displays/dspSalesOrdersByCustomerPO.ui000066400000000000000000000063001217451700100247740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSalesOrdersByCustomerPO 0 0 461 73 Sales Order Lookup by Customer PO 0 0 5 0 PO Number: Qt::Vertical QSizePolicy::Expanding 20 0 0 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DateCluster QWidget
    datecluster.h
    _poNumber _dates
    qt-client-4.1.0/guiclient/displays/dspSalesOrdersByItem.cpp000066400000000000000000000133461217451700100240070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSalesOrdersByItem.h" #include #include #include #include #include "guiclient.h" #include "dspSalesOrderStatus.h" #include "dspShipmentsBySalesOrder.h" #include "returnAuthorization.h" #include "salesOrder.h" dspSalesOrdersByItem::dspSalesOrdersByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSalesOrdersByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Sales Order Lookup by Item")); setListLabel(tr("Sales Orders")); setMetaSQLOptions("salesOrderItems", "detail"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Order Date:")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Order Date:")); _item->setType(ItemLineEdit::cSold); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number" ); list()->addColumn(tr("Order Date"), _dateColumn, Qt::AlignCenter, true, "cohead_orderdate" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyord" ); list()->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyshipped" ); list()->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyreturned" ); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "qtybalance" ); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList())); } void dspSalesOrdersByItem::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspSalesOrdersByItem::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); return NoError; } void dspSalesOrdersByItem::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { if(_privileges->check("MaintainSalesOrders")) menuThis->addAction(tr("Edit..."), this, SLOT(sEditOrder())); menuThis->addAction(tr("View..."), this, SLOT(sViewOrder())); menuThis->addSeparator(); menuThis->addAction(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus())); menuThis->addAction(tr("Shipments.."), this, SLOT(sDspShipments())); if ( (_metrics->boolean("EnableReturnAuth")) && (_privileges->check("MaintainReturns")) ) { menuThis->addSeparator(); menuThis->addAction(tr("Create Return Authorization..."), this, SLOT(sCreateRA())); } } void dspSalesOrdersByItem::sEditOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::editSalesOrder(list()->id(), false); } void dspSalesOrdersByItem::sViewOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::viewSalesOrder(list()->id()); } void dspSalesOrdersByItem::sCreateRA() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("mode", "new"); params.append("sohead_id", list()->id()); returnAuthorization *newdlg = new returnAuthorization(); if (newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else QMessageBox::critical(this, tr("Could Not Open Window"), tr("The new Return Authorization could not be created")); } void dspSalesOrdersByItem::sDspShipmentStatus() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspSalesOrderStatus *newdlg = new dspSalesOrderStatus(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSalesOrdersByItem::sDspShipments() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspShipmentsBySalesOrder *newdlg = new dspShipmentsBySalesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspSalesOrdersByItem::setParams(ParameterList ¶ms) { if (!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } if(!_dates->allValid()) { QMessageBox::warning(this, tr("Dates Required"), tr("You must specify a valid Date range.")); return false; } _dates->appendValue(params); params.append("closed", tr("Closed")); params.append("item_id", _item->id()); return true; } bool dspSalesOrdersByItem::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkSOSitePrivs(:coheadid) AS result;"); check.bindValue(":coheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("

    You may not view or edit this Sales Order " "as it references a Site for which you have " "not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/displays/dspSalesOrdersByItem.h000066400000000000000000000024041217451700100234450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSALESORDERSBYITEM_H #define DSPSALESORDERSBYITEM_H #include "guiclient.h" #include "display.h" #include "ui_dspSalesOrdersByItem.h" class dspSalesOrdersByItem : public display, public Ui::dspSalesOrdersByItem { Q_OBJECT public: dspSalesOrdersByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); virtual bool setParams(ParameterList&); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sCreateRA(); virtual void sDspShipmentStatus(); virtual void sDspShipments(); protected slots: virtual void languageChange(); }; #endif // DSPSALESORDERSBYITEM_H qt-client-4.1.0/guiclient/displays/dspSalesOrdersByItem.ui000066400000000000000000000055751217451700100236470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSalesOrdersByItem 0 0 537 88 Sales Order Lookup by Item 0 Qt::Vertical 20 0 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DateCluster QWidget

    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    _item _dates qt-client-4.1.0/guiclient/displays/dspSalesOrdersByParameterList.cpp000066400000000000000000000145111217451700100256600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSalesOrdersByParameterList.h" #include #include #include #include #include "guiclient.h" #include "dspSalesOrderStatus.h" #include "dspShipmentsBySalesOrder.h" #include "returnAuthorization.h" #include "salesOrder.h" dspSalesOrdersByParameterList::dspSalesOrdersByParameterList(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSalesOrdersByParameterList", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Sales Order Lookup by Parameter List")); setListLabel(tr("Sales Orders")); setMetaSQLOptions("salesOrders", "detail"); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setStartCaption(tr("Starting Order Date:")); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _dates->setEndCaption(tr("Ending Order Date:")); list()->addColumn(tr("Customer"), _itemColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number" ); list()->addColumn(tr("Ordered"), _dateColumn, Qt::AlignRight, true, "cohead_orderdate" ); list()->addColumn(tr("Scheduled"), _dateColumn, Qt::AlignRight, true, "min_scheddate" ); list()->addColumn(tr("Status"), _itemColumn, Qt::AlignCenter, true, "order_status" ); list()->addColumn(tr("Ship-to"), -1, Qt::AlignLeft, true, "cohead_shiptoname" ); list()->addColumn(tr("Cust. P/O #"), 200, Qt::AlignLeft, true, "cohead_custponumber" ); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList()) ); } void dspSalesOrdersByParameterList::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspSalesOrdersByParameterList::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("custtype", &valid); if (valid) _parameter->setType(ParameterGroup::CustomerType); param = pParams.value("custtype_id", &valid); if (valid) { _parameter->setType(ParameterGroup::CustomerType); _parameter->setId(param.toInt()); } param = pParams.value("custtype_pattern", &valid); if (valid) { _parameter->setType(ParameterGroup::CustomerType); _parameter->setPattern(param.toString()); } param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); if (_parameter->type() == ParameterGroup::CustomerType) setWindowTitle(tr("Sales Order Lookup by Customer Type")); return NoError; } void dspSalesOrdersByParameterList::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { if(list()->id() == -1) return; if(_privileges->check("MaintainSalesOrders")) menuThis->addAction(tr("Edit..."), this, SLOT(sEditOrder())); menuThis->addAction(tr("View..."), this, SLOT(sViewOrder())); menuThis->addSeparator(); menuThis->addAction(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus())); menuThis->addAction(tr("Shipments..."), this, SLOT(sDspShipments())); if ( (_metrics->boolean("EnableReturnAuth")) && (_privileges->check("MaintainReturns")) ) { menuThis->addSeparator(); menuThis->addAction(tr("Create Return Authorization..."), this, SLOT(sCreateRA())); } } void dspSalesOrdersByParameterList::sEditOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::editSalesOrder(list()->id(), false); } void dspSalesOrdersByParameterList::sViewOrder() { if (!checkSitePrivs(list()->id())) return; salesOrder::viewSalesOrder(list()->id()); } void dspSalesOrdersByParameterList::sCreateRA() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("mode", "new"); params.append("sohead_id", list()->id()); returnAuthorization *newdlg = new returnAuthorization(); if (newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else QMessageBox::critical(this, tr("Could Not Open Window"), tr("The new Return Authorization could not be created")); } void dspSalesOrdersByParameterList::sDspShipmentStatus() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspSalesOrderStatus *newdlg = new dspSalesOrderStatus(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSalesOrdersByParameterList::sDspShipments() { if (!checkSitePrivs(list()->id())) return; ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspShipmentsBySalesOrder *newdlg = new dspShipmentsBySalesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspSalesOrdersByParameterList::setParams(ParameterList ¶ms) { if (!_dates->allValid()) { QMessageBox::warning(this, tr("Dates Required"), tr("You must specify a valid Date range.")); return false; } _dates->appendValue(params); _parameter->appendValue(params); params.append("noLines", tr("No Lines")); params.append("closed", tr("Closed")); params.append("open", tr("Open")); params.append("partial", tr("Partial")); params.append("orderByCust"); return true; } bool dspSalesOrdersByParameterList::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkSOSitePrivs(:coheadid) AS result;"); check.bindValue(":coheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Sales Order as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/displays/dspSalesOrdersByParameterList.h000066400000000000000000000025111217451700100253220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSALESORDERSBYPARAMETERLIST_H #define DSPSALESORDERSBYPARAMETERLIST_H #include "guiclient.h" #include "display.h" #include "ui_dspSalesOrdersByParameterList.h" class dspSalesOrdersByParameterList : public display, public Ui::dspSalesOrdersByParameterList { Q_OBJECT public: dspSalesOrdersByParameterList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sEditOrder(); virtual void sViewOrder(); virtual void sCreateRA(); virtual void sDspShipmentStatus(); virtual void sDspShipments(); protected slots: virtual void languageChange(); }; #endif // DSPSALESORDERSBYPARAMETERLIST_H qt-client-4.1.0/guiclient/displays/dspSalesOrdersByParameterList.ui000066400000000000000000000061731217451700100255200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSalesOrdersByParameterList 0 0 543 118 Sales Order Lookup by Parameter List 0 false Qt::Vertical 20 0 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 1 20 DateCluster QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    _parameter
    qt-client-4.1.0/guiclient/displays/dspShipmentsBase.cpp000066400000000000000000000251031217451700100232060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspShipmentsBase.h" #include #include #include #include #include #include #include #include #include "errorReporter.h" #include "inputManager.h" #include "printShippingForm.h" dspShipmentsBase::dspShipmentsBase(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { setupUi(optionsWidget()); setListLabel(tr("Shipments")); setMetaSQLOptions("shipments", "detail"); setUseAltId(true); connect(_shipment, SIGNAL(newId(int)), this, SLOT(sPopulateShipment(int))); connect(_salesOrder, SIGNAL(newId(int,QString)), this, SLOT(sPopulateSalesOrder(int))); _salesOrder->setAllowedTypes(OrderLineEdit::Sales); _shipment->setType("SO"); omfgThis->inputManager()->notify(cBCSalesOrder, this, _salesOrder, SLOT(setId(int))); list()->setRootIsDecorated(true); list()->addColumn(tr("Shipment #"), _orderColumn, Qt::AlignLeft, true, "shiphead_number" ); list()->addColumn(tr("Ship Date"), _itemColumn, Qt::AlignCenter, true, "shiphead_shipdate" ); list()->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "linenumber" ); list()->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "qtyord" ); list()->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "qtyshipped" ); list()->addColumn(tr("Tracking Number"), _qtyColumn, Qt::AlignRight, true, "shiphead_tracknum" ); list()->addColumn(tr("Freight at Shipping"), _qtyColumn, Qt::AlignRight, true, "shiphead_freight" ); } void dspShipmentsBase::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspShipmentsBase::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("sohead_id", &valid); if (valid) { _salesOrder->setId(param.toInt()); _salesOrder->setEnabled(false); } param = pParams.value("shiphead_id", &valid); if (valid) { _shipment->setId(param.toInt()); _shipment->setEnabled(false); } return NoError; } void dspShipmentsBase::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Print Shipping Form..."), this, SLOT(sPrintShippingForm())); menuItem->setEnabled(_privileges->check("PrintBillsOfLading")); menuItem = pMenu->addAction(tr("Query Shipment Status..."), this, SLOT(sFillURL())); } bool dspShipmentsBase::setParams(ParameterList& params) { if(_salesOrder->isVisibleTo(this)) params.append("sohead_id", _salesOrder->id()); if(_shipment->isVisibleTo(this)) { params.append("shiphead_id", _shipment->id()); params.append("MultiWhs", true); } return true; } void dspShipmentsBase::sPrintShippingForm() { ParameterList params; params.append("shiphead_id", list()->id()); printShippingForm newdlg(this); newdlg.set(params); newdlg.exec(); } void dspShipmentsBase::sPopulateSalesOrder(int pSoheadid) { if (pSoheadid != -1) { XSqlQuery coq; coq.prepare( "SELECT cohead_number," " cohead_orderdate," " cohead_custponumber," " cust_name, cntct_phone " " FROM cohead" " JOIN custinfo ON (cohead_cust_id=cust_id)" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" " WHERE (cohead_id=:sohead_id);" ); coq.bindValue(":sohead_id", pSoheadid); coq.exec(); if (coq.first()) { _orderDate->setDate(coq.value("cohead_orderdate").toDate()); _poNumber->setText(coq.value("cohead_custponumber").toString()); _custName->setText(coq.value("cust_name").toString()); _custPhone->setText(coq.value("cntct_phone").toString()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Sales Order"), coq, __FILE__, __LINE__)) return; } else { _orderDate->clear(); _poNumber->clear(); _custName->clear(); _custPhone->clear(); } } void dspShipmentsBase::sPopulateShipment(int pShipheadid) { if (pShipheadid != -1) { XSqlQuery shq; shq.prepare("SELECT cust_name, cntct_phone," " cohead_orderdate AS orderdate," " cohead_custponumber AS custponumber" " FROM shiphead" " JOIN cohead ON (shiphead_order_id=cohead_id)" " JOIN custinfo ON (cohead_cust_id=cust_id)" " JOIN cntct ON (cust_cntct_id=cntct_id)" " WHERE (shiphead_id=:shiphead_id) AND (shiphead_order_type='SO')" " UNION " "SELECT warehous_code, cntct_phone," " tohead_orderdate AS orderdate," " NULL AS custponumber" " FROM shiphead" " JOIN tohead ON (shiphead_order_id=tohead_id)" " JOIN whsinfo ON (tohead_dest_warehous_id=warehous_id)" " LEFT OUTER JOIN cntct ON (warehous_cntct_id=cntct_id)" " WHERE (shiphead_id=:shiphead_id) AND (shiphead_order_type='TO');"); shq.bindValue(":shiphead_id", pShipheadid); shq.exec(); if (shq.first()) { _orderDate->setDate(shq.value("orderdate").toDate()); _poNumber->setText(shq.value("custponumber").toString()); _custName->setText(shq.value("cust_name").toString()); _custPhone->setText(shq.value("cntct_phone").toString()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Shipment"), shq, __FILE__, __LINE__)) return; } else { _poNumber->clear(); _custName->clear(); _custPhone->clear(); } } void dspShipmentsBase::sFillURL() { XSqlQuery shq; shq.prepare("SELECT UPPER(shiphead_shipvia) AS shiphead_shipvia," " shiphead_tracknum, cohead_shiptozipcode " " FROM shiphead, cohead " " WHERE ((shiphead_id=:shiphead_id) " " AND (shiphead_order_id=cohead_id));"); shq.bindValue(":shiphead_id", list()->id()); shq.exec(); if (shq.first()) { QString url; bool canOpenTrackingPage = true; QString tracknum = shq.value("shiphead_tracknum").toString(); QString shipvia = shq.value("shiphead_shipvia").toString(); if (shipvia.startsWith("UPS")) { url = "http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&loc=en_US&Requester=UPSHome&tracknum="; url += tracknum; url += "&AgreeToTermsAndConditions=yes&track.x=40&track.y=9"; } if (shipvia.startsWith("SAIA")) { url = "http://www.SaiaSecure.com/tracing/manifest.asp?UID=&PWD=&PRONum1="; int _how_many = tracknum.length() - 5; QString _partial; _partial = tracknum.left(3); _partial += tracknum.mid( 4, _how_many); url += _partial; url += "&Type=Pro&x=55&y=8"; } if (shipvia.startsWith("A & B") || shipvia.startsWith("A&B")) { url = "http://www.aandbfreight.com/"; canOpenTrackingPage = false; } if (shipvia.startsWith("AVERITT")) { url = "http://www.averittexpress.com/"; canOpenTrackingPage = false; } if (shipvia.startsWith("DHL")) { // see http://www.dhl-usa.com/en/express/tracking/tracking_tools.html url = QString("http://www.dhl-usa.com/home/content/us/en/express/tracking.shtml?brand=DHL&AWB=") + tracknum; } if (shipvia.startsWith("FEDEX")) { url = "http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcom&cntry_code=us&language=english&tracknumbers="; QString _partial; QString _check_tail; _check_tail = tracknum.right(2); _check_tail = _check_tail.left(1); if (_check_tail == "-") { // Ok we need to strip the hyphen out _partial = tracknum.left(tracknum.length() - 2); _partial += tracknum.right(1); } else _partial = tracknum; url += _partial; } if (shipvia.startsWith("R & L") || shipvia.startsWith("R&L")) { url = "http://www.rlcarriers.com/index.asp"; canOpenTrackingPage = false; } if (shipvia.startsWith("ROADWAY")) { url = "http://www.quiktrak.roadway.com/cgi-bin/quiktrak?type=0&pro0="; url += tracknum; url += "&zip0="; url += shq.value("cohead_shiptozipcode").toString (); } if (shipvia.startsWith("USF")) { url = "http://www.usfc.com/shipmentStatus/shipmentStatustWS.jsp?TrackType=H&TrackNumber="; url += tracknum; } if (shipvia.startsWith("WATKINS")) { url = "http://www.watkins.com/"; canOpenTrackingPage = false; } if (shipvia.startsWith("YELLOW")) { /* TODO: http://my.yrc.com/dynamic/national/servlet? CONTROLLER=com.rdwy.ec.rextracking .http.controller.ProcessPublicTrackingController &type=1&pro0=nnnnnnnnnn&ozip0=nnnnn&dzip0=nnnnnn type = 1 to track by bill of lading #, 2 by p/o #, 3 by booking # ozip0 = origin zip code, dzip = destination zip code */ url = "http://www.myyellow.com/dynamic/services/content/index.jsp"; canOpenTrackingPage = false; } if (url.isEmpty()) QMessageBox::information(this, tr("Shipper"), tr("We do not currently process the shipper %1.") .arg(shipvia)); else omfgThis->launchBrowser(this, url); if (! canOpenTrackingPage) QMessageBox::information(this, tr("Cannot Track %1").arg(shipvia), tr("We cannot directly show tracking pages for " "the shipper %1. The tracking number is %2.") .arg(shipvia, tracknum)); } else if (shq.lastError().type() != QSqlError::NoError) { systemError(this, shq.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/displays/dspShipmentsBase.h000066400000000000000000000023321217451700100226520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DSPSHIPMENTSBASE_H__ #define __DSPSHIPMENTSBASE_H__ #include "guiclient.h" #include "display.h" #include #include "ui_dspShipmentsBase.h" class dspShipmentsBase : public display, public Ui::dspShipmentsBase { Q_OBJECT public: dspShipmentsBase(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pItem, int); virtual void sPrintShippingForm(); virtual void sPopulateSalesOrder(int); virtual void sPopulateShipment(int); virtual void sFillURL(); protected slots: virtual void languageChange(); }; #endif // __DSPSHIPMENTSBASE_H__ qt-client-4.1.0/guiclient/displays/dspShipmentsBase.ui000066400000000000000000000215101217451700100230370ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspShipmentsBase true 0 0 692 93 0 0 Shipments by QFrame::NoFrame QFrame::Plain 0 5 5 Sales Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 5 false false 0 false Qt::Horizontal QSizePolicy::Preferred 20 20 Qt::Vertical 20 6 Qt::StrongFocus Shipment: Qt::Vertical 20 0 0 5 0 Cust. Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Cust. Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter P/O Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 0 0 Qt::Vertical 20 0 Qt::Horizontal 0 20 DLineEdit QWidget
    datecluster.h
    OrderCluster QWidget
    ordercluster.h
    ShipmentCluster QWidget
    shipmentcluster.h
    qt-client-4.1.0/guiclient/displays/dspShipmentsByDate.cpp000066400000000000000000000072301217451700100235050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ // TODO: add checkboxes to distinguish between sales and transfer orders #include "dspShipmentsByDate.h" #include #include #include #include #include "inputManager.h" #include "printShippingForm.h" dspShipmentsByDate::dspShipmentsByDate(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspShipmentsByDate", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Shipments by Date")); setListLabel(tr("Shipments")); setReportName("ShipmentsByDate"); setMetaSQLOptions("shipments", "detail"); setUseAltId(true); list()->setRootIsDecorated(true); list()->addColumn(tr("Shipment #"), _orderColumn, Qt::AlignLeft, true, "shiphead_number" ); list()->addColumn(tr("Order Type"), 80, Qt::AlignLeft, true, "shiphead_order_type" ); list()->addColumn(tr("Ship Date"), _itemColumn, Qt::AlignCenter, true, "shiphead_shipdate"); list()->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "linenumber"); list()->addColumn(tr("S/O #/Item"), _itemColumn, Qt::AlignLeft, true, "order_item" ); list()->addColumn(tr("Customer/Description"), -1, Qt::AlignLeft, true, "cust_desc" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code"); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "qtyord" ); list()->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "qtyshipped" ); list()->addColumn(tr("Tracking #"), _qtyColumn, Qt::AlignRight, true, "shiphead_tracknum" ); list()->addColumn(tr("Freight at Shipping"), _qtyColumn, Qt::AlignRight, true, "shiphead_freight" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight, true, "freight_curr_abbr" ); } void dspShipmentsByDate::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspShipmentsByDate::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspShipmentsByDate::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Print Shipping Form..."), this, SLOT(sPrintShippingForm())); menuItem->setEnabled(_privileges->check("PrintBillsOfLading")); } bool dspShipmentsByDate::setParams(ParameterList & params) { if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter a Valid Start Date and End Date"), tr("You must enter a valid Start Date and End Date for this report.") ); _dates->setFocus(); return false; } if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); _dates->appendValue(params); return true; } void dspShipmentsByDate::sPrintShippingForm() { ParameterList params; params.append("shiphead_id", list()->id()); printShippingForm newdlg(this); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/displays/dspShipmentsByDate.h000066400000000000000000000021241217451700100231470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSHIPMENTSBYDATE_H #define DSPSHIPMENTSBYDATE_H #include "guiclient.h" #include "display.h" #include "ui_dspShipmentsByDate.h" class dspShipmentsByDate : public display, public Ui::dspShipmentsByDate { Q_OBJECT public: dspShipmentsByDate(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pItem, int); virtual void sPrintShippingForm(); protected slots: virtual void languageChange(); }; #endif // DSPSHIPMENTSBYDATE_H qt-client-4.1.0/guiclient/displays/dspShipmentsByDate.ui000066400000000000000000000050151217451700100233370ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspShipmentsByDate true 0 0 223 73 0 0 Shipments by Date 0 0 Qt::Vertical QSizePolicy::Preferred 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DateCluster QWidget
    datecluster.h
    _dates parameter.h
    qt-client-4.1.0/guiclient/displays/dspShipmentsBySalesOrder.cpp000066400000000000000000000013661217451700100246770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspShipmentsBySalesOrder.h" dspShipmentsBySalesOrder::dspShipmentsBySalesOrder(QWidget* parent, const char*, Qt::WFlags fl) : dspShipmentsBase(parent, "dspShipmentsBySalesOrder", fl) { setWindowTitle(tr("Shipments by Sales Order")); setReportName("ShipmentsBySalesOrder"); _shipment->hide(); } qt-client-4.1.0/guiclient/displays/dspShipmentsBySalesOrder.h000066400000000000000000000014021217451700100243330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSHIPMENTSBYSALESORDER_H #define DSPSHIPMENTSBYSALESORDER_H #include "dspShipmentsBase.h" class dspShipmentsBySalesOrder : public dspShipmentsBase { Q_OBJECT public: dspShipmentsBySalesOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); }; #endif // DSPSHIPMENTSBYSALESORDER_H qt-client-4.1.0/guiclient/displays/dspShipmentsByShipment.cpp000066400000000000000000000013601217451700100244150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspShipmentsByShipment.h" dspShipmentsByShipment::dspShipmentsByShipment(QWidget* parent, const char*, Qt::WFlags fl) : dspShipmentsBase(parent, "dspShipmentsByShipment", fl) { setWindowTitle(tr("Shipments by Shipment")); setReportName("ShipmentsByShipment"); _salesOrderGroup->hide(); } qt-client-4.1.0/guiclient/displays/dspShipmentsByShipment.h000066400000000000000000000013701217451700100240630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSHIPMENTSBYSHIPMENT_H #define DSPSHIPMENTSBYSHIPMENT_H #include "dspShipmentsBase.h" class dspShipmentsByShipment : public dspShipmentsBase { Q_OBJECT public: dspShipmentsByShipment(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); }; #endif // DSPSHIPMENTSBYSHIPMENT_H qt-client-4.1.0/guiclient/displays/dspSingleLevelBOM.cpp000066400000000000000000000044331217451700100232130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSingleLevelBOM.h" #include dspSingleLevelBOM::dspSingleLevelBOM(QWidget* parent, const char*, Qt::WFlags fl) : dspBOMBase(parent, "dspSingleLevelBOM", fl) { setWindowTitle(tr("Single Level Bill of Materials")); setReportName("SingleLevelBOM"); list()->addColumn(tr("#"), 30, Qt::AlignCenter,true, "bomitem_seqnumber" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription" ); list()->addColumn(tr("Issue UOM"), _uomColumn, Qt::AlignCenter,true, "issueuomname" ); list()->addColumn(tr("Issue Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "bomitem_qtyfxd" ); list()->addColumn(tr("Issue Qty. Per"), _qtyColumn, Qt::AlignRight, true, "bomitem_qtyper" ); list()->addColumn(tr("Inv. UOM"), _uomColumn, Qt::AlignCenter,true, "invuomname" ); list()->addColumn(tr("Inv. Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "invqtyfxd" ); list()->addColumn(tr("Inv. Qty. Per"), _qtyColumn, Qt::AlignRight, true, "invqtyper" ); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomitem_scrap" ); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter,true, "bomitem_effective" ); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter,true, "bomitem_expires" ); list()->addColumn(tr("ECN #"), _itemColumn, Qt::AlignLeft, true, "bomitem_ecn" ); list()->addColumn(tr("Notes"), _itemColumn, Qt::AlignLeft, false, "bomitem_notes" ); list()->addColumn(tr("Reference"), _itemColumn, Qt::AlignLeft, false, "bomitem_ref" ); } bool dspSingleLevelBOM::setParams(ParameterList ¶ms) { params.append("bySingleLvl"); return dspBOMBase::setParams(params); } qt-client-4.1.0/guiclient/displays/dspSingleLevelBOM.h000066400000000000000000000014071217451700100226560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSINGLELEVELBOM_H #define DSPSINGLELEVELBOM_H #include "dspBOMBase.h" class dspSingleLevelBOM : public dspBOMBase { Q_OBJECT public: dspSingleLevelBOM(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList ¶ms); }; #endif // DSPSINGLELEVELBOM_H qt-client-4.1.0/guiclient/displays/dspSingleLevelWhereUsed.cpp000066400000000000000000000116731217451700100244750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSingleLevelWhereUsed.h" #include #include #include #include #include "bom.h" #include "dspInventoryHistory.h" #include "item.h" dspSingleLevelWhereUsed::dspSingleLevelWhereUsed(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSingleLevelWhereUsed", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Single Level Where Used")); setListLabel(tr("Bill of Materials Items")); setReportName("SingleLevelWhereUsed"); setMetaSQLOptions("whereUsed", "detail"); if (_metrics->boolean("AllowInactiveBomItems")) _item->setType(ItemLineEdit::cGeneralComponents); else _item->setType(ItemLineEdit::cGeneralComponents | ItemLineEdit::cActive); _effective->setNullString(tr("Today")); _effective->setNullDate(QDate::currentDate()); _effective->setAllowNullDate(true); _effective->setNull(); list()->addColumn(tr("Seq #"), 40, Qt::AlignCenter, true, "bomitem_seqnumber"); list()->addColumn(tr("Parent Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name"); list()->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "qtyfxd"); list()->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "qtyper"); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomitem_scrap"); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter,true, "bomitem_effective"); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter,true, "bomitem_expires"); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), SLOT(sFillList())); } void dspSingleLevelWhereUsed::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspSingleLevelWhereUsed::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); param = pParams.value("effective", &valid); if (valid) _effective->setDate(param.toDate()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspSingleLevelWhereUsed::sPopulateMenu(QMenu *menu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = menu->addAction(tr("Edit Bill of Materials..."), this, SLOT(sEditBOM())); if (!_privileges->check("MaintainBOMs")) menuItem->setEnabled(false); menuItem = menu->addAction(tr("Edit Item Master..."), this, SLOT(sEditItem())); if (!_privileges->check("MaintainItemMasters")) menuItem->setEnabled(false); menuItem = menu->addAction(tr("View Item Inventory History..."), this, SLOT(sViewInventoryHistory())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); } void dspSingleLevelWhereUsed::sEditBOM() { ParameterList params; params.append("mode", "edit"); params.append("item_id", list()->id()); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSingleLevelWhereUsed::sEditItem() { item::editItem(list()->id()); } void dspSingleLevelWhereUsed::sViewInventoryHistory() { ParameterList params; XSqlQuery qq; qq.prepare( "SELECT item_id " "FROM item JOIN bomitem ON (bomitem_parent_item_id=item_id) " "WHERE (bomitem_parent_item_id = :bomitem_parent_item_id) " ); qq.bindValue(":bomitem_parent_item_id", list()->id()); qq.exec(); if (qq.first()) { int _itemId = qq.value("item_id").toInt(); params.append("item_id", _itemId); } params.append("warehous_id", -1); params.append("run"); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspSingleLevelWhereUsed::setParams(ParameterList ¶ms) { if (!_item->isValid()) { QMessageBox::warning( this, tr("Enter a Valid Item Number"), tr("You must enter a valid Item Number.") ); _item->setFocus(); return false; } params.append("item_id", _item->id()); if (_effective->isNull()) params.append("notEffective"); else params.append("effective", _effective->date()); params.append("Always", tr("Always")); params.append("Never", tr("Never")); params.append("Push", tr("Push")); params.append("Pull", tr("Pull")); params.append("Mixed", tr("Mixed")); params.append("Special", tr("Special")); return true; } qt-client-4.1.0/guiclient/displays/dspSingleLevelWhereUsed.h000066400000000000000000000022271217451700100241350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSINGLELEVELWHEREUSED_H #define DSPSINGLELEVELWHEREUSED_H #include "display.h" #include "ui_dspSingleLevelWhereUsed.h" class dspSingleLevelWhereUsed : public display, public Ui::dspSingleLevelWhereUsed { Q_OBJECT public: dspSingleLevelWhereUsed(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * menu, QTreeWidgetItem *, int); virtual void sEditBOM(); virtual void sEditItem(); virtual void sViewInventoryHistory(); protected slots: virtual void languageChange(); }; #endif // DSPSINGLELEVELWHEREUSED_H qt-client-4.1.0/guiclient/displays/dspSingleLevelWhereUsed.ui000066400000000000000000000067561217451700100243360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSingleLevelWhereUsed 0 0 518 94 Single Level Where Used Qt::Vertical QSizePolicy::Expanding 20 0 0 0 5 0 Effective: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    _item _effective
    qt-client-4.1.0/guiclient/displays/dspSlowMovingInventoryByClassCode.cpp000066400000000000000000000130541217451700100265410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSlowMovingInventoryByClassCode.h" #include #include #include #include #include #include #include #include "guiclient.h" #include "adjustmentTrans.h" #include "enterMiscCount.h" #include "transferTrans.h" #include "createCountTagsByItem.h" #include "mqlutil.h" dspSlowMovingInventoryByClassCode::dspSlowMovingInventoryByClassCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSlowMovingInventoryByClassCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Slow Moving Inventory")); setListLabel(tr("Quantities on Hand")); setReportName("SlowMovingInventoryByClassCode"); setMetaSQLOptions("slowMovingInventoryByClassCode", "detail"); _costsGroupInt = new QButtonGroup(this); _costsGroupInt->addButton(_useStandardCosts); _costsGroupInt->addButton(_useActualCosts); connect(_showValue, SIGNAL(toggled(bool)), this, SLOT(sHandleValue(bool))); _classCode->setType(ParameterGroup::ClassCode); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Last Movement"), _itemColumn, Qt::AlignCenter, true, "itemsite_datelastused" ); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "itemsite_qtyonhand" ); list()->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "cost" ); list()->addColumn(tr("Value"), _costColumn, Qt::AlignRight, true, "value" ); sHandleValue(_showValue->isChecked()); _showValue->setEnabled(_privileges->check("ViewInventoryValue")); } void dspSlowMovingInventoryByClassCode::languageChange() { display::languageChange(); retranslateUi(this); } bool dspSlowMovingInventoryByClassCode::setParams(ParameterList & params) { if(!_cutoffDate->isValid()) { QMessageBox::warning(this, tr("No Cutoff Date"), tr("You must specify a cutoff date.")); _cutoffDate->setFocus(); return false; } params.append("cutoffDate", _cutoffDate->date()); _warehouse->appendValue(params); _classCode->appendValue(params); if(_showValue->isChecked()) params.append("showValue"); if (_useStandardCosts->isChecked()) params.append("useStandardCosts"); if (_useActualCosts->isChecked()) params.append("useActualCosts"); return true; } void dspSlowMovingInventoryByClassCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; if (((XTreeWidgetItem *)pSelected)->id() != -1) { menuItem = pMenu->addAction(tr("Transfer to another Site..."), this, SLOT(sTransfer()));; if (!_privileges->check("CreateInterWarehouseTrans")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Adjust this QOH..."), this, SLOT(sAdjust()));; if (!_privileges->check("CreateAdjustmentTrans")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Reset this QOH to 0..."), this, SLOT(sReset()));; if (!_privileges->check("CreateAdjustmentTrans")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Enter Misc. Count..."), this, SLOT(sMiscCount()));; if (!_privileges->check("EnterMiscCounts")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()));; if (!_privileges->check("IssueCountTags")) menuItem->setEnabled(false); } } void dspSlowMovingInventoryByClassCode::sTransfer() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSlowMovingInventoryByClassCode::sAdjust() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSlowMovingInventoryByClassCode::sReset() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); params.append("qty", 0.0); adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSlowMovingInventoryByClassCode::sMiscCount() { ParameterList params; params.append("itemsite_id", list()->id()); enterMiscCount newdlg(this, "", true); newdlg.set(params); if (newdlg.exec()) sFillList(); } void dspSlowMovingInventoryByClassCode::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspSlowMovingInventoryByClassCode::sHandleValue(bool pShowValue) { list()->setColumnHidden(6, !pShowValue); list()->setColumnHidden(7, !pShowValue); } qt-client-4.1.0/guiclient/displays/dspSlowMovingInventoryByClassCode.h000066400000000000000000000025221217451700100262040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSLOWMOVINGINVENTORYBYCLASSCODE_H #define DSPSLOWMOVINGINVENTORYBYCLASSCODE_H #include "display.h" #include "ui_dspSlowMovingInventoryByClassCode.h" class dspSlowMovingInventoryByClassCode : public display, public Ui::dspSlowMovingInventoryByClassCode { Q_OBJECT public: dspSlowMovingInventoryByClassCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sTransfer(); virtual void sAdjust(); virtual void sReset(); virtual void sMiscCount(); virtual void sIssueCountTag(); virtual void sHandleValue( bool pShowValue ); protected slots: virtual void languageChange(); private: QButtonGroup* _costsGroupInt; QButtonGroup* _orderByGroupInt; }; #endif // DSPSLOWMOVINGINVENTORYBYCLASSCODE_H qt-client-4.1.0/guiclient/displays/dspSlowMovingInventoryByClassCode.ui000066400000000000000000000103151217451700100263710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSlowMovingInventoryByClassCode 0 0 486 216 Slow Moving Inventory false false false 0 0 Show Inventory Value true false Use Standard Costs true Use Actual Costs Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 11 10 DLineEdit QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _classCode _cutoffDate _warehouse _useStandardCosts
    qt-client-4.1.0/guiclient/displays/dspStandardJournalHistory.cpp000066400000000000000000000075731217451700100251310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspStandardJournalHistory.h" #include #include #include #include #include #include "guiclient.h" #include "xtreewidget.h" #include "metasql.h" #include "mqlutil.h" #include "reverseGLSeries.h" dspStandardJournalHistory::dspStandardJournalHistory(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspStandardJournalHistory", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Standard Journal History")); setListLabel(tr("G/L Transactions")); setReportName("StandardJournalHistory"); setMetaSQLOptions("standardJournalHistory", "detail"); setUseAltId(true); list()->setRootIsDecorated(true); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "gltrans_date" ); list()->addColumn(tr("Journal #"), _itemColumn, Qt::AlignCenter, true, "gltrans_journalnumber" ); list()->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter, true, "gltrans_posted" ); list()->addColumn(tr("Journal Name"), _orderColumn, Qt::AlignCenter, true, "gltrans_docnumber" ); list()->addColumn(tr("Account"), -1, Qt::AlignLeft, true, "account" ); list()->addColumn(tr("Debit"), _bigMoneyColumn, Qt::AlignRight, true, "debit" ); list()->addColumn(tr("Credit"), _bigMoneyColumn, Qt::AlignRight, true, "credit" ); } void dspStandardJournalHistory::languageChange() { display::languageChange(); retranslateUi(this); } void dspStandardJournalHistory::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int) { bool deletable = false; // Make sure there is nothing to restricting deletes ParameterList params; params.append("glSequence", list()->id()); MetaSQLQuery mql = mqlLoad("glseries", "checkeditable"); XSqlQuery qry = mql.toQuery(params); if (!qry.first()) deletable = true; QAction *menuItem; menuItem = pMenu->addAction(tr("Delete Journal..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("DeletePostedJournals") && deletable); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Reverse Journal..."), this, SLOT(sReverse())); menuItem->setEnabled(_privileges->check("PostStandardJournals")); } bool dspStandardJournalHistory::setParams(ParameterList ¶ms) { if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter Date"), tr("Please enter a valid Start Date & End Date.") ); _dates->setFocus(); return false; } params.append("startDate", _dates->startDate()); params.append("endDate", _dates->endDate()); return true; } void dspStandardJournalHistory::sReverse() { ParameterList params; params.append("glseries", list()->id()); reverseGLSeries newdlg(this); if(newdlg.set(params) != NoError) return; if(newdlg.exec() == XDialog::Accepted) sFillList(); } void dspStandardJournalHistory::sDelete() { ParameterList params; params.append("glseries", list()->id()); params.append("notes", tr("Journal deleted by %1 on %2") .arg(omfgThis->username()) .arg(omfgThis->dbDate().toString())); MetaSQLQuery mql("SELECT deleteGlSeries(," ") AS result;"); XSqlQuery del; del = mql.toQuery(params); if (del.lastError().type() != QSqlError::NoError) { systemError(this, del.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sGlSeriesUpdated(); sFillList(); } qt-client-4.1.0/guiclient/displays/dspStandardJournalHistory.h000066400000000000000000000020621217451700100245620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSTANDARDJOURNALHISTORY_H #define DSPSTANDARDJOURNALHISTORY_H #include "display.h" #include "ui_dspStandardJournalHistory.h" class dspStandardJournalHistory : public display, public Ui::dspStandardJournalHistory { Q_OBJECT public: dspStandardJournalHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual void sPopulateMenu(QMenu *, QTreeWidgetItem*, int); protected slots: virtual void languageChange(); virtual void sReverse(); virtual void sDelete(); }; #endif // DSPSTANDARDJOURNALHISTORY_H qt-client-4.1.0/guiclient/displays/dspStandardJournalHistory.ui000066400000000000000000000043351217451700100247550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspStandardJournalHistory 0 0 256 73 Standard Journal History 0 0 Qt::Vertical QSizePolicy::Preferred 20 0 Qt::Horizontal QSizePolicy::Expanding 6 20 DateCluster QWidget
    datecluster.h
    _dates
    qt-client-4.1.0/guiclient/displays/dspSubstituteAvailabilityByItem.cpp000066400000000000000000000124531217451700100262650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSubstituteAvailabilityByItem.h" #include #include #include #include #include #include #include #include "dspAllocations.h" #include "dspOrders.h" dspSubstituteAvailabilityByItem::dspSubstituteAvailabilityByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSubstituteAvailabilityByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Substitute Availability by Root Item")); setListLabel(tr("Substitute Availability")); setReportName("SubstituteAvailabilityByRootItem"); setMetaSQLOptions("substituteAvailability", "detail"); setUseAltId(true); _showByGroupInt = new QButtonGroup(this); _showByGroupInt->addButton(_leadTime); _showByGroupInt->addButton(_byDays); _showByGroupInt->addButton(_byDate); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("LT"), _whsColumn, Qt::AlignCenter, true, "leadtime" ); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qtyonhand" ); list()->addColumn(tr("Allocated"), _qtyColumn, Qt::AlignRight, true, "allocated" ); list()->addColumn(tr("On Order"), _qtyColumn, Qt::AlignRight, true, "ordered" ); list()->addColumn(tr("Reorder Lvl."), _qtyColumn, Qt::AlignRight, true, "reorderlevel" ); list()->addColumn(tr("Available"), _qtyColumn, Qt::AlignRight, true, "available" ); } void dspSubstituteAvailabilityByItem::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspSubstituteAvailabilityByItem::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(true); } param = pParams.value("warehous_id", &valid); if (valid) { _warehouse->setId(param.toInt()); _warehouse->setEnabled(false); } param = pParams.value("itemsite_id", &valid); if (valid) { _item->setItemsiteid(param.toInt()); _item->setReadOnly(true); _warehouse->setEnabled(false); } _leadTime->setChecked(pParams.inList("byLeadTime")); param = pParams.value("byDays", &valid); if (valid) { _byDays->setChecked(true); _days->setValue(param.toInt()); } param = pParams.value("byDate", &valid); if (valid) { _byDate->setChecked(true); _date->setDate(param.toDate()); } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspSubstituteAvailabilityByItem::sViewAllocations() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); if (_leadTime->isChecked()) params.append("byLeadTime", true); else if (_byDays->isChecked()) params.append("byDays", _days->value() ); else if (_byDate->isChecked()) params.append("byDate", _date->date()); dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSubstituteAvailabilityByItem::sViewOrders() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); if (_leadTime->isChecked()) params.append("byLeadTime", true); else if (_byDays->isChecked()) params.append("byDays", _days->value() ); else if (_byDate->isChecked()) params.append("byDate", _date->date()); dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSubstituteAvailabilityByItem::sPopulateMenu(QMenu *menu, QTreeWidgetItem*, int) { menu->addAction(tr("View Allocations..."), this, SLOT(sViewAllocations())); menu->addAction(tr("View Orders..."), this, SLOT(sViewOrders())); } bool dspSubstituteAvailabilityByItem::setParams(ParameterList ¶ms) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number")); return false; } if (_byDate->isChecked() && !_date->isValid()) { QMessageBox::warning(this, tr("Date Required"), tr("You must specify a valid date.")); return false; } if (_normalize->isChecked()) params.append("normalize"); if (_leadTime->isChecked()) { params.append("leadTime"); params.append("byLeadTime"); // report } else if (_byDays->isChecked()) { params.append("byDays", _days->value()); params.append("days", _days->value()); // MetaSQL } else if (_byDate->isChecked()) { params.append("byDate", _date->date()); params.append("date", _date->date()); // MetaSQL } params.append("item_id", _item->id()); _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspSubstituteAvailabilityByItem.h000066400000000000000000000024131217451700100257250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSUBSTITUTEAVAILABILITYBYITEM_H #define DSPSUBSTITUTEAVAILABILITYBYITEM_H #include "guiclient.h" #include "display.h" #include "parameter.h" #include "ui_dspSubstituteAvailabilityByItem.h" class dspSubstituteAvailabilityByItem : public display, public Ui::dspSubstituteAvailabilityByItem { Q_OBJECT public: dspSubstituteAvailabilityByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sViewAllocations(); virtual void sViewOrders(); virtual void sPopulateMenu(QMenu * menu, QTreeWidgetItem *, int); protected slots: virtual void languageChange(); private: QButtonGroup* _showByGroupInt; }; #endif // DSPSUBSTITUTEAVAILABILITYBYITEM_H qt-client-4.1.0/guiclient/displays/dspSubstituteAvailabilityByItem.ui000066400000000000000000000146001217451700100261140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSubstituteAvailabilityByItem 0 0 737 202 Substitute Availability by Root Item Qt::Horizontal 0 0 32767 32767 Show Availability as of: Item Site Lead Time true true Look Ahead Days: false 0 1000 Date: false 0 0 100 32767 false Normalize to Parent UOM DLineEdit QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _item _leadTime _byDays _days _byDate _date _byDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _byDate toggled(bool) _date setEnabled(bool) 20 20 20 20 _item newId(int) _warehouse findItemSites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspSummarizedBOM.cpp000066400000000000000000000024351217451700100231220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSummarizedBOM.h" #include dspSummarizedBOM::dspSummarizedBOM(QWidget* parent, const char*, Qt::WFlags fl) : dspBOMBase(parent, "dspSummarizedBOM", fl) { setWindowTitle(tr("Summarized Bill of Materials")); setReportName("SummarizedBOM"); list()->setRootIsDecorated(true); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "bomdata_item_number"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "bomdata_itemdescription"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "bomdata_uom_name"); list()->addColumn(tr("Ext. Qty. Req."),_qtyColumn, Qt::AlignRight, true, "bomdata_qtyreq"); list()->setIndentation(10); } bool dspSummarizedBOM::setParams(ParameterList ¶ms) { params.append("bySummarized"); return dspBOMBase::setParams(params); } qt-client-4.1.0/guiclient/displays/dspSummarizedBOM.h000066400000000000000000000013741217451700100225700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSUMMARIZEDBOM_H #define DSPSUMMARIZEDBOM_H #include "dspBOMBase.h" class dspSummarizedBOM : public dspBOMBase { Q_OBJECT public: dspSummarizedBOM(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); }; #endif // DSPSUMMARIZEDBOM_H qt-client-4.1.0/guiclient/displays/dspSummarizedBacklogByWarehouse.cpp000066400000000000000000000231561217451700100262300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSummarizedBacklogByWarehouse.h" #include #include #include #include #include #include #include "guiclient.h" #include "dspInventoryAvailabilityBySalesOrder.h" #include "salesOrder.h" #include "printPackingList.h" #include "storedProcErrorLookup.h" #include "mqlutil.h" dspSummarizedBacklogByWarehouse::dspSummarizedBacklogByWarehouse(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSummarizedBacklogByWarehouse", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Summarized Backlog by Site")); setListLabel(tr("Backlog")); setReportName("SummarizedBacklogByWarehouse"); setMetaSQLOptions("summarizedBacklogByWarehouse", "detail"); setUseAltId(true); connect(_showPrices, SIGNAL(toggled(bool)), this, SLOT(sHandlePrices(bool))); _customerType->setType(ParameterGroup::CustomerType); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Order#/Shipment#"), _itemColumn, Qt::AlignLeft, true, "cohead_number"); list()->addColumn(tr("Customer/Ship Via"), -1, Qt::AlignLeft, true, "cust_name"); list()->addColumn(tr("Hold Type/Shipped"), _orderColumn*2, Qt::AlignRight, true, "f_holdtype"); list()->addColumn(tr("Ordered/Shipped"), _dateColumn, Qt::AlignRight, true, "cohead_orderdate"); list()->addColumn(tr("Scheduled"), _dateColumn, Qt::AlignRight, true, "scheddate"); list()->addColumn(tr("Pack Date"), _dateColumn, Qt::AlignRight, true, "cohead_packdate"); if (_privileges->check("ViewCustomerPrices")) list()->addColumn(tr("Sales"), _moneyColumn, Qt::AlignRight, true, "sales"); if (_privileges->check("ViewCosts")) list()->addColumn(tr("Cost"), _moneyColumn, Qt::AlignRight, true, "cost"); if (_privileges->check("ViewCustomerPrices") && _privileges->check("ViewCosts")) list()->addColumn(tr("Margin"), _moneyColumn, Qt::AlignRight, true, "margin"); list()->addColumn(tr("Sales Rep"), _itemColumn, Qt::AlignRight, true, "salesrep_name"); list()->addColumn(tr("Time Received"), _dateColumn, Qt::AlignRight, false, "cohead_created"); list()->addColumn(tr("Pack List Batch"), _dateColumn, Qt::AlignRight, false, "packed"); list()->setRootIsDecorated(true); list()->setDragString("soheadid="); if ( (!_privileges->check("ViewCustomerPrices")) && (!_privileges->check("ViewCosts")) ) _showPrices->setEnabled(false); sHandlePrices(_showPrices->isChecked()); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList())); sFillList(); } void dspSummarizedBacklogByWarehouse::languageChange() { display::languageChange(); retranslateUi(this); } void dspSummarizedBacklogByWarehouse::sHandlePrices(bool pShowPrices) { if(pShowPrices){ list()->showColumn("sales"); list()->showColumn("cost"); list()->showColumn("margin"); } else{ list()->hideColumn("sales"); list()->hideColumn("cost"); list()->hideColumn("margin"); } } bool dspSummarizedBacklogByWarehouse::setParams(ParameterList ¶ms) { _warehouse->appendValue(params); _customerType->appendValue(params); if (_dates->allValid()) _dates->appendValue(params); else return false; if(_showPrices->isChecked()) params.append("showPrices"); sHandlePrices(_showPrices->isChecked()); params.append("none", tr("None")); params.append("credit", tr("Credit")); params.append("pack", tr("Pack")); params.append("return", tr("Return")); params.append("ship", tr("Ship")); params.append("other", tr("Other")); params.append("yes", tr("Yes")); params.append("no", tr("No")); return true; } void dspSummarizedBacklogByWarehouse::sInventoryAvailabilityBySalesOrder() { ParameterList params; params.append("mode", "edit"); params.append("sohead_id", list()->id()); dspInventoryAvailabilityBySalesOrder *newdlg = new dspInventoryAvailabilityBySalesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSummarizedBacklogByWarehouse::sEdit() { salesOrder::editSalesOrder(list()->id(), false); } void dspSummarizedBacklogByWarehouse::sView() { salesOrder::viewSalesOrder(list()->id()); } void dspSummarizedBacklogByWarehouse::sDelete() { XSqlQuery dspDelete; if ( QMessageBox::question(this, tr("Delete Sales Order?"), tr("

    Are you sure that you want to completely " "delete the selected Sales Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { dspDelete.prepare("SELECT deleteSo(:sohead_id) AS result;"); dspDelete.bindValue(":sohead_id", list()->id()); dspDelete.exec(); if (dspDelete.first()) { int result = dspDelete.value("result").toInt(); switch (result) { case 0: omfgThis->sSalesOrdersUpdated(-1); break; case -1: if (QMessageBox::question(this, tr("Cannot Delete Sales Order"), storedProcErrorLookup("deleteSO", result) + tr("
    Would you like to Close the " "selected Sales Order instead?" ), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { dspDelete.prepare( "UPDATE coitem " "SET coitem_status='C' " "WHERE ((coitem_status<>'X')" " AND (coitem_cohead_id=:sohead_id));" ); dspDelete.bindValue(":sohead_id", list()->id()); dspDelete.exec(); if (dspDelete.lastError().type() != QSqlError::NoError) { systemError(this, dspDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } break; default: systemError(this, storedProcErrorLookup("deleteSO", result), __FILE__, __LINE__); return; } } else if (dspDelete.lastError().type() != QSqlError::NoError) { systemError(this, dspDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } } void dspSummarizedBacklogByWarehouse::sPrintPackingList() { ParameterList params; if (list()->altId() > 0) params.append("shiphead_id", list()->altId()); else params.append("sohead_id", list()->id()); printPackingList newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspSummarizedBacklogByWarehouse::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if (list()->id() != -1) { menuItem = pMenu->addAction(tr("Inventory Availability by Sales Order..."), this, SLOT(sInventoryAvailabilityBySalesOrder())); if (!_privileges->check("ViewInventoryAvailability")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); if (!_privileges->check("MaintainSalesOrders")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); if ((!_privileges->check("MaintainSalesOrders")) && (!_privileges->check("ViewSalesOrders"))) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); if (!_privileges->check("MaintainSalesOrders")) menuItem->setEnabled(false); } if (list()->altId() > -1 || (list()->id() != -1 && list()->currentItem()->text(2) != tr("Pack") && list()->currentItem()->text(2) != tr("Credit"))) { if (list()->id() != -1) pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList())); if (!_privileges->check("PrintPackingLists")) menuItem->setEnabled(false); } } void dspSummarizedBacklogByWarehouse::sFillList() { XSqlQuery dspFillList; ParameterList params; if (setParams(params)) { display::sFillList(); // if (list()->topLevelItemCount()) // { MetaSQLQuery totm = mqlLoad("summarizedBacklogByWarehouse", "totals"); dspFillList = totm.toQuery(params); if (dspFillList.first()) _totalSalesOrders->setText(dspFillList.value("totalorders").toString()); else if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } MetaSQLQuery cntm = mqlLoad("summarizedBacklogByWarehouse", "counts"); dspFillList = cntm.toQuery(params); if (dspFillList.first()) _totalLineItems->setText(dspFillList.value("totalitems").toString()); else if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } MetaSQLQuery qtym = mqlLoad("summarizedBacklogByWarehouse", "qtys"); dspFillList = qtym.toQuery(params); if (dspFillList.first()) _totalQty->setText(dspFillList.value("f_totalqty").toString()); else if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } // } // else // { // _totalSalesOrders->clear(); // _totalLineItems->clear(); // _totalQty->clear(); // } } } qt-client-4.1.0/guiclient/displays/dspSummarizedBacklogByWarehouse.h000066400000000000000000000024471217451700100256750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSUMMARIZEDBACKLOGBYWAREHOUSE_H #define DSPSUMMARIZEDBACKLOGBYWAREHOUSE_H #include "display.h" #include "ui_dspSummarizedBacklogByWarehouse.h" class dspSummarizedBacklogByWarehouse : public display, public Ui::dspSummarizedBacklogByWarehouse { Q_OBJECT public: dspSummarizedBacklogByWarehouse(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sHandlePrices( bool pShowPrices ); virtual void sInventoryAvailabilityBySalesOrder(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPrintPackingList(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPSUMMARIZEDBACKLOGBYWAREHOUSE_H qt-client-4.1.0/guiclient/displays/dspSummarizedBacklogByWarehouse.ui000066400000000000000000000175131217451700100260630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSummarizedBacklogByWarehouse 0 0 462 286 Summarized Backlog by Site false false Qt::Horizontal 0 20 Qt::Horizontal 0 20 0 Qt::Vertical 20 0 Show Prices and Costs Qt::Horizontal QSizePolicy::Expanding 0 63 0 Total Sales Orders: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Qty (Inventory UOM): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Line Items: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 DateCluster QWidget

    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _customerType _dates qt-client-4.1.0/guiclient/displays/dspSummarizedBankrecHistory.cpp000066400000000000000000000041071217451700100254320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSummarizedBankrecHistory.h" #include #include "xtreewidget.h" dspSummarizedBankrecHistory::dspSummarizedBankrecHistory(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSummarizedBankrecHistory", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Summarized Bank Reconciliation History")); setListLabel(tr("Summarized History")); setReportName("SummarizedBankrecHistory"); setMetaSQLOptions("summarizedBankrecHistory", "detail"); list()->addColumn(tr("Posted"), _ynColumn, Qt::AlignLeft, true, "bankrec_posted" ); list()->addColumn(tr("Post Date"), _dateColumn, Qt::AlignCenter, true, "bankrec_postdate" ); list()->addColumn(tr("User"), -1, Qt::AlignLeft, true, "bankrec_username" ); list()->addColumn(tr("Start Date"), _dateColumn, Qt::AlignCenter, true, "bankrec_opendate" ); list()->addColumn(tr("End Date"), _dateColumn, Qt::AlignCenter, true, "bankrec_enddate" ); list()->addColumn(tr("Opening Bal."), _bigMoneyColumn, Qt::AlignRight, true, "bankrec_openbal" ); list()->addColumn(tr("Ending Bal."), _bigMoneyColumn, Qt::AlignRight, true, "bankrec_endbal" ); _bankaccnt->populate("SELECT bankaccnt_id," " (bankaccnt_name || '-' || bankaccnt_descrip) " "FROM bankaccnt " "ORDER BY bankaccnt_name;"); } void dspSummarizedBankrecHistory::languageChange() { display::languageChange(); retranslateUi(this); } bool dspSummarizedBankrecHistory::setParams(ParameterList & params) { params.append("bankaccntid", _bankaccnt->id()); return true; } qt-client-4.1.0/guiclient/displays/dspSummarizedBankrecHistory.h000066400000000000000000000016671217451700100251070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSUMMARIZEDBANKRECHISTORY_H #define DSPSUMMARIZEDBANKRECHISTORY_H #include "display.h" #include "ui_dspSummarizedBankrecHistory.h" class dspSummarizedBankrecHistory : public display, public Ui::dspSummarizedBankrecHistory { Q_OBJECT public: dspSummarizedBankrecHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPSUMMARIZEDBANKRECHISTORY_H qt-client-4.1.0/guiclient/displays/dspSummarizedBankrecHistory.ui000066400000000000000000000050401217451700100252620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSummarizedBankrecHistory 0 0 255 43 Summarized Bank Reconciliation History 0 0 0 Bank Account: Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 55 20 XComboBox QComboBox
    xcombobox.h
    qt-client-4.1.0/guiclient/displays/dspSummarizedGLTransactions.cpp000066400000000000000000000126621217451700100254030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSummarizedGLTransactions.h" #include #include #include #include #include "guiclient.h" #include "glTransactionDetail.h" #include "voucher.h" #include "miscVoucher.h" #include "invoice.h" #include "purchaseOrder.h" dspSummarizedGLTransactions::dspSummarizedGLTransactions(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSummarizedGLTransactions", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Summarized General Ledger Transactions")); setListLabel(tr("Transactions")); setReportName("SummarizedGLTransactions"); setMetaSQLOptions("summarizedGLTransactions", "detail"); setUseAltId(true); connect(_selectedSource, SIGNAL(toggled(bool)), _source, SLOT(setEnabled(bool))); list()->setRootIsDecorated(true); list()->addColumn(tr("Account #"), 150, Qt::AlignCenter, true, "account" ); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "gltrans_date" ); list()->addColumn(tr("Description/Notes"), -1, Qt::AlignLeft, true, "descrip_notes" ); list()->addColumn(tr("Src."), _whsColumn, Qt::AlignCenter, true, "gltrans_source" ); list()->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter, true, "gltrans_doctype" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "gltrans_docnumber" ); list()->addColumn(tr("Debit"), _bigMoneyColumn, Qt::AlignRight, true, "debit" ); list()->addColumn(tr("Credit"), _bigMoneyColumn, Qt::AlignRight, true, "credit" ); list()->addColumn( tr("Username"), _userColumn, Qt::AlignLeft, true, "gltrans_username" ); } void dspSummarizedGLTransactions::languageChange() { display::languageChange(); retranslateUi(this); } void dspSummarizedGLTransactions::sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int) { if(list()->altId() == -1) return; menuThis->addAction(tr("View..."), this, SLOT(sViewTrans())); QTreeWidgetItem * item = list()->currentItem(); if(0 == item) return; if(item->text(4) == "VO") menuThis->addAction(tr("View Voucher..."), this, SLOT(sViewDocument())); else if(item->text(4) == "IN") menuThis->addAction(tr("View Invoice..."), this, SLOT(sViewDocument())); else if(item->text(4) == "PO") menuThis->addAction(tr("View Purchase Order..."), this, SLOT(sViewDocument())); } bool dspSummarizedGLTransactions::setParams(ParameterList & params) { if (_dates->allValid()) { params.append("startDate", _dates->startDate()); params.append("endDate", _dates->endDate()); } if (_selectedSource->isChecked()) params.append("source", _source->currentText()); if (_unpostedTransactions->isChecked()) params.append("unpostedTransactions"); else if (_postedTransactions->isChecked()) params.append("postedTransactions"); params.append("showUsernames"); // report only? return true; } void dspSummarizedGLTransactions::sViewTrans() { ParameterList params; params.append("gltrans_id", list()->altId()); glTransactionDetail newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspSummarizedGLTransactions::sViewDocument() { XSqlQuery dspViewDocument; QTreeWidgetItem * item = list()->currentItem(); if(0 == item) return; ParameterList params; if(item->text(4) == "VO") { dspViewDocument.prepare("SELECT vohead_id, vohead_misc " " FROM vohead" " WHERE (vohead_number=:vohead_number)"); dspViewDocument.bindValue(":vohead_number", item->text(5)); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("vohead_id", dspViewDocument.value("vohead_id").toInt()); params.append("mode", "view"); if(dspViewDocument.value("vohead_misc").toBool()) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } else if(item->text(4) == "IN") { dspViewDocument.prepare("SELECT invchead_id" " FROM invchead" " WHERE (invchead_invcnumber=:invchead_invcnumber)"); dspViewDocument.bindValue(":invchead_invcnumber", item->text(5)); dspViewDocument.exec(); if(!dspViewDocument.first()) return; invoice::viewInvoice(dspViewDocument.value("invchead_id").toInt()); } else if(item->text(4) == "PO") { dspViewDocument.prepare("SELECT pohead_id" " FROM pohead" " WHERE (pohead_number=:pohead_number)"); dspViewDocument.bindValue(":pohead_number", item->text(5)); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("pohead_id", dspViewDocument.value("pohead_id").toInt()); params.append("mode", "view"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } qt-client-4.1.0/guiclient/displays/dspSummarizedGLTransactions.h000066400000000000000000000021101217451700100250330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSUMMARIZEDGLTRANSACTIONS_H #define DSPSUMMARIZEDGLTRANSACTIONS_H #include "display.h" #include "ui_dspSummarizedGLTransactions.h" class dspSummarizedGLTransactions : public display, public Ui::dspSummarizedGLTransactions { Q_OBJECT public: dspSummarizedGLTransactions(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu *, QTreeWidgetItem*, int); virtual void sViewTrans(); virtual void sViewDocument(); protected slots: virtual void languageChange(); }; #endif // DSPSUMMARIZEDGLTRANSACTIONS_H qt-client-4.1.0/guiclient/displays/dspSummarizedGLTransactions.ui000066400000000000000000000161141217451700100252320ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSummarizedGLTransactions 0 0 501 179 Summarized General Ledger Transactions All Sources true Selected Source: false A/P A/R G/L I/M P/D P/O S/O S/R W/O Qt::Horizontal 0 20 Transactions 12 All true Posted Unposted Qt::Horizontal 40 20 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 3 20 DateCluster QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    _allSources _selectedSource _source _dates _selectedSource toggled(bool) _source setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspSummarizedSales.cpp000066400000000000000000000214151217451700100235530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspSalesHistory.h" #include "dspSummarizedSales.h" #include "parameterwidget.h" #include "xtreewidget.h" #include "xtsettings.h" #include #include dspSummarizedSales::dspSummarizedSales(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspSummarizedSales", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Summarized Sales")); setReportName("SummarizedSalesHistory"); setMetaSQLOptions("summarizedSalesHistory", "detail"); setParameterWidgetVisible(true); parameterWidget()->append(tr("Invoice Start Date"), "startDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Invoice End Date"), "endDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Ship Start Date"), "shipStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Ship End Date"), "shipEndDate", ParameterWidget::Date); parameterWidget()->appendComboBox(tr("Currency"), "curr_id", XComboBox::Currencies); parameterWidget()->append(tr("Currency Pattern"), "currConcat_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->append(tr("Customer Ship-to"), "shipto_id", ParameterWidget::Shipto); parameterWidget()->appendComboBox(tr("Customer Group"), "custgrp_id", XComboBox::CustomerGroups); parameterWidget()->append(tr("Customer Group Pattern"), "custgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesReps); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); _units->append(0,tr("Base")); _units->append(1,tr("Local")); if (!_metrics->boolean("MultiWhs")) { _site->setForgetful(true); _site->setChecked(false); _site->setVisible(false); } if (omfgThis->singleCurrency()) { _unitsLit->hide(); _units->hide(); } _units->setId(xtsettingsValue("dspSummarizedSales/units").toInt()); connect(_cust, SIGNAL(toggled(bool)), this, SLOT(sGroupByChanged())); connect(_custtype, SIGNAL(toggled(bool)), this, SLOT(sGroupByChanged())); connect(_item, SIGNAL(toggled(bool)), this, SLOT(sGroupByChanged())); connect(_site, SIGNAL(toggled(bool)), this, SLOT(sGroupByChanged())); connect(_shipzone, SIGNAL(toggled(bool)), this, SLOT(sGroupByChanged())); connect(_salesrep, SIGNAL(toggled(bool)), this, SLOT(sGroupByChanged())); connect(_units, SIGNAL(currentIndexChanged(int)), this, SLOT(sGroupByChanged())); sGroupByChanged(); } void dspSummarizedSales::languageChange() { display::languageChange(); retranslateUi(this); } bool dspSummarizedSales::setParams(ParameterList & params) { if (!_cust->isChecked() && !_custtype->isChecked() && !_salesrep->isChecked() && !_shipzone->isChecked() && !_item->isChecked() && !_site->isChecked()) { QMessageBox::warning( this, tr("Select a Group By"), tr("Please select at least one Group By option.") ); return false; } parameterWidget()->appendValue(params); params.append("filter", parameterWidget()->filter()); QList groupLitList; QList groupList; QList groupDescripList; if (_cust->isChecked()) { groupLitList.append(tr("'Customer:'")); groupList.append("cust_number"); groupDescripList.append("cust_name"); params.append("byCustomer"); } if (_custtype->isChecked()) { groupLitList.append(tr("'Cust. Type:'")); groupList.append("custtype_code"); groupDescripList.append("custtype_descrip"); params.append("byCustomerType"); } if (_salesrep->isChecked()) { groupLitList.append(tr("'Sales Rep.:'")); groupList.append("salesrep_number"); groupDescripList.append("salesrep_name"); params.append("bySalesRep"); } if (_shipzone->isChecked()) { groupLitList.append(tr("'Ship Zone:'")); groupList.append("COALESCE(shipzone_name,'')"); groupDescripList.append("COALESCE(shipzone_descrip,'')"); params.append("byShippingZone"); } if (_item->isChecked()) { groupLitList.append(tr("'Item:'")); groupList.append("item_number"); groupDescripList.append("itemdescription"); params.append("byItem"); } if (_site->isChecked()) { groupLitList.append(tr("'Site:'")); groupList.append("warehous_code"); groupDescripList.append("warehous_descrip"); params.append("bySite"); } if (_units->currentIndex()) { params.append("byCurrency"); } params.append("groupLitList", groupLitList); params.append("groupList", groupList); params.append("groupDescripList", groupDescripList); return true; } void dspSummarizedSales::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("View Sales Detail..."), this, SLOT(sViewHistory())); } void dspSummarizedSales::sViewHistory() { ParameterList params; parameterWidget()->appendValue(params); if (_cust->isChecked()) params.append("cust_id", list()->id("cust_number")); if (_custtype->isChecked()) params.append("custtype_id", list()->id("custtype_code")); if (_salesrep->isChecked()) params.append("salesrep_id", list()->id("salesrep_number")); if (_shipzone->isChecked()) params.append("shipzone_id", list()->id("shipzone_name")); if (_item->isChecked()) params.append("item_id", list()->id("item_number")); if (_site->isChecked()) params.append("warehous_id", list()->id("warehous_code")); params.append("run"); dspSalesHistory *newdlg = new dspSalesHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspSummarizedSales::sGroupByChanged() { list()->clear(); list()->setColumnCount(0); if (_cust->isChecked()) { list()->addColumn(tr("Customer"), _itemColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name" ); } if (_custtype->isChecked()) { list()->addColumn(tr("Customer Type"), _itemColumn, Qt::AlignLeft, true, "custtype_code" ); } if (_salesrep->isChecked()) { list()->addColumn(tr("Sales Rep."), _itemColumn, Qt::AlignLeft, true, "salesrep_number" ); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "salesrep_name" ); } if (_shipzone->isChecked()) list()->addColumn(tr("Zone"), _itemColumn, Qt::AlignLeft, true, "shipzone_name" ); if (_item->isChecked()) { list()->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription" ); } if (_site->isChecked()) list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("First Sale"), _dateColumn, Qt::AlignCenter, true, "firstdate" ); list()->addColumn(tr("Last Sale"), _dateColumn, Qt::AlignCenter, true, "lastdate" ); list()->addColumn(tr("Min. Price"), _priceColumn, Qt::AlignRight, true, "minprice" ); list()->addColumn(tr("Max. Price"), _priceColumn, Qt::AlignRight, true, "maxprice" ); list()->addColumn(tr("Avg. Price"), _priceColumn, Qt::AlignRight, true, "avgprice" ); list()->addColumn(tr("Wt. Avg. Price"), _priceColumn, Qt::AlignRight, true, "wtavgprice" ); list()->addColumn(tr("Total Units"), _qtyColumn, Qt::AlignRight, true, "totalunits" ); list()->addColumn(tr("Total Sales"), _bigMoneyColumn, Qt::AlignRight, true, "totalsales" ); if (!omfgThis->singleCurrency()) list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currAbbr" ); xtsettingsSetValue("dspSummarizedSales/units", _units->id()); } qt-client-4.1.0/guiclient/displays/dspSummarizedSales.h000066400000000000000000000020221217451700100232110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPSUMMARIZEDSALES_H #define DSPSUMMARIZEDSALES_H #include "display.h" #include "ui_dspSummarizedSales.h" class dspSummarizedSales : public display, public Ui::dspSummarizedSales { Q_OBJECT public: dspSummarizedSales(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sViewHistory(); virtual void sGroupByChanged(); protected slots: virtual void languageChange(); }; #endif // DSPSUMMARIZEDSALES_H qt-client-4.1.0/guiclient/displays/dspSummarizedSales.ui000066400000000000000000000075711217451700100234150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspSummarizedSales true 0 0 611 103 Summarized Sales Group By 12 Customer Customer Type Item Qt::Horizontal 14 20 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Sales Rep. Shipping Zone Site XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    qt-client-4.1.0/guiclient/displays/dspTimePhasedAvailability.cpp000066400000000000000000000110251217451700100250150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTimePhasedAvailability.h" #include #include #include #include #include #include "guiclient.h" #include "dspInventoryAvailability.h" #include "dspAllocations.h" #include "dspOrders.h" #include "workOrder.h" #include "purchaseRequest.h" #include "purchaseOrder.h" dspTimePhasedAvailability::dspTimePhasedAvailability(QWidget* parent, const char*, Qt::WFlags fl) : displayTimePhased(parent, "dspTimePhasedAvailability", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Time-Phased Availability")); setListLabel(tr("Time-Phased Availability")); setReportName("TimePhasedAvailability"); setMetaSQLOptions("timePhasedAvailability", "detail"); setUseAltId(true); _plannerCode->setType(ParameterGroup::PlannerCode); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); } void dspTimePhasedAvailability::languageChange() { displayTimePhased::languageChange(); retranslateUi(this); } void dspTimePhasedAvailability::sViewAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byDate", _columnDates[_column - 3].startDate); params.append("run"); dspInventoryAvailability *newdlg = new dspInventoryAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedAvailability::sViewOrders() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byRange"); params.append("startDate", _columnDates[_column - 3].startDate); params.append("endDate", _columnDates[_column - 3].endDate); params.append("run"); dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedAvailability::sViewAllocations() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byRange"); params.append("startDate", _columnDates[_column - 3].startDate); params.append("endDate", _columnDates[_column - 3].endDate); params.append("run"); dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedAvailability::sCreateWO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedAvailability::sCreatePR() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseRequest newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspTimePhasedAvailability::sCreatePO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", list()->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); } void dspTimePhasedAvailability::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int pColumn) { QAction *menuItem; _column = pColumn; if (_column > 2) { menuItem = pMenu->addAction(tr("View Availability Detail..."), this, SLOT(sViewAvailability())); menuItem = pMenu->addAction(tr("View Allocations..."), this, SLOT(sViewAllocations())); menuItem = pMenu->addAction(tr("View Orders..."), this, SLOT(sViewOrders())); if (((XTreeWidgetItem *)pSelected)->altId() == 1) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Create W/O..."), this, SLOT(sCreateWO())); } else if (((XTreeWidgetItem *)pSelected)->altId() == 2) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Create P/R..."), this, SLOT(sCreatePR())); menuItem = pMenu->addAction(tr("Create P/O..."), this, SLOT(sCreatePO())); } } } bool dspTimePhasedAvailability::setParamsTP(ParameterList & params) { _warehouse->appendValue(params); _plannerCode->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspTimePhasedAvailability.h000066400000000000000000000023741217451700100244710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTIMEPHASEDAVAILABILITY_H #define DSPTIMEPHASEDAVAILABILITY_H #include "displayTimePhased.h" #include #include "ui_dspTimePhasedAvailability.h" class dspTimePhasedAvailability : public displayTimePhased, public Ui::dspTimePhasedAvailability { Q_OBJECT public: dspTimePhasedAvailability(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); bool setParamsTP(ParameterList & params); public slots: virtual void sViewAvailability(); virtual void sViewOrders(); virtual void sViewAllocations(); virtual void sCreateWO(); virtual void sCreatePR(); virtual void sCreatePO(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int pColumn); protected slots: virtual void languageChange(); }; #endif // DSPTIMEPHASEDAVAILABILITY_H qt-client-4.1.0/guiclient/displays/dspTimePhasedAvailability.ui000066400000000000000000000063721217451700100246610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspTimePhasedAvailability 0 0 412 118 Time-Phased Availability 0 Qt::StrongFocus false Qt::Vertical 20 0 0 Qt::StrongFocus false Qt::Vertical 20 0 Qt::Horizontal 37 20 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _plannerCode
    qt-client-4.1.0/guiclient/displays/dspTimePhasedBookings.cpp000066400000000000000000000111631217451700100241610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTimePhasedBookings.h" #include #include #include #include #include #include "guiclient.h" #include "dspBookings.h" #include "parameterwidget.h" dspTimePhasedBookings::dspTimePhasedBookings(QWidget* parent, const char*, Qt::WFlags fl) : displayTimePhased(parent, "dspTimePhasedBookings", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Time-Phased Bookings")); setReportName("TimePhasedBookings"); setMetaSQLOptions("timePhasedBookings", "detail"); setUseAltId(true); setParameterWidgetVisible(true); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); _groupBy->append(0,tr("Customer")); _groupBy->append(1,tr("Product Category")); _groupBy->append(2,tr("Item")); _units->append(0, tr("Sales Dollars")); _units->append(1, tr("Inventory")); _units->append(2,tr("Capacity")); _units->append(3, tr("Alt. Capacity")); connect(_groupBy, SIGNAL(newID(int)), this, SLOT(sGroupByChanged())); sGroupByChanged(); } void dspTimePhasedBookings::languageChange() { display::languageChange(); retranslateUi(this); } void dspTimePhasedBookings::sViewBookings() { ParameterList params = parameterWidget()->parameters(); if (_groupBy->id() == 1) params.append("prodcat_id", list()->id()); else if (_groupBy->id() == 2) params.append("item_id", list()->id()); else params.append("cust_id", list()->id()); params.append("startDate", _columnDates[_column - 4].startDate); params.append("endDate", _columnDates[_column - 4].endDate); params.append("run"); dspBookings *newdlg = new dspBookings(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedBookings::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int pColumn) { if (pColumn < 4) return; QAction *menuItem; _column = pColumn; if (((XTreeWidgetItem *)pSelected)->id() != -1) menuItem = pMenu->addAction(tr("View Bookings..."), this, SLOT(sViewBookings())); } bool dspTimePhasedBookings::setParamsTP(ParameterList & params) { parameterWidget()->appendValue(params); params.append("filter", parameterWidget()->filter()); int idx = _groupBy->id(); if (idx == 1) params.append("byProdcat"); else if (idx == 2) params.append("byItem"); else params.append("byCust"); idx = _units->id(); if (idx == 1) params.append("inventoryUnits"); else if (idx == 2) params.append("capacityUnits"); else if (idx == 3) params.append("altCapacityUnits"); else params.append("salesDollars"); params.append("baseCurrAbbr", CurrDisplay::baseCurrAbbr()); return true; } void dspTimePhasedBookings::sGroupByChanged() { int idx = _groupBy->id(); list()->clear(); list()->setColumnCount(0); if (idx == 1) { list()->addColumn(tr("Prod. Cat."), _itemColumn, Qt::AlignLeft, true, "prodcat_code" ); list()->addColumn(tr("Description"), 180, Qt::AlignLeft, true, "prodcat_descrip" ); } else if (idx == 2) { list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), 180, Qt::AlignLeft, true, "item_descrip1" ); } else { list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Name"), 180, Qt::AlignLeft, true, "cust_name" ); } list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom" ); } qt-client-4.1.0/guiclient/displays/dspTimePhasedBookings.h000066400000000000000000000021201217451700100236170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTIMEPHASEDBOOKINGS_H #define DSPTIMEPHASEDBOOKINGS_H #include "displayTimePhased.h" #include "ui_dspTimePhasedBookings.h" class dspTimePhasedBookings : public displayTimePhased, public Ui::dspTimePhasedBookings { Q_OBJECT public: dspTimePhasedBookings(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParamsTP(ParameterList &); public slots: virtual void sGroupByChanged(); virtual void sViewBookings(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int pColumn); protected slots: virtual void languageChange(); }; #endif // DSPTIMEPHASEDBOOKINGS_H qt-client-4.1.0/guiclient/displays/dspTimePhasedBookings.ui000066400000000000000000000044361217451700100240210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspTimePhasedBookings true 0 0 421 54 Time-Phased Bookings 0 Group By: Units: Qt::Horizontal 14 20 XComboBox QComboBox
    xcombobox.h
    qt-client-4.1.0/guiclient/displays/dspTimePhasedOpenAPItems.cpp000066400000000000000000000222561217451700100245370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTimePhasedOpenAPItems.h" #include #include #include #include #include #include #include "mqlutil.h" #include #include "dspAPOpenItemsByVendor.h" #include "submitReport.h" dspTimePhasedOpenAPItems::dspTimePhasedOpenAPItems(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspTimePhasedOpenAPItems", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Payables Aging")); setReportName("APAging"); connect(_custom, SIGNAL(toggled(bool)), this, SLOT(sToggleCustom())); _asOf->setDate(omfgThis->dbDate(), true); sToggleCustom(); if(_preferences->value("APAgingDefaultDate") == "doc") _useDocDate->setChecked(true); else _useDistDate->setChecked(true); } dspTimePhasedOpenAPItems::~dspTimePhasedOpenAPItems() { // no need to delete child widgets, Qt does it all for us QString str("dist"); if(_useDocDate->isChecked()) str = "doc"; _preferences->set("APAgingDefaultDate", str); } bool dspTimePhasedOpenAPItems::setParams(ParameterList ¶ms) { if ((_custom->isChecked() && ! _periods->isPeriodSelected()) || (!_custom->isChecked() && ! _asOf->isValid())) { QMessageBox::critical(this, tr("Incomplete criteria"), tr("

    The criteria you specified are not complete. " "Please make sure all fields are correctly filled " "out before running the report." ) ); return false; } _vendorGroup->appendValue(params); if(_custom->isChecked()) { QList selected = _periods->selectedItems(); QList periodList; for (int i = 0; i < selected.size(); i++) periodList.append(((XTreeWidgetItem*)selected[i])->id()); params.append("period_id_list", periodList); params.append("report_name", "TimePhasedOpenAPItems"); } else { params.append("relDate", _asOf->date()); params.append("report_name", "APAging"); } // have both in case we add a third option params.append("useDocDate", QVariant(_useDocDate->isChecked())); params.append("useDistDate", QVariant(_useDistDate->isChecked())); return true; } void dspTimePhasedOpenAPItems::sViewOpenItems() { ParameterList params; params.append("vend_id", list()->id()); if (_custom->isChecked()) { QDate checkDate = _columnDates[_column - 2].startDate; if (checkDate.isValid()) { params.append("startDate", _columnDates[_column - 2].startDate); params.append("endDate", _columnDates[_column - 2].endDate); } } else { QDate asOfDate; asOfDate = _asOf->date(); if (_column == 3) { params.append("startDate", asOfDate ); } else if (_column == 4) { params.append("startDate", asOfDate.addDays(-30) ); params.append("endDate", asOfDate); } else if (_column == 5) { params.append("startDate",asOfDate.addDays(-60) ); params.append("endDate", asOfDate.addDays(-31)); } else if (_column == 6) { params.append("startDate",asOfDate.addDays(-90) ); params.append("endDate", asOfDate.addDays(-61)); } else if (_column == 7) params.append("endDate",asOfDate.addDays(-91) ); } params.append("run"); params.append("asofDate",_asOf->date()); // have both in case we add a third option params.append("useDocDate", QVariant(_useDocDate->isChecked())); params.append("useDistDate", QVariant(_useDistDate->isChecked())); dspAPOpenItemsByVendor *newdlg = new dspAPOpenItemsByVendor(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedOpenAPItems::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem *, int pColumn) { _column = pColumn; if ((_column > 1) && (list()->id() > 0)) menuThis->addAction(tr("View Open Items..."), this, SLOT(sViewOpenItems())); } void dspTimePhasedOpenAPItems::sFillList() { if (_custom->isChecked()) sFillCustom(); else sFillStd(); } void dspTimePhasedOpenAPItems::sFillCustom() { XSqlQuery dspFillCustom; if (!_periods->isPeriodSelected()) { if (isVisible()) QMessageBox::warning( this, tr("Select Calendar Periods"), tr("Please select one or more Calendar Periods") ); return; } _columnDates.clear(); list()->setColumnCount(2); QString sql("SELECT vend_id, vend_number, vend_name"); QStringList linetotal; int columns = 1; QList selected = _periods->selectedItems(); for (int i = 0; i < selected.size(); i++) { PeriodListViewItem *cursor = (PeriodListViewItem*)selected[i]; QString bucketname = QString("bucket%1").arg(columns++); sql += QString(", openAPItemsValue(vend_id, %2) AS %1," " 'curr' AS %3_xtnumericrole, 0 AS %4_xttotalrole") .arg(bucketname) .arg(cursor->id()) .arg(bucketname) .arg(bucketname); list()->addColumn(formatDate(cursor->startDate()), _bigMoneyColumn, Qt::AlignRight, true, bucketname); _columnDates.append(DatePair(cursor->startDate(), cursor->endDate())); linetotal << QString("openAPItemsValue(vend_id, %1)").arg(cursor->id()); } list()->addColumn(tr("Total"), _bigMoneyColumn, Qt::AlignRight, true, "linetotal"); _columnDates.append(DatePair()); sql += ", " + linetotal.join("+") + " AS linetotal," " 'curr' AS linetotal_xtnumericrole," " 0 AS linetotal_xttotalrole," " (" + linetotal.join("+") + ") = 0.0 AS xthiddenrole " "FROM vendinfo " "" "WHERE (vend_id=)" "" "WHERE (vend_vendtype_id=)" "" "WHERE (vend_vendtype_id IN (SELECT vendtype_id FROM vendtype WHERE (vendtype_code ~ ))) " "" "ORDER BY vend_number;"; MetaSQLQuery mql(sql); ParameterList params; if (! setParams(params)) return; dspFillCustom = mql.toQuery(params); list()->populate(dspFillCustom); if (dspFillCustom.lastError().type() != QSqlError::NoError) { systemError(this, dspFillCustom.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspTimePhasedOpenAPItems::sFillStd() { XSqlQuery dspFillStd; MetaSQLQuery mql = mqlLoad("apAging", "detail"); ParameterList params; if (! setParams(params)) return; dspFillStd = mql.toQuery(params); list()->populate(dspFillStd); if (dspFillStd.lastError().type() != QSqlError::NoError) { systemError(this, dspFillStd.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspTimePhasedOpenAPItems::sToggleCustom() { list()->clear(); if (_custom->isChecked()) { setReportName("TimePhasedOpenAPItems"); _calendarLit->setHidden(FALSE); _calendar->setHidden(FALSE); _periods->setHidden(FALSE); _asOf->setDate(omfgThis->dbDate(), true); _asOf->setEnabled(FALSE); _useGroup->setHidden(TRUE); list()->setColumnCount(0); list()->addColumn(tr("Vend. #"), _orderColumn, Qt::AlignLeft, true, "vend_number"); list()->addColumn(tr("Vendor"), 180, Qt::AlignLeft, true, "vend_name"); } else { setReportName("APAging"); _calendarLit->setHidden(TRUE); _calendar->setHidden(TRUE); _periods->setHidden(TRUE); _asOf->setEnabled(TRUE); _useGroup->setHidden(FALSE); list()->addColumn(tr("Total Open"), _bigMoneyColumn, Qt::AlignRight, true, "total_val"); list()->addColumn(tr("0+ Days"), _bigMoneyColumn, Qt::AlignRight, true, "cur_val"); list()->addColumn(tr("0-30 Days"), _bigMoneyColumn, Qt::AlignRight, true, "thirty_val"); list()->addColumn(tr("31-60 Days"), _bigMoneyColumn, Qt::AlignRight, true, "sixty_val"); list()->addColumn(tr("61-90 Days"), _bigMoneyColumn, Qt::AlignRight, true, "ninety_val"); list()->addColumn(tr("90+ Days"), _bigMoneyColumn, Qt::AlignRight, true, "plus_val"); list()->setColumnCount(0); list()->addColumn(tr("Vend. #"), _orderColumn, Qt::AlignLeft, true, "apaging_vend_number"); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "apaging_vend_name"); list()->addColumn(tr("Total Open"), _bigMoneyColumn, Qt::AlignRight, true, "apaging_total_val_sum"); list()->addColumn(tr("0+ Days"), _bigMoneyColumn, Qt::AlignRight, true, "apaging_cur_val_sum"); list()->addColumn(tr("0-30 Days"), _bigMoneyColumn, Qt::AlignRight, true, "apaging_thirty_val_sum"); list()->addColumn(tr("31-60 Days"), _bigMoneyColumn, Qt::AlignRight, true, "apaging_sixty_val_sum"); list()->addColumn(tr("61-90 Days"), _bigMoneyColumn, Qt::AlignRight, true, "apaging_ninety_val_sum"); list()->addColumn(tr("90+ Days"), _bigMoneyColumn, Qt::AlignRight, true, "apaging_plus_val_sum"); } } qt-client-4.1.0/guiclient/displays/dspTimePhasedOpenAPItems.h000066400000000000000000000023601217451700100241760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTIMEPHASEDOPENAPITEMS_H #define DSPTIMEPHASEDOPENAPITEMS_H #include "display.h" #include #include "ui_dspTimePhasedOpenAPItems.h" class dspTimePhasedOpenAPItems : public display, public Ui::dspTimePhasedOpenAPItems { Q_OBJECT public: dspTimePhasedOpenAPItems(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspTimePhasedOpenAPItems(); public slots: virtual void sViewOpenItems(); virtual void sPopulateMenu( QMenu * menuThis, QTreeWidgetItem *, int pColumn ); virtual void sFillList(); virtual void sFillStd(); virtual void sFillCustom(); virtual void sToggleCustom(); protected slots: virtual bool setParams(ParameterList &); private: int _column; QList _columnDates; }; #endif // DSPTIMEPHASEDOPENAPITEMS_H qt-client-4.1.0/guiclient/displays/dspTimePhasedOpenAPItems.ui000066400000000000000000000162321217451700100243670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspTimePhasedOpenAPItems 0 0 398 353 Payables Aging As of: _asOf Use Custom Calendar Qt::Horizontal 40 20 Use 12 Document Date Use Distribution Date true Qt::Horizontal 13 20 7 0 5 Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 20 0 0 0 0 120 CalendarComboBox XComboBox

    calendarTools.h
    DLineEdit QWidget
    datecluster.h
    1
    PeriodsListView XTreeWidget
    calendarTools.h
    VendorGroup QWidget
    vendorgroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _asOf _custom _useDocDate _useDistDate _periods _calendar newCalendarId(int) _periods populate(int) 154 197 590 281 _calendar select(ParameterList&) _periods load(ParameterList&) 154 197 590 281 qt-client-4.1.0/guiclient/displays/dspTimePhasedOpenARItems.cpp000066400000000000000000000223321217451700100245340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTimePhasedOpenARItems.h" #include #include #include #include #include #include #include "mqlutil.h" #include #include "printStatementByCustomer.h" #include "dspAROpenItems.h" dspTimePhasedOpenARItems::dspTimePhasedOpenARItems(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspTimePhasedOpenARItems", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Receivables Aging")); setReportName("ARAging"); connect(_custom, SIGNAL(toggled(bool)), this, SLOT(sToggleCustom())); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "araging_cust_number" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "araging_cust_name" ); _asOf->setDate(omfgThis->dbDate(), true); sToggleCustom(); if(_preferences->value("ARAgingDefaultDate") == "doc") _useDocDate->setChecked(true); else _useDistDate->setChecked(true); } dspTimePhasedOpenARItems::~dspTimePhasedOpenARItems() { // no need to delete child widgets, Qt does it all for us QString str("dist"); if(_useDocDate->isChecked()) str = "doc"; _preferences->set("ARAgingDefaultDate", str); } bool dspTimePhasedOpenARItems::setParams(ParameterList ¶ms) { if ((_custom->isChecked() && ! _periods->isPeriodSelected()) || (!_custom->isChecked() && !_asOf->isValid())) { QMessageBox::critical(this, tr("Incomplete criteria"), tr("

    The criteria you specified are not complete. " "Please make sure all fields are correctly filled " "out before running the report." ) ); return false; } _customerSelector->appendValue(params); if(_custom->isChecked()) { params.append("report_name", "TimePhasedOpenARItems"); QList selected = _periods->selectedItems(); QList periodList; for (int i = 0; i < selected.size(); i++) periodList.append(((XTreeWidgetItem*)selected[i])->id()); params.append("period_id_list", periodList); } else { params.append("report_name", "ARAging"); params.append("relDate", _asOf->date()); } // have both in case we add a third option params.append("useDocDate", QVariant(_useDocDate->isChecked())); params.append("useDistDate", QVariant(_useDistDate->isChecked())); return true; } void dspTimePhasedOpenARItems::sViewOpenItems() { ParameterList params; params.append("cust_id", list()->id()); if (_custom->isChecked()) { params.append("startDate", _periods->getSelected(_column - 1)->startDate()); params.append("endDate", _periods->getSelected(_column - 1)->endDate()); } else { QDate asOfDate; asOfDate = _asOf->date(); if (_column == 3) params.append("startDate", asOfDate ); else if (_column == 4) { params.append("startDate", asOfDate.addDays(-30) ); params.append("endDate", asOfDate.addDays(-1)); } else if (_column == 5) { params.append("startDate",asOfDate.addDays(-60) ); params.append("endDate", asOfDate.addDays(-31)); } else if (_column == 6) { params.append("startDate",asOfDate.addDays(-90) ); params.append("endDate", asOfDate.addDays(-61)); } else if (_column == 7) params.append("endDate",asOfDate.addDays(-91) ); } params.append("byDueDate"); params.append("run"); params.append("asofDate", _asOf->date()); dspAROpenItems *newdlg = new dspAROpenItems(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedOpenARItems::sPrintStatement() { ParameterList params; params.append("cust_id", list()->id()); params.append("asofDate", _asOf->date()); params.append("print"); printStatementByCustomer newdlg(this, "", TRUE); newdlg.set(params); } void dspTimePhasedOpenARItems::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int pColumn) { QAction *menuItem; _column = pColumn; if ((_custom->isChecked()) && (_column == list()->column("linetotal"))) return; if ((_column > 1) && (list()->id() > 0)) { menuItem = pMenu->addAction(tr("View Open Items..."), this, SLOT(sViewOpenItems())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Print Statement..."), this, SLOT(sPrintStatement())); } } void dspTimePhasedOpenARItems::sFillList() { if (_custom->isChecked()) sFillCustom(); else sFillStd(); } void dspTimePhasedOpenARItems::sFillCustom() { XSqlQuery dspFillCustom; if (!_periods->isPeriodSelected()) { if (isVisible()) QMessageBox::warning( this, tr("Select Calendar Periods"), tr("Please select one or more Calendar Periods") ); return; } _columnDates.clear(); list()->setColumnCount(2); QString sql("SELECT cust_id, cust_number, cust_name"); QStringList linetotal; int columns = 1; QList selected = _periods->selectedItems(); for (int i = 0; i < selected.size(); i++) { PeriodListViewItem *cursor = (PeriodListViewItem*)selected[i]; QString bucketname = QString("bucket%1").arg(columns++); sql += QString(", openARItemsValue(cust_id, %2) AS %1," " 'curr' AS %3_xtnumericrole, 0 AS %4_xttotalrole") .arg(bucketname) .arg(cursor->id()) .arg(bucketname) .arg(bucketname); list()->addColumn(formatDate(cursor->startDate()), _bigMoneyColumn, Qt::AlignRight, true, bucketname); _columnDates.append(DatePair(cursor->startDate(), cursor->endDate())); linetotal << QString("openARItemsValue(cust_id, %2)").arg(cursor->id()); } list()->addColumn(tr("Total"), _bigMoneyColumn, Qt::AlignRight, true, "linetotal"); sql += ", " + linetotal.join("+") + " AS linetotal," " 'curr' AS linetotal_xtnumericrole," " 0 AS linetotal_xttotalrole," " (" + linetotal.join("+") + ") = 0.0 AS xthiddenrole " "FROM custinfo LEFT OUTER JOIN custgrpitem ON (cust_id = custgrpitem_cust_id) " "" "WHERE (cust_id=)" "" "WHERE (cust_custtype_id=)" "" "WHERE (custgrpitem_custgrp_id=)" "" "WHERE (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ ))) " "" "ORDER BY cust_number;"; MetaSQLQuery mql(sql); ParameterList params; if (! setParams(params)) return; dspFillCustom = mql.toQuery(params); list()->populate(dspFillCustom); if (dspFillCustom.lastError().type() != QSqlError::NoError) { systemError(this, dspFillCustom.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspTimePhasedOpenARItems::sFillStd() { XSqlQuery dspFillStd; MetaSQLQuery mql = mqlLoad("arAging", "detail"); ParameterList params; if (! setParams(params)) return; dspFillStd = mql.toQuery(params); list()->populate(dspFillStd); if (dspFillStd.lastError().type() != QSqlError::NoError) { systemError(this, dspFillStd.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspTimePhasedOpenARItems::sToggleCustom() { list()->clear(); if (_custom->isChecked()) { setReportName("TimePhasedOpenARItems"); _calendarLit->setHidden(FALSE); _calendar->setHidden(FALSE); _periods->setHidden(FALSE); _asOf->setDate(omfgThis->dbDate(), true); _asOf->setEnabled(FALSE); _useGroup->setHidden(TRUE); list()->setColumnCount(0); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number"); list()->addColumn(tr("Customer"), 180, Qt::AlignLeft, true, "cust_name"); } else { setReportName("ARAging"); _calendarLit->setHidden(TRUE); _calendar->setHidden(TRUE); _periods->setHidden(TRUE); _asOf->setEnabled(TRUE); _useGroup->setHidden(FALSE); list()->setColumnCount(0); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "araging_cust_number"); list()->addColumn(tr("Customer"), 180, Qt::AlignLeft, true, "araging_cust_name"); list()->addColumn(tr("Total Open"), _bigMoneyColumn, Qt::AlignRight, true, "araging_total_val_sum"); list()->addColumn(tr("0+ Days"), _bigMoneyColumn, Qt::AlignRight, true, "araging_cur_val_sum"); list()->addColumn(tr("0-30 Days"), _bigMoneyColumn, Qt::AlignRight, true, "araging_thirty_val_sum"); list()->addColumn(tr("31-60 Days"), _bigMoneyColumn, Qt::AlignRight, true, "araging_sixty_val_sum"); list()->addColumn(tr("61-90 Days"), _bigMoneyColumn, Qt::AlignRight, true, "araging_ninety_val_sum"); list()->addColumn(tr("90+ Days"), _bigMoneyColumn, Qt::AlignRight, true, "araging_plus_val_sum"); } } qt-client-4.1.0/guiclient/displays/dspTimePhasedOpenARItems.h000066400000000000000000000024171217451700100242030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTIMEPHASEDOPENARITEMS_H #define DSPTIMEPHASEDOPENARITEMS_H #include "guiclient.h" #include "display.h" #include #include "ui_dspTimePhasedOpenARItems.h" class dspTimePhasedOpenARItems : public display, public Ui::dspTimePhasedOpenARItems { Q_OBJECT public: dspTimePhasedOpenARItems(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspTimePhasedOpenARItems(); virtual bool setParams(ParameterList &); public slots: virtual void sViewOpenItems(); virtual void sPrintStatement(); virtual void sPopulateMenu( QMenu *, QTreeWidgetItem *, int ); virtual void sFillList(); virtual void sFillStd(); virtual void sFillCustom(); virtual void sToggleCustom(); private: int _column; QList _columnDates; }; #endif // DSPTIMEPHASEDOPENARITEMS_H qt-client-4.1.0/guiclient/displays/dspTimePhasedOpenARItems.ui000066400000000000000000000166271217451700100244010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspTimePhasedOpenARItems 0 0 508 350 Receivables Aging As of: _asOf Use Custom Calendar Qt::Horizontal 0 20 Use 3 0 3 0 Document Date Distribution Date true Qt::Horizontal 0 28 7 0 5 Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 20 0 0 0 0 120 CalendarComboBox XComboBox

    calendarTools.h
    CustomerSelector QWidget
    customerselector.h
    DLineEdit QWidget
    datecluster.h
    1
    PeriodsListView XTreeWidget
    calendarTools.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _asOf _custom _periods _calendar newCalendarId(int) _periods populate(int) 154 187 590 271 _calendar select(ParameterList&) _periods load(ParameterList&) 154 187 590 271 qt-client-4.1.0/guiclient/displays/dspTimePhasedSales.cpp000066400000000000000000000116601217451700100234570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTimePhasedSales.h" #include #include #include #include #include "currdisplay.h" #include "dspSalesHistory.h" #include "parameterwidget.h" #include "guiclient.h" dspTimePhasedSales::dspTimePhasedSales(QWidget* parent, const char*, Qt::WFlags fl) : displayTimePhased(parent, "dspTimePhasedSales", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Time-Phased Sales History")); setReportName("TimePhasedSalesHistory"); setMetaSQLOptions("timePhasedSales", "detail"); setUseAltId(true); setParameterWidgetVisible(true); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->appendComboBox(tr("Customer Group"), "custgrp_id", XComboBox::CustomerGroups); parameterWidget()->append(tr("Customer Group Pattern"), "custgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); _groupBy->append(0,tr("Customer")); _groupBy->append(1,tr("Product Category")); _groupBy->append(2,tr("Item")); _units->append(0, tr("Sales Dollars")); _units->append(1, tr("Inventory")); _units->append(2,tr("Capacity")); _units->append(3, tr("Alt. Capacity")); connect(_groupBy, SIGNAL(newID(int)), this, SLOT(sGroupByChanged())); sGroupByChanged(); } void dspTimePhasedSales::languageChange() { display::languageChange(); retranslateUi(this); } void dspTimePhasedSales::sViewHistory() { ParameterList params; parameterWidget()->appendValue(params); params.append("filter", parameterWidget()->filter()); if (_groupBy->id() == 1) params.append("prodcat_id", list()->id()); else if (_groupBy->id() == 2) params.append("item_id", list()->id()); else params.append("cust_id", list()->id()); params.append("warehous_id", list()->altId()); params.append("startDate", _columnDates[_column - 4].startDate); params.append("endDate", _columnDates[_column - 4].endDate); params.append("run"); dspSalesHistory *newdlg = new dspSalesHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTimePhasedSales::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem *, int pColumn) { if (pColumn < 4) return; QAction *menuItem; _column = pColumn; menuItem = menuThis->addAction(tr("View Sales Detail..."), this, SLOT(sViewHistory())); menuItem->setEnabled(_privileges->check("ViewSalesHistory")); } bool dspTimePhasedSales::setParamsTP(ParameterList & params) { parameterWidget()->appendValue(params); params.append("filter", parameterWidget()->filter()); int idx = _groupBy->id(); if (idx == 1) params.append("byProdcat"); else if (idx == 2) params.append("byItem"); else params.append("byCust"); idx = _units->id(); if (idx == 1) params.append("inventoryUnits"); else if (idx == 2) params.append("capacityUnits"); else if (idx == 3) params.append("altCapacityUnits"); else params.append("salesDollars"); params.append("baseCurrAbbr", CurrDisplay::baseCurrAbbr()); return true; } void dspTimePhasedSales::sGroupByChanged() { int idx = _groupBy->id(); list()->clear(); list()->setColumnCount(0); if (idx == 1) { list()->addColumn(tr("Prod. Cat."), _itemColumn, Qt::AlignLeft, true, "prodcat_code" ); list()->addColumn(tr("Description"), 180, Qt::AlignLeft, true, "prodcat_descrip" ); } else if (idx == 2) { list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), 180, Qt::AlignLeft, true, "item_descrip1" ); } else { list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Name"), 180, Qt::AlignLeft, true, "cust_name" ); } list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom" ); } qt-client-4.1.0/guiclient/displays/dspTimePhasedSales.h000066400000000000000000000020711217451700100231200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTIMEPHASEDSALES_H #define DSPTIMEPHASEDSALES_H #include "displayTimePhased.h" #include "ui_dspTimePhasedBookings.h" class dspTimePhasedSales : public displayTimePhased, public Ui::dspTimePhasedBookings { Q_OBJECT public: dspTimePhasedSales(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParamsTP(ParameterList &); public slots: virtual void sGroupByChanged(); virtual void sViewHistory(); virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem *, int pColumn); protected slots: virtual void languageChange(); }; #endif // DSPTIMEPHASEDSALES_H qt-client-4.1.0/guiclient/displays/dspTimePhasedUsageStatisticsByItem.cpp000066400000000000000000000055621217451700100266450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTimePhasedUsageStatisticsByItem.h" #include #include #include #include #include "dspInventoryHistory.h" #include "guiclient.h" dspTimePhasedUsageStatisticsByItem::dspTimePhasedUsageStatisticsByItem(QWidget* parent, const char*, Qt::WFlags fl) : displayTimePhased(parent, "dspTimePhasedUsageStatisticsByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Time-Phased Item Usage Statistics by Item")); setListLabel(tr("Usage")); setReportName("TimePhasedStatisticsByItem"); setMetaSQLOptions("timePhasedUsageStatisticsByItem", "detail"); list()->addColumn(tr("Transaction Type"), 120, Qt::AlignLeft, true, "label"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); } void dspTimePhasedUsageStatisticsByItem::languageChange() { displayTimePhased::languageChange(); retranslateUi(this); } void dspTimePhasedUsageStatisticsByItem::sViewTransactions() { if (_column > 1) { ParameterList params; params.append("itemsite_id", list()->id()); params.append("startDate", _columnDates[_column - 2].startDate); params.append("endDate", _columnDates[_column - 2].endDate); params.append("run"); QString type = list()->currentItem()->text(0); if (type == "Received") params.append("transtype", "R"); else if (type == "Issued") params.append("transtype", "I"); else if (type == "Sold") params.append("transtype", "S"); else if (type == "Scrap") params.append("transtype", "SC"); else if (type == "Adjustments") params.append("transtype", "A"); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspTimePhasedUsageStatisticsByItem::sPopulateMenu(QMenu *menu, QTreeWidgetItem *, int pColumn) { QAction *menuItem; _column = pColumn; menuItem = menu->addAction(tr("View Transactions..."), this, SLOT(sViewTransactions())); menuItem->setEnabled(_privileges->check("ViewInventoryHistory")); } bool dspTimePhasedUsageStatisticsByItem::setParamsTP(ParameterList & params) { params.append("item_id", _item->id()); _warehouse->appendValue(params); params.append("received", tr("Received")); params.append("issued", tr("Issued")); params.append("sold", tr("Sold")); params.append("scrap", tr("Scrap")); params.append("adjustments", tr("Adjustments")); return true; } qt-client-4.1.0/guiclient/displays/dspTimePhasedUsageStatisticsByItem.h000066400000000000000000000022001217451700100262740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTIMEPHASEDUSAGESTATISTICSBYITEM_H #define DSPTIMEPHASEDUSAGESTATISTICSBYITEM_H #include "displayTimePhased.h" #include "ui_dspTimePhasedUsageStatisticsByItem.h" class dspTimePhasedUsageStatisticsByItem : public displayTimePhased, public Ui::dspTimePhasedUsageStatisticsByItem { Q_OBJECT public: dspTimePhasedUsageStatisticsByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParamsTP(ParameterList &); public slots: virtual void sViewTransactions(); virtual void sPopulateMenu(QMenu * menu, QTreeWidgetItem *, int pColumn); protected slots: virtual void languageChange(); }; #endif // DSPTIMEPHASEDUSAGESTATISTICSBYITEM_H qt-client-4.1.0/guiclient/displays/dspTimePhasedUsageStatisticsByItem.ui000066400000000000000000000047541217451700100265020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspTimePhasedUsageStatisticsByItem 0 0 617 122 Time-Phased Item Usage Statistics by Item Qt::StrongFocus Qt::StrongFocus false ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    _item _warehouse _item newId(int) _warehouse findItemSites(int) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspTrialBalances.cpp000066400000000000000000000134361217451700100231530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTrialBalances.h" #include #include #include #include #include #include "guiclient.h" #include "dspGLTransactions.h" #include "storedProcErrorLookup.h" #include "metasql.h" #include "parameterwidget.h" #include "xtreewidget.h" dspTrialBalances::dspTrialBalances(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspTrialBalances", fl) { setWindowTitle(tr("Trial Balances")); setListLabel(tr("Trial Balances")); setReportName("TrialBalances"); setMetaSQLOptions("trialBalances", "detail"); setUseAltId(true); setParameterWidgetVisible(true); list()->addColumn(tr("Start"), _dateColumn, Qt::AlignCenter, true, "period_start" ); list()->addColumn(tr("End"), _dateColumn, Qt::AlignCenter, true, "period_end" ); list()->addColumn(tr("Account #"), _itemColumn, Qt::AlignLeft, true, "account" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "accnt_descrip" ); list()->addColumn(tr("Beg. Bal."), _bigMoneyColumn, Qt::AlignRight, true, "beginning" ); list()->addColumn(tr("Beg. Bal. Sense"), 25, Qt::AlignLeft, true, "beginningsense" ); list()->addColumn(tr("Debits"), _bigMoneyColumn, Qt::AlignRight, true, "debits" ); list()->addColumn(tr("Credits"), _bigMoneyColumn, Qt::AlignRight, true, "credits" ); list()->addColumn(tr("Difference"), _bigMoneyColumn, Qt::AlignRight, true, "diff" ); list()->addColumn(tr("Difference Sense"), 25, Qt::AlignLeft, true, "diffsense" ); list()->addColumn(tr("End Bal."), _bigMoneyColumn, Qt::AlignRight, true, "ending" ); list()->addColumn(tr("End Bal. Sense"), 25, Qt::AlignLeft, true, "endingsense" ); // Determine current period int periodid = -1; XSqlQuery qry; qry.exec("SELECT period_id " "FROM period " "WHERE (current_date BETWEEN period_start AND period_end);"); if (qry.first()) periodid = qry.value("period_id").toInt(); parameterWidget()->appendComboBox(tr("Period"), "period_id", XComboBox::AccountingPeriods, QVariant(periodid)); if (_metrics->value("GLCompanySize").toInt() > 0) parameterWidget()->appendComboBox(tr("Company"), "company_id", XComboBox::Companies); parameterWidget()->append(tr("GL Account"), "accnt_id", ParameterWidget::GLAccount); parameterWidget()->append(tr("Show Zero Amounts"), "showZero", ParameterWidget::Exists); parameterWidget()->applyDefaultFilterSet(); } void dspTrialBalances::languageChange() { display::languageChange(); } void dspTrialBalances::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("View Transactions..."), this, SLOT(sViewTransactions())); if (_metrics->boolean("ManualForwardUpdate")) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Forward Update"), this, SLOT(sForwardUpdate())); } } void dspTrialBalances::sViewTransactions() { ParameterList params; params.append("accnt_id", list()->id()); params.append("period_id", list()->altId()); params.append("run"); dspGLTransactions *newdlg = new dspGLTransactions(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspTrialBalances::sForwardUpdate() { XSqlQuery dspForwardUpdate; dspForwardUpdate.prepare( "SELECT MIN(forwardUpdateTrialBalance(trialbal_id)) AS result " "FROM trialbal " "WHERE ( (trialbal_period_id=:period_id)" " AND (trialbal_accnt_id=:accnt_id) );"); dspForwardUpdate.bindValue(":accnt_id", list()->id()); dspForwardUpdate.bindValue(":period_id", list()->altId()); dspForwardUpdate.exec(); if (dspForwardUpdate.first()) { int result = dspForwardUpdate.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("forwardUpdateTrialBalance", result), __FILE__, __LINE__); return; } } else if (dspForwardUpdate.lastError().type() != QSqlError::NoError) { systemError(this, dspForwardUpdate.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspTrialBalances::sPrint() { if (!_metrics->boolean("ManualForwardUpdate")) { if (!forwardUpdate()) return; } display::sPrint(); } void dspTrialBalances::sFillList() { list()->clear(); if (!_metrics->boolean("ManualForwardUpdate")) { if (!forwardUpdate()) return; } display::sFillList(); } bool dspTrialBalances::forwardUpdate() { XSqlQuery dspforwardUpdate; QString sql( "SELECT MIN(forwardUpdateAccount(accnt_id)) AS result " "FROM accnt " "" " WHERE (accnt_id=)" "" ";" ); ParameterList params; setParams(params); MetaSQLQuery mql(sql); dspforwardUpdate = mql.toQuery(params); if (dspforwardUpdate.first()) { int result = dspforwardUpdate.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("forwardUpdateTrialBalance", result), __FILE__, __LINE__); return false; } } else if (dspforwardUpdate.lastError().type() != QSqlError::NoError) { systemError(this, dspforwardUpdate.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } qt-client-4.1.0/guiclient/displays/dspTrialBalances.h000066400000000000000000000020041217451700100226050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTRIALBALANCES_H #define DSPTRIALBALANCES_H #include "display.h" class dspTrialBalances : public display { Q_OBJECT public: dspTrialBalances(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sViewTransactions(); virtual void sForwardUpdate(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); protected: virtual bool forwardUpdate(); }; #endif // DSPTRIALBALANCES_H qt-client-4.1.0/guiclient/displays/dspUnbalancedQOHByClassCode.cpp000066400000000000000000000115701217451700100251240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspUnbalancedQOHByClassCode.h" #include #include #include #include "createCountTagsByItem.h" #include "dspInventoryAvailability.h" #include "itemSite.h" #include "storedProcErrorLookup.h" dspUnbalancedQOHByClassCode::dspUnbalancedQOHByClassCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspUnbalancedQOHByClassCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Unbalanced QOH by Class Code")); setListLabel(tr("&Item Sites")); setMetaSQLOptions("unbalancedQOHByClassCode", "detail"); setUseAltId(true); _classCode->setType(ParameterGroup::ClassCode); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "itemsite_qtyonhand" ); list()->addColumn(tr("QOH Detail."), _qtyColumn, Qt::AlignRight, true, "detailedqoh" ); list()->addColumn(tr("NN QOH"), _qtyColumn, Qt::AlignRight, true, "itemsite_nnqoh" ); list()->addColumn(tr("NN Detail."), _qtyColumn, Qt::AlignRight, true, "detailednnqoh" ); } void dspUnbalancedQOHByClassCode::languageChange() { display::languageChange(); retranslateUi(this); } void dspUnbalancedQOHByClassCode::sBalance() { XSqlQuery dspBalance; dspBalance.prepare("SELECT balanceItemsite(:itemsite_id) AS result;"); dspBalance.bindValue(":itemsite_id", list()->id()); dspBalance.exec(); if (dspBalance.first()) { int result = dspBalance.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("balanceItemsite", result), __FILE__, __LINE__); return; } } else if (dspBalance.lastError().type() != QSqlError::NoError) { systemError(this, dspBalance.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspUnbalancedQOHByClassCode::sView() { ParameterList params; params.append("mode", "view"); params.append("itemsite_id", list()->id()); itemSite newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspUnbalancedQOHByClassCode::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("itemsite_id", list()->id()); itemSite newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspUnbalancedQOHByClassCode::sInventoryAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("byLeadTime"); params.append("run"); dspInventoryAvailability *newdlg = new dspInventoryAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspUnbalancedQOHByClassCode::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspUnbalancedQOHByClassCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Balance Item Site..."), this, SLOT(sBalance())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Item Site..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainItemSites") || _privileges->check("ViewItemSites")); menuItem = pMenu->addAction(tr("Edit Item Site..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainItemSites")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Inventory Availability..."), this, SLOT(sInventoryAvailability())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag())); menuItem->setEnabled(_privileges->check("IssueCountTags")); } bool dspUnbalancedQOHByClassCode::setParams(ParameterList ¶ms) { if ((_classCode->isSelected()) || (_classCode->isPattern())) _classCode->appendValue(params); if (_warehouse->isSelected()) params.append("warehous_id", _warehouse->id()); params.append("regular", tr("Regular")); params.append("none", tr("None")); params.append("lot", tr("Lot #")); params.append("serial", tr("Serial #")); return true; } qt-client-4.1.0/guiclient/displays/dspUnbalancedQOHByClassCode.h000066400000000000000000000022531217451700100245670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPUNBALANCEDQOHBYCLASSCODE_H #define DSPUNBALANCEDQOHBYCLASSCODE_H #include "display.h" #include "ui_dspUnbalancedQOHByClassCode.h" class dspUnbalancedQOHByClassCode : public display, public Ui::dspUnbalancedQOHByClassCode { Q_OBJECT public: dspUnbalancedQOHByClassCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sBalance(); virtual void sView(); virtual void sEdit(); virtual void sInventoryAvailability(); virtual void sIssueCountTag(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); protected slots: virtual void languageChange(); }; #endif // DSPUNBALANCEDQOHBYCLASSCODE_H qt-client-4.1.0/guiclient/displays/dspUnbalancedQOHByClassCode.ui000066400000000000000000000054711217451700100247620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspUnbalancedQOHByClassCode 0 0 412 120 Unbalanced QOH by Class Code 0 false false Qt::Vertical 20 0 Qt::Horizontal 17 20 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _classCode _warehouse parameter.h
    qt-client-4.1.0/guiclient/displays/dspUndefinedManufacturedItems.cpp000066400000000000000000000060051217451700100257030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspUndefinedManufacturedItems.h" #include #include #include #include "guiclient.h" #include "bom.h" #include "item.h" dspUndefinedManufacturedItems::dspUndefinedManufacturedItems(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspUndefinedManufacturedItems", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Undefined Manufactured Items")); setListLabel(tr("Undefined Manufactured Items")); setMetaSQLOptions("undefinedManufacturedItems", "detail"); setUseAltId(true); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Type"), _uomColumn, Qt::AlignCenter, true, "item_type" ); list()->addColumn(tr("Active"), _orderColumn, Qt::AlignCenter, true, "item_active" ); list()->addColumn(tr("Exception"), _itemColumn, Qt::AlignCenter, true, "exception" ); connect(omfgThis, SIGNAL(itemsUpdated(int, bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(boosUpdated(int, bool)), this, SLOT(sFillList())); if (_preferences->boolean("XCheckBox/forgetful")) { _bom->setChecked(true); } if (!_privileges->check("ViewBOMs")) { _bom->setChecked(false); _bom->setEnabled(false); } } void dspUndefinedManufacturedItems::languageChange() { display::languageChange(); retranslateUi(this); } void dspUndefinedManufacturedItems::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Item..."), this, SLOT(sEditItem())); menuItem->setEnabled(_privileges->check("MaintainItemMasters")); if (((XTreeWidgetItem *)list()->currentItem())->altId() == 2) { menuItem = pMenu->addAction(tr("Create BOM..."), this, SLOT(sCreateBOM())); menuItem->setEnabled(_privileges->check("MaintainBOMs")); } } void dspUndefinedManufacturedItems::sCreateBOM() { ParameterList params; params.append("mode", "edit"); params.append("item_id", list()->id()); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspUndefinedManufacturedItems::sEditItem() { item::editItem(list()->id()); } bool dspUndefinedManufacturedItems::setParams(ParameterList ¶ms) { if (!_bom->isChecked()) { list()->clear(); return false; } params.append("noBom", tr("No BOM")); if (!_showInactive->isChecked()) params.append("notshowInactive"); return true; } qt-client-4.1.0/guiclient/displays/dspUndefinedManufacturedItems.h000066400000000000000000000021261217451700100253500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPUNDEFINEDMANUFACTUREDITEMS_H #define DSPUNDEFINEDMANUFACTUREDITEMS_H #include "display.h" #include "ui_dspUndefinedManufacturedItems.h" class dspUndefinedManufacturedItems : public display, public Ui::dspUndefinedManufacturedItems { Q_OBJECT public: dspUndefinedManufacturedItems(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sCreateBOM(); virtual void sEditItem(); protected slots: virtual void languageChange(); }; #endif // DSPUNDEFINEDMANUFACTUREDITEMS_H qt-client-4.1.0/guiclient/displays/dspUndefinedManufacturedItems.ui000066400000000000000000000054431217451700100255430ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspUndefinedManufacturedItems 0 0 606 41 Undefined Manufactured Items 0 0 0 Show Manufactured Items without valid Bills of Materials false Show &Inactive Items Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 XCheckBox QCheckBox
    xcheckbox.h
    _bom _showInactive
    qt-client-4.1.0/guiclient/displays/dspUninvoicedReceivings.cpp000066400000000000000000000105501217451700100245630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspUninvoicedReceivings.h" #include #include #include #include "enterPoitemReceipt.h" #include "poLiabilityDistrib.h" #include "postPoReturnCreditMemo.h" dspUninvoicedReceivings::dspUninvoicedReceivings(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspUninvoicedReceivings", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Uninvoiced P/O Receipts and Returns")); setListLabel(tr("Purchase Order &Receipts")); setReportName("UninvoicedReceipts"); setMetaSQLOptions("uninvoicedReceivings", "detail"); setUseAltId(true); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "thedate"); list()->addColumn(tr("By"), _orderColumn, Qt::AlignCenter, true, "f_user" ); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignLeft, true, "ponumber"); list()->addColumn(tr("#"), _whsColumn, Qt::AlignCenter, true, "poitem_linenumber"); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "itemnumber"); list()->addColumn(tr("Uninvoiced"), _qtyColumn, Qt::AlignRight, true, "qty"); list()->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "type"); list()->addColumn(tr("Value"), _moneyColumn, Qt::AlignRight, true, "value"); sFillList(); } void dspUninvoicedReceivings::languageChange() { display::languageChange(); retranslateUi(this); } void dspUninvoicedReceivings::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem*, int) { QAction *menuItem; if(_privileges->check("MaintainUninvoicedReceipts")) { if(list()->altId() < 3) { menuItem = pMenu->addAction(tr("Mark as Invoiced..."), this, SLOT(sMarkAsInvoiced())); menuItem = pMenu->addAction(tr("Correct Receiving..."), this, SLOT(sCorrectReceiving())); if(list()->altId() == 2) menuItem->setEnabled(false); } if (list()->altId() == 3) menuItem = pMenu->addAction(tr("Create Credit Memo..."), this, SLOT(sCreateCreditMemo())); } } void dspUninvoicedReceivings::sMarkAsInvoiced() { XSqlQuery dspMarkAsInvoiced; bool update = true; dspMarkAsInvoiced.prepare("SELECT * FROM recv " "WHERE ((recv_value <> 0) " "AND (recv_id=:recv_id));"); dspMarkAsInvoiced.bindValue(":recv_id",list()->id()); dspMarkAsInvoiced.exec(); if (dspMarkAsInvoiced.first()) { ParameterList params; params.append("recv_id", list()->id()); poLiabilityDistrib newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() == XDialog::Rejected) update = false; } else if (dspMarkAsInvoiced.lastError().type() != QSqlError::NoError) { systemError(this, dspMarkAsInvoiced.lastError().databaseText(), __FILE__, __LINE__); return; } if (update) { dspMarkAsInvoiced.prepare("UPDATE recv " "SET recv_invoiced=true " "WHERE (recv_id=:recv_id); "); dspMarkAsInvoiced.bindValue(":recv_id",list()->id()); dspMarkAsInvoiced.exec(); if (dspMarkAsInvoiced.lastError().type() != QSqlError::NoError) { systemError(this, dspMarkAsInvoiced.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void dspUninvoicedReceivings::sCorrectReceiving() { if (enterPoitemReceipt::correctReceipt(list()->id(), this) != XDialog::Rejected) sFillList(); } void dspUninvoicedReceivings::sCreateCreditMemo() { ParameterList params; params.append("poreject_id", list()->id()); postPoReturnCreditMemo newdlg(this, "", true); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } bool dspUninvoicedReceivings::setParams(ParameterList &pParams) { _warehouse->appendValue(pParams); if(_selectedPurchasingAgent->isChecked()) pParams.append("agentUsername", _agent->currentText()); return true; } qt-client-4.1.0/guiclient/displays/dspUninvoicedReceivings.h000066400000000000000000000021371217451700100242320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPUNINVOICEDRECEIVINGS_H #define DSPUNINVOICEDRECEIVINGS_H #include "display.h" #include "ui_dspUninvoicedReceivings.h" class dspUninvoicedReceivings : public display, public Ui::dspUninvoicedReceivings { Q_OBJECT public: dspUninvoicedReceivings(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem*, int); virtual void sMarkAsInvoiced(); virtual void sCorrectReceiving(); virtual void sCreateCreditMemo(); protected slots: virtual void languageChange(); }; #endif // DSPUNINVOICEDRECEIVINGS_H qt-client-4.1.0/guiclient/displays/dspUninvoicedReceivings.ui000066400000000000000000000076751217451700100244340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspUninvoicedReceivings 0 0 491 92 Uninvoiced P/O Receipts and Returns 0 false All Purchasing Agents true Selected: false 0 0 Qt::Horizontal 0 20 Qt::Vertical 20 1 WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _warehouse _allPurchasingAgents _agent _selectedPurchasingAgent toggled(bool) _agent setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspUnusedPurchasedItems.cpp000066400000000000000000000042261217451700100245500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspUnusedPurchasedItems.h" #include #include "xtreewidget.h" dspUnusedPurchasedItems::dspUnusedPurchasedItems(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { setupUi(optionsWidget()); setWindowTitle(tr("Unused Purchased Items")); setListLabel(tr("Unused Purchased Items")); setReportName("UnusedPurchasedItems"); setMetaSQLOptions("unusedPurchasedItems", "detail"); _classCode->setType(ParameterGroup::ClassCode); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name" ); list()->addColumn(tr("Total QOH"), _qtyColumn, Qt::AlignRight, true, "qoh" ); list()->addColumn(tr("Last Cnt'd"), _dateColumn, Qt::AlignRight, true, "lastcount" ); list()->addColumn(tr("Last Used"), _dateColumn, Qt::AlignRight, true, "lastused" ); } void dspUnusedPurchasedItems::languageChange() { languageChange(); retranslateUi(this); } bool dspUnusedPurchasedItems::setParams(ParameterList & params) { if (_classCode->isPattern() && ! _classCode->isAll()) { QString pattern = _classCode->pattern(); if (pattern.length() == 0) { QMessageBox::warning(this, tr("Enter Class Code"), tr("Class Code Pattern cannot be blank.")); return false; } } _classCode->appendValue(params); if (!_includeUncontrolled->isChecked()) params.append("includeUncontrolled"); // metasql only? if(_includeUncontrolled->isChecked()) params.append("includeUncontrolledItems"); // report only? return true; } qt-client-4.1.0/guiclient/displays/dspUnusedPurchasedItems.h000066400000000000000000000016331217451700100242140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPUNUSEDPURCHASEDITEMS_H #define DSPUNUSEDPURCHASEDITEMS_H #include "display.h" #include "ui_dspUnusedPurchasedItems.h" class dspUnusedPurchasedItems : public display, public Ui::dspUnusedPurchasedItems { Q_OBJECT public: dspUnusedPurchasedItems(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPUNUSEDPURCHASEDITEMS_H qt-client-4.1.0/guiclient/displays/dspUnusedPurchasedItems.ui000066400000000000000000000047721217451700100244110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspUnusedPurchasedItems 0 0 397 151 Unused Purchased Items false Include &Uncontrolled Items Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 92 20 ParameterGroup QGroupBox
    parametergroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _classCode
    qt-client-4.1.0/guiclient/displays/dspUsageStatistics.cpp000066400000000000000000000146711217451700100235700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspUsageStatistics.h" #include #include #include #include #include "dspInventoryHistory.h" #include "parameterwidget.h" #include "xtreewidget.h" dspUsageStatistics::dspUsageStatistics(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, name, fl) { setWindowTitle(tr("Item Usage Statistics")); setReportName("UsageStatistics"); setMetaSQLOptions("usageStatistics", "detail"); setUseAltId(true); setParameterWidgetVisible(true); _printing = false; parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date, QDate(QDate::currentDate().year(),1,1), true); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date, QDate::currentDate(), true); parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->append(tr("Class Code Pattern"), "classcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Item Group"), "itemgrp_id", XComboBox::ItemGroups); parameterWidget()->append(tr("Item Group Pattern"), "itemgrp_pattern", ParameterWidget::Text); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "received" ); list()->addColumn(tr("Issued"), _qtyColumn, Qt::AlignRight, true, "issued" ); list()->addColumn(tr("Sold"), _qtyColumn, Qt::AlignRight, true, "sold" ); list()->addColumn(tr("Scrap"), _qtyColumn, Qt::AlignRight, true, "scrap" ); list()->addColumn(tr("Adjustments"), _qtyColumn, Qt::AlignRight, true, "adjust" ); if (_metrics->boolean("MultiWhs")) list()->addColumn(tr("Transfers"), _qtyColumn, Qt::AlignRight, true, "transfer" ); } enum SetResponse dspUsageStatistics::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; parameterWidget()->setSavedFilters(); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param); param = pParams.value("warehous_id", &valid); if (valid) { if (param.toInt() > 0) parameterWidget()->setDefault(tr("Site"), param); } param = pParams.value("startDate", &valid); if (valid) parameterWidget()->setDefault(tr("Start Date"), param); else parameterWidget()->setDefault(tr("Start Date"), omfgThis->startOfTime()); param = pParams.value("endDate", &valid); if (valid) parameterWidget()->setDefault(tr("End Date"), param); else parameterWidget()->setDefault(tr("End Date"), omfgThis->endOfTime()); parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspUsageStatistics::setParams(ParameterList & params) { if (!display::setParams(params)) return false; if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if(_printing) params.append("print"); return true; } void dspUsageStatistics::sPrint() { _printing = true; display::sPrint(); _printing = false; } void dspUsageStatistics::sPreview() { _printing = true; display::sPreview(); _printing = false; } void dspUsageStatistics::sViewAll() { viewTransactions(QString::null); } void dspUsageStatistics::sViewReceipt() { viewTransactions("R"); } void dspUsageStatistics::sViewIssue() { viewTransactions("I"); } void dspUsageStatistics::sViewSold() { viewTransactions("S"); } void dspUsageStatistics::sViewScrap() { viewTransactions("SC"); } void dspUsageStatistics::sViewAdjustment() { viewTransactions("A"); } void dspUsageStatistics::sViewTransfer() { viewTransactions("T"); } void dspUsageStatistics::viewTransactions(QString pType) { ParameterList params; display::setParams(params); params.append("itemsite_id", list()->id()); params.append("run"); if (!pType.isNull()) params.append("transtype", pType); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspUsageStatistics::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int pColumn) { QAction *menuItem; menuItem = pMenu->addAction("View All Transactions...", this, SLOT(sViewAll())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); switch (pColumn) { case 3: menuItem = pMenu->addAction("View Receipt Transactions...", this, SLOT(sViewReceipt())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); break; case 4: menuItem = pMenu->addAction("View Issue Transactions...", this, SLOT(sViewIssue())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); break; case 5: menuItem = pMenu->addAction("View Sold Transactions...", this, SLOT(sViewSold())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); break; case 6: menuItem = pMenu->addAction("View Scrap Transactions...", this, SLOT(sViewScrap())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); break; case 7: menuItem = pMenu->addAction("View Adjustment Transactions...", this, SLOT(sViewAdjustment())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); break; case 8: menuItem = pMenu->addAction("View Transfer Transactions...", this, SLOT(sViewTransfer())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); break; } } qt-client-4.1.0/guiclient/displays/dspUsageStatistics.h000066400000000000000000000024441217451700100232300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DSPUSAGESTATISTICS_H__ #define __DSPUSAGESTATISTICS_H__ #include "guiclient.h" #include "display.h" class dspUsageStatistics : public display { Q_OBJECT public: dspUsageStatistics(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList & params); virtual void viewTransactions(QString); public slots: virtual enum SetResponse set(const ParameterList &); virtual void sViewAll(); virtual void sViewReceipt(); virtual void sViewIssue(); virtual void sViewSold(); virtual void sViewScrap(); virtual void sViewAdjustment(); virtual void sViewTransfer(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int pColumn ); virtual void sPreview(); virtual void sPrint(); private: bool _printing; }; #endif // __DSPUSAGESTATISTICS_H__ qt-client-4.1.0/guiclient/displays/dspValidLocationsByItem.cpp000066400000000000000000000034771217451700100245000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspValidLocationsByItem.h" #include #include #include dspValidLocationsByItem::dspValidLocationsByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspValidLocationsByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Valid Locations by Item")); setListLabel(tr("Valid Locations")); setReportName("ValidLocationsByItem"); setMetaSQLOptions("validLocationsByItem", "detail"); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Location"), _itemColumn, Qt::AlignLeft, true, "locationname" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "locationdescrip" ); list()->addColumn(tr("Restricted"), _orderColumn, Qt::AlignCenter, true, "location_restrict" ); list()->addColumn(tr("Netable"), _orderColumn, Qt::AlignCenter, true, "location_netable" ); } void dspValidLocationsByItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspValidLocationsByItem::setParams(ParameterList & params) { if (! _item->isValid()) { QMessageBox::warning(this, tr("Invalid Item"), tr("Please select a valid Item.")); _item->setFocus(); return false; } params.append("item_id", _item->id()); _warehouse->appendValue(params); return true; } qt-client-4.1.0/guiclient/displays/dspValidLocationsByItem.h000066400000000000000000000016331217451700100241350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPVALIDLOCATIONSBYITEM_H #define DSPVALIDLOCATIONSBYITEM_H #include "display.h" #include "ui_dspValidLocationsByItem.h" class dspValidLocationsByItem : public display, public Ui::dspValidLocationsByItem { Q_OBJECT public: dspValidLocationsByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // DSPVALIDLOCATIONSBYITEM_H qt-client-4.1.0/guiclient/displays/dspValidLocationsByItem.ui000066400000000000000000000051121217451700100243170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspValidLocationsByItem 0 0 609 120 Valid Locations by Item false ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    _item _warehouse _item newId(int) _warehouse findItemSites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspVendorAPHistory.cpp000066400000000000000000000215001217451700100234760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspVendorAPHistory.h" #include #include #include #include #include #include "apOpenItem.h" #include "voucher.h" #include "miscVoucher.h" #include "dspGLSeries.h" dspVendorAPHistory::dspVendorAPHistory(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspVendorAPHistory", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Vendor History")); setReportName("VendorAPHistory"); setMetaSQLOptions("vendorAPHistory", "detail"); setUseAltId(true); connect(_searchInvoiceNum, SIGNAL(textChanged(const QString&)), this, SLOT(sSearchInvoiceNum())); list()->setRootIsDecorated(true); list()->addColumn(tr("Open"), _dateColumn, Qt::AlignCenter, true, "f_open" ); list()->addColumn(tr("Doc. Type"), _itemColumn, Qt::AlignCenter, true, "documenttype" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignRight, true, "docnumber" ); list()->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignRight, true, "invoicenumber" ); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "ponumber" ); list()->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, true, "docdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "duedate" ); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "amount" ); list()->addColumn(tr("Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _bigMoneyColumn, Qt::AlignRight, false, "base_amount" ); list()->addColumn(tr("Applied (%1)").arg(CurrDisplay::baseCurrAbbr()), _bigMoneyColumn, Qt::AlignRight, false, "base_applied" ); list()->addColumn(tr("Balance"), _moneyColumn, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter, true, "currAbbr" ); list()->addColumn(tr("Base Balance"), _bigMoneyColumn, Qt::AlignRight, true, "base_balance" ); list()->setPopulateLinear(); } void dspVendorAPHistory::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspVendorAPHistory::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) _vend->setId(param.toInt()); param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspVendorAPHistory::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int) { QAction *menuItem; XTreeWidgetItem * item = (XTreeWidgetItem*)pSelected; if (item->id() != -1) { menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("EditAPOpenItem")); pMenu->addAction(tr("View A/P Open..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("View G/L Series..."), this, SLOT(sViewGLSeries())); menuItem->setEnabled(_privileges->check("ViewGLTransactions")); if(item->altId() == -1 && item->text(1)==tr("Voucher")) { menuItem = pMenu->addAction(tr("View Voucher..."), this, SLOT(sViewVoucher())); menuItem->setEnabled(_privileges->check("ViewVouchers") || _privileges->check("MaintainVouchers")); if(item->rawValue("amount")==item->rawValue("balance")) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Void"), this, SLOT(sVoidVoucher())); menuItem->setEnabled(_privileges->check("VoidPostedVouchers")); } } } } void dspVendorAPHistory::sEdit() { ParameterList params; params.append("mode", "edit"); if (list()->altId() == -1) params.append("apopen_id", list()->id()); else params.append("apopen_id", list()->altId()); apOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); sFillList(); } void dspVendorAPHistory::sView() { ParameterList params; params.append("mode", "view"); if (list()->altId() == -1) params.append("apopen_id", list()->id()); else params.append("apopen_id", list()->altId()); apOpenItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspVendorAPHistory::sFillList() { display::sFillList(); sSearchInvoiceNum(); } bool dspVendorAPHistory::setParams(ParameterList ¶ms) { if (isVisible()) { if (!_vend->isValid()) { QMessageBox::warning( this, tr("Select Number"), tr("Please select a valid Vendor.") ); _vend->setFocus(); return false; } if (!_dates->startDate().isValid()) { QMessageBox::warning( this, tr("Enter Start Date"), tr("Please enter a valid Start Date.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::warning( this, tr("Enter End Date"), tr("Please enter a valid End Date.") ); _dates->setFocus(); return false; } } params.append("creditMemo", tr("Credit Memo")); params.append("debitMemo", tr("Debit Memo")); params.append("check", tr("Check")); params.append("voucher", tr("Voucher")); params.append("other", tr("Other")); params.append("vend_id", _vend->id()); _dates->appendValue(params); return true; } void dspVendorAPHistory::sSearchInvoiceNum() { QString sub = _searchInvoiceNum->text().trimmed(); if(sub.isEmpty()) return; XTreeWidgetItem *item = 0; XTreeWidgetItem *foundSub = 0; for (int i = 0; i < list()->topLevelItemCount(); i++) { item = list()->topLevelItem(i); if (item->text(3) == sub) { foundSub = item; break; } else if (foundSub == 0 && item->text(3).startsWith(sub)) foundSub = item; } if (foundSub) { list()->setCurrentItem(foundSub); list()->scrollToItem(foundSub); } } void dspVendorAPHistory::sVoidVoucher() { XSqlQuery dspVoidVoucher; dspVoidVoucher.prepare("SELECT voidApopenVoucher(:apopen_id) AS result;"); dspVoidVoucher.bindValue(":apopen_id", list()->id()); dspVoidVoucher.exec(); if(dspVoidVoucher.first()) { if(dspVoidVoucher.value("result").toInt() < 0) systemError( this, tr("A System Error occurred at %1::%2, Error #%3.") .arg(__FILE__) .arg(__LINE__) .arg(dspVoidVoucher.value("result").toInt()) ); else sFillList(); } else systemError( this, dspVoidVoucher.lastError().databaseText(), __FILE__, __LINE__); } void dspVendorAPHistory::sViewVoucher() { XSqlQuery dspViewVoucher; dspViewVoucher.prepare("SELECT vohead_id, COALESCE(pohead_id, -1) AS pohead_id" " FROM apopen, vohead LEFT OUTER JOIN pohead ON (vohead_pohead_id=pohead_id)" " WHERE((vohead_number=apopen_docnumber)" " AND (apopen_id=:apopen_id));"); dspViewVoucher.bindValue(":apopen_id", list()->id()); dspViewVoucher.exec(); if(dspViewVoucher.first()) { ParameterList params; params.append("mode", "view"); params.append("vohead_id", dspViewVoucher.value("vohead_id").toInt()); if (dspViewVoucher.value("pohead_id").toInt() == -1) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } else systemError( this, dspViewVoucher.lastError().databaseText(), __FILE__, __LINE__); } void dspVendorAPHistory::sViewGLSeries() { XSqlQuery dspViewGLSeries; dspViewGLSeries.prepare("SELECT apopen_docdate, apopen_journalnumber" " FROM apopen" " WHERE(apopen_id=:apopen_id);"); dspViewGLSeries.bindValue(":apopen_id", list()->id()); dspViewGLSeries.exec(); if(dspViewGLSeries.first()) { ParameterList params; params.append("startDate", dspViewGLSeries.value("apopen_docdate").toDate()); params.append("endDate", dspViewGLSeries.value("apopen_docdate").toDate()); params.append("journalnumber", dspViewGLSeries.value("apopen_journalnumber").toInt()); dspGLSeries *newdlg = new dspGLSeries(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else systemError( this, dspViewGLSeries.lastError().databaseText(), __FILE__, __LINE__); } qt-client-4.1.0/guiclient/displays/dspVendorAPHistory.h000066400000000000000000000024131217451700100231450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPVENDORAPHISTORY_H #define DSPVENDORAPHISTORY_H #include "guiclient.h" #include "display.h" #include "ui_dspVendorAPHistory.h" class dspVendorAPHistory : public display, public Ui::dspVendorAPHistory { Q_OBJECT public: dspVendorAPHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int); virtual void sEdit(); virtual void sView(); virtual void sVoidVoucher(); virtual void sViewVoucher(); virtual void sViewGLSeries(); virtual void sFillList(); protected slots: virtual void languageChange(); virtual void sSearchInvoiceNum(); }; #endif // DSPVENDORAPHISTORY_H qt-client-4.1.0/guiclient/displays/dspVendorAPHistory.ui000066400000000000000000000104321217451700100233330ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspVendorAPHistory 0 0 554 155 Vendor History 0 Vendor: Qt::Vertical QSizePolicy::Preferred 20 7 Qt::Horizontal 0 20 Find Vend. Invoice #: 0 Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 11 DateCluster QWidget
    datecluster.h
    VendorCluster QWidget
    vendorcluster.h
    _vend _searchInvoiceNum parameter.h
    qt-client-4.1.0/guiclient/displays/dspVoucherRegister.cpp000066400000000000000000000163371217451700100235720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspVoucherRegister.h" #include #include #include #include #include "glTransactionDetail.h" #include "invoice.h" #include "miscVoucher.h" #include "purchaseOrder.h" #include "voucher.h" dspVoucherRegister::dspVoucherRegister(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspVoucherRegister", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Voucher Register")); setListLabel(tr("Vouchers")); setReportName("VoucherRegister"); setMetaSQLOptions("voucherRegister", "detail"); connect(_selectedAccount, SIGNAL(toggled(bool)), _account, SLOT(setEnabled(bool))); connect(_showUsername, SIGNAL(toggled(bool)), this, SLOT(sShowUsername(bool))); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "gltrans_date" ); list()->addColumn(tr("Vend. #"), _orderColumn, Qt::AlignRight, true, "vend_number" ); list()->addColumn(tr("Vend. Name"), _itemColumn, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter, true, "gltrans_doctype" ); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "gltrans_docnumber" ); list()->addColumn(tr("Reference"), -1, Qt::AlignLeft, true, "reference" ); list()->addColumn(tr("Account"), _itemColumn, Qt::AlignLeft, true, "account" ); list()->addColumn(tr("Debit"), _moneyColumn, Qt::AlignRight, true, "debit" ); list()->addColumn(tr("Credit"), _moneyColumn, Qt::AlignRight, true, "credit" ); list()->addColumn(tr("Username"), _userColumn, Qt::AlignLeft, true, "gltrans_username" ); sShowUsername(_showUsername->isChecked()); } void dspVoucherRegister::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspVoucherRegister::set(const ParameterList &pParams) { XSqlQuery dspet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("accnt_id", &valid); if (valid) { _selectedAccount->setChecked(true); _account->setId(param.toInt()); } param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); param = pParams.value("period_id", &valid); if (valid) { dspet.prepare( "SELECT period_start, period_end " "FROM period " "WHERE (period_id=:period_id);" ); dspet.bindValue(":period_id", param.toInt()); dspet.exec(); if (dspet.first()) { _dates->setStartDate(dspet.value("period_start").toDate()); _dates->setEndDate(dspet.value("period_end").toDate()); } } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspVoucherRegister::sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int) { menuThis->addAction(tr("View..."), this, SLOT(sViewTrans())); XTreeWidgetItem *item = dynamic_cast(list()->currentItem()); if(0 == item) return; QString doctype = item->rawValue("gltrans_doctype").toString(); if (doctype == "VO") menuThis->addAction(tr("View Voucher..."), this, SLOT(sViewDocument())); else if (doctype == "IN") menuThis->addAction(tr("View Invoice..."), this, SLOT(sViewDocument())); else if (doctype == "PO") menuThis->addAction(tr("View Purchase Order..."), this, SLOT(sViewDocument())); } bool dspVoucherRegister::setParams(ParameterList & params) { if (! _dates->startDate().isValid()) { QMessageBox::warning(this, tr("Invalid Date"), tr("Enter a valid Start Date.")); _dates->setFocus(); return false; } if (! _dates->endDate().isValid()) { QMessageBox::warning(this, tr("Invalid Date"), tr("Enter a valid End Date.")); _dates->setFocus(); return false; } if (_selectedAccount->isChecked()) if (! _account->isValid()) { QMessageBox::warning(this, tr("Invalid Account"), tr("Enter a valid Account.")); _account->setFocus(); return false; } _dates->appendValue(params); if (_selectedAccount->isChecked()) params.append("accnt_id", _account->id()); if (_showUsername->isChecked()) params.append("showUsernames"); return true; } void dspVoucherRegister::sShowUsername( bool yes ) { if(yes) list()->showColumn(list()->column("gltrans_username")); else list()->hideColumn(list()->column("gltrans_username")); } void dspVoucherRegister::sViewTrans() { ParameterList params; params.append("gltrans_id", list()->id()); glTransactionDetail newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspVoucherRegister::sViewDocument() { XSqlQuery dspViewDocument; XTreeWidgetItem *item = dynamic_cast(list()->currentItem()); if(0 == item) return; QString doctype = item->rawValue("gltrans_doctype").toString(); QString docnumber = item->rawValue("gltrans_docnumber").toString(); ParameterList params; if(doctype == "VO") { dspViewDocument.prepare("SELECT vohead_id, vohead_misc" " FROM vohead" " WHERE (vohead_number=:vohead_number)"); dspViewDocument.bindValue(":vohead_number", docnumber); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("vohead_id", dspViewDocument.value("vohead_id").toInt()); params.append("mode", "view"); if(dspViewDocument.value("vohead_misc").toBool()) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } else if(doctype == "IN") { dspViewDocument.prepare("SELECT invchead_id" " FROM invchead" " WHERE (invchead_invcnumber=:invchead_invcnumber)"); dspViewDocument.bindValue(":invchead_invcnumber", docnumber); dspViewDocument.exec(); if(!dspViewDocument.first()) return; invoice::viewInvoice(dspViewDocument.value("invchead_id").toInt()); } else if(doctype == "PO") { dspViewDocument.prepare("SELECT pohead_id" " FROM pohead" " WHERE (pohead_number=:pohead_number)"); dspViewDocument.bindValue(":pohead_number", docnumber); dspViewDocument.exec(); if(!dspViewDocument.first()) return; params.append("pohead_id", dspViewDocument.value("pohead_id").toInt()); params.append("mode", "view"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } qt-client-4.1.0/guiclient/displays/dspVoucherRegister.h000066400000000000000000000022131217451700100232230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPVOUCHERREGISTER_H #define DSPVOUCHERREGISTER_H #include "guiclient.h" #include "display.h" #include "ui_dspVoucherRegister.h" class dspVoucherRegister : public display, public Ui::dspVoucherRegister { Q_OBJECT public: dspVoucherRegister(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem*, int); virtual void sViewTrans(); virtual void sViewDocument(); protected slots: virtual void languageChange(); virtual void sShowUsername(bool); }; #endif // DSPVOUCHERREGISTER_H qt-client-4.1.0/guiclient/displays/dspVoucherRegister.ui000066400000000000000000000135641217451700100234240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspVoucherRegister 0 0 592 111 Voucher Register 0 0 5 All Accounts true 5 Selected Account: false Qt::Vertical QSizePolicy::Expanding 20 0 0 Qt::Horizontal QSizePolicy::Expanding 40 20 Show Username 0 0 Qt::Horizontal QSizePolicy::Expanding 0 16 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 11 20 DateCluster QWidget
    datecluster.h
    GLCluster QWidget
    glcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _allAccounts _selectedAccount _account _dates _showUsername _selectedAccount toggled(bool) _account setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/displays/dspWoHistoryByClassCode.cpp000066400000000000000000000077341217451700100244760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspWoHistoryByClassCode.h" #include #include #include #include #include "guiclient.h" #include "workOrder.h" dspWoHistoryByClassCode::dspWoHistoryByClassCode(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspWoHistoryByClassCode", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Work Order History by Class Code")); setListLabel(tr("Work Orders")); setReportName("WOHistoryByClassCode"); setMetaSQLOptions("workOrderHistory", "detail"); connect(_showCost, SIGNAL(toggled(bool)), this, SLOT(sHandleCosts(bool))); _classCode->setType(ParameterGroup::ClassCode); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("W/O #"), _orderColumn, Qt::AlignLeft, true, "wonumber" ); list()->addColumn(tr("Item #"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "wo_status" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "wo_qtyord" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "wo_qtyrcv" ); list()->addColumn(tr("Start Date"), _dateColumn, Qt::AlignRight, true, "wo_startdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignRight, true, "wo_duedate" ); list()->addColumn(tr("Cost"), _costColumn, Qt::AlignRight, true, "wo_postedvalue" ); sHandleCosts(_showCost->isChecked()); } void dspWoHistoryByClassCode::languageChange() { display::languageChange(); retranslateUi(this); } void dspWoHistoryByClassCode::sView() { ParameterList params; params.append("mode", "view"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoHistoryByClassCode::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoHistoryByClassCode::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); } void dspWoHistoryByClassCode::sHandleCosts(bool pShowCosts) { if (pShowCosts) list()->showColumn(9); else list()->hideColumn(9); } bool dspWoHistoryByClassCode::setParams(ParameterList & params) { if(isVisible()) { if (! _dates->startDate().isValid()) { QMessageBox::warning(this, tr("Invalid Start Date"), tr("Enter a valid Start Date.")); _dates->setFocus(); return false; } if (! _dates->endDate().isValid()) { QMessageBox::warning(this, tr("Invalid End Date"), tr("Enter a valid End Date.")); _dates->setFocus(); return false; } } params.append("woHistoryByClassCode"); // metasql only? _classCode->appendValue(params); _warehouse->appendValue(params); _dates->appendValue(params); if (_topLevel->isChecked()) params.append("showOnlyTopLevel"); if(_showCost->isChecked()) params.append("showCosts"); // report only? return true; } qt-client-4.1.0/guiclient/displays/dspWoHistoryByClassCode.h000066400000000000000000000021271217451700100241320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPWOHISTORYBYCLASSCODE_H #define DSPWOHISTORYBYCLASSCODE_H #include "display.h" #include "ui_dspWoHistoryByClassCode.h" class dspWoHistoryByClassCode : public display, public Ui::dspWoHistoryByClassCode { Q_OBJECT public: dspWoHistoryByClassCode(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sView(); virtual void sEdit(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sHandleCosts( bool pShowCosts ); protected slots: virtual void languageChange(); }; #endif // DSPWOHISTORYBYCLASSCODE_H qt-client-4.1.0/guiclient/displays/dspWoHistoryByClassCode.ui000066400000000000000000000111351217451700100243170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspWoHistoryByClassCode 0 0 730 237 Work Order History by Class Code false false Show 12 Only Top Level Work Orders Cost Qt::Horizontal 40 20 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 17 DateCluster QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _classCode _warehouse _topLevel _showCost
    qt-client-4.1.0/guiclient/displays/dspWoHistoryByItem.cpp000066400000000000000000000102011217451700100235130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspWoHistoryByItem.h" #include #include #include #include #include "guiclient.h" #include "workOrder.h" dspWoHistoryByItem::dspWoHistoryByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspWoHistoryByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Work Order History by Item")); setListLabel(tr("Work Orders")); setReportName("WOHistoryByItem"); setMetaSQLOptions("workOrderHistory", "detail"); connect(_showCost, SIGNAL(toggled(bool)), this, SLOT(sHandleCosts(bool))); _item->setType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cGeneralPurchased); _item->setDefaultType(ItemLineEdit::cGeneralManufactured); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); list()->addColumn(tr("W/O #"), -1, Qt::AlignLeft, true, "wonumber" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "wo_status" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "wo_qtyord" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "wo_qtyrcv" ); list()->addColumn(tr("Start Date"), _dateColumn, Qt::AlignCenter, true, "wo_startdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "wo_duedate" ); list()->addColumn(tr("Cost"), _costColumn, Qt::AlignRight, true, "wo_postedvalue" ); sHandleCosts(_showCost->isChecked()); connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList())); } void dspWoHistoryByItem::languageChange() { display::languageChange(); retranslateUi(this); } void dspWoHistoryByItem::sView() { ParameterList params; params.append("mode", "view"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoHistoryByItem::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoHistoryByItem::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); } void dspWoHistoryByItem::sHandleCosts(bool pShowCosts) { if (pShowCosts) list()->showColumn(7); else list()->hideColumn(7); if (_item->isValid()) sFillList(); } bool dspWoHistoryByItem::setParams(ParameterList & params) { if(isVisible()) { if (! _item->isValid()) { QMessageBox::warning(this, tr("Invalid Item"), tr("Enter a valid Item.")); _item->setFocus(); return false; } if (! _dates->startDate().isValid()) { QMessageBox::warning(this, tr("Invalid Start Date"), tr("Enter a valid Start Date.")); _dates->setFocus(); return false; } if (! _dates->endDate().isValid()) { QMessageBox::warning(this, tr("Invalid End Date"), tr("Enter a valid End Date.")); _dates->setFocus(); return false; } } params.append("woHistoryByItem"); // metasql only? params.append("item_id", _item->id()); _dates->appendValue(params); _warehouse->appendValue(params); if (_showOnlyTopLevel->isChecked()) params.append("showOnlyTopLevel"); if(_showCost->isChecked()) params.append("showCosts"); // report only? return true; } qt-client-4.1.0/guiclient/displays/dspWoHistoryByItem.h000066400000000000000000000020641217451700100231700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPWOHISTORYBYITEM_H #define DSPWOHISTORYBYITEM_H #include "display.h" #include "ui_dspWoHistoryByItem.h" class dspWoHistoryByItem : public display, public Ui::dspWoHistoryByItem { Q_OBJECT public: dspWoHistoryByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sView(); virtual void sEdit(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sHandleCosts( bool pShowCosts ); protected slots: virtual void languageChange(); }; #endif // DSPWOHISTORYBYITEM_H qt-client-4.1.0/guiclient/displays/dspWoHistoryByItem.ui000066400000000000000000000107161217451700100233610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspWoHistoryByItem 0 0 526 196 Work Order History by Item Qt::Horizontal QSizePolicy::Expanding 0 17 false Show Work Order Cost Only Show Top Level Work Orders Qt::Horizontal QSizePolicy::Expanding 0 17 Qt::Vertical 20 27 DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _item _warehouse _showOnlyTopLevel _showCost
    qt-client-4.1.0/guiclient/displays/dspWoHistoryByNumber.cpp000066400000000000000000000112131217451700100240510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspWoHistoryByNumber.h" #include #include #include #include #include "workOrder.h" dspWoHistoryByNumber::dspWoHistoryByNumber(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspWoHistoryByNumber", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Work Order History by W/O Number")); setListLabel(tr("Work Orders")); setReportName("WOHistoryByNumber"); setMetaSQLOptions("workOrderHistory", "detail"); connect(_showCost, SIGNAL(toggled(bool)), this, SLOT(sHandleCosts(bool))); list()->addColumn(tr("W/O #"), _orderColumn, Qt::AlignLeft, true, "wo_number" ); list()->addColumn(tr("Sub. #"), _uomColumn, Qt::AlignLeft, true, "wo_subnumber" ); list()->addColumn(tr("Item #"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "wo_status" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "wo_qtyord" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "wo_qtyrcv" ); list()->addColumn(tr("Start Date"), _dateColumn, Qt::AlignCenter, true, "wo_startdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "wo_duedate" ); list()->addColumn(tr("Cost"), _costColumn, Qt::AlignRight, true, "wo_postedvalue" ); list()->addColumn(tr("WIP"), _costColumn, Qt::AlignRight, false, "wo_wipvalue" ); list()->addColumn(tr("Project"), _orderColumn, Qt::AlignLeft, false, "project" ); list()->addColumn(tr("Priority"), _statusColumn, Qt::AlignCenter, false, "wo_priority" ); list()->addColumn(tr("BOM Rev"), _orderColumn, Qt::AlignLeft, false, "bom_rev_number" ); list()->addColumn(tr("BOO Rev"), _orderColumn, Qt::AlignLeft, false, "boo_rev_number" ); sHandleCosts(_showCost->isChecked()); connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), SLOT(sFillList())); } void dspWoHistoryByNumber::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspWoHistoryByNumber::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("wo_number", &valid); if (valid) { _woNumber->setText(param.toString()); sFillList(); } return NoError; } void dspWoHistoryByNumber::sView() { ParameterList params; params.append("mode", "view"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoHistoryByNumber::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoHistoryByNumber::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); } void dspWoHistoryByNumber::sHandleCosts(bool pShowCosts) { if (pShowCosts) list()->showColumn(list()->column("wo_postedvalue")); else list()->hideColumn(list()->column("wo_postedvalue")); } bool dspWoHistoryByNumber::setParams(ParameterList ¶ms) { if(_woNumber->text().isEmpty()) { QMessageBox::warning( this, tr("Invalid Work Order Number"), tr( "You must enter a work order number for this report." ) ); _woNumber->setFocus(); return false; } params.append("wo_number", _woNumber->text()); // metasql only? params.append("woNumber", _woNumber->text()); // report only? if (_metrics->boolean("RevControl")) params.append("revControl"); // metasql only? if (_showOnlyTopLevel->isChecked()) params.append("showOnlyTopLevel"); if(_showCost->isChecked()) params.append("showCosts"); // report only? return true; } qt-client-4.1.0/guiclient/displays/dspWoHistoryByNumber.h000066400000000000000000000022261217451700100235220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPWOHISTORYBYNUMBER_H #define DSPWOHISTORYBYNUMBER_H #include "guiclient.h" #include "display.h" #include "ui_dspWoHistoryByNumber.h" class dspWoHistoryByNumber : public display, public Ui::dspWoHistoryByNumber { Q_OBJECT public: dspWoHistoryByNumber(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sView(); virtual void sEdit(); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sHandleCosts( bool pShowCosts ); protected slots: virtual void languageChange(); }; #endif // DSPWOHISTORYBYNUMBER_H qt-client-4.1.0/guiclient/displays/dspWoHistoryByNumber.ui000066400000000000000000000104221217451700100237050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspWoHistoryByNumber 0 0 522 70 Work Order History by W/O Number 6 0 6 0 &Work Order Pattern: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _woNumber 0 0 100 32767 Qt::Vertical QSizePolicy::Expanding 20 0 Only Show Top Level Work Orders Show W/O Cost Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 18 20 XCheckBox QCheckBox
    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    _woNumber _showOnlyTopLevel _showCost
    qt-client-4.1.0/guiclient/displays/dspWoMaterialsByItem.cpp000066400000000000000000000063261217451700100240100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspWoMaterialsByItem.h" #include #include #include "guiclient.h" #include "inputManager.h" dspWoMaterialsByItem::dspWoMaterialsByItem(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspWoMaterialsByItem", fl) { setupUi(optionsWidget()); setWindowTitle(tr("W/O Material Requirements by Component Item")); setListLabel(tr("Material Requirements")); setReportName("WOMaterialRequirementsByComponentItem"); setMetaSQLOptions("workOrderMaterial", "detail"); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); _manufacturing = false; if (_metrics->value("Application") == "Standard") { XSqlQuery xtmfg; xtmfg.exec("SELECT pkghead_name FROM pkghead WHERE pkghead_name='xtmfg'"); if (xtmfg.first()) _manufacturing = true; } list()->addColumn(tr("W/O #"), _orderColumn, Qt::AlignLeft, true, "wonumber" ); list()->addColumn(tr("Parent Item #"), _itemColumn, Qt::AlignLeft, true, "item_number" ); if (_manufacturing) list()->addColumn(tr("Oper. #"), _dateColumn, Qt::AlignCenter, true, "wooperseq" ); list()->addColumn(tr("Iss. Meth."), _dateColumn, Qt::AlignCenter, true, "issuemethod" ); list()->addColumn(tr("Iss. UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name" ); list()->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "womatl_qtyfxd" ); list()->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyper" ); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "womatl_scrap" ); list()->addColumn(tr("Required"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyreq" ); list()->addColumn(tr("Issued"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyiss" ); list()->addColumn(tr("Scrapped"), _qtyColumn, Qt::AlignRight, true, "womatl_qtywipscrap" ); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "womatl_duedate" ); } void dspWoMaterialsByItem::languageChange() { display::languageChange(); retranslateUi(this); } bool dspWoMaterialsByItem::setParams(ParameterList & params) { if(!_item->isValid()) { QMessageBox::warning(this, tr("Item Required"), tr("You must specify an Item Number.")); return false; } params.append("item_id", _item->id()); _warehouse->appendValue(params); params.append("push", tr("Push")); params.append("pull", tr("Pull")); params.append("mixed", tr("Mixed")); params.append("error", tr("Error")); if (_manufacturing) params.append("Manufacturing"); return true; } qt-client-4.1.0/guiclient/displays/dspWoMaterialsByItem.h000066400000000000000000000016501217451700100234500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPWOMATERIALSBYITEM_H #define DSPWOMATERIALSBYITEM_H #include "display.h" #include "ui_dspWoMaterialsByItem.h" class dspWoMaterialsByItem : public display, public Ui::dspWoMaterialsByItem { Q_OBJECT public: dspWoMaterialsByItem(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); protected slots: virtual void languageChange(); private: bool _manufacturing; }; #endif // DSPWOMATERIALSBYITEM_H qt-client-4.1.0/guiclient/displays/dspWoMaterialsByItem.ui000066400000000000000000000063371217451700100236450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspWoMaterialsByItem 0 0 532 110 W/O Material Requirements by Component Item 0 Qt::Vertical 20 0 0 false Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 12 20 ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    _item _warehouse
    qt-client-4.1.0/guiclient/displays/dspWoMaterialsByWorkOrder.cpp000066400000000000000000000076021217451700100250260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspWoMaterialsByWorkOrder.h" #include #include #include #include #include "inputManager.h" #include "woMaterialItem.h" dspWoMaterialsByWorkOrder::dspWoMaterialsByWorkOrder(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspWoMaterialsByWorkOrder", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Work Order Material Requirements By Work Order")); setListLabel(tr("Material Requirements")); setReportName("WOMaterialRequirementsByWorkOrder"); setMetaSQLOptions("workOrderMaterial", "detail"); _wo->setType(cWoExploded | cWoIssued | cWoReleased); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _manufacturing = false; if (_metrics->value("Application") == "Standard") { XSqlQuery xtmfg; xtmfg.exec("SELECT pkghead_name FROM pkghead WHERE pkghead_name='xtmfg'"); if (xtmfg.first()) _manufacturing = true; } list()->addColumn(tr("Component Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); if (_manufacturing) list()->addColumn(tr("Oper. #"), _dateColumn, Qt::AlignCenter, true, "wooperseq" ); list()->addColumn(tr("Iss. Meth.") , _orderColumn, Qt::AlignCenter, true, "issuemethod" ); list()->addColumn(tr("Iss. UOM") , _uomColumn, Qt::AlignLeft, true, "uom_name" ); list()->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "womatl_qtyfxd" ); list()->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyper" ); list()->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "womatl_scrap" ); list()->addColumn(tr("Required"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyreq" ); list()->addColumn(tr("Issued"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyiss" ); list()->addColumn(tr("Scrapped"), _qtyColumn, Qt::AlignRight, true, "womatl_qtywipscrap" ); list()->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "womatl_duedate" ); } void dspWoMaterialsByWorkOrder::languageChange() { display::languageChange(); retranslateUi(this); } enum SetResponse dspWoMaterialsByWorkOrder::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) _wo->setId(param.toInt()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspWoMaterialsByWorkOrder::setParams(ParameterList & params) { if(!_wo->isValid()) { QMessageBox::warning(this, tr("Work Order Required"), tr("You must specify a Work Order Number.")); return false; } params.append("wo_id", _wo->id()); params.append("push", tr("Push")); params.append("pull", tr("Pull")); params.append("mixed", tr("Mixed")); params.append("error", tr("Error")); if (_manufacturing) params.append("Manufacturing"); return true; } void dspWoMaterialsByWorkOrder::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("View Requirement..."), this, SLOT(sView())); } void dspWoMaterialsByWorkOrder::sView() { ParameterList params; params.append("mode", "view"); params.append("womatl_id", list()->id()); woMaterialItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/displays/dspWoMaterialsByWorkOrder.h000066400000000000000000000022251217451700100244670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPWOMATERIALSBYWORKORDER_H #define DSPWOMATERIALSBYWORKORDER_H #include "guiclient.h" #include "display.h" #include "ui_dspWoMaterialsByWorkOrder.h" class dspWoMaterialsByWorkOrder : public display, public Ui::dspWoMaterialsByWorkOrder { Q_OBJECT public: dspWoMaterialsByWorkOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList&); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int); virtual void sView(); protected slots: virtual void languageChange(); private: bool _manufacturing; }; #endif // DSPWOMATERIALSBYWORKORDER_H qt-client-4.1.0/guiclient/displays/dspWoMaterialsByWorkOrder.ui000066400000000000000000000046111217451700100246560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspWoMaterialsByWorkOrder 0 0 316 150 Work Order Material Requirements By Work Order 0 0 0 290 130 Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 6 20 WoCluster QWidget
    wocluster.h
    qt-client-4.1.0/guiclient/displays/dspWoSchedule.cpp000066400000000000000000000431341217451700100225070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspWoSchedule.h" #include #include #include #include "bom.h" #include "changeWoQty.h" #include "closeWo.h" #include "correctProductionPosting.h" #include "dspInventoryAvailabilityByWorkOrder.h" #include "dspRunningAvailability.h" #include "dspWoMaterialsByWorkOrder.h" #include "explodeWo.h" #include "implodeWo.h" #include "issueWoMaterialItem.h" #include "postProduction.h" #include "printWoTraveler.h" #include "reprioritizeWo.h" #include "rescheduleWo.h" #include "salesOrderInformation.h" #include "storedProcErrorLookup.h" #include "workOrder.h" #include "parameterwidget.h" dspWoSchedule::dspWoSchedule(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspWoSchedule", fl) { setNewVisible(true); setSearchVisible(true); setWindowTitle(tr("Work Order Schedule")); setReportName("WOSchedule"); setMetaSQLOptions("workOrderSchedule", "detail"); setUseAltId(true); setAutoUpdateEnabled(true); setParameterWidgetVisible(true); setQueryOnStartEnabled(true); QString qryStatus = QString( "SELECT 'O', '%1' UNION " "SELECT 'E', '%2' UNION " "SELECT 'R', '%3' UNION " "SELECT 'I', '%4'") .arg(tr("Open")) .arg(tr("Exploded")) .arg(tr("Released")) .arg(tr("In-Process")); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date); parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->append(tr("Class Code Pattern"), "classcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Item Group"), "itemgrp_id", XComboBox::ItemGroups); parameterWidget()->append(tr("Item Group Pattern"), "itemgrp_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Planner Code"), "plancode_id", XComboBox::PlannerCodes); parameterWidget()->append(tr("Planner Code Pattern"), "plancode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Show Only Top Level"), "showOnlyTopLevel", ParameterWidget::Exists); parameterWidget()->append(tr("Status"), "status_list", ParameterWidget::Multiselect, QVariant(), false, qryStatus); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->append(tr("Has Parent Sales Order"), "woSoStatus", ParameterWidget::Exists); parameterWidget()->append(tr("Has Closed Parent Sales Order"), "woSoStatusMismatch", ParameterWidget::Exists); parameterWidget()->applyDefaultFilterSet(); list()->addColumn(tr("parentType"), 0, Qt::AlignCenter, true, "wo_ordtype" ); list()->addColumn(tr("Work Order #"),_orderColumn, Qt::AlignLeft, true, "wonumber" ); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "wo_status" ); list()->addColumn(tr("Pri."), _statusColumn, Qt::AlignCenter, false, "wo_priority" ); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "wo_qtyord" ); list()->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "wo_qtyrcv" ); list()->addColumn(tr("Start Date"), _dateColumn, Qt::AlignRight, true, "wo_startdate" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignRight, true, "wo_duedate" ); list()->addColumn(tr("Condition"), _dateColumn, Qt::AlignLeft, true, "condition" ); if (_privileges->check("MaintainWorkOrders")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillList())); } enum SetResponse dspWoSchedule::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; parameterWidget()->setSavedFilters(); param = pParams.value("plancode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code"), param); param = pParams.value("wrkcnt", &valid); if (valid) parameterWidget()->setDefault(tr("Work Center"), param); param = pParams.value("warehous_id", &valid); if (valid) parameterWidget()->setDefault(tr("Site"), param); param = pParams.value("item_id", &valid); if (valid) parameterWidget()->setDefault(tr("Item"), param); param = pParams.value("startDate", &valid); if (valid) parameterWidget()->setDefault(tr("Start Date"), param); param = pParams.value("endDate", &valid); if (valid) parameterWidget()->setDefault(tr("End Date"), param); param = pParams.value("status", &valid); if (valid) { QVariantList list; list.append(param.toString()); parameterWidget()->setDefault(tr("Status"), list); } parameterWidget()->applyDefaultFilterSet(); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspWoSchedule::sView() { ParameterList params; params.append("mode", "view"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoSchedule::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("wo_id", list()->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoSchedule::sPostProduction() { ParameterList params; params.append("wo_id", list()->id()); postProduction newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sCorrectProductionPosting() { ParameterList params; params.append("wo_id", list()->id()); correctProductionPosting newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sReleaseWO() { XSqlQuery dspReleaseWO; dspReleaseWO.prepare("SELECT releaseWo(:wo_id, false);"); dspReleaseWO.bindValue(":wo_id", list()->id()); dspReleaseWO.exec(); omfgThis->sWorkOrdersUpdated(list()->id(), true); } void dspWoSchedule::sRecallWO() { XSqlQuery dspRecallWO; dspRecallWO.prepare("SELECT recallWo(:wo_id, false);"); dspRecallWO.bindValue(":wo_id", list()->id()); dspRecallWO.exec(); omfgThis->sWorkOrdersUpdated(list()->id(), true); } void dspWoSchedule::sExplodeWO() { ParameterList params; params.append("wo_id", list()->id()); explodeWo newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sImplodeWO() { ParameterList params; params.append("wo_id", list()->id()); implodeWo newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sDeleteWO() { XSqlQuery dspDeleteWO; dspDeleteWO.prepare( "SELECT wo_ordtype, itemsite_costmethod " "FROM wo JOIN itemsite ON (itemsite_id=wo_itemsite_id) " "WHERE (wo_id=:wo_id);" ); dspDeleteWO.bindValue(":wo_id", list()->id()); dspDeleteWO.exec(); if (dspDeleteWO.first()) { QString question; if (dspDeleteWO.value("wo_ordtype") == "W") question = tr("

    The Work Order that you selected to delete is a child " "of another Work Order. If you delete the selected Work " "Order then the Work Order Materials Requirements for the " "Component Item will remain but the Work Order to relieve " "that demand will not. Are you sure that you want to " "delete the selected Work Order?" ); else if (dspDeleteWO.value("wo_ordtype") == "S" && dspDeleteWO.value("itemsite_costmethod") == "J") { QMessageBox::critical(this, tr("Cannot Delete Work Order"), tr("This Work Order is linked to a Sales Order and is a Job Costed Item. The Work Order may not be deleted.")); return; } else if (dspDeleteWO.value("wo_ordtype") == "S") question = tr("

    The Work Order that you selected to delete was created " "to satisfy Sales Order demand. If you delete the selected " "Work Order then the Sales Order demand will remain but " "the Work Order to relieve that demand will not. Are you " "sure that you want to delete the selected Work Order?" ); else question = tr("

    Are you sure that you want to delete the selected " "Work Order?"); if (QMessageBox::question(this, tr("Delete Work Order?"), question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return; } dspDeleteWO.prepare("SELECT deleteWo(:wo_id, true) AS returnVal;"); dspDeleteWO.bindValue(":wo_id", list()->id()); dspDeleteWO.exec(); if (dspDeleteWO.first()) { int result = dspDeleteWO.value("returnVal").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteWo", result)); return; } } else if (dspDeleteWO.lastError().type() != QSqlError::NoError) systemError(this, dspDeleteWO.lastError().databaseText(), __FILE__, __LINE__); omfgThis->sWorkOrdersUpdated(-1, true); } else if (dspDeleteWO.lastError().type() != QSqlError::NoError) { systemError(this, dspDeleteWO.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspWoSchedule::sCloseWO() { ParameterList params; params.append("wo_id", list()->id()); closeWo newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sPrintTraveler() { ParameterList params; params.append("wo_id", list()->id()); printWoTraveler newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sViewWomatl() { ParameterList params; params.append("wo_id", list()->id()); params.append("run"); dspWoMaterialsByWorkOrder *newdlg = new dspWoMaterialsByWorkOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoSchedule::sInventoryAvailabilityByWorkOrder() { ParameterList params; params.append("wo_id", list()->id()); params.append("run"); dspInventoryAvailabilityByWorkOrder *newdlg = new dspInventoryAvailabilityByWorkOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoSchedule::sReprioritizeWo() { ParameterList params; params.append("wo_id", list()->id()); reprioritizeWo newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sRescheduleWO() { ParameterList params; params.append("wo_id", list()->id()); rescheduleWo newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sChangeWOQty() { ParameterList params; params.append("wo_id", list()->id()); changeWoQty newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sViewParentSO() { ParameterList params; params.append("soitem_id", list()->altId()); salesOrderInformation newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void dspWoSchedule::sViewParentWO() { ParameterList params; params.append("mode", "view"); params.append("wo_id", list()->altId()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspWoSchedule::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected, int) { QString status(selected->text(2)); QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); pMenu->addSeparator(); if (status == "E") { menuItem = pMenu->addAction(tr("Release"), this, SLOT(sReleaseWO())); menuItem->setEnabled(_privileges->check("ReleaseWorkOrders")); } else if (status == "R") { menuItem = pMenu->addAction(tr("Recall"), this, SLOT(sRecallWO())); menuItem->setEnabled(_privileges->check("RecallWorkOrders")); } if (status == "O") { menuItem = pMenu->addAction(tr("Explode..."), this, SLOT(sExplodeWO())); menuItem->setEnabled(_privileges->check("ExplodeWorkOrders")); } else if (status == "E") { menuItem = pMenu->addAction(tr("Implode..."), this, SLOT(sImplodeWO())); menuItem->setEnabled(_privileges->check("ImplodeWorkOrders")); } if ((status == "O") || (status == "E")) { menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteWO())); menuItem->setEnabled(_privileges->check("DeleteWorkOrders")); } else { menuItem = pMenu->addAction(tr("Close..."), this, SLOT(sCloseWO())); menuItem->setEnabled(_privileges->check("CloseWorkOrders")); } pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Bill of Materials..."), this, SLOT(sViewBOM())); menuItem->setEnabled(_privileges->check("ViewBOMs")); if ((status == "E") || (status == "R") || (status == "I")) { menuItem = pMenu->addAction(tr("View Material Requirements..."), this, SLOT(sViewWomatl())); menuItem->setEnabled(_privileges->check("ViewWoMaterials")); menuItem = pMenu->addAction(tr("Inventory Availability..."), this, SLOT(sInventoryAvailabilityByWorkOrder())); menuItem->setEnabled(_privileges->check("ViewInventoryAvailability")); menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sDspRunningAvailability())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Print Traveler..."), this, SLOT(sPrintTraveler())); menuItem->setEnabled(_privileges->check("PrintWorkOrderPaperWork")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Issue Material Item..."), this, SLOT(sIssueWoMaterialItem())); menuItem->setEnabled(_privileges->check("IssueWoMaterials")); menuItem = pMenu->addAction(tr("Post Production..."), this, SLOT(sPostProduction())); menuItem->setEnabled(_privileges->check("PostProduction")); if (status != "E") { menuItem = pMenu->addAction(tr("Correct Production Posting..."), this, SLOT(sCorrectProductionPosting())); menuItem->setEnabled(_privileges->check("PostProduction")); } } if ((status == "O") || (status == "E")) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Reprioritize..."), this, SLOT(sReprioritizeWo())); menuItem->setEnabled(_privileges->check("ReprioritizeWorkOrders")); menuItem = pMenu->addAction(tr("Reschedule..."), this, SLOT(sRescheduleWO())); menuItem->setEnabled(_privileges->check("RescheduleWorkOrders")); menuItem = pMenu->addAction(tr("Change Quantity..."), this, SLOT(sChangeWOQty())); menuItem->setEnabled(_privileges->check("ChangeWorkOrderQty")); } if (list()->altId() != -1) { if (selected->text(0) == "S") { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Parent Sales Order Information..."), this, SLOT(sViewParentSO())); } else if (selected->text(0) == "W") { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Parent Work Order..."), this, SLOT(sViewParentWO())); } } } void dspWoSchedule::sIssueWoMaterialItem() { issueWoMaterialItem newdlg(this); ParameterList params; params.append("wo_id", list()->id()); if (newdlg.set(params) == NoError) newdlg.exec(); } void dspWoSchedule::sDspRunningAvailability() { XSqlQuery dspDspRunningAvailability; dspDspRunningAvailability.prepare("SELECT wo_itemsite_id FROM wo WHERE (wo_id=:id);"); dspDspRunningAvailability.bindValue(":id", list()->id()); dspDspRunningAvailability.exec(); if (dspDspRunningAvailability.first()) { ParameterList params; params.append("itemsite_id", dspDspRunningAvailability.value("wo_itemsite_id")); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (dspDspRunningAvailability.lastError().type() != QSqlError::NoError) { systemError(this, dspDspRunningAvailability.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspWoSchedule::sViewBOM() { XSqlQuery dspViewBOM; dspViewBOM.prepare("SELECT itemsite_item_id " "FROM wo, itemsite " "WHERE ((wo_itemsite_id=itemsite_id)" " AND (wo_id=:id));"); dspViewBOM.bindValue(":id", list()->id()); dspViewBOM.exec(); if (dspViewBOM.first()) { ParameterList params; params.append("item_id", dspViewBOM.value("itemsite_item_id")); params.append("mode", "view"); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (dspViewBOM.lastError().type() != QSqlError::NoError) { systemError(this, dspViewBOM.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspWoSchedule::sNew() { ParameterList params; params.append("mode", "new"); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/displays/dspWoSchedule.h000066400000000000000000000031301217451700100221440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPWOSCHEDULE_H #define DSPWOSCHEDULE_H #include "guiclient.h" #include "display.h" class dspWoSchedule : public display { Q_OBJECT public: dspWoSchedule(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sChangeWOQty(); virtual void sCloseWO(); virtual void sCorrectProductionPosting(); virtual void sDeleteWO(); virtual void sDspRunningAvailability(); virtual void sEdit(); virtual void sExplodeWO(); virtual void sImplodeWO(); virtual void sInventoryAvailabilityByWorkOrder(); virtual void sIssueWoMaterialItem(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * selected, int); virtual void sPostProduction(); virtual void sPrintTraveler(); virtual void sRecallWO(); virtual void sReleaseWO(); virtual void sReprioritizeWo(); virtual void sRescheduleWO(); virtual void sView(); virtual void sViewBOM(); virtual void sViewParentSO(); virtual void sViewParentWO(); virtual void sViewWomatl(); virtual void sNew(); }; #endif // DSPWOSCHEDULE_H qt-client-4.1.0/guiclient/distributeInventory.cpp000066400000000000000000000754141217451700100222100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "distributeInventory.h" #include #include #include #include #include #include "mqlutil.h" #include "assignLotSerial.h" #include "distributeToLocation.h" #include "inputManager.h" #define cIncludeLotSerial 0x01 #define cNoIncludeLotSerial 0x02 distributeInventory::distributeInventory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_bcDistribute, SIGNAL(clicked()), this, SLOT(sBcDistribute())); connect(_default, SIGNAL(clicked()), this, SLOT(sDefault())); connect(_defaultAndPost, SIGNAL(clicked()), this, SLOT(sDefaultAndPost())); connect(_distribute, SIGNAL(clicked()), this, SLOT(sSelectLocation())); connect(_itemloc, SIGNAL(itemSelected(int)), this, SLOT(sSelectLocation())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_taggedOnly, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_bc, SIGNAL(textChanged(QString)), this, SLOT(sBcChanged(QString))); connect(_qtyOnly, SIGNAL(toggled(bool)), this, SLOT(sFillList())); omfgThis->inputManager()->notify(cBCLotSerialNumber, this, this, SLOT(sCatchLotSerialNumber(QString))); _item->setReadOnly(TRUE); _qtyToDistribute->setPrecision(omfgThis->qtyVal()); _qtyTagged->setPrecision(omfgThis->qtyVal()); _qtyRemaining->setPrecision(omfgThis->qtyVal()); _itemloc->addColumn(tr("Location"), _itemColumn, Qt::AlignLeft, true, "locationname"); _itemloc->addColumn(tr("Default"), _ynColumn, Qt::AlignLeft, true, "defaultlocation"); _itemloc->addColumn(tr("Netable"), _ynColumn, Qt::AlignCenter,true, "location_netable"); _itemloc->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "lotserial"); _itemloc->addColumn(tr("Expiration"), _dateColumn, Qt::AlignCenter,true, "f_expiration"); _itemloc->addColumn(tr("Qty. Before"), _qtyColumn, Qt::AlignRight, true, "qty"); _itemloc->addColumn(tr("Tagged Qty."), _qtyColumn, Qt::AlignRight, true, "qtytagged"); _itemloc->addColumn(tr("Qty. After"), _qtyColumn, Qt::AlignRight, true, "balance"); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } //If not lot serial control, hide info if (!_metrics->boolean("LotSerialControl")) { _lotSerial->hide(); _lotSerialLit->hide(); _bcLit->hide(); _bc->hide(); _bcQtyLit->hide(); _bcQty->hide(); _bcDistribute->hide(); } _itemlocdistid = -1; _transtype = "O"; _locationDefaultLit->hide(); _locations->hide(); } distributeInventory::~distributeInventory() { // no need to delete child widgets, Qt does it all for us } void distributeInventory::languageChange() { retranslateUi(this); } int distributeInventory::SeriesAdjust(int pItemlocSeries, QWidget *pParent, const QString & pPresetLotnum, const QDate & pPresetLotexp, const QDate & pPresetLotwarr) { int result; QList ildsList; // Item Loc Dist Series QList ildList; // Item Loc Dist List if (pItemlocSeries != 0) { XSqlQuery itemloc; itemloc.prepare( "SELECT itemlocdist_id, itemlocdist_reqlotserial," " itemlocdist_distlotserial, itemlocdist_qty," " itemsite_loccntrl, itemsite_controlmethod," " itemsite_perishable, itemsite_warrpurc," " COALESCE(itemsite_lsseq_id,-1) AS itemsite_lsseq_id," " COALESCE(itemlocdist_source_id,-1) AS itemlocdist_source_id," " CASE WHEN (invhist_transtype IN ('RM','RP','RR','RX')) THEN 'R'" " WHEN (invhist_transtype = 'IM') THEN 'I'" " ELSE 'O'" " END AS trans_type," " CASE WHEN (invhist_transtype IN ('RM','RP','RR','RX')" " AND itemsite_recvlocation_dist) THEN TRUE" " WHEN (invhist_transtype = 'IM'" " AND itemsite_issuelocation_dist) THEN TRUE" " WHEN (invhist_transtype NOT IN ('RM','RP','RR','RX','IM')" " AND itemsite_location_dist) THEN TRUE" " ELSE FALSE" " END AS auto_dist " "FROM itemlocdist JOIN itemsite ON (itemlocdist_itemsite_id=itemsite_id) " " LEFT OUTER JOIN invhist ON (itemlocdist_invhist_id=invhist_id) " "WHERE (itemlocdist_series=:itemlocdist_series) " "ORDER BY itemlocdist_id;" ); itemloc.bindValue(":itemlocdist_series", pItemlocSeries); itemloc.exec(); while (itemloc.next()) { if (itemloc.value("itemlocdist_reqlotserial").toBool()) { int itemlocSeries = -1; XSqlQuery query; // Check to see if this is a lot controlled item and if we have // a predefined lot#/expdate to use. If so assign that information // with itemlocdist_qty and move on. otherwise do the normal dialog // to ask the user for that information. if(itemloc.value("itemsite_controlmethod").toString() == "L" && !pPresetLotnum.isEmpty()) { query.exec("SELECT nextval('itemloc_series_seq') AS _itemloc_series;"); if(query.first()) { itemlocSeries = query.value("_itemloc_series").toInt(); query.prepare( "SELECT createlotserial(itemlocdist_itemsite_id,:lotserial,:itemlocdist_series,'I',NULL,itemlocdist_id,:qty,:expiration,:warranty) " "FROM itemlocdist " "WHERE (itemlocdist_id=:itemlocdist_id);" "UPDATE itemlocdist " "SET itemlocdist_source_type='O' " "WHERE (itemlocdist_series=:itemlocdist_series);" "DELETE FROM itemlocdist " "WHERE (itemlocdist_id=:itemlocdist_id);" ); query.bindValue(":lotserial", pPresetLotnum); query.bindValue(":qty", itemloc.value("itemlocdist_qty")); query.bindValue(":itemlocdist_series", itemlocSeries); query.bindValue(":itemlocdist_id", itemloc.value("itemlocdist_id")); if(itemloc.value("itemsite_perishable").toBool()) query.bindValue(":expiration", pPresetLotexp); else query.bindValue(":expiration", omfgThis->endOfTime()); if(itemloc.value("itemsite_warrpurc").toBool()) query.bindValue(":warranty", pPresetLotwarr); query.exec(); } } if(itemlocSeries == -1) { // Check to see if Lot/Serial distributions should be created using // "from" side of transaction. Transactions are related by itemlocdist_source_id. // InterWarehouseTransfer uses this technique. if (itemloc.value("itemlocdist_source_id").toInt() > -1) { XSqlQuery fromlots; fromlots.exec("SELECT nextval('itemloc_series_seq') AS _itemloc_series;"); if(fromlots.first()) { itemlocSeries = fromlots.value("_itemloc_series").toInt(); fromlots.prepare("SELECT createlotserial(s.itemlocdist_itemsite_id, ls_number, " " :itemlocdist_series, 'I', NULL, :itemlocdist_id, (d.itemlocdist_qty * -1.0), " " itemloc_expiration, itemloc_warrpurc) " "FROM itemlocdist s JOIN itemlocdist o ON (o.itemlocdist_id=s.itemlocdist_source_id) " " JOIN itemlocdist d ON (d.itemlocdist_itemlocdist_id=o.itemlocdist_id) " " JOIN itemloc ON (itemloc_id=d.itemlocdist_source_id) " " JOIN ls ON (ls_id=itemloc_ls_id) " "WHERE (s.itemlocdist_id=:itemlocdist_id);" "UPDATE itemlocdist " "SET itemlocdist_source_type='O' " "WHERE (itemlocdist_series=:itemlocdist_series);" "DELETE FROM itemlocdist " "WHERE (itemlocdist_id=:itemlocdist_id);" ); fromlots.bindValue(":itemlocdist_series", itemlocSeries); fromlots.bindValue(":itemlocdist_id", itemloc.value("itemlocdist_id")); fromlots.exec(); if (fromlots.lastError().type() != QSqlError::NoError) { systemError(0, fromlots.lastError().databaseText(), __FILE__, __LINE__); return XDialog::Rejected; } } } } if(itemlocSeries == -1) { ParameterList params; params.append("itemlocdist_id", itemloc.value("itemlocdist_id").toInt()); // Auto assign lot/serial if applicable if (itemloc.value("itemsite_lsseq_id").toInt() != -1 && !itemloc.value("itemsite_perishable").toBool() && !itemloc.value("itemsite_warrpurc").toBool()) { XSqlQuery autocreatels; autocreatels.prepare("SELECT autocreatels(:itemlocdist_id) AS itemlocseries;"); autocreatels.bindValue(":itemlocdist_id", itemloc.value("itemlocdist_id").toInt()); autocreatels.exec(); if (autocreatels.first()) params.append("itemlocseries", autocreatels.value("itemlocseries").toInt()); else if (autocreatels.lastError().type() != QSqlError::NoError) { systemError(0, autocreatels.lastError().databaseText(), __FILE__, __LINE__); return XDialog::Rejected; } } assignLotSerial newdlg(pParent, "", TRUE); newdlg.set(params); itemlocSeries = newdlg.exec(); if (itemlocSeries == XDialog::Rejected) return XDialog::Rejected; } if (itemloc.value("itemsite_loccntrl").toBool()) { query.prepare( "SELECT itemlocdist_id " "FROM itemlocdist " "WHERE (itemlocdist_series=:itemlocdist_series) " "ORDER BY itemlocdist_id;" ); query.bindValue(":itemlocdist_series", itemlocSeries); query.exec(); while (query.next()) { ParameterList params; params.append("itemlocdist_id", query.value("itemlocdist_id").toInt()); params.append("trans_type", itemloc.value("trans_type").toString()); distributeInventory newdlg(pParent, "", TRUE); newdlg.set(params); if (itemloc.value("auto_dist").toBool()) { if (newdlg.sDefaultAndPost()) ildList.append(query.value("itemlocdist_id").toInt()); else { result = newdlg.exec(); if (result == XDialog::Rejected) return XDialog::Rejected; else ildList.append(result); } } else { result = newdlg.exec(); if (result == XDialog::Rejected) return XDialog::Rejected; else ildList.append(result); } } } else { query.prepare( "UPDATE itemlocdist " "SET itemlocdist_source_type='L', itemlocdist_source_id=-1 " "WHERE (itemlocdist_series=:itemlocdist_series); "); query.bindValue(":itemlocdist_series", itemlocSeries); query.exec(); // Append id to list and process at the end ildsList.append(itemlocSeries); } } else { ParameterList params; params.append("itemlocdist_id", itemloc.value("itemlocdist_id").toInt()); params.append("trans_type", itemloc.value("trans_type").toString()); if (itemloc.value("itemlocdist_distlotserial").toBool()) params.append("includeLotSerialDetail"); distributeInventory newdlg(pParent, "", TRUE); newdlg.set(params); if (itemloc.value("auto_dist").toBool()) { if (newdlg.sDefaultAndPost()) ildList.append(itemloc.value("itemlocdist_id").toInt()); else { result = newdlg.exec(); if (result == XDialog::Rejected) return XDialog::Rejected; else ildList.append(result); } } else { result = newdlg.exec(); if (result == XDialog::Rejected) return XDialog::Rejected; else ildList.append(result); } } } XSqlQuery post; // Process Lot/Serial distributions for (int i = 0; i < ildsList.size(); ++i) { post.prepare( "SELECT distributeItemlocSeries(:itemlocdist_series) AS result;"); post.bindValue(":itemlocdist_series", ildsList.at(i)); post.exec(); if (post.lastError().type() != QSqlError::NoError) { systemError(0, post.lastError().databaseText(), __FILE__, __LINE__); return XDialog::Rejected; } } // Process location distributions for (int i = 0; i < ildList.size(); ++i) { post.prepare("SELECT distributeToLocations(:itemlocdist_id) AS result;"); post.bindValue(":itemlocdist_id", ildList.at(i)); post.exec(); if (post.lastError().type() != QSqlError::NoError) { systemError(0, post.lastError().databaseText(), __FILE__, __LINE__); return XDialog::Rejected; } } //Post inventory history for any remaining non-distributed transactions and trial balance post.prepare("SELECT postItemlocseries(:itemlocseries) AS result;"); post.bindValue(":itemlocseries", pItemlocSeries); post.exec(); if (post.first()) { if (!post.value("result").toBool()) QMessageBox::warning( 0, tr("Inventory Distribution"), tr("There was an error posting the transaction. Contact your administrator") ); } else if (post.lastError().type() != QSqlError::NoError) { systemError(0, post.lastError().databaseText(), __FILE__, __LINE__); return XDialog::Rejected; } } return XDialog::Accepted; } enum SetResponse distributeInventory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("includeLotSerialDetail", &valid); if (valid && _metrics->boolean("LotSerialControl")) { _mode = cIncludeLotSerial; } else _mode = cNoIncludeLotSerial; param = pParams.value("trans_type", &valid); if (valid) { _transtype = param.toString(); populate(); } param = pParams.value("itemlocdist_id", &valid); if (valid) { _itemlocdistid = param.toInt(); populate(); } return NoError; } void distributeInventory::closeEvent(QCloseEvent *pEvent) { pEvent->accept(); } void distributeInventory::populate() { XSqlQuery distributepopulate; distributepopulate.prepare("SELECT itemsite_controlmethod " "FROM itemsite, itemlocdist " "WHERE ((itemlocdist_itemsite_id=itemsite_id)" " AND (itemlocdist_id=:itemlocdist_id));"); distributepopulate.bindValue(":itemlocdist_id", _itemlocdistid); distributepopulate.exec(); if (distributepopulate.first()) { _controlMethod = distributepopulate.value("itemsite_controlmethod").toString(); _bc->setEnabled(_controlMethod == "L" || _controlMethod == "S"); _bcQty->setEnabled(_controlMethod == "L"); _bcDistribute->setEnabled(_controlMethod == "L" || _controlMethod == "S"); if (_controlMethod == "S") _bcQty->setText("1"); else _bcQty->clear(); } else if (distributepopulate.lastError().type() != QSqlError::NoError) { systemError(this, distributepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } // Auto distribute location reservations if ( (_metrics->boolean("EnableSOReservationsByLocation")) && (_mode == cIncludeLotSerial) ) { distributepopulate.prepare("SELECT distributeToReservedItemLoc(:itemlocdist_id) AS result;"); distributepopulate.bindValue(":itemlocdist_id", _itemlocdistid); distributepopulate.exec(); } sFillList(); if (_metrics->boolean("SetDefaultLocations")) sPopulateDefaultSelector(); } void distributeInventory::sSelectLocation() { ParameterList params; params.append("source_itemlocdist_id", _itemlocdistid); if (_itemloc->altId() == cLocation) params.append("location_id", _itemloc->id()); else if (_itemloc->altId() == cItemloc) params.append("itemlocdist_id", _itemloc->id()); distributeToLocation newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } void distributeInventory::sPost() { if (_qtyRemaining->toDouble() != 0.0) { QMessageBox::critical( this, tr("Cannot Perform Partial Distribution"), tr( "

    You must completely distribute the quantity " "before selecting the 'Post' button." ) ); return; } // Append id to the list and process at the end done(_itemlocdistid); } bool distributeInventory::sDefault() { XSqlQuery distributeDefault; bool distribOk = true; double qty = 0.0; double availToDistribute = 0.0; int defaultlocid = 0; distributeDefault.prepare("SELECT itemsite_location_id, itemsite_recvlocation_id, itemsite_issuelocation_id " " FROM itemlocdist, itemsite " " WHERE ( (itemlocdist_itemsite_id=itemsite_id)" " AND (itemlocdist_id=:itemlocdist_id) ) "); distributeDefault.bindValue(":itemlocdist_id", _itemlocdistid); distributeDefault.exec(); if (distributeDefault.first()) { if (_transtype == "R") defaultlocid = distributeDefault.value("itemsite_recvlocation_id").toInt(); else if (_transtype == "I") defaultlocid = distributeDefault.value("itemsite_issuelocation_id").toInt(); else defaultlocid = distributeDefault.value("itemsite_location_id").toInt(); } distributeDefault.prepare("SELECT itemlocdist_qty AS qty, " " qtyLocation(location_id, NULL, NULL, NULL, itemsite_id, itemlocdist_order_type, itemlocdist_order_id, itemlocdist_id) AS availToDistribute " " FROM itemlocdist, location, itemsite " " WHERE ( (itemlocdist_itemsite_id=itemsite_id)" " AND (itemsite_loccntrl)" " AND (itemsite_warehous_id=location_warehous_id)" " AND (location_id=:defaultlocid) " " AND (itemlocdist_id=:itemlocdist_id) ) "); distributeDefault.bindValue(":itemlocdist_id", _itemlocdistid); distributeDefault.bindValue(":defaultlocid", defaultlocid); distributeDefault.exec(); if (distributeDefault.first()) { qty = distributeDefault.value("qty").toDouble(); availToDistribute = distributeDefault.value("availToDistribute").toDouble(); } if(qty < 0 && availToDistribute < qAbs(qty)) { if (QMessageBox::question(this, tr("Distribute to Default"), tr("It appears you are trying to distribute more " "than is available to be distributed. " "

    Are you sure you want to distribute this quantity?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) distribOk = true; else distribOk = false; } if(distribOk) { if(_mode == cIncludeLotSerial) distributeDefault.prepare("SELECT distributeToDefaultItemLoc(:itemlocdist_id, :transtype) AS result;"); else distributeDefault.prepare("SELECT distributeToDefault(:itemlocdist_id, :transtype) AS result;"); distributeDefault.bindValue(":itemlocdist_id", _itemlocdistid); distributeDefault.bindValue(":transtype", _transtype); distributeDefault.exec(); if (distributeDefault.first()) { int result = distributeDefault.value("result").toInt(); if (result < 0) { QMessageBox::warning( 0, tr("Inventory Distribution"), tr("There was an error distributing to default location.")); return false; } } else if (distributeDefault.lastError().type() != QSqlError::NoError) { systemError(this, distributeDefault.lastError().databaseText(), __FILE__, __LINE__); return false; } sFillList(); //prevent default from been changed after default distribute //stopping the operator from thinking the inventory has been posted //to the new default _locations->setEnabled(false); return true; } else return false; } bool distributeInventory::sDefaultAndPost() { if(sDefault()) { sPost(); return true; } else return false; } void distributeInventory::sFillList() { XSqlQuery distributeFillList; distributeFillList.prepare( "SELECT itemsite_id, " " COALESCE(itemsite_location_id,-1) AS itemsite_location_id," " formatlotserialnumber(itemlocdist_ls_id) AS lotserial," " (itemlocdist_order_type || ' ' || formatSoItemNumber(itemlocdist_order_id)) AS order," " (itemsite_controlmethod IN ('L', 'S')) AS lscontrol," " parent.itemlocdist_qty AS qtytodistribute," " ( ( SELECT COALESCE(SUM(child.itemlocdist_qty), 0)" " FROM itemlocdist AS child" " WHERE (child.itemlocdist_itemlocdist_id=parent.itemlocdist_id) ) ) AS qtytagged," " (parent.itemlocdist_qty - ( SELECT COALESCE(SUM(child.itemlocdist_qty), 0)" " FROM itemlocdist AS child" " WHERE (child.itemlocdist_itemlocdist_id=parent.itemlocdist_id) ) ) AS qtybalance " "FROM itemsite, itemlocdist AS parent " "WHERE ( (itemlocdist_itemsite_id=itemsite_id)" " AND (itemlocdist_id=:itemlocdist_id) );" ); distributeFillList.bindValue(":itemlocdist_id", _itemlocdistid); distributeFillList.exec(); if (distributeFillList.first()) { _item->setItemsiteid(distributeFillList.value("itemsite_id").toInt()); _lotSerial->setText(distributeFillList.value("lotserial").toString()); _order->setText(distributeFillList.value("order").toString()); _qtyToDistribute->setDouble(distributeFillList.value("qtytodistribute").toDouble()); _qtyTagged->setDouble(distributeFillList.value("qtytagged").toDouble()); _qtyRemaining->setDouble(distributeFillList.value("qtybalance").toDouble()); if ( (distributeFillList.value("itemsite_location_id").toInt() != -1) && ( (_mode == cNoIncludeLotSerial) || ( (_mode == cIncludeLotSerial) && (!distributeFillList.value("lscontrol").toBool()) ) ) ) { _default->setEnabled(TRUE); _defaultAndPost->setEnabled(TRUE); } else { _default->setEnabled(FALSE); _defaultAndPost->setEnabled(FALSE); } ParameterList params; if (_mode == cNoIncludeLotSerial) params.append("cNoIncludeLotSerial"); else if (_mode == cIncludeLotSerial) params.append("cIncludeLotSerial"); if (_taggedOnly->isChecked()) params.append("showOnlyTagged"); if (_qtyOnly->isChecked()) params.append("showQtyOnly"); params.append("locationType", cLocation); params.append("itemlocType", cItemloc); params.append("yes", tr("Yes")); params.append("no", tr("No")); params.append("na", tr("N/A")); params.append("undefined", tr("Undefined")); params.append("itemlocdist_id", _itemlocdistid); params.append("itemsite_id", distributeFillList.value("itemsite_id").toInt()); params.append("transtype", _transtype); MetaSQLQuery mql = mqlLoad("distributeInventory", "locations"); distributeFillList = mql.toQuery(params); _itemloc->populate(distributeFillList, true); if (distributeFillList.lastError().type() != QSqlError::NoError) { systemError(this, distributeFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (distributeFillList.lastError().type() != QSqlError::NoError) { systemError(this, distributeFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void distributeInventory::sBcDistribute() { XSqlQuery distributeBcDistribute; if (_bc->text().isEmpty()) { QMessageBox::warning(this, tr("No Bar Code scanned"), tr("

    Cannot search for Items by Bar Code without a " "Bar Code.")); _bc->setFocus(); return; } distributeBcDistribute.prepare( "SELECT itemloc_id " "FROM itemlocdist, itemloc, itemsite, ls " "WHERE ((itemlocdist_itemsite_id=itemloc_itemsite_id)" " AND (itemloc_itemsite_id=itemsite_id)" " AND (itemsite_controlmethod IN ('L', 'S'))" " AND (itemsite_item_id=ls_item_id)" " AND (itemloc_ls_id=ls_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (ls_number=:lotserial)" " AND (itemlocdist_id=:itemlocdist_id));"); distributeBcDistribute.bindValue(":itemlocdist_id", _itemlocdistid); distributeBcDistribute.bindValue(":lotserial", _bc->text()); distributeBcDistribute.bindValue(":warehous_id", _warehouse->id()); distributeBcDistribute.exec(); if(!distributeBcDistribute.first()) { if (distributeBcDistribute.lastError().type() != QSqlError::NoError) { systemError(this, distributeBcDistribute.lastError().databaseText(), __FILE__, __LINE__); return; } QMessageBox::warning(this, tr("No Match Found"), tr("

    No available lines match the specified Barcode.")); _bc->clear(); return; } ParameterList params; params.append("itemlocdist_id", distributeBcDistribute.value("itemloc_id")); params.append("source_itemlocdist_id", _itemlocdistid); params.append("qty", _bcQty->text()); params.append("distribute"); distributeToLocation newdlg(this, "", TRUE); if (newdlg.set(params) != NoError) return; _bc->clear(); if (_controlMethod == "S") _bcQty->setText("1"); else _bcQty->clear(); sFillList(); _bc->setFocus(); } void distributeInventory::sCatchLotSerialNumber(const QString plotserial) { _bc->setText(plotserial); if (_controlMethod == "S") _bcDistribute->setFocus(); else _bcQty->setFocus(); } void distributeInventory::sBcChanged(const QString p) { _post->setDefault(p.isEmpty()); _bcDistribute->setDefault(! p.isEmpty()); } void distributeInventory::sPopulateDefaultSelector() { XSqlQuery query; query.prepare(" SELECT itemsite_id, itemsite_loccntrl, itemsite_location_id" " FROM itemsite, itemlocdist" " WHERE (itemsite_id=itemlocdist_itemsite_id)" " AND (itemlocdist_id=:itemlocdist_id)"); query.bindValue(":itemlocdist_id", _itemlocdistid); query.exec(); if(query.first()) { _itemsite_id = query.value("itemsite_id").toInt(); if(_itemsite_id > -1 && query.value("itemsite_loccntrl").toBool() && query.value("itemsite_location_id").toInt() != -1) { _locationDefaultLit->show(); _locations->show(); XSqlQuery loclist; loclist.prepare( " SELECT location_id, formatLocationName(location_id) AS locationname " " FROM location " " WHERE ( (location_warehous_id=:warehous_id)" " AND (NOT location_restrict) ) " " UNION SELECT location_id, formatLocationName(location_id) AS locationname " " FROM location, locitem, itemsite" " WHERE ( (location_warehous_id=:warehous_id)" " AND (location_restrict)" " AND (locitem_location_id=location_id)" " AND (locitem_item_id=itemsite_item_id)" " AND (itemsite_id=:itemsite_id))" " ORDER BY locationname;" ); loclist.bindValue(":warehous_id", _warehouse->id()); loclist.bindValue(":itemsite_id", _itemsite_id); loclist.exec(); _locations->populate(loclist); if (!loclist.first()) { _locationDefaultLit->hide(); _locations->hide(); } else { //Allow default location update with correct privileges if (_privileges->check("MaintainItemSites")) _locations->setEnabled(true); else _locations->setEnabled(false); XSqlQuery dfltLocation; dfltLocation.prepare( " SELECT itemsite_location_id" " FROM itemsite" " WHERE (itemsite_id=:itemsite_id)"); dfltLocation.bindValue(":itemsite_id", _itemsite_id); dfltLocation.exec(); if (!dfltLocation.first()) _locations->setId(-1); else _locations->setId(dfltLocation.value("itemsite_location_id").toInt()); connect(_locations, SIGNAL(newID(int)), this, SLOT(sChangeDefaultLocation())); } } else { _locationDefaultLit->hide(); _locations->hide(); } } else { _locationDefaultLit->hide(); _locations->hide(); } } void distributeInventory::sChangeDefaultLocation() { XSqlQuery query; query.prepare( " UPDATE itemsite" " SET itemsite_location_id=:itemsite_location_id" " WHERE (itemsite_id=:itemsite_id);" ); query.bindValue(":itemsite_location_id", _locations->id()); query.bindValue(":itemsite_id", _itemsite_id); query.exec(); sFillList(); if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/distributeInventory.h000066400000000000000000000033351217451700100216460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DISTRIBUTEINVENTORY_H #define DISTRIBUTEINVENTORY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_distributeInventory.h" class distributeInventory : public XDialog, public Ui::distributeInventory { Q_OBJECT public: distributeInventory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~distributeInventory(); static int SeriesAdjust( int pItemlocSeries, QWidget * pParent, const QString & = QString::null, const QDate & = QDate(), const QDate & = QDate() ); virtual enum SetResponse set( const ParameterList & pParams ); public slots: virtual void closeEvent( QCloseEvent * pEvent ); virtual void populate(); virtual void sBcChanged(const QString); virtual void sBcDistribute(); virtual void sCatchLotSerialNumber(const QString); virtual bool sDefault(); virtual bool sDefaultAndPost(); virtual void sFillList(); virtual void sPost(); virtual void sSelectLocation(); virtual void sPopulateDefaultSelector(); virtual void sChangeDefaultLocation(); protected slots: virtual void languageChange(); private: QString _controlMethod; QString _transtype; int _itemlocdistid; int _mode; int _itemsite_id; }; #endif // DISTRIBUTEINVENTORY_H qt-client-4.1.0/guiclient/distributeInventory.ui000066400000000000000000000512411217451700100220330ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. distributeInventory 0 0 849 572 Distribute Stock To/From Site Locations Qty. to Distribute: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Tagged: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Remaining: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _warehouse 0 false Qt::Horizontal QSizePolicy::Expanding 20 0 Location Default: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _locations true 0 0 0 20 false XComboBox::First Qt::Horizontal 40 0 Lot/Serial #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 0 0 2 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 0 0 2 Only Show &Locations with Qty &Tagged Lines Qt::Vertical 20 0 Qt::Horizontal 0 20 0 &Post true &Cancel &Default De&fault and Post Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 &Valid Locations: _itemloc 0 0 0 100 qt_scrollarea_viewport false Distri&bute Qt::Vertical 20 40 10 Qt::Horizontal 40 20 Lot/Serial &Number: _bc false Qty. _bcQty false false F&ind ItemCluster QWidget

    itemcluster.h
    1 WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _bc _bcQty _distribute _bcDistribute _defaultAndPost _default _cancel _post _item _warehouse _locations _qtyOnly _taggedOnly _itemloc _item newId(int) _warehouse findItemsites(int) 20 20 126 114 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 126 114 _cancel clicked() distributeInventory reject() 699 67 381 181 _itemloc valid(bool) _distribute setEnabled(bool) 601 241 700 207 qt-client-4.1.0/guiclient/distributeToLocation.cpp000066400000000000000000000314731217451700100222630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "distributeToLocation.h" #include #include #include #include #include distributeToLocation::distributeToLocation(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_distribute, SIGNAL(clicked()), this, SLOT(sDistribute())); _availToDistribute = 0; _sourceItemlocdistid = -1; _itemlocdistid = -1; _qtyToDistribute->setPrecision(omfgThis->qtyVal()); _qtyTagged->setPrecision(omfgThis->qtyVal()); _qtyBalance->setPrecision(omfgThis->qtyVal()); _locationQty->setValidator(omfgThis->transQtyVal()); } distributeToLocation::~distributeToLocation() { // no need to delete child widgets, Qt does it all for us } void distributeToLocation::languageChange() { retranslateUi(this); } enum SetResponse distributeToLocation::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("source_itemlocdist_id", &valid); if (valid) _sourceItemlocdistid = param.toInt(); param = pParams.value("itemlocdist_id", &valid); if (valid) { _mode = cItemloc; _itemlocdistid = param.toInt(); } param = pParams.value("location_id", &valid); if (valid) { _mode = cLocation; _locationid = param.toInt(); } populate(); param = pParams.value("qty", &valid); if (valid) { // convert the sign of qty to match the desired outcome then choose the lesser of // the qty available to distribute and the qty the caller requested double locQty = _locationQty->toDouble(); if (_mode == cItemloc) // lot/serial { if (locQty < 0 && param.toDouble() > 0) locQty = qMax(-param.toDouble(), locQty); else if (locQty < 0 && param.toDouble() < 0) locQty = qMax(param.toDouble(), locQty); } _locationQty->setDouble(locQty); } param = pParams.value("distribute", &valid); if (valid) { sDistribute(); return NoError; } return NoError; } void distributeToLocation::sDistribute() { XSqlQuery distributeDistribute; double qty = _locationQty->toDouble(); if ((_balance < 0) && (qty < _balance)) { QMessageBox::warning( this, tr("Cannot Distribute Quantity"), tr("You must not distribute a quantity to this Location that is greater than the total quantity to distribute.") ); _locationQty->setFocus(); return; } else if ((_balance > 0) && (qty > _balance)) { QMessageBox::warning( this, tr("Cannot Distribute Quantity"), tr("You may not distribute a quantity to this Location that is greater than the total quantity to distribute.") ); _locationQty->setFocus(); return; } else if ((_balance > 0) && (qty < 0)) { QMessageBox::warning( this, tr("Cannot Distribute Quantity"), tr("You may not distribute a negative value when the balance to distribute is positive.") ); _locationQty->setFocus(); return; } else if ((_balance < 0) && (qty > 0)) { QMessageBox::warning( this, tr("Cannot Distribute Quantity"), tr("You may not distribute a positive value when the balance to distribute is negative.") ); _locationQty->setFocus(); return; } if (qty < 0 && _availToDistribute < qAbs(qty) && QMessageBox::question(this, tr("Distribute More Than Available?"), tr("

    It appears you are trying to distribute " "more than is available to be distributed. " "Are you sure you want to distribute this " "quantity?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { _locationQty->setFocus(); return; } if (qty == 0.0) { if (_mode == cLocation) { distributeDistribute.prepare( "DELETE FROM itemlocdist " "WHERE ( (itemlocdist_itemlocdist_id=:itemlocdist_id)" " AND (itemlocdist_source_type='L')" " AND (itemlocdist_source_id=:location_id) );" ); distributeDistribute.bindValue(":itemlocdist_id", _sourceItemlocdistid); distributeDistribute.bindValue(":location_id", _locationid); distributeDistribute.exec(); } else if (_mode == cItemloc) { distributeDistribute.prepare( "DELETE FROM itemlocdist " "WHERE ( (itemlocdist_itemlocdist_id=:itemlocdist_id)" " AND (itemlocdist_source_type='I')" " AND (itemlocdist_source_id=:itemloc_id));" ); distributeDistribute.bindValue(":itemlocdist_id", _sourceItemlocdistid); distributeDistribute.bindValue(":itemloc_id", _itemlocdistid); distributeDistribute.exec(); } } else if (_mode == cLocation) { if (_metrics->boolean("LotSerialControl")) distributeDistribute.prepare( "SELECT itemlocdist_id " "FROM itemlocdist " "WHERE ( (itemlocdist_itemlocdist_id=:itemlocdist_id)" " AND (itemlocdist_source_type='L')" " AND (itemlocdist_source_id=:location_id)" " AND (formatlotserialnumber(itemlocdist_ls_id)=:lotSerial) );" ); else distributeDistribute.prepare( "SELECT itemlocdist_id " "FROM itemlocdist " "WHERE ( (itemlocdist_itemlocdist_id=:itemlocdist_id)" " AND (itemlocdist_source_type='L')" " AND (itemlocdist_source_id=:location_id)" " );" ); distributeDistribute.bindValue(":itemlocdist_id", _sourceItemlocdistid); distributeDistribute.bindValue(":location_id", _locationid); distributeDistribute.bindValue(":lotSerial", _lotSerial); distributeDistribute.exec(); if (distributeDistribute.first()) { int itemlocdistid = distributeDistribute.value("itemlocdist_id").toInt(); distributeDistribute.prepare( "UPDATE itemlocdist " "SET itemlocdist_qty=:qty " "WHERE (itemlocdist_id=:itemlocdist_id);" ); distributeDistribute.bindValue(":qty", qty); distributeDistribute.bindValue(":itemlocdist_id", itemlocdistid); distributeDistribute.exec(); } else { distributeDistribute.prepare( "INSERT INTO itemlocdist " "( itemlocdist_itemlocdist_id," " itemlocdist_source_type, itemlocdist_source_id," " itemlocdist_qty, itemlocdist_ls_id, itemlocdist_expiration ) " "SELECT itemlocdist_id," " 'L', :location_id," " :qty, itemlocdist_ls_id, endOfTime() " "FROM itemlocdist " "WHERE (itemlocdist_id=:itemlocdist_id);" ); distributeDistribute.bindValue(":location_id", _locationid); distributeDistribute.bindValue(":qty", qty); distributeDistribute.bindValue(":itemlocdist_id", _sourceItemlocdistid); distributeDistribute.exec(); } } else if (_mode == cItemloc) { distributeDistribute.prepare( "SELECT itemlocdist_id " "FROM itemlocdist, itemloc " "WHERE ( (itemlocdist_itemlocdist_id=:sItemlocdist_id)" " AND (itemlocdist_source_type='I')" " AND (itemlocdist_source_id=:itemlocdist_id) );" ); distributeDistribute.bindValue(":sItemlocdist_id", _sourceItemlocdistid); distributeDistribute.bindValue(":itemlocdist_id", _itemlocdistid); distributeDistribute.exec(); if (distributeDistribute.first()) { int itemlocdistid = distributeDistribute.value("itemlocdist_id").toInt(); distributeDistribute.prepare( "UPDATE itemlocdist " "SET itemlocdist_qty=:qty " "WHERE (itemlocdist_id=:itemlocdist_id);" ); distributeDistribute.bindValue(":qty", qty); distributeDistribute.bindValue(":itemlocdist_id", itemlocdistid); distributeDistribute.exec(); } else { distributeDistribute.prepare( "INSERT INTO itemlocdist " "( itemlocdist_itemlocdist_id," " itemlocdist_source_type, itemlocdist_source_id," " itemlocdist_qty, itemlocdist_expiration ) " "VALUES " "( :sItemlocdist_id," " 'I', :itemlocdist_id," " :qty, endOfTime() );" ); distributeDistribute.bindValue(":sItemlocdist_id", _sourceItemlocdistid); distributeDistribute.bindValue(":itemlocdist_id", _itemlocdistid); distributeDistribute.bindValue(":qty", qty); distributeDistribute.exec(); } } accept(); } void distributeToLocation::populate() { XSqlQuery distributepopulate; if (_mode == cLocation) { distributepopulate.prepare( "SELECT formatLocationName(location_id) AS locationname, COALESCE(subild.itemlocdist_qty, 0) AS qty, " " qtyLocation(location_id, NULL, NULL, NULL, topild.itemlocdist_itemsite_id, topild.itemlocdist_order_type, topild.itemlocdist_order_id, topild.itemlocdist_id) AS availqty " "FROM location LEFT OUTER JOIN itemlocdist AS subild" " ON ( (subild.itemlocdist_source_type='L')" " AND (subild.itemlocdist_source_id=location_id)" " AND (subild.itemlocdist_itemlocdist_id=:itemlocdist_id) ) " " LEFT OUTER JOIN itemlocdist AS topild" " ON (topild.itemlocdist_id=:itemlocdist_id) " "WHERE (location_id=:location_id);" ); distributepopulate.bindValue(":itemlocdist_id", _sourceItemlocdistid); distributepopulate.bindValue(":location_id", _locationid); } else if (_mode == cItemloc) { distributepopulate.prepare( "SELECT formatLocationName(location_id) AS locationname," " COALESCE(itemlocdist_qty, 0) AS qty, " " itemloc_qty AS availqty " "FROM itemloc LEFT OUTER JOIN" " location ON (itemloc_location_id=location_id) LEFT OUTER JOIN" " itemlocdist ON ((itemlocdist_source_type='I')" " AND (itemlocdist_source_id=itemloc_id)" " AND (itemlocdist_itemlocdist_id=:itemlocdist_id) ) " "WHERE (itemloc_id=:itemloc_id);" ); distributepopulate.bindValue(":itemlocdist_id", _sourceItemlocdistid); distributepopulate.bindValue(":itemloc_id", _itemlocdistid); } distributepopulate.exec(); if (distributepopulate.first()) { _locationQty->setDouble(distributepopulate.value("qty").toDouble()); _location->setText(distributepopulate.value("locationname").toString()); _availToDistribute = distributepopulate.value("availqty").toDouble(); } distributepopulate.prepare( "SELECT parent.lotserial AS lotserial," " qtydistrib," " qtytagged," " (qtydistrib - qtytagged) AS qtybalance " "FROM ( SELECT formatlotserialnumber(itemlocdist_ls_id) AS lotserial, itemlocdist_qty AS qtydistrib" " FROM itemlocdist" " WHERE (itemlocdist_id=:itemlocdist_id) ) AS parent," " ( SELECT COALESCE(SUM(itemlocdist_qty), 0) AS qtytagged" " FROM itemlocdist" " WHERE (itemlocdist_itemlocdist_id=:itemlocdist_id) ) AS child;" ); distributepopulate.bindValue(":itemlocdist_id", _sourceItemlocdistid); distributepopulate.exec(); if (distributepopulate.first()) { _lotSerial = distributepopulate.value("lotserial").toString(); _qtyToDistribute->setDouble(distributepopulate.value("qtydistrib").toDouble()); _qtyTagged->setDouble(distributepopulate.value("qtytagged").toDouble()); _qtyBalance->setDouble(distributepopulate.value("qtybalance").toDouble()); // _balance = (double)qRound(distributepopulate.value("qtybalance").toDouble() * pow(10.0, decimalPlaces("qty"))) / pow(10.0, decimalPlaces("qty")); _balance = _qtyBalance->toDouble(); double locQty = _balance; if (_mode == cItemloc || _mode == cLocation) // lot/serial or Location { // if we want to take stuff away and we have stuff to take away if (locQty < 0 && _availToDistribute > 0) locQty = qMax(-_availToDistribute, locQty); // if we want to take stuff away but don't have anything to take away else if (locQty < 0) locQty = 0; } _locationQty->setDouble(locQty); } else if (distributepopulate.lastError().type() != QSqlError::NoError) { systemError(this, distributepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/distributeToLocation.h000066400000000000000000000023531217451700100217230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DISTRIBUTETOLOCATION_H #define DISTRIBUTETOLOCATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_distributeToLocation.h" class distributeToLocation : public XDialog, public Ui::distributeToLocation { Q_OBJECT public: distributeToLocation(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~distributeToLocation(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sDistribute(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _locationid; int _sourceItemlocdistid; int _itemlocdistid; double _balance; QString _lotSerial; double _availToDistribute; }; #endif // DISTRIBUTETOLOCATION_H qt-client-4.1.0/guiclient/distributeToLocation.ui000066400000000000000000000215471217451700100221170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. distributeToLocation 0 0 351 135 Distribute to Location 5 7 0 0 0 5 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight 0 0 Qty. to Distribute: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Tagged: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Location: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. to this Location: 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 0 Qt::Vertical QSizePolicy::Expanding 20 16 0 0 Qt::Horizontal QSizePolicy::Expanding 23 20 0 5 &Cancel &Distribute true true Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit

    xlineedit.h
    0 _locationQty _distribute _close _close clicked() distributeToLocation reject() 20 20 20 20 qt-client-4.1.0/guiclient/dspAROpenItems.cpp000066400000000000000000001236671217451700100207550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspAROpenItems.h" #include #include #include #include #include #include #include #include #include "mqlutil.h" #include #include #include "applyARCreditMemo.h" #include "arOpenItem.h" #include "cashReceipt.h" #include "creditMemo.h" #include "creditcardprocessor.h" #include "distributeInventory.h" #include "dspInvoiceInformation.h" #include "dspSalesOrderStatus.h" #include "dspShipmentsBySalesOrder.h" #include "getGLDistDate.h" #include "invoice.h" #include "incident.h" #include "printArOpenItem.h" #include "printCreditMemo.h" #include "printInvoice.h" #include "printStatementByCustomer.h" #include "salesOrder.h" #include "storedProcErrorLookup.h" dspAROpenItems::dspAROpenItems(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspAROpenItems", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Open Receivables")); setListLabel(tr("Receivables")); setReportName("AROpenItems"); setMetaSQLOptions("arOpenItems", "detail"); setUseAltId(true); setNewVisible(true); connect(_customerSelector, SIGNAL(updated()), list(), SLOT(clear())); connect(_customerSelector, SIGNAL(updated()), this, SLOT(sHandlePrintGroup())); connect(_closed, SIGNAL(toggled(bool)), this, SLOT(sClosedToggled(bool))); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); QString baseBalanceTitle(tr("Balance")); QString baseAmountTitle(tr("Amount")); QString basePaidTitle(tr("Paid")); if (! omfgThis->singleCurrency()) { baseBalanceTitle = tr("Balance (in %1)").arg(CurrDisplay::baseCurrAbbr()); baseAmountTitle = tr("Amount (in %1)").arg(CurrDisplay::baseCurrAbbr()); basePaidTitle = tr("Paid (in %1)").arg(CurrDisplay::baseCurrAbbr()); } list()->setRootIsDecorated(true); list()->addColumn(tr("Doc. Type"), -1, Qt::AlignLeft, true, "doctype"); list()->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter, true, "posted"); list()->addColumn(tr("Recurring"), _ynColumn, Qt::AlignCenter, false, "recurring"); list()->addColumn(tr("Open"), _ynColumn, Qt::AlignCenter, false, "open"); list()->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignLeft, true, "docnumber"); list()->addColumn(tr("Cust./Assign To"),_itemColumn, Qt::AlignLeft, false, "cust_number"); list()->addColumn(tr("Name/Desc."), -1, Qt::AlignLeft, true, "cust_name"); list()->addColumn(tr("Order/Incident"),_itemColumn, Qt::AlignRight, false, "ordernumber"); list()->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, true, "docdate"); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "aropen_duedate"); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "amount"); list()->addColumn(baseAmountTitle, _moneyColumn, Qt::AlignRight, false, "base_amount"); list()->addColumn(tr("Paid"), _moneyColumn, Qt::AlignRight, true, "paid"); list()->addColumn(basePaidTitle, _moneyColumn, Qt::AlignRight, false, "base_paid"); list()->addColumn(tr("Balance"), _moneyColumn, Qt::AlignRight, true, "balance"); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currAbbr"); list()->addColumn(baseBalanceTitle, _moneyColumn, Qt::AlignRight, true, "base_balance"); list()->addColumn(tr("Credit Card"), -1, Qt::AlignLeft, false, "ccard_number"); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, false, "notes"); connect(omfgThis, SIGNAL(creditMemosUpdated()), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(invoicesUpdated(int, bool)), this, SLOT(sFillList())); if (omfgThis->singleCurrency()) { list()->hideColumn("currAbbr"); list()->hideColumn("balance"); } disconnect(newAction(), SIGNAL(triggered()), this, SLOT(sNew())); connect(newAction(), SIGNAL(triggered()), this, SLOT(sCreateInvoice())); QToolButton * newBtn = (QToolButton*)toolBar()->widgetForAction(newAction()); newBtn->setPopupMode(QToolButton::MenuButtonPopup); QAction *menuItem; QMenu * newMenu = new QMenu; menuItem = newMenu->addAction(tr("Invoice"), this, SLOT(sCreateInvoice())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices")); menuItem = newMenu->addAction(tr("Misc. Debit Memo"), this, SLOT(sEnterMiscArDebitMemo())); menuItem->setEnabled(_privileges->check("MaintainARMemos")); newMenu->addSeparator(); menuItem = newMenu->addAction(tr("Credit Memo"), this, SLOT(sNewCreditMemo())); menuItem->setEnabled(_privileges->check("MaintainCreditMemos")); menuItem = newMenu->addAction(tr("Misc. Credit Memo"), this, SLOT(sEnterMiscArCreditMemo())); menuItem->setEnabled(_privileges->check("MaintainARMemos")); newBtn->setMenu(newMenu); _asOf->setDate(omfgThis->dbDate(), true); _closed->hide(); } enum SetResponse dspAROpenItems::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; if (pParams.inList("byDueDate")) _dueDate->setChecked(true); param = pParams.value("cust_id", &valid); if (valid) _customerSelector->setCustId(param.toInt()); param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setEndDate(param.toDate()); param = pParams.value("asofDate", &valid); if (valid) { _asOf->setDate(param.toDate()); _asOf->setEnabled(FALSE); } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void dspAROpenItems::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pItem, int) { QAction *menuItem = 0; if (((XTreeWidgetItem *)pItem)->altId() < 4) { menuItem = pMenu->addAction(tr("Print..."), this, SLOT(sPrintItem())); if (((XTreeWidgetItem *)pItem)->altId() == 0) // Invoice menuItem->setEnabled(_privileges->check("ViewMiscInvoices") || _privileges->check("MaintainMiscInvoices")); else if (((XTreeWidgetItem *)pItem)->altId() == 1 && ((XTreeWidgetItem *)pItem)->id("docnumber") > -1) // Credit Memo menuItem->setEnabled(_privileges->check("ViewCreditMemos") || _privileges->check("MaintainCreditMemos")); else // Open Item menuItem->setEnabled(_privileges->check("ViewAROpenItems") || _privileges->check("EditAROpenItem")); } pMenu->addSeparator(); if (((XTreeWidgetItem *)pItem)->altId() == 0 && ((XTreeWidgetItem *)pItem)->rawValue("posted") == 0) // Invoice { menuItem = pMenu->addAction(tr("Edit Invoice..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices")); } else if (((XTreeWidgetItem *)pItem)->altId() == 1 && ((XTreeWidgetItem *)pItem)->id("docnumber") > -1) // Credit Memo { menuItem = pMenu->addAction(tr("Edit Credit Memo..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCreditMemos")); } else if (((XTreeWidgetItem *)pItem)->id() > 0) // Open Item { menuItem = pMenu->addAction(tr("Edit Receivable Item..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("EditAROpenItem")); } else // Incident { menuItem = pMenu->addAction(tr("Edit Incident..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainAllIncidents")); } if (((XTreeWidgetItem *)pItem)->id() > 0) // Open Item { menuItem = pMenu->addAction(tr("View Receivable Item..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("EditAROpenItem") || _privileges->check("ViewAROpenItems")); } if (((XTreeWidgetItem *)pItem)->altId() == 0) // Invoice { if(((XTreeWidgetItem *)pItem)->rawValue("posted") != 0) { menuItem = pMenu->addAction(tr("Void Posted Invoice..."), this, SLOT(sVoidInvoiceDetails())); menuItem->setEnabled(_privileges->check("VoidPostedInvoices")); menuItem = pMenu->addAction(tr("Edit Posted Invoice..."), this, SLOT(sEditInvoiceDetails())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices")); } menuItem = pMenu->addAction(tr("View Invoice..."), this, SLOT(sViewInvoiceDetails())); menuItem->setEnabled(_privileges->check("ViewMiscInvoices")); menuItem = pMenu->addAction(tr("View Invoice Information..."), this, SLOT(sViewInvoice())); menuItem->setEnabled(_privileges->check("ViewMiscInvoices")); } else if (((XTreeWidgetItem *)pItem)->altId() == 1 && ((XTreeWidgetItem *)pItem)->id("docnumber") > -1) // Credit Memo { if(((XTreeWidgetItem *)pItem)->rawValue("posted") != 0) { menuItem = pMenu->addAction(tr("Void Posted Credit Memo..."), this, SLOT(sVoidCreditMemo())); menuItem->setEnabled(_privileges->check("VoidPostedARCreditMemos")); } menuItem = pMenu->addAction(tr("View Credit Memo..."), this, SLOT(sViewCreditMemo())); menuItem->setEnabled(_privileges->check("MaintainCreditMemos") || _privileges->check("ViewCreditMemos")); } else if (((XTreeWidgetItem *)pItem)->altId() == 4) // Incident { menuItem = pMenu->addAction(tr("View Incident..."), this, SLOT(sViewIncident())); menuItem->setEnabled(_privileges->check("ViewAllIncidents") || _privileges->check("MaintainAllIncidents")); } if (((XTreeWidgetItem *)pItem)->altId() < 2 && ((XTreeWidgetItem *)pItem)->id() == -1 && !((XTreeWidgetItem *)pItem)->rawValue("posted").toBool()) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostARDocuments")); if (((XTreeWidgetItem *)pItem)->altId() == 0) { menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteInvoice())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices")); } else { menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteCreditMemo())); menuItem->setEnabled(_privileges->check("MaintainCreditMemos")); } } if ((((XTreeWidgetItem *)pItem)->altId() == 1 || ((XTreeWidgetItem *)pItem)->altId() == 3) && ((XTreeWidgetItem *)pItem)->rawValue("posted").toBool() && ((XTreeWidgetItem *)pItem)->rawValue("open").toBool() ) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Apply Credit Memo..."), this, SLOT(sApplyAropenCM())); menuItem->setEnabled(_privileges->check("ApplyARMemos")); } if ((((XTreeWidgetItem *)pItem)->id("ordernumber") > 0 && ((XTreeWidgetItem *)pItem)->altId() == 0) ) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditSalesOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewSalesOrder())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction(tr("Shipments..."), this, SLOT(sShipment())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders")); } if ((((XTreeWidgetItem *)pItem)->altId() == 0 || ((XTreeWidgetItem *)pItem)->altId() == 2) && ((XTreeWidgetItem *)pItem)->rawValue("posted").toBool() && ((XTreeWidgetItem *)pItem)->rawValue("open").toBool() ) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("New Cash Receipt..."), this, SLOT(sNewCashrcpt())); menuItem->setEnabled(_privileges->check("MaintainCashReceipts")); } if ((_metrics->boolean("CCAccept") && ((XTreeWidgetItem *)pItem)->id("ccard_number") > 0) ) { menuItem = pMenu->addAction(tr("Refund"), this, SLOT(sCCRefundCM())); menuItem->setEnabled( _privileges->check("ProcessCreditCards") && ((XTreeWidgetItem *)pItem)->rawValue("balance").toDouble() < 0); } if (((XTreeWidgetItem *)pItem)->id() > -1 && ((XTreeWidgetItem *)pItem)->rawValue("posted").toBool() && ((XTreeWidgetItem *)pItem)->rawValue("open").toBool() ) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("New Incident..."), this, SLOT(sIncident())); if (!_privileges->check("MaintainAllIncidents")) menuItem->setEnabled(false); } } void dspAROpenItems::sApplyAropenCM() { ParameterList params; params.append("aropen_id", list()->id()); applyARCreditMemo newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspAROpenItems::sCCRefundCM() { XSqlQuery dspCCRefundCM; if (list()->id("ccard_number") < 0) { QMessageBox::warning(this, tr("Cannot Refund by Credit Card"), tr("

    The application cannot refund this " "transaction using a credit card.")); return; } int ccardid = -1; double total = 0.0; double tax = 0.0; double freight = 0.0; double duty = 0.0; int currid = -1; bool taxexempt = false; QString docnum; QString refnum; int ccpayid = list()->currentItem()->id("ccard_number"); dspCCRefundCM.prepare("SELECT ccpay_ccard_id, aropen_amount - aropen_paid AS balance, " " aropen_curr_id, aropen_docnumber " "FROM aropen " " JOIN payaropen ON (aropen_id=payaropen_aropen_id) " " JOIN ccpay ON (payaropen_ccpay_id=ccpay_id) " "WHERE ((aropen_id=:aropen_id)" " AND (ccpay_id=:ccpay_id));"); dspCCRefundCM.bindValue(":aropen_id", list()->id()); dspCCRefundCM.bindValue(":ccpay_id", ccpayid); dspCCRefundCM.exec(); if (dspCCRefundCM.first()) { ccardid = dspCCRefundCM.value("ccpay_ccard_id").toInt(); total = dspCCRefundCM.value("balance").toDouble(); currid = dspCCRefundCM.value("aropen_curr_id").toInt(); docnum = dspCCRefundCM.value("aropen_docnumber").toString(); } else if (dspCCRefundCM.lastError().type() != QSqlError::NoError) { systemError(this, dspCCRefundCM.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::critical(this, tr("Credit Card Processing Error"), tr("Could not find a Credit Card to use for " "this Credit transaction.")); return; } CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (! cardproc) QMessageBox::critical(this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); else { int refid = list()->id(); int returnVal = cardproc->credit(ccardid, "-2", total, tax, taxexempt, freight, duty, currid, docnum, refnum, ccpayid, "aropen", refid); if (returnVal < 0) QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); else if (returnVal > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (! cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); } sFillList(); } void dspAROpenItems::sDeleteCreditMemo() { if (QMessageBox::question(this, tr("Delete Selected Credit Memos?"), tr("

    Are you sure that you want to delete the " "selected Credit Memos?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("SELECT deleteCreditMemo(:cmhead_id) AS result;"); if (checkCreditMemoSitePrivs(list()->currentItem()->id("docnumber"))) { delq.bindValue(":cmhead_id", (list()->currentItem()->id("docnumber"))); delq.exec(); if (delq.first()) { if (! delq.value("result").toBool()) systemError(this, tr("Could not delete Credit Memo."), __FILE__, __LINE__); } else if (delq.lastError().type() != QSqlError::NoError) systemError(this, tr("Error deleting Credit Memo %1\n").arg(list()->currentItem()->text("docnumber")) + delq.lastError().databaseText(), __FILE__, __LINE__); } omfgThis->sCreditMemosUpdated(); } } void dspAROpenItems::sDeleteInvoice() { XSqlQuery dspDeleteInvoice; if ( QMessageBox::warning( this, tr("Delete Selected Invoices"), tr("

    Are you sure that you want to delete the " "selected Invoices?"), tr("Delete"), tr("Cancel"), QString::null, 1, 1 ) == 0) { dspDeleteInvoice.prepare("SELECT deleteInvoice(:invchead_id) AS result;"); if (checkInvoiceSitePrivs(list()->currentItem()->id("docnumber"))) { dspDeleteInvoice.bindValue(":invchead_id", list()->currentItem()->id("docnumber")); dspDeleteInvoice.exec(); if (dspDeleteInvoice.first()) { int result = dspDeleteInvoice.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteInvoice", result), __FILE__, __LINE__); } } else if (dspDeleteInvoice.lastError().type() != QSqlError::NoError) systemError(this, tr("Error deleting Invoice %1\n").arg(list()->currentItem()->text("docnumber")) + dspDeleteInvoice.lastError().databaseText(), __FILE__, __LINE__); } omfgThis->sInvoicesUpdated(-1, TRUE); omfgThis->sBillingSelectionUpdated(-1, -1); } } void dspAROpenItems::sDspShipmentStatus() { if (checkSalesOrderSitePrivs(list()->currentItem()->id("ordernumber"))) { ParameterList params; params.append("sohead_id", list()->currentItem()->id("ordernumber")); params.append("run"); dspSalesOrderStatus *newdlg = new dspSalesOrderStatus(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspAROpenItems::sEdit() { ParameterList params; if (list()->altId() == 0 && list()->id() == -1) // Edit Unposted Invoice { if (checkInvoiceSitePrivs(list()->currentItem()->id("docnumber"))) { params.append("invchead_id", list()->currentItem()->id("docnumber")); params.append("mode", "edit"); invoice* newdlg = new invoice(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); return; } return; } else if (list()->altId() == 1 && list()->currentItem()->id("docnumber") > -1 && list()->id() -1) // Edit Unposted Credit Memo { if (checkCreditMemoSitePrivs(list()->currentItem()->id("docnumber"))) { params.append("cmhead_id", list()->currentItem()->id("docnumber")); params.append("mode", "edit"); creditMemo* newdlg = new creditMemo(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); return; } return; } else if (list()->id() > 0) // Edit AR Open Item { params.append("mode", "edit"); params.append("aropen_id", list()->id()); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } else // Edit Incident { params.append("mode", "edit"); params.append("incdt_id", list()->currentItem()->id("ordernumber")); incident newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } } void dspAROpenItems::sEditSalesOrder() { if (checkSalesOrderSitePrivs(list()->currentItem()->id("ordernumber"))) salesOrder::editSalesOrder(list()->currentItem()->id("ordernumber"), false); } void dspAROpenItems::sView() { ParameterList params; params.append("mode", "view"); params.append("aropen_id", list()->id()); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspAROpenItems::sViewSalesOrder() { if (checkSalesOrderSitePrivs(list()->currentItem()->id("ordernumber"))) salesOrder::viewSalesOrder(list()->currentItem()->id("ordernumber")); } void dspAROpenItems::sViewCreditMemo() { ParameterList params; params.append("cmhead_id", list()->currentItem()->id("docnumber")); params.append("mode", "view"); creditMemo* newdlg = new creditMemo(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAROpenItems::sVoidCreditMemo() { XSqlQuery dspVoidCreditMemo; XTreeWidgetItem *pItem = list()->currentItem(); if(pItem->rawValue("posted") != 0 && QMessageBox::question(this, tr("Void Posted Credit Memo?"), tr("

    This Credit Memo has already been posted. " "Are you sure you want to void it?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery post; post.prepare("SELECT voidCreditMemo(:cmhead_id) AS result;"); dspVoidCreditMemo.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations post.bindValue(":cmhead_id", list()->currentItem()->id("docnumber")); post.exec(); if (post.first()) { int result = post.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("voidCreditMemo", result), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Void Credit Memo"), tr("Transaction Canceled") ); return; } dspVoidCreditMemo.exec("COMMIT;"); sFillList(); } else if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("A System Error occurred voiding Credit Memo.\n%1") .arg(post.lastError().databaseText()), __FILE__, __LINE__); } } void dspAROpenItems::sEnterMiscArCreditMemo() { ParameterList params; params.append("mode", "new"); params.append("docType", "creditMemo"); if (_customerSelector->isSelectedCust()) params.append("cust_id", _customerSelector->custId()); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void dspAROpenItems::sEnterMiscArDebitMemo() { ParameterList params; params.append("mode", "new"); params.append("docType", "debitMemo"); if (_customerSelector->isSelectedCust()) params.append("cust_id", _customerSelector->custId()); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void dspAROpenItems::sCreateInvoice() { invoice::newInvoice(_customerSelector->custId()); } void dspAROpenItems::sNewCashrcpt() { XSqlQuery dspNewCashrcpt; ParameterList params; params.append("mode", "new"); if (list()->id() > -1) { dspNewCashrcpt.prepare("SELECT aropen_cust_id FROM aropen WHERE aropen_id=:aropen_id;"); dspNewCashrcpt.bindValue(":aropen_id", list()->id()); dspNewCashrcpt.exec(); if (dspNewCashrcpt.first()) { params.append("cust_id", dspNewCashrcpt.value("aropen_cust_id").toInt()); params.append("docnumber", list()->currentItem()->text("docnumber")); } } else { if (_customerSelector->isSelectedCust()) params.append("cust_id", _customerSelector->custId()); } cashReceipt *newdlg = new cashReceipt(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAROpenItems::sNewCreditMemo() { ParameterList params; params.append("mode", "new"); if (_customerSelector->isSelectedCust()) params.append("cust_id", _customerSelector->custId()); creditMemo *newdlg = new creditMemo(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAROpenItems::sViewInvoice() { ParameterList params; params.append("invoiceNumber", list()->currentItem()->text("docnumber")); dspInvoiceInformation* newdlg = new dspInvoiceInformation(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAROpenItems::sEditInvoiceDetails() { XTreeWidgetItem *pItem = list()->currentItem(); if(pItem->rawValue("posted") != 0 && QMessageBox::question(this, tr("Edit Posted Invoice?"), tr("

    This Invoice has already been posted. " "Are you sure you want to edit it?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return; } ParameterList params; params.append("invchead_id", list()->currentItem()->id("docnumber")); params.append("mode", "edit"); invoice* newdlg = new invoice(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAROpenItems::sVoidInvoiceDetails() { XSqlQuery dspVoidInvoiceDetails; XTreeWidgetItem *pItem = list()->currentItem(); if(pItem->rawValue("posted") != 0 && QMessageBox::question(this, tr("Void Posted Invoice?"), tr("

    This Invoice has already been posted. " "Are you sure you want to void it?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery post; post.prepare("SELECT voidInvoice(:invchead_id) AS result;"); dspVoidInvoiceDetails.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations post.bindValue(":invchead_id", list()->currentItem()->id("docnumber")); post.exec(); if (post.first()) { int result = post.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("voidInvoice", result), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Void Invoice"), tr("Transaction Canceled") ); return; } dspVoidInvoiceDetails.exec("COMMIT;"); sFillList(); } else if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("A System Error occurred voiding Invoice.\n%1") .arg(post.lastError().databaseText()), __FILE__, __LINE__); } } void dspAROpenItems::sViewInvoiceDetails() { ParameterList params; params.append("invchead_id", list()->currentItem()->id("docnumber")); params.append("mode", "view"); invoice* newdlg = new invoice(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspAROpenItems::sIncident() { XSqlQuery dspIncident; dspIncident.prepare("SELECT crmacct_id, crmacct_cntct_id_1 " "FROM crmacct, aropen " "WHERE ((aropen_id=:aropen_id) " "AND (crmacct_cust_id=aropen_cust_id));"); dspIncident.bindValue(":aropen_id", list()->id()); dspIncident.exec(); if (dspIncident.first()) { ParameterList params; params.append("mode", "new"); params.append("aropen_id", list()->id()); params.append("crmacct_id", dspIncident.value("crmacct_id")); params.append("cntct_id", dspIncident.value("crmacct_cntct_id_1")); incident newdlg(this, 0, TRUE); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillList(); } } void dspAROpenItems::sViewIncident() { ParameterList params; params.append("mode", "view"); params.append("incdt_id", list()->currentItem()->id("ordernumber")); incident newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } bool dspAROpenItems::setParams(ParameterList ¶ms) { _customerSelector->appendValue(params); if (_docDate->isChecked()) _dates->appendValue(params); else { params.append("startDueDate", _dates->startDate()); params.append("endDueDate", _dates->endDate()); } params.append("invoice", tr("Invoice")); params.append("creditMemo", tr("Credit Memo")); params.append("debitMemo", tr("Debit Memo")); params.append("cashdeposit", tr("Customer Deposit")); params.append("asofDate", _asOf->date()); if (_incidentsOnly->isChecked()) params.append("incidentsOnly"); if (_debits->isChecked()) params.append("debitsOnly"); else if (_credits->isChecked()) params.append("creditsOnly"); if (_unposted->isChecked()) params.append("showUnposted"); if (_closed->isChecked()) params.append("showClosed"); params.append("key", omfgThis->_key); return true; } void dspAROpenItems::sPreview() { if (_printStatement->isChecked()) { MetaSQLQuery mql("SELECT findCustomerForm(cust_id, 'S') AS reportname" " FROM custinfo" " WHERE (cust_id=);"); ParameterList params; params.append("cust_id", _customerSelector->custId()); params.append("invoice", tr("Invoice")); params.append("debit", tr("Debit Memo")); params.append("credit", tr("Credit Memo")); params.append("deposit", tr("Deposit")); params.append("asofdate", _asOf->date()); XSqlQuery qry = mql.toQuery(params); if (qry.first()) setReportName(qry.value("reportname").toString()); display::sPreview(params); } else { setReportName("AROpenItems"); display::sPreview(); } } void dspAROpenItems::sPrint() { if (_printStatement->isChecked()) { printStatementByCustomer newdlg(this, "", true); ParameterList params; params.append("cust_id", _customerSelector->custId()); params.append("asofDate", _asOf->date()); params.append("print"); newdlg.set(params); } else { ParameterList params; if (! setParams(params)) return; params.append("includeFormatted"); orReport report(reportName(), params); if (report.isValid()) report.print(); else report.reportError(this); } } void dspAROpenItems::sPrintItem() { ParameterList params; if (list()->altId() == 0) { // Print Invoice printInvoice newdlg(this, "", TRUE); if (checkInvoiceSitePrivs(list()->currentItem()->id("docnumber"))) { params.append("invchead_id", list()->currentItem()->id("docnumber")); params.append("persistentPrint"); newdlg.set(params); if (!newdlg.isSetup()) { if(newdlg.exec() == QDialog::Rejected) return; newdlg.setSetup(TRUE); } omfgThis->sInvoicesUpdated(-1, TRUE); return; } else return; } else if (list()->altId() == 1 && list()->currentItem()->id("docnumber") > -1) { // Print Credit Memo if (checkCreditMemoSitePrivs(list()->currentItem()->id("docnumber"))) { params.append("cmhead_id", list()->currentItem()->id("docnumber")); params.append("persistentPrint"); printCreditMemo newdlg(this, "", TRUE); newdlg.set(params); if (!newdlg.isSetup()) { if(newdlg.exec() == QDialog::Rejected) return; newdlg.setSetup(TRUE); } omfgThis->sCreditMemosUpdated(); return; } else return; } else if (list()->id() > 0) // Print AR Open Item { params.append("aropen_id", list()->id()); printArOpenItem newdlg(this, "", true); if (newdlg.set(params) == NoError) newdlg.exec(); } } void dspAROpenItems::sPost() { if (list()->altId() == 1 && list()->id() == -1) sPostCreditMemo(); else if (list()->altId() == 0 || list()->id() == -1) sPostInvoice(); } void dspAROpenItems::sPostCreditMemo() { XSqlQuery dspPostCreditMemo; if (list()->altId() != 1 || list()->id() > 0) return; int id = list()->currentItem()->id("docnumber"); if (!checkCreditMemoSitePrivs(id)) return; bool changeDate = false; QDate newDate = QDate::currentDate(); if (_privileges->check("ChangeSOMemoPostDate")) { getGLDistDate newdlg(this, "", TRUE); newdlg.sSetDefaultLit(tr("Credit Memo Date")); if (newdlg.exec() == XDialog::Accepted) { newDate = newdlg.date(); changeDate = (newDate.isValid()); } else return; } XSqlQuery setDate; setDate.prepare("UPDATE cmhead SET cmhead_gldistdate=:distdate " "WHERE cmhead_id=:cmhead_id;"); if (changeDate) { setDate.bindValue(":distdate", newDate); setDate.bindValue(":cmhead_id", id); setDate.exec(); if (setDate.lastError().type() != QSqlError::NoError) { systemError(this, setDate.lastError().databaseText(), __FILE__, __LINE__); } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery postq; postq.prepare("SELECT postCreditMemo(:cmhead_id, 0) AS result;"); XSqlQuery tx; tx.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations postq.bindValue(":cmhead_id", id); postq.exec(); if (postq.first()) { int result = postq.value("result").toInt(); if (result < 0) { rollback.exec(); systemError( this, storedProcErrorLookup("postCreditMemo", result), __FILE__, __LINE__); return; } else { if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Post Credit Memo"), tr("Transaction Canceled") ); return; } dspPostCreditMemo.exec("COMMIT;"); } } // contains() string is hard-coded in stored procedure else if (postq.lastError().databaseText().contains("post to closed period")) { rollback.exec(); systemError(this, tr("Could not post Credit Memo #%1 because of a missing exchange rate.") .arg(list()->currentItem()->text("docnumber"))); return; } else if (postq.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("A System Error occurred posting Credit Memo#%1.\n%2") .arg(list()->currentItem()->text("docnumber")) .arg(postq.lastError().databaseText()), __FILE__, __LINE__); } omfgThis->sCreditMemosUpdated(); } void dspAROpenItems::sPostInvoice() { XSqlQuery dspPostInvoice; if (list()->altId() != 0 || list()->id() > 0) return; bool changeDate = false; QDate newDate = QDate::currentDate(); if (!checkInvoiceSitePrivs(list()->currentItem()->id("docnumber"))) return; if (_privileges->check("ChangeARInvcDistDate")) { getGLDistDate newdlg(this, "", TRUE); newdlg.sSetDefaultLit(tr("Invoice Date")); if (newdlg.exec() == XDialog::Accepted) { newDate = newdlg.date(); changeDate = (newDate.isValid()); } else return; } int journal = -1; dspPostInvoice.exec("SELECT fetchJournalNumber('AR-IN') AS result;"); if (dspPostInvoice.first()) { journal = dspPostInvoice.value("result").toInt(); if (journal < 0) { systemError(this, storedProcErrorLookup("fetchJournalNumber", journal), __FILE__, __LINE__); return; } } else if (dspPostInvoice.lastError().type() != QSqlError::NoError) { systemError(this, dspPostInvoice.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery xrate; xrate.prepare("SELECT curr_rate " "FROM curr_rate, invchead " "WHERE ((curr_id=invchead_curr_id)" " AND (invchead_id=:invchead_id)" " AND (invchead_invcdate BETWEEN curr_effective AND curr_expires));"); // if SUM becomes dependent on curr_id then move XRATE before it in the loop XSqlQuery sum; sum.prepare("SELECT invoicetotal(:invchead_id) AS subtotal;"); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery post; post.prepare("SELECT postInvoice(:invchead_id, :journal) AS result;"); XSqlQuery setDate; setDate.prepare("UPDATE invchead SET invchead_gldistdate=:distdate " "WHERE invchead_id=:invchead_id;"); if (changeDate) { setDate.bindValue(":distdate", newDate); setDate.bindValue(":invchead_id", list()->currentItem()->id("docnumber")); setDate.exec(); if (setDate.lastError().type() != QSqlError::NoError) systemError(this, setDate.lastError().databaseText(), __FILE__, __LINE__); } sum.bindValue(":invchead_id", list()->currentItem()->id("docnumber")); sum.exec(); if (sum.first()) { if (sum.value("subtotal").toDouble() == 0) { if (QMessageBox::question(this, tr("Invoice Has Value 0"), tr("Invoice #%1 has a total value of 0.\n" "Would you like to post it anyway?") .arg(list()->currentItem()->text("docnumber")), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; } else { xrate.bindValue(":invchead_id", list()->currentItem()->id("docnumber")); xrate.exec(); if (xrate.lastError().type() != QSqlError::NoError) { systemError(this, tr("System Error posting Invoice #%1\n%2") .arg(list()->currentItem()->text("docnumber")) .arg(xrate.lastError().databaseText()), __FILE__, __LINE__); return; } else if (!xrate.first() || xrate.value("curr_rate").isNull()) { systemError(this, tr("Could not post Invoice #%1 because of a missing exchange rate.") .arg(list()->currentItem()->text("docnumber"))); return; } } } else if (sum.lastError().type() != QSqlError::NoError) { systemError(this, sum.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery tx; tx.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations post.bindValue(":invchead_id", list()->currentItem()->id("docnumber")); post.bindValue(":journal", journal); post.exec(); if (post.first()) { int result = post.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postInvoice", result), __FILE__, __LINE__); } else { if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Post Invoice"), tr("Transaction Canceled") ); return; } dspPostInvoice.exec("COMMIT;"); } } // contains() string is hard-coded in stored procedure else if (post.lastError().databaseText().contains("post to closed period")) { rollback.exec(); systemError(this, tr("Could not post Invoice #%1 into a closed period.") .arg(list()->currentItem()->text("docnumber"))); } else if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("A System Error occurred posting Invoice #%1.\n%2") .arg(list()->currentItem()->text("docnumber")) .arg(post.lastError().databaseText()), __FILE__, __LINE__); } omfgThis->sInvoicesUpdated(-1, TRUE); } void dspAROpenItems::sShipment() { if (checkSalesOrderSitePrivs(list()->currentItem()->id("ordernumber"))) { ParameterList params; params.append("sohead_id", list()->currentItem()->id("ordernumber")); dspShipmentsBySalesOrder* newdlg = new dspShipmentsBySalesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void dspAROpenItems::sHandlePrintGroup() { _printGroup->setEnabled(_customerSelector->isValid() && _customerSelector->isSelectedCust()); } bool dspAROpenItems::checkInvoiceSitePrivs(int invcid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkInvoiceSitePrivs(:invcheadid) AS result;"); check.bindValue(":invcheadid", invcid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Invoice as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } bool dspAROpenItems::checkCreditMemoSitePrivs(int cmid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkCreditMemoSitePrivs(:cmheadid) AS result;"); check.bindValue(":cmheadid", cmid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Credit Memo as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } bool dspAROpenItems::checkSalesOrderSitePrivs(int soid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkSOSitePrivs(:coheadid) AS result;"); check.bindValue(":coheadid", soid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Sales Order as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } void dspAROpenItems::sClosedToggled(bool checked) { if (checked) _dates->setStartDate(QDate().currentDate().addDays(-90)); else _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); } qt-client-4.1.0/guiclient/dspAROpenItems.h000066400000000000000000000042421217451700100204050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPAROPENITEMS_H #define DSPAROPENITEMS_H #include "display.h" #include #include "ui_dspAROpenItems.h" class dspAROpenItems : public display, public Ui::dspAROpenItems { Q_OBJECT public: dspAROpenItems(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); Q_INVOKABLE bool checkInvoiceSitePrivs(int); Q_INVOKABLE bool checkCreditMemoSitePrivs(int); Q_INVOKABLE bool checkSalesOrderSitePrivs(int); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool setParams(ParameterList &); virtual void sApplyAropenCM(); virtual void sCCRefundCM(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem *pItem, int ); virtual void sDeleteCreditMemo(); virtual void sDeleteInvoice(); virtual void sDspShipmentStatus(); virtual void sEdit(); virtual void sEditSalesOrder(); virtual void sEnterMiscArCreditMemo(); virtual void sEnterMiscArDebitMemo(); virtual void sCreateInvoice(); virtual void sNewCashrcpt(); virtual void sNewCreditMemo(); virtual void sView(); virtual void sViewCreditMemo(); virtual void sVoidCreditMemo(); virtual void sViewInvoice(); virtual void sVoidInvoiceDetails(); virtual void sEditInvoiceDetails(); virtual void sViewInvoiceDetails(); virtual void sViewSalesOrder(); virtual void sIncident(); virtual void sViewIncident(); virtual void sPreview(); virtual void sPrint(); virtual void sPrintItem(); virtual void sPost(); virtual void sPostInvoice(); virtual void sPostCreditMemo(); virtual void sShipment(); virtual void sHandlePrintGroup(); virtual void sClosedToggled(bool); }; #endif // DSPAROPENITEMS_H qt-client-4.1.0/guiclient/dspAROpenItems.ui000066400000000000000000000155401217451700100205760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspAROpenItems 0 0 719 306 Open Receivables Qt::Vertical QSizePolicy::Fixed 20 5 Date Range 12 Document true Due Qt::Horizontal 40 20 Qt::StrongFocus Show Debits Only Items with Incidents Credits Unposted false Both true Closed false true false Print List true Statement As of Date: Qt::Horizontal 270 20 CustomerSelector QWidget

    customerselector.h
    DateCluster QWidget
    datecluster.h
    DLineEdit QWidget
    datecluster.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    qt-client-4.1.0/guiclient/dspBankrecHistory.cpp000066400000000000000000000115201217451700100215360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspBankrecHistory.h" #include #include #include #include #include #include #include "guiclient.h" #include "mqlutil.h" dspBankrecHistory::dspBankrecHistory(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _bankaccnt->populate("SELECT bankaccnt_id," " (bankaccnt_name || '-' || bankaccnt_descrip) " "FROM bankaccnt " "ORDER BY bankaccnt_name;"); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sBankaccntChanged())); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _rec->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter,true, "gltrans_date"); _rec->addColumn(tr("Doc Number/Notes"), -1, Qt::AlignLeft, true, "gltrans_docnumber"); _rec->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight, true, "amount"); _unrec->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter,true, "gltrans_date"); _unrec->addColumn(tr("Doc Number/Notes"), -1, Qt::AlignLeft, true, "gltrans_docnumber"); _unrec->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight, true, "amount"); _unrec->hide(); _unrecLit->hide(); sBankaccntChanged(); } dspBankrecHistory::~dspBankrecHistory() { // no need to delete child widgets, Qt does it all for us } void dspBankrecHistory::languageChange() { retranslateUi(this); } bool dspBankrecHistory::setParams(ParameterList ¶ms) { params.append("bankaccnt_id", _bankaccnt->id()); params.append("bankrec_id", _bankrec->id()); params.append("openingBalance" , tr("Opening Balance")); params.append("Checks" , tr("Checks")); params.append("Deposits" , tr("Deposits")); params.append("Adjustments" , tr("Adjustments")); params.append("closingBalance" , tr("Closing Balance")); params.append("reconciled" , tr("Reconciled")); params.append("unreconciled" , tr("Unreconciled")); if (_showUnreconciled->isChecked()) params.append("showUnreconciled"); return true; } void dspBankrecHistory::sPrint() { ParameterList params; setParams(params); orReport report("BankrecHistory", params); if(report.isValid()) report.print(); else report.reportError(this); } void dspBankrecHistory::sBankaccntChanged() { XSqlQuery bq; bq.prepare( "SELECT bankrec_id, (formatDate(bankrec_opendate) || '-' || formatDate(bankrec_enddate)) " "FROM bankrec " "WHERE (bankrec_bankaccnt_id=:bankaccnt_id) " "ORDER BY bankrec_opendate DESC, bankrec_enddate DESC; "); bq.bindValue(":bankaccnt_id", _bankaccnt->id()); bq.exec(); _bankrec->populate(bq); } void dspBankrecHistory::sFillList() { XSqlQuery dspFillList; dspFillList.prepare( "SELECT bankrec_username, " " bankrec_posted," " bankrec_postdate," " bankrec_opendate," " bankrec_enddate," " bankrec_openbal," " bankrec_endbal " "FROM bankrec " "WHERE (bankrec_id=:bankrecid);" ); dspFillList.bindValue(":bankrecid", _bankrec->id()); dspFillList.exec(); if(dspFillList.first()) { _poster->setText(dspFillList.value("bankrec_username").toString()); _postdate->setDate(dspFillList.value("bankrec_postdate").toDate()); ParameterList params; params.append("treeView", true); if (! setParams(params)) return; MetaSQLQuery mql = mqlLoad("bankrecHistory", "reconciled"); dspFillList = mql.toQuery(params); _rec->populate(dspFillList, true); if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } else _rec->expandAll(); if (_showUnreconciled->isChecked()) { ParameterList params2; params2.append("treeView", true); if (! setParams(params2)) return; MetaSQLQuery mql2 = mqlLoad("bankrecHistory", "unreconciled"); dspFillList = mql2.toQuery(params2); _unrec->populate(dspFillList, true); if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } else _unrec->expandAll(); } } } qt-client-4.1.0/guiclient/dspBankrecHistory.h000066400000000000000000000017701217451700100212110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPBANKRECHISTORY_H #define DSPBANKRECHISTORY_H #include "xwidget.h" #include "ui_dspBankrecHistory.h" class dspBankrecHistory : public XWidget, public Ui::dspBankrecHistory { Q_OBJECT public: dspBankrecHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspBankrecHistory(); public slots: virtual bool setParams(ParameterList &); virtual void sPrint(); virtual void sBankaccntChanged(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // DSPBANKRECHISTORY_H qt-client-4.1.0/guiclient/dspBankrecHistory.ui000066400000000000000000000275741217451700100214110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspBankrecHistory 0 0 800 600 Bank Reconciliation History 12 12 Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Date Range: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 13 20 Show unreconciled as of posting true Qt::Horizontal 40 20 0 0 &Close Query &Print Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Posted By: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter N/A Qt::Horizontal QSizePolicy::Fixed 15 20 Date Posted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal QSizePolicy::Expanding 13 20 Reconciled: Unreconciled: DLineEdit QWidget
    datecluster.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _bankaccnt _bankrec _rec _print _close _close clicked() dspBankrecHistory close() 20 20 20 20 _showUnreconciled toggled(bool) _unrec setVisible(bool) 219 96 387 479 _showUnreconciled toggled(bool) _unrecLit setVisible(bool) 219 96 387 373 _showUnreconciled toggled(bool) _unrec clear() 225 96 399 479 _showUnreconciled toggled(bool) _rec clear() 225 96 399 268
    qt-client-4.1.0/guiclient/dspBillingSelections.cpp000066400000000000000000000157011217451700100222250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspBillingSelections.h" #include #include #include #include #include #include #include "mqlutil.h" #include #include "selectOrderForBilling.h" #include "printInvoices.h" #include "createInvoices.h" dspBillingSelections::dspBillingSelections(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_cobill, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_cancel, SIGNAL(clicked()), this, SLOT(sCancel())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_postAll, SIGNAL(clicked()), this, SLOT(sPostAll())); connect(_cobill, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_cobill, SIGNAL(valid(bool)), _cancel, SLOT(setEnabled(bool))); connect(_cobill, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _cobill->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number" ); _cobill->addColumn(tr("Cust. #"), _itemColumn, Qt::AlignLeft, true, "cust_number" ); _cobill->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name" ); _cobill->addColumn(tr("Subtotal"), _moneyColumn, Qt::AlignLeft, false, "subtotal" ); _cobill->addColumn(tr("Misc."), _moneyColumn, Qt::AlignLeft, true, "cobmisc_misc" ); _cobill->addColumn(tr("Freight"), _moneyColumn, Qt::AlignLeft, true, "cobmisc_freight" ); _cobill->addColumn(tr("Tax"), _moneyColumn, Qt::AlignLeft, true, "cobmisc_tax" ); _cobill->addColumn(tr("Total"), _moneyColumn, Qt::AlignLeft, true, "total" ); _cobill->addColumn(tr("Payment Rec'd"), _bigMoneyColumn, Qt::AlignLeft, true, "cobmisc_payment" ); if (_privileges->check("PostARDocuments")) connect(_cobill, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); connect(omfgThis, SIGNAL(billingSelectionUpdated(int, int)), this, SLOT(sFillList())); sFillList(); } dspBillingSelections::~dspBillingSelections() { // no need to delete child widgets, Qt does it all for us } void dspBillingSelections::languageChange() { retranslateUi(this); } void dspBillingSelections::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *) { QAction *menuItem; pMenu->addAction("Edit...", this, SLOT(sEdit())); pMenu->addAction("Cancel...", this, SLOT(sCancel())); menuItem = pMenu->addAction("Create Invoice", this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostARDocuments")); } void dspBillingSelections::sFillList() { XSqlQuery dspFillList; MetaSQLQuery mql = mqlLoad("billingSelections", "detail"); ParameterList params; dspFillList = mql.toQuery(params); _cobill->populate(dspFillList); } void dspBillingSelections::sPostAll() { createInvoices newdlg(this, "", TRUE); newdlg.exec(); } void dspBillingSelections::sPost() { XSqlQuery dspPost; int soheadid = -1; dspPost.prepare("SELECT cobmisc_cohead_id AS sohead_id " "FROM cobmisc " "WHERE (cobmisc_id = :cobmisc_id)"); dspPost.bindValue(":cobmisc_id", _cobill->id()); dspPost.exec(); if (dspPost.first()) { soheadid = dspPost.value("sohead_id").toInt(); } else if (dspPost.lastError().type() != QSqlError::NoError) { systemError(this, dspPost.lastError().databaseText(), __FILE__, __LINE__); return; } dspPost.prepare("SELECT createInvoice(:cobmisc_id) AS result;"); dspPost.bindValue(":cobmisc_id", _cobill->id()); dspPost.exec(); if (dspPost.first()) { int result = dspPost.value("result").toInt(); if (result == -5) QMessageBox::critical( this, tr("Cannot Create one or more Invoices"), tr( "The G/L Account Assignments for the selected Invoice are not configured correctly.\n" "Because of this, G/L Transactions cannot be created for this Invoices.\n" "You must contact your Systems Administrator to have this corrected before you may Create this Invoice." ) ); else if (result < 0) systemError( this, tr("A System Error occurred at %1::%2, Error #%3.") .arg(__FILE__) .arg(__LINE__) .arg(dspPost.value("result").toInt()) ); omfgThis->sInvoicesUpdated(result, TRUE); omfgThis->sSalesOrdersUpdated(soheadid); omfgThis->sBillingSelectionUpdated(soheadid, TRUE); sFillList(); } else if (dspPost.lastError().type() != QSqlError::NoError) { systemError(this, dspPost.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspBillingSelections::sNew() { ParameterList params; params.append("mode", "new"); selectOrderForBilling *newdlg = new selectOrderForBilling(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspBillingSelections::sEdit() { XSqlQuery dspEdit; ParameterList params; params.append("mode", "edit"); dspEdit.prepare("SELECT cobmisc_cohead_id AS sohead_id " "FROM cobmisc " "WHERE (cobmisc_id = :cobmisc_id)"); dspEdit.bindValue(":cobmisc_id", _cobill->id()); dspEdit.exec(); if (dspEdit.first()) { int sohead_id = dspEdit.value("sohead_id").toInt(); params.append("sohead_id", sohead_id); } else if (dspEdit.lastError().type() != QSqlError::NoError) { systemError(this, dspEdit.lastError().databaseText(), __FILE__, __LINE__); return; } selectOrderForBilling *newdlg = new selectOrderForBilling(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspBillingSelections::sCancel() { XSqlQuery dspCancel; if ( QMessageBox::critical( this, tr("Cancel Billing"), tr("Are you sure that you want to cancel billing for the selected order?"), tr("&Yes"), tr("&No"), QString::null, 0, 1) == 0) { dspCancel.prepare( "SELECT cancelBillingSelection(cobmisc_id) AS result " "FROM cobmisc " "WHERE (cobmisc_id=:cobmisc_id);" ); dspCancel.bindValue(":cobmisc_id", _cobill->id()); dspCancel.exec(); sFillList(); } } void dspBillingSelections::sPrint() { orReport report("BillingSelections"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/dspBillingSelections.h000066400000000000000000000022071217451700100216670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPBILLINGSELECTIONS_H #define DSPBILLINGSELECTIONS_H #include "xwidget.h" #include "ui_dspBillingSelections.h" class dspBillingSelections : public XWidget, public Ui::dspBillingSelections { Q_OBJECT public: dspBillingSelections(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspBillingSelections(); public slots: virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * ); virtual void sFillList(); virtual void sPostAll(); virtual void sPost(); virtual void sNew(); virtual void sEdit(); virtual void sCancel(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // DSPBILLINGSELECTIONS_H qt-client-4.1.0/guiclient/dspBillingSelections.ui000066400000000000000000000175671217451700100220740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspBillingSelections 0 0 800 600 Billing Selections 12 12 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Close &Print 0 0 Billing List: 7 0 0 0 0 100 0 0 5 0 Create &All Create &Invoice 0 0 &New &Edit &Cancel Qt::Vertical QSizePolicy::Expanding 10 31 XTreeWidget QTreeWidget
    xtreewidget.h
    _cobill _print _close parameter.h _close clicked() dspBillingSelections close() 20 20 20 20 _cobill valid(bool) _edit setEnabled(bool) 20 20 20 20 _cobill valid(bool) _cancel setEnabled(bool) 20 20 20 20 _cobill itemSelected(int) _edit animateClick() 20 20 20 20
    qt-client-4.1.0/guiclient/dspCashReceipts.cpp000066400000000000000000000230671217451700100211750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCashReceipts.h" #include #include #include #include #include #include "arOpenItem.h" #include "cashReceipt.h" #include "storedProcErrorLookup.h" dspCashReceipts::dspCashReceipts(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspCashReceipts", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Cash Receipts")); setListLabel(tr("Cash Receipts")); setReportName("CashReceipts"); setMetaSQLOptions("cashReceipts", "detail"); setNewVisible(true); setUseAltId(true); connect(_applications, SIGNAL(toggled(bool)), list(), SLOT(clear())); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _dates->setStartDate(QDate().currentDate().addDays(-90)); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); list()->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, true, "cashrcpt_number" ); list()->addColumn(tr("Source"), _itemColumn, Qt::AlignLeft, true, "source" ); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter, true, "posted" ); list()->addColumn(tr("Voided"), _ynColumn, Qt::AlignCenter, true, "voided" ); list()->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "postdate" ); list()->addColumn(tr("Apply-To"), -1, Qt::AlignLeft, true, "target" ); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "applied" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currAbbr" ); list()->addColumn(tr("Base Amount"), _moneyColumn, Qt::AlignRight, true, "base_applied" ); newAction()->setEnabled(_privileges->check("MaintainCashReceipts")); } bool dspCashReceipts::setParams(ParameterList &pParams) { if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Start Date"), tr("You must enter a valid Start Date.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter End Date"), tr("You must enter a valid End Date.") ); _dates->setFocus(); return false; } _customerSelector->appendValue(pParams); _dates->appendValue(pParams); pParams.append("creditMemo", tr("Credit Memo")); pParams.append("debitMemo", tr("Debit Memo")); pParams.append("cashdeposit", tr("Customer Deposit")); pParams.append("invoice", tr("Invoice")); pParams.append("cash", tr("Cash")); pParams.append("check", tr("Check")); pParams.append("certifiedCheck", tr("Cert. Check")); pParams.append("masterCard", tr("Master Card")); pParams.append("visa", tr("Visa")); pParams.append("americanExpress", tr("AmEx")); pParams.append("discoverCard", tr("Discover")); pParams.append("otherCreditCard", tr("Other C/C")); pParams.append("wireTransfer", tr("Wire Trans.")); pParams.append("other", tr("Other")); pParams.append("unapplied", tr("Customer Deposit")); pParams.append("unposted", tr("Unposted")); pParams.append("voided", tr("Voided")); if (_applications->isChecked()) { list()->hideColumn("cashrcpt_number"); pParams.append("LegacyDisplayMode"); } else list()->showColumn("cashrcpt_number"); pParams.append("includeFormatted"); return true; } void dspCashReceipts::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem = 0; if (list()->id() > -1) { // Cash Receipt if (!list()->currentItem()->rawValue("posted").toBool() && !list()->currentItem()->rawValue("voided").toBool()) { menuItem = pMenu->addAction(tr("Edit Cash Receipt..."), this, SLOT(sEditCashrcpt())); menuItem->setEnabled(_privileges->check("MaintainCashReceipts")); } menuItem = pMenu->addAction(tr("View Cash Receipt..."), this, SLOT(sViewCashrcpt())); menuItem->setEnabled(_privileges->check("ViewCashReceipts") || _privileges->check("MaintainCashReceipts")); if (!list()->currentItem()->rawValue("voided").toBool()) { if (!list()->currentItem()->rawValue("posted").toBool()) { menuItem = pMenu->addAction(tr("Post Cash Receipt"), this, SLOT(sPostCashrcpt())); menuItem->setEnabled(_privileges->check("PostCashReceipts")); } else if (!list()->altId()) { menuItem = pMenu->addAction(tr("Void Posted Cash Receipt"), this, SLOT(sReversePosted())); menuItem->setEnabled(_privileges->check("VoidPostedCashReceipts")); } } // Open Item if (list()->currentItem()->id("target") > -1 ) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit Receivable Item..."), this, SLOT(sEditAropen())); menuItem->setEnabled(_privileges->check("EditAROpenItem")); menuItem = pMenu->addAction(tr("View Receivable Item..."), this, SLOT(sViewAropen())); menuItem->setEnabled(_privileges->check("ViewAROpenItems") || _privileges->check("EditAROpenItem")); } } } void dspCashReceipts::sEditAropen() { ParameterList params; params.append("mode", "edit"); params.append("aropen_id", list()->currentItem()->id("target")); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspCashReceipts::sViewAropen() { ParameterList params; params.append("mode", "view"); params.append("aropen_id", list()->currentItem()->id("target")); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void dspCashReceipts::sNew() { sNewCashrcpt(); } void dspCashReceipts::sNewCashrcpt() { ParameterList params; params.append("mode", "new"); if (_customerSelector->isSelectedCust()) params.append("cust_id", _customerSelector->custId()); cashReceipt *newdlg = new cashReceipt(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspCashReceipts::sEditCashrcpt() { ParameterList params; params.append("mode", "edit"); params.append("cashrcpt_id", list()->currentItem()->id("source")); cashReceipt *newdlg = new cashReceipt(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspCashReceipts::sViewCashrcpt() { ParameterList params; params.append("mode", "view"); params.append("cashrcpt_id", list()->currentItem()->id("source")); cashReceipt *newdlg = new cashReceipt(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspCashReceipts::sPostCashrcpt() { XSqlQuery dspPostCashrcpt; int journalNumber = -1; XSqlQuery tx; tx.exec("BEGIN;"); dspPostCashrcpt.exec("SELECT fetchJournalNumber('C/R') AS journalnumber;"); if (dspPostCashrcpt.first()) journalNumber = dspPostCashrcpt.value("journalnumber").toInt(); else if (dspPostCashrcpt.lastError().type() != QSqlError::NoError) { systemError(this, dspPostCashrcpt.lastError().databaseText(), __FILE__, __LINE__); return; } dspPostCashrcpt.prepare("SELECT postCashReceipt(:cashrcpt_id, :journalNumber) AS result;"); dspPostCashrcpt.bindValue(":cashrcpt_id", list()->currentItem()->id("source")); dspPostCashrcpt.bindValue(":journalNumber", journalNumber); dspPostCashrcpt.exec(); if (dspPostCashrcpt.first()) { int result = dspPostCashrcpt.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postCashReceipt", result), __FILE__, __LINE__); tx.exec("ROLLBACK;"); return; } } else if (dspPostCashrcpt.lastError().type() != QSqlError::NoError) { systemError(this, dspPostCashrcpt.lastError().databaseText(), __FILE__, __LINE__); tx.exec("ROLLBACK;"); return; } tx.exec("COMMIT;"); omfgThis->sCashReceiptsUpdated(list()->currentItem()->id("source"), TRUE); sFillList(); } void dspCashReceipts::sReversePosted() { XSqlQuery dspReversePosted; if (QMessageBox::warning(this, tr("Reverse Entire Posting?"), tr("

    This will reverse all applications related " "to this cash receipt. Are you sure you want " "to do this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { dspReversePosted.prepare("SELECT reverseCashReceipt(:cashrcpt_id, fetchJournalNumber('C/R')) AS result;"); dspReversePosted.bindValue(":cashrcpt_id", list()->currentItem()->id("source")); dspReversePosted.exec(); if (dspReversePosted.first()) { int result = dspReversePosted.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("reverseCashReceipt", result), __FILE__, __LINE__); return; } } else if (dspReversePosted.lastError().type() != QSqlError::NoError) { systemError(this, dspReversePosted.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } qt-client-4.1.0/guiclient/dspCashReceipts.h000066400000000000000000000022451217451700100206350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCASHRECEIPTS_H #define DSPCASHRECEIPTS_H #include "display.h" #include #include "ui_dspCashReceipts.h" class dspCashReceipts : public display, public Ui::dspCashReceipts { Q_OBJECT public: dspCashReceipts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual void sEditAropen(); virtual void sEditCashrcpt(); virtual void sNew(); virtual void sNewCashrcpt(); // Legacy code virtual void sPostCashrcpt(); virtual void sViewAropen(); virtual void sViewCashrcpt(); virtual void sReversePosted(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // DSPCASHRECEIPTS_H qt-client-4.1.0/guiclient/dspCashReceipts.ui000066400000000000000000000055521217451700100210270ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCashReceipts 0 0 565 235 Cash Receipts Distribution Display By Applications Cash Receipts true Qt::Vertical QSizePolicy::Fixed 20 5 CustomerSelector QWidget

    customerselector.h
    DateCluster QWidget
    datecluster.h
    _dates qt-client-4.1.0/guiclient/dspCheckRegister.cpp000066400000000000000000000204011217451700100213270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCheckRegister.h" #include #include #include #include #include #include #include #include #include "guiclient.h" #include "mqlutil.h" #include "storedProcErrorLookup.h" dspCheckRegister::dspCheckRegister(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_check, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_vendRB, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_taxauthRB, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_custRB, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); _bankaccnt->setType(XComboBox::APBankAccounts); _check->addColumn(tr("Void"), _ynColumn, Qt::AlignCenter, true, "checkhead_void" ); _check->addColumn(tr("Misc."), _ynColumn, Qt::AlignCenter, true, "checkhead_misc" ); _check->addColumn(tr("Prt'd"), _ynColumn, Qt::AlignCenter, true, "checkhead_printed" ); _check->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter, true, "checkhead_posted" ); _check->addColumn(tr("Chk./Vchr."), _itemColumn, Qt::AlignCenter, true, "number" ); _check->addColumn(tr("Recipient"), -1, Qt::AlignLeft, true, "description" ); _check->addColumn(tr("Check Date") , _dateColumn, Qt::AlignCenter, true, "checkdate" ); _check->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "amount" ); _check->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight, true, "currAbbr" ); _check->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight, true, "base_amount" ); if (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")) _check->addColumn(tr("EFT Batch"), _orderColumn, Qt::AlignRight, true, "checkhead_ach_batch"); _check->sortByColumn(4); sHandleButtons(); _recipGroup->setChecked(false); _total->setPrecision(omfgThis->moneyVal()); if (omfgThis->singleCurrency()) { _check->hideColumn("currAbbr"); _totalCurr->hide(); } } dspCheckRegister::~dspCheckRegister() { // no need to delete child widgets, Qt does it all for us } void dspCheckRegister::languageChange() { retranslateUi(this); } bool dspCheckRegister::setParams(ParameterList &pParams) { if(!_dates->allValid()) { QMessageBox::information( this, tr("Invalid Dates"), tr("

    Invalid dates specified. Please specify a " "valid date range.") ); _dates->setFocus(); return false; } if(_recipGroup->isChecked()) { pParams.append("recip", 100); if(_vendRB->isChecked()) { pParams.append("recip_type_v", 100); if(_vend->isValid()) { pParams.append("recip_id", _vend->id()); } } if(_custRB->isChecked()) { pParams.append("recip_type_c", 100); if(_cust->isValid()) { pParams.append("recip_id", _cust->id()); } } if(_taxauthRB->isChecked()) { pParams.append("recip_type_t", 100); pParams.append("recip_id", _taxauth_2->id()); } } if(_checkNumber->text() != "") { pParams.append("check_number", _checkNumber->text()); } pParams.append("bankaccnt_id", _bankaccnt->id()); _dates->appendValue(pParams); if(_showDetail->isChecked()) pParams.append("showDetail"); return true; } void dspCheckRegister::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("CheckRegister", params); if(report.isValid()) report.print(); else report.reportError(this); } void dspCheckRegister::sFillList() { XSqlQuery dspFillList; MetaSQLQuery mql = mqlLoad("checkRegister", "detail"); ParameterList params; if (!setParams(params)) return; dspFillList = mql.toQuery(params); _check->populate(dspFillList, true); if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } if(_showDetail->isChecked()) _check->expandAll(); QString tots("SELECT SUM(currToCurr(checkhead_curr_id, bankaccnt_curr_id," " checkhead_amount, checkhead_checkdate)) AS amount, " " currConcat(bankaccnt_curr_id) AS currAbbr " " FROM bankaccnt LEFT OUTER JOIN" " checkhead ON ((bankaccnt_id=checkhead_bankaccnt_id)" " AND (checkhead_checkdate BETWEEN AND ) " " AND (NOT checkhead_void)" " " " AND (CAST(checkhead_number AS text) ~ )" " " " " " " " AND (checkhead_recip_type = 'V' )" " " " " " AND (checkhead_recip_type = 'C' )" " " " " " AND (checkhead_recip_type = 'T' )" " " " " " AND (checkhead_recip_id = )" " " " )" " LEFT OUTER JOIN " " checkrecip ON ((checkhead_recip_id=checkrecip_id) " " AND (checkhead_recip_type=checkrecip_type)) " " WHERE(bankaccnt_id=) " "GROUP BY bankaccnt_curr_id;" ); MetaSQLQuery totm(tots); dspFillList = totm.toQuery(params); // reused from above if(dspFillList.first()) { _total->setDouble(dspFillList.value("amount").toDouble()); _totalCurr->setText(dspFillList.value("currAbbr").toString()); } else if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspCheckRegister::sPopulateMenu( QMenu * pMenu ) { QAction *menuItem; if(_check->altId() == 1) { menuItem = pMenu->addAction(tr("Void Posted Check..."), this, SLOT(sVoidPosted())); menuItem->setEnabled(_privileges->check("VoidPostedAPCheck")); } } void dspCheckRegister::sVoidPosted() { XSqlQuery dspVoidPosted; ParameterList params; XDateInputDialog newdlg(this, "", TRUE); params.append("label", tr("On what date did you void this check?")); newdlg.set(params); int returnVal = newdlg.exec(); if (returnVal == XDialog::Accepted) { QDate voidDate = newdlg.getDate(); dspVoidPosted.prepare("SELECT voidPostedCheck(:check_id, fetchJournalNumber('AP-CK')," " DATE :voidDate) AS result;"); dspVoidPosted.bindValue(":check_id", _check->id()); dspVoidPosted.bindValue(":voidDate", voidDate); dspVoidPosted.exec(); if (dspVoidPosted.first()) { int result = dspVoidPosted.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("voidPostedCheck", result), __FILE__, __LINE__); return; } } else if (dspVoidPosted.lastError().type() != QSqlError::NoError) { systemError(this, dspVoidPosted.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } void dspCheckRegister::sHandleButtons() { if (_vendRB->isChecked()) { _widgetStack->setCurrentIndex(0); } else if (_custRB->isChecked()) { _widgetStack->setCurrentIndex(1); } else { _widgetStack->setCurrentIndex(2); } } qt-client-4.1.0/guiclient/dspCheckRegister.h000066400000000000000000000020711217451700100207770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCHECKREGISTER_H #define DSPCHECKREGISTER_H #include "xwidget.h" #include "ui_dspCheckRegister.h" class dspCheckRegister : public XWidget, public Ui::dspCheckRegister { Q_OBJECT public: dspCheckRegister(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspCheckRegister(); virtual bool setParams(ParameterList &); public slots: virtual void sPrint(); virtual void sFillList(); virtual void sVoidPosted(); virtual void sHandleButtons(); protected slots: virtual void languageChange(); virtual void sPopulateMenu(QMenu *); }; #endif // DSPCHECKREGISTER_H qt-client-4.1.0/guiclient/dspCheckRegister.ui000066400000000000000000000447001217451700100211720ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCheckRegister 0 0 806 600 Check Register 12 12 0 0 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Check Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _bankaccnt Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 0 20 Show only checks written to: true 12 Vendor true Customer Tax Authority 16 75 0 Qt::StrongFocus Vendor #: Qt::Vertical 20 0 true Qt::StrongFocus Qt::Vertical 20 0 Tax Authority #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::TaxAuths XComboBox::None Qt::Vertical 20 0 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Qt::Vertical 20 0 Show Detail Qt::Horizontal 17 20 0 0 &Close &Query &Print Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Plain 0 0 Checks _check true 0 0 Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 0.00 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 50 0 USD CustCluster QWidget

    custcluster.h
    DateCluster QWidget
    datecluster.h
    VendorCluster QWidget
    vendorcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _bankaccnt _checkNumber _dates _showDetail _recipGroup _vendRB _custRB _taxauthRB _vend _check _query _print _close _taxauth_2 _cust _close clicked() dspCheckRegister close() 538 32 20 20 qt-client-4.1.0/guiclient/dspCountSlipEditList.cpp000066400000000000000000000152361217451700100222010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCountSlipEditList.h" #include #include #include #include #include #include #include "countTagList.h" #include "countSlip.h" #include #include "mqlutil.h" dspCountSlipEditList::dspCountSlipEditList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_cntslip, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_countTagList, SIGNAL(clicked()), this, SLOT(sCountTagList())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_postAll, SIGNAL(clicked()), this, SLOT(sPostAll())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); #ifndef Q_WS_MAC _countTagList->setMaximumWidth(25); #endif _item->setReadOnly(TRUE); _cntslip->addColumn(tr("User"), _dateColumn, Qt::AlignCenter,true, "user"); _cntslip->addColumn(tr("#"), _itemColumn, Qt::AlignLeft, true, "cntslip_number"); _cntslip->addColumn(tr("Location"),_itemColumn, Qt::AlignLeft, true, "locname"); _cntslip->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "cntslip_lotserial"); _cntslip->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter,true, "cntslip_posted"); _cntslip->addColumn(tr("Entered"), _itemColumn, Qt::AlignCenter,true, "cntslip_entered"); _cntslip->addColumn(tr("Slip Qty."),_qtyColumn, Qt::AlignRight, true, "cntslip_qty"); if (_privileges->check("EnterCountSlips")) { connect(_cntslip, SIGNAL(valid(bool)), this, SLOT(sHandleButtons(bool))); connect(_item, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); } if (_privileges->check("DeleteCountSlips")) connect(_cntslip, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); if (_privileges->check("PostCountSlips")) { connect(_cntslip, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); _postAll->setEnabled(TRUE); } if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } dspCountSlipEditList::~dspCountSlipEditList() { // no need to delete child widgets, Qt does it all for us } void dspCountSlipEditList::languageChange() { retranslateUi(this); } enum SetResponse dspCountSlipEditList::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("cnttag_id", &valid); if (valid) { _cnttagid = param.toInt(); populate(); } return NoError; } void dspCountSlipEditList::sPrint() { ParameterList params; params.append("cnttag_id", _cnttagid); orReport report("CountSlipEditList", params); if (report.isValid()) report.print(); else report.reportError(this); } void dspCountSlipEditList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { QAction *menuItem; if (((XTreeWidgetItem *)pSelected)->rawValue("cntslip_posted") == 0) { menuItem = pMenu->addAction("Edit Count Slip...", this, SLOT(sEdit())); if (!_privileges->check("EnterCountSlips")) menuItem->setEnabled(false); menuItem = pMenu->addAction("Post Count Slip", this, SLOT(sPost())); if (!_privileges->check("PostCountSlips")) menuItem->setEnabled(false); } } void dspCountSlipEditList::sNew() { ParameterList params; params.append("mode", "new"); params.append("cnttag_id", _cnttagid); countSlip newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspCountSlipEditList::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("cntslip_id", _cntslip->id()); countSlip newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspCountSlipEditList::sDelete() { XSqlQuery dspDelete; if (QMessageBox::question( this, tr("Delete Count Slip?"), tr("Are you sure that you want to delete the selected Count Slip?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { dspDelete.prepare( "DELETE FROM cntslip " " WHERE(cntslip_id=:cntslip_id);" ); dspDelete.bindValue(":cntslip_id", _cntslip->id()); dspDelete.exec(); sFillList(); } } void dspCountSlipEditList::sPost() { XSqlQuery dspPost; dspPost.prepare("SELECT postCountSlip(:cntslip_id);"); dspPost.bindValue(":cntslip_id", _cntslip->id()); dspPost.exec(); sFillList(); } void dspCountSlipEditList::sPostAll() { XSqlQuery dspPostAll; dspPostAll.prepare( "SELECT postCountSlip(cntslip_id) " "FROM cntslip " "WHERE ( (NOT cntslip_posted)" " AND (cntslip_cnttag_id=:cnttag_id) );" ); dspPostAll.bindValue(":cnttag_id", _cnttagid); dspPostAll.exec(); sFillList(); } void dspCountSlipEditList::sCountTagList() { ParameterList params; params.append("cnttag_id", _cnttagid); params.append("tagType", cUnpostedCounts); countTagList newdlg(this, "", TRUE); newdlg.set(params); _cnttagid = newdlg.exec(); populate(); } void dspCountSlipEditList::populate() { XSqlQuery dsppopulate; dsppopulate.prepare( "SELECT invcnt_tagnumber, invcnt_itemsite_id " "FROM invcnt " "WHERE (invcnt_id=:cnttag_id);" ); dsppopulate.bindValue(":cnttag_id", _cnttagid); dsppopulate.exec(); if (dsppopulate.first()) { _countTagNumber->setText(dsppopulate.value("invcnt_tagnumber").toString()); _item->setItemsiteid(dsppopulate.value("invcnt_itemsite_id").toInt()); } sFillList(); } void dspCountSlipEditList::sFillList() { XSqlQuery dspFillList; MetaSQLQuery mql = mqlLoad("countSlip", "detail"); ParameterList params; params.append("cnttag_id", _cnttagid); dspFillList = mql.toQuery(params); _cntslip->populate(dspFillList); } void dspCountSlipEditList::sHandleButtons(bool valid) { if (valid) { // Handle Edit Button if (_cntslip->currentItem()->rawValue("cntslip_posted") == 0) _edit->setEnabled(true); else _edit->setEnabled(false); } else _edit->setEnabled(false); } qt-client-4.1.0/guiclient/dspCountSlipEditList.h000066400000000000000000000026061217451700100216430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOUNTSLIPEDITLIST_H #define DSPCOUNTSLIPEDITLIST_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_dspCountSlipEditList.h" class dspCountSlipEditList : public XWidget, public Ui::dspCountSlipEditList { Q_OBJECT public: dspCountSlipEditList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspCountSlipEditList(); virtual void populate(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPrint(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sPost(); virtual void sPostAll(); virtual void sCountTagList(); virtual void sFillList(); virtual void sHandleButtons(bool); protected slots: virtual void languageChange(); private: int _cnttagid; }; #endif // DSPCOUNTSLIPEDITLIST_H qt-client-4.1.0/guiclient/dspCountSlipEditList.ui000066400000000000000000000372351217451700100220370ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCountSlipEditList 0 0 753 400 Count Slip Edit List 5 0 0 0 0 5 0 0 0 0 0 0 0 0 0 5 0 0 0 0 5 0 0 0 0 Count &Tag #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _countTagList false 100 0 ... Qt::Vertical QSizePolicy::Expanding 0 20 Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 20 20 5 0 0 0 0 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 0 0 0 5 0 0 0 0 &Close &Print Qt::Vertical QSizePolicy::Expanding 20 20 0 1 QFrame::NoFrame QFrame::Plain 0 0 0 0 0 Count Slips: 7 0 0 0 0 0 0 0 100 0 0 0 0 0 false &New false &Edit false &Delete false P&ost false Post &All Qt::Vertical QSizePolicy::Expanding 20 20 ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _countTagNumber _countTagList _item _warehouse _cntslip _new _edit _delete _post _postAll _print _close _close clicked() dspCountSlipEditList close() 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/dspCountTagEditList.cpp000066400000000000000000000443631217451700100220100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCountTagEditList.h" #include #include #include #include #include #include #include #include #include #include "mqlutil.h" #include "countSlip.h" #include "countTag.h" #include "dspInventoryHistory.h" #include "dspCountSlipEditList.h" #include "storedProcErrorLookup.h" dspCountTagEditList::dspCountTagEditList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _highlightGroupInt = new QButtonGroup(this); _highlightGroupInt->addButton(_noHighlight); _highlightGroupInt->addButton(_highlightValue); _highlightGroupInt->addButton(_highlightPercent); _codeGroup = new QButtonGroup(this); _codeGroup->addButton(_plancode); _codeGroup->addButton(_classcode); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_showSlips, SIGNAL(clicked()), this, SLOT(sToggleList())); connect(_enterSlip, SIGNAL(clicked()), this, SLOT(sEnterCountSlip())); connect(_cnttag, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool))); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_codeGroup, SIGNAL(buttonClicked(int)), this, SLOT(sParameterTypeChanged())); _parameter->setType(ParameterGroup::ClassCode); _variancePercent->setValidator(omfgThis->percentVal()); _cnttag->setRootIsDecorated(TRUE); _cnttag->addColumn(tr("Pri."), (_whsColumn + 10), Qt::AlignCenter,true, "invcnt_priority"); _cnttag->addColumn(tr("Tag/Slip #"),_orderColumn, Qt::AlignRight, true, "tagnumber"); _cnttag->addColumn(tr("Tag Date"), _dateColumn, Qt::AlignCenter,true, "tagdate"); _cnttag->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "item_number"); _cnttag->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); _cnttag->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _cnttag->addColumn(tr("Location"), _ynColumn, Qt::AlignCenter,true, "loc_specific"); _cnttag->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh"); _cnttag->addColumn(tr("NN QOH"), _qtyColumn, Qt::AlignRight, true, "nnqoh"); _cnttag->addColumn(tr("Count Qty."), _qtyColumn, Qt::AlignRight, true, "qohafter"); _cnttag->addColumn(tr("Variance"), _qtyColumn, Qt::AlignRight, true, "variance"); _cnttag->addColumn(tr("%"), _prcntColumn, Qt::AlignRight, true, "varianceprcnt"); _cnttag->addColumn(tr("Amount"), _costColumn, Qt::AlignRight, true, "variancecost"); _cnttag->setIndentation(10); if (_privileges->check("EnterCountTags")) { connect(_cnttag, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_cnttag, SIGNAL(valid(bool)), this, SLOT(sHandleButtons(bool))); } if (_privileges->check("DeleteCountTags")) connect(_cnttag, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); if (_privileges->check("PostCountTags")) connect(_cnttag, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); if (_privileges->check("EnterCountSlips")) connect(_cnttag, SIGNAL(valid(bool)), _enterSlip, SLOT(setEnabled(bool))); } dspCountTagEditList::~dspCountTagEditList() { // no need to delete child widgets, Qt does it all for us } void dspCountTagEditList::languageChange() { retranslateUi(this); } void dspCountTagEditList::sToggleList() { if (_showSlips->isChecked()) _cnttag->setSelectionMode(QAbstractItemView::SingleSelection); else _cnttag->setSelectionMode(QAbstractItemView::ExtendedSelection); sFillList(); } void dspCountTagEditList::setParams(ParameterList ¶ms) { if (_parameter->type() == ParameterGroup::ClassCode) params.append("ParameterType", "ClassCode"); else params.append("ParameterType", "PlannerCode"); _warehouse->appendValue(params); _parameter->appendValue(params); params.append("all", tr("All")); params.append("posted", tr("Posted")); params.append("unposted", tr("Unposted")); if (_showSlips->isChecked()) params.append("showSlips"); if (_highlightValue->isChecked()) params.append("varianceValue", _varianceValue->localValue()); else if (_highlightPercent->isChecked()) params.append("variancePercent", _variancePercent->toDouble()); } void dspCountTagEditList::sPrint() { ParameterList params; _parameter->appendValue(params); _warehouse->appendValue(params); params.append("maxTags", 10000); orReport report("CountTagEditList", params); if (report.isValid()) report.print(); else report.reportError(this); } void dspCountTagEditList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { QAction *menuItem; if (((XTreeWidgetItem *)pSelected)->altId() == -1) { menuItem = pMenu->addAction(tr("Enter Count Slip..."), this, SLOT(sEnterCountSlip())); if (!_privileges->check("EnterCountSlips")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Count Slip Edit List..."), this, SLOT(sCountSlipEditList())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Pending Inventory History..."), this, SLOT(sViewInventoryHistory())); if (!_privileges->check("ViewInventoryHistory")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit Count Tag..."), this, SLOT(sEdit())); if (!_privileges->check("EnterCountTags")) menuItem->setEnabled(false); if (pSelected->text(5) != "") { menuItem = pMenu->addAction(tr("Post Count Tag..."), this, SLOT(sPost())); if (!_privileges->check("PostCountTags")) menuItem->setEnabled(false); } menuItem = pMenu->addAction(tr("Delete Count Tag"), this, SLOT(sDelete())); if (!_privileges->check("DeleteCountTags")) menuItem->setEnabled(false); } else { if (pSelected->text(3) == tr("Unposted")) { menuItem = pMenu->addAction(tr("Edit Count Slip..."), this, SLOT(sEdit())); if (!_privileges->check("EnterCountSlips")) menuItem->setEnabled(false); } } } void dspCountTagEditList::sEnterCountSlip() { ParameterList params; params.append("mode", "new"); params.append("cnttag_id", _cnttag->id()); countSlip newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillList(); _searchFor->setFocus(); _searchFor->setSelection(0, _searchFor->text().length()); } } void dspCountTagEditList::sCountSlipEditList() { ParameterList params; params.append("cnttag_id", _cnttag->id()); params.append("run"); dspCountSlipEditList *newdlg = new dspCountSlipEditList(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspCountTagEditList::sViewInventoryHistory() { XSqlQuery dspViewInventoryHistory; dspViewInventoryHistory.prepare( "SELECT invcnt_itemsite_id, invcnt_tagdate " "FROM invcnt " "WHERE (invcnt_id=:invcnt_id);" ); dspViewInventoryHistory.bindValue(":invcnt_id", _cnttag->id()); dspViewInventoryHistory.exec(); if (dspViewInventoryHistory.first()) { ParameterList params; params.append("itemsite_id", dspViewInventoryHistory.value("invcnt_itemsite_id").toInt()); params.append("startDate", dspViewInventoryHistory.value("invcnt_tagdate").toDate()); params.append("endDate", omfgThis->dbDate()); params.append("run"); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (dspViewInventoryHistory.lastError().type() != QSqlError::NoError) { systemError(this, dspViewInventoryHistory.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspCountTagEditList::sEdit() { bool update = FALSE; if ( (_showSlips->isChecked()) && (((XTreeWidgetItem *)_cnttag->currentItem())->altId() == -1) ) sEditTag(); else if (_showSlips->isChecked()) sEditSlip(); else { QList selected = _cnttag->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("mode", "edit"); params.append("cnttag_id", ((XTreeWidgetItem*)(selected[i]))->id()); countTag newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) update = TRUE; } if (update) sFillList(); } } void dspCountTagEditList::sEditTag() { ParameterList params; params.append("mode", "edit"); params.append("cnttag_id", _cnttag->id()); countTag newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspCountTagEditList::sEditSlip() { ParameterList params; params.append("mode", "edit"); params.append("cntslip_id", _cnttag->altId()); countSlip newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspCountTagEditList::sDelete() { XSqlQuery dspDelete; if ( (_showSlips->isChecked()) && (((XTreeWidgetItem *)_cnttag->currentItem())->altId() == -1) ) sDeleteTag(); else if (_showSlips->isChecked()) sDeleteSlip(); else { QList selected = _cnttag->selectedItems(); for (int i = 0; i < selected.size(); i++) { int itemsiteid = -1; dspDelete.prepare( "SELECT cntslip_id FROM cntslip " "WHERE (cntslip_cnttag_id=:cnttag_id);" ); dspDelete.bindValue(":cnttag_id", ((XTreeWidgetItem*)(selected[i]))->id()); dspDelete.exec(); if (dspDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Count tag"), tr("

    There are Count Slips entered for this " "Count Tag. You must delete Count Slips for " "the Count Tag before you may delete this Tag.") ); continue; } else if (dspDelete.lastError().type() != QSqlError::NoError) { systemError(this, dspDelete.lastError().databaseText(), __FILE__, __LINE__); return; } dspDelete.prepare("SELECT itemsite_id" " FROM invcnt JOIN itemsite ON (invcnt_itemsite_id=itemsite_id AND itemsite_freeze) " " WHERE (invcnt_id=:cnttag_id); "); dspDelete.bindValue(":cnttag_id", ((XTreeWidgetItem*)(selected[i]))->id()); if(dspDelete.exec() && dspDelete.first()) itemsiteid = dspDelete.value("itemsite_id").toInt(); else if (dspDelete.lastError().type() != QSqlError::NoError) { systemError(this, dspDelete.lastError().databaseText(), __FILE__, __LINE__); return; } dspDelete.prepare( "DELETE FROM cntslip " "WHERE (cntslip_cnttag_id=:cnttag_id); " "DELETE FROM invcnt " "WHERE (invcnt_id=:cnttag_id); " ); dspDelete.bindValue(":cnttag_id", ((XTreeWidgetItem*)(selected[i]))->id()); dspDelete.exec(); if (dspDelete.lastError().type() != QSqlError::NoError) { systemError(this, dspDelete.lastError().databaseText(), __FILE__, __LINE__); return; } if (itemsiteid != -1) { if (QMessageBox::question(this, tr("Unfreeze Itemsite?"), tr("

    The Itemsite for the Count Tag you " "deleted is frozen. Would you like to " "unfreeze the Itemsite at this time?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) { dspDelete.prepare("SELECT thawItemsite(:itemsite_id) AS result;"); dspDelete.bindValue(":itemsite_id", itemsiteid); dspDelete.exec(); if (dspDelete.first()) { int result = dspDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("thawItemsite", result), __FILE__, __LINE__); continue; } else if (dspDelete.lastError().type() != QSqlError::NoError) { systemError(this, dspDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } } } } sFillList(); } } void dspCountTagEditList::sDeleteTag() { XSqlQuery dspDeleteTag; int itemsiteid = -1; dspDeleteTag.prepare( "SELECT cntslip_id FROM cntslip " "WHERE (cntslip_cnttag_id=:cnttag_id);" ); dspDeleteTag.bindValue(":cnttag_id", _cnttag->id()); dspDeleteTag.exec(); if (dspDeleteTag.first()) { QMessageBox::critical( this, tr("Cannot Delete Count tag"), tr("

    There are Count Slips entered for this count " "tag. You must delete Count Slips for the Count " "Tag before you may delete this Tag.") ); return; } dspDeleteTag.prepare( "SELECT itemsite_id" " FROM invcnt JOIN itemsite ON (invcnt_itemsite_id=itemsite_id AND itemsite_freeze) " " WHERE (invcnt_id=:cnttag_id); "); dspDeleteTag.bindValue(":cnttag_id", _cnttag->id()); if (dspDeleteTag.exec() && dspDeleteTag.first()) itemsiteid = dspDeleteTag.value("itemsite_id").toInt(); else if (dspDeleteTag.lastError().type() != QSqlError::NoError) { systemError(this, dspDeleteTag.lastError().databaseText(), __FILE__, __LINE__); return; } dspDeleteTag.prepare( "DELETE FROM invcnt " "WHERE (invcnt_id=:cnttag_id);" ); dspDeleteTag.bindValue(":cnttag_id", _cnttag->id()); dspDeleteTag.exec(); if (dspDeleteTag.lastError().type() != QSqlError::NoError) { systemError(this, dspDeleteTag.lastError().databaseText(), __FILE__, __LINE__); return; } if(itemsiteid != -1) { if (QMessageBox::question( this, tr("Unfreeze Itemsite?"), tr("

    The Itemsite for the Count Tag you deleted" " is frozen. Would you like to unfreeze the " "Itemsite at this time?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) { dspDeleteTag.prepare("SELECT thawItemsite(:itemsite_id) AS result;"); dspDeleteTag.bindValue(":itemsite_id", itemsiteid); dspDeleteTag.exec(); if (dspDeleteTag.first()) { int result = dspDeleteTag.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("thawItemsite", result), __FILE__, __LINE__); return; } else if (dspDeleteTag.lastError().type() != QSqlError::NoError) { systemError(this, dspDeleteTag.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (dspDeleteTag.lastError().type() != QSqlError::NoError) { systemError(this, dspDeleteTag.lastError().databaseText(), __FILE__, __LINE__); return; } } } sFillList(); } void dspCountTagEditList::sDeleteSlip() { XSqlQuery dspDeleteSlip; dspDeleteSlip.prepare( "DELETE FROM cntslip " "WHERE (cntslip_id=:cntslip_id);" ); dspDeleteSlip.bindValue(":cntslip_id", _cnttag->altId()); dspDeleteSlip.exec(); if (dspDeleteSlip.lastError().type() != QSqlError::NoError) { systemError(this, dspDeleteSlip.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void dspCountTagEditList::sPost() { bool update = FALSE; if ( (_showSlips->isChecked()) && (((XTreeWidgetItem *)_cnttag->currentItem())->altId() == -1) ) sPostTag(); else if (_showSlips->isChecked()) sPostSlip(); else { QList selected = _cnttag->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (((XTreeWidgetItem*)(selected[i]))->altId() == -1) { ParameterList params; params.append("mode", "post"); params.append("cnttag_id", ((XTreeWidgetItem*)(selected[i]))->id()); countTag newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) update = TRUE; } } if (update) sFillList(); } } void dspCountTagEditList::sPostTag() { ParameterList params; params.append("mode", "post"); params.append("cnttag_id", _cnttag->id()); countTag newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspCountTagEditList::sPostSlip() { ParameterList params; params.append("mode", "post"); params.append("cntslip_id", _cnttag->altId()); countSlip newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void dspCountTagEditList::sSearch(const QString &pTarget) { QList search = _cnttag->findItems(pTarget, Qt::MatchStartsWith, 3); if (search.size() > 0) { _cnttag->setCurrentItem(search[0], TRUE); _cnttag->scrollToItem(search[0]); } } void dspCountTagEditList::sFillList() { XSqlQuery dspFillList; MetaSQLQuery mql = mqlLoad("countTag", "detail"); ParameterList params; setParams(params); dspFillList = mql.toQuery(params); _cnttag->populate(dspFillList, true); if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _cnttag->expandAll(); if (_searchFor->text().trimmed().length()) sSearch(_searchFor->text()); } void dspCountTagEditList::sHandleAutoUpdate(bool pAutoUpdate) { if (pAutoUpdate) connect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); else disconnect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); } void dspCountTagEditList::sHandleButtons(bool valid) { if (valid) { // Handle Edit Button if (_cnttag->currentItem()->altId() == -1) // count tag _edit->setEnabled(true); else if (_cnttag->currentItem()->rawValue("item_number") == tr("Unposted")) // unposted count slip _edit->setEnabled(true); else _edit->setEnabled(false); } else _edit->setEnabled(false); } void dspCountTagEditList::sParameterTypeChanged() { if(_plancode->isChecked()) _parameter->setType(ParameterGroup::PlannerCode); else _parameter->setType(ParameterGroup::ClassCode); } qt-client-4.1.0/guiclient/dspCountTagEditList.h000066400000000000000000000033651217451700100214520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCOUNTTAGEDITLIST_H #define DSPCOUNTTAGEDITLIST_H #include "guiclient.h" #include "xwidget.h" #include "ui_dspCountTagEditList.h" class dspCountTagEditList : public XWidget, public Ui::dspCountTagEditList { Q_OBJECT public: dspCountTagEditList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspCountTagEditList(); virtual void setParams(ParameterList ¶ms); public slots: virtual void sPrint(); virtual void sToggleList(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sEnterCountSlip(); virtual void sCountSlipEditList(); virtual void sViewInventoryHistory(); virtual void sEdit(); virtual void sEditTag(); virtual void sEditSlip(); virtual void sDelete(); virtual void sDeleteTag(); virtual void sDeleteSlip(); virtual void sPost(); virtual void sPostTag(); virtual void sPostSlip(); virtual void sSearch( const QString & pTarget ); virtual void sFillList(); virtual void sHandleAutoUpdate( bool pAutoUpdate ); virtual void sHandleButtons(bool); virtual void sParameterTypeChanged(); protected slots: virtual void languageChange(); private: QButtonGroup* _highlightGroupInt; QButtonGroup* _codeGroup; }; #endif // DSPCOUNTTAGEDITLIST_H qt-client-4.1.0/guiclient/dspCountTagEditList.ui000066400000000000000000000453551217451700100216450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCountTagEditList 0 0 800 627 Count Tag Edit List Item Sites by 12 Class Code true Planner Code Qt::Horizontal QSizePolicy::Expanding 0 16 Qt::StrongFocus false Qt::StrongFocus false No Highlighting true Qt::Horizontal QSizePolicy::Preferred 0 20 5 Highlight Tag when Variance Value Exceeds 0 0 false false Qt::Horizontal 0 20 0 2 &Highlight Tag when Variance % Exceeds false 0 0 40 32767 % Qt::Horizontal QSizePolicy::Expanding 0 10 S&earch for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _searchFor Qt::Horizontal QSizePolicy::Preferred 40 17 Show Count &Slips Qt::Horizontal 166 13 0 0 &Close &Query &Print Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Count Tags: 7 0 100 QAbstractItemView::ExtendedSelection 0 5 0 false &Edit false &Delete false P&ost Enter S&lip Qt::Vertical QSizePolicy::Expanding 20 20 150 20 Automatically Update Qt::Horizontal QSizePolicy::Expanding 20 20 CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _classcode _plancode _parameter _warehouse _noHighlight _highlightValue _highlightPercent _varianceValue _variancePercent _searchFor _showSlips _cnttag _edit _delete _post _enterSlip _autoUpdate _close _query _print _close clicked() dspCountTagEditList close() 20 20 20 20 _highlightValue toggled(bool) _varianceValue setEnabled(bool) 20 20 20 20 _highlightPercent toggled(bool) _variancePercent setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/dspCreditCardTransactions.cpp000066400000000000000000000220211217451700100232020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspCreditCardTransactions.h" #include #include #include #include #include #include "mqlutil.h" #include "creditcardprocessor.h" #include "storedProcErrorLookup.h" #include "xtreewidget.h" dspCreditCardTransactions::dspCreditCardTransactions(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_preauth, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(sgetCCAmount())); connect(_preauth, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_postPreauth, SIGNAL(clicked()), this, SLOT(sPostPreauth())); connect(_voidPreauth, SIGNAL(clicked()), this, SLOT(sVoidPreauth())); connect(_customerSelector, SIGNAL(newState(int)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newCustId(int)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newCustTypeId(int)), this, SLOT(sClear())); connect(_customerSelector, SIGNAL(newTypePattern(QString)), this, SLOT(sClear())); _preauth->addColumn(tr("Timestamp"), _dateColumn, Qt::AlignLeft, true, "ccpay_transaction_datetime" ); _preauth->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number"); _preauth->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "cust_name"); _preauth->addColumn(tr("Type"), _orderColumn, Qt::AlignLeft, true, "type" ); _preauth->addColumn(tr("Status"), _bigMoneyColumn, Qt::AlignLeft, true, "status" ); _preauth->addColumn(tr("Document #"), -1, Qt::AlignLeft, true, "docnumber" ); _preauth->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "ccpay_amount"); _preauth->addColumn(tr("Currency"),_currencyColumn, Qt::AlignLeft, true, "currabbr"); _preauth->addColumn(tr("Entered By"), _userColumn, Qt::AlignLeft, false, "ccpay_by_username" ); _preauth->addColumn(tr("Reference"), _orderColumn, Qt::AlignLeft, false, "ccpay_r_ref" ); _preauth->addColumn(tr("Allocated"), _moneyColumn, Qt::AlignRight, false, "allocated" ); _preauth->addColumn(tr("Allocated Currency"), _currencyColumn, Qt::AlignLeft, false, "payco_currAbbr" ); if (omfgThis->singleCurrency()) _preauth->hideColumn(2); if (_metrics->value("CCValidDays").toInt()) _validDays->setValue(_metrics->value("CCValidDays").toInt()); else _validDays->setValue(7); } dspCreditCardTransactions::~dspCreditCardTransactions() { // no need to delete child widgets, Qt does it all for us } void dspCreditCardTransactions::languageChange() { retranslateUi(this); } enum SetResponse dspCreditCardTransactions::set( const ParameterList & pParams ) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) { _customerSelector->setCustId(param.toInt()); sFillList(); } return NoError; } void dspCreditCardTransactions::sFillList() { XSqlQuery dspFillList; _CCAmount->clear(); MetaSQLQuery mql = mqlLoad("ccpayments", "list"); ParameterList params; _customerSelector->appendValue(params); if (_processed->isChecked()) params.append("processed"); else if (_pending->isChecked()) params.append("authorizations"); if (!_expired->isChecked()) params.append("validOnly"); params.append("ccValidDays", _validDays->value()); params.append("preauth", tr("Preauthorization")); params.append("charge", tr("Charge")); params.append("refund", tr("Refund")); params.append("authorized", tr("Authorized")); params.append("approved", tr("Approved")); params.append("declined", tr("Declined")); params.append("voided", tr("Voided")); params.append("noapproval", tr("No Approval Code")); dspFillList = mql.toQuery(params); _preauth->populate(dspFillList,true); } void dspCreditCardTransactions::sClear() { _preauth->clear(); } void dspCreditCardTransactions::sgetCCAmount() { XSqlQuery dspgetCCAmount; if (_preauth->altId() && _privileges->check("ProcessCreditCards")) { dspgetCCAmount.prepare("SELECT ccpay_amount, ccpay_curr_id " "FROM ccpay " " WHERE (ccpay_id = :ccpay_id);"); dspgetCCAmount.bindValue(":ccpay_id", _preauth->id()); if (dspgetCCAmount.exec() && dspgetCCAmount.first()) { /* _CCAmount->id() defaults to customer's currency if CC payment is in either customer's currency or base set _CCAmount appropriately but handle it if it somehow happens to be in a 3rd currency */ _postPreauth->setEnabled(true); _voidPreauth->setEnabled(true); int ccpayCurrId = dspgetCCAmount.value("ccpay_curr_id").toInt(); if (ccpayCurrId == _CCAmount->baseId()) _CCAmount->setBaseValue(dspgetCCAmount.value("ccpay_amount").toDouble()); else if (ccpayCurrId != _CCAmount->id()) { _CCAmount->setId(ccpayCurrId); _CCAmount->setLocalValue(dspgetCCAmount.value("ccpay_amount").toDouble()); } else _CCAmount->setLocalValue(dspgetCCAmount.value("ccpay_amount").toDouble()); return; } else if (dspgetCCAmount.lastError().type() != QSqlError::NoError) systemError(this, dspgetCCAmount.lastError().databaseText(), __FILE__, __LINE__); } _postPreauth->setEnabled(false); _voidPreauth->setEnabled(false); _CCAmount->clear(); } void dspCreditCardTransactions::sPopulateMenu( QMenu * pMenu, QTreeWidgetItem *pItem ) { if (((XTreeWidgetItem *)pItem)->rawValue("status") == "C") { QAction* printAct = new QAction(tr("Print Receipt"), this); connect(printAct, SIGNAL(triggered()), this, SLOT(sPrintCCReceipt())); pMenu->addAction(printAct); } if (_postPreauth->isEnabled()) { QAction* postAct = new QAction(tr("Post"), this); connect(postAct, SIGNAL(triggered()), this, SLOT(sPostPreauth())); pMenu->addAction(postAct); } if (_voidPreauth->isEnabled()) { QAction* voidAct = new QAction(tr("Void"), this); connect(voidAct, SIGNAL(triggered()), this, SLOT(sVoidPreauth())); pMenu->addAction(voidAct); } } void dspCreditCardTransactions::sPostPreauth() { CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (! cardproc) { QMessageBox::critical(this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); return; } if (! cardproc->errorMsg().isEmpty()) { QMessageBox::warning( this, tr("Credit Card Error"), cardproc->errorMsg() ); _CCAmount->setFocus(); return; } _postPreauth->setEnabled(false); _voidPreauth->setEnabled(false); int ccpayid = _preauth->id(); QString neworder = _preauth->currentItem()->text("docnumber"); QString reforder = neworder; int returnVal = cardproc->chargePreauthorized("-2", _CCAmount->localValue(), _CCAmount->id(), neworder, reforder, ccpayid); if (returnVal < 0) QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); else if (returnVal > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (! cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); else _CCAmount->clear(); sFillList(); _voidPreauth->setEnabled(true); _postPreauth->setEnabled(true); } void dspCreditCardTransactions::sPrintCCReceipt() { CreditCardProcessor::printReceipt(_preauth->id()); } void dspCreditCardTransactions::sVoidPreauth() { CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (! cardproc) { QMessageBox::critical(this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); return; } if (! cardproc->errorMsg().isEmpty()) { QMessageBox::warning( this, tr("Credit Card Error"), cardproc->errorMsg() ); _CCAmount->setFocus(); return; } _postPreauth->setEnabled(false); _voidPreauth->setEnabled(false); int ccpayid = _preauth->id(); QString ordernum; int returnVal = cardproc->voidPrevious(ccpayid); if (returnVal < 0) QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); else if (returnVal > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (! cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); else _CCAmount->clear(); sFillList(); _voidPreauth->setEnabled(true); _postPreauth->setEnabled(true); } qt-client-4.1.0/guiclient/dspCreditCardTransactions.h000066400000000000000000000024661217451700100226620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPCREDITCARDTRANSACTIONS_H #define DSPCREDITCARDTRANSACTIONS_H #include "guiclient.h" #include "xwidget.h" #include #include #include "ui_dspCreditCardTransactions.h" class dspCreditCardTransactions : public XWidget, public Ui::dspCreditCardTransactions { Q_OBJECT public: dspCreditCardTransactions(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspCreditCardTransactions(); virtual SetResponse set( const ParameterList & pParams ); public slots: virtual void sFillList(); virtual void sPostPreauth(); virtual void sPopulateMenu(QMenu* pMenu, QTreeWidgetItem* pItem); virtual void sPrintCCReceipt(); virtual void sVoidPreauth(); virtual void sgetCCAmount(); virtual void sClear(); protected slots: virtual void languageChange(); }; #endif // DSPCREDITCARDTRANSACTIONS_H qt-client-4.1.0/guiclient/dspCreditCardTransactions.ui000066400000000000000000000304171217451700100230450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspCreditCardTransactions 0 0 800 600 Credit Card Transactions 12 12 Qt::Horizontal 40 20 Qt::Vertical 20 0 0 &Close &Query Qt::Vertical QSizePolicy::Expanding 20 0 Show 12 All Processed Pending true Expired true Qt::Horizontal QSizePolicy::Fixed 5 20 Valid Days: 30 Qt::Horizontal QSizePolicy::Expanding 40 20 0 1 QFrame::NoFrame QFrame::Raised 0 1 0 Qt::Horizontal 40 20 0 false Post false Void Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 false true Qt::Vertical 20 40 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    CustomerSelector QWidget
    customerselector.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _preauth _postPreauth _voidPreauth _CCAmount _close _close clicked() dspCreditCardTransactions close() 717 46 20 20 _processed toggled(bool) _expired setDisabled(bool) 116 117 220 214 _processed toggled(bool) _validDays setDisabled(bool) 116 117 578 214
    qt-client-4.1.0/guiclient/dspFinancialReport.cpp000066400000000000000000001531421217451700100216760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspFinancialReport.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dspFinancialReport.h" #include "dspGLTransactions.h" #include "financialReportNotes.h" #include "storedProcErrorLookup.h" #define cFlRoot 0 #define cFlItem 1 #define cFlGroup 2 #define cFlSpec 3 #define cBegining 0 #define cEnding 1 #define cDebits 2 #define cCredits 3 #define cBudget 4 #define cDiff 5 dspFinancialReport::dspFinancialReport(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "dspFinancialReport", fl) { setupUi(optionsWidget()); setWindowTitle(tr("View Financial Report")); setListLabel(tr("Statement")); setReportName("dummy"); // This is really handled locally _prjid = -1; _col = 0; QToolBar *toolbar = this->toolBar(); QToolButton *_notesBtn = new QToolButton(); _notesBtn->setText(tr("Notes")); _notesAct = toolbar->insertWidget(filterSeparator(), _notesBtn); _notesAct->setEnabled(false); // signals and slots connections connect(list(), SIGNAL(itemCollapsed(QTreeWidgetItem*)), this, SLOT(sCollapsed(QTreeWidgetItem*))); connect(list(), SIGNAL(itemExpanded(QTreeWidgetItem*)), this, SLOT(sExpanded(QTreeWidgetItem*))); connect(_periods, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_periods, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sEditPeriodLabel())); connect(_periods, SIGNAL(valid(bool)), this, SLOT(sToggleNotes())); connect(_flhead, SIGNAL(newID(int)), this, SLOT(sReportChanged(int))); connect(_trend, SIGNAL(toggled(bool)), this, SLOT(sToggleTrend())); connect(_trend, SIGNAL(toggled(bool)), this, SLOT(sTogglePeriod())); connect(_trend, SIGNAL(toggled(bool)), this, SLOT(sFillPeriods())); connect(_month, SIGNAL(toggled(bool)), this, SLOT(sFillPeriods())); connect(_quarter, SIGNAL(toggled(bool)), this, SLOT(sFillPeriods())); connect(_year, SIGNAL(toggled(bool)), this, SLOT(sFillPeriods())); connect(_notesBtn, SIGNAL(clicked()), _notesAct, SLOT(trigger())); connect(_notesAct, SIGNAL(triggered()), this, SLOT(sNotes())); list()->setPopulateLinear(true); _flhead->setType(XComboBox::FinancialLayouts); _periods->addColumn(tr("Period"), _itemColumn, Qt::AlignLeft, true, "f_name"); _periods->addColumn(tr("Alternate Label"), -1, Qt::AlignLeft, true, "alt_name"); sFillPeriods(); _tab->setTabEnabled(_tab->indexOf(_showColumnsTab),false); sReportChanged(_flhead->id()); // Hide trend features until we can figure out how to make them print _actuals->hide(); _budgets->hide(); } enum SetResponse dspFinancialReport::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("flhead_id", &valid); if (valid) _flhead->setId(param.toInt()); return NoError; } void dspFinancialReport::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected, int pColumn) { Q_UNUSED(pSelected); if (_columnDates.contains(pColumn) && list()->id() > 0) { _col = pColumn; QAction* viewGlAct = pMenu->addAction(tr("View Transactions..."), this, SLOT(sViewTransactions())); viewGlAct->setEnabled(_privileges->check("ViewGLTransactions")); } else _col = 0; } void dspFinancialReport::sViewTransactions() { ParameterList params; params.append("accnt_id", list()->id()); params.append("startDate", _columnDates.value(_col).first); params.append("endDate", _columnDates.value(_col).second); params.append("run"); dspGLTransactions *newdlg = new dspGLTransactions(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool dspFinancialReport::sCheck() { XSqlQuery dspCheck; if (!_periods->selectedItems().count()) { QMessageBox::warning( this, tr("No period selected"), tr("

    You must select at least one period.") ); return false; } //Make sure user has upgraded period settings dspCheck.exec("SELECT period_id FROM period WHERE period_quarter IS NULL;"); if (dspCheck.first()) { QMessageBox::warning( this, tr("Setup Incomplete"), tr("

    Please make sure all accounting periods " "are associated with a quarter and fiscal year " "before using this application.") ); return false; } return true; } void dspFinancialReport::sFillList() { if (!sCheck()) return; if (!_metrics->boolean("ManualForwardUpdate")) { if (!forwardUpdate()) return; } if (_trend->isChecked()) sFillListTrend(); else sFillListStatement(); } void dspFinancialReport::sFillListStatement() { XSqlQuery dspFillListStatement; XSqlQuery label; QList periodsRef; QString qc; QStringList qwList; dspFillListStatement.prepare("SELECT * FROM flcol WHERE flcol_id=:flcolid"); dspFillListStatement.bindValue(":flcolid", _flcol->id()); dspFillListStatement.exec(); if (dspFillListStatement.first()) { //Find which period selected QList selected = _periods->selectedItems(); for (int i = 0; i < selected.size(); i++) periodsRef.prepend(((XTreeWidgetItem*)(selected[i]))->id()); if(periodsRef.count() < 1) return; //Get date labels for period label.prepare( "SELECT * FROM getflstmthead(:flcolid,:periodid)"); label.bindValue(":flcolid", _flcol->id()); label.bindValue(":periodid", periodsRef.at(0)); label.exec(); //Get column date ranges for drill down _columnDates.clear(); XSqlQuery coldata; coldata.prepare("SELECT * FROM getflcoldata(:flcolid,:periodid)"); coldata.bindValue(":flcolid", _flcol->id()); coldata.bindValue(":periodid", periodsRef.at(0)); coldata.exec(); while(coldata.next()) { QPair range; range.first = coldata.value("flcoldata_start").toDate(); range.second = coldata.value("flcoldata_end").toDate(); _columnDates.insert(coldata.value("flcoldata_column").toInt(), range); }; if (label.first()) { list()->clear(); list()->setColumnCount(0); list()->addColumn(tr("Group\n Account Name"), -1, Qt::AlignLeft, true, "flstmtitem_name"); //Build report query qc = ("SELECT COALESCE(flstmtitem_accnt_id,-1) AS id, flstmtitem_order AS orderby," " flstmtitem_level AS xtindentrole," " CASE WHEN flstmtitem_type = 'G' THEN 2 " " WHEN flstmtitem_type = 'I' THEN 1 " " ELSE -1 " " END AS type," " flstmtitem_name"); if (dspFillListStatement.value("flcol_month").toBool()) { if (dspFillListStatement.value("flcol_showdb").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_month").toString()).arg(_columnLabels.value(cDebits)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_monthdb"); list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_month").toString()).arg(_columnLabels.value(cCredits)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_monthcr"); qc += ",flstmtitem_monthdb, 'curr' AS flstmtitem_monthdb_xtnumericrole" ",flstmtitem_monthcr, 'curr' AS flstmtitem_monthcr_xtnumericrole"; qwList << "(flstmtitem_monthdb <> 0) OR (flstmtitem_monthcr <> 0)"; } list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_month").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_month"); qc += ",flstmtitem_month, 'curr' AS flstmtitem_month_xtnumericrole"; qwList << "(flstmtitem_month <> 0)"; if (dspFillListStatement.value("flcol_prcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_month").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_monthprcnt"); qc += ",flstmtitem_monthprcnt, 'percent' AS flstmtitem_monthprcnt_xtnumericrole"; } if (dspFillListStatement.value("flcol_budget").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_month").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_monthbudget"); qc += ",flstmtitem_monthbudget, 'curr' AS flstmtitem_monthbudget_xtnumericrole"; qwList << "(flstmtitem_monthbudget <> 0)"; if (dspFillListStatement.value("flcol_budgetprcnt").toBool()) { list()->addColumn( tr("%1\n% of Group").arg(label.value("flstmthead_month").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_monthbudgetprcnt"); qc += ",flstmtitem_monthbudgetprcnt, 'percent' AS flstmtitem_monthbudgetprcnt_xtnumericrole"; } if (dspFillListStatement.value("flcol_budgetdiff").toBool()) { list()->addColumn( tr("%1\n%2 Diff.").arg(label.value("flstmthead_month").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_monthbudgetdiff"); qc += ",flstmtitem_monthbudgetdiff, 'curr' AS flstmtitem_monthbudgetdiff_xtnumericrole"; } if (dspFillListStatement.value("flcol_budgetdiffprcnt").toBool()) { list()->addColumn( tr("%1\n%2 % Diff.").arg(label.value("flstmthead_month").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_monthbudgetdiffprcnt"); qc += ",flstmtitem_monthbudgetdiffprcnt, 'percent' AS flstmtitem_monthbudgetdiffprcent_xtnumericrole"; } } } if (dspFillListStatement.value("flcol_quarter").toBool()) { if (dspFillListStatement.value("flcol_showdb").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_qtr").toString()).arg(_columnLabels.value(cDebits)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_qtrdb"); list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_qtr").toString()).arg(_columnLabels.value(cCredits)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_qtrcr"); qc += ",flstmtitem_qtrdb, 'curr' AS flstmtitem_qtrdb_xtnumericrole" ",flstmtitem_qtrcr, 'cur' AS flstmtitem_qtrcr_xtnumericrole"; qwList << "(flstmtitem_qtrdb <> 0) OR (flstmtitem_qtrcr <> 0)"; } list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_qtr").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_qtr"); qc += ",flstmtitem_qtr, 'curr' AS flstmtitem_qtr_xtnumericrole"; qwList << "(flstmtitem_qtr <> 0)"; if (dspFillListStatement.value("flcol_prcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_qtr").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstitem_qtrprcent"); qc += ",flstmtitem_qtrprcnt, 'percent' AS flstitem_qtrprcnt_xtnumericrole"; } if (dspFillListStatement.value("flcol_budget").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_qtr").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_qtrbudget"); qc += ",flstmtitem_qtrbudget, 'curr' AS flstmtitem_qtrbudget_xtnumericrole"; qwList << "(flstmtitem_qtrbudget <> 0)"; if (dspFillListStatement.value("flcol_budgetprcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_qtr").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_qtrbudgetprcnt" ); qc += ",flstmtitem_qtrbudgetprcnt, 'percent' AS flstmtitem_qtrbudgetprcent_xtnumericrole"; } if (dspFillListStatement.value("flcol_budgetdiff").toBool()) { list()->addColumn(tr("%1\n%2 Diff.").arg(label.value("flstmthead_qtr").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_qtrbudgetdiff"); qc += ",flstmtitem_qtrbudgetdiff, 'curr' AS flstmtitem_qtrbudgetdiff_xtnumericrole"; } if (dspFillListStatement.value("flcol_budgetdiffprcnt").toBool()) { list()->addColumn(tr("%1\n%2 % Diff.").arg(label.value("flstmthead_qtr").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_qtrbudgetdiffprcnt"); qc += ",flstmtitem_qtrbudgetdiffprcnt, 'percent' AS flstmtitem_qtrbudgetdiffprcnt_xtnumericrole"; } } } if (dspFillListStatement.value("flcol_year").toBool()) { if (dspFillListStatement.value("flcol_showdb").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_year").toString()).arg(_columnLabels.value(cDebits)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_yeardb"); list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_year").toString()).arg(_columnLabels.value(cCredits)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_yearcr"); qc += ",flstmtitem_yeardb, 'curr' AS flstmtitem_yeardb_xtnumericrole" ",flstmtitem_yearcr, 'curr' AS flstmtitem_yearcr_xtnumericrole"; qwList << "(flstmtitem_yeardb <> 0) OR (flstmtitem_yearcr <> 0)"; } list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_year").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_year"); qc += ",flstmtitem_year, 'curr' AS flstmtitem_year_xtnumericrole"; qwList << "(flstmtitem_year <> 0)"; if (dspFillListStatement.value("flcol_prcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_year").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_yearprcnt"); qc += ",flstmtitem_yearprcnt, 'percent' AS flstmtitem_yearprcnt_xtnumericrole"; } if (dspFillListStatement.value("flcol_budget").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_year").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_yearbudget"); qc += ",flstmtitem_yearbudget, 'curr' AS flstmtitem_yearbudget_xtnumericrole"; qwList << "(flstmtitem_yearbudget <> 0)"; if (dspFillListStatement.value("flcol_budgetprcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_year").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_yearbudgetprcent"); qc += ",flstmtitem_yearbudgetprcnt, 'percent' AS flstmtitem_yearbudgetprcent_xtnumericrole"; } if (dspFillListStatement.value("flcol_budgetdiff").toBool()) { list()->addColumn(tr("%1\n%2 Diff.").arg(label.value("flstmthead_year").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_yearbudgetdiff"); qc += ",flstmtitem_yearbudgetdiff, 'curr' AS flstmtitem_yearbudgetdiff_xtnumericrole"; } if (dspFillListStatement.value("flcol_budgetdiffprcnt").toBool()) { list()->addColumn(tr("%1\n%2 % Diff.").arg(label.value("flstmthead_year").toString()).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_yearbudgetdiffprcnt"); qc += ",flstmtitem_yearbudgetdiffprcnt, 'percent' AS flstmtitem_yearbudgetdiffprcnt_xtnumericrole"; } } } if (dspFillListStatement.value("flcol_priormonth").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_prmonth").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prmonth"); qc += ",flstmtitem_prmonth, 'curr' AS flstmtitem_prmonth_xtnumericrole"; qwList << "(flstmtitem_prmonth <> 0)"; if (dspFillListStatement.value("flcol_priorprcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_prmonth").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prmonthprcnt"); qc += ",flstmtitem_prmonthprcnt, 'percent' AS flstmtitem_prmonthprcnt_xtnumericrole"; } if (dspFillListStatement.value("flcol_priordiff").toBool()) { list()->addColumn(tr("%1\n%2 Diff.").arg(label.value("flstmthead_prmonth").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prmonthdiff"); qc += ",flstmtitem_prmonthdiff, 'curr' AS flstmtitem_prmonthdiff_xtnumericrole"; } if (dspFillListStatement.value("flcol_priordiffprcnt").toBool()) { list()->addColumn(tr("%1\n%2 % Diff.").arg(label.value("flstmthead_prmonth").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prmonthdiffprcnt"); qc += ",flstmtitem_prmonthdiffprcnt, 'percent' AS flstmtitem_prmonthdiffprcnt_xtnumericrole"; } } if (dspFillListStatement.value("flcol_priorquarter").toBool()) { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_prqtr").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prqtr"); qc += ",flstmtitem_prqtr, 'curr' AS flstmtitem_prqtr_xtnumericrole"; qwList << "(flstmtitem_prqtr <> 0)"; if (dspFillListStatement.value("flcol_priorprcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_prqtr").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prqtrprcnt"); qc += ",flstmtitem_prqtrprcnt, 'percent' AS flstmtitem_prqtrprcnt_xtnumericrole"; } if (dspFillListStatement.value("flcol_priordiff").toBool()) { list()->addColumn(tr("%1\n%2 Diff.").arg(label.value("flstmthead_prqtr").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prqtrdiff"); qc += ",flstmtitem_prqtrdiff, 'curr' AS flstmtitem_prqtrdiff_xtnumericrole"; } if (dspFillListStatement.value("flcol_priordiffprcnt").toBool()) { list()->addColumn(tr("%1\n%2 % Diff.").arg(label.value("flstmthead_prqtr").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_prqtrdiffprcnt"); qc += ",flstmtitem_prqtrdiffprcnt, 'percent' AS flstmtitem_prqtrdiffprcnt_xtnumericrole"; } } if (dspFillListStatement.value("flcol_prioryear").toString() != "N") { list()->addColumn(tr("%1\n%2").arg(label.value("flstmthead_pryear").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_pryear"); qc += ",flstmtitem_pryear, 'curr' AS flstmtitem_pryear_xtnumericrole"; qwList << "(flstmtitem_pryear <> 0)"; if (dspFillListStatement.value("flcol_priorprcnt").toBool()) { list()->addColumn(tr("%1\n% of Group").arg(label.value("flstmthead_pryear").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_pryearprcnt"); qc += ",flstmtitem_pryearprcnt, 'percent' AS flstmtitem_pryearprcnt_xtnumericrole"; } if (dspFillListStatement.value("flcol_priordiff").toBool()) { list()->addColumn(tr("%1\n%2 Diff.").arg(label.value("flstmthead_pryear").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_pryeardiff"); qc += ",flstmtitem_pryeardiff, 'curr' AS flstmtitem_pryeardiff_xtnumericrole"; } if (dspFillListStatement.value("flcol_priordiffprcnt").toBool()) { list()->addColumn(tr("%1\n%2 % Diff.").arg(label.value("flstmthead_pryear").toString()).arg(label.value("flstmthead_typedescrip2").toString()), _bigMoneyColumn, Qt::AlignRight, true, "flstmtitem_pryeardiffprcnt"); qc += ",flstmtitem_pryeardiffprcnt, 'percent' AS flstmtitem_pryeardiffprcnt_xtnumericrole"; } } qc += " FROM financialreport(:flcolid,:periodid,:shownumbers,false,:prjid)"; if (!_showzeros->isChecked()) qc += " WHERE (" + qwList.join(" OR ") + " OR (flstmtitem_type <> 'I'))"; dspFillListStatement.prepare(qc); dspFillListStatement.bindValue(":flcolid", _flcol->id()); dspFillListStatement.bindValue(":periodid", periodsRef.at(0)); dspFillListStatement.bindValue(":shownumbers", _shownumbers->isChecked()); dspFillListStatement.bindValue(":prjid", _prjid); dspFillListStatement.exec(); list()->populate(dspFillListStatement, true); if (dspFillListStatement.lastError().type() != QSqlError::NoError) { systemError(this, dspFillListStatement.lastError().databaseText(), __FILE__, __LINE__); return; } list()->expandAll(); } } } void dspFinancialReport::sFillListTrend() { XSqlQuery dspFillListTrend; if (_typeCode=="A") { if( (!_showBegBal->isChecked()) && (!_showBegBalPrcnt->isChecked()) && (!_showDebits->isChecked()) && (!_showDebitsPrcnt->isChecked()) && (!_showCredits->isChecked()) && (!_showCreditsPrcnt->isChecked()) && (!_showEndBal->isChecked()) && (!_showEndBalPrcnt->isChecked()) && (!_showBudget->isChecked()) && (!_showBudgetPrcnt->isChecked()) && (!_showDiff->isChecked()) && (!_showDiffPrcnt->isChecked()) && (!_showCustom->isChecked()) && (!_showCustomPrcnt->isChecked()) ) { QMessageBox::critical(this, tr("Report Error"), tr("You must select at least one Column")); return; } } else if (!_actuals->isChecked() && !_budgets->isChecked()) { QMessageBox::critical(this, tr("Report Error"), tr("You must select actuals or budget to proceed.")); return; } int c = 0; QList periodsRef; QStringList periods; QString interval; if (_month->isChecked()) interval = "M"; else if (_quarter->isChecked()) interval = "Q"; else interval = "Y"; QString customlabel; dspFillListTrend.prepare("SELECT flhead_custom_label" " FROM flhead" " WHERE (flhead_id=:flhead_id);"); dspFillListTrend.bindValue(":flhead_id", _flhead->id()); dspFillListTrend.exec(); if(dspFillListTrend.first()) customlabel = dspFillListTrend.value("flhead_custom_label").toString(); if(customlabel.isEmpty()) customlabel = tr("Custom"); QTreeWidgetItem* selected; QString label; QStringList periodList; for (int i = 0; i < _periods->topLevelItemCount(); i++) { if (_periods->topLevelItem(i)->isSelected()) { selected = _periods->topLevelItem(i); label = selected->text(1).isEmpty() ? selected->text(0) : selected->text(1); periodsRef.prepend(((XTreeWidgetItem*)(selected))->id()); periods.prepend(label); periodList.prepend(QString::number(((XTreeWidgetItem*)(selected))->id())); } } if(periodsRef.count() < 1) return; //Get column date ranges for drill down if (_actuals->isChecked()) { _columnDates.clear(); XSqlQuery coldata; QString sql("SELECT * FROM getflcoldata(,ARRAY[], )"); ParameterList params; if (_month->isChecked()) params.append("interval", "M"); else if (_quarter->isChecked()) params.append("interval", "Q"); else params.append("interval", "Y"); params.append("periodids", periodList.join(",")); params.append("budgets", QVariant(_budgets->isChecked())); MetaSQLQuery mql(sql); coldata = mql.toQuery(params); while(coldata.next()) { QPair range; range.first = coldata.value("flcoldata_start").toDate(); range.second = coldata.value("flcoldata_end").toDate(); _columnDates.insert(coldata.value("flcoldata_column").toInt(), range); }; } list()->setColumnCount(0); list()->addColumn( tr("Group\n Account Name"), -1, Qt::AlignLeft, true, "name"); dspFillListTrend.prepare("SELECT financialReport(:flhead_id, :period_id, :interval, :prjid) AS result;"); QString q1c = QString("SELECT -1, r0.flrpt_order AS orderby, r0.flrpt_level AS xtindentrole," " :group AS type, flgrp_id AS id," " flgrp_name AS name"); QString q1f = QString(" FROM flgrp"); QString q1w = QString(" WHERE ((true)"); QString q2c = QString("SELECT r0.flrpt_accnt_id, r0.flrpt_order AS orderby, r0.flrpt_level AS xtindentrole," " :item AS type, flitem_id AS id,"); if (_shownumbers->isChecked()) q2c += " (formatGLAccount(accnt_id) || '-' || accnt_descrip) AS name "; else q2c += " accnt_descrip AS name "; QString q2f = QString(" FROM flitem, accnt "); QString q2w = QString(" WHERE ((true) AND accnt_id IN (SELECT accnt_id FROM flaccnt WHERE flitem_id=flitem_id) "); QString q3c = QString("SELECT -1, r0.flrpt_order AS orderby, r0.flrpt_level AS xtindentrole," " :spec AS type, flspec_id AS id," " flspec_name AS name"); QString q3f = QString(" FROM flspec"); QString q3w = QString(" WHERE ((true)"); QString q4c = QString("SELECT -1, r0.flrpt_order AS orderby, r0.flrpt_level AS xtindentrole," " -1 AS type, r0.flrpt_type_id AS id," " CASE WHEN(r0.flrpt_type='T' AND r0.flrpt_level=0) THEN COALESCE(r0.flrpt_altname, 'Total')" " WHEN(r0.flrpt_type='T') THEN COALESCE(r0.flrpt_altname, 'Subtotal')" " ELSE ('Type ' || r0.flrpt_type || ' ' || text(r0.flrpt_type_id))" " END AS name"); QString q4f = QString(" FROM"); QString q4w = QString(" WHERE ((true)"); QStringList qbList; QStringList qtList; QStringList qzList; QString colname; QString sharedColumns; for(c = 0; c < periodsRef.count(); c++) { sharedColumns = QString(); if (_typeCode == "A") { if(_showBegBal->isChecked()) { colname = "flrpt_beginning"; list()->addColumn(tr("%1\n%2").arg(periods.at(c)).arg(_columnLabels.value(cBegining)), _bigMoneyColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showstart) THEN r%1.%2 ELSE NULL END AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2 AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); qzList << QString("(r%1.%2 <> 0)").arg(c).arg(colname); } if(_showBegBalPrcnt->isChecked()) { colname = "flrpt_beginningprcnt"; list()->addColumn(tr("%1\n%2 %").arg(periods.at(c)).arg(_columnLabels.value(cBegining)), _ynColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showstartprcnt) THEN r%1.%2 ELSE NULL END AS r%3%4, 'percent' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2, 'percent' AS r%3%4_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname); } if(_showDebits->isChecked()) { colname = "flrpt_debits"; list()->addColumn(tr("%1\n%2").arg(periods.at(c)).arg(_columnLabels.value(cDebits)), _bigMoneyColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showdelta) THEN r%1.%2 ELSE NULL END AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2 AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); qzList << QString("(r%1.%2 <> 0)").arg(c).arg(colname); } if(_showDebitsPrcnt->isChecked()) { colname = "flrpt_debitsprcnt"; list()->addColumn( tr("%1\n%2 %").arg(periods.at(c)).arg(_columnLabels.value(cDebits)), _ynColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showdeltaprcnt) THEN r%1.%2 ELSE NULL END AS r%3%4, 'percent' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2, 'percent' AS r%3%4_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname); } if(_showCredits->isChecked()) { colname = "flrpt_credits"; list()->addColumn(tr("%1\n%2").arg(periods.at(c)).arg(_columnLabels.value(cCredits)), _bigMoneyColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showdelta) THEN r%1.%2 ELSE NULL END AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2 AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); qzList << QString("(r%1.%2 <> 0)").arg(c).arg(colname); } if(_showCreditsPrcnt->isChecked()) { colname = "flrpt_creditsprcnt"; list()->addColumn(tr("%1\n%2 %").arg(periods.at(c)).arg(_columnLabels.value(cCredits)), _ynColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showdeltaprcnt) THEN r%1.%2 ELSE NULL END AS r%3%4, 'percent' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2, 'percent' AS r%3%4_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname); } } if ((_showEndBal->isChecked()) || (_actuals->isChecked() && _typeCode == "B")) { colname = "flrpt_ending"; list()->addColumn( tr("%1\n%2").arg(periods.at(c)).arg(_columnLabels.value(cEnding)), _bigMoneyColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showend) THEN r%1.%2 ELSE NULL END AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2 AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); qzList << QString("(r%1.%2 <> 0)").arg(c).arg(colname); } if(_showEndBalPrcnt->isChecked() && _typeCode=="A") { colname = "flrpt_endingprcnt"; list()->addColumn(tr("%1\n%2 %").arg(periods.at(c)).arg(_columnLabels.value(cEnding)), _ynColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showendprcnt) THEN r%1.%2 ELSE NULL END AS r%3%4, 'percent' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2, 'percent' AS r%3%4_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname); } if(_showBudget->isChecked() || _budgets->isChecked()) { colname = "flrpt_budget"; list()->addColumn(tr("%1\n%2").arg(periods.at(c)).arg(_columnLabels.value(cBudget)), _bigMoneyColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showbudget) THEN r%1.%2 ELSE NULL END AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2 AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); qbList << QString("r%1.%2").arg(c).arg(colname); qzList << QString("(r%1.%2 <> 0)").arg(c).arg(colname); } if(_showBudgetPrcnt->isChecked() && _typeCode=="A") { colname = "flrpt_budgetprcnt"; list()->addColumn( tr("%1\n%2 %").arg(periods.at(c)).arg(_columnLabels.value(cBudget)), _ynColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showbudgetprcnt) THEN r%1.%2 ELSE NULL END AS r%3%4, 'percent' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2, 'percent' AS r%3%4_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname); } if ((_showDiff->isChecked()) || (_actuals->isChecked() && ((_typeCode == "I") || (_typeCode == "C")))) { colname = "flrpt_diff"; list()->addColumn(tr("%1\n%2").arg(periods.at(c)).arg(_columnLabels.value(cDiff)), _bigMoneyColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showdiff) THEN r%1.%2 ELSE NULL END AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2 AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); qtList << QString("r%1.%2").arg(c).arg(colname); qzList << QString("(r%1.%2 <> 0)").arg(c).arg(colname); } if (_typeCode=="A") { if(_showDiffPrcnt->isChecked()) { colname = "flrpt_diffprcnt"; list()->addColumn(tr("%1\n%2 %").arg(periods.at(c)).arg(_columnLabels.value(cDiff)), _ynColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showdiffprcnt) THEN r%1.%2 ELSE NULL END AS r%3%4, 'percent' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",%1, 'percent' AS %2_xtnumericrole").arg(colname).arg(colname); } if(_showCustom->isChecked()) { colname = "flrpt_custom"; list()->addColumn(tr("%1\n%2").arg(periods.at(c)).arg(customlabel), _bigMoneyColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showcustom) THEN r%1.%2 ELSE NULL END AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2 AS r%3%4, 'curr' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); qzList << QString("(r%1.%2 <> 0)").arg(c).arg(colname); } if(_showCustomPrcnt->isChecked()) { colname = "flrpt_customprcnt"; list()->addColumn(tr("%1\n%2 %").arg(periods.at(c)).arg(customlabel), _ynColumn, Qt::AlignRight, true, QString("r%1%2").arg(c).arg(colname)); q1c += QString(",CASE WHEN(flgrp_summarize AND flgrp_showcustomprcnt) THEN r%1.%2 ELSE NULL END AS r%3%4, 'percent' AS r%5%6_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname).arg(c).arg(colname); sharedColumns += QString(",r%1.%2, 'percent' AS r%3%4_xtnumericrole").arg(c).arg(colname).arg(c).arg(colname); } } q2c += sharedColumns; q3c += sharedColumns; q4c += sharedColumns; q1f += QString(", flrpt AS r%1").arg(c); q1w += QString(" AND (r%1.flrpt_type='G')").arg(c); q1w += QString(" AND (r%1.flrpt_type_id=flgrp_id)").arg(c); q1w += QString(" AND (r%1.flrpt_flhead_id=:flhead_id)").arg(c); q1w += QString(" AND (r%1.flrpt_period_id=%2)").arg(c).arg(periodsRef.at(c)); q1w += QString(" AND (r%1.flrpt_username=getEffectiveXtUser())").arg(c); q1w += QString(" AND (r%1.flrpt_interval='%2')").arg(c).arg(interval); if(c > 0) q1w += QString(" AND (r0.flrpt_order=r%1.flrpt_order)").arg(c); q2f += QString(", flrpt AS r%1").arg(c); q2w += QString(" AND (r%1.flrpt_type='I')").arg(c); q2w += QString(" AND (r%1.flrpt_type_id=flitem_id)").arg(c); q2w += QString(" AND (r%1.flrpt_flhead_id=:flhead_id)").arg(c); q2w += QString(" AND (r%1.flrpt_period_id=%2)").arg(c).arg(periodsRef.at(c)); q2w += QString(" AND (r%1.flrpt_username=getEffectiveXtUser())").arg(c); q2w += QString(" AND (r%1.flrpt_accnt_id=accnt_id)").arg(c); q2w += QString(" AND (r%1.flrpt_interval='%2')").arg(c).arg(interval); if(c > 0) q2w += QString(" AND (r0.flrpt_order=r%1.flrpt_order)").arg(c); q3f += QString(", flrpt AS r%1").arg(c); q3w += QString(" AND (r%1.flrpt_type='S')").arg(c); q3w += QString(" AND (r%1.flrpt_type_id=flspec_id)").arg(c); q3w += QString(" AND (r%1.flrpt_flhead_id=:flhead_id)").arg(c); q3w += QString(" AND (r%1.flrpt_period_id=%2)").arg(c).arg(periodsRef.at(c)); q3w += QString(" AND (r%1.flrpt_username=getEffectiveXtUser())").arg(c); q3w += QString(" AND (r%1.flrpt_interval='%2')").arg(c).arg(interval); if(c > 0) q3w += QString(" AND (r0.flrpt_order=r%1.flrpt_order)").arg(c); if(c > 0) q4f += QString(", flrpt AS r%1").arg(c); else q4f += QString(" flrpt AS r%1").arg(c); q4w += QString(" AND (NOT (r%1.flrpt_type IN ('G','I','S')))").arg(c); q4w += QString(" AND (r%1.flrpt_flhead_id=:flhead_id)").arg(c); q4w += QString(" AND (r%1.flrpt_period_id=%2)").arg(c).arg(periodsRef.at(c)); q4w += QString(" AND (r%1.flrpt_username=getEffectiveXtUser())").arg(c); q4w += QString(" AND (r%1.flrpt_interval='%2')").arg(c).arg(interval); if(c > 0) q4w += QString(" AND (r0.flrpt_order=r%1.flrpt_order)").arg(c); dspFillListTrend.bindValue(":flhead_id", _flhead->id()); dspFillListTrend.bindValue(":period_id", periodsRef.at(c)); dspFillListTrend.bindValue(":interval", interval); dspFillListTrend.bindValue(":prjid", _prjid); dspFillListTrend.exec(); } //Grand Total for Trend Reports if ((_trend->isChecked()) && ((_typeCode == "I") || (_typeCode == "C"))) { if (_budgets->isChecked()) { list()->addColumn( tr("Budget\nTotal"), _bigMoneyColumn, Qt::AlignRight, true, "budgsum"); q1c += ",CASE WHEN(flgrp_summarize AND flgrp_showbudget) THEN (" + qbList.join(" + ") + ") ELSE NULL END AS budgsum, 'curr' AS budgsum_xtnumericrole"; q2c += ", " + qbList.join(" + ") + " AS budgsum, 'curr' AS budgsum_xtnumericrole"; q3c += ", " + qbList.join(" + ") + " AS budgsum, 'curr' AS budgsum_xtnumericrole"; q4c += ", " + qbList.join(" + ") + " AS budgsum, 'curr' AS budgsum_xtnumericrole"; } if (_actuals->isChecked()) { list()->addColumn( tr("Grand\nTotal"), _bigMoneyColumn, Qt::AlignRight, true, "diffsum"); q1c += ",CASE WHEN(flgrp_summarize AND flgrp_showdiff) THEN (" + qtList.join(" + ") + ") ELSE NULL END AS diffsum, 'curr' AS diffsum_xtnumericrole"; q2c += ", " + qtList.join(" + ") + " AS diffsum, 'curr' AS diffsum_xtnumericrole"; q3c += ", " + qtList.join(" + ") + " AS diffsum, 'curr' AS diffsum_xtnumericrole"; q4c += ", " + qtList.join(" + ") + " AS diffsum, 'curr' AS diffsum_xtnumericrole"; } } if (!_showzeros->isChecked()) { q2w += " AND (" + qzList.join(" OR ") + ")"; q3w += " AND (" + qzList.join(" OR ") + ")"; } q1w += ")"; q2w += ")"; q3w += ")"; q4w += ")"; QString query = q1c + q1f + q1w + QString(" UNION ") + q2c + q2f + q2w + QString(" UNION ") + q3c + q3f + q3w + QString(" UNION ") + q4c + q4f + q4w + QString(" ORDER BY orderby;"); dspFillListTrend.prepare(query); dspFillListTrend.bindValue(":flhead_id", _flhead->id()); dspFillListTrend.bindValue(":item", cFlItem); dspFillListTrend.bindValue(":group", cFlGroup); dspFillListTrend.bindValue(":spec", cFlSpec); dspFillListTrend.exec(); list()->populate(dspFillListTrend, true); if (dspFillListTrend.lastError().type() != QSqlError::NoError) { systemError(this, dspFillListTrend.lastError().databaseText(), __FILE__, __LINE__); return; } list()->expandAll(); } void dspFinancialReport::sFillPeriods() { if ((!_trend->isChecked()) || (_month->isChecked())) { _periods->populate("SELECT period_id," "(formatDate(period_start) || '-' || formatDate(period_end)) AS f_name," "period_name AS alt_name " " FROM period " "ORDER BY period_start DESC;" ); } else if (_quarter->isChecked()) { _periods->populate("SELECT LAST(period_id)," "('Q' || period_quarter || '-' || EXTRACT(year from yearperiod_end)) AS f_name," "'' AS alt_name " "FROM " " (SELECT period_id, period_quarter, yearperiod_end " " FROM period,yearperiod " " WHERE (period_yearperiod_id=yearperiod_id) " " ORDER BY period_end) AS data " " GROUP by period_quarter,yearperiod_end " " ORDER by EXTRACT(year from yearperiod_end) DESC, period_quarter DESC"); } else { _periods->populate("SELECT (SELECT LAST(period_id)" " FROM (SELECT period_id,period_start" " FROM period " " WHERE period_yearperiod_id=yearperiod_id " " ORDER BY period_start) " " AS data) AS id," " CAST(EXTRACT(year from yearperiod_end) AS TEXT) AS f_name," " '' AS alt_name " " FROM yearperiod " " ORDER BY EXTRACT(year from yearperiod_end) DESC" ); } } void dspFinancialReport::sCollapsed( QTreeWidgetItem * item ) { for (int i = 0; i < item->childCount(); i++) { XTreeWidgetItem *child = (XTreeWidgetItem*)item->child(i); if(child->altId() == -1) { for (int i = 1; i < list()->columnCount(); i++) item->setText(i, child->text(i)); return; } } } void dspFinancialReport::sExpanded( QTreeWidgetItem * item ) { if(item->childCount() > 0) for(int i = 1; i < list()->columnCount(); i++) item->setText(i, ""); } void dspFinancialReport::sPreview() { ParameterList params; if(!setParams(params)) return; XSqlQuery qry; qry.prepare("SELECT report_source " " FROM report " " WHERE (report_name=:report)" " ORDER BY report_grade DESC " " LIMIT 1;" ); qry.bindValue(":report",reportName()); qry.exec(); qry.first(); QDomDocument _doc; QString errorMessage; int errorLine; if (!_doc.setContent(qry.value("report_source").toString(), &errorMessage, &errorLine)) { QMessageBox::critical(this, tr("Error Parsing Report"), tr("There was an error Parsing the report definition. %1 %2").arg(errorMessage).arg(errorLine)); return; } QPrinter printer(QPrinter::HighResolution); ORPreRender pre; pre.setDom(_doc); pre.setParamList(params); ORODocument * doc = pre.generate(); ORPrintRender render; render.setupPrinter(doc, &printer); PreviewDialog preview (doc, &printer, this); preview.exec(); } void dspFinancialReport::sPrint() { ParameterList params; if(!setParams(params)) return; orReport report(reportName(), params); if (report.isValid()) report.print(); else report.reportError(this); } void dspFinancialReport::sPopulateMenu( QMenu * pMenu ) { pMenu->addAction(tr("Edit Alternate Label..."), this, SLOT(sEditPeriodLabel())); } void dspFinancialReport::sEditPeriodLabel() { XTreeWidgetItem * item = (XTreeWidgetItem*)_periods->currentItem(); if(!item) return; bool ok; QString text = QInputDialog::getText(this, tr("Alternate Label"), tr("Enter an alternate label for the period %1:").arg(item->text(0)), QLineEdit::Normal, item->text(1), &ok); if(ok) item->setText(1, text); } void dspFinancialReport::sReportChanged(int flheadid) { XSqlQuery dspReportChanged; //Populate column layouts dspReportChanged.prepare( "SELECT flcol_id, flcol_name " " FROM flcol " " WHERE flcol_flhead_id=:flhead_id " " ORDER BY flcol_name; "); dspReportChanged.bindValue(":flhead_id", flheadid); dspReportChanged.exec(); _flcol->populate(dspReportChanged); dspReportChanged.prepare("SELECT flhead_usealtbegin, flhead_altbegin," " flhead_usealtend, flhead_altend," " flhead_usealtdebits, flhead_altdebits," " flhead_usealtcredits, flhead_altcredits," " flhead_usealtbudget, flhead_altbudget," " flhead_usealtdiff, flhead_altdiff, " " flhead_type " " FROM flhead" " WHERE (flhead_id=:flhead_id);"); dspReportChanged.bindValue(":flhead_id", flheadid); dspReportChanged.exec(); if(dspReportChanged.first()) { if(dspReportChanged.value("flhead_usealtbegin").toBool()) _columnLabels.insert(cBegining, dspReportChanged.value("flhead_altbegin").toString()); else _columnLabels.insert(cBegining, tr("Beg. Bal.")); if(dspReportChanged.value("flhead_usealtend").toBool()) _columnLabels.insert(cEnding, dspReportChanged.value("flhead_altend").toString()); else if (dspReportChanged.value("flhead_type").toString() == "B") _columnLabels.insert(cEnding, tr("Balance")); else _columnLabels.insert(cEnding, tr("End. Bal.")); if(dspReportChanged.value("flhead_usealtdebits").toBool()) _columnLabels.insert(cDebits, dspReportChanged.value("flhead_altdebits").toString()); else _columnLabels.insert(cDebits, tr("Debits")); if(dspReportChanged.value("flhead_usealtcredits").toBool()) _columnLabels.insert(cCredits, dspReportChanged.value("flhead_altcredits").toString()); else _columnLabels.insert(cCredits, tr("Credits")); if(dspReportChanged.value("flhead_usealtbudget").toBool()) _columnLabels.insert(cBudget, dspReportChanged.value("flhead_altbudget").toString()); else _columnLabels.insert(cBudget, tr("Budget")); if(dspReportChanged.value("flhead_usealtdiff").toBool()) _columnLabels.insert(cDiff, dspReportChanged.value("flhead_altdiff").toString()); else if (dspReportChanged.value("flhead_type").toString() == "I") _columnLabels.insert(cDiff, tr("Income")); else if (dspReportChanged.value("flhead_type").toString() == "C") _columnLabels.insert(cDiff, tr("Cash")); else _columnLabels.insert(cDiff, tr("Difference")); _showBegBal->setText(_columnLabels.value(cBegining)); _showBegBalPrcnt->setText(tr("%1 %").arg(_columnLabels.value(cBegining))); _showEndBal->setText(_columnLabels.value(cEnding)); _showEndBalPrcnt->setText(tr("%1 %").arg(_columnLabels.value(cEnding))); _showDebits->setText(_columnLabels.value(cDebits)); _showDebitsPrcnt->setText(tr("%1 %").arg(_columnLabels.value(cDebits))); _showCredits->setText(_columnLabels.value(cCredits)); _showCreditsPrcnt->setText(tr("%1 %").arg(_columnLabels.value(cCredits))); _showBudget->setText(_columnLabels.value(cBudget)); _showBudgetPrcnt->setText(tr("%1 %").arg(_columnLabels.value(cBudget))); _showDiff->setText(_columnLabels.value(cDiff)); _showDiffPrcnt->setText(tr("%1 %").arg(_columnLabels.value(cDiff))); if (dspReportChanged.value("flhead_type").toString()== "A") { _tab->setTabEnabled(_tab->indexOf(_showColumnsTab),true); _trend->setChecked(true); _periods->setSelectionMode(QAbstractItemView::ExtendedSelection); _flcol->setEnabled(false); _type->setText(tr("Ad Hoc")); _typeCode = "A"; } else { _typeCode = dspReportChanged.value("flhead_type").toString(); if (_typeCode== "I") _type->setText(tr("Income Statement")); if (_typeCode== "B") _type->setText(tr("Balance Sheet")); if (_typeCode== "C") _type->setText(tr("Cash Flow Statement")); _tab->setTabEnabled(_tab->indexOf(_showColumnsTab),false); _trend->setChecked(false); sTogglePeriod(); } } sToggleTrend(); } void dspFinancialReport::sToggleTrend() { if (!_trend->isChecked()) { if (_typeCode == "A") _trend->setChecked(true); } else { _actuals->setDisabled(_typeCode == "A"); _budgets->setDisabled(_typeCode == "A"); } sToggleNotes(); } void dspFinancialReport::sToggleNotes() { _notesAct->setEnabled(_periods->selectedItems().count() && !_trend->isChecked()); } void dspFinancialReport::sTogglePeriod() { if (_trend->isChecked()) { _periods->setSelectionMode(QAbstractItemView::MultiSelection); _flcol->setEnabled(false); } else { _periods->setSelectionMode(QAbstractItemView::SingleSelection); _flcol->setEnabled(true); } } bool dspFinancialReport::forwardUpdate() { XSqlQuery dspforwardUpdate; QString sql( "SELECT MIN(forwardUpdateAccount(accnt_id)) AS result " "FROM accnt;" ); ParameterList params; MetaSQLQuery mql(sql); dspforwardUpdate = mql.toQuery(params); if (dspforwardUpdate.first()) { int result = dspforwardUpdate.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("forwardUpdateTrialBalance", result), __FILE__, __LINE__); return false; } } else if (dspforwardUpdate.lastError().type() != QSqlError::NoError) { systemError(this, dspforwardUpdate.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } QString dspFinancialReport::reportName() const { if (_trend->isChecked()) { if (_typeCode == "A") return "FinancialReport"; else return "FinancialTrend"; } else { XSqlQuery qry; qry.prepare("SELECT report_name " "FROM flcol " " JOIN report ON (flcol_report_id=report_id)" "WHERE (flcol_id=:flcol_id);" ); qry.bindValue(":flcol_id",_flcol->id()); qry.exec(); if (qry.first()) return qry.value("report_name").toString(); } return QString(); } ParameterList dspFinancialReport::getParams() { ParameterList params; bool ret = setParams(params); params.append("checkParamsReturn", ret); return params; } bool dspFinancialReport::setParams(ParameterList ¶ms) { QString interval; if (_month->isChecked()) interval = "M"; else if (_quarter->isChecked()) interval = "Q"; else interval = "Y"; if(_shownumbers->isChecked()) params.append("shownumbers"); if(_showzeros->isChecked()) params.append("showzeros"); if (_trend->isChecked()) { if (_actuals->isChecked()) params.append("showActuals"); if (_budgets->isChecked()) params.append("showBudgets"); } if (_prjid != -1) { params.append("project", tr("Project:")); params.append("prj_id", _prjid); } QList periodList; QTreeWidgetItem* selected; for (int i = 0; i < _periods->topLevelItemCount(); i++) { if (_periods->topLevelItem(i)->isSelected()) { selected = _periods->topLevelItem(i); periodList.prepend(((XTreeWidgetItem*)(selected))->id()); } } if(periodList.isEmpty()) { QMessageBox::warning(this, tr("No Period(s) Selected"), tr("You must select at least one period to report on.") ); return false; } if (_trend->isChecked()) { params.append("flhead_id", _flhead->id()); params.append("period_id_list", periodList); params.append("interval", interval); } else if (!reportName().isEmpty()) { params.append("flcol_id", _flcol->id()); params.append("period_id", periodList.at(0)); } return true; } void dspFinancialReport::sNotes() { ParameterList params; params.append("period_id", _periods->id()); params.append("flhead_id", _flhead->id()); financialReportNotes newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } bool dspFinancialReport::columnHasTransactions(int col) { return _columnDates.contains(col); } QDate dspFinancialReport::columnStart(int col) { return _columnDates.value(col).first; } QDate dspFinancialReport::columnEnd(int col) { return _columnDates.value(col).second; } qt-client-4.1.0/guiclient/dspFinancialReport.h000066400000000000000000000043241217451700100213400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPFINANCIALREPORT_H #define DSPFINANCIALREPORT_H class GroupBalances; #include "display.h" #include #include #include "ui_dspFinancialReport.h" class dspFinancialReport : public display, public Ui::dspFinancialReport { Q_OBJECT public: dspFinancialReport(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); Q_INVOKABLE virtual bool setParams(ParameterList &); Q_INVOKABLE int projectId() { return _prjid; } Q_INVOKABLE void setProjectId(int p) { _prjid = p; } Q_INVOKABLE QString reportName() const; Q_INVOKABLE bool columnHasTransactions(int col); Q_INVOKABLE QDate columnStart(int col); Q_INVOKABLE QDate columnEnd(int col); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sFillList(); virtual void sPrint(); virtual void sPreview(); virtual void sPopulateMenu(QMenu * pMenu); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * pSelected, int pColumn); virtual void sFillListStatement(); virtual void sFillListTrend(); virtual void sFillPeriods(); virtual void sEditPeriodLabel(); virtual void sTogglePeriod(); virtual void sToggleTrend(); virtual void sToggleNotes(); virtual bool sCheck(); virtual void sNotes(); virtual void sViewTransactions(); protected slots: virtual void sCollapsed( QTreeWidgetItem * item ); virtual void sExpanded( QTreeWidgetItem * item ); virtual void sReportChanged(int); protected: virtual bool forwardUpdate(); Q_INVOKABLE ParameterList getParams(); private: int _prjid; int _col; QMap _columnLabels; QMap > _columnDates; QAction *_notesAct; QString _typeCode; }; #endif // DSPFINANCIALREPORT_H qt-client-4.1.0/guiclient/dspFinancialReport.ui000066400000000000000000000313751217451700100215340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspFinancialReport 0 0 629 313 View Financial Report Financial Report: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Column Layout: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _flcol 0 0 Report Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _type Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true 1 0 0 Periods QAbstractItemView::MultiSelection Columns Beg. Bal. Beg. Bal. % Debits Debits % Credits Credits % End. Bal. End. Bal. % Budget Budget % Difference Difference % Custom Custom % Trend Report true false 12 Month true Quarter Year Budgets Actuals true Qt::Horizontal 13 20 230 16 Show 12 Account Numbers true Zero Amounts true Qt::Horizontal 0 20 XCheckBox QCheckBox

    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _flhead _flcol _showBegBal _showBegBalPrcnt _showDebits _showDebitsPrcnt _showCredits _showCreditsPrcnt _showEndBal _showEndBalPrcnt _showBudget _showBudgetPrcnt _showDiff _showDiffPrcnt _showCustom _showCustomPrcnt _shownumbers _showzeros _periods _trend toggled(bool) _flcol setDisabled(bool) 549 93 179 74 qt-client-4.1.0/guiclient/dspInvoiceInformation.cpp000066400000000000000000000177451217451700100224300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspInvoiceInformation.h" #include #include #include "invoice.h" #include #include #include #include "mqlutil.h" dspInvoiceInformation::dspInvoiceInformation(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_invoiceNumber, SIGNAL(newInvoiceNumber(QString)), this, SLOT(sParseInvoiceNumber())); connect(_invoiceList, SIGNAL(clicked()), this, SLOT(sInvoiceList())); connect(_view, SIGNAL(clicked()), this, SLOT(sViewDetails())); _invoiceAmount->setPrecision(omfgThis->moneyVal()); #ifndef Q_WS_MAC _invoiceList->setMaximumWidth(25); #endif _cust->setReadOnly(TRUE); _arapply->addColumn(tr("Type"), _dateColumn, Qt::AlignCenter,true, "doctype"); _arapply->addColumn(tr("Doc./Ref. #"), -1, Qt::AlignLeft, true, "docnumber"); _arapply->addColumn(tr("Apply Date"), _dateColumn, Qt::AlignCenter,true, "arapply_postdate"); _arapply->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "arapply_applied"); _arapply->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currabbr"); _arapply->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight, true, "baseapplied"); if (omfgThis->singleCurrency()) _arapply->hideColumn("currabbr"); _invcheadid = -1; } dspInvoiceInformation::~dspInvoiceInformation() { // no need to delete child widgets, Qt does it all for us } void dspInvoiceInformation::languageChange() { retranslateUi(this); } enum SetResponse dspInvoiceInformation::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("invoiceNumber", &valid); if (valid) { _invoiceNumber->setInvoiceNumber(param.toString()); _invoiceNumber->setEnabled(FALSE); _invoiceList->hide(); } return NoError; } void dspInvoiceInformation::sParseInvoiceNumber() { XSqlQuery dspParseInvoiceNumber; dspParseInvoiceNumber.prepare( "SELECT invchead_id, invchead_cust_id, invchead_ponumber," " invchead_shipdate, invchead_invcdate," " invoiceTotal(invchead_id) AS amount," " invchead_billto_name, invchead_billto_address1," " invchead_billto_address2, invchead_billto_address3," " invchead_billto_city, invchead_billto_state, invchead_billto_zipcode," " invchead_shipto_name, invchead_shipto_address1," " invchead_shipto_address2, invchead_shipto_address3," " invchead_shipto_city, invchead_shipto_state, invchead_shipto_zipcode," " invchead_notes " "FROM invchead LEFT OUTER JOIN" " ( invcitem LEFT OUTER JOIN item" " ON (invcitem_item_id=item_id) )" " ON (invcitem_invchead_id=invchead_id) " "WHERE (invchead_invcnumber=:invoiceNumber) " "GROUP BY invchead_id, invchead_cust_id, invchead_ponumber," " invchead_shipdate, invchead_invcdate," " invchead_misc_amount, invchead_freight," " invchead_billto_name, invchead_billto_address1," " invchead_billto_address2, invchead_billto_address3," " invchead_billto_city, invchead_billto_state, invchead_billto_zipcode," " invchead_shipto_name, invchead_shipto_address1," " invchead_shipto_address2, invchead_shipto_address3," " invchead_shipto_city, invchead_shipto_state, invchead_shipto_zipcode," " invchead_notes;" ); dspParseInvoiceNumber.bindValue(":invoiceNumber", _invoiceNumber->invoiceNumber()); dspParseInvoiceNumber.exec(); if (dspParseInvoiceNumber.first()) { _print->setEnabled(TRUE); _view->setEnabled(TRUE); _invcheadid = dspParseInvoiceNumber.value("invchead_id").toInt(); _custPoNumber->setText(dspParseInvoiceNumber.value("invchead_ponumber").toString()); _cust->setId(dspParseInvoiceNumber.value("invchead_cust_id").toInt()); _invoiceDate->setDate(dspParseInvoiceNumber.value("invchead_invcdate").toDate()); _shipDate->setDate(dspParseInvoiceNumber.value("invchead_shipdate").toDate()); _invoiceAmount->setDouble(dspParseInvoiceNumber.value("amount").toDouble()); _billToName->setText(dspParseInvoiceNumber.value("invchead_billto_name")); _billToAddress1->setText(dspParseInvoiceNumber.value("invchead_billto_address1")); _billToAddress2->setText(dspParseInvoiceNumber.value("invchead_billto_address2")); _billToAddress3->setText(dspParseInvoiceNumber.value("invchead_billto_address3")); _billToCity->setText(dspParseInvoiceNumber.value("invchead_billto_city")); _billToState->setText(dspParseInvoiceNumber.value("invchead_billto_state")); _billToZip->setText(dspParseInvoiceNumber.value("invchead_billto_zipcode")); _shipToName->setText(dspParseInvoiceNumber.value("invchead_shipto_name")); _shipToAddress1->setText(dspParseInvoiceNumber.value("invchead_shipto_address1")); _shipToAddress2->setText(dspParseInvoiceNumber.value("invchead_shipto_address2")); _shipToAddress3->setText(dspParseInvoiceNumber.value("invchead_shipto_address3")); _shipToCity->setText(dspParseInvoiceNumber.value("invchead_shipto_city")); _shipToState->setText(dspParseInvoiceNumber.value("invchead_shipto_state")); _shipToZip->setText(dspParseInvoiceNumber.value("invchead_shipto_zipcode")); _notes->setText(dspParseInvoiceNumber.value("invchead_notes").toString()); MetaSQLQuery mql = mqlLoad("invoiceInformation", "detail"); ParameterList params; if (! setParams(params)) return; dspParseInvoiceNumber = mql.toQuery(params); _arapply->populate(dspParseInvoiceNumber); } else { if (dspParseInvoiceNumber.lastError().type() != QSqlError::NoError) systemError(this, dspParseInvoiceNumber.lastError().databaseText(), __FILE__, __LINE__); _print->setEnabled(FALSE); _view->setEnabled(FALSE); _invoiceNumber->clear(); _arapply->clear(); _invcheadid = -1; } } bool dspInvoiceInformation::setParams(ParameterList ¶ms) { params.append("creditMemo", tr("C/M")); params.append("cashdeposit", tr("Cash Deposit")); params.append("error", tr("Error")); params.append("check", tr("Check")); params.append("certifiedCheck", tr("Certified Check")); params.append("masterCard", tr("Master Card")); params.append("visa", tr("Visa")); params.append("americanExpress", tr("American Express")); params.append("discoverCard", tr("Discover Card")); params.append("otherCreditCard", tr("Other Credit Card")); params.append("cash", tr("Cash")); params.append("wireTransfer", tr("Wire Transfer")); params.append("other", tr("ther")); params.append("aropen_docnumber", _invoiceNumber->invoiceNumber()); return true; } void dspInvoiceInformation::sPrint() { ParameterList params; params.append("invchead_id", _invcheadid); orReport report("InvoiceInformation", params); if (report.isValid()) report.print(); else report.reportError(this); } void dspInvoiceInformation::sViewDetails() { invoice::viewInvoice(_invcheadid); } void dspInvoiceInformation::sInvoiceList() { ParameterList params; params.append("invoiceNumber", _invoiceNumber->invoiceNumber()); invoiceList newdlg(this, "", TRUE); newdlg.set(params); int invoiceid = newdlg.exec(); if (invoiceid > 0) _invoiceNumber->setId(invoiceid); } qt-client-4.1.0/guiclient/dspInvoiceInformation.h000066400000000000000000000023111217451700100220540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPINVOICEINFORMATION_H #define DSPINVOICEINFORMATION_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_dspInvoiceInformation.h" class dspInvoiceInformation : public XWidget, public Ui::dspInvoiceInformation { Q_OBJECT public: dspInvoiceInformation(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspInvoiceInformation(); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set(const ParameterList & pParams ); protected slots: virtual void languageChange(); virtual void sParseInvoiceNumber(); virtual void sPrint(); virtual void sViewDetails(); virtual void sInvoiceList(); private: int _invcheadid; }; #endif // DSPINVOICEINFORMATION_H qt-client-4.1.0/guiclient/dspInvoiceInformation.ui000066400000000000000000000524771217451700100222640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspInvoiceInformation 0 0 669 559 Invoice Information 0 5 0 5 0 7 0 5 &Invoice #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _invoiceNumber ... 0 5 Customer P/O #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 5 0 0 100 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 7 0 0 Qt::StrongFocus Qt::Vertical QSizePolicy::Preferred 20 0 0 5 0 5 0 0 Invoice Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ship Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 false false Qt::Horizontal QSizePolicy::Expanding 11 10 0 5 Invoice Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 98 20 0 0 0 5 &Close false &View Details false &Print Qt::Vertical QSizePolicy::Preferred 20 20 0 7 0 0 Bill-to: false false false false 0 5 false false 40 32767 false false 0 0 Ship-to: false false false Qt::AlignLeading false 0 5 false false 40 32767 false false 0 0 Notes: false Applications: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 7 7 0 0 0 100 XLineEdit QLineEdit
    xlineedit.h
    DLineEdit XLineEdit
    datecluster.h
    CustCluster QWidget
    custcluster.h
    InvoiceLineEdit XLineEdit
    invoicelineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    XTextEdit QTextEdit
    xtextedit.h
    _invoiceNumber _invoiceList _cust _invoiceDate _shipDate _billToName _billToAddress1 _billToAddress2 _billToAddress3 _billToCity _billToState _billToZip _billToPhone _shipToName _shipToAddress1 _shipToAddress2 _shipToAddress3 _shipToCity _shipToState _shipToZip _shipToPhone _notes _arapply _view _print _close _close clicked() dspInvoiceInformation close() 602 29 20 20
    qt-client-4.1.0/guiclient/dspMRPDetail.cpp000066400000000000000000000257051217451700100204020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspMRPDetail.h" #include #include #include #include #include #include #include #include #include "dspAllocations.h" #include "dspOrders.h" #include "purchaseOrder.h" #include "purchaseRequest.h" #include "workOrder.h" #include "mqlutil.h" dspMRPDetail::dspMRPDetail(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_itemsite, SIGNAL(itemSelected(int)), this, SLOT(sFillMRPDetail())); connect(_itemsite, SIGNAL(itemSelectionChanged()), this, SLOT(sFillMRPDetail())); connect(_mrp, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*,int))); connect(_plannerCode, SIGNAL(updated()), this, SLOT(sFillItemsites())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillItemsites())); _plannerCode->setType(ParameterGroup::PlannerCode); _itemsite->addColumn("Itemtype", 0, Qt::AlignCenter,false,"item_type"); _itemsite->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); _itemsite->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); _itemsite->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _mrp->addColumn("", 120, Qt::AlignRight); sFillItemsites(); } dspMRPDetail::~dspMRPDetail() { // no need to delete child widgets, Qt does it all for us } void dspMRPDetail::languageChange() { retranslateUi(this); } void dspMRPDetail::sPrint() { XSqlQuery dspPrint; if ( (_periods->isPeriodSelected()) && (_itemsite->id() != -1) ) { XSqlQuery wsq ( QString( "SELECT mrpReport(%1, '%2') as worksetid;") .arg(_itemsite->id()) .arg(_periods->periodString()) ); if(wsq.first()) { ParameterList params; _plannerCode->appendValue(params); _warehouse->appendValue(params); QList selected = _periods->selectedItems(); QList periodList; for (int i = 0; i < selected.size(); i++) periodList.append(((XTreeWidgetItem*)selected[i])->id()); params.append("period_id_list", periodList); params.append("itemsite_id", _itemsite->id()); params.append("workset_id", wsq.value("worksetid").toInt()); orReport report("MRPDetail", params); if (report.isValid()) report.print(); else { report.reportError(this); return; } XSqlQuery dwsq( QString( "SELECT deleteMPSMRPWorkset(%1) as result") .arg(wsq.value("worksetid").toInt()) ); } else if (dspPrint.lastError().type() != QSqlError::NoError) { systemError(this, dspPrint.lastError().databaseText(), __FILE__, __LINE__); return; } } else QMessageBox::critical(this, tr("Incomplete criteria"), tr("

    The criteria you specified is not complete. " "Please make sure all fields are correctly filled " "out before running the report." ) ); } void dspMRPDetail::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int pColumn) { QAction *menuItem; int mrpIndex = 0; _column = pColumn; menuItem = pMenu->addAction(tr("View Allocations..."), this, SLOT(sViewAllocations())); while ((mrpIndex < _mrp->topLevelItemCount()) && (_mrp->topLevelItem(mrpIndex)->text(0) != tr("Allocations"))) mrpIndex++; if (_mrp->topLevelItem(mrpIndex)->text(pColumn).toDouble() == 0.0) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View Orders..."), this, SLOT(sViewOrders())); while ((mrpIndex < _mrp->topLevelItemCount()) && (_mrp->topLevelItem(mrpIndex)->text(0) != tr("Orders"))) mrpIndex++; if (_mrp->topLevelItem(mrpIndex)->text(pColumn).toDouble() == 0.0) menuItem->setEnabled(false); pMenu->addSeparator(); if (_itemsite->currentItem()->text(0) == "P") { menuItem = pMenu->addAction(tr("Issue P/R..."), this, SLOT(sIssuePR())); if (!_privileges->check("MaintainPurchaseRequests")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Issue P/O..."), this, SLOT(sIssuePO())); if (!_privileges->check("MaintainPurchaseOrders")) menuItem->setEnabled(false); } else if (_itemsite->currentItem()->text(0) == "M") { menuItem = pMenu->addAction(tr("Issue W/O..."), this, SLOT(sIssueWO())); if (!_privileges->check("MaintainWorkOrders")) menuItem->setEnabled(false); } } void dspMRPDetail::sViewAllocations() { ParameterList params; params.append("itemsite_id", _itemsite->id()); params.append("byRange"); params.append("startDate", _periods->getSelected(_column)->startDate()); params.append("endDate", _periods->getSelected(_column)->endDate()); params.append("run"); dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspMRPDetail::sViewOrders() { ParameterList params; params.append("itemsite_id", _itemsite->id()); params.append("byRange"); params.append("startDate", _periods->getSelected(_column)->startDate()); params.append("endDate", _periods->getSelected(_column)->endDate()); params.append("run"); dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspMRPDetail::sIssuePR() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", _itemsite->id()); purchaseRequest newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillMRPDetail(); } void dspMRPDetail::sIssuePO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", _itemsite->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); } void dspMRPDetail::sIssueWO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", _itemsite->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void dspMRPDetail::sFillItemsites() { XSqlQuery dspFillItemsites; ParameterList params; if (! setParams(params)) return; MetaSQLQuery mql = mqlLoad("mrpDetail", "item"); dspFillItemsites = mql.toQuery(params); _itemsite->populate(dspFillItemsites, true); } void dspMRPDetail::sFillMRPDetail() { XSqlQuery dspFillMRPDetail; _mrp->clear(); _mrp->setColumnCount(1); QList selected = _periods->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem *cursor = (XTreeWidgetItem*)selected[i]; _mrp->addColumn(formatDate(((PeriodListViewItem *)cursor)->startDate()), _qtyColumn, Qt::AlignRight); } XTreeWidgetItem *qoh = 0; XTreeWidgetItem *allocations = 0; XTreeWidgetItem *orders = 0; XTreeWidgetItem *availability = 0; XTreeWidgetItem *firmedAllocations = 0; XTreeWidgetItem *firmedOrders = 0; XTreeWidgetItem *firmedAvailability = 0; double runningAvailability = 0.0; double runningFirmed = 0.0; int counter = 0; for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem *cursor = (XTreeWidgetItem*)selected[i]; counter++; ParameterList params; params.append("cursorId", cursor->id()); params.append("counter", counter); params.append("itemsite_id", _itemsite->id()); MetaSQLQuery mql = mqlLoad("mrpDetail", "detail"); dspFillMRPDetail = mql.toQuery(params); if (dspFillMRPDetail.first()) { if (counter == 1) { runningFirmed = dspFillMRPDetail.value("firmedorders1").toDouble(); runningAvailability = (dspFillMRPDetail.value("itemsite_qtyonhand").toDouble() - dspFillMRPDetail.value("allocations1").toDouble() + dspFillMRPDetail.value("orders1").toDouble()); qoh = new XTreeWidgetItem(_mrp, 0, QVariant(tr("Projected QOH")), dspFillMRPDetail.value("f_qoh")); allocations = new XTreeWidgetItem(_mrp, qoh, 0, QVariant(tr("Allocations")), formatQty(dspFillMRPDetail.value("allocations1").toDouble())); orders = new XTreeWidgetItem(_mrp, allocations, 0, QVariant(tr("Orders")), formatQty(dspFillMRPDetail.value("orders1").toDouble())); availability = new XTreeWidgetItem(_mrp, orders, 0, QVariant(tr("Availability")), formatQty(runningAvailability)); firmedAllocations = new XTreeWidgetItem(_mrp, availability, 0, QVariant(tr("Firmed Allocations")), formatQty(dspFillMRPDetail.value("firmedallocations1").toDouble())); firmedOrders = new XTreeWidgetItem(_mrp, firmedAllocations, 0, QVariant(tr("Firmed Orders")), formatQty(runningFirmed)); firmedAvailability = new XTreeWidgetItem(_mrp, firmedOrders, 0, QVariant(tr("Firmed Availability")), formatQty( runningAvailability - dspFillMRPDetail.value("firmedallocations1").toDouble() + runningFirmed ) ); } else { qoh->setText(counter, formatQty(runningAvailability)); allocations->setText(counter, formatQty(dspFillMRPDetail.value(QString("allocations%1").arg(counter)).toDouble())); orders->setText(counter, formatQty(dspFillMRPDetail.value(QString("orders%1").arg(counter)).toDouble())); runningAvailability = ( runningAvailability - dspFillMRPDetail.value(QString("allocations%1").arg(counter)).toDouble() + dspFillMRPDetail.value(QString("orders%1").arg(counter)).toDouble() ); availability->setText(counter, formatQty(runningAvailability)); firmedAllocations->setText(counter, formatQty(dspFillMRPDetail.value(QString("firmedallocations%1").arg(counter)).toDouble())); runningFirmed += dspFillMRPDetail.value(QString("firmedorders%1").arg(counter)).toDouble(); firmedOrders->setText(counter, formatQty(runningFirmed)); firmedAvailability->setText(counter, formatQty( runningAvailability - dspFillMRPDetail.value(QString("firmedallocations%1").arg(counter)).toDouble() + runningFirmed ) ); } } } } bool dspMRPDetail::setParams(ParameterList ¶ms) { _plannerCode->appendValue(params); if (_warehouse->isSelected()) params.append("warehous_id", _warehouse->id()); return true; } qt-client-4.1.0/guiclient/dspMRPDetail.h000066400000000000000000000024101217451700100200330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPMRPDETAIL_H #define DSPMRPDETAIL_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_dspMRPDetail.h" class dspMRPDetail : public XWidget, public Ui::dspMRPDetail { Q_OBJECT public: dspMRPDetail(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspMRPDetail(); virtual bool setParams(ParameterList &); public slots: virtual void sPrint(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem *, int pColumn ); virtual void sViewAllocations(); virtual void sViewOrders(); virtual void sIssuePR(); virtual void sIssuePO(); virtual void sIssueWO(); virtual void sFillItemsites(); virtual void sFillMRPDetail(); protected slots: virtual void languageChange(); private: int _column; }; #endif // DSPMRPDETAIL_H qt-client-4.1.0/guiclient/dspMRPDetail.ui000066400000000000000000000221231217451700100202240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspMRPDetail 0 0 800 600 MRP Detail 12 12 false false Qt::Horizontal 0 20 0 0 &Close &Print Qt::Vertical QSizePolicy::Expanding 20 0 7 0 5 Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::MinimumExpanding 20 20 0 Item Sites: 0 0 0 100 0 MRP Detail: 0 0 0 165 CalendarComboBox XComboBox

    calendarTools.h
    ParameterGroup QGroupBox
    parametergroup.h
    PeriodsListView XTreeWidget
    calendarTools.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _warehouse _plannerCode _periods _itemsite _mrp _print _close parameter.h calendarTools.h _close clicked() dspMRPDetail close() 20 20 20 20 _calendar newCalendarId(int) _periods populate(int) 142 135 522 181 _calendar select(ParameterList&) _periods load(ParameterList&) 142 135 522 181 qt-client-4.1.0/guiclient/dspTaxHistory.cpp000066400000000000000000000261511217451700100207330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "dspTaxHistory.h" #include #include #include #include #include "currdisplay.h" #include "mqlutil.h" dspTaxHistory::dspTaxHistory(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_filterOn, SIGNAL(currentIndexChanged(int)), this, SLOT(sHandleFilter())); connect(_showOnlyGroup, SIGNAL(toggled(bool)), this, SLOT(sHandleFilter())); connect(_summary, SIGNAL(toggled(bool)), this, SLOT(sHandleType())); connect(_sales, SIGNAL(toggled(bool)), this, SLOT(sHandleType())); connect(_purchases, SIGNAL(toggled(bool)), this, SLOT(sHandleType())); QString base = CurrDisplay::baseCurrAbbr(); _taxdet->addColumn(tr("Doc#"), _orderColumn, Qt::AlignLeft, true, "docnumber" ); _taxdet->addColumn(tr("Source"), _orderColumn, Qt::AlignLeft, true, "source" ); _taxdet->addColumn(tr("Doc. Type"), _orderColumn, Qt::AlignLeft, true, "doctype" ); _taxdet->addColumn(tr("Order#"), _orderColumn, Qt::AlignLeft, false, "ordernumber" ); _taxdet->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter,true, "docdate" ); _taxdet->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter,false, "taxhist_distdate" ); _taxdet->addColumn(tr("Journal#"), _orderColumn, Qt::AlignRight, false, "taxhist_journalnumber" ); _taxdet->addColumn(tr("Name"), _orderColumn, Qt::AlignLeft, false, "name" ); _taxdet->addColumn(tr("Tax Code"), _itemColumn, Qt::AlignLeft, true, "tax" ); _taxdet->addColumn(tr("Tax Type"), _itemColumn, Qt::AlignLeft, false, "taxtype" ); _taxdet->addColumn(tr("Tax Zone"), _itemColumn, Qt::AlignLeft, false, "taxzone" ); _taxdet->addColumn(tr("Tax Class"), _itemColumn, Qt::AlignLeft, false, "taxclass" ); _taxdet->addColumn(tr("Tax Authority"), _itemColumn, Qt::AlignLeft, false, "taxauth" ); _taxdet->addColumn(tr("Item#"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _taxdet->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); _taxdet->addColumn(tr("Qty"), _qtyColumn, Qt::AlignRight, false, "qty" ); _taxdet->addColumn(tr("Unit Price"), _moneyColumn, Qt::AlignRight, false, "unitprice" ); _taxdet->addColumn(tr("Extension"), _moneyColumn, Qt::AlignRight, false, "amount" ); _taxdet->addColumn(tr("Tax"), _moneyColumn, Qt::AlignRight, true, "taxlocal" ); _taxdet->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight, true, "curr_abbr" ); _taxdet->addColumn(tr("Tax %1").arg(base), _moneyColumn, Qt::AlignRight, true, "taxbase" ); sHandleType(); } dspTaxHistory::~dspTaxHistory() { // no need to delete child widgets, Qt does it all for us } void dspTaxHistory::languageChange() { retranslateUi(this); } enum SetResponse dspTaxHistory::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("type", &valid); if (valid) { if (param.toString() == "detail") _detail->setChecked(true); } param = pParams.value("showSales", &valid); if (valid) _sales->setChecked(param.toBool()); param = pParams.value("showPurchases", &valid); if (valid) _purchases->setChecked(param.toBool()); param = pParams.value("startDate", &valid); if (valid) _dates->setStartDate(param.toDate()); param = pParams.value("endDate", &valid); if (valid) _dates->setStartDate(param.toDate()); if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } bool dspTaxHistory::setParams(ParameterList ¶ms) { if (!(_sales->isChecked() || _purchases->isChecked())) { QMessageBox::warning( this, tr("Select items to show"), tr("You must select sales or purchase items to show.") ); return false; } if (!_dates->startDate().isValid()) { QMessageBox::warning( this, tr("Enter Valid Start Date"), tr("You must enter a valid Start Date to print this report.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::warning( this, tr("Enter Valid End Date"), tr("You must enter a valid End Date to print this report.") ); _dates->setFocus(); return false; } if (_summary->isChecked()) params.append("type", "summary"); else params.append("type", "detail"); if (_sales->isChecked()) params.append("showSales"); if (_purchases->isChecked()) params.append("showPurchases"); if (_distDate->isChecked()) params.append("distDate"); _dates->appendValue(params); params.append("selection", _selection->currentText()); if (((_showOnlyGroup->isCheckable() && _showOnlyGroup->isChecked()) || !_showOnlyGroup->isCheckable()) && _selection->id() != -1) { switch (_filterOn->currentIndex()) { case 0: params.append("tax_id",_selection->id()); break; case 1: params.append("taxtype_id",_selection->id()); break; case 2: params.append("taxclass_id",_selection->id()); break; case 3: params.append("taxauth_id",_selection->id()); break; case 4: params.append("taxzone_id",_selection->id()); break; } } if (_summary->isChecked()) params.append("summary"); if ((_showOnlyGroup->isCheckable() && _showOnlyGroup->isChecked()) || _summary->isChecked()) { switch (_filterOn->currentIndex()) { case 0: params.append("groupBy","tax"); params.append("groupProper",tr("Tax Code")); break; case 1: params.append("groupBy","taxtype"); params.append("groupProper",tr("Tax Type")); break; case 2: params.append("groupBy","taxclass"); params.append("groupProper",tr("Tax Class")); break; case 3: params.append("groupBy","taxauth"); params.append("groupProper",tr("Tax Authority")); break; case 4: params.append("groupBy","taxzone"); params.append("groupProper",tr("Tax Zone")); break; } } params.append("invoice",tr("Invoice")); params.append("creditmemo",tr("Credit Memo")); params.append("debitmemo",tr("Debit Memo")); params.append("other",tr("Other")); params.append("none",tr("None")); params.append("sales",tr("Sales")); params.append("purchase",tr("Purchase")); params.append("voucher",tr("Voucher")); return true; } void dspTaxHistory::sPrint() { QString name; if (_summary->isChecked()) name="TaxHistorySummary"; else name="TaxHistoryDetail"; ParameterList params; if (! setParams(params)) return; orReport report(name, params); if (report.isValid()) report.print(); else report.reportError(this); } void dspTaxHistory::sFillList() { XSqlQuery dspFillList; ParameterList params; if (! setParams(params)) return; _taxsum->clear(); _taxdet->clear(); MetaSQLQuery mql = mqlLoad("taxHistory", "detail"); dspFillList = mql.toQuery(params); dspFillList.exec(); if (_summary->isChecked()) _taxsum->populate(dspFillList); else _taxdet->populate(dspFillList); if (dspFillList.lastError().type() != QSqlError::NoError) { systemError(this, dspFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void dspTaxHistory::sHandleFilter() { _selection->setType(XComboBox::Adhoc); // Force to re-evaluate if null state changed switch (_filterOn->currentIndex()) { case 0: _selection->setType(XComboBox::TaxCodes); break; case 1: _selection->setType(XComboBox::TaxTypes); break; case 2: _selection->setType(XComboBox::TaxClasses); break; case 3: _selection->setType(XComboBox::TaxAuths); break; case 4: _selection->setType(XComboBox::TaxZones); break; } if (_summary->isChecked()) { QString base = CurrDisplay::baseCurrAbbr(); _taxsum->clear(); _taxsum->setColumnCount(0); switch (_filterOn->currentIndex()) { case 0: _taxsum->addColumn(tr("Tax Code"), _itemColumn, Qt::AlignLeft, true, "tax" ); break; case 1: _taxsum->addColumn(tr("Tax Type"), _itemColumn, Qt::AlignLeft, true, "taxtype" ); break; case 2: _taxsum->addColumn(tr("Tax Class"), _itemColumn, Qt::AlignLeft, true, "taxclass" ); break; case 3: _taxsum->addColumn(tr("Tax Authority"), _itemColumn, Qt::AlignLeft, true, "taxauth" ); break; case 4: _taxsum->addColumn(tr("Tax Zone"), _itemColumn, Qt::AlignLeft, true, "taxzone" ); break; } _taxsum->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); if (_sales->isChecked()) { _taxsum->addColumn(tr("Sales %1").arg(base), _bigMoneyColumn, Qt::AlignRight, true, "salesbase" ); _taxsum->addColumn(tr("Sales Freight %1").arg(base),_bigMoneyColumn, Qt::AlignRight, true, "freightbase" ); _taxsum->addColumn(tr("Freight Taxed"), _itemColumn, Qt::AlignCenter, true, "freighttax" ); _taxsum->addColumn(tr("Sales Tax %1").arg(base), _bigMoneyColumn, Qt::AlignRight, true, "salestaxbase" ); } if (_purchases->isChecked()) { _taxsum->addColumn(tr("Purchases %1").arg(base), _bigMoneyColumn, Qt::AlignRight, true, "purchasebase" ); _taxsum->addColumn(tr("Purchase Tax %1").arg(base), _bigMoneyColumn, Qt::AlignRight, true, "purchasetaxbase" ); } if (_sales->isChecked() && _purchases->isChecked()) _taxsum->addColumn(tr("Net Tax %1").arg(base), _bigMoneyColumn, Qt::AlignRight, true, "nettaxbase" ); } } void dspTaxHistory::sHandleType() { if (_summary->isChecked()) { _showOnlyGroup->setTitle(tr("Summarize by")); _showOnlyGroup->setCheckable(false); _showOnlyGroup->setEnabled(true); _taxdet->hide(); _taxsum->show(); _selection->setAllowNull(true); } else { _showOnlyGroup->setTitle(tr("Show only tax")); _showOnlyGroup->setCheckable(true); _showOnlyGroup->setChecked(false); _taxsum->hide(); _taxdet->show(); _selection->setAllowNull(false); } sHandleFilter(); } qt-client-4.1.0/guiclient/dspTaxHistory.h000066400000000000000000000021371217451700100203760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DSPTAXHISTORY_H #define DSPTAXHISTORY_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_dspTaxHistory.h" class dspTaxHistory : public XWidget, public Ui::dspTaxHistory { Q_OBJECT public: dspTaxHistory(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~dspTaxHistory(); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sPrint(); virtual void sFillList(); virtual void sHandleFilter(); virtual void sHandleType(); protected slots: virtual void languageChange(); }; #endif // DSPTAXHISTORY_H qt-client-4.1.0/guiclient/dspTaxHistory.ui000066400000000000000000000377531217451700100206000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. dspTaxHistory 0 0 800 600 Tax History 12 12 Type 12 Summary true Detail false Qt::Horizontal 0 20 Show 12 Sales true true Purchases true Qt::Horizontal 0 20 Basis 12 Document date true Distribution date Qt::Horizontal 0 20 Date Range Qt::StrongFocus false false Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Code Type Class Authority Zone Qt::Horizontal 40 20 Selection: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 All Qt::Horizontal 40 20 Qt::Horizontal 0 20 0 0 &Close &Query true true &Print Qt::Vertical 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 0 0 0 0 Tax History: Qt::AlignVCenter 0 0 DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _summary _detail _sales _purchases _docDate _distDate _filterOn _selection _dates _query _print _close _taxsum _taxdet _close clicked() dspTaxHistory close() 20 20 20 20
    qt-client-4.1.0/guiclient/duplicateAccountNumbers.cpp000066400000000000000000000121541217451700100227270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "duplicateAccountNumbers.h" #include #include #include //#include #include #include /* * Constructs a duplicateAccountNumbers as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ duplicateAccountNumbers::duplicateAccountNumbers(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_duplicate, SIGNAL(clicked()), this, SLOT(sDuplicate())); sBuildList(); } /* * Destroys the object and frees any allocated resources */ duplicateAccountNumbers::~duplicateAccountNumbers() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void duplicateAccountNumbers::languageChange() { retranslateUi(this); } void duplicateAccountNumbers::sDuplicate() { XSqlQuery duplicateDuplicate; if(!(_changeCompany->isChecked() || _changeProfit->isChecked() || _changeSub->isChecked())) { QMessageBox::warning( this, tr("No Segments Selected for Change"), tr("You have not selected any segments for changing. You must select at least one segment to be changed.") ); return; } QString sql ("INSERT INTO accnt" " (accnt_number, accnt_descrip," " accnt_comments, accnt_type, accnt_extref," " accnt_forwardupdate," " accnt_subaccnttype_code, accnt_curr_id," " accnt_company, accnt_profit, accnt_sub) " "SELECT accnt_number, (accnt_descrip||' '||:descrip)," " accnt_comments, accnt_type, accnt_extref," " accnt_forwardupdate," " accnt_subaccnttype_code, accnt_curr_id,"); if(_changeCompany->isChecked()) sql += " :company,"; else sql += " accnt_company,"; if(_changeProfit->isChecked()) sql += " :profit,"; else sql += " accnt_profit,"; if(_changeSub->isChecked()) sql += " :sub"; else sql += " accnt_sub"; sql += " FROM accnt" " WHERE (accnt_id=:accnt_id);"; duplicateDuplicate.exec("BEGIN;"); duplicateDuplicate.prepare(sql); QList selected = _account->selectedItems(); for (int i = 0; i < selected.size(); i++) { duplicateDuplicate.bindValue(":company", _company->currentText()); duplicateDuplicate.bindValue(":profit", _profit->currentText()); duplicateDuplicate.bindValue(":sub", _sub->currentText()); duplicateDuplicate.bindValue(":accnt_id", ((XTreeWidgetItem*)selected[i])->id()); duplicateDuplicate.bindValue(":descrip", _descrip->text()); duplicateDuplicate.exec(); if (duplicateDuplicate.lastError().type() != QSqlError::NoError) { systemError(this, tr("A System Error occurred at %1::%2\n\n%3") .arg(__FILE__) .arg(__LINE__) .arg(duplicateDuplicate.lastError().databaseText())); duplicateDuplicate.exec("ROLLBACK;"); return; } } duplicateDuplicate.exec("COMMIT;"); close(); } void duplicateAccountNumbers::sFillList() { QString sql("SELECT accnt_id, "); if (_metrics->value("GLCompanySize").toInt() > 0) sql += "accnt_company, "; if (_metrics->value("GLProfitSize").toInt() > 0) sql += "accnt_profit, "; sql += "accnt_number, "; if (_metrics->value("GLSubaccountSize").toInt() > 0) sql += "accnt_sub, "; sql += " accnt_descrip," " accnt_type " "FROM ONLY accnt " "ORDER BY accnt_number, accnt_sub, accnt_profit;"; _account->populate(sql); } void duplicateAccountNumbers::sBuildList() { bool bComp = (_metrics->value("GLCompanySize").toInt() > 0); bool bProf = (_metrics->value("GLProfitSize").toInt() > 0); bool bSub = (_metrics->value("GLSubaccountSize").toInt() > 0); _account->setColumnCount(0); if(bComp) _account->addColumn(tr("Company"), 50, Qt::AlignCenter, true, "accnt_company"); _changeCompany->setVisible(bComp); _company->setVisible(bComp); if(bProf) _account->addColumn(tr("Profit"), 50, Qt::AlignCenter, true, "accnt_profit"); _changeProfit->setVisible(bProf); _profit->setVisible(bProf); _account->addColumn(tr("Account Number"), 100, Qt::AlignCenter, true, "accnt_number"); if(bSub) _account->addColumn(tr("Sub."), 50, Qt::AlignCenter, true, "accnt_sub"); _changeSub->setVisible(bSub); _sub->setVisible(bSub); _account->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "accnt_descrip"); _account->addColumn(tr("Type"), _ynColumn, Qt::AlignCenter, true, "accnt_type"); sFillList(); } qt-client-4.1.0/guiclient/duplicateAccountNumbers.h000066400000000000000000000020211217451700100223640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DUPLICATEACCOUNTNUMBERS_H #define DUPLICATEACCOUNTNUMBERS_H #include "guiclient.h" #include "xwidget.h" #include "ui_duplicateAccountNumbers.h" class duplicateAccountNumbers : public XWidget, public Ui::duplicateAccountNumbers { Q_OBJECT public: duplicateAccountNumbers(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~duplicateAccountNumbers(); public slots: virtual void sBuildList(); virtual void sDuplicate(); protected slots: virtual void languageChange(); virtual void sFillList(); }; #endif // DUPLICATEACCOUNTNUMBERS_H qt-client-4.1.0/guiclient/duplicateAccountNumbers.ui000066400000000000000000000156351217451700100225710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. duplicateAccountNumbers 0 0 547 456 Duplicate Account Numbers 0 6 0 6 0 6 Change Profit Center Number: XComboBox::Companies Change Company Number: XComboBox::ProfitCenters XComboBox::Subaccounts Change Sub. Accnt. Number: Qt::Horizontal 40 20 0 6 Append to Description: _descrip 0 0 Select Account Numbers to Duplicate: _account 7 7 0 0 QAbstractItemView::MultiSelection 0 5 &Close Duplicate Qt::Vertical 20 40 XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _changeCompany _company _changeProfit _profit _changeSub _sub _descrip _account _duplicate _close _close clicked() duplicateAccountNumbers close() 486 26 20 20
    qt-client-4.1.0/guiclient/editOwners.cpp000066400000000000000000000203631217451700100202300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "editOwners.h" #include #include #include #include #include "storedProcErrorLookup.h" editOwners::editOwners(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery editeditOwners; setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_modify, SIGNAL(clicked()), this, SLOT(sModify())); connect(_modifyAll, SIGNAL(clicked()), this, SLOT(sModifyAll())); connect(_list, SIGNAL(itemClicked(QTreeWidgetItem*, int)), this, SLOT(sItemClicked())); _list->addColumn(tr("Type"), _statusColumn, Qt::AlignCenter, true, "type_name"); _list->addColumn(tr("Name"), 100, Qt::AlignLeft, true, "name"); _list->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); _list->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, true, "owner_username"); _modify->setEnabled(false); _modifyAll->setEnabled(false); _newOwner->setType(UsernameLineEdit::UsersActive); _first = true; editeditOwners.prepare("SELECT usr_id " "FROM usr " "WHERE (usr_username=getEffectiveXtUser());"); editeditOwners.exec(); if (editeditOwners.first()) { _owner->setId(editeditOwners.value("usr_id").toInt()); } else if (editeditOwners.lastError().type() != QSqlError::NoError) { systemError(this, editeditOwners.lastError().databaseText(), __FILE__, __LINE__); reject(); } } void editOwners::sFillList() { XSqlQuery editFillList; if(_todo->isChecked()) { _queryString += "SELECT todoitem_id AS id, " " todoitem_owner_username AS owner_username, " " todoitem_name AS name, " " todoitem_description AS description, " " 'To Do' AS type_name, " " 'todoitem' AS table " "FROM todoitem " "WHERE todoitem_owner_username = :owner "; _first = false; } if(_project->isChecked()) { if(!_first) _queryString += "UNION ALL "; _queryString += "SELECT prj_id AS id, " " prj_owner_username AS owner_username, " " prj_name AS name, " " prj_descrip AS description, " " 'Project' AS type_name, " " 'prj' AS table " "FROM prj " "WHERE prj_owner_username = :owner "; _first = false; } if(_contact->isChecked()) { if(!_first) _queryString += "UNION ALL "; _queryString += "SELECT cntct_id AS id, " " cntct_owner_username AS owner_username, " " cntct_first_name || ' ' || cntct_last_name AS name, " " '' AS description, " " 'Contact' AS type_name, " " 'cntct' AS table " "FROM cntct " "WHERE cntct_owner_username = :owner "; _first = false; } if(_incident->isChecked()) { if(!_first) _queryString += "UNION ALL "; _queryString += "SELECT incdt_id AS id, " " incdt_owner_username AS owner_username, " " incdt_summary AS name, " " incdt_descrip AS description, " " 'Incident' AS type_name, " " 'incdt' AS table " "FROM incdt " "WHERE incdt_owner_username = :owner "; _first = false; } if(_account->isChecked()) { if(!_first) _queryString += "UNION ALL "; _queryString += "SELECT crmacct_id AS id, " " crmacct_owner_username AS owner_username, " " crmacct_name AS name, " " crmacct_notes AS description, " " 'Account' AS type_name, " " 'crmacct' AS table " "FROM crmacct " "WHERE crmacct_owner_username = :owner "; _first = false; } if(_oppourtunity->isChecked()) { if(!_first) _queryString += "UNION ALL "; _queryString += "SELECT ophead_id AS id, " " ophead_owner_username AS owner_username, " " ophead_name AS name, " " ophead_notes AS description, " " 'Opportunity' AS type_name, " " 'ophead' AS table " "FROM ophead " "WHERE ophead_owner_username = :owner "; _first = false; } if(_queryString == "") _list->clear(); else { editFillList.prepare(_queryString); editFillList.bindValue(":owner", _owner->username()); editFillList.exec(); _list->populate(editFillList); } _modifyAll->setEnabled(_list->topLevelItemCount() > 0); _modify->setEnabled(false); _first = true; _queryString = ""; } void editOwners::sClose() { close(); } void editOwners::sModify() { QString table; if(!_newOwner->isValid()) { QMessageBox::critical( this, tr("No New Owner"), tr("A new owner must be selected before you can continue.")); _newOwner->setFocus(); return; } int ret = QMessageBox::warning(this, tr("Confirm Ownership Modification"), tr("

    Are you sure that you want to change the new owner " "to '%1' for the selected records?") .arg(_newOwner->username()), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if(ret == QMessageBox::Yes) { if (modifyOne(_list->currentItem())) sFillList(); } } void editOwners::sModifyAll() { if(!_newOwner->isValid()) { QMessageBox::critical( this, tr("No New Owner"), tr("A new owner must be selected before you can continue.")); _newOwner->setFocus(); return; } int ret = QMessageBox::warning(this, tr("Confirm Ownership Modification"), tr("

    Are you sure that you want to change the new owner " "to '%1' for the selected records?") .arg(_newOwner->username()), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if(ret == QMessageBox::Yes) { QList all = _list->findItems("", Qt::MatchContains); for (int i = 0; i < all.size(); i++) { XTreeWidgetItem *currentItem = static_cast(all[i]); if (currentItem->rawValue("type_name").toString() != "") modifyOne(currentItem); } sFillList(); } } bool editOwners::modifyOne(XTreeWidgetItem * currentItem) { XSqlQuery editmodifyOne; QString table; if(currentItem->rawValue("type_name").toString() == "To Do") table = "todoitem"; if(currentItem->rawValue("type_name").toString() == "Project") table = "prj"; if(currentItem->rawValue("type_name").toString() == "Contact") table = "cntct"; if(currentItem->rawValue("type_name").toString() == "Incident") table = "incdt"; if(currentItem->rawValue("type_name").toString() == "Account") table = "crmacct"; if(currentItem->rawValue("type_name").toString() == "Opportunity") table = "ophead"; editmodifyOne.prepare("UPDATE "+table+" " "SET "+table+"_owner_username = :new_owner_username " "WHERE "+table+"_id = :id "); editmodifyOne.bindValue(":new_owner_username", _newOwner->username()); editmodifyOne.bindValue(":id", currentItem->id()); editmodifyOne.exec(); if (editmodifyOne.lastError().type() != QSqlError::NoError) { systemError(this, editmodifyOne.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void editOwners::sItemClicked() { _modify->setEnabled(true); } qt-client-4.1.0/guiclient/editOwners.h000066400000000000000000000020401217451700100176650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EDITOWNERS_H #define EDITOWNERS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_editOwners.h" class editOwners : public XDialog, public Ui::editOwners { Q_OBJECT public: editOwners(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); protected slots: virtual void sClose(); virtual void sFillList(); virtual void sModify(); virtual void sModifyAll(); virtual void sItemClicked(); virtual bool modifyOne(XTreeWidgetItem*); private: QString _queryString; bool _first; }; #endif // EDITOWNERS_H qt-client-4.1.0/guiclient/editOwners.ui000066400000000000000000000171171217451700100200660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. editOwners 0 0 655 400 Edit Owners Owner: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 New Owner: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Maximum 241 20 0 0 In the following categories: Project To Do Account Contact Incident Opportunity Qt::Horizontal 16 86 &Close Qt::Vertical QSizePolicy::Maximum 20 40 244 232 0 &Query Modify Modify All Qt::Vertical 20 281 UsernameCluster QWidget

    usernamecluster.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    qt-client-4.1.0/guiclient/empGroup.cpp000066400000000000000000000220631217451700100177020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "empGroup.h" #include #include #include #include "empGroup.h" #include "empcluster.h" #include "storedProcErrorLookup.h" #define DEBUG false // TODO: XDialog should have a default implementation that returns FALSE bool empGroup::userHasPriv(const int pMode) { if (DEBUG) qDebug("empGroup::userHasPriv(%d)", pMode); bool retval = false; switch (pMode) { case cView: retval = _privileges->check("ViewEmployeeGroups") || _privileges->check("MaintainEmployeeGroups"); break; case cNew: case cEdit: retval = _privileges->check("MaintainEmployeeGroups"); break; default: retval = false; break; } if (DEBUG) qDebug("empGroup::userHasPriv(%d) returning %d", pMode, retval); return retval; } // TODO: this code really belongs in XDialog void empGroup::setVisible(bool visible) { if (DEBUG) qDebug("empGroup::setVisible(%d) called with mode() == %d", visible, _mode); if (! visible) XDialog::setVisible(false); else if (! userHasPriv(_mode)) { systemError(this, tr("You do not have sufficient privilege to view this window"), __FILE__, __LINE__); reject(); } else XDialog::setVisible(true); } empGroup::empGroup(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _empgrpitem->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "emp_code"); _empgrpitem->addColumn(tr("Number"), -1, Qt::AlignLeft, true, "emp_number"); } empGroup::~empGroup() { // no need to delete child widgets, Qt does it all for us } void empGroup::languageChange() { retranslateUi(this); } enum SetResponse empGroup::set(const ParameterList &pParams) { XSqlQuery empet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("empgrp_id", &valid); if (valid) { _empgrpid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _save->setEnabled(FALSE); empet.exec("SELECT NEXTVAL('empgrp_empgrp_id_seq') AS empgrpid;"); if (empet.first()) _empgrpid = empet.value("empgrpid").toInt(); else if (empet.lastError().type() != QSqlError::NoError) { systemError(this, empet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; } } bool editing = (_mode == cNew || _mode == cEdit); if (editing) { connect(_empgrpitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } else { _save->hide(); _close->setText(tr("&Close")); } _name->setEnabled(_mode == cNew); _descrip->setEnabled(editing); _new->setEnabled(editing); return NoError; } void empGroup::sCheck() { XSqlQuery empCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length())) { empCheck.prepare( "SELECT empgrp_id " "FROM empgrp " "WHERE (UPPER(empgrp_name)=UPPER(:name));" ); empCheck.bindValue(":name", _name->text()); empCheck.exec(); if (empCheck.first()) { _empgrpid = empCheck.value("empgrp_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } else if (empCheck.lastError().type() != QSqlError::NoError) { systemError(this, empCheck.lastError().databaseText(), __FILE__, __LINE__); return; } } _save->setEnabled(TRUE); } bool empGroup::close() { XSqlQuery empclose; if (_mode == cNew && _empgrpid > 0) { empclose.prepare( "SELECT deleteEmpgrp(:grpid) AS result;"); empclose.bindValue(":grpid", _empgrpid); empclose.exec(); if (empclose.first()) { int result = empclose.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteEmpgrp", result), __FILE__, __LINE__); return false; } } else if (empclose.lastError().type() != QSqlError::NoError) { systemError(this, empclose.lastError().databaseText(), __FILE__, __LINE__); return false; } } return true; } void empGroup::sSave(const bool pClose) { XSqlQuery empSave; _name->setText(_name->text().trimmed()); if (_name->text().length() == 0) { QMessageBox::information( this, tr("Invalid Name"), tr("You must enter a valid Name for this Employee Group.") ); _name->setFocus(); return; } if (_mode == cNew) empSave.prepare( "INSERT INTO empgrp " "(empgrp_id, empgrp_name, empgrp_descrip) " "VALUES " "(:grpid, :empgrp_name, :empgrp_descrip);" ); else if (_mode == cEdit) empSave.prepare( "UPDATE empgrp " "SET empgrp_name=:empgrp_name, empgrp_descrip=:empgrp_descrip " "WHERE (empgrp_id=:grpid);" ); empSave.bindValue(":grpid", _empgrpid); empSave.bindValue(":empgrp_name", _name->text().trimmed()); empSave.bindValue(":empgrp_descrip", _descrip->text().trimmed()); empSave.exec(); if (empSave.lastError().type() != QSqlError::NoError) { systemError(this, empSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (pClose) { int grpid = _empgrpid; // don't delete groups in close() _empgrpid = -1; done(grpid); } else if (_mode == cNew) _mode = cEdit; } void empGroup::sDelete() { XSqlQuery empDelete; empDelete.prepare( "DELETE FROM empgrpitem " "WHERE (empgrpitem_id=:empgrpitem_id);" ); empDelete.bindValue(":empgrpitem_id", _empgrpitem->id()); empDelete.exec(); if (empDelete.lastError().type() != QSqlError::NoError) { systemError(this, empDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void empGroup::sNew() { XSqlQuery empNew; ParameterList params; int empid = EmpClusterLineEdit::idFromList(this); if (empid != XDialog::Rejected && empid != -1) { sSave(false); empNew.prepare( "SELECT empgrpitem_id " "FROM empgrpitem " "WHERE ((empgrpitem_empgrp_id=:empgrpitem_empgrp_id)" " AND (empgrpitem_emp_id=:empgrpitem_emp_id) );" ); empNew.bindValue(":empgrpitem_empgrp_id", _empgrpid); empNew.bindValue(":empgrpitem_emp_id", empid); empNew.exec(); if (empNew.first()) return; else if (empNew.lastError().type() != QSqlError::NoError) { systemError(this, empNew.lastError().databaseText(), __FILE__, __LINE__); return; } empNew.prepare( "INSERT INTO empgrpitem " "(empgrpitem_empgrp_id, empgrpitem_emp_id) " "VALUES " "(:empgrpitem_empgrp_id, :empgrpitem_emp_id);" ); empNew.bindValue(":empgrpitem_empgrp_id", _empgrpid); empNew.bindValue(":empgrpitem_emp_id", empid); empNew.exec(); if (empNew.lastError().type() != QSqlError::NoError) { systemError(this, empNew.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void empGroup::sFillList() { XSqlQuery empFillList; empFillList.prepare( "SELECT empgrpitem_id, emp_code, emp_number " "FROM empgrpitem, emp " "WHERE ((empgrpitem_emp_id=emp_id) " " AND (empgrpitem_empgrp_id=:empgrp_id) ) " "ORDER BY emp_code;" ); empFillList.bindValue(":empgrp_id", _empgrpid); empFillList.exec(); _empgrpitem->populate(empFillList); if (empFillList.lastError().type() != QSqlError::NoError) { systemError(this, empFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void empGroup::populate() { XSqlQuery emppopulate; emppopulate.prepare( "SELECT empgrp_name, empgrp_descrip " "FROM empgrp " "WHERE (empgrp_id=:empgrp_id);" ); emppopulate.bindValue(":empgrp_id", _empgrpid); emppopulate.exec(); if (emppopulate.first()) { _name->setText(emppopulate.value("empgrp_name").toString()); _descrip->setText(emppopulate.value("empgrp_descrip").toString()); } else if (emppopulate.lastError().type() != QSqlError::NoError) { systemError(this, emppopulate.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } qt-client-4.1.0/guiclient/empGroup.h000066400000000000000000000023571217451700100173530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EMPGROUP_H #define EMPGROUP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_empGroup.h" class empGroup : public XDialog, public Ui::empGroup { Q_OBJECT public: empGroup(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~empGroup(); static bool userHasPriv(const int = cView); virtual void setVisible(bool); public slots: virtual bool close(); virtual void populate(); virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(const bool = true); virtual void sDelete(); virtual void sNew(); virtual void sFillList(); protected slots: virtual void languageChange(); private: int _mode; int _empgrpid; }; #endif // EMPGROUP_H qt-client-4.1.0/guiclient/empGroup.ui000066400000000000000000000216311217451700100175350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. empGroup 0 0 517 292 Employee Group 5 5 0 7 5 7 0 5 0 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Save true true Qt::Vertical QSizePolicy::Preferred 20 40 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 45 0 0 Member Employees: 0 7 0 0 0 0 &New false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    XLineEdit QLineEdit
    xlineedit.h
    0
    _name _descrip _empgrpitem _delete _new _save _close
    qt-client-4.1.0/guiclient/empGroups.cpp000066400000000000000000000062741217451700100200730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "empGroups.h" #include #include #include "empGroup.h" #include "guiclient.h" #include "storedProcErrorLookup.h" empGroups::empGroups(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _empgrp->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "empgrp_name"); _empgrp->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "empgrp_descrip"); if (_privileges->check("MaintainEmployeeGroups")) { connect(_empgrp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_empgrp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_empgrp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_empgrp, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } empGroups::~empGroups() { // no need to delete child widgets, Qt does it all for us } void empGroups::languageChange() { retranslateUi(this); } void empGroups::sDelete() { XSqlQuery empDelete; empDelete.prepare( "SELECT deleteEmpgrp(:grpid) AS result;"); empDelete.bindValue(":grpid", _empgrp->id()); empDelete.exec(); if (empDelete.first()) { int result = empDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteEmpgrp", result), __FILE__, __LINE__); return; } } else if (empDelete.lastError().type() != QSqlError::NoError) { systemError(this, empDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void empGroups::sNew() { ParameterList params; params.append("mode", "new"); empGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void empGroups::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("empgrp_id", _empgrp->id()); empGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void empGroups::sView() { ParameterList params; params.append("mode", "view"); params.append("empgrp_id", _empgrp->id()); empGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void empGroups::sFillList() { XSqlQuery empFillList; empFillList.prepare("SELECT * FROM empgrp ORDER BY empgrp_name;" ); empFillList.exec(); _empgrp->populate(empFillList); if (empFillList.lastError().type() != QSqlError::NoError) { systemError(this, empFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/empGroups.h000066400000000000000000000016631217451700100175350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EMPGROUPS_H #define EMPGROUPS_H #include "xwidget.h" #include "ui_empGroups.h" class empGroups : public XWidget, public Ui::empGroups { Q_OBJECT public: empGroups(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~empGroups(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // EMPGROUPS_H qt-client-4.1.0/guiclient/empGroups.ui000066400000000000000000000120661217451700100177220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. empGroups 0 0 357 281 List Employee Groups 0 0 Employee Groups: 0 5 &Close 0 0 &New false &Edit false &View false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _empgrp _new _edit _view _delete _close _close clicked() empGroups close() _empgrp valid(bool) _view setEnabled(bool)
    qt-client-4.1.0/guiclient/employee.cpp000066400000000000000000000553341217451700100177320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "employee.h" #include #include #include #include #include "characteristicAssignment.h" #include "crmaccount.h" #include "empGroup.h" #include "empgroupcluster.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "storedProcErrorLookup.h" #define DEBUG false // TODO: XDialog should have a default implementation that returns FALSE bool employee::userHasPriv(const int pMode) { if (DEBUG) qDebug("employee::userHasPriv(%d)", pMode); bool retval = false; switch (pMode) { case cView: retval = _privileges->check("ViewEmployees") || _privileges->check("MaintainEmployees"); break; case cNew: case cEdit: retval = _privileges->check("MaintainEmployees"); break; default: retval = false; break; } if (DEBUG) qDebug("employee::userHasPriv(%d) returning %d", pMode, retval); return retval; } // TODO: this code really belongs in XDialog void employee::setVisible(bool visible) { if (DEBUG) qDebug("employee::setVisible(%d) called with mode() == %d", visible, _mode); if (! visible) XDialog::setVisible(false); else if (! userHasPriv(_mode)) { ErrorReporter::error(QtCriticalMsg, this, tr("No Privileges"), tr("You do not have sufficient privilege to view " "this window")); reject(); } else XDialog::setVisible(true); } employee::employee(QWidget* parent, const char * name, Qt::WindowFlags fl) : XDialog(parent, name, fl) { setupUi(this); connect(_attachGroup, SIGNAL(clicked()), this, SLOT(sAttachGroup())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sHandleButtons())); connect(_crmacct, SIGNAL(clicked()), this, SLOT(sCrmAccount())); connect(_deleteCharass, SIGNAL(clicked()), this, SLOT(sDeleteCharass())); connect(_detachGroup, SIGNAL(clicked()), this, SLOT(sDetachGroup())); connect(_editCharass, SIGNAL(clicked()), this, SLOT(sEditCharass())); connect(_editGroup, SIGNAL(clicked()), this, SLOT(sEditGroup())); connect(_newCharass, SIGNAL(clicked()), this, SLOT(sNewCharass())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_viewGroup, SIGNAL(clicked()), this, SLOT(sViewGroup())); XSqlQuery xtmfg; xtmfg.exec("SELECT pkghead_name FROM pkghead WHERE pkghead_name='xtmfg'"); if (xtmfg.first()) { _shift->setEnabled(true); _shift->setVisible(true); shiftLit->setVisible(true); } else { _shift->setEnabled(false); _shift->setVisible(false); shiftLit->setVisible(false); } _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name"); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value"); _groups->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "empgrp_name"); _groups->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "empgrp_descrip"); _wagetype->setAllowNull(false); _wagetype->append(0, tr("Hourly"), "H"); _wagetype->append(1, tr("Salaried"), "S"); _per->setAllowNull(false); _per->append(0, tr("Hour"), "H"); _per->append(1, tr("Day"), "D"); _per->append(2, tr("Week"), "W"); _per->append(3, tr("Bi-Weekly"), "BW"); _per->append(4, tr("Month"), "M"); _per->append(5, tr("Year"), "Y"); _per->setAllowNull(false); _perExt->append(0, tr("Hour"), "H"); _perExt->append(1, tr("Day"), "D"); _perExt->append(2, tr("Week"), "W"); _perExt->append(3, tr("Bi-Weekly"), "BW"); _perExt->append(4, tr("Month"), "M"); _perExt->append(4, tr("Year"), "Y"); _comments->setId(-1); _comments->setReadOnly(true); _crmacctid = -1; _empid = -1; _NumberGen = -1; _mode = cView; _origmode = cView; } employee::~employee() { // no need to delete child widgets, Qt does it all for us } void employee::languageChange() { retranslateUi(this); } enum SetResponse employee::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("crmacct_id", &valid); if (valid) _crmacctid = param.toInt(); param = pParams.value("emp_id", &valid); if (valid) _empid = param.toInt(); if (_empid > 0 || _crmacctid > 0) if (! sPopulate()) return UndefinedError; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; if(((_metrics->value("CRMAccountNumberGeneration") == "A") || (_metrics->value("CRMAccountNumberGeneration") == "O")) && _code->text().isEmpty() ) { XSqlQuery numq; numq.exec("SELECT fetchCRMAccountNumber() AS number;"); if (numq.first()) { _code->setText(numq.value("number")); _NumberGen = numq.value("number").toInt(); } } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _save->hide(); _close->setText(tr("&Close")); } } bool editing = (_mode == cNew || _mode == cEdit); if (editing) { connect(_charass,SIGNAL(valid(bool)), _deleteCharass, SLOT(setEnabled(bool))); connect(_charass,SIGNAL(valid(bool)), _editCharass, SLOT(setEnabled(bool))); connect(_charass,SIGNAL(itemSelected(int)), _editCharass, SLOT(animateClick())); connect(_groups, SIGNAL(valid(bool)), _detachGroup, SLOT(setEnabled(bool))); _attachGroup->setEnabled(true); if (empGroup::userHasPriv(cEdit)) { connect(_groups, SIGNAL(valid(bool)), _editGroup, SLOT(setEnabled(bool))); } } if (empGroup::userHasPriv(cView)) connect(_groups, SIGNAL(valid(bool)), _viewGroup, SLOT(setEnabled(bool))); _code->setEnabled(editing); _number->setEnabled(editing); _name->setEnabled(editing); _startDate->setEnabled(editing); _active->setEnabled(editing); _contact->setEnabled(editing); _site->setEnabled(editing); _mgr->setEnabled(editing); _wagetype->setEnabled(editing); _rate->setEnabled(editing); _per->setEnabled(editing); _externalRate->setEnabled(editing); _perExt->setEnabled(editing); _dept->setEnabled(editing); _shift->setEnabled(editing); _notes->setEnabled(editing); _image->setEnabled(editing); _comments->setReadOnly(!editing); _save->setEnabled(editing); _newCharass->setEnabled(editing); _origmode = _mode; if (DEBUG) qDebug("employee::set() returning with _mode %d and _origmode %d", _mode, _origmode); return NoError; } bool employee::sSave(const bool pClose) { bool dupCode = false; bool dupNumber = false; XSqlQuery dupq; dupq.prepare("SELECT emp_id" " FROM emp" " WHERE(emp_code=:code) AND (emp_id != :id);"); dupq.bindValue(":code", _code->text()); dupq.bindValue(":id", _empid); dupq.exec(); if(dupq.first()) dupCode = true; else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), dupq, __FILE__, __LINE__)) return false; dupq.prepare("SELECT emp_id" " FROM emp" " WHERE(emp_number=:number) AND (emp_id != :id);"); dupq.bindValue(":number", _number->text()); dupq.bindValue(":id", _empid); dupq.exec(); if(dupq.first()) dupNumber = true; else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), dupq, __FILE__, __LINE__)) return false; QList errors; errors << GuiErrorCheck(_code->text().isEmpty(), _code, tr("You must enter a valid Employee Code.")) << GuiErrorCheck(_number->text().isEmpty(), _number, tr("You must enter an Employee Number.")) << GuiErrorCheck(dupCode, _code, tr("An Employee already exists for the Code specified.")) << GuiErrorCheck(_code->text() == _mgr->number(), _number, tr("An Employee already exists for the Number specified.")) << GuiErrorCheck(_code->text() == _mgr->number(), _mgr, tr("An Employee cannot be his or her own Manager.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Employee"), errors)) return false; // _contact->check(); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); int cntctResult = _contact->save(AddressCluster::CHANGEALL); if (cntctResult < 0) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Contact"), storedProcErrorLookup("saveContact", cntctResult)); return false; } XSqlQuery upsq; if (_mode == cNew) upsq.prepare("INSERT INTO emp (" " emp_code, emp_number, emp_active, emp_cntct_id," " emp_warehous_id, emp_mgr_emp_id," " emp_wage_type, emp_wage, emp_wage_curr_id, emp_wage_period," " emp_dept_id, emp_shift_id, emp_notes, emp_image_id," " emp_extrate, emp_extrate_period, emp_startdate, emp_name" ") VALUES (" " :code, :number, :active, :cntct_id," " :warehous_id, :mgr_emp_id," " :wage_type, :wage, :wage_curr_id, :wage_period," " :dept_id, :shift_id, :notes, :image_id," " :extrate, :extrate_period, :startdate, :name" ") RETURNING emp_id;"); else if (_mode == cEdit) { upsq.prepare("UPDATE emp SET" " emp_code=:code," " emp_number=:number," " emp_active=:active," " emp_cntct_id=:cntct_id," " emp_warehous_id=:warehous_id," " emp_mgr_emp_id=:mgr_emp_id," " emp_wage_type=:wage_type," " emp_wage=:wage," " emp_wage_curr_id=:wage_curr_id," " emp_wage_period=:wage_period," " emp_dept_id=:dept_id," " emp_shift_id=:shift_id," " emp_notes=:notes," " emp_image_id=:image_id," " emp_extrate=:extrate," " emp_extrate_period=:extrate_period," " emp_startdate=:startdate," " emp_name=:name" " WHERE (emp_id=:emp_id)" " RETURNING emp_id;" ); upsq.bindValue(":emp_id", _empid); } upsq.bindValue(":code", _code->text()); upsq.bindValue(":number", _number->text()); upsq.bindValue(":active", _active->isChecked()); if (_contact->isValid()) upsq.bindValue(":cntct_id", _contact->id()); if (_site->isValid()) upsq.bindValue(":warehous_id", _site->id()); if (_mgr->isValid()) upsq.bindValue(":mgr_emp_id", _mgr->id()); upsq.bindValue(":wage_type", _wagetype->code()); upsq.bindValue(":wage", _rate->localValue()); if (_rate->id() > 0) upsq.bindValue(":wage_curr_id", _rate->id()); upsq.bindValue(":wage_period", _per->code()); if (_dept->isValid()) upsq.bindValue(":dept_id", _dept->id()); if (_shift->isValid()) upsq.bindValue(":shift_id", _shift->id()); upsq.bindValue(":notes", _notes->toPlainText()); if (_image->isValid()) upsq.bindValue(":image_id", _image->id()); upsq.bindValue(":extrate", _externalRate->localValue()); upsq.bindValue(":extrate_period", _perExt->code()); upsq.bindValue(":startdate", _startDate->date()); upsq.bindValue(":name", _name->text()); upsq.exec(); if (upsq.first()) _empid = upsq.value("emp_id").toInt(); else if (upsq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error saving Employee"), upsq, __FILE__, __LINE__); return false; } XSqlQuery commit("COMMIT;"); emit saved(); omfgThis->sEmployeeUpdated(_empid); if (pClose) done(_empid); else { _mode = cEdit; sPopulate(); } return true; } void employee::sReleaseNumber() { XSqlQuery employeeReleaseNumber; employeeReleaseNumber.prepare("SELECT releaseCRMAccountNumber(:number);"); employeeReleaseNumber.bindValue(":number", _NumberGen); employeeReleaseNumber.exec(); if (employeeReleaseNumber.lastError().type() != QSqlError::NoError) { systemError(this, employeeReleaseNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } void employee::reject() { if (DEBUG) qDebug("employee::reject() entered with _mode %d and _origmode %d", _mode, _origmode); if (_origmode == cNew) { XSqlQuery delq; delq.prepare("DELETE FROM emp WHERE (emp_id=:empid);"); delq.bindValue(":empid", _empid); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting Employee"), delq, __FILE__, __LINE__); if(_NumberGen != -1) sReleaseNumber(); } XDialog::reject(); } bool employee::sPopulate() { XSqlQuery getq; if (_empid > 0) { getq.prepare("SELECT emp.*, crmacct_id, crmacct_owner_username," " crmacct_salesrep_id, crmacct_usr_username, crmacct_vend_id" " FROM emp JOIN crmacct ON (emp_id=crmacct_emp_id)" " WHERE (emp_id=:id);"); getq.bindValue(":id", _empid); } else if (_crmacctid > 0) { getq.prepare("SELECT crmacct_number AS emp_code, NULL AS emp_number," " crmacct_name AS emp_name," " crmacct_active AS emp_active," " crmacct_cntct_id_1 AS emp_cntct_id," " NULL AS emp_startdate, NULL AS emp_mgr_emp_id," " NULL AS emp_warehous_id, NULL AS emp_wage_type," " NULL AS emp_wage, NULL AS emp_wage_curr_id," " NULL AS emp_extrate, NULL AS emp_wage_period," " NULL AS emp_extrate_period, NULL AS emp_dept_id," " NULL AS emp_shift_id, NULL AS emp_notes," " NULL AS emp_image_id," "crmacct_id, crmacct_owner_username" " FROM crmacct" " WHERE (crmacct_id=:id);"); getq.bindValue(":id", _crmacctid); } getq.exec(); if (getq.first()) { _code->setText(getq.value("emp_code").toString()); _name->setText(getq.value("emp_name").toString()); _number->setText(getq.value("emp_number").toString()); _active->setChecked(getq.value("emp_active").toBool()); _startDate->setDate(getq.value("emp_startdate").toDate()); _contact->setId(getq.value("emp_cntct_id").toInt()); _site->setId(getq.value("emp_warehous_id").toInt()); _mgr->setId(getq.value("emp_mgr_emp_id").toInt()); _wagetype->setCode(getq.value("emp_wage_type").toString()); _rate->set(getq.value("emp_wage").toDouble(), getq.value("emp_wage_curr_id").toInt(), QDate::currentDate()); _externalRate->set(getq.value("emp_extrate").toDouble(), getq.value("emp_wage_curr_id").toInt(), QDate::currentDate()); _per->setCode(getq.value("emp_wage_period").toString()); _perExt->setCode(getq.value("emp_extrate_period").toString()); _dept->setId(getq.value("emp_dept_id").toInt()); _shift->setId(getq.value("emp_shift_id").toInt()); _notes->setText(getq.value("emp_notes").toString()); _image->setId(getq.value("emp_image_id").toInt()); _crmacctid = getq.value("crmacct_id").toInt(); _crmowner = getq.value("crmacct_owner_username").toString(); if (DEBUG) qDebug("image %s and %s", qPrintable(getq.value("image").toString()), qPrintable(_image->number())); sFillCharassList(); sFillGroupsList(); _comments->setId(_empid); _comments->setReadOnly(_empid==-1); emit populated(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error getting Employee"), getq, __FILE__, __LINE__)) return false; sHandleButtons(); return true; } void employee::sDeleteCharass() { XSqlQuery delq; delq.prepare("DELETE FROM charass WHERE (charass_id=:charass_id);"); delq.bindValue(":charass_id", _charass->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting Characteristic Assignment"), delq, __FILE__, __LINE__)) return; sFillCharassList(); } void employee::sEditCharass() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharassList(); } void employee::sNewCharass() { if (_mode == cNew) { if (!sSave(false)) return; } ParameterList params; params.append("mode", "new"); params.append("emp_id", _empid); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharassList(); } void employee::sFillCharassList() { XSqlQuery getq; getq.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value " "FROM charass, char " "WHERE ((charass_target_type='EMP')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:emp_id) ) " "ORDER BY char_order, char_name;" ); getq.bindValue(":emp_id", _empid); getq.exec(); _charass->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error getting Characteristic Assignments"), getq, __FILE__, __LINE__)) return; } void employee::sFillGroupsList() { XSqlQuery getq; getq.prepare( "SELECT empgrp.* " "FROM empgrp, empgrpitem " "WHERE ((empgrp_id=empgrpitem_empgrp_id)" " AND (empgrpitem_emp_id=:emp_id) ) " "ORDER BY empgrp_name;" ); getq.bindValue(":emp_id", _empid); getq.exec(); _groups->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error getting Employee Groups"), getq, __FILE__, __LINE__)) return; } void employee::sAttachGroup() { if (!sSave(false)) return; int empgrpid = EmpGroupClusterLineEdit::idFromList(this); if (empgrpid != XDialog::Rejected && empgrpid != -1) { XSqlQuery grpq; grpq.prepare("SELECT * FROM empgrpitem" " WHERE((empgrpitem_empgrp_id=:empgrpid)" " AND (empgrpitem_emp_id=:empid));"); grpq.bindValue(":empgrpid", empgrpid); grpq.bindValue(":empid", _empid); grpq.exec(); if(grpq.first()) { QMessageBox::information(this, tr("Employee in Group"), tr("The employee is already in the selected group.") ); return; } grpq.prepare("INSERT INTO empgrpitem (empgrpitem_empgrp_id, empgrpitem_emp_id)" " VALUES " "(:empgrpid, :empid);"); grpq.bindValue(":empgrpid", empgrpid); grpq.bindValue(":empid", _empid); grpq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error attaching to Employee Group"), grpq, __FILE__, __LINE__)) return; sFillGroupsList(); } } void employee::sCrmAccount() { ParameterList params; params.append("crmacct_id", _crmacctid); if ((cView == _mode && _privileges->check("ViewAllCRMAccounts")) || (cView == _mode && _privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner) || (cEdit == _mode && _privileges->check("ViewAllCRMAccounts") && ! _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("ViewPersonalCRMAccounts") && ! _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else if ((cEdit == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if ((cNew == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cNew == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else { qWarning("tried to open CRM Account window without privilege"); return; } crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void employee::sDetachGroup() { XSqlQuery detq; detq.prepare("DELETE FROM empgrpitem " "WHERE ((empgrpitem_empgrp_id=:grpid)" " AND (empgrpitem_emp_id=:empid));"); detq.bindValue(":grpid", _groups->id()); detq.bindValue(":empid", _empid); detq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error detaching from Employee Group"), detq, __FILE__, __LINE__)) return; sFillGroupsList(); } void employee::sEditGroup() { ParameterList params; params.append("mode", "edit"); params.append("empgrp_id", _groups->id()); empGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillGroupsList(); } void employee::sViewGroup() { ParameterList params; params.append("mode", "view"); params.append("empgrp_id", _groups->id()); empGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void employee::sHandleButtons() { _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); if(_NumberGen != -1 && _code->text().toInt() != _NumberGen) sReleaseNumber(); } qt-client-4.1.0/guiclient/employee.h000066400000000000000000000031221217451700100173630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EMPLOYEE_H #define EMPLOYEE_H #include "guiclient.h" #include "xdialog.h" #include "ui_employee.h" class employee : public XDialog, public Ui::employee { Q_OBJECT public: employee(QWidget* = 0, const char * = 0, Qt::WindowFlags = 0); ~employee(); static bool userHasPriv(const int = cView); virtual void setVisible(bool); public slots: virtual enum SetResponse set(const ParameterList &); virtual bool sPopulate(); virtual bool sSave(const bool = true); virtual void reject(); protected slots: virtual void languageChange(); virtual void sAttachGroup(); virtual void sCrmAccount(); virtual void sDeleteCharass(); virtual void sDetachGroup(); virtual void sEditCharass(); virtual void sEditGroup(); virtual void sFillCharassList(); virtual void sFillGroupsList(); virtual void sHandleButtons(); virtual void sNewCharass(); virtual void sViewGroup(); virtual void sReleaseNumber(); private: int _crmacctid; QString _crmowner; int _empid; int _mode; int _NumberGen; int _origmode; signals: void saved(); void populated(); }; #endif qt-client-4.1.0/guiclient/employee.ui000066400000000000000000000701261217451700100175610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. employee 0 0 643 393 Employee Save true Cancel Qt::Vertical 20 0 Employee: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code code Employee Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter number Employee Name: Qt::Vertical 20 0 false CRM Account... Active true active true Qt::Horizontal QSizePolicy::Fixed 13 20 0 1 0 &Contact false false false contact_change contact_number honorific first last job_title voice alternate fax email web address_change address_number address1 address2 address3 city state postalcode country Qt::Vertical 20 0 Image 2 0 Qt::StrongFocus Picture: Qt::Horizontal 40 20 &Detail Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true site Qt::Horizontal 40 20 Qt::StrongFocus Manager: manager_code Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Vertical 20 13 Shift: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus shift Qt::StrongFocus department Dept.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 0 0 Financial Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Compensation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter wage false wage_currency Per: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter wage_period Billing Rate: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter wage false wage_currency Per: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter billing_period Qt::Horizontal 40 20 wage_type Qt::Horizontal 0 20 Qt::Vertical 20 154 Notes notes Comments Comments::Employee Characteristics true New false Edit false Delete Qt::Vertical 20 40 Groups false Edit false View false Detach false Attach Qt::Vertical 20 40 Comments QWidget
    comments.h
    ContactWidget QWidget
    contactwidget.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DeptCluster QWidget
    deptcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    EmpCluster QWidget
    empcluster.h
    ImageCluster QWidget
    imagecluster.h
    ShiftCluster QWidget
    shiftcluster.h
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _code _number _name _tabWidget _contact _image _site _mgr _startDate _dept _shift _wagetype _rate _per _externalRate _perExt _notes _charass _newCharass _editCharass _deleteCharass _groups _editGroup _viewGroup _detachGroup _attachGroup _save _close _close clicked() employee reject() 716 113 546 106
    qt-client-4.1.0/guiclient/employees.cpp000066400000000000000000000103371217451700100201070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "employees.h" #include #include #include #include #include #include "characteristic.h" #include "employee.h" #include "errorReporter.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" employees::employees(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "employees", fl) { setWindowTitle(tr("Employees")); setReportName("EmployeeList"); setMetaSQLOptions("employees", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Show Active Only"), "activeOnly", ParameterWidget::Exists); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->applyDefaultFilterSet(); connect(omfgThis, SIGNAL(employeesUpdated(int)), this, SLOT(sFillList())); list()->addColumn(tr("Site"), _whsColumn, Qt::AlignLeft, true, "warehous_code"); list()->addColumn(tr("Active"), _ynColumn, Qt::AlignLeft, true, "emp_active"); list()->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "emp_code"); list()->addColumn(tr("Number"), -1, Qt::AlignLeft, true, "emp_number"); list()->addColumn(tr("First"), _itemColumn, Qt::AlignLeft, true, "cntct_first_name"); list()->addColumn(tr("Last"), _itemColumn, Qt::AlignLeft, true, "cntct_last_name"); setupCharacteristics(characteristic::Employees); parameterWidget()->applyDefaultFilterSet(); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen())); if (!_privileges->check("MaintainEmployees")) newAction()->setEnabled(FALSE); } void employees::sNew() { ParameterList params; params.append("mode", "new"); employee* newdlg = new employee(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void employees::sView() { ParameterList params; params.append("mode", "view"); params.append("emp_id", list()->id()); employee* newdlg = new employee(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void employees::sDelete() { if (QMessageBox::question(this, tr("Delete?"), tr("Are you sure you want to delete this Employee?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM charass WHERE charass_target_type = 'EMP' AND charass_target_id = :emp_id;" "DELETE FROM empgrpitem WHERE empgrpitem_emp_id = :emp_id;" "DELETE FROM emp WHERE emp_id = :emp_id;"); delq.bindValue(":emp_id", list()->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting Employee"), delq, __FILE__, __LINE__)) return; sFillList(); } void employees::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("emp_id", list()->id()); employee* newdlg = new employee(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void employees::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; bool editPriv = (_privileges->check("MaintainEmployees")); bool viewPriv = (_privileges->check("ViewEmployees")); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(editPriv); } void employees::sOpen() { bool editPriv = (_privileges->check("MaintainEmployees")); bool viewPriv = (_privileges->check("ViewEmployees")); if (editPriv) sEdit(); else if (viewPriv) sView(); } qt-client-4.1.0/guiclient/employees.h000066400000000000000000000016161217451700100175540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EMPLOYEES_H #define EMPLOYEES_H #include "display.h" #include class employees : public display { Q_OBJECT public: employees(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sNew(); virtual void sView(); virtual void sOpen(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // EMPLOYEES_H qt-client-4.1.0/guiclient/enterMiscCount.cpp000066400000000000000000000105231217451700100210440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "enterMiscCount.h" #include #include #include #include "storedProcErrorLookup.h" enterMiscCount::enterMiscCount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _captive = FALSE; _item->setType(ItemLineEdit::cGeneralInventory | ItemLineEdit::cActive); _item->addExtraClause( QString("(item_type NOT IN ('R', 'F'))") ); _item->addExtraClause( QString("(itemsite_costmethod != 'J')") ); _warehouse->setType(WComboBox::AllActiveInventory); _qty->setValidator(omfgThis->qtyVal()); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } enterMiscCount::~enterMiscCount() { // no need to delete child widgets, Qt does it all for us } void enterMiscCount::languageChange() { retranslateUi(this); } enum SetResponse enterMiscCount::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); } return NoError; } void enterMiscCount::sPost() { XSqlQuery enterPost; enterPost.prepare( "SELECT ( (itemsite_controlmethod IN ('L', 'S')) OR (itemsite_loccntrl) ) AS detailed," " COALESCE(invcnt_id, -1) AS cnttagid " "FROM itemsite LEFT OUTER JOIN invcnt ON ( (invcnt_itemsite_id=itemsite_id) AND (NOT invcnt_posted) ) " "WHERE ( (itemsite_warehous_id=:warehous_id)" " AND (itemsite_item_id=:item_id) );" ); enterPost.bindValue(":warehous_id", _warehouse->id()); enterPost.bindValue(":item_id", _item->id()); enterPost.exec(); if (enterPost.first()) { if (enterPost.value("detailed").toBool()) { QMessageBox::warning( this, tr("Cannot Enter Misc. Count"), tr("

    The selected Item Site is controlled via a " "combination of Lot/Serial and/or Location " "control. Misc. Counts can only be entered for " "Item Sites that are not Lot/Serial or Location " "controlled." ) ); return; } if (enterPost.value("cnttagid") != -1) { QMessageBox::warning(this, tr("Count Tag Previously Created"), tr("

    An unposted Count Tag already exists for " "this Item and Site. You may not a Misc. Count " "until the current Count Tag has been posted.")); return; } } else if (enterPost.lastError().type() != QSqlError::NoError) { systemError(this, enterPost.lastError().databaseText(), __FILE__, __LINE__); return; } enterPost.prepare( "SELECT postMiscCount(itemsite_id, :qty, :comments) AS cnttag_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); enterPost.bindValue(":qty", _qty->toDouble()); enterPost.bindValue(":comments", _comments->toPlainText()); enterPost.bindValue(":item_id", _item->id()); enterPost.bindValue(":warehous_id", _warehouse->id()); enterPost.exec(); if (enterPost.first()) { int result = enterPost.value("cnttag_id").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postMiscCount", result), __FILE__, __LINE__); return; } } else if (enterPost.lastError().type() != QSqlError::NoError) { systemError(this, enterPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (_captive) done(enterPost.value("cnttag_id").toInt()); else { _item->setId(-1); _qty->clear(); _comments->clear(); _item->setFocus(); } } qt-client-4.1.0/guiclient/enterMiscCount.h000066400000000000000000000020061217451700100205060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ENTERMISCCOUNT_H #define ENTERMISCCOUNT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_enterMiscCount.h" class enterMiscCount : public XDialog, public Ui::enterMiscCount { Q_OBJECT public: enterMiscCount(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~enterMiscCount(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPost(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // ENTERMISCCOUNT_H qt-client-4.1.0/guiclient/enterMiscCount.ui000066400000000000000000000251001217451700100206740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. enterMiscCount 0 0 427 295 Enter Miscellaneous Count 5 5 7 0 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 5 0 &Cancel false &Post Count true true Qt::Vertical QSizePolicy::Preferred 20 0 5 0 6 0 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 Count &Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _qty Qt::Vertical 20 40 5 0 0 0 true Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 80 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical 20 40 0 0 Co&mments: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _comments true ItemCluster QWidget

    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _qty _comments _post _close _item valid(bool) _post setEnabled(bool) 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _close clicked() enterMiscCount reject() 20 20 20 20 qt-client-4.1.0/guiclient/enterPoReceipt.cpp000066400000000000000000000674731217451700100210520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ // rename to enterReceipt #include "enterPoReceipt.h" #include #include #include #include #include #include "xmessagebox.h" #include "inputManager.h" #include "distributeInventory.h" #include "enterPoitemReceipt.h" #include "getLotInfo.h" #include "mqlutil.h" #include "printLabelsByOrder.h" #include "storedProcErrorLookup.h" enterPoReceipt::enterPoReceipt(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_all, SIGNAL(clicked()), this, SLOT(sReceiveAll())); connect(_enter, SIGNAL(clicked()), this, SLOT(sEnter())); connect(_order, SIGNAL(valid(bool)), this, SLOT(sFillList())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_orderitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_printLabel, SIGNAL(clicked()), this, SLOT(sPrintItemLabel())); connect(_bcFind, SIGNAL(clicked()), this, SLOT(sBcFind())); // connect(_orderitem, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); _order->setAllowedStatuses(OrderLineEdit::Open); _order->setAllowedTypes(OrderLineEdit::Purchase | OrderLineEdit::Return | OrderLineEdit::Transfer); _order->setToSitePrivsEnforced(true); _order->setLockSelected(true); omfgThis->inputManager()->notify(cBCItem, this, this, SLOT(sCatchItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, this, SLOT(sCatchItemsiteid(int))); omfgThis->inputManager()->notify(cBCPurchaseOrder, this, this, SLOT(sCatchPoheadid(int))); omfgThis->inputManager()->notify(cBCPurchaseOrderLineItem, this, this, SLOT(sCatchPoitemid(int))); omfgThis->inputManager()->notify(cBCTransferOrder, this, this, SLOT(sCatchToheadid(int))); omfgThis->inputManager()->notify(cBCTransferOrderLineItem, this, this, SLOT(sCatchToitemid(int))); if (_metrics->boolean("EnableDropShipments")) _dropShip->setEnabled(FALSE); else _dropShip->hide(); if (_metrics->boolean("EnableReturnAuth")) { _order->setExtraClause("RA", "(SELECT SUM(raitem_qtyauthorized) > 0 " " FROM raitem" " WHERE ((raitem_rahead_id=orderhead_id)" " AND (orderhead_type = 'RA'))) " " AND " "(SELECT TRUE " " FROM raitem" " WHERE ((raitem_rahead_id=orderhead_id)" " AND (raitem_disposition IN ('R','P','V')) " " AND (orderhead_type = 'RA')) " " LIMIT 1)"); _order->setExtraClause("TO", "(SELECT SUM(NONEG(toitem_qty_shipped - toitem_qty_received)) > 0 " " FROM toitem" " WHERE ((toitem_tohead_id=orderhead_id)" " AND (orderhead_type = 'TO'))) "); } _orderitem->addColumn(tr("#"), _whsColumn, Qt::AlignCenter , true, "linenumber"); _orderitem->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft , true, "duedate"); _orderitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft , true, "item_number"); _orderitem->addColumn(tr("Description"), -1, Qt::AlignLeft , true, "itemdescription"); _orderitem->addColumn(tr("Inv. UOM"), _uomColumn, Qt::AlignCenter , true, "inv_uom"); _orderitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter , true, "warehous_code"); _orderitem->addColumn(tr("Vend. Item #"), -1, Qt::AlignLeft , true, "vend_item_number"); _orderitem->addColumn(tr("Vend. UOM"), _uomColumn, Qt::AlignCenter , true, "vend_uom"); _orderitem->addColumn(tr("Manufacturer"), _orderColumn, Qt::AlignLeft , false, "manuf_name"); _orderitem->addColumn(tr("Manuf. Item#"), _orderColumn, Qt::AlignCenter, false, "manuf_item_number"); _orderitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight , true, "qty_ordered"); _orderitem->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight , true, "qty_received"); _orderitem->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight , true, "qty_returned"); _orderitem->addColumn(tr("To Receive"), _qtyColumn, Qt::AlignRight , true, "qty_toreceive"); _captive = FALSE; _soheadid = -1; _bcQty->setValidator(omfgThis->qtyVal()); //Remove lot/serial if no lot/serial tracking if (!_metrics->boolean("LotSerialControl")) _singleLot->hide(); } enterPoReceipt::~enterPoReceipt() { // no need to delete child widgets, Qt does it all for us } void enterPoReceipt::languageChange() { retranslateUi(this); } enum SetResponse enterPoReceipt::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _captive = TRUE; _order->setId(param.toInt(), "PO"); } param = pParams.value("tohead_id", &valid); if (valid) { _captive = TRUE; _order->setId(param.toInt(), "TO"); } param = pParams.value("rahead_id", &valid); if (valid) { _captive = TRUE; _order->setId(param.toInt(), "RA"); } return NoError; } void enterPoReceipt::setParams(ParameterList & params) { if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_order->isValid()) { if (_order->isPO()) params.append("pohead_id", _order->id()); else if (_order->isRA()) params.append("rahead_id", _order->id()); else if (_order->isTO()) params.append("tohead_id", _order->id()); params.append("orderid", _order->id()); params.append("ordertype", _order->type()); } params.append("nonInventory", tr("Non-Inventory")); params.append("na", tr("N/A")); } void enterPoReceipt::sPrint() { ParameterList params; setParams(params); printLabelsByOrder newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void enterPoReceipt::sPrintItemLabel() { ParameterList params; params.append("vendorItemLit", tr("Vendor Item#:")); params.append("ordertype", _order->type()); params.append("orderitemid", _orderitem->id()); orReport report("ReceivingLabel", params); if (report.isValid()) report.print(); else { report.reportError(this); } } void enterPoReceipt::post(const QString pType, const int pId) { enterPoReceipt * w = new enterPoReceipt(0, "enterPoReceipt"); w->setWindowModality(Qt::WindowModal); ParameterList params; if (pType == "PO") params.append("pohead_id", pId); else if (pType == "RA") params.append("rahead_id", pId); else if (pType == "TO") params.append("tohead_id", pId); w->set(params); w->sPost(); } void enterPoReceipt::sPost() { XSqlQuery enterPost; ParameterList params; // shared by several queries setParams(params); QString checks = "SELECT SUM(qtyToReceive(recv_order_type," " recv_orderitem_id)) AS qtyToRecv " "FROM recv, orderitem " "WHERE ((recv_order_type=)" " AND (recv_orderitem_id=orderitem_id)" " AND (orderitem_orderhead_type=)" " AND (orderitem_orderhead_id=));"; MetaSQLQuery checkm(checks); enterPost = checkm.toQuery(params); if (enterPost.first()) { if (enterPost.value("qtyToRecv").toDouble() <= 0) { QMessageBox::critical(this, tr("Nothing selected for Receipt"), tr("

    No Line Items have been selected " "for receipt. Select at least one Line Item and " "enter a Receipt before trying to Post.")); return; } } else if (enterPost.lastError().type() != QSqlError::NoError) { systemError(this, enterPost.lastError().databaseText(), __FILE__, __LINE__); return; } QString lotnum = QString::null; QDate expdate = omfgThis->startOfTime(); QDate warrdate; bool gotlot = false; enterPost.exec("BEGIN;"); // because of possible insertgltransaction failures XSqlQuery rollback; rollback.prepare("ROLLBACK;"); QString items = "SELECT recv_id, itemsite_controlmethod, itemsite_perishable,itemsite_warrpurc, " " (recv_order_type = 'RA' AND COALESCE(itemsite_costmethod,'') = 'J') AS issuerawo, " " (recv_order_type = 'PO' AND COALESCE(itemsite_costmethod,'') = 'J' AND poitem_order_type='W') AS issuejobwo, " " (recv_order_type = 'PO' AND COALESCE(itemsite_costmethod,'') = 'J' AND poitem_order_type='S') AS issuejobso, " " COALESCE(pohead_dropship, false) AS dropship " " FROM orderitem, recv " " LEFT OUTER JOIN itemsite ON (recv_itemsite_id=itemsite_id) " " LEFT OUTER JOIN poitem ON ((recv_order_type='PO') " " AND (recv_orderitem_id=poitem_id)) " " LEFT OUTER JOIN pohead ON (poitem_pohead_id=pohead_id) " " WHERE((recv_orderitem_id=orderitem_id)" " AND (orderitem_orderhead_id=)" " AND (orderitem_orderhead_type=)" " AND (NOT recv_posted)" " AND (recv_trans_usr_name=getEffectiveXtUser())" " AND (recv_order_type=))"; MetaSQLQuery itemsm(items); XSqlQuery qi = itemsm.toQuery(params); while(qi.next()) { if(_singleLot->isChecked() && !gotlot && qi.value("itemsite_controlmethod").toString() == "L") { getLotInfo newdlg(this, "", TRUE); newdlg.enableExpiration(qi.value("itemsite_perishable").toBool()); newdlg.enableWarranty(qi.value("itemsite_warrpurc").toBool()); if(newdlg.exec() == XDialog::Accepted) { gotlot = true; lotnum = newdlg.lot(); expdate = newdlg.expiration(); warrdate = newdlg.warranty(); } } XSqlQuery postLine; postLine.prepare("SELECT postReceipt(recv_id, 0) AS result " "FROM recv " "WHERE (recv_id=:recv_id);"); postLine.bindValue(":recv_id", qi.value("recv_id").toInt()); postLine.exec(); if (postLine.first()) { int result = postLine.value("result").toInt(); if (result < 0 && result != -11) // ignore -11 as it just means there was no inventory { rollback.exec(); systemError(this, storedProcErrorLookup("postReceipt", result), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(result, this, lotnum, expdate, warrdate) == XDialog::Rejected) { QMessageBox::information( this, tr("Enter Receipts"), tr("Post Canceled") ); rollback.exec(); return; } // Job item for Return Service; issue this to work order if (qi.value("issuerawo").toBool()) { XSqlQuery issue; issue.prepare("SELECT issueWoRtnReceipt(coitem_order_id, invhist_id) AS result " "FROM invhist, recv " " JOIN raitem ON (raitem_id=recv_orderitem_id) " " JOIN coitem ON (coitem_id=raitem_new_coitem_id) " "WHERE ((invhist_series=:itemlocseries) " " AND (recv_id=:id));"); issue.bindValue(":itemlocseries", postLine.value("result").toInt()); issue.bindValue(":id", qi.value("recv_id").toInt()); issue.exec(); if (issue.lastError().type() != QSqlError::NoError) { systemError(this, issue.lastError().databaseText(), __FILE__, __LINE__); rollback.exec(); return; } } // Job item for Purchase Order; issue this to work order else if (qi.value("issuejobwo").toBool()) { XSqlQuery issue; issue.prepare("SELECT issueWoMaterial(womatl_id, " " (recv_qty * poitem_invvenduomratio), " " :itemlocseries, NOW(), invhist_id ) AS result " "FROM invhist, recv " " JOIN poitem ON (poitem_id=recv_orderitem_id) " " JOIN womatl ON (womatl_id=poitem_order_id AND poitem_order_type='W') " "WHERE ((invhist_series=:itemlocseries) " " AND (recv_id=:id));"); issue.bindValue(":itemlocseries", postLine.value("result").toInt()); issue.bindValue(":id", qi.value("recv_id").toInt()); issue.exec(); if (issue.first()) { if (issue.value("result").toInt() < 0) { rollback.exec(); systemError( this, storedProcErrorLookup("issueWoMaterial", issue.value("result").toInt()), __FILE__, __LINE__); return; } issue.prepare("SELECT postItemLocSeries(:itemlocseries);"); issue.bindValue(":itemlocseries", postLine.value("result").toInt()); issue.exec(); } else if (issue.lastError().type() != QSqlError::NoError) { systemError(this, issue.lastError().databaseText(), __FILE__, __LINE__); rollback.exec(); return; } } // Issue drop ship orders and Job Cost items to shipping else if (qi.value("dropship").toBool() || qi.value("issuejobso").toBool()) { XSqlQuery issue; issue.prepare("SELECT issueToShipping('SO', coitem_id, " " (recv_qty * poitem_invvenduomratio / coitem_qty_invuomratio), " " :itemlocseries, recv_gldistdate, invhist_id ) AS result, " " coitem_cohead_id, cohead_holdtype " "FROM invhist, recv " " JOIN poitem ON (poitem_id=recv_orderitem_id) " " JOIN coitem ON (coitem_id=poitem_order_id AND poitem_order_type='S') " " JOIN cohead ON (coitem_cohead_id=cohead_id) " "WHERE ((invhist_series=:itemlocseries) " " AND (recv_id=:id));"); issue.bindValue(":itemlocseries", postLine.value("result").toInt()); issue.bindValue(":id", qi.value("recv_id").toInt()); issue.exec(); if (issue.first()) { if (issue.value("result").toInt() < 0) { rollback.exec(); systemError( this, storedProcErrorLookup("issueToShipping", issue.value("result").toInt()), __FILE__, __LINE__); return; } if (issue.value("cohead_holdtype").toString() != "N") { QString msg = tr("This Purchase Order is being drop shipped against " "a Sales Order that is on Hold. The Sales Order must " "be taken off Hold before the Receipt may be Posted."); rollback.exec(); QMessageBox::warning(this, tr("Cannot Ship Order"), msg); return; } _soheadid = issue.value("coitem_cohead_id").toInt(); issue.prepare("SELECT postItemLocSeries(:itemlocseries);"); issue.bindValue(":itemlocseries", postLine.value("result").toInt()); issue.exec(); if (qi.value("dropship").toBool() && _soheadid != -1) { XSqlQuery ship; ship.prepare("SELECT shipShipment(shiphead_id, recv_gldistdate) AS result, " " shiphead_id " "FROM shiphead, recv " "WHERE ( (shiphead_order_type='SO') " " AND (shiphead_order_id=:cohead_id) " " AND (NOT shiphead_shipped) " " AND (recv_id=:recv_id) );"); ship.bindValue(":cohead_id", _soheadid); ship.bindValue(":recv_id", qi.value("recv_id").toInt()); ship.exec(); if (ship.first()) { if (ship.value("result").toInt() < 0) { rollback.exec(); systemError( this, storedProcErrorLookup("shipShipment", ship.value("result").toInt()), __FILE__, __LINE__); return; } if (_metrics->boolean("BillDropShip")) { int shipheadid = ship.value("shiphead_id").toInt(); ship.prepare("SELECT selectUninvoicedShipment(:shiphead_id);"); ship.bindValue(":shiphead_id", shipheadid); ship.exec(); if (ship.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, ship.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (ship.lastError().type() != QSqlError::NoError) { systemError(this, ship.lastError().databaseText(), __FILE__, __LINE__); rollback.exec(); return; } } } else if (issue.lastError().type() != QSqlError::NoError) { systemError(this, issue.lastError().databaseText(), __FILE__, __LINE__); rollback.exec(); return; } } } else if (postLine.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, postLine.lastError().databaseText(), __FILE__, __LINE__); return; } } _soheadid = -1; enterPost.exec("COMMIT;"); // TODO: update this to sReceiptsUpdated? omfgThis->sPurchaseOrderReceiptsUpdated(); if (_captive) { _orderitem->clear(); close(); } else { _order->setId(-1); _close->setText(tr("&Close")); } } void enterPoReceipt::sSave() { // most of the work is done in enterPoitemReceipt // don't call this->close() 'cause that deletes the recv records XWidget::close(); } void enterPoReceipt::sEnter() { ParameterList params; params.append("lineitem_id", _orderitem->id()); params.append("order_type", _order->type()); params.append("mode", "new"); enterPoitemReceipt newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void enterPoReceipt::sFillList() { XSqlQuery enterFillList; _orderitem->clear(); if (_order->isRA()) { enterFillList.prepare( "SELECT (rahead_expiredate < CURRENT_DATE) AS expired " "FROM rahead " "WHERE (rahead_id=:rahead_id);" ); enterFillList.bindValue(":rahead_id", _order->id()); enterFillList.exec(); if (enterFillList.first()) { if (enterFillList.value("expired").toBool()) { QMessageBox::warning(this, tr("RMA Expired"), tr("

    The selected Return Authorization " "is expired and cannot be received.")); _order->setId(-1); _order->setFocus(); } } else if (enterFillList.lastError().type() != QSqlError::NoError) { systemError(this, enterFillList.lastError().databaseText(), __FILE__, __LINE__); return; } else { _order->setId(-1); _order->setFocus(); return; } } XSqlQuery dropship; dropship.prepare("SELECT pohead_dropship FROM pohead WHERE (pohead_id = :pohead_id);"); dropship.bindValue(":pohead_id", _order->id()); dropship.exec(); if(dropship.first()) { if(dropship.value("pohead_dropship").toBool()) _dropShip->setChecked(TRUE); else _dropShip->setChecked(FALSE); } disconnect(_order, SIGNAL(valid(bool)), this, SLOT(sFillList())); if (_order->isValid()) { ParameterList params; setParams(params); MetaSQLQuery fillm = mqlLoad("receipt", "detail"); enterFillList = fillm.toQuery(params); _orderitem->populate(enterFillList,true); if (enterFillList.lastError().type() != QSqlError::NoError) { systemError(this, enterFillList.lastError().databaseText(), __FILE__, __LINE__); connect(_order, SIGNAL(valid(bool)), this, SLOT(sFillList())); return; } } connect(_order, SIGNAL(valid(bool)), this, SLOT(sFillList())); } void enterPoReceipt::close() { XSqlQuery enterclose; QList zeroItems = _orderitem->findItems("^[0.]*$", Qt::MatchRegExp, 9); if (_order->isValid() && zeroItems.size() != _orderitem->topLevelItemCount()) { if (QMessageBox::question(this, tr("Cancel Receipts?"), tr("

    Are you sure you want to cancel all " "unposted Receipts for this Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { ParameterList params; setParams(params); QString dels = "SELECT deleteRecvForOrder(," " ) AS result;" ; MetaSQLQuery delm(dels); enterclose = delm.toQuery(params); if (enterclose.first()) { int result = enterclose.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteRecvForOrder", result), __FILE__, __LINE__); return; } } else if (enterclose.lastError().type() != QSqlError::NoError) { systemError(this, enterclose.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPurchaseOrderReceiptsUpdated(); } else return; } if(!isVisible()) deleteLater(); else XWidget::close(); } void enterPoReceipt::sReceiveAll() { XSqlQuery enterReceiveAll; ParameterList params; setParams(params); if (_metrics->boolean("EnableReturnAuth")) params.append("EnableReturnAuth", TRUE); MetaSQLQuery recvm = mqlLoad("receipt", "receiveAll"); enterReceiveAll = recvm.toQuery(params); while (enterReceiveAll.next()) { int result = enterReceiveAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("enterReceipt", result), __FILE__, __LINE__); return; } } if (enterReceiveAll.lastError().type() != QSqlError::NoError) { systemError(this, enterReceiveAll.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPurchaseOrderReceiptsUpdated(); sFillList(); } void enterPoReceipt::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem * /*selected*/) { QAction *menuItem; if (_orderitem->altId() != -1) menuItem = pMenu->addAction(tr("Print Label..."), this, SLOT(sPrintItemLabel())); menuItem = pMenu->addAction(tr("Enter Receipt..."), this, SLOT(sEnter())); } void enterPoReceipt::sBcFind() { XSqlQuery enterBcFind; if (!_order->isValid()) { QMessageBox::warning(this, tr("Invalid Order"), tr("

    Cannot search for Items by Bar Code without " "first selecting an Order.")); _bc->setFocus(); return; } if (_bc->text().isEmpty()) { QMessageBox::warning(this, tr("No Bar Code scanned"), tr("

    Cannot search for Items by Bar Code without a " "Bar Code.")); _bc->setFocus(); return; } double qtytoreceive = 0; // find item that matches barcode and is a line item in this order. // then call enterPoItemReceipt passing in params to preset and // run the receive button. ParameterList findbc; setParams(findbc); findbc.append("bc", _bc->text()); MetaSQLQuery fillm = mqlLoad("receipt", "detail"); enterBcFind = fillm.toQuery(findbc); if(enterBcFind.first()) qtytoreceive = enterBcFind.value("qty_toreceive").toDouble(); else { if (enterBcFind.lastError().type() != QSqlError::NoError) { systemError(this, enterBcFind.lastError().databaseText(), __FILE__, __LINE__); return; } XMessageBox::message(this, QMessageBox::Warning, tr("No Match Found"), tr("

    No Items on this Order match the specified Barcode.") ); _bc->clear(); return; } ParameterList params; params.append("lineitem_id", enterBcFind.value("orderitem_id").toInt()); params.append("order_type", _order->type()); params.append("mode", "new"); params.append("qty", _bcQty->toDouble() + qtytoreceive); params.append("receive"); params.append("snooze"); enterPoitemReceipt newdlg(this, "", TRUE); if (newdlg.set(params) != NoError) return; sFillList(); if (_autoPost->isChecked()) { int id = _order->id(); QString type = _order->type(); sPost(); _order->setId(id, type); } _bc->clear(); _bcQty->setText("1"); } void enterPoReceipt::sCatchPoheadid(int pPoheadid) { _order->setId(pPoheadid, "PO"); _orderitem->selectAll(); } void enterPoReceipt::sCatchPoitemid(int pPoitemid) { XSqlQuery enterCatchPoitemid; enterCatchPoitemid.prepare( "SELECT poitem_pohead_id " "FROM poitem " "WHERE (poitem_id=:poitem_id);" ); enterCatchPoitemid.bindValue(":poitem_id", pPoitemid); enterCatchPoitemid.exec(); if (enterCatchPoitemid.first()) { _order->setId(enterCatchPoitemid.value("poitem_pohead_id").toInt(), "PO"); _orderitem->clearSelection(); _orderitem->setId(pPoitemid); sEnter(); } else if (enterCatchPoitemid.lastError().type() != QSqlError::NoError) { systemError(this, enterCatchPoitemid.lastError().databaseText(), __FILE__, __LINE__); return; } } void enterPoReceipt::sCatchToheadid(int pToheadid) { _order->setId(pToheadid, "TO"); _orderitem->selectAll(); } void enterPoReceipt::sCatchToitemid(int porderitemid) { XSqlQuery enterCatchToitemid; enterCatchToitemid.prepare( "SELECT toitem_tohead_id " "FROM toitem " "WHERE (toitem_id=:tohead_id);" ); enterCatchToitemid.bindValue(":tohead_id", porderitemid); enterCatchToitemid.exec(); if (enterCatchToitemid.first()) { _order->setId(enterCatchToitemid.value("toitem_tohead_id").toInt(), "TO"); _orderitem->clearSelection(); _orderitem->setId(porderitemid); sEnter(); } else if (enterCatchToitemid.lastError().type() != QSqlError::NoError) { systemError(this, enterCatchToitemid.lastError().databaseText(), __FILE__, __LINE__); return; } } void enterPoReceipt::sCatchItemsiteid(int pItemsiteid) { XSqlQuery enterCatchItemsiteid; enterCatchItemsiteid.prepare("SELECT orderitem_id " "FROM orderitem " "WHERE ((orderitem_itemsite_id=:itemsite) " " AND (orderitem_orderhead_type=:ordertype) " " AND (orderitem_orderhead_id=:orderid));"); enterCatchItemsiteid.bindValue(":itemsite", pItemsiteid); enterCatchItemsiteid.bindValue(":ordertype", _order->type()); enterCatchItemsiteid.bindValue(":orderid", _order->id()); enterCatchItemsiteid.exec(); if (enterCatchItemsiteid.first()) { _orderitem->clearSelection(); _orderitem->setId(enterCatchItemsiteid.value("orderitem_id").toInt()); sEnter(); } else audioReject(); } void enterPoReceipt::sCatchItemid(int pItemid) { XSqlQuery enterCatchItemid; enterCatchItemid.prepare( "SELECT orderitem_id " "FROM orderitem, itemsite " "WHERE ((orderitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=:item_id)" " AND (orderitem_orderhead_type=:ordertype) " " AND (orderitem_orderhead_id=:orderid));"); enterCatchItemid.bindValue(":item_id", pItemid); enterCatchItemid.bindValue(":ordertype", _order->type()); enterCatchItemid.bindValue(":orderid", _order->id()); enterCatchItemid.exec(); if (enterCatchItemid.first()) { _orderitem->clearSelection(); _orderitem->setId(enterCatchItemid.value("orderitem_id").toInt()); sEnter(); } else audioReject(); } qt-client-4.1.0/guiclient/enterPoReceipt.h000066400000000000000000000033201217451700100204740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ENTERPORECEIPT_H #define ENTERPORECEIPT_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_enterPoReceipt.h" class enterPoReceipt : public XWidget, public Ui::enterPoReceipt { Q_OBJECT public: enterPoReceipt(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~enterPoReceipt(); static void post(const QString, const int); public slots: virtual void close(); virtual enum SetResponse set(const ParameterList & pParams); virtual void sEnter(); virtual void sFillList(); virtual void sPost(); virtual void sPrint(); virtual void sReceiveAll(); virtual void sSave(); virtual void setParams(ParameterList &); virtual void sPrintItemLabel(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * selected ); virtual void sBcFind(); virtual void sCatchItemid( int pItemid ); virtual void sCatchItemsiteid( int pItemsiteid ); virtual void sCatchPoheadid( int pPoheadid ); virtual void sCatchPoitemid( int pPoitemid ); virtual void sCatchToheadid( int pToheadid ); virtual void sCatchToitemid( int porderitemid ); protected slots: virtual void languageChange(); private: bool _captive; int _soheadid; }; #endif // ENTERPORECEIPT_H qt-client-4.1.0/guiclient/enterPoReceipt.ui000066400000000000000000000347141217451700100206750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. enterPoReceipt 0 0 800 600 Enter Order Receipts 12 12 5 14 0 0 6 false Drop Ship Qt::Vertical 20 0 Qt::Horizontal 40 0 Assign all Lot-controlled Items to single Lot # 0 &Cancel false &Print false P&ost true true false Save Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Order Line Items: 5 0 false Print &Label false &Enter Receipt false Receive &All Qt::Vertical QSizePolicy::Expanding 20 20 12 Receive Items using bar code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 35 0 Qty. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 1 Auto Post Find Qt::Horizontal QSizePolicy::Expanding 0 20 OrderCluster QWidget

    ordercluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _singleLot _orderitem _enter _all _print _post _close _close clicked() enterPoReceipt close() 20 20 20 20 _orderitem itemSelected(int) _enter animateClick() 20 20 20 20 _orderitem valid(bool) _enter setEnabled(bool) 20 20 20 20 _order valid(bool) _print setEnabled(bool) 171 28 683 88 _order valid(bool) _save setEnabled(bool) 171 28 683 178 _order valid(bool) _all setEnabled(bool) 171 28 691 282 _order valid(bool) _post setEnabled(bool) 171 28 683 133 _orderitem valid(bool) _printLabel setEnabled(bool) 297 317 635 170 _bc returnPressed() _bcFind animateClick() 294 556 592 558 qt-client-4.1.0/guiclient/enterPoReturn.cpp000066400000000000000000000277141217451700100207300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "enterPoReturn.h" #include #include #include #include #include #include #include "distributeInventory.h" #include "enterPoitemReturn.h" #include "storedProcErrorLookup.h" #include "postPoReturnCreditMemo.h" enterPoReturn::enterPoReturn(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_enter, SIGNAL(clicked()), this, SLOT(sEnter())); connect(_po, SIGNAL(newId(int, const QString&)), this, SLOT(sFillList())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _poitem->addColumn(tr("#"), _whsColumn, Qt::AlignCenter , true, "poitem_linenumber"); _poitem->addColumn(tr("Site"), _whsColumn, Qt::AlignLeft , true, "warehous_code"); _poitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft , true, "item_number"); _poitem->addColumn(tr("Description"), -1, Qt::AlignLeft , true, "itemdescription"); _poitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter , true, "inv_uom"); _poitem->addColumn(tr("Vend. Item #"), -1, Qt::AlignLeft , true, "poitem_vend_item_number"); _poitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter , true, "poitem_vend_uom"); _poitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight , true, "poitem_qty_ordered"); _poitem->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight , true, "poitem_qty_received"); _poitem->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight , true, "poitem_qty_returned"); _poitem->addColumn(tr("To Return"), _qtyColumn, Qt::AlignRight , true, "poitem_qty_toreturn"); _captive = false; _dropshipWarn = new XErrorMessage(this); _returnAddr->setEnabled(_printReport->isChecked()); _po->setAllowedStatuses(OrderLineEdit::Open | OrderLineEdit::Closed); _po->setAllowedTypes(OrderLineEdit::Purchase); _po->setLockSelected(true); if (_metrics->boolean("EnableDropShipments")) _dropShip->setEnabled(FALSE); else _dropShip->hide(); } enterPoReturn::~enterPoReturn() { // no need to delete child widgets, Qt does it all for us } void enterPoReturn::languageChange() { retranslateUi(this); } enum SetResponse enterPoReturn::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _captive = TRUE; _po->setId(param.toInt()); } return NoError; } void enterPoReturn::sPost() { XSqlQuery enterPost; bool createMemo = false; enterPost.prepare("SELECT SUM(poreject_qty) AS qtyToReturn, MIN(poitem_status) AS poitem_status " "FROM poreject, poitem " "WHERE ((poreject_poitem_id=poitem_id)" " AND (NOT poreject_posted)" " AND (poitem_pohead_id=:pohead_id));"); enterPost.bindValue(":pohead_id", _po->id()); enterPost.exec(); if (enterPost.first()) { if (enterPost.value("qtyToReturn").toDouble() == 0) { QMessageBox::critical(this, tr("Nothing selected for Return"), tr("

    No Purchase Order Items have been selected " "to be returned. Select at least one Line Item " "and enter a Return before trying to Post.")); return; } //Offer to create credit memo if ( (_privileges->check("MaintainAPMemos")) && (enterPost.value("poitem_status").toString() == "C") ) if ( QMessageBox::question( this, tr("Create Credit Memo"), tr("One or more line items on this P/O are closed. \n" "Would you like to automatically create a credit memo against this return?"), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 0 ) createMemo = true; } else if (enterPost.lastError().type() != QSqlError::NoError) { systemError(this, enterPost.lastError().databaseText(), __FILE__, __LINE__); return; } int saveResult = _returnAddr->save(AddressCluster::CHECK); if (-2 == saveResult) { if (QMessageBox::question(this, tr("Saving Shared Address"), tr("

    There are multiple uses for this Address. " "If you save this Address, the Address for all " "of these uses will be changed. Would you like to " "save this Address?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes)) saveResult = _returnAddr->save(AddressCluster::CHANGEALL); } if (0 > saveResult) // NOT else if { systemError(this, tr("

    There was an error saving this address (%1). " "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); } // print while we can still differentiate current from previous returns if (_printReport->isChecked()) { ParameterList params; params.append("pohead_id", _po->id()); if (_returnAddr->isValid()) params.append("addr_id", _returnAddr->id()); orReport report("UnpostedReturnsForPO", params); if (report.isValid()) report.print(); else { report.reportError(this); return; } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); // Get the list of returns that are going to be posted XSqlQuery reject; reject.prepare("SELECT poreject_id" " FROM poreject, poitem" " WHERE((NOT poreject_posted)" " AND (poreject_poitem_id=poitem_id)" " AND (poitem_pohead_id=:pohead_id));"); reject.bindValue(":pohead_id", _po->id()); reject.exec(); enterPost.exec("BEGIN;"); // because of possible insertgltransaction failures // post the returns enterPost.prepare("SELECT postPoReturns(:pohead_id,false) AS result;"); enterPost.bindValue(":pohead_id", _po->id()); enterPost.exec(); int result = 0; if (enterPost.first()) { result = enterPost.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postPoReturns", result), __FILE__, __LINE__); return; } } else if (enterPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, enterPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(enterPost.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Enter PO Return"), tr("Transaction Canceled") ); return; } enterPost.exec("COMMIT;"); // if we are creating the credit memo go ahead and loop the returns that // we have just posted and create the credit memos. if(createMemo) { while(reject.next()) { ParameterList params; params.append("poreject_id", reject.value("poreject_id").toInt()); postPoReturnCreditMemo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } if (_captive) close(); else { _close->setText(tr("&Close")); _po->setId(-1); } } void enterPoReturn::sEnter() { ParameterList params; params.append("poitem_id", _poitem->id()); if(_dropShip->isChecked()) _dropshipWarn->showMessage(tr("Returns made against Drop Shipped Purchase Orders " "will not reverse shipment transactions generated " "by the original receipt. Shipment transactions should " "be reversed separately if necessary.")); enterPoitemReturn newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec()) sFillList(); } void enterPoReturn::sFillList() { XSqlQuery enterFillList; _poitem->clear(); if (_po->id() != -1) { enterFillList.prepare( "SELECT 1, vendaddr_addr_id AS addr_id, pohead_dropship " "FROM vendaddrinfo, pohead " "WHERE ((vendaddr_id=pohead_vendaddr_id)" " AND (pohead_id=:pohead_id))" "UNION " "SELECT 2, vend_addr_id AS addr_id, pohead_dropship " "FROM vendinfo, pohead " "WHERE ((vend_id=pohead_vend_id)" " AND (pohead_id=:pohead_id)) " "ORDER BY 1 " "LIMIT 1;"); enterFillList.bindValue(":pohead_id", _po->id()); enterFillList.exec(); if (enterFillList.first()) { _returnAddr->setId(enterFillList.value("addr_id").toInt()); _dropShip->setChecked(enterFillList.value("pohead_dropship").toBool()); } else if (enterFillList.lastError().type() != QSqlError::NoError) { systemError(this, enterFillList.lastError().databaseText(), __FILE__, __LINE__); return; } QString sql( "SELECT poitem_id, poitem_linenumber," " warehous_code, " " COALESCE(item_number, ) AS item_number," " CASE WHEN (LENGTH(TRIM(BOTH ' ' FROM poitem_vend_item_descrip)) <= 0) THEN " " (item_descrip1 || ' ' || item_descrip2) " " ELSE poitem_vend_item_descrip " " END AS itemdescription, " " COALESCE(uom_name, ) AS inv_uom," " poitem_vend_item_number, poitem_vend_uom," " poitem_qty_ordered," " poitem_qty_received," " poitem_qty_returned," " COALESCE( ( SELECT SUM(poreject_qty)" " FROM poreject" " WHERE ( (poreject_poitem_id=poitem_id)" " AND (NOT poreject_posted) ) ), 0 ) AS poitem_qty_toreturn, " " 'qty' AS poitem_qty_ordered_xtnumericrole, " " 'qty' AS poitem_qty_received_xtnumericrole, " " 'qty' AS poitem_qty_returned_xtnumericrole, " " 'qty' AS poitem_qty_toreturn_xtnumericrole " "FROM poitem LEFT OUTER JOIN " " ( itemsite " " JOIN item ON (itemsite_item_id=item_id) " " JOIN uom ON (item_inv_uom_id=uom_id) " " JOIN site() ON (itemsite_warehous_id=warehous_id) " " ) ON (poitem_itemsite_id=itemsite_id) " "WHERE (poitem_pohead_id= ) " "ORDER BY poitem_linenumber;" ); ParameterList params; params.append("na", tr("N/A")); params.append("nonInventory", tr("Non-Inventory")); params.append("pohead_id", _po->id()); MetaSQLQuery mql(sql); enterFillList = mql.toQuery(params); _poitem->populate(enterFillList); if (enterFillList.lastError().type() != QSqlError::NoError) { systemError(this, enterFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } } void enterPoReturn::closeEvent(QCloseEvent *pEvent) { XSqlQuery entercloseEvent; if (_po->isValid()) { // Cancel all received qty's for this po entercloseEvent.prepare( "DELETE FROM poreject " "WHERE ( poreject_id IN ( SELECT poreject_id" " FROM poreject, poitem" " WHERE ( (poreject_poitem_id=poitem_id)" " AND (NOT poreject_posted)" " AND (poitem_pohead_id=:pohead_id) ) ) );" ); entercloseEvent.bindValue(":pohead_id", _po->id()); entercloseEvent.exec(); if (entercloseEvent.lastError().type() != QSqlError::NoError) { systemError(this, entercloseEvent.lastError().databaseText(), __FILE__, __LINE__); } } XWidget::closeEvent(pEvent); } qt-client-4.1.0/guiclient/enterPoReturn.h000066400000000000000000000022451217451700100203650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ENTERPORETURN_H #define ENTERPORETURN_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_enterPoReturn.h" #include "xerrormessage.h" class enterPoReturn : public XWidget, public Ui::enterPoReturn { Q_OBJECT public: enterPoReturn(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~enterPoReturn(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sEnter(); virtual void sFillList(); virtual void sPost(); protected slots: virtual void languageChange(); private: bool _captive; XErrorMessage *_dropshipWarn; }; #endif // ENTERPORETURN_H qt-client-4.1.0/guiclient/enterPoReturn.ui000066400000000000000000000247111217451700100205550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. enterPoReturn 0 0 600 400 Enter Purchase Order Returns 6 0 6 0 14 0 0 4 false Drop Ship Qt::Vertical 20 0 Qt::Horizontal 40 0 Print Return Report Return Address: _returnAddr false Qt::Vertical 20 0 Qt::Horizontal 40 20 0 0 &Cancel false &Post true true Qt::Vertical 20 40 0 0 0 0 0 20 Purchase Order Items: 7 0 0 2 0 0 false &Enter Return true true Qt::Vertical QSizePolicy::Expanding 20 20 AddressCluster QWidget

    addresscluster.h
    OrderCluster QWidget
    ordercluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _printReport _returnAddr _poitem _enter _post _close _close clicked() enterPoReturn close() 20 20 20 20 _poitem itemSelected(int) _enter animateClick() 20 20 20 20 _poitem valid(bool) _enter setEnabled(bool) 20 20 20 20 _printReport toggled(bool) _returnAddr setEnabled(bool) 359 17 359 111 _po valid(bool) _post setEnabled(bool) 130 43 20 20 qt-client-4.1.0/guiclient/enterPoitemReceipt.cpp000066400000000000000000000320351217451700100217130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "enterPoitemReceipt.h" #include #include #include #include #include #include "xmessagebox.h" #include "distributeInventory.h" #include "itemSite.h" #include "mqlutil.h" #include "storedProcErrorLookup.h" enterPoitemReceipt::enterPoitemReceipt(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sReceive())); connect(_toReceive, SIGNAL(editingFinished()), this, SLOT(sDetermineToReceiveInv())); connect(_toReceive, SIGNAL(editingFinished()), this, SLOT(sHandleExtendedCost())); connect(_purchCost, SIGNAL(editingFinished()), this, SLOT(sHandleExtendedCost())); _invVendorUOMRatio->setPrecision(omfgThis->ratioVal()); _ordered->setPrecision(omfgThis->qtyVal()); _received->setPrecision(omfgThis->qtyVal()); _returned->setPrecision(omfgThis->qtyVal()); _toReceiveInv->setPrecision(omfgThis->qtyVal()); _toReceive->setValidator(omfgThis->qtyVal()); _receiptDate->setDate(QDate::currentDate()); _mode = cView; _orderitemid = -1; _ordertype = ""; _receivable = 0.0; _recvid = -1; _snooze = false; } enterPoitemReceipt::~enterPoitemReceipt() { // no need to delete child widgets, Qt does it all for us } void enterPoitemReceipt::languageChange() { retranslateUi(this); } bool enterPoitemReceipt::correctReceipt(int pRecvid, QWidget *pParent) { XSqlQuery entercorrectReceipt; //Validate - Drop Ship receipts may not be corrected entercorrectReceipt.prepare("SELECT (count(*) > 0) AS result " "FROM recv JOIN pohead ON ((recv_order_type='PO') AND (recv_order_number=pohead_number)) " "WHERE ((recv_id=:recvid) " " AND (COALESCE(pohead_dropship, false))); "); entercorrectReceipt.bindValue(":recvid", pRecvid); entercorrectReceipt.exec(); if (entercorrectReceipt.first()) { if (entercorrectReceipt.value("result").toBool()) { QMessageBox::warning(pParent, tr("Cannot Correct"), tr("

    Receipt is a Drop Shipment. The received quantity may not be changed. " "You must use Purchase Order Return to make corrections." )); return XDialog::Rejected; } } //Validate - Split receipts may not be corrected entercorrectReceipt.prepare("SELECT (count(*) > 0) AS result " "FROM recv " "WHERE (((recv_id=:recvid) " " AND (recv_splitfrom_id IS NOT NULL)) " " OR (recv_splitfrom_id=:recvid)); "); entercorrectReceipt.bindValue(":recvid", pRecvid); entercorrectReceipt.exec(); if (entercorrectReceipt.first()) { if (entercorrectReceipt.value("result").toBool()) { QMessageBox::warning(pParent, tr("Cannot Correct"), tr("

    Receipt has been split. The received quantity may not be changed.")); return XDialog::Rejected; } else { ParameterList params; params.append("mode", "edit"); params.append("recv_id", pRecvid); enterPoitemReceipt newdlg(pParent, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) return true; } } return false; } enum SetResponse enterPoitemReceipt::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; _toReceiveLit->setText(tr("Correct Qty. to:")); _freightLit->setText(tr("Correct Freight to:")); _item->setEnabled(false); setWindowTitle(tr("Correct Item Receipt")); } } param = pParams.value("order_type", &valid); if (valid) _ordertype = param.toString(); param = pParams.value("lineitem_id", &valid); if (valid) { _orderitemid = param.toInt(); populate(); } param = pParams.value("recv_id", &valid); if (valid) { _recvid = param.toInt(); populate(); } param = pParams.value("qty", &valid); if (valid) _toReceive->setDouble(param.toDouble()); _snooze = pParams.inList("snooze"); if(pParams.inList("receive")) sReceive(); return NoError; } void enterPoitemReceipt::populate() { XSqlQuery enterpopulate; ParameterList params; if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_metrics->boolean("EnableReturnAuth")) params.append("EnableReturnAuth"); // NOTE: this crashes if popm is defined and toQuery() is called outside the blocks if (_mode == cNew) { MetaSQLQuery popm = mqlLoad("itemReceipt", "populateNew"); params.append("ordertype", _ordertype); params.append("orderitem_id", _orderitemid); enterpopulate = popm.toQuery(params); } else if (_mode == cEdit) { MetaSQLQuery popm = mqlLoad("itemReceipt", "populateEdit"); params.append("recv_id", _recvid); enterpopulate = popm.toQuery(params); } else { systemError(this, tr("

    Incomplete Parameter List: " "_orderitem_id=%1, _ordertype=%2, _mode=%3.") .arg(_orderitemid) .arg(_ordertype) .arg(_mode) ); return; } if (enterpopulate.first()) { _orderNumber->setText(enterpopulate.value("order_number").toString()); _lineNumber->setText(enterpopulate.value("orderitem_linenumber").toString()); _vendorItemNumber->setText(enterpopulate.value("vend_item_number").toString()); _vendorDescrip->setText(enterpopulate.value("vend_item_descrip").toString()); _vendorUOM->setText(enterpopulate.value("vend_uom").toString()); _invVendorUOMRatio->setDouble(enterpopulate.value("orderitem_qty_invuomratio").toDouble()); _dueDate->setDate(enterpopulate.value("duedate").toDate()); _ordered->setDouble(enterpopulate.value("orderitem_qty_ordered").toDouble()); _received->setDouble(enterpopulate.value("qtyreceived").toDouble()); _returned->setDouble(enterpopulate.value("qtyreturned").toDouble()); _receivable = enterpopulate.value("receivable").toDouble(); _notes->setText(enterpopulate.value("notes").toString()); _receiptDate->setDate(enterpopulate.value("effective").toDate()); _freight->setId(enterpopulate.value("curr_id").toInt()); _freight->setLocalValue(enterpopulate.value("recv_freight").toDouble()); if (_ordertype.isEmpty()) _ordertype = enterpopulate.value("recv_order_type").toString(); if (_ordertype == "PO") _orderType->setText(tr("P/O")); else if (_ordertype == "TO") { _returnedLit->setText(tr("Qty. Shipped:")); _orderType->setText(tr("T/O")); } else if (_ordertype == "RA") _orderType->setText(tr("R/A")); int itemsiteid = enterpopulate.value("itemsiteid").toInt(); if (itemsiteid > 0) _item->setItemsiteid(itemsiteid); _item->setEnabled(false); _purchCost->setId(enterpopulate.value("recv_purchcost_curr_id").toInt()); _purchCost->setLocalValue(enterpopulate.value("recv_purchcost").toDouble()); _purchCost->setEnabled(enterpopulate.value("costmethod_average").toBool() && _metrics->boolean("AllowReceiptCostOverride")); _extendedCost->setId(enterpopulate.value("recv_purchcost_curr_id").toInt()); if (enterpopulate.value("inventoryitem").toBool() && itemsiteid <= 0) { MetaSQLQuery ism = mqlLoad("itemReceipt", "sourceItemSite"); XSqlQuery isq = ism.toQuery(params); if (isq.first()) { itemsiteid = itemSite::createItemSite(this, isq.value("itemsite_id").toInt(), isq.value("warehous_id").toInt(), true); if (itemsiteid < 0) return; _item->setItemsiteid(itemsiteid); } else if (isq.lastError().type() != QSqlError::NoError) { systemError(this, isq.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (enterpopulate.lastError().type() != QSqlError::NoError) { systemError(this, enterpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void enterPoitemReceipt::sReceive() { XSqlQuery enterReceive; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); if(_metrics->boolean("DisallowReceiptExcessQty") && _receivable < _toReceive->toDouble()) { XMessageBox::message( (isVisible() ? this : parentWidget()), QMessageBox::Warning, tr("Cannot Receive"), tr( "

    Cannot receive more quantity than ordered." ), QString::null, QString::null, _snooze ); return; } if(_ordertype == "RA" && _receivable < _toReceive->toDouble()) { XMessageBox::message( (isVisible() ? this : parentWidget()), QMessageBox::Warning, tr("Cannot Receive"), tr( "

    Cannot receive more quantity than authorized." ), QString::null, QString::null, _snooze ); return; } double tolerance = _metrics->value("ReceiptQtyTolerancePct").toDouble() / 100.0; if(_metrics->boolean("WarnIfReceiptQtyDiffers") && (_receivable < _toReceive->toDouble() * (1.0 - tolerance) || _receivable > _toReceive->toDouble() * (1.0 + tolerance))) { if(XMessageBox::message( (isVisible() ? this : parentWidget()) , QMessageBox::Question, tr("Receipt Qty. Differs"), tr("

    The Qty entered does not match the receivable Qty for this order. " "Do you wish to continue anyway?"), tr("Yes"), tr("No"), _snooze, 0, 1) == 1) return; } int result = 0; QString storedProc; if (_mode == cNew) { enterReceive.prepare("SELECT enterReceipt(:ordertype, :poitem_id, :qty, :freight, :notes, " ":curr_id, :effective, :purchcost) AS result;"); enterReceive.bindValue(":poitem_id", _orderitemid); enterReceive.bindValue(":ordertype", _ordertype); storedProc = "enterReceipt"; } else if (_mode == cEdit) { enterReceive.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations enterReceive.prepare("UPDATE recv SET recv_notes = :notes WHERE (recv_id=:recv_id);" ); enterReceive.bindValue(":notes", _notes->toPlainText()); enterReceive.bindValue(":recv_id", _recvid); enterReceive.exec(); if (enterReceive.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, enterReceive.lastError().databaseText(), __FILE__, __LINE__); return; } enterReceive.prepare("SELECT correctReceipt(:recv_id, :qty, :freight, 0, " ":curr_id, :effective, :purchcost) AS result;"); enterReceive.bindValue(":recv_id", _recvid); storedProc = "correctReceipt"; } enterReceive.bindValue(":qty", _toReceive->toDouble()); enterReceive.bindValue(":freight", _freight->localValue()); enterReceive.bindValue(":notes", _notes->toPlainText()); enterReceive.bindValue(":curr_id", _freight->id()); enterReceive.bindValue(":effective", _receiptDate->date()); enterReceive.bindValue(":purchcost", _purchCost->localValue()); enterReceive.exec(); if (enterReceive.first()) { result = enterReceive.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup(storedProc, result), __FILE__, __LINE__); return; } } else if (enterReceive.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, enterReceive.lastError().databaseText(), __FILE__, __LINE__); return; } if(cEdit == _mode) { if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); XMessageBox::message( (isVisible() ? this : parentWidget()), QMessageBox::Warning, tr("Enter PO Receipt"), tr( "

    Transaction Cancelled." ), QString::null, QString::null, _snooze ); return; } enterReceive.exec("COMMIT;"); } omfgThis->sPurchaseOrderReceiptsUpdated(); accept(); if (_printLabel->isChecked()) sPrintItemLabel(); } void enterPoitemReceipt::sDetermineToReceiveInv() { _toReceiveInv->setDouble(_invVendorUOMRatio->toDouble() * _toReceive->toDouble()); } void enterPoitemReceipt::sPrintItemLabel() { ParameterList params; params.append("vendorItemLit", tr("Vendor Item#:")); params.append("ordertype", _ordertype); params.append("orderitemid", _orderitemid); orReport report("ReceivingLabel", params); if (report.isValid()) report.print(); else { report.reportError(this); } } void enterPoitemReceipt::sHandleExtendedCost() { _extendedCost->setLocalValue(_toReceive->toDouble() * _purchCost->localValue()); } qt-client-4.1.0/guiclient/enterPoitemReceipt.h000066400000000000000000000025641217451700100213640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ENTERPOITEMRECEIPT_H #define ENTERPOITEMRECEIPT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_enterPoitemReceipt.h" class enterPoitemReceipt : public XDialog, public Ui::enterPoitemReceipt { Q_OBJECT public: enterPoitemReceipt(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~enterPoitemReceipt(); static bool correctReceipt( int pRecvid, QWidget * pParent ); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sReceive(); virtual void sDetermineToReceiveInv(); virtual void sPrintItemLabel(); virtual void sHandleExtendedCost(); protected: bool _snooze; protected slots: virtual void languageChange(); private: int _mode; int _orderitemid; QString _ordertype; double _receivable; int _recvid; }; #endif // ENTERPOITEMRECEIPT_H qt-client-4.1.0/guiclient/enterPoitemReceipt.ui000066400000000000000000000542701217451700100215530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. enterPoitemReceipt 0 0 663 658 Enter Item Receipt 12 Order Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderType Qt::Horizontal 40 20 Order Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderNumber 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 40 20 Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 true Qt::StrongFocus Vend. Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Vendor Item Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 0 0 0 50 true Qty. to Receive in Inv. UOM: Vendor UOM Ratio: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 211 22 0 Receipt Qty. to Receive: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Vendor UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Returned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 160 0 CurrDisplay::Money false CurrDisplay::ExtPrice false CurrDisplay::PurchPrice false Extended Purchase Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unit Purchase Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Date Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Notes 0 0 true true Print Label CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _item _vendorDescrip _toReceive _purchCost _extendedCost _freight _dueDate _receiptDate _printLabel _buttonBox _notes _tab _receiptDate newDate(QDate) _freight setEffective(QDate) 155 289 177 392 _buttonBox rejected() enterPoitemReceipt close() 512 154 279 280 qt-client-4.1.0/guiclient/enterPoitemReturn.cpp000066400000000000000000000211401217451700100215720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "enterPoitemReturn.h" #include #include #include #include "storedProcErrorLookup.h" enterPoitemReturn::enterPoitemReturn(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_return, SIGNAL(clicked()), this, SLOT(sReturn())); _invVendorUOMRatio->setPrecision(omfgThis->ratioVal()); _ordered->setPrecision(omfgThis->qtyVal()); _received->setPrecision(omfgThis->qtyVal()); _toReturn->setValidator(omfgThis->qtyVal()); _item->setReadOnly(TRUE); _rejectCode->setAllowNull(TRUE); _rejectCode->populate( "SELECT rjctcode_id, rjctcode_code " "FROM rjctcode " "ORDER BY rjctcode_code;" ); _receipts->addColumn(tr("Receipt Date"), _timeDateColumn, Qt::AlignCenter, true, "recv_date"); _receipts->addColumn(tr("Receiving Agent"), 100, Qt::AlignCenter, true, "recv_agent_username"); _receipts->addColumn(tr("G/L Post Date"), _dateColumn, Qt::AlignCenter, true, "recv_gldistdate"); _receipts->addColumn(tr("Returnable Qty."), 100, Qt::AlignRight, true, "returnable"); _receipts->addColumn(tr("Purchase Cost"), -1, Qt::AlignRight, true, "recv_purchcost"); _receiptsLit->hide(); _receiptsLine->hide(); _receipts->hide(); } enterPoitemReturn::~enterPoitemReturn() { // no need to delete child widgets, Qt does it all for us } void enterPoitemReturn::languageChange() { retranslateUi(this); } enum SetResponse enterPoitemReturn::set(const ParameterList &pParams) { XSqlQuery enteret; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("poitem_id", &valid); if (valid) { _poitemid = param.toInt(); enteret.prepare(" SELECT recv_id, recv_date, recv_agent_username, recv_gldistdate," " recv_qty-COALESCE(SUM(poreject_qty),0) AS returnable, recv_purchcost " " FROM recv LEFT OUTER JOIN poreject ON (recv_id = poreject_recv_id) " " WHERE recv_orderitem_id=:poitem_id AND recv_order_type='PO' " " GROUP BY recv_id, recv_date, recv_agent_username, recv_gldistdate, recv_purchcost, recv_qty;"); enteret.bindValue(":poitem_id", _poitemid); enteret.exec(); if (enteret.lastError().type() != QSqlError::NoError) { systemError(this, enteret.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _receipts->clear(); _receipts->populate(enteret); enteret.prepare( "SELECT CASE WHEN itemsite_costmethod='A' THEN TRUE ELSE FALSE END AS costmethod_average " "FROM poitem LEFT OUTER JOIN itemsite ON (poitem_itemsite_id = itemsite_id) " "WHERE poitem_id = :poitem_id;"); enteret.bindValue(":poitem_id", _poitemid); enteret.exec(); if (enteret.lastError().type() != QSqlError::NoError) { systemError(this, enteret.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } if (enteret.first()) { _receipts->setVisible(enteret.value("costmethod_average").toBool() && _metrics->boolean("AllowReceiptCostOverride")); _receiptsLit->setVisible(enteret.value("costmethod_average").toBool() && _metrics->boolean("AllowReceiptCostOverride")); _receiptsLine->setVisible(enteret.value("costmethod_average").toBool() && _metrics->boolean("AllowReceiptCostOverride")); } enteret.prepare( "SELECT pohead_number, poitem_linenumber," " COALESCE(itemsite_id, -1) AS itemsiteid," " noNeg(poitem_qty_received - poitem_qty_returned) AS returnable," " poitem_vend_item_number, poitem_vend_uom, poitem_vend_item_descrip," " poitem_qty_ordered," " noNeg(poitem_qty_received - poitem_qty_returned) AS returnableqty," " poitem_invvenduomratio " "FROM pohead, poitem LEFT OUTER JOIN " " ( itemsite JOIN item " " ON (itemsite_item_id=item_id)" " ) ON (poitem_itemsite_id=itemsite_id) " "WHERE ( (poitem_pohead_id=pohead_id)" " AND (poitem_id=:poitem_id) );" ); enteret.bindValue(":poitem_id", _poitemid); enteret.exec(); if (enteret.first()) { _poNumber->setText(enteret.value("pohead_number").toString()); _lineNumber->setText(enteret.value("poitem_linenumber").toString()); _vendorItemNumber->setText(enteret.value("poitem_vend_item_number").toString()); _vendorDescrip->setText(enteret.value("poitem_vend_item_descrip").toString()); _vendorUOM->setText(enteret.value("poitem_vend_uom").toString()); _ordered->setDouble(enteret.value("poitem_qty_ordered").toDouble()); _received->setDouble(enteret.value("returnableqty").toDouble()); _invVendorUOMRatio->setDouble(enteret.value("poitem_invvenduomratio").toDouble()); if (enteret.value("itemsiteid").toInt() != -1) _item->setItemsiteid(enteret.value("itemsiteid").toInt()); _cachedReceived = enteret.value("returnable").toDouble(); enteret.prepare( "SELECT COALESCE(SUM(poreject_qty), 0) AS qtytoreturn " "FROM poreject " "WHERE ( (poreject_poitem_id=:poitem_id)" " AND (NOT poreject_posted) );" ); enteret.bindValue(":poitem_id", _poitemid); enteret.exec(); if (enteret.first()) { _toReturn->setText(enteret.value("qtytoreturn").toString()); _returned = enteret.value("qtytoreturn").toDouble(); } else if (enteret.lastError().type() != QSqlError::NoError) { systemError(this, enteret.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } if (enteret.lastError().type() != QSqlError::NoError) { systemError(this, enteret.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } return NoError; } void enterPoitemReturn::sReturn() { XSqlQuery enterReturn; if (_rejectCode->id() == -1) { QMessageBox::critical( this, tr("Cannot Enter Return"), tr("You may not enter this return until you select a Reject Code.\n") ); _rejectCode->setFocus(); return; } if (_cachedReceived < (_toReturn->toDouble() + _returned)) { QMessageBox::critical( this, tr("Cannot Enter Return"), tr("You may not enter a return whose returned quantity is greater than the returnable quantity.") ); _toReturn->setFocus(); return; } if (_toReturn->toDouble() == 0) { QMessageBox::critical( this, tr("Cannot Enter Return"), tr("You must enter a quantity to return.") ); _toReturn->setFocus(); return; } if (_receipts->isVisible() && _receipts->id() == -1) { QMessageBox::critical( this, tr("Cannot Enter Return"), tr("You may not enter this return until you select a Receipt.\n") ); _receipts->setFocus(); return; } if (_receipts->isVisible()) { QList items = _receipts->selectedItems(); if (_toReturn->toDouble() > items.at(0)->text(3).toDouble()) { QMessageBox::critical( this, tr("Cannot Enter Return"), tr("Quantity to return may not be greater than the returnable quantity from the selected receipt.\n") ); _toReturn->setFocus(); return; } } enterReturn.prepare("SELECT enterPoReturn(:poitem_id, :qty, :rjctcode_id, :recv_id) AS result;"); enterReturn.bindValue(":poitem_id", _poitemid); enterReturn.bindValue(":qty", _toReturn->toDouble()); enterReturn.bindValue(":rjctcode_id", _rejectCode->id()); if (_receipts->id() != -1) enterReturn.bindValue(":recv_id", _receipts->id()); enterReturn.exec(); if (enterReturn.first()) { int result = enterReturn.value("result").toInt(); if (result < 0) { QMessageBox::critical(this, tr("Cannot Enter Return"), storedProcErrorLookup("enterPoReturn", result)); return; } } else if (enterReturn.lastError().type() != QSqlError::NoError) { systemError(this, enterReturn.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/enterPoitemReturn.h000066400000000000000000000021221217451700100212360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ENTERPOITEMRETURN_H #define ENTERPOITEMRETURN_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_enterPoitemReturn.h" class enterPoitemReturn : public XDialog, public Ui::enterPoitemReturn { Q_OBJECT public: enterPoitemReturn(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~enterPoitemReturn(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sReturn(); protected slots: virtual void languageChange(); private: int _poitemid; double _cachedReceived; double _returned; }; #endif // ENTERPOITEMRETURN_H qt-client-4.1.0/guiclient/enterPoitemReturn.ui000066400000000000000000000401311217451700100214260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. enterPoitemReturn 0 0 499 428 Enter P/O Item Return 5 5 7 5 5 5 P/O Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 true Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel &Return true true Qt::Vertical QSizePolicy::Preferred 20 50 5 0 Vend. Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Vendor Item Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::MinimumExpanding 20 20 Vendor UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 true 0 7 40 0 5 Inv./Vendor UOM Ratio: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::Horizontal QSizePolicy::Expanding 20 20 7 5 5 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. to Return: 5 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight 5 5 Returnable Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Reject Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Horizontal Receipts: qPixmapFromMimeSource ItemCluster QWidget
    itemcluster.h
    1
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _item _vendorDescrip _toReturn _rejectCode _return _close _close clicked() enterPoitemReturn reject() 20 20 20 20
    qt-client-4.1.0/guiclient/errorLog.cpp000066400000000000000000000103101217451700100176670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include "errorLog.h" #include "guiclient.h" #include #include #include #include #include #include #include "xtsettings.h" static QStringList _errorList; static errorLogListener * listener = 0; void errorLogListener::initialize() { listener = new errorLogListener(); } void errorLogListener::destroy() { if(listener) delete listener; listener = 0; } errorLog::errorLog(QWidget* parent, const char * name, Qt::WFlags flags) : XWidget(parent, name, flags) { setupUi(this); for(int i = 0; i < _errorList.size(); i++) _errorLog->append(_errorList.at(i)); _debug->setChecked(xtsettingsValue("catchQDebug").toBool()); _warning->setChecked(xtsettingsValue("catchQWarning").toBool()); _critical->setChecked(xtsettingsValue("catchQCritical").toBool()); _fatal->setChecked(xtsettingsValue("catchQFatal").toBool()); connect(_clear, SIGNAL(clicked()), _errorLog, SLOT(clear())); connect(_clear, SIGNAL(clicked()), listener, SLOT(clear())); connect(_clear, SIGNAL(clicked()), omfgThis, SLOT(sClearErrorMessages())); connect(listener, SIGNAL(updated(const QString &)), this, SLOT(updateErrors(const QString &))); connect(_debug, SIGNAL(toggled(bool)), this, SLOT(toggleDebug(bool))); connect(_warning, SIGNAL(toggled(bool)), this, SLOT(toggleWarning(bool))); connect(_critical,SIGNAL(toggled(bool)), this, SLOT(toggleCritical(bool))); connect(_fatal, SIGNAL(toggled(bool)), this, SLOT(toggleFatal(bool))); } errorLog::~errorLog() { // no need to delete child widgets, Qt does it all for us } void errorLog::languageChange() { retranslateUi(this); } void errorLog::updateErrors(const QString & msg) { _errorLog->append(msg); } void errorLog::toggleDebug(bool y) { xtsettingsSetValue("catchQDebug", y); } void errorLog::toggleWarning(bool y) { xtsettingsSetValue("catchQWarning", y); } void errorLog::toggleCritical(bool y) { xtsettingsSetValue("catchQCritical", y); } void errorLog::toggleFatal(bool y) { xtsettingsSetValue("catchQFatal", y); } errorLogListener::errorLogListener(QObject * parent) : QObject(parent) { XSqlQuery::addErrorListener(this); } errorLogListener::~errorLogListener() { XSqlQuery::removeErrorListener(this); } void errorLogListener::error(const QString & sql, const QSqlError & error) { QString msg; msg = QDateTime::currentDateTime().toString(); msg += " " + error.text(); msg += "\n" + sql; _errorList.append(msg); if(_errorList.size() > 20) _errorList.removeFirst(); emit updated(msg); if(omfgThis) omfgThis->sNewErrorMessage(); } void errorLogListener::clear() { bool blocked = blockSignals(true); _errorList.clear(); (void)blockSignals(blocked); } void xTupleMessageOutput(QtMsgType type, const char *pMsg) { QString msg; msg = QDateTime::currentDateTime().toString(); bool notify = false; bool iserror= (type == QtCriticalMsg) || (type == QtFatalMsg); switch (type) { case QtDebugMsg: notify = xtsettingsValue("catchQDebug").toBool(); msg += " Debug: "; break; case QtWarningMsg: notify = xtsettingsValue("catchQWarning").toBool(); msg += " Warning: "; break; case QtCriticalMsg: notify = xtsettingsValue("catchQCritical").toBool(); msg += " Critical: "; break; case QtFatalMsg: notify = xtsettingsValue("catchQFatal").toBool(); msg += " Fatal: "; //abort(); break; } msg += pMsg; _errorList.append(msg); if(_errorList.size() > 20) _errorList.removeFirst(); if(listener && notify) listener->updated(msg); if(omfgThis && notify && iserror) omfgThis->sNewErrorMessage(); printf("%s\n", qPrintable(msg)); } qt-client-4.1.0/guiclient/errorLog.h000066400000000000000000000026501217451700100173440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ERRORLOG_H #define ERRORLOG_H #include "xwidget.h" #include #include "ui_errorLog.h" class errorLog : public XWidget, public Ui::errorLog { Q_OBJECT public: errorLog(QWidget* parent = 0, const char * = 0, Qt::WFlags flags = 0); ~errorLog(); public slots: virtual void updateErrors(const QString &); protected slots: virtual void languageChange(); virtual void toggleDebug(bool); virtual void toggleWarning(bool); virtual void toggleCritical(bool); virtual void toggleFatal(bool); }; class errorLogListener : public QObject, public XSqlQueryErrorListener { Q_OBJECT friend void xTupleMessageOutput(QtMsgType, const char*); public: errorLogListener(QObject * parent = 0); virtual ~errorLogListener(); virtual void error(const QString &, const QSqlError&); static void initialize(); static void destroy(); public slots: void clear(); signals: void updated(const QString &); }; #endif // ERRORLOG_H qt-client-4.1.0/guiclient/errorLog.ui000066400000000000000000000055231217451700100175340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. errorLog 0 0 642 426 Database Log false true Debug Warning Critical Fatal Qt::Horizontal 40 20 Clear Close _close clicked() errorLog close() 591 397 320 212 qt-client-4.1.0/guiclient/eventManager.cpp000066400000000000000000000401471217451700100205230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "eventManager.h" #include #include #include #include #include #include #include #include "changeWoQty.h" #include "createCountTagsByItem.h" #include "dspInventoryAvailability.h" #include "dspInventoryAvailabilityByWorkOrder.h" #include "dspInventoryHistory.h" #include "mqlutil.h" #include "printPackingList.h" #include "printWoTraveler.h" #include "rescheduleWo.h" #include "salesOrder.h" #include "salesOrderItem.h" #include "storedProcErrorLookup.h" #include "purchaseOrderItem.h" #include "todoItem.h" #include "incident.h" #include "task.h" eventManager::eventManager(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_ack, SIGNAL(clicked()), this, SLOT(sAcknowledge())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool))); connect(_event, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_event, SIGNAL(valid(bool)), this, SLOT(sHandleEventValid(bool))); connect(_selectedUser, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_showAcknowledged, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_usr, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); if (!_privileges->check("ViewOtherEvents")) _selectedUser->setEnabled(FALSE); _event->addColumn("orderId", 0, Qt::AlignCenter, true, "evntlog_ord_id"); _event->addColumn("newDate", 0, Qt::AlignCenter, true, "evntlog_newdate" ); _event->addColumn("newQty", 0, Qt::AlignCenter, true, "evntlog_newvalue" ); _event->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _event->addColumn(tr("Time"), _timeDateColumn, Qt::AlignLeft , true, "evntlog_evnttime" ); _event->addColumn(tr("Acknowleged"), _timeDateColumn, Qt::AlignLeft , true, "evntlog_dispatched" ); _event->addColumn(tr("Event Type"), _itemColumn, Qt::AlignLeft , true, "evnttype_name" ); _event->addColumn(tr("Order #"), -1, Qt::AlignLeft , true, "evntlog_number" ); sFillList(); } eventManager::~eventManager() { // no need to delete child widgets, Qt does it all for us } void eventManager::languageChange() { retranslateUi(this); } void eventManager::sHandleEventValid(bool pvalid) { _ack->setEnabled(pvalid && ((_currentUser->isChecked() && _privileges->check("DispatchOwnEvents")) || (_selectedUser->isChecked() && _privileges->check("DispatchOtherEvents"))) ); _delete->setEnabled(pvalid && ((_currentUser->isChecked() && _privileges->check("DeleteOwnEvents")) || (_selectedUser->isChecked() && _privileges->check("DeleteOtherEvents"))) ); } void eventManager::sPopulateMenu(QMenu *menu) { QAction *menuItem; if (_event->currentItem()->rawValue("evntlog_dispatched").toString().length() == 0) { menuItem = menu->addAction(tr("Acknowledge"), this, SLOT(sAcknowledge())); if ( ((_currentUser->isChecked()) && (!_privileges->check("DispatchOwnEvents"))) || ((_selectedUser->isChecked()) && (!_privileges->check("DispatchOtherEvents"))) ) menuItem->setEnabled(FALSE); } menuItem = menu->addAction(tr("Delete"), this, SLOT(sDelete())); if ( ((_currentUser->isChecked()) && (!_privileges->check("DeleteOwnEvents"))) || ((_selectedUser->isChecked()) && (!_privileges->check("DeleteOtherEvents"))) ) menuItem->setEnabled(FALSE); // if multiple items are selected then keep the menu short QList list = _event->selectedItems(); if (list.size() > 1) return; if ( (_event->currentItem()->rawValue("evnttype_name").toString() == "WoCreated") || (_event->currentItem()->rawValue("evnttype_name").toString() == "WoDueDateChanged") || (_event->currentItem()->rawValue("evnttype_name").toString() == "WoQtyChanged") ) { menu->addSeparator(); menuItem = menu->addAction(tr("Inventory Availability by Work Order..."), this, SLOT(sInventoryAvailabilityByWorkOrder())); } else if ( (_event->currentItem()->rawValue("evnttype_name").toString() == "POitemCreate") ) { menu->addSeparator(); menuItem = menu->addAction(tr("View Purchase Order Item..."), this, SLOT(sViewPurchaseOrderItem())); } else if ( (_event->currentItem()->rawValue("evnttype_name").toString() == "SoitemCreated") || (_event->currentItem()->rawValue("evnttype_name").toString() == "SoitemQtyChanged") || (_event->currentItem()->rawValue("evnttype_name").toString() == "SoitemSchedDateChanged") ) { menu->addSeparator(); menuItem = menu->addAction(tr("View Sales Order..."), this, SLOT(sViewSalesOrder())); menuItem = menu->addAction(tr("View Sales Order Item..."), this, SLOT(sViewSalesOrderItem())); menuItem = menu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "SoCommentsChanged") { menu->addSeparator(); menuItem = menu->addAction(tr("View Sales Order..."), this, SLOT(sViewSalesOrder())); menuItem = menu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "QOHBelowZero") { menu->addSeparator(); menuItem = menu->addAction(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag())); menuItem = menu->addAction(tr("View Inventory History..."), this, SLOT(sViewInventoryHistory())); menuItem = menu->addAction(tr("View Inventory Availability..."), this, SLOT(sViewInventoryAvailability())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "RWoQtyRequestChange") { menu->addSeparator(); menuItem = menu->addAction(tr("Recall Work Order"), this, SLOT(sRecallWo())); menuItem = menu->addAction(tr("Change W/O Quantity..."), this, SLOT(sChangeWoQty())); menuItem = menu->addAction(tr("Print W/O Traveler..."), this, SLOT(sPrintWoTraveler())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "RWoDueDateRequestChange") { menu->addSeparator(); menuItem = menu->addAction(tr("Recall Work Order"), this, SLOT(sRecallWo())); menuItem = menu->addAction(tr("Change W/O Due Date..."), this, SLOT(sChangeWoDueDate())); menuItem = menu->addAction(tr("Print W/O Traveler..."), this, SLOT(sPrintWoTraveler())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "RWoRequestCancel") { menu->addSeparator(); menuItem = menu->addAction(tr("Recall Work Order"), this, SLOT(sRecallWo())); menuItem = menu->addAction(tr("Delete Work Order..."), this, SLOT(sDeleteWorkOrder())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "TodoAlarm") { menu->addSeparator(); menuItem = menu->addAction(tr("View Todo Item..."), this, SLOT(sViewTodoItem())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "IncidentAlarm") { menu->addSeparator(); menuItem = menu->addAction(tr("View Incident..."), this, SLOT(sViewIncident())); } else if (_event->currentItem()->rawValue("evnttype_name").toString() == "TaskAlarm") { menu->addSeparator(); menuItem = menu->addAction(tr("View Project Task..."), this, SLOT(sViewTask())); } } void eventManager::sInventoryAvailabilityByWorkOrder() { ParameterList params; params.append("wo_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); dspInventoryAvailabilityByWorkOrder *newdlg = new dspInventoryAvailabilityByWorkOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void eventManager::sViewSalesOrder() { XSqlQuery eventViewSalesOrder; eventViewSalesOrder.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:coitem_id);" ); eventViewSalesOrder.bindValue(":coitem_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); eventViewSalesOrder.exec(); if (eventViewSalesOrder.first()) salesOrder::viewSalesOrder(eventViewSalesOrder.value("coitem_cohead_id").toInt()); else if (eventViewSalesOrder.lastError().type() != QSqlError::NoError) { systemError(this, eventViewSalesOrder.lastError().databaseText(), __FILE__, __LINE__); return; } } void eventManager::sViewSalesOrderItem() { ParameterList params; params.append("mode", "view"); params.append("soitem_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } void eventManager::sViewPurchaseOrderItem() { ParameterList params; params.append("mode", "view"); params.append("poitem_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); purchaseOrderItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void eventManager::sPrintPackingList() { XSqlQuery eventPrintPackingList; eventPrintPackingList.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:coitem_id);" ); eventPrintPackingList.bindValue(":coitem_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); eventPrintPackingList.exec(); if (eventPrintPackingList.first()) { ParameterList params; params.append("sohead_id", eventPrintPackingList.value("coitem_cohead_id").toInt()); printPackingList newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else if (eventPrintPackingList.lastError().type() != QSqlError::NoError) { systemError(this, eventPrintPackingList.lastError().databaseText(), __FILE__, __LINE__); return; } } void eventManager::sIssueCountTag() { ParameterList params; params.append("itemsite_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); createCountTagsByItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void eventManager::sViewInventoryHistory() { ParameterList params; params.append("itemsite_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void eventManager::sViewInventoryAvailability() { ParameterList params; params.append("itemsite_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); params.append("run"); dspInventoryAvailability *newdlg = new dspInventoryAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void eventManager::sRecallWo() { XSqlQuery eventRecallWo; eventRecallWo.prepare("SELECT recallWo(:wo_id, FALSE) AS result;"); eventRecallWo.bindValue(":wo_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); eventRecallWo.exec(); if (eventRecallWo.first()) { int result = eventRecallWo.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("recallWo", result), __FILE__, __LINE__); return; } } else if (eventRecallWo.lastError().type() != QSqlError::NoError) { systemError(this, eventRecallWo.lastError().databaseText(), __FILE__, __LINE__); return; } } void eventManager::sChangeWoQty() { ParameterList params; params.append("wo_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); params.append("newQty", _event->currentItem()->rawValue("evntlog_newvalue").toDouble()); changeWoQty newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void eventManager::sChangeWoDueDate() { // ToDo #if 0 (new rescheduleWo( _event->currentItem()->rawValue("evntlog_ord_id").toInt(), _event->currentItem()->rawValue("evntlog_newdate"), omfgThis ))->show(); #endif } void eventManager::sPrintWoTraveler() { ParameterList params; params.append("wo_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); printWoTraveler newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void eventManager::sDeleteWorkOrder() { XSqlQuery eventDeleteWorkOrder; if ( QMessageBox::warning( this, tr("Delete Work Order?"), tr("Are you sure that you want to delete the selected Work Order?"), tr("&Yes"), tr("&No"), QString::null, 0, 1) == 0) { eventDeleteWorkOrder.prepare("SELECT deleteWo(:wo_id, TRUE) AS returnVal;"); eventDeleteWorkOrder.bindValue(":wo_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); eventDeleteWorkOrder.exec(); if (eventDeleteWorkOrder.first()) { int result = eventDeleteWorkOrder.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteWo", result), __FILE__, __LINE__); return; } } else if (eventDeleteWorkOrder.lastError().type() != QSqlError::NoError) { systemError(this, eventDeleteWorkOrder.lastError().databaseText(), __FILE__, __LINE__); return; } } } void eventManager::sViewTodoItem() { ParameterList params; params.append("mode", "view"); params.append("todoitem_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); todoItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void eventManager::sViewIncident() { ParameterList params; params.append("mode", "view"); params.append("incdt_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); incident newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void eventManager::sViewTask() { ParameterList params; params.append("mode", "view"); params.append("prjtask_id", _event->currentItem()->rawValue("evntlog_ord_id").toInt()); task newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void eventManager::sAcknowledge() { XSqlQuery eventAcknowledge; eventAcknowledge.prepare( "UPDATE evntlog " "SET evntlog_dispatched=CURRENT_TIMESTAMP " "WHERE (evntlog_id=:evntlog_id)" ); QList list = _event->selectedItems(); for (int i = 0; i < list.size(); i++) { eventAcknowledge.bindValue(":evntlog_id", ((XTreeWidgetItem*)(list[i]))->id()); eventAcknowledge.exec(); if (eventAcknowledge.lastError().type() != QSqlError::NoError) { systemError(this, eventAcknowledge.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } void eventManager::sDelete() { XSqlQuery eventDelete; eventDelete.prepare( "DELETE FROM evntlog " "WHERE (evntlog_id=:evntlog_id);" ); QList list = _event->selectedItems(); for (int i = 0; i < list.size(); i++) { eventDelete.bindValue(":evntlog_id", ((XTreeWidgetItem*)(list[i]))->id()); eventDelete.exec(); if (eventDelete.lastError().type() != QSqlError::NoError) { systemError(this, eventDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } void eventManager::sFillList() { XSqlQuery eventFillList; MetaSQLQuery mql = mqlLoad("events", "detail"); ParameterList params; params.append("username", _currentUser->isChecked() ? omfgThis->username() : _usr->currentText()); _warehouse->appendValue(params); if (_showAcknowledged->isChecked()) params.append("showAcknowledged"); eventFillList = mql.toQuery(params); _event->populate(eventFillList); if (eventFillList.lastError().type() != QSqlError::NoError) { systemError(this, eventFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void eventManager::sHandleAutoUpdate(bool pAutoUpdate) { if (pAutoUpdate) connect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); else disconnect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); } qt-client-4.1.0/guiclient/eventManager.h000066400000000000000000000032751217451700100201710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EVENTMANAGER_H #define EVENTMANAGER_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_eventManager.h" class eventManager : public XWidget, public Ui::eventManager { Q_OBJECT public: eventManager(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~eventManager(); public slots: virtual void sPopulateMenu(QMenu * menu); virtual void sInventoryAvailabilityByWorkOrder(); virtual void sViewSalesOrder(); virtual void sViewSalesOrderItem(); virtual void sPrintPackingList(); virtual void sIssueCountTag(); virtual void sViewInventoryHistory(); virtual void sViewInventoryAvailability(); virtual void sRecallWo(); virtual void sChangeWoQty(); virtual void sChangeWoDueDate(); virtual void sPrintWoTraveler(); virtual void sDeleteWorkOrder(); virtual void sAcknowledge(); virtual void sDelete(); virtual void sFillList(); virtual void sHandleAutoUpdate( bool pAutoUpdate ); virtual void sHandleEventValid(bool); virtual void sViewPurchaseOrderItem(); virtual void sViewTodoItem(); virtual void sViewIncident(); virtual void sViewTask(); protected slots: virtual void languageChange(); }; #endif // EVENTMANAGER_H qt-client-4.1.0/guiclient/eventManager.ui000066400000000000000000000256211217451700100203560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. eventManager 0 0 800 600 Events 12 12 0 0 0 0 Current &User true &Selected User: false XComboBox::Users false Show &Acknowledged Events Qt::Horizontal QSizePolicy::Expanding 0 20 0 &Close Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 Events: 5 0 0 0 100 QAbstractItemView::ExtendedSelection 0 false Acknowledge false Delete Qt::Vertical 20 40 0 Automatically Update Qt::Horizontal QSizePolicy::Expanding 20 20 WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _currentUser _selectedUser _usr _warehouse _showAcknowledged _event _close _selectedUser toggled(bool) _usr setEnabled(bool) 20 20 20 20 _close clicked() eventManager close() 782 27 422 177 _event valid(bool) _ack setEnabled(bool) 358 220 773 141 _event valid(bool) _delete setEnabled(bool) 358 220 773 173
    qt-client-4.1.0/guiclient/expenseCategories.cpp000066400000000000000000000146421217451700100215650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "expenseCategories.h" #include #include //#include #include #include "expenseCategory.h" /* * Constructs a expenseCategories as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ expenseCategories::expenseCategories(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_expcat, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); // statusBar()->hide(); _expcat->addColumn(tr("Category"), _itemColumn, Qt::AlignLeft, true, "expcat_code" ); _expcat->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "expcat_descrip" ); if (_privileges->check("MaintainExpenseCategories")) { connect(_expcat, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_expcat, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_expcat, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_expcat, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_expcat, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } expenseCategories::~expenseCategories() { // no need to delete child widgets, Qt does it all for us } void expenseCategories::languageChange() { retranslateUi(this); } void expenseCategories::sDelete() { XSqlQuery expenseDelete; expenseDelete.prepare( "SELECT poitem_status, COUNT(*) " "FROM poitem " "WHERE (poitem_expcat_id=:expcat_id) " "GROUP BY poitem_status;" ); expenseDelete.bindValue(":expcat_id", _expcat->id()); expenseDelete.exec(); if (expenseDelete.first()) { if (expenseDelete.findFirst("poitem_status", "U") != -1) QMessageBox::warning( this, tr("Cannot Delete Expense Category"), tr( "

    The selected Expense Category cannot be deleted as there are unposted P/O Lines assigned to it. " "You must reassign these P/O Lines before you may delete the selected Expense Category.

    " ) ); else if (expenseDelete.findFirst("poitem_status", "O") != -1) QMessageBox::warning( this, tr("Cannot Delete Expense Category"), tr( "

    The selected Expense Category cannot be deleted as there are open P/O Lines assigned to it. " "You must close these P/O Lines before you may delete the selected Expense Category.

    " ) ); else if (expenseDelete.findFirst("poitem_status", "C") != -1) { int result = QMessageBox::warning( this, tr("Cannot Delete Expense Category"), tr( "

    The selected Expense Category cannot be deleted as there are closed P/O Lines assigned to it. " "Would you like to mark the selected Expense Category as inactive instead?

    " ), tr("&Yes"), tr("&No"), QString::null ); if (result == 0) { expenseDelete.prepare( "UPDATE expcat " "SET expcat_active=FALSE " "WHERE (expcat_id=:expcat_id);" ); expenseDelete.bindValue(":expcat_id", _expcat->id()); expenseDelete.exec(); sFillList(); } } } else { expenseDelete.prepare( "SELECT checkhead_id AS id" " FROM checkhead" " WHERE(checkhead_expcat_id=:expcat_id)" " UNION " "SELECT vodist_id AS id" " FROM vodist" " WHERE(vodist_expcat_id=:expcat_id)"); expenseDelete.bindValue(":expcat_id", _expcat->id()); expenseDelete.exec(); if(expenseDelete.first()) { QMessageBox::warning( this, tr("Cannot Delete Expense Category"), tr( "

    The selected Expense Category cannot be deleted as there are Checks and Voucher Distributions assigned to it. " "You must change these before you may delete the selected Expense Category.

    " ) ); } else { expenseDelete.prepare( "DELETE FROM expcat " "WHERE (expcat_id=:expcat_id); "); expenseDelete.bindValue(":expcat_id", _expcat->id()); expenseDelete.exec(); sFillList(); } } } void expenseCategories::sNew() { ParameterList params; params.append("mode", "new"); expenseCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void expenseCategories::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("expcat_id", _expcat->id()); expenseCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void expenseCategories::sCopy() { ParameterList params; params.append("mode", "copy"); params.append("expcat_id", _expcat->id()); expenseCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void expenseCategories::sView() { ParameterList params; params.append("mode", "view"); params.append("expcat_id", _expcat->id()); expenseCategory newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void expenseCategories::sPrint() { orReport report("ExpenseCategoriesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void expenseCategories::sFillList() { _expcat->populate( "SELECT expcat_id, expcat_code, expcat_descrip " "FROM expcat " "ORDER BY expcat_code;" ); } qt-client-4.1.0/guiclient/expenseCategories.h000066400000000000000000000021261217451700100212240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXPENSECATEGORIES_H #define EXPENSECATEGORIES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_expenseCategories.h" class expenseCategories : public XWidget, public Ui::expenseCategories { Q_OBJECT public: expenseCategories(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~expenseCategories(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sCopy(); virtual void sView(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // EXPENSECATEGORIES_H qt-client-4.1.0/guiclient/expenseCategories.ui000066400000000000000000000117621217451700100214200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. expenseCategories 0 0 400 400 List Expense Categories 0 Expense Categories: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 true &New false &Edit false &View false Co&py false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _expcat _new _edit _view _copy _delete _print _close parameter.h _close clicked() expenseCategories close() 20 20 20 20 _expcat valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/expenseCategory.cpp000066400000000000000000000166171217451700100212610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "errorReporter.h" #include "guiErrorCheck.h" #include "expenseCategory.h" #include #include expenseCategory::expenseCategory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _expcatid = -1; // signals and slots connections connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_category, SIGNAL(editingFinished()), this, SLOT(sCheck())); _expense->setType(GLCluster::cExpense | GLCluster::cAsset | GLCluster::cLiability); _purchasePrice->setType(GLCluster::cAsset | GLCluster::cExpense); _liability->setType(GLCluster::cLiability); _freight->setType(GLCluster::cExpense); } expenseCategory::~expenseCategory() { // no need to delete child widgets, Qt does it all for us } void expenseCategory::languageChange() { retranslateUi(this); } enum SetResponse expenseCategory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("expcat_id", &valid); if (valid) { _expcatid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "copy") { _mode = cCopy; _category->clear(); } else if (param.toString() == "view") { _mode = cView; _category->setEnabled(FALSE); _active->setEnabled(FALSE); _description->setEnabled(FALSE); _expense->setReadOnly(TRUE); _purchasePrice->setReadOnly(TRUE); _liability->setReadOnly(TRUE); _freight->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void expenseCategory::sCheck() { XSqlQuery expenseCheck; _category->setText(_category->text().trimmed().toUpper()); if ( ((_mode == cNew) || (_mode == cCopy)) && (_category->text().length() != 0) ) { expenseCheck.prepare( "SELECT expcat_id " "FROM expcat " "WHERE (UPPER(expcat_code)=:expcat_code);" ); expenseCheck.bindValue(":expcat_code", _category->text().trimmed()); expenseCheck.exec(); if (expenseCheck.first()) { _expcatid = expenseCheck.value("expcat_id").toInt(); _mode = cEdit; populate(); _category->setEnabled(FALSE); } } } void expenseCategory::sSave() { XSqlQuery expenseSave; QList errors; errors << GuiErrorCheck(_category->text().trimmed().isEmpty(), _category, tr("

    You must specify a name.")); if (_mode == cEdit) { expenseSave.prepare( "SELECT expcat_id " " FROM expcat " " WHERE((UPPER(expcat_code)=UPPER(:expcat_code))" " AND (expcat_id != :expcat_id));" ); expenseSave.bindValue(":expcat_id", _expcatid); expenseSave.bindValue(":expcat_code", _category->text().trimmed()); expenseSave.exec(); if (expenseSave.first()) { errors << GuiErrorCheck(true, _category, tr("

    The name you have specified is already in use.")); } } if (_metrics->boolean("InterfaceAPToGL")) { errors << GuiErrorCheck(!_expense->isValid(), _expense, tr("

    You must select a Expense Account Number for this Expense Category before you may save it.")) << GuiErrorCheck(!_purchasePrice->isValid(), _purchasePrice, tr("

    You must select a Purchase Price Variance Account Number for this Expense Category before you may save it.")) << GuiErrorCheck(!_liability->isValid(), _liability, tr("

    You must select a P/O Liability Clearing Account Number for this Expense Category before you may save it.")) << GuiErrorCheck(!_freight->isValid(), _freight, tr("

    You must select a Freight Receiving Account Number for this Expense Category before you may save it.")) ; } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Expense Category"), errors)) return; if ( (_mode == cNew) || (_mode == cCopy) ) { expenseSave.exec("SELECT NEXTVAL('expcat_expcat_id_seq') AS expcat_id"); if (expenseSave.first()) _expcatid = expenseSave.value("expcat_id").toInt(); expenseSave.prepare( "INSERT INTO expcat" "( expcat_id, expcat_code, expcat_active, expcat_descrip," " expcat_exp_accnt_id, expcat_purchprice_accnt_id," " expcat_liability_accnt_id, expcat_freight_accnt_id ) " "VALUES " "( :expcat_id, :expcat_code, :expcat_active, :expcat_descrip," " :expcat_exp_accnt_id, :expcat_purchprice_accnt_id," " :expcat_liability_accnt_id, :expcat_freight_accnt_id );" ); } else if (_mode == cEdit) expenseSave.prepare( "UPDATE expcat " "SET expcat_code=:expcat_code, expcat_active=:expcat_active," " expcat_descrip=:expcat_descrip," " expcat_exp_accnt_id=:expcat_exp_accnt_id," " expcat_purchprice_accnt_id=:expcat_purchprice_accnt_id," " expcat_liability_accnt_id=:expcat_liability_accnt_id," " expcat_freight_accnt_id=:expcat_freight_accnt_id " "WHERE (expcat_id=:expcat_id);" ); expenseSave.bindValue(":expcat_id", _expcatid); expenseSave.bindValue(":expcat_code", _category->text().trimmed()); expenseSave.bindValue(":expcat_active", QVariant(_active->isChecked())); expenseSave.bindValue(":expcat_descrip", _description->text().trimmed()); expenseSave.bindValue(":expcat_exp_accnt_id", _expense->id()); expenseSave.bindValue(":expcat_purchprice_accnt_id", _purchasePrice->id()); expenseSave.bindValue(":expcat_liability_accnt_id", _liability->id()); expenseSave.bindValue(":expcat_freight_accnt_id", _freight->id()); expenseSave.exec(); done(_expcatid); } void expenseCategory::populate() { XSqlQuery expensepopulate; expensepopulate.prepare( "SELECT * " "FROM expcat " "WHERE (expcat_id=:expcat_id);" ); expensepopulate.bindValue(":expcat_id", _expcatid); expensepopulate.exec(); if (expensepopulate.first()) { if (_mode != cCopy) { _category->setText(expensepopulate.value("expcat_code").toString()); _description->setText(expensepopulate.value("expcat_descrip").toString()); _active->setChecked(expensepopulate.value("expcat_active").toBool()); } else _active->setChecked(TRUE); _expense->setId(expensepopulate.value("expcat_exp_accnt_id").toInt()); _purchasePrice->setId(expensepopulate.value("expcat_purchprice_accnt_id").toInt()); _liability->setId(expensepopulate.value("expcat_liability_accnt_id").toInt()); _freight->setId(expensepopulate.value("expcat_freight_accnt_id").toInt()); } } qt-client-4.1.0/guiclient/expenseCategory.h000066400000000000000000000021261217451700100207140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXPENSECATEGORY_H #define EXPENSECATEGORY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_expenseCategory.h" class expenseCategory : public XDialog, public Ui::expenseCategory { Q_OBJECT public: expenseCategory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~expenseCategory(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _expcatid; }; #endif // EXPENSECATEGORY_H qt-client-4.1.0/guiclient/expenseCategory.ui000066400000000000000000000200441217451700100211010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. expenseCategory 0 0 564 306 Expense Category 0 0 Ca&tegory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _category &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 &Active true Qt::Vertical QSizePolicy::Expanding 65 20 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save PO Line Freight Expense: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _liability E&xpense: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _expense Purchase Price Variance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _expense P/O &Liability Clearing: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _liability Qt::Vertical QSizePolicy::Expanding 16 16 GLCluster QWidget

    glcluster.h
    XLineEdit QLineEdit
    xlineedit.h
    _category _active _description _expense _purchasePrice _liability _freight qt-client-4.1.0/guiclient/expenseTrans.cpp000066400000000000000000000171211217451700100205620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "expenseTrans.h" #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "distributeInventory.h" #include "inputManager.h" #include "storedProcErrorLookup.h" expenseTrans::expenseTrans(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_qty,SIGNAL(textChanged(const QString&)), this, SLOT(sPopulateQty())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateQOH(int))); _captive = FALSE; _prjid = -1; _item->setType(ItemLineEdit::cGeneralInventory | ItemLineEdit::cActive); _warehouse->setType(WComboBox::AllActiveInventory); _qty->setValidator(omfgThis->transQtyVal()); _afterQty->setPrecision(omfgThis->qtyVal()); _beforeQty->setPrecision(omfgThis->qtyVal()); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } expenseTrans::~expenseTrans() { // no need to delete child widgets, Qt does it all for us } void expenseTrans::languageChange() { retranslateUi(this); } enum SetResponse expenseTrans::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; int invhistid = -1; param = pParams.value("invhist_id", &valid); if (valid) invhistid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _usernameLit->clear(); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); } else if (param.toString() == "view") { _mode = cView; _transDate->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _qty->setEnabled(FALSE); _documentNum->setEnabled(FALSE); _notes->setEnabled(FALSE); _post->hide(); _expcat->setEnabled(FALSE); _close->setText(tr("&Close")); XSqlQuery histq; histq.prepare("SELECT invhist.*, invhistexpcat_expcat_id" " FROM invhist" " LEFT OUTER JOIN invhistexpcat ON (invhist_id=invhistexpcat_invhist_id)" " WHERE (invhist_id=:invhist_id);" ); histq.bindValue(":invhist_id", invhistid); histq.exec(); if (histq.first()) { _transDate->setDate(histq.value("invhist_transdate").toDate()); _username->setText(histq.value("invhist_user").toString()); _qty->setDouble(histq.value("invhist_invqty").toDouble()); _beforeQty->setDouble(histq.value("invhist_qoh_before").toDouble()); _afterQty->setDouble(histq.value("invhist_qoh_after").toDouble()); _documentNum->setText(histq.value("invhist_ordnumber")); _notes->setText(histq.value("invhist_comments").toString()); _item->setItemsiteid(histq.value("invhist_itemsite_id").toInt()); _expcat->setId(histq.value("invhistexpcat_expcat_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting History"), histq, __FILE__, __LINE__)) return UndefinedError; } } return NoError; } void expenseTrans::sPost() { QList errors; errors << GuiErrorCheck(! _item->isValid(), _item, tr("You must select an Item before posting this " "transaction.")) << GuiErrorCheck(_qty->text().isEmpty(), _qty, tr("

    You must enter a Quantity before posting this " "transaction.")) << GuiErrorCheck(!_expcat->isValid(), _expcat, tr("You must select an Expense Category before " "posting this transaction.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Post Transaction"), errors)) return; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); // because of possible distribution cancelations XSqlQuery expq; expq.prepare("SELECT invExpense(itemsite_id, :qty, :expcatid, :docNumber," " :comments, :date, :prj_id) AS result" " FROM itemsite" " WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id));" ); expq.bindValue(":qty", _qty->toDouble()); expq.bindValue(":expcatid", _expcat->id()); expq.bindValue(":docNumber", _documentNum->text()); expq.bindValue(":comments", _notes->toPlainText()); expq.bindValue(":item_id", _item->id()); expq.bindValue(":warehous_id", _warehouse->id()); expq.bindValue(":date", _transDate->date()); if (_prjid != -1) expq.bindValue(":prj_id", _prjid); expq.exec(); if (expq.first()) { if (distributeInventory::SeriesAdjust(expq.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information(this, tr("Expense Transaction"), tr("Transaction Canceled") ); return; } XSqlQuery commit("COMMIT;"); if (_captive) close(); else { _close->setText(tr("&Close")); _item->setId(-1); _qty->clear(); _documentNum->clear(); _notes->clear(); _beforeQty->clear(); _afterQty->clear(); _transDate->setDate(omfgThis->dbDate()); _item->setFocus(); } } else if (expq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Could Not Post"), expq, __FILE__, __LINE__); return; } else { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Item not found"), tr("

    No transaction was done because Item %1 " "was not found at Site %2.") .arg(_item->itemNumber(), _warehouse->currentText())); } } void expenseTrans::sPopulateQOH(int pWarehousid) { if (_mode != cView) { XSqlQuery qohq; qohq.prepare( "SELECT itemsite_qtyonhand " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); qohq.bindValue(":item_id", _item->id()); qohq.bindValue(":warehous_id", pWarehousid); qohq.exec(); if (qohq.first()) { _cachedQOH = qohq.value("itemsite_qtyonhand").toDouble(); _beforeQty->setDouble(qohq.value("itemsite_qtyonhand").toDouble()); if (_item->isFractional()) _qty->setValidator(omfgThis->transQtyVal()); else _qty->setValidator(new QIntValidator(this)); sPopulateQty(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting QOH"), qohq, __FILE__, __LINE__)) return; } } void expenseTrans::sPopulateQty() { _afterQty->setDouble(_cachedQOH - _qty->toDouble()); } qt-client-4.1.0/guiclient/expenseTrans.h000066400000000000000000000023361217451700100202310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXPENSETRANS_H #define EXPENSETRANS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_expenseTrans.h" class expenseTrans : public XWidget, public Ui::expenseTrans { Q_OBJECT public: expenseTrans(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~expenseTrans(); Q_INVOKABLE int projectId() { return _prjid; } public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void setProjectId(int p) { _prjid = p; } virtual void sPost(); virtual void sPopulateQOH( int pWarehousid ); virtual void sPopulateQty(); protected slots: virtual void languageChange(); private: int _mode; bool _captive; double _cachedQOH; int _prjid; }; #endif // EXPENSETRANS_H qt-client-4.1.0/guiclient/expenseTrans.ui000066400000000000000000000274401217451700100204220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. expenseTrans 0 0 524 548 Expense Transaction Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 5 false &Post &Cancel Qt::Vertical QSizePolicy::Expanding 20 20 Qt::StrongFocus 80 32767 Before Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter After Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Quantity: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 20 Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Qt::Horizontal Expense Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Notes: true true DLineEdit QWidget

    datecluster.h
    ExpenseCluster QWidget
    expensecluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    XTextEdit QTextEdit
    xtextedit.h
    _transDate _item _warehouse _qty _documentNum _expcat _notes _post _close _item newId(int) _warehouse findItemsites(int) 28 59 105 144 _item warehouseIdChanged(int) _warehouse setId(int) 28 59 105 144 _item valid(bool) _post setEnabled(bool) 28 59 424 59 _close clicked() expenseTrans close() 424 27 20 20 qt-client-4.1.0/guiclient/explodeWo.cpp000066400000000000000000000050131217451700100200460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "explodeWo.h" #include #include #include #include "inputManager.h" #include "storedProcErrorLookup.h" explodeWo::explodeWo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); QButtonGroup* _levelGroupInt = new QButtonGroup(this); _levelGroupInt->addButton(_singleLevel); _levelGroupInt->addButton(_multipleLevel); connect(_explode, SIGNAL(clicked()), this, SLOT(sExplode())); _captive = FALSE; omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _multipleLevel->setChecked(_metrics->value("WOExplosionLevel") == "M"); _wo->setType(cWoOpen); } explodeWo::~explodeWo() { // no need to delete child widgets, Qt does it all for us } void explodeWo::languageChange() { retranslateUi(this); } enum SetResponse explodeWo::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setEnabled(false); } return NoError; } void explodeWo::sExplode() { XSqlQuery explodeExplode; if (_wo->isValid()) { explodeExplode.prepare("SELECT explodeWo(:wo_id, :explodeChildren) AS result;"); explodeExplode.bindValue(":wo_id", _wo->id()); explodeExplode.bindValue(":explodeChildren", QVariant(_multipleLevel->isChecked())); explodeExplode.exec(); if (explodeExplode.first()) { int result = explodeExplode.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("explodeWo", result).arg(_wo->woNumber()), __FILE__, __LINE__); return; } } else if (explodeExplode.lastError().type() != QSqlError::NoError) { systemError(this, explodeExplode.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); if (_captive) accept(); else { _wo->setId(-1); _close->setText(tr("&Close")); _wo->setFocus(); } } } qt-client-4.1.0/guiclient/explodeWo.h000066400000000000000000000017411217451700100175170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXPLODEWO_H #define EXPLODEWO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_explodeWo.h" class explodeWo : public XDialog, public Ui::explodeWo { Q_OBJECT public: explodeWo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~explodeWo(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sExplode(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // EXPLODEWO_H qt-client-4.1.0/guiclient/explodeWo.ui000066400000000000000000000170501217451700100177050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. explodeWo 0 0 457 245 Explode Work Order 5 0 0 7 0 6 0 0 0 0 0 0 290 130 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Level 5 0 1 0 0 0 &Single Level Explosion true 1 0 0 0 &Multiple Level Explosion Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel false E&xplode true Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 WoCluster QWidget
    wocluster.h
    0
    _wo _singleLevel _explode _close _close clicked() explodeWo reject() 20 20 20 20 _wo valid(bool) _explode setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/exportData.cpp000066400000000000000000000172531217451700100202240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "exportData.h" #include #include #include #include #include #include #include #include "exporthelper.h" #include "storedProcErrorLookup.h" #define DEBUG true QString exportData::exportFileDir = QString::null; exportData::exportData(QWidget *parent, const char *name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); _paramedit = new ParameterEdit(this); QGridLayout *lyt = qobject_cast(layout()); if (lyt) lyt->addWidget(_paramedit, 4, 0, 1, -1); connect(_otherXML, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_deleteQuerySet,SIGNAL(clicked()), this, SLOT(sDeleteQuerySet())); connect(_editQuerySet,SIGNAL(clicked()), this, SLOT(sEditQuerySet())); connect(_export, SIGNAL(clicked()), this, SLOT(sExport())); connect(_exportList, SIGNAL(newId(int)), this, SLOT(sHandleButtons())); connect(_newQuerySet, SIGNAL(clicked()), this, SLOT(sNewQuerySet())); connect(_qrySetList, SIGNAL(newId(int)), this, SLOT(sHandleButtons())); connect(_xtupleXML, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); _exportList->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "xsltmap_name"); _exportList->addColumn(tr("Document Type"), -1, Qt::AlignLeft, true, "xsltmap_doctype"); _exportList->addColumn(tr("System Identifier"),-1, Qt::AlignLeft, false,"xsltmap_system"); _exportList->addColumn(tr("Export XSLT File"), -1, Qt::AlignLeft, false,"xsltmap_export"); _qrySetList->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "qryhead_name"); _qrySetList->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "qryhead_descrip"); _exportList->populate("SELECT xsltmap_id, xsltmap_name, xsltmap_doctype," " xsltmap_system, xsltmap_export" " FROM xsltmap" " WHERE (LENGTH(xsltmap_export) > 0)" " ORDER BY xsltmap_name;"); sFillList(); sHandleButtons(); _queryset = new QuerySet(0, Qt::Dialog); if (_queryset) { _queryset->setWindowModality(Qt::WindowModal); connect(_queryset, SIGNAL(saved(int)), this, SLOT(sFillList())); } } exportData::~exportData() { // no need to delete child widgets, Qt does it all for us if (_queryset) _queryset->deleteLater(); _queryset = 0; } void exportData::languageChange() { retranslateUi(this); } ParameterEdit *exportData::getParameterEdit() const { return _paramedit; } void exportData::sDeleteQuerySet() { if (QMessageBox::question(this, tr("Delete Query Set?"), tr("

    Are you sure you want to delete this " "Query Set?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("SELECT deleteQryhead(:id) AS result;"); delq.bindValue(":id", _qrySetList->id()); if (delq.exec()) { int result = delq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteQryhead", result), __FILE__, __LINE__); return; } } if (delq.lastError().type() != QSqlError::NoError) { systemError(this, delq.lastError().text(), __FILE__, __LINE__); return; } sFillList(); } } void exportData::sEditQuerySet() { if (_queryset) { _queryset->setId(_qrySetList->id()); _queryset->show(); } } void exportData::sExport() { if (DEBUG) qDebug("exportData::sExport() entered with exportFileDir '%s'", qPrintable(exportFileDir)); if (exportFileDir.isEmpty()) { #if defined Q_WS_MACX exportFileDir = _metrics->value("XMLExportDefaultDirMac"); #elif defined Q_WS_WIN exportFileDir = _metrics->value("XMLExportDefaultDirWindows"); #elif defined Q_WS_X11 exportFileDir = _metrics->value("XMLExportDefaultDirLinux"); #endif } QString filename = QFileDialog::getSaveFileName(0, tr("Export Output File"), exportFileDir + QDir::separator() + _qrySetList->currentItem()->rawValue("qryhead_name").toString() + ".xml", "XML files (*.xml *.txt)"); if (filename.isEmpty()) return; QString tmpfilename = QFileInfo(filename).dir().absolutePath(); exportFileDir = tmpfilename; QString errmsg; ParameterList params = _paramedit->getParameterList(); bool success = ExportHelper::exportXML(_qrySetList->id(), params, filename, errmsg, (_otherXML->isChecked() ? _exportList->id() : -1)); if (success) QMessageBox::information(this, tr("Processing Complete"), tr("The export to %1 is complete").arg(filename)); else QMessageBox::critical(this, tr("Processing Error"), errmsg); } void exportData::sFillList() { _qrySetList->populate("SELECT qryhead_id, qryhead_name, qryhead_descrip" " FROM qryhead" " ORDER BY qryhead_name;"); } void exportData::sHandleButtons() { static int prevqrysetid = -1; _export->setEnabled(_qrySetList->id() > 0 && (_xtupleXML->isChecked() || (_otherXML->isChecked() && _exportList->id() > 0))); // populate _paramedit with parameters from all of the query items in the set if (_qrySetList->id() != prevqrysetid) { _paramedit->clear(); if (_qrySetList->id() < 0) prevqrysetid = -1; else { QString xml = ""; QStringList paramlist; XSqlQuery qiq; qiq.prepare("SELECT qryitem_src, qryitem_group, qryitem_detail" " FROM qryitem" " WHERE ((qryitem_qryhead_id=:id)" " AND (qryitem_src!='REL'))" " ORDER BY qryitem_order;"); qiq.bindValue(":id", _qrySetList->id()); qiq.exec(); while (qiq.next()) { QString qryitem_src = qiq.value("qryitem_src").toString(); if (qryitem_src == "MQL") { bool valid = false; QString errmsg; QString tmpqry; tmpqry = MQLUtil::mqlLoad(qiq.value("qryitem_group").toString(), qiq.value("qryitem_detail").toString(), errmsg, &valid); if (valid) paramlist.append(MQLEdit::getParamsFromMetaSQLText(tmpqry)); } else if (qryitem_src == "CUSTOM") paramlist.append(MQLEdit::getParamsFromMetaSQLText(qiq.value("qryitem_detail").toString())); } if (qiq.lastError().type() != QSqlError::NoError) { systemError(this, qiq.lastError().text(), __FILE__, __LINE__); return; } paramlist.sort(); for (int i = 0; i < paramlist.size(); i++) xml += "\n "; xml += "\n"; QDomDocument doc; doc.setContent(xml); _paramedit->setDocument(doc); prevqrysetid = _qrySetList->id(); } } } void exportData::sNewQuerySet() { if (_queryset) { _queryset->setId(-1); _queryset->show(); } } qt-client-4.1.0/guiclient/exportData.h000066400000000000000000000024031217451700100176600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXPORTDATA_H #define EXPORTDATA_H #include "xwidget.h" #include #include #include "ui_exportData.h" #include "queryset.h" class exportData : public XWidget, public Ui::exportData { Q_OBJECT public: exportData(QWidget* = 0, const char * = 0, Qt::WindowFlags = 0); ~exportData(); static bool userHasPriv(const int priv); Q_INVOKABLE ParameterEdit *getParameterEdit() const; public slots: protected slots: virtual void languageChange(); virtual void sDeleteQuerySet(); virtual void sEditQuerySet(); virtual void sExport(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sNewQuerySet(); protected: static QString exportFileDir; ParameterEdit *_paramedit; QuerySet *_queryset; }; #endif qt-client-4.1.0/guiclient/exportData.ui000066400000000000000000000160021217451700100200460ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. exportData 0 0 444 383 Export Data Close false Export Qt::Vertical 20 40 Destination format: xTuple XML true Alternate XML false Qt::Horizontal QSizePolicy::Fixed 20 7 1 0 Query Set: _qrySetList New false Edit Qt::Vertical QSizePolicy::Fixed 20 20 Delete Qt::Vertical 20 40 XLabel QLabel

    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _xtupleXML _otherXML _exportList _qrySetList _newQuerySet _editQuerySet _export _close _close clicked() exportData close() 431 43 554 21 _qrySetList valid(bool) _editQuerySet setEnabled(bool) 332 312 431 296 _qrySetList itemSelected(int) _editQuerySet animateClick() 332 312 431 296 _otherXML toggled(bool) _exportList setEnabled(bool) 65 81 105 111 qt-client-4.1.0/guiclient/externalCCTransaction.cpp000066400000000000000000000101771217451700100223450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "externalCCTransaction.h" #include #include #include #include #include #include externalCCTransaction::externalCCTransaction(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); } externalCCTransaction::~externalCCTransaction() { // no need to delete child widgets, Qt does it all for us } void externalCCTransaction::languageChange() { retranslateUi(this); } enum SetResponse externalCCTransaction::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) _cust->setId(param.toInt()); param = pParams.value("ccard_number_x", &valid); if (valid) _ccard->setText(param.toString()); param = pParams.value("currid", &valid); if (valid) _amount->setId(param.toInt()); param = pParams.value("amount", &valid); if (valid) _amount->setLocalValue(param.toDouble()); param = pParams.value("type", &valid); if (valid) { if (param.toString() == "A") _transType->setCurrentIndex(0); else if (param.toString() == "C") _transType->setCurrentIndex(1); else if (param.toString() == "CP") _transType->setCurrentIndex(2); else if (param.toString() == "R") _transType->setCurrentIndex(3); else if (param.toString() == "V") _transType->setCurrentIndex(4); } param = pParams.value("reforder", &valid); if (valid) _order->setText(param.toString()); param = pParams.value("ordernum", &valid); if (valid) _transactionId->setText(param.toString()); return NoError; } void externalCCTransaction::getResults(ParameterList &pParams) { QVariant amount = pParams.value("amount"); int amountIndex; for (amountIndex = 0; amountIndex < pParams.size(); amountIndex++) if (pParams.name(amountIndex) == "amount") break; switch (_approved->currentIndex()) { case 0: pParams.append("approved", "APPROVED"); if (_transType->currentIndex() == 0) pParams.append("status", "A"); else if (_transType->currentIndex() == 4) pParams.append("status", "V"); else pParams.append("status", "C"); break; case 1: pParams.append("approved", "DECLINED"); pParams.append("status", "D"); if (amountIndex < pParams.size()) pParams.removeAt(amountIndex); pParams.append("amount", "0"); break; case 2: pParams.append("approved", "ERROR"); pParams.append("status", "X"); if (amountIndex < pParams.size()) pParams.removeAt(amountIndex); pParams.append("amount", "0"); break; case 3: pParams.append("approved", "HELDFORREVIEW"); if (_transType->currentIndex() == 0) pParams.append("status", "A"); else if (_transType->currentIndex() == 4) pParams.append("status", "V"); else pParams.append("status", "C"); break; default: pParams.append("status", "X"); if (amountIndex < pParams.size()) pParams.removeAt(amountIndex); pParams.append("amount", "0"); } pParams.append("code", _approvalCode->text()); pParams.append("xactionid",_transactionId->text()); pParams.append("avs", _passedAVS->isChecked() ? tr("passed") : tr("failed or not entered")); pParams.append("passedavs",QVariant(_passedAVS->isChecked())); pParams.append("passedcvv",QVariant(_passedCVV->isChecked())); //pParams.append("error", ); //pParams.append("shipping", ); //pParams.append("tax", ); //pParams.append("ref", ); //pParams.append("message", ); } qt-client-4.1.0/guiclient/externalCCTransaction.h000066400000000000000000000020751217451700100220100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXTERNALCCTRANSACTION_H #define EXTERNALCCTRANSACTION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_externalCCTransaction.h" class externalCCTransaction : public XDialog, public Ui::externalCCTransaction { Q_OBJECT public: externalCCTransaction(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~externalCCTransaction(); public slots: virtual enum SetResponse set(const ParameterList &pParams); virtual void getResults(ParameterList &); protected slots: virtual void languageChange(); private: }; #endif // EXTERNALCCTRANSACTION_H qt-client-4.1.0/guiclient/externalCCTransaction.ui000066400000000000000000000237661217451700100222100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. externalCCTransaction 0 0 576 372 Credit Card Transaction Information false 0 0 0 0 0 5 0 0 0 0 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 20 Credit Card Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ccard XXXX false Transaction Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transType false Pre-Authorization Charge Capture Pre-Authorization Credit Void Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _amount false Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _order order Qt::Horizontal Passed Address Verification Approval Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _approved Approved Declined Error Held For Review Approval Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _approvalCode Passed Card Verification Transaction ID: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transactionId Qt::Vertical 20 0 CurrCluster CurrDisplay
    currcluster.h
    CustCluster QWidget
    custcluster.h
    DLineEdit QWidget
    datecluster.h
    _approved _approvalCode _transactionId _passedAVS _passedCVV _save _close _expDate _transType _amount _close clicked() externalCCTransaction reject() 423 32 20 20 _save clicked() externalCCTransaction accept() 474 53 279 185
    qt-client-4.1.0/guiclient/externalShipping.cpp000066400000000000000000000112201217451700100214210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include "externalShipping.h" #include "errorReporter.h" #include "guiErrorCheck.h" bool externalShipping::userHasPriv(const int /*pMode*/) { bool retval = _privileges->check("MaintainExternalShipping"); return retval; } void externalShipping::setVisible(bool visible) { if (! visible) XDialog::setVisible(false); else if (!userHasPriv()) { systemError(this, tr("You do not have sufficient privilege to view this window."), __FILE__, __LINE__); reject(); } else XDialog::setVisible(true); } void externalShipping::showEvent(QShowEvent *event) { if (event) { _screen->setModel(_model); _screen->setCurrentIndex(_idx); if (_mode == cNew) _screen->setMode(Screen::New); else if (_mode == cEdit) _screen->setMode(Screen::Edit); else if (_mode == cView) _screen->setMode(Screen::View); } } externalShipping::externalShipping(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _mode=-1; connect(_order, SIGNAL(newId(int)), this, SLOT(sHandleOrder())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(this, SIGNAL(rejected()), this, SLOT(sReject())); _order->setAllowedTypes(OrderLineEdit::Sales); _shipment->setType(ShipmentClusterLineEdit::SalesOrder); // Trolltech bug 150373, fixed in Qt 4.4: Numerics are returned as strings // TODO: retest in 4.4: are numerics displayed using the current locale? #if QT_VERSION >= 0x040400 _weight->setValidator(omfgThis->weightVal()); #endif _model = new XSqlTableModel(this); } externalShipping::~externalShipping() { // no need to delete child widgets, Qt does it all for us } void externalShipping::languageChange() { retranslateUi(this); } enum SetResponse externalShipping::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("currentIndex", &valid); if (valid) _idx=param.toInt(); param = pParams.value("mode", &valid); if (valid) { _mode = param.toInt(); _save->setHidden(_mode==cView); } return NoError; } enum SetResponse externalShipping::setModel(XSqlTableModel *model) { _model=model; return NoError; } void externalShipping::sHandleOrder() { if (_order->id() > 0) { _shipment->setType("SO"); _shipment->limitToOrder(_order->id()); } else { _shipment->removeOrderLimit(); _shipment->setType("SO"); } } void externalShipping::sSave() { QList errors; errors << GuiErrorCheck(!_order->isValid(), _order, tr("You must enter a valid Order Number for this External Shipping Record " "before continuing")) << GuiErrorCheck(!_shipment->isValid(), _shipment, tr("You must select a valid Shipment Number for this External Shipping Record " "before continuing")) << GuiErrorCheck(_shipper->text().isEmpty(), _shipper, tr("You must select a valid Shipper for this External Shipping Record " "before continuing")) << GuiErrorCheck(_packnumTracknum->text().isEmpty(), _packnumTracknum, tr("You must select a valid Package Tracking Number for this External Shipping Record " "before continuing")) << GuiErrorCheck(_tracknum->text().isEmpty(), _tracknum, tr("You must select a valid Tracking Number for this External Shipping Record " "before continuing")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Shipping Record"), errors)) return; else { _screen->save(); } if (_screen->mode() != Screen::New) { accept(); } else { _order->setFocus(); } } void externalShipping::sClose() { switch (_screen->check()) { case Screen::Save: return; case Screen::Cancel: _screen->revertRow(_screen->currentIndex()); break; default: break; } accept(); } void externalShipping::sReject() { _screen->revertRow(_screen->currentIndex()); } qt-client-4.1.0/guiclient/externalShipping.h000066400000000000000000000025141217451700100210740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXTERNALSHIPPING_H #define EXTERNALSHIPPING_H #include "guiclient.h" #include "xdialog.h" #include class externalShipping : public XDialog, public Ui::externalShipping { Q_OBJECT public: externalShipping(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~externalShipping(); static bool userHasPriv(const int = cView); virtual void setVisible(bool); void showEvent(QShowEvent *event); public slots: enum SetResponse set(const ParameterList &pParams); virtual SetResponse setModel(XSqlTableModel *model ); protected slots: virtual void languageChange(); virtual void sHandleOrder(); virtual void sSave(); virtual void sClose(); virtual void sReject(); private: XSqlTableModel *_model; int _idx; int _mode; }; #endif // EXTERNALSHIPPING_H qt-client-4.1.0/guiclient/externalShipping.ui000066400000000000000000000426201217451700100212640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. externalShipping 0 0 600 429 External Shipping Maintenance 5 Qt::StrongFocus so_number Qt::Horizontal 40 20 0 Close Save Qt::Vertical 20 40 Qt::StrongFocus Shipment #: shipment_number Qt::Horizontal 40 20 Shipper: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipper shipper Package Tracking Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _packnumTracknum package_tracking_number Tracking Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _tracknum tracking_number Package Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _pkgType package_type Void: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _void Qt::StrongFocus void N Y Billing Option: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billing billing_option Weight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _weight Base Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _baseFreight Total Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _totalFreight weight 0 base_freight false base_freight_currency total_freight false total_freight_currency Last Updated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _lastupdated false XDateEdit::Current last_updated CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    OrderCluster QWidget
    ordercluster.h
    Screen QWidget
    screen.h
    1
    ShipmentCluster QWidget
    shipmentcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _order _shipment _shipper _packnumTracknum _tracknum _pkgType _void _billing _weight _baseFreight _totalFreight _lastupdated _close _save _screen newDataWidgetMapper(XDataWidgetMapper*) _shipper setDataWidgetMap(XDataWidgetMapper*) 375 223 557 218 _screen newDataWidgetMapper(XDataWidgetMapper*) _billing setDataWidgetMap(XDataWidgetMapper*) 375 223 455 385 _screen newDataWidgetMapper(XDataWidgetMapper*) _pkgType setDataWidgetMap(XDataWidgetMapper*) 375 223 455 315 _screen newDataWidgetMapper(XDataWidgetMapper*) _tracknum setDataWidgetMap(XDataWidgetMapper*) 375 223 727 282 _screen newDataWidgetMapper(XDataWidgetMapper*) _packnumTracknum setDataWidgetMap(XDataWidgetMapper*) 375 223 727 250 _screen newDataWidgetMapper(XDataWidgetMapper*) _lastupdated setDataWidgetMap(XDataWidgetMapper*) 375 223 485 414 _screen newDataWidgetMapper(XDataWidgetMapper*) _weight setDataWidgetMap(XDataWidgetMapper*) 375 223 726 315 _screen newDataWidgetMapper(XDataWidgetMapper*) _baseFreight setDataWidgetMap(XDataWidgetMapper*) 375 223 726 351 _screen newDataWidgetMapper(XDataWidgetMapper*) _totalFreight setDataWidgetMap(XDataWidgetMapper*) 375 223 726 387 _screen newDataWidgetMapper(XDataWidgetMapper*) _shipment setDataWidgetMap(XDataWidgetMapper*) 375 223 509 184 _screen newDataWidgetMapper(XDataWidgetMapper*) _void setDataWidgetMap(XDataWidgetMapper*) 375 223 458 352 _screen newDataWidgetMapper(XDataWidgetMapper*) _order setDataWidgetMap(XDataWidgetMapper*) 375 223 292 61
    qt-client-4.1.0/guiclient/externalShippingList.cpp000066400000000000000000000072401217451700100222640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "externalShipping.h" #include "externalShippingList.h" bool externalShippingList::userHasPriv() { bool retval = _privileges->check("MaintainExternalShipping"); return retval; } void externalShippingList::showEvent(QShowEvent *event) { if (event) { _ship->setTable(); _ship->setColumn(tr("So Number"), 100, Qt::AlignLeft, true, "so_number"); _ship->setColumn(tr("Shipment Number"), 100, Qt::AlignLeft, true, "shipment_number"); _ship->setColumn(tr("Package Tracking Number"), 100, Qt::AlignLeft, true, "package_tracking_number"); _ship->setColumn(tr("Void"), 40, Qt::AlignLeft, true, "void"); _ship->setColumn(tr("Billing Option"), 100, Qt::AlignLeft, false, "billing_option"); _ship->setColumn(tr("Weight"), 60, Qt::AlignRight,true, "weight"); _ship->setColumn(tr("Base Freight"), 60, Qt::AlignRight,false, "base_freight"); _ship->setColumn(tr("Base Freight Currency"), 80, Qt::AlignLeft, false, "base_freight_currency"); _ship->setColumn(tr("Total Freight"), 60, Qt::AlignRight,true, "total_freight"); _ship->setColumn(tr("Total Freight Currency"), 80, Qt::AlignLeft, true, "total_freight_currency"); _ship->setColumn(tr("Package Type"), 100, Qt::AlignLeft, false, "billing_option"); _ship->setColumn(tr("Tracking Number"), 100, Qt::AlignLeft, false, "tracking_number"); _ship->setColumn(tr("Last Updated"), 100, Qt::AlignLeft, false, "last_updated"); _ship->setColumnFormat("weight", XSqlTableModel::Weight); _ship->setColumnFormat("base_freight", XSqlTableModel::Curr); _ship->setColumnFormat("total_freight", XSqlTableModel::Curr); _ship->select(); } XWidget::showEvent(event); } void externalShippingList::setVisible(bool visible) { if (! visible) XWidget::setVisible(false); else if (!userHasPriv()) { systemError(this, tr("You do not have sufficient privilege to view this window."), __FILE__, __LINE__); close(); } else XWidget::setVisible(true); } externalShippingList::externalShippingList(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); } externalShippingList::~externalShippingList() { // no need to delete child widgets, Qt does it all for us } void externalShippingList::languageChange() { retranslateUi(this); } void externalShippingList::sNew() { sOpen(cNew); } void externalShippingList::sEdit() { sOpen(cEdit); } void externalShippingList::sView() { sOpen(cView); } void externalShippingList::sDelete() { _ship->removeSelected(); _ship->save(); } void externalShippingList::sOpen(int mode) { if (mode == cNew) _ship->clearSelection(); ParameterList params; params.append("mode", mode); params.append("currentIndex",_ship->currentIndex()); externalShipping newdlg(this, "", TRUE); newdlg.setModel(_ship->model()); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/externalShippingList.h000066400000000000000000000022241217451700100217260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXTERNALSHIPPINGLIST_H #define EXTERNALSHIPPINGLIST_H #include "guiclient.h" #include "xwidget.h" #include "ui_externalShippingList.h" class externalShippingList : public XWidget, public Ui::externalShippingList { Q_OBJECT public: externalShippingList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~externalShippingList(); static bool userHasPriv(); virtual void setVisible(bool); void showEvent(QShowEvent *event); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sOpen(int mode); protected slots: virtual void languageChange(); }; #endif // EXTERNALSHIPPINGLIST_H qt-client-4.1.0/guiclient/externalShippingList.ui000066400000000000000000000126031217451700100221160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. externalShippingList 0 0 800 600 External Shipping List 0 External Shipping Data: QAbstractItemView::NoEditTriggers QAbstractItemView::SelectRows api extshipmaint 5 &Close 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeView QTreeView
    xtreeview.h
    _close clicked() externalShippingList close() 746 36 760 4 _ship doubleClicked(QModelIndex) _edit animateClick() 613 84 703 90 _ship valid(bool) _view setEnabled(bool) 647 120 727 117 _ship valid(bool) _delete setEnabled(bool) 347 297 727 141 _ship valid(bool) _edit setEnabled(bool) 347 297 727 93
    qt-client-4.1.0/guiclient/externalccprocessor.cpp000066400000000000000000000211771217451700100222010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "guiclient.h" #include "externalccprocessor.h" #include "externalCCTransaction.h" #define DEBUG false /** @ingroup creditcards @class ExternalCCProcessor @brief A simple interface for entering credit card transaction information manually. */ ExternalCCProcessor::ExternalCCProcessor() : CreditCardProcessor() { _company = "ExternalCCProcessor"; _defaultLivePort = 0; _defaultLiveServer = ""; _defaultTestPort = 0; _defaultTestServer = ""; } /** @brief Simplify CreditCardProcessor's implementation - we really don't care about much with the external credit card processor. */ int ExternalCCProcessor::testConfiguration() { if (DEBUG) qDebug("ExternalCCProcessor::testConfiguration()"); reset(); if (!_privileges->check("ProcessCreditCards")) { _errorMsg = errorMsg(-2); return -2; } if(!_metrics->boolean("CCAccept")) { _errorMsg = errorMsg(-3); return -3; } XSqlQuery ccbankq("SELECT ccbank_id" " FROM ccbank" " WHERE (ccbank_bankaccnt_id IS NOT NULL);"); if (ccbankq.first()) ; // we're ok - we can accept at least one credit card else if (ccbankq.lastError().type() != QSqlError::NoError) { _errorMsg = ccbankq.lastError().text(); return -1; } else { _errorMsg = errorMsg(-4); return -4; } if (omfgThis->_key.isEmpty()) { _errorMsg = errorMsg(-5); return -5; } return 0; } int ExternalCCProcessor::doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("ExtCC:doAuthorize(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = handleTrans(pccardid, "A", pcvv, pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int ExternalCCProcessor::doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("ExtCC:doCharge(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = handleTrans(pccardid, "C", pcvv, pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int ExternalCCProcessor::doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("ExtCC:doChargePreauthorized(%d, pcvv, %f, %d, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = handleTrans(pccardid, "CP", pcvv, pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int ExternalCCProcessor::doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("ExtCC:doCredit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = handleTrans(pccardid, "R", pcvv, pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int ExternalCCProcessor::doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("ExtCC:doVoidPrevious(%d, pcvv, %f, %d, %s, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), qPrintable(papproval), pccpayid); int returnValue = handleTrans(pccardid, "V", pcvv, pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int ExternalCCProcessor::handleTrans(const int pccardid, const QString &ptype, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { Q_UNUSED(pcvv); if (DEBUG) qDebug("ExtCC::handleTrans(%d, %s, pcvv, %f, %d, %s, %s, %d, pparams)", pccardid, qPrintable(ptype), pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); // TODO: if check and not credit card transaction do something else XSqlQuery extq; extq.prepare( "SELECT ccard_active," " formatccnumber(decrypt(setbytea(ccard_number),setbytea(:key),'bf')) AS ccard_number_x," " formatbytea(decrypt(setbytea(ccard_month_expired),setbytea(:key),'bf')) AS ccard_month_expired," " formatbytea(decrypt(setbytea(ccard_year_expired),setbytea(:key), 'bf')) AS ccard_year_expired," " ccard_cust_id " " FROM ccard " "WHERE (ccard_id=:ccardid);"); extq.bindValue(":ccardid", pccardid); extq.bindValue(":key", omfgThis->_key); extq.exec(); if (extq.first()) { if (!extq.value("ccard_active").toBool()) { _errorMsg = errorMsg(-10); return -10; } } else if (extq.lastError().type() != QSqlError::NoError) { _errorMsg = extq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } pparams.append("cust_id", extq.value("ccard_cust_id")); pparams.append("ccard_number_x", extq.value("ccard_number_x")); pparams.append("ccard_exp", QDate(extq.value("ccard_year_expired").toInt(), extq.value("ccard_month_expired").toInt(), 1)); pparams.append("ccard_id", pccardid); pparams.append("currid", pcurrid); pparams.append("amount", pamount); pparams.append("auth_charge",ptype); pparams.append("type", ptype); pparams.append("reforder", (preforder.isEmpty()) ? pneworder : preforder); pparams.append("ordernum", pneworder); pparams.append("auth", QVariant(ptype == "A")); externalCCTransaction newdlg(0, "", true); newdlg.set(pparams); int returnValue = 0; if (newdlg.exec() == QDialog::Rejected) { if (ptype == "A") returnValue = -70; else if (ptype == "C") returnValue = -72; else if (ptype == "CP") returnValue = -71; else if (ptype == "R") returnValue = -73; else if (ptype == "V") returnValue = -74; else returnValue = -19; _errorMsg = errorMsg(returnValue).arg(ptype); } else { newdlg.getResults(pparams); QVariant param; bool valid; param = pparams.value("passedavs", &valid); if (valid) _passedAvs = param.toBool(); param = pparams.value("passedcvv", &valid); if (valid) _passedCvv = param.toBool(); param = pparams.value("approved", &valid); if (valid) { if (param.toString() == "ERROR") { _errorMsg = errorMsg(-12).arg(tr("User reported that an error occurred.")).arg(_company); returnValue = -12; } else if (param.toString() == "DECLINED") { _errorMsg = errorMsg(-92).arg(""); returnValue = -92; } else if (param.toString().isEmpty()) { _errorMsg = errorMsg(-100).arg(tr("The 'approved' parameter is empty; " "this should never happen.")); returnValue = -100; } } } if (DEBUG) qDebug("ExtCC::handleTrans returning %d %s", returnValue, qPrintable(errorMsg())); return returnValue; } bool ExternalCCProcessor::handlesCreditCards() { return true; } qt-client-4.1.0/guiclient/externalccprocessor.h000066400000000000000000000043471217451700100216460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EXTERNALCCPROCESSOR_H #define EXTERNALCCPROCESSOR_H #include #include #include "creditcardprocessor.h" class ExternalCCProcessor : public CreditCardProcessor { Q_OBJECT public: ExternalCCProcessor(); Q_INVOKABLE virtual int testConfiguration(); protected: virtual int doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pnweorder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pnweorder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams); virtual bool handlesCreditCards(); virtual int handleTrans(const int pccardid, const QString &ptype, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); private: }; #endif // EXTERNALCCPROCESSOR_H qt-client-4.1.0/guiclient/failedPostList.cpp000066400000000000000000000025651217451700100210370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "failedPostList.h" failedPostList::failedPostList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); } failedPostList::~failedPostList() { // no need to delete child widgets, Qt does it all for us } void failedPostList::languageChange() { retranslateUi(this); } void failedPostList::setLabel(const QString& pText) { _label->setText(pText); } void failedPostList::sSetList(QList itemList, QTreeWidgetItem* hitem, QHeaderView* header) { if (itemList.size() > 0) { for (int j = 0; j < hitem->columnCount(); j++) { _doclist->addColumn(hitem->text(j), header->sectionSize(j), hitem->textAlignment(j)); } //_doclist->addTopLevelItems(itemList); for (int i = 0; i < itemList.size(); i++) { XTreeWidgetItem* tmp = (XTreeWidgetItem*)(itemList[i]->clone()); _doclist->addTopLevelItem(tmp); } } } qt-client-4.1.0/guiclient/failedPostList.h000066400000000000000000000017671217451700100205070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FAILEDPOSTLIST_H #define FAILEDPOSTLIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_failedPostList.h" class failedPostList : public XDialog, public Ui::failedPostList { Q_OBJECT public: failedPostList(QWidget* = 0, const char* = 0, bool = false, Qt::WFlags = 0); ~failedPostList(); public slots: virtual void sSetList(QList, QTreeWidgetItem*, QHeaderView*); virtual void setLabel(const QString&); protected slots: virtual void languageChange(); }; #endif // FAILEDPOSTLIST_H qt-client-4.1.0/guiclient/failedPostList.ui000066400000000000000000000076221217451700100206710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. failedPostList 0 0 655 258 Failed Post List 9 6 0 5 true 7 7 0 0 <p>Could not post these documents to the G/L because the accounting periods for the posting dates are closed:</p> 3 3 0 2 0 0 OK Retry Qt::Vertical 20 0 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _ok clicked() failedPostList reject() 457 25 259 59 _retry clicked() failedPostList accept() 529 57 295 130
    qt-client-4.1.0/guiclient/financialLayout.cpp000066400000000000000000001267341217451700100212400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "financialLayout.h" #include #include #include #include "errorReporter.h" #include "financialLayoutColumns.h" #include "financialLayoutItem.h" #include "financialLayoutGroup.h" #include "financialLayoutSpecial.h" #define cFlRoot 0 #define cFlItem 1 #define cFlGroup 2 #define cFlSpec 3 #define cIncome 0 #define cBalance 1 #define cCash 2 #define cAdHoc 3 financialLayout::financialLayout(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl), _last(0), _flheadid(-1), _mode(0), _cachedType(cIncome) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_layout, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); connect(_addTopLevelGroup, SIGNAL(clicked()), this, SLOT(sAddTopLevelGroup())); connect(_addGroup, SIGNAL(clicked()), this, SLOT(sAddGroup())); connect(_layout, SIGNAL(itemSelected(int)), this, SLOT(sHandleSelection())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_addAccount, SIGNAL(clicked()), this, SLOT(sAddAccount())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_moveUp, SIGNAL(clicked()), this, SLOT(sMoveUp())); connect(_moveDown, SIGNAL(clicked()), this, SLOT(sMoveDown())); connect(_addSpecial, SIGNAL(clicked()), this, SLOT(sAddSpecial())); connect(_income, SIGNAL(clicked()), this, SLOT(sSetType())); connect(_balance, SIGNAL(clicked()), this, SLOT(sSetType())); connect(_cash, SIGNAL(clicked()), this, SLOT(sSetType())); connect(_adHoc, SIGNAL(clicked()), this, SLOT(sSetType())); connect(_addCol, SIGNAL(clicked()), this, SLOT(sAddCol())); connect(_editCol, SIGNAL(clicked()), this, SLOT(sEditCol())); connect(_viewCol, SIGNAL(clicked()), this, SLOT(sEditCol())); connect(_deleteCol, SIGNAL(clicked()), this, SLOT(sDeleteCol())); connect(_layouts, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtonsCol())); connect(_layouts, SIGNAL(itemSelected(int)), this, SLOT(sEditCol())); connect(_showTotal, SIGNAL(toggled(bool)), this, SLOT(sUncheckAltGrandTotal())); connect(_showGrandTotal, SIGNAL(toggled(bool)), this, SLOT(sUncheckAltGrandTotal())); _layout->setRootIsDecorated(TRUE); _layout->addColumn( tr("Group/Account Name"), -1, Qt::AlignLeft ); _layouts->addColumn( tr("Name"), _itemColumn, Qt::AlignLeft, true, "flcol_name"); _layouts->addColumn( tr("Description"), -1, Qt::AlignLeft, true, "flcol_descrip"); } financialLayout::~financialLayout() { // no need to delete child widgets, Qt does it all for us } void financialLayout::languageChange() { retranslateUi(this); } enum SetResponse financialLayout::set(const ParameterList &pParams) { XSqlQuery financialet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("flhead_id", &valid); if (valid) { _flheadid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; financialet.prepare("INSERT INTO flhead (flhead_name)" " VALUES ('TEMPORARY' || CURRENT_TIMESTAMP)" " RETURNING flhead_id;"); financialet.exec(); if (financialet.first()) _flheadid = financialet.value("flhead_id").toInt(); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Creating Temporary Record"), financialet, __FILE__, __LINE__)) return UndefinedError; sSetType(); // ToDo } /*else if (param.toString() == "edit") { _mode = cEdit; _view->setHidden(TRUE); _viewCol->setHidden(TRUE); }*/ else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _showTotal->setEnabled(FALSE); _showGrandTotal->setEnabled(FALSE); _altLabels->setEnabled(FALSE); _addTopLevelGroup->setHidden(TRUE); _addGroup->setHidden(TRUE); _addAccount->setHidden(TRUE); _edit->setHidden(TRUE); _delete->setHidden(TRUE); _moveUp->setHidden(TRUE); _moveDown->setHidden(TRUE); _reportType->setEnabled(FALSE); _addCol->setHidden(TRUE); _editCol->setHidden(TRUE); _deleteCol->setHidden(TRUE); } } return NoError; } void financialLayout::sCheck() { XSqlQuery financialCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) || (_name->text().length())) { financialCheck.prepare( "SELECT flhead_id " "FROM flhead " "WHERE (UPPER(flhead_name)=UPPER(:flhead_name));" ); financialCheck.bindValue(":flhead_name", _name->text()); financialCheck.exec(); if (financialCheck.first()) { _flheadid = financialCheck.value("flhead_id").toInt(); _mode = cEdit; _layout->setColumnCount(1); populate(); _name->setEnabled(FALSE); } } } void financialLayout::sSave() { XSqlQuery financialSave; if (_name->text().length() == 0) { QMessageBox::warning( this, tr("Layout Name is Invalid"), tr("You must enter a valid name for this Financial Report.") ); _name->setFocus(); return; } financialSave.prepare( "UPDATE flhead " "SET flhead_name=:flhead_name, flhead_descrip=:flhead_descrip," " flhead_showtotal=:showtotal," " flhead_showstart=:flhead_showstart," " flhead_showend=:flhead_showend," " flhead_showdelta=:flhead_showdelta," " flhead_showbudget=:flhead_showbudget," " flhead_showdiff=:flhead_showdiff," " flhead_showcustom=:flhead_showcustom," " flhead_type=:flhead_type," " flhead_active=:flhead_active," " flhead_custom_label=:flhead_custom_label," " flhead_usealtbegin=:flhead_usealtbegin," " flhead_altbegin=:flhead_altbegin," " flhead_usealtend=:flhead_usealtend," " flhead_altend=:flhead_altend," " flhead_usealtdebits=:flhead_usealtdebits," " flhead_altdebits=:flhead_altdebits," " flhead_usealtcredits=:flhead_usealtcredits," " flhead_altcredits=:flhead_altcredits," " flhead_usealtbudget=:flhead_usealtbudget," " flhead_altbudget=:flhead_altbudget," " flhead_usealtdiff=:flhead_usealtdiff," " flhead_altdiff=:flhead_altdiff," " flhead_usealttotal=:flhead_usealttotal," " flhead_alttotal=:flhead_alttotal," " flhead_notes=:flhead_notes" " WHERE (flhead_id=:flhead_id);" ); financialSave.bindValue(":flhead_name", _name->text()); financialSave.bindValue(":flhead_descrip", _descrip->text()); financialSave.bindValue(":showtotal", QVariant((_showTotal->isChecked()) || (_showGrandTotal->isChecked()))); financialSave.bindValue(":flhead_showstart", QVariant((_showTotal->isChecked() && _showStart->isChecked()))); financialSave.bindValue(":flhead_showend", QVariant((_showTotal->isChecked() && _showEnd->isChecked()) || ((_showGrandTotal->isChecked()) && (_balance->isChecked())))); financialSave.bindValue(":flhead_showdelta", QVariant((_showTotal->isChecked() && _showDelta->isChecked()) || ((_showGrandTotal->isChecked()) && (_cash->isChecked())))); financialSave.bindValue(":flhead_showbudget", QVariant((_showTotal->isChecked() && _showBudget->isChecked()) || ((_showGrandTotal->isChecked()) && (!_adHoc->isChecked())))); financialSave.bindValue(":flhead_showdiff", QVariant((_showTotal->isChecked() && _showDiff->isChecked()) || ((_showGrandTotal->isChecked()) && (((_income->isChecked())) || (_cash->isChecked()))))); financialSave.bindValue(":flhead_showcustom", QVariant((_showTotal->isChecked() && _showCustom->isChecked()))); if ( _income->isChecked() ) financialSave.bindValue(":flhead_type","I"); else if ( _balance->isChecked() ) financialSave.bindValue(":flhead_type","B"); else if ( _cash->isChecked() ) financialSave.bindValue(":flhead_type","C"); else if ( _adHoc->isChecked() ) financialSave.bindValue(":flhead_type","A"); financialSave.bindValue(":flhead_active", QVariant(_active->isChecked())); financialSave.bindValue(":flhead_id", _flheadid); financialSave.bindValue(":flhead_custom_label", _customText->text()); financialSave.bindValue(":flhead_usealttotal", QVariant(_altTotal->isChecked())); financialSave.bindValue(":flhead_alttotal", _altTotalText->text()); financialSave.bindValue(":flhead_usealtbegin", QVariant(_altBegin->isChecked())); financialSave.bindValue(":flhead_altbegin", _altBeginText->text()); financialSave.bindValue(":flhead_usealtend", QVariant(_altEnd->isChecked())); financialSave.bindValue(":flhead_altend", _altEndText->text()); financialSave.bindValue(":flhead_usealtdebits", QVariant(_altDebits->isChecked())); financialSave.bindValue(":flhead_altdebits", _altDebitsText->text()); financialSave.bindValue(":flhead_usealtcredits", QVariant(_altCredits->isChecked())); financialSave.bindValue(":flhead_altcredits", _altCreditsText->text()); financialSave.bindValue(":flhead_usealtbudget", QVariant(_altBudget->isChecked())); financialSave.bindValue(":flhead_altbudget", _altBudgetText->text()); financialSave.bindValue(":flhead_usealtdiff", QVariant(_altDiff->isChecked())); financialSave.bindValue(":flhead_altdiff", _altDiffText->text()); financialSave.bindValue(":flhead_id", _flheadid); financialSave.bindValue(":flhead_notes", _notes->toPlainText()); financialSave.exec(); done(_flheadid); } void financialLayout::populate() { XSqlQuery financialpopulate; financialpopulate.prepare( "SELECT flhead_name, flhead_descrip, flhead_showtotal," " flhead_showstart, flhead_showend," " flhead_showdelta, flhead_showbudget, flhead_showdiff," " flhead_showcustom, flhead_type, flhead_active, " " flhead_custom_label," " flhead_usealtbegin, flhead_altbegin," " flhead_usealtend, flhead_altend," " flhead_usealtdebits, flhead_altdebits," " flhead_usealtcredits, flhead_altcredits," " flhead_usealtbudget, flhead_altbudget," " flhead_usealtdiff, flhead_altdiff," " flhead_usealttotal, flhead_alttotal, " " flhead_notes " "FROM flhead " "WHERE (flhead_id=:flhead_id);" ); financialpopulate.bindValue(":flhead_id", _flheadid); financialpopulate.exec(); if (financialpopulate.first()) { _name->setText(financialpopulate.value("flhead_name").toString()); _descrip->setText(financialpopulate.value("flhead_descrip").toString()); _notes->setPlainText(financialpopulate.value("flhead_notes").toString()); if(_showTotal->isChecked()) { _showStart->setChecked(financialpopulate.value("flhead_showstart").toBool()); _showEnd->setChecked(financialpopulate.value("flhead_showend").toBool()); _showDelta->setChecked(financialpopulate.value("flhead_showdelta").toBool()); _showBudget->setChecked(financialpopulate.value("flhead_showbudget").toBool()); _showDiff->setChecked(financialpopulate.value("flhead_showdiff").toBool()); _showCustom->setChecked(financialpopulate.value("flhead_showcustom").toBool()); } if ( financialpopulate.value("flhead_type").toString() == "I" ) { _showGrandTotal->setChecked(financialpopulate.value("flhead_showtotal").toBool()); _cachedType = cIncome; _income->setChecked(true); } else if ( financialpopulate.value("flhead_type").toString() == "B" ) { _showGrandTotal->setChecked(financialpopulate.value("flhead_showtotal").toBool()); _cachedType = cBalance; _balance->setChecked(true); } else if ( financialpopulate.value("flhead_type").toString() == "C" ) { _showGrandTotal->setChecked(financialpopulate.value("flhead_showtotal").toBool()); _cachedType = cCash; _cash->setChecked(true); } else if ( financialpopulate.value("flhead_type").toString() == "A" ) { _showTotal->setChecked(financialpopulate.value("flhead_showtotal").toBool()); _cachedType = cAdHoc; _adHoc->setChecked(true); } _active->setChecked(financialpopulate.value("flhead_active").toBool()); _customText->setText(financialpopulate.value("flhead_custom_label").toString()); _altTotal->setChecked(financialpopulate.value("flhead_usealttotal").toBool()); _altTotalText->setText(financialpopulate.value("flhead_alttotal").toString()); _altBegin->setChecked(financialpopulate.value("flhead_usealtbegin").toBool()); _altBeginText->setText(financialpopulate.value("flhead_altbegin").toString()); _altEnd->setChecked(financialpopulate.value("flhead_usealtend").toBool()); _altEndText->setText(financialpopulate.value("flhead_altend").toString()); _altDebits->setChecked(financialpopulate.value("flhead_usealtdebits").toBool()); _altDebitsText->setText(financialpopulate.value("flhead_altdebits").toString()); _altCredits->setChecked(financialpopulate.value("flhead_usealtcredits").toBool()); _altCreditsText->setText(financialpopulate.value("flhead_altcredits").toString()); _altBudget->setChecked(financialpopulate.value("flhead_usealtbudget").toBool()); _altBudgetText->setText(financialpopulate.value("flhead_altbudget").toString()); _altDiff->setChecked(financialpopulate.value("flhead_usealtdiff").toBool()); _altDiffText->setText(financialpopulate.value("flhead_altdiff").toString()); } else if (financialpopulate.lastError().type() != QSqlError::NoError) { systemError(this, financialpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } sSetType(); } void financialLayout::sFillList() { XSqlQuery financialFillList; int pId = -1, pType = -1; XTreeWidgetItem * item = (XTreeWidgetItem*)(_layout->currentItem()); if(0 != item) { pId = item->id(); pType = item->altId(); } _layout->clear(); _lastStack.clear(); _last = 0; if (_adHoc->isChecked()) { insertFlGroupAdHoc(-1, "", 0, pId, pType); } else { insertFlGroup(-1, "", 0, pId, pType); } _layout->expandAll(); item = (XTreeWidgetItem*)(_layout->currentItem()); if(0 != item) _layout->scrollToItem(item); financialFillList.prepare ("SELECT flcol_id, flcol_name, flcol_descrip " " FROM flcol " " WHERE flcol_flhead_id=:flhead_id " " ORDER BY flcol_name, flcol_descrip; "); financialFillList.bindValue(":flhead_id", _flheadid); financialFillList.exec(); _layouts->populate(financialFillList); if (financialFillList.lastError().type() != QSqlError::NoError) { systemError(this, financialFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void financialLayout::insertFlGroup(int pFlgrpid, QString pFlgrpname, XTreeWidgetItem *pParent, int pId, int pType) { XTreeWidgetItem *root = 0; XSqlQuery thisLevel; if (pFlgrpid != -1) { thisLevel.prepare("SELECT CASE WHEN(flgrp_summarize) THEN 'Summarized'" " WHEN(flgrp_subtotal) THEN 'Subtotal'" " ELSE ''" " END AS summary," " flgrp_subtract as subtract " " FROM flgrp" " WHERE ((flgrp_id=:flgrp_id)" " AND (flgrp_flhead_id=:flhead_id) ); "); thisLevel.bindValue(":flgrp_id", pFlgrpid); thisLevel.bindValue(":flhead_id", _flheadid); thisLevel.exec(); thisLevel.first(); if (pParent) _last = root = new XTreeWidgetItem(pParent, _last, pFlgrpid, cFlGroup, pFlgrpname, thisLevel.value("summary").toString(), ( thisLevel.value("subtract").toBool() ? tr("-") : tr("+") ) ); else _last = root = new XTreeWidgetItem(_layout, _last, pFlgrpid, cFlGroup, pFlgrpname, thisLevel.value("summary").toString(), ( thisLevel.value("subtract").toBool() ? tr("-") : tr("+") ) ); if ( (pFlgrpid == pId) && (pType == cFlGroup) ) { _layout->setCurrentItem(root); _layout->scrollToItem(root); } _lastStack.push(_last); _last = 0; } thisLevel.prepare( "SELECT flgrp_id AS id, :group AS type, flgrp_order AS orderby," " flgrp_name AS name," " flgrp_subtract AS subtract " "FROM flgrp " "WHERE ( (flgrp_flgrp_id=:flgrp_id)" " AND (flgrp_flhead_id=:flhead_id) ) " "UNION SELECT flitem_id AS id, :item AS type, flitem_order AS orderby," " formatflitemdescrip(flitem_id) AS name," " flitem_subtract AS subtract " "FROM flitem " "WHERE (flitem_flgrp_id=:flgrp_id) " "UNION SELECT flspec_id AS id, :spec AS type, flspec_order AS orderby," " flspec_name AS name," " flspec_subtract AS subtract " "FROM flspec " "WHERE (flspec_flgrp_id=:flgrp_id) " "ORDER BY orderby;" ); thisLevel.bindValue(":group", cFlGroup); thisLevel.bindValue(":item", cFlItem); thisLevel.bindValue(":spec", cFlSpec); thisLevel.bindValue(":flgrp_id", pFlgrpid); thisLevel.bindValue(":flhead_id", _flheadid); thisLevel.exec(); while (thisLevel.next()) { if (thisLevel.value("type").toInt() == cFlGroup) insertFlGroup(thisLevel.value("id").toInt(), thisLevel.value("name").toString(), root, pId, pType); else if (pFlgrpid != -1) { _last = new XTreeWidgetItem( root, _last, thisLevel.value("id").toInt(), thisLevel.value("type").toInt(), thisLevel.value("name"), "", ( thisLevel.value("subtract").toBool() ? tr("-") : tr("+") ) ); if ( (thisLevel.value("id").toInt() == pId) && (thisLevel.value("type").toInt() == pType) ) { _layout->setCurrentItem(_last); _layout->scrollToItem(root); } } } _last = _lastStack.pop(); } void financialLayout::insertFlGroupAdHoc(int pFlgrpid, QString pFlgrpname, XTreeWidgetItem *pParent, int pId, int pType) { XTreeWidgetItem *root = 0; XSqlQuery thisLevel; if (pFlgrpid != -1) { thisLevel.prepare("SELECT CASE WHEN(flgrp_summarize OR flgrp_subtotal) THEN formatBoolYN(flgrp_showstart)" " ELSE ''" " END AS showbeg," " CASE WHEN(flgrp_summarize OR flgrp_subtotal) THEN formatBoolYN(flgrp_showend)" " ELSE ''" " END AS showend," " CASE WHEN(flgrp_summarize OR flgrp_subtotal) THEN formatBoolYN(flgrp_showdelta)" " ELSE ''" " END AS showdbcr," " CASE WHEN(flgrp_summarize OR flgrp_subtotal) THEN formatBoolYN(flgrp_showbudget)" " ELSE ''" " END AS showbudget," " CASE WHEN(flgrp_summarize OR flgrp_subtotal) THEN formatBoolYN(flgrp_showdiff)" " ELSE ''" " END AS showdiff," " CASE WHEN(flgrp_summarize OR flgrp_subtotal) THEN formatBoolYN(flgrp_showcustom)" " ELSE ''" " END AS showcustom," " CASE WHEN(flgrp_summarize) THEN 'Summarized'" " WHEN(flgrp_subtotal) THEN 'Subtotal'" " ELSE ''" " END AS summary," " flgrp_subtract as subtract " " FROM flgrp" " WHERE ((flgrp_id=:flgrp_id)" " AND (flgrp_flhead_id=:flhead_id) ); "); thisLevel.bindValue(":flgrp_id", pFlgrpid); thisLevel.bindValue(":flhead_id", _flheadid); thisLevel.exec(); thisLevel.first(); if (pParent) _last = root = new XTreeWidgetItem(pParent, _last, pFlgrpid, cFlGroup, pFlgrpname, thisLevel.value("showbeg").toString(), thisLevel.value("showend").toString(), thisLevel.value("showdbcr").toString(), thisLevel.value("showbudget").toString(), thisLevel.value("showdiff").toString(), thisLevel.value("showcustom").toString(), thisLevel.value("summary").toString(), ( thisLevel.value("subtract").toBool() ? tr("-") : tr("+") ) ); else _last = root = new XTreeWidgetItem(_layout, _last, pFlgrpid, cFlGroup, pFlgrpname, thisLevel.value("showbeg").toString(), thisLevel.value("showend").toString(), thisLevel.value("showdbcr").toString(), thisLevel.value("showbudget").toString(), thisLevel.value("showdiff").toString(), thisLevel.value("showcustom").toString(), thisLevel.value("summary").toString(), ( thisLevel.value("subtract").toBool() ? tr("-") : tr("+") ) ); if ( (pFlgrpid == pId) && (pType == cFlGroup) ) { _layout->setCurrentItem(root); _layout->scrollToItem(root); } _lastStack.push(_last); _last = 0; } thisLevel.prepare( "SELECT flgrp_id AS id, :group AS type, flgrp_order AS orderby," " flgrp_name AS name," " '' AS showbeg," " '' AS showend," " '' AS showdbcr," " '' AS showbudget," " '' AS showdiff," " '' AS showcustom," " flgrp_subtract AS subtract " "FROM flgrp " "WHERE ( (flgrp_flgrp_id=:flgrp_id)" " AND (flgrp_flhead_id=:flhead_id) ) " "UNION SELECT flitem_id AS id, :item AS type, flitem_order AS orderby," " formatflitemdescrip(flitem_id) AS name," " formatBoolYN(flitem_showstart) AS showbeg," " formatBoolYN(flitem_showend) AS showend," " formatBoolYN(flitem_showdelta) AS showdbcr," " formatBoolYN(flitem_showbudget) AS showbudget," " formatBoolYN(flitem_showdiff) AS showdiff," " CASE WHEN(NOT flitem_showcustom) THEN formatBoolYN(flitem_showcustom)" " WHEN(flitem_custom_source='S') THEN text('BB')" " WHEN(flitem_custom_source='E') THEN text('EB')" " WHEN(flitem_custom_source='D') THEN text('DB')" " WHEN(flitem_custom_source='C') THEN text('CR')" " WHEN(flitem_custom_source='B') THEN text('BU')" " WHEN(flitem_custom_source='F') THEN text('DI')" " ELSE flitem_custom_source" " END AS showcustom," " flitem_subtract AS subtract " "FROM flitem " "WHERE (flitem_flgrp_id=:flgrp_id) " "UNION SELECT flspec_id AS id, :spec AS type, flspec_order AS orderby," " flspec_name AS name," " formatBoolYN(flspec_showstart) AS showbeg," " formatBoolYN(flspec_showend) AS showend," " formatBoolYN(flspec_showdelta) AS showdbcr," " formatBoolYN(flspec_showbudget) AS showbudget," " formatBoolYN(flspec_showdiff) AS showdiff," " CASE WHEN(NOT flspec_showcustom) THEN formatBoolYN(flspec_showcustom)" " WHEN(flspec_custom_source='S') THEN text('BB')" " WHEN(flspec_custom_source='E') THEN text('EB')" " WHEN(flspec_custom_source='D') THEN text('DB')" " WHEN(flspec_custom_source='C') THEN text('CR')" " WHEN(flspec_custom_source='B') THEN text('BU')" " WHEN(flspec_custom_source='F') THEN text('DI')" " ELSE flspec_custom_source" " END AS showcustom," " flspec_subtract AS subtract " "FROM flspec " "WHERE (flspec_flgrp_id=:flgrp_id) " "ORDER BY orderby;" ); thisLevel.bindValue(":group", cFlGroup); thisLevel.bindValue(":item", cFlItem); thisLevel.bindValue(":spec", cFlSpec); thisLevel.bindValue(":flgrp_id", pFlgrpid); thisLevel.bindValue(":flhead_id", _flheadid); thisLevel.exec(); while (thisLevel.next()) { if (thisLevel.value("type").toInt() == cFlGroup) insertFlGroupAdHoc(thisLevel.value("id").toInt(), thisLevel.value("name").toString(), root, pId, pType); else if (pFlgrpid != -1) { _last = new XTreeWidgetItem( root, _last, thisLevel.value("id").toInt(), thisLevel.value("type").toInt(), thisLevel.value("name"), thisLevel.value("showbeg"), thisLevel.value("showend"), thisLevel.value("showdbcr"), thisLevel.value("showbudget"), thisLevel.value("showdiff"), thisLevel.value("showcustom"), "", ( thisLevel.value("subtract").toBool() ? tr("-") : tr("+") ) ); if ( (thisLevel.value("id").toInt() == pId) && (thisLevel.value("type").toInt() == pType) ) { _layout->setCurrentItem(_last); _layout->scrollToItem(root); } } } _last = _lastStack.pop(); } void financialLayout::sHandleButtons() { if (_layout->altId() == cFlRoot) { _addGroup->setEnabled(TRUE); _addAccount->setEnabled(FALSE); _addSpecial->setEnabled(FALSE); _edit->setEnabled(FALSE); _view->setEnabled(FALSE); _delete->setEnabled(FALSE); _moveUp->setEnabled(FALSE); _moveDown->setEnabled(FALSE); } else if (_layout->altId() == cFlGroup) { _addGroup->setEnabled(TRUE); _addAccount->setEnabled(TRUE); _edit->setEnabled(TRUE); _view->setEnabled(TRUE); _delete->setEnabled(TRUE); _moveUp->setEnabled(TRUE); _moveDown->setEnabled(TRUE); if (_adHoc->isChecked()) _addSpecial->setEnabled(TRUE); else _addSpecial->setEnabled(FALSE); } else if ((_layout->altId() == cFlItem) || (_layout->altId() == cFlSpec)) { _addGroup->setEnabled(FALSE); _addAccount->setEnabled(FALSE); _addSpecial->setEnabled(FALSE); _edit->setEnabled(TRUE); _view->setEnabled(TRUE); _delete->setEnabled(TRUE); _moveUp->setEnabled(TRUE); _moveDown->setEnabled(TRUE); } } void financialLayout::sHandleButtonsCol() { _editCol->setEnabled(TRUE); _viewCol->setEnabled(TRUE); _deleteCol->setEnabled(TRUE); } void financialLayout::sHandleSelection() { if ( (_mode == cEdit) || (_mode == cNew) ) _edit->animateClick(); } void financialLayout::sAddTopLevelGroup() { ParameterList params; params.append("mode", "new"); params.append("flhead_id", _flheadid); params.append("flgrp_flgrp_id", -1); if (_income->isChecked()) params.append("type", "income"); else if (_balance->isChecked()) params.append("type", "balance"); else if (_cash->isChecked()) params.append("type", "cash"); else if (_adHoc->isChecked()) params.append("type", "adHoc"); financialLayoutGroup newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void financialLayout::sAddGroup() { ParameterList params; params.append("mode", "new"); params.append("flhead_id", _flheadid); params.append("flgrp_flgrp_id", _layout->id()); if (_income->isChecked()) params.append("type", "income"); else if (_balance->isChecked()) params.append("type", "balance"); else if (_cash->isChecked()) params.append("type", "cash"); else if (_adHoc->isChecked()) params.append("type", "adHoc"); financialLayoutGroup newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void financialLayout::sAddAccount() { ParameterList params; params.append("mode", "new"); params.append("flhead_id", _flheadid); params.append("flgrp_id", _layout->id()); if (_income->isChecked()) params.append("type", "income"); else if (_balance->isChecked()) params.append("type", "balance"); else if (_cash->isChecked()) params.append("type", "cash"); else if (_adHoc->isChecked()) params.append("type", "adHoc"); financialLayoutItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void financialLayout::sAddSpecial() { ParameterList params; params.append("mode", "new"); params.append("flhead_id", _flheadid); params.append("flgrp_id", _layout->id()); financialLayoutSpecial newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void financialLayout::sEdit() { ParameterList params; params.append("mode", "edit"); this->sHandleEditOrView(params); } void financialLayout::sView() { ParameterList params; params.append("mode", "view"); this->sHandleEditOrView(params); } void financialLayout::sHandleEditOrView(ParameterList &rams) { bool ok = false; ParameterList params = rams; if(_layout->altId() == cFlGroup) { params.append("flgrp_id", _layout->id()); if (_income->isChecked()) params.append("type", "income"); else if (_balance->isChecked()) params.append("type", "balance"); else if (_cash->isChecked()) params.append("type", "cash"); else if (_adHoc->isChecked()) params.append("type", "adHoc"); financialLayoutGroup newdlg(this, "", TRUE); newdlg.set(params); ok = (newdlg.exec() != XDialog::Rejected); } else if(_layout->altId() == cFlItem) { params.append("flitem_id", _layout->id()); if (_income->isChecked()) params.append("type", "income"); else if (_balance->isChecked()) params.append("type", "balance"); else if (_cash->isChecked()) params.append("type", "cash"); else if (_adHoc->isChecked()) params.append("type", "adHoc"); financialLayoutItem newdlg(this, "", TRUE); newdlg.set(params); ok = (newdlg.exec() != XDialog::Rejected); } else if(_layout->altId() == cFlSpec) { params.append("flspec_id", _layout->id()); financialLayoutSpecial newdlg(this, "", TRUE); newdlg.set(params); ok = (newdlg.exec() != XDialog::Rejected); } if(ok) sFillList(); } void financialLayout::sDelete() { XSqlQuery financialDelete; if(_layout->altId() == cFlGroup) financialDelete.prepare("SELECT deleteFlgrp(:item_id) AS result;"); else if(_layout->altId() == cFlItem) financialDelete.prepare( "DELETE FROM flitem WHERE (flitem_id=:item_id);" ); else if(_layout->altId() == cFlSpec) financialDelete.prepare( "DELETE FROM flspec WHERE (flspec_id=:item_id);" ); financialDelete.bindValue(":item_id", _layout->id()); financialDelete.exec(); XTreeWidgetItem *item = _layout->currentItem(); if (0 != item) _layout->setCurrentItem(_layout->topLevelItem(_layout->indexOfTopLevelItem(item) - 1)); sFillList(); } void financialLayout::sMoveUp() { XSqlQuery financialMoveUp; if (_layout->altId() == cFlGroup) financialMoveUp.prepare("SELECT moveFlGroupUp(:item_id) AS result;"); else if (_layout->altId() == cFlItem) financialMoveUp.prepare("SELECT moveFlItemUp(:item_id) AS result;"); else if (_layout->altId() == cFlSpec) financialMoveUp.prepare("SELECT moveFlSpecUp(:item_id) AS result;"); financialMoveUp.bindValue(":item_id", _layout->id()); financialMoveUp.exec(); sFillList(); } void financialLayout::sMoveDown() { XSqlQuery financialMoveDown; if (_layout->altId() == cFlGroup) financialMoveDown.prepare("SELECT moveFlGroupDown(:item_id) AS result;"); else if (_layout->altId() == cFlItem) financialMoveDown.prepare("SELECT moveFlItemDown(:item_id) AS result;"); else if (_layout->altId() == cFlSpec) financialMoveDown.prepare("SELECT moveFlSpecDown(:item_id) AS result;"); financialMoveDown.bindValue(":item_id", _layout->id()); financialMoveDown.exec(); sFillList(); } void financialLayout::sSetType() { XSqlQuery financialSetType; //Check for column layout definitions and respond if ((_income->isChecked() && _cachedType != cIncome) || (_balance->isChecked() && _cachedType != cBalance) || (_cash->isChecked() && _cachedType != cCash) || (_adHoc->isChecked() && _cachedType != cAdHoc)) { financialSetType.prepare( "SELECT flcol_id FROM flcol WHERE (flcol_flhead_id=:flheadid); "); financialSetType.bindValue(":flheadid",_flheadid); financialSetType.exec(); if (financialSetType.first()) { QMessageBox::critical( this, tr("Cannot Change Type"), tr("All column layouts must be deleted before changing the type.") ); if (_cachedType == cAdHoc) _adHoc->setChecked(TRUE); else if (_cachedType == cIncome) _income->setChecked(TRUE); else if (_cachedType == cBalance) _balance->setChecked(TRUE); else if (_cachedType == cCash) _cash->setChecked(TRUE); return; } } //Check to see if groups and items are defined, if so warn about changes if ((_income->isChecked() && _cachedType != cIncome) || (_balance->isChecked() && _cachedType != cBalance) || (_cash->isChecked() && _cachedType != cCash)) { financialSetType.prepare( "SELECT flgrp_id FROM flgrp WHERE (flgrp_flhead_id=:flheadid) " "UNION " "SELECT flitem_id FROM flitem WHERE (flitem_flhead_id=:flheadid) " "UNION " "SELECT flhead_id FROM flhead WHERE (flhead_id=:flheadid);"); financialSetType.bindValue(":flheadid",_flheadid); financialSetType.exec(); if (financialSetType.first()) { if ( QMessageBox::warning( this, tr("Report type changed"), tr( "Existing row definitions will be changed.\n" "Group percentage settings will be reset.\n" "Continue?" ), tr("Yes"), tr("No"), QString::null ) == 1 ) { if (_cachedType == cAdHoc) _adHoc->setChecked(TRUE); else if (_cachedType == cIncome) _income->setChecked(TRUE); else if (_cachedType == cBalance) _balance->setChecked(TRUE); else if (_cachedType == cCash) _cash->setChecked(TRUE); return; } else { _showTotal->setChecked(FALSE); financialSetType.prepare("UPDATE flgrp " " SET flgrp_showstart=false,flgrp_showend=:showend,flgrp_showdelta=:showdelta," " flgrp_showbudget=true,flgrp_showdiff=:showdiff,flgrp_showcustom=false," " flgrp_showstartprcnt=false,flgrp_showendprcnt=false,flgrp_showdeltaprcnt=false," " flgrp_showbudgetprcnt=false,flgrp_showdiffprcnt=false,flgrp_showcustomprcnt=false" " WHERE (flgrp_flhead_id=:flhead_id); " " UPDATE flitem " " SET flitem_showstart=false,flitem_showend=:showend,flitem_showdelta=:showdelta," " flitem_showbudget=true,flitem_showdiff=:showdiff,flitem_showcustom=false," " flitem_showstartprcnt=false,flitem_showendprcnt=false,flitem_showdeltaprcnt=false," " flitem_showbudgetprcnt=false,flitem_showdiffprcnt=false,flitem_showcustomprcnt=false" " WHERE (flitem_flhead_id=:flhead_id); " " UPDATE flhead " " SET flhead_type=:type,flhead_showtotal=false," " flhead_showstart=false,flhead_showend=false,flhead_showdelta=false," " flhead_showbudget=true,flhead_showdiff=false,flhead_showcustom=false," " flhead_custom_label=NULL,flhead_usealttotal=false,flhead_alttotal=NULL," " flhead_usealtbegin=false,flhead_altbegin=NULL,flhead_usealtend=false," " flhead_altend=NULL,flhead_usealtdebits=false,flhead_altdebits=NULL," " flhead_usealtcredits=false,flhead_altcredits=NULL,flhead_usealtbudget=false," " flhead_altbudget=NULL,flhead_usealtdiff=false,flhead_altdiff=NULL" " WHERE (flhead_id=:flhead_id);"); if (_income->isChecked()) { financialSetType.bindValue(":showend","false"); financialSetType.bindValue(":showdelta","false"); financialSetType.bindValue(":showdiff","true"); financialSetType.bindValue(":type","I"); _cachedType=cIncome; } else if (_balance->isChecked()) { financialSetType.bindValue(":showend","true"); financialSetType.bindValue(":showdelta","false"); financialSetType.bindValue(":showdiff","false"); financialSetType.bindValue(":type","B"); _cachedType=cBalance; } if (_cash->isChecked()) { financialSetType.bindValue(":showend","false"); financialSetType.bindValue(":showdelta","true"); financialSetType.bindValue(":showdiff","true"); financialSetType.bindValue(":type","C"); _cachedType=cCash; } financialSetType.bindValue(":flhead_id",_flheadid); financialSetType.exec(); } } } if ((_layout->columnCount() == 1) || ((_layout->columnCount() <= 4) && (_adHoc->isChecked())) || ((_layout->columnCount() > 4) && (!_adHoc->isChecked())) ) { _layout->clear(); _layout->setColumnCount(1); if ( _adHoc->isChecked() ) { _tab->setTabEnabled(1,FALSE); _showTotal->setHidden(FALSE); _showGrandTotal->setHidden(TRUE); _addSpecial->setHidden(FALSE); _altBegin->setHidden(FALSE); _altBeginText->setHidden(FALSE); _altEnd->setHidden(FALSE); _altEndText->setHidden(FALSE); _customText->setHidden(FALSE); _altDiff->setHidden(FALSE); _altDiffText->setHidden(FALSE); _customLit->setHidden(FALSE); _cachedType=cAdHoc; _layout->addColumn( tr("Show\nBeg'ng"), _ynColumn, Qt::AlignCenter ); _layout->addColumn( tr("Show\nEnd"), _ynColumn, Qt::AlignCenter ); _layout->addColumn( tr("Show\nDb/Cr"), _ynColumn, Qt::AlignCenter ); _layout->addColumn( tr("Show\nBudget"), _ynColumn, Qt::AlignCenter ); _layout->addColumn( tr("Show\nDiff."), _ynColumn, Qt::AlignCenter ); _layout->addColumn( tr("Show\nCustom"), _ynColumn, Qt::AlignCenter ); } else { _tab->setTabEnabled(1,TRUE); _showTotal->setHidden(TRUE); _showGrandTotal->setHidden(FALSE); _addSpecial->setHidden(TRUE); _altBegin->setHidden(TRUE); _altBeginText->setHidden(TRUE); _altEnd->setHidden(TRUE); _altEndText->setHidden(TRUE); _altDiff->setHidden(TRUE); _altDiffText->setHidden(TRUE); _customText->setHidden(TRUE); _customLit->setHidden(TRUE); } _layout->addColumn( tr("Sub./Summ."), _dateColumn, Qt::AlignCenter ); _layout->addColumn( tr("Oper."), _ynColumn, Qt::AlignCenter ); sFillList(); } //Change the display if necessary if ((_cachedType == cCash) || (_cachedType == cAdHoc)) { _altDebits->setHidden(FALSE); _altDebitsText->setHidden(FALSE); _altCredits->setHidden(FALSE); _altCreditsText->setHidden(FALSE); } else { _altDebits->setHidden(TRUE); _altDebitsText->setHidden(TRUE); _altCredits->setHidden(TRUE); _altCreditsText->setHidden(TRUE); } } void financialLayout::sAddCol() { ParameterList params; params.append("mode", "new"); params.append("flhead_id", _flheadid); if (_income->isChecked()) params.append("type", "income"); if (_balance->isChecked()) params.append("type", "balance"); if (_cash->isChecked()) params.append("type", "cash"); if (_adHoc->isChecked()) params.append("type", "adhoc"); financialLayoutColumns newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void financialLayout::sEditCol() { bool ok = false; ParameterList params; if ( (_mode == cEdit) || (_mode == cNew) ) params.append("mode", "edit"); else params.append("mode", "view"); params.append("flhead_id", _flheadid); params.append("flcol_id", _layouts->id()); if (_income->isChecked()) params.append("type", "income"); if (_balance->isChecked()) params.append("type", "balance"); if (_cash->isChecked()) params.append("type", "cash"); if (_adHoc->isChecked()) params.append("type", "adhoc"); financialLayoutColumns newdlg(this, "", TRUE); newdlg.set(params); ok = (newdlg.exec() != XDialog::Rejected); if(ok) sFillList(); } void financialLayout::sDeleteCol() { XSqlQuery financialDeleteCol; financialDeleteCol.prepare( "DELETE FROM flcol WHERE (flcol_id=:flcol_id);" ); financialDeleteCol.bindValue(":flcol_id", _layouts->id()); financialDeleteCol.exec(); XTreeWidgetItem *item = _layout->currentItem(); if(0 != item) _layout->setCurrentItem(_layout->topLevelItem(_layout->indexOfTopLevelItem(item) - 1)); sFillList(); } void financialLayout::sUncheckAltGrandTotal() { if ((!_showTotal->isChecked()) && (!_showGrandTotal->isChecked())) _altTotal->setChecked(FALSE); } void financialLayout::reject() { XSqlQuery financialreject; if(cNew == _mode) { financialreject.prepare("DELETE FROM flspec WHERE flspec_flhead_id=:flhead_id;" "DELETE FROM flitem WHERE flitem_flhead_id=:flhead_id;" "DELETE FROM flgrp WHERE flgrp_flhead_id=:flhead_id;" "DELETE FROM flhead WHERE flhead_id=:flhead_id;"); financialreject.bindValue(":flhead_id", _flheadid); financialreject.exec(); } XDialog::reject(); } qt-client-4.1.0/guiclient/financialLayout.h000066400000000000000000000040641217451700100206740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FINANCIALLAYOUT_H #define FINANCIALLAYOUT_H #include "guiclient.h" #include "xdialog.h" #include #include #include "ui_financialLayout.h" class financialLayout : public XDialog, public Ui::financialLayout { Q_OBJECT public: financialLayout(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~financialLayout(); virtual void insertFlGroup( int pFlgrpid, QString pFlgrpname, XTreeWidgetItem * pParent, int pId, int pType ); virtual void insertFlGroupAdHoc( int pFlgrpid, QString pFlgrpname, XTreeWidgetItem * pParent, int pId, int pType ); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void populate(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sHandleSelection(); virtual void sAddTopLevelGroup(); virtual void sAddGroup(); virtual void sAddAccount(); virtual void sAddSpecial(); virtual void sEdit(); virtual void sView(); virtual void sHandleEditOrView(ParameterList&); virtual void sDelete(); virtual void sMoveUp(); virtual void sMoveDown(); virtual void sSetType(); virtual void reject(); virtual void sHandleButtonsCol(); virtual void sAddCol(); virtual void sEditCol(); virtual void sDeleteCol(); virtual void sUncheckAltGrandTotal(); protected slots: virtual void languageChange(); virtual void sSave(); private: XTreeWidgetItem * _last; QStack _lastStack; int _flheadid; int _mode; int _cachedType; }; #endif // FINANCIALLAYOUT_H qt-client-4.1.0/guiclient/financialLayout.ui000066400000000000000000000760231217451700100210660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. financialLayout 0 0 797 653 Financial Report 12 5 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _descrip Active true Qt::Horizontal QSizePolicy::Expanding 91 20 Report Type 12 &Income Statement true &Balance Sheet &Cash Flow &Ad Hoc false Qt::Horizontal 0 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 1 0 Row Layout 0 1 QFrame::NoFrame QFrame::Plain 0 0 5 0 5 Add Top Level Group 0 false &Add Group false Add Account false Add Special false Edit false &View false Delete 0 false &Move Up false &Move Down Qt::Vertical QSizePolicy::Expanding 20 20 Column Layouts &Add false &Edit false &View false &Delete Qt::Vertical 20 40 Options 0 70 Show Grand Total true false 6 Show Custom true Show Budget true Show Ending true Show Difference true Show Debits/Credits true Show Beginning true Show Grand Total Alternate Labels 0 Alternate Begining Balance: false Alternate Ending Balance: false Alternate Debits: false Alternate Credits: false Alternate Budget: false Alternate Difference: false false Alternate Grand Total: false Alternate Custom Label: _customText true Qt::Vertical QSizePolicy::Expanding 550 20 Notes XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    XTextEdit QTextEdit
    xtextedit.h
    _name _active _descrip _income _balance _cash _adHoc _tab _addTopLevelGroup _addGroup _addAccount _addSpecial _edit _delete _moveUp _moveDown _layout _addCol _editCol _deleteCol _layouts _showStart _showEnd _showDelta _showBudget _showDiff _showCustom _showGrandTotal _altBegin _altBeginText _altEnd _altEndText _altDebits _altDebitsText _altCredits _altCreditsText _altBudget _altBudgetText _altDiff _altDiffText _altTotal _altTotalText _customText _altBegin toggled(bool) _altBeginText setEnabled(bool) 115 325 380 325 _altEnd toggled(bool) _altEndText setEnabled(bool) 115 349 380 349 _altDebits toggled(bool) _altDebitsText setEnabled(bool) 115 373 380 373 _altCredits toggled(bool) _altCreditsText setEnabled(bool) 115 397 380 404 _altDiff toggled(bool) _altDiffText setEnabled(bool) 115 445 380 445 _altBudget toggled(bool) _altBudgetText setEnabled(bool) 115 421 380 421 _altTotal toggled(bool) _altTotalText setEnabled(bool) 115 469 380 469 _showGrandTotal toggled(bool) _altTotal setEnabled(bool) 299 275 115 469 _showTotal toggled(bool) _altTotal setEnabled(bool) 299 224 115 469 _buttonBox rejected() financialLayout reject() 745 92 399 339
    qt-client-4.1.0/guiclient/financialLayoutColumns.cpp000066400000000000000000000267631217451700100226020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "financialLayoutColumns.h" #include #include #include #include #include #include financialLayoutColumns::financialLayoutColumns(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_month, SIGNAL(toggled(bool)), this, SLOT(sToggleMonth())); connect(_quarter, SIGNAL(toggled(bool)), this, SLOT(sToggleQuarter())); connect(_year, SIGNAL(toggled(bool)), this, SLOT(sToggleYear())); connect(_fullmonth, SIGNAL(toggled(bool)), this, SLOT(sTogglePrior())); connect(_fullquarter, SIGNAL(toggled(bool)), this, SLOT(sTogglePrior())); connect(_fullyear, SIGNAL(toggled(bool)), this, SLOT(sTogglePrior())); connect(_yeartodate, SIGNAL(toggled(bool)), this, SLOT(sTogglePrior())); connect(_fullyear, SIGNAL(toggled(bool)), this, SLOT(sToggleYearToDate())); connect(_yeartodate, SIGNAL(toggled(bool)), this, SLOT(sToggleFullYear())); languageChange(); } financialLayoutColumns::~financialLayoutColumns() { // no need to delete child widgets, Qt does it all for us } void financialLayoutColumns::languageChange() { retranslateUi(this); } enum SetResponse financialLayoutColumns::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("flhead_id", &valid); if (valid) { _flheadid = param.toInt(); } param = pParams.value("flcol_id", &valid); if (valid) { _flcolid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; populate(); } else if (param.toString() == "view") { _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _report->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); _selected->setEnabled(FALSE); _prior->setEnabled(FALSE); _budget->setEnabled(FALSE); _showdb->setEnabled(FALSE); } } param = pParams.value("type", &valid); if (valid) { if (param.toString() == "balance") { _month->setChecked(TRUE); _month->setEnabled(FALSE); _fullmonth->setEnabled(TRUE); _fullquarter->setEnabled(TRUE); _fullyear->setEnabled(TRUE); _yeartodate->setEnabled(TRUE); _quarter->setHidden(TRUE); _year->setHidden(TRUE); _yeartodate->setHidden(TRUE); _fullmonth->setText(tr("Month End")); _fullquarter->setText(tr("Quarter End")); _fullyear->setText(tr("Year End")); } if (param.toString() != "cash") _showdb->setHidden(TRUE); } return NoError; } void financialLayoutColumns::sSave() { XSqlQuery financialSave; QString sql; if ((!_month->isChecked()) && (!_quarter->isChecked()) && (!_year->isChecked())) { QMessageBox::critical( this, tr("Cannot Save settings"), tr("

    At least one of Month, Date or Year must be selected.") ); return; } if (_mode == cNew) { financialSave.exec("SELECT NEXTVAL('flcol_flcol_id_seq') AS flcol_id;"); if (financialSave.first()) _flcolid = financialSave.value("flcol_id").toInt(); else if (financialSave.lastError().type() != QSqlError::NoError) { systemError(this, financialSave.lastError().databaseText(), __FILE__, __LINE__); return; } sql = ( "INSERT INTO flcol " "(flcol_id,flcol_flhead_id,flcol_name,flcol_descrip," "flcol_report_id,flcol_month,flcol_quarter,flcol_year," "flcol_showdb,flcol_prcnt,flcol_priortype,flcol_priormonth," "flcol_priorquarter,flcol_prioryear,flcol_priorprcnt," "flcol_priordiff,flcol_priordiffprcnt,flcol_budget," "flcol_budgetprcnt,flcol_budgetdiff,flcol_budgetdiffprcnt) " "VALUES " "(:flcol_id,:flcol_flhead_id,:flcol_name,:flcol_descrip," ":flcol_report_id,:flcol_month,:flcol_quarter,:flcol_year," ":flcol_showdb,:flcol_prcnt,:flcol_priortype,:flcol_priormonth," ":flcol_priorquarter,:flcol_prioryear,:flcol_priorprcnt," ":flcol_priordiff,:flcol_priordiffprcnt,:flcol_budget," ":flcol_budgetprcnt,:flcol_budgetdiff,:flcol_budgetdiffprcnt);" ); } else if (_mode == cEdit) { sql = ("UPDATE flcol " "SET flcol_name=:flcol_name,flcol_descrip=:flcol_descrip," "flcol_report_id=:flcol_report_id,flcol_month=:flcol_month," "flcol_quarter=:flcol_quarter,flcol_year=:flcol_year," "flcol_showdb=:flcol_showdb,flcol_prcnt=:flcol_prcnt," "flcol_priortype=:flcol_priortype,flcol_priormonth=:flcol_priormonth," "flcol_priorquarter=:flcol_priorquarter," "flcol_prioryear=:flcol_prioryear,flcol_priorprcnt=:flcol_priorprcnt," "flcol_priordiff=:flcol_priordiff,flcol_priordiffprcnt=:flcol_priordiffprcnt," "flcol_budget=:flcol_budget,flcol_budgetprcnt=:flcol_budgetprcnt," "flcol_budgetdiff=:flcol_budgetdiff,flcol_budgetdiffprcnt=:flcol_budgetdiffprcnt" " WHERE (flcol_id=:flcol_id);"); } financialSave.prepare(sql); financialSave.bindValue(":flcol_id", _flcolid); financialSave.bindValue(":flcol_flhead_id", _flheadid); financialSave.bindValue(":flcol_name", _name->text()); financialSave.bindValue(":flcol_descrip", _descrip->text()); financialSave.bindValue(":flcol_report_id", _report->id()); financialSave.bindValue(":flcol_month", _month->isChecked()); financialSave.bindValue(":flcol_quarter", _quarter->isChecked()); financialSave.bindValue(":flcol_year", _year->isChecked()); financialSave.bindValue(":flcol_showdb", _showdb->isChecked()); financialSave.bindValue(":flcol_prcnt", _prcnt->isChecked()); if (_priorperiod->isChecked()) financialSave.bindValue(":flcol_priortype", "P"); else financialSave.bindValue(":flcol_priortype", "Y"); financialSave.bindValue(":flcol_priormonth", _fullmonth->isChecked()); financialSave.bindValue(":flcol_priorquarter", _fullquarter->isChecked()); if (_fullyear->isChecked()) financialSave.bindValue(":flcol_prioryear", "F"); else if (_yeartodate->isChecked()) financialSave.bindValue(":flcol_prioryear", "D"); else financialSave.bindValue(":flcol_prioryear", "N"); financialSave.bindValue(":flcol_priorprcnt", _priorprcnt->isChecked()); financialSave.bindValue(":flcol_priordiff", _priordiff->isChecked()); financialSave.bindValue(":flcol_priordiffprcnt", _priordiffprcnt->isChecked()); financialSave.bindValue(":flcol_budget", _budget->isChecked()); if (_budget->isChecked()) { financialSave.bindValue(":flcol_budgetprcnt", _budgetprcnt->isChecked()); financialSave.bindValue(":flcol_budgetdiff", _budgetdiff->isChecked()); financialSave.bindValue(":flcol_budgetdiffprcnt", _budgetdiffprcnt->isChecked()); } else { financialSave.bindValue(":flcol_budgetprcnt", false); financialSave.bindValue(":flcol_budgetdiff", false); financialSave.bindValue(":flcol_budgetdiffprcnt", false); } financialSave.exec(); if (financialSave.lastError().type() != QSqlError::NoError) { systemError(this, financialSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_flcolid); } void financialLayoutColumns::populate() { XSqlQuery financialpopulate; financialpopulate.prepare( "SELECT * " "FROM flcol " "WHERE (flcol_id=:flcol_id);" ); financialpopulate.bindValue(":flcol_id", _flcolid); financialpopulate.exec(); if (financialpopulate.first()) { _name->setText(financialpopulate.value("flcol_name")); _descrip->setText(financialpopulate.value("flcol_descrip")); _report->setId(financialpopulate.value("flcol_report_id").toInt()); _month->setChecked(financialpopulate.value("flcol_month").toBool()); _quarter->setChecked(financialpopulate.value("flcol_quarter").toBool()); _year->setChecked(financialpopulate.value("flcol_year").toBool()); _showdb->setChecked(financialpopulate.value("flcol_showdb").toBool()); _prcnt->setChecked(financialpopulate.value("flcol_prcnt").toBool()); if (financialpopulate.value("flcol_priortype").toString() == "P") _priorperiod->setChecked(true); else _prioryear->setChecked(true); _fullmonth->setChecked(financialpopulate.value("flcol_priormonth").toBool()); _fullquarter->setChecked(financialpopulate.value("flcol_priorquarter").toBool()); if (financialpopulate.value("flcol_prioryear").toString() == "F") { _fullyear->setChecked(true); _yeartodate->setChecked(false); } else if (financialpopulate.value("flcol_prioryear").toString() == "D") { _yeartodate->setChecked(true); _fullyear->setChecked(false); } else { _fullyear->setChecked(false); _yeartodate->setChecked(false); } _priorprcnt->setChecked(financialpopulate.value("flcol_priorprcnt").toBool()); _priordiff->setChecked(financialpopulate.value("flcol_priordiff").toBool()); _priordiffprcnt->setChecked(financialpopulate.value("flcol_priordiffprcnt").toBool()); _budget->setChecked(financialpopulate.value("flcol_budget").toBool()); _budgetprcnt->setChecked(financialpopulate.value("flcol_budgetprcnt").toBool()); _budgetdiff->setChecked(financialpopulate.value("flcol_budgetdiff").toBool()); _budgetdiffprcnt->setChecked(financialpopulate.value("flcol_budgetdiffprcnt").toBool()); } else if (financialpopulate.lastError().type() != QSqlError::NoError) { systemError(this, financialpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void financialLayoutColumns::sToggleMonth() { if (!_month->isChecked()) { _fullmonth->setChecked(FALSE); _fullmonth->setEnabled(FALSE); } else _fullmonth->setEnabled(TRUE); } void financialLayoutColumns::sToggleQuarter() { if (!_quarter->isChecked()) { _fullquarter->setChecked(FALSE); _fullquarter->setEnabled(FALSE); } else _fullquarter->setEnabled(TRUE); } void financialLayoutColumns::sToggleYear() { if (!_year->isChecked()) { _fullyear->setChecked(FALSE); _yeartodate->setChecked(FALSE); _fullyear->setEnabled(FALSE); _yeartodate->setEnabled(FALSE); } else { _fullyear->setEnabled(TRUE); _yeartodate->setEnabled(TRUE); } } void financialLayoutColumns::sTogglePrior() { if ((_fullmonth->isChecked()) || (_fullquarter->isChecked()) || (_fullyear->isChecked()) || (_yeartodate->isChecked())) { _priorprcnt->setEnabled(TRUE); _priordiff->setEnabled(TRUE); _priordiffprcnt->setEnabled(TRUE); } else { _priorprcnt->setChecked(FALSE); _priordiff->setChecked(FALSE); _priordiffprcnt->setChecked(FALSE); _priorprcnt->setEnabled(FALSE); _priordiff->setEnabled(FALSE); _priordiffprcnt->setEnabled(FALSE); } } void financialLayoutColumns::sToggleYearToDate() { if (_fullyear->isChecked()) _yeartodate->setChecked(false); } void financialLayoutColumns::sToggleFullYear() { if (_yeartodate->isChecked()) _fullyear->setChecked(false); } qt-client-4.1.0/guiclient/financialLayoutColumns.h000066400000000000000000000025201217451700100222300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FINANCIALLAYOUTCOLUMNS_H #define FINANCIALLAYOUTCOLUMNS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_financialLayoutColumns.h" class financialLayoutColumns : public XDialog, public Ui::financialLayoutColumns { Q_OBJECT public: financialLayoutColumns(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~financialLayoutColumns(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sToggleMonth(); virtual void sToggleQuarter(); virtual void sToggleYear(); virtual void sTogglePrior(); virtual void sToggleYearToDate(); virtual void sToggleFullYear(); protected slots: virtual void languageChange(); private: int _mode; int _flheadid; int _flcolid; }; #endif // FINANCIALLAYOUTCOLUMNS_H qt-client-4.1.0/guiclient/financialLayoutColumns.ui000066400000000000000000000323351217451700100224250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. financialLayoutColumns 0 0 609 361 Column Layout Name Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Description Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Report Template Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 150 0 XComboBox::Reports true &Edit Qt::Horizontal 141 20 Selected Period 0 Month true Quarter Year 0 Show Debits and Credits % of Group Total Qt::Vertical 20 0 Prior false false 0 Period true Year 0 Full Month true false Full Quarter false Full Year false Year To Date 0 % of Group Total Difference % Difference Qt::Vertical 20 0 Budget true false 0 % of Group Total Difference % Difference Qt::Vertical 20 0 XComboBox QComboBox

    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _name _descrip _report _edit _month _quarter _year _showdb _prcnt _priorperiod _prioryear _fullmonth _fullquarter _fullyear _yeartodate _priorprcnt _priordiff _priordiffprcnt _budgetprcnt _budgetdiff _budgetdiffprcnt _buttonBox accepted() financialLayoutColumns accept() 721 180 233 29 _buttonBox rejected() financialLayoutColumns reject() 721 180 197 125 _month toggled(bool) _fullmonth setEnabled(bool) 110 165 285 206 qt-client-4.1.0/guiclient/financialLayoutGroup.cpp000066400000000000000000000376601217451700100222540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "financialLayoutGroup.h" #include #define cIncome 0 #define cBalance 1 #define cCash 2 #define cAdHoc 3 financialLayoutGroup::financialLayoutGroup(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_showSubtotal, SIGNAL(toggled(bool)), this, SLOT(sToggled())); connect(_summarize, SIGNAL(toggled(bool)), this, SLOT(sToggled())); connect(_summarize, SIGNAL(toggled(bool)), _showSubtotal, SLOT(setDisabled(bool))); connect(_showBudget, SIGNAL(toggled(bool)), _showBudgetPrcnt, SLOT(setEnabled(bool))); connect(_showDelta, SIGNAL(toggled(bool)), _showDeltaPrcnt, SLOT(setEnabled(bool))); connect(_showEnd, SIGNAL(toggled(bool)), _showEndPrcnt, SLOT(setEnabled(bool))); connect(_showStart, SIGNAL(toggled(bool)), _showStartPrcnt, SLOT(setEnabled(bool))); connect(_showDiff, SIGNAL(toggled(bool)), _showDiffPrcnt, SLOT(setEnabled(bool))); connect(_showCustom, SIGNAL(toggled(bool)), _showCustomPrcnt, SLOT(setEnabled(bool))); connect(_showPrcnt, SIGNAL(toggled(bool)), this, SLOT(sToggleShowPrcnt())); } financialLayoutGroup::~financialLayoutGroup() { // no need to delete child widgets, Qt does it all for us } void financialLayoutGroup::languageChange() { retranslateUi(this); } enum SetResponse financialLayoutGroup::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("flhead_id", &valid); if (valid) { _flheadid = param.toInt(); sFillGroupList(); } param = pParams.value("flgrp_flgrp_id", &valid); if (valid) _flgrp_flgrpid = param.toInt(); param = pParams.value("flgrp_id", &valid); if (valid) { _flgrpid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); _name->setEnabled(FALSE); _description->setEnabled(FALSE); _subSummGroup->setEnabled(FALSE); _operationGroup->setEnabled(FALSE); } } param = pParams.value("type", &valid); if (valid) { if (param.toString() == "adHoc") { _rpttype = cAdHoc; _showPrcnt->setHidden(TRUE); } else { _showStart->setHidden(TRUE); _showEnd->setHidden(TRUE); _showDelta->setHidden(TRUE); _showBudget->setHidden(TRUE); _showDiff->setHidden(TRUE); _showCustom->setHidden(TRUE); _showStartPrcnt->setHidden(TRUE); _showEndPrcnt->setHidden(TRUE); _showDeltaPrcnt->setHidden(TRUE); _showBudgetPrcnt->setHidden(TRUE); _showDiffPrcnt->setHidden(TRUE); _showCustomPrcnt->setHidden(TRUE); } if (param.toString() == "income") { _rpttype = cIncome; _showPrcnt->setHidden(FALSE); _showStart->setChecked(FALSE); _showEnd->setChecked(FALSE); _showDelta->setChecked(FALSE); _showBudget->setChecked(TRUE); _showDiff->setChecked(TRUE); } else if (param.toString() == "balance") { _rpttype = cBalance; _showPrcnt->setHidden(FALSE); _showStart->setChecked(FALSE); _showEnd->setChecked(TRUE); _showDelta->setChecked(FALSE); _showBudget->setChecked(TRUE); _showDiff->setChecked(FALSE); } else if (param.toString() == "cash") { _rpttype = cCash; _showPrcnt->setHidden(FALSE); _showStart->setChecked(FALSE); _showEnd->setChecked(FALSE); _showDelta->setChecked(TRUE); _showBudget->setChecked(TRUE); _showDiff->setChecked(TRUE); } } return NoError; } void financialLayoutGroup::sCheck() { } void financialLayoutGroup::sSave() { XSqlQuery financialSave; int order = 1; if (_mode == cNew) { financialSave.prepare("SELECT COALESCE(MAX(ord),0) + 1 AS neworder" " FROM (SELECT flgrp_order AS ord" " FROM flgrp" " WHERE ((flgrp_flgrp_id=:flgrp_id)" " AND (flgrp_flhead_id=:flhead_id))" " UNION" " SELECT flitem_order AS ord" " FROM flitem" " WHERE ((flitem_flgrp_id=:flgrp_id)" " AND (flitem_flhead_id=:flhead_id))" " UNION" " SELECT flspec_order AS ord" " FROM flspec" " WHERE ((flspec_flgrp_id=:flgrp_id)" " AND (flspec_flhead_id=:flhead_id)) ) AS data;" ); financialSave.bindValue(":flgrp_id", _flgrp_flgrpid); financialSave.bindValue(":flhead_id", _flheadid); financialSave.exec(); if(financialSave.first()) order = financialSave.value("neworder").toInt(); } if (_mode == cNew) { financialSave.exec("SELECT NEXTVAL('flgrp_flgrp_id_seq') AS flgrp_id;"); if (financialSave.first()) _flgrpid = financialSave.value("flgrp_id").toInt(); financialSave.prepare( "INSERT INTO flgrp " "( flgrp_id, flgrp_flhead_id, flgrp_flgrp_id, flgrp_name, flgrp_descrip, flgrp_order, flgrp_subtotal," " flgrp_summarize, flgrp_subtract, flgrp_showstart, flgrp_showend, flgrp_showdelta, flgrp_showbudget, flgrp_showdiff, flgrp_showcustom," " flgrp_showstartprcnt, flgrp_showendprcnt, flgrp_showdeltaprcnt, flgrp_showbudgetprcnt, flgrp_showdiffprcnt, flgrp_showcustomprcnt," " flgrp_prcnt_flgrp_id, flgrp_usealtsubtotal, flgrp_altsubtotal ) " "VALUES " "( :flgrp_id, :flgrp_flhead_id, :flgrp_flgrp_id, :flgrp_name, :flgrp_descrip, :flgrp_order, :flgrp_subtotal," " :flgrp_summarize, :flgrp_subtract, :flgrp_showstart, :flgrp_showend, :flgrp_showdelta, :flgrp_showbudget, :flgrp_showdiff, :flgrp_showcustom," " :flgrp_showstartprcnt, :flgrp_showendprcnt, :flgrp_showdeltaprcnt, :flgrp_showbudgetprcnt, :flgrp_showdiffprcnt, :flgrp_showcustomprcnt," " :flgrp_prcnt_flgrp_id, :flgrp_usealtsubtotal, :flgrp_altsubtotal );" ); } else if (_mode == cEdit) financialSave.prepare( "UPDATE flgrp " "SET flgrp_name=:flgrp_name, flgrp_descrip=:flgrp_descrip," " flgrp_subtotal=:flgrp_subtotal," " flgrp_summarize=:flgrp_summarize," " flgrp_subtract=:flgrp_subtract," " flgrp_showstart=:flgrp_showstart," " flgrp_showend=:flgrp_showend," " flgrp_showdelta=:flgrp_showdelta," " flgrp_showbudget=:flgrp_showbudget," " flgrp_showdiff=:flgrp_showdiff," " flgrp_showcustom=:flgrp_showcustom," " flgrp_showstartprcnt=:flgrp_showstartprcnt," " flgrp_showendprcnt=:flgrp_showendprcnt," " flgrp_showdeltaprcnt=:flgrp_showdeltaprcnt," " flgrp_showbudgetprcnt=:flgrp_showbudgetprcnt," " flgrp_showdiffprcnt=:flgrp_showdiffprcnt," " flgrp_showcustomprcnt=:flgrp_showcustomprcnt," " flgrp_prcnt_flgrp_id=:flgrp_prcnt_flgrp_id," " flgrp_usealtsubtotal=:flgrp_usealtsubtotal," " flgrp_altsubtotal=:flgrp_altsubtotal " "WHERE (flgrp_id=:flgrp_id);" ); financialSave.bindValue(":flgrp_id", _flgrpid); financialSave.bindValue(":flgrp_flgrp_id", _flgrp_flgrpid); financialSave.bindValue(":flgrp_flhead_id", _flheadid); financialSave.bindValue(":flgrp_name", _name->text()); financialSave.bindValue(":flgrp_descrip", _description->text()); financialSave.bindValue(":flgrp_order", order); financialSave.bindValue(":flgrp_subtotal", QVariant(_showSubtotal->isChecked())); financialSave.bindValue(":flgrp_summarize", QVariant(_summarize->isChecked())); financialSave.bindValue(":flgrp_subtract", QVariant(_subtract->isChecked())); financialSave.bindValue(":flgrp_showstart", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showStart->isChecked()))); financialSave.bindValue(":flgrp_showend", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showEnd->isChecked()))); financialSave.bindValue(":flgrp_showdelta", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showDelta->isChecked()))); financialSave.bindValue(":flgrp_showbudget", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showBudget->isChecked()))); financialSave.bindValue(":flgrp_showdiff", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showDiff->isChecked()))); financialSave.bindValue(":flgrp_showcustom", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showCustom->isChecked()))); financialSave.bindValue(":flgrp_showstartprcnt", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showStart->isChecked() && _showStartPrcnt->isChecked()))); financialSave.bindValue(":flgrp_showendprcnt", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showEnd->isChecked() && _showEndPrcnt->isChecked()))); financialSave.bindValue(":flgrp_showdeltaprcnt", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showDelta->isChecked() && _showDeltaPrcnt->isChecked()))); financialSave.bindValue(":flgrp_showbudgetprcnt", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showBudget->isChecked() && _showBudgetPrcnt->isChecked()))); financialSave.bindValue(":flgrp_showdiffprcnt", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showDiff->isChecked() && _showDiffPrcnt->isChecked()))); financialSave.bindValue(":flgrp_showcustomprcnt", QVariant(((_showSubtotal->isChecked() || _summarize->isChecked()) && _showCustom->isChecked() && _showCustomPrcnt->isChecked()))); financialSave.bindValue(":flgrp_prcnt_flgrp_id", _group->id()); financialSave.bindValue(":flgrp_usealtsubtotal", QVariant(_altSubtotal->isChecked())); financialSave.bindValue(":flgrp_altsubtotal", _altSubtotalLabel->text()); financialSave.exec(); done(_flgrpid); } void financialLayoutGroup::populate() { XSqlQuery financialpopulate; financialpopulate.prepare( "SELECT flgrp_name, flgrp_descrip, flgrp_subtotal," " flgrp_summarize, flgrp_subtract," " flgrp_showstart, flgrp_showend," " flgrp_showdelta, flgrp_showbudget, flgrp_showdiff, flgrp_showcustom," " flgrp_showstartprcnt, flgrp_showendprcnt," " flgrp_showdeltaprcnt, flgrp_showbudgetprcnt, flgrp_showdiffprcnt, flgrp_showcustomprcnt," " flgrp_flhead_id, flgrp_prcnt_flgrp_id, flgrp_usealtsubtotal, flgrp_altsubtotal " "FROM flgrp " "WHERE (flgrp_id=:flgrp_id);" ); financialpopulate.bindValue(":flgrp_id", _flgrpid); financialpopulate.exec(); if (financialpopulate.first()) { _flheadid = financialpopulate.value("flgrp_flhead_id").toInt(); _name->setText(financialpopulate.value("flgrp_name").toString()); _description->setText(financialpopulate.value("flgrp_descrip").toString()); _showSubtotal->setChecked(financialpopulate.value("flgrp_subtotal").toBool()); _summarize->setChecked(financialpopulate.value("flgrp_summarize").toBool()); _altSubtotal->setChecked(financialpopulate.value("flgrp_usealtsubtotal").toBool()); _altSubtotalLabel->setText(financialpopulate.value("flgrp_altsubtotal").toString()); if(_summarize->isChecked() || _showSubtotal->isChecked()) { _showStart->setChecked(financialpopulate.value("flgrp_showstart").toBool()); _showEnd->setChecked(financialpopulate.value("flgrp_showend").toBool()); _showDelta->setChecked(financialpopulate.value("flgrp_showdelta").toBool()); _showBudget->setChecked(financialpopulate.value("flgrp_showbudget").toBool()); _showDiff->setChecked(financialpopulate.value("flgrp_showdiff").toBool()); _showCustom->setChecked(financialpopulate.value("flgrp_showcustom").toBool()); _showStartPrcnt->setChecked(financialpopulate.value("flgrp_showstartprcnt").toBool()); _showEndPrcnt->setChecked(financialpopulate.value("flgrp_showendprcnt").toBool()); _showDeltaPrcnt->setChecked(financialpopulate.value("flgrp_showdeltaprcnt").toBool()); _showBudgetPrcnt->setChecked(financialpopulate.value("flgrp_showbudgetprcnt").toBool()); _showDiffPrcnt->setChecked(financialpopulate.value("flgrp_showdiffprcnt").toBool()); _showCustomPrcnt->setChecked(financialpopulate.value("flgrp_showcustomprcnt").toBool()); } if(financialpopulate.value("flgrp_subtract").toBool()) _subtract->setChecked(true); else _add->setChecked(true); if ((_rpttype != cAdHoc) && ((_showEndPrcnt->isChecked()) || (_showDiffPrcnt->isChecked()))) _showPrcnt->setChecked(TRUE); int grpid = financialpopulate.value("flgrp_prcnt_flgrp_id").toInt(); sFillGroupList(); _group->setId(grpid); } } void financialLayoutGroup::sToggled() { bool on = (_showSubtotal->isChecked() || _summarize->isChecked()); if(_summarize->isChecked()) { _altSubtotal->setChecked(false); _altSubtotal->setEnabled(false); } else _altSubtotal->setEnabled(_showSubtotal->isEnabled()); _showStart->setEnabled(on); _showEnd->setEnabled(on); _showDelta->setEnabled(on); _showBudget->setEnabled(on); _showDiff->setEnabled(on); _showCustom->setEnabled(on); _showStartPrcnt->setEnabled(on && _showStart->isChecked()); _showEndPrcnt->setEnabled(on && _showEnd->isChecked()); _showDeltaPrcnt->setEnabled(on && _showDelta->isChecked()); _showBudgetPrcnt->setEnabled(on && _showBudget->isChecked()); _showDiffPrcnt->setEnabled(on && _showDiff->isChecked()); _showCustomPrcnt->setEnabled(on && _showCustom->isChecked()); } void financialLayoutGroup::sToggleShowPrcnt() { if (_rpttype == cIncome) { if (_showPrcnt->isChecked()) { _showBudgetPrcnt->setChecked(TRUE); _showDiffPrcnt->setChecked(TRUE); } else { _showBudgetPrcnt->setChecked(FALSE); _showDiffPrcnt->setChecked(FALSE); } } else if (_rpttype == cBalance) { if (_showPrcnt->isChecked()) { _showBudgetPrcnt->setChecked(TRUE); _showEndPrcnt->setChecked(TRUE); } else { _showBudgetPrcnt->setChecked(FALSE); _showEndPrcnt->setChecked(FALSE); } } else if (_rpttype == cCash) { if (_showPrcnt->isChecked()) { _showDeltaPrcnt->setChecked(TRUE); _showBudgetPrcnt->setChecked(TRUE); _showDiffPrcnt->setChecked(TRUE); } else { _showDeltaPrcnt->setChecked(FALSE); _showBudgetPrcnt->setChecked(FALSE); _showDiffPrcnt->setChecked(FALSE); } } } void financialLayoutGroup::sFillGroupList() { XSqlQuery financialFillGroupList; _group->clear(); financialFillGroupList.prepare("SELECT flgrp_id, flgrp_name" " FROM flgrp" " WHERE (flgrp_flhead_id=:flhead_id)" " ORDER BY flgrp_name;"); financialFillGroupList.bindValue(":flhead_id", _flheadid); financialFillGroupList.exec(); _group->append(-1, tr("Parent")); while(financialFillGroupList.next()) _group->append(financialFillGroupList.value("flgrp_id").toInt(), financialFillGroupList.value("flgrp_name").toString()); } qt-client-4.1.0/guiclient/financialLayoutGroup.h000066400000000000000000000024341217451700100217100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FINANCIALLAYOUTGROUP_H #define FINANCIALLAYOUTGROUP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_financialLayoutGroup.h" class financialLayoutGroup : public XDialog, public Ui::financialLayoutGroup { Q_OBJECT public: financialLayoutGroup(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~financialLayoutGroup(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); virtual void sFillGroupList(); virtual void sToggleShowPrcnt(); protected slots: virtual void languageChange(); virtual void sToggled(); private: int _flgrp_flgrpid; int _flgrpid; int _flheadid; int _mode; int _rpttype; }; #endif // FINANCIALLAYOUTGROUP_H qt-client-4.1.0/guiclient/financialLayoutGroup.ui000066400000000000000000000626301217451700100221020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. financialLayoutGroup 0 0 509 639 Financial Report Group 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Description Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 Qt::Horizontal QSizePolicy::Expanding 36 11 Subtotal/Summarize true Show % of Group Total false 0 Show Subtotal 0 Qt::Horizontal QSizePolicy::Preferred 21 16 false Use Alt. Label Summarized Qt::Vertical QSizePolicy::Expanding 102 10 Qt::Horizontal QSizePolicy::Preferred 19 10 false Show Beginning Balance true 0 Qt::Horizontal QSizePolicy::Preferred 21 0 false Show % of Group Total false Show Ending Balance true 0 Qt::Horizontal QSizePolicy::Preferred 21 0 false Show % of Group Total false Show Debits/Credits true 0 Qt::Horizontal QSizePolicy::Preferred 21 0 false Show % of Group Total false Show Budget true 0 Qt::Horizontal QSizePolicy::Preferred 21 0 false Show % of Group Total false Show Difference true 0 Qt::Horizontal QSizePolicy::Preferred 21 0 false Show % of Group Total false Show Custom Column 0 Qt::Horizontal QSizePolicy::Preferred 21 0 false Show % of Group Total 5 Use Group _group 0 0 for % Total calculation Alt. Subtotal Label: _altSubtotalLabel false 0 Operation 0 5 Add to Group Total true Subtract from Group Total Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _name _description _showSubtotal _altSubtotal _summarize _showStart _showStartPrcnt _showEnd _showEndPrcnt _showDelta _showDeltaPrcnt _showBudget _showBudgetPrcnt _showDiff _showDiffPrcnt _showCustom _showCustomPrcnt _showPrcnt _group _altSubtotalLabel _add _subtract _buttonBox rejected() financialLayoutGroup reject() 541 195 20 20 _summarize toggled(bool) _showSubtotal setDisabled(bool) 45 170 45 124 _showBudget toggled(bool) _showBudgetPrcnt setEnabled(bool) 181 262 200 285 _showDelta toggled(bool) _showDeltaPrcnt setEnabled(bool) 181 216 200 239 _showEnd toggled(bool) _showEndPrcnt setEnabled(bool) 181 170 200 193 _showStart toggled(bool) _showStartPrcnt setEnabled(bool) 181 124 200 147 _showDiff toggled(bool) _showDiffPrcnt setEnabled(bool) 181 308 200 331 _showCustom toggled(bool) _showCustomPrcnt setEnabled(bool) 181 354 200 377 _showSubtotal toggled(bool) _altSubtotal setEnabled(bool) 123 120 119 144 _altSubtotal toggled(bool) _altSubtotalLabel setEnabled(bool) 94 147 328 474
    qt-client-4.1.0/guiclient/financialLayoutItem.cpp000066400000000000000000000507631217451700100220550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "financialLayoutItem.h" #include #include #include #define cIncome 0 #define cBalance 1 #define cCash 2 #define cAdHoc 3 financialLayoutItem::financialLayoutItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery financialfinancialLayoutItem; setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_showBeginning, SIGNAL(toggled(bool)), _showBeginningPrcnt, SLOT(setEnabled(bool))); connect(_showBudget, SIGNAL(toggled(bool)), _showBudgetPrcnt, SLOT(setEnabled(bool))); connect(_showDB, SIGNAL(toggled(bool)), _showDBPrcnt, SLOT(setEnabled(bool))); connect(_showEnding, SIGNAL(toggled(bool)), _showEndingPrcnt, SLOT(setEnabled(bool))); connect(_showDiff, SIGNAL(toggled(bool)), _showDiffPrcnt, SLOT(setEnabled(bool))); connect(_showPrcnt, SIGNAL(toggled(bool)), this, SLOT(sToggleShowPrcnt())); connect(_selectAccount, SIGNAL(toggled(bool)), this, SLOT(sToggleSegment())); connect(_selectSegment, SIGNAL(toggled(bool)), this, SLOT(sToggleAccount())); connect(_type, SIGNAL(activated(int)), this, SLOT(populateSubTypes())); _flheadid = -1; _flitemid = -1; _account->setShowExternal(true); _company->setType(XComboBox::Companies); _company->append(-1,tr("All"),"All"); _company->setId(-1); _profit->setType(XComboBox::ProfitCenters); _profit->append(-1,tr("All"),"All"); _profit->setId(-1); _type->setCurrentIndex(5); _sub->setType(XComboBox::Subaccounts); _sub->append(-1,tr("All"),"All"); _sub->setId(-1); financialfinancialLayoutItem.prepare( "SELECT DISTINCT accnt_id, accnt_number, accnt_number " "FROM ONLY accnt " "ORDER BY accnt_number;" ); financialfinancialLayoutItem.exec(); _number->populate(financialfinancialLayoutItem); _number->append(-1,tr("All"),"All"); _number->setId(-1); _subType->setAllowNull(FALSE); populateSubTypes(); if (_metrics->value("GLCompanySize").toInt() == 0) { _company->hide(); _sep1Lit->hide(); } if (_metrics->value("GLProfitSize").toInt() == 0) { _profit->hide(); _sep2Lit->hide(); } if (_metrics->value("GLSubaccountSize").toInt() == 0) { _sub->hide(); _sep3Lit->hide(); } } /* * Destroys the object and frees any allocated resources */ financialLayoutItem::~financialLayoutItem() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void financialLayoutItem::languageChange() { retranslateUi(this); } enum SetResponse financialLayoutItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("flhead_id", &valid); if (valid) { _flheadid = param.toInt(); sFillGroupList(); } param = pParams.value("flgrp_id", &valid); if (valid) _flgrpid = param.toInt(); param = pParams.value("flitem_id", &valid); if (valid) { _flitemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); _selectAccount->setEnabled(FALSE); _selectSegment->setEnabled(FALSE); _operationGroup->setEnabled(FALSE); _showColumns->setEnabled(FALSE); _showPrcnt->setEnabled(FALSE); _group->setEnabled(FALSE); _showCustom->setEnabled(FALSE); } } param = pParams.value("type", &valid); if (valid) { if (param.toString() == "adHoc") { _rpttype = cAdHoc; _showPrcnt->setHidden(TRUE); } else { _showColumns->setHidden(TRUE); _showCustom->setHidden(TRUE); } if (param.toString() == "income") { _rpttype = cIncome; _showBeginning->setChecked(FALSE); _showEnding->setChecked(FALSE); _showDB->setChecked(FALSE); _showBudget->setChecked(TRUE); _showDiff->setChecked(TRUE); _showCustom->setChecked(FALSE); } else if (param.toString() == "balance") { _rpttype = cBalance; _showBeginning->setChecked(FALSE); _showEnding->setChecked(TRUE); _showDB->setChecked(FALSE); _showBudget->setChecked(TRUE); _showDiff->setChecked(TRUE); _showCustom->setChecked(FALSE); } else if (param.toString() == "cash") { _rpttype = cCash; _showBeginning->setChecked(FALSE); _showEnding->setChecked(FALSE); _showDB->setChecked(TRUE); _showBudget->setChecked(TRUE); _showDiff->setChecked(TRUE); _showCustom->setChecked(FALSE); } } return NoError; } void financialLayoutItem::sCheck() { } void financialLayoutItem::sSave() { XSqlQuery financialSave; QString sql; if (_selectAccount->isChecked()) { if (_account->isValid()) { financialSave.prepare( "SELECT count(*) AS result" " FROM flitem" " WHERE ((flitem_flhead_id=:flhead_id)" " AND (flitem_id != :flitem_id)" " AND (flitem_accnt_id=:accnt_id) ); "); financialSave.bindValue(":flhead_id", _flheadid); financialSave.bindValue(":flitem_id", _flitemid); financialSave.bindValue(":accnt_id", _account->id()); financialSave.exec(); if(financialSave.first() && (financialSave.value("result").toInt() > 0) ) { if ( QMessageBox::warning( this, tr("Duplicate Account Number"), tr("The selected Account number is already being used in this Financial Report.\n" "Would you like to continue anyway?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape, Qt::NoButton ) != QMessageBox::Yes) return; } } else { QMessageBox::warning( this, tr("Invalid Account Number"), tr("The selected Account number is not valid. Please select a valid " "account before continuing.") ); return; } } int order = 1; if (_mode == cNew) { financialSave.prepare("SELECT COALESCE(MAX(ord),0) + 1 AS neworder" " FROM (SELECT flgrp_order AS ord" " FROM flgrp" " WHERE ((flgrp_flgrp_id=:flgrp_id)" " AND (flgrp_flhead_id=:flhead_id))" " UNION" " SELECT flitem_order AS ord" " FROM flitem" " WHERE ((flitem_flgrp_id=:flgrp_id)" " AND (flitem_flhead_id=:flhead_id))" " UNION" " SELECT flspec_order AS ord" " FROM flspec" " WHERE ((flspec_flgrp_id=:flgrp_id)" " AND (flspec_flhead_id=:flhead_id)) ) AS data;" ); financialSave.bindValue(":flgrp_id", _flgrpid); financialSave.bindValue(":flhead_id", _flheadid); financialSave.exec(); if(financialSave.first()) order = financialSave.value("neworder").toInt(); } if (_mode == cNew) { financialSave.exec("SELECT NEXTVAL('flitem_flitem_id_seq') AS flitem_id;"); if (financialSave.first()) _flitemid = financialSave.value("flitem_id").toInt(); sql = ( "INSERT INTO flitem " "( flitem_id, flitem_flhead_id, flitem_flgrp_id, flitem_order," " flitem_accnt_id, flitem_showstart, flitem_showend, flitem_showdelta, flitem_showbudget, flitem_showdiff, flitem_showcustom," " flitem_subtract, flitem_showstartprcnt, flitem_showendprcnt, flitem_showdeltaprcnt, flitem_showcustomprcnt," " flitem_showbudgetprcnt, flitem_showdiffprcnt, flitem_prcnt_flgrp_id, flitem_custom_source, " " flitem_company, flitem_profit, flitem_number, flitem_sub, flitem_type, flitem_subaccnttype_code) " "VALUES " "( :flitem_id, :flitem_flhead_id, :flitem_flgrp_id, :flitem_order," " :flitem_accnt_id, :flitem_showstart, :flitem_showend, :flitem_showdelta, :flitem_showbudget, :flitem_showdiff, :flitem_showcustom," " :flitem_subtract, :flitem_showstartprcnt, :flitem_showendprcnt, :flitem_showdeltaprcnt, :flitem_showcustomprcnt," " :flitem_showbudgetprcnt, :flitem_showdiffprcnt, :flitem_prcnt_flgrp_id, :flitem_custom_source," " :flitem_company, :flitem_profit, :flitem_number, :flitem_sub, :flitem_type, "); if (_selectAccount->isChecked()) sql += " '' );"; else sql += " (COALESCE((SELECT subaccnttype_code FROM subaccnttype WHERE subaccnttype_id=:subaccnttype_id),'All')));" ; } else if (_mode == cEdit) { sql = "UPDATE flitem " "SET flitem_accnt_id=:flitem_accnt_id, flitem_showstart=:flitem_showstart," " flitem_showend=:flitem_showend, flitem_showdelta=:flitem_showdelta," " flitem_showbudget=:flitem_showbudget, flitem_subtract=:flitem_subtract," " flitem_showdiff=:flitem_showdiff, flitem_showcustom=:flitem_showcustom," " flitem_showstartprcnt=:flitem_showstartprcnt, flitem_showendprcnt=:flitem_showendprcnt," " flitem_showdeltaprcnt=:flitem_showdeltaprcnt, flitem_showbudgetprcnt=:flitem_showbudgetprcnt," " flitem_showdiffprcnt=:flitem_showdiffprcnt, flitem_showcustomprcnt=:flitem_showcustomprcnt," " flitem_prcnt_flgrp_id=:flitem_prcnt_flgrp_id, flitem_custom_source=:flitem_custom_source, " " flitem_company=:flitem_company, flitem_profit=:flitem_profit, " " flitem_number=:flitem_number, flitem_sub=:flitem_sub, " " flitem_type=:flitem_type, "; if (_selectAccount->isChecked()) sql += " flitem_subaccnttype_code='' "; else sql += " flitem_subaccnttype_code=(COALESCE((SELECT subaccnttype_code FROM subaccnttype WHERE subaccnttype_id=:subaccnttype_id),'All'))" ; sql += " WHERE (flitem_id=:flitem_id);"; } financialSave.prepare(sql); financialSave.bindValue(":flitem_flhead_id", _flheadid); financialSave.bindValue(":flitem_flgrp_id", _flgrpid); financialSave.bindValue(":flitem_order", order); financialSave.bindValue(":flitem_accnt_id", _account->id()); financialSave.bindValue(":flitem_showstart", QVariant(_showBeginning->isChecked())); financialSave.bindValue(":flitem_showend", QVariant(_showEnding->isChecked())); financialSave.bindValue(":flitem_showdelta", QVariant(_showDB->isChecked())); financialSave.bindValue(":flitem_showbudget", QVariant(_showBudget->isChecked())); financialSave.bindValue(":flitem_showdiff", QVariant(_showDiff->isChecked())); financialSave.bindValue(":flitem_showcustom", QVariant(_showCustom->isChecked())); financialSave.bindValue(":flitem_subtract", QVariant(_subtract->isChecked())); financialSave.bindValue(":flitem_showstartprcnt", QVariant(_showBeginning->isChecked() && _showBeginningPrcnt->isChecked())); financialSave.bindValue(":flitem_showendprcnt", QVariant(_showEnding->isChecked() && _showEndingPrcnt->isChecked())); financialSave.bindValue(":flitem_showdeltaprcnt", QVariant(_showDB->isChecked() && _showDBPrcnt->isChecked())); financialSave.bindValue(":flitem_showbudgetprcnt", QVariant(_showBudget->isChecked() && _showBudgetPrcnt->isChecked())); financialSave.bindValue(":flitem_showdiffprcnt", QVariant(_showDiff->isChecked() && _showDiffPrcnt->isChecked())); financialSave.bindValue(":flitem_showcustomprcnt", QVariant(_showCustom->isChecked() && _showCustomPrcnt->isChecked())); financialSave.bindValue(":flitem_id", _flitemid); financialSave.bindValue(":flitem_prcnt_flgrp_id", _group->id()); if(_customUseBeginning->isChecked()) financialSave.bindValue(":flitem_custom_source", "S"); else if(_customUseEnding->isChecked()) financialSave.bindValue(":flitem_custom_source", "E"); else if(_customUseDebits->isChecked()) financialSave.bindValue(":flitem_custom_source", "D"); else if(_customUseCredits->isChecked()) financialSave.bindValue(":flitem_custom_source", "C"); else if(_customUseBudget->isChecked()) financialSave.bindValue(":flitem_custom_source", "B"); else if(_customUseDiff->isChecked()) financialSave.bindValue(":flitem_custom_source", "F"); if ( _selectSegment->isChecked() ) { financialSave.bindValue(":flitem_accnt_id", -1); financialSave.bindValue(":flitem_company", _company->code()); financialSave.bindValue(":flitem_profit", _profit->code()); financialSave.bindValue(":flitem_number", _number->code()); financialSave.bindValue(":flitem_sub", _sub->code()); financialSave.bindValue(":subaccnttype_id", _subType->id()); if (_type->currentIndex() == 0) financialSave.bindValue(":flitem_type", "A"); else if (_type->currentIndex() == 1) financialSave.bindValue(":flitem_type", "L"); else if (_type->currentIndex() == 2) financialSave.bindValue(":flitem_type", "E"); else if (_type->currentIndex() == 3) financialSave.bindValue(":flitem_type", "R"); else if (_type->currentIndex() == 4) financialSave.bindValue(":flitem_type", "Q"); else financialSave.bindValue(":flitem_type", ""); } else { financialSave.bindValue(":flitem_accnt_id", _account->id()); financialSave.bindValue(":flitem_company", ""); financialSave.bindValue(":flitem_profit", ""); financialSave.bindValue(":flitem_number", ""); financialSave.bindValue(":flitem_sub", ""); financialSave.bindValue(":flitem_subaccnttype_code", ""); financialSave.bindValue(":flitem_type", ""); } financialSave.exec(); done(_flitemid); } void financialLayoutItem::populate() { XSqlQuery financialpopulate; financialpopulate.prepare( "SELECT * " "FROM flitem " "LEFT OUTER JOIN subaccnttype ON flitem_subaccnttype_code=subaccnttype_code " "WHERE (flitem_id=:flitem_id);" ); financialpopulate.bindValue(":flitem_id", _flitemid); financialpopulate.exec(); if (financialpopulate.first()) { if ( financialpopulate.value("flitem_accnt_id").toInt() == -1 ) { _selectSegment->setChecked(TRUE); if (_metrics->value("GLCompanySize").toInt()) _company->setCode(financialpopulate.value("flitem_company").toString()); if (_metrics->value("GLProfitSize").toInt()) _profit->setCode(financialpopulate.value("flitem_profit").toString()); _number->setCode(financialpopulate.value("flitem_number").toString()); if (_metrics->value("GLSubaccountSize").toInt()) _sub->setCode(financialpopulate.value("flitem_sub").toString()); if (financialpopulate.value("flitem_type").toString() == "A") _type->setCurrentIndex(0); else if (financialpopulate.value("flitem_type").toString() == "L") _type->setCurrentIndex(1); else if (financialpopulate.value("flitem_type").toString() == "E") _type->setCurrentIndex(2); else if (financialpopulate.value("flitem_type").toString() == "R") _type->setCurrentIndex(3); else if (financialpopulate.value("flitem_type").toString() == "Q") _type->setCurrentIndex(4); else _type->setCurrentIndex(5); _subType->setId(financialpopulate.value("subaccnttype_id").toInt()); } else { _selectAccount->setChecked(TRUE); _account->setId(financialpopulate.value("flitem_accnt_id").toInt()); } _showBeginning->setChecked(financialpopulate.value("flitem_showstart").toBool()); _showEnding->setChecked(financialpopulate.value("flitem_showend").toBool()); _showDB->setChecked(financialpopulate.value("flitem_showdelta").toBool()); _showBudget->setChecked(financialpopulate.value("flitem_showbudget").toBool()); _showDiff->setChecked(financialpopulate.value("flitem_showdiff").toBool()); _showCustom->setChecked(financialpopulate.value("flitem_showcustom").toBool()); _showBeginningPrcnt->setChecked(financialpopulate.value("flitem_showstartprcnt").toBool()); _showEndingPrcnt->setChecked(financialpopulate.value("flitem_showendprcnt").toBool()); _showDBPrcnt->setChecked(financialpopulate.value("flitem_showdeltaprcnt").toBool()); _showBudgetPrcnt->setChecked(financialpopulate.value("flitem_showbudgetprcnt").toBool()); _showDiffPrcnt->setChecked(financialpopulate.value("flitem_showdiffprcnt").toBool()); _showCustomPrcnt->setChecked(financialpopulate.value("flitem_showcustomprcnt").toBool()); if ((_rpttype != cAdHoc) & ((_showDiffPrcnt->isChecked()) || (_showEndingPrcnt->isChecked()))) _showPrcnt->setChecked(TRUE); QString src = financialpopulate.value("flitem_custom_source").toString(); if("S" == src) _customUseBeginning->setChecked(TRUE); else if("E" == src) _customUseEnding->setChecked(TRUE); else if("D" == src) _customUseDebits->setChecked(TRUE); else if("C" == src) _customUseCredits->setChecked(TRUE); else if("B" == src) _customUseBudget->setChecked(TRUE); else if("F" == src) _customUseDiff->setChecked(TRUE); if(financialpopulate.value("flitem_subtract").toBool()) _subtract->setChecked(TRUE); else _add->setChecked(TRUE); _flheadid = financialpopulate.value("flitem_flhead_id").toInt(); int grpid = financialpopulate.value("flitem_prcnt_flgrp_id").toInt(); sFillGroupList(); _group->setId(grpid); sToggleShowPrcnt(); } } void financialLayoutItem::sFillGroupList() { XSqlQuery financialFillGroupList; _group->clear(); financialFillGroupList.prepare("SELECT flgrp_id, flgrp_name" " FROM flgrp" " WHERE (flgrp_flhead_id=:flhead_id)" " ORDER BY flgrp_name;"); financialFillGroupList.bindValue(":flhead_id", _flheadid); financialFillGroupList.exec(); _group->append(-1, tr("Parent")); while(financialFillGroupList.next()) _group->append(financialFillGroupList.value("flgrp_id").toInt(), financialFillGroupList.value("flgrp_name").toString()); } void financialLayoutItem::sToggleShowPrcnt() { if (_rpttype == cIncome) { if (_showPrcnt->isChecked()) { _showBudgetPrcnt->setChecked(TRUE); _showDiffPrcnt->setChecked(TRUE); } else { _showBudgetPrcnt->setChecked(FALSE); _showDiffPrcnt->setChecked(FALSE); } } else if (_rpttype == cBalance) { if (_showPrcnt->isChecked()) { _showBudgetPrcnt->setChecked(TRUE); _showEndingPrcnt->setChecked(TRUE); } else { _showBudgetPrcnt->setChecked(FALSE); _showEndingPrcnt->setChecked(FALSE); } } else if (_rpttype == cCash) { if (_showPrcnt->isChecked()) { _showDBPrcnt->setChecked(TRUE); _showBudgetPrcnt->setChecked(TRUE); _showDiffPrcnt->setChecked(TRUE); } else { _showDBPrcnt->setChecked(FALSE); _showBudgetPrcnt->setChecked(FALSE); _showDiffPrcnt->setChecked(FALSE); } } } void financialLayoutItem::sToggleSegment() { if (_selectAccount->isChecked()) _selectSegment->setChecked(FALSE); else _selectSegment->setChecked(TRUE); } void financialLayoutItem::sToggleAccount() { if (_selectSegment->isChecked()) _selectAccount->setChecked(FALSE); else _selectAccount->setChecked(TRUE); } void financialLayoutItem::populateSubTypes() { QString query; XSqlQuery sub; query = ("SELECT subaccnttype_id, (subaccnttype_code||'-'||subaccnttype_descrip) " "FROM subaccnttype "); if (_type->currentIndex() != 5) query += "WHERE (subaccnttype_accnt_type=:subaccnttype_accnt_type) "; query += "ORDER BY subaccnttype_code; "; sub.prepare(query); if (_type->currentIndex() != 5) { if (_type->currentIndex() == 0) sub.bindValue(":subaccnttype_accnt_type", "A"); else if (_type->currentIndex() == 1) sub.bindValue(":subaccnttype_accnt_type", "L"); else if (_type->currentIndex() == 2) sub.bindValue(":subaccnttype_accnt_type", "E"); else if (_type->currentIndex() == 3) sub.bindValue(":subaccnttype_accnt_type", "R"); else if (_type->currentIndex() == 4) sub.bindValue(":subaccnttype_accnt_type", "Q"); } sub.exec(); _subType->populate(sub); _subType->append(-1,tr("All")); _subType->setText(tr("All")); } qt-client-4.1.0/guiclient/financialLayoutItem.h000066400000000000000000000025341217451700100215130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FINANCIALLAYOUTITEM_H #define FINANCIALLAYOUTITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_financialLayoutItem.h" class financialLayoutItem : public XDialog, public Ui::financialLayoutItem { Q_OBJECT public: financialLayoutItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~financialLayoutItem(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void sFillGroupList(); virtual void sToggleShowPrcnt(); virtual void sToggleSegment(); virtual void sToggleAccount(); virtual void populateSubTypes(); protected slots: virtual void languageChange(); private: int _mode; int _rpttype; int _flheadid; int _flitemid; int _flgrpid; }; #endif // FINANCIALLAYOUTITEM_H qt-client-4.1.0/guiclient/financialLayoutItem.ui000066400000000000000000001000461217451700100216760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. financialLayoutItem 0 0 731 427 Financial Report Item 0 Selections 0 500 70 Select one Account true true 10 30 476 36 5 Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _tab true Select Multiple Accounts by Segment true false Number: 0 0 0 0 - Qt::AlignCenter 0 0 - Qt::AlignCenter 0 0 - Qt::AlignCenter Qt::Horizontal QSizePolicy::Expanding 25 16 5 5 Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Asset Liability Expense Revenue Equity All Qt::Horizontal QSizePolicy::Minimum 16 20 5 Sub Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 40 20 Operation 0 5 Add to Group Total true Subtract from Group Total Qt::Vertical 20 16 Options 9 Show Columns 0 Show Beginning Balance true 0 Qt::Horizontal QSizePolicy::Fixed 20 16 Show % of Group Total Show Ending Balance true 0 Qt::Horizontal QSizePolicy::Fixed 20 16 Show % of Group Total Show Debits/Credits true 0 Qt::Horizontal QSizePolicy::Fixed 20 16 Show % of Group Total Show Budget true 0 Qt::Horizontal QSizePolicy::Fixed 20 16 Show % of Group Total Show Difference true 0 Qt::Horizontal QSizePolicy::Fixed 20 16 Show % of Group Total Qt::Vertical QSizePolicy::Preferred 199 10 Show % of Group Total 5 Use Group for % Total calculation Qt::Horizontal QSizePolicy::Expanding 61 20 Qt::Vertical 20 10 Show Custom Column true false 5 5 0 Qt::Horizontal QSizePolicy::Fixed 20 16 Show % of Group Total 0 Use Beginning Balance true Use Ending Balance Use Debits Use Credits Use Budget Use Difference Qt::Vertical QSizePolicy::Expanding 20 10 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save GLCluster QWidget
    glcluster.h
    XComboBox QComboBox
    xcombobox.h
    _tab _company _profit _number _sub _type _subType _add _subtract _showBeginning _showBeginningPrcnt _showEnding _showEndingPrcnt _showDB _showDBPrcnt _showBudget _showBudgetPrcnt _showDiff _showDiffPrcnt _showPrcnt _group _showCustomPrcnt _customUseBeginning _customUseEnding _customUseDebits _customUseCredits _customUseBudget _customUseDiff _buttonBox rejected() financialLayoutItem reject() 723 80 20 30
    qt-client-4.1.0/guiclient/financialLayoutSpecial.cpp000066400000000000000000000256361217451700100225400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "financialLayoutSpecial.h" #include #include financialLayoutSpecial::financialLayoutSpecial(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_showBudget, SIGNAL(toggled(bool)), _showBudgetPrcnt, SLOT(setEnabled(bool))); connect(_showDB, SIGNAL(toggled(bool)), _showDBPrcnt, SLOT(setEnabled(bool))); connect(_showEnding, SIGNAL(toggled(bool)), _showEndingPrcnt, SLOT(setEnabled(bool))); connect(_showDiff, SIGNAL(toggled(bool)), _showDiffPrcnt, SLOT(setEnabled(bool))); connect(_showBeginning, SIGNAL(toggled(bool)), _showBeginningPrcnt, SLOT(setEnabled(bool))); _flheadid = -1; _flspecid = -1; } financialLayoutSpecial::~financialLayoutSpecial() { // no need to delete child widgets, Qt does it all for us } void financialLayoutSpecial::languageChange() { retranslateUi(this); } enum SetResponse financialLayoutSpecial::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("flhead_id", &valid); if (valid) { _flheadid = param.toInt(); sFillGroupList(); } param = pParams.value("flgrp_id", &valid); if (valid) _flgrpid = param.toInt(); param = pParams.value("flspec_id", &valid); if (valid) { _flspecid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; } } return NoError; } void financialLayoutSpecial::sCheck() { } void financialLayoutSpecial::sSave() { XSqlQuery financialSave; int order = 1; if (_mode == cNew) { financialSave.prepare("SELECT COALESCE(MAX(ord),0) + 1 AS neworder" " FROM (SELECT flgrp_order AS ord" " FROM flgrp" " WHERE ((flgrp_flgrp_id=:flgrp_id)" " AND (flgrp_flhead_id=:flhead_id))" " UNION" " SELECT flitem_order AS ord" " FROM flitem" " WHERE ((flitem_flgrp_id=:flgrp_id)" " AND (flitem_flhead_id=:flhead_id))" " UNION" " SELECT flspec_order AS ord" " FROM flspec" " WHERE ((flspec_flgrp_id=:flgrp_id)" " AND (flspec_flhead_id=:flhead_id)) ) AS data;" ); financialSave.bindValue(":flgrp_id", _flgrpid); financialSave.bindValue(":flhead_id", _flheadid); financialSave.exec(); if(financialSave.first()) order = financialSave.value("neworder").toInt(); } if (_mode == cNew) { financialSave.exec("SELECT NEXTVAL('flspec_flspec_id_seq') AS flspec_id;"); if (financialSave.first()) _flspecid = financialSave.value("flspec_id").toInt(); financialSave.prepare( "INSERT INTO flspec " "( flspec_id, flspec_flhead_id, flspec_flgrp_id, flspec_order," " flspec_name, flspec_type, flspec_showstart, flspec_showend, flspec_showdelta," " flspec_showbudget, flspec_showdiff, flspec_showcustom," " flspec_subtract, flspec_showstartprcnt, flspec_showendprcnt, flspec_showdeltaprcnt," " flspec_showbudgetprcnt, flspec_showdiffprcnt, flspec_showcustomprcnt," " flspec_prcnt_flgrp_id, flspec_custom_source) " "VALUES " "( :flspec_id, :flspec_flhead_id, :flspec_flgrp_id, :flspec_order," " :flspec_name, :flspec_type, :flspec_showstart, :flspec_showend, :flspec_showdelta," " :flspec_showbudget, :flspec_showdiff, :flspec_showcustom," " :flspec_subtract, :flspec_showstartprcnt, :flspec_showendprcnt, :flspec_showdeltaprcnt," " :flspec_showbudgetprcnt, :flspec_showdiffprcnt, :flspec_showcustomprcnt," " :flspec_prcnt_flgrp_id, :flspec_custom_source);" ); } else if (_mode == cEdit) financialSave.prepare( "UPDATE flspec " "SET flspec_name=:flspec_name, flspec_type=:flspec_type," " flspec_showstart=:flspec_showstart," " flspec_showend=:flspec_showend, flspec_showdelta=:flspec_showdelta," " flspec_showbudget=:flspec_showbudget, flspec_subtract=:flspec_subtract," " flspec_showdiff=:flspec_showdiff, flspec_showcustom=:flspec_showcustom," " flspec_showstartprcnt=:flspec_showstartprcnt, flspec_showendprcnt=:flspec_showendprcnt," " flspec_showdeltaprcnt=:flspec_showdeltaprcnt, flspec_showbudgetprcnt=:flspec_showbudgetprcnt," " flspec_showdiffprcnt=:flspec_showdiffprcnt, flspec_showcustomprcnt=:flspec_showcustomprcnt," " flspec_prcnt_flgrp_id=:flspec_prcnt_flgrp_id, flspec_custom_source=:flspec_custom_source " "WHERE (flspec_id=:flspec_id);" ); financialSave.bindValue(":flspec_flhead_id", _flheadid); financialSave.bindValue(":flspec_flgrp_id", _flgrpid); financialSave.bindValue(":flspec_order", order); financialSave.bindValue(":flspec_name", _name->text()); financialSave.bindValue(":flspec_showstart", QVariant(_showBeginning->isChecked())); financialSave.bindValue(":flspec_showend", QVariant(_showEnding->isChecked())); financialSave.bindValue(":flspec_showdelta", QVariant(_showDB->isChecked())); financialSave.bindValue(":flspec_showbudget", QVariant(_showBudget->isChecked())); financialSave.bindValue(":flspec_showdiff", QVariant(_showDiff->isChecked())); financialSave.bindValue(":flspec_showcustom", QVariant(_showCustom->isChecked())); financialSave.bindValue(":flspec_subtract", QVariant(_subtract->isChecked())); financialSave.bindValue(":flspec_showstartprcnt", QVariant(_showBeginning->isChecked() && _showBeginningPrcnt->isChecked())); financialSave.bindValue(":flspec_showendprcnt", QVariant(_showEnding->isChecked() && _showEndingPrcnt->isChecked())); financialSave.bindValue(":flspec_showdeltaprcnt", QVariant(_showDB->isChecked() && _showDBPrcnt->isChecked())); financialSave.bindValue(":flspec_showbudgetprcnt", QVariant(_showBudget->isChecked() && _showBudgetPrcnt->isChecked())); financialSave.bindValue(":flspec_showdiffprcnt", QVariant(_showDiff->isChecked() && _showDiffPrcnt->isChecked())); financialSave.bindValue(":flspec_showcustomprcnt", QVariant(_showCustom->isChecked() && _showCustomPrcnt->isChecked())); financialSave.bindValue(":flspec_prcnt_flgrp_id", _group->id()); financialSave.bindValue(":flspec_id", _flspecid); if(_customUseBeginning->isChecked()) financialSave.bindValue(":flspec_custom_source", "S"); else if(_customUseEnding->isChecked()) financialSave.bindValue(":flspec_custom_source", "E"); else if(_customUseDebits->isChecked()) financialSave.bindValue(":flspec_custom_source", "D"); else if(_customUseCredits->isChecked()) financialSave.bindValue(":flspec_custom_source", "C"); else if(_customUseBudget->isChecked()) financialSave.bindValue(":flspec_custom_source", "B"); else if(_customUseDiff->isChecked()) financialSave.bindValue(":flspec_custom_source", "F"); switch(_type->currentIndex()) { case 1: financialSave.bindValue(":flspec_type", "OpenAP"); break; case 0: default: financialSave.bindValue(":flspec_type", "OpenAR"); } financialSave.exec(); done(_flspecid); } void financialLayoutSpecial::populate() { XSqlQuery financialpopulate; financialpopulate.prepare( "SELECT * " "FROM flspec " "WHERE (flspec_id=:flspec_id);" ); financialpopulate.bindValue(":flspec_id", _flspecid); financialpopulate.exec(); if (financialpopulate.first()) { _name->setText(financialpopulate.value("flspec_name").toString()); _showBeginning->setChecked(financialpopulate.value("flspec_showstart").toBool()); _showEnding->setChecked(financialpopulate.value("flspec_showend").toBool()); _showDB->setChecked(financialpopulate.value("flspec_showdelta").toBool()); _showBudget->setChecked(financialpopulate.value("flspec_showbudget").toBool()); _showDiff->setChecked(financialpopulate.value("flspec_showdiff").toBool()); _showCustom->setChecked(financialpopulate.value("flspec_showcustom").toBool()); _showBeginningPrcnt->setChecked(financialpopulate.value("flspec_showstartprcnt").toBool()); _showEndingPrcnt->setChecked(financialpopulate.value("flspec_showendprcnt").toBool()); _showDBPrcnt->setChecked(financialpopulate.value("flspec_showdeltaprcnt").toBool()); _showBudgetPrcnt->setChecked(financialpopulate.value("flspec_showbudgetprcnt").toBool()); _showDiffPrcnt->setChecked(financialpopulate.value("flspec_showdiffprcnt").toBool()); _showCustomPrcnt->setChecked(financialpopulate.value("flspec_showcustomprcnt").toBool()); QString src = financialpopulate.value("flspec_custom_source").toString(); if("S" == src) _customUseBeginning->setChecked(true); else if("E" == src) _customUseEnding->setChecked(true); else if("D" == src) _customUseDebits->setChecked(true); else if("C" == src) _customUseCredits->setChecked(true); else if("B" == src) _customUseBudget->setChecked(true); else if("F" == src) _customUseDiff->setChecked(true); if(financialpopulate.value("flspec_subtract").toBool()) _subtract->setChecked(true); else _add->setChecked(true); if(financialpopulate.value("flspec_type").toString() == "OpenAP") _type->setCurrentIndex(1); else //if(financialpopulate.value("flspec_type").toString() == "OpenAR") _type->setCurrentIndex(0); _flheadid = financialpopulate.value("flspec_flhead_id").toInt(); int grpid = financialpopulate.value("flspec_prcnt_flgrp_id").toInt(); sFillGroupList(); _group->setId(grpid); } } void financialLayoutSpecial::sFillGroupList() { XSqlQuery financialFillGroupList; _group->clear(); financialFillGroupList.prepare("SELECT flgrp_id, flgrp_name" " FROM flgrp" " WHERE (flgrp_flhead_id=:flhead_id)" " ORDER BY flgrp_name;"); financialFillGroupList.bindValue(":flhead_id", _flheadid); financialFillGroupList.exec(); _group->append(-1, tr("Parent")); while(financialFillGroupList.next()) _group->append(financialFillGroupList.value("flgrp_id").toInt(), financialFillGroupList.value("flgrp_name").toString()); } qt-client-4.1.0/guiclient/financialLayoutSpecial.h000066400000000000000000000023271217451700100221750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FINANCIALLAYOUTSPECIAL_H #define FINANCIALLAYOUTSPECIAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_financialLayoutSpecial.h" class financialLayoutSpecial : public XDialog, public Ui::financialLayoutSpecial { Q_OBJECT public: financialLayoutSpecial(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~financialLayoutSpecial(); virtual void populate(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void sFillGroupList(); protected slots: virtual void languageChange(); private: int _mode; int _flheadid; int _flspecid; int _flgrpid; }; #endif // FINANCIALLAYOUTSPECIAL_H qt-client-4.1.0/guiclient/financialLayoutSpecial.ui000066400000000000000000000506071217451700100223670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. financialLayoutSpecial 0 0 576 425 Financial Report Special 0 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter A/R Open Items A/P Open Items Qt::Horizontal QSizePolicy::Expanding 40 20 Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Show Beginning Balance 0 Qt::Horizontal QSizePolicy::Fixed 20 16 false Show % of Group Total Show Ending Balance 0 Qt::Horizontal QSizePolicy::Fixed 20 16 false Show % of Group Total Show Debits/Credits 0 Qt::Horizontal QSizePolicy::Fixed 20 16 false Show % of Group Total Show Budget 0 Qt::Horizontal QSizePolicy::Fixed 20 16 false Show % of Group Total Show Difference 0 Qt::Horizontal QSizePolicy::Fixed 20 16 false Show % of Group Total Qt::Vertical QSizePolicy::Preferred 20 26 Operation Add to Group Total true Subtract from Group Total Show Custom Column true false 0 Qt::Horizontal QSizePolicy::Fixed 20 16 Show % of Group Total Use Beginning Balance true Use Ending Balance Use Debits Use Credits Use Budget Use Difference Qt::Vertical QSizePolicy::Preferred 20 0 Use Group for % Total calculation Qt::Horizontal QSizePolicy::Expanding 61 20 Qt::Vertical QSizePolicy::Expanding 16 44 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox
    xcombobox.h
    _name _type _showBeginning _showBeginningPrcnt _showEnding _showEndingPrcnt _showDB _showDBPrcnt _showBudget _showBudgetPrcnt _showDiff _showDiffPrcnt _add _showCustomPrcnt _customUseBeginning _customUseEnding _customUseDebits _customUseCredits _customUseBudget _customUseDiff _group _buttonBox rejected() financialLayoutSpecial reject() 581 225 20 20 _showBudget toggled(bool) _showBudgetPrcnt setEnabled(bool) 20 20 20 20 _showDB toggled(bool) _showDBPrcnt setEnabled(bool) 20 20 20 20 _showEnding toggled(bool) _showEndingPrcnt setEnabled(bool) 20 20 20 20 _showDiff toggled(bool) _showDiffPrcnt setEnabled(bool) 20 20 20 20 _showBeginning toggled(bool) _showBeginningPrcnt setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/financialLayouts.cpp000066400000000000000000000150061217451700100214100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "financialLayouts.h" #include #include #include //#include #include #include "financialLayout.h" /* * Constructs a financialLayouts as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ financialLayouts::financialLayouts(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_flhead, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_flhead, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_flhead, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_flhead, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_showInactive, SIGNAL(toggled(bool)), this, SLOT(sFillList())); // statusBar()->hide(); _flhead->addColumn(tr("Name"), (_itemColumn*2), Qt::AlignLeft, true, "flhead_name" ); _flhead->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "flhead_descrip" ); _flhead->addColumn(tr("Active"), _ynColumn, Qt::AlignLeft, true, "active" ); _flhead->addColumn(tr("System"), _ynColumn, Qt::AlignLeft, true, "system" ); sFillList(); } /* * Destroys the object and frees any allocated resources */ financialLayouts::~financialLayouts() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void financialLayouts::languageChange() { retranslateUi(this); } void financialLayouts::sNew() { ParameterList params; params.append("mode", "new"); financialLayout newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void financialLayouts::sEdit() { XSqlQuery financialEdit; ParameterList params; financialEdit.prepare("SELECT * FROM flhead " " WHERE ((flhead_id=:flhead_id)" " AND (flhead_sys));"); financialEdit.bindValue(":flhead_id", _flhead->id()); financialEdit.exec(); if (financialEdit.first()) { QMessageBox::information(this, tr("System Report"), tr("This is a system report and will be opened in " "view mode. Only status and notes may be changed.")); params.append("mode", "view"); } else params.append("mode", "edit"); params.append("flhead_id", _flhead->id()); financialLayout newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void financialLayouts::sDelete() { XSqlQuery financialDelete; financialDelete.prepare("SELECT * FROM flhead " " WHERE ((flhead_id=:flhead_id)" " AND (flhead_sys));"); financialDelete.bindValue(":flhead_id", _flhead->id()); financialDelete.exec(); if (financialDelete.first()) { QMessageBox::critical(this, tr("System Report"), tr("You may not delete a system report,\n" "but you may deactivate it.")); return; } if(QMessageBox::question( this, tr("Confirm Delete"), tr("You are about to delete the selected Financial Report and all of its items.\n" "Are you sure you want to continue?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Escape | QMessageBox::Default) == QMessageBox::Yes) { financialDelete.prepare( "DELETE FROM flcol " "WHERE (flcol_flhead_id=:flhead_id);" "DELETE FROM flitem " "WHERE (flitem_flhead_id=:flhead_id);" "DELETE FROM flgrp " "WHERE (flgrp_flhead_id=:flhead_id);" "DELETE FROM flhead " "WHERE (flhead_id=:flhead_id);" ); financialDelete.bindValue(":flhead_id", _flhead->id()); financialDelete.exec(); sFillList(); } } void financialLayouts::sFillList() { QString query; _flhead->clear(); query = ("SELECT flhead_id, flhead_name, flhead_descrip," " formatboolyn(flhead_active) AS active,formatboolyn(flhead_sys) AS system " "FROM flhead "); if (!_showInactive->isChecked()) query += " WHERE flhead_active=true "; query += "ORDER BY flhead_name;"; _flhead->populate(query); } void financialLayouts::sCopy() { XSqlQuery financialCopy; bool ok; QString text; do { text = QInputDialog::getText(this, tr("Copy Financial Report"), tr("Target Report:"), QLineEdit::Normal, text, &ok); if ( ok ) { financialCopy.prepare("SELECT copyFinancialLayout(:flhead_id, :name) AS result;"); financialCopy.bindValue(":flhead_id", _flhead->id()); financialCopy.bindValue(":name", text); financialCopy.exec(); if(financialCopy.first()) { if(financialCopy.value("result").toInt() < 0) { QString message; switch(financialCopy.value("result").toInt()) { case -1: message = tr("The record you are trying to copy is no longer on the database."); break; case -2: message = tr("You must specify a name."); ok = false; break; case -3: message = tr("The name you specified is already in use. Please choose a different name."); ok = false; break; default: message = tr("There was an unknown error encountered while copying this report."); } QMessageBox::critical(this, tr("Error Encountered"), message); } else sFillList(); } else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } } else return; } while ( !ok ); } qt-client-4.1.0/guiclient/financialLayouts.h000066400000000000000000000020021217451700100210450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FINANCIALLAYOUTS_H #define FINANCIALLAYOUTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_financialLayouts.h" class financialLayouts : public XWidget, public Ui::financialLayouts { Q_OBJECT public: financialLayouts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~financialLayouts(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); virtual void sCopy(); protected slots: virtual void languageChange(); }; #endif // FINANCIALLAYOUTS_H qt-client-4.1.0/guiclient/financialLayouts.ui000066400000000000000000000157101217451700100212450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. financialLayouts 0 0 522 326 List Financial Reports 0 6 Show &Inactive Qt::Horizontal 40 20 0 0 0 5 &Close 0 0 &New false &Edit false Copy false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 0 0 true Financial Layouts: 7 7 0 0 false XTreeWidget QTreeWidget
    xtreewidget.h
    _flhead _new _edit _copy _delete _close _close clicked() financialLayouts close() 20 20 20 20 _flhead valid(bool) _copy setEnabled(bool) 20 20 20 20 _flhead valid(bool) _edit setEnabled(bool) 20 20 20 20 _flhead valid(bool) _delete setEnabled(bool) 20 20 20 20 _flhead itemSelected(int) _edit animateClick() 20 20 20 20
    qt-client-4.1.0/guiclient/financialReportNotes.cpp000066400000000000000000000065451217451700100222440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include "financialReportNotes.h" financialReportNotes::financialReportNotes(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _periodid = -1; _flheadid = -1; _flnotesid = -1; // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); } financialReportNotes::~financialReportNotes() { // no need to delete child widgets, Qt does it all for us } void financialReportNotes::languageChange() { retranslateUi(this); } enum SetResponse financialReportNotes::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("period_id", &valid); if (valid) _periodid = param.toInt(); param = pParams.value("flhead_id", &valid); if (valid) _flheadid = param.toInt(); populate(); return NoError; } void financialReportNotes::sSave() { XSqlQuery qry; if (_flnotesid == -1) qry.prepare("INSERT INTO flnotes " "(flnotes_period_id, flnotes_flhead_id, flnotes_notes) " "VALUES " "(:flnotes_period_id, :flnotes_flhead_id, :flnotes_notes) "); else qry.prepare( "UPDATE flnotes " "SET flnotes_notes=:flnotes_notes " "WHERE flnotes_id=:flnotes_id;"); qry.bindValue(":flnotes_id", _flnotesid); qry.bindValue(":flnotes_period_id", _periodid); qry.bindValue(":flnotes_flhead_id", _flheadid); qry.bindValue(":flnotes_notes", _notes->toPlainText()); qry.exec(); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } accept(); } void financialReportNotes::populate() { XSqlQuery qry; qry.prepare( "SELECT flhead_name, " "CASE WHEN (length(period_name) > 0) THEN " " period_name " "ELSE " " (formatDate(period_start) || '-' || formatDate(period_end)) " "END AS period_name " "FROM flhead, period " "WHERE ((flhead_id=:flhead_id) " " AND (period_id=:period_id));" ); qry.bindValue(":flhead_id", _flheadid); qry.bindValue(":period_id", _periodid); qry.exec(); if (qry.first()) { _layout->setText(qry.value("flhead_name").toString()); _period->setText(qry.value("period_name").toString()); } qry.prepare( "SELECT flnotes_id, flnotes_notes " "FROM flnotes " "WHERE ((flnotes_flhead_id=:flhead_id) " " AND (flnotes_period_id=:period_id));" ); qry.bindValue(":flhead_id", _flheadid); qry.bindValue(":period_id", _periodid); qry.exec(); if (qry.first()) { _flnotesid = qry.value("flnotes_id").toInt(); _notes->setText(qry.value("flnotes_notes").toString()); } } qt-client-4.1.0/guiclient/financialReportNotes.h000066400000000000000000000021731217451700100217020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FINANCIALREPORTNOTES_H #define FINANCIALREPORTNOTES_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_financialReportNotes.h" class financialReportNotes : public XDialog, public Ui::financialReportNotes { Q_OBJECT public: financialReportNotes(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~financialReportNotes(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _periodid; int _flheadid; int _flnotesid; }; #endif // financialReportNotes_H qt-client-4.1.0/guiclient/financialReportNotes.ui000066400000000000000000000101501217451700100220620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. financialReportNotes 0 0 400 300 Financial Report Notes Layout: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Period: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XTextEdit QTextEdit
    xtextedit.h
    _buttonBox accepted() financialReportNotes accept() 248 254 157 274 _buttonBox rejected() financialReportNotes reject() 316 260 286 274
    qt-client-4.1.0/guiclient/firmPlannedOrder.cpp000066400000000000000000000077751217451700100213540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "firmPlannedOrder.h" #include #include #include firmPlannedOrder::firmPlannedOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_firm, SIGNAL(clicked()), this, SLOT(sFirm())); _quantity->setValidator(omfgThis->qtyVal()); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } firmPlannedOrder::~firmPlannedOrder() { // no need to delete child widgets, Qt does it all for us } void firmPlannedOrder::languageChange() { retranslateUi(this); } enum SetResponse firmPlannedOrder::set(const ParameterList &pParams) { XSqlQuery firmet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("planord_id", &valid); if (valid) { _planordid = param.toInt(); _item->setReadOnly(TRUE); firmet.prepare( "SELECT planord.*, (planord_duedate - planord_startdate) AS leadtime " "FROM planord " "WHERE (planord_id=:planord_id);" ); firmet.bindValue(":planord_id", _planordid); firmet.exec(); if (firmet.first()) { _item->setItemsiteid(firmet.value("planord_itemsite_id").toInt()); _quantity->setDouble(firmet.value("planord_qty").toDouble()); _dueDate->setDate(firmet.value("planord_duedate").toDate()); _comments->setText(firmet.value("planord_comments").toString()); _number = firmet.value("planord_number").toInt(); _itemsiteid = firmet.value("planord_itemsite_id").toInt(); _leadTime = firmet.value("leadtime").toInt(); _type = firmet.value("planord_type").toString(); if (firmet.value("planord_type").toString() == "P") _orderType->setText(tr("Purchase Order")); else if (firmet.value("planord_type").toString() == "W") _orderType->setText(tr("Work Order")); } else if (firmet.lastError().type() != QSqlError::NoError) { systemError(this, firmet.lastError().databaseText(), __FILE__, __LINE__); reject(); } } return NoError; } void firmPlannedOrder::sFirm() { XSqlQuery firmFirm; firmFirm.prepare( "UPDATE planord " "SET planord_firm=TRUE, " " planord_comments=:planord_comments, " " planord_qty=:planord_qty, " " planord_duedate=:planord_dueDate, " " planord_startdate=(DATE(:planord_dueDate) - :planord_leadTime) " "WHERE (planord_id=:planord_id);" ); firmFirm.bindValue(":planord_qty", _quantity->toDouble()); firmFirm.bindValue(":planord_dueDate", _dueDate->date()); firmFirm.bindValue(":planord_leadTime", _leadTime); firmFirm.bindValue(":planord_comments", _comments->toPlainText()); firmFirm.bindValue(":planord_id", _planordid); firmFirm.exec(); if (firmFirm.lastError().type() != QSqlError::NoError) { systemError(this, firmFirm.lastError().databaseText(), __FILE__, __LINE__); return; } firmFirm.prepare( "SELECT explodePlannedOrder( :planord_id, true) AS result;" ); firmFirm.bindValue(":planord_id", _planordid); firmFirm.exec(); if (firmFirm.first()) { double result = firmFirm.value("result").toDouble(); if (result < 0.0) { systemError(this, tr("ExplodePlannedOrder returned %, indicating an " "error occurred.").arg(result), __FILE__, __LINE__); return; } } else if (firmFirm.lastError().type() != QSqlError::NoError) { systemError(this, firmFirm.lastError().databaseText(), __FILE__, __LINE__); return; } done(_planordid); } qt-client-4.1.0/guiclient/firmPlannedOrder.h000066400000000000000000000021431217451700100210010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FIRMPLANNEDORDER_H #define FIRMPLANNEDORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_firmPlannedOrder.h" class firmPlannedOrder : public XDialog, public Ui::firmPlannedOrder { Q_OBJECT public: firmPlannedOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~firmPlannedOrder(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sFirm(); protected slots: virtual void languageChange(); private: int _planordid; int _number; int _leadTime; int _itemsiteid; QString _type; }; #endif // FIRMPLANNEDORDER_H qt-client-4.1.0/guiclient/firmPlannedOrder.ui000066400000000000000000000255621217451700100212010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. firmPlannedOrder 0 0 424 310 Firm Planned Order 5 5 7 5 5 Order Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 5 &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse false Qt::Horizontal QSizePolicy::Expanding 207 20 5 5 &Quantity: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _quantity &Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _dueDate 5 0 80 32767 Qt::Horizontal QSizePolicy::Expanding 177 20 0 Qt::Horizontal QSizePolicy::Expanding 66 10 5 &Cancel &Firm Qt::Vertical QSizePolicy::Expanding 20 20 0 Notes: _comments WComboBox QComboBox
    wcombobox.h
    ItemCluster QWidget
    itemcluster.h
    XLineEdit QWidget
    xlineedit.h
    DLineEdit QWidget
    dlineedit.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _quantity _dueDate _comments _firm _close parameter.h _close clicked() firmPlannedOrder reject() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/firmPlannedOrdersByPlannerCode.cpp000066400000000000000000000042001217451700100241210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "firmPlannedOrdersByPlannerCode.h" #include #include firmPlannedOrdersByPlannerCode::firmPlannedOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_firm, SIGNAL(clicked()), this, SLOT(sFirm())); _plannerCode->setType(ParameterGroup::PlannerCode); } firmPlannedOrdersByPlannerCode::~firmPlannedOrdersByPlannerCode() { // no need to delete child widgets, Qt does it all for us } void firmPlannedOrdersByPlannerCode::languageChange() { retranslateUi(this); } void firmPlannedOrdersByPlannerCode::sFirm() { XSqlQuery firmFirm; if (!_cutoffDate->isValid()) { QMessageBox::critical( this, tr("Enter Cut Off Date"), tr( "You must enter a cut off date for the Planned Orders\n" "to be firmed." ) ); _cutoffDate->setFocus(); return; } QString sql( "UPDATE planord " "SET planord_firm=TRUE " "FROM itemsite " "WHERE ( (planord_itemsite_id=itemsite_id)" " AND (NOT planord_firm)" " AND (planord_startdate <= :cutOffDate)" ); if (_plannerCode->isSelected()) sql += " AND (itemsite_plancode_id=:plancode_id)"; else if (_plannerCode->isPattern()) sql += " AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ :plancode_pattern)))"; sql += ");"; firmFirm.prepare(sql); firmFirm.bindValue(":cutOffDate", _cutoffDate->date()); _plannerCode->bindValue(firmFirm); firmFirm.exec(); accept(); } qt-client-4.1.0/guiclient/firmPlannedOrdersByPlannerCode.h000066400000000000000000000020201217451700100235640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FIRMPLANNEDORDERSBYPLANNERCODE_H #define FIRMPLANNEDORDERSBYPLANNERCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_firmPlannedOrdersByPlannerCode.h" class firmPlannedOrdersByPlannerCode : public XDialog, public Ui::firmPlannedOrdersByPlannerCode { Q_OBJECT public: firmPlannedOrdersByPlannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~firmPlannedOrdersByPlannerCode(); public slots: virtual void sFirm(); protected slots: virtual void languageChange(); }; #endif // FIRMPLANNEDORDERSBYPLANNERCODE_H qt-client-4.1.0/guiclient/firmPlannedOrdersByPlannerCode.ui000066400000000000000000000126101217451700100237600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. firmPlannedOrdersByPlannerCode 0 0 715 216 Firm Planned Orders by Planner Code false false Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Horizontal 0 20 0 &Cancel &Firm true true Qt::Vertical 20 0 DLineEdit QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _plannerCode _warehouse _cutoffDate _firm _close _close clicked() firmPlannedOrdersByPlannerCode reject() 20 20 20 20
    qt-client-4.1.0/guiclient/fixACL.cpp000066400000000000000000000032141217451700100172070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "fixACL.h" #include #include #include #include "storedProcErrorLookup.h" bool fixACL::userHasPriv(const int /* ignored */) { return _privileges->check("fixACL"); } fixACL::fixACL(QWidget* parent, const char * name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_fix, SIGNAL(clicked()), this, SLOT(sFix())); _status->setText(""); } fixACL::~fixACL() { // no need to delete child widgets, Qt does it all for us } void fixACL::languageChange() { retranslateUi(this); } void fixACL::sFix() { XSqlQuery fixFix; QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); fixFix.prepare("SELECT fixACL() AS result;"); fixFix.exec(); QApplication::restoreOverrideCursor(); if (fixFix.first()) { int result = fixFix.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("fixACL", result), __FILE__, __LINE__); return; } _status->setText(tr("Done. %1 entities examined.").arg(result)); } else if (fixFix.lastError().type() != QSqlError::NoError) { systemError(this, fixFix.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/fixACL.h000066400000000000000000000016071217451700100166600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FIXACL_H #define FIXACL_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_fixACL.h" class fixACL : public XWidget, public Ui::fixACL { Q_OBJECT public: fixACL(QWidget* parent = 0, const char * = 0, Qt::WindowFlags fl = Qt::Window); ~fixACL(); static bool userHasPriv(const int = 0); public slots: virtual void sFix(); protected slots: virtual void languageChange(); }; #endif // FIXACL_H qt-client-4.1.0/guiclient/fixACL.ui000066400000000000000000000060611217451700100170450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. fixACL 0 0 411 328 Fix Access Control Close Fix Qt::Vertical 20 40 3 3 Sometimes after restoring a database users get unexpected errors relating to permission to modify the data in database tables. This can happen even though the user has been granted privileges through the application. Click the "Fix" button to try to correct database-level permissions problems. This will only work if you are logged in as a PostgreSQL administrative user. true Qt::Vertical 20 40 TextLabel _close clicked() fixACL close() 311 21 204 12 qt-client-4.1.0/guiclient/fixPackage000077500000000000000000000104201217451700100173620ustar00rootroot00000000000000#!/bin/bash PROG=`basename $0` if ! [ -d $QTDIR ]; then echo "Cannot find QTDIR" exit 1 fi if ! [ -d $PGDIR/lib ]; then echo "Cannot find PGDIR/lib" exit 1 fi if [ $# -lt 1 ] ; then APPROOT=../bin/xtuple.app EXECNAME=xtuple elif [ $# -eq 1 ] ; then APPROOT=$1 EXECNAME=`basename $APPROOT .app` elif [ $# -eq 2 ] ; then APPROOT=$1 EXECNAME=$2 fi if ! [ -d "$APPROOT" ] ; then echo "$PROG: $APPROOT does not exist so either rebuild or specify a .app directory" exit 1 elif ! [ -f "$APPROOT/Contents/MacOS/$EXECNAME" ] ; then echo "$PROG: $APPROOT/Contents/MacOS/$EXECNAME does not exist so rebuild, " echo " specify a proper .app directory, or name the executable as well as the .app" exit 1 fi cd $APPROOT || exit 1 APPROOT=`pwd` collectAndRenameLibs() { if [ $# -ne 1 ] ; then echo "$PROG collectAndRenameLibs() expected 1 args and got $#: $*" return 1 fi if expr "$1" : '\/' > /dev/null ; then FILE="$1" else FILE="`pwd`/$1" fi STARTDIR=`pwd` NEWLOC="@executable_path/../Frameworks" FRAMEWORKSDIR=$APPROOT/Contents/Frameworks [ -d $FRAMEWORKSDIR ] || mkdir $FRAMEWORKSDIR || return 1 cd $FRAMEWORKSDIR || return 1 LIBSTORENAME=`otool -L $FILE | tail -n +2 |\ egrep "($QTDIR|$PGDIR|boost)" |\ grep -v @executable |\ awk '{print $1}'` for TORENAME in $LIBSTORENAME ; do FOUNDTORENAME=false BASETORENAME=`basename $TORENAME` # if TORENAME is a relative path, try various searchpaths until we find it if [ -e "$TORENAME" -a `echo $TORENAME | cut -c1 ` = / ] ; then cp "$TORENAME" . || return 1 FOUNDTORENAME=true else for LIBDIR in `echo "$DYLD_LIBRARY_PATH:$LD_LIBRARY_PATH:$LIBRARY_PATH:/usr/local/lib" |\ tr : " "` ; do if [ -e "$LIBDIR/$BASETORENAME" ] ; then cp "$LIBDIR/$BASETORENAME" . || return 1 FOUNDTORENAME=true break fi done fi if ! $FOUNDTORENAME ; then echo "Could not find $TORENAME to copy" return 1 fi install_name_tool -id $NEWLOC/$BASETORENAME $BASETORENAME || return 1 install_name_tool -change $TORENAME $NEWLOC/$BASETORENAME $FILE || return 1 done cd $STARTDIR || return 1 return 0 } collectAndRenameLibs $APPROOT/Contents/MacOS/$EXECNAME || exit 2 for PLUGIN in sqldrivers/libqsqlpsql.dylib sqldrivers/libqsqlodbc.dylib \ sqldrivers/libqsqlite.dylib \ imageformats/libqgif.dylib imageformats/libqjpeg.dylib \ imageformats/libqmng.dylib \ designer/libxtuplewidgets.dylib \ designer/libqwebview.dylib ; do [ -d $APPROOT/Contents/plugins/`dirname $PLUGIN` ] || \ mkdir -p $APPROOT/Contents/plugins/`dirname $PLUGIN` || exit 2 cp $QTDIR/plugins/$PLUGIN $APPROOT/Contents/plugins/$PLUGIN || exit 2 collectAndRenameLibs $APPROOT/Contents/plugins/$PLUGIN || exit 2 done if [ -f $APPROOT/../../../csvimp/plugins/libcsvimpplugin.dylib ] ; then cp $APPROOT/../../../csvimp/plugins/libcsvimpplugin.dylib \ $APPROOT/Contents/plugins/libcsvimpplugin.dylib || exit 2 collectAndRenameLibs $APPROOT/Contents/plugins/libcsvimpplugin.dylib || exit 2 fi cd $APPROOT/Contents/MacOS for PDIR in sqldrivers imageformats ; do if [ ! -e $PDIR ] ; then if [ -L $PDIR ] ; then rm $PDIR fi ln -s ../plugins/$PDIR || exit 2 fi done cd $APPROOT while [ `otool -L $APPROOT/Contents/Frameworks/* | egrep "($QTDIR|$PGDIR)" | wc -l` -gt 0 ] ; do for LIB in $APPROOT/Contents/Frameworks/* ; do collectAndRenameLibs $LIB || exit 4 done done cd $APPROOT/Contents/Resources || exit 4 # create/copy a qt.conf file pointing to the plugins directory echo "[Paths]" > qt.conf echo "Prefix = .." >> qt.conf cd .. || exit 4 if [ -L Frameworks ] ; then rm Frameworks && ln -s ../../../Frameworks || exit 4 fi if [ -L plugins ] ; then rm plugins && ln -s ../../../plugins || exit 4 fi exit 0 qt-client-4.1.0/guiclient/fixSerial.cpp000066400000000000000000000140171217451700100200320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "fixSerial.h" #include #include #include #include fixSerial::fixSerial(QWidget* parent, const char * name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_fix, SIGNAL(clicked()), this, SLOT(sFix())); connect(_fixAll, SIGNAL(clicked()), this, SLOT(sFixAll())); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_serial, SIGNAL(valid(bool)), this, SLOT(sHandleSerial())); connect(_serial, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_showProblems, SIGNAL(toggled(bool)), this, SLOT(sFillList())); _serial->addColumn(tr("Schema Name"), -1, Qt::AlignLeft, true, "nspname"); _serial->addColumn(tr("Table Name"), -1, Qt::AlignLeft, true, "relname"); _serial->addColumn(tr("Column Name"), -1, Qt::AlignLeft, true, "attname"); _serial->addColumn(tr("Sequence Name"), -1, Qt::AlignLeft, true, "seq"); _serial->addColumn(tr("Largest Key Used"), -1, Qt::AlignRight, true, "maxval"); _serial->addColumn(tr("Next Key"), -1, Qt::AlignRight, true, "lastvalue"); } fixSerial::~fixSerial() { // no need to delete child widgets, Qt does it all for us } void fixSerial::languageChange() { retranslateUi(this); } void fixSerial::sFillList() { _serial->clear(); QApplication::setOverrideCursor( QCursor(Qt::WaitCursor) ); QString sql = "SELECT nspname ||'.' ||relname AS tablename, nspname, relname, attname, " " TRIM(quote_literal('\"''') FROM" " SUBSTRING(pg_catalog.pg_get_expr(d.adbin, d.adrelid)" " FROM '[' || quote_literal('\"''') || " " '].*[' || quote_literal('\"''') || ' ]')) AS seq" " FROM pg_catalog.pg_attribute a, pg_catalog.pg_class," " pg_catalog.pg_attrdef d, pg_catalog.pg_namespace " " WHERE a.attnum > 0" " AND pg_namespace.oid = pg_class.relnamespace" " AND NOT a.attisdropped" " AND a.attnotnull" " AND a.attrelid = pg_class.oid" " AND d.adrelid = a.attrelid" " AND d.adnum = a.attnum" " AND pg_catalog.pg_get_expr(d.adbin, d.adrelid) ~* 'nextval'" " AND a.atthasdef " "ORDER BY relname;" ; XSqlQuery relq; relq.prepare(sql); QString maxStr = "SELECT MAX() AS maxval " "FROM ;" ; XSqlQuery maxq; QString seqStr = "SELECT last_value AS currval FROM ;" ; XSqlQuery seqq; XTreeWidgetItem *last = 0; int rows = 0; int maxval = 0; int currval = 0; int errors = 0; relq.exec(); while (relq.next()) { ParameterList params; params.append("attname", relq.value("attname").toString()); params.append("tablename", relq.value("tablename").toString()); params.append("seq", relq.value("seq").toString()); MetaSQLQuery maxMql = MetaSQLQuery(maxStr); maxq = maxMql.toQuery(params); if (maxq.first()) maxval = maxq.value("maxval").toInt(); else if (maxq.lastError().type() != QSqlError::NoError) { systemError(this, maxq.lastError().databaseText(), __FILE__, __LINE__); continue; } MetaSQLQuery seqMql = MetaSQLQuery(seqStr); seqq = seqMql.toQuery(params); if (seqq.first()) currval = seqq.value("currval").toInt(); else if (seqq.lastError().type() != QSqlError::NoError) { systemError(this, seqq.lastError().databaseText(), __FILE__, __LINE__); continue; } rows++; if (maxval > currval) errors++; if ((_showProblems->isChecked() && maxval > currval) || ! _showProblems->isChecked()) { last = new XTreeWidgetItem(_serial, last, rows, maxval > currval ? 1 : 0, relq.value("nspname"), relq.value("relname"), relq.value("attname"), relq.value("seq"), maxval, currval); if (maxval > currval) last->setTextColor("red"); } } QApplication::restoreOverrideCursor(); if (relq.lastError().type() != QSqlError::NoError) { systemError(this, relq.lastError().databaseText(), __FILE__, __LINE__); return; } if (errors > 0) _statusLit->setText(QObject::tr("Found %1 tables with mismatched serial values.") .arg(errors)); else _statusLit->setText(QObject::tr("No problems found")); _fixAll->setEnabled(errors > 0); } void fixSerial::sHandleSerial() { _fix->setEnabled(_serial->altId() > 0); } bool fixSerial::fixOne(XTreeWidgetItem *pItem) { XSqlQuery fixfixOne; fixfixOne.prepare("SELECT SETVAL(:sequence, :value);"); fixfixOne.bindValue(":sequence", pItem->text(3)); fixfixOne.bindValue(":value", pItem->text(4)); fixfixOne.exec(); if (fixfixOne.lastError().type() != QSqlError::NoError) { systemError(this, fixfixOne.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void fixSerial::sFix() { if (fixOne(static_cast(_serial->currentItem()))) sFillList(); } void fixSerial::sFixAll() { QList all = _serial->findItems("", Qt::MatchContains); for (int i = 0; i < all.size(); i++) { XTreeWidgetItem *currItem = static_cast(all[i]); if (currItem->altId() > 0) fixOne(currItem); } sFillList(); } void fixSerial::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pItem) { QAction *menuItem; menuItem = pMenu->addAction(tr("Fix"), this, SLOT(sFix())); menuItem->setEnabled((static_cast(pItem))->altId() > 0 && _privileges->check("FixSerial")); menuItem = pMenu->addAction(tr("Fix All"), this, SLOT(sFixAll())); menuItem->setEnabled(_privileges->check("FixSerial")); } qt-client-4.1.0/guiclient/fixSerial.h000066400000000000000000000020661217451700100175000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FIXSERIAL_H #define FIXSERIAL_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_fixSerial.h" class fixSerial : public XWidget, public Ui::fixSerial { Q_OBJECT public: fixSerial(QWidget* parent = 0, const char * = 0, Qt::WindowFlags fl = Qt::Window); ~fixSerial(); public slots: virtual void sFillList(); virtual void sFix(); virtual void sFixAll(); virtual void sHandleSerial(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *); protected slots: virtual void languageChange(); virtual bool fixOne(XTreeWidgetItem*); }; #endif // FIXSERIAL_H qt-client-4.1.0/guiclient/fixSerial.ui000066400000000000000000000072161217451700100176700ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. fixSerial 0 0 596 396 Fix Serial Columns 0 6 Only Show Problems Query not run yet 0 0 &Close Query false Fix false Fix All Qt::Vertical 20 35 XTreeWidget QTreeWidget
    xtreewidget.h
    _showProblems _serial _query _fix _fixAll _close _close clicked() fixSerial close() 20 20 20 20
    qt-client-4.1.0/guiclient/form.cpp000066400000000000000000000144001217451700100170430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "form.h" #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" form::form(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); } form::~form() { // no need to delete child widgets, Qt does it all for us } void form::languageChange() { retranslateUi(this); } enum SetResponse form::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("form_id", &valid); if (valid) { _formid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _report->setEnabled(FALSE); _key->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void form::sSave() { XSqlQuery formSave; QList errors; errors << GuiErrorCheck(_name->text().trimmed().isEmpty(), _name, tr("You must enter a valid Name for this Form " "before continuing")) << GuiErrorCheck(_report->id() == -1, _report, tr("You must select a Report for this Form " "before continuing")) ; if (_mode == cNew) { formSave.prepare( "SELECT form_id " "FROM form " "WHERE (form_name=:form_name);" ); formSave.bindValue(":form_name", _name->text()); formSave.exec(); if (formSave.first()) errors << GuiErrorCheck(true, _name, tr( "A Form has already been defined with the selected Name.\n" "You may not create duplicate Forms." ) ); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Form"), errors)) return; if (_mode == cNew) { formSave.exec("SELECT NEXTVAL('form_form_id_seq') AS _form_id"); if (formSave.first()) _formid = formSave.value("_form_id").toInt(); else if (formSave.lastError().type() != QSqlError::NoError) { systemError(this, formSave.lastError().databaseText(), __FILE__, __LINE__); return; } formSave.prepare( "INSERT INTO form " "(form_id, form_name, form_descrip, form_report_name, form_key) " "VALUES " "(:form_id, :form_name, :form_descrip, :form_report_name, :form_key);" ); } else if (_mode == cEdit) formSave.prepare( "UPDATE form " "SET form_name=:form_name, form_descrip=:form_descrip," " form_report_name=:form_report_name, form_key=:form_key " "WHERE (form_id=:form_id);" ); formSave.bindValue(":form_id", _formid); formSave.bindValue(":form_name", _name->text()); formSave.bindValue(":form_descrip", _descrip->text()); formSave.bindValue(":form_report_name", _report->code()); if (_key->currentIndex() == 0) formSave.bindValue(":form_key", "Cust"); else if (_key->currentIndex() == 1) formSave.bindValue(":form_key", "Item"); else if (_key->currentIndex() == 2) formSave.bindValue(":form_key", "ItSt"); else if (_key->currentIndex() == 3) formSave.bindValue(":form_key", "PO"); else if (_key->currentIndex() == 4) formSave.bindValue(":form_key", "SO"); else if (_key->currentIndex() == 5) formSave.bindValue(":form_key", "Vend"); else if (_key->currentIndex() == 6) formSave.bindValue(":form_key", "WO"); else if (_key->currentIndex() == 7) formSave.bindValue(":form_key", "SASC"); else if (_key->currentIndex() == 8) formSave.bindValue(":form_key", "PES"); else if (_key->currentIndex() == 9) formSave.bindValue(":form_key", "RA"); else formSave.bindValue(":form_key", ""); formSave.exec(); if (formSave.lastError().type() != QSqlError::NoError) { systemError(this, formSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_formid); } void form::populate() { XSqlQuery formpopulate; formpopulate.prepare( "SELECT * " "FROM form " "WHERE (form_id=:form_id);" ); formpopulate.bindValue(":form_id", _formid); formpopulate.exec(); if (formpopulate.first()) { _name->setText(formpopulate.value("form_name").toString()); _descrip->setText(formpopulate.value("form_descrip").toString()); _report->setCode(formpopulate.value("form_report_name").toString()); if (formpopulate.value("form_key").toString() == "Cust") _key->setCurrentIndex(0); else if (formpopulate.value("form_key").toString() == "Item") _key->setCurrentIndex(1); else if (formpopulate.value("form_key").toString() == "ItSt") _key->setCurrentIndex(2); else if (formpopulate.value("form_key").toString() == "PO") _key->setCurrentIndex(3); else if (formpopulate.value("form_key").toString() == "SO") _key->setCurrentIndex(4); else if (formpopulate.value("form_key").toString() == "Vend") _key->setCurrentIndex(5); else if (formpopulate.value("form_key").toString() == "WO") _key->setCurrentIndex(6); else if (formpopulate.value("form_key").toString() == "SASC") _key->setCurrentIndex(7); else if (formpopulate.value("form_key").toString() == "PES") _key->setCurrentIndex(8); else if (formpopulate.value("form_key").toString() == "RA") _key->setCurrentIndex(9); else _key->setCurrentIndex(-1); } else if (formpopulate.lastError().type() != QSqlError::NoError) { systemError(this, formpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/form.h000066400000000000000000000017401217451700100165130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FORM_H #define FORM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_form.h" class form : public XDialog, public Ui::form { Q_OBJECT public: form(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~form(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _formid; }; #endif // FORM_H qt-client-4.1.0/guiclient/form.ui000066400000000000000000000171531217451700100167060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. form 0 0 443 134 Form 0 0 5 0 5 0 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report &Report: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report Keyed On: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 true XComboBox::Reports Customers Items Item Sites Purchase Orders Sales Orders Vendors Work Orders Sales Analysis - Special Calendar Production Entry Sheets Return Authorizations Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _name _descrip _report _key _buttonBox rejected() form reject() 396 68 221 66
    qt-client-4.1.0/guiclient/forms.cpp000066400000000000000000000044331217451700100172330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "forms.h" #include #include #include #include "form.h" #include "guiclient.h" forms::forms(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_form, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_form, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_form, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); _form->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "form_name" ); _form->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "form_descrip" ); sFillList(); } forms::~forms() { // no need to delete child widgets, Qt does it all for us } void forms::languageChange() { retranslateUi(this); } void forms::sNew() { ParameterList params; params.append("mode", "new"); form newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void forms::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("form_id", _form->id()); form newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void forms::sDelete() { XSqlQuery formsDelete; formsDelete.prepare( "DELETE FROM form " "WHERE (form_id=:form_id);" ); formsDelete.bindValue(":form_id", _form->id()); formsDelete.exec(); sFillList(); } void forms::sFillList() { _form->populate( "SELECT form_id, form_name, form_descrip " "FROM form " "ORDER BY form_name;" ); } qt-client-4.1.0/guiclient/forms.h000066400000000000000000000015711217451700100167000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FORMS_H #define FORMS_H #include "xwidget.h" #include "ui_forms.h" class forms : public XWidget, public Ui::forms { Q_OBJECT public: forms(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~forms(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // FORMS_H qt-client-4.1.0/guiclient/forms.ui000066400000000000000000000116121217451700100170630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. forms 0 0 600 400 List Forms 0 Forms: 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _form _new _edit _delete _close _form valid(bool) _delete setEnabled(bool) 20 20 20 20 _form itemSelected(int) _edit animateClick() 20 20 20 20 _form valid(bool) _edit setEnabled(bool) 20 20 20 20 _close clicked() forms close() 20 20 20 20
    qt-client-4.1.0/guiclient/forwardUpdateAccounts.cpp000066400000000000000000000051231217451700100224110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "forwardUpdateAccounts.h" #include #include #include "guiclient.h" forwardUpdateAccounts::forwardUpdateAccounts(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(accept())); connect(_typeSelected, SIGNAL(toggled(bool)), _type, SLOT(setEnabled(bool))); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); } forwardUpdateAccounts::~forwardUpdateAccounts() { // no need to delete child widgets, Qt does it all for us } void forwardUpdateAccounts::languageChange() { retranslateUi(this); } void forwardUpdateAccounts::sUpdate() { XSqlQuery forwardUpdate; if(_accntSelected->isChecked() && _accnt->id() == -1) { QMessageBox::warning(this, tr("No Account Selected"), tr("You have choosen to use an account but no account was specified.") ); return; } if(_accntSelected->isChecked()) { forwardUpdate.prepare("SELECT forwardUpdateAccount(:accnt_id) AS result;"); forwardUpdate.bindValue(":accnt_id", _accnt->id()); } else if(_typeSelected->isChecked()) { forwardUpdate.prepare("SELECT forwardUpdateAccount(accnt_id) AS result" " FROM accnt LEFT OUTER JOIN company ON (company_number=accnt_company)" " WHERE((accnt_type=:accnt_type)" " AND (NOT COALESCE(company_external,false)));"); if (_type->currentIndex() == 0) forwardUpdate.bindValue(":accnt_type", "A"); else if (_type->currentIndex() == 1) forwardUpdate.bindValue(":accnt_type", "L"); else if (_type->currentIndex() == 2) forwardUpdate.bindValue(":accnt_type", "E"); else if (_type->currentIndex() == 3) forwardUpdate.bindValue(":accnt_type", "R"); else if (_type->currentIndex() == 4) forwardUpdate.bindValue(":accnt_type", "Q"); } else forwardUpdate.prepare("SELECT forwardUpdateAccount(accnt_id) AS result" " FROM accnt LEFT OUTER JOIN company ON (company_number=accnt_company)" " WHERE (NOT COALESCE(company_external,false));"); forwardUpdate.exec(); } qt-client-4.1.0/guiclient/forwardUpdateAccounts.h000066400000000000000000000016631217451700100220630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FORWARDUPDATEACCOUNTS_H #define FORWARDUPDATEACCOUNTS_H #include "xdialog.h" #include "ui_forwardUpdateAccounts.h" class forwardUpdateAccounts : public XDialog, public Ui::forwardUpdateAccounts { Q_OBJECT public: forwardUpdateAccounts(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~forwardUpdateAccounts(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); }; #endif // FORWARDUPDATEACCOUNTS_H qt-client-4.1.0/guiclient/forwardUpdateAccounts.ui000066400000000000000000000206601217451700100222470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. forwardUpdateAccounts 0 0 600 99 Forward Update Accounts 5 5 0 0 0 5 All Accounts true 5 0 Selected Account: false 5 0 Account Type: 0 0 false Asset Liability Expense Revenue Equity Qt::Horizontal QSizePolicy::Expanding 51 20 Qt::Vertical QSizePolicy::Expanding 20 20 0 0 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 0 0 5 0 Close Update Qt::Vertical QSizePolicy::Expanding 20 20 GLCluster QWidget
    glcluster.h
    _allSelected _accntSelected _accnt _typeSelected _type _update _close _close clicked() forwardUpdateAccounts accept() 537 28 20 20 _typeSelected toggled(bool) _type setEnabled(bool) 34 79 141 79 _accntSelected toggled(bool) _accnt setEnabled(bool) 87 48 157 46
    qt-client-4.1.0/guiclient/freightBreakdown.cpp000066400000000000000000000125541217451700100213750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "freightBreakdown.h" #include #include #include freightBreakdown::freightBreakdown(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sSave())); _freight->addColumn(tr("Schedule"), _itemColumn, Qt::AlignLeft, true, "freightdata_schedule"); _freight->addColumn(tr("From"), _itemColumn, Qt::AlignLeft, true, "freightdata_from"); _freight->addColumn(tr("To"), _itemColumn, Qt::AlignLeft, true, "freightdata_to"); _freight->addColumn(tr("Ship Via"), _itemColumn, Qt::AlignLeft, true, "freightdata_shipvia"); _freight->addColumn(tr("Freight Class"), _itemColumn, Qt::AlignLeft, true, "freightdata_freightclass"); _freight->addColumn(tr("Total Weight"), _qtyColumn, Qt::AlignRight, true, "freightdata_weight"); _freight->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "freightdata_uom"); _freight->addColumn(tr("Price"), _moneyColumn, Qt::AlignRight, true, "freightdata_price"); _freight->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "freightdata_type"); _freight->addColumn(tr("Total"), _moneyColumn, Qt::AlignRight, true, "freightdata_total"); _freight->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter, true, "freightdata_currency"); } freightBreakdown::~freightBreakdown() { // no need to delete child widgets, Qt does it all for us } void freightBreakdown::languageChange() { retranslateUi(this); } SetResponse freightBreakdown::set(const ParameterList& pParams) { XSqlQuery freightet; XDialog::set(pParams); QVariant param; bool valid; ParameterList params; param = pParams.value("order_id", &valid); if (valid) { _orderid = param.toInt(); params.append("order_id", _orderid); } param = pParams.value("cust_id", &valid); if (valid) params.append("cust_id", param.toInt()); param = pParams.value("shipto_id", &valid); if (valid) params.append("shipto_id", param.toInt()); param = pParams.value("orderdate", &valid); if (valid) params.append("orderdate", param.toDate()); param = pParams.value("shipvia", &valid); if (valid) params.append("shipvia", param.toString()); param = pParams.value("curr_id", &valid); if (valid) params.append("curr_id", param.toInt()); param = pParams.value("document_number", &valid); if (valid) _document->setText(param.toString()); param = pParams.value("order_type", &valid); if (valid) { _ordertype = param.toString(); params.append("order_type", _ordertype); if (_ordertype == "SO") _header->setText(tr("Freight Breakdown for Sales Order:")); else if (_ordertype == "QU") _header->setText(tr("Freight Breakdown for Quote:")); else _header->setText(tr("Freight Breakdown for Return Auth.:")); } param = pParams.value("calcfreight", &valid); if (valid) { _calcfreight = param.toBool(); if (_calcfreight == true) _calculated->setChecked(true); else _manual->setChecked(true); } param = pParams.value("mode", &valid); if (valid) { if(param.toString() == "view") _mode = cView; else _mode = cEdit; } QString sql = "SELECT *," " 'weight' AS freightdata_weight_xtnumericrole," " 'salesprice' AS freightdata_price_xtnumericrole," " 'curr' AS freightdata_total_xtnumericrole," " 0 AS freightdata_total_xttotalrole " "FROM freightDetail(," " ," " ," " ," " ," " ," " );"; MetaSQLQuery mql(sql); freightet = mql.toQuery(params); _freight->populate(freightet); if (freightet.lastError().type() != QSqlError::NoError) { systemError(this, freightet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } return NoError; } void freightBreakdown::sSave() { XSqlQuery ord; if (_ordertype == "SO") { ord.prepare("UPDATE cohead " " SET cohead_calcfreight=:calc " "WHERE (cohead_id=:ordid); "); } else if (_ordertype == "QU") { ord.prepare("UPDATE quhead " " SET quhead_calcfreight=:calc " "WHERE (quhead_id=:ordid); "); } else { accept(); return; } ord.bindValue(":ordid", _orderid); ord.bindValue(":calc", QVariant(_calculated->isChecked())); ord.exec(); accept(); } qt-client-4.1.0/guiclient/freightBreakdown.h000066400000000000000000000020631217451700100210340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FREIGHTBREAKDOWN_H #define FREIGHTBREAKDOWN_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_freightBreakdown.h" class freightBreakdown : public XDialog, public Ui::freightBreakdown { Q_OBJECT public: freightBreakdown(QWidget* = 0, const char* = 0, bool = 0, Qt::WFlags = 0); ~freightBreakdown(); public slots: void languageChange(); virtual SetResponse set(const ParameterList&); virtual void sSave(); private: int _mode; int _orderid; QString _ordertype; bool _calcfreight; }; #endif // FREIGHTBREAKDOWN_H qt-client-4.1.0/guiclient/freightBreakdown.ui000066400000000000000000000106531217451700100212260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. freightBreakdown 0 0 600 400 Freight Breakdown Freight Breakdown for Document: false Qt::Horizontal 40 20 &Close true Qt::Vertical 20 0 12 Calculated true Manual Qt::Horizontal 40 20 0 1 QFrame::NoFrame QFrame::Raised 0 XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    qt-client-4.1.0/guiclient/freightClass.cpp000066400000000000000000000111441217451700100205200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "freightClass.h" #include #include #include #include freightClass::freightClass(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_freightClass, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); } freightClass::~freightClass() { // no need to delete child widgets, Qt does it all for us } void freightClass::languageChange() { retranslateUi(this); } enum SetResponse freightClass::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("freightclass_id", &valid); if (valid) { _freightclassid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _buttonBox->button(QDialogButtonBox::Save)->setEnabled(FALSE); } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _freightClass->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void freightClass::sSave() { XSqlQuery freightSave; if (_freightClass->text().length() == 0) { QMessageBox::information( this, tr("No Freight Class Entered"), tr("You must enter a valid Freight Class before saving this Item Type.") ); _freightClass->setFocus(); return; } if (_mode == cEdit) freightSave.prepare( "UPDATE freightclass " "SET freightclass_code=:freightclass_code, freightclass_descrip=:freightclass_descrip " "WHERE (freightclass_id=:freightclass_id);" ); else if (_mode == cNew) { freightSave.exec("SELECT NEXTVAL('freightclass_freightclass_id_seq') AS freightclass_id"); if (freightSave.first()) _freightclassid = freightSave.value("freightclass_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } freightSave.prepare( "INSERT INTO freightclass " "( freightclass_id, freightclass_code, freightclass_descrip ) " "VALUES " "( :freightclass_id, :freightclass_code, :freightclass_descrip );" ); } freightSave.bindValue(":freightclass_id", _freightclassid); freightSave.bindValue(":freightclass_code", _freightClass->text()); freightSave.bindValue(":freightclass_descrip", _description->text()); freightSave.exec(); if (freightSave.lastError().type() != QSqlError::NoError) { systemError(this, freightSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_freightclassid); } void freightClass::sCheck() { XSqlQuery freightCheck; _freightClass->setText(_freightClass->text().trimmed()); if ( (_mode == cNew) && (_freightClass->text().length()) ) { freightCheck.prepare( "SELECT freightclass_id " "FROM freightclass " "WHERE (UPPER(freightclass_code)=UPPER(:freightclass_code));" ); freightCheck.bindValue(":freightclass_code", _freightClass->text()); freightCheck.exec(); if (freightCheck.first()) { _freightclassid = freightCheck.value("freightclass_id").toInt(); _mode = cEdit; populate(); _freightClass->setEnabled(FALSE); } } _buttonBox->button(QDialogButtonBox::Save)->setEnabled(TRUE); } void freightClass::populate() { XSqlQuery freightpopulate; freightpopulate.prepare( "SELECT * " "FROM freightclass " "WHERE (freightclass_id=:freightclass_id);" ); freightpopulate.bindValue(":freightclass_id", _freightclassid); freightpopulate.exec(); if (freightpopulate.first()) { _freightClass->setText(freightpopulate.value("freightclass_code")); _description->setText(freightpopulate.value("freightclass_descrip")); } } qt-client-4.1.0/guiclient/freightClass.h000066400000000000000000000021061217451700100201630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef freightClass_H #define freightClass_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_freightClass.h" class freightClass : public XDialog, public Ui::freightClass { Q_OBJECT public: freightClass(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~freightClass(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _freightclassid; int _mode; }; #endif // freightClass_H qt-client-4.1.0/guiclient/freightClass.ui000066400000000000000000000073501217451700100203570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. freightClass 0 0 400 100 Freight Class Freight &Class: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _freightClass Qt::Horizontal QSizePolicy::Expanding 0 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _freightClass _description parameter.h
    qt-client-4.1.0/guiclient/freightClasses.cpp000066400000000000000000000114501217451700100210500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "freightClasses.h" #include #include #include #include #include #include "freightClass.h" #include "storedProcErrorLookup.h" freightClasses::freightClasses(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deleteUnused, SIGNAL(clicked()), this, SLOT(sDeleteUnused())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainFreightClasses")) { connect(_freightClass, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_freightClass, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_freightClass, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_freightClass, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); _deleteUnused->setEnabled(FALSE); } _freightClass->addColumn(tr("Code"), 70, Qt::AlignLeft, true, "freightclass_code"); _freightClass->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "freightclass_descrip"); sFillList(-1); } freightClasses::~freightClasses() { // no need to delete child widgets, Qt does it all for us } void freightClasses::languageChange() { retranslateUi(this); } void freightClasses::sNew() { ParameterList params; params.append("mode", "new"); freightClass newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void freightClasses::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("freightclass_id", _freightClass->id()); freightClass newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void freightClasses::sView() { ParameterList params; params.append("mode", "view"); params.append("freightclass_id", _freightClass->id()); freightClass newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void freightClasses::sDelete() { XSqlQuery freightDelete; freightDelete.prepare("SELECT deleteFreightClass(:freightclass_id) AS result;"); freightDelete.bindValue(":freightclass_id", _freightClass->id()); freightDelete.exec(); if (freightDelete.first()) { int result = freightDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteFreightClass", result), __FILE__, __LINE__); return; } } else if (freightDelete.lastError().type() != QSqlError::NoError) { systemError(this, freightDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(-1); } void freightClasses::sPrint() { orReport report("FreightClassesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void freightClasses::sDeleteUnused() { XSqlQuery freightDeleteUnused; if ( QMessageBox::warning( this, tr("Delete Unused Freight Classes"), tr("

    Are you sure that you wish to delete all " "unused Freight Classes?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { freightDeleteUnused.exec("SELECT deleteUnusedFreightClasses() AS result;"); if (freightDeleteUnused.first()) { int result = freightDeleteUnused.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteUnusedFreightClasses", result), __FILE__, __LINE__); return; } } else if (freightDeleteUnused.lastError().type() != QSqlError::NoError) { systemError(this, freightDeleteUnused.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(-1); } } void freightClasses::sFillList(int pId) { _freightClass->populate( "SELECT freightclass_id, freightclass_code, freightclass_descrip " "FROM freightclass " "ORDER BY freightclass_code;", pId ); } qt-client-4.1.0/guiclient/freightClasses.h000066400000000000000000000020351217451700100205140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef freightClassS_H #define freightClassS_H #include "xwidget.h" #include "ui_freightClasses.h" class freightClasses : public XWidget, public Ui::freightClasses { Q_OBJECT public: freightClasses(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~freightClasses(); public slots: virtual void sFillList(int pId); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPrint(); virtual void sDeleteUnused(); protected slots: virtual void languageChange(); }; #endif // freightClasses_H qt-client-4.1.0/guiclient/freightClasses.ui000066400000000000000000000122571217451700100207110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. freightClasses 0 0 600 400 List Freight Classes 0 Freight Classes: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Preferred 20 5 Delete &Unused Qt::Vertical QSizePolicy::Expanding 20 68 XTreeWidget QTreeWidget

    xtreewidget.h
    _freightClass _new _edit _view _delete _deleteUnused _print _close _close clicked() freightClasses close() 20 20 20 20 _freightClass valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/getGLDistDate.cpp000066400000000000000000000020131217451700100205210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "getGLDistDate.h" getGLDistDate::getGLDistDate(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _date->setDate(QDate::currentDate()); } getGLDistDate::~getGLDistDate() { // no need to delete child widgets, Qt does it all for us } void getGLDistDate::languageChange() { retranslateUi(this); } QDate getGLDistDate::date() const { if (_default->isChecked()) return QDate(); else return _date->date(); } void getGLDistDate::sSetDefaultLit(const QString & pStr) { _default->setText(pStr); } qt-client-4.1.0/guiclient/getGLDistDate.h000066400000000000000000000017011217451700100201710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GETGLDISTDATE_H #define GETGLDISTDATE_H #include "guiclient.h" #include "xdialog.h" #include "ui_getGLDistDate.h" class getGLDistDate : public XDialog, public Ui::getGLDistDate { Q_OBJECT public: getGLDistDate(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~getGLDistDate(); virtual QDate date() const; public slots: virtual void sSetDefaultLit(const QString &); protected slots: virtual void languageChange(); }; #endif // GETGLDISTDATE_H qt-client-4.1.0/guiclient/getGLDistDate.ui000066400000000000000000000151461217451700100203670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. getGLDistDate 0 0 493 99 Get G/L Distribution Date 9 6 0 0 0 6 Distribute to the G/L using the following date: 0 6 Qt::Horizontal QSizePolicy::Fixed 8 20 0 0 Default true 0 6 Alternate Date: false Qt::Horizontal 0 20 Qt::Vertical 282 16 Qt::Horizontal 51 20 0 5 Cancel Continue Qt::Vertical 20 0 DLineEdit XLineEdit
    datecluster.h
    _cancel clicked() getGLDistDate reject() 543 35 259 59 _continue clicked() getGLDistDate accept() 543 68 259 59 _particular toggled(bool) _date setEnabled(bool) 115 84 221 85
    qt-client-4.1.0/guiclient/getLotInfo.cpp000066400000000000000000000043061217451700100201560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "getLotInfo.h" #include #include getLotInfo::getLotInfo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_assign, SIGNAL(clicked()), this, SLOT(sAssign())); } getLotInfo::~getLotInfo() { // no need to delete child widgets, Qt does it all for us } void getLotInfo::languageChange() { retranslateUi(this); } QString getLotInfo::lot() { return _lot->text(); } QDate getLotInfo::expiration() { if(_expiration->isEnabled()) return _expiration->date(); else return omfgThis->endOfTime(); } QDate getLotInfo::warranty() { if(_warranty->isEnabled()) return _warranty->date(); else return QDate(); } void getLotInfo::enableExpiration( bool yes ) { _expiration->setEnabled(yes); } void getLotInfo::enableWarranty( bool yes ) { _warranty->setEnabled(yes); } void getLotInfo::sAssign() { if (_lot->text().isEmpty()) { QMessageBox::critical( this, tr("Enter A Lot Number"), tr("You must specifiy a Lot Number.") ); _lot->setFocus(); return; } if ( (_expiration->isEnabled()) && (!_expiration->isValid()) ) { QMessageBox::critical( this, tr("Enter Expiration Date"), tr("You must enter an expiration date to this Perishable Lot/Serial number.") ); _expiration->setFocus(); return; } if ( (_warranty->isEnabled()) && (!_warranty->isValid()) ) { QMessageBox::critical( this, tr("Enter Warranty Date"), tr("You must enter an warranty date to this Lot/Serial number.") ); _expiration->setFocus(); return; } accept(); } qt-client-4.1.0/guiclient/getLotInfo.h000066400000000000000000000020471217451700100176230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GETLOTINFO_H #define GETLOTINFO_H #include "guiclient.h" #include "xdialog.h" #include "ui_getLotInfo.h" class getLotInfo : public XDialog, public Ui::getLotInfo { Q_OBJECT public: getLotInfo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~getLotInfo(); public slots: virtual QString lot(); virtual QDate expiration(); virtual QDate warranty(); virtual void enableExpiration( bool yes ); virtual void enableWarranty( bool yes ); virtual void sAssign(); protected slots: virtual void languageChange(); }; #endif // GETLOTINFO_H qt-client-4.1.0/guiclient/getLotInfo.ui000066400000000000000000000121741217451700100200130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. getLotInfo 0 0 415 114 Lot Information Lot #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 &Cancel &Assign true true Qt::Vertical QSizePolicy::Preferred 20 0 Expiration Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 31 10 Warranty Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 31 10 DLineEdit XLineEdit
    datecluster.h
    XLineEdit QLineEdit
    xlineedit.h
    _lot _expiration _warranty _assign _close _close clicked() getLotInfo reject() 20 20 20 20
    qt-client-4.1.0/guiclient/getscreen.cpp000066400000000000000000000023031217451700100200560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "getscreen.h" #define STARTCLASSLIST \ if(classname.isEmpty()) \ return 0; #define ENDCLASSLIST #define CLASSITEM(cn) \ if(classname == #cn) { \ w = new cn(parent, #cn, wflags); \ w->setObjectName(#cn); \ } #include "getscreen_headerlist.h" QWidget * xtGetScreen(const QString & classname, QWidget * parent, Qt::WindowFlags wflags, const QString & objectname) { QWidget * w = 0; STARTCLASSLIST #include "getscreen_classlist.h" /* Added in as an aliased name */ if(classname == "AdatabaseInformation") { w = new databaseInformation(parent, "databaseInformation", wflags); w->setObjectName("databaseInformation"); } ENDCLASSLIST if(w) { if(!objectname.isEmpty()) w->setObjectName(objectname); } return w; } qt-client-4.1.0/guiclient/getscreen.h000066400000000000000000000011631217451700100175260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __GETSCREEN_H__ #define __GETSCREEN_H__ #include QWidget * xtGetScreen(const QString &, QWidget *, Qt::WindowFlags = 0, const QString & = QString::null); #endif qt-client-4.1.0/guiclient/getscreen_classlist.h000066400000000000000000000433421217451700100216140ustar00rootroot00000000000000// generated 2009-04-30 // grep "public X[Dialog,Widget]" *.h | awk '{print "CLASSITEM("$2")"}' > getscreen_classlist.h CLASSITEM(absoluteCalendarItem) CLASSITEM(accountingPeriod) CLASSITEM(accountingPeriods) CLASSITEM(accountingYearPeriod) CLASSITEM(accountingYearPeriods) CLASSITEM(accountNumber) CLASSITEM(accountNumbers) CLASSITEM(addPoComment) CLASSITEM(addresses) CLASSITEM(address) CLASSITEM(adjustmentTrans) CLASSITEM(adjustInvValue) CLASSITEM(allocateARCreditMemo) CLASSITEM(allocateReservations) CLASSITEM(apAccountAssignment) CLASSITEM(apAccountAssignments) CLASSITEM(apCreditMemoApplication) CLASSITEM(apOpenItem) CLASSITEM(applyAPCreditMemo) CLASSITEM(applyARCreditMemo) CLASSITEM(applyDiscount) CLASSITEM(apWorkBench) CLASSITEM(arAccountAssignment) CLASSITEM(arAccountAssignments) CLASSITEM(archRestoreSalesHistory) CLASSITEM(arCreditMemoApplication) CLASSITEM(arOpenItem) CLASSITEM(arWorkBench) CLASSITEM(assignClassCodeToPlannerCode) CLASSITEM(assignItemToPlannerCode) CLASSITEM(assignLotSerial) CLASSITEM(bankAccount) CLASSITEM(bankAccounts) CLASSITEM(bankAdjustmentEditList) CLASSITEM(bankAdjustment) CLASSITEM(bankAdjustmentType) CLASSITEM(bankAdjustmentTypes) CLASSITEM(BOM) CLASSITEM(bomItem) CLASSITEM(bomList) CLASSITEM(budgets) CLASSITEM(buyCard) CLASSITEM(calendar) CLASSITEM(calendars) CLASSITEM(cashReceipt) CLASSITEM(cashReceiptItem) CLASSITEM(cashReceiptMiscDistrib) CLASSITEM(cashReceiptsEditList) CLASSITEM(changePoitemQty) CLASSITEM(changeWoQty) CLASSITEM(characteristicAssignment) CLASSITEM(characteristic) CLASSITEM(characteristicPrice) CLASSITEM(characteristics) CLASSITEM(checkFormat) CLASSITEM(checkFormats) CLASSITEM(check) CLASSITEM(classCode) CLASSITEM(classCodes) CLASSITEM(closePurchaseOrder) CLASSITEM(closeWo) CLASSITEM(commentType) CLASSITEM(commentTypes) CLASSITEM(companies) CLASSITEM(company) CLASSITEM(configureCC) CLASSITEM(configureCRM) CLASSITEM(configureEncryption) CLASSITEM(configureGL) CLASSITEM(configureIE) CLASSITEM(configureIM) CLASSITEM(configureMS) CLASSITEM(configurePD) CLASSITEM(configurePO) CLASSITEM(configureSO) CLASSITEM(configureSearchPath) CLASSITEM(configureWO) CLASSITEM(confirmAchOK) CLASSITEM(contact) CLASSITEM(contacts) CLASSITEM(contactMerge) CLASSITEM(contract) CLASSITEM(contracts) CLASSITEM(copyBOM) CLASSITEM(copyBudget) CLASSITEM(copyContract) CLASSITEM(copyItem) CLASSITEM(copyPurchaseOrder) CLASSITEM(copySalesOrder) CLASSITEM(copyTransferOrder) CLASSITEM(correctProductionPosting) CLASSITEM(costCategories) CLASSITEM(costCategory) CLASSITEM(costingElements) CLASSITEM(countries) CLASSITEM(country) CLASSITEM(countSlip) CLASSITEM(countTag) CLASSITEM(countTagList) CLASSITEM(createCountTagsByItem) CLASSITEM(createCountTagsByParameterList) CLASSITEM(createCycleCountTags) CLASSITEM(createInvoices) CLASSITEM(createItemSitesByClassCode) CLASSITEM(createLotSerial) CLASSITEM(createPlannedOrdersByItem) CLASSITEM(createPlannedOrdersByPlannerCode) CLASSITEM(createRecurringInvoices) CLASSITEM(createRecurringItems) CLASSITEM(creditCard) CLASSITEM(creditMemoEditList) CLASSITEM(creditMemo) CLASSITEM(creditMemoItem) CLASSITEM(crmaccount) CLASSITEM(crmaccounts) CLASSITEM(currencies) CLASSITEM(currencyConversion) CLASSITEM(currencyConversions) CLASSITEM(currency) CLASSITEM(currencySelect) CLASSITEM(customCommandArgument) CLASSITEM(customCommand) CLASSITEM(customCommands) CLASSITEM(customerFormAssignment) CLASSITEM(customerFormAssignments) CLASSITEM(customerGroup) CLASSITEM(customerGroups) CLASSITEM(customer) CLASSITEM(customers) CLASSITEM(customerType) CLASSITEM(customerTypeList) CLASSITEM(customerTypes) CLASSITEM(databaseInformation) CLASSITEM(deletePlannedOrder) CLASSITEM(deletePlannedOrdersByPlannerCode) CLASSITEM(department) CLASSITEM(departments) CLASSITEM(distributeInventory) CLASSITEM(distributeToLocation) CLASSITEM(dspAllocations) CLASSITEM(dspAPApplications) CLASSITEM(dspAPOpenItemsByVendor) CLASSITEM(dspARApplications) CLASSITEM(dspAROpenItems) CLASSITEM(dspBacklog) CLASSITEM(dspBankrecHistory) CLASSITEM(dspBillingSelections) CLASSITEM(dspBookings) CLASSITEM(dspBriefEarnedCommissions) CLASSITEM(dspBriefSalesHistory) CLASSITEM(dspCapacityUOMsByClassCode) CLASSITEM(dspCapacityUOMsByProductCategory) CLASSITEM(dspCashReceipts) CLASSITEM(dspCheckRegister) CLASSITEM(dspCostedIndentedBOM) CLASSITEM(dspCostedSingleLevelBOM) CLASSITEM(dspCostedSummarizedBOM) CLASSITEM(dspCountSlipEditList) CLASSITEM(dspCountSlipsByWarehouse) CLASSITEM(dspCountTagEditList) CLASSITEM(dspCountTagsByClassCode) CLASSITEM(dspCountTagsByItem) CLASSITEM(dspCountTagsByWarehouse) CLASSITEM(dspCustomerARHistory) CLASSITEM(dspDepositsRegister) CLASSITEM(dspDetailedInventoryHistoryByLocation) CLASSITEM(dspDetailedInventoryHistoryByLotSerial) CLASSITEM(dspEarnedCommissions) CLASSITEM(dspExpediteExceptionsByPlannerCode) CLASSITEM(dspExpiredInventoryByClassCode) CLASSITEM(dspFinancialReport) CLASSITEM(dspFreightPricesByCustomer) CLASSITEM(dspFreightPricesByCustomerType) CLASSITEM(dspFrozenItemSites) CLASSITEM(dspGLSeries) CLASSITEM(dspGLTransactions) CLASSITEM(dspIndentedBOM) CLASSITEM(dspIndentedWhereUsed) CLASSITEM(dspInvalidBillsOfMaterials) CLASSITEM(dspInventoryAvailabilityByCustomerType) CLASSITEM(dspInventoryAvailabilityByWorkOrder) CLASSITEM(dspInventoryHistory) CLASSITEM(dspInventoryLocator) CLASSITEM(dspInvoiceInformation) CLASSITEM(dspInvoiceRegister) CLASSITEM(dspItemCostDetail) CLASSITEM(dspItemCostHistory) CLASSITEM(dspItemCostsByClassCode) CLASSITEM(dspItemCostSummary) CLASSITEM(dspItemSources) CLASSITEM(dspItemsWithoutItemSources) CLASSITEM(dspJobCosting) CLASSITEM(dspMaterialUsageVarianceByBOMItem) CLASSITEM(dspMaterialUsageVarianceByComponentItem) CLASSITEM(dspMaterialUsageVarianceByItem) CLASSITEM(dspMaterialUsageVarianceByWarehouse) CLASSITEM(dspMaterialUsageVarianceByWorkOrder) CLASSITEM(dspMRPDetail) CLASSITEM(dspOrderActivityByProject) CLASSITEM(dspOrders) CLASSITEM(dspPartiallyShippedOrders) CLASSITEM(dspPendingAvailability) CLASSITEM(dspPendingBOMChanges) CLASSITEM(dspPlannedOrders) CLASSITEM(dspPoDeliveryDateVariancesByItem) CLASSITEM(dspPoDeliveryDateVariancesByVendor) CLASSITEM(dspPoHistory) CLASSITEM(dspPoItemReceivingsByDate) CLASSITEM(dspPoItemReceivingsByItem) CLASSITEM(dspPoItemReceivingsByVendor) CLASSITEM(dspPoItemsByDate) CLASSITEM(dspPoItemsByItem) CLASSITEM(dspPoItemsByVendor) CLASSITEM(dspPoPriceVariancesByItem) CLASSITEM(dspPoPriceVariancesByVendor) CLASSITEM(dspPoReturnsByVendor) CLASSITEM(dspPOsByDate) CLASSITEM(dspPOsByVendor) CLASSITEM(dspPricesByCustomer) CLASSITEM(dspPricesByCustomerType) CLASSITEM(dspPricesByItem) CLASSITEM(dspPurchaseReqsByItem) CLASSITEM(dspPurchaseReqsByPlannerCode) CLASSITEM(dspQOH) CLASSITEM(dspQOHByLocation) CLASSITEM(dspQuotesByCustomer) CLASSITEM(dspQuotesByItem) CLASSITEM(dspReorderExceptionsByPlannerCode) CLASSITEM(dspReservations) CLASSITEM(dspRunningAvailability) CLASSITEM(dspSalesHistory) CLASSITEM(dspSalesOrdersByCustomer) CLASSITEM(dspSalesOrdersByCustomerPO) CLASSITEM(dspSalesOrdersByItem) CLASSITEM(dspSalesOrdersByParameterList) CLASSITEM(dspSalesOrderStatus) CLASSITEM(dspShipmentsByDate) CLASSITEM(dspShipmentsBySalesOrder) CLASSITEM(dspShipmentsByShipment) CLASSITEM(dspSingleLevelBOM) CLASSITEM(dspSingleLevelWhereUsed) CLASSITEM(dspSlowMovingInventoryByClassCode) CLASSITEM(dspStandardJournalHistory) CLASSITEM(dspSubstituteAvailabilityByItem) CLASSITEM(dspSummarizedBacklogByWarehouse) CLASSITEM(dspSummarizedBankrecHistory) CLASSITEM(dspSummarizedBOM) CLASSITEM(dspSummarizedGLTransactions) CLASSITEM(dspSummarizedSales) CLASSITEM(dspTaxHistory) CLASSITEM(dspTimePhasedAvailability) CLASSITEM(dspTimePhasedBookings) CLASSITEM(dspTimePhasedOpenAPItems) CLASSITEM(dspTimePhasedOpenARItems) CLASSITEM(dspTimePhasedSales) CLASSITEM(dspTimePhasedUsageStatisticsByItem) CLASSITEM(dspTrialBalances) CLASSITEM(dspUnbalancedQOHByClassCode) CLASSITEM(dspUndefinedManufacturedItems) CLASSITEM(dspUninvoicedReceivings) CLASSITEM(dspUnusedPurchasedItems) CLASSITEM(dspUsageStatistics) CLASSITEM(dspValidLocationsByItem) CLASSITEM(dspVendorAPHistory) CLASSITEM(dspVoucherRegister) CLASSITEM(dspWoHistoryByClassCode) CLASSITEM(dspWoHistoryByItem) CLASSITEM(dspWoHistoryByNumber) CLASSITEM(dspWoMaterialsByItem) CLASSITEM(dspWoMaterialsByWorkOrder) CLASSITEM(dspWoSchedule) CLASSITEM(duplicateAccountNumbers) CLASSITEM(editOwners) CLASSITEM(empGroup) CLASSITEM(empGroups) CLASSITEM(employee) CLASSITEM(employees) CLASSITEM(enterMiscCount) CLASSITEM(enterPoitemReceipt) CLASSITEM(enterPoitemReturn) CLASSITEM(enterPoReceipt) CLASSITEM(enterPoReturn) CLASSITEM(errorLog) CLASSITEM(eventManager) CLASSITEM(expenseCategories) CLASSITEM(expenseCategory) CLASSITEM(expenseTrans) CLASSITEM(explodeWo) CLASSITEM(exportData) CLASSITEM(externalCCTransaction) CLASSITEM(externalShipping) CLASSITEM(externalShippingList) CLASSITEM(failedPostList) CLASSITEM(financialLayoutColumns) CLASSITEM(financialLayoutGroup) CLASSITEM(financialLayout) CLASSITEM(financialLayoutItem) CLASSITEM(financialLayouts) CLASSITEM(financialLayoutSpecial) CLASSITEM(firmPlannedOrder) CLASSITEM(firmPlannedOrdersByPlannerCode) CLASSITEM(fixACL) CLASSITEM(fixSerial) CLASSITEM(form) CLASSITEM(forms) CLASSITEM(forwardUpdateAccounts) CLASSITEM(freightBreakdown) CLASSITEM(freightClasses) CLASSITEM(freightClass) CLASSITEM(getGLDistDate) CLASSITEM(getLotInfo) CLASSITEM(glSeries) CLASSITEM(glSeriesItem) CLASSITEM(glTransactionDetail) CLASSITEM(glTransaction) CLASSITEM(group) CLASSITEM(groups) CLASSITEM(honorific) CLASSITEM(honorifics) CLASSITEM(hotkey) CLASSITEM(hotkeys) CLASSITEM(idleShutdown) CLASSITEM(image) CLASSITEM(imageList) CLASSITEM(images) CLASSITEM(implodeWo) CLASSITEM(importData) CLASSITEM(incidentCategories) CLASSITEM(incidentCategory) CLASSITEM(incident) CLASSITEM(incidentPriorities) CLASSITEM(incidentPriority) CLASSITEM(incidentResolution) CLASSITEM(incidentResolutions) CLASSITEM(incidentSeverities) CLASSITEM(incidentSeverity) CLASSITEM(incidentWorkbench) CLASSITEM(invoice) CLASSITEM(invoiceItem) CLASSITEM(invoiceList) CLASSITEM(issueLineToShipping) CLASSITEM(issueToShipping) CLASSITEM(issueWoMaterialBatch) CLASSITEM(issueWoMaterialItem) CLASSITEM(itemAlias) CLASSITEM(itemAvailabilityWorkbench) CLASSITEM(itemCost) CLASSITEM(itemGroup) CLASSITEM(itemGroups) CLASSITEM(item) CLASSITEM(itemImages) CLASSITEM(itemListPrice) CLASSITEM(itemPricingSchedule) CLASSITEM(itemPricingScheduleItem) CLASSITEM(itemPricingSchedules) CLASSITEM(items) CLASSITEM(itemSite) CLASSITEM(itemSites) CLASSITEM(itemSource) CLASSITEM(itemSourceList) CLASSITEM(itemSourcePrice) CLASSITEM(itemSourceSearch) CLASSITEM(itemSources) CLASSITEM(itemSubstitute) CLASSITEM(itemtax) CLASSITEM(itemUOM) CLASSITEM(labelForm) CLASSITEM(labelForms) CLASSITEM(listRecurringInvoices) CLASSITEM(locales) CLASSITEM(location) CLASSITEM(locations) CLASSITEM(lotSerial) CLASSITEM(lotSerialSequences) CLASSITEM(lotSerialRegistration) CLASSITEM(maintainBudget) CLASSITEM(maintainItemCosts) CLASSITEM(maintainShipping) CLASSITEM(massExpireComponent) CLASSITEM(massReplaceComponent) CLASSITEM(materialReceiptTrans) CLASSITEM(metasqls) CLASSITEM(miscCheck) CLASSITEM(miscVoucher) CLASSITEM(openReturnAuthorizations) CLASSITEM(openSalesOrders) CLASSITEM(openVouchers) CLASSITEM(opportunity) CLASSITEM(opportunityList) CLASSITEM(opportunitySource) CLASSITEM(opportunitySources) CLASSITEM(opportunityStage) CLASSITEM(opportunityStages) CLASSITEM(opportunityType) CLASSITEM(opportunityTypes) CLASSITEM(package) CLASSITEM(packages) CLASSITEM(packingListBatch) CLASSITEM(plannedOrder) CLASSITEM(plannerCode) CLASSITEM(plannerCodes) CLASSITEM(poLiabilityDistrib) CLASSITEM(postCashReceipts) CLASSITEM(postCheck) CLASSITEM(postChecks) CLASSITEM(postCostsByClassCode) CLASSITEM(postCostsByItem) CLASSITEM(postCountSlips) CLASSITEM(postCountTags) CLASSITEM(postCreditMemos) CLASSITEM(postInvoices) CLASSITEM(postMiscProduction) CLASSITEM(postPoReturnCreditMemo) CLASSITEM(postProduction) CLASSITEM(postPurchaseOrder) CLASSITEM(postPurchaseOrdersByAgent) CLASSITEM(postStandardJournalGroup) CLASSITEM(postStandardJournal) CLASSITEM(postVouchers) CLASSITEM(prepareCheckRun) CLASSITEM(priceList) CLASSITEM(pricingScheduleAssignment) CLASSITEM(pricingScheduleAssignments) CLASSITEM(printCheck) CLASSITEM(printChecks) CLASSITEM(printChecksReview) CLASSITEM(printCreditMemo) CLASSITEM(printCreditMemos) CLASSITEM(printInvoice) CLASSITEM(printInvoices) CLASSITEM(printItemLabelsByClassCode) CLASSITEM(printLabelsByInvoice) CLASSITEM(printLabelsByOrder) CLASSITEM(printLabelsBySo) CLASSITEM(printLabelsByTo) CLASSITEM(printMulticopyDocument) CLASSITEM(printOptions) CLASSITEM(printPackingListBatchByShipvia) CLASSITEM(printPackingList) CLASSITEM(printPoForm) CLASSITEM(printPurchaseOrder) CLASSITEM(printPurchaseOrdersByAgent) CLASSITEM(printRaForm) CLASSITEM(printShippingForm) CLASSITEM(printShippingForms) CLASSITEM(printSoForm) CLASSITEM(printStatementByCustomer) CLASSITEM(printStatementsByCustomerType) CLASSITEM(printVendorForm) CLASSITEM(printWoForm) CLASSITEM(printWoPickList) CLASSITEM(printWoTraveler) CLASSITEM(productCategories) CLASSITEM(productCategory) CLASSITEM(profitCenter) CLASSITEM(profitCenters) CLASSITEM(project) CLASSITEM(projects) CLASSITEM(prospect) CLASSITEM(prospects) CLASSITEM(purchaseOrder) CLASSITEM(purchaseOrderItem) CLASSITEM(purchaseRequest) CLASSITEM(purgeClosedWorkOrders) CLASSITEM(purgeCreditMemos) CLASSITEM(purgeInvoices) CLASSITEM(purgePostedCounts) CLASSITEM(purgePostedCountSlips) CLASSITEM(quotes) CLASSITEM(reasonCode) CLASSITEM(reasonCodes) CLASSITEM(reassignClassCodeByClassCode) CLASSITEM(reassignCustomerTypeByCustomerType) CLASSITEM(reassignLotSerial) CLASSITEM(reassignProductCategoryByProductCategory) CLASSITEM(recallOrders) CLASSITEM(reconcileBankaccount) CLASSITEM(registrationKey) CLASSITEM(rejectCode) CLASSITEM(rejectCodes) CLASSITEM(relativeCalendarItem) CLASSITEM(releasePlannedOrdersByPlannerCode) CLASSITEM(releaseTransferOrdersByAgent) CLASSITEM(releaseWorkOrdersByPlannerCode) CLASSITEM(relocateInventory) CLASSITEM(reports) CLASSITEM(reprintCreditMemos) CLASSITEM(reprintInvoices) CLASSITEM(reprintMulticopyDocument) CLASSITEM(reprioritizeWo) CLASSITEM(reschedulePoitem) CLASSITEM(rescheduleWo) CLASSITEM(reserveSalesOrderItem) CLASSITEM(resetQOHBalances) CLASSITEM(returnAuthCheck) CLASSITEM(returnAuthItemLotSerial) CLASSITEM(returnAuthorization) CLASSITEM(returnAuthorizationItem) CLASSITEM(returnAuthorizationWorkbench) CLASSITEM(returnWoMaterialBatch) CLASSITEM(returnWoMaterialItem) CLASSITEM(reverseGLSeries) CLASSITEM(sale) CLASSITEM(salesAccount) CLASSITEM(salesAccounts) CLASSITEM(salesCategories) CLASSITEM(salesCategory) CLASSITEM(sales) CLASSITEM(salesHistoryInformation) CLASSITEM(salesOrder) CLASSITEM(salesOrderInformation) CLASSITEM(salesOrderItem) CLASSITEM(salesRep) CLASSITEM(salesReps) CLASSITEM(saleType) CLASSITEM(saleTypes) CLASSITEM(scrapTrans) CLASSITEM(scrapWoMaterialFromWIP) CLASSITEM(scriptEditor) CLASSITEM(scripts) CLASSITEM(searchForEmp) CLASSITEM(selectBankAccount) CLASSITEM(selectBillingQty) CLASSITEM(selectedPayments) CLASSITEM(selectOrderForBilling) CLASSITEM(selectPayment) CLASSITEM(selectPayments) CLASSITEM(selectShippedOrders) CLASSITEM(setup) CLASSITEM(shipOrder) CLASSITEM(shippingChargeType) CLASSITEM(shippingChargeTypes) CLASSITEM(shippingForm) CLASSITEM(shippingForms) CLASSITEM(shippingInformation) CLASSITEM(shippingZone) CLASSITEM(shippingZones) CLASSITEM(shipTo) CLASSITEM(shipVia) CLASSITEM(shipVias) CLASSITEM(siteType) CLASSITEM(siteTypes) CLASSITEM(splitReceipt) CLASSITEM(standardJournalGroup) CLASSITEM(standardJournalGroupItem) CLASSITEM(standardJournalGroups) CLASSITEM(standardJournal) CLASSITEM(standardJournalItem) CLASSITEM(standardJournals) CLASSITEM(states) CLASSITEM(subAccntType) CLASSITEM(subAccntTypes) CLASSITEM(subaccount) CLASSITEM(subaccounts) CLASSITEM(submitAction) CLASSITEM(submitReport) CLASSITEM(substituteList) CLASSITEM(summarizeInvTransByClassCode) CLASSITEM(syncCompanies) CLASSITEM(sysLocale) CLASSITEM(systemMessage) CLASSITEM(task) CLASSITEM(taxAuthorities) CLASSITEM(taxAuthority) CLASSITEM(taxBreakdown) CLASSITEM(taxClasses) CLASSITEM(taxClass) CLASSITEM(taxCode) CLASSITEM(taxCodeRate) CLASSITEM(taxCodes) CLASSITEM(taxDetail) CLASSITEM(taxRegistration) CLASSITEM(taxRegistrations) CLASSITEM(taxType) CLASSITEM(taxTypes) CLASSITEM(taxZone) CLASSITEM(taxZones) CLASSITEM(termses) CLASSITEM(terms) CLASSITEM(thawItemSitesByClassCode) CLASSITEM(todoItem) CLASSITEM(todoListCalendar) CLASSITEM(todoList) CLASSITEM(transactionInformation) CLASSITEM(transferOrder) CLASSITEM(transferOrderItem) CLASSITEM(transferOrders) CLASSITEM(transferTrans) CLASSITEM(transformTrans) CLASSITEM(uiform) CLASSITEM(uiforms) CLASSITEM(unappliedAPCreditMemos) CLASSITEM(unappliedARCreditMemos) CLASSITEM(uninvoicedShipments) CLASSITEM(unpostedCreditMemos) CLASSITEM(unpostedGlSeries) CLASSITEM(unpostedGLTransactions) CLASSITEM(unpostedInvoices) CLASSITEM(unpostedPoReceipts) CLASSITEM(unpostedPurchaseOrders) CLASSITEM(uomConv) CLASSITEM(uom) CLASSITEM(uoms) CLASSITEM(updateABCClass) CLASSITEM(updateActualCostsByClassCode) CLASSITEM(updateActualCostsByItem) CLASSITEM(updateCreditStatusByCustomer) CLASSITEM(updateCycleCountFrequency) CLASSITEM(updateItemSiteLeadTimes) CLASSITEM(updateLateCustCreditStatus) CLASSITEM(updateListPricesByProductCategory) CLASSITEM(updateOUTLevelByItem) CLASSITEM(updateOUTLevelsByClassCode) CLASSITEM(updateOUTLevels) CLASSITEM(updatePrices) CLASSITEM(updateReorderLevels) CLASSITEM(userCostingElement) CLASSITEM(user) CLASSITEM(userList) CLASSITEM(userPreferences) CLASSITEM(users) CLASSITEM(vendorAddress) CLASSITEM(vendorAddressList) CLASSITEM(vendor) CLASSITEM(vendors) CLASSITEM(vendorPriceList) CLASSITEM(vendorType) CLASSITEM(vendorTypes) CLASSITEM(vendorWorkBench) CLASSITEM(viewCheckRun) CLASSITEM(voidChecks) CLASSITEM(voucher) CLASSITEM(voucherItemDistrib) CLASSITEM(voucherItem) CLASSITEM(voucherMiscDistrib) CLASSITEM(warehouse) CLASSITEM(warehouses) CLASSITEM(warehouseZone) CLASSITEM(woMaterialItem) CLASSITEM(workOrder) CLASSITEM(workOrderMaterials) CLASSITEM(XDateInputDialog) CLASSITEM(xsltMap) CLASSITEM(zeroUncountedCountTagsByWarehouse) qt-client-4.1.0/guiclient/getscreen_headerlist.h000066400000000000000000000457621217451700100217470ustar00rootroot00000000000000// generated 2009-04-30 // grep "public X[Dialog,Widget]" *.h | awk -F : '{print "#include \""$1"\""}' > getscreen_headerlist.h #include "absoluteCalendarItem.h" #include "accountingPeriod.h" #include "accountingPeriods.h" #include "accountingYearPeriod.h" #include "accountingYearPeriods.h" #include "accountNumber.h" #include "accountNumbers.h" #include "addPoComment.h" #include "addresses.h" #include "address.h" #include "adjustmentTrans.h" #include "adjustInvValue.h" #include "allocateARCreditMemo.h" #include "allocateReservations.h" #include "apAccountAssignment.h" #include "apAccountAssignments.h" #include "apCreditMemoApplication.h" #include "apOpenItem.h" #include "applyAPCreditMemo.h" #include "applyARCreditMemo.h" #include "applyDiscount.h" #include "apWorkBench.h" #include "arAccountAssignment.h" #include "arAccountAssignments.h" #include "archRestoreSalesHistory.h" #include "arCreditMemoApplication.h" #include "arOpenItem.h" #include "arWorkBench.h" #include "assignClassCodeToPlannerCode.h" #include "assignItemToPlannerCode.h" #include "assignLotSerial.h" #include "bankAccount.h" #include "bankAccounts.h" #include "bankAdjustmentEditList.h" #include "bankAdjustment.h" #include "bankAdjustmentType.h" #include "bankAdjustmentTypes.h" #include "bom.h" #include "bomItem.h" #include "bomList.h" #include "budgets.h" #include "buyCard.h" #include "calendar.h" #include "calendars.h" #include "cashReceipt.h" #include "cashReceiptItem.h" #include "cashReceiptMiscDistrib.h" #include "cashReceiptsEditList.h" #include "changePoitemQty.h" #include "changeWoQty.h" #include "characteristicAssignment.h" #include "characteristic.h" #include "characteristicPrice.h" #include "characteristics.h" #include "checkFormat.h" #include "checkFormats.h" #include "check.h" #include "classCode.h" #include "classCodes.h" #include "closePurchaseOrder.h" #include "closeWo.h" #include "commentType.h" #include "commentTypes.h" #include "companies.h" #include "company.h" #include "configureCC.h" #include "configureCRM.h" #include "configureEncryption.h" #include "configureGL.h" #include "configureIE.h" #include "configureIM.h" #include "configureMS.h" #include "configurePD.h" #include "configurePO.h" #include "configureSO.h" #include "configureSearchPath.h" #include "configureWO.h" #include "confirmAchOK.h" #include "contact.h" #include "contacts.h" #include "contactMerge.h" #include "contract.h" #include "contracts.h" #include "copyBOM.h" #include "copyBudget.h" #include "copyContract.h" #include "copyItem.h" #include "copyPurchaseOrder.h" #include "copySalesOrder.h" #include "copyTransferOrder.h" #include "correctProductionPosting.h" #include "costCategories.h" #include "costCategory.h" #include "costingElements.h" #include "countries.h" #include "country.h" #include "countSlip.h" #include "countTag.h" #include "countTagList.h" #include "createCountTagsByItem.h" #include "createCountTagsByParameterList.h" #include "createCycleCountTags.h" #include "createInvoices.h" #include "createItemSitesByClassCode.h" #include "createLotSerial.h" #include "createPlannedOrdersByItem.h" #include "createPlannedOrdersByPlannerCode.h" #include "createRecurringInvoices.h" #include "createRecurringItems.h" #include "creditCard.h" #include "creditMemoEditList.h" #include "creditMemo.h" #include "creditMemoItem.h" #include "crmaccount.h" #include "crmaccounts.h" #include "currencies.h" #include "currencyConversion.h" #include "currencyConversions.h" #include "currency.h" #include "currencySelect.h" #include "customCommandArgument.h" #include "customCommand.h" #include "customCommands.h" #include "customerFormAssignment.h" #include "customerFormAssignments.h" #include "customerGroup.h" #include "customerGroups.h" #include "customer.h" #include "customers.h" #include "customerType.h" #include "customerTypeList.h" #include "customerTypes.h" #include "databaseInformation.h" #include "deletePlannedOrder.h" #include "deletePlannedOrdersByPlannerCode.h" #include "department.h" #include "departments.h" #include "distributeInventory.h" #include "distributeToLocation.h" #include "dspAllocations.h" #include "dspAPApplications.h" #include "dspAPOpenItemsByVendor.h" #include "dspARApplications.h" #include "dspAROpenItems.h" #include "dspBacklog.h" #include "dspBankrecHistory.h" #include "dspBillingSelections.h" #include "dspBookings.h" #include "dspBriefEarnedCommissions.h" #include "dspBriefSalesHistory.h" #include "dspCapacityUOMsByClassCode.h" #include "dspCapacityUOMsByProductCategory.h" #include "dspCashReceipts.h" #include "dspCheckRegister.h" #include "dspCostedIndentedBOM.h" #include "dspCostedSingleLevelBOM.h" #include "dspCostedSummarizedBOM.h" #include "dspCountSlipEditList.h" #include "dspCountSlipsByWarehouse.h" #include "dspCountTagEditList.h" #include "dspCountTagsByClassCode.h" #include "dspCountTagsByItem.h" #include "dspCountTagsByWarehouse.h" #include "dspCustomerARHistory.h" #include "dspDepositsRegister.h" #include "dspDetailedInventoryHistoryByLocation.h" #include "dspDetailedInventoryHistoryByLotSerial.h" #include "dspEarnedCommissions.h" #include "dspExpediteExceptionsByPlannerCode.h" #include "dspExpiredInventoryByClassCode.h" #include "dspFinancialReport.h" #include "dspFreightPricesByCustomer.h" #include "dspFreightPricesByCustomerType.h" #include "dspFrozenItemSites.h" #include "dspGLSeries.h" #include "dspGLTransactions.h" #include "dspIndentedBOM.h" #include "dspIndentedWhereUsed.h" #include "dspInvalidBillsOfMaterials.h" #include "dspInventoryAvailabilityByCustomerType.h" #include "dspInventoryAvailabilityByWorkOrder.h" #include "dspInventoryHistory.h" #include "dspInventoryLocator.h" #include "dspInvoiceInformation.h" #include "dspInvoiceRegister.h" #include "dspItemCostDetail.h" #include "dspItemCostHistory.h" #include "dspItemCostsByClassCode.h" #include "dspItemCostSummary.h" #include "dspItemSources.h" #include "dspItemsWithoutItemSources.h" #include "dspJobCosting.h" #include "dspMaterialUsageVarianceByBOMItem.h" #include "dspMaterialUsageVarianceByComponentItem.h" #include "dspMaterialUsageVarianceByItem.h" #include "dspMaterialUsageVarianceByWarehouse.h" #include "dspMaterialUsageVarianceByWorkOrder.h" #include "dspMRPDetail.h" #include "dspOrderActivityByProject.h" #include "dspOrders.h" #include "dspPartiallyShippedOrders.h" #include "dspPendingAvailability.h" #include "dspPendingBOMChanges.h" #include "dspPlannedOrders.h" #include "dspPoDeliveryDateVariancesByItem.h" #include "dspPoDeliveryDateVariancesByVendor.h" #include "dspPoHistory.h" #include "dspPoItemReceivingsByDate.h" #include "dspPoItemReceivingsByItem.h" #include "dspPoItemReceivingsByVendor.h" #include "dspPoItemsByDate.h" #include "dspPoItemsByItem.h" #include "dspPoItemsByVendor.h" #include "dspPoPriceVariancesByItem.h" #include "dspPoPriceVariancesByVendor.h" #include "dspPoReturnsByVendor.h" #include "dspPOsByDate.h" #include "dspPOsByVendor.h" #include "dspPricesByCustomer.h" #include "dspPricesByCustomerType.h" #include "dspPricesByItem.h" #include "dspPurchaseReqsByItem.h" #include "dspPurchaseReqsByPlannerCode.h" #include "dspQOH.h" #include "dspQOHByLocation.h" #include "dspQuotesByCustomer.h" #include "dspQuotesByItem.h" #include "dspReorderExceptionsByPlannerCode.h" #include "dspReservations.h" #include "dspRunningAvailability.h" #include "dspSalesHistory.h" #include "dspSalesOrdersByCustomer.h" #include "dspSalesOrdersByCustomerPO.h" #include "dspSalesOrdersByItem.h" #include "dspSalesOrdersByParameterList.h" #include "dspSalesOrderStatus.h" #include "dspShipmentsByDate.h" #include "dspShipmentsBySalesOrder.h" #include "dspShipmentsByShipment.h" #include "dspSingleLevelBOM.h" #include "dspSingleLevelWhereUsed.h" #include "dspSlowMovingInventoryByClassCode.h" #include "dspStandardJournalHistory.h" #include "dspSubstituteAvailabilityByItem.h" #include "dspSummarizedBacklogByWarehouse.h" #include "dspSummarizedBankrecHistory.h" #include "dspSummarizedBOM.h" #include "dspSummarizedGLTransactions.h" #include "dspSummarizedSales.h" #include "dspTaxHistory.h" #include "dspTimePhasedAvailability.h" #include "dspTimePhasedBookings.h" #include "dspTimePhasedOpenAPItems.h" #include "dspTimePhasedOpenARItems.h" #include "dspTimePhasedSales.h" #include "dspTimePhasedUsageStatisticsByItem.h" #include "dspTrialBalances.h" #include "dspUnbalancedQOHByClassCode.h" #include "dspUndefinedManufacturedItems.h" #include "dspUninvoicedReceivings.h" #include "dspUnusedPurchasedItems.h" #include "dspUsageStatistics.h" #include "dspValidLocationsByItem.h" #include "dspVendorAPHistory.h" #include "dspVoucherRegister.h" #include "dspWoHistoryByClassCode.h" #include "dspWoHistoryByItem.h" #include "dspWoHistoryByNumber.h" #include "dspWoMaterialsByItem.h" #include "dspWoMaterialsByWorkOrder.h" #include "dspWoSchedule.h" #include "duplicateAccountNumbers.h" #include "editOwners.h" #include "empGroup.h" #include "empGroups.h" #include "employee.h" #include "employees.h" #include "enterMiscCount.h" #include "enterPoitemReceipt.h" #include "enterPoitemReturn.h" #include "enterPoReceipt.h" #include "enterPoReturn.h" #include "errorLog.h" #include "eventManager.h" #include "expenseCategories.h" #include "expenseCategory.h" #include "expenseTrans.h" #include "explodeWo.h" #include "exportData.h" #include "externalCCTransaction.h" #include "externalShipping.h" #include "externalShippingList.h" #include "failedPostList.h" #include "financialLayoutColumns.h" #include "financialLayoutGroup.h" #include "financialLayout.h" #include "financialLayoutItem.h" #include "financialLayouts.h" #include "financialLayoutSpecial.h" #include "firmPlannedOrder.h" #include "firmPlannedOrdersByPlannerCode.h" #include "fixACL.h" #include "fixSerial.h" #include "form.h" #include "forms.h" #include "forwardUpdateAccounts.h" #include "freightBreakdown.h" #include "freightClasses.h" #include "freightClass.h" #include "getGLDistDate.h" #include "getLotInfo.h" #include "glSeries.h" #include "glSeriesItem.h" #include "glTransactionDetail.h" #include "glTransaction.h" #include "group.h" #include "groups.h" #include "honorific.h" #include "honorifics.h" #include "hotkey.h" #include "hotkeys.h" #include "idleShutdown.h" #include "image.h" #include "imageList.h" #include "images.h" #include "implodeWo.h" #include "importData.h" #include "incidentCategories.h" #include "incidentCategory.h" #include "incident.h" #include "incidentPriorities.h" #include "incidentPriority.h" #include "incidentResolution.h" #include "incidentResolutions.h" #include "incidentSeverities.h" #include "incidentSeverity.h" #include "incidentWorkbench.h" #include "invoice.h" #include "invoiceItem.h" #include "invoiceList.h" #include "issueLineToShipping.h" #include "issueToShipping.h" #include "issueWoMaterialBatch.h" #include "issueWoMaterialItem.h" #include "itemAlias.h" #include "itemAvailabilityWorkbench.h" #include "itemCost.h" #include "itemGroup.h" #include "itemGroups.h" #include "item.h" #include "itemImages.h" #include "itemListPrice.h" #include "itemPricingSchedule.h" #include "itemPricingScheduleItem.h" #include "itemPricingSchedules.h" #include "items.h" #include "itemSite.h" #include "itemSites.h" #include "itemSource.h" #include "itemSourceList.h" #include "itemSourcePrice.h" #include "itemSourceSearch.h" #include "itemSources.h" #include "itemSubstitute.h" #include "itemtax.h" #include "itemUOM.h" #include "labelForm.h" #include "labelForms.h" #include "listRecurringInvoices.h" #include "locales.h" #include "location.h" #include "locations.h" #include "lotSerial.h" #include "lotSerialSequences.h" #include "lotSerialRegistration.h" #include "maintainBudget.h" #include "maintainItemCosts.h" #include "maintainShipping.h" #include "massExpireComponent.h" #include "massReplaceComponent.h" #include "materialReceiptTrans.h" #include "metasqls.h" #include "miscCheck.h" #include "miscVoucher.h" #include "openReturnAuthorizations.h" #include "openSalesOrders.h" #include "openVouchers.h" #include "opportunity.h" #include "opportunityList.h" #include "opportunitySource.h" #include "opportunitySources.h" #include "opportunityStage.h" #include "opportunityStages.h" #include "opportunityType.h" #include "opportunityTypes.h" #include "package.h" #include "packages.h" #include "packingListBatch.h" #include "plannedOrder.h" #include "plannerCode.h" #include "plannerCodes.h" #include "poLiabilityDistrib.h" #include "postCashReceipts.h" #include "postCheck.h" #include "postChecks.h" #include "postCostsByClassCode.h" #include "postCostsByItem.h" #include "postCountSlips.h" #include "postCountTags.h" #include "postCreditMemos.h" #include "postInvoices.h" #include "postMiscProduction.h" #include "postPoReturnCreditMemo.h" #include "postProduction.h" #include "postPurchaseOrder.h" #include "postPurchaseOrdersByAgent.h" #include "postStandardJournalGroup.h" #include "postStandardJournal.h" #include "postVouchers.h" #include "prepareCheckRun.h" #include "priceList.h" #include "pricingScheduleAssignment.h" #include "pricingScheduleAssignments.h" #include "printCheck.h" #include "printChecks.h" #include "printChecksReview.h" #include "printCreditMemo.h" #include "printCreditMemos.h" #include "printInvoice.h" #include "printInvoices.h" #include "printItemLabelsByClassCode.h" #include "printLabelsByInvoice.h" #include "printLabelsByOrder.h" #include "printLabelsBySo.h" #include "printLabelsByTo.h" #include "printMulticopyDocument.h" #include "printOptions.h" #include "printPackingListBatchByShipvia.h" #include "printPackingList.h" #include "printPoForm.h" #include "printPurchaseOrder.h" #include "printPurchaseOrdersByAgent.h" #include "printRaForm.h" #include "printShippingForm.h" #include "printShippingForms.h" #include "printSoForm.h" #include "printStatementByCustomer.h" #include "printStatementsByCustomerType.h" #include "printVendorForm.h" #include "printWoForm.h" #include "printWoPickList.h" #include "printWoTraveler.h" #include "productCategories.h" #include "productCategory.h" #include "profitCenter.h" #include "profitCenters.h" #include "project.h" #include "projects.h" #include "prospect.h" #include "prospects.h" #include "purchaseOrder.h" #include "purchaseOrderItem.h" #include "purchaseRequest.h" #include "purgeClosedWorkOrders.h" #include "purgeCreditMemos.h" #include "purgeInvoices.h" #include "purgePostedCounts.h" #include "purgePostedCountSlips.h" #include "quotes.h" #include "reasonCode.h" #include "reasonCodes.h" #include "reassignClassCodeByClassCode.h" #include "reassignCustomerTypeByCustomerType.h" #include "reassignLotSerial.h" #include "reassignProductCategoryByProductCategory.h" #include "recallOrders.h" #include "reconcileBankaccount.h" #include "registrationKey.h" #include "rejectCode.h" #include "rejectCodes.h" #include "relativeCalendarItem.h" #include "releasePlannedOrdersByPlannerCode.h" #include "releaseTransferOrdersByAgent.h" #include "releaseWorkOrdersByPlannerCode.h" #include "relocateInventory.h" #include "reports.h" #include "reprintCreditMemos.h" #include "reprintInvoices.h" #include "reprintMulticopyDocument.h" #include "reprioritizeWo.h" #include "reschedulePoitem.h" #include "rescheduleWo.h" #include "reserveSalesOrderItem.h" #include "resetQOHBalances.h" #include "returnAuthCheck.h" #include "returnAuthItemLotSerial.h" #include "returnAuthorization.h" #include "returnAuthorizationItem.h" #include "returnAuthorizationWorkbench.h" #include "returnWoMaterialBatch.h" #include "returnWoMaterialItem.h" #include "reverseGLSeries.h" #include "sale.h" #include "salesAccount.h" #include "salesAccounts.h" #include "salesCategories.h" #include "salesCategory.h" #include "sales.h" #include "salesHistoryInformation.h" #include "salesOrder.h" #include "salesOrderInformation.h" #include "salesOrderItem.h" #include "salesRep.h" #include "salesReps.h" #include "saleType.h" #include "saleTypes.h" #include "scrapTrans.h" #include "scrapWoMaterialFromWIP.h" #include "scriptEditor.h" #include "scripts.h" #include "searchForEmp.h" #include "selectBankAccount.h" #include "selectBillingQty.h" #include "selectedPayments.h" #include "selectOrderForBilling.h" #include "selectPayment.h" #include "selectPayments.h" #include "selectShippedOrders.h" #include "setup.h" #include "shipOrder.h" #include "shippingChargeType.h" #include "shippingChargeTypes.h" #include "shippingForm.h" #include "shippingForms.h" #include "shippingInformation.h" #include "shippingZone.h" #include "shippingZones.h" #include "shipTo.h" #include "shipVia.h" #include "shipVias.h" #include "siteType.h" #include "siteTypes.h" #include "splitReceipt.h" #include "standardJournalGroup.h" #include "standardJournalGroupItem.h" #include "standardJournalGroups.h" #include "standardJournal.h" #include "standardJournalItem.h" #include "standardJournals.h" #include "states.h" #include "subAccntType.h" #include "subAccntTypes.h" #include "subaccount.h" #include "subaccounts.h" #include "submitAction.h" #include "submitReport.h" #include "substituteList.h" #include "summarizeInvTransByClassCode.h" #include "syncCompanies.h" #include "sysLocale.h" #include "systemMessage.h" #include "task.h" #include "taxAuthorities.h" #include "taxAuthority.h" #include "taxBreakdown.h" #include "taxclasses.h" #include "taxClass.h" #include "taxCode.h" #include "taxCodeRate.h" #include "taxCodes.h" #include "taxDetail.h" #include "taxRegistration.h" #include "taxRegistrations.h" #include "taxType.h" #include "taxTypes.h" #include "taxZone.h" #include "taxZones.h" #include "termses.h" #include "terms.h" #include "thawItemSitesByClassCode.h" #include "todoItem.h" #include "todoListCalendar.h" #include "todoList.h" #include "transactionInformation.h" #include "transferOrder.h" #include "transferOrderItem.h" #include "transferOrders.h" #include "transferTrans.h" #include "transformTrans.h" #include "uiform.h" #include "uiforms.h" #include "unappliedAPCreditMemos.h" #include "unappliedARCreditMemos.h" #include "uninvoicedShipments.h" #include "unpostedCreditMemos.h" #include "unpostedGlSeries.h" #include "unpostedGLTransactions.h" #include "unpostedInvoices.h" #include "unpostedPoReceipts.h" #include "unpostedPurchaseOrders.h" #include "uomConv.h" #include "uom.h" #include "uoms.h" #include "updateABCClass.h" #include "updateActualCostsByClassCode.h" #include "updateActualCostsByItem.h" #include "updateCreditStatusByCustomer.h" #include "updateCycleCountFrequency.h" #include "updateItemSiteLeadTimes.h" #include "updateLateCustCreditStatus.h" #include "updateListPricesByProductCategory.h" #include "updateOUTLevelByItem.h" #include "updateOUTLevelsByClassCode.h" #include "updateOUTLevels.h" #include "updatePrices.h" #include "updateReorderLevels.h" #include "userCostingElement.h" #include "user.h" #include "userList.h" #include "userPreferences.h" #include "users.h" #include "vendorAddress.h" #include "vendorAddressList.h" #include "vendor.h" #include "vendors.h" #include "vendorPriceList.h" #include "vendorType.h" #include "vendorTypes.h" #include "vendorWorkBench.h" #include "viewCheckRun.h" #include "voidChecks.h" #include "voucher.h" #include "voucherItemDistrib.h" #include "voucherItem.h" #include "voucherMiscDistrib.h" #include "warehouse.h" #include "warehouses.h" #include "warehouseZone.h" #include "woMaterialItem.h" #include "workOrder.h" #include "workOrderMaterials.h" #include "xdateinputdialog.h" #include "xsltMap.h" #include "zeroUncountedCountTagsByWarehouse.h" qt-client-4.1.0/guiclient/glSeries.cpp000066400000000000000000000363401217451700100176640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "glSeries.h" #include #include #include #include "glSeriesItem.h" #include "storedProcErrorLookup.h" #include "submitAction.h" #define cPostStandardJournal 0x10 #define DEBUG false glSeries::glSeries(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _post = _buttonBox->addButton(tr("&Post"), QDialogButtonBox::ActionRole); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); _glseries->addColumn(tr("Account"), -1, Qt::AlignLeft, true, "account" ); _glseries->addColumn(tr("Debit"), _moneyColumn, Qt::AlignRight, true, "debit" ); _glseries->addColumn(tr("Credit"), _moneyColumn, Qt::AlignRight, true, "credit" ); _credits->setPrecision(omfgThis->moneyVal()); _debits->setPrecision(omfgThis->moneyVal()); _diff->setPrecision(omfgThis->moneyVal()); _source->setText("G/L"); _source->setEnabled(false); _doctype->addItem("AD"); _doctype->addItem("CD"); _doctype->addItem("CK"); _doctype->addItem("CM"); _doctype->addItem("CR"); _doctype->addItem("CT"); _doctype->addItem("DM"); _doctype->addItem("DS"); _doctype->addItem("IN"); _doctype->addItem("JE"); _doctype->addItem("MM"); _doctype->addItem("PO"); _doctype->addItem("SO"); _doctype->addItem("ST"); _doctype->addItem("VO"); _doctype->addItem("WO"); _doctype->setCurrentIndex(_doctype->findText("JE")); _submit = false; _journal = 0; } glSeries::~glSeries() { // no need to delete child widgets, Qt does it all for us } void glSeries::languageChange() { retranslateUi(this); } enum SetResponse glSeries::set(const ParameterList &pParams) { XSqlQuery glet; XDialog::set(pParams); QVariant param; bool valid; _submit = pParams.inList("submit"); if((_submit) && (_metrics->boolean("EnableBatchManager"))) _post->setText(tr("Schedule")); else _submit = false; param = pParams.value("glSequence", &valid); if (valid) { _glsequence = param.toInt(); glet.prepare("SELECT DISTINCT glseries_distdate, glseries_source," " glseries_doctype, glseries_docnumber," " glseries_notes" " FROM glseries" " WHERE (glseries_sequence=:glseries_sequence);" ); glet.bindValue(":glseries_sequence", _glsequence); glet.exec(); if(glet.first()) { _date->setDate(glet.value("glseries_distdate").toDate()); _source->setText(glet.value("glseries_source").toString()); int idx = _doctype->findText(glet.value("glseries_doctype").toString()); if(idx < 0) _doctype->addItem(glet.value("glseries_doctype").toString()); _doctype->setCurrentIndex(_doctype->findText(glet.value("glseries_doctype").toString())); _docnumber->setText(glet.value("glseries_docnumber").toString()); _notes->setText(glet.value("glseries_notes").toString()); } else if (glet.lastError().type() != QSqlError::NoError) { systemError(this, glet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } sFillList(); } param = pParams.value("journalnumber", &valid); if (valid) { _journal = param.toInt(); _buttonBox->removeButton(_buttonBox->button(QDialogButtonBox::Save)); _mode = cEdit; _doctype->setCurrentIndex(_doctype->findText("JE")); _doctype->setEnabled(false); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; glet.exec("SELECT fetchGLSequence() AS glsequence;"); if (glet.first()) _glsequence = glet.value("glsequence").toInt(); else if (glet.lastError().type() != QSqlError::NoError) { systemError(this, glet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "postStandardJournal") { _mode = cPostStandardJournal; _doctype->setCurrentIndex(_doctype->findText("ST")); _doctype->setEnabled(false); _date->setEnabled(FALSE); _notes->setEnabled(FALSE); glet.prepare( "SELECT DISTINCT glseries_docnumber, stdjrnl_notes " " FROM glseries, stdjrnl " " WHERE ( (stdjrnl_name=glseries_docnumber) " " AND (stdjrnl_notes IS NOT NULL) " " AND (stdjrnl_notes != '') " " AND (glseries_sequence=:glsequence) ); "); glet.bindValue(":glsequence", _glsequence); glet.exec(); if (glet.lastError().type() != QSqlError::NoError) { systemError(this, glet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } while(glet.next()) _notes->append(glet.value("glseries_docnumber").toString() + ": " + glet.value("stdjrnl_notes").toString() + "\n\n"); } else if (param.toString() == "view") { _mode = cView; _new->setEnabled(false); disconnect(_glseries, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); disconnect(_glseries, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); _source->setEnabled(false); _doctype->setEnabled(false); _docnumber->setEnabled(false); _date->setEnabled(false); _notes->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void glSeries::sNew() { if(!_date->isValid()) { QMessageBox::information( this, tr("Cannot Maintain G/L Series"), tr("

    You must enter a Distribution Date for this Series.") ); _date->setFocus(); return; } ParameterList params; params.append("mode", "new"); params.append("doctype", _doctype->currentText()); params.append("docnumber", _docnumber->text()); params.append("glSequence", _glsequence); params.append("distDate", _date->date()); if (_mode == cPostStandardJournal) params.append("postStandardJournal"); glSeriesItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillList(); sNew(); } } void glSeries::sEdit() { if(!_date->isValid()) { QMessageBox::information( this, tr("Cannot Maintain G/L Series"), tr("

    You must enter a Distribution Date for this Series.") ); _date->setFocus(); return; } ParameterList params; params.append("mode", "edit"); params.append("glseries_id", _glseries->id()); params.append("glSequence", _glsequence); params.append("distDate", _date->date()); if (_mode == cPostStandardJournal) params.append("postStandardJournal"); glSeriesItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void glSeries::sDelete() { XSqlQuery glDelete; glDelete.prepare( "DELETE FROM glseries " "WHERE (glseries_id=:glseries_id);" ); glDelete.bindValue(":glseries_id", _glseries->id()); glDelete.exec(); if (glDelete.lastError().type() != QSqlError::NoError) { systemError(this, glDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } bool glSeries::update() { XSqlQuery glupdate; if(!_date->isValid()) { QMessageBox::information( this, tr("Cannot Post G/L Series"), tr("

    You must enter a Distribution Date for this Series.") ); _date->setFocus(); return false; } if(_metrics->boolean("MandatoryGLEntryNotes") && _notes->toPlainText().trimmed().isEmpty()) { QMessageBox::information( this, tr("Cannot Post G/L Series"), tr("

    You must enter some Notes to describe this transaction.") ); _notes->setFocus(); return false; } // Do not save notes when posting std journal if (_mode == cPostStandardJournal) glupdate.prepare( "UPDATE glseries " "SET glseries_source=:source," " glseries_doctype=:doctype," " glseries_docnumber=:docnumber," " glseries_distdate=:glseries_distdate " "WHERE (glseries_sequence=:glseries_sequence);" ); else glupdate.prepare( "UPDATE glseries " "SET glseries_notes=:glseries_notes, " " glseries_source=:source," " glseries_doctype=:doctype," " glseries_docnumber=:docnumber," " glseries_distdate=:glseries_distdate " "WHERE (glseries_sequence=:glseries_sequence);" ); glupdate.bindValue(":glseries_notes", _notes->toPlainText()); glupdate.bindValue(":source", _source->text()); glupdate.bindValue(":doctype", _doctype->currentText()); glupdate.bindValue(":docnumber", _docnumber->text()); glupdate.bindValue(":glseries_sequence", _glsequence); glupdate.bindValue(":glseries_distdate", _date->date()); glupdate.exec(); if (glupdate.lastError().type() != QSqlError::NoError) { systemError(this, glupdate.lastError().databaseText(), __FILE__, __LINE__); return false; } glupdate.prepare("SELECT SUM(glseries_amount) AS result " " FROM glseries " " WHERE (glseries_sequence=:glseries_sequence); "); glupdate.bindValue(":glseries_sequence", _glsequence); glupdate.exec(); if(glupdate.first()) { double result = glupdate.value("result").toDouble(); if(result != 0) { QMessageBox::critical( this, tr("Cannot Post G/L Series"), tr("

    The G/L Series information is unbalanced and cannot be posted. Please correct this before continuing.") ); return false; } } else if (glupdate.lastError().type() != QSqlError::NoError) { systemError(this, glupdate.lastError().databaseText(), __FILE__, __LINE__); return false; } omfgThis->sGlSeriesUpdated(); return true; } void glSeries::sSave() { if (! update()) return; accept(); } void glSeries::sPost() { XSqlQuery glPost; if (! update()) return; if(_submit) { ParameterList params; params.append("action_name", "PostGLSeries"); params.append("glseries_sequence", _glsequence); submitAction newdlg(this, "", true); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) { // TODO: do something? } } else { glPost.prepare("SELECT postGLSeriesNoSumm(:glseries_sequence,COALESCE(:journal,fetchJournalNumber('G/L'))) AS return;"); glPost.bindValue(":glseries_sequence", _glsequence); if (_journal) glPost.bindValue(":journal", _journal); glPost.exec(); if (glPost.first()) { int returnVal = glPost.value("return").toInt(); if (returnVal < 0) { systemError(this, storedProcErrorLookup("postGLSeriesNoSumm", returnVal), __FILE__, __LINE__); return; } } else if (glPost.lastError().type() != QSqlError::NoError) { systemError(this, glPost.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sGlSeriesUpdated(); } if(cPostStandardJournal == _mode || _journal) { accept(); return; } _date->clear(); _notes->clear(); _debits->clear(); _credits->clear(); _diff->clear(); _glseries->clear(); _docnumber->clear(); ParameterList params; params.append("mode", "new"); set(params); } void glSeries::reject() { XSqlQuery glreject; if (DEBUG) qDebug("glSeries::reject() entered with _mode %d, topLevelItemCount %d", _mode, _glseries->topLevelItemCount()); if (cNew == _mode && _glseries->topLevelItemCount() > 0) { if (QMessageBox::question(this, tr("Delete G/L Series?"), tr("

    Are you sure you want to delete this G/L " "Series Entry?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { glreject.prepare("SELECT deleteGLSeries(:glsequence);"); glreject.bindValue(":glsequence", _glsequence); glreject.exec(); if (glreject.lastError().type() != QSqlError::NoError) systemError(this, glreject.lastError().databaseText(), __FILE__, __LINE__); } else return; } omfgThis->sGlSeriesUpdated(); XDialog::reject(); } void glSeries::sFillList() { XSqlQuery glFillList; glFillList.prepare( "SELECT glseries_id, (formatGLAccount(accnt_id) || '-' || accnt_descrip) AS account," " CASE WHEN (glseries_amount < 0) THEN (glseries_amount * -1)" " ELSE 0" " END AS debit," " CASE WHEN (glseries_amount > 0) THEN glseries_amount" " ELSE 0" " END AS credit," " 'curr' AS debit_xtnumericrole," " 'curr' AS credit_xtnumericrole " "FROM glseries, accnt " "WHERE ( (glseries_accnt_id=accnt_id)" " AND (glseries_sequence=:glseries_sequence) );" ); glFillList.bindValue(":glseries_sequence", _glsequence); glFillList.exec(); if (glFillList.lastError().type() != QSqlError::NoError) { systemError(this, glFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _glseries->populate(glFillList); if (glFillList.lastError().type() != QSqlError::NoError) { systemError(this, glFillList.lastError().databaseText(), __FILE__, __LINE__); return; } glFillList.prepare("SELECT SUM(CASE WHEN (glseries_amount < 0) THEN (glseries_amount * -1)" " ELSE 0" " END) AS debit," " SUM(CASE WHEN (glseries_amount > 0) THEN glseries_amount" " ELSE 0" " END ) AS credit," " SUM(glseries_amount) AS diff," " (SUM(glseries_amount) <> 0) AS oob " "FROM glseries " "WHERE (glseries_sequence=:glseries_sequence);" ); glFillList.bindValue(":glseries_sequence", _glsequence); glFillList.exec(); if (glFillList.first()) { _debits->setDouble(glFillList.value("debit").toDouble()); _credits->setDouble(glFillList.value("credit").toDouble()); _diff->setDouble(glFillList.value("diff").toDouble()); QString stylesheet; if (glFillList.value("oob").toBool()) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); _debits->setStyleSheet(stylesheet); _credits->setStyleSheet(stylesheet); _diff->setStyleSheet(stylesheet); } else if (glFillList.lastError().type() != QSqlError::NoError) { systemError(this, glFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/glSeries.h000066400000000000000000000023601217451700100173240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GLSERIES_H #define GLSERIES_H #include #include "guiclient.h" #include "xdialog.h" #include #include "ui_glSeries.h" class glSeries : public XDialog, public Ui::glSeries { Q_OBJECT public: glSeries(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~glSeries(); public slots: virtual void reject(); virtual enum SetResponse set(const ParameterList & pParams ); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sPost(); virtual void sFillList(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _glsequence; int _journal; bool update(); bool _submit; QPushButton* _post; }; #endif // GLSERIES_H qt-client-4.1.0/guiclient/glSeries.ui000066400000000000000000000303221217451700100175110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. glSeries 0 0 575 507 Series G/L Journal Entry Source: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _source Document Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _doctype Dist. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _date Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docnumber Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Transaction Series: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::StrongFocus &New Ctrl+N false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 10 0 Qt::Vertical QSizePolicy::Preferred 10 21 Totals: Qt::AlignRight Debits Qt::AlignCenter false 0 0 Qt::NoFocus Qt::AlignRight Credits Qt::AlignCenter false 0 0 Qt::NoFocus Qt::AlignRight Difference Qt::AlignCenter 0 0 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 20 N&otes: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _notes true true DLineEdit QWidget

    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _source _doctype _docnumber _date _glseries _new _edit _delete _glseries itemSelected(int) _edit animateClick() 30 166 490 202 _buttonBox rejected() glSeries reject() 520 45 287 253 _glseries valid(bool) _edit setEnabled(bool) 241 189 521 168 _glseries valid(bool) _delete setEnabled(bool) 241 189 521 202 qt-client-4.1.0/guiclient/glSeriesItem.cpp000066400000000000000000000123341217451700100205000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "glSeriesItem.h" #include #include #include #include #include glSeriesItem::glSeriesItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _glseriesid = -1; _glsequence = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); } glSeriesItem::~glSeriesItem() { // no need to delete child widgets, Qt does it all for us } void glSeriesItem::languageChange() { retranslateUi(this); } enum SetResponse glSeriesItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("glseries_id", &valid); if (valid) { _glseriesid = param.toInt(); populate(); } param = pParams.value("doctype", &valid); if (valid) _doctype = param.toString(); param = pParams.value("docnumber", &valid); if (valid) _docnumber = param.toString(); param = pParams.value("glSequence", &valid); if (valid) _glsequence = param.toInt(); param = pParams.value("distDate", &valid); if (valid) _amount->setEffective(param.toDate()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; } } param = pParams.value("postStandardJournal", &valid); if (valid) _doctype = "ST"; return NoError; } void glSeriesItem::sSave() { XSqlQuery glSave; if (! _amount->isBase() && QMessageBox::question(this, tr("G/L Transaction Not In Base Currency"), tr("G/L transactions are recorded in the base currency.\n" "Do you wish to convert %1 %2 at the rate effective on %3?") .arg(_amount->localValue()).arg(_amount->currAbbr()) .arg(_amount->effective().toString(Qt::LocalDate)), QMessageBox::Yes|QMessageBox::Escape, QMessageBox::No |QMessageBox::Default) != QMessageBox::Yes) { _amount->setFocus(); return; } if (!_metrics->boolean("IgnoreCompany") && _metrics->value("GLCompanySize").toInt()) { XSqlQuery co; co.prepare("SELECT company_id " "FROM glseries " " JOIN accnt ON (accnt_id=glseries_accnt_id) " " JOIN company ON (accnt_company=company_number) " "WHERE ((glseries_sequence=:glsequence) " " AND (glseries_id != :glseries_id) " " AND (company_id != :company_id));"); co.bindValue(":glsequence", _glsequence); co.bindValue(":glseries_id", _glseriesid); co.bindValue(":company_id", _account->companyId()); co.exec(); if (co.first()) { QMessageBox::critical(this, tr("Can not Save Series Item"), tr("The Company of this Account does not match the " "Companies for other Accounts on this series. This " "entry can not be saved.")); _account->setFocus(); return; } } double amount = _amount->baseValue(); if (_debit->isChecked()) amount *= -1; if (_mode == cNew) glSave.prepare("SELECT insertIntoGLSeries(:glsequence, 'G/L', :doctype, :docnumber, :accnt_id, :amount, :distdate) AS result;"); else if (_mode == cEdit) glSave.prepare( "UPDATE glseries " "SET glseries_accnt_id=:accnt_id," " glseries_amount=:amount " "WHERE (glseries_id=:glseries_id);" ); glSave.bindValue(":glseries_id", _glseriesid); glSave.bindValue(":glsequence", _glsequence); glSave.bindValue(":doctype", _doctype); glSave.bindValue(":docnumber", _docnumber); glSave.bindValue(":accnt_id", _account->id()); glSave.bindValue(":amount", amount); glSave.bindValue(":distdate", _amount->effective()); glSave.exec(); if (glSave.lastError().type() != QSqlError::NoError) { systemError(this, glSave.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void glSeriesItem::populate() { XSqlQuery glpopulate; glpopulate.prepare( "SELECT glseries_amount, glseries_accnt_id " "FROM glseries " "WHERE (glseries_id=:glseries_id);" ); glpopulate.bindValue(":glseries_id", _glseriesid); glpopulate.exec(); if (glpopulate.first()) { if (glpopulate.value("glseries_amount").toDouble() < 0) { _debit->setChecked(TRUE); _amount->setBaseValue(fabs(glpopulate.value("glseries_amount").toDouble())); } else { _credit->setChecked(TRUE); _amount->setBaseValue(glpopulate.value("glseries_amount").toDouble()); } _account->setId(glpopulate.value("glseries_accnt_id").toInt()); } else if (glpopulate.lastError().type() != QSqlError::NoError) { systemError(this, glpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/glSeriesItem.h000066400000000000000000000021501217451700100201400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GLSERIESITEM_H #define GLSERIESITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_glSeriesItem.h" class glSeriesItem : public XDialog, public Ui::glSeriesItem { Q_OBJECT public: glSeriesItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~glSeriesItem(); virtual void populate(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _glsequence; int _glseriesid; QString _docnumber; QString _doctype; }; #endif // GLSERIESITEM_H qt-client-4.1.0/guiclient/glSeriesItem.ui000066400000000000000000000123411217451700100203310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. glSeriesItem 0 0 539 105 General Ledger Transaction Series Item Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 false Qt::StrongFocus Debit true Qt::StrongFocus Credit Qt::StrongFocus 5 Account #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    GLCluster QWidget
    glcluster.h
    _amount _debit _credit _account _buttonBox _buttonBox rejected() glSeriesItem reject() 488 62 267 60
    qt-client-4.1.0/guiclient/glTransaction.cpp000066400000000000000000000134421217451700100207150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "glTransaction.h" #include #include #include #include #include "glcluster.h" glTransaction::glTransaction(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Post")); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sPost())); // This should all be generated as part of the UI but it was the only // way I could get the tab order to work exactly as it was supposed to. QWidget::setTabOrder(_amount, _distDate); QWidget::setTabOrder(_distDate, _docType); QWidget::setTabOrder(_docType, _docNumber); QWidget::setTabOrder(_docNumber, _debit); QWidget::setTabOrder(_debit, _credit); QWidget::setTabOrder(_credit, _notes); QWidget::setTabOrder(_notes, _buttonBox->button(QDialogButtonBox::Ok)); QWidget::setTabOrder(_buttonBox->button(QDialogButtonBox::Ok), _buttonBox->button(QDialogButtonBox::Cancel)); _captive = FALSE; } glTransaction::~glTransaction() { // no need to delete child widgets, Qt does it all for us } void glTransaction::languageChange() { retranslateUi(this); } enum SetResponse glTransaction::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("glsequence", &valid); if (valid) { _glsequence = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _distDate->setDate(omfgThis->dbDate(), true); _docType->setEnabled(FALSE); _docType->setText("JE"); } else if (param.toString() == "view") { _mode = cView; _amount->setEnabled(FALSE); _docNumber->setEnabled(FALSE); _distDate->setEnabled(FALSE); _docType->setEnabled(FALSE); _debit->setEnabled(FALSE); _credit->setEnabled(FALSE); _notes->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void glTransaction::sPost() { XSqlQuery glPost; struct { bool condition; QString msg; QWidget* widget; } error[] = { { _amount->isZero(), tr("

    You must enter an amount for this G/L " "Transaction before you may Post it."), _amount }, { ! _debit->isValid(), tr("

    You must select a Debit Account for this G/L " "Transaction before you may Post it." ), _debit }, { ! _credit->isValid(), tr("

    You must select a Credit Account for this G/L " "Transaction before you may Post it." ), _credit }, { !_metrics->boolean("IgnoreCompany") && _credit->companyId() != _debit->companyId(), tr("The Accounts must belong to the same Company to Post this transaciton." ), _credit }, { _metrics->boolean("MandatoryGLEntryNotes") && _notes->toPlainText().trimmed().isEmpty(), tr("

    You must enter some Notes to describe this transaction."), _notes}, { true, "", NULL } }; // error[] int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Post G/L Journal Entry"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } if (! _amount->isBase() && QMessageBox::question(this, tr("G/L Transaction Not In Base Currency"), tr("G/L transactions are recorded in the base currency.\n" "Do you wish to convert %1 %2 at the rate effective on %3?") .arg(_amount->localValue()).arg(_amount->currAbbr()) .arg(_distDate->date().toString(Qt::LocalDate)), QMessageBox::Yes|QMessageBox::Escape, QMessageBox::No |QMessageBox::Default) != QMessageBox::Yes) { _amount->setFocus(); return; } glPost.prepare( "SELECT insertGLTransaction( fetchJournalNumber('GL-MISC'), 'G/L', :docType, :docNumber, :notes," " :creditAccntid, :debitAccntid, -1, :amount, :distDate, true, false ) AS result;" ); glPost.bindValue(":distDate", _distDate->date()); glPost.bindValue(":docType", _docType->text().trimmed()); glPost.bindValue(":docNumber", _docNumber->text().trimmed()); glPost.bindValue(":notes", _notes->toPlainText().trimmed()); glPost.bindValue(":creditAccntid", _credit->id()); glPost.bindValue(":debitAccntid", _debit->id()); glPost.bindValue(":amount", _amount->baseValue()); glPost.exec(); if (glPost.first()) { if (_captive) done(glPost.value("result").toInt()); else { clear(); _buttonBox->removeButton(_buttonBox->button(QDialogButtonBox::Cancel)); _buttonBox->removeButton(_buttonBox->button(QDialogButtonBox::Close)); QPushButton* button = _buttonBox->addButton(QDialogButtonBox::Close); button->setShortcut(QKeySequence::Close); button->setToolTip(button->text().append(" ").append(button->shortcut().toString(QKeySequence::NativeText))); _amount->setFocus(); } } else if (glPost.lastError().type() != QSqlError::NoError) { systemError(this, glPost.lastError().databaseText(), __FILE__, __LINE__); return; } } void glTransaction::clear() { _amount->clear(); _docNumber->clear(); _debit->setId(-1); _credit->setId(-1); _notes->clear(); _mode = cNew; _amount->setFocus(); } void glTransaction::populate() { } qt-client-4.1.0/guiclient/glTransaction.h000066400000000000000000000021241217451700100203550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GLTRANSACTION_H #define GLTRANSACTION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_glTransaction.h" class glTransaction : public XDialog, public Ui::glTransaction { Q_OBJECT public: glTransaction(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~glTransaction(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sPost(); virtual void clear(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _glsequence; bool _captive; }; #endif // GLTRANSACTION_H qt-client-4.1.0/guiclient/glTransaction.ui000066400000000000000000000246271217451700100205570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. glTransaction 0 0 619 523 Simple G/L Journal Entry 0 25 Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 300 10 Document Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 60 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 120 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 5 Debit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::StrongFocus 5 Credit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::StrongFocus 0 1 QFrame::NoFrame QFrame::Plain 0 0 Notes: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true true CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    GLCluster QWidget
    glcluster.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _amount _distDate _docType _docNumber _debit _credit _notes _buttonBox _distDate newDate(QDate) _amount setEffective(QDate) 20 20 20 20 _buttonBox rejected() glTransaction reject() 553 45 299 199 qt-client-4.1.0/guiclient/glTransactionDetail.cpp000066400000000000000000000061731217451700100220430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "glTransactionDetail.h" #include #include #include #include "mqlutil.h" glTransactionDetail::glTransactionDetail(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _amount->setPrecision(omfgThis->moneyVal()); _gltransid = -1; _table = "gltrans"; } glTransactionDetail::~glTransactionDetail() { // no need to delete child widgets, Qt does it all for us } void glTransactionDetail::languageChange() { retranslateUi(this); } enum SetResponse glTransactionDetail::set( const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("gltrans_id", &valid); if (valid) { _gltransid = param.toInt(); populate(); } param = pParams.value("sltrans_id", &valid); if (valid) { setWindowTitle(tr("Sub Ledger")); _table = "sltrans"; _gltransid = param.toInt(); populate(); } return NoError; } void glTransactionDetail::populate() { XSqlQuery glpopulate; QString sql("SELECT _date AS transdate, " "_source AS source, " "_journalnumber AS journalnumber, " "_amount AS amount, " "_username AS username, " "_created AS created, " "_posted AS posted, " "_notes AS notes, " " (_doctype || ' ' || _docnumber) AS f_document," " formatGLAccountLong(_accnt_id) AS f_accnt " " FROM " " WHERE (_id=);"); ParameterList params; params.append("gltrans_id", _gltransid); params.append("table", _table); MetaSQLQuery mql(sql); glpopulate = mql.toQuery(params); if(glpopulate.first()) { _date->setDate(glpopulate.value("transdate").toDate()); _source->setText(glpopulate.value("source").toString()); _document->setText(glpopulate.value("f_document").toString()); _journalnumber->setText(glpopulate.value("journalnumber").toString()); _accnt->setText(glpopulate.value("f_accnt").toString()); _amount->setDouble(glpopulate.value("amount").toDouble()); _username->setText(glpopulate.value("username").toString()); _created->setDate(glpopulate.value("created").toDate()); _posted->setText(glpopulate.value("posted").toBool() ? tr("Yes") : tr("No")); _notes->setText(glpopulate.value("notes").toString()); } } qt-client-4.1.0/guiclient/glTransactionDetail.h000066400000000000000000000021161217451700100215010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GLTRANSACTIONDETAIL_H #define GLTRANSACTIONDETAIL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_glTransactionDetail.h" class glTransactionDetail : public XDialog, public Ui::glTransactionDetail { Q_OBJECT public: glTransactionDetail(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~glTransactionDetail(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); protected: int _gltransid; protected slots: virtual void languageChange(); private: QString _table; }; #endif // GLTRANSACTIONDETAIL_H qt-client-4.1.0/guiclient/glTransactionDetail.ui000066400000000000000000000276041217451700100217000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. glTransactionDetail 0 0 524 419 G/L Transaction Detail 5 5 5 0 5 0 5 0 Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Source: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Document: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Journal Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Created: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Posted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 false 1 0 0 0 _source _document _journalnumber 0 0 _accnt _amount 0 0 _username false 0 0 _posted 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 154 0 0 Notes: 0 1 Qt::NoFocus true DLineEdit QWidget
    datecluster.h
    XLabel QLabel
    xlabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _close _notes _close clicked() glTransactionDetail close() 20 20 20 20
    qt-client-4.1.0/guiclient/group.cpp000066400000000000000000000301431217451700100172360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "group.h" #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "storedProcErrorLookup.h" #define DEBUG false group::group(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery groupgroup; setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_addAll, SIGNAL(clicked()), this, SLOT(sAddAll())); connect(_revoke, SIGNAL(clicked()), this, SLOT(sRevoke())); connect(_revokeAll, SIGNAL(clicked()), this, SLOT(sRevokeAll())); connect(_module, SIGNAL(activated(const QString&)), this, SLOT(sModuleSelected(const QString&))); connect(_available, SIGNAL(valid(bool)), _add, SLOT(setEnabled(bool))); connect(_granted, SIGNAL(itemSelected(int)), this, SLOT(sRevoke())); connect(_granted, SIGNAL(valid(bool)), _revoke, SLOT(setEnabled(bool))); connect(_available, SIGNAL(itemSelected(int)), this, SLOT(sAdd())); _available->addColumn("Available Privileges", -1, Qt::AlignLeft, true, "priv_name"); _granted->addColumn("Granted Privileges", -1, Qt::AlignLeft, true, "priv_name"); groupgroup.exec( "SELECT DISTINCT priv_module " "FROM priv " "ORDER BY priv_module;" ); for (int i = 0; groupgroup.next(); i++) _module->append(i, groupgroup.value("priv_module").toString()); _trapClose = false; } group::~group() { // no need to delete child widgets, Qt does it all for us } void group::languageChange() { retranslateUi(this); } enum SetResponse group::set(const ParameterList &pParams) { XSqlQuery groupet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("grp_id", &valid); if (valid) { _grpid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { groupet.exec("SELECT NEXTVAL('grp_grp_id_seq') AS grp_id;"); if (groupet.first()) _grpid = groupet.value("grp_id").toInt(); else if (groupet.lastError().type() != QSqlError::NoError) { systemError(this, groupet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _mode = cNew; _trapClose = true; groupet.exec("BEGIN;"); groupet.prepare( "INSERT INTO grp " "( grp_id, grp_name, grp_descrip)" "VALUES( :grp_id, :grp_id, '' );" ); groupet.bindValue(":grp_id", _grpid); groupet.exec(); if (groupet.lastError().type() != QSqlError::NoError) { systemError(this, groupet.lastError().databaseText(), __FILE__, __LINE__); groupet.exec("ROLLBACK;"); _trapClose = false; return UndefinedError; } _module->setCurrentIndex(0); sModuleSelected(_module->itemText(0)); } else if (param.toString() == "edit") { _mode = cEdit; groupet.exec("BEGIN;"); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _addAll->setEnabled(FALSE); _revokeAll->setEnabled(FALSE); disconnect(_available, SIGNAL(itemSelected(int)), this, SLOT(sAdd())); disconnect(_available, SIGNAL(valid(bool)), _add, SLOT(setEnabled(bool))); disconnect(_granted, SIGNAL(itemSelected(int)), this, SLOT(sRevoke())); disconnect(_granted, SIGNAL(valid(bool)), _revoke, SLOT(setEnabled(bool))); _save->hide(); _close->setText(tr("&Close")); } } return NoError; } /* override reject() instead of closeEvent() because the QDialog docs say the Esc key calls reject and the close event cannot be ignored */ void group::reject() { if (DEBUG) qDebug("group::reject() called with _trapClose = %d", _trapClose); if(_trapClose) { XSqlQuery endtxn; switch(QMessageBox::question(this, tr("Save?"), tr("

    Do you wish to save your changes?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes)) { case QMessageBox::Yes: sSave(); return; // endtxn.exec("COMMIT;"); // break; case QMessageBox::No: endtxn.exec("ROLLBACK;"); break; case QMessageBox::Cancel: return; default: break; } } XDialog::reject(); } void group::sCheck() { XSqlQuery groupCheck; _name->setText(_name->text().trimmed().toUpper()); if ((_mode == cNew) && (_name->text().length() != 0)) { groupCheck.prepare( "SELECT grp_id " " FROM grp " " WHERE (UPPER(grp_name)=UPPER(:grp_name));" ); groupCheck.bindValue(":grp_name", _name->text()); groupCheck.exec(); if (groupCheck.first()) { XSqlQuery groupet; groupet.exec("ROLLBACK;"); groupet.exec("BEGIN;"); _grpid = groupCheck.value("grp_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void group::sSave() { XSqlQuery groupSave; _name->setText(_name->text().trimmed().toUpper()); QList errors; errors << GuiErrorCheck(_name->text().trimmed().isEmpty(), _name, tr("You must enter a valid Name for this Group " "before continuing")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Group"), errors)) return; groupSave.prepare( "UPDATE grp " " SET grp_name=:grp_name," " grp_descrip=:grp_descrip " " WHERE(grp_id=:grp_id);" ); groupSave.bindValue(":grp_id", _grpid); groupSave.bindValue(":grp_name", _name->text()); groupSave.bindValue(":grp_descrip", _description->text().trimmed()); groupSave.exec(); if (groupSave.lastError().type() != QSqlError::NoError) { systemError(this, groupSave.lastError().databaseText(), __FILE__, __LINE__); return; } groupSave.exec("COMMIT;"); _trapClose = false; _mode = cEdit; done(_grpid); } void group::sModuleSelected(const QString &pModule) { XSqlQuery avail; avail.prepare( "SELECT priv_id, priv_name " "FROM priv " "WHERE ((priv_module=:priv_module) " " AND (priv_id NOT IN (SELECT grppriv_priv_id" " FROM grppriv" " WHERE (grppriv_grp_id=:grpid)" " ))) " "ORDER BY priv_name;" ); avail.bindValue(":priv_module", pModule); avail.bindValue(":grpid", _grpid); avail.exec(); _available->populate(avail); if (avail.lastError().type() != QSqlError::NoError) { systemError(this, avail.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery grppriv; grppriv.prepare( "SELECT priv_id, priv_name " "FROM priv, grppriv " "WHERE ((grppriv_priv_id=priv_id)" " AND (grppriv_grp_id=:grp_id)" " AND (priv_module=:priv_module))" "ORDER BY priv_name;" ); grppriv.bindValue(":grp_id", _grpid); grppriv.bindValue(":priv_module", _module->currentText()); grppriv.exec(); _granted->populate(grppriv); if (grppriv.lastError().type() != QSqlError::NoError) { systemError(this, grppriv.lastError().databaseText(), __FILE__, __LINE__); return; } } void group::sAdd() { XSqlQuery groupAdd; groupAdd.prepare("SELECT grantPrivGroup(:grp_id, :priv_id) AS result;"); groupAdd.bindValue(":grp_id", _grpid); groupAdd.bindValue(":priv_id", _available->id()); groupAdd.exec(); if (groupAdd.first()) { int result = groupAdd.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("grantPrivGroup", result), __FILE__, __LINE__); return; } } else if (groupAdd.lastError().type() != QSqlError::NoError) { systemError(this, groupAdd.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); _trapClose = true; } void group::sAddAll() { XSqlQuery groupAddAll; groupAddAll.prepare("SELECT grantAllModulePrivGroup(:grp_id, :module) AS result;"); groupAddAll.bindValue(":grp_id", _grpid); groupAddAll.bindValue(":module", _module->currentText()); groupAddAll.exec(); if (groupAddAll.first()) { int result = groupAddAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("grantAllModulePrivGroup", result), __FILE__, __LINE__); return; } } else if (groupAddAll.lastError().type() != QSqlError::NoError) { systemError(this, groupAddAll.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); _trapClose = true; } void group::sRevoke() { XSqlQuery groupRevoke; groupRevoke.prepare("SELECT revokePrivGroup(:grp_id, :priv_id) AS result;"); groupRevoke.bindValue(":grp_id", _grpid); groupRevoke.bindValue(":priv_id", _granted->id()); groupRevoke.exec(); if (groupRevoke.first()) { int result = groupRevoke.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("revokePrivGroup", result), __FILE__, __LINE__); return; } } else if (groupRevoke.lastError().type() != QSqlError::NoError) { systemError(this, groupRevoke.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); _trapClose = true; } void group::sRevokeAll() { XSqlQuery groupRevokeAll; groupRevokeAll.prepare("SELECT revokeAllModulePrivGroup(:grp_id, :module) AS result;"); groupRevokeAll.bindValue(":grp_id", _grpid); groupRevokeAll.bindValue(":module", _module->currentText()); groupRevokeAll.exec(); if (groupRevokeAll.first()) { int result = groupRevokeAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("revokeAllModulePrivGroup", result), __FILE__, __LINE__); return; } } else if (groupRevokeAll.lastError().type() != QSqlError::NoError) { systemError(this, groupRevokeAll.lastError().databaseText(), __FILE__, __LINE__); return; } sModuleSelected(_module->currentText()); _trapClose = true; } void group::populate() { XSqlQuery grouppopulate; grouppopulate.prepare( "SELECT grp_name, grp_descrip " " FROM grp " " WHERE(grp_id=:grp_id);" ); grouppopulate.bindValue(":grp_id", _grpid); grouppopulate.exec(); if (grouppopulate.first()) { _name->setText(grouppopulate.value("grp_name")); _description->setText(grouppopulate.value("grp_descrip")); grouppopulate.prepare( "SELECT priv_module " "FROM grppriv, priv " "WHERE ( (grppriv_priv_id=priv_id)" " AND (grppriv_id=:grp_id) ) " "ORDER BY priv_module " "LIMIT 1;" ); grouppopulate.bindValue(":grp_id", _grpid); grouppopulate.exec(); if (grouppopulate.first()) { for (int counter = 0; counter < _module->count(); counter++) { if (_module->itemText(counter) == grouppopulate.value("priv_module").toString()) { _module->setCurrentIndex(counter); sModuleSelected(_module->itemText(counter)); } } } else { _module->setCurrentIndex(0); sModuleSelected(_module->itemText(0)); } } else if (grouppopulate.lastError().type() != QSqlError::NoError) { systemError(this, grouppopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/group.h000066400000000000000000000023261217451700100167050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GROUP_H #define GROUP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_group.h" class group : public XDialog, public Ui::group { Q_OBJECT public: group(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~group(); public slots: virtual void reject(); virtual SetResponse set(const ParameterList &pParams); virtual void sCheck(); virtual void populate(); virtual void sSave(); virtual void sModuleSelected(const QString &); virtual void sAdd(); virtual void sAddAll(); virtual void sRevoke(); virtual void sRevokeAll(); protected slots: virtual void languageChange(); private: int _grpid; int _mode; bool _trapClose; }; #endif // GROUP_H qt-client-4.1.0/guiclient/group.ui000066400000000000000000000361061217451700100170760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. group 0 0 491 256 Role 0 0 0 0 0 5 0 0 0 0 5 0 0 0 0 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 0 0 0 0 0 0 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 347 0 0 0 0 0 0 5 0 0 0 0 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Plain 0 0 0 0 0 6 0 0 0 0 &Module: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _module Qt::Horizontal QSizePolicy::Expanding 20 20 5 0 0 0 0 5 0 0 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 0 0 0 0 0 Add-> Add All->> 0 0 0 0 0 <-Revoke <<-Revoke All Qt::Vertical QSizePolicy::Expanding 20 20 XComboBox QComboBox

    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _name _description _module _available _add _addAll _revoke _revokeAll _granted _save _close _close clicked() group reject() 424 32 20 20 qt-client-4.1.0/guiclient/groups.cpp000066400000000000000000000074441217451700100174310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "groups.h" #include #include //#include #include #include #include "group.h" #include "guiclient.h" /* * Constructs a groups as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ groups::groups(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); // statusBar()->hide(); _print->hide(); _list->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "grp_name" ); _list->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "grp_descrip" ); if (_privileges->check("MaintainGroups")) { connect(_list, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_list, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_list, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_list, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(); } /* * Destroys the object and frees any allocated resources */ groups::~groups() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void groups::languageChange() { retranslateUi(this); } void groups::sDelete() { XSqlQuery groupsDelete; groupsDelete.prepare( "SELECT usrgrp_id " "FROM usrgrp " "WHERE (usrgrp_grp_id=:grp_id);" ); groupsDelete.bindValue(":grp_id", _list->id()); groupsDelete.exec(); if (groupsDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Group"), tr( "The selected Group cannot be deleted as there are one or more Users currently assigned to it.\n" "You must reassign these Users before you may delete the selected Group." ) ); return; } groupsDelete.prepare( "DELETE FROM grppriv" " WHERE (grppriv_grp_id=:grp_id);" "DELETE FROM grp " " WHERE (grp_id=:grp_id);" ); groupsDelete.bindValue(":grp_id", _list->id()); groupsDelete.exec(); sFillList(); } void groups::sNew() { ParameterList params; params.append("mode", "new"); group newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void groups::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("grp_id", _list->id()); group newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void groups::sView() { ParameterList params; params.append("mode", "view"); params.append("grp_id", _list->id()); group newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void groups::sFillList() { _list->populate( "SELECT grp_id, grp_name, grp_descrip " " FROM grp " " ORDER BY grp_name;" ); } void groups::sPrint() { orReport report("GroupMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/groups.h000066400000000000000000000016651217451700100170750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GROUPS_H #define GROUPS_H #include "xwidget.h" #include "ui_groups.h" class groups : public XWidget, public Ui::groups { Q_OBJECT public: groups(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~groups(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // GROUPS_H qt-client-4.1.0/guiclient/groups.ui000066400000000000000000000111461217451700100172560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. groups 0 0 374 421 List Roles 0 0 Roles: 0 5 &Close &Print 0 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _list _new _edit _view _delete _print _close _list valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() groups close() 20 20 20 20
    qt-client-4.1.0/guiclient/guiErrorCheck.cpp000066400000000000000000000023711217451700100206400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "guiErrorCheck.h" #include #include #include GuiErrorCheck::GuiErrorCheck(bool phasError, QWidget *pwidget, QString pmsg) : hasError(phasError), widget(pwidget), msg(pmsg) { if (! widget) { msg = "Bug: GuiErrorCheck created with empty widget"; // no tr hasError = true; } } GuiErrorCheck::~GuiErrorCheck() { // no need to delete child widgets, Qt does it all for us } bool GuiErrorCheck::reportErrors(QWidget *parent, QString title, QList list) { for (int i = 0; i < list.length(); i++) { if (list[i].hasError) { QMessageBox::critical(parent, title, QString("

    %1").arg(list[i].msg)); if (list[i].widget) list[i].widget->setFocus(); return true; } } return false; } qt-client-4.1.0/guiclient/guiErrorCheck.h000066400000000000000000000017041217451700100203040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GUIERRORCHECK_H #define GUIERRORCHECK_H #include class QWidget; class GuiErrorCheck { public: GuiErrorCheck(bool hasError, QWidget *widget, QString msg); ~GuiErrorCheck(); static bool reportErrors(QWidget *parent, QString title, QList list); // order of declarations should match order in constructor: // http://gcc.gnu.org/ml/gcc-help/2006-06/msg00068.html bool hasError; QWidget *widget; QString msg; }; #endif // GUIERRORCHECK_H qt-client-4.1.0/guiclient/guiclient.cpp000066400000000000000000002313421217451700100200710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtsettings.h" #include "xuiloader.h" #include "guiclient.h" #include "version.h" #include "xmainwindow.h" #include "xdialog.h" #include "errorLog.h" #include "errorReporter.h" #include "systemMessage.h" #include "menuProducts.h" #include "menuInventory.h" #include "menuSchedule.h" #include "menuManufacture.h" #include "menuPurchase.h" #include "menuCRM.h" #include "menuSales.h" #include "menuAccounting.h" #include "menuWindow.h" #include "menuSystem.h" #include "timeoutHandler.h" #include "idleShutdown.h" #include "inputManager.h" #include "xdoublevalidator.h" #include "distributeInventory.h" #include "documents.h" #include "splashconst.h" #include "scripttoolbox.h" #include "menubutton.h" #include "setup.h" #include "setupscriptapi.h" #if defined(Q_OS_WIN32) #define NOCRYPT #include #else #if defined(Q_OS_MACX) #include #endif #endif class Metrics; class Preferences; class Privileges; class Metricsenc; #ifdef Q_WS_MACX void qt_mac_set_native_menubar(bool); #endif QSplashScreen *_splash; Metrics *_metrics=0; Preferences *_preferences=0; Privileges *_privileges=0; Metricsenc *_metricsenc=0; QList _hotkeyList; bool _evaluation; #include static SaveSizePositionEventFilter * __saveSizePositionEventFilter = 0; static int __interval = 0; static int __intervalCount = 0; // #name is a special check like calling a function // @name:mode is a class call to static method userHasPriv(mode) // where mode is one of new edit view static bool __privCheck(const QString & privname) { if(privname == "#superuser") return _privileges->isDba(); return _privileges->check(privname); } static void __menuEvaluate(QAction * act) { if(!act) return; QString privs = act->data().toString(); if(privs == "true") act->setEnabled(true); else if(privs == "false") act->setEnabled(false); else if(!privs.isEmpty()) { bool enable = false; QStringList privlist = privs.split(' ', QString::SkipEmptyParts); for (int i = 0; i < privlist.size(); ++i) { bool tb = true; QStringList privandlist = privlist.at(i).split('+', QString::SkipEmptyParts); if(privandlist.size() > 1) { for(int ii = 0; ii < privandlist.size(); ++ii) tb = tb && __privCheck(privandlist.at(ii)); } else tb = enable || __privCheck(privlist.at(i)); enable = enable || tb; } act->setEnabled(enable); } } static QScriptValue settingsValue(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() == 2) return xtsettingsValue(context->argument(0).toString(), context->argument(1).toVariant()).toString(); else return xtsettingsValue(context->argument(0).toString()).toString(); } static QScriptValue settingsSetValue(QScriptContext *context, QScriptEngine *engine) { xtsettingsSetValue(context->argument(0).toString(), context->argument(1).toVariant()); return settingsValue(context, engine); } Action::Action( QWidget *pParent, const char *pName, const QString &pDisplayName, QObject *pTarget, const char *pActivateSlot, QWidget *pAddTo, bool pEnabled ) : QAction(pDisplayName, pParent) { init(pParent, pName, pDisplayName, pTarget, pActivateSlot, pAddTo, (pEnabled?"true":"false")); } Action::Action( QWidget *pParent, const char *pName, const QString &pDisplayName, QObject *pTarget, const char *pActivateSlot, QWidget *pAddTo, bool pEnabled, const QPixmap &pIcon, QWidget *pToolBar ) : QAction(pDisplayName, pParent) { init(pParent, pName, pDisplayName, pTarget, pActivateSlot, pAddTo, (pEnabled?"true":"false")); setIcon(QIcon(pIcon)); pToolBar->addAction(this); } Action::Action( QWidget *pParent, const char *pName, const QString &pDisplayName, QObject *pTarget, const char *pActivateSlot, QWidget *pAddTo, bool pEnabled, const QPixmap &pIcon, QWidget *pToolBar, const QString &pToolTip ) : QAction(pDisplayName, pParent) { init(pParent, pName, pDisplayName, pTarget, pActivateSlot, pAddTo, (pEnabled?"true":"false")); setIcon(QIcon(pIcon)); pToolBar->addAction(this); setToolTip(pToolTip); } Action::Action( QWidget *pParent, const char *pName, const QString &pDisplayName, QObject *pTarget, const char *pActivateSlot, QWidget *pAddTo, const QString & pEnabled ) : QAction(pDisplayName, pParent) { init(pParent, pName, pDisplayName, pTarget, pActivateSlot, pAddTo, pEnabled); } Action::Action( QWidget *pParent, const char *pName, const QString &pDisplayName, QObject *pTarget, const char *pActivateSlot, QWidget *pAddTo, const QString & pEnabled, const QPixmap &pIcon, QWidget *pToolBar ) : QAction(pDisplayName, pParent) { init(pParent, pName, pDisplayName, pTarget, pActivateSlot, pAddTo, pEnabled); setIcon(QIcon(pIcon)); pToolBar->addAction(this); } Action::Action( QWidget *pParent, const char *pName, const QString &pDisplayName, QObject *pTarget, const char *pActivateSlot, QWidget *pAddTo, const QString & pEnabled, const QPixmap &pIcon, QWidget *pToolBar, const QString &pToolTip ) : QAction(pDisplayName, pParent) { init(pParent, pName, pDisplayName, pTarget, pActivateSlot, pAddTo, pEnabled); setIcon(QIcon(pIcon)); pToolBar->addAction(this); setToolTip(pToolTip); } void Action::init( QWidget *, const char *pName, const QString &/*pDisplayName*/, QObject *pTarget, const char *pActivateSlot, QWidget *pAddTo, const QString & pEnabled ) { setObjectName(pName); QString hotkey; hotkey = _preferences->parent(pName); if (!hotkey.isNull() && !_hotkeyList.contains(hotkey)) { _hotkeyList << hotkey; setShortcutContext(Qt::ApplicationShortcut); if (hotkey.left(1) == "C") setShortcut(QString("Ctrl+%1").arg(hotkey.right(1))); else if (hotkey.left(1) == "F") setShortcut(hotkey); } connect(this, SIGNAL(triggered()), pTarget, pActivateSlot); //setEnabled(pEnabled); pAddTo->addAction(this); if(!pEnabled.isEmpty()) setData(pEnabled); __menuEvaluate(this); } class xTupleGuiClientInterface : public GuiClientInterface { public: QWidget* openWindow(const QString pname, ParameterList pparams, QWidget *parent = 0, Qt::WindowModality modality = Qt::NonModal, Qt::WindowFlags flags = 0) { ScriptToolbox toolbox(0); QWidget* w = toolbox.openWindow(pname, parent, modality, flags); if (w) { if (w->inherits("QDialog")) { XDialog* xdlg = (XDialog*)w; xdlg->set(pparams); w = (QWidget*)xdlg; return w; } else if (w->inherits("XMainWindow")) { XMainWindow* xwind = (XMainWindow*)w; xwind->set(pparams); w = (QWidget*)xwind; w->show(); return w; } else if (w->inherits("XWidget")) { XWidget* xwind = (XWidget*)w; xwind->set(pparams); w = (QWidget*)xwind; w->show(); return w; } } return 0; } QAction* findAction(const QString pname) { return omfgThis->findChild(pname); } void addDocumentWatch(QString path, int id) { omfgThis->addDocumentWatch(path, id); } void removeDocumentWatch(QString path) { omfgThis->removeDocumentWatch(path); } bool hunspell_ready() { return omfgThis->hunspell_ready(); } int hunspell_check(const QString word) { return omfgThis->hunspell_check(word); } const QStringList hunspell_suggest(const QString word) { return omfgThis->hunspell_suggest(word); } int hunspell_add(const QString word) { return omfgThis->hunspell_add(word); } int hunspell_ignore(const QString word) { return omfgThis->hunspell_ignore(word); } }; GUIClient *omfgThis; GUIClient::GUIClient(const QString &pDatabaseURL, const QString &pUsername) { XSqlQuery _GGUIClient; _menuBar = 0; _shown = false; _shuttingDown = false; _databaseURL = pDatabaseURL; _username = pUsername; __saveSizePositionEventFilter = new SaveSizePositionEventFilter(this); _splash->showMessage(tr("Initializing Internal Data"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _showTopLevel = true; if(_preferences->value("InterfaceWindowOption") == "Workspace") _showTopLevel = false; _GGUIClient.exec("SELECT startOfTime() AS sot, endOfTime() AS eot;"); if (_GGUIClient.first()) { _startOfTime = _GGUIClient.value("sot").toDate(); _endOfTime = _GGUIClient.value("eot").toDate(); } else systemError( this, tr( "A Critical Error occurred at %1::%2.\n" "Please immediately log out and contact your Systems Adminitrator." ) .arg(__FILE__) .arg(__LINE__) ); /* TODO: either separate validators for extprice, purchprice, and salesprice or replace every field that uses _moneyVal, _negMoneyVal, _priceVal, and _costVal with CurrCluster or CurrDisplay */ _qtyVal = new XDoubleValidator(0, 99999999.0, decimalPlaces("qty"), this); _transQtyVal = new XDoubleValidator(-99999999.0, 99999999.0, decimalPlaces("qty"), this); _qtyPerVal = new XDoubleValidator(0, 99999999.0, decimalPlaces("qtyper"), this); _scrapVal = new XDoubleValidator(0, 9999.0, decimalPlaces("percent"), this); _percentVal = new XDoubleValidator(0, 9999.0, decimalPlaces("percent"), this); _negPercentVal = new XDoubleValidator(-9999.0, 9999.0, decimalPlaces("percent"), this); _moneyVal = new XDoubleValidator(0, 9999999999.0, decimalPlaces("curr"), this); _negMoneyVal = new XDoubleValidator(-9999999999.0,9999999999.0, decimalPlaces("curr"), this); _priceVal = new XDoubleValidator(0, 9999999.0, decimalPlaces("purchprice"), this); _costVal = new XDoubleValidator(0, 9999999.0, decimalPlaces("cost"), this); _ratioVal = new XDoubleValidator(0, 9999999999.0, decimalPlaces("uomratio"), this); _weightVal = new XDoubleValidator(0, 99999999.0, decimalPlaces("weight"), this); _runTimeVal = new XDoubleValidator(0, 99999999.0, 2, this); _orderVal = new QIntValidator(0, 9999999, this); _dayVal = new QIntValidator(0, 9999, this); _fixedFont = new QFont("courier", 8); _systemFont = new QFont(qApp->font()); _workspace = new QMdiArea(); xtViewMode prevmode = (xtViewMode)(xtsettingsValue("GUIClient/viewMode", SubWindowView).toInt()); if (FreeFloatingView == prevmode) _workspace->setViewMode(QMdiArea::SubWindowView); else _workspace->setViewMode((QMdiArea::ViewMode)(prevmode)); _workspace->setOption(QMdiArea::DontMaximizeSubWindowOnActivation, false); _workspace->setWindowIcon(QIcon(":/images/clear.png")); _workspace->setActivationOrder(QMdiArea::ActivationHistoryOrder); #if defined Q_WS_MACX _workspace->setDocumentMode(true); #endif setCentralWidget(_workspace); _workspace->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); _workspace->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); _workspace->setContentsMargins(0, 0, 0, 0); // Install the InputManager _inputManager = new InputManager(); qApp->installEventFilter(_inputManager); setWindowTitle(); // load plugins before building the menus // TODO? add a step later to add to the menus from the plugins? QDir pluginsDir(QApplication::applicationDirPath()); while (! pluginsDir.exists("plugins") && pluginsDir.cdUp()) ; if (pluginsDir.cd("plugins")) { foreach (QString fileName, pluginsDir.entryList(QDir::Files)) new QPluginLoader(pluginsDir.absoluteFilePath(fileName), this); } // Populate the menu bar #ifdef Q_WS_MACX // qt_mac_set_native_menubar(false); #endif XSqlQuery window; window.prepare("SELECT usr_window " " FROM usr " " WHERE (usr_username=getEffectiveXtUser());"); window.exec(); // keep synchronized with user.ui.h _singleWindow = ""; if (window.first()) _singleWindow = window.value("usr_window").toString(); if (_singleWindow.isEmpty()) initMenuBar(); else _showTopLevel = true; // if we are in single level mode we want to run toplevel always // Load the user indicated background image _splash->showMessage(tr("Loading the Background Image"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); if (_preferences->value("BackgroundImageid").toInt() > 0) { _GGUIClient.prepare( "SELECT image_data " "FROM image " "WHERE (image_id=:image_id);" ); _GGUIClient.bindValue(":image_id", _preferences->value("BackgroundImageid").toInt()); _GGUIClient.exec(); if (_GGUIClient.first()) { QImage background; background.loadFromData(QUUDecode(_GGUIClient.value("image_data").toString())); _workspace->setBackground(QBrush(QPixmap::fromImage(background))); //_workspace->setBackgroundMode(Qt::FixedPixmap); } } _splash->showMessage(tr("Initializing Internal Timers"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _eventButton = NULL; _registerButton = NULL; _errorButton = NULL; __interval = _metrics->value("updateTickInterval").toInt(); if(__interval < 1) __interval = 1; __intervalCount = 0; sTick(); _timeoutHandler = new TimeoutHandler(this); connect(_timeoutHandler, SIGNAL(timeout()), this, SLOT(sIdleTimeout())); _timeoutHandler->setIdleMinutes(_preferences->value("IdleTimeout").toInt()); _reportHandler = 0; connect(_privileges, SIGNAL(loaded()), this, SLOT(initMenuBar())); VirtualClusterLineEdit::_guiClientInterface = new xTupleGuiClientInterface(); Documents::_guiClientInterface = VirtualClusterLineEdit::_guiClientInterface; MenuButton::_guiClientInterface = VirtualClusterLineEdit::_guiClientInterface; XTreeWidget::_guiClientInterface = VirtualClusterLineEdit::_guiClientInterface; XComboBox::_guiClientInterface = VirtualClusterLineEdit::_guiClientInterface; XTextEdit::_guiClientInterface = VirtualClusterLineEdit::_guiClientInterface; XTextEditHighlighter::_guiClientInterface = VirtualClusterLineEdit::_guiClientInterface; _splash->showMessage(tr("Completing Initialization"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _splash->finish(this); //Restore Window Size Saved on Close QRect availableGeometry = QApplication::desktop()->availableGeometry(); QSize defsize = QSize(); #if defined Q_WS_MACX defsize = QSize(1000, 650); #endif QPoint pos = xtsettingsValue("GUIClient/geometry/pos", QPoint()).toPoint(); QSize size = xtsettingsValue("GUIClient/geometry/size", defsize).toSize(); int mainXMax = availableGeometry.bottomRight().x(); int mainYMax = availableGeometry.bottomRight().y(); //if the window size is bigger than the //screen make it the screen size if(size.isValid()) { if(size.width() > mainXMax) size.setWidth(mainXMax); if(size.height() > mainYMax) size.setHeight(mainYMax); resize(size); } //put the main window back on screen if it is off screen in part or full if(!pos.isNull()) { if (pos.x() < availableGeometry.left()) pos.setX(availableGeometry.left()); else if (pos.x() + size.width() > mainXMax) pos.setX(qMax(availableGeometry.right() - size.width(), availableGeometry.left())); if (pos.y() < availableGeometry.top()) pos.setY(availableGeometry.top()); else if (pos.y() + size.height() > mainYMax) pos.setY(qMax(availableGeometry.height() - size.height(), availableGeometry.top())); move(pos); } setDocumentMode(true); // Set up document file watcher _fileWatcher = new QFileSystemWatcher(); connect(_fileWatcher, SIGNAL(fileChanged(QString)), this, SLOT(handleDocument(QString))); hunspell_initialize(); } GUIClient::~GUIClient() { QApplication::closeAllWindows(); errorLogListener::destroy(); //omfgThis = 0; // Close the database connection XSqlQuery qlc("SELECT logout();"); QSqlDatabase::database().close(); } GUIClient::WindowSystem GUIClient::getWindowSystem() { #ifdef Q_WS_X11 return X11; #elif defined Q_WS_WIN return WIN; #elif defined Q_WS_MAC return MAC; #elif defined Q_WS_QWS return QWS; #elif defined Q_WS_WINCE return WINCE; #elif defined Q_WS_S60 return S60; #else return Unknown; #endif } // TODO: can we get rid of _showTopLevel altogether? GUIClient::xtViewMode GUIClient::viewMode() const { if (_showTopLevel) return FreeFloatingView; else if (_workspace) return (GUIClient::xtViewMode)(_workspace->viewMode()); qWarning("GUIClient:: Don't know what viewMode I'm in"); return FreeFloatingView; } bool GUIClient::singleCurrency() { bool retValue = true; XSqlQuery currCount; currCount.exec("SELECT count(*) AS count FROM curr_symbol;"); if (currCount.first()) retValue = (currCount.value("count").toInt() <= 1); else systemError(this, currCount.lastError().databaseText(), __FILE__, __LINE__); return retValue; } void GUIClient::setWindowTitle() { XSqlQuery _GetWindowTitle; QString name; _splash->showMessage(tr("Loading Database Information"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _GetWindowTitle.exec( "SELECT metric_value, getEffectiveXtUser() AS username " "FROM metric " "WHERE (metric_name='DatabaseName')" ); if (_GetWindowTitle.first()) { if (_GetWindowTitle.value("metric_value").toString().isEmpty()) name = tr("Unnamed Database"); else name = _GetWindowTitle.value("metric_value").toString(); QString server; QString protocol; QString database; QString port; parseDatabaseURL(_databaseURL, protocol, server, database, port); if (_evaluation) QMainWindow::setWindowTitle( tr("%1 Evaluation %2 - Logged on as %3") .arg(_Name) .arg(_Version) .arg(_GetWindowTitle.value("username").toString()) ); else QMainWindow::setWindowTitle( tr("%1 %2 - %3 on %4/%5 AS %6") .arg(_Name) .arg(_Version) .arg(name) .arg(server) .arg(database) .arg(_GetWindowTitle.value("username").toString()) ); } else QMainWindow::setWindowTitle(_Name); } void GUIClient::setCaption() { } void GUIClient::initMenuBar() { static bool firstRun = true; qApp->setOverrideCursor(Qt::WaitCursor); if(!firstRun) { QList menulist = findChildren(); for(int m = 0; m < menulist.size(); ++m) { QList actionlist = menulist.at(m)->actions(); for(int i = 0; i < actionlist.size(); ++i) __menuEvaluate(actionlist.at(i)); } } else { menuBar()->clear(); _hotkeyList.clear(); QList toolbars = qFindChildren(this); while(!toolbars.isEmpty()) delete toolbars.takeFirst(); _splash->showMessage(tr("Initializing the Products Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); productsMenu = new menuProducts(this); _splash->showMessage(tr("Initializing the Inventory Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); inventoryMenu = new menuInventory(this); if(_metrics->value("Application") != "PostBooks") { _splash->showMessage(tr("Initializing the Scheduling Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); scheduleMenu = new menuSchedule(this); } _splash->showMessage(tr("Initializing the Purchase Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); purchaseMenu = new menuPurchase(this); _splash->showMessage(tr("Initializing the Manufacture Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); manufactureMenu = new menuManufacture(this); _splash->showMessage(tr("Initializing the CRM Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); crmMenu = new menuCRM(this); _splash->showMessage(tr("Initializing the Sales Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); salesMenu = new menuSales(this); _splash->showMessage(tr("Initializing the Accounting Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); accountingMenu = new menuAccounting(this); windowMenu = new menuWindow(this); _splash->showMessage(tr("Initializing the System Module"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); systemMenu = new menuSystem(this); } findChild("menu.prod")->menuAction()->setVisible(_preferences->boolean("ShowPDMenu")); findChild("menu.im")->menuAction()->setVisible(_preferences->boolean("ShowIMMenu")); if(_metrics->value("Application") != "PostBooks") { findChild("menu.sched")->menuAction()->setVisible(_preferences->boolean("ShowMSMenu")); } findChild("menu.purch")->menuAction()->setVisible(_preferences->boolean("ShowPOMenu")); findChild("menu.manu")->menuAction()->setVisible(_preferences->boolean("ShowWOMenu")); findChild("menu.crm")->menuAction()->setVisible(_preferences->boolean("ShowCRMMenu")); findChild("menu.sales")->menuAction()->setVisible(_preferences->boolean("ShowSOMenu")); findChild("menu.accnt")->menuAction()->setVisible(_preferences->boolean("ShowGLMenu")); // Restore toolbar positions from local machine restoreState(xtsettingsValue("MainWindowState", QByteArray()).toByteArray(), 1); // Set visibility of toolbars based on preferences stored in the databse findChild("Products Tools")->setVisible(_preferences->boolean("ShowPDToolbar")); findChild("Inventory Tools")->setVisible(_preferences->boolean("ShowIMToolbar")); if(_metrics->value("Application") != "PostBooks") { findChild("Schedule Tools")->setVisible(_preferences->boolean("ShowMSToolbar")); } findChild("Purchase Tools")->setVisible(_preferences->boolean("ShowPOToolbar")); findChild("Manufacture Tools")->setVisible(_preferences->boolean("ShowWOToolbar")); findChild("CRM Tools")->setVisible(_preferences->boolean("ShowCRMToolbar")); findChild("Sales Tools")->setVisible(_preferences->boolean("ShowSOToolbar")); findChild("Accounting Tools")->setVisible(_preferences->boolean("ShowGLToolbar")); findChild("Community Tools")->setVisible(_preferences->boolean("ShowPDToolbar") || _preferences->boolean("ShowIMToolbar") || _preferences->boolean("ShowMSToolbar") || _preferences->boolean("ShowPOToolbar") || _preferences->boolean("ShowWOToolbar") || _preferences->boolean("ShowCRMToolbar") || _preferences->boolean("ShowSOToolbar") || _preferences->boolean("ShowGLToolbar")); firstRun = false; qApp->restoreOverrideCursor(); } void GUIClient::saveToolbarPositions() { xtsettingsSetValue("MainWindowState", saveState(1)); // Set preferences base on visibility of toolbars _preferences->set("ShowPDToolbar", findChild("Products Tools")->isVisible()); _preferences->set("ShowIMToolbar", findChild("Inventory Tools")->isVisible()); if(_metrics->value("Application") != "PostBooks") _preferences->set("ShowMSToolbar", findChild("Schedule Tools")->isVisible()); _preferences->set("ShowPOToolbar", findChild("Purchase Tools")->isVisible()); _preferences->set("ShowWOToolbar", findChild("Manufacture Tools")->isVisible()); _preferences->set("ShowCRMToolbar", findChild("CRM Tools")->isVisible()); _preferences->set("ShowSOToolbar", findChild("Sales Tools")->isVisible()); _preferences->set("ShowGLToolbar", findChild("Accounting Tools")->isVisible()); } void GUIClient::closeEvent(QCloseEvent *event) { if (_showTopLevel || _workspace->viewMode() == QMdiArea::SubWindowView) { foreach (QWidget *child, QApplication::topLevelWidgets()) { if (child != this && ! child->close()) { event->ignore(); return; } } } else { foreach (QMdiSubWindow *child, _workspace->subWindowList()) { if (! child->close()) { event->ignore(); return; } } } hunspell_uninitialize(); _shuttingDown = true; // Remove any temporary document files being watched QMapIterator i(_fileMap); while (i.hasNext()) { i.next(); removeDocumentWatch(i.key()); } saveToolbarPositions(); // save main window info for next login xtsettingsSetValue("GUIClient/geometry/pos", pos()); xtsettingsSetValue("GUIClient/geometry/size", size()); xtsettingsSetValue("GUIClient/viewMode", viewMode()); // save state of any main window children QList windows = findChildren(); for (int i = 0; i < windows.size(); i++) { QByteArray state = windows.at(i)->saveState(); xtsettingsSetValue(windows.at(i)->objectName() + "/WindowState", state); } event->accept(); } void GUIClient::showEvent(QShowEvent *event) { if(!_shown) { _shown = true; // We only want the scripting to work on the NEO menu // START script code XSqlQuery sq; sq.prepare("SELECT script_source, script_order" " FROM script" " WHERE((script_name=:script_name)" " AND (script_enabled))" " ORDER BY script_order;"); sq.bindValue(":script_name", "initMenu"); sq.exec(); QScriptEngine * engine = 0; QScriptEngineDebugger * debugger = 0; bool found_one = false; while(sq.next()) { found_one = true; QString script = scriptHandleIncludes(sq.value("script_source").toString()); if(!engine) { engine = new QScriptEngine(this); if (_preferences->boolean("EnableScriptDebug")) { debugger = new QScriptEngineDebugger(this); debugger->attachTo(engine); } loadScriptGlobals(engine); } QScriptValue result = engine->evaluate(script, "initMenu"); if (engine->hasUncaughtException()) { int line = engine->uncaughtExceptionLineNumber(); qDebug() << "uncaught exception at line" << line << ":" << result.toString(); } } if(found_one) { QList menulist = findChildren(); for(int m = 0; m < menulist.size(); ++m) { QList actionlist = menulist.at(m)->actions(); for(int i = 0; i < actionlist.size(); ++i) { QAction* act = actionlist.at(i); if(!act->objectName().isEmpty()) { QString hotkey; hotkey = _preferences->parent(act->objectName()); if (!hotkey.isNull() && !_hotkeyList.contains(hotkey)) { _hotkeyList << hotkey; act->setShortcutContext(Qt::ApplicationShortcut); if (hotkey.left(1) == "C") act->setShortcut(QString("Ctrl+%1").arg(hotkey.right(1))); else if (hotkey.left(1) == "F") act->setShortcut(hotkey); } } } } } // END script code } QMainWindow::showEvent(event); } void GUIClient::sReportError(const QString &pError) { qDebug("%s", qPrintable(pError)); } void GUIClient::sTick() { // Check the database XSqlQuery tickle; tickle.exec( "SELECT CURRENT_DATE AS dbdate," " hasAlarms() AS alarms," " hasMessages() AS messages," " hasEvents() AS events;" ); if (tickle.first()) { _dbDate = tickle.value("dbdate").toDate(); if (isVisible()) { // Handle any un-dispatched Events if (tickle.value("events").toBool()) { if (_eventButton) { if (!_eventButton->isVisible()) _eventButton->show(); } else { _eventButton = new QPushButton(QIcon(":/images/dspEvents.png"), "", statusBar()); _eventButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _eventButton->setMinimumSize(QSize(32, 32)); _eventButton->setMaximumSize(QSize(32, 32)); statusBar()->setMinimumHeight(36); statusBar()->addWidget(_eventButton); connect(_eventButton, SIGNAL(clicked()), systemMenu, SLOT(sEventManager())); } } else if ( (_eventButton) && (_eventButton->isVisible()) ) _eventButton->hide(); } __intervalCount++; if(__intervalCount >= __interval) { emit(tick()); __intervalCount = 0; } _tick.singleShot(60000, this, SLOT(sTick())); } else { // Check to make sure we are not in the middle of an aborted transaction // before we go doing something rash. if(tickle.lastError().databaseText().contains("current transaction is aborted")) return; systemError(this, tr("

    You have been disconnected from the database server. " "This is usually caused by an interruption in your " "network. Please exit the application and restart." "

    %1
    " ) .arg(tickle.lastError().databaseText())); } } void GUIClient::sNewErrorMessage() { if (QApplication::closingDown()) return; if (_errorButton) _errorButton->setVisible(true); else { _errorButton = new QPushButton(QIcon(":/images/dspError.png"), "", statusBar()); _errorButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _errorButton->setMinimumSize(QSize(32, 32)); _errorButton->setMaximumSize(QSize(32, 32)); statusBar()->setMinimumHeight(36); statusBar()->addWidget(_errorButton); connect(_errorButton, SIGNAL(clicked()), systemMenu, SLOT(sErrorLog())); } } void GUIClient::sClearErrorMessages() { if (_errorButton) _errorButton->setVisible(false); } // Global notification slots void GUIClient::sSystemMessageAdded() { emit systemMessageAdded(); // Grab any new System Messages XSqlQuery msg; msg.exec( "SELECT msguser_id " "FROM msg, msguser " "WHERE ( (msguser_username=getEffectiveXtUser())" " AND (msguser_msg_id=msg_id)" " AND (CURRENT_TIMESTAMP BETWEEN msg_scheduled AND msg_expires)" " AND (msguser_viewed IS NULL) );" ); if (msg.first()) { ParameterList params; params.append("mode", "acknowledge"); systemMessage newdlg(this, "", TRUE); newdlg.set(params); do { ParameterList params; params.append("msguser_id", msg.value("msguser_id").toInt()); newdlg.set(params); newdlg.exec(); } while (msg.next()); } } void GUIClient::sItemsUpdated(int intPItemid, bool boolPLocalUpdate) { emit itemsUpdated(intPItemid, boolPLocalUpdate); } void GUIClient::sItemsitesUpdated() { emit itemsitesUpdated(); } void GUIClient::sWarehousesUpdated() { emit warehousesUpdated(); } void GUIClient::sCustomersUpdated(int pCustid, bool pLocal) { emit customersUpdated(pCustid, pLocal); } void GUIClient::sEmployeeUpdated(int id) { emit employeeUpdated(id); } void GUIClient::sGlSeriesUpdated() { emit glSeriesUpdated(); } void GUIClient::sVendorsUpdated() { emit vendorsUpdated(); } void GUIClient::sProspectsUpdated() { emit prospectsUpdated(); } void GUIClient::sReturnAuthorizationsUpdated() { emit returnAuthorizationsUpdated(); } void GUIClient::sStandardPeriodsUpdated() { emit standardPeriodsUpdated(); } void GUIClient::sSalesOrdersUpdated(int pSoheadid) { emit salesOrdersUpdated(pSoheadid, TRUE); } void GUIClient::sSalesRepUpdated(int id) { emit salesRepUpdated(id); } void GUIClient::sCreditMemosUpdated() { emit creditMemosUpdated(); } void GUIClient::sQuotesUpdated(int pQuheadid) { emit quotesUpdated(pQuheadid, TRUE); } void GUIClient::sWorkOrderMaterialsUpdated(int pWoid, int pWomatlid, bool pLocalUpdate) { emit workOrderMaterialsUpdated(pWoid, pWomatlid, pLocalUpdate); } void GUIClient::sWorkOrderOperationsUpdated(int pWoid, int pWooperid, bool pLocalUpdate) { emit workOrderOperationsUpdated(pWoid, pWooperid, pLocalUpdate); } void GUIClient::sWorkOrdersUpdated(int pWoid, bool pLocalUpdate) { emit workOrdersUpdated(pWoid, pLocalUpdate); } void GUIClient::sPurchaseOrdersUpdated(int pPoheadid, bool pLocalUpdate) { emit purchaseOrdersUpdated(pPoheadid, pLocalUpdate); } void GUIClient::sPurchaseOrderReceiptsUpdated() { emit purchaseOrderReceiptsUpdated(); } void GUIClient::sPurchaseRequestsUpdated() { emit purchaseRequestsUpdated(); } void GUIClient::sVouchersUpdated() { emit vouchersUpdated(); } void GUIClient::sBOMsUpdated(int intPItemid, bool boolPLocalUpdate) { emit bomsUpdated(intPItemid, boolPLocalUpdate); } void GUIClient::sBBOMsUpdated(int intPItemid, bool boolPLocalUpdate) { emit bbomsUpdated(intPItemid, boolPLocalUpdate); } void GUIClient::sBOOsUpdated(int intPItemid, bool boolPLocalUpdate) { emit boosUpdated(intPItemid, boolPLocalUpdate); } void GUIClient::sBudgetsUpdated(int intPItemid, bool boolPLocalUpdate) { emit budgetsUpdated(intPItemid, boolPLocalUpdate); } void GUIClient::sAssortmentsUpdated(int pItemid, bool pLocalUpdate) { emit assortmentsUpdated(pItemid, pLocalUpdate); } void GUIClient::sWorkCentersUpdated() { emit workCentersUpdated(); } void GUIClient::sBillingSelectionUpdated(int pCoheadid, int pCoitemid) { emit billingSelectionUpdated(pCoheadid, pCoitemid); } void GUIClient::sInvoicesUpdated(int pInvcheadid, bool pLocal) { emit invoicesUpdated(pInvcheadid, pLocal); } void GUIClient::sItemGroupsUpdated(int pItemgrpid, bool pLocal) { emit itemGroupsUpdated(pItemgrpid, pLocal); } void GUIClient::sCashReceiptsUpdated(int pCashrcptid, bool pLocal) { emit cashReceiptsUpdated(pCashrcptid, pLocal); } void GUIClient::sBankAccountsUpdated() { emit bankAccountsUpdated(); } void GUIClient::sBankAdjustmentsUpdated(int pBankadjid, bool pLocal) { emit bankAdjustmentsUpdated(pBankadjid, pLocal); } void GUIClient::sQOHChanged(int pItemsiteid, bool pLocal) { emit qohChanged(pItemsiteid, pLocal); } void GUIClient::sReportsChanged(int pReportid, bool pLocal) { emit reportsChanged(pReportid, pLocal); } void GUIClient::sChecksUpdated(int pBankaccntid, int pCheckid, bool pLocal) { emit checksUpdated(pBankaccntid, pCheckid, pLocal); emit paymentsUpdated(pBankaccntid, -1, pLocal); } void GUIClient::sPaymentsUpdated(int pBankaccntid, int pApselectid, bool pLocal) { emit paymentsUpdated(pBankaccntid, pApselectid, pLocal); } void GUIClient::sConfigureGLUpdated() { emit configureGLUpdated(); } void GUIClient::sProjectsUpdated(int prjid) { emit projectsUpdated(prjid); } void GUIClient::sCrmAccountsUpdated(int crmacctid) { emit crmAccountsUpdated(crmacctid); } void GUIClient::sTaxAuthsUpdated(int taxauthid) { emit taxAuthsUpdated(taxauthid); } void GUIClient::sTransferOrdersUpdated(int id) { emit transferOrdersUpdated(id); } void GUIClient::sUserUpdated(QString username) { emit userUpdated(username); } void GUIClient::sIdleTimeout() { // so we don't accidentally get called again waiting _timeoutHandler->reset(); ParameterList params; params.append("minutes", _timeoutHandler->idleMinutes()); idleShutdown newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) qApp->quit(); } int systemError(QWidget *pParent, const QString &pMessage) { ErrorReporter::error(QtCriticalMsg, pParent, QObject::tr("System Message"), pMessage); return QMessageBox::Ok; } int systemError(QWidget *pParent, const QString &pMessage, const QString &pFileName, const int lineNumber) { ErrorReporter::error(QtCriticalMsg, pParent, QObject::tr("System Message (%1 at %2)") .arg(pFileName).arg(lineNumber), pMessage, pFileName, lineNumber); return QMessageBox::Ok; } void message(const QString &pMessage, int pTimeout) { if (pTimeout == 0) omfgThis->statusBar()->showMessage(pMessage); else omfgThis->statusBar()->showMessage(pMessage, pTimeout); qApp->processEvents(); } void resetMessage() { omfgThis->statusBar()->showMessage(QObject::tr("Ready...")); qApp->processEvents(); } void audioAccept() { qApp->beep(); } void audioReject() { qApp->beep(); } /** @brief Find the translation file for a given locale. Looks for the translation %file for a particular locale in all of the standard places xTuple ERP knows to look. The first %file found is returned even if it isn't the most complete, specific, or up-to-date. @param localestr The locale to look for, in standard format. @param component The application component for which to find a translation file (empty string means core) @return The path to the translation file (may be relative or absolute) */ QString translationFile(QString localestr, const QString component) { QString version = QString::null; return translationFile(localestr, component, version); } /** @brief Find the translation file for a given locale. This overload should be used primarily by the Update Manager. Looks for the translation %file for a particular locale in all of the standard places xTuple ERP knows to look. The first %file found is returned even if it isn't the most complete, specific, or up-to-date. If translation %file is found for the locale, this overload of translationFile(QString) tries to extract a version number from the translation %file and pass it back to the caller. The base translation file is expected to have a @c Version string in the component context. Translations from that base translation %file are expected to translate the @c Version string to something meaningful that can be put in the compatibility matrix. One suggestion is @c major.minor.percent-complete , where @c major and @c minor are component release numbers and percent-complete indicates how much of the base translation file has been completed. @param[in] localestr The locale to look for, in standard format. @param[in] component The application component for which to find a translation file (empty string means core) @param[out] version The version string found in the translation file or an empty string if none was found. @return The path to the translation file (may be relative or absolute) */ QString translationFile(QString localestr, const QString component, QString &version) { QStringList paths; //qDebug() << QDesktopServices::storageLocation(QDesktopServices::DataLocation); paths << QDesktopServices::storageLocation(QDesktopServices::DataLocation); paths << "dict"; paths << ""; paths << "../dict"; paths << QApplication::applicationDirPath() + "/dict"; paths << QApplication::applicationDirPath(); paths << QApplication::applicationDirPath() + "/../dict"; #if defined Q_WS_MACX paths << QApplication::applicationDirPath() + "/../../../dict"; paths << QApplication::applicationDirPath() + "/../../.."; #endif QTranslator translator; for (QStringList::Iterator pit = paths.begin(); pit != paths.end(); pit++) { QString filename = *pit + "/" + component + "." + localestr; if (translator.load(filename)) { if (! version.isNull()) version = translator.translate(component.toAscii().data(), "Version"); return filename; } } return QString::null; } void GUIClient::populateCustomMenu(QMenu * menu, const QString & module) { QMenu *customMenu = 0; XSqlQuery qry; qry.prepare("SELECT cmd_id, cmd_title, cmd_privname," " COALESCE(cmd_name, cmd_title) AS cmd_name" " FROM cmd" " WHERE (cmd_module=:module)" " ORDER BY cmd_title, cmd_id; "); qry.bindValue(":module", module); qry.exec(); while(qry.next()) { if(customMenu == 0) { customMenu = menu->addMenu(tr("Custom")); customMenu->setObjectName("menu." + module.toLower() + ".custom"); } QString allowed = "true"; QString privname = qry.value("cmd_privname").toString(); if(!privname.isEmpty()) allowed = "Custom"+privname; QString cmdname = QString("custom." + qry.value("cmd_name").toString()); Action *action = new Action(this, cmdname.toAscii().data(), qry.value("cmd_title").toString(), this, SLOT(sCustomCommand()), customMenu, allowed); _customCommands.insert(action, qry.value("cmd_id").toInt()); //actions.append(action); } } void GUIClient::sCustomCommand() { XSqlQuery GCustomCommand; const QObject * obj = sender(); QMap::const_iterator it; it = _customCommands.find(obj); if(it != _customCommands.end()) { GCustomCommand.prepare("SELECT cmd_executable" " FROM cmd" " WHERE(cmd_id=:cmd_id);"); GCustomCommand.bindValue(":cmd_id", it.value()); GCustomCommand.exec(); GCustomCommand.first(); QString cmd = GCustomCommand.value("cmd_executable").toString(); if(cmd.toLower() == "!customuiform") { bool haveParams = false; ParameterList params; bool asDialog = false; QString asName; GCustomCommand.prepare("SELECT cmdarg_arg AS argument" " FROM cmdarg" " WHERE (cmdarg_cmd_id=:cmd_id)" " ORDER BY cmdarg_order; "); GCustomCommand.bindValue(":cmd_id", it.value()); GCustomCommand.exec(); while(GCustomCommand.next()) { cmd = GCustomCommand.value("argument").toString(); if(cmd.startsWith("uiformtype=", Qt::CaseInsensitive)) asDialog = (cmd.right(cmd.length() - 11).toLower() == "dialog"); else if(cmd.startsWith("uiform=", Qt::CaseInsensitive)) asName = cmd.right(cmd.length() - 7); else if (cmd.startsWith("-param=", Qt::CaseInsensitive)) { // Taken from OpenRPT/renderapp with slight modifications QString str = cmd.right(cmd.length() - 7); bool active = true; QString name; QString type; QString value; QVariant var; int sep = str.indexOf('='); if(sep == -1) name = str; else { name = str.left(sep); value = str.right(str.length() - (sep + 1)); } str = name; sep = str.indexOf(':'); if(sep != -1) { name = str.left(sep); type = str.right(str.length() - (sep + 1)); } if(name.startsWith("-")) { name = name.right(name.length() - 1); active = false; } else if(name.startsWith("+")) name = name.right(name.length() - 1); if(!value.isEmpty()) var = XVariant::decode(type, value); if(active) { haveParams = true; params.append(name, var); } // end copied code from OpenRPT/renderapp } } if(asName.isEmpty()) return; GCustomCommand.prepare("SELECT *" " FROM uiform" " WHERE((uiform_name=:uiform_name)" " AND (uiform_enabled))" " ORDER BY uiform_order DESC" " LIMIT 1;"); GCustomCommand.bindValue(":uiform_name", asName); GCustomCommand.exec(); if(!GCustomCommand.first()) { QMessageBox::critical(this, tr("Could Not Create Form"), tr("

    Could not create the '%1' form. Either an " "error occurred or the specified form does " "not exist.").arg(asName) ); return; } XUiLoader loader; QByteArray ba = GCustomCommand.value("uiform_source").toString().toUtf8(); QBuffer uiFile(&ba); if(!uiFile.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Could not load file"), tr("There was an error loading the UI Form from the database.")); return; } QWidget *ui = loader.load(&uiFile); QSize size = ui->size(); uiFile.close(); if(asDialog) { XDialog dlg(this); dlg.setObjectName(GCustomCommand.value("uiform_name").toString()); QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(ui); dlg.setLayout(layout); dlg.setWindowTitle(ui->windowTitle()); dlg.resize(size); dlg.exec(); } else { XMainWindow * wnd = new XMainWindow(); wnd->setObjectName(GCustomCommand.value("uiform_name").toString()); wnd->setCentralWidget(ui); wnd->setWindowTitle(ui->windowTitle()); wnd->resize(size); handleNewWindow(wnd); } } else if(cmd.toLower().startsWith("!openurl")) { //allow a file or Url to be opened from a custom command directly // backwards compatibility with original patch - deprecated usage QString urltext = cmd.mid(8, cmd.length()).trimmed(); if (! urltext.isEmpty()) { qWarning("Deprecated usage of !openurl. Use cmdarg."); //If url scheme is missing, we'll assume it is "file" for now. QUrl url(urltext); if (url.scheme().isEmpty()) url.setScheme("file"); QDesktopServices::openUrl(url); } // end of deprecated usage GCustomCommand.prepare("SELECT cmdarg_arg " "FROM cmdarg " "WHERE (cmdarg_cmd_id=:cmd_id) " "ORDER BY cmdarg_order;"); GCustomCommand.bindValue(":cmd_id", it.value()); GCustomCommand.exec(); while (GCustomCommand.next()) { QUrl url(GCustomCommand.value("cmdarg_arg").toString()); if (url.scheme().isEmpty()) url.setScheme("file"); QDesktopServices::openUrl(url); } } else { QProcess *proc = new QProcess(this); QString command; QStringList args; connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), proc, SLOT(deleteLater())); GCustomCommand.prepare("SELECT 1 AS base," " 0 AS ord," " cmd_executable AS argument" " FROM cmd" " WHERE (cmd_id=:cmd_id)" " UNION " "SELECT 2 AS base," " cmdarg_order AS ord," " cmdarg_arg AS argument" " FROM cmdarg" " WHERE (cmdarg_cmd_id=:cmd_id)" " ORDER BY base, ord; "); GCustomCommand.bindValue(":cmd_id", it.value()); GCustomCommand.exec(); if (GCustomCommand.first()) { command = GCustomCommand.value("argument").toString(); while(GCustomCommand.next()) args.append(GCustomCommand.value("argument").toString()); proc->start(command, args); } } } } void GUIClient::launchBrowser(QWidget * w, const QString & url) { #if defined(Q_OS_WIN32) // Windows - let the OS do the work QT_WA( { ShellExecute(w->winId(), 0, (TCHAR*)url.utf16(), 0, 0, SW_SHOWNORMAL ); } , { ShellExecuteA( w->winId(), 0, url.toLocal8Bit(), 0, 0, SW_SHOWNORMAL ); } ); #else const char *b = getenv("BROWSER"); QStringList browser; if(b) { QString t(b); browser = t.split(':', QString::SkipEmptyParts); } #if defined(Q_OS_MACX) browser.append("/usr/bin/open"); #else // append this on linux just as a good guess browser.append("/usr/bin/firefox"); browser.append("/usr/bin/mozilla"); #endif for(QStringList::const_iterator cit=browser.begin(); cit!=browser.end(); ++cit) { QString app = *cit; if(app.contains("%s")) { app.replace("%s", url); } else { app += " " + url; } app.replace("%%", "%"); QProcess *proc = new QProcess(w); connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), proc, SLOT(deleteLater())); QStringList args = app.split(QRegExp(" +")); QString cmd = args.first(); args.removeFirst(); proc->start(cmd, args); if (proc->waitForStarted()) return; } // There was an error. Offer the user a chance to look at the online help to // tell them about the BROWSER variable if(1==QMessageBox::warning(w, tr("Failed to open URL"), url, tr("OK"), tr("Help"))) { //launchHelp("browser.html"); QMessageBox::information( w, tr("Quick Help"), tr("

    Before you can run a browser you must set " "the environment variable BROWSER to point " "to the browser executable.") ); } #endif } QWidgetList GUIClient::windowList() { return _windowList; } void GUIClient::windowDestroyed(QObject * o) { QWidget * w = qobject_cast(o); if(w) _windowList.removeAll(w); } bool SaveSizePositionEventFilter::eventFilter(QObject *obj, QEvent *event) { if(event->type() == QEvent::Close) omfgThis->saveWidgetSizePos(qobject_cast(obj)); return QObject::eventFilter(obj, event); } /** Save the size and position of the passed in widget for future use. @return The return value indicates whether the position or size was saved or not. It might not have been saved because the user told us not to save them for this widget, because the application is running in tabbed mode, or something similar. */ bool GUIClient::saveWidgetSizePos(QWidget *pWidget) { if (! pWidget) return false; bool returnVal = false; QString objName = pWidget->objectName(); /* qDebug() << __FUNCTION__ << pWidget->isMaximized() << pWidget->size() << xtsettingsValue(objName + "/geometry/rememberSize", true).toBool() << pWidget->pos() << xtsettingsValue(objName + "/geometry/rememberPos", true).toBool(); */ if (! pWidget->isMaximized()) { if (xtsettingsValue(objName + "/geometry/rememberSize", true).toBool()) { xtsettingsSetValue(objName + "/geometry/size", pWidget->size()); returnVal = true; } if (xtsettingsValue(objName + "/geometry/rememberPos", true).toBool()) { xtsettingsSetValue(objName + "/geometry/pos", pWidget->pos()); returnVal = true; } } return returnVal; } bool GUIClient::restoreWidgetSizePos(QWidget *pWidget, bool forceFloat) { bool returnVal = false; if (! pWidget) returnVal = false; else if (windowFlags() & (Qt::Window | Qt::Dialog) && metaObject()->className() != QString("xTupleDesigner")) { QRect availableGeometry = QApplication::desktop()->availableGeometry(); if (! showTopLevel() && ! pWidget->isModal()) availableGeometry = _workspace->geometry(); QString objName = pWidget->objectName(); QPoint pos = xtsettingsValue(objName + "/geometry/pos").toPoint(); QSize lsize = xtsettingsValue(objName + "/geometry/size").toSize(); /* qDebug() << __FUNCTION__ << pWidget->isModal() << showTopLevel() << _workspace->viewMode() << availableGeometry << lsize << xtsettingsValue(objName + "/geometry/rememberSize", true).toBool() << pos << xtsettingsValue(objName + "/geometry/rememberPos", true).toBool(); */ QMainWindow *mw = qobject_cast(pWidget); if (mw) mw->statusBar()->show(); QWidget *parentWindow = qobject_cast(pWidget->parent()); if (lsize.isValid() && xtsettingsValue(objName + "/geometry/rememberSize", true).toBool()) { if (showTopLevel()) pWidget->resize(lsize); else if (parentWindow && _workspace->viewMode() == QMdiArea::SubWindowView && (!pWidget->inherits("setup") && !pWidget->inherits("userPreferences") && !pWidget->inherits("copyItem") && !pWidget->inherits("copyBOM"))) parentWindow->resize(lsize); } bool shouldRestore = ! pos.isNull() && availableGeometry.contains(QRect(pos, pWidget->size())) && xtsettingsValue(objName + "/geometry/rememberPos", true).toBool(); if (showTopLevel() || pWidget->isModal() || forceFloat) { if (shouldRestore) pWidget->move(pos); } else if (_workspace->viewMode() == QMdiArea::TabbedView) pWidget->setWindowState(Qt::WindowMaximized); else if (shouldRestore) pWidget->parentWidget()->move(pos); returnVal = true; } return returnVal; } /* TODO: in workspace subwindow mode, w->show is called twice for every call to handleNewWindow. w gets resized between the 1st and 2nd calls, so pos memory works but not size memory. why are there 2 show() calls & who is resizing w? TODO: combine window handling from here, scripttoolbox, & guiclientinterface */ void GUIClient::handleNewWindow(QWidget *w, Qt::WindowModality m, bool forceFloat) { if (! w->isModal()) { if (w->parentWidget()) { if (w->parentWidget()->window()->isModal()) w->setWindowModality(Qt::ApplicationModal); else { w->setWindowModality(m); // don't destroy nonmodal children if their nonmodal parents get closed. // setParent(0) because using 'this' embeds w in the main app window. // reset the focusWidget because setParent changes it (?) QWidget * fw = w->focusWidget(); w->setParent(0); if(fw) fw->setFocus(); } } else w->setWindowModality(m); } connect(w, SIGNAL(destroyed(QObject*)), this, SLOT(windowDestroyed(QObject*))); w->setAttribute(Qt::WA_DeleteOnClose); _windowList.append(w); if (! forceFloat && ! w->isModal() && ! showTopLevel()) { QMdiSubWindow *subwin = _workspace->addSubWindow(w); _workspace->setActiveSubWindow(subwin); if (QDialog *dlg = qobject_cast(w)) // not == connect(dlg, SIGNAL(finished(int)), subwin, SLOT(hide())); connect(w, SIGNAL(destroyed(QObject*)), subwin, SLOT(close())); } // TODO: why do {XDialog,XMainWindow,XWidget}::showEvent call restoreWidgetSizePos? if (! w->inherits("XDialog") && ! w->inherits("XMainWindow") && ! w->inherits("XWidget")) { restoreWidgetSizePos(w, forceFloat); if (! w->isModal()) w->installEventFilter(__saveSizePositionEventFilter); } w->show(); if (showTopLevel()) w->activateWindow(); } QMenuBar *GUIClient::menuBar() { #ifdef Q_WS_MACX if (_menuBar == 0) _menuBar = new QMenuBar(); return _menuBar; #else return QMainWindow::menuBar(); #endif } /*! Adds the given @a dockwidget to the specified @a area. */ void GUIClient::addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget ) { QMainWindow::addDockWidget( area, dockwidget); } /*! This is an overloaded function. Equivalent of calling addToolBar(Qt::TopToolBarArea, toolbar) */ void GUIClient::addToolBar ( QToolBar * toolbar ) { QMainWindow::addToolBar(Qt::TopToolBarArea, toolbar); } /*! Adds the toolbar into the specified area in this main window. The toolbar is placed at the end of the current tool bar block (i.e. line). If the main window already manages toolbar then it will only move the toolbar to area. See also @sa addToolBarBreak(). */ void GUIClient::addToolBar ( Qt::ToolBarArea area, QToolBar * toolbar ) { QMainWindow::addToolBar(area, toolbar); } /*! Adds a toolbar break to the given area after all the other objects that are present. */ void GUIClient::addToolBarBreak ( Qt::ToolBarArea area ) { QMainWindow::addToolBarBreak(area); } /*! Moves @a second dock widget on top of @a first dock widget, creating a tabbed docked area in the main window. */ void GUIClient::tabifyDockWidget ( QDockWidget * first, QDockWidget * second ) { QMainWindow::tabifyDockWidget( first, second ); } /*! Sets the given @a widget to be the main window's central widget. Note: GUIClient takes ownership of the @a widget pointer and deletes it at the appropriate time. */ void GUIClient::setCentralWidget(QWidget * widget) { QMainWindow::setCentralWidget(widget); } // TODO: when std edition is extracted, replace this with a script include() QScriptValue distributeInventorySeriesAdjust(QScriptContext *context, QScriptEngine *engine) { int result = -1; if (context->argumentCount() == 1 && context->argument(0).isNumber()) result = distributeInventory::SeriesAdjust(context->argument(0).toInt32(), 0); else if (context->argumentCount() == 2 && context->argument(0).isNumber() && qscriptvalue_cast(context->argument(1))) result = distributeInventory::SeriesAdjust(context->argument(0).toInt32(), qscriptvalue_cast(context->argument(1))); else if (context->argumentCount() == 3 && context->argument(0).isNumber() && qscriptvalue_cast(context->argument(1))) result = distributeInventory::SeriesAdjust(context->argument(0).toInt32(), qscriptvalue_cast(context->argument(1)), context->argument(2).toString()); else if (context->argumentCount() == 4 && context->argument(0).isNumber() && qscriptvalue_cast(context->argument(1)) && context->argument(3).isDate()) result = distributeInventory::SeriesAdjust(context->argument(0).toInt32(), qscriptvalue_cast(context->argument(1)), context->argument(2).toString(), context->argument(3).toDateTime().date()); else if (context->argumentCount() == 5 && context->argument(0).isNumber() && qscriptvalue_cast(context->argument(1)) && context->argument(3).isDate() && context->argument(4).isDate()) result = distributeInventory::SeriesAdjust(context->argument(0).toInt32(), qscriptvalue_cast(context->argument(1)), context->argument(2).toString(), context->argument(3).toDateTime().date(), context->argument(4).toDateTime().date()); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate SeriesAdjust method"); return engine->toScriptValue(result); } void GUIClient::loadScriptGlobals(QScriptEngine * engine) { if(!engine) return; #if QT_VERSION >= 0x040500 engine->installTranslatorFunctions(); #endif qScriptRegisterMetaType(engine, SetResponsetoScriptValue, SetResponsefromScriptValue); qScriptRegisterMetaType(engine, ParameterGroupTypestoScriptValue, ParameterGroupTypesfromScriptValue); qScriptRegisterMetaType(engine, ParameterGroupStatestoScriptValue, ParameterGroupStatesfromScriptValue); qScriptRegisterMetaType(engine, QtWindowModalitytoScriptValue, QtWindowModalityfromScriptValue); qScriptRegisterMetaType(engine, SaveFlagstoScriptValue, SaveFlagsfromScriptValue); qScriptRegisterMetaType(engine, WindowSystemtoScriptValue, WindowSystemfromScriptValue); ScriptToolbox * tb = new ScriptToolbox(engine); QScriptValue toolbox = engine->newQObject(tb); engine->globalObject().setProperty("toolbox", toolbox); QScriptValue mainwindowval = engine->newQObject(this); engine->globalObject().setProperty("mainwindow", mainwindowval); mainwindowval.setProperty("NoError", QScriptValue(engine, NoError), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("NoError_Cancel", QScriptValue(engine, NoError_Cancel), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("NoError_Run", QScriptValue(engine, NoError_Run), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("NoError_Print", QScriptValue(engine, NoError_Print), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("NoError_Submit", QScriptValue(engine, NoError_Submit), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("Error_NoSetup", QScriptValue(engine, Error_NoSetup), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("UndefinedError", QScriptValue(engine, UndefinedError), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("X11", QScriptValue(engine, X11), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("WIN", QScriptValue(engine, WIN), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("MAC", QScriptValue(engine, MAC), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("QWS", QScriptValue(engine, QWS), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("WINCE", QScriptValue(engine, WINCE), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("S60", QScriptValue(engine, S60), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("Unknown", QScriptValue(engine, Unknown), QScriptValue::ReadOnly | QScriptValue::Undeletable); QScriptValue metricsval = engine->newQObject(_metrics); engine->globalObject().setProperty("metrics", metricsval); QScriptValue metricsencval = engine->newQObject(_metricsenc); engine->globalObject().setProperty("metricsenc", metricsencval); QScriptValue preferencesval = engine->newQObject(_preferences); engine->globalObject().setProperty("preferences", preferencesval); QScriptValue privilegesval = engine->newQObject(_privileges); engine->globalObject().setProperty("privileges", privilegesval); QScriptValue settingsval = engine->newFunction(settingsValue, 2); engine->globalObject().setProperty("settingsValue", settingsval); QScriptValue settingssetval = engine->newFunction(settingsSetValue, 2); engine->globalObject().setProperty("settingsSetValue", settingssetval); engine->globalObject().setProperty("startOfTime", engine->newDate(QDateTime(_startOfTime))); engine->globalObject().setProperty("endOfTime", engine->newDate(QDateTime(_endOfTime))); // TODO: when std edition is extracted, replace this with a script include() QScriptValue distribInvObj = engine->newFunction(distributeInventorySeriesAdjust); distribInvObj.setProperty("SeriesAdjust", distribInvObj, QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("DistributeInventory", distribInvObj); mainwindowval.setProperty("UndefinedError", QScriptValue(engine, UndefinedError), QScriptValue::ReadOnly | QScriptValue::Undeletable); // #defines from guiclient.h mainwindowval.setProperty("cNew", QScriptValue(engine, cNew), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cEdit", QScriptValue(engine, cEdit), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cView", QScriptValue(engine, cView), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cCopy", QScriptValue(engine, cCopy), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cRelease", QScriptValue(engine, cRelease), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cPost", QScriptValue(engine, cPost), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cReplace", QScriptValue(engine, cReplace), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cPostedCounts", QScriptValue(engine, cPostedCounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cUnpostedCounts", QScriptValue(engine, cUnpostedCounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cAllCounts", QScriptValue(engine, cAllCounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cLocation", QScriptValue(engine, cLocation), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cItemloc", QScriptValue(engine, cItemloc), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cTransAll", QScriptValue(engine, cTransAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cTransReceipts", QScriptValue(engine, cTransReceipts), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cTransIssues", QScriptValue(engine, cTransIssues), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cTransShipments", QScriptValue(engine, cTransShipments), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cTransAdjCounts", QScriptValue(engine, cTransAdjCounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cTransTransfers", QScriptValue(engine, cTransTransfers), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cTransScraps", QScriptValue(engine, cTransScraps), QScriptValue::ReadOnly | QScriptValue::Undeletable); mainwindowval.setProperty("cNoReportDefinition", QScriptValue(engine, cNoReportDefinition), QScriptValue::ReadOnly | QScriptValue::Undeletable); QScriptValue inputmanagerval = engine->newQObject(_inputManager); engine->globalObject().setProperty("InputManager", inputmanagerval); // #defines from inputmanager.h inputmanagerval.setProperty("cBCWorkOrder", QScriptValue(engine, cBCWorkOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCWorkOrderMaterial", QScriptValue(engine, cBCWorkOrderMaterial), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCWorkOrderOperation", QScriptValue(engine, cBCWorkOrderOperation), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCSalesOrder", QScriptValue(engine, cBCSalesOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCSalesOrderLineItem", QScriptValue(engine, cBCSalesOrderLineItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCItemSite", QScriptValue(engine, cBCItemSite), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCItem", QScriptValue(engine, cBCItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCUPCCode", QScriptValue(engine, cBCUPCCode), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCEANCode", QScriptValue(engine, cBCEANCode), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCCountTag", QScriptValue(engine, cBCCountTag), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCLocation", QScriptValue(engine, cBCLocation), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCLocationIssue", QScriptValue(engine, cBCLocationIssue), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCLocationContents", QScriptValue(engine, cBCLocationContents), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCUser", QScriptValue(engine, cBCUser), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCTransferOrder", QScriptValue(engine, cBCTransferOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCTransferOrderLineItem", QScriptValue(engine, cBCTransferOrderLineItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); inputmanagerval.setProperty("cBCLotSerialNumber", QScriptValue(engine, cBCLotSerialNumber), QScriptValue::ReadOnly | QScriptValue::Undeletable); setupScriptApi(engine); setupSetupApi(engine); } void GUIClient::addDocumentWatch(QString path, int id) { if (_fileWatcher->files().contains(path)) _fileWatcher->removePath(path); _fileWatcher->addPath(path); _fileMap.insert(path,id); } bool GUIClient::removeDocumentWatch(QString path) { bool result; if (_fileWatcher->files().contains(path)) _fileWatcher->removePath(path); _fileMap.remove(path); QFileInfo fi = QFileInfo(path); QFile().remove(path); result = QDir().rmdir(fi.path()); return result; } void GUIClient::handleDocument(QString path) { QByteArray bytarr; QFile sourceFile(path); bool opened = false; QTimer retry(this); retry.setInterval(5000); retry.setSingleShot(true); retry.start(); while (retry.isActive() && !opened) { qApp->processEvents(); // Retry for 5 sec. so OS can finish any housekeeping. // In particular, Microsoft Office deletes and copies // files on every save which can take a bit of time to // complete. opened = sourceFile.open(QIODevice::ReadOnly); } if (!opened) { qWarning("File %s could not be opened. Changes will not be saved to the database.", qPrintable(path)); return; } int id = _fileMap.value(path); bytarr = sourceFile.readAll(); XSqlQuery qry; qry.prepare( "UPDATE url SET url_stream = :stream " "WHERE (url_id = :id);" ); qry.bindValue(":id", id); qry.bindValue(":stream", bytarr); qry.exec(); addDocumentWatch(path, id); } void GUIClient::hunspell_initialize() { _spellReady = false; QString langName = QLocale::languageToString(QLocale().language()); QString appPath = QApplication::applicationDirPath(); QString fullPathWithoutExt = appPath + "/" + langName; QFile affFile(fullPathWithoutExt + tr(".aff")); QFile dicFile(fullPathWithoutExt + tr(".dic")); // If we don't have files for the first name lets try a more common naming convention if(!(affFile.exists() && dicFile.exists())) { langName = QLocale().name().toLower(); // retruns lang_cntry format en_us for example fullPathWithoutExt = appPath + "/" + langName; affFile.setFileName(fullPathWithoutExt + tr(".aff")); dicFile.setFileName(fullPathWithoutExt + tr(".dic")); } if(affFile.exists() && dicFile.exists()) { _spellReady = true; } _spellChecker = new Hunspell(QString(fullPathWithoutExt+tr(".aff")).toLatin1(), QString(fullPathWithoutExt+tr(".dic")).toLatin1()); QString spell_encoding = QString(_spellChecker->get_dic_encoding()); _spellCodec = QTextCodec::codecForName(spell_encoding.toLocal8Bit()); QString homePath = QDir::homePath().toLatin1(); if(_spellReady) { QFile file(homePath + tr("/xTuple/user.dic")); if(file.exists(homePath + tr("/xTuple/user.dic"))) { //open user dictionary if exists _spellChecker->add_dic(QString(homePath + tr("/xTuple/user.dic")).toLatin1()); } } } void GUIClient::hunspell_uninitialize() { delete (Hunspell *)(_spellChecker); QString homePath = QDir::homePath().toLatin1(); QFile file(homePath + tr("/xTuple/user.dic")); if(_spellReady && !_spellAddWords.isEmpty()) { //if user directory missing create it QString homePath = QDir::homePath().toLatin1(); QDir dir(homePath); if(!dir.exists(homePath + tr("/xTuple"))) { dir.mkpath(tr("xTuple")); } //get old words from file if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in(&file); //skip word count line in.readLine(); while (!in.atEnd()) { //add old words to stringlist QString line = in.readLine(); if(!_spellAddWords.contains(line)) _spellAddWords.append(line); } file.close(); } //store new words added and old words if (file.open(QIODevice::WriteOnly | QIODevice::Text)) { QTextStream out(&file); //add word count to file first line out << _spellAddWords.count() << "\n"; //add all new words in sort order _spellAddWords.sort(); foreach(QString word, _spellAddWords) { QByteArray encodedString = _spellCodec->fromUnicode(word); out << encodedString.data() << "\n"; } file.close(); } } } bool GUIClient::hunspell_ready() { return _spellReady; } int GUIClient::hunspell_check(const QString word) { QByteArray encodedString = _spellCodec->fromUnicode(word); return _spellChecker->spell(encodedString.data()); } const QStringList GUIClient::hunspell_suggest(const QString word) { char **wlst; QStringList wordList; QByteArray encodedString = _spellCodec->fromUnicode(word); if(_spellChecker->spell(encodedString.data()) < 1) { int suggestNum = _spellChecker->suggest(&wlst, encodedString.data()); if (suggestNum > 0) { for (int i=0; i < suggestNum; i++) wordList.append(_spellCodec->toUnicode(wlst[i])); } _spellChecker->free_list(&wlst, suggestNum); } return wordList; } int GUIClient::hunspell_add(const QString word) { QByteArray encodedString = _spellCodec->fromUnicode(word); //check if word has been added before if(!_spellAddWords.contains(encodedString.data())) _spellAddWords.append(encodedString.data()); return _spellChecker->add(encodedString.data()); } int GUIClient::hunspell_ignore(const QString word) { QByteArray encodedString = _spellCodec->fromUnicode(word); return _spellChecker->add(encodedString.data()); } void GUIClient::setUpListener(const QString ¬e) { if(QSqlDatabase::database().isOpen()) { QSqlDatabase::database().driver()->subscribeToNotification(note); QObject::connect(QSqlDatabase::database().driver(), SIGNAL(notification(const QString&)), this, SLOT(sEmitNotifyHeard(const QString &))); } } void GUIClient::sEmitNotifyHeard(const QString ¬e) { if(note == "testNote") QMessageBox::information(this, "asdf", "test note received"); else if(note == "messagePosted") emit messageNotify(); } qt-client-4.1.0/guiclient/guiclient.h000066400000000000000000000336461217451700100175450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef GUICLIENT_H #define GUICLIENT_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../common/format.h" #include "../hunspell/hunspell.hxx" class QSplashScreen; class QMdiArea; class QPushButton; class QIntValidator; class QDoubleValidator; class QCheckBox; class QScriptEngine; class menuProducts; class menuInventory; class menuSchedule; class menuPurchase; class menuManufacture; class menuCRM; class menuSales; class menuAccounting; class menuWindow; class menuSystem; class TimeoutHandler; class InputManager; class ReportHandler; class XMainWindow; class QMainWindow; class XWidget; #define cNew 1 #define cEdit 2 #define cView 3 #define cCopy 4 #define cRelease 5 #define cPost 6 #define cReplace 7 #define cPostedCounts 0x01 #define cUnpostedCounts 0x02 #define cAllCounts 0x04 // Possible Location/Itemloc Sources #define cLocation 0x01 #define cItemloc 0x02 // Possible Transactions Groups #define cTransAll 0xFF #define cTransReceipts 0x01 #define cTransIssues 0x02 #define cTransShipments 0x04 #define cTransAdjCounts 0x08 #define cTransTransfers 0x10 #define cTransScraps 0x20 // Possible return values from submitReport #define cNoReportDefinition -2 int systemError(QWidget *, const QString &); int systemError(QWidget *, const QString &, const QString &, const int); void message(const QString &, int = 0); void resetMessage(); void audioAccept(); void audioReject(); QString translationFile(const QString localestr, const QString component); QString translationFile(const QString localestr, const QString component, QString &version); extern bool _evaluation; extern QSplashScreen *_splash; #include "../common/metrics.h" extern Metrics *_metrics; extern Preferences *_preferences; extern Privileges *_privileges; #include "../common/metricsenc.h" extern Metricsenc *_metricsenc; enum SetResponse { NoError, NoError_Cancel, NoError_Run, NoError_Print, NoError_Submit, Error_NoSetup, UndefinedError }; class Action : public QAction { public: Action( QWidget *, const char *, const QString &, QObject *, const char *, QWidget *, bool ); Action( QWidget *, const char *, const QString &, QObject *, const char *, QWidget *, bool, const QPixmap &, QWidget *); Action( QWidget *, const char *, const QString &, QObject *, const char *, QWidget *, bool, const QPixmap &, QWidget *, const QString &); Action( QWidget *, const char *, const QString &, QObject *, const char *, QWidget *, const QString & ); Action( QWidget *, const char *, const QString &, QObject *, const char *, QWidget *, const QString &, const QPixmap &, QWidget *); Action( QWidget *, const char *, const QString &, QObject *, const char *, QWidget *, const QString &, const QPixmap &, QWidget *, const QString &); private: void init( QWidget *, const char *, const QString &, QObject *, const char *, QWidget *, const QString & ); }; class GUIClient : public QMainWindow { friend class XWidget; friend class XMainWindow; friend class XDialog; friend class xTupleGuiClientInterface; Q_OBJECT Q_PROPERTY(QString key READ key) public: enum WindowSystem { Unknown, X11, WIN, MAC, QWS, WINCE, S60 }; enum xtViewMode { FreeFloatingView = -1, // don't conflict with QMdiArea::ViewMode SubWindowView = QMdiArea::SubWindowView, TabbedView = QMdiArea::TabbedView }; GUIClient(const QString &, const QString &); virtual ~GUIClient(); Q_INVOKABLE void setUpListener(const QString &); Q_INVOKABLE void setCaption(); Q_INVOKABLE void saveToolbarPositions(); Q_INVOKABLE inline QMdiArea *workspace() { return _workspace; } Q_INVOKABLE inline InputManager *inputManager() { return _inputManager; } Q_INVOKABLE inline QString databaseURL() { return _databaseURL; } Q_INVOKABLE inline QString username() { return _username; } Q_INVOKABLE inline const QDate startOfTime() { return _startOfTime; } Q_INVOKABLE inline const QDate endOfTime() { return _endOfTime; } Q_INVOKABLE inline const QDate dbDate() { return _dbDate; } Q_INVOKABLE inline QDoubleValidator *qtyVal() { return _qtyVal; } Q_INVOKABLE inline QDoubleValidator *transQtyVal() { return _transQtyVal; } Q_INVOKABLE inline QDoubleValidator *qtyPerVal() { return _qtyPerVal; } Q_INVOKABLE inline QDoubleValidator *scrapVal() { return _scrapVal; } Q_INVOKABLE inline QDoubleValidator *percentVal() { return _percentVal; } Q_INVOKABLE inline QDoubleValidator *negPercentVal() { return _negPercentVal; } Q_INVOKABLE inline QDoubleValidator *moneyVal() { return _moneyVal; } Q_INVOKABLE inline QDoubleValidator *negMoneyVal() { return _negMoneyVal; } Q_INVOKABLE inline QDoubleValidator *priceVal() { return _priceVal; } Q_INVOKABLE inline QDoubleValidator *costVal() { return _costVal; } Q_INVOKABLE inline QDoubleValidator *ratioVal() { return _ratioVal; } Q_INVOKABLE inline QDoubleValidator *weightVal() { return _weightVal; } Q_INVOKABLE inline QDoubleValidator *runTimeVal() { return _runTimeVal; } Q_INVOKABLE inline QIntValidator *orderVal() { return _orderVal; } Q_INVOKABLE inline QIntValidator *dayVal() { return _dayVal; } Q_INVOKABLE inline QFont systemFont() { return *_systemFont; } Q_INVOKABLE inline QFont fixedFont() { return *_fixedFont; } Q_INVOKABLE GUIClient::WindowSystem getWindowSystem(); Q_INVOKABLE bool singleCurrency(); Q_INVOKABLE bool showTopLevel() const { return _showTopLevel; } Q_INVOKABLE xtViewMode viewMode() const; Q_INVOKABLE QWidgetList windowList(); Q_INVOKABLE void populateCustomMenu(QMenu*, const QString &); Q_INVOKABLE void handleNewWindow(QWidget *, Qt::WindowModality = Qt::NonModal, bool forceFloat = false); Q_INVOKABLE bool saveWidgetSizePos(QWidget *pWidget); Q_INVOKABLE bool restoreWidgetSizePos(QWidget *pWidget, bool forceFloat = false); Q_INVOKABLE QMenuBar *menuBar(); // Used by scripting Q_INVOKABLE void addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget ); Q_INVOKABLE void addToolBar ( QToolBar * toolbar ); Q_INVOKABLE void addToolBar ( Qt::ToolBarArea area, QToolBar * toolbar ); Q_INVOKABLE void addToolBarBreak ( Qt::ToolBarArea area = Qt::TopToolBarArea ); Q_INVOKABLE void tabifyDockWidget ( QDockWidget * first, QDockWidget * second ); Q_INVOKABLE void setCentralWidget(QWidget * widget); TimeoutHandler *_timeoutHandler; ReportHandler *_reportHandler; QMap _customCommands; QString _key; Q_INVOKABLE QString key() { return _key; } QString _singleWindow; Q_INVOKABLE void launchBrowser(QWidget*, const QString &); Q_INVOKABLE inline bool shuttingDown() { return _shuttingDown; } void loadScriptGlobals(QScriptEngine * engine); //check hunspell is ready Q_INVOKABLE bool hunspell_ready(); //spellcheck word, returns 1 if word ok otherwise 0 Q_INVOKABLE int hunspell_check(const QString word); //suggest words for word, returns number of words in slst Q_INVOKABLE const QStringList hunspell_suggest(const QString word); //add word to dict (word is valid until spell object is not destroyed) Q_INVOKABLE int hunspell_add(const QString word); //add word to dict (word is valid until spell object is not destroyed) Q_INVOKABLE int hunspell_ignore(const QString word); public slots: void sReportError(const QString &); void sTick(); void sAssortmentsUpdated(int, bool); void sBBOMsUpdated(int, bool); void sBOMsUpdated(int, bool); void sBOOsUpdated(int, bool); void sBankAccountsUpdated(); void sBankAdjustmentsUpdated(int, bool); void sBillingSelectionUpdated(int, int); void sBudgetsUpdated(int, bool); void sCashReceiptsUpdated(int, bool); void sChecksUpdated(int, int, bool); void sConfigureGLUpdated(); void sCreditMemosUpdated(); void sCrmAccountsUpdated(int); void sCustomCommand(); void sCustomersUpdated(int, bool); void sEmitNotifyHeard(const QString ¬e); void sEmployeeUpdated(int); void sGlSeriesUpdated(); void initMenuBar(); void sInvoicesUpdated(int, bool); void sItemGroupsUpdated(int, bool); void sItemsUpdated(int, bool); void sItemsitesUpdated(); void sPaymentsUpdated(int, int, bool); void sProjectsUpdated(int); void sProspectsUpdated(); void sPurchaseOrderReceiptsUpdated(); void sPurchaseOrdersUpdated(int, bool); void sPurchaseRequestsUpdated(); void sQOHChanged(int, bool); void sQuotesUpdated(int); void sReportsChanged(int, bool); void sReturnAuthorizationsUpdated(); void sSalesOrdersUpdated(int); void sSalesRepUpdated(int); void sStandardPeriodsUpdated(); void sSystemMessageAdded(); void sTaxAuthsUpdated(int); void sTransferOrdersUpdated(int); void sUserUpdated(QString); void sVendorsUpdated(); void sVouchersUpdated(); void sWarehousesUpdated(); void sWorkCentersUpdated(); void sWorkOrderMaterialsUpdated(int, int, bool); void sWorkOrderOperationsUpdated(int, int, bool); void sWorkOrdersUpdated(int, bool); void sIdleTimeout(); void sClearErrorMessages(); void sNewErrorMessage(); void setWindowTitle(); signals: void tick(); void messageNotify(); void assortmentsUpdated(int, bool); void bankAccountsUpdated(); void bankAdjustmentsUpdated(int, bool); void bbomsUpdated(int, bool); void billingSelectionUpdated(int, int); void bomsUpdated(int, bool); void boosUpdated(int, bool); void budgetsUpdated(int, bool); void cashReceiptsUpdated(int, bool); void checksUpdated(int, int, bool); void configureGLUpdated(); void creditMemosUpdated(); void crmAccountsUpdated(int); void customersUpdated(int, bool); void employeeUpdated(int); void glSeriesUpdated(); void invoicesUpdated(int, bool); void itemGroupsUpdated(int, bool); void itemsUpdated(int, bool); void itemsitesUpdated(); void paymentsUpdated(int, int, bool); void projectsUpdated(int); void prospectsUpdated(); void purchaseOrderReceiptsUpdated(); void purchaseOrdersUpdated(int, bool); void purchaseRequestsUpdated(); void qohChanged(int, bool); void quotesUpdated(int, bool); void reportsChanged(int, bool); void returnAuthorizationsUpdated(); void salesOrdersUpdated(int, bool); void salesRepUpdated(int); void standardPeriodsUpdated(); void systemMessageAdded(); void taxAuthsUpdated(int); void transferOrdersUpdated(int); void userUpdated(QString); void vendorsUpdated(); void vouchersUpdated(); void warehousesUpdated(); void workCentersUpdated(); void workOrderMaterialsUpdated(int, int, bool); void workOrderOperationsUpdated(int, int, bool); void workOrdersUpdated(int, bool); protected: void closeEvent(QCloseEvent *); void showEvent(QShowEvent *); void addDocumentWatch(QString path, int id); bool removeDocumentWatch(QString path); protected slots: void windowDestroyed(QObject*); private slots: void handleDocument(QString path); void hunspell_initialize(); void hunspell_uninitialize(); private: QMdiArea *_workspace; QTimer _tick; QPushButton *_eventButton; QPushButton *_registerButton; QPushButton *_errorButton; QString _databaseURL; QString _username; bool _showTopLevel; QWidgetList _windowList; QMenuBar *_menuBar; InputManager *_inputManager; menuProducts *productsMenu; menuInventory *inventoryMenu; menuSchedule *scheduleMenu; menuPurchase *purchaseMenu; menuManufacture *manufactureMenu; menuCRM *crmMenu; menuSales *salesMenu; menuAccounting *accountingMenu; menuWindow *windowMenu; menuSystem *systemMenu; QDate _startOfTime; QDate _endOfTime; QDate _dbDate; QDoubleValidator *_qtyVal; QDoubleValidator *_transQtyVal; QDoubleValidator *_qtyPerVal; QDoubleValidator *_scrapVal; QDoubleValidator *_percentVal; QDoubleValidator *_negPercentVal; QDoubleValidator *_moneyVal; QDoubleValidator *_negMoneyVal; QDoubleValidator *_priceVal; QDoubleValidator *_costVal; QDoubleValidator *_ratioVal; QDoubleValidator *_weightVal; QDoubleValidator *_runTimeVal; QIntValidator *_orderVal; QIntValidator *_dayVal; QFont *_systemFont; QFont *_fixedFont; bool _shown; bool _shuttingDown; QFileSystemWatcher* _fileWatcher; QMap _fileMap; QTextCodec * _spellCodec; Hunspell * _spellChecker; bool _spellReady; QStringList _spellAddWords; }; extern GUIClient *omfgThis; #endif qt-client-4.1.0/guiclient/guiclient.pro000066400000000000000000002450371217451700100201150ustar00rootroot00000000000000include( ../global.pri ) TARGET = xtuple CONFIG += qt warn_on uitools designer help TEMPLATE = app INCLUDEPATH += ../scriptapi \ ../common \ ../widgets ../widgets/tmp/lib \ ../../xtuple-build-desktop/scriptapi \ ../../xtuple-build-desktop/common \ ../../xtuple-build-desktop/widgets \ ../../xtuple-build-desktop/widgets/tmp/lib \ ../../xtuple-build-desktop/guiclient . DEPENDPATH += $${INCLUDEPATH} win32-msvc* { PRE_TARGETDEPS += ../lib/xtuplecommon.lib \ ../lib/xtuplescriptapi.lib \ ../lib/xtuplewidgets.lib } else { PRE_TARGETDEPS += ../lib/libxtuplecommon.a \ ../lib/libxtuplescriptapi.a \ ../lib/libxtuplewidgets.a \ ../$${OPENRPT_BLD}/lib/libMetaSQL.a \ ../$${OPENRPT_BLD}/lib/librenderer.a \ ../$${OPENRPT_BLD}/lib/libwrtembed.a \ ../$${OPENRPT_BLD}/lib/libDmtx_Library.a \ ../$${OPENRPT_BLD}/lib/libcommon.a } LIBS += -L../lib -L../$${OPENRPT_BLD}/lib \ -lxtuplecommon -lxtuplewidgets -lwrtembed -lcommon -lrenderer \ -lxtuplescriptapi -lDmtx_Library -lMetaSQL #not the best way to handle this, but it should do mac:!static:contains(QT_CONFIG, qt_framework) { LIBS += -framework QtDesignerComponents } else { LIBS += -lQtDesignerComponents } win32 { win32-msvc*:LIBS += -lshell32 RC_FILE = rcguiclient.rc OBJECTS_DIR = win_obj } win32-g++-4.6 { LIBS += -lz } unix { OBJECTS_DIR = unx_obj LIBS += -lz } macx { RC_FILE = images/icons.icns #PRECOMPILED_HEADER = stable.h OBJECTS_DIR = osx_obj QMAKE_INFO_PLIST = Info.plist LIBS += -lz } DESTDIR = ../bin MOC_DIR = moc UI_DIR = ui FORMS = absoluteCalendarItem.ui \ accountNumber.ui \ accountNumbers.ui \ accountingPeriod.ui \ accountingPeriods.ui \ accountingYearPeriod.ui \ accountingYearPeriods.ui \ addPoComment.ui \ address.ui \ addresses.ui \ adjustmentTrans.ui \ adjustInvValue.ui \ allocateARCreditMemo.ui \ allocateReservations.ui \ apAccountAssignment.ui \ apAccountAssignments.ui \ apCreditMemoApplication.ui \ apOpenItem.ui \ apWorkBench.ui \ applyAPCreditMemo.ui \ applyARCreditMemo.ui \ applyARDiscount.ui \ applyDiscount.ui \ arAccountAssignment.ui \ arAccountAssignments.ui \ arCreditMemoApplication.ui \ arOpenItem.ui \ arWorkBench.ui \ archRestoreSalesHistory.ui \ assignClassCodeToPlannerCode.ui \ assignItemToPlannerCode.ui \ assignLotSerial.ui \ atlasMap.ui \ bankAccount.ui \ bankAccounts.ui \ bankAdjustment.ui \ bankAdjustmentEditList.ui \ bankAdjustmentType.ui \ bankAdjustmentTypes.ui \ bom.ui \ bomItem.ui \ bomList.ui \ budgets.ui \ buyCard.ui \ calendar.ui \ calendars.ui \ cashReceipt.ui \ cashReceiptItem.ui \ cashReceiptMiscDistrib.ui \ cashReceiptsEditList.ui \ changePoitemQty.ui \ changeWoQty.ui \ characteristic.ui \ characteristicAssignment.ui \ characteristicPrice.ui \ characteristics.ui \ check.ui \ checkFormat.ui \ checkFormats.ui \ classCode.ui \ classCodes.ui \ closePurchaseOrder.ui \ closeWo.ui \ commentType.ui \ commentTypes.ui \ companies.ui \ company.ui \ configauthorizedotnetprocessor.ui \ configcybersourceprocessor.ui \ configureCC.ui \ configureCRM.ui \ configureEncryption.ui \ configureGL.ui \ configureIE.ui \ configureIM.ui \ configureMS.ui \ configurePD.ui \ configurePO.ui \ configureSearchPath.ui \ configureSO.ui \ configureWO.ui \ confirmAchOK.ui \ contact.ui \ contacts.ui \ contactMerge.ui \ contract.ui \ copyBOM.ui \ copyBudget.ui \ copyContract.ui \ copyItem.ui \ copyPurchaseOrder.ui \ copySalesOrder.ui \ copyTransferOrder.ui \ correctProductionPosting.ui \ costCategories.ui \ costCategory.ui \ costingElements.ui \ countSlip.ui \ countTag.ui \ countTagList.ui \ countries.ui \ country.ui \ createCountTagsByItem.ui \ createCountTagsByParameterList.ui \ createCycleCountTags.ui \ createInvoices.ui \ createItemSitesByClassCode.ui \ createLotSerial.ui \ createPlannedOrdersByItem.ui \ createPlannedOrdersByPlannerCode.ui \ createRecurringInvoices.ui \ createRecurringItems.ui \ creditCard.ui \ creditMemo.ui \ creditMemoEditList.ui \ creditMemoItem.ui \ crmaccount.ui \ crmaccountMerge.ui \ crmaccountMergePickAccountsPage.ui \ crmaccountMergePickDataPage.ui \ crmaccountMergePickTaskPage.ui \ crmaccountMergePurgePage.ui \ crmaccountMergeResultPage.ui \ currencies.ui \ currency.ui \ currencyConversion.ui \ currencyConversions.ui \ currencySelect.ui \ customCommand.ui \ customCommandArgument.ui \ customCommands.ui \ customer.ui \ customerFormAssignment.ui \ customerFormAssignments.ui \ customerGroup.ui \ customerGroups.ui \ customerType.ui \ customerTypeList.ui \ customerTypes.ui \ databaseInformation.ui \ deletePlannedOrder.ui \ deletePlannedOrdersByPlannerCode.ui \ department.ui \ departments.ui \ dictionaries.ui \ display.ui \ displayTimePhased.ui \ distributeInventory.ui \ distributeToLocation.ui \ dspAROpenItems.ui \ dspBankrecHistory.ui \ dspBillingSelections.ui \ dspCashReceipts.ui \ dspCheckRegister.ui \ dspCountSlipEditList.ui \ dspCountTagEditList.ui \ dspCreditCardTransactions.ui \ dspFinancialReport.ui \ dspInvoiceInformation.ui \ dspMRPDetail.ui \ dspTaxHistory.ui \ duplicateAccountNumbers.ui \ editOwners.ui \ empGroup.ui \ empGroups.ui \ employee.ui \ enterMiscCount.ui \ enterPoReceipt.ui \ enterPoReturn.ui \ enterPoitemReceipt.ui \ enterPoitemReturn.ui \ errorLog.ui \ eventManager.ui \ expenseCategories.ui \ expenseCategory.ui \ expenseTrans.ui \ explodeWo.ui \ exportData.ui \ externalCCTransaction.ui \ externalShipping.ui \ externalShippingList.ui \ failedPostList.ui \ financialLayout.ui \ financialLayoutColumns.ui \ financialLayoutGroup.ui \ financialLayoutItem.ui \ financialLayoutSpecial.ui \ financialLayouts.ui \ financialReportNotes.ui \ firmPlannedOrder.ui \ firmPlannedOrdersByPlannerCode.ui \ fixACL.ui \ fixSerial.ui \ form.ui \ forms.ui \ forwardUpdateAccounts.ui \ freightBreakdown.ui \ freightClass.ui \ freightClasses.ui \ getGLDistDate.ui \ getLotInfo.ui \ glSeries.ui \ glSeriesItem.ui \ glTransaction.ui \ glTransactionDetail.ui \ group.ui \ groups.ui \ helpDownload.ui \ honorific.ui \ honorifics.ui \ hotkey.ui \ hotkeys.ui \ idleShutdown.ui \ image.ui \ imageList.ui \ images.ui \ implodeWo.ui \ importData.ui \ incident.ui \ incidentCategories.ui \ incidentCategory.ui \ incidentPriorities.ui \ incidentPriority.ui \ incidentResolution.ui \ incidentResolutions.ui \ incidentSeverities.ui \ incidentSeverity.ui \ invoice.ui \ invoiceItem.ui \ invoiceList.ui \ issueLineToShipping.ui \ issueToShipping.ui \ issueWoMaterialBatch.ui \ issueWoMaterialItem.ui \ item.ui \ itemAlias.ui \ itemAvailabilityWorkbench.ui \ itemCost.ui \ itemGroup.ui \ itemGroups.ui \ itemImages.ui \ itemListPrice.ui \ itemPricingSchedule.ui \ itemPricingScheduleItem.ui \ itemPricingSchedules.ui \ itemSite.ui \ itemSites.ui \ itemSource.ui \ itemSourceList.ui \ itemSourcePrice.ui \ itemSourceSearch.ui \ itemSubstitute.ui \ itemUOM.ui \ items.ui \ itemtax.ui \ labelForm.ui \ labelForms.ui \ listRecurringInvoices.ui \ locales.ui \ location.ui \ locations.ui \ lotSerial.ui \ lotSerialSequence.ui \ lotSerialSequences.ui \ lotSerialRegistration.ui \ maintainBudget.ui \ maintainItemCosts.ui \ maintainShipping.ui \ massExpireComponent.ui \ massReplaceComponent.ui \ materialReceiptTrans.ui \ metasqls.ui \ miscCheck.ui \ miscVoucher.ui \ openPurchaseOrder.ui \ openReturnAuthorizations.ui \ openSalesOrders.ui \ openVouchers.ui \ opportunity.ui \ opportunityList.ui \ opportunitySource.ui \ opportunitySources.ui \ opportunityStage.ui \ opportunityStages.ui \ opportunityType.ui \ opportunityTypes.ui \ package.ui \ packages.ui \ packingListBatch.ui \ plannedOrder.ui \ plannerCode.ui \ plannerCodes.ui \ poLiabilityDistrib.ui \ postCashReceipts.ui \ postCheck.ui \ postChecks.ui \ postCostsByClassCode.ui \ postCostsByItem.ui \ postCountSlips.ui \ postCountTags.ui \ postCreditMemos.ui \ postInvoices.ui \ postJournals.ui \ postMiscProduction.ui \ postPoReturnCreditMemo.ui \ postProduction.ui \ postPurchaseOrder.ui \ postPurchaseOrdersByAgent.ui \ postStandardJournal.ui \ postStandardJournalGroup.ui \ postVouchers.ui \ prepareCheckRun.ui \ priceList.ui \ pricingScheduleAssignment.ui \ pricingScheduleAssignments.ui \ printArOpenItem.ui \ printCheck.ui \ printChecks.ui \ printChecksReview.ui \ printCreditMemo.ui \ printCreditMemos.ui \ printInvoice.ui \ printInvoices.ui \ printItemLabelsByClassCode.ui \ printLabelsByInvoice.ui \ printLabelsByOrder.ui \ printLabelsBySo.ui \ printLabelsByTo.ui \ printMulticopyDocument.ui \ printOptions.ui \ printPackingList.ui \ printPackingListBatchByShipvia.ui \ printPoForm.ui \ printPurchaseOrder.ui \ printPurchaseOrdersByAgent.ui \ printQuote.ui \ printRaForm.ui \ printShippingForm.ui \ printShippingForms.ui \ printSinglecopyDocument.ui \ printSoForm.ui \ printStatementByCustomer.ui \ printStatementsByCustomerType.ui \ printVendorForm.ui \ printWoForm.ui \ printWoPickList.ui \ printWoTraveler.ui \ productCategories.ui \ productCategory.ui \ profitCenter.ui \ profitCenters.ui \ project.ui \ projects.ui \ prospect.ui \ purchaseOrder.ui \ purchaseOrderItem.ui \ purchaseRequest.ui \ purgeClosedWorkOrders.ui \ purgeCreditMemos.ui \ purgeInvoices.ui \ purgePostedCountSlips.ui \ purgePostedCounts.ui \ quotes.ui \ reasonCode.ui \ reasonCodes.ui \ reassignClassCodeByClassCode.ui \ reassignCustomerTypeByCustomerType.ui \ reassignLotSerial.ui \ reassignProductCategoryByProductCategory.ui \ recallOrders.ui \ reconcileBankaccount.ui \ registrationKey.ui \ registrationKeyDialog.ui \ rejectCode.ui \ rejectCodes.ui \ relativeCalendarItem.ui \ releasePlannedOrdersByPlannerCode.ui \ releaseTransferOrdersByAgent.ui \ releaseWorkOrdersByPlannerCode.ui \ relocateInventory.ui \ reports.ui \ reprintCreditMemos.ui \ reprintInvoices.ui \ reprintMulticopyDocument.ui \ reprioritizeWo.ui \ reschedulePoitem.ui \ rescheduleWo.ui \ reserveSalesOrderItem.ui \ resetQOHBalances.ui \ returnAuthCheck.ui \ returnAuthItemLotSerial.ui \ returnAuthorization.ui \ returnAuthorizationItem.ui \ returnAuthorizationWorkbench.ui \ returnWoMaterialBatch.ui \ returnWoMaterialItem.ui \ reverseGLSeries.ui \ sale.ui \ sales.ui \ salesAccount.ui \ salesAccounts.ui \ salesCategories.ui \ salesCategory.ui \ salesHistoryInformation.ui \ salesOrder.ui \ salesOrderInformation.ui \ salesOrderItem.ui \ salesRep.ui \ salesReps.ui \ saleType.ui \ saleTypes.ui \ scrapTrans.ui \ scrapWoMaterialFromWIP.ui \ scriptEditor.ui \ scripts.ui \ searchForEmp.ui \ selectBankAccount.ui \ selectBillingQty.ui \ selectOrderForBilling.ui \ selectPayment.ui \ selectPayments.ui \ selectShippedOrders.ui \ selectedPayments.ui \ setup.ui \ shipOrder.ui \ shipTo.ui \ shipVia.ui \ shipVias.ui \ shippingChargeType.ui \ shippingChargeTypes.ui \ shippingForm.ui \ shippingForms.ui \ shippingInformation.ui \ shippingZone.ui \ shippingZones.ui \ siteType.ui \ siteTypes.ui \ splitReceipt.ui \ standardJournal.ui \ standardJournalGroup.ui \ standardJournalGroupItem.ui \ standardJournalGroups.ui \ standardJournalItem.ui \ standardJournals.ui \ state.ui \ states.ui \ subAccntType.ui \ subAccntTypes.ui \ subaccount.ui \ subaccounts.ui \ submitAction.ui \ submitReport.ui \ substituteList.ui \ summarizeInvTransByClassCode.ui \ syncCompanies.ui \ sysLocale.ui \ systemMessage.ui \ task.ui \ taxAdjustment.ui \ taxAssignment.ui \ taxAssignments.ui \ taxAuthority.ui \ taxBreakdown.ui \ taxClass.ui \ taxClasses.ui \ taxCode.ui \ taxCodeRate.ui \ taxCodes.ui \ taxDetail.ui \ taxRegistration.ui \ taxRegistrations.ui \ taxType.ui \ taxTypes.ui \ taxZone.ui \ taxZones.ui \ terms.ui \ termses.ui \ thawItemSitesByClassCode.ui \ todoItem.ui \ todoList.ui \ todoListCalendar.ui \ transactionInformation.ui \ transferOrder.ui \ transferOrderItem.ui \ transferOrders.ui \ transferTrans.ui \ transformTrans.ui \ translations.ui \ uiform.ui \ uiforms.ui \ unappliedAPCreditMemos.ui \ unappliedARCreditMemos.ui \ uninvoicedShipments.ui \ unpostedCreditMemos.ui \ unpostedGLTransactions.ui \ unpostedGlSeries.ui \ unpostedInvoices.ui \ unpostedPoReceipts.ui \ unpostedPurchaseOrders.ui \ uom.ui \ uomConv.ui \ uoms.ui \ updateABCClass.ui \ updateActualCostsByClassCode.ui \ updateActualCostsByItem.ui \ updateCreditStatusByCustomer.ui \ updateCycleCountFrequency.ui \ updateItemSiteLeadTimes.ui \ updateLateCustCreditStatus.ui \ updateListPricesByProductCategory.ui \ updateOUTLevelByItem.ui \ updateOUTLevels.ui \ updateOUTLevelsByClassCode.ui \ updatePrices.ui \ updateReorderLevels.ui \ user.ui \ userCostingElement.ui \ userList.ui \ userPreferences.ui \ users.ui \ vendor.ui \ vendorAddress.ui \ vendorAddressList.ui \ vendorPriceList.ui \ vendorType.ui \ vendorTypes.ui \ vendorWorkBench.ui \ viewCheckRun.ui \ voidChecks.ui \ voucher.ui \ voucherItem.ui \ voucherItemDistrib.ui \ voucherMiscDistrib.ui \ warehouse.ui \ warehouseZone.ui \ warehouses.ui \ welcomeStub.ui \ woMaterialItem.ui \ workOrder.ui \ workOrderMaterials.ui \ xdateinputdialog.ui \ xsltMap.ui \ zeroUncountedCountTagsByWarehouse.ui \ HEADERS = ../common/format.h \ SaveSizePositionEventFilter.h \ absoluteCalendarItem.h \ accountNumber.h \ accountNumbers.h \ accountingPeriod.h \ accountingPeriods.h \ accountingYearPeriod.h \ accountingYearPeriods.h \ addPoComment.h \ address.h \ addresses.h \ adjustmentTrans.h \ adjustInvValue.h \ allocateARCreditMemo.h \ allocateReservations.h \ apAccountAssignment.h \ apAccountAssignments.h \ apCreditMemoApplication.h \ apOpenItem.h \ apWorkBench.h \ applyAPCreditMemo.h \ applyARCreditMemo.h \ applyARDiscount.h \ applyDiscount.h \ arAccountAssignment.h \ arAccountAssignments.h \ arCreditMemoApplication.h \ arOpenItem.h \ arWorkBench.h \ archRestoreSalesHistory.h \ assignClassCodeToPlannerCode.h \ assignItemToPlannerCode.h \ assignLotSerial.h \ atlasMap.h \ authorizedotnetprocessor.h \ bankAccount.h \ bankAccounts.h \ bankAdjustment.h \ bankAdjustmentEditList.h \ bankAdjustmentType.h \ bankAdjustmentTypes.h \ bom.h \ bomItem.h \ bomList.h \ budgets.h \ buyCard.h \ calendar.h \ calendars.h \ cashReceipt.h \ cashReceiptItem.h \ cashReceiptMiscDistrib.h \ cashReceiptsEditList.h \ changePoitemQty.h \ changeWoQty.h \ characteristic.h \ characteristicAssignment.h \ characteristicPrice.h \ characteristics.h \ check.h \ checkFormat.h \ checkFormats.h \ classCode.h \ classCodes.h \ closePurchaseOrder.h \ closeWo.h \ commentType.h \ commentTypes.h \ companies.h \ company.h \ configauthorizedotnetprocessor.h \ configcreditcardprocessor.h \ configcybersourceprocessor.h \ configureCC.h \ configureCRM.h \ configureEncryption.h \ configureGL.h \ configureIE.h \ configureIM.h \ configureMS.h \ configurePD.h \ configurePO.h \ configureSearchPath.h \ configureSO.h \ configureWO.h \ confirmAchOK.h \ contact.h \ contacts.h \ contactMerge.h \ contract.h \ contracts.h \ copyBOM.h \ copyBudget.h \ copyContract.h \ copyItem.h \ copyPurchaseOrder.h \ copySalesOrder.h \ copyTransferOrder.h \ correctProductionPosting.h \ costCategories.h \ costCategory.h \ costingElements.h \ countSlip.h \ countTag.h \ countTagList.h \ countries.h \ country.h \ createCountTagsByItem.h \ createCountTagsByParameterList.h \ createCycleCountTags.h \ createInvoices.h \ createItemSitesByClassCode.h \ createLotSerial.h \ createPlannedOrdersByItem.h \ createPlannedOrdersByPlannerCode.h \ createRecurringInvoices.h \ createRecurringItems.h \ creditCard.h \ creditMemo.h \ creditMemoEditList.h \ creditMemoItem.h \ creditcardprocessor.h \ crmaccount.h \ crmaccountMerge.h \ crmaccountMergePickAccountsPage.h \ crmaccountMergePickDataPage.h \ crmaccountMergePickTaskPage.h \ crmaccountMergePurgePage.h \ crmaccountMergeResultPage.h \ crmaccounts.h \ currencies.h \ currenciesDialog.h \ currency.h \ currencyConversion.h \ currencyConversions.h \ currencySelect.h \ custCharacteristicDelegate.h \ customCommand.h \ customCommandArgument.h \ customCommands.h \ customer.h \ customerFormAssignment.h \ customerFormAssignments.h \ customerGroup.h \ customerGroups.h \ customerType.h \ customerTypeList.h \ customerTypes.h \ customers.h \ cybersourceprocessor.h \ databaseInformation.h \ deletePlannedOrder.h \ deletePlannedOrdersByPlannerCode.h \ department.h \ departments.h \ dictionaries.h \ display.h \ displayTimePhased.h \ distributeInventory.h \ distributeToLocation.h \ dspAROpenItems.h \ dspBankrecHistory.h \ dspBillingSelections.h \ dspCashReceipts.h \ dspCheckRegister.h \ dspCountSlipEditList.h \ dspCountTagEditList.h \ dspCreditCardTransactions.h \ dspFinancialReport.h \ dspInvoiceInformation.h \ dspMRPDetail.h \ dspTaxHistory.h \ duplicateAccountNumbers.h \ editOwners.h \ empGroup.h \ empGroups.h \ employee.h \ employees.h \ enterMiscCount.h \ enterPoReceipt.h \ enterPoReturn.h \ enterPoitemReceipt.h \ enterPoitemReturn.h \ errorLog.h \ eventManager.h \ expenseCategories.h \ expenseCategory.h \ expenseTrans.h \ explodeWo.h \ exportData.h \ externalCCTransaction.h \ externalShipping.h \ externalShippingList.h \ externalccprocessor.h \ failedPostList.h \ financialLayout.h \ financialLayoutColumns.h \ financialLayoutGroup.h \ financialLayoutItem.h \ financialLayoutSpecial.h \ financialLayouts.h \ financialReportNotes.h \ firmPlannedOrder.h \ firmPlannedOrdersByPlannerCode.h \ fixACL.h \ fixSerial.h \ form.h \ forms.h \ forwardUpdateAccounts.h \ freightBreakdown.h \ freightClass.h \ freightClasses.h \ getGLDistDate.h \ getLotInfo.h \ getscreen.h \ getscreen_classlist.h \ getscreen_headerlist.h \ glSeries.h \ glSeriesItem.h \ glTransaction.h \ glTransactionDetail.h \ group.h \ groups.h \ guiErrorCheck.h \ guiclient.h \ helpDownload.h \ helpView.h \ helpViewBrowser.h \ honorific.h \ honorifics.h \ hotkey.h \ hotkeys.h \ idleShutdown.h \ image.h \ imageList.h \ images.h \ implodeWo.h \ importData.h \ incident.h \ incidentCategories.h \ incidentCategory.h \ incidentPriorities.h \ incidentPriority.h \ incidentResolution.h \ incidentResolutions.h \ incidentSeverities.h \ incidentSeverity.h \ incidentWorkbench.h \ inputManager.h \ invoice.h \ invoiceItem.h \ invoiceList.h \ issueLineToShipping.h \ issueToShipping.h \ issueWoMaterialBatch.h \ issueWoMaterialItem.h \ item.h \ itemAlias.h \ itemAvailabilityWorkbench.h \ itemCharacteristicDelegate.h \ itemCost.h \ itemGroup.h \ itemGroups.h \ itemImages.h \ itemListPrice.h \ itemPricingSchedule.h \ itemPricingScheduleItem.h \ itemPricingSchedules.h \ itemSite.h \ itemSites.h \ itemSource.h \ itemSourceList.h \ itemSourcePrice.h \ itemSourceSearch.h \ itemSources.h \ itemSubstitute.h \ itemUOM.h \ items.h \ itemtax.h \ jsHighlighter.h \ labelForm.h \ labelForms.h \ listRecurringInvoices.h \ locales.h \ location.h \ locations.h \ lotSerial.h \ lotSerialSequence.h \ lotSerialSequences.h \ lotSerialRegistration.h \ maintainBudget.h \ maintainItemCosts.h \ maintainShipping.h \ massExpireComponent.h \ massReplaceComponent.h \ materialReceiptTrans.h \ metasqls.h \ menuAccounting.h \ menuCRM.h \ menuInventory.h \ menuManufacture.h \ menuProducts.h \ menuPurchase.h \ menuSales.h \ menuSchedule.h \ menuSystem.h \ menuWindow.h \ miscCheck.h \ miscVoucher.h \ openPurchaseOrder.h \ openReturnAuthorizations.h \ openSalesOrders.h \ openVouchers.h \ opportunity.h \ opportunityList.h \ opportunitySource.h \ opportunitySources.h \ opportunityStage.h \ opportunityStages.h \ opportunityType.h \ opportunityTypes.h \ package.h \ packages.h \ packingListBatch.h \ paymentechprocessor.h \ plannedOrder.h \ plannerCode.h \ plannerCodes.h \ poLiabilityDistrib.h \ poitemTableModel.h \ poitemTableView.h \ postCashReceipts.h \ postCheck.h \ postChecks.h \ postCostsByClassCode.h \ postCostsByItem.h \ postCountSlips.h \ postCountTags.h \ postCreditMemos.h \ postInvoices.h \ postJournals.h \ postMiscProduction.h \ postPoReturnCreditMemo.h \ postProduction.h \ postPurchaseOrder.h \ postPurchaseOrdersByAgent.h \ postStandardJournal.h \ postStandardJournalGroup.h \ postVouchers.h \ prepareCheckRun.h \ priceList.h \ pricingScheduleAssignment.h \ pricingScheduleAssignments.h \ printArOpenItem.h \ printCheck.h \ printChecks.h \ printChecksReview.h \ printCreditMemo.h \ printCreditMemos.h \ printInvoice.h \ printInvoices.h \ printItemLabelsByClassCode.h \ printLabelsByInvoice.h \ printLabelsByOrder.h \ printLabelsBySo.h \ printLabelsByTo.h \ printOptions.h \ printMulticopyDocument.h \ printPackingList.h \ printPackingListBatchByShipvia.h \ printPoForm.h \ printPurchaseOrder.h \ printPurchaseOrdersByAgent.h \ printQuote.h \ printRaForm.h \ printShippingForm.h \ printShippingForms.h \ printSinglecopyDocument.h \ printSoForm.h \ printStatementByCustomer.h \ printStatementsByCustomerType.h \ printVendorForm.h \ printWoForm.h \ printWoPickList.h \ printWoTraveler.h \ productCategories.h \ productCategory.h \ profitCenter.h \ profitCenters.h \ project.h \ projects.h \ prospect.h \ prospects.h \ purchaseOrder.h \ purchaseOrderItem.h \ purchaseRequest.h \ purgeClosedWorkOrders.h \ purgeCreditMemos.h \ purgeInvoices.h \ purgePostedCountSlips.h \ purgePostedCounts.h \ quotes.h \ reasonCode.h \ reasonCodes.h \ reassignClassCodeByClassCode.h \ reassignCustomerTypeByCustomerType.h \ reassignLotSerial.h \ reassignProductCategoryByProductCategory.h \ recallOrders.h \ reconcileBankaccount.h \ registrationKey.h \ registrationKeyDialog.h \ rejectCode.h \ rejectCodes.h \ relativeCalendarItem.h \ releasePlannedOrdersByPlannerCode.h \ releaseTransferOrdersByAgent.h \ releaseWorkOrdersByPlannerCode.h \ relocateInventory.h \ reports.h \ reprintCreditMemos.h \ reprintInvoices.h \ reprintMulticopyDocument.h \ reprioritizeWo.h \ reschedulePoitem.h \ rescheduleWo.h \ reserveSalesOrderItem.h \ resetQOHBalances.h \ returnAuthCheck.h \ returnAuthItemLotSerial.h \ returnAuthorization.h \ returnAuthorizationItem.h \ returnAuthorizationWorkbench.h \ returnWoMaterialBatch.h \ returnWoMaterialItem.h \ reverseGLSeries.h \ sale.h \ sales.h \ salesAccount.h \ salesAccounts.h \ salesCategories.h \ salesCategory.h \ salesHistoryInformation.h \ salesOrder.h \ salesOrderInformation.h \ salesOrderItem.h \ salesRep.h \ salesReps.h \ saleType.h \ saleTypes.h \ scrapTrans.h \ scrapWoMaterialFromWIP.h \ scriptablePrivate.h \ scriptEditor.h \ scripts.h \ scripttoolbox.h \ searchForEmp.h \ selectBankAccount.h \ selectBillingQty.h \ selectOrderForBilling.h \ selectPayment.h \ selectPayments.h \ selectShippedOrders.h \ selectedPayments.h \ setup.h \ shipOrder.h \ shipTo.h \ shipVia.h \ shipVias.h \ shippingChargeType.h \ shippingChargeTypes.h \ shippingForm.h \ shippingForms.h \ shippingInformation.h \ shippingZone.h \ shippingZones.h \ siteType.h \ siteTypes.h \ splitReceipt.h \ standardJournal.h \ standardJournalGroup.h \ standardJournalGroupItem.h \ standardJournalGroups.h \ standardJournalItem.h \ standardJournals.h \ state.h \ states.h \ subAccntType.h \ subAccntTypes.h \ subaccount.h \ subaccounts.h \ submitAction.h \ submitReport.h \ substituteList.h \ summarizeInvTransByClassCode.h\ syncCompanies.h \ sysLocale.h \ systemMessage.h \ task.h \ taxAdjustment.h \ taxAssignment.h \ taxAssignments.h \ taxAuthorities.h \ taxAuthority.h \ taxBreakdown.h \ taxCache.h \ taxClass.h \ taxClasses.h \ taxCode.h \ taxCodeRate.h \ taxCodes.h \ taxDetail.h \ taxRegistration.h \ taxRegistrations.h \ taxType.h \ taxTypes.h \ taxZone.h \ taxZones.h \ terms.h \ termses.h \ thawItemSitesByClassCode.h \ timeoutHandler.h \ todoCalendarControl.h \ todoItem.h \ todoList.h \ todoListCalendar.h \ toitemTableModel.h \ toitemTableView.h \ transactionInformation.h \ transferOrder.h \ transferOrderItem.h \ transferOrders.h \ transferTrans.h \ transformTrans.h \ translations.h \ uiform.h \ uiforms.h \ unappliedAPCreditMemos.h \ unappliedARCreditMemos.h \ uninvoicedShipments.h \ unpostedCreditMemos.h \ unpostedGLTransactions.h \ unpostedGlSeries.h \ unpostedInvoices.h \ unpostedPoReceipts.h \ unpostedPurchaseOrders.h \ uom.h \ uomConv.h \ uoms.h \ updateABCClass.h \ updateActualCostsByClassCode.h \ updateActualCostsByItem.h \ updateCreditStatusByCustomer.h \ updateCycleCountFrequency.h \ updateItemSiteLeadTimes.h \ updateLateCustCreditStatus.h \ updateListPricesByProductCategory.h \ updateOUTLevelByItem.h \ updateOUTLevels.h \ updateOUTLevelsByClassCode.h \ updatePrices.h \ updateReorderLevels.h \ user.h \ userCostingElement.h \ userList.h \ userPreferences.h \ users.h \ vendor.h \ vendorAddress.h \ vendorAddressList.h \ vendorPriceList.h \ vendorType.h \ vendorTypes.h \ vendorWorkBench.h \ vendors.h \ verisignprocessor.h \ version.h \ viewCheckRun.h \ voidChecks.h \ voucher.h \ voucherItem.h \ voucherItemDistrib.h \ voucherMiscDistrib.h \ warehouse.h \ warehouseZone.h \ warehouses.h \ welcomeStub.h \ woMaterialItem.h \ workOrder.h \ workOrderMaterials.h \ xtHelp.h \ xTupleDesigner.h \ xTupleDesignerActions.h \ xabstractconfigure.h \ xdateinputdialog.h \ xdialog.h \ xerrormessage.h \ xmainwindow.h \ xmessagebox.h \ xmessageboxmessagehandler.h \ xsltMap.h \ xuiloader.h \ xwidget.h \ yourpayprocessor.h \ zeroUncountedCountTagsByWarehouse.h \ SOURCES = absoluteCalendarItem.cpp \ accountNumber.cpp \ accountNumbers.cpp \ accountingPeriod.cpp \ accountingPeriods.cpp \ accountingYearPeriod.cpp \ accountingYearPeriods.cpp \ addPoComment.cpp \ address.cpp \ addresses.cpp \ adjustmentTrans.cpp \ adjustInvValue.cpp \ allocateARCreditMemo.cpp \ allocateReservations.cpp \ apAccountAssignment.cpp \ apAccountAssignments.cpp \ apCreditMemoApplication.cpp \ apOpenItem.cpp \ apWorkBench.cpp \ applyAPCreditMemo.cpp \ applyARCreditMemo.cpp \ applyARDiscount.cpp \ applyDiscount.cpp \ arAccountAssignment.cpp \ arAccountAssignments.cpp \ arCreditMemoApplication.cpp \ arOpenItem.cpp \ arWorkBench.cpp \ archRestoreSalesHistory.cpp \ assignClassCodeToPlannerCode.cpp \ assignItemToPlannerCode.cpp \ assignLotSerial.cpp \ atlasMap.cpp \ authorizedotnetprocessor.cpp \ bankAccount.cpp \ bankAccounts.cpp \ bankAdjustment.cpp \ bankAdjustmentEditList.cpp \ bankAdjustmentType.cpp \ bankAdjustmentTypes.cpp \ bom.cpp \ bomItem.cpp \ bomList.cpp \ budgets.cpp \ buyCard.cpp \ calendar.cpp \ calendars.cpp \ cashReceipt.cpp \ cashReceiptItem.cpp \ cashReceiptMiscDistrib.cpp \ cashReceiptsEditList.cpp \ changePoitemQty.cpp \ changeWoQty.cpp \ characteristic.cpp \ characteristicAssignment.cpp \ characteristicPrice.cpp \ characteristics.cpp \ check.cpp \ checkFormat.cpp \ checkFormats.cpp \ classCode.cpp \ classCodes.cpp \ closePurchaseOrder.cpp \ closeWo.cpp \ commentType.cpp \ commentTypes.cpp \ companies.cpp \ company.cpp \ configauthorizedotnetprocessor.cpp \ configcreditcardprocessor.cpp \ configcybersourceprocessor.cpp \ configureCC.cpp \ configureCRM.cpp \ configureEncryption.cpp \ configureGL.cpp \ configureIE.cpp \ configureIM.cpp \ configureMS.cpp \ configurePD.cpp \ configurePO.cpp \ configureSearchPath.cpp \ configureSO.cpp \ configureWO.cpp \ confirmAchOK.cpp \ contact.cpp \ contacts.cpp \ contactMerge.cpp \ contract.cpp \ contracts.cpp \ copyBOM.cpp \ copyBudget.cpp \ copyContract.cpp \ copyItem.cpp \ copyPurchaseOrder.cpp \ copySalesOrder.cpp \ copyTransferOrder.cpp \ correctProductionPosting.cpp \ costCategories.cpp \ costCategory.cpp \ costingElements.cpp \ countSlip.cpp \ countTag.cpp \ countTagList.cpp \ countries.cpp \ country.cpp \ createCountTagsByItem.cpp \ createCountTagsByParameterList.cpp \ createCycleCountTags.cpp \ createInvoices.cpp \ createItemSitesByClassCode.cpp \ createLotSerial.cpp \ createPlannedOrdersByItem.cpp \ createPlannedOrdersByPlannerCode.cpp \ createRecurringInvoices.cpp \ createRecurringItems.cpp \ creditCard.cpp \ creditMemo.cpp \ creditMemoEditList.cpp \ creditMemoItem.cpp \ creditcardprocessor.cpp \ crmaccount.cpp \ crmaccountMerge.cpp \ crmaccountMergePickAccountsPage.cpp \ crmaccountMergePickDataPage.cpp \ crmaccountMergePickTaskPage.cpp \ crmaccountMergePurgePage.cpp \ crmaccountMergeResultPage.cpp \ crmaccounts.cpp \ currencies.cpp \ currenciesDialog.cpp \ currency.cpp \ currencyConversion.cpp \ currencyConversions.cpp \ currencySelect.cpp \ custCharacteristicDelegate.cpp \ customCommand.cpp \ customCommandArgument.cpp \ customCommands.cpp \ customer.cpp \ customerFormAssignment.cpp \ customerFormAssignments.cpp \ customerGroup.cpp \ customerGroups.cpp \ customerType.cpp \ customerTypeList.cpp \ customerTypes.cpp \ customers.cpp \ cybersourceprocessor.cpp \ databaseInformation.cpp \ deletePlannedOrder.cpp \ deletePlannedOrdersByPlannerCode.cpp \ department.cpp \ departments.cpp \ dictionaries.cpp \ display.cpp \ displayTimePhased.cpp \ distributeInventory.cpp \ distributeToLocation.cpp \ dspAROpenItems.cpp \ dspBankrecHistory.cpp \ dspBillingSelections.cpp \ dspCashReceipts.cpp \ dspCheckRegister.cpp \ dspCountSlipEditList.cpp \ dspCountTagEditList.cpp \ dspCreditCardTransactions.cpp \ dspFinancialReport.cpp \ dspInvoiceInformation.cpp \ dspMRPDetail.cpp \ dspTaxHistory.cpp \ duplicateAccountNumbers.cpp \ editOwners.cpp \ empGroup.cpp \ empGroups.cpp \ employee.cpp \ employees.cpp \ enterMiscCount.cpp \ enterPoReceipt.cpp \ enterPoReturn.cpp \ enterPoitemReceipt.cpp \ enterPoitemReturn.cpp \ errorLog.cpp \ eventManager.cpp \ expenseCategories.cpp \ expenseCategory.cpp \ expenseTrans.cpp \ explodeWo.cpp \ exportData.cpp \ externalCCTransaction.cpp \ externalShipping.cpp \ externalShippingList.cpp \ externalccprocessor.cpp \ failedPostList.cpp \ financialLayout.cpp \ financialLayoutColumns.cpp \ financialLayoutGroup.cpp \ financialLayoutItem.cpp \ financialLayoutSpecial.cpp \ financialLayouts.cpp \ firmPlannedOrder.cpp \ firmPlannedOrdersByPlannerCode.cpp \ financialReportNotes.cpp \ fixACL.cpp \ fixSerial.cpp \ form.cpp \ forms.cpp \ forwardUpdateAccounts.cpp \ freightBreakdown.cpp \ freightClass.cpp \ freightClasses.cpp \ getGLDistDate.cpp \ getLotInfo.cpp \ getscreen.cpp \ glSeries.cpp \ glSeriesItem.cpp \ glTransaction.cpp \ glTransactionDetail.cpp \ group.cpp \ groups.cpp \ guiErrorCheck.cpp \ guiclient.cpp \ helpDownload.cpp \ helpView.cpp \ helpViewBrowser.cpp \ honorific.cpp \ honorifics.cpp \ hotkey.cpp \ hotkeys.cpp \ idleShutdown.cpp \ image.cpp \ imageList.cpp \ images.cpp \ implodeWo.cpp \ importData.cpp \ incident.cpp \ incidentCategories.cpp \ incidentCategory.cpp \ incidentPriorities.cpp \ incidentPriority.cpp \ incidentResolution.cpp \ incidentResolutions.cpp \ incidentSeverities.cpp \ incidentSeverity.cpp \ incidentWorkbench.cpp \ inputManager.cpp \ invoice.cpp \ invoiceItem.cpp \ invoiceList.cpp \ issueLineToShipping.cpp \ issueToShipping.cpp \ issueWoMaterialBatch.cpp \ issueWoMaterialItem.cpp \ item.cpp \ itemAlias.cpp \ itemAvailabilityWorkbench.cpp \ itemCharacteristicDelegate.cpp\ itemCost.cpp \ itemGroup.cpp \ itemGroups.cpp \ itemImages.cpp \ itemListPrice.cpp \ itemPricingSchedule.cpp \ itemPricingScheduleItem.cpp \ itemPricingSchedules.cpp \ itemSite.cpp \ itemSites.cpp \ itemSource.cpp \ itemSourceList.cpp \ itemSourcePrice.cpp \ itemSourceSearch.cpp \ itemSources.cpp \ itemSubstitute.cpp \ itemUOM.cpp \ items.cpp \ itemtax.cpp \ jsHighlighter.cpp \ labelForm.cpp \ labelForms.cpp \ listRecurringInvoices.cpp \ locales.cpp \ location.cpp \ locations.cpp \ lotSerial.cpp \ lotSerialSequence.cpp \ lotSerialSequences.cpp \ lotSerialRegistration.cpp \ main.cpp \ maintainBudget.cpp \ maintainItemCosts.cpp \ maintainShipping.cpp \ massExpireComponent.cpp \ massReplaceComponent.cpp \ materialReceiptTrans.cpp \ metasqls.cpp \ menuAccounting.cpp \ menuCRM.cpp \ menuInventory.cpp \ menuManufacture.cpp \ menuProducts.cpp \ menuPurchase.cpp \ menuSales.cpp \ menuSchedule.cpp \ menuSystem.cpp \ menuWindow.cpp \ miscCheck.cpp \ miscVoucher.cpp \ openPurchaseOrder.cpp \ openReturnAuthorizations.cpp \ openSalesOrders.cpp \ openVouchers.cpp \ opportunity.cpp \ opportunityList.cpp \ opportunitySource.cpp \ opportunitySources.cpp \ opportunityStage.cpp \ opportunityStages.cpp \ opportunityType.cpp \ opportunityTypes.cpp \ package.cpp \ packages.cpp \ packingListBatch.cpp \ paymentechprocessor.cpp \ plannedOrder.cpp \ plannerCode.cpp \ plannerCodes.cpp \ poLiabilityDistrib.cpp \ poitemTableModel.cpp \ poitemTableView.cpp \ postCashReceipts.cpp \ postCheck.cpp \ postChecks.cpp \ postCostsByClassCode.cpp \ postCostsByItem.cpp \ postCountSlips.cpp \ postCountTags.cpp \ postCreditMemos.cpp \ postInvoices.cpp \ postJournals.cpp \ postMiscProduction.cpp \ postPoReturnCreditMemo.cpp \ postProduction.cpp \ postPurchaseOrder.cpp \ postPurchaseOrdersByAgent.cpp \ postStandardJournal.cpp \ postStandardJournalGroup.cpp \ postVouchers.cpp \ prepareCheckRun.cpp \ priceList.cpp \ pricingScheduleAssignment.cpp \ pricingScheduleAssignments.cpp \ printArOpenItem.cpp \ printCheck.cpp \ printChecks.cpp \ printChecksReview.cpp \ printCreditMemo.cpp \ printCreditMemos.cpp \ printInvoice.cpp \ printInvoices.cpp \ printItemLabelsByClassCode.cpp \ printLabelsByInvoice.cpp \ printLabelsByOrder.cpp \ printLabelsBySo.cpp \ printLabelsByTo.cpp \ printOptions.cpp \ printMulticopyDocument.cpp \ printPackingList.cpp \ printPackingListBatchByShipvia.cpp \ printPoForm.cpp \ printPurchaseOrder.cpp \ printPurchaseOrdersByAgent.cpp \ printQuote.cpp \ printRaForm.cpp \ printShippingForm.cpp \ printShippingForms.cpp \ printSinglecopyDocument.cpp \ printSoForm.cpp \ printStatementByCustomer.cpp \ printStatementsByCustomerType.cpp \ printVendorForm.cpp \ printWoForm.cpp \ printWoPickList.cpp \ printWoTraveler.cpp \ productCategories.cpp \ productCategory.cpp \ profitCenter.cpp \ profitCenters.cpp \ project.cpp \ projects.cpp \ prospect.cpp \ prospects.cpp \ purchaseOrder.cpp \ purchaseOrderItem.cpp \ purchaseRequest.cpp \ purgeClosedWorkOrders.cpp \ purgeCreditMemos.cpp \ purgeInvoices.cpp \ purgePostedCountSlips.cpp \ purgePostedCounts.cpp \ quotes.cpp \ reasonCode.cpp \ reasonCodes.cpp \ reassignClassCodeByClassCode.cpp \ reassignCustomerTypeByCustomerType.cpp\ reassignLotSerial.cpp \ reassignProductCategoryByProductCategory.cpp \ recallOrders.cpp \ reconcileBankaccount.cpp \ registrationKey.cpp \ registrationKeyDialog.cpp \ rejectCode.cpp \ rejectCodes.cpp \ relativeCalendarItem.cpp \ releasePlannedOrdersByPlannerCode.cpp \ releaseTransferOrdersByAgent.cpp \ releaseWorkOrdersByPlannerCode.cpp \ relocateInventory.cpp \ reports.cpp \ reprintCreditMemos.cpp \ reprintInvoices.cpp \ reprintMulticopyDocument.cpp \ reprioritizeWo.cpp \ reschedulePoitem.cpp \ rescheduleWo.cpp \ reserveSalesOrderItem.cpp \ resetQOHBalances.cpp \ returnAuthCheck.cpp \ returnAuthItemLotSerial.cpp \ returnAuthorization.cpp \ returnAuthorizationItem.cpp \ returnAuthorizationWorkbench.cpp \ returnWoMaterialBatch.cpp \ returnWoMaterialItem.cpp \ reverseGLSeries.cpp \ sale.cpp \ sales.cpp \ salesAccount.cpp \ salesAccounts.cpp \ salesCategories.cpp \ salesCategory.cpp \ salesHistoryInformation.cpp \ salesOrder.cpp \ salesOrderInformation.cpp \ salesOrderItem.cpp \ salesRep.cpp \ salesReps.cpp \ saleType.cpp \ saleTypes.cpp \ scrapTrans.cpp \ scrapWoMaterialFromWIP.cpp \ scriptablePrivate.cpp \ scriptEditor.cpp \ scripts.cpp \ scripttoolbox.cpp \ searchForEmp.cpp \ selectBankAccount.cpp \ selectBillingQty.cpp \ selectOrderForBilling.cpp \ selectPayment.cpp \ selectPayments.cpp \ selectShippedOrders.cpp \ selectedPayments.cpp \ setup.cpp \ shipOrder.cpp \ shipTo.cpp \ shipVia.cpp \ shipVias.cpp \ shippingChargeType.cpp \ shippingChargeTypes.cpp \ shippingForm.cpp \ shippingForms.cpp \ shippingInformation.cpp \ shippingZone.cpp \ shippingZones.cpp \ siteType.cpp \ siteTypes.cpp \ splitReceipt.cpp \ standardJournal.cpp \ standardJournalGroup.cpp \ standardJournalGroupItem.cpp \ standardJournalGroups.cpp \ standardJournalItem.cpp \ standardJournals.cpp \ state.cpp \ states.cpp \ subAccntType.cpp \ subAccntTypes.cpp \ subaccount.cpp \ subaccounts.cpp \ submitAction.cpp \ submitReport.cpp \ substituteList.cpp \ summarizeInvTransByClassCode.cpp \ syncCompanies.cpp \ sysLocale.cpp \ systemMessage.cpp \ task.cpp \ taxAdjustment.cpp \ taxAssignment.cpp \ taxAssignments.cpp \ taxAuthorities.cpp \ taxAuthority.cpp \ taxBreakdown.cpp \ taxCache.cpp \ taxClass.cpp \ taxClasses.cpp \ taxCode.cpp \ taxCodeRate.cpp \ taxCodes.cpp \ taxDetail.cpp \ taxRegistration.cpp \ taxRegistrations.cpp \ taxType.cpp \ taxTypes.cpp \ taxZone.cpp \ taxZones.cpp \ terms.cpp \ termses.cpp \ thawItemSitesByClassCode.cpp \ timeoutHandler.cpp \ todoCalendarControl.cpp \ todoItem.cpp \ todoList.cpp \ todoListCalendar.cpp \ toitemTableModel.cpp \ toitemTableView.cpp \ transactionInformation.cpp \ transferOrder.cpp \ transferOrderItem.cpp \ transferOrders.cpp \ transferTrans.cpp \ transformTrans.cpp \ translations.cpp \ uiform.cpp \ uiforms.cpp \ unappliedAPCreditMemos.cpp \ unappliedARCreditMemos.cpp \ uninvoicedShipments.cpp \ unpostedCreditMemos.cpp \ unpostedGLTransactions.cpp \ unpostedGlSeries.cpp \ unpostedInvoices.cpp \ unpostedPoReceipts.cpp \ unpostedPurchaseOrders.cpp \ uom.cpp \ uomConv.cpp \ uoms.cpp \ updateABCClass.cpp \ updateActualCostsByClassCode.cpp \ updateActualCostsByItem.cpp \ updateCreditStatusByCustomer.cpp \ updateCycleCountFrequency.cpp \ updateItemSiteLeadTimes.cpp \ updateLateCustCreditStatus.cpp \ updateListPricesByProductCategory.cpp \ updateOUTLevelByItem.cpp \ updateOUTLevels.cpp \ updateOUTLevelsByClassCode.cpp \ updatePrices.cpp \ updateReorderLevels.cpp \ user.cpp \ userCostingElement.cpp \ userList.cpp \ userPreferences.cpp \ users.cpp \ vendor.cpp \ vendorAddress.cpp \ vendorAddressList.cpp \ vendorPriceList.cpp \ vendorType.cpp \ vendorTypes.cpp \ vendorWorkBench.cpp \ vendors.cpp \ verisignprocessor.cpp \ version.cpp \ viewCheckRun.cpp \ voidChecks.cpp \ voucher.cpp \ voucherItem.cpp \ voucherItemDistrib.cpp \ voucherMiscDistrib.cpp \ warehouse.cpp \ warehouseZone.cpp \ warehouses.cpp \ welcomeStub.cpp \ woMaterialItem.cpp \ workOrder.cpp \ workOrderMaterials.cpp \ xTupleDesigner.cpp \ xTupleDesignerActions.cpp \ xabstractconfigure.cpp \ xdateinputdialog.cpp \ xdialog.cpp \ xerrormessage.cpp \ xmainwindow.cpp \ xmessagebox.cpp \ xmessageboxmessagehandler.cpp \ xsltMap.cpp \ xtHelp.cpp \ xuiloader.cpp \ xwidget.cpp \ yourpayprocessor.cpp \ zeroUncountedCountTagsByWarehouse.cpp \ include( displays/displays.pri ) include( hunspell.pri ) QT += xml sql script scripttools network QT += webkit xmlpatterns RESOURCES += guiclient.qrc ../$${OPENRPT_DIR}/OpenRPT/images/OpenRPTMetaSQL.qrc #CONFIG += debug qt-client-4.1.0/guiclient/guiclient.qrc000066400000000000000000000046411217451700100200740ustar00rootroot00000000000000 newForm.ui images/icon32x32.png images/dspEvents.png images/dspError.png images/dspInventoryAvailabilityByPlannerCode.png images/items.png images/boms.png images/boos.png images/itemSites.png images/itemAvailabilityWorkbench.png images/runMrpByPlannerCode.png images/dspPlannedOrdersByPlannerCode.png images/shopFloorWorkbench.png images/dspWoScheduleByPlannerCode.png images/dspPurchaseReqByPlannerCode.png images/listUnpostedPo.png images/listOpenSalesOrders.png images/dspSummarizedBacklogByWhse.png images/uninvoicedShipments.png images/unpostedInvoices.png images/customerInformationWorkbench.png images/toDoList.png images/accounts.png images/contacts.png images/incidents.png images/issueStockToShipping.png images/postReceipts.png images/projects.png images/listUnpostedVouchers.png images/selectPayments.png images/prepareCheckRun.png images/viewCheckRun.png images/apAging.png images/arWorkbench.png images/arAging.png images/editCashReceipts.png images/journalEntries.png images/bankReconciliation.png images/viewTrialBalance.png images/viewFinancialReport.png images/billingSelections.png images/splashMfgEdition.png images/splashPostBooks.png images/splashStdEdition.png images/splashEnterprise.png images/splashEmpty.png images/dspRegister.png images/xchange.png images/community.png images/icon128x32.png images/clear.png qt-client-4.1.0/guiclient/helpDownload.cpp000066400000000000000000000143041217451700100205230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "helpDownload.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include helpDownload::helpDownload(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _state = Idle; nwam = new QNetworkAccessManager(this); _nwrep = 0; ver = qApp->applicationVersion().left(3); connect(nwam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*))); connect(_button, SIGNAL(clicked()), this, SLOT(sAction())); } helpDownload::~helpDownload() { // no need to delete child widgets, Qt does it all for us } void helpDownload::languageChange() { retranslateUi(this); } void helpDownload::finished(QNetworkReply * nwrep) { if(nwrep->header(QNetworkRequest::LocationHeader).isValid()) { if(nwrep->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt() == 301) { qDebug() << "301 Not found"; _progress->setRange(0, 100); _progress->setValue(100); _label->setText("No documentation is currently available."); _button->setText(tr("Start")); _state = Idle; } else { QNetworkReply * newrep = nwam->get(QNetworkRequest(QUrl(nwrep->header(QNetworkRequest::LocationHeader).toString()))); connect(newrep, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); _nwrep = newrep; } } else { if(nwrep->error() == QNetworkReply::NoError) { QByteArray ba = nwrep->readAll(); if(!ba.isEmpty()) { if(ba[0] == '<') { QRegExp re(""); QString html(ba); re.indexIn(html); QStringList list = re.capturedTexts(); if(list.size() > 1) { QString url = list.at(1); url = url.replace("&", "&"); qDebug() << "Redirecting to " << url; QNetworkReply * newrep = nwam->get(QNetworkRequest(QUrl(url))); connect(newrep, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); _nwrep = newrep; } else { _label->setText(tr("Received unknown response from server.")); } } else { QDir dir(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); if(!dir.exists()) dir.mkpath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); QFile file(QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/helpXTupleGUIClient-" + ver + ".tar.gz"); if(file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { file.write(ba); file.close(); QByteArray data = gunzipFile(file.fileName()); if(!data.isEmpty()) { TarFile *_files = new TarFile(data); if(_files->isValid()) { bool error = false; QMapIterator i(_files->_list); while (i.hasNext()) { i.next(); //cout << i.key() << ": " << i.value() << endl; QFile ff(QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/" + i.key()); if(ff.open(QIODevice::WriteOnly | QIODevice::Truncate)) { ff.write(i.value()); ff.close(); } else { error = true; } } if(error) { _label->setText(tr("Could not save one or more files.")); } else { _label->setText(tr("Documentation downloaded.")); xtHelp::reload(); } } else { _label->setText(tr("Could not read archive format.")); } delete _files; } else { _label->setText(tr("Could not uncompress file.")); } } else { _label->setText(tr("Could not save file.")); } } } else { _label->setText(tr("No documentation is currently available.")); } } else { qDebug() << "Error: " << nwrep->error(); _label->setText(tr("Could not retrieve documentation at this time.")); } _progress->setRange(0, 100); _progress->setValue(100); _button->setText(tr("Start")); _state = Idle; } if(nwrep == _nwrep) _nwrep = 0; nwrep->deleteLater(); } void helpDownload::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { if(bytesTotal == -1) bytesTotal = 30000000; // chose some number that is reasonable _progress->setRange(0, bytesTotal); _progress->setValue(bytesReceived); } void helpDownload::sAction() { if(_state == Busy) { if(_nwrep) { _nwrep->abort(); _nwrep->deleteLater(); _nwrep = 0; } _button->setText(tr("Start")); _state = Idle; } else { _nwrep = nwam->get(QNetworkRequest(QUrl("http://sourceforge.net/projects/postbooks/files/04%20PostBooks-docs/" + ver + ".0/helpXTupleGUIClient-" + ver + ".tar.gz/download"))); connect(_nwrep, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); _label->setText(tr("Downloading...")); _button->setText(tr("Cancel")); _state = Busy; } } qt-client-4.1.0/guiclient/helpDownload.h000066400000000000000000000022451217451700100201710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef HELPDOWNLOAD_H #define HELPDOWNLOAD_H #include "guiclient.h" #include "xwidget.h" #include "ui_helpDownload.h" class QNetworkAccessManager; class QNetworkReply; class helpDownload : public XWidget, public Ui::helpDownload { Q_OBJECT enum State { Idle = 0, Busy }; public: helpDownload(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~helpDownload(); public slots: virtual void sAction(); protected slots: virtual void languageChange(); virtual void finished(QNetworkReply*); virtual void downloadProgress(qint64, qint64); private: QString ver; State _state; QNetworkAccessManager * nwam; QNetworkReply * _nwrep; }; #endif // HELPDOWNLOAD_H qt-client-4.1.0/guiclient/helpDownload.ui000066400000000000000000000066401217451700100203620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. helpDownload 0 0 312 102 Help Download Check for available documentation? Qt::Horizontal 40 20 1 0 100 0 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Start Qt::Horizontal 40 20 Qt::Vertical 20 15 qt-client-4.1.0/guiclient/helpView.cpp000066400000000000000000000122601217451700100176650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2010 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "guiclient.h" #include "helpView.h" #include "helpViewBrowser.h" #include "xtHelp.h" static QIcon iconFromImageByName(QString name) { QImage image; XSqlQuery imageq; imageq.prepare("SELECT image_data FROM image WHERE image_name=:name LIMIT 1;"); imageq.bindValue(":name", name); if (imageq.exec() && imageq.first()) { image.loadFromData(QUUDecode(imageq.value("image_data").toString())); return QIcon(QPixmap::fromImage(image)); } return QIcon(); } static helpView *helpViewSingleton = 0; helpView* helpView::getInstance(QWidget *parent) { if(!helpViewSingleton) helpViewSingleton = new helpView(parent); return helpViewSingleton; } void helpView::reset() { helpViewSingleton = 0; } helpView::helpView(QWidget *parent) : QDockWidget(tr("xTuple Help Documentation"), parent) { setObjectName("helpView"); _layoutContainer = new QWidget(this); _layout = new QGridLayout; _layout->setSpacing(0); _helpBrowser = new helpViewBrowser(this); _help = xtHelp::getInstance(this); _helpBrowserToolbar = new QToolBar(this); _searchSplitter = new QSplitter(this); _mainSplitter = new QSplitter(this); _searchEngine = new QHelpSearchEngine(_help, this); _searchTabs = new QTabWidget(this); QAction *back = _helpBrowserToolbar->addAction(iconFromImageByName("ImgLeftArrow"), tr("Back"), _helpBrowser, SLOT(backward())); QAction *fwd = _helpBrowserToolbar->addAction(iconFromImageByName("ImgRightArrow"),tr("Forward"), _helpBrowser, SLOT(forward())); QAction *home = _helpBrowserToolbar->addAction(iconFromImageByName("home_32"), tr("Home"), _helpBrowser, SLOT(home())); connect(_helpBrowser, SIGNAL(backwardAvailable(bool)), back, SLOT(setEnabled(bool))); connect(_helpBrowser, SIGNAL(forwardAvailable(bool)), fwd, SLOT(setEnabled(bool))); connect(_helpBrowser, SIGNAL(backwardAvailable(bool)), home, SLOT(setEnabled(bool))); connect(_searchEngine->queryWidget(),SIGNAL(search()), this, SLOT(queriesToEngine())); connect(_help->contentWidget(), SIGNAL(clicked(QModelIndex)), this, SLOT(showLink(QModelIndex))); connect(_help->contentWidget(), SIGNAL(linkActivated(const QUrl&)), this, SLOT(sIndexChanged(const QUrl&))); connect(_searchEngine->resultWidget(), SIGNAL(requestShowLink(const QUrl&)), this, SLOT(sIndexChanged(const QUrl&))); connect(_help->indexWidget(), SIGNAL(linkActivated(const QUrl&,QString)), this, SLOT(sIndexChanged(const QUrl&))); connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)), this, SLOT(sLocationChanged(Qt::DockWidgetArea))); _searchSplitter->setOrientation(Qt::Vertical); _searchSplitter->addWidget(_searchEngine->queryWidget()); _searchSplitter->addWidget(_searchEngine->resultWidget()); _searchTabs->addTab(_help->contentWidget(), "Contents"); _searchTabs->addTab(_searchSplitter, "Search"); _searchTabs->addTab(_help->indexWidget(), "Index"); _mainSplitter->addWidget(_searchTabs); _mainSplitter->addWidget(_helpBrowser); _layout->addWidget(_helpBrowserToolbar, 0, 0, 1, -1); _layout->addWidget(_mainSplitter, 1, 0); if(_help->isOnline()) { _help->contentWidget()->hide(); sIndexChanged(QUrl("index.html")); } _layoutContainer->setLayout(_layout); setWidget(_layoutContainer); omfgThis->addDockWidget(Qt::TopDockWidgetArea, this); _searchEngine->reindexDocumentation(); } helpView::~helpView() { } void helpView::queriesToEngine() { _searchEngine->search(_searchEngine->queryWidget()->query()); } void helpView::sIndexChanged(const QUrl& index) { _helpBrowser->setSource(index); _helpBrowser->show(); } void helpView::sLocationChanged(Qt::DockWidgetArea area) { bool redraw = false; if( area == Qt::RightDockWidgetArea || area == Qt::LeftDockWidgetArea ) { _layout->removeWidget(_helpBrowser); _mainSplitter->addWidget(_helpBrowser); redraw = true; } else if( area == Qt::TopDockWidgetArea || area == Qt::BottomDockWidgetArea ) { _layout->removeWidget(_helpBrowser); _mainSplitter->addWidget(_helpBrowser); redraw = true; } if(redraw) { show(); } } void helpView::showLink(const QModelIndex &index) { QHelpContentModel *contentModel = _help->contentModel(); if (!contentModel) return; QHelpContentItem *item = contentModel->contentItemAt(index); if (!item) return; QUrl url = item->url(); if (url.isValid()) sIndexChanged(url); } qt-client-4.1.0/guiclient/helpView.h000066400000000000000000000027571217451700100173440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __HELPVIEW_H__ #define __HELPVIEW_H__ #include #include class QGridLayout; class QHelpSearchEngine; class QTabWidget; class QSplitter; class QToolBar; class QUrl; class QWidget; class xtHelp; class helpViewBrowser; class helpView : public QDockWidget { Q_OBJECT public: static helpView *getInstance(QWidget *parent = 0); ~helpView(); static void reset(); public slots: void queriesToEngine(); void sIndexChanged(const QUrl&); void sLocationChanged(Qt::DockWidgetArea); void showLink(const QModelIndex &index); protected: xtHelp *_help; helpViewBrowser *_helpBrowser; QTabWidget *_searchTabs; QToolBar *_helpBrowserToolbar; QSplitter *_searchSplitter; QSplitter *_mainSplitter; QHelpSearchEngine *_searchEngine; QString _loc; private: helpView(QWidget *parent = 0); QWidget *_layoutContainer; QGridLayout *_layout; }; #endif // __HELPVIEW_H__ qt-client-4.1.0/guiclient/helpViewBrowser.cpp000066400000000000000000000022401217451700100212260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "helpViewBrowser.h" #include "xtHelp.h" #define DEBUG false helpViewBrowser::helpViewBrowser(QWidget *parent) : QTextBrowser(parent) { setSource(xtHelp::getInstance()->homePage()); } QVariant helpViewBrowser::loadResource(int type, const QUrl &name) { if (DEBUG) qDebug() << "loadResource: type [" << type << "] name [" << name.toString() << "]"; QByteArray data; if(type < 4) { QUrl url(name); if(name.isRelative()) { url = source().resolved(url); if (DEBUG) qDebug() << "url was relative [" << url << "]"; } data = xtHelp::getInstance()->fileData(url); } return data; } helpViewBrowser::~helpViewBrowser() { } qt-client-4.1.0/guiclient/helpViewBrowser.h000066400000000000000000000014011217451700100206710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __HELPVIEWBROWSER_H__ #define __HELPVIEWBROWSER_H__ #include class QWidget; class helpViewBrowser : public QTextBrowser { Q_OBJECT public: helpViewBrowser(QWidget *parent = 0); ~helpViewBrowser(); virtual QVariant loadResource(int, const QUrl&); }; #endif // __HELPVIEWBROWSER_H__ qt-client-4.1.0/guiclient/honorific.cpp000066400000000000000000000132051217451700100200620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "honorific.h" #include #include #include #include honorific::honorific(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } honorific::~honorific() { // no need to delete child widgets, Qt does it all for us } void honorific::languageChange() { retranslateUi(this); } enum SetResponse honorific::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("hnfc_id", &valid); if (valid) { _honorificid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void honorific::sCheck() { XSqlQuery honorificCheck; _code->setText(_code->text().trimmed()); if ( (_mode == cNew) && (_code->text().length()) ) { honorificCheck.prepare( "SELECT hnfc_id " "FROM hnfc " "WHERE (UPPER(hnfc_code)=UPPER(:hnfc_code));" ); honorificCheck.bindValue(":hnfc_code", _code->text()); honorificCheck.exec(); if (honorificCheck.first()) { _honorificid = honorificCheck.value("hnfc_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void honorific::sSave() { XSqlQuery honorificSave; if (_code->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Title"), tr("You must enter a valid Title.") ); return; } if (_mode == cEdit) { honorificSave.prepare( "SELECT hnfc_id " "FROM hnfc " "WHERE ( (hnfc_id<>:hnfc_id)" " AND (UPPER(hnfc_code)=UPPER(:hnfc_code)) );"); honorificSave.bindValue(":hnfc_id", _honorificid); } else { honorificSave.prepare( "SELECT hnfc_id " "FROM hnfc " "WHERE (hnfc_code=:hnfc_code);"); } honorificSave.bindValue(":hnfc_code", _code->text().trimmed()); honorificSave.exec(); if (honorificSave.first()) { QMessageBox::critical( this, tr("Cannot Create Title"), tr( "A Title with the entered code already exists." "You may not create a Title with this code." ) ); _code->setFocus(); return; } else if (honorificSave.lastError().type() != QSqlError::NoError) { systemError(this, honorificSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cNew) { honorificSave.exec("SELECT NEXTVAL('hnfc_hnfc_id_seq') AS _hnfc_id"); if (honorificSave.first()) _honorificid = honorificSave.value("_hnfc_id").toInt(); else if (honorificSave.lastError().type() != QSqlError::NoError) { systemError(this, honorificSave.lastError().databaseText(), __FILE__, __LINE__); return; } honorificSave.prepare( "INSERT INTO hnfc " "( hnfc_id, hnfc_code ) " "VALUES " "( :hnfc_id, :hnfc_code );" ); } else if (_mode == cEdit) { honorificSave.prepare( "SELECT hnfc_id " "FROM hnfc " "WHERE ( (UPPER(hnfc_code)=UPPER(:hnfc_code))" " AND (hnfc_id<>:hnfc_id) );" ); honorificSave.bindValue(":hnfc_id", _honorificid); honorificSave.bindValue(":hnfc_code", _code->text()); honorificSave.exec(); if (honorificSave.first()) { QMessageBox::warning( this, tr("Cannot Save Title"), tr("You may not rename this Title with the entered value as it is in use by another Title.") ); return; } else if (honorificSave.lastError().type() != QSqlError::NoError) { systemError(this, honorificSave.lastError().databaseText(), __FILE__, __LINE__); return; } honorificSave.prepare( "UPDATE hnfc " "SET hnfc_code=:hnfc_code " "WHERE (hnfc_id=:hnfc_id);" ); } honorificSave.bindValue(":hnfc_id", _honorificid); honorificSave.bindValue(":hnfc_code", _code->text()); honorificSave.exec(); if (honorificSave.lastError().type() != QSqlError::NoError) { systemError(this, honorificSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_honorificid); } void honorific::populate() { XSqlQuery honorificpopulate; honorificpopulate.prepare( "SELECT hnfc_code " "FROM hnfc " "WHERE (hnfc_id=:hnfc_id);" ); honorificpopulate.bindValue(":hnfc_id", _honorificid); honorificpopulate.exec(); if (honorificpopulate.first()) { _code->setText(honorificpopulate.value("hnfc_code").toString()); } else if (honorificpopulate.lastError().type() != QSqlError::NoError) { systemError(this, honorificpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/honorific.h000066400000000000000000000020471217451700100175310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef HONORIFIC_H #define HONORIFIC_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_honorific.h" class honorific : public XDialog, public Ui::honorific { Q_OBJECT public: honorific(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~honorific(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _honorificid; }; #endif // HONORIFIC_H qt-client-4.1.0/guiclient/honorific.ui000066400000000000000000000060301217451700100177130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. honorific 0 0 296 94 Title 0 2 Title: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code Qt::Horizontal QSizePolicy::Expanding 0 10 Qt::Vertical QSizePolicy::Expanding 10 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit

    xlineedit.h
    1 _code qt-client-4.1.0/guiclient/honorifics.cpp000066400000000000000000000102211217451700100202400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "honorifics.h" #include #include #include #include #include #include #include "honorific.h" /* honorifics is internal name, titles is external name. names differ because 'title' might make more sense to users but we need to distinguish between Mr/Dr/Miss/Mrs used to address people directly and a job title such as Director of Operations and Shop Foreman in case this ever comes up. */ honorifics::honorifics(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_honorifics, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _honorifics->addColumn(tr("Title"), -1, Qt::AlignLeft, true, "hnfc_code"); if (_privileges->check("MaintainTitles")) { connect(_honorifics, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_honorifics, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_honorifics, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_honorifics, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } honorifics::~honorifics() { // no need to delete child widgets, Qt does it all for us } void honorifics::languageChange() { retranslateUi(this); } void honorifics::sFillList() { XSqlQuery honorificsFillList; honorificsFillList.prepare( "SELECT hnfc_id, hnfc_code " "FROM hnfc " "ORDER BY hnfc_code;" ); honorificsFillList.exec(); _honorifics->populate(honorificsFillList); if (honorificsFillList.lastError().type() != QSqlError::NoError) { systemError(this, honorificsFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void honorifics::sDelete() { XSqlQuery honorificsDelete; honorificsDelete.prepare( "DELETE FROM hnfc " "WHERE (hnfc_id=:hnfc_id);" ); honorificsDelete.bindValue(":hnfc_id", _honorifics->id()); honorificsDelete.exec(); if (honorificsDelete.lastError().type() != QSqlError::NoError) { systemError(this, honorificsDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void honorifics::sNew() { ParameterList params; params.append("mode", "new"); honorific newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void honorifics::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("hnfc_id", _honorifics->id()); honorific newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void honorifics::sView() { ParameterList params; params.append("mode", "view"); params.append("hnfc_id", _honorifics->id()); honorific newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void honorifics::sPopulateMenu( QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); if (!_privileges->check("MaintainTitles")) menuItem->setEnabled(false); pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); if (!_privileges->check("MaintainTitles")) menuItem->setEnabled(false); } void honorifics::sPrint() { orReport report("TitleList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/honorifics.h000066400000000000000000000020561217451700100177140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef HONORIFICS_H #define HONORIFICS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_honorifics.h" class honorifics : public XWidget, public Ui::honorifics { Q_OBJECT public: honorifics(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~honorifics(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // HONORIFICS_H qt-client-4.1.0/guiclient/honorifics.ui000066400000000000000000000113641217451700100201040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. honorifics 0 0 400 400 List Titles 0 Titles: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _honorifics _new _edit _view _delete _print _close _close clicked() honorifics close() 20 20 20 20 _honorifics valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/hotkey.cpp000066400000000000000000000133221217451700100174050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "hotkey.h" #include #include hotkey::hotkey(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); int i = 0; _hotkey->append(i++, "F1"); _hotkey->append(i++, "F2"); _hotkey->append(i++, "F3"); _hotkey->append(i++, "F4"); _hotkey->append(i++, "F5"); _hotkey->append(i++, "F6"); _hotkey->append(i++, "F7"); _hotkey->append(i++, "F8"); _hotkey->append(i++, "F9"); _hotkey->append(i++, "Ctrl+B"); _hotkey->append(i++, "Ctrl+C"); _hotkey->append(i++, "Ctrl+D"); _hotkey->append(i++, "Ctrl+E"); _hotkey->append(i++, "Ctrl+F"); _hotkey->append(i++, "Ctrl+G"); _hotkey->append(i++, "Ctrl+H"); _hotkey->append(i++, "Ctrl+I"); _hotkey->append(i++, "Ctrl+J"); _hotkey->append(i++, "Ctrl+K"); _hotkey->append(i++, "Ctrl+M"); _hotkey->append(i++, "Ctrl+N"); _hotkey->append(i++, "Ctrl+O"); _hotkey->append(i++, "Ctrl+P"); _hotkey->append(i++, "Ctrl+Q"); _hotkey->append(i++, "Ctrl+R"); _hotkey->append(i++, "Ctrl+T"); _hotkey->append(i++, "Ctrl+U"); _hotkey->append(i++, "Ctrl+V"); _hotkey->append(i++, "Ctrl+W"); _hotkey->append(i++, "Ctrl+X"); _hotkey->append(i++, "Ctrl+Y"); _hotkey->append(i++, "Ctrl+Z"); _hotkey->append(i++, "Ctrl+0"); _hotkey->append(i++, "Ctrl+1"); _hotkey->append(i++, "Ctrl+2"); _hotkey->append(i++, "Ctrl+3"); _hotkey->append(i++, "Ctrl+4"); _hotkey->append(i++, "Ctrl+5"); _hotkey->append(i++, "Ctrl+6"); _hotkey->append(i++, "Ctrl+7"); _hotkey->append(i++, "Ctrl+8"); _hotkey->append(i++, "Ctrl+9"); _action->addColumn( tr("Action Name"), 200, Qt::AlignLeft ); _action->addColumn( tr("Display Name"), -1, Qt::AlignLeft ); QStringList addedactions; XTreeWidgetItem *last = 0; QList menulist = omfgThis->findChildren(); for(int m = 0; m < menulist.size(); ++m) { QList actionlist = menulist.at(m)->actions(); for(int i = 0; i < actionlist.size(); ++i) { QAction* act = actionlist.at(i); if(!act->objectName().isEmpty()) { if(!addedactions.contains(act->objectName())) { addedactions.append(act->objectName()); last = new XTreeWidgetItem(_action, last, -1, QVariant(act->objectName()), act->text().remove("&")); } } } } _action->sortItems(0,Qt::AscendingOrder); } hotkey::~hotkey() { // no need to delete child widgets, Qt does it all for us } void hotkey::languageChange() { retranslateUi(this); } enum SetResponse hotkey::set(const ParameterList &pParams) { XSqlQuery hotkeyet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; _hotkey->setEnabled(FALSE); } } param = pParams.value("username", &valid); if (valid) { _username = param.toString(); _currentUser = FALSE; } param = pParams.value("currentUser", &valid); if (valid) _currentUser = TRUE; param = pParams.value("hotkey", &valid); if (valid) { QString value; if (_currentUser) value = _preferences->value(param.toString()); else { hotkeyet.prepare( "SELECT usrpref_value " "FROM usrpref " "WHERE ( (usrpref_username=:username)" " AND (usrpref_name=:name) );" ); hotkeyet.bindValue(":username", _username); hotkeyet.bindValue(":name", param.toString()); hotkeyet.exec(); if (hotkeyet.first()) value = hotkeyet.value("usrpref_value").toString(); // ToDo } if (!value.isNull()) { for (int i = 0; i < _action->topLevelItemCount(); i++) { XTreeWidgetItem *cursor = _action->topLevelItem(i); if (param.toString().left(1) == "F") _hotkey->setText(QString("F%1").arg(param.toString().right(1))); else if (param.toString().left(1) == "C") _hotkey->setText(QString("Ctrl+%1").arg(param.toString().right(1))); if (cursor->text(0) == value) { _action->setCurrentItem(cursor); _action->scrollToItem(cursor); break; } } } } return NoError; } void hotkey::sSave() { XSqlQuery hotkeySave; QString keyValue; if(_action->currentItem() == 0) { QMessageBox::information( this, tr("No Action Selected"), tr("You must select an Action before saving this Hotkey.") ); return; } if (_hotkey->currentText().left(1) == tr("F")) keyValue = QString("F%1").arg(_hotkey->currentText().right(1)); else if (_hotkey->currentText().left(5) == "Ctrl+") keyValue = QString("C%1").arg(_hotkey->currentText().right(1)); if (_currentUser) { _preferences->set(keyValue, _action->currentItem()->text(0)); _preferences->load(); } else { hotkeySave.prepare("SELECT setUserPreference(:username, :name, :value);"); hotkeySave.bindValue(":username", _username); hotkeySave.bindValue(":name", keyValue); hotkeySave.bindValue(":value", _action->currentItem()->text(0)); hotkeySave.exec(); } accept(); } qt-client-4.1.0/guiclient/hotkey.h000066400000000000000000000017541217451700100170600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef HOTKEY_H #define HOTKEY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_hotkey.h" class hotkey : public XDialog, public Ui::hotkey { Q_OBJECT public: hotkey(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~hotkey(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; bool _currentUser; QString _username; }; #endif // HOTKEY_H qt-client-4.1.0/guiclient/hotkey.ui000066400000000000000000000146551217451700100172520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. hotkey 0 0 542 281 Hot Key 5 7 0 5 0 0 5 0 Keystroke: Qt::AlignVCenter 7 0 0 0 193 16 Expanding Horizontal 0 0 Actions: 0 0 5 0 &Close &Save 10 41 Expanding Vertical XComboBox QComboBox
    xcombobox.h
    0
    XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _hotkey _action _save _close parameter.h _close clicked() hotkey reject()
    qt-client-4.1.0/guiclient/hotkeys.cpp000066400000000000000000000122401217451700100175660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "hotkeys.h" #include #include "hotkey.h" /* * Constructs a hotkeys as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ hotkeys::hotkeys(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_hotkey, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_hotkey, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_hotkey, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); _dirty = FALSE; _hotkey->addColumn(tr("Keystroke"), _itemColumn, Qt::AlignLeft ); _hotkey->addColumn(tr("Action"), -1, Qt::AlignLeft ); _hotkey->addColumn("key", 0, Qt::AlignLeft ); sFillList(); } hotkeys::~hotkeys() { // no need to delete child widgets, Qt does it all for us } void hotkeys::languageChange() { retranslateUi(this); } enum SetResponse hotkeys::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("username", &valid); if (valid) { _username->setText(param.toString()); _currentUser = FALSE; } param = pParams.value("currentUser", &valid); if (valid) { _username->setText(omfgThis->username()); _currentUser = TRUE; } sFillList(); return NoError; } void hotkeys::sFillList() { _hotkey->clear(); QString hotkey; QString action; char key; XTreeWidgetItem *last = 0; if (_currentUser) { for (key = '1'; key <= '9'; key++) { hotkey = QString("F%1").arg(key); action = _preferences->value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(tr("F%1").arg(key)), action, hotkey); } for (key = 'A'; key <= 'Z'; key++) { hotkey = QString("C%1").arg(key); action = _preferences->value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(QString("Ctrl+%1").arg(key)), action, hotkey); } for (key = '0'; key <= '9'; key++) { hotkey = QString("C%1").arg(key); action = _preferences->value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(QString("Ctrl+%1").arg(key)), action, hotkey); } } else { Preferences pref(_username->text()); for (key = '1'; key <= '9'; key++) { hotkey = QString("F%1").arg(key); action = pref.value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(tr("F%1").arg(key)), action, hotkey); } for (key = 'A'; key <= 'Z'; key++) { hotkey = QString("C%1").arg(key); action = pref.value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1,QVariant( QString("Ctrl+%1").arg(key)), action, hotkey); } for (key = '0'; key <= '9'; key++) { hotkey = QString("C%1").arg(key); action = pref.value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(QString("Ctrl+%1").arg(key)), action, hotkey); } } } void hotkeys::sNew() { ParameterList params; params.append("mode", "new"); if (_currentUser) params.append("currentUser"); else params.append("username", _username->text()); hotkey newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) { _dirty = TRUE; sFillList(); } } void hotkeys::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("hotkey", _hotkey->currentItem()->text(2)); if (_currentUser) params.append("currentUser"); else params.append("username", _username->text()); hotkey newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) { _dirty = TRUE; sFillList(); } } void hotkeys::sDelete() { XSqlQuery hotkeysDelete; if (_currentUser) { _preferences->remove(_hotkey->currentItem()->text(2)); _preferences->load(); } else { hotkeysDelete.prepare("SELECT deleteUserPreference(:username, :name) AS _result;"); hotkeysDelete.bindValue(":username", _username->text()); hotkeysDelete.bindValue(":name", _hotkey->currentItem()->text(2)); hotkeysDelete.exec(); } _dirty = TRUE; sFillList(); } void hotkeys::sClose() { if (_dirty) accept(); else reject(); } qt-client-4.1.0/guiclient/hotkeys.h000066400000000000000000000021151217451700100172330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef HOTKEYS_H #define HOTKEYS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_hotkeys.h" class hotkeys : public XDialog, public Ui::hotkeys { Q_OBJECT public: hotkeys(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~hotkeys(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sFillList(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sClose(); protected slots: virtual void languageChange(); private: bool _dirty; bool _currentUser; }; #endif // HOTKEYS_H qt-client-4.1.0/guiclient/hotkeys.ui000066400000000000000000000210611217451700100174220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. hotkeys 0 0 466 302 List Hot Keys 5 7 5 0 0 0 5 0 Username: Qt::AlignVCenter|Qt::AlignRight 7 5 0 0 Qt::AlignVCenter|Qt::AlignLeft 10 16 Expanding Vertical &Close 0 0 Hot Keys: 7 0 7 7 0 0 0 0 0 0 &New false &Edit false &Delete 20 184 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _hotkey _new _edit _delete _close _hotkey valid(bool) _edit setEnabled(bool) _hotkey valid(bool) _delete setEnabled(bool) _hotkey itemSelected(int) _edit animateClick()
    qt-client-4.1.0/guiclient/hunspell.pri000066400000000000000000000023571217451700100177520ustar00rootroot00000000000000HEADERS += ../hunspell/w_char.hxx \ ../hunspell/suggestmgr.hxx \ ../hunspell/replist.hxx \ ../hunspell/phonet.hxx \ ../hunspell/langnum.hxx \ ../hunspell/hunzip.hxx \ ../hunspell/hunspell.hxx \ ../hunspell/hunspell.h \ ../hunspell/htypes.hxx \ ../hunspell/hashmgr.hxx \ ../hunspell/filemgr.hxx \ ../hunspell/dictmgr.hxx \ ../hunspell/csutil.hxx \ ../hunspell/baseaffix.hxx \ ../hunspell/atypes.hxx \ ../hunspell/affixmgr.hxx \ ../hunspell/affentry.hxx \ ../hunspell/config.h SOURCES += ../hunspell/utf_info.cxx \ ../hunspell/suggestmgr.cxx \ ../hunspell/replist.cxx \ ../hunspell/phonet.cxx \ ../hunspell/hunzip.cxx \ ../hunspell/hunspell.cxx \ ../hunspell/hashmgr.cxx \ ../hunspell/filemgr.cxx \ ../hunspell/dictmgr.cxx \ ../hunspell/csutil.cxx \ ../hunspell/affixmgr.cxx \ ../hunspell/affentry.cxx DEFINES += HUNSPELL_STATIC OTHER_FILES += ../hunspell/license.myspell \ ../hunspell/license.hunspell qt-client-4.1.0/guiclient/idleShutdown.cpp000066400000000000000000000025661217451700100205630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "idleShutdown.h" #include #include idleShutdown::idleShutdown(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _secsRemaining = 60; _countMessage = _count->text(); _count->setText(_countMessage.arg(_secsRemaining)); startTimer(1000); } idleShutdown::~idleShutdown() { // no need to delete child widgets, Qt does it all for us } void idleShutdown::languageChange() { retranslateUi(this); } enum SetResponse idleShutdown::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("minutes", &valid); if (valid) _message->setText(_message->text().arg(param.toInt())); return NoError; } void idleShutdown::timerEvent(QTimerEvent*) { _secsRemaining--; if (_secsRemaining > 1) _count->setText(_countMessage.arg(_secsRemaining)); else accept(); } qt-client-4.1.0/guiclient/idleShutdown.h000066400000000000000000000020511217451700100202150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IDLESHUTDOWN_H #define IDLESHUTDOWN_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_idleShutdown.h" class idleShutdown : public XDialog, public Ui::idleShutdown { Q_OBJECT public: idleShutdown(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~idleShutdown(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void timerEvent( QTimerEvent * ); protected slots: virtual void languageChange(); private: int _secsRemaining; QString _countMessage; }; #endif // IDLESHUTDOWN_H qt-client-4.1.0/guiclient/idleShutdown.ui000066400000000000000000000070211217451700100204050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. idleShutdown 0 0 546 103 Idle Shutdown You have been idle for %1 minute(s). xTuple ERP will be closed unless you Cancel. Qt::AlignCenter Shutdown in %1 seconds Qt::AlignCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Cancel true Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 16 32 parameter.h _btnCancel pressed() idleShutdown reject() 256 78 20 20 qt-client-4.1.0/guiclient/image.cpp000066400000000000000000000132541217451700100171700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "image.h" #include #include #include #include #include #include #include #include image::image(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_fileList, SIGNAL(clicked()), this, SLOT(sFileList())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); #ifndef Q_WS_MAC _fileList->setMaximumWidth(25); #endif _image = new QLabel(); _image->setAlignment(Qt::AlignLeft | Qt::AlignTop); QScrollArea * scrollArea = new QScrollArea(); scrollArea->setWidgetResizable(true); scrollArea->setAlignment(Qt::AlignLeft | Qt::AlignTop); scrollArea->setWidget(_image); QHBoxLayout *layout = new QHBoxLayout; layout->setMargin(0); layout->addWidget(scrollArea); _imageFrame->setLayout(layout); } image::~image() { // no need to delete child widgets, Qt does it all for us } void image::languageChange() { retranslateUi(this); } enum SetResponse image::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("image_id", &valid); if (valid) { _imageid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; _filenameLit->hide(); _fileName->hide(); _fileList->hide(); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _filenameLit->hide(); _fileName->hide(); _fileList->hide(); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void image::populate() { XSqlQuery image; image.prepare( "SELECT image_name, image_descrip, image_data " "FROM image " "WHERE (image_id=:image_id);" ); image.bindValue(":image_id", _imageid); image.exec(); if (image.first()) { _name->setText(image.value("image_name").toString()); _descrip->setText(image.value("image_descrip").toString()); __image.loadFromData(QUUDecode(image.value("image_data").toString())); _image->setPixmap(QPixmap::fromImage(__image)); } } void image::sSave() { XSqlQuery newImage; if (__image.isNull()) { QMessageBox::warning(this, tr("No Image Specified"), tr("You must load an image before you may save this record.") ); return; } if (_mode == cNew) { XSqlQuery imageid("SELECT NEXTVAL('image_image_id_seq') AS _image_id"); if (imageid.first()) _imageid = imageid.value("_image_id").toInt(); // ToDo QImageWriter imageIo; QBuffer imageBuffer; QString imageString; imageBuffer.open(QIODevice::ReadWrite); imageIo.setDevice(&imageBuffer); imageIo.setFormat("PNG"); if (!imageIo.write(__image)) { QMessageBox::critical(this, tr("Error Saving Image"), tr("There was an error trying to save the image.") ); return; } imageBuffer.close(); imageString = QUUEncode(imageBuffer); newImage.prepare( "INSERT INTO image " "(image_id, image_name, image_descrip, image_data) " "VALUES " "(:image_id, :image_name, :image_descrip, :image_data);" ); newImage.bindValue(":image_id", _imageid); newImage.bindValue(":image_name", _name->text()); newImage.bindValue(":image_descrip", _descrip->toPlainText()); newImage.bindValue(":image_data", imageString); } else if (_mode == cEdit) { newImage.prepare( "UPDATE image " "SET image_name=:image_name, image_descrip=:image_descrip " "WHERE (image_id=:image_id);" ); newImage.bindValue(":image_id", _imageid); newImage.bindValue(":image_name", _name->text()); newImage.bindValue(":image_descrip", _descrip->toPlainText()); } newImage.exec(); done(_imageid); } void image::sFileList() { bool first = TRUE; bool havejpg = FALSE; QString frmtList = QString(tr("Images (")); QString ext = QString::null; QList list = QImageReader::supportedImageFormats(); for (int i = 0; i < list.size(); ++i) { if (!first) frmtList += QString(tr(" ")); ext = (list.at(i)).toLower(); if (ext == "jpeg") ext = "jpg"; if (ext != "jpg" || !havejpg) frmtList += QString(tr("*.")) + ext; if (ext == "jpg") havejpg = TRUE; first = FALSE; } frmtList += QString(tr(")")); if (first) frmtList = QString(tr("Images (*.png *.xpm *.jpg *.gif)")); // should I do this? _fileName->setText(QFileDialog::getOpenFileName( this, tr("Select Image File"), QString::null, frmtList)); if (_fileName->text().length()) { if(!__image.load(_fileName->text())) QMessageBox::warning(this, tr("Could not load file"), tr( "Could not load the selected file.\n" "The file is not an image, an unknown image format or is corrupt" ) ); _image->setPixmap(QPixmap::fromImage(__image)); } } qt-client-4.1.0/guiclient/image.h000066400000000000000000000020601217451700100166260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IMAGE_H #define IMAGE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_image.h" class image : public XDialog, public Ui::image { Q_OBJECT public: image(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~image(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sSave(); virtual void sFileList(); protected slots: virtual void languageChange(); private: int _mode; int _imageid; QImage __image; QLabel *_image; }; #endif // IMAGE_H qt-client-4.1.0/guiclient/image.ui000066400000000000000000000147001217451700100170200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. image 0 0 600 591 Image 5 5 5 File Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 5 ... 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 0 0 0 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 90 0 0 32767 120 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 1 1 QFrame::Box QFrame::Plain XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _fileName _fileList _name _descrip
    qt-client-4.1.0/guiclient/imageList.cpp000066400000000000000000000034061217451700100200220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "imageList.h" imageList::imageList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_image, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_image, SIGNAL(itemSelected(int)), _select, SLOT(animateClick())); _image->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "image_name" ); _image->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "image_descrip" ); } imageList::~imageList() { // no need to delete child widgets, Qt does it all for us } void imageList::languageChange() { retranslateUi(this); } enum SetResponse imageList::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("image_id", &valid); if (valid) _imageid = param.toInt(); else _imageid = -1; _image->populate( "SELECT image_id, image_name, firstLine(image_descrip) AS image_descrip " "FROM image " "ORDER BY image_name;", _imageid ); return NoError; } void imageList::sClose() { done(_imageid); } void imageList::sSelect() { done(_image->id()); } qt-client-4.1.0/guiclient/imageList.h000066400000000000000000000017711217451700100174720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IMAGELIST_H #define IMAGELIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_imageList.h" class imageList : public XDialog, public Ui::imageList { Q_OBJECT public: imageList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~imageList(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sClose(); virtual void sSelect(); protected slots: virtual void languageChange(); private: int _imageid; }; #endif // IMAGELIST_H qt-client-4.1.0/guiclient/imageList.ui000066400000000000000000000071461217451700100176620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. imageList 0 0 511 483 Image List 5 7 0 0 0 5 &Cancel false &Select 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _image _select _close parameter.h _image valid(bool) _select setEnabled(bool) _image itemSelected(int) _select animateClick()
    qt-client-4.1.0/guiclient/images.cpp000066400000000000000000000066501217451700100173550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "images.h" #include #include #include #include "image.h" #include "guiclient.h" images::images(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_image, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_image, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_image, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); _image->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "image_name"); _image->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "image_descrip"); _image->addColumn(tr("Size"), _qtyColumn, Qt::AlignRight,true, "image_size"); _image->addColumn(tr("Package"),_qtyColumn, Qt::AlignRight,false,"nspname"); connect(_image, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); sFillList(); } images::~images() { // no need to delete child widgets, Qt does it all for us } void images::languageChange() { retranslateUi(this); } void images::sNew() { ParameterList params; params.append("mode", "new"); image newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void images::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("image_id", _image->id()); image newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void images::sView() { ParameterList params; params.append("mode", "view"); params.append("image_id", _image->id()); image newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void images::sDelete() { XSqlQuery imagesDelete; imagesDelete.prepare( "DELETE FROM image " "WHERE (image_id=:image_id);" ); imagesDelete.bindValue(":image_id", _image->id()); imagesDelete.exec(); if (imagesDelete.lastError().type() != QSqlError::NoError) { systemError(this, imagesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void images::sFillList() { XSqlQuery imagesFillList; // Do not select image_data into the list imagesFillList.exec("SELECT image_id, image_name, image_descrip, LENGTH(image_data) AS image_size, " " CASE WHEN nspname='public' THEN ''" " ELSE nspname END AS nspname" " FROM image, pg_class, pg_namespace " " WHERE ((image.tableoid=pg_class.oid)" " AND (relnamespace=pg_namespace.oid))" "ORDER BY image_name;" ); _image->populate(imagesFillList); if (imagesFillList.lastError().type() != QSqlError::NoError) { systemError(this, imagesFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/images.h000066400000000000000000000016331217451700100170160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IMAGES_H #define IMAGES_H #include "xwidget.h" #include "ui_images.h" class images : public XWidget, public Ui::images { Q_OBJECT public: images(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~images(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // IMAGES_H qt-client-4.1.0/guiclient/images.ui000066400000000000000000000117041217451700100172040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. images 0 0 600 400 List Images 0 Images: &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _image _new _edit _view _delete _close _image valid(bool) _view setEnabled(bool) 20 20 20 20 _image valid(bool) _delete setEnabled(bool) 20 20 20 20 _close clicked() images close() 20 20 20 20 _image valid(bool) _edit setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/images/000077500000000000000000000000001217451700100166425ustar00rootroot00000000000000qt-client-4.1.0/guiclient/images/PurchaseOrder.png000077500000000000000000000037261217451700100221310ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœaIDATXÃÕ—Ë«eGÆ«ªöÞçÜsûÞ¾·_ytB· p¢ *!Á™8‘ œH2Á‰‚ÿ€ ˆ„@&‚"N¨¨ Ä„ˆ†ø ’6é€(¥SÉ¥  Y J!ŽËaßY­zö/¿ÁÕ+o•W¯xcLùó¾úž9Üí„Rä;H9[@‘B1€B©Ïk€²&]ÇñÝhŠŠÆg÷öö~ ¼ÐÜÿùÿþ³›sÈí|ÿÉ}’–»g­y껦ºÆr!eÅG­c-ïŠs!j!ÄD¿\réµòòÞò•K/¾ð­—þú§n<çO?þß°FH ÓÖrvÿzeÑBr|øþäÆ0÷ŠOŠ¥ÆTI1±€uà¶Ù]çÞsçÏïîî>v|÷¤ýãã_~⾇Ïqñ'߸=O<}ŸÊݧ·š§î-« Oþú"ÏþmÅóo)?züÓ˜SS^šGz¯ôcfé•Þ+KŸYŽëñ˜‰ó·yèÞ†[^ykñrïãçŒÈÅŸ|퓘Û2 ‚ÁŠÕñ‹?~~Ùqí#gi·;¦­0mMíeÒšÚ›»FèZ³~õjÂIfgÃoœûDãìQ$¨ÝHÁnvøûÎpÏ[œ~à›;&F9=ƒÞ)+§l:¡o”Ukè}¦ïLegb‰ÇÎpöÎ É®ä .vŽ@°¶:ûÂÝS~úõ $c0ΰ[H…ó|£DQBS%¤BÌ’Ôž«y7'›mñ­-œ‘£1àTpFqd0‘( ù4ïñYˆÒ°\ôŒ -ÃàY #ÞL|įVôL1)ð…ûwh\S&GÈÎj«PÅÆ€’Ø4 E2S+˜¦a Ú 8CßK+hc|ftBi9d6\]ŒÁš#°R‘#`»(óài7°PDhZ¡ë ˆ`[C/–‹é ckéÅtŽàÓÖÐXY{ë¶€Š@¯p-( ¯D-ŸX,"! j Ãà†@vŽÁGV} Ø¢çC§*«Ö‘g„R*¥Àq+lL,Ëì1t“–e×!bh'¼·xï˜ll2øÀb!4ÓcŒãÈñ©Åý/ XZj@®&åò˜/"AµÂb>âUÈ¢ ÃÈ8ŽD« >2ô=£É˜yäã³*p4ZÔ¬M¨*Û¦­¡ß°ˆ1´]˲mQ„¶ëð^HÑ2mâCd¹ºÊÀî†Å];”àH Jˆn¨° ‹A‰YQXÎc²†qd<Ù÷‘¾ïñ¶`sà+'¶iœÜLp7”¼„° L$xäÅcå‹;ûbe¡ ;0™Z–Ù‚Ú®cÙÆõ¸z`-“Ù1bŒ¬zËts‹Fv6,nÍèMʳÀóHx4½Íƒ>UA3|[¥ÄþØlµñÐi½ÒÇ“ j]ŠÌgòú‰/±\D¢ ÅÉzxh-£Œ«¹$ΞØÂóN rÛ@Î|ê÷±_[݉)®uh4J~+‘‚¡`mfwKhïÚf·3tÑ’‹`[Çh3ƒË¸IC0´ vÒQ4V0²>cML xóþýì÷X^~†ã'ïáúþE¦cµºNßD5û}·Â5Ÿ@K¡”²Þ¦uœU]WG¥ ”*s)y1´ƒªÙœD ƒGÔæ—ç—Áï•%vû !Á**¾|†”21rqôc&&ÅGÃ#Ž‚XWOÖ[M¬zˆÐLè_#ŒWYî½Æbï"6¾Ájð4n‚÷Ìh’ã䯄]8‡+\7‘[ëœÃ:QÐòÖ²Ö·2\e€¢Äåë„囤þÆ•0i…¡!(FP#L²#g©Ù A>°¶’ºV+f››5½ß€‰RZ3P”ÕÁsôW_ ÆDŒb؇C¬€Rv¤ôþSzï988`öööPUŒÌzõ‡ÉÍ…XW#h ,öžc&ØVðAjl ø@µ¯’:r~)%®\¹BJ‰ù|NÓ4U–úé{=0˜ BSƯBœàB¬„ð p‚!çæ´mË7888àŽ;îàÔ©SÌf³šU¥fXw«¬]3 5† ´R£])TRÖôƒ%pÎqîÜ9rÎloo3›Ín>3æ]gAи5€ Q׺ „XÓ¦RÄ*ÉM¹ž–ïg¼S§Ï5c!ëaž¨§ª3ÈM b¬Ú†°f !Z¢±ÄhqëhÖÑZ‡ÒPè8¸¾êÿ±ç¯ßÜj릥N¦¥Þk²‚¬°³qÖ,7 ¡ÞñB€é”¶Ý¡+3œ=N·ÕàlÃt¬ëÈY1ng!øƒWóËégø&šÞ± k6¬Ö¼¾¸f]×Väà´K Œ…œù]+cÔ°Ÿ%—Zl¨2h|U©?ÊB Áæ¬O]úîäåœáÑ'øÿlÿÑv_OæˆIEND®B`‚qt-client-4.1.0/guiclient/images/accounts.png000077500000000000000000000036761217451700100212060ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœIIDATXÃí”il\WÇÿ÷íï=‹=c=^âdœ¤ÆŽÇqšÅ¤ 1”Ö)M Q+Ñ€PR•¨¢‚ªR¡R -i„øˆ”ª-²´é’6‰6¶3Þg_ß¼ý½ËÓBš*|áùIWçÜ««£ŸŽÎ½Àîp‡ÿwÈ'¢Ñ(t]gk !b>_(qk²œ€7.œûŸ p%£££Ø½{&§®w÷÷|›RÚöìÙÚÄÌÌ©©©éïù|¾ÊÇÖ„€RÊøý~žçy/—ËÙ<Ïc``étš]×ÑÑq·¦i—.½Ç\¾rõÏ\-zÉdò&ö£Dñùpüø¯ùÁþ¾_Ä›k¡Z2Ö@f¨$ú,!Z^XXxÆÆÆÖîÛ·ïá½{÷>Ö××÷ I’ I§SWçææh"1ó­Í[¶¼Ø‹íÍfRÃsÓ—f¶2œôn&“N„B!†qk6w7‚:ݼ¯:^ÓßÖ…H´lYD·F`Oå[bÜð•á­Û¶½ÔÛÛ·ºT*¢Ï‚š8Za fÛ;âo ôÈOyaKbÑΕ1´«¯áZþx-òì¦ÍŸ›½Q, · Ü·!€=}r´³YŽ5(DÆ‚i«1pxle{4¾W>ðóñ{³³ã«gÝXºŠ»|*Fv ø=ã4šoÿI .:V«O”v #_b«°2—òf1•š×/eÚÖz—>m¸äiXUuÖ×0ô„¹hÿ’VfWX…¨U>___ÿƒÁ‡ŽêbM]îkþ|Ï~0,bä`e®€Ñæ1y2§Þ?Ò³fSGýÚzŸØ*àYpª9x ‡XÓÉ…[z¹óÍWþzáÖ8qNÃÁ/†½“o_MtÔ°[Mm«ªeMÍçŽÔâ§·„ïn8ØÛÙØ¥£„ãPׄUL@ЦÑÕ6›êkÏGøBv¥‹q Ù«&af¯Á,ÎçýÁºßHD…Ñæ«Gÿpãf£ƒŒBÛÐØ½wõ ÿð³çGÔéTØYÈ‘ õⳊ°¾”|¿ÒÝ^'s+rÄ­&af?€]^´›Z—DÖýmËWOT¿àoqÍÒ»²«¼³’y1ûÎÄ®6¥ÆMßü ~ü0ÁÖûœ¯®X»åŽŠÈ¡âkö±h”› C>«WswßHLi*SÔV?Oí*±Õ$Ìâ,l5}†uí[g¤ fè†ÒÍbc9?âºf P¶çÎ3?ks–O=ä^ÿÛ`æ?vöÇž>Çö H¼³ÞU¯Á hˆ7¢&V^âa%˜Z9d˜ú‡›:ÿª¨z¿£W¹z¶¥§Y3óxkf~z¼»ÿëÛúv  9ËÁA ‚H!@Só`<£¹'Nö¬›5zŸ3†œHhȳ,h[#² «õ €ãé¥ À@.†ÊÅÕ†'á—eøDŽç¡XÖ >Qf›‹‚ˆ<òàžÿ Ày åeò,(¥¾¦¦7^D) ÃòI@H¢> ¬®¤xÀ£€îyj&U3Q«°†m±9@å s2êdMÃj¼üÓ?ýû'ü4(õx KKU>©æÁ¬ Â[©< (<Q–/Z.HAQP#À1|XÊ•a»$ž‡n[ –j°px ”ÆC;ãåÜVà0€\°n>–Gɺ T- h8â‚óʰA¯9ÉX¯¹¤h ˵qkÊ‚uyÖ1KÛÙíÀS¸€€`6&8ꢎ«E©hY XÀp–»¡ZP ¢«!cȨ-·%“?}h¦`å,óà¿êM.‡'y,Opn+@ÁqÄu#¥F‘cx'" ¸±Pxp)P6—;`¸¨åÈ (™6C,ê2¬-K¢ËüDÙçnÞÞF€Àq „>Xdž¥~‘©X %cYÂñ–£éB±Á‚1¤t'›S3Åîð_ù'ÌTñyAÑ;IEND®B`‚qt-client-4.1.0/guiclient/images/apAging.png000077500000000000000000000044401217451700100207230ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ«IDATXÃÅ–[ŒžEÇ3ó¾ïwþ¾Ýîv—î¶Ú-ÛåÔ‚P,á˜Jˆ£‘ nD/L¼1&¢ Õ zaŒœ<…OQÅD£X9‹(¥¥--l·»Ûm÷|>|çï=ÍŒ»­¤Üø$“çÍä™ÿüžgžø?›X­ó‡ÏÍ"^¤Mk[¡ h ÆX´m,Æ‚¶c–½Ö†ââ3Sc”f+ž}²Ü±©‡Ég:{¾0‹µ\á(ñ˜§DZ[kµ±,7ˆWü;û‹ó³ÌÏLLÏ,yìÈdz…æÊôÓ»ßS€³Z§›\ßäwù†d&ˆ4§(DÆÆ–H[¢ØjK¤ Ql‰tc†£îæ áÏK\5<4ðõÍ·ïžzòž³ Ò@Ê“ôa ‘7Bn½­‹®m-LTbê±¥j¡¡¾âk¦ZÊuÅÎîv·½¥ù®ös:¦Ë!ߺô¯˜?|íêw­%WU%Ž('‡}žx®ÄÏߨ3¥%‘Ԁ2P4°[f#ôo˜lF«šqáïý3¸¦&Öµä>×ÙZؘÏ$φ(ŽL’b_®€sí9¤»šÉz’æ´ƒ+5®¸JàIABiβO:i°ƒ’¥µKó•6„þÀ)ÐvùûŽ[;Ùy]"ëÑ…ÝIK ,g bŸ•±$ˆ$~lˆµK>á2U΋&“’®Z5ßß›€c—ã“rt®‘„‘ÏÉÙµ@£e‚J¥J`¾VÔ«U|ëÒˆ~­JÝ&@ÇÜÜÕ„ë8¸®²îªÁ~Æ‚” Ãm,J:$1aPžÀq,F ´”b‹V’P *Ö¢Ej’ Ü•\Rò¬”) 4Ü$.# ®°$¤e±"¬‚P‚uÀ¸ $]‰£j%©Ï>+c,Y%Ô µÅ×c-VZmA@h ´ Wþq•X°<çY…ÀÚÿb\V ¬WA¨ÄrÅRãJ¤'ˆŒOb]‰V’¤'—C°ÒÎ*æ –ØBd-‘±˜·0–zdÂZhh•­®’Ë$8gG`û)#À^9ûÉ·ð$†¤ƒ©¸Œ«êX\Q@©RÈA+ƒN0ËÞNÀX¦*Œ$ïJüj…ÎŽvŒ|¼Ü§“b·9¹¿7´¶ºk×nîÿî7O¯%WÀéR|* öÔ†ñ$$dȺ‚pa’¬®q雹쒲I—¸^gèø Æ¿œŠ¦vrm}ìOÜ™LeRßðÑÿ„`‘B¬œå{[ V6Ž´ „ Š5k[[XZ\äù׎0\ÖÈT©$Vk„?•ow¢k·lhÛ‘Éæ>¶°°pß®ÝwÝóÕÕßÿª{M[Îù[Þ3•F†“Äb‚0ÆI¤)•*h颔KÚ_¢¿÷O½ÚÇG.ù(7_y!¥™qj ŸXz„ézû‡(;HwKÊd³é‡§&Æ¿‘L¦üU œ2 •J¡ƒD ‰«Œä3)B#i4ÆG'xê_G¹èêë¸uÇù„Œ% |œB†\ÚãâžMœÌeÜ÷’ÜG_Êå›öfsùÇßW@¡§©PXõíÇ1o¼5À_=DaËÅììÙÀäì"^6O¶}=•T “µSlPŸeîÄ12›¶2}üpjm>}÷àTÿžU$‹„ ÐcÅŠA™®–­YP«û  3TŒ¸éú- \z¿B*"ßµ9ßàxáüµñÚÏÝD¾³‹ñÅI•ùíJ9¿KÀ}÷R Š”ã¢[‰qhn€Þ¹,’ÖÜôøçJŒaõkü5LLÎ@¦€gÊõ­7slï‹”Ž Ðº©›¨‘H<•Igöå²y[ÈÖå²¹t6“!ŸÉcR!QC“) jóóx…545ð´.Îr^wéȧ»L Sž×{÷½þ£}¯½þc%…^ýŽ\Åî|æ H)=Ïó¶¥’©»Œ±Ÿ­TÊ푎BÛZ»ÿürX‰ïðQé캴ttO'hʦ1A].²05Y?pððOö8ô½B¡P>zð>°€Söã߯Z”çºÛ¿8=;5P‹j6ÿþüX¤å§6_¶Öns=/—H&¤£”1q\^ZZ:42:þÓÞ£}ÎòÁhÿ¾•¢÷!íÁéèLu:3õc0æwwìáŠ704ÐÛ,„Üf¬ÝjŒMû~£Z©TûfgfŽ\ÿ‰O•~ýÈýXÛ8=Ïð‚pÒþqÄIEND®B`‚qt-client-4.1.0/guiclient/images/arAging.png000077500000000000000000000044351217451700100207310ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ¨IDATXÃÍ—[Œ]UÇk¯}9×9sæÌtÚδC§NË¥¥ mPƒ\¢1<1’ETŒ ú@šHx@M ŠŠ>1¨Ñ¨$B$#„”j mi¡7¦ÓN§s=s9ç̹ì³Ï¾­åÔË(™6ð ßËÞ;Yk}¿ýÿþßÚ{Áÿ8ħ™üðŸö´·§œoŒ–½ð­©øYKÒØû஋^ÃüÄÙ©4³¥Úg1ÅÕ²}…uM‡}üµ?ì9þÚ¿Ö™–Õ+¥™¨Õª^­VŸŸ›ïèè žüéO8røàÅ+p9ƒ(`\Ò(tÃÆ•ðÂÂ.£²íþ]½+:6ÛWlX³2gø¥ùã7®ˆªµ…êöre¡Ðò}‰Ò‘ãX%)Í}^Ë{frbâõT*ýðû. ðèÝP+a­îïþn¾Ð³K‡e«¨Èe¯s·-7Þ³C:é„+¸¾Ç¦OÍrðíw81]%¡b±GoFrIOwEJ¹{v¦ø„“Hx?zèþå¿GP+é–]7¿f'’[DvÉD’ÑjÌóµq ëI%lïŠé¬ ñç×\;È-×^IP›ÃkùøÂ¤i¶ñÞÉ!âs'ؼº=pûÇÃCï=–ï(DËzÀ¶À±Á±MÇ®½þtN7Xš'—”tX1bnŒç^}‹U[wò¥Ïn!8S›Aù.™ö.:òmdÓ[9UèàäÛ{ìõ™ºW÷N%S/-`BÂaHL [{Ò\±*AÅáÙÄèä¦m˜+W0S2ݽx©Ó͈¨Ü$¨iÏ`¯`zìD®3—ùÎðÄ©× 8H"¤#>R0)Mü0âìÙqNÎ6¹jËf¤eóÞ±w:N%ÐLµ4Ú´ Y¦|æÉL†µ—mAg xMo»ã$/_VËÛƒ! !hµ|fgg0¥d¡î1>Y$N¶‘±õV@¢½À‰{P§†éèß„[žÁŒš\¶ózœ\·éÑìéÅ;UÊGQté² XrQƒCÄ‹ªØ6ÝÝÝtvuá8ÕziÙL e®8EWß6Ýt;³Scüí±‰%¶}îVúúûhs š¥­-ƒ!M3ŽUnYL –õ>€Po4hÔkh¥‚ Z#RíĦMÕ ð­$×Ýù5®ìN³åºí´wæ‘Bcâv´S¯bJ#v›ncyJ &H á L&C2á µFÏ—I§’М¢häñ} S5ɤl ¹6n¹‚;M:eáX’¤-±ìAŽ÷" Þ¨»§—¬ß~w|ázš^ CÿÒ×Ef…iN´okÎvš!ð<¦Û Ct¬èìÌÓ¡O359M°²‹‚£hK¯À@¡ò+õqìV¥“$-›R£p븮{¼83st À–«˜Ÿ/%ÒéÔ›×ße"Yª¤Ä\ûUr6˜¡+LpLi ”B›ú9vüÉèüvŒLŽXC³^'^pÉ$;pN#±ù<·Net¿^ ¦¦ŠÏmݺ¥$?  ŒŽ ç‚0xH¹Vš–,tvù|‡›®Ó½z « i\×¥Õjáí¹,ASžî·ZÁ€dªV«™ ƒðë^+èVZ M‹XÁØØ87±¹5µZ )§j­è*´³°P¥13M³8Ž |¶C&A)˜u53#g™?7íßà÷ù~{>_9¼ï奟c!B­4QG1Ji”^“Íf1ŒÅVJ‘ËåøÊ—ogÿ¡£¼±w?sÃG?{’d2ɤe#…Ou¡|zøÌôSC§†ŸËfÛjGö¿¼Øiç~!†!0 CJ i „Áy2™Ì’ñQ¬I;wî¤oý §GF™š*2Qò ñWnØø:¶ÑúùMOy¿L´u1yæÐ‡­¾4óûf½¨/hV­5Jë%Õ† Rø¡Â ~¤°SYÖoºœ5.#3O¾ÈŽMEtŒWzüúÄÒ½fÉ“^„P*F)…:ŸTkE¬Ô¥ˆ•Æ­Pá¿úá‡0^ ¨5šÈ¦OèƒPâü ê (@ˆÅûó À¢7”‚ i“@øÑyˆà<@¤¨¸!U·ÅäÜ…š‹ A(Ðó÷±Àˆjo`iH C ,Ÿ·F_eD½F6¹†Mù«1TˆRCfQXøÚ ˆ XnrnÞe¢ÜbM2K䃡ùØø.Öz‘Å –!sÎEç,Í+4 )©AŒl†7Z9WÜG$ÕŒf7¶Ÿ?¢VšÆ ZlÙ vpAg ‡úœ ÿIDATXÃÅ–ylÕÇ¿ïÍ›Ùû²½¾ã#>bâšÄpš&Ž‚ â’@jiŠ€R(¢*U+ ­ZAi¡…µMQ*4E”Ò–4p…¨’àBHœø¾ÛëõîÌîìœû^ÿX¯7TUE¥þFO3ó¤y¿Ïïû;4ÀÿÙìzå0úñ}¸òªk剉ñH>ï)¥¥DÐþ Úqþzs|d¿~øžÿ-À·|œ‹0“ÈõÙ¬¶¥²"Þ‹„#¦íPð„a9YÃ0Æ<ŠòV xA’è”åüü;yño{@àƒâ!ñùùôÚÄ\ry.g¸¶mŸÔu½;iûßÛ‹wÞ|õ,éÕW_Ñ£Ÿ~WSSÛÛZ›V^ºq}ùôÔTdxh4ìñzÃ--Mee¥¥MŽc_ «&&Æ_y+à½wϽðWì=ð,:Ú¾¸yptò©ãC·MÌ¥×%RZ—–É^+8ß8Ÿšï[Óµ~Êr)Ƈ{—°ò¨B.¿ææÖšeuRr^űÞA8‚`e{"Ñâe¥Èå Ø¦Žþþ¦}oïUJJblÿÍNÔ.«ÇÍÕ\t¤g`çHRWµ¬Hx5u²hxDSQŸï©CÝÝ_©¬¬îýWôö#³³³˜š<…±Ñ1”W”#Âv9²º ˶Ñ?0„žã'…m[Èh@eUba¯ÒÓ7vïDÚ(Û¸¡K›™Í>:ÜŸžš$yKSy¾? Ü †îÜõ̶ûÖ â£ýo- ”À±-¤Ó)€P¸yÓ´‹Å¸® Ë´A Q „R@8ãðÊ©DjuYE…EÀd*•J%çæˆ“Kq3;ïØfŽTT¼ F»V_¸9âõùÔ³ B ×B{…=BJå_XÕ†çw…^Üý†hk®¯±8‰p%äfuÃÊ»®Ë¨p­¼c:f.×Öã%Q'äËL–eÎùÙ) „J)¡g ΋J@)…¢(+W´4¾ÞÜÔq¼œR50Å/c¬7©¹Ëjª'”Qʨ$ƒJžuëÖ•Õ-«ëH&æ§>úàMmu׿%¸àà‚…¡tA–çÁ@À·éKU×UWz{{•SSÓŠ×ãQêk«¨¤§”áéT¥–gaÝ¢ø#µ ÍuUµË7¥Ó™s‡v?òËvbzâl(¡‚€@QXœî ù „ gxÿÀ!TTÄÑÚ¶áP‘p“Ð^ÇǽŸb4•-%`Á@¤: TŒuÎÎ̼ñýÝ/}xä&GOž !”J gD_È?ë §ëèþ°åå(-+E$F(†?@JÓ&=Ž×až•<ïÂÎd†uË:Xî•ïªDÇÃû÷voòÊbŸé,M À9_\…è Ò‹…!òœÃÈÈd2д ²Y¦eÃqó°-33³ØY[Qz™"‘/Ú?xãUíußúfS ~AÜ÷ÒO6o¸èž[nB¼X_§ŠVðXð)Ó D± $‰‚J(! ´  %„:Å´,ýÀ‡‡N=³ã±‰GÓÖÁ²†¾ûwÏ7%êWF=íûäDÝ]º–BD¡· %_ä+!p: œóÓ5² Qáà\œÞpå+‡°é‘›ù‘„ö¤œù{sjh}gmü¡ƒ'‚·6ןBJ (¥‹‹ÐBd„ÓÀ <‹©!E>g(»hšhòÔ¨=‰±ãmnò«W\°êîgFéÕÑÐé±´ ‘ŠÂ:Ã!8À)‡åÍ"«$áÀ\T‚, 3*I‹»5`OZàê(zf ÷’S½Z•=ÿ7ê*.;·ªdàŒ@Ä/§y ÄÎÑ¡v cnår+st.Cy{buËáF@=„ ÷¿ûýÅ3¶Í;Ï àµ1ÃýEÀÒúê|DïŒÉ s€R0Æ@©T˜† — L ÁÆ1Ñ8©£4Ú€šèy¨‰t¢,ÐEöÀÄ vpAg ‡úœHIDATXÃå—iŒ^UÇg¹÷¾Û¬ïL;»O+`[¦Pµ, µ‰¢¤a1ý‚F@Bƒ !.ÔEˆ‰¸Õ€q)›iÀÀ P(,3Ò23íL§³¼óNç]îvÎñÃ;-B‰h…O>ŸÎ½¹Ï=¿óüŸç9çÀÿ»‰Suv@Î=ÚˆSûÕ)yõ§cÑ'·:Çüzd~"…¨ž™Qï?À˵!„¯¤¸áÀàôíõ0Í.]Ú~ObÜí@ù¼6ÿýøûLŒ”"‡ãÖþ©[úöMfƒ@SìÌ›+‹Û,âVãøTwö½xr2BIÑ’¦ö[ý“×MOÖüO~d¾¯Ø±ë¡uné²ö„R7‡¤\µ<ÿ¿<6VÇXRtÆqúý×LoUƪ‹ÖÍ'çIê©£žéŸ¢TIè^Ôò¸ôô—¥` J _ém?u€¿ŒÔ ‹”â´0Lî8|øØ–bV‹uËÚ¨&–©º¡Yb㈭ch¬Êl%b޼³Ê××ûJ¾T‰R¾}~ç°­ÿHôDaz×ÄdíâbÞ£¥9ÑJÊtݦŽÄ8Rã0ÖaT«1.N)¶g_•žº¾5£þ6^Iùéæ®ÿàç¯Îàpĺ$1wO•Ãj­0B2š“¦öM€Ä@jã8±hkho H%oØÑ_tSO†ßnYôî?{i‚JšÁ—ɹ8î.ÏÖׄõÒ‡¸4"‰"’($CÒ4Å)T€SFúDø„xHÉeFËÍCGkêh ìÎk–½`ýmÛI­›¿l^ÓYYO kS˜îÖÖ¦¯Kí­4Ö!Ñh{pÎaÃÚFèëÀ:H-D©%4Ž(“ǘ Uài^!kqjÌÔwÚwޱî~%•—ÏÂ÷©=_ií9O+á{ _+´–H)R …@°pBŽ8µ„±%L õ8%ŒRâ$uI’t˜$û=—FƙإÖÅ.‚¿*ÝûÂÄTOUw­Z¹(5Ako¹O ãö}£¥¥ûú‹‡â§%-­ÍL•±÷ð$ƒSUF¦«Œ–«)×XØ™G¨€©Ò4ãUÆKeF÷f;ïé]Õ=@[…Ñľ‘Ò­³õûŒµ/ë*úÐ?0ò«¾cÛ[ózñ®•­Q¥6røÀcã¶ÄG†z]¤XP$¦‰R•׆& F+…R%%Ë»[0NPšžåètBZŸ¥zt”Ùì‚]çõ¬èxf?ŸoKóáÕgö¼¼eãê}À €>ž Ç5µÎá!¡Ö~cŒÀ9pO#e€§%Z6 <¥H‡’\Ö'%ƒÍæ2>9ÏãôbÄH¼kÑ cûÞÙ1¶qé¹÷lX°á×úíUàæ` zë'©sžFk­Z)´”h¥° ÙÀ#u I6Ë¢¶¦|¦²§§ïàƒ›èr8Óõà+tí=òÚ»6uÅ'àÇ«TH=Óxo¬Ãó4žçãÍ%æq)¬3€ ø¤.%ÉdíÇ—»«v¼òç5 8ºŸ'úŸ`qûb·váÚ=9ôŽpn®A !J5özç@+‰S­žÖ Q‡)Èf|gèêj‘Õèé¯OÿÙKßh›ÎØÞø±ïÝ´jÓwÇgÆÇNŽÀÛú”P­$ZÉ€bÿ“ôä¦)´´“onÂu®Æ÷Öã\‚”‚ « ¼«;cž~H¼6ÖÇhy„Ë7\ÝtÁÍßÙ°bý’jvÍï:q¤:Y‰F&"µ‡§5JÉPE3ÁšÎv”XÈtUqî‚*¾/€Ò•S,énfÊßÍ‹Ó/2Á—øj6¯¾eä7OÔ·}áîÇC¿Ð8¸è“× r®A !ž‡ž+5()ð ÍôO7ñpeó–XÎO J7œ”’è¼OwK‰moì ž ¹pÙ…\´ì<׺=ƒmݼ¹î“Dcb!Ñž@KA6Ÿçó÷±6Dg3ƒsðrŽaOQÕ‚ŽŸŠyža;ÄŠ…ËÝ{¿¿t¨#ˆÌž’DîÍ-è%sÙ&¤Di¯Ñ~…@ÑÈМâôl‰e«–0ÕT£T~€µ F)|6Y§ñZ|®Z}噵D&EÍ-ì_Mw|u¡®Ùt—þÅ£×ùIjH¬³‘Ë:夯¹Fù%©Á:E†}£5º>ØËQgrvˆÉt’ba€3oÿ(}æ6žv.[?ýûƒå¤n¬½,µV”ŸÖ <¾ôP²d^µþòëh+ø½—\¶æÞ¸_l’¸Í“‹tlènË­ZØÞt·æhÉx(Öd[æQk_È\Êió×1¿ÈÃcÛ9èrV×”7ÍséSl)ÜÀŽgŠ{'Ξž©¶«Ç•)\ \š¹ô¬®gNÖÐQj±ŽÖr=9ß82§ñƒlFk}›§ÉxšŒ/ [ê;–ôKl,±K©„1õ(VÖ¹ág§s7ªÝ±Ù9Djab©&– 6øžÀÓ¥R âðS‰qŽZl9ZmrWοâÒZ2{ç¨7Ú²V®¼ów¯s‡Ê[Kb,ÆÚã¹ñ^[ýP·×©Ý3»oÛ9»sxbjâC¥ré]ýNùrúNV+tâqÉÌìÌýQÕ{Võü[Ÿÿœa–è¦IEND®B`‚qt-client-4.1.0/guiclient/images/billingSelections.png000077500000000000000000000041311217451700100230230ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœäIDATXÃÅ—[¬UÇkï™ùfÎ÷}=—žÓz9J¯J X¡*FÄ€â 7ƒÁI}ñÅ_àIÓxIð‚1}ñLL)Pz!€’ÆB -œÓ–sùÎí»Ì}öÞ>|§…Ðk‚‰+Y³²÷dfýöZÿ¬ÌÀÿÙä“¿~aÀ·Î5EŒuXƵ`ÃX0Îa-Äq—¹™)çg«nœv•8ûÆï÷\Àûä†Àq‹ˆ<¡45-`ô£C‹`qX'(q(+Xq DƒCC˜"Ém™½xîܹ}À ½õ~̉¿_;@å\cuÓß¾s}‚PKeyi¨ TÆQYKi ²®¿6ŽÊ:ò¢FgÝÇOG_ë+îçÁŸ?öþþ§þÖØýCÛ;ü§«h% +"÷8y²Eœ€W‹øâî5,VŽnn¡Lé°¥¥rëȬ#G‘ ††êÜ»mëæCƒƒOŒ®¾>‰¢è™ÅÏÝ̱}?ºx ´Þy{Ž£GfxæåEÇGøËíkh˜Êqnéå–^fé妿Π½ÜÒM+¢T1·Ø6¾j¬Ñhü¤rúà ›ÕÒ±}Ÿ¨øE"h%xJh§>û^Žy«1„ݵŽZè1PSÔCE½¦©×Ô˱zôj#¼:#¬ }}“³f“­ª«·ÀS‚u…£¾v ÷ÜÀú†ÙqãõÈcL J„Ä·$"©Y’\“D–87$…%),qîªVÖ˜èùAÞN"OÉÕ”íçàΛܺ-À‰B©Š¤ÛaÀo!w¥†2pb(|GBQÙ¾PµÂ  ÑôÐç¿´­%B7MXКÂXÒÔ²¸ØÁèÜ ¥6…„äFˆã˜´2ç“¥)i^ѳ5V{÷m_Ö‚V\€§À¹~%”5„E†ïMÏ'Ð~hqh:ø5Á¢é„Ь¬Ö$‰¦*Ázº2Ô<é‹ZÉ%.+B%‚ÔÁ•%¸ócÓ8úóªïç燖þ àœCD<…·œüš4 Ë-2çpÆÑ­R8Œ³t2ÆP9HRCi…J,IjÈ C!†Êxýi%¨‹Ž{ hÕ"À°'5M*ÂQš>µ¨†(MW ‚ö#zqbŠasYn,Ï—k¬€»P~9gKKEE;®pEAavõ…U$½„ÒB!i’‘—–Lk‚ŠGÖžÅSöZä€sg-£j5E§®‰|D4mÏÇ”öHbƒçyµˆV«ÍÄÔ»Ìvæé-õxöÕUL¦×IV…^sÅ@q%ܲjEQŠVa©rËRlqyIé vÑšÂV¤qÎ|w–·þó,fáßl¼þ:VRØ‚7ß;Î{3g¢gß~¼5ûaÈþI@Åá+µ`YÕÐWþu~¿÷íÒ#Œ”Ötj!µ(ÂóNMN³÷¹½Ü²e=ü8a‘•í´Í¹Åsl™Ÿ”ñÉ5w:~è–‰©‰_Ú¶ýw“ñüeZÀÇÎkÀ¤†¥^EIi v¾¦·xö¹ßòÀwq÷îo2Ýžf©ÛfØ Ó>ÝF*:´Y1ÚdÇÛS>>Lg¼Ão¸{É ¨e†<…(ÂPDQ|üÐçÉWþÊö ã|m××™˜›`1_@´P´ ^|þEv>¸ž[äƒø½IÊ4T+ÔOívû/ñA"8éGœÃ:GbRYÚ¥E‹Á ô2ËB릧Žñ½G~Ì™…3,d t«6µ Àw>eYÒ1 œˆÿE«œ£ 2†¢nk«R•ï©Þ¶G.øÈaâpDÚbë šÊ ~³Á¡c/0:¸ƒ¡“wÈ\ŠUây ‚RŠ\w i4ב&s‹‹ˆÌã¬ûJº©ØpYç ÑhÐl4X}~S.\xéðÍzÜ䌌S–%‹RŠ™l– ãøÒàm|yÍ]XëpÞX<ÂŸßøE^­²™¿BúÉD.7Í2Ò2¥›u9}ä4GÅZ‹ˆæ)Î9N½{ßë·C‹fÛwƨ‡ôº™_Uý*W¶ú@¹3sL.L2²y˜[¯ßI! AàQœP:p˜;¾»ÆR’$§Ì-³ê,ž|ß+ÀÖõ[yúàÓ}ï(]¿Mîu¨j=¶¬ÛÈý7ïaîÜ<Þ¦„3#o²¸Ðju˜ž^ÂW¾òg¬±Ÿ `×çwQ˜‚ýG÷ãi†VFŒŽ5)òS³”eI¯›2gº$qAçP)šÞ3féå…ƒñYõiÖŽ­åÑ{ÅåŽ<-ÈóŠ4-HÓA¨JC/Ιmu˜›ïÆë£Ídi9Çñ¾ÏÜ7f. à”Æ]Ñ+ ß¿{í~—Açôz­¥EºÍEv|{+­lŽé鼬Éí+¿A¯“%“³“¿øðí£ùlyñ¿á¡S=œã6OË‘/µ«UA)͹¹3<öÔü×§|vpe£62Üdlx˜¡f“Áh-+·1ÞÜÄ«§¶^9ùÒÏfÎÌ>Ùl6‹©½m.¡A o–ÆÝçV®à0¬[½‘¯n½Ëýôo¥^¾'ó¶W¾nh¯.¾4ÍÉÉæÿ1ÿÂÁ‰Öû¿k½¿ÒõíÔÞör¶ÿ•í^`„&7‘·±x5”mgey¼\pï°’”ýÀÙû/Z6ë™2»?IEND®B`‚qt-client-4.1.0/guiclient/images/boms.png000077500000000000000000000035461217451700100203230ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœñIDATXÃÍ–MˆWÇçã}ï{ï{3™É4cfˆi‰ZQ„’EÑ–Ö"©T\TÑ• ©›âÂV° ºêNéÎ…(ˆXQÛR*-JZ¬¶MšÓf’ÌGrïÜ÷=ç<‹÷ÎÔé¤dŠ"žÍË9œsžßù?ÿ÷9Çð_h_|òw GãFžûî¥Õµuç}xáñ/ìk­ýOƒò»¿à/Vý©“Kß8yäàWŽÿÒ ßy˜G~yåàO0ÄÑm6–ÞØŒ÷ö²î™#+K÷öGîŽ6ßÂ?òÔm·0·›ð­‡áÚ+MáÛ-³hµa¦ãÐâçG~úÑ_úæj•ßû¾#‡Æ—×ùùëé׋Æ÷x_ªL‹*ˆ’BÔÒôôº?€'1”c9xxéñîÜá»e¼®{{œµŸ2['»kzöÀÂk‰EÑ ÓΙk¦·Žýý±ówÞü΂`5cU~A’yòaÁÁù‚»Úž©¦£]X¦šÙáæÌ×ëÅ9\f`õy|ïeTíKžF °€ÜƒSLæ0eˆ»çQŽ-¯pq}Äù³×ie†NÓÐ) •'œM£87Â.aùØãŒÍ ¯þækÌ _ƒµ’Nl´€X*¼U2M+åÓÇ×Xž[a¶9ƒÈdG&_­¿<çõ„A)rÀ ÎBLûÈ|ý«XÎZ’$VGWyî³ 7‡ø¡cÓ7ÑíÀïh‡¦ÀBÞ¨Mg¸¸_nàm†"œ¹y†|>羕û¸pîýqÿ]×èv@øb`Aü{P ™ãÈ]΋ aöœ\õýɘZÅo+`÷«€wÛ)ˆ#ÀíŒÄ]s[­EQìkijÁå“Êç@Ã~¬AT±P“vÆ«Tñúõ×Q¯LS,,,Ðív÷ì!ýrG«`<ˆÝ'€³5µ!`Œ$±^nðì¹g¸qã÷Ÿ¼Ÿ™Æ Š¢ª ƒ]ë‹FŽP+à`T1óÔ€Ñ!EžY{–Ô œ^9ÍÅs¹.½ëú•åeD;ˆUlŒ‚õTö`Mm$#Eð®àÁ¥Q%¬õX+p‹ßPU‰¢”APS{À˜ìíé;ò"‹(_¡#*)‰Ž†¼Ù[›;"¿ö=ʲƒˆ’’Ð è¹S”î.Ù)@ªEUÂ8ج°9uuûw€Á{æ7{<údz9çZ ï*‘̃¤ÙÚO¸(‚·Š÷†Ó–´0Oš>ÎÒáEæHI(ƒR†DÂ2îÅú:°qµw„P˽yMÅ)>|ê+\?÷+æ–?εsàÀ'X¿üW¦¦ ú›WÉìg¨pèÐ"í•y‡b©**±„¤Œƒ’¨ ÔÁ÷˜°ªjƒÄÍ"£ÕjÓÈ3ŠFNæ_DË«„¸Nت0.¢ÞáLÆ•ÕkhuŽ#UBTBBRfç)c‡$/Qçû°K3I…Æ>eÿa¼IÿÊó 7þAÚ¸ÄhÔÆä#Ê‘G3ðêq™#!V‰ãNàmˆ¼JŒ£’¢R{€úq²W´¾¥4mQn]bÜ{ƒ°þ:U9ƒóB†Ê@¨Ïb-1:ª „(T!â )1Õ&U‘4Žh04ÝBt[-¶®þ‰r°FNE'†2€ÃPU£`¬Å'KY Ui¶;L5§)c†ÍaÅÒ°º¾N«×GBf H¼…*µâð*½Õ+”U€²2XUeÈÊ Œ¬·dÑ‘·fiXÄ7𨼅A¢"eŸ~%œ¿²Æ‡¬'Uu)FAÂ-Øã>ck©Ò¨‚Á¥ ¦îcpÑ“ãú¨`4š¦êUT±GˆÊÖ`ÈåËoòææ€ãGrÄ ŽÁMŠ`ªn ©T+R‰ÁL$÷®É&j9ÀKŒ¿úSá Š"&‘$ÑéèM>2ŸsG£K;¼„HjŒ&H•dw œ­Ò6€Ö¹®¢Á§ ‡Ú²†%%ÇûiX:^$ã=è*CT† cR¸F,_!U¤r¤¨—SU_J{Hb¨XÊ@ Jgj%J1”¥Á)9RrzùÕ0Û<ÿ[58ããcTM‚FA¢M¼„;Ò½&´DŒiµgñY“Œ.^3säfŸ¦i¸HrŠÜS´¦÷ÿÉÆ*¯\ÿýæs_~òvWÛÞöÎB4Bõl+u• NúˆZr¹ˆ%ÓkÄÒâÕP-ã0ÚÚÔ$l¤ðރフêÂpA•Ï¥XšJRªÇ%Õj§ë¾¤É g¾Ë£øÿ¿ý p¦ïv&^E_IEND®B`‚qt-client-4.1.0/guiclient/images/boos.png000077500000000000000000000043061217451700100203200ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœQIDATXÃ¥—Yh]ÇÇ3g¹Ww‘t%Y–-ÉJdÙqÙØqbÇÁÍÖf¤!…¶„œ<”ÐÒ…¼¤”–BC(…¦}H—‡”6RJ]’RRH!¤IIIlc;Ž-ï•íh³µYºÛ9gÎÌׇ+Ë"Ž’æÜ{Üù~óÿ–™Ï`ßý#?}uσϿ¶÷…'^ü×="Bç3ÿ¸î9Ôgøò/ÿI6ð»7¬jÿýL-=6frýä[ŸÊh¦_z¬÷ºæÐŸÖyþk¿f×_ÿ O–w˜t}…Þþä¦ÛלÛñúË |6žß©XûæÈk¶”ššP¡ÅùKúT!³æñoÜzcçCÓ¦%_jc²œ21ï.´µ^¹éü+/Ý1ö£j6¯•p"$ÖÉ„óØóru€Ÿ=©H¬hïêýC{Wÿ[ŸgæPé<³&û­ß;VßÓ>Ÿúz¬¦IuH1Ÿ¡5ÐÜ从ò_7þ9 ¢°¢ž^VJxø9Á¿€ïŽ®•ý[¶)IZmÇ ¹Ö•hs`¼• ùsQBS–îRÞ#jš2š\ÆÓMá]*ø1:FDàì.2µaúvO«—SÛPàŠ¯Ðˆò=ETž¡kÛ÷ذén40ºÿÞ¹ íy–,4g ù0E+@ žOA¸önîéåèD•™‰½´™a¨ÀW$†kÐ$xÚâ+!ç7&~|S “6ƒ"‚ ˆ,~ žç‘Ëûh,J Ùx—be<MЧjI¶dÂLx}Õ"Öö„0l$cà_ʾ«(РU<µ `zzŠÉÉ©ër½½«p"àçPê×ð½­–OY”R $†$I¿¯a ÁJÓçƒ8ð³`ÜõêRœs×§ýsðÀÏ4¾{pöZZáDP¤he“FDpÎ]¦€Rê²w"‡u‚ø‚—u½žrh ÚÅ Ò%“ÊâXjÝÝÝtvv^¾z{12 ,è¬ÃK¯°ûƒcܾq-oýå™.í)_ÂeT£#ÇOx°¼«›Rk‘ A<Ï»b¬¥Ag€Tð Ý厞&Ž#”R]{ÿŽ]ñÄÎá³#…NOSÙ¿p´ä›X±|7ôõÐQ*ú­õ¢:K-zzWaày‚.€„à}¼½ð(Q½ŽÖºßóÛ£GßÿÆ{ª)—¥¹½ƒ l'13!'rã‡G¸¡‡MÖÒQj¾Ì94* 2cOƒÕÐÉÇÒ$EiÝnùÕž½xuÏI6lßÁÎmë)OŽqa~žZlÈ­\ÍÉñiŽíßÇÌÁcÔêu¶m¾…®Î¶F½/Ê.¸T¨'–Ä ™%^Ö_ðö{àœCÃÓ'NœzøµÝ'¸íÞÏóÐæ~j Õ(Æz!‰utµ ·nåè~Ÿ¡ãÇɆ!ÅÂFr¹&œÖ Æ 8G”4ÚoT†òcÀÚðz«•ÊÎ7ß?¨—¯¿•íëz›š![h![ê@ÎÍGع:6ª2qh7™|‰(ßÎÉSg¸óŽ- Gl„$µÄ©%Ž$uø«‹J,…44º[šÚÛFÇ&VŸ©À¦õ«qÚçÄÐa>Üýfk1µ?Úå“ûÈdCúÖÒ¹n Õ‡œ¤¥ÔcG=I©%Žzb©G’J#z?‰IˆâøT.ZW™åœ*1aBFæjÄÎÑ” Øø…Gè)uJ[s–ÖB†¾5k(ærâhÊpʧž8"ã¨ÄŽÑé #SsLÍÌR¯Öq\zi,&a'DõhoS6{¶5gtâ<çækDósèFé"™&¤¥“pn-G“¯‰&ϣŲ|e/)š(i¬¼j±áì¬aº9lB"ºà˜$¡uYûÿ*•ꮾö³C#CHëm¨lNÀÃôÈòí„ÃCHiÊ SãÓ¨ùY.Äše-ìû(ƤŽ(6LOO2<6I=Õܱ±ŸR9·(½Óà–vÂg¾¹“Ÿüü7¢µ~±¥¹¸£»<¾}îôvÃíh­±Q¹áô,ßN¶©@X¯22Sezô8}ùwi»p;+($Ži®”Ykj,_¾‚•QŽ|z|@¡´`,9–GqŒIÌYÏ÷¾ÕÖRüž›ØZ;ðV¯#Ó½‚Ö®U¤‘a$ÛCuè v~–‰áC tœáÞ-+ñ|€â*ˆT[A\›œ$M*H¾ŽK4b©šTáì'\L¾ýìsØÔâyÞ€1æ‡II”nÉŠä‹E²aˆ¯„¤V5#££ûÖæÞzïñ{Ê6“/¢< Ú ” A\‚8ƒK ΜIcqü 8¬€¯¸O¾=ùô³(¥2&5[18kE$/NÒ8IÎÌÍ—ßžššyó¾»ïœ|ùÏ£zþŸÖ®z²Ü|çISKKs.HãÏ—Ën|d$ñƒP¦Ç}j§KíÿS yÑÄŽ×QIEND®B`‚qt-client-4.1.0/guiclient/images/clear.png000066400000000000000000000016521217451700100204420ustar00rootroot00000000000000‰PNG  IHDRóÿatEXtSoftwareAdobe ImageReadyqÉe<$iTXtXML:com.adobe.xmp m•neIDATxÚbüÿÿ?%€qÔ€QF .ýZ/áN@ÎIEND®B`‚qt-client-4.1.0/guiclient/images/community.png000066400000000000000000000041151217451700100213750ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœØIDATXÃí—Y¬ßEÇ?ó[ÿûr·Þ{»r¡ ;eÙU ZQ4!FåÔL /* (F£DÑ‚ ‰šBK¨B)ôriïÒÞ¥w¿ÿõ·ÌüfƇ*XzKc '9Éy˜Ì÷33gæœí6qÆ#ÛÁóœ — nÜ6¸mh :†^.úVʬ1s|uzü±£4žjBŸ…åÿ€7pÙÚRnçµ»o¸ùºóîÞ9²áêÞZap ¯’|ÏAÍv¶°Ôh½167>:¾ðÇ—þ]sìgã8W[ÌþÿÀ¹ŠÇ÷þ‰Çøá¹wܺû›®Ùu×Eçn*…¡GK”ÊX^mãz³ÇH“„r¹B;RöÀë“ãû^}ìÕ¿üU®·ÖM¦ž8­Œ».UþcX¹oÝÿã›îýÒMO|᮫nÙ12á` fštTŠÞžˆ€nbÐÚˆÞrOoåøÃSÇæ÷W·\×M–Fyù=Ü÷à=Ü÷Í'nþÜ—ý⊋6ïìé© ´Ak‹¶c-n!P™¦V-ÒéÆ4Z1펤I|Ïu«åÜn¥õ¦‰‰¹}¥áݱ\yõý¼m_fè¬!^zqô‚/~æÚ_ÞvãÅ;–[Ì/®R¯UÀq1ŽÀ 组9Ÿ|!ÇZ»Ë«‡¦é¤$Q,éF)X+ÂÀ» Jd8?vto~ë5:[{íôAße¬½q¤xë'¯~tÏmWÜ Ç XmÆÔê%Â|ˆ\ë„çÉŒ“K´´‡ÔE’¨›E)Ý(Å‚0F_ØF¼ÕSðÉM7’ͽøî¢ÿ”v|•C½´ªÅ_yÉÈ®ëÐh%( ‰Ì,6(ÕJ8®Ž@ªŒN¢8¸Øb^ø¨À"c…Ò•dÈH"S‰”)¹0,ÖjåoL4Ô³•“vý¿¯ÃØs >²gÏç‡jùÕfŒÊ,Ê R×ãGWXŠW^´–±ì_¤KT!Gìyd(RmiuS–gt—š˜,ÅßÕ¾{y¹ä^ï˜ì)÷ÎÇÑOýd°ñ¼­CêW Ív‚Ê@9*ô1¥2‡"Móà1¶lé§:P#u]šÝ”ÀMYXë2¾Ôfar9ÛÀ¬´@%`%žPx>¡-Vom¾ðý§‚;‚~ïäBŸÀww”‹¹ íNBª,J ”㢠(á J9áòæ\“Às)8p~™ õS® "3^˜o²æ»XG€#°TfY†.Š‹ý»]Á÷[§A>ç#e¶Ye:h¶cRi‘ZyÞ ÊuÈüª˜§[éÄ’MÆb­¥/ïséæ:ÃÎûáµÅÆØ“_<ÏDPÅNhµºhDõÅ—ßæ‚s=õ*)ܹ`, ­ •jf.»ò.ýEâD‘¤2ÍÈ»çoí%ˆŽM/²²²F¢-Vlæm+àf§&¡6øæøR“•æý½ôõÕ lI¢bEÔ•4ÈVè#Ÿ¦£h–}Ç%é¦¤Ñ ÷­ÃUzËcG ‡'Úà¹Ø|ÑÚ\ÁZ½€)–ÀõVÝA)Éìü*Ç—»øa§XÀÖ‹èj[É#J9œ\À¥Ø¯Ç¹äœM¤‘$i''B¢HœäIEND®B`‚qt-client-4.1.0/guiclient/images/contacts.png000077500000000000000000000042171217451700100211750ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœIDATXÃí–iŒUÇç]ï{÷Yî™Î”vÚÒ)eÚBm±uj[Å–¢! ljIA¨Á úTJ¢Ä/`¢—h ”/Ø5Ú©2m§vÒÙ—{ç½Ë»/~ @¡ÆÄ„/ü?žäœçwþÏr|¤ô!Kü?[¼x1óóóÊÚµkó™L&S©TâJ¥2£iZÝu]Nœ8qÑåR^{íµ jëÖ­+655µ8Ž“œ­ÍÏÏ©ªZ³m›Ó§O³}ûvLÓLmذáÆîîî›r¹ÜSSSù£ýÇèïï?266öˆ¢¨gÞ/Æûôôô`š¦ÞÙÙ¹c×®]·wtt¬õ<¯ixxXí;rÄ›ž™ùÇôôôƒŠ¢LôööòÚk¯É»wï~të¶íß\ºd©6:zÒÜÕ¹Qp滎=g4&¿ÛÕÕ5sêÔ©wÅ’ß¼··—½{÷ràÀû·mÛþ‹M›7¯ÕµDã…ÑÑÄàà mbdÈ(ÏM_Q·=/N÷EQä …¶l6û“D0Uœ9Jiäí‰n¸Ö4—86*Ö¯^wÍLooÏþ}ûö]ÚZ­FgggÃÇ7mºcäÌ@rfø0•Љð+ô,ò¹½+ɾ¾Púu_þÛW­ß0S(ž}þ·/{i¯}ïgv²¾ç$B$ßÄ/Ÿ¡3_çàÉ㯕K3ÿ=¥R7ˆ9zø€ÔӾЛo¹Y5HH²_Æ/¦Q­°ÿܤ\6«êšUKøóS·¶Z£‡ªÝ]ËP I1ˆ ˆ‘ÑÁ®öª0§o¹2­|bƒ{ûûÞà­‚½[™4ù³†>·eÝúÆÂ"„’ lÂjH,´6¦øb·UÿÃgN+Õ—74²¹µs³°&«Yäd#±3KT½€oͱbi«±²Ø~kÿá×_ÌJ²û5г\ðýgž¥U­ÞóéµÙ»ó™”!«’$#KÖ'ñKC¸ås´5§å;v.‘Í7þÖôëé†ñ°>½’ Þˆ_#¨Mâ™ð̱PÀo ]ûÑúž.ýõ¼pðR È0öÊchvП-¶Åõ±DPÖ’R`‚$šç ­Y"ߊ3™bIñ‡ÿ%.MŠwõª¶Ÿ[ãG“>Ñ“‘=/E¾…W pkÇÊôcõÙáÑqñØy—ûÏÂ}jˆÊ… ‰Æö—üÚd¿¾‘Ð%´Ëøµ)üÊ8^mz*ðì;²Åå¿êX±ÒYu_{¶¨Dƒ–UéòÊ8 qB¥b×Í=nÛšC­gGxúðÅ-ÿ“pôù«!ŽÖHjê/²žéŒ‰ mß1±ÊãO­|Çʉp×Ïb&Š«W®ÞxnîÜ•ª~þºË’×aä±'MóÕ|ñ…«²ýZ=î«NV1ðxüsà-ݱ©…öô±éé²QœÒõ„®j ˜µà`yjvÏhC¼uÆU»¿Ú}Û]›îznó’Í÷7~V¨-Y4š6‘ƒ(ñê2õšð²ŽË2Ënv$gEÝ®W®Wæ£õ쿨 ïŽ ]ÿZÇ=/-é0Yµÿ˵íø§HæÓ8áòùZÇã¯?øD_´a ¿îOÚ¶ëªÅër‡JqÓu¾ÜL©®Ð I˜iÁx2@ aE•‚œ”ïV,¥-¨w’¦ôž"ü!P1ººº{Çή¯¯\UXñÜÏ+#ƒ‹8Õ—eUÆ&¯*œ­/ïɶ}¥µŒ[Å—â£/ÎJÖM'™h?AÆÐiÌfQ“¾ªbD1mŽË|½Îlu’ªR!ÔÃO²ÁËïøð8--ÏÞ·sçåO|lã"}pÔb¸P[z3i[)Êu„œ`<[¤¢¥È„PBCTòœ¬Ðö°Cf¹NÞHÒ”ÎN$ˆªm£Haáú>®ãk~^Ž<ù6€|oé²e »3YC?~Ú䨄ƒe¨Ð”£œo§œÒAàPu©–mNÍZˆâÑ&¢¿/¥«kš„¦‘1 Ù,’¨²ŒÔ—¤¦£ë*¡ù–o½ m™ãÄíoœ¬`©*çì˜(­A>r ÐdðB0UP%ˆbb7„Zˆ;²˜Ð9BGÄqüvpU–QdÝÕ‘#‰Œ–&•”‹SwN ž!~G HÍÇç´óãZ2XI(¤ ¥BN‡bR¸áHƒ@̓´‡ï¦°jõ¼CŶ‘% UQ¨;^ Ú +BQšŒ–æ©¦T"¼wÄ?årÉEN⌶àŒ$@•!©AsœÜ**J"&ÔÂPÐå ¦’È× ÛóÞ¶¿ê8$ãf<;ÄN„èr¢‰Føx <ò&@P„¢ƒ2!9l/\°Ü Àò¡êA-Ü>†ŒdQP%й†h¶$¦”¦ª†1uÇA•e‚(Âñ}ÕNü "IJн¸&b¡ã‚>Ð À‡Ð#-Õðã»æAÅCYÛóÓàРX^ß7ÈI –ùêÎ{ëk~zD¶e9Œ"Y&Š"¼ DW ¼(ijë ͱ—…$P @ˆƒr犠Y]àset„Xp"©.¤Ä UbRfÒuñmáIjÓÌF'¸ÿw£CC·]4YOðû‹Öbb!`(B„µ8v‡@ SF–H(Ù ÕÇ yO( ~„°|šóŠ‘“cðƒÈ²,EÓ.ùϽHJÇ!yï@…P‘ýhÁꔺðNÇ,t€$ ˆN€êÄžDuÎáßçkøžUBúŸ>Ò‡®ÿ– êçGb¶;IEND®B`‚qt-client-4.1.0/guiclient/images/customerInformationWorkbench.png000077500000000000000000000041641217451700100252720ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœÿIDATXÃí•YlT×Çÿçnsg»ãÏŒÇ0lŒ±] lJÔ&¥1$¨%] ªP¥>R#R©ªPËÒD­"E"QIJ¥Vm’¦…’R6³„B($cÛãe°=ž}îܹûéJJ„*µÍKùIGçÓy8úéÓ·xÄ#þß!ÿú‰DP*•˜¹sçz !Žt:“ã8VcyçÏžù¯ pxòËí¸sçvckkÛ÷(¥­]]]ÞØààñ¾¾þÜnwákB@)e$Iâyž·S©”Áó<ÚÚÚH$¸ŽŽŽ¦šššEŠ¢Ô\½ú!s­ûú_nööD"öØØØ}ìÇËíÆðs[[~Q[å}ž*cÑ0 ¢kÑ…H>Ÿ€ÎÎÎÇ6lØðܺuë¶¶´´lEçz Dbüúðð0Å¿»xÉ’_VE£ë’ã †ûo<>\Êp╉‰DÌï÷CUÕ3°¸1ÛläÝÅOkuB‘F°y¥A=žžT¥þyÏ,XºlÙ¯š›[färYdÒIP-SÉ´ù|eÉ)5µïÏo›½)Ýgu‘Å.ù«=8íá&ý¡7´káâ':†‡²™LæA¯Î“ÐÞR©«rFÃ.F‡¦fõ¨ØÖ9mJ¤v½sÓK׿’ê™1d B/ɘ閱âIo1fåñ‘){|H§·t#·²m¢µs@ úÄ5øí!ô”®&§˜“ƒ.\ý¬àÆN@/ÊCîðüÚ]c?- Õ虨ž?[^^þÃù_{©Ä»©¯/±vÕF0,¢¦ OtƒQFpçݔܹ¢©~AMùcån0dÀÖaSðñ ¶­¯¯ã‚“g»œuï>vîÁ8xFÁ–5Aû—¯Ç¦zXŸ!/+ÊyEN§v|µ'¾°lEðé…áÍÍu ®²áx¨¥AÏÆ (ýh¨ j‘roWŸœ€)ÏblÕe Z²zv$í- Ié0£Œ_~{àþ ¼¼¹ 鱬`NZÕ¾b¦kÃùÿnê&-c¯ûÙ£ew—É©îwoh²Æ„l${$Ö-¥aî‚XšQ?¹º8ÂNÞ‘×óÉâ¸Y.±9„õ45ÿfâì©Üab5î¢÷·áOž#XôÔVôuŸ|6mxjÌ[Uï‚ óp:ž8ÑÆ¥M¦¹Õg.}~yÓœ¿ëViJIÆ6è…Q˜zñô-ÇÓG/ s;ÆG*UKR}œªAó:<´E£Võ‡{jÃ&vغÐõ©6\ÙìÿѶeAÙN‘7çXr/$E¸¶žh9x‘‡¡æ )y¿ª•n-œ|½P(µš¥ìt«”‡¡GÇýíÇO%ª·d WÑ´hC–'¬f„ÉB‘è¸ASZä«ô,ÛûÑ‹®|([X-hÖqëžÀ› &ÕÁ #ù³Ð7ÕÁkü>øƒøüe „@Ót(E ý£““«öý8åN¿WvÇš šìPad lSô¦ŠúöUKx…“Ë^æòŽ<¡~ Ê4 ‹q»…™>^6Ô^4Š’‘3N`,œ8Í,JœºaûsE I#0tšªPj!žòã\ÿ jŸêlšouë­¢æ8"ލÔ03ÖPQ5j!£rÄ¥‹ = kÂç`^ô¡hçXËan„„ƒ ø8Õl —¢ÁAxQ7,Á.dr`%¹ˆ‚LÉ{—W S›7Æ# CF £“¿ñY8 ü¾ V" Þ°‘ÎÛPâ~ˆå^H. AàÐB >§»(•,½úJJ‘ÒMl!8((r¬Àƒgë໳›†ÔæÝŽ Õ‹)H³,hu’áé€K@Ž·a;KE ’¡iA0S5ˆ ¨3Cõ¡}EnËÉ1t¤‘·÷÷gîȃ] ”º++s\â.r>'t·øE â‚.ä-ŠT£:qWzû¡¨4‡ˆb‘ƒ!z¡¤<¾rcÎÛ`TNÖ‰€K Í×áOûƒyت¤Ô`…GG‹|Ï4FEØ„xpñ@ÈD<8m†ô׃OÞ@îî5˜Yò-Šñ.—Þ¼ £'¡WçAKLÓ† ®Šm+·¥OâÙÀ`„ ¬U„›å‘Sý@ÉŠ:UŽªÙ8–(ÇìB%‚fR&§àB±gŒÊwlVóMCx•Ò‰ ºÈi–ቩ™W—³Ë* `h€ŽZp^ä²*TTó^6d¼b ?|0X¶PeŒ- ~ÿ6ü,L3Bè^@ßÏ0,•ç¹ÿÿÿœsïsž˜E;S&®“é Éu¢¼ „ÄM¬fõŒ…ßl3h'èìãEAÜÇ ?G¦o±à¯GöàÝ4dq¼lÕCqã"šÌüÛõpvÏBq³&Èäe?¸\þc_R{þ¾2¾éG†æ{à»™ ÷•šÃïиˆ@3wÓ×.àÜ“7hæûä>2 kÅ#ª.Ù‚ÝA½'qÃ_[s_Øþxãì ñø0A$h5ôÝu|ZŽpzò‰ ¢NÙE·é^³CõÑ%›±+èMÈ/>ËÅç;è»ê¿Ü¾9Z¸JÐ1GA¾óª+^mqZµó2}ÒùÉoþþ Øtz·2ò4Ý_£ûÞÄîÝJÐ!ÀÞúÏ·dŠKÈÈæ ¿|ûµ ˆ ²ý«\|ò3ë°_^س•ø=÷_Žë¹?õmE^ˆýãû[æÐ#›Ÿ€sOÝ(ìêäz5ï^‰—D¢Þ‡ »OãA,Nûƒ‰/ìJ¿‹H„—÷­ sA&;ˈ©½sRôÏ¿/Ãa¹ž'¶óiìC%íûRŸ$¦çdäp¸ñòÐ2Q4Û-Zæã:ºï%3Òð14&=7R_Ú2óé݆P5^Ü7V¢÷NÏÅI]_!ZtE@uŠ—®ð…}tÝÀœ¬”ÌmK@¥d^ÇâÎMd—L¥°=_v ›’L‰×SìéTJºq7È}‚Öû×. õ~‚Q7áHÊñ¿*%†°´ãvò+“pÞdóÛó…óŒü :’T°C)×e©ã¬Í¯¦c5õd—Oóål¼"‰gRß-»<ÁêXM~5X‹&D•’?Á`n%Ÿ£ö[ò·]%C½‹Oa|Òì“îô4móÒ¯©ÿìÅ=vc0úhB>:DáÎŽÈÅÈNð«““Ñy'­ó4Þ6ˆó!@<š6ϵYI|x’]lï• ìøÒ\ ÂbÙ&<ÑüÃ;éú*ÕgÚ@ëŸdf¯>“`ï¤yź¶²¼RòqG±ó‹ä–%©5×ÿß[P?Cnõ?séÉ«éÌOýß“JÉ"¼†E…;ȯ¢ö*ùõišMíÚ F‚Ó¸¥XvúºÜŒREüKók(ldô@š‡=D-)ÿÿ‚µÅ²J;¸a»6¼zG7ãXí8—^Lˆ ‰’ÃÍߺPª´‹Û¶€??h˹GjØ€õ7yŽ‘ŸROn_°¡XV‹²Ùë{9h·|ö.cc£^Yw(›á›Ó¡}¸gõЭãqÜðö›'\÷€×^Ù¯1)–§ øGiüNëã§þtlVäðo8¥Í‹‡EIEND®B`‚qt-client-4.1.0/guiclient/images/dspEvents.png000066400000000000000000000032151217451700100213240ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœIDATXõ–]ŒU†Ÿµ¿ï;ÿsf:?8Ó´ Q;’(F«Æ¢rA!þDå‚ Q ‰ /´‰& ^è…A½ÑnLImb %š ¨´ÅƶXÚÑB;Lç§sÎÌ™sÎ÷³÷^^œiõÂΜCêºÚ+ïû®w­½özˆ¹¦HÐgªä cæË„1K¨›ÇD™kÌ1úp÷˜ÒMÒÂÏ· êDU&$?ð¥ û¦o|»DÅšzMjË>^zMmóipi}åäµ°ðÄ(ê’H‚ü}ÑÈ®ïç'¿ðîÜõŸÀ”®C]Š&ËøæÛØÚ?°KÓ±[=sÛÜ 2£ ƒŸ?öÎ,þr>®“ïÿf+ø»•`àfÔµÐøšÔPÛD]ÍØ¥×° /¿ ÙêW‘ðŸâ-ý{_•#¼:ù8¨"aé3ÑõŸúAå£?¬˜ÊVp1®9‹Æó¨‹xPA@8ò0|Ò.}»öu¢Rc£"ÍFæø¤>ôïx¤4õà©lE³&¶v¿ö/Ô5AˆvP ˆéœÃÁI‚-;ï%*ÞC”gõOŸ~'@Ââîhì#·[&Ѭ«¿Ž&K ¾C,Š $ € ¨Þ˜3Å/ãã"Q¾7‹¿Ç”Ç\uw8ôÞ>Å5ÞÄÇ »é¸\1WÈ1‚Åä«HaË.“+Þ AÔ£ É™£Då›$WÁ§u´}4C±¾‹ÿõHhP ”uA £ÂüáUGíjC(˜n iЦ1š´Ñ¸Æ­Žýí5|{ [‹š&k–­&lá¦.“Opö× w{‘~ƒ‚zÔ¹Nõ&èìU}£GCe÷MáÍf C÷Ÿíô5Ki–Õ¤ObüzõÚn¢í&¾ÝB3‰5Ih+±4W7%ï΀4Eiâ’çpîN¼gÑ D‚Îk$Å!„â9ß8÷7 ôíy±+èMþÆ9°8ûŠfIÛ¯_;;•ûö&7ŠZ=Õ:þÊ‚[]‘w-à¿â-TkØ Mãνo7Ð4Ô·£IûÌà}¬¶]ö* ,_y\¼"¦HþÆ»‰&ñ‹’O2ôÀ™®»›Ë­ˆ—Ï'ã‰rÅ÷J}åëvbKÛxkúwoËü›/Jp±§Šºú–_Žï<ümTݽ;†‚ýý~.ôÉ ‰V³3—Ì‘C/½qç»Ë£GwÙ“‹éÎ{ùaæìÍÖ*©…‰;©.êÜüKTúª=9Ðõ üøg¿á©ß Z)ŽñB>bD ï]ÿ°tA·‰[o˜`ê}7WEÌÞr©0‰ÅeÆ„Œ ÓŠ“ù$ÓýãÛÆš·|ˆ7NM_[Nø;ÿì=«+µý"âADÈçsdÖ’Z½ejêƒï˜0£££×¾Ó‡Ÿåχ~12c­[)”«äŠÚ‰åÄÉÓLOO¿piyùé_<þ=FQ·°½Ý‚ݱ‡8n‡ƒ_þV©XÚÞXk¤³.<·¼¼ð“ ˆÎªZNùÿ#`×íwqüÈ3|í¡½ƒccccƘx¥¾rÞIúè#½Âño9k9Ú©PW²IEND®B`‚qt-client-4.1.0/guiclient/images/dspInventoryAvailabilityByPlannerCode.png000077500000000000000000000035401217451700100270220ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœëIDATXÃí—Û‹]WÇ?k­½Ï>·œ3·œÌÉL®MjKÓ¢­¶­6”¶`¡"Ò_õðMD}Ѿ‹RP°Ð‡Šˆ ¢­V´5™´Éd&M&“L¦É\Μ9·½×ÚëâÞF£ÒQŸô‹ßÞ°ÙëËçw[ þoÿë&vû ¼ (ÀÑ F ä€-|°[°ò² tÎHJúÞÑÏøÿ£]xØÚ‚fƒ¯¬,ò…Þ+@(ô |ð(ÅRÅÊ¿ßsnw» 0–VàÞ#´ßY>|b|æüh™(.ƒíâlJ$3ò´O¬FÔ•†°Ù€÷~odY±jµ)N>ð4ÃÛB%utç<é0Ý%š8 TÑZ DÀï­ Â&‡`‡¤Ý÷ußÛ t÷]t–IOjJX©QoR¬Ý£ؼðÞ¥dÛ‹ ×ÞÂê5„(aLÀIÐZà• ¶΀@°'9 5dºàtŸí•7ÈÒÞ‚L " Ú¼$6"×;ö* ûƒÂëá6;À±oÖàdZà%ä6˜¢¾÷Œ@ð;¬'Càx B ´E öB`ó=Îç@;Ÿ „dâ ¹SST5{D€°“„^BŒ Þ;¤(ãƒÂAV@Ūh B🠂*3 O”¯ÿÙ¬WQOLcx’¼ÖBIùPBJ…3=r«±g¿Û˜˜||jñ…/ߌoÍ…ö#йLÈV ¡ÏûÞ™þÏ $-£yi­Ãk != xÐæ9³Áƒ Ygƒo4ǨŒOð­Þ€È;˜[žfT9½´ÚU«Ô:Ø®^º<wªùkùÐá­e_ Ð=úâ?Ès(U©Ü\ãÌ܇Ô*ûˆc°Ù6Ic³-âXâÍ€¤d«en&¼ù‘¨Ÿ½ù‹GYÚcñÖ$fï;vþâ[ÇŽœÈèî9VŽ#~sÅ–6.ÇùJ wáÒÝ´†Ri ‡N>KkªM¤<½õJ±cûÖ;Húh"JQŽóeL:Àe0Å\×OÐIf¹.Í_äĉ“Ü{ÿ½\œ¿Ä¹ù ´góÇõÓGÓÞægÏ<ýôN=òMÞ}ûÍ¿ 0´gÁe·Ðƒ€±k 7æ¤ E÷r_ÇŪE²™ Rßb£_fd:H)˜Øß&©±Õé UL£9N:êa²f\©T¿ôÊôÚ±cÇ×ß}ûMäßȲb®»l¬wîò/uɳ­Ú-×InÆ@·—×g Š¢YKõ·¨%j­ ^cMÆì)Jäô¶·N…ÀãI9¹;Æ€…Ó_¢×7 Gh“àDQçÂCîI”+\¿›ŸáìÒ©Ê0¹fö`gvå§´d……µˆãÇÎPŠ%·×7É­+ë<þ¯½ú«G?ý¬¿‹€1Åv®0Ü^G›¢Ói]ôüb.L^^yã#1Ëþö,ÃaÊüÅ‹TëM*I‰F~‰ñ©i´1,.,à´fŽ âÒíƒíúæú­» HvŽV:ÇÉ„Xí´Z Ò òP ŸR®0)Ô[÷ï«7'”÷Žû'¸~í*+K8~x ç ÉoröjÊ¡™i*µ*B&[ë~üÉzE½ÊSšÈ¿(Ú·ªÕ£eÔêé•Ñ;?|}ü%¥Z›çßú÷Ü÷J™³ñ>ñŒhÝ«h!·6‘«öZnxOí>0ÿµÕcô{Ý÷¥b¿,‰S3ˆ–W®.¯Þ\þz))[]^"ËRpsùÚûÕZ¥œÔ+ë`’Õµ•Û͵oÏ´§~¿ëÍèÃl|²…u¶Öl4N+)÷ol¬Ï ýyŠëÊBB(OLN>ÚlŽÏ¦Y6¿¹Ù9_.'ÿÆ¡í¿l¤?ؽÕ&˜IEND®B`‚qt-client-4.1.0/guiclient/images/dspPlannedOrdersByPlannerCode.png000077500000000000000000000043001217451700100252250ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœKIDATXÃí—[Œ]UÇkßÎmÎeæœ33v:ÓË”)-ЖÛ”b!€bM_¥j ÑðЈEMÔHôAbŒ1i10bú`Œ·[i´@J/"µÓé\:—sæÌ¹ïû^ˇ)­5TÓ7ý’ì•ýßßúíÿÚ߷׆ÿÇÿzˆë¹w _Fñ·®­ûi/`¡µwîýsk× (ÄêHŠÇl‡Xuä߀.évR숛ÏæoÀ…JÈDò«2Û×h»8|d†‰Ðõ›ôDòà|Km7uÁ·s7@µQæÖ]IcǃûEÆØ×h;·îjM<›ÃJ¦äнu®°{¸sEïÁ’³ñdǵÓïìÿþ ¡4 ¹ÌÎÊüÅüñ?¶ÆÇξd˜¦ oʵѢ€ôý'<Û~ÊþË1½ÞŽžy} ÎÖ1 Š@I‚F®eýlܺ}Øv_:8SZülί|>?j«k;­L’­L¤r‹“Ï䛥WÆô,3õBAFKx²Z†Ð#³mW,yó†}zL|¥xy()A)Âf¯²@.gdÍÐp6•|nÆS;<š×vàS/åØXk׉²žfc,/Ϋ@ÈfbKÊs Z"*Í Êód:s1§PÜg—ÊFÝWßÔµÀŽ”"j5ñüÖøyRõ&ë,s¨­ëf}¹7g2úqKpÈWW‚:x!(W$ÉúyßC†á¯<9y–Ðv8•`Fï%7·Rþñ'Ê"Vµõu¿#FP[ÄÓMoÞÈL$0ÆÇXûö‰!·m˜ñÔÞ¬ÁèCºà·‘ºp¥' ¤”´.œÇžŸGci „Ên@³Â‰žÛøîÑÓfŒu}kØ’Ÿµ–Iõ¤-AÊ(\¬P½ë^~6W§Ñn3¼~…‹3ÜâMÙQx`ÖS{3£»¤À8´Z  ÿËrø…´&z¦æWH£AG»Þ¹u¹ót§I=P³(JÏIEhüµê°¢€|gŽZµÂT#…nË Õ—ìj½Là3 Š=ËX›NÓj5™Õ …`ƒ¦ Qô Ÿ‡’‚†qé¹sšR{¥dù\¹FR«‘ÑÉÄt>£KæˆKÊÀ#ÓšÆ÷:ˆ÷-#9]g]×éÍâíHö_ð›œ:ÿgâV¯ZKT­Ñ_¯` (ÁA®eš Œ»:„  ®FË÷b Ð…B×@ ë]€¦$n ”d{PÂo–h½9Áí^µIE¼.mŽô§Ñ× Sè_í¦Aµ]e¼6ÎÄ€šŒª@FÁ{mÁXn ðìx6í„F츭¥ãÒX©ÍÝ€.C±;à¸>hùð¼WcnÛVÝó8½ý4Ý&•Ö•V…Ù ·rê¶3üú­c¬m’»ÏA\B¨+5N­Lmò<åH!¾ç’q=ýX1P ¡iÔzÖ° -<×Ãu<~ñmäƒ{Øÿ‰/bûm¦kSÔÜ*5·FÝ­Ó¤AW1ÃЖÛùsܧ»(î{QO¼W†pZP+sÊÕy-¾œ SSÌ.øì,vñ„YE .UƒÆéì gŒãc㜞=Cþ¦›ùÖßc¡U¦âThøušAƒ\:G »Ì¸‹LÙoNÐJ;Ù¤-?²N®× FµËvU¢ ¤T©2;_4tÃü—þ†óóe¦fgYgxd×jN¹æ‹Þ°Š­“yî,Ü…2|.¸Ã1jX)ˆwZ2§=æ–0ËMÆiÃâF\"7¸d»‹iîd‡WäÎnbÇ·rBÅ)·±4 S3çU$Ç…ºãÒâꚆ¯ ª ø@ÈKŸb N¸t© t+ý#â€VÐÈäãtwg(³»ÓÜ›ÚÃÂQŸì}gµ7©Ô4ªªçÜäøOι¸×—·ØR^÷ö Ý5¢$:(]y¿pÅ2ß‹pÝÇöiÔ]Ú]m¬].o:Çq=Ï– &‡ywáÜl«Ý:¸êžb¨ÿ'“^m x•iVã s·2•¥éBPŠÉæ­1lÛ#CÍ]w3Sžkœ8ùµ‰ïT~•¸Åâ¿˜îœ AY 6 ]K[F K‹a‰]Vë;7sKöÞž<9{ôÝWöOžŸûqaG:š¶q}Fﻀ «Ù¢gôdzé½]Åîb¶ ç’Ù(”aiº69:½0y°òŽ{<Ñ#¤óœº\€7.>ؘX©%YeÄ´„8A Çå<“tðâÕ·üæ®ï¡Dþ“‚IEND®B`‚qt-client-4.1.0/guiclient/images/dspPurchaseReqByPlannerCode.png000077500000000000000000000046631217451700100247230ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ >IDATXÕ—kŒ_ÇYÆïÌœsþ—½¯w_²‰í6„X¤‚@I‰Z¢¨ÐB) *%PT ‰"@jâ _‚¨„T$DDTD”R(*M…ŒËmêÔD)I›Æ‰{g7û·÷ò¿œÛÌ™>œu¸If;Ò«ç=çèè}æy½šn°>}r ˜…€ø!€‘@Ä_Ïãu|Œ„E‘3X¿ÂÖÕ·âpëj­”ŠßúËOüŸæF”¢Dùc$ŽHT@€Ø~o—ÄÝ<ÒÉ2æ ÷üÆÆÆç€W’;~.º—¿øv ¹?}z@â¡~ªN?Ø=–%ŠÆG¨]hóÿ‚÷"Ö5ä“ V/óúÆäâ…×^ùÃó/þû3û–Ýèô£ÿ¿Z M€nª9܇7/nPÕÛn»cŸ(Fu nµ‹-6Û”‹  ˜YÆs¬Üzäȧçöé³~ü±Û¼•sO>|c;}•º‰‡–g’S+±8öôWÎñüKßy+ðÙGµÔåüȑ׼òLê@^&µgRíæ•Ç®qßJ‚õ)ß¿ž×îJäÜ“¿u7ê† ˆ`DÐ"ø`øÇç,ÿ°nؾó0élF7º©j#ÓtRÕFÒb–Yª ?Ï?_j0â™ï™#‰1?–½—´¡$¢§2êÛ÷só–/25ß¡£Ë}ÈM 0)#äI HyíÉ3ÕªÓѸéý>Схlºñü Z·Î>v¨Ëç?yŒF)”Q,ÄšÈ up°IÄv¶‰8¶‘6|kÞ©Ž°–&LÏÌ`”ìM£ë*Jåp’P–Ž £œÚ N&㜪KJYÖeE­º”µ£. rº¨ÆòÀó$&i7&{˜F A·^ ´³¦TBOW *IèÛHHŒ"O„‰B¢)kOe„˜¼õôL»-‚V{  ¥eª” €ÙÙšt* Q„$²L:Uä¢ÉѨLQ¥š\iTf°uC7U$Zv½µ‡(:‚¢@`ÛÆuÀ…H¬Æc‡õBЊ²¬)K‹7†²v¹Åê \ÍÑ¥VU­ö¨€QBŒ­1œzÍÄDY'e’eˆ(ÒN‡ºÖÔµ¡Ó›¢¬-ã±t§©ªŠ¹®Æ|/ h!¶(€l5õ²a4vØ -ŒGu¼ʲ¢ª*œ”µ£Ìs*åQÞqâGûm „½™P‹Ô® ³ º©"ïiD)Ò,e’¦„4˨kÁ7 Ýþ4µkÈ'†´;EU•,ô4fûz ö¤Àõ"Ša62.΂±LF–Ú 11ìŒÆ¬­¿Î¨Ø¦¬ œ={”…Þ"¿ó¾9#o¸· ÄœG˜º€8qn:~ta Zz˜O„NW3ñD‘fyÖà#|ã»Ïò/§¾H/.î#•ÈV±Ík«_:¼¸r™zFµ^0ñyàe$üZs{k‹‚‡O‰®˜î½û–ÃÕWU( Ú5ŽQÿ^ÞXüU†Ã‚gN?­üö¿ÄÊ[×c6'›lN6Yß^ãÛ—^â‘§þ€w®|˜;ßñ‹Œóí–€o@{ðž{¾þúÁíâ*Z²Ô¼%1ýÓhñˆD­= 3Bzp–ÙþîëK&%ŸüØïR¸‚+Ã+ìTÛìT; «!c3Ó<+æfΜ‚g_ýû×ÿìá'‰ÆZè*¨kåÓÜõþ?a²~†¹}7³38G73űZ#„—HLIMÐ|çÕoPÏó›¿ü0×òkl–›Œì±17=‡ÓkÕo—¸˜¯’§›lŽ.|Œò §sÐÍÀÚÖlFŠE„;º@5Z‡z€³c"]‚L0³û_úæ—xàžûVCù€±Rø eÌygïGzGymø—ªW(MMÚú>[.´=á_gŒµPà<6_ÅV[L6VoœC»+eMb:Ôu ªKè„”|´A–Yœ_dm¸F΄š§*¢±¸P“”?½üóH8»þ,ijèã{Êw«qÓ*@ ¸ÉØÉM~†ª:©àÄ(X Q A >$\Z¿‚RûÙ.·1ÃBµÈh´Ã”™F˜lVì ÏÑï÷ù‰î‡˜½e–gÞ8IÓêºY .5ÎB“ì*Åæ ä[—é¨ç”´…}Ø% ø0η©›šÁxÀœžãä_Ÿäk§¾Fš¦$iJ¯×åࡃ,.."QøÁ»ïä]7mrzršN'1Mß÷uíîƒÐXÆ/P–t*ÔVZL"Ô–v†*¡ñ†n:ÅxgÌ`4 ¤žã?|3¥-£©Ç–¿ù«ÏSäüÐ8¶¼Ä[õ*išãtP#c-”º%O]”XסF°®½Xû_-À¢×hî»…úÍ’—V¿ßt˜N ÜY1»Ðeiišws'¿¼Ä»ö.îýÄð­pšòjNªR•lD.çÀè]B‹Ö ©´¨w‰DZ¯PÜ3·­Àãg'Ùo˜Yì°¼<ÃR:‹íMóýýš‡~ýW˜½ßñ²z–ñNNl3É?<½ùb¾ª¬…Æïðà,X׳®Ík+í»Ýp®=%+IùøOpÓÔ\Ù`kOU5”…e4¬È³œô¾1Ï—§¹ºµC9i¸µ÷}زYŸä“ÏyßR£œk‡µ» 4‚u×hÜÃf}0„ÉlMòÅ}?ôæ/¼÷7Ö´3UUX&ãŠá°`g{Â?½úÿ¶úU6;¤Õ,w/¾ŸrmU'­=2Vw=3·»;9Õt?3øóÓÏq mÕÚ´º7Rß³cG¬)78øk‚vìƒz20@z{ë×Ô¨‡{zb±)ƒ®%K9Ƨ“ ^ß„ 'æL*MˆW^uuàrß7 Åéâ¼øB¬ƒû÷ìk.ýh èŒ0bã}TŽðM¦k—ORRR”À¤ÿ*òqOOŸ6ÔÔÔ¾wïÂgýðcó\3¡Ûf°?”•ÓÓeY0QÄëµÂóæáêjðûl#y™[·zÜž;\iÜ­áÜ)àu5¼ç:¼ÇŸ™F Á8š˲7× #ä[±ü’V:çU˼¡¯ïTcãíDŸ¿oGC~¶9$9¹|^>ˆB8¦ÒäädAÒE¶¥q0HfÏáÕÈpOn²¶«a«Ýn¿Ùç-ÿGKJM‚«P”ú킼`Óéxº8•V«ÕDƲeË8Žkii¡V¡PH„ÆBXücA)weØ?ìû&½©û_29Öêï´NÛì’‚?#´ö‘ð¥È :Û¶mÛ´i¥o0q(„Uò–O$n_pRšQ¸|éôÁCÿñDmmÅ3UØÚ)û²Rª¨”ý^ꈢPG ÃX,–ÒÒR³Ù¼sçNµZME¢(*`wÂ5 óËÂŒŒ9MHÙ_Wçñxn°ÔoÈÎ0é½aXÌÒë·3A©5˜eÀhŸe•jÈ1j³Ù¨òE«U‰‰adV…éÊ0„f4|Á&ª9^¤PѨãÇÍ›£žUôj=nÛ×TVòPøÂe‰YoDÞ1D‚%™îÖ9ÌVÏšÙòÍ×½WzWÕ­îWREªª8É㦄FÝ|‘Ñpt×nKuõ¬š¥ÉÇ>žêêÏB~AF€Eúy˜–QVZbI]oðÉ­")È÷𒤔((Š—ú™FÇ DeH9¢ ü"Ñc‚PÔ‘ˆBTŒ¯I©P)Ý5Q!”3Ã\—ë‡×]ÿÙÇï]Œ¿ ìwµ“ueIEND®B`‚qt-client-4.1.0/guiclient/images/dspSummarizedBacklogByWhse.png000077500000000000000000000043451217451700100246150ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœpIDATXÃÅ—[l\W†¿}ΙËÏŒ=ã[œ±gšÔŽCâÞCÓ¦IKK«¢ÞD ¡"Ѿqð„„x©xB¨‚$<ðP$„úÔŠª­Ô HQÒæRßâ&“øÛ“¹Ÿ9s.{ofœØNœJ‰--íµÏÑžõ¯ÿßk=ðâÈñÍñÑ?þ_]/™»‡w“ß»‡l¶‡h,á+éþïÿ«ÿâ‰,­uÌó<ª5‡–0´kPMšhÕê -Ž>ñU>ž>÷ì“¿¼{þ¡†ãÊR¥J(½‘³^>úæì¾„T hÝ6¥?1Ð|orì¯MÜ›éé!Ÿet8gÔÎÌÙ s?L§“ +ÑÕEÍicc#‡÷ïÛûÈ™³ÓXщ˜í¹Ç”C€´ Á ã·—}ÓG·×RÁ®L‹˜Ý…‰"䆇èó‚Äô|ÁJ§ÓXÙl†Ã‡„ŠO.̳^,RZ] ƒ²¿ÄÛœ¿ £ Hˆ›ófól h6Œ÷F*™Æ7RÌÌècll;ÃÊd{¹çp­@‰F0 “Xí-ž;±3b‡(„P¨þö¹»B H”Vh4ù>|ö#’Ù½œvŽ±Þ´ñM.7„V«»;îÍKÓ›+ÛVm—èÍ%yéå׉vO ƒ*tѲ‰ \”l¢Bn›e¸(én{ïâ×0bqÌz8š˜Ñ_´³‚ЫbÙ‰/ö+h‰Ô))ï]RŠ™b©@*R ©$JJ” Qaˆ ýŽyÛÌEú5¤_!ôÊH¿Š „­2v4Ë(o0,b;ö;ærÙYš| ë?}•¿ P…$\¼%ô«­*¨#Ã&*l¢Ã&2tЛ²—¡CØ*8KÎ2¡WDZú(¥Ú!Á&w …x]-´nt×O>„ílP LC·3ñJÈ Þ¡s³¹H¿Šß(ЪÎ8‹È Jµ«e£ÕÍYi“P„a§R:òSB¢SbB£ü¡WBNæMtè"ƒ^í"ÍëŸ8KhÜ(¿ÍA·ÐÚDk)w :µ®4˜B#ƒÂ+obÀ%h.á¬Â«-l |» ·ce [ÆbƒŽ1TÐ@†­ò4ÎÚ¿^e Í·ÝÔoÐaઃJˆöfC´ha"ýîõiÏ ¤ûÀªx˜ç(µ€‡B´7F[¥ÍâiÜëçPJîHñ-ÔÎg@IÚmõ¶t¨Ý`À¯,àÏ¡¤¼£Æ›c¥©<"žCë(Êw+(#…PkídÅNt|M«VÀ­\BòFvwb@6ÑÜ3èçYwzX-5q[>šd&0 ᛘz¡‚;K€–4K „¡¿ãÁÚìcõÿ+òþþÞ,…Ú5L;‰0 ´”ˆ–C¿és`ôqrv’îæ[„¢˜Û €"ümÞ^oŒ8öþï1[=Ì_><ÞÃ÷ñÊ‘ƒTWqÜ¡ÅOôrav§O3Ù?I691uñj#þýŸD[Æ¥Ú³Vm)¤¼iï¤lã7¿3ŸaE>Èœã Gñ'î%*Màµ0£R‰(‡ä~è1f×›\+ë“=Ý©3½ýg@ÊvÏÖ6µ9ÈN¦4ªÿ+¼sjšž}‡xøÀËk%j^Hrp=˜gYÚ\®¸ —YŸ?MW~‚ÕRÍö=ÿ»ós³=[%`+;ø )ŒTžµFš‹åk<õØ~0#\øäì„Mzßë-…µð‹K8‹s ŽåIçö±XZÆ­ï1MëЖ2¤ÓŠùåTêéʱVl@"MT{Ôš.}£w1óÏw©ÎÌÑ—'¨I%bL3ž ^«“Ù=Œ3½ž¥¿E¶1°v%¡Tƒb–Kœf òX^ø”õk+¤rÜý¥—ð¥äí×NWÔäþ'ž&—¤;&Å«¤’6¦eš2”IëÈñˆ£ÔŒ˜¦¡ðÂvJ¹­›m»õö¦ äÔ‰d5H‰Ù3ˆŽwQiz¸ÚàÈó'92œfß}Ig’XBÓ Àäúò:–i†ŽãT-!Ç~õªùÔä½é„&núŒwBJïFwS›tׂ”Z$jJŒf•«~‚†Q¿Iw2F—m3ððãdª’¶E,bZ˜Ñ•ËWÑJUëõƬ•H$8¸kÉ"{3e!iÖ‰Ù3Dm‰ÆèôpÑö  Fb‚º+0£aÜ£ßô¹¶²ˆfˆÞ˜ÂH "ÐÈtT.c6Jxñ1+†_.c4ëÔ3KKKç­L6ÃÜgW8~ü§~9ôMJ™4¦;O¯˜%aG„ ˜ô !L„0Xq/°§œÚò :“ÆèîGjA£ZÁ[«ÑÕÝGtþ,É©G©•«T œJÙ]ZZùýääÁš•Éd $ŒŒäØ;6ÂüÂê^ˆ/4—çX+ŸaÏ@çºv»nH„]±ç©wM²zñcüøX=ILÖʤÆï'v½@iµÄZá*îú*ÅRõR~ÿÝïY–‰•îNóÀ}Sºå3•šÓ—ÍfdÂ1̈Pé‘óµEÎ{"¹5¸Ö€ èqß× ë®{2úºwîƒÄZq”ÞÝ»I'R\ZXDy>rþ4Å•egqùÚüøÄó‘˜íÉ0Düìµß2Зá³Â²Heõ÷ö20؇£´ö„þwN>}Ç?¡ß~åGh­â†yIIõªÖz*¦bñ˜a™¦RaX+—Ëg W—Ùóö#ó-Ëp7®¡ÿ“qôij<øðã,Ì]ÈaL)­'”Ò‰VËmÔëéµÕÕ³'žy¡ú§ß¼†Öî}ÿa¨ÈþNè÷IEND®B`‚qt-client-4.1.0/guiclient/images/dspWoScheduleByPlannerCode.png000077500000000000000000000043741217451700100245420ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ‡IDATXÃí—[lÕÆg®»³WÛkoÛ‰/qb7$¦@ )QHhQZŠDUõ¡7T¡Jm¢R¨¨UZµ¥‘>T¢•PÕÒ‡R ¡@I.!„ÄqbÇöÚÞµ÷¾3;;—Ó» QS‘V¼µéHs4ŸÎùÍwôýuþ_ÿë%®FÔ¼ueDŽ_Y÷›UàøäÞù^[¹‰@"ƒP|Ív0Kÿ è²nŠ]áÇÀ2…Œ†Që{aÔÜ_­cÎŽ\a1MG¨ê5jX¨Ëíº*x<ý1ÈRߺÛÒvÜõ°Hjû« ̳ë/×DRi +ßv×pÛ@ÿBcâ‘äÇá@ŠKëÞ¯›æÍ·?¤$ÔïT¢ï®»\½k»sÏH[ïªygb_üÊËjÿ|xø'Oãù¡žI'w.-Ìv}ý`ýüÄ™—4]·á8( ›6Jà‘¸ãÞ¨kÛÙG^S+à‰ÃC8['€ âU+´w÷1¶uûˆÝ|é@._| mˆ¿}#¿lÈ+;Zº@ji*–.^x¢£–f©þ¬[W3™0XÀuKð]’7ï6­ÑÍûUS|·ê}yd‚”øµ*îÒ"éH„CÃ#©˜õëœ+wFøJT\Ù¯¾ü#¤cc¬[/ j‚1³Cœ“žk%0—¤ë@)OÏ! $ÛÒ¦“éÜoç Z¥%¿¯*žHIP¯á¶|êçÏ«ÔXoèà U}j®îMë¼Ï<Û’—d¼ ¸>H‡¦°Hµ\:Z.¡ï_òÊu/œÁ·N¤Ö’SW‘ޱÖÑ}ÎR£T´7ñÊE\U§8:F.hç'X÷ÎÛÃ͆ýTΕ{SïVÏòÀ¥ž$Ãúä9ì…–@( í*Ô–x;{-?|õ=4Ýdýê!¶tÌÝ¡Üg‡EÃÀ/.QÚv¿¯Pm4¹æz2³9>áÎ ÛÿÔœ+÷&5îÚ³ƒ ÏüŠÈ®^è µ*ñF¥mkóH›NÅ“`t†® Px¿äÐÛ·–޶4åÒÓlÌtŽ/¿eËÙt˜òÚ:»LÐhÔ™S4ú…`³¢ {AðØT‹»-AU[ùî´"åÞ0¤g¾PÆRÊ$U’¦Êý±lŽXQz.Éú -7Ndu7ÖL…µ´PU…ζöˆgÆúDß0©ÎnVq:;»˜?Õm"¤$#`‹ ½©ëÄÌfÀgHé|EéXÕ£!Q…DU@ ªU€"C/U ªô»e†ðŠŽ»qõ±íÌ+Qª ×CQ ª*X…Ú+/â>D`Û'Â]À’ÖchIØq'\¿ªK`W¡Y_+s)”–‡ßôh×${bN³…$ÄÕ“ÔwñÌ9vЩЇ#Tˆf.#`Ãퟣ­«õùç Z[I¼”qÊÊÎQ¾çÓr›$›.ý­*&H‰PÊÙ!Cƒ¦ãâûÖµÛy[Ëðì Çéß|{ïÝHea††ÓÄW ZV'OOðÆÇ%{Ï5qä&cñ•À©C¹À‰¦Ê‘&§§™[l±³³oê%r% ï¥ú9©e8;>AwO/ëS}üîÏGÙtó-|æÆõ´X %žÛDKÅHX›F9ŸˆsæÈAüîµêçûoMÆ“Ï(ìTKžO~©ÄÜBPP5ý_ú·ïÌ/ä)Uª pðͤÖmbÛh¹|‘ªëÏö"³ƒä‚(“e‡©©I ãlj Ž0_¬FZ®wÿéñ3iíb“qP\ÀóRä .†!–LcYœí.nËcz¦HvU7a(/µ¸}Ç0¨:'ßy¨%¹nŒB3D34Z‹³4fÎí$Ù³Ž™b§¶x­ªj›.]ƒÉ ²ý„–!Hb%RD­ÖeðƒUÓÉveY\*ƒ•Ä.UÛ!³fˆ¿Låƒ3d7àUIX&c·Ü†±¨Uk´­î¥qªôƒ`ƒr¹!—òŸA3"¤;:ÉdWÑÞÙEÄŠ”+#¢&éŽ ±D’†í h¹‰÷)ÌÏ‘èêaýî{h/üôQb†Êõ·ÞAOO–”)§IÄ£¨šª~¿ä@¹f„¥Á—² [!æl6!Ѧ ¡©°¹¯‹Î¡v|3Ρj 5EFb”mG*Ü´ç>nêM²îº$ÛâhBRÇÃéβ”+ ©ªßh4*Ë’:AðGµcõ¹cruqâ)ˆ'!–„öUH+ŽPukh°ÆoÉ)ÏJD m—b/F§[õ-›TÜ$Òµmm•)âQ SW‰ªaRžœF†a¥V«ŸÖVÒµ@>Èb Æ‹PZ€„+…Ðò—_Õ€!zôi‘éú}—ê›AÒM‡¢$²$A2åIÔz7baj&­R Å®Q«×ßš}O¯ØaxÕ×3àÁo?Ä`gwÉmÚú2é-•Ü©¨lK¢¤: ¤ ^)ãæ«ÄRŒñw‰m§ZªP™š¢Q.Ù3³¹#££Uõ?ÙôÃuôðklþä8vc\7ÌL$poh,- #ÕN:šå<F±¼&_g~b’jn&8|äØÏ¼yìª"‚ÿàЫ冭·øÍ¦sXÓ´¨î;cn~F÷jU4E%±h6æ+.‹çÏ“›8k¿~èÈ“GÿþÖc™ÎNûÄѯîÏè£êË{÷!eQTýž0RŽé†‘0#¦¢©jú~µT*½5uaæW'ß?õ‡d*é^8}äb?–úÔÎO³eÛ.&ΜlB ¥ Ci5›N½V«ŸÊ/,¼»óÎÏVž~òq¤¼ÔÙþÊɪ„taIEND®B`‚qt-client-4.1.0/guiclient/images/editCashReceipts.png000077500000000000000000000044231217451700100226010ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœžIDATXõ–kŒ]U†Ÿµöíìs›™N;3¥z£¡ˆ¨) -¨ÊEÔb”„Kñ‡˜"A (?P1€’R(†‚€H¡i)…^,2eÚ¹u¦s朳ÏÙ—uñ ´E|ÿì¬díµž¼ß÷½YbÍ œ–¤î‹lý}óÝ[Þš²Ä±ç­Ö|’;€ë:qZÊìe[ùLÖZ^»íì«'Ì<ñ6kôeÕþÒÑ=tì Oö¯ZÜ"f,›ä»çe®µ ™›d…×m¬ì1VNÕYÚYØv¡kæ ;Ÿý5g<˜:ÀšËÊS§ŸyÍêBÇ´B€”“Œo&yÁ+´LpýBð‚N!½vecmh´vt¦0JQëßòÊàë}ÝË·öŸø“×À-6o‘–f褎ã¹''smS:~°Ð‘ ]éº` Z¥ÆÕĦMtãZO.M=æÚízôƵ×NU§Ýñþ!8ß9iâù^X\êxR° W0µ]ØÆŽ­ã9Ï“aTŠÕ)&‹Qi“ÆXcçz%³¥(LsÒ¦8®ƒëJ©ÒEg1&k¢UŠQHkA5k¹¬ÍÝöês2È=´®vœXèKƆŸ”ŽxBµUJq˜tÜ.éºHÇE‰ÕicŒfu”úØÕ‘*{ú‰ªãåN0š¸:Ü•Ö+æÑ»v=ûÓo…<ü¦:¸X²r@m¼sÊ/—ßaîEæþ µmK¢*F+œØÃZKš$$ia¬CœEôm{„ÎÎɤq]5MòîYw.±…u/üì»Ø´r)ÑÀV§möé?ÊOš~³ +ëhV'` Vktš •Æk9wâQôn~=ïü¾éAöó®þ§†âÚ#ļDB?†ëP‚}÷<ý.W-›më»7½áæÛ6¹Å΢[ì, 7/µÒY”4ìP2æÖÂ2£ã+Ôz·Ñ Æ—}Åiëž5»à„çh«—'6™©3­9½KÌ™ÀÚ8ð‘î,À<‹÷_Ü’k™þ…¿ÜÙá ååéªküŽîK矇ˆ3Žõ=ò‘æõ)°kÎ4Œ6d*£Ñ·w½£½ÁÊàæZT[cR³†ŒÍ84É€[>`?=X& )ŸY>{ùq »ŽÅ4œÔç s¬Ÿî0ÒˆØôÆ›à&LjCJI’¥TƬ ìoT×%q²Újûš¼Kî¿Jð±ºëCLÍÒV¿å‹ºNp­‚zóž¨Ñè.#ÊEzwôòÔ£kرeèc V[ldñb/,壒,9;MS‹å$¸å€,-Y’ nܹ±grq²SôJ`¡:ÔG7]ìîÛMT‹K!qš0ö~/åR™B>OµV#ªEH_ •’ñòGçس>€·³${|÷Xÿæ¾Ñ>†*Cíõ¨žj‘¨T*¸ž‹Ö'綆ŒWÇÉTöAP…•†Z³Îx½úš[°ÔùåÁöÀGú>ФHæ!Îðì’[:¦”K9™ÃKš&4“!ÖZ”R(­¨ÕkÄq|; ×÷*À¾º øp=e %r™/ý¥ fùÂóA µF)õÁ7S¤qZ³Æž ¬åÁC™‚éJÀ ðèÄr’°âÇ:§b9Ì#­°ØÌBÂKÀr`œßžû껸X¦¡9Ã9À"QÜÜŠùì«@Ÿ󰜊åI,ÛYõŸ-Ÿ À_//Rª‹žïZ{æ;ù¶YB8%6ê:Ù¯ìZŸx…xÞ×í÷ïÿ°þg H*ÃNëÌ“gû­=—ø-“—{¥Ž#Ý\)´Ö¢“ˆ´:TGÞ[õÝì¥Éø oxñ³l¸ãt¬ÑŽãùíA¹c¡_îõB«ߤ&­a’˜)È?xÞË·> „ØBMûÚ=Ì•ƒ¢'¾b´uKÝíÝ~¡è¹~ÇÏáúÒó‘Ž« D:ÿê§öXþ âŸVöáïg IEND®B`‚qt-client-4.1.0/guiclient/images/icon128x32.png000066400000000000000000002005461217451700100210770ustar00rootroot00000000000000‰PNG  IHDR€€Ã>aËgAMA± üa pHYs  šœtIMEÙ/-@«LÄ IDATx@€¿L -‰ IDATÿÿÿßc=ýìÞòùçÿþ ùüÿêÿù ë +éÿñÿ€þÿÿÿÿÿÿÿ€€þÿÿ€€þÿÿÿ¡Ö*ûúÿþþêùþðü÷ ÿðóþ ðþûý ÿ/ò »tàÿþÿÿÿ«x Úœ'% þéýîûðþ ûÿýõûÿü ÿúþüþÿÿõ & þ¦–ÿðÿÿÿÿÿÿÿÿÿÿÿÿ««VVýšßGû-üÑûøûÿ üûýýøùúþPïíiîç…K„ÿÿÿÿ€ÿÿÿrG ò¤ %;ö Ëû÷çþÿùþý þÿþÿÿÿÿþûçÿú ê‹7“ÿóÿ««VVýÿÿÿÿÿÿÿÿÿÿÿŸåEùüfÓÿú ÿýþÿÿÿþþÿÿ2åá!âÒÿôŠÿœyzÿÿÿÿþÿÿþÿÿÿÿDñû« ý&÷%ÿúýÿÿþÿûüåÿÑüü ûóö/£õÿÿþÿÿÿÿÿÿÿÿ™Õ<þrÿéü'û5ü þþþþþÿÿýþÿÿ÷õÿæØëãþÿ™ÿtkÿÿÿÿÿÿÿÿÿo¼í [öëÓëÛîùûÿÿýþþÿþþÿþÿ0 ÿþÿÿ p™ ÿÿÿÿÿÿ€€ÿÿ’Û1 sþêÿþúÿ3üûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýÿÿÿÿþ÷ñÿâÖýêãÿ¢ujÿÿ€ÿÿÿÿÿý«ª€ÿýsÁÿäöZýüîÕî áòöûþÿÿýþÿýþÿýþÿýþÿýþÿýþÿýþÿýþÿýþþýÿþýÿþýÿþýÿÿýþÿýþÿýþþÿüÿù1ùû >èjÿ@ÿÿÿÿÿ€ÿ€ÿÿU)€ýÿìûú7ÿþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿÿýþýÿþýöóýåÞÿïë¯Ó fÿÿÿÿþÿÿÿÿÿüÿÿÿÿt8(© /õþýüþüÿþýþþÿüüãÐ òüá*Ÿ€–€þÿÿÿÿÿÿ€€þÿÿ•Þ"ÿú„ï<ûþÿþÿþÿÿÿÿùôþéÞêÞûº¥ÜLÿÿšýþÿÿÿÿÿÿÿÿÿÿÿªªüý€ŒÈØ÷_øýüÒì áóÿùûúÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþýÿþýÿþýÿþýÿÿýþþýÿýüþýÿÿúþþÿþþ,óÿòàa€gÿ€ÿþÿÿÿš«þþ‚óüþý7ÿÿýþúþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþþÿýùûûèãæÞþüþÄ )Qÿ™üÿÿÿýþÿÿÿÿÿ{/7 ¡ -õ ýýþþþþÿþþÿýÿÿýÿþþûÿÿûáÿÒ Û šœÿÿÿÿÿþÿÿÿÿÿÿÿÿÿþyóäþúýú=þÿþþÿÿÿÿþÿþÿýüýúøûïßäÞúÌøF«xñÿ„ÑÊþkïûÐèéöûúÿÿýýüþþýþÿþýýüÿÿ)öúõ%ÕZUÿÿÿýÿÿÿÿÿÿÿÿÿ€Ææ‹þûøþþ8ÿþüÿÿýýûýýÿþþÿþýýÿýýþþþÿþÿýÿþûýýúûïæãÝÿüÕÿN«xñþÿÿyÊÿ½÷ýnóúÒê ïøùþýÿþþþÿýÿýÿüÿþýýþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýþÿÿÿÿÿÿþ#üû"ô8_dNÿÿ€ÿÿÿÿÿÿÿÿÿÿ‰¼…þüÿùü6ÿýþýÿýÿþþÿþûÿþÿþÿþÿþÿþÿþÿþÿþÿüþþýþþýÿþÿüüöíèþàÓþûúÛëýG‘{éÿªªd'œ IDATÿ3r¶ÿ|ñøÔí îöüýÿÿÿÿÿþÿþþÿþÿýþ (û#ñþû=ÜbI€þÿþÿÿÿÿ%m€þþ ýÿûý7ÿýÿüþÿþÿüýýþþþÿþÿþþÿþþÿþþÿþþÿþþÿþþÿþþÿþþýýþüüùûþüüüÿüþøüýíãþåÓýüã J¸zèÿVVýÿÿÿz6e ~ù+÷ûýÿýþÿÿÿüÿýÿÿþýÿÿÿÿýûÿÿÔÿÞÿ ´žÀÿÿÿÿ€ÿ€ÜÛ¶ø‰úûúþ9 þýþÿüýÿþÿþþýýúüùóæäÙûøêý A)pÙÿÿÿÿÿÿ…KœüþŽêõÞð ðøýþýýþÿÿÿÿýüüÿüÿüÿüÿüÿüÿüÿüÿýüýÿÿÿýþþþþþþü*ý ýî÷üLäb5ÿ€þ@²ö}øýþþùùþ7ýýþýÿüýýÿÿüþÿüüÿþÿýÿÿýÿÿýÿÿýÿÿýÿÿýÿÿýÿÿýÿÿÿÿýýÿüÿþÿþüÿüý÷ïäßÖû÷ôíýúJ©qØ€þÿÿUÿÿÿÿU«ýÿÿþÿÿ€ÿ€ƒ8|üþa"ÿ'ôþþÿÿþþÿþÿÿÿÿþþþÿ÷Ôýåú£§ÑþUÿ0Ðx(úòü<ú!ÿÿÿÿÿýþÿýÿÿÿÿýÿÿüþñæÿæÙú÷ø IÿyÇÿÿÿVªÿþÿÀAüÿÿÿÿ€ÿÿ…6‹öþR($óýÿþýÿýüÿÿÿÿÿýÿÿþÿýÿôüüÎìÿûþ™ ©×‰Ñ{ýý-îÿÿ3+úþÿýüÿþÿÿÿÿþþüüþöèâØýûøýO¦y¼ÿÿþÿÿý™fèÑÿüM!ø+øÿýÿÿýÿþÿÿÿþüþüòýÏìþüù‘)°ÿáÿÿÿÿÿÿÿ~Š lÁý'ÿÿÿÿþþþþÿþÿÿÿþÿÿÿÿõèâÙýúïøûV´…³ÿÿqöÄ–þC# ÷+ú ýÿÿþÿÿüÿÿÿÿÿúüþÿÿÿÿïÕüöêù,¡ÿåýÿÿ“mË-»5ýÿüýÿûÿÿÿÿÿÿÿÿþÿÿÿøóðÿéÚõòý_­€§ÿrŽÿøû1kÿüÆÜòØðôøÿþÿÿþÿþþþýýýþÿýþÿûþýÿýÿùù,þûóùnÂ]ÿÿÿÿÿm“ûPòâ×âÔéáÿù÷ûýÿúýÿüûúýüÿþüÿþüÿþüÿþüÿþüÿþüÿþüÿþúýüûúýþÿýýüþûÿýúýþûüýüûôõçØòîmÿ®€§ÿÿÿÿÿÿÿ£F€ áè¦ü.+û( úÿÿýûÿüþýýþþÿÿþÿýÿÿþÿþîþÎúÿúü (¡ï€ÿÿÿZzùÀÿ$&úý ÿþþÿÿÿÿþÿýÿÿùïéÝóë{­‹ÿÿÿÿÿÿÿÿÿq0ªü',÷)ûýÿþÿþÿþÿÿÿüÿÿþþÿýÿüýþüÿýèýÒÿ÷Ì®‡UÿøÿP` ÿ ¾'ý þ ùþþýýúþø÷þëÙñêü…ª`‚ƒVVýÿÿýÿÿÿÿÿþÿÿª«Çû©"-ø" ù ýýýþþÿÿþÿÿÿýþùÿÿþþþÿþÿþþæÓÿûüüñ)Š4öÿÿÿÿÿÿK{+·%úÿþþÿýÿÿýÿþüùñþíçíÞüš±~oÿÿV«ýÿÿþÿÿÿÿ€ÿýÿÿ†=üó±-ò! üþþþýÿÿÿýÿþÿþÿÿþþÿÿþûèûÿÎüþó(“ÿúÿÿÿS‚7ùû¸+ÿüÿýþþÿùóÿîàíäþ¨´ƒc€ÿÿ€ÿÿþÿÿüÿÿÿÿýÿÿU«ý|6!÷ª .õ" ùÿþýÿÿþÿÿýþÿúþÿãþÿÑþé%²ÿÿÿÿÿA}?÷®  %úýþÿÿ÷öÿïæêÚý³³„Zÿÿÿÿÿÿþ|>)ñ¬þ,÷þÿýÿþþÿþÿÿÿþþþÿÿüþýÿüàÕøþ äÐS–UVÿÿÿÿÿÿIìL§*ÿ ýÿûÿÿþÿÿüÿúöìãïáÿ»ë…SÍû„Â× òYøüÕò éðûÿþþþÿÿÿþÿþþýþþþÿÿÿÿÿÿÿÿüüÿþúüýú!ÿ(ýôñ5ž\ÿÿªÿ€ÿb”µi÷òèÙõñúùÿúÿþÿþþþûÿýüÿÿÿÿùöÿìåìᒚ ‚ÿ þùüÿþÿþýÿýÿýþûþýþýü÷üáý ÓýúþÐð•¢ÿ€€€ÿÿÿÿÿÿUÿÿ€Uÿ»þþm4ýûÿÿÿÿþûýýÿüÿýÿÿÿþÿúûæüÑùúùå»ùzÆö÷ Ý ìä á øæÙàa!··Í ïÍûí%ðñïòùðòòõÑÊÿìŒúöüäüõþþÿþþþþýþýþþþþþþþþýÿþýýþÿüýÿÿ ú üõ(ÿóù2uV€€€€ÿÿ€ÿªÿ€UÿVÿ«€ÿfg™€ýªÕ«ÿ«AÀAž;€ :×oûøþø1üþûÿÿÿýÿÿÿÿÿûÿûÿúûÿé ÖùþûíÀ„Ìø óö ïõþúúûòý öòÿþ ÿû Òûôôöüîîõ$(ô÷Éå ¬áòüþtêþþüøþþÿÿÿÿþþýÿü$öûýþýÖõ8 cùfóе€€wþÿffVþ€€€€þÿ€@€ªÿfVÞïUÍ«3ÿš"`@« ÀSnû øúú0þýÿÿýÿÿýÿÿýÿýþâþÖûòöÈý†Áùâüì üø üÿü ôüôþøüþÿÿÿÿøøÿøøü úøöúøòùó.Yý mùû þÿÿÿüÿüþÿ÷ûÙÜøì·ªÁ99ÇÇUý«I$L6Ü´ûªþVÿÿÿà`à){+?-Öû.ÇééÖôày÷i õ÷þ.ÿûûýýýÿÿÿÿþÿãýÖü÷ú½öÍúèõþýõþúûúÿýÿüüüüü þÿýùýøæäü üÿ-üþüþýÿþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿþÿýûþùÿþæ1!öäô è$ºîî.Ü×ÚÚLÿôÚëàðþ ÊÊíÿî Õ4èøùù¥ðaþøó0ÿ!üüýÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿåüÔ öÿ½ø—Ïý æúûÿøýýýýúýüýÿýüÿúýÿ÷ ýðüøþíéËÿ÷ÿÿþ*ûÿþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿüÿþýýÿÿøéü2ÿÿ òÔîõ÷&ñôâñà*éXØíÏú$åúÞøæ©þùY þúð1þþþþýýþüþÿÿÿÿÿÿþÿþÿþÿÿûåÖü ôûþÆü£Ãûàýüýû ÿûüÿûûýÿÿüþüýýøýòýêìýýîôüüýüüèæýÿÿÿÿÿÿÿÿÿÿÿûÿüþüôþëú0ôýíòü×ðô ìööõõëÏ) æ ë*¯þéP$øïþ/ÿý!þÿÿúüýÿÿÿýþýÿüëüÖùñÿÇü­ÃûÛþÿþÿþÿþþþþüüÿþÿúòëêýêïþýýÿýýþ ýÿñÝÿÿÿÿýýÿþþþøñÿïü2éôÛóøøø÷÷ ä äªæFÿ&óý(ÿ%ÿÿúüþþýÿÿýÿÿÿÿÿÿÿÿÿþþûÿ÷ÿÓúñ ˵»ùÖþÿÿþûÿþþÿüþ ýû üùüûþÿúóîìæéóù üùýýþ þþþþþÿÿûýôÜÿ ÿÿÿ üþþþÿþþþþþþþþþþþþÿüÿýïúþï 2êåúúú÷þýö  ‚ð&E !üò%ü'þýÿþÿÿüþÿÿëÿÔþ ïËûýÿÔúùýüþûþûúöùöñøÿ  ûû ûø÷þ-N ýø ú þþÿþÿÿïûøÌòý÷ÀÄãóùùùûúöùùúüþýýýþþ  z/S;òýáþðúÿÿüüûÿýþÿûøÿÆüÛÀÝþøòýöüøþøþõûû÷ïóôüÿ ûû  þ þþ/:û þÿÿýþþÿÿÿÿÿÿÿÿþûýÿûÿÿ÷ö²°òðûþõòìñõ÷ûüýýýýþ [6'Küÿúüýÿÿýÿýüþüü÷÷Óè´úØýÿöóúéù åûìü ü÷óü÷ûýÿÿÿÿÿùùþÿ þ.6 þÿÿýÿÿ·ÓP IDATÿýþÿþûïø̦þôëñëñõøúüýýýýþ  ùü ýùùÿýúúðúýÿúþýýôñûýú ùùðúüôúöþÿÿÿÿÿ ÷÷ù ÷ôþúúþúþÿÿÿÿúÿÿþùûûøöøùûüýýýýþþ  ùàúô îúûþôú öûÿ ÷ûûû÷ÿû öÿöòÿèþöÿöûñÿÿÿ ö ÷÷ þö ÷÷þÿÿÿÿÿÿÿÿëåûÿ ôôûýüþüýýþþýþþþ ýõííÿ î ÿâýçêñ ôÿ úÿ úõõþðÿê úõÿõ õúÿ õÿÿÿÿÿÿ õõ ÿõÿ åÿõõÿÿÿÿÿÿÿÿÿÿòòÿþñññýïÿþÿþþÿþþþþþþþÿþÿþÿþ÷(õóöúí îñþîþöýìÿñ ôó ûôóúÿ õ ùôôýûöíéúüôúÿõ ôéûÿâõÿÿÿÿýåêä ûôÿÿÿÿÿÿÿÿÿÿÿÿÿòòþÿìÿïýÿþÿþÿÿþÿýÿÿÿÿÿÿ'Ù'"ÙüÜâñÿÿøñññÿñùÿññùÿñùò"Þùþòòþòòþñÿþòòýÿÿÿÿÿÿÿÿÿÿÿÿ ÿôþóåGÿòÙþàÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ¤eS IDAT=·O•IDAT€ÿzµpѺËÀIEND®B`‚qt-client-4.1.0/guiclient/images/icon16x32.png000066400000000000000000000022141217451700100210030ustar00rootroot00000000000000‰PNG  IHDRóÿagAMA± üa pHYs  šœtIMEÙ8-@ZIDAT8ïû¬Q5J"úçøÿþÚ”ýð™Þ?ÿþâÓ>™U&1øýÿÿ)#‘òü‘×eÿ‘ÿ–c"×ÁßsÂgðõþþþýÿû÷ÿîòŽøû™ùú ùúþûþÝÎø×Áßl¦™9¸Dûþª!­„s»ÿ ð ¿•LÄŸ¼ ÙMÛåýÿÿ Ž%ŠJ,MôîŸ\MT©7þ|1éLÃÝдî…$ø9×ýõýõ÷û”Ö&Ýd³ñlŸýü:üùÿþé÷[ÝRóHü Aßú廵FÔ"›ÿô*õôöþµèÍ;Ö%ìèíMÿéð¦ôñø;Óƒ\ÿóü2ãg9¥ÿüùÿî]A$ÇÝ¿¼ÀÿÐsaþþ(ìLû÷þþ4Zÿ&jëþÿ=ú—è ¢Düÿÿâÿ‡ù¨ñþÿÈäÿ#ÿÿOˆÿÿüÿâ(5Øúû÷þüûùýÿÿýÿü €¤ÛåCÿ ÐIEND®B`‚qt-client-4.1.0/guiclient/images/icon32x32.png000066400000000000000000000102341217451700100210020ustar00rootroot00000000000000‰PNG  IHDR szzôgAMA± üa pHYs  šœtIMEÙ3º<¤+IDATX  ßï×ZµÿŠÔ±NßhãSãSdƒ€ß˜á¬Q5 %1ÕâòÿþÿþÚ”ýð×dù‚§‘‹U Õõs+›ß>þÿÿþ ûýýâÓI–w©‰Wÿ¯Ë–Ei – éøùÿÿýýüûýÂÓjj)–þöÙ_ü‘‹Uõs+•ÚqúýŽÿÿøàÑöäÕ=ÿóôíj»b¿à©îôîþüóÿüðÿüïý;öþ‚Ýo'¡vp_‘×eûþ…ûûüýûûüüýþúþÜÎý±,ÿ¤{Î~°–c½™"‡4sÂgÁâ·ðõþþþýþýÿû÷ýOÿîòŽÿÿZŠ¡ØXøû™ùú ùúøùúþùûýûþÝÎøÃ¥1×Áßl¦æ‚Pÿmu–•<¯A=àúþÿ  '§„i´C ¼ þüúøÿçØγ9Å¢È%œªÛdVÿO{±„ë”;kÄQÃãÌøöûýÿùùþúöù_ßS|—L½ÙÉ íéúüúööýúÿàÓ϶EÅ¢Èy¹Ûd«ÿuÄ_±…±„á ›7¶>%åüÿÿ Ž%²˜Pв,M ôéÛ ÚÂRÅš¯ÿÿÿ Qlõ®”§=Yà  5þÁ9óüÿÿýŠ·ŸK†» DáÈVÉŸ«¬ÿþ’hü»|YÃIþö­áSÈêìýù ùþÿùÿùùùüåøròGO#åÆWÝÊRÉŸ«þTÿÀF o3?KÄÆ,:Ô£-A/ žñþÿÿÿâøýõKD×Ì?s$&تgÿ?KÄÎZ:ÔÒ:7 ]üúþûûÿû þþåôÇéŒDkÿÏN¦&üÁØê5±aV?»÷Ö2¦ìÕ2ôÿ”úø@þøøøþÿ÷ÿûþçóÅëzã‹©–Žîí¶<’D ö¼”•WÇ69ÊåÑ7 òú‹Kÿóÿÿýíý'Äóœtço3‘{þúhÿÿíbÿËsÉÿÿ>¿9ÊåµFëú’úKùõûÿûûþïøÈò§tço$†oòðqô÷ûóöñô÷ÿñõ—'‚<t#&„ |àêÿÓƒ\ÿóÿý÷þ Âø¼pëUg9»êÿüùÿç]à‡ÜAD@¿¼Àÿ$# îïú;¡ð Ñ õ‰ÿWýøþýþÿþþþùüÃöÏpîPõÍäüâüWýîúùÿúýþúüûúûùþ: (ÒßÖ°ç$îÿññ üÐsj÷þÿÿý¹úáoòkÿôýüþ ýùçò;sÿ&j ëÿúÿÿÚÿcú—èÞìù"ù ûõýÚzeÿûÿüþÿþºùónôÿþ$ÿÿÿÿÿýùþãÐÿýù ü.ýõþüÿÿüÿûýþý1Òîq[ìÒŒ üÿ 3ƒ [CýÿüÿÿÚþý‡ù¨ñþÿËýðÿôÿÿÿ,j#ûÿÿÿâÿÒŸüáÇäö Øûùÿúþÿþüÿýûýüüþÿþûþÿÿÿþþ ýý üÿñëñøûÿ)ÿ= ñÇíþüöÿýüÿÿûÿ÷þÿþÿþýÿÿþþýþÿþþýý ýïöíýÿÿÿ † E³²üIEND®B`‚qt-client-4.1.0/guiclient/images/icon48x32.png000066400000000000000000000222701217451700100210140ustar00rootroot00000000000000‰PNG  IHDR00Wù‡gAMA± üa pHYs  šœtIMEÙ2*!£µ{ IDATh0$ÏÛ×[Єì-ŸÎ(–t*lœ•ñ~æFÿþªU×ZÿwÛQ©ÃØ$mu#æýÿÿÿÿÿÿÿ´ÿ ‘Ûÿ‰#wÝ­R`,ÑôûýþÿÿþÿÿüÂ$”øñÎz2†é—aAjbj¨•(ÿ®×îìVÿÿþÿÿçÙ0óîëðƒ;…ÿtŒlP!ñç–0H%ëûþÿÿÿé²ò˜2”ü÷ãS­ÿ››Òed¹u³¼»nõ’’Oþ—êÿñwlÿîåáÒÄúñUúvèÿÍ3‹½™"”°çøsâ'fËåºÞîÿýýüýÿýþÿüýÿüûÿüúþÿýJ ÷ü\î^­ÿì%€ee.uÿŒ³yþ’’Oþ¤£”üîpýÿ`ýýýþýþýþýþýþýþíåÜÍȰLúvèyy™3Ô•€þÿðÿ†"Šßÿ +õ¡:@!çøýÿÿÿÿÿÞÿ«Þ#*¥F~Öý’«MnU³“Åm;×ikÿ)þÿÿóëßÏÖÈ©=ÔÁîO|±„þ@ÿÿ¿ÌÌŠßÿ“<ùðõúxÅ_ÊçÉâñþýþÿÿÿþÿþýüþ!ÿY"ÜÖ[õóAnU³Vlum;‹Ð`úýlûý+üüþúüûûýþüüþüýÿûüÿþþñéÝÌØ×¼EÔÁî8]u±„þÿjVÿÌ ìÑöcÿU&9ø¦9' ðøýÿÿÿàÿ›%¦°ƒË ò _ýý_þý7üýÿ÷ñàÎÞÚÅCƨàÐ^àäMÿŸLUÿ¶JtRŒ®êY*7ü¥;( èúþÿÿÿÿÿØÿþŸ'©ÿµj³ýïÃ"  ÷ýýÿÿþøó âÑíßÏ=þÃ× Rlõ®”þÿÿ€¯¡”Q_V_ªÿAR ø¬:îýÿÿÿÿÿÿÞ˜#­¸EpD%¬/õþýÿÿûö âÒîæÏHþÀŸÎÿÿÿÿÿÿËÿ¥b$&3¥9òùýÿÿþØû•-¯ýÁ>kI+±*÷ÿýüù ãÒðç×L™Åÿÿÿÿ*Öœþb5|ÉÿLžÜÚÒïeÊëõòøÿÿýþüÿüÿüþýÿýü'úý_ØN6•·çÛaâÔúùþûöõ áÒûå×V™ÅF„Z‡†ÖÃÿ;=ÅcCû3ZìÍc"49ÿ¢6 óýÿÿÿÿÿøÒ’µÎÿþþÿþÿÕõÑò„ãŒI¤!ýø+üË¢˜héi¾îeÎmCOˆ¬µJÂGƒ?EÁÿÕ0 ðÿkÿüIÿûüýûþûÿúÿÿüüÿýÿ×òÍñœ„ã…LÁõðvÿøùøðýc EŒ—B®©Ó9­‰pÿ½Aÿÿ‰ÿ&LQµÒ? íýdÿTÿúÿÿÿÝøÊõ¯ækWÿà’}þKäÿÿ³ ü‘õ¾uï?ajÁŸ;ÿ[ç‘™ogÿÿ²aWOŸªÿÎKÛð`R ÿùÿÿÿàúÈõ¶}è^Gÿè‰~Mÿþÿì¦ý–îÁxôº®NÕ(ÿ3}Ф¬\Tâè²T."ÏÒdVÿûÿÿÿÿýãýÉöÇ{éS%€zÿWÿùÿþçÿÿ© šùÎ}ò:3ÒÆÍ.Àÿ@ÿÿÌ5ÿ}Ó¤cZÿaÿúÿæûÊùÏWêO 5î鈌 /üÿüÿÿÿëÿ¥(Mû•Ø’‡ý½ÿÿDÿ(™MF5Ô cSûWÿüþüüþýÿýþýÿüþýýéùÌöÖÊ` þ åyõß÷é*úÿùúùüøúþøúþùúþûûýúüûøúùùUØ­þ]ÿÿCy€G&ãÚò òÏÿìNaÿ ÿÿÿþÿÿÿýîüÊúߟü PÓóöð¬„;T|Åþ êA ? êþÿÿÿàÿý¤ª« üåùçó÷ùüüþ >öÂÁLÿe%þþÿÿòü Âûï®ùkÇKÍ üù,ý·ÚÕý #þ< # íþÿÿÿÿÿàÿû§ô˜¡ÿ«ÿU(tf6ÀÃåÿÐA ý`*ÿÿÿþÿÿÿÿöýÄûó¥ùˆËùè× ööùòöùÞîëþúôüÊþû2þþùþûþýþþþþýÿþýþÿüþý4õýÌÚ•ã}†¬ÝÚ/Þý'åòþ·ÓAÿbÿ,ÿþüÿÿýû Ãûü’÷–Üý×ÿÿþýÿÿü÷ûÿîýÿÿ2xôþÿÿÿÕø¨ ¥ºùüüúÿýþýþýÿý ýð÷ñ §ç6,ÿ`þ-þþÿÿþÿÿùýÆüœù±×ýâ ÿÿÿùöòÿ þøíîÿ )ÿþÿÿÿÿüý"ûÖïþýÿ ÿÿ&[GDCöÿ ÿÿýÿÿÿîÿÿ¬üÑÎýÂýåþþñÿöúÿúü ÿ  ÿ@ÿ*:ÿÿÿÿþýû÷ÿæÄûиÿáþèøù âþÿüùýþÿûûÿùþüûüÿþþÿÿþþýÿþÿÿÿÿÿÿ þþüþÿñññôúúù ûþöùóþýþþýÿþüþþýÿÿÿÿþþýþýüÿÿþþþÿýþ þòóýÿÿüþýÿÿ òôÿÿþýÿÿÿÿÿÿÿÿÿÿÿþÿþÿÿþ ÿúýýÿúþÿÿÿÿÿÿÿÿÿÿÿÿÿÿœZ ;IDAT1ªÎ£yá§IEND®B`‚qt-client-4.1.0/guiclient/images/icons.icns000066400000000000000000001005141217451700100206340ustar00rootroot00000000000000icnsLics#H||>|xðÀÀðp>x||þ||>|xðÀÀðp>x||þis32c•éÒÒÏ¿ˆyÚÑÒÒˆÇØÎÐщ†ÔÍÏÕ‰ÏÒÍÌЈ3ÍÍÌ뇹ÐËËÔq‡ÌÉËÒ¸†?ÈÈÉÎ|‡ÆÈÇLJÃÆÅÉ·|––”t‡¬9V€U?‚ …‡i-OLJK€{}~~‚€DK€Guwv|[‚&A€=`hi%„9<9:8????:QjžðÙÜÛÜÞ  qÿÿÿÿÿÿõ2™îÊÎÌÍÛŒeöÿúûùÿü!¥âÌÐÎÒÛ’Xþÿ÷øøÿ÷-¯ìÌÏÏÐÜ|Cÿýõöõüÿ8¸ÞÌÏÎÒÛ|ŸÿïóøÿD ÂçÌÏÐÑÚh²ÿóÿQ ËÛÎÑÐ××a»ÿUÇÚÏÐÐÓÓOQAßÐÑÑÐ×é4žÙÓÒÑÎöu&ªÞÑÑÑÏ胑ÜD ”ßÒÒÑÎõ‘{ãèÕ7›ßÔÒÓÏæœoìÞÙêÎ<ƒßÒÒÒÏï«9ôÞ×ÙÙàÇ$‹ÞÖÒÓÐà¶\ôÓÕÕÕå¾1sÝÔÒÓÐãÄ/#&$ ~èÓÓÓÓÛµzÛ×ÑÒÑØÐWV`[RK4™äÐÑÑÑá­( G¢åæâââåâŠURB65FX`ÊèãääåéËj1  $5.,023540-)+..,+.164320.73  ich#Hÿ€ÿÀÿÀÿ€ÿàÿÿðþø?ü?üøþðÿàÿ?ÀÿŸÀÿÏ€ÿçÿðøøÿòÿçÿÏ€ÿŸÀÿ?àþð?üøø?üÿðþÿðÿÿÿïÿ€ÿÿÿÿÀÿð?ÿðø@ÿ€ÿÀÿÀÿ€ÿàÿÿðþø?ü?üøþðÿàÿ?ÀÿŸÀÿÏ€ÿçÿðøøÿòÿçÿÏ€ÿŸÀÿ?àþð?üøø?üÿðþÿðÿÿÿïÿ€ÿÿÿÿÀÿð?ÿðø@ih32¡ÿÿÍÌÿ¬š­ÞÑÍÑÐÓÓÌ y¯ÚƒÓÔÒѪ¡t²ÚÕ€ÓÒÏÌ¡tµÛ‚ÒÓÒÑЪ¡x¸ØƒÑÒÒС*{ºÚÑÏ΀ÑÒÑÏ¡ 3|¿ØÐÏÑÏÑÏÎÑÌ¡€ÀÔÑÎÑÏÑС C‚ÂÖÍÎÑÎÎÐÎÏ¡ J„ÆÓÍÍÎÎÍÎÎÐË¡ IŠÇÒÎÏÎÎÏÏÎÍà¡Z‹ÉÒÎÏÌÍÍÄ¡]ŽËÑÍ€ÎÍð¡‡Â΀ˀÌÍ̬ªŸ»ÑÎÌÍÌÎКiŸÃËÌ€ËÌÒŸgŸ °ËÌËÌËÌËÌËÑ¢iŸ™ÌÉȀɀËѨkŸ ‘ÆÉÈÌËËÉÈËÒ¬nŸ?ÆÉËËÈÉήq ÃÈÈÉÈÉϱt ÄÈÈÇÈÇдw(Ÿ ÆÈÆÇÇÆÆÇÇÌ·{  ®ÆÆÇÇÆÆÇÇͽx Ÿ ÀÇÇÆÈÇÈÆÇÍÁ|ŸªÉÅÄ‚ÆÉÄ~Ÿ“ÑÍÍÌ€ÍÎÒÅ‚ŸE€‚‚…q!‡ ÿÿÿÿ¯ÿÿÍ3$ ™f‡=AUNL€UNOPOUˆU…ƒ„†„Œtg‰-CR„QPNU†U‚„…ŠvU?Š)BPNLMLMK3…~€„‚…uOŒ)AO€L€KLKIUƒ{}|ƒ}sOŽ*AK€IH€IHF‚ tvywvwyyw{qM)>HFEFDDEFFBUut€rssrrunK‘ (??>@?><-HehghghcE(• %7=;;€< :=:<>?@@ABB=81--.011/--/5;BCBAA@?>==B>/  !$&'&''(((('&%#   it32%šÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿáÿÑÒÌÔÔÍ´ÕÍÕ¸Í×Ïÿ’ÿƒÿÿŸÿ•ÿÿ™žËØÖרÍ××ÔÐÒá…Ó‚× Í×ÖÎÛáÿÿ’ÿÿ€ÿUŸÿ˜ ÿUj€ÁÑÊÓÓÑÑÈÓÑ…ÒÑÒÒÔÙÓÐÔ£€ÿUÿ€ÿÿÿ ÿÿÿ• ÿÿnmy¢ÌÓÕÒÔÕÎÏÉÓ¢ÿÿÿ£ÿ€ÿ•ÿÿÿÿrmq¡ËØÕÑÒÔÒÔÕ×ÔÓÓf‘ÿÿÿ¢ÿÿÿ•ÿÿUÿ\nrªÌÙÓÖÕÕ†ÓÒ‚ÓÍÕÍÌÿÿŽÿ€€ÿ¡ÿÿ— ÿÿÿUoxªÍÒÖÒŽÕÒÔÓÓÒÚÈÿŽÿÿÿ ÿÿÿ˜ÿU€ÿÿfnw©Ñ·ÔÓ ÔÓÒÓÕÓÑÒÕÌÌÓ’ÿ¡ÿÿÿŸdl}¯ÌÑÔÒÓÔÓÕÓÑÔ…ÓÔÓÕÎÑÐÒÒÖÿÿÿÿ‡ÿÿÿÈÿÿpl{²ËÓÔÔÑÎÓÓÍÕ…ÓÒÒÕÔÓÒÒÔÐÌÿÿ†ÿÏ `m¶ËÓÔÒÒÑÓŠÒÔ€ÒÑÔÓÒ€ÿ†ÿÿ U¨ Ulo…¶ÎÕÓÑÓÑÒ ÔÑÓÑÎÓÒÏÔÓÎÿ†ÿÿ ÿ© ÿdo‡µËÔÐÑÒÒ ÔÐÒÐÓÓÒÒÏÑÒØÿÿ†ÿÿŸÿ¨ÿÿÿkn¸ÑÖÓÑÑÓ…ÒÑÑÓÑÑÓÑÎÕÒÏÓÒÕÿ­ÿ¥ÿÿ€ÿmjŽ»ÍÕÕÓÒ…ÑÒÎÒÒ€ÑÔÕÕÓÒÎÓÐÿ¦ÿÿ€ÿ¨ ÿÿpg‘ºÎÓÓ†ÑÏÔÏÍÓÔÑÑÍÏÓÑÌÎÍÓ¨ÿ± fllÀÐÏÏÑÏÎÑ€ÏÑ†Ï ÓÎÓÒÎÎпÿÿÿ×ÿUpn”ÄÏÐÑÑÏÐÔÏÎÑ…Ð ÔÌÑÏÑÑÓÎÒ»€ÿ×ÿfmm—ÁÏÑÏÒÓÐÏÑÒ…ÐÑÒÑÑÒÓÌÓÍÑ£ÿÿÿ›€ÿµÿÿsnk™ÇÑÎÑÓÎÑÓ†ÑÏÑÓÑÎÑÒÎÑÒÑ»ÿÿÿœÿ¸ ÿ?pl›ËÌÍÓÑÔÒÑ…ÎÏÍÔÒÑÔÑÏÑÍÓÓqÿÿ™U¹ÿ€ UUlp¡ÈÓÎÒÒÏÍ…ÒÓÓÌÓÓÑÒÏÍÏÒÐÑ™ÿ—ÿÿ·ÿÿÿflq¡ÈÌÎÏÒ전 ÓÑÎÌÑÑÏÏÎÔÍÑÌ€ÿ—ÿÿÿ¶ÿÿÿ\ir¥ÌÏÑчÎÌÏÐÏÐÑÎÓÌÍÐÍÌÐÿÿ”ÿÿÿ¿ckt¤ÈÑÍÍÒÏÍÎÒ…Ï ÑÏËÎÌÑÉÐUÿÿÚnlw®Ì€ÎÏÑÏÏÎÌÏ…Î ÌÍÏÏÑÕÌÐÔÿŽUÅÿfk{¬ËÌÏÎÎÏÎÎÏ̆ÏÑ€ÎÒÑÏËÍ’ÿÇÿnk}±ËÍÏÎӆРÎÏÐÏÎÎÑÌÍÏÒ€ÿ‹ÿÿÈÿÿil²Ë€ÏÑÎÑÓ…ÏÌÕÑÍÓÎÐÔË×ÏÓÿÿŒÿÆÿÿÿcl€²ÉÓÏÏÎχÎÓËÍÏÎÏËÍÌÏËÐÿÿ‡ÿ€ÿÇ ÿÿgkˆ¯ËÍÎÍÏ͇ÎÌÓÎÏÍÑÌÏÎÎÐÇÿÿ…ÿÿÅÿÿ€ÿkjжÍÌÎΈÍÒ΂ÍÏÑËÉ˱€ÿ„ÿUÿÍhm‡¸ÍÎÑÍÏÌÒÌÎËËÌÍÞjmŠ»ÌÍÏÍ ÑÌÏÏÌÏÉÍÎUÿØÿÿkk’¾ËÏÎ ÍÎËÏÐÏÌÏÉÃÿÛÿUn{±ÌÑŽÌÍËÎÌÍÇÐÊÒ»ÿÿÿÿ×ÿ¢ÄÌ ÍÍÐÍÎÉÍÏ̯¦UÜËÍËÍÌÍÏÌÍ̲̀‡llÿÿÕÿÑÈÉÍÌÏŽÎÉÈÎÎÆ³nfÿUÿÿÖÄÎÆÍÑÌŽÍÉÌÏÌȸ‡jeÿÿÿÿÍÿÿ‚€ÌÊÏËÒ†ÍÈÍÌÎÍÍÎÌÒÍÑȹˆjlÿ‚ÿ€ÿÿÿÅÿ€ ÿÿÀÃÇÓÇÌˈÌÍÍÌÌËÌ È̸ipÿUÿÿÿÿÉ ÿÿÿ·ÐÉÐÉ€ÍÈÉ…ËÌ€ËÌÎ̀˾li?ÿ…ÿÿÿÿÆÿÿÏÐÊÈÊÍÇÍÉÌɆÌÈÈÌ Èͽ—jhUÿÿ†ÿ€ÿÆ ÿ­ÊÈÄÏÎËÌÌËË†Í ÌËÍÌËÌÍÆÀ•hi€ÿŠÿÆÿª€Ì΀ËÍË̈ËÉËËÉÌÍÀŸih_ÿÿ‰ÿÿÿÆÿ¹ÌÒÉËËÌÈÈÌË†Ì ÈÌËË;›nktÿÿŒÿÇÿÅÌÆÉËÈÌËËÈÍÉÈÈ†Ì ËÍÌÇßrgQÿÕÿ€ÿÀÌÈÍÇ̆ÈÌÇÈ€ÌËÈÈÉÆÈÁ¤sgWÿÿÿÿÿ¹ÿ‚ ?ÿÃÏÈËËÈˈÌËËÌÈÈËÌÍÌÈÈ¥sjhÿÿ‘ÿÿÿ€ÿµÿÿÿÿÆËÆËËÉËÌˇÌËÇË€ÌËÌÇ«yhh˜?ÿÿµÿ€ ÿÆÊÊÈÌÈËÌËÅ†Ë ÈÉÇÌÌËÈÉÄ­wijÿ–ÿÿÿ¶ ÿÿÀÑÅÌÍÌÍÈÌË†È ÍÌÈÌÌÈËÈÆ¯yh\ÿÕ ÿÿÅÅËÈÈËÈÆÌÆÌÍ…ÌËÈÌËÇÇÌȯijÿU?˜€ÿ¹½ÄÆËÇÈËÉ€ËÈÆ…ËÉÇËËÇËŬidÿÿÖ ÿÉÅÇÆÇÉËËÉÉÈÉ‡È ÌÆËÌÆÇ¯„lkÿÿŸÿ®ÿÿ€ÁÉÉÆÊ‡ÌÅÌÈÈÌÈÈËÇÉÇÈĵ…ilÿÿÿ¡ÿ€?¨ÿÿÿ¹ÇÆÍÊÉÇȆÇÈÇÇËÈÇËÈËÉǶ…miÿÿÿÿžÿÿÿ¥ÿÿ€ ÿÿÏÉËÇÈÇËÉÇ…ÈÌ€È ÌÈÇÈÈÇȶˆkh€ÿ£ÿÿÿ¨ ÿÿÿºÇÆÎÆÉÈËˈÇÌÈËÈÆÇÇ̺ŽjgÿÿÿÿÿÿŸÿ€ÿ¦ …ÊËÌÇÈÆÇÈÆÌ‡ÇÌÌÇÇÆÉžmgUÿÿÿÿÿÐ cÆÀÂÆÆËÆÈÆÅÄ…È ÅÆÈÆÆÈËȹ“ii…UÿÿÏ ™ÁÇËÇÇÈÄÄÈÌÆÈˆÇÅÅÈǸ–hf€Uÿm?U‚fŸfÿ¥ÿ¸ÀÌÆÅÌÇÆÉÇÌÆÇÈ…Ç ÈÈÇÆÇÇ·œld!€ƒÿ¥ÿžÿÿÿ€ÿªÆÇÊÇÈÅ…ÇÈ„Ç ËÆÆÇÇÀšie·ÿÿ™3ÿuÌÆËÃÈÉÌ…ÆËÈ€Æ ÇÆÇÉÈËŽ¥mf&³3€3› 33UÆÁÄÅÉËÇņÈÇÈ€Æ ÇÈÆÅÅÀŸqb)º3™U¾ÆÍÅËÉÇÅÆ…ÈËÇÈÇÇ€ÈÇÆÃ qh"Ú -¸ÊÄÌÇÈÈÆÉ†ÇÉÇËÉÇÈȧsh%»­ÅÆ€ÇÆÆÄÄÈ…ÆÇ€ÆÈÇÆÆÁ¦wh.Ù ¨ÅÇÅÆÄÈÆÅÆÇÅ†Ç ÆÅÇÆÇ¿ªyh/Ü£ÃÇÄÄÆÄÆ€ÇÆÇŠÆľ³|j3‡‡œ‚žxÅÁÃÇÅÆ ÅÇÆÇÆÅ­|i5¡”€™fÁ±}|}|wz€yskl2£˜—Dnjhkhimjilimilh:¥–°€€ ×½¸ü „ ›¹ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ·ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿJU:UFUKRURŽU:Oÿÿ”ÿÿÿÿˆ…Žˆ‹sˆvˆ‹y…s…‡lÿÿ–ÿU=PM[PLUPPF>DK…Q‚PIPLMSKÿšÿÿU„ˆƒ }‹‰ƒ{‘‡ˆŠyf€ÿ–ÿ'3IUKOOQUOSU…RQ RRUTUOS6ÿUÿ‚ÿ€ˆ„‡†Ž„ ‡„„ƒ„ƒ„ŠmNM€ÿ• ÿÿÿ!+)=PRRQ‘RMLMP.ÿ’€ÿÿˆƒ‚Š„… ƒ…ƒ†ƒ‰‡|bKN€ÿ˜ ÿÿ#,*?LQPPQRQŽRQLOUfÿ’ ÿÿÿw‡ƒ€Ž† ‚‡…‚†|\JKÿ€ÿ• ÿÿUÿ*(.@MRQ€P†ON€OQPNQUQ’€ÿ€vƒ‚‚†Ž‚‡‚z_MKÿÿÿš ÿÿÿ&*ÿÿ§ÿ€ ÿ#%2@GFIGFE‡G IGGIGFFIHCGEÿˆ ytsruwuvtuytty…uwutuwubEB=ÿÿ¨ ÿÿÿ$#1AEGGIH†GFGG€FGGFEGHB>ÿ†ouoxrptsstussts‡tsvrbHCI€ÿÿ?¨ ÿÿÿ""2?BEC†GDEF€E DGGDEGAHC>…tqqpqrp€rtrs†rprncEA?€ÿ€ÿ­ 3$"/?CFDGDBDC†DEFEDDBA/€ ÿÿhoppqpopo…pr€p oppoopocE@4·U#"->D€CDCCDD‡CEBDCBJ@DDÿÿHHKZjmoqmp‡op€o ppnm_G=;ÿÿ¶ÿ3"0=€BDCCBBD…C BABBAEBB?A=€ÿU==Rfjkl†kjkjnljjkj`F;?ÿ¶ÿÿ2>C@?@C@=?…@B@B€@A@>E>5ÿÿÿ7==SeŠjil€jg^H<=ÿÿ·ÿ".=?@==@@?…> @@=@@=?@<><<‚/;;@@>…=@=<=?==@@=A;Afÿÿ.7>Rcg…effcafc[I7:ÿÿÿ¶ÿÿÿ".9<<=@‰=;>=;==<<:<:$ÿ<8=U]‡cfcaZH67€ÿÿ·ÿÿ#1:=;9‡;>=9;:€<:;7ÿ€(2>R…a ^abbYG38ÿÿÿÿ¿%-;998ƒ9;;†9€<987AUÿÿ15;R\]^]\]^^]_YD53Ç ",…988†9669789€3ÿÿUÿU33;QW_\\Z\[\XD34UÆÿ ,7975579578…797<59:553=ÿÿ*3,,ÿÿÈÿÿÿ!*0/2/32…3/32352402.,ÿÿH-*7<*,ÿÿÿUÆÿÿÿÿ ,//33†/4/33/3//3/2010*ÿU€)' ÿÿUÿÿÍ*-/,2/01,.,+01ÿ$(+ Ö)+-/-,0//33)*$UÿÿU=Ø (/)* --,)/*/',-ÜÿU#+)Ž* ))**),*)+ÿÕÿÿ'(Ž*)(*+*)()*" ÿÿÿØ%&),*) ())""ÿÿÙÿ5#($&(Ž% )&*)'!ÿÿUÿÖÿ"$*'"Ž% $($#&!ÿÿÿÍ€ÿ‚€"%'#'#…$&$#%$$%&#€$!ÿÿ.>ÿ?ÿÊ ÿÿÿ(! "$!#$…#„#"# ÿÿU2110ÿ€ÿÿÅ€ÿ€  ! "$!" …#"#"!€# €ÿ0)/.2.ÿÿÿUÅÿÿ%! "!  † ""!""!  ‚ 3)/2.-.#ÿÿËÿ!€!…Uÿÿ))++*))+*ÿÿÿÅÿÿ#Š  ÿ+*))())''*$ÿÿÆÿ…ÿÿ%$"%(%%('%%&#ÿÅÿ€† ÿ##%##%$$&%##'$#Àÿÿ$€‡ €ÿ$!!‚ " #$"##ÿ€ÿ€ÿ·ÿ€ ÿ†. ÿ   !ÿÿÿÿ™ÿ¹ÿÿU€ˆ ÿÿÿ€ ÿÿÿ¸€ÿ ÿ‡  €ÿ€€ÿÿ·ÿ€€Š€€  ÿÿÿÿ¶ÿÿ†  ÿUÿÿÿ¹ …  ÿ€€¸ÿ … ÿÿ‚ €3ÿ¯ÿÿ ‡€ ÿÿ €…†€ÿÿ© ÿÿÿ ‡ ÿ‚    ‚€ÿ¨ ÿÿ  Š €ÿ ÿÿÿ … …  € ÿÿ¨ÿÿÿ     ‡  ÿÿÿÿ † …   ÿÿÿª  € ‡  € €ÿÿÿÿÿ€’  ¯     …  €  ÿÿÿ Uÿÿ ……   «ÿÿ  †  ƒH„3€Ž3ÿ¦ ÿ  † ‘ £ÿÿ€  ‚ ”‚ÿUÿ•ÿÿ3U€     “ “€3šUƒ  š’€…f—ƒ   … † ¯€¦  †  Ý   Û   ‹Ý ‡€’Å Ž ¹ÛŽù¤Ø¹ ž÷ šƒœ Ý ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ”ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿàÿÿÿÿ€ÿÿ†ÿÿÃŽÝÏÜÔÝÙÌÜÈÊÔÊÐרÿ–ÿŸÿÿÿ’ÿÿÿÓÎÎŽÓÇÒÔÎÓÓרÒ×Á£ÿÿ—ÿžÿÿÿÿƒÚØÚÒŽÕ ÑÑÕÓÔרֲ~qÿÿ™ÿ´ ÿÿÿÿÿÌÎØÔÙŽÔ ÖÔÕÖÖÕÆšyw‚ÿ•€ÿ¡ÿÿÿƒÊÖÕÖÓÒŽÕ Ó×ÔÕÖÁ–yyÿÿšÿÿÿ°ÿ‚ÿÃÙÔÐÏ×ÒÓ ÔÓÕÓÒÅšxf€ÿÿ—ÿ€ÿ°ÿÿ€ÿÉÏ€ÒÏÔÔŽÒ ÓÒÑœxv3ÿ€ÿ•ÿ· ÿÿÿ™ÑÓÒÎÑÏÑÍÏÒÑÉÍ¡vt™ÿÿÿÿžÿ€ÿ†ÿÿ€ ÚÌÊÑÉÑÏÑÑÏ…ÎÌÑÎÑÌ€ÏÑÉÄžyrfÉÿ€ÿ…ÿÿÿªÏÆÎÍÏÌÌÍÎÏ…Î ÌÍËÎÌÎÌÏÍĦwtc¨ÿÿŸÿˆÿÿªÎÊËË€ÍÎÌÍÉ‡Í ÎÎÍÍÎËÁªtqfÿØ ÿ$ÅÌËÈÌÉÈÌÉÈÍÉ…ÌËÉÉÆÈÈÉÆ vpxÿÿ©ÿÿžÿˆ ‘ÈÉÊÇÌÇÈËÉÆÉÈË†È ÌÈÉÍÌĦ{rvÿÿªÿ« ÅÄÆÈÅÇÉÅÇÈÈÇÄÈ‰Ç ÉÁ£wnfÿÿÕÿÂÆÈÄÆÄÇÆÆÉÆÅÄÇÆ†Ç ÄÆÅÂ¥zplÿÿÿ«ÿ¥ÄÂÃÂÇÀÅÂÂÄÀÂÅÄÂÆ‡ÅÀ§{rp„ÿÎÿÿÿÿ±ÀÂÄÀÅÄÁ¿…ÁÂÁÁÅÄÁÀÅ©}lc¶ÿžÿ€ $‡‰Ÿ·ÀÀ¿ÀÆ…ÀÁÀÁ€À Áŧ}nhÿÿ¶ÿž ÿÿqio”¶½¿»†¿¾À¾½»¿¾¿½­{jnÿÿ¶ÿ¡ ÿXno™²¾½¾…»¾¾½½€»º§€jj€ÿ¶ÿÿž ÿÿ?km—°¿·†º½½¹»½¶«€iiÿÿ¸ÿ ÿÿ\hp˜¸·…¸ ¶¸¸º»·¦Šfm»ÿÿÿž€ÿjioŸ°†µ ·¸µ³¥cgÿÿ¹ÿÿ£ÿe_rš…³µ¶³²§Šag€ÿÿá€ÿUho¯²·±±°µµ¯±¦…eeÿël`qžª°¯®°®¯¯¦ˆbemÆÿŸÿÿYbu¨©¯®¯«¡ƒb^ÿÇÿžÿÿfauœ¯­ªª b_LÿÈÿ¢ \]wšª«œ|`ZUÿÈÿ¡€ÿ[\w— }^ZÿÿÿÅ€ÿ¡ÿÿ_[p|Y[‘ÿÿÿÈÿ¡ ÿ_XZXYCÿÿñÿ[XZb÷ÿÿ-=Öÿžÿÿÿùÿÿ×ÿÿÿÿÿÕÿŸÿÿÿÕÿÿžÿ€ÿÕÿ¡ÿÿÏÿ£ÿÿÿ{ÿÿÿÿÿÅÿÿ €ÿÿz‹‹ˆÿÿÊÿŸ ÿ‹Š‰‡†ÿÿÿÇÿ¢ÿwƒ‚‡……x‚ÿìÿi}ƒƒ€‡€ÿÿÇÿ ÿÿž‚†‚€|†zÿì ÿÿ}||}~{€€}€{ÿÆÿŸ ÿÿUuu||wyz~{y€zxzÃÿÿ ÿ‹{{~yz‚y |yz{zt{ÿ€ÿÿµÿ§ÿÿysrrszuvywwyrvtwyxwÿÿÿ·ÿÿÿ  ÿÿÿUmrssuvwus€uruutwuptuÿÿÿµÿ€ÿ  ÿÿenmqussqrr€spstqirptjaÿÿÿ¹ÿŸ€ÿuknqpmomnpqooprmmrpoonqofÿ¶ÿÿ£qhpomkoomookknonmomplmnnlpZÿÛ!ÿÿÿÿlngolfmkmkkljikllmhmjmjljjim=Ú#ÿÿÿ_jjggjhjghhjjhiifgikiihghfkcihz¯ÿÿÿžÿÿÿÿDLVafifbhi€fhhfc†fekdhacÿ¬€ÿ€ÿ ÿÿÿÿÿ547Paef€ebb€ef†efbebd_b:ÿ€ÿÿÿ¥ÿÿÿÿÿÿÿ€-37K^b`a`€^‰bfa\a`a`[€ÿ¬ÿÿžÿ€ÿÿ*34I^_†]…_€`Z\_`bXªÓÿ‚ÿÿ036K\`^``]]€^…] ^^\`\`aZ^Z€Ì?ÿ† ÿ315LX\\_‚\…[ Y^[Y\]_\X[QÑÿƒÿ€ .5GVXYZZXX†Y [W[WYWYY]\UX©ÿÿž€_"‚"/7PT‚V†WTWVXUTYVWU\WSÿÿÿ´ .5HUWUT\UVXTRVY]€ÿ ÿ?Ÿ +4KQR€TUTWSQRNLUÄ”"-2FSRV†R…UTRRSNRU=„U–U»*4HPRUP QPPNUPOO<€3™¼")4GIO QKQOOPSOA—8¿(6FOPLPOLKOP+½)7INŒP OKOMKPKLFLO(Ó)7€L‚K…L QJKNNPLOMKLGÞ!+;ENMMONŽMLOFJFÞ #$*/..00.00/0/‰0*-;JIÝ$()''**'…*)*))*)'++&)-›šÛ ˜ŸÿÜ Ø"ÝÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÙt8mk@>E#$$$$$$"%$%$$$$$$$$$$$$$$$$$'+.----------------+,*-)-,*,*,7f!«ÐO83533361435555555533333432EkGtE@@@@@@@@@@@@@@@@@@?B?@@ABE•þ}¶ÛÑœƒ‡‡†‡„†‡……………………††††……„‚itƒE«~‰¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤£¤¥££«Ýþý‡ÂßÖÕÏÏÎÌÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÏ´…| <®—¾óþþþþþþþþþþþþþþþþüþüÿüÿÿþÿý–ÊÞÕÑÎÑÏÎÐÎÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐϵ‡{ 1¯˜µñùÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýÿþýÿþûþŸ$ÌàÕÐÒÑÐÑÑÎÎÎÎÎÎÎÎÎÏÏÏÏÎÎÎÑͰ€‡t+±›´ìÿüýýýýýýýýýýýýýýýýÿüýüþüýÿ­*ÓÝÒÐÍÑÍÑÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÏÍÐ̯‹l&ª™°ìúýþýýýýýýýýýýýýýýýýýüüþüýÿ¹2ÙÜÔÓËÐÐÐÐÐÐÐÐÐÐÎÎÎÎÍÎÏÎÐÎÎÊ«}‰i¨ªçýüþüûûûûûûûûûûûûûûûûýûýÿüûà 8ÙßÔÑÎÑÏÏÍÏÐÑÎÑÎÎÎÎÎÎÎÎÐÎÐÏÊ«}‰d¥Ÿ§äûûþüüûûûûûûûûûüûþûüüüüýýýýÉDßÛÒÏÎÐÐÎÏÑÎÐÏÎÎÎÎÎÎÎÎÌÏÐÐÎȦ‰U §ßüúøûüûüüüüüüüüüùýüüúûüùþýýÒMÝÞÔÏÏÎÏÌÐÍÍÒÏÏÏÏÏÏÏÏÏÏÏÑÏÏÉ¡}P—Ÿ£ÝûùüýùüúüüüüüüüüúýúýüúüüüüûØYâÞÒÎÑÒÐÏÐÒÓÐÐÐÐÐÐÐÐÐÒÎÏÎÍÓÉ ~I žÚ÷úûúúúúùúúúúúúúúüúúøøûúùúýÞ"fäÝÔÏÐÑÐÎÎÑÐÐÐÐÐÐÐÐÏÒÑÎÑÑÑÎÉ{ŽB¡œÕõùúû÷øùúûúúúúúúúúúúú÷ÿùùþþè)rààÒÐÎÑÏÎÍÏÏÏÏÏÏÏÏÏÏÑÏÏÑÏÏÏÇ›|Ž7„¢šÓôûùùøúúøùúùùùùùùùùûùøùûüùùë2~ßÞÒÐÑÑÑÒÐÐÐÐÐÐÐÐÏÏÏÏÎÎÎÒÑÏÆšŽ1{£•Ñòöøùøøú÷øøùøøøøøøøøøùùùùøúò;ŒÞÞÑÎÑÏÐÐÐÐÐÐÐÐÐÐÐÑÐÑÐÏÐÏÐÑÅ“){¨–Éôùùùùöùùùùùøùùùùùùùùù÷ù÷ûøõD”áÙÑÑÑÐÐÐÎÏÐÐÐÐÐÐÐÐÐÐÐÐÐÑÑÑÃ’~ ‹÷¸Éð÷öøö÷÷÷÷÷÷÷÷ù÷÷÷ö÷÷ööõùú÷÷M ŸâÙÓÐÑÐÐÐÑÐÐÑÐÑÑÑÑÑÑÑÑÐÑÏÐп”~ŽÂ÷øøõøøõø÷÷÷÷÷÷÷÷öøøùø÷øø÷÷öøûZ ¨àÙÓÐÏÐÒÑÑÐÏÒÑÑÑÑÑÑÑÑÏÏÏÏÏÑÀŽŒÎû÷ö÷õ÷õõõõõõõõõöóöùöôöõ÷÷÷ùh ±ßÚÔÓÎÎÑÓÐÎÎÐÐÐÐÐÐÐÐÐÐÓÐÎÐϽ‹…†×ûõòöôõõõõõõõõõöõöõõõõô÷ùúuºáØÓÐÏÎÐÐÒÎÏÏÏÏÏÏÏÏÑÏÎÔÐÎÎѹ‹‚‚  Þùöôôôôôôôôôôôöôôõ÷øöôøû€¾àØÑÒÏÍÒÑÐÏÏÏÏÏÏÏÏÑÏÏÎÒÐÏÑϵˆ„€ ,ãùó÷õôôôôôôôôôõòòóöôû÷‘ÊãÕÑÏÍÑÒÑÐÐÐÐÐÐÐÐÐÏÐÏÑÐÎÑÑÌ´‚‡z7ïöõñóóóóóóóóóóõóóò÷õ!ËäÙÒÑÎÏÏÏÏÏÏÏÏÏÏÏÑÑÑÑÑÏÏÑÏႉr?íùóóóóóóóóóóóõôóøõ¨)ÕÝÔÒÏÐÎÏÐÐÏÐÏÏÒÐÐÐÐÐÐÐÐÏÒÐÍ­‚‰mNõõôññóòðñóóòóôô÷².ÙáÕÒÑÑÑÑÐÑÐÏÑÐÑÑÑÑÑÑÑÑÎÎÑÐΪ}Š_^öôòðõñòñòòñòô÷½7ÛßÖÓÐÐÑÑÐÒÑÐÑÐÐÐÐÐÐÐÐÑÐÓÑÑΧ|WlõôðñïñððïñòöÄ EÝÞÖÔÒÐÑÑÑÒÑÑÑÑÑÑÑÑÑÑÑÒÑÑÒÑÈ¥{‘J‚÷óñóðïïòòõËMßàÕÑÒÒÒÏÑÓÑÒÒÒÒÒÒÒÒÒÑÐÒÒÑÍÊžz•Aöòñïððòõ·WáâÖÐÓÑÐÑÐÑÑÑÑÑÑÑÑÑÔÓÎÏÐÓÑÏÊœ|7žõðîñóó·eáàÑÑÐÎÐÑÏÒÒÒÒÒÒÒÒÍÑÐÑÔÑÒÓÐÇ—.®òñóòÃoßßÖÐÑÒÒÐÐÐÐÐÐÐÐÐÔÐÒÒÐÒÐÐÒÑÅ”$¹óòÍ}àÚÖÐÒÏÓÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÒÓÎÄ€ŽÅÛ‹äÛÖÑÓÒÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÐÏÒÒÑÑ€Š!‘ãÜÒÓÐÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÐÓÏÐѼŒ‚Š ›ßÓÒÐÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÐÐÑÒм‰š¶ÕÏÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÏÑÓÑÐÏÅÑÕ§YȱÏÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÓÒÏÓÓÍÕÜÝP>™Š©ÎÕÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÒÑÓÔÓÓÕàäZ0’œÊÎÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÒÐÕÑÑÓÖÞßj-Ž—ÊÏÔÐÓÓÓÓÓÓÓÓÓÓÑÒÓÓÒÓÓÓÓÑÕÛäz!)%’“ÆÔÐÏÔÒÒÒÒÒÒÒÒÐÐÒÒÓÒÒÒÒÑÑÓÜÞŒ8XMI ÃÓÓÐÑÑÓÓÓÓÓÓÓÓÒÓÓÓÒÒÓÓÖÓÔÞä–5˜`W™H‰ƒÂÐÒÓÑÑÑÑÑÑÑÑÑÑÑÑÔÔÔÑÑÒÒÓÕÙâ¤-›‹™žˆŸ9ˆ‚ŒÂÑÓÓÓÓÓÔÒÒÒÒÒÒÒÒÐÓÒÐÐÐÒÑÕÚà± "šŒŸÕ×¥ˆ‘0‚‚ˆÂÏÐÓÓÑÐÓÑÑÑÑÑÑÑÑÑÑÑÑÑÑÕÓÕÛá·—Œ™ÐááÔ }ƒS }ˆ‰¼ÐÒÓÒÑÒÒÑÑÒÒÒÒÒÒÒÒÒÒÒÑÔÓÔØäÄ”•ÌáßßáÔ¤|W |‡„¹ÐÓÐÓÓÒÒÑÓÓÒÒÒÒÒÒÒÒÒÓÒÒÓÓÖãÊ •ÊÞàààáà×­‰™Oz‡„´ÏÒÓÓÓÓÓÓÓÓÓÔÓÑÐÓÓÑÑÑÐÑÔÑ×âÍ) ˆ‘ÅÝÞßÞÞÞáÞת…™Hp…„±ÏÑÕÑÓÓÓÓÓÓÓÓÓÑÑÓÓÓÔÓÓÔÑÑÙߨ1€ŒÀÚáßÞßààßàÞÔ¥„›<h‹‚®ÏÕÔÕÑÒÒÒÒÒÒÒÒÒÒÔÔÔÔÔÔÓÓÔÛàÜ=w“‰¾ÙàÞÜÜßßßÝÞÝÝÓ£†™4c­ÎÖÓÒÕÑÓÓÓÓÓÓÓÓÓÓÕÔÑÑÓÓÑ×ÚáàCl‘‰¸ÜÝÝÝÝÜÝÝÝÜÜÝÝÜÓŸ†”/Z€«ÏÔÓÔÐÓÔÔÔÔÔÔÔÔÔÔÔÔÒÑÒÓÔÓÙàâSb•ƒ´×ÚÝÝÛÛÚÝÞÛÝÛÝÝÜÚИ‡™#T§ÎÕÒÑÒÓÒÔÒÒÒÒÒÒÒÒÓÔÒÑÓÕÔÔÖÞãVX—†°ÔÝÜÛÛÜÝÜÝÜÛàÚÜÝÜÜÚ̘ˆ˜J‘£ÍÒÓÑÓÔÑ×ÑÓÓÓÓÓÓÓÓÑÓÓÑÓÕÒÖÞå`PšƒªÓÚÚÝÚÚÚÜÜÙÚÜÙÞÛÛÚÛÜÙÉ•ŠŽC|ŸËÑÕÑÖÑÒÖÒÒÔÔÔÔÔÔÔÔÒÔÔÒÔÓÔàåmXÖœ¨ÒÚÚÚÙÚÚÚÚÚÙÛÛÙÙÛÚÚÛÙÚÚLj‹:€ŸÇÒÒÒÒÒÒÒÒÒÒÒÒÓÒÒÒÒÔÓÑÕ×ÒÔÞæ}ºãÜÚÚÚÚÛÛÚÚÚÚÛÛÚÚÚÚÚÚÚÚÚÚÚÛÇŽ‰Š3’™ÉÕÓÓÔÔÔÔÔÔÔÔÔÔÔÓÓÓÔÓÓÔÕÓÖáä…ÉæàÛÙ×ÙÙÙÙÙÙÙÙØÙÙÙÙÙÙÙÙÙØÛÕ‹ˆ† 0|—ÉÔÔÐÓÓÓÓÓÓÓÓÓÔÓÓÓÓÓÓÓÓÔÑØÜã“ÏçÞÙÚÖÙÖ×××××××ÙÙÙÙÙÙÙÙ×Ù×Ö¿ˆ‰€ %„”ÇÐÓÑÔÒÔÔÔÔÔÔÔÔÔÔÒÓÔÓÔÔÔÒÕÚä$ÔåÛÚÚ×××××××××ØØØØØØØØØ×ØØÖº‡Œy .Ž…‘ÅÓÕÔÓÕÔÒÒÒÒÒÒÒÒÒÒÒÒÔÔÕÕÒÕÛä¨/ØäÝÙרØ×××ØØØ×××××××רØ×ÖÕÓ¸‡Œw  .ƒ¿ÕÓÓÓÕÑ×ÓÓÓÓÓÓÓÓÔÓÑÓÕÖÓÑÔßã±7ÞãÜÚØØØØØØØØÖÖÖÖÖÖÖÖØÕÖØØ×Óµ„Žt ‹ÀÔÑÒÔÒÏÕÒÔÔÔÔÔÔÔÔÔÒÒÔÔÔÏÒÙâ¾  KàáÙ×ÕÕÖÖÕÕÕÕÕÕÕÕÕÕÕÖÔÖ×Õ×ÖѯŒhƒ‚ˆ¿ÒÒÓÖÔÒÓÔÒÓÓÓÓÓÓÓÓÔÒÓÓÒÓÓÜæÆ5$#&! "%%#aãáÚÖÔÕÔÔÔÔÔÔÔÔÔÔÔÔÓ×Ô×ÕÓÕÖÍ®_†ˆ¼ÑÑÓÓÓÓÓÓÓÓÒÓÓÓÓÓÓÓÕÓÓÕÕÓØãË@,.,-.,,,)! #+oááÙÕÔÕÔÔÔÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕ×Ω‚‘W ~‡…¹ÑÕÓÔÔÔÔÔÔÔÔÓÔÔÔÔÓÔÓÖÒÓÔÓÝâÐO355585546456550+!oãàÙ×ÓÖÔÔÔÔÕÕÔÔÔÕÕÕÕÕÕÕÕÕÔÕͦ|P zŒ†¶ÑÔÕÔÔÔÔÔÔÔÔÔÔÕÔÔÔÔÕÔÔÕÕÕÚá×]???A@A?A?>@?>@??A@A=7-%wäÝØÖÕÔÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÔÓÓÊ£G    v‹‚²ÓÖÐÕÑÔÔÔÔÔÔÔÔÔÕÔÕÕÔÔÔÕÔÓÙàÚgJKKIIIIIJIIIIIIHIIIHJJJJJDãÞÖÓÓÒÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÖÒÒÔÌž}“C  pްÒÖÓÑÕÓÓÓÓÓÓÓÓÓÕÕÕÕÕÔÕÕÔרâàtSQSRSSVSTTSTSSSSSSTSSRSOC6*(“âÞÖÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÔÔÒÓÊ›€“B  mŽ~¯ÍÔÖÑÔÖÔÔÔÔÔÔÔÔÔÔÔÔÔÓÔÔÔÖÚâàƒ[\]]\\^\\^]\\\\\\\[YNB4/-,4BPW±ãÜÖÓÓÓÓÓÓÔÔÔÓÓÓÓÓÓÓÓÔÓÓÓÕÓȘ€‘@  j}¬ÎÑ××Õ×ÒÕÔÔÔÔÔÔÔÔÔÔÕÔÕÒÒÔØßácccdddbccdedcccbYL?72/6EPY_abbbf¹åÞ×ÖÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÔÔÔÕÔÕÔÈ•‚“?   #$&gާÎÕÔÕÒÓÒÕÔÓÓÓÓÓÓÓÓÓÓÕÕÕÓÔÛßè™iikhhhiiiijh`TIB8111=UahhjjjhihjjmÀäÞÖÕÕÔÔÔÔÔÕÕÕÕÕÕÕÕÖÕÔÖÖÕÕÔÈ”‚’B+(&$"   '2:@Hn¦ÍÔÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÓÒÕÕÓÔÔ×àå¨|urmnlllf\UK<433333333;EQX`illlmpqxÍæÞØÖÖÖ×ÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÖÕÄ‚”XKD?9/(!   -=Q`l›ÖÖÝÝßáááááááááááááááááÜáßßÞßãåÀ…}ujaPC7333333333333333433;HVdku|…žØäåãàáââáââãâãâââââââââââáâßÞÙЀpeWC4)    -=Sb˜ãäçããåääåååååååååååååååååæäåéàÈ –‰rWC:632343233333333333233332349I[u‰˜¥ÛåçææåæçææææææææçæççææææçççææçÖ|gXC4)!   (4 vpAg ‡úœþIDATXÃÍ—mŒ\UÇÿçœ{î;sgfß_Øí¶ZÊ6Û7m…¥o€¦ËÖÆ–BãòEcŒMøñ5ˆ F›ZÔŠ"ʬÅZk V[TºK·¥°»ÝîÌìÎìܹoçÍÓBÑÝÊOò$çžÜ›ÿï>Ïÿ¹ç\‚`ä7ïET hC£ëf\ËvlFlÎ4€°4&œSsîù;/û,¹"ž]È6¹PR;¶mõeÓ|mγWx.ŸçØ,Ç(!„IJ”Ò3#Ç)%G¤ÒoBôþÇ7]9@nÃ(m£XÓ”KÝßwmÓ§–-jjêlIñ¤2ˆ…†TüÓÕµH*cð&!xš²‹P\ˆ"ƒg¿»qnù {E›ÝuÝü†‡ïXÜõñÞV©á‡Q¬ X(‘B5¨ÔüP@J©´QJð¯JefÛð8œ!j㢞ü¾‡¿¼¦­»=ƒñB€(Qï¼y5¨†±Ðõ@* !5ÂX"ú 1æs¤dÍÀæ …W.’–eí;nëŸ×6¯ÝÃÙñ*„ÔÊ ì'˜ª ( ¤l††¬Çf°…1u€(Q#?ë„ÔküvÖ%È-i¶\ÇêhÌ9/ð¡ .”B”}´Ë‘÷ld36<—ÃMqp‹ÂÀ I4‚H 00Jí0–m”³`Œbù’VñÖÿŸ§Ï•ïèéÈŠå¦"ä26\ÇB:Åá¹6òÙ:H:eAk?`ŒÐJWó!t¶c¿»‹~b £?}õlåÕ¿½^D5˜ª&Ð ”€zÍ)%à…m3pÎÀE6mÁK[à}Ö/s‹^Þ„”Rlß¾CCC¹ÞÞÞ5===k8ç× ïÌ™á鱨§ÔÖ»íÖ«»ò«³›* ä<yÏA>ë çÙȦmd\ ŽÍÀ-Š´MP­‰`´ì-W“-F/n^ðÁlܸ¨T*}ßëïï_ŸohHáÄÉàôÐ(˜,½~¿½å[­ ‘ºÛKó^‹Ñ´Å((%0Æ  µÐ‚ë0“vXiJ›£•šØ]ñÅn±ppóüzißÐÞÞŽC‡9ýýý÷õ-"á§^{'ŽCñÍ“¸Ê‰‹™‰RåêFyj7Ÿ?ð ñ‹”’“ÆBêk…ÒÒœRJÿ,zw%ŒÂ'<×zm×oFäî[ù®¹ßP©TÐÕÕ•;=4t}^ᦕ ±À±°êæ5.GV·ãèÑ=¯Vµ´u~òæÎ—Ž8»è“ÅàhkszM:e©(áû„Ð_Ÿ(øoض…oaŇw×Ì6~ÕỺ4ºeç¶¥ënû,@9L<QG4 ¬\ÜŽ›œ–ÏŸ81<ôúkhßð(„Ô·”ÊÑê8ÿ*•yrªû{ZûßÛû½÷ÝJðØ3Â_<·ª8tÐé]ØÄ/‚¥r „h‹Hl]åÄë7Ý´¸ÅœÏnù½ [’^!Õsž}èÜXż¸ëöYu׿P$C¿F£]¾hYÏz¡ü10€Rèê(´?U°pÁ¼ k³î8u|äÇÕ8WüÑÝçÆªÓ…Î~ÈÖ{¹ñ6~¤R¨¦–ën¼[‰ðÛë\aç:AGR@T:ƒ°0³LëÞT¶ã©¶;÷~ù^Š~hf-úàüãÝàùùÐ2Øi¹OZ™V›L!.¿¨<~¤æW>C+-ÿ¦º"áw²~¹Åù÷ŽÂ¥äR•çLTúU2uQé,dX¤©IiôwhîªÒ5-ÿ›8pÙ½`5€ãh¼;«õ’Žnùþ±mkÏlË65e"ÚŒÒÈÄðcÏ V^(¬¾ âÜ$Ð&/}ƒèìÜŽÉÉ“ón¸ák;V¯éúôÁãÓ‹^:ÝÔ°®åï)áU`cÅtÑiÜß½4wÑS½}kdúAðèž÷ÎàÒ—ðAäóWcjêí×?µcÇÒÏ·vgçï?1í×9«8_îÀèL/ö…›È‘ÔÇ·!ÓÜÝá.S±ÞTUJ©èp»öÏ à’ ¿`Êëí]úôÎ+·d28y¾†Ÿÿ¹‘w¬ ¤À P‹Áª\?™¬!Ÿ‰TÞÐ_sÉ„õ.G~IKK榋“ ü‚ÄPIBx6Дš] ëT9T‰Á×R àÚ)Äj+ÔÌ3@zNÎ|ë.{Ar2ŸÆ³€4rÐäÖÃåu€©  à'@(»dR ¬}E&$-¿8]éL`ºr@W p±ë.Éúí‘™‰`Ò$ÍA3¼AEÒ…EkHf@.MU+ a”73° e})€z lVÎàò”IP‡¡­ÍÍY)æ6·_ «n l 2$€DD(€àRЧ£:ˆA}MhäY!jаÑÞšÊ$Å ç‡ q8'€À ¸±H!k%HŒÁL%®û€³ºx5®×> 31š-ƒr" )XŽ»yÏjàŒ`bfõƒd×:i­[‚"ë:P„àB)8­‹‡¢nBJ€XÔ::m¼I¸ZƒmsK5750LŒÏÀ€BôcÄA€iÇÎÂÌÄ€kÕEµBYŸ D^·–R˜šLP˜ôOÛ6›½úÿÃø C³ïïÒÆIEND®B`‚qt-client-4.1.0/guiclient/images/issueStockToShipping.png000077500000000000000000000043361217451700100235220ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœiIDATXÃå—Y¬]UÇk­=s§ÞÛÛ{o{;Pô¢¶J0h 5@¢‰š˜¨D¢/*F‰Ãƒ‰M|@ªð`À€ IˆhL1)¦ÈT0éh9¸mïxιgØÓš|8·ƒòê—¬|k=¬|ÿýÿÿoï ÿï!.lîyj`›óþ›ÆXï±Ür~ÛÙy¬ó¤Ý. sçE}îìÙf³ñÄ«Þùz<õe_¼¶çÊÜû9¬÷7öݸ2Nœc¥q”Æc­Ç8¶½ÂÚzŒm,N‡sg§ýÉùΉZ­ö‹C/>óèðøÝØï».n”Àüø@ȸÏ8?Û¡HaÝÆaú&*4rK¡¹qäÚ÷öÚSAQšB¬^3±m||b÷È蘚úÀxùÚòâîÛß%{K xáù7xþÀ"{¡ÍîÞÉÇ?µš…£“9Ú…¥[Ú¹£“YÚ…£;ÚKž ¶Ø0ZíÔU?HK½ojêÚÓ/¾ ò"!¤ P‚×ç½b8uÍ$rý•PR•DR‰•HQ‰%I¬H"I âþ4«ˆ d0 ¶h­w­¯@)pÞ#lÚ1ÎgG†¶ ³mK?#1lèÆ’4q¤IZ*º¥#-iéèŽ|,fÓHÈ©¹V哎pÞaŠ:çRóQhã©8,4¡…*PxM4žA•( è«VQR¼w=z=ÐL3š*¤°Ðj—tsƒ *´—22V‡ÜdN‘¶Z¤>AkÃbI¤úP²'é2RgHS†ã˜•¡ÃOR…Ž $2 h6!N,-…ˆ0¢ÔŠ•ýŠº¹ÔÔW@x²×Î9f GZX²Â@©i·JJ'0ÂÓi”X §è¶ @kË-Û"%QR\¹~™„R0)´’˜HW*t BÆ A "KM‹+”Ú²ªO1“_rÕIp¡ ½ ËŽ“töQd%¹ŒÈócÁ‰€"+°Hšb#G»×‘ ‡6–/NÅDxx¿œ@(Æík¼ñïû)¸ŠPH›“àÀg$:¥el»õ[n$¬ RhËø@ȹìýJÀå x ‹‘kÙ°ýë3G¶tÍ¢Û5вD‰„ómÉþN—\)Œ±|mgB Á•1ÀrôΑ$B²¤SŠv²q€¬q]4ðÖ“—áBV †Ü´®¸ok-cýÓ]A,ôЦôµ•úóSx¼ð©u¾*ÉW>óÛ%ËY{OZ‚-;tç/¼„Ö`-8'ÈrA*曞t—B)¬±|㺄@EäçïÕ…3ßv"RR9xºÑµß•Bäï €è1à{.è’Åt‘fö28O©e€…¬€8V¬ˆCn޼̀± WÓ)¶ÈºÉéóvÓÐØ¤ÐÖS[Ly#µ+ê„÷Iü¿.Ô½¨’!z6¼À@£ôèB“uK²\\¶ Ë¥8·äØ÷z—Ç·xüp‹FjQR…a…þ•£œÒ1ÓsÕUfbèÖVc÷<÷f.… ‚!˜Õ Ë;¥Xã/JŠ‘8â¦Í}$ý½®.Ï)ðIÄ_ŽÌ3­-j¬JßH¹"¹µçêßaÝ"€üÉ/ïÇ{ϯ~üý ']í¬óÖZrm˜Ë,ÎÇ !B†#¨dAe‚x` A²Š3uÓǗØój=¯ÔYè”HJ A…™JD´a˜[†øÌ@ƒµù™k+“7ÄãU¾ê=â7¿ßê±±øè‘#”ºÜµ~ýº5Ê•Ai ¶˜Ã·Ž!dH@v»h­­RªæœÇYKgižNsÇ9w±PoNH¼‡¤”0©â]墳ë±ã.ËV瘢….2‚(AU¬Wà}Az@Üy×ÏB~Ç{ÿÛ¥æ"3gŽâLN³¹Äôô4õzÁÁA¦¦¦(Šœùù†WN°yûÂ(Á{‡s˜p8ï1eN¶4ƒ·KÍ&K­«Æ'Y‹PÁÓÀç@¤ÁÝ?½‡¢ÈP*uÎ1?{ÖOŒ­BŒŽJ­Y\\dçÎlظ‰¬ÐHuœ£G2¹ñ*?1¹háå¶X˜Æ°zíF²Õ†ÓµÔNãÆ›¶1ºz}œÄq,,,pªV£¯¿ÿ cL­Ý\]90þÑUc£ÕþAæf8Y«ýiddä¡Â·nE—%Gzö?ÇŽÝ·yÃúO ÜøK¿9ÓMþhºÉV/Ôõ¶nÃ9Ç‘#‡žsJçEñðúÕƒîÚyõsÖÚ§Þ:Φ¶o~æ±Ç»¥Ón^çÏœ¦OŸtišîéÔÏ>xàŸû°Ö¾}¶Z-FEÑ]ÓÓÓÇë‹‹“3³³;ç¤iv¤^¯çFc×ÌÌ̳EQ>²ÿ~öîÝ[jopÛm·¡”z¸Ñ˜•Íæ¡]3çÏ¿T–åCµZíbñÞ|}‡H’ï½°Ö cŒB$ ÆiŒq—;ãEEˆžï¥µöïü?aõõy ¼IEND®B`‚qt-client-4.1.0/guiclient/images/itemAvailabilityWorkbench.png000077500000000000000000000031751217451700100245150ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœIDATXÃí—KlW€¿ÿÌ™™k_ûÚnl'Q'm“êÒB+‹R*‚Т.Kè’=°` «JH,€ +X 6)´HHmª4Ö$q¾‰×÷1sÞ,Æ 5fauGYÌã›ïÿÿóŸÿÿõ!;]ÎèÐf 8À7sòàÁüì~tÙ¼s‘"ôn¿†¢AShGˆ-\5`peðIVÓ,O?ù(Ö¸µ|…Ù6”…åÈÔˆsaomžàðÌ)’5¼#€µ`2B}3HXßex÷ƒêb³¾Ç.NrããØ6ô§¹Üaß¾ûPÉcG+Hu•¼^¦%C²0àèþ£,]?Àú¦ÐÑàÒ6´4}=Ô]êÍ sç4UÐRaì’À¤ÐE†±P»)*PÁR™¡ZAÅP#Ä&ÛLNæ+ظ €µmØþ›} f„±%Aš:—. ‚B» c@mžfvìYþ|í: ó9ÉzŒ×ÔI#´˜š˜ÇÅtz-ýˆÞÆ@& Èpð&yÖBß[éj+¨6 J¹Ï¨-¤õ?p¨ØË¹sö|`Og„2Š”µ‘±y|ØË…+ëÌ›30©U Ëm (¶¶VÆTIžÝh ¨(¸Ô4ŸÂe˜ºiÓnåW<65Á¹åcÜŠ53Sš~ÑáFl³²²ŽÜy‰÷¾ç&ÖeØþy›ò6Ħ½ƒ„uj’`œ 8­ï³&q xS1ã~Æãcâ¶Y`õÎ8ëÎЊ«ŒC9q?Õê¦Xq»* 6/÷^ð1#Å„u1e8¯Ÿá%'DÁÝl@í?¬éø:dgÙ_ÌÒ"%É›|†µKm–gr¤å¶1àŠÉÎ4IuP*£K„=´S Ò>Pmò vpAg ‡úœIDATXÃí–M‹eG€Ÿ·ªÎ9}ûÞéîÑÇ8 Á…nݨàRAQüŠàFpe6þ‚ìü‰»€&‘dbBÂdœ‘dz>úvßSŸïëât'D¦m½K uçT=<ïG|>>ëC.úÀ^<ÐØcÎ  N³U(j…R FH…­s¬TáúOÿ÷úáB…£#Øßã7wÞáç'kª €MüØÙ»ÑwÎw^Ÿ7ãO­]làB€œáæøÆuž¼që«_¿zíÇèö¡Ûº¤Õ‘à"e\Ñù- ŸÀŸ]¡ë Æc†¡£Æ#ºÎ¡yÍÐgæ±]Ö/}óY¯¾áõƒö:[³³;çdsøôRû§-/qΠm™ …½ÙæŸVc{DR‚>À8ÂSÏüˆÇ{’à•“{oÓwãoàX‘ô¡Ðt‡<®©#äÜñ­ïü¶ï±¸úeŽn¿Dè›û7кE³£ µv”qþ9CòÐ*´ø!imäzÈæþ[¬Ç·II]StAë*ìî~Ô¤T•¼¹Û»¬ómÖ÷^ÁÒZsÔÕ ŽÁ…s ™Îõ‰'#éÞ Œc#ÈHÊ3Ä 4s„ÞOÐ ´eý/êê}6«—I¹ÇZ¤ÙœZ¦|vÁcæH ¼žcÀŸäÕMNVÒ–”šLu. EÁŠ'¥  Uc|ðÒú¡%R° Í„šÁDÝ)M9Ãfýß!œu:„˜§UpâèêÇ97Êá›4[Ћš`eú¯d„~ð˜:Roçpœ^­R¡¹ÎŸLœ Ŧç/žO £•BE0©9,CJDª› ÄOv¿O@§r¬ AƒM&¤"¸!8¡Ös µé¿¬g2ˆPˆƒR<èdMÝ9ÐióZ…ªS#š§Ô€TO•ަBmaº€žž% É<ˆ'›ÇJ I ”€ój¥$b< ¥i!Áqeïs{8çÙÑá‹ÌmìKàætg»¼MÊGèBGp•Wð²`—9¦û˜ÌP5œß!tåw),= V¨p$¦ôv¼ßê‰Õ6émÍ¡ ­ ª§y’s1x?ú õ·Z:i(Í¡Íhêh T…Ö V“’óñ¬þŸ{Âçã³3þÖf#@™…ãIEND®B`‚qt-client-4.1.0/guiclient/images/items.png000077500000000000000000000030541217451700100204760ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ·IDATXÃí–Í‹&W‡Ÿsî­zßî¶í™ &&q‘ ¢•ÉBPÔ¥ ñ¯7B@\d#.\éÖ•+qã î\ºP1F2Ì Édœ¯Ìt¿Uu¿?\Ô;N;‚E£›¸Š*îyîïw8·àãø?‡\ôAÿ#ÐÙbx‰-BʺZZ¡”ýªP2„Dk;@|å;ÿ}{@« ÊkÓŽ_ÝüG½ÑAúÊß÷™]P9Üp&½}·Ã_.ÚÿB€œa³a¼õ/]üÍ£kW¯að´â±©%`%SÀâØŒ‘ÑN‡½ÌÃÅú~€”ÀÔ¯~þu^xþ3PÝ)¤àæ‡t ßÚ=ƒB©–Aô’”Õëæî&èñîì=òÙŸˆ~Áp¾`ÔÐè£!GsIò Þ'Îïwøù!ƒQR*4c‰ Œ‚ZEb½,ú¾ÛÝmæpƒê‘S¥[CLB3BŒ``Gƒè^¹K(–wÈÖb‚ÖÖÂÍ ) ÍÀ‘~¹½­ÑOsD³†…Ö %¡·Uòj„±T!EÐ wÿ(y(j^skBLÐû>·§ 䢨vbÓ. 'hfU (]è]öÖ¬[¾ñ6ÇG'‡‡ R£Q¤6ý9´…£A9é5¿èÇßÿöµßŒwoÝ(;ÿw¬=ƹ0 =¿Q⬵€0Œ–Ãa`ÚåÓÛOTä™z©•Ï}ý[¼üé1É‘w±%‘wüyž°9bi„³yvnÙñú—?Ë'Ž_FU™§‚±–i*ÎgD,ª¿žÞÀ¹ˆ5ÏF…úrFŽvú¼GŸNé5“Gî‚6¤XÐ%âC'çJ.JJ ŇNŠinSq.£Z0¦“R"†@±ú @¡»3ÚΠw®ÓÜ¡ÖLržŒa™#½ ÃF¨¹À >s%%ŘŽ÷ÓÓ†1 ç2ÆT–Å#Ö )&|HØÿ``9¥Ç‰zï}â<“d`™"‚2ÏŒ ½Ñ—H‘’+) ¥4¼œËØ}aUeY‚a””2ÁGìp Ö†h~ï}BNP*ó©ÌS@ÏlÛ€*´%â} åÂnש5²8T ó¼æUÃ8RJ„ê9€à£RÈÔå.E-`™¦€b™çˆ¢Ls@›ÐdË0eŽ„H)óèqBpkÎUû¯¼ÌÄ°Ý ¤”ñ!P›=©ª$ŸH±€ …yŠ)«]™—ˆ6èæ€ÍÖ’—@‘ óœúþ䣖yö¨,‹ µ4RΟhµ>ðK"«|Æ»H¥¢æ)`dUÀ4av­ ãú—–B‘˜žäýÉW€eö¨æÅAhJY{ ÷s x—°*DŸðS$IÛNXmÌKÂveqÛ„M›*~‚"9f–9"Ò1fÀ-cFPi¸%¢ÚÇ\V :Ãy€ˆ‚ô ãñ¬Ý€NŽN5Œ¥!b8jc,ÃfËî· œ÷¢z÷# ™ƒÃ†ÑÄ0ª+WF¬µX[x÷]GŒhOR(@¿-Ÿk8”Ò 4ri¬Ï•R¾4J*§Å)<Ì9SøÅ‡î6µUj©´Ö(µ®ó¿Vê>—RÄûìTûýœËÅWåÇñ¿ˆH[²G¤ÆIEND®B`‚qt-client-4.1.0/guiclient/images/journalEntries.png000077500000000000000000000035011217451700100223560ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœÌIDATXÃí–[Œ]UÆë²÷Ùçœ9çÌ™{n-%´B ¥@mBECD‘/FM1Q‰QI¼’‚€ðI¾d%+kå[ß÷ÿÖÊ? >ÀøÿïP§'?xîÔ™ÅѾ½\è¯êþr¤/­Dúòj¬‡*±öåHO‰âÐÑÙüОCKÓͪU»¨66^>Tø°!ÍÃhZæáTš‡ç³BL¶üÒ@U1“‚H„¯oÀž- …CÖ¨[[™—j¬ÇEÔUV©KM_¢!Fˆœ¨,ÍåøÓ Ÿ‹­Ù¾¶o‡Fε"IŒx ¹RK"r VRûR?U!8/÷+hÖ=cÀAP+Êß]V¡¯¢4 åPPW [Æ+¬7((¯)©±lL¢À )0]‡ ‚!¡©+­vˆfGÐÌ÷‚zL)ÙÿvïF+è9¿u¬Üë[_7”¢ˆf­J¹a5¸,#O[ºÝ.ÃŒ–IÃÆÑW±Ö"@h-µˆÉiF†^Y7çˆ+š ½òe‘Qûwïá{FŸ®þpÛ¼¿r¸1T«0ܬS­–1Öà;K¨¢G "U¨kA)ˆ#‹Ò +£l4U)¨[ªÆ¬é‹®…wWÝqtXùàV ¸ 4ŒÑâ67Ká=Jk‚ÈÊ;­ÖéE ©.Q É0䢫ÕDdE\V¯ÔDd:¦@á} ¡tp—ݾf®éƒ¼iÀ!xQŒ?·[$€R "h¥QÐ!€6x[Z{å YM@­ "B! o"rSŽ-±òëÄ» θñ¾ß¢µ¥»ÜÙZ1¡j­u¦"Áº[t1Á¹6m!έîs&V¯@)EÔ[F/ÍaŠ:x*±¥ª|³È–/Çܲ·ƒ}ãä~õ`tõ‡·ooŒ "A0Æ" Š ¼—“‹ÆÚç„ ocBX‰ÀûÊá| 8ïÉ“:®×E¼'Hg§ÙòäoØüʾnïžû‹sƜ͉)5FÆœó›†k%œsDQ™n·‡Ï{ˆxŒRmÐfµo)C¡#¼Ò8Èóç Œ1„ ÂÊÛˆb‚‰y¹5É/¾ÀÅOü…‘^ØüËï´ÙÒ´êCXe7vUy<µUÚíE¼+ˆ¬! èy!÷‚ÒŠØ(«I"ƒ2† ‚Q ‡¢d.{A‚EÙZNtó˜þ9Kçºð£ù¦³“Æà¾œMÛ™ŽpÑú±mÝl¹¼ÜîPô'Lv­ÜÑöš4ºÞ`¬¡VÒ U Íz™§í %m8ÖTd™I ³ËžNÏ‚§l„HØÓùê¶šk¼xœƒ¯5ë•‘æóSò”½ýãg•ž²ÛN¼>Åž}󌭽e"ŠÂ1»”qªí骄¸”P/ª†$Ÿ§·xŠ£3]¬‚ÎÂ$º6J·4Ä|êig×M©¨#)Ï.t0MŽÔÎcæÐ >^d´ìÊÏní7êœO|y0ªìñ*º¼Þ¨Ó> /šÌØ2Q¥NTmTªR+[úbQíÉ×9öâ“LM#H`dü<οt;µñ ,Z:YNžµU{¦Å¿ÌZs,O¼€?³|‚4G÷D±xò“¶µ°`u'ÕQ¹FÑËhµS¢JCâj£Uâƒ"áy þHÒ ®põ¬³t~ºÜÞTô²µ€dË£Y§ýjÙǃÄA¤»˜­› qû¨²k²Nq¸–Ø|þŸ*Oç(Ò.ë˜PäÚ"aAÁ WB‘ŽIpćßÊfOðÌ÷o`ìºÛøñŸÊ¯ù]4iÍN/<~ï7{;®cþÐz˜|ØðÕŸìLú/991=7yWÑ_$¡è® ±ˆ,Oƒ,¿¿¿‹Ê×VºÒ®Ç?ÝupéÚ¯ü­sóMìjµ[þ7?š7±¾qnzt»_;ºáKOÊÍ·üú¾„¢ Ö}ë-Yê](¼=®ÿ´–ÆÙ¹éÁ‘ùlç–é‰GŽ¿ü׿žÞ÷·¤é÷E|óðÔ?Ê\½áîzvnšŸzµ˜›¸sôìõsOïûÙÛRß³]·Ý Ÿû<ëv]²«ž˜[¯˜Ÿ™­v¦î¸öúO|ôO¿Ž¾-ß¾3™·Fµ/áÛÓ÷”³æð§g§SÇÓï>ò×ßÿñ¹ýû)ŠÇþ+ß¼Wæ0Ó³³Ã}±Þ2^ëÞóÊ‹?|è²-Cᥗ~¯G¿ÓêÔÍòÚõ¶]½ó]ñÿ ßç.Æ:LIEND®B`‚qt-client-4.1.0/guiclient/images/listOpenSalesOrders.png000077500000000000000000000027761217451700100233330ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ‰IDATXÃÍ–Ml\g†ŸóÝŸùñŒí8–k§Žm•* T­,Bl"–°@BHÁ V•XU*¬Ê±`ÙˆK~TAY 6ƒ (jl'®cÇ3óýœÃâ^»If³Oú3º÷»ÏyÏûž{á¼äInúÜ÷~ÎЧò•矾Ö†Õ?ߨýÉR7¿ñæ? Þøä™ÎrOð‘Õ>¼záãÀWöFîÙsO­}óÒµWäkŸ}îÌg `ö6^ý)ßýñº×ïô>µ¹_tׯ<VÛýÙÞúÐooÍË‹oüíLG޵àµ/‚SÏB³I§Õ‚"ƒ"ZÎìÙë—®^ýØ·/]˜ýôæ®–çÎñ¯­ƒTÜ\˜-¿ÿÒõ/ÿò*¿Q)f ªô“ÚŽzí5{èyù£yá0Õ/>óÜ»ó cË4 qŸñ2+Ëk3öÜü_vw‡%;[ÊìÌ,Kílu¶•½nëŸù–¿ñ{íˆGÔœ¨°›9ù*ð6œÐj¶1³g—×_z¾wÿ–t>øy&1yþþÎ:÷ZW8´˜›iru±`¾Ñ*­ÒÑnfesé K©3 /‡øÁùÍ7!öžR“+oüèE!€1šqù寳±²D”øëoÓ÷‘´sM¥Ûð´ AD ç sÆü _âòòÓüió:é_Ð-P›¸q€Ì0@ðä™Q8¥•C3s|ã‹$UÌ Ì0 3«•­þ/ËWš(2£é ÙäÌ{ «zä,9}Ï­"´š©Ý=Œ•³Ê T'_70CdÎnߺE¯×Cäñ³ËÌèv»œ_\&™!äÅY\ÕgžLSÃ{Oa*€#f•쮀¬ ’¦V ê§<Ð3C߯„Ǭc²ÆYœÔ&Œd"'ÆQUTuLç&S£6^YD&ºp À9Ä<™'cãX…œs¬­­ÑétÆ> ÔÜ*€lJ2©ò"—cf¸Ì±±±QÅïÑòœ÷[ɨZPÎ&^3àªjÅ"M’UznooOLÁ£PÇ)˜[X®¨L@¦j&U „j蘣ÑïýT)ð!0 JTC2p%U¢¦Q@¤žjCíl)H £` ¼Ô —ƒMîÀ€c €ž ÓR V™ÎG…È}"&ƒ¢˜z‰†`i„Yªàñ)hÍtÅeQLìŒ JCˆcºk¥¡ª$3²Ì±¾¾>Áp€Ë8%|P|2öî0 ‰˜uˆZ¿¬ê‰:• Í4…ªêú™EQ*_ïêHdì÷ú­.í¹¼æýþ!Ñ+ÁRµOU@k}`ñëÊGAñ±2œÊÅ•uÚý!®hr0Tvúìö<{ïîá[ Ó¾ Tk©2Ôˆ©ªü¡‡÷¢e¸²FÿhÈ0À¿wŽðIÈ(H¾Nõ4©î¹Óªú;û‘ßý³OˆJLFH•¹B:þm…•Á`Èöö7·ïÓœ™åå+äýü œùp‹|ó;Ü¥¸jž›u`bˆT8Œ\†.p.SVίpþpHÃî“F‚F©Nù,W3Ž$I*âa¾Üÿ­Ö Íf‡²Ý!oÏ7;dõg˜bzˆi‡¤°Iõ±H#QM ¦ó@•€·Ôx5&½‚·Ì©‡†’4,È%®,pˆ €¯¶Ì<¤€¤€F‹Ü3å×ü?®ÿõ1fcXeYIEND®B`‚qt-client-4.1.0/guiclient/images/listUnpostedPo.png000077500000000000000000000037261217451700100223570ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœaIDATXÃÕ—Ë«eGÆ«ªöÞçÜsûÞ¾·_ytB· p¢ *!Á™8‘ œH2Á‰‚ÿ€ ˆ„@&‚"N¨¨ Ä„ˆ†ø ’6é€(¥SÉ¥  Y J!ŽËaßY­zö/¿ÁÕ+o•W¯xcLùó¾úž9Üí„Rä;H9[@‘B1€B©Ïk€²&]ÇñÝhŠŠÆg÷öö~ ¼ÐÜÿùÿþ³›sÈí|ÿÉ}’–»g­y껦ºÆr!eÅG­c-ïŠs!j!ÄD¿\réµòòÞò•K/¾ð­—þú§n<çO?þß°FH ÓÖrvÿzeÑBr|øþäÆ0÷ŠOŠ¥ÆTI1±€uà¶Ù]çÞsçÏïîî>v|÷¤ýãã_~⾇Ïqñ'߸=O<}ŸÊݧ·š§î-« Oþú"ÏþmÅóo)?züÓ˜SS^šGz¯ôcfé•Þ+KŸYŽëñ˜‰ó·yèÞ†[^ykñrïãçŒÈÅŸ|퓘Û2 ‚ÁŠÕñ‹?~~Ùqí#gi·;¦­0mMíeÒšÚ›»FèZ³~õjÂIfgÃoœûDãìQ$¨ÝHÁnvøûÎpÏ[œ~à›;&F9=ƒÞ)+§l:¡o”Ukè}¦ïLegb‰ÇÎpöÎ É®ä .vŽ@°¶:ûÂÝS~úõ $c0ΰ[H…ó|£DQBS%¤BÌ’Ôž«y7'›mñ­-œ‘£1àTpFqd0‘( ù4ïñYˆÒ°\ôŒ -ÃàY #ÞL|įVôL1)ð…ûwh\S&GÈÎj«PÅÆ€’Ø4 E2S+˜¦a Ú 8CßK+hc|ftBi9d6\]ŒÁš#°R‘#`»(óài7°PDhZ¡ë ˆ`[C/–‹é ckéÅtŽàÓÖÐXY{ë¶€Š@¯p-( ¯D-ŸX,"! j Ãà†@vŽÁGV} Ø¢çC§*«Ö‘g„R*¥Àq+lL,Ëì1t“–e×!bh'¼·xï˜ll2øÀb!4ÓcŒãÈñ©Åý/ XZj@®&åò˜/"AµÂb>âUÈ¢ ÃÈ8ŽD« >2ô=£É˜yäã³*p4ZÔ¬M¨*Û¦­¡ß°ˆ1´]˲mQ„¶ëð^HÑ2mâCd¹ºÊÀî†Å];”àH Jˆn¨° ‹A‰YQXÎc²†qd<Ù÷‘¾ïñ¶`sà+'¶iœÜLp7”¼„° L$xäÅcå‹;ûbe¡ ;0™Z–Ù‚Ú®cÙÆõ¸z`-“Ù1bŒ¬zËts‹Fv6,nÍèMʳÀóHx4½Íƒ>UA3|[¥ÄþØlµñÐi½ÒÇ“ j]ŠÌgòú‰/±\D¢ ÅÉzxh-£Œ«¹$ΞØÂóN rÛ@Î|ê÷±_[݉)®uh4J~+‘‚¡`mfwKhïÚf·3tÑ’‹`[Çh3ƒË¸IC0´ vÒQ4V0²>cML xóþýì÷X^~†ã'ïáúþE¦cµºNßD5û}·Â5Ÿ@K¡”²Þ¦uœU]WG¥ ”*s)y1´ƒªÙœD ƒGÔæ—ç—Áï•%vû !Á**¾|†”21rqôc&&ÅGÃ#Ž‚XWOÖ[M¬zˆÐLè_#ŒWYî½Æbï"6¾Ájð4n‚÷Ìh’ã䯄]8‡+\7‘[ëœÃ:QÐòÖ²Ö·2\e€¢Äåë„囤þÆ•0i…¡!(FP#L²#g©Ù A>°¶’ºV+f››5½ß€‰RZ3P”ÕÁsôW_ ÆDŒb؇C¬€Rv¤ôþSzï988`öööPUŒÌzõ‡ÉÍ…XW#h ,öžc&ØVðAjl ø@µ¯’:r~)%®\¹BJ‰ù|NÓ4U–úé{=0˜ BSƯBœàB¬„ð p‚!çæ´mË7888àŽ;îàÔ©SÌf³šU¥fXw«¬]3 5† ´R£])TRÖôƒ%pÎqîÜ9rÎloo3›Ín>3æ]gAи5€ Q׺ „XÓ¦RÄ*ÉM¹ž–ïg¼S§Ï5c!ëaž¨§ª3ÈM b¬Ú†°f !Z¢±ÄhqëhÖÑZ‡ÒPè8¸¾êÿ±ç¯ßÜj릥N¦¥Þk²‚¬°³qÖ,7 ¡ÞñB€é”¶Ý¡+3œ=N·ÕàlÃt¬ëÈY1ng!øƒWóËégø&šÞ± k6¬Ö¼¾¸f]×Väà´K Œ…œù]+cÔ°Ÿ%—Zl¨2h|U©?ÊB Áæ¬O]úîäåœáÑ'øÿlÿÑv_OæˆIEND®B`‚qt-client-4.1.0/guiclient/images/listUnpostedVouchers.png000077500000000000000000000033431217451700100235720ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœnIDATXí–[l\W†¿}Ξ3ç̌ǷÄNâ8qãD‰S‚š¶õ¡¥ D $$*qy )…ÒŠV-R¸©y¢DZPBÀK«VE*) —^R*œki]'±»¶S=—3sî{ožP©b7ãõ¼õÿŸÖú÷^[°Òz€<—˜6†Ÿ^¿Œ½b€aÀân GÐì&¥Ä-(†hq'[€s×–+2 JªD(ÂÇ×zkL£Œ¦ßL“(™7¡9CÌˤ¼JÊ\¨Ç––’+°¡©š¥¢W¼­Ûí&L" …\Fr¥Ü†$H>]«Ö¢Le‡Hù «=‚»ÁŽîR÷Á²)Ó$Eæ%Z+Öµ¯gxû0‹þ¢¬'õ^ò,¢g);€ÿÜ(Àa°Ù?еùK=åƒ!ISÂ$¤ËíâÒ•KÛŠ=YšíW‰ÚEÌ$³l.¼'g­¤ý¦i„ëºÃkÛ{D¡àQ(°, )%ÅäÂ-ÕbûÆíìÛ³Ï+zÅÏcñu4…÷Ë­€vÖ–Kå=ÝmÝØRâ7}æ®ÌEÂLÕ§19ƒFc ›|>OÎË}Å7éî½ pØÑS^»¥ì•Q*#ŽcŠÅ"RJ°­¬…ë¹d:cd|„¡Á! n¡‰á-*€Y!ÀñÃw‚ Òµîèëì+¹NžFÕ§>[G*IÉ+aKa \Çejq ™“LV&ãz«þcfx<÷žæ5¯auì$¶[ê\;ù‰™ÓǶ¹iðñÕ{úºúÚbêí)fÞœAz’› 9'ÂЈ|”­¨,V~‡áWlÃðû÷ë Àü©géØº×>}ôÛÍž=þ°¾(ߨÍ+§£_ô´÷ù!ýý4ëMdNÒ7ÐÇØÜnÞ%ŠcR“²,¼¢Ñ‡(ðë«=–} OüæQâ+£Èb×þÚÅý¶­ï\78Äôâ„YÓDî¹]4‰´%~½ALÌL226B^ä©Ô*dq6­uÿ$ž\:ÓKÖð‡wk­~V~Þ·iËÖM»‡ñº7b‡¡P¯ÞÅIŠÅ¹õ½”»»ñ[>—g§¨4+$iB+j…Ƙ‡½½ÞÓÙ;übiŸ%GðÂý´æ^ÌvÝûÀÆ­»o-w÷b;¢ Å…Ñs”7í¢yùƒ°ìQ•ô/èÔïMÓZ)T¡µÁqÛUôî¥SãÏ< þÁ®@údAuÚéÚ:!tÖ«ZMŒJI£d,n æÞü»°Wö¯ý_-™ ¶@P' |•„I5$a€J³ùàÊØÖÝþ•w² vCKâ¿úØNdÛȵ}2i5>ª£FŨÈG«ìm´¨ŽþíùÖôiö‘_¿ÍÑ$h®Šù²¨_æ O?yìÀ}Ÿ•ù¶ÏØùÂJÓ›ÍcBÅU¤»j×\˜/Ý/c ~Ä–nGAå=Ô§Žø«ð_¹šùM¤zIEND®B`‚qt-client-4.1.0/guiclient/images/postReceipts.png000077500000000000000000000044411217451700100220420ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ¬IDATXÕ—o¨eUÆïZkï}Î=÷ν÷ŒÎ8Î86ލ˜X`:*‚PVEŒD’ bЇ"ƒ‚¨ú••B ¡XÁd‰%Ó¨QQšZ3ͨ£Þœ¹3÷ÎÜ™;çœ}ö^kíµVö™™2˜Æ‹÷…ÍÞëYÏûì÷p†uÏ“ËIEŒHH#„˜ˆ$ÂI?´BH‰a<.Y>t€cG§ÇŽX¥TzþÏüÏæL”ÂZIò$mJ‘DR@„Ô>o—¤‰ŸèsýµÄÆG¢viiéÇÀÞìò&¿çç§Î3øþÎeš˜6örµëíçw·™¢ ‰&D¬­Ó›,„ð1á|C9±á_¼º4zmÿË{¿ñÊ‹}hÍ9ëüàéûþ?Z M„n®ÙÔƒƒ¯-QÛ„k —\¾–)6b›ˆõ©µMÂ5åhf–þpŽÍoÛ²¥ßïß3×?Gÿå¾;î¿ìocߎ/ž™ûŸ>‚mÒÆuk²]›ÓxëÎßìãÙ¿Ù}8òÃû®GÛå•§´‘²Œl¤´‘‘ Œê‰_üà(7mÎp!çµÃÃWKë? DöíøÜµ¨32 ‚A‹¢á×vüêáø•›Èg º¹ÐÍU» M'WíÎZ[dB‘+èÍóøë FóSfKfÌ5™Ñg‚v+Ièé{Ùz.ذ†uo_Ëô|‡ŽŠ¬ëAi"c™6B™Eƹ¢´²P-;ŸYϦ =–?œ?K‚Ö­²·nìòÓ/l¥Q eýTA“Ø¢Áf/—%\'âš„àiwhÅ;ÝóŒ™5k0JÎŽ£çk*åñ’QUžýƒ/£aIÝ€#§ª,ãªÆª.•õØñ˜’.ªq|ìòy2“µ“³ÈF Q·Z F´wD¦UF’@W *Ëè¹DÌŒ¢Ì„‘b¦©l 6BÊ Á¦L{-‚Vg@K‹T)A³)2p–|: I„,ŠB:W”¢)ѨBQçšRiTap¶¡›+2-mE”@ ˆI ŒpÜE†6âc"Ù†áÐサ¢ª,UåÆPYϸt8]ƒ·\tn˪VgÉ€QBJ-)Áœ¦:šQ0ˆ(ŠNΨ(QäÖj¬5t¦¦©¬c8²î u]3×Õ˜·Â€VSkcMäPÕ0z\¢†ƒ… ‘ªª©ë¯#•õTeI­*xî|O¯ pv"Ô"D5!cdVA7W”SQмÈå9!/ ¬¯éö¦±Î3 ÅTË@J£ Jä«ÿ7´!D'¢°ìÃ*âC$Çhਃ”PÕ5ue ¬õ”e‰Õ <Ÿ]7ÏÚ錖â‰}RL-€”€Wæ€.àîÜ7“>Þ_-S ˜Ï„NW3 D‘£ÜOüVu­éôfðÞ3.5½™9õqžyõqŽ`¦˜¾óó7\µÂxóC&= ìAÒ˜O5G¹Á:BŒ|+Jòã™Þxê¦uñHޝkTHDm(Ï wo¬½ÑÐ㣌Lþ ¹¦¶¼åÅžÚ¿ƒºñœ¯²ã¥ß_´{ñºïž÷Þó¼ è!°í/èOo@%G‘bpdR؉–€HB‘Ð:Ð_#äçÏÒ/…ׄ$èÜPë@e¦“á¼ÂÙŠ'ö>‚–ÄËË/ó»½O²y~szÇÆw¼ P Æ9è*°å W½ï^F‡þÄÜ9°º¼naWIõ"16ør™ÌŒ1™Ç6S"¥4ùM[?´}çÏvxáàyíè?Ù½¸‡=÷ðÁ+?̧o¸ë‘›/¹î³K'–ï¡[€s­ØŒx ‹D‹ì§»ŒwC]¢ŒÐ³ëq Œ}Ä&… Ð4ï!‚ƒruG÷>ÊÞ¥½<~Û®¿[ßõu–†³|d÷èðö«ÎÃ8ã1xÄ€+põ1FK —ö¡ýÆ•%3¬µ ºD¬1œ3Õá][׉ @›5á›ÏüˆçVŸ£¤äÖm·òí÷ßÍóo ªút5ôÓ2@ŠøÑ¸Ñ"Mù'ê±ÐÉï!%Á9HJˆJèCíA È›z«£übá—Ôš·ÜÈ—¯û2ýn%#Œ­'‰È;h² )2^ùå±ÑQ Þg(iq@ (h‚¡iÚ¸àH$ ]œðÔá§XH \¼ñb¾¶íklšÙD"¡dR &ˆóíí½‡Ø8†K£ª:è\°NZ›%°Ž6‡*!ÄŒ û޾Äî#ÿ`Ð ¸fÓ5\:)>zvßE>›sÇÅwp!b½¥˜ê ät§ÕpPéDlv\á|‹à|;8w:A&™â©×wr°>ÀÑp”—ÜKÜuÅ] ÛÙvÁ6nž»™é™iz½^›U¥Í°ÿ¥£' ÄÖ:'äÒZ=’hHj4A«!·\q w?÷m[|ŒézšËŽ\ÆTw ?í¹ý‚Û¹hæ"DŸˆ:UŽå4ÙD1€à¼àœo ‘uÒðmHZ ¾Iô;ó|åÝ_e¾ßçÁåxxð03i†«Ï½škg¶µ¢'óD[U͆Àû6 97a Îk¼Òx¯1«&VkC$#Q°²:.÷¶«‚æ#k?M覹ŸÕ?é­˜néÝVXÎVëPM’„Ã:(£Õè$'ƹvÆs¦º]ò|ž"õ0zŽbM†ÑÝYЦ „ˆ2Ó ÎV¬¼þÛǺ7ò%¢—)݉ÛûÛovWï^Ìç.e뽎Æ8åuˆí 'Ý•Y99Gš¦¥!~ŸKí£[RÛlDÁˆI°b”öCAðÎéâ®ýßë¼|ò+Å-nß´}ÊZ¹s½[ûðù›Ç¯÷çúgªøgÍÞêZ=¼ p.:1<±ÃZ[]ré%g|çßÙ2Ø!tc pIEND®B`‚qt-client-4.1.0/guiclient/images/prepareCheckRun.png000077500000000000000000000033661217451700100224440ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœIDATXÃí–[ŒVWÇkí}Î7W†ùf¦-”™¡‚M/@‹å"ii¢M|ŒÕ o>è“I£Fcú /‰ÆK M|PcLÕ£1¦¡Z°¥­:ÎÀÌÀÀÌ7ó ßý|ç²·çÚƒ¾ÉJVÖÚ9çìýßÿu;p[nËmùaè9­²Ü²Bè ¡7€ÞŽí ±k º4P¼UÄ*Ä*(²ÊW{ãúß4È}TSðÎîyz+õf²kóØÀ³±sÚLQêhež(s43O#u´œ'ð*`g¹IÕÎh¾¶‚¬òÕ(XÁYÁZubô»x^±ƒÔÈ:ÛUxª»¯¨ƒVÉd™÷$Þã„÷=ðúZóµ]ýLo|× m<'M×ôü\l5J©·S_O„›ïa GÀ;$„âlÇLsU¹ÑŠ€0FÁçöê3Íu%M9=ŸÐÌ2/¶g4RG=É­£45ÍÔ\™Ù8¥Ö_ m„}Gxdâ^b—oÆ*pWUTˆš5–çg@<#wÒ7°ă’«äV½Ì–› ­(¡»cÞ9[â¥ÓóÈ£ë(lbM`´³Ïª­fÀáJiž—_|ïRöx»‡$ŽòÛeíðjòÄT#(`KÍ„$ÉX“:¼*ïÛÊw?€ìBׄxëtB–^§ñê;>â¸ûÞM<óµïaŒb­àñÄõ>¯/`½U< ”Ì{f'ßdy~ €á»FyàÃO‚ ™dˆvè÷à%gß y¦Wk%æ.œ¢\žÃ¹„îž>Ö¯ßÄØèýô4KóÒôE°šüVVQsSŒ’¤Qýʵ˜]KªU¾1J­¾Ìñ×CõÊ»Œ(»˜Åù¯_ègßÞ/pß#CCƒ^e@“o(j”Mîfb뎭ïSºúzóå½U`TY©^â/‡¿Ïö ëØ¿ÿ«t÷ô%•¨ÂÅòEf—g9uþ$¿þÃ7Ø|ù²~ -t!Þc%ìdd3᳄4n]‹õÕC}‡ñâ…JµÄï^ü6ŸÙ½—ï|ŠË•ËTj—ôƒT¦+˜a¥F…;˜Ð1޽ñS°Æ?ñe\ÜÄj`P‘ÐÝÕKôæ·\àæºÏR8üÚ!vnžà‰ícfi†•v1B\ŠyéÏ/±íSQ÷+œoL1Ó˜¥T¨{^£ÒÉ.ç"¬„Ñ€5‚Ñ÷i07•^waañ—¦qðs_a®øêÈ ÃOŽgóßùÅs­uŸ¶Õ˜>6ÍñWãœCDhµ[xœ&°y8Œîÿô8=½]ÔkQ‡i¯]úú^:Ã/þÿ"¸°+ K²•¥ê³åYŠ›Ù¾~±4 CK|Vyõðkìùì6iÑl¶IÚŽE½€5BØØZSµ·ô“@§øÄŸ™šŸŠå_Ö‚ m[%-ÔÙ¼a‚ý[²tq{_“¹â›¬”›”JU._¾B ! .s3·ð‰Ç'ÏŸœ<Ý8ý Öu3<ÒOÜNÈ Ž$I¨×Z,e5š˜f£ ©Òoײ]ùkùHã‚Þ*ÚÀn.fiv(nÆY;Ši·SZ­˜V+FÒ$£Þh³Xª²´\¥ÕHíÞDÔJ.5C?9’™[°„@ÂiB6zËÃ>ð¨ºÂnÝBqÃózžÉ¥wécˆíÅ=\X¼Ô<5wò[³?Xþm÷DÈ­€¼sÃ460©K8uåmι³4“[б­øÞšy»ttòÈ7æJ?Ú±&»ô|ù¯\•O1½¬åéÂ@xphhð¡uÅ;ûî\;"ƒ=ƒY’%Ëç–§ŽÌ”Îý°4Ùx¥8pÕ'ÿ#P¤Ÿ-a·(„¶€ºJ”$ÿLÊþ C´ø=páúgÿ¬”ÓÖþõ\•IEND®B`‚qt-client-4.1.0/guiclient/images/projects.png000077500000000000000000000037671217451700100212210ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ‚IDATXÃÅ–KŒW†¿û¨êîéyxžq&؉¿’€9ˆÈ‰+¤(‚%Š€[¶ˆkkĆ%Ù#6lÈ*B $'`’8qÇ{<¯~Tõ£÷ÞsYÔÌØÄ ²%®ººÏmµº¾:çÿϹð^ PgÎóÙåÕõ¯Ðž¦=iÏaÚ³˜Ö &é`Ò6Ʀ$I™õE¦•çVoLžàk‚+ u¯¦„rL(G„2§õÔÆõk—¯^~óµÏ°€~êü…Ÿœ=sæªÕõ:Á¤3è´ƒNÚ˜$A'c-Öj–ç[8/ôg\þúÑkÏ?ó ¶=‡m¥`[ƒ]Ξ:N«­IR…MÖ(ŒŠ¨xÎG\qµàªH] u!„ÚÑßÛæ­‹ï07ÛåÕ?}¨çÏ-šïû ZiD¦Ó‚¿¿Ûç…ÇVÐZ~}¨ÿVòÝ(¥¸¹5ƒë}ÀêÒ¯òùÑ¡¬ÝáÿW.0)K¶özh­QJAŒwî¯1Æ;÷¼k+¥Øí©gZÞ«@Œ‘!h‚òÑ”Ë×60ZÓÏr´R™Ÿ#„ÀÖ^µ•e¬1äã µs¬,Abdk·ÇÊâi’0f”UM>™~€DDîÅ…Yž}ê ÖZÞ»ò1ÖZΜfiaîÞ#>´>zƒŒ¿]z£5·¶w1F“å#¼÷ÜØ¼Mb ‰µìö‡”UE]׈7nmƒÐi·dÓ¢¤¯ø‚ ÄHBЀB»Õâ¡ÕU¬ÑµÃÃú±UêÚ±3È8vô(­4!¢˜ëk«v9kGW˜íÎ`­%±–v»õe2 hKcDñ?\ª¹8üNm£â—Ê@ hu(ÂÑdÊG·0Z³µÛÃhMíÞ{vûW76I¬¥?Ì(ªªiË"lïîat:m²|DYUŒôHÄû€V €÷ùÙ._;õÖj:i‚5†“ÇשjG]׸ú ZköC´ÖŒ'S¼÷lïõ1Æ`!‡ô³Œõ‡çô‰‡)ò‚ó—ßä÷ý’UÇ1(ÐfJÒ”P+¢h€ˆˆºÀ‹& Ë‹GÐZS;ÖšåÅ#xïÉÆ–Ž,ØF„®®Hl‚è]æ/¾Éµü£ûÓµoqÎ b´FDØ›(œÓ£ñ®PUU3È2¬1ÔÎQ×DMØÿ”àà Á7±ŠHp_£pyç&Ÿ …#é7VWy4Ii›€B£„¨èH‚M C(ûØ×/„Þà¹xéºjú'"BQÕÜÚÚ ¬kªéý12)J¶vöPJá¼g<Åá¨~Ñ.œûF¯;Ã`ÖÊ}p¼Ó‹“6$â0µ&xásêË­_~™ ¯üœëoÿñ—K§/üliÅRKÅ Oȳ£M½Õ¾{›É€ŠéøâëaóµïØû F’Ä¢µ!íô— ”^#­Ë¬YEPÄVG$6ÊÏË_4¶¾ÀZCb,›ù&5C¬™srÁQ‹ÂEƒÕMóŠ€#aj4Þ? €Ä”ŽÌ¥3t›DŸÓm?E/Ì!Ò´x J›&SÚSMáÁÓŒŸ£³'x¸õ$ÑM Ë«DW4= éBÒ…´‹‹ÖD=€É"ß\ûó{Ú$AÍùÔ‰ZâþX‰b\‘}L2/÷í‚^z‰cë0e3FÇQˆDö_‡KÝõ¦”¸²¬G"÷µþ ôoJ1%·¼IEND®B`‚qt-client-4.1.0/guiclient/images/runMrpByPlannerCode.png000077500000000000000000000043151217451700100232470ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœXIDATXÃí—yŒUÕÇ?ç.ï¾eÞ2óf`æÉÌ J…’ ˆV!J¢$Ä´Áj[±Kš¶þA´jšÚ´šþ¡1vI mºÆHÓ¦‰†`µJµ""¸°è°Ì¾½…7o¿÷½»þ1ƒ”J#1ü×þ’›Ü“û=¿û¹ßsÎïÜÿÿõ—#ª¯@mzÁw.­ûM;8 ®¹3ýɹ•Ë$b‘ç‹/›FaÙÑmu|±>¨+<•¼B32ä‡Âú!cW¹Š1±ôÉ4¡ªKÔPxO¦*×éªàlj+ kH½oSX[¿ùaÓv•kg_¬ ÆÂ¿÷¦Í½ÍW¥öäj3Ä®„ˆp“ oûŠa¬½ù!%ª>X²ë¹Xæ{ÉÎ…¬¸uëÒæÎö=Ykâ¦K§ÕÎß<üôïq\_oMÄ6ä3É·ß8P8ýЦë&¼ Ⱥ‰â9DoÙj˜æCæáª¥š÷ø¡n¬¾Àó@ú8å-ó°¢oÝR³þÊžÉìôý‰€xíëøEM^Úx~”x~$’˜}»ÐPŸ™§«­­¾7#@ÃÂ/äÀm[»É_}Ý.Õß+;„^½ ¤ïƒ”¸•2ü9Á ˺{—Æ#á_N6ä†÷„Ä¥¸÷Õ'‘–I g±È©QVI1(áW `ÌȆ…,^v™ËkNVkÛ.3›ÓJ¶ü¡ª8¦'%^µBÃv© )UXÐ{kªº{Êöw&tlöÚòb€V§ ¤E]„‰Û ’vßu/xÕ°ðGOãšÇã]Lªí$zƒˆýöV~š@¡ú}»ÉÀ)NÓPu¦¯^Á¤'Іèyÿ½ÞzÍÜ=Ù;ãnS/xòÀ…š$ð}Ÿêð f&ƒÂ̤Y†Jž÷æ~†Ÿ¼~M7XÜÑÍêäT`ž/0ýið}ÏÎSXsH—(×j,]¾ŠÖ‰I®iŒ÷šž»{ª!wÆ4lòÚÞE É¿äÜoF1·k,Óékešj¥æ¾ùÖ#Í:%G‚ ÍoX…  ºH6'(òŒ9°¬uNÀråw¬B)'›qOÐ6·ƒžh”jµÌ”¢‘‚ë¥×ñ¼ÇFln ÊÚìw')wú>óÓ¹"a¥HL%f¨|U"f̳J§A¬:ŽÝh"Ø1ðx‰.lTUen²5˜uÝGýCoñ¦»«Q¨‘*åQ´ ÁjA¢©ë´5M\PR‹P’íhHT!QP¨ª@ HGÕÒg“Å®d©áúF‘Þ°Fűyž ý+»éX¾š…sæÑæÖIÓœ±F˜HÙhÃ>©iˆçË‚6? À–°þVXµÊy0ËP¯Î\³m)=ÛÁ­;´h’­«nƒ€ñºË/ º·ßÇCï@×TJV!`º–§j‡®>ÌÞ£Yw0Ãê‘S% !/¬qŠ9Š£ƒä<ë¸Ø:±zƒ”]†€R"…âÜnÎùu›rµÌ³'X{σl]w;•Z…t-MÕ©­Æ?1Aª+…¶L¥"JìSj4D‰Í×Î/CXU(æ8^Wy38Ÿá±1¦ÎÙlhká[zœ] 'â)Nj­  q$}–[¶lçεw0:H0H$£L+“˜¶I±R䨱ctttPV)(j2K8¦6 m\Çų<ÂÁF@Óªª^˜„ÅA–*5¾8ô°§YÄêuˆ6ƒa€/@*\·`s{Ûxs¸ÂKé#”œíóÚ!(‚LÕ‡ -á±DN}!ÿÃ0èQ ê>º®•„Š9 ©âyÏ£¨ÉŽÁ#²czšâЃH ZÚ‘á&„ª#ÐXH”ëaú5c÷Ä™ûŽï‹­\¿’ƒ?:È[Ͻ˪»o`Ü8‰&´‹ì×[xaïn–¯XŽÝRE™RQPŽW÷4ÊB®œ\UQ°%$Tpv+öÁrgU€n`u—¦¹Êý5I¾°ãƘLö=¿Ïo¹™·­#ÙÞÌøÉ,¿zæ·ÔM‹ûp/gçc(=Z;;:´=Ò÷]Öoù%£H}ÄøS¤#Òywß‚§‚œ<ú!ªª‰D¨V«$Zâ¬Úr-¥Î4™Ê99ô»Ó#_KÄâÖ§øðp+;ˆñTxN0¹iùFúZúˆ:q„iø8q=¦R´Ê¼xrÿ˧GOÝ ‡†GŸÎtØøt1l¦8Aœ3®ô–WÆÚêgEVg:˜ÅŽXBébÎ|郟=5v껡xpdj ÿŒ¼¼“Ñ'Æà p)%¦lkŠG6%ã‰ÎDSL èjµQ>ž)¥ÿšÏ×þ®±ìŸ^èzeÎÇ l&Hˆ8 *Pg‚<^þx—âDÇ€½k´IEND®B`‚qt-client-4.1.0/guiclient/images/selectPayments.png000077500000000000000000000041241217451700100223540ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœßIDATXÃí–[lÇÇÿ3{ß=7ŸãcûØ`pc PŠi$Ü’@hB(©¥ªš´¡B¥¥4¨RÕHˆFJQ¢Ð‡€¨ ¥4%@ mBh \Æ®6ìƒoœûîžÝÙéCÔª$Ƹi¢¾ôÿ23Ÿ¾ßü¿o.Àÿõ?íÂ=?–·!X¬Õ4­I5´ªk×TM=%ŠâM* ¶™É nyËç°kàæ¡£Á5ª&ýP3Ô˜á7 S5µWVås”cŽãÏeÍŽKÎgªš„ú†y ÀkkRI®Œ­o**¯ÛÀ­›²ªF #àƒ(«hïÌ1ãbRR€ý¶mÚë!½uËÏ?@¼ßƧ$¤²‚Ü›äû;²Qò´bÈ–yTP J$YÂP5=a¨ä}QrSæ¾Ï9¤”~ö¬^ À²X¤¾qÆ‹!]i÷Ÿ †ý‘èšÝï‡ä‹@ ©ÒÕ¢bÿZubñ1ôݲQ²„¬u ë‡([fö=WQ[ˆ 37;ÝÎ Íé½[ùÛµùèÐkA§—¨ \¼£NzÇ9m9—g°oÔÉï ð›# áXÛîíÏ%a‚Š¤Ã—«;u{éŽwÏ ¬—· @hGŸ0—‡ Bý·:ÿ£Ä#–`8U•? A)ÕcÆG;KýžœK¢(ýbܯÓWDIz•sïcžü™õù¼°õ Ü\z‰ªÐ_‡}n¬ÃÓpÍ£øz˜#¦ ž(‰'EzÁgȵó®7{M|Tƒüâ ’AÜWJË«¶GCòʳhuð\ BBœ dˆ‹å”H 5Qt5]½ðíEÎëîþwlYè*E>ïÕ•UÕO®ki;„ƒ)½ž[cè2l”0 ¶æ¡ÖÓ±il0ÔÅíTÊ9¿Û°ªuD€«@€TÒ+),­~©ºþñºtº;º@𽘀õQÅ’ŒéºŠŸcE4ˆ _•EEY#JÒ/UM µïkül/®â½CE‘ÕÓ7kºÙH„B,BQEÌ ´êŠtóÊ|0tŠªPY‘¿%Éò&ES•®# Á9‡g{!+eU¹9·sN¸Ç‡ïç—šª@RØÒ Ó¾º¹rÒ<9qû,rñ“¨ÑEôq‡]'\„ ¥°¤ó$*¡ÐP¡©2¥‚0r­bÁ;WÎ\;óÝ7Ï¿ùÒ[o­m·.£œzejY˰ój Ò)·4ZZñòÔ/­¬(Gÿõ¿ ŸîFX—0#(£Ñ§a’®aŠ®Ã„ˆnÈå(ιºL¥Š‚¨O‘DYŸp1㟺¯íð†¬“­H˜‰ÀÞö–ôgúçO;íÖ§.¢=Èëò%• F ón'¬t(% ”B‘Æk"U¦©ð VD‚( i8”¶ñ»”4è…Ôºz²V¤i·ãhÇQT„+x}Yýy zc˜›`(é…~íÅåu„¹ls®•¥„PòñÈ)§5ª€£²ƒp,Œùa(*väLt£ ×û(i뻎¶ž‹hïiGó”fkmÓÚ×›kš·ô%ûâŸàP#kIF ÇÎÀ±RðX%!¸˜„¼‡F™€£‰(d®p†·2øø|:’b5ö´¾‹¶xz=X6kYf}Óú-UÛœ¬c•—`xޱT Î9;æØÿœ…írJ»8çæ0“9˜êcP%–ŸâF„cG"ƒRMÁãR5þnàôÝ3È"‹¥3—šçlÜ\_^¿›Ü‘}2€a#€,3#d’}Pe Æ\€Êð¸…r¬ ˜Ìt´'¬4æÀQepFñ˜+£¹À”LÀOÎü–jâѪ&¬øÙ×êËëå$G.ÿ•ï€ç¾ö±¤ÐÊ&qãÒqTŽoc.D%–K‚{¢2Ã~KD ¢¯Zt2ާsw® .L6 pÀ²qûñc&b]õ”ß~£%Þ÷û|lÖ¶{6|ã@¬àFœ—3è¾üˆ›F¨ *ùÀˆÆ\Æw#ÀZ†kJŠ“Åja.ÊîüYZŠãv¤„o–<ßÕSD{S>ïî¼ðÛ©ÖÔ†pAk¨2\Hgóüvç9–ô‰>C† ÁuÁ\&¸ÂSð¡ÃÐkv`€õ£ËÁªhr"AKö$掙ƒÙC¦gž¦Š_^ì1o¾çyoè€pÞÁÕ¼ƒAÆpÚPqÙ2ÓÍ„a&WHŒÊD¡®K¨@óC— ><½¨{'OL>Øw°Ð° Œ¯~šªÂ…ƒÅ‘…çé…Ý[ÓC·K½|°Ûçó}àyÞ'ý¿iÑ `É—7!c‚¥¹ûÌ£à‚&“¨&£L•T‘ÈŠœœÛ/.Ûºxg|çÖ}©}±q‘qøƒˆ~¶QßøýT0õªùž‰9óæà ëbàû9:û;—n¾¾¹·¡£Ïî™Íw¥vå}¼¤ÿNÿˆñâ(óÜWB¥ç’ƒÊâʽ+Vê–c½Ü#õëIýžýÑýqéOÒ³óOÊì6Á[¹p6yöù#é#7ûûë†CŒõ§t4JÄ…„ÅÉtr·mÛæÄš‰#ÆüßHb>/TªIEND®B`‚qt-client-4.1.0/guiclient/images/shopFloorWorkbench.png000077500000000000000000000036541217451700100232010ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ7IDATXÃÅ•[¨\ÕÇk¯}Ù3sfæÜ“˜˜SWÔF (©—V¤`cZÒ Z©”"¶m,X…>HûP¥Å—RЪ‘ÖÒ¾øæCQ°­TªFc0&¦ç$9s.9çdn{ÏìËìËêC"ÔKrN4¥¬Å†µÖÿÿßÿõ}ß‚ÿsˆÏsè/ÁÄúIâ(ªH)õrm¨973Ë·~Ÿ5–v6›UÿöÎNØÿx«uS¦Ï'Iö«¯Ïîxý·“<¸éäÀìË7àdyßÞc»µÆ®îŸ8¼}ãh\q“™¹,¥-ÿ¶gß½ì’Ñ'‰š¿üŽ}çÎ|ún‚ $·Yé‘4îݦ¥­Še–‰ïtn¨¡ÝÑ ß5{dÎ[;΀¹F‹-·C÷{É7ç-Õû¢£aÙ&–eQptd|”ÖÊqá÷’_Ûq£Ûík ¯eÓ‡‡üûðü²èÆ0lœg¨”P©¡”¢\-uL¢nJ³é_ýúk®u]ëoçÄß Û¶Ñ骯wÛ½uNy‚Rí<*Õ •Z•<ËðÚ>Í~ ­°ß Ê]Oí¼ö®½â¡«ÿߪοüb~ûdc“ïE÷xh*Ä´ ·€a™è:¨$^·ïE»»ojëäæ/}ñ+° ÃV>áÔ×mð—­V›]'‰Bú½¿ã±ÒÎéô3Ìä#åqìÚ•#ÅÁÒfÇ-¿ψ/Ï´¸û«‚Ÿÿá(ýùý·”LnÕŒ¢}èh‹™†G/rh¶C–Z­x˜,ÝaýÔ5LLN FŠÖßoøÎÏÞŸ}–—¨Ï瀔 ÊùòÔ†±R¥­EÔ¿r) ++øý(©KêFÛ*3dJªÚ4ë«ãv;jÕõCXÆ™^µ½÷ — mÞxÅM¿‘º}¥0KçËb%-r ‹{dýyo´=ÒÝ#åõW½Û™~õAÝ´nºÿèñWMBu¢Ï¶žI½ãwºs÷¥Þ\;ï-¡§VcezÒ…¨M‡ ³ðCMewN}û×Gƒã‹«Á¯½7~*Mi—Ÿ’Véi¹€ ‹{¤ý’ Eà­ü±ÙŽîµloû•Zq{M7* Oƒæ;‰7Ï Ó é¯€U!‘å}A=æ–¬8Œ×F~VܺýE^zí6ñןŽß]+«gjÕª¡•71¿ÔdqæÐýw<åýÎ!žøâÞÿ \ðÌý™!³înÍÍñ­/üî—O¼ö§Ë¶lž¹$EI.ÈÓç7‹?°óÐÃ?ú×O6ÞŒ{áÛΔèôÞSlÞ}zŽÓ–á±§@%ØË/í*]¾ý>{|ûUí–_0Ž˜¨¶» Srr\ *šA®²‹*åü¢n~Ñíæè† 7¦ß‰ O¥Á =D¾9ÐØ#PŽQy´xÁ÷žv/¼÷zshKayÅǶ®Ûi’—‘F™R¡‚>QŹm„ó.–쟮!­rÁ(O]/ ãO£Nã¹Ï6ûSÌí N¸ËÛþ€Y¿ÊβäÇ—H²õÚ2\7B¦t„&ZÂÆ†âêÄÞÛ¨4BÚB“(•¾Úós{2Ö‰O9 „ õûŽfÞ%Ýóì´7CÖŸ%ñ±â ¡‹iÚèf»PÄvJ–‹f›„F:A8Ð €¡I!ïBeŽbu4“a¡éfá ù ¦å„AV°…²ÓAèšn!´“ω¦Të’¦5B'­âCTž¡ò‘§*•#D²Õ]”³ð¸/¾‚tjHÓ¢×3ñ£ *W$¹ÊA !M™ÇEÏ­ÒLklÔWÈR! „¦»Jåe„`M@ÔPy!–!óPVß[Gœº¼¿t#3¯^ClY§†/4ZIƼ¯Ó,ÖYÎê t„vjH³ TV;›2¬Öɤ€¦/éE‚Ø$b‚ÙXÒ3uچαL£!$©ƒ& š°”×i÷%®¡!4‰f×-,×QùšŒ|´–å)‹mƒ~êâyeèé:KQÆÁÁ€E5jAÕ]ƒ^Šf©£S¬ŸlÉš=ªçƒpääôN_=@šdx‘I?)Óõsº~‘ã!{ôY‰Ê1 dAÝ‘ 9xú0~d’¦)ä)B³FiĨ^úߟQ†Bpª;qêkd ÙDi…n7áðŒÏþÃý8©.ÁÒÁ5¡bƒ­ÈJ8$I‚ÊT!¤=V½þ¹S§@®£œRfà‹DÙÓÓ¦gZèÄTÌaÙe4oR[¸½.V¯ƒ„XT±ì"i’‚,€f!4côÍ['?Å÷‰M¯‹@®”\‡hÑ¥Ñð1+U –FÁ‘ i BrúQB âP‘\ …y˜€(<-—ŒíDœ„Wgü(æŸù¸œu?àœÄ™pÿ%:0éØéIEND®B`‚qt-client-4.1.0/guiclient/images/splashEmpty.png000066400000000000000000000522211217451700100216630ustar00rootroot00000000000000‰PNG  IHDRüÈ‚¬ÄKtEXtSoftwareAdobe ImageReadyqÉe<hiTXtXML:com.adobe.xmp c·öP¿IDATxÚì½|×u&>3¯¢${;E‰cYÍrY·'Q¼ë-ïºüb9›HY;®‰×ŽØŽKþÒ&v\äWYÅ–É*&)Qì @ ˆ¼6ofþßÌ\ «$<à|?üÈyóæÍ{sî¹ß9÷ÜsÏÕÇÑ@03`ˆ@H_ Bú@ Ò¾@ „ô@ ¤/!}@ é @H_ Bú@ Ò!}@ é @H_ Bú@ ˜‚Н$,G{¤=¹¶8dÚ/Ëî=M?1˜~ÓÜðÔ|ö}}éòCm\¤kZÒÖbi»¦ð÷Äž”sjÐJÙ΂¼@eŽøv‚ Ðeç,Á+J|¶³æßOšsËË~9îïhzU¼ûÙ?Z2Ÿvîº7Å K4t:ýN7F°½ ?¨‹ú ÄÓ¼â^†®EmûDWZ³í—é–Fì)úìš²¬ºNÓcfïD0;˜§]KÇ럎ŞjK=|[Ie®ž7mí['ã7ÿ¶çÙ;J¢á}¾àÕà>]÷þ{Y<}ÍЦîàU·áã«Gw`ÀqÒ×êþGûÒ?nJ>vkñ»ŸïŸ5ÎÅ­µ%¡/lÊÛÿÍþÁ/o)õé ^qÀÇ÷]$¦ïŒOݺvsOÙS8bé8š×ù…†¦¹Þ÷5ûÁ÷×Å?½!/' 5X?}má€é”ÿøüG×ä¼{Iô5öˆê „ô¯Ì´ã„tÍž”»u]·­±üîóã=mMá‡é«à“ckØ6ýŽLÎ ÙK –£îÿô™~ÓÑî]Ÿ[2‚†677 º'ÒŸñïØi͘T ôKÍýH;:á8o¹Œçu­¢¯u°¹a’‚ fuåÌé¯X¤;>§Ø›ú,j®+ItÛz`V·¤TÓVLMyëàc˦y×ëwëZƣ­;eWä¥í3›óþüùÛÊsC†–´ž¤-ú.ÒÒwÎ>ÿè+œ3϶Çõm£tI°|óEït¼ßüíÙd¾6ƃ‡%‰XªùtÛg߸>ç/?úºÉ[á=?;ú@wZ‡ƒêKot’ÖG6ß{ÇõcÖ)œ¡h»D¯] }[Këڵˠ{×¢èƒ ‰/lΧµ5EÁÞT¸ùWÝíïš}´Ï*É,®@H_`æ\ç3Ÿ¾s¥¹»°8š¶œÑ‘ÇÐõ@Õªœ[?¬œŒjÓïz¦çPSboß0´”5·qïKŸ¹-té87º¸Çš—¯wÚº?²¯ëZÚÊ-*̉„³WÞ:XÞ²õa–w4ƒ]»v.ø›+#ÿ|4öS‰Ÿ¼®í°8/ðÌ›Jž9g~pçÀÓw‹¾ 4Y‘+FrvüíjƒÛúm#vœ£ ÿivر‚éÓõñ§>nÛ?ÑÚâÖŸ<Ó}¬1®™ä]ÿñwümÝáhØ‚ª˜$àF¢æS‰§>•sëÿ ̺°Øµ;iýÙÓçw2vÔãénJzÑéÿåukνìd;9ÐNÝ?-NOyü˵˜åæ]ˆinÔT³" ×ô§ì¨¢^žô^äŒ|%^ ˜vd4Ÿâ7 šN©G °@})»Ï´{6H9Ðq~V4P62XxÔÆvòtMý"ü^Ӛ̒‰¥÷v¦ž:?x6ÙÒ›tIß1 =2æ×Ì o¯Šl+‹¬, ù3dho© ãO[ ¤/˜ù¥s¶~ò'{>þŽÍ•V ¶G¯˜uL[;s6ñô§¢·ü] ¤gÎÇ­÷ü®{÷ÑÁdÌr}|{ã;ºj8ðÈ_nܸ¬ò ~Œá€°åqáÂŽèÎøk_<ýÁ_7oYRjŽTwFswüõóÃo\“9ÈH[ΰnÕÒ9Oðî°Xg{“¯« üÙ¦¹## çO¿S[^Uæ+Tâºq¢©ó7¾òä õL[bgkêTgªgÀ4Ó6,cAN`ÙœðŽE97UFW‡Ç%þ€fçÚO_wiK/{Núí±Ÿ×Ç^:ïê3 ÷‰tX5w:Övì„ÝO7µ§žjH­^`ÞV|{UÎ₨±@H_p(š;ãßþ`ÿ'ß¹yY$Ù£3å¤ctv'žù\ÎÍŸ2 Ë_8~æáŸ .XrìQKJ]z8þpÍö5 ¯ð§Øv~@‹|Ñü Óâ7šýÌþö]guUÒǽÝý7¿eœ°RÀК[{öu‡‘)TÝ0úz‡nž]è»FO Æ{¸?h\ $-絋óŸm‹óÀ`}»™ˆY qüƈ72ì·÷ô¥¶§·0õ¶…Ñ?^’¯!ó€í5\× Ç0-ÍÉŒ¶[¶ó•#}¿9•³&y‰x÷!}Áå`Ö‚¥k?öà¾ÏþñÖu ¡€ßßw3 cN (ñÌçsnþÄ›6-øü-§î{òd`þ=m^X³ñà#^sËæeWü3à ´œ ô Ý j“DBŠBúì<à 1F(fLhÉ Uyòã È&±uÝLW¼’˜ÎHIïMè_y¶û|oºHÓŠÃŽ’ŒšqLóì™Ðus ÞûþšÌ„™ ã/¤OxKÍìŒ,WÜí‹/õ<Þ’Jv™³4®ަw¶µ v¶;–Ì-š½`AAa~:™rw9 §Ãé }dOß¿m/.Ï_ ¤/¸ÌYºÚü«ÛûÅ÷mݶΥ__9LøÙÆ€ÌÓÏ~9zó}÷þÉMç{ûÒžSÑyÕŽmºÓ¸FÐj>þÓ÷-ö•WótÛ‰ç…uetéë“>%!Ý¡ùPÐheCŽ]rƒP¼]0h$Cc,Šã”†ñ­¶¿²KÃBÌ/Ã8Þ^â m¦ùy7ëÞŒçöG~–L­)º±:o”§ï8%î=‡ï èi#³ óC4ÄË,#eXZXC±TêøîïÛQ~Û®ÏÏ4íºÿÑýÍ=ÕK—/N%â^ü)èÌ«.üÈS¾¹ûÏ¡›îùâÞøò¯¾y°%\Vá¦Y¶Ô~ëÝ ÞñÚš«ü Åâ°ž6F¢îàG#4t{‚ ŽË§¥#¾>6ºB®{ Ú¶K¾#<†Ü`3š m·.%ØQê„á¾þXÃáãö`wQÔýDwÒ˜·pÉÂ…U–™òFží\9»ô“Ïvüê¢ùဲAÇ.Šèºm¨‡Š£&rc)ëãO´/Ÿ“oö'0,JP‹„Zì|è¾›6,ŸÏkÖ..¿ã†ÕùµGŽž/XX>;™Hx¶&‘?mF~´¯ë®-³E‡Bú‚ËÂM¯1ÿüï|çÓ›_‡™0ýëuáÓ†û }n®ùÌ7C7}èk÷¼µëS?þISÀ‰÷üë]•ï¾cóÕ;<üâ°Q5¬Wüh¦ mâ‚”aÍž•c˜æðõÑH #b8dû¸"j¸6ÁKO ‡yÁ “jiƒS¹º2 ¯o¶ÎÕ}þÎm›VÞX”—ƒ·Îtö~÷±}í:{Û­ÛS‰ÔðDˆcÆS•³ò9ÔõG[æøú›3 ß;2xôþШ q¿8ÐU4fkv"êÚŽ‚’‚ç÷ÿìkã+i|â=¯»ý“Ol\2ÏÔÞ/ÔõdlÓÜ’oímyǺ’ܰdå „ô—‰%7Þ–Ž úõëßø3wFø×ñx?8ÒŠòÓÏþkðµïÿÞ'ÞÙsÏ·o|mõ{þËõ׿»áéGõÒœ@Ú ׄ)Ó˜$¼ãñi Åå[Ž–—*Î1&òôž…Ðèd;Nn^p0ÔF#ò£FY~ÐN Çw CJ:9‰ó?üÂ]¨ËWÎþÔ{o_ùøÞo¿päöû‡øûfrKeáC/5¾ss™12Nr$¾×Žè„ƒÞpdD°ø¢íîØ°h6 XnÔ0Œ@4/éo¿}Û¶±0«(Û¢-™˜“2YdCÛª(‰:Ýý²Q`¾à²±âö·ªÝõ䪛nM%’ÚˆÏë2L(,(·B†³óûÆö»~ýOïûy­¾×°âœøQ•Ì ‡ƒ¦Ô{bOß™HzeÅð3‹òƒ%‘ kü{V.˜ßMÈ òCƒîDî¨a\ðy…¡„ë–Ût®-3¹zQ¹ŸñÞuûæßìùE://ФR¦gwìù9çÓÎÙîøüY¹#ß Òw­ G‘;QßÛÚYÕ…ÁD*í=r¨;‘ضzA`<Áâók—ίëMÍ)‹&’æ.j™×U<ôR»¾@H_p…¨yû]§?eë!#?ϱ\Dsô¼|;Ö—8~P;ÓØ¼÷÷ÅZÙ¬oº†_ ¦-Ž¥yÁtÚöm' šé€54áÐ ¤;¥¹ÁDÀö"õzI~ÐÍ•×Óç@nÀ±†I¿8/Ø?˜™Òì9ùÁ<²cº;ÔH&ÍöóÆ—îºmíO÷žYs㪾¾aÓ¯Yk+ò5ö^ }Œ0òVZãD ©¦Êk[û•FJsŒx à™=œ4ó«ëÏ'Ü›íZŠ‘=·´HØ”–.ŠØ!-g$•ÓØe‘½çEoBú‚+„¹çÑùÛwè³*D\ GŒü‚ô™ÆäS?OÞeôwuõ žÞþG7o¿ÃÛJÓ¯QÚ<úÊ¢à¬bxÛz$d¤Òv~n8?œ®˜ÀÓw´ˆî,œŽ' ˵zEY¸®^ŸhSF8ù%9ÇóôuÝXR‘3Ôß›ŠžÈµsÂùFï@j(‘6tf ¸02¡u\Z~ÿcMàtÃë0Õ³‚9†3}Ú–Šáሡ­(Ïaé´åäç{û†Cq¾{²µwռܢ¨‘r#?á` 77”Ÿ—“6m+eÇS¶™¶-˱Üh\°8?¤å¹kÍtÍpùuV¤´0„Ÿ‹+CA)½ Ò\&Rž¶û{ÂknÒ’ ­,Çêêˆýò;‰ßýʉ #Ѿ˜Ö°ù­·ÿÃÿ³uã϶-™yóÚÒkò½¶eó‘æîA+1n\U²uEQÏ@êÑÝí+æMÞ1“æ3‡º÷ÔõœéJÆM+/êïëûìWOúŽ3§02œ`ÐÐ ãDSÏ×Ùô?_?*éÅ4­Çvwì¬í©mõÅÒ ÙT2õÞ1abLQ~4¤9s Å‘\ÃÐð‘Ÿ?{æþGšÞ÷º ›&éG_èèLÍ-Ž,(‹êºþäÞΗgÖ %çÏ+œW†iìH4‹ŸëMõ¥“i; ëyÑ@I^°´ 4»0\Z,È †ÝÝQt.F€½JšvGOü7/už>;hÙvHÊ) „ô—çã×îqbýÑ×ý±3Ð>Ûšxö‘Ô³[çÛõø&p0Q»èºÛ¾üïša|õ?ÛþéÇ'‹‹Â¹ï[yóŠkPÂ×J[Oíë ƒphwéu8ï‰Xò«ï›?þÈ@Óê[ÿó[Ça-ðxÝ`¾¡›ƒõ+ÝÞ•èèŽmÜu¼gã`*ÿУý|Oâžû¹‰UO¥RöÄû¹‡‚œHøhcï©¶¡=u}»k{›Î% 7„”«®9s.öƒßŸ0ܧÑÃÝÖt+•|íŠaË”J&ˋûŽö|ë‰Öc-ƒC kxK]oüänºe;xºpHÏó£˜ ƒ‚wzŒ3ÓÕo&œe%)Çýé .‹ñ'}0¸dóà7>:º7]wȉ 鑨Ê3-><2gÕ­÷ÿ8 ÿËïÚ¾ñ'{Û†ú;†îyàØ7ÿçê×,»ZÞ×m;×p Ý«ûf°Îš®»› ÚDwÜÑA®ÁYf‡·ptg¢eJm±?ûüþ¡¸™¶Ü0ˆë2.ÔùQÃüàˆíåD:¶¥O¼/ìÁ‘Sƒ?Ú¹/eº3Ps0`™VH³|ÏåÞ3À_å¸3mÃQ³ÓÝþÒOêŸ>Ô‡_ îvæš^b* õip»žƒ±„îR<þ̤r'ô4«ËÙv¾ã†uæhš°¾@H_pÉHŸ®úç¥öpbßu &ÒC=œçúÏ––J™ò+^÷ï¿çä~WÇW~p¢³e r+Ù4ízÿWÿëGj®_zu¼nM3±ÑW7g&àÜ@@áëÝe±Ê*À‰¶ssÆ©Eã,-0£0*ndÅv—œ¥Çºeëi_µQMØV*ž˜è'ÄÌŽžtÐ6BAµ1Fɹ%¦ÜMTÒi_ÜEwwO16¸òÑçë °@Þœ¹ãèo½yùW>z³7íøG6ŽÙ÷½¼°tØ0ð$O_ ¤/¸ÄÐÊÙ¦/ýµ¹ï Ëz‘üv)'¿2Þ.}Í÷~[Tüоî¿ÿÖÑö¦~wÎÐK® iNK]ׇ¾vø¬ß´¨ðÊ„cé´1ÊõÖqf¢<ýH(P±ÛûÓþxŽciÝñqLšeÇÍ€aù.†ûœNgÄ‚ ¤ï\*¸×˜ùÑ Éôä™AˆÈ—ÞƒŸ›\^Uâ÷ôÝj:>ÒÇ÷ª£ Šsì¡€ã:RŽG×w×i‰”u[eŽZ„×W™êŒfüζþ/Þk¾tÀIZpë´¦þ K·’Ö;ÿº.žWñôÞÖüÝï:ÀøÈ1Í?òà×>÷/ï?Þz剃nÍ÷†–º3ÿ&ZlÇv^¡®™¦ÿbÃÑ^:Þ7öâÆ¶ÁÓŽž63ožáéÛvƺeäNô›¡ÃJ;m\¸aÚ* .­ž=Ù=}U³¼bNnÌN]xËI¦š;âOì뼌¸œåÔŸ”˜¾@H_p 1•îÎÏÿµ¹óE'iººŸÕþ3à駬ÉÀÆüzö‚…¸xãòÒ²ø+>àFE¬´»óŸ÷9àXµ;îþâÞÚ–þ+&}ݽۅÛÿM¼8kÍÂ;™Ð¸¡÷r¬_ï<¾wT@&iÚ÷?|Z7-7¤n ëâÞÜý¼“êÏ4ƒF ¡}üpæ|ü'OŸÕauì ·u’‰kógçûFVÆé¾ðNN4ò¦m¥VlÀµy¦c'z†þá'ž9Ú•±ƒñXÄ’VmëàW~Vÿ7_|B—’k!}ÁE oà‹K>·Óާ¼­©?7¶cÚûböÚ<4wÙr^Ÿ÷7ßýð’‚F;>h¸ó‰Ê½¥¿Ÿ>¶ïìûÿaoSGìÊÂ;úxžþ$ó¨Û7Î×=†ås¥Ítwçà?þìdWʶüuö%¿ñPÃCŸ²bÉÀh§ÛI™Eá O_íæÛIó‰=ç÷Ô÷$RزæÎؽ÷îhéuCF#¿fÒl{÷Û6øŸJ·Æñôýa¥þÙ=vZK;¾ÁSúè¾¶O|ýèƒÿy¦õ|,ž´ÀþÃûì˜Ö`<}¶;þ»ƒçþþÛ‡ßó·ÏâK/Î)’êÊ‚ !1}ÇFCƒ_øxâɧœX\ ý‰uo«ýƒ©Õ?}¬²f½ÿSsËJþön}×W:KÁˆg|œi9Ç÷½ûs/þÛÇ®«š“{™?Èå04ÿ¦»ºß)‹[—•å<Ò›.õ¶F¾,Ùð‡GÏžî½aÝlØ‹:Ÿ}áìà@Ê]ñ >Õ#WÍJÄ“†ÇH[¾ø»[åÿð¾3ñÙÄ[oYp]MYIA†ädëÀO{ú™]gÒ¦¸°g¡‘NŶ.1o¹qTÁQݱŒ´cü'F0V-«ºçO—}é{my…sTyøû^jþ›ú¾š s¶m)Þ´ ¯0€eîˆ[gÎÄk뻚Zº{û†®-¨K´_ ¤/˜„`ñütòñÇÁ¸ )Æw¶êî:¦ƒ=K~òë›Æ)ŸY1oö#ßýÐíïújOj¹úÃ/`K;eÜÓü_4¾~ï–ŠÙ—ÁûÃñ1¤?Ù&*…yýï›îûòÑœü g„.šëÿü¡:üñ™"áP@· µF˘K—Œdû`hc§©Q¿_g[þÉ]·Ð¦f;ÚqäH{^N(ÅhÁŠ™fÊÂ]½]‚Õ…šÕWûÕϼ?3‹Æ>ùDºæ¦Ž Ý÷á·½°÷Ë/œèG‹ÔƒDZªïüî§Ï¿ð{£(7˜ $m§?a¥â®Û0Üýr‚àü@<6˜ŠõŠV $¼#˜€ñÍTìkÿzøa­w0` ÛMÊ4¼ ~ÀÑB–s¬g ò[?XòšÝaÑ‚yýûÿʳŽkfʰ7?òçHK¦w?ßøWÿ¸·oȼ,Oß ©ù›$¦¼÷®[oÝä$Û "­[)= ØfnÈÊ Z¹!'/ÔÒñPüð×?óæ²¢l¾sÚI§£‘p†áñ¢:£þœdwX7s¸qr gh¨?fXéhPsañw6ÂNôûŸ{ýÚ• ÇѼ ¾ÿ/iÉr¢‘ÝÿÁ Ï¥ZÝ… ©wç€fG ;lšC=±ÎήÁ@,‘«™y!'êúöº–6}§*rkïyï¢Ø!}Á8°cC­Ÿ¼ïÔ~ØÚÑ}ÆÒšæé„Ù”4ñ7ñrWï`É×ÿuåëß8ù}V-_ðËoßˆí³†ÎØÞŸÃßY;Ö¦§Ú“½­¿ûí w}äÍgû.ñ‡%û´d¿ž⟖ôþúC“e…áï}óCo½ÑNöÅǵT\3ñÓ’ÞA²×ì««©l}ôÁÜqË–žó=š9¨›1þéDbt> –1ŠñAÐæ[w„•4kæPÐ1ÜmÊÇpyÜÆ€Á3l]KÅô¡ƒ_ûäMw¾ý¦1–LêëÕR=ø%Ã)üÛ“Œg–‘+.*øåwÿú¼­$Ýó’9pNK[®1vÿ0"qð½aw‡t—èaÞÜÔíļèÑÿûÑu{ŸüÜŠeU¢Û ïÆAë“7Øç-èÅ«ÉKš»ÊGw÷s²lgîÚµ5oÿ¯—r«ë–>ô½þò¡gtˆt„€í.œêùù¯žûÀ{ß0niâ lZ3««ý¤nÄÜŰï§Yi{Å¢¢É?˜——óùß=¾óÁ?yèXGWiºK´sæä®^>ïOîü/¯ûƒ-¡P0¶ÞyGIKë9Ãà*^7IJtÑèÂAnx'­ûVD9š½nÍ’OüÕÛ?øÑ¯ï:hÂešáf厓v¬X:Ñ~ËkJ>þ×\·véxA+í–m…‹æ¶ze"¼uî÷ÚËŽóP…¹ÿøwwÿ·wüÉÏŸ|ôÉÚSͦ(†ru#è¸%&l+²ÓCº3°¤:º}kõoó ׯ/,È­LÝ‘„^Á4E"™êîîK&ÍüüÜÒ’ÂÀe–û¿ó|뙆|u`xì½»òcåZAØ•'þsïÁ£gº{â¸óüò‚;áöë·l^}Í$Oœl8]ßÐRòloßLlUżÒÅ‹*VÏ_´°< Ks ÄÓÌtD#áŠò²«~Y†eéþ’ šɼyÃíÛñ‡ƒ”™vsf^β99Ñšµ+ð'm*Ò^6Xî¯qaWtÝË¥É\õI'é ÓŽ—/ä ïèÚd !} ‹¡3mÔÞ½úL Ò¦“§ï¸iõ\}·j½xú!}`ºzúöèµ²îD®.›“„ô‚éëé§G{ú–¤8 „ô‚éJú¶»‘¡/{Ç+!¤/Ò¦%çí·Àû†>¼ñ®ã–gNÛ"¾@0  ŽÑÑ MÞmŽ0¸N$#ÈjH`|tuõ:|ÝE‡BEEù"¾@ ²RZY „ô@ ¤/!}@ é @H_ Bú@ Ò¾@ „ô@ ¤/!}@ Ò¾@ „ô@ ¤/!}@ é @H_ ^eضJ¥xÜÝÝÝßߟíO”F‚‰ÐÒÒ244´`Á˲b±ØÀÀNæææâ ¨¨È0²Ïo–Ñ`àÚ–––‚åC¡NF"‘üü|€®®.>® ‡Ã+V¬O_ ¼Œè÷0wî\]×ÏŸ?nª®®&+ ®Z[[!X»išay:ÆËd2iÛ6ìAAAAEEEv=Äô‚,(†ÿöôô†ÑÐÐÐÙÙ W'=ÚÞÞ~êÔ)FW)gÇqÀõ8ŽÇãø7àƒ?¦0kÖ¬sçÎÁôf×3JxG ˜êÑÃë,))I$`|øõÁ`ÿF"0N[[ø(œÓíÛ·ã-‘ظ€{‰MrAGGm*äìzÄž¨ |t ûƒøà}ðg*•ª©©™üÎâéOi;ßÜܼsçÎÚÚZ1‡‚)Ð hŒNÇ1þ ‡Ãp<ÁS¤!¨.H­®®N¥š`‡††p Óˆ—MMM| 6rìõàzHŒB§wôáã>c§mq=šàÈ‘#ŠeÄ)¸t¡'Nôõõ±›Y–µfÍ‹àÕ: 7ªHêQq0>|Ò³gÏ*gæÍ›Vï¯]»V¤>wîðÓ§OBŒ`g@b½½½sçÎ5k–ÿ#EEEìþtó!pW2‚[á¤ßÄ} ö¼¼¼ìr…ô‡õ£ÁŽ1ˆŽÇãhæÖÖÖœœœÅ‹‹|¯–£ b0t£|°O¸®äþK’‚³;‘ŸŸ¿páÂ(1øïðå! Ø?ȃXÀøä¢oooç¼÷Ñ£G7oÞ ÊÆ1˜¢‹ÅbŠÍq1H ««‹Í îÏž=·"ÅSæ¸UUU¾—Á¨égÐühu4çÒ¥K,X€–~饗ðœ&ð~yy¹HIðÊŽ'È=8ð Xê ÿ‚zèx’}hðÃðÔ8Sȯ`mrôÉ“'ˆWñ¼D¿³“ñ!¥D"qüøñuëÖá]Œ™ü| ttt€÷!Fܧ¢¢Æc/Näúƒ?9NâæÛ·oÒÏÀ?vì<ýùóçƒñ£Ñ(NbЇãúúz4jmm-|´·pà•ôXÁ_d|’ ¨Ê4Í––8°xLw„‹ƒÈøôjKKKáæãSÌ€ÁñÔ Ç“µÕä£a[gg§ŠÏàn;ó V¬XÙÜÜLÞç˜ c,2>.[»v-™äŽóŠñÑ( p /%¼“ý t B_¹r%³ßÐx8Ÿ››»dÉ´.Ü´:Æ[¶l™Þ©ÐtaÀPnË™3gpÞ z‹Pð+ÈŸ,­#sÁñ=õôôÜ‹‹‹¡¥dÅûx™ã‡Ë²|ùò™CG†8›J±({ F_Æ5C¦9A¤Pue&Iß õ@Î7nT„Îa„?‰“Ö]¦²²RHJwðàAXrÐ=£Ÿh{´(X¯   Ôóþâ‹/R8 œÞ#<>œ E‹Á'BçaÔøºë®‹Çãx)c«/—˜O‰Á%xÄïæƒÇÉø ˜5kÖÀýÔ¼Ht{{»òôq=Œ7Fh2¼5sH²¢xýn¾šÿ€4Àøã}ÐÍap%(^Hå¼Οb|ÈMà@¸UUÆ«W¯ÒŸÒW[[;kÖ,0ÓoAs8˜3g§nЯÐëТè]póÑåÐÞMMMÓlr ¼õÀ‘,ÿ‚2ðøLT€d˜ºŠÇé/]ºT¸û²X\S:þ|¨\Qˆ,s)\ NU)·Ý0WdóæÍpMgùc;ÌÖç’¢’’’™#j Ó!j5¿Ê^¢/sìÎ\û±96ôrSŸ¥$!gŸU¾^èþÀ‘ÊÂe'OžÌ–2³Hë±cÇÐNëׯ/++ƒ6 !ÑÞsçί¡[‚ø0 Ã1xÇhxšq z4€Q i€s ÜPzh-ƒW {cx v¢ •:tˆN°ù%t¡$Y__E‚$!j¸'tJu‚²ý šƒ‹<•S eࢺºZ1>ç™Ø£Â;h2ãÓ{`ê—äŒQ©?he†å«l§¨¨(77×Ïûœ G渖~ž3áz¦Ìr¬€öòG8’3œ>}šéYT}s‘>ÚÖ ¿}ûvfA EÑëШ ?œõÃÃ1®)((Óá%º®D»B'0ÄÆ[œÒÉvÀsa-t E£ÌQc[\ ÂÂãg¤6 ü ×0±&\B‘pÇååå tÈo/0”ëFàHžÑ|åx‚ƒð)X u, H9û´4hPx¸Ðíiã LôÐS§N©¨Ž6²†–ùÖ¦i2ˆÎ<}mdMƒŸ÷é³ûçà Ð΃ֵѹ:Šñ)p¼‹^YY9gÎ!ý©tô¥Å‹s¼†.Á¹p£/¡ùÑKáê¢ÇÒÕ•hZ\¶råÊÇ“îA|x™½rqà‰°Rca?ãC•aü®“æ’?>y ™ölrÅ€[Ú…ÓLj0£ *¾ ™Ã*p½>¼Kcütà 7d¬à‰`pw*¦¿hÑ"Ü6íú‰q'+ùICUZ|;fB3A3¡«þÀ¤ÁBid|&a3áĉ*½GpmÁ bv.oV†DeÄò_Úc´¸DA“ý³Ó0“!á.ÚÌŽƒåË—ƒÇq/Ñ`,–„ó ~t'ô"Øj(<5è<}ôI.¼F3£Ëáïâ÷àWŸýÍÜyþO˜ÅUñUoÖ«þ@›½JêRŒOß\÷ nÌ¡$4°¶¶Ö/OÈ™Zê_rOÅŸ&¨’Lü‹ÊËË¡®[¶lQqÿé ˆ®³³Ó?feMïÂ… ýE!µ2gÅY»¼ŽÏ˜>où³±ü:øøRp=ZSIúä̹þ+ 4<&´šyÅŠ`|•‡“pŽÐ‘кœÌÁ1¥¬¬ †|„‹°a¸CкÌË£íqÙüùó1ÿøº™¯ ¡AuÕS++XäoÁAQñ^.CÉ`|4:”ŸÅJ7lØ€ÞÑÔÔ`ß§¡Åÿž;wB†!á¬$ÌMõ-Bú/cTí4à­ˆF‚­®¬¬D'Q®=Ú˜ã;•ù°}ûv†Sq¬FdhK\ ²C£9q[Ømü{öìYR¼3vÐ÷p­ EÁ0|×®]ì¥sçÎÍŠ¹2pŠzq¾ªÏyBËñÉ…#üË­$ÆuöñŒ(d2y¾9îÌ$èËø¡àÓç°øÉì¯b>àîêÍüÌÐ ÞAãT>–ôð)Ü“á É‡´"¸[^É8—ýæ ÃŒïÝq·Ú5»wÉmËï ã³&W[[ø—3Š0“*ä¢"3<€…&3áG} h .×dÑsWeךgNc²Z< ^qq¥‘\ … 666R“UF T~8TÎaT¹i¿åçä;nˆ¶ {à#põ@ñ` šRÜŠÉ<4ÌY<’-?;è˜S²Œ‡Îñ@§†fí„æ¡“¥˜‹74\§eË–¡µ@X脸à8úò¸!¬=ô×3·gÖ¬Y¸¬ô—qBz°zõê#GŽh^2À¶mÛ¦~Y+*1»„ßÇÇyæ2ó˜Õ‡8ÿåÝd,ŧ ÝÚÚZt-5±a¢›A>ååå`"ˆrcA ÿ(ûâá~|ާ=¨}r˜ôùröb—èÁøà}|ŽüØÏúÙïÒZŒΌŽ»µfïV¸çì15V›÷ßjÇÝd–¢ÝÿßÊ]_囃+ÞÐóÎû¡Wð èž“AT6|†\†r²€? £Õ××£@FÌÇ1­2÷óÃyæCW³q³Ö«Dç’Zÿš81P<(p†ã¢ŸÑ|¨+Sca,gy@pÂÅ}q†Ëñ]pׯ_ë³=3*kH T¢­€˜” ɺTh;4>ŽÉøœNa¦-€t.1å ?'ʘô¶aÃxOjÖ‹ ¬ùA¼Ëå¦0æpK¡  {–îƒÆÙ`ÞEQp+æ½;vlŠôñ8°aì~×F¦g—-[–Žg˜8cÑ}vp®G[@bü¼b AO<ÆIp×­pÊñøñã“­VÉ2Ÿ’s¶*ãŸÝõÇvÆÅDoÁ¨{þÁÝ~Ì=OŒcî¸wøäwæÿþx^×7<\‘‹Z厫觚2.™(B¿"… QCF-p†Û6A’ÎÒ Ã#A[ Yq Ó’]‹ƒ®à¨A,ÐC¸L”â 7ßÇÇ ÐÃ666ÒN«¡UF!k° '&K@æ µ»–„w^.€&öîÝ µFÚ½{÷‰'®»î:VCC;Á g ¹š1cºü\UÀëÄÅèZ{öì®à2´+õ€Ôr瀀ӿʱEÇæ¸ïСCpî jx 'ágAuTVÀ” èsÒ‚S¸~“á{<ˆ?çŒeUn‰J-g~!d¡¡ ªªªH@Œ¤©16’J[‹¾ÁY¿j:Ý´N9éøS¡Ã¹¾ë~7àΛŒÄM5»ûÛQS©.øÜ—Ùñ)ÖMÆ·ð‹.šÜ©xŸqžŒ“ø^&ðüü¾*¦ðûÞ…ˆ4ýfíÁ¯9U›´š½®ÂÅÕ›{Þ÷XÉ‘ÿ˜óøß¦æÕ´ÿùÃÊîVTT€ UtvvBÓ@èŒX²¥àÙ(Ó‹–Âet; a. š±›zB8œ…bg‡ !•ò¤Æ^¤{h)þ=sæ º9—ãЧbû·¢d•|ø|þ0¯ÁKœ„ÍØºukÖelg“§W‚FO€Æƒp9.cÑ œAK aÞÑö´ ƒ’ýÑ¢\‰ÇŒÌ´…ñ8zô(ýÌS„%@ÿéééaÍ<š ÜI]ø,ÓïXY_:ã–Š/Wæâµ~t³¬Ñ€HiÀ”Zã¹àþpvËï2Žú .ªœåã+0âÏ ³_8h¬ \<Ÿç#O¸¬êÍã<®’ôi ¼©ÔQäK‹Ç¿3îƒ;Ož¤?îG2³ñ÷ ][ßk_(?—\û–Ø;¾l½õï¡uŽæU0t5XqWB´6tOÔºL (Á2¿’G±°çÀU¢JµbLY-ߥb3Á!‹vå¾ö~«§œ§N‚Ñ©lÊõb™‘ŒMA(x^Mû©†ày´E†ö²ƒ°p3íìÚw'LýŸþüóÏÃñ)++Û¼y3àõ£y®¿þz4 ½l´z—Îr#—_±>í3GÖj4ÇàòòåË™ŽÂ¥}ìid|~f€^•ju®§Ÿ3gÔ‚ñ¬^½šó S9¾¦ IýVXÖûeV X–GWGóªÊ@>¸ƒíAÅpüYÿd|\¹Ñšf˜m¤6$®¹ñƳz??¸{¬8Í0±ñí¾}ûæÍ›§ ¬ãyá+dL¨›ÚÛÛ¹ü›³JÔ^eü…òáÖ@ß8m«äÉàב,Z´hÆò>$7’GÇ„WYÑuƒ;ÖAWe´—éjË–-£?§ f0â.J¡T™”96ÿ‡éÝ £7f©>õ©OMñŸÈ½ ˜fpvÚa/]uy8 Æ1ËFæææ’€˜æ¬ì? û¬Y³ÀûÌ0áS´ œÀaT_ÊdsÕÞ ›€á÷à+Ö¯_î=ňGïåW‘7„c½_¦â°x€1‘g¤KyCŒOžbi£±Œ¯‚Ceø"«3Ê¡BœBáúIŸuŸH%;–Ñù ‘Ò»‡1†ùäDe,¸¥yÆ ¡rc¥ªj=â[ð3˜½6ÑaIf¤—5T(F‡tUFüÑLÌòPñz÷ð˜ÏÄæ#d|§!m(@–îI™–Š+ÑÑx x †“«œàâì"k[£©`ÏÁþhcP6.Àyö–'TÑÖlà!ì6챤{|®3Xã«Æû”——oÛ¶-+ê c4ŠŒGScX&æS>LøÃSû«wù+R2èEà}òŽßµWûNà-ÈbϪf8J´»¸ ±±qŠO‡\¤çŒ,þôW¿ÁÓq?^©d¹Ç±Œ¯úÜŸ*JË1¶Ä×ËøÊÇAWŒ¯ŠÜÑ@âäο¶¶648fÃz ÊáþãbÊJÅ'ÑßYÑšMÀ9¿q£ Œ—³ÁP/[bSÿ'¢Áàrw'´"ØT‹c°ÆªUnq+fˆcÀÅh;-?>…vÅ[hTŽÝß×¼ ´Ù–-[`ØÙÒjg5.µE/¢9¡ºøyC`uðE¼gKr4 rƒÿ†ª®®&Y³Ü#@þHŽLëÄ0¬ÄMˆ¸<Ý=#øx—ù²j.=£Šƒ")V¼À•ø%YsÂ’[œ7R5Ù¡húw¯;lâÅÌVDã7º´"ܳŒ{B©½Ç‚^äÕi»›¡ ãÁ!It|ÎÒÁ;a‰hž ¹Qûƒ½Êrã XB•Ê(..^±b+nÁlÃŒõZ¸*:{fãöÙ±8«ªªŠ™à---4ø~ ÷;/ÃKbˆÎ8ˆËÑ!Á/´ê\,Cꇬ_¿¼Ï]aÕa )IîT*ßù‚‡6¤ÍŠðÙ¾hè €^ÌÙlU“Ã#ôb¼EUg²,º6Ü5HǤrºùlGÆ ´`5¾÷¯òQ^uÞ9{…–?E¾(èÖÖV ÓX}ó3LÎaæ—Ø1àƒ†çl>s¶8ùÎÙZÖQÂ=ñút‡Ò©¬¬Äp% +þH5oA YQ`?•Ã#øŒœæbJ¥Jñ»ö*ò€§†xY^”3½& aššš&â/ 0/fiÜ 'OÆãñ}ûöÝxãÙX²Š¦dÇ稅'YÓbƇi ã)ÖuG:>qâZÄ„·èd¡U`«™!Ž6­sÝ,7ÿSsôt—ÐÙH7ªVmqs¼Ä»ðŽÂSZ¥ê¸â‹²‹­Èà…ÆÆFÈϨuü®k‡MåŠ62ûO†m€œ!|f‚rÖkÕªU¸-;x ör¬CÄLg4ÝØººº 6diLŸ5ÎXu•Õ[iÿ2_U=b±F˜^PeÊ(wƒW¡Ê_kÞž*PcܸÎ>› Í 4ö1f6š,eY¹ŒV1¾_ëÐ4 }:õüM¬JÜäþõê#ðÕ:/Î{q…z=·ZÊÞAjÖ RX”*ê¡¥¥…#µ—^z Þ:ø­?ˆéáÐþ|¬cŽÖÂ1 #¤ôp¹Àš étó=q™>¸ÿ~¼5oÞ<·Ä•°ðpÄ²ŽªhðŽ9Ò¬@ Ü7^$ â]¼… ðï²3ˆVŸEoaLvü¥{ ámÛ¶žü=sl0”Ǹ>Hgl_—Ô>€©!5¯«²ÅhñÈ,èDâVd0>Þ…UVŒ~Y±bôœ/ñ–ªò˜1l v O×Omœ'q™w§š€±œW¥AƦ C¶*\C÷Ÿ’‡¬¸Cªß‡`ܯn¢||®VaÍAˆ:K‹Ü³¨w1²Œ¶9yò$ZMýæ†ô‹/FWaö3ÁÑ<ì„\p˸ 3q+nKÀ¬|®ÖÝã$:'îÏ>Œûû(qŸ…NÔÖÖfÝf¹Æk^ó8×ÜWOÇdz Þ‚p†õJé1 ìçzÞ‹Ð’×¶lÙâg|m¤´²?áUÙ–Zí@„/Íöìr¨ ä…a´ã} IñtL$cý5¨ ´ /Y®ŽeáxúÓuÐ x—ã†6mÚä§oeGý#3/8«¬â×ÓÛÓ‡Æú] öP–‹(7‚!dz°yi@Â*þ¦6ŽgÒ°•¢æMŽ HúŸûŒrêz»mÛ6ÙDå•ú HŸ{Õ×××cü»xñâ³gÏ2¥­Â9[´Ó×ÐU¸æAõ"´1ZmŒâz<ÖÈX’ê× ^Ͻ1³z ô }Mt˜êêj•¥ªy <܃”SÙe–a2¹2Ù¿çî•j«R¿›O/Œ‹Ý!ð_|>²Ǩ¬TJXVV…„Ð`2!@XM–ç¥BBE¹mƒ*cç÷:Uˆ,c­2®‡ýPŒŸÞáx‹+W0üÍÒe¢—èöAªuuu¬EJ*g*䀱‘Z¯j®¨¢#Ðd4„ÏÊQ܋硫´Êã2>ÿðY4+<2œÝbÌ®ŸË½PXOÆú’’0ב#GŽ?Î}¬˜ÍÉÁ·ÅိËÕX8fQŽcÇŽ¡w±F ‡„ eOàÑÅÀ1˜ÓƒôÇÂ…§Ë¬2Ò:q} ­€ÎÀuíœí@ò3¾Ÿ¡`k¹‘_ª­é¦ Wªº=”ʉ—~©Â@o¹~ЯoÜß òä ÕÕikk›gÅö‚OUç¬;´”cßéJúxF7_eÝ0bc ŸuÔãðù Ã¤x(º0GùãÖßW>>WVCi¹ÎœµfÒ¥}.(=yòäÖ­[1¶…§Ž„æA·A£rÇØŽ6RŽÿÂÏ‚ŸN7Škq¡(hHÜÉv*ßÎ_\M¶b&£ÚŒÜy°÷—ð3>ÄûÇ[;„É<}æ9ø½{u_ ¥Ø ·å&$Ó^†ó ¨” 4”EdF9©œþ»ª%56ªƒËâñ8ìU7›Æ’䢿ƒÂU8ó¶ h#»³y3‹òBi7lØ¡Añ,[Ÿs$,Ã¥e©A|xƒk}²}âì#}´Ä¢E‹à~j^š‰^•Úgò,È= 444  áš-[¶0m:kPYY 娳g£oŽÚT¢ÔpÇ8‡Æ@W¸’{F%0xR)†~Ògö!ƒ¡ÚXnRÿ²ˆ9 Õ±-²·"ùU~ äØ$}œ‡ƒÍÕF@Ã&uÀÌcò÷Φ÷®èL Pu¿)<2ó5¨®èÝÐX?ãã-Æý¡{PZBQQѹsç@ýèàt;ÔžBœºÃeÜÓF—WkÖ¬™6Þ^V.&†³ßÜÜŒ†Ô¼ÒipŽÐ<ô÷™¾©y‹ƒðZ¬}Ýuס™éòƒîq£àM›6A]¸N=]ª=À»±X?“´5ši`ÿaò§–Cb´…þ½SÆå&u“n¹jtf “€è ftó3Rõ¹XÚŸ;‘H)O˜(*´º¦¦f&x$蘲s»`Åéà}èÌÓ÷ïˆBŸ™Ö9êW[[ËüNæ#06Z`Í. m5oQ'®a’ñt*q‘•¤†„³Ï} ûûûÁ#`üåË—wvv666¢ÙpmŒ¸çŒôá2¨ =VÀ'ÁªÃëÄ»ç<0ÿç¼æö®_¿†Ä?½9£€N£È ãÕÕÕªüGÙþzmy£pEUáIîC C¢ŠÕÌ@p‰æE¨UXŸU©™Ÿ3–ßÇQR;BMo_Åîý³nš7çÁMR5ßÌ­¿ô)W˜Ã \¹reyy9GN7nÄ1:>§g™¬ÉB¬çCýd–NVçêLÒç™KãèìsA)xÿðáÃ`I Xƒ^M÷Â… a-Æ6a¡‡ÒÒR˜ –$ãl$Žq1n;cÝRøP}}}Ü0#*•^¾wQ]‘Ôñ% qAu6–'¼&`ÆH}}=ÜR¨4™<Î%¦ã¦èh£7´wÂ’$,9€Ï¡™ {££¿«}cTÝi•{3¶$87Õ¢kBoÝŸx3Ï(ž;­â]ø"d2>)¸†‰àBú¯~tc½½{÷j^9ªæææÅ‹WVVb˜ÆåŽ\©ˆÎ€·8©»téÒŒU£(õÀãµk×jOÎ høD0œÌrãš,–žÎˆB¨°ƒ²LHGÏä>!h ÐSV¯r¸z@999pVTB0í(£üÚx3"j+¨43йhŽ×«éÍé 8 ‚Ã3ãR&é³²ÂXÆç¾(T?ð8 mŽ-HUܶmÔ› þÚH~åêeoéFúOn[¨y%‘¡°ÿ¬†Á=3Ñà4*ú.¿çbä^»ííí¬Æ£2OÔej­2{«ðŒ™¸ ½”1¢.Rø•'è›Û·úOŠî)dRëÈò]XPØcÒÙ )® ý©©©á¨{c°N‘ŸñÕ ```Çñ tj¢i¦ÿó0¼ÃéÇõÓô–aàʰüÊ•+qÜÚÚÚØØˆ3èT¸€Ãg!î«ô÷Y¬ ²…„Õ.£)L›#7Á COãn- Rƒ’ðrË–-¼UVoœrmÁðüH•®‰¿î)³9`…TÁA\{¨öû\¿~ýôNМÜö2Éñ ’ Taj¨Ü¼yó8$ÅØ}Ó¦M—¾œªÂÃô`v“>3m¸o“mΞ=˼fXlðN¶¯›:ô„ÎÃÝY “ÉÑK±ŽéâÅ‹áFqá(%8YCCC }† fæøEQRRƇä¢?rVGG÷„(//giXx38 Ž[°`Þ¢‡‹ÏÎLÆg¼ºÞWs¡f\HÈLk0@Üëq L+ÒÐÐXáääÉ“°ù8³páÂé]„äÕŠH”••AÈÜ –«ápŒÞÅ…op²¸I=“ÍÑ;ƽ×Ezã~ |ü'NЩïëëkhh ;ÏLDN3ª˜£¢)<ÓGžéªèûmmm,¯ ¹AJ‘à‚À¦Nã(Í•ûpm¼™E@c8pŒgt/„Wð§@è $èkÖ¬QŒð¿ n¹å½~µÏ¢`"ÀpbÚÒÒBÿ€=`!~–ð…VïØ±ª±3eYô\ó–SÕ××Ãù¸þúëAñuuuÌÃY·ng:“¾àU§Oà~²´2¼-t90FÜ0½þRn‚KldSSˆ¾ªªjñâÅða1®boØ€™”yŪÈüúƒF"‘õë×û‹ „ô/#˜=c^ Bú@ ˜BL „ô@ ¤/!}@ d¦èâ¬ýû÷û·1›?þ¢E‹.ýãeeeÜw×®]Ü_íÊn¥y›®?~ü >8uH$êëë{{{3„€GÃ[W¼;›é†n¸¬5·h4 ZgãÆS\n|Àh4ŠŸÊg¤2hÞ–ÂW¹«†¿Q.Q†~žĎÐÚÚZSS3 *ÜAìÜëTaò&Àõ«V­ºæú€VCc é¿ì€â†B¡Kìc­&ª°†·rrrÔvš3è~# !TUU‘t²z·ÏWÌd‚=—-[ÆÎ¯ÕmÛÚÚÀø¸í%jãäŠ=.y˜M…W.Î5ÄÔwS²žôa¨gÏžM Ïu‰~ç]…+€p¦½½]óö@€Š³[Â&û‰·ÊðúYš÷qÅö¸'3\?| ü2îÏ~énÚ«K[£È‚%‹8 +OŠLD¯N"W*+ŸK=µšjåÎããx'!L¶]6–â‚q#JR{mjÞn<Ð1¾½]õœ©ü`<]EãX ŠtŸÑÏÑ‹p^É“Zâp3A|/E!ЈÎ÷@á2Ü™õvÐ+ØÐLì$[·n%Wf“gäíeàÃò%ßâãPZT<‚‚`ÁËdMM͸-€h ÒJ'!@¼EÆgëà<®ñ+¶ßwkà•Ìé*ù)Òß”ä2|”?M6õ·¥+OŽÝÏ!C8Jz,¿L+‹Ç„0)IàñÙj.ÃgUm(Q\ƒû¨“¸!¥=–OØjêW1ŒIâ×<²4ãÂ;äÂåö{ìQrgg'¢‹ú¼h4-®×FvH€íÇÝÆ=ÉægÛ³¯Òxà ô 7õƒEàhPKSAŒx.¥÷= à¢vu’ýŠB ç¨D俌ÒËSãzšFHÐ:¸Ï$„557¦Ž†ÇU¬ Ïâ ?žÁéê‚Kù Ü·õßrV,|Y\¬džá6mÊỉŽ@óÖ„g¼ËNÍ-Ï(-ål 5Ÿf’ W;9£³d 䦪p h~ ¿`-¤åáɯ¡qFÇãX Í3îÀŠ·â5á^îa¸ê‚¥®àK¡+ž_úÜÚ«k8ñìPM<>Ô:CPœ¤Rñ±ËÝRÜ÷ô϶©qU¶úù€4ñ8`g¿g„ÐT¬ïÊbGSN.üKŒ\ºÌiKT03+†­cÃ;“ Î2ü¿XÀéøÛE¥Íz±cõ}šào¯±¶aj"›R6)}Zin^ÌV„¾¢ èNâ$͵Þ’.ÏsÏ=GLJ@Nˆ‘¡X#w÷¤_o ×F6gg?™â†„þœ°3p',Í«ïHqŒ!\´”ˆT¿ÂK „¢PçUÏÁwáæ‰déãAÐ¥3h‘½¡3|ÌI< ^ÀaÖØwI@ðý^*kØñzF–üŠÍâûüF~ürmAvà 7d„C§rxç¹Lb 9 ¤¦±S3vO#§40CV”?ÝvµµêDò„ùa˜ŸâWð÷0(žþµt¸ Y´7]o°ŒJ¡Ó¼éÒ4ºA½‡±³íÊ£¡›ÃËxŸ÷¤¿2ÀªfØxrê×ì†Rª>€þ~a‡¬Ú=p¢ÂÄ8oÁ¦Â<Œ›Øƒ+$EC(áp £]Núæþ¶Ãù={öL›òúN ¡MDCž"WU =Î ÐÃ`@™âRé¡c›Ã ô…«Q?|´ §eÃ,‡²q"ãr<&^âx" „þ3ΣºÃ$^­/:‹šÁ"5ÑÊ‘‚kÁ ³°8ýÈ4žé‘Ñeˆq“¦%dE®@0CáGM§y]Á´ ï‚k…eË–Õ××3ç„S23ÓÍŸiðŽ@ Ì HxG „ô@ ¤/‚¬FöMäªêTÃÏà¥âª—þʽþR¨þ*Ó©ä¬ÈP„,¢QOgÒ¿,¨ÅY\O¤VÍØ’³"C²ˆz†‹:‹I?£ ±ªºì?ÉZʬ,8¶Œ°*ÈÃ•Ùø Ë'MTRxúAd(BQÏ4Qg1ésí¸6Rsmòʽe„UåÖ `rUžZ¢Q‡vZúD†"dõLõ4™ÈEÓr[;S»ô²¸k¨² yF›¾uhE†"dõLõ4 ï\´pc6îÖ$2! DÔBúã 娨ªrï¸Ø_FØŒÑ0‚ëéé™={6‹6_Ö¤Óf8,2!‹¨gˆ¨§­›¼r/·¿Pe„ÕyÖOniiávš-©:½!2!‹¨§½¨¥öŽ@ Ì ÈŠ\@ Ò¾@ „ô@ ¤/!}@ é @H_ Bú@ Ò¾@ „ô@H_ Bú@ Ò¾@ „ô@ ¤/!}@ é @H_ Bú@ Ò!}@ é @H_ Bú@ Ò¾@ „ô@ ¤/!}@ é @H_ f.þãP›atÎR‹IEND®B`‚qt-client-4.1.0/guiclient/images/splashEnterprise.png000066400000000000000000000627251217451700100227170ustar00rootroot00000000000000‰PNG  IHDRüÈ‚¬ÄKtEXtSoftwareAdobe ImageReadyqÉe<hiTXtXML:com.adobe.xmp ¤®gbIDATxÚì}˜TÕùþ=·L/;ÛØÆ–Þ›€AšØk ±$j$QcL4¿ˆ‰ÆM41ùÛ5&ÆBDAÅBïMz‡¥,»lï½ÍN»íÿÞ9»Ã°€‰‰&,œ÷™gîÜ{fîwÏ÷~ï÷ÝsÎ%º®s #}Fú Œôé300000Òg`````¤ÏÀÀÀÀÀHŸ‘>#}Fú Œôé30000Òg`````¤ÏÀÀÀÀÀHŸ‘>#}† ªÎ-«Ž‘dí[éxGŽ{•+{˜ÎÍsß×¢$[ùˆÏŽ jœOц¸Äoö»šBz¡W izº]Hµò¬ã10ÒgøŸ¦z÷„Ü#AWµo£}#=ý›¿›}ž;âܘ…Å>—‡ƒÓøáÞïM–çŽMþæ,À½‘çý¨op¬c"{êå¾.ñ¯ã‘°îLjÌ ÿU•A8‹¦oP8Mû–¾¡·Y;GÏã$UÍ«“ÃÌÞ ˆƒvî›^ÿï¨o}Uhé OªÏË÷ö ÿÔUM›gy,ã}Fú ÿ î#$üÏ·¢ô9ž;w“W¢AãGNÝx¯‹‚®+ßTûGZ”…ÅÁÓc¾¿¥5ÑÂ×úÕÁé#í`û_í÷¾0Úɺ#}†ÿ: ñÁ}ÿ¤¦¯Ÿ™º ÷OÂŽÒÎእ®sF]«óòg¨ïoì¿™çj¸Ý*pEmê'“]m²ž¼°þ¡AÖïg[&,ob]‘>Ãÿ²¢ëá´¯änBˆ¦žÎï:ÿÏt¼Nõ>y~¤ø¤kœ€ØF¾Á̤¢]Ëv ªÎîoÝÔ*ëÜÜa¶X‰y®‡M`}‘þðަpüWvò¯ŽýPô³ŠplW ÆÓEÂ¥´”{K ¾bÈ© ÖÄÖ”,¢G‰âð­Owiž'Шá+X5);–ãú›ö&àcUí yCõëºúMÖ£L×ÒR¬|¬™ûí(û·´ÍH¶I<Ôô¦ Æú;#}Fúzå–-œÏ•˜¤igTÈ›-&ú§-k•WUÜi ‘@à¾PiIÕÓWôƒæüü¡K¿ZÜ‚ \tä¯ @Þ¨ÕŸŠ™;kÜ?cÖsx„¢f=w’ô5N!Ü77‚nv–e~Aà£~…ä?œâõEcõìø#-jŒÄîâ20Ògà…Äq7ozêæþòWŒEQõS+%:OˆÐs€uúÓbêWQm‘W™½©éPqà jŸç¹Ú£hïžßΰˆÛÌÒ?W¬v©ÓHteŸNQmn—Õlê¾ö&`yU#,¯s2’Â}süªTóËG|ï>ºÔëÐË.lºÒ³©Vþɶ¶ ³bXgàÂ7’.ì°o¶NúÍ‚\q|[«Æ &]—t®ãÅi&]•’|ÿú§”ªýgk¡Ê¯Þ²©ñh‘Ÿ“U(s^z©CJrÙ­MI‹s}~©ë:BªE¿@úBwŸU¢ã,¢ÎHU¹ö *}DÅÓbŸ;Ôþ×þ÷‹ ?ÝÖöÞ%®4VÓg`JŸ¡CV[íã=oë7 ñæYlfUÕ£ó©Ôâ|ÿ†§¬3~/& ìrlµ_½ucÃþ¼vMÖDþ”(„EVãK®ù¿‹³“ã¾fD“4׸èòŽ1‰·›Ï%$ª.ªº@:΂hšªh_]ÒLJí²Ö*kA­9¨awDR§Ä{Ì$Æ,8D"ñ§äVv‘¬˜³¢*´­&Rõqó•žf&ïé3DÁêt{lþŽÇ®.4š,&"4Â$‚Q‰ÖK 럴NVˆ;9Ùµ1¨Þ¾¡~DZv9   žèê1†¤»K¬þŘA™=¾öÒt+z'‰nóS¥|æÝ9ŸjŒ :Y 〉 ¨Î|ÚŒ$ìÓÒ,ê¥Ãÿ±v~%þ×&kæSù¿Á+ë±aEj i-²ÖÐ@Ê&`{œEp›ø.,|J£évÂE~~¯¬~U$«ð){ëBëKü+ƒeÍŠ× }ç‰Eâ{¸ÅA=Lã{šÇ&˜û»¥èÓ”xîšT^¬c30Òg8+±‰=ñÑîÇn•ª &“vêŒY]Ö¸ŠÊÀ†'-Óž<ØRïWïÜØ¸ãˆ7èS ¯Âø:!RÁe¿1¢Oê¿ñcx䨛Œ*!\Ä¢ŸY±¶ø•Ÿ,)+w®î ò|i£ÿ²4Óƒº&Šªß1?o@ïDä´uD¬Êæà¥©Âí#{tfú­ïå&÷LˆZ¨Dç ¼¸nåûŸðª›ªÛÊC…u¡¦6YV4DF§Uè“hš”e’jc:#ñ œæà¹“JŸèE%g½ ‘¾´Ü÷i¾oO¡¿¡Eæ3"ˆjÆíXM×Z™_)®­/ L—gdˆ×÷´örJ¬30Ògøp÷Hñ›ö?ñQ}Ì‚IÒN)¯u¾®1°é÷Ö©Oò®äÇ*–~rXLï+éÚ)SJ zô¢K:dü Ìó§hšCà,BTu?¤Kh‰œ¶iõöJYÒ‡øæÆÖ©×œ¡¬$ð\iyÓ¾Fßy •ð|KsûÔxWÔ>$äõ¯Êiù“ BPÕ'÷rl®ò¿~À›_-|*H¿ÑÎ ¼­ÚîåHµ²13t]¦å{Ùr™ šî¹Hqð:/«œÞµÚ®jú‹‡[V+*‚¼ª$™Y¼¼ ¾cOMUÂgªiÁ`Q!÷Iж»±í·ƒ}=LÝ30Ògø:ˆKï=øÑùûžþÞEC3IˆÖûÆHCŸ.´¶6=gúø•#ÓŸ›VøÈÚBZ6Qä“ ^‹.ûé i£úüÛ?RØ%pV1Šôy¢‹ÜWTB܉·óZg‰IxÉÇŸ­Ðbøžö“ããyž·….µu"+©N!¼$¦ÞYD"ÍòâæÆúfÅÍq1&=b™ÈM]–++¤‰Üæoþñ®fD]OŸO5ÓºŒrEkÏïiZ] 6Èñ¼‚½AÐ9RWUå­«ÖUY´¹ãÓÓ.‡ “»ô€^£7KîŸïnùûø˜dÓû Œô¾{”ù÷½ÏϹhìPƒ~£–Ã„ÎæÛˆhç›_°L}dî-Sê›Wüiw¡%)C×dã6./ª¥Ç>™Ó÷ò±ýÿ“ß@4 $n7‘HФOÎNúH8<Q;i^ù6;ÛhH^ל’Q„¢Í‰"”N‹(ºk·jÑ+!«>"ÍiBÐÃ7ð_¼Qd…oŒº—ý¶Vó¢`h«}b†ý¥¯ë£ÍŽE(|×U6µ/+ð'¨|ˆW9‘DÉ Û±mΤä7 sØÌÅ• o.ß_ڔѻo¯PÀ®?…„:¯=Ãõóõuó¯Jy6$Ÿ‘>Ã×AêàÑêÏ^Ý÷ÊC£'×MSU®³T¡ê:߉6QÞü²4åÁçï»<ð¯,3%¤Ã,Ërßþ~ú “‡ü‡?´c"ßYu?òJ'ÚYÖXÐ >5óŠÒ±¿ÉÄ7Hg÷$jšA¾ö‰Í5_|×â0 ‘˜!êšÛLˆÆGNÊÇŸr#×R[SÝ7Ñ!·u"ŠÈ™¥²Û?2exß4ºÏà^ɳ.ø‹W–©wf&Çp¬ 8Ú,Õ¢yÁ¾†ÛFdz>ÌÀHŸáë!}äù‡Ïxï©Q—Í’rô|]hZS+OzØäM¯KSîåÁkž\øQ± û›Þº-õû³Fýçß…câÝ^í”úàG9Äsg_ÒÄiqV^–;ö·˜…3¯Ÿe´!,¼ÂÃSM&¡Í.v‰hSxz+—%#ñX~©Z›÷ÜÍcGöŸè¶[ñQE]ó¼ûo¯œ1}|(긢«.(5ξìPÃwG'Fù›‡ïíL$´J§¬÷Ù†‘紀ňNs˾cOß<(Âøk<~ç¥3ŸX3";I&Bøôìáy{oÙ C=6•ÏÀHŸák"{â Åç=´ä¯Ã®¸FöùõNþÕü/¶KœÛ¡l~Kœüã<þ¦ß™89ãΫÇ}3ß ¥o!±VAQ;Ë5’’ù¯(ï„ùTÑé[:gwH1VþlJ_GŽŠl]·ÙEoHäNM#>Á!jŽúÏsíAݨÿð·!3ˆìÖ+5þÉ»gö_½÷‡gNámm§¿_ƒ£S]‹÷}gTß™'?ß«vTtLb8é4,¾hÁŽšáYñ`6 Ïó‚Å.˜[«gŽ{ú)Ĺc³œ\0h—dºÈRMMñX•´Žëãa˜‘>Ã×F¿™×ç´·çn_;`ÊôP Èuj^ƒa$It&«¯o{ŸÛ’ÿw'äç7õ½¼¦ÇXðcdÉL“I”e‘èÚÙ•¾o‚áeÅð3ÝÑc>ë?¢®ÅÙÀüÆ€LÀ鼯ÜSÒHð$—0d¹Fŵ*f%G3~³gŽZ¹û3%èOv›C!9w´4«°EÑ+ýiq¶ÎïéÑ…ffÉHG"ß[Þà÷·«.1R§,5c¦ g2,ŽÜ;-¯9”˜` ;BE•Ǥ:ï©f¤ÏÀHŸáßÄëo+ÌY¯‰wØuÕà`Áb%v‡æk ;ÈU•îÝÃ%ÄMºòüR0mŒ…µ‹Š¢……¶n1‹²"¨ígM $¢ÇÚÄ€ …+õÄã±ògTúô€MÐÕÒ±‹­Þ®ãA%NKtˆm8e]㉑jƒruýYëK·ÍüÉÞŠA´´t§N±*j>IúÈ0삪pôFN §¹Už[Þšk޵ò~A‡b²Š²##¿>`Ø4#Rt>s‹3›x!66ˬ9%ÎÚ9”“´§yo­—õ[Fú ÿ&äÝËÓÆO"q©|Àϙ̼éT×ÊÙη644yKÆwêøYáGBqä6EŸêãb ¶‰YâCŠæ°™&%¿í,J_çÌDÏŒ7ùƒ¼jD ’’`ÊË'g{(#D¾Ç*èa¥OŸbmomùO½‘«éýMm¾¹-ÔPx¢# ĸÌg޽“ß\Q NçeP0AȈ‹¬BAE 7:¥#á¹~ÉVºôŽ¢ê«ØÜÒh÷ÓOO”7H²¹-¼U2*?&Q°Ù$‡ÝªÈšÒü!MV4UÕUã 4Fèå8»1׌p¼1ŸD‘X—„Ÿ‹=%‘-½ÀÀHŸák"t`ƒÖÚd4… ¸«ÚPãûü½ÀÆ/t_›h¶´ø¸‚Q×Îüãß4¿¶¹*;Î|ÕàØoä{5U{}Yi£Wµ˜ù‰<õs7µ…–ï¨î—tÖòŽ”7jÜ×TÑô˪Ý,µ¶´<ý½Œ3“¾®'º$‰×E‘'<¼¸éÕÏ‹ï¹ì”A/²¬®ØQ³-·)·Ü×âS@²¡`è×7œu`ŒÛa‘8½‡Sˆ1ÛxžÃ!Ÿn®xsYñœKO>¤0P–ï¬ið†zĘÓ,„µ{ë&öíYßÞLKr%yLˆ1E5âZms¨¹] *š@ˆÝ"xìb¬SŠw™b¢Ó*šŒ§£:ñ*(k5Mþ•{êJ*½ª¦Il9EFú _OãçîÖ}­–K¿§·5*•åÍËB›—ªõÕÄ ¾qx½Ü¬13^x—ãù—ÖUý¿…'bÜ&ÛœþSû}KøªŠº~_“(Š´;7šDñð_š“væÌ€ãò˼ëÞ>†h!@ñÅ|žÈÞ³õuU©nÔ4ú”z·kÚ_ä ùý÷Ï:…Ð뛾yÔ(ì”XI(ÒÎþÌ fQPeUâÔ¨ó2Úè¯Ò35^Ü6íOåo8Ô‚_e1ñÆãÌ9âQ c¥N·+r bP<^rP 7ˆBW—Ó4‡®»y^·èiN'Ç1Ög`¤Ïð/C)ÉkùÑÐþºožA0’D$31Ù ý¬r¡|À‘r黟™¬¶÷·×¼øÁñº²6I2V²)8Òðã—rÞúùq½ÿ3Þ·*t`cÔº™ØrÎ"áëi±‘¨­Ù¬gX‹ÆHTN È£²¢SΔÓ]ÕˆµÚ(GM ùgûÉm>¹¦I5^#ÆBvìá9yÀxˆŠ¢DÕ]ˆñôÄÎ`ƒ=—oÉsºœ&D ð=s]'×NíûâCS÷³õèÌFWö£þ{rê0Ïã7°qú ŒôþÅÒJeqÛŸ–÷4XÏìèdaƒrèJEÙoŠð%6wÌâ}¿{ûHuq«qÏ0<¸Râô²¼†û_ÉùëχÌrýû?B×xEáO‘Þ[Î6Nß, .³VݪD×st•«iôŸ!¤©š_x5jgÈgEéR â5¾~2U0ö‘–³’鉊¶6/L5¼?7äíÛÓ­ôÕt¢HßbÔ/=ƪµ *‚kçr<„ìÈã!ÕbL¶êšµ0^gø7Ànõ0œÊøuU­ÏÏ•÷Ѓ*d½®p‘¯5¨Ðcæ/IJÙ°·ü¾g6Ö€ñ9£B_¼ªBççÔÞ÷ÂþcåÿþÀAcÍ£A5Ò2}m²„m’‹p²½3¯s{޵œ¾sQ•·¤N'ŠÜµñ.J_Óºì@T5Æi;Ûo^½³FUtd'TT—èíÿUmFÔ¾)‰6Ÿ:ù‘ •Öø×ì«ûu9Uϯô²š>#}†¡¦ÒX×öÜÃò¶]zP6ú4«Úñâ¡ôCê 0âƒ%ñ陨yDߨÿaÕßfTETÅxò_ø,èjîÁš=¿7·¬õß&}b´v²ÙŽ×Ù'g ÊtjÁGŸA~Iººd[}}ó)™ ¬½¹´„ȪQ Š4‹èb4®ŸúÂ#/Yy¡ úÌ? ¢ÞÿцJ‚¨£lV& vÄÅ8¢²µË‘¨òŽÕb¾rl¬êk3b5¦®šÚÿøÁñMGº<Áøtø‚jn¹÷ÅEù¿z~ aK®10Ògø'ŒßÖÒöü£Á/·iþ®ƒ·¹È˨íÈÚ>Ÿ6øƒÅ=úô¥ûCó®œ÷Ólg‘æ÷òÆýĈ¼¥z_9º¯òÇÜ[\ãû÷Ê;äLJÿ+‘Æšx5JJËJc÷Ï‹N4´†4MÇ«®%øÚâ‚Å« U_P8Utë!Ùí4uQúÜ©2_ Êkv×ïÎo „N°ªé¥u¾¹oæÔ”5%£Îߌ0©z«¾Ýðè³"ê”~tYé'·O"¾NÑ£’'åȾªÇ_=2]Ey½ÏTÁþÏFX‘U¯_©lôo“.ê“`]֬ĆÒ±[°Õ?ÿÃ#•%ÍG¼Øv nóÎJo[Șñ >%Bçž¼À©°Kàá5ªþn¬òŸ³¯âgO®–>fH‚Ç)!œ(oûdUɦíЬ 'ŸYÈ+!ßEÙò´‰§,8Jt•Wt^ˆÞpJ†1 OÏoíó§TÙ]‰‘å ÷ì)ýU~Ëá‰cGÇŒL·»$‘¹Æ¯VTø‹Š¼¹ù ÅeÍ-žQçDªý Œô¾‚`þ¶??\½Z÷ú‰(EߘØJŒyL›Ú²?Z’>ò Ëg¦$Å/›wÿÌÙ/5…úò‚]~[j!õàîÒŸ=Ï¿:wtJü×àýŽúÆi¤ÿUQqÙºcä#/±:RôNº8âkõº8/zNf“$ÍÅ©|œOñtŽöAj£…¡S~¾NS£oî mrüÑ#5‡WÛ­’Å‚lAo÷ÉrHE«á§GväÔ–Ü—~û㮣hŒêStˆpÆ0ÐSJFüôº{_Øy¼ÑdqGNÄ,p¡–úêwnåÝ6Ñ* AMo ¨!¿!ûÞx~€Uç ~Ÿ7äkf½š•wÎÂørÈ÷ÊCK—rÍ^yÍ”ɇ‹ø‚ÎIª~´©-õí²'L:[ YéI‹ß½×®ãä¯éF9¾óe,Tvl)úåŸ÷¶´Ë_Ké%õÓ^_QÓî¾múô‘zÐ[Íëˆ QCD šl“T›¨Ú$Ýn9Å/ùs^ýíU nÉ(¶t´¬èŠb1›ºžpUç”—l4Ù* á`[S{{«W‹È“°è>ÆÝ-Ðtôo¿¿lpÿÌÓŠhá"~ôKéɬó‚72"³6ÔVnLT€IÃ- œfá5“,·7ùêêÚÚ¼‚/`ãd»¤[ mO8E´¦Ør¼{"ëØ ŒôÎÍ×^þÄ#…|X^ÓX¡r¥¹$ å"¼ü2þ»½Ùëyõ­þ—]ñÕí è›þù;?|ûÔö -üÒ}xUj¾*ª6—o\µó¶ŸVZÙò/þ°€·… ¶’P;}q!oøÕhÿªA&“ô×ï¿v¢l:‚ùŸ“ñòqÁð›`³Ü’7$µ|ùüûfMÝTßÄÉ^"ûè‹WSÇà#`ñ§0>Z¾v’)ËSÊÉí¢Î)×uÞàqã6¯.ä#í_ybÊÍ×O9-’qí-Í\¨ ¿¤ãÂߦ ¿ë2r1nççó¾ë:Ò´Gn«åÕÆÆ ‰Žï5OH7ˆáÍ‚À©O²yö¡¡{×þ¾_Ÿž¬o3°òÃP¾vu&è×Ü®WS^âŒY>Äxž“ªé=rýÿJS#†ö^üŸ|¾x  7YB@3&N5}úÅ—÷Ý}ù—&î‚‘ƒâªOÞgL†åh{œªhý²Ü_} Ýn}ïÿ[±zÛü…k­ih’ecŠ–˜hØ7é–›¯¾ô’Ñ’$*ŠúYž²òZž§³xKï¬S2Ê; ‰š¥sÚÐAÙÿòúŸ<ôêöƒ²`Jàˆ™>¬\×]õ)êi<=ü“¡ƒ{Ÿ©hÅMëÊêQ^&"¼@ñ½ZŸÌ3œ”Ëiûó3?úÁì}ºvùÚÜÂR™œ¢d#¼¨KLhªÒ”v¢·egXÆ_”qÅÌ«.7Ìå´³^ÍðÕ :ÐËpž" 56¶ƒ²Ãa‹õ¸„¯¹ÜÿÍw½½ig{Ô:<ÚýßO}ô—FD\Y³nïÁ#M~´œ–ì5<óò™ãFøŸˆß8QP’_P–¢²¹¥!±*%)¶WVJfFZVf²Ùlb—›)}† ³)%9á?(~©¼ª’è%8UèysùÌñxáMHVŒ13ßæ²V«eÈà~x±kÊÀHŸá[ƒjÜàåO>„ÇÒtõd’˜10Òg`8 ‡Ç E•w÷Ué30tc:l4º¼sêì3Fú ç“Ò×aõ'¥¾±j=Sú ŒôÎW¥¯:WÖ¸‘KØÃIé30œ¿J_9Ué«lˆ3#}†ó•ô5ãA†Q£w‹@0Òg`¤ÏÀp^r>d½ ÞçIǃwucyfEc–a`¤ÏÀpB’|:)Ò Ï‘Ž§­Cø‹âPf†n ¶ ÙÑÐЬ‡å.Ä$In·ƒ‡‘>#}Fú Œôé300000Òg`````¤ÏÀÀÀÀÀHŸ‘>#}Fú Œôé300000Òg`````¤ÏÀÀÀÀÀHŸ‘>#}Fú à™ Î 9¨5Öt¼ýò 9g{w?!‘]S†³!ðÎSmEyêˆo/vlÛ¨'Z²³“Íúá­ü¨iD2w»3bå†S ÕU¨¹»¥ רÅÇüo<ÈÇÇzu»+5Æ4jhõ‘šÕk[®éQê®Ï]œ~÷õü˜)}†o'Nœ?~¼(Šûöí+..¾öÚk³Ì7©îßÿƒš»'´és®­ž8lÄa÷$%pI)º`ޝ/¼]ß%×J•Šó·+‰uøÑY³v¯³ž|òIvÎqȲ,‚¢(Û¶m³Ûí[¶lñûýÆ ËËË[»v-òõÝ»w[­VÇÃlõŸ:ÈZùÝÛÂy‰ÕDÜ1|Œ›ÄÆò±qòšõ¡=ûÉbÔHéijÍ:±4ÁÉ“¬ÁÝèYy‡á\ÇÑ£G÷ïß?xðàúúz|—Ëe³Ù îccc!ö7nÜh6›}>_yyùK/½êg;šÎ•úÔ »@ξOhéÛò¶åœÍ®•pšJlVïáããø‰|rв}·|ð1wñ §Ûy9¨‹¯ùgÜùÂ#±±öîb 6z§«žZºté<ðÖ[oišÆ Âp.   T^RRƇÌ7™L‹ÔðàÁ­[·â¿„$ï½÷^ss3³Å%þŸìi9^åÅû—òÛ?, ¾¸²~Ô:ƒw«åùZC¥V–ÏÁ÷E‘sØ·Ók7ÇX¤»IÎÁã:3GVµf¿|¢Ïožß’ÕîbVÞ9‰œœœ?þñkÖ¬Û?~ÇŒÃÌÂð¿zàž={@åµµµ`yH{kù]týúõ$ äëØ!33÷îÝ;vìØ YÑëá„ó©ú£û[œÙt¸6_ácEáâD뛲)ÊÙü»cí.]à1z°¦ìßHeBúœ–––‘‘Áˆá¿I’JJJœN'e|ôO³Ù\^^~èС;wBš@”D@UUv€ˆ™:u*Ï_pÅÛò;…¾*¿òEyÀëWSÌ|¼™O’ød+Ÿb—U>¯ J‰ð„óõu‡ò«¼#Çe8x•ûÓƒÅÇ Æx^Šq´ªæŸî½ßŸb•Ô˭׸î†Qv3µb»Â `|â´sN‡ãò‡„O9æmSo¼¶{ ã¹Ð‡l®ZµêÍ7ß„“̘1ãÖ[o…†ÂÆaÆÝrË-óçχ/½õÖ[©©©ÙÙÙŒƒþkðù|•••eeeàqK þööö?þ8''i(âA=úöí+Š"z©9 l:thzz:”þ…Æø'¼ŠGâ ½ 1„:çâ¹x‰¸Eâ–x—‰$ZE0þ»%> i ]!V“rÇÔÝVÓ­‡B«F›Ä{žÞúÚÖŒ£‰Õl±KïM;HtðÁ‹G§=þÈÔÄã>­žSæÝ.3e|§èq©²zß²Œþt©¾»ØêÂ%}xÎo¼Eß«W¯9sæ l º‚§ÁßRRRfÏžŸŸŸ›› Gzíµ×žzê)xÝylÖÖÖ'NôìÙ3!!¡­­míÚµ`)S¦¸ÝnFÁÿ}Àþõõõö0Àæø …>üðÃcÇŽâÑ'ûõë—œœ ¥O¹± &&Á‡Ï›7ïŽ;î¸@Ìõ~±ÿÿå¶ÙEâSô0©‘8xÂŒW²M\SšWê³8¿ó ‹sê„4®9ôþ éûSbž¨ˆ‚À;ì!bÚÞ˜(pêÐA‰Ï?3Ëj•è1rÞ~N Æw9‰ÓA\.^QûÅùKšÕË/ë6uà ”ôApúÓŸ~øÃ^wÝuØräÈ‘ŠŠ °^VVV0„ªzàyä8>ýÛßþöàƒž¯ER]×W®\‰€§ªê 7Ü-‰7EEE›6mzöÙgkkkÁ8`ø„¦iРïeç´´4„^«Õ OKùëÖ­ãƒÜÁé÷ßÿˆ#°ÛñãÇ7oÞLe>HiAss3’×êêjè• ‡ôBš¦ëmr¸/sœ[àbEkâíR‚KÚã×çUL„2>¡ÞÙ“k[øÕ¥Ädû±Ê¥2«™sØx›I"ªªswÿ¢ãëõòŽ•¼Ëf|§ñÆé²¤%<–^k[®?ôФîb® ±¦¿zõj0>Rcèw8OAAØ ÛGŽ ²C<ÑÇÆÆÂ‘²³³wîÜ õZZZ p>Ù¼€¿` ä4 ”ÄÄD°?NDãñx@4Ø¡¬¬ íÞ½qèСŒ»¿ËïÚµ ýJ}iýúõˆ¦{öì6lØ?=*ÇQ`|‡Ã¬kùòåMMM¸.¿ûÝï óén%%%”ññ—²®®  2dÚ´iˆ©S¬ÂÂR¿f|3!©I³Iª(È«ÛôeÁÖ#ÕªI\VcdOHxœ½®c{uãw…]ɤEãyNù'qǘ’âì²ocUâC÷³Ù Ò×* oý†“½œÛEŸõ’·¯níuþ~K@GHa¤ÎA–å×^{mëÖ­?ùÉOfÏž ·„+"7nrd8$è…ݪªªào\Øî‡-4w>?L2‚H§———#ËÅãÜÝn7hÜAkà¯×‹7Ðï¿ÿ~FFFïÞ½›ÿ‹€m—-[Â¼Ðø lô"ô·ÖÖVX #!!áô‘rA…€‘pQ(é#ÇÂÅ‚öG§?~|$¨ ‘HMŸþÅ5JJJŠÿÍo~s!ùH‹²ª:øq©¿´]¥\ž(’T»©²É·kþöê%ûÚ— ¹bN‰ê°r©±ÄàýˆÞçO´Aéë3¦*fh9¢ËÆÅ¸…·ž˜Ô;.4°j§Û&8š C›‡>}…S|Œïvò1nS¬cýšº}ž¶¾:AD—ÃtÙ´îáâå„`.h¨^xRTTåÕ¿Ð[@ýðÌ;v¤¦¦Ây|>Ÿ¢(W_}uaa!\ `íÚµ)))ôfo·Ïˆ\.ؤººš2>Èþ…Ò1ãôñžÖ>ûì3Êðá០µµµÛ·oGúÛ~ùå—0&{C­ ;_rÉ%tÁ|´téÒû￟ÞLŠÆ`pHoá¢gâX$¦8ꢋ.Šì¶qãFì¡{z¥¡NÏÐ,k?ÞÝä•é4+ãþ¬±¦5÷· ¦Š³EÒ)>Î6(;Τ´­ )!7&^u”wt]Óí“=É5#¡ÄÚJB;o·DY‡ÃàðÅ–mÕ‹^]à$‰wwn;4¾ËÅÅÄpn§Ÿ4ê’iÔàø«fõ›tØ2\TîöûýH‡ Mß¿°9”>¢Â!C Öêêê†w‚›!¹FS¿^¯wàÀ'Â莼~§ÚVl@”ñ#Ã?ý@Ež>Ä[¡ÔÓ½ð =öØ8÷çŒ@§‚0GGB¯kll䓪(ãÛÂ@„¤YG&ÐRôêÕ Ÿâð·ÞzëÑG|„Fz‘ZÑRö¡á––z"\a|º0z)’þ3Ï<Ó³gÏ ÁòàñyE¾2Ÿ ƯNJÄmj›Ú9_HÕ¸[¿3äòËúFvÎk–냪H:ßJHºÄ§KºõªAG•Pr¦»'W/9„8§à°†ŠK9žI$ç|ÜNÁCÜ1Jkûãkÿ¬®·À©6«$ðJMm[7ãóãòoß¾}Á‚ðŸ)S¦ÜqÇÐéTû€ªà|ðiÒ¤I`ÿ””¼omm…®G" š»ôÒK‘hƒÎFŒA§;6 ‡S7ëÛ·/TöG¢ðÎ;ïà=Úüè£zè!ZEíFˆ‡ŠwG4>U÷Hƒpú–øôÝðéé˯‚È’““¡LѾAii)úOä¿t9ªña10>,F?Úh4µBf¹gÏXþã?¾ùæ›#;ì߿ٲeè™S§NÅe‚ò€Ì§K­EÓ=¦ -²cÇèzè\ʶ¶¶ Áì`ü;w·ä·„¸ðb;nĉÄ#r.·MxÑnºîäÀyd/æ·óŒo!\¦‰dZùÞajïô¿xåïö…|Ö2Ó®µ’Pß¿®†³Z,n³ærÈh|— é‚äS{´.ƒº÷8…»o9kFŸšZï°ÁÉŒôÿ{€l?|øðÚµkáW—_~ù5×\Ó¥ì/‚ó¬\¹röìÙÙÙÙðFÐ7ü 2 Œ‡Af”y4$<< Û¡úiAÔŠÏË˃ßfffʲŒFxàZ–ENðãw›‡æ€2p¾Ðrøñ´ðE5>gëÖ­`%ð]¬@ºý½Î(Þƒb)²(ü—®À€¾Â¥k[ž”ñiœ^RR‚.Dm‰£‘éT08쉮µdÉ’Y³fÑ©pèx…C§‰@‹ ªô)è=^4‚ïýðÃñ-Ø­á/":óyovŸ¢—Tµéf“Îè»x‘Ĉ¼pc²=…÷uìÍKMë˜WØÒ~{¸m³,pDãth|0~/«g“v•µ.ßV\±)÷¡Fß› */êóóæÉւ׆(~Áº5˜œÐ®÷M¶ 1¶…KÛ6”º¿-¯¤\ñ‰£†ö˜sÇh4Þ3µûÍ^ìf¤ry‡QVV†Y 5„ì˜Þ ƒ_Á‹ îiÞ…´÷…^¡ƒïèP |„,855Õï÷Ã!Apàq4‹,¡¨¨hãÆØB8ß0¾! ‘ …‹/‚Ƨ+0_|ñÅÝbè:¨gõêÕ8eZ ˆ0>ÎŒÿÙgŸá#ðN Ÿfeea; xƪ=R²bÅ ˜î«çþàJ¡M\ó›z`4Èúƒ}h=6ß´izd8¬Ý£GÈ NƧoFŽYQQ,3zò3RÒýèGè~ëÖ­£ÊÆEgá"ÃW#£E×¥«5\{íµÉØyܸqB¬M°ðo 0¿øÅñ½CûÅJ$Väݱ‹¤·• ½näcMa›;Öv¸1ôYy "  á;·Ö°ÆÏ² .Óö ;_^cnk7ñ¼OÚìIƒï¿×“Ve-\¯×~ùiìžkÅ{ºm^ßòqYÆþæxÛv‹,X±.6ÆÒ}M×=¢‚¹|ùòõë×ËèpÓðáÃÑ¿©¨ÔÕÕÁýà tl­ZБð8¤Óí·ßâFTÀvˆ_Èyümâ¨×íÛ·ãÀ¾}ûæää´··ƒÐÑ,‚ABB6â=ä-TتU«^yå4Û»wï矞j±s¼è ! P²ˆh|¶Í*¤y,ï®É/úÛ‡Ã4brŸIƒ¿{ÃàçNrêC¤¥5½,Ïß«ßF¦ÎÛ]SöÒÛ=z¹¾¼äjKeã²ï÷u™×¬Í1"%1¡»>¢²{ŒÞé ÷CzOœ8ñ¶Ûn»óÎ;oºé&ˆ#Ð1´*]A.„ÿÂ+ÀG lü¥t ¯ƒOÂsðé_ÿúWªÈè˜tlĈØÜ7lØ0|O—a#h áaÔ¨Qh_ý¡[Ñ,hÁ ±±?ìÜûøå üfÄ9œr¤>PRRf‡)@RsæÌùÅ/~¤ü«âiéÂÀXéСC”ý¯ºêªÈT5ÄKpŒC×õ=zô()l饗èТ&"ëys3€f{`|œ5¬Jë9¬íÈDiˆ…fŸ={6:- ²|¹KËúØ‚ü¤ÿå—_ҡÑ„×W -ãºÔÔÔà@tWØ_½råJägèŸõõõˆ¸ýúõCÞy¡1þ_Šüókµ³,’8“± fš]<äU64„̺N4ëê¤OïÜ‚ñ3,|†]ÈŽ1õwŠ}$®Í©1e'Y®uõˆGZÕEEí=4-ÝmuôÊ—`M5é§4?&;¿ÿS¬Moò&WÖ œÔ;;IW÷µ[·² ÷زe dÎ7ÞZMÃ… 9!cÁ/qqq z¸Õ\\ÐVæø/œŠ½]úž0a²KII©ªª…AgåççÓÁûÐhÈÍ'Ož gáQh–AÐ>’ x)}Ö HÿŒó*Ï)@ƒŸ8qoðã#4a ü~0äùÃ?½?d;茨é_:³4tÇw )lJ1!@"gÂvh楆Â!N”——ÃtÛ¶msý+‹t  ? Aç¡U/:V'&&&EŸÁécûu×]÷ÿ÷è´èŸè$讈yÔøô/A€\¼x1¬îЉiû80rÐììlôCìN~‡Æ?pàv†‘}ôÑk®¹—`æÌ™ØóB#ýÍ5ÁÃù þÒú˜k/—)ÎÌÇY…ª‚µAMìÆ?ÑŒßÛ)™mÒ¾ò¶Ïm;TU°)/8sxhú´2¸½&˜Ìsˆ‰f>ä÷´ uŠöbA{»I´:ÂÿåÑCKö›Ò¿§§{Wî¤o™7oÍ‚GŽ ~ãÃèÐ4hLhؤ¤$¨$P‘š‹J*Zßèä,x Ȉª{8*háTÇŽƒgddlذN…è%|º{÷n0œª ^ È3 “i¹ÿòË/?gMG'ëCE‚¤`“è!ùøå8)¼ÿõ¯=ߊÞÚEèžö„‘±ÿŒ3@O°Ø;Cûcg|Jc@ÇјA¥=¾¡tùòåcÆŒ9?–²ÀyáLÑÐåèXZv‡é¨¢Ÿ6mÚ}÷Ý¹Ý QCÑ,3Âû¸ ùHª°[¯^½.ºè"tE0 q°ÚDLE³èêhß•——‡K9xðàôôt¼Ç!¼â-ûNä~ºOî“2.ÓÝÓ*4(úÂÊ€@Œz½J”ñ{…«:½¢±ÃÇûü}óæ]¥;‹Mp1}9—t=E$IFº ÐŒ¡UÓŸ>î­ð«æŽ†t-ÙÞkiÀÔ×. )Fúß"ÀM?þ8ˆþž{îY³f 2\¸´´<èÞ‡{€ AýØNkïp3¸½u dffÂO@ܯ¾ú*|â ûÀoqÝáWp¿œœˆz ŸÏ‡øßCSØ ÍâK±rj´åEoÙø ^ñ-7ß|ó¹\Ð_¿~=b­|ñ#2T_ˇL éÔ矎@ÞÝŒ.r0>}–!z 8hÐ è ±È‡è´èÚy",^ C¡MtE×ÈÝG±¬ºqãÆªª*š*ó¶Âšw7|2®ï‘Kûm>nÖôéÃz¹ùµ ]mÓ#p‰qØM¹M¾Í»KZÕ1.Kzœ±4[³ë‘¢žž•¨V7øU R¦[ŽJèåtè#GŽ@€C*öïßo@+èý„3€\Àïð(ü—„ «"CQÂg ˜èHžHý„…7ð–yóæ!§†/­[·ŽGW”׃֑Dƒ÷Eð]´¬Á…,â#%¸Œð¿üå/'L˜pŽÑ1!!!²p#]³7??b<66¶= ;ÐbNô‚<ô/òœ>r)ìF£•œè¢?vC›08"%ÍŸºü :úAäUVVں袋ºï`t!ºt]ff&;«"ADª««£wP`öÝ»w#}ħь¿ØÛ‘<¡"+Å_º¼Z—9·´ˆ66è2jÑ¿>e… ßxGÀ¸`ÂëÛÃvÓuý³Ê7öQŽoâúe/ZúfüŠÄ¦ÚüÞã‹T¼t^Ûî fHl®n©JŒ ¤'Y~ÙX¿Ù@&¸Á$îÞ”—ûþ–Æ­y¡#e¦CÅz‹_ëL:h½³Â£êZj?ºwVï„YÙnFúß EW¯^îž1cFFFºxmm-¼®ÖHOOƒàð] N‚é˜}P•Ò ÊP8¹”/Ô+² |ÿÁž`@ø*aô¨Žé ' 5úì‘K.¹dîܹð´sÿïß¿œF Z›ÞtÅ)ÓITZFFõD#2ó“.`aØ6Rpˆ0>½aK@›”›Î8ÿ€………¸9Ó§Oï¾w éX&Ä?œLJWÓ„Ñèt*X Œö§’¼K¥3|häLh†^Z'²p&Ú¤Ë}wÉœ"q–D&Õ‚¿è“âBx¡'ˆB°½ßÖ? œöÞÕ»tÈ-CƒemŸ¬m½ìø?,=¦$ß~ÏŒï\7(/=ù`VZ½ËáOVä9’"—Ýt`eŽï‹]&Eå%‘—„þ}â‡9øÓÖêqUTxŒE~x>.ÞY|¨¢e{ÞÅã2»£hé¤~> Ú³Ã= N­@(]|ñÅðð;>NA×§CÐÞÃ3á“tP<‡ £X²d (›Î’G³p3ÊøØV®Ñ8ýHï¡QŸ÷õêÕ ÒìÞ{ïí.Ï…ݲe˶mÛ@F°Mz?ÑÉ ‘Á9]Ÿ’‚+âòªíÛ·# âÜaŠéSÆG³Ð³_~ù%¾âö¤wÏÈûôÛÙ³gOš4©ûR Mh Ïia‡WAÃÑÄÝEàÓíôÖ7 ºš¢wP¢¢Qv†m‘Y"ŽžmÑ ìƒþß. DÌD÷ºüøåà¢×x‡;´úý@s-—0a€ž44CMÈê¬¹êØ‚)\¾$pŸúG=ôàTßcr¸Ö¯„'mnž¤;LåEuÍoÛkø‹ÿB„Ž1ÒNõT.¢éß¿ff&ü Ì=!6ÐÛ†ôŽ.%>ÈX:MÎÀ\-ðºéÓ§O›6-++ëž{î)++£ú”.\ƒc°Ž¥£ªÏ}ëe` œÎù ÕÕÕáÜOç&X§‰“Ñ/\¸°¦¦Q¤v¡Dß¶Å>åååŸ|ò öÑ`|‚/š8q" ½\çú §ó>~b ò­)S¦€Îº#á ÃЙè-ôÆþýû©âî²ÖB¤¤ƒ> ‹Ñ‡tbO˜ ý6²­¤Aþctxdcˆ£èÛ´£žñ‘mt>pJJ $v»@žc¬QöoÒJó”ƒ[8U!3‰q·›ï'§hå•¡¥+8UÕxAåx¸ÁslPÓöã­¦ƒ ÿ^j—ôÍ8ëi6)”®?JZ|ii1¯<edªmHÕŸ?ÖÖ¢Óz; AÉ6‘ž‰voŒ#MПœ;ę´îxSª{L1€GMž<9“›› ¦…½ýöÛðH!|DI½1 Â3-- JÁÓŠ‹‹A.p ºÚ„ Èèsé@úð:ºTá°aæNE&hÁ§o¾ù&¾!'RøÆ±ÔÍÀøIIIÝÉOT罿hÑ"œ;xŠŽÜ§÷cés?誢؎°JGéÀÂtþ3NŸ®bY¯ v†ñapâßœ9sÐ,öÇ×!/]º4rS$úR¶µµá‹ðæ½÷Þ›;wnwä:,jôèÑ ~¼AÃVtmêèÑ®ôþ6LD™a±gϤª49 ™Vda˜ÝŒ©Î#‚fggÃì¸"¸ÑKŸR` ~.äzø¹qV÷•ƒË¶]<¦»>´ ÛÌ+»øâ‹¡}À, ¬U«VÝpà  ÝÇ<11qìØ±p‰~ýúÑáá@)szzzuuõÑ£GÁéø/Ì–oÐgÀnݺÞº§¤OÇ)‚¡ÆŸD;Ï>û,œ:7RŠ¥… ;î¸cÙ²e¿úÕ¯º×• ¾ôÒK Øê²Ë.¹ƒƒ`%Xò§†^yåüwÖ¬Y`sP#ÐTm~~>­íÐû·´°óÂ,08¬ýÜsÏEßÖŽp•Bt|'µ0š‚yi<€8íÖüCëïÐûÈŠÀÎè9tè=]x‡®ˆ ©Ž3¢›ÑÕ’iý‡ÆÎèÊhIŸf¥PwÞyç˜1cè l\ ÓË;@ee%â(úö;#ýÏÇ8Ÿ½Ó.VÕõÛËê÷‡¶©‡õg÷Žg¤ÿ-îª_CìðÁuuu#FŒ€ÎÚ½{7åM7ÝW¡OÅÝ‚ßÁõ}ûöEö]SSOÇqÒ³PghÎu¤ã.Àt {ì9dÈ÷ßr‰üNKe>Ù‹lIÃÁƒÿþ÷¿ÿð‡?ì^”ôÚk¯½ûî»8}ð ˜÷£>‚¡@70ì€óËWUU!U¢„r=]…?¢ô±¥¢¢q”Îy~ê©§º dB#4­ ¯# M]?¤j$‚R ý¦¦&Hó0ð>®àùÌøš¦·ÔëšÚ¡áwØ,fnËnAAì‰6»[šqc|îµîüðÃÉ“'ƒ›À>Ð;`“ÌÌL·Û 7ûòË/Áe ïpáÑÁ©à'Ø‚üÇ‚A@ ~úìéþýû¿úê«È&L˜§¥ÓM©ÆÇ{¤ , +õGVQï^À™>ðÀ04>ìF >|8DýŸÿügÊõ0Ý“O> #°á4aF° ŒLÅ¢lNe¾÷½ïE– £ +0ÃbTÝG@yŠ>Ý ÙRdD÷¬÷òË/ÏŸ?ä ÁA\ƒ…2‡ !ÁþsâÄ úÔ6ök#«bDòH:z˜ÎÔýå/ÙåŽ>¥ãe£A/ ò]¤qØÿúë¯?ŸŸa }¯þR+:¢ý´rÃð-›û’^/¢ò‚D´jEx=ÔÇZ1ËœãÓ$#BÚ,ªÃáñ8oØPëZãqÆ=&\ÛqK¼Ç,|Y{%Íùy;›ÔÁ¨àëtf’Èg[ø4‹ér÷–Ô9$!5Ý3bXÊw¢žÌÅHÿÛ\{É’%èúëÖ­»âŠ+@îW^yå§Ÿ~ þ—ÁÍ îÁ#Pú t¨0ˆw(ø÷fGÊLêàS¸+}¬ ¶àS¸+>¥Ãé "«ŒE¦ËÓQüƒ†ku¡¹nW”˜4i2§U«Våççÿô§?ÑÓqœ>ŸoæÌ™tÈìÙ³?ûì3jú@ÝȸlÁµ µþiÓ¦E7RÃÕýÁò‘úeJR؈¯ƒ!vßÑ;ÑÏþìg?ƒº‡x¹ãqîÐ [¶l¡k*Àbè®?øÁfÍšµbÅ  A7Rý7wF£·@`Ò.Ϲ¥É+-BFŒIßÀ/Ð,|øá‡Ï{ž ºÏ«7Vu0¾ÎI²ºLË=¯••DÝBäïÏ~å¬þÉ=MëyeñaÊøÄå .á…ÏO$=7~N¼ËžH”‰sŒÏË„ÛÝ,›T7²ÒÑ…;ª:ã÷´ ½œbºSîȽyLë{Þzõº¸X[÷5c7[+žÒ§µfäÔ=öØM7Ý´aÆիWƒý¡ÍÁûûà”K/½”º ‰d^D‹ P^`¥£iËÊÊ@ŽPú/¾øbô5Ý W]uÕ˜1cÐ!AßH€`ÀO>ùÂ݆vHtÑ#F€¾©A¢ŸJÃ322èm.O¿Âþˆ ÷ÓŸj|rˆE‹!ý=XOÜq¶‡ÿÖþä-º·üÌÛ­Š }\ž©Á,*¿{læ´K³;®…ÔêÕyb7Ÿs:M±®†ò¶gl¹È™PPYï¶öÍŒq›ø‹pÀ«V5«a³ãsÆÏ° ésak¨.¨¸ƒjuNy²Óäè΋ésÝh=} :$*žf»HŸÓÒÒè IPùôéÓá0tŠcqq1Ô=8=`À„ì¿xñâ÷Þ{oçÎø/¸†>†”:Ø@F´ÜQ^tz}]]Ü žLPDl€L>/Ÿ Ni=ò_:ìdÙ²e^¯·W¯^ÑëÆÐEŠ`^úœZ{{;’†7"¯:½Dß:t¹ŸÇpì 7Ü@‚óèBÈiqVB½,ŒÈT>zOˆ ˆt6jUtf|ZYYyË-·Dæ*ã¿H h„ˆÍ· VLÀ°è½xœµOŸ>çm=¿¶,ôù_Ô’cœ¦‹Iˆuù8Ë;ù™mªô³»/ºþÚÎz‹¦ú?~…“Û‰ÛIœNÞå$.·-5¾ŸZÌ—yµ…µÞac²zYøx«¸°Ò_8¹þ~Xã“ä0ã§[…8»´ò@Õê¿lܵ,gËú<ýxes[(©‡c@¿n¼Ll÷[úòË/‡Øk@LÍŸ?ÿ™gž×Cé9rdÇŽ_|1Hì÷”PŽ;öñÇçææBgA§S–ß¿?Z˜8q"-¿ÂgèõÈjÄšzƒÈà¥ø/v†¤š1cÆyÉøgVá5ææÎ»bÅ ºÖB„n`(Ä?l²uëÖ={ö (ŠBŸÈE ׉Tu9"ÏïF~]|Þ?D— îŒþï%—\‚h ‘žžý°\Úë?Á8ÔPˆ£4D/‘ùØ¿¦¦fóæÍtÝ$Z7;¿'gé¯ÜÏ×Uqºˆ’³Ù4»Ãi‘Ò-­ÅzâÌé}O¦›ëj5ÅÆÈ}'è¤ïØî¬jäLâ´‹RT=AUµIã3»w‡ìv¿œyøî»ïâ=rçñãÇßu×]?üðÛo¿=räHÐ}ïÞ½©b…~_¸p!\Dð¹ŠPFˆˆˆàúG}”>ÜC‡«Ó:H¨SSS¡Ô\Ãõ«_]€O¤Ã¹ÃÈ‘Å"«5Ð'dz`Z†¦ƒ#%hƧccc¡ËËË“““Ÿ~úiúXî‚ÄÌ™3érO‘¡;ô tò3xl^QQAµ<-u©êЉå+tJ9šêÆØ±cÏc»mйŒ+^?ÖVÁY-œÃF¬V>5ñç—´´nkŽq}Ooª ­[(où´“ñ]¼Û)ÆÇÖ5½÷vów^[ ý£Ã–©C—¬Þýù~óˆÌÀ€t^W8“/„äddÙÄÊ_Ð&LžØPëçCŠh3ÍýÅäë®pž¨îø£¯¸âŠeË–ÕÕÕáý‚ ÆŒ3`À8ôþâÅ‹¡å¹ðä Ð=äüСCŸ}öYšóBòc~FFÆO<é*›SÔåBbß~ûíPXh ¾„ÀSà;:þçB¢&Œàr¹èÚÈ‘24¸‰>i=2(ót–Ö¤ô/lˆ´é–[n¡³¿0Ó!%E7£öŒÔÁÝèÒ‘éZÔtg¤ûȸHtTÈ—‡zèBP$Sqߦ¿8øœ75»•Øí¼Ã®ºb{{j_‰[ ½r( ŠJe1 LbÜÄé04¾ÛIb<‚‰ÿÇZåÕ‚A‹’'Ì? Uxéã|qaÀãà†õÒ}*¿#OÓ¹˜¡éƒ<¶&¿|ø¯ëxóÝ1¡±´ÑâÚì¦Ëgœ?E³nIú ¡›nºé7ÞÀû¢¢"dÊ3fÌøÁ~°{÷îE‹¥¤¤€Çñ¾GsçÎ8q"~üÖG}´mÛ6‡Ãqï½÷"BФ;>>þ·¿ýmaaáÎ;áŠNHº÷îÝ‹À¿JJJB±téRúH¼ ¡<Ïš5kZ[[AúW_}5D:pÔØh RmNôÑ E§&åääÐ1¯›7o¦©Ã5×\s Öü÷4Mƒq`CôÕÈ Á`ÐëõÒq®g$úH¡ ¦£•4È|lÁ5º@ž¥çﻤäÃÝ¢9Äaç EïÏ-2 š^tD橹P÷œÓaÔñÝ.#ÄÇqñ±Ó'ø—T¶ÞûÓ©—Mëë1Æ)¼ôÔŒ —öZÒ¤¯CXýò¨´æ€ ë® ©_BeNž©®UH¿²JMQ«5-6ö¼ºíÔ]Ÿô–_¹r%ï?üðà &@‚÷_|ñÅçž{.66vΜ9Hþ?{gUu†ñ%³ ’D,D”¨Øà4Ic,$Å“H”’à 0v¨NüË):ÓbëGÿèÀ8í ‡qJT2d’Gm¶P* ¢Kù„ð! 1A>$P$}²žÞ¹»„͇¸{÷ù ÃÜ=÷îÉÞ÷œó¼ï{î½çBÙ‘&×ÖÖú|> ­yøá‡±×VÛX?pNÛ8ø±Ç‹Ú°4==½±±±¢¢îpúô霃ÐÀ p2:hhoä )0²%^Ë…€À½óÎ;EEEŽyCzOAØÑÒÒòÚk¯!ËDN™ŸŸÏ4ˆ™+ý¨ çm†åÄ=8N8`®ŽïVWW?úè£ÎO’öl?¶£=nðp$IPö””k§Z;ÏëŒõßð¾?ÆïºG3%%ÎãþòôÙî„Ø—Ç=èç3ïô þÿ ,szG®ËµóЙ•'[%ÆçÿlüœŸÜºìOÿøº©uPìÀôô¡¿-ïZ67{ìØÑ)ññƒcÆH=tthñŠ+°ÑòöÛoçåå555Aý!î|v!°ÊÌÌ,))=zt7uNöÃí'žxÂ%ü!!Ð999555'NäÄo¾ä•@¹gÏí;v Bô ¹¿ÝOss3ä)¢Ÿrè#0Ë#<2lذªª*¾á€å\©ÍøQ[ÚDÅGOÆ·šp5 s·/çóÀ/ÿÚ8é¿[ö¬½}orêNç«mt½T f@Lâ-®Á~ÅOJŠáÊkc|5Ç^ùÐ3ä–#G.&}Þ·¾zoÙ"{J4ýΔWV­«Úó‹üôÛF$:s¶©½Ý÷׋¿9òþrÚ ŽÜŸ>mÚ4ÄžØ~óÍ7û'''/Z´Èå¿ü¸aÃBkÆ?oÞ<)ïKp ™NMMEŒùÞ{ïÝsÏ=C† 1ϯñÖrÊ|-Ä‹¯‡c¸rå T {Ï>þøãh ÖÖV„¨¾—X¼xñþýû;::0 òK–,Áv]]ÂR”x½Þ… Μ93Ê%¦_ò*¨üK/½´qãÆöööO?ýtÁ‚ðp®°3Ô{¹HÑ®]»Þzë-8Z$[h põêÕ &<û쳬 R%{š,êÔ©S0—Ïçƒú#‚³äGè±\Ïù<ù”)SÆwþüy”cï]wÝõÔSOEî{Çú4å8"fß¶Kþ0ùþ¤£‹¼—¯%%rìtÇ}éñÄ&'5¼pþJÇ} níø*æêÀØÌ»½«^(œê}b³gÇ?‡w¼ˆþõ|qDEE¶7mÚ„èrË–-|G.bŸ‡z(ºÞ)ñ•™8ÚÐÐðÉ'Ÿœ8qâòåËØà-°²a “&MB2 ч_„²ómYï¿ÿ~}}=6rrrнàWWW£ÞtöìÙØ…ä ‘>š#:¿‹¼g;§m8:öò™AÉvI]sàGS=§57Á5ðÚ ›½»/x—?XÆ}-.~ܘ”Ð?Z¢H?Œ„;wîÞ½´~ýz.r‚´7²»rss§M›öÆo@töíÛ‡kÇŽ| ¤̘1ÍÍÍPyˆTìÞ{ïE¦õòË/3å’õ‚‚|1þÚµkÔ766VUU1œGò„]<|ø0¼,œ(t¿¥¥ÅõíƒoÑl·ì'ÿýþ ŸïÙø¯Ø;‡í¹4|tƸÏOîú yÀÁ+ÞA ñw/ùMÚùŽ/ª÷Θ~»º™A_dY`¼øâ‹ÇÏÌÌ„Üká&°}ûöÕ«W#¨‡ö¥™V®\Ù£W¢9Ð(håË—‡¹Ýx‚^¯÷é§Ÿæ9²3`ìµÝ%DZ;vˆÁçó•——;àm0;Œo-é¾ püÒ¥Kû½?´µµ¡±"Ú’‘ñ\ŸÏO¿Œ]Û¶m‹6ߎ`ŸFàK%!: |BQg¨'Ý7ú…­[·¢QJKK׬YŠâ÷hYDåQøþ[‡ï/¦Dºâ»Â|8jÄ5ôð ü­ÁQVVŸB uPaa!‡%|2ÉZ•-êÇâÁø"Bp½B[èÇ×yÅìi¨{óáZíÖdv€a©bå8/IÁ°0/£ZHvñuð4¸‰¹ÌY£™v1á|zz:ö¢0??Ÿm‰oBGƒðãÑ­åÈX‚l} ç˃m…Ô šmA‡MFÅî ðE|…&2­ƒclÌ–L& ÛlŽVÀ^¼A›rÕªUVqì{úò]cK¸ÙÍ`g·ÛM³ãda4öϲ²2XfG ¬‡ƒaœ’’üÏUÁõ¢¦C Ê©3´ƒ1lss3Ý3+A…PØÅ¦§¶°B[ Jô{ã®Í6SZ˜­‹àm€þ Ë:-J‘â‘h´ƒ5 6U¡ðH꿈ª0ÀÐZì¶BS J¨øøífä„?øÁ85†ŠØÆ)ÀÙÙÙ”{Û8Ç(B¹±'{9 ˆð]X楉`:ÑY~h"†]h:Ž"|D øøÜsÏQ+#HñÑÍpšè [å8ÆÚ±­±K ƒ76·Î‘6%µ N?]"Ìß–îÀtž”~ÇX¯®®Žrÿ™ÑÒ’ØÀé³ÕÃwÍÚPð¬0/ŽA=¦ÒÚØkÓ¶šùUœFƒ%QC¿Ï,E‹è[Ý;/\+CocíÁ+c/†Ù §;QZ…ñÇkCï7‚­Í϶çX¥ó@ †M–Ÿ07 4€ §sÄy™~oQ؋ӴÆ)\óF`ähLl"_ZÏ–SãxºΠuPO7‚ž ¬÷CKâL˜â\ †&A ñdQá6?¦Æ4*Ü#-66·…MMé˜Éôm¯W×’ m{Ùc™Ñ²ÄôR|‘“t$ŒTüáða°Ø DOFµð4è”&F<ÖÄZ¢ßûéîa†Kµb 4±bUÌטáöôÇpºƒ >¯ìa´ãï¢6„¡_[û~'~-º&NÝÚf(^¤B@Ô‹.˰õ£NëÕ6“WE:è?èZPœŽ‘fôB)`´¾\A…Ì)QO7× Bœ1Ýæô%f2³¤¤$"â?ÛôN7É™-ÅLßÐÚÐÀebÑ0öEYÛ+Ð7„'‘´@+­ßÐÐÀ6ãÔ$û+Ú€á$ 鮃ÛfŠÊÊÊø ´(Ý Šͨ!h¡µßp*œ}Ó;¶yÞ0‚^æ úØA)ñM~8‡pÃV0&2Q>Ò 4…oæmòø[¨ „yt= À¶Íæ1+‚A(ÝD<'n»ÿÄ*@3k” À´Œ>ÕÖ±ýðx[vel -NƒØ¦CÃyz§ì[ºq°,ÆÞÈkfið-3`m~”ö¤Í5®çkÑ^ˆôù-þ sµ?Ìõô!îµµµhozi¨Œ¹…Îå¿üB™Æ0¨ôxS ‰hæð0b<ã»A ­ã¬æ  o(”áà/Ñ5Í%Gä¤ìÓŒ[9wÌLyvÁ€pAgp$t‡óžÆ8¼†1ÀK…ÖiSkÛ¡’c–×gòÇ·ã¤`´ëÉPaa!& ÚU`g^`„Á ešËÜر™^`,ô¥ûAÑ+(^á7thpÞh —†Œ¼§‰Ø¾^DkržÇ ‡n¢(Nña°dgg³B4šƒ1h8Gg ¥ð.,^~äm<θ£¿w DЛ‰^+D”brÒu]á¨é!DQZZZYYÉ{NxI&:ÃühCÓ;B!ÑB!ÑB!ÑB!Ñÿnhjj2«SÞŠk>ZWîµ.…j]FØIKÎʆ2²L-S‡ŽÃïÞ1gqÑ¥üü|~,ò£Ñ"ÊÈ2u´™:‚Eß¶ ±YuÙZȵ”¹²`à2ÂfA>™/šå“‚®Cë wra†IDATxÚì}|Uåýþ9ïwfïA#„lA†κê®ÕÒ¡­u´Åþ\Õö_mm«Vë.j*X†ÈÞ+aB d‡ìäî³þϹor¹„Ñjµ%ð>Ÿû¹¹9÷Ü÷Þó¾ß÷ù>ßïyoÇÀÀÀÀpa€°*`````¤ÏÀÀÀÀÀHŸ‘>#}Fú Œôé300000Òg`````¤ÏÀÀÀÀÀHŸ‘>#}Fú Œôé30000œƒY0ü7¡ÜÒ:^´¤èßÊî=Çr©—'Éçæµ´©)6Ú¸ˆç8¿ÎyT=?òî‰-£Ì¥t#Ã!¤Ù˜¶c8žíœÅð_%>Ýôöa%)ÁÐôo£|ƒã{y›×7û¼vø¹‹>:ꉌáÐéxô;žÄëS~’¢ÌòÍÕ÷J‰÷åž¼X)Zæw6*ý#Å×ÇE8Ež™Sú ÿu•ÁsV]?Ô¤rºþ-}C_‹~Ž^;ÇIšVÒ ™9x@àÜ7)¼þrÀ³º6°dzLš€ç›{Ø;eyËú1Vñ>#}†ÿ÷ñ|ðÏ·¢ô9»Á+¯Cã‡.Ý|mˆ‚a¨ßTùEmêGGý˦Eß±±=ÑJŽ{µ¼éÃ`û_ºžÁÌ‘>ÃÐøà¾‘Ó7NOÝ<÷/Ü>¥ŸÃKÃà̼V×/$gªïoì¿Vâ}r¨Ã&påÚ'“";#壯ÙîȶŽÿ¼…™#}†ÿÕ0$žÓÏÊÝ<ÏëÚ©ün¥ã ^ÕÎá‹釒O†Î ðmü7™T»õìA38Ðý­ëÚƒ›3Ä+‘pIvÙ#ý à]åÈYÍ€ÿwÇ~¨ÆE8Žk&ã"Ï¥¶U¹*ŽœeÈiM¶ÄöÔÞ¼&Šƒ·>£*Jb|Í:/œ…U“³c9nÀ¹Yß<øXÓ:iÞTý†¡}“ù(YàšzªÄZ¸§F8îÞØ1=Å.ί-~Ù;#}FúFÍÆ¬œ'21Y×O«u›-¦Œø—%lW–×øÜ) ž@ >O âXíog €æüìÁKÎ.nA†|Zôz³ÊC † o4üÚý#¢çÌó¯˜õ¡¨›DÏ }Syî›AwSoë¼#¾?ŒpzUnP”øÁäÈÿl®»)¾¨M‹–Ø]\Fú DHsãº'oÌQ¶FF[UÍ89SbžzåÚ¦ýVL;Õ–»Ô›Öµì=ê;Ú'„ hIå»v>5Ý*štl·HÿZ±:œ|ƒÎ‡göyžS5{T¤Í"÷ÜúæÁòšÎw²¼Á)ZxàW¤YþZäy§Ì7ÿ’(´C‡°îò˜uÇ•{7w¬™Íìc3rD‹mâc‹ã:Úu"Ȇ!\çƒÓeCÕc¥ÞÕOªµ…g*¡Ö«Ý²®ù@¹—S4(sb„=ÀÔ5¥r÷¦G'§ÇE~»4 .HÓà }¡§Ï*1paW¤i\@ÿ•><È¢©ÑŸõ?³×ýúaï{G}–ù~¶¹ã‹#ÓYNŸ)}†NYmsŒû¿lzâú|W‰ÕnÑ4#lP¡9ŸJ;Zê]ó¤múïÅ„Ý>[çÕn]ÛTXâÖ]$' Dáy^U´øŠ=+16;%î+¦AtI7ˆÎ…§wÌI¼=|.!¯¢f|çU𺮩úÙSúxÓ­èíŠÞì×[ý:N‡'HŒ…¶N‘—ÈI±•Cä—M^VØ\hÆÀqýå1I&ïé3„Á5æÑy[½f¨Ð,[e "4Ä$‚™‰6*Ê|«c›ö´wb²k³_»}MãÖƒnŧ  žðìoI:¶{ÅC ÊJúÊ?H7l°N>¼<ÎK•òéOç<š9&èD6ˆ3³& :Ë)3’pN{@·†¨— þcëúJüס薓ù¿Á¥±A…j èmŠÞâÓAʲÀãxœUˆ’I7>)‚Ñ Ï…~~¯¢Í“U{Ô] ÕǼ{jü•­ªË$}ƒÞ*‘¤(qP’<®—et‚%'J ¿L‰pW¥Éx0Ãf`¤ÏpF8cG=1ǣ׎HÓYÖOž1k(:W]ã[óëÔß 1™8ÒèÕ¾¿¶yk‘ËïÑL¯ŸÄøÏKGv/}hذ~i_ãÇähÈf–Ç.üoœ^±¶yÕ{WŒÌŽUºVw ©hö^–.ÏÔ=ÈP5ãÎy%¹}OÐÒá±jZý—¤ ·OêŠ4Œ[ß)Né•¶P‰AxrèhÃwçviëj}›«e –EQuxÆ›Ð/QžØÛ69Íš-Ÿ–øNwî„Òç Ÿªñ§½ ‘¾¤Ê³ Ô³³ÌÛÔ¦óŠxx5óv¬nè>½Ò«­ ¬>˜¡LÏ¿ÓËÖ'BbfÌÀHŸá+ *)}Øcï>qÈ~A–ô“GÊ~ƒ44ûÖýÞ6å7$2eÛÁê%Ÿì3úK†~Ò”R“ž£|÷’Ÿå”õ5Š®;Î*„ewðCº¹–p'Áéë ë¶Ôð¡%}ˆ@Z›Û§\uš´’@¸Šª–‚f™tÝBå ikuO‰ ;‡¸¼Ë÷µ‹äD€à׌I}œëk½/ïv•Ö)>Ço´#W»¾£M-ªS×f®É²ÞœíäO!sA7"E.”\ç‰A3ºgÛ5Ýx~Ûeþêj?ÑÔd‹9‹—O:ÏÔ55x¥ºî÷——qŸøí;š;žäìÃÔ=#}†¯‚¸Œ¾yÌ+øíÍ£g ’®÷Í‘†ChwûÖ=c›òøåÃ3ž™Zöð—‡…ôl^UN$,ˆ ”ïYú³ASGôûÚ?R8RàlbéÞ¹³dB¢$>ÞAô®“ ÉCΔh± ¤—ãÄøxBˆÕ/tË­óŠš!—Ä4º’H|«~}sc«ÅqѲª™ÐMCQjª¥x¥ÃÛú£üîfDÈO ŸN5Ó»rEiÏîlYQð7)ñDÅÙ‚ ßP[ëj¨34E´GÅgdDD:UÀœÜeøŒz£UŠºGÛßÇE§8™Þg`¤ÏðUØw òË¿ïzvö¨ÑƒMú [:›tð¢ƒó­Î:åá9·Lnl]ö§eÖäLCWÌÛ¸DÔ*~2»ÿÌÑ9ÿÉoàu$îùÓ‚¤ÏŸ™ôpÄH¼ÖEó’H:îL£!‰¡GHfŠ'ŠÄ/âQ #VÆ·êá+!k"=B†0‚7ð/^¨ŠJ?oŽºW¼öv˧þÀ H÷„LÇIJß0bÌ2;K^%ÝWaX_î^zÄ› ‘Ñ8™—DÉܺyöÄ”é×qÚ-Gkš^û¼°¢%³oÿ>Ÿ7˜  .Gfäý«æ]‘"6$Ÿ‘>ÃWAZÞHíç/¼øàÈIãtU×5ëJUh†AÚ8Ñ.*ëÿ*M~àÙ{fúžûçË{*å„Ts˜eeñÜ;2®”ÿþÐb´Ì;eÒ•u?ÕOxý k,&ŸÆZˆªvž/ˤI:ã¼'Q×MòíâyYÜf²Ç8™ us]J\°âPC–¥¶vÏ‘}uWs”ÕüD³Ÿ$gegeõÒ”@00 ú>·+'>ö‰õõÿü®Õ) !Ÿ!z”…çuº(9éF®' =º²®¢Si÷2<ŠÈY¤ÊÝ›=ôâҢƈ¬”x¿Ïô5>g‡µN´|XÐtÛÈxfà Œô¾2†WîþÝîwžq٠ŧ„Ï×…¦•Û ŸdWÖ½,Mþé‹\Ýô›æ oË›·¥Ý1cÄþíPøÑ2‰²­Kꃕáμ ¥Ìéq6¢(ç[-B½…gícz+1}Bpxª, ±›‡€Ë@œJè­\ÞL‰K+´ã%ÏÜ8zx΄(‡ oU7´þcYÁ¢-5Ó§ ø7B -ÒH‹s,ÝÛôÝ‘‰aý͈Ã÷v’À·K'­·pwS´Hâ9Ýg5}GDLÄÆ‚ƒ¿½qPˆñCµñø÷/¹ô‰•ò“^þBž÷{†'ÅÌÝUyíà»ÌFå30ÒgøŠÈž0]õ¸ö.~}Ȭ«×èâ_#Èû¢[⢜êú7ÅI?z÷ñZxk¤Ìï_9æ›ùn(}+kT­+]# …œ%½äS!@§oœÃ)EÛÈ™”¾ôÙ†awˆ®€ÈF8­$Á)ê¾Îü!œÛoØ|üá6D¡Óú¤Åÿæ—æ¬ØõÖ¶ý—NæjwÓß/(þ‘i‘‹v–ß0"tÅIæÄ÷jY †#]‹/úpkýÐÞñp`v+!D°:K{Ý¥£GŸz qQÎѽ#8¿/Ñ!)t‘9„&º–cÝ{¬}L¿fÀ Œô¾2\ú}nwñ–/s'O øü\—æ5F’ĈM"Ææ÷ȸÛÿåûŸßÔ÷݈¶ àÇÐ’™²,*ŠÈú™•¾ïüÁeÅð3£œbŒåŒküˆ†gó›2§ä2oäžF@‚'GJ>S–ëT\kŠ`ï”pÆá¦KG|±c¡ê÷¦DY%èwôt›°Q5jš½éqö®ïé›Þ…FÉ GBß[ÕäõºµÌHÑPƒ—,5û|£f§«X|>¯ozIk 1Áêówº:«¦\”±hg#}Fú _ùß¹­lßj—ˆÓah& Vïpêž6ßÁ=\uyÅ®MÑ\BÜÄË¿Á/ÓF[I¬CTU=(´ «ETTAsŸ14x#Ö.ú=˜©çcœ¢9Vþ´JŸÞ° †ÖIúѱÝÕ}<¨Äé‰N±—lè„7C ¿_©k•ðÜ@t¤åŒÞ±oÊkËŽ‚Ó‰ æá$2ãÄr›p¤º™ÚŽn@Š.½£j†Ó&¶¶¹}n/}÷pUkn²=ÊJl’™ù‘EÁn—œ›ªèZ@÷tEÕ5ÍÐÌhLÐÇ)qs®Ïs ?ÏËÄFJø¹8SÙÒ Œô¾"»×èí-ò ÉœßÇ%Ø´¦zÏgïøÖþÓðtˆk›‡;2âêKÿø†Î“¿­¯Í޳\‘û|¯®é//­hviV ™3j@TKGàó­u’ϘÞQüʺ½Í;JZª›ü^EsX¤ö¶¶ßÞœyzÒ7ŒÄHI"†(žCG[^úìè/;iЋ¢h˶Öo.n)®ò´yTlÀø¿kÏ80&Êi•8#)Bˆ¶Ø áð‘ë«_[ztö%'6)ôùÔÏ·Õ7¹IÑ–Œ+Ïó_îj˜Ð¿sd½ÛíOOŽLŽ‘ácÊë}G{·Zݪ_ÕžwX…‡!ÅGʱb„M”ÍÝQx:þʯèõ-Þ/v6«qiº.±åé3|5_¼Ãð´[/¹ÙèhVkª|ë—Ö/Ñëx øÆérùŠ{_4ý¹·9B^XUû—GGÉöÙ9S|Køjª¶º EEÚ­û›e‘‡x÷yü/ÌN?}dÀq¥•®UsÂ[P¼f2ŸðŠëLI}CSëš|õÍÞ¢ ×–ƒ-…宀×ûÓ'zc‹ïט‰+ô3ïç.‰‚Í"•·–Õºw”´m-n=zÜGÌ’=tNõqÏû›ójxYàuŽ×þI:=SÀïO‰–·µÌ]Yu Òåöi[êã'sÓ-ÝÀÕÉï´ŠN«7€0HÌÛÛ`|¸™¦vÅå3úÅ ƒÙ/#}†¯ÄøGöù>Ÿ'fpýíÉ@Ñ.µd¯áqó+'9ˆÁy;üûs§½ö‘ ʯ¬­ýÛLJ[kÝíõî^?ðòŽï÷Ÿò>¯ëvb>¸î¡ë¬ñ¼¹¹ ~†ìŽØ ½ËlÐ" Þ8Ó4¥ÚÏíϺ½Šª™iS2 'Öù …N±KFÇDºÆŸy^øƒýe®7ó·Ô, š¢Iœv]f™ýU†¹`¦NŒÐÝi ¯ÿi~éš½møUV™˜Û™s|ŒV+µq¸·!–àMŠÇCñëó†¯ÒÕåtÝiQ„V#="‚ãë30Ògø·¡+qÿõ‘@ánÃó“`$‰—,¼ì0õ³ÆÊngê%o/”mö÷¶Ô?ÿþ¡†ÊI2W²9RÔô£ö½yþ˜¾ÿïƒ[U:°1lÝL9ç /áëÍi±!¯­Ûm§Y‹Æ 4Nõ)V83³¢›SÎÔS]Óy5lµQŽt-àõé'wx”úUÔ‰$†6ÆBtàOŠ9qÀÜDEUÃò.¼¹{b—³Á™Ÿo,‰ˆŒá‚÷Ì ƒ¿zJÿ眼m„G6F0³öÄà7°qú ŒôþÍÔJÍÑŽ?ýJ)Øc²žÅÙÅÂ&åЕªZ(ÇŽw±=*zQAóÿ›[Tw´Ý¼g\)qFeIÓO_Ü÷úýC†÷Žüú?ÂЉª’“¤7#g§o‘„H‹^×®†çs «oöžÆ¥iºWˆv2䳪vˤoœÌs§õŒdz¸º£Ã…* ÞƒŸpõï®ôÍÕtÂHßb4 #Ú¦» εk9žßZÂùšÕœlÕ=ja¼Îð5Ànõ0œÌø µíÏÎQvî6üd½¡r¡ÑxͯíÖÍ[œºfWÕ=¿[[Æç@Ž*}Mƒ.Ýwüžç V}ýƒæš;fZ¨dú8Ód+ÛäHžS”ð“‰Áí<ØvêÉåµ®c ¯*Ý ï¦ôu½Û ¼¦EGØÏô›Wl«×TÑÆ‰U-RtõÍŒ?[™a•ß?5ÑîÑ'Þ2üŠzïÊ‚†¯—ÓŒÒËé30Ògø7r*Í ÏüJÙ¼Ýð+¦m@³j¥Ðvû…aï/ŽÏÈÂÉÃúÇ&x÷kÞ3+¢©æÎÁ²`hÅ{êøì®âÊö¯Mú¼YÚ‰b;gžœ5(+B÷û8ºað!ÚâÍ­'%düŠþÚ’c¼¢™¹ P±ð.fáÆÉ¿!x0ôP‘GêNÿª½ó×Ôðð:ú‰b ¿obž3.Ú=hÝ®ˆKïØ¬–ËGÇjžÓçÑÊ4t_‹ûïZWÔÔmãSáñkÅU®ç?-ýõ³+y¶ä#}†ÁømÏ>âß°Y÷ ¼Í…fnGÑ \ŸŠ‰£ú%Ø–¶ª±Á­Q:Oó·{ç}PTs¬uìàxø‹Í»Öo«qu̯àS^è:“œæóú»9¢jaùws•ÿ}Õ?ÿ­ïê©å'ÄDHp$‡«:>Y~lÝ–jUÑ„{5à•­LpÒ‚£¼¡Õ Bø“"ŒÜ~½¸µßŸÞ­uD&†–g€Þß½³â×¥mùCGŒžáˆ”xæz¯V]í-/w—6­lnmóž NäY¶Ÿ‘>ÃYÖçíøó“þ+ ——¥ã›[ysÓž–Žìù‹3†ŸfùÌÔäø¥ÿøé¥7½ÐèO1<ý¶ÔÚž?–¼4gdjüWàýÎüÆ)¤¶MT"Þ9üáçŠlÎT£‹.Ž÷´{,*Áƒ^“E–^äÊ5çQcºFû ´Ñ¾ÀI¿_§ká7wÍ…69r ¨~ÿþ:‡M²Z-n¢4”Ü%8t"§µ¿ðÔº¢1³Oá "ž3‡ž”2zøg×lÛõܶCͲ5*t! ´5n]Ó¸m‰²‹6QðëF»O xMÙ/sÿ›Î¼WÀÓʬš¥wÎÀøJÀóâK–p­.ˆD7e’`_08I3´t¤Í}?{üÄ3•Ð;#yÑÛ?qh9%@tÃLÇw=ÌÒüêÖå¿üó®6·ò•”¾™R?åq–œ>ðƒÛ¦Mnø]uÄ€‡Py-À«~AWì’f5»d8d‘S½’wßKO]‘%™É–Î’UCU­¹›ã fuNzþf™Wl öw´¸Ýí¢©V‘3'aÑsÌ»º¯åÀ¿¿,/'ë”$Z0‰þP»{2›Õòák÷Ë:è¨2'* Jƒ% œn%º¬(îOCCGG“Kðøìœâ «©íyNU|me©öâ~06#}†Ó@÷¸«žx¸ìýªê›«5®Â§ó)GýJ9^ÿniużôfÎe³Î^NnÿŒÏÞú¡à)ÐÜÕzðaxð¨Ñ=µ| ÎßZµvù¶Ûî_XQÓöoþ0Ÿ«ó·ó7}pWðÑîsŸmD,Kï¾üÓ«'èþ–"|œ x9ç¾ð·*m%ùiUŸÏ»gÆÔ‘--œââ}Õç;y >9‰ñAÐÊÕåÞ1œâ bnSnÄäqó6Ñy.àáÝ{^|bòß™|Š'ãÜm­\ ¿¤óÀs‹ßÛ}¹è¨ˆÏþñ«»®‰Q[v*Ç9U3±ù@Dbà{es‡t“èáÞÌ!¨>\Ú¡dkÑÓÞõåïôëÅl›¥wNƒª/WÑãªëƒùjÊKœ9ˇ7÷sÒt#)//ÿ;×ý;E ÜwÑ»÷~¶h$">X`h Ýœ8Õ²àŸîùÁÌÓ.MÜ ÃÅ5Õæ‰Çœ ËÑò8MÕôŽ:ûÛ;¯übÙŠÍó>úrïú¦E1§h ‰‰öý“o¹ñÊK.)I¢ªj7̈©¬:NÅk¦Xúö>yá 3½£òa3¢ N<(ûñ_~çÞ_Ú²G䎷ÐÍÊ C54ê«›:>æÑ_Ý;8¯ïé’VÜÔÑ‘½“ª‚ËD¨3¿Wï—uš‹ŠŒ°ÿùw?üÞM‡ç/øòó/‹Ë*Nˆ%;ODÃ\bB×Ô€®ºy£#;Ó:nTæ¬K¯;fHd„ƒY5ÃÙÁl@/Ãy Ÿ?ÐÜÜæ÷+N§=6&RøŠËýßx×ÜuÛÜaë8Àñè?½#í‘_š^~eåª]{Šª›[¼(9=%bÄЬ™—Ž9bà7~!^¯ïð‘c¥G*K×´¶¹á2à«R“cûôNÍÊLï•b±È¬¹˜Òg¸ÐaµÈ©) ÿAòK#šÆ‡/™ÀiB×È›™—ŽÃ/ŠjŽ™ù6—=°Ù¬ùyð`mÊÀHŸá[ƒfÞà%'vEçƒciºÏz’%Ö‰é30œ0‚ã…ÂÒ;#}Fú Œôé300000Òg`````¤ÏÀÀÀÀÀHŸ‘>#}Fú Œôé300000Òg`````¤ÏÀÀÀð?†ªªíííôõÞ½{ËÊÊzú‰¬Q΄eË–UWWÏœ9Óï÷×ÕÕ•——OŸ>=%%/ú÷ï/Š=BÙÆè '¡µµµ¢¢"??,¿`Á§Ó žŒÍÌ̬ªªÚ³gOrr2äddä]wÝÅ”>÷ˆu ‚òÖïçDñVéí*åxQåœÉ½"#,¬f¾A¬\¹¤rw»Ý– ¢‚ÁëõZ­VxEQಲ²¦L™Ò³®Žåôz<š‘ûucùQ·lµ<±âؼ’Žï&[xŽ{쯛^;ØöÃÂŽƒG[XEý‡PUU×õŽŽ¼nhh€À·t\¿wïÞÇAB†ºm۶žu,½ÃÀp®ciïãr϶²v5RÓSl¢Ó.%Ë\¦SœWéùkQ‹h·òÍ}–l}ïìv‰Õةѵ´´ÄÆÆžåœ-[¶ɲܨØêÇ g‘‘‘ÑÑÑeeeÿ’t¢z!üqŠ}ðÁcbb˜Òï‘@ȶdÉ’ûî»ïÍ7ßDs² a8°¡ÞŸÈq{ª}‘ª' v‘Ä F’Mø¸Úóòa—h“ áx¯ïX‡òÈÇ[½¬Æ( >ýôÓªª*¼^¿~=$ùÂ… ;#'çÔó!íÛÚÚ¨À¡CÝÛl6>žQHuuu8ãS€ñá*þú׿‚:zJµ°œþ ìÛ·oîܹß𺼼Üï÷ß{ャZþW¨òhÿ¬ö%XˆË§'Š|¬…DJÄ)‘H™O± Ëê¼Ïw„AQªFRc?¹ô@”íwó‹žÿáÈ YÑ› ž oß¾ }ñâÅ}ûöw÷éÓç…^ˆˆˆ „7nèСáŸíׯ_ii)} ~·Û횦>>>22$¾k×®¦¦&Ðô²eˆŽƒøà¡C‡à!ðAH=tQá$::: âwïÞ]SSS___WW Þ§~ä Ë2>ž››‹òãââð¥Lé÷ @Ô¿ôÒK%%%h¿[o½uÖ¬Y{öìyì±Çðֻロœœ|ñųZbøïcJ²ew½/Ò^â#E’h$›´­Á}|û—-ª jç9C7(ãÇ\¤È7ùÕ€'°j]Ù׿‹â—¼­­­¥ÉœŠŠ °6Õæ4E€¾¡äà ÊAîo¼ñÆ<€·V­ZÒïøNؼysKK $?¸þ’K.ÉÎÎnmmE ”ñé­]Dð8XXXÕÈH¿`ùò寽ö”þôéÓÁøp×88dÈ[n¹eÞ¼yðäo¾ù&Â7´7ã †ÿZúîVeW“/ò&ãK$Ñ.ÖjÆü ªÖ4Ú<X¥k3†YŒâ¸h0¾@¢tmÐè>îÞq)F€ KçƒÁAîðô_ô\»µ Pâû÷ïß±c$<{*‡ÌÇóüùóï¼óÎ+®¸béÒ¥‡¾…”––"îÇùÆ »ÿþû)3”••Aâ e||ÅŠp6ø·§ÔÕ…Kúp쯼òÊš5kúôé3{öì¼¼<D‡†OMM½é¦›ÐêÅÅŰ€¿ýíoO>ù$ìæ<®öööÇ÷êÕ+!!Qí—_~ ½3yò䨨(FÁÿe÷û¢ŽŠ–@’DâeâIœUháù7ßÞê^¹Ïn8äå$dÅ‹¥MÍÕY©1ª)pN·ó\z”Å›Òkõ—_ßúÓ½@jl×®]èÈ â@ Àúp”îñ6Œ¾¼sçNuxæ"Ïp .„‡ÁÓ˜”¾Áã89''ç‘G zee%N ŒO ×4-))Éív÷ Ñú(éƒàþô§?AÜ}÷Ý×\s ŽUWWƒõz÷îÈ­xß}÷=üðÃtš5 ùó4K [ÿâ‹/àð`Á×^{í¾}û𢼼|ݺuO?ýôñãÇÑ—àù 0IüÍA3¸E‰ÿ;'‹•›\jŒ©ñƒÙ|»¼xcYûš"»]JI‰ü¿‡&Õ §­ªñ¾XìŽø‘wŠ\´,Ô¸•õßÈí«xO.ÒGo… û|>ú/¥cp:jY___XX(©ŒÂàLPpà@¸ñíÛ·ÇÅÅûúö훟Ÿ~TŶ Ð7pi9°`=UX?”ô:<"ªö Ÿ÷—¿ügΘ1ƒ±ù¿›sh¼XÜn'‚kÁÁA#³š]\N„ôÙÞºd-sé ÚÕvíâÞ‘§~pO«2¿ÌcQô‰ð¾ŸpªÛzË ƒ{gvNR nK­7ZäíçijHl„›Õ/Î6g–¼£äÙ‡'_•\WWWUUv¡·mž‚ˆaØ z6Lº_¿~©©©á.é`|ôhÐJ@”S§“o¡„ ãß»w/ÌßÒ ™[pÄÐ’%KpåƒýYzçœDë{ï½—’’òÜsÏÑF‚ÈÉɪýáȘ1cZZZ¶nÝ êÏÌÌôx<ªª^yå•eee Bø€/¿üvCoéôt455ÖÑ`Ðõ¸@=}†eÃí=z—Oc[thŸ… &''wÚÌŽCíêëGÜßͰ¥Ú„—JÝNžKù޾G:ô^’"ãgå¿x°AßÙÊ[åuËv¾q[Þ°¡©Ý ùô˜‡×¹x+qJB”Ä;$¾W¤ÔwHê¾G&ŽÉì$,Ž{î KPt‡È;óœH‰h„ß×ä©­jiÚQY°»fø)%Ÿgðz½óçÏ÷ûý¡#°^ÈüÖÖVDóðø—.”†ž€ ¦ûÃõ>|èA "´ÜžAøÈ®]»p|N£sµB¹#à-ÈÄ©S§Ž=š¥wÎ-ìÞ½{Ó¦M—_~ù”)SÐNpàà÷qãÆA à­#FÀ2@ýx+//\hM €w×®] º‡Þ¹sçðáÃ{n=€Ê!jàÏè"t¬1åzšÍ„MÃà4Øz(ŠŽ/˜°ÿ~ø<„ÃŒßO‹_ìnÛÒàÿ¼Ö¿ ÊÛêÕS%’$‘‰$Z„›Pé7Ö¸uO´S@Åz}äó‚ eSfä:l'i¯x¿Å‚B#)zP‚=Ræ£-$Ý.¤ô‰_Zë<$ÅiÝÙ¢¼zÈÕØ¦DñEÞ)ñ±[ÅÏ6•¯~qUÛö#ªW%áâqYç}àÉ=Þ™ãy:{º JŸÎž½õÖ[þóŸ_vÙeèìPëáqaÿ°öÆÆFPtåq<Ó!GŽ¡î:ƒÆ§'àÄ"^ ÌG}täÈ‘(‘þÿ hW¸zŸÏFA®–––â ÂÂqüÝ»wïíÛ·ƒæF.û£å4MÃk´%$-¬'à™A÷ð ø¬ª¤¤¤oß¾=4^¼xquu5 1)¬ϧ2þ±cÇø BÄkØ=ÜÀÁƒW­Z5cÆ üË(þTÌ;êmèºÁY ŒŸh¿áce’jx´ùuÞÕA%†Á ÄOZÜzEëä£Â–ÉLŠ¶Æ§Eûy!3B›ÇX…hYߨ[è#+ª|{û-ºa¦tx§Éû* k¾(âT§¤FM—uûMCcclçwmÃhH©œ®Œ†~ÝÑÑQPP@ýC=„HF«à À!ƇÁCØ‚ôѪªªâƒ€ðohh¨¯¯‚ Ô¡9 †Ø°aCYYâÈ£´´´ô z;Ò; ¤Í›7¯\¹Ô†¶EKL˜0íÚ¯_?4*mxP9¸áž={ âsrrÀæPúð ùùùùhõ¡C‡ÂŒÐö0…ÖEcÃÈÑyüNCWjôè”ñiT‹>ë‡éÓº ÚLg¦ êž{î9¨›SO»0Ñ¡OuxU=J&ånâ0‚çS%>A"q2<¿Ð¥,nðñ/…±ŽkÜÿïÞÜù꣗„FÖ—»µ¼}dªàà5(ýÑ cy•7Óc .’g0¥bü™DØÅ‡8áò¼µ‡jÿöç+{gÅ\5îŒÈfÉoÉRRF÷§Ëà\sÍ5—\rIèdhDðÔhéœ[:¶güøñà tüôôt:ÙŠÊô:+$ó¡åñ û‡r:pàŠÁ=ŒÎæß²eˇ~#˜DQôîc|`\¼œn«NF¯Á·ôêÕ D±mÛ6tüË/¿œƒB tóÍ7£ðз0Òÿ¶ry ¢²²Ê¾zÊ”)<ò½™Nçh@ÝÓ44zøÜsÏÑ̽ƒ· ÒÒÒ©ÓAphN ¿]^^¾víZÁÀ,rss¡) „Ѻðóø"h|ºóرc{ÄÈ\(=.™?1>®}cáÂ…x „Ž‹Â»½{÷ÆqTài³ö¨@¼»lÙ2T"ª³·ÊDëœßÔãÓŒZ¯æ÷D>%ÈøP÷>ÎX¾º¸f{Y Ù%ަéãs BÀ:ž3_àí„sÈ‚ëò¡íÙIsc)ãS ðǧ٢l¯ì:ÞÖæk‰p&W[ã£U"DÂIB;áúEÊ»»¼»ÅؤïÞ8dü˜Ì¶vßä ½/_‹¾yÍ5×|òÉ'°äÐp˜\BB„ ÀÑè¿k°Cp:è;œñÑ‘é ìÏ>û fƒ$ˆóqšÆårõéÓ]/ðÙC‡ÁÇlß¾¦’zÊÚj§EÏØD?òóÏ?_½z58š7 :t̘14¶B;!΂ŠG{€åé²­0š›ëèèxë­·n¿ýv´7¼ŽÃ ð/]j êuË–-ø`ÿþýa%n·„Žbá `F8HMaùòå/¾ø"ŠíÛ·ï³Ï>{îïŒ §µxñbÔgÒøp8¾gÏ:}êÔ©·Þz+®çìܹsÕªUèH¡…jiÈŒÿW\\ŒãsçÎ ÝØ@Í£›A(Áq&''£‡ ~BõÂSB¯¼óÆÏgUÞzŸ¦êFlñれßP×üc“¿à¨$ÀøÌ—ó«úØþÆ•#íºE8' ޳8;áV12Ö±ikٱܬËNÜl Ï~qdé³Ë•¸ÈÑÌÀ™Çªšc­Ò˜>±«øÁÊCÍû«®ºsì¡Ò†ýo®›26ã¹g.ç.<@{A­ƒ‚Áï4GŽ¿fÍ:;—†ª§fuèôh9º<âWHû+®¸‚ º zú¤I“Ö­[æIã#à„_ýêWø–õë×çååõ\AÓ3Fï ÙæÍ›× ~Ûm·}ÿûß¿þúë‡ :†V¥+(P'&DëÒiÙ”ŽAa`7¨¼ûúë¯ãhHˆÂàpo!Зá h ¦3bÄ”Œ¯Àùhf Z„ƒ3hnnÆ;÷Å>~9âºAUC4•ìØ1=ªV>{öì‡zH{jHSÿÆ€¨¥½{÷RöG'IJêœ ‰h •ƒ`MpàÀR8þ /¤§§#>@¨¯ ÏzÞÜ ðhƯ÷´‡Ô7¸8§Ê$A&‰V"ÈŠy[ý[K%›Ì‹$7'ñî;GýðîÑ3.Jßæ!vÃÌê8ƒŒï&jdQ(.o<¼|ÿ–¥EcÆd$ÄuŽü³AÔÛäòÖ@¼Câú&kèˆá¸òêÖ¤äˆVžìœ»ì=f´{”#õ®&wÞ äK&ö¹ÐŸÎ¶…uAõ;‚5SÓ¥7lCƒÐBŒO;‰A ›€Àà£G¦«5 _ ¤¦¦feeÑÄÈЉ;èJx‹®ÛÃHÿÛxjãÆ999×]w4@ ’>ü¿ ¢G,†ã¡õNáçñ/›ïã?}?ž.9²Cë"j…åçç—––ÒÁû•••ðððóh~ÈqìØ±(¦AP>‚ :l’¤»9ÇkœnCóžt€&ª¿\ y ~>d;"œCsA¡gÔÍ’Ýyç( G °àNà é°exÍÆÆFT/­(|üDUUªnóæÍèWð¬çã@ÄçEKûÛA3Àø‰ù2IŽöו-Ø)[$Žçn½qÈo›–?0)!Á™ïX^uÝÞÅøxi“v¨Ûõו¤¶E帬^ÑùyÉ´üÅÕ¾ª-=~j¼0À!6Ûw†¦÷(k?ÜQ¾ú àS„é¯þßäۮˎ¶_}ynt”õB#}°jØ6Œ >°?D L7|hY8ãã4˜%¼È*˜ììl„¹”8HKÀ3 „=ƒR6lØ@eœã†ÖìéIËž‘Ó¹ƒ¯á`—/_>}úô~ýúñáÃ*//Ggff¢1ÚÛÛé2§h]X ^D ™3gH'£]á hnâ¯W¯^ ö‡¡ÐypÎŽ;PÈqÊ”)(ü±ððÃßÿý ÁW_}zöœ­::’õàÁƒtIqšÛ¡KJq]·go¿ýöð Nàç`ú¨Uº > o‡ÃÏ¡ÆP&NƒØéÃËÒÄ(þ¥.– BKÑÂt–/ê }æüXÊ‚ðܨXiH”T¦ 2+‘8 qZ¥š¢AQ9Q¾bFÎý÷Œ ßè×}~5Zàm„³ xð6XEÁï ðª†Zî×'Î’•Ðä×QÎ_SíM[9¤Í®È¾vçè(+QÔ¬DG±¡ûV㺱\Rô3k«^únÎ-7\ k"3<ðÙgŸ¡“4L 1k ϸRÆ¥tpÂÂ… ÑÙÑ ©¡Òyˆô®@h)f0>¨þƒ®ÆŒsÀ?½zõZ¼x1NF¸Ï”þ·ëÏüq4Ûüã•+WVWWO:­-_QQŠéÝ»7˜~¸­­ ÇiâË¥·.´YFFh襗^B@ À904' -P,·Ë­ƒ³PNC±øRœöÅ_ 4H0&¾(==|Šo¹ñÆÏå„>lOŸævðûéRàðgpu³gÏ ÅÁÅ.Z´¨ÛL]ú‚ N|G¯Zµ õ‹ƒ¸|”Lý+å}:ŸÕˆ®I}j¯¡ô¡ËÐ ç~lô/±µ)ðû¢Žª%Åb¦òÁÔqV!Â&mÞpØs¬):Îþ§ßÍ´ÙNl©úq¥·¦M &vÌß.;oä÷‰Ó²“òlWÜ=î¯ÒªZ¿Dø÷ÊÜ>¯FWRèH±‰VÂGK|¯hkivZ]¿4Áj1|ú·µW4OŸua’>ì ÝŸfxèx„é!c¦‹ã£ ÃÞ(éÃà׬Yë…p&''ÃÎéÔ\ÊQÍ™î?èc„ã¤I“Îý›ygÔ+çþO|å•WÀ,И ;v,¢0º¦ˆ&77Ͱ{÷îÆÆFˆ÷´´4pÊ¡C‡ÀtœpËhŸÏr§ÃQ@=pwÝu×Ë/¿ ÊC3ÃP@I°›‚‚HW|Ú!20>NÀס4J‘à,º™NII å/º÷9Þ1ÀÎÛ·oonn¦3°BS±†>nÜ8¼ —€*Åu-X°/p½Ô=PÒG—@ÂãÂÀ5Ò¸G ‚®Û#„žŒxþƒv?ZKh¾Ë/¿<%%ÒŒn?Ô£ñ»b02­$V2¾Eˆµ½ìBzŸ8UÓ‡N Ÿ{ Mý²Â#‚ëÍIU”ñÍl"‘ùÀÁúw‹ÛDÕ >ua©ËçÖbàó gÈ„O°ú€þÇÒö¢–€¬é¼¡“/ߨñÉgû?ÜP¡¨:w¡ ö6þü?þñ»ví¢öL¥^Sõ†( ŠG/Æq0=ŽŽ@#¡2Ÿ.Ï {Þ¶m¬·­S½_ZZºwïÞ¹sç†hféot¹ š’¾ýöÛÁ}ôÑÈ‘#Ñ`à8o F»¢Í@ßhK„?^€âiæâ¤îzĈ`®yóæ}ï{ßCË¡d8†ºº:ú.Tm{|ZÇiÛããÆ ûo¾ùæE]³€…Á\~ðƒœã¤O§/ Þ£ÐI¹taXtÄ=p K–,¡•†`ÇqáôXè..^ÃÐñ 'º‡W@|@Oq=¥~”ŒBà>qZø@~*¦hªþôÓOÃïÒ´[Er…DgÇ'ZåhYˆ±<eã–+rwm9šubÀëšãþ·KÜ g‚¤/p¶ ã ’ðéÚÕ%užÃõFe³s¬+5.*R7Ç7GsšÓ¯Ì•Ô’`J<ÊëžU·Ð)^šÎEÚÕ[&p„Æo¯[Qvÿ¬¾&é8ðñ:^Àž¡ÆÐmÑU 醮ºqãF8:  ;­®C÷À¢«ê‡¦øÂ+Ði_áßEsÂè)[aÉ=tRzHï  ŠŠŠ À!srrð´šFcÓ˜ü6Á¿àòòr´þ…¢§x½^:’'”aáÅ!Cþñ¤§§#DXµjÕ±cÇ芒tìÂ@ð>¼¾‹¦5¸à€E¼¢×ÃŒð¾â—¿üåøñãÏñ „ÃwD„KGÙSGA³@ÎÀ¸ÝA rpMæ„/ÈCŸßàòKáØ=Íä„îñÒóé$uxJ?uû´ÿ 7"ì@ Ž>3jÔ¨ž;˜gZNlsQU… K‰ˆ”øXH~Iv½ÆçÎh3‘QЦ¾{ÄÜÜ<édÆÇ‹h›¸£¬iýÇ;•19bnºmHFBï¤hÒ9÷ʤ{'|ßJJ=ê«ÇܳtÛ1ÆÉE9xN/úbÿ¨GJrÄ…Éû ³fÍ‚íÁÁÈ wD±T¿ãÈŽ;ÐmaèªðtT7ÍCuU÷0Ë5kÖÀ7 kƒÓQx ›Æaÿ²²² 5é[€ë^±bZ1}úôÌÌLp.ZÄMï4fddøý~p x„. *ÇÉ´uAUj(Cá#ˆàçáöÑrpx‹îœ@çéààf@O¡êtmUü S {\|ñÅsæÌA`qî·qaa!8’'´*,\ .™Nzmø):‡: t Ô0ê6>‡ŸòApÆ(}‰Þû:M2‘T ú$š.gÚ´ih J4‚@JíÎ4§-ÅJb¬$Î&$ØE‹Ä?{ ½d’UÔà/o ðŠ#òÖàXßL옯#d¡òxG‰d•eÄDØ“¢¢ƒK,Dt’>1'ÜÊB¢U8êÕÀø^ÍLòtÿº¥OVîá7Ú_ÒxéÔ¾VË·ÍØ@g ¾¤óo ÿFÝÞÞ¾nÝ:¼ ?Üzë­—_~yˆ¦é‚ÌtaN˜÷–-[À´§ÃzûôéIGÕL7KÆ p¥AŒ9²'ª–@úp­Pâ -´8!8qèС±cÇ¢ ÀïtøN ™kN¿ MòÆià>DRRÒO~ò“ž²,b^„·›7o)£öhЃø‰Nn»Ðñ©'€s…ÿƒ,B¯€ĵÓE¦B% Xˆ© 6à[***PŸt­’Óò>ývছnš8qbÏåšÅµ~·Bòâ¬Ñ‚G¼]°Ë|…[}¹ÄÉó1œaN»%ÁQ:æX»@ ñé*i11RädDÔ{ ƒ·Šœ¹j¦¹Ê=Á"D:,œHjúÜZo›Aä3;¾ Œ¯lnm÷[íòˆó} ýnº{]°IX è  å‡`ú¦c«¯¯ÿñ ÛƒÒ¯ªª ­µ‰#èõ8ÚA777÷¿øÅí·ßNwÍ?tS-À¾}ûÀ3 }ô¦äädFúßïïÙ³2M×MÑ/ðºtý/ª1ÑÞhHPÔ:š$?ãhlp=m„ÆŒƒfCãÁ%P*G!ø¢þóŸˆP"8*Bišˆ.NI—^‚;AùëׯG´Ø#ÖŸÁÕÁʺ¢Wà7Ó›ð”BtžZ(žÏÁ3"ª?ü _ˆOÁÄQKáŒsP]Ÿ}öBcÔ0Å!/‚¼:íuø,ÚÕ ŸŠ.Ú—.¡(ëP7ÿrky£¢Mïc .’³ªÎ·±ÎŸ(CÔ:JÇÞõlŽÕøh‹ ÊÂÆâãMí¾]‡÷,Ù—“–a‰ €ÄÇÚ¥[¹õèŠÏvoZ¶ßWT%iš‘\ëáÔè‰7œÎãOÌNxà{Ã×h>ï~ºlÙ2˜1h½ÛŒ ßÐÐ@'TÂ\¡B¨.ÌÎΆKÀ ºÓÍÀJwíÚEWW¾è¢‹{ì1z¿ ' XºbOxBvNoæá_8†žHú=#ÌË˃¸¦³m¡Ä¦€pê Šv…'hnnFˆO0dÈ4?¬  €ÞÁÁóãã½t;4ðÊDcÃDè[ðxee%ø}êÔ©ƒ…M›6 n€:JýhéO?ý”眜° ) tÒ¤ItB|$¬5€£)ÐP*À©Çe¢¢6mÚ„€à²Ë.ÃeÒeÚÂïÜ¢BP] .D¢çÀ1À¹¢SádZ]4î>UÑ•J7<õÔS¯¾újOì6ÀÔ$K«§õÍùÛ'å<45ƒÜ׈6WÁì\b!(ðÍT>Õø2©ö( >-¬ÝXÂÏ‘“¢âg MŠs89ÃÙÅøÑviçq÷ºw·(û*$sÔ/Áoî¯àª[ŒC¹Sc'Uãz%èw\ÒÈŸ®>rÿmÃ.º¯ †“£ã2Ck £/COìÝ»—ŽC¯ÇñQ£FÁ ¬ZµŠ.²’ù4K—o†/K—ž g|¸8 ð>úŽËåºãŽ;zè®Ñ=ƒôÑ$ ­Â´´´âââÉ“'ƒŽçÎ fïã-ê½A=ðh’C‡ÚÒÓÓ¡ôñ„çÑ£GÑf`ÿ¨¨(MÓP&è2“Þ™A[ÂÊÑ{¼tÞ}íµ×ðÕP¦¡Ä7>K×q…õ,¶Â/ǵCïÃiáÚáØèÈ}z?–r1]UÇáSé(Ô0ÿŒË§«…ÖkC=£òáhQ-ð‹p«³gÏF±t !è¬%K–„nŠ„7eGGGyy9¾/Þyç9sæôÄž# üÍ×51{GsÀÆqGýø½Ö¥ÆJÄ º']£3!'-ÄiÀà6qOAUÍg»sœ—‰Ñõ(ÂE€ñÅÎû·ˆ <+_Zm)¯·Údªì³{Çæô‹—¿¾Ýu<:ÒdùîM«s¢ ´{ß[°?#B¾öêAç7ãƒÇW¬XfYtãCÕþýû»¥ÆkH>Ä;jIGÓDi7tKE ÈyØvh9:~‚^oÙ¼ysÏÝA¯ÇÜö;v,d;˜„µ|ùòk¯½´ûøã'&&Ž=L4`À:<Â*>##ZòÀôn;̃=ÑÙ¡±h~´%}:N¶2nÜ8 (çé§Ÿ†YLœ814…•&‚î¼óÎ¥K—þú׿îY- {…#|á… ÷QWÔÄ·oߎZB­N˜0—†·^|ñEü;cÆ X”ä ̽…ævèý[šØAõ¢ZPá¨ígžy&ü¶vh3ÕJt|'­a…ê¥þàøñã=š€ˆÓ*êò‹ë+ßy{{|~zÂȾ1qXE‡LlИç”Is@Û^Þ|InB\„Eñ)¨¿§%šÓ# ÝÉñÓµD>Z&í<Ù¸°@.¯'v3‡ŸžyßÇN—×l*Óƒ®÷޹yî„ÜçƒmxÂë…ed]ßâ~áÕ-Çg%Ä;ÎcÒ‡!ÁÞ(é‡d>º*¬ F évêìü K†L¡³pébz—ýô]SS“šzâv…uëÖ… ¡p&xo•Ñy×]w1ÒÿAWÊF;Aì¿ÿþûÖ† 6räHº!ýõ×_9OwÅÝ IÀïàzDsn·»¾¾¦@ÇqÒ³•••(EîÁ}8¦ÝãÌüüü÷Þ{rÂE]{¢2ŸÎìE´ aÏž=ÿûßï¾ûîžÕØpfûÛßÞ~ûm\>„<˜wþüù¨(ð/* õ€ëBß@àŒP‰FH4I÷V ’#ÕÕÕ4ƒšyòÉ'» dB!Ô=ð] }ÅR……ˆ/½îºëz4õq‡ª;üy•v¬©Ájé=>GÔ´=;Ëõvoæ ´ Ùq‚,|¾ °æó=UW82³tk¹l“òž9CœOû¢4Õd|‡H"mâβÏîc6«9J¸_vÜóÏÌJL8¡=&Ç™D/š+ÿ˜Ï"o®×æ©kñ}²Õ¬aYðxŸ_=öm’ôŒ±#T4¬133Ò0bÒV³„ùA)Ò¡4)A@߇Iƒ.è$ÍPbçÇAW¥­ªª¢† `Jÿ[ÇÅ_üÖ[o-Z´Ì š¾çž{ài÷íÛ÷ÁLš4 ­‚†DÛƒM²²²¢¢¢`6l—¾sssQ„@EEÚ Gà³àA´=]”srr^zé%øóñãÇgggÓé¦Tãã5B?ü®Ôszb{ãJï»ï>T4>ê.:tèPˆú?ÿùÏ”ëQu¿ùÍoPÃpl¸LT#L %ô©ÑÓùnˆœn¾ùæn÷6è Ì¡Õ{B ƒ ¬èDDK¡i=3ûGxãú×ÿ¾½P°øy®¬ðXý{› ·ß;mÐØ!S«šÜ­»+" ïÞTmã¤Ãu~]·FÙ{5g˜ë1tnnN¬²XWÙ,xüœE´Û¥ÿ÷øôpÆö·"yD/ñ†ØIúœD )Òê”n”Ô&':o»qHR¢ó|e|ˆŒ… ‚¸é0<:ÿ}4¾I}l–F§ÒEuh(@wº¦Û Ó±Ë¡ÌP„`8®¾A4 Á[th¢ÄÊ( þcРA=wÍðžDúÔEÃÙ¢™W­Z5kÖ,;ª~Á‚à/p”)Ô=ZJ„oñŽF¥7ÜAR`öääd:Pï‚ìBÛã]PÞ¥+ÉÀ èjUt'6:Š?//ï;ßùN¸…{&à¢&NœˆÈiùò奥¥?ûÙÏ`Öt§Çã¹ôÒKéžs7Ýtú­º¡nhÜŽ -h®êÔ©Ý´Zý.?¢ûÐ ^Ä×!ª@ì¹£w‘˜è|ô×S<>uÁÊÒ·×ì—¡Ã#¬×HÙöž= Íàñ®tïÇ\wEîß¿,kLOš[îO&†­sŸ[Á!¶h׫÷ŽJO‹âÎ_€Ð¡B(ãs]fÕÕÕñé(ƒk¯½Öˤ3()ãSrÇ tJ z15ér¼8‚ã\ð¦W(Îø øøx| *ððáûwïþÃþ@9„‘þ z>Í5¿÷Þ{>úèõ×_¿fÍš+V€ýÑ*à}ˆ}p Ýì*GÓöîÝþ€¶(;m Æ¥¦¦‚ÖáäÁw4ùJ[ÓèÞÞ¡çã„n¸¡‡Þµ?…ªÃ××¼îºë®¼òJº÷=^ƑВ¥¡Å×èÖ‰‡ßÐF»¬^½é€×p¥Oóªt4-ºú”þóÏ?ߣ7! ‡Ý*ÞveîÔQéËV–èšñƒ[†x¼Ê?øÀêzT¤uæts]Æœ~ñÄawëvE‘8šÍ7éÞÌé‹\vŸ¸²$kF·Ý¯ê|úkÅ®D‰'/œ`|ô^^–ó.®¢¹j[ß}¿pÎC“9o·/YßrË-÷a™\p¹uغ3%÷_üâ&L gâ-:n'´è”ß–-[ óðYôzð8=NWV?uõ4Êøt]ôœCçúÒÉ\=º{Ìzú¡¶qÐAWh­!C†¤§§Ó’hûiÓ¦AfÒ’¬ÁÛ£uAй¹¹p8Ñ¢Eï¼ó$þ×Àz ÆŒƒÒàÀAF¡ú¡`p Ÿ~ú)\ >ˆæ‡o€L>/w§´ú—†ÀK—.¥[Ç…òÓQü¨CT/Ýg†.E‹ aíÚµè]§æ‚苽{÷"¶ãÓä> iÖ£÷£8N˰!©Ãƒ“¤$I9"ý;W¼æŠÜ˜®õ׊*Ú¶î©lrŠSŽ0¾à”è¢ \ßÔˆ-M~÷ÁêÙwŽŠêZO«ò‡}í6M· ÄFx›È™Ï‚¹–ƒÕ"qÀFÝX·»ÕÜ?=K&%zsÐŽ!ÀƒòêÔfÛšÝF‹›Øe›]Δ48/ùâózm}PqJÄ&ñGZ•‘³ëšD8ÁÊ£‰¹ÎÍãó&ãó„ÊüàècÊÔúéyí«<õÈÔÉ{Ÿ÷UwÛm·}òÉ'è4§´8`À0E¨7:‚€Ž±ЯqŒ¿mÛ6ü ñŽàæ÷ÆoÔ××ãD=>BwxÎÊÊBŠô‹/¾ .çÐAÆô!#ýÿÐT×_ý+¯¼‚×åååkÖ¬™>}ú÷¾÷½;v|úé§©©©àq¼NJJš3g½·säÈ‘ùóçoÞ¼žü'?ù <õíñññO=õTYYlbëÖ­÷222víÚÇ@gf#€X²d 8®§ß½ùz€’Z¹r%äLÿÊ+¯„H§K5 |æ‚ ‘ŸJô!®§c[zïÛ·Žy]¿~= ®ºêªó`°æ×C›b*gXø2¯28ZŽx»L¢¬Ä­^5NDÂwêzó¨Ÿë"}ó¸ Æ—/gNæjU ^ qqö‰ã2/„ªÝ#4mD—L¨­­…±áöFÚ…Ÿ.Å¥Ÿ——Áw÷Ýw_|ñÅtàâ{÷¥¥¥­­­t°&¨ÂVŠ3½^/],ªŸ ®^u^å{èïËÃñññÚøñã¡FÁûÏ?ÿü3Ï<ƒ¦š={60{uu5TÀòåËq&¸æºë®£ Ž>AäççÃUÌœ9“.¡ ×8ùŽ;î¸`e)"Ü’’’×_îpÔ¨Q4?†>7@o~œVÚ‡òø¡à€-Ñ{¹tá£Ï?ÿüÚk¯=ovHÿªH´öòÚ?-Þ×X×q×=gOÊ€÷³ˆüá¶1ÌT’ö¤3ƒß%öMÆHÂòU·Iʈmmt5®> ‰ÂÛïÞ}ûˆó¾ê@ͰC˜ú&½ë†aT4Ü -ŒÒøtS-âd¨u:™b|ÅÅ҆%Oš4 üð‡?ü‚¼Ñ·o_¨Cœ6nÜ8Á½áÏyBúh$pñ“O>‰× K—.½á†¦NzìØ1°?n…`oÁ‡3æÖ[oEøv–2ó‚ ¯ï»ï>Ž!8þ°`Á‚ÜÜ\šØ¡ƒ/éSéžJxúzË–-ˆŸÐýÐ3Óƒ@ýÝï~·GÏrøåþØÌ>c8ÿ+îqX„(¹sT@½[‹”Í19$œñÍš4“9æÊk„óò÷ù»ý³ÐPJÍsPÛ"ÇsMž ¡ê† †|çÎt* ݈N§ íý@GÜÑ•a~ˆàA÷ Xì¢E‹@§ÊšgŸ}æ=mÚ´¤¤ÿÏÞùÆVYÝqüÒRje A‰ #IpÔE†mÔÒ 1+™”ºHœö…3ã+MÌb¢33FBâb|1j„Á N2E 0§2Y`´d¥­À(%‚ŽR¤…}z¿ãäÉs/¥-UïŸïç¹÷Üç>ôùžßùžß9ÏsÏÇ©ô«Ãð4óìÙ¹Ö›fñ– åååäžä漦:Éý…i5Œ/¾øbýúõâ57ß|ó<À‘vðAC³¡mŒ3F;ÏÝvÛm£F ¿_ÓŠ:ò}ÝjS’¥ÕNèø´ªªêñǧ‚ÚÛÛ¯¿þú,Ýrh¨Àæï?­{ê„Ê›¾ƒãÿåøÙï—w¿X:¢€\»ÿ¿ï÷æø½;mõ>Œßs¡0qñð¹ Çv7—t÷ +1ùÆÒ6ãDGç—ç{ê–æEx“Ï-_¾œ!>Eti§NÒOÃ#ùtÚ?£¹¹ùÝwßM$ýÀÐ;::ÈÙÓž–Î#t‹/>xðàäÉ“sÏësÁôáá‡Þ¿ÿÙ³g©{\þ‘Gá51A¿MIYYÙÒ¥KI òÜb†d\…˯\¹rëÖ­Œ—=JDO@çŠÎ´4>Õ"Eda›7o¦£e°E]p@ww÷Ô©SŸ}öYj„ ÖSôŒ,Þwúüï67ýy]äÛoZúàÇ(VTØ;•p¾»w™áÚÿ{~ÛÇmwý`üܾÕÜÑu¡ûÂð‚ò™~ý«{K/=ËŸWŒ;–To÷îÝ×]wÝøñãõ˜uXSáÓO?¥?˜;w.G"rë­·>óÌ3Ñå3ûæž$9>|Ïê¿Á}V¯^ÍëmÛ¶Qå;vìй555 ,ˆNá™ÁÏHLŸ>]S‰ÆX~ø!‚···cýŒˆ[[[qyº^’¬Y³f1Òzíµ×4ä²zi&y‰_Þû½{n\´ò·mýÝDɈ]-Ÿýñ•­Æ••–üèÇSÚ:ÿÓÐRZRÔõ÷Ö¶o?×öÙðîžÞ}q ‡å³twÞy'ÖèС†††;wvttL™2÷'Õ8yò$= oßyç™3g:Òâ—v#ÓìâôéÓ/¼ðB[[ÛwÜÝ{ákàƒ>xõÕWIê{zzA?öØc6l H$—ß!½Z·niWccãáÇIÁœmõÍ‘ö3¿ßѼþOÏ>ùù9>ZüÓ¿øùlKt¹Pd|I òâ‹/Ž=úÉ'Ÿ7nœe±é›¯ýL7—j6ƦoŒ1&[ñ³ŒÆcÓ7ÆcÓ7ÆcÓ7Æ“d賞þù–––ðvÞ¼y .ìÿ×7nÜ8{öìI“z×›]¾|yggç O «W¯Ä3‡ŽŽŽúúúÆÆÆ˜\ zwUÓË/¿< -©*…Úyê©§2\7]`YYÙÓO?­kT0ð¯rWh¥ôSÃh`÷³!lÙ²eÙ²e9°²#~´¤ï*àøG}tÈãáĉT–3ý¯œ-I†ä`>ÚµkW¾õí4€àøA›Jb:N|úãθ§º+½vîÜI¥ÔÖÖ®Zµª?Ž? Vl‘“çáþ?±€*HS²Ýñ¾ 5yzx%þÑ䨢¢B¿¢D>NT]]­fIŸ¬JŠž*–õÓ„t0_$eкzi c©Ÿ¶óŽ9ÐT÷ëG»ŒE+耰r1 œë ™Â"¯²Z,ƒ´¼9W¸ê Z¨—ÎßrË-|JaUU•ê.wB'ÀÐ?žŒ–3P £bŒëU„èàX¡üB²Prp4™8q¢Âø"_‘D!°©މ6/4Z #QŽiN-ð©Þ´U¹bÅŠ¨9^ýðå«&6àV˜¡óÈ‘#%;‹hŠÏºº:”DvJPƒgÉ’%ü«1§¢ë¥é(¡\>#‚°­­­êžuNHƒâ#U½¼E'ŒÕ M0Ýux­!-rS»$/ÔñвcÇŽ¥FeR:’  ¶h ÑQp8ñ¡#åSú"§¢Q[ ŽXa8 %r|þ Z{h9™0—¦T‘×\:TVVÊîcíœVDyÐSQŽ€œï¢<òJ"DP':/‰$â0>¢^ÔÙ¨ñ–3ðö¹çž“Wf‘ãf\&Á ‹Õ[}¤ËQ4¢m˜O@(ò|yÓ¦MË–-K[#ò}õ „tˆIä#9¾j‡rމv4wIíàƒæÑ9ÒÔª”—ñ_ÐI𧙿 lt¸ƒtjž²~Ä êi¿Cõ²ÑJI^pùª5à0¾Ö†¢gE^Žá<¡Jm>ù‰j-üUšFCIÎ0ä3KùbúÑî]/]«RoÄ¥íQjQ¨Ì§4³+NwrjEùQâÒ ÊËB‚+Tõ«îÕVÕyPB³©H’áâÑX€–¦â¹®÷±ŧúQ{(Ô†'A™cˆ8d¾R/6¦æxuš!¡v8O†•™6&‘’\i0S®ãH0 Ä~^,'Ü•$” fpáyqÐ<–6¥VeÎLæÛeIx}æÌ™Ø§ŠXhU¢”/j2@‰2%>KlÑ@"™ÓÒÓ²&e<ѵMðÓ;}£®ÜJ‰dÚ•N¥ñšF¸ýc4Ý¡¾îìÑÚù9)@ÿï­}³'-¡ÉåÖ1¡t“Š„h!«´”ósÎèݶ0®ÊvˆB àr‚5 âˆv5wG8¡Æ”œ§{ýœ1è¿æêKÂdfê®RY1½ÓÇà,–÷De SÄWTßH]&–x í“EEë+µoÈL²é‘M©ßÔÔ¤:ÓÔ¤â•:P:I¡ºkrðØLQ]]NBª;‘Ci¢™3¤-ŒÆ¦ÂŸ¦wbó¼†^—„j $} PY|KÍ!\±‚D!«â­‘¡½…Ýäù¿89ÿdxt9  IÇfó4*BD™„àÂcÏŸD ;‹f©ô–©O¶vÔñ±ÑUм?`[š‰M‡fòôNÝ%úè Ñ ÅŠØ0K÷Bƒõ£ÒSš5.××R_dúú–þ‹p·?ßȲõô1÷M›6Qßê¥q™ð]"yûE6M3¨O’úP`Èh”æè0 iÏ|7ma´j‚5ÜaSaæï¬Æ_Hh†[ŽŒIÓÊ[5w¬‘ã>B@º‡´³ ‰ïhÞ3ˆ£û`´Ý*ŒN›FëŽrFH9³¼¾Ú=˜‹B´ËÙPuu5ޤiCuW@†&”%Wx<45°5¼ -\MøaŽD…Ì+óïâö ®méÒhȌ˹LÞòúrHmjž'4‡>²(MñÑX*++uB*ŽêPšÉâxÁ5cò=…¥ÛzŒ'7žèÜ"íC 9‰‘kLžÊ¥ûº&§¦wŒ1CEmmm}}½ž9Ñ-™üLóó OïcLáécŒ±écŒ±écŒÉj²ïFnKKKXJèQÜð6ºrot)Ôè2¹´ä¬5´È–ÚRç²éˆðã,-ºTUU¥· “¸µXC‹l©óMê,6ýØ‚ÆaÕåh¡ÖRÖÊ‚©Ë‡yôËl¾–OJ»mîa -²¥Î7©³ØôõÛñÄ¥5×ú^¹7¶ŒpX¹Ak¨ õ«¼ðíØ:´99賆ÙRç›Ô9r#—>™ªÒ «Ú¾@Ëk¨ò´ðlXp#Wסµ†ÙRç³Ô92½sÅu.³q·&kh‘¥¶é§Ê©²Ãʽ©»(„Î9uQ_ÆhŒày¡E›3ÉLkh‘-²¥ÎGÓÑ÷ʽaû -#ʵ~ò{ï½§í4¯¸¤jnc -²¥Îy©½öŽ1ÆäþE®1ÆØô1ÆØô1ÆØô1ÆØô1ÆØô1ÆØô1ÆØô1ÆØô1ÆØô1ÆØô1ÆØô1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒÉ_þ'ÀrÅ?ö dp€IEND®B`‚qt-client-4.1.0/guiclient/images/splashPostBooks.png000066400000000000000000000617641217451700100225240ustar00rootroot00000000000000‰PNG  IHDRüÈ‚¬ÄKtEXtSoftwareAdobe ImageReadyqÉe<hiTXtXML:com.adobe.xmp Äìô`"IDATxÚì]|Uåù>óŽÜì½ÈB ¬0e ˆàÑÖºë¨ÚZ­³µýk«Vm­³Új'E‘¡ì°g„ìE²çÝgýŸs?8\¨ZmIøžßýÝÜœûsï}Ï÷=ïó¾ßb5Mc(((((. pÔ”ô)(((((éSPPPPPÒ§     ¤OAAAAAIŸ‚‚‚‚‚’>%} Jú”ô)(((((éSPPPPPÒ§    ¤OAAAAAIŸ‚‚‚‚‚’>%} Šó5ŊƬjðd…Š’úƒìÞÃ3l‰]¾<Æt~þöÜN9Îʱ ãQ§¬ þž[b»W«°+^UK²ñ Vªí(N‚¥;gQüW‰OÕ†¼_.ÅDiŠúC\_cØ~®¶-?I?;üÜØO«œÁa ‹vÇr<çrK¿ˆ“÷ýY€ù{©ëÍBgV¸jb÷µHƒ…·' ,­~TéSü×UËXTµ¤UfTõú„þfõ<ýí #*Ji³äcf߇´1ß§ðz©Ð¹ñ˜wå%a x^R™å®é_·o™fá)ïSPÒ§ø_pËúþü JŸá˜ó7xeUh|ã§ë¯5×4ùûº~A§üi•gÍÌÐ[¶uE[¸&—’&>ŸmÛÿ.Ïþòè Zý((éSü×îû79}íÌÔÍ2ÿÆ]à,õ<ÎXj£çµN|CŽatõý½}á·J]O°Yy¦²[Y25¸[Òâ>myhˆõ–tËÄÕí´êQPÒ§ø@’5MdõœÜͲ¬ªœÎï÷ït¼ÆÊÊyüãAúFòIS¾ý#“:‡šÄ+º¿1§KÒ˜G‡„‹œÀ11<­{”ô/x€wT™áÎY Øo:öCÖÎ*Âq\ÑOX&¾³Ö^säFiµFwŧ²šŸ(öu}†Ô”†¹ÛT–?«Æ¦‡3LÆùio|¬(Çi^Wýš¦|Ÿù(Ï´yÕx+nfþ8ÊvǶîKâDŽñ¨Z»G¥õ‚’>%}­~Û" ã ŽŽUÕ3*d• OâFýÛ+uI_×{™Ó<<ϹޚêcO_–͹ü¡‹Ï-nA†.-x»Mf!Pý†7jåQ¡Îÿï˜õ<¡¨êDÏœ$}•‘YæûAw]ªeá÷ó£]23$DX4-xÔm ×Et*¡"íÅ¥ ¤OÁñÑã¯ÍyêÚAÒ®àP‹¬h§fJ4Žeù~™Ö™O ç¢ÚJ»|]Nû¡*÷Ô>Ç1^%¦rÿ¾?^bt:0‹ÿ^±ÚÙf•õÏì³,#+!ÁV³©÷Ú›Ë+*{œå5FBÐÂ2ߟ¿"ÁüZóƒ ÷â‹CpÒl|Îåa9MÒ/wtošJë;CgäRfëäßR,LèîR9Þ¤i¢Æ0ªIS¹ºÌµñ)ùXÞÙ®pÌ¥ÜÓVXéb$ÊœÓü`j¯wôÀöǧ%F‹z©i\¢ú?@ú|oŸU¢áWøý"Ea¼ê÷¨ôáAVÌ]Zåyîãír×ÇUîO*Ü÷íèþ`Jp"ÍéSP¥Oq\V[mþïÃíOüh¨½Ô`VÍoP¡>ŸJ©*smzÊzÉŸ„¨Á=Împ)7nnÍ+u¨’*p§ DaYV–”Èšƒë¹(=.â[¦ATQÕ8•ñOïè“x{ù\BVÑEãÙã¿‚UUEVÏÒÇ›Ií’Ô6ÚáQQž4HäÂÌl¨™X‘;%¶² ìš¡kŽyw4z½Š68LØryXŒ™Ê; Jú~°…Œ|á®Ç¯Á·™,&"Ô`^ÏDk5îOZgþ™89ٵܼͣ©eW‘Cr«<¨Ç?;ÄêCÒCª¬}x씘oý…TÍŠÚÉú_q¥|æâŒSÑÇÌ1zÖTg>mFÊtyU‹A½ä ïë‰ÄÝ’j>•Oñì’î#Px N¯Ú)©ín¤lâY°ð!&® ŸÁ¨šeŒo„ï+)çòduNy³wcµë`½çh‡l×I_ã8Ö"r1!ÂÓ„~æqQæA!¢ÿÏ9fn‚ Z±)(éSœáÑcžX¼÷ñ«G%(¼É¤ž:cV“T¦®Þ½éIËŒgø°diq)·mnÛU`÷8]ã«§0¾Æ²â‘«9r@Âwø2œrÔLz–G3~„ÕάX;]ò/¿¬.XÝAบ6×¥‰¦Ë†ô 2dE»uaifÿhÄäêðXõž‹ø›³cNDÚÇõ‹ò[¨DãX®¤ªù«;•Û•œcîµÞŠfo{·$É*‡}Pdø[¿ø‰%ÐÄ>CÐÔ3˪œñ£œÜ)¹N¯òøº†ÑR—G3Á£ŒYÅ·Dú¤Kd§ýЗo¿l®äti'øWóñ¾à™@yË;ÂÔ»?úÃÛ|oÒÔäÛ®ÿý|6”¾… ·ò²r"]#ò^‰;GzÇǧ¼—LßÒ[ jåΦôyŸ‡`ˆÈÖ´›`÷ Ì©aD …‹ T÷ñüÇ1fu·,zþ&DF±´„È'6kÐÚýïí>¤¯{=˜E=1>·¶Õår(ÉÁ‚Û+û~²ØævœÄŸÉ°8?«bi‡7:ÊâöwuE›´b_%} JúßCçßT‘¿QeE.Ц):ó+k TL]eÍþí¡LTÄäË¿ÇÓ†Z¸p› ˪Ohk³ ɼâ8kh ²Zx€àæU_¦ž ô±ògTú¤ €×”ã¤jºì=ÇƒŠŒ(tã'k*ÇꡆÇ#5´œ5¿tÓ%YKö× ™”ÙÙyÜñ2JV¼íPeÇIÒG„aã™!øQø™FWyqmWj¸9ÜʹxÞçfX“U“ËZÜz‚MÕ=ʼn=·³‰ãÃÃSÍjÈXO åäx5*ȼ¿ÉNë-%}ŠïiïêÄ “ÙˆÎíbLf.0H®«ôlüÜ›¿“ëjmm·WOøÉô ³}[B1ì÷4lŠ>!Dˆ…ÚfÍ"ç•ÕÀS I.ë>‹Ò×3«¥Dš\Nѽe*-c϶)#D~˜•×|JŸe¹ôx«£«Ãë:µ#WÕ2¢MÝ\G·×á–9Vƒ 6ŸÕ;ö{kM8“@Á,œDr„PiåÔu2£ã‡#“g%KïÈŠh::n‡‹¼[^Û‘bᬢžù1 |@€h³Ê’ªxU—W•dUQ4EßFwi"cÓçš± §ägYx‘ð`_%E.½@AIŸâ[Â{`“ÚÕn2ñ¸™(«ÒÚè\þ{óš³[0[:Ì‘Qóf½ðO•åÞØr,=Â|EVø÷ò¹ª¢¾¹ª¦Í®XÌܤ̰1!íÝÞÕ»2bÏšÞ‘ßR÷Öªª;/>¹I¡Û-¯ÞÝØj÷Æ„š“¢,,Ë®ßßÌ fW$Ed¿ß¥_“'ßJÓÌT9Íè6³ê_—m:Ô‰oe1qúvæ ¦T„‹ ng­ˆ%Xâñ<ªWïp`e²ºœªjZÇi-1(ˆa(ëSPÒ§øÆ«K¯=æÍ; 9?Ô FYÑÌšlº~V¯W:ñûËLÖ€w6¾ò¯’æ£Ý¢¨¯ds¤ õîWóßy`èøþÿïƒ[e2°ÑoÝL9 çò<+âãõi±†W€ˆV¬gX‹FFvK8=³¢êSÎäÓ]QYÙoµQ†åUÅërŸí+w;¥ÆvYP9Q06ÆBtà‰ ;Ù  o¢"Ë~yVß=ñ„³AÉÕÛJƒ‚ƒLð@¾>sMcçMøÊCÓ}ÝÙšd£ù2û~ÿžœ:Ìqøtœ>%}Šo˜Z©¯êþËo¤Üƒ:ë™O°°N9°_˜¿Ò×WÓñ#}|®1Ä(#)Ôª:xÎõÄr<,»«”q{‹>ÙªgÔByâ;€võPœÊøÍǺ^|TÚw@ó(õšÌNar@ »pehlü¦ýµ÷<³¹ŒÏ€eòàr¸,¿éž—óŠj¿ûÀA}Íý‚Šqeò8Ûd+ÛØ`–‘$ÿœÆì+ê<½på1{u³ÆÊRÏ‹÷PúªÚ£«(¡AgûÎkw7*²†hãäe%X°÷OŽ<×5ý~ÔÐñÑNÕ{ò-Íã­it­Ëmþy9E+«·Óœ>%}ŠoSikî~î7ÒŽ=šGÒë4«rüÁAé{•~俾ŒLJAá‘ã\‡W·žQd}ç?ß™×”âƒw½¸¿øh×w&}V¿ÚÉËœ}rÖ” ÕãfÈ„¾‡¨)_îhié8%!ã‘Ô·VV³’¢ç‚ŒË»è×Ný¾ƒÆC’Ž?Òpæ/P×âZ¼©ž…×QO^Vó¸'gF„úEJ_Äú¥w¬óåãÂg·îóˆ15ÕÝîxá_%9­=v0>NR\keiÙï^\ÇÒ%×((éSüÆïîì~ñ1Ï֪˫iàmÆxè¹IÍuªYÿZ3` )ÍûÕ‡÷¥Uª.;§÷'ò–è}¹0·þîöW5:¿[z‡=“Ò?G?ê„‘‰Œ»Sü¤´$·5Ûÿº´¼µË«ªÍž7VY±¶BqzøSE·æ•B‚L=”>sªÌW=Òº½-{ËÚÝÞ“¬¨ZM³óÑ·òvè)£ßnR±»åªþ¿ŠUΠôýÓJ¿¼y2ë¬fdÍ/x’ rýáo 7ÔÕ¶8]ì|ÿ`¸I±»äú6׿ƒMϾ—Ûï·ýá/{¢CèêÊgÍéSøØÈaï~þq÷úšÓÅ‚ÿŠÄ¬o«<»wð’5 C‡ûŸ¶ò½{f^÷J£»?/˜}þÁ3­(·þ®?íy÷±±ý¢¾åÒà98ÆÓ]Ö_ŸŽÉcDYWuÈá¾­QŽót¹.*¨¯î¸hX$üÅŽÍ[v×Û»½úŒWð)ËŸ(ÉñŒâvyz8NVüòïú*ÿù¹u÷?íž7#iìШ° ޤ¼¶{É×Õ9;ëdIáOîYÈÉ^ç˜tiƤSe5…“5Ž÷?pJ„‘9 ßƒ7øËGÇlÁÑÆò ÐûöÕü®¬sèˆèq£C³“lÁ"ÏÜèRêê\••öâ²Öª£mnŽeXší§ ¤Oq‚u»ºÿú”gíZÍîbÑ`|}b+«Ïc:ØÞ¾øË¤ì3,Ÿ¹êÃ{g]÷j»w Ç þé°¥êUî­¹ÿEîoŽŽü¼<¿qéŸk•`ÛC·fÿöåk`¼v‚.y†uv¹>_QŠùMf“ȳj0S©pN9ìÄh„6ª×í=å;àãTÅ¿sW_h“á n°YE‹Ñ‚æpJ’WÁU}»¥³øÕ?ÞÝsž}òO±Œ> ô””Ñoï»j÷þ—w—´™,!Æ1󌷳eצ–ÝÛ¹Á*ðUër+^—.ûyNß?À*€óy—ÓîuvÐZMAÓ;ga|Éë|ýïÊ•L‡çNÕer¾$>¯1¢¢¶w',øWúÄÉg»BjRìŠ÷aSŠÉË©šžŽ?ñÐHóÈ»¶Uþú¯û;Ò·RúzJý´Ç9rúÀÏnš93[óØ8 Bf/+{xU •A 5›I`d—èÊÿÛ¯ˆ õdËñ+Ëš,[̦ŽÇ—Õ9å¡yÚL¬dåqaOw»ÃÑåäÙ"0ú$,RFïPÝí…ÿüÓ¥YƒRNK¢ù’øþ¹§'³ZÌŸ¼õË‘)MÞîZ}¢Lê»2ϨN5I’£ÝÙÜÜÝÝjçîF²‰šE×ö,#KîΊø€â6‰Vl Júg€êtÔ>ñÛŠ-ªml«S˜·Tí–ªÑf³~ð÷G֬ݱðÓõ‡ [Û%IŸ¢ÅGG {õW^EŸä|Èz¼Ï±Ç7ÞÕôå™e•Z†‚’>E„(:5¶Rc9†=¾Û:„¿ £–¡èÕ Ë0PPœ­­š~Í…5‰bHH 5%} Š^º´2%} Jú”ô)(((((éSPPPPPÒ§     ¤OAAAAAIŸ‚‚‚‚‚’>%} Jú”ô)((((éSPPPPPÒ§     ¤OAAAAAIŸ‚‚‚‚‚’>%} JúÿcȲÜÕÕE^:t¨¢¢¢·ÿ"ÞT гaÍš5uuusæÌñx< •••—\rI\\^ 8Pz…ÒÑ)(((NAGGGMMÍСCÁòŸþy`` x2<<<99¹¶¶öàÁƒ±±±ÿÁÁÁ·ß~;Uú? Ž9R^^>aÂhÌÜÜܪªªy󿕍e¾G¬[·¤rw8fB|àyÞårY,xI’àRRR¦OŸÞ»~ÿä“OÒ{LAqžÆ‘eyÇŽ6›mÛ¶m`ŸáÇ—––®_¿:tïÞ½V«5,,ŒÚê?,Œç={ö¸Ýn§Ó ÏàlÏZPPPYYÉqÇ»Baí¦¦&‹‹ëE¿‘¦w((Îwæååeeeµ´´€†‚ƒƒACàšððpˆýÍ›7CŠ‚¡jkk_}õUP?µØéѵ··Ãbç(³sçNкÉd‚UUÅ‹@`ðÐÐÐŠŠ ÈQOJfžG1\ö¡‡êEî–ŽÞ9^IùôóÃ7ܱø¥¿íPUê)Î 9rT^]] ƇäY,0ÑÁƒ·oߎY–…Dmkkûàƒ:::¨Åà—.] _ˆ×[¶lã\¶ly >òôòÍÍÍx†‡¡Ã•Âì }<ã"uuuþŒOƇ«xíµ×Šõ³ÐœþIì?Pÿêßw•4#*«hu{äÿ{x 5 Åÿ  ïǃtÜn7xt®'LRTT´iÓ&ŽãÀøÐ›ð“&M‚Wøè£î»ï¾ YÑë – ïÙ³ ýË/¿ìß¿?̘––†H(((F+..ž0aˆ#üÏ0`@YYy ~G8¥( ì oŠ«AËÃþ0õIÉÌq¸ ð¸øÄÞb"šÓ÷ |¯òÖ{{Ÿy!§¥Õ1"+Nc4‡Ë[\Ö,òüÈaqÔ>ÿìØ±£¤¤Ôo=ð>X,""ªsíÚµ ’_Æ ’‹@Líb½ˆ†¾/8HûÂÂBXi×®].— ¦ˆ‹‹ÑGFFÂ/‚Ä÷ïßßÚÚ š^³fMvv6âDØ'z<¸ øN³»»*þÀõõõ áááà}âW Àæ8=33×ÇMÁ‡R¥ß;Pv¤õÙ¿ä5…[î¾mô5ó³öæÖÞûð •eß|wwB|ð¬éý©•(þû8p`MM ô¦ÅÐd~ee%è©¢¢‚¤ ðLŸ”©¶ÀûW\qEoBþâØ±c$™»Á\D›“ ú†S„€Å`¥–––þóŸ>ø ÞÚ°a<„¡ßq Àé¶··Còƒë/¾øâôôt8`\0>îŠáîÀà`^^Þk¯½FI¿`ùÊ¢^Ý*y•«ædÜyǸè(ŽÉN¼ãŽñïüs§É,¼üƶ¤ÄA£(Qü×àt:¡.=j0>´$dìgŸ}–ŸŸzÅÄÄÉA`|2¬‡ –””^3F˜\ ƒƒÜ!áÉ¿° ɆÖ;|øðÞ½{a.ÍØ 2Ï‹/¾õÖ[á#W­Z³“·pJYYY[[Ê9ò€ÇeákKKKq0>>Œ Îÿö[ p»’ž{yëšu%™iáüjröˆxÌë”;¼ê°ñ®›²KË/l°ìsÍyõÅ+B‚-}Ø]]]åååýúõ‹ŠŠBT»~ýz°Æ´iÓBBB(ÿ÷ûƒÅl>€_ðìõz-ZTTT:+eddÄÅŽ‰ñŒã £ÐÐP8œþᇂË.sí߿ӦM0¬D’]p„îIÿ|ß¾}°Ê ÏpË–-ƒG…ã™O‚4hÐc=f:Ü0 Æ'GhƒÃ÷¢Ñú(é•4ÿþ™ -ÍÝÿâ¢ë~¢wæ,?æ=Ð. &FŠvYmñ²¿ý¿™÷ß½˜3 ‚ª¾üúö'þoF_Í‘¢®õÕW–¨ÁW_}5´$^TVVæääüùÏnjjB[JKK»sÄß#TU%)æoR811®—0IåoذŒºÅÜ{⦅Œ/½eË"óAú`±ŽŽŽ¯¿þº¡¡¡¸¸øÂ!}p.ê°Ûí&ÿ£Ád¨eccc^^äé' $(uàAIärÇ-»þúë Æïìì,,,4n á}\Μ9ð(÷ÜsOo1×…Ø‘ûŪ¢ÇŸY?t`ä+™;nL¿ÍÍÞÊ]`ö“,^UËiöš96ÅÆ[M|ʸ]ËÂÃmn§·¥Ó3,+¶/Ù¼@ôê=%::-zU9,, Dƒ6x qq]]ݰaÃ(w+–ß³gÏîÝ»?D6nÜo v>|ø¿=*7† ‚€V¯^ÝÞÞŽûòì³ÏBæ“bÕÕÕmmm„ññŒ[ÙÜÜŒ›…·†:cÆŒ ÄÔ wÐúqFãù   p1¼´´tçÎ0; Kž>' Çív;j> H1à:555wÜq™÷€ÀkÕªUP?ãã¾  ´\/>>£·4 Ké{½Êó¯l)(hüÓã3'\”ÜæQ~WädeåW©Ö:—òr‰cD˜pYœ¹Î¥®oðf‡‹cG_víȽ›Ê¢¢‚ ÖïψåËõìö ÌA F¥‡Š$9bè4$ÈI¨Ôoh¨—^z %gÏžMÙü¢¶¶¡,ùÑGeeeÁ’‘‘‘Ë–-;3š1===33óôråææâÉJ¶òx<¸AóæÍƒ 1œÊ‘#GPÀ?½ƒ[†¸Â#>ÞÀ%é ‡w”$ W€aɈXâ>áYqË:„jO³“Ì1’ eà_W®\‰ã¸>ØŸ¦wÎ;TVµÿ}Ážä¸àÞþ‘Ù,lk•–Öy.“L *œ{gz@µCyûˆsD˜8>ÂÔæUÝ*sÃü¬ÊâF‘eS"BW­*JJ ‰Š´õk´¶¶‚ÖÑP¡A.à pyFÍîêꪪª’e™Ä¶hÐ> ¬ØØØC›)üA¸Ì ÛnݺÆ„ê$Œ8;O™2…,˜ƒ·À÷Þ{/üA‹8plj$@Æ8gÁ[Å6oÞŒb†Ì'w ¦;xðàáÇO¿rƒËåZ¼x1Ü¡q„¼££cíÚµðø—,”ÿJ–'B…÷×ûð¸;0¯èa|BýˆqqÊþýûQ¾ÅHàeäŽH€·à¹T7ަwÎ3a»¯vCNÅO®2gv† p‹ë½5vùžtëáNù³£î’Rùw+œË\•hiñ¨Û[¼ñV>ÂÄ9í¢±I×'&†ÅÇmÛstüØ~½× ˆ§ÓY^^N”Qˆ¤Ò“‘`(C]7r hHÉÉÉQQQ „Ôßψ+V@ñA!ÂȰˆƒ<ÃkB9’yüdêÄ#ÀÔ©S{,œ€Ûñõ×_ÃC$$$AÈdggã8˜}Û¶m$3Ÿ^oÙ²eéÒ¥^¯;vlß¶6lÉ;aU2{v×®]ð¾döì7Þxÿý÷_zé¥&L€Áý'â¢þÃh---ííí°*áq<ã~1¾YÐÄ=g`h|R€,s„¸æã?>zôèoØ[CIÿÃámkw¹ÜÏqàwIR Kšð<ÿÊÁ‘‘¶nI]ß,%[ØI‘¦÷*!𹟦|QçÎïoN±zU¯c,Ü¡¼[é”´T›já#ú…åí®NhÎ/iÊÌè•#8ÑB¾üò˺º:ThĤ¨Íœn¢žŒ_]]Íú`œˆ×¨÷p ³ 6Ìž=ÿRŠ?†dØÉ,“á7  0>hžÀ¥œx«¾¾„Nˆ†lBúWÈT rÜ2°[cc#n1†Ää¡$Ü£œœ|JLL è~þüù½e®Ðw*íàÁƒ •“ ?¹»»®”(ú‡~øÊ+¯$1,g@ÖS#ŒÓá¾äååôaO¸ÒH ü›››ajÞc îb„qp®¸ÝGðÍF/ MïüW¡ªÚÆ-+VÕÖwÛlb\LPVfôÌ‹ÓìCEsœNa]²VfW&Eˆ^õ³£®«­NYûk‰}vœ9ÊÌ-¨p¦ PúÛš½¥ÝòµIÖ -î’c­üˆAQ•Ãâ»»ÝÇÇ–6•4÷FÞ¿mH*=a|cøj?ªþéC¼ÉÐf231õË/¿ us¡?À&æ×`„¶¶6#É@Èš0þ±cÇ@ÖÆZ‚´´4¼‹ÓßyçÇ{Ìx ëEhERm(CÜ-Iõ\o0¾1RAHÿ™gž1òþ}Þòûöí#k }°P6dœ«®ºêâ‹/öϼ9bd2ç–Œí™8qâŽ;¿Âõkù›EFÄ27ϨÿPNˆºÈÀP\¢—ñ@߸ý›¶T¾óá~Gš3³ÿ¯îlµš UŸy<ò[ïímkvL¾tÐàAÑ#BÅJ‡ÜàRoI ØÒì­q( ²­mðæ4y’dÍm—–uý¨Ÿ5DäÖó‹ì̳‰cêÝêü+2ß|c;'òùÞûxÿSͰZÄÞe%¨¨H4CãuO¦¢µà-Tz#c–{œ"‹‹‹ƒ2ÅEèðM555›Æ¿d9¢ña10>,Fßßh$´R´ËöÙg×^{­QòsÕªUà¬éÓ§ã6AuBæ“¥Öüéž Ó„ð„†Ì…jŒªž••…@¦Æ)íx#°-Éà#“›…S Š ññ)¸_Ó¦Mã#Ú ¤ÿßCc“=÷`ý—kJjk;~4wðµ?n±œú‹XfñòÃ_¬(øémc‡ôˆ°òÇܪ•gÇFˆóá&.;Lü¸Ú™f®ˆ7/ªvçÄÙ–u·zUP?è~C£'ÁÊ4¹í–ÛÇÝv뢒šN“‰ŠÜýëû'õC2PS¡É´rTkCãƒq¶oßV"‹FáyРAC‡E÷ê@Vš=z´Û펎Ž&½[”ñ””0Ñ›°'a|’ÇMTWW—––[~ÔoƒÃžP¦³gÏ&SáÂÃÃñú½÷Þ¯‘¥@4$Ï`0>É9à"øÜE‹áSÈ8t<Ãõ:ú€ÑÈü)‚&ÓÖ €Zm¬q_»vm]]ÉùƇ‘qƒÊËËQùóóóá5}ôQ4Ï?ÿ<))iøðá(ŒVƒOAØÒß½{7¼ûå—_Ž 2dÈõ×_Ïø×ö¾ˆ¿w}Ý£µ%å-åGÚÊ*Z*«:ÚÚq‘—_š1ÿ™Ù¶]w«Ó)kYãY&H`Áïæh}¸Î®½G[Úœa¦0Õ„-í–G„‰^m}£g~‚uo›wk³’{‹÷/ÅŽù‰–‘]QçŠ2ó—ś풖ÓäÉ S„gž»âg?û`ñ²ü‹§¤Ž™pþ ÔƒJMDR㣑 m,[¶ oGP¿ñnjj*Ž{½Þ3fíÉ’5kÖ È=÷ÜÈ[\JªÏS±k6,û|lž““º‡ ‡µcbb’““{0>y‘ >9r¤ÿägÐÖ]wÝEÖ„!ÊøœErÅðѱ±±`"²Züyóà’Qxüøñ‚¯…A®ºêª%K–ÀŒÆpØ'**jÒ¤IàèÇ“0 œúög|öˆˆåË—ÃŒ8HºXpA”Çhܸ´´44 ¼À¹p¥ð1{öì!©¤^Ý_Ò;6QÁw\²ü𪵥EMäÀÀôˆñÙ S¦¤ ª{Z—¬;¨x‘Ñâ-|„™ Y¯ªô943Žíìòüíï;î¼û¢èPK§¤ðlKmóªÉÓ€ŸÆã“„2Éç°6ŽWUU Í~Ýu×ÝtÓMàP‘d­.ƒñÉxÙÊÊJþÖ­[GelíDüîY¸±±'‚’`C|ôW_} jkiiÇÍÈȸ袋.4Æ'³m‰åI' ¨™T]cÅéŒO;Ñ>@²äææ"2ƒÃk’Õ`sX;>>>%%… Í$Y¸a8o4%¼EÖí¡¤ÿÃÂdÖo®6$ö–ëGš âó:•Õ ^‡¬f‡©6¾Õ£wË8bâÂM^x5FR5;<ËÔ6t½ÿqnñ¾£gf$E¨ÓîÕ†† ‡;å&:?Ѳ¡Qï×½»À¾v郭÷ J ß)³ÖtÞ’çQÜ­ D¹Ñc“vî¨nmwæ6ÎNˆ>ß·¥†‡ b|Ë’4 ÉÁ ç0þå!ÛAg$™€Öb<Ã=´··£1Üzë­¸Ž@a˜ ëɰeh-Šø|üDmm-jÇŽhWßd‚^Ð â„ü$ëEÆê€SȤ|ü|Æ7€ä‘G6‡®¹ B2Vw!Ï8rÅŠ°6d)$ “ë>|¦ƒ®LOO ¡oM‡ÊšZTTdèPcI)æD÷ìÍ7ßì ¤ ‚²ÒÙN² 3f̸ãŽ;Œò`ÒSbÜâ}¡ÖQSSSáPŒLó)--%)#²l/¸ ÅbccI‡í!CðÖòåËïºë®yóæ1$Hð#€ a05Ä8j£ÿF„ñ” ,[¶ Ž–t³“ŠJæ!’^ÿ…¬7nÜÿAVcF|Üñ/¿ü…H•þˆâÒæû~½2"Üú胓¿X]\SÓ~ùìA`gªím“–™e¶òìÎVoS¶p`pz³[iõjx7ÔÄ›8FàØôôˆþ)aƒE¿ðܦ¬QýâÃ,ø`|YeÊìðÜçµî]­^‡¤u»äØÐ³I̲qÉA¦^Ü×­t›Ä­ïæƒÆô BáÐ`sBjDÎæŠn‡çö›FÏ }Ô]ÔxÂøÆh?²øÞ½{A[wÞy§1§³³³ÇL]ò‚ñM|¯©©Ù°a‘Ÿhds \é FÓ‚À'>m¯ÁÐeIII\½qàðÖ¯_ŸC:oyX’ëÀàþKòЕ’ü³ùÄÂ`óððphü«¯¾ž õÙ·onI%$$@Å“* -²éxß³g8®Ïϼ=GÞÎ’dxÈxÒ•b0>ÌEÂ,Bú¨ð›6mBí%À‰Â’dj®1™%q$''2Åßc¸ DrS§Ní½{Ôô‚ïýüË[»ížq£³2c¦MNÍÝ]µaGõ”‹’m7'Î\Ú-/®qEZ¸©Ñf—¢uÊùÒ  13X„Þoóª]’ªi ~Îfâ%‰øÕ=½ôÂÆ×_½*ÆÂuxU„#M¿Ø×±³ÙÃs,TV’‰‹7qý¬|„…ÛÜæ) ÒÍäövU5ïûºpRzȧ'*ÐÜÔªÏäXî|8(æ…=qàha@2ÆňÌ'ËsÂ’ u¨Ÿ&%z¿¬¬ ÚeÁ‚wß}w/ŸØ *ŠÃ)1,STªO{»çgã*iZôÎŽIcûAnh×ßšŸh)ì’¿>æ‰OŠ2ðl•CÙÑê Øä>ÌÄYxÖ!k¤ÁñøñÉûóêÞ~wϽwƒØÜäé’´ÂNYc˜ ãÇ™¹D+fæ–7{ò»%3§wi<Ë_7©*Äúóååw%™?Ú|d÷®Và¼wÂyNúsçÎ5ƒÐÁ³dR.É€D —°råJ4Œ¶¶6³d i6F/.^:tÏp {xĤ€Áõ$é+ã" 8óÈOÄIõ”——ÿùÏ~óÍ7Iâ»—ô–!;nœ¨ùòË/kƒkŒ’ø½»ví"ünt¨êG†ˆ$*%A´’ž^£ ™Š@ô]ïv» ‘ŒNŽø§#P¸0IðàÁp~Oôàê3Â/xYÈy¸ÞèèhÄ^Û¶mCUQQA†!Œ5Šì'L§k]@S|áˆKè‘ÓÃEKAØŠ[ÐKI¿¤wÚ:œ¹‡ŽÕÔvf Ž6$¶º¶ÓÞîìöjÙY±ÑÎ%3;[½Á"wy¼ä¾½Ù ¥bb‡‡ŠVží”Ô¯ªj T¿À±f^Ç)rì˜Ñýþñö®ø´ˆB7ût‰sw³Ç­há› oá’ƒÄH›øe³ç`§ÑŸaÌ d‘AŒ‹wå®/­©ïJHyö—Ìœv¾+V(šºº:D¸ÆÂDHB³@Πr;|› Iæø/ÈCž¡ôÑŠPõždrŒ>^RžLR/,,ãŸq-¢yA^ˆÁÑfÆŒÓ{ó€pÉÒu)))†Ø;ƒ}ðóA+0;´9‚¼ëÏøDÝãøºuë~ÅÄÄà™,¯ÖcÎ-ûkÂmeÔü¿ÉA3¾Žw8Œ v!>EyŽeF‡›ì²¶ªÞ-«ÌøÓ€ áˆ]>Ô!®ã¬|¼UÏþ{†Ð½‰gqÊ‚ö•”4ÞQ1jdÂ6Y”%5‚gSL\²M [;œÛÊšÙeK…Ñ“CŒ…e"6BääNg˶¼dæ€çžœ5 =âü¿Çyyyàt0‚±*,¨Bõ›„duñ43?IâlÏa$ Æ'ƒ|ȸ&á¦3ÎÿÀ‰hKh“àz¸œ™3göÞ1'd,ü~LJVÓ„ÑÈt*X Œö'’¼‡%Ã1!ðAF ,\Œ*12oÆ’/¸&Ü-¿Gädp,‰Háž§L™r.„G26°âK:Úܸq]]]999xÚßãñÜxã š&+ß‘…9q³vî܉ €ÜVÔÞ´´´¸¸8¢fzÔd€3(óaôèѽQµôÒ ¶©hsv¹½n98Ô:rX\C³l_PÔ8sB2ôûÁvIcôErŽÙÔä=bW2‚…Œ`Ñ¥0xÝáUÃM\ŒoÆ–KÑ“<­neéâƒ|fÎÑ]íR­` c4hüä@Á£(›>ÏÍýdOËöRÛ¡*Ö$( Rp ¡<ı‘!–˜I!©¾kLX¨µWÜc¨Q„·;vì!à%Yxİ`%’dð—öé@ò@¡U@¤£1E¦ +à²S[·nŧ@ü¢9‘žÆ3ò¾ÑpÝu×Mž<¹÷r h ÏIb‡ WAÃþÄÝCà“ã¤ë;99dÍø6KéA÷Ä‹ÀΰíþýûáG϶èÊ@™vù€[Ó7FF}CîV?5t£AƒÃ°pÆp·°, ÓÁ¿þüç?‡a¡ôkkkµ6q‘.Ž;èfff>òÈ#7ß|3Ù5—Ü kùùùp± }´¦ØØXJú?ïïßWXPÒ4szÿÁƒ¢7o« âYKTPL¸5)ÌϬoðtËÚøH½ÿvw«TíT Û§D™ öÁþåv¹Õ£ZxEEnÒ”ô ­Ò?œ¦Z^ŒPÔd3‡‹hœ¶nÁVç¶³ª¥%…Z¢m,#‡¥ÆÚŒ,°<aâ¢ãCË«Û÷/?0cjš ô‚ø"µ¡+Z"\2¼’0…ÁJÆB5º{÷îO>ù<vÃY¨âhKþŒ2GŽY¾|9Bc4'2ŠBžìuÆ êp.T-ä––4ÑÞ¸t ¾?Y³>uذadt„¸¿1 ÀŒ„5`¢’’xb˜"$$ÄQ˜×ĕ׭[WJzÎÉÖf§ ²-Ø îTå¿DsŸ~ûš5kPÁ¿ˆe‰÷…¡PácA¬$$}€ª˜žž—€d§-’çA-…[%«+;ö÷¿ÿ=é¯B\–¬ØãŸÐG=GyÒÑÇÐI¿wôøg µˆ*ìX]üãùYÃFÄó²¶õëâ!¿œÐ%kvY»8ÆTåPV×{b­üûY îóÚ¥E5®^ßð¶  húrí^5H`C-üÈóˆFï1¯–láâÌ|l¸nc‰;¯Êj5͹<3ó¢ä6E»ubÊ£{ÛHrL oZ–Ês_¼»Õ¹³ü˜À•–·Ó+S§N1bä "SÔZp=ZI;7ºd‰G…ïlß¾Á¥—^:hÐ ²L›Ï-¸æèѣ˖-CƒAËcõ Q¡0á/wŸ®Îp.ž7üñüÇ?þÑ› ã[¤ðÅ_€ýçÎK‚\zL¸õw¥08ì¹råÊ¢¢" Œo;b æ!™´ªªªÕ«WãRdôã[ÔvƱáгà¸ììlÞ¸qã7Þx!Ðý1P‘ÈÿM¯HÈ¡C‡È˜1؇ìO 7°aÃØ×ùd¡Ø%Qzè!c”-YzÖŸñáNpËÀûh;v»ý–[n饻F÷ÒGå¿dæÀý»kRB 7ιdàÜ9ƒ^}sg€À~µ¹âò‹Óqw·zÃLÜ]é]’¶®ÑSaWF† “£LªÆÔºÔ­Þh3—jÓSü^UOò¤òCCD³G‰3sð"×TPgâØì1IÓç±Z„Ù‘¶¿¼ºµ.=%6&ØÆh$r†ådÕ Nº(9!¾7å£E¢„Þ_ºt)ˆfÆŒdä>é%\ @«â8D=¥& áZYÄÑX¯ U:´­­ íÒþÎ;ïÄeÉÜ"è,°›±z€ÜÝÝ]YY‰‹>øàÑGí•-Ç7,jôèÑð|x 6‡­ÈÚÔéîV²e B"¸^8 HËð0Dè’%KÙùäädHT˜w·ÀéSƒ÷ñp àÂÃÃç̙ӷ¿wíÚµ`v£Fã_AʨT‡&Œï_ë M@úðÓÄ€°Ù‚˜¬Bˆ«AÜ- çQ·åÈø˜¾Ÿ‚ ޶—°×Œí½xJêîÝ5QÑA‘1A˾,¼ùú/Jºï׫úEL› :+ÖÒìQ¿¨swHê˜pÓØpñp§¼ÂßÂc,¢[ÑšÜj»$‡ˆl¡KýG©ƒ÷*q=ݯ“~€>mWSµ±—ÌN Ë;PÛƒ+Ĩ©6ž 8Ï¥‹áÎÈyë OÌè]wõÿÕW_éddd*‚â_Oš4 ‚o½þúëøwöìÙ¨ñ 0()Ъ;Z Éíþ[’Ø),,D›q»ÝIIIÏ=÷\jjªË4$y&º­—B³$þ¶WQ‹æŸ~ú)Ø™Ì@&û©’¨/3ÁÃÁŒ ²Z2ÉÿSsÌhjŒO³‚_n»í¶±cÇ’A;pظA§§8„ð£àý÷Þ{åáÔû0éð¨o„ô ™Of– ÒVWW÷`|r j2ŒOfá’Ĥçíô ÆÇÇå(äää!P1ÞªðaÁ‚·ß~;%ý&‘2$Æjû%†nþp_C£}ü˜~Ç'mßQõÙçù·^?rþH·¾zš¬1[š½nÔI¬ž ¨KÞÕ*뇅‚ý93ÇæµxZë;EÆYÄ(+GRˆ8qÆ€ å S3¢Þy{÷GÿÊG¦f^6"”elz7,r¼Àm:ÜPSÒXµ£ò•7¶?ðˉ½.#ñÆo¼ÿþû§à0ïâÅ‹¡Œ@7{á<ˆ¶À¹¤¤ ƒ,HK¸ž¤w ¥#uuu$Ž{ê©§üŸàÄ=°'@Ú.KZ >ôšk®éÕz…1?þøãÆÆF2A”ñM¾…#„<©ô œ –¹þúëeÂÈ ÌÆê=O‘ݽÑê~÷»ß‚ëÕ€õ^{íµ… ‚|AFdÁ5X.søðá¤Ðž õòòrhIœ¸=²¨Km°@Ið£$Sñë_ÿºÇÂ^x—Œ—õ¹5`1„q(?þü>¼‡Œ³lÙ2ØlˆHöÅ…M@Ó¹¹¹ÄÀò¨i¤?œ,ªCBøÔ˜˜² :»lŒ`Æ §ƒÄÉt-ÿ=Îp¼…™hFÆÕà?à¿{ïšá½‰ôƒͱqAŸ,Ë7›ø•_•üøª!ýÓ"®?ä£EÞ{w÷ã^ Q?:\Ÿ“µµÙ»¬Ö(ÜÝ? Üı+W» “À â“múè·Ê~‘SCä83b悇ªmªsÚúÇòƒúû†ë ÊØX=•Æ1±!&..Äb ±NyÃOFôŠ.Üs$%&Ožœ‘‘ñõ×_—••Ýwß}¨Öd§Óéœ5krÝuס‘ñ…dC]cÜŽ€hH®ÆŒ=´Ø† ÐÞÈò³Ý3xq9ŒØ{Gïø<{ÿý÷CÝC¼ƒÜÉ´ ‰'nÛ¶ d¿‹]vÙe?ýéOgÏž½fÍ N×Èþ›OF#ú&í±ÏmEE‰ÉüI^À…ಸào~ó›¾aϳ„BŸ9±aVCCŒLF\}õÕ0jæþýûwïÞMŸ; ) okûã¸Hù‘"ŒŠû‹³ºáæ8pàùçŸ÷ŸqMIÿ‡Åæ ùté¡¶v·×+ÿãݽyvö­7d¯^[úåÊÂù?6$=¢Ö¥loö‚܈»·¥Ù»®Álá§F£ÃDßîèh?­Û5ÄÄ 5¹epÉ*²9Mž·oâB%ˆUm ¸žÕ5¾ÈEXx…ç ìC„È ŸÞ8rtvbhBhþëk^sÍ5W^y%ª>Z9¶/ãHTTÕc,¾F¶NÑ "ö~ù¿qãF$³®ü•>É«ÖÔÔ@j¡™¡ý@é¿òÊ+½z"€D®¸âбcÇnÚ´ T‚\²d „?œ(Ù¤Ä1räHÐ71ˆÿ®ô8=99™t{ôØý åá?z,ˆD^íB ±téÒ{î¹§oX Üpà ï½÷~/ãÛŽ€N'äþÈ#Lšt|S¼EÆí‹Ž@¤ãF ,ùpàqcS²»YÏ"ŒOöÑE+@2×—LæêÕfìe¤dþñUCßzOß´lëΪù #†ÆÞó³qO¿°ùµ¿æüýùPåW&胮v¶z77IáVþöTkj ®.Öv~õUñνGUŽ32!Û,¼ùznöÌŒI·Ä»ûš=! ¢çõñøø(rˆ*:\k–æ¹›ºYV+š-Í52±On Þc1œˆˆˆ©S§.X°´>eÊcÜ¡~ˆJ´±}ûö‘ sAèùùùˆˆò×øäÔ=‘ü‹«ùO“é3€+ýÉO~B^Ã}­‚ýý9N”l2Ÿp7‚HTXÉ?ES__¿eË2¸ÖŸôIì…@­²²·Qâ¶´´4ÿ Áûð3Aܨi¤ÿ¬àb¼uã7ŒO’lÆ|rÒ¯ž””„Ê Šw80éСCÉ)dÌþŸ¬M‹Oܼy3‚ ²6ê-d B+Júÿ=\3oð§ŸçwtºU•ykÁÞ7_ºòÊ9ƒ–¯*Ê=X¿i{õŒI)m^uW«$³ìÏÓ­a&]õÊ?öÁǹ ›2FÞró¨i“ô.ÇÝ{Žò^éʉIíÓÔ-ÕvËQ" ¢ç+¯wÛ†ÚLAËkø:?(È2}zG¼mîe™}’ñOh²ôÑG]³f YkÁ`|2Ê ’-mûöí ~¨'08Ù/ñ®cdu •ÀPÆþÝp$ÐÅ}~]æÄà>Áp~ !ÿÍr ‹!~‚qˆ¡@OUUU`(ÿ%ð ™òðdÝ$’7ëÛ“³–-[ßFçÝ!`gè ºQ,77žÀÈÚ“Ä=^8°¹¹ñ%H‚†ô»àHÙÎ zxnTc~WW׆ H‚n̘1ª½}-ëÞGúa¡Ö›¯þú[»FÛ—W·ikÅô)i÷ÿ⢟ݻüï¯o0¶ŸÊpG›@Ü(¼wßÑîÏ/i¹xrÊ/]™1@§ˆý·ì9œß0ýêá%÷Êo¿>ÖæÊ¼aBd€ £>ù¨Ÿ¸5Û+ÄŽÕÏÝæ°˜þüìœi“S™ ÝÝ݇2o0”>Ù! m¨-Æ×O@ þRÔŸ§ÂÃÃ!¯ î¡pŸ~úéôôô p¡‚Y³fÁA’u7œ>¤ß Þ'#IHß IõÈêQ+à,ðéøäøqãú°ÝðKÁÂd#â/ÁøøÉdˆ=ª+¡’?ã£|SSt Ü'(~Ñ¢E`ÿ={öäääôë×ìOb&„á:¨¨¨Ûp̰'å‰Ïºçž{.½ôÒ>¢Bzã—þѼ¬Ï–nh´ãõ;ì›2!exVì¼Ë}±²è“ÏÞv£>iâÀÁzÐýÎýu£G&¼ýêÜÁƒôn@y~zjÄ+/\>iBJm›»Ìãnèr[Ž«ü|oDFÜíwO.¨íÈ}[I€x`Lª=¿–øaY± =8p€Ìy!C›44¸‰ì´n Ê<åý5)yÎÌ̄Ⱥá†Ì\¨€évíÚ•˜˜HìéŸá%ÓµˆéÎH÷Ƹììl„ÅÅÅ=ôÐ…°GîM7Ý´dÉèâ) ­C’gdd €AZ[[É2å €+%›ÒìÞ½ÿƒ"xEõûç?ÿ ÏŠ#õ8…ì𜒒‚!éW_}E\ÊÑV¤K†’þÿ âOoÈ~þå-ûeGZW¯-{Ù {ï¿mgÍGÿ:œ²ò«’­»ªãã‚ÿüÄ%3/Ö—>..mYðñþM[*ƒƒL>0ùª+“esÃ-/½2¯øH늵û—ì޶E%ïÚ]‘¿µÜ¦(é‘!oþjܧýl’¤ÚL CAI­[·ò UÿÊ+¯„H'ŽH"­ît¢÷g(25)??ŸL7ݲe æÎÛk~7ýÉL¢øøxÂø`2¹ŸŒs=#щ2˜ŽdÒ óq÷èÙ< tOv3]`|#Ya<“nm’Á7²:dõÓ¬¬¬¢¢¢;î¸cÊ”)$rzì±Ç¦M›VVVÖÑÑAkâ¦@øÃþ(IöÿA'ûÔ÷™±½˜ô¹s}¾¢°ìH ðÿü`ßô©i¡!–{ï÷Ôs›}r]dDÀC÷NüñUY`öê£zpùÊ"œu݆þôú‘x·ÇÕ¥Gà13=tÛ®ê«çeÙÄ¿WÖW±‰WÏiûå㘠ˆpKKKß~ûíÎÎÎ1cƤ¥¥í 7@’Ñg”ö=! Þ°aC^^à€¹zõꫯ¾ºÏìþmjhhX¸paKKËÍ7ß<{ölAæ~Ôó= K²Ï­pœpÀ`À‚‚œ ýkô÷a€šQa¨{2öÿ¢R‘p“ôÜúk|>ü(‰GQjÝ¿Ïc¢ˆ“ÊËËaéS§B‹<ÿüópÆ‚ ôïßÿ¿øŠM˜0!))©WoøÓGHßdâÁÅüv5^74Ú—,?|ëÙWÌÎ8RÙb½îš¡f³ÐÒê|aîgË àçMJ»ûö1ýÓÂÏqÍìñx×ÿ÷èt†Â× ‚F{øüóÏ333Ib‡ ¾$cŸO§{"áÉë;wîÚµ Í-3ÑÄÑ §“¹.(À,×^{mttô§Ÿ~Jä8YÙð£=Â&Âø¨É8kïÞ½d5 ¢úq. ¼ú2•„lD¦ScuÈè{²¢2ª$è5vÅŠ§/H‡ªøâ‹/¢zÏœ93&&—"³ÑÌ£Fêkº÷~õ‰ã“&_”´u§¾àõ¢%ùs/Ë ³Þÿ }óÂÎ.÷û ó-Íw8øàW_}…s¡¦Á ¤»Û’Oö©Çseeåš5kßL@:â*hö3^f7œÁõ×__RR’ššÚ÷¸¾/>ðÀ=ÿÏÞÙ†F•Ýaÿçã<ò÷ßüj^"ñŸæÖk‡ÿü)%ß./ýõ/~¸lIå¨Qa€Åàò{÷îmoog¼|÷î]ò z‚§OŸÒêhil¥ÕÑüÈÂNŸ>=yòdFÊ/^¼`‡W¯^M™2eÛ¶m:Ve=Ã(êÞ½{ÈÕÖÖ†û3¢³ KX¿~ýZw£kw’ÜI“&=yòDK†Íœ9sÓ¦MùûܱáP^^ÎXçÒ¥KŒ–Ư'ȇ5úúúèæÍ›GàÑ;Θ1cëÖ­Ñå33óã$xyýí'|ôá/þƒ]¿ÿ¤¤ä¿­éþfé×δßì»ûïo|ý«k6gåòéßú`ŒÍeøà2Ó§O׃)o"KM$ Н]»†õÔÕÕÍ;W?íîî&É¢í½|ù’XX˜Á0Q¦M›vêÔ)L{ÂÙuÕñÂ… ]]]¼X°`$ þ‰'(¤7]²d ›´¶ ÕQœŽ¯ùò‰ÎÎN¤ÐÈ’¡=AUUJ’”ý(oÉúéAéø;f̘+Vx¢¬$ùsª#GŽ»ví:yòäáÇé;ÉN6lØ`q ÙôÍ—B"‘hoo'ý\½zuee%£išÎ5zôèÚÚÚúúzK4XÈë›››oÞ¼¹xñ⺺:rØ£G’±jL°jÕ*Kô¶Pd|I ²sçαcÇnܸqܸq–Ŧo¾ô3ÝBº©Ù›¾1Ƙ|e”%0Æ›¾1Æ›¾1Æ›¾1Ƙ¼ GœµcÇŽžžžðvÑ¢EË—/ÏþãÍÍͳgÏ®¨øÿz;ëׯO$C>\¾|ùàÁƒCø`îÐßßßÔÔÔÕÕScÓŸ¡jÚ½{·žž%T•BílÞ¼9ÇuÓ –••mÙ²Eç¨`àó©ÑJÉRÃh`gÙÚÚÚ+++óݪñ£%™«€ý×®];âñðèÑ#*Ë™þ;§-Ɉì̦sçÎ[ßNŽ/p^ì Óqâ“;ãžê®ôbDèèè Rêëë8ãª[äààøÃ ø‘‚4%ß¿$Ç—a £&¯Q¯Ä?šUUUé@”ÈÇÉ€jkkÕ,é“UIÑCŲ~šv惤 ZW/ma,õ£-ÑJƒc6ÕýâÑZíÑÁ : ¬\ (ç¼B&…°È«¬Ë`{ÁCÎÎ:ˆê%¤óS§Ne+…555ª»×*-:ðå‰Àh9#•0 Æ8_EˆvŽÊ/$ u!G“ &(\òI›ÚaŸX`óB£¥0Eá˜æÔ[•ð¦­Ê={öDÍqøÃ—wMlÀ­0CçÒÒRÉÎÉ"šâ³¡¡%‘ÔcgÄY³f 5âPt½”#%”Ëg¤C¶··WݳÂiPlRÕË[tÀX Úô‡Ò]‡×Ò"7µKòB¯([^^Nʤ´'@mÑ¢£àp(âC{ʧôAE£¶±ÂpJäøü Z{h9¹_˜SSªÈkNª««e÷±vN+¢<è©(G@ŽÀgQy%"¨]”D±›¨u6jE¼å¼Ý¾}»¼2Ÿ0ã4 ¬Þj“NGш¶a>¡È?ðå–––ÆÆÆ´5"ßW¯@H‡˜D@6ÉñU;”³O4°£¹Kj4Α¦V¥¼ŒA'ÁW%$rÿ1°ÑáÒ©yÊú'¨§çª—ÕˆVJò‚ÓW­»ñÙ°6=+ò²Ç …Pj³5æ'ªµð­4†’aÄg–ŠÅô£Ý»:^ºV¥ÞˆKÛ£>Ô¢P™­4³§;9µ¢ü¨äÍ”—…!V¨êWÝ«­ªó „fS•$ÇÄ£±-MÅ9r^!îc-Š­úQ{(ÔšïA™cˆ8d¾R/6¦fuš!¡v8NÃÊMH»’HIÎ4˜)ç‚q¤N†b–'ËÏ% %ˆ\xP^4¥M©UY0“9ÄvY^?þ<¶U«­JB”òAM¨#Q¦¢ä}BÂGc‰-H$sXzbCÖ¤Œ':°¶é}z'ó>áÊ­”H¦XéP¯i„;Ø/£é ðueÖÎÿåh¤Ù_[ûr;N¾-¡ÉéÖ1¡t‘Š„h!«´”ãsÌèÕ¶0®ÊwˆB àt‚5 âˆ6œ«#PcJŽ“ášA–3Ùk®¾$Lf¦>U*/¦w2 ÎbyOT–0E< ÚøFê2±ÄmŸ,*Z_©}Cn’O·lJýîînÕ™¦&¯ÔÒI Õ]“ƒÇfŠ”øpjT݉JÍ!ma4n4®˜ ø4½›çÍA0ô†$¼Pc éS€Êâ{’haÀZ…¬Š·DR„öÆP 8ç±CŽçAo³štl6O£"‘AdÈ$´'»ÿ$j@ØY4K¥аL}j,°õD@í]ͳÛÒ4Hl:4—§wÞ¡ƒD+S4*bÃ, Ÿ 6ÖJOiÔx[_K}‘éëSúájŽß‘gëécî---Ô·zi\&ÜBW’¼ü"›¦4%I½)0d4Js´…´g>›¶0Ú5Á®°©0÷Ÿ¬Æ7$4Ã%GƤŠiå­š;ÖHˆq›î!í¬{â;š÷ âè:m@— £Ó¦Ñº£œRÁ,¯¯ÁŸžÌI!ÚÛl¨¶¶ÇGÒ´¡‚κ*  CÊ’+ÜšØ^І~˜#Q!óÊý«¸Ù#Áu£-] ™q9§É[^¿-©MÍó„æ!‹Ò¥ººZ¤â¨å ¹,Ž\3¦HÑ]Xºü¨Ûx ãŽþ¡ ÒÞÔPø¹Æ)Ñù¨Bº®k jzÇ3RÔ××755éž]’)Î4¿ØðôŽ1ÆžÞ1Æ›¾1Æ›¾1Ƙ¼&ÿ.äöôô„Õ©„nÅ o£+÷F—B.#\HKÎZC‹l©-u!›þ ?ÎÒ¢K555z»<‰[‹5´È–ºØ¤ÎcÓ-hV]Žj-e­,˜ºŒpXG¿Ìæƒaù¤´ëÐÖÐ"[êb“:M_¿/y³æZæ•{cˇ•´f€ªP¿Ê ?ÑŽ­C[ƒ>kh‘-u±I] ré“©*­°:¨Çhy Užž nê:´ÖÐ"[êb–º@¦w\ç2ŸÖd -²±Ô6ý4C9UvX¹7õ) ¡sN]Ô—1#¸®®.^hÑæÜ_2ÓZd‹l©‹Ñôcd^¹7<þBˇr­Ÿ|æÌ=NsÀ%U kh‘-uÁKíµwŒ1¦ˆð/r1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ1ƦoŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ16}cŒ±écŒ±écŒ±écŒ±écŒ±écŒ±écŒ±écŒ±écŒ±écŒ±écŒ±écLñò?îšÃà€ÒˆWIEND®B`‚qt-client-4.1.0/guiclient/images/splashStdEdition.png000066400000000000000000000616571217451700100226500ustar00rootroot00000000000000‰PNG  IHDRüÈ‚¬ÄKtEXtSoftwareAdobe ImageReadyqÉe<hiTXtXML:com.adobe.xmp Y Äš_ÝIDATxÚì}xTUúþ­ÓÓ{!@(„Þ¤KQš(®ÅÞÖU×UWEºººîª‹»ÖÕ¿eqEQ@ŠÒK( jè é½gÚmÿ÷ÎI†I(«®îrÞgžÉÍ;gfÎùÎû½ßwOa5Mc(((((:8Z”ô)(((((éSPPPPPÒ§     ¤OAAAAAIŸ‚‚‚‚‚’>%} Jú”ô)(((((éSPPPPPÒ§    ¤OAAAAAIŸ‚‚‚‚‚’>%} ŠË­Šÿ&YWæJ %õÙ½‡gØÓMòÌÃåùÛÕËQfλqË0.•±Ëj’ÿÏÜkÝZ^“âVµX+c¦ÚŽâXºsÅ•øT­ÿ¿r¤ˆ0MQ‰ò5†íê¨I½µçeøÛáçF,=c÷bÐéXô;–ã9‡SúM”4dÔÏWÌGYŽOÚƒÅ@{°Jêí/|2ÚÏ&°Ôü(¨Ò§ø¯« –1©êéj™QÕ_èâêeúÛFT”¬JÉÃÌž?he~Náõ÷“öm¥îµSƒb,x^R™…9ŽI›jS§™xÊû”ô)þÜDzž?¿ˆÒg8æò ^YßûÓõcMà5Mþ¹ÊϨ——žqm˜x×®†pWáPƒÄ7‡XÁöÏnz{˜5? Júÿu@ãƒûþMN_»0u³Ì¿qx—zg,5ÑóZ­ßc]}ÿl_øã,Ç+ƒ¬fžÉoT–Oðo”´¨¥UOõ7ßÕÓ4f}-5= JúÿH²¦‰,£^’»Y–U•óù]ãþŽ×XY¹Œ¢Øsë3  +ÈY£²ü%X5²g0Ãô¹<ë›+J Íëª_Ó”Ÿ3eà™·mæ‚Ì«C­÷ïjœe9Æ¥jµ.•Ú;%}JúZÉ®oLŒÝ?ƒ õùTÊ™lÇöWÌSÿ"„õk÷Þ2‡2oGõá¬fUR®Í@–eeI -8ºåé«zF…üÈ4ˆ*ª§2¾é}oŸKÈ*š h<Ûò+XUUdõÒ)}¼Ø,© ’ZãRë\*.‡'õ¹ #häm+rmb+«Àn˜¸¡ÔVîv+Z¿ !ufP„‘Ê; Jú>0ûŒzqñÞoÄ×L"ÔË$¼ž‰Ö òœÛþhžò:rn²kK¹s{ÕÞSÍ’SåA=¾Ù!V’pöÈæßèñ£¿ª™a¬oyŒƒ(å _ÎØ}Lйl£gM@uÆóf$áš·jòR/9éùÇÜú‘ø¯QRmùß¡IÒ‚= TïVë%µÖ©‚” <‹ó!&>ÀÀµcá6ŒªYYÆûð}%åRž¬Ø.§Wº·u-qÖÉM:ékÇšD."@èaÝÕ82ÌØ7@ôý™"ÇÌŽ1àA ›‚’>ÅEa þò²/Þ84Fá µíŒYMR™âçö?š&¿ÆuÙ*‡r½M.»¢k|µ ãk,+æY÷ûÁƒ{Åü„/Ãi GÍ gy4/á°څk½C~tMÁ°žÁRëêÇÔ8®íb˜Ñ¿}!+Ú=‹³âÃOÒá±Jê\WÇðw‰h4´y_dFu óY¨DãXîô™Ê÷÷ÍiRRJiEî¼Jwm£$É*<£Ÿ™ïn×Ý<1Æ”h¸ ñóŒjã˜sJŸÕœ²Â^hô*DúÚ"ûÊlûÁåÝdú–ÆXmb ™»˜Òç=‚!"[Ó,V¡É-0mÛ‰ ³ ª³%¿ÃqL³K3;«¾yóDÞËzÄ„þñkúnNÿ|߉kÆ njh&ߟ—\ÃbüWÌ¿yh×'é_Ÿ«´dt ‚'i­X|Ð’½åƒº‡ÂYLÇñ&+ol(»fäÈóBH€mdw?Æå ·ŠYd¡‰ªD™ŽmÕ+ˆ0%}Š>×Ì9ÞÜœ¹'9aâ·ÓÅ´j^aDQð‹RDNKûŠ}Çš¿ß ùùs}.§jfüè]2Ó`$I`5õâJ_ µò.ϲbøš6!ÈxÑ5~M ±€ùõ™€ŸMlÒoä¶ # Á#ýE§.ËU"®ÉÕ¯{”/ã{1÷𡬒]ލ£Û-yüŽÚÅÌï’µ’G—Këç‚ôuïB¢£¨‡#ÞÏ-ªv8š•nþ‚Ó-{~²XãtŽìË_¨bñþÄø.Yuîð0“ÓÕâêLŠ4"ÆoõÁ2Jú”ô)~"’æÜ‘w|›ÊŠœÍª):ó&3kµ©özç©£Lq~Aúî@&,dÜÌŸñCÁ´&.Ø*ȲêÚšÉ(H2¯4_44Y-Ø"8yÕ“©gƒl‚>Vþ‚JŸÜ°ðšÒBúV¡¡©ýxP‘QÃmB#~²¦r¬j¸\RYÕEóKwLM\ž^ÜlB}}‹ã±1Jb´õX~Ý9ÒG„aå™!7 ð£ð3½·Ê3‹ºƒÍœƒç=n†5˜ÉÖ-»Ê©'ØTÝS´î¹Å Üݨú‰Œ¹u('Ç«a~ÆôŠ&j·”ô)~"¤뻌džÄpNc0r6?¹8ßµm¥ûø®¡ºº¶éìè['žæÙŠa¦a#Pô1BH Ô6k9·¬Ú,›AÎn¼ˆÒ×#«Å….NѽfÈÊf/¶)#D~™×êã gÀéœ fá$º…ùf>·¸žÝŽpLŸ(3YzGV4›Y¨«ov6;È«9Eu ‘–gõÌAà-Ñf5Ë’ª¸U‡[•dUQ4EßFw=l"cÕçš± §ägYx‘`_WŠ]z‚’>Å„ûÈvµ¡ÖÐ"ãr2af¥ºÜþÝÎßköFÁhª·3¹C¯¿æ¯Ÿª,÷ÔÒž!ÆY‰Á?Ë窊úẂš&ÅdäÆ& ïPÛè^¿·¬OäEÓ;’KJ9Vs «¶¸Úå«Ql¨¯ÿÓmÝ.Lúšî/Šœ&Ëq§ÏÔ~ðÝ™‡¯m3èE’” {ËÓ2k3‹ìõv$ëv¹ÿïÆ‹Œ °™DF‹ðãŽc𖕩ů;óàÕç6)t:åõûÊ«›ÜÆØ0˲Éé•c{·Œ¬onvu‰ô 2ÀÇä—;ÏT8*êÜuͲKVy–µšø «ì'†ú‚ý?³`ÐwGaÉdø+—¤–×:6¬<[Ò¤¨ªH—S¤ ¤Oñã4~æÍÞ`ºú6­±F.)r¦®s§®UªÊX#øÆÖÔäÌì>bêÛÿb8îÝ­¥_š`°<ØwRŸŸa _EV¶ª‚vÀB¼;í®wìráÈ€a² ›¶.<oÁCñêÉ|Ž•š.–Ô×¹¬ÚY^ãÈ(hÚsªöp~“ÛáxlZB¯ªu>ùñI=±ÃbeÝn·zñýÜE7 ùuy¥Í²ê÷fÖ©prz É⽦¸ÂþõîÓœþkXϪ «¸]ú´x&·ËhØ“Q»pKÑɦf§Ò²¥®'~Ò7ÝR5ü:ƒÈÚL‚ÍÄà xýö6n¦ºAjrj½‚ÜšFí—‚’>ÅbüÜãÎõ‹…žC›þñŠ;#]Î:¦Ù›Y£‰­œÆ8]'¦|¼” í(ýÇ·9u¥Í åÍO~ròÇûéõŸò>«ªNãXϺoYgeõÍÕ‹dwôèÀ‘»Ì)Bcµ‹MS*­´ßùÆáf‡$+zD—Ìü¹u~¼á†Mh•Ñž1‘šª°߀þàD^Ó’´CnI¿óa5 ¼")"£øü.½Lž|+M_0Så4ïÝi#«¾µ,{û±z|+“Ó·3gØ %/X¬gxp;kF,Áê‡äRÝú V&«Ë©ªMÓ8N3i]üü†²>%}Š ùlVó{/¸Ñì‹t‚EV4²«®ŸÆí–ŽØ¢¯þ×*ƒÙòÕžòw¾>]YØ(ŠúJ6¹Õ¿~÷øgO$ŠÿÏxÜ*“>ëfâÌE8—çY¯O‹õzˆhÕb¾ÀZ4z  0²S2Á©è™UŸr&ŸGèŠÊÊ>«2,¯*n‡ób_¹Ñ.•×ʂʉ‚wc,D®ˆ s·ôMTdÙ'ïÂê»'¶:\¹~W–Ÿ¿ŸÈsÏ\ÓØë'õ~ç©IžÛÙšod£y2û>ÿž›:Ìqøtœ>%}Š˜Z)9ÓøÖ³Ò¡£:ëm­,¬S])ˇ Ác¾\c \}¨æÏ 3ÊÎ4è÷ =ƒ+EF+̪~ìýãŸ<1pHwÿŸþ%4•“e®ôfqæbãô"ïoTËdß|ަ0å5Ž ¸4EuH<§ø\ ù,ËírAœ Ò×Î… ú5’ÍtQ2Í)nllBù ïÁ×u7õîä«ôõÕt|HŸëbÔ'6Ь6ó œkër<,»7‹qº“>Ùª}ÔByâ'€Þê¡hËø•¥ æKh.²^“ïƒSXÅ¥Qm#¯ ŒŒÞž^ôÈk;ÊÁø ÈQ&NQ ‡³W<òöáSE?}à ¾æŽ^ â-™<.6Ù Â6ÒŸe$É÷bNcžª?ÿâüÒ¦³•+Kí o§ôUµÝ¬¢úY.ö7ï+Wd ÑÆ¹eÅ_hŠïz©2}~TRïèp‹]uŸ{Is¹ Ê[Uþˆ¼œ¢e—4Ñœ>%}ŠS©©l|ãY)m¿æ’tÛ€fUZ”¾[9ââ½&46îæ8¡8õ¬ˆ"ë;ÿyȼ¦d-hAzfaÃO&}V/í\±-‹OÎê秺œ ÙƒÐó5eMZUU]›„ŒKR?^{–•=ä-ÞE/\kû<'½I8>·ìÂ_ ¸Ê±l{ ¯£ž+Vs9Ç%ÚBm>уÒî±>é³É8sd°boÔ}©LMuÖ6ÿõëÓ)Õív0>v—’YÔôΊìçlaé’k”ô)þ ã7Ö7.xÁµ3Mu¸5 ¼ÍxznGRÙÕįWGôêM®‡æÝ¸è·=ýòUG§ßOôÊ[¢÷哇J~ý×ô3åöŸ–Þa/¤ô/quôà.Œ³–S|¤´$×T6ýmENuƒ[U5<*ë]ÿX»zsžbwñmE·æ–ü í”>ÓVæ«.i˪ÙµN÷9VT­ Ò>ÿããå…uzʨõ;ÃM*M¥wÝ0È÷W±Ê”¾oZéÑ;DZö³Œ¬ùOrơҗ>ÈX¼µ¸¨Êîp)`ÿ–ýƒáV$¥É!—Ô8v­øóçÇïýî—ÞÚ@WW¦¸(hNŸÂÃFÍMo¾èLÞ¦ÙŒ ø®HÌzö±:Üäî·|CLÒ@ßwE„­ýü‘)sß)wÆó‚Ñã|8SÑN*yè/ûÿùˆ®á–ù…4xŽñÝt—õÅçcÜð^aæuur°gk”–Ë\ ŽÅßd”œ­»j@(üEÚ‘ÊÔ}%Mn}Æ+ø”å[¯äxFq:\í'+>ùw}•ÿ㇊÷'çõ“cG$…ù‰p$9EË7MÙS,K nÏBNvÛ‡÷”&m³à(«)œ¬q¼ï‰6FB¯®OÎëõÖ—¥Vÿpïò ÐûG<Ÿ]Ÿ4(|ä°À!±V‘‡g.w(ÅÅŽüü¦Ììê3…5uõNŽeXší§ ¤Oq ‚u:ÿöŠkóf­ÉÁ ¢—ñõ‰­¬>éhmcÏekb‡\`ùÌèÈÐu‹»fîÞ/ø¦_À–ª[9z àw ¸æ‹ý¼ß’ß8ô/µ‰Š¿õ©{†<÷v†Ù­µÒ%ϰöÇÊÕYxßd4ˆ<«ú3ù b—ƒZGû ´QÝNw›ï€Sß›»úB› w2£üĉ2«Y4™-hÍvIr+(Õ³K°÷BF©Ï|÷Õ_·E£gŸ|D,£m“2zî·7ìK{ßéƒ)ÀûCŒ<㮯ڻ½jßn.À"˜Þ¥j NÅíÐe?Ïéû˜p>ï°7¹íuÔª)hz‡â"Œ/¹íïÿÕ½v-S×Äs§êƒ29OŸ×QÑNÖ6Æ,üºç˜q+¡{läêýƪœb$7§jz:¾õ¡/æ’÷îÊæoéõÍÒRúzJý¼Ç%rúÀwL™2Ds5•q<„Ì*nVvñªd‹ XDÍjÙ!:ŽðꬰQO¶´”,k²l2Ú9OV§ÍCsÕXÉÌ£`WcmssƒSd“Àè“°È5úÝÕY{òÓ¿\›Ø7î¼$š'‰ïûÛ{2³É¸äãGÇU¸‹ô‰ ¨ROÉ<£š8Õ I͵öÊÊÆÆê&Þî´0’UÔLº¶gYrÖçE[2Ÿ|`,5l Jú€jo.zù¹¼¯¿)*¯)V˜§tÖ)qIùx8$ü»§®)èƒÏú^;ãÒå$ôŽýîó‡xû!¥¹Xõ<4;%ª½”u—¹êŠvlÚwÇ« Jêàs6Õ3®ÖÝLŒ»Éóhp6_jDÁ ~ùác×U]µx;ãv0vÆå9pÕIõYI1Eë?2mò°ÚªZFjb%;yp²ÓÙv >׆ñAÐÒõã ݃ ©YÐ8}›rMãt×ocÀáq*˸ílóÑ÷_žxËœ‰çy2¦¹¾Žq×â›´<Üx®u9Ú/#à÷Ý¢gï»!H®=(5V0²¢;cýˆDÃçôÒu¢‡{Ó‡ :ñÓNGš2^j@zò_úôêJm›‚¦w(.€¢ä͹*¯Í¾É“¯&¼Äè³|X}?'EÕ"“æüê‡5x@üê/ýnu ë!"ÖS w UŸ8U»òû<0ý‚K·Ãþ!Õe9,g×'Ã2¤Ý.ýF«ÕüÅGOoØœ¶xiò±“åÕµ’¤OÑâÃÃ-ýzGÞ~ËuW&Š‚,+7O *,ªà82‹WO±Äwo»pžÞ‘YŸQ£èßó¥gæ<úÔ{ŽJ¼!Œad³rM“5Å.;Ë& zñÙG$Æ_(iÅLéß=¢È³L„g:ýsÕ^qøQþ~–¿½öÐÝss–­L^Ÿœ™W 1¼Ÿ ZXNÐô%&TEv«r3«5öìf=¼ÛŒkf]5j ¿Ÿ•Z5Å¥Ájt@/Å §Ë]SSïrI6›%8ÈŸÿ‘Ëýßrß”}Í>ë8Àñ¨ÝóÂ3º„_Ù²5ýhFqM­%w‰ò:(nú5£† í÷³ÿ‡Ã™“{6;·0;§¤®¾.¾*:2¸G÷è¸n]ºÇEÚÜTéStv˜Œ†è¨°ÿ ù¥pŠÂú.™À(|ëÈ›é׌ÆnIÖÇÌü’˘ͦ¤Ä>xÐ6¥ ¤OAñ‹AÑoðrçvEg=ciÚÏz2ˆ´QPÒ§ ¸ yÆ ù¤wXæR(((éSPt`°dبoz§íì3 JúW’Ò×ôaõ社¾j=Uú”ô)(®T¥¯¶+«ßÈeéæ$”ô)(®\¥/·Uú âLAIŸ‚âJ%}UßÈÐgôŽgJú”ô)(®H·¬WÀûÛ²ñ®¦/Ï,«´f((éSP\E»Ææk,ǰ-»­Cø ÂZ3t Š £ººNóÀ§»°Q °ÑÊ¡ ¤OAAAAÑ@—V¦    ¤OAAAAAIŸ‚‚‚‚‚’>%} Jú”ô)(((((éSPPPPPÒ§     ¤OAAAAAIŸ‚‚‚‚‚’>%} Jú”ô)(((((éSPPPPPÒ§     ¤OAAAAAIŸ‚‚‚â Y–Èñ±cÇòòò:ú/h£RPPP\ 6l(..ž>}ºËå*++ËÏÏŸ:ujTTz÷î-BéÆèmPWWWPP””–_¹r¥ÍfOwëÖ­¨¨èèÑ£‘‘‘ÿþþþ÷ÝwUú¿ rsssrrF yèС3gÎ\ýõ`%Z3?#¶lÙÒ¹777=ð€çy‡Ãa2™à$I‚?ˆ‹‹›4iRÇúuüÿøGÚÆ—9@1`Y–ÓÒÒ¬Vë®]»À>ÌÊÊJNN†=pà€Ùl ¢uõŸ5Œçýû÷;N»ÝÏjñuÏš‘‘‘ŸŸÏq-·BQÛ8Õ~#MïPP\î8yòäáÇ«ªª@Cþþþ !pMpp0ÄþŽ; EÁPEEEï¾û.¨ŸÖØùÑÕÖÖ¢Æ.qÍž={@ëƒõ¬ª*l Âóòò ÿEQ<'™y—¡Ø§žzª¹[:z§½žZ»víã?þÙgŸ¡9i…P\ÈÍÍ•Ÿ={ŒÉ 22™L`¢£GîÞ½ÿ², ‰ZSSóÅ_ÔÕÕÑ#€G\±b|!ŽSSSá8W­ZE^‚<ÿúÊÊÊúúz<ÃC€ÐáJQí }<£ââb_Æ'ãÃU¼÷Þ{ ŽŽR-4§Ç_¸paNNŽĹ\®G}”V Åÿ  ï'N€tœN'xt®'LpêÔ©íÛ·sƇ@;v,¼Â—_~ùÛßþ¶3+z=ƒÁ²`áýû÷C¡¯Y³&>>ÕØ£GDB~~~¨´ÌÌÌÑ£G4È÷½½zõÊÎÎ&Çàw„SŠ¢ žáMQ´<êßW ¢4DLL <.>±£TÍé·ü¯¿þî­Û¯_?ØÃြ‚·ïß¿?­Šÿ ÒÒÒNŸ> ê7·¼ êܼy3ˆ†ä—q@r0Zh\Ö§OŸDC?š››!íOž<‰ZÚ»w/z1ª"** D ¿OOO¯®®MoذaÈ!8‰7¢žá!ðFH=tøNTfcc#Tü‘#GJJJÊËËËÊÊ‚ƒƒÁûį€Pçx{BBÊG£àC©Òÿàƒ²²²Ð~óæÍ›1c¢æ?üáx ¢)22rüøñ´–(þûèÝ»wAAô¦ÉÐd>Ìô”——GRx&ŒO®©¶Àû³fÍêˆCÈÿC”––’dê ÕE´9IÑ o8E¸Ôj©ªªêÓO?}òÉ'ñÒÖ­[á!¼úïÂpºµµµüàú«¯¾ºgÏžpÀ(0>Ú—¡uà?pòðáÃP”ô;6mÚôñÇCéO:Œw“¼ýöÛ/^Œ¾ôÙgŸ!|C{S¢ø¯Án·C]zZ2öÛo¿=~ü8è LA&ÁJɰBœ0`@ll,xÍ;¤“ r‡„'ÿ¢NH6Ì[{'Nœ8pàªKóu™çeË–ÝsÏ=ð‘ëÖ­Cµ“—ð–ììlÄý¸~ðàÁO<ñaøZ¨Cœ$Œã#䂳Á¿¥®:/é£ç|ôÑGÛ·oïѣǃ>˜˜˜ˆ“èihøèèè¹sç¢Õ333aÿøÇ?^yåØÍ\ju™ûÄN¹×U¶è.jM¥¼ú•Z>Ì4ë÷AtøÿÉÉÉ`1«à<»Ýîo¾ùæÔ©S 3ØdŸ>}¢¢¢ˆÞÄ¿xÆyQ`` œÞ¾hÑ"pY'©®ôôttdTj‰$»àÝ“ûèËDýø¦¼àPñ g°jÕ*y¸I0>‘ù$hÀÅ}ûö}á…¼„7Œ ã“ÂZ¡Âá;ÐhýNJú999o½õtÁý÷ßà 7àLFFFqqq×®]»wïŽÈ­øøã?÷Üs$F&aà•š$Õ4ƽê¾igÚ†«{Þõbtúß ¡e‡ ß™¿öíçÚòj®f>iëõ¹UU%)ærq—.] s‘TþÖ­[Áø PÌc=ùÉx2Ñ©©©DæƒôÁbuuu^ËÊÊ W:飷‚¯N'ù—Tjƒ µ,//?|ø0äùýo„?À• xÐ7.€%‘ÈMvÛm·y¿¾¾þäÉ“ÞF!¼ò§OŸòÈ#t”êêŒ7rŽñC¿£óäææ¦¤¤à<Â=4<üˆ>88 ß³gÏ}ûö¡]aOhò„„„+ˆééÐüåü‚¥Ã)\þ7b|l°V©Oör³±V³íDÊIÛéí]3Þ­OY¶:¯KâHzOûDZüþýûa?P°¥mÛ¶?~ì0pàÀû^¨xHïAÐúõëkkkƒ‚‚þüç?Cæ“ËΞ=[SSCÏ ¯ÊÊÊ।¤¤É“'w’ª¹ƒÖ[産ςÁ³²²öìÙƒjG¢&ÏŸ“„óMMMááá$ —‘àå@’y¼Ö­[‡HÂËøh\“ŸŸ׋Ou 0€*ýË’$}ôÑGh¤gžyfذaðó7nDç3f 8Ôfohh€¹@mõë×n]7$$:+>>}éʨ ÷¶Ï™ÃWlÝ%¿$®v )†€øÀѤñþçg _¹æ€TQÁYLÇœÝ~û~®Ö#gîÌxÊæ?EEE°((Ç/¿ü211ºjÕ*°óðáá!).(#JJJ:„’•&l…è¬týõ×Ã…x ô .ðMï@Äà%<ýôÓ¡’Ó žÁÎÞ3ÄMVTT€ˆ¡ß½7º{õêí;à’Ü G- T,KÜ'<+šìرcèûøÉüxGRáø×µk×â<ÊûÓôÎe‡Â¯¾ú êí·ß& зo_¨'È1œ5jÄÔÞ½{Aýݺu³Ûí²,_wÝuyyyèNðÉÉɰrK§Ã£ê´Èðvͱƒ ` #˜5ÎÂpVƨV”+'ö1’‹±ùkš¬È\7SÓ¾÷ß½.`Šuìõ”Ð/Â5`^hÏ;w‚Ž¡:É Fœ‰?ž,˜ƒ—À=ö¹™ä‹#GŽ€ðF’@ ã˜â]ðÞËvìØË¼2Ÿd!À€`º£Gž8qâü’¯08ŽeË–ÁzÏ ¯««C4 ÉBið¯dy"8_½€ÖAõŠÆ'ÔºÀ[ÒÓÓq |.#—7wD"¼Ï jäÈ‘4½syi÷îÝ3gΜ4iÚ ü>zôhô¼4tèPX¨/¡« €K@ˆ‡¦… À«è` ûˆˆ„çC† é¸õ ŸÚ«äPë뵜M¼ÙÁp"kÖé^'}ÑÂl:ãžUŽïcT™áx½ch\÷àæ[£O_wªjÿŽ‚È©áÑ! Å…°zõjX‚BDÄAžaNPŽd?™:ñ0a„v '@alÚ´ ⃠„æ@pÛÃy0û®]»PšW™ªJMM]±b4ŠÛíF!#FŒ¸âwhpÔùµJfÏB·Áû’Ù³óæÍûÝï~wíµ×¢³£Â}'â‚ýQiUUU Ô*áq<“!ˆ¢ˆ{ ÎÀ«ñÉd™# Ì_|qذa?ðn %ý_hW¸z§Ó ‡éC­gggã ‘Žóø½¨{÷îû÷ï‡J‚z‚,û£åEÁ1Ú222Ö€‹á ÐÌ {ø¼V•••ß!³Ê™“ÊêGùÚT-w³àfE#à ŒhfD«þ0ø1æ µ0_É8Àpã3æOã8«?ë”…W ùçnæÆëú™Œt†ÇaH†ý‘Ì2~ûãƒ†à ¼²”ó/•””€Ð}džMÂÃÉD%ãq8ìV^^âCbð€P(/%%Ÿ[ÝÏ™3§£ÌúÉ÷ë×P9 zð“áJ‰¢ÿýïHÄ@¨y8²ža|TÚåðáà }Ô'\i¨þ•••¨jÞï@´b„qp®hn„_ðÍÞ»,4½ó_¢°´´´-[¶Àù£mÐmÐcÇŽE»öêÕ‹ [&32ÀÝ 0š*¾oß¾`s(}x…¤¤$ˆ5´ú Aƒ`Fh{ŠB뢱ad9tHÞ7˜9›•ƒ€ç4UÓ…¼h‚Àg6ÆbcLV¦ä,Ÿ½_i;Îÿkjf©ßªÚAÎâŠWÞH~ëµ™×é&|^0*s¬®¦¦Æ›d dM’dí@KУG¼Š·öÙg/¼ð‚÷%R]]Ý­[72`×À¶ñv’êñr½—ñ½#U4€ô_{í5oÞÿНyDÞd­!ï=Xt² Î 7ÜpõÕWûfÞÁ“J&snÉØž1cÆ€7ÐñázImùÆ"#b½2 ŠgPÇš5ku‘¡(\ѱêí !ý={ö,Y²F0qâÄ{î¹:h´.zã×_Ž4nÜ8r3Ç ÐõðÕpò° ˆ(©ÁƒÃÛCŽ 8o'ݬwïÞh{\@áóÏ?'s —-[öÔSOu é-a]twÙ’ 90‹®ñ0¾•µù1ÍÒé#ÕÇòëåÕ ~C»Ö«FAUÛpº¢r=CšGX Ê!¡Áf–~+ `?ç«g9¢ñAý`|hyÂø¾CÉÐ@D– -ðÔ·ß~{Ë-·x/€ü\·n,sÒ¤I '(È|²Ôš/Ý“ašÐ"аà/è(YHÝNÂøK—.•“ÉV¾Jœñ¤Úg̘qÎz%55•T/a|T"*èúÄÄD ¨j¼Â.##8ƒº%|Rɤ±ðPxŸ‚öÛ€ñ!)éÿ÷‡|âĉäädô«éÓ§Ïž==Á÷43:ÏÆçÎKn怾Ñß £ÐrhK¸wÄhˆ£Ñrèi8ÕO² ~4VVúm\\ä yüñÇIZÒà׿þu‡ ƒªJä“»´Ê\ΞɄ˜^Ô5¾Æ·Vž¬ùËÊ€ÅÝ›5£ÊöÕ$é¶Ð#¯Ž?bð7ù.3ª¨¬Ù¦}26¹©I«°Z$m²ò¾° 0Ñ›0?Âø$š8{ö,L†Ä´®æM“Õ1N'L âqÚ´i°4¼ kÄ1xLÑ<ƒ—ñIÎ…às¿ùæ| ‡Žgx GC?¨42ŠñÜ!M¦­AÛÁz׸G_Þ¼ysqq1Q„ñQÉh „ì»wï>~ü8¼æüùó`­\¹266}ÃÑâS6(öíÛ‡Ž?sæLp éß¿ÿm·ÝÆx×v¸ªë`¤rYŸñ °°_ 5„è˜Ü #s4 îÑfd²"‚¸·ß~›dîȼƒH 2)) ͉bá·óóówìØ30 ²ÀaBBúâ´.ü<>Ÿ¬À|ÕUWuˆ‘¹š,»¿Ipìç¬V6ÄŸá z_°@ãƒñïÿ,2Ýk3ȬÃ`5ôLŒB”IŸ´õÐC‘5aˆr'¾ï"9Žãðшhaºdµ†ë¯¿Á+.5jTgðµ¨n¸aùòå¨FïpÔOXXØØ±cÁÑè¿$̧ƒ¾}™ Âþî»ïP8In± @\3ªª¢ázôè¢ÀÞ W ³ÿ~’JêÐ÷K:Æ&*ø’ëׯ߶mz9Ó½{÷AƒÁ¾‰¨A;!ÎB÷C{±q`m„ºd¤ú :¤ÓwÞ‰ö†WÀyØ$þ%K­…‡‡ïÙ³oìÝ»7¬¤¹¹„Žbá `F8ILaÓ¦Mï¿ÿ>Š_°`Á忬•ÖÜä^ö¤(d²V?†å=wn-¬ÑµöìÛÌW… —Ó%Ïš–ðн£ú'DrëØö »åET%Ób,£W#[V-|x,aUi/‰V/¹'¡OxK$QS¦ìø¤¦¢F½î娘 éP2sèãšöPÔÃÓo›t¥òä!L¦Š'³uãCL@€‹ax$‰ S„~„€ K3zA²öxËÁƒ!5|§òÃ8W¬X±xñbpÙœ9sp%|ì‘(Þ#Ýã<ädìÈ‘#_~ùåNf¡ž¡ÖAÁ¨C’£Gålß¾ÌÎ%£òÏÏê•J7lØŸŠ*…³„´Ÿ5k*͇ž>aÂxn0œ+ÞNxöÙgñ)©©©‰‰‰›´Ò:Æè4¬®>üŽ;î¸÷Þ{oºé&ˆ#Ð1â8²‚qòhB´.™–Mè½}=¯~òÉ'D‘¡ ‘o„ÿÀGEÃã%ôd°9N¦§§Ãt†Š’ñ¸ÍŒbáà`à jjjðÅ.±ÏB¼NÊ-âœ9¬-¬ŒhƒÌÏ=P÷ZJ¬`v÷õ…k#ÂýZÒÊgOh9Û8“‰…àVXÑ ðÚÿ¥ þgÉ0#+54ºæÜ8¢k¤…|„{ó'BヱqÊÜ+kÎüB܇U´‡^͵öØß\êZò*ãvp]{_1k9hŒOÊ$ŸÀNp‘(ÑãÐìsçÎ…ÑB @E’µº¼ŒOfT!¾éïܹ“ öà/XY¸¼¼o„¹Bà£7nÜ û¬ªª‚ÖéÓ§âÎÎÆød¶-©yrÔ B@ßô®8ÝŽñIb'ÜtóC‡ÀàðšdµÔ9j;:::..Ž$P )œLÜçÆKdÝJú¿,Ð=víÚ™ó«_ý šFÊÌÌ„Oމ‰ßÑ£ÍEÖ;…ŸÇ¿hl"¸Èí2Ð÷˜1cÈ8¸t´.¢6DpÐYÙÙÙdð>4<<ü<š†uöìYô(”€òI:A6€ ¤»¹ÜsúÅg”ÓɼÕÉš<4-¬É²sGãwg¢d·ëÚ)}þüòô6Œ¶õsÎq†5YAdƒçaäxƒ»Ö•Uk1†„>ñÀðÉÚã¹(¥0OMÿTˆ C{ZË 5GŒ½º²¼M4Y£]e•;Ö÷?ûOCÃÁƒëÒÖÕ64öÊ`ØCTTŒÇÞ±:à2)vÂx<ýôÓ0ZØ'Œæê]Ý…<ã-'Ož\½z5œ̵K—.¸˜”‰!]Ù³gOØ!®‡‚ß¡ñ9‚‹aÃ/¼ðÂìÙ³!r¯¹æ².|§Ù#¾ºº5@Øÿرc¨LßQR¾ŒËÐáP¨^\Œêu»Ý¨mœ$%à" ¥À“{x†#OKKƒÖ츿#‘>zË¢E‹H"FO@G¿"ù}€LÎBc£Õ‰ºGë½ã­xêÔ)ôánݺ!6D§B (ÍŒW8g€Î Õ»ÀÇI´=bC’îŸ>}úå[wŠâÞø‘ºë Cˆõk™„%ú±¿Ìƒ•ësCLFîÍWgFEž£ ùÌ)eû»|?ÃÁõŒ`b#ŒÉÖ/AëeÏŸs÷C]’g¿T ÷KÙÙÚ‰¯Äh£ž/BL*F„1¼gì¿ÑÖËœ;”OWá8DqaæÀ¿mãÇŒéÑ%Âz0,  ûÉ%HøfFýäÉ“yär —ñ¬íŠ!Q¦—÷aŠù \Ö£GáÇÉÀÄÁ(bÅÂÔQ&>+++ Œq‹c¼¥_¿~ñty(9T8:>âoôM2û|Æòu‹ ¾ÿþ{8N0 ôŽ–ì>F5Ò”¸];99Äâ- ¯FDD ½PN‡ž–ßH¬úÒK/¡~øá-[¶ ÂEw‚¶‚–Ý£·€ÁÑ=@Ðh!œ‡BB¼“a¹ÐÈ$ eè' î>ø}͆kÐoáЯÐý*BÔÃI Žƒ¡ï¡(\†bñ¡¸ 15Jƒ4 ·ì`.ðüø”[n¹åòÕøöfuëKÆ~~¬-‚aÍŒ2ß1ø³Ö0ksÝŠ=O?:FZ,[©*u/zJ´I qV4z&F4òF#§ª5õüª¬È…)ò ë¶À¾þœÕÈ«…BDkògXQÊî!@³Û•}ë•ÂE4ëªX’“Ïv9YkNïÓ];þ ^˜ HʀܼõÎÃÚ·o_UUÈwI^déà›Í'¹˜Œ ¶tã7Bm¡> $Q-dÁé$ k$Ûøá<Ù¦{Åϼ½P'ÐÑýI†‡Œç!·R¼ŒOÚAà“<>Tz=Ùxn5I¦æz'ÓáJœA¬¸Ê÷޹c r@$7aÂ„Ž»GMH°~ôÑG ÖAƒ‘Ä%dYÓ]"!!Í€®‚nîNIŽŸLÄ‘Ó鹃Êq=ˆÎã¾ûîûðÃá3ÐÌ00ìæÐ¡Cûx/dš¿`|\€Cid·È:²™z&ŽñYdî˺úŒ¦£þ·/üÊ\•ï`-6ÂøŒ!@ãºNšðüÀÓ!l³fÐÍW“déÐ6÷?õ¬¨îŒVýÙ`á¬~UÕÚc‹CŸY¼"·‹±¦HS:ÅóF=zàÌÆ7êã‚xã×U+i«µšF4x:£ˆÆùÃŽ&Oúˤ¯+Í8ÕÑŒ“AxŸð¬ÆÙ¿ß¤dÚ‡on‡Œ'³~Èz0'” S„ %cQX ×ÀŒwìØá§HÔɺuë¶mÛæhÚ Af*,[¶ì¯ýkzzº·ÆÈ:hD½eff¢º@ñ¨(œG‘óà2}š þ!Ës‚4à¹!õÚÑ:®dgg#b[¸p¡ïÚmÌY^þ_‘,—Aö+¿óÎ;!ü—.]:lØ0r_‹ñ¬" F»¢Í@ßhËšš€âÑœh<’ä!îzèСõ‹/¾ûî»Ñr(ŽÝ’¼ @Úžä[qž´=ÞNÆÕ}öÙgÐV0 XÌ帬½º(ºçÿáU'_âÇ0 ýÆĘ#ÕúŠÛG–)üÖ½°ˆ1´ª|¶¹H õgL‘ºÐçí úƒ9^þ|—Õ"8ß¼õt½=[vk±‰~šQ/êÞàa|.€3Èö`ذaQµtÒ‡Ýæ!ØÑNèÙÀéh ¥«®º m~'ÃçÑ¢0}¼JÆá¢½qŒžIVCEÓ’•˜PÔš5k@Ùd–<Š%ëí‘Á?_ºQ8ù¼Ñ;É—AÀ Í~ó›ßøN¡¼¬{ESÝîuéËVV¹*z ĈŒ`Ðj ´‚ƒžûº¢Z¹Þ3uË#ðm‚ÍZy¦zçÞZ©Ñññ&)½È8sH½>c«%ƒïØc5+¥5›¾¯x…öi2û}VTy9ÁZi²2ªÖ¾?¨ ft( nAvJs›ƒVŽß5f6§ÄdMšjð$vôq™¬Å\y´ä׋Â3ä‹,¹]’SíÛ#$©$k|ºÉ=ZÚËpí"…Ð "«Ê™EÒϯYùåm1QrŒ9ì ¤óûÏž=›œ¹´›pÛnT~]]ÝÚµka¥`0Ì ª¶ä50ù™3gÖ¯_Oò“„q***@mˆeÏÿ°j˜î!Cp1"Ôyóæuº/õÌ oGÆeú&ÄÐ"ÇŽ##ëP?dJ¸­[·’EV¼2ŸäoÉò- oߥs ýçe|¸4ÂßÔÔt×]wu”Mq;$é£I&L˜pøðaÈ™ÌÌ̉'‚Ž.\ˆ~ÞÇKÄ{ÃiC£I ¡à»t饗 ªÐ‘Ðf`²ÊDgƒŠ'wfЖ°²T!ƤI“Ðöxõã?ÆG# c*pï%ÓîaFËÉå&1Ø’±|í;ÿ:Õ3H~æfÁ‹#ð fYÑ©î!ïp¶¿Ÿ%ôªÑŒÃáÒ„Ñm´ú3 Z€©5•ïÉãÍLcó[+ÄRL Q²Û¥ðpÛSŸ9-ÁfÕÓÊò¾f÷ªTNWÛ¦ä™ÊröÃ#–W%V7V~ðÉî×_žÞ!{Ž €ë‡ ¡€c°9¬Ïd½—îÉànXÙ2eÿþý„à ÁÉÿxýf¼|ùrX¬7;àÊ–)I¨çü‘‚8ƒ/@¦ÁÂ/ë©‚?ð{7oÞ f÷’ƒwü+:rccã‰'Ú¥Æ1äH~šT jŒ¬ÐE6$@i×^{-ÙR‘r"Ò»œXtêE¯Ç§ Dë¸;èu˜1sW]ud;™ ·iÓ¦o¼´ûÒK/…‡‡9]¢OŸ>p¿ho¨øØØØ²²²“'O’»íd2 }- ß¾{÷n4?Ú>:$Y‡oôèÑè“(çõ×_‡YŒ7ΛŠ%‰ {î¹gݺuÏ?ÿ|kêˆîµå5//HþþTجp¸7Æ?xïÆŒôb11L7c8“³u×-ïÛ»6ÏÏ[—_¡;­v‰9;á/Ã,Û•Òõ|tôŽÎ4™²öV¬-êj3*‡Ü=.øã÷nêÕóÜôtÍËMºVò,âÙKP]oòyŰpc3£¹ÊÊ:öâïD-B˜/]ºì Ë!CïÉÂ;dEL—YYY`y˜Y-™äpà›ü!{sB­ƒñɤ\ð˽÷Þ;bÄ2hgûöípç§8„ùùù°íÏ?ÿ×_!Û8_\¢wÒ÷Ê|T)ê4 évþìü‹˜•цc2‹Ü¥ƒ¾QÑÑÑÞë(¤¤¤x !30p%x/åyÑyß}÷QÒÿAVÊF;Aìýõ×Ö E6¤¿é¦›ÐUÈ®X r4 ø\h®¹¹¹¼¼¦@Æq’³Pg(Ìu$ã.àN@÷¸2))髯¾Z±bôØ‘ùdf/¢  Gýç?ÿyÿý÷w¬Æ0ô“o’’>Ù«¥×ÚÝÌÙ]Y¯0çJañj~rÿB¿° äý•å\Leƒº¨(ÊÅŠ%9*Ïû3.ƒ¾·¢žá1´ŒÊçøôl®A³XÅbß]pƒ/ãër¬àgY\Lèžå<¼¦ðñ~õáÕ N“˜qçmC:4^aK0X™ Êx&ßBy@ž“aÄà0›ÜÜÜþýûgddQ˜7ÜpCrr²ïÝ]>¤Ù­ñ¬# Mã»Ì ‰P Ñs­@ùаx#YM¼OF"^©_CÛyÃr‹5Ÿ‡®¨¨@?…÷E»xGÝš!#bKKKÁàPŠ$ü"I!®¡‹‹‹Ad’¦7±CVePÿkÖ¬)**"Ëy¨ÒÿÅ1~üx™Õ«W£ ¡Û<òÈ#ð´Çÿæ›o&L˜€VAC¢íáÏãââ`;w¾ÏFtèTh3œA|€÷Bš¡íÉ¢¬d¹«>øþ|̘1è´hoﲈ8F¨±dɲR¿wõŽ…`ÃËOw;FœÜ¾ëä½¹M¬ Õ÷4üTmÝ×OnÜUèǪRh ñÍ¿Þào|÷Ãæ‚CC޽¤×qá‘ú –ôŽ>H¿Ñgì÷·ŒHê×&Ó¥ÖU«YÛ„€ ý-,×Jú<ÈJ1Ú~sm}ï=›“#zåµ› ¾£ÓРAƒÞ{ï½Å‹ƒ|AFdÁ5!TÈÀ!D 8`?999d×6l ¢Ä›Ê÷Æ‘dô0ÉT<óÌ3íö«dº©/À>döxuu5®Ÿ3gNG_ì@å¬Zµ õ@†á‘ù7¨Ð4ú&ñ¨yôPr?ÍAV¸#>5""‚lƒN¶?$Ï8{€ÄÉt-ß=ÎP^"Cû  ’Qüü÷Ì™3)éÿâ .ÎͼuëÖ3f€ÜQõ+W®ï?þøãèfP÷h(}:¼=Ä;•Üp‡³#d&uð*º«wc{¼ŠîŠWÉp:¥K¬ŠÄìdbb"ºV‡¸…{1̦A3¦ümØè5kŽœÌ¬ø¿§'û‡ø 9~lñ>C³cöÌþþzBù‰»ú2Kß`â‚4!šÑ„–©X¼Ym½cxVvŒâ¬imöiÒTͽêu^´3Æ@¢J[yŸg¡D– Ñ¡GNV•W6u ¸È<û»ßýêâäN¦A7ìÚµ‹¬©C‚¹Þ}÷ÝÓ¦MÛ°aŒjÿþýÞ쿱d¬ œ¹=8È|ePHdÖ¬Y#FŒ€A‚Jn»í6ÐýòåË!üa6Ä a¢ƒ}ÖöÚºÓ­[7rc©ÝîW¸þƒ¤­Û1>Ñþø Ä+V¬@øÛA§‰þ@Ùwûí·#ÜÇïe<Ë­£Ð ¹?ýôÓcÇŽm‘5·CÈ]Ê ‡÷¢×ƒÇÉy²²úù«§Æ'ks">À5d®/™ÌÕ¡«±Ã¬§ïmKÐ=t…ÖBøÜ¥K4dÚ~Ê”)è0dŠ#‚5x{´.:!!nׯ^½ú‹/¾€À¿pàdRÒÁàÀ÷yoè{G€ÁaTVV¢;¡'“áÆÇ^‰[ƒ hè\¾…µ䛇/ø²1¨ôd×a± gmÅoB"ÆÚ7×•Ö ¸jP°¿I«¯–nw¯]À7dðaúP¡õ€g9~ÁÀ~¿C¹çÈÍUqE®Au;œÒs‡Z­†+Œ˜ ’ä>˜&z­Þ©|äžà56"ùaÌxµ¤¤Ôæ]-ÿ"€ Â$ …XÎ=vì¬Ç ©^½z]©¤ß¸sçNH{rÿ–Œá>qâ8Q”wØè~ÇŽ8éÍáhžL¶‡.D hœ!€ÈÍóŸ æ>pàÀÊ•+ñ¹iii 8à°°°øøxªôÿ{@ÓBì£Ð´‹/~íµ×ÀõPú{÷î½êª«@Êä>ŽÉ7§NúöÛo333¡³ Ó Ë>|%@ô+¬Á»Í& Ñð$ô†Á2ð/.†L˜:uêÉøçJrÈU}"_¿Ëµê4#ø1¬¥EæófÆ¢–d……H fÚ“Ÿví´2²Õ¢¿íÙ^QÏç¬Ãñ¬ ÊÕ•KOG*‹YsÀ»„EÝtG°´”Ñô!:ž|ïKú'ѦyƒË¦4Ft þ`Áõ}z‡›ŒÓ)qÍ5×åž¼CwȠ‚Ħà}2’„hy²Ds»¬µÎ"3QT_FŽy×~)X˜¬qDü%?y÷îÝ$‹®ŠÞ ‰æËø¸¾¢¢âàÁƒpŸ øo¾ùì¿ÿþ”””®]»‚ýQŸÄ1+ŠBfó  ‡cF}’Qžø¬GyáÚ¢B:â—ž1cƺuëÐ~8^²d oBB:ôþêÕ«¡åqÂt9?`À€×_ļü¸fÑ­[·—_~o$«lÂH—ƒ Aˆ}çwBa¡4X J(**‚ ã:¤ÝËŒÑ&,Šu³Œ¨Þ—Sk(gÌþ/ê´ÞV×·cA ž%šæiƒ«ÿº£â¾{f LŠf:+@ëIafdÆ–7— ƒI{§k~¿ Ý{Çí@âÀP!_žzê©Î Hî¸ãŽåË—£?OIh*°OŸ>P!PoPâÐõdŒ5Ù«€lJ³oß>ü :xðà~ýú}úé§ð¬8Q· ïCðÅÅÅEFF655mܸ‘¸\CF[‘[2”ôÿg@SÝtÓM}ôŽóóó)O:õî»ï>pàÀŠ+¢££Áã8Žˆˆ˜?>¹·“››»lÙ²´´4xòßüæ7ðÄ·‡††¾úê«yyy° tEH'Ýééép df6ˆµk×’-ñ:!CiaqûVïˬ­µHö˜(Æ%hŒ‘1¨Gt}¯o˜Õªë‰´'ÔŠ÷#hb›jަˆ&c˜ŸúÖ:1_<|èÌ¿Jô½yЩ I†ÖÔÔÀV ãäÉä~˜Y;~ow@† P k¾â Ôn'Ù< tOvóÞrc<÷öP doôxß»úibb"ßý÷ß?~üx9!¾GpŸ]WWGk¢Q üQÿ¸‹zÝ“}ê}÷á¤ÿ?XÞŒcÄkcÆŒñ÷÷ï¿óÎ;o¼ñšêÁD@fG˜ °iÓ&\9{öì_ýêW¤!}Ñä¤$¸ŠéÓ§“îc\|×]wuZY* ¹6?'ä¯ÿï0_œ9ùê³ÁýÆ0²‡ßëK£g±6¯ºoy¼Ç¬h¨ÏÉýhUå¹q"¯™5{‰d11+¿?vçÜ!ÇtíœU *++[¼x1¢LĔӦM# z¹’õ¼r¾]ŸdŸ!PŽ;EÖÇ{¡o½õÖ+¾ê@ÍdÓZôMr× ÿÚív²ü™waD¯Æ'›j‘½4p1Ôºï=1 NÊÉÉAN˜0üðæ›oƒ7âãã¡qÙèÑ£!ÉiJúÿK ‘Àů¼ò ŽÑ[Ö­[wóÍ7Ož<ùìÙ³`4Ù? /Á‡5jÞ¼yß.Qf¢äøñÇg(=73wÞ¨‰Ófü¿¿ £o®ËÙÁéšËΘ=+¯y¾@ô>+š4F÷<¯|½¹öïYý‚-Zm³Û/6n€Ÿ˜—_}ï#’úGuÚ*=ÝrË-áááK—.% rž¬ Ãö•öíò9°d¼ Ò"”Üì%÷®`ê¡êŒüàÁƒˆÔÉ T™NEß;úž¬¨¼gÏ8H²¹¼Ûí^½zõù ÒõíÛwÁ‚+W®œ2eJDDŠ"»ìÁ“ †z¥uêŽûÕ‡ 6|øpt£9¡ý…‘Õ0¿ýö[œ„ èÝ»÷ܹsq%eðŸŒH«9ÀÌÄt/Ù°ndžCãÆÄFwá5SgÛtƒÆðšêYc‡3FS]Âø‡)ÖF®¯p™L %UùÕuýžzrH°¥¤¬¡kL ­3×'Y•7$$„Lñƒ€Ý!†d’Q»‘ø`v’ª««ËÊÊ"ÃÒcbbæÌ™º—$éöÛoï õ=÷ä“O"ÄÑ£ºà&Q!äv·wH>Ù§Ïùùù6l`fú¦±dÑ–Êå5ýS÷6=»±ÌiI­ïbäd‹Å@«ð|ôë×Á(Hôf'wÓÒÒN:…ƒ &À¼!ð—/_Ž“œ9s&^"kË$&&vNÆ'ùh»½{÷’=ï ÷*ÁŒ7îp×®]%%%åååd~·nÝ~8ãwµÑÑzÜþáÇívû’%KÈ"'{;âŽ6—uF‚a¦_“0fT÷ÿ·è`ŸZ­hçþ”}Uïžê¡-GëÂo<|zNâÑŠÌü]¥þ!&Y’Eóu ³¥½½¥¹¶¾3ÌÀúi˜={64þÂ… ‰¨ÏÊÊZºt)‘óAAAxéôéÓ999ˆÈ–~eeeLë*›¹ÞÆŽ êÏËËC ”šúÿÙ;ƒ)²;›da%9EÈAÉJÀCHH<ÄŽ'Q"8‡ˆ“ÜFñ¤gEÑSPINŽ’Ó "›8ÂbA˜CÌh  s•ÍnÂæ£ø(ªÛžžqÜ­îþ¾ÃÐýªº¦ë÷þï÷þïUõ«{ËËË;wîÄýQ‰î“ž€„··oßf„d˜ÕÛòçŸ`ÝWÐHΟ?ÿôéÓ={ö`÷äGÖë;…ˆùhîgý§ ÿúüÿýþv\úÕ¿ûÍÛþäã‘mŸþç³¾ýÍ»þòk_ýÊ_þó¯[þɾï|ãë#êÖ…gϞݽ{wnn[ÏÃZ<øâÅ ÿñãǼ%ª¯\¹B¨ówddäðáÃÆù†ÖÏ©nܸqÿþý‹/Þºuëúõëôûöí;yò¤â ²é˗¿_}öáïÞÿèï¿øÙ¾÷Ýoýãù§W;?÷‡‡##ïûé'þc%Z-äõ333=:pàÀ‘#GÈaoÞ¼™E¼=zT‰:Â(ãÆ‹‹‹.\ؼyó©S§¶mÛ¦,š¾|!£®?yÿ½÷‡u}M_DD„÷2Šˆhú""¢é‹ˆˆ¦/""ýACï²8wîÜÒÒRy»ÿþC‡õþñ™™™Ý»wïØ±ƒ×'NœxõêÕš<¸víÚ>Ø–——§§§j"pjlZóÓ!RM—.]ÊÊz„ê R¨Ó§O7\·œà–-[Μ9“sL0ðßò©ÕJéQÃj`÷Øæææ¦¦¦àiÈŽøÕ’îUÀþÇ_÷xxþü9•e¦ÿΙk±.;³i~~~Øúv@qüˆ‡Jb:&>½¸3î™î*/Ö…{÷îQ)W¯^íÅñWÕ Š-rð!|þO-à× Ò”~wü _†Žš¼&=|ÿjr´wï^ /(‰“§YÒ'§’ª‡ªeý4¡ìÌI²®^ÇÂZêG[¢•Ç\mªûÅ“µÚ«ƒt@ظPÎy•L a‘7Y-–Á¦<>‚—œ«œu­ÔKIçwíÚÅV ÇÆÆRw ת#:ðå‰Àj9#€”0 Æ8ßDHv®Æ/" uG“íÛ·'\ò‘HT›ÚaŸZ`ó"£¥2EášæÔ[“ðv¬ÊË—/WÍñí‡/ïšÚ€;a†Î›6mŠìœ,¢%>'''QÙ)A=vFœcÇŽñ7c E×K9ÒQBy|&:aŸ¡È?ðåÙÙÙ©©©Ž5ßO¯@H—˜D@6ÅñS;”³O5°«¹K{_4¯Î‘¶We¼ŒA'ÁW%$šÿØêpéÒ§rÀ¨ÍÖšŸ¤ÖÊ·Ê4Jr„uŸYÓ¯vïéxéZ“z#.múH‹Be¶ÒÌVœîäÔJò£ ¯Ÿ¼¬$µÂTê>m5%4›½-. di*Αó*q_kQlÍÚKaÖ|É‹DtÀ%ózµ15û§{È µÃqºV3! \h%9Ób¦œ ÆÑ>aXˆ=ž,œoQJ³¸ðª¼¸h^K›Ú«r`&sˆí--xýòåËÚÖDlF´))QÊ3Ž$™J’?ö) ¥ô%å°ô4ÄF¬)Ou`­é¯}z§û>áÆ­’HvXåP¯e„»Ú/“éŽ ðseÖÎÿåh¤½_[ûr;N¾-¡ÉéÖ5¡r‘Š„h !›´”ãsÌêÕ¶2®êwˆB àtŠ5 âˆö6WG8`Æ”§Ë5ƒg z×<}I™ÌlªT_LïtœÕòžª,eŠxEµñšã'hûdQÕújïšI?ݲõSg™šL¼RI')LwM^›)šœœLâÃA¨Ñt'q¨L4s„Ž…Õ¸ÉTxb‚àËôNmž·`è“-x‘Æ@Ò—Å/µÈеP$*Yo#H¤(í­•Q®ö7üþˆ>[ sŸ¥¾ÓKã2åº ­Ë/±išÁt‹ö›KF“4'»QH{æ³ «í0¬å [ ›ÿd5¾!¡Y.92&ML'oÍÜqFBŒØ„€tgØßɼg'×Áh¹TX6­ÖåŒú"ê}ðljsÖœ¢½É†ÆÇÇq|$í*蜫É02¡¹Êí¡íámámÂs$*b^Í¿ŠÛ;<7Úҥїsš¼åõ›"ÚÌ vpAg ‡úœ=IDATXÃí—Í\GÅ·ê½×ݯ{ÆcOì۱㠄b£$&AäC (BD H,X‹lò„ÿ+R6aÄ2‹¬#eÉD  "@e‚0 Æž¶ÝŸïUÕ½YTk<É´°¡¤R©¥z·Î=çÔ½Õð?r+}çÅ×PµîÉã·=rq4k_ýíù_î«;ñWßûæÒ±Š[ð¥{nço›W¿Ö«ü·æ®/Ÿ»ÿAcüù­ÄrKí^–Ç~òÏýììþßÿcôÄŸFtøŽ#U·ˆO¾ñÎ¥Õ{ø î:óÞR!wHðƒoCœƒóìëöŠ#uÏûÂ+¥K”¢öR÷ÇÇï9ùÐwën÷῎}Ñí÷9¿Ù´ƒÁàõ;ÒÛÏ?òöÓÿZ]Q5A±Ò׿¯/Aá…áЪ;O=sðð§¿‘æ[fá Ä+œkogíЉÞU­ûz&ZÑsÇ6êj­_|ecÍþýÀ|x ç¦*I¹lÆ3À{ò€w†:ë'Nv:Õ:‡ŸâÀ‘SXj9û^Í%î&¹š£]­”¬ö%ôÂ+üî⻀¢*F#a×ê~W/™‡œ<ôI>Sï£7½HlAãöëÅö »VEi¼*[/ÓëõéÖªz@Q÷)z|w€¯j€ÙÓ1ªc4±0!¶c¤š§šh–òÀ…¡MŽ­Ë )ÙSŒ¤Ø ÁaM×`LÁFXªp>!ÌÎæ s”/‘¤&¸d‰7oíOàÿÇa|d¿RB<¡IEND®B`‚qt-client-4.1.0/guiclient/images/uninvoicedShipments.png000077500000000000000000000036741217451700100234230ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœGIDATXÃÅ—[Œ]UÇßZûzΙÎt Ì”-Vh1 cF ÂK1$&bCˆÑ(^/ƒ†˜Àƒ ‰/&ŠALh4h0ĤK|Ð6ÁKŒM(öBIÄÞ¦fæÌÙ{Ÿ}YëóáL‡BÇv4&þ“µWöÚYûû¯ÿ÷_ß^þÏ÷|Ï4@èU‡œGœW¼Â¹½Sð¼*΃SÅ{ȲΜ:ÁìÌt³ FÔÿõ‰í$¼wÀ |XD7–Ø 8…A¯Xœ‚Å«`D1^ð¢´Ò”á‘\•—¾îï=vìØàU»ùNÜ«;WN QíŒ …×}èŠ4¡vžÆ)eíh4Ni¼§vÐxÜ;¥ñJYÅt'Zü{zcÒ^u'Û}øõ_=ýËΖ/úÞ|qÖÎêÔd=Ž9M–C§Lmg¶QJàjÅמ (½Ò÷J‰¡ˆ:ŒŒ´¹ãšÍWÿaxøñKÇ.ÏÓ4Ý=ûI^Ùñ•‹€À€µÂáCgøóŸN±û…Y†7ŒòÔGÇ9íàD©d¥§Wzz}O¯tƒû¾£WzІ´0Œd§¹fÃek:Î7µ/n¼Ú̽²ã=ŠŸG@k„ÀóEÈŽ2^îŒàoš NZ±¡Ú±¥›¥ÖŠ ­Å¾ôâQ^:%Œ'$¡½^½»Ê7ÍÅSÁ«bPÚë†YûF®Ø¸š^;B; Xc#BzòÈÇž¼´ä©'+yåÉ+OV$¦ÅØ¥1oö¨œÏÓÀÈÅ VU¸m²Ã ×D¨ŒiȺ´B¥6ÔêH©ÄQ…J@ÕøAs`â’(¢3`Ï¿¼ ½‚a¡ÈyÛZ*ç) ÏìlgJ/tçæ©$¡tB–eµÐ×~QP” =3T|êº1¬¬aeª%Œw$UŸP CAHdÂÄ£Xº „±à±tC¿¼µä¹¥©Á¶qÄ LmdYÿÖ„F„h;‡Ö5èÙ²© Ê ^ ÚÙúaeðBT! ÁbðyÀS""ôUQ§,4ŠTŠSO·ïÀ9…¼pÔ^hÄ“Ž~å¨Ä±Ê8¢`° ksÞr/àkFXQlICÒ cé§1b,YÖ€6LéeƒŠ)aŠ/e1²X_V¨€.)0sºö44Ìg ZUTÞЯð¡ò†¼—S{¨¤!Ï Êª¡ a,ªù̸!°ƒô¬xœ% ª¨÷\j!Ž Ý¶%m…ˆXæƒ0‰06 ÏÖZÂ8%Ï-UíâW$¡Y”_äá;Ƈ¾Õí¯ ‚ kS;ƒ¢çA]+"ˆ1œ®ÄË\1Ç®—wM8qà{ã[Ç«eSÀ9ÎzÀ޹^UMíÝù µ:=?}r™‰ 2èQÅ«’;EÏ|í±âP…¢Á¸ÒËj*'H ”ý’ªö„qÈúKfxöµ]:y˜ãsǹë#wõ¼õÁGoØxÃcuV÷ÇÇÆÏßï@IÒEI­Ç ·[ –FÓiQ«Å©`[É༈¥± ýÚaÀ߾õköÍî##cÛÔ¶â¡›úÎäúÉÇ´Ð:êDËoÃ¥ð N‡¡N‡±³ƒ²tY"y΃wáXïŸüàÙßP$}nÝx_¿ñ?š\?ùÃz®®£ÕÑ;ŠsAÈR9Fd™@ƒ±ÊU”®|דNþž7ü\µî*¾pý·sWݸ{ïá¼:7øX T•#3G8púݦ˖‰-lÙD^æ vpAg ‡úœ¶IDATXÃÍ—;Œ%G†¿SUýºswgÖì2ã–VXÞkapHd‰‹ˆ !ABLFèœÄ" Ø„„ 9ubñ @BF€7¬¬Ùõî¹s»ûvWÕ9}gÖÞç] ŽT}ÔÕÕUýç?§»àlrÇOÞ»P¨Ù¹¬HVC >é³*¨Y!›¡ m{ÂLJ±¸s+Ÿ´ýÒ‰éŸ~ú½Ç÷w8Œ¯ˆÈ;ÎSyl0yË ²j‚é bÌš†Ý½=òØ×ïݼyó:ð¡å-ò‡¿Ú@2›ïŸ+®}ùŦ!f%ecˆ™”!e#©3$µé>Ia¬X¾0ãoÿl^¯wοŷßþñ¿~ý‹_Îßø®~ÿ³'ðNÈ çOhWܸq›¶ƒP5|íÉ8’£¡QAµ޾œ³··Ã7¯¼òòïvwß¹¸ÿ\×4Í»‹«¯ñÁõ> Þ ÿøûÇüñ‡¼ûþ‚Ý—žáç_?àv†£”Õ ¬ÖÊjÈÓý:³”“>Ñô޽ö6W^úü¥ù|þ£dþ7—_vG\¿ñˆàœpÜ\¿å/ó=ô«/PÕY娩;•g§rgmV:f¿SVÕ3üöP8Ø­© ÿªiþ¢¦ôä'¨cçù]¾ðæe^¼|W¿´ÇN¸ä'BW(]éè*¥<]£´C¦•nTÚ!P»û+þ½*Êá¸k‚“'p¼ fð׿¼~¥ÄÄá\¢;Y23(KD±4FÉŒ…k“N-ƒC¨J¨Ë’ù¹€pý‡‹P œ'}Ç]ï³Ò÷Êb±$ûšA…åÑ1£Ô YhÛ–> k+X÷=ýXiÅ~ùÖµ}¼¼c;ÁÙÄ„ÓL=®)Ìq.”>QÔŠáY&(*Añ,kÇ: ê=]çI4”ø”©‚L¢vòP¡!;9c1‚–M1¦z5µÓúáešÐ3CD(ƒ#lßJÞ± ˆˆ°6òq’ lÊr!g’A×g¢ I”®Ï¬ÇÌ(™ó.S†iCÞ îí>FÞMB¸„²ò4µ£žÄy–TM…8OÛ&Á «vª˜R4è ›Ȧ¾lÉ€10Ñy+*‰Äq›°qdTÇòxDƒcTG·êˆ £$º®g=‰ý2òGðSx¶Î‚Sf†©rÑCU9–;žfV â9E]â| k3Þ{Šª¡ëŸsn>gÿ´SÎ.g ™¡cš2$&Cž6 Ȫõ¯7×Õ¶Ë«MgEýÄ¹Ñ ¢šÄd]á]÷°÷@pŸc¶7ÛA·Þ¿šžT³‚êÆ”Á™9ùtÝø?±ÿW$øº¯ïLmIEND®B`‚qt-client-4.1.0/guiclient/images/viewCheckRun.png000077500000000000000000000020111217451700100217420ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœ”IDATXÃí–Ï‹UÇ?U¯ºgvgÌf’0„¬&!KÌÁÅ D0*ô˜ƒ'ý;Ä?@п"àÍ‹W=D=êÁK²¢+LËÆ$;;¿ºû•‡×;éÙ¬ñ¨à<ª^¿_õ¾õ­W KYÊRþï"œþrSöÆF+‡n :µîæØ‰­• Í7ELÑ, ¦H¦HÃV[ì/ØÐ,Ù¨–àÑ^ÿ`‹á¨xmscíãYŒ:*#“22®œIUÎAG§pB ‚i„4õM†­AÁ„h‚™F ú9ÎwÖ[k¡AÎX»õÞJ÷”öL©€T•;…;Q8öÀÇ}M}kŽéâ\¦8?ŒâÈùBìѤdZ2,„k›çY[ðˆ¤@ž)Ѳ3MMeQ‹€AÁ“>ÓÔþ,Kî FU… ØÃYÅA¹Ev·eûûìÌJöŸi1 Âçû¼tñ³˜6£áÜa&£}ö¿ƒ8ý³çè®qPR“¤%Ó¹cvT0ž¬Ì ?ßÝåörõ ­ûpªÍ(f­÷iܨ‰@ƒÝß~u %oÞüÙ8O1›¤Ûåäúi4$bj°ÝQAQTœ(#®Ê[7¶xùú¬×FOä¸9½(Tåc ¯m$röÂ%>üä3T ˜â±éÎçf™¡î)\ÀÜÇ‘L©ÜÙùå'öÛ¬?{Ž+¯¾*TR!ZÃïà’Åkh=Á4qq‚%¨ç¨AÝSjzDLó&˜¢áHŒƒR”&Ãó˜ÍIÕ°ÉèÀ!Z2ŸLéõûhP4S”ÉBÚ0S4(—®^çâÖµVǽ¤Ýí¤äÉ,˜óAÒe1åö—·Øzãm66/ã^Í9bA•DÂúŽ&yÍÈ,!áUA9Ïc}x¨×¨ˆ×! ¶oèöj›WÞ}Ÿ^¿OŒ%wEÔS²€J"µ¥ŽÔÀJ»Ãªtbw\Þ/Œ5ìXµú”gX›Ïq¾Š¬tþvÍgš)Au0És½÷¨,¾þæîŽJödå µ®«Û?U½,Ôãµ("І€A倉)À¢r“…ÒY—ÜæÁGKî§Òm8¢ ûÍת”ÿö¿ÈR–²”ÿ†ü§Ä"ÿ™$IEND®B`‚qt-client-4.1.0/guiclient/images/viewFinancialReport.png000077500000000000000000000031431217451700100233270ustar00rootroot00000000000000‰PNG  IHDR szzôbKGDùC» pHYsHHFÉk> vpAg ‡úœîIDATXÃí—KGǧªúöí;w<øí±•D¼$ !#eÁ$Ègà dƒŸ!+ˆ‚…7àK ) P¤ @MÂC(ƯŒmîxfnßsXtßë× ÉÀ&GjG—ºªþç_çTÃGò¹úû"|)+_IÙ4d5²B6l#¨²²³úØØ‡ßë ›¦åÞÝÛ2Û½uwÿþìç¿ýÉ•÷Ž]ø¬îÿæJ¿€Ÿþaðúská[ÛÓ€šaf¬l50z?+¤l¤lÄl$íí¥ŽKˆÅdÔ‹šÝoqmwÿÚ߯]ÿþ{üÝÖ7·êÛ?û!xA N |êÔø©`ËÚOÞE¥ËF—”˜zÝûFÌ:h#æ³ÍÀÙóó;;;ßÝÜÚ^ÿËû~ãå×~œƒw‚3p"O7ï„~´CÄ@DA_7hª³5íX«Š‘æ_;þù·ÀÞ Áõ»§Ÿ¿ŸÚ c'Î^IN‰Î‚3ºe,NFx·Á¢iÙ^kNÌæõ¼“w‚ÁIÿÁ›7÷ØÝ=ĉ#F¡máãŸØääÉŠƒ¨Fì'Ÿ®HÈ î6iŸ†dã´QiÛ–vQ“º–³'¶ÙÚ>NÕ®B x×,8áoý•Û.øÇ­È¯ßÝçÚ\¸|é"_}å,Ì3ïïuýDQiâ ÓÝD]½ëí^/ êÙ.iv“¯½òãb‹j<Æ;zšs°×V\ùå®gOwâ8òÒéÌ1Š LJ‡w†à q`N1q˜(ŠëQ±Áf©+Ôï ÓMÆÓu,öö‚A1xñs§ù|šðò‰ Ÿà¶+^885”>2«ã;Žû]2šÔ£ÐF¥MJΛœÙ*¸v¯Ã;ú,Ie&\øä_Þøx'„âIþ(¼s¤œ‰.p·¬P ĬÌM‘8&wBTˆ1ÑÔb±º‚u[#OÊJTH'âH&Äl”ßxÁáä°±¹AŒ‰éú:§W=ìä±þZ3Ü û¸‚-#Æ`KyØ·UvÙšŽ¹s³ºá#)0¼/ðþIZ vpAg ‡úœ¨IDATXÃíV[l\W]ûœûœ‡ça{lçaOj;NÆ›4T¡)MJŠRhˆŠ -P@*ÑPÛ?ñF"ˆ%¨” Ô‚dÕPŠP¥B)-NKpŒ:qæ¿Æ™ñ<=;{ïác’ÚŽÕÉ|Ð-¯»÷>Kk­½ÏÞÿ÷à7Rôm|UÔ®‘7ùÒ½8òãÛyhÃúݽ®ÖWþOž:Šñpù­éz/ÿùWT³*‘âÙËþƒn¥÷i¹sž¦Ú´îá >ŸRl$ƒ«dÆ'†ìƒ­å‹ŽTãl’Úé¾}A·µ¼ßš Þ…šÉÉçÄ–L)ÿH\örÊßêËJôºZ¬Ûd2B,µ(Ë‹¹é¨HGg¬Äù˜<›=›"Ì-8}vä±=€U-ãÅk0³>Ô+u¤$/eý7 ‰)ýö$s¦*µ¯×óédÉxpLåùÁéMa@o±»$­è(.$.¥“ÓiûülBLÌÌÛ“3—Ä;C¹¹f«—ÊR'b8±t'-ðÌOöAÓø-ñˆx$›ÏÙ70|a>§ HŠã~YÕï…¨·çªÈ˜ª2- [cu{‡ óéÌBñXd¦6ÿ»a¤Ã—P€n øúã2²yûŽŽ«Ú EÛÝë;ØÉcO×0øºXÍÀÔô" ˜|Ì­MYcSl†1±d”ªõâ÷ †Î0sú´˜ß±ªkƒç©¶fŒ÷„§¿øÓÙ’}p/áQS½%ăÍ>ú}le—†Û.NYž»vóüàëæj…Ä( Ž3­-ôkFæÜhÇÏ^´r©¯0ú÷ËPeÛbŒ1ÎÕUžé 2ØÝNeŸªgî—Q40£ª´ÕéÂð•<¶¼¨/h¢£ÙÜÜî3Ÿ÷¹1·«Ÿ‹Ïî竦Œ3€À1âʊxìèf¸r9iü£’‘Ê Të¡Ç( é©'øJ œ±d]GwS¶¢œc›ÛM8pëÛ`c Dì*ÝAŽ|a2àÐI õ²©ö!<#ðÐwœI2T:}>¾R‚¾MB ¨kT|¾žÙµSšpj8X* ížH•“ÿ2—F‡_a€$±%7·[{RÑïÐ~cÔ2?ñÍ: tS –…7uý$Sô»±/ððƒ*\Nܬ©4~Ï>Û7SÎÈ( º=Mtm®’`ÿ†‘qKsê´ÞÛDëÚ—TŽÍ $3"j x˜m{·ôð€Ç~Yñk*¹}^Š:tÂXX ZØ-JÔqøÐÒÖæœVJ°ŒM9:¬GQ°Øç¯•ÚªÊäq(ù”Þ6SIFLÓ¨"^«SHkH°©“¡XBHU(–HÚµSa ªM°Moë¦Û[n•Ûˆ[Tb§+¤ ³õr­½,ÌÇg­Ê£[×yàjªÀ£¨;î n&ëpLM¾ö‹&ÇkÒW`?g)}Ý<¨jxáð¯lÀ³ß’-£‚ ²Œ~ۦđC _>jƒó¥)[iÂÙx¦EgJÅÅ]÷v…ÇžOHH$È®B’f H糩òp6…ÔÛ˜×.EA>®g:6ÊKšÍÙМÓT:às ÍÙI•† $–$XÎÀÐo&P«"µ® Ÿ{ñ¥K,2ÄË€¸6Å…X…‚§b@WÎ2i®IN4ˆl˜Ð×^D×àÉÁˆø>ZSç Áˆ­©îmÜHg‚€†ª6„mÝHW=Fk ·Û‡Ã·Û ۬ªåÿ{ŽCÆ^MË~¿ÕÙÞ[:ŒM<ç8󬆇?rýÿ¸´–¤Ïïf˜ŽÙØ»ßÛìm2>ì󊃭~ºÓ© wÙ€‘HY¯– ös‚ä¡è´¾àP ñµãµµ´~g‡îÞw×}(²Ûƒ=Û~V+œß‰ê9Yãi8t —SÁBÚ2ùæñTNÿ’Çëÿû?^þ~øÛwöÆšL¨;ýX˜ŸVÒâÉ'%¦ ÍÑŠ–€Í-~¸½~Èî2e'æy­R”úú÷bøå®[Žwãÿ®´¸WÔyûIEND®B`‚qt-client-4.1.0/guiclient/images/xchange.png000066400000000000000000000050001217451700100207600ustar00rootroot00000000000000‰PNG  IHDR szzôtIMEÙ *%8 pHYsÂÂnÐu>gAMA± üa IDATxÚåW{pTÕÿîkwï>³Ù„lH¨@P”—m‘ tZëtj´•‡C¶ÆÑ*ˆ¯ŽF(Z«Ç‚:µ‚–v$u¬:uÔúŠaD(Ødó~,Én’;ïÝû~œž»›ð Èÿ=3ßÞÝsîùÎï|çw~ß·ÿï°>†Þiœ-òòó••¥‹ŠÄ=èÌ·p"LÞã{l_¿G¬hÖÏçðB̧=ÂZÔ6ÐL§ èH7L™ ’ UƒôÈèÑ,MßC[¯~  ¢ÍÈÒÑ·fW1$ILúC'2L®¹â’¯6Ð|à|š»…•ŸŽëÛŽöç«Q#tiž¶!Óz¸gdo í\×Kœ>yÏí‹V\fOíº|3¯€~6P3/€Ã·nGÛÞƒ[·‚99w?BTOˆ[õÞ€ø×ÐTUc2À0ᬑÎðt.r×àž†–‰àžjNmîêÿ¡Èˆ‘ÄàI¶‚`#ì8t˜£C5 «;6Í_;çô¹£m¹«>žm+TŸnÒŒ“f#)𦣹%öàR¡ìË38p6/öÝvÅ-sÝòs³gªÐÙƒØ(¯ ˆŠê£È0ÖynÿGwÿú‡Û¾ÖˆR ‚KA¹‹Câ][hˆF"CÎÑö{ÛvÝùîé$£§€˜yóßl;ægYåÅêê2Ž ’°O^XdúKŸšîø•”NÌlë‚È_ ³ü4,­rÀ%~X†»†¾Á!²=OÔ.Bï·Åpj*"55wõW¦%²þ´ƒ¢ëJÊ+Y‚b –@aÓI’¶³sM’žÿå?þh<80–V¯'^Ö"]^6 %˜îLFáÍ+¼‘=;xÀ8{­)@tºiÆô0/K”‡e¿ë.«ÀŒ±ã˜9ŠF9€4( |þ™`cü^5òr(åÑ]gP.ZTLˆ ˜Äxïöù%ê_vn}@jó°ÚÛqmQ~ÐÔ³àõú—ú*kl@ãHØ\C8*¤ÁPT ¸d®S lt{òŸ1¯’QÙå2Ï)¥|Ƕ« cÇ+;­œo °Zs"aÔ]­Çʪj–±¥A<ËÃÌúN8"¾²y`脨/õÄy¿[O^àҞݳûnéBþ‰o0ÙvT{ùâE/Ôݶvƒ#´!³(Ea}ÀW–u€žCüÑÏŸêOO^û\“t1~é‹yÉj«QoH*Îx|&áößq©]G ½ç8ð£#Dol¼Š]¼X·´ÿ~–—=÷1s–mgʪI„EÆä3 þ”/Þ”M‚`êñ”òæ¡97o.¿ç韺I$_[R±÷Ê+ õB¾¿1h=ÅsÎu¶…u›™Ú夙µõ3?{ôHXYFŪٙ¿ˆåÅßånߺfŽ)<žÍŽ˜ÿûù sû‘&IƒÀCFNI÷EE½ü2ÃñmkARwÞ «t‚ÞÛf.õÀVxÙ0öŒüq¨|vÃîUn¤Þ¯¯uHtyi)GÊ'äîX×XßHß\.·ÒpÚ.¬„ÅÅñtŽïþ¾Ö׿Õèìd‘Š#iI"ÖÖB~À’bâßý9¹=¬0m_~Ó‡7 o;ó'·ÁŒ` ð I! é|Ú±0»`V{¤}ÖÁ΃k"#‘§ãhÍZgÊkˆÉÜê…«®®×õpgçuÜi‰:‰1àmaþéºi†sJk'mØþóßß½®,¶êñ ›Àî´Ã7’!á4 r,ÌNËÉéÜuâ8è€CgeÃÉÆ‘ÙkÌÈð3ZgO)XiÕ*?&Œ°ÄTG0Àk±A mºÿ·¯+Ë´C~´ù$D³QàMPÚ„–¿µ1B€FJ0, @¿Ð +²”|~˧Œ€ðؽK”È`“Öž‹dvÓÄ¢ŽY<g»^A‰¿<‘hvÍóÝõèÊ7Ú]Nˆ qÈiиá<¼¶û5(¯.ƒˆ7 ƒùô<>9»4Ý2m¨½{¢[~S«ŽÇwê]5HRÎá¨UT Ëz>’ɪ¢Z"µ´Ô€X.œž @㸲´Ó…ƒÀGíT @º€e°Ù¤‚d ë¤µü$©ñ¾K³‘&¥³c¤âjgѲ_V“ûÒùM»²¢•ÓqfÛ4±,#å ­§A@ åx÷5öK¡r¥BÔÈäyPjµ0žJţɨ­ùE #include #include #include "inputManager.h" implodeWo::implodeWo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_wo, SIGNAL(valid(bool)), _implode, SLOT(setEnabled(bool))); connect(_implode, SIGNAL(clicked()), this, SLOT(sImplode())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _captive = TRUE; omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _wo->setType(cWoExploded); } implodeWo::~implodeWo() { // no need to delete child widgets, Qt does it all for us } void implodeWo::languageChange() { retranslateUi(this); } enum SetResponse implodeWo::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setEnabled(false); } return NoError; } void implodeWo::sImplode() { XSqlQuery implodeImplode; implodeImplode.prepare( "SELECT wo_adhoc " "FROM wo " "WHERE ( (wo_adhoc)" " AND (wo_id=:wo_id) );" ); implodeImplode.bindValue(":wo_id", _wo->id()); implodeImplode.exec(); if (implodeImplode.first()) { if ( QMessageBox::warning( this, tr("Adhoc Work Order"), tr( "The Work Order you have selected to Implode is adhoc, meaning\n" "that its W/O Materials Requirements and/or W/O Operations lists\n" "have been manually modified. If you Implode the selected Work Order\n" "then these modifications will be lost.\n" "Are you sure that you want to Implode the selected Work Order?"), tr("&Yes"), tr("&No"), QString::null, 0, 1) == 1) return; } implodeImplode.prepare("SELECT implodeWo(:wo_id, TRUE) AS result;"); implodeImplode.bindValue(":wo_id", _wo->id()); implodeImplode.exec(); if (implodeImplode.first() && implodeImplode.value("result").toInt() < 0) { QString msg; if (implodeImplode.value("result").toInt() == -1) msg = tr("The Work Order could not be imploded because time clock " "entries exist for it."); else msg = tr("The Work Order could not be imploded (reason %1).") .arg(implodeImplode.value("result").toString()); QMessageBox::information(this, tr("Work Order Not Imploded"), msg); return; } else if (implodeImplode.lastError().type() != QSqlError::NoError) systemError(this, implodeImplode.lastError().databaseText(), __FILE__, __LINE__); omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); if (_captive) accept(); else { _wo->setId(-1); _close->setText("&Close"); _wo->setFocus(); } } qt-client-4.1.0/guiclient/implodeWo.h000066400000000000000000000017421217451700100175110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IMPLODEWO_H #define IMPLODEWO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_implodeWo.h" class implodeWo : public XDialog, public Ui::implodeWo { Q_OBJECT public: implodeWo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~implodeWo(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sImplode(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // IMPLODEWO_H qt-client-4.1.0/guiclient/implodeWo.ui000066400000000000000000000112671217451700100177020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. implodeWo 0 0 433 152 Implode Work Order 5 0 0 3 1 1 0 0 290 130 Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel false &Implode false true Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 WoCluster QWidget
    wocluster.h
    0
    _wo _implode _close _wo valid(bool) _implode setEnabled(bool) 20 20 20 20 _close clicked() implodeWo reject() 20 20 20 20
    qt-client-4.1.0/guiclient/importData.cpp000066400000000000000000000216141217451700100202110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "importData.h" #include #include #include #include #include "configureIE.h" #include "importhelper.h" #include "storedProcErrorLookup.h" #define DEBUG false enum ImportFileType { Unknown = -1, Csv, Xml }; bool importData::userHasPriv() { return _privileges->check("ImportXML"); } void importData::setVisible(bool visible) { if (! visible) XWidget::setVisible(false); else if (! userHasPriv()) { systemError(this, tr("You do not have sufficient privilege to view this window"), __FILE__, __LINE__); close(); } else if (_metrics->value("XMLSuccessTreatment").isEmpty() || _metrics->value("XSLTLibrary").isEmpty()) // not configured properly { QString msg = tr("The application is not set up to import data. " "Have an administrator configure Data Import before " "trying to import data."); if (configureIE::userHasPriv()) tr("

    You must first set up the application to import data."); systemError(this, msg, __FILE__, __LINE__); deleteLater(); } else XWidget::setVisible(true); } importData::importData(QWidget* parent, const char * name, Qt::WindowFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool))); connect(_clearStatus, SIGNAL(clicked()), this, SLOT(sClearStatus())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_file, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_importAll, SIGNAL(clicked()), this, SLOT(sImportAll())); connect(_importSelected, SIGNAL(clicked()), this, SLOT(sImportSelected())); connect(_resetList, SIGNAL(clicked()), this, SLOT(sFillList())); _file->addColumn(tr("Type"), -1, Qt::AlignLeft, false, "type"); _file->addColumn(tr("File Name"), -1, Qt::AlignLeft, true, "filename"); _file->addColumn(tr("Status"), _ynColumn, Qt::AlignCenter,true, "status"); _defaultDir = _metrics->value( #if defined Q_WS_MACX "XMLDefaultDirMac" #elif defined Q_WS_WIN "XMLDefaultDirWindows" #elif defined Q_WS_X11 "XMLDefaultDirLinux" #endif ); if (_defaultDir.isEmpty()) _defaultDir = "."; sFillList(); sHandleAutoUpdate(_autoUpdate->isChecked()); } importData::~importData() { // no need to delete child widgets, Qt does it all for us } void importData::languageChange() { retranslateUi(this); } void importData::sFillList() { _file->clear(); if (! _defaultDir.isEmpty()) { QStringList filters; filters << "*.xml" << "*.XML"; if (ImportHelper::getCSVImpPlugin(omfgThis)) filters << "*.csv" << "*.CSV" << "*.tsv" << "*.TSV"; QDirIterator iterator(_defaultDir, filters); XTreeWidgetItem *last = 0; for (int i = 0; iterator.hasNext(); i++) { QString filename = iterator.next(); ImportFileType type = Unknown; QString suffix = QFileInfo(filename).suffix().toUpper(); if (suffix == "XML") type = Xml; else if (suffix == "CSV" || suffix == "TSV") type = Csv; last = new XTreeWidgetItem(_file, last, type, i, QVariant(suffix), QVariant(filename)); } } } void importData::sAdd() { QFileDialog newdlg(this, tr("Select File(s) to Import"), _defaultDir); newdlg.setFileMode(QFileDialog::ExistingFiles); QStringList filters; if (ImportHelper::getCSVImpPlugin(omfgThis)) filters << tr("Data files (*.xml *.csv *.tsv)") << tr("CSV files (*.csv *.tsv)"); filters << tr("XML files (*.xml)") << tr("Any Files (*)"); newdlg.setNameFilters(filters); if (newdlg.exec()) { QStringList files = newdlg.selectedFiles(); XTreeWidgetItem *last = 0; for (int i = 0; i < files.size(); i++) { ImportFileType type = Unknown; QString suffix = QFileInfo(files[i]).suffix().toUpper(); if (suffix == "XML") type = Xml; else if (suffix == "CSV" || suffix == "TSV") type = Csv; last = new XTreeWidgetItem(_file, last, i, type, QVariant(suffix), QVariant(files[i])); } } } void importData::sClearStatus() { QList selected = _file->selectedItems(); for (int i = selected.size() - 1; i >= 0; i--) selected[i]->setText(_file->column("status"), ""); } void importData::sDelete() { QList selected = _file->selectedItems(); for (int i = selected.size() - 1; i >= 0; i--) _file->takeTopLevelItem(_file->indexOfTopLevelItem(selected[i])); } void importData::sPopulateMenu(QMenu* pMenu, QTreeWidgetItem* /* pItem */) { QAction *menuItem; menuItem = pMenu->addAction(tr("Import Selected"), this, SLOT(sImportSelected())); menuItem = pMenu->addAction(tr("Clear Status"), this, SLOT(sClearStatus())); menuItem = pMenu->addAction(tr("Delete From List"), this, SLOT(sDelete())); } void importData::sImportAll() { bool oldAutoUpdate = _autoUpdate->isChecked(); sHandleAutoUpdate(false); for (int i = 0; i < _file->topLevelItemCount(); i++) { XTreeWidgetItem* pItem = _file->topLevelItem(i); if (pItem->text("status").isEmpty()) { if (importOne(pItem->text("filename"), pItem->altId())) pItem->setText(_file->column("status"), tr("Done")); else pItem->setText(_file->column("status"), tr("Error")); } } if (oldAutoUpdate) sHandleAutoUpdate(true); } void importData::sImportSelected() { bool oldAutoUpdate = _autoUpdate->isChecked(); sHandleAutoUpdate(false); QList selected = _file->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (selected[i]->text("status").isEmpty()) { if (importOne(selected[i]->text("filename"), selected[i]->altId())) selected[i]->setText(_file->column("status"), tr("Done")); else selected[i]->setText(_file->column("status"), tr("Error")); } } if (oldAutoUpdate) sHandleAutoUpdate(true); } bool importData::importOne(const QString &pFileName, int pType) { if (DEBUG) qDebug("importData::importOne(%s, %d)", qPrintable(pFileName), pType); int filetype = pType; if (filetype == Unknown) { QFile file(pFileName); if (file.open(QIODevice::ReadOnly)) { QString firstline(file.readLine(1024)); file.close(); if (firstline.contains(QRegExp("^<[?a-zA-Z]"))) // filetype = Csv; else if (firstline.contains(QRegExp("^[^\"\t]*\t"))) // stuff filetype = Csv; } QStringList typestrings; typestrings << "Unknown" << "CSV" << "XML"; // must match ImportFileType seq bool ok; QString typestring = QInputDialog::getItem(this, tr("Select File Type"), tr("Please select the best description of the " "structure of the file %1:").arg(pFileName), typestrings, filetype + 1, // ImportFileType enum starts at -1 false, &ok); filetype = typestrings.indexOf(typestring) - 1; if (! ok || filetype == Unknown) return false; } QString errmsg; QString warnmsg; if (filetype == Xml || QFileInfo(pFileName).suffix().toUpper() == "XML") { if (! ImportHelper::importXML(pFileName, errmsg, warnmsg)) { systemError(this, errmsg); return false; } else if (! warnmsg.isEmpty()) { QMessageBox::warning(this, tr("XML Import Warnings"), warnmsg); return true; } } else if (filetype == Csv || QFileInfo(pFileName).suffix().toUpper() == "CSV" || QFileInfo(pFileName).suffix().toUpper() == "TSV") { if (! ImportHelper::importCSV(pFileName, errmsg)) { systemError(this, errmsg); return false; } } return true; } void importData::sHandleAutoUpdate(const bool pAutoUpdate) { if (pAutoUpdate) connect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); else disconnect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); } qt-client-4.1.0/guiclient/importData.h000066400000000000000000000024041217451700100176520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IMPORTDATA_H #define IMPORTDATA_H #include #include "xwidget.h" #include #include "ui_importData.h" class importData : public XWidget, public Ui::importData { Q_OBJECT public: importData(QWidget* = 0, const char * = 0, Qt::WindowFlags = 0); ~importData(); static bool userHasPriv(); public slots: virtual void setVisible(bool); protected slots: virtual void languageChange(); virtual void sAdd(); virtual void sClearStatus(); virtual void sDelete(); virtual void sFillList(); virtual void sHandleAutoUpdate(const bool); virtual void sImportAll(); virtual void sImportSelected(); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*); private: QString _defaultDir; bool importOne(const QString &, const int pType = -1); }; #endif qt-client-4.1.0/guiclient/importData.ui000066400000000000000000000133731217451700100200470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. importData 0 0 600 395 Import Data Files from which to import data: QAbstractItemView::MultiSelection 10 Qt::Horizontal 40 20 Automatically Update Close Qt::Vertical QSizePolicy::Fixed 133 16 Add To List false Delete From List Reset List Clear Status false Import Selected Import All Qt::Vertical 20 0 XCheckBox QCheckBox

    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _file _add _delete _resetList _clearStatus _importSelected _importAll _close _close clicked() importData close() 499 27 299 197 _file valid(bool) _importSelected setEnabled(bool) 206 199 499 91 _file valid(bool) _delete setEnabled(bool) 206 199 499 187 qt-client-4.1.0/guiclient/incident.cpp000066400000000000000000000770031217451700100177050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incident.h" #include #include #include #include #include #include "arOpenItem.h" #include "returnAuthorization.h" #include "storedProcErrorLookup.h" #include "todoItem.h" #include "characteristicAssignment.h" #include incident::incident(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { _statusCodes << "N" << "F" << "C" << "A" << "R" << "L"; setupUi(this); _incdtid = -1; _saved = false; _aropenid = -1; _print = _buttonBox->addButton(tr("Print"),QDialogButtonBox::ActionRole); _print->setObjectName("_print"); _buttonBox->button(QDialogButtonBox::Save)->setObjectName("_save"); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_assignedTo, SIGNAL(newId(int)), this, SLOT(sAssigned())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sCancel())); connect(_crmacct, SIGNAL(newId(int)), this, SLOT(sCRMAcctChanged(int))); connect(_deleteTodoItem, SIGNAL(clicked()), this, SLOT(sDeleteTodoItem())); connect(_editTodoItem, SIGNAL(clicked()), this, SLOT(sEditTodoItem())); connect(_item, SIGNAL(newId(int)), _lotserial, SLOT(setItemId(int))); connect(_newTodoItem, SIGNAL(clicked()), this, SLOT(sNewTodoItem())); //connect(_return, SIGNAL(clicked()), this, SLOT(sReturn())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_todoList, SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick())); connect(_todoList, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this, SLOT(sPopulateTodoMenu(QMenu*))); connect(_todoList, SIGNAL(valid(bool)), this, SLOT(sHandleTodoPrivs())); connect(_viewAR, SIGNAL(clicked()), this, SLOT(sViewAR())); connect(_viewTodoItem, SIGNAL(clicked()), this, SLOT(sViewTodoItem())); connect(_deleteCharacteristic,SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic())); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic())); connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(itemSelected(int)), _editCharacteristic, SLOT(animateClick())); _severity->setType(XComboBox::IncidentSeverity); _priority->setType(XComboBox::IncidentPriority); _resolution->setType(XComboBox::IncidentResolution); _category->setType(XComboBox::IncidentCategory); _lotserial->setStrict(false); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name"); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value"); _incdthist->addColumn(tr("Username"), _userColumn, Qt::AlignLeft, true, "incdthist_username"); _incdthist->addColumn(tr("Date/Time"),_timeDateColumn, Qt::AlignLeft, true, "incdthist_timestamp"); _incdthist->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "incdthist_descrip"); _todoList->addColumn(tr("Priority"), _userColumn, Qt::AlignRight, true, "incdtpriority_name"); _todoList->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false, "todoitem_owner_username"); _todoList->addColumn(tr("Assigned"), _userColumn, Qt::AlignLeft, true, "todoitem_username"); _todoList->addColumn(tr("Name"), 100, Qt::AlignLeft, true, "todoitem_name"); _todoList->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "todoitem_description"); _todoList->addColumn(tr("Status"), _statusColumn, Qt::AlignLeft, true, "todoitem_status"); _todoList->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft, true, "todoitem_due_date"); _owner->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); if (_metrics->boolean("LotSerialControl")) { connect(_item, SIGNAL(valid(bool)), _lotserial, SLOT(setEnabled(bool))); connect(_item, SIGNAL(newId(int)), _lotserial, SLOT(setItemId(int))); } else _lotserial->setVisible(false); if(!_metrics->boolean("IncidentsPublicPrivate")) _public->hide(); _public->setChecked(_metrics->boolean("IncidentPublicDefault")); // because this causes a pop-behind situation we are hiding for now. //_return->hide(); } incident::~incident() { // no need to delete child widgets, Qt does it all for us } void incident::languageChange() { retranslateUi(this); } enum SetResponse incident::set(const ParameterList &pParams) { XSqlQuery incidentet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("incdt_id", &valid); if (valid) { _incdtid = param.toInt(); populate(); _lotserial->setItemId(_item->id()); } param = pParams.value("mode", &valid); if (valid) { _mode = cNew; if (param.toString() == "new") { incidentet.exec("SELECT nextval('incdt_incdt_id_seq') AS incdt_id, " "fetchIncidentNumber() AS number;"); if(incidentet.first()) { _incdtid=incidentet.value("incdt_id").toInt(); _number->setText(incidentet.value("number").toString()); _comments->setId(_incdtid); _documents->setId(_incdtid); _alarms->setId(_incdtid); _recurring->setParent(_incdtid, "INCDT"); _print->hide(); } else { QMessageBox::critical( omfgThis, tr("Database Error"), tr( "A Database Error occured in incident::New:" "\n%1" ).arg(incidentet.lastError().text())); reject(); } } else if (param.toString() == "edit") { _mode = cEdit; _crmacct->setEnabled(true); } else if (param.toString() == "view") { _mode = cView; _crmacct->setEnabled(false); _cntct->setEnabled(false); _assignedTo->setEnabled(false); _category->setEnabled(false); _status->setEnabled(false); _resolution->setEnabled(false); _severity->setEnabled(false); _priority->setEnabled(false); _item->setReadOnly(true); _lotserial->setEnabled(false); _description->setEnabled(false); _notes->setEnabled(false); _deleteTodoItem->setEnabled(false); _editTodoItem->setEnabled(false); _newTodoItem->setEnabled(false); disconnect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); disconnect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); disconnect(_charass, SIGNAL(itemSelected(int)), _editCharacteristic, SLOT(animateClick())); _newCharacteristic->setEnabled(false); _owner->setEnabled(false); _buttonBox->setStandardButtons(QDialogButtonBox::Close); _comments->setReadOnly(true); _documents->setReadOnly(true); _alarms->setReadOnly(true); } } param = pParams.value("crmacct_id", &valid); if (valid) { _crmacct->setId(param.toInt()); _crmacct->setEnabled(false); } param = pParams.value("cntct_id", &valid); if (valid) { _cntct->setId(param.toInt()); } param = pParams.value("aropen_id", &valid); if (valid) { _aropenid = param.toInt(); incidentet.prepare("SELECT aropen_doctype, aropen_docnumber, " " CASE WHEN (aropen_doctype='C') THEN :creditMemo" " WHEN (aropen_doctype='D') THEN :debitMemo" " WHEN (aropen_doctype='I') THEN :invoice" " WHEN (aropen_doctype='R') THEN :cashdeposit" " ELSE '' END AS docType " "FROM aropen " "WHERE (aropen_id=:aropen_id);"); incidentet.bindValue(":aropen_id", _aropenid); incidentet.bindValue(":creditMemo", tr("Credit Memo")); incidentet.bindValue(":debitMemo", tr("Debit Memo")); incidentet.bindValue(":invoice", tr("Invoice")); incidentet.bindValue(":cashdeposit", tr("Customer Deposit")); incidentet.exec(); if (incidentet.first()) { if (_metrics->value("DefaultARIncidentStatus").toInt()) _category->setId(_metrics->value("DefaultARIncidentStatus").toInt()); _ardoctype=incidentet.value("aropen_doctype").toString(); _docType->setText(incidentet.value("docType").toString()); _docNumber->setText(incidentet.value("aropen_docnumber").toString()); _description->setText(QString("%1 #%2").arg(incidentet.value("docType").toString()).arg(incidentet.value("aropen_docnumber").toString())); } } sHandleTodoPrivs(); return NoError; } int incident::id() const { return _incdtid; } int incident::mode() const { return _mode; } int incident::aropenid() const { return _aropenid; } QString incident::arDoctype() const { return _ardoctype; } void incident::sCancel() { XSqlQuery incidentCancel; if (cNew == _mode) { incidentCancel.prepare("SELECT releaseNumber('IncidentNumber', :number) AS result;"); incidentCancel.bindValue(":number", _number->text()); incidentCancel.exec(); if (incidentCancel.first()) { int result = incidentCancel.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("releaseNumber", result), __FILE__, __LINE__); return; } } else if (incidentCancel.lastError().type() != QSqlError::NoError) { systemError(this, incidentCancel.lastError().databaseText(), __FILE__, __LINE__); return; } incidentCancel.prepare("SELECT deleteIncident(:incdt_id) AS result;"); incidentCancel.bindValue(":incdt_id", _incdtid); incidentCancel.exec(); if (incidentCancel.first()) { int result = incidentCancel.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteIncident", result), __FILE__, __LINE__); return; } } else if (incidentCancel.lastError().type() != QSqlError::NoError) { systemError(this, incidentCancel.lastError().databaseText(), __FILE__, __LINE__); return; } } reject(); } void incident::sSave() { if (! save(false)) // if error return; { done(_incdtid); } } bool incident::save(bool partial) { XSqlQuery incidentave; if (! partial) { if(_crmacct->id() == -1) { QMessageBox::critical( this, tr("Incomplete Information"), tr("You must specify the Account that this incident is for.") ); return false; } if(_cntct->id() <= 0 && _cntct->name().simplified().isEmpty()) { QMessageBox::critical( this, tr("Incomplete Information"), tr("You must specify a Contact for this Incident.") ); return false; } if(_description->text().trimmed().isEmpty()) { QMessageBox::critical( this, tr("Incomplete Information"), tr("You must specify a description for this incident report.") ); _description->setFocus(); return false; } if (_status->currentIndex() == 3 && _assignedTo->username().isEmpty()) { QMessageBox::critical( this, tr("Incomplete Information"), tr("You must specify an assignee when the status is assigned.") ); _description->setFocus(); return false; } } RecurrenceWidget::RecurrenceChangePolicy cp = _recurring->getChangePolicy(); if (cp == RecurrenceWidget::NoPolicy) return false; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); if (!incidentave.exec("BEGIN")) { systemError(this, incidentave.lastError().databaseText(), __FILE__, __LINE__); return false; } if (cNew == _mode && !_saved) incidentave.prepare("INSERT INTO incdt" " (incdt_id, incdt_number, incdt_crmacct_id, incdt_cntct_id," " incdt_summary, incdt_descrip, incdt_item_id," " incdt_status, incdt_assigned_username," " incdt_incdtcat_id, incdt_incdtseverity_id," " incdt_incdtpriority_id, incdt_incdtresolution_id," " incdt_ls_id, incdt_aropen_id, incdt_owner_username," " incdt_prj_id, incdt_public," " incdt_recurring_incdt_id) " "VALUES(:incdt_id, :incdt_number, :incdt_crmacct_id, :incdt_cntct_id," " :incdt_description, :incdt_notes, :incdt_item_id," " :incdt_status, :incdt_assigned_username," " :incdt_incdtcat_id, :incdt_incdtseverity_id," " :incdt_incdtpriority_id, :incdt_incdtresolution_id," " :incdt_ls_id, :incdt_aropen_id, :incdt_owner_username," " :incdt_prj_id, :incdt_public," " :incdt_recurring_incdt_id);" ); else if (cEdit == _mode || _saved) incidentave.prepare("UPDATE incdt" " SET incdt_cntct_id=:incdt_cntct_id," " incdt_crmacct_id=:incdt_crmacct_id," " incdt_summary=:incdt_description," " incdt_descrip=:incdt_notes," " incdt_item_id=:incdt_item_id," " incdt_status=:incdt_status," " incdt_assigned_username=:incdt_assigned_username," " incdt_incdtcat_id=:incdt_incdtcat_id," " incdt_incdtpriority_id=:incdt_incdtpriority_id," " incdt_incdtseverity_id=:incdt_incdtseverity_id," " incdt_incdtresolution_id=:incdt_incdtresolution_id," " incdt_ls_id=:incdt_ls_id," " incdt_owner_username=:incdt_owner_username," " incdt_prj_id=:incdt_prj_id," " incdt_public=:incdt_public," " incdt_recurring_incdt_id=:incdt_recurring_incdt_id" " WHERE (incdt_id=:incdt_id); "); incidentave.bindValue(":incdt_id", _incdtid); incidentave.bindValue(":incdt_number", _number->text()); incidentave.bindValue(":incdt_owner_username", _owner->username()); if (_crmacct->id() > 0) incidentave.bindValue(":incdt_crmacct_id", _crmacct->id()); if (_cntct->id() > 0) incidentave.bindValue(":incdt_cntct_id", _cntct->id()); incidentave.bindValue(":incdt_description", _description->text().trimmed()); incidentave.bindValue(":incdt_notes", _notes->toPlainText().trimmed()); if(-1 != _item->id()) incidentave.bindValue(":incdt_item_id", _item->id()); incidentave.bindValue(":incdt_assigned_username", _assignedTo->username()); incidentave.bindValue(":incdt_status", _statusCodes.at(_status->currentIndex())); if(_category->isValid()) incidentave.bindValue(":incdt_incdtcat_id", _category->id()); if(_severity->isValid()) incidentave.bindValue(":incdt_incdtseverity_id", _severity->id()); if(_priority->isValid()) incidentave.bindValue(":incdt_incdtpriority_id", _priority->id()); if(_resolution->isValid()) incidentave.bindValue(":incdt_incdtresolution_id", _resolution->id()); if ((_item->id() != -1) && (_lotserial->id() != -1)) incidentave.bindValue(":incdt_ls_id", _lotserial->id()); if (_aropenid > 0) incidentave.bindValue(":incdt_aropen_id", _aropenid); if (_recurring->isRecurring()) incidentave.bindValue(":incdt_recurring_incdt_id", _recurring->parentId()); if (_project->id() > 0) incidentave.bindValue(":incdt_prj_id", _project->id()); incidentave.bindValue(":incdt_public", _public->isChecked()); if(!incidentave.exec() && incidentave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, incidentave.lastError().databaseText(), __FILE__, __LINE__); return false; } QString errmsg; if (! _recurring->save(true, cp, &errmsg)) { rollback.exec(); systemError(this, errmsg, __FILE__, __LINE__); return false; } incidentave.exec("COMMIT;"); if(incidentave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, incidentave.lastError().databaseText(), __FILE__, __LINE__); return false; } _saved = true; return true; } void incident::sFillHistoryList() { XSqlQuery incidentFillHistoryList; incidentFillHistoryList.prepare("SELECT * " " FROM incdthist" " WHERE (incdthist_incdt_id=:incdt_id)" " ORDER BY incdthist_timestamp; "); incidentFillHistoryList.bindValue(":incdt_id", _incdtid); incidentFillHistoryList.bindValue(":new", tr("New Incident")); incidentFillHistoryList.bindValue(":status", tr("Status")); incidentFillHistoryList.bindValue(":category", tr("Category")); incidentFillHistoryList.bindValue(":severity", tr("Severity")); incidentFillHistoryList.bindValue(":priority", tr("Priority")); incidentFillHistoryList.bindValue(":resolution", tr("Resolution")); incidentFillHistoryList.bindValue(":assignedto", tr("Assigned To")); incidentFillHistoryList.bindValue(":notes", tr("Comment")); incidentFillHistoryList.bindValue(":contact", tr("Contact")); incidentFillHistoryList.exec(); _incdthist->populate(incidentFillHistoryList); if (incidentFillHistoryList.lastError().type() != QSqlError::NoError) { systemError(this, incidentFillHistoryList.lastError().databaseText(), __FILE__, __LINE__); return; } } void incident::populate() { XSqlQuery incidentpopulate; incidentpopulate.prepare("SELECT incdt_number," " incdt_crmacct_id," " COALESCE(incdt_cntct_id,-1) AS incdt_cntct_id," " (cntct_first_name || ' ' || cntct_last_name) AS cntct_name," " incdt_summary, incdt_descrip," " incdt_item_id, incdt_ls_id," " incdt_status, incdt_assigned_username," " incdt_incdtcat_id, incdt_incdtseverity_id," " incdt_incdtpriority_id, incdt_incdtresolution_id," " incdt_owner_username, incdt_recurring_incdt_id," " COALESCE(incdt_aropen_id, -1) AS docId," " COALESCE(aropen_docnumber, '') AS docNumber," " CASE WHEN (aropen_doctype='C') THEN :creditMemo" " WHEN (aropen_doctype='D') THEN :debitMemo" " WHEN (aropen_doctype='I') THEN :invoice" " WHEN (aropen_doctype='R') THEN :cashdeposit" " ELSE ''" " END AS docType, " " COALESCE(incdt_prj_id,-1) AS incdt_prj_id," " COALESCE(incdt_public, false) AS incdt_public," " aropen_doctype " "FROM incdt LEFT OUTER JOIN cntct ON (incdt_cntct_id=cntct_id)" " LEFT OUTER JOIN aropen ON (incdt_aropen_id=aropen_id) " "WHERE (incdt_id=:incdt_id); "); incidentpopulate.bindValue(":incdt_id", _incdtid); incidentpopulate.bindValue(":creditMemo", tr("Credit Memo")); incidentpopulate.bindValue(":debitMemo", tr("Debit Memo")); incidentpopulate.bindValue(":invoice", tr("Invoice")); incidentpopulate.bindValue(":cashdeposit", tr("Customer Deposit")); incidentpopulate.exec(); if(incidentpopulate.first()) { _cntct->setId(incidentpopulate.value("incdt_cntct_id").toInt()); _crmacct->setId(incidentpopulate.value("incdt_crmacct_id").toInt()); _owner->setUsername(incidentpopulate.value("incdt_owner_username").toString()); _number->setText(incidentpopulate.value("incdt_number").toString()); _assignedTo->setUsername(incidentpopulate.value("incdt_assigned_username").toString()); _category->setNull(); if(!incidentpopulate.value("incdt_incdtcat_id").toString().isEmpty()) _category->setId(incidentpopulate.value("incdt_incdtcat_id").toInt()); _status->setCurrentIndex(_statusCodes.indexOf(incidentpopulate.value("incdt_status").toString())); _severity->setNull(); if(!incidentpopulate.value("incdt_incdtseverity_id").toString().isEmpty()) _severity->setId(incidentpopulate.value("incdt_incdtseverity_id").toInt()); _priority->setNull(); if(!incidentpopulate.value("incdt_incdtpriority_id").toString().isEmpty()) _priority->setId(incidentpopulate.value("incdt_incdtpriority_id").toInt()); _resolution->setNull(); if(!incidentpopulate.value("incdt_incdtresolution_id").toString().isEmpty()) _resolution->setId(incidentpopulate.value("incdt_incdtresolution_id").toInt()); if(!incidentpopulate.value("incdt_item_id").toString().isEmpty()) _item->setId(incidentpopulate.value("incdt_item_id").toInt()); else _item->setId(-1); if(!incidentpopulate.value("incdt_ls_id").toString().isEmpty()) _lotserial->setId(incidentpopulate.value("incdt_ls_id").toInt()); else _lotserial->setId(-1); _description->setText(incidentpopulate.value("incdt_summary").toString()); _notes->setText(incidentpopulate.value("incdt_descrip").toString()); _comments->setId(_incdtid); _documents->setId(_incdtid); _alarms->setId(_incdtid); _project->setId(incidentpopulate.value("incdt_prj_id").toInt()); _public->setChecked(incidentpopulate.value("incdt_public").toBool()); _docType->setText(incidentpopulate.value("docType").toString()); _docNumber->setText(incidentpopulate.value("docNumber").toString()); _aropenid = incidentpopulate.value("docId").toInt(); _ardoctype = incidentpopulate.value("aropen_doctype").toString(); if (_aropenid > 0) _viewAR->setEnabled(true); _recurring->setParent(incidentpopulate.value("incdt_recurring_incdt_id").isNull() ? _incdtid : incidentpopulate.value("incdt_recurring_incdt_id").toInt(), "INCDT"); sFillCharacteristicsList(); sFillHistoryList(); sFillTodoList(); emit populated(); } } void incident::sCRMAcctChanged(const int newid) { _cntct->setSearchAcct(newid); } void incident::sNewTodoItem() { if (! save(true)) return; ParameterList params; params.append("mode", "new"); params.append("incdt_id", _incdtid); params.append("priority_id", _priority->id()); todoItem newdlg(this, 0, true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillTodoList(); } void incident::sEditTodoItem() { ParameterList params; params.append("mode", "edit"); params.append("todoitem_id", _todoList->id()); todoItem newdlg(this, 0, true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillTodoList(); } void incident::sViewTodoItem() { ParameterList params; params.append("mode", "view"); params.append("todoitem_id", _todoList->id()); todoItem newdlg(this, 0, true); newdlg.set(params); newdlg.exec(); } void incident::sDeleteTodoItem() { XSqlQuery incidentDeleteTodoItem; incidentDeleteTodoItem.prepare("SELECT deleteTodoItem(:todoitem_id) AS result;"); incidentDeleteTodoItem.bindValue(":todoitem_id", _todoList->id()); incidentDeleteTodoItem.exec(); if (incidentDeleteTodoItem.first()) { int result = incidentDeleteTodoItem.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteTodoItem", result)); return; } else sFillTodoList(); } else if (incidentDeleteTodoItem.lastError().type() != QSqlError::NoError) { systemError(this, incidentDeleteTodoItem.lastError().databaseText(), __FILE__, __LINE__); return; } } void incident::sFillTodoList() { XSqlQuery incidentFillTodoList; incidentFillTodoList.prepare("SELECT todoitem_id, *, " " firstLine(todoitem_notes) AS todoitem_notes, " " CASE WHEN (todoitem_status != 'C' AND" " todoitem_due_date < CURRENT_DATE) THEN 'expired'" " WHEN (todoitem_status != 'C' AND" " todoitem_due_date > CURRENT_DATE) THEN 'future'" " END AS todoitem_due_date_qtforegroundrole " " FROM todoitem " " LEFT OUTER JOIN incdtpriority ON (incdtpriority_id=todoitem_priority_id) " "WHERE ( (todoitem_incdt_id=:incdt_id) " " AND (todoitem_active) ) " "ORDER BY todoitem_due_date, todoitem_username;"); incidentFillTodoList.bindValue(":incdt_id", _incdtid); incidentFillTodoList.exec(); _todoList->populate(incidentFillTodoList); if (incidentFillTodoList.lastError().type() != QSqlError::NoError) { systemError(this, incidentFillTodoList.lastError().databaseText(), __FILE__, __LINE__); return; } } void incident::sPopulateTodoMenu(QMenu *pMenu) { QAction *menuItem; bool newPriv = (cNew == _mode || cEdit == _mode) && (_privileges->check("MaintainPersonalToDoItems") || _privileges->check("MaintainAllToDoItems") ); bool editPriv = (cNew == _mode || cEdit == _mode) && ( (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")) ); bool viewPriv = (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")) || (_privileges->check("MaintainAllToDoItems")); menuItem = pMenu->addAction(tr("New..."), this, SLOT(sNewTodoItem())); menuItem->setEnabled(newPriv); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEditTodoItem())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sViewTodoItem())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDeleteTodoItem())); menuItem->setEnabled(editPriv); } void incident::sHandleTodoPrivs() { bool newPriv = (cNew == _mode || cEdit == _mode) && (_privileges->check("MaintainPersonalToDoItems") || _privileges->check("MaintainAllToDoItems") ); bool editPriv = false; bool viewPriv = false; if(_todoList->currentItem()) { editPriv = (cNew == _mode || cEdit == _mode) && ( (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")) ); viewPriv = (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")) || (_privileges->check("MaintainAllToDoItems")); } _newTodoItem->setEnabled(newPriv); _editTodoItem->setEnabled(editPriv && _todoList->id() > 0); _viewTodoItem->setEnabled((editPriv || viewPriv) && _todoList->id() > 0); _deleteTodoItem->setEnabled(editPriv && _todoList->id() > 0); if (editPriv) { disconnect(_todoList,SIGNAL(itemSelected(int)),_viewTodoItem, SLOT(animateClick())); connect(_todoList, SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick())); } else if (viewPriv) { disconnect(_todoList,SIGNAL(itemSelected(int)),_editTodoItem, SLOT(animateClick())); connect(_todoList, SIGNAL(itemSelected(int)), _viewTodoItem, SLOT(animateClick())); } } void incident::sReturn() { XSqlQuery incidentReturn; if (! save(true)) return; ParameterList params; incidentReturn.prepare("SELECT rahead_id FROM rahead WHERE rahead_incdt_id=:incdt_id"); incidentReturn.bindValue(":incdt_id", _incdtid); incidentReturn.exec(); if(incidentReturn.first()) { params.append("mode", "edit"); params.append("rahead_id", incidentReturn.value("rahead_id").toInt()); } else { params.append("mode", "new"); params.append("incdt_id", _incdtid); } returnAuthorization * newdlg = new returnAuthorization(this); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else QMessageBox::critical(this, tr("Could Not Open Window"), tr("The new Return Authorization could not be created")); } void incident::sViewAR() { ParameterList params; params.append("mode", "view"); params.append("aropen_id", _aropenid); arOpenItem newdlg(this, 0, true); newdlg.set(params); newdlg.exec(); } void incident::sPrint() { if (_incdtid != -1) { ParameterList params; params.append("incdt_id", _incdtid); params.append("print"); orReport report("Incident", params); if (report.isValid()) report.print(); else report.reportError(this); } // ToDo } void incident::sAssigned() { if (_status->currentIndex() < 3 && !_assignedTo->username().isEmpty()) _status->setCurrentIndex(3); } void incident::sNewCharacteristic() { if (! save(true)) return; ParameterList params; params.append("mode", "new"); params.append("incdt_id", _incdtid); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharacteristicsList(); } void incident::sEditCharacteristic() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharacteristicsList(); } void incident::sDeleteCharacteristic() { XSqlQuery incidentDeleteCharacteristic; incidentDeleteCharacteristic.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); incidentDeleteCharacteristic.bindValue(":charass_id", _charass->id()); incidentDeleteCharacteristic.exec(); sFillCharacteristicsList(); } void incident::sFillCharacteristicsList() { XSqlQuery qry; qry.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value " "FROM charass, char " "WHERE ( (charass_target_type='INCDT')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:incdt_id) ) " "ORDER BY char_order, char_name;" ); qry.bindValue(":incdt_id", _incdtid); qry.exec(); _charass->populate(qry); } qt-client-4.1.0/guiclient/incident.h000066400000000000000000000041321217451700100173430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENT_H #define INCIDENT_H #include "guiclient.h" #include "xdialog.h" #include #include #include "ui_incident.h" class incident : public XDialog, public Ui::incident { Q_OBJECT public: incident(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~incident(); Q_INVOKABLE virtual int aropenid() const; Q_INVOKABLE virtual QString arDoctype() const; Q_INVOKABLE virtual int id() const; Q_INVOKABLE virtual int mode() const; Q_INVOKABLE virtual void populate(); Q_INVOKABLE virtual bool save(bool); QPushButton* _print; public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCancel(); virtual void sCRMAcctChanged(const int); virtual void sDeleteTodoItem(); virtual void sEditTodoItem(); virtual void sFillHistoryList(); virtual void sFillTodoList(); virtual void sHandleTodoPrivs(); virtual void sNewTodoItem(); virtual void sPopulateTodoMenu(QMenu*); virtual void sSave(); virtual void sPrint(); virtual void sViewTodoItem(); virtual void sReturn(); virtual void sViewAR(); virtual void sAssigned(); virtual void sDeleteCharacteristic(); virtual void sEditCharacteristic(); virtual void sFillCharacteristicsList(); virtual void sNewCharacteristic(); signals: void populated(); protected slots: virtual void languageChange(); private: int _cntctid; int _incdtid; int _mode; int _aropenid; bool _saved; QString _ardoctype; QStringList _statusCodes; }; #endif // INCIDENT_H qt-client-4.1.0/guiclient/incident.ui000066400000000000000000000743241217451700100175430ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incident 0 0 800 600 0 0 Incident 12 Incident #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number false 0 0 Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _category true Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 0 Public true Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 0 0 0 Qt::StrongFocus Qt::Horizontal 0 0 Qt::StrongFocus Qt::Horizontal 0 0 Qt::StrongFocus Qt::Horizontal CRM Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Owner: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Assigned To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter New Feedback Confirmed Assigned Resolved Closed Severity: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Priority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Resolution: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true 0 0 Contact 0 0 true Qt::Horizontal 0 20 Project 0 1 0 Notes 0 0 0 125 true true Characteristics 0 New false Edit false Delete Qt::Vertical 20 40 Relationships Item 0 0 0 72 Qt::Horizontal 0 20 false Qt::StrongFocus Lot/Serial #: Qt::Horizontal 0 20 Qt::Vertical 20 40 Receivable Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 32767 Qt::AlignRight Doc #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 32767 Qt::AlignRight false 0 0 View Qt::Vertical 51 0 Qt::Horizontal 0 20 To-Do List Items 0 New Edit View Delete Qt::Vertical 20 40 History Comments Qt::StrongFocus Comments::Incident Documents Documents::Incident Alarms Alarms::Incident Alarms QWidget
    alarms.h
    Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    CRMAcctCluster QWidget
    crmacctcluster.h
    Documents QWidget
    documents.h
    ItemCluster QWidget
    itemcluster.h
    1
    LotserialCluster QWidget
    lotserialcluster.h
    ProjectCluster QWidget
    projectcluster.h
    RecurrenceWidget QWidget
    recurrencewidget.h
    UsernameCluster QWidget
    usernamecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _category _description _public _crmacct _owner _assignedTo _status _severity _priority _resolution _cntct _project _tab _notes _charass _newCharacteristic _editCharacteristic _deleteCharacteristic _item _lotserial _docType _docNumber _viewAR _todoList _newTodoItem _editTodoItem _viewTodoItem _deleteTodoItem _incdthist _comments _buttonBox _owner newId(int) _alarms setUsrId1(int) 140 206 399 541 _assignedTo newId(int) _alarms setUsrId2(int) 387 206 399 541 _cntct newId(int) _alarms setCntctId1(int) 328 326 648 843
    qt-client-4.1.0/guiclient/incidentCategories.cpp000066400000000000000000000110321217451700100217010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentCategories.h" #include #include #include #include #include #include #include "incidentCategory.h" incidentCategories::incidentCategories(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_incidentCategories, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_incidentCategories, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _incidentCategories->addColumn(tr("Order"), _seqColumn, Qt::AlignRight, true, "incdtcat_order"); _incidentCategories->addColumn(tr("Category"), 100, Qt::AlignLeft, true, "incdtcat_name"); _incidentCategories->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "incdtcat_descrip"); if (_privileges->check("MaintainIncidentCategories")) { connect(_incidentCategories, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_incidentCategories, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_incidentCategories, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_incidentCategories, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } incidentCategories::~incidentCategories() { // no need to delete child widgets, Qt does it all for us } void incidentCategories::languageChange() { retranslateUi(this); } void incidentCategories::sFillList() { XSqlQuery incidentFillList; incidentFillList.prepare( "SELECT incdtcat_id, incdtcat_order, " " incdtcat_name, firstLine(incdtcat_descrip) AS incdtcat_descrip " "FROM incdtcat " "ORDER BY incdtcat_order, incdtcat_name;" ); incidentFillList.exec(); if (incidentFillList.lastError().type() != QSqlError::NoError) { systemError(this, incidentFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _incidentCategories->populate(incidentFillList); } void incidentCategories::sDelete() { XSqlQuery incidentDelete; incidentDelete.prepare( "DELETE FROM incdtcat " "WHERE (incdtcat_id=:incdtcat_id);" ); incidentDelete.bindValue(":incdtcat_id", _incidentCategories->id()); incidentDelete.exec(); if (incidentDelete.lastError().type() != QSqlError::NoError) { systemError(this, incidentDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void incidentCategories::sNew() { ParameterList params; params.append("mode", "new"); incidentCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentCategories::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("incdtcat_id", _incidentCategories->id()); incidentCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentCategories::sView() { ParameterList params; params.append("mode", "view"); params.append("incdtcat_id", _incidentCategories->id()); incidentCategory newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void incidentCategories::sPopulateMenu( QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainIncidentCategories")); pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainIncidentCategories")); } void incidentCategories::sPrint() { orReport report("IncidentCategoriesList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/incidentCategories.h000066400000000000000000000021561217451700100213550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTCATEGORIES_H #define INCIDENTCATEGORIES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_incidentCategories.h" class incidentCategories : public XWidget, public Ui::incidentCategories { Q_OBJECT public: incidentCategories(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~incidentCategories(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // INCIDENTCATEGORIES_H qt-client-4.1.0/guiclient/incidentCategories.ui000066400000000000000000000115111217451700100215360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentCategories 0 0 600 400 List Incident Categories 0 Incident Categories: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _incidentCategories _new _edit _view _delete _print _close _close clicked() incidentCategories close() 20 20 20 20 _incidentCategories valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/incidentCategory.cpp000066400000000000000000000141011217451700100213710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentCategory.h" #include #include #include #include incidentCategory::incidentCategory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); if (!_metrics->boolean("EnableBatchManager")) { _ediprofile->hide(); _ediprofileLit->hide(); } else _ediprofile->populate("SELECT ediprofile_id, ediprofile_name " "FROM xtbatch.ediprofile " "WHERE (ediprofile_type='email');"); } incidentCategory::~incidentCategory() { } void incidentCategory::languageChange() { retranslateUi(this); } enum SetResponse incidentCategory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("incdtcat_id", &valid); if (valid) { _incdtcatId = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _order->setEnabled(FALSE); _descrip->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void incidentCategory::sCheck() { XSqlQuery incidentCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { incidentCheck.prepare( "SELECT incdtcat_id " "FROM incdtcat " "WHERE (UPPER(incdtcat_name)=UPPER(:incdtcat_name));" ); incidentCheck.bindValue(":incdtcat_name", _name->text()); incidentCheck.exec(); if (incidentCheck.first()) { _incdtcatId = incidentCheck.value("incdtcat_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void incidentCategory::sSave() { XSqlQuery incidentSave; if(_name->text().length() == 0) { QMessageBox::critical(this, tr("Category Name Required"), tr("You must enter a Category Name to continue.") ); _name->setFocus(); return; } if (_mode == cNew) { incidentSave.exec("SELECT NEXTVAL('incdtcat_incdtcat_id_seq') AS _incdtcat_id"); if (incidentSave.first()) _incdtcatId = incidentSave.value("_incdtcat_id").toInt(); else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "INSERT INTO incdtcat " "(incdtcat_id, incdtcat_name, incdtcat_order, incdtcat_descrip, incdtcat_ediprofile_id)" " VALUES " "(:incdtcat_id, :incdtcat_name, :incdtcat_order, :incdtcat_descrip, :incdtcat_ediprofile_id );" ); } else if (_mode == cEdit) { incidentSave.prepare( "SELECT incdtcat_id " "FROM incdtcat " "WHERE ( (UPPER(incdtcat_name)=UPPER(:incdtcat_name))" " AND (incdtcat_id<>:incdtcat_id) );" ); incidentSave.bindValue(":incdtcat_id", _incdtcatId); incidentSave.bindValue(":incdtcat_name", _name->text()); incidentSave.exec(); if (incidentSave.first()) { QMessageBox::warning( this, tr("Cannot Save Incident Category"), tr("You may not rename this Incident Category with " "the entered value as it is in use by another " "Incident Category.") ); return; } else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "UPDATE incdtcat " "SET incdtcat_name=:incdtcat_name, " " incdtcat_order=:incdtcat_order, " " incdtcat_descrip=:incdtcat_descrip, " " incdtcat_ediprofile_id=:incdtcat_ediprofile_id " "WHERE (incdtcat_id=:incdtcat_id);" ); } incidentSave.bindValue(":incdtcat_id", _incdtcatId); incidentSave.bindValue(":incdtcat_name", _name->text()); incidentSave.bindValue(":incdtcat_order", _order->value()); incidentSave.bindValue(":incdtcat_descrip", _descrip->toPlainText()); if (_ediprofile->id() != -1) incidentSave.bindValue(":incdtcat_ediprofile_id", _ediprofile->id()); incidentSave.exec(); if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_incdtcatId); } void incidentCategory::populate() { XSqlQuery incidentpopulate; incidentpopulate.prepare( "SELECT *,COALESCE(incdtcat_ediprofile_id,-1) AS ediprofile " "FROM incdtcat " "WHERE (incdtcat_id=:incdtcat_id);" ); incidentpopulate.bindValue(":incdtcat_id", _incdtcatId); incidentpopulate.exec(); if (incidentpopulate.first()) { _name->setText(incidentpopulate.value("incdtcat_name").toString()); _order->setValue(incidentpopulate.value("incdtcat_order").toInt()); _descrip->setText(incidentpopulate.value("incdtcat_descrip").toString()); _ediprofile->setId(incidentpopulate.value("ediprofile").toInt()); } else if (incidentpopulate.lastError().type() != QSqlError::NoError) { systemError(this, incidentpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/incidentCategory.h000066400000000000000000000021361217451700100210430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTCATEGORY_H #define INCIDENTCATEGORY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_incidentCategory.h" class incidentCategory : public XDialog, public Ui::incidentCategory { Q_OBJECT public: incidentCategory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~incidentCategory(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _incdtcatId; }; #endif // INCIDENTCATEGORY_H qt-client-4.1.0/guiclient/incidentCategory.ui000066400000000000000000000121661217451700100212350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentCategory 0 0 400 345 Incident Category Incident Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Email Delivery Profile: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 9999 Qt::Horizontal QSizePolicy::Expanding 16 22 true XComboBox::Adhoc Qt::Horizontal 40 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 0 Description: 0 1 XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    qt-client-4.1.0/guiclient/incidentPriorities.cpp000066400000000000000000000111721217451700100217520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentPriorities.h" #include #include #include #include #include #include #include "incidentPriority.h" incidentPriorities::incidentPriorities(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_incidentPriorities, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_incidentPriorities, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _incidentPriorities->addColumn(tr("Order"), _seqColumn, Qt::AlignRight, true, "incdtpriority_order"); _incidentPriorities->addColumn(tr("Priority"), 100, Qt::AlignLeft, true, "incdtpriority_name" ); _incidentPriorities->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "incdtpriority_descrip" ); if (_privileges->check("MaintainIncidentPriorities")) { connect(_incidentPriorities, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_incidentPriorities, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_incidentPriorities, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_incidentPriorities, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } incidentPriorities::~incidentPriorities() { // no need to delete child widgets, Qt does it all for us } void incidentPriorities::languageChange() { retranslateUi(this); } void incidentPriorities::sFillList() { XSqlQuery incidentFillList; incidentFillList.prepare( "SELECT incdtpriority_id, incdtpriority_order, " " incdtpriority_name, firstLine(incdtpriority_descrip) AS incdtpriority_descrip " "FROM incdtpriority " "ORDER BY incdtpriority_order, incdtpriority_name;" ); incidentFillList.exec(); if (incidentFillList.lastError().type() != QSqlError::NoError) { systemError(this, incidentFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _incidentPriorities->populate(incidentFillList); } void incidentPriorities::sDelete() { XSqlQuery incidentDelete; incidentDelete.prepare( "DELETE FROM incdtpriority " "WHERE (incdtpriority_id=:incdtpriorityid);" ); incidentDelete.bindValue(":incdtpriorityid", _incidentPriorities->id()); incidentDelete.exec(); if (incidentDelete.lastError().type() != QSqlError::NoError) { systemError(this, incidentDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void incidentPriorities::sNew() { ParameterList params; params.append("mode", "new"); incidentPriority newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentPriorities::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("incdtpriority_id", _incidentPriorities->id()); incidentPriority newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentPriorities::sView() { ParameterList params; params.append("mode", "view"); params.append("incdtpriority_id", _incidentPriorities->id()); incidentPriority newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void incidentPriorities::sPopulateMenu( QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainIncidentPriorities")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainIncidentPriorities")); } void incidentPriorities::sPrint() { orReport report("IncidentPrioritiesList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/incidentPriorities.h000066400000000000000000000021561217451700100214210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTPRIORITIES_H #define INCIDENTPRIORITIES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_incidentPriorities.h" class incidentPriorities : public XWidget, public Ui::incidentPriorities { Q_OBJECT public: incidentPriorities(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~incidentPriorities(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // INCIDENTPRIORITIES_H qt-client-4.1.0/guiclient/incidentPriorities.ui000066400000000000000000000114671217451700100216140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentPriorities 0 0 600 400 List Priorities 0 Priorities: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _incidentPriorities _new _edit _view _delete _print _close _close clicked() incidentPriorities close() 20 20 20 20 _incidentPriorities valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/incidentPriority.cpp000066400000000000000000000132571217451700100214500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentPriority.h" #include #include #include #include incidentPriority::incidentPriority(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } incidentPriority::~incidentPriority() { } void incidentPriority::languageChange() { retranslateUi(this); } enum SetResponse incidentPriority::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("incdtpriority_id", &valid); if (valid) { _incdtpriorityId = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _order->setEnabled(FALSE); _descrip->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void incidentPriority::sCheck() { XSqlQuery incidentCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { incidentCheck.prepare( "SELECT incdtpriority_id " "FROM incdtpriority " "WHERE (UPPER(incdtpriority_name)=UPPER(:incdtpriority_name));" ); incidentCheck.bindValue(":incdtpriority_name", _name->text()); incidentCheck.exec(); if (incidentCheck.first()) { _incdtpriorityId = incidentCheck.value("incdtpriority_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void incidentPriority::sSave() { XSqlQuery incidentSave; if(_name->text().length() == 0) { QMessageBox::critical(this, tr("Priority Name Required"), tr("You must enter a Priority Name to continue.") ); _name->setFocus(); return; } if (_mode == cNew) { incidentSave.exec("SELECT NEXTVAL('incdtpriority_incdtpriority_id_seq') AS _incdtpriority_id"); if (incidentSave.first()) _incdtpriorityId = incidentSave.value("_incdtpriority_id").toInt(); else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "INSERT INTO incdtpriority " "(incdtpriority_id, incdtpriority_name, incdtpriority_order, incdtpriority_descrip)" " VALUES " "(:incdtpriority_id, :incdtpriority_name, :incdtpriority_order, :incdtpriority_descrip);" ); } else if (_mode == cEdit) { incidentSave.prepare( "SELECT incdtpriority_id " "FROM incdtpriority " "WHERE ( (UPPER(incdtpriority_name)=UPPER(:incdtpriority_name))" " AND (incdtpriority_id<>:incdtpriority_id) );" ); incidentSave.bindValue(":incdtpriority_id", _incdtpriorityId); incidentSave.bindValue(":incdtpriority_name", _name->text()); incidentSave.exec(); if (incidentSave.first()) { QMessageBox::warning( this, tr("Cannot Save Incident Priority"), tr("You may not rename this Incident Priority with " "the entered value as it is in use by another " "Incident Priority.") ); return; } else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "UPDATE incdtpriority " "SET incdtpriority_name=:incdtpriority_name, " " incdtpriority_order=:incdtpriority_order, " " incdtpriority_descrip=:incdtpriority_descrip " "WHERE (incdtpriority_id=:incdtpriority_id);" ); } incidentSave.bindValue(":incdtpriority_id", _incdtpriorityId); incidentSave.bindValue(":incdtpriority_name", _name->text()); incidentSave.bindValue(":incdtpriority_order", _order->value()); incidentSave.bindValue(":incdtpriority_descrip", _descrip->toPlainText()); incidentSave.exec(); if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_incdtpriorityId); } void incidentPriority::populate() { XSqlQuery incidentpopulate; incidentpopulate.prepare( "SELECT * " "FROM incdtpriority " "WHERE (incdtpriority_id=:incdtpriority_id);" ); incidentpopulate.bindValue(":incdtpriority_id", _incdtpriorityId); incidentpopulate.exec(); if (incidentpopulate.first()) { _name->setText(incidentpopulate.value("incdtpriority_name").toString()); _order->setValue(incidentpopulate.value("incdtpriority_order").toInt()); _descrip->setText(incidentpopulate.value("incdtpriority_descrip").toString()); } else if (incidentpopulate.lastError().type() != QSqlError::NoError) { systemError(this, incidentpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/incidentPriority.h000066400000000000000000000021431217451700100211050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTPRIORITY_H #define INCIDENTPRIORITY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_incidentPriority.h" class incidentPriority : public XDialog, public Ui::incidentPriority { Q_OBJECT public: incidentPriority(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~incidentPriority(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _incdtpriorityId; }; #endif // INCIDENTPRIORITY_H qt-client-4.1.0/guiclient/incidentPriority.ui000066400000000000000000000106511217451700100212760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentPriority 0 0 404 183 Priority 2 2 Priority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 5 9999 Qt::Horizontal QSizePolicy::Expanding 16 22 Description: Qt::Vertical QSizePolicy::Expanding 20 40 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    qt-client-4.1.0/guiclient/incidentResolution.cpp000066400000000000000000000134731217451700100217720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentResolution.h" #include #include #include #include incidentResolution::incidentResolution(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } incidentResolution::~incidentResolution() { } void incidentResolution::languageChange() { retranslateUi(this); } enum SetResponse incidentResolution::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("incdtresolution_id", &valid); if (valid) { _incdtresolutionId = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _order->setEnabled(FALSE); _descrip->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void incidentResolution::sCheck() { XSqlQuery incidentCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { incidentCheck.prepare( "SELECT incdtresolution_id " "FROM incdtresolution " "WHERE (UPPER(incdtresolution_name)=UPPER(:incdtresolution_name));" ); incidentCheck.bindValue(":incdtresolution_name", _name->text()); incidentCheck.exec(); if (incidentCheck.first()) { _incdtresolutionId = incidentCheck.value("incdtresolution_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void incidentResolution::sSave() { XSqlQuery incidentSave; if(_name->text().length() == 0) { QMessageBox::critical(this, tr("Resolution Name Required"), tr("You must enter a Resolution Name to continue.") ); _name->setFocus(); return; } if (_mode == cNew) { incidentSave.exec("SELECT NEXTVAL('incdtresolution_incdtresolution_id_seq') AS _incdtresolution_id"); if (incidentSave.first()) _incdtresolutionId = incidentSave.value("_incdtresolution_id").toInt(); else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "INSERT INTO incdtresolution " "(incdtresolution_id, incdtresolution_name, incdtresolution_order, incdtresolution_descrip)" " VALUES " "(:incdtresolution_id, :incdtresolution_name, :incdtresolution_order, :incdtresolution_descrip);" ); } else if (_mode == cEdit) { incidentSave.prepare( "SELECT incdtresolution_id " "FROM incdtresolution " "WHERE ( (UPPER(incdtresolution_name)=UPPER(:incdtresolution_name))" " AND (incdtresolution_id<>:incdtresolution_id) );" ); incidentSave.bindValue(":incdtresolution_id", _incdtresolutionId); incidentSave.bindValue(":incdtresolution_name", _name->text()); incidentSave.exec(); if (incidentSave.first()) { QMessageBox::warning( this, tr("Cannot Save Incident Resolution"), tr("You may not rename this Incident Resolution with " "the entered value as it is in use by another " "Incident Resolution.") ); return; } else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "UPDATE incdtresolution " "SET incdtresolution_name=:incdtresolution_name, " " incdtresolution_order=:incdtresolution_order, " " incdtresolution_descrip=:incdtresolution_descrip " "WHERE (incdtresolution_id=:incdtresolution_id);" ); } incidentSave.bindValue(":incdtresolution_id", _incdtresolutionId); incidentSave.bindValue(":incdtresolution_name", _name->text()); incidentSave.bindValue(":incdtresolution_order", _order->value()); incidentSave.bindValue(":incdtresolution_descrip", _descrip->toPlainText()); incidentSave.exec(); if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_incdtresolutionId); } void incidentResolution::populate() { XSqlQuery incidentpopulate; incidentpopulate.prepare( "SELECT * " "FROM incdtresolution " "WHERE (incdtresolution_id=:incdtresolution_id);" ); incidentpopulate.bindValue(":incdtresolution_id", _incdtresolutionId); incidentpopulate.exec(); if (incidentpopulate.first()) { _name->setText(incidentpopulate.value("incdtresolution_name").toString()); _order->setValue(incidentpopulate.value("incdtresolution_order").toInt()); _descrip->setText(incidentpopulate.value("incdtresolution_descrip").toString()); } else if (incidentpopulate.lastError().type() != QSqlError::NoError) { systemError(this, incidentpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/incidentResolution.h000066400000000000000000000021651217451700100214330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTRESOLUTION_H #define INCIDENTRESOLUTION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_incidentResolution.h" class incidentResolution : public XDialog, public Ui::incidentResolution { Q_OBJECT public: incidentResolution(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~incidentResolution(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _incdtresolutionId; }; #endif // INCIDENTRESOLUTION_H qt-client-4.1.0/guiclient/incidentResolution.ui000066400000000000000000000107031217451700100216160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentResolution 0 0 404 183 Incident Resolution 2 2 Incident Resolution: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 5 9999 Qt::Horizontal QSizePolicy::Expanding 16 22 Description: Qt::Vertical QSizePolicy::Expanding 20 40 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    qt-client-4.1.0/guiclient/incidentResolutions.cpp000066400000000000000000000113111217451700100221420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentResolutions.h" #include #include #include #include #include #include #include "incidentResolution.h" incidentResolutions::incidentResolutions(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_incidentResolutions, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_incidentResolutions, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _incidentResolutions->addColumn(tr("Order"), _seqColumn, Qt::AlignRight, true, "incdtresolution_order"); _incidentResolutions->addColumn(tr("Resolution"), 100, Qt::AlignLeft, true, "incdtresolution_name" ); _incidentResolutions->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "incdtresolution_descrip" ); if (_privileges->check("MaintainIncidentResolutions")) { connect(_incidentResolutions, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_incidentResolutions, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_incidentResolutions, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_incidentResolutions, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } incidentResolutions::~incidentResolutions() { // no need to delete child widgets, Qt does it all for us } void incidentResolutions::languageChange() { retranslateUi(this); } void incidentResolutions::sFillList() { XSqlQuery incidentFillList; incidentFillList.prepare( "SELECT incdtresolution_id, incdtresolution_order, " " incdtresolution_name, firstLine(incdtresolution_descrip) AS incdtresolution_descrip " "FROM incdtresolution " "ORDER BY incdtresolution_order, incdtresolution_name;" ); incidentFillList.exec(); if (incidentFillList.lastError().type() != QSqlError::NoError) { systemError(this, incidentFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _incidentResolutions->populate(incidentFillList); } void incidentResolutions::sDelete() { XSqlQuery incidentDelete; incidentDelete.prepare( "DELETE FROM incdtresolution " "WHERE (incdtresolution_id=:incdtresolution_id);" ); incidentDelete.bindValue(":incdtresolution_id", _incidentResolutions->id()); incidentDelete.exec(); if (incidentDelete.lastError().type() != QSqlError::NoError) { systemError(this, incidentDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void incidentResolutions::sNew() { ParameterList params; params.append("mode", "new"); incidentResolution newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentResolutions::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("incdtresolution_id", _incidentResolutions->id()); incidentResolution newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentResolutions::sView() { ParameterList params; params.append("mode", "view"); params.append("incdtresolution_id", _incidentResolutions->id()); incidentResolution newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void incidentResolutions::sPopulateMenu( QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainIncidentResolutions")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainIncidentResolutions")); } void incidentResolutions::sPrint() { orReport report("IncidentResolutionsList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/incidentResolutions.h000066400000000000000000000021661217451700100216170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTRESOLUTIONS_H #define INCIDENTRESOLUTIONS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_incidentResolutions.h" class incidentResolutions : public XWidget, public Ui::incidentResolutions { Q_OBJECT public: incidentResolutions(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~incidentResolutions(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // INCIDENTRESOLUTIONS_H qt-client-4.1.0/guiclient/incidentResolutions.ui000066400000000000000000000115221217451700100220010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentResolutions 0 0 600 400 List Incident Resolutions 0 Incident Resolutions: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _incidentResolutions _new _edit _view _delete _print _close _close clicked() incidentResolutions close() 20 20 20 20 _incidentResolutions valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/incidentSeverities.cpp000066400000000000000000000111741217451700100217450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentSeverities.h" #include #include #include #include #include #include #include "incidentSeverity.h" incidentSeverities::incidentSeverities(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_incidentSeverities, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_incidentSeverities, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _incidentSeverities->addColumn(tr("Order"), _seqColumn, Qt::AlignRight, true, "incdtseverity_order"); _incidentSeverities->addColumn(tr("Severity"), 100, Qt::AlignLeft, true, "incdtseverity_name" ); _incidentSeverities->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "incdtseverity_descrip" ); if (_privileges->check("MaintainIncidentSeverities")) { connect(_incidentSeverities, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_incidentSeverities, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_incidentSeverities, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_incidentSeverities, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } incidentSeverities::~incidentSeverities() { // no need to delete child widgets, Qt does it all for us } void incidentSeverities::languageChange() { retranslateUi(this); } void incidentSeverities::sFillList() { XSqlQuery incidentFillList; incidentFillList.prepare( "SELECT incdtseverity_id, incdtseverity_order, " " incdtseverity_name, firstLine(incdtseverity_descrip) AS incdtseverity_descrip " "FROM incdtseverity " "ORDER BY incdtseverity_order, incdtseverity_name;" ); incidentFillList.exec(); if (incidentFillList.lastError().type() != QSqlError::NoError) { systemError(this, incidentFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _incidentSeverities->populate(incidentFillList); } void incidentSeverities::sDelete() { XSqlQuery incidentDelete; incidentDelete.prepare( "DELETE FROM incdtseverity " "WHERE (incdtseverity_id=:incdtseverity_id);" ); incidentDelete.bindValue(":incdtseverity_id", _incidentSeverities->id()); incidentDelete.exec(); if (incidentDelete.lastError().type() != QSqlError::NoError) { systemError(this, incidentDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void incidentSeverities::sNew() { ParameterList params; params.append("mode", "new"); incidentSeverity newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentSeverities::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("incdtseverity_id", _incidentSeverities->id()); incidentSeverity newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentSeverities::sView() { ParameterList params; params.append("mode", "view"); params.append("incdtseverity_id", _incidentSeverities->id()); incidentSeverity newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void incidentSeverities::sPopulateMenu( QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainIncidentSeverities")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainIncidentSeverities")); } void incidentSeverities::sPrint() { orReport report("IncidentSeveritiesList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/incidentSeverities.h000066400000000000000000000021561217451700100214120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTSEVERITIES_H #define INCIDENTSEVERITIES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_incidentSeverities.h" class incidentSeverities : public XWidget, public Ui::incidentSeverities { Q_OBJECT public: incidentSeverities(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~incidentSeverities(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // INCIDENTSEVERITIES_H qt-client-4.1.0/guiclient/incidentSeverities.ui000066400000000000000000000115111217451700100215730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentSeverities 0 0 600 400 List Incident Severities 0 Incident Severities: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _incidentSeverities _new _edit _view _delete _print _close _close clicked() incidentSeverities close() 20 20 20 20 _incidentSeverities valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/incidentSeverity.cpp000066400000000000000000000132571217451700100214410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentSeverity.h" #include #include #include #include incidentSeverity::incidentSeverity(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } incidentSeverity::~incidentSeverity() { } void incidentSeverity::languageChange() { retranslateUi(this); } enum SetResponse incidentSeverity::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("incdtseverity_id", &valid); if (valid) { _incdtseverityId = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _order->setEnabled(FALSE); _descrip->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void incidentSeverity::sCheck() { XSqlQuery incidentCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { incidentCheck.prepare( "SELECT incdtseverity_id " "FROM incdtseverity " "WHERE (UPPER(incdtseverity_name)=UPPER(:incdtseverity_name));" ); incidentCheck.bindValue(":incdtseverity_name", _name->text()); incidentCheck.exec(); if (incidentCheck.first()) { _incdtseverityId = incidentCheck.value("incdtseverity_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void incidentSeverity::sSave() { XSqlQuery incidentSave; if(_name->text().length() == 0) { QMessageBox::critical(this, tr("Severity Name Required"), tr("You must enter a Severity Name to continue.") ); _name->setFocus(); return; } if (_mode == cNew) { incidentSave.exec("SELECT NEXTVAL('incdtseverity_incdtseverity_id_seq') AS _incdtseverity_id"); if (incidentSave.first()) _incdtseverityId = incidentSave.value("_incdtseverity_id").toInt(); else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "INSERT INTO incdtseverity " "(incdtseverity_id, incdtseverity_name, incdtseverity_order, incdtseverity_descrip)" " VALUES " "(:incdtseverity_id, :incdtseverity_name, :incdtseverity_order, :incdtseverity_descrip);" ); } else if (_mode == cEdit) { incidentSave.prepare( "SELECT incdtseverity_id " "FROM incdtseverity " "WHERE ( (UPPER(incdtseverity_name)=UPPER(:incdtseverity_name))" " AND (incdtseverity_id<>:incdtseverity_id) );" ); incidentSave.bindValue(":incdtseverity_id", _incdtseverityId); incidentSave.bindValue(":incdtseverity_name", _name->text()); incidentSave.exec(); if (incidentSave.first()) { QMessageBox::warning( this, tr("Cannot Save Incident Severity"), tr("You may not rename this Incident Severity with " "the entered value as it is in use by another " "Incident Severity.") ); return; } else if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } incidentSave.prepare( "UPDATE incdtseverity " "SET incdtseverity_name=:incdtseverity_name, " " incdtseverity_order=:incdtseverity_order, " " incdtseverity_descrip=:incdtseverity_descrip " "WHERE (incdtseverity_id=:incdtseverity_id);" ); } incidentSave.bindValue(":incdtseverity_id", _incdtseverityId); incidentSave.bindValue(":incdtseverity_name", _name->text()); incidentSave.bindValue(":incdtseverity_order", _order->value()); incidentSave.bindValue(":incdtseverity_descrip", _descrip->toPlainText()); incidentSave.exec(); if (incidentSave.lastError().type() != QSqlError::NoError) { systemError(this, incidentSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_incdtseverityId); } void incidentSeverity::populate() { XSqlQuery incidentpopulate; incidentpopulate.prepare( "SELECT * " "FROM incdtseverity " "WHERE (incdtseverity_id=:incdtseverity_id);" ); incidentpopulate.bindValue(":incdtseverity_id", _incdtseverityId); incidentpopulate.exec(); if (incidentpopulate.first()) { _name->setText(incidentpopulate.value("incdtseverity_name").toString()); _order->setValue(incidentpopulate.value("incdtseverity_order").toInt()); _descrip->setText(incidentpopulate.value("incdtseverity_descrip").toString()); } else if (incidentpopulate.lastError().type() != QSqlError::NoError) { systemError(this, incidentpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/incidentSeverity.h000066400000000000000000000021431217451700100210760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTSEVERITY_H #define INCIDENTSEVERITY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_incidentSeverity.h" class incidentSeverity : public XDialog, public Ui::incidentSeverity { Q_OBJECT public: incidentSeverity(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~incidentSeverity(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _incdtseverityId; }; #endif // INCIDENTSEVERITY_H qt-client-4.1.0/guiclient/incidentSeverity.ui000066400000000000000000000106731217451700100212730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. incidentSeverity 0 0 404 183 Incident Severity 2 2 Incident Severity: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 5 9999 Qt::Horizontal QSizePolicy::Expanding 16 22 Description: Qt::Vertical QSizePolicy::Expanding 20 40 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    qt-client-4.1.0/guiclient/incidentWorkbench.cpp000066400000000000000000000215201217451700100215410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentWorkbench.h" #include #include "characteristic.h" #include "guiclient.h" #include "incident.h" #include "parameterwidget.h" incidentWorkbench::incidentWorkbench(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "incidentWorkbench", fl) { setWindowTitle(tr("Incidents")); setListLabel(tr("Incidents")); setReportName("IncidentWorkbenchList"); setMetaSQLOptions("incidents", "detail"); setParameterWidgetVisible(true); setNewVisible(_privileges->check("MaintainAllIncidents") || _privileges->check("MaintainPersonalIncidents")); setSearchVisible(true); setQueryOnStartEnabled(true); setAutoUpdateEnabled(true); QString qryStatus = QString("SELECT status_seq, " " CASE WHEN status_code = 'N' THEN '%1' " " WHEN status_code = 'F' THEN '%2' " " WHEN status_code = 'C' THEN '%3' " " WHEN status_code = 'A' THEN '%4' " " WHEN status_code = 'R' THEN '%5' " " WHEN status_code = 'L' THEN '%6' " " END AS name, status_code AS code " "FROM status; ") .arg(tr("New")) .arg(tr("Feedback")) .arg(tr("Confirmed")) .arg(tr("Assigned")) .arg(tr("Resolved")) .arg(tr("Closed")); QString qryPriority = "SELECT incdtpriority_id, incdtpriority_name " "FROM incdtpriority " "ORDER BY incdtpriority_order, incdtpriority_name "; parameterWidget()->append(tr("CRM Account"), "crmAccountId", ParameterWidget::Crmacct); parameterWidget()->append(tr("Contact"),"cntct_id", ParameterWidget::Contact); parameterWidget()->append(tr("Category"), "categorylist", ParameterWidget::Multiselect, QVariant(), false, "SELECT incdtcat_id, incdtcat_name" " FROM incdtcat" " ORDER BY incdtcat_name;"); parameterWidget()->appendComboBox(tr("Status Above"), "status_above", qryStatus, 4); parameterWidget()->append(tr("Status"), "statuslist", ParameterWidget::Multiselect, QVariant(), false, qryStatus); parameterWidget()->appendComboBox(tr("Severity"), "severity_id", XComboBox::IncidentSeverity); parameterWidget()->append(tr("User"), "username", ParameterWidget::User, omfgThis->username()); parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User); parameterWidget()->append(tr("Assigned To"), "assigned_username", ParameterWidget::User); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date); parameterWidget()->append(tr("Priority"), "incdtpriority_id_list", ParameterWidget::Multiselect, QVariant(), false, qryPriority); parameterWidget()->append(tr("Project"), "prj_id", ParameterWidget::Project); if(_metrics->boolean("IncidentsPublicPrivate")) parameterWidget()->append(tr("Public"), "public", ParameterWidget::CheckBox); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); if (_metrics->boolean("LotSerialControl")) parameterWidget()->append(tr("Lot/Serial Pattern"), "lspattern", ParameterWidget::Text); parameterWidget()->applyDefaultFilterSet(); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen())); if (!_privileges->check("MaintainAllIncidents") && !_privileges->check("MaintainPersonalIncidents")) newAction()->setEnabled(FALSE); list()->addColumn(tr("Number"), _orderColumn,Qt::AlignLeft, true, "incdt_number" ); list()->addColumn(tr("Created"), _dateColumn, Qt::AlignLeft, true, "incdt_timestamp" ); list()->addColumn(tr("Account"), _itemColumn, Qt::AlignLeft, true, "crmacct_name" ); list()->addColumn(tr("Status"), _itemColumn, Qt::AlignLeft, true, "incdt_status" ); list()->addColumn(tr("Updated"), _dateColumn, Qt::AlignLeft, true, "incdt_updated" ); list()->addColumn(tr("Assigned To"), _userColumn, Qt::AlignLeft, true, "incdt_assigned_username" ); list()->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, true, "incdt_owner_username" ); list()->addColumn(tr("Summary"), -1, Qt::AlignLeft, true, "incdt_summary" ); list()->addColumn(tr("Category"), _userColumn, Qt::AlignLeft, false, "incdtcat_name"); list()->addColumn(tr("Severity"), _userColumn, Qt::AlignLeft, false, "incdtseverity_name"); list()->addColumn(tr("Priority"), _userColumn, Qt::AlignLeft, false, "incdtpriority_name"); list()->addColumn(tr("Contact"), _userColumn, Qt::AlignLeft, false, "cntct_name"); list()->addColumn(tr("Project"), _userColumn, Qt::AlignLeft, false, "prj_number"); if(_metrics->boolean("IncidentsPublicPrivate")) list()->addColumn(tr("Public"), _userColumn, Qt::AlignLeft, false, "incdt_public"); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, false, "item_number"); list()->addColumn(tr("Lot/Serial"), _itemColumn, Qt::AlignLeft, false, "ls_number"); setupCharacteristics(characteristic::Incidents); parameterWidget()->applyDefaultFilterSet(); } enum SetResponse incidentWorkbench::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("run", &valid); if (valid) sFillList(); return NoError; } void incidentWorkbench::sNew() { ParameterList params; params.append("mode", "new"); incident newdlg(this, 0, true); newdlg.set(params); if(newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentWorkbench::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("incdt_id", list()->id()); incident newdlg(this, 0, true); newdlg.set(params); if(newdlg.exec() != XDialog::Rejected) sFillList(); } void incidentWorkbench::sView() { ParameterList params; params.append("mode", "view"); params.append("incdt_id", list()->id()); incident newdlg(this, 0, true); newdlg.set(params); newdlg.exec(); } bool incidentWorkbench::setParams(ParameterList & params) { params.append("new", tr("New")); params.append("feedback", tr("Feedback")); params.append("confirmed", tr("Confirmed")); params.append("assigned", tr("Assigned")); params.append("resolved", tr("Resolved")); params.append("closed", tr("Closed")); params.append("startDate", omfgThis->startOfTime()); params.append("endDate", omfgThis->endOfTime()); if (_metrics->boolean("LotSerialControl")) params.append("LotSerialControl", true); if (!display::setParams(params)) return false; return true; } void incidentWorkbench::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("incdt_owner_username") && _privileges->check("MaintainPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("incdt_assigned_username") && _privileges->check("MaintainPersonalIncidents")) || (_privileges->check("MaintainAllIncidents")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("incdt_owner_username") && _privileges->check("ViewPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("incdt_username") && _privileges->check("ViewPersonalIncidents")) || (_privileges->check("ViewAllIncidents")); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(viewPriv); } void incidentWorkbench::sOpen() { bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("incdt_owner_username") && _privileges->check("MaintainPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("incdt_assigned_username") && _privileges->check("MaintainPersonalIncidents")) || (_privileges->check("MaintainAllIncidents")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("incdt_owner_username") && _privileges->check("ViewPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("incdt_username") && _privileges->check("ViewPersonalIncidents")) || (_privileges->check("ViewAllIncidents")); if (editPriv) sEdit(); else if (viewPriv) sView(); } qt-client-4.1.0/guiclient/incidentWorkbench.h000066400000000000000000000017621217451700100212140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INCIDENTWORKBENCH_H #define INCIDENTWORKBENCH_H #include "display.h" class incidentWorkbench : public display { Q_OBJECT public: incidentWorkbench(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual bool setParams(ParameterList&); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sOpen(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // INCIDENTWORKBENCH_H qt-client-4.1.0/guiclient/inputManager.cpp000066400000000000000000001142401217451700100205350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include "guiclient.h" #include "inputManager.h" typedef struct { int event; char string[5]; int length1; int length2; int length3; } InputEvent; #define cBCCProlog "\x0b\x38" #define cBCPrologSize 2 #define cBCTypeSize 4 #define cIdle 0x01 #define cProlog 0x02 #define cType 0x04 #define cHeader 0x08 #define cData 0x10 #ifdef Q_WS_MACX #define cPrologCtrl 0x80 /* Macintosh-only */ #endif static InputEvent _eventList[] = { { cBCWorkOrder, "WOXX", 1, 1, 0 }, { cBCWorkOrderMaterial, "WOMR", 1, 1, 1 }, { cBCWorkOrderOperation, "WOOP", 1, 1, 1 }, { cBCPurchaseOrder, "POXX", 1, 0, 0 }, { cBCPurchaseOrderLineItem, "POLI", 1, 1, 0 }, { cBCSalesOrder, "SOXX", 1, 0, 0 }, { cBCSalesOrderLineItem, "SOLI", 1, 1, 0 }, { cBCTransferOrder, "TOXX", 1, 0, 0 }, { cBCTransferOrderLineItem, "TOLI", 1, 1, 0 }, { cBCItemSite, "ISXX", 2, 1, 0 }, { cBCItem, "ITXX", 2, 0, 0 }, { cBCUPCCode, "ITUP", 0, 0, 0 }, { cBCEANCode, "ITEA", 0, 0, 0 }, { cBCCountTag, "CTXX", 2, 0, 0 }, { cBCLocation, "LOXX", 1, 2, 0 }, { cBCLocationIssue, "LOIS", 1, 2, 0 }, { cBCLocationContents, "LOCN", 1, 2, 0 }, { cBCUser, "USER", 1, 0, 0 }, { cBCLotSerialNumber, "LSNX", 1, 0, 0 }, // TODO: itemloc? lsdetail? { -1, "", 0, 0, 0 } }; class ReceiverItem { public: ReceiverItem() { _null = TRUE; }; ReceiverItem(int pType, QObject *pParent, QObject *pTarget, const QString &pSlot) { _type = pType; _parent = pParent; _target = pTarget; _slot = pSlot; _null = FALSE; }; inline int type() { return _type; }; inline QObject *parent() { return _parent; }; inline QObject *target() { return _target; }; inline char* slot() { return _slot.toAscii().data(); }; inline bool isNull() { return _null; }; bool operator==(const ReceiverItem &value) const { return (_null && value._null) || (_target == value._target) ; }; private: int _type; QObject *_parent; QObject *_target; QString _slot; bool _null; }; class InputManagerPrivate { public: InputManagerPrivate() { _state = cIdle; }; QList _receivers; int _state; int _cursor; int _eventCursor; int _length1; int _length2; int _length3; int _type; QString _buffer; ReceiverItem findReceiver(int pMask) { for (int counter = 0; counter < _receivers.count(); counter++) if (_receivers[counter].type() & pMask) return _receivers[counter]; return ReceiverItem(); }; }; InputManager::InputManager() { _private = new InputManagerPrivate(); } void InputManager::notify(int pType, QObject *pParent, QObject *pTarget, const QString &pSlot) { _private->_receivers.prepend(ReceiverItem(pType, pParent, pTarget, pSlot)); connect(pTarget, SIGNAL(destroyed(QObject *)), this, SLOT(sRemove(QObject *))); } /* Application scripts need to pass strings as the last argument to InputManager::notify() but don't have access to the C++ SLOT() macro to generate it. This function mimics the SLOT() macro and will need to be maintained as Qt changes. */ QString InputManager::slotName(const QString &slotname) { return QString("1") + slotname; } void InputManager::sRemove(QObject *pTarget) { for (int counter = 0; counter < _private->_receivers.count(); counter++) if (_private->_receivers[counter].target() == pTarget) _private->_receivers.removeAt(counter); } bool InputManager::eventFilter(QObject *, QEvent *pEvent) { if (pEvent->type() == QEvent::KeyPress) { // Swallow the Shift key as the Symbol Bar Code readers express a Shift key // for each upper case alpha character if (((QKeyEvent *)pEvent)->key() == Qt::Key_Shift) return FALSE; int character = ((QKeyEvent *)pEvent)->text().data()->toAscii(); /* qDebug("Scanned %d (key %d) at _private->_state=%d", character, ((QKeyEvent *)pEvent)->key(), _private->_state); */ /* The Macintosh seems to handle control characters differently than Linux and Windows. Apparently we need an extra state to look for the CTRL key (which Qt treats as Qt::Key_Meta, using Qt::Key_Control for the Apple/Command key). */ switch (_private->_state) { case cIdle: #ifdef Q_WS_MACX if (((QKeyEvent *)pEvent)->key() == Qt::Key_Meta) { _private->_state = cPrologCtrl; _private->_cursor = 0; } #else if (character == QString(cBCCProlog)[0]) { _private->_state = cProlog; _private->_cursor = 0; } #endif else return FALSE; break; #ifdef Q_WS_MACX case cPrologCtrl: // why does character come back as 0? // on an Intel Mac with Qt 4 the key() came back as Key_PageUp // but with PowerPC Mac with Qt 3 the key() came back as 'V'. // Accept either for now. if (((QKeyEvent *)pEvent)->key() - 64 == QString(cBCCProlog)[0] || ((QKeyEvent *)pEvent)->key() == Qt::Key_PageUp) { _private->_state = cProlog; _private->_cursor = 0; } else _private->_state = cIdle; break; #endif case cProlog: _private->_cursor++; if (character == *(cBCCProlog + _private->_cursor)) { if (_private->_cursor == (cBCPrologSize - 1)) { _private->_state = cType; _private->_cursor = 0; _private->_buffer = ""; } } else _private->_state = cIdle; break; case cType: _private->_buffer += character; if (++_private->_cursor == cBCTypeSize) { int cursor; for (cursor = 0, _private->_type = 0; _eventList[cursor].string[0] != '\0'; cursor++) { if (_private->_buffer == QString(_eventList[cursor].string)) { _private->_eventCursor = cursor; _private->_type = _eventList[cursor].event; break; } } if (_private->_type == 0) _private->_state = cIdle; else { _private->_state = cHeader; _private->_cursor = 0; _private->_buffer = ""; } } break; case cHeader: _private->_buffer += character; _private->_cursor++; if (_private->_cursor == ( _eventList[_private->_eventCursor].length1 + _eventList[_private->_eventCursor].length2 + _eventList[_private->_eventCursor].length3 ) ) { bool check; if (_eventList[_private->_eventCursor].length1) { _private->_length1 = _private->_buffer.left(_eventList[_private->_eventCursor].length1).toInt(&check); if (!check) { _private->_state = cIdle; break; } } else _private->_length1 = 0; if (_eventList[_private->_eventCursor].length2) { _private->_length2 = _private->_buffer.mid( _eventList[_private->_eventCursor].length1, _eventList[_private->_eventCursor].length2 ).toInt(&check); if (!check) { _private->_state = cIdle; break; } } else _private->_length2 = 0; if (_eventList[_private->_eventCursor].length3) { _private->_length3 = _private->_buffer.right(_eventList[_private->_eventCursor].length3).toInt(&check); if (!check) { _private->_state = cIdle; break; } } else _private->_length3 = 0; _private->_cursor = 0; _private->_buffer = ""; _private->_state = cData; } break; case cData: _private->_buffer += character; _private->_cursor++; if (_private->_cursor == (_private->_length1 + _private->_length2 + _private->_length3)) { _private->_state = cIdle; switch (_private->_type) { case cBCWorkOrderOperation: dispatchWorkOrderOperation(); break; case cBCPurchaseOrder: dispatchPurchaseOrder(); break; case cBCSalesOrder: dispatchSalesOrder(); break; case cBCTransferOrder: dispatchTransferOrder(); break; case cBCCountTag: dispatchCountTag(); break; case cBCWorkOrder: dispatchWorkOrder(); break; case cBCSalesOrderLineItem: dispatchSalesOrderLineItem(); break; case cBCPurchaseOrderLineItem: dispatchPurchaseOrderLineItem(); break; case cBCTransferOrderLineItem: dispatchTransferOrderLineItem(); break; case cBCItemSite: dispatchItemSite(); break; case cBCItem: dispatchItem(); break; case cBCUPCCode: dispatchUPCCode(); break; case cBCLocation: dispatchLocation(); break; case cBCLocationIssue: dispatchLocationIssue(); break; case cBCLocationContents: dispatchLocationContents(); break; case cBCLotSerialNumber: dispatchLotSerialNumber(); break; case cBCUser: dispatchUser(); break; default: _private->_state = cIdle; break; } } break; } return TRUE; } else return FALSE; } void InputManager::dispatchWorkOrder() { ReceiverItem receiver = _private->findReceiver(cBCWorkOrder); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); QString subNumber = _private->_buffer.right(_private->_length2); if (receiver.type() == cBCWorkOrder) { XSqlQuery woid; woid.prepare( "SELECT wo_id " "FROM wo " "WHERE ( (wo_number=:wo_number)" " AND (wo_subnumber=:wo_subnumber) );" ); woid.bindValue(":wo_number", number); woid.bindValue(":wo_subnumber", subNumber); woid.exec(); if (woid.first()) { message( tr("Scanned Work Order #%1-%2.") .arg(number) .arg(subNumber), 1000 ); if (connect(this, SIGNAL(readWorkOrder(int)), receiver.target(), receiver.slot())) { emit readWorkOrder(woid.value("wo_id").toInt()); disconnect(this, SIGNAL(readWorkOrder(int)), receiver.target(), receiver.slot()); } } else message( tr("Work Order #%1-%2 does not exist in the Database.") .arg(number) .arg(subNumber), 1000 ); } } } void InputManager::dispatchWorkOrderOperation() { ReceiverItem receiver = _private->findReceiver((cBCWorkOrderOperation | cBCWorkOrder)); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); QString subNumber = _private->_buffer.mid(_private->_length1, _private->_length2); QString seqNumber = _private->_buffer.right(_private->_length3); XSqlQuery wooperid; wooperid.prepare( "SELECT wo_id, wooper_id " "FROM wo, wooper " "WHERE ( (wooper_wo_id=wo_id)" " AND (wo_number=:wo_number)" " AND (wo_subnumber=:wo_subnumber)" " AND (wooper_seqnumber=:wooper_seqnumber) );" ); wooperid.bindValue(":wo_number", number); wooperid.bindValue(":wo_subnumber", subNumber); wooperid.bindValue(":wooper_seqnumber", seqNumber); wooperid.exec(); if (wooperid.first()) { message( tr("Scanned Work Order #%1-%2, Operation %3.") .arg(number) .arg(subNumber) .arg(seqNumber), 1000 ); if (receiver.type() == cBCWorkOrderOperation) { if (connect(this, SIGNAL(readWorkOrderOperation(int)), receiver.target(), receiver.slot())) { emit readWorkOrderOperation(wooperid.value("wooper_id").toInt()); disconnect(this, SIGNAL(readWorkOrderOperation(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCWorkOrder) { if (connect(this, SIGNAL(readWorkOrder(int)), receiver.target(), receiver.slot())) { emit readWorkOrder(wooperid.value("wo_id").toInt()); disconnect(this, SIGNAL(readWorkOrder(int)), receiver.target(), receiver.slot()); } } } else message( tr("Work Order #%1-%2, Operation %3 does not exist in the Database.") .arg(number) .arg(subNumber) .arg(seqNumber), 1000 ); } } void InputManager::dispatchPurchaseOrder() { ReceiverItem receiver = _private->findReceiver(cBCPurchaseOrder); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); XSqlQuery poheadid; poheadid.prepare( "SELECT pohead_id " "FROM pohead " "WHERE (pohead_number=:pohead_number);" ); poheadid.bindValue(":pohead_number", number); poheadid.exec(); if (poheadid.first()) { message( tr("Scanned Purchase Order #%1.") .arg(number), 1000 ); if (connect(this, SIGNAL(readPurchaseOrder(int)), receiver.target(), receiver.slot())) { emit readPurchaseOrder(poheadid.value("pohead_id").toInt()); disconnect(this, SIGNAL(readPurchaseOrder(int)), receiver.target(), receiver.slot()); } } else message( tr("Purchase Order #%1 does not exist in the Database.") .arg(number), 1000 ); } } void InputManager::dispatchSalesOrder() { ReceiverItem receiver = _private->findReceiver(cBCSalesOrder); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); XSqlQuery soheadid; soheadid.prepare( "SELECT cohead_id " "FROM cohead " "WHERE (cohead_number=:sohead_number);" ); soheadid.bindValue(":sohead_number", number); soheadid.exec(); if (soheadid.first()) { message( tr("Scanned Sales Order #%1.") .arg(number), 1000 ); if (connect(this, SIGNAL(readSalesOrder(int)), receiver.target(), receiver.slot())) { emit readSalesOrder(soheadid.value("cohead_id").toInt()); disconnect(this, SIGNAL(readSalesOrder(int)), receiver.target(), receiver.slot()); } } else message( tr("Sales Order #%1 does not exist in the Database.") .arg(number), 1000 ); } } void InputManager::dispatchTransferOrder() { ReceiverItem receiver = _private->findReceiver(cBCTransferOrder); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); XSqlQuery toheadid; toheadid.prepare( "SELECT tohead_id " "FROM tohead " "WHERE (tohead_number=:tohead_number);" ); toheadid.bindValue(":tohead_number", number); toheadid.exec(); if (toheadid.first()) { message( tr("Scanned Transfer Order #%1.") .arg(number), 1000 ); if (connect(this, SIGNAL(readTransferOrder(int)), receiver.target(), receiver.slot())) { emit readTransferOrder(toheadid.value("tohead_id").toInt()); disconnect(this, SIGNAL(readTransferOrder(int)), receiver.target(), receiver.slot()); } } else message( tr("Transfer Order #%1 does not exist in the Database.") .arg(number), 1000 ); } } void InputManager::dispatchPurchaseOrderLineItem() { ReceiverItem receiver = _private->findReceiver((cBCPurchaseOrderLineItem | cBCPurchaseOrder | cBCItemSite | cBCItem)); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); QString subNumber = _private->_buffer.right(_private->_length2); QString lineNumber = subNumber; QString subSubNumber = "0"; int subsep = subNumber.indexOf("."); if(subsep >= 0) { lineNumber = subNumber.left(subsep); subSubNumber = subNumber.right(subNumber.length() - (subsep + 1)); } if ( (receiver.type() == cBCPurchaseOrderLineItem) || (receiver.type() == cBCPurchaseOrder) ) { XSqlQuery poitemid; poitemid.prepare( "SELECT pohead_id, poitem_id " "FROM pohead, poitem " "WHERE ( (poitem_pohead_id=pohead_id)" " AND (pohead_number=:pohead_number)" " AND (poitem_linenumber=:poitem_linenumber) );" ); poitemid.bindValue(":pohead_number", number); poitemid.bindValue(":poitem_linenumber", lineNumber); poitemid.exec(); if (poitemid.first()) { message( tr("Scanned Purchase Order Line #%1-%2.") .arg(number) .arg(subNumber), 1000 ); if (receiver.type() == cBCPurchaseOrderLineItem) { if (connect(this, SIGNAL(readPurchaseOrderLineItem(int)), receiver.target(), receiver.slot())) { emit readPurchaseOrderLineItem(poitemid.value("poitem_id").toInt()); disconnect(this, SIGNAL(readPurchaseOrderLineItem(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCPurchaseOrder) { if (connect(this, SIGNAL(readPurchaseOrder(int)), receiver.target(), receiver.slot())) { emit readPurchaseOrder(poitemid.value("pohead_id").toInt()); disconnect(this, SIGNAL(readPurchaseOrder(int)), receiver.target(), receiver.slot()); } } } else message( tr("Purchase Order Line #%1-%2 does not exist in the Database.") .arg(number) .arg(subNumber), 1000 ); } else if ( (receiver.type() == cBCItemSite) || (receiver.type() == cBCItem) ) { XSqlQuery itemsiteid; itemsiteid.prepare( "SELECT itemsite_id, itemsite_item_id " "FROM pohead, poitem, itemsite " "WHERE ( (poitem_cohead_id=pohead_id)" " AND (poitem_itemsite_id=itemsite_id)" " AND (pohead_number=:pohead_number)" " AND (poitem_linenumber=:poitem_linenumber) );" ); itemsiteid.bindValue(":pohead_number", number); itemsiteid.bindValue(":poitem_linenumber", lineNumber); itemsiteid.exec(); if (itemsiteid.first()) { message( tr("Scanned Purchase Order Line #%1-%2.") .arg(number) .arg(subNumber), 1000 ); if (receiver.type() == cBCItemSite) { if (connect(this, SIGNAL(readItemSite(int)), receiver.target(), receiver.slot())) { emit readItemSite(itemsiteid.value("itemsite_id").toInt()); disconnect(this, SIGNAL(readItemSite(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCItem) { if (connect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot())) { emit readItem(itemsiteid.value("itemsite_item_id").toInt()); disconnect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot()); } } } else message( tr("Purchase Order Line #%1-%2 does not exist in the Database.") .arg(number) .arg(subNumber), 1000 ); } } } void InputManager::dispatchSalesOrderLineItem() { ReceiverItem receiver = _private->findReceiver((cBCSalesOrderLineItem | cBCSalesOrder | cBCItemSite | cBCItem)); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); QString subNumber = _private->_buffer.right(_private->_length2); QString lineNumber = subNumber; QString subSubNumber = "0"; int subsep = subNumber.indexOf("."); if(subsep >= 0) { lineNumber = subNumber.left(subsep); subSubNumber = subNumber.right(subNumber.length() - (subsep + 1)); } if ( (receiver.type() == cBCSalesOrderLineItem) || (receiver.type() == cBCSalesOrder) ) { XSqlQuery soitemid; soitemid.prepare( "SELECT cohead_id, coitem_id " "FROM cohead, coitem " "WHERE ( (coitem_cohead_id=cohead_id)" " AND (cohead_number=:sohead_number)" " AND (coitem_linenumber=:soitem_linenumber)" " AND (coitem_subnumber=:soitem_subnumber) );" ); soitemid.bindValue(":sohead_number", number); soitemid.bindValue(":soitem_linenumber", lineNumber); soitemid.bindValue(":soitem_subnumber", subSubNumber); soitemid.exec(); if (soitemid.first()) { message( tr("Scanned Sales Order Line #%1-%2.") .arg(number) .arg(subNumber), 1000 ); if (receiver.type() == cBCSalesOrderLineItem) { if (connect(this, SIGNAL(readSalesOrderLineItem(int)), receiver.target(), receiver.slot())) { emit readSalesOrderLineItem(soitemid.value("coitem_id").toInt()); disconnect(this, SIGNAL(readSalesOrderLineItem(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCSalesOrder) { if (connect(this, SIGNAL(readSalesOrder(int)), receiver.target(), receiver.slot())) { emit readSalesOrder(soitemid.value("cohead_id").toInt()); disconnect(this, SIGNAL(readSalesOrder(int)), receiver.target(), receiver.slot()); } } } else message( tr("Sales Order Line #%1-%2 does not exist in the Database.") .arg(number) .arg(subNumber), 1000 ); } else if ( (receiver.type() == cBCItemSite) || (receiver.type() == cBCItem) ) { XSqlQuery itemsiteid; itemsiteid.prepare( "SELECT itemsite_id, itemsite_item_id " "FROM cohead, coitem, itemsite " "WHERE ( (coitem_cohead_id=cohead_id)" " AND (coitem_itemsite_id=itemsite_id)" " AND (cohead_number=:sohead_number)" " AND (coitem_linenumber=:soitem_linenumber)" " AND (coitem_subnumber=:soitem_subnumber) );" ); itemsiteid.bindValue(":sohead_number", number); itemsiteid.bindValue(":soitem_linenumber", lineNumber); itemsiteid.bindValue(":soitem_subnumber", subSubNumber); itemsiteid.exec(); if (itemsiteid.first()) { message( tr("Scanned Sales Order Line #%1-%2.") .arg(number) .arg(subNumber), 1000 ); if (receiver.type() == cBCItemSite) { if (connect(this, SIGNAL(readItemSite(int)), receiver.target(), receiver.slot())) { emit readItemSite(itemsiteid.value("itemsite_id").toInt()); disconnect(this, SIGNAL(readItemSite(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCItem) { if (connect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot())) { emit readItem(itemsiteid.value("itemsite_item_id").toInt()); disconnect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot()); } } } else message( tr("Sales Order Line #%1-%2 does not exist in the Database.") .arg(number) .arg(subNumber), 1000 ); } } } void InputManager::dispatchTransferOrderLineItem() { ReceiverItem receiver = _private->findReceiver((cBCTransferOrderLineItem | cBCTransferOrder | cBCItem)); if (!receiver.isNull()) { QString number = _private->_buffer.left(_private->_length1); QString subNumber = _private->_buffer.right(_private->_length2); if ( (receiver.type() == cBCTransferOrderLineItem) || (receiver.type() == cBCTransferOrder) || (receiver.type() == cBCItem) ) { XSqlQuery toitemid; toitemid.prepare( "SELECT tohead_id, toitem_id, toitem_item_id " "FROM tohead, toitem " "WHERE ( (toitem_tohead_id=tohead_id)" " AND (tohead_number=:tohead_number)" " AND (toitem_linenumber=:toitem_linenumber) );" ); toitemid.bindValue(":tohead_number", number); toitemid.bindValue(":toitem_linenumber", subNumber); toitemid.exec(); if (toitemid.first()) { message( tr("Scanned Transfer Order Line #%1-%2.") .arg(number) .arg(subNumber), 1000 ); if (receiver.type() == cBCTransferOrderLineItem) { if (connect(this, SIGNAL(readTransferOrderLineItem(int)), receiver.target(), receiver.slot())) { emit readTransferOrderLineItem(toitemid.value("toitem_id").toInt()); disconnect(this, SIGNAL(readTransferOrderLineItem(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCTransferOrder) { if (connect(this, SIGNAL(readTransferOrder(int)), receiver.target(), receiver.slot())) { emit readTransferOrder(toitemid.value("tohead_id").toInt()); disconnect(this, SIGNAL(readTransferOrder(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCItem) { if (connect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot())) { emit readItem(toitemid.value("toitem_item_id").toInt()); disconnect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot()); } } } else message( tr("Transfer Order Line #%1-%2 does not exist in the Database.") .arg(number) .arg(subNumber), 1000 ); } } } void InputManager::dispatchItemSite() { ReceiverItem receiver = _private->findReceiver((cBCItemSite | cBCItem)); if (!receiver.isNull()) { QString itemNumber = _private->_buffer.left(_private->_length1); QString warehouseCode = _private->_buffer.right(_private->_length2); XSqlQuery itemsiteid; itemsiteid.prepare( "SELECT itemsite_id, itemsite_item_id " "FROM itemsite, item, whsinfo " "WHERE ( (itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=item_id)" " AND (item_number=:item_number)" " AND (warehous_code=:warehous_code) );" ); itemsiteid.bindValue(":item_number", itemNumber); itemsiteid.bindValue(":warehous_code", warehouseCode); itemsiteid.exec(); if (itemsiteid.first()) { message( tr("Scanned Item %1, Site %2.") .arg(itemNumber) .arg(warehouseCode), 1000 ); if (receiver.type() == cBCItemSite) { if (connect(this, SIGNAL(readItemSite(int)), receiver.target(), receiver.slot())) { emit readItemSite(itemsiteid.value("itemsite_id").toInt()); disconnect(this, SIGNAL(readItemSite(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCItem) { if (connect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot())) { emit readItem(itemsiteid.value("itemsite_item_id").toInt()); disconnect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot()); } } } else message( tr("Item %1, Site %2 does not exist in the Database.") .arg(itemNumber) .arg(warehouseCode), 1000 ); } } void InputManager::dispatchItem() { ReceiverItem receiver = _private->findReceiver(cBCItem); if (!receiver.isNull()) { QString itemNumber = _private->_buffer.left(_private->_length1); XSqlQuery itemid; itemid.prepare( "SELECT item_id " "FROM item " "WHERE (item_number=:item_number);" ); itemid.bindValue(":item_number", itemNumber); itemid.exec(); if (itemid.first()) { message( tr("Scanned Item %1.") .arg(itemNumber), 1000 ); if (connect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot())) { emit readItem(itemid.value("item_id").toInt()); disconnect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot()); } } else message( tr("Item %1 does not exist in the Database.") .arg(itemNumber), 1000 ); } } void InputManager::dispatchUPCCode() { ReceiverItem receiver = _private->findReceiver(cBCItem); if (!receiver.isNull()) { QString upcCode = _private->_buffer.left(_private->_length1); XSqlQuery itemid; itemid.prepare( "SELECT item_id, item_number " "FROM item " "WHERE (item_upccode=:item_upccode);" ); itemid.bindValue(":item_upccode", upcCode); itemid.exec(); if (itemid.first()) { message( tr("Scanned UPC %1 for Item %2.") .arg(upcCode) .arg(itemid.value("item_number").toString()), 1000 ); if (connect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot())) { emit readItem(itemid.value("item_id").toInt()); disconnect(this, SIGNAL(readItem(int)), receiver.target(), receiver.slot()); } } else message( tr("UPC Code %1 does not exist in the Database.") .arg(upcCode), 1000 ); } } void InputManager::dispatchCountTag() { ReceiverItem receiver = _private->findReceiver(cBCCountTag); if (!receiver.isNull()) { QString tagNumber = _private->_buffer.left(_private->_length1); XSqlQuery cnttagid; cnttagid.prepare( "SELECT invcnt_id " "FROM invcnt " "WHERE (invcnt_tagnumber=:tagnumber);" ); cnttagid.bindValue(":tagnumber", tagNumber); cnttagid.exec(); if (cnttagid.first()) { message( tr("Scanned Count Tag %1.") .arg(tagNumber), 1000 ); if (connect(this, SIGNAL(readCountTag(int)), receiver.target(), receiver.slot())) { emit readCountTag(cnttagid.value("invcnt_id").toInt()); disconnect(this, SIGNAL(readCountTag(int)), receiver.target(), receiver.slot()); } } else message( tr("Item %1 does not exist in the Database.") .arg(tagNumber), 1000 ); } } void InputManager::dispatchLocation() { ReceiverItem receiver = _private->findReceiver(cBCLocation); if (!receiver.isNull()) { QString warehouseCode = _private->_buffer.left(_private->_length1); QString locationCode = _private->_buffer.right(_private->_length2); XSqlQuery locationid; locationid.prepare( "SELECT location_id " "FROM location, whsinfo " "WHERE ( (location_warehous_id=warehous_id)" " AND (warehous_code=:warehous_code)" " AND (location_name=:location_name) );" ); locationid.bindValue(":warehous_code", warehouseCode); locationid.bindValue(":location_name", locationCode); locationid.exec(); if (locationid.first()) { message( tr("Scanned Site %1, Location %2.") .arg(warehouseCode) .arg(locationCode), 1000 ); if (connect(this, SIGNAL(readLocation(int)), receiver.target(), receiver.slot())) { emit readLocation(locationid.value("location_id").toInt()); disconnect(this, SIGNAL(readLocation(int)), receiver.target(), receiver.slot()); } } else message( tr("Site %1, Location %2 does not exist in the Database.") .arg(warehouseCode) .arg(locationCode), 1000 ); } } void InputManager::dispatchLocationIssue() { ReceiverItem receiver = _private->findReceiver((cBCLocation | cBCLocationIssue)); if (!receiver.isNull()) { QString warehouseCode = _private->_buffer.left(_private->_length1); QString locationCode = _private->_buffer.right(_private->_length2); XSqlQuery locationid; locationid.prepare( "SELECT location_id " "FROM location, whsinfo " "WHERE ( (location_warehous_id=warehous_id)" " AND (warehous_code=:warehous_code)" " AND (location_name=:location_name) );" ); locationid.bindValue(":warehous_code", warehouseCode); locationid.bindValue(":location_name", locationCode); locationid.exec(); if (locationid.first()) { message( tr("Scanned Site %1, Location %2.") .arg(warehouseCode) .arg(locationCode), 1000 ); if (receiver.type() == cBCLocationIssue) { if (connect(this, SIGNAL(readLocationIssue(int)), receiver.target(), receiver.slot())) { emit readLocationIssue(locationid.value("location_id").toInt()); disconnect(this, SIGNAL(readLocationIssue(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCLocation) { if (connect(this, SIGNAL(readLocation(int)), receiver.target(), receiver.slot())) { emit readLocation(locationid.value("location_id").toInt()); disconnect(this, SIGNAL(readLocation(int)), receiver.target(), receiver.slot()); } } } else message( tr("Site %1, Location %2 does not exist in the Database.") .arg(warehouseCode) .arg(locationCode), 1000 ); } } void InputManager::dispatchLocationContents() { ReceiverItem receiver = _private->findReceiver((cBCLocation | cBCLocationContents)); if (!receiver.isNull()) { QString warehouseCode = _private->_buffer.left(_private->_length1); QString locationCode = _private->_buffer.right(_private->_length2); XSqlQuery locationid; locationid.prepare( "SELECT location_id " "FROM location, whsinfo " "WHERE ( (location_warehous_id=warehous_id)" " AND (warehous_code=:warehous_code)" " AND (location_name=:location_name) );" ); locationid.bindValue(":warehous_code", warehouseCode); locationid.bindValue(":location_name", locationCode); locationid.exec(); if (locationid.first()) { message( tr("Scanned Site %1, Location %2.") .arg(warehouseCode) .arg(locationCode), 1000 ); if (receiver.type() == cBCLocationContents) { if (connect(this, SIGNAL(readLocationContents(int)), receiver.target(), receiver.slot())) { emit readLocationContents(locationid.value("location_id").toInt()); disconnect(this, SIGNAL(readLocationContents(int)), receiver.target(), receiver.slot()); } } else if (receiver.type() == cBCLocation) { if (connect(this, SIGNAL(readLocation(int)), receiver.target(), receiver.slot())) { emit readLocation(locationid.value("location_id").toInt()); disconnect(this, SIGNAL(readLocation(int)), receiver.target(), receiver.slot()); } } } else message( tr("Site %1, Location %2 does not exist in the Database.") .arg(warehouseCode) .arg(locationCode), 1000 ); } } void InputManager::dispatchUser() { ReceiverItem receiver = _private->findReceiver((cBCUser)); if (!receiver.isNull()) { QString username = _private->_buffer.left(_private->_length1); XSqlQuery userid; userid.prepare( "SELECT usr_id " "FROM usr " "WHERE (usr_username=:username);" ); userid.bindValue(":username", username); userid.exec(); if (userid.first()) { message( tr("Scanned User %1.") .arg(username), 1000 ); if (connect(this, SIGNAL(readUser(int)), receiver.target(), receiver.slot())) { emit readUser(userid.value("usr_id").toInt()); disconnect(this, SIGNAL(readUser(int)), receiver.target(), receiver.slot()); } } else message( tr("User %1 not exist in the Database.") .arg(username), 1000 ); } } void InputManager::dispatchLotSerialNumber() { // qDebug("dispatchLotSerialNumber"); ReceiverItem receiver = _private->findReceiver(cBCLotSerialNumber); if (!receiver.isNull()) { QString lotserial = _private->_buffer.left(_private->_length1); XSqlQuery lsdetail; lsdetail.prepare( "SELECT lsdetail_id " "FROM lsdetail " "WHERE (formatlotserialnumber(lsdetail_ls_id)=:lotserial);" ); lsdetail.bindValue(":lotserial", lotserial); lsdetail.exec(); if (lsdetail.first()) { message( tr("Scanned Lot/Serial # %1.").arg(lotserial), 1000); if (connect(this, SIGNAL(readLotSerialNumber(QString)), receiver.target(), receiver.slot())) { emit readLotSerialNumber(lotserial); disconnect(this, SIGNAL(readLotSerialNumber(QString)), receiver.target(), receiver.slot()); } } else message( tr("Lot/Serial # %1 does not exist in the Database.") .arg(lotserial), 1000 ); } } qt-client-4.1.0/guiclient/inputManager.h000066400000000000000000000055421217451700100202060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef inputManager_h #define inputManager_h #include #include class InputManagerPrivate; #define cBCWorkOrder 0x00000010 #define cBCWorkOrderMaterial 0x00000020 #define cBCWorkOrderOperation 0x00000040 #define cBCSalesOrder 0x00000100 #define cBCSalesOrderLineItem 0x00000200 #define cBCItemSite 0x00000400 #define cBCItem 0x00000800 #define cBCUPCCode 0x00001000 #define cBCEANCode 0x00002000 #define cBCCountTag 0x00004000 #define cBCLocation 0x00010000 #define cBCLocationIssue 0x00020000 #define cBCLocationContents 0x00040000 #define cBCUser 0x00100000 #define cBCTransferOrder 0x00200000 #define cBCTransferOrderLineItem 0x00400000 #define cBCLotSerialNumber 0x00800000 #define cBCPurchaseOrder 0x01000000 #define cBCPurchaseOrderLineItem 0x02000000 class InputManager : public QObject { Q_OBJECT public: InputManager(); Q_INVOKABLE void notify(int, QObject *, QObject *, const QString &); Q_INVOKABLE QString slotName(const QString &); public slots: void sRemove(QObject *); signals: void readWorkOrder(int); void readWorkOrderMaterial(int); void readWorkOrderOperation(int); void readPurchaseOrder(int); void readPurchaseOrderLineItem(int); void readSalesOrder(int); void readSalesOrderLineItem(int); void readTransferOrder(int); void readTransferOrderLineItem(int); void readItemSite(int); void readItem(int); void readCountTag(int); void readLocation(int); void readLocationIssue(int); void readLocationContents(int); void readLotSerialNumber(QString); void readUser(int); protected: bool eventFilter(QObject *, QEvent *); private: InputManagerPrivate *_private; void dispatchWorkOrder(); void dispatchWorkOrderOperation(); void dispatchPurchaseOrder(); void dispatchPurchaseOrderLineItem(); void dispatchSalesOrder(); void dispatchSalesOrderLineItem(); void dispatchTransferOrder(); void dispatchTransferOrderLineItem(); void dispatchItemSite(); void dispatchItem(); void dispatchUPCCode(); void dispatchCountTag(); void dispatchLocation(); void dispatchLocationIssue(); void dispatchLocationContents(); void dispatchLotSerialNumber(); void dispatchUser(); }; #endif qt-client-4.1.0/guiclient/invoice.cpp000066400000000000000000001465041217451700100175470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "invoice.h" #include #include #include #include #include #include #include "invoiceItem.h" #include "storedProcErrorLookup.h" #include "taxBreakdown.h" #include "allocateARCreditMemo.h" #define cViewQuote (0x20 | cView) invoice::invoice(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, fl) { if(name) setObjectName(name); setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_cust, SIGNAL(newId(int)), _shipTo, SLOT(setCustid(int))); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustomerInfo(int))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_copyToShipto, SIGNAL(clicked()), this, SLOT(sCopyToShipto())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_shipTo, SIGNAL(newId(int)), this, SLOT(populateShipto(int))); connect(_shipToName, SIGNAL(textChanged(const QString&)), this, SLOT(sShipToModified())); connect(_subtotal, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_tax, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_miscAmount, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); connect(_allocatedCM, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_outstandingCM, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_authCC, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_shipToAddr, SIGNAL(changed()), this, SLOT(sShipToModified())); connect(_shipToPhone, SIGNAL(textChanged(const QString&)), this, SLOT(sShipToModified())); connect(_authCC, SIGNAL(idChanged(int)), this, SLOT(populateCCInfo())); connect(_allocatedCM, SIGNAL(idChanged(int)), this, SLOT(populateCMInfo())); connect(_outstandingCM, SIGNAL(idChanged(int)), this, SLOT(populateCMInfo())); connect(_authCC, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(populateCCInfo())); if (_privileges->check("ApplyARMemos")) connect(_allocatedCMLit, SIGNAL(leftClickedURL(const QString &)), this, SLOT(sCreditAllocate())); connect(_allocatedCM, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(populateCMInfo())); connect(_outstandingCM, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(populateCMInfo())); connect(_invcitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_invcitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_invcitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_taxzone, SIGNAL(newID(int)), this, SLOT(sTaxZoneChanged())); connect(_shipChrgs, SIGNAL(newID(int)), this, SLOT(sHandleShipchrg(int))); connect(_cust, SIGNAL(newCrmacctId(int)), _billToAddr, SLOT(setSearchAcct(int))); connect(_cust, SIGNAL(newCrmacctId(int)), _shipToAddr, SLOT(setSearchAcct(int))); connect(_invoiceNumber, SIGNAL(editingFinished()), this, SLOT(sCheckInvoiceNumber())); setFreeFormShipto(false); _custtaxzoneid = -1; _invcheadid = -1; _taxzoneidCache = -1; _loading = false; _freightCache = 0; _posted = false; _NumberGen = -1; _cust->setType(CLineEdit::ActiveCustomers); _shipTo->setNameVisible(false); _shipTo->setDescriptionVisible(false); _invcitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "invcitem_linenumber" ); _invcitem->addColumn(tr("Order #"), _itemColumn, Qt::AlignLeft, true, "soitemnumber" ); _invcitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "itemnumber" ); _invcitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription" ); _invcitem->addColumn(tr("Qty. UOM"), _uomColumn, Qt::AlignLeft, true, "qtyuom" ); _invcitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "invcitem_ordered" ); _invcitem->addColumn(tr("Billed"), _qtyColumn, Qt::AlignRight, true, "invcitem_billed" ); _invcitem->addColumn(tr("Price UOM"), _uomColumn, Qt::AlignLeft, true, "priceuom" ); _invcitem->addColumn(tr("Price"), _moneyColumn, Qt::AlignRight, true, "invcitem_price" ); _invcitem->addColumn(tr("Extended"), _bigMoneyColumn, Qt::AlignRight, true, "extprice" ); _custCurrency->setLabel(_custCurrencyLit); _project->setType(ProjectLineEdit::SalesOrder); if(!_metrics->boolean("UseProjects")) _project->hide(); _miscAmount->setAllowNegative(true); _commission->setValidator(omfgThis->percentVal()); // some customers are creating scripts to show these widgets, probably shouldn't remove _paymentLit->hide(); _payment->hide(); // Issue 9895: if no objections over time, we should ultimately remove this. _recurring->setParent(-1, "I"); _miscChargeAccount->setType(GLCluster::cRevenue | GLCluster::cExpense); } invoice::~invoice() { // no need to delete child widgets, Qt does it all for us } void invoice::languageChange() { retranslateUi(this); } enum SetResponse invoice::set(const ParameterList &pParams) { XSqlQuery invoiceet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { setObjectName("invoice new"); _mode = cNew; invoiceet.exec("SELECT NEXTVAL('invchead_invchead_id_seq') AS invchead_id;"); if (invoiceet.first()) { _invcheadid = invoiceet.value("invchead_id").toInt(); _recurring->setParent(_invcheadid, "I"); } else if (invoiceet.lastError().type() != QSqlError::NoError) { systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } if ((_metrics->value("InvcNumberGeneration") == "A") || (_metrics->value("InvcNumberGeneration") == "O")) { invoiceet.exec("SELECT fetchInvcNumber() AS number;"); if (invoiceet.first()) { _invoiceNumber->setText(invoiceet.value("number").toString()); _NumberGen = invoiceet.value("number").toInt(); if (_metrics->value("InvcNumberGeneration") == "A") _invoiceNumber->setEnabled(false); } else if (invoiceet.lastError().type() != QSqlError::NoError) { systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else sCheckInvoiceNumber(); _orderDate->setDate(omfgThis->dbDate()); _shipDate->setDate(omfgThis->dbDate()); _invoiceDate->setDate(omfgThis->dbDate(), true); invoiceet.prepare("INSERT INTO invchead (" " invchead_id, invchead_invcnumber, invchead_orderdate," " invchead_invcdate, invchead_cust_id, invchead_posted," " invchead_printed, invchead_commission, invchead_freight," " invchead_misc_amount, invchead_shipchrg_id " ") VALUES (" " :invchead_id, :invchead_invcnumber, :invchead_orderdate, " " :invchead_invcdate, -1, false," " false, 0, 0," " 0, -1" ");"); invoiceet.bindValue(":invchead_id", _invcheadid); invoiceet.bindValue(":invchead_invcnumber",_invoiceNumber->text().isEmpty() ? "TEMP" + QString(0 - _invcheadid) : _invoiceNumber->text()); invoiceet.bindValue(":invchead_orderdate", _orderDate->date()); invoiceet.bindValue(":invchead_invcdate", _invoiceDate->date()); invoiceet.exec(); if (invoiceet.lastError().type() != QSqlError::NoError) { systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } connect(_cust, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); connect(_cust, SIGNAL(valid(bool)), this, SLOT(populateCMInfo())); connect(_orderNumber, SIGNAL(editingFinished()), this, SLOT(populateCCInfo())); } else if (param.toString() == "edit") { param = pParams.value("invchead_id", &valid); if(valid) _invcheadid = param.toInt(); setObjectName(QString("invoice edit %1").arg(_invcheadid)); _mode = cEdit; _new->setEnabled(TRUE); _cust->setReadOnly(TRUE); } else if (param.toString() == "view") { setObjectName(QString("invoice view %1").arg(_invcheadid)); _mode = cView; _invoiceNumber->setEnabled(FALSE); _orderNumber->setEnabled(FALSE); _invoiceDate->setEnabled(FALSE); _shipDate->setEnabled(FALSE); _orderDate->setEnabled(FALSE); _poNumber->setEnabled(FALSE); _cust->setReadOnly(TRUE); _salesrep->setEnabled(FALSE); _commission->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _terms->setEnabled(FALSE); _terms->setType(XComboBox::Terms); _fob->setEnabled(FALSE); _shipVia->setEnabled(FALSE); _billToName->setEnabled(FALSE); _billToAddr->setEnabled(FALSE); _billToPhone->setEnabled(FALSE); _shipTo->setEnabled(FALSE); _shipToName->setEnabled(FALSE); _shipToAddr->setEnabled(FALSE); _shipToPhone->setEnabled(FALSE); _miscAmount->setEnabled(FALSE); _miscChargeDescription->setEnabled(FALSE); _miscChargeAccount->setReadOnly(TRUE); _freight->setEnabled(FALSE); _payment->setEnabled(FALSE); _notes->setReadOnly(TRUE); _edit->hide(); _save->hide(); _delete->hide(); _project->setEnabled(false); _shipChrgs->setEnabled(FALSE); _shippingZone->setEnabled(FALSE); _saleType->setEnabled(FALSE); disconnect(_invcitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); disconnect(_invcitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); disconnect(_invcitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_invcitem, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } } param = pParams.value("cust_id", &valid); if(cNew == _mode && valid) _cust->setId(param.toInt()); param = pParams.value("invchead_id", &valid); if (valid) { _invcheadid = param.toInt(); populate(); populateCMInfo(); populateCCInfo(); } return NoError; } void invoice::sClose() { XSqlQuery invoiceClose; if (_mode == cNew) { int answer = QMessageBox::question(this, tr("Delete Invoice?"), tr("

    This Invoice has not been saved. " "Do you wish to delete this Invoice?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes); if (QMessageBox::No == answer) return; else { // make sure invoice not posted invoiceClose.prepare( "SELECT invchead_posted FROM invchead WHERE (invchead_id=:invchead_id);" ); invoiceClose.bindValue(":invchead_id", _invcheadid); invoiceClose.exec(); if (invoiceClose.lastError().type() != QSqlError::NoError) systemError(this, invoiceClose.lastError().databaseText(), __FILE__, __LINE__); if (invoiceClose.first() && invoiceClose.value("invchead_posted").toBool()) { QMessageBox::warning( this, tr("Cannot delete Invoice"), tr("

    The Invoice has been posted and must be saved.") ); return; } invoiceClose.prepare( "SELECT deleteInvoice(:invchead_id) AS result;" ); invoiceClose.bindValue(":invchead_id", _invcheadid); invoiceClose.exec(); if (invoiceClose.first()) { int result = invoiceClose.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteInvoice", result), __FILE__, __LINE__); } } else if (invoiceClose.lastError().type() != QSqlError::NoError) systemError(this, tr("Error deleting Invoice %1\n").arg(_invcheadid) + invoiceClose.lastError().databaseText(), __FILE__, __LINE__); } } else if (_mode == cEdit) { if (_invcitem->topLevelItemCount() <= 0 ) { int answer = QMessageBox::question(this, tr("Delete Invoice with no Line Items?"), tr("

    This Invoice does not contain any Line Items " "associated with it. Do you wish to delete " "this Invoice?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes); if (QMessageBox::No == answer) return; else { invoiceClose.prepare( "SELECT deleteInvoice(:invchead_id) AS result;" ); invoiceClose.bindValue(":invchead_id", _invcheadid); invoiceClose.exec(); if (invoiceClose.first()) { int result = invoiceClose.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteInvoice", result), __FILE__, __LINE__); } } else if (invoiceClose.lastError().type() != QSqlError::NoError) systemError(this, tr("Error deleting Invoice %1\n").arg(_invcheadid) + invoiceClose.lastError().databaseText(), __FILE__, __LINE__); } } } close(); } void invoice::sPopulateCustomerInfo(int pCustid) { if (pCustid != -1) { XSqlQuery cust; cust.prepare( "SELECT cust_name, COALESCE(cntct_addr_id,-1) AS addr_id, " " cust_salesrep_id, cust_commprcnt * 100 AS commission," " cust_creditstatus, cust_terms_id, " " COALESCE(cust_taxzone_id, -1) AS cust_taxzone_id," " COALESCE(cust_shipchrg_id, -1) AS cust_shipchrg_id," " cust_ffshipto, cust_ffbillto, " " COALESCE(shipto_id, -1) AS shiptoid, " " cust_curr_id " "FROM custinfo " " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) " " LEFT OUTER JOIN shiptoinfo ON ( (shipto_cust_id=cust_id) " " AND (shipto_default) ) " "WHERE (cust_id=:cust_id);" ); cust.bindValue(":cust_id", pCustid); cust.exec(); if (cust.first()) { _billToName->setText(cust.value("cust_name").toString()); _billToAddr->setId(cust.value("addr_id").toInt()); _salesrep->setId(cust.value("cust_salesrep_id").toInt()); _commission->setDouble(cust.value("commission").toDouble()); _terms->setId(cust.value("cust_terms_id").toInt()); _custtaxzoneid = cust.value("cust_taxzone_id").toInt(); _taxzone->setId(cust.value("cust_taxzone_id").toInt()); _custCurrency->setId(cust.value("cust_curr_id").toInt()); _shipChrgs->setId(cust.value("cust_shipchrg_id").toInt()); bool ffBillTo = cust.value("cust_ffbillto").toBool(); if (_mode != cView) { _billToName->setEnabled(ffBillTo); _billToAddr->setEnabled(ffBillTo); _billToPhone->setEnabled(ffBillTo); } setFreeFormShipto(cust.value("cust_ffshipto").toBool()); if (cust.value("shiptoid").toInt() != -1) populateShipto(cust.value("shiptoid").toInt()); else { _shipTo->setId(-1); _shipToName->clear(); _shipToAddr->clear(); _shipToPhone->clear(); } } if (cust.lastError().type() != QSqlError::NoError) { systemError(this, cust.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _salesrep->setCurrentIndex(-1); _commission->clear(); _terms->setCurrentIndex(-1); _custtaxzoneid = -1; _taxzoneidCache = -1; _taxzone->setCurrentIndex(-1); } } void invoice::populateShipto(int pShiptoid) { if (pShiptoid != -1) { XSqlQuery shipto; shipto.prepare( "SELECT shipto_id, shipto_num, shipto_name, shipto_addr_id, " " cntct_phone, shipto_shipvia, shipto_salesrep_id, " " COALESCE(shipto_taxzone_id, -1) AS shipto_taxzone_id," " COALESCE(shipto_shipchrg_id, -1) AS shipto_shipchrg_id," " COALESCE(shipto_shipzone_id, -1) AS shipto_shipzone_id," " shipto_commission * 100 AS commission " "FROM shiptoinfo LEFT OUTER JOIN " " cntct ON (shipto_cntct_id=cntct_id)" "WHERE (shipto_id=:shipto_id);" ); shipto.bindValue(":shipto_id", pShiptoid); shipto.exec(); if (shipto.first()) { _shipToAddr->blockSignals(true); _shipTo->blockSignals(true); _shipToName->blockSignals(true); _shipToPhone->blockSignals(true); _shipToName->setText(shipto.value("shipto_name")); _shipToAddr->setId(shipto.value("shipto_addr_id").toInt()); _shipToPhone->setText(shipto.value("cntct_phone")); _shipTo->setId(shipto.value("shipto_id").toInt()); _shipToAddr->blockSignals(false); _shipTo->blockSignals(false); _shipToName->blockSignals(false); _shipToPhone->blockSignals(false); _salesrep->setId(shipto.value("shipto_salesrep_id").toInt()); _commission->setDouble(shipto.value("commission").toDouble()); _shipVia->setText(shipto.value("shipto_shipvia")); _taxzone->setId(shipto.value("shipto_taxzone_id").toInt()); _shipChrgs->setId(shipto.value("shipto_shipchrg_id").toInt()); _shippingZone->setId(shipto.value("shipto_shipzone_id").toInt()); } else if (shipto.lastError().type() != QSqlError::NoError) { systemError(this, shipto.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _shipTo->blockSignals(true); _shipTo->setId(-1); _shipTo->blockSignals(false); _shipToName->clear(); _shipToAddr->clear(); _shipToPhone->clear(); } } void invoice::sCopyToShipto() { _shipTo->blockSignals(true); _shipToAddr->blockSignals(true); _shipTo->setId(-1); _shipToName->setText(_billToName->text()); _shipToAddr->setId(_billToAddr->id()); _shipToPhone->setText(_billToPhone->text()); _taxzone->setId(_custtaxzoneid); _shipTo->blockSignals(false); _shipToAddr->blockSignals(false); } void invoice::sSave() { struct { bool condition; QString msg; QWidget* widget; } error[] = { { _cust->id() <= 0, tr("

    You must enter a Customer for this Invoice before saving it."), _cust }, // TODO: add more error checks here? { true, "", NULL } }; if (_total->localValue() < 0 ) { QMessageBox::information(this, tr("Total Less than Zero"), tr("

    The Total must be a positive value.") ); _cust->setFocus(); return; } //Invoices must have atleast one line item. if (_invcitem->topLevelItemCount() <= 0 ) { QMessageBox::information(this, tr("No Line Items"), tr("

    There must be at least one line item for an invoice.") ); _new->setFocus(); return; } // We can't post a Misc. Charge without a Sales Account if ( (! _miscAmount->isZero()) && (!_miscChargeAccount->isValid()) ) { QMessageBox::warning( this, tr("No Misc. Charge Account Number"), tr("

    You may not enter a Misc. Charge without " "indicating the G/L Sales Account number for the " "charge. Please set the Misc. Charge amount to 0 " "or select a Misc. Charge Sales Account." ) ); _tabWidget->setCurrentIndex(_tabWidget->indexOf(lineItemsTab)); _miscChargeAccount->setFocus(); return; } int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Save Invoice"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } // save address info in case someone wants to use 'em again later // but don't make any global changes to the data and ignore errors _shipToAddr->blockSignals(true); _billToAddr->save(AddressCluster::CHANGEONE); _shipToAddr->save(AddressCluster::CHANGEONE); _shipToAddr->blockSignals(false); // finally save the invchead if (!save()) return; omfgThis->sInvoicesUpdated(_invcheadid, TRUE); _invcheadid = -1; close(); } bool invoice::save() { XSqlQuery invoiceave; RecurrenceWidget::RecurrenceChangePolicy cp = _recurring->getChangePolicy(); if (cp == RecurrenceWidget::NoPolicy) return false; XSqlQuery rollbackq; rollbackq.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); invoiceave.prepare( "UPDATE invchead " "SET invchead_cust_id=:invchead_cust_id," " invchead_invcdate=:invchead_invcdate," " invchead_shipdate=:invchead_shipdate," " invchead_invcnumber=:invchead_invcnumber," " invchead_ordernumber=:invchead_ordernumber," " invchead_orderdate=:invchead_orderdate," " invchead_ponumber=:invchead_ponumber," " invchead_billto_name=:invchead_billto_name, invchead_billto_address1=:invchead_billto_address1," " invchead_billto_address2=:invchead_billto_address2, invchead_billto_address3=:invchead_billto_address3," " invchead_billto_city=:invchead_billto_city, invchead_billto_state=:invchead_billto_state," " invchead_billto_zipcode=:invchead_billto_zipcode, invchead_billto_phone=:invchead_billto_phone," " invchead_billto_country=:invchead_billto_country," " invchead_shipto_id=:invchead_shipto_id," " invchead_shipto_name=:invchead_shipto_name, invchead_shipto_address1=:invchead_shipto_address1," " invchead_shipto_address2=:invchead_shipto_address2, invchead_shipto_address3=:invchead_shipto_address3," " invchead_shipto_city=:invchead_shipto_city, invchead_shipto_state=:invchead_shipto_state," " invchead_shipto_zipcode=:invchead_shipto_zipcode, invchead_shipto_phone=:invchead_shipto_phone," " invchead_shipto_country=:invchead_shipto_country," " invchead_salesrep_id=:invchead_salesrep_id," " invchead_terms_id=:invchead_terms_id, invchead_commission=:invchead_commission," " invchead_misc_amount=:invchead_misc_amount, invchead_misc_descrip=:invchead_misc_descrip," " invchead_misc_accnt_id=:invchead_misc_accnt_id," " invchead_freight=:invchead_freight," " invchead_payment=:invchead_payment," " invchead_curr_id=:invchead_curr_id," " invchead_shipvia=:invchead_shipvia, invchead_fob=:invchead_fob, invchead_notes=:invchead_notes," " invchead_recurring_invchead_id=:invchead_recurring_invchead_id," " invchead_prj_id=:invchead_prj_id," " invchead_shipchrg_id=:invchead_shipchrg_id, " " invchead_taxzone_id=:invchead_taxzone_id," " invchead_shipzone_id=:invchead_shipzone_id," " invchead_saletype_id=:invchead_saletype_id " "WHERE (invchead_id=:invchead_id);" ); invoiceave.bindValue(":invchead_id", _invcheadid); invoiceave.bindValue(":invchead_invcnumber", _invoiceNumber->text()); invoiceave.bindValue(":invchead_cust_id", _cust->id()); invoiceave.bindValue(":invchead_invcdate", _invoiceDate->date()); invoiceave.bindValue(":invchead_shipdate", _shipDate->date()); invoiceave.bindValue(":invchead_orderdate", _orderDate->date()); invoiceave.bindValue(":invchead_ponumber", _poNumber->text()); invoiceave.bindValue(":invchead_billto_name", _billToName->text()); invoiceave.bindValue(":invchead_billto_address1", _billToAddr->line1()); invoiceave.bindValue(":invchead_billto_address2", _billToAddr->line2()); invoiceave.bindValue(":invchead_billto_address3", _billToAddr->line3()); invoiceave.bindValue(":invchead_billto_city", _billToAddr->city()); invoiceave.bindValue(":invchead_billto_state", _billToAddr->state()); invoiceave.bindValue(":invchead_billto_zipcode", _billToAddr->postalCode()); invoiceave.bindValue(":invchead_billto_country", _billToAddr->country()); invoiceave.bindValue(":invchead_billto_phone", _billToPhone->text()); invoiceave.bindValue(":invchead_shipto_id", _shipTo->id()); invoiceave.bindValue(":invchead_shipto_name", _shipToName->text()); invoiceave.bindValue(":invchead_shipto_address1", _shipToAddr->line1()); invoiceave.bindValue(":invchead_shipto_address2", _shipToAddr->line2()); invoiceave.bindValue(":invchead_shipto_address3", _shipToAddr->line3()); invoiceave.bindValue(":invchead_shipto_city", _shipToAddr->city()); invoiceave.bindValue(":invchead_shipto_state", _shipToAddr->state()); invoiceave.bindValue(":invchead_shipto_zipcode", _shipToAddr->postalCode()); invoiceave.bindValue(":invchead_shipto_country", _shipToAddr->country()); invoiceave.bindValue(":invchead_shipto_phone", _shipToPhone->text()); if(_taxzone->isValid()) invoiceave.bindValue(":invchead_taxzone_id", _taxzone->id()); invoiceave.bindValue(":invchead_salesrep_id", _salesrep->id()); invoiceave.bindValue(":invchead_terms_id", _terms->id()); invoiceave.bindValue(":invchead_commission", (_commission->toDouble() / 100.0)); invoiceave.bindValue(":invchead_freight", _freight->localValue()); invoiceave.bindValue(":invchead_payment", _payment->localValue()); invoiceave.bindValue(":invchead_curr_id", _custCurrency->id()); invoiceave.bindValue(":invchead_misc_amount", _miscAmount->localValue()); invoiceave.bindValue(":invchead_misc_descrip", _miscChargeDescription->text()); invoiceave.bindValue(":invchead_misc_accnt_id",_miscChargeAccount->id()); invoiceave.bindValue(":invchead_shipvia", _shipVia->currentText()); invoiceave.bindValue(":invchead_fob", _fob->text()); invoiceave.bindValue(":invchead_notes", _notes->toPlainText()); invoiceave.bindValue(":invchead_prj_id", _project->id()); invoiceave.bindValue(":invchead_shipchrg_id", _shipChrgs->id()); if(_shippingZone->isValid()) invoiceave.bindValue(":invchead_shipzone_id", _shippingZone->id()); if(_saleType->isValid()) invoiceave.bindValue(":invchead_saletype_id", _saleType->id()); if(_recurring->isRecurring()) { if(_recurring->parentId() != 0) invoiceave.bindValue(":invchead_recurring_invchead_id", _recurring->parentId()); else invoiceave.bindValue(":invchead_recurring_invchead_id", _invcheadid); } if (_orderNumber->text().length()) invoiceave.bindValue(":invchead_ordernumber", _orderNumber->text().toInt()); invoiceave.exec(); if (invoiceave.lastError().type() != QSqlError::NoError) { rollbackq.exec(); systemError(this, invoiceave.lastError().databaseText(), __FILE__, __LINE__); return false; } QString errmsg; if (! _recurring->save(true, cp, &errmsg)) { rollbackq.exec(); systemError(this, errmsg, __FILE__, __LINE__); return false; } XSqlQuery commitq("COMMIT;"); return true; } void invoice::sNew() { if (!save()) return; ParameterList params; params.append("mode", "new"); params.append("invchead_id", _invcheadid); invoiceItem newdlg(this); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillItemList(); } void invoice::sEdit() { if (!save()) return; ParameterList params; params.append("mode", "edit"); params.append("invchead_id", _invcheadid); params.append("invcitem_id", _invcitem->id()); invoiceItem newdlg(this); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillItemList(); } void invoice::sView() { ParameterList params; params.append("mode", "view"); params.append("invchead_id", _invcheadid); params.append("invcitem_id", _invcitem->id()); invoiceItem newdlg(this); newdlg.set(params); newdlg.exec(); } void invoice::sDelete() { XSqlQuery invoiceDelete; invoiceDelete.prepare( "DELETE FROM invcitem " "WHERE (invcitem_id=:invcitem_id);" ); invoiceDelete.bindValue(":invcitem_id", _invcitem->id()); invoiceDelete.exec(); if (invoiceDelete.lastError().type() != QSqlError::NoError) { systemError(this, invoiceDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillItemList(); } void invoice::populate() { XSqlQuery invoicepopulate; invoicepopulate.prepare( "SELECT invchead.*," " COALESCE(invchead_taxzone_id, -1) AS taxzone_id," " COALESCE(cust_taxzone_id, -1) AS cust_taxzone_id," " cust_ffbillto, cust_ffshipto, " " invchead_shipchrg_id, invchead_ordernumber, " " COALESCE(invchead_shipchrg_id,-1) AS shipchrg_id " "FROM invchead LEFT OUTER JOIN cohead " "ON (cohead.cohead_number = invchead.invchead_ordernumber) " "JOIN custinfo ON (invchead_cust_id = cust_id) " "WHERE (invchead_id=:invchead_id);" ); invoicepopulate.bindValue(":invchead_id", _invcheadid); invoicepopulate.exec(); if (invoicepopulate.first()) { _loading = true; // We are setting the _taxzoneidCache here to the value that // sPopulateCustomerInfo is going to set the _taxzone to. // The reason for doing this is to prevent sPopulateCustomerInfo // from triggering the sTaxZoneChanged() function which does some // database manipulation that may be unnecessary or even harmful // and we intend to set the values a little further down and they // may differ. _taxzoneidCache = invoicepopulate.value("cust_taxzone_id").toInt(); _cust->setId(invoicepopulate.value("invchead_cust_id").toInt()); _custCurrency->setId(invoicepopulate.value("invchead_curr_id").toInt()); _invoiceNumber->setText(invoicepopulate.value("invchead_invcnumber").toString()); _invoiceNumber->setEnabled(false); _orderNumber->setText(invoicepopulate.value("invchead_ordernumber").toString()); if (! _orderNumber->text().isEmpty() && _orderNumber->text().toInt() != 0) _custCurrency->setEnabled(FALSE); _invoiceDate->setDate(invoicepopulate.value("invchead_invcdate").toDate(), true); _orderDate->setDate(invoicepopulate.value("invchead_orderdate").toDate()); _shipDate->setDate(invoicepopulate.value("invchead_shipdate").toDate()); _poNumber->setText(invoicepopulate.value("invchead_ponumber").toString()); _shipVia->setText(invoicepopulate.value("invchead_shipvia").toString()); _fob->setText(invoicepopulate.value("invchead_fob").toString()); _shipChrgs->setId(invoicepopulate.value("shipchrg_id").toInt()); _freightCache=invoicepopulate.value("invchead_freight").toDouble(); _freight->setLocalValue(invoicepopulate.value("invchead_freight").toDouble()); if(invoicepopulate.value("invchead_recurring_invchead_id").toInt() != 0) _recurring->setParent(invoicepopulate.value("invchead_recurring_invchead_id").toInt(), "I"); else _recurring->setParent(_invcheadid, "I"); _salesrep->setId(invoicepopulate.value("invchead_salesrep_id").toInt()); _commission->setDouble(invoicepopulate.value("invchead_commission").toDouble() * 100); _taxzoneidCache = invoicepopulate.value("taxzone_id").toInt(); _taxzone->setId(invoicepopulate.value("taxzone_id").toInt()); _terms->setId(invoicepopulate.value("invchead_terms_id").toInt()); _project->setId(invoicepopulate.value("invchead_prj_id").toInt()); _shippingZone->setId(invoicepopulate.value("invchead_shipzone_id").toInt()); _saleType->setId(invoicepopulate.value("invchead_saletype_id").toInt()); bool ffBillTo = invoicepopulate.value("cust_ffbillto").toBool(); if (_mode != cView) { _billToName->setEnabled(ffBillTo); _billToAddr->setEnabled(ffBillTo); _billToPhone->setEnabled(ffBillTo); } _billToName->setText(invoicepopulate.value("invchead_billto_name").toString()); _billToAddr->setLine1(invoicepopulate.value("invchead_billto_address1").toString()); _billToAddr->setLine2(invoicepopulate.value("invchead_billto_address2").toString()); _billToAddr->setLine3(invoicepopulate.value("invchead_billto_address3").toString()); _billToAddr->setCity(invoicepopulate.value("invchead_billto_city").toString()); _billToAddr->setState(invoicepopulate.value("invchead_billto_state").toString()); _billToAddr->setPostalCode(invoicepopulate.value("invchead_billto_zipcode").toString()); _billToAddr->setCountry(invoicepopulate.value("invchead_billto_country").toString()); _billToPhone->setText(invoicepopulate.value("invchead_billto_phone").toString()); setFreeFormShipto(invoicepopulate.value("cust_ffshipto").toBool()); _shipToName->setText(invoicepopulate.value("invchead_shipto_name").toString()); _shipToAddr->setLine1(invoicepopulate.value("invchead_shipto_address1").toString()); _shipToAddr->setLine2(invoicepopulate.value("invchead_shipto_address2").toString()); _shipToAddr->setLine3(invoicepopulate.value("invchead_shipto_address3").toString()); _shipToAddr->setCity(invoicepopulate.value("invchead_shipto_city").toString()); _shipToAddr->setState(invoicepopulate.value("invchead_shipto_state").toString()); _shipToAddr->setPostalCode(invoicepopulate.value("invchead_shipto_zipcode").toString()); _shipToAddr->setCountry(invoicepopulate.value("invchead_shipto_country").toString()); _shipToPhone->setText(invoicepopulate.value("invchead_shipto_phone").toString()); _shipTo->blockSignals(true); _shipTo->setId(invoicepopulate.value("invchead_shipto_id").toInt()); _shipTo->blockSignals(false); _payment->setLocalValue(invoicepopulate.value("invchead_payment").toDouble()); _miscChargeDescription->setText(invoicepopulate.value("invchead_misc_descrip")); _miscChargeAccount->setId(invoicepopulate.value("invchead_misc_accnt_id").toInt()); _miscAmount->setLocalValue(invoicepopulate.value("invchead_misc_amount").toDouble()); _notes->setText(invoicepopulate.value("invchead_notes").toString()); _posted = invoicepopulate.value("invchead_posted").toBool(); if (_posted) { _new->setEnabled(false); disconnect(_invcitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); disconnect(_invcitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); _invoiceNumber->setEnabled(false); _invoiceDate->setEnabled(false); _terms->setEnabled(false); _salesrep->setEnabled(false); _commission->setEnabled(false); _taxzone->setEnabled(false); _shipChrgs->setEnabled(false); _project->setEnabled(false); _miscChargeAccount->setEnabled(false); _miscAmount->setEnabled(false); _freight->setEnabled(false); _shippingZone->setEnabled(false); _saleType->setEnabled(false); } _loading = false; sFillItemList(); } if (invoicepopulate.lastError().type() != QSqlError::NoError) { systemError(this, invoicepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void invoice::sFillItemList() { XSqlQuery invoiceFillItemList; invoiceFillItemList.prepare( "SELECT invcitem_id, invcitem_linenumber," " formatSoItemNumber(invcitem_coitem_id) AS soitemnumber, " " CASE WHEN (item_id IS NULL) THEN invcitem_number" " ELSE item_number" " END AS itemnumber," " CASE WHEN (item_id IS NULL) THEN invcitem_descrip" " ELSE (item_descrip1 || ' ' || item_descrip2)" " END AS itemdescription," " quom.uom_name AS qtyuom," " invcitem_ordered, invcitem_billed," " puom.uom_name AS priceuom," " invcitem_price," " round((invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price / " " (CASE WHEN(item_id IS NULL) THEN 1 " " ELSE invcitem_price_invuomratio END)), 2) AS extprice," " 'qty' AS invcitem_ordered_xtnumericrole," " 'qty' AS invcitem_billed_xtnumericrole," " 'salesprice' AS invcitem_price_xtnumericrole," " 'curr' AS extprice_xtnumericrole " "FROM invcitem LEFT OUTER JOIN item on (invcitem_item_id=item_id) " " LEFT OUTER JOIN uom AS quom ON (invcitem_qty_uom_id=quom.uom_id)" " LEFT OUTER JOIN uom AS puom ON (invcitem_price_uom_id=puom.uom_id)" "WHERE (invcitem_invchead_id=:invchead_id) " "ORDER BY invcitem_linenumber;" ); invoiceFillItemList.bindValue(":invchead_id", _invcheadid); invoiceFillItemList.bindValue(":curr_id", _custCurrency->id()); invoiceFillItemList.bindValue(":date", _orderDate->date()); invoiceFillItemList.exec(); if (invoiceFillItemList.lastError().type() != QSqlError::NoError) systemError(this, invoiceFillItemList.lastError().databaseText(), __FILE__, __LINE__); _invcitem->clear(); _invcitem->populate(invoiceFillItemList); // Determine the subtotal invoiceFillItemList.prepare( "SELECT SUM( round(((invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price /" " CASE WHEN (item_id IS NULL) THEN 1" " ELSE invcitem_price_invuomratio" " END)),2) ) AS subtotal " "FROM invcitem LEFT OUTER JOIN item ON (invcitem_item_id=item_id) " "WHERE (invcitem_invchead_id=:invchead_id);" ); invoiceFillItemList.bindValue(":invchead_id", _invcheadid); invoiceFillItemList.exec(); if (invoiceFillItemList.first()) _subtotal->setLocalValue(invoiceFillItemList.value("subtotal").toDouble()); else if (invoiceFillItemList.lastError().type() != QSqlError::NoError) systemError(this, invoiceFillItemList.lastError().databaseText(), __FILE__, __LINE__); _custCurrency->setEnabled(_invcitem->topLevelItemCount() == 0); // TODO: Calculate the Freight weight here. sCalculateTax(); } void invoice::sCalculateTotal() { _total->setLocalValue(_subtotal->localValue() + _miscAmount->localValue() + _freight->localValue() + _tax->localValue()); _balance->setLocalValue(_total->localValue() - _allocatedCM->localValue() - _authCC->localValue() - _outstandingCM->localValue()); if (_balance->localValue() < 0) _balance->setLocalValue(0); } void invoice::closeEvent(QCloseEvent *pEvent) { XSqlQuery invoicecloseEvent; if ( (_mode == cNew) && (_invcheadid != -1) ) { // make sure invoice not posted invoicecloseEvent.prepare( "SELECT invchead_posted FROM invchead WHERE (invchead_id=:invchead_id);" ); invoicecloseEvent.bindValue(":invchead_id", _invcheadid); invoicecloseEvent.exec(); if (invoicecloseEvent.lastError().type() != QSqlError::NoError) systemError(this, invoicecloseEvent.lastError().databaseText(), __FILE__, __LINE__); if (invoicecloseEvent.first() && invoicecloseEvent.value("invchead_posted").toBool()) { QMessageBox::warning( this, tr("Cannot delete Invoice"), tr("

    The Invoice has been posted and must be saved.") ); return; } invoicecloseEvent.prepare( "DELETE FROM invcitem WHERE (invcitem_invchead_id=:invchead_id);" ); invoicecloseEvent.bindValue(":invchead_id", _invcheadid); invoicecloseEvent.bindValue(":invoiceNumber", _invoiceNumber->text().toInt()); invoicecloseEvent.exec(); if (invoicecloseEvent.lastError().type() != QSqlError::NoError) systemError(this, invoicecloseEvent.lastError().databaseText(), __FILE__, __LINE__); sReleaseNumber(); } XWidget::closeEvent(pEvent); } void invoice::sReleaseNumber() { XSqlQuery invoiceReleaseNumber; if(-1 != _NumberGen) { invoiceReleaseNumber.prepare("SELECT releaseInvcNumber(:number);" ); invoiceReleaseNumber.bindValue(":number", _NumberGen); invoiceReleaseNumber.exec(); if (invoiceReleaseNumber.lastError().type() != QSqlError::NoError) systemError(this, invoiceReleaseNumber.lastError().databaseText(), __FILE__, __LINE__); _NumberGen = -1; } } void invoice::sTaxDetail() { if (_mode != cView) { if (!save()) return; } ParameterList params; params.append("order_id", _invcheadid); params.append("order_type", "I"); if (_mode == cView || _posted) params.append("mode", "view"); else if (_mode == cNew || _mode == cEdit) params.append("mode", "edit"); taxBreakdown newdlg(this, "", TRUE); if (newdlg.set(params) == NoError) { newdlg.exec(); sCalculateTax(); } } void invoice::sCalculateTax() { XSqlQuery taxq; taxq.prepare( "SELECT SUM(tax) AS tax " "FROM (" "SELECT ROUND(SUM(taxdetail_tax),2) AS tax " "FROM tax " " JOIN calculateTaxDetailSummary('I', :invchead_id, 'T') ON (taxdetail_tax_id=tax_id)" "GROUP BY tax_id) AS data;" ); taxq.bindValue(":invchead_id", _invcheadid); taxq.exec(); if (taxq.first()) _tax->setLocalValue(taxq.value("tax").toDouble()); else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } // changing _tax fires sCalculateTotal() } void invoice::setFreeFormShipto(bool pFreeForm) { _ffShipto = pFreeForm; if (_mode != cView) { _copyToShipto->setEnabled(_ffShipto); _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _shipToPhone->setEnabled(_ffShipto); } else _copyToShipto->setEnabled(false); } void invoice::sShipToModified() { _shipTo->blockSignals(true); _shipTo->setId(-1); _shipTo->setCustid(_cust->id()); _shipTo->blockSignals(false); } void invoice::keyPressEvent( QKeyEvent * e ) { #ifdef Q_WS_MAC if(e->key() == Qt::Key_N && (e->modifiers() & Qt::ControlModifier)) { _new->animateClick(); e->accept(); } else if(e->key() == Qt::Key_E && (e->modifiers() & Qt::ControlModifier)) { _edit->animateClick(); e->accept(); } if(e->isAccepted()) return; #endif e->ignore(); } void invoice::newInvoice(int pCustid, QWidget *parent ) { // Check for an Item window in new mode already. QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), "invoice new")==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "new"); if(-1 != pCustid) params.append("cust_id", pCustid); invoice *newdlg = new invoice(parent); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void invoice::editInvoice( int pId, QWidget *parent ) { // Check for an Item window in edit mode for the specified invoice already. QString n = QString("invoice edit %1").arg(pId); QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), n)==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("invchead_id", pId); params.append("mode", "edit"); invoice *newdlg = new invoice(parent); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void invoice::viewInvoice( int pId, QWidget *parent ) { // Check for an Item window in edit mode for the specified invoice already. QString n = QString("invoice view %1").arg(pId); QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), n)==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("invchead_id", pId); params.append("mode", "view"); invoice *newdlg = new invoice(parent); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void invoice::sCreditAllocate() { ParameterList params; params.append("doctype", "I"); params.append("invchead_id", _invcheadid); params.append("cust_id", _cust->id()); params.append("total", _total->localValue()); params.append("balance", (_total->localValue() - _allocatedCM->localValue())); params.append("curr_id", _total->id()); params.append("effective", _total->effective()); allocateARCreditMemo newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) { populateCMInfo(); } } void invoice::populateCMInfo() { XSqlQuery cm; // Allocated C/M's cm.prepare("SELECT COALESCE(SUM(currToCurr(aropenalloc_curr_id, :curr_id," " aropenalloc_amount, :effective)),0) AS amount" " FROM ( " " SELECT aropenalloc_curr_id, aropenalloc_amount" " FROM cohead JOIN aropenalloc ON (aropenalloc_doctype='S' AND aropenalloc_doc_id=cohead_id)" " WHERE (cohead_number=:cohead_number) " " UNION ALL" " SELECT aropenalloc_curr_id, aropenalloc_amount" " FROM aropenalloc" " WHERE (aropenalloc_doctype='I' AND aropenalloc_doc_id=:invchead_id)" " ) AS data;"); cm.bindValue(":invchead_id", _invcheadid); cm.bindValue(":cohead_number", _orderNumber->text()); cm.bindValue(":curr_id", _allocatedCM->id()); cm.bindValue(":effective", _allocatedCM->effective()); cm.exec(); if(cm.first()) _allocatedCM->setLocalValue(cm.value("amount").toDouble()); else if (cm.lastError().type() != QSqlError::NoError) { systemError(this, cm.lastError().databaseText(), __FILE__, __LINE__); return; } else _allocatedCM->setLocalValue(0.00); // Unallocated C/M's cm.prepare("SELECT SUM(amount) AS amount" " FROM ( SELECT aropen_id, " " currToCurr(aropen_curr_id, :curr_id," " noNeg(aropen_amount - aropen_paid - SUM(COALESCE(aropenalloc_amount,0)))," " :effective) AS amount" " FROM aropen LEFT OUTER JOIN aropenalloc ON (aropenalloc_aropen_id=aropen_id)" " WHERE ( (aropen_cust_id=:cust_id)" " AND (aropen_doctype IN ('C', 'R'))" " AND (aropen_open))" " GROUP BY aropen_id, aropen_amount, aropen_paid, aropen_curr_id) AS data; "); cm.bindValue(":cust_id", _cust->id()); cm.bindValue(":curr_id", _outstandingCM->id()); cm.bindValue(":effective", _outstandingCM->effective()); cm.exec(); if(cm.first()) _outstandingCM->setLocalValue(cm.value("amount").toDouble()); else if (cm.lastError().type() != QSqlError::NoError) { systemError(this, cm.lastError().databaseText(), __FILE__, __LINE__); return; } else _outstandingCM->setLocalValue(0.00); } void invoice::populateCCInfo() { XSqlQuery cc; int ccValidDays = _metrics->value("CCValidDays").toInt(); if(ccValidDays < 1) ccValidDays = 7; if (_mode == cNew) { cc.prepare("SELECT COALESCE(SUM(currToCurr(payco_curr_id, :curr_id," " payco_amount, :effective)),0) AS amount" " FROM ccpay, payco, cohead" " WHERE ( (ccpay_status = 'A')" " AND (date_part('day', CURRENT_TIMESTAMP - ccpay_transaction_datetime) < :ccValidDays)" " AND (payco_ccpay_id=ccpay_id)" " AND (payco_cohead_id=cohead_id)" " AND (cohead_number=:cohead_number) );"); cc.bindValue(":cohead_number", _orderNumber->text()); } else { cc.prepare("SELECT COALESCE(SUM(currToCurr(payco_curr_id, :curr_id," " payco_amount, :effective)),0) AS amount" " FROM ccpay, payco, cohead, invchead" " WHERE ( (ccpay_status = 'A')" " AND (date_part('day', CURRENT_TIMESTAMP - ccpay_transaction_datetime) < :ccValidDays)" " AND (payco_ccpay_id=ccpay_id)" " AND (payco_cohead_id=cohead_id)" " AND (invchead_ordernumber=cohead_number)" " AND (invchead_id=:invchead_id) ); "); cc.bindValue(":invchead_id", _invcheadid); } cc.bindValue(":ccValidDays", ccValidDays); cc.bindValue(":curr_id", _authCC->id()); cc.bindValue(":effective", _authCC->effective()); cc.exec(); if(cc.first()) _authCC->setLocalValue(cc.value("amount").toDouble()); else if (cc.lastError().type() != QSqlError::NoError) { systemError(this, cc.lastError().databaseText(), __FILE__, __LINE__); return; } else _authCC->setLocalValue(0.00); } void invoice::sHandleShipchrg(int pShipchrgid) { if ( (_mode == cView) || (_mode == cViewQuote) ) _freight->setEnabled(FALSE); else { XSqlQuery query; query.prepare( "SELECT shipchrg_custfreight " "FROM shipchrg " "WHERE (shipchrg_id=:shipchrg_id);" ); query.bindValue(":shipchrg_id", pShipchrgid); query.exec(); if (query.first()) { if (query.value("shipchrg_custfreight").toBool()) _freight->setEnabled(TRUE); else { _freight->setEnabled(FALSE); _freight->clear(); } } } } void invoice::sTaxZoneChanged() { if (_loading == false && _invcheadid != -1 && _taxzoneidCache != _taxzone->id()) { if (!save()) return; _taxzoneidCache = _taxzone->id(); sCalculateTax(); } } void invoice::sFreightChanged() { if (_loading == false && _invcheadid != -1 && _freightCache != _freight->localValue()) { if (!save()) return; _freightCache = _freight->localValue(); sCalculateTax(); } } bool invoice::sCheckInvoiceNumber() { XSqlQuery invoiceCheckInvoiceNumber; if (cNew == _mode) { if(-1 != _NumberGen && _invoiceNumber->text().toInt() != _NumberGen) sReleaseNumber(); if (_invoiceNumber->text().isEmpty()) { QMessageBox::warning(this, tr("Enter Invoice Number"), tr("

    You must enter an Invoice Number before " "you may continue.")); _invoiceNumber->setFocus(); } else { XSqlQuery checkq; checkq.prepare("SELECT invchead_invcnumber" " FROM invchead" " WHERE ((invchead_invcnumber=:number)" " AND (invchead_id != :id));"); checkq.bindValue(":number", _invoiceNumber->text()); checkq.bindValue(":id", _invcheadid); checkq.exec(); if (checkq.first()) { QMessageBox::warning(this, tr("Duplicate Invoice Number"), tr("

    %1 is already used by another Invoice. " "Please enter a different Invoice Number.") .arg(_invoiceNumber->text())); _invoiceNumber->setFocus(); } else if (checkq.lastError().type() != QSqlError::NoError) systemError(this, invoiceCheckInvoiceNumber.lastError().text(), __FILE__, __LINE__); else { _invoiceNumber->setEnabled(false); return true; } } } else qWarning("invoice::sHandleInvoiceNumber() called but mode isn't cNew"); return false; } qt-client-4.1.0/guiclient/invoice.h000066400000000000000000000044471217451700100172130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INVOICE_H #define INVOICE_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_invoice.h" class invoice : public XWidget, public Ui::invoice { Q_OBJECT public: invoice(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~invoice(); static void newInvoice( int pCustid, QWidget *parent = 0 ); static void editInvoice( int pId, QWidget *parent = 0 ); static void viewInvoice( int pId, QWidget *parent = 0 ); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sClose(); virtual void sPopulateCustomerInfo( int pCustid ); virtual void populateShipto( int pShiptoid ); virtual void sCopyToShipto(); virtual void sSave(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void populate(); virtual void sFillItemList(); virtual void sCalculateTotal(); virtual void sCalculateTax(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void setFreeFormShipto( bool pFreeForm ); virtual void sShipToModified(); virtual void sCreditAllocate(); virtual void populateCMInfo(); virtual void populateCCInfo(); virtual bool sCheckInvoiceNumber(); virtual void sHandleShipchrg( int pShipchrgid ); virtual void sTaxZoneChanged(); virtual void sFreightChanged(); virtual void sReleaseNumber(); protected: virtual void keyPressEvent( QKeyEvent * e ); protected slots: virtual void languageChange(); virtual void sTaxDetail(); private: int _mode; double _cachedSubtotal; int _custtaxzoneid; bool _ffShipto; int _invcheadid; int _taxzoneidCache; bool _loading; double _freightCache; bool save(); bool _posted; int _NumberGen; }; #endif // INVOICE_H qt-client-4.1.0/guiclient/invoice.ui000066400000000000000000001523011217451700100173720ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. invoice 0 0 988 591 Invoice 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Save &Close true 0 Header Information Invoice #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _invoiceNumber Invoice Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _invoiceDate Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderNumber Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderDate 0 0 Ship Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipDate Sales Rep.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _salesrep true XComboBox::SalesRepsActive Commission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _commission 0 0 40 20 Qt::AlignRight % Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxzone 0 0 true None XComboBox::TaxZones Qt::Horizontal 0 20 Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _terms Qt::Horizontal 0 20 0 0 true XComboBox::ARTerms Qt::Horizontal 0 20 Qt::Horizontal 0 20 Bill To 2 0 0 0 32 16777215 32 QFrame::NoFrame QFrame::Raised 0 Qt::Horizontal 0 32 false false false Copy to Ship-to -> Name: _billToName false Phone: _billToPhone false Ship To 2 0 0 0 32 16777215 32 QFrame::NoFrame QFrame::Raised 0 false false Qt::Horizontal Name: _shipToName false Phone: _shipToPhone false 4 0 0 Cust. PO #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _poNumber 0 0 &F.O.B.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _fob 0 0 Ship &Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipVia 0 0 200 32767 XComboBox::ShipVias Qt::Vertical 20 0 Shipping Chgs. 0 0 200 16777215 true XComboBox::ShippingCharges Sale Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Shipping Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::SaleTypes true XComboBox::ShippingZones 3 Qt::StrongFocus Project #: Qt::Vertical 20 0 Qt::Horizontal 0 20 Qt::Vertical 20 0 Line Items false &New true false &Edit true false &View true false &Delete true Qt::Vertical QSizePolicy::Expanding 20 93 0 0 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _custCurrency true XComboBox::Currencies 0 0 Subtotal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 200 32767 Misc. Charge Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _miscChargeDescription 0 0 Misc. Charge Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billToAddr 0 0 200 32767 false false false 0 0 Misc. Charge Sales Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _freight 0 0 200 32767 false false false Outstanding Credit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter tax 0 0 200 32767 Authorized CC Payments: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 _total Outstanding Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 32767 false false Payment Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _payment Allocated Credit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Notes true Advanced Qt::Horizontal 661 20 Qt::Vertical 460 391 RecurrenceWidget::Daily AddressCluster QWidget

    addresscluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    CustCluster QWidget
    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    GLCluster QWidget
    glcluster.h
    ProjectCluster QWidget
    projectcluster.h
    RecurrenceWidget QWidget
    recurrencewidget.h
    ShiptoCluster QWidget
    shiptocluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _tabWidget _invoiceNumber _invoiceDate _terms _orderNumber _orderDate _shipDate _salesrep _commission _taxzone _cust _copyToShipto _billToName _billToPhone _billToAddr _shipTo _shipToName _shipToPhone _shipToAddr _poNumber _fob _shipVia _shipChrgs _saleType _shippingZone _project _new _edit _view _delete _custCurrency _miscChargeDescription _miscChargeAccount _miscAmount _freight _payment _save _close _invcitem valid(bool) _view setEnabled(bool) 20 20 20 20 _custCurrency newID(int) _subtotal setId(int) 20 20 20 20 _custCurrency newID(int) _tax setId(int) 20 20 20 20 _custCurrency newID(int) _miscAmount setId(int) 20 20 20 20 _custCurrency newID(int) _freight setId(int) 20 20 20 20 _custCurrency newID(int) _total setId(int) 20 20 20 20 _custCurrency newID(int) _balance setId(int) 20 20 20 20 _custCurrency newID(int) _payment setId(int) 20 20 20 20 _custCurrency newID(int) _allocatedCM setId(int) 20 20 20 20 _custCurrency newID(int) _outstandingCM setId(int) 20 20 20 20 _custCurrency newID(int) _authCC setId(int) 20 20 20 20 _invoiceDate newDate(QDate) _subtotal setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _tax setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _miscAmount setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _freight setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _total setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _balance setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _payment setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _allocatedCM setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _outstandingCM setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _authCC setEffective(QDate) 20 20 20 20 qt-client-4.1.0/guiclient/invoiceItem.cpp000066400000000000000000000652161217451700100203660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "invoiceItem.h" #include #include #include #include #include #include "xdoublevalidator.h" #include "priceList.h" #include "taxDetail.h" #include "errorReporter.h" #include "guiErrorCheck.h" /* TODO: connect(_warehouse id, SIGNAL(newId(int)), ...) to set _trackqoh? bug 16465 - seems too disruptive now as we're between 3.8.0RC and RC2 */ invoiceItem::invoiceItem(QWidget* parent, const char * name, Qt::WindowFlags fl) : XDialog(parent, name, fl) { setupUi(this); connect(_billed, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice())); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sHandleUpdateInv())); connect(_extended,SIGNAL(valueChanged()), this, SLOT(sLookupTax())); connect(_listPrices, SIGNAL(clicked()), this, SLOT(sListPrices())); connect(_price, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup())); connect(_price, SIGNAL(valueChanged()), this, SLOT(sCalculateExtendedPrice())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxLit, SIGNAL(leftClickedURL(QString)), this, SLOT(sTaxDetail())); connect(_taxtype, SIGNAL(newID(int)), this, SLOT(sLookupTax())); connect(_qtyUOM, SIGNAL(newID(int)), this, SLOT(sQtyUOMChanged())); connect(_pricingUOM, SIGNAL(newID(int)), this, SLOT(sPriceUOMChanged())); connect(_miscSelected, SIGNAL(toggled(bool)), this, SLOT(sMiscSelected(bool))); _ordered->setValidator(omfgThis->qtyVal()); _billed->setValidator(omfgThis->qtyVal()); _altRevAccnt->setType(GLCluster::cRevenue); _taxtype->setEnabled(_privileges->check("OverrideTax")); _mode = cNew; _invcheadid = -1; _custid = -1; _invcitemid = -1; _priceRatioCache = 1.0; _taxzoneid = -1; _qtyinvuomratio = 1.0; _priceinvuomratio = 1.0; _invuomid = -1; _trackqoh = true; //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } _saved = false; adjustSize(); } invoiceItem::~invoiceItem() { // no need to delete child widgets, Qt does it all for us } void invoiceItem::languageChange() { retranslateUi(this); } enum SetResponse invoiceItem::set(const ParameterList &pParams) { XSqlQuery invoiceet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("invchead_id", &valid); if (valid) { _invcheadid = param.toInt(); invoiceet.prepare("SELECT * " "FROM invchead " "WHERE (invchead_id = :invchead_id);"); invoiceet.bindValue(":invchead_id", _invcheadid); invoiceet.exec(); if (invoiceet.first()) { _invoiceNumber->setText(invoiceet.value("invchead_invcnumber").toString()); _custid = invoiceet.value("invchead_cust_id").toInt(); _taxzoneid = invoiceet.value("invchead_taxzone_id").toInt(); _tax->setId(invoiceet.value("invchead_curr_id").toInt()); _price->setId(invoiceet.value("invchead_curr_id").toInt()); _price->setEffective(invoiceet.value("invchead_invcdate").toDate()); sPriceGroup(); } else if (invoiceet.lastError().type() != QSqlError::NoError) { systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("invcitem_id", &valid); if (valid) { _invcitemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; invoiceet.exec("SELECT NEXTVAL('invcitem_invcitem_id_seq') AS invcitem_id;"); if (invoiceet.first()) _invcitemid = invoiceet.value("invcitem_id").toInt(); else if (invoiceet.lastError().type() != QSqlError::NoError) { systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } invoiceet.prepare( "SELECT (COALESCE(MAX(invcitem_linenumber), 0) + 1) AS linenumber " "FROM invcitem " "WHERE (invcitem_invchead_id=:invchead_id);" ); invoiceet.bindValue(":invchead_id", _invcheadid); invoiceet.exec(); if (invoiceet.first()) _lineNumber->setText(invoiceet.value("linenumber").toString()); else if (invoiceet.lastError().type() != QSqlError::NoError) { systemError(this, invoiceet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } connect(_billed, SIGNAL(editingFinished()), this, SLOT(sDeterminePrice())); connect(_billed, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice())); connect(_price, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice())); _item->setType(ItemLineEdit::cSold); _salescat->setType(XComboBox::SalesCategoriesActive); } else if (param.toString() == "edit") { _mode = cEdit; connect(_billed, SIGNAL(editingFinished()), this, SLOT(sDeterminePrice())); connect(_billed, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice())); connect(_price, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice())); } else if (param.toString() == "view") { _mode = cView; _itemTypeGroup->setEnabled(FALSE); _custPn->setEnabled(FALSE); _ordered->setEnabled(FALSE); _billed->setEnabled(FALSE); _price->setEnabled(FALSE); _notes->setReadOnly(TRUE); _taxtype->setEnabled(false); _altRevAccnt->setEnabled(false); _qtyUOM->setEnabled(false); _pricingUOM->setEnabled(false); _save->hide(); _close->setText(tr("&Cancel")); } } return NoError; } int invoiceItem::id() const { return _invcitemid; } int invoiceItem::mode() const { return _mode; } void invoiceItem::sSave() { QList errors; errors << GuiErrorCheck(_itemSelected->isChecked() && !_item->isValid(), _item, tr("

    You must select an Item for this Invoice Item before you may save it.")) << GuiErrorCheck(!_itemSelected->isChecked() && !_itemNumber->text().length(), _itemNumber, tr("

    You must enter an Item Number for this Miscellaneous Invoice Item before you may save it.")) << GuiErrorCheck(!_itemSelected->isChecked() && !_itemDescrip->toPlainText().length(), _itemDescrip, tr("

    You must enter a Item Description for this Miscellaneous Invoice Item before you may save it.")) << GuiErrorCheck(!_itemSelected->isChecked() && !_salescat->isValid(), _salescat, tr("

    You must select a Sales Category for this Miscellaneous Invoice Item before you may save it.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Invoice Item"), errors)) return; XSqlQuery invoiceSave; if (_mode == cNew) { invoiceSave.prepare( "INSERT INTO invcitem " "( invcitem_id, invcitem_invchead_id, invcitem_linenumber," " invcitem_item_id, invcitem_warehous_id," " invcitem_number, invcitem_descrip, invcitem_salescat_id," " invcitem_custpn," " invcitem_ordered, invcitem_billed, invcitem_updateinv," " invcitem_qty_uom_id, invcitem_qty_invuomratio," " invcitem_custprice, invcitem_price," " invcitem_price_uom_id, invcitem_price_invuomratio," " invcitem_notes, " " invcitem_taxtype_id, invcitem_rev_accnt_id) " "VALUES " "( :invcitem_id, :invchead_id, :invcitem_linenumber," " :item_id, :warehous_id," " :invcitem_number, :invcitem_descrip, :invcitem_salescat_id," " :invcitem_custpn," " :invcitem_ordered, :invcitem_billed, :invcitem_updateinv," " :qty_uom_id, :qty_invuomratio," " :invcitem_custprice, :invcitem_price," " :price_uom_id, :price_invuomratio," " :invcitem_notes, " " :invcitem_taxtype_id, :invcitem_rev_accnt_id);"); invoiceSave.bindValue(":invchead_id", _invcheadid); invoiceSave.bindValue(":invcitem_linenumber", _lineNumber->text()); } else if (_mode == cEdit) invoiceSave.prepare( "UPDATE invcitem " "SET invcitem_item_id=:item_id, invcitem_warehous_id=:warehous_id," " invcitem_number=:invcitem_number, invcitem_descrip=:invcitem_descrip," " invcitem_salescat_id=:invcitem_salescat_id," " invcitem_custpn=:invcitem_custpn, invcitem_updateinv=:invcitem_updateinv," " invcitem_ordered=:invcitem_ordered, invcitem_billed=:invcitem_billed," " invcitem_qty_uom_id=:qty_uom_id, invcitem_qty_invuomratio=:qty_invuomratio," " invcitem_custprice=:invcitem_custprice, invcitem_price=:invcitem_price," " invcitem_price_uom_id=:price_uom_id, invcitem_price_invuomratio=:price_invuomratio," " invcitem_notes=:invcitem_notes," " invcitem_taxtype_id=:invcitem_taxtype_id," " invcitem_rev_accnt_id=:invcitem_rev_accnt_id " "WHERE (invcitem_id=:invcitem_id);" ); if (_itemSelected->isChecked()) { invoiceSave.bindValue(":item_id", _item->id()); invoiceSave.bindValue(":warehous_id", _warehouse->id()); } else { invoiceSave.bindValue(":item_id", -1); invoiceSave.bindValue(":warehous_id", -1); } invoiceSave.bindValue(":invcitem_id", _invcitemid); invoiceSave.bindValue(":invcitem_number", _itemNumber->text()); invoiceSave.bindValue(":invcitem_descrip", _itemDescrip->toPlainText()); invoiceSave.bindValue(":invcitem_salescat_id", _salescat->id()); invoiceSave.bindValue(":invcitem_custpn", _custPn->text()); invoiceSave.bindValue(":invcitem_ordered", _ordered->toDouble()); invoiceSave.bindValue(":invcitem_billed", _billed->toDouble()); invoiceSave.bindValue(":invcitem_updateinv", QVariant(_updateInv->isChecked())); if(!_miscSelected->isChecked()) invoiceSave.bindValue(":qty_uom_id", _qtyUOM->id()); invoiceSave.bindValue(":qty_invuomratio", _qtyinvuomratio); invoiceSave.bindValue(":invcitem_custprice", _custPrice->localValue()); invoiceSave.bindValue(":invcitem_price", _price->localValue()); if(!_miscSelected->isChecked()) invoiceSave.bindValue(":price_uom_id", _pricingUOM->id()); invoiceSave.bindValue(":price_invuomratio", _priceinvuomratio); invoiceSave.bindValue(":invcitem_notes", _notes->toPlainText()); if(_taxtype->isValid()) invoiceSave.bindValue(":invcitem_taxtype_id", _taxtype->id()); if (_altRevAccnt->isValid()) invoiceSave.bindValue(":invcitem_rev_accnt_id", _altRevAccnt->id()); invoiceSave.exec(); if (invoiceSave.lastError().type() != QSqlError::NoError) { systemError(this, invoiceSave.lastError().databaseText(), __FILE__, __LINE__); return; } _saved = true; emit saved(_invcitemid); done(_invcitemid); } void invoiceItem::populate() { XSqlQuery invcitem; invcitem.prepare( "SELECT invcitem.*, invchead_invcnumber," " CASE WHEN (item_id IS NULL) THEN :na" " ELSE item_listprice" " END AS f_listprice," " taxzone_id," " invchead_curr_id AS taxcurr_id," " itemsite_costmethod" " FROM invcitem JOIN " " invchead LEFT OUTER JOIN taxzone ON " " (invchead_taxzone_id = taxzone_id) " " ON (invcitem_invchead_id = invchead_id) LEFT OUTER JOIN " " item ON (invcitem_item_id = item_id) " " LEFT OUTER JOIN invcitemtax ON (invcitem_id = taxhist_parent_id) " " LEFT OUTER JOIN itemsite ON (itemsite_item_id=item_id " " AND itemsite_warehous_id=invcitem_warehous_id)" "WHERE (invcitem_id = :invcitem_id);" ); invcitem.bindValue(":invcitem_id", _invcitemid); invcitem.exec(); if (invcitem.first()) { _invcheadid = invcitem.value("invcitem_invchead_id").toInt(); _invoiceNumber->setText(invcitem.value("invchead_invcnumber").toString()); _lineNumber->setText(invcitem.value("invcitem_linenumber").toString()); // TODO: should this check itemsite_controlmethod == N? _trackqoh = (invcitem.value("invcitem_coitem_id").toInt() > 0 && invcitem.value("itemsite_costmethod").toString() != "J"); if (invcitem.value("invcitem_item_id").toInt() != -1) { _itemSelected->setChecked(TRUE); _item->setId(invcitem.value("invcitem_item_id").toInt()); _warehouse->setId(invcitem.value("invcitem_warehous_id").toInt()); } else { _miscSelected->setChecked(TRUE); _itemNumber->setText(invcitem.value("invcitem_number")); _itemDescrip->setText(invcitem.value("invcitem_descrip").toString()); _salescat->setId(invcitem.value("invcitem_salescat_id").toInt()); } _qtyUOM->setId(invcitem.value("invcitem_qty_uom_id").toInt()); _qtyinvuomratio = invcitem.value("invcitem_qty_invuomratio").toDouble(); _pricingUOM->setId(invcitem.value("invcitem_price_uom_id").toInt()); _priceinvuomratio = invcitem.value("invcitem_price_invuomratio").toDouble(); // do tax stuff before invcitem_price and _tax_* to avoid signal cascade problems if (! invcitem.value("taxzone_id").isNull()) _taxzoneid = invcitem.value("taxzone_id").toInt(); _tax->setId(invcitem.value("taxcurr_id").toInt()); _taxtype->setId(invcitem.value("invcitem_taxtype_id").toInt()); _altRevAccnt->setId(invcitem.value("invcitem_rev_accnt_id").toInt()); _ordered->setDouble(invcitem.value("invcitem_ordered").toDouble()); _billed->setDouble(invcitem.value("invcitem_billed").toDouble()); // TODO: why not setChecked then call sHandleUpdateInv if ( (invcitem.value("invcitem_coitem_id").toInt() > 0) || (invcitem.value("itemsite_costmethod").toString() == "J") || (invcitem.value("invcitem_item_id").toInt() == -1) ) { _updateInv->setChecked(false); _updateInv->setEnabled(false); } else { _updateInv->setChecked(invcitem.value("invcitem_updateinv").toBool()); _updateInv->setEnabled(true); } _price->setLocalValue(invcitem.value("invcitem_price").toDouble()); _custPrice->setLocalValue(invcitem.value("invcitem_custprice").toDouble()); _listPrice->setBaseValue(invcitem.value("f_listprice").toDouble() * (_priceinvuomratio / _priceRatioCache)); _custPn->setText(invcitem.value("invcitem_custpn").toString()); _notes->setText(invcitem.value("invcitem_notes").toString()); } else if (invcitem.lastError().type() != QSqlError::NoError) { systemError(this, invcitem.lastError().databaseText(), __FILE__, __LINE__); return; } invcitem.prepare( "SELECT SUM(COALESCE(taxhist_tax, 0.00)) AS lineTaxTotal " "FROM invcitem LEFT OUTER JOIN invcitemtax " " ON (invcitem_id = taxhist_parent_id) " "WHERE invcitem_id = :invcitem_id;" ); invcitem.bindValue(":invcitem_id", _invcitemid); invcitem.exec(); if (invcitem.first()) _tax->setLocalValue(invcitem.value("lineTaxTotal").toDouble()); else if (invcitem.lastError().type() != QSqlError::NoError) { systemError(this, invcitem.lastError().databaseText(), __FILE__, __LINE__); return; } sCalculateExtendedPrice(); _saved = true; emit populated(); } void invoiceItem::sCalculateExtendedPrice() { _extended->setLocalValue((_billed->toDouble() * _qtyinvuomratio) * (_price->localValue() / _priceinvuomratio)); } void invoiceItem::sPopulateItemInfo(int pItemid) { XSqlQuery invoicePopulateItemInfo; if ( (_itemSelected->isChecked()) && (pItemid != -1) ) { XSqlQuery uom; uom.prepare("SELECT uom_id, uom_name" " FROM item" " JOIN uom ON (item_inv_uom_id=uom_id)" " WHERE(item_id=:item_id)" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_to_uom_id=uom_id)" " WHERE((itemuomconv_from_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_from_uom_id=uom_id)" " WHERE((itemuomconv_to_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " ORDER BY uom_name;"); uom.bindValue(":item_id", _item->id()); uom.exec(); _qtyUOM->populate(uom); _pricingUOM->populate(uom); invoicePopulateItemInfo.prepare( "SELECT item_inv_uom_id, item_price_uom_id," " iteminvpricerat(item_id) AS invpricerat," " item_listprice, item_fractional, " " stdcost(item_id) AS f_unitcost," " getItemTaxType(item_id, :taxzone) AS taxtype_id," " itemsite_costmethod" " FROM item" " JOIN itemsite ON (item_id=itemsite_item_id)" " WHERE ((item_id=:item_id)" " AND (itemsite_warehous_id=:whsid));" ); invoicePopulateItemInfo.bindValue(":item_id", pItemid); invoicePopulateItemInfo.bindValue(":taxzone", _taxzoneid); invoicePopulateItemInfo.bindValue(":whsid", _warehouse->id()); invoicePopulateItemInfo.exec(); if (invoicePopulateItemInfo.first()) { _priceRatioCache = invoicePopulateItemInfo.value("invpricerat").toDouble(); _listPrice->setBaseValue(invoicePopulateItemInfo.value("item_listprice").toDouble()); _invuomid = invoicePopulateItemInfo.value("item_inv_uom_id").toInt(); _qtyUOM->setId(invoicePopulateItemInfo.value("item_inv_uom_id").toInt()); _pricingUOM->setId(invoicePopulateItemInfo.value("item_price_uom_id").toInt()); _qtyinvuomratio = 1.0; _priceinvuomratio = invoicePopulateItemInfo.value("invpricerat").toDouble(); _unitCost->setBaseValue(invoicePopulateItemInfo.value("f_unitcost").toDouble()); _taxtype->setId(invoicePopulateItemInfo.value("taxtype_id").toInt()); if (invoicePopulateItemInfo.value("item_fractional").toBool()) { _ordered->setValidator(omfgThis->qtyVal()); _billed->setValidator(omfgThis->qtyVal()); } else { _ordered->setValidator(new XDoubleValidator(0, 999999, 0, this)); _billed->setValidator(new XDoubleValidator(0, 999999, 0, this)); } sDeterminePrice(); // TODO: should this check itemsite_controlmethod == N? _trackqoh = (invoicePopulateItemInfo.value("itemsite_costmethod").toString() != "J"); } else if (invoicePopulateItemInfo.lastError().type() != QSqlError::NoError) { systemError(this, invoicePopulateItemInfo.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _priceRatioCache = 1.0; _qtyinvuomratio = 1.0; _priceinvuomratio = 1.0; _qtyUOM->clear(); _pricingUOM->clear(); _listPrice->clear(); _unitCost->clear(); } } void invoiceItem::sDeterminePrice() { if ( (_itemSelected->isChecked()) && (_item->isValid()) && (_billed->toDouble()) && (_qtyUOM->id() > 0) && (_pricingUOM->id() > 0) ) { XSqlQuery itemprice; itemprice.prepare( "SELECT itemPrice(item_id, :cust_id, -1, " " :qty, :qtyUOM, :priceUOM, :curr_id, :effective) AS price " "FROM item " "WHERE (item_id=:item_id);" ); itemprice.bindValue(":cust_id", _custid); itemprice.bindValue(":qty", _billed->toDouble()); itemprice.bindValue(":qtyUOM", _qtyUOM->id()); itemprice.bindValue(":priceUOM", _pricingUOM->id()); itemprice.bindValue(":item_id", _item->id()); itemprice.bindValue(":curr_id", _price->id()); itemprice.bindValue(":effective", _price->effective()); itemprice.exec(); if (itemprice.first()) { if (itemprice.value("price").toDouble() == -9999.0) { QMessageBox::critical( this, tr("Customer Cannot Buy at Quantity"), tr("

    This item is marked as exclusive and " "no qualifying price schedule was found. " "You may click on the price list button " "(...) next to the Unit Price to determine " "if there is a minimum quantity the selected " "Customer may purchase." ) ); _custPrice->clear(); _price->clear(); _billed->clear(); _billed->setFocus(); return; } double price = itemprice.value("price").toDouble(); //price = price * (_priceinvuomratio / _priceRatioCache); _custPrice->setLocalValue(price); _price->setLocalValue(price); } else if (itemprice.lastError().type() != QSqlError::NoError) { systemError(this, itemprice.lastError().databaseText(), __FILE__, __LINE__); return; } } } void invoiceItem::sPriceGroup() { if (! omfgThis->singleCurrency()) _priceGroup->setTitle(tr("In %1:").arg(_price->currAbbr())); } void invoiceItem::sTaxDetail() { taxDetail newdlg(this, "", true); ParameterList params; params.append("taxzone_id", _taxzoneid); params.append("taxtype_id", _taxtype->id()); params.append("date", _price->effective()); params.append("subtotal", CurrDisplay::convert(_extended->id(), _tax->id(), _extended->localValue(), _extended->effective())); params.append("curr_id", _tax->id()); if(cView == _mode) params.append("readOnly"); if(_saved == true) { params.append("order_id", _invcitemid); params.append("order_type", "II"); } newdlg.set(params); if (newdlg.set(params) == NoError && newdlg.exec()) { if (_taxtype->id() != newdlg.taxtype()) _taxtype->setId(newdlg.taxtype()); } } void invoiceItem::sQtyUOMChanged() { if(_qtyUOM->id() == _invuomid) _qtyinvuomratio = 1.0; else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio" " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _qtyUOM->id()); invuom.exec(); if(invuom.first()) _qtyinvuomratio = invuom.value("ratio").toDouble(); else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } if(_qtyUOM->id() != _invuomid) { _pricingUOM->setId(_qtyUOM->id()); _pricingUOM->setEnabled(false); } else _pricingUOM->setEnabled(true); sDeterminePrice(); sCalculateExtendedPrice(); } void invoiceItem::sPriceUOMChanged() { if(_pricingUOM->id() == -1 || _qtyUOM->id() == -1) return; if(_pricingUOM->id() == _invuomid) _priceinvuomratio = 1.0; else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio" " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _pricingUOM->id()); invuom.exec(); if(invuom.first()) _priceinvuomratio = invuom.value("ratio").toDouble(); else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } XSqlQuery item; item.prepare("SELECT item_listprice" " FROM item" " WHERE(item_id=:item_id);"); item.bindValue(":item_id", _item->id()); item.exec(); item.first(); _listPrice->setBaseValue(item.value("item_listprice").toDouble() * (_priceinvuomratio / _priceRatioCache)); sDeterminePrice(); sCalculateExtendedPrice(); } void invoiceItem::sMiscSelected(bool isMisc) { if(isMisc) _item->setId(-1); } void invoiceItem::sHandleUpdateInv() { if( (_item->isValid()) && (_warehouse->isValid()) && (_trackqoh) ) { XSqlQuery invq; invq.prepare("SELECT itemsite_id FROM itemsite " "WHERE (itemsite_item_id=:item_id) " " AND (itemsite_warehous_id=:warehous_id) " " AND (itemsite_controlmethod != 'N');"); invq.bindValue(":item_id", _item->id()); invq.bindValue(":warehous_id", _warehouse->id()); invq.exec(); if (invq.first()) { _updateInv->setEnabled(true); } else if (invq.lastError().type() != QSqlError::NoError) { systemError(this, invq.lastError().databaseText(), __FILE__, __LINE__); return; } else { _updateInv->setChecked(false); _updateInv->setEnabled(false); } } else { _updateInv->setChecked(false); _updateInv->setEnabled(false); } } void invoiceItem::sListPrices() { ParameterList params; params.append("cust_id", _custid); //params.append("shipto_id", _shiptoid); params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); params.append("qty", _billed->toDouble() * _qtyinvuomratio); params.append("curr_id", _price->id()); params.append("effective", _price->effective()); priceList newdlg(this); newdlg.set(params); if ( (newdlg.exec() == XDialog::Accepted) && (_privileges->check("OverridePrice")) && (!_metrics->boolean("DisableSalesOrderPriceOverride")) ) { _price->setLocalValue(newdlg._selectedPrice * (_priceinvuomratio / _priceRatioCache)); } } void invoiceItem::sLookupTax() { XSqlQuery taxcal; taxcal.prepare("SELECT calculatetax(:taxzone_id, :taxtype_id, :date, :curr_id, :amount) AS taxamount;"); taxcal.bindValue(":taxzone_id", _taxzoneid); taxcal.bindValue(":taxtype_id", _taxtype->id()); taxcal.bindValue(":date", _price->effective()); taxcal.bindValue(":curr_id", _tax->id()); taxcal.bindValue(":amount", CurrDisplay::convert(_extended->id(), _tax->id(), _extended->localValue(), _extended->effective())); taxcal.exec(); if (taxcal.first()) { _tax->setLocalValue(taxcal.value("taxamount").toDouble()); _saved = false; } else if (taxcal.lastError().type() != QSqlError::NoError) { systemError(this, taxcal.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/invoiceItem.h000066400000000000000000000034161217451700100200250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INVOICEITEM_H #define INVOICEITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_invoiceItem.h" class invoiceItem : public XDialog, public Ui::invoiceItem { Q_OBJECT public: invoiceItem(QWidget* = 0, const char * = 0, Qt::WindowFlags = 0); ~invoiceItem(); Q_INVOKABLE virtual int id() const; Q_INVOKABLE virtual int mode() const; virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sCalculateExtendedPrice(); virtual void sPopulateItemInfo( int pItemid ); virtual void sDeterminePrice(); virtual void sListPrices(); virtual void sLookupTax(); virtual void sPriceGroup(); virtual void sTaxDetail(); virtual void sQtyUOMChanged(); virtual void sPriceUOMChanged(); virtual void sMiscSelected(bool); virtual void sHandleUpdateInv(); protected slots: virtual void languageChange(); signals: void populated(); void newId(int); void newMode(int); void saved(int); private: int _mode; int _invcheadid; int _custid; int _invcitemid; double _priceRatioCache; int _taxzoneid; int _invuomid; double _qtyinvuomratio; double _priceinvuomratio; bool _saved; bool _trackqoh; }; #endif // INVOICEITEM_H qt-client-4.1.0/guiclient/invoiceItem.ui000066400000000000000000001114271217451700100202150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. invoiceItem 0 0 724 820 Invoice Item 12 12 12 12 Invoice #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 201 20 5 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 0 true Qt::Vertical QSizePolicy::Expanding 10 10 Item 0 0 Qt::StrongFocus 5 &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse WComboBox::Sold Qt::Vertical QSizePolicy::Expanding 72 70 0 Qt::Vertical QSizePolicy::Expanding 10 10 false Miscellaneous true XComboBox::SalesCategoriesActive 0 0 0 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _itemDescrip Qt::Vertical QSizePolicy::Expanding 16 0 Item: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _itemNumber Sales Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _salescat 0 0 16777215 80 5 Customer P/N: Qt::Horizontal 40 20 Alternate Revenue Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::StrongFocus Qt::Horizontal 40 20 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ordered 0 0 100 0 200 22 Qt::AlignRight Qty. Billed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billed 0 0 100 0 200 22 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billed false Update Inventory false Net Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice false 0 0 Pricing UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Extended Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false ... 0 1 0 Detail Costs Unit Cost (Inv. UOM): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::Cost false List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice false CurrDisplay::SalesPrice false 0 0 Customer Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxtype false true None XComboBox::TaxTypes Qt::Horizontal 40 20 Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice false Qt::Vertical 20 0 Notes 0 1 QFrame::NoFrame QFrame::Plain 0 0 Qt::Horizontal 0 20 CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    GLCluster QWidget
    glcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _itemSelected _item _warehouse _miscSelected _itemDescrip _salescat _custPn _ordered _billed _qtyUOM _price _listPrices _pricingUOM _extended _taxtype _save _close _itemNumber _tab _notes _close clicked() invoiceItem reject() 20 20 20 20 _item aliasChanged(QString) _custPn setText(QString) 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _itemSelected toggled(bool) _itemGroup setEnabled(bool) 20 20 20 20 _miscSelected toggled(bool) _miscGroup setEnabled(bool) 20 20 20 20 _price idChanged(int) _listPrice setId(int) 20 20 20 20 _price effectiveChanged(QDate) _listPrice setEffective(QDate) 20 20 20 20 _price effectiveChanged(QDate) _custPrice setEffective(QDate) 20 20 20 20 _price effectiveChanged(QDate) _extended setEffective(QDate) 20 20 20 20 _price idChanged(int) _custPrice setId(int) 20 20 20 20 _price effectiveChanged(QDate) _unitCost setEffective(QDate) 20 20 20 20 _price idChanged(int) _unitCost setId(int) 20 20 20 20 _price idChanged(int) _extended setId(int) 20 20 20 20 _price effectiveChanged(QDate) _tax setEffective(QDate) 346 434 346 570 _price idChanged(int) _tax setId(int) 475 434 491 624 qt-client-4.1.0/guiclient/invoiceList.cpp000066400000000000000000000066211217451700100203760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "invoiceList.h" #include invoiceList::invoiceList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_invoice, SIGNAL(itemSelected(int)), this, SLOT(sSelect())); connect(_cust, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_dates, SIGNAL(updated()), this, SLOT(sFillList())); QDate today(omfgThis->dbDate()); _dates->setEndDate(today); _dates->setStartDate(today.addMonths(-1)); _invoice->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignRight, true, "invchead_invcnumber" ); _invoice->addColumn(tr("Invoice Date"), _dateColumn, Qt::AlignCenter, true, "invchead_invcdate" ); _invoice->addColumn(tr("S/O #"), _orderColumn, Qt::AlignRight, true, "invchead_ordernumber" ); _invoice->addColumn(tr("Ship Date"), _dateColumn, Qt::AlignCenter, true, "invchead_shipdate" ); _invoice->addColumn(tr("Cust. P/O #"), -1, Qt::AlignLeft, true, "invchead_ponumber" ); } invoiceList::~invoiceList() { // no need to delete child widgets, Qt does it all for us } void invoiceList::languageChange() { retranslateUi(this); } enum SetResponse invoiceList::set(const ParameterList &pParams) { XSqlQuery invoiceet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("invoiceNumber", &valid); if (valid) _invoiceNumber = param.toString(); else _invoiceNumber = ""; param = pParams.value("cust_id", &valid); if (valid) _cust->setId(param.toInt()); else if (! _invoiceNumber.isEmpty()) { invoiceet.prepare( "SELECT invchead_id, invchead_cust_id " "FROM invchead " "WHERE (invchead_invcnumber=:invoiceNumber) ;" ); invoiceet.bindValue(":invoiceNumber", _invoiceNumber); invoiceet.exec(); if (invoiceet.first()) { _invoiceid = invoiceet.value("invchead_id").toInt(); _cust->setId(invoiceet.value("invchead_cust_id").toInt()); } } return NoError; } void invoiceList::sClose() { done(_invoice->id()); } void invoiceList::sSelect() { done(_invoice->id()); } void invoiceList::sFillList() { XSqlQuery invoiceFillList; invoiceFillList.prepare( "SELECT DISTINCT invchead_id, invchead_invcnumber, invchead_invcdate," " invchead_ordernumber, invchead_shipdate," " COALESCE(invchead_ponumber, '') AS invchead_ponumber " "FROM invchead " "WHERE ( (invchead_posted)" " AND (invchead_invcdate BETWEEN :startDate AND :endDate)" " AND (invchead_cust_id=:cust_id) ) " "ORDER BY invchead_invcnumber DESC;" ); invoiceFillList.bindValue(":cust_id", _cust->id()); _dates->bindValue(invoiceFillList); invoiceFillList.exec(); _invoice->populate(invoiceFillList, _invoiceid); } qt-client-4.1.0/guiclient/invoiceList.h000066400000000000000000000021041217451700100200330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef INVOICELIST_H #define INVOICELIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_invoiceList.h" class invoiceList : public XDialog, public Ui::invoiceList { Q_OBJECT public: invoiceList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~invoiceList(); public slots: virtual SetResponse set(const ParameterList & pParams); virtual void sClose(); virtual void sSelect(); virtual void sFillList(); protected slots: virtual void languageChange(); private: int _invoiceid; QString _invoiceNumber; }; #endif // INVOICELIST_H qt-client-4.1.0/guiclient/invoiceList.ui000066400000000000000000000156771217451700100202440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. invoiceList 0 0 680 400 Invoices 12 12 12 12 12 12 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Cancel &Select true Qt::Vertical QSizePolicy::Expanding 20 20 0 1 QFrame::StyledPanel QFrame::Raised 0 0 0 0 0 0 0 Invoices: 0 0 CustCluster QWidget
    custcluster.h
    DateCluster QWidget
    datecluster.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _cust _dates _invoice _select _close parameter.h
    qt-client-4.1.0/guiclient/issueLineToShipping.cpp000066400000000000000000000361671217451700100220630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "issueLineToShipping.h" #include #include #include #include #include #include "xmessagebox.h" #include "distributeInventory.h" #include "storedProcErrorLookup.h" issueLineToShipping::issueLineToShipping(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_issue, SIGNAL(clicked()), this, SLOT(sIssue())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _requireInventory = false; _snooze = false; _transTS = QDateTime::currentDateTime(); _item->setReadOnly(TRUE); _qtyToIssue->setValidator(omfgThis->qtyVal()); _qtyOrdered->setPrecision(omfgThis->qtyVal()); _qtyShipped->setPrecision(omfgThis->qtyVal()); _qtyReturned->setPrecision(omfgThis->qtyVal()); _balance->setPrecision(omfgThis->qtyVal()); _qtyAtShip->setPrecision(omfgThis->qtyVal()); adjustSize(); } issueLineToShipping::~issueLineToShipping() { // no need to delete child widgets, Qt does it all for us } void issueLineToShipping::languageChange() { retranslateUi(this); } enum SetResponse issueLineToShipping::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("transTS", &valid); if (valid) _transTS = param.toDateTime(); param = pParams.value("order_type", &valid); if (valid) { _ordertype = param.toString(); if (_ordertype == "SO") _orderNumberLit->setText(tr("Sales Order #:")); else if (_ordertype == "TO") _orderNumberLit->setText(tr("Transfer Order #:")); } param = pParams.value("order_id", &valid); if (valid) { _itemid = param.toInt(); populate(); } // TODO: deprecate by remoing from salesOrder and transferOrder windows param = pParams.value("soitem_id", &valid); if (valid) { _itemid = param.toInt(); _ordertype = "SO"; _orderNumberLit->setText(tr("Sales Order #:")); populate(); } // TODO: deprecate by remoing from salesOrder and transferOrder windows param = pParams.value("toitem_id", &valid); if (valid) { _itemid = param.toInt(); _ordertype = "TO"; _orderNumberLit->setText(tr("Transfer Order #:")); populate(); } if (pParams.inList("requireInventory")) _requireInventory = true; param = pParams.value("qty", &valid); if (valid) _qtyToIssue->setDouble(param.toDouble()); _snooze = pParams.inList("snooze"); if(pParams.inList("issue")) sIssue(); return NoError; } void issueLineToShipping::sIssue() { XSqlQuery issueIssue; if (_qtyToIssue->toDouble() <= 0) { XMessageBox::message( (isVisible() ? this : parentWidget()), QMessageBox::Warning, tr("Invalid Quantity to Issue to Shipping"), tr( "

    Please enter a non-negative, non-zero value to indicate the amount " "of Stock you wish to Issue to Shipping for this Order Line." ), QString::null, QString::null, _snooze ); _qtyToIssue->setFocus(); return; } if(_requireInventory || ("SO" == _ordertype && _metrics->boolean("EnableSOReservations"))) { issueIssue.prepare("SELECT sufficientInventoryToShipItem(:ordertype, :orderitemid, :orderqty) AS result;"); issueIssue.bindValue(":ordertype", _ordertype); issueIssue.bindValue(":orderitemid", _itemid); issueIssue.bindValue(":orderqty", _qtyToIssue->toDouble()); issueIssue.exec(); if (issueIssue.first()) { int result = issueIssue.value("result").toInt(); if (result < 0) { ParameterList errp; if (_ordertype == "SO") errp.append("soitem_id", _itemid); else if (_ordertype == "TO") errp.append("toitem_id", _itemid); QString errs = "" "SELECT item_number, warehous_code " " FROM coitem, item, itemsite, whsinfo " " WHERE ((coitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (coitem_id=));" "" "SELECT item_number, tohead_srcname AS warehous_code " " FROM toitem, tohead, item " " WHERE ((toitem_item_id=item_id)" " AND (toitem_tohead_id=tohead_id)" " AND (toitem_id=));" "" ; MetaSQLQuery errm(errs); issueIssue = errm.toQuery(errp); if (! issueIssue.first() && issueIssue.lastError().type() != QSqlError::NoError) systemError(this, issueIssue.lastError().databaseText(), __FILE__, __LINE__); systemError(this, storedProcErrorLookup("sufficientInventoryToShipItem", result) .arg(issueIssue.value("item_number").toString()) .arg(issueIssue.value("warehous_code").toString()), __FILE__, __LINE__); return; } } else if (issueIssue.lastError().type() != QSqlError::NoError) { systemError(this, issueIssue.lastError().databaseText(), __FILE__, __LINE__); return; } } // check to see if we are over issuing ParameterList params; if (_ordertype == "SO") params.append("soitem_id", _itemid); else if (_ordertype == "TO") params.append("toitem_id", _itemid); params.append("qty", _qtyToIssue->toDouble()); QString sql = "" "SELECT itemsite_costmethod," " (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) <" " (COALESCE(SUM(shipitem_qty), 0) + )) AS overship" " FROM coitem LEFT OUTER JOIN" " ( shipitem JOIN shiphead" " ON ( (shipitem_shiphead_id=shiphead_id) AND (NOT shiphead_shipped) )" " ) ON (shipitem_orderitem_id=coitem_id)" " JOIN itemsite ON (coitem_itemsite_id=itemsite_id) " " WHERE (coitem_id=)" " GROUP BY coitem_qtyord, coitem_qtyshipped, coitem_qtyreturned, " " itemsite_costmethod, itemsite_controlmethod;" "" "SELECT false AS postprod," " (noNeg(toitem_qty_ordered - toitem_qty_shipped) <" " (COALESCE(SUM(shipitem_qty), 0) + )) AS overship" " FROM toitem LEFT OUTER JOIN" " ( shipitem JOIN shiphead" " ON ( (shipitem_shiphead_id=shiphead_id) AND (NOT shiphead_shipped) )" " ) ON (shipitem_orderitem_id=toitem_id)" " WHERE (toitem_id=)" " GROUP BY toitem_qty_ordered, toitem_qty_shipped;" ""; MetaSQLQuery mql(sql); issueIssue = mql.toQuery(params); if (issueIssue.next() && issueIssue.value("overship").toBool()) { if(XMessageBox::message( (isVisible() ? this : parentWidget()) , QMessageBox::Question, tr("Inventory Overshipped"), tr("

    You have selected to ship more inventory than required. Do you want to continue?"), tr("Yes"), tr("No"), _snooze, 0, 1) == 1) return; } if (issueIssue.lastError().type() != QSqlError::NoError) { systemError(this, issueIssue.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); int invhistid = 0; int itemlocSeries = 0; XSqlQuery issue; issue.exec("BEGIN;"); // If this is a lot/serial controlled job item, we need to post production first if (issueIssue.value("itemsite_costmethod").toString() == "J") { XSqlQuery prod; prod.prepare("SELECT postSoItemProduction(:soitem_id, :qty, :ts) AS result;"); prod.bindValue(":soitem_id", _itemid); prod.bindValue(":qty", _qtyToIssue->toDouble()); prod.bindValue(":ts", _transTS); prod.exec(); if (prod.first()) { itemlocSeries = prod.value("result").toInt(); if (itemlocSeries < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postProduction", itemlocSeries), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(itemlocSeries, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Issue Canceled") ); return; } // Need to get the inventory history id so we can auto reverse the distribution when issuing prod.prepare("SELECT invhist_id " "FROM invhist " "WHERE ((invhist_series = :itemlocseries) " " AND (invhist_transtype = 'RM')); "); prod.bindValue(":itemlocseries" , itemlocSeries); prod.exec(); if (prod.first()) invhistid = prod.value("invhist_id").toInt(); else { rollback.exec(); systemError(this, tr("Inventory history not found"), __FILE__, __LINE__); return; } } } issue.prepare("SELECT issueToShipping(:ordertype, :lineitem_id, :qty, :itemlocseries, :ts, :invhist_id) AS result;"); issue.bindValue(":ordertype", _ordertype); issue.bindValue(":lineitem_id", _itemid); issue.bindValue(":qty", _qtyToIssue->toDouble()); issue.bindValue(":ts", _transTS); if (invhistid) issue.bindValue(":invhist_id", invhistid); issue.bindValue(":itemlocseries", itemlocSeries); issue.exec(); if (issue.first()) { int result = issue.value("result").toInt(); if (result < 0) { rollback.exec(); systemError( this, storedProcErrorLookup("issueToShipping", result), __FILE__, __LINE__); return; } else { if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Issue Canceled") ); return; } // If Transfer Order then insert special pre-assign records for the lot/serial# // so they are available when the Transfer Order is received if (_ordertype == "TO") { XSqlQuery lsdetail; lsdetail.prepare("INSERT INTO lsdetail " " (lsdetail_itemsite_id, lsdetail_created, lsdetail_source_type, " " lsdetail_source_id, lsdetail_source_number, lsdetail_ls_id, lsdetail_qtytoassign) " "SELECT invhist_itemsite_id, NOW(), 'TR', " " :orderitemid, invhist_ordnumber, invdetail_ls_id, (invdetail_qty * -1.0) " "FROM invhist JOIN invdetail ON (invdetail_invhist_id=invhist_id) " "WHERE (invhist_series=:itemlocseries);"); lsdetail.bindValue(":orderitemid", _itemid); lsdetail.bindValue(":itemlocseries", result); lsdetail.exec(); if (lsdetail.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, lsdetail.lastError().databaseText(), __FILE__, __LINE__); return; } } issue.exec("COMMIT;"); accept(); } } else if (issue.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, issue.lastError().databaseText(), __FILE__, __LINE__); return; } } void issueLineToShipping::populate() { ParameterList itemp; if (_ordertype == "SO") itemp.append("soitem_id", _itemid); else if (_ordertype == "TO") itemp.append("toitem_id", _itemid); itemp.append("ordertype", _ordertype); // TODO: make this an orderitem select QString sql = "" "SELECT cohead_number AS order_number," " itemsite_item_id AS item_id," " warehous_code, uom_name," " coitem_qtyord AS qtyordered," " coitem_qtyshipped AS qtyshipped," " coitem_qtyreturned AS qtyreturned," " noNeg(coitem_qtyord - coitem_qtyshipped +" " coitem_qtyreturned) AS balance " "FROM cohead, coitem, itemsite, item, whsinfo, uom " "WHERE ((coitem_cohead_id=cohead_id)" " AND (coitem_itemsite_id=itemsite_id)" " AND (coitem_status <> 'X')" " AND (coitem_qty_uom_id=uom_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (coitem_id=) );" "" "SELECT tohead_number AS order_number," " toitem_item_id AS item_id," " warehous_code, toitem_uom AS uom_name," " toitem_qty_ordered AS qtyordered," " toitem_qty_shipped AS qtyshipped," " 0 AS qtyreturned," " noNeg(toitem_qty_ordered -" " toitem_qty_shipped) AS balance " "FROM tohead, toitem, whsinfo, item " "WHERE ((toitem_tohead_id=tohead_id)" " AND (toitem_status <> 'X')" " AND (tohead_src_warehous_id=warehous_id)" " AND (toitem_id=) );" ""; MetaSQLQuery itemm(sql); XSqlQuery itemq = itemm.toQuery(itemp); if (itemq.first()) { _orderNumber->setText(itemq.value("order_number").toString()); _item->setId(itemq.value("item_id").toInt()); _warehouse->setText(itemq.value("warehous_code").toString()); _shippingUOM->setText(itemq.value("uom_name").toString()); _qtyOrdered->setDouble(itemq.value("qtyordered").toDouble()); _qtyShipped->setDouble(itemq.value("qtyshipped").toDouble()); _qtyReturned->setDouble(itemq.value("qtyreturned").toDouble()); _balance->setDouble(itemq.value("balance").toDouble()); } else if (itemq.lastError().type() != QSqlError::NoError) { systemError(this, itemq.lastError().databaseText(), __FILE__, __LINE__); return; } ParameterList shipp; shipp.append("ordertype", _ordertype); shipp.append("orderitem_id", _itemid); sql = "SELECT shiphead_id AS misc_id," " SUM(shipitem_qty) AS qtyatship " "FROM shiphead, shipitem " "WHERE ((shipitem_shiphead_id=shiphead_id)" " AND (NOT shiphead_shipped)" " AND (shiphead_order_type=)" " AND (shipitem_orderitem_id=) ) " "GROUP BY shiphead_id;" ; MetaSQLQuery shipm(sql); XSqlQuery shipq = shipm.toQuery(shipp); if (shipq.first()) { _shipment->setType(_ordertype); _shipment->setId(shipq.value("misc_id").toInt()); _qtyAtShip->setDouble(shipq.value("qtyatship").toDouble()); } else if (shipq.lastError().type() != QSqlError::NoError) { systemError( this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } if (_qtyAtShip->toDouble() == 0.0) _qtyToIssue->setDouble(itemq.value("balance").toDouble()); } qt-client-4.1.0/guiclient/issueLineToShipping.h000066400000000000000000000022671217451700100215220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ISSUELINETOSHIPPING_H #define ISSUELINETOSHIPPING_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_issueLineToShipping.h" class issueLineToShipping : public XDialog, public Ui::issueLineToShipping { Q_OBJECT public: issueLineToShipping(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~issueLineToShipping(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sIssue(); protected: bool _requireInventory; bool _snooze; protected slots: virtual void languageChange(); virtual void populate(); private: int _itemid; QString _ordertype; QDateTime _transTS; }; #endif // ISSUELINETOSHIPPING_H qt-client-4.1.0/guiclient/issueLineToShipping.ui000066400000000000000000000363171217451700100217130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. issueLineToShipping 0 0 517 540 Issue Line to Shipping 12 12 12 12 12 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 6 Shipment #: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing Qt::Vertical 20 0 false 5 &Cancel &Issue true Qt::Vertical QSizePolicy::Expanding 20 20 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 38 20 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::MinimumExpanding 12 20 Selling UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Returned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Balance Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::MinimumExpanding 20 12 Qty. at Shipping: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::MinimumExpanding 20 12 Qty. to Issue: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Qt::Horizontal 20 20 ItemCluster QWidget

    itemcluster.h
    1 ShipmentCluster QWidget
    shipmentcluster.h
    XLineEdit QLineEdit
    xlineedit.h
    _qtyToIssue _issue _close _close clicked() issueLineToShipping reject() 20 20 20 20 qt-client-4.1.0/guiclient/issueToShipping.cpp000066400000000000000000000722141217451700100212440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "issueToShipping.h" #include #include #include #include "xmessagebox.h" #include "inputManager.h" #include "distributeInventory.h" #include "issueLineToShipping.h" #include "mqlutil.h" #include "shipOrder.h" #include "storedProcErrorLookup.h" issueToShipping::issueToShipping(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl), _captive(false) { setupUi(this); connect(_ship, SIGNAL(clicked()), this, SLOT(sShip())); connect(_issueLine, SIGNAL(clicked()), this, SLOT(sIssueLineBalance())); connect(_issueAll, SIGNAL(clicked()), this, SLOT(sIssueAllBalance())); connect(_issueStock, SIGNAL(clicked()), this, SLOT(sIssueStock())); connect(_order, SIGNAL(valid(bool)), this, SLOT(sFillList())); connect(_returnStock, SIGNAL(clicked()), this, SLOT(sReturnStock())); connect(_bcFind, SIGNAL(clicked()), this, SLOT(sBcFind())); connect(_soitem, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); _order->setAllowedStatuses(OrderLineEdit::Open); _order->setAllowedTypes(OrderLineEdit::Sales | OrderLineEdit::Transfer); _order->setLockSelected(true); _ship->setEnabled(_privileges->check("ShipOrders")); omfgThis->inputManager()->notify(cBCItem, this, this, SLOT(sCatchItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, this, SLOT(sCatchItemsiteid(int))); omfgThis->inputManager()->notify(cBCSalesOrder, this, this, SLOT(sCatchSoheadid(int))); omfgThis->inputManager()->notify(cBCSalesOrderLineItem, this, this, SLOT(sCatchSoitemid(int))); omfgThis->inputManager()->notify(cBCTransferOrder, this, this, SLOT(sCatchToheadid(int))); omfgThis->inputManager()->notify(cBCTransferOrderLineItem, this, this, SLOT(sCatchToitemid(int))); omfgThis->inputManager()->notify(cBCWorkOrder, this, this, SLOT(sCatchWoid(int))); _soitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "linenumber"); _soitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number"); _soitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip"); _soitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code"); _soitem->addColumn(tr("Sched. Date"), _qtyColumn, Qt::AlignRight, true, "scheddate"); _soitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name"); _soitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "qtyord"); _soitem->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "qtyshipped"); _soitem->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, false, "qtyreturned"); _soitem->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, false, "balance"); _soitem->addColumn(tr("At Shipping"), _qtyColumn, Qt::AlignRight, true, "atshipping"); _soitem->setSelectionMode(QAbstractItemView::ExtendedSelection); _order->setFromSitePrivsEnforced(TRUE); _bcQty->setValidator(omfgThis->qtyVal()); if(_metrics->boolean("EnableSOReservations")) { _requireInventory->setChecked(true); _requireInventory->setEnabled(false); } _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); // Until 9063 implemented: _issueByGroup->hide(); _onlyReserved->hide(); } issueToShipping::~issueToShipping() { // no need to delete child widgets, Qt does it all for us } void issueToShipping::languageChange() { retranslateUi(this); } enum SetResponse issueToShipping::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("sohead_id", &valid); if (valid) { _order->setId(param.toInt(), "SO"); if (_order->isValid()) { _order->setEnabled(false); _captive = true; } } param = pParams.value("tohead_id", &valid); if (valid) { _order->setId(param.toInt(), "TO"); if (_order->isValid()) { _order->setEnabled(false); _captive = true; } } return NoError; } void issueToShipping::sHandleButtons() { if (_soitem->currentItem() && _soitem->currentItem()->rawValue("atshipping").toDouble() > 0) _returnStock->setEnabled(true); else _returnStock->setEnabled(false); } void issueToShipping::sCatchSoheadid(int pSoheadid) { _order->setId(pSoheadid, "SO"); _soitem->selectAll(); } void issueToShipping::sCatchSoitemid(int pSoitemid) { XSqlQuery issueCatchSoitemid; issueCatchSoitemid.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:sohead_id);" ); issueCatchSoitemid.bindValue(":sohead_id", pSoitemid); issueCatchSoitemid.exec(); if (issueCatchSoitemid.first()) { _order->setId(issueCatchSoitemid.value("coitem_cohead_id").toInt(), "SO"); _soitem->clearSelection(); _soitem->setId(pSoitemid); sIssueStock(); } else if (issueCatchSoitemid.lastError().type() != QSqlError::NoError) { systemError(this, issueCatchSoitemid.lastError().databaseText(), __FILE__, __LINE__); return; } } void issueToShipping::sCatchToheadid(int pToheadid) { _order->setId(pToheadid, "TO"); _soitem->selectAll(); } void issueToShipping::sCatchToitemid(int porderitemid) { XSqlQuery issueCatchToitemid; issueCatchToitemid.prepare( "SELECT toitem_tohead_id " "FROM toitem " "WHERE (toitem_id=:tohead_id);" ); issueCatchToitemid.bindValue(":tohead_id", porderitemid); issueCatchToitemid.exec(); if (issueCatchToitemid.first()) { _order->setId(issueCatchToitemid.value("toitem_tohead_id").toInt(), "TO"); _soitem->clearSelection(); _soitem->setId(porderitemid); sIssueStock(); } else if (issueCatchToitemid.lastError().type() != QSqlError::NoError) { systemError(this, issueCatchToitemid.lastError().databaseText(), __FILE__, __LINE__); return; } } void issueToShipping::sCatchItemsiteid(int pItemsiteid) { XSqlQuery issueCatchItemsiteid; issueCatchItemsiteid.prepare("SELECT orderitem_id " "FROM orderitem " "WHERE ((orderitem_itemsite_id=:itemsite) " " AND (orderitem_orderhead_type=:ordertype) " " AND (orderitem_orderhead_id=:orderid));"); issueCatchItemsiteid.bindValue(":itemsite", pItemsiteid); issueCatchItemsiteid.bindValue(":ordertype", _order->type()); issueCatchItemsiteid.bindValue(":orderid", _order->id()); issueCatchItemsiteid.exec(); if (issueCatchItemsiteid.first()) { _soitem->clearSelection(); _soitem->setId(issueCatchItemsiteid.value("orderitem_id").toInt()); sIssueStock(); } else audioReject(); } void issueToShipping::sCatchItemid(int pItemid) { XSqlQuery issueCatchItemid; issueCatchItemid.prepare( "SELECT orderitem_id " "FROM orderitem, itemsite " "WHERE ((orderitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=:item_id)" " AND (orderitem_orderhead_type=:ordertype) " " AND (orderitem_orderhead_id=:orderid));"); issueCatchItemid.bindValue(":item_id", pItemid); issueCatchItemid.bindValue(":ordertype", _order->type()); issueCatchItemid.bindValue(":orderid", _order->id()); issueCatchItemid.exec(); if (issueCatchItemid.first()) { _soitem->clearSelection(); _soitem->setId(issueCatchItemid.value("orderitem_id").toInt()); sIssueStock(); } else audioReject(); } void issueToShipping::sCatchWoid(int pWoid) { XSqlQuery issueCatchWoid; if (_order->isSO()) { issueCatchWoid.prepare( " SELECT coitem_cohead_id, coitem_id" " FROM coitem" " WHERE ((coitem_order_id=:wo_id)" " AND (coitem_cohead_id=:sohead_id));" ); issueCatchWoid.bindValue(":wo_id", pWoid); issueCatchWoid.bindValue(":sohead_id", _order->id()); issueCatchWoid.exec(); if (issueCatchWoid.first()) { _order->setId(issueCatchWoid.value("coitem_cohead_id").toInt()); _soitem->clearSelection(); _soitem->setId(issueCatchWoid.value("coitem_id").toInt()); sIssueStock(); } else if (issueCatchWoid.lastError().type() != QSqlError::NoError) { systemError(this, issueCatchWoid.lastError().databaseText(), __FILE__, __LINE__); return; } } else audioReject(); } void issueToShipping::sIssueStock() { bool update = FALSE; QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("order_id", ((XTreeWidgetItem*)selected[i])->id()); params.append("order_type", _order->type()); params.append("transTS", _transDate->date()); if(_requireInventory->isChecked()) params.append("requireInventory"); issueLineToShipping newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() != XDialog::Rejected) update = TRUE; } if (update) sFillList(); } bool issueToShipping::sufficientItemInventory(int porderitemid) { XSqlQuery issueufficientItemInventory; if(_requireInventory->isChecked() || (_order->isSO() && _metrics->boolean("EnableSOReservations"))) { issueufficientItemInventory.prepare("SELECT sufficientInventoryToShipItem(:ordertype, :itemid) AS result;"); issueufficientItemInventory.bindValue(":itemid", porderitemid); issueufficientItemInventory.bindValue(":ordertype", _order->type()); issueufficientItemInventory.exec(); if (issueufficientItemInventory.first()) { int result = issueufficientItemInventory.value("result").toInt(); if (result < 0) { ParameterList errp; if (_order->isSO()) errp.append("soitem_id", porderitemid); else if (_order->isTO()) errp.append("toitem_id", porderitemid); QString errs = "" "SELECT item_number, warehous_code " " FROM coitem, item, itemsite, whsinfo " " WHERE ((coitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (coitem_id=));" "" "SELECT item_number, tohead_srcname AS warehous_code " " FROM toitem, tohead, item " " WHERE ((toitem_item_id=item_id)" " AND (toitem_tohead_id=tohead_id)" " AND (toitem_id=));" "" ; MetaSQLQuery errm(errs); issueufficientItemInventory = errm.toQuery(errp); if (! issueufficientItemInventory.first() && issueufficientItemInventory.lastError().type() != QSqlError::NoError) systemError(this, issueufficientItemInventory.lastError().databaseText(), __FILE__, __LINE__); systemError(this, storedProcErrorLookup("sufficientInventoryToShipItem", result) .arg(issueufficientItemInventory.value("item_number").toString()) .arg(issueufficientItemInventory.value("warehous_code").toString()), __FILE__, __LINE__); return false; } } else if (issueufficientItemInventory.lastError().type() != QSqlError::NoError) { systemError(this, issueufficientItemInventory.lastError().databaseText(), __FILE__, __LINE__); return false; } } return true; } bool issueToShipping::sufficientInventory(int porderheadid) { XSqlQuery issueufficientInventory; if (_requireInventory->isChecked() || (_order->isSO() && _metrics->boolean("EnableSOReservations"))) { issueufficientInventory.prepare("SELECT sufficientInventoryToShipOrder(:ordertype, :orderid) AS result;"); issueufficientInventory.bindValue(":orderid", porderheadid); issueufficientInventory.bindValue(":ordertype", _order->type()); issueufficientInventory.exec(); if (issueufficientInventory.first()) { int result = issueufficientInventory.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("sufficientInventoryToShipOrder", result), __FILE__, __LINE__); return false; } } else if (issueufficientInventory.lastError().type() != QSqlError::NoError) { systemError(this, issueufficientInventory.lastError().databaseText(), __FILE__, __LINE__); return false; } } return true; } void issueToShipping::sIssueLineBalance() { bool refresh = false; QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem *cursor = (XTreeWidgetItem*)selected[i]; if (sIssueLineBalance(cursor->id(), cursor->altId())) refresh = true; else break; } if (refresh) sFillList(); } bool issueToShipping::sIssueLineBalance(int id, int altId) { if (altId == 0) // Not a Job costed item { if (! sufficientItemInventory(id)) return false; } int invhistid = 0; int itemlocSeries = 0; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery issue; issue.exec("BEGIN;"); // If this is a lot/serial controlled job item, we need to post production first if (altId == 1) { XSqlQuery prod; prod.prepare("SELECT postSoItemProduction(:soitem_id, :ts) AS result;"); prod.bindValue(":soitem_id", id); prod.bindValue(":ts", _transDate->date()); prod.exec(); if (prod.first()) { itemlocSeries = prod.value("result").toInt(); if (itemlocSeries < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postProduction", itemlocSeries), __FILE__, __LINE__); return false; } else if (distributeInventory::SeriesAdjust(itemlocSeries, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Issue Canceled") ); return false; } // Need to get the inventory history id so we can auto reverse the distribution when issuing prod.prepare("SELECT invhist_id " "FROM invhist " "WHERE ((invhist_series = :itemlocseries) " " AND (invhist_transtype = 'RM')); "); prod.bindValue(":itemlocseries" , itemlocSeries); prod.exec(); if (prod.first()) invhistid = prod.value("invhist_id").toInt(); else { rollback.exec(); systemError(this, tr("Inventory history not found"), __FILE__, __LINE__); return false; } } } issue.prepare("SELECT issueLineBalanceToShipping(:ordertype, :soitem_id, :ts, :itemlocseries, :invhist_id) AS result;"); issue.bindValue(":ordertype", _order->type()); issue.bindValue(":soitem_id", id); issue.bindValue(":ts", _transDate->date()); if (invhistid) issue.bindValue(":invhist_id", invhistid); if (itemlocSeries) issue.bindValue(":itemlocseries", itemlocSeries); issue.exec(); if (issue.first()) { int result = issue.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("issueLineBalanceToShipping", result), __FILE__, __LINE__); return false; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Issue Canceled") ); return false; } // If Transfer Order then insert special pre-assign records for the lot/serial# // so they are available when the Transfer Order is received if (_order->type() == "TO") { XSqlQuery lsdetail; lsdetail.prepare("INSERT INTO lsdetail " " (lsdetail_itemsite_id, lsdetail_created, lsdetail_source_type, " " lsdetail_source_id, lsdetail_source_number, lsdetail_ls_id, lsdetail_qtytoassign) " "SELECT invhist_itemsite_id, NOW(), 'TR', " " :orderitemid, invhist_ordnumber, invdetail_ls_id, (invdetail_qty * -1.0) " "FROM invhist JOIN invdetail ON (invdetail_invhist_id=invhist_id) " "WHERE (invhist_series=:itemlocseries);"); lsdetail.bindValue(":orderitemid", id); lsdetail.bindValue(":itemlocseries", result); lsdetail.exec(); if (lsdetail.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, lsdetail.lastError().databaseText(), __FILE__, __LINE__); return false; } } issue.exec("COMMIT;"); } else if (issue.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, issue.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void issueToShipping::sIssueAllBalance() { bool refresh = false; int orderid = _order->id(); if (! sufficientInventory(orderid)) return; for (int i = 0; i < _soitem->topLevelItemCount(); i++) { XTreeWidgetItem *cursor = (XTreeWidgetItem*)_soitem->topLevelItem(i); if (sIssueLineBalance(cursor->id(),cursor->altId())) refresh = true; else break; } if (refresh) sFillList(); } void issueToShipping::sReturnStock() { XSqlQuery issueReturnStock; QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem *cursor = (XTreeWidgetItem*)selected[i]; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); issueReturnStock.exec("BEGIN"); issueReturnStock.prepare("SELECT returnItemShipments(:ordertype, :soitem_id, 0, :ts) AS result;"); issueReturnStock.bindValue(":ordertype", _order->type()); issueReturnStock.bindValue(":soitem_id", cursor->id()); issueReturnStock.bindValue(":ts", _transDate->date()); issueReturnStock.exec(); if (issueReturnStock.first()) { int result = issueReturnStock.value("result").toInt(); if (result < 0) { rollback.exec(); systemError( this, storedProcErrorLookup("returnItemShipments", result), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Return Canceled") ); return; } issueReturnStock.exec("COMMIT;"); } else if (issueReturnStock.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, issueReturnStock.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } void issueToShipping::sShip() { XSqlQuery issueShip; issueShip.prepare( "SELECT shiphead_id " "FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) " "WHERE ((NOT shiphead_shipped)" " AND (shiphead_order_type=:ordertype)" " AND (shiphead_order_id=:order_id) ) " "LIMIT 1;" ); issueShip.bindValue(":order_id", _order->id()); issueShip.bindValue(":ordertype", _order->type()); issueShip.exec(); if (issueShip.first()) { // Reset _order so that lock is released prior to shipping and potentially auto receiving // to avoid locking conflicts _transDate->setDate(omfgThis->dbDate()); _order->setId(-1); _order->setFocus(); ParameterList params; params.append("shiphead_id", issueShip.value("shiphead_id").toInt()); shipOrder newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() != XDialog::Rejected) { //_transDate->setDate(omfgThis->dbDate()); //_order->setId(-1); //_order->setFocus(); } } else if (issueShip.lastError().type() != QSqlError::NoError) { systemError(this, issueShip.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::information( this, tr("Cannot Ship Order"), tr("

    You must issue some amount of Stock to " "this Order before you may ship it.") ); return; } if (_captive) close(); } void issueToShipping::sFillList() { XSqlQuery issueFillList; ParameterList listp; if (_order->id() < 0) { _soitem->clear(); _order->setFocus(); return; } else if (_order->isSO()) { issueFillList.prepare( "SELECT cohead_holdtype " "FROM cohead " "WHERE (cohead_id=:sohead_id);" ); issueFillList.bindValue(":sohead_id", _order->id()); issueFillList.exec(); if (issueFillList.first()) { if (issueFillList.value("cohead_holdtype").toString() == "C") { QMessageBox::critical( this, tr("Cannot Issue Stock"), storedProcErrorLookup("issuetoshipping", -12)); _order->setId(-1); _order->setFocus(); } else if (issueFillList.value("cohead_holdtype").toString() == "P") { QMessageBox::critical( this, tr("Cannot Issue Stock"), storedProcErrorLookup("issuetoshipping", -13)); _order->setId(-1); _order->setFocus(); } else if (issueFillList.value("cohead_holdtype").toString() == "R") { QMessageBox::critical( this, tr("Cannot Issue Stock"), storedProcErrorLookup("issuetoshipping", -14)); _order->setId(-1); _order->setFocus(); } } else if (issueFillList.lastError().type() != QSqlError::NoError) { systemError(this, issueFillList.lastError().databaseText(), __FILE__, __LINE__); return; } else { _order->setId(-1); _order->setFocus(); return; } listp.append("sohead_id", _order->id()); } else if (_order->isTO()) { listp.append("tohead_id", _order->id()); } else { systemError(this, tr("Unrecognized order type %1").arg(_order->type()), __FILE__, __LINE__); return; } listp.append("ordertype", _order->type()); MetaSQLQuery listm = mqlLoad("issueToShipping", "detail"); XSqlQuery listq = listm.toQuery(listp); _soitem->populate(listq, true); if (listq.first()) { _shipment->setText(listq.value("shiphead_number").toString()); } if (listq.lastError().type() != QSqlError::NoError) { systemError(this, listq.lastError().databaseText(), __FILE__, __LINE__); return; } } void issueToShipping::sBcFind() { XSqlQuery issueBcFind; if (_bc->text().isEmpty()) { QMessageBox::warning(this, tr("No Bar Code scanned"), tr("

    Cannot search for Items by Bar Code without a " "Bar Code.")); _bc->setFocus(); return; } // find item that matches barcode and is a line item in this order. // then call issueLineToShipping passing in params to preset and // run the issue button. // TODO: can we make this an orderitem select? QString sql = "" "SELECT coitem_id AS lineitem_id, noNeg(noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) - COALESCE(SUM(shipitem_qty), 0)) AS balance" " FROM itemsite, item," " coitem LEFT OUTER JOIN" " ( shipitem JOIN shiphead" " ON ( (shipitem_shiphead_id=shiphead_id)" " AND (NOT shiphead_shipped" " AND shiphead_order_type=) )" " ) ON (shipitem_orderitem_id=coitem_id) " " WHERE ((coitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (coitem_status NOT IN ('C', 'X'))" " AND (coitem_cohead_id=)" " AND (item_upccode=))" " GROUP BY coitem_id, coitem_qtyord, coitem_qtyshipped, coitem_qtyreturned; " "" "SELECT toitem_id AS lineitem_id, noNeg(noNeg(toitem_qty_ordered - toitem_qty_shipped) - COALESCE(SUM(shipitem_qty), 0)) AS balance" " FROM item," " toitem LEFT OUTER JOIN" " ( shipitem JOIN shiphead" " ON ( (shipitem_shiphead_id=shiphead_id)" " AND (NOT shiphead_shipped" " AND shiphead_order_type=) )" " ) ON (shipitem_orderitem_id=toitem_id) " " WHERE ((toitem_item_id=item_id)" " AND (toitem_status NOT IN ('C', 'X'))" " AND (toitem_tohead_id=)" " AND (item_upccode=))" " GROUP BY toitem_id, toitem_qty_ordered, toitem_qty_shipped; " "" ; ParameterList findp; if (_order->isSO()) findp.append("sohead_id", _order->id()); else if (_order->isTO()) findp.append("tohead_id", _order->id()); findp.append("ordertype", _order->type()); findp.append("bc", _bc->text()); MetaSQLQuery findm(sql); issueBcFind = findm.toQuery(findp); if(!issueBcFind.first()) { if (issueBcFind.lastError().type() != QSqlError::NoError) { systemError(this, issueBcFind.lastError().databaseText(), __FILE__, __LINE__); return; } XMessageBox::message(this, QMessageBox::Warning, tr("No Match Found"), tr("

    No Items on this Sales Order match the specified Barcode.") ); _bc->clear(); return; } int coitemid = issueBcFind.value("lineitem_id").toInt(); while(issueBcFind.value("balance").toDouble() == 0 && issueBcFind.next()) coitemid = issueBcFind.value("lineitem_id").toInt(); ParameterList params; if (_order->isSO()) params.append("soitem_id", coitemid); else if (_order->isTO()) params.append("toitem_id", coitemid); if (_requireInventory->isChecked()) params.append("requireInventory"); params.append("qty", _bcQty->toDouble()); params.append("issue"); params.append("snooze"); issueLineToShipping newdlg(this, "", TRUE); if (newdlg.set(params) != NoError) return; sFillList(); _bc->clear(); // Check to see if the order is fully completed yet. // If so we can pop a quick message informing the user. // TODO: can we make this an orderitem select? sql = "" "SELECT coitem_id," " noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) - COALESCE(SUM(shipitem_qty), 0) AS remaining" " FROM coitem LEFT OUTER JOIN" " ( shipitem JOIN shiphead" " ON ( (shipitem_shiphead_id=shiphead_id)" " AND (NOT shiphead_shipped)" " AND (shiphead_order_type=))" " ) ON (shipitem_orderitem_id=coitem_id)" " WHERE ( (coitem_status NOT IN ('C','X'))" " AND (coitem_cohead_id=) )" " GROUP BY coitem_id, coitem_qtyord, coitem_qtyshipped, coitem_qtyreturned " "HAVING ((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) - COALESCE(SUM(shipitem_qty),0)) > 0);" "" "SELECT toitem_id," " noNeg(toitem_qty_ordered - toitem_qty_shipped) - COALESCE(SUM(shipitem_qty), 0) AS remaining" " FROM toitem LEFT OUTER JOIN" " ( shipitem JOIN shiphead" " ON ( (shipitem_shiphead_id=shiphead_id)" " AND (NOT shiphead_shipped)" " AND (shiphead_order_type=))" " ) ON (shipitem_orderitem_id=toitem_id)" " WHERE ( (toitem_status NOT IN ('C','X'))" " AND (toitem_tohead_id=) )" " GROUP BY toitem_id, toitem_qty_ordered, toitem_qty_shipped " "HAVING ((noNeg(toitem_qty_ordered - toitem_qty_shipped) - COALESCE(SUM(shipitem_qty),0)) > 0);" "" ; ParameterList fullp; if (_order->isSO()) fullp.append("sohead_id", _order->id()); else if (_order->isTO()) fullp.append("tohead_id", _order->id()); fullp.append("ordertype", _order->type()); fullp.append("bc", _bc->text()); MetaSQLQuery fullm(sql); issueBcFind = fullm.toQuery(fullp); // If there are no records then the order is complete if(!issueBcFind.first()) { if (issueBcFind.lastError().type() != QSqlError::NoError) { systemError(this, issueBcFind.lastError().databaseText(), __FILE__, __LINE__); return; } XMessageBox::message( this, QMessageBox::Information, tr("Order Complete"), tr("All items for this order have been issued to shipping.") ); } } qt-client-4.1.0/guiclient/issueToShipping.h000066400000000000000000000033331217451700100207050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ISSUETOSHIPPING_H #define ISSUETOSHIPPING_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_issueToShipping.h" class issueToShipping : public XWidget, public Ui::issueToShipping { Q_OBJECT public: issueToShipping(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~issueToShipping(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sBcFind(); virtual void sCatchItemid( int pItemid ); virtual void sCatchItemsiteid( int pItemsiteid ); virtual void sCatchSoheadid( int pSoheadid ); virtual void sCatchSoitemid( int pSoitemid ); virtual void sCatchToheadid( int pToheadid ); virtual void sCatchToitemid( int porderitemid ); virtual void sCatchWoid( int pWoid ); virtual void sHandleButtons(); virtual void sIssueAllBalance(); virtual void sIssueLineBalance(); virtual bool sIssueLineBalance(int id, int altId); virtual void sIssueStock(); virtual void sReturnStock(); virtual void sShip(); protected slots: virtual void languageChange(); virtual void sFillList(); protected: bool _captive; private: bool sufficientInventory(int); bool sufficientItemInventory(int); }; #endif // ISSUETOSHIPPING_H qt-client-4.1.0/guiclient/issueToShipping.ui000066400000000000000000000533071217451700100211010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. issueToShipping 0 0 800 600 Issue to Shipping Shipment #: 100 0 0 0 Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal 40 20 Issue by: Order Customer &Close &Ship Qt::Vertical QSizePolicy::Expanding 20 0 1 0 0 0 0 0 Qt::StrongFocus Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 Qt::StrongFocus Qt::Vertical 20 0 false Qt::Vertical 20 0 Qt::Horizontal 0 20 12 0 0 Require sufficient Inventory Only show Reserved Items Qt::Horizontal 40 20 0 1 QFrame::NoFrame 0 0 0 0 0 20 Line Items: false &Issue Stock false Issue &Line false &Return Stock Qt::Vertical QSizePolicy::Fixed 20 5 Issue &All Qt::Vertical QSizePolicy::Expanding 20 20 12 Qt::Horizontal QSizePolicy::Expanding 0 20 Issue Items using bar code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 35 0 Qty. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 1 Find 0 1 CustCluster QWidget

    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    OrderCluster QWidget
    ordercluster.h
    ShiptoCluster QWidget
    shiptocluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _shipment _transDate _issueBy _order _requireInventory _onlyReserved _soitem _bc _bcQty _bcFind _issueStock _issueLine _returnStock _issueAll _cust _ship _close _close clicked() issueToShipping close() 20 20 20 20 _soitem valid(bool) _issueLine setEnabled(bool) 20 20 20 20 _soitem itemSelected(int) _issueStock animateClick() 20 20 20 20 _soitem valid(bool) _issueStock setEnabled(bool) 20 20 20 20 _bc returnPressed() _bcFind animateClick() 20 20 20 20 _issueBy currentIndexChanged(int) _stackedWidget setCurrentIndex(int) 147 42 200 159 _cust valid(bool) _shipto setEnabled(bool) 355 148 594 147 _cust newId(int) _shipto setCustid(int) 355 148 594 147 qt-client-4.1.0/guiclient/issueWoMaterialBatch.cpp000066400000000000000000000222331217451700100221620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "issueWoMaterialBatch.h" #include #include #include #include "inputManager.h" #include "distributeInventory.h" issueWoMaterialBatch::issueWoMaterialBatch(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _captive = false; connect(_issue, SIGNAL(clicked()), this, SLOT(sIssue())); connect(_wo, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); _hasPush = FALSE; _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); _wo->setType(cWoExploded | cWoIssued | cWoReleased); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _womatl->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _womatl->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); _womatl->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); _womatl->addColumn(tr("Issue Method"), _itemColumn, Qt::AlignCenter, true, "issuemethod" ); _womatl->addColumn(tr("Picklist"), _itemColumn, Qt::AlignCenter, true, "picklist" ); _womatl->addColumn(tr("Required"), _qtyColumn, Qt::AlignRight, true, "required" ); _womatl->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "itemsite_qtyonhand" ); _womatl->addColumn(tr("Short"), _qtyColumn, Qt::AlignRight, true, "short" ); } issueWoMaterialBatch::~issueWoMaterialBatch() { // no need to delete child widgets, Qt does it all for us } void issueWoMaterialBatch::languageChange() { retranslateUi(this); } enum SetResponse issueWoMaterialBatch::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _captive = TRUE; _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } return NoError; } void issueWoMaterialBatch::sIssue() { if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return; } QString sqlissue = ( "SELECT itemsite_id, " " item_number, " " warehous_code, " " (COALESCE((SELECT SUM(itemloc_qty) " " FROM itemloc " " WHERE (itemloc_itemsite_id=itemsite_id)), 0.0) " " >= roundQty(item_fractional, noNeg(itemuomtouom(itemsite_item_id, womatl_uom_id, NULL, womatl_qtyreq - womatl_qtyiss)))) AS isqtyavail " " FROM womatl, itemsite, item, whsinfo " " WHERE ( (womatl_itemsite_id=itemsite_id) " " AND (itemsite_item_id=item_id) " " AND (itemsite_warehous_id=warehous_id) " " AND (NOT ((item_type = 'R') OR (itemsite_controlmethod = 'N'))) " " AND ((itemsite_controlmethod IN ('L', 'S')) OR (itemsite_loccntrl)) " " AND (womatl_issuemethod IN ('S', 'M')) " " " " AND (womatl_picklist) " " " " AND (womatl_wo_id=)); "); MetaSQLQuery mqlissue(sqlissue); ParameterList params; params.append("wo_id", _wo->id()); if (!_nonPickItems->isChecked()) params.append("pickItemsOnly", true); XSqlQuery issue = mqlissue.toQuery(params); while(issue.next()) { if(!(issue.value("isqtyavail").toBool())) { QMessageBox::critical(this, tr("Insufficient Inventory"), tr("Item Number %1 in Site %2 is a Multiple Location or\n" "Lot/Serial controlled Item which is short on Inventory.\n" "This transaction cannot be completed as is. Please make\n" "sure there is sufficient Quantity on Hand before proceeding.") .arg(issue.value("item_number").toString()) .arg(issue.value("warehous_code").toString())); return; } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); QString sqlitems = ("SELECT womatl_id," " CASE WHEN (womatl_qtyreq >= 0) THEN" " roundQty(itemuomfractionalbyuom(item_id, womatl_uom_id), noNeg(womatl_qtyreq - womatl_qtyiss))" " ELSE" " roundQty(itemuomfractionalbyuom(item_id, womatl_uom_id), noNeg(womatl_qtyiss * -1))" " END AS qty" " FROM womatl, itemsite, item" " WHERE((womatl_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (womatl_issuemethod IN ('S', 'M'))" " " " AND (womatl_picklist) " " " " AND (womatl_wo_id=)); "); MetaSQLQuery mqlitems(sqlitems); XSqlQuery items = mqlitems.toQuery(params); while(items.next()) { issue.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations issue.prepare("SELECT issueWoMaterial(:womatl_id, :qty, 0, TRUE, :date) AS result;"); issue.bindValue(":womatl_id", items.value("womatl_id").toInt()); issue.bindValue(":qty", items.value("qty").toDouble()); issue.bindValue(":date", _transDate->date()); issue.exec(); if (issue.first()) { if (issue.value("result").toInt() < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2, Error #%3.") .arg(__LINE__) .arg(_wo->id()) .arg(issue.value("result").toInt()) ); return; } if (distributeInventory::SeriesAdjust(issue.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Material Issue"), tr("Transaction Canceled") ); return; } } else { rollback.exec(); systemError( this, tr("A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2.") .arg(__LINE__) .arg(_wo->id()) ); return; } issue.exec("COMMIT;"); } omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); if (_captive) accept(); else { _wo->setId(-1); _womatl->clear(); _wo->setFocus(); } } void issueWoMaterialBatch::sFillList() { _womatl->clear(); _issue->setEnabled(false); if (_wo->isValid()) { QTreeWidgetItem * hitem = _womatl->headerItem(); if (_wo->method() == "A") hitem->setText(5, tr("Required")); else hitem->setText(5, tr("Returned")); XSqlQuery womatl; womatl.prepare( "SELECT womatl_id, item_number," " (item_descrip1 || ' ' || item_descrip2) AS itemdescrip, uom_name," " CASE WHEN (womatl_issuemethod = 'S') THEN :push" " WHEN (womatl_issuemethod = 'L') THEN :pull" " WHEN (womatl_issuemethod = 'M') THEN :mixed" " ELSE :error" " END AS issuemethod," " womatl_picklist AS picklist," " CASE " " WHEN (womatl_qtyreq >= 0) THEN " " noNeg(womatl_qtyreq - womatl_qtyiss) " " ELSE " " (womatl_qtyiss * -1) " " END AS required," " itemsite_qtyonhand," " abs(noneg((itemsite_qtyonhand - womatl_qtyreq) * -1)) AS short," " 'qty' AS required_xtnumericrole," " 'qty' AS itemsite_qtyonhand_xtnumericrole," " 'qty' AS short_xtnumericrole," " CASE WHEN (womatl_issuemethod = 'L') THEN 'blue'" " END AS issuemethod_qtforegroundrole, " " CASE WHEN (abs(noneg((itemsite_qtyonhand - womatl_qtyreq) * -1)) > 0.0) THEN 'red'" " END AS short_qtforegroundrole " "FROM womatl, itemsite, item, uom " "WHERE ((womatl_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (womatl_uom_id=uom_id)" " AND (womatl_wo_id=:wo_id)) " "ORDER BY item_number;" ); womatl.bindValue(":push", tr("Push")); womatl.bindValue(":pull", tr("Pull")); womatl.bindValue(":mixed", tr("Mixed")); womatl.bindValue(":error", tr("Error")); womatl.bindValue(":wo_id", _wo->id()); womatl.exec(); _womatl->populate(womatl); _issue->setEnabled(true); } } qt-client-4.1.0/guiclient/issueWoMaterialBatch.h000066400000000000000000000021511217451700100216240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ISSUEWOMATERIALBATCH_H #define ISSUEWOMATERIALBATCH_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_issueWoMaterialBatch.h" class issueWoMaterialBatch : public XDialog, public Ui::issueWoMaterialBatch { Q_OBJECT public: issueWoMaterialBatch(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~issueWoMaterialBatch(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sIssue(); virtual void sFillList(); protected slots: virtual void languageChange(); private: bool _captive; bool _hasPush; }; #endif // ISSUEWOMATERIALBATCH_H qt-client-4.1.0/guiclient/issueWoMaterialBatch.ui000066400000000000000000000211621217451700100220150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. issueWoMaterialBatch 0 0 625 513 Issue Work Order Material Batch 12 12 Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 290 130 Qt::StrongFocus Issue Items not on Pick List Qt::Horizontal QSizePolicy::Expanding 114 81 &Cancel false &Post Qt::Vertical QSizePolicy::Expanding 20 80 0 1 QFrame::NoFrame QFrame::Raised 0 QFrame::NoFrame QFrame::Raised 0 0 0 20 Work Order Material Requirements: 0 0 DLineEdit QWidget
    datecluster.h
    WoCluster QWidget
    wocluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _transDate _wo _nonPickItems _issue _close _womatl _close clicked() issueWoMaterialBatch close() 20 20 20 20
    qt-client-4.1.0/guiclient/issueWoMaterialItem.cpp000066400000000000000000000176761217451700100220560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "issueWoMaterialItem.h" #include #include #include #include "inputManager.h" #include "distributeInventory.h" issueWoMaterialItem::issueWoMaterialItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_womatl, SIGNAL(newId(int)), this, SLOT(sSetQOH(int))); connect(_qtyToIssue, SIGNAL(textChanged(const QString&)), this, SLOT(sPopulateQOH())); connect(_issue, SIGNAL(clicked()), this, SLOT(sIssue())); _captive = FALSE; _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); omfgThis->inputManager()->notify(cBCItem, this, this, SLOT(sCatchItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, this, SLOT(sCatchItemsiteid(int))); _wo->setType(cWoExploded | cWoIssued | cWoReleased); _qtyToIssue->setValidator(omfgThis->qtyVal()); _beforeQty->setPrecision(omfgThis->transQtyVal()); _afterQty->setPrecision(omfgThis->transQtyVal()); } issueWoMaterialItem::~issueWoMaterialItem() { // no need to delete child widgets, Qt does it all for us } void issueWoMaterialItem::languageChange() { retranslateUi(this); } enum SetResponse issueWoMaterialItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _captive = TRUE; _wo->setId(param.toInt()); _wo->setEnabled(false); } param = pParams.value("womatl_id", &valid); if (valid) { _womatl->setId(param.toInt()); _womatl->setEnabled(false); } param = pParams.value("qty", &valid); if (valid) _qtyToIssue->setDouble(param.toDouble()); return NoError; } void issueWoMaterialItem::sCatchItemid(int pItemid) { XSqlQuery issueCatchItemid; if (_wo->isValid()) { issueCatchItemid.prepare( "SELECT womatl_id " "FROM womatl, itemsite " "WHERE ( (womatl_itemsite_id=itemsite_id)" " AND (womatl_wo_id=:wo_id)" " AND (itemsite_item_id=:item_id) );" ); issueCatchItemid.bindValue(":wo_id", _wo->id()); issueCatchItemid.bindValue(":item_id", pItemid); issueCatchItemid.exec(); if (issueCatchItemid.first()) _womatl->setId(issueCatchItemid.value("womatl_id").toInt()); else audioReject(); } else audioReject(); } void issueWoMaterialItem::sCatchItemsiteid(int pItemsiteid) { XSqlQuery issueCatchItemsiteid; if (_wo->isValid()) { issueCatchItemsiteid.prepare( "SELECT womatl_id " "FROM womatl " "WHERE ((womatl_itemsite_id=:itemsite_id)" " AND (womatl_wo_id=:wo_id));" ); issueCatchItemsiteid.bindValue(":itemsite_id", pItemsiteid); issueCatchItemsiteid.bindValue(":wo_id", _wo->id()); issueCatchItemsiteid.exec(); if (issueCatchItemsiteid.first()) _womatl->setId(issueCatchItemsiteid.value("womatl_id").toInt()); else audioReject(); } else audioReject(); } void issueWoMaterialItem::sIssue() { XSqlQuery issueIssue; if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return; } issueIssue.prepare("SELECT itemsite_id, item_number, warehous_code, " " (COALESCE((SELECT SUM(itemloc_qty) " " FROM itemloc " " WHERE (itemloc_itemsite_id=itemsite_id)), 0.0) >= roundQty(item_fractional, itemuomtouom(itemsite_item_id, womatl_uom_id, NULL, :qty))) AS isqtyavail " " FROM womatl, itemsite, item, whsinfo " " WHERE ((womatl_itemsite_id=itemsite_id) " " AND (itemsite_item_id=item_id) " " AND (itemsite_warehous_id=warehous_id) " " AND (NOT ((item_type = 'R') OR (itemsite_controlmethod = 'N'))) " " AND ((itemsite_controlmethod IN ('L', 'S')) OR (itemsite_loccntrl)) " " AND (womatl_id=:womatl_id)); "); issueIssue.bindValue(":womatl_id", _womatl->id()); issueIssue.bindValue(":qty", _qtyToIssue->toDouble()); issueIssue.exec(); while(issueIssue.next()) { if(!(issueIssue.value("isqtyavail").toBool())) { QMessageBox::critical(this, tr("Insufficient Inventory"), tr("Item Number %1 in Site %2 is a Multiple Location or\n" "Lot/Serial controlled Item which is short on Inventory.\n" "This transaction cannot be completed as is. Please make\n" "sure there is sufficient Quantity on Hand before proceeding.") .arg(issueIssue.value("item_number").toString()) .arg(issueIssue.value("warehous_code").toString())); return; } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); issueIssue.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations issueIssue.prepare("SELECT issueWoMaterial(:womatl_id, :qty, TRUE, :date) AS result;"); issueIssue.bindValue(":womatl_id", _womatl->id()); issueIssue.bindValue(":qty", _qtyToIssue->toDouble()); issueIssue.bindValue(":date", _transDate->date()); issueIssue.exec(); if (issueIssue.first()) { if (issueIssue.value("result").toInt() < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at issueWoMaterialItem::%1, Work Order ID #%2, Error #%3.") .arg(__LINE__) .arg(_wo->id()) .arg(issueIssue.value("result").toInt()) ); return; } else if (distributeInventory::SeriesAdjust(issueIssue.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Material Issue"), tr("Transaction Canceled") ); return; } issueIssue.exec("COMMIT;"); } else { rollback.exec(); systemError( this, tr("A System Error occurred at issueWoMaterialItem::%1, Work Order ID #%2.") .arg(__LINE__) .arg(_wo->id()) ); return; } if (_captive) close(); else { _close->setText(tr("Close")); _qtyToIssue->clear(); _womatl->setId(-1); _womatl->setFocus(); } } void issueWoMaterialItem::sSetQOH(int pWomatlid) { if (pWomatlid == -1) { _cachedQOH = 0.0; _beforeQty->clear(); _afterQty->clear(); } else { if (_wo->method() == "A") _qtyToIssue->setDouble(_womatl->qtyRequired() - _womatl->qtyIssued()); else _qtyToIssue->setDouble(_womatl->qtyIssued() * -1); XSqlQuery qoh; qoh.prepare( "SELECT itemuomtouom(itemsite_item_id, NULL, womatl_uom_id, itemsite_qtyonhand) AS qtyonhand," " uom_name " " FROM womatl, itemsite, uom" " WHERE((womatl_itemsite_id=itemsite_id)" " AND (womatl_uom_id=uom_id)" " AND (womatl_id=:womatl_id) );" ); qoh.bindValue(":womatl_id", pWomatlid); qoh.exec(); if (qoh.first()) { _uomQty->setText(qoh.value("uom_name").toString()); _cachedQOH = qoh.value("qtyonhand").toDouble(); _beforeQty->setDouble(_cachedQOH); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } sPopulateQOH(); } void issueWoMaterialItem::sPopulateQOH() { _afterQty->setDouble(_cachedQOH - _qtyToIssue->toDouble()); } qt-client-4.1.0/guiclient/issueWoMaterialItem.h000066400000000000000000000023661217451700100215110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ISSUEWOMATERIALITEM_H #define ISSUEWOMATERIALITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_issueWoMaterialItem.h" class issueWoMaterialItem : public XDialog, public Ui::issueWoMaterialItem { Q_OBJECT public: issueWoMaterialItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~issueWoMaterialItem(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCatchItemid( int pItemid ); virtual void sCatchItemsiteid( int pItemsiteid ); virtual void sIssue(); virtual void sSetQOH(int pWomatlid); virtual void sPopulateQOH(); protected slots: virtual void languageChange(); private: bool _captive; double _cachedQOH; }; #endif // ISSUEWOMATERIALITEM_H qt-client-4.1.0/guiclient/issueWoMaterialItem.ui000066400000000000000000000265701217451700100217020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. issueWoMaterialItem 0 0 522 520 Issue Work Order Material Item 12 12 Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 20 20 &Cancel false &Post true Qt::Vertical QSizePolicy::Expanding 20 20 Qt::StrongFocus Qt::Horizontal 40 20 Qty. to Issue: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyToIssue 0 0 80 32767 Qt::AlignRight UOM: Qt::AlignCenter 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter QOH Before: Qt::AlignCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QOH After: Qt::AlignCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 DLineEdit QWidget
    datecluster.h
    WoCluster QWidget
    wocluster.h
    WomatlCluster QWidget
    womatlcluster.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _transDate _wo _womatl _qtyToIssue _issue _close _wo valid(bool) _issue setEnabled(bool) 20 20 20 20 _close clicked() issueWoMaterialItem reject() 20 20 20 20 _wo newId(int) _womatl setWoid(int) 180 80 233 239
    qt-client-4.1.0/guiclient/item.cpp000066400000000000000000002261771217451700100170560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "item.h" #include #include #include #include #include #include #include #include #include #include #include #include "bom.h" #include "characteristicAssignment.h" #include "comment.h" #include "image.h" #include "itemAlias.h" #include "itemAvailabilityWorkbench.h" #include "itemcluster.h" #include "itemSite.h" #include "itemSubstitute.h" #include "itemUOM.h" #include "itemtax.h" #include "itemSource.h" #include "storedProcErrorLookup.h" const char *_itemTypes[] = { "P", "M", "F", "R", "S", "T", "O", "L", "K", "B", "C", "Y" }; item::item(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { XSqlQuery itemitem; setupUi(this); _notes->setSpellEnable(true); _mode=0; _itemid = -1; connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_itemNumber, SIGNAL(editingFinished()), this, SLOT(sFormatItemNumber())); connect(_inventoryUOM, SIGNAL(newID(int)), this, SLOT(sPopulateUOMs())); connect(_classcode, SIGNAL(newID(int)), this, SLOT(sPopulateUOMs())); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNew())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_itemtype, SIGNAL(activated(int)), this, SLOT(sHandleItemtype())); connect(_newAlias, SIGNAL(clicked()), this, SLOT(sNewAlias())); connect(_editAlias, SIGNAL(clicked()), this, SLOT(sEditAlias())); connect(_deleteAlias, SIGNAL(clicked()), this, SLOT(sDeleteAlias())); connect(_newSubstitute, SIGNAL(clicked()), this, SLOT(sNewSubstitute())); connect(_editSubstitute, SIGNAL(clicked()), this, SLOT(sEditSubstitute())); connect(_deleteSubstitute, SIGNAL(clicked()), this, SLOT(sDeleteSubstitute())); connect(_newTransform, SIGNAL(clicked()), this, SLOT(sNewTransformation())); connect(_deleteTransform, SIGNAL(clicked()), this, SLOT(sDeleteTransformation())); connect(_materials, SIGNAL(clicked()), this, SLOT(sEditBOM())); connect(_site, SIGNAL(clicked()), this, SLOT(sEditItemSite())); connect(_workbench, SIGNAL(clicked()), this, SLOT(sWorkbench())); connect(_deleteItemSite, SIGNAL(clicked()), this, SLOT(sDeleteItemSite())); connect(_viewItemSite, SIGNAL(clicked()), this, SLOT(sViewItemSite())); connect(_editItemSite, SIGNAL(clicked()), this, SLOT(sEditItemSite())); connect(_newItemSite, SIGNAL(clicked()), this, SLOT(sNewItemSite())); connect(_itemtaxNew, SIGNAL(clicked()), this, SLOT(sNewItemtax())); connect(_itemtaxEdit, SIGNAL(clicked()), this, SLOT(sEditItemtax())); connect(_itemtaxDelete, SIGNAL(clicked()), this, SLOT(sDeleteItemtax())); connect(_newUOM, SIGNAL(clicked()), this, SLOT(sNewUOM())); connect(_editUOM, SIGNAL(clicked()), this, SLOT(sEditUOM())); connect(_deleteUOM, SIGNAL(clicked()), this, SLOT(sDeleteUOM())); connect(_configured, SIGNAL(toggled(bool)), this, SLOT(sConfiguredToggled(bool))); connect(_notesButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_extDescripButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_commentsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_aliasesButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_substitutesButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_transformationsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_editSrc, SIGNAL(clicked()), this, SLOT(sEditSource())); connect(_newSrc, SIGNAL(clicked()), this, SLOT(sNewSource())); connect(_viewSrc, SIGNAL(clicked()), this, SLOT(sViewSource())); connect(_copySrc, SIGNAL(clicked()), this, SLOT(sCopySource())); connect(_deleteSrc, SIGNAL(clicked()), this, SLOT(sDeleteSource())); connect(_elementsButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_bomButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); _disallowPlanningType = false; _inTransaction = false; _listprice->setValidator(omfgThis->priceVal()); _listcost->setValidator(omfgThis->costVal()); _prodWeight->setValidator(omfgThis->weightVal()); _packWeight->setValidator(omfgThis->weightVal()); _classcode->setAllowNull(TRUE); _classcode->setType(XComboBox::ClassCodes); _freightClass->setAllowNull(TRUE); _freightClass->setType(XComboBox::FreightClasses); _prodcat->setAllowNull(TRUE); _prodcat->setType(XComboBox::ProductCategories); _inventoryUOM->setType(XComboBox::UOMs); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name" ); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value" ); _charass->addColumn(tr("Default"), _ynColumn*2, Qt::AlignCenter, true, "charass_default" ); _charass->addColumn(tr("List Price"), _priceColumn,Qt::AlignRight, true, "charass_price" ); _charass->hideColumn(3); _elements = new maintainItemCosts(this, "maintainItemCosts", Qt::Widget); _elementsPage->layout()->addWidget(_elements); _elements->findChild("_close")->hide(); _elements->findChild("_item")->hide(); _elements->findChild("_costingElementsLit")->hide(); _bom = new BOM(this, "BOM", Qt::Widget); _bomPage->layout()->addWidget(_bom); _bom->findChild("_item")->hide(); _bom->findChild("_itemLit")->hide(); _bom->findChild("_save")->hide(); _bom->findChild("_close")->hide(); _bom->findChild("_print")->hide(); _bom->findChild("_totalsGroup")->hide(); _bom->findChild("_costsGroup")->hide(); _bom->findChild("_showExpired")->hide(); _bom->findChild("_showFuture")->hide(); _bom->findChild("_documentNum")->hide(); _bom->findChild("_documentNumLit")->hide(); _bom->findChild("_batchSize")->hide(); _bom->findChild("_batchSizeLit")->hide(); _bom->findChild("_moveUp")->hide(); _bom->findChild("_moveDown")->hide(); // QPushButton *moreButton = new QPushButton(this); // moreButton->setText(tr("More")); // connect(moreButton, SIGNAL(clicked()), this, SLOT(sEditBOM())); // _bom->findChild("_formButtonsLayout")->addWidget(moreButton); ParameterList plist; if(_privileges->check("MaintainBOMs")) plist.append("mode", "edit"); else if (_privileges->check("ViewBOMs")) plist.append("mode", "view"); _bom->set(plist); _uomconv->addColumn(tr("Conversions/Where Used"), _itemColumn*2, Qt::AlignLeft, true, "uomname"); _uomconv->addColumn(tr("Ratio"), -1, Qt::AlignRight, true, "uomvalue" ); _uomconv->addColumn(tr("Global"), _ynColumn*2, Qt::AlignCenter, true, "global" ); _uomconv->addColumn(tr("Fractional"), _ynColumn*2, Qt::AlignCenter, true, "fractional" ); _itemsrc->addColumn(tr("Active"), _dateColumn, Qt::AlignCenter, true, "itemsrc_active"); _itemsrc->addColumn(tr("Vendor"), _itemColumn, Qt::AlignLeft, true, "vend_number" ); _itemsrc->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "vend_name" ); _itemsrc->addColumn(tr("Vendor Item"), _itemColumn, Qt::AlignLeft, true, "itemsrc_vend_item_number" ); _itemsrc->addColumn(tr("Manufacturer"), _itemColumn, Qt::AlignLeft, true, "itemsrc_manuf_name" ); _itemsrc->addColumn(tr("Manuf. Item#"), _itemColumn, Qt::AlignLeft, true, "itemsrc_manuf_item_number" ); _itemsrc->addColumn(tr("Default"), _dateColumn, Qt::AlignCenter, true, "default"); _itemalias->addColumn(tr("Alias Number"), _itemColumn, Qt::AlignLeft, true, "itemalias_number" ); _itemalias->addColumn(tr("Comments"), -1, Qt::AlignLeft, true, "itemalias_comments" ); _itemsub->addColumn(tr("Rank"), _whsColumn, Qt::AlignCenter, true, "itemsub_rank" ); _itemsub->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _itemsub->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip1" ); _itemsub->addColumn(tr("Ratio"), _qtyColumn, Qt::AlignRight, true, "itemsub_uomratio" ); _itemtrans->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _itemtrans->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); _itemSite->addColumn(tr("Active"), _dateColumn, Qt::AlignCenter, true, "itemsite_active" ); _itemSite->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _itemSite->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "warehous_descrip" ); _itemSite->addColumn(tr("Cntrl. Method"), _itemColumn, Qt::AlignCenter, true, "itemsite_controlmethod" ); _itemSite->setDragString("itemsiteid="); connect(omfgThis, SIGNAL(itemsitesUpdated()), SLOT(sFillListItemSites())); _itemtax->addColumn(tr("Tax Type"),_itemColumn, Qt::AlignLeft,true,"taxtype_name"); _itemtax->addColumn(tr("Tax Zone"), -1, Qt::AlignLeft,true,"taxzone"); if (_privileges->check("MaintainItemSources")) { connect(_itemsrc, SIGNAL(valid(bool)), _editSrc, SLOT(setEnabled(bool))); connect(_itemsrc, SIGNAL(valid(bool)), _viewSrc, SLOT(setEnabled(bool))); connect(_itemsrc, SIGNAL(valid(bool)), _copySrc, SLOT(setEnabled(bool))); connect(_itemsrc, SIGNAL(valid(bool)), _deleteSrc, SLOT(setEnabled(bool))); connect(_itemsrc, SIGNAL(itemSelected(int)), _editSrc, SLOT(animateClick())); _newSrc->setEnabled(_privileges->check("MaintainItemSources")); } else if (_privileges->check("ViewItemSources")) { connect(_itemsrc, SIGNAL(valid(bool)), _viewSrc, SLOT(setEnabled(bool))); connect(_itemsrc, SIGNAL(itemSelected(int)), _viewSrc, SLOT(animateClick())); } else _tab->setTabEnabled(_tab->indexOf(_sourcesTab), FALSE); if (!_metrics->boolean("Transforms")) _transformationsButton->hide(); if (!_metrics->boolean("MultiWhs")) _tab->removeTab(_tab->indexOf(_itemsitesTab)); else if (_privileges->check("MaintainItemSites")) { connect(_itemSite, SIGNAL(valid(bool)), _editItemSite, SLOT(setEnabled(bool))); connect(_itemSite, SIGNAL(valid(bool)), _viewItemSite, SLOT(setEnabled(bool))); connect(_itemSite, SIGNAL(itemSelected(int)), _editItemSite, SLOT(animateClick())); _newItemSite->setEnabled(_privileges->check("MaintainItemSites")); } else if (_privileges->check("ViewItemSites")) { connect(_itemSite, SIGNAL(valid(bool)), _viewItemSite, SLOT(setEnabled(bool))); connect(_itemSite, SIGNAL(itemSelected(int)), _viewItemSite, SLOT(animateClick())); } else _tab->setTabEnabled(_tab->indexOf(_itemsitesTab), FALSE); itemitem.exec("SELECT uom_name FROM uom WHERE (uom_item_weight);"); if (itemitem.first()) { QString title (tr("Weight in ")); title += itemitem.value("uom_name").toString(); _weightGroup->setTitle(title); } #ifdef Q_WS_MAC _tab->setUsesScrollButtons(true); _tab->setElideMode(Qt::ElideNone); #endif // TO DO: Implement later _taxRecoverable->hide(); } item::~item() { // no need to delete child widgets, Qt does it all for us } void item::languageChange() { retranslateUi(this); } enum SetResponse item::set(const ParameterList &pParams) { XSqlQuery itemet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) setId(param.toInt()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _tab->setEnabled(false); setObjectName("item new"); _mode = cNew; _newUOM->setEnabled(false); _print->hide(); itemet.exec("SELECT NEXTVAL('item_item_id_seq') AS item_id"); if (itemet.first()) _itemid = itemet.value("item_id").toInt(); // ToDo _comments->setId(_itemid); _documents->setId(_itemid); _exclusive->setChecked(_metrics->boolean("DefaultSoldItemsExclusive")); connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); connect(_uomconv, SIGNAL(valid(bool)), _editUOM, SLOT(setEnabled(bool))); connect(_uomconv, SIGNAL(valid(bool)), _deleteUOM, SLOT(setEnabled(bool))); connect(_itemalias, SIGNAL(valid(bool)), _editAlias, SLOT(setEnabled(bool))); connect(_itemalias, SIGNAL(valid(bool)), _deleteAlias, SLOT(setEnabled(bool))); connect(_itemsub, SIGNAL(valid(bool)), _editSubstitute, SLOT(setEnabled(bool))); connect(_itemsub, SIGNAL(valid(bool)), _deleteSubstitute, SLOT(setEnabled(bool))); connect(_itemtrans, SIGNAL(valid(bool)), _deleteTransform, SLOT(setEnabled(bool))); connect(_itemtax, SIGNAL(valid(bool)), _itemtaxEdit, SLOT(setEnabled(bool))); connect(_itemtax, SIGNAL(valid(bool)), _itemtaxDelete, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _tab->setEnabled(true); setObjectName(QString("item edit %1").arg(_itemid)); _mode = cEdit; connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); connect(_uomconv, SIGNAL(valid(bool)), _editUOM, SLOT(setEnabled(bool))); connect(_uomconv, SIGNAL(valid(bool)), _deleteUOM, SLOT(setEnabled(bool))); connect(_itemalias, SIGNAL(valid(bool)), _editAlias, SLOT(setEnabled(bool))); connect(_itemalias, SIGNAL(valid(bool)), _deleteAlias, SLOT(setEnabled(bool))); connect(_itemsub, SIGNAL(valid(bool)), _editSubstitute, SLOT(setEnabled(bool))); connect(_itemsub, SIGNAL(valid(bool)), _deleteSubstitute, SLOT(setEnabled(bool))); connect(_itemtrans, SIGNAL(valid(bool)), _deleteTransform, SLOT(setEnabled(bool))); connect(_itemtax, SIGNAL(valid(bool)), _itemtaxEdit, SLOT(setEnabled(bool))); connect(_itemtax, SIGNAL(valid(bool)), _itemtaxDelete, SLOT(setEnabled(bool))); if (_privileges->check("MaintainItemSites")) { connect(_itemSite, SIGNAL(valid(bool)), _editItemSite, SLOT(setEnabled(bool))); connect(_itemSite, SIGNAL(itemSelected(int)), _editItemSite, SLOT(animateClick())); } else { connect(_itemSite, SIGNAL(itemSelected(int)), _viewItemSite, SLOT(animateClick())); } if (_privileges->check("DeleteItemSites")) connect(_itemSite, SIGNAL(valid(bool)), _deleteItemSite, SLOT(setEnabled(bool))); _itemNumber->setEnabled(FALSE); } else if (param.toString() == "view") { _tab->setEnabled(true); setObjectName(QString("item view %1").arg(_itemid)); _mode = cView; _itemNumber->setEnabled(FALSE); _active->setEnabled(FALSE); _description1->setEnabled(FALSE); _description2->setEnabled(FALSE); _maximumDesiredCost->setEnabled(FALSE); _itemtype->setEnabled(FALSE); _sold->setEnabled(FALSE); _pickListItem->setEnabled(FALSE); _fractional->setEnabled(FALSE); _classcode->setEnabled(FALSE); _freightClass->setEnabled(FALSE); _inventoryUOM->setEnabled(FALSE); _prodWeight->setEnabled(FALSE); _packWeight->setEnabled(FALSE); _notes->setEnabled(FALSE); _comments->setReadOnly(TRUE); _documents->setReadOnly(TRUE); _extDescription->setReadOnly(TRUE); _newCharacteristic->setEnabled(FALSE); _newAlias->setEnabled(FALSE); _newSubstitute->setEnabled(FALSE); _newTransform->setEnabled(FALSE); _taxRecoverable->setEnabled(FALSE); _itemtaxNew->setEnabled(FALSE); _close->setText(tr("&Close")); _newSrc->setEnabled(false); _newUOM->setEnabled(false); _upcCode->setEnabled(false); _newItemSite->setEnabled(FALSE); _bom->findChild("_new")->hide(); _elements->findChild("_new")->hide(); disconnect(_itemalias, SIGNAL(valid(bool)), _editAlias, SLOT(setEnabled(bool))); disconnect(_itemalias, SIGNAL(valid(bool)), _deleteAlias, SLOT(setEnabled(bool))); disconnect(_itemsub, SIGNAL(valid(bool)), _editSubstitute, SLOT(setEnabled(bool))); disconnect(_itemsub, SIGNAL(valid(bool)), _deleteSubstitute, SLOT(setEnabled(bool))); disconnect(_itemtrans, SIGNAL(valid(bool)), _deleteTransform, SLOT(setEnabled(bool))); _save->hide(); } } sHandleRightButtons(); return NoError; } void item::saveCore() { XSqlQuery itemaveCore; if(cNew != _mode || _inTransaction) return; if (_inventoryUOM->id() == -1) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select an Inventory Unit of Measure for this Item before continuing.") ); _inventoryUOM->setFocus(); return; } else if (_classcode->id() == -1) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select a Class Code before continuing.") ); _classcode->setFocus(); return; } else { itemaveCore.exec("BEGIN;"); _inTransaction = true; itemaveCore.prepare("INSERT INTO item" " (item_id, item_number, item_Descrip1, item_descrip2," " item_classcode_id," " item_picklist, item_sold, item_fractional, item_active," " item_type," " item_prodweight, item_packweight, item_prodcat_id," " item_exclusive, item_listprice, item_listcost, item_maxcost," " item_inv_uom_id, item_price_uom_id)" "VALUES(:item_id, :item_number, '', ''," " :item_classcode_id," " false, false, false, :item_active," " :item_type," " 0.0, 0.0, -1," " true, 0.0, 0.0, 0.0," " :item_inv_uom_id, :item_inv_uom_id);"); itemaveCore.bindValue(":item_id", _itemid); itemaveCore.bindValue(":item_number", _itemNumber->text().trimmed().toUpper()); itemaveCore.bindValue(":item_type", _itemTypes[_itemtype->currentIndex()]); itemaveCore.bindValue(":item_classcode_id", _classcode->id()); itemaveCore.bindValue(":item_inv_uom_id", _inventoryUOM->id()); itemaveCore.bindValue(":item_active", QVariant(_active->isChecked())); if(!itemaveCore.exec() || itemaveCore.lastError().type() != QSqlError::NoError) { itemaveCore.exec("ROLLBACK;"); _inTransaction = false; return; } sPopulateUOMs(); // TODO: We can enable certain functionality here that needs a saved record _newUOM->setEnabled(true); _tab->setEnabled(true); sHandleRightButtons(); } } void item::sSave() { XSqlQuery itemSave; QString sql; QString itemNumber = _itemNumber->text().trimmed().toUpper(); //Check To see if the item has active sites associated with it int fActive = false; itemSave.prepare("SELECT itemsite_id " "FROM itemsite " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_active)) " "LIMIT 1; "); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) fActive = true; if(!_active->isChecked()) { itemSave.prepare("SELECT bomitem_id " "FROM bomitem, item " "WHERE ((bomitem_parent_item_id=item_id) " "AND (item_active) " "AND (bomitem_expires > current_date) " "AND (getActiveRevId('BOM',bomitem_parent_item_id)=bomitem_rev_id) " "AND (bomitem_item_id=:item_id)) " "LIMIT 1; "); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::warning( this, tr("Cannot Save Item"), tr("This Item is used in an active Bill of Materials and must be marked as active. " "Expire the Bill of Material items to allow this Item to not be active.") ); return; } if (fActive) { QMessageBox::warning( this, tr("Cannot Save Item"), tr("This Item is used in an active Item Site and must be marked as active. " "Deactivate the Item Sites to allow this Item to not be active.") ); return; } itemSave.prepare("SELECT itemsrc_id " "FROM itemsrc " "WHERE ((itemsrc_item_id=:item_id)" " AND (itemsrc_active)) " "LIMIT 1; "); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::warning( this, tr("Cannot Save Item"), tr("This Item is used in an active Item Source and must be marked as active. " "Deactivate the Item Sources to allow this Item to not be active.") ); return; } } if(_disallowPlanningType && QString(_itemTypes[_itemtype->currentIndex()]) == "L") { QMessageBox::warning( this, tr("Planning Type Disallowed"), tr("This item is part of one or more Bills of Materials and cannot be a Planning Item.") ); return; } if(QString(_itemTypes[_itemtype->currentIndex()]) == "K" && !_sold->isChecked()) { QMessageBox::warning( this, tr("Must be Sold"), tr("Kit item types must be Sold. Please mark this item as sold and set the appropriate options and save again.") ); return; } if(!_sold->isChecked()) { itemSave.prepare("SELECT bomitem_id " "FROM bomitem, item " "WHERE ((bomitem_parent_item_id=item_id) " "AND (item_active) " "AND (item_type='K') " "AND (bomitem_expires > current_date) " "AND (getActiveRevId('BOM',bomitem_parent_item_id)=bomitem_rev_id) " "AND (bomitem_item_id=:item_id)) " "LIMIT 1; "); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::warning( this, tr("Cannot Save Item"), tr("This item is used in an active bill of materials for a kit and must be marked as sold. " "Expire the bill of material items or deactivate the kit items to allow this item to not be sold.") ); return; } } if (cEdit == _mode && _itemtype->currentText() != _originalItemType && QString(_itemTypes[_itemtype->currentIndex()]) == "K") { itemSave.prepare("SELECT bomitem_id " "FROM bomitem, item " "WHERE ((bomitem_item_id=item_id) " "AND (item_active) " "AND (NOT item_sold) " "AND (bomitem_expires > current_date) " "AND (getActiveRevId('BOM',bomitem_parent_item_id)=bomitem_rev_id) " "AND (bomitem_parent_item_id=:item_id)) " "LIMIT 1; "); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { if(QMessageBox::question( this, tr("BOM Items should be marked as Sold"), tr("

    You have changed the Item Type of this " "Item to Kit. This Item has BOM Items associated " "with it that are not marked as Sold. " "Do you wish to continue saving?"), QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Escape | QMessageBox::Default ) == QMessageBox::Cancel) return; } } if (_mode == cEdit) { itemSave.prepare( "SELECT item_id " "FROM item " "WHERE ( (item_number=:item_number)" " AND (item_id <> :item_id) );" ); itemSave.bindValue(":item_number", itemNumber); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::warning( this, tr("Cannot Save Item"), tr("You may not rename this Item to the entered Item Number as it is in use by another Item.") ); _itemNumber->setFocus(); return; } } if (_itemNumber->text().length() == 0) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must enter a Item Number for this Item before continuing.") ); _itemNumber->setFocus(); return; } if (_itemtype->currentIndex() == -1) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select an Item Type for this Item Type before continuing.") ); _itemtype->setFocus(); return; } if (_classcode->currentIndex() == -1) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select a Class Code for this Item before continuing.") ); _classcode->setFocus(); return; } if (_inventoryUOM->id() == -1) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select an Inventory Unit of Measure for this Item before continuing.") ); _inventoryUOM->setFocus(); return; } if ((_sold->isChecked()) && (_prodcat->id() == -1)) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select a Product Category for this Sold Item before continuing.") ); _prodcat->setFocus(); return; } if ((_sold->isChecked()) && (_priceUOM->id() == -1)) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select a Selling UOM for this Sold Item before continuing.") ); return; } if (_classcode->id() == -1) { QMessageBox::information( this, tr("Cannot Save Item"), tr("You must select a Class Code for this Item before continuing.") ); _classcode->setFocus(); return; } if (cEdit == _mode && _itemtype->currentText() != _originalItemType) { if ((QString(_itemTypes[_itemtype->currentIndex()]) == "R") || (QString(_itemTypes[_itemtype->currentIndex()]) == "S") || (QString(_itemTypes[_itemtype->currentIndex()]) == "T") || (QString(_itemTypes[_itemtype->currentIndex()]) == "F")) { itemSave.prepare( "SELECT itemsite_id " " FROM itemsite " " WHERE ((itemsite_item_id=:item_id) " " AND (itemsite_qtyonhand + qtyallocated(itemsite_id,startoftime(),endoftime()) +" " qtyordered(itemsite_id,startoftime(),endoftime()) != 0 ));" ); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::information(this, tr("Cannot Save Item"), tr("

    This Item has Item Sites with either " "on hand quantities or pending inventory " "activity. This item type does not allow " "on hand balances or inventory activity.")); _itemtype->setFocus(); return; } } itemSave.prepare( "SELECT itemcost_id " " FROM itemcost " " WHERE (itemcost_item_id=:item_id);" ); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { if(QMessageBox::question( this, tr("Item Costs Exist"), tr("

    You have changed the Item Type of this " "Item. This Item has Item Costs associated " "with it that will be deleted before this " "change may occur. Do you wish to continue " "saving and delete the Item Costs?"), QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Escape | QMessageBox::Default ) == QMessageBox::Cancel) return; } itemSave.prepare( "SELECT itemsite_id " " FROM itemsite " " WHERE (itemsite_item_id=:item_id);" ); itemSave.bindValue(":item_id", _itemid); itemSave.exec(); if (itemSave.first()) { if(QMessageBox::question( this, tr("Item Sites Exist"), tr("

    You have changed the Item Type of this " "Item. To ensure Item Sites do not have " "invalid settings, all Item Sites for it " "will be inactivated before this change " "may occur. You may afterward edit " "the Item Sites, enter valid information, " "and reactivate them. Do you wish to " "continue saving and inactivate the Item " "Sites?"), QMessageBox::Ok, QMessageBox::Cancel | QMessageBox::Escape | QMessageBox::Default ) == QMessageBox::Cancel) return; } } // look for all of the uom ids we have associated with this item QStringList knownunits; itemSave.prepare("SELECT :uom_id AS uom_id " "UNION " "SELECT itemuomconv_from_uom_id " "FROM itemuomconv " "WHERE (itemuomconv_item_id=:item_id) " "UNION " "SELECT itemuomconv_to_uom_id " "FROM itemuomconv " "WHERE (itemuomconv_item_id=:item_id);" ); itemSave.bindValue(":item_id", _itemid); itemSave.bindValue(":uom_id", _inventoryUOM->id()); itemSave.exec(); while (itemSave.next()) knownunits.append(itemSave.value("uom_id").toString()); if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return; } sql = "SELECT DISTINCT uom_name " "FROM uomUsedForItem() " "WHERE (uom_id NOT IN ());" ; MetaSQLQuery mql(sql); ParameterList params; params.append("item_id", _itemid); params.append("knownunits", knownunits.join(", ")); itemSave = mql.toQuery(params); itemSave.exec(); QStringList missingunitnames; while (itemSave.next()) missingunitnames.append(itemSave.value("uom_name").toString()); if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (missingunitnames.size() > 0) { int answer = QMessageBox::question(this, tr("Add conversions?"), tr("

    There are records referring to this Item " "that do not have UOM Conversions to %1. Would " "you like to create UOM Conversions now?

    If " "you answer No then the Item will be saved and " "you may encounter errors later. The units " "without conversions are:
    %2") .arg(_inventoryUOM->currentText()) .arg(missingunitnames.join(", ")), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); if (answer == QMessageBox::Yes) { _tab->setCurrentIndex(_tab->indexOf(_tabUOM)); return; } } int sourceItemid = _itemid; if (_mode == cCopy) { itemSave.exec("SELECT NEXTVAL('item_item_id_seq') AS _item_id"); if (itemSave.first()) _itemid = itemSave.value("_item_id").toInt(); // ToDo } if ( (_mode == cNew && !_inTransaction) || (_mode == cCopy) ) sql = "INSERT INTO item " "( item_id, item_number, item_active," " item_descrip1, item_descrip2," " item_type, item_inv_uom_id, item_classcode_id," " item_picklist, item_sold, item_fractional," " item_maxcost, item_prodweight, item_packweight," " item_prodcat_id, item_price_uom_id," " item_exclusive," " item_listprice, item_listcost," " item_upccode, item_config," " item_comments, item_extdescrip, item_warrdays, item_freightclass_id," " item_tax_recoverable ) " "VALUES " "( :item_id, :item_number, :item_active," " :item_descrip1, :item_descrip2," " :item_type, :item_inv_uom_id, :item_classcode_id," " :item_picklist, :item_sold, :item_fractional," " :item_maxcost, :item_prodweight, :item_packweight," " :item_prodcat_id, :item_price_uom_id," " :item_exclusive," " :item_listprice, :item_listcost," " :item_upccode, :item_config," " :item_comments, :item_extdescrip, :item_wardays, :item_freightclass_id," " :item_tax_recoverable );" ; else if ((_mode == cEdit) || (cNew == _mode && _inTransaction)) sql = "UPDATE item " "SET item_number=:item_number, item_descrip1=:item_descrip1, item_descrip2=:item_descrip2," " item_type=:item_type, item_inv_uom_id=:item_inv_uom_id, item_classcode_id=:item_classcode_id," " item_picklist=:item_picklist, item_sold=:item_sold, item_fractional=:item_fractional," " item_active=:item_active," " item_maxcost=:item_maxcost, item_prodweight=:item_prodweight, item_packweight=:item_packweight," " item_prodcat_id=:item_prodcat_id," " item_price_uom_id=:item_price_uom_id," " item_exclusive=:item_exclusive," " item_listprice=:item_listprice, item_listcost=:item_listcost," " item_upccode=:item_upccode, item_config=:item_config," " item_comments=:item_comments, item_extdescrip=:item_extdescrip, item_warrdays=:item_warrdays," " item_freightclass_id=:item_freightclass_id," " item_tax_recoverable=:item_tax_recoverable " "WHERE (item_id=:item_id);"; itemSave.prepare(sql); itemSave.bindValue(":item_id", _itemid); itemSave.bindValue(":item_number", itemNumber); itemSave.bindValue(":item_descrip1", _description1->text()); itemSave.bindValue(":item_descrip2", _description2->text()); itemSave.bindValue(":item_type", _itemTypes[_itemtype->currentIndex()]); itemSave.bindValue(":item_classcode_id", _classcode->id()); itemSave.bindValue(":item_sold", QVariant(_sold->isChecked())); itemSave.bindValue(":item_prodcat_id", _prodcat->id()); itemSave.bindValue(":item_exclusive", QVariant(_exclusive->isChecked())); itemSave.bindValue(":item_price_uom_id", _priceUOM->id()); itemSave.bindValue(":item_listprice", _listprice->toDouble()); itemSave.bindValue(":item_listcost", _listcost->toDouble()); itemSave.bindValue(":item_upccode", _upcCode->text()); itemSave.bindValue(":item_active", QVariant(_active->isChecked())); itemSave.bindValue(":item_picklist", QVariant(_pickListItem->isChecked())); itemSave.bindValue(":item_fractional", QVariant(_fractional->isChecked())); itemSave.bindValue(":item_config", QVariant(_configured->isChecked())); itemSave.bindValue(":item_inv_uom_id", _inventoryUOM->id()); itemSave.bindValue(":item_maxcost", _maximumDesiredCost->localValue()); itemSave.bindValue(":item_prodweight", _prodWeight->toDouble()); itemSave.bindValue(":item_packweight", _packWeight->toDouble()); itemSave.bindValue(":item_comments", _notes->toPlainText()); itemSave.bindValue(":item_extdescrip", _extDescription->toPlainText()); itemSave.bindValue(":item_warrdays", _warranty->value()); if (_freightClass->isValid()) itemSave.bindValue(":item_freightclass_id", _freightClass->id()); itemSave.bindValue(":item_tax_recoverable", QVariant(_taxRecoverable->isChecked())); itemSave.exec(); if (itemSave.lastError().type() != QSqlError::NoError) { itemSave.exec("ROLLBACK;"); _inTransaction = false; systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cCopy) { // Copy all of the costs for this item itemSave.prepare( "INSERT INTO itemcost " "(itemcost_item_id, itemcost_costelem_id, itemcost_lowlevel," " itemcost_stdcost, itemcost_posted, itemcost_actcost, " " itemcost_updated, itemcost_curr_id ) " "SELECT :item_id, itemcost_costelem_id, itemcost_lowlevel," " itemcost_stdcost, itemcost_posted, itemcost_actcost, " " itemcost_updated, itemcost_curr_id " "FROM itemcost " "WHERE (itemcost_item_id=:sourceItem_id);" ); itemSave.bindValue(":item_id", _itemid); itemSave.bindValue(":sourceItem_id", sourceItemid); itemSave.exec(); } if(_inTransaction) { itemSave.exec("COMMIT;"); _inTransaction = false; } omfgThis->sItemsUpdated(_itemid, TRUE); if ((!fActive) && ( (_mode == cNew) || (_mode == cCopy) ) && (_privileges->check("MaintainItemSites")) && ( (*_itemTypes[_itemtype->currentIndex()] != 'B') || (*_itemTypes[_itemtype->currentIndex()] != 'F') || (*_itemTypes[_itemtype->currentIndex()] != 'R') || (*_itemTypes[_itemtype->currentIndex()] != 'S') ) ) { if (QMessageBox::information( this, tr("Create New Item Sites"), tr("Would you like to create Item site inventory settings for the newly created Item now?"), tr("&Yes"), tr("&No"), QString::null, 0, 1) == 0) { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); itemSite newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } if(_bomButton->isEnabled() && _bomButton->isChecked()) _bom->sSave(); emit saved(_itemid); close(); } void item::sNew() { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); if (_configured->isChecked()) params.append("showPrices", TRUE); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void item::sEdit() { QString itemType = QString(*(_itemTypes + _itemtype->currentIndex())); ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); if (_configured->isChecked()) params.append("showPrices", TRUE); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void item::sDelete() { XSqlQuery itemDelete; itemDelete.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); itemDelete.bindValue(":charass_id", _charass->id()); itemDelete.exec(); sFillList(); } void item::sFillList() { XSqlQuery itemFillList; itemFillList.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value, " " charass_default, " " charass_price, 'salesprice' AS charass_price_xtnumericrole " "FROM charass, char " "WHERE ( (charass_target_type='I')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:item_id) ) " "ORDER BY char_order, char_name;" ); itemFillList.bindValue(":item_id", _itemid); itemFillList.exec(); _charass->populate(itemFillList); } void item::sPrint() { if (_itemid != -1) { ParameterList params; params.append("item_id", _itemid); params.append("print"); orReport report("ItemMaster", params); if (report.isValid()) report.print(); else report.reportError(this); } // ToDo } void item::sFormatItemNumber() { XSqlQuery itemFormatItemNumber; if ((_mode == cNew) && (_itemNumber->text().length())) { _itemNumber->setText(_itemNumber->text().trimmed().toUpper()); // Check to see if this item exists itemFormatItemNumber.prepare( "SELECT item_id " "FROM item " "WHERE (item_number=:item_number);" ); itemFormatItemNumber.bindValue(":item_number", _itemNumber->text()); itemFormatItemNumber.exec(); if (itemFormatItemNumber.first()) { _mode = cEdit; ParameterList params; params.append("item_id", itemFormatItemNumber.value("item_id").toInt()); params.append("mode", "edit"); set(params); } else { _itemNumber->setEnabled(FALSE); _mode = cNew; } } } void item::populate() { XSqlQuery item; item.prepare( "SELECT *," " ( (item_type IN ('P', 'M', 'C', 'Y', 'R', 'A')) AND (item_sold) ) AS sold " "FROM item " "WHERE (item_id=:item_id);" ); item.bindValue(":item_id", _itemid); item.exec(); if (item.first()) { if (_mode != cCopy) _itemNumber->setText(item.value("item_number")); for (int counter = 0; counter < _itemtype->count(); counter++) { if (QString(item.value("item_type").toString()[0]) == _itemTypes[counter]) { _itemtype->setCurrentIndex(counter); sHandleItemtype(); } } _originalItemType = _itemtype->currentText(); XSqlQuery checkBOM; if(cCopy != _mode && QString(item.value("item_type").toString()[0]) == "L") { checkBOM.prepare("SELECT bomitem_id FROM bomitem WHERE (bomitem_parent_item_id=:item_id); "); checkBOM.bindValue(":item_id", _itemid); checkBOM.exec(); if(checkBOM.first()) _itemtype->setEnabled(false); } else { checkBOM.prepare("SELECT bomitem_id FROM bomitem WHERE (bomitem_item_id=:item_id); "); checkBOM.bindValue(":item_id", _itemid); checkBOM.exec(); if(checkBOM.first()) _disallowPlanningType = true; } _active->setChecked(item.value("item_active").toBool()); _description1->setText(item.value("item_descrip1")); _description2->setText(item.value("item_descrip2")); _classcode->setId(item.value("item_classcode_id").toInt()); _freightClass->setId(item.value("item_freightclass_id").toInt()); _inventoryUOM->setId(item.value("item_inv_uom_id").toInt()); _pickListItem->setChecked(item.value("item_picklist").toBool()); _fractional->setChecked(item.value("item_fractional").toBool()); _configured->setChecked(item.value("item_config").toBool()); _prodWeight->setDouble(item.value("item_prodweight").toDouble()); _packWeight->setDouble(item.value("item_packweight").toDouble()); _maximumDesiredCost->setLocalValue(item.value("item_maxcost").toDouble()); _notes->setText(item.value("item_comments").toString()); _extDescription->setText(item.value("item_extdescrip").toString()); _sold->setChecked(item.value("item_sold").toBool()); _prodcat->setId(item.value("item_prodcat_id").toInt()); _upcCode->setText(item.value("item_upccode")); _exclusive->setChecked(item.value("item_exclusive").toBool()); _listprice->setDouble(item.value("item_listprice").toDouble()); _listcost->setDouble(item.value("item_listcost").toDouble()); _priceUOM->setId(item.value("item_price_uom_id").toInt()); _warranty->setValue(item.value("item_warrdays").toInt()); _taxRecoverable->setChecked(item.value("item_tax_recoverable").toBool()); sFillList(); _bom->findChild("_item")->setId(_itemid); _elements->findChild("_item")->setId(_itemid); sFillUOMList(); sFillSourceList(); sFillAliasList(); sFillSubstituteList(); sFillTransformationList(); sFillListItemSites(); sFillListItemtax(); _comments->setId(_itemid); _documents->setId(_itemid); } // ToDo } void item::clear() { XSqlQuery itemclear; _disallowPlanningType = false; itemclear.exec("SELECT NEXTVAL('item_item_id_seq') AS item_id"); if (itemclear.first()) _itemid = itemclear.value("item_id").toInt(); // ToDo _itemNumber->clear(); _description1->clear(); _description2->clear(); _inventoryUOM->clear(); _priceUOM->clear(); _listprice->clear(); _listcost->clear(); _active->setChecked(TRUE); _pickListItem->setChecked(TRUE); _sold->setChecked(FALSE); _exclusive->setChecked(_metrics->boolean("DefaultSoldItemsExclusive")); _fractional->setChecked(FALSE); _itemtype->setCurrentIndex(0); _classcode->setNull(); _freightClass->setNull(); _prodcat->setNull(); _configured->setChecked(false); _notes->clear(); _extDescription->clear(); _charass->clear(); _uomconv->clear(); _comments->setId(_itemid); _documents->setId(_itemid); _itemalias->clear(); _itemsub->clear(); _itemtax->clear(); } void item::sPopulateUOMs() { if ((_inventoryUOM->id() != -1) && (_classcode->id()!=-1)) { saveCore(); sPopulatePriceUOMs(); if (_priceUOM->id()==-1) _priceUOM->setId(_inventoryUOM->id()); } } void item::sHandleItemtype() { QString itemType = QString(*(_itemTypes + _itemtype->currentIndex())); bool pickList = FALSE; bool sold = FALSE; bool weight = FALSE; bool config = FALSE; bool shipUOM = FALSE; bool capUOM = FALSE; bool planType = FALSE; bool purchased = FALSE; bool freight = FALSE; _configured->setEnabled(FALSE); if (itemType == "P") { pickList = TRUE; sold = TRUE; weight = TRUE; capUOM = TRUE; shipUOM = TRUE; planType = TRUE; purchased = TRUE; freight = TRUE; } if (itemType == "M") { pickList = TRUE; sold = TRUE; weight = TRUE; config = TRUE; capUOM = TRUE; shipUOM = TRUE; planType = TRUE; purchased = TRUE; freight = TRUE; } if (itemType == "F") planType = TRUE; if (itemType == "B") { capUOM = TRUE; planType = TRUE; purchased = TRUE; freight = TRUE; } if (itemType == "C") { pickList = TRUE; sold = TRUE; weight = TRUE; capUOM = TRUE; shipUOM = TRUE; planType = TRUE; freight = TRUE; } if (itemType == "Y") { pickList = TRUE; sold = TRUE; weight = TRUE; capUOM = TRUE; shipUOM = TRUE; planType = TRUE; freight = TRUE; } if (itemType == "R") { sold = TRUE; weight = TRUE; capUOM = TRUE; shipUOM = TRUE; freight = TRUE; config = TRUE; } if (itemType == "T") { pickList = TRUE; weight = TRUE; capUOM = TRUE; shipUOM = TRUE; freight = TRUE; purchased = TRUE; sold = TRUE; } if (itemType == "O") { capUOM = TRUE; planType = TRUE; purchased = TRUE; freight = TRUE; } if (itemType == "A") { sold = TRUE; planType = TRUE; freight = TRUE; } if (itemType == "K") { sold = true; weight = true; _fractional->setChecked(false); } _fractional->setEnabled(itemType!="K"); _tab->setTabEnabled(_tab->indexOf(_tabUOM),(itemType!="K")); _transformationsButton->setEnabled(itemType!="K"); _configured->setEnabled(config); if (!config) _configured->setChecked(false); _pickListItem->setChecked(pickList); _pickListItem->setEnabled(pickList); _sold->setChecked(sold); _sold->setEnabled(sold); _prodWeight->setEnabled(weight); _packWeight->setEnabled(weight); _freightClass->setEnabled(freight); _tab->setTabEnabled(_tab->indexOf(_sourcesTab), (_privileges->check("ViewItemSources") || _privileges->check("MaintainItemSources")) && purchased); sHandleRightButtons(); } void item::sNewAlias() { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); params.append("item_number", _itemNumber->text()); itemAlias newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillAliasList(); } void item::sEditAlias() { ParameterList params; params.append("mode", "edit"); params.append("itemalias_id", _itemalias->id()); params.append("item_number", _itemNumber->text()); itemAlias newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillAliasList(); } void item::sDeleteAlias() { XSqlQuery itemDeleteAlias; itemDeleteAlias.prepare( "DELETE FROM itemalias " "WHERE (itemalias_id=:itemalias_id);" ); itemDeleteAlias.bindValue(":itemalias_id", _itemalias->id()); itemDeleteAlias.exec(); sFillAliasList(); } void item::sFillAliasList() { XSqlQuery itemFillAliasList; itemFillAliasList.prepare( "SELECT itemalias_id, itemalias_number, firstLine(itemalias_comments) AS itemalias_comments " "FROM itemalias " "WHERE (itemalias_item_id=:item_id) " "ORDER BY itemalias_number;" ); itemFillAliasList.bindValue(":item_id", _itemid); itemFillAliasList.exec(); _itemalias->populate(itemFillAliasList); } void item::sNewSubstitute() { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); itemSubstitute newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillSubstituteList(); } void item::sEditSubstitute() { ParameterList params; params.append("mode", "edit"); params.append("itemsub_id", _itemsub->id()); itemSubstitute newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillSubstituteList(); } void item::sDeleteSubstitute() { XSqlQuery itemDeleteSubstitute; itemDeleteSubstitute.prepare( "DELETE FROM itemsub " "WHERE (itemsub_id=:itemsub_id);" ); itemDeleteSubstitute.bindValue(":itemsub_id", _itemsub->id()); itemDeleteSubstitute.exec(); sFillSubstituteList(); } void item::sFillSubstituteList() { XSqlQuery itemFillSubstituteList; itemFillSubstituteList.prepare( "SELECT itemsub_id, itemsub_rank, item_number, item_descrip1," " itemsub_uomratio, 'uomratio' AS itemsub_uomratio_xtnumericrole " "FROM itemsub, item " "WHERE ( (itemsub_sub_item_id=item_id)" " AND (itemsub_parent_item_id=:item_id) ) " "ORDER BY itemsub_rank, item_number" ); itemFillSubstituteList.bindValue(":item_id", _itemid); itemFillSubstituteList.exec(); _itemsub->populate(itemFillSubstituteList); } void item::sNewTransformation() { XSqlQuery itemNewTransformation; ParameterList params; params.append("itemType", ItemLineEdit::cAllItemTypes_Mask ^ ItemLineEdit::cPhantom); itemList* newdlg = new itemList(this); newdlg->set(params); int itemid = newdlg->exec(); if (itemid != -1) { itemNewTransformation.prepare( "SELECT itemtrans_id " "FROM itemtrans " "WHERE ( (itemtrans_source_item_id=:source_item_id)" " AND (itemtrans_target_item_id=:target_item_id) );" ); itemNewTransformation.bindValue(":source_item_id", _itemid); itemNewTransformation.bindValue(":target_item_id", itemid); itemNewTransformation.exec(); if (itemNewTransformation.first()) { QMessageBox::warning( this, tr("Cannot Duplicate Transformation"), tr("The selected Item is already a Transformation target for this Item.") ); return; } itemNewTransformation.prepare( "INSERT INTO itemtrans " "( itemtrans_source_item_id, itemtrans_target_item_id )" "VALUES " "( :source_item_id, :target_item_id );" ); itemNewTransformation.bindValue(":source_item_id", _itemid); itemNewTransformation.bindValue(":target_item_id", itemid); itemNewTransformation.exec(); sFillTransformationList(); } } void item::sDeleteTransformation() { XSqlQuery itemDeleteTransformation; itemDeleteTransformation.prepare( "DELETE FROM itemtrans " "WHERE (itemtrans_id=:itemtrans_id);" ); itemDeleteTransformation.bindValue(":itemtrans_id", _itemtrans->id()); itemDeleteTransformation.exec(); sFillTransformationList(); } void item::sFillTransformationList() { XSqlQuery itemFillTransformationList; itemFillTransformationList.prepare( "SELECT itemtrans_id," " item_number, (item_descrip1 || ' ' || item_descrip2) as item_descrip " "FROM itemtrans, item " "WHERE ( (itemtrans_target_item_id=item_id)" " AND (itemtrans_source_item_id=:item_id) ) " "ORDER BY item_number;" ); itemFillTransformationList.bindValue(":item_id", _itemid); itemFillTransformationList.exec(); _itemtrans->populate(itemFillTransformationList); } void item::newItem() { // Check for an Item window in new mode already. QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); ++i) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), "item new")==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "new"); item *newdlg = new item(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void item::editItem( int pId ) { // Check for an Item window in edit mode for the specified item already. QString n = QString("item edit %1").arg(pId); QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); ++i) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), n)==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "edit"); params.append("item_id", pId); item *newdlg = new item(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void item::viewItem( int pId ) { // Check for an Item window in edit mode for the specified item already. QString n = QString("item view %1").arg(pId); QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); ++i) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), n)==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "view"); params.append("item_id", pId); item *newdlg = new item(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void item::sEditBOM() { ParameterList params; if(_privileges->check("MaintainBOMs") && _mode != cView) params.append("mode", "edit"); else params.append("mode", "view"); params.append("item_id", _itemid); BOM *newdlg = new BOM(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); /* XDialog *newdlg = new XDialog(this); _bomwin = new BOM(this); QGridLayout *layout = new QGridLayout; layout->setMargin(0); _bomwin->set(params); layout->addWidget(_bomwin); newdlg->setLayout(layout); newdlg->setWindowTitle(_bomwin->windowTitle()); connect(_bomwin->_close, SIGNAL(clicked()), newdlg, SLOT(close())); disconnect(_bomwin->_save, SIGNAL(clicked()), _bomwin, SLOT(sSave())); connect(_bomwin->_save, SIGNAL(clicked()), this, SLOT(sSaveBom())); newdlg->exec(); */ _bom->sFillList(); } void item::sSaveBom() { if (_bomwin->sSave()) _bomwin->parentWidget()->close(); } void item::sWorkbench() { ParameterList params; params.append("item_id", _itemid); itemAvailabilityWorkbench *newdlg = new itemAvailabilityWorkbench(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void item::sNewItemSite() { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); itemSite newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void item::sEditItemSite() { XSqlQuery itemEditItemSite; ParameterList params; if (_mode == cEdit || _mode == cNew) params.append("mode", "edit"); else params.append("mode", "view"); if (!_metrics->boolean("MultiWhs")) { itemEditItemSite.prepare("SELECT itemsite_id " "FROM itemsite " "WHERE (itemsite_item_id=:item_id AND itemsite_active);"); itemEditItemSite.bindValue(":item_id",_itemid); itemEditItemSite.exec(); if (itemEditItemSite.first()) params.append("itemsite_id", itemEditItemSite.value("itemsite_id").toInt()); else { itemEditItemSite.prepare("SELECT itemsite_id " "FROM itemsite " "WHERE (itemsite_item_id=:item_id);"); itemEditItemSite.bindValue(":item_id",_itemid); itemEditItemSite.exec(); if (itemEditItemSite.first()) params.append("itemsite_id", itemEditItemSite.value("itemsite_id").toInt()); else { if((_mode == cEdit) && (QMessageBox::question(this, tr("No Item Site Found"), tr("There is no Item Site for this item. Would you like to create one now?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)) sNewItemSite(); else if(_mode != cEdit) QMessageBox::information(this, tr("No Item Site Found"), tr("There is no Item Site for this item.")); return; } } } else { if (!checkSitePrivs(_itemSite->id())) return; else params.append("itemsite_id", _itemSite->id()); } itemSite newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void item::sViewItemSite() { if (!checkSitePrivs(_itemSite->id())) return; ParameterList params; params.append("mode", "view"); params.append("itemsite_id", _itemSite->id()); itemSite newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void item::sDeleteItemSite() { XSqlQuery itemDeleteItemSite; if (!checkSitePrivs(_itemSite->id())) return; itemDeleteItemSite.prepare("SELECT deleteItemSite(:itemsite_id) AS result;"); itemDeleteItemSite.bindValue(":itemsite_id", _itemSite->id()); itemDeleteItemSite.exec(); if (itemDeleteItemSite.first()) { switch (itemDeleteItemSite.value("result").toInt()) { case -1: QMessageBox::warning( this, tr("Cannot Delete Item Site"), tr( "The selected Item Site cannot be deleted as there is Inventory History posted against it.\n" "You may edit the Item Site and deactivate it." ) ); return; case -2: QMessageBox::warning( this, tr("Cannot Delete Item Site"), tr( "The selected Item Site cannot be deleted as there is Work Order History posted against it.\n" "You may edit the Item Site and deactivate it." ) ); return; case -3: QMessageBox::warning( this, tr("Cannot Delete Item Site"), tr( "The selected Item Site cannot be deleted as there is Sales History posted against it.\n" "You may edit the Item Site and deactivate it." ) ); return; case -4: QMessageBox::warning( this, tr("Cannot Delete Item Site"), tr( "The selected Item Site cannot be deleted as there is Purchasing History posted against it.\n" "You may edit the Item Site and deactivate it." ) ); return; case -5: QMessageBox::warning( this, tr("Cannot Delete Item Site"), tr( "The selected Item Site cannot be deleted as there is Planning History posted against it.\n" "You may edit the Item Site and deactivate it." ) ); return; case -9: QMessageBox::warning( this, tr("Cannot Delete Item Site"), tr("The selected Item Site cannot be deleted as there is a non-zero Inventory Quantity posted againt it.") ); return; default: // ToDo case 0: sFillListItemSites(); break; } } // ToDo } void item::sFillListItemSites() { XSqlQuery itemFillListItemSites; QString sql( "SELECT itemsite_id, itemsite_active," " warehous_code, warehous_descrip, " " CASE WHEN itemsite_controlmethod='R' THEN :regular" " WHEN itemsite_controlmethod='N' THEN :none" " WHEN itemsite_controlmethod='L' THEN :lotNumber" " WHEN itemsite_controlmethod='S' THEN :serialNumber" " END AS itemsite_controlmethod " "FROM itemsite, item, whsinfo " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id) " " AND (item_id=:item_id) ) " "ORDER BY item_number, warehous_code;" ); itemFillListItemSites.prepare(sql); itemFillListItemSites.bindValue(":item_id", _itemid); itemFillListItemSites.bindValue(":regular", tr("Regular")); itemFillListItemSites.bindValue(":none", tr("None")); itemFillListItemSites.bindValue(":lotNumber", tr("Lot #")); itemFillListItemSites.bindValue(":serialNumber", tr("Serial #")); itemFillListItemSites.exec(); _itemSite->populate(itemFillListItemSites); } void item::sNewItemtax() { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); itemtax newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillListItemtax(); } void item::sEditItemtax() { ParameterList params; params.append("mode", "edit"); params.append("itemtax_id", _itemtax->id()); itemtax newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillListItemtax(); } void item::sDeleteItemtax() { XSqlQuery itemDeleteItemtax; itemDeleteItemtax.prepare("DELETE FROM itemtax" " WHERE (itemtax_id=:itemtax_id);"); itemDeleteItemtax.bindValue(":itemtax_id", _itemtax->id()); itemDeleteItemtax.exec(); sFillListItemtax(); } void item::sFillListItemtax() { XSqlQuery itemFillListItemtax; itemFillListItemtax.prepare("SELECT itemtax_id, taxtype_name," " COALESCE(taxzone_code,:any) AS taxzone" " FROM itemtax JOIN taxtype ON (itemtax_taxtype_id=taxtype_id)" " LEFT OUTER JOIN taxzone ON (itemtax_taxzone_id=taxzone_id)" " WHERE (itemtax_item_id=:item_id)" " ORDER BY taxtype_name;"); itemFillListItemtax.bindValue(":item_id", _itemid); itemFillListItemtax.bindValue(":any", tr("Any")); itemFillListItemtax.exec(); _itemtax->populate(itemFillListItemtax, _itemtax->id()); if (itemFillListItemtax.lastError().type() != QSqlError::NoError) { systemError(this, itemFillListItemtax.lastError().databaseText(), __FILE__, __LINE__); return; } } void item::sNewUOM() { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); params.append("inventoryUOM", _inventoryUOM->id()); itemUOM newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillUOMList(); } void item::sEditUOM() { ParameterList params; params.append("mode", "edit"); params.append("itemuomconv_id", _uomconv->id()); itemUOM newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillUOMList(); } void item::sDeleteUOM() { XSqlQuery itemDeleteUOM; itemDeleteUOM.prepare("SELECT deleteItemUOMConv(:itemuomconv_id) AS result;"); itemDeleteUOM.bindValue(":itemuomconv_id", _uomconv->id()); itemDeleteUOM.exec(); if (itemDeleteUOM.first()) { int result = itemDeleteUOM.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteItemUOMConv", result), __FILE__, __LINE__); return; } } else if (itemDeleteUOM.lastError().type() != QSqlError::NoError) { systemError(this, itemDeleteUOM.lastError().databaseText(), __FILE__, __LINE__); return; } sFillUOMList(); } void item::sFillUOMList() { XSqlQuery itemFillUOMList; itemFillUOMList.prepare("SELECT * FROM ( " "SELECT itemuomconv_id, -1 AS itemuom_id, 0 AS xtindentrole, " " (nuom.uom_name||'/'||duom.uom_name) AS uomname," " (formatUOMRatio(itemuomconv_from_value)||'/'||formatUOMRatio(itemuomconv_to_value)) AS uomvalue," " (uomconv_id IS NOT NULL) AS global," " itemuomconv_fractional AS fractional" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom AS nuom ON (itemuomconv_from_uom_id=nuom.uom_id)" " JOIN uom AS duom ON (itemuomconv_to_uom_id=duom.uom_id)" " JOIN itemuom ON (itemuom_itemuomconv_id=itemuomconv_id)" " LEFT OUTER JOIN uomconv ON ((uomconv_from_uom_id=duom.uom_id AND uomconv_to_uom_id=nuom.uom_id)" " OR (uomconv_to_uom_id=duom.uom_id AND uomconv_from_uom_id=nuom.uom_id))" " WHERE(item_id=:item_id)" " UNION " " SELECT itemuomconv_id, itemuom_id, 1 AS xtindentrole," " uomtype_name AS uomname," " '' AS uomvalue," " NULL AS global," " NULL AS fractional" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom AS nuom ON (itemuomconv_from_uom_id=nuom.uom_id)" " JOIN uom AS duom ON (itemuomconv_to_uom_id=duom.uom_id)" " JOIN itemuom ON (itemuom_itemuomconv_id=itemuomconv_id)" " JOIN uomtype ON (itemuom_uomtype_id=uomtype_id)" " WHERE (item_id=:item_id)" " ) AS data " " ORDER BY itemuomconv_id, xtindentrole, uomname;"); itemFillUOMList.bindValue(":item_id", _itemid); itemFillUOMList.exec(); _uomconv->populate(itemFillUOMList,TRUE); _uomconv->expandAll(); itemFillUOMList.prepare("SELECT itemInventoryUOMInUse(:item_id) AS result;"); itemFillUOMList.bindValue(":item_id", _itemid); itemFillUOMList.exec(); if(itemFillUOMList.first()) _inventoryUOM->setEnabled(!itemFillUOMList.value("result").toBool()); sPopulatePriceUOMs(); } void item::sPopulatePriceUOMs() { XSqlQuery itemPopulatePriceUOMs; int pid = _priceUOM->id(); itemPopulatePriceUOMs.prepare("SELECT uom_id, uom_name, uom_name" " FROM uom" " WHERE(uom_id=:uom_id)" " UNION " "SELECT uom_id, uom_name, uom_name" " FROM uom" " JOIN itemuomconv ON (itemuomconv_to_uom_id=uom_id)" " JOIN item ON (itemuomconv_from_uom_id=item_inv_uom_id)" " JOIN itemuom ON (itemuom_itemuomconv_id=itemuomconv_id)" " JOIN uomtype ON (itemuom_uomtype_id=uomtype_id)" " WHERE((itemuomconv_item_id=:item_id)" " AND (uomtype_name='Selling'))" " UNION " "SELECT uom_id, uom_name, uom_name" " FROM uom" " JOIN itemuomconv ON (itemuomconv_from_uom_id=uom_id)" " JOIN item ON (itemuomconv_to_uom_id=item_inv_uom_id)" " JOIN itemuom ON (itemuom_itemuomconv_id=itemuomconv_id)" " JOIN uomtype ON (itemuom_uomtype_id=uomtype_id)" " WHERE((itemuomconv_item_id=:item_id)" " AND (uomtype_name='Selling'))" " ORDER BY 2;"); itemPopulatePriceUOMs.bindValue(":item_id", _itemid); itemPopulatePriceUOMs.bindValue(":uom_id", _inventoryUOM->id()); itemPopulatePriceUOMs.exec(); _priceUOM->populate(itemPopulatePriceUOMs, pid); if (itemPopulatePriceUOMs.lastError().type() != QSqlError::NoError) { systemError(this, itemPopulatePriceUOMs.lastError().databaseText(), __FILE__, __LINE__); return; } } void item::closeEvent(QCloseEvent *pEvent) { XSqlQuery itemcloseEvent; if(_inTransaction) { itemcloseEvent.exec("ROLLBACK;"); _inTransaction = false; } QDirIterator dirIterator(QDir::tempPath() + "/xtTempDoc/", QDir::AllDirs|QDir::Files|QDir::NoSymLinks, QDirIterator::Subdirectories); while(dirIterator.hasNext()) { dirIterator.next(); QFile rfile(dirIterator.fileInfo().absoluteFilePath()); rfile.remove(); } XWidget::closeEvent(pEvent); } void item::sConfiguredToggled(bool p) { if (p) _charass->showColumn(3); else _charass->hideColumn(3); } bool item::checkSitePrivs(int itemsiteid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT warehous_id " "FROM itemsite, site() " "WHERE ( (itemsite_id=:itemsiteid) " " AND (warehous_id=itemsite_warehous_id) );"); check.bindValue(":itemsiteid", itemsiteid); check.exec(); if (!check.first()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Item Site as it references " "a Site for which you have not been granted privileges.")) ; return false; } } return true; } void item::sHandleButtons() { if(_mode == cNew) { ParameterList params; if(_privileges->check("MaintainBOMs") && _mode != cView) params.append("mode", "edit"); else params.append("mode", "view"); params.append("item_id", _itemid); _bom->set(params); _bom->sFillList(); } if (_notesButton->isChecked()) _remarksStack->setCurrentIndex(0); else if (_extDescripButton->isChecked()) _remarksStack->setCurrentIndex(1); else if (_commentsButton->isChecked()) _remarksStack->setCurrentIndex(2); if (_elementsButton->isChecked()) _costStack->setCurrentIndex(0); else if (_bomButton->isChecked()) _costStack->setCurrentIndex(1); if (_aliasesButton->isChecked()) _relationshipsStack->setCurrentIndex(0); else if (_transformationsButton->isChecked()) _relationshipsStack->setCurrentIndex(1); else if (_substitutesButton->isChecked()) _relationshipsStack->setCurrentIndex(2); } void item::sHandleRightButtons() { if ((_inventoryUOM->isValid()) && (_classcode->isValid())) { QString itemtype = _itemTypes[_itemtype->currentIndex()]; if(!_privileges->check("ViewItemAvailabilityWorkbench")) _workbench->hide(); else if (itemtype == "K" || _itemtype->currentIndex()==-1) _workbench->hide(); else _workbench->show(); if(!_privileges->check("MaintainBOMs")) _materials->hide(); else if (itemtype == "M" || // manufactured itemtype == "P" || // purchased itemtype == "B" || // breeder itemtype == "F" || // phantom itemtype == "K" || // kit itemtype == "T" || // tooling itemtype == "L") // planning _materials->show(); else _materials->hide(); if((!_privileges->check("CreateCosts")) && (!_privileges->check("EnterActualCosts")) && (!_privileges->check("UpdateActualCosts")) && (!_privileges->check("ViewCosts"))) { _elementsButton->setEnabled(false); _bomButton->setChecked(true); sHandleButtons(); } _bomButton->setEnabled((_privileges->check("MaintainBOMs") || _privileges->check("ViewBOMs")) && itemtype != "R" && itemtype != "S"); // If can't do anything in costs tab, then disable _tab->setTabEnabled(_tab->indexOf(_costTab), _elementsButton->isEnabled() || _bomButton->isEnabled()); if((_privileges->check("MaintainItemSites")) && (!_metrics->boolean("MultiWhs"))) _site->show(); else _site->hide(); } else { _materials->hide(); _workbench->hide(); _site->hide(); } } void item::sFillSourceList() { XSqlQuery itemFillSourceList; QString sql( "SELECT itemsrc_id, vend_number," " vend_name, itemsrc_vend_item_number, " " itemsrc_active, itemsrc_manuf_name, " " itemsrc_manuf_item_number, " " CASE WHEN itemsrc_default = 'TRUE' THEN 'Yes' " " ELSE 'No' " " END AS default " "FROM item, vendinfo, itemsrc " "WHERE ( (itemsrc_item_id=item_id)" " AND (itemsrc_vend_id=vend_id)" " AND (itemsrc_item_id=) " ") ORDER BY vend_number, vend_name;" ); ParameterList params; MetaSQLQuery mql(sql); params.append("item_id", _itemid); itemFillSourceList = mql.toQuery(params); _itemsrc->populate(itemFillSourceList); } void item::sNewSource() { ParameterList params; params.append("mode", "new"); params.append("item_id", _itemid); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillSourceList(); } void item::sEditSource() { ParameterList params; params.append("mode", "edit"); params.append("itemsrc_id", _itemsrc->id()); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillSourceList(); } void item::sViewSource() { ParameterList params; params.append("mode", "view"); params.append("itemsrc_id", _itemsrc->id()); itemSource newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void item::sCopySource() { ParameterList params; params.append("mode", "copy"); params.append("itemsrc_id", _itemsrc->id()); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillSourceList(); } void item::sDeleteSource() { XSqlQuery itemDeleteSource; itemDeleteSource.prepare("SELECT poitem_id, itemsrc_active " "FROM poitem, itemsrc " "WHERE ((poitem_itemsrc_id=:itemsrc_id) " "AND (itemsrc_id=:itemsrc_id)); "); itemDeleteSource.bindValue(":itemsrc_id", _itemsrc->id()); itemDeleteSource.exec(); if (itemDeleteSource.first()) { if (itemDeleteSource.value("itemsrc_active").toBool()) { if (QMessageBox::question( this, tr("Delete Item Source"), tr( "This item source is used by existing purchase order records" " and may not be deleted. Would you like to deactivate it instead?"), tr("&Ok"), tr("&Cancel"), 0, 0, 1 ) == 0 ) { itemDeleteSource.prepare( "UPDATE itemsrc SET " " itemsrc_active=false " "WHERE (itemsrc_id=:itemsrc_id);" ); itemDeleteSource.bindValue(":itemsrc_id", _itemsrc->id()); itemDeleteSource.exec(); sFillSourceList(); } } else QMessageBox::critical( this, tr("Delete Item Source"), tr("This item source is used by existing " "purchase order records and may not be deleted.")); return; } if (QMessageBox::information( this, tr("Delete Item Source"), tr( "Are you sure that you want to delete the Item Source?"), tr("&Delete"), tr("&Cancel"), 0, 0, 1 ) == 0 ) { itemDeleteSource.prepare( "DELETE FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" "DELETE FROM itemsrcp " "WHERE (itemsrcp_itemsrc_id=:itemsrc_id);" ); itemDeleteSource.bindValue(":itemsrc_id", _itemsrc->id()); itemDeleteSource.exec(); sFillSourceList(); } } void item::setId(int p) { if (_itemid==p) return; _itemid=p; populate(); emit newId(_itemid); } qt-client-4.1.0/guiclient/item.h000066400000000000000000000060501217451700100165050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEM_2_H #define ITEM_2_H #include "guiclient.h" #include "xwidget.h" #include "bom.h" #include "maintainItemCosts.h" #include #include "ui_item.h" class item : public XWidget, public Ui::item { Q_OBJECT public: item(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~item(); virtual void populate(); virtual void clear(); static void newItem(); static void editItem( int pId ); static void viewItem( int pId ); virtual bool checkSitePrivs( int itemsiteid ); Q_INVOKABLE virtual int id() { return _itemid; } public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void setId(int); virtual void sSave(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); virtual void sPrint(); virtual void sFormatItemNumber(); virtual void sPopulateUOMs(); virtual void sHandleItemtype(); virtual void sNewAlias(); virtual void sEditAlias(); virtual void sDeleteAlias(); virtual void sFillAliasList(); virtual void sNewSubstitute(); virtual void sEditSubstitute(); virtual void sDeleteSubstitute(); virtual void sFillSubstituteList(); virtual void sNewTransformation(); virtual void sDeleteTransformation(); virtual void sFillTransformationList(); virtual void sEditBOM(); virtual void sWorkbench(); virtual void sNewItemSite(); virtual void sEditItemSite(); virtual void sViewItemSite(); virtual void sDeleteItemSite(); virtual void sFillListItemSites(); virtual void sNewItemtax(); virtual void sEditItemtax(); virtual void sDeleteItemtax(); virtual void sFillListItemtax(); virtual void sNewUOM(); virtual void sEditUOM(); virtual void sDeleteUOM(); virtual void sFillUOMList(); virtual void sPopulatePriceUOMs(); virtual void sConfiguredToggled(bool p); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sHandleButtons(); virtual void sHandleRightButtons(); virtual void sFillSourceList(); virtual void sNewSource(); virtual void sEditSource(); virtual void sViewSource(); virtual void sCopySource(); virtual void sDeleteSource(); virtual void sSaveBom(); protected: BOM *_bom; BOM *_bomwin; maintainItemCosts * _elements; protected slots: virtual void languageChange(); signals: void newId(int); void saved(int); private: int _mode; int _itemid; bool _disallowPlanningType; QString _originalItemType; bool _inTransaction; void saveCore(); }; #endif // ITEM_2_H qt-client-4.1.0/guiclient/item.ui000066400000000000000000001560031217451700100166770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. item 0 0 849 660 Item 12 5 0 0 Item &Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _itemNumber 5 0 &Active true Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 3 0 0 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description1 Qt::Vertical QSizePolicy::Expanding 20 0 0 &Save true &Cancel true Qt::Vertical 77 16 &Print true Materials... Inventory... Workbench... true 0 0 Item &Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _itemtype Purchased Manufactured Phantom Reference Costing Tooling Outside Process Planning Kit Maximum Desired Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 150 0 false Qt::Vertical QSizePolicy::Expanding 20 44 Class Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Preferred 16 16 &Inventory UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _inventoryUOM 12 Pick List true Fractional false Configured Qt::Horizontal 16 20 Freight Class: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Bar Code: 0 0 120 32767 Qt::Horizontal 0 20 Qt::Horizontal 0 10 0 0 Item is Sold true true Product C&ategory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _prodcat 0 0 250 16777215 Warranty: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 9999 Days List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 22 Qt::AlignRight Unit Price UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 0 0 80 22 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Wholesale Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Exclusive Qt::Horizontal 0 20 0 0 Weight &Product: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _prodWeight 75 0 Qt::AlignRight Pac&kaging: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _packWeight Qt::AlignRight 0 1 Qt::ClickFocus 0 Remarks 0 12 Notes true Extended Description Comments Qt::Horizontal 40 20 0 true Qt::ClickFocus Qt::ClickFocus Comments::Item Characteristics Qt::ClickFocus 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Cost Elements true Materials Qt::Horizontal 40 20 0 Conversions Qt::ClickFocus true 0 New false Edit false Delete Qt::Vertical 20 40 Sites Qt::ClickFocus 0 false &New true false &Edit true false &View true false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Sources 0 0 0 false &New false &Edit false &View false &Copy false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Tax Types Qt::ClickFocus 0 New false Edit false Delete Qt::Vertical 20 40 Tax is Recoverable true Relationships 0 12 Aliases true Substitutes Transformations Qt::Horizontal 40 20 0 Qt::ClickFocus 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 0 New false Delete Qt::Vertical QSizePolicy::Expanding 10 0 Qt::ClickFocus 0 New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Documents Documents::Item Comments QWidget

    comments.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    Documents QWidget
    documents.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _itemNumber _active _description1 _description2 _itemtype _maximumDesiredCost _classcode _inventoryUOM _pickListItem _fractional _configured _freightClass _upcCode _sold _prodcat _warranty _listprice _listcost _priceUOM _prodWeight _packWeight _tab _notesButton _extDescripButton _extDescription _commentsButton _comments _charass _newCharacteristic _editCharacteristic _deleteCharacteristic _uomconv _newUOM _editUOM _deleteUOM _itemSite _newItemSite _editItemSite _viewItemSite _deleteItemSite _itemsrc _newSrc _editSrc _viewSrc _deleteSrc _itemtax _itemtaxNew _itemtaxEdit _itemtaxDelete _aliasesButton _substitutesButton _transformationsButton _itemalias _newAlias _editAlias _deleteAlias _close _site _workbench _itemsub _editSubstitute _deleteSubstitute _deleteTransform _itemtrans _newTransform _newSubstitute _close clicked() item close() 776 47 20 20 _itemtax itemSelected(int) _itemtaxEdit animateClick() 151 557 676 456 _uomconv itemSelected(int) _editUOM animateClick() 181 503 676 429 _charass itemSelected(int) _editCharacteristic animateClick() 203 532 676 429 _itemalias valid(bool) _editAlias setEnabled(bool) 78 420 184 438 _itemalias valid(bool) _deleteAlias setEnabled(bool) 78 420 184 438 _itemtrans valid(bool) _deleteTransform setEnabled(bool) 131 429 131 429 _itemsub valid(bool) _editSubstitute setEnabled(bool) 131 429 131 429 _itemsub valid(bool) _deleteSubstitute setEnabled(bool) 131 429 131 429 _itemsub itemSelected(int) _editSubstitute animateClick() 131 429 131 429 _itemalias itemSelected(int) _editAlias animateClick() 78 420 184 438 qt-client-4.1.0/guiclient/itemAlias.cpp000066400000000000000000000135751217451700100200240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemAlias.h" #include #include #include "errorReporter.h" #include "guiErrorCheck.h" itemAlias::itemAlias(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _itemaliasid = -1; _itemid = -1; } itemAlias::~itemAlias() { // no need to delete child widgets, Qt does it all for us } void itemAlias::languageChange() { retranslateUi(this); } enum SetResponse itemAlias::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _itemid = param.toInt(); itemet.prepare("SELECT item_number FROM item WHERE (item_id=:item_id);"); itemet.bindValue(":item_id", _itemid); itemet.exec(); if(itemet.first()) _item->setText(itemet.value("item_number").toString()); } param = pParams.value("itemalias_id", &valid); if (valid) { _itemaliasid = param.toInt(); populate(); } param = pParams.value("item_number", &valid); if (valid) _item->setText(param.toString()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(FALSE); _useDescription->setEnabled(FALSE); _descrip1->setEnabled(FALSE); _descrip2->setEnabled(FALSE); _comments->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void itemAlias::sSave() { XSqlQuery itemSave; QList errors; errors << GuiErrorCheck(_number->text().trimmed().isEmpty(), _number, tr("You must enter a valid Alias " "before continuing")) ; if (_mode == cNew) { itemSave.prepare( "SELECT itemalias_id " "FROM itemalias " "WHERE ( (itemalias_item_id=:item_id)" " AND (itemalias_number=:itemalias_number) );" ); itemSave.bindValue(":item_id", _itemid); itemSave.bindValue(":itemalias_number", _number->text()); itemSave.exec(); if (itemSave.first()) errors << GuiErrorCheck(true, _number, tr( "An Item Alias for the selected Item Number has already been defined with the selected Alias Item Number.\n" "You may not create duplicate Item Aliases." ) ); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Item Alias"), errors)) return; if (_mode == cNew) { itemSave.exec("SELECT NEXTVAL('itemalias_itemalias_id_seq') AS _itemalias_id;"); if (itemSave.first()) _itemaliasid = itemSave.value("_itemalias_id").toInt(); itemSave.prepare( "INSERT INTO itemalias " "( itemalias_id, itemalias_item_id, itemalias_number," " itemalias_usedescrip, itemalias_descrip1, itemalias_descrip2," " itemalias_comments ) " "VALUES " "( :itemalias_id, :itemalias_item_id, :itemalias_number," " :itemalias_usedescrip, :itemalias_descrip1, :itemalias_descrip2," " :itemalias_comments );" ); } else if (_mode == cEdit) itemSave.prepare( "UPDATE itemalias " "SET itemalias_number=:itemalias_number, itemalias_comments=:itemalias_comments," " itemalias_usedescrip=:itemalias_usedescrip," " itemalias_descrip1=:itemalias_descrip1, itemalias_descrip2=:itemalias_descrip2 " "WHERE (itemalias_id=:itemalias_id);" ); itemSave.bindValue(":itemalias_id", _itemaliasid); itemSave.bindValue(":itemalias_item_id", _itemid); itemSave.bindValue(":itemalias_number", _number->text().trimmed()); itemSave.bindValue(":itemalias_descrip1", _descrip1->text().trimmed()); itemSave.bindValue(":itemalias_descrip2", _descrip2->text().trimmed()); itemSave.bindValue(":itemalias_comments", _comments->toPlainText()); itemSave.bindValue(":itemalias_usedescrip", QVariant(_useDescription->isChecked())); itemSave.exec(); done(_itemaliasid); } void itemAlias::populate() { XSqlQuery itempopulate; itempopulate.prepare( "SELECT itemalias_item_id, itemalias_number," " itemalias_usedescrip, itemalias_descrip1, itemalias_descrip2," " itemalias_comments, item_number " "FROM itemalias LEFT OUTER JOIN item ON (itemalias_item_id=item_id) " "WHERE (itemalias_id=:itemalias_id);" ); itempopulate.bindValue(":itemalias_id", _itemaliasid); itempopulate.exec(); if (itempopulate.first()) { _itemid = itempopulate.value("itemalias_item_id").toInt(); _item->setText(itempopulate.value("item_number").toString()); _number->setText(itempopulate.value("itemalias_number").toString()); if (itempopulate.value("itemalias_usedescrip").toBool()) { _useDescription->setChecked(TRUE); _descriptionGroup->setEnabled(TRUE); _descrip1->setText(itempopulate.value("itemalias_descrip1").toString()); _descrip2->setText(itempopulate.value("itemalias_descrip2").toString()); } else { _useDescription->setChecked(FALSE); _descriptionGroup->setEnabled(FALSE); } _comments->setText(itempopulate.value("itemalias_comments").toString()); } } qt-client-4.1.0/guiclient/itemAlias.h000066400000000000000000000020371217451700100174600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMALIAS_H #define ITEMALIAS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemAlias.h" class itemAlias : public XDialog, public Ui::itemAlias { Q_OBJECT public: itemAlias(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemAlias(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _itemaliasid; int _itemid; }; #endif // ITEMALIAS_H qt-client-4.1.0/guiclient/itemAlias.ui000066400000000000000000000265251217451700100176560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemAlias 0 0 485 389 Item Alias 9 6 0 6 0 6 0 0 0 6 5 0 0 0 Not Specified Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _itemLit Alias Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number Qt::Horizontal QSizePolicy::Expanding 169 20 0 0 0 0 Use an Alias Description on Billing and Shipping Paperwork Qt::Horizontal QSizePolicy::Expanding 20 20 false 5 5 0 0 Description: _descrip1 Qt::Vertical QSizePolicy::Preferred 20 20 0 0 0 0 0 5 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 20 5 7 0 1 QFrame::NoFrame QFrame::Plain 0 0 Comments: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _comments XLineEdit QLineEdit
    xlineedit.h
    0
    XTextEdit QTextEdit
    xtextedit.h
    _number _useDescription _descrip1 _descrip2 _comments _save _close _close clicked() itemAlias reject() 406 32 20 20 _useDescription toggled(bool) _descriptionGroup setEnabled(bool) 33 99 32 122
    qt-client-4.1.0/guiclient/itemAvailabilityWorkbench.cpp000066400000000000000000001516521217451700100232470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemAvailabilityWorkbench.h" #include #include #include #include #include #include "adjustmentTrans.h" #include "bom.h" #include "countTag.h" #include "createCountTagsByItem.h" #include "dspAllocations.h" #include "dspInventoryHistory.h" #include "dspItemCostSummary.h" #include "dspOrders.h" #include "dspRunningAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "enterMiscCount.h" #include "expenseTrans.h" #include "firmPlannedOrder.h" #include "item.h" #include "maintainItemCosts.h" #include "materialReceiptTrans.h" #include "mqlutil.h" #include "purchaseOrder.h" #include "purchaseRequest.h" #include "reassignLotSerial.h" #include "relocateInventory.h" #include "scrapTrans.h" #include "storedProcErrorLookup.h" #include "transactionInformation.h" #include "transferTrans.h" #include "workOrder.h" #include "salesOrder.h" #include "transferOrder.h" itemAvailabilityWorkbench::itemAvailabilityWorkbench(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _costsGroupInt = new QButtonGroup(this); _costsGroupInt->addButton(_useStandardCosts); _costsGroupInt->addButton(_useActualCosts); connect(_availPrint, SIGNAL(clicked()), this, SLOT(sPrintAvail())); connect(_availability,SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuRunning(QMenu*,QTreeWidgetItem*))); connect(_availability,SIGNAL(resorted()), this, SLOT(sHandleResort())); connect(_bomitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuCosted(QMenu*,QTreeWidgetItem*))); connect(_byDates, SIGNAL(toggled(bool)), _endDate, SLOT(setEnabled(bool))); connect(_byDates, SIGNAL(toggled(bool)), _startDate, SLOT(setEnabled(bool))); connect(_costedPrint, SIGNAL(clicked()), this, SLOT(sPrintCosted())); connect(_costsGroup, SIGNAL(toggled(bool)), this, SLOT(sFillListCosted())); connect(_costsGroupInt,SIGNAL(buttonClicked(int)), this, SLOT(sFillListCosted())); connect(_effective, SIGNAL(newDate(const QDate&)), this, SLOT(sFillListWhereUsed())); connect(_histPrint, SIGNAL(clicked()), this, SLOT(sPrintHistory())); connect(_invAvailability,SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuAvail(QMenu*,QTreeWidgetItem*))); connect(_invQuery, SIGNAL(clicked()), this, SLOT(sFillListAvail())); connect(_invhist, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuHistory(QMenu*,QTreeWidgetItem*))); connect(_invhistQuery,SIGNAL(clicked()), this, SLOT(sFillListInvhist())); connect(_item, SIGNAL(newId(int)), this, SLOT(sFillListCosted())); connect(_item, SIGNAL(newId(int)), this, SLOT(sFillListWhereUsed())); connect(_item, SIGNAL(newId(int)), this, SLOT(sClearQueries())); connect(_itemloc, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuLocation(QMenu*,QTreeWidgetItem*))); connect(_itemlocQuery,SIGNAL(clicked()), this, SLOT(sFillListItemloc())); connect(_locPrint, SIGNAL(clicked()), this, SLOT(sPrintLocation())); connect(_runPrint, SIGNAL(clicked()), this, SLOT(sPrintRunning())); connect(_showPlanned, SIGNAL(toggled(bool)), this, SLOT(sFillListRunning())); connect(_showReorder, SIGNAL(toggled(bool)), this, SLOT(sHandleShowReorder(bool))); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sFillListRunning())); connect(_wherePrint, SIGNAL(clicked()), this, SLOT(sPrintWhereUsed())); connect(_whereused, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenuWhereUsed(QMenu*,QTreeWidgetItem*))); // Running Availability _availability->addColumn(tr("Order Type"), _itemColumn, Qt::AlignLeft, true, "ordertype"); _availability->addColumn(tr("Order #"), _itemColumn, Qt::AlignLeft, true, "ordernumber"); _availability->addColumn(tr("Source/Destination"), -1, Qt::AlignLeft, true, "item_number"); _availability->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft, true, "duedate"); _availability->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "qtyordered"); _availability->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "qtyreceived"); _availability->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balance"); _availability->addColumn(tr("Running Avail."), _qtyColumn, Qt::AlignRight, true, "runningavail"); connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillListRunning())); // Inventory Availability _invAvailability->addColumn(tr("Site"), -1, Qt::AlignCenter, true, "warehous_code" ); _invAvailability->addColumn(tr("LT"), _whsColumn, Qt::AlignCenter, true, "itemsite_leadtime" ); _invAvailability->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight , true, "qoh" ); _invAvailability->addColumn(tr("Allocated"), _qtyColumn, Qt::AlignRight , true, "allocated" ); _invAvailability->addColumn(tr("Unallocated"), _qtyColumn, Qt::AlignRight , true, "unallocated" ); _invAvailability->addColumn(tr("On Order"), _qtyColumn, Qt::AlignRight , true, "ordered" ); _invAvailability->addColumn(tr("Reorder Lvl."), _qtyColumn, Qt::AlignRight , true, "reorderlevel" ); _invAvailability->addColumn(tr("OUT Level"), _qtyColumn, Qt::AlignRight , true, "outlevel" ); _invAvailability->addColumn(tr("Available"), _qtyColumn, Qt::AlignRight , true, "available" ); connect(omfgThis, SIGNAL(workOrdersUpdated(int, bool)), this, SLOT(sFillListAvail())); // Costed BOM _bomitem->setRootIsDecorated(TRUE); _bomitem->addColumn(tr("Seq #"), _itemColumn, Qt::AlignLeft, true, "bomdata_bomwork_seqnumber"); _bomitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "bomdata_item_number"); _bomitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "bomdata_itemdescription"); _bomitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "bomdata_uom_name"); _bomitem->addColumn(tr("Ext. Qty. Per"),_qtyColumn, Qt::AlignRight, true, "bomdata_qtyper"); _bomitem->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomdata_scrap"); _bomitem->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter,true, "bomdata_effective"); _bomitem->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter,true, "bomdata_expires"); _bomitem->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "unitcost"); _bomitem->addColumn(tr("Ext Cost"), _priceColumn, Qt::AlignRight, true, "extendedcost"); _bomitem->setIndentation(10); // Invhist _invhist->setRootIsDecorated(TRUE); _invhist->addColumn(tr("Transaction Time"),_timeDateColumn, Qt::AlignLeft, true, "invhist_transdate"); _invhist->addColumn(tr("Created Time"), _timeDateColumn, Qt::AlignLeft, false, "invhist_created"); _invhist->addColumn(tr("Type"), _transColumn, Qt::AlignCenter,true, "invhist_transtype"); _invhist->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _invhist->addColumn(tr("Order #/Detail"), -1,Qt::AlignLeft, true, "orderlocation"); _invhist->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "invhist_invuom"); _invhist->addColumn(tr("Trans-Qty"), _qtyColumn, Qt::AlignRight, true, "transqty"); _invhist->addColumn(tr("From Area"), _orderColumn, Qt::AlignLeft, true, "locfrom"); _invhist->addColumn(tr("QOH Before"), _qtyColumn, Qt::AlignRight, true, "qohbefore"); _invhist->addColumn(tr("To Area"), _orderColumn, Qt::AlignLeft, true, "locto"); _invhist->addColumn(tr("QOH After"), _qtyColumn, Qt::AlignRight, false, "qohafter"); _invhist->addColumn(tr("Cost Method"), _qtyColumn, Qt::AlignLeft, false, "costmethod"); _invhist->addColumn(tr("Value Before"),_qtyColumn, Qt::AlignRight, false, "invhist_value_before"); _invhist->addColumn(tr("Value After"), _qtyColumn, Qt::AlignRight, false, "invhist_value_after"); _invhist->addColumn(tr("User"), _orderColumn, Qt::AlignCenter,true, "invhist_user"); _transType->append(cTransAll, tr("All Transactions") ); _transType->append(cTransReceipts, tr("Receipts") ); _transType->append(cTransIssues, tr("Issues") ); _transType->append(cTransShipments, tr("Shipments") ); _transType->append(cTransAdjCounts, tr("Adjustments and Counts") ); _transType->append(cTransTransfers, tr("Transfers") ); _transType->append(cTransScraps, tr("Scraps") ); _transType->setCurrentIndex(0); // Itemloc _itemloc->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _itemloc->addColumn(tr("Location"), 200, Qt::AlignLeft, true, "locationname" ); _itemloc->addColumn(tr("Netable"), _orderColumn, Qt::AlignCenter, true, "netable" ); _itemloc->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "lotserial" ); _itemloc->addColumn(tr("Expiration"), _dateColumn, Qt::AlignCenter, true, "itemloc_expiration" ); _itemloc->addColumn(tr("Warranty"), _dateColumn, Qt::AlignCenter, true, "itemloc_warrpurc" ); _itemloc->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qoh" ); // Where Used _effective->setNullString(tr("Now")); _effective->setNullDate(omfgThis->dbDate()); _effective->setAllowNullDate(TRUE); _effective->setNull(); _whereused->addColumn(tr("Seq #"), 40, Qt::AlignCenter, true, "bomitem_seqnumber" ); _whereused->addColumn(tr("Parent Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _whereused->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip" ); _whereused->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name" ); _whereused->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "qtyfxd"); _whereused->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "qtyper" ); _whereused->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "bomitem_scrap" ); _whereused->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter, true, "bomitem_effective" ); _whereused->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter, true, "bomitem_expires" ); // connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), SLOT(sFillListWhereUsed(int, bool))); connect(omfgThis, SIGNAL(bomsUpdated(int, bool)), SLOT(sFillListWhereUsed())); // General if(!_privileges->check("ViewBOMs")) _tab->removeTab(5); if(!_privileges->check("ViewQOH")) _tab->removeTab(4); if(!_privileges->check("ViewInventoryHistory")) _tab->removeTab(3); if(!_privileges->check("ViewBOMs")) _tab->removeTab(2); if(!_privileges->check("ViewInventoryAvailability")) { _tab->removeTab(1); _tab->removeTab(0); } if(!_privileges->check("ViewCosts")) { _costsGroup->setEnabled(false); _costsGroup->setChecked(false); } else _costsGroup->setChecked(true); //If not Manufacturing, hide show planned option if (_metrics->value("Application") != "Standard") _showPlanned->hide(); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } //If not Serial Control, hide lot control if (!_metrics->boolean("LotSerialControl")) _tab->removeTab(_tab->indexOf(lotserial)); if (_preferences->boolean("XCheckBox/forgetful")) _ignoreReorderAtZero->setChecked(true); _ignoreReorderAtZero->setEnabled(_showReorder->isChecked()); _qoh->setPrecision(omfgThis->qtyVal()); _orderMultiple->setPrecision(omfgThis->qtyVal()); _reorderLevel->setPrecision(omfgThis->qtyVal()); _orderToQty->setPrecision(omfgThis->qtyVal()); } itemAvailabilityWorkbench::~itemAvailabilityWorkbench() { // no need to delete child widgets, Qt does it all for us } void itemAvailabilityWorkbench::languageChange() { retranslateUi(this); } enum SetResponse itemAvailabilityWorkbench::set( const ParameterList & pParams ) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); return NoError; } void itemAvailabilityWorkbench::setParams(ParameterList & params) { params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); params.append("firmPo", tr("Planned P/O (firmed)")); params.append("plannedPo", tr("Planned P/O")); params.append("firmWo", tr("Planned W/O (firmed)")); params.append("plannedWo", tr("Planned W/O")); params.append("firmTo", tr("Planned T/O (firmed)")); params.append("plannedTo", tr("Planned T/O")); params.append("firmWoReq", tr("Planned W/O Req. (firmed)")); params.append("plannedWoReq", tr("Planned W/O Req.")); params.append("pr", tr("Purchase Request")); if (_showPlanned->isChecked()) params.append("showPlanned"); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_metrics->value("Application") == "Standard") { XSqlQuery xtmfg; xtmfg.exec("SELECT pkghead_name FROM pkghead WHERE pkghead_name='xtmfg'"); if (xtmfg.first()) params.append("Manufacturing"); params.append("showMRPplan"); } } void itemAvailabilityWorkbench::sFillListWhereUsed() { XSqlQuery itemFillListWhereUsed; if ((_item->isValid()) && (_effective->isValid())) { ParameterList params; params.append("item_id", _item->id()); params.append("effective", _effective->date()); params.append("always", tr("Always")); params.append("never", tr("Never")); MetaSQLQuery mql = mqlLoad("whereUsed", "detail"); itemFillListWhereUsed = mql.toQuery(params); _whereused->populate(itemFillListWhereUsed, true); if (itemFillListWhereUsed.lastError().type() != QSqlError::NoError) { systemError(this, itemFillListWhereUsed.lastError().databaseText(), __FILE__, __LINE__); return; } } else _whereused->clear(); } void itemAvailabilityWorkbench::sFillListItemloc() { XSqlQuery itemFillListItemloc; if (_item->isValid()) { QString sql( "SELECT itemloc_id, 1 AS type, warehous_code," " CASE WHEN (location_id IS NULL) THEN :na" " ELSE (formatLocationName(location_id) || '-' || firstLine(location_descrip))" " END AS locationname," " CASE WHEN (location_id IS NULL) THEN :na" " WHEN (location_netable) THEN :yes" " ELSE :no" " END AS netable," " CASE WHEN (itemsite_controlmethod NOT IN ('L', 'S')) THEN :na" " ELSE formatlotserialnumber(itemloc_ls_id)" " END AS lotserial," " itemloc_expiration," " CASE WHEN (NOT itemsite_perishable) THEN :na END AS itemloc_expiration_qtdisplayrole," " itemloc_warrpurc," " CASE WHEN (NOT itemsite_warrpurc) THEN :na END AS itemloc_warrpurc_qtdisplayrole," " CASE WHEN ((itemsite_perishable) AND (itemloc_expiration <= CURRENT_DATE)) THEN 'red'" " END AS itemloc_expiration_qtforegroundrole," " CASE WHEN ((itemsite_warrpurc) AND (itemloc_warrpurc <= CURRENT_DATE)) THEN 'red'" " END AS itemloc_warrpurc_qtforegroundrole," " itemloc_qty AS qoh," " 'qty' AS qoh_xtnumericrole " "FROM itemsite, whsinfo," " itemloc LEFT OUTER JOIN location ON (itemloc_location_id=location_id) " "WHERE ( ( (itemsite_loccntrl) OR (itemsite_controlmethod IN ('L', 'S')) )" " AND (itemloc_itemsite_id=itemsite_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=:item_id)" ); if (_itemlocWarehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ") " "UNION SELECT itemsite_id, 2 AS type, warehous_code," " :na AS locationname," " :na AS netable," " :na AS lotserial," " CAST(NULL AS DATE) AS itemloc_expiration," " :na AS itemloc_expiration_qtdisplayrole," " CAST(NULL AS DATE) AS itemloc_warrpurc," " :na AS itemloc_warrpurc_qtdisplayrole," " NULL AS itemloc_expiration_qtforegroundrole," " NULL AS itemloc_warrpurc_qtforegroundrole," " itemsite_qtyonhand AS qoh," " 'qty' AS qoh_xtnumericrole " "FROM itemsite, whsinfo " "WHERE ( (NOT itemsite_loccntrl)" " AND (itemsite_controlmethod NOT IN ('L', 'S'))" " AND (itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=:item_id)"; if (_itemlocWarehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ") " "ORDER BY warehous_code, locationname, lotserial;"; itemFillListItemloc.prepare(sql); itemFillListItemloc.bindValue(":yes", tr("Yes")); itemFillListItemloc.bindValue(":no", tr("No")); itemFillListItemloc.bindValue(":na", tr("N/A")); itemFillListItemloc.bindValue(":undefined", tr("Undefined")); itemFillListItemloc.bindValue(":item_id", _item->id()); _itemlocWarehouse->bindValue(itemFillListItemloc); itemFillListItemloc.exec(); _itemloc->populate(itemFillListItemloc, true); } else _itemloc->clear(); } void itemAvailabilityWorkbench::sFillListInvhist() { XSqlQuery itemFillListInvhist; _invhist->clear(); if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Start Date"), tr("Please enter a valid Start Date.") ); _dates->setFocus(); return; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter End Date"), tr("Please enter a valid End Date.") ); _dates->setFocus(); return; } if (_item->isValid()) { ParameterList params; _dates->appendValue(params); params.append("item_id", _item->id()); params.append("transType", _transType->id()); _invhistWarehouse->appendValue(params); MetaSQLQuery mql = mqlLoad("inventoryHistory", "detail"); itemFillListInvhist = mql.toQuery(params); _invhist->populate(itemFillListInvhist, true); if (itemFillListInvhist.lastError().type() != QSqlError::NoError) { systemError(this, itemFillListInvhist.lastError().databaseText(), __FILE__, __LINE__); return; } } } void itemAvailabilityWorkbench::sFillListCosted() { XSqlQuery itemFillListCosted; if (! _item->isValid() || _item->itemType() == "R") return; MetaSQLQuery mql( "SELECT bomdata_bomwork_id AS id," " CASE WHEN bomdata_bomwork_parent_id = -1 AND " " bomdata_bomwork_id = -1 THEN" " -1" " ELSE bomdata_item_id" " END AS altid," " *, " " " " bomdata_stdunitcost AS unitcost, " " bomdata_stdextendedcost AS extendedcost, " " " " bomdata_actunitcost AS unitcost, " " bomdata_actextendedcost AS extendedcost, " " " " bomdata_qtyper, " " 'qtyper' AS bomdata_qtyper_xtnumericrole," " 'percent' AS bomdata_scrap_xtnumericrole," " 'cost' AS unitcost_xtnumericrole," " 'cost' AS extendedcost_xtnumericrole," " CASE WHEN COALESCE(bomdata_effective, startOfTime()) <= startOfTime() THEN END AS bomdata_effective_qtdisplayrole," " CASE WHEN COALESCE(bomdata_expires, endOfTime()) <= endOfTime() THEN END AS bomdata_expires_qtdisplayrole," " CASE WHEN bomdata_expired THEN 'expired'" " WHEN bomdata_future THEN 'future'" " END AS qtforegroundrole," " bomdata_bomwork_level - 1 AS xtindentrole, bomdata_itemdescription " "FROM indentedbom(," " ,0,0)"); ParameterList params; if (! setParamsCosted(params)) return; itemFillListCosted = mql.toQuery(params); _bomitem->populate(itemFillListCosted, true); if (itemFillListCosted.lastError().type() != QSqlError::NoError) { systemError(this, itemFillListCosted.lastError().databaseText(), __FILE__, __LINE__); return; } if(_costsGroup->isChecked()) { _bomitem->showColumn(8); _bomitem->showColumn(9); itemFillListCosted.prepare("SELECT formatCost(SUM(bomdata_actextendedcost)) AS actextendedcost," " formatCost(SUM(bomdata_stdextendedcost)) AS stdextendedcost," " formatCost(actcost(:item_id)) AS actual," " formatCost(stdcost(:item_id)) AS standard " "FROM indentedbom(:item_id," " getActiveRevId('BOM',:item_id),0,0)" "WHERE (bomdata_bomwork_level=1) " "GROUP BY actual, standard;" ); itemFillListCosted.bindValue(":item_id", _item->id()); itemFillListCosted.exec(); if (itemFillListCosted.first()) { XTreeWidgetItem *last = new XTreeWidgetItem(_bomitem, -1, -1); last->setText(0, tr("Total Cost")); if(_useStandardCosts->isChecked()) last->setText(9, itemFillListCosted.value("stdextendedcost").toString()); else last->setText(9, itemFillListCosted.value("actextendedcost").toString()); last = new XTreeWidgetItem( _bomitem, -1, -1); last->setText(0, tr("Actual Cost")); last->setText(9, itemFillListCosted.value("actual").toString()); last = new XTreeWidgetItem( _bomitem, -1, -1); last->setText(0, tr("Standard Cost")); last->setText(9, itemFillListCosted.value("standard").toString()); } else if (itemFillListCosted.lastError().type() != QSqlError::NoError) { systemError(this, itemFillListCosted.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _bomitem->hideColumn(8); _bomitem->hideColumn(9); } } void itemAvailabilityWorkbench::sFillListRunning() { XSqlQuery itemFillListRunning; _availability->clear(); if (_item->isValid()) { itemFillListRunning.prepare( "SELECT item_type, item_sold," " itemsite_id, itemsite_qtyonhand," " CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel," " CASE WHEN(itemsite_useparams) THEN itemsite_ordertoqty ELSE 0.0 END AS ordertoqty," " CASE WHEN(itemsite_useparams) THEN itemsite_multordqty ELSE 0.0 END AS multorderqty " "FROM item, itemsite " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (item_id=:item_id) );" ); itemFillListRunning.bindValue(":item_id", _item->id()); itemFillListRunning.bindValue(":warehous_id", _warehouse->id()); itemFillListRunning.exec(); if (itemFillListRunning.first()) { _qoh->setDouble(itemFillListRunning.value("itemsite_qtyonhand").toDouble()); _reorderLevel->setDouble(itemFillListRunning.value("reorderlevel").toDouble()); _orderMultiple->setDouble(itemFillListRunning.value("multorderqty").toDouble()); _orderToQty->setDouble(itemFillListRunning.value("ordertoqty").toDouble()); QString itemType = itemFillListRunning.value("item_type").toString(); QString sql; MetaSQLQuery mql = mqlLoad("runningAvailability", "detail"); ParameterList params; setParams(params); params.append("qoh", itemFillListRunning.value("itemsite_qtyonhand").toDouble()); itemFillListRunning = mql.toQuery(params); _availability->populate(itemFillListRunning, true); sHandleResort(); if (itemFillListRunning.lastError().type() != QSqlError::NoError) { systemError(this, itemFillListRunning.lastError().databaseText(), __FILE__, __LINE__); return; } } } else { _qoh->setDouble(0); _reorderLevel->setDouble(0); _orderMultiple->setDouble(0); _orderToQty->setDouble(0); } } void itemAvailabilityWorkbench::sHandleResort() { for (int i = 0; i < _availability->topLevelItemCount(); i++) { XTreeWidgetItem *item = _availability->topLevelItem(i); if (item->data(_availability->column("runningavail"), Qt::DisplayRole).toDouble() < 0) item->setTextColor(_availability->column("runningavail"), namedColor("error")); else if (item->data(_availability->column("runningavail"), Qt::DisplayRole).toDouble() < _reorderLevel->toDouble()) item->setTextColor(_availability->column("runningavail"), namedColor("warning")); else item->setTextColor(_availability->column("runningavail"), namedColor("")); } } void itemAvailabilityWorkbench::sHandleShowReorder( bool pValue ) { _ignoreReorderAtZero->setEnabled(pValue); if (pValue && _preferences->boolean("XCheckBox/forgetful")) _showShortages->setChecked(TRUE); } void itemAvailabilityWorkbench::sFillListAvail() { XSqlQuery itemFillListAvail; _invAvailability->clear(); if ((_byDate->isChecked()) && (!_date->isValid())) { QMessageBox::critical(this, tr("Enter Valid Date"), tr("

    You have choosen to view Inventory Availability" " as of a given date but have not indicated the " "date. Please enter a valid date." ) ); _date->setFocus(); return; } QString sql( "SELECT itemsite_id, itemtype, warehous_id, warehous_code, itemsite_leadtime," " qoh," " noNeg(qoh - allocated) AS unallocated," " allocated," " ordered," " reorderlevel," " outlevel," " (qoh - allocated + ordered) AS available," " CASE WHEN (NOT :byLeadtime) THEN 'grey' END AS itemsite_leadtime_qtforegroundrole, " " CASE " " WHEN ((qoh - allocated + ordered) < 0) THEN 'error' " " WHEN ((qoh - allocated + ordered) <= reorderlevel) THEN 'warning' " " END AS available_qtforegroundrole, " " 'qty' AS qoh_xtnumericrole, " " 'qty' AS unallocated_xtnumericrole, " " 'qty' AS allocated_xtnumericrole, " " 'qty' AS ordered_xtnumericrole, " " 'qty' AS reorderlevel_xtnumericrole, " " 'qty' AS outlevel_xtnumericrole, " " 'qty' AS available_xtnumericrole " "FROM ( SELECT itemsite_id," " CASE WHEN (item_type IN ('P', 'O')) THEN 1" " WHEN (item_type IN ('M')) THEN 2" " ELSE 0" " END AS itemtype," " warehous_id, warehous_code, itemsite_leadtime," " CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0 END AS reorderlevel," " CASE WHEN(itemsite_useparams) THEN itemsite_ordertoqty ELSE 0 END AS outlevel," " itemsite_qtyonhand AS qoh," ); if (_leadTime->isChecked()) sql += " qtyAllocated(itemsite_id, itemsite_leadtime) AS allocated," " qtyOrdered(itemsite_id, itemsite_leadtime) AS ordered "; else if (_byDays->isChecked()) sql += " qtyAllocated(itemsite_id, :days) AS allocated," " qtyOrdered(itemsite_id, :days) AS ordered "; else if (_byDate->isChecked()) sql += " qtyAllocated(itemsite_id, (:date - CURRENT_DATE)) AS allocated," " qtyOrdered(itemsite_id, (:date - CURRENT_DATE)) AS ordered "; else if (_byDates->isChecked()) sql += " qtyAllocated(itemsite_id, :startDate, :endDate) AS allocated," " qtyOrdered(itemsite_id, :startDate, :endDate) AS ordered "; sql += "FROM itemsite, whsinfo, item " "WHERE ( (itemsite_active)" " AND (itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=item_id)" " AND (item_id=:item_id)"; if (_invWarehouse->isSelected()) sql += " AND (warehous_id=:warehous_id)"; sql += ") ) AS data "; if (_showReorder->isChecked()) { sql += "WHERE ( ((qoh - allocated + ordered) <= reorderlevel) "; if (_ignoreReorderAtZero->isChecked()) sql += " AND (NOT ( ((qoh - allocated + ordered) = 0) AND (reorderlevel = 0)) ) ) "; else sql += ") "; } else if (_showShortages->isChecked()) sql += "WHERE ((qoh - allocated + ordered) < 0) "; sql += "ORDER BY warehous_code DESC;"; itemFillListAvail.prepare(sql); itemFillListAvail.bindValue(":days", _days->value()); itemFillListAvail.bindValue(":date", _date->date()); itemFillListAvail.bindValue(":startDate", _startDate->date()); itemFillListAvail.bindValue(":endDate", _endDate->date()); itemFillListAvail.bindValue(":item_id", _item->id()); itemFillListAvail.bindValue(":byLeadtime",QVariant(_leadTime->isChecked())); _invWarehouse->bindValue(itemFillListAvail); itemFillListAvail.exec(); _invAvailability->populate(itemFillListAvail,TRUE); } void itemAvailabilityWorkbench::sPrintRunning() { ParameterList params; setParams(params); params.append("isReport"); orReport report("RunningAvailability", params); if (report.isValid()) report.print(); else report.reportError(this); } void itemAvailabilityWorkbench::sPrintAvail() { if (!_item->isValid()) { QMessageBox::warning( this, tr("Invalid Data"), tr("You must enter a valid Item Number for this report.") ); _item->setFocus(); return; } ParameterList params; params.append("item_id", _item->id()); _invWarehouse->appendValue(params); if (_leadTime->isChecked()) params.append("byLeadTime"); else if (_byDays->isChecked()) params.append("byDays", _days->text().toInt()); else if (_byDate->isChecked()) params.append("byDate", _date->date()); else if (_byDates->isChecked()) { params.append("byDates"); params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } if(_showReorder->isChecked()) params.append("showReorder"); if(_ignoreReorderAtZero->isChecked()) params.append("ignoreReorderAtZero"); if(_showShortages->isChecked()) params.append("showShortages"); orReport report("InventoryAvailability", params); if (report.isValid()) report.print(); else report.reportError(this); } bool itemAvailabilityWorkbench::setParamsCosted(ParameterList ¶ms) { if (! _item->isValid()) { QMessageBox::critical(this, tr("Select an Item"), tr("Please select an Item and try again.")); _item->setFocus(); return false; } if (_item->itemType() != "M" && _item->itemType() != "B" && _item->itemType() != "F" && _item->itemType() != "K" && _item->itemType() != "P" && _item->itemType() != "O" && _item->itemType() != "L" && _item->itemType() != "J" && _item->itemType() != "T") { _tab->setTabEnabled(_tab->indexOf(costed),false); return false; } _tab->setTabEnabled(_tab->indexOf(costed),true); params.append("item_id", _item->id()); if(_useStandardCosts->isChecked()) params.append("useStandardCosts"); if(_useActualCosts->isChecked()) params.append("useActualCosts"); params.append("always", tr("Always")); params.append("never", tr("Never")); XSqlQuery rq; rq.prepare("SELECT getActiveRevId('BOM', :item_id) AS result;"); rq.bindValue(":item_id", _item->id()); rq.exec(); if (rq.first()) { int result = rq.value("result").toInt(); if (result < -1) { systemError(this, storedProcErrorLookup("getActiveRevId", result), __FILE__, __LINE__); return false; } params.append("revision_id", result); } else if (rq.lastError().type() != QSqlError::NoError) { systemError(this, rq.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void itemAvailabilityWorkbench::sPrintCosted() { XSqlQuery itemPrintCosted; itemPrintCosted.prepare("SELECT indentedBOM(:item_id) AS result;"); itemPrintCosted.bindValue(":item_id", _item->id()); itemPrintCosted.exec(); if (itemPrintCosted.first()) { ParameterList params; params.append("bomworkset_id", itemPrintCosted.value("result").toInt()); if (! setParamsCosted(params)) return; orReport report("CostedIndentedBOM", params); if (report.isValid()) report.print(); else report.reportError(this); } else if (itemPrintCosted.lastError().type() != QSqlError::NoError) { systemError(this, tr("

    Could not collect the Indented BOM information to write " "write the report.

    %1
    ") .arg(itemPrintCosted.lastError().databaseText()), __FILE__, __LINE__); return; } } void itemAvailabilityWorkbench::sPrintHistory() { if (!_dates->allValid()) { QMessageBox::warning( this, tr("Invalid Data"), tr("You must enter a valid Start Date and End Date for this report.") ); _dates->setFocus(); return; } ParameterList params; _invhistWarehouse->appendValue(params); _dates->appendValue(params); params.append("item_id", _item->id()); params.append("transType", _transType->id()); params.append("average", tr("Average")); params.append("standard", tr("Standard")); params.append("job", tr("Job")); params.append("none", tr("None")); params.append("unknown", tr("Unknown")); orReport report("InventoryHistory", params); if(report.isValid()) report.print(); else report.reportError(this); } void itemAvailabilityWorkbench::sPrintLocation() { if(!_item->isValid()) { QMessageBox::warning( this, tr("Enter a Valid Item Number"), tr("You must enter a valid Item Number for this report.") ); return; } ParameterList params; params.append("item_id", _item->id()); _itemlocWarehouse->appendValue(params); orReport report("LocationLotSerialNumberDetail", params); if (report.isValid()) report.print(); else report.reportError(this); } void itemAvailabilityWorkbench::sPrintWhereUsed() { ParameterList params; params.append("item_id", _item->id()); if(!_effective->isNull()) params.append("effective", _effective->date()); orReport report("SingleLevelWhereUsed", params); if (report.isValid()) report.print(); else report.reportError(this); } void itemAvailabilityWorkbench::sPopulateMenuRunning( QMenu * pMenu, QTreeWidgetItem * pSelected ) { QAction *menuItem; if (pSelected->text(0) == tr("Planned W/O (firmed)") || pSelected->text(0) == tr("Planned W/O") || pSelected->text(0) == tr("Planned P/O (firmed)") || pSelected->text(0) == tr("Planned P/O") ) { if (pSelected->text(0) == tr("Planned W/O (firmed)") || pSelected->text(0) == tr("Planned P/O (firmed)") ) pMenu->addAction(tr("Soften Order..."), this, SLOT(sSoftenOrder())); else pMenu->addAction(tr("Firm Order..."), this, SLOT(sFirmOrder())); pMenu->addAction(tr("Release Order..."), this, SLOT(sReleaseOrder())); pMenu->addAction(tr("Delete Order..."), this, SLOT(sDeleteOrder())); } else if (pSelected->text(0).contains("W/O") && !(pSelected->text(0) == tr("Planned W/O Req. (firmed)") || pSelected->text(0) == tr("Planned W/O Req."))) pMenu->addAction(tr("View Work Order Details..."), this, SLOT(sViewWOInfo())); else if (pSelected->text(0) == tr("S/O")) { menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditSo())); menuItem->setEnabled(_privileges->check("ViewSalesOrders") || _privileges->check("MaintainSalesOrders")); } else if (pSelected->text(0) == tr("T/O")) { menuItem = pMenu->addAction(tr("Edit Transfer Order..."), this, SLOT(sEditTo())); menuItem->setEnabled(_privileges->check("ViewTransferOrders") || _privileges->check("MaintainTransferOrders")); } else if (pSelected->text(0) == tr("P/O")) { menuItem = pMenu->addAction(tr("Edit Purchase Order..."), this, SLOT(sEditPo())); menuItem->setEnabled(_privileges->check("ViewPurchaseOrders") || _privileges->check("MaintainPurchaseOrders")); } } void itemAvailabilityWorkbench::sPopulateMenuAvail( QMenu *pMenu, QTreeWidgetItem * selected ) { XTreeWidgetItem *item = dynamic_cast(selected); QAction *menuItem; menuItem = pMenu->addAction(tr("View Inventory History..."), this, SLOT(sViewHistory())); menuItem->setEnabled(_privileges->check("ViewInventoryHistory")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Allocations..."), this, SLOT(sViewAllocations())); menuItem->setEnabled(item && item->rawValue("allocated").toDouble() != 0.0); menuItem = pMenu->addAction(tr("View Orders..."), this, SLOT(sViewOrders())); menuItem->setEnabled(item && item->rawValue("ordered").toDouble() != 0.0); menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sRunningAvailability())); pMenu->addSeparator(); if (item && (item->altId() == 1)) { menuItem = pMenu->addAction(tr("Create P/R..."), this, SLOT(sCreatePR())); menuItem->setEnabled(_privileges->check("MaintainPurchaseRequests")); menuItem = pMenu->addAction(tr("Create P/O..."), this, SLOT(sCreatePO())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); pMenu->addSeparator(); } else if (item && (item->altId() == 2)) { menuItem = pMenu->addAction(tr("Create W/O..."), this, SLOT(sCreateWO())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); pMenu->addSeparator(); } menuItem = pMenu->addAction(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag())); menuItem->setEnabled(_privileges->check("IssueCountTags")); menuItem = pMenu->addAction(tr("Enter Misc. Inventory Count..."), this, SLOT(sEnterMiscCount())); menuItem->setEnabled(_privileges->check("EnterMiscCounts")); pMenu->addSeparator(); pMenu->addAction(tr("View Substitute Availability..."), this, SLOT(sViewSubstituteAvailability())); } void itemAvailabilityWorkbench::sPopulateMenuCosted( QMenu * pMenu, QTreeWidgetItem * pSelected ) { XTreeWidgetItem *item = dynamic_cast(pSelected); if(! item || !_privileges->check("ViewCosts")) return; if (item->id() != -1) pMenu->addAction(tr("Maintain Item Costs..."), this, SLOT(sMaintainItemCosts())); if (item->id() != -1) pMenu->addAction(tr("View Item Costing..."), this, SLOT(sViewItemCosting())); } void itemAvailabilityWorkbench::sPopulateMenuHistory( QMenu * pMenu, QTreeWidgetItem * pItem ) { QAction *menuItem; menuItem = pMenu->addAction(tr("View Transaction Information..."), this, SLOT(sViewTransInfo())); menuItem = pMenu->addAction(tr("Edit Transaction Information..."), this, SLOT(sEditTransInfo())); if ( (pItem->text(3).length()) && ( (pItem->text(2) == "RM") || (pItem->text(2) == "IM") ) ) { QString orderNumber = _invhist->currentItem()->text(4); int sep1 = orderNumber.indexOf('-'); int sep2 = orderNumber.indexOf('-', (sep1 + 1)); int mainNumber = orderNumber.mid((sep1 + 1), ((sep2 - sep1) - 1)).toInt(); int subNumber = orderNumber.right((orderNumber.length() - sep2) - 1).toInt(); if ( (mainNumber) && (subNumber) ) { menuItem = pMenu->addAction(tr("View Work Order Information..."), this, SLOT(sViewWOInfoHistory())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders") || _privileges->check("ViewWorkOrders")); } } } void itemAvailabilityWorkbench::sPopulateMenuLocation( QMenu * pMenu, QTreeWidgetItem * pSelected ) { QAction *menuItem; XTreeWidgetItem *item = dynamic_cast(pSelected); if (item && item->altId() == -1) { menuItem = pMenu->addAction(tr("Relocate..."), this, SLOT(sRelocateInventory())); menuItem->setEnabled(_privileges->check("RelocateInventory")); menuItem = pMenu->addAction(tr("Reassign Lot/Serial #..."), this, SLOT(sReassignLotSerial())); menuItem->setEnabled(_privileges->check("ReassignLotSerial")); } } void itemAvailabilityWorkbench::sPopulateMenuWhereUsed( QMenu *menu, QTreeWidgetItem * ) { QAction *menuItem; menuItem = menu->addAction(tr("Edit Bill of Materials..."), this, SLOT(sEditBOM())); menuItem->setEnabled(_privileges->check("MaintainBOMs")); menuItem = menu->addAction(tr("Edit Item Master..."), this, SLOT(sEditItem())); menuItem->setEnabled(_privileges->check("MaintainItemMasters")); menuItem = menu->addAction(tr("View Item Inventory History..."), this, SLOT(sViewInventoryHistory())); menuItem->setEnabled(_privileges->check("ViewInventoryHistory")); } void itemAvailabilityWorkbench::sViewHistory() { ParameterList params; params.append("itemsite_id", _invAvailability->id()); params.append("run"); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sViewAllocations() { ParameterList params; params.append("itemsite_id", _invAvailability->id()); params.append("run"); if (_leadTime->isChecked()) params.append("byLeadTime", TRUE); else if (_byDays->isChecked()) params.append("byDays", _days->value() ); else if (_byDate->isChecked()) params.append("byDate", _date->date()); else if (_byDates->isChecked()) { params.append("byRange"); params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } dspAllocations *newdlg = new dspAllocations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sViewOrders() { ParameterList params; params.append("itemsite_id", _invAvailability->id()); params.append("run"); if (_leadTime->isChecked()) params.append("byLeadTime", TRUE); else if (_byDays->isChecked()) params.append("byDays", _days->value()); else if (_byDate->isChecked()) params.append("byDate", _date->date()); else if (_byDates->isChecked()) { params.append("byRange"); params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } dspOrders *newdlg = new dspOrders(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sRunningAvailability() { ParameterList params; params.append("itemsite_id", _invAvailability->id()); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sCreatePR() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", _invAvailability->id()); purchaseRequest newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void itemAvailabilityWorkbench::sCreatePO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", _invAvailability->id()); purchaseOrder *newdlg = new purchaseOrder(); if(newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sCreateWO() { ParameterList params; params.append("mode", "new"); params.append("itemsite_id", _invAvailability->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sIssueCountTag() { ParameterList params; params.append("itemsite_id", _invAvailability->id()); createCountTagsByItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void itemAvailabilityWorkbench::sEnterMiscCount() { ParameterList params; params.append("itemsite_id", _invAvailability->id()); enterMiscCount newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void itemAvailabilityWorkbench::sViewSubstituteAvailability() { ParameterList params; params.append("itemsite_id", _invAvailability->id()); if (_leadTime->isChecked()) params.append("byLeadTime", TRUE); else if (_byDays->isChecked()) params.append("byDays", _days->value() ); else if (_byDate->isChecked()) params.append("byDate", _date->date()); dspSubstituteAvailabilityByItem *newdlg = new dspSubstituteAvailabilityByItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sSoftenOrder() { XSqlQuery itemSoftenOrder; itemSoftenOrder.prepare( "UPDATE planord " "SET planord_firm=FALSE " "WHERE (planord_id=:planord_id);" ); itemSoftenOrder.bindValue(":planord_id", _availability->id()); itemSoftenOrder.exec(); sFillListRunning(); } void itemAvailabilityWorkbench::sFirmOrder() { ParameterList params; params.append("planord_id", _availability->id()); firmPlannedOrder newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillListRunning(); } void itemAvailabilityWorkbench::sReleaseOrder() { // TODO if (_availability->currentItem()->text(0) == tr("Planned W/O (firmed)") || _availability->currentItem()->text(0) == tr("Planned W/O")) { ParameterList params; params.append("mode", "release"); params.append("planord_id", _availability->id()); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); #if 0 if (newdlg.exec() != XDialog::Rejected) { sDeleteOrder(); sFillListRunning(); } #endif } else if (_availability->currentItem()->text(0) == tr("Planned P/O (firmed)") || _availability->currentItem()->text(0) == tr("Planned P/O")) { ParameterList params; params.append("mode", "release"); params.append("planord_id", _availability->id()); purchaseRequest newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillListRunning(); } } void itemAvailabilityWorkbench::sDeleteOrder() { XSqlQuery itemDeleteOrder; itemDeleteOrder.prepare( "SELECT deletePlannedOrder(:planord_id, FALSE);" ); itemDeleteOrder.bindValue(":planord_id", _availability->id()); itemDeleteOrder.exec(); sFillListRunning(); } void itemAvailabilityWorkbench::sMaintainItemCosts() { ParameterList params; params.append("item_id", _bomitem->altId()); maintainItemCosts *newdlg = new maintainItemCosts(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sViewItemCosting() { ParameterList params; params.append( "item_id", _bomitem->altId() ); params.append( "run", TRUE ); dspItemCostSummary *newdlg = new dspItemCostSummary(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sViewTransInfo() { QString transType(((XTreeWidgetItem *)_invhist->currentItem())->text(2)); ParameterList params; params.append("mode", "view"); params.append("invhist_id", _invhist->id()); if (transType == "AD") { adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "TW") { transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "SI") { scrapTrans *newdlg = new scrapTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "EX") { expenseTrans *newdlg = new expenseTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "RX") { materialReceiptTrans *newdlg = new materialReceiptTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (transType == "CC") { countTag newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else { transactionInformation newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void itemAvailabilityWorkbench::sEditTransInfo() { ParameterList params; params.append("mode", "edit"); params.append("invhist_id", _invhist->id()); transactionInformation newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void itemAvailabilityWorkbench::sViewWOInfo() { XSqlQuery itemViewWOInfo; QString orderNumber = _availability->currentItem()->text(1); int sep1 = orderNumber.indexOf('-'); int mainNumber = orderNumber.left(sep1).toInt(); int subNumber = orderNumber.right(orderNumber.length() - sep1 - 1).toInt(); itemViewWOInfo.prepare( "SELECT wo_id " "FROM wo " "WHERE ( (wo_number=:wo_number)" " AND (wo_subnumber=:wo_subnumber) );" ); itemViewWOInfo.bindValue(":wo_number", mainNumber); itemViewWOInfo.bindValue(":wo_subnumber", subNumber); itemViewWOInfo.exec(); if (itemViewWOInfo.first()) { ParameterList params; params.append("mode", "view"); params.append("wo_id", itemViewWOInfo.value("wo_id")); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void itemAvailabilityWorkbench::sViewWOInfoHistory() { XSqlQuery itemViewWOInfoHistory; QString orderNumber = _invhist->currentItem()->text(4); int sep1 = orderNumber.indexOf('-'); int sep2 = orderNumber.indexOf('-', (sep1 + 1)); int mainNumber = orderNumber.mid((sep1 + 1), ((sep2 - sep1) - 1)).toInt(); int subNumber = orderNumber.right((orderNumber.length() - sep2) - 1).toInt(); itemViewWOInfoHistory.prepare( "SELECT wo_id " "FROM wo " "WHERE ( (wo_number=:wo_number)" " AND (wo_subnumber=:wo_subnumber) );" ); itemViewWOInfoHistory.bindValue(":wo_number", mainNumber); itemViewWOInfoHistory.bindValue(":wo_subnumber", subNumber); itemViewWOInfoHistory.exec(); if (itemViewWOInfoHistory.first()) { ParameterList params; params.append("mode", "view"); params.append("wo_id", itemViewWOInfoHistory.value("wo_id")); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void itemAvailabilityWorkbench::sEditSo() { ParameterList params; if (_privileges->check("MaintainSalesOrders")) salesOrder::editSalesOrder(_availability->id(), true); else salesOrder::viewSalesOrder(_availability->id()); } void itemAvailabilityWorkbench::sEditTo() { ParameterList params; if (_privileges->check("MaintainTransferOrders")) transferOrder::editTransferOrder(_availability->id(), true); else transferOrder::viewTransferOrder(_availability->id()); } void itemAvailabilityWorkbench::sEditPo() { ParameterList params; if (_privileges->check("MaintainPurchaseOrders")) params.append("mode", "edit"); else params.append("mode", "view"); params.append("pohead_id", _availability->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sRelocateInventory() { ParameterList params; params.append("itemloc_id", _itemloc->id()); relocateInventory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec()) sFillListItemloc(); } void itemAvailabilityWorkbench::sReassignLotSerial() { ParameterList params; params.append("itemloc_id", _itemloc->id()); reassignLotSerial newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillListItemloc(); } void itemAvailabilityWorkbench::sEditBOM() { ParameterList params; params.append("mode", "edit"); params.append("item_id", _whereused->id()); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sEditItem() { item::editItem(_whereused->id()); } void itemAvailabilityWorkbench::sViewInventoryHistory() { ParameterList params; params.append("item_id", _whereused->altId()); params.append("warehous_id", -1); params.append("run"); dspInventoryHistory *newdlg = new dspInventoryHistory(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemAvailabilityWorkbench::sClearQueries() { _invAvailability->clear(); _invhist->clear(); _itemloc->clear(); } qt-client-4.1.0/guiclient/itemAvailabilityWorkbench.h000066400000000000000000000060421217451700100227040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMAVAILABILITYWORKBENCH_H #define ITEMAVAILABILITYWORKBENCH_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_itemAvailabilityWorkbench.h" class itemAvailabilityWorkbench : public XWidget, public Ui::itemAvailabilityWorkbench { Q_OBJECT public: itemAvailabilityWorkbench(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~itemAvailabilityWorkbench(); virtual bool setParamsCosted(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void setParams(ParameterList & params); virtual void sFillListWhereUsed(); virtual void sFillListItemloc(); virtual void sFillListInvhist(); virtual void sFillListCosted(); virtual void sFillListRunning(); virtual void sHandleResort(); virtual void sHandleShowReorder( bool pValue ); virtual void sFillListAvail(); virtual void sPrintRunning(); virtual void sPrintAvail(); virtual void sPrintCosted(); virtual void sPrintHistory(); virtual void sPrintLocation(); virtual void sPrintWhereUsed(); virtual void sPopulateMenuRunning( QMenu*, QTreeWidgetItem* ); virtual void sPopulateMenuAvail( QMenu*, QTreeWidgetItem* ); virtual void sPopulateMenuCosted( QMenu*, QTreeWidgetItem* ); virtual void sPopulateMenuHistory( QMenu*, QTreeWidgetItem* ); virtual void sPopulateMenuLocation( QMenu*, QTreeWidgetItem* ); virtual void sPopulateMenuWhereUsed( QMenu*, QTreeWidgetItem* ); virtual void sViewHistory(); virtual void sViewAllocations(); virtual void sViewOrders(); virtual void sRunningAvailability(); virtual void sCreatePR(); virtual void sCreatePO(); virtual void sCreateWO(); virtual void sIssueCountTag(); virtual void sEnterMiscCount(); virtual void sViewSubstituteAvailability(); virtual void sSoftenOrder(); virtual void sFirmOrder(); virtual void sReleaseOrder(); virtual void sDeleteOrder(); virtual void sMaintainItemCosts(); virtual void sViewItemCosting(); virtual void sViewTransInfo(); virtual void sEditTransInfo(); virtual void sViewWOInfo(); virtual void sViewWOInfoHistory(); virtual void sEditSo(); virtual void sEditTo(); virtual void sEditPo(); virtual void sRelocateInventory(); virtual void sReassignLotSerial(); virtual void sEditBOM(); virtual void sEditItem(); virtual void sViewInventoryHistory(); virtual void sClearQueries(); protected slots: virtual void languageChange(); private: QButtonGroup* _costsGroupInt; }; #endif // ITEMAVAILABILITYWORKBENCH_H qt-client-4.1.0/guiclient/itemAvailabilityWorkbench.ui000066400000000000000000001712021217451700100230730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemAvailabilityWorkbench 0 0 800 600 Item Availability Workbench 12 12 5 Qt::StrongFocus 0 Qt::Horizontal QSizePolicy::Expanding 31 20 0 &Close Qt::Vertical QSizePolicy::Preferred 20 34 0 Running 5 7 0 5 0 1 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Preferred 0 20 Show Planned Orders Qt::Vertical QSizePolicy::Preferred 10 0 5 0 QOH: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Multiple: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Reorder Level: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Up To Qty: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 16 20 0 false &Print Qt::Vertical QSizePolicy::Preferred 20 0 0 Running Availability: Inventory Show Availability as of: Item Site Lead Time true true Look Ahead Days: 0 false 0 1000 Qt::Horizontal QSizePolicy::MinimumExpanding 0 10 Cutoff Date: 0 false 0 0 100 32767 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 Dates: 2 false to false Qt::Vertical 20 0 Show 5 0 0 Reorder Exceptions Qt::Horizontal QSizePolicy::Expanding 13 13 0 Qt::Horizontal QSizePolicy::Preferred 20 20 false Ignore Reorder at 0 Qt::Horizontal QSizePolicy::Preferred 20 20 0 Only Show Shortages Qt::Horizontal QSizePolicy::Preferred 20 20 false Qt::Horizontal QSizePolicy::Expanding 0 20 0 false &Query false &Print Qt::Vertical QSizePolicy::Expanding 76 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 Availability: 0 0 0 0 32767 32767 Bill of Materials 5 0 Show Costs true false Use Standard Costs true Use Actual Costs Qt::Vertical QSizePolicy::Preferred 20 0 0 Qt::Horizontal QSizePolicy::Expanding 16 20 0 false &Print Qt::Vertical QSizePolicy::Preferred 20 0 0 Costed Bill of Materials: 0 0 0 100 History false 5 Transaction Types: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 41 20 Qt::Horizontal QSizePolicy::Expanding 38 150 0 5 false &Query true true false &Print Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 0 0 0 0 Inventory History: Qt::AlignVCenter 0 0 0 100 Inventory Detail 5 0 false Qt::Vertical QSizePolicy::Preferred 20 0 Qt::Horizontal QSizePolicy::Expanding 0 20 0 0 false &Query true true false &Print Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 Locations: 0 0 0 100 Where Used 5 5 Effective: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 370 20 false &Print 0 Bill of Materials Items: 0 0 0 100 DateCluster QWidget
    datecluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    1
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _item _warehouse _showPlanned _availability _runPrint _tab _leadTime _byDays _days _byDate _date _byDates _startDate _endDate _showReorder _ignoreReorderAtZero _showShortages _invWarehouse _invQuery _invAvailability _availPrint _useStandardCosts _bomitem _costedPrint _invhistWarehouse _dates _transType _invhistQuery _invhist _histPrint _itemlocWarehouse _itemlocQuery _itemloc _locPrint _effective _whereused _wherePrint _close _close clicked() itemAvailabilityWorkbench close() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item newId(int) _invhistWarehouse findItemSites(int) 20 20 20 20 _item newId(int) _invWarehouse findItemSites(int) 20 20 20 20 _item newId(int) _itemlocWarehouse findItemSites(int) 20 20 20 20 _item valid(bool) _availPrint setEnabled(bool) 20 20 20 20 _item valid(bool) _costedPrint setEnabled(bool) 20 20 20 20 _byDate toggled(bool) _date setEnabled(bool) 20 20 20 20 _byDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _item valid(bool) _histPrint setEnabled(bool) 20 20 20 20 _showReorder toggled(bool) _ignoreReorderAtZero setEnabled(bool) 20 20 20 20 _item valid(bool) _invhistQuery setEnabled(bool) 20 20 20 20 _item valid(bool) _invQuery setEnabled(bool) 20 20 20 20 _item valid(bool) _itemlocQuery setEnabled(bool) 20 20 20 20 _item valid(bool) _locPrint setEnabled(bool) 20 20 20 20 _item valid(bool) _runPrint setEnabled(bool) 20 20 20 20 _item valid(bool) _wherePrint setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/itemCharacteristicDelegate.cpp000066400000000000000000000123411217451700100233440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "characteristic.h" #include "datecluster.h" #include "itemCharacteristicDelegate.h" #include "guiclient.h" #include "xt.h" ItemCharacteristicDelegate::ItemCharacteristicDelegate(QObject *parent) : QItemDelegate(parent) { } QWidget *ItemCharacteristicDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem & /*style*/, const QModelIndex & index) const { if(index.column()!=1) return 0; QModelIndex idx = index.sibling(index.row(), CHAR); characteristic::Type chartype = characteristic::Text; // Determine what type we have XSqlQuery qry; qry.prepare("SELECT char_id, char_type " "FROM char " "WHERE (char_id=:char_id); "); qry.bindValue(":char_id", idx.model()->data(idx, Qt::UserRole)); qry.exec(); if (qry.first()) chartype = (characteristic::Type)qry.value("char_type").toInt(); if (chartype == characteristic::Text || chartype == characteristic::List) { qry.prepare("SELECT charass_value " "FROM char, charass " " LEFT OUTER JOIN charopt ON ((charopt_char_id=charass_char_id) " " AND (charopt_value=charass_value)) " "WHERE ((charass_char_id=char_id)" " AND (charass_target_type='I')" " AND (charass_target_id=:item_id)" " AND (char_id=:char_id) ) " "ORDER BY COALESCE(charopt_order,0), charass_value;"); qry.bindValue(":char_id", idx.model()->data(idx, Qt::UserRole)); qry.bindValue(":item_id", index.model()->data(index, Xt::IdRole)); qry.exec(); QComboBox *editor = new QComboBox(parent); editor->setEditable(chartype == characteristic::Text); #ifdef Q_WS_MAC QFont boxfont = editor->font(); boxfont.setPointSize((boxfont.pointSize() == -1) ? boxfont.pixelSize() - 3 : boxfont.pointSize() - 3); editor->setFont(boxfont); #endif while(qry.next()) editor->addItem(qry.value("charass_value").toString()); editor->installEventFilter(const_cast(this)); return editor; } else if (chartype == characteristic::Date) { DLineEdit *editor = new DLineEdit(parent); return editor; } return 0; } void ItemCharacteristicDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { if (editor->inherits("QComboBox")) { QString value = index.model()->data(index, Qt::DisplayRole).toString(); QComboBox *comboBox = static_cast(editor); int curIdx = comboBox->findText(value); if(curIdx != -1) comboBox->setCurrentIndex(curIdx); else comboBox->setEditText(value); } else if (editor->inherits("DLineEdit")) { QDate date = index.model()->data(index, Qt::UserRole).toDate(); DLineEdit *dlineedit = static_cast(editor); dlineedit->setDate(date); } } void ItemCharacteristicDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { XSqlQuery ItemetModelData; QComboBox *comboBox = static_cast(editor); QModelIndex charidx = index.sibling(index.row(), CHAR); QModelIndex priceidx = index.sibling(index.row(), PRICE); QVariant charVars; QVariantList listVars; if (priceidx.model()) charVars.setValue(priceidx.model()->data(priceidx, Qt::UserRole).toList()); listVars=charVars.toList(); if (editor->inherits("QComboBox")) { if (listVars.value(CUST_ID).toInt()) { ItemetModelData.prepare("SELECT itemcharprice(:item_id,:char_id,:value,:cust_id,:shipto_id,:qty,:curr_id,:effective)::numeric(16,4) AS price;"); ItemetModelData.bindValue(":item_id" , listVars.value(ITEM_ID).toInt()); ItemetModelData.bindValue(":char_id" , charidx.model()->data(charidx, Qt::UserRole)); ItemetModelData.bindValue(":value" , comboBox->currentText()); ItemetModelData.bindValue(":cust_id" , listVars.value(CUST_ID)); ItemetModelData.bindValue(":shipto_id", listVars.value(SHIPTO_ID)); ItemetModelData.bindValue(":qty" , listVars.value(QTY)); ItemetModelData.bindValue(":curr_id" , listVars.value(CURR_ID)); ItemetModelData.bindValue(":effective", listVars.value(EFFECTIVE)); ItemetModelData.exec(); if (ItemetModelData.first()) model->setData(priceidx, ItemetModelData.value("price").toString()); } model->setData(index, comboBox->currentText()); } else if (editor->inherits("DLineEdit")) { DLineEdit *dlineedit = static_cast(editor); model->setData(index, dlineedit->date()); } } void ItemCharacteristicDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const { editor->setGeometry(option.rect); } qt-client-4.1.0/guiclient/itemCharacteristicDelegate.h000066400000000000000000000026611217451700100230150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ITEMCHARACTERISTICDELEGATE_H__ #define __ITEMCHARACTERISTICDELEGATE_H__ #include #include #include #include class ItemCharacteristicDelegate : public QItemDelegate { Q_OBJECT public: ItemCharacteristicDelegate(QObject * parent = 0); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; private: enum { CHAR = 0, VALUE = 1, PRICE = 2 }; enum { ITEM_ID = 0, CUST_ID = 1, SHIPTO_ID = 2, QTY = 3, CURR_ID = 4, EFFECTIVE = 5 }; }; #endif qt-client-4.1.0/guiclient/itemCost.cpp000066400000000000000000000312011217451700100176650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemCost.h" #include #include #include #include "currcluster.h" #include "mqlutil.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "storedProcErrorLookup.h" #define cItemCost 0x01 #define cBOMItemCost 0x02 static bool _foundCostElems; itemCost::itemCost(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _captive = false; _itemcostid = -1; _postCost->setEnabled(_privileges->check("PostActualCosts")); _foundCostElems = true; // assume it's true until sPopulateCostelem } itemCost::~itemCost() { // no need to delete child widgets, Qt does it all for us } void itemCost::languageChange() { retranslateUi(this); } enum SetResponse itemCost::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); _captive = true; QVariant param; bool valid; param = pParams.value("bomitem_id", &valid); if (valid) { _type = cBOMItemCost; _bomitemid = param.toInt(); itemet.prepare( "SELECT bomitem_item_id " "FROM bomitem " "WHERE (bomitem_id=:bomitem_id);" ); itemet.bindValue(":bomitem_id", _bomitemid); itemet.exec(); if (itemet.first()) { _item->setId(itemet.value("bomitem_item_id").toInt()); _item->setReadOnly(TRUE); } } param = pParams.value("bomitem_item_id", &valid); if (valid) { _type = cBOMItemCost; _item->setId(param.toInt()); _item->setReadOnly(TRUE); } param = pParams.value("bomitemcost_id", &valid); if (valid) { _type = cBOMItemCost; _itemcostid = param.toInt(); _item->setReadOnly(TRUE); itemet.prepare( "SELECT bomitem_item_id, formatBoolYN(bomitemcost_lowlevel) AS lowlevel," " bomitemcost_actcost, bomitemcost_curr_id, bomitemcost_updated " "FROM bomitem, bomitemcost " "WHERE ( (bomitemcost_bomitem_id=bomitem_id)" " AND (bomitemcost_id=:bomitemcost_id) );" ); itemet.bindValue(":bomitemcost_id", _itemcostid); itemet.exec(); if (itemet.first()) { _item->setId(itemet.value("bomitem_item_id").toInt()); _lowerLevel->setText(itemet.value("lowlevel").toString()); _actualCost->set(itemet.value("bomitemcost_actcost").toDouble(), itemet.value("bomitemcost_curr_id").toInt(), QDate::currentDate(), false); } else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, itemet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("item_id", &valid); if (valid) { _type = cItemCost; _item->setId(param.toInt()); _item->setReadOnly(TRUE); } param = pParams.value("itemcost_id", &valid); if (valid) { _type = cItemCost; _itemcostid = param.toInt(); _item->setReadOnly(TRUE); itemet.prepare( "SELECT item_id, formatBoolYN(itemcost_lowlevel) AS lowlevel," " itemcost_actcost, itemcost_curr_id, itemcost_updated " "FROM item, itemcost " "WHERE ( (itemcost_item_id=item_id)" " AND (itemcost_id=:itemcost_id) );" ); itemet.bindValue(":itemcost_id", _itemcostid); itemet.exec(); if (itemet.first()) { _item->setId(itemet.value("item_id").toInt()); _lowerLevel->setText(itemet.value("lowlevel").toString()); _actualCost->set(itemet.value("itemcost_actcost").toDouble(), itemet.value("itemcost_curr_id").toInt(), QDate::currentDate(), false); } else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, itemet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _lowerLevel->hide(); _lowerLevelLit->hide(); if (_type == cItemCost) setWindowTitle("Create Item Cost"); else setWindowTitle("Create BOM Item Cost"); } else if (param.toString() == "edit") { _mode = cEdit; _costelem->setEnabled(false); if (_type == cItemCost) setWindowTitle("Enter Actual Cost"); else setWindowTitle("Enter BOM Item Actual Cost"); } else if (param.toString() == "view") { _actualCost->setEnabled(false); _costelem->setEnabled(false); _postCost->setEnabled(false); _save->hide(); _close->setText("&Close"); if (_type == cItemCost) setWindowTitle("View Actual Cost"); else setWindowTitle("View BOM Item Actual Cost"); } } sPopulateCostelem(); return _foundCostElems ? NoError : UndefinedError; } void itemCost::sSave() { XSqlQuery itemSave; if (_mode != cNew && _mode != cEdit) done(_itemcostid); QList errors; errors << GuiErrorCheck(_costelem->id() < 0, _costelem, tr("You must select a Costing Element to save this Item Cost.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Item Cost"), errors)) return; if (_type == cItemCost) { if (_mode == cNew) { itemSave.exec("SELECT NEXTVAL('itemcost_itemcost_id_seq') AS itemcost_id;"); if (itemSave.first()) { _itemcostid = itemSave.value("itemcost_id").toInt(); itemSave.prepare( "INSERT INTO itemcost " "( itemcost_id, itemcost_item_id," " itemcost_costelem_id, itemcost_lowlevel," " itemcost_stdcost, itemcost_posted," " itemcost_actcost, itemcost_updated, " " itemcost_curr_id ) " "VALUES " "( :itemcost_id, :itemcost_item_id," " :itemcost_costelem_id, FALSE," " 0, startOfTime()," " :itemcost_actcost, CURRENT_DATE, " " :itemcost_curr_id );" ); itemSave.bindValue(":itemcost_item_id", _item->id()); itemSave.bindValue(":itemcost_costelem_id", _costelem->id()); } } else if (_mode == cEdit) { itemSave.prepare( "UPDATE itemcost SET" " itemcost_actcost=:itemcost_actcost," " itemcost_curr_id=:itemcost_curr_id, " " itemcost_updated=CURRENT_DATE " "WHERE (itemcost_id=:itemcost_id);"); } itemSave.bindValue(":itemcost_id", _itemcostid); itemSave.bindValue(":itemcost_actcost", _actualCost->localValue()); itemSave.bindValue(":itemcost_curr_id", _actualCost->id()); if (itemSave.exec() && _postCost->isChecked()) { itemSave.prepare("SELECT postCost(:itemcost_id) AS result;"); itemSave.bindValue(":itemcost_id", _itemcostid); itemSave.exec(); if (itemSave.first()) { int result = itemSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postCost", result), __FILE__, __LINE__); return; } } } if (itemSave.lastError().type() != QSqlError::NoError) // if EITHER itemSave.exec() failed { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (_type == cBOMItemCost) { if (_mode == cNew) { itemSave.exec("SELECT NEXTVAL('bomitemcost_bomitemcost_id_seq') AS itemcost_id;"); if (itemSave.first()) { _itemcostid = itemSave.value("itemcost_id").toInt(); itemSave.prepare( "INSERT INTO bomitemcost " "( bomitemcost_id, bomitemcost_bomitem_id," " bomitemcost_costelem_id, bomitemcost_lowlevel," " bomitemcost_stdcost, bomitemcost_posted," " bomitemcost_actcost, bomitemcost_updated, " " bomitemcost_curr_id ) " "VALUES " "( :bomitemcost_id, :bomitemcost_bomitem_id," " :bomitemcost_costelem_id, FALSE," " 0, startOfTime()," " :bomitemcost_actcost, CURRENT_DATE, " " :bomitemcost_curr_id );" ); itemSave.bindValue(":bomitemcost_bomitem_id", _bomitemid); itemSave.bindValue(":bomitemcost_costelem_id", _costelem->id()); } } else if (_mode == cEdit) { itemSave.prepare( "UPDATE bomitemcost SET" " bomitemcost_actcost=:bomitemcost_actcost," " bomitemcost_curr_id=:bomitemcost_curr_id, " " bomitemcost_updated=CURRENT_DATE " "WHERE (bomitemcost_id=:bomitemcost_id);"); } itemSave.bindValue(":bomitemcost_id", _itemcostid); itemSave.bindValue(":bomitemcost_actcost", _actualCost->localValue()); itemSave.bindValue(":bomitemcost_curr_id", _actualCost->id()); if (itemSave.exec() && _postCost->isChecked()) { itemSave.prepare("UPDATE bomitemcost SET bomitemcost_stdcost=round(currToBase(bomitemcost_curr_id, bomitemcost_actcost, CURRENT_DATE),6), " " bomitemcost_posted=CURRENT_DATE " "WHERE bomitemcost_id=:bomitemcost_id;"); itemSave.bindValue(":bomitemcost_id", _itemcostid); itemSave.exec(); } if (itemSave.lastError().type() != QSqlError::NoError) // if EITHER itemSave.exec() failed { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return; } } done(_itemcostid); } void itemCost::sPopulateCostelem() { XSqlQuery itemPopulateCostelem; if (_type == cItemCost) { if (_mode == cNew) { ParameterList params; params.append("item_id", _item->id()); params.append("itemtype", _item->itemType()); itemPopulateCostelem = mqlLoad("costelem", "unusedbyitem").toQuery(params); _costelem->populate(itemPopulateCostelem); if (itemPopulateCostelem.size() <= 0) { QMessageBox::warning(this, tr("No Costing Elements Remaining"), tr("

    Item %1 already has all available costing " "elements assigned. No new Item Costs can be " "created for it until more costing elements are " "defined.") .arg(_item->itemNumber())); _foundCostElems = false; } } else // _mode == cEdit || cView) { QString sql( "SELECT costelem_id, costelem_type " "FROM costelem, itemcost " "WHERE ((costelem_id=itemcost_costelem_id)" " AND (itemcost_id=:itemcost_id));"); itemPopulateCostelem.prepare(sql); itemPopulateCostelem.bindValue(":itemcost_id", _itemcostid); itemPopulateCostelem.exec(); _costelem->populate(itemPopulateCostelem); } } if (_type == cBOMItemCost) { if (_mode == cNew) { ParameterList params; params.append("bomitem_id", _bomitemid); params.append("itemtype", _item->itemType()); itemPopulateCostelem = mqlLoad("costelem", "unusedbyitem").toQuery(params); _costelem->populate(itemPopulateCostelem); if (itemPopulateCostelem.size() <= 0) { QMessageBox::warning(this, tr("No Costing Elements Remaining"), tr("

    BOM Item %1 already has all available costing " "elements assigned. No new BOM Item Costs can be " "created for it until more costing elements are " "defined.") .arg(_item->itemNumber())); _foundCostElems = false; } } else // _mode == cEdit || cView) { QString sql( "SELECT costelem_id, costelem_type " "FROM costelem, bomitemcost " "WHERE ((costelem_id=bomitemcost_costelem_id)" " AND (bomitemcost_id=:itemcost_id));"); itemPopulateCostelem.prepare(sql); itemPopulateCostelem.bindValue(":itemcost_id", _itemcostid); itemPopulateCostelem.exec(); _costelem->populate(itemPopulateCostelem); } } } qt-client-4.1.0/guiclient/itemCost.h000066400000000000000000000020771217451700100173430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMCOST_H #define ITEMCOST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemCost.h" class itemCost : public XDialog, public Ui::itemCost { Q_OBJECT public: itemCost(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemCost(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sPopulateCostelem(); protected slots: virtual void languageChange(); private: bool _captive; int _itemcostid; int _mode; int _type; int _bomitemid; }; #endif // ITEMCOST_H qt-client-4.1.0/guiclient/itemCost.ui000066400000000000000000000136771217451700100175410ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemCost 0 0 492 195 Item Cost 0 5 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 0 Costing Element: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Lower Level: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 5 Actual Cost: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing CurrDisplay::Cost false &Post Cost to Standard CurrCluster CurrDisplay

    currcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    XComboBox QComboBox
    xcombobox.h
    _item _costelem _actualCost _postCost _save _close parameter.h _close clicked() itemCost reject() 20 20 20 20 qt-client-4.1.0/guiclient/itemGroup.cpp000066400000000000000000000146271217451700100200660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemGroup.h" #include #include #include "itemcluster.h" itemGroup::itemGroup(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); _itemgrpitem->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _itemgrpitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); } itemGroup::~itemGroup() { // no need to delete child widgets, Qt does it all for us } void itemGroup::languageChange() { retranslateUi(this); } enum SetResponse itemGroup::set(const ParameterList &pParams) { XSqlQuery itemet; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("itemgrp_id", &valid); if (valid) { _itemgrpid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; itemet.exec("SELECT NEXTVAL('itemgrp_itemgrp_id_seq') AS itemgrp_id;"); if (itemet.first()) _itemgrpid = itemet.value("itemgrp_id").toInt(); // ToDo connect(_itemgrpitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _mode = cEdit; connect(_itemgrpitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _new->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void itemGroup::sCheck() { XSqlQuery itemCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length())) { itemCheck.prepare( "SELECT itemgrp_id " "FROM itemgrp " "WHERE (UPPER(itemgrp_name)=UPPER(:itemgrp_name));" ); itemCheck.bindValue(":itemgrp_name", _name->text()); itemCheck.exec(); if (itemCheck.first()) { _itemgrpid = itemCheck.value("itemgrp_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void itemGroup::sClose() { XSqlQuery itemClose; if (_mode == cNew) { itemClose.prepare( "DELETE FROM itemgrpitem " "WHERE (itemgrpitem_itemgrp_id=:itemgrp_id);" "DELETE FROM itemgrp " "WHERE (itemgrp_id=:itemgrp_id);" ); itemClose.bindValue(":itemgrp_id", _itemgrpid); itemClose.exec(); } close(); } void itemGroup::sSave() { XSqlQuery itemSave; if (_name->text().trimmed().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Item Group"), tr("You must enter a Name for this Item Group before you may save it.") ); _name->setFocus(); return; } if (_mode == cNew) itemSave.prepare( "INSERT INTO itemgrp " "(itemgrp_id, itemgrp_name, itemgrp_descrip) " "VALUES " "(:itemgrp_id, :itemgrp_name, :itemgrp_descrip);" ); else itemSave.prepare( "UPDATE itemgrp " "SET itemgrp_name=:itemgrp_name, itemgrp_descrip=:itemgrp_descrip " "WHERE (itemgrp_id=:itemgrp_id);" ); itemSave.bindValue(":itemgrp_id", _itemgrpid); itemSave.bindValue(":itemgrp_name", _name->text()); itemSave.bindValue(":itemgrp_descrip", _descrip->text()); itemSave.exec(); omfgThis->sItemGroupsUpdated(_itemgrpid, TRUE); close(); } void itemGroup::sDelete() { XSqlQuery itemDelete; itemDelete.prepare( "DELETE FROM itemgrpitem " "WHERE (itemgrpitem_id=:itemgrpitem_id);" ); itemDelete.bindValue(":itemgrpitem_id", _itemgrpitem->id()); itemDelete.exec(); sFillList(); } void itemGroup::sNew() { XSqlQuery itemNew; ParameterList params; itemList* newdlg = new itemList(this); newdlg->set(params); int itemid = newdlg->exec(); if (itemid != -1) { itemNew.prepare( "SELECT itemgrpitem_id " "FROM itemgrpitem " "WHERE ( (itemgrpitem_itemgrp_id=:itemgrp_id)" " AND (itemgrpitem_item_id=:item_id) );" ); itemNew.bindValue(":itemgrp_id", _itemgrpid); itemNew.bindValue(":item_id", itemid); itemNew.exec(); if (itemNew.first()) { QMessageBox::warning( this, tr("Cannot Add Item to Item Group"), tr("The selected Item is already a member of this Item Group") ); return; } itemNew.prepare( "INSERT INTO itemgrpitem " "(itemgrpitem_itemgrp_id, itemgrpitem_item_id) " "VALUES " "(:itemgrpitem_itemgrp_id, :itemgrpitem_item_id);" ); itemNew.bindValue(":itemgrpitem_itemgrp_id", _itemgrpid); itemNew.bindValue(":itemgrpitem_item_id", itemid); itemNew.exec(); sFillList(); } } void itemGroup::sFillList() { XSqlQuery itemFillList; itemFillList.prepare( "SELECT itemgrpitem_id, item_number, (item_descrip1 || ' ' || item_descrip2) AS item_descrip " "FROM itemgrpitem, item " "WHERE ( (itemgrpitem_item_id=item_id) " " AND (itemgrpitem_itemgrp_id=:itemgrp_id) ) " "ORDER BY item_number;" ); itemFillList.bindValue(":itemgrp_id", _itemgrpid); itemFillList.exec(); _itemgrpitem->populate(itemFillList); } void itemGroup::populate() { XSqlQuery itempopulate; itempopulate.prepare( "SELECT itemgrp_name, itemgrp_descrip " "FROM itemgrp " "WHERE (itemgrp_id=:itemgrp_id);" ); itempopulate.bindValue(":itemgrp_id", _itemgrpid); itempopulate.exec(); if (itempopulate.first()) { _name->setText(itempopulate.value("itemgrp_name").toString()); _descrip->setText(itempopulate.value("itemgrp_descrip").toString()); sFillList(); } } qt-client-4.1.0/guiclient/itemGroup.h000066400000000000000000000022101217451700100175140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMGROUP_H #define ITEMGROUP_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_itemGroup.h" class itemGroup : public XWidget, public Ui::itemGroup { Q_OBJECT public: itemGroup(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~itemGroup(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sCheck(); virtual void sClose(); virtual void sSave(); virtual void sDelete(); virtual void sNew(); virtual void sFillList(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _itemgrpid; }; #endif // ITEMGROUP_H qt-client-4.1.0/guiclient/itemGroup.ui000066400000000000000000000307001217451700100177070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemGroup 0 0 517 298 Item Group 0 7 5 7 0 5 0 5 Name: Qt::AlignVCenter|Qt::AlignRight Description: Qt::AlignVCenter|Qt::AlignRight 0 5 0 0 20 20 Expanding Horizontal 0 0 &Save true true 20 20 Preferred Vertical 0 0 &Close 20 20 Preferred Vertical 0 0 Member Items: 0 7 7 7 0 0 0 100 0 0 0 0 &New false Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _name _descrip _itemgrpitem _new _delete _save _close parameter.h
    qt-client-4.1.0/guiclient/itemGroups.cpp000066400000000000000000000060661217451700100202470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemGroups.h" #include #include "itemGroup.h" #include "guiclient.h" itemGroups::itemGroups(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_itemgrp, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); _itemgrp->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "itemgrp_name" ); _itemgrp->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemgrp_descrip" ); if (_privileges->check("MaintainItemGroups")) { connect(_itemgrp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_itemgrp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_itemgrp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_itemgrp, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(omfgThis, SIGNAL(itemGroupsUpdated(int, bool)), this, SLOT(sFillList(int))); sFillList(-1); } itemGroups::~itemGroups() { // no need to delete child widgets, Qt does it all for us } void itemGroups::languageChange() { retranslateUi(this); } void itemGroups::sDelete() { XSqlQuery itemDelete; itemDelete.prepare( "DELETE FROM itemgrpitem " "WHERE (itemgrpitem_itemgrp_id=:itemgrp_id);" "DELETE FROM itemgrp " "WHERE (itemgrp_id=:itemgrp_id);" ); itemDelete.bindValue(":itemgrp_id", _itemgrp->id()); itemDelete.exec(); sFillList(-1); } void itemGroups::sNew() { ParameterList params; params.append("mode", "new"); itemGroup *newdlg = new itemGroup(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemGroups::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("itemgrp_id", _itemgrp->id()); itemGroup *newdlg = new itemGroup(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemGroups::sView() { ParameterList params; params.append("mode", "view"); params.append("itemgrp_id", _itemgrp->id()); itemGroup *newdlg = new itemGroup(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemGroups::sFillList(int) { _itemgrp->populate( "SELECT itemgrp_id, itemgrp_name, itemgrp_descrip " "FROM itemgrp " "ORDER BY itemgrp_name;" ); } qt-client-4.1.0/guiclient/itemGroups.h000066400000000000000000000017021217451700100177040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMGROUPS_H #define ITEMGROUPS_H #include "xwidget.h" #include "ui_itemGroups.h" class itemGroups : public XWidget, public Ui::itemGroups { Q_OBJECT public: itemGroups(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~itemGroups(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(int pId); protected slots: virtual void languageChange(); }; #endif // ITEMGROUPS_H qt-client-4.1.0/guiclient/itemGroups.ui000066400000000000000000000126151217451700100200770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemGroups 0 0 357 277 List Item Groups 0 0 Item Groups: 7 7 0 0 0 5 &Close 0 0 &New false &Edit false &View false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _itemgrp _new _edit _view _delete _close _close clicked() itemGroups close() _itemgrp valid(bool) _view setEnabled(bool)
    qt-client-4.1.0/guiclient/itemImages.cpp000066400000000000000000000062471217451700100201760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemImages.h" #include #include #include itemImages::itemImages(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_prev, SIGNAL(clicked()), this, SLOT(sPrevious())); connect(_next, SIGNAL(clicked()), this, SLOT(sNext())); connect(_item, SIGNAL(newId(int)), this, SLOT(sFillList())); #ifndef Q_WS_MAC _prev->setMaximumWidth(25); _next->setMaximumWidth(25); #endif } itemImages::~itemImages() { // no need to delete child widgets, Qt does it all for us } void itemImages::languageChange() { retranslateUi(this); } enum SetResponse itemImages::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); return NoError; } void itemImages::sPrevious() { _images.prev(); loadImage(); } void itemImages::sNext() { _images.next(); loadImage(); } void itemImages::sFillList() { _images.prepare( "SELECT imageass_id, image_data, image_descrip," " CASE WHEN (imageass_purpose='I') THEN :inventoryDescription" " WHEN (imageass_purpose='P') THEN :productDescription" " WHEN (imageass_purpose='E') THEN :engineeringReference" " WHEN (imageass_purpose='M') THEN :miscellaneous" " ELSE :other" " END AS purpose " "FROM imageass, image " "WHERE ( (imageass_image_id=image_id)" " AND (imageass_source_id=:item_id) " " AND (imageass_source='I') ) " "ORDER BY image_name;" ); _images.bindValue(":item_id", _item->id()); _images.bindValue(":inventoryDescription", tr("Inventory Description")); _images.bindValue(":productDescription", tr("Product Description")); _images.bindValue(":engineeringReference", tr("Engineering Reference")); _images.bindValue(":miscellaneous", tr("Miscellaneous")); _images.bindValue(":other", tr("Other")); _images.exec(); if (_images.first()) loadImage(); else { _prev->setEnabled(FALSE); _next->setEnabled(FALSE); _image->clear(); } } void itemImages::loadImage() { _prev->setEnabled(_images.at() != 0); _next->setEnabled(_images.at() < (_images.size() - 1)); _description->setText(_images.value("purpose").toString() + " - " + _images.value("image_descrip").toString()); QImage image; image.loadFromData(QUUDecode(_images.value("image_data").toString())); _image->setPixmap(QPixmap::fromImage(image)); } qt-client-4.1.0/guiclient/itemImages.h000066400000000000000000000020701217451700100176310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMIMAGES_H #define ITEMIMAGES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_itemImages.h" class itemImages : public XWidget, public Ui::itemImages { Q_OBJECT public: itemImages(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~itemImages(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sPrevious(); virtual void sNext(); virtual void sFillList(); virtual void loadImage(); protected slots: virtual void languageChange(); private: XSqlQuery _images; }; #endif // ITEMIMAGES_H qt-client-4.1.0/guiclient/itemImages.ui000066400000000000000000000147661217451700100200360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemImages 0 0 623 423 List Item Images 0 7 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 2 0 5 Image Description: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 7 5 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 5 false << false >> 0 0 &Close Qt::Vertical 20 20 7 7 0 0 QFrame::Box false Qt::AlignCenter ItemCluster QWidget
    itemcluster.h
    1
    _close clicked() itemImages close() 20 20 20 20
    qt-client-4.1.0/guiclient/itemListPrice.cpp000066400000000000000000000113651217451700100206640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemListPrice.h" #include #include #include itemListPrice::itemListPrice(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_item, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulate())); connect(_listPrice, SIGNAL(editingFinished()), this, SLOT(sUpdateMargins())); _item->setType(ItemLineEdit::cSold); _listPrice->setValidator(omfgThis->priceVal()); _extPrice->setPrecision(omfgThis->priceVal()); _stdCost->setPrecision(omfgThis->costVal()); _actCost->setPrecision(omfgThis->costVal()); _extStdCost->setPrecision(omfgThis->costVal()); _extActCost->setPrecision(omfgThis->costVal()); _stdMargin->setPrecision(omfgThis->percentVal()); _actMargin->setPrecision(omfgThis->percentVal()); _pricingRatio->setPrecision(omfgThis->percentVal()); if (!_privileges->check("MaintainListPrices")) { _listPrice->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } itemListPrice::~itemListPrice() { // no need to delete child widgets, Qt does it all for us } void itemListPrice::languageChange() { retranslateUi(this); } enum SetResponse itemListPrice::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(TRUE); } return NoError; } void itemListPrice::sSave() { XSqlQuery itemSave; itemSave.prepare( "UPDATE item " "SET item_listprice=:item_listprice " "WHERE (item_id=:item_id);" ); itemSave.bindValue(":item_listprice", _listPrice->toDouble()); itemSave.bindValue(":item_id", _item->id()); itemSave.exec(); accept(); } void itemListPrice::sPopulate() { XSqlQuery itemPopulate; itemPopulate.prepare( "SELECT uom_name, iteminvpricerat(item_id) AS invpriceratio," " item_listprice," " (item_listprice / iteminvpricerat(item_id)) AS extprice," " stdCost(item_id) AS standardcost," " actCost(item_id) AS actualcost," " (stdCost(item_id) * iteminvpricerat(item_id)) AS extstandardcost," " (actCost(item_id) * iteminvpricerat(item_id)) AS extactualcost " "FROM item JOIN uom ON (item_price_uom_id=uom_id)" "WHERE (item_id=:item_id);" ); itemPopulate.bindValue(":item_id", _item->id()); itemPopulate.exec(); if (itemPopulate.first()) { _cachedRatio = itemPopulate.value("invpriceratio").toDouble(); _cachedStdCost = itemPopulate.value("standardcost").toDouble(); _cachedActCost = itemPopulate.value("actualcost").toDouble(); _listPrice->setDouble(itemPopulate.value("item_listprice").toDouble()); _priceUOM->setText(itemPopulate.value("uom_name").toString()); _pricingRatio->setDouble(itemPopulate.value("invpriceratio").toDouble()); _extPrice->setDouble(itemPopulate.value("extprice").toDouble()); _stdCost->setDouble(itemPopulate.value("standardcost").toDouble()); _actCost->setDouble(itemPopulate.value("actualcost").toDouble()); _extStdCost->setDouble(itemPopulate.value("extstandardcost").toDouble()); _extActCost->setDouble(itemPopulate.value("extactualcost").toDouble()); } sUpdateMargins(); } void itemListPrice::sUpdateMargins() { if (_item->isValid()) { double price = _listPrice->toDouble() / _cachedRatio; _extPrice->setDouble(price); QString stylesheet; if (_cachedStdCost > 0.0) { _stdMargin->setDouble((price - _cachedStdCost) / price * 100); if (_cachedStdCost > price) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); } else _stdMargin->setText("N/A"); _stdMargin->setStyleSheet(stylesheet); stylesheet = ""; if (_cachedActCost > 0.0) { _actMargin->setDouble((price - _cachedActCost) / price * 100); if (_cachedActCost > price) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); } else _actMargin->setText("N/A"); _actMargin->setStyleSheet(stylesheet); } } qt-client-4.1.0/guiclient/itemListPrice.h000066400000000000000000000021741217451700100203270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMLISTPRICE_H #define ITEMLISTPRICE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemListPrice.h" class itemListPrice : public XDialog, public Ui::itemListPrice { Q_OBJECT public: itemListPrice(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemListPrice(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sPopulate(); virtual void sUpdateMargins(); protected slots: virtual void languageChange(); private: double _cachedRatio; double _cachedStdCost; double _cachedActCost; }; #endif // ITEMLISTPRICE_H qt-client-4.1.0/guiclient/itemListPrice.ui000066400000000000000000000655011217451700100205200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemListPrice 0 0 413 215 Item List Price 5 0 5 0 7 0 0 0 81 20 Preferred Horizontal 0 0 0 5 &Cancel false &Save true 20 0 Preferred Vertical 0 0 0 7 0 0 0 5 List Price: Qt::AlignVCenter|Qt::AlignRight 5 0 0 0 80 32767 20 20 Expanding Vertical 0 5 0 0 Price UOM: Qt::AlignVCenter|Qt::AlignRight Inv./Price Ratio: Qt::AlignVCenter|Qt::AlignRight Inventory UOM Price: Qt::AlignVCenter|Qt::AlignRight 0 0 80 0 Qt::AlignVCenter|Qt::AlignLeft 80 0 Qt::AlignVCenter|Qt::AlignRight 80 0 Qt::AlignVCenter|Qt::AlignRight 20 20 Expanding Horizontal 0 0 5 0 0 0 20 0 Preferred Vertical Cost: Qt::AlignVCenter|Qt::AlignRight Extended Cost: Qt::AlignVCenter|Qt::AlignRight Margin: Qt::AlignVCenter|Qt::AlignRight 0 0 0 7 100 0 Standard Qt::AlignCenter 100 0 Actual Qt::AlignCenter 0 7 100 0 Qt::AlignVCenter|Qt::AlignRight 100 0 Qt::AlignVCenter|Qt::AlignRight 0 7 100 0 Qt::AlignVCenter|Qt::AlignRight 100 0 Qt::AlignVCenter|Qt::AlignRight 0 7 100 0 Qt::AlignVCenter|Qt::AlignRight 100 0 Qt::AlignVCenter|Qt::AlignRight 57 20 Preferred Horizontal 20 16 Expanding Vertical _item _listPrice _save _close parameter.h _close clicked() itemListPrice reject() _item valid(bool) _save setEnabled(bool) qt-client-4.1.0/guiclient/itemPricingSchedule.cpp000066400000000000000000000302041217451700100220270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemPricingSchedule.h" #include #include #include #include "itemPricingScheduleItem.h" #include #include "mqlutil.h" itemPricingSchedule::itemPricingSchedule(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery itemitemPricingSchedule; setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_currency, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sFillList())); _dates->setStartNull(tr("Always"), omfgThis->startOfTime(), TRUE); _dates->setStartCaption(tr("Effective")); _dates->setEndNull(tr("Never"), omfgThis->endOfTime(), TRUE); _dates->setEndCaption(tr("Expires")); _ipsitem->addColumn(tr("Target"), _ynColumn, Qt::AlignLeft, true, "target" ); _ipsitem->addColumn(tr("Item/Prod. Cat."), _itemColumn, Qt::AlignLeft, true, "number" ); _ipsitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip" ); _ipsitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "qtyuom"); _ipsitem->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "qtybreak" ); _ipsitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "priceuom"); _ipsitem->addColumn(tr("Price/Percent"), _priceColumn, Qt::AlignRight, true, "price" ); _ipsitem->addColumn(tr("Fixed Amt."), _priceColumn, Qt::AlignRight, true, "fixedAmt" ); _ipsitem->addColumn(tr("Net Price"), _priceColumn, Qt::AlignRight, true, "netPrice" ); _ipsitem->addColumn(tr("Type"), -1, Qt::AlignLeft, true, "type" ); _ipsitem->addColumn(tr("Method"), -1, Qt::AlignLeft, true, "method" ); _currency->setType(XComboBox::Currencies); _currency->setLabel(_currencyLit); _updated = QDate::currentDate(); itemitemPricingSchedule.exec("BEGIN;"); _rejectedMsg = tr("The application has encountered an error and must " "stop editing this Pricing Schedule.\n%1"); } itemPricingSchedule::~itemPricingSchedule() { // no need to delete child widgets, Qt does it all for us } void itemPricingSchedule::languageChange() { retranslateUi(this); } enum SetResponse itemPricingSchedule::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "copy") { _mode = cCopy; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _dates->setEnabled(FALSE); _warehouse->setEnabled(FALSE); _currency->setEnabled(FALSE); _new->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } param = pParams.value("ipshead_id", &valid); if (valid) { _ipsheadid = param.toInt(); populate(); } if ( (_mode == cNew) || (_mode == cEdit) || (_mode == cCopy) ) { connect(_ipsitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_ipsitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_ipsitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } if ( (_mode == cNew) ) { itemet.exec("SELECT NEXTVAL('ipshead_ipshead_id_seq') AS ipshead_id;"); if (itemet.first()) _ipsheadid = itemet.value("ipshead_id").toInt(); else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemet.lastError().databaseText()), __FILE__, __LINE__); reject(); return UndefinedError; } } return NoError; } bool itemPricingSchedule::sSave(bool p) { XSqlQuery itemSave; if (_name->text().trimmed().isEmpty()) { QMessageBox::critical( this, tr("Enter Name"), tr("You must enter a Name for this Pricing Schedule.") ); _name->setFocus(); return false; } if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Effective Date"), tr("You must enter an effective date for this Pricing Schedule.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter Expiration Date"), tr("You must enter an expiration date for this Pricing Schedule.") ); _dates->setFocus(); return false; } if (_dates->endDate() < _dates->startDate()) { QMessageBox::critical( this, tr("Invalid Expiration Date"), tr("The expiration date cannot be earlier than the effective date.") ); _dates->setFocus(); return false; } itemSave.prepare("SELECT ipshead_id" " FROM ipshead" " WHERE ((ipshead_name=:ipshead_name)" " AND (ipshead_id != :ipshead_id))"); itemSave.bindValue(":ipshead_id", _ipsheadid); itemSave.bindValue(":ipshead_name", _name->text()); itemSave.exec(); if(itemSave.first()) { QMessageBox::warning(this, tr("Pricing Schedule Already Exists"), tr("A Pricing Schedule with the entered Name already exists.")); return false; } if (_mode == cNew) itemSave.prepare( "INSERT INTO ipshead " "( ipshead_id, ipshead_name, ipshead_descrip," " ipshead_effective, ipshead_expires, " " ipshead_curr_id, ipshead_updated ) " "VALUES " "( :ipshead_id, :ipshead_name, :ipshead_descrip," " :ipshead_effective, :ipshead_expires, " " :ipshead_curr_id, CURRENT_DATE );" ); else if ( (_mode == cEdit) || (_mode == cCopy) ) itemSave.prepare( "UPDATE ipshead " "SET ipshead_name=:ipshead_name, ipshead_descrip=:ipshead_descrip," " ipshead_effective=:ipshead_effective, ipshead_expires=:ipshead_expires, " " ipshead_curr_id=:ipshead_curr_id, " " ipshead_updated=CURRENT_DATE " "WHERE (ipshead_id=:ipshead_id);" ); itemSave.bindValue(":ipshead_id", _ipsheadid); itemSave.bindValue(":ipshead_name", _name->text()); itemSave.bindValue(":ipshead_descrip", _descrip->text()); itemSave.bindValue(":ipshead_effective", _dates->startDate()); itemSave.bindValue(":ipshead_expires", _dates->endDate()); itemSave.bindValue(":ipshead_curr_id", _currency->id()); itemSave.exec(); if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); reject(); } _mode = cEdit; if (p) { itemSave.exec("COMMIT;"); done(_ipsheadid); } return true; } void itemPricingSchedule::sSave() { XSqlQuery itemSave; sSave(true) ; } void itemPricingSchedule::sCheck() { } void itemPricingSchedule::sNew() { if(!sSave(false)) return; ParameterList params; params.append("mode", "new"); params.append("ipshead_id", _ipsheadid); params.append("curr_id", _currency->id()); params.append("updated", _updated); itemPricingScheduleItem newdlg(this, "", TRUE); newdlg.set(params); int result; if ((result = newdlg.exec()) != XDialog::Rejected) { if (result == -1) reject(); else sFillList(result); } } void itemPricingSchedule::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("curr_id", _currency->id()); params.append("updated", _updated); if(_ipsitem->altId() == 1) params.append("ipsitem_id", _ipsitem->id()); else if(_ipsitem->altId() == 2) params.append("ipsfreight_id", _ipsitem->id()); else return; // ToDo - tell the user why we're not showing the pricing sched? itemPricingScheduleItem newdlg(this, "", TRUE); newdlg.set(params); int result; if ((result = newdlg.exec()) != XDialog::Rejected) { if (result == -1) reject(); else sFillList(result); } } void itemPricingSchedule::sDelete() { XSqlQuery itemDelete; if(_ipsitem->altId() == 1) itemDelete.prepare( "DELETE FROM ipsiteminfo " "WHERE (ipsitem_id=:ipsitem_id);" ); else if(_ipsitem->altId() == 2) itemDelete.prepare( "DELETE FROM ipsfreight " "WHERE (ipsfreight_id=:ipsitem_id);" ); else return; itemDelete.bindValue(":ipsitem_id", _ipsitem->id()); itemDelete.exec(); if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemDelete.lastError().databaseText()), __FILE__, __LINE__); reject(); } sFillList(); } void itemPricingSchedule::sFillList() { XSqlQuery itemFillList; sFillList(-1); } void itemPricingSchedule::sFillList(int pIpsitemid) { XSqlQuery itemFillList; MetaSQLQuery mql = mqlLoad("itemPricingSchedule", "detail"); ParameterList params; params.append("ipshead_id", _ipsheadid); params.append("warehous_id", _warehouse->id()); params.append("item",tr("Item")); params.append("prodcat", tr("Prod. Cat.")); params.append("flatrate", tr("Flat Rate")); params.append("peruom", tr("Price Per UOM")); params.append("nominal",tr("Nominal")); params.append("discount",tr("Discount")); params.append("markup",tr("Markup")); params.append("freight", tr("Freight")); params.append("price", tr("Price")); params.append("fixed", tr("Fixed")); params.append("percent", tr("Percent")); params.append("mixed", tr("Mixed")); params.append("allsites", tr("All Sites")); params.append("allzones", tr("All Shipping Zones")); itemFillList = mql.toQuery(params); if (pIpsitemid == -1) _ipsitem->populate(itemFillList, true); else _ipsitem->populate(itemFillList, pIpsitemid, true); _currency->setEnabled(_ipsitem->topLevelItemCount() <= 0); } void itemPricingSchedule::populate() { XSqlQuery itempopulate; XSqlQuery pop; pop.prepare( "SELECT ipshead_name, ipshead_descrip," " ipshead_effective, ipshead_expires, " " ipshead_curr_id, ipshead_updated " "FROM ipshead " "WHERE (ipshead_id=:ipshead_id);" ); pop.bindValue(":ipshead_id", _ipsheadid); pop.exec(); if (pop.first()) { _name->setText(pop.value("ipshead_name").toString()); _descrip->setText(pop.value("ipshead_descrip").toString()); _dates->setStartDate(pop.value("ipshead_effective").toDate()); _dates->setEndDate(pop.value("ipshead_expires").toDate()); _currency->setId(pop.value("ipshead_curr_id").toInt()); _currency->setEnabled(FALSE); QDate tmpDate = pop.value("ipshead_updated").toDate(); if (tmpDate.isValid() && ! tmpDate.isNull()) _updated = tmpDate; sFillList(-1); } else if (itempopulate.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itempopulate.lastError().databaseText()), __FILE__, __LINE__); reject(); } } void itemPricingSchedule::reject() { XSqlQuery itemreject; itemreject.exec("ROLLBACK;"); if(_mode == cCopy) { itemreject.prepare( "DELETE FROM ipsiteminfo " "WHERE (ipsitem_ipshead_id=:ipshead_id); " "DELETE FROM ipsfreight " "WHERE (ipsfreight_ipshead_id=:ipshead_id); " "DELETE FROM ipshead " "WHERE (ipshead_id=:ipshead_id);" ); itemreject.bindValue(":ipshead_id", _ipsheadid); itemreject.exec(); } XDialog::reject(); } qt-client-4.1.0/guiclient/itemPricingSchedule.h000066400000000000000000000025661217451700100215060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMPRICINGSCHEDULE_H #define ITEMPRICINGSCHEDULE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemPricingSchedule.h" class itemPricingSchedule : public XDialog, public Ui::itemPricingSchedule { Q_OBJECT public: itemPricingSchedule(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemPricingSchedule(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual bool sSave(bool p); virtual void sCheck(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); virtual void sFillList( int pIpsitemid ); virtual void populate(); virtual void reject(); protected slots: virtual void languageChange(); private: int _ipsheadid; int _mode; QDate _updated; QString _rejectedMsg; }; #endif // ITEMPRICINGSCHEDULE_H qt-client-4.1.0/guiclient/itemPricingSchedule.ui000066400000000000000000000260531217451700100216710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemPricingSchedule 0 0 666 371 0 0 0 0 Pricing Schedule 5 5 7 5 5 5 5 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 5 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 20 5 &Cancel &Save true Qt::Vertical QSizePolicy::Preferred 20 60 0 Schedule: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 7 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 DateCluster QWidget
    datecluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _name _descrip _dates _currency _ipsitem _new _edit _delete _save _close _close clicked() itemPricingSchedule reject() 20 20 20 20
    qt-client-4.1.0/guiclient/itemPricingScheduleItem.cpp000066400000000000000000001144661217451700100226630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemPricingScheduleItem.h" #include "characteristicPrice.h" #include "xdoublevalidator.h" #include #include "mqlutil.h" #include #include #include #include itemPricingScheduleItem::itemPricingScheduleItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery itemitemPricingScheduleItem; setupUi(this); _save = _buttonBox->button(QDialogButtonBox::Save); _save->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_item, SIGNAL(newId(int)), this, SLOT(sUpdateCosts(int))); connect(_price, SIGNAL(idChanged(int)), _actCost, SLOT(setId(int))); connect(_price, SIGNAL(idChanged(int)), _stdCost, SLOT(setId(int))); connect(_price, SIGNAL(idChanged(int)), _listPrice, SLOT(setId(int))); connect(_price, SIGNAL(effectiveChanged(const QDate&)), _actCost, SLOT(setEffective(const QDate&))); connect(_price, SIGNAL(effectiveChanged(const QDate&)), _stdCost, SLOT(setEffective(const QDate&))); connect(_price, SIGNAL(effectiveChanged(const QDate&)), _listPrice, SLOT(setEffective(const QDate&))); connect(_price, SIGNAL(valueChanged()), this, SLOT(sUpdateMargins())); connect(_itemSelected, SIGNAL(toggled(bool)), this, SLOT(sTypeChanged(bool))); connect(_discountSelected, SIGNAL(toggled(bool)), this, SLOT(sTypeChanged(bool))); connect(_markupSelected, SIGNAL(toggled(bool)), this, SLOT(sTypeChanged(bool))); connect(_freightSelected, SIGNAL(toggled(bool)), this, SLOT(sTypeChanged(bool))); connect(_qtyUOM, SIGNAL(newID(int)), this, SLOT(sQtyUOMChanged())); connect(_priceUOM, SIGNAL(newID(int)), this, SLOT(sPriceUOMChanged())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_dscbyItem, SIGNAL(toggled(bool)), this, SLOT(sCheckEnable())); connect(_dscbyprodcat, SIGNAL(toggled(bool)), this, SLOT(sCheckEnable())); connect(_markupbyItem, SIGNAL(toggled(bool)), this, SLOT(sCheckEnable())); connect(_markupbyprodcat, SIGNAL(toggled(bool)), this, SLOT(sCheckEnable())); connect(_item, SIGNAL(valid(bool)), this, SLOT(sCheckEnable())); connect(_dscitem, SIGNAL(valid(bool)), this, SLOT(sCheckEnable())); connect(_markupitem, SIGNAL(valid(bool)), this, SLOT(sCheckEnable())); connect(_prodcat, SIGNAL(valid(bool)), this, SLOT(sCheckEnable())); connect(_markupProdcat, SIGNAL(valid(bool)), this, SLOT(sCheckEnable())); _ipsheadid = -1; _ipsitemid = -1; _ipsfreightid = -1; _invuomid = -1; _charprice->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name" ); _charprice->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "ipsitemchar_value" ); _charprice->addColumn(tr("Price"), _priceColumn,Qt::AlignRight, true, "ipsitemchar_price" ); _qtyBreak->setValidator(omfgThis->qtyVal()); _qtyBreakCat->setValidator(omfgThis->qtyVal()); _markupQtyBreakCat->setValidator(omfgThis->qtyVal()); _qtyBreakFreight->setValidator(omfgThis->weightVal()); _discount->setValidator(new XDoubleValidator(-999, 999, decimalPlaces("percent"), this)); _fixedAmtDiscount->setValidator(omfgThis->negMoneyVal()); _markup->setValidator(new XDoubleValidator(-999, 999, decimalPlaces("percent"), this)); _fixedAmtMarkup->setValidator(omfgThis->negMoneyVal()); _pricingRatio->setPrecision(omfgThis->percentVal()); _stdMargin->setPrecision(omfgThis->percentVal()); _actMargin->setPrecision(omfgThis->percentVal()); _item->setType(ItemLineEdit::cSold); _zoneFreight->setType(XComboBox::ShippingZones); _shipViaFreight->setType(XComboBox::ShipVias); _freightClass->setType(XComboBox::FreightClasses); _tab->setTabEnabled(_tab->indexOf(_configuredPrices),FALSE); itemitemPricingScheduleItem.exec("SELECT uom_name FROM uom WHERE (uom_item_weight);"); if (itemitemPricingScheduleItem.first()) { QString uom = itemitemPricingScheduleItem.value("uom_name").toString(); QString title (tr("Price per ")); title += uom; _perUOMFreight->setText(title); _qtyBreakFreightUOM->setText(uom); } if (_metrics->boolean("WholesalePriceCosting")) _markupLit->setText(tr("Markup Percent (Wholesale Price):")); else _markupLit->setText(tr("Markup Percent (Inventory Cost):")); _rejectedMsg = tr("The application has encountered an error and must " "stop editing this Pricing Schedule.\n%1"); } itemPricingScheduleItem::~itemPricingScheduleItem() { // no need to delete child widgets, Qt does it all for us } void itemPricingScheduleItem::languageChange() { retranslateUi(this); } enum SetResponse itemPricingScheduleItem::set(const ParameterList &pParams) { XSqlQuery itemet; XSqlQuery prodcatet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("ipshead_id", &valid); if (valid) _ipsheadid = param.toInt(); param = pParams.value("curr_id", &valid); if (valid) { _price->setId(param.toInt()); _priceFreight->setId(param.toInt()); } param = pParams.value("updated", &valid); if (valid) { _price->setEffective(param.toDate()); _priceFreight->setEffective(param.toDate()); } param = pParams.value("ipsitem_id", &valid); if (valid) { _ipsitemid = param.toInt(); populate(); } param = pParams.value("ipsfreight_id", &valid); if (valid) { _ipsfreightid = param.toInt(); _freightSelected->setChecked(true); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(TRUE); _prodcat->setEnabled(FALSE); _markupProdcat->setEnabled(FALSE); _typeGroup->setEnabled(FALSE); _dscitem->setReadOnly(TRUE); _markupitem->setReadOnly(TRUE); _discountBy->setEnabled(FALSE); _markupBy->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _prodcat->setEnabled(FALSE); _qtyBreak->setEnabled(FALSE); _qtyBreakCat->setEnabled(FALSE); _qtyBreakFreight->setEnabled(FALSE); _price->setEnabled(FALSE); _discount->setEnabled(FALSE); _fixedAmtDiscount->setEnabled(FALSE); _markup->setEnabled(FALSE); _fixedAmtMarkup->setEnabled(FALSE); _priceFreight->setEnabled(FALSE); _typeGroup->setEnabled(FALSE); _typeFreightGroup->setEnabled(FALSE); _siteFreight->setEnabled(FALSE); _zoneFreightGroup->setEnabled(FALSE); _shipViaFreightGroup->setEnabled(FALSE); _freightClassGroup->setEnabled(FALSE); _dscitem->setReadOnly(TRUE); _discountBy->setEnabled(FALSE); _markupBy->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } return NoError; } void itemPricingScheduleItem::sCheckEnable() { if(_itemSelected->isChecked()) { if (_item->isValid()) _save->setEnabled(true); else _save->setEnabled(false); } if (_dscbyItem->isChecked()) { _prodcatLit->hide(); _prodcat->hide(); _itemGroup->show(); if (_dscitem->isValid()) _save->setEnabled(true); else _save->setEnabled(false); } if (_dscbyprodcat->isChecked()) { _itemGroup->hide(); _prodcatLit->show(); _prodcat->show(); if (_prodcat->isValid()) _save->setEnabled(true); else _save->setEnabled(false); } if (_markupbyItem->isChecked()) { _markupProdcatLit->hide(); _markupProdcat->hide(); _markupItemGroup->show(); if (_markupitem->isValid()) _save->setEnabled(true); else _save->setEnabled(false); } if (_markupbyprodcat->isChecked()) { _markupItemGroup->hide(); _markupProdcatLit->show(); _markupProdcat->show(); if (_markupProdcat->isValid()) _save->setEnabled(true); else _save->setEnabled(false); } } void itemPricingScheduleItem::sSave() { sSave(TRUE); } void itemPricingScheduleItem::sSave( bool pClose) { XSqlQuery itemSave; if(_itemSelected->isChecked()) { itemSave.prepare( "SELECT ipsitem_id " " FROM ipsiteminfo " " WHERE((ipsitem_ipshead_id=:ipshead_id)" " AND (ipsitem_item_id=:item_id)" " AND (ipsitem_qty_uom_id=:uom_id)" " AND (ipsitem_qtybreak=:qtybreak)" " AND (ipsitem_id <> :ipsitem_id));" ); itemSave.bindValue(":ipshead_id", _ipsheadid); itemSave.bindValue(":item_id", _item->id()); itemSave.bindValue(":qtybreak", _qtyBreak->toDouble()); itemSave.bindValue(":uom_id", _qtyUOM->id()); itemSave.bindValue(":ipsitem_id", _ipsitemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Pricing Schedule Item"), tr( "There is an existing Pricing Schedule Item for the selected Pricing Schedule, Item and Quantity Break defined.\n" "You may not create duplicate Pricing Schedule Items." ) ); return; } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } else if(_discountSelected->isChecked()) { if(_dscbyItem->isChecked()) { itemSave.prepare( "SELECT * " "FROM ipsiteminfo JOIN ipshead ON (ipsitem_ipshead_id=ipshead_id) " "WHERE ((ipshead_id = :ipshead_id)" " AND (ipsitem_item_id = :item_id)" " AND (ipsitem_qtybreak = :qtybreak)" " AND (ipsitem_id <> :ipsitem_id));" ); itemSave.bindValue(":ipshead_id", _ipsheadid); itemSave.bindValue(":item_id", _dscitem->id()); itemSave.bindValue(":qtybreak", _qtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_id", _ipsitemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Pricing Schedule Item"), tr( "There is an existing Pricing Schedule Item for the selected Pricing Schedule, Item and Quantity Break defined.\n" "You may not create duplicate Pricing Schedule Items." ) ); return; } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } else if(_dscbyprodcat->isChecked()) { itemSave.prepare( "SELECT ipsitem_id " "FROM ipsiteminfo " "WHERE ( (ipsitem_ipshead_id=:ipshead_id)" " AND (ipsitem_prodcat_id=:prodcat_id)" " AND (ipsitem_qtybreak=:qtybreak)" " AND (ipsitem_id <> :ipsitem_id) );" ); itemSave.bindValue(":ipshead_id", _ipsheadid); itemSave.bindValue(":prodcat_id", _prodcat->id()); itemSave.bindValue(":qtybreak", _qtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_id", _ipsitemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Pricing Schedule Item"), tr( "There is an existing Pricing Schedule Item for the selected Pricing Schedule, Product Category and Quantity Break defined.\n" "You may not create duplicate Pricing Schedule Items." ) ); return; } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } } else if(_markupSelected->isChecked()) { if(_markupbyItem->isChecked()) { itemSave.prepare( "SELECT * " "FROM ipsiteminfo JOIN ipshead ON (ipsitem_ipshead_id=ipshead_id) " "WHERE ((ipshead_id = :ipshead_id)" " AND (ipsitem_item_id = :item_id)" " AND (ipsitem_qtybreak = :qtybreak)" " AND (ipsitem_id <> :ipsitem_id));" ); itemSave.bindValue(":ipshead_id", _ipsheadid); itemSave.bindValue(":item_id", _markupitem->id()); itemSave.bindValue(":qtybreak", _markupQtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_id", _ipsitemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Pricing Schedule Item"), tr( "There is an existing Pricing Schedule Item for the selected Pricing Schedule, Item and Quantity Break defined.\n" "You may not create duplicate Pricing Schedule Items." ) ); return; } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } else if(_markupbyprodcat->isChecked()) { itemSave.prepare( "SELECT ipsitem_id " "FROM ipsiteminfo " "WHERE ( (ipsitem_ipshead_id=:ipshead_id)" " AND (ipsitem_prodcat_id=:prodcat_id)" " AND (ipsitem_qtybreak=:qtybreak)" " AND (ipsitem_id <> :ipsitem_id) );" ); itemSave.bindValue(":ipshead_id", _ipsheadid); itemSave.bindValue(":prodcat_id", _markupProdcat->id()); itemSave.bindValue(":qtybreak", _markupQtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_id", _ipsitemid); itemSave.exec(); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Pricing Schedule Item"), tr( "There is an existing Pricing Schedule Item for the selected Pricing Schedule, Product Category and Quantity Break defined.\n" "You may not create duplicate Pricing Schedule Items." ) ); return; } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } } else if(_freightSelected->isChecked()) { MetaSQLQuery mql = mqlLoad("pricingFreight", "detail"); ParameterList params; params.append("checkDup", true); params.append("ipshead_id", _ipsheadid); if (_siteFreight->isSelected()) params.append("warehous_id", _siteFreight->id()); if (_selectedZoneFreight->isChecked()) params.append("shipzone_id", _zoneFreight->id()); if (_selectedFreightClass->isChecked()) params.append("freightclass_id", _freightClass->id()); if (_selectedShipViaFreight->isChecked()) params.append("shipvia", _shipViaFreight->currentText()); params.append("qtybreak", _qtyBreakFreight->toDouble()); params.append("ipsfreight_id", _ipsfreightid); itemSave = mql.toQuery(params); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Pricing Schedule Item"), tr( "There is an existing Pricing Schedule Item for the selected Pricing Schedule, Freight Criteria and Quantity Break defined.\n" "You may not create duplicate Pricing Schedule Items." ) ); return; } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } if (_mode == cNew) { if(_itemSelected->isChecked() || _discountSelected->isChecked() || _markupSelected->isChecked()) { itemSave.exec("SELECT NEXTVAL('ipsitem_ipsitem_id_seq') AS ipsitem_id;"); if (itemSave.first()) _ipsitemid = itemSave.value("ipsitem_id").toInt(); else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } itemSave.prepare( "INSERT INTO ipsiteminfo " "( ipsitem_id, ipsitem_ipshead_id, ipsitem_item_id, ipsitem_prodcat_id," " ipsitem_qty_uom_id, ipsitem_qtybreak, " " ipsitem_price_uom_id, ipsitem_price, " " ipsitem_discntprcnt, ipsitem_fixedamtdiscount, " " ipsitem_type, ipsitem_warehous_id ) " "VALUES " "( :ipsitem_id, :ipshead_id, :ipsitem_item_id, :ipsitem_prodcat_id, " " :ipsitem_qty_uom_id, :ipsitem_qtybreak, " " :ipsitem_price_uom_id, :ipsitem_price, " " :ipsitem_discntprcnt, :ipsitem_fixedamtdiscount, " " :ipsitem_type, :ipsitem_warehous_id);" ); } else if(_freightSelected->isChecked()) { itemSave.exec("SELECT NEXTVAL('ipsfreight_ipsfreight_id_seq') AS ipsfreight_id;"); if (itemSave.first()) _ipsfreightid = itemSave.value("ipsfreight_id").toInt(); else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } itemSave.prepare( "INSERT INTO ipsfreight " "( ipsfreight_id, ipsfreight_ipshead_id, ipsfreight_qtybreak, ipsfreight_price," " ipsfreight_type, ipsfreight_warehous_id, ipsfreight_shipzone_id," " ipsfreight_freightclass_id, ipsfreight_shipvia ) " "VALUES " "( :ipsfreight_id, :ipshead_id, :ipsfreight_qtybreak, :ipsfreight_price," " :ipsfreight_type, :ipsfreight_warehous_id, :ipsfreight_shipzone_id," " :ipsfreight_freightclass_id, :ipsfreight_shipvia ) " ); } } else if (_mode == cEdit) { if(_itemSelected->isChecked() || _discountSelected->isChecked() || _markupSelected->isChecked()) itemSave.prepare( "UPDATE ipsiteminfo " " SET ipsitem_qty_uom_id=:ipsitem_qty_uom_id," " ipsitem_qtybreak=:ipsitem_qtybreak," " ipsitem_price_uom_id=:ipsitem_price_uom_id," " ipsitem_price=:ipsitem_price," " ipsitem_discntprcnt=:ipsitem_discntprcnt," " ipsitem_fixedamtdiscount=:ipsitem_fixedamtdiscount " "WHERE (ipsitem_id=:ipsitem_id);" ); else if(_freightSelected->isChecked()) itemSave.prepare( "UPDATE ipsfreight " " SET ipsfreight_qtybreak=:ipsfreight_qtybreak," " ipsfreight_type=:ipsfreight_type," " ipsfreight_price=:ipsfreight_price," " ipsfreight_warehous_id=:ipsfreight_warehous_id," " ipsfreight_shipzone_id=:ipsfreight_shipzone_id," " ipsfreight_freightclass_id=:ipsfreight_freightclass_id," " ipsfreight_shipvia=:ipsfreight_shipvia " "WHERE (ipsfreight_id=:ipsfreight_id);" ); } itemSave.bindValue(":ipsitem_id", _ipsitemid); itemSave.bindValue(":ipsfreight_id", _ipsfreightid); itemSave.bindValue(":ipshead_id", _ipsheadid); if(_itemSelected->isChecked()) { itemSave.bindValue(":ipsitem_item_id", _item->id()); itemSave.bindValue(":ipsitem_type", "N"); itemSave.bindValue(":ipsitem_qty_uom_id", _qtyUOM->id()); itemSave.bindValue(":ipsitem_price_uom_id", _priceUOM->id()); itemSave.bindValue(":ipsitem_qtybreak", _qtyBreak->toDouble()); itemSave.bindValue(":ipsitem_discntprcnt", 0.00); itemSave.bindValue(":ipsitem_fixedamtdiscount", 0.00); itemSave.bindValue(":ipsitem_price", _price->localValue()); } else if((_discountSelected->isChecked()) && (_dscbyItem->isChecked())) { itemSave.bindValue(":ipsitem_item_id", _dscitem->id()); itemSave.bindValue(":ipsitem_type", "D"); itemSave.bindValue(":ipsitem_qtybreak", _qtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_discntprcnt", (_discount->toDouble() / 100.0)); itemSave.bindValue(":ipsitem_fixedamtdiscount", (_fixedAmtDiscount->toDouble())); itemSave.bindValue(":ipsitem_price", 0.00); } else if((_discountSelected->isChecked()) && (_dscbyprodcat->isChecked())) { itemSave.bindValue(":ipsitem_prodcat_id", _prodcat->id()); itemSave.bindValue(":ipsitem_type", "D"); itemSave.bindValue(":ipsitem_qtybreak", _qtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_discntprcnt", (_discount->toDouble() / 100.0)); itemSave.bindValue(":ipsitem_fixedamtdiscount", (_fixedAmtDiscount->toDouble())); itemSave.bindValue(":ipsitem_price", 0.00); } else if((_markupSelected->isChecked()) && (_markupbyItem->isChecked())) { itemSave.bindValue(":ipsitem_item_id", _markupitem->id()); itemSave.bindValue(":ipsitem_type", "M"); itemSave.bindValue(":ipsitem_qtybreak", _markupQtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_discntprcnt", (_markup->toDouble() / 100.0)); itemSave.bindValue(":ipsitem_fixedamtdiscount", (_fixedAmtMarkup->toDouble())); itemSave.bindValue(":ipsitem_price", 0.00); } else if((_markupSelected->isChecked()) && (_markupbyprodcat->isChecked())) { itemSave.bindValue(":ipsitem_prodcat_id", _markupProdcat->id()); itemSave.bindValue(":ipsitem_type", "M"); itemSave.bindValue(":ipsitem_qtybreak", _markupQtyBreakCat->toDouble()); itemSave.bindValue(":ipsitem_discntprcnt", (_markup->toDouble() / 100.0)); itemSave.bindValue(":ipsitem_fixedamtdiscount", (_fixedAmtMarkup->toDouble())); itemSave.bindValue(":ipsitem_price", 0.00); } XSqlQuery qry; if((_discountSelected->isChecked()) && (_dscbyItem->isChecked())) { qry.prepare("SELECT item_inv_uom_id, item_price_uom_id " "FROM item " "WHERE (item_id=:item_id);"); qry.bindValue(":item_id", _dscitem->id()); qry.exec(); if (qry.first()) { itemSave.bindValue(":ipsitem_qty_uom_id", qry.value("item_inv_uom_id")); itemSave.bindValue(":ipsitem_price_uom_id", qry.value("item_price_uom_id")); } else if (qry.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(qry.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } if((_markupSelected->isChecked()) && (_markupbyItem->isChecked())) { qry.prepare("SELECT item_inv_uom_id, item_price_uom_id " "FROM item " "WHERE (item_id=:item_id);"); qry.bindValue(":item_id", _markupitem->id()); qry.exec(); if (qry.first()) { itemSave.bindValue(":ipsitem_qty_uom_id", qry.value("item_inv_uom_id")); itemSave.bindValue(":ipsitem_price_uom_id", qry.value("item_price_uom_id")); } else if (qry.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(qry.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } itemSave.bindValue(":ipsfreight_qtybreak", _qtyBreakFreight->toDouble()); itemSave.bindValue(":ipsfreight_price", _priceFreight->localValue()); itemSave.bindValue(":qty_uom_id", _qtyUOM->id()); itemSave.bindValue(":price_uom_id", _priceUOM->id()); if (_flatRateFreight->isChecked()) itemSave.bindValue(":ipsfreight_type", "F"); else itemSave.bindValue(":ipsfreight_type", "P"); if (_siteFreight->isSelected()) itemSave.bindValue(":ipsfreight_warehous_id", _siteFreight->id()); if (_selectedZoneFreight->isChecked()) itemSave.bindValue(":ipsfreight_shipzone_id", _zoneFreight->id()); if (_selectedFreightClass->isChecked()) itemSave.bindValue(":ipsfreight_freightclass_id", _freightClass->id()); if (_selectedShipViaFreight->isChecked()) itemSave.bindValue(":ipsfreight_shipvia", _shipViaFreight->currentText()); itemSave.exec(); if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemSave.lastError().databaseText()), __FILE__, __LINE__); done(-1); } if (pClose) { if(_itemSelected->isChecked()) done(_ipsitemid); if(_discountSelected->isChecked()) done(_ipsitemid); if(_markupSelected->isChecked()) done(_ipsitemid); if(_freightSelected->isChecked()) done(_ipsfreightid); } else { _mode = cEdit; _item->setReadOnly(TRUE); _prodcat->setEnabled(FALSE); _typeGroup->setEnabled(FALSE); } } void itemPricingScheduleItem::populate() { XSqlQuery itempopulate; if(_freightSelected->isChecked()) { MetaSQLQuery mql = mqlLoad("pricingFreight", "detail"); ParameterList params; params.append("ipsfreight_id", _ipsfreightid); itempopulate = mql.toQuery(params); if (itempopulate.first()) { _ipsheadid=itempopulate.value("ipsfreight_ipshead_id").toInt(); _qtyBreakFreight->setDouble(itempopulate.value("ipsfreight_qtybreak").toDouble()); _priceFreight->setLocalValue(itempopulate.value("ipsfreight_price").toDouble()); if (itempopulate.value("ipsfreight_type").toString() == "F") { _flatRateFreight->setChecked(true); _qtyBreakFreight->setEnabled(false); } else _perUOMFreight->setChecked(true); if (itempopulate.value("ipsfreight_warehous_id").toInt() > 0) _siteFreight->setId(itempopulate.value("ipsfreight_warehous_id").toInt()); else _siteFreight->setAll(); if (itempopulate.value("ipsfreight_shipzone_id").toInt() > 0) { _selectedZoneFreight->setChecked(true); _zoneFreight->setId(itempopulate.value("ipsfreight_shipzone_id").toInt()); } else _allZonesFreight->setChecked(true); if (itempopulate.value("ipsfreight_freightclass_id").toInt() > 0) { _selectedFreightClass->setChecked(true); _freightClass->setId(itempopulate.value("ipsfreight_freightclass_id").toInt()); } else _allFreightClasses->setChecked(true); // Handle the free-form Ship Via _shipViaFreight->setCurrentIndex(-1); QString shipvia = itempopulate.value("ipsfreight_shipvia").toString(); if (shipvia.trimmed().length() != 0) { _selectedShipViaFreight->setChecked(true); for (int counter = 0; counter < _shipViaFreight->count(); counter++) if (_shipViaFreight->itemText(counter) == shipvia) _shipViaFreight->setCurrentIndex(counter); if (_shipViaFreight->id() == -1) { _shipViaFreight->addItem(shipvia); _shipViaFreight->setCurrentIndex(_shipViaFreight->count() - 1); } } else _allShipViasFreight->setChecked(true); } else if (itempopulate.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itempopulate.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } else { itempopulate.prepare( "SELECT * " "FROM ipsiteminfo " "WHERE (ipsitem_id=:ipsitem_id);" ); itempopulate.bindValue(":ipsitem_id", _ipsitemid); itempopulate.exec(); if (itempopulate.first()) { if(itempopulate.value("ipsitem_type").toString() == "D") _discountSelected->setChecked(true); else if(itempopulate.value("ipsitem_type").toString() == "M") _markupSelected->setChecked(true); else _itemSelected->setChecked(true); if (itempopulate.value("ipsitem_item_id").toInt() > 0) { if(itempopulate.value("ipsitem_type").toString() == "D") _dscbyItem->setChecked(true); else if(itempopulate.value("ipsitem_type").toString() == "M") _markupbyItem->setChecked(true); } else { if(itempopulate.value("ipsitem_type").toString() == "D") _dscbyprodcat->setChecked(true); else if(itempopulate.value("ipsitem_type").toString() == "M") _markupbyprodcat->setChecked(true); } _ipsheadid=itempopulate.value("ipsitem_ipshead_id").toInt(); // Nominal _item->setId(itempopulate.value("ipsitem_item_id").toInt()); _qtyBreak->setDouble(itempopulate.value("ipsitem_qtybreak").toDouble()); _price->setLocalValue(itempopulate.value("ipsitem_price").toDouble()); _qtyUOM->setId(itempopulate.value("ipsitem_qty_uom_id").toInt()); _priceUOM->setId(itempopulate.value("ipsitem_price_uom_id").toInt()); // Discount _dscitem->setId(itempopulate.value("ipsitem_item_id").toInt()); _prodcat->setId(itempopulate.value("ipsitem_prodcat_id").toInt()); _qtyBreakCat->setDouble(itempopulate.value("ipsitem_qtybreak").toDouble()); _discount->setDouble(itempopulate.value("ipsitem_discntprcnt").toDouble() * 100.0); _fixedAmtDiscount->setDouble(itempopulate.value("ipsitem_fixedamtdiscount").toDouble()); // Markup _markupitem->setId(itempopulate.value("ipsitem_item_id").toInt()); _markupProdcat->setId(itempopulate.value("ipsitem_prodcat_id").toInt()); _markupQtyBreakCat->setDouble(itempopulate.value("ipsitem_qtybreak").toDouble()); _markup->setDouble(itempopulate.value("ipsitem_discntprcnt").toDouble() * 100.0); _fixedAmtMarkup->setDouble(itempopulate.value("ipsitem_fixedamtdiscount").toDouble()); sUpdateMargins(); } else if (itempopulate.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itempopulate.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } sFillList(); } void itemPricingScheduleItem::sUpdateCosts(int pItemid) { XSqlQuery itemUpdateCosts; XSqlQuery uom; uom.prepare("SELECT uom_id, uom_name" " FROM item" " JOIN uom ON (item_inv_uom_id=uom_id)" " WHERE(item_id=:item_id)" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_to_uom_id=uom_id)" " WHERE((itemuomconv_from_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_from_uom_id=uom_id)" " WHERE((itemuomconv_to_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " ORDER BY uom_name;"); uom.bindValue(":item_id", _item->id()); uom.exec(); if (itemUpdateCosts.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemUpdateCosts.lastError().databaseText()), __FILE__, __LINE__); done(-1); } _qtyUOM->populate(uom); _priceUOM->populate(uom); XSqlQuery cost; cost.prepare( "SELECT item_inv_uom_id, item_price_uom_id," " iteminvpricerat(item_id) AS ratio," " item_listprice, " " (stdcost(item_id) * iteminvpricerat(item_id)) AS standard," " (actcost(item_id, :curr_id) * iteminvpricerat(item_id)) AS actual " " FROM item" " WHERE (item_id=:item_id);" ); cost.bindValue(":item_id", pItemid); cost.bindValue(":curr_id", _actCost->id()); cost.exec(); if (cost.first()) { _invuomid = cost.value("item_inv_uom_id").toInt(); _listPrice->setBaseValue(cost.value("item_listprice").toDouble()); _pricingRatio->setDouble(cost.value("ratio").toDouble()); _stdCost->setBaseValue(cost.value("standard").toDouble()); _actCost->setLocalValue(cost.value("actual").toDouble()); _qtyUOM->setId(cost.value("item_inv_uom_id").toInt()); _priceUOM->setId(cost.value("item_price_uom_id").toInt()); } else if (itemUpdateCosts.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemUpdateCosts.lastError().databaseText()), __FILE__, __LINE__); done(-1); } if (_item->isConfigured()) _tab->setTabEnabled(_tab->indexOf(_configuredPrices),TRUE); else _tab->setTabEnabled(_tab->indexOf(_configuredPrices),FALSE); } void itemPricingScheduleItem::sUpdateMargins() { if (_item->isValid()) { double price = _price->baseValue(); QString stylesheet; if (_stdCost->baseValue() > 0.0) { _stdMargin->setDouble((price - _stdCost->baseValue()) / price * 100); if (_stdCost->baseValue() > price) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); } else _stdMargin->setText("N/A"); _stdMargin->setStyleSheet(stylesheet); if (_actCost->baseValue() > 0.0) { _actMargin->setDouble((price - _actCost->baseValue()) / price * 100); if (_actCost->baseValue() > price) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); } else _actMargin->setText("N/A"); _actMargin->setStyleSheet(stylesheet); } } void itemPricingScheduleItem::sTypeChanged(bool pChecked) { if(!pChecked) return; if(_itemSelected->isChecked()) { _widgetStack->setCurrentWidget(_nominalPage); _save->setEnabled(_item->isValid()); _dscbyItem->setChecked(false); _dscbyprodcat->setChecked(false); _markupbyItem->setChecked(false); _markupbyprodcat->setChecked(false); } else if(_discountSelected->isChecked()) { _widgetStack->setCurrentWidget(_discountPage); _dscbyItem->setChecked(true); _dscbyprodcat->setChecked(false); _markupbyItem->setChecked(false); _markupbyprodcat->setChecked(false); _save->setEnabled(false); _save->setEnabled(_dscitem->isValid()); } else if(_markupSelected->isChecked()) { _widgetStack->setCurrentWidget(_markupPage); _dscbyItem->setChecked(false); _dscbyprodcat->setChecked(false); _markupbyItem->setChecked(true); _markupbyprodcat->setChecked(false); _save->setEnabled(false); _save->setEnabled(_markupitem->isValid()); } else if(_freightSelected->isChecked()) { _widgetStack->setCurrentWidget(_freightPage); _save->setEnabled(true); _dscbyItem->setChecked(false); _dscbyprodcat->setChecked(false); } } void itemPricingScheduleItem::sQtyUOMChanged() { if(_qtyUOM->id() != _invuomid) { _priceUOM->setId(_qtyUOM->id()); _priceUOM->setEnabled(false); } else _priceUOM->setEnabled(true); sPriceUOMChanged(); } void itemPricingScheduleItem::sPriceUOMChanged() { XSqlQuery itemPriceUOMChanged; if(_priceUOM->id() == -1 || _qtyUOM->id() == -1) return; XSqlQuery cost; cost.prepare( "SELECT " " itemuomtouomratio(item_id, :qtyuomid, :priceuomid) AS ratio," " ((item_listprice / iteminvpricerat(item_id)) * itemuomtouomratio(item_id, :priceuomid, item_inv_uom_id)) AS listprice, " " (stdcost(item_id) * itemuomtouomratio(item_id, :priceuomid, item_inv_uom_id)) AS standard," " (actcost(item_id, :curr_id) * itemuomtouomratio(item_id, :priceuomid, item_inv_uom_id)) AS actual " " FROM item" " WHERE (item_id=:item_id);" ); cost.bindValue(":item_id", _item->id()); cost.bindValue(":curr_id", _actCost->id()); cost.bindValue(":qtyuomid", _qtyUOM->id()); cost.bindValue(":priceuomid", _priceUOM->id()); cost.exec(); if (cost.first()) { _listPrice->setBaseValue(cost.value("listprice").toDouble()); _pricingRatio->setDouble(cost.value("ratio").toDouble()); _stdCost->setBaseValue(cost.value("standard").toDouble()); _actCost->setLocalValue(cost.value("actual").toDouble()); sUpdateMargins(); } else if (itemPriceUOMChanged.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemPriceUOMChanged.lastError().databaseText()), __FILE__, __LINE__); done(-1); } } void itemPricingScheduleItem::sNew() { if (_mode == cNew) sSave(FALSE); ParameterList params; params.append("mode", "new"); params.append("ipsitem_id", _ipsitemid); params.append("curr_id", _price->id()); params.append("item_id", _item->id()); characteristicPrice newdlg(this, "", TRUE); newdlg.set(params); int result; if ((result = newdlg.exec()) != XDialog::Rejected) { if (result == -1) done(-1); else sFillList(); } } void itemPricingScheduleItem::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("ipsitem_id", _ipsitemid); params.append("ipsitemchar_id", _charprice->id()); params.append("curr_id", _price->id()); params.append("item_id", _item->id()); characteristicPrice newdlg(this, "", TRUE); newdlg.set(params); int result; if ((result = newdlg.exec()) != XDialog::Rejected) { if (result == -1) done(-1); else sFillList(); } } void itemPricingScheduleItem::sDelete() { XSqlQuery itemDelete; itemDelete.prepare("DELETE FROM ipsitemchar " "WHERE (ipsitemchar_id=:ipsitemchar_id);"); itemDelete.bindValue(":ipsitemchar_id", _charprice->id()); itemDelete.exec(); if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemDelete.lastError().databaseText()), __FILE__, __LINE__); done(-1); } sFillList(); } void itemPricingScheduleItem::sFillList() { XSqlQuery itemFillList; itemFillList.prepare("SELECT ipsitemchar_id, char_name, ipsitemchar_value, ipsitemchar_price, " " 'salesprice' AS ipsitemchar_price_xtnumericrole " "FROM ipsitemchar, char " "WHERE ((ipsitemchar_char_id=char_id) " "AND (ipsitemchar_ipsitem_id=:ipsitem_id)); "); itemFillList.bindValue(":ipsitem_id", _ipsitemid); itemFillList.exec(); if (itemFillList.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(itemFillList.lastError().databaseText()), __FILE__, __LINE__); done(-1); } _charprice->populate(itemFillList); } qt-client-4.1.0/guiclient/itemPricingScheduleItem.h000066400000000000000000000031321217451700100223130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMPRICINGSCHEDULEITEM_H #define ITEMPRICINGSCHEDULEITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemPricingScheduleItem.h" class itemPricingScheduleItem : public XDialog, public Ui::itemPricingScheduleItem { Q_OBJECT public: itemPricingScheduleItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemPricingScheduleItem(); QPushButton* _save; public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sSave( bool pClose); virtual void populate(); virtual void sUpdateCosts( int pItemid ); virtual void sUpdateMargins(); virtual void sTypeChanged(bool); virtual void sQtyUOMChanged(); virtual void sPriceUOMChanged(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); virtual void sCheckEnable(); protected slots: virtual void languageChange(); private: int _mode; int _ipsheadid; int _ipsitemid; int _ipsfreightid; int _invuomid; QString _rejectedMsg; }; #endif // ITEMPRICINGSCHEDULEITEM_H qt-client-4.1.0/guiclient/itemPricingScheduleItem.ui000066400000000000000000001570311217451700100225110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemPricingScheduleItem 0 0 601 479 Pricing Schedule Item Type 12 Nominal true Discount Markup Freight Qt::Horizontal 0 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 1 0 0 0 Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 0 20 0 Base Qt::AlignRight Qt::Horizontal 0 20 Qt::Horizontal QSizePolicy::Expanding 0 20 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _price 80 0 CurrDisplay::SalesPrice Qt::Horizontal 0 20 List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _listPrice Qt::Horizontal QSizePolicy::Expanding 0 20 Price UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice false Price/Inv. Ratio: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Qty. Break: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyBreak Qt::Horizontal 0 5 Cost (Pricing UOM): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Margin: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Standard Qt::AlignCenter 80 0 Actual Qt::AlignCenter 80 0 CurrDisplay::Cost 80 0 CurrDisplay::Cost 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical 20 0 Characteristic &New &Edit &Delete Qt::Vertical 20 40 0 Discount By Item Product Category Qt::Horizontal 0 20 Qt::Horizontal 0 20 Product Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::ProductCategories Qt::Horizontal QSizePolicy::Expanding 0 0 &Qty. Break (Inventory UOM): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyBreakCat 0 0 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 0 16 Discount Percent (List Price): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _price 0 0 Qt::AlignRight Qt::Horizontal 0 20 Discount By Fixed Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 Markup By Item Product Category Qt::Horizontal 0 20 Qt::Horizontal 0 20 Product Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::ProductCategories Qt::Horizontal QSizePolicy::Expanding 0 0 &Qty. Break (Inventory UOM): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyBreakCat 0 0 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 0 16 Markup Percent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _price 0 0 Qt::AlignRight Qt::Horizontal 0 20 Markup By Fixed Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 0 &Qty. Break: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyBreakFreight false 0 0 0 22 80 32767 Qt::AlignRight N/A Qt::Horizontal 0 20 Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 160 0 CurrDisplay::SalesPrice true Qt::Horizontal 0 26 Flat Rate true Price per N/A From false To All Shipping Zones true Selected: false Qt::Horizontal 0 20 All Ship Vias true Selected: false Qt::Horizontal 0 20 All Freight Classes true Selected: false Qt::Horizontal 0 20 Qt::Vertical 20 0 Qt::Horizontal 0 20 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    1
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _itemSelected _discountSelected _freightSelected _item _tab _qtyBreak _price _qtyUOM _priceUOM _qtyBreakCat _discount _fixedAmtDiscount _qtyBreakFreight _priceFreight _flatRateFreight _perUOMFreight _allShipViasFreight _selectedShipViaFreight _shipViaFreight _allZonesFreight _selectedZoneFreight _zoneFreight _allFreightClasses _selectedFreightClass _freightClass _edit _delete _new _charprice _price idChanged(int) _actCost setId(int) 123 274 311 397 _price idChanged(int) _stdCost setId(int) 123 274 175 397 _price idChanged(int) _listPrice setId(int) 123 274 124 311 _price effectiveChanged(QDate) _actCost setEffective(QDate) 123 274 311 397 _price effectiveChanged(QDate) _stdCost setEffective(QDate) 123 274 175 397 _price effectiveChanged(QDate) _listPrice setEffective(QDate) 123 274 124 311 _charprice itemSelected(int) _edit animateClick() 430 499 430 499 _perUOMFreight toggled(bool) _qtyBreakFreight setEnabled(bool) 490 191 267 152 _selectedFreightClass toggled(bool) _freightClass setEnabled(bool) 386 357 494 356 _selectedShipViaFreight toggled(bool) _shipViaFreight setEnabled(bool) 68 357 176 356 _selectedZoneFreight toggled(bool) _zoneFreight setEnabled(bool) 386 257 494 256
    qt-client-4.1.0/guiclient/itemPricingSchedules.cpp000066400000000000000000000174771217451700100222330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemPricingSchedules.h" #include #include #include #include #include "itemPricingSchedule.h" itemPricingSchedules::itemPricingSchedules(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deleteExpired, SIGNAL(clicked()), this, SLOT(sDeleteExpired())); connect(_showExpired, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchFor, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_showFuture, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_ipshead, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); _ipshead->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "ipshead_name" ); _ipshead->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "ipshead_descrip" ); _ipshead->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter, true, "ipshead_effective" ); _ipshead->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter, true, "ipshead_expires" ); if (_privileges->check("MaintainPricingSchedules")) { connect(_ipshead, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_ipshead, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_ipshead, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_ipshead, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_ipshead, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } itemPricingSchedules::~itemPricingSchedules() { // no need to delete child widgets, Qt does it all for us } void itemPricingSchedules::languageChange() { retranslateUi(this); } void itemPricingSchedules::sNew() { ParameterList params; params.append("mode", "new"); itemPricingSchedule newdlg(this, "", TRUE); newdlg.set(params); int result; if ((result = newdlg.exec()) != XDialog::Rejected) sFillList(result); } void itemPricingSchedules::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("ipshead_id", _ipshead->id()); itemPricingSchedule newdlg(this, "", TRUE); newdlg.set(params); int result; if ((result = newdlg.exec()) != XDialog::Rejected) sFillList(result); } void itemPricingSchedules::sCopy() { XSqlQuery itemCopy; itemCopy.prepare("SELECT copypricingschedule(:ipshead_id) AS result;"); itemCopy.bindValue(":ipshead_id", _ipshead->id()); itemCopy.exec(); if (itemCopy.first()) { ParameterList params; params.append("mode", "copy"); params.append("ipshead_id", itemCopy.value("result").toInt()); itemPricingSchedule newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } else if (itemCopy.lastError().type() != QSqlError::NoError) systemError(this,itemCopy.lastError().databaseText(), __FILE__, __LINE__); } void itemPricingSchedules::sView() { ParameterList params; params.append("mode", "view"); params.append("ipshead_id", _ipshead->id()); itemPricingSchedule newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void itemPricingSchedules::sDelete() { XSqlQuery itemDelete; itemDelete.prepare( "SELECT ipsass_id " "FROM ipsass " "WHERE (ipsass_ipshead_id=:ipshead_id) " "LIMIT 1;" ); itemDelete.bindValue(":ipshead_id", _ipshead->id()); itemDelete.exec(); if (itemDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Pricing Schedule"), tr( "The selected Pricing Schedule cannot be deleted as it has been assign to one or more Customers.\n" "You must delete these assignments before you may delete the selected Pricing Schedule." ) ); return; } itemDelete.prepare( "SELECT sale_id " "FROM sale " "WHERE (sale_ipshead_id=:ipshead_id) " "LIMIT 1;" ); itemDelete.bindValue(":ipshead_id", _ipshead->id()); itemDelete.exec(); if (itemDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Pricing Schedule"), tr( "The selected Pricing Schedule cannot be deleted as it has been assign to one or more Sales.\n" "You must delete these assignments before you may delete the selected Pricing Schedule." ) ); return; } itemDelete.prepare( "DELETE FROM ipsiteminfo " "WHERE (ipsitem_ipshead_id=:ipshead_id); " "DELETE FROM ipsfreight " "WHERE (ipsfreight_ipshead_id=:ipshead_id); " "DELETE FROM ipshead " "WHERE (ipshead_id=:ipshead_id);" ); itemDelete.bindValue(":ipshead_id", _ipshead->id()); itemDelete.exec(); sFillList(); } void itemPricingSchedules::sDeleteExpired() { XSqlQuery itemDeleteExpired; int answer = QMessageBox::question(this, tr("Delete Expired?"), tr("

    This will permanently delete all " "expired Pricing Schedules.

    " "OK to continue? "), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); if (answer == QMessageBox::No) return; itemDeleteExpired.prepare("SELECT deleteexpiredips() AS result;"); itemDeleteExpired.exec(); if (itemDeleteExpired.lastError().type() != QSqlError::NoError) systemError(this,itemDeleteExpired.lastError().databaseText(), __FILE__, __LINE__); sFillList(); } void itemPricingSchedules::sFillList() { sFillList(-1); } void itemPricingSchedules::sFillList(int pIpsheadid) { QString sql( "SELECT ipshead_id, ipshead_name, ipshead_descrip," " ipshead_effective, ipshead_expires," " CASE WHEN COALESCE(ipshead_effective, startOfTime()) <= startOfTime() THEN :always END AS ipshead_effective_qtdisplayrole," " CASE WHEN COALESCE(ipshead_expires, endOfTime()) >= endOfTime() THEN :never END AS ipshead_expires_qtdisplayrole " "FROM ipshead " ); if (!_showExpired->isChecked()) { sql += "WHERE ( (ipshead_expires > CURRENT_DATE)"; if (!_showFuture->isChecked()) sql += " AND (ipshead_effective <= CURRENT_DATE) ) "; else sql += " ) "; } else if (!_showFuture->isChecked()) sql += "WHERE (ipshead_effective <= CURRENT_DATE) "; sql += "ORDER BY ipshead_name, ipshead_effective;"; XSqlQuery r; r.prepare(sql); r.bindValue(":always", tr("Always")); r.bindValue(":never", tr("Never")); r.exec(); if (pIpsheadid == -1) _ipshead->populate(r); else _ipshead->populate(r, pIpsheadid); } void itemPricingSchedules::sSearch( const QString & pTarget) { _ipshead->clearSelection(); int i; for (i = 0; i < _ipshead->topLevelItemCount(); i++) { if (_ipshead->topLevelItem(i)->text(0).startsWith(pTarget, Qt::CaseInsensitive)) break; } if (i < _ipshead->topLevelItemCount()) { _ipshead->setCurrentItem(_ipshead->topLevelItem(i)); _ipshead->scrollToItem(_ipshead->topLevelItem(i)); } } qt-client-4.1.0/guiclient/itemPricingSchedules.h000066400000000000000000000022431217451700100216610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMPRICINGSCHEDULES_H #define ITEMPRICINGSCHEDULES_H #include "xwidget.h" #include "ui_itemPricingSchedules.h" class itemPricingSchedules : public XWidget, public Ui::itemPricingSchedules { Q_OBJECT public: itemPricingSchedules(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~itemPricingSchedules(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sDeleteExpired(); virtual void sFillList(); virtual void sFillList( int pIpsheadid ); virtual void sSearch( const QString & ); virtual void sCopy(); protected slots: virtual void languageChange(); }; #endif // ITEMPRICINGSCHEDULES_H qt-client-4.1.0/guiclient/itemPricingSchedules.ui000066400000000000000000000202521217451700100220470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemPricingSchedules 0 0 563 447 List Pricing Schedules 7 0 5 Search &for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _searchFor Qt::Vertical QSizePolicy::Preferred 20 20 0 Show E&xpired Pricing Schedules Show &Future Pricing Schedules 0 &Close Qt::Vertical QSizePolicy::Preferred 20 20 0 &Item Pricing Schedules: _ipshead 7 0 0 &New false &Edit false &View false Copy false &Delete Delete Expired Qt::Vertical QSizePolicy::Expanding 20 120 XLineEdit QLineEdit

    xlineedit.h
    1 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _searchFor _showExpired _showFuture _ipshead _new _edit _view _copy _delete _close parameter.h _close clicked() itemPricingSchedules close() 20 20 20 20 _ipshead valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/itemSite.cpp000066400000000000000000001751621217451700100177000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSite.h" #include #include #include #include #include #include #include "mqlutil.h" #include "storedProcErrorLookup.h" itemSite::itemSite(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sCheckItemsite())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_planningType, SIGNAL(activated(int)), this, SLOT(sHandlePlanningType())); connect(_poSupply, SIGNAL(toggled(bool)), this, SLOT(sHandlePOSupplied(bool))); connect(_createPo, SIGNAL(toggled(bool)), this, SLOT(sHandleCreatePO(bool))); connect(_createSoPr, SIGNAL(toggled(bool)), this, SLOT(sHandleCreateSOPR(bool))); connect(_createPr, SIGNAL(toggled(bool)), this, SLOT(sHandleCreateWOPR(bool))); connect(_woSupply, SIGNAL(toggled(bool)), this, SLOT(sHandleWOSupplied(bool))); connect(_item, SIGNAL(typeChanged(const QString&)), this, SLOT(sCacheItemType(const QString&))); connect(_item, SIGNAL(newId(int)), this, SLOT(sCheckItemsite())); connect(_controlMethod, SIGNAL(currentIndexChanged(int)), this, SLOT(sHandleControlMethod())); connect(_controlMethod, SIGNAL(activated(int)), this, SLOT(sHandleControlMethod())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sFillRestricted())); connect(_toggleRestricted, SIGNAL(clicked()), this, SLOT(sToggleRestricted())); connect(_useDefaultLocation, SIGNAL(toggled(bool)), this, SLOT(sDefaultLocChanged())); connect(_locationControl, SIGNAL(toggled(bool)), this, SLOT(sDefaultLocChanged())); connect(_costJob, SIGNAL(toggled(bool)), this, SLOT(sHandleJobCost())); _planningType->append(0, "None", "N"); _mpsTimeFenceLit->hide(); _mpsTimeFence->hide(); _mpsTimeFenceDaysLit->hide(); if(_metrics->value("Application") == "PostBooks") { _planningType->setCurrentIndex(0); _planningType->hide(); _planningTypeLit->hide(); _createPlannedTransfers->hide(); _orderGroupLit->hide(); _orderGroup->hide(); _orderGroupDaysLit->hide(); _orderGroupFirst->hide(); } else _planningType->append(1, "MRP", "M"); if (!_metrics->boolean("MultiWhs")) { _createPlannedTransfers->hide(); } if (_metrics->boolean("EnableDropShipments")) _dropShip->setEnabled(FALSE); else _dropShip->hide(); sHandlePlanningType(); _itemsiteid = -1; _itemType = 0; _qohCache = 0; _captive = FALSE; _updates = TRUE; _reorderLevel->setValidator(omfgThis->qtyVal()); _orderUpToQty->setValidator(omfgThis->qtyVal()); _minimumOrder->setValidator(omfgThis->qtyVal()); _maximumOrder->setValidator(omfgThis->qtyVal()); _orderMultiple->setValidator(omfgThis->qtyVal()); _safetyStock->setValidator(omfgThis->qtyVal()); _orderGroup->setMinimum(1); _restricted->addColumn(tr("Location"), _itemColumn, Qt::AlignLeft, true, "location_name" ); _restricted->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "location_descrip" ); _restricted->addColumn(tr("Allowed"), _dateColumn, Qt::AlignCenter, true, "allowed" ); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } else { _warehouse->setAllowNull(TRUE); _warehouse->setNull(); } //Default to Regular control _controlMethod->setCurrentIndex(1); //If not lot serial control, remove options if (!_metrics->boolean("LotSerialControl")) { _controlMethod->removeItem(3); _controlMethod->removeItem(2); _autoNumberGroup->hide(); _tab->removeTab(_tab->indexOf(_expirationTab)); } //If routings disabled, hide options if (!_metrics->boolean("Routings")) { _disallowBlankWIP->hide(); } _costAvg->setVisible(_metrics->boolean("AllowAvgCostMethod")); _costStd->setVisible(_metrics->boolean("AllowStdCostMethod")); _costStd->setVisible(_metrics->boolean("AllowJobCostMethod")); adjustSize(); } itemSite::~itemSite() { // no need to delete child widgets, Qt does it all for us } void itemSite::languageChange() { retranslateUi(this); } enum SetResponse itemSite::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; bool check; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _itemsiteid = param.toInt(); _item->setReadOnly(TRUE); populate(); } param = pParams.value("item_id", &valid); if (valid) { check = TRUE; _item->setId(param.toInt()); _item->setReadOnly(TRUE); } else check = FALSE; param = pParams.value("warehous_id", &valid); if (valid) { _captive = TRUE; _warehouse->setId(param.toInt()); _warehouse->setEnabled(FALSE); } else if (check) check = FALSE; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { if (check) { XSqlQuery itemsiteid; itemsiteid.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); itemsiteid.bindValue(":item_id", _item->id()); itemsiteid.bindValue(":warehous_id", _warehouse->id()); itemsiteid.exec(); if (itemsiteid.first()) { _mode = cEdit; _itemsiteid = itemsiteid.value("itemsite_id").toInt(); populate(); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); } else { _mode = cNew; _reorderLevel->setDouble(0.0); _orderUpToQty->setDouble(0.0); _minimumOrder->setDouble(0.0); _maximumOrder->setDouble(0.0); _orderMultiple->setDouble(0.0); _safetyStock->setDouble(0.0); _cycleCountFreq->setValue(0); _leadTime->setValue(0); _eventFence->setValue(_metrics->value("DefaultEventFence").toInt()); _tab->setTabEnabled(_tab->indexOf(_expirationTab),FALSE); } } else { _mode = cNew; _reorderLevel->setDouble(0.0); _orderUpToQty->setDouble(0.0); _minimumOrder->setDouble(0.0); _maximumOrder->setDouble(0.0); _orderMultiple->setDouble(0.0); _safetyStock->setDouble(0.0); _cycleCountFreq->setValue(0); _leadTime->setValue(0); _eventFence->setValue(_metrics->value("DefaultEventFence").toInt()); _tab->setTabEnabled(_tab->indexOf(_expirationTab),FALSE); } } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(TRUE); } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _useParameters->setEnabled(FALSE); _useParametersOnManual->setEnabled(FALSE); _reorderLevel->setEnabled(FALSE); _orderUpToQty->setEnabled(FALSE); _minimumOrder->setEnabled(FALSE); _maximumOrder->setEnabled(FALSE); _orderMultiple->setEnabled(FALSE); _safetyStock->setEnabled(FALSE); _abcClass->setEnabled(FALSE); _autoUpdateABCClass->setEnabled(FALSE); _cycleCountFreq->setEnabled(FALSE); _leadTime->setEnabled(FALSE); _eventFence->setEnabled(FALSE); _active->setEnabled(FALSE); _poSupply->setEnabled(FALSE); _woSupply->setEnabled(FALSE); _createPr->setEnabled(FALSE); _createSoPr->setEnabled(FALSE); _createPo->setEnabled(FALSE); _dropShip->setEnabled(FALSE); _createWo->setEnabled(FALSE); _sold->setEnabled(FALSE); _soldRanking->setEnabled(FALSE); _stocked->setEnabled(FALSE); _controlMethod->setEnabled(FALSE); _perishable->setEnabled(FALSE); _locationControl->setEnabled(FALSE); _disallowBlankWIP->setEnabled(FALSE); _useDefaultLocation->setEnabled(FALSE); _location->setEnabled(FALSE); _locations->setEnabled(FALSE); _recvlocations->setEnabled(FALSE); _issuelocations->setEnabled(FALSE); _locations_dist->setEnabled(FALSE); _recvlocations_dist->setEnabled(FALSE); _issuelocations_dist->setEnabled(FALSE); _miscLocation->setEnabled(FALSE); _miscLocationName->setEnabled(FALSE); _locationComments->setEnabled(FALSE); _plannerCode->setEnabled(FALSE); _costcat->setEnabled(FALSE); _eventFence->setEnabled(FALSE); _notes->setReadOnly(TRUE); _orderGroup->setEnabled(FALSE); _orderGroupFirst->setEnabled(FALSE); _mpsTimeFence->setEnabled(FALSE); _planningType->setEnabled(FALSE); _createPlannedTransfers->setEnabled(FALSE); _woCostGroup->setEnabled(FALSE); _costing->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); _comments->setReadOnly(TRUE); } } return NoError; } bool itemSite::sSave() { XSqlQuery itemSave; if (_warehouse->id() == -1) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr( "

    You must select a Site for this " "Item Site before creating it." ) ); _warehouse->setFocus(); return false; } if(!_costNone->isChecked() && !_costAvg->isChecked() && !_costStd->isChecked() && !_costJob->isChecked()) { QMessageBox::critical(this, tr("Cannot Save Item Site"), tr("

    You must select a Cost Method for this " "Item Site before you may save it.") ); return false; } if(_costAvg->isChecked() && _qohCache < 0) { QMessageBox::critical(this, tr("Cannot Save Item Site"), tr("

    You can not change an Item Site to " "Average Costing when it has a negative Qty. On Hand.") ); return false; } if (_costcat->id() == -1) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr("

    You must select a Cost Category for this " "Item Site before you may save it.") ); _costcat->setFocus(); return false; } if (_plannerCode->id() == -1) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr("

    You must select a Planner Code for this " "Item Site before you may save it.") ); _plannerCode->setFocus(); return false; } if (_stocked->isChecked() && _reorderLevel->toDouble() == 0) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr("

    You must set a reorder level " "for a stocked item before you may save it.") ); _reorderLevel->setFocus(); return false; } bool isLocationControl = _locationControl->isChecked(); bool isLotSerial = ((_controlMethod->currentIndex() == 2) || (_controlMethod->currentIndex() == 3)); if ( ( (_mode == cNew) && (isLocationControl) ) || ( (_mode == cEdit) && (isLocationControl) && (!_wasLocationControl) ) ) { XSqlQuery locationid; locationid.prepare( "SELECT location_id " "FROM location " "WHERE ((location_warehous_id=:warehous_id)" " AND ( (NOT location_restrict) OR" " ( (location_restrict) AND" " (location_id IN ( SELECT locitem_location_id" " FROM locitem" " WHERE (locitem_item_id=:item_id) ) ) ) )) " "LIMIT 1;" ); locationid.bindValue(":warehous_id", _warehouse->id()); locationid.bindValue(":item_id", _item->id()); locationid.exec(); if (!locationid.first()) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr( "

    You have indicated that this Item Site " "should be Multiple Location Controlled " "but there are no non-restrictive Locations " "in the selected Site nor restrictive Locations " "that will accept the selected Item." "

    You must first create at least one valid " "Location for this Item Site before it may be " "Multiple Location Controlled." ) ); return false; } } if(_active->isChecked()) { itemSave.prepare("SELECT item_id " "FROM item " "WHERE ((item_id=:item_id)" " AND (item_active)) " "LIMIT 1; "); itemSave.bindValue(":item_id", _item->id()); itemSave.exec(); if (!itemSave.first()) { QMessageBox::warning( this, tr("Cannot Save Item Site"), tr("This Item Site refers to an inactive Item and must be marked as inactive.") ); return false; } } if (_locationControl->isChecked() && _disallowBlankWIP->isChecked()) { itemSave.prepare("SELECT EXISTS(SELECT boohead_id" " FROM boohead" " WHERE ((COALESCE(boohead_final_location_id, -1) = -1)" " AND (boohead_rev_id=getActiveRevId('BOO', :item_id))" " AND (boohead_item_id=:item_id))" " UNION SELECT booitem_id" " FROM booitem JOIN" " boohead ON (booitem_item_id=boohead_item_id" " AND booitem_rev_id=boohead_rev_id)" " WHERE ((COALESCE(booitem_wip_location_id, -1) = -1)" " AND (boohead_rev_id=getActiveRevId('BOO', :item_id))" " AND (boohead_item_id=:item_id))" " ) AS isBlank;"); itemSave.bindValue(":item_id", _item->id()); itemSave.exec(); if (itemSave.first()) { if (itemSave.value("isBlank").toBool() && QMessageBox::question(this, tr("Save anyway?"), tr("

    You have selected to disallow blank WIP " "locations but the active Bill Of Operations " "for this Item is either missing a Final " "Location or contains an Operation without " "a WIP Location. Are you sure you want to " "save this Item Site?

    If you say 'Yes' " "then you should fix the Bill Of Operations."), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return false; } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return false; } } if(!_active->isChecked()) { if (_qohCache != 0) { QMessageBox::warning( this, tr("Cannot Save Item Site"), tr("This Item Site has a quantity on hand and must be marked as active.") ); return false; } itemSave.prepare("SELECT coitem_id " "FROM coitem " "WHERE ((coitem_itemsite_id=:itemsite_id)" " AND (coitem_status NOT IN ('X','C'))) " "UNION " "SELECT wo_id " "FROM wo " "WHERE ((wo_itemsite_id=:itemsite_id)" " AND (wo_status<>'C')) " "UNION " "SELECT womatl_id " "FROM womatl, wo " "WHERE ((womatl_itemsite_id=:itemsite_id)" " AND (wo_id=womatl_wo_id)" " AND (wo_status<>'C')) " "UNION " "SELECT poitem_id " "FROM poitem " "WHERE ((poitem_itemsite_id=:itemsite_id)" " AND (poitem_status<>'C')) " "LIMIT 1; "); itemSave.bindValue(":itemsite_id", _itemsiteid); itemSave.exec(); if (itemSave.first()) { QMessageBox::warning( this, tr("Cannot Save Item Site"), tr("This Item Site is used in an active order and must be marked as active.") ); return false; } if (_metrics->boolean("MultiWhs")) { itemSave.prepare("SELECT raitem_id " "FROM raitem " "WHERE ((raitem_itemsite_id=:itemsite_id)" " AND (raitem_status<>'C')) " "UNION " "SELECT planord_id " "FROM planord " "WHERE (planord_itemsite_id=:itemsite_id)" "UNION " "SELECT planreq_id " "FROM planreq " "WHERE (planreq_itemsite_id=:itemsite_id)" "LIMIT 1; "); itemSave.bindValue(":itemsite_id", _itemsiteid); itemSave.exec(); if (itemSave.first()) { QMessageBox::warning( this, tr("Cannot Save Item Site"), tr("This Item Site is used in an active order and must be marked as active.") ); return false; } } } int _supplyItemsiteId = -1; if (_createPlannedTransfers->isChecked()) { itemSave.prepare("SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) ); "); itemSave.bindValue(":item_id", _item->id()); itemSave.bindValue(":warehous_id", _suppliedFromSite->id()); itemSave.exec(); if (itemSave.first()) { if (itemSave.value("itemsite_id").toInt() == _itemsiteid) { QMessageBox::warning( this, tr("Cannot Save Item Site"), tr("The Supplied From Site must be different from this Site.") ); return false; } else _supplyItemsiteId = itemSave.value("itemsite_id").toInt(); } else { QMessageBox::warning( this, tr("Cannot Save Item Site"), tr("Cannot find Supplied From Item Site.") ); return false; } } XSqlQuery newItemSite; if (_mode == cNew) { XSqlQuery newItemsiteid("SELECT NEXTVAL('itemsite_itemsite_id_seq') AS _itemsite_id"); if (newItemsiteid.first()) _itemsiteid = newItemsiteid.value("_itemsite_id").toInt(); else if (newItemsiteid.lastError().type() != QSqlError::NoError) { systemError(this, newItemsiteid.lastError().databaseText(), __FILE__, __LINE__); return false; } newItemSite.prepare( "INSERT INTO itemsite " "( itemsite_id, itemsite_item_id, itemsite_warehous_id, itemsite_qtyonhand," " itemsite_useparams, itemsite_useparamsmanual, itemsite_reorderlevel," " itemsite_ordertoqty, itemsite_minordqty, itemsite_maxordqty, itemsite_multordqty," " itemsite_safetystock, itemsite_cyclecountfreq," " itemsite_leadtime, itemsite_eventfence, itemsite_plancode_id, itemsite_costcat_id," " itemsite_poSupply, itemsite_woSupply, itemsite_createpr, itemsite_createwo," " itemsite_dropship, itemsite_createsopr, itemsite_createsopo," " itemsite_sold, itemsite_soldranking," " itemsite_stocked, itemsite_planning_type, itemsite_supply_itemsite_id," " itemsite_controlmethod, itemsite_perishable, itemsite_active," " itemsite_loccntrl, itemsite_location_id, itemsite_location," " itemsite_recvlocation_id, itemsite_issuelocation_id," " itemsite_location_dist, itemsite_recvlocation_dist, itemsite_issuelocation_dist," " itemsite_location_comments, itemsite_notes," " itemsite_abcclass, itemsite_autoabcclass," " itemsite_freeze, itemsite_datelastused, itemsite_ordergroup, itemsite_ordergroup_first," " itemsite_mps_timefence," " itemsite_disallowblankwip, " " itemsite_costmethod, itemsite_value, itemsite_cosdefault, " " itemsite_warrpurc, itemsite_autoreg, itemsite_lsseq_id) " "VALUES " "( :itemsite_id, :itemsite_item_id, :itemsite_warehous_id, 0.0," " :itemsite_useparams, :itemsite_useparamsmanual, :itemsite_reorderlevel," " :itemsite_ordertoqty, :itemsite_minordqty, :itemsite_maxordqty, :itemsite_multordqty," " :itemsite_safetystock, :itemsite_cyclecountfreq," " :itemsite_leadtime, :itemsite_eventfence, :itemsite_plancode_id, :itemsite_costcat_id," " :itemsite_poSupply, :itemsite_woSupply, :itemsite_createpr, :itemsite_createwo," " :itemsite_dropship, :itemsite_createsopr, :itemsite_createsopo," " :itemsite_sold, :itemsite_soldranking," " :itemsite_stocked, :itemsite_planning_type, :itemsite_supply_itemsite_id," " :itemsite_controlmethod, :itemsite_perishable, :itemsite_active," " :itemsite_loccntrl, :itemsite_location_id, :itemsite_location," " :itemsite_recvlocation_id, :itemsite_issuelocation_id," " :itemsite_location_dist, :itemsite_recvlocation_dist, :itemsite_issuelocation_dist," " :itemsite_location_comments, :itemsite_notes," " :itemsite_abcclass, :itemsite_autoabcclass," " FALSE, startOfTime(), :itemsite_ordergroup, :itemsite_ordergroup_first," " :itemsite_mps_timefence," " :itemsite_disallowblankwip, " " :itemsite_costmethod, 0, :itemsite_cosdefault, " " :itemsite_warrpurc, :itemsite_autoreg, :itemsite_lsseq_id );" ); } else if (_mode == cEdit) { int state = 0; if ( (_wasLocationControl) && (isLocationControl) ) // - state = 10; else if ( (!_wasLocationControl) && (!isLocationControl) ) // _ state = 20; else if ( (!_wasLocationControl) && (isLocationControl) ) // _|- state = 30; else if ( (_wasLocationControl) && (!isLocationControl) ) // -|_ state = 40; if ( (_wasLotSerial) && (isLotSerial) ) // - state += 1; else if ( (!_wasLotSerial) && (!isLotSerial) ) // _ state += 2; else if ( (!_wasLotSerial) && (isLotSerial) ) // _|- state += 3; else if ( (_wasLotSerial) && (!isLotSerial) ) // -|_ state += 4; XSqlQuery query; if ( ( (state == 31) || (state == 32) || (state == 33) || (state == 34) ) && (_qohCache > 0) && ( (!_location->isChecked() || (!_location->isEnabled()) ) ) ) { QMessageBox::critical( this, tr("Cannot Save Item Site"), tr( "

    You have indicated that this Item Site " "should be Multiple Location Controlled and " "there is existing quantity on hand." "

    You must select a default location " "for the on hand balance to be relocated to." ) ); return false; } if ( (state == 24) || (state == 42) || (state == 44) ) { if ( QMessageBox::question(this, tr("Delete Inventory Detail Records?"), tr( "

    You have indicated that detailed " "inventory records for this Item Site " "should no longer be kept. All of the " "detailed inventory records will be " "deleted. " "Are you sure that you want to do this?" ), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return true; } if (_qohCache != 0.0) { // Handle Lot/Serial distribution if ( (state == 13) || (state == 23) || (state == 33) || (state == 43) ) QMessageBox::warning(this, tr("Assign Lot Numbers"), tr("

    You should now use the Reassign Lot/Serial # window to assign Lot/Serial numbers.") ); } newItemSite.prepare( "UPDATE itemsite " "SET itemsite_useparams=:itemsite_useparams, itemsite_useparamsmanual=:itemsite_useparamsmanual," " itemsite_reorderlevel=:itemsite_reorderlevel, itemsite_ordertoqty=:itemsite_ordertoqty," " itemsite_minordqty=:itemsite_minordqty, itemsite_maxordqty=:itemsite_maxordqty, itemsite_multordqty=:itemsite_multordqty," " itemsite_safetystock=:itemsite_safetystock, itemsite_cyclecountfreq=:itemsite_cyclecountfreq," " itemsite_leadtime=:itemsite_leadtime, itemsite_eventfence=:itemsite_eventfence," " itemsite_plancode_id=:itemsite_plancode_id, itemsite_costcat_id=:itemsite_costcat_id," " itemsite_poSupply=:itemsite_poSupply, itemsite_woSupply=:itemsite_woSupply," " itemsite_createsopr=:itemsite_createsopr, itemsite_createsopo=:itemsite_createsopo," " itemsite_dropship=:itemsite_dropship," " itemsite_createpr=:itemsite_createpr, itemsite_createwo=:itemsite_createwo," " itemsite_sold=:itemsite_sold, itemsite_soldranking=:itemsite_soldranking," " itemsite_stocked=:itemsite_stocked, itemsite_planning_type=:itemsite_planning_type," " itemsite_supply_itemsite_id=:itemsite_supply_itemsite_id," " itemsite_controlmethod=:itemsite_controlmethod, itemsite_active=:itemsite_active," " itemsite_perishable=:itemsite_perishable," " itemsite_loccntrl=:itemsite_loccntrl, itemsite_location_id=:itemsite_location_id," " itemsite_location=:itemsite_location, itemsite_location_comments=:itemsite_location_comments," " itemsite_recvlocation_id=:itemsite_recvlocation_id, itemsite_issuelocation_id=:itemsite_issuelocation_id," " itemsite_location_dist=:itemsite_location_dist," " itemsite_recvlocation_dist=:itemsite_recvlocation_dist, itemsite_issuelocation_dist=:itemsite_issuelocation_dist," " itemsite_abcclass=:itemsite_abcclass, itemsite_autoabcclass=:itemsite_autoabcclass," " itemsite_notes=:itemsite_notes," " itemsite_ordergroup=:itemsite_ordergroup," " itemsite_ordergroup_first=:itemsite_ordergroup_first," " itemsite_mps_timefence=:itemsite_mps_timefence," " itemsite_disallowblankwip=:itemsite_disallowblankwip, " " itemsite_warrpurc=:itemsite_warrpurc, itemsite_autoreg=:itemsite_autoreg, " " itemsite_costmethod=:itemsite_costmethod, itemsite_cosdefault=:itemsite_cosdefault, " " itemsite_warehous_id=:itemsite_warehous_id, " " itemsite_lsseq_id=:itemsite_lsseq_id " "WHERE (itemsite_id=:itemsite_id);" ); } newItemSite.bindValue(":itemsite_id", _itemsiteid); newItemSite.bindValue(":itemsite_item_id", _item->id()); newItemSite.bindValue(":itemsite_warehous_id", _warehouse->id()); newItemSite.bindValue(":itemsite_useparams", QVariant(_useParameters->isChecked())); newItemSite.bindValue(":itemsite_reorderlevel", _reorderLevel->toDouble()); newItemSite.bindValue(":itemsite_ordertoqty", _orderUpToQty->toDouble()); newItemSite.bindValue(":itemsite_minordqty", _minimumOrder->toDouble()); newItemSite.bindValue(":itemsite_maxordqty", _maximumOrder->toDouble()); newItemSite.bindValue(":itemsite_multordqty", _orderMultiple->toDouble()); newItemSite.bindValue(":itemsite_useparamsmanual", QVariant(_useParametersOnManual->isChecked())); newItemSite.bindValue(":itemsite_safetystock", _safetyStock->toDouble()); newItemSite.bindValue(":itemsite_cyclecountfreq", _cycleCountFreq->value()); newItemSite.bindValue(":itemsite_plancode_id", _plannerCode->id()); newItemSite.bindValue(":itemsite_costcat_id", _costcat->id()); newItemSite.bindValue(":itemsite_active", QVariant(_active->isChecked())); newItemSite.bindValue(":itemsite_planning_type", _planningType->code()); if (_createPlannedTransfers->isChecked()) newItemSite.bindValue(":itemsite_supply_itemsite_id", _supplyItemsiteId); newItemSite.bindValue(":itemsite_poSupply", QVariant(_poSupply->isChecked())); newItemSite.bindValue(":itemsite_woSupply", QVariant(_woSupply->isChecked())); newItemSite.bindValue(":itemsite_createsopr", QVariant(_createSoPr->isChecked())); newItemSite.bindValue(":itemsite_createsopo", QVariant(_createPo->isChecked())); newItemSite.bindValue(":itemsite_createpr", QVariant(_createPr->isChecked())); newItemSite.bindValue(":itemsite_dropship", QVariant(_dropShip->isChecked() && _createPo->isChecked())); newItemSite.bindValue(":itemsite_createwo", QVariant(_createWo->isChecked())); newItemSite.bindValue(":itemsite_sold", QVariant(_sold->isChecked())); newItemSite.bindValue(":itemsite_stocked", QVariant(_stocked->isChecked())); newItemSite.bindValue(":itemsite_perishable", QVariant(_perishable->isChecked())); newItemSite.bindValue(":itemsite_loccntrl", QVariant(_locationControl->isChecked())); newItemSite.bindValue(":itemsite_disallowblankwip", QVariant((_locationControl->isChecked() && _disallowBlankWIP->isChecked()))); newItemSite.bindValue(":itemsite_leadtime", _leadTime->value()); newItemSite.bindValue(":itemsite_eventfence", _eventFence->value()); newItemSite.bindValue(":itemsite_soldranking", _soldRanking->value()); newItemSite.bindValue(":itemsite_location_comments", _locationComments->text().trimmed()); newItemSite.bindValue(":itemsite_notes", _notes->toPlainText().trimmed()); newItemSite.bindValue(":itemsite_abcclass", _abcClass->currentText()); newItemSite.bindValue(":itemsite_autoabcclass", QVariant(_autoUpdateABCClass->isChecked())); newItemSite.bindValue(":itemsite_ordergroup", _orderGroup->value()); newItemSite.bindValue(":itemsite_ordergroup_first", QVariant(_orderGroupFirst->isChecked())); newItemSite.bindValue(":itemsite_mps_timefence", _mpsTimeFence->value()); newItemSite.bindValue(":itemsite_autolsnum", _autoNumberGroup->isChecked()); if (_useDefaultLocation->isChecked()) { if (_location->isChecked()) { newItemSite.bindValue(":itemsite_location_id", _locations->id()); newItemSite.bindValue(":itemsite_recvlocation_id", _recvlocations->id()); newItemSite.bindValue(":itemsite_issuelocation_id", _issuelocations->id()); newItemSite.bindValue(":itemsite_location_dist", QVariant(_locations_dist->isChecked())); newItemSite.bindValue(":itemsite_recvlocation_dist", QVariant(_recvlocations_dist->isChecked())); newItemSite.bindValue(":itemsite_issuelocation_dist", QVariant(_issuelocations_dist->isChecked())); newItemSite.bindValue(":itemsite_location", ""); } else if (_miscLocation->isChecked()) { newItemSite.bindValue(":itemsite_location_id", -1); newItemSite.bindValue(":itemsite_recvlocation_id", -1); newItemSite.bindValue(":itemsite_issuelocation_id", -1); newItemSite.bindValue(":itemsite_location_dist", false); newItemSite.bindValue(":itemsite_recvlocation_dist", false); newItemSite.bindValue(":itemsite_issuelocation_dist", false); newItemSite.bindValue(":itemsite_location", _miscLocationName->text().trimmed()); } } else { newItemSite.bindValue(":itemsite_location_id", -1); newItemSite.bindValue(":itemsite_recvlocation_id", -1); newItemSite.bindValue(":itemsite_issuelocation_id", -1); newItemSite.bindValue(":itemsite_location_dist", false); newItemSite.bindValue(":itemsite_recvlocation_dist", false); newItemSite.bindValue(":itemsite_issuelocation_dist", false); newItemSite.bindValue(":itemsite_location", ""); } if (_controlMethod->currentIndex() == 0) newItemSite.bindValue(":itemsite_controlmethod", "N"); else if (_controlMethod->currentIndex() == 1) newItemSite.bindValue(":itemsite_controlmethod", "R"); else if (_controlMethod->currentIndex() == 2) newItemSite.bindValue(":itemsite_controlmethod", "L"); else if (_controlMethod->currentIndex() == 3) newItemSite.bindValue(":itemsite_controlmethod", "S"); if(_costNone->isChecked()) newItemSite.bindValue(":itemsite_costmethod", "N"); else if(_costAvg->isChecked()) newItemSite.bindValue(":itemsite_costmethod", "A"); else if(_costStd->isChecked()) newItemSite.bindValue(":itemsite_costmethod", "S"); else if(_costJob->isChecked()) newItemSite.bindValue(":itemsite_costmethod", "J"); newItemSite.bindValue(":itemsite_warrpurc", QVariant(_purchWarranty->isChecked())); newItemSite.bindValue(":itemsite_autoreg", QVariant(_autoRegister->isChecked())); if (_woCostGroup->isChecked()) { if (_todate->isChecked()) newItemSite.bindValue(":itemsite_cosdefault", QString("D")); else newItemSite.bindValue(":itemsite_cosdefault", QString("P")); } if (_sequence->isValid()) newItemSite.bindValue(":itemsite_lsseq_id", _sequence->id()); newItemSite.exec(); if (newItemSite.lastError().type() != QSqlError::NoError) { systemError(this, newItemSite.lastError().databaseText(), __FILE__, __LINE__); return false; } omfgThis->sItemsitesUpdated(); if ((_captive) || (!_metrics->boolean("MultiWhs"))) accept(); else { _warehouse->setNull(); clear(); } return true; } void itemSite::sCheckItemsite() { int whsCache; if ( (_item->isValid()) && (_updates) && (_warehouse->id() != -1) ) { _updates = FALSE; XSqlQuery query; query.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (COALESCE(itemsite_warehous_id,:warehous_id)=:warehous_id) );" ); query.bindValue(":item_id", _item->id()); query.bindValue(":warehous_id", _warehouse->id()); query.exec(); if (query.first()) { _mode = cEdit; _itemsiteid = query.value("itemsite_id").toInt(); whsCache=_warehouse->id(); disconnect(_warehouse, SIGNAL(newID(int)), this, SLOT(sCheckItemsite())); populate(); if (_warehouse->id() == -1) { _warehouse->setId(whsCache); populateLocations(); } connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sCheckItemsite())); } else { _mode = cNew; clear(); } _active->setFocus(); _updates = TRUE; } } void itemSite::sHandleJobCost() { if (_costJob->isChecked() && _itemType == 'M') { _safetyStock->setEnabled(false); _abcClass->setEnabled(false); _autoUpdateABCClass->setEnabled(false); _cycleCountFreq->setEnabled(false); _useParameters->setEnabled(false); _woSupply->setChecked(true); _woSupply->setEnabled(false); _createWo->setChecked(true); _sold->setChecked(true); _sold->setEnabled(false); _stocked->setChecked(false); _autoUpdateABCClass->setChecked(false); _cycleCountFreq->setValue(0); _inventory->setEnabled(false); _poSupply->setChecked(false); _poSupply->setEnabled(false); _locationControl->setChecked(false); _useDefaultLocation->setChecked(false); _tab->setTabEnabled(_tab->indexOf(_restrictedLocations),false); _useParameters->setChecked(false); _planningType->setCurrentIndex(0); _safetyStock->setDouble(0); _createPlannedTransfers->setChecked(false); _tab->setTabEnabled(_tab->indexOf(_planningTab),false); } else if (_costJob->isChecked() && (_itemType == 'P' || _itemType == 'O')) { _safetyStock->setEnabled(false); _abcClass->setEnabled(false); _autoUpdateABCClass->setEnabled(false); _cycleCountFreq->setEnabled(false); _useParameters->setEnabled(false); _woSupply->setChecked(false); _woSupply->setEnabled(false); _createWo->setChecked(false); _sold->setChecked(true); _sold->setEnabled(false); _stocked->setChecked(false); _autoUpdateABCClass->setChecked(false); _cycleCountFreq->setValue(0); _inventory->setEnabled(false); _poSupply->setChecked(true); _poSupply->setEnabled(false); _createPr->setChecked(true); _createSoPr->setChecked(true); _locationControl->setChecked(false); _useDefaultLocation->setChecked(false); _tab->setTabEnabled(_tab->indexOf(_restrictedLocations),false); _useParameters->setChecked(false); _planningType->setCurrentIndex(0); _safetyStock->setDouble(0); _createPlannedTransfers->setChecked(false); _tab->setTabEnabled(_tab->indexOf(_planningTab),false); } else { _inventory->setEnabled(true); sCacheItemType(_itemType); } } void itemSite::sHandlePlanningType() { if (_planningType->code() == "M" || _planningType->code() == "S") { _createPlannedTransfers->setEnabled(TRUE); _orderGroup->setEnabled(TRUE); _orderGroupFirst->setEnabled(TRUE); if (_planningType->code() == "S") _mpsTimeFence->setEnabled(TRUE); else _mpsTimeFence->setEnabled(FALSE); } else { _createPlannedTransfers->setEnabled(FALSE); _orderGroup->setEnabled(FALSE); _orderGroupFirst->setEnabled(FALSE); _mpsTimeFence->setEnabled(FALSE); } } void itemSite::sHandlePOSupplied(bool pSupplied) { if ( (pSupplied) && ( (_itemType == 'P') || (_itemType == 'O') ) ) { _createPr->setEnabled(TRUE); _createSoPr->setEnabled(TRUE); _createPo->setEnabled(TRUE); } else { _createPr->setEnabled(FALSE); _createPr->setChecked(FALSE); _createSoPr->setEnabled(FALSE); _createSoPr->setChecked(FALSE); _createPo->setEnabled(FALSE); _createPo->setChecked(FALSE); _dropShip->setChecked(FALSE); } } void itemSite::sHandleCreatePO(bool pCreate) { if (pCreate) { _dropShip->setEnabled(TRUE); _createSoPr->setChecked(FALSE); XSqlQuery source; source.prepare("SELECT * FROM itemsrc " "WHERE itemsrc_item_id = :item_id " "LIMIT 1;"); source.bindValue(":item_id", _item->id()); source.exec(); if ( !(source.first()) ) QMessageBox::warning( this, tr("No Item Source found"), tr("Purchase Orders cannot be automatically " "created for this Item as there are no Item " "Sources for it. You must create one or " "more Item Sources for this Item before " "the application can automatically create " "Purchase Orders for it.") ); } else _dropShip->setChecked(FALSE); } void itemSite::sHandleCreateSOPR(bool pCreate) { if (pCreate) { _createPo->setChecked(FALSE); XSqlQuery source; source.prepare("SELECT * FROM itemsrc " "WHERE itemsrc_item_id = :item_id " "LIMIT 1;"); source.bindValue(":item_id", _item->id()); source.exec(); if ( !(source.first()) ) QMessageBox::warning( this, tr("No Item Source found"), tr("Purchase Orders cannot be automatically " "created for this Item as there are no Item " "Sources for it. You must create one or " "more Item Sources for this Item before " "the application can automatically create " "Purchase Orders for it.") ); } } void itemSite::sHandleCreateWOPR(bool pCreate) { if (pCreate) { XSqlQuery source; source.prepare("SELECT * FROM itemsrc " "WHERE itemsrc_item_id = :item_id " "LIMIT 1;"); source.bindValue(":item_id", _item->id()); source.exec(); if ( !(source.first()) ) QMessageBox::warning( this, tr("No Item Source found"), tr("Purchase Orders cannot be automatically " "created for this Item as there are no Item " "Sources for it. You must create one or " "more Item Sources for this Item before " "the application can automatically create " "Purchase Orders for it.") ); } } void itemSite::sHandleWOSupplied(bool pSupplied) { if ( (pSupplied) && ( (_itemType == 'M') ) ) _createWo->setEnabled(TRUE); else { _createWo->setEnabled(FALSE); _createWo->setChecked(FALSE); } } void itemSite::sHandleControlMethod() { if (_controlMethod->currentIndex() == 0 || _itemType == 'R' || _itemType == 'K') { _costNone->setChecked(true); _costNone->setEnabled(true); _costAvg->setEnabled(false); _costStd->setEnabled(false); _costJob->setEnabled(false); } else { if(_costStd->isVisibleTo(this) && !_costAvg->isChecked() && !_costJob->isChecked()) _costStd->setChecked(true); else if (_costAvg->isVisibleTo(this) && !_costStd->isChecked() && !_costJob->isChecked()) _costAvg->setChecked(true); else if (_costJob->isVisibleTo(this) && !_costAvg->isChecked() && !_costStd->isChecked()) _costJob->setChecked(true); _costNone->setEnabled(false); _costAvg->setEnabled(true); _costStd->setEnabled(true); } if( (_itemType == 'M' || _itemType == 'P' || _itemType == 'O') && _controlMethod->currentIndex() > 0 && _costJob->isVisibleTo(this) && _qohCache == 0) _costJob->setEnabled(true); else { _costJob->setChecked(false); _costJob->setEnabled(false); } if ( (_controlMethod->currentIndex() == 2) || (_controlMethod->currentIndex() == 3) ) { _autoNumberGroup->setEnabled(true); _perishable->setEnabled(TRUE); _tab->setTabEnabled(_tab->indexOf(_expirationTab),TRUE); } else { _autoNumberGroup->setEnabled(false); _perishable->setEnabled(FALSE); _tab->setTabEnabled(_tab->indexOf(_expirationTab),FALSE); } if (_costJob->isChecked()) sHandleJobCost(); } void itemSite::sCacheItemType(const QString &pItemType) { _itemType = pItemType[0].toAscii(); sCacheItemType(_itemType); } void itemSite::sCacheItemType(char pItemType) { _itemType = pItemType; if (_itemType == 'L') { _planningType->setCurrentIndex(1); _planningType->setEnabled(FALSE); } else if (_itemType != 'P' && _itemType != 'M' && _itemType != 'F' && _itemType != 'B' && _itemType != 'C' && _itemType != 'Y' && _itemType != 'O' && _itemType != 'A') { _planningType->setCurrentIndex(0); _planningType->setEnabled(FALSE); } else { _planningType->setEnabled(TRUE); } if (_controlMethod->currentIndex() == 0 || _itemType == 'R' || _itemType == 'K') { _costNone->setChecked(true); _costNone->setEnabled(true); _costAvg->setEnabled(false); _costStd->setEnabled(false); _costJob->setEnabled(false); } else { if(_costStd->isVisibleTo(this) && !_costAvg->isChecked()) _costStd->setChecked(true); else _costAvg->setChecked(true); _costNone->setEnabled(false); _costAvg->setEnabled(true); _costStd->setEnabled(true); _costJob->setEnabled(false); } if ( (_itemType == 'B') || (_itemType == 'F') || (_itemType == 'R') || (_itemType == 'L') || (_itemType == 'K')) { _safetyStock->setEnabled(FALSE); _abcClass->setEnabled(FALSE); _autoUpdateABCClass->setEnabled(FALSE); _cycleCountFreq->setEnabled(FALSE); if(_itemType=='L') { _orderGroup->setEnabled(TRUE); _orderGroupFirst->setEnabled(TRUE); _mpsTimeFence->setEnabled(TRUE); } else { _orderGroup->setEnabled(FALSE); _orderGroupFirst->setEnabled(FALSE); _mpsTimeFence->setEnabled(FALSE); } _poSupply->setChecked((_itemType!='L') && (_itemType!='K')); _poSupply->setEnabled(FALSE); _woSupply->setChecked((_itemType!='L') && (_itemType!='K')); _woSupply->setEnabled(FALSE); _createPr->setChecked(FALSE); _createPr->setEnabled(FALSE); _createSoPr->setChecked(FALSE); _createSoPr->setEnabled(FALSE); _createPo->setChecked(FALSE); _createPo->setEnabled(FALSE); _createWo->setEnabled(FALSE); if((_itemType == 'R') || (_itemType == 'K')) { _sold->setEnabled(TRUE); _controlMethod->setCurrentIndex(0); } else { _sold->setChecked(FALSE); _sold->setEnabled(FALSE); _controlMethod->setCurrentIndex(1); } _stocked->setChecked(FALSE); _stocked->setEnabled(FALSE); _useDefaultLocation->setChecked(FALSE); _useDefaultLocation->setEnabled(FALSE); _locationControl->setChecked(FALSE); _locationControl->setEnabled(FALSE); _controlMethod->setEnabled(FALSE); } else { _safetyStock->setEnabled(TRUE); _abcClass->setEnabled(TRUE); _autoUpdateABCClass->setEnabled(TRUE); _cycleCountFreq->setEnabled(TRUE); _leadTime->setEnabled(TRUE); _orderGroup->setEnabled(TRUE); _orderGroupFirst->setEnabled(TRUE); _mpsTimeFence->setEnabled(TRUE); _poSupply->setEnabled(TRUE); _woSupply->setEnabled(TRUE); if ( (_itemType == 'O') || (_itemType == 'P') ) { _createPr->setEnabled(_poSupply->isChecked()); _createSoPr->setEnabled(_poSupply->isChecked()); _createPo->setEnabled(_poSupply->isChecked()); } else { _createPr->setChecked(FALSE); _createPr->setEnabled(FALSE); _createSoPr->setChecked(FALSE); _createSoPr->setEnabled(FALSE); _createPo->setChecked(FALSE); _createPo->setEnabled(FALSE); } if ( (_itemType == 'M') ) _createWo->setEnabled(_woSupply->isChecked()); else { _createWo->setChecked(FALSE); _createWo->setEnabled(FALSE); } _sold->setEnabled(TRUE); _stocked->setEnabled(TRUE); _useDefaultLocation->setEnabled(TRUE); _locationControl->setEnabled(TRUE); _controlMethod->setEnabled(TRUE); } if ( (_itemType == 'B') || (_itemType == 'F') || (_itemType == 'R') || (_itemType == 'L') || (_itemType == 'K')) _woCostGroup->setEnabled(false); _tab->setTabEnabled(_tab->indexOf(_planningTab),(_itemType!='K')); _tab->setTabEnabled(_tab->indexOf(_restrictedLocations),(_itemType!='K')); sHandleControlMethod(); } void itemSite::populateLocations() { XSqlQuery query; query.prepare( "SELECT location_id, formatLocationName(location_id) AS locationname " "FROM location " "WHERE ( (location_warehous_id=:warehous_id)" " AND (NOT location_restrict) ) " "UNION SELECT location_id, formatLocationName(location_id) AS locationname " "FROM location, locitem " "WHERE ( (location_warehous_id=:warehous_id)" " AND (location_restrict)" " AND (locitem_location_id=location_id)" " AND (locitem_item_id=:item_id) ) " "ORDER BY locationname;" ); query.bindValue(":warehous_id", _warehouse->id()); query.bindValue(":item_id", _item->id()); query.exec(); _locations->populate(query); _recvlocations->populate(query); _issuelocations->populate(query); sDefaultLocChanged(); sFillRestricted(); } void itemSite::populate() { XSqlQuery itemsite; itemsite.prepare( "SELECT itemsite.*," " item_sold, item_type, supplysite.itemsite_warehous_id AS supplywarehousid " "FROM itemsite JOIN item ON (itemsite.itemsite_item_id=item_id) " " LEFT OUTER JOIN itemsite supplysite ON (itemsite.itemsite_supply_itemsite_id=supplysite.itemsite_id) " "WHERE (itemsite.itemsite_id=:itemsite_id);" ); itemsite.bindValue(":itemsite_id", _itemsiteid); itemsite.exec(); if (itemsite.first()) { _updates = FALSE; _item->setId(itemsite.value("itemsite_item_id").toInt()); _warehouse->setId(itemsite.value("itemsite_warehous_id").toInt()); _warehouse->setEnabled(itemsite.value("itemsite_warehous_id").isNull() || itemsite.value("itemsite_warehous_id").toInt() <= 0); populateLocations(); _active->setChecked(itemsite.value("itemsite_active").toBool()); _qohCache = itemsite.value("itemsite_qtyonhand").toDouble(); sHandleControlMethod(); _useParameters->setChecked(itemsite.value("itemsite_useparams").toBool()); _useParametersOnManual->setChecked(itemsite.value("itemsite_useparamsmanual").toBool()); _reorderLevel->setDouble(itemsite.value("itemsite_reorderlevel").toDouble()); _orderUpToQty->setDouble(itemsite.value("itemsite_ordertoqty").toDouble()); _minimumOrder->setDouble(itemsite.value("itemsite_minordqty").toDouble()); _maximumOrder->setDouble(itemsite.value("itemsite_maxordqty").toDouble()); _orderMultiple->setDouble(itemsite.value("itemsite_multordqty").toDouble()); _safetyStock->setDouble(itemsite.value("itemsite_safetystock").toDouble()); _cycleCountFreq->setValue(itemsite.value("itemsite_cyclecountfreq").toInt()); _leadTime->setValue(itemsite.value("itemsite_leadtime").toInt()); _eventFence->setValue(itemsite.value("itemsite_eventfence").toInt()); _orderGroup->setValue(itemsite.value("itemsite_ordergroup").toInt()); _orderGroupFirst->setChecked(itemsite.value("itemsite_ordergroup_first").toBool()); _mpsTimeFence->setValue(itemsite.value("itemsite_mps_timefence").toInt()); if (itemsite.value("itemsite_controlmethod").toString() == "N") { _controlMethod->setCurrentIndex(0); _wasLotSerial = FALSE; } else if (itemsite.value("itemsite_controlmethod").toString() == "R") { _controlMethod->setCurrentIndex(1); _wasLotSerial = FALSE; } else if (itemsite.value("itemsite_controlmethod").toString() == "L") { _controlMethod->setCurrentIndex(2); _wasLotSerial = TRUE; } else if (itemsite.value("itemsite_controlmethod").toString() == "S") { _controlMethod->setCurrentIndex(3); _wasLotSerial = TRUE; } if ( (_controlMethod->currentIndex() == 2) || (_controlMethod->currentIndex() == 3) ) { _perishable->setEnabled(TRUE); _perishable->setChecked(itemsite.value("itemsite_perishable").toBool()); _sequence->setId(itemsite.value("itemsite_lsseq_id").toInt()); } else _perishable->setEnabled(FALSE); if(itemsite.value("itemsite_costmethod").toString() == "N") _costNone->setChecked(true); else if(itemsite.value("itemsite_costmethod").toString() == "A") _costAvg->setChecked(true); else if(itemsite.value("itemsite_costmethod").toString() == "S") _costStd->setChecked(true); else if(itemsite.value("itemsite_costmethod").toString() == "J") _costJob->setChecked(true); _costcat->setId(itemsite.value("itemsite_costcat_id").toInt()); _plannerCode->setId(itemsite.value("itemsite_plancode_id").toInt()); for (int pcounter = 0; pcounter < _planningType->count(); pcounter++) { _planningType->setCurrentIndex(pcounter); if (QString(itemsite.value("itemsite_planning_type").toString()[0]) == _planningType->code()) break; } sHandlePlanningType(); if (!itemsite.value("supplywarehousid").isNull()) { _suppliedFromSite->setId(itemsite.value("supplywarehousid").toInt()); _createPlannedTransfers->setChecked(TRUE); } else _createPlannedTransfers->setChecked(FALSE); _poSupply->setChecked(itemsite.value("itemsite_poSupply").toBool()); _woSupply->setChecked(itemsite.value("itemsite_woSupply").toBool()); _sold->setChecked(itemsite.value("itemsite_sold").toBool()); _soldRanking->setValue(itemsite.value("itemsite_soldranking").toInt()); _stocked->setChecked(itemsite.value("itemsite_stocked").toBool()); _notes->setText(itemsite.value("itemsite_notes").toString()); if ( (itemsite.value("item_type").toString() == "P") || (itemsite.value("item_type").toString() == "O") ) { _createPr->setChecked(itemsite.value("itemsite_createpr").toBool()); _createSoPr->setChecked(itemsite.value("itemsite_createsopr").toBool()); _createPo->setChecked(itemsite.value("itemsite_createsopo").toBool()); _dropShip->setChecked(itemsite.value("itemsite_dropship").toBool()); } else { _createPr->setEnabled(FALSE); _createSoPr->setEnabled(FALSE); _createPo->setEnabled(FALSE); _dropShip->setEnabled(FALSE); } if ( (itemsite.value("item_type").toString() == "M") ) _createWo->setChecked(itemsite.value("itemsite_createwo").toBool()); else _createWo->setEnabled(FALSE); if (itemsite.value("itemsite_loccntrl").toBool()) _locationControl->setChecked(TRUE); else _locationControl->setChecked(FALSE); _wasLocationControl = itemsite.value("itemsite_loccntrl").toBool(); _disallowBlankWIP->setChecked(itemsite.value("itemsite_disallowblankwip").toBool()); if (itemsite.value("itemsite_location_id").toInt() == -1) { if (!itemsite.value("itemsite_loccntrl").toBool()) { if (itemsite.value("itemsite_location").toString().length()) { _useDefaultLocation->setChecked(TRUE); _miscLocation->setChecked(TRUE); _miscLocationName->setText(itemsite.value("itemsite_location").toString()); } else _useDefaultLocation->setChecked(FALSE); } else _useDefaultLocation->setChecked(FALSE); } else { _useDefaultLocation->setChecked(TRUE); _location->setChecked(TRUE); _locations->setId(itemsite.value("itemsite_location_id").toInt()); _recvlocations->setId(itemsite.value("itemsite_recvlocation_id").toInt()); _issuelocations->setId(itemsite.value("itemsite_issuelocation_id").toInt()); _locations_dist->setChecked(itemsite.value("itemsite_location_dist").toBool()); _recvlocations_dist->setChecked(itemsite.value("itemsite_recvlocation_dist").toBool()); _issuelocations_dist->setChecked(itemsite.value("itemsite_issuelocation_dist").toBool()); } _locationComments->setText(itemsite.value("itemsite_location_comments").toString()); for (int counter = 0; counter < _abcClass->count(); counter++) if (_abcClass->itemText(counter) == itemsite.value("itemsite_abcclass").toString()) _abcClass->setCurrentIndex(counter); _autoUpdateABCClass->setChecked(itemsite.value("itemsite_autoabcclass").toBool()); sHandlePOSupplied(itemsite.value("itemsite_poSupply").toBool()); sHandleWOSupplied(itemsite.value("itemsite_woSupply").toBool()); _comments->setId(_itemsiteid); _purchWarranty->setChecked(itemsite.value("itemsite_warrpurc").toBool()); _autoRegister->setChecked(itemsite.value("itemsite_autoreg").toBool()); if (itemsite.value("itemsite_cosdefault").toString() == "D") { _woCostGroup->setChecked(TRUE); _todate->setChecked(TRUE); _proportional->setChecked(FALSE); } else if (itemsite.value("itemsite_cosdefault").toString() == "P") { _woCostGroup->setChecked(TRUE); _todate->setChecked(FALSE); _proportional->setChecked(TRUE); } _updates = TRUE; } else if (itemsite.lastError().type() != QSqlError::NoError) { systemError(this, itemsite.lastError().databaseText(), __FILE__, __LINE__); return; } } void itemSite::clear() { if (_item->id() != -1) _item->setFocus(); else _active->setFocus(); _active->setChecked(TRUE); _useParameters->setChecked(FALSE); _useParametersOnManual->setChecked(FALSE); _reorderLevel->setText("0.00"); _orderUpToQty->setText("0.00"); _minimumOrder->setText("0.00"); _maximumOrder->setText("0.00"); _orderMultiple->setText("0.00"); _safetyStock->setText("0.00"); _cycleCountFreq->setValue(0); _leadTime->setValue(0); _eventFence->setValue(_metrics->value("DefaultEventFence").toInt()); _orderGroup->setValue(1); _orderGroupFirst->setChecked(FALSE); _mpsTimeFence->setValue(0); sCacheItemType(_itemType); _locationControl->setChecked(FALSE); _useDefaultLocation->setChecked(FALSE); _miscLocationName->clear(); _locationComments->clear(); _costcat->setId(-1); _purchWarranty->setChecked(FALSE); _autoRegister->setChecked(FALSE); _tab->setTabEnabled(_tab->indexOf(_expirationTab),FALSE); populateLocations(); } void itemSite::sFillRestricted() { XSqlQuery itemFillRestricted; int locationid = _restricted->id(); itemFillRestricted.prepare("SELECT location_id, COALESCE(locitem_id, -1)," " formatLocationName(location_id) AS location_name, firstLine(location_descrip) AS location_descrip," " (locitem_id IS NOT NULL) AS allowed" " FROM location LEFT OUTER JOIN locitem" " ON (locitem_location_id=location_id AND locitem_item_id=:item_id)" " WHERE ((location_restrict)" " AND (location_warehous_id=:warehouse_id) ) " "ORDER BY location_name; "); itemFillRestricted.bindValue(":warehouse_id", _warehouse->id()); itemFillRestricted.bindValue(":item_id", _item->id()); itemFillRestricted.exec(); _restricted->populate(itemFillRestricted, locationid, true); } void itemSite::sToggleRestricted() { XSqlQuery itemToggleRestricted; XTreeWidgetItem * locitem = static_cast(_restricted->currentItem()); if(0 == locitem) return; if(-1 != locitem->altId()) { itemToggleRestricted.prepare("DELETE FROM locitem WHERE (locitem_id=:locitem_id); "); itemToggleRestricted.bindValue(":locitem_id", locitem->altId()); itemToggleRestricted.exec(); } else { itemToggleRestricted.prepare("INSERT INTO locitem(locitem_location_id, locitem_item_id) VALUES (:location_id, :item_id);"); itemToggleRestricted.bindValue(":location_id", locitem->id()); itemToggleRestricted.bindValue(":item_id", _item->id()); itemToggleRestricted.exec(); } sFillRestricted(); } int itemSite::createItemSite(QWidget* pparent, int pitemsiteid, int pwhsid, bool peditResult) { QString noactiveis = tr("

    There is no active Item Site for this Item " "at %1. Shipping or receiving this Item will " "fail if there is no Item Site. Please have an " "administrator create one before trying to ship " "this Order."); QString whs; XSqlQuery whsq; whsq.prepare("SELECT warehous_code " "FROM whsinfo " "WHERE (warehous_id=:whsid);"); whsq.bindValue(":whsid", pwhsid); whsq.exec(); if (whsq.first()) whs = whsq.value("warehous_code").toString(); else if (whsq.lastError().type() != QSqlError::NoError) { systemError(pparent, whsq.lastError().databaseText(), __FILE__, __LINE__); return -100; } else { QMessageBox::warning(pparent, tr("No Site"), tr("

    The desired Item Site cannot be created as " "there is no Site with the internal ID %1.") .arg(whs)); return -99; } // use the s(ource) itemsite_item_id to see if the d(est) itemsite exists XSqlQuery isq; isq.prepare("SELECT COALESCE(d.itemsite_id, -1) AS itemsite_id," " COALESCE(d.itemsite_active, false) AS itemsite_active " "FROM itemsite s LEFT OUTER JOIN" " itemsite d ON (d.itemsite_item_id=s.itemsite_item_id" " AND d.itemsite_warehous_id=:whsid) " "WHERE (s.itemsite_id=:itemsiteid);"); isq.bindValue(":itemsiteid", pitemsiteid); isq.bindValue(":whsid", pwhsid); isq.exec(); if (isq.first()) { int itemsiteid = isq.value("itemsite_id").toInt(); if (itemsiteid > 0 && isq.value("itemsite_active").toBool()) return itemsiteid; else if (! _privileges->check("MaintainItemSites")) { QMessageBox::warning(pparent, tr("No Active Item Site"), noactiveis.arg(whs)); return 0; // not fatal - toitem trigger should log an event } else if (itemsiteid < 0) { isq.prepare("SELECT copyItemSite(:itemsiteid, :whsid) AS result;"); isq.bindValue(":itemsiteid", pitemsiteid); isq.bindValue(":whsid", pwhsid); isq.exec(); if (isq.first()) { itemsiteid = isq.value("result").toInt(); if (itemsiteid < 0) { systemError(pparent, storedProcErrorLookup("copyItemSite", itemsiteid), __FILE__, __LINE__); return itemsiteid; } if (peditResult) { itemSite newdlg(pparent, "", true); ParameterList params; params.append("mode", "edit"); params.append("itemsite_id", itemsiteid); if (newdlg.set(params) != NoError || newdlg.exec() != XDialog::Accepted) { isq.prepare("SELECT deleteItemSite(:itemsiteid) AS result;"); isq.bindValue(":itemsiteid", itemsiteid); isq.exec(); if (isq.first()) { int result = isq.value("result").toInt(); if (result < 0) { systemError(pparent, storedProcErrorLookup("deleteItemsite", result), __FILE__, __LINE__); return result; } } else if (isq.lastError().type() != QSqlError::NoError) { systemError(pparent, isq.lastError().databaseText(), __FILE__, __LINE__); return -100; } return -1; // user cancelled } } return itemsiteid; } // end if successfully copied an itemsite else if (isq.lastError().type() != QSqlError::NoError) { systemError(pparent, isq.lastError().databaseText(), __FILE__, __LINE__); return -100; } } else if (! isq.value("itemsite_active").toBool()) { if (QMessageBox::question(pparent, tr("Inactive Item Site"), tr("

    The Item Site for this Item at %1 is " "inactive. Would you like to make it active?") .arg(whs), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes) { isq.prepare("UPDATE itemsite SET itemsite_active = TRUE " "WHERE itemsite_id=:itemsiteid;"); isq.bindValue(":itemsiteid", itemsiteid); isq.exec(); if (isq.lastError().type() != QSqlError::NoError) { systemError(pparent, isq.lastError().databaseText(), __FILE__, __LINE__); return -100; } return itemsiteid; } else { QMessageBox::warning(pparent, tr("No Active Item Site"), noactiveis.arg(whs)); return -98; } } } else if (isq.lastError().type() != QSqlError::NoError) { systemError(pparent, isq.lastError().databaseText(), __FILE__, __LINE__); return -100; } systemError(pparent, tr("

    There was a problem checking or creating an " "Item Site for this Transfer Order Item."), __FILE__, __LINE__); return -90; // catchall: we didn't successfully find/create an itemsite } void itemSite::sDefaultLocChanged() { if (_useDefaultLocation->isChecked()) { _location->setChecked(_locationControl->isChecked()); _miscLocation->setEnabled(!_locationControl->isChecked()); _miscLocationName->setEnabled(!_locationControl->isChecked()); } else { _miscLocation->setEnabled(FALSE); _miscLocationName->setEnabled(FALSE); } } qt-client-4.1.0/guiclient/itemSite.h000066400000000000000000000035771217451700100173450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSITE_H #define ITEMSITE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemSite.h" class itemSite : public XDialog, public Ui::itemSite { Q_OBJECT public: itemSite(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemSite(); static int createItemSite(QWidget*, int, int, bool); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool sSave(); virtual void sCheckItemsite(); virtual void sHandlePlanningType(); virtual void sHandleJobCost(); virtual void sHandlePOSupplied( bool pSupplied ); virtual void sHandleCreatePO( bool pCreate ); virtual void sHandleCreateSOPR( bool pCreate ); virtual void sHandleCreateWOPR( bool pCreate ); virtual void sHandleWOSupplied( bool pSupplied ); virtual void sHandleControlMethod(); virtual void sCacheItemType( const QString & pItemType ); virtual void sCacheItemType( char pItemType ); virtual void populateLocations(); virtual void populate(); virtual void clear(); virtual void sFillRestricted(); virtual void sToggleRestricted(); virtual void sDefaultLocChanged(); protected slots: virtual void languageChange(); private: int _mode; int _itemsiteid; bool _captive; bool _updates; double _qohCache; char _itemType; bool _wasLotSerial; bool _wasLocationControl; }; #endif // ITEMSITE_H qt-client-4.1.0/guiclient/itemSite.ui000066400000000000000000001752531217451700100175340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSite 0 0 714 619 Item Site 12 Qt::StrongFocus 2 &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::Vertical 20 0 &Active true Qt::Horizontal 0 20 &Cancel false &Save true Qt::Vertical 20 0 Site can manufacture this Item true false 0 0 Create Work Orders linked to Sales Orders Qt::TabFocus Site can purchase this Item true false Create Purchase Requests for Work Order requirements Create Purchase Requests for Sales Orders Create Purchase Orders linked to Sales Orders Qt::Horizontal QSizePolicy::Fixed 13 13 Drop ship Items by default Qt::Vertical 20 0 Qt::TabFocus Sold from this Site true Ranking: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 10 Qt::Horizontal QSizePolicy::Expanding 0 17 0 1 Qt::ClickFocus 0 &Inventory Control Control Method: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter None Regular Lot # Serial # &Planner Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _plannerCode 0 0 true XComboBox::PlannerCodes Cost Cate&gory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _costcat 0 0 true XComboBox::CostCategories Qt::Horizontal 0 20 Settings Stocked Allow Automatic ABC Updates ABC Class: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter A B C Cycl. Cnt. Fre&q.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _cycleCountFreq 999 Days Event &Fence: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _eventFence 0 999 Days Costing Method 0 0 None 0 0 Average 0 0 Standard 0 0 Job Qt::Horizontal 0 20 Over-ride Work Order Item Cost Recognition Default true false To Date true Proportional Qt::Horizontal 40 20 Automatic Lot/Serial Numbering false Qt::StrongFocus Sequence #: Qt::Vertical 20 64 &Location Control 12 true Multiple Location Control false 0 0 Qt::TabFocus Use Default Location true Location: true User-Defined: false Qt::Horizontal 0 20 Receive: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Auto true Qt::Horizontal 0 20 Stock: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Auto true Qt::Horizontal 0 20 W/O Issue: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Auto true Qt::Horizontal 0 20 Location Comment: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Disallow Blank WIP Locations Qt::Vertical 20 0 Restricted Locations Qt::ClickFocus false Toggle Qt::Vertical QSizePolicy::Expanding 20 20 &Planning true Qt::TabFocus Enforce Order Parameters true false &Reorder Level: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _reorderLevel 80 32767 Qt::AlignRight Maximum Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _maximumOrder 80 32767 Qt::AlignRight Minimum Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _minimumOrder Order &Multiple: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderMultiple 80 32767 Qt::AlignRight 80 32767 Qt::AlignRight 80 32767 Qt::AlignRight Order &Up To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderUpToQty Qt::Horizontal QSizePolicy::Expanding 0 20 Enforce on Manual Orders Qt::Vertical 20 0 1 0 Scheduling Planning System: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 Group Planned Orders Every: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 999 0 Days &Lead Time: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _leadTime 0 999 Days Qt::Horizontal QSizePolicy::Fixed 13 14 0 0 First Group MPS Time Fence: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 999 0 Days Create Planned Transfer Orders true false Supplied from Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter WComboBox::NonTransit Qt::Horizontal 0 17 Qt::Horizontal 40 20 Safety Stock: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Qt::Vertical 20 0 &Notes Qt::ClickFocus true Co&mments Qt::TabFocus Comments::ItemSite E&xpiration true Perishable Requires Warranty when Purchased Auto Register Lot/Serial at Shipping Qt::Vertical 236 138 Qt::Horizontal 0 20 Comments QWidget

    comments.h
    ItemCluster QWidget
    itemcluster.h
    1
    LotserialseqCluster QWidget
    lotserialseqcluster.h
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _active _woSupply _createWo _sold _soldRanking _poSupply _createPr _createSoPr _createPo _dropShip _tab _controlMethod _plannerCode _costcat _costNone _costAvg _costStd _costJob _stocked _autoUpdateABCClass _abcClass _cycleCountFreq _eventFence _woCostGroup _todate _proportional _sequence _locationControl _useDefaultLocation _location _miscLocation _miscLocationName _locationComments _disallowBlankWIP _restricted _toggleRestricted _useParameters _reorderLevel _orderUpToQty _minimumOrder _maximumOrder _orderMultiple _useParametersOnManual _planningType _safetyStock _orderGroup _leadTime _orderGroupFirst _mpsTimeFence _createPlannedTransfers _suppliedFromSite _notes _comments _perishable _purchWarranty _autoRegister _save _close _item valid(bool) _save setEnabled(bool) 20 20 20 20 _miscLocation toggled(bool) _miscLocationName setEnabled(bool) 20 20 20 20 _restricted itemSelected(int) _toggleRestricted animateClick() 20 20 20 20 _restricted valid(bool) _toggleRestricted setEnabled(bool) 20 20 20 20 _locationControl toggled(bool) _disallowBlankWIP setEnabled(bool) 20 20 20 20 _item newId(int) _suppliedFromSite findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _suppliedFromSite setId(int) 20 20 20 20 qt-client-4.1.0/guiclient/itemSites.cpp000066400000000000000000000230361217451700100200530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSites.h" #include #include #include #include #include #include #include "createCountTagsByItem.h" #include "dspInventoryAvailability.h" #include "itemSite.h" #include "parameterwidget.h" #include "storedProcErrorLookup.h" itemSites::itemSites(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "itemSites", fl) { setWindowTitle(tr("Item Sites")); setReportName("ItemSites"); setMetaSQLOptions("itemSites", "detail"); setParameterWidgetVisible(true); setSearchVisible(true); setNewVisible(true); setQueryOnStartEnabled(true); parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->append(tr("Class Code Pattern"), "classcode_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Cost Category"), "costcat_id", XComboBox::CostCategories); parameterWidget()->append(tr("Cost Category Pattern"), "costcat_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->appendComboBox(tr("Planner Code"), "plancode_id", XComboBox::PlannerCodes); parameterWidget()->append(tr("Planner Code Pattern"), "plancode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); if (_privileges->check("MaintainItemSites")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } list()->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "itemsite_qtyonhand" ); list()->addColumn(tr("Active"), _ynColumn, Qt::AlignCenter, true, "itemsite_active" ); list()->addColumn(tr("Loc. Cntrl."), _dateColumn, Qt::AlignCenter, true, "itemsite_loccntrl" ); list()->addColumn(tr("Cntrl. Method"), _dateColumn, Qt::AlignCenter, true, "controlmethod" ); list()->addColumn(tr("Sold Ranking"), _dateColumn, Qt::AlignCenter, false, "soldranking" ); list()->addColumn(tr("ABC Class"), _dateColumn, Qt::AlignCenter, false, "itemsite_abcclass" ); list()->addColumn(tr("Cycle Cnt."), _dateColumn, Qt::AlignCenter, false, "itemsite_cyclecountfreq" ); list()->addColumn(tr("Last Cnt'd"), _dateColumn, Qt::AlignCenter, false, "datelastcount" ); list()->addColumn(tr("Last Used"), _dateColumn, Qt::AlignCenter, false, "datelastused" ); } enum SetResponse itemSites::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("warehous_id", &valid); if (valid) { if (param.toInt() > 0) parameterWidget()->setDefault(tr("Site"), param); } if (pParams.inList("showInactive")) parameterWidget()->setDefault(tr("Show Inactive"), true); param = pParams.value("classcode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code"), param); param = pParams.value("classcode_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Class Code Pattern"), param); param = pParams.value("plancode_id", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code"), param); param = pParams.value("plancode_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Planner Code Pattern"), param); param = pParams.value("costcat_id", &valid); if (valid) parameterWidget()->setDefault(tr("Cost Category"), param); param = pParams.value("costcat_pattern", &valid); if (valid) parameterWidget()->setDefault(tr("Cost Category Pattern"), param); parameterWidget()->applyDefaultFilterSet();; if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void itemSites::sNew() { ParameterList params; params.append("mode", "new"); itemSite newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void itemSites::sView() { ParameterList params; params.append("mode", "view"); params.append("itemsite_id", list()->id()); itemSite newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void itemSites::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("itemsite_id", list()->id()); itemSite newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void itemSites::sCopy() { XSqlQuery itemCopy; itemCopy.prepare("SELECT copyItemSite(:olditemsiteid, NULL) AS result;"); itemCopy.bindValue(":olditemsiteid", list()->id()); itemCopy.exec(); if (itemCopy.first()) { int result = itemCopy.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("copyItemSite", result), __FILE__, __LINE__); return; } ParameterList params; params.append("mode", "edit"); params.append("itemsite_id", result); itemSite newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Accepted) { itemCopy.prepare("SELECT deleteItemSite(:itemsite_id) AS result;"); itemCopy.bindValue(":itemsite_id", result); itemCopy.exec(); if (itemCopy.first()) { int result = itemCopy.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteItemSite", result), __FILE__, __LINE__); return; } } else if (itemCopy.lastError().type() != QSqlError::NoError) { systemError(this, itemCopy.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } else if (itemCopy.lastError().type() != QSqlError::NoError) { systemError(this, itemCopy.lastError().databaseText(), __FILE__, __LINE__); return; } } void itemSites::sDelete() { XSqlQuery itemDelete; if (QMessageBox::question(this, tr("Delete Selected Line Item?"), tr("Are you sure that you want to delete the " "selected Item Site?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; itemDelete.prepare("SELECT deleteItemSite(:itemsite_id) AS result;"); itemDelete.bindValue(":itemsite_id", list()->id()); itemDelete.exec(); if (itemDelete.first()) { int result = itemDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteItemSite", result), __FILE__, __LINE__); return; } sFillList(); } else if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, itemDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void itemSites::sInventoryAvailability() { ParameterList params; params.append("itemsite_id", list()->id()); params.append("run"); params.append("byLeadTime"); dspInventoryAvailability *newdlg = new dspInventoryAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void itemSites::sIssueCountTag() { ParameterList params; params.append("itemsite_id", list()->id()); createCountTagsByItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void itemSites::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView()));; if ((!_privileges->check("MaintainItemSites")) && (!_privileges->check("ViewItemSites"))) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit()));; if (!_privileges->check("MaintainItemSites")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Copy..."), this, SLOT(sCopy()));; if (!_privileges->check("MaintainItemSites")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete()));; if (!_privileges->check("MaintainItemSites")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Inventory Availability..."), this, SLOT(sInventoryAvailability()));; if (!_privileges->check("ViewInventoryAvailability")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Issue Count Tag..."), this, SLOT(sIssueCountTag()));; if (!_privileges->check("IssueCountTags")) menuItem->setEnabled(false); } bool itemSites::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; params.append("regular", tr("Regular")); params.append("none", tr("None")); params.append("lot", tr("Lot #")); params.append("serial", tr("Serial #")); params.append("na", tr("N/A")); params.append("never", tr("Never")); return true; } qt-client-4.1.0/guiclient/itemSites.h000066400000000000000000000021101217451700100175060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSITES_H #define ITEMSITES_H #include "guiclient.h" #include "display.h" class itemSites : public display { Q_OBJECT public: itemSites(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sNew(); virtual void sView(); virtual void sEdit(); virtual void sCopy(); virtual void sDelete(); virtual void sInventoryAvailability(); virtual void sIssueCountTag(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // ITEMSITES_H qt-client-4.1.0/guiclient/itemSites.ui000066400000000000000000000224601217451700100177060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSites 0 0 800 600 List Item Sites 12 12 false Show &Inactive Item Sites Search &for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _searchFor Qt::Horizontal QSizePolicy::Expanding 283 20 5 &Close true Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 &Item Sites: _itemSite 5 0 &New true false &Edit true false &View true false &Delete Copy Qt::Vertical QSizePolicy::Expanding 20 115 WarehouseGroup QGroupBox
    warehousegroup.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _searchFor _warehouse _itemSite _new _edit _view _delete _copy _close _close clicked() itemSites close() 485 31 20 20 _itemSite valid(bool) _view setEnabled(bool) 31 158 484 217
    qt-client-4.1.0/guiclient/itemSource.cpp000066400000000000000000000572321217451700100202310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2011 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSource.h" #include #include #include #include #include #include #include "crmacctcluster.h" #include "itemSourcePrice.h" #include "xcombobox.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include #include #include "mqlutil.h" itemSource::itemSource(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery itemitemSource; setupUi(this); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_itemsrcp,SIGNAL(populateMenu(QMenu*, XTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); connect(_save, SIGNAL(clicked()), this, SLOT(sSaveClicked())); connect(_vendor, SIGNAL(newId(int)), this, SLOT(sVendorChanged(int))); connect(_vendorCurrency, SIGNAL(newID(int)), this, SLOT(sFillPriceList())); connect(_contract, SIGNAL(newID(int)), this, SLOT(sContractChanged(int))); connect(this, SIGNAL(rejected()), this, SLOT(sRejected())); // TODO method doesn't exist? // connect(_vendorUOM, SIGNAL(textChanged()), this, SLOT(sClearVendorUOM())); // connect(_invVendorUOMRatio, SIGNAL(textChanged(QString)), this, SLOT(sClearVendorUOM())); _vendorUOM->setType(XComboBox::UOMs); _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured | ItemLineEdit::cTooling); _item->setDefaultType(ItemLineEdit::cGeneralPurchased); _dates->setStartNull(tr("Always"), omfgThis->startOfTime(), TRUE); _dates->setStartCaption(tr("Effective")); _dates->setEndNull(tr("Never"), omfgThis->endOfTime(), TRUE); _dates->setEndCaption(tr("Expires")); _captive = false; _new = false; QString base; itemitemSource.exec("SELECT currConcat(baseCurrID()) AS base;"); if (itemitemSource.first()) base = itemitemSource.value("base").toString(); else base = tr("Base"); if (_metrics->boolean("MultiWhs")) { _itemsrcp->addColumn(tr("Site"), _qtyColumn, Qt::AlignCenter,true, "warehous_code"); _itemsrcp->addColumn(tr("Order Type"), -1, Qt::AlignCenter,true, "itemsrcp_dropship"); } _itemsrcp->addColumn(tr("Qty Break"), _qtyColumn, Qt::AlignRight, true, "itemsrcp_qtybreak"); _itemsrcp->addColumn(tr("Unit Price"), -1, Qt::AlignRight, true, "itemsrcp_price"); _itemsrcp->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "item_curr"); _itemsrcp->addColumn(tr("Discount Percent"), -1, Qt::AlignRight, true, "itemsrcp_discntprcnt" ); _itemsrcp->addColumn(tr("Discount Fixed Amt."), -1, Qt::AlignRight, true, "itemsrcp_fixedamtdiscount" ); _itemsrcp->addColumn(tr("Unit Price\n(%1)").arg(base),_moneyColumn, Qt::AlignRight, true, "price_base"); _itemsrcp->addColumn(tr("Type"), _orderColumn, Qt::AlignLeft, true, "type" ); _itemsrcp->addColumn(tr("Method"), _orderColumn, Qt::AlignLeft, true, "method" ); if (omfgThis->singleCurrency()) { _itemsrcp->hideColumn(1); _itemsrcp->hideColumn(2); _itemsrcp->headerItem()->setText(3, tr("Unit Price")); } _invVendorUOMRatio->setValidator(omfgThis->ratioVal()); _minOrderQty->setValidator(omfgThis->qtyVal()); _multOrderQty->setValidator(omfgThis->qtyVal()); _vendorCurrency->setType(XComboBox::Currencies); _vendorCurrency->setLabel(_vendorCurrencyLit); itemitemSource.exec("SELECT MAX(itemsrc_id),itemsrc_manuf_name, itemsrc_manuf_name " "FROM itemsrc " "WHERE (itemsrc_manuf_name != '') " "GROUP BY itemsrc_manuf_name " "ORDER BY itemsrc_manuf_name;"); _manufName->populate(itemitemSource); _manufName->setCurrentIndex(0); } itemSource::~itemSource() { // no need to delete child widgets, Qt does it all for us } void itemSource::languageChange() { retranslateUi(this); } enum SetResponse itemSource::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsrc_id", &valid); if (valid) { _itemsrcid = param.toInt(); populate(); } param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setEnabled(FALSE); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _new = true; itemet.exec("SELECT NEXTVAL('itemsrc_itemsrc_id_seq') AS _itemsrc_id;"); if (itemet.first()) _itemsrcid = itemet.value("_itemsrc_id").toInt(); else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, itemet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _captive = true; connect(_itemsrcp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_itemsrcp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_itemsrcp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else if (param.toString() == "edit") { _mode = cEdit; connect(_itemsrcp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_itemsrcp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_itemsrcp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); _item->setReadOnly(TRUE); _vendor->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _active->setEnabled(FALSE); _default->setEnabled(FALSE); _vendor->setEnabled(FALSE); _dates->setEnabled(FALSE); _vendorItemNumber->setEnabled(FALSE); _vendorItemDescrip->setEnabled(FALSE); _vendorUOM->setEnabled(FALSE); _invVendorUOMRatio->setEnabled(FALSE); _vendorRanking->setEnabled(FALSE); _minOrderQty->setEnabled(FALSE); _multOrderQty->setEnabled(FALSE); _leadTime->setEnabled(FALSE); _notes->setEnabled(FALSE); _upcCode->setEnabled(FALSE); _add->setEnabled(FALSE); _delete->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } if (param.toString() == "copy") { _mode = cCopy; _new = true; _captive = true; int itemsrcidold = _itemsrcid; itemet.exec("SELECT NEXTVAL('itemsrc_itemsrc_id_seq') AS _itemsrc_id;"); if (itemet.first()) _itemsrcid = itemet.value("_itemsrc_id").toInt(); else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, itemet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } connect(_itemsrcp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_itemsrcp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_itemsrcp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); _item->setReadOnly(TRUE); _vendorItemNumber->setText(_vendorItemNumber->text().prepend("Copy Of ")); _dates->setStartDate(omfgThis->dbDate()); if (sSave()) { itemet.prepare("INSERT INTO itemsrcp ( " "itemsrcp_itemsrc_id, itemsrcp_qtybreak, " "itemsrcp_price, itemsrcp_updated, itemsrcp_curr_id) " "SELECT :itemsrcid, itemsrcp_qtybreak, " "itemsrcp_price, current_date, itemsrcp_curr_id " "FROM itemsrcp " "WHERE (itemsrcp_itemsrc_id=:itemsrcidold); "); itemet.bindValue(":itemsrcid", _itemsrcid); itemet.bindValue(":itemsrcidold", itemsrcidold); itemet.exec(); sFillPriceList(); } } } return NoError; } void itemSource::sSaveClicked() { _captive = false; sSave(); } bool itemSource::sSave() { XSqlQuery itemSave; QList errors; errors << GuiErrorCheck(!_item->isValid(), _item, tr( "You must select an Item that this Item Source represents\n" "before you may save this Item Source." ) ) << GuiErrorCheck(!_vendor->isValid(), _vendor, tr( "You must select this Vendor that this Item Source is sold by\n" "before you may save this Item Source." ) ) << GuiErrorCheck(_dates->endDate() < _dates->startDate(), _dates, tr("The expiration date cannot be earlier than the effective date.")) << GuiErrorCheck(_vendorUOM->currentText().length() == 0, _vendorUOM, tr( "You must indicate the Unit of Measure that this Item Source is sold in\n" "before you may save this Item Source." ) ) << GuiErrorCheck(_invVendorUOMRatio->toDouble() == 0.0, _invVendorUOMRatio, tr( "You must indicate the Ratio of Inventory to Vendor Unit of Measures\n" "before you may save this Item Source." ) ) ; /* TODO - need this? itemSave.prepare( "SELECT count(*) AS numberOfOverlaps " "FROM itemsrc " "WHERE (itemsrc_item_id = :itemsrc_item_id)" " AND (itemsrc_vend_id = :itemsrc_vend_id)" " AND (itemsrc_id != :itemsrc_id)" " AND ( (itemsrc_effective BETWEEN :itemsrc_effective AND :itemsrc_expires OR" " itemsrc_expires BETWEEN :itemsrc_effective AND :itemsrc_expires)" " OR (itemsrc_effective <= :itemsrc_effective AND" " itemsrc_expires >= :itemsrc_expires) );" ); itemSave.bindValue(":itemsrc_id", _itemsrcid); itemSave.bindValue(":itemsrc_item_id", _item->id()); itemSave.bindValue(":itemsrc_vend_id", _vendor->id()); itemSave.bindValue(":itemsrc_effective", _dates->startDate()); itemSave.bindValue(":itemsrc_expires", _dates->endDate()); itemSave.exec(); if (itemSave.first()) { if (itemSave.value("numberOfOverlaps").toInt() > 0) { errors << GuiErrorCheck(true, _dates, tr("The date range overlaps with another date range.\n" "Please check the values of these dates.")); } } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return false; } */ if(_mode == cNew || _mode == cCopy) { itemSave.prepare( "SELECT itemsrc_id " " FROM itemsrc " " WHERE ((itemsrc_item_id=:item_id) " " AND (itemsrc_vend_id=:vend_id) " " AND (itemsrc_vend_item_number=:itemsrc_vend_item_number) " " AND (UPPER(itemsrc_manuf_name)=UPPER(:itemsrc_manuf_name)) " " AND (UPPER(itemsrc_manuf_item_number)=UPPER(:itemsrc_manuf_item_number)) ) "); itemSave.bindValue(":item_id", _item->id()); itemSave.bindValue(":vend_id", _vendor->id()); itemSave.bindValue(":itemsrc_vend_item_number", _vendorItemNumber->text()); itemSave.bindValue(":itemsrc_manuf_name", _manufName->currentText()); itemSave.bindValue(":itemsrc_manuf_item_number", _manufItemNumber->text()); itemSave.exec(); if(itemSave.first()) { errors << GuiErrorCheck(true, _item, tr("An Item Source already exists for the Item Number, Vendor,\n" "Vendor Item, Manfacturer Name and Manufacturer Item Number you have specified.")); } else if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return false; } } if(_active->isChecked()) { itemSave.prepare("SELECT item_id " "FROM item " "WHERE ((item_id=:item_id)" " AND (item_active)) " "LIMIT 1; "); itemSave.bindValue(":item_id", _item->id()); itemSave.exec(); if (!itemSave.first()) { errors << GuiErrorCheck(true, _active, tr("This Item Source refers to an inactive Item and must be marked as inactive.") ); } } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Item Source"), errors)) return false; if (_mode == cNew || _mode == cCopy) itemSave.prepare( "INSERT INTO itemsrc " "( itemsrc_id, itemsrc_item_id, itemsrc_active, itemsrc_default, itemsrc_vend_id," " itemsrc_contrct_id, itemsrc_effective, itemsrc_expires," " itemsrc_vend_item_number, itemsrc_vend_item_descrip," " itemsrc_vend_uom, itemsrc_invvendoruomratio," " itemsrc_minordqty, itemsrc_multordqty, itemsrc_upccode," " itemsrc_leadtime, itemsrc_ranking," " itemsrc_comments, itemsrc_manuf_name, " " itemsrc_manuf_item_number, itemsrc_manuf_item_descrip ) " "VALUES " "( :itemsrc_id, :itemsrc_item_id, :itemsrc_active, :itemsrc_default, :itemsrc_vend_id," " :itemsrc_contrct_id, :itemsrc_effective, :itemsrc_expires," " :itemsrc_vend_item_number, :itemsrc_vend_item_descrip," " :itemsrc_vend_uom, :itemsrc_invvendoruomratio," " :itemsrc_minordqty, :itemsrc_multordqty, :itemsrc_upccode," " :itemsrc_leadtime, :itemsrc_ranking," " :itemsrc_comments, :itemsrc_manuf_name, " " :itemsrc_manuf_item_number, :itemsrc_manuf_item_descrip );" ); if (_mode == cEdit) itemSave.prepare( "UPDATE itemsrc " "SET itemsrc_active=:itemsrc_active," " itemsrc_default=:itemsrc_default," " itemsrc_vend_id=:itemsrc_vend_id," " itemsrc_contrct_id=:itemsrc_contrct_id," " itemsrc_effective=:itemsrc_effective," " itemsrc_expires=:itemsrc_expires," " itemsrc_vend_item_number=:itemsrc_vend_item_number," " itemsrc_vend_item_descrip=:itemsrc_vend_item_descrip," " itemsrc_vend_uom=:itemsrc_vend_uom," " itemsrc_invvendoruomratio=:itemsrc_invvendoruomratio," " itemsrc_upccode=:itemsrc_upccode," " itemsrc_minordqty=:itemsrc_minordqty, itemsrc_multordqty=:itemsrc_multordqty," " itemsrc_leadtime=:itemsrc_leadtime, itemsrc_ranking=:itemsrc_ranking," " itemsrc_comments=:itemsrc_comments, itemsrc_manuf_name=:itemsrc_manuf_name, " " itemsrc_manuf_item_number=:itemsrc_manuf_item_number, " " itemsrc_manuf_item_descrip=:itemsrc_manuf_item_descrip " "WHERE (itemsrc_id=:itemsrc_id);" ); itemSave.bindValue(":itemsrc_id", _itemsrcid); itemSave.bindValue(":itemsrc_item_id", _item->id()); itemSave.bindValue(":itemsrc_active", QVariant(_active->isChecked())); itemSave.bindValue(":itemsrc_default", QVariant(_default->isChecked())); itemSave.bindValue(":itemsrc_vend_id", _vendor->id()); if (_contract->isValid()) itemSave.bindValue(":itemsrc_contrct_id", _contract->id()); itemSave.bindValue(":itemsrc_effective", _dates->startDate()); itemSave.bindValue(":itemsrc_expires", _dates->endDate()); itemSave.bindValue(":itemsrc_vend_item_number", _vendorItemNumber->text()); itemSave.bindValue(":itemsrc_vend_item_descrip", _vendorItemDescrip->toPlainText()); itemSave.bindValue(":itemsrc_vend_uom", _vendorUOM->currentText()); itemSave.bindValue(":itemsrc_invvendoruomratio", _invVendorUOMRatio->toDouble()); itemSave.bindValue(":itemsrc_upccode", _upcCode->text()); itemSave.bindValue(":itemsrc_minordqty", _minOrderQty->toDouble()); itemSave.bindValue(":itemsrc_multordqty", _multOrderQty->toDouble()); itemSave.bindValue(":itemsrc_leadtime", _leadTime->text().toInt()); itemSave.bindValue(":itemsrc_ranking", _vendorRanking->value()); itemSave.bindValue(":itemsrc_comments", _notes->toPlainText().trimmed()); itemSave.bindValue(":itemsrc_manuf_name", _manufName->currentText()); itemSave.bindValue(":itemsrc_manuf_item_number", _manufItemNumber->text()); itemSave.bindValue(":itemsrc_manuf_item_descrip", _manufItemDescrip->toPlainText()); itemSave.exec(); if (itemSave.lastError().type() != QSqlError::NoError) { systemError(this, itemSave.lastError().databaseText(), __FILE__, __LINE__); return false; } if (_captive) { if (_mode != cCopy) { _vendor->setEnabled(FALSE); } _mode = cEdit; _item->setReadOnly(TRUE); _captive = false; } else done(_itemsrcid); return true; } void itemSource::sAdd() { if (_mode == cNew || _mode == cCopy) { if (!sSave()) return; } ParameterList params; params.append("mode", "new"); params.append("itemsrc_id", _itemsrcid); params.append("curr_id", _vendorCurrency->id()); itemSourcePrice newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillPriceList(); } void itemSource::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("itemsrcp_id", _itemsrcp->id()); itemSourcePrice newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillPriceList(); } void itemSource::sDelete() { XSqlQuery itemDelete; // Make sure the user is sure if ( QMessageBox::warning( this, tr("Delete Item Source Price"), tr("Are you sure you want to delete this Item Source price?"), tr("&Delete"), tr("&Cancel"), 0, 0, 1) == 0 ) { itemDelete.prepare( "DELETE FROM itemsrcp " "WHERE (itemsrcp_id=:itemsrcp_id);" ); itemDelete.bindValue(":itemsrcp_id", _itemsrcp->id()); itemDelete.exec(); if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, itemDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillPriceList(); } } void itemSource::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction("Edit Item Source Price...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuItem = pMenu->addAction("Delete Item Source Price...", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); } void itemSource::sFillPriceList() { XSqlQuery priceq; MetaSQLQuery mql = mqlLoad("itemSources", "prices"); ParameterList params; params.append("itemsrc_id", _itemsrcid); params.append("nominal",tr("Nominal")); params.append("discount",tr("Discount")); params.append("price", tr("Price")); params.append("fixed", tr("Fixed")); params.append("percent", tr("Percent")); params.append("mixed", tr("Mixed")); params.append("all", tr("All")); params.append("stock", tr("Into Stock")); params.append("dropship", tr("Drop Ship")); priceq = mql.toQuery(params); _itemsrcp->populate(priceq); } void itemSource::populate() { XSqlQuery itemsrcQ; itemsrcQ.prepare( "SELECT * " "FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); itemsrcQ.bindValue(":itemsrc_id", _itemsrcid); itemsrcQ.exec(); if (itemsrcQ.first()) { _item->setId(itemsrcQ.value("itemsrc_item_id").toInt()); _active->setChecked(itemsrcQ.value("itemsrc_active").toBool()); _default->setChecked(itemsrcQ.value("itemsrc_default").toBool()); _vendor->setId(itemsrcQ.value("itemsrc_vend_id").toInt()); _contract->setId(itemsrcQ.value("itemsrc_contrct_id").toInt()); _dates->setStartDate(itemsrcQ.value("itemsrc_effective").toDate()); _dates->setEndDate(itemsrcQ.value("itemsrc_expires").toDate()); _vendorItemNumber->setText(itemsrcQ.value("itemsrc_vend_item_number").toString()); _vendorItemDescrip->setText(itemsrcQ.value("itemsrc_vend_item_descrip").toString()); _vendorUOM->setCode(itemsrcQ.value("itemsrc_vend_uom").toString()); _invVendorUOMRatio->setDouble(itemsrcQ.value("itemsrc_invvendoruomratio").toDouble()); _upcCode->setText(itemsrcQ.value("itemsrc_upccode")); _minOrderQty->setDouble(itemsrcQ.value("itemsrc_minordqty").toDouble()); _multOrderQty->setDouble(itemsrcQ.value("itemsrc_multordqty").toDouble()); _vendorRanking->setValue(itemsrcQ.value("itemsrc_ranking").toInt()); _leadTime->setValue(itemsrcQ.value("itemsrc_leadtime").toInt()); _notes->setText(itemsrcQ.value("itemsrc_comments").toString()); _manufName->setCode(itemsrcQ.value("itemsrc_manuf_name").toString()); _manufItemNumber->setText(itemsrcQ.value("itemsrc_manuf_item_number").toString()); _manufItemDescrip->setText(itemsrcQ.value("itemsrc_manuf_item_descrip").toString()); sFillPriceList(); } else if (itemsrcQ.lastError().type() != QSqlError::NoError) { systemError(this, itemsrcQ.lastError().databaseText(), __FILE__, __LINE__); return; } } void itemSource::sRejected() { XSqlQuery itemRejected; if (_new) { itemRejected.prepare( "DELETE FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); itemRejected.bindValue(":itemsrc_id", _itemsrcid); itemRejected.exec(); if (itemRejected.lastError().type() != QSqlError::NoError) { systemError(this, itemRejected.lastError().databaseText(), __FILE__, __LINE__); return; } } } void itemSource::sVendorChanged( int pId ) { XSqlQuery vendorChanged; vendorChanged.prepare("SELECT vend_curr_id " "FROM vendinfo " "WHERE (vend_id = :vend_id)"); vendorChanged.bindValue(":vend_id", pId); vendorChanged.exec(); if (vendorChanged.first()) { _vendorCurrency->setId(vendorChanged.value("vend_curr_id").toInt()); } else if (vendorChanged.lastError().type() != QSqlError::NoError) { systemError(this, vendorChanged.lastError().databaseText(), __FILE__, __LINE__); return; } vendorChanged.prepare("SELECT contrct_id, contrct_number " "FROM contrct " "WHERE (contrct_vend_id = :vend_id)"); vendorChanged.bindValue(":vend_id", pId); vendorChanged.exec(); _contract->populate(vendorChanged); if (vendorChanged.lastError().type() != QSqlError::NoError) { systemError(this, vendorChanged.lastError().databaseText(), __FILE__, __LINE__); return; } } void itemSource::sContractChanged( int pId ) { XSqlQuery contractChanged; contractChanged.prepare("SELECT contrct_effective, contrct_expires " "FROM contrct " "WHERE (contrct_id = :contrct_id);"); contractChanged.bindValue(":contrct_id", pId); contractChanged.exec(); if (contractChanged.first()) { _dates->setStartDate(contractChanged.value("contrct_effective").toDate()); _dates->setEndDate(contractChanged.value("contrct_expires").toDate()); _dates->setEnabled(false); } else if (contractChanged.lastError().type() != QSqlError::NoError) { systemError(this, contractChanged.lastError().databaseText(), __FILE__, __LINE__); return; } else _dates->setEnabled(true); } qt-client-4.1.0/guiclient/itemSource.h000066400000000000000000000025601217451700100176700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSOURCE_H #define ITEMSOURCE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemSource.h" class itemSource : public XDialog, public Ui::itemSource { Q_OBJECT public: itemSource(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemSource(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool sSave(); virtual void sSaveClicked(); virtual void sAdd(); virtual void sEdit(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sFillPriceList(); virtual void populate(); virtual void sRejected(); virtual void sVendorChanged( int pId ); virtual void sContractChanged( int pId ); protected slots: virtual void languageChange(); private: int _mode; int _itemsrcid; bool _captive; bool _new; }; #endif // ITEMSOURCE_H qt-client-4.1.0/guiclient/itemSource.ui000066400000000000000000000621011217451700100200530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2011 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSource 0 0 1013 608 Item Source 7 Active true Default Qt::Vertical QSizePolicy::Expanding 10 0 0 Qt::Horizontal QSizePolicy::Expanding 0 20 0 5 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 Vendor Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Minimum Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true 0 0 Qt::AlignRight Qt::Horizontal 40 20 Vendor &UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _vendorUOM 5 true Qt::Horizontal QSizePolicy::Expanding 0 20 Order &Multiple: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _multOrderQty true 0 0 Qt::AlignRight Qt::Horizontal 40 20 Inventory/Vendor UOM Ratio: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 0 Qt::Horizontal QSizePolicy::Preferred 16 20 Vendor Ranking: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 9 Qt::Horizontal 40 20 Lead Time: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 999 Qt::Horizontal QSizePolicy::Expanding 16 20 Bar Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 1 1 &Notes 5 5 true &Prices 7 5 0 0 180 0 0 &Add false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Vendor &Description 5 5 true &Manufacturer Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true true 0 0 Qt::Horizontal QSizePolicy::Preferred 150 20 0 Description true Qt::StrongFocus Vendor #: 5 Vendor Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal QSizePolicy::Expanding 21 21 Qt::Vertical 20 0 Effectivity Contract #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 150 26 true Qt::StrongFocus qPixmapFromMimeSource DateCluster QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    VendorCluster QWidget
    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _item _active _default _vendor _vendorCurrency _contract _dates _vendorItemNumber _vendorUOM _invVendorUOMRatio _upcCode _minOrderQty _multOrderQty _vendorRanking _leadTime _add _edit _delete _tab _itemsrcp _notes _vendorItemDescrip _manufName _manufItemNumber _manufItemDescrip _close _save
    qt-client-4.1.0/guiclient/itemSourceList.cpp000066400000000000000000000053721217451700100210630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSourceList.h" #include #include #include "mqlutil.h" itemSourceList::itemSourceList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_itemsrc, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_itemsrc, SIGNAL(itemSelected(int)), _select, SLOT(animateClick())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); _itemsrc->addColumn(tr("Ranking"), _orderColumn, Qt::AlignRight, true, "itemsrc_ranking" ); _itemsrc->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name"); _itemsrc->addColumn(tr("Vend Item#"), _itemColumn, Qt::AlignRight, true, "itemsrc_vend_item_number" ); _itemsrc->addColumn(tr("Manufacturer"), _itemColumn, Qt::AlignLeft, true, "itemsrc_manuf_name"); _itemsrc->addColumn(tr("Manuf. Item#"), _itemColumn, Qt::AlignRight, true, "itemsrc_manuf_item_number" ); _itemsrc->addColumn(tr("Default"), _itemColumn, Qt::AlignLeft, true, "itemsrc_default" ); } itemSourceList::~itemSourceList() { // no need to delete child widgets, Qt does it all for us } void itemSourceList::languageChange() { retranslateUi(this); } enum SetResponse itemSourceList::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setEnabled(FALSE); } param = pParams.value("vend_id", &valid); if (valid) { _vendor->setId(param.toInt()); _vendor->setEnabled(FALSE); } param = pParams.value("qty", &valid); sFillList(); connect(_item, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_vendor, SIGNAL(newId(int)), this, SLOT(sFillList())); return NoError; } void itemSourceList::sSelect() { done(_itemsrc->id()); } void itemSourceList::sFillList() { XSqlQuery itemFillList; MetaSQLQuery mql = mqlLoad("itemSources", "detail"); ParameterList params; params.append("item_id", _item->id()); if (_vendor->isValid()) params.append("vend_id", _vendor->id()); params.append("onlyShowActive", true); itemFillList = mql.toQuery(params); _itemsrc->populate(itemFillList); } qt-client-4.1.0/guiclient/itemSourceList.h000066400000000000000000000020101217451700100205120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSOURCELIST_H #define ITEMSOURCELIST_H #include "xdialog.h" #include "guiclient.h" #include #include "ui_itemSourceList.h" class itemSourceList : public XDialog, public Ui::itemSourceList { Q_OBJECT public: itemSourceList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemSourceList(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sSelect(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // ITEMSOURCELIST_H qt-client-4.1.0/guiclient/itemSourceList.ui000066400000000000000000000177331217451700100207220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSourceList 0 0 697 400 Item Sources 12 12 7 0 Vendor: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel false &Select true Qt::Vertical QSizePolicy::Expanding 20 20 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 0 0 20 Item Sources: 0 100 ItemCluster QWidget
    itemcluster.h
    1
    VendorCluster QWidget
    vendorcluster.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _item _itemsrc _select _close parameter.h _itemsrc valid(bool) _select setEnabled(bool) 20 20 20 20 _itemsrc itemSelected(int) _select animateClick() 20 20 20 20 _close clicked() itemSourceList reject() 20 20 20 20
    qt-client-4.1.0/guiclient/itemSourcePrice.cpp000066400000000000000000000213301217451700100212020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSourcePrice.h" #include "xdoublevalidator.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include #include #include itemSourcePrice::itemSourcePrice(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_itemSelected, SIGNAL(toggled(bool)), this, SLOT(sTypeChanged(bool))); connect(_discountSelected, SIGNAL(toggled(bool)), this, SLOT(sTypeChanged(bool))); _qtyBreak->setValidator(omfgThis->qtyVal()); _discount->setValidator(new XDoubleValidator(-999, 999, decimalPlaces("percent"), this)); _fixedAmtDiscount->setValidator(omfgThis->negMoneyVal()); _site->setAll(); if (!_metrics->boolean("MultiWhs")) { _site->hide(); _dropship->hide(); } _discount->hide(); _fixedAmtDiscount->hide(); _listCost->hide(); _discountLit->hide(); _fixedAmtDiscountLit->hide(); _listCostLit->hide(); _itemsrcpid = -1; _itemsrcid = -1; } itemSourcePrice::~itemSourcePrice() { // no need to delete child widgets, Qt does it all for us } void itemSourcePrice::languageChange() { retranslateUi(this); } enum SetResponse itemSourcePrice::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsrc_id", &valid); if (valid) _itemsrcid = param.toInt(); param = pParams.value("curr_id", &valid); if (valid) _price->setId(param.toInt()); param = pParams.value("curr_effective", &valid); if (valid) _price->setEffective(param.toDate()); param = pParams.value("itemsrcp_id", &valid); if (valid) { _itemsrcpid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; itemet.exec("SELECT NEXTVAL('itemsrcp_itemsrcp_id_seq') AS _itemsrcp_id;"); if (itemet.first()) _itemsrcpid = itemet.value("_itemsrcp_id").toInt(); else if (itemet.lastError().type() != QSqlError::NoError) { systemError(this, itemet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _qtyBreak->setEnabled(FALSE); _price->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void itemSourcePrice::sSave() { QList errors; XSqlQuery itemSave; itemSave.prepare("SELECT itemsrcp_id" " FROM itemsrcp" " WHERE ((itemsrcp_id != :itemsrcp_id)" " AND (itemsrcp_itemsrc_id=:itemsrcp_itemsrc_id)" " AND (itemsrcp_warehous_id=:itemsrcp_warehous_id)" " AND (itemsrcp_dropship=:itemsrcp_dropship)" " AND (itemsrcp_qtybreak=:itemsrcp_qtybreak));"); itemSave.bindValue(":itemsrcp_id", _itemsrcpid); itemSave.bindValue(":itemsrcp_itemsrc_id", _itemsrcid); itemSave.bindValue(":itemsrcp_warehous_id", _site->id()); itemSave.bindValue(":itemsrcp_dropship", QVariant(_dropship->isChecked())); itemSave.bindValue(":itemsrcp_qtybreak", _qtyBreak->toDouble()); itemSave.exec(); if(itemSave.first()) { if (_metrics->boolean("MultiWhs")) errors << GuiErrorCheck(true, _qtyBreak, tr("A Qty. Break with the specified Site, Drop Ship and Qty. \n" "already exists for this Item Source.") ); else errors << GuiErrorCheck(true, _qtyBreak, tr("A Qty. Break with the specified Qty. already exists for this Item Source.") ); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Item Source Price"), errors)) return; if (_mode == cNew) { itemSave.prepare( "INSERT INTO itemsrcp " "(itemsrcp_id, itemsrcp_itemsrc_id, itemsrcp_type," " itemsrcp_warehous_id, itemsrcp_dropship," " itemsrcp_qtybreak, itemsrcp_price," " itemsrcp_discntprcnt, itemsrcp_fixedamtdiscount," " itemsrcp_updated, itemsrcp_curr_id) " "VALUES " "(:itemsrcp_id, :itemsrcp_itemsrc_id, :itemsrcp_type," " :itemsrcp_warehous_id, :itemsrcp_dropship," " :itemsrcp_qtybreak, :itemsrcp_price," " :itemsrcp_discntprcnt, :itemsrcp_fixedamtdiscount," " CURRENT_DATE, :itemsrcp_curr_id);" ); } else if (_mode == cEdit) itemSave.prepare( "UPDATE itemsrcp " "SET itemsrcp_type=:itemsrcp_type," " itemsrcp_warehous_id=:itemsrcp_warehous_id," " itemsrcp_dropship=:itemsrcp_dropship," " itemsrcp_qtybreak=:itemsrcp_qtybreak," " itemsrcp_price=:itemsrcp_price," " itemsrcp_discntprcnt=:itemsrcp_discntprcnt," " itemsrcp_fixedamtdiscount=:itemsrcp_fixedamtdiscount," " itemsrcp_updated=CURRENT_DATE," " itemsrcp_curr_id=:itemsrcp_curr_id " "WHERE (itemsrcp_id=:itemsrcp_id);" ); itemSave.bindValue(":itemsrcp_id", _itemsrcpid); itemSave.bindValue(":itemsrcp_itemsrc_id", _itemsrcid); itemSave.bindValue(":itemsrcp_warehous_id", _site->id()); itemSave.bindValue(":itemsrcp_dropship", QVariant(_dropship->isChecked())); itemSave.bindValue(":itemsrcp_qtybreak", _qtyBreak->toDouble()); if(_itemSelected->isChecked()) { itemSave.bindValue(":itemsrcp_type", "N"); itemSave.bindValue(":itemsrcp_price", _price->localValue()); itemSave.bindValue(":itemsrcp_curr_id", _price->id()); } else if(_discountSelected->isChecked()) { itemSave.bindValue(":itemsrcp_type", "D"); itemSave.bindValue(":itemsrcp_discntprcnt", (_discount->toDouble() / 100.0)); itemSave.bindValue(":itemsrcp_fixedamtdiscount", (_fixedAmtDiscount->toDouble())); } itemSave.exec(); done(_itemsrcpid); } void itemSourcePrice::populate() { XSqlQuery itempopulate; itempopulate.prepare( "SELECT itemsrcp.*, item_listcost " "FROM itemsrcp JOIN itemsrc ON (itemsrc_id=itemsrcp_itemsrc_id) " " JOIN item ON (item_id=itemsrc_item_id) " "WHERE (itemsrcp_id=:itemsrcp_id);" ); itempopulate.bindValue(":itemsrcp_id", _itemsrcpid); itempopulate.exec(); if (itempopulate.first()) { _itemsrcid = itempopulate.value("itemsrcp_itemsrc_id").toInt(); if(itempopulate.value("itemsrcp_type").toString() == "D") _discountSelected->setChecked(true); else _itemSelected->setChecked(true); if (itempopulate.value("itemsrcp_warehous_id").toInt() > 0) _site->setId(itempopulate.value("itemsrcp_warehous_id").toInt()); else _site->setAll(); _dropship->setChecked(itempopulate.value("itemsrcp_dropship").toBool()); _qtyBreak->setDouble(itempopulate.value("itemsrcp_qtybreak").toDouble()); _price->setLocalValue(itempopulate.value("itemsrcp_price").toDouble()); _price->setEffective(itempopulate.value("itemsrcp_updated").toDate()); _price->setId(itempopulate.value("itemsrcp_curr_id").toInt()); _discount->setDouble(itempopulate.value("itemsrcp_discntprcnt").toDouble() * 100.0); _fixedAmtDiscount->setDouble(itempopulate.value("itemsrcp_fixedamtdiscount").toDouble()); _listCost->setBaseValue(itempopulate.value("item_listcost").toDouble()); } } void itemSourcePrice::sTypeChanged(bool pChecked) { if(!pChecked) return; if(_itemSelected->isChecked()) { _price->show(); _priceLit->show(); _discount->hide(); _fixedAmtDiscount->hide(); _listCost->hide(); _discountLit->hide(); _fixedAmtDiscountLit->hide(); _listCostLit->hide(); } else if(_discountSelected->isChecked()) { _price->hide(); _priceLit->hide(); _discount->show(); _fixedAmtDiscount->show(); _listCost->show(); _discountLit->show(); _fixedAmtDiscountLit->show(); _listCostLit->show(); } } qt-client-4.1.0/guiclient/itemSourcePrice.h000066400000000000000000000021611217451700100206500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSOURCEPRICE_H #define ITEMSOURCEPRICE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemSourcePrice.h" class itemSourcePrice : public XDialog, public Ui::itemSourcePrice { Q_OBJECT public: itemSourcePrice(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemSourcePrice(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); virtual void sTypeChanged(bool); protected slots: virtual void languageChange(); private: int _mode; int _itemsrcpid; int _itemsrcid; }; #endif // ITEMSOURCEPRICE_H qt-client-4.1.0/guiclient/itemSourcePrice.ui000066400000000000000000000350531217451700100210440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSourcePrice 0 0 675 394 Item Source Price Pricing Type 12 Nominal true Discount Qt::Horizontal 0 20 Site Restriction Drop Ship true Qt::Vertical 20 40 Qt::Vertical 20 40 0 Qt::Vertical QSizePolicy::Expanding 20 16 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 &Cancel &Save true 0 0 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 0 0 Discount Percent (Wholesale Price): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _price true 0 0 Qt::AlignRight Qt::Horizontal 0 20 Discount By Fixed Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true 0 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 CurrDisplay::Cost Qt::Horizontal 40 20 Price per Unit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Break (Inventory UOM): Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 130 32767 CurrDisplay::SalesPrice Qt::Horizontal 0 20 Wholesale Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _itemSelected _discountSelected _dropship _qtyBreak _price _discount _fixedAmtDiscount _close _save _close clicked() itemSourcePrice reject() 20 20 20 20
    qt-client-4.1.0/guiclient/itemSourceSearch.cpp000066400000000000000000000120651217451700100213520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSourceSearch.h" #include #include #include #include #include #include "mqlutil.h" /* * Constructs a itemSourceSearch as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ itemSourceSearch::itemSourceSearch(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _vendid = -1; _itemid = -1; // signals and slots connections connect(_searchNumber, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchDescrip1, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchDescrip2, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchVendNumber, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchVendDescrip, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_search, SIGNAL(textChanged(QString)), this, SLOT(sFillList())); _itemsrc->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _itemsrc->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); _itemsrc->addColumn(tr("Vendor"), _itemColumn, Qt::AlignLeft, true, "vend_name" ); _itemsrc->addColumn(tr("Vendor Item"), _itemColumn, Qt::AlignLeft, true, "itemsrc_vend_item_number" ); _itemsrc->addColumn(tr("Vendor Descrip"), _itemColumn, Qt::AlignLeft, true, "itemsrc_vend_item_descrip" ); _itemsrc->addColumn(tr("Manufacturer"), _itemColumn, Qt::AlignLeft, true, "itemsrc_manuf_name" ); _itemsrc->addColumn(tr("Manuf. Item#"), _itemColumn, Qt::AlignLeft, true, "itemsrc_manuf_item_number" ); _itemsrc->addColumn(tr("Manuf. Descrip."), _itemColumn, Qt::AlignLeft, false, "itemsrc_manuf_item_descrip" ); } /* * Destroys the object and frees any allocated resources */ itemSourceSearch::~itemSourceSearch() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void itemSourceSearch::languageChange() { retranslateUi(this); } enum SetResponse itemSourceSearch::set(const ParameterList & pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("vend_id", &valid); if(valid) _vendid = param.toInt(); param = pParams.value("search", &valid); if(valid) _search->setText(param.toString()); sFillList(); return NoError; } void itemSourceSearch::sFillList() { XSqlQuery itemFillList; _itemsrc->clear(); MetaSQLQuery mql = mqlLoad("itemSources", "search"); ParameterList params; params.append("vend_id", _vendid); params.append("item_id", _itemid); params.append("non", tr("Non-Inventory")); if(_searchNumber->isChecked()) params.append("searchNumber", _search->text()); if(_searchVendNumber->isChecked()) params.append("searchVendNumber", _search->text()); if(_searchDescrip1->isChecked()) params.append("searchDescrip1", _search->text()); if(_searchDescrip2->isChecked()) params.append("searchDescrip2", _search->text()); if(_searchVendDescrip->isChecked()) params.append("searchVendDescrip", _search->text()); if(_searchManufName->isChecked()) params.append("searchManufName", _search->text()); if(_searchManufNumber->isChecked()) params.append("searchManufNumber", _search->text()); itemFillList = mql.toQuery(params); _itemsrc->populate(itemFillList, TRUE); } int itemSourceSearch::itemsrcId() { XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem(); if(item) { if(item->altId() == 1) return item->id(); } return -1; } int itemSourceSearch::expcatId() { XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem(); if(item) { if(item->altId() == 2) return item->id(); } return -1; } QString itemSourceSearch::vendItemNumber() { XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem(); if(item) return item->text(3); return QString(); } QString itemSourceSearch::vendItemDescrip() { XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem(); if(item) return item->text(4); return QString(); } QString itemSourceSearch::manufName() { XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem(); if(item) return item->text(5); return QString(); } QString itemSourceSearch::manufItemNumber() { XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem(); if(item) return item->text(6); return QString(); } QString itemSourceSearch::manufItemDescrip() { XTreeWidgetItem * item = (XTreeWidgetItem*)_itemsrc->currentItem(); if(item) return item->text(7); return QString(); } qt-client-4.1.0/guiclient/itemSourceSearch.h000066400000000000000000000023361217451700100210170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSOURCESEARCH_H #define ITEMSOURCESEARCH_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemSourceSearch.h" class itemSourceSearch : public XDialog, public Ui::itemSourceSearch { Q_OBJECT public: itemSourceSearch(QWidget* parent = 0, const char* name = 0, bool model = false, Qt::WFlags fl = 0); ~itemSourceSearch(); int itemsrcId(); int expcatId(); QString vendItemNumber(); QString vendItemDescrip(); QString manufName(); QString manufItemNumber(); QString manufItemDescrip(); public slots: virtual enum SetResponse set(const ParameterList &); protected slots: virtual void languageChange(); virtual void sFillList(); private: int _itemid; int _vendid; }; #endif // ITEMSOURCESEARCH_H qt-client-4.1.0/guiclient/itemSourceSearch.ui000066400000000000000000000234171217451700100212100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSourceSearch 0 0 800 600 Item Source Search 12 12 12 12 12 12 5 S&earch for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _search 0 &Cancel false &Select Qt::Vertical QSizePolicy::Expanding 20 20 Search through Item Numbers true Vendor Item Numbers true Description 1 true Vendor Description true Description 2 true Manufacturer Names true Manufacturer Item Numbers true Qt::Horizontal QSizePolicy::Expanding 20 10 0 1 QFrame::NoFrame QFrame::Plain 0 0 0 0 0 Item Sources: 0 0 XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _search _searchNumber _searchDescrip1 _searchDescrip2 _searchVendNumber _searchVendDescrip _itemsrc _select _close _close clicked() itemSourceSearch reject() 461 31 20 20 _itemsrc valid(bool) _select setEnabled(bool) 29 162 461 64 _itemsrc itemSelected(int) _select animateClick() 465 158 465 50 _select clicked() itemSourceSearch accept() 498 51 451 101
    qt-client-4.1.0/guiclient/itemSources.cpp000066400000000000000000000172231217451700100204100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSources.h" #include #include #include #include #include #include "itemSource.h" #include "buyCard.h" #include "dspPoItemsByVendor.h" #include "guiclient.h" #include "parameterwidget.h" itemSources::itemSources(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "itemSources", fl) { setWindowTitle(tr("Item Sources")); setReportName("ItemSources"); setMetaSQLOptions("itemSources", "detail"); setUseAltId(true); setParameterWidgetVisible(true); setNewVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Item"), "item_id", ParameterWidget::Item); parameterWidget()->append(tr("Vendor"), "vend_id", ParameterWidget::Vendor); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); parameterWidget()->appendComboBox(tr("Contract"), "contrct_id", XComboBox::Contracts); parameterWidget()->append(tr("Contract Number Pattern"), "contract_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Show Expired"), "showExpired", ParameterWidget::Exists); parameterWidget()->append(tr("Show Future"), "showFuture", ParameterWidget::Exists); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Contract #"), _itemColumn, Qt::AlignLeft, true, "contrct_number" ); list()->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter, true, "itemsrc_effective" ); list()->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter, true, "itemsrc_expires" ); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name" ); list()->addColumn(tr("Vendor Item Number"), _itemColumn, Qt::AlignLeft, true, "itemsrc_vend_item_number" ); list()->addColumn(tr("Vendor UOM"), _uomColumn, Qt::AlignLeft, true, "itemsrc_vend_uom" ); list()->addColumn(tr("UOM Ratio"), _qtyColumn, Qt::AlignRight, true, "itemsrc_invvendoruomratio" ); list()->addColumn(tr("Manufacturer"), _itemColumn, Qt::AlignLeft, false, "itemsrc_manuf_name" ); list()->addColumn(tr("Manuf. Item#"), _itemColumn, Qt::AlignLeft, false, "itemsrc_manuf_item_number" ); if (_privileges->check("MaintainItemSources")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } } bool itemSources::setParams(ParameterList & params) { if (!display::setParams(params)) return false; params.append("always", tr("Always")); params.append("never", tr("Never")); return true; } void itemSources::sPopulateMenu(QMenu *menuThis, QTreeWidgetItem*, int) { QAction *menuItem; menuItem = menuThis->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuItem = menuThis->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainItemSources") || _privileges->check("ViewItemSource")); menuItem = menuThis->addAction(tr("Copy..."), this, SLOT(sCopy())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuItem = menuThis->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainItemSources")); menuThis->addSeparator(); menuThis->addAction("View Buy Card...", this, SLOT(sBuyCard())); } void itemSources::sNew() { ParameterList params; params.append("mode", "new"); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void itemSources::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("itemsrc_id", list()->id()); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void itemSources::sView() { ParameterList params; params.append("mode", "view"); params.append("itemsrc_id", list()->id()); itemSource newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void itemSources::sCopy() { ParameterList params; params.append("mode", "copy"); params.append("itemsrc_id", list()->id()); itemSource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void itemSources::sDelete() { XSqlQuery itemDelete; itemDelete.prepare("SELECT poitem_id, itemsrc_active " "FROM poitem, itemsrc " "WHERE ((poitem_itemsrc_id=:itemsrc_id) " "AND (itemsrc_id=:itemsrc_id)); "); itemDelete.bindValue(":itemsrc_id", list()->id()); itemDelete.exec(); if (itemDelete.first()) { if (itemDelete.value("itemsrc_active").toBool()) { if (QMessageBox::question(this, tr("Delete Item Source"), tr("

    This item source is used by existing " "purchase order records and may not be " "deleted. Would you like to deactivate it " "instead?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { itemDelete.prepare( "UPDATE itemsrc SET " " itemsrc_active=false " "WHERE (itemsrc_id=:itemsrc_id);" ); itemDelete.bindValue(":itemsrc_id", list()->id()); itemDelete.exec(); sFillList(); } } else QMessageBox::critical(this, tr("Delete Item Source"), tr("

    This item source is used by existing " "purchase order records and may not be deleted.")); return; } itemDelete.prepare( "SELECT item_number " "FROM itemsrc, item " "WHERE ( (itemsrc_item_id=item_id)" " AND (itemsrc_id=:itemsrc_id) );" ); itemDelete.bindValue(":itemsrc_id", list()->id()); itemDelete.exec(); if (itemDelete.first()) { if (QMessageBox::question(this, tr("Delete Item Source"), tr( "Are you sure that you want to delete the " "Item Source for %1?") .arg(itemDelete.value("item_number").toString()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { // itemsrcp deleted on cascade itemDelete.prepare( "DELETE FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); itemDelete.bindValue(":itemsrc_id", list()->id()); itemDelete.exec(); if (itemDelete.lastError().type() != QSqlError::NoError) { systemError(this, itemDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } } void itemSources::sBuyCard() { ParameterList params; params.append("itemsrc_id", list()->id()); buyCard *newdlg = new buyCard(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/itemSources.h000066400000000000000000000017401217451700100200520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSOURCES_H #define ITEMSOURCES_H #include "display.h" class itemSources : public display { Q_OBJECT Q_INVOKABLE virtual bool setParams(ParameterList &); public: itemSources(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sPopulateMenu(QMenu * menuThis, QTreeWidgetItem*, int); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sCopy(); virtual void sDelete(); virtual void sBuyCard(); }; #endif // ITEMSOURCES_H qt-client-4.1.0/guiclient/itemSources.ui000066400000000000000000000214251217451700100202420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSources 0 0 800 600 List Item Sources 12 12 12 12 S&earch for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _searchFor Qt::Horizontal 40 20 5 &Close &Print Show &Inactive Item Sources Qt::Horizontal 40 20 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 0 0 Item Sources: 0 0 0 &New false &Edit false &View false &Copy false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XCheckBox QCheckBox

    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _searchFor _showInactive _new _edit _view _delete _close _print _itemsrc _close clicked() itemSources close() 719 45 20 20 _itemsrc valid(bool) _view setEnabled(bool) 46 135 712 183 qt-client-4.1.0/guiclient/itemSubstitute.cpp000066400000000000000000000211521217451700100211340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemSubstitute.h" #include #include #define cItemSub 0x01 #define cBOMItemSub 0x02 itemSubstitute::itemSubstitute(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_substitute, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _uomRatio->setValidator(omfgThis->ratioVal()); _uomRatio->setText("1.0"); } itemSubstitute::~itemSubstitute() { // no need to delete child widgets, Qt does it all for us } void itemSubstitute::languageChange() { retranslateUi(this); } enum SetResponse itemSubstitute::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("bomitem_id", &valid); if (valid) { _type = cBOMItemSub; _bomitemid = param.toInt(); itemet.prepare( "SELECT bomitem_item_id " "FROM bomitem " "WHERE (bomitem_id=:bomitem_id);" ); itemet.bindValue(":bomitem_id", _bomitemid); itemet.exec(); if (itemet.first()) { _item->setId(itemet.value("bomitem_item_id").toInt()); _item->setReadOnly(TRUE); } } param = pParams.value("bomitem_item_id", &valid); if (valid) { _type = cBOMItemSub; _item->setId(param.toInt()); _item->setReadOnly(TRUE); } param = pParams.value("item_id", &valid); if (valid) { _type = cItemSub; _item->setId(param.toInt()); _item->setReadOnly(TRUE); } param = pParams.value("itemsub_id", &valid); if (valid) { _type = cItemSub; _itemsubid = param.toInt(); populate(); } param = pParams.value("bomitemsub_id", &valid); if (valid) { _type = cBOMItemSub; _itemsubid = param.toInt(); _item->setEnabled(FALSE); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _substitute->setReadOnly(TRUE); _uomRatio->setEnabled(FALSE); _ranking->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void itemSubstitute::sSave() { XSqlQuery itemSave; if (_type == cItemSub) { if (_item->id() == _substitute->id()) { QMessageBox::critical( this, tr("Cannot Create Substitute"), tr("You cannot define an Item to be a substitute for itself.") ); _substitute->setFocus(); return; } itemSave.prepare( "SELECT itemsub_id " " FROM itemsub " " WHERE((itemsub_parent_item_id=:parentItem_id)" " AND (itemsub_sub_item_id=:item_id)" " AND (itemsub_id != :itemsub_id) );" ); itemSave.bindValue(":parentItem_id", _item->id()); itemSave.bindValue(":item_id", _substitute->id()); itemSave.bindValue(":itemsub_id", _itemsubid); itemSave.exec(); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Duplicate Substitute"), tr( "This substitution has already been defined for the selected Item.\n" "You may edit the existing Substitution but you may not create a duplicate." ) ); _substitute->setFocus(); return; } if (_mode == cNew) { itemSave.exec("SELECT NEXTVAL('itemsub_itemsub_id_seq') AS _itemsub_id"); if (itemSave.first()) _itemsubid = itemSave.value("_itemsub_id").toInt(); // ToDo itemSave.prepare( "INSERT INTO itemsub " "( itemsub_id, itemsub_parent_item_id, itemsub_sub_item_id," " itemsub_uomratio, itemsub_rank ) " "VALUES " "( :itemsub_id, :itemsub_parent_item_id, :itemsub_sub_item_id," " :itemsub_uomratio, :itemsub_rank );" ); } else if (_mode == cEdit) itemSave.prepare( "UPDATE itemsub " " SET itemsub_uomratio=:itemsub_uomratio," " itemsub_rank=:itemsub_rank," " itemsub_sub_item_id=:itemsub_sub_item_id" " WHERE(itemsub_id=:itemsub_id);" ); itemSave.bindValue(":itemsub_id", _itemsubid); itemSave.bindValue(":itemsub_parent_item_id", _item->id()); itemSave.bindValue(":itemsub_sub_item_id", _substitute->id()); itemSave.bindValue(":itemsub_uomratio", _uomRatio->toDouble()); itemSave.bindValue(":itemsub_rank", _ranking->value()); itemSave.exec(); } else if (_type == cBOMItemSub) { if (_mode == cNew) { itemSave.prepare( "SELECT bomitemsub_id " "FROM bomitemsub " "WHERE ( (bomitemsub_bomitem_id=:bomitem_id)" " AND (bomitemsub_item_id=:item_id) );" ); itemSave.bindValue(":bomitem_id", _bomitemid); itemSave.bindValue(":item_id", _substitute->id()); itemSave.exec(); if (itemSave.first()) { QMessageBox::critical( this, tr("Cannot Create Duplicate Substitute"), tr( "This substitution has already been defined for the selected BOM Item.\n" "You may edit the existing Substitution but you may not create a duplicate." ) ); _substitute->setFocus(); return; } } if (_mode == cNew) { itemSave.exec("SELECT NEXTVAL('bomitemsub_bomitemsub_id_seq') AS bomitemsub_id"); if (itemSave.first()) _itemsubid = itemSave.value("bomitemsub_id").toInt(); // ToDo itemSave.prepare( "INSERT INTO bomitemsub " "( bomitemsub_id, bomitemsub_bomitem_id, bomitemsub_item_id," " bomitemsub_uomratio, bomitemsub_rank ) " "VALUES " "( :bomitemsub_id, :bomitemsub_bomitem_id, :bomitemsub_item_id," " :bomitemsub_uomratio, :bomitemsub_rank );" ); } else if (_mode == cEdit) itemSave.prepare( "UPDATE bomitemsub " "SET bomitemsub_uomratio=:bomitemsub_uomratio, bomitemsub_rank=:bomitemsub_rank " "WHERE (bomitemsub_id=:bomitemsub_id);" ); itemSave.bindValue(":bomitemsub_id", _itemsubid); itemSave.bindValue(":bomitemsub_bomitem_id", _bomitemid); itemSave.bindValue(":bomitemsub_item_id", _substitute->id()); itemSave.bindValue(":bomitemsub_uomratio", _uomRatio->toDouble()); itemSave.bindValue(":bomitemsub_rank", _ranking->value()); itemSave.exec(); } done(_itemsubid); } void itemSubstitute::populate() { XSqlQuery itempopulate; if (_type == cItemSub) { itempopulate.prepare( "SELECT itemsub_parent_item_id, itemsub_sub_item_id," " itemsub_uomratio, itemsub_rank " "FROM itemsub " "WHERE (itemsub_id=:itemsub_id);" ); itempopulate.bindValue(":itemsub_id", _itemsubid); itempopulate.exec(); if (itempopulate.first()) { _item->setId(itempopulate.value("itemsub_parent_item_id").toInt()); _substitute->setId(itempopulate.value("itemsub_sub_item_id").toInt()); _ranking->setValue(itempopulate.value("itemsub_rank").toInt()); _uomRatio->setDouble(itempopulate.value("itemsub_uomratio").toDouble()); } } else if (_type == cBOMItemSub) { itempopulate.prepare( "SELECT bomitemsub_bomitem_id, item_id, bomitemsub_item_id," " bomitemsub_uomratio, bomitemsub_rank " "FROM bomitemsub, bomitem, item " "WHERE ( (bomitemsub_bomitem_id=bomitem_id)" " AND (bomitem_item_id=item_id)" " AND (bomitemsub_id=:bomitemsub_id) );" ); itempopulate.bindValue(":bomitemsub_id", _itemsubid); itempopulate.exec(); if (itempopulate.first()) { _item->setId(itempopulate.value("item_id").toInt()); _substitute->setId(itempopulate.value("bomitemsub_item_id").toInt()); _ranking->setValue(itempopulate.value("bomitemsub_rank").toInt()); _uomRatio->setDouble(itempopulate.value("bomitemsub_uomratio").toDouble()); } } } qt-client-4.1.0/guiclient/itemSubstitute.h000066400000000000000000000021271217451700100206020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMSUBSTITUTE_H #define ITEMSUBSTITUTE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemSubstitute.h" class itemSubstitute : public XDialog, public Ui::itemSubstitute { Q_OBJECT public: itemSubstitute(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemSubstitute(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _type; int _itemsubid; int _bomitemid; }; #endif // ITEMSUBSTITUTE_H qt-client-4.1.0/guiclient/itemSubstitute.ui000066400000000000000000000316051217451700100207730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemSubstitute 0 0 432 260 Item Substitution 5 0 0 7 0 5 0 0 Root Item: 0 0 Substitution: 0 5 0 0 Subsitute/Parent UOM Ratio: Qt::AlignVCenter|Qt::AlignRight Ranking: Qt::AlignVCenter|Qt::AlignRight 0 0 0 0 5 0 0 0 80 32767 20 20 Expanding Horizontal 0 0 99 1 20 20 Expanding Horizontal 0 0 20 20 Expanding Horizontal 0 0 0 5 &Close false &Save true 20 20 Expanding Vertical 20 20 Expanding Vertical _item _substitute _uomRatio _ranking _save _close parameter.h _substitute valid(bool) _save setEnabled(bool) _close clicked() itemSubstitute reject() qt-client-4.1.0/guiclient/itemUOM.cpp000066400000000000000000000273561217451700100174350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemUOM.h" #include #include #include #include #include "storedProcErrorLookup.h" itemUOM::itemUOM(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _itemid = _itemuomconvid = -1; _uomidFrom = -1; _ignoreSignals = false; connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_uomFrom, SIGNAL(currentIndexChanged(int)), this, SLOT(sCheck())); connect(_uomTo, SIGNAL(currentIndexChanged(int)), this, SLOT(sCheck())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove())); _fromValue->setValidator(omfgThis->ratioVal()); _toValue->setValidator(omfgThis->ratioVal()); _fromValue->setDouble(1); _toValue->setDouble(1); _uomFrom->setType(XComboBox::UOMs); _uomTo->setType(XComboBox::UOMs); } itemUOM::~itemUOM() { // no need to delete child widgets, Qt does it all for us } void itemUOM::languageChange() { retranslateUi(this); } enum SetResponse itemUOM::set(const ParameterList &pParams) { XSqlQuery itemet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _itemid = param.toInt(); itemet.prepare("SELECT item_inv_uom_id" " FROM item" " WHERE(item_id=:item_id);"); itemet.bindValue(":item_id", _itemid); itemet.exec(); if(itemet.first()) { _uomidFrom = itemet.value("item_inv_uom_id").toInt(); _ignoreSignals = true; _uomFrom->setId(_uomidFrom); _uomTo->setId(_uomidFrom); _ignoreSignals = false; } } param = pParams.value("inventoryUOM", &valid); if (valid) { _uomidFrom = param.toInt(); _ignoreSignals = true; _uomFrom->setId(_uomidFrom); _uomTo->setId(_uomidFrom); _ignoreSignals = false; } param = pParams.value("itemuomconv_id", &valid); if (valid) { _itemuomconvid = param.toInt(); _ignoreSignals = true; populate(); _ignoreSignals = false; } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; _uomTo->setEnabled(false); _uomFrom->setEnabled(false); } else if (param.toString() == "view") { _mode = cView; _toValue->setEnabled(false); _fromValue->setEnabled(false); _uomTo->setEnabled(false); _uomFrom->setEnabled(false); _add->setEnabled(false); _remove->setEnabled(false); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void itemUOM::sSave() { XSqlQuery itemSave; if(_fromValue->toDouble() <= 0.0) { QMessageBox::warning(this, tr("Invalid Ratio"), tr("

    You must specify a ratio value greater than 0.")); _fromValue->setFocus(); return; } if(_toValue->toDouble() <= 0.0) { QMessageBox::warning(this, tr("Invalid Ratio"), tr("

    You must specify a ratio value greater than 0.")); _toValue->setFocus(); return; } if(_selected->count() == 0) { QMessageBox::warning(this, tr("No Types Selected"), tr("

    You must select at least one UOM Type for this conversion.")); return; } itemSave.prepare("UPDATE itemuomconv" " SET itemuomconv_to_value=:tovalue," " itemuomconv_from_value=:fromvalue," " itemuomconv_fractional=:fractional " " WHERE(itemuomconv_id=:itemuomconv_id);"); itemSave.bindValue(":itemuomconv_id", _itemuomconvid); itemSave.bindValue(":tovalue", _toValue->toDouble()); itemSave.bindValue(":fromvalue", _fromValue->toDouble()); itemSave.bindValue(":fractional", QVariant(_fractional->isChecked())); if(itemSave.exec()) accept(); } void itemUOM::populate() { XSqlQuery itempopulate; itempopulate.prepare("SELECT itemuomconv_item_id, item_inv_uom_id," " itemuomconv_from_uom_id, itemuomconv_to_uom_id," " itemuomconv_from_value, itemuomconv_to_value, itemuomconv_fractional," " (uomconv_id IS NOT NULL) AS global" " FROM itemuomconv" " JOIN item ON (itemuomconv_item_id=item_id)" " LEFT OUTER JOIN uomconv" " ON ((uomconv_from_uom_id=itemuomconv_from_uom_id AND uomconv_to_uom_id=itemuomconv_to_uom_id)" " OR (uomconv_to_uom_id=itemuomconv_from_uom_id AND uomconv_from_uom_id=itemuomconv_to_uom_id))" " WHERE((itemuomconv_id=:itemuomconv_id));"); itempopulate.bindValue(":itemuomconv_id", _itemuomconvid); itempopulate.exec(); if(itempopulate.first()) { _itemid = itempopulate.value("itemuomconv_item_id").toInt(); _uomidFrom = itempopulate.value("item_inv_uom_id").toInt(); _uomFrom->setId(itempopulate.value("itemuomconv_from_uom_id").toInt()); _uomTo->setId(itempopulate.value("itemuomconv_to_uom_id").toInt()); _fromValue->setDouble(itempopulate.value("itemuomconv_from_value").toDouble()); _toValue->setDouble(itempopulate.value("itemuomconv_to_value").toDouble()); _fractional->setChecked(itempopulate.value("itemuomconv_fractional").toBool()); _toValue->setEnabled(!itempopulate.value("global").toBool()); _fromValue->setEnabled(!itempopulate.value("global").toBool()); sFillList(); } } void itemUOM::sFillList() { XSqlQuery itemFillList; _available->clear(); _selected->clear(); itemFillList.prepare("SELECT uomtype_id, uomtype_name," " uomtype_descrip, (itemuom_id IS NOT NULL) AS selected" " FROM uomtype" " LEFT OUTER JOIN itemuom ON ((itemuom_uomtype_id=uomtype_id)" " AND (itemuom_itemuomconv_id=:itemuomconv_id))" " WHERE (uomtype_id NOT IN" " (SELECT uomtype_id" " FROM itemuomconv" " JOIN itemuom ON (itemuom_itemuomconv_id=itemuomconv_id)" " JOIN uomtype ON (itemuom_uomtype_id=uomtype_id)" " WHERE((itemuomconv_item_id=:item_id)" " AND (itemuomconv_id != :itemuomconv_id)" " AND (uomtype_multiple=false))))" " ORDER BY uomtype_name;"); itemFillList.bindValue(":item_id", _itemid); itemFillList.bindValue(":itemuomconv_id", _itemuomconvid); itemFillList.exec(); while(itemFillList.next()) { QListWidgetItem *item = new QListWidgetItem(itemFillList.value("uomtype_name").toString()); item->setToolTip(itemFillList.value("uomtype_descrip").toString()); item->setData(Qt::UserRole, itemFillList.value("uomtype_id").toInt()); if(itemFillList.value("selected").toBool()) _selected->addItem(item); else _available->addItem(item); } _add->setEnabled(true); _remove->setEnabled(true); } void itemUOM::sAdd() { XSqlQuery itemAdd; QList items = _available->selectedItems(); QListWidgetItem * item; for(int i = 0; i < items.size(); i++) { item = items.at(i); itemAdd.prepare("INSERT INTO itemuom" " (itemuom_itemuomconv_id, itemuom_uomtype_id) " "VALUES(:itemuomconv_id, :uomtype_id);"); itemAdd.bindValue(":itemuomconv_id", _itemuomconvid); itemAdd.bindValue(":uomtype_id", item->data(Qt::UserRole)); itemAdd.exec(); } sFillList(); } void itemUOM::sRemove() { XSqlQuery itemRemove; QList items = _selected->selectedItems(); QListWidgetItem * item; for(int i = 0; i < items.size(); i++) { item = items.at(i); itemRemove.prepare("SELECT deleteItemuom(itemuom_id) AS result" " FROM itemuom" " WHERE((itemuom_itemuomconv_id=:itemuomconv_id)" " AND (itemuom_uomtype_id=:uomtype_id));"); itemRemove.bindValue(":itemuomconv_id", _itemuomconvid); itemRemove.bindValue(":uomtype_id", item->data(Qt::UserRole)); itemRemove.exec(); // TODO: add in some addtional error checking } sFillList(); } void itemUOM::sCheck() { XSqlQuery itemCheck; if(cNew != _mode || _ignoreSignals) return; if (!(_uomFrom->isValid() && _uomTo->isValid())) return; if (_uomFrom->id() == _uomTo->id()) return; _ignoreSignals = true; _uomFrom->setEnabled(false); _uomTo->setEnabled(false); itemCheck.prepare("SELECT itemuomconv_id" " FROM itemuomconv" " WHERE((itemuomconv_item_id=:item_id)" " AND (((itemuomconv_from_uom_id=:from_uom_id) AND (itemuomconv_to_uom_id=:to_uom_id))" " OR ((itemuomconv_from_uom_id=:to_uom_id) AND (itemuomconv_to_uom_id=:from_uom_id))));"); itemCheck.bindValue(":item_id", _itemid); itemCheck.bindValue(":from_uom_id", _uomFrom->id()); itemCheck.bindValue(":to_uom_id", _uomTo->id()); itemCheck.exec(); if(itemCheck.first()) { _itemuomconvid = itemCheck.value("itemuomconv_id").toInt(); _mode = cEdit; populate(); _ignoreSignals = false; return; } itemCheck.prepare("SELECT uomconv_from_uom_id, uomconv_from_value," " uomconv_to_uom_id, uomconv_to_value," " uomconv_fractional" " FROM uomconv" " WHERE(((uomconv_from_uom_id=:from_uom_id) AND (uomconv_to_uom_id=:to_uom_id))" " OR ((uomconv_from_uom_id=:to_uom_id) AND (uomconv_to_uom_id=:from_uom_id)));"); itemCheck.bindValue(":from_uom_id", _uomFrom->id()); itemCheck.bindValue(":to_uom_id", _uomTo->id()); itemCheck.exec(); if(itemCheck.first()) { _uomFrom->setId(itemCheck.value("uomconv_from_uom_id").toInt()); _uomTo->setId(itemCheck.value("uomconv_to_uom_id").toInt()); _fromValue->setDouble(itemCheck.value("uomconv_from_value").toDouble()); _toValue->setDouble(itemCheck.value("uomconv_to_value").toDouble()); _fractional->setChecked(itemCheck.value("uomconv_fractional").toBool()); _fromValue->setEnabled(false); _toValue->setEnabled(false); } else { _fromValue->setEnabled(true); _toValue->setEnabled(true); } itemCheck.exec("SELECT nextval('itemuomconv_itemuomconv_id_seq') AS result;"); itemCheck.first(); _itemuomconvid = itemCheck.value("result").toInt(); itemCheck.prepare("INSERT INTO itemuomconv" " (itemuomconv_id, itemuomconv_item_id, itemuomconv_from_uom_id, itemuomconv_to_uom_id," " itemuomconv_from_value, itemuomconv_to_value, itemuomconv_fractional) " "VALUES(:id, :item_id, :from_uom_id, :to_uom_id, :fromvalue, :tovalue, :fractional);"); itemCheck.bindValue(":id", _itemuomconvid); itemCheck.bindValue(":item_id", _itemid); itemCheck.bindValue(":from_uom_id", _uomFrom->id()); itemCheck.bindValue(":to_uom_id", _uomTo->id()); itemCheck.bindValue(":fromvalue", _fromValue->toDouble()); itemCheck.bindValue(":tovalue", _toValue->toDouble()); itemCheck.bindValue(":fractional", QVariant(_fractional->isChecked())); itemCheck.exec(); sFillList(); _ignoreSignals = false; } void itemUOM::reject() { XSqlQuery itemreject; if(cNew == _mode) { itemreject.prepare("DELETE FROM itemuom WHERE itemuom_itemuomconv_id=:itemuomconv_id;" "DELETE FROM itemuomconv WHERE itemuomconv_id=:itemuomconv_id;"); itemreject.bindValue(":itemuomconv_id", _itemuomconvid); itemreject.exec(); } XDialog::reject(); } qt-client-4.1.0/guiclient/itemUOM.h000066400000000000000000000023071217451700100170670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMUOM_H #define ITEMUOM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemUOM.h" class itemUOM : public XDialog, public Ui::itemUOM { Q_OBJECT public: itemUOM(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemUOM(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sFillList(); virtual void reject(); virtual void sAdd(); virtual void sRemove(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _mode; int _itemid; int _itemuomconvid; bool _ignoreSignals; int _uomidFrom; }; #endif // ITEMUOM_H qt-client-4.1.0/guiclient/itemUOM.ui000066400000000000000000000233151217451700100172570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemUOM 0 0 443 255 Unit of Measure 9 6 0 6 0 0 0 6 0 6 Per Fractional Qt::Vertical 329 0 0 0 0 5 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 0 false 5 7 0 1 QFrame::NoFrame QFrame::Plain 0 6 0 0 Available Types 0 0 Add > false Qt::Vertical 20 40 < Remove false 0 0 Selected Types XComboBox QComboBox

    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _uomFrom _fromValue _uomTo _toValue _fractional _available _add _remove _selected _save _close _close clicked() itemUOM reject() 363 32 308 16 _available doubleClicked(QModelIndex) _add animateClick() 101 115 181 107 _selected doubleClicked(QModelIndex) _remove animateClick() 316 186 219 183 _uomTo valid(bool) _typeFrame setEnabled(bool) 218 21 172 78 qt-client-4.1.0/guiclient/items.cpp000066400000000000000000000201231217451700100172200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "items.h" #include #include #include #include #include #include #include "characteristic.h" #include "copyItem.h" #include "item.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" items::items(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "items", fl) { setWindowTitle(tr("Items")); setReportName("Items"); setMetaSQLOptions("items", "detail"); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); setParameterWidgetVisible(true); QString qryType = QString( "SELECT 1, '%1' UNION " "SELECT 2, '%2' UNION " "SELECT 3, '%3' UNION " "SELECT 4, '%4' UNION " "SELECT 5, '%5' UNION " "SELECT 6, '%6' UNION " "SELECT 7, '%7' UNION " "SELECT 8, '%8' UNION " "SELECT 9, '%9' UNION " "SELECT 10, '%10' UNION " "SELECT 11, '%11' UNION " "SELECT 12, '%12' UNION " "SELECT 13, '%13' UNION " "SELECT 14, '%14' UNION " "SELECT 15, '%15'") .arg(tr("Buy Items")) .arg(tr("Make Items")) .arg(tr("Sold Items")) .arg(tr("Purchased")) .arg(tr("Manufactured")) .arg(tr("Phantom")) .arg(tr("Reference")) .arg(tr("Costing")) .arg(tr("Tooling")) .arg(tr("Outside Process")) .arg(tr("Planning")) .arg(tr("Kit")) .arg(tr("Breeder")) .arg(tr("Co-Product")) .arg(tr("By-Product")); parameterWidget()->appendComboBox(tr("Class Code"), "classcode_id", XComboBox::ClassCodes); parameterWidget()->append(tr("Class Code Pattern"), "classcode_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Freight Class"), "freightclass_id", XComboBox::FreightClasses); parameterWidget()->append(tr("Freight Class Pattern"), "freightclass_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item Number Pattern"), "item_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Item Description"), "item_descrip_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Item Group"), "itemgrp_id", XComboBox::ItemGroups); parameterWidget()->appendComboBox(tr("Item Types"), "item_types", qryType); parameterWidget()->appendComboBox(tr("Product Category"), "prodcat_id", XComboBox::ProductCategories); parameterWidget()->append(tr("Product Category Pattern"), "prodcat_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); list()->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft , true, "item_number" ); list()->addColumn(tr("Active"), _ynColumn, Qt::AlignCenter , true, "item_active" ); list()->addColumn(tr("Description"), -1, Qt::AlignLeft , true, "item_descrip" ); list()->addColumn(tr("Class Code"), _dateColumn, Qt::AlignLeft , true, "classcode_code"); list()->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft , true, "f_item_type"); list()->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft , true, "uom_name"); list()->addColumn(tr("Product Category"), _itemColumn, Qt::AlignLeft , false, "prodcat_code"); list()->addColumn(tr("Freight Class"), _itemColumn, Qt::AlignLeft , false, "freightclass_code"); setupCharacteristics(characteristic::Items); parameterWidget()->applyDefaultFilterSet(); if (_privileges->check("MaintainItemMasters")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(FALSE); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } connect(omfgThis, SIGNAL(itemsUpdated(int, bool)), this, SLOT(sFillList())); } void items::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainItemMasters")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); QAction *tmpaction = pMenu->addAction(tr("Delete...")); connect(tmpaction, SIGNAL(triggered()), this, SLOT(sDelete())); tmpaction->setEnabled(_privileges->check("DeleteItemMasters")); tmpaction->setObjectName("items.popup.delete"); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Copy..."), this, SLOT(sCopy())); menuItem->setEnabled(_privileges->check("MaintainItemMasters")); } void items::sNew() { item::newItem(); } void items::sEdit() { item::editItem(list()->id()); } void items::sView() { item::viewItem(list()->id()); } void items::sDelete() { if (QMessageBox::information( this, tr("Delete Item"), tr( "Are you sure that you want to delete the Item?"), tr("&Delete"), tr("&Cancel"), 0, 0, 1 ) == 0 ) { XSqlQuery qry; qry.prepare("SELECT deleteItem(:item_id) AS returnVal;"); qry.bindValue(":item_id", list()->id()); qry.exec(); if (qry.first()) { int returnVal = qry.value("returnVal").toInt(); if (returnVal < 0) { systemError(this, storedProcErrorLookup("deleteItem", returnVal), __FILE__, __LINE__); return; } sFillList(); } else if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } } } bool items::setParams(ParameterList ¶ms) { display::setParams(params); bool valid; QVariant param; param = params.value("item_types", &valid); if (valid) { int types = param.toInt(); if (types == 1) params.append("showPurchased"); else if (types == 2) params.append("showManufactured"); else if (types == 3) params.append("showSold"); else if (types == 4) params.append("item_type", "P"); else if (types == 5) params.append("item_type", "M"); else if (types == 6) params.append("item_type", "F"); else if (types == 7) params.append("item_type", "R"); else if (types == 8) params.append("item_type", "S"); else if (types == 9) params.append("item_type", "T"); else if (types == 10) params.append("item_type", "O"); else if (types == 11) params.append("item_type", "L"); else if (types == 12) params.append("item_type", "K"); else if (types == 13) params.append("item_type", "B"); else if (types == 14) params.append("item_type", "C"); else if (types == 15) params.append("item_type", "Y"); } if (_preferences->boolean("ListNumericItemNumbersFirst")) params.append("ListNumericItemNumbersFirst"); params.append("purchased", tr("Purchased")); params.append("manufactured", tr("Manufactured")); params.append("phantom", tr("Phantom")); params.append("breeder", tr("Breeder")); params.append("coProduct", tr("Co-Product")); params.append("byProduct", tr("By-Product")); params.append("reference", tr("Reference")); params.append("costing", tr("Costing")); params.append("tooling", tr("Tooling")); params.append("outside", tr("Outside Process")); params.append("planning", tr("Planning")); params.append("assortment", tr("Assortment")); params.append("kit", tr("Kit")); params.append("error", tr("Error")); return true; } void items::sCopy() { ParameterList params; params.append("item_id", list()->id()); copyItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/items.h000066400000000000000000000016471217451700100166770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMS_H #define ITEMS_H #include "display.h" #include class items : public display { Q_OBJECT public: items(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sCopy(); virtual bool setParams(ParameterList &); }; #endif // ITEMS_H qt-client-4.1.0/guiclient/items.ui000066400000000000000000000052041217451700100170560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. items 0 0 617 87 List Items Show 12 All Item Types true Buy Items Make Items Sold Items Qt::Horizontal 40 20 _showAll qt-client-4.1.0/guiclient/itemtax.cpp000066400000000000000000000075731217451700100175700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemtax.h" #include #include /* * Constructs a itemtax as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ itemtax::itemtax(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _itemtaxid = -1; _itemid = -1; } /* * Destroys the object and frees any allocated resources */ itemtax::~itemtax() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void itemtax::languageChange() { retranslateUi(this); } enum SetResponse itemtax::set(const ParameterList & pParams) { XSqlQuery itemtaxet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _itemid = param.toInt(); param = pParams.value("itemtax_id", &valid); if (valid) { _itemtaxid = param.toInt(); itemtaxet.prepare("SELECT itemtax_item_id," " COALESCE(itemtax_taxzone_id,-1) AS taxzone_id," " itemtax_taxtype_id" " FROM itemtax" " WHERE (itemtax_id=:itemtax_id);"); itemtaxet.bindValue(":itemtax_id", _itemtaxid); itemtaxet.exec(); if(itemtaxet.first()) { _itemid = itemtaxet.value("itemtax_item_id").toInt(); _taxzone->setId(itemtaxet.value("taxzone_id").toInt()); _taxtype->setId(itemtaxet.value("itemtax_taxtype_id").toInt()); } // TODO: catch any possible errors } param = pParams.value("mode", &valid); if(valid) { if(param.toString() == "new") _mode = cNew; else if(param.toString() == "edit") _mode = cEdit; else if(param.toString() == "view") { _mode = cView; _save->hide(); _taxzone->setEnabled(false); _taxtype->setEnabled(false); } } return NoError; } void itemtax::sSave() { XSqlQuery itemtaxSave; itemtaxSave.prepare("SELECT itemtax_id" " FROM itemtax" " WHERE ((itemtax_taxzone_id=:taxzone_id)" " AND (itemtax_item_id=:item_id)" " AND (itemtax_id != :itemtax_id))"); itemtaxSave.bindValue(":item_id", _itemid); itemtaxSave.bindValue(":itemtax_id", _itemtaxid); if(_taxzone->isValid()) itemtaxSave.bindValue(":taxzone_id", _taxzone->id()); itemtaxSave.exec(); if(itemtaxSave.first()) { QMessageBox::warning(this, tr("Tax Zone Already Exists"), tr("The Tax Zone you have choosen already exists for this item.")); return; } if(cNew == _mode) itemtaxSave.prepare("INSERT INTO itemtax" " (itemtax_item_id, itemtax_taxzone_id, itemtax_taxtype_id) " "VALUES(:item_id, :taxzone_id, :taxtype_id)"); else if(cEdit == _mode) itemtaxSave.prepare("UPDATE itemtax" " SET itemtax_taxzone_id=:taxzone_id," " itemtax_taxtype_id=:taxtype_id" " WHERE (itemtax_id=:itemtax_id);"); itemtaxSave.bindValue(":item_id", _itemid); itemtaxSave.bindValue(":itemtax_id", _itemtaxid); if(_taxzone->isValid()) itemtaxSave.bindValue(":taxzone_id", _taxzone->id()); itemtaxSave.bindValue(":taxtype_id", _taxtype->id()); itemtaxSave.exec(); accept(); } qt-client-4.1.0/guiclient/itemtax.h000066400000000000000000000017651217451700100172320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ITEMTAX_H #define ITEMTAX_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_itemtax.h" class itemtax : public XDialog, public Ui::itemtax { Q_OBJECT public: itemtax(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~itemtax(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); protected slots: virtual void languageChange(); private: int _itemtaxid; int _itemid; int _mode; }; #endif // ITEMTAX_H qt-client-4.1.0/guiclient/itemtax.ui000066400000000000000000000132341217451700100174120ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. itemtax 0 0 274 96 Item Tax 12 12 0 0 0 6 Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxtype Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxzone true Any XComboBox::TaxZones XComboBox::TaxTypes Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 0 0 0 0 Cancel Save Qt::Vertical 20 0 XComboBox QComboBox
    xcombobox.h
    _taxzone _taxtype _save _cancel _cancel clicked() itemtax reject() 324 18 286 18
    qt-client-4.1.0/guiclient/jsHighlighter.cpp000066400000000000000000000112111217451700100206700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "jsHighlighter.h" #include #include "format.h" static QStringList _keyword; static QStringList _extension; void JSHighlighter::init() { _commentColor = namedColor("altemphasis"); _errorColor = namedColor("error"); _extensionColor = namedColor("warning"); _keywordColor = namedColor("emphasis"); _literalColor = namedColor("future"); if (_keyword.isEmpty()) _keyword << "break" << "case" << "catch" << "continue" << "default" << "delete" << "do" << "else" << "false" << "finally" << "for" << "function" << "if" << "in" << "instanceof" << "new" << "null" << "return" << "switch" << "this" << "throw" << "true" << "try" << "typeof" << "var" << "void" << "while" << "with" ; if (_extension.isEmpty()) _extension << "abstract" << "boolean" << "byte" << "char" << "class" << "const" << "debugger" << "double" << "enum" << "export" << "extends" << "final" << "float" << "goto" << "implements" << "import" << "int" << "interface" << "long" << "native" << "package" << "private" << "protected" << "public" << "short" << "static" << "super" << "synchronized" << "throws" << "transient" << "volatile" ; _kwtest.setPattern("^(" + _keyword.join("|") + ")((?=\\W)|$)"); _extest.setPattern("^(" + _extension.join("|") + ")((?=\\W)|$)"); _numerictest.setPattern("^(0[xX][0-9a-fA-F]+)|(-?[0-9]+(\\.[0-9]+)?)"); _wordtest.setPattern("^\\w+"); _quotetest.setPattern("^\"[^\"]*\"|'[^']*'"); _regexptest.setPattern("/[^/]*/[igm]?"); } JSHighlighter::JSHighlighter(QObject *parent) : QSyntaxHighlighter(parent) { init(); } JSHighlighter::JSHighlighter(QTextDocument *document) : QSyntaxHighlighter(document) { init(); } JSHighlighter::JSHighlighter(QTextEdit *editor) : QSyntaxHighlighter(editor) { init(); } JSHighlighter::~JSHighlighter() { } void JSHighlighter::highlightBlock(const QString &text) { int state = previousBlockState(); int start = 0; for (int i = 0; i < text.length(); i++) { if (state == InsideCStyleComment) { if (text.mid(i, 2) == "*/") { state = NormalState; setFormat(start, i - start + 2, _commentColor); } } else if (state == InsideString) { // TODO: if i == 0 then error color until next " if (text.mid(i, 1) == "\"") { state = NormalState; setFormat(start, i - start + 1, _literalColor); start = i; } } else if (text.mid(i, 2) == "//") { setFormat(i, text.length() - i, _commentColor); break; } else if (text.mid(i, 2) == "/*") { start = i; state = InsideCStyleComment; } else if (_quotetest.indexIn(text.mid(i)) == 0) { setFormat(i, _quotetest.matchedLength(), _literalColor); i += _quotetest.matchedLength(); } else if (text.mid(i, 1) == "\"") { start = i; state = InsideString; } else if (_kwtest.indexIn(text.mid(i)) == 0) { setFormat(i, _kwtest.matchedLength(), _keywordColor); i += _kwtest.matchedLength(); } else if (_extest.indexIn(text.mid(i)) == 0) { setFormat(i, _extest.matchedLength(), _extensionColor); i += _extest.matchedLength(); } else if (_numerictest.indexIn(text.mid(i)) == 0) { setFormat(i, _numerictest.matchedLength(), _literalColor); i += _numerictest.matchedLength(); } else if (_regexptest.indexIn(text.mid(i)) == 0) { setFormat(i, _regexptest.matchedLength(), _literalColor); i += _regexptest.matchedLength(); } else if (_wordtest.indexIn(text.mid(i)) == 0) // skip non-keywords i += _wordtest.matchedLength(); } if (state == InsideCStyleComment) setFormat(start, text.length() - start, _commentColor); else if (state == InsideString) setFormat(start, text.length() - start, _errorColor); setCurrentBlockState(state); } qt-client-4.1.0/guiclient/jsHighlighter.h000066400000000000000000000024021217451700100203370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef JSHIGHLIGHTER_H #define JSHIGHLIGHTER_H #include class QColor; class QTextDocument; class JSHighlighter : public QSyntaxHighlighter { Q_OBJECT public: JSHighlighter(QObject *parent); JSHighlighter(QTextDocument *document); JSHighlighter(QTextEdit *editor); ~JSHighlighter(); protected: enum State { NormalState = -1, InsideCStyleComment, InsideString }; virtual void highlightBlock(const QString &text); QColor _commentColor; QColor _errorColor; QColor _extensionColor; QColor _keywordColor; QColor _literalColor; private: virtual void init(); QRegExp _kwtest; QRegExp _extest; QRegExp _numerictest; QRegExp _wordtest; QRegExp _quotetest; QRegExp _regexptest; }; #endif // JSHIGHLIGHTER_H qt-client-4.1.0/guiclient/labelForm.cpp000066400000000000000000000113451217451700100200100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "labelForm.h" #include #include #include labelForm::labelForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); } labelForm::~labelForm() { // no need to delete child widgets, Qt does it all for us } void labelForm::languageChange() { retranslateUi(this); } enum SetResponse labelForm::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("labelform_id", &valid); if (valid) { _labelformid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _report->setEnabled(FALSE); _labelsPerPage->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void labelForm::sSave() { XSqlQuery labelSave; if (_name->text().length() == 0) { QMessageBox::warning( this, tr("Format Name is Invalid"), tr("

    You must enter a valid name for this Label Format.") ); _name->setFocus(); return; } else if (_report->currentIndex() == -1) { QMessageBox::warning( this, tr("Report Name is Invalid"), tr("

    You must enter a select Report for this Label Format.") ); _report->setFocus(); return; } if (_mode == cNew) { labelSave.prepare( "SELECT labelform_id " "FROM labelform " "WHERE (labelform_name=:labelform_name);" ); labelSave.bindValue(":labelform_name", _name->text()); labelSave.exec(); if (labelSave.first()) { QMessageBox::warning( this, tr("Format Name is Invalid"), tr("

    This Label Form Name already exists.") ); _name->setFocus(); return; } else if (labelSave.lastError().type() != QSqlError::NoError) { systemError(this, labelSave.lastError().databaseText(), __FILE__, __LINE__); return; } labelSave.exec("SELECT NEXTVAL('labelform_labelform_id_seq') AS _labelform_id"); if (labelSave.first()) _labelformid = labelSave.value("_labelform_id").toInt(); else if (labelSave.lastError().type() != QSqlError::NoError) { systemError(this, labelSave.lastError().databaseText(), __FILE__, __LINE__); return; } labelSave.prepare( "INSERT INTO labelform " "(labelform_id, labelform_name, labelform_report_name, labelform_perpage) " "VALUES " "(:labelform_id, :labelform_name, :labelform_report_name, :labelform_perpage);" ); } if (_mode == cEdit) labelSave.prepare( "UPDATE labelform " "SET labelform_name=:labelform_name, labelform_report_name=:labelform_report_name," " labelform_perpage=:labelform_perpage " "WHERE (labelform_id=:labelform_id);" ); labelSave.bindValue(":labelform_id", _labelformid); labelSave.bindValue(":labelform_name", _name->text()); labelSave.bindValue(":labelform_report_name", _report->code()); labelSave.bindValue(":labelform_perpage", _labelsPerPage->value()); labelSave.exec(); if (labelSave.lastError().type() != QSqlError::NoError) { systemError(this, labelSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_labelformid); } void labelForm::populate() { XSqlQuery labelpopulate; labelpopulate.prepare( "SELECT * " "FROM labelform " "WHERE (labelform_id=:labelform_id);" ); labelpopulate.bindValue(":labelform_id", _labelformid); labelpopulate.exec(); if (labelpopulate.first()) { _name->setText(labelpopulate.value("labelform_name").toString()); _report->setCode(labelpopulate.value("labelform_report_name").toString()); _labelsPerPage->setValue(labelpopulate.value("labelform_perpage").toInt()); } else if (labelpopulate.lastError().type() != QSqlError::NoError) { systemError(this, labelpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/labelForm.h000066400000000000000000000020151217451700100174470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LABELFORM_H #define LABELFORM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_labelForm.h" class labelForm : public XDialog, public Ui::labelForm { Q_OBJECT public: labelForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~labelForm(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _labelformid; }; #endif // LABELFORM_H qt-client-4.1.0/guiclient/labelForm.ui000066400000000000000000000125611217451700100176440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. labelForm 0 0 437 109 Label Form 0 5 &Form Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Report: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report # of Labels per &Page Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report 5 XComboBox::Reports 0 1 Qt::Horizontal QSizePolicy::Expanding 31 10 Qt::Vertical QSizePolicy::Expanding 20 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox

    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _name _report _labelsPerPage _buttonBox rejected() labelForm reject() 390 56 218 54 qt-client-4.1.0/guiclient/labelForms.cpp000066400000000000000000000060561217451700100201760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "labelForms.h" #include #include #include #include #include "labelForm.h" labelForms::labelForms(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _labelforms->addColumn(tr("Form Name"), -1, Qt::AlignLeft, true, "labelform_name" ); _labelforms->addColumn(tr("#/Page"),_orderColumn, Qt::AlignCenter,true, "labelform_perpage" ); if (_privileges->check("MaintainShippingForms")) { connect(_labelforms, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_labelforms, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_labelforms, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_labelforms, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } labelForms::~labelForms() { // no need to delete child widgets, Qt does it all for us } void labelForms::languageChange() { retranslateUi(this); } void labelForms::sNew() { ParameterList params; params.append("mode", "new"); labelForm newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void labelForms::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("labelform_id", _labelforms->id()); labelForm newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void labelForms::sView() { ParameterList params; params.append("mode", "view"); params.append("labelform_id", _labelforms->id()); labelForm newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void labelForms::sDelete() { XSqlQuery labelDelete; labelDelete.prepare( "DELETE FROM labelform " "WHERE (labelform_id=:labelform_id);" ); labelDelete.bindValue(":labelform_id", _labelforms->id()); labelDelete.exec(); sFillList(); } void labelForms::sFillList() { XSqlQuery labelFillList; labelFillList.prepare("SELECT labelform_id, labelform_name, labelform_perpage " "FROM labelform " "ORDER BY labelform_name;"); labelFillList.exec(); _labelforms->populate(labelFillList); if (labelFillList.lastError().type() != QSqlError::NoError) { systemError(this, labelFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/labelForms.h000066400000000000000000000017221217451700100176360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LABELFORMS_H #define LABELFORMS_H #include "guiclient.h" #include "xwidget.h" #include "ui_labelForms.h" class labelForms : public XWidget, public Ui::labelForms { Q_OBJECT public: labelForms(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~labelForms(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // LABELFORMS_H qt-client-4.1.0/guiclient/labelForms.ui000066400000000000000000000113631217451700100200260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. labelForms 0 0 600 400 List Label Forms 0 true Label Forms: Qt::AlignVCenter 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _labelforms _new _edit _view _delete _close _close clicked() labelForms close() 20 20 20 20 _labelforms valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/listRecurringInvoices.cpp000066400000000000000000000122331217451700100224360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "listRecurringInvoices.h" #include #include #include #include #include #include #include #include "getGLDistDate.h" #include "invoice.h" #include "mqlutil.h" #include "storedProcErrorLookup.h" listRecurringInvoices::listRecurringInvoices(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_invchead, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _invchead->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignLeft, true, "invchead_invcnumber" ); _invchead->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); _invchead->addColumn(tr("Ship-to"), 100, Qt::AlignLeft, false, "invchead_shipto_name" ); _invchead->addColumn(tr("Invc. Date"), _dateColumn, Qt::AlignCenter, true, "invchead_invcdate" ); _invchead->addColumn(tr("Interval"), 100, Qt::AlignRight, true, "recur_freq" ); _invchead->addColumn(tr("Type"), _orderColumn, Qt::AlignCenter, true, "recur_period" ); _invchead->addColumn(tr("Until"), _dateColumn, Qt::AlignCenter, true, "recur_end" ); _invchead->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight, true, "extprice" ); _invchead->setSelectionMode(QAbstractItemView::ExtendedSelection); if (_privileges->check("MaintainMiscInvoices")) { _new->setEnabled(TRUE); connect(_invchead, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_invchead, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else connect(_invchead, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); if (_privileges->check("MaintainMiscInvoices") || _privileges->check("ViewMiscInvoices")) connect(_invchead, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(omfgThis, SIGNAL(invoicesUpdated(int, bool)), this, SLOT(sFillList())); sFillList(); } listRecurringInvoices::~listRecurringInvoices() { // no need to delete child widgets, Qt does it all for us } void listRecurringInvoices::languageChange() { retranslateUi(this); } void listRecurringInvoices::sNew() { invoice::newInvoice(-1); } void listRecurringInvoices::sEdit() { QList selected = _invchead->selectedItems(); for (int i = 0; i < selected.size(); i++) if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) invoice::editInvoice(((XTreeWidgetItem*)(selected[i]))->id()); } void listRecurringInvoices::sView() { QList selected = _invchead->selectedItems(); for (int i = 0; i < selected.size(); i++) if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) invoice::viewInvoice(((XTreeWidgetItem*)(selected[i]))->id()); } void listRecurringInvoices::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainMiscInvoices") || _privileges->check("ViewMiscInvoices")); } void listRecurringInvoices::sFillList() { XSqlQuery listFillList; _invchead->clear(); MetaSQLQuery mql = mqlLoad("invoices", "detail"); ParameterList params; params.append("recurringOnly"); params.append("minute", tr("Minute")); params.append("hour", tr("Hour")); params.append("day", tr("Day")); params.append("week", tr("Week")); params.append("month", tr("Month")); params.append("year", tr("Year")); params.append("none", tr("None")); listFillList = mql.toQuery(params); _invchead->populate(listFillList); if (listFillList.lastError().type() != QSqlError::NoError) { systemError(this, listFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } bool listRecurringInvoices::checkSitePrivs(int invcid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkInvoiceSitePrivs(:invcheadid) AS result;"); check.bindValue(":invcheadid", invcid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Invoice as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/listRecurringInvoices.h000066400000000000000000000022021217451700100220760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LISTRECURRINGINVOICES_H #define LISTRECURRINGINVOICES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_listRecurringInvoices.h" class listRecurringInvoices : public XWidget, public Ui::listRecurringInvoices { Q_OBJECT public: listRecurringInvoices(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~listRecurringInvoices(); virtual bool checkSitePrivs(int invcid); public slots: virtual void sEdit(); virtual void sView(); virtual void sNew(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // LISTRECURRINGINVOICES_H qt-client-4.1.0/guiclient/listRecurringInvoices.ui000066400000000000000000000120301217451700100222640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. listRecurringInvoices 0 0 698 322 List Recurring Invoices 12 12 0 Recurring Invoices: _invchead false 5 &Close 0 false New false &Edit false &View 0 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _invchead _edit _view _close _close clicked() listRecurringInvoices close() 579 26 20 20
    qt-client-4.1.0/guiclient/locales.cpp000066400000000000000000000075431217451700100175340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "locales.h" #include #include #include #include #include "sysLocale.h" locales::locales(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_locale, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_locale, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_locale, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_locale, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); _locale->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "locale_code" ); _locale->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "locale_descrip" ); sFillList(); } locales::~locales() { // no need to delete child widgets, Qt does it all for us } void locales::languageChange() { retranslateUi(this); } void locales::sNew() { ParameterList params; params.append("mode", "new"); sysLocale newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void locales::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("locale_id", _locale->id()); sysLocale newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void locales::sCopy() { XSqlQuery syset; syset.prepare("SELECT copyLocale(:locale_id) AS _locale_id;"); syset.bindValue(":locale_id", _locale->id()); syset.exec(); if (syset.first()) { ParameterList params; params.append("mode", "edit"); params.append("locale_id", syset.value("_locale_id").toInt()); sysLocale newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } else if (syset.lastError().type() != QSqlError::NoError) { systemError(this, syset.lastError().databaseText(), __FILE__, __LINE__); return; } } void locales::sView() { ParameterList params; params.append("mode", "view"); params.append("locale_id", _locale->id()); sysLocale newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void locales::sDelete() { XSqlQuery localesDelete; localesDelete.prepare( "SELECT usr_username " "FROM usr " "WHERE (usr_locale_id=:locale_id) " "LIMIT 1;" ); localesDelete.bindValue(":locale_id", _locale->id()); localesDelete.exec(); if (localesDelete.first()) QMessageBox::critical( this, tr("Cannot Delete Selected Locale"), tr( "The selected Locale cannot be deleted as it has been assigned to one or more Users.\n" "You must reassign the Locales for these Users before you may delete the selected Locale." ) ); else { localesDelete.prepare( "DELETE FROM locale " "WHERE (locale_id=:locale_id);" ); localesDelete.bindValue(":locale_id", _locale->id()); localesDelete.exec(); sFillList(); } } void locales::sFillList() { _locale->populate( "SELECT locale_id, locale_code, locale_descrip " "FROM locale " "ORDER BY locale_code" ); } qt-client-4.1.0/guiclient/locales.h000066400000000000000000000017241217451700100171740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LOCALES_H #define LOCALES_H #include "guiclient.h" #include "xwidget.h" #include "ui_locales.h" class locales : public XWidget, public Ui::locales { Q_OBJECT public: locales(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~locales(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sCopy(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // LOCALES_H qt-client-4.1.0/guiclient/locales.ui000066400000000000000000000135361217451700100173660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. locales 0 0 600 400 List Locales 0 0 0 0 20 Locales 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false Cop&y false &Delete Qt::Vertical QSizePolicy::Expanding 20 43 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _locale _new _edit _copy _delete _close _locale valid(bool) _delete setEnabled(bool) 20 20 20 20 _close clicked() locales close() 20 20 20 20 _locale itemSelected(int) _edit animateClick() 20 20 20 20 _locale valid(bool) _edit setEnabled(bool) 20 20 20 20 _locale valid(bool) _copy setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/location.cpp000066400000000000000000000361571217451700100177250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "location.h" #include #include #include #include "itemcluster.h" location::location(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_location, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sHandleWarehouse(int))); _locitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _locitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); _warehouse->setAllowNull(_metrics->boolean("MultiWhs")); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); sHandleWarehouse(_warehouse->id()); } else _warehouse->setNull(); } location::~location() { // no need to delete child widgets, Qt does it all for us } void location::languageChange() { retranslateUi(this); } enum SetResponse location::set(const ParameterList &pParams) { XSqlQuery locationet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("location_id", &valid); if (valid) { _locationid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; locationet.exec("SELECT NEXTVAL('location_location_id_seq') AS location_id;"); if (locationet.first()) _locationid = locationet.value("location_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; _warehouse->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _warehouse->setEnabled(FALSE); _whsezone->setEnabled(FALSE); _aisle->setEnabled(FALSE); _rack->setEnabled(FALSE); _bin->setEnabled(FALSE); _location->setEnabled(FALSE); _netable->setEnabled(FALSE); _restricted->setEnabled(FALSE); _description->setEnabled(FALSE); _locitem->setEnabled(FALSE); _save->hide(); _new->hide(); _delete->hide(); _close->setText(tr("&Close")); } } param = pParams.value("warehous_id", &valid); if (valid) { _warehouse->setId(param.toInt()); _warehouse->setEnabled(FALSE); } return NoError; } void location::sCheck() { XSqlQuery locationCheck; _location->setText(_location->text().trimmed()); if ( (_mode == cNew) && (_warehouse->isEnabled()) && (_location->text().length()) ) { locationCheck.prepare( "SELECT location_id " "FROM location " "WHERE ( (location_warehous_id=:location_warehous_id)" " AND (UPPER(location_name)=UPPER(:location_name)) );" ); locationCheck.bindValue(":warehous_id", _warehouse->id()); locationCheck.bindValue(":location_name", _location->text()); locationCheck.exec(); if (locationCheck.first()) { _locationid = locationCheck.value("location_id").toInt(); _mode = cEdit; _warehouse->setEnabled(FALSE); _location->setEnabled(FALSE); populate(); } } } void location::sSave() { XSqlQuery locationSave; if (_warehouse->id() == -1) { QMessageBox::critical( this, tr("Select a Site"), tr( "

    You must select a Site for this " "Location before creating it." ) ); _warehouse->setFocus(); return; } if ( (_location->text().trimmed().length() == 0) && (_aisle->text().trimmed().length() == 0) && (_rack->text().trimmed().length() == 0) && (_bin->text().trimmed().length() == 0) ) { QMessageBox::critical( this, tr("Enter Location Name"), tr("

    You must enter a unique name to identify " "this Location.") ); _location->setFocus(); return; } locationSave.prepare("SELECT location_id" " FROM location" " WHERE((location_id != :location_id)" " AND (location_warehous_id=:location_warehous_id)" " AND (location_aisle=:location_aisle)" " AND (location_rack=:location_rack)" " AND (location_bin=:location_bin)" " AND (location_name=:location_name))"); locationSave.bindValue(":location_id", _locationid); locationSave.bindValue(":location_warehous_id", _warehouse->id()); locationSave.bindValue(":location_aisle", _aisle->text()); locationSave.bindValue(":location_rack", _rack->text()); locationSave.bindValue(":location_bin", _bin->text()); locationSave.bindValue(":location_name", _location->text()); locationSave.exec(); if(locationSave.first()) { QMessageBox::critical( this, tr("Duplicate Location Name"), tr("

    You must enter a unique name to identify " "this Location in the specified Site.") ); _location->setFocus(); return; } if (_mode == cNew) locationSave.prepare( "INSERT INTO location " "( location_id, location_warehous_id," " location_aisle, location_rack, location_bin, location_name," " location_whsezone_id, location_descrip," " location_netable, location_restrict ) " "VALUES " "( :location_id, :location_warehous_id," " :location_aisle, :location_rack, :location_bin, :location_name," " :location_whsezone_id, :location_descrip," " :location_netable, :location_restrict );" ); else if (_mode == cEdit) locationSave.prepare( "UPDATE location " "SET location_warehous_id=:location_warehous_id," " location_aisle=:location_aisle, location_rack=:location_rack," " location_bin=:location_bin, location_name=:location_name," " location_whsezone_id=:location_whsezone_id, location_descrip=:location_descrip," " location_netable=:location_netable, location_restrict=:location_restrict " "WHERE (location_id=:location_id);" ); locationSave.bindValue(":location_id", _locationid); locationSave.bindValue(":location_warehous_id", _warehouse->id()); locationSave.bindValue(":location_aisle", _aisle->text()); locationSave.bindValue(":location_rack", _rack->text()); locationSave.bindValue(":location_bin", _bin->text()); locationSave.bindValue(":location_name", _location->text()); locationSave.bindValue(":location_whsezone_id", _whsezone->id()); locationSave.bindValue(":location_descrip", _description->toPlainText().trimmed()); locationSave.bindValue(":location_netable", QVariant(_netable->isChecked())); locationSave.bindValue(":location_restrict", QVariant(_restricted->isChecked())); locationSave.exec(); done(_locationid); } void location::sClose() { XSqlQuery locationClose; if (_mode == cNew) { locationClose.prepare( "DELETE FROM locitem " "WHERE (locitem_location_id=:location_id);" ); locationClose.bindValue(":location_id", _locationid); locationClose.exec(); } reject(); } void location::sHandleWarehouse(int pWarehousid) { XSqlQuery locationHandleWarehouse; locationHandleWarehouse.prepare( "SELECT warehous_enforcearbl, warehous_usezones," " warehous_aislesize, warehous_aislealpha," " warehous_racksize, warehous_rackalpha," " warehous_binsize, warehous_binalpha," " warehous_locationsize, warehous_locationalpha " "FROM whsinfo " "WHERE (warehous_id=:warehous_id);" ); locationHandleWarehouse.bindValue(":warehous_id", pWarehousid); locationHandleWarehouse.exec(); if (locationHandleWarehouse.first()) { if (locationHandleWarehouse.value("warehous_enforcearbl").toBool()) { QString regex; if (locationHandleWarehouse.value("warehous_aislesize").toInt() > 0) { _aisleLit->show(); _aisle->show(); if (locationHandleWarehouse.value("warehous_aislealpha").toBool()) regex = QString("\\w{1%1}").arg(locationHandleWarehouse.value("warehous_aislesize").toInt()); else regex = QString("\\d{1%1}").arg(locationHandleWarehouse.value("warehous_aislesize").toInt()); _aisle->setValidator(new QRegExpValidator(QRegExp(regex), this)); _aisle->setMaxLength(locationHandleWarehouse.value("warehous_aislesize").toInt()); } else { _aisleLit->hide(); _aisle->hide(); } if (locationHandleWarehouse.value("warehous_racksize").toInt() > 0) { _rackLit->show(); _rack->show(); if (locationHandleWarehouse.value("warehous_rackalpha").toBool()) regex = QString("\\w{1%1}").arg(locationHandleWarehouse.value("warehous_racksize").toInt()); else regex = QString("\\d{1%1}").arg(locationHandleWarehouse.value("warehous_racksize").toInt()); _rack->setValidator(new QRegExpValidator(QRegExp(regex), this)); _rack->setMaxLength(locationHandleWarehouse.value("warehous_racksize").toInt()); } else { _rackLit->hide(); _rack->hide(); } if (locationHandleWarehouse.value("warehous_binsize").toInt() > 0) { _binLit->show(); _bin->show(); if (locationHandleWarehouse.value("warehous_binalpha").toBool()) regex = QString("\\w{1%1}").arg(locationHandleWarehouse.value("warehous_binsize").toInt()); else regex = QString("\\d{1%1}").arg(locationHandleWarehouse.value("warehous_binsize").toInt()); _bin->setValidator(new QRegExpValidator(QRegExp(regex), this)); _bin->setMaxLength(locationHandleWarehouse.value("warehous_binsize").toInt()); } else { _binLit->hide(); _bin->hide(); } if (locationHandleWarehouse.value("warehous_locationsize").toInt() > 0) { _locationLit->show(); _location->show(); if (locationHandleWarehouse.value("warehous_locationalpha").toBool()) regex = QString("\\w{1%1}").arg(locationHandleWarehouse.value("warehous_locationsize").toInt()); else regex = QString("\\d{1%1}").arg(locationHandleWarehouse.value("warehous_locationsize").toInt()); _location->setValidator(new QRegExpValidator(QRegExp(regex), this)); _location->setMaxLength(locationHandleWarehouse.value("warehous_locationsize").toInt()); } else { _locationLit->hide(); _location->hide(); } } else { _aisleLit->hide(); _aisle->hide(); _rackLit->hide(); _rack->hide(); _binLit->hide(); _bin->hide(); _locationLit->show(); _location->show(); } _whsezone->setAllowNull(!locationHandleWarehouse.value("warehous_usezones").toBool()); locationHandleWarehouse.prepare( "SELECT whsezone_id, whsezone_name " "FROM whsezone " "WHERE (whsezone_warehous_id=:warehous_id) " "ORDER BY whsezone_name;" ); locationHandleWarehouse.bindValue(":warehous_id", pWarehousid); locationHandleWarehouse.exec(); _whsezone->populate(locationHandleWarehouse); if (!_whsezone->count()) _whsezone->setEnabled(FALSE); } } void location::sNew() { XSqlQuery locationNew; ParameterList params; itemList* newdlg = new itemList(this); newdlg->set(params); int itemid = newdlg->exec(); if (itemid != -1) { // Make sure that a locitem does not already exist for this // location and the selected item locationNew.prepare( "SELECT locitem_id " "FROM locitem " "WHERE ( (locitem_location_id=:location_id)" " AND (locitem_item_id=:item_id) );" ); locationNew.bindValue(":location_id", _locationid); locationNew.bindValue(":item_id", itemid); locationNew.exec(); if (locationNew.first()) // Tell the user that a locitem already exists for this location/item QMessageBox::information( this, tr("Location/Item Exists"), tr( "

    An Item record already exists in the " "Location. You may not add another record " "for the same Item") ); else { locationNew.prepare( "INSERT INTO locitem " "(locitem_location_id, locitem_item_id) " "VALUES " "(:location_id, :item_id);" ); locationNew.bindValue(":location_id", _locationid); locationNew.bindValue(":item_id", itemid); locationNew.exec(); sFillList(); } } } void location::sDelete() { XSqlQuery locationDelete; // ToDo - add a check to make sure that am itemloc does not exist for the selected locitem pair? locationDelete.prepare( "DELETE FROM locitem " "WHERE (locitem_id=:locitem_id);" ); locationDelete.bindValue(":locitem_id", _locitem->id()); locationDelete.exec(); sFillList(); } void location::sFillList() { XSqlQuery locationFillList; locationFillList.prepare( "SELECT locitem_id, item_number," " (item_descrip1 || ' ' || item_descrip2) AS item_descrip " "FROM locitem, item " "WHERE ( (locitem_item_id=item_id)" " AND (locitem_location_id=:location_id) );" ); locationFillList.bindValue(":location_id", _locationid); locationFillList.exec(); _locitem->populate(locationFillList); } void location::populate() { XSqlQuery locationpopulate; locationpopulate.prepare( "SELECT * " "FROM location " "WHERE (location_id=:location_id);" ); locationpopulate.bindValue(":location_id", _locationid); locationpopulate.exec(); if (locationpopulate.first()) { _aisle->setText(locationpopulate.value("location_aisle").toString()); _rack->setText(locationpopulate.value("location_rack").toString()); _bin->setText(locationpopulate.value("location_bin").toString()); _location->setText(locationpopulate.value("location_name").toString()); _description->setText(locationpopulate.value("location_descrip").toString()); _netable->setChecked(locationpopulate.value("location_netable").toBool()); _restricted->setChecked(locationpopulate.value("location_restrict").toBool()); int whsezoneid = locationpopulate.value("location_whsezone_id").toInt(); _warehouse->setId(locationpopulate.value("location_warehous_id").toInt()); sHandleWarehouse(_warehouse->id()); _whsezone->setId(whsezoneid); sFillList(); } } qt-client-4.1.0/guiclient/location.h000066400000000000000000000023051217451700100173560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LOCATION_H #define LOCATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_location.h" class location : public XDialog, public Ui::location { Q_OBJECT public: location(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~location(); virtual void populate(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void sClose(); virtual void sHandleWarehouse( int pWarehousid ); virtual void sNew(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); private: int _mode; int _locationid; }; #endif // LOCATION_H qt-client-4.1.0/guiclient/location.ui000066400000000000000000000323371217451700100175540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. location 0 0 446 404 Location &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _warehouse Qt::Horizontal QSizePolicy::Expanding 71 20 WComboBox::NonTransit &Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 _whsezone Ne&table true &Restricted Qt::Vertical QSizePolicy::Preferred 20 0 Qt::Horizontal 0 0 Aisle Qt::AlignCenter _location Rack Qt::AlignCenter _location Bin Qt::AlignCenter _location Location Qt::AlignCenter _location Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _location 0 0 0 0 0 0 0 0 Qt::Horizontal 40 20 D&escription: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _description true Allowable Items: false 0 0 0 100 false &New false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 &Cancel &Save true Qt::Vertical 0 0 WComboBox XComboBox

    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _warehouse _whsezone _restricted _netable _aisle _rack _bin _location _description _locitem _new _delete _save _close _locitem valid(bool) _delete setEnabled(bool) 20 20 20 20 _restricted toggled(bool) _new setEnabled(bool) 20 20 20 20 _restricted toggled(bool) _locitem setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/locations.cpp000066400000000000000000000126701217451700100201020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "locations.h" #include #include #include #include #include #include "location.h" locations::locations(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_location, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); _location->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _location->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "name" ); _location->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "locationname" ); _location->addColumn(tr("Netable"), 80, Qt::AlignCenter, true, "netable" ); _location->addColumn(tr("Restricted"), 80, Qt::AlignCenter, true, "restricted" ); if (_privileges->check("MaintainLocations")) { connect(_location, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_location, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_location, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_location, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } locations::~locations() { // no need to delete child widgets, Qt does it all for us } void locations::languageChange() { retranslateUi(this); } void locations::sNew() { ParameterList params; params.append("mode", "new"); if (_warehouse->isSelected()) params.append("warehous_id", _warehouse->id()); location newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void locations::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("location_id", _location->id()); location newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void locations::sView() { ParameterList params; params.append("mode", "view"); params.append("location_id", _location->id()); location newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void locations::sDelete() { XSqlQuery locationsDelete; locationsDelete.prepare("SELECT deleteLocation(:location_id) AS result;"); locationsDelete.bindValue(":location_id", _location->id()); locationsDelete.exec(); if (locationsDelete.first()) { QString caption = tr("Cannot Delete Selected Location"); QString msg; switch (locationsDelete.value("result").toInt()) { case -1: msg = tr("

    There are one or more Item Sites that use the selected Location as their default Location. " "You must assign the default Location for all Item Sites that use the selected Location before you may delete it.

    " ); break; case -2: msg = tr("

    There is Inventory contained in the selected Location. " "You must move all Inventory out of the selected Location and may then set its status to inactive.

    " ); break; case -3: msg = tr("

    There are one or more undistributed Location records that have been posted against the selected Locations. " "This probably indicates a system error.

    " "Please contact your Systems Adminstrator to have this resolved.

    " ); break; case -4: msg = tr("

    The selected Location cannot be deleted as there has been Inventory Transaction History posted against it.

    " ); break; } if (! msg.isEmpty()) { QMessageBox::critical(this, caption, msg); return; } sFillList(); } // ToDo } void locations::sPrint() { ParameterList params; _warehouse->appendValue(params); orReport report("WarehouseLocationMasterList", params); if (report.isValid()) report.print(); else report.reportError(this); } void locations::sFillList() { XSqlQuery locationsFillList; QString sql( "SELECT location_id, warehous_code, formatLocationName(location_id) AS name," " firstLine(location_descrip) AS locationname," " formatBoolYN(location_netable) AS netable," " formatBoolYN(location_restrict) AS restricted " "FROM location, whsinfo " "WHERE ( (location_warehous_id=warehous_id)" ); if (_warehouse->isSelected()) sql += " AND (warehous_id=:warehous_id)"; sql += " ) " "ORDER BY warehous_code, locationname;"; locationsFillList.prepare(sql); locationsFillList.bindValue(":warehous_id", _warehouse->id()); locationsFillList.exec(); _location->populate(locationsFillList); } qt-client-4.1.0/guiclient/locations.h000066400000000000000000000017451217451700100175500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LOCATIONS_H #define LOCATIONS_H #include "guiclient.h" #include "xwidget.h" #include "ui_locations.h" class locations : public XWidget, public Ui::locations { Q_OBJECT public: locations(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~locations(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // LOCATIONS_H qt-client-4.1.0/guiclient/locations.ui000066400000000000000000000172511217451700100177350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. locations 0 0 800 600 List Site Locations 12 12 false Qt::Horizontal QSizePolicy::Expanding 277 20 0 &Close &Print Qt::Vertical 20 40 0 1 QFrame::NoFrame QFrame::Raised 0 0 Locations: 0 0 1 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 WarehouseGroup QGroupBox
    warehousegroup.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _warehouse _location _new _edit _view _delete _print _close _close clicked() locations close() 20 20 20 20 _location valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/lotSerial.cpp000066400000000000000000000223361217451700100200450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "lotSerial.h" #include "characteristicAssignment.h" #include "lotSerialRegistration.h" #include #include #include #include #include lotSerial::lotSerial(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _print = _buttonBox->addButton(tr("Print Label"),QDialogButtonBox::ActionRole); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_lotSerial, SIGNAL(valid(bool)), this, SLOT(populate())); connect(_notes, SIGNAL(textChanged()), this, SLOT(sChanged())); connect(_deleteChar, SIGNAL(clicked()), this, SLOT(sDeleteCharass())); connect(_editChar, SIGNAL(clicked()), this, SLOT(sEditCharass())); connect(_newChar, SIGNAL(clicked()), this, SLOT(sNewCharass())); connect(_deleteReg, SIGNAL(clicked()), this, SLOT(sDeleteReg())); connect(_editReg, SIGNAL(clicked()), this, SLOT(sEditReg())); connect(_newReg, SIGNAL(clicked()), this, SLOT(sNewReg())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name" ); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value" ); _reg->addColumn(tr("Number") , _orderColumn, Qt::AlignLeft, true, "lsreg_number" ); _reg->addColumn(tr("CRM Account#"), _itemColumn, Qt::AlignLeft, true, "crmacct_number" ); _reg->addColumn(tr("Name" ), -1, Qt::AlignLeft, true, "crmacct_name" ); _reg->addColumn(tr("First Name" ), 80, Qt::AlignLeft, true, "cntct_first_name" ); _reg->addColumn(tr("Last Name" ), 80, Qt::AlignLeft, true, "cntct_last_name" ); _reg->addColumn(tr("Phone" ), 80, Qt::AlignLeft, true, "cntct_phone" ); _changed=false; } lotSerial::~lotSerial() { // no need to delete child widgets, Qt does it all for us } void lotSerial::languageChange() { retranslateUi(this); } void lotSerial::populate() { XSqlQuery lotpopulate; if (_changed) { if (QMessageBox::question(this, tr("Save changes?"), tr("

    Notes were changed without saving. " "If you continue your changes will be lost. " "Would you like an opportunity to save your changes first?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes) { disconnect(_lotSerial, SIGNAL(valid(bool)), this, SLOT(populate())); _item->setId(_itemidCache); _lotSerial->setId(_lsidCache); connect(_lotSerial, SIGNAL(valid(bool)), this, SLOT(populate())); return; } } lotpopulate.prepare( "SELECT ls_item_id,ls_notes " "FROM ls " "WHERE (ls_id=:ls_id );" ); lotpopulate.bindValue(":ls_id", _lotSerial->id()); lotpopulate.exec(); if (lotpopulate.first()) { _lsidCache=_lotSerial->id(); if (_item->id() == -1) _item->setId(lotpopulate.value("ls_item_id").toInt()); _itemidCache=_item->id(); _notes->setText(lotpopulate.value("ls_notes").toString()); _changed=false; } else if (lotpopulate.lastError().type() != QSqlError::NoError) { systemError(this, lotpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void lotSerial::sSave() { XSqlQuery lotSave; lotSave.prepare("UPDATE ls SET" " ls_notes=:notes " "WHERE (ls_id=:ls_id);"); lotSave.bindValue(":notes",_notes->toPlainText()); lotSave.bindValue(":ls_id", _lotSerial->id()); lotSave.exec(); if (lotSave.lastError().type() != QSqlError::NoError) { systemError(this, lotSave.lastError().databaseText(), __FILE__, __LINE__); return; } _notes->clear(); _changed=false; _item->setId(-1); } void lotSerial::sChanged() { if (_notes->toPlainText().length() > 0) _changed=true; } void lotSerial::sNewCharass() { ParameterList params; params.append("mode", "new"); params.append("ls_id", _lotSerial->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void lotSerial::sEditCharass() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void lotSerial::sDeleteCharass() { XSqlQuery lotDeleteCharass; lotDeleteCharass.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); lotDeleteCharass.bindValue(":charass_id", _charass->id()); lotDeleteCharass.exec(); if (lotDeleteCharass.lastError().type() != QSqlError::NoError) { systemError(this, lotDeleteCharass.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void lotSerial::sNewReg() { ParameterList params; params.append("mode", "new"); params.append("item_id", _item->id()); params.append("ls_id", _lotSerial->id()); lotSerialRegistration newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void lotSerial::sEditReg() { ParameterList params; params.append("mode", "edit"); params.append("lsreg_id", _reg->id()); lotSerialRegistration newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void lotSerial::sDeleteReg() { XSqlQuery lotDeleteReg; lotDeleteReg.prepare( "DELETE FROM lsreg " "WHERE (lsreg_id=:lsreg_id);" "DELETE FROM charass " "WHERE ((charass_target_type='LSR') " "AND (charass_target_id=:lsreg_id))" ); lotDeleteReg.bindValue(":lsreg_id", _reg->id()); lotDeleteReg.exec(); if (lotDeleteReg.lastError().type() != QSqlError::NoError) { systemError(this, lotDeleteReg.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void lotSerial::sFillList() { XSqlQuery lotFillList; lotFillList.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value " "FROM charass, char " "WHERE ((charass_target_type='LS')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:ls_id) ) " "ORDER BY char_order, char_name;" ); lotFillList.bindValue(":ls_id", _lotSerial->id()); lotFillList.exec(); _charass->clear(); _charass->populate(lotFillList); if (lotFillList.lastError().type() != QSqlError::NoError) { systemError(this, lotFillList.lastError().databaseText(), __FILE__, __LINE__); return; } lotFillList.prepare( "SELECT lsreg_id,lsreg_number,crmacct_number,crmacct_name," " cntct_first_name,cntct_last_name,cntct_phone " "FROM lsreg " " LEFT OUTER JOIN crmacct ON (lsreg_crmacct_id=crmacct_id), " " cntct " "WHERE ((lsreg_cntct_id=cntct_id) " "AND (lsreg_ls_id=:ls_id));"); lotFillList.bindValue(":ls_id", _lotSerial->id()); lotFillList.exec(); _reg->clear(); _reg->populate(lotFillList); if (lotFillList.lastError().type() != QSqlError::NoError) { systemError(this, lotFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void lotSerial::sPrint() { XSqlQuery lotPrint; QString lot(tr("Lot#:")); QString serial(tr("Serial#:")); ParameterList params; params.append("ls_id", _lotSerial->id()); // Try to infer whether this requires a lot or serial number label lotPrint.prepare("SELECT DISTINCT itemsite_controlmethod " "FROM itemsite " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_controlmethod IN ('L','S')));"); lotPrint.bindValue(":item_id", _item->id()); lotPrint.exec(); if (lotPrint.size() == 1) { lotPrint.first(); if (lotPrint.value("itemsite_controlmethod").toString() == "L") params.append("label", lot); else params.append("label", serial); } else if (lotPrint.lastError().type() != QSqlError::NoError) { systemError(this, lotPrint.lastError().databaseText(), __FILE__, __LINE__); return; } else { QString msg(tr("Is this a Lot or a Serial number?")); QMessageBox msgbox; msgbox.setText(msg); msgbox.addButton(tr("Lot"),QMessageBox::AcceptRole); msgbox.addButton(tr("Serial"),QMessageBox::RejectRole); if (msgbox.exec() == QDialog::Accepted) params.append("label", serial); else params.append("label", lot); } orReport report("LotSerialLabel",params); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/lotSerial.h000066400000000000000000000024231217451700100175050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LOTSERIAL_H #define LOTSERIAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_lotSerial.h" class lotSerial : public XDialog, public Ui::lotSerial { Q_OBJECT public: lotSerial(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~lotSerial(); QPushButton* _print; public slots: virtual void populate(); virtual void sSave(); virtual void sChanged(); virtual void sFillList(); virtual void sNewCharass(); virtual void sEditCharass(); virtual void sDeleteCharass(); virtual void sNewReg(); virtual void sEditReg(); virtual void sDeleteReg(); virtual void sPrint(); protected slots: virtual void languageChange(); private: int _lsidCache; int _itemidCache; bool _changed; }; #endif // LOTSERIAL_H qt-client-4.1.0/guiclient/lotSerial.ui000066400000000000000000000304061217451700100176750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. lotSerial 0 0 619 479 600 400 1000 1000 Lot/Serial 12 Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 76 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save true Qt::StrongFocus Lot/Serial #: false Qt::ClickFocus 0 Characteristics false &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Qt::ClickFocus Registrations Qt::ClickFocus false &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Notes Qt::ClickFocus Comments Qt::StrongFocus Comments::LotSerial Comments QWidget

    comments.h
    ItemCluster QWidget
    itemcluster.h
    1
    LotserialCluster QWidget
    lotserialcluster.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _item _lotSerial _charass _newChar _editChar _deleteChar _tab _reg _newReg _editReg _deleteReg _notes _comments _charass valid(bool) _editChar setEnabled(bool) 263 317 565 210 _charass valid(bool) _deleteChar setEnabled(bool) 263 317 565 210 _reg valid(bool) _editReg setEnabled(bool) 458 307 568 216 _reg valid(bool) _deleteReg setEnabled(bool) 471 324 588 251 _lotSerial newId(int) _comments setId(int) 202 126 110 201 _item privateIdChanged(int) _lotSerial setItemId(int) 215 50 215 113 _lotSerial valid(bool) _newReg setEnabled(bool) 294 122 529 182 _lotSerial valid(bool) _newChar setEnabled(bool) 138 110 565 210 _reg itemDoubleClicked(QTreeWidgetItem*,int) _editReg animateClick() 472 289 549 218 _buttonBox rejected() lotSerial reject() 572 66 309 239 qt-client-4.1.0/guiclient/lotSerialRegistration.cpp000066400000000000000000000307211217451700100224350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "lotSerialRegistration.h" #include #include #include #include #include #include "storedProcErrorLookup.h" #include "characteristicAssignment.h" lotSerialRegistration::lotSerialRegistration(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _lsregid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_soldDate, SIGNAL(newDate(const QDate&)), this, SLOT(sDateUpdated())); connect(_crmacct, SIGNAL(newId(int)), this, SLOT(sSetSoCustId())); connect(_so, SIGNAL(newId(int,QString)), this, SLOT(sSetSoId())); connect(_deleteChar, SIGNAL(clicked()), this, SLOT(sDeleteCharass())); connect(_editChar, SIGNAL(clicked()), this, SLOT(sEditCharass())); connect(_newChar, SIGNAL(clicked()), this, SLOT(sNewCharass())); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name" ); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value" ); _lotSerial->setStrict(true); _shipment->setStrict(true); _so->setAllowedTypes(OrderLineEdit::Sales); _qty->setValidator(omfgThis->qtyVal()); adjustSize(); } lotSerialRegistration::~lotSerialRegistration() { // no need to delete child widgets, Qt does it all for us } void lotSerialRegistration::languageChange() { retranslateUi(this); } enum SetResponse lotSerialRegistration::set(const ParameterList &pParams) { XSqlQuery lotet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("crmacct_id", &valid); if (valid) _crmacct->setId(param.toInt()); param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); param = pParams.value("ls_id", &valid); if (valid) _lotSerial->setId(param.toInt()); param = pParams.value("lsreg_id", &valid); if (valid) _lsregid=param.toInt(); param = pParams.value("mode", &valid); if (valid) { _mode = cNew; if (param.toString() == "new") { _mode = cNew; lotet.exec ("SELECT fetchlsregnumber() AS number;"); if (lotet.first()) _regNumber->setText(lotet.value("number").toString()); else if(lotet.lastError().type() != QSqlError::NoError) { systemError(this, lotet.lastError().databaseText(), __FILE__, __LINE__); reject(); } lotet.exec("SELECT NEXTVAL('lsreg_lsreg_id_seq') AS _lsreg_id;"); if (lotet.first()) _lsregid = lotet.value("_lsreg_id").toInt(); else if (lotet.lastError().type() != QSqlError::NoError) { systemError(this, lotet.lastError().databaseText(), __FILE__, __LINE__); reject(); } _qty->setText("1"); } else if (param.toString() == "edit") { _mode = cEdit; populate(); _itemGroup->setEnabled(false); } else if (param.toString() == "view") { _mode = cView; _regDate->setEnabled(false); _soldDate->setEnabled(false); _expireDate->setEnabled(false); _crmacct->setEnabled(false); _cntct->setEnabled(false); _type->setEnabled(false); _item->setReadOnly(true); _lotSerial->setEnabled(false); _newChar->setEnabled(false); _editChar->setEnabled(false); _deleteChar->setEnabled(false); _notes->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } param = pParams.value("crmacct_id", &valid); if (valid) { _crmacct->setId(param.toInt()); _crmacct->setEnabled(false); } return NoError; } void lotSerialRegistration::closeEvent(QCloseEvent *pEvent) { XSqlQuery lotcloseEvent; if (_mode == cNew) { lotcloseEvent.prepare("SELECT releaseLsRegNumber(:regNumber);" ); lotcloseEvent.bindValue(":regNumber", _regNumber->text()); lotcloseEvent.exec(); if (lotcloseEvent.lastError().type() != QSqlError::NoError) systemError(this, lotcloseEvent.lastError().databaseText(), __FILE__, __LINE__); } pEvent->accept(); } void lotSerialRegistration::sNewCharass() { ParameterList params; params.append("mode", "new"); params.append("lsreg_id", _lsregid); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void lotSerialRegistration::sEditCharass() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void lotSerialRegistration::sDeleteCharass() { XSqlQuery lotDeleteCharass; lotDeleteCharass.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); lotDeleteCharass.bindValue(":charass_id", _charass->id()); lotDeleteCharass.exec(); if (lotDeleteCharass.lastError().type() != QSqlError::NoError) { systemError(this, lotDeleteCharass.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void lotSerialRegistration::sFillList() { XSqlQuery lotFillList; lotFillList.prepare( "SELECT charass_id, char_name, charass_value " "FROM charass, char " "WHERE ((charass_target_type='LSR')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:lsreg_id) ) " "ORDER BY char_name;" ); lotFillList.bindValue(":lsreg_id", _lsregid); lotFillList.exec(); _charass->clear(); _charass->populate(lotFillList); if (lotFillList.lastError().type() != QSqlError::NoError) { systemError(this, lotFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void lotSerialRegistration::populate() { XSqlQuery lotpopulate; lotpopulate.prepare("SELECT *" " FROM lsreg LEFT OUTER JOIN ls ON (lsreg_ls_id=ls_id)" " WHERE(lsreg_id=:lsreg_id);"); lotpopulate.bindValue(":lsreg_id", _lsregid); lotpopulate.exec(); if(lotpopulate.first()) { _lsregid = lotpopulate.value("lsreg_id").toInt(); _regNumber->setText(lotpopulate.value("lsreg_number").toString()); _type->setId(lotpopulate.value("lsreg_regtype_id").toInt()); _qty->setDouble(lotpopulate.value("lsreg_qty").toDouble()); _item->setId(lotpopulate.value("ls_item_id").toInt()); _lotSerial->setId(lotpopulate.value("lsreg_ls_id").toInt()); _regDate->setDate(lotpopulate.value("lsreg_regdate").toDate()); _soldDate->setDate(lotpopulate.value("lsreg_solddate").toDate()); _expireDate->setDate(lotpopulate.value("lsreg_expiredate").toDate()); _crmacct->setId(lotpopulate.value("lsreg_crmacct_id").toInt()); _cntct->setId(lotpopulate.value("lsreg_cntct_id").toInt()); _notes->setText(lotpopulate.value("lsreg_notes").toString()); if(!lotpopulate.value("lsreg_cohead_id").isNull()) _so->setId(lotpopulate.value("lsreg_cohead_id").toInt()); if(!lotpopulate.value("lsreg_shiphead_id").isNull()) _shipment->setId(lotpopulate.value("lsreg_shiphead_id").toInt()); sFillList(); } else if(lotpopulate.lastError().type() != QSqlError::NoError) { systemError(this, lotpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void lotSerialRegistration::sSave() { XSqlQuery lotSave; if(cView == _mode) return; if (!_crmacct->isValid()) { QMessageBox::warning(this, windowTitle(), tr("You must provide a CRM Account.")); _crmacct->setFocus(); return; } if (!_regDate->isValid()) { QMessageBox::warning(this, windowTitle(), tr("You must provide a registration date.")); _regDate->setFocus(); return; } if (!_soldDate->isValid()) { QMessageBox::warning(this, windowTitle(), tr("You must provide a sold date.")); _soldDate->setFocus(); return; } if (!_expireDate->isValid()) { QMessageBox::warning(this, windowTitle(), tr("You must provide a expiration date.")); _expireDate->setFocus(); return; } if (_lotSerial->id() == -1) { QMessageBox::warning(this, windowTitle(), tr("You must provide a lot/serial number.")); _lotSerial->setFocus(); return; } if (!(_qty->toDouble() > 0)) { QMessageBox::warning(this, windowTitle(), tr("You must provide a quantity greater than zero.")); _qty->setFocus(); return; } if (_cntct->id() == -1) { QMessageBox::warning(this, windowTitle(), "You must provide a contact."); _cntct->setFocus(); return; } if(cNew == _mode) { lotSave.prepare("INSERT INTO lsreg" " (lsreg_id, lsreg_number, lsreg_regtype_id," " lsreg_ls_id, lsreg_qty, lsreg_regdate, lsreg_solddate," " lsreg_expiredate, lsreg_crmacct_id, lsreg_cntct_id," " lsreg_notes, lsreg_cohead_id, lsreg_shiphead_id) " "VALUES(:lsreg_id, :lsreg_number, :lsreg_regtype_id," " :lsreg_ls_id, :lsreg_qty, :lsreg_regdate, :lsreg_solddate," " :lsreg_expiredate, :lsreg_crmacct_id, :lsreg_cntct_id," " :lsreg_notes, :lsreg_cohead_id, :lsreg_shiphead_id);"); } else if(cEdit == _mode) lotSave.prepare("UPDATE lsreg" " SET lsreg_number=:lsreg_number," " lsreg_regtype_id=:lsreg_regtype_id," " lsreg_ls_id=:lsreg_ls_id," " lsreg_qty=:lsreg_qty," " lsreg_regdate=:lsreg_regdate," " lsreg_solddate=:lsreg_solddate," " lsreg_expiredate=:lsreg_expiredate," " lsreg_crmacct_id=:lsreg_crmacct_id," " lsreg_cntct_id=:lsreg_cntct_id," " lsreg_notes=:lsreg_notes," " lsreg_cohead_id=:lsreg_cohead_id," " lsreg_shiphead_id=:lsreg_shiphead_id" " WHERE(lsreg_id=:lsreg_id);"); lotSave.bindValue(":lsreg_id", _lsregid); lotSave.bindValue(":lsreg_number", _regNumber->text().trimmed()); lotSave.bindValue(":lsreg_regtype_id", _type->id()); lotSave.bindValue(":lsreg_ls_id", _lotSerial->id()); lotSave.bindValue(":lsreg_qty", _qty->toDouble()); lotSave.bindValue(":lsreg_regdate", _regDate->date()); lotSave.bindValue(":lsreg_solddate", _soldDate->date()); lotSave.bindValue(":lsreg_expiredate", _expireDate->date()); lotSave.bindValue(":lsreg_crmacct_id", _crmacct->id()); lotSave.bindValue(":lsreg_cntct_id", _cntct->id()); lotSave.bindValue(":lsreg_notes", _notes->toPlainText()); if(_so->id() != -1) lotSave.bindValue(":lsreg_cohead_id", _so->id()); if(_shipment->id() != -1) lotSave.bindValue(":lsreg_shiphead_id", _shipment->id()); lotSave.exec(); if (lotSave.lastError().type() != QSqlError::NoError) { systemError(this, lotSave.lastError().databaseText(), __FILE__, __LINE__); return; } _mode = 0; close(); } void lotSerialRegistration::sDateUpdated() { if(cView == _mode) return; QDate date = _soldDate->date(); if(date.isNull()) return; XSqlQuery dq; dq.prepare("SELECT item_warrdays" " FROM item" " WHERE(item_id=:item_id);"); dq.bindValue(":item_id", _item->id()); dq.exec(); if(dq.first()) { date.addDays(dq.value("item_warrdays").toInt()); _expireDate->setDate(date); } } void lotSerialRegistration::sSetSoCustId() { if (_crmacct->id() != -1) { XSqlQuery cq; cq.prepare("SELECT crmacct_cust_id " "FROM crmacct " "WHERE (crmacct_id=:crmacct_id);"); cq.bindValue(":crmacct_id", _crmacct->id()); cq.exec(); if (cq.first()) { _so->setCustId(cq.value("crmacct_cust_id").toInt()); _shipment->setId(-1); } else if(cq.lastError().type() != QSqlError::NoError) { systemError(this, cq.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _shipment->setId(-1); _so->setCustId(-1); } } void lotSerialRegistration::sSetSoId() { if (_so->id() != -1) _shipment->limitToOrder(_so->id()); else _shipment->removeOrderLimit(); } qt-client-4.1.0/guiclient/lotSerialRegistration.h000066400000000000000000000027531217451700100221060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LOTSERIALREGISTRATION_H #define LOTSERIALREGISTRATION_H #include "guiclient.h" #include "xdialog.h" #include "xdatawidgetmapper.h" #include #include #include #include "ui_lotSerialRegistration.h" class lotSerialRegistration : public XDialog, public Ui::lotSerialRegistration { Q_OBJECT public: lotSerialRegistration(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~lotSerialRegistration(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void closeEvent( QCloseEvent * pEvent ); virtual void populate(); virtual void sSave(); virtual void sNewCharass(); virtual void sEditCharass(); virtual void sDeleteCharass(); virtual void sFillList(); virtual void sDateUpdated(); virtual void sSetSoCustId(); virtual void sSetSoId(); protected slots: virtual void languageChange(); private: int _mode; int _lsregid; }; #endif // LOTSERIALREGISTRATION_H qt-client-4.1.0/guiclient/lotSerialRegistration.ui000066400000000000000000000543511217451700100222750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. lotSerialRegistration 0 0 800 600 Lot/Serial Registration 12 0 12 Registration #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _regNumber false lsreg_number Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _type XComboBox::RegistrationTypes lsreg_regtype_id Qt::Horizontal 21 25 Qt::Vertical 20 0 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Vertical 20 0 Qt::StrongFocus Qt::StrongFocus Lot/Serial #: lsreg_ls_id Qty: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty lsreg_qty Register Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _regDate Sold Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _soldDate lsreg_solddate Qt::Horizontal 40 20 Expire Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _expireDate 2000 1 1 lsreg_expiredate lsreg_regdate Qt::StrongFocus CRM Account: lsreg_crmacct_id Qt::Vertical 20 40 7 Sales Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Shipment #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipment Qt::StrongFocus false lsreg_shiphead_id 0 1 0 Contact lsreg_cntct_id false false false Qt::Vertical 20 0 Qt::Horizontal 0 20 Characteristics Qt::ClickFocus 0 true Qt::TabFocus &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 Notes lsreg_notes ContactCluster QWidget
    contactcluster.h
    CRMAcctCluster QWidget
    crmacctcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    LotserialCluster QWidget
    lotserialcluster.h
    OrderCluster QWidget
    ordercluster.h
    ShipmentCluster QWidget
    shipmentcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _regNumber _type _item _lotSerial _qty _regDate _soldDate _expireDate _crmacct _so _shipment _tab _cntct _charass _newChar _editChar _deleteChar _notes _item newId(int) _lotSerial setItemId(int) 140 181 138 240 _crmacct newId(int) _cntct setSearchAcct(int) 145 401 28 527 _lotSerial newItemId(int) _item setId(int) 166 240 137 129 _charass valid(bool) _editChar setEnabled(bool) 524 490 598 501 _charass valid(bool) _deleteChar setEnabled(bool) 540 522 601 523 _charass doubleClicked(QModelIndex) _editChar animateClick() 532 481 608 506 _buttonBox rejected() lotSerialRegistration reject() 745 46 399 314
    qt-client-4.1.0/guiclient/lotSerialSequence.cpp000066400000000000000000000144531217451700100215370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "lotSerialSequence.h" #include #include lotSerialSequence::lotSerialSequence(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_prefix, SIGNAL(editingFinished()), this, SLOT(sHandleExample())); connect(_nextValue, SIGNAL(editingFinished()), this, SLOT(sHandleExample())); connect(_length, SIGNAL(editingFinished()), this, SLOT(sHandleExample())); connect(_suffix, SIGNAL(editingFinished()), this, SLOT(sHandleExample())); _nextValue->setValidator(omfgThis->orderVal()); } lotSerialSequence::~lotSerialSequence() { // no need to delete child widgets, Qt does it all for us } void lotSerialSequence::languageChange() { retranslateUi(this); } enum SetResponse lotSerialSequence::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("lsseq_id", &valid); if (valid) { _lsseqid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(FALSE); _description->setEnabled(FALSE); _prefix->setEnabled(FALSE); _nextValue->setEnabled(FALSE); _length->setEnabled(FALSE); _suffix->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } bool lotSerialSequence::sCheck() { XSqlQuery lotCheck; _number->setText(_number->text().trimmed()); if ((_mode == cNew) && (_number->text().length() != 0)) { lotCheck.prepare( "SELECT lsseq_id " "FROM lsseq " "WHERE (UPPER(lsseq_number)=UPPER(:lsseq_number));" ); lotCheck.bindValue(":lsseq_number", _number->text()); lotCheck.exec(); if (lotCheck.first()) { _lsseqid = lotCheck.value("lsseq_id").toInt(); _mode = cEdit; populate(); _number->setEnabled(FALSE); return TRUE; } } return FALSE; } void lotSerialSequence::sSave() { XSqlQuery lotSave; _number->setText(_number->text().trimmed().toUpper()); if (_number->text().length() == 0) { QMessageBox::information( this, tr("Invalid Sequence"), tr("You must enter a valid Code for this Sequence.") ); _number->setFocus(); return; } if (_mode == cNew) { if (sCheck()) { QMessageBox::warning( this, tr("Cannot Save Sequence"), tr("This Sequence number already exists. You have been placed in edit mode.") ); return; } lotSave.exec("SELECT NEXTVAL('lsseq_lsseq_id_seq') AS lsseq_id"); if (lotSave.first()) _lsseqid = lotSave.value("lsseq_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } lotSave.prepare( "INSERT INTO lsseq " "( lsseq_id, lsseq_number) " "VALUES " "( :lsseq_id, :lsseq_number);"); } else if (_mode == cEdit) lotSave.prepare("SELECT lsseq_id" " FROM lsseq" " WHERE((lsseq_id != :lsseq_id)" " AND (lsseq_number = :lsseq_number));"); lotSave.bindValue(":lsseq_id", _lsseqid); lotSave.bindValue(":lsseq_number", _number->text()); lotSave.exec(); if(lotSave.first()) { QMessageBox::warning( this, tr("Cannot Save Sequence Number"), tr("You may not rename this Sequence number with the entered name as it is in use by another Planner code.") ); _number->setFocus(); return; } lotSave.prepare( "UPDATE lsseq " "SET lsseq_number=:lsseq_number, lsseq_descrip=:lsseq_descrip," " lsseq_prefix=:lsseq_prefix,lsseq_seqlen=:lsseq_seqlen, " " lsseq_suffix=:lsseq_suffix " "WHERE (lsseq_id=:lsseq_id);" "SELECT setval(:sequence, :next_value - 1);"); lotSave.bindValue(":lsseq_id", _lsseqid); lotSave.bindValue(":lsseq_number", _number->text()); lotSave.bindValue(":lsseq_descrip", _description->text().trimmed()); lotSave.bindValue(":lsseq_prefix", _prefix->text()); lotSave.bindValue(":lsseq_seqlen", _length->value()); lotSave.bindValue(":lsseq_suffix", _suffix->text()); lotSave.bindValue(":next_value", _nextValue->text()); lotSave.bindValue(":sequence", QString("lsseq_number_seq_%1").arg(_lsseqid)); lotSave.exec(); done(_lsseqid); } void lotSerialSequence::populate() { XSqlQuery lotpopulate; lotpopulate.prepare( "SELECT * " "FROM lsseq " "WHERE (lsseq_id=:lsseq_id);" ); lotpopulate.bindValue(":lsseq_id", _lsseqid); lotpopulate.exec(); if (lotpopulate.first()) { _number->setText(lotpopulate.value("lsseq_number")); _description->setText(lotpopulate.value("lsseq_descrip")); _prefix->setText(lotpopulate.value("lsseq_prefix")); _length->setValue(lotpopulate.value("lsseq_seqlen").toInt()); _suffix->setText(lotpopulate.value("lsseq_suffix")); lotpopulate.prepare("SELECT last_value + 1 AS next_number " "FROM lsseq_number_seq_:lsseq_id;"); lotpopulate.bindValue(":lsseq_id", _lsseqid); lotpopulate.exec(); if (lotpopulate.first()) _nextValue->setText(lotpopulate.value("next_number")); sHandleExample(); } } void lotSerialSequence::sHandleExample() { _example->setText(_prefix->text() + _nextValue->text().rightJustified(_length->value(),QChar('0')) + _suffix->text()); } qt-client-4.1.0/guiclient/lotSerialSequence.h000066400000000000000000000022031217451700100211720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LOTSERIALSEQUENCE_H #define LOTSERIALSEQUENCE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_lotSerialSequence.h" class lotSerialSequence : public XDialog, public Ui::lotSerialSequence { Q_OBJECT public: lotSerialSequence(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~lotSerialSequence(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool sCheck(); virtual void sSave(); virtual void sHandleExample(); protected slots: virtual void languageChange(); private: int _mode; int _lsseqid; }; #endif // LOTSERIALSEQUENCE_H qt-client-4.1.0/guiclient/lotSerialSequence.ui000066400000000000000000000231151217451700100213650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. lotSerialSequence 0 0 547 227 Lot/Serial Sequence &Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Next Value: 1 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Min. Length: 1 5 Qt::Horizontal 40 20 Qt::Horizontal 40 20 Prefix: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Suffix: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Example: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Qt::Horizontal 0 20 5 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical 20 0 XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XSpinBox QSpinBox
    xspinbox.h
    _number _description _prefix _nextValue _length _suffix parameter.h
    qt-client-4.1.0/guiclient/lotSerialSequences.cpp000066400000000000000000000073511217451700100217210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "lotSerialSequences.h" #include #include #include #include #include "lotSerialSequence.h" #include "guiclient.h" /* * Constructs a lotSerialSequences as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ lotSerialSequences::lotSerialSequences(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _lsseq->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft, true, "lsseq_number" ); _lsseq->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "lsseq_descrip" ); if (_privileges->check("MaintainLotSerialSequences")) { connect(_lsseq, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_lsseq, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_lsseq, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_lsseq, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(); } /* * Destroys the object and frees any allocated resources */ lotSerialSequences::~lotSerialSequences() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void lotSerialSequences::languageChange() { retranslateUi(this); } void lotSerialSequences::sDelete() { XSqlQuery lotDelete; lotDelete.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE (itemsite_lsseq_id=:lsseq_id);" ); lotDelete.bindValue(":lsseq_id", _lsseq->id()); lotDelete.exec(); if (lotDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Sequence"), tr( "The selected Planner Code cannot be deleted as there are one or more Item Sites currently assigned to it.\n" "You must reassign these Item Sites before you may delete the selected Planner Code." ) ); return; } lotDelete.prepare( "DELETE FROM lsseq " "WHERE (lsseq_id=:lsseq_id);" ); lotDelete.bindValue(":lsseq_id", _lsseq->id()); lotDelete.exec(); sFillList(); } void lotSerialSequences::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("lsseq_id", _lsseq->id()); lotSerialSequence newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void lotSerialSequences::sView() { ParameterList params; params.append("mode", "view"); params.append("lsseq_id", _lsseq->id()); lotSerialSequence newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void lotSerialSequences::sFillList() { _lsseq->populate( "SELECT lsseq_id, lsseq_number, lsseq_descrip " "FROM lsseq " "ORDER BY lsseq_number;" ); } void lotSerialSequences::sNew() { ParameterList params; params.append("mode", "new"); lotSerialSequence newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } qt-client-4.1.0/guiclient/lotSerialSequences.h000066400000000000000000000017721217451700100213670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef LOTSERIALSEQUENCES_H #define LOTSERIALSEQUENCES_H #include "xwidget.h" #include "ui_lotSerialSequences.h" class lotSerialSequences : public XWidget, public Ui::lotSerialSequences { Q_OBJECT public: lotSerialSequences(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~lotSerialSequences(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sNew(); protected slots: virtual void languageChange(); }; #endif // LOTSERIALSEQUENCES_H qt-client-4.1.0/guiclient/lotSerialSequences.ui000066400000000000000000000105771217451700100215600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. lotSerialSequences 0 0 600 400 Lot/Serial Sequences 0 Lot/Serial Sequences &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _lsseq _new _edit _view _delete _close _lsseq valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() lotSerialSequences close() 20 20 20 20
    qt-client-4.1.0/guiclient/m000077500000000000000000000000251217451700100155540ustar00rootroot00000000000000#!/bin/bash make -j4 qt-client-4.1.0/guiclient/main.cpp000066400000000000000000000710141217451700100170300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /*! \mainpage xTuple ERP Programmer Reference Index Page \section intro_sec Introduction \brief xTuple ERP is an application written in C++ using the %Qt cross-platform application and %user interface framework. This document provides reference information for people who want to either understand the core application code or develop %scripts and %packages to extend the xTuple ERP core. To navigate this documentation you should know the following:
    */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtupleplugin.h" #include "xtupleproductkey.h" #include "login2.h" #include "currenciesDialog.h" #include "registrationKeyDialog.h" #include "guiclient.h" #include "version.h" #include "metrics.h" #include "metricsenc.h" #include "scripttoolbox.h" #include "xmainwindow.h" #include "checkForUpdates.h" #include "sysLocale.h" #include "splashconst.h" #include "xtsettings.h" #include "welcomeStub.h" #include Q_IMPORT_PLUGIN(xTuplePlugin) QString __password; #define DEBUG false extern void xTupleMessageOutput(QtMsgType type, const char *msg); // helps determine which edition we're running & what splash screen to present struct editionDesc { editionDesc(QString ed, QString splash, bool check, QString query) : editionName(ed), splashResource(splash), shouldCheckLicense(check), queryString(query) {} QString editionName; QString splashResource; bool shouldCheckLicense; QString queryString; }; int main(int argc, char *argv[]) { XSqlQuery main; Q_INIT_RESOURCE(guiclient); QString username; QString databaseURL; QString passwd; bool haveUsername = FALSE; bool haveDatabaseURL = FALSE; bool loggedIn = FALSE; bool haveEnhancedAuth= false; bool _enhancedAuth = false; bool havePasswd = false; bool forceWelcomeStub= false; qInstallMsgHandler(xTupleMessageOutput); QApplication app(argc, argv); app.setOrganizationDomain("xTuple.com"); app.setOrganizationName("xTuple"); app.setApplicationName("xTuple"); app.setApplicationVersion(_Version); #if QT_VERSION >= 0x040400 // This is the correct place for this call but on versions less // than 4.4 it causes a crash for an unknown reason so it is // called later on earlier versions. QCoreApplication::addLibraryPath(QString(".")); #endif #ifndef Q_WS_MACX QApplication::setWindowIcon(QIcon(":/images/icon32x32.png")); #endif app.processEvents(); if (argc > 1) { for (int intCounter = 1; intCounter < argc; intCounter++) { QString argument(argv[intCounter]); if (argument.contains("-databaseURL=", Qt::CaseInsensitive)) { haveDatabaseURL = TRUE; databaseURL = argument.right(argument.length() - 13); } else if (argument.contains("-username=", Qt::CaseInsensitive)) { haveUsername = TRUE; username = argument.right(argument.length() - 10); } else if (argument.contains("-passwd=", Qt::CaseInsensitive)) { havePasswd = TRUE; passwd = argument.right(argument.length() - 8); } else if (argument.contains("-noAuth", Qt::CaseInsensitive)) { haveUsername = TRUE; havePasswd = TRUE; } else if (argument.contains("-enhancedAuth", Qt::CaseInsensitive)) { haveEnhancedAuth = true; _enhancedAuth = true; if(argument.contains("=no", Qt::CaseInsensitive) || argument.contains("=false", Qt::CaseInsensitive)) _enhancedAuth = false; } else if (argument.contains("-forceWelcomeStub", Qt::CaseInsensitive)) forceWelcomeStub = true; } } // Try and load a default translation file and install it // otherwise if we are non-english inform the user that translation are available bool checkLanguage = false; QLocale sysl = QLocale::system(); QTranslator defaultTranslator(&app); if (defaultTranslator.load(translationFile(sysl.name().toLower(), "default"))) app.installTranslator(&defaultTranslator); else if(!xtsettingsValue("LanguageCheckIgnore", false).toBool() && sysl.language() != QLocale::C && sysl.language() != QLocale::English) checkLanguage = translationFile(sysl.name().toLower(), "xTuple").isNull(); if (forceWelcomeStub || checkLanguage) { QTranslator * translator = new QTranslator(&app); if (translator->load(translationFile(sysl.name().toLower(), "welcome/wmsg"))) app.installTranslator(translator); welcomeStub wsdlg; wsdlg.checkBox->setChecked(xtsettingsValue("LanguageCheckIgnore", false).toBool()); wsdlg.exec(); xtsettingsSetValue("LanguageCheckIgnore", wsdlg.checkBox->isChecked()); } _splash = new QSplashScreen(); _splash->setPixmap(QPixmap(":/images/splashEmpty.png")); _evaluation = FALSE; if (!loggedIn) { ParameterList params; params.append("copyright", _Copyright); params.append("version", _Version); params.append("build", _Build.arg(__DATE__).arg(__TIME__)); params.append("setSearchPath", true); if (haveUsername) params.append("username", username); if (havePasswd) params.append("password", passwd); if (haveDatabaseURL) params.append("databaseURL", databaseURL); if (haveEnhancedAuth) params.append("enhancedAuth", _enhancedAuth); if (_evaluation) params.append("evaluation"); if ( (haveDatabaseURL) && (haveUsername) && (havePasswd) ) params.append("login"); login2 newdlg(0, "", TRUE); newdlg.set(params, _splash); if(newdlg.result() != QDialog::Accepted) { if (newdlg.exec() == QDialog::Rejected) return -1; else { databaseURL = newdlg._databaseURL; username = newdlg.username(); __password = newdlg.password(); } } } // TODO: can/should we compose the splash screen on the fly from parts? QList edition; edition << editionDesc( "Enterprise", ":/images/splashEnterprise.png", true, "SELECT fetchMetricText('Application') = 'Standard' AND COUNT(*) = 4" " FROM pkghead" " WHERE pkghead_name IN ('xtmfg', 'xtprjaccnt', 'asset', 'assetdepn');" ) << editionDesc( "Manufacturing", ":/images/splashMfgEdition.png", true, "SELECT fetchMetricText('Application') = 'Standard' AND COUNT(*) = 1" " FROM pkghead" " WHERE pkghead_name IN ('xtmfg');" ) << editionDesc( "Standard", ":/images/splashStdEdition.png", true, "SELECT fetchMetricText('Application') = 'Standard';" ) << editionDesc( "PostBooks", ":/images/splashPostBooks.png", true, "SELECT fetchMetricText('Application') = 'PostBooks';" ) ; XSqlQuery metric; int editionIdx; // we'll use this after the loop for (editionIdx = 0; editionIdx < edition.size(); editionIdx++) { metric.exec(edition[editionIdx].queryString); if (metric.first() && metric.value(0).toBool()) break; } if (editionIdx >= edition.size()) editionIdx = edition.size(); // default to PostBooks _splash->setPixmap(QPixmap(edition[editionIdx].splashResource)); _Name = _Name.arg(edition[editionIdx].editionName); if (edition[editionIdx].shouldCheckLicense) { _splash->showMessage(QObject::tr("Checking License Key"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); metric.exec("SELECT count(*) AS registered, (SELECT count(*) FROM pg_stat_activity WHERE datname=current_database()) AS total" " FROM pg_stat_activity, pg_locks" " WHERE((database=datid)" " AND (classid=datid)" " AND (objsubid=2)" " AND (procpid = pg_backend_pid()));"); int cnt = 50000; int tot = 50000; if(metric.first()) { cnt = metric.value("registered").toInt(); tot = metric.value("total").toInt(); } metric.exec("SELECT packageIsEnabled('drupaluserinfo') AS result;"); bool xtweb = false; if(metric.first()) xtweb = metric.value("result").toBool(); metric.exec("SELECT fetchMetricBool('ForceLicenseLimit') as metric_value;"); bool forceLimit = false; bool forced = false; if(metric.first()) forceLimit = metric.value("metric_value").toBool(); metric.exec("SELECT metric_value" " FROM metric" " WHERE(metric_name = 'RegistrationKey');"); bool checkPass = true; bool checkLock = false; bool expired = false; QString checkPassReason; QString rkey = ""; if(metric.first()) rkey = metric.value("metric_value").toString(); XTupleProductKey pkey(rkey); QString application; metric.exec("SELECT fetchMetricText('Application') as app;"); if(metric.first()) { application = metric.value("app").toString(); } if(pkey.valid() && (pkey.version() == 1 || pkey.version() == 2 || pkey.version() == 3)) { if(pkey.expiration() < QDate::currentDate()) { checkPass = false; checkPassReason = QObject::tr("

    Your license has expired."); if(!pkey.perpetual()) { int daysTo = pkey.expiration().daysTo(QDate::currentDate()); if(daysTo > 30) { checkLock = true; expired = true; checkPassReason = QObject::tr("

    Your xTuple license expired over 30 days ago, and this software will no longer function. Please contact xTuple immediately to reinstate your software."); } else checkPassReason = QObject::tr("

    Attention: Your xTuple license has expired, and in %1 days this software will cease to function. Please make arrangements for immediate payment").arg(30 - daysTo); } else expired = true; } else if(application == "PostBooks" && pkey.users() == 1) { if(pkey.users() < cnt) { checkPass = false; checkPassReason = QObject::tr("

    Multiple concurrent users of xTuple PostBooks require a license key. Please contact key@xtuple.com to request a free license key for your local installation, or sales@xtuple.com to purchase additional users in the xTuple Cloud Service.

    Thank you."); checkLock = forced = forceLimit; } } else if(pkey.users() != 0 && (pkey.users() < cnt || (!xtweb && (pkey.users() * 2 < tot)))) { checkPass = false; checkPassReason = QObject::tr("

    You have exceeded the number of allowed concurrent users for your license."); checkLock = forced = forceLimit; } else { int daysTo = QDate::currentDate().daysTo(pkey.expiration()); if(!pkey.perpetual() && daysTo <= 15) { checkPass = false; checkPassReason = QObject::tr("

    Please note: your xTuple license will expire in %1 days. You should already have received your renewal invoice; please contact xTuple at your earliest convenience.").arg(daysTo); } } } else { checkPass = false; checkPassReason = QObject::tr("

    The Registration key installed for this system does not appear to be valid."); } if(!checkPass) { _splash->hide(); if (expired) { registrationKeyDialog newdlg(0, "", TRUE); if(newdlg.exec() == -1) { QMessageBox::critical(0, QObject::tr("Registration Key"), checkPassReason); return 0; } } else if(checkLock) { QMessageBox::critical(0, QObject::tr("Registration Key"), checkPassReason); if(!forced) return 0; } else { if(QMessageBox::critical(0, QObject::tr("Registration Key"), QObject::tr("%1\n

    Would you like to continue anyway?").arg(checkPassReason), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return 0; } if(forced) checkPassReason.append(" FORCED!"); metric.exec("SELECT current_database() AS db," " fetchMetricText('DatabaseName') AS dbname," " fetchMetricText('remitto_name') AS name;"); QString db = ""; QString dbname = ""; QString name = ""; if(metric.first()) { db = metric.value("db").toString(); dbname = metric.value("dbname").toString(); name = metric.value("name").toString(); } QHttp *http = new QHttp(); QUrl url; url.setPath("/api/regviolation.php"); url.addQueryItem("key", QUrl::toPercentEncoding(rkey)); url.addQueryItem("error", QUrl::toPercentEncoding(checkPassReason)); url.addQueryItem("name", QUrl::toPercentEncoding(name)); url.addQueryItem("dbname", QUrl::toPercentEncoding(dbname)); url.addQueryItem("db", QUrl::toPercentEncoding(db)); url.addQueryItem("cnt", QString::number(cnt)); url.addQueryItem("tot", QString::number(tot)); url.addQueryItem("ver", _Version); http->setHost("www.xtuple.org"); http->get(url.toString()); if(forced) return 0; _splash->show(); } } metric.exec("SELECT metric_value" " FROM metric" " WHERE (metric_name = 'ServerVersion')" ); if(!metric.first() || (metric.value("metric_value").toString() != _dbVersion)) { bool disallowMismatch = false; metric.exec("SELECT metric_value FROM metric WHERE(metric_name='DisallowMismatchClientVersion')"); if(metric.first() && (metric.value("metric_value").toString() == "t")) disallowMismatch = true; _splash->hide(); //inserting temporary placeholder while checkForUpdates code is not being used int result; if(disallowMismatch) result = QMessageBox::warning( 0, QObject::tr("Version Mismatch"), QObject::tr("

    The version of the database you are connecting to is " "not the version this client was designed to work against. " "This client was designed to work against the database " "version %1. The system has been configured to disallow " "access in this case.

    Please contact your systems " "administrator.").arg(_dbVersion), QMessageBox::Ok | QMessageBox::Escape | QMessageBox::Default ); else result = QMessageBox::warning( 0, QObject::tr("Version Mismatch"), QObject::tr("

    The version of the database you are connecting to is " "not the version this client was designed to work against. " "This client was designed to work against the database " "version %1. If you continue some or all functionality may " "not work properly or at all. You may also cause other " "problems on the database.

    Do you want to continue " "anyway?").arg(_dbVersion), QMessageBox::Yes, QMessageBox::No | QMessageBox::Escape | QMessageBox::Default ); if(result != QMessageBox::Yes) return 0; //end temporary code //checkForUpdates newdlg(0,"", TRUE); //int result = newdlg.exec(); //if (result == QDialog::Rejected) // return 0; _splash->show(); } _splash->showMessage(QObject::tr("Loading Database Metrics"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _metrics = new Metrics(); _splash->showMessage(QObject::tr("Loading User Preferences"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _preferences = new Preferences(username); _splash->showMessage(QObject::tr("Loading User Privileges"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _privileges = new Privileges(); // Load the translator and set the locale from the User's preferences _splash->showMessage(QObject::tr("Loading Translation Dictionary"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); XSqlQuery langq("SELECT * " "FROM usr, locale LEFT OUTER JOIN" " lang ON (locale_lang_id=lang_id) LEFT OUTER JOIN" " country ON (locale_country_id=country_id) " "WHERE ( (usr_username=getEffectiveXtUser())" " AND (usr_locale_id=locale_id) );" ); if (langq.first()) { QStringList files; if (!langq.value("locale_lang_file").toString().isEmpty()) files << langq.value("locale_lang_file").toString(); QString langext; if (!langq.value("lang_abbr2").toString().isEmpty() && !langq.value("country_abbr").toString().isEmpty()) { langext = langq.value("lang_abbr2").toString() + "_" + langq.value("country_abbr").toString().toLower(); } else if (!langq.value("lang_abbr2").toString().isEmpty()) { langext = langq.value("lang_abbr2").toString(); } if(!langext.isEmpty()) { files << "qt"; files << "xTuple"; files << "openrpt"; files << "reports"; XSqlQuery pkglist("SELECT pkghead_name" " FROM pkghead" " WHERE packageIsEnabled(pkghead_name);"); while(pkglist.next()) files << pkglist.value("pkghead_name").toString(); } if (files.size() > 0) { QStringList notfound; QTranslator *translator = new QTranslator(&app); for (QStringList::Iterator fit = files.begin(); fit != files.end(); ++fit) { if (DEBUG) qDebug("looking for %s", (*fit).toAscii().data()); if (translator->load(translationFile(langext, *fit))) { app.installTranslator(translator); qDebug("installed %s", (*fit).toAscii().data()); translator = new QTranslator(&app); } else { notfound << *fit; } } if (! notfound.isEmpty() && !_preferences->boolean("IngoreMissingTranslationFiles")) QMessageBox::warning( 0, QObject::tr("Cannot Load Dictionary"), QObject::tr("

    The Translation Dictionaries %1 " "cannot be loaded. Reverting " "to the default dictionary." ) .arg(notfound.join(QObject::tr(", ")))); } /* set the locale to langabbr_countryabbr, langabbr, {lang# country#}, or lang#, depending on what information is available */ QString langAbbr = langq.value("lang_abbr2").toString(); QString cntryAbbr = langq.value("country_abbr").toString().toUpper(); if(cntryAbbr == "UK") cntryAbbr = "GB"; if (! langAbbr.isEmpty() && ! cntryAbbr.isEmpty()) QLocale::setDefault(QLocale(langAbbr + "_" + cntryAbbr)); else if (! langAbbr.isEmpty()) QLocale::setDefault(QLocale(langq.value("lang_abbr2").toString())); else if (langq.value("lang_qt_number").toInt() && langq.value("country_qt_number").toInt()) QLocale::setDefault( QLocale(QLocale::Language(langq.value("lang_qt_number").toInt()), QLocale::Country(langq.value("country_qt_number").toInt()))); else QLocale::setDefault(QLocale::system()); qDebug("Locale set to language %s and country %s", QLocale().languageToString(QLocale().language()).toAscii().data(), QLocale().countryToString(QLocale().country()).toAscii().data()); } else if (langq.lastError().type() != QSqlError::NoError) { systemError(0, langq.lastError().databaseText(), __FILE__, __LINE__); } qApp->processEvents(); QString key; // TODO: Add code to check a few locations - Hopefully done QString keypath; QString keyname; QString keytogether; #ifdef Q_WS_WIN keypath = _metrics->value("CCWinEncKey"); #elif defined Q_WS_MACX keypath = _metrics->value("CCMacEncKey"); #elif defined Q_WS_X11 keypath = _metrics->value("CCLinEncKey"); #endif if (keypath.isEmpty()) keypath = app.applicationDirPath(); if (! keypath.endsWith(QDir::separator())) keypath += QDir::separator(); keyname = _metrics->value("CCEncKeyName"); if (keyname.isEmpty()) { keyname = "xTuple.key"; keytogether = keypath + keyname; QFile kn(keytogether); if(!kn.exists()) keyname = "OpenMFG.key"; } keytogether = keypath + keyname; // qDebug("keytogether: %s", keytogether.toAscii().data()); QFile keyFile(keytogether); if(keyFile.exists()) { if(keyFile.open(QIODevice::ReadOnly)) { key = keyFile.readLine(1024); // strip off any newline characters key = key.trimmed(); } } omfgThis = 0; omfgThis = new GUIClient(databaseURL, username); omfgThis->_key = key; if (key.length() > 0) { _splash->showMessage(QObject::tr("Loading Database Encryption Metrics"), SplashTextAlignment, SplashTextColor); qApp->processEvents(); _metricsenc = new Metricsenc(key); } initializePlugin(_preferences, _metrics, _privileges, omfgThis->username(), omfgThis->workspace()); // START code for updating the locale settings if they haven't been already XSqlQuery lc; lc.exec("SELECT count(*) FROM metric WHERE metric_name='AutoUpdateLocaleHasRun';"); lc.first(); if(lc.value(0).toInt() == 0) { lc.exec("INSERT INTO metric (metric_name, metric_value) values('AutoUpdateLocaleHasRun', 't');"); lc.exec("SELECT locale_id from locale;"); while(lc.next()) { ParameterList params; params.append("mode","edit"); params.append("locale_id", lc.value(0)); sysLocale lcdlg; lcdlg.set(params); lcdlg.sSave(); } } // END code for updating locale settings QObject::connect(&app, SIGNAL(aboutToQuit()), &app, SLOT(closeAllWindows())); if (omfgThis->_singleWindow.isEmpty()) { omfgThis->setAttribute(Qt::WA_DeleteOnClose); omfgThis->show(); } // keep this synchronized with GUIClient and user.ui.h else if (omfgThis->_singleWindow == "woTimeClock") { ScriptToolbox sb(0); QWidget* newdlg = sb.openWindow("woTimeClock"); if(newdlg) { XMainWindow *mw = qobject_cast(newdlg); if(mw) { ParameterList params; params.append("captive"); mw->set(params); } newdlg->setAttribute(Qt::WA_DeleteOnClose); QObject::connect(omfgThis, SIGNAL(destroyed(QObject*)), &app, SLOT(quit())); newdlg->show(); } else { qDebug("Failed to initialize woTimeClock window."); return -2; } } // Check for the existance of a base currency, if none, one needs to // be selected or created XSqlQuery baseCurrency; baseCurrency.prepare("SELECT COUNT(*) AS count FROM curr_symbol WHERE curr_base=TRUE;"); baseCurrency.exec(); if(baseCurrency.first()) { if(baseCurrency.value("count").toInt() != 1) { currenciesDialog newdlg(0, "", TRUE); newdlg.exec(); baseCurrency.exec(); if(baseCurrency.first()) { if(baseCurrency.value("count").toInt() != 1) return -1; } else { systemError(0, baseCurrency.lastError().databaseText(), __FILE__, __LINE__); // need to figure out appropriate return code for this...unusual error return -1; } } } else { systemError(0, baseCurrency.lastError().databaseText(), __FILE__, __LINE__); // need to figure out appropriate return code for this...unusual error return -1; } if(!omfgThis->singleCurrency() && _metrics->value("GLCompanySize").toInt() == 0) { // Check for the gain/loss and discrep accounts main.prepare("SELECT COALESCE((SELECT TRUE" " FROM accnt, metric" " WHERE ((CAST(accnt_id AS text)=metric_value)" " AND (metric_name='CurrencyGainLossAccount'))), FALSE)" " AND COALESCE((SELECT TRUE" " FROM accnt, metric" " WHERE ((CAST(accnt_id AS text)=metric_value)" " AND (metric_name='GLSeriesDiscrepancyAccount'))), FALSE) AS result; "); main.exec(); if(main.first() && main.value("result").toBool() != true) QMessageBox::warning( omfgThis, QObject::tr("Additional Configuration Required"), QObject::tr("

    Your system is configured to use multiple Currencies, " "but the Currency Gain/Loss Account and/or the G/L Series " "Discrepancy Account does not appear to be configured " "correctly. You should define these Accounts in 'System | " "Configure Modules | Configure G/L...' before posting any " "transactions in the system.") ); } app.exec(); // Clean up delete _metrics; delete _preferences; delete _privileges; if (0 != _metricsenc) delete _metricsenc; return 0; } qt-client-4.1.0/guiclient/maintainBudget.cpp000066400000000000000000000346461217451700100210510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "maintainBudget.h" #include #include #include #include #include #include maintainBudget::maintainBudget(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { XSqlQuery maintainmaintainBudget; setupUi(this); connect(_accountsAdd, SIGNAL(clicked()), this, SLOT(sAccountsAdd())); connect(_accountsRemove, SIGNAL(clicked()), this, SLOT(sAccountsRemove())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_generate, SIGNAL(clicked()), this, SLOT(sGenerateTable())); connect(_periodsAll, SIGNAL(clicked()), this, SLOT(sPeriodsAll())); connect(_periodsInvert, SIGNAL(clicked()), this, SLOT(sPeriodsInvert())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_table, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(sValueChanged(QTableWidgetItem*))); _accounts->addColumn(QString(), -1, Qt::AlignLeft, true,"result"); _dirty = false; _budgheadid = -1; _mode = cNew; maintainmaintainBudget.exec("SELECT period_id, (formatDate(period_start) || '-' || formatDate(period_end)) AS f_name " " FROM period " "ORDER BY period_start DESC;" ); while(maintainmaintainBudget.next()) { XListBoxText *item = new XListBoxText(maintainmaintainBudget.value("f_name").toString(), maintainmaintainBudget.value("period_id").toInt()); _periods->addItem(dynamic_cast(item)); } } maintainBudget::~maintainBudget() { // no need to delete child widgets, Qt does it all for us } void maintainBudget::languageChange() { retranslateUi(this); } enum SetResponse maintainBudget::set(const ParameterList & pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("budghead_id", &valid); if(valid) { _budgheadid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if(valid) { if(param.toString() == "new") { _mode = cNew; _print->setEnabled(false); } else if(param.toString() == "edit") { _mode = cEdit; } else if(param.toString() == "view") { _mode = cView; _name->setReadOnly(true); _descrip->setReadOnly(true); _save->setEnabled(false); _save->hide(); _table->setSelectionMode(QAbstractItemView::NoSelection); _accountsAdd->setEnabled(false); _accountsRemove->setEnabled(false); _periodsAll->setEnabled(false); _periodsInvert->setEnabled(false); _periodsNone->setEnabled(false); _generate->setEnabled(false); } } return NoError; } void maintainBudget::sSave() { XSqlQuery maintainSave; if(_name->text().trimmed().isEmpty()) { QMessageBox::warning(this, tr("Cannot Save Budget"), tr("You must specify a name for this budget before saving.")); _name->setFocus(); return; } XSqlQuery qry; qry.prepare("SELECT budghead_id " "FROM budghead " "WHERE ((budghead_id != :budghead_id) " " AND (budghead_name = :budghead_name));"); qry.bindValue(":budghead_id", _budgheadid); qry.bindValue(":budghead_name", _name->text()); qry.exec(); if (qry.first()) { QMessageBox::warning(this, tr("Cannot Save Budget"), tr("The name is already in use by another budget.")); _name->setFocus(); return; } _save->setFocus(); if(cEdit == _mode) maintainSave.prepare("UPDATE budghead " " SET budghead_name=:name," " budghead_descrip=:descrip " " WHERE(budghead_id=:budghead_id);"); else if(cNew == _mode) { maintainSave.prepare("SELECT nextval('budghead_budghead_id_seq') AS result;"); maintainSave.exec(); if(maintainSave.first()) _budgheadid = maintainSave.value("result").toInt(); else { systemError(this, maintainSave.lastError().databaseText(), __FILE__, __LINE__); return; } maintainSave.prepare("INSERT INTO budghead" " (budghead_id, budghead_name, budghead_descrip) " "VALUES(:budghead_id, :name, :descrip);"); } maintainSave.bindValue(":budghead_id", _budgheadid); maintainSave.bindValue(":name", _name->text()); maintainSave.bindValue(":descrip", _descrip->text()); if(!maintainSave.exec()) { systemError(this, maintainSave.lastError().databaseText(), __FILE__, __LINE__); return; } // Delete the Budget Items and regenerate from table maintainSave.prepare("SELECT deleteBudgetItems(:budghead_id) AS result;"); maintainSave.bindValue(":budghead_id", _budgheadid); if(!maintainSave.exec()) { systemError(this, maintainSave.lastError().databaseText(), __FILE__, __LINE__); return; } maintainSave.prepare("SELECT setBudget(:budghead_id, :period_id, :accnt_id, :amount) AS result;"); for(int r = 0; r < _table->rowCount(); r++) { int accountid = _accountsRef.at(r); for(int c = 1; c < _table->columnCount(); c++) { if (_table->item(r, c)) { QString amount = _table->item(r, c)->text(); if(amount.isEmpty()) amount = "0.0"; maintainSave.bindValue(":budghead_id", _budgheadid); maintainSave.bindValue(":period_id", _periodsRef.at(c)); maintainSave.bindValue(":accnt_id", accountid); maintainSave.bindValue(":amount", amount.toDouble()); maintainSave.exec(); } else { maintainSave.bindValue(":budghead_id", _budgheadid); maintainSave.bindValue(":period_id", _periodsRef.at(c)); maintainSave.bindValue(":accnt_id", accountid); maintainSave.bindValue(":amount", 0.0); maintainSave.exec(); } } } _dirty = false; omfgThis->sBudgetsUpdated(_budgheadid, true); if(cNew == _mode) { _name->clear(); _descrip->clear(); _accounts->clear(); _periods->clearSelection(); _accountsRef.clear(); _periodsRef.clear(); _table->setRowCount(0); _table->setColumnCount(0); } else close(); } void maintainBudget::closeEvent( QCloseEvent * e ) { _close->setFocus(); if(!_dirty) { e->accept(); return; } switch(QMessageBox::question(this, tr("Unsaved Changes"), tr("

    The document has been changed " "since the last save.
    Do you want " "to save your changes?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save)) { case QMessageBox::Save: sSave(); e->accept(); break; case QMessageBox::Discard: e->accept(); break; case QMessageBox::Cancel: default: // just for sanity e->ignore(); break; } } void maintainBudget::sAccountsAdd() { XSqlQuery maintainAccountsAdd; ParameterList params; params.append("type", (GLCluster::cAsset | GLCluster::cLiability | GLCluster::cExpense | GLCluster::cRevenue | GLCluster::cEquity)); params.append("ignoreCompany"); accountList newdlg(this); newdlg.setAttribute(Qt::WA_DeleteOnClose, false); newdlg.xtreewidget()->setSelectionMode(QAbstractItemView::ExtendedSelection); newdlg.set(params); int accnt_id=newdlg.exec(); if (accnt_id == -1) return; QList selected = newdlg.xtreewidget()->selectedItems(); for (int i = 0; i < selected.size(); i++) { int accntid = selected[i]->id(); if (_prjid != -1) { maintainAccountsAdd.prepare("SELECT getPrjAccntId(:prj_id,:accnt_id) AS accnt_id"); maintainAccountsAdd.bindValue(":prj_id", _prjid); maintainAccountsAdd.bindValue(":accnt_id", accntid); maintainAccountsAdd.exec(); if (maintainAccountsAdd.first()) accntid = maintainAccountsAdd.value("accnt_id").toInt(); } if (_accountsRef.contains(accntid)) continue; maintainAccountsAdd.prepare("SELECT formatGLAccountLong(:accnt_id) AS result;"); maintainAccountsAdd.bindValue(":accnt_id", accntid); maintainAccountsAdd.exec(); if(maintainAccountsAdd.first()) { new XTreeWidgetItem(_accounts, accntid, maintainAccountsAdd.value("result")); _accountsRef.append(accntid); } } } void maintainBudget::sAccountsRemove() { QList selected = _accounts->selectedItems(); for (int i = 0; i < selected.count(); i++) _accounts->takeTopLevelItem(_accounts->indexOfTopLevelItem(selected[i])); sGenerateTable(); } void maintainBudget::sPeriodsAll() { _periods->selectAll(); } void maintainBudget::sPeriodsInvert() { for (int row = 0; row < _periods->count(); row++) _periods->setCurrentItem(_periods->item(row), QItemSelectionModel::Toggle); } void maintainBudget::sValueChanged(QTableWidgetItem * /* item */) { if (_mode != cView) _dirty = true; } void maintainBudget::sGenerateTable() { XSqlQuery maintainGenerateTable; _generate->setFocus(); if(_dirty) { switch(QMessageBox::question(this, tr("Unsaved Changes"), tr("

    The document has been changed " "since the last save.
    Do you want " "to save your changes?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save)) { case QMessageBox::Save: sSave(); break; case QMessageBox::Discard: break; case QMessageBox::Cancel: default: // just for sanity return; break; } } _dirty = false; _accountsRef.clear(); _periodsRef.clear(); _table->setRowCount(0); _table->setColumnCount(0); QStringList accounts; QStringList periods; for (int row = 0; row < _accounts->topLevelItemCount(); row++) { XTreeWidgetItem* item = _accounts->topLevelItem(row); _accountsRef.append(item->id()); accounts.append(item->text(0)); } QListperiodlist = _periods->selectedItems(); for (int i = 0; i < periodlist.size(); i++) { XListBoxText *item = dynamic_cast(periodlist.at(i)); if (item) { _periodsRef.prepend(item->id()); periods.prepend(item->text()); } } if (periodlist.isEmpty()) { QMessageBox::critical(this, tr("Incomplete criteria"), tr("

    Please select at least one Period " "before generating the table." ) ); return; } _periodsRef.prepend(-1); periods.prepend(tr("Account")); _table->setColumnCount(periods.count()); _table->setHorizontalHeaderLabels(periods); periods.clear(); for(int i = 0; i < _periodsRef.count(); i++) { if (_periodsRef.at(i) != -1) periods.append(QString::number(_periodsRef.at(i))); } QString sql = "SELECT budgitem_period_id, budgitem_amount" " FROM budgitem" " WHERE ((budgitem_accnt_id=:accnt_id)" " AND (budgitem_budghead_id=:budghead_id)" " AND (budgitem_period_id IN (" + periods.join(",") + ")) ); "; maintainGenerateTable.prepare(sql); _table->setRowCount(_accountsRef.count()); _table->setColumnCount(periods.size() + 1); // + 1 to hold account number for(int i = 0; i < _accountsRef.count(); i++) { QTableWidgetItem *item = new QTableWidgetItem(); _table->setItem(i, 0, item); item->setText(accounts.at(i)); maintainGenerateTable.bindValue(":accnt_id", _accountsRef.at(i)); maintainGenerateTable.bindValue(":budghead_id", _budgheadid); maintainGenerateTable.exec(); while(maintainGenerateTable.next()) { item = new QTableWidgetItem(maintainGenerateTable.value("budgitem_amount").toString()); _table->setItem(i, _periodsRef.indexOf(maintainGenerateTable.value("budgitem_period_id").toInt()), item); } _table->item(i, 0)->setFlags(_table->item(i, 0)->flags() & (~Qt::ItemIsEditable)); } _dirty = false; } void maintainBudget::populate() { XSqlQuery maintainpopulate; maintainpopulate.prepare("SELECT budghead_name, budghead_descrip" " FROM budghead" " WHERE(budghead_id=:budghead_id);"); maintainpopulate.bindValue(":budghead_id", _budgheadid); maintainpopulate.exec(); if(maintainpopulate.first()) { _name->setText(maintainpopulate.value("budghead_name").toString()); _descrip->setText(maintainpopulate.value("budghead_descrip").toString()); maintainpopulate.prepare("SELECT DISTINCT budgitem_accnt_id, formatGLAccountLong(budgitem_accnt_id) AS result" " FROM budgitem JOIN accnt ON (accnt_id=budgitem_accnt_id)" " WHERE(budgitem_budghead_id=:budghead_id)" " ORDER BY result;"); maintainpopulate.bindValue(":budghead_id", _budgheadid); maintainpopulate.exec(); while(maintainpopulate.next()) /*XTreeWidgetItem *item =*/ new XTreeWidgetItem(_accounts, maintainpopulate.value("budgitem_accnt_id").toInt(), maintainpopulate.value("result")); maintainpopulate.prepare("SELECT DISTINCT budgitem_period_id" " FROM budgitem" " WHERE(budgitem_budghead_id=:budghead_id)" " ORDER BY budgitem_period_id;"); maintainpopulate.bindValue(":budghead_id", _budgheadid); maintainpopulate.exec(); while(maintainpopulate.next()) { for (int row = 0; _periods->item(row); row++) { XListBoxText* item = (XListBoxText*)_periods->item(row); if(item->id() == maintainpopulate.value("budgitem_period_id").toInt()) { _periods->setCurrentItem(item, QItemSelectionModel::Select); break; } } } sGenerateTable(); } } void maintainBudget::sPrint() { ParameterList params; params.append("budghead_id", _budgheadid); orReport report("Budget", params); if(report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/maintainBudget.h000066400000000000000000000030721217451700100205030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MAINTAINBUDGET_H #define MAINTAINBUDGET_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_maintainBudget.h" class QTableWidgetItem; class maintainBudget : public XWidget, public Ui::maintainBudget { Q_OBJECT public: maintainBudget(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~maintainBudget(); Q_INVOKABLE int projectId() { return _prjid; } Q_INVOKABLE void setProjectId(int p) { _prjid = p; } public slots: virtual enum SetResponse set(const ParameterList &); virtual void sAccountsAdd(); virtual void sAccountsRemove(); virtual void sGenerateTable(); virtual void sPeriodsAll(); virtual void sPeriodsInvert(); virtual void sPrint(); virtual void sSave(); virtual void sValueChanged(QTableWidgetItem *item); protected: virtual void closeEvent( QCloseEvent * e ); virtual void populate(); protected slots: virtual void languageChange(); private: int _budgheadid; bool _dirty; int _mode; int _prjid; QList _accountsRef; QList _periodsRef; }; #endif // MAINTAINBUDGET_H qt-client-4.1.0/guiclient/maintainBudget.ui000066400000000000000000000254741217451700100207030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. maintainBudget 0 0 800 600 Maintain Budget Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Table Parameters 5 5 Accounts: false false false false Add Remove Qt::Vertical QSizePolicy::MinimumExpanding 20 0 Accounting Periods: 0 0 QAbstractItemView::MultiSelection Select All Invert Unselect All Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 40 20 Generate Table Close &Save &Print Qt::Vertical QSizePolicy::MinimumExpanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 XTreeWidget QTreeWidget

    xtreewidget.h
    _name _descrip _accounts _accountsAdd _periods _periodsAll _periodsInvert _periodsNone _generate _table _close _save _print _close clicked() maintainBudget close() 20 20 20 20 _periodsNone clicked() _periods clearSelection() 20 20 20 20 qt-client-4.1.0/guiclient/maintainItemCosts.cpp000066400000000000000000000260561217451700100215450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "maintainItemCosts.h" #include #include #include #include #include #include #include "dspItemCostDetail.h" #include "mqlutil.h" #include "itemCost.h" maintainItemCosts::maintainItemCosts(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_item, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_itemcost, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_itemcost, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_itemcost, SIGNAL(itemSelectionChanged()), this, SLOT(sSelectionChanged())); _itemcost->addColumn(tr("Element"), -1, Qt::AlignLeft, true, "costelem_type"); _itemcost->addColumn(tr("Lower"), _costColumn, Qt::AlignCenter, true, "itemcost_lowlevel" ); _itemcost->addColumn(tr("Std. Cost"), _costColumn, Qt::AlignRight, true, "itemcost_stdcost" ); _itemcost->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft,true, "baseCurr" ); _itemcost->addColumn(tr("Posted"), _dateColumn, Qt::AlignCenter, true, "itemcost_posted" ); _itemcost->addColumn(tr("Act. Cost"), _costColumn, Qt::AlignRight, true, "itemcost_actcost" ); _itemcost->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft,true, "costCurr" ); _itemcost->addColumn(tr("Updated"), _dateColumn, Qt::AlignCenter, true, "itemcost_updated" ); if (omfgThis->singleCurrency()) { _itemcost->hideColumn(3); _itemcost->hideColumn(6); } if (_privileges->check("CreateCosts")) { connect(_item, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); _new->setEnabled(true); } } maintainItemCosts::~maintainItemCosts() { // no need to delete child widgets, Qt does it all for us } void maintainItemCosts::languageChange() { retranslateUi(this); } enum SetResponse maintainItemCosts::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(TRUE); } return NoError; } void maintainItemCosts::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { if (((XTreeWidgetItem *)pSelected)->id() == -1) return; QAction *menuItem; if (pSelected->text(1) == "No") { if (pSelected->text(0) == "Direct Labor") { menuItem = pMenu->addAction(tr("Update Actual Cost..."), this, SLOT(sUpdateDirectLabor())); menuItem->setEnabled(_privileges->check("UpdateActualCosts")); } else if (pSelected->text(0) == "Overhead") { menuItem = pMenu->addAction(tr("Update Actual Cost..."), this, SLOT(sUpdateOverhead())); menuItem->setEnabled(_privileges->check("UpdateActualCosts")); } else if (pSelected->text(0) == "Machine Overhead") { menuItem = pMenu->addAction(tr("Update Actual Cost..."), this, SLOT(sUpdateMachineOverhead())); menuItem->setEnabled(_privileges->check("UpdateActualCosts")); } } else { pMenu->addAction(tr("View Costing Detail..."), this, SLOT(sViewDetail())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Update Actual Cost..."), this, SLOT(sUpdateDetail())); menuItem->setEnabled(_privileges->check("UpdateActualCosts")); } if (((XTreeWidgetItem *)pSelected)->altId() == 0) { menuItem = pMenu->addAction(tr("Delete Cost..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("DeleteCosts")); } menuItem = pMenu->addAction(tr("Post Actual Cost to Standard..."), this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostActualCosts")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit Actual Cost..."), this, SLOT(sEnterActualCost())); menuItem->setEnabled(_privileges->check("EnterActualCosts")); menuItem = pMenu->addAction(tr("New Actual Cost..."), this, SLOT(sCreateUserCost())); menuItem->setEnabled(_privileges->check("CreateCosts")); } void maintainItemCosts::sViewDetail() { ParameterList params; params.append("itemcost_id", _itemcost->id()); params.append("run"); dspItemCostDetail *newdlg = new dspItemCostDetail(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void maintainItemCosts::sUpdateDetail() { XSqlQuery maintainUpdateDetail; QString cost = _itemcost->currentItem()->text(0); maintainUpdateDetail.prepare("SELECT updateCost(:item_id, :cost, TRUE, lowerCost(:item_id, :cost));"); maintainUpdateDetail.bindValue(":item_id", _item->id()); maintainUpdateDetail.bindValue(":cost", cost); maintainUpdateDetail.exec(); sFillList(); } void maintainItemCosts::sUpdateDirectLabor() { XSqlQuery maintainUpdateDirectLabor; maintainUpdateDirectLabor.prepare("SELECT updateCost(:item_id, 'Direct Labor', FALSE, directLaborCost(:item_id));"); maintainUpdateDirectLabor.bindValue(":item_id", _item->id()); maintainUpdateDirectLabor.exec(); sFillList(); } void maintainItemCosts::sUpdateOverhead() { XSqlQuery maintainUpdateOverhead; maintainUpdateOverhead.prepare("SELECT updateCost(:item_id, 'Overhead', FALSE, overheadCost(:item_id));"); maintainUpdateOverhead.bindValue(":item_id", _item->id()); maintainUpdateOverhead.exec(); sFillList(); } void maintainItemCosts::sUpdateMachineOverhead() { XSqlQuery maintainUpdateMachineOverhead; maintainUpdateMachineOverhead.prepare("SELECT updateCost(:item_id, 'Machine Overhead', FALSE, machineOverheadCost(:item_id));"); maintainUpdateMachineOverhead.bindValue(":item_id", _item->id()); maintainUpdateMachineOverhead.exec(); sFillList(); } void maintainItemCosts::sPost() { XSqlQuery maintainPost; maintainPost.prepare("SELECT postCost(:item_id);"); maintainPost.bindValue(":item_id", _itemcost->id()); maintainPost.exec(); if (maintainPost.lastError().type() != QSqlError::NoError) systemError(this, maintainPost.lastError().databaseText(), __FILE__, __LINE__); sFillList(); } void maintainItemCosts::sDelete() { XSqlQuery maintainDelete; double stdCost = 0.0; maintainDelete.prepare( "SELECT itemcost_stdcost " "FROM itemcost " "WHERE (itemcost_id=:itemcost_id);" ); maintainDelete.bindValue(":itemcost_id", _itemcost->id()); maintainDelete.exec(); if (maintainDelete.first()) stdCost = maintainDelete.value("itemcost_stdcost").toDouble(); else if (maintainDelete.lastError().type() != QSqlError::NoError) { systemError(this, maintainDelete.lastError().databaseText(), __FILE__, __LINE__); return; } if (stdCost > 0) { if (QMessageBox::warning(this, tr("Deletion of Costing Elements"), tr("

    Before a Costing Element is deleted, the " "system will set the Actual Cost value to 0. " "This helps ensure Inventory is valued " "correctly. Once the 0 value Actual Cost is " "posted to Standard, the Costing Element will " "be removed."), QMessageBox::Ok | QMessageBox::Default, QMessageBox::Cancel) == QMessageBox::Cancel) return; maintainDelete.prepare("SELECT updateCost(:itemcost_id, 0);"); } else { maintainDelete.prepare( "DELETE FROM itemcost WHERE (itemcost_id=:itemcost_id);" ); } maintainDelete.bindValue(":itemcost_id", _itemcost->id()); maintainDelete.exec(); if (maintainDelete.lastError().type() != QSqlError::NoError) systemError(this, maintainDelete.lastError().databaseText(), __FILE__, __LINE__); sFillList(); } void maintainItemCosts::sEnterActualCost() { ParameterList params; params.append("itemcost_id", _itemcost->id()); params.append("mode", "edit"); itemCost newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec()) sFillList(); } void maintainItemCosts::sCreateUserCost() { ParameterList params; params.append("item_id", _item->id()); params.append("mode", "new"); itemCost newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec()) sFillList(); } void maintainItemCosts::sNew() { sCreateUserCost(); } void maintainItemCosts::sEdit() { sEnterActualCost(); } void maintainItemCosts::sFillList() { if (_item->isValid()) { double standardCost = 0.0; double actualCostBase = 0.0; double actualCostLocal = 0.0; MetaSQLQuery mql = mqlLoad("itemCost", "list"); ParameterList params; params.append("item_id", _item->id()); params.append("error", tr("!ERROR!")); params.append("never", tr("Never")); XSqlQuery qry = mql.toQuery(params); _itemcost->populate(qry, TRUE); bool multipleCurrencies = false; int firstCurrency = 0; bool baseKnown = true; if (qry.first()) { firstCurrency = qry.value("itemcost_curr_id").toInt(); do { standardCost += qry.value("itemcost_stdcost").toDouble(); if (qry.value("itemcost_actcost").isNull()) baseKnown = false; else actualCostBase += qry.value("actcostBase").toDouble(); actualCostLocal += qry.value("itemcost_actcost").toDouble(); if (! multipleCurrencies && qry.value("itemcost_curr_id").toInt() != firstCurrency) multipleCurrencies = true; } while (qry.next()); } XSqlQuery convert; double actualCost = 0; if (multipleCurrencies) { actualCost = actualCostBase; convert.prepare("SELECT currConcat(baseCurrId()) AS baseConcat, " " currConcat(baseCurrId()) AS currConcat;"); } else { actualCost = actualCostLocal; baseKnown = true; // not necessarily but we can trust actualCost convert.prepare("SELECT currConcat(baseCurrId()) AS baseConcat, " " currConcat(:firstCurrency) AS currConcat;" ); convert.bindValue(":firstCurrency", firstCurrency); } convert.exec(); if (convert.first()) new XTreeWidgetItem(_itemcost, _itemcost->topLevelItem(_itemcost->topLevelItemCount() - 1), -1, QVariant(tr("Totals")), "", formatCost(standardCost), convert.value("baseConcat"), "", baseKnown ? formatCost(actualCost) : tr("?????"), convert.value("currConcat")); else if (convert.lastError().type() != QSqlError::NoError) systemError(this, convert.lastError().databaseText(), __FILE__, __LINE__); } else _itemcost->clear(); } void maintainItemCosts::sSelectionChanged() { bool yes = (_itemcost->id() != -1); if (_privileges->check("EnterActualCosts")) _edit->setEnabled(yes); if (_privileges->check("DeleteCosts")) _delete->setEnabled(yes); } qt-client-4.1.0/guiclient/maintainItemCosts.h000066400000000000000000000027651217451700100212130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MAINTAINITEMCOSTS_H #define MAINTAINITEMCOSTS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_maintainItemCosts.h" class maintainItemCosts : public XWidget, public Ui::maintainItemCosts { Q_OBJECT public: maintainItemCosts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~maintainItemCosts(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sViewDetail(); virtual void sUpdateDetail(); virtual void sUpdateDirectLabor(); virtual void sUpdateOverhead(); virtual void sUpdateMachineOverhead(); virtual void sPost(); virtual void sDelete(); virtual void sEnterActualCost(); virtual void sCreateUserCost(); virtual void sNew(); virtual void sEdit(); virtual void sFillList(); virtual void sSelectionChanged(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // MAINTAINITEMCOSTS_H qt-client-4.1.0/guiclient/maintainItemCosts.ui000066400000000000000000000144451217451700100213770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. maintainItemCosts 0 0 685 319 Maintain Item Costs 7 0 Qt::Horizontal QSizePolicy::Expanding 20 0 &Close Qt::Vertical QSizePolicy::Preferred 20 0 0 0 0 0 20 Costing &Elements: _itemcost 7 0 0 false &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 ItemCluster QWidget

    itemcluster.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _item _itemcost _new _edit _delete _close parameter.h _close clicked() maintainItemCosts close() 20 20 20 20 _itemcost itemSelected(int) _edit animateClick() 20 20 20 20 qt-client-4.1.0/guiclient/maintainShipping.cpp000066400000000000000000000270031217451700100214050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "maintainShipping.h" #include #include #include #include #include #include "distributeInventory.h" #include "mqlutil.h" #include "shippingInformation.h" #include "shipOrder.h" #include "salesOrder.h" #include "salesOrderItem.h" #include "transferOrder.h" #include "transferOrderItem.h" #include "printShippingForm.h" #include "issueToShipping.h" #include "storedProcErrorLookup.h" maintainShipping::maintainShipping(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_ship, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _ship->setRootIsDecorated(TRUE); _ship->addColumn(tr("Shipment #"), _orderColumn, Qt::AlignLeft, true, "shiphead_number"); _ship->addColumn(tr("Order Type"), _statusColumn, Qt::AlignLeft, true, "ordertype"); _ship->addColumn(tr("Order/Line #"), _itemColumn, Qt::AlignRight, true, "linenumber"); _ship->addColumn(tr("Printed"), _dateColumn, Qt::AlignCenter,true, "sfstatus"); _ship->addColumn(tr("Cust./Item #"), _itemColumn, Qt::AlignLeft, true, "dest"); _ship->addColumn(tr("Name/Description"), -1, Qt::AlignLeft, true, "description"); _ship->addColumn(tr("Ship Via"), _itemColumn, Qt::AlignLeft, true, "shiphead_shipvia"); _ship->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name"); _ship->addColumn(tr("Qty. At Ship"), _qtyColumn, Qt::AlignRight, true, "shipqty"); _ship->addColumn(tr("Value At Ship"), _moneyColumn, Qt::AlignRight, true, "shipvalue"); _ship->addColumn(tr("Hold Type"), _statusColumn, Qt::AlignCenter,true, "holdtype"); } maintainShipping::~maintainShipping() { // no need to delete child widgets, Qt does it all for us } void maintainShipping::languageChange() { retranslateUi(this); } void maintainShipping::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected) { QAction *menuItem; if (selected->text(0) != "") _itemtype = 1; else if (selected->text(2) != "") _itemtype = 2; else _itemtype = 3; switch (_itemtype) { case 1: menuItem = pMenu->addAction("Shipping Information...", this, SLOT(sShippingInformation())); menuItem->setEnabled(_privileges->check("EnterShippingInformation")); menuItem = pMenu->addAction("Return ALL Stock Issued to Order...", this, SLOT(sReturnAllOrderStock())); menuItem->setEnabled(_privileges->check("ReturnStockFromShipping")); menuItem = pMenu->addAction("View Order...", this, SLOT(sViewOrder())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction("Print Shipping Form...", this, SLOT(sPrintShippingForm())); menuItem->setEnabled(_privileges->check("PrintBillsOfLading")); if (selected->text(6) != "S") { menuItem = pMenu->addAction("Ship Order...", this, SLOT(sShipOrder())); menuItem->setEnabled(_privileges->check("ShipOrders")); } break; case 2: menuItem = pMenu->addAction("Issue Additional Stock to Order Line...", this, SLOT(sIssueStock())); menuItem->setEnabled(_privileges->check("IssueStockToShipping")); menuItem = pMenu->addAction("Return ALL Stock Issued to Order Line...", this, SLOT(sReturnAllLineStock())); menuItem->setEnabled(_privileges->check("ReturnStockFromShipping")); menuItem = pMenu->addAction("View Order Line...", this, SLOT(sViewLine())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); break; case 3: menuItem = pMenu->addAction("Return ALL of this Stock Issued in this Transaction...", this, SLOT(sReturnAllStock())); menuItem->setEnabled(_privileges->check("ReturnStockFromShipping")); break; } } void maintainShipping::sShippingInformation() { ParameterList params; params.append("shiphead_id", _ship->id()); shippingInformation newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void maintainShipping::sShipOrder() { ParameterList params; params.append("shiphead_id", _ship->id()); shipOrder newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void maintainShipping::sReturnAllOrderStock() { XSqlQuery maintainReturnAllOrderStock; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); maintainReturnAllOrderStock.exec("BEGIN"); maintainReturnAllOrderStock.prepare("SELECT returnCompleteShipment(:ship_id) AS result;"); maintainReturnAllOrderStock.bindValue(":ship_id", _ship->id()); maintainReturnAllOrderStock.exec(); if (maintainReturnAllOrderStock.first()) { int result = maintainReturnAllOrderStock.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("returnCompleteShipment", result), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Return Canceled") ); return; } maintainReturnAllOrderStock.exec("COMMIT;"); sFillList(); } else if (maintainReturnAllOrderStock.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, maintainReturnAllOrderStock.lastError().databaseText(), __FILE__, __LINE__); return; } } void maintainShipping::sViewOrder() { XSqlQuery maintainViewOrder; maintainViewOrder.prepare( "SELECT shiphead_order_id, shiphead_order_type " "FROM shiphead " "WHERE (shiphead_id=:shiphead_id);" ); maintainViewOrder.bindValue(":shiphead_id", _ship->id()); maintainViewOrder.exec(); if (maintainViewOrder.first()) { if (maintainViewOrder.value("shiphead_order_type").toString() == "SO") salesOrder::viewSalesOrder(maintainViewOrder.value("shiphead_order_id").toInt()); else if (maintainViewOrder.value("shiphead_order_type").toString() == "TO") transferOrder::viewTransferOrder(maintainViewOrder.value("shiphead_order_id").toInt()); } else if (maintainViewOrder.lastError().type() != QSqlError::NoError) { systemError(this, maintainViewOrder.lastError().databaseText(), __FILE__, __LINE__); return; } } void maintainShipping::sPrintShippingForm() { ParameterList params; params.append("shiphead_id", _ship->id()); printShippingForm newdlg(this); newdlg.set(params); newdlg.exec(); } void maintainShipping::sIssueStock() { ParameterList params; if (_ship->currentItem()->rawValue("ordertype").toString() == "SO") params.append("sohead_id", _ship->id()); else if (_ship->currentItem()->rawValue("ordertype").toString() == "TO") params.append("tohead_id", _ship->id()); issueToShipping *newdlg = new issueToShipping(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void maintainShipping::sReturnAllLineStock() { XSqlQuery maintainReturnAllLineStock; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); maintainReturnAllLineStock.exec("BEGIN"); maintainReturnAllLineStock.prepare("SELECT returnItemShipments(:ship_id) AS result;"); maintainReturnAllLineStock.bindValue(":ship_id", _ship->altId()); maintainReturnAllLineStock.exec(); if (maintainReturnAllLineStock.first()) { int result = maintainReturnAllLineStock.value("result").toInt(); if (maintainReturnAllLineStock.value("result").toInt() < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("returnItemShipments", result), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Return Canceled") ); return; } maintainReturnAllLineStock.exec("COMMIT;"); sFillList(); } else if (maintainReturnAllLineStock.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, maintainReturnAllLineStock.lastError().databaseText(), __FILE__, __LINE__); return; } } void maintainShipping::sViewLine() { ParameterList params; params.append("mode", "view"); if (_ship->currentItem()->rawValue("ordertype").toString() == "SO") { params.append("soitem_id", _ship->altId()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } if (_ship->currentItem()->rawValue("ordertype").toString() == "TO") { params.append("toitem_id", _ship->altId()); transferOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } } void maintainShipping::sReturnAllStock() { XSqlQuery maintainReturnAllStock; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); maintainReturnAllStock.exec("BEGIN"); maintainReturnAllStock.prepare("SELECT returnShipmentTransaction(:ship_id) AS result;"); maintainReturnAllStock.bindValue(":ship_id", _ship->altId()); maintainReturnAllStock.exec(); if (maintainReturnAllStock.first()) { int result = maintainReturnAllStock.value("result").toInt(); if (maintainReturnAllStock.value("result").toInt() < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("returnShipmentTransaction", result), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Return Canceled") ); return; } maintainReturnAllStock.exec("COMMIT;"); sFillList(); } else if (maintainReturnAllStock.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, maintainReturnAllStock.lastError().databaseText(), __FILE__, __LINE__); return; } } void maintainShipping::sFillList() { XSqlQuery maintainFillList; ParameterList params; if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_warehouse->isSelected()) params.append("warehous_id", _warehouse->id()); params.append("notPrinted", tr("No")); params.append("dirty", tr("Dirty")); params.append("printed", tr("Yes")); MetaSQLQuery mql = mqlLoad("maintainShipping", "detail"); maintainFillList = mql.toQuery(params); maintainFillList.exec(); _ship->populate(maintainFillList, true); if (maintainFillList.lastError().type() != QSqlError::NoError) { systemError(this, maintainFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void maintainShipping::sPrint() { ParameterList params; if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_warehouse->isSelected()) params.append("warehous_id", _warehouse->id()); params.append("notPrinted", tr("No")); params.append("dirty", tr("Dirty")); params.append("printed", tr("Yes")); params.append("includeFormatted"); orReport report("ShipmentsPending", params); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/maintainShipping.h000066400000000000000000000025651217451700100210600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MAINTAINSHIPPING_H #define MAINTAINSHIPPING_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_maintainShipping.h" class maintainShipping : public XWidget, public Ui::maintainShipping { Q_OBJECT public: maintainShipping(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~maintainShipping(); public slots: virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem * selected ); virtual void sShippingInformation(); virtual void sShipOrder(); virtual void sReturnAllOrderStock(); virtual void sViewOrder(); virtual void sPrintShippingForm(); virtual void sIssueStock(); virtual void sReturnAllLineStock(); virtual void sViewLine(); virtual void sReturnAllStock(); virtual void sFillList(); virtual void sPrint(); protected slots: virtual void languageChange(); private: int _itemtype; }; #endif // MAINTAINSHIPPING_H qt-client-4.1.0/guiclient/maintainShipping.ui000066400000000000000000000111301217451700100212320ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. maintainShipping 0 0 800 600 Maintain Shipping Qt::StrongFocus false Qt::Horizontal QSizePolicy::Expanding 20 20 &Close &Query &Print Qt::Vertical 20 0 0 1 QFrame::NoFrame QFrame::Plain 0 0 Stock at Shipping: _ship true WarehouseGroup QGroupBox
    warehousegroup.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _warehouse _close _close clicked() maintainShipping close() 633 32 20 20
    qt-client-4.1.0/guiclient/massExpireComponent.cpp000066400000000000000000000052571217451700100221150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "massExpireComponent.h" #include #include massExpireComponent::massExpireComponent(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _captive = FALSE; _original->setType(ItemLineEdit::cGeneralComponents); _expireAsOf->setNullString(tr("Immediate")); _expireAsOf->setNullDate(omfgThis->dbDate()); _expireAsOf->setAllowNullDate(true); _expireAsOf->setNull(); connect(_expire, SIGNAL(clicked()), this, SLOT(sExpire())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); } massExpireComponent::~massExpireComponent() { // no need to delete child widgets, Qt does it all for us } void massExpireComponent::languageChange() { retranslateUi(this); } enum SetResponse massExpireComponent::set(const ParameterList &pParams) { XWidget::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _original->setId(param.toInt()); return NoError; } void massExpireComponent::sExpire() { XSqlQuery massExpire; if ( (_original->isValid()) && (_expireAsOf->isValid()) ) { if (_metrics->boolean("RevControl")) { massExpire.prepare("SELECT * " "FROM bomitem, rev " "WHERE ( (bomitem_rev_id=rev_id) " "AND (rev_status='P') " "AND (bomitem_item_id=:item_id) ) " "LIMIT 1;"); massExpire.bindValue(":item_id", _original->id()); massExpire.exec(); if (massExpire.first()) QMessageBox::information( this, tr("Mass Expire"), tr("

    This process will only affect active revisions. " "Items on pending revisions must be expired manually.") ); } QSqlQuery expire; if (_expireAsOf->isNull()) expire.prepare("SELECT massExpireBomitem(:item_id, CURRENT_DATE, :ecn);"); else expire.prepare("SELECT massExpireBomitem(:item_id, :expire_date, :ecn);"); expire.bindValue(":item_id", _original->id()); expire.bindValue(":expire_date", _expireAsOf->date()); expire.bindValue(":ecn", _ecn->text()); expire.exec(); if (_captive) close(); { _close->setText(tr("&Close")); _original->setId(-1); _ecn->clear(); _original->setFocus(); } } } qt-client-4.1.0/guiclient/massExpireComponent.h000066400000000000000000000020441217451700100215510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MASSEXPIRECOMPONENT_H #define MASSEXPIRECOMPONENT_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_massExpireComponent.h" class massExpireComponent : public XWidget, public Ui::massExpireComponent { Q_OBJECT public: massExpireComponent(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~massExpireComponent(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sExpire(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // MASSEXPIRECOMPONENT_H qt-client-4.1.0/guiclient/massExpireComponent.ui000066400000000000000000000111051217451700100217350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. massExpireComponent 0 0 461 160 Mass Expire Component Item &Expire as of: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _expireAsOf EC&N #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ecn Qt::Horizontal QSizePolicy::Expanding 137 20 &Cancel &Expire true Qt::Vertical QSizePolicy::Expanding 20 20 DLineEdit QWidget

    datecluster.h
    1 ItemCluster QWidget
    itemcluster.h
    1
    XLineEdit QLineEdit
    xlineedit.h
    1
    _original _expireAsOf _ecn _expire _close parameter.h qstatusbar.h _close clicked() massExpireComponent close() 20 20 20 20 qt-client-4.1.0/guiclient/massReplaceComponent.cpp000066400000000000000000000066601217451700100222330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "massReplaceComponent.h" #include #include #include #include "storedProcErrorLookup.h" massReplaceComponent::massReplaceComponent(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_replace, SIGNAL(clicked()), this, SLOT(sReplace())); _captive = FALSE; _original->setType(ItemLineEdit::cGeneralComponents); _replacement->setType(ItemLineEdit::cGeneralComponents); _effective->setNullString(tr("Immediate")); _effective->setAllowNullDate(TRUE); _effective->setNull(); } massReplaceComponent::~massReplaceComponent() { // no need to delete child widgets, Qt does it all for us } void massReplaceComponent::languageChange() { retranslateUi(this); } enum SetResponse massReplaceComponent::set(const ParameterList &pParams) { XWidget::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _original->setId(param.toInt()); return NoError; } void massReplaceComponent::sReplace() { XSqlQuery massReplace; if (_original->isValid() && _replacement->isValid() && _effective->isValid()) { if (_original->uom() != _replacement->uom()) { QMessageBox::critical( this, tr("Mass Replace"), tr("The original and replacement Items must have the same Unit of Measure.") ); return; } if (_metrics->boolean("RevControl")) { massReplace.prepare("SELECT * " "FROM bomitem, rev " "WHERE ( (bomitem_rev_id=rev_id) " "AND (rev_status='P') " "AND (bomitem_item_id=:item_id) ) " "LIMIT 1;"); massReplace.bindValue(":item_id", _original->id()); massReplace.exec(); if (massReplace.first()) QMessageBox::information( this, tr("Mass Replace"), tr("

    This process will only affect active revisions. " "Items on pending revisions must be replaced manually.") ); } massReplace.prepare("SELECT massReplaceBomitem(:replacement_item_id," " :original_item_id, :effective_date," " :ecn) AS result;"); massReplace.bindValue(":replacement_item_id", _replacement->id()); massReplace.bindValue(":original_item_id", _original->id()); massReplace.bindValue(":ecn", _ecn->text()); if (!_effective->isNull()) massReplace.bindValue(":effective_date", _effective->date()); massReplace.exec(); if (massReplace.first()) { int result = massReplace.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("massReplaceBomitem", result), __FILE__, __LINE__); return; } } else if (massReplace.lastError().type() != QSqlError::NoError) { systemError(this, massReplace.lastError().databaseText(), __FILE__, __LINE__); return; } _original->setId(-1); _replacement->setId(-1); _ecn->clear(); _close->setText(tr("&Close")); _original->setFocus(); } } qt-client-4.1.0/guiclient/massReplaceComponent.h000066400000000000000000000020561217451700100216730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MASSREPLACECOMPONENT_H #define MASSREPLACECOMPONENT_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_massReplaceComponent.h" class massReplaceComponent : public XWidget, public Ui::massReplaceComponent { Q_OBJECT public: massReplaceComponent(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~massReplaceComponent(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sReplace(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // MASSREPLACECOMPONENT_H qt-client-4.1.0/guiclient/massReplaceComponent.ui000066400000000000000000000304411217451700100220600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. massReplaceComponent 0 0 414 262 Mass Replace Component Item 0 6 0 5 0 0 Original Item: 0 5 Replacement Item: 0 5 0 5 &Effective: Qt::AlignVCenter|Qt::AlignRight _effective EC&N #: Qt::AlignVCenter|Qt::AlignRight _ecn 0 5 0 0 20 20 Expanding Horizontal 0 0 20 20 Expanding Horizontal 0 0 20 20 Expanding Horizontal 0 0 0 5 &Cancel &Replace true 20 20 Expanding Vertical 20 20 Expanding Vertical _original _replacement _effective _ecn _replace _close parameter.h qstatusbar.h _close clicked() massReplaceComponent close() qt-client-4.1.0/guiclient/materialReceiptTrans.cpp000066400000000000000000000254021217451700100222260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "materialReceiptTrans.h" #include #include #include #include #include "inputManager.h" #include "distributeInventory.h" #include "issueWoMaterialItem.h" #include "storedProcErrorLookup.h" materialReceiptTrans::materialReceiptTrans(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateQty())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateQty())); connect(_cost, SIGNAL(textChanged(const QString&)), this, SLOT(sCostUpdated())); _captive = FALSE; _item->setType(ItemLineEdit::cGeneralInventory | ItemLineEdit::cActive); _warehouse->setType(WComboBox::AllActiveInventory); _qty->setValidator(omfgThis->qtyVal()); _beforeQty->setPrecision(omfgThis->qtyVal()); _afterQty->setPrecision(omfgThis->qtyVal()); _unitCost->setPrecision(omfgThis->costVal()); _cost->setValidator(omfgThis->costVal()); _wo->setType(cWoOpen | cWoExploded | cWoReleased | cWoIssued); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } if (!_metrics->boolean("AllowAvgCostMethod")) _tab->removeTab(0); } materialReceiptTrans::~materialReceiptTrans() { // no need to delete child widgets, Qt does it all for us } void materialReceiptTrans::languageChange() { retranslateUi(this); } enum SetResponse materialReceiptTrans::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; int _invhistid = -1; param = pParams.value("invhist_id", &valid); if (valid) _invhistid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _usernameLit->clear(); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); connect(_qty, SIGNAL(textChanged(const QString &)), this, SLOT(sUpdateQty(const QString &))); connect(_qty, SIGNAL(textChanged(const QString &)), this, SLOT(sCostUpdated())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateQty())); connect(_issueToWo, SIGNAL(toggled(bool)), this, SLOT(sPopulateQty())); } else if (param.toString() == "view") { _mode = cView; _transDate->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _qty->setEnabled(FALSE); _issueToWo->setEnabled(FALSE); _wo->setReadOnly(TRUE); _documentNum->setEnabled(FALSE); _notes->setEnabled(FALSE); _post->hide(); _close->setText(tr("&Close")); XSqlQuery popq; popq.prepare( "SELECT * " "FROM invhist " "WHERE (invhist_id=:invhist_id);" ); popq.bindValue(":invhist_id", _invhistid); popq.exec(); if (popq.first()) { // _item first so it doesn't trigger sPopulateQty _item->setItemsiteid(popq.value("invhist_itemsite_id").toInt()); _transDate->setDate(popq.value("invhist_transdate").toDate()); _username->setText(popq.value("invhist_user").toString()); _qty->setDouble(popq.value("invhist_invqty").toDouble()); _beforeQty->setDouble(popq.value("invhist_qoh_before").toDouble()); _afterQty->setDouble(popq.value("invhist_qoh_after").toDouble()); _documentNum->setText(popq.value("invhist_ordnumber")); _notes->setText(popq.value("invhist_comments").toString()); } else if (popq.lastError().type() != QSqlError::NoError) { systemError(this, popq.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } } return NoError; } void materialReceiptTrans::sPost() { XSqlQuery materialPost; double cost = _cost->toDouble(); struct { bool condition; QString msg; QWidget *widget; } error[] = { { ! _item->isValid(), tr("You must select an Item before posting this transaction."), _item }, { _qty->text().length() == 0 || _qty->toDouble() <= 0, tr("

    You must enter a positive Quantity before posting this Transaction."), _qty }, { _costAdjust->isEnabled() && _costAdjust->isChecked() && _costManual->isChecked() && (_cost->text().length() == 0 || cost ==0), tr("

    You must enter a total cost value for the inventory to be transacted."), _cost }, { true, "", NULL } }; int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Post Transaction"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); materialPost.exec("BEGIN;"); // because of possible distribution cancelations materialPost.prepare( "SELECT invReceipt(itemsite_id, :qty, '', :docNumber," " :comments, :date, :cost) AS result " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); materialPost.bindValue(":qty", _qty->toDouble()); materialPost.bindValue(":docNumber", _documentNum->text()); materialPost.bindValue(":comments", _notes->toPlainText()); materialPost.bindValue(":item_id", _item->id()); materialPost.bindValue(":warehous_id", _warehouse->id()); materialPost.bindValue(":date", _transDate->date()); if(!_costAdjust->isChecked()) materialPost.bindValue(":cost", 0.0); else if(_costManual->isChecked()) materialPost.bindValue(":cost", cost); materialPost.exec(); if (materialPost.first()) { int result = materialPost.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("invReceipt", result), __FILE__, __LINE__); return; } else if (materialPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, materialPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(materialPost.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information(this, tr("Enter Receipt"), tr("Transaction Canceled") ); return; } materialPost.exec("COMMIT;"); } else if (materialPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, materialPost.lastError().databaseText(), __FILE__, __LINE__); return; } else { rollback.exec(); systemError( this, tr("

    No transaction was done because Item %1 " "was not found at Site %2.") .arg(_item->itemNumber()).arg(_warehouse->currentText())); return; } if (_issueToWo->isChecked()) { materialPost.prepare( "SELECT womatl_id, womatl_issuemethod " "FROM womatl, wo, itemsite " "WHERE ( ( womatl_itemsite_id=itemsite_id)" " AND (womatl_wo_id=wo_id)" " AND (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (wo_id=:wo_id) );" ); materialPost.bindValue(":item_id", _item->id()); materialPost.bindValue(":warehous_id", _warehouse->id()); materialPost.bindValue(":wo_id", _wo->id()); materialPost.exec(); if (materialPost.first()) { if ( (materialPost.value("womatl_issuemethod").toString() == "S") || (materialPost.value("womatl_issuemethod").toString() == "M") ) { issueWoMaterialItem newdlg(this); ParameterList params; params.append("wo_id", _wo->id()); params.append("womatl_id", materialPost.value("womatl_id").toInt()); params.append("qty", _qty->toDouble()); if (newdlg.set(params) == NoError) newdlg.exec(); } } } if (_captive) close(); else { _close->setText(tr("&Close")); _item->setId(-1); _qty->clear(); _beforeQty->clear(); _afterQty->clear(); _documentNum->clear(); _issueToWo->setChecked(FALSE); _wo->setId(-1); _notes->clear(); _item->setFocus(); } } void materialReceiptTrans::sPopulateQty() { XSqlQuery materialPopulateQty; materialPopulateQty.prepare( "SELECT itemsite_qtyonhand, itemsite_costmethod " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); materialPopulateQty.bindValue(":item_id", _item->id()); materialPopulateQty.bindValue(":warehous_id", _warehouse->id()); materialPopulateQty.exec(); if (materialPopulateQty.first()) { _cachedQOH = materialPopulateQty.value("itemsite_qtyonhand").toDouble(); if(_cachedQOH == 0.0) _costManual->setChecked(true); _beforeQty->setDouble(materialPopulateQty.value("itemsite_qtyonhand").toDouble()); _costAdjust->setChecked(true); _costAdjust->setEnabled(materialPopulateQty.value("itemsite_costmethod").toString() == "A"); if (_issueToWo->isChecked()) _afterQty->setDouble(materialPopulateQty.value("itemsite_qtyonhand").toDouble()); else if (_qty->toDouble() != 0) _afterQty->setDouble(_cachedQOH + _qty->toDouble()); if (_item->isFractional()) _qty->setValidator(omfgThis->transQtyVal()); else _qty->setValidator(new QIntValidator(this)); } else if (materialPopulateQty.lastError().type() != QSqlError::NoError) { systemError(this, materialPopulateQty.lastError().databaseText(), __FILE__, __LINE__); return; } _wo->setWarehouse(_warehouse->id()); } void materialReceiptTrans::sUpdateQty(const QString &pQty) { if (_issueToWo->isChecked()) _afterQty->setDouble(_beforeQty->toDouble()); else _afterQty->setDouble(_cachedQOH + pQty.toDouble()); } void materialReceiptTrans::sCostUpdated() { if(_cost->toDouble() == 0.0 || _qty->toDouble() == 0.0) _unitCost->setText(tr("N/A")); else _unitCost->setDouble(_cost->toDouble() / _qty->toDouble()); } qt-client-4.1.0/guiclient/materialReceiptTrans.h000066400000000000000000000023101217451700100216640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MATERIALRECEIPTTRANS_H #define MATERIALRECEIPTTRANS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_materialReceiptTrans.h" class materialReceiptTrans : public XWidget, public Ui::materialReceiptTrans { Q_OBJECT public: materialReceiptTrans(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~materialReceiptTrans(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPost(); virtual void sPopulateQty(); virtual void sUpdateQty( const QString & pQty ); virtual void sCostUpdated(); protected slots: virtual void languageChange(); private: int _mode; double _cachedQOH; bool _captive; }; #endif // MATERIALRECEIPTTRANS_H qt-client-4.1.0/guiclient/materialReceiptTrans.ui000066400000000000000000000467241217451700100220730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. materialReceiptTrans 0 0 467 549 Material Receipt Transaction Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate Username: 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 20 20 5 &Cancel false &Post true Qt::Vertical QSizePolicy::Preferred 20 20 0 5 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 _warehouse Receipt Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 _qty Qt::Vertical 20 40 5 0 Qt::Horizontal QSizePolicy::Preferred 20 0 0 0 Qt::AlignRight Qt::Vertical 86 16 0 Qt::Vertical QSizePolicy::Preferred 10 0 7 2 Before Qt::AlignCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 After Qt::AlignCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 101 20 0 0 0 0 0 20 Immediate Issue to Work Order Qt::Horizontal QSizePolicy::Expanding 71 10 false Qt::StrongFocus 5 Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _documentNum 0 Cost Adjust Value true Calculated true Manual Total Cost: _cost Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter N/A Qt::Vertical 20 1 Notes 0 1 true true DLineEdit QWidget

    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    WoCluster QWidget
    wocluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    XTextEdit QTextEdit
    xtextedit.h
    _transDate _item _warehouse _qty _issueToWo _wo _documentNum _costAdjust _costCalculated _costManual _cost _tab _notes _post _close _issueToWo toggled(bool) _wo setEnabled(bool) 31 211 30 233 _item valid(bool) _post setEnabled(bool) 32 64 401 64 _item newId(int) _warehouse findItemsites(int) 32 64 113 143 _item warehouseIdChanged(int) _warehouse setId(int) 32 64 113 143 _close clicked() materialReceiptTrans close() 401 31 20 20 qt-client-4.1.0/guiclient/menuAccounting.cpp000066400000000000000000001251011217451700100210600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include "guiclient.h" //AP #include "purchaseOrder.h" #include "unpostedPurchaseOrders.h" #include "printPurchaseOrder.h" #include "postPurchaseOrder.h" #include "dspUninvoicedReceivings.h" #include "voucher.h" #include "miscVoucher.h" #include "openVouchers.h" #include "postVouchers.h" #include "selectPayments.h" #include "selectedPayments.h" #include "prepareCheckRun.h" #include "viewCheckRun.h" #include "miscCheck.h" #include "printCheck.h" #include "printChecks.h" #include "voidChecks.h" #include "postCheck.h" #include "postChecks.h" #include "apWorkBench.h" #include "unappliedAPCreditMemos.h" #include "apOpenItem.h" #include "dspVendorAPHistory.h" #include "dspCheckRegister.h" #include "dspAPApplications.h" #include "dspVoucherRegister.h" #include "dspAPOpenItemsByVendor.h" #include "dspTimePhasedOpenAPItems.h" // AR #include "invoice.h" #include "listRecurringInvoices.h" #include "unpostedInvoices.h" #include "printInvoices.h" #include "reprintInvoices.h" #include "postInvoices.h" #include "purgeInvoices.h" #include "cashReceipt.h" #include "cashReceiptsEditList.h" #include "postCashReceipts.h" #include "unappliedARCreditMemos.h" #include "arOpenItem.h" #include "arWorkBench.h" #include "dspCustomerARHistory.h" #include "dspCashReceipts.h" #include "dspARApplications.h" #include "dspInvoiceInformation.h" #include "dspAROpenItems.h" #include "dspTimePhasedOpenARItems.h" #include "dspInvoiceRegister.h" #include "dspDepositsRegister.h" #include "printStatementByCustomer.h" #include "printStatementsByCustomerType.h" // GL #include "glTransaction.h" #include "glSeries.h" #include "unpostedGlSeries.h" #include "standardJournal.h" #include "standardJournals.h" #include "standardJournalGroups.h" #include "postStandardJournal.h" #include "postStandardJournalGroup.h" #include "postJournals.h" #include "dspStandardJournalHistory.h" #include "financialLayouts.h" #include "financialLayout.h" #include "dspFinancialReport.h" #include "dspGLTransactions.h" #include "dspSummarizedGLTransactions.h" #include "dspGLSeries.h" #include "dspTrialBalances.h" #include "dspJournals.h" #include "companies.h" #include "profitCenters.h" #include "subaccounts.h" #include "accountNumbers.h" #include "subAccntTypes.h" #include "accountingPeriods.h" #include "accountingYearPeriods.h" #include "taxCodes.h" #include "taxclasses.h" #include "taxTypes.h" #include "taxZones.h" #include "taxAuthorities.h" #include "taxAssignments.h" #include "taxRegistrations.h" #include "dspTaxHistory.h" #include "reconcileBankaccount.h" #include "bankAdjustment.h" #include "bankAdjustmentEditList.h" #include "dspBankrecHistory.h" #include "dspSummarizedBankrecHistory.h" #include "budgets.h" #include "maintainBudget.h" #include "forwardUpdateAccounts.h" #include "duplicateAccountNumbers.h" #include "vendors.h" #include "bankAccounts.h" #include "checkFormats.h" #include "customers.h" #include "updateLateCustCreditStatus.h" #include "createRecurringInvoices.h" #include "syncCompanies.h" #include "setup.h" #include "menuAccounting.h" menuAccounting::menuAccounting(GUIClient *Pparent) : QObject(Pparent) { setObjectName("wmModule"); parent = Pparent; toolBar = new QToolBar(tr("Accounting Tools")); toolBar->setObjectName("Accounting Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); mainMenu = new QMenu(parent); apMenu = new QMenu(parent); apPurchaseMenu = new QMenu(parent); apVoucherMenu = new QMenu(parent); apMemosMenu = new QMenu(parent); apPaymentsMenu = new QMenu(parent); apFormsMenu = new QMenu(parent); apReportsMenu = new QMenu(parent); arMenu = new QMenu(parent); arInvoicesMenu = new QMenu(parent); arMemosMenu = new QMenu(parent); arCashReceiptsMenu = new QMenu(parent); arFormsMenu = new QMenu(parent); arReportsMenu = new QMenu(parent); glMenu = new QMenu(parent); glEnterTransactionMenu = new QMenu(parent); glStandardJournalsMenu = new QMenu(parent); bankrecMenu = new QMenu(parent); bankrecReportsMenu = new QMenu(parent); financialReportsMenu = new QMenu(parent); glReportsMenu = new QMenu(parent); calendarMenu = new QMenu(parent); coaMenu = new QMenu(parent); budgetMenu = new QMenu(parent); taxMenu = new QMenu(parent); taxReportsMenu = new QMenu(parent); utilitiesMenu = new QMenu(parent); mainMenu->setObjectName("menu.accnt"); apMenu->setObjectName("menu.accnt.ap"); apPurchaseMenu->setObjectName("menu.accnt.appurchase"); apVoucherMenu->setObjectName("menu.accnt.apvoucher"); apMemosMenu->setObjectName("menu.accnt.apmemos"); apPaymentsMenu->setObjectName("menu.accnt.appayments"); apFormsMenu->setObjectName("menu.accnt.apforms"); apReportsMenu->setObjectName("menu.accnt.apreports"); arMenu->setObjectName("menu.accnt.ar"); arInvoicesMenu->setObjectName("menu.accnt.arinvoices"); arMemosMenu->setObjectName("menu.accnt.armemos"); arCashReceiptsMenu->setObjectName("menu.accnt.arcashreceipts"); arFormsMenu->setObjectName("menu.accnt.arforms"); arReportsMenu->setObjectName("menu.accnt.arreports"); glMenu->setObjectName("menu.accnt.gl"); glReportsMenu->setObjectName("menu.accnt.gl.glreports"); glEnterTransactionMenu->setObjectName("menu.accnt.glentertransaction"); glStandardJournalsMenu->setObjectName("menu.accnt.glstandardjournals"); bankrecMenu->setObjectName("menu.accnt.bankrec"); bankrecReportsMenu->setObjectName("menu.accnt.bankrec.bankrecreports"); financialReportsMenu->setObjectName("menu.accnt.financialreports"); calendarMenu->setObjectName("menu.accnt.calendar"); coaMenu->setObjectName("menu.accnt.coa"); budgetMenu->setObjectName("menu.accnt.budget"); taxMenu->setObjectName("menu.accnt.tax"); taxMenu->setObjectName("menu.accnt.tax.taxreports"); utilitiesMenu->setObjectName("menu.accnt.utilities"); actionProperties acts[] = { // Accounting | Accounts Payable { "menu", tr("Accounts &Payable"), (char*)apMenu, mainMenu, "true", NULL, NULL, true, NULL }, // Accounting | Accaunts Payable | Purchase Orders { "menu", tr("Purchase &Order"), (char*)apPurchaseMenu, apMenu, "true", NULL, NULL, true, NULL }, { "ap.enterPurchaseOrder", tr("&New..."), SLOT(sEnterPurchaseOrder()), apPurchaseMenu, "MaintainPurchaseOrders", NULL, NULL, true , NULL }, { "ap.listUnpostedPurchaseOrders", tr("&List Open..."), SLOT(sUnpostedPurchaseOrders()), apPurchaseMenu, "MaintainPurchaseOrders ViewPurchaseOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apPurchaseMenu, "true", NULL, NULL, true, NULL }, { "ap.postPurchaseOrder", tr("&Release..."), SLOT(sPostPurchaseOrder()), apPurchaseMenu, "ReleasePurchaseOrders", NULL, NULL, true , NULL }, // Accounting | Accaunts Payable | Vouchers { "menu", tr("&Voucher"), (char*)apVoucherMenu, apMenu, "true", NULL, NULL, true, NULL }, { "ar.enterNewVoucher", tr("&New..."), SLOT(sEnterVoucher()), apVoucherMenu, "MaintainVouchers", NULL, NULL, true , NULL }, { "ar.enterNewMiscVoucher", tr("New &Miscellaneous..."), SLOT(sEnterMiscVoucher()), apVoucherMenu, "MaintainVouchers", NULL, NULL, true , NULL }, { "ar.listUnpostedVouchers", tr("&List Unposted..."), SLOT(sUnpostedVouchers()), apVoucherMenu, "MaintainVouchers ViewVouchers", QPixmap(":/images/listUnpostedVouchers.png"), toolBar, true , tr("List Unposted Vouchers") }, { "separator", NULL, NULL, apVoucherMenu, "true", NULL, NULL, true, NULL }, { "ar.postVouchers", tr("&Post..."), SLOT(sPostVouchers()), apVoucherMenu, "PostVouchers", NULL, NULL, true , NULL }, // Accounting | Accaunts Payable | Memos { "menu", tr("&Memos"), (char*)apMemosMenu, apMenu, "true", NULL, NULL, true, NULL }, { "ap.enterMiscCreditMemo", tr("&New Misc. Credit Memo..."), SLOT(sEnterMiscApCreditMemo()), apMemosMenu, "MaintainAPMemos", NULL, NULL, true , NULL }, { "ap.unapplidCreditMemo", tr("&List Unapplied Credit Memos..."), SLOT(sUnappliedApCreditMemos()), apMemosMenu, "MaintainAPMemos ViewAPMemos", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apMemosMenu, "true", NULL, NULL, true, NULL }, { "ap.enterMiscDebitMemo", tr("New &Misc. Debit Memo..."), SLOT(sEnterMiscApDebitMemo()), apMemosMenu, "MaintainAPMemos", NULL, NULL, true , NULL }, // Accounting | Accaunts Payable | Payments { "menu", tr("&Payments"), (char*)apPaymentsMenu, apMenu, "true", NULL, NULL, true, NULL }, { "ap.selectPayments", tr("&Select..."), SLOT(sSelectPayments()), apPaymentsMenu, "MaintainPayments", NULL, NULL, true , tr("Select Payments") }, { "ap.listSelectPayments", tr("&List Selected..."), SLOT(sSelectedPayments()), apPaymentsMenu, "MaintainPayments", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apPaymentsMenu, "true", NULL, NULL, true, NULL }, { "ap.prepareCheckRun", tr("&Prepare Check Run..."), SLOT(sPrepareCheckRun()), apPaymentsMenu, "MaintainPayments", NULL, NULL, true , NULL }, { "ap.createMiscCheck", tr("Create &Miscellaneous Check..."), SLOT(sCreateMiscCheck()), apPaymentsMenu, "MaintainPayments", NULL, NULL, true , NULL }, { "ap.viewCheckRun", tr("Vie&w Check Run..."), SLOT(sViewCheckRun()), apPaymentsMenu, "MaintainPayments", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apPaymentsMenu, "true", NULL, NULL, true, NULL }, { "ap.voidCheckRun", tr("&Void Check Run..."), SLOT(sVoidCheckRun()), apPaymentsMenu, "MaintainPayments", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apPaymentsMenu, "true", NULL, NULL, true, NULL }, { "ap.postCheck", tr("Post &Check..."), SLOT(sPostCheck()), apPaymentsMenu, "PostPayments", NULL, NULL, true , NULL }, { "ap.postChecks", tr("P&ost Checks..."), SLOT(sPostChecks()), apPaymentsMenu, "PostPayments", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apMenu, "true", NULL, NULL, true, NULL }, { "ap.workbench", tr("&Workbench..."), SLOT(sApWorkBench()), apMenu, "MaintainPayments MaintainAPMemos", QPixmap(":/images/viewCheckRun.png"), toolBar, true, tr("Payables Workbench") }, { "separator", NULL, NULL, apMenu, "true", NULL, NULL, true, NULL }, // Accounting | Accaunts Payable | Forms { "menu", tr("&Forms"), (char*)apFormsMenu, apMenu, "true", NULL, NULL, true, NULL }, { "ap.printPurchaseOrder", tr("Print Purchase &Order..."), SLOT(sPrintPurchaseOrder()), apFormsMenu, "PrintPurchaseOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apFormsMenu, "true", NULL, NULL, true, NULL }, { "ap.printCheck", tr("Print &Check..."), SLOT(sPrintCheck()), apFormsMenu, "MaintainPayments", NULL, NULL, true , NULL }, { "ap.printCheckRun", tr("Print Check &Run..."), SLOT(sPrintCheckRun()), apFormsMenu, "MaintainPayments", NULL, NULL, true , NULL }, // Accounting | Accaunts Payable | Reports { "menu", tr("&Reports"), (char*)apReportsMenu, apMenu, "true", NULL, NULL, true, NULL }, { "ap.uninvoicedReceipts", tr("&Uninvoiced Receipts and Returns..."), SLOT(sDspUninvoicedReceipts()), apReportsMenu, "ViewUninvoicedReceipts MaintainUninvoicedReceipts", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apReportsMenu, "true", NULL, NULL, true, NULL }, { "ap.dspOpenAPItemsByVendor", tr("Open &Payables..."), SLOT(sDspAPOpenItemsByVendor()), apReportsMenu, "ViewAPOpenItems", NULL, NULL, true , NULL }, { "ap.dspAPAging", tr("&Aging..."), SLOT(sDspTimePhasedOpenAPItems()), apReportsMenu, "ViewAPOpenItems", QPixmap(":/images/apAging.png"), toolBar, true , tr("Payables Aging") }, { "separator", NULL, NULL, apReportsMenu, "true", NULL, NULL, true, NULL }, { "ap.dspCheckRegister", tr("&Check Register..."), SLOT(sDspCheckRegister()), apReportsMenu, "MaintainPayments", NULL, NULL, true , NULL }, { "ap.dspVoucherRegister", tr("&Voucher Register..."), SLOT(sDspVoucherRegister()), apReportsMenu, "MaintainVouchers ViewVouchers", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apReportsMenu, "true", NULL, NULL, true, NULL }, { "ap.dspAPApplications", tr("&Applications..."), SLOT(sDspAPApplications()), apReportsMenu, "ViewAPOpenItems", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apReportsMenu, "true", NULL, NULL, true, NULL }, { "ap.dspVendorHistory", tr("Vendor &History..."), SLOT(sDspVendorHistory()), apReportsMenu, "ViewAPOpenItems", NULL, NULL, true , NULL }, { "separator", NULL, NULL, apMenu, "true", NULL, NULL, true, NULL }, { "ap.vendors", tr("Ve&ndors..."), SLOT(sVendors()), apMenu, "MaintainVendors ViewVendors", NULL, NULL, true , NULL }, // Accounting | Accounts Receivable { "menu", tr("Accounts Recei&vable"), (char*)arMenu, mainMenu, "true", NULL, NULL, true, NULL }, // Accounting | Accounts Receivable | Invoices { "menu", tr("&Invoice"), (char*)arInvoicesMenu, arMenu, "true", NULL, NULL, true, NULL }, { "ar.createInvoice", tr("&New..."), SLOT(sCreateInvoice()), arInvoicesMenu, "MaintainMiscInvoices", NULL, NULL, true , NULL }, { "ar.listRecurringInvoices", tr("&List Recurring Invoices..."), SLOT(sRecurringInvoices()), arInvoicesMenu, "SelectBilling", NULL, NULL, true, NULL }, { "ar.listUnpostedInvoices", tr("&List Unposted..."), SLOT(sUnpostedInvoices()), arInvoicesMenu, "SelectBilling", QPixmap(":/images/unpostedInvoices.png"), toolBar, true , tr("List Unposted Invoices") }, { "separator", NULL, NULL, arInvoicesMenu, "true", NULL, NULL, true, NULL }, { "ar.postInvoices", tr("&Post..."), SLOT(sPostInvoices()), arInvoicesMenu, "PostMiscInvoices", NULL, NULL, true , NULL }, // Accounting | Accounts Receivable | Memos { "menu", tr("&Memos"), (char*)arMemosMenu, arMenu, "true", NULL, NULL, true, NULL }, { "ar.enterMiscCreditMemo", tr("&New Misc. Credit Memo..."), SLOT(sEnterMiscArCreditMemo()), arMemosMenu, "MaintainARMemos", NULL, NULL, true , NULL }, { "ar.unapplidCreditMemo", tr("&List Unapplied Credit Memos..."), SLOT(sUnappliedArCreditMemos()), arMemosMenu, "MaintainARMemos ViewARMemos", NULL, NULL, true , NULL }, { "separator", NULL, NULL, arMemosMenu, "true", NULL, NULL, true, NULL }, { "ar.enterMiscDebitMemo", tr("New &Misc. Debit Memo..."), SLOT(sEnterMiscArDebitMemo()), arMemosMenu, "MaintainARMemos", NULL, NULL, true , NULL }, // Accounting | Accounts Receivable | Cash Receipts { "menu", tr("C&ash Receipt"), (char*)arCashReceiptsMenu, arMenu, "true", NULL, NULL, true, NULL }, { "ar.enterCashReceipt", tr("&New..."), SLOT(sEnterCashReceipt()), arCashReceiptsMenu, "MaintainCashReceipts", NULL, NULL, true , NULL }, { "ar.cashReceiptEditList", tr("&Edit List..."), SLOT(sCashReceiptEditList()), arCashReceiptsMenu, "MaintainCashReceipts ViewCashReceipt", QPixmap(":/images/editCashReceipts.png"), toolBar, true , tr("Cash Receipt Edit List") }, { "ar.postCashReceipts", tr("&Post..."), SLOT(sPostCashReceipts()), arCashReceiptsMenu, "PostCashReceipts", NULL, NULL, true , NULL }, { "separator", NULL, NULL, arMenu, "true", NULL, NULL, true, NULL }, { "ar.arWorkBench", tr("&Workbench..."), SLOT(sArWorkBench()), arMenu, "ViewAROpenItems" , QPixmap(":/images/arWorkbench.png"), toolBar, true , tr("Receivables Workbench") }, { "separator", NULL, NULL, arMenu, "true", NULL, NULL, true, NULL }, // Accounting | Accounts Receivable | Forms { "menu", tr("&Forms"), (char*)arFormsMenu, arMenu, "true", NULL, NULL, true, NULL }, { "ar.printInvoices", tr("Print &Invoices..."), SLOT(sPrintInvoices()), arFormsMenu, "PrintInvoices", NULL, NULL, true , NULL }, { "ar.reprintInvoices", tr("&Re-Print Invoices..."), SLOT(sReprintInvoices()), arFormsMenu, "PrintInvoices", NULL, NULL, true , NULL }, { "separator", NULL, NULL, arFormsMenu, "true", NULL, NULL, true, NULL }, { "ar.printStatementByCustomer", tr("Print S&tatement by Customer..."), SLOT(sPrintStatementByCustomer()), arFormsMenu, "ViewAROpenItems", NULL, NULL, true , NULL }, { "ar.printStatementsByCustomerType", tr("Print State&ments by Customer Type..."), SLOT(sPrintStatementsByCustomerType()), arFormsMenu, "ViewAROpenItems", NULL, NULL, true , NULL }, // Accounting | Accounts Receivable | Reports { "menu", tr("&Reports"), (char*)arReportsMenu, arMenu, "true", NULL, NULL, true, NULL }, { "ar.dspInvoiceInformation", tr("&Invoice Information..."), SLOT(sDspInvoiceInformation()), arReportsMenu, "ViewAROpenItems", NULL, NULL, true , NULL }, { "separator", NULL, NULL, arReportsMenu, "true", NULL, NULL, true, NULL }, { "ar.dspOpenItems", tr("&Open Receivables..."), SLOT(sDspAROpenItems()), arReportsMenu, "ViewAROpenItems", NULL, NULL, true , NULL }, { "ar.dspARAging", tr("A&ging..."), SLOT(sDspTimePhasedOpenItems()), arReportsMenu, "ViewAROpenItems", QPixmap(":/images/arAging.png"), toolBar, true , tr("Receivables Aging") }, { "separator", NULL, NULL, arReportsMenu, "true", NULL, NULL, true, NULL }, { "ar.dspInvoiceRegister", tr("In&voice Register..."), SLOT(sDspInvoiceRegister()), arReportsMenu, "ViewInvoiceRegister", NULL, NULL, true , NULL }, { "ar.dspCashReceipts", tr("Cash &Receipts..."), SLOT(sDspCashReceipts()), arReportsMenu, "ViewAROpenItems", NULL, NULL, true , NULL }, { "ar.dspARApplications", tr("&Applications..."), SLOT(sDspARApplications()), arReportsMenu, "ViewAROpenItems", NULL, NULL, true , NULL }, { "ar.dspDepositsRegister", tr("&Deposits Register..."), SLOT(sDspDepositsRegister()), arReportsMenu, "ViewDepositsRegister", NULL, NULL, true , NULL }, { "separator", NULL, NULL, arReportsMenu, "true", NULL, NULL, true, NULL }, { "ar.dspCustomerHistory", tr("Customer &History..."), SLOT(sDspCustomerHistory()), arReportsMenu, "ViewAROpenItems", NULL, NULL, true , NULL }, { "separator", NULL, NULL, arMenu, "true", NULL, NULL, true, NULL }, { "ar.customers", tr("&Customers..."), SLOT(sCustomers()), arMenu, "MaintainCustomerMasters ViewCustomerMasters", NULL, NULL, true , NULL }, // Accounting | G/L { "menu", tr("General &Ledger"), (char*)glMenu, mainMenu, "true", NULL, NULL, true, NULL }, // Accounting | G/L | Journals { "menu", tr("&Journal Entry"), (char*)glEnterTransactionMenu, glMenu, "true", NULL, NULL, true, NULL }, { "gl.simpleEntry", tr("S&imple..."), SLOT(sSimpleEntry()), glEnterTransactionMenu, "PostJournalEntries", NULL, NULL, true, NULL }, { "gl.seriesEntry", tr("&Series..."), SLOT(sSeriesEntry()), glEnterTransactionMenu, "PostJournalEntries", NULL, NULL, true, NULL }, { "separator", NULL, NULL, glEnterTransactionMenu, "true", NULL, NULL, true, NULL }, { "gl.unpostedEntries", tr("&List Unposted..."), SLOT(sUnpostedEntries()), glEnterTransactionMenu, "PostJournalEntries", QPixmap(":/images/journalEntries.png"), toolBar, true, tr("List Unposted Journal Entries") }, // Accounting | G/L | Standard Journals { "menu", tr("&Standard Journals"), (char*)glStandardJournalsMenu, glMenu, "true", NULL, NULL, true, NULL }, { "gl.enterNewStandardJournal", tr("&New..."), SLOT(sEnterStandardJournal()), glStandardJournalsMenu, "MaintainStandardJournals", NULL, NULL, true, NULL }, { "gl.listStandardJournals", tr("&List..."), SLOT(sStandardJournals()), glStandardJournalsMenu, "MaintainStandardJournals", NULL, NULL, true, NULL }, { "gl.listStandardJournalGroups",tr("List &Groups..."),SLOT(sStandardJournalGroups()), glStandardJournalsMenu, "MaintainStandardJournalGroups", NULL, NULL, true, NULL }, { "separator", NULL, NULL, glStandardJournalsMenu, "true", NULL, NULL, true, NULL }, { "gl.postStandardJournal", tr("&Post..."), SLOT(sPostStandardJournal()), glStandardJournalsMenu, "PostStandardJournals", NULL, NULL, true, NULL }, { "gl.postStandardJournalGroup", tr("Post G&roup..."), SLOT(sPostStandardJournalGroup()),glStandardJournalsMenu, "PostStandardJournalGroups", NULL, NULL, true, NULL }, { "separator", NULL, NULL, glMenu, "true", NULL, NULL, _metrics->boolean("UseJournals"), NULL }, { "gl.postJournals", tr("&Post Journals to Ledger..."), SLOT(sPostJournals()), glMenu, "PostJournals", NULL, NULL, _metrics->boolean("UseJournals"), NULL }, { "separator", NULL, NULL, glMenu, "true", NULL, NULL, true, NULL }, // Accounting | General Ledger | Reports { "menu", tr("&Reports"), (char*)glReportsMenu, glMenu, "true", NULL, NULL, true, NULL }, { "gl.dspGLTransactions", tr("&Transactions..."), SLOT(sDspGLTransactions()), glReportsMenu, "ViewGLTransactions", NULL, NULL, true, NULL }, { "gl.dspSummarizedGLTransactions", tr("Su&mmarized Transactions..."), SLOT(sDspSummarizedGLTransactions()), glReportsMenu, "ViewGLTransactions", NULL, NULL, true, NULL }, { "gl.dspGLSeries", tr("&Series..."), SLOT(sDspGLSeries()), glReportsMenu, "ViewGLTransactions", NULL, NULL, true, NULL }, { "gl.dspStandardJournalHistory", tr("Standard &Journal History..."), SLOT(sDspStandardJournalHistory()), glReportsMenu, "ViewGLTransactions", NULL, NULL, true, NULL }, { "separator", NULL, NULL, glReportsMenu, "true", NULL, NULL, _metrics->boolean("UseJournals"), NULL }, { "gl.dspJournals", tr("Journals..."), SLOT(sDspJournals()), glReportsMenu, "ViewJournals", NULL, NULL, _metrics->boolean("UseJournals"), NULL }, { "menu", tr("&Bank Reconciliation"), (char*)bankrecMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "gl.reconcileBankaccnt", tr("&Reconcile..."),SLOT(sReconcileBankaccount()), bankrecMenu, "MaintainBankRec", QPixmap(":/images/bankReconciliation.png"), toolBar, true, tr("Reconcile Bank Account") }, { "separator", NULL, NULL, bankrecMenu, "true", NULL, NULL, true, NULL }, { "gl.enterAdjustment", tr("&New Adjustment..."), SLOT(sEnterAdjustment()), bankrecMenu, "MaintainBankAdjustments", NULL, NULL, true, NULL }, { "gl.adjustmentEditList", tr("Adjustment Edit &List..."), SLOT(sAdjustmentEditList()), bankrecMenu, "MaintainBankAdjustments ViewBankAdjustments", NULL, NULL, true, NULL }, { "separator", NULL, NULL, bankrecMenu, "true", NULL, NULL, true, NULL }, // Accounting | Bank Reconciliation | Reports { "menu", tr("&Reports"), (char*)bankrecReportsMenu, bankrecMenu, "true", NULL, NULL, true, NULL }, { "gl.dspBankrecHistory", tr("&History"), SLOT(sDspBankrecHistory()), bankrecReportsMenu, "ViewBankRec", NULL, NULL, true, NULL }, { "gl.dspSummarizedBankrecHistory", tr("Summari&zed History"), SLOT(sDspSummarizedBankrecHistory()), bankrecReportsMenu, "ViewBankRec", NULL, NULL, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Accounting | Statements { "menu", tr("Financial &Statements"), (char*)financialReportsMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "gl.createFinancialReports",tr("&New Financial Report..."), SLOT(sNewFinancialReport()), financialReportsMenu, "MaintainFinancialLayouts", NULL, NULL, true, NULL }, { "gl.editFinancialReports", tr("&List Financial Reports..."), SLOT(sFinancialReports()), financialReportsMenu, "MaintainFinancialLayouts", NULL, NULL, true, NULL }, { "separator", NULL, NULL, financialReportsMenu, "true", NULL, NULL, true, NULL }, { "gl.dspTrialBalances", tr("View &Trial Balances..."), SLOT(sDspTrialBalances()), financialReportsMenu, "ViewTrialBalances", QPixmap(":/images/viewTrialBalance.png"), toolBar, true, NULL }, { "gl.viewFinancialReport", tr("View &Financial Report..."), SLOT(sViewFinancialReport()), financialReportsMenu, "ViewFinancialReports", QPixmap(":/images/viewFinancialReport.png"), toolBar, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Accounting | Fiscal Calendar { "menu", tr("&Fiscal Calendar"), (char*)calendarMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "gl.accountingYearPeriods", tr("Fiscal &Years..."), SLOT(sAccountingYearPeriods()), calendarMenu, "MaintainAccountingPeriods", NULL, NULL, true, NULL }, { "gl.accountingPeriods", tr("Accounting &Periods..."), SLOT(sAccountingPeriods()), calendarMenu, "MaintainAccountingPeriods", NULL, NULL, true, NULL }, // Accounting | Account { "menu", tr("&Account"), (char*)coaMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "gl.accountNumbers", tr("&Chart of Accounts..."), SLOT(sAccountNumbers()), coaMenu, "MaintainChartOfAccounts", NULL, NULL, true, NULL }, { "gl.companies", tr("C&ompanies..."), SLOT(sCompanies()), coaMenu, "MaintainChartOfAccounts", NULL, NULL, (_metrics->value("GLCompanySize").toInt() > 0), NULL }, { "gl.profitCenterNumber", tr("&Profit Center Numbers..."), SLOT(sProfitCenters()), coaMenu, "MaintainChartOfAccounts", NULL, NULL, (_metrics->value("GLProfitSize").toInt() > 0), NULL }, { "gl.subaccountNumbers", tr("&Subaccount Numbers..."), SLOT(sSubaccounts()), coaMenu, "MaintainChartOfAccounts", NULL, NULL, (_metrics->value("GLSubaccountSize").toInt() > 0), NULL }, { "gl.subAccntTypes", tr("Su&baccount Types..."), SLOT(sSubAccntTypes()), coaMenu, "MaintainChartOfAccounts", NULL, NULL, true, NULL }, // Accounting | Budget { "menu", tr("Bu&dget"), (char*)budgetMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "gl.maintainBudget", tr("&New Budget..."), SLOT(sMaintainBudget()), budgetMenu, "MaintainBudgets", NULL, NULL, true, NULL }, { "gl.maintainBudgets", tr("&List Budgets..."), SLOT(sBudgets()), budgetMenu, "MaintainBudgets ViewBudgets", NULL, NULL, true, NULL }, // Accounting | Tax { "menu", tr("&Tax"), (char*)taxMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "gl.taxAuthorities", tr("Tax &Authorities..."), SLOT(sTaxAuthorities()), taxMenu, "MaintainTaxAuthorities ViewTaxAuthorities", NULL, NULL, true, NULL }, { "gl.taxZones", tr("Tax &Zones..."), SLOT(sTaxZones()), taxMenu, "MaintainTaxZones ViewTaxZones", NULL, NULL, true, NULL }, { "gl.taxClasses", tr("Tax &Classes..."), SLOT(sTaxClasses()), taxMenu, "MaintainTaxClasses ViewTaxClasses", NULL, NULL, true, NULL }, { "gl.taxCodes", tr("Tax &Codes..."), SLOT(sTaxCodes()), taxMenu, "MaintainTaxCodes ViewTaxCodes", NULL, NULL, true, NULL }, { "gl.taxTypes", tr("Tax &Types..."), SLOT(sTaxTypes()), taxMenu, "MaintainTaxTypes ViewTaxTypes", NULL, NULL, true, NULL }, { "gl.taxAssignments", tr("Tax Assi&gnments..."), SLOT(sTaxAssignments()), taxMenu, "MaintainTaxAssignments ViewTaxAssignments", NULL, NULL, true, NULL }, { "gl.taxRegistatrions", tr("Tax &Registrations..."), SLOT(sTaxRegistrations()), taxMenu, "MaintainTaxRegistrations ViewTaxRegistrations", NULL, NULL, true, NULL }, { "separator", NULL, NULL, taxMenu, "true", NULL, NULL, true, NULL }, // Accounting | Tax | Reports { "menu", tr("&Reports"), (char*)taxReportsMenu, taxMenu, "true", NULL, NULL, true, NULL }, { "gl.dspTaxHistory", tr("&Tax History..."), SLOT(sDspTaxHistory()), taxReportsMenu, "ViewTaxReconciliations", NULL, NULL, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Accounting | Utilities { "menu", tr("&Utilities"), (char*)utilitiesMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "gl.forwardUpdateAccounts", tr("&Forward Update Accounts..."), SLOT(sForwardUpdateAccounts()), utilitiesMenu, "ViewTrialBalances", NULL, NULL, _metrics->boolean("ManualForwardUpdate"), NULL }, { "gl.duplicateAccountNumbers", tr("&Duplicate Account Numbers..."), SLOT(sDuplicateAccountNumbers()), utilitiesMenu, "MaintainChartOfAccounts", NULL, NULL, true, NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, true, NULL }, { "so.purgeInvoices", tr("Purge &Invoices..."), SLOT(sPurgeInvoices()), utilitiesMenu, "PurgeInvoices", NULL, NULL, true , NULL }, { "ar.updateLateCustCreditStatus", tr("&Update Late Customer Credit Status..."), SLOT(sUpdateLateCustCreditStatus()), utilitiesMenu, "UpdateCustomerCreditStatus", NULL, NULL, _metrics->boolean("AutoCreditWarnLateCustomers"), NULL }, // { "ar.createRecurringInvoices", tr("&Create Recurring Invoices..."), SLOT(sCreateRecurringInvoices()), utilitiesMenu, "MaintainMiscInvoices", NULL, NULL, true, NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, _metrics->boolean("MultiCompanyFinancialConsolidation"), NULL }, { "gl.syncCompanies", tr("&Synchronize Companies"), SLOT(sSyncCompanies()), utilitiesMenu, "SynchronizeCompanies", NULL, NULL, _metrics->boolean("MultiCompanyFinancialConsolidation"), NULL }, { "gl.setup", tr("&Setup..."), SLOT(sSetup()), mainMenu, NULL, NULL, NULL, true, NULL}, }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(mainMenu, "Accounting"); QAction * m = parent->menuBar()->addMenu(mainMenu); if(m) m->setText(tr("Accountin&g")); } void menuAccounting::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (acts[i].toolBar != NULL)) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle); } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } // Purchase Orders void menuAccounting::sEnterPurchaseOrder() { ParameterList params; params.append("mode", "new"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuAccounting::sUnpostedPurchaseOrders() { omfgThis->handleNewWindow(new unpostedPurchaseOrders()); } void menuAccounting::sPrintPurchaseOrder() { printPurchaseOrder(parent, "", TRUE).exec(); } void menuAccounting::sPostPurchaseOrder() { postPurchaseOrder(parent, "", TRUE).exec(); } // Vouchers void menuAccounting::sDspUninvoicedReceipts() { omfgThis->handleNewWindow(new dspUninvoicedReceivings()); } void menuAccounting::sEnterVoucher() { ParameterList params; params.append("mode", "new"); voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuAccounting::sEnterMiscVoucher() { ParameterList params; params.append("mode", "new"); miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuAccounting::sUnpostedVouchers() { omfgThis->handleNewWindow(new openVouchers()); } void menuAccounting::sPostVouchers() { postVouchers(parent, "", TRUE).exec(); } // Payments void menuAccounting::sSelectPayments() { omfgThis->handleNewWindow(new selectPayments()); } void menuAccounting::sSelectedPayments() { omfgThis->handleNewWindow(new selectedPayments()); } void menuAccounting::sCreateMiscCheck() { ParameterList params; params.append("new"); miscCheck *newdlg = new miscCheck(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } void menuAccounting::sPrepareCheckRun() { prepareCheckRun(parent, "", TRUE).exec(); } void menuAccounting::sViewCheckRun() { omfgThis->handleNewWindow(new viewCheckRun()); } void menuAccounting::sPrintCheck() { omfgThis->handleNewWindow(new printCheck(0, "printCheckFromAccountingMenu"), Qt::ApplicationModal); } void menuAccounting::sPrintCheckRun() { printChecks *newdlg = new printChecks(parent, "", false); newdlg->setWindowModality(Qt::WindowModal); newdlg->exec(); } void menuAccounting::sVoidCheckRun() { voidChecks newdlg(parent, "", TRUE); newdlg.exec(); } void menuAccounting::sPostCheck() { postCheck(parent, "", TRUE).exec(); } void menuAccounting::sPostChecks() { postChecks(parent, "", TRUE).exec(); } void menuAccounting::sApWorkBench() { omfgThis->handleNewWindow(new apWorkBench()); } // Memos void menuAccounting::sEnterMiscApCreditMemo() { ParameterList params; params.append("mode", "new"); params.append("docType", "creditMemo"); apOpenItem newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuAccounting::sUnappliedApCreditMemos() { omfgThis->handleNewWindow(new unappliedAPCreditMemos()); } void menuAccounting::sEnterMiscApDebitMemo() { ParameterList params; params.append("mode", "new"); params.append("docType", "debitMemo"); apOpenItem newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } // AP Displays void menuAccounting::sDspVendorHistory() { omfgThis->handleNewWindow(new dspVendorAPHistory()); } void menuAccounting::sDspCheckRegister() { omfgThis->handleNewWindow(new dspCheckRegister()); } void menuAccounting::sDspVoucherRegister() { omfgThis->handleNewWindow(new dspVoucherRegister()); } void menuAccounting::sDspAPApplications() { omfgThis->handleNewWindow(new dspAPApplications()); } void menuAccounting::sDspAPOpenItemsByVendor() { omfgThis->handleNewWindow(new dspAPOpenItemsByVendor()); } void menuAccounting::sDspTimePhasedOpenAPItems() { omfgThis->handleNewWindow(new dspTimePhasedOpenAPItems()); } void menuAccounting::sCreateInvoice() { invoice::newInvoice(-1); } void menuAccounting::sRecurringInvoices() { omfgThis->handleNewWindow(new listRecurringInvoices()); } void menuAccounting::sUnpostedInvoices() { omfgThis->handleNewWindow(new unpostedInvoices()); } void menuAccounting::sReprintInvoices() { reprintInvoices(parent, "", TRUE).exec(); } void menuAccounting::sPrintInvoices() { printInvoices(parent, "", TRUE).exec(); } void menuAccounting::sPostInvoices() { postInvoices(parent, "", TRUE).exec(); } void menuAccounting::sPurgeInvoices() { purgeInvoices(parent, "", TRUE).exec(); } // Cash Receipts void menuAccounting::sEnterCashReceipt() { ParameterList params; params.append("mode", "new"); cashReceipt *newdlg = new cashReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuAccounting::sCashReceiptEditList() { omfgThis->handleNewWindow(new cashReceiptsEditList()); } void menuAccounting::sPostCashReceipts() { postCashReceipts(parent, "", TRUE).exec(); } // Memos void menuAccounting::sEnterMiscArCreditMemo() { ParameterList params; params.append("mode", "new"); params.append("docType", "creditMemo"); arOpenItem newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuAccounting::sUnappliedArCreditMemos() { omfgThis->handleNewWindow(new unappliedARCreditMemos()); } void menuAccounting::sEnterMiscArDebitMemo() { ParameterList params; params.append("mode", "new"); params.append("docType", "debitMemo"); arOpenItem newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } // Displays void menuAccounting::sArWorkBench() { omfgThis->handleNewWindow(new arWorkBench()); } void menuAccounting::sDspCustomerHistory() { omfgThis->handleNewWindow(new dspCustomerARHistory()); } void menuAccounting::sDspCashReceipts() { omfgThis->handleNewWindow(new dspCashReceipts()); } void menuAccounting::sDspARApplications() { omfgThis->handleNewWindow(new dspARApplications()); } void menuAccounting::sDspInvoiceInformation() { omfgThis->handleNewWindow(new dspInvoiceInformation()); } void menuAccounting::sDspInvoiceRegister() { omfgThis->handleNewWindow(new dspInvoiceRegister()); } void menuAccounting::sDspDepositsRegister() { omfgThis->handleNewWindow(new dspDepositsRegister()); } void menuAccounting::sDspAROpenItems() { omfgThis->handleNewWindow(new dspAROpenItems()); } void menuAccounting::sDspTimePhasedOpenItems() { omfgThis->handleNewWindow(new dspTimePhasedOpenARItems()); } // General Ledger void menuAccounting::sEnterStandardJournal() { ParameterList params; params.append("mode", "new"); standardJournal newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuAccounting::sStandardJournals() { omfgThis->handleNewWindow(new standardJournals()); } void menuAccounting::sStandardJournalGroups() { omfgThis->handleNewWindow(new standardJournalGroups()); } void menuAccounting::sPostStandardJournal() { postStandardJournal(parent, "", TRUE).exec(); } void menuAccounting::sPostStandardJournalGroup() { postStandardJournalGroup(parent, "", TRUE).exec(); } void menuAccounting::sPostJournals() { omfgThis->handleNewWindow(new postJournals()); } void menuAccounting::sSimpleEntry() { ParameterList params; params.append("mode", "new"); glTransaction newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuAccounting::sSeriesEntry() { ParameterList params; params.append("mode", "new"); glSeries newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuAccounting::sUnpostedEntries() { omfgThis->handleNewWindow(new unpostedGlSeries()); } // Financial Layouts void menuAccounting::sFinancialReports() { omfgThis->handleNewWindow(new financialLayouts()); } void menuAccounting::sViewFinancialReport() { omfgThis->handleNewWindow(new dspFinancialReport()); } void menuAccounting::sNewFinancialReport() { ParameterList params; params.append("mode", "new"); financialLayout newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } // Displays void menuAccounting::sDspGLTransactions() { omfgThis->handleNewWindow(new dspGLTransactions()); } void menuAccounting::sDspSummarizedGLTransactions() { omfgThis->handleNewWindow(new dspSummarizedGLTransactions()); } void menuAccounting::sDspGLSeries() { omfgThis->handleNewWindow(new dspGLSeries()); } void menuAccounting::sDspJournals() { omfgThis->handleNewWindow(new dspJournals()); } void menuAccounting::sDspStandardJournalHistory() { omfgThis->handleNewWindow(new dspStandardJournalHistory()); } void menuAccounting::sDspTrialBalances() { omfgThis->handleNewWindow(new dspTrialBalances()); } // Master Information void menuAccounting::sCompanies() { omfgThis->handleNewWindow(new companies()); } void menuAccounting::sProfitCenters() { omfgThis->handleNewWindow(new profitCenters()); } void menuAccounting::sSubaccounts() { omfgThis->handleNewWindow(new subaccounts()); } void menuAccounting::sAccountNumbers() { omfgThis->handleNewWindow(new accountNumbers()); } void menuAccounting::sDuplicateAccountNumbers() { omfgThis->handleNewWindow(new duplicateAccountNumbers()); } void menuAccounting::sSubAccntTypes() { omfgThis->handleNewWindow(new subAccntTypes()); } void menuAccounting::sAccountingPeriods() { omfgThis->handleNewWindow(new accountingPeriods()); } void menuAccounting::sAccountingYearPeriods() { omfgThis->handleNewWindow(new accountingYearPeriods()); } void menuAccounting::sReconcileBankaccount() { // omfgThis->handleNewWindow(new reconcileBankaccount()); reconcileBankaccount *newdlg = new reconcileBankaccount(); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } void menuAccounting::sEnterAdjustment() { ParameterList params; params.append("mode", "new"); bankAdjustment *newdlg = new bankAdjustment(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } void menuAccounting::sAdjustmentEditList() { omfgThis->handleNewWindow(new bankAdjustmentEditList()); } void menuAccounting::sTaxAuthorities() { omfgThis->handleNewWindow(new taxAuthorities()); } void menuAccounting::sTaxZones() { omfgThis->handleNewWindow(new taxZones()); } void menuAccounting::sTaxClasses() { omfgThis->handleNewWindow(new taxClasses()); } void menuAccounting::sTaxCodes() { omfgThis->handleNewWindow(new taxCodes()); } void menuAccounting::sTaxTypes() { omfgThis->handleNewWindow(new taxTypes()); } void menuAccounting::sTaxAssignments() { omfgThis->handleNewWindow(new taxAssignments()); } void menuAccounting::sTaxRegistrations() { omfgThis->handleNewWindow(new taxRegistrations()); } void menuAccounting::sDspTaxHistory() { omfgThis->handleNewWindow(new dspTaxHistory()); } void menuAccounting::sDspBankrecHistory() { omfgThis->handleNewWindow(new dspBankrecHistory()); } void menuAccounting::sDspSummarizedBankrecHistory() { omfgThis->handleNewWindow(new dspSummarizedBankrecHistory()); } void menuAccounting::sBudgets() { omfgThis->handleNewWindow(new budgets()); } void menuAccounting::sMaintainBudget() { ParameterList params; params.append("mode", "new"); maintainBudget *newdlg = new maintainBudget(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuAccounting::sForwardUpdateAccounts() { forwardUpdateAccounts(parent, "", TRUE).exec(); } void menuAccounting::sVendors() { omfgThis->handleNewWindow(new vendors()); } void menuAccounting::sCheckFormats() { omfgThis->handleNewWindow(new checkFormats()); } void menuAccounting::sPrintStatementByCustomer() { printStatementByCustomer(parent, "", TRUE).exec(); } void menuAccounting::sPrintStatementsByCustomerType() { printStatementsByCustomerType(parent, "", TRUE).exec(); } void menuAccounting::sCustomers() { omfgThis->handleNewWindow(new customers()); } void menuAccounting::sUpdateLateCustCreditStatus() { updateLateCustCreditStatus newdlg(parent, "", TRUE); newdlg.exec(); } void menuAccounting::sCreateRecurringInvoices() { createRecurringInvoices newdlg(parent, "", TRUE); newdlg.exec(); } void menuAccounting::sSyncCompanies() { omfgThis->handleNewWindow(new syncCompanies()); } void menuAccounting::sSetup() { ParameterList params; params.append("module", Xt::AccountingModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/menuAccounting.h000066400000000000000000000116251217451700100205320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuAccounting_h #define menuAccounting_h #include #include class QToolBar; class QMenu; class GUIClient; class menuAccounting : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuAccounting(GUIClient *); public slots: // AP void sEnterPurchaseOrder(); void sUnpostedPurchaseOrders(); void sPrintPurchaseOrder(); void sPostPurchaseOrder(); void sDspUninvoicedReceipts(); void sEnterVoucher(); void sEnterMiscVoucher(); void sUnpostedVouchers(); void sPostVouchers(); void sSelectPayments(); void sSelectedPayments(); void sPrepareCheckRun(); void sCreateMiscCheck(); void sViewCheckRun(); void sPrintCheck(); void sPrintCheckRun(); void sVoidCheckRun(); void sPostCheck(); void sPostChecks(); void sApWorkBench(); void sEnterMiscApCreditMemo(); void sUnappliedApCreditMemos(); void sEnterMiscApDebitMemo(); void sDspVendorHistory(); void sDspCheckRegister(); void sDspVoucherRegister(); void sDspAPApplications(); void sDspAPOpenItemsByVendor(); void sDspTimePhasedOpenAPItems(); // AR void sCreateInvoice(); void sRecurringInvoices(); void sUnpostedInvoices(); void sPrintInvoices(); void sReprintInvoices(); void sPostInvoices(); void sPurgeInvoices(); void sEnterCashReceipt(); void sCashReceiptEditList(); void sPostCashReceipts(); void sEnterMiscArCreditMemo(); void sUnappliedArCreditMemos(); void sEnterMiscArDebitMemo(); void sArWorkBench(); void sDspCustomerHistory(); void sDspCashReceipts(); void sDspARApplications(); void sDspInvoiceInformation(); void sDspAROpenItems(); void sDspTimePhasedOpenItems(); void sDspInvoiceRegister(); void sDspDepositsRegister(); // GL void sSimpleEntry(); void sSeriesEntry(); void sUnpostedEntries(); void sEnterStandardJournal(); void sStandardJournals(); void sStandardJournalGroups(); void sPostStandardJournal(); void sPostStandardJournalGroup(); void sPostJournals(); void sFinancialReports(); void sViewFinancialReport(); void sNewFinancialReport(); void sDspGLTransactions(); void sDspSummarizedGLTransactions(); void sDspGLSeries(); void sDspStandardJournalHistory(); void sDspTrialBalances(); void sDspJournals(); void sCompanies(); void sProfitCenters(); void sSubaccounts(); void sAccountNumbers(); void sDuplicateAccountNumbers(); void sSubAccntTypes(); void sAccountingPeriods(); void sAccountingYearPeriods(); void sTaxCodes(); void sTaxTypes(); void sTaxAuthorities(); void sTaxZones(); void sTaxClasses(); void sTaxAssignments(); void sTaxRegistrations(); void sDspTaxHistory(); void sReconcileBankaccount(); void sEnterAdjustment(); void sAdjustmentEditList(); void sDspBankrecHistory(); void sDspSummarizedBankrecHistory(); void sBudgets(); void sMaintainBudget(); void sForwardUpdateAccounts(); void sVendors(); void sCheckFormats(); void sPrintStatementByCustomer(); void sPrintStatementsByCustomerType(); void sCustomers(); void sUpdateLateCustCreditStatus(); void sCreateRecurringInvoices(); void sSyncCompanies(); void sSetup(); private: GUIClient *parent; QToolBar *toolBar; QMenu *mainMenu; QMenu *apMenu; QMenu *apPurchaseMenu; QMenu *apVoucherMenu; QMenu *apPaymentsMenu; QMenu *apMemosMenu; QMenu *apFormsMenu; QMenu *apReportsMenu; QMenu *arMenu; QMenu *arInvoicesMenu; QMenu *arMemosMenu; QMenu *arCashReceiptsMenu; QMenu *arFormsMenu; QMenu *arReportsMenu; QMenu *glMenu; QMenu *glReportsMenu; QMenu *glEnterTransactionMenu; QMenu *glStandardJournalsMenu; QMenu *financialReportsMenu; QMenu *calendarMenu; QMenu *coaMenu; QMenu *budgetMenu; QMenu *taxMenu; QMenu *taxReportsMenu; QMenu *bankrecMenu; QMenu *bankrecDisplaysMenu; QMenu *bankrecReportsMenu; QMenu *utilitiesMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuCRM.cpp000066400000000000000000000272641217451700100174220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include "guiclient.h" #include "project.h" #include "projects.h" #include "dspOrderActivityByProject.h" #include "contact.h" #include "contacts.h" #include "contactMerge.h" #include "crmaccountMerge.h" #include "address.h" #include "addresses.h" #include "crmaccount.h" #include "crmaccounts.h" #include "incidentWorkbench.h" #include "incident.h" #include "opportunityList.h" #include "todoList.h" #include "todoListCalendar.h" #include "todoItem.h" #include "opportunity.h" #include "editOwners.h" #include "createRecurringItems.h" #include "setup.h" #include "menuCRM.h" menuCRM::menuCRM(GUIClient *Pparent) : QObject(Pparent) { setObjectName("crmModule"); parent = Pparent; toolBar = new QToolBar(tr("CRM Tools")); toolBar->setObjectName("CRM Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); // Menus crmMenu = new QMenu(parent); projectsMenu = new QMenu(parent); incidentMenu = new QMenu(parent); todoMenu = new QMenu(parent); reportsMenu = new QMenu(parent); accountsMenu = new QMenu(parent); contactsMenu = new QMenu(parent); addressMenu = new QMenu(parent); utilitiesMenu = new QMenu(parent); opportunityMenu = new QMenu(parent); crmMenu->setObjectName("menu.crm"); projectsMenu->setObjectName("menu.crm.projects"); incidentMenu->setObjectName("menu.crm.incident"); todoMenu->setObjectName("menu.crm.todo"); reportsMenu->setObjectName("menu.crm.reports"); accountsMenu->setObjectName("menu.crm.accounts"); contactsMenu->setObjectName("menu.crm.contacts"); addressMenu->setObjectName("menu.crm.address"); utilitiesMenu->setObjectName("menu.crm.utilities"); opportunityMenu->setObjectName("menu.crm.opportunity"); actionProperties acts[] = { // CRM | Incident { "menu", tr("&Incident"), (char*)incidentMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "crm.incident", tr("&New..."), SLOT(sIncident()), incidentMenu, "MaintainPersonalIncidents MaintainAllIncidents", NULL, NULL, true , NULL }, { "crm.incidentList", tr("&List..."), SLOT(sIncidentWorkbench()), incidentMenu, "ViewPersonalIncidents MaintainPersonalIncidents ViewAllIncidents MaintainAllIncidents", QPixmap(":/images/incidents.png"), toolBar, true , tr("Incident List") }, // CRM / To Do { "menu", tr("&To-Do"), (char*)todoMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "crm.todoItem", tr("&New..."), SLOT(sTodoItem()), todoMenu, "MaintainPersonalToDoItems MaintainAllToDoItems", NULL, NULL, true , NULL }, { "crm.todoList", tr("&List..."), SLOT(sTodoList()), todoMenu, "MaintainPersonalToDoItems ViewPersonalToDoItems MaintainAllToDoItems ViewAllToDoItems", QPixmap(":/images/toDoList.png"), toolBar, true , tr("To-Do List") }, { "crm.todoListCalendar", tr("&Calendar List..."), SLOT(sTodoListCalendar()), todoMenu, "MaintainPersonalToDoItems ViewPersonalToDoItems MaintainAllToDoItems ViewAllToDoItems", NULL, NULL, true, NULL}, // Project { "menu", tr("Pro&ject"), (char*)projectsMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "pm.newProject", tr("&New..."), SLOT(sNewProject()), projectsMenu, "MaintainPersonalProjects MaintainAllProjects", NULL, NULL, true , NULL }, { "pm.projects", tr("&List..."), SLOT(sProjects()), projectsMenu, "ViewPersonalProjects MaintainPersonalProjects ViewAllProjects MaintainAllProjects", QPixmap(":/images/projects.png"), toolBar, true , tr("List Projects") }, // Opportunity { "menu", tr("&Opportunity"), (char*)opportunityMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "crm.newOpportunity", tr("&New..."), SLOT(sNewOpportunity()), opportunityMenu, "MaintainPersonalOpportunities MaintainAllOpportunities", NULL, NULL, true , NULL }, { "crm.listOpportunity", tr("&List..."), SLOT(sOpportunities()), opportunityMenu, "MaintainPersonalOpportunities ViewPersonalOpportunities MaintainAllOpportunities ViewAllOpportunities", NULL, NULL, true , NULL }, { "separator", NULL, NULL, crmMenu, "true", NULL, NULL, true , NULL }, // Reports { "menu", tr("&Reports"), (char*)reportsMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "pm.dspOrderActivityByProject", tr("Order &Activity by Project..."), SLOT(sDspOrderActivityByProject()), reportsMenu, "ViewAllProjects ViewPersonalProjects", NULL, NULL, true , NULL }, { "separator", NULL, NULL, crmMenu, "true", NULL, NULL, true , NULL }, // CRM | Account { "menu", tr("&Account"), (char*)accountsMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "crm.crmaccount", tr("&New..."), SLOT(sCRMAccount()), accountsMenu, "MaintainPersonalCRMAccounts MaintainAllCRMAccounts", NULL, NULL, true , NULL }, { "crm.crmaccounts", tr("&List..."), SLOT(sCRMAccounts()), accountsMenu, "MaintainPersonalCRMAccounts ViewPersonalCRMAccounts MaintainAllCRMAccounts ViewAllCRMAccounts", QPixmap(":/images/accounts.png"), toolBar, true , tr("List Accounts") }, // CRM | Contact { "menu", tr("&Contact"), (char*)contactsMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "crm.contact", tr("&New..."), SLOT(sContact()), contactsMenu, "MaintainPersonalContacts MaintainAllContacts", NULL, NULL, true , NULL }, { "crm.contacts", tr("&List..."), SLOT(sContacts()), contactsMenu, "MaintainPersonalContacts ViewPersonalContacts MaintainAllContacts ViewAllContacts", QPixmap(":/images/contacts.png"), toolBar, true , tr("List Contacts") }, // CRM | Address { "menu", tr("A&ddress"), (char*)addressMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "crm.address", tr("&New..."), SLOT(sAddress()), addressMenu, "MaintainAddresses", NULL, NULL, true , NULL }, { "crm.addresses", tr("&List..."), SLOT(sAddresses()), addressMenu, "MaintainAddresses ViewAddresses", NULL, NULL, true , NULL }, { "separator", NULL, NULL, crmMenu, "true", NULL, NULL, true , NULL }, //Utilities { "menu", tr("&Utilities"), (char*)utilitiesMenu, crmMenu, "true", NULL, NULL, true , NULL }, { "crm.replaceOwner", tr("Edit O&wners"), SLOT(sEditOwners()), utilitiesMenu, "EditOwner", NULL, NULL, true, NULL }, { "crm.createRecurringItems",tr("Create &Recurring Items..."), SLOT(sCreateRecurringItems()),utilitiesMenu, "MaintainPersonalIncidents MaintainPersonalIncidents MaintainAllIncidents MaintainAllProjects MaintainPersonalToDoItems MaintainAllToDoItems", NULL, NULL, true, NULL }, { "crm.contactMerge", tr("&Merge Contacts..."), SLOT(sContactMerge()), utilitiesMenu, "MergeContacts", NULL, NULL, true, NULL }, { "crm.crmaccountMerge", tr("Merge &CRM Accounts..."), SLOT(sCrmaccountMerge()), utilitiesMenu, "MaintainAllCRMAccounts", NULL, NULL, true, NULL }, { "crm.setup", tr("&Setup..."), SLOT(sSetup()), crmMenu, NULL, NULL, NULL, true, NULL} }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(crmMenu, "CRM"); QAction * m = parent->menuBar()->addMenu(crmMenu); if(m) m->setText(tr("C&RM")); } void menuCRM::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (!acts[i].toolTip.isEmpty())) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } void menuCRM::sNewProject() { ParameterList params; params.append("mode", "new"); project newdlg(omfgThis, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuCRM::sProjects() { omfgThis->handleNewWindow(new projects()); } void menuCRM::sDspOrderActivityByProject() { omfgThis->handleNewWindow(new dspOrderActivityByProject()); } void menuCRM::sCRMAccount() { ParameterList params; params.append("mode", "new"); crmaccount* newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuCRM::sCRMAccounts() { omfgThis->handleNewWindow(new crmaccounts()); } void menuCRM::sEditOwners() { omfgThis->handleNewWindow(new editOwners()); } void menuCRM::sCreateRecurringItems() { omfgThis->handleNewWindow(new createRecurringItems(), Qt::ApplicationModal); } void menuCRM::sContact() { ParameterList params; params.append("mode", "new"); contact* newdlg = new contact(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuCRM::sContacts() { omfgThis->handleNewWindow(new contacts()); } void menuCRM::sContactMerge() { omfgThis->handleNewWindow(new contactMerge()); } void menuCRM::sCrmaccountMerge() { omfgThis->handleNewWindow(new crmaccountMerge(omfgThis, "crmaccountMerge"), Qt::WindowModal); } void menuCRM::sAddress() { ParameterList params; params.append("mode", "new"); address* newdlg = new address(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuCRM::sAddresses() { omfgThis->handleNewWindow(new addresses()); } void menuCRM::sIncidentWorkbench() { omfgThis->handleNewWindow(new incidentWorkbench()); } void menuCRM::sIncident() { ParameterList params; params.append("mode", "new"); incident* newdlg = new incident(); newdlg->set(params); newdlg->exec(); } void menuCRM::sTodoList() { ParameterList params; params.append("run"); todoList* win = new todoList(); win->set(params); omfgThis->handleNewWindow(win); } void menuCRM::sTodoListCalendar() { omfgThis->handleNewWindow(new todoListCalendar()); } void menuCRM::sTodoItem() { ParameterList params; params.append("mode", "new"); todoItem* newdlg = new todoItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuCRM::sNewOpportunity() { ParameterList params; params.append("mode", "new"); opportunity newdlg(omfgThis, "", true); newdlg.set(params); newdlg.exec(); } void menuCRM::sOpportunities() { ParameterList params; params.append("run"); opportunityList* win = new opportunityList(); win->set(params); omfgThis->handleNewWindow(win); } void menuCRM::sSetup() { ParameterList params; params.append("module", Xt::CRMModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/menuCRM.h000066400000000000000000000034511217451700100170570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuCRM_h #define menuCRM_h #include #include class QToolBar; class QMenu; class GUIClient; class menuCRM : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuCRM(GUIClient *); public slots: void sNewProject(); void sProjects(); void sDspOrderActivityByProject(); void sAddress(); void sAddresses(); void sCRMAccount(); void sCRMAccounts(); void sContact(); void sContacts(); void sContactMerge(); void sCrmaccountMerge(); void sCreateRecurringItems(); void sIncident(); void sIncidentWorkbench(); void sTodoItem(); void sTodoList(); void sTodoListCalendar(); void sNewOpportunity(); void sOpportunities(); void sEditOwners(); void sSetup(); private: GUIClient *parent; QToolBar *toolBar; QMenu *crmMenu; QMenu *projectsMenu; QMenu *incidentMenu; QMenu *todoMenu; QMenu *reportsMenu; QMenu *accountsMenu; QMenu *contactsMenu; QMenu *addressMenu; QMenu *utilitiesMenu; QMenu *opportunityMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuInventory.cpp000066400000000000000000001366121217451700100207740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include "errorReporter.h" #include "guiclient.h" #include "inputManager.h" #include "itemSite.h" #include "itemSites.h" #include "adjustmentTrans.h" #include "adjustInvValue.h" #include "transferTrans.h" #include "transferOrders.h" #include "transferOrder.h" #include "releaseTransferOrdersByAgent.h" #include "scrapTrans.h" #include "expenseTrans.h" #include "transformTrans.h" #include "resetQOHBalances.h" #include "materialReceiptTrans.h" #include "relocateInventory.h" #include "reassignLotSerial.h" #include "createCountTagsByParameterList.h" #include "createCountTagsByItem.h" #include "createCycleCountTags.h" #include "countSlip.h" #include "countTag.h" #include "enterMiscCount.h" #include "zeroUncountedCountTagsByWarehouse.h" #include "postCountSlips.h" #include "postCountTags.h" #include "purgePostedCountSlips.h" #include "purgePostedCounts.h" #include "thawItemSitesByClassCode.h" #include "packingListBatch.h" #include "issueToShipping.h" #include "maintainShipping.h" #include "shipOrder.h" #include "recallOrders.h" #include "externalShippingList.h" #include "enterPoReceipt.h" #include "enterPoReturn.h" #include "unpostedPoReceipts.h" #include "printPackingList.h" #include "printPackingListBatchByShipvia.h" #include "printShippingForm.h" #include "printShippingForms.h" #include "printLabelsBySo.h" #include "printLabelsByTo.h" #include "printLabelsByInvoice.h" #include "printLabelsByOrder.h" #include "dspShipmentsBySalesOrder.h" #include "dspSummarizedBacklogByWarehouse.h" #include "dspShipmentsBySalesOrder.h" #include "dspShipmentsByDate.h" #include "dspShipmentsByShipment.h" #include "dspFrozenItemSites.h" #include "dspCountSlipEditList.h" #include "dspCountTagEditList.h" #include "dspCountSlipsByWarehouse.h" #include "dspCountTagsByItem.h" #include "dspCountTagsByWarehouse.h" #include "dspCountTagsByClassCode.h" #include "itemAvailabilityWorkbench.h" #include "dspBacklog.h" #include "dspValidLocationsByItem.h" #include "dspQOH.h" #include "dspQOHByLocation.h" #include "dspInventoryLocator.h" #include "dspSlowMovingInventoryByClassCode.h" #include "dspExpiredInventoryByClassCode.h" #include "dspInventoryAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "dspInventoryHistory.h" #include "dspDetailedInventoryHistoryByLotSerial.h" #include "dspDetailedInventoryHistoryByLocation.h" #include "dspUsageStatistics.h" #include "dspTimePhasedUsageStatisticsByItem.h" #include "printItemLabelsByClassCode.h" #include "warehouses.h" #include "warehouse.h" #include "locations.h" #include "dspUnbalancedQOHByClassCode.h" #include "updateABCClass.h" #include "updateCycleCountFrequency.h" #include "updateItemSiteLeadTimes.h" #include "updateReorderLevels.h" #include "updateOUTLevelByItem.h" #include "updateOUTLevels.h" #include "updateOUTLevelsByClassCode.h" #include "summarizeInvTransByClassCode.h" #include "createItemSitesByClassCode.h" #include "setup.h" #include "menuInventory.h" menuInventory::menuInventory(GUIClient *Pparent) : QObject(Pparent) { setObjectName("imModule"); parent = Pparent; toolBar = new QToolBar(tr("Inventory Tools")); toolBar->setObjectName("Inventory Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); mainMenu = new QMenu(parent); itemSitesMenu = new QMenu(parent); warehouseMenu = new QMenu(parent); transferOrderMenu = new QMenu(parent); transactionsMenu = new QMenu(parent); lotSerialControlMenu = new QMenu(parent); physicalMenu = new QMenu(parent); physicalCreateTagsMenu = new QMenu(parent); physicalReportsMenu = new QMenu(parent); physicalReportsTagsMenu = new QMenu(parent); shippingMenu = new QMenu(parent); shippingReportsMenu = new QMenu(parent); shippingFormsMenu = new QMenu(parent); receivingMenu = new QMenu(parent); receivingFormsMenu = new QMenu(parent); formsMenu = new QMenu(parent); formsShipLabelsMenu = new QMenu(parent); reportsMenu = new QMenu(parent); reportsShipmentsMenu = new QMenu(parent); updateItemInfoMenu = new QMenu(parent); updateItemInfoReorderMenu= new QMenu(parent); updateItemInfoOutMenu = new QMenu(parent); utilitiesMenu = new QMenu(parent); mainMenu->setObjectName("menu.im"); warehouseMenu->setObjectName("menu.im.warehouse"); transferOrderMenu->setObjectName("menu.im.transferorder"); transactionsMenu->setObjectName("menu.im.transactions"); lotSerialControlMenu->setObjectName("menu.im.lotserialcontrol"); physicalMenu->setObjectName("menu.im.physical"); physicalCreateTagsMenu->setObjectName("menu.im.physicalcreatetags"); physicalReportsMenu->setObjectName("menu.im.physicalreports"); physicalReportsTagsMenu->setObjectName("menu.im.physicalreportstags"); shippingMenu->setObjectName("menu.im.shipping"); shippingReportsMenu->setObjectName("menu.im.shippingreports"); shippingFormsMenu->setObjectName("menu.im.shippingforms"); receivingMenu->setObjectName("menu.im.receiving"); receivingFormsMenu->setObjectName("menu.im.receivingforms"); formsMenu->setObjectName("menu.im.forms"); formsShipLabelsMenu->setObjectName("menu.im.formsshiplabels"); reportsMenu->setObjectName("menu.im.reports"); reportsShipmentsMenu->setObjectName("menu.im.reportsshipments"); updateItemInfoMenu->setObjectName("menu.im.updateiteminfo"); updateItemInfoReorderMenu->setObjectName("menu.im.updateiteminforeorder"); updateItemInfoOutMenu->setObjectName("menu.im.updateiteminfoout"); utilitiesMenu->setObjectName("menu.im.utilities"); //Handle single vs. multi-warehouse scenario const char *whsModule; QString whsLabel; if (_metrics->boolean("MultiWhs")) { whsModule="im.warehouses"; whsLabel=tr("&List..."); } else { whsModule = "im.warehouse"; // must be char* whsLabel = tr("&Maintain..."); } actionProperties acts[] = { // Inventory | Transfer Orders // TODO: switch between visibility of Inter-Warehouse Transfer and Transfer Orders based on config param? { "menu", tr("Transfer &Order"), (char*)transferOrderMenu, mainMenu, "true", NULL, NULL, _metrics->boolean("MultiWhs"), NULL}, { "im.interWarehouseTransfer", tr("&New..."), SLOT(sNewTransferOrder()), transferOrderMenu, "MaintainTransferOrders", NULL, NULL, _metrics->boolean("MultiWhs"), NULL }, { "im.transferOrders", tr("&List Open..."), SLOT(sTransferOrders()), transferOrderMenu, "ViewTransferOrders MaintainTransferOrders", NULL, NULL, _metrics->boolean("MultiWhs"), NULL }, { "separator", NULL, NULL, transferOrderMenu, "true", NULL, NULL, true, NULL}, { "im.releaseTransferOrders", tr("&Release by Agent..."), SLOT(sReleaseTransferOrdersByAgent()),transferOrderMenu, "ReleaseTransferOrders", NULL, NULL, _metrics->boolean("MultiWhs"), NULL }, // Inventory | Physical Inventory { "menu", tr("&Physical Inventory"), (char*)physicalMenu, mainMenu, "true", NULL, NULL, true, NULL }, // Inventory | Physical Inventory | Create Count Tags { "menu", tr("&Create Count Tags"), (char*)physicalCreateTagsMenu, physicalMenu, "true", NULL, NULL, true, NULL }, { "im.createCountTagsByPlannerCode",tr("by &Planner Code..."), SLOT(sCreateCountTagsByPlannerCode()),physicalCreateTagsMenu, "IssueCountTags", NULL, NULL, true, NULL }, { "im.createCountTagsByClassCode", tr("by &Class Code..."), SLOT(sCreateCountTagsByClassCode()), physicalCreateTagsMenu, "IssueCountTags", NULL, NULL, true, NULL }, { "im.createCountTagsByItem", tr("by &Item..."), SLOT(sCreateCountTagsByItem()), physicalCreateTagsMenu, "IssueCountTags", NULL, NULL, true, NULL }, { "im.createCycleCountTags", tr("Create C&ycle Count Tags..."), SLOT(sCreateCycleCountTags()), physicalMenu, "IssueCountTags", NULL, NULL, true, NULL }, { "separator", NULL, NULL, physicalMenu, "true", NULL, NULL, true, NULL }, { "im.enterCountSlip", tr("Enter Count &Slip..."), SLOT(sEnterCountSlip()), physicalMenu, "EnterCountSlips", NULL, NULL, true, NULL }, { "im.enterCountTag", tr("Enter Count &Tag..."), SLOT(sEnterCountTags()), physicalMenu, "EnterCountTags", NULL, NULL, true, NULL }, { "im.enterMiscInventoryCount", tr("Enter &Misc. Inventory Count..."), SLOT(sEnterMiscCount()), physicalMenu, "EnterMiscCounts", NULL, NULL, true, NULL }, { "im.zeroUncountedCountTags", tr("&Zero Uncounted Count Tags..."), SLOT(sZeroUncountedTagsByWarehouse()),physicalMenu, "ZeroCountTags", NULL, NULL, true, NULL }, { "separator", NULL, NULL, physicalMenu, "true", NULL, NULL, true, NULL }, { "im.thawItemSitesByClassCode", tr("Tha&w Item Sites..."), SLOT(sThawItemSitesByClassCode()), physicalMenu, "ThawInventory", NULL, NULL, true, NULL }, { "separator", NULL, NULL, physicalMenu, "true", NULL, NULL, true, NULL }, { "im.postCountSlips", tr("Post Count S&lips..."), SLOT(sPostCountSlipsByWarehouse()), physicalMenu, "PostCountSlips", NULL, NULL, true, NULL }, { "im.postCountTags", tr("Post Count T&ags..."), SLOT(sPostCountTags()), physicalMenu, "PostCountTags", NULL, NULL, true, NULL }, { "im.purgeCountSlips", tr("&Purge Posted Count Slips..."), SLOT(sPurgePostedCountSlips()), physicalMenu, "PurgeCountSlips", NULL, NULL, true, NULL }, { "im.purgeCountTags", tr("P&urge Posted Count Tags..."), SLOT(sPurgePostedCountTags()), physicalMenu, "PurgeCountTags", NULL, NULL, true, NULL }, { "separator", NULL, NULL, physicalMenu, "true", NULL, NULL, true, NULL }, // Inventory | Physical Inventory | Reports { "menu", tr("&Reports"), (char*)physicalReportsMenu, physicalMenu, "true", NULL, NULL, true, NULL }, { "im.dspFrozenItemSites", tr("&Frozen Item Sites..."), SLOT(sDspFrozenItemSites()), physicalReportsMenu, "ViewItemSites", NULL, NULL, true, NULL }, { "separator", NULL, NULL, physicalReportsMenu, "true", NULL, NULL, true, NULL }, { "im.dspCountSlipEditList", tr("Count S&lip Edit List..."), SLOT(sDspCountSlipEditList()), physicalReportsMenu, "ViewCountTags", NULL, NULL, true, NULL }, { "im.dspCountTagEditList", tr("Count Ta&g Edit List..."), SLOT(sDspCountTagEditList()), physicalReportsMenu, "ViewCountTags", NULL, NULL, true, NULL }, { "separator", NULL, NULL, physicalReportsMenu, "true", NULL, NULL, true, NULL }, { "im.dspCountSlipsByWarehouse", tr("Count &Slips..."), SLOT(sDspCountSlipsByWarehouse()),physicalReportsMenu, "ViewCountTags", NULL, NULL, true, NULL }, // Inventory | Physical Inventory | Reports | Count Tags { "menu", tr("Count &Tags"), (char*)physicalReportsTagsMenu, physicalReportsMenu, "ViewCountTags", NULL, NULL, true, NULL }, { "im.dspCountTagsByItem", tr("by &Item..."), SLOT(sDspCountTagsByItem()), physicalReportsTagsMenu, "ViewCountTags", NULL, NULL, true, NULL }, { "im.dspCountTagsByWarehouse", tr("by Sit&e..."), SLOT(sDspCountTagsByWarehouse()), physicalReportsTagsMenu, "ViewCountTags", NULL, NULL, true, NULL }, { "im.dspCountTagsByClassCode", tr("by &Class Code..."), SLOT(sDspCountTagsByClassCode()), physicalReportsTagsMenu, "ViewCountTags", NULL, NULL, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Inventory | Receiving { "menu", tr("R&eceiving"), (char*)receivingMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "sr.enterReceipt", tr("&New Receipt..."), SLOT(sEnterReceipt()), receivingMenu, "EnterReceipts", NULL, NULL, true, NULL }, { "sr.postReceipts", tr("&List Unposted Receipts..."), SLOT(sPostReceipts()), receivingMenu, "EnterReceipts", QPixmap(":/images/postReceipts.png"), toolBar, true, tr("List Unposted Receipts") }, { "separator", NULL, NULL, receivingMenu, "true", NULL, NULL, true, NULL }, { "sr.enterReturn", tr("Purchase Order &Return..."), SLOT(sEnterReturn()), receivingMenu, "EnterReturns", NULL, NULL, true, NULL }, { "separator", NULL, NULL, receivingMenu, "true", NULL, NULL, true, NULL }, // Inventory | Receiving | Forms { "menu", tr("&Forms"), (char*)receivingFormsMenu, receivingMenu, "true", NULL, NULL, true, NULL }, { "sr.printReceivingLabelsByPo", tr("&Print Receiving Labels..."), SLOT(sPrintReceivingLabelsByPo()), receivingFormsMenu, "ViewShipping", NULL, NULL, true, NULL }, // Inventory | Shipping { "menu", tr("&Shipping"), (char*)shippingMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "sr.issueToShipping", tr("&Issue to Shipping..."), SLOT(sIssueStockToShipping()), shippingMenu, "IssueStockToShipping", QPixmap(":/images/issueStockToShipping.png"), toolBar, true, tr("Issue to Shipping") }, { "sr.maintainShippingContents", tr("&Maintain Shipping Contents..."), SLOT(sDspShippingContents()), shippingMenu, "ViewShipping", NULL, NULL, true, NULL }, { "separator", NULL, NULL, shippingMenu, "true", NULL, NULL, true, NULL }, { "sr.shipOrder", tr("&Ship Order..."), SLOT(sShipOrders()), shippingMenu, "ShipOrders", NULL, NULL, true, NULL }, { "sr.recallOrdersToShipping", tr("R&ecall Orders to Shipping..."), SLOT(sRecallOrders()), shippingMenu, "RecallOrders", NULL, NULL, true, NULL }, { "separator", NULL, NULL, shippingMenu, "true", NULL, NULL, true, NULL }, // Inventory | Shipping | Forms { "menu", tr("&Forms"), (char*)shippingFormsMenu, shippingMenu, "true", NULL, NULL, true, NULL }, { "sr.packingListBatch", tr("Packing List &Batch..."), SLOT(sPackingListBatch()), shippingFormsMenu, "MaintainPackingListBatch ViewPackingListBatch", NULL, NULL, true, NULL }, { "sr.printPackingListBatchByShipvia", tr("Print Packing List Batch by Ship &Via..."), SLOT(sPrintPackingListBatchByShipvia()), shippingFormsMenu, "PrintPackingLists", NULL, NULL, true, NULL }, { "sr.printPackingList", tr("&Packing List..."), SLOT(sPrintPackingLists()), shippingFormsMenu, "PrintPackingLists", NULL, NULL, true, NULL }, { "separator", NULL, NULL, shippingFormsMenu, "true", NULL, NULL, true, NULL }, { "sr.printShippingForm", tr("&Shipping Form..."), SLOT(sPrintShippingForm()), shippingFormsMenu, "PrintBillsOfLading", NULL, NULL, true, NULL }, { "sr.printShippingForms", tr("S&hipping Forms..."), SLOT(sPrintShippingForms()), shippingFormsMenu, "PrintBillsOfLading", NULL, NULL, true, NULL }, // Inventory | Shipping | Forms | Shipping Labels { "menu", tr("Shipping &Labels"), (char*)formsShipLabelsMenu, shippingFormsMenu, "true", NULL, NULL, true, NULL }, { "sr.printShippingLabelsBySo", tr("by &Sales Order..."), SLOT(sPrintShippingLabelsBySo()), formsShipLabelsMenu, "ViewShipping", NULL, NULL, true, NULL }, { "sr.printShippingLabelsByTo", tr("by &Transfer Order..."), SLOT(sPrintShippingLabelsByTo()), formsShipLabelsMenu, "ViewTransferOrders", NULL, NULL, true, NULL }, { "sr.printShippingLabelsByInvoice", tr("by &Invoice..."), SLOT(sPrintShippingLabelsByInvoice()), formsShipLabelsMenu, "ViewShipping", NULL, NULL, true, NULL }, // Inventory | Shipping | Reports { "menu", tr("&Reports"), (char*)shippingReportsMenu, shippingMenu, "true", NULL, NULL, true, NULL }, // Inventory | Shipping | Reports | Backlog { "sr.dspBacklog", tr("&Backlog..."), SLOT(sDspBacklog()), shippingReportsMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, { "separator", NULL, NULL, shippingReportsMenu, "true", NULL, NULL, true, NULL }, // Inventory | Shipping | Reports | Shipments { "menu", tr("&Shipments"), (char*)reportsShipmentsMenu, shippingReportsMenu, "true", NULL, NULL, true, NULL }, { "sr.dspShipmentsBySalesOrder", tr("by Sales &Order..."), SLOT(sDspShipmentsBySalesOrder()), reportsShipmentsMenu, "ViewShipping", NULL, NULL, true, NULL }, { "sr.dspShipmentsByDate", tr("by &Date..."), SLOT(sDspShipmentsByDate()), reportsShipmentsMenu, "ViewShipping", NULL, NULL, true, NULL }, { "sr.dspShipmentsByShipment", tr("by &Shipment..."), SLOT(sDspShipmentsByShipment()), reportsShipmentsMenu, "ViewShipping", NULL, NULL, true, NULL }, // Inventory | Transactions { "menu", tr("&Transactions"), (char*)transactionsMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "im.miscellaneousAdjustment", tr("&Adjustment..."), SLOT(sAdjustmentTrans()), transactionsMenu, "CreateAdjustmentTrans", NULL, NULL, true, NULL }, { "im.scrap", tr("&Scrap..."), SLOT(sScrapTrans()), transactionsMenu, "CreateScrapTrans", NULL, NULL, true, NULL }, { "im.expense", tr("E&xpense..."), SLOT(sExpenseTrans()), transactionsMenu, "CreateExpenseTrans", NULL, NULL, true, NULL }, { "im.materialReceipt", tr("&Material Receipt..."), SLOT(sReceiptTrans()), transactionsMenu, "CreateReceiptTrans", NULL, NULL, true, NULL }, { "im.transform", tr("Trans&form..."), SLOT(sTransformTrans()), transactionsMenu, "CreateTransformTrans", NULL, NULL, _metrics->boolean("Transforms"), NULL }, { "separator", NULL, NULL, transactionsMenu, "true", NULL, NULL, true, NULL }, { "im.resetQOHBalances", tr("&Reset QOH Balances..."),SLOT(sResetQOHBalances()), transactionsMenu, "CreateAdjustmentTrans", NULL, NULL, true, NULL }, { "separator", NULL, NULL, transactionsMenu, "true", NULL, NULL, true, NULL }, { "im.interWarehouseTransfer", tr("&Site Transfer..."), SLOT(sTransferTrans()), transactionsMenu, "CreateInterWarehouseTrans", NULL, NULL, _metrics->boolean("MultiWhs"), NULL }, { "im.relocateInventory", tr("Re&locate Inventory..."),SLOT(sRelocateInventory()), transactionsMenu, "RelocateInventory", NULL, NULL, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Inventory | Forms { "menu", tr("&Forms"), (char*)formsMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "im.printItemLabelsByClassCode", tr("Print &Item Labels..."), SLOT(sPrintItemLabelsByClassCode()), formsMenu, "ViewItemSites", NULL, NULL, true, NULL }, // Inventory | Reports { "menu", tr("&Reports"), (char*)reportsMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "im.dspValidLocationsByItem", tr("&Valid Locations by Item..."),SLOT(sDspValidLocationsByItem()), reportsMenu, "ViewLocations", NULL, NULL, true, NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true, NULL }, // Inventory | Reports | Quantities On Hand { "im.dspQOH", tr("&Quantities On Hand..."), SLOT(sDspQOH()), reportsMenu, "ViewQOH", NULL, NULL, true, NULL }, { "im.dspQOHByLocation", tr("Quantities On Hand By &Location..."), SLOT(sDspQOHByLocation()), reportsMenu, "ViewQOH", NULL, NULL, true, NULL }, { "im.dspLocationLotSerialDetail",tr("&Location/Lot/Serial # Detail..."),SLOT(sDspLocationLotSerialDetail()), reportsMenu, "ViewQOH", NULL, NULL, _metrics->boolean("LotSerialControl"), NULL }, { "im.dspExpiredInventory", tr("&Expired Inventory..."), SLOT(sDspExpiredInventoryByClassCode()), reportsMenu, "ViewQOH", NULL, NULL, _metrics->boolean("LotSerialControl"), NULL }, { "im.dspSlowMovingInventory", tr("Slow &Moving Inventory..."), SLOT(sDspSlowMovingInventoryByClassCode()),reportsMenu, "ViewQOH", NULL, NULL, true, NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true, NULL }, // Inventory| Reports | Inventory Availability { "im.dspInventoryAvailability", tr("Inventory &Availability..."), SLOT(sDspInventoryAvailability()), reportsMenu, "ViewInventoryAvailability", QPixmap(":/images/dspInventoryAvailabilityByPlannerCode.png"), toolBar, true, tr("Inventory Availability by Planner Code") }, { "im.dspSubstituteAvailabilityByRootItem", tr("&Substitute Availability..."), SLOT(sDspSubstituteAvailabilityByRootItem()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true, NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true, NULL }, // Inventory| Reports | Inventory History { "im.dspInventoryHistory", tr("&History..."), SLOT(sDspInventoryHistory()), reportsMenu, "ViewInventoryHistory", NULL, NULL, true, NULL }, { "im.dspDetailedInventoryHistoryByLocation", tr("History by Lo&cation..."), SLOT(sDspDetailedInventoryHistoryByLocation()), reportsMenu, "ViewInventoryHistory", NULL, NULL, true, NULL }, { "im.dspDetailedInventoryHistoryByLot/SerialNumber", tr("History by &Lot/Serial #..."), SLOT(sDspDetailedInventoryHistoryByLotSerial()),reportsMenu, "ViewInventoryHistory", NULL, NULL, _metrics->boolean("LotSerialControl"), NULL }, { "im.dspItemUsageStatistics", tr("&Usage Statistics..."), SLOT(sDspItemUsageStatistics()), reportsMenu, "ViewInventoryHistory", NULL, NULL, true, NULL }, { "im.dspTimePhasedItemUsageStatisticsByItem",tr("Time &Phased Usage Statistics..."), SLOT(sDspTimePhasedUsageStatisticsByItem()),reportsMenu, "ViewInventoryHistory", NULL, NULL, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Inventory | Warehouse { "menu", tr("&Site"), (char*)warehouseMenu, mainMenu, "true", NULL, NULL, true, NULL }, { whsModule, whsLabel, SLOT(sWarehouses()), warehouseMenu, "MaintainWarehouses ViewWarehouses", NULL, NULL, true, NULL }, { "im.warehousesLocations", tr("L&ocations..."), SLOT(sWarehouseLocations()), warehouseMenu, "MaintainLocations ViewLocations", NULL, NULL, true, NULL }, // Inventory | Item Site { "menu", tr("&Item Site"), (char*)itemSitesMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "im.newItemSite", tr("&New..."), SLOT(sNewItemSite()), itemSitesMenu, "MaintainItemSites", NULL, NULL, true, NULL }, { "im.listItemSites", tr("&List..."), SLOT(sItemSites()), itemSitesMenu, "MaintainItemSites ViewItemSites", QPixmap(":/images/itemSites.png"), toolBar, true, tr("List Item Sites") }, { "separator", NULL, NULL, itemSitesMenu, "true", NULL, NULL, true, NULL }, { "im.itemAvailabilityWorkbench", tr("&Workbench..."), SLOT(sDspItemAvailabilityWorkbench()), itemSitesMenu, "ViewItemAvailabilityWorkbench", QPixmap(":/images/itemAvailabilityWorkbench.png"), toolBar, true, tr("Item Availability Workbench") }, // Inventory | Lot/Serial Control { "menu", tr("&Lot/Serial Control"), (char*)lotSerialControlMenu, mainMenu, "true", NULL, NULL, _metrics->boolean("LotSerialControl") , NULL }, { "im.dspLocationLotSerialDetail", tr("&Location Detail..."), SLOT(sDspLocationLotSerialDetail()), lotSerialControlMenu, "ViewQOH", NULL, NULL, _metrics->boolean("LotSerialControl"), NULL }, { "im.dspDetailedInventoryHistoryByLot/SerialNumber", tr("&Detailed Inventory History..."), SLOT(sDspDetailedInventoryHistoryByLotSerial()), lotSerialControlMenu, "ViewInventoryHistory", NULL, NULL, _metrics->boolean("LotSerialControl"), NULL }, { "separator", NULL, NULL, lotSerialControlMenu, "true", NULL, NULL, _metrics->boolean("LotSerialControl") , NULL }, { "im.reassignLotSerialNumber", tr("&Reassign Lot/Serial #..."), SLOT(sReassignLotSerialNumber()), lotSerialControlMenu, "ReassignLotSerial", NULL, NULL, _metrics->boolean("LotSerialControl"), NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Inventory | Utilities { "menu", tr("&Utilities"), (char*)utilitiesMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "im.dspUnbalancedQOHByClassCode", tr("U&nbalanced QOH..."), SLOT(sDspUnbalancedQOHByClassCode()), utilitiesMenu, "ViewItemSites", NULL, NULL, true, NULL }, { "im.adjustInvValue", tr("Adjust Avg. Cost Value..."), SLOT(sAdjustInvValue()), utilitiesMenu, "CreateAdjustmentTrans ViewCosts", NULL, NULL, _metrics->boolean("AllowAvgCostMethod"), NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, true, NULL }, // Inventory | Utilities | Update Item Controls { "menu", tr("&Update Item Controls"), (char*)updateItemInfoMenu, utilitiesMenu, "true", NULL, NULL, true, NULL }, { "im.updateABCClass", tr("&ABC Class..."), SLOT(sUpdateABCClass()), updateItemInfoMenu, "UpdateABCClass", NULL, NULL, true, NULL }, { "im.updateCycleCountFrequency", tr("&Cycle Count Frequency..."), SLOT(sUpdateCycleCountFreq()), updateItemInfoMenu, "UpdateCycleCountFreq",NULL, NULL, true, NULL }, { "im.updateItemSiteLeadTimes", tr("&Item Site Lead Times..."), SLOT(sUpdateItemSiteLeadTimes()), updateItemInfoMenu, "UpdateLeadTime", NULL, NULL, true, NULL }, // Inventory | Utilities | Update Item Controls | Update Reorder Levels { "menu", tr("&Reorder Levels"), (char*)updateItemInfoReorderMenu, updateItemInfoMenu, "UpdateReorderLevels", NULL, NULL, true, NULL }, { "im.updateReorderLevelsByItem", tr("by &Item..."), SLOT(sUpdateReorderLevelByItem()), updateItemInfoReorderMenu,"UpdateReorderLevels", NULL, NULL, true, NULL }, { "im.updateReorderLevelsByPlannerCode", tr("by &Planner Code..."), SLOT(sUpdateReorderLevelsByPlannerCode()),updateItemInfoReorderMenu,"UpdateReorderLevels", NULL, NULL, true, NULL }, { "im.updateReorderLevelsByClassCode", tr("by &Class Code..."), SLOT(sUpdateReorderLevelsByClassCode()), updateItemInfoReorderMenu,"UpdateReorderLevels", NULL, NULL, true, NULL }, // Inventory | Utilities | Update Item Controls | Update Order Up To Levels { "menu", tr("&Order Up To Levels"), (char*)updateItemInfoOutMenu, updateItemInfoMenu, "UpdateOUTLevels", NULL, NULL, true, NULL }, { "im.updateOrderUpToLevelsByItem", tr("by &Item..."), SLOT(sUpdateOUTLevelByItem()), updateItemInfoOutMenu, "UpdateOUTLevels", NULL, NULL, true, NULL }, { "im.updateOrderUpToLevelsByPlannerCode", tr("by &Planner Code..."), SLOT(sUpdateOUTLevelsByPlannerCode()), updateItemInfoOutMenu, "UpdateOUTLevels", NULL, NULL, true, NULL }, { "im.updateOrderUpToLevelsByClassCode", tr("by &Class Code..."), SLOT(sUpdateOUTLevelsByClassCode()), updateItemInfoOutMenu, "UpdateOUTLevels", NULL, NULL, true, NULL }, { "im.summarizeTransactionHistoryByClassCode",tr("Summarize &Transaction History..."),SLOT(sSummarizeInvTransByClassCode()), utilitiesMenu, "SummarizeInventoryTransactions", NULL, NULL, true, NULL }, { "im.createItemSitesByClassCode", tr("&Create Item Sites..."), SLOT(sCreateItemSitesByClassCode()), utilitiesMenu, "MaintainItemSites", NULL, NULL, true, NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, true, NULL }, { "sr.externalShipping", tr("Maintain E&xternal Shipping Records..."), SLOT(sExternalShipping()), utilitiesMenu, "MaintainExternalShipping", NULL, NULL, true, NULL }, // Setup { "im.setup", tr("&Setup..."), SLOT(sSetup()), mainMenu, "true", NULL, NULL, true, NULL} }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); #if 0 mainMenu->insertItem(tr("&Graphs"), graphsMenu ); #endif parent->populateCustomMenu(mainMenu, "Inventory"); QAction * m = parent->menuBar()->addMenu(mainMenu); if(m) m->setText(tr("&Inventory")); // Create connections to the module specific inputManager SIGNALS parent->inputManager()->notify(cBCLocationContents, this, this, SLOT(sCatchLocationContents(int))); parent->inputManager()->notify(cBCCountTag, this, this, SLOT(sCatchCountTag(int))); } void menuInventory::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (!acts[i].toolTip.isEmpty())) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } void menuInventory::sNewItemSite() { ParameterList params; params.append("mode", "new"); itemSite newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuInventory::sItemSites() { omfgThis->handleNewWindow(new itemSites()); } void menuInventory::sAdjustmentTrans() { ParameterList params; params.append("mode", "new"); adjustmentTrans *newdlg = new adjustmentTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sAdjustInvValue() { ParameterList params; params.append("mode", "new"); adjustInvValue *newdlg = new adjustInvValue(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); } void menuInventory::sTransferTrans() { ParameterList params; params.append("mode", "new"); transferTrans *newdlg = new transferTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sNewTransferOrder() { transferOrder::newTransferOrder(-1, -1); } void menuInventory::sTransferOrders() { omfgThis->handleNewWindow(new transferOrders()); } void menuInventory::sReleaseTransferOrdersByAgent() { omfgThis->handleNewWindow(new releaseTransferOrdersByAgent()); } void menuInventory::sReceiptTrans() { ParameterList params; params.append("mode", "new"); materialReceiptTrans *newdlg = new materialReceiptTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sTransformTrans() { ParameterList params; params.append("mode", "new"); transformTrans *newdlg = new transformTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sScrapTrans() { ParameterList params; params.append("mode", "new"); scrapTrans *newdlg = new scrapTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sExpenseTrans() { ParameterList params; params.append("mode", "new"); expenseTrans *newdlg = new expenseTrans(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sResetQOHBalances() { resetQOHBalances(parent, "", TRUE).exec(); } void menuInventory::sRelocateInventory() { relocateInventory(parent, "", TRUE).exec(); } // Lot/Serial Control void menuInventory::sReassignLotSerialNumber() { reassignLotSerial newdlg(parent, "", TRUE); newdlg.exec(); } void menuInventory::sCreateCountTagsByClassCode() { ParameterList params; params.append("classcode"); createCountTagsByParameterList newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuInventory::sCreateCountTagsByPlannerCode() { ParameterList params; params.append("plancode"); createCountTagsByParameterList newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuInventory::sCreateCountTagsByItem() { createCountTagsByItem(parent, "", TRUE).exec(); } void menuInventory::sCreateCycleCountTags() { createCycleCountTags(parent, "", TRUE).exec(); } void menuInventory::sEnterCountSlip() { ParameterList params; params.append("mode", "new"); countSlip newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuInventory::sEnterCountTags() { ParameterList params; params.append("mode", "new"); countTag newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuInventory::sEnterMiscCount() { enterMiscCount(parent, "", TRUE).exec(); } void menuInventory::sZeroUncountedTagsByWarehouse() { zeroUncountedCountTagsByWarehouse(parent, "", TRUE).exec(); } void menuInventory::sThawItemSitesByClassCode() { thawItemSitesByClassCode(parent, "", TRUE).exec(); } void menuInventory::sPostCountSlipsByWarehouse() { postCountSlips(parent, "", TRUE).exec(); } void menuInventory::sPostCountTags() { postCountTags(parent, "", TRUE).exec(); } void menuInventory::sPurgePostedCountSlips() { purgePostedCountSlips(parent, "", TRUE).exec(); } void menuInventory::sPurgePostedCountTags() { purgePostedCounts(parent, "", TRUE).exec(); } void menuInventory::sPackingListBatch() { omfgThis->handleNewWindow(new packingListBatch()); } void menuInventory::sDspShippingContents() { omfgThis->handleNewWindow(new maintainShipping()); } void menuInventory::sIssueStockToShipping() { omfgThis->handleNewWindow(new issueToShipping()); } void menuInventory::sPrintPackingLists() { printPackingList(parent, "", TRUE).exec(); } void menuInventory::sPrintPackingListBatchByShipvia() { printPackingListBatchByShipvia(parent, "", TRUE).exec(); } void menuInventory::sPrintShippingForm() { printShippingForm(parent).exec(); } void menuInventory::sPrintShippingForms() { printShippingForms(parent, "", TRUE).exec(); } void menuInventory::sPrintShippingLabelsBySo() { printLabelsBySo(parent, "", TRUE).exec(); } void menuInventory::sPrintShippingLabelsByTo() { printLabelsByTo(parent, "", TRUE).exec(); } void menuInventory::sPrintShippingLabelsByInvoice() { printLabelsByInvoice(parent, "", TRUE).exec(); } void menuInventory::sPrintReceivingLabelsByPo() { printLabelsByOrder(parent, "", TRUE).exec(); } void menuInventory::sShipOrders() { shipOrder(parent, "", TRUE).exec(); } void menuInventory::sRecallOrders() { omfgThis->handleNewWindow(new recallOrders()); } void menuInventory::sEnterReceipt() { ParameterList params; params.append("mode", "new"); enterPoReceipt *newdlg = new enterPoReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sEnterReturn() { ParameterList params; params.append("mode", "new"); enterPoReturn *newdlg = new enterPoReturn(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sPostReceipts() { //ParameterList params; unpostedPoReceipts *newdlg = new unpostedPoReceipts(); //newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sAddRate() { } void menuInventory::sDspRatesByDestination() { } void menuInventory::sDspBacklog() { omfgThis->handleNewWindow(new dspBacklog()); } void menuInventory::sDspSummarizedBacklogByWarehouse() { omfgThis->handleNewWindow(new dspSummarizedBacklogByWarehouse()); } void menuInventory::sDspShipmentsBySalesOrder() { omfgThis->handleNewWindow(new dspShipmentsBySalesOrder()); } void menuInventory::sDspShipmentsByDate() { omfgThis->handleNewWindow(new dspShipmentsByDate()); } void menuInventory::sDspShipmentsByShipment() { omfgThis->handleNewWindow(new dspShipmentsByShipment()); } void menuInventory::sDspFrozenItemSites() { omfgThis->handleNewWindow(new dspFrozenItemSites()); } void menuInventory::sDspCountSlipEditList() { omfgThis->handleNewWindow(new dspCountSlipEditList()); } void menuInventory::sDspCountTagEditList() { omfgThis->handleNewWindow(new dspCountTagEditList()); } void menuInventory::sDspCountSlipsByWarehouse() { omfgThis->handleNewWindow(new dspCountSlipsByWarehouse()); } void menuInventory::sDspCountTagsByItem() { omfgThis->handleNewWindow(new dspCountTagsByItem()); } void menuInventory::sDspCountTagsByWarehouse() { omfgThis->handleNewWindow(new dspCountTagsByWarehouse()); } void menuInventory::sDspCountTagsByClassCode() { omfgThis->handleNewWindow(new dspCountTagsByClassCode()); } void menuInventory::sDspItemAvailabilityWorkbench() { omfgThis->handleNewWindow(new itemAvailabilityWorkbench()); } void menuInventory::sDspValidLocationsByItem() { omfgThis->handleNewWindow(new dspValidLocationsByItem()); } void menuInventory::sDspQOH() { omfgThis->handleNewWindow(new dspQOH()); } void menuInventory::sDspQOHByLocation() { omfgThis->handleNewWindow(new dspQOHByLocation()); } void menuInventory::sDspLocationLotSerialDetail() { omfgThis->handleNewWindow(new dspInventoryLocator()); } void menuInventory::sDspSlowMovingInventoryByClassCode() { omfgThis->handleNewWindow(new dspSlowMovingInventoryByClassCode()); } void menuInventory::sDspExpiredInventoryByClassCode() { omfgThis->handleNewWindow(new dspExpiredInventoryByClassCode()); } void menuInventory::sDspInventoryAvailability() { omfgThis->handleNewWindow(new dspInventoryAvailability()); } void menuInventory::sDspSubstituteAvailabilityByRootItem() { omfgThis->handleNewWindow(new dspSubstituteAvailabilityByItem()); } void menuInventory::sDspInventoryHistory() { omfgThis->handleNewWindow(new dspInventoryHistory()); } void menuInventory::sDspDetailedInventoryHistoryByLotSerial() { omfgThis->handleNewWindow(new dspDetailedInventoryHistoryByLotSerial()); } void menuInventory::sDspDetailedInventoryHistoryByLocation() { omfgThis->handleNewWindow(new dspDetailedInventoryHistoryByLocation()); } void menuInventory::sDspItemUsageStatistics() { omfgThis->handleNewWindow(new dspUsageStatistics()); } void menuInventory::sDspTimePhasedUsageStatisticsByItem() { omfgThis->handleNewWindow(new dspTimePhasedUsageStatisticsByItem()); } void menuInventory::sPrintItemLabelsByClassCode() { printItemLabelsByClassCode(parent, "", TRUE).exec(); } // Master Information void menuInventory::sWarehouses() { if (_metrics->boolean("MultiWhs")) omfgThis->handleNewWindow(new warehouses()); else { ParameterList params; XSqlQuery whsq("SELECT warehous_id FROM whsinfo;"); if (whsq.first()) { params.append("mode", "edit"); params.append("warehous_id", whsq.value("warehous_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, omfgThis, tr("Error Finding Site"), whsq, __FILE__, __LINE__)) return; else params.append("mode", "new"); warehouse *newdlg = new warehouse(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void menuInventory::sWarehouseLocations() { omfgThis->handleNewWindow(new locations()); } // Utilities void menuInventory::sDspUnbalancedQOHByClassCode() { omfgThis->handleNewWindow(new dspUnbalancedQOHByClassCode()); } void menuInventory::sUpdateABCClass() { updateABCClass(parent, "", TRUE).exec(); } void menuInventory::sUpdateCycleCountFreq() { updateCycleCountFrequency(parent, "", TRUE).exec(); } void menuInventory::sUpdateItemSiteLeadTimes() { updateItemSiteLeadTimes(parent, "", TRUE).exec(); } void menuInventory::sUpdateReorderLevelByItem() { ParameterList params; params.append("item"); updateReorderLevels *newdlg = new updateReorderLevels(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sUpdateReorderLevelsByPlannerCode() { ParameterList params; params.append("plancode"); updateReorderLevels *newdlg = new updateReorderLevels(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sUpdateReorderLevelsByClassCode() { ParameterList params; params.append("classcode"); updateReorderLevels *newdlg = new updateReorderLevels(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sUpdateOUTLevelByItem() { updateOUTLevelByItem(parent, "", TRUE).exec(); } void menuInventory::sUpdateOUTLevelsByPlannerCode() { updateOUTLevels(parent, "", TRUE).exec(); } void menuInventory::sUpdateOUTLevelsByClassCode() { updateOUTLevelsByClassCode(parent, "", TRUE).exec(); } void menuInventory::sSummarizeInvTransByClassCode() { summarizeInvTransByClassCode(parent, "", TRUE).exec(); } void menuInventory::sCreateItemSitesByClassCode() { createItemSitesByClassCode(parent, "", TRUE).exec(); } // inputManager SIGNAL handlers void menuInventory::sCatchLocationContents(int pLocationid) { ParameterList params; params.append("location_id", pLocationid); params.append("run"); dspQOHByLocation *newdlg = new dspQOHByLocation(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuInventory::sCatchCountTag(int pCnttagid) { ParameterList params; params.append("cnttag_id", pCnttagid); params.append("mode", "edit"); countTag newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuInventory::sExternalShipping() { omfgThis->handleNewWindow(new externalShippingList()); } void menuInventory::sSetup() { ParameterList params; params.append("module", Xt::InventoryModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/menuInventory.h000066400000000000000000000120101217451700100204220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuInventory_h #define menuInventory_h #include #include class QToolBar; class QMenu; class GUIClient; class menuInventory : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuInventory(GUIClient *); public slots: void sNewItemSite(); void sItemSites(); void sAdjustmentTrans(); void sAdjustInvValue(); void sTransferTrans(); void sNewTransferOrder(); void sTransferOrders(); void sReleaseTransferOrdersByAgent(); void sReceiptTrans(); void sScrapTrans(); void sExpenseTrans(); void sTransformTrans(); void sResetQOHBalances(); void sRelocateInventory(); void sReassignLotSerialNumber(); void sCreateCountTagsByClassCode(); void sCreateCountTagsByPlannerCode(); void sCreateCountTagsByItem(); void sCreateCycleCountTags(); void sEnterCountSlip(); void sEnterCountTags(); void sEnterMiscCount(); void sZeroUncountedTagsByWarehouse(); void sThawItemSitesByClassCode(); void sPostCountSlipsByWarehouse(); void sPostCountTags(); void sPurgePostedCountSlips(); void sPurgePostedCountTags(); void sPackingListBatch(); void sIssueStockToShipping(); void sShipOrders(); void sRecallOrders(); void sExternalShipping(); void sDspShippingContents(); void sEnterReceipt(); void sEnterReturn(); void sPostReceipts(); void sPrintPackingLists(); void sPrintPackingListBatchByShipvia(); void sPrintShippingForm(); void sPrintShippingForms(); void sPrintShippingLabelsBySo(); void sPrintShippingLabelsByInvoice(); void sPrintReceivingLabelsByPo(); void sPrintShippingLabelsByTo(); void sAddRate(); void sDspRatesByDestination(); void sDspBacklog(); void sDspSummarizedBacklogByWarehouse(); void sDspShipmentsBySalesOrder(); void sDspShipmentsByDate(); void sDspShipmentsByShipment(); void sDspItemAvailabilityWorkbench(); void sDspFrozenItemSites(); void sDspCountSlipEditList(); void sDspCountTagEditList(); void sDspCountSlipsByWarehouse(); void sDspCountTagsByItem(); void sDspCountTagsByWarehouse(); void sDspCountTagsByClassCode(); void sDspValidLocationsByItem(); void sDspQOH(); void sDspQOHByLocation(); void sDspLocationLotSerialDetail(); void sDspSlowMovingInventoryByClassCode(); void sDspExpiredInventoryByClassCode(); void sDspInventoryAvailability(); void sDspSubstituteAvailabilityByRootItem(); void sDspInventoryHistory(); void sDspDetailedInventoryHistoryByLotSerial(); void sDspDetailedInventoryHistoryByLocation(); void sDspItemUsageStatistics(); void sDspTimePhasedUsageStatisticsByItem(); void sPrintItemLabelsByClassCode(); void sWarehouses(); void sWarehouseLocations(); void sDspUnbalancedQOHByClassCode(); void sUpdateABCClass(); void sUpdateCycleCountFreq(); void sUpdateItemSiteLeadTimes(); void sUpdateReorderLevelByItem(); void sUpdateReorderLevelsByPlannerCode(); void sUpdateReorderLevelsByClassCode(); void sUpdateOUTLevelByItem(); void sUpdateOUTLevelsByPlannerCode(); void sUpdateOUTLevelsByClassCode(); void sSummarizeInvTransByClassCode(); void sCreateItemSitesByClassCode(); void sCatchLocationContents(int); void sCatchCountTag(int); void sSetup(); private: GUIClient *parent; QToolBar *toolBar; QMenu *mainMenu; QMenu *itemSitesMenu; QMenu *warehouseMenu; QMenu *transferOrderMenu; QMenu *transactionsMenu; QMenu *lotSerialControlMenu; QMenu *physicalMenu; QMenu *physicalCreateTagsMenu; QMenu *physicalReportsMenu; QMenu *physicalReportsSlipsMenu; QMenu *physicalReportsTagsMenu; QMenu *shippingMenu; QMenu *shippingReportsMenu; QMenu *shippingFormsMenu; QMenu *receivingMenu; QMenu *receivingFormsMenu; QMenu *formsMenu; QMenu *formsShipLabelsMenu; QMenu *graphsMenu; QMenu *reportsMenu; QMenu *reportsShipmentsMenu; QMenu *utilitiesMenu; QMenu *updateItemInfoMenu; QMenu *updateItemInfoReorderMenu; QMenu *updateItemInfoOutMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuManufacture.cpp000066400000000000000000000461511217451700100212470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include "guiclient.h" #include "workOrder.h" #include "explodeWo.h" #include "implodeWo.h" #include "closeWo.h" #include "printWoTraveler.h" #include "printWoPickList.h" #include "releaseWorkOrdersByPlannerCode.h" #include "reprioritizeWo.h" #include "rescheduleWo.h" #include "changeWoQty.h" #include "purgeClosedWorkOrders.h" #include "woMaterialItem.h" #include "workOrderMaterials.h" #include "issueWoMaterialBatch.h" #include "issueWoMaterialItem.h" #include "returnWoMaterialBatch.h" #include "returnWoMaterialItem.h" #include "scrapWoMaterialFromWIP.h" #include "postProduction.h" #include "correctProductionPosting.h" #include "postMiscProduction.h" #include "dspWoSchedule.h" #include "dspWoHistoryByItem.h" #include "dspWoHistoryByNumber.h" #include "dspWoHistoryByClassCode.h" #include "dspWoMaterialsByItem.h" #include "dspWoMaterialsByWorkOrder.h" #include "dspInventoryAvailabilityByWorkOrder.h" #include "dspPendingAvailability.h" #include "dspJobCosting.h" #include "dspMaterialUsageVarianceByBOMItem.h" #include "dspMaterialUsageVarianceByItem.h" #include "dspMaterialUsageVarianceByComponentItem.h" #include "dspMaterialUsageVarianceByWorkOrder.h" #include "dspMaterialUsageVarianceByWarehouse.h" #include "printWoForm.h" #include "setup.h" #include "menuManufacture.h" menuManufacture::menuManufacture(GUIClient *Pparent) : QObject(Pparent) { setObjectName("woModule"); parent = Pparent; toolBar = new QToolBar(tr("Manufacture Tools")); toolBar->setObjectName("Manufacture Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); mainMenu = new QMenu(parent); ordersMenu = new QMenu(parent); formsMenu = new QMenu(parent); materialsMenu = new QMenu(parent); materialsIssueMenu = new QMenu(parent); materialsReturnMenu = new QMenu(parent); transactionsMenu = new QMenu(parent); reportsMenu = new QMenu(parent); reportsHistoryMenu = new QMenu(parent); reportsMatlReqMenu = new QMenu(parent); reportsMatlUseVarMenu = new QMenu(parent); utilitiesMenu = new QMenu(parent); mainMenu->setObjectName("menu.manu"); ordersMenu->setObjectName("menu.manu.orders"); formsMenu->setObjectName("menu.manu.forms"); materialsMenu->setObjectName("menu.manu.materials"); materialsIssueMenu->setObjectName("menu.manu.materialsissue"); materialsReturnMenu->setObjectName("menu.manu.materialsreturn"); transactionsMenu->setObjectName("menu.manu.transactions"); reportsMenu->setObjectName("menu.manu.reports"); reportsHistoryMenu->setObjectName("menu.manu.reportshistory"); reportsMatlReqMenu->setObjectName("menu.manu.reportsmatlreq"); reportsMatlUseVarMenu->setObjectName("menu.manu.reportsmatlusevar"); utilitiesMenu->setObjectName("menu.manu.utilities"); actionProperties acts[] = { // Production | Control { "menu", tr("&Work Order"), (char*)ordersMenu, mainMenu, "true", 0, 0, true, NULL }, { "wo.newWorkOrder", tr("&New..."), SLOT(sNewWorkOrder()), ordersMenu, "MaintainWorkOrders", 0, 0, true, NULL }, { "separator", NULL, NULL, ordersMenu, "true", 0, 0, true, NULL }, { "wo.explodeWorkOrder", tr("E&xplode..."), SLOT(sExplodeWorkOrder()), ordersMenu, "ExplodeWorkOrders", 0, 0, true, NULL }, { "wo.implodeWorkOrder", tr("&Implode..."), SLOT(sImplodeWorkOrder()), ordersMenu, "ImplodeWorkOrders", 0, 0, true, NULL }, { "wo.releaseWorkOrdersByPlannerCode", tr("&Release..."), SLOT(sReleaseWorkOrdersByPlannerCode()), ordersMenu, "ReleaseWorkOrders", 0, 0, true, NULL }, { "wo.closeWorkOrder", tr("&Close..."), SLOT(sCloseWorkOrder()), ordersMenu, "CloseWorkOrders", 0, 0, true, NULL }, { "separator", NULL, NULL, ordersMenu, "true", 0, 0, true, NULL }, { "wo.reprioritizeWorkOrder", tr("Re&prioritize..."), SLOT(sReprioritizeWorkOrder()), ordersMenu, "ReprioritizeWorkOrders",0, 0, true, NULL }, { "wo.rescheduleWorkOrder", tr("Re&schedule..."), SLOT(sRescheduleWorkOrder()), ordersMenu, "RescheduleWorkOrders", 0, 0, true, NULL }, { "wo.changeWorkOrderQuantity",tr("Change &Quantity..."), SLOT(sChangeWorkOrderQty()), ordersMenu, "ChangeWorkOrderQty", 0, 0, true, NULL }, // Production | W/O Materials { "menu", tr("&Materials"), (char*)materialsMenu, mainMenu, "true", 0, 0, true, NULL }, { "wo.createWoMaterialRequirement", tr("&New..."), SLOT(sCreateWoMaterialRequirement()), materialsMenu, "MaintainWoMaterials", 0, 0, true, NULL }, { "wo.maintainWoMaterialRequirements",tr("&Maintain..."), SLOT(sMaintainWoMaterials()), materialsMenu, "MaintainWoMaterials", 0, 0, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", 0, 0, true, NULL }, // Production | Transactions { "menu", tr("&Transactions"), (char*)transactionsMenu, mainMenu, "true", 0, 0, true, NULL }, // Production |Transactions | Issue { "menu", tr("&Issue Material"), (char*)materialsIssueMenu, transactionsMenu, "true", 0, 0, true, NULL }, { "wo.issueWoMaterialBatch", tr("&Batch..."), SLOT(sIssueWoMaterialBatch()), materialsIssueMenu, "IssueWoMaterials", 0, 0, true, NULL }, { "wo.issueWoMaterialItem", tr("&Item..."), SLOT(sIssueWoMaterialItem()), materialsIssueMenu, "IssueWoMaterials", 0, 0, true, NULL }, // Production | Transactions | Return { "menu", tr("Ret&urn Material"), (char*)materialsReturnMenu, transactionsMenu, "true", 0, 0, true, NULL }, { "wo.returnWoMaterialBatch", tr("&Batch..."), SLOT(sReturnWoMaterialBatch()), materialsReturnMenu, "ReturnWoMaterials", 0, 0, true, NULL }, { "wo.returnWoMaterialItem", tr("&Item..."), SLOT(sReturnWoMaterialItem()), materialsReturnMenu, "ReturnWoMaterials", 0, 0, true, NULL }, { "wo.scrapWoMaterialFromWo", tr("&Scrap..."), SLOT(sScrapWoMaterialFromWo()), transactionsMenu, "ScrapWoMaterials", 0, 0, true, NULL }, { "separator", NULL, NULL, transactionsMenu, "true", 0, 0, true, NULL }, { "wo.postProduction", tr("Post Productio&n..."), SLOT(sPostProduction()), transactionsMenu, "PostProduction", 0, 0, true, NULL }, { "wo.correctProductionPosting",tr("C&orrect Production Posting..."),SLOT(sCorrectProductionPosting()),transactionsMenu, "PostProduction", 0, 0, true, NULL }, { "wo.closeWorkOrder", tr("&Close Work Order..."), SLOT(sCloseWorkOrder()), transactionsMenu, "CloseWorkOrders", 0, 0, true, NULL }, { "separator", NULL, NULL, transactionsMenu, "true", 0, 0, true, NULL }, { "wo.postMiscProduction", tr("Post &Misc. Production..."), SLOT(sPostMiscProduction()), transactionsMenu, "PostMiscProduction",0, 0, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", 0, 0, true, NULL }, // Production | Forms { "menu", tr("&Forms"), (char*)formsMenu, mainMenu, "true", 0, 0, true, NULL }, { "wo.printTraveler", tr("Print &Traveler..."), SLOT(sPrintTraveler()), formsMenu, "PrintWorkOrderPaperWork", 0, 0, true, NULL }, { "wo.printPickList", tr("Print &Pick List..."), SLOT(sPrintPickList()), formsMenu, "PrintWorkOrderPaperWork", 0, 0, true, NULL }, { "separator", NULL, NULL, formsMenu, "true", 0, 0, true, NULL }, { "wo.rptPrintWorkOrderForm",tr("Print &Work Order Form..."),SLOT(sPrintWorkOrderForm()),formsMenu, "PrintWorkOrderPaperWork", 0, 0, true, NULL }, // Production | Reports { "menu", tr("&Reports"), (char*)reportsMenu, mainMenu, "true", 0, 0, true, NULL }, // Production | Reports | Schedule { "wo.dspWoSchedule", tr("Work Order &Schedule"), SLOT(sDspWoSchedule()),reportsMenu, "MaintainWorkOrders ViewWorkOrders", QPixmap(":/images/dspWoScheduleByPlannerCode.png"), toolBar, true, tr("Work Order Schedule by Planner Code") }, // Production | Reports | Material Requirements { "menu", tr("&Material Requirements"),(char*)reportsMatlReqMenu, reportsMenu, "true", 0, 0, true, NULL }, { "wo.dspWoMaterialRequirementsByWorkOrder", tr("by &Work Order..."), SLOT(sDspWoMaterialsByWo()), reportsMatlReqMenu, "MaintainWorkOrders ViewWorkOrders", 0, 0, true, NULL }, { "wo.dspWoMaterialRequirementsByComponentItem",tr("by &Component Item..."), SLOT(sDspWoMaterialsByComponentItem()), reportsMatlReqMenu, "MaintainWorkOrders ViewWorkOrders", 0, 0, true, NULL }, { "wo.dspInventoryAvailabilityByWorkOrder", tr("&Inventory Availability..."), SLOT(sDspInventoryAvailabilityByWorkOrder()), reportsMenu, "ViewInventoryAvailability", 0, 0, true, NULL }, { "wo.dspPendingWoMaterialAvailability", tr("&Pending Material Availability..."),SLOT(sDspPendingAvailability()), reportsMenu, "ViewInventoryAvailability", 0, 0, true, NULL }, { "separator", NULL, NULL, reportsMenu, "true", 0, 0, true, NULL }, // Production | Reports | History { "menu", tr("&History"), (char*)reportsHistoryMenu, reportsMenu, "true", 0, 0, true, NULL }, { "wo.dspWoHistoryByClassCode", tr("by &Class Code..."), SLOT(sDspWoHistoryByClassCode()), reportsHistoryMenu, "MaintainWorkOrders ViewWorkOrders", 0, 0, true, NULL }, { "wo.dspWoHistoryByItem", tr("by &Item..."), SLOT(sDspWoHistoryByItem()), reportsHistoryMenu, "MaintainWorkOrders ViewWorkOrders", 0, 0, true, NULL }, { "wo.dspWoHistoryByNumber", tr("by &W/O Number..."), SLOT(sDspWoHistoryByNumber()), reportsHistoryMenu, "MaintainWorkOrders ViewWorkOrders", 0, 0, true, NULL }, { "separator", NULL, NULL, reportsMenu, "true", 0, 0, true, NULL }, { "wo.dspJobCosting", tr("Work Order &Costing..."), SLOT(sDspJobCosting()), reportsMenu, "ViewCosts", 0, 0, true, NULL }, // Production | Reports | Material Usage Variance { "menu", tr("Material &Usage Variance"),(char*)reportsMatlUseVarMenu, reportsMenu, "true", 0, 0, true, NULL }, { "wo.dspMaterialUsageVarianceByWarehouse", tr("by &Site..."), SLOT(sDspMaterialUsageVarianceByWarehouse()), reportsMatlUseVarMenu, "ViewMaterialVariances", 0, 0, true, NULL }, { "wo.dspMaterialUsageVarianceByItem", tr("by &Item..."), SLOT(sDspMaterialUsageVarianceByItem()), reportsMatlUseVarMenu, "ViewMaterialVariances", 0, 0, true, NULL }, { "wo.dspMaterialUsageVarianceByBOMItem", tr("by &BOM Item..."), SLOT(sDspMaterialUsageVarianceByBOMItem()), reportsMatlUseVarMenu, "ViewMaterialVariances", 0, 0, true, NULL }, { "wo.dspMaterialUsageVarianceByComponentItem",tr("by &Component Item..."), SLOT(sDspMaterialUsageVarianceByComponentItem()),reportsMatlUseVarMenu, "ViewMaterialVariances", 0, 0, true, NULL }, { "wo.dspMaterialUsageVarianceByWorkOrder", tr("by &Work Order..."), SLOT(sDspMaterialUsageVarianceByWorkOrder()), reportsMatlUseVarMenu, "ViewMaterialVariances", 0, 0, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", 0, 0, true, NULL }, { "menu", tr("&Utilities"), (char*)utilitiesMenu, mainMenu, "true", 0, 0, true, NULL }, { "wo.purgeClosedWorkOrder",tr("Pur&ge Closed Work Orders..."), SLOT(sPurgeClosedWorkOrders()), utilitiesMenu, "PurgeWorkOrders", 0, 0, true, NULL }, { "wo.setup", tr("&Setup..."), SLOT(sSetup()), mainMenu, NULL, NULL, NULL, true, NULL} }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(mainMenu, "Manufacture"); QAction * m = parent->menuBar()->addMenu(mainMenu); if(m) m->setText(tr("&Manufacture")); } void menuManufacture::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (!acts[i].toolTip.isEmpty())) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } void menuManufacture::sNewWorkOrder() { ParameterList params; params.append("mode", "new"); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuManufacture::sExplodeWorkOrder() { explodeWo(parent, "", TRUE).exec(); } void menuManufacture::sImplodeWorkOrder() { implodeWo(parent, "", TRUE).exec(); } void menuManufacture::sPrintTraveler() { printWoTraveler(parent, "", TRUE).exec(); } void menuManufacture::sPrintPickList() { printWoPickList(parent, "", TRUE).exec(); } void menuManufacture::sCloseWorkOrder() { closeWo(parent, "", TRUE).exec(); } void menuManufacture::sReleaseWorkOrdersByPlannerCode() { releaseWorkOrdersByPlannerCode(parent, "", TRUE).exec(); } void menuManufacture::sReprioritizeWorkOrder() { reprioritizeWo(parent, "", TRUE).exec(); } void menuManufacture::sRescheduleWorkOrder() { rescheduleWo(parent, "", TRUE).exec(); } void menuManufacture::sChangeWorkOrderQty() { changeWoQty(parent, "", TRUE).exec(); } void menuManufacture::sPurgeClosedWorkOrders() { purgeClosedWorkOrders(parent, "", TRUE).exec(); } void menuManufacture::sCreateWoMaterialRequirement() { ParameterList params; params.append("mode", "new"); woMaterialItem newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuManufacture::sMaintainWoMaterials() { omfgThis->handleNewWindow(new workOrderMaterials()); } void menuManufacture::sIssueWoMaterialBatch() { issueWoMaterialBatch(parent, "", TRUE).exec(); } void menuManufacture::sIssueWoMaterialItem() { issueWoMaterialItem(parent, "", TRUE).exec(); } void menuManufacture::sReturnWoMaterialBatch() { returnWoMaterialBatch(parent, "", TRUE).exec(); } void menuManufacture::sReturnWoMaterialItem() { returnWoMaterialItem(parent, "", TRUE).exec(); } void menuManufacture::sScrapWoMaterialFromWo() { ParameterList params; if (_privileges->check("PostProduction")) params.append("canPostProd", true); scrapWoMaterialFromWIP newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuManufacture::sPostProduction() { postProduction(parent, "", TRUE).exec(); } void menuManufacture::sCorrectProductionPosting() { correctProductionPosting(parent, "", TRUE).exec(); } void menuManufacture::sPostMiscProduction() { postMiscProduction(parent, "", TRUE).exec(); } void menuManufacture::sDspWoHistoryByItem() { omfgThis->handleNewWindow(new dspWoHistoryByItem()); } void menuManufacture::sDspWoHistoryByNumber() { omfgThis->handleNewWindow(new dspWoHistoryByNumber()); } void menuManufacture::sDspWoHistoryByClassCode() { omfgThis->handleNewWindow(new dspWoHistoryByClassCode()); } void menuManufacture::sDspWoMaterialsByComponentItem() { omfgThis->handleNewWindow(new dspWoMaterialsByItem()); } void menuManufacture::sDspWoMaterialsByWo() { omfgThis->handleNewWindow(new dspWoMaterialsByWorkOrder()); } void menuManufacture::sDspInventoryAvailabilityByWorkOrder() { omfgThis->handleNewWindow(new dspInventoryAvailabilityByWorkOrder()); } void menuManufacture::sDspPendingAvailability() { omfgThis->handleNewWindow(new dspPendingAvailability()); } void menuManufacture::sDspWoSchedule() { omfgThis->handleNewWindow(new dspWoSchedule()); } void menuManufacture::sDspJobCosting() { omfgThis->handleNewWindow(new dspJobCosting()); } void menuManufacture::sDspMaterialUsageVarianceByBOMItem() { omfgThis->handleNewWindow(new dspMaterialUsageVarianceByBOMItem()); } void menuManufacture::sDspMaterialUsageVarianceByItem() { omfgThis->handleNewWindow(new dspMaterialUsageVarianceByItem()); } void menuManufacture::sDspMaterialUsageVarianceByComponentItem() { omfgThis->handleNewWindow(new dspMaterialUsageVarianceByComponentItem()); } void menuManufacture::sDspMaterialUsageVarianceByWorkOrder() { omfgThis->handleNewWindow(new dspMaterialUsageVarianceByWorkOrder()); } void menuManufacture::sDspMaterialUsageVarianceByWarehouse() { omfgThis->handleNewWindow(new dspMaterialUsageVarianceByWarehouse()); } void menuManufacture::sPrintWorkOrderForm() { printWoForm(parent, "", TRUE).exec(); } void menuManufacture::sSetup() { ParameterList params; params.append("module", Xt::ManufactureModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/menuManufacture.h000066400000000000000000000053501217451700100207100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuManufacture_H #define menuManufacture_H #include #include class QToolBar; class QMenu; class GUIClient; class menuManufacture : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuManufacture(GUIClient *); public slots: void sNewWorkOrder(); void sExplodeWorkOrder(); void sImplodeWorkOrder(); void sCloseWorkOrder(); void sPrintTraveler(); void sPrintPickList(); void sReleaseWorkOrdersByPlannerCode(); void sReprioritizeWorkOrder(); void sRescheduleWorkOrder(); void sChangeWorkOrderQty(); void sPurgeClosedWorkOrders(); void sCreateWoMaterialRequirement(); void sMaintainWoMaterials(); void sIssueWoMaterialBatch(); void sIssueWoMaterialItem(); void sReturnWoMaterialBatch(); void sReturnWoMaterialItem(); void sScrapWoMaterialFromWo(); void sPostProduction(); void sPostMiscProduction(); void sCorrectProductionPosting(); void sDspWoSchedule(); void sDspWoHistoryByItem(); void sDspWoHistoryByNumber(); void sDspWoHistoryByClassCode(); void sDspWoMaterialsByComponentItem(); void sDspWoMaterialsByWo(); void sDspInventoryAvailabilityByWorkOrder(); void sDspPendingAvailability(); void sDspJobCosting(); void sDspMaterialUsageVarianceByBOMItem(); void sDspMaterialUsageVarianceByItem(); void sDspMaterialUsageVarianceByComponentItem(); void sDspMaterialUsageVarianceByWorkOrder(); void sDspMaterialUsageVarianceByWarehouse(); void sPrintWorkOrderForm(); void sSetup(); private: GUIClient *parent; QToolBar *toolBar; QMenu *mainMenu; QMenu *ordersMenu; QMenu *formsMenu; QMenu *materialsMenu; QMenu *materialsIssueMenu; QMenu *materialsReturnMenu; QMenu *transactionsMenu; QMenu *reportsMenu; QMenu *reportsHistoryMenu; QMenu *reportsMatlReqMenu; QMenu *reportsOperationsMenu; QMenu *reportsWoTcMenu; QMenu *reportsMatlUseVarMenu; QMenu *utilitiesMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuProducts.cpp000066400000000000000000000462171217451700100206030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "guiclient.h" #include "inputManager.h" #include "item.h" #include "items.h" #include "copyItem.h" #include "itemGroups.h" #include "itemImages.h" #include "lotSerial.h" #include "bom.h" #include "bomList.h" #include "copyBOM.h" #include "massReplaceComponent.h" #include "massExpireComponent.h" #include "maintainItemCosts.h" #include "updateActualCostsByItem.h" #include "updateActualCostsByClassCode.h" #include "postCostsByItem.h" #include "postCostsByClassCode.h" #include "dspCostedSingleLevelBOM.h" #include "dspCostedIndentedBOM.h" #include "dspCostedSummarizedBOM.h" #include "dspItemCostsByClassCode.h" #include "dspItemCostSummary.h" #include "dspItemCostHistory.h" #include "costingElements.h" #include "dspSingleLevelBOM.h" #include "dspIndentedBOM.h" #include "dspSummarizedBOM.h" #include "dspSingleLevelWhereUsed.h" #include "dspIndentedWhereUsed.h" #include "dspPendingBOMChanges.h" #include "dspCapacityUOMsByClassCode.h" #include "dspCapacityUOMsByProductCategory.h" #include "itemAvailabilityWorkbench.h" #include "dspUndefinedManufacturedItems.h" #include "dspUnusedPurchasedItems.h" #include "dspInvalidBillsOfMaterials.h" #include "reassignClassCodeByClassCode.h" #include "reassignProductCategoryByProductCategory.h" #include "setup.h" #include "menuProducts.h" #include "userPreferences.h" menuProducts::menuProducts(GUIClient *Pparent) : QObject(Pparent) { setObjectName("productMenu"); parent = Pparent; toolBar = new QToolBar(tr("Products Tools")); toolBar->setObjectName("Products Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); mainMenu = new QMenu(parent); itemsMenu = new QMenu(parent); bomMenu = new QMenu(parent); costingMenu = new QMenu(parent); costingUpdActMenu = new QMenu(parent); costingPostActMenu = new QMenu(parent); costingUpdStdMenu = new QMenu(parent); costingReportsMenu = new QMenu(parent); costingReportsCostedMenu = new QMenu(parent); costingReportsItemCostsMenu = new QMenu(parent); reportsMenu = new QMenu(parent); reportsBomsMenu = new QMenu(parent); reportsWhereUsdMenu = new QMenu(parent); reportsCapUomMenu = new QMenu(parent); utilitiesMenu = new QMenu(parent); mainMenu->setObjectName("menu.prod"); itemsMenu->setObjectName("menu.prod.items"); bomMenu->setObjectName("menu.prod.bom"); costingMenu->setObjectName("menu.prod.costing"); costingUpdActMenu->setObjectName("menu.prod.costingupdact"); costingPostActMenu->setObjectName("menu.prod.costingpostact"); costingUpdStdMenu->setObjectName("menu.prod.costingupdstd"); costingReportsMenu->setObjectName("menu.prod.costingreports"); costingReportsCostedMenu->setObjectName("menu.prod.costingreportscosted"); costingReportsItemCostsMenu->setObjectName("menu.prod.costingreportsitemcosts"); reportsMenu->setObjectName("menu.prod.reports"); reportsBomsMenu->setObjectName("menu.prod.reportsboms"); reportsWhereUsdMenu->setObjectName("menu.prod.reportswhereusd"); reportsCapUomMenu->setObjectName("menu.prod.reportscapuom"); utilitiesMenu->setObjectName("menu.prod.utilities"); actionProperties acts[] = { #ifdef Q_WS_MACX { "pd.setup", tr("&Setup..."), SLOT(sPreferences()), mainMenu, "MaintainPreferencesSelf MaintainPreferencesOthers", NULL, NULL, true, NULL }, #endif // Product | Reports { "menu", tr("&Reports"), (char*)reportsMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, // Product | Reports | BOMs { "menu", tr("&Bills of Materials"), (char*)reportsBomsMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "pd.dspSingleLevelBOM", tr("&Single Level..."), SLOT(sDspSingleLevelBOM()), reportsBomsMenu, "ViewBOMs", NULL, NULL, true , NULL }, { "pd.dspIndentedBOM", tr("&Indented..."), SLOT(sDspIndentedBOM()), reportsBomsMenu, "ViewBOMs", NULL, NULL, true , NULL }, { "pd.dspSummarizedBOM", tr("Summari&zed..."), SLOT(sDspSummarizedBOM()), reportsBomsMenu, "ViewBOMs", NULL, NULL, true , NULL }, // Product | Reports | Where Used { "menu", tr("&Where Used"), (char*)reportsWhereUsdMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "pd.dspSingleLevelWhereUsed", tr("&Single Level..."), SLOT(sDspSingleLevelWhereUsed()), reportsWhereUsdMenu, "ViewBOMs", NULL, NULL, true , NULL }, { "pd.dspIndentedWhereUsed", tr("&Indented..."), SLOT(sDspIndentedWhereUsed()), reportsWhereUsdMenu, "ViewBOMs", NULL, NULL, true , NULL }, { "pd.dspPendingBOMChanges", tr("&Pending BOM Changes..."), SLOT(sDspPendingBOMChanges()), reportsMenu, "ViewBOMs", NULL, NULL, true , NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, // Product | Reports | Capacity UOMs { "menu", tr("Capacity &UOMs"), (char*)reportsCapUomMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "pd.dspCapacityUOMsByProductCategory", tr("by &Product Category..."), SLOT(sDspCapacityUOMsByProductCategory()), reportsCapUomMenu, "MaintainItemMasters ViewItemMasters", NULL, NULL, true , NULL }, { "pd.dspCapacityUOMsByClassCode", tr("by &Class Code..."), SLOT(sDspCapacityUOMsByClassCode()), reportsCapUomMenu, "MaintainItemMasters ViewItemMasters", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, // Product | Items { "menu", tr("&Item"), (char*)itemsMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "pd.enterNewItem", tr("&New..."), SLOT(sNewItem()), itemsMenu, "MaintainItemMasters", NULL, NULL, true , NULL }, { "pd.listItems", tr("&List..."), SLOT(sItems()), itemsMenu, "MaintainItemMasters ViewItemMasters", QPixmap(":/images/items.png"), toolBar, true , tr("List Items") }, { "pd.copyItem", tr("&Copy..."), SLOT(sCopyItem()), itemsMenu, "MaintainItemMasters" , NULL, NULL, true, NULL }, { "separator", NULL, NULL, itemsMenu, "true", NULL, NULL, true , NULL }, { "pd.itemAvailabilityWorkbench", tr("&Workbench..."), SLOT(sDspItemAvailabilityWorkbench()), itemsMenu, "ViewItemAvailabilityWorkbench", NULL, NULL, true , NULL }, { "separator", NULL, NULL, itemsMenu, "true", NULL, NULL, true , NULL }, { "pd.itemGroups", tr("&Groups..."), SLOT(sItemGroups()), itemsMenu, "MaintainItemGroups ViewItemGroups", NULL, NULL, true , NULL }, { "pd.itemImages", tr("&Images..."), SLOT(sItemImages()), itemsMenu, "MaintainItemMasters ViewItemMasters", NULL, NULL, true , NULL }, // Product | Bill of Materials { "menu", tr("Bill Of Ma&terials"), (char*)bomMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "pd.enterNewBOM", tr("&New..."), SLOT(sNewBOM()), bomMenu, "MaintainBOMs", NULL, NULL, true , NULL }, { "pd.listBOMs", tr("&List..."), SLOT(sBOMs()), bomMenu, "MaintainBOMs ViewBOMs", QPixmap(":/images/boms.png"), toolBar, true , tr("List Bill of Materials") }, { "pd.copyBOM", tr("&Copy..."), SLOT(sCopyBOM()), bomMenu, "MaintainBOMs", NULL, NULL, true , NULL }, { "separator", NULL, NULL, bomMenu, "true", NULL, NULL, true , NULL }, { "pd.massReplaceComponentItem", tr("Mass &Replace..."), SLOT(sMassReplaceComponent()), bomMenu, "MaintainBOMs", NULL, NULL, true , NULL }, { "pd.massExpireComponentItem", tr("Mass E&xpire..."), SLOT(sMassExpireComponent()), bomMenu, "MaintainBOMs", NULL, NULL, true , NULL }, // Product | Costing { "menu", tr("&Costing"), (char*)costingMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "pd.maintainItemCosts", tr("&Maintain Item Costs..."), SLOT(sMaintainItemCosts()), costingMenu, "ViewCosts", NULL, NULL, true , NULL }, // Product | Lot Serial { "pd.lotSerial", tr("&Lot/Serial..."), SLOT(sLotSerial()), mainMenu, "true", NULL, NULL, _metrics->boolean("LotSerialControl"), NULL }, { "separator", NULL, NULL, costingMenu, "true", NULL, NULL, true , NULL }, // Product | Costing | Update Actual Costs { "menu", tr("Update &Actual Costs"), (char*)costingUpdActMenu, costingMenu, "true", NULL, NULL, true , NULL }, { "pd.updateActualCostsByItem", tr("by &Item..."), SLOT(sUpdateActualCostsByItem()), costingUpdActMenu, "UpdateActualCosts", NULL, NULL, true , NULL }, { "pd.updateActualCostsByClassCode", tr("by &Class Code..."), SLOT(sUpdateActualCostsByClassCode()), costingUpdActMenu, "UpdateActualCosts", NULL, NULL, true , NULL }, // Product | Costing | Post Actual Costs { "menu", tr("&Post Actual Costs"), (char*)costingPostActMenu, costingMenu, "true", NULL, NULL, true , NULL }, { "pd.postActualCostsByItem", tr("by &Item..."), SLOT(sPostActualCostsByItem()), costingPostActMenu, "PostActualCosts", NULL, NULL, true , NULL }, { "pd.postActualCostsByClassCode", tr("by &Class Code..."), SLOT(sPostActualCostsByClassCode()), costingPostActMenu, "PostActualCosts", NULL, NULL, true , NULL }, // Product | Costing | Post Standard Costs { "menu", tr("Post &Standard Costs"), (char*)costingUpdStdMenu, costingMenu, "true", NULL, NULL, true , NULL }, { "pd.postStandardCostsByItem", tr("by &Item..."), SLOT(sUpdateStandardCostsByItem()), costingUpdStdMenu, "PostStandardCosts", NULL, NULL, true , NULL }, { "pd.postStandardCostsByClassCode", tr("by &Class Code..."), SLOT(sUpdateStandardCostsByClassCode()), costingUpdStdMenu, "PostStandardCosts", NULL, NULL, true , NULL }, { "separator", NULL, NULL, costingMenu, "true", NULL, NULL, true , NULL }, // Product | Costing | Reports { "menu", tr("&Reports"), (char*)costingReportsMenu, costingMenu, "true", NULL, NULL, true , NULL }, // Product | Costing | Reports | Costed BOM { "menu", tr("&Costed BOM"), (char*)costingReportsCostedMenu, costingReportsMenu, "true", NULL, NULL, true , NULL }, { "pd.dspCostedSingleLevelBOM", tr("&Single Level..."), SLOT(sDspCostedSingleLevelBOM()),costingReportsCostedMenu, "ViewCosts", NULL, NULL, true , NULL }, { "pd.dspCostedIndentedBOM", tr("&Indented..."), SLOT(sDspCostedIndentedBOM()), costingReportsCostedMenu, "ViewCosts", NULL, NULL, true , NULL }, { "pd.dspCostedSummarizedBOM", tr("Summari&zed..."), SLOT(sDspCostedSummarizedBOM()), costingReportsCostedMenu, "ViewCosts", NULL, NULL, true , NULL }, // Product | Costing | Reports | Item Costs { "menu", tr("&Item Costs"), (char*)costingReportsItemCostsMenu, costingReportsMenu, "true", NULL, NULL, true , NULL }, { "pd.dspItemCostsByClassCode", tr("by &Class Code..."), SLOT(sDspItemCostsByClassCode()), costingReportsItemCostsMenu, "ViewCosts", NULL, NULL, true , NULL }, { "pd.dspItemCostsSummary", tr("&Summary..."), SLOT(sDspItemCostSummary()), costingReportsItemCostsMenu, "ViewCosts", NULL, NULL, true , NULL }, { "pd.dspItemCostsHistory", tr("&History..."), SLOT(sDspItemCostHistory()), costingReportsItemCostsMenu, "ViewCosts", NULL, NULL, true , NULL }, { "separator", NULL, NULL, costingMenu, "true", NULL, NULL, true , NULL }, { "pd.userDefinedCostingElements", tr("&User-Defined Costing Elements..."), SLOT(sUserCostingElements()), costingMenu, "MaintainUserCostingElements", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, // Produt | Utilies { "menu", tr("&Utilities"), (char*)utilitiesMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "pd.dspUnusedPurchasedItems", tr("Unused &Purchased Items..."), SLOT(sDspUnusedPurchasedItems()), utilitiesMenu, "ViewBOMs", NULL, NULL, true , NULL }, { "pd.dspUndefinedManufacturedItems", tr("Undefined &Manufactured Items..."), SLOT(sDspUndefinedManufacturedItems()), utilitiesMenu, "ViewBOMs ViewBOOs", NULL, NULL, true , NULL }, { "pd.dspBillsOfMaterialsWithoutComponentItemSites", tr("Bills of Ma&terials without Component Item Sites..."), SLOT(sDspInvalidBillsOfMaterials()), utilitiesMenu, "ViewBOMs", NULL, NULL, true , NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, true , NULL }, { "pd.reassignClassCodeByClassCode", tr("Reassign &Class Codes..."), SLOT(sReassignClassCodeByClassCode()), utilitiesMenu, "MaintainItemMasters", NULL, NULL, true , NULL }, { "pd.reassignProductCategoryByProductCategory", tr("&Reassign Product Categories..."), SLOT(sReassignProductCategoryByProductCategory()), utilitiesMenu, "MaintainItemMasters", NULL, NULL, true , NULL }, // Setup { "pd.setup", tr("&Setup..."), SLOT(sSetup()), mainMenu, "true", NULL, NULL, true, NULL} }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(mainMenu, "Products"); QAction * m = parent->menuBar()->addMenu(mainMenu); if(m) m->setText(tr("Produc&ts")); } void menuProducts::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { m = acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (!acts[i].toolTip.isEmpty())) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } void menuProducts::sNewItem() { item::newItem(); } void menuProducts::sItems() { omfgThis->handleNewWindow(new items()); } void menuProducts::sCopyItem() { copyItem(parent, "", TRUE).exec(); } void menuProducts::sItemGroups() { omfgThis->handleNewWindow(new itemGroups()); } void menuProducts::sItemImages() { omfgThis->handleNewWindow(new itemImages()); } void menuProducts::sNewBOM() { ParameterList params; params.append("mode", "new"); BOM *newdlg = new BOM(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuProducts::sBOMs() { omfgThis->handleNewWindow(new bomList()); } void menuProducts::sCopyBOM() { copyBOM(parent, "", TRUE).exec(); } void menuProducts::sMassReplaceComponent() { omfgThis->handleNewWindow(new massReplaceComponent(), Qt::ApplicationModal); } void menuProducts::sMassExpireComponent() { omfgThis->handleNewWindow(new massExpireComponent(), Qt::ApplicationModal); } // Costing void menuProducts::sMaintainItemCosts() { omfgThis->handleNewWindow(new maintainItemCosts()); } void menuProducts::sUpdateActualCostsByItem() { ParameterList params; params.append("costtype", "actual"); updateActualCostsByItem *newdlg = new updateActualCostsByItem(parent, "", TRUE); newdlg->set(params); newdlg->exec(); } void menuProducts::sUpdateActualCostsByClassCode() { ParameterList params; params.append("costtype", "actual"); updateActualCostsByClassCode *newdlg = new updateActualCostsByClassCode(parent, "", TRUE); newdlg->set(params); newdlg->exec(); } void menuProducts::sPostActualCostsByItem() { postCostsByItem(parent, "", TRUE).exec(); } void menuProducts::sPostActualCostsByClassCode() { postCostsByClassCode(parent, "", TRUE).exec(); } void menuProducts::sUpdateStandardCostsByItem() { ParameterList params; params.append("costtype", "standard"); updateActualCostsByItem *newdlg = new updateActualCostsByItem(parent, "", TRUE); newdlg->set(params); newdlg->exec(); } void menuProducts::sUpdateStandardCostsByClassCode() { ParameterList params; params.append("costtype", "standard"); updateActualCostsByClassCode *newdlg = new updateActualCostsByClassCode(parent, "", TRUE); newdlg->set(params); newdlg->exec(); } void menuProducts::sDspCostedSingleLevelBOM() { omfgThis->handleNewWindow(new dspCostedSingleLevelBOM()); } void menuProducts::sDspCostedIndentedBOM() { omfgThis->handleNewWindow(new dspCostedIndentedBOM()); } void menuProducts::sDspCostedSummarizedBOM() { omfgThis->handleNewWindow(new dspCostedSummarizedBOM()); } void menuProducts::sDspItemCostsByClassCode() { omfgThis->handleNewWindow(new dspItemCostsByClassCode()); } void menuProducts::sDspItemCostSummary() { omfgThis->handleNewWindow(new dspItemCostSummary()); } void menuProducts::sDspItemCostHistory() { omfgThis->handleNewWindow(new dspItemCostHistory()); } void menuProducts::sUserCostingElements() { omfgThis->handleNewWindow(new costingElements()); } void menuProducts::sLotSerial() { lotSerial newdlg(parent, "", TRUE); newdlg.exec(); } // Displays void menuProducts::sDspSingleLevelBOM() { omfgThis->handleNewWindow(new dspSingleLevelBOM()); } void menuProducts::sDspIndentedBOM() { omfgThis->handleNewWindow(new dspIndentedBOM()); } void menuProducts::sDspSummarizedBOM() { omfgThis->handleNewWindow(new dspSummarizedBOM()); } void menuProducts::sDspSingleLevelWhereUsed() { omfgThis->handleNewWindow(new dspSingleLevelWhereUsed()); } void menuProducts::sDspIndentedWhereUsed() { omfgThis->handleNewWindow(new dspIndentedWhereUsed()); } void menuProducts::sDspPendingBOMChanges() { omfgThis->handleNewWindow(new dspPendingBOMChanges()); } void menuProducts::sDspCapacityUOMsByClassCode() { omfgThis->handleNewWindow(new dspCapacityUOMsByClassCode()); } void menuProducts::sDspCapacityUOMsByProductCategory() { omfgThis->handleNewWindow(new dspCapacityUOMsByProductCategory()); } void menuProducts::sDspItemAvailabilityWorkbench() { omfgThis->handleNewWindow(new itemAvailabilityWorkbench()); } // Utilities void menuProducts::sDspUnusedPurchasedItems() { omfgThis->handleNewWindow(new dspUnusedPurchasedItems()); } void menuProducts::sDspUndefinedManufacturedItems() { omfgThis->handleNewWindow(new dspUndefinedManufacturedItems()); } void menuProducts::sDspInvalidBillsOfMaterials() { omfgThis->handleNewWindow(new dspInvalidBillsOfMaterials()); } void menuProducts::sReassignClassCodeByClassCode() { reassignClassCodeByClassCode(parent, "", TRUE).exec(); } void menuProducts::sReassignProductCategoryByProductCategory() { reassignProductCategoryByProductCategory(parent, "", TRUE).exec(); } void menuProducts::sSetup() { ParameterList params; params.append("module", Xt::ProductsModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } void menuProducts::sPreferences() { userPreferences(parent, "", true).exec(); } qt-client-4.1.0/guiclient/menuProducts.h000066400000000000000000000054451217451700100202460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuProducts_h #define menuProducts_h #include #include class QToolBar; class QMenu; class GUIClient; class menuProducts : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuProducts(GUIClient *); private slots: void sNewItem(); void sItems(); void sLotSerial(); void sCopyItem(); void sItemGroups(); void sItemImages(); void sNewBOM(); void sBOMs(); void sCopyBOM(); void sMassReplaceComponent(); void sMassExpireComponent(); void sMaintainItemCosts(); void sUpdateActualCostsByItem(); void sUpdateActualCostsByClassCode(); void sPostActualCostsByItem(); void sPostActualCostsByClassCode(); void sUpdateStandardCostsByItem(); void sUpdateStandardCostsByClassCode(); void sDspCostedSingleLevelBOM(); void sDspCostedIndentedBOM(); void sDspCostedSummarizedBOM(); void sDspItemCostsByClassCode(); void sDspItemCostSummary(); void sDspItemCostHistory(); void sUserCostingElements(); void sDspSingleLevelBOM(); void sDspIndentedBOM(); void sDspSummarizedBOM(); void sDspSingleLevelWhereUsed(); void sDspIndentedWhereUsed(); void sDspPendingBOMChanges(); void sDspCapacityUOMsByClassCode(); void sDspCapacityUOMsByProductCategory(); void sDspItemAvailabilityWorkbench(); void sDspUnusedPurchasedItems(); void sDspUndefinedManufacturedItems(); void sDspInvalidBillsOfMaterials(); void sReassignClassCodeByClassCode(); void sReassignProductCategoryByProductCategory(); void sSetup(); void sPreferences(); private: GUIClient *parent; QToolBar *toolBar; QMenu *mainMenu; QMenu *itemsMenu; QMenu *bomMenu; QMenu *costingMenu; QMenu *costingUpdActMenu; QMenu *costingPostActMenu; QMenu *costingUpdStdMenu; QMenu *costingReportsMenu; QMenu *costingReportsCostedMenu; QMenu *costingReportsItemCostsMenu; QMenu *reportsMenu; QMenu *reportsBomsMenu; QMenu *reportsWhereUsdMenu; QMenu *reportsCapUomMenu; QMenu *utilitiesMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuPurchase.cpp000066400000000000000000000517661217451700100205570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "guiclient.h" #include "inputManager.h" #include "purchaseOrder.h" #include "unpostedPurchaseOrders.h" #include "printPurchaseOrder.h" #include "printPurchaseOrdersByAgent.h" #include "postPurchaseOrder.h" #include "postPurchaseOrdersByAgent.h" #include "closePurchaseOrder.h" #include "reschedulePoitem.h" #include "changePoitemQty.h" #include "addPoComment.h" #include "dspUninvoicedReceivings.h" #include "voucher.h" #include "miscVoucher.h" #include "openVouchers.h" #include "postVouchers.h" #include "contract.h" #include "contracts.h" #include "itemSource.h" #include "itemSources.h" #include "itemSites.h" #include "dspItemSources.h" #include "dspPurchaseReqsByItem.h" #include "dspPurchaseReqsByPlannerCode.h" #include "dspPoItemsByVendor.h" #include "dspPoItemsByItem.h" #include "dspPoItemsByDate.h" #include "dspPoHistory.h" #include "buyCard.h" #include "dspPoItemReceivingsByVendor.h" #include "dspPoItemReceivingsByItem.h" #include "dspPoItemReceivingsByDate.h" #include "dspPoPriceVariancesByVendor.h" #include "dspPoPriceVariancesByItem.h" #include "dspPoDeliveryDateVariancesByItem.h" #include "dspPoDeliveryDateVariancesByVendor.h" #include "dspPoReturnsByVendor.h" #include "dspPOsByDate.h" #include "dspPOsByVendor.h" #include "printPoForm.h" #include "printVendorForm.h" #include "vendor.h" #include "vendors.h" #include "vendorWorkBench.h" #include "dspItemsWithoutItemSources.h" #include "assignItemToPlannerCode.h" #include "assignClassCodeToPlannerCode.h" #include "setup.h" #include "menuPurchase.h" menuPurchase::menuPurchase(GUIClient *Pparent) : QObject(Pparent) { setObjectName("poModule"); parent = Pparent; toolBar = new QToolBar(tr("Purchase Tools")); toolBar->setObjectName("Purchase Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); mainMenu = new QMenu(parent); requestMenu = new QMenu(parent); ordersMenu = new QMenu(parent); vouchersMenu = new QMenu(parent); contractsMenu = new QMenu(parent); itemSourcesMenu = new QMenu(parent); vendorMenu = new QMenu(parent); formsMenu = new QMenu(parent); reportsMenu = new QMenu(parent); reportsPoMenu = new QMenu(parent); reportsPoItemsMenu = new QMenu(parent); reportsRcptRtrnMenu = new QMenu(parent); reportsPriceVarMenu = new QMenu(parent); reportsDelvVarMenu = new QMenu(parent); utilitiesMenu = new QMenu(parent); mainMenu->setObjectName("menu.purch"); requestMenu->setObjectName("menu.purch.request"); ordersMenu->setObjectName("menu.purch.orders"); vouchersMenu->setObjectName("menu.purch.vouchers"); contractsMenu->setObjectName("menu.purch.contracts"); itemSourcesMenu->setObjectName("menu.purch.itemsources"); vendorMenu->setObjectName("menu.purch.vendor"); formsMenu->setObjectName("menu.purch.forms"); reportsMenu->setObjectName("menu.purch.reports"); reportsPoMenu->setObjectName("menu.purch.reportspo"); reportsPoItemsMenu->setObjectName("menu.purch.reportpoitems"); reportsRcptRtrnMenu->setObjectName("menu.purch.reportsrcptrtrn"); reportsPriceVarMenu->setObjectName("menu.purch.reportspricevar"); reportsDelvVarMenu->setObjectName("menu.purch.reportsdelvvar"); utilitiesMenu->setObjectName("menu.purch.utilities"); actionProperties acts[] = { // Purchase | Requisitions { "menu", tr("Purchase &Requests"), (char*)requestMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.dspPurchaseRequestsByPlannerCode", tr("by &Planner Code..."), SLOT(sDspPurchaseReqsByPlannerCode()), requestMenu, "ViewPurchaseRequests", QPixmap(":/images/dspPurchaseReqByPlannerCode.png"), toolBar, true , tr("Purchase Requests by Planner Code") }, { "po.dspPurchaseRequestsByItem", tr("by &Item..."), SLOT(sDspPurchaseReqsByItem()), requestMenu, "ViewPurchaseRequests", NULL, NULL, true , NULL }, // Purchase | Purchase Order { "menu", tr("&Purchase Order"), (char*)ordersMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.newPurchaseOrder", tr("&New..."), SLOT(sNewPurchaseOrder()), ordersMenu, "MaintainPurchaseOrders", NULL, NULL, true , NULL }, { "po.listUnpostedPurchaseOrders", tr("&List Open..."), SLOT(sPurchaseOrderEditList()), ordersMenu, "MaintainPurchaseOrders ViewPurchaseOrders", QPixmap(":/images/listUnpostedPo.png"), toolBar, true , tr("List Open Purchase Orders") }, { "separator", NULL, NULL, ordersMenu, "true", NULL, NULL, true , NULL }, { "po.postPurchaseOrder", tr("&Release..."), SLOT(sPostPurchaseOrder()), ordersMenu, "ReleasePurchaseOrders", NULL, NULL, true , NULL }, { "po.postPurchaseOrdersByAgent", tr("Release by A&gent..."), SLOT(sPostPurchaseOrdersByAgent()), ordersMenu, "ReleasePurchaseOrders", NULL, NULL, true , NULL }, { "po.closePurchaseOrder", tr("&Close..."), SLOT(sClosePurchaseOrder()), ordersMenu, "MaintainPurchaseOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, ordersMenu, "true", NULL, NULL, true , NULL }, { "po.reschedulePurchaseOrderItem", tr("&Reschedule..."), SLOT(sReschedulePoitem()), ordersMenu, "ReschedulePurchaseOrders", NULL, NULL, true , NULL }, { "wo.changePurchaseOrderItemQty", tr("Change &Qty..."), SLOT(sChangePoitemQty()), ordersMenu, "ChangePurchaseOrderQty", NULL, NULL, true , NULL }, { "wo.addCommentToPurchaseOrder", tr("&Add Comment..."), SLOT(sAddPoComment()), ordersMenu, "MaintainPurchaseOrders", NULL, NULL, true , NULL }, // Purchasing | Voucher { "menu", tr("&Voucher"), (char*)vouchersMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.enterNewVoucher", tr("&New..."), SLOT(sEnterVoucher()), vouchersMenu, "MaintainVouchers", NULL, NULL, true , NULL }, { "po.enterNewMiscVoucher", tr("New &Miscellaneous..."), SLOT(sEnterMiscVoucher()), vouchersMenu, "MaintainVouchers", NULL, NULL, true , NULL }, { "po.listUnpostedVouchers", tr("&List Unposted..."), SLOT(sUnpostedVouchers()), vouchersMenu, "MaintainVouchers ViewVouchers", NULL, NULL, true , NULL }, { "separator", NULL, NULL, vouchersMenu, "true", NULL, NULL, true , NULL }, { "po.postVouchers", tr("&Post..."), SLOT(sPostVouchers()), vouchersMenu, "PostVouchers", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, // Purchasing | Forms { "menu", tr("&Forms"), (char*)formsMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.printPurchaseOrder", tr("Print Purchase &Order..."), SLOT(sPrintPurchaseOrder()), formsMenu, "PrintPurchaseOrders", NULL, NULL, true , NULL }, { "po.printPurchaseOrdersByAgent", tr("Print Purchase Orders by &Agent..."), SLOT(sPrintPurchaseOrdersByAgent()), formsMenu, "PrintPurchaseOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, formsMenu, "true", NULL, NULL, true , NULL }, { "po.printPoForm", tr("Print &P/O Form..."), SLOT(sPrintPOForm()), formsMenu, "PrintPurchaseOrders", NULL, NULL, true , NULL }, { "po.printVendorForm", tr("Print &Vendor Form..."), SLOT(sPrintVendorForm()), formsMenu, "MaintainVendors ViewVendors", NULL, NULL, true , NULL }, // Purchasing | Reports { "menu", tr("&Reports"), (char*)reportsMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.itemSites", tr("Item &Sites..."), SLOT(sItemSites()), reportsMenu, "ViewItemSites", NULL, NULL, true , NULL }, // Purchasing | Reports | Item Sources { "po.dspItemSources", tr("&Item Sources..."), SLOT(sDspItemSources()), reportsMenu, "ViewItemSources", NULL, NULL, true , NULL }, { "po.dspBuyCard", tr("&Buy Card..."), SLOT(sDspBuyCard()), reportsMenu, "ViewItemSources", NULL, NULL, true , NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, // Purchasing | Reports | Purchase Requests // { "menu", tr("Purchase Re&quests"), (char*)requestMenu, reportsMenu, "true", NULL, NULL, true , NULL }, // { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, // Purchasing | Reports | P/Os { "menu", tr("&Purchase Orders"), (char*)reportsPoMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "po.dspPOsByVendor", tr("by &Vendor..."), SLOT(sDspPOsByVendor()), reportsPoMenu, "ViewPurchaseOrders", NULL, NULL, true , NULL }, { "po.dspPOsByDate", tr("by &Date..."), SLOT(sDspPOsByDate()), reportsPoMenu, "ViewPurchaseOrders", NULL, NULL, true , NULL }, // Purchasing | Reports | P/O Items { "menu", tr("Purchase &Order Items"), (char*)reportsPoItemsMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "po.dspPoLineItemsByVendor", tr("by &Vendor..."), SLOT(sDspPoItemsByVendor()), reportsPoItemsMenu, "ViewPurchaseOrders", NULL, NULL, true , NULL }, { "po.dspPoLineItemsByDate", tr("by &Date..."), SLOT(sDspPoItemsByDate()), reportsPoItemsMenu, "ViewPurchaseOrders", NULL, NULL, true , NULL }, { "po.dspPoLineItemsByItem", tr("by &Item..."), SLOT(sDspPoItemsByItem()), reportsPoItemsMenu, "ViewPurchaseOrders", NULL, NULL, true , NULL }, { "po.dspPoHistory", tr("Purchase Order &History..."), SLOT(sDspPoHistory()), reportsMenu, "ViewPurchaseOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, // Purchasing | Reports | Receipts and Returns { "menu", tr("&Receipts and Returns"), (char*)reportsRcptRtrnMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "po.dspReceiptsAndReturnsByVendor", tr("by &Vendor..."), SLOT(sDspReceiptsReturnsByVendor()), reportsRcptRtrnMenu, "ViewReceiptsReturns", NULL, NULL, true , NULL }, { "po.dspReceiptsAndReturnsByDate", tr("by &Date..."), SLOT(sDspReceiptsReturnsByDate()), reportsRcptRtrnMenu, "ViewReceiptsReturns", NULL, NULL, true , NULL }, { "po.dspReceiptsAndReturnsByItem", tr("by &Item..."), SLOT(sDspReceiptsReturnsByItem()), reportsRcptRtrnMenu, "ViewReceiptsReturns", NULL, NULL, true , NULL }, { "po.uninvoicedReceipts", tr("&Uninvoiced Receipts and Returns..."), SLOT(sDspUninvoicedReceipts()), reportsMenu, "ViewUninvoicedReceipts MaintainUninvoicedReceipts", NULL, NULL, true , NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, // Purchasing | Reports | Price Variances { "menu", tr("Price &Variances"), (char*)reportsPriceVarMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "po.dspPriceVariancesByVendor", tr("by &Vendor..."), SLOT(sDspPriceVariancesByVendor()), reportsPriceVarMenu, "ViewVendorPerformance", NULL, NULL, true , NULL }, { "po.dspPriceVariancesByItem", tr("by &Item..."), SLOT(sDspPriceVariancesByItem()), reportsPriceVarMenu, "ViewVendorPerformance", NULL, NULL, true , NULL }, // Purchasing | Reports | Delivery Date Variance { "menu", tr("&Delivery Date Variances"), (char*)reportsDelvVarMenu, reportsMenu, "true", NULL, NULL, true , NULL }, { "po.dspDeliveryDateVariancesByVendor", tr("by &Vendor..."), SLOT(sDspPoDeliveryDateVariancesByVendor()), reportsDelvVarMenu, "ViewVendorPerformance", NULL, NULL, true , NULL }, { "po.dspDeliveryDateVariancesByItem", tr("by &Item..."), SLOT(sDspPoDeliveryDateVariancesByItem()), reportsDelvVarMenu, "ViewVendorPerformance", NULL, NULL, true , NULL }, { "po.dspRejectedMaterialByVendor", tr("Rejected &Material..."), SLOT(sDspRejectedMaterialByVendor()), reportsMenu, "ViewVendorPerformance", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, // Purchasing | Vendor { "menu", tr("V&endor"), (char*)vendorMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.newVendor", tr("&New..."), SLOT(sNewVendor()), vendorMenu, "MaintainVendors", NULL, NULL, true , NULL }, { "po.vendors", tr("&List..."), SLOT(sVendors()), vendorMenu, "MaintainVendors ViewVendors", NULL, NULL, true , NULL }, { "separator", NULL, NULL, vendorMenu, "true", NULL, NULL, true , NULL }, { "po.vendorWorkBench", tr("&Workbench..."), SLOT(sVendorWorkBench()), vendorMenu, "MaintainVendors", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, // P/O | Contract { "menu", tr("&Contract"), (char*)contractsMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.enterNewContract", tr("&New..."), SLOT(sNewContract()), contractsMenu, "MaintainItemSources", NULL, NULL, true , NULL }, { "po.listContracts", tr("&List..."), SLOT(sContracts()), contractsMenu, "MaintainItemSources ViewItemSources", NULL, NULL, true , NULL }, // P/O | Item Source { "menu", tr("&Item Source"), (char*)itemSourcesMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.enterNewItemSource", tr("&New..."), SLOT(sNewItemSource()), itemSourcesMenu, "MaintainItemSources", NULL, NULL, true , NULL }, { "po.listItemSources", tr("&List..."), SLOT(sItemSources()), itemSourcesMenu, "MaintainItemSources ViewItemSources", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, // Purchasing | Utilities { "menu", tr("&Utilities"), (char*)utilitiesMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "po.itemsWithoutItemSources", tr("&Items without Item Sources..."), SLOT(sItemsWithoutItemSources()), utilitiesMenu, "ViewItemMasters", NULL, NULL, true , NULL }, { "po.assignItemToPlannerCode", tr("&Assign Item to Planner Code..."), SLOT(sAssignItemToPlannerCode()), utilitiesMenu, "AssignItemsToPlannerCode", NULL, NULL, true , NULL }, { "po.assignItemsToPlannerCodeByClassCode", tr("Assign Item&s to Planner Code..."), SLOT(sAssignClassCodeToPlannerCode()), utilitiesMenu, "AssignItemsToPlannerCode", NULL, NULL, true , NULL }, // Setup { "po.setup", tr("&Setup..."), SLOT(sSetup()), mainMenu, NULL, NULL, NULL, true, NULL} }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(mainMenu, "Purchase"); QAction * m = parent->menuBar()->addMenu(mainMenu); if(m) m->setText(tr("P&urchase")); } void menuPurchase::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (!acts[i].toolTip.isEmpty())) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } void menuPurchase::sNewPurchaseOrder() { ParameterList params; params.append("mode", "new"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuPurchase::sPurchaseOrderEditList() { omfgThis->handleNewWindow(new unpostedPurchaseOrders()); } void menuPurchase::sPrintPurchaseOrder() { printPurchaseOrder(parent, "", TRUE).exec(); } void menuPurchase::sPrintPurchaseOrdersByAgent() { printPurchaseOrdersByAgent(parent, "", TRUE).exec(); } void menuPurchase::sPostPurchaseOrder() { postPurchaseOrder(parent, "", TRUE).exec(); } void menuPurchase::sPostPurchaseOrdersByAgent() { postPurchaseOrdersByAgent(parent, "", TRUE).exec(); } void menuPurchase::sClosePurchaseOrder() { closePurchaseOrder(parent, "", TRUE).exec(); } void menuPurchase::sReschedulePoitem() { reschedulePoitem(parent, "", TRUE).exec(); } void menuPurchase::sChangePoitemQty() { changePoitemQty(parent, "", TRUE).exec(); } void menuPurchase::sAddPoComment() { addPoComment(parent, "", TRUE).exec(); } void menuPurchase::sDspUninvoicedReceipts() { omfgThis->handleNewWindow(new dspUninvoicedReceivings()); } void menuPurchase::sEnterVoucher() { ParameterList params; params.append("mode", "new"); voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuPurchase::sEnterMiscVoucher() { ParameterList params; params.append("mode", "new"); miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuPurchase::sUnpostedVouchers() { omfgThis->handleNewWindow(new openVouchers()); } void menuPurchase::sPostVouchers() { postVouchers(parent, "", TRUE).exec(); } void menuPurchase::sNewItemSource() { ParameterList params; params.append("mode", "new"); itemSource newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuPurchase::sItemSources() { omfgThis->handleNewWindow(new itemSources()); } void menuPurchase::sNewContract() { ParameterList params; params.append("mode", "new"); contract newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuPurchase::sContracts() { omfgThis->handleNewWindow(new contracts()); } void menuPurchase::sDspPurchaseReqsByItem() { omfgThis->handleNewWindow(new dspPurchaseReqsByItem()); } void menuPurchase::sDspPurchaseReqsByPlannerCode() { omfgThis->handleNewWindow(new dspPurchaseReqsByPlannerCode()); } void menuPurchase::sItemSites() { ParameterList params; itemSites *newdlg = new itemSites(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuPurchase::sDspPOsByDate() { omfgThis->handleNewWindow(new dspPOsByDate()); } void menuPurchase::sDspPOsByVendor() { omfgThis->handleNewWindow(new dspPOsByVendor()); } void menuPurchase::sDspPoItemsByVendor() { omfgThis->handleNewWindow(new dspPoItemsByVendor()); } void menuPurchase::sDspPoItemsByItem() { omfgThis->handleNewWindow(new dspPoItemsByItem()); } void menuPurchase::sDspPoItemsByDate() { omfgThis->handleNewWindow(new dspPoItemsByDate()); } void menuPurchase::sDspPoHistory() { omfgThis->handleNewWindow(new dspPoHistory()); } void menuPurchase::sDspItemSources() { omfgThis->handleNewWindow(new dspItemSources()); } void menuPurchase::sDspBuyCard() { omfgThis->handleNewWindow(new buyCard()); } void menuPurchase::sDspReceiptsReturnsByVendor() { omfgThis->handleNewWindow(new dspPoItemReceivingsByVendor()); } void menuPurchase::sDspReceiptsReturnsByItem() { omfgThis->handleNewWindow(new dspPoItemReceivingsByItem()); } void menuPurchase::sDspReceiptsReturnsByDate() { omfgThis->handleNewWindow(new dspPoItemReceivingsByDate()); } void menuPurchase::sDspPriceVariancesByVendor() { omfgThis->handleNewWindow(new dspPoPriceVariancesByVendor()); } void menuPurchase::sDspPriceVariancesByItem() { omfgThis->handleNewWindow(new dspPoPriceVariancesByItem()); } void menuPurchase::sDspPoDeliveryDateVariancesByItem() { omfgThis->handleNewWindow(new dspPoDeliveryDateVariancesByItem()); } void menuPurchase::sDspPoDeliveryDateVariancesByVendor() { omfgThis->handleNewWindow(new dspPoDeliveryDateVariancesByVendor()); } void menuPurchase::sDspRejectedMaterialByVendor() { omfgThis->handleNewWindow(new dspPoReturnsByVendor()); } void menuPurchase::sPrintPOForm() { printPoForm(parent, "", TRUE).exec(); } void menuPurchase::sPrintVendorForm() { printVendorForm(parent, "", TRUE).exec(); } // Master Information void menuPurchase::sNewVendor() { ParameterList params; params.append("mode", "new"); vendor *newdlg = new vendor(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuPurchase::sVendors() { omfgThis->handleNewWindow(new vendors()); } void menuPurchase::sVendorWorkBench() { omfgThis->handleNewWindow(new vendorWorkBench()); } // Utilities void menuPurchase::sItemsWithoutItemSources() { omfgThis->handleNewWindow(new dspItemsWithoutItemSources()); } void menuPurchase::sAssignItemToPlannerCode() { assignItemToPlannerCode(parent, "", TRUE).exec(); } void menuPurchase::sAssignClassCodeToPlannerCode() { assignClassCodeToPlannerCode(parent, "", TRUE).exec(); } void menuPurchase::sSetup() { ParameterList params; params.append("module", Xt::PurchaseModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/menuPurchase.h000066400000000000000000000056041217451700100202120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuPurchase_h #define menuPurchase_h #include #include class QToolBar; class QMenu; class GUIClient; class menuPurchase : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuPurchase(GUIClient *); public slots: void sNewPurchaseOrder(); void sPurchaseOrderEditList(); void sPrintPurchaseOrder(); void sPrintPurchaseOrdersByAgent(); void sPostPurchaseOrder(); void sPostPurchaseOrdersByAgent(); void sClosePurchaseOrder(); void sReschedulePoitem(); void sChangePoitemQty(); void sAddPoComment(); void sDspUninvoicedReceipts(); void sEnterVoucher(); void sEnterMiscVoucher(); void sUnpostedVouchers(); void sPostVouchers(); void sNewItemSource(); void sItemSources(); void sNewContract(); void sContracts(); void sItemSites(); void sDspPurchaseReqsByItem(); void sDspPurchaseReqsByPlannerCode(); void sDspPOsByDate(); void sDspPOsByVendor(); void sDspPoItemsByVendor(); void sDspPoItemsByItem(); void sDspPoItemsByDate(); void sDspPoHistory(); void sDspItemSources(); void sDspBuyCard(); void sDspReceiptsReturnsByVendor(); void sDspReceiptsReturnsByItem(); void sDspReceiptsReturnsByDate(); void sDspPriceVariancesByVendor(); void sDspPriceVariancesByItem(); void sDspPoDeliveryDateVariancesByVendor(); void sDspPoDeliveryDateVariancesByItem(); void sDspRejectedMaterialByVendor(); void sPrintPOForm(); void sPrintVendorForm(); void sNewVendor(); void sVendors(); void sVendorWorkBench(); void sItemsWithoutItemSources(); void sAssignItemToPlannerCode(); void sAssignClassCodeToPlannerCode(); void sSetup(); private: GUIClient *parent; QToolBar *toolBar; QMenu *mainMenu; QMenu *requestMenu; QMenu *ordersMenu; QMenu *vouchersMenu; QMenu *contractsMenu; QMenu *itemSourcesMenu; QMenu *vendorMenu; QMenu *formsMenu; QMenu *reportsMenu; QMenu *reportsPoMenu; QMenu *reportsPoItemsMenu; QMenu *reportsRcptRtrnMenu; QMenu *reportsPriceVarMenu; QMenu *reportsDelvVarMenu; QMenu *utilitiesMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuSales.cpp000066400000000000000000000763541217451700100200540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "guiclient.h" #include "salesOrder.h" #include "openSalesOrders.h" #include "quotes.h" #include "returnAuthorization.h" #include "openReturnAuthorizations.h" #include "returnAuthorizationWorkbench.h" #include "packingListBatch.h" #include "printPackingList.h" #include "uninvoicedShipments.h" #include "selectShippedOrders.h" #include "selectOrderForBilling.h" #include "dspBillingSelections.h" #include "createInvoices.h" #include "unpostedInvoices.h" #include "reprintInvoices.h" #include "printInvoices.h" #include "purgeInvoices.h" #include "creditMemo.h" #include "unpostedCreditMemos.h" #include "creditMemoEditList.h" #include "printCreditMemos.h" #include "reprintCreditMemos.h" #include "postCreditMemos.h" #include "purgeCreditMemos.h" #include "postInvoices.h" #include "itemListPrice.h" #include "updateListPricesByProductCategory.h" #include "itemPricingSchedules.h" #include "pricingScheduleAssignments.h" #include "sales.h" #include "updatePrices.h" #include "dspPricesByItem.h" #include "dspPricesByCustomer.h" #include "dspPricesByCustomerType.h" #include "dspFreightPricesByCustomer.h" #include "dspFreightPricesByCustomerType.h" #include "dspSalesOrdersByCustomer.h" #include "dspSalesOrdersByItem.h" #include "dspSalesOrdersByCustomerPO.h" #include "dspSalesOrdersByParameterList.h" #include "dspQuotesByCustomer.h" #include "dspQuotesByItem.h" #include "dspInventoryAvailability.h" #include "dspInventoryAvailabilityByCustomerType.h" #include "dspInventoryAvailabilityBySalesOrder.h" #include "dspReservations.h" #include "dspSalesOrderStatus.h" #include "dspBacklog.h" #include "dspSummarizedBacklogByWarehouse.h" #include "dspPartiallyShippedOrders.h" #include "dspEarnedCommissions.h" #include "dspBriefEarnedCommissions.h" #include "dspTaxHistory.h" #include "dspSalesHistory.h" #include "dspBriefSalesHistory.h" #include "dspBookings.h" #include "dspSummarizedSales.h" #include "dspTimePhasedBookings.h" #include "dspTimePhasedSales.h" #include "printSoForm.h" #include "printRaForm.h" #include "customer.h" #include "customers.h" #include "prospect.h" #include "prospects.h" #include "updateCreditStatusByCustomer.h" #include "customerGroups.h" #include "reassignCustomerTypeByCustomerType.h" #include "characteristics.h" #include "archRestoreSalesHistory.h" #include "allocateReservations.h" #include "setup.h" #include "menuSales.h" menuSales::menuSales(GUIClient *pParent) : QObject(pParent) { setObjectName("soModule"); parent = pParent; toolBar = new QToolBar(tr("Sales Tools")); toolBar->setObjectName("Sales Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); mainMenu = new QMenu(parent); quotesMenu = new QMenu(parent); ordersMenu = new QMenu(parent); billingMenu = new QMenu(parent); billingInvoicesMenu = new QMenu(parent); billingCreditMemosMenu= new QMenu(parent); billingFormsMenu= new QMenu(parent); returnsMenu= new QMenu(parent); lookupMenu = new QMenu(parent); lookupQuoteMenu = new QMenu(parent); lookupSoMenu = new QMenu(parent); formsMenu = new QMenu(parent); reportsMenu = new QMenu(parent); analysisMenu = new QMenu(parent); prospectMenu = new QMenu(parent); customerMenu = new QMenu(parent); pricingReportsMenu = new QMenu(parent); pricingMenu = new QMenu(parent); pricingUpdateMenu = new QMenu(parent); utilitiesMenu = new QMenu(parent); mainMenu->setObjectName("menu.sales"); quotesMenu->setObjectName("menu.sales.quotes"); ordersMenu->setObjectName("menu.sales.orders"); billingMenu->setObjectName("menu.sales.billing"); billingInvoicesMenu->setObjectName("menu.sales.billinginvoices"); billingCreditMemosMenu->setObjectName("menu.sales.billingcreditmemos"); billingFormsMenu->setObjectName("menu.sales.billingforms"); returnsMenu->setObjectName("menu.sales.returns"); lookupMenu->setObjectName("menu.sales.lookup"); lookupQuoteMenu->setObjectName("menu.sales.lookupquote"); lookupSoMenu->setObjectName("menu.sales.lookupso"); formsMenu->setObjectName("menu.sales.forms"); reportsMenu->setObjectName("menu.sales.reports"); analysisMenu->setObjectName("menu.sales.analysis"); prospectMenu->setObjectName("menu.sales.prospect"); customerMenu->setObjectName("menu.sales.customer"); pricingReportsMenu->setObjectName("menu.sales.pricingreports"); pricingMenu->setObjectName("menu.sales.pricing"); pricingUpdateMenu->setObjectName("menu.sales.pricingupdate"); utilitiesMenu->setObjectName("menu.sales.utilities"); actionProperties acts[] = { // Sales | Quotes { "menu", tr("&Quote"), (char*)quotesMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.newQuote", tr("&New..."), SLOT(sNewQuote()), quotesMenu, "MaintainQuotes", NULL, NULL, true, NULL }, { "so.listQuotes", tr("&List..."), SLOT(sQuotes()), quotesMenu, "MaintainQuotes ViewQuotes", NULL, NULL, true, NULL }, // Sales | Sales Order { "menu", tr("&Sales Order"), (char*)ordersMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.newSalesOrder", tr("&New..."), SLOT(sNewSalesOrder()), ordersMenu, "MaintainSalesOrders", NULL, NULL, true, NULL }, { "so.listOpenSalesOrders", tr("&List Open..."), SLOT(sOpenSalesOrders()), ordersMenu, "MaintainSalesOrders ViewSalesOrders", QPixmap(":/images/listOpenSalesOrders.png"), toolBar, true, tr("List Open Sales Orders") }, // Sales | Billing { "menu", tr("&Billing"), (char*)billingMenu, mainMenu, "true", NULL, NULL, true, NULL }, // Sales | Billing | Invoice { "menu", tr("&Invoice"), (char*)billingInvoicesMenu, billingMenu, "true", NULL, NULL, true, NULL }, { "so.uninvoicedShipments", tr("&Uninvoiced Shipments..."), SLOT(sUninvoicedShipments()), billingInvoicesMenu, "SelectBilling", QPixmap(":/images/uninvoicedShipments"), toolBar, true, tr("Uninvoiced Shipments") }, { "so.selectAllShippedOrdersForBilling", tr("Select &All Shipped Orders for Billing..."), SLOT(sSelectShippedOrdersForBilling()), billingInvoicesMenu, "SelectBilling", NULL, NULL, true, NULL }, { "so.selectOrderForBilling", tr("Select &Order for Billing..."), SLOT(sSelectOrderForBilling()), billingInvoicesMenu, "SelectBilling", NULL, NULL, true, NULL }, { "separator", NULL, NULL, billingInvoicesMenu, "true", NULL, NULL, true, NULL }, { "so.dspBillingSelections", tr("Billing &Selections..."), SLOT(sDspBillingSelections()), billingInvoicesMenu, "SelectBilling", QPixmap(":/images/billingSelections"), toolBar, true, tr("Billing Selections") }, { "so.createInvoices", tr("&Create Invoices..."), SLOT(sCreateInvoices()), billingInvoicesMenu, "SelectBilling", NULL, NULL, true, NULL }, { "separator", NULL, NULL, billingInvoicesMenu, "true", NULL, NULL, true, NULL }, { "so.listUnpostedInvoices", tr("&List Unposted Invoices..."), SLOT(sUnpostedInvoices()), billingInvoicesMenu, "SelectBilling", NULL, NULL, true, NULL }, { "so.postInvoices", tr("Post &Invoices..."), SLOT(sPostInvoices()), billingInvoicesMenu, "PostMiscInvoices", NULL, NULL, true, NULL }, // Sales | Billing | Credit Memo { "menu", tr("&Credit Memo"), (char*)billingCreditMemosMenu, billingMenu, "true", NULL, NULL, true, NULL }, { "so.newCreditMemo", tr("&New..."), SLOT(sNewCreditMemo()), billingCreditMemosMenu, "MaintainCreditMemos", NULL, NULL, true, NULL }, { "so.listUnpostedCreditMemos", tr("&List Unposted..."), SLOT(sUnpostedCreditMemos()), billingCreditMemosMenu, "MaintainCreditMemos ViewCreditMemos", NULL, NULL, true, NULL }, { "so.creditMemoEditList", tr("&Edit List..."), SLOT(sCreditMemoEditList()), billingCreditMemosMenu, "MaintainCreditMemos ViewCreditMemos", NULL, NULL, true, NULL }, { "separator", NULL, NULL, billingCreditMemosMenu, "true", NULL, NULL, true, NULL }, { "so.postCreditMemos", tr("&Post..."), SLOT(sPostCreditMemos()), billingCreditMemosMenu, "PostARDocuments", NULL, NULL, true, NULL }, { "separator", NULL, NULL, billingMenu, "true", NULL, NULL, true, NULL }, // Sales | Billing | Forms { "menu", tr("&Forms"), (char*)billingFormsMenu, billingMenu, "true", NULL, NULL, true, NULL }, { "so.printInvoices", tr("&Print Invoices..."), SLOT(sPrintInvoices()), billingFormsMenu, "PrintInvoices", NULL, NULL, true, NULL }, { "so.reprintInvoices", tr("&Re-Print Invoices..."), SLOT(sReprintInvoices()), billingFormsMenu, "PrintInvoices", NULL, NULL, true, NULL }, { "separator", NULL, NULL, billingFormsMenu, "true", NULL, NULL, true , NULL }, { "so.printCreditMemos", tr("Print &Credit Memos..."), SLOT(sPrintCreditMemos()), billingFormsMenu, "PrintCreditMemos", NULL, NULL, true, NULL }, { "so.reprintCreditMemos", tr("Re-Print Credit &Memos..."), SLOT(sReprintCreditMemos()), billingFormsMenu, "PrintCreditMemos", NULL, NULL, true, NULL }, // Sales | Returns { "menu", tr("&Return"), (char*)returnsMenu, mainMenu, "true", NULL, NULL, _metrics->boolean("EnableReturnAuth"), NULL }, { "so.newReturn", tr("&New..."), SLOT(sNewReturn()), returnsMenu, "MaintainReturns", NULL, NULL, true, NULL }, { "so.openReturns", tr("&List Open..."), SLOT(sOpenReturns()), returnsMenu, "MaintainReturns ViewReturns", NULL, NULL, true, NULL }, { "separator", NULL, NULL, returnsMenu, "true", NULL, NULL, true , NULL }, { "so.returnsWorkbench", tr("&Workbench..."), SLOT(sReturnsWorkbench()), returnsMenu, "MaintainReturns ViewReturns", NULL, NULL, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Sales | Lookup { "menu", tr("&Lookup"), (char*)lookupMenu, mainMenu, "true", NULL, NULL, true, NULL }, // Sales | Lookup | Quote Lookup { "menu", tr("&Quote"), (char*)lookupQuoteMenu, lookupMenu, "true", NULL, NULL, true, NULL }, { "so.dspQuoteLookupByCustomer", tr("by &Customer..."), SLOT(sDspQuoteLookupByCustomer()), lookupQuoteMenu, "ViewQuotes", NULL, NULL, true, NULL }, { "so.dspQuoteOrderLookupByItem", tr("by &Item..."), SLOT(sDspQuoteLookupByItem()), lookupQuoteMenu, "ViewQuotes", NULL, NULL, true, NULL }, // Sales | Lookup | Sales Order Lookup { "menu", tr("&Sales Order"), (char*)lookupSoMenu, lookupMenu, "true", NULL, NULL, true, NULL }, { "so.dspSalesOrderLookupByCustomerType", tr("by Customer &Type..."), SLOT(sDspOrderLookupByCustomerType()), lookupSoMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, { "so.dspSalesOrderLookupByCustomer", tr("by &Customer..."), SLOT(sDspOrderLookupByCustomer()), lookupSoMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, { "so.dspSalesOrderLookupByCustomerPO", tr("by Customer &PO..."), SLOT(sDspOrderLookupByCustomerPO()), lookupSoMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, { "so.dspSalesOrderLookupByItem", tr("by &Item..."), SLOT(sDspOrderLookupByItem()), lookupSoMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, { "separator", NULL, NULL, lookupMenu, "true", NULL, NULL, true, NULL }, { "so.dspSalesOrderStatus", tr("Sales Order S&tatus..."), SLOT(sDspSalesOrderStatus()), lookupMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, // Sales | Forms { "menu", tr("&Forms"), (char*)formsMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.printSalesOrderForm", tr("Print Sales &Order Form..."), SLOT(sPrintSalesOrderForm()), formsMenu, "MaintainSalesOrders ViewSalesOrders", NULL, NULL, true, NULL }, { "so.printReturnAuthForm", tr("Print &Return Auth. Form..."), SLOT(sPrintReturnAuthForm()), formsMenu, "MaintainReturns", NULL, NULL, _metrics->boolean("EnableReturnAuth"), NULL }, { "separator", NULL, NULL, formsMenu, "true", NULL, NULL, true , NULL }, { "so.packingListBatch", tr("Packing &List Batch..."), SLOT(sPackingListBatch()), formsMenu, "MaintainPackingListBatch ViewPackingListBatch", NULL, NULL, true, NULL }, { "so.printPackingList", tr("&Print Packing List..."), SLOT(sPrintPackingList()), formsMenu, "PrintPackingLists", NULL, NULL, true, NULL }, // Sales | Reports { "menu", tr("&Reports"), (char*)reportsMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.dspSummarizedBacklogByWarehouse", tr("Su&mmarized Backlog..."), SLOT(sDspSummarizedBacklogByWarehouse()), reportsMenu, "ViewSalesOrders", QPixmap(":/images/dspSummarizedBacklogByWhse.png"), toolBar, true, tr("Summarized Backlog") }, // Sales | Reports | Backlog { "so.dspBacklog", tr("&Backlog..."), SLOT(sDspBacklog()), reportsMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, { "so.dspPartiallyShippedOrders", tr("&Partially Shipped Orders..."), SLOT(sDspPartiallyShippedOrders()), reportsMenu, "ViewSalesOrders", NULL, NULL, true, NULL }, { "so.dspReservations", tr("Reservations by Item..."), SLOT(sDspReservations()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, _metrics->boolean("EnableSOReservations"), NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true, NULL }, // Sales | Reports | Inventory Availability { "so.dspInventoryAvailability", tr("Inventory &Availability..."), SLOT(sDspInventoryAvailability()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true, NULL }, { "so.dspInventoryAvailabilityBySalesOrder", tr("Availability by &Sales Order..."), SLOT(sDspInventoryAvailabilityBySalesOrder()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true, NULL }, { "so.dspInventoryAvailabilityByCustomerType", tr("Availability by &Customer Type..."), SLOT(sDspInventoryAvailabilityByCustomerType()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true, NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true, NULL }, { "so.dspEarnedCommissions", tr("&Earned Commissions..."), SLOT(sDspEarnedCommissions()), reportsMenu, "ViewCommissions", NULL, NULL, true, NULL }, { "so.dspBriefEarnedCommissions", tr("B&rief Earned Commissions..."), SLOT(sDspBriefEarnedCommissions()), reportsMenu, "ViewCommissions", NULL, NULL, true, NULL }, { "so.dspTaxHistory", tr("Tax History..."), SLOT(sDspTaxHistory()), reportsMenu, "ViewTaxReconciliations", NULL, NULL, true, NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true, NULL }, // Sales | Analysis { "menu", tr("&Analysis"), (char*)analysisMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "sa.dspBookings", tr("&Bookings..."), SLOT(sDspBookings()), analysisMenu, "ViewSalesOrders", NULL, NULL, true , NULL }, { "sa.dspTimePhasedBookings", tr("T&ime Phased Bookings..."), SLOT(sDspTimePhasedBookings()), analysisMenu, "ViewSalesOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, analysisMenu, "true", NULL, NULL, true, NULL }, { "sa.dspSalesHistory", tr("Sales &History..."), SLOT(sDspSalesHistory()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL }, { "sa.dspBriefSalesHistory", tr("Brie&f Sales History..."), SLOT(sDspBriefSalesHistory()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL }, { "sa.dspSummarizedSalesHistory", tr("Summari&zed Sales History..."), SLOT(sDspSummarizedSales()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL }, { "sa.dspTimePhasedSalesHistory", tr("Time &Phased Sales History..."), SLOT(sDspTimePhasedSales()), analysisMenu, "ViewSalesHistory", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, // Sales | Prospect { "menu", tr("&Prospect"), (char*)prospectMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.enterNewProspect", tr("&New..."), SLOT(sNewProspect()), prospectMenu, "MaintainProspectMasters", NULL, NULL, true, NULL }, { "so.prospects", tr("&List..."), SLOT(sProspects()), prospectMenu, "MaintainProspectMasters ViewProspectMasters", NULL, NULL, true, NULL }, // Sales | Customer { "menu", tr("&Customer"), (char*)customerMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.enterNewCustomer", tr("&New..."), SLOT(sNewCustomer()), customerMenu, "MaintainCustomerMasters", NULL, NULL, true, NULL }, { "so.customers", tr("&List..."), SLOT(sCustomers()), customerMenu, "MaintainCustomerMasters ViewCustomerMasters", NULL, NULL, true, NULL }, { "separator", NULL, NULL, customerMenu, "true", NULL, NULL, true, NULL }, { "so.customerWorkbench", tr("&Workbench..."), SLOT(sCustomerWorkbench()), customerMenu, "MaintainCustomerMasters ViewCustomerMasters", QPixmap(":/images/customerInformationWorkbench.png"), toolBar, true, tr("Customer Workbench") }, { "separator", NULL, NULL, customerMenu, "true", NULL, NULL, true, NULL }, { "so.customerGroups", tr("&Groups..."), SLOT(sCustomerGroups()), customerMenu, "MaintainCustomerGroups ViewCustomerGroups", NULL, NULL, true, NULL }, // Sales | Pricing { "menu", tr("Pricing"), (char*)pricingMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.itemListPrice", tr("Item &List Price..."), SLOT(sItemListPrice()), pricingMenu, "MaintainListPrices ViewListPrices", NULL, NULL, true, NULL }, { "so.updateListPricesByProductCategory", tr("&Update List Prices..."), SLOT(sUpdateListPricesByProductCategory()), pricingMenu, "MaintainListPrices", NULL, NULL, true, NULL }, { "separator", NULL, NULL, pricingMenu, "true", NULL, NULL, true, NULL }, { "so.pricingSchedules", tr("Pricing &Schedules..."), SLOT(sPricingSchedules()), pricingMenu, "MaintainListPrices ViewListPrices", NULL, NULL, true, NULL }, { "so.updatePricingSchedules", tr("Update Pricing Schedules..."), SLOT(sUpdatePrices()), pricingMenu, "UpdatePricingSchedules", NULL, NULL, true, NULL }, { "so.pricingScheduleAssignments", tr("Pricing Schedule Assi&gnments..."), SLOT(sPricingScheduleAssignments()), pricingMenu, "AssignPricingSchedules", NULL, NULL, true, NULL }, { "so.sales", tr("S&ales..."), SLOT(sSales()), pricingMenu, "CreateSales", NULL, NULL, true, NULL }, { "separator", NULL, NULL, pricingMenu, "true", NULL, NULL, true, NULL }, // Sales | Pricing | Reports { "menu", tr("&Reports"), (char*)pricingReportsMenu, pricingMenu, "true", NULL, NULL, true, NULL }, { "so.dspPricesByCustomerType", tr("Item Prices by Customer &Type..."), SLOT(sDspPricesByCustomerType()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL, true, NULL }, { "so.dspPricesByCustomer", tr("Item Prices by &Customer..."), SLOT(sDspPricesByCustomer()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL, true, NULL }, { "so.dspPricesByItem", tr("Item Prices by &Item..."), SLOT(sDspPricesByItem()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL, true, NULL }, { "separator", NULL, NULL, pricingReportsMenu, "true", NULL, NULL, true, NULL }, { "so.dspFreightPricesByCustomerType", tr("Freight Prices by Customer &Type..."), SLOT(sDspFreightPricesByCustomerType()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL, true, NULL }, { "so.dspFreightPricesByCustomer", tr("Freight Prices by &Customer..."), SLOT(sDspFreightPricesByCustomer()), pricingReportsMenu, "ViewCustomerPrices", NULL, NULL, true, NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true, NULL }, { "menu", tr("&Utilities"), (char*)utilitiesMenu, mainMenu, "true", NULL, NULL, true, NULL }, { "so.reassignCustomerTypeByCustomerType", tr("&Reassign Customer Type by Customer Type..."), SLOT(sReassignCustomerTypeByCustomerType()), utilitiesMenu, "MaintainCustomerMasters", NULL, NULL, true, NULL }, { "so.updateCreditStatusByCustomer", tr("&Update Credit Status by Customer..."), SLOT(sUpdateCreditStatusByCustomer()), utilitiesMenu, "MaintainCustomerMasters UpdateCustomerCreditStatus", NULL, NULL, true, NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, true, NULL }, { "so.purgeInvoices", tr("Purge &Invoices..."), SLOT(sPurgeInvoices()), utilitiesMenu, "PurgeInvoices", NULL, NULL, true, NULL }, { "so.purgeCreditMemos", tr("Purge Credit &Memos..."), SLOT(sPurgeCreditMemos()), utilitiesMenu, "PurgeCreditMemos", NULL, NULL, true, NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, _metrics->boolean("EnableSOReservations"), NULL }, { "so.allocateReservations", tr("Allocate Reser&vations..."), SLOT(sAllocateReservations()), utilitiesMenu, "MaintainReservations", NULL, NULL, _metrics->boolean("EnableSOReservations") , NULL }, { "separator", NULL, NULL, utilitiesMenu, "true", NULL, NULL, true, NULL }, { "sa.archieveSalesHistory", tr("&Archive Sales History..."), SLOT(sArchiveSalesHistory()), utilitiesMenu, "ArchiveSalesHistory", NULL, NULL, true , NULL }, { "sa.restoreSalesHistory", tr("Restore &Sales History..."), SLOT(sRestoreSalesHistory()), utilitiesMenu, "RestoreSalesHistory", NULL, NULL, true , NULL }, { "so.setup", tr("&Setup..."), SLOT(sSetup()), mainMenu, NULL, NULL, NULL, true, NULL }, }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(mainMenu, "Sales"); QAction * m = parent->menuBar()->addMenu(mainMenu); if(m) m->setText(tr("S&ales")); } void menuSales::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (!acts[i].toolTip.isEmpty())) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } // Orders void menuSales::sNewSalesOrder() { salesOrder::newSalesOrder(-1); } void menuSales::sOpenSalesOrders() { omfgThis->handleNewWindow(new openSalesOrders()); } void menuSales::sPackingListBatch() { omfgThis->handleNewWindow(new packingListBatch()); } void menuSales::sPrintPackingList() { printPackingList(parent, "", TRUE).exec(); } void menuSales::sNewQuote() { ParameterList params; params.append("mode", "newQuote"); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sQuotes() { omfgThis->handleNewWindow(new quotes()); } // Billing void menuSales::sUninvoicedShipments() { omfgThis->handleNewWindow(new uninvoicedShipments()); } void menuSales::sSelectShippedOrdersForBilling() { selectShippedOrders(parent, "", TRUE).exec(); } void menuSales::sSelectOrderForBilling() { ParameterList params; params.append("mode", "new"); selectOrderForBilling *newdlg = new selectOrderForBilling(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sDspBillingSelections() { omfgThis->handleNewWindow(new dspBillingSelections()); } void menuSales::sCreateInvoices() { createInvoices(parent, "", TRUE).exec(); } void menuSales::sUnpostedInvoices() { omfgThis->handleNewWindow(new unpostedInvoices()); } void menuSales::sPrintInvoices() { printInvoices(parent, "", TRUE).exec(); } void menuSales::sReprintInvoices() { reprintInvoices(parent, "", TRUE).exec(); } void menuSales::sPostInvoices() { postInvoices(parent, "", TRUE).exec(); } void menuSales::sPurgeInvoices() { purgeInvoices(parent, "", TRUE).exec(); } void menuSales::sNewCreditMemo() { ParameterList params; params.append("mode", "new"); creditMemo *newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sUnpostedCreditMemos() { omfgThis->handleNewWindow(new unpostedCreditMemos()); } void menuSales::sCreditMemoEditList() { omfgThis->handleNewWindow(new creditMemoEditList()); } void menuSales::sPrintCreditMemos() { printCreditMemos(parent, "", TRUE).exec(); } void menuSales::sReprintCreditMemos() { reprintCreditMemos(parent, "", TRUE).exec(); } void menuSales::sPostCreditMemos() { postCreditMemos(parent, "", TRUE).exec(); } void menuSales::sPurgeCreditMemos() { purgeCreditMemos(parent, "", TRUE).exec(); } void menuSales::sNewReturn() { ParameterList params; params.append("mode", "new"); returnAuthorization *newdlg = new returnAuthorization(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sOpenReturns() { ParameterList params; params.append("run"); openReturnAuthorizations* win = new openReturnAuthorizations(); win->set(params); omfgThis->handleNewWindow(win); } void menuSales::sReturnsWorkbench() { omfgThis->handleNewWindow(new returnAuthorizationWorkbench()); } // S/O | Item Pricing void menuSales::sItemListPrice() { itemListPrice newdlg(parent, "", TRUE); newdlg.exec(); } void menuSales::sUpdateListPricesByProductCategory() { updateListPricesByProductCategory newdlg(parent, "", TRUE); newdlg.exec(); } void menuSales::sPricingSchedules() { omfgThis->handleNewWindow(new itemPricingSchedules()); } void menuSales::sPricingScheduleAssignments() { omfgThis->handleNewWindow(new pricingScheduleAssignments()); } void menuSales::sSales() { omfgThis->handleNewWindow(new sales()); } void menuSales::sUpdatePrices() { updatePrices(parent, "", TRUE).exec(); } void menuSales::sDspPricesByItem() { omfgThis->handleNewWindow(new dspPricesByItem()); } void menuSales::sDspPricesByCustomer() { omfgThis->handleNewWindow(new dspPricesByCustomer()); } void menuSales::sDspPricesByCustomerType() { omfgThis->handleNewWindow(new dspPricesByCustomerType()); } void menuSales::sDspFreightPricesByCustomer() { omfgThis->handleNewWindow(new dspFreightPricesByCustomer()); } void menuSales::sDspFreightPricesByCustomerType() { omfgThis->handleNewWindow(new dspFreightPricesByCustomerType()); } void menuSales::sDspSalesOrderStatus() { omfgThis->handleNewWindow(new dspSalesOrderStatus()); } void menuSales::sDspInventoryAvailability() { omfgThis->handleNewWindow(new dspInventoryAvailability()); } void menuSales::sDspInventoryAvailabilityBySalesOrder() { omfgThis->handleNewWindow(new dspInventoryAvailabilityBySalesOrder()); } void menuSales::sDspInventoryAvailabilityByCustomerType() { omfgThis->handleNewWindow(new dspInventoryAvailabilityByCustomerType()); } void menuSales::sDspReservations() { omfgThis->handleNewWindow(new dspReservations()); } void menuSales::sDspOrderLookupByCustomer() { omfgThis->handleNewWindow(new dspSalesOrdersByCustomer()); } void menuSales::sDspOrderLookupByCustomerType() { ParameterList params; params.append("custtype"); dspSalesOrdersByParameterList *newdlg = new dspSalesOrdersByParameterList(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sDspOrderLookupByItem() { omfgThis->handleNewWindow(new dspSalesOrdersByItem()); } void menuSales::sDspOrderLookupByCustomerPO() { omfgThis->handleNewWindow(new dspSalesOrdersByCustomerPO()); } void menuSales::sDspQuoteLookupByCustomer() { omfgThis->handleNewWindow(new dspQuotesByCustomer()); } void menuSales::sDspQuoteLookupByItem() { omfgThis->handleNewWindow(new dspQuotesByItem()); } void menuSales::sDspBacklog() { omfgThis->handleNewWindow(new dspBacklog()); } void menuSales::sDspSummarizedBacklogByWarehouse() { omfgThis->handleNewWindow(new dspSummarizedBacklogByWarehouse()); } void menuSales::sDspPartiallyShippedOrders() { omfgThis->handleNewWindow(new dspPartiallyShippedOrders()); } void menuSales::sDspEarnedCommissions() { omfgThis->handleNewWindow(new dspEarnedCommissions()); } void menuSales::sDspBriefEarnedCommissions() { omfgThis->handleNewWindow(new dspBriefEarnedCommissions()); } void menuSales::sDspTaxHistory() { omfgThis->handleNewWindow(new dspTaxHistory()); } void menuSales::sDspSalesHistory() { omfgThis->handleNewWindow(new dspSalesHistory()); } void menuSales::sDspBriefSalesHistory() { omfgThis->handleNewWindow(new dspBriefSalesHistory()); } void menuSales::sDspBookings() { omfgThis->handleNewWindow(new dspBookings()); } void menuSales::sDspSummarizedSales() { omfgThis->handleNewWindow(new dspSummarizedSales()); } void menuSales::sDspTimePhasedBookings() { omfgThis->handleNewWindow(new dspTimePhasedBookings()); } void menuSales::sDspTimePhasedSales() { omfgThis->handleNewWindow(new dspTimePhasedSales()); } void menuSales::sPrintSalesOrderForm() { printSoForm(parent, "", TRUE).exec(); } void menuSales::sPrintReturnAuthForm() { printRaForm(parent, "", TRUE).exec(); } // Master Information void menuSales::sNewCustomer() { ParameterList params; params.append("mode", "new"); customer *newdlg = new customer(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sCustomerWorkbench() { ParameterList params; if (_privileges->check("MaintainCustomerMasters")) params.append("mode", "edit"); else params.append("mode", "view"); customer *newdlg = new customer(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sCustomers() { omfgThis->handleNewWindow(new customers()); } void menuSales::sUpdateCreditStatusByCustomer() { updateCreditStatusByCustomer(parent, "", TRUE).exec(); } void menuSales::sCustomerGroups() { omfgThis->handleNewWindow(new customerGroups()); } void menuSales::sNewProspect() { ParameterList params; params.append("mode", "new"); prospect *newdlg = new prospect(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void menuSales::sProspects() { omfgThis->handleNewWindow(new prospects()); } void menuSales::sReassignCustomerTypeByCustomerType() { reassignCustomerTypeByCustomerType(parent, "", TRUE).exec(); } void menuSales::sArchiveSalesHistory() { ParameterList params; params.append("archieve"); archRestoreSalesHistory newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuSales::sRestoreSalesHistory() { ParameterList params; params.append("restore"); archRestoreSalesHistory newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuSales::sAllocateReservations() { allocateReservations(parent, "", TRUE).exec(); } void menuSales::sSetup() { ParameterList params; params.append("module", Xt::SalesModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/menuSales.h000066400000000000000000000077261217451700100175160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuSales_h #define menuSales_h #include #include class QToolBar; class QMenu; class GUIClient; class menuSales : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuSales(GUIClient *); public slots: void sNewSalesOrder(); void sOpenSalesOrders(); void sNewQuote(); void sQuotes(); void sPackingListBatch(); void sPrintPackingList(); void sUninvoicedShipments(); void sSelectShippedOrdersForBilling(); void sSelectOrderForBilling(); void sDspBillingSelections(); void sCreateInvoices(); void sUnpostedInvoices(); void sPrintInvoices(); void sReprintInvoices(); void sPostInvoices(); void sPurgeInvoices(); void sNewReturn(); void sOpenReturns(); void sReturnsWorkbench(); void sNewCreditMemo(); void sUnpostedCreditMemos(); void sCreditMemoEditList(); void sPrintCreditMemos(); void sReprintCreditMemos(); void sPostCreditMemos(); void sPurgeCreditMemos(); void sItemListPrice(); void sUpdateListPricesByProductCategory(); void sPricingSchedules(); void sPricingScheduleAssignments(); void sSales(); void sUpdatePrices(); void sDspPricesByItem(); void sDspPricesByCustomer(); void sDspPricesByCustomerType(); void sDspFreightPricesByCustomer(); void sDspFreightPricesByCustomerType(); void sDspOrderLookupByCustomer(); void sDspOrderLookupByCustomerType(); void sDspOrderLookupByItem(); void sDspOrderLookupByCustomerPO(); void sDspQuoteLookupByCustomer(); void sDspQuoteLookupByItem(); void sDspInventoryAvailability(); void sDspInventoryAvailabilityByCustomerType(); void sDspInventoryAvailabilityBySalesOrder(); void sDspReservations(); void sDspSalesOrderStatus(); void sDspBacklog(); void sDspSummarizedBacklogByWarehouse(); void sDspPartiallyShippedOrders(); void sDspEarnedCommissions(); void sDspBriefEarnedCommissions(); void sDspTaxHistory(); void sDspSalesHistory(); void sDspBriefSalesHistory(); void sDspBookings(); void sDspSummarizedSales(); void sDspTimePhasedBookings(); void sDspTimePhasedSales(); void sPrintSalesOrderForm(); void sPrintReturnAuthForm(); void sNewCustomer(); void sCustomers(); void sCustomerWorkbench(); void sUpdateCreditStatusByCustomer(); void sCustomerGroups(); void sNewProspect(); void sProspects(); void sReassignCustomerTypeByCustomerType(); void sArchiveSalesHistory(); void sRestoreSalesHistory(); void sAllocateReservations(); void sSetup(); private: GUIClient *parent; QToolBar *toolBar; QMenu *mainMenu; QMenu *quotesMenu; QMenu *ordersMenu; QMenu *packingListsMenu; QMenu *billingMenu; QMenu *billingInvoicesMenu; QMenu *billingCreditMemosMenu; QMenu *billingFormsMenu; QMenu *returnsMenu; QMenu *pricingMenu; QMenu *pricingReportsMenu; QMenu *pricingUpdateMenu; QMenu *prospectMenu; QMenu *customerMenu; QMenu *lookupMenu; QMenu *lookupQuoteMenu; QMenu *lookupSoMenu; QMenu *formsMenu; QMenu *analysisMenu; QMenu *reportsMenu; QMenu *reportsBacklogMenu; QMenu *utilitiesMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuSchedule.cpp000066400000000000000000000212161217451700100205240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "guiclient.h" #include "inputManager.h" #include "plannedOrder.h" #include "createPlannedOrdersByItem.h" #include "createPlannedOrdersByPlannerCode.h" #include "deletePlannedOrder.h" #include "deletePlannedOrdersByPlannerCode.h" #include "firmPlannedOrdersByPlannerCode.h" #include "releasePlannedOrdersByPlannerCode.h" #include "dspPlannedOrders.h" #include "dspMRPDetail.h" #include "dspRunningAvailability.h" #include "dspTimePhasedAvailability.h" #include "dspExpediteExceptionsByPlannerCode.h" #include "dspReorderExceptionsByPlannerCode.h" #include "setup.h" #include "menuSchedule.h" menuSchedule::menuSchedule(GUIClient *Pparent) : QObject(Pparent) { setObjectName("msModule"); parent = Pparent; toolBar = new QToolBar(tr("Schedule Tools")); toolBar->setObjectName("Schedule Tools"); toolBar->setIconSize(QSize(32, 32)); parent->addToolBar(toolBar); mainMenu = new QMenu(parent); plannedOrdersMenu = new QMenu(parent); plannedOrdersMrpMenu = new QMenu(parent); reportsMenu = new QMenu(parent); mainMenu->setObjectName("menu.sched"); plannedOrdersMenu->setObjectName("menu.sched.plannedorders"); plannedOrdersMrpMenu->setObjectName("menu.sched.plannedordersmrp"); reportsMenu->setObjectName("menu.sched.reports"); actionProperties acts[] = { // Schedule | Schedule { "menu", tr("&Scheduling"), (char*)plannedOrdersMenu, mainMenu, "true", NULL, NULL, true , NULL }, { "ms.createPlannedOrder", tr("&New Planned Order..."), SLOT(sCreatePlannedOrder()), plannedOrdersMenu, "CreatePlannedOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, plannedOrdersMenu, "true", NULL, NULL, true , NULL }, // Schedule | Schedule | MRP { "menu", tr("Run &MRP"), (char*)plannedOrdersMrpMenu, plannedOrdersMenu, "true", NULL, NULL, true , NULL }, { "ms.runMRPByPlannerCode", tr("by &Planner Code..."), SLOT(sCreatePlannedReplenOrdersByPlannerCode()), plannedOrdersMrpMenu, "CreatePlannedOrders", QPixmap(":/images/runMrpByPlannerCode.png"), toolBar, true , tr("Run MRP by Planner Code") }, { "ms.runMRPByItem", tr("by &Item..."), SLOT(sCreatePlannedReplenOrdersByItem()), plannedOrdersMrpMenu, "CreatePlannedOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, plannedOrdersMenu, "true", NULL, NULL, true , NULL }, { "ms.firmPlannedOrdersByPlannerCode", tr("&Firm Planned Orders..."), SLOT(sFirmPlannedOrdersByPlannerCode()), plannedOrdersMenu, "FirmPlannedOrders", NULL, NULL, true , NULL }, { "ms.releasePlannedOrdersByPlannerCode", tr("&Release Planned Orders..."), SLOT(sReleasePlannedOrdersByPlannerCode()), plannedOrdersMenu, "ReleasePlannedOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, plannedOrdersMenu, "true", NULL, NULL, true , NULL }, { "ms.deletePlannedOrder", tr("&Delete Planned Order..."), SLOT(sDeletePlannedOrder()),plannedOrdersMenu, "DeletePlannedOrders", NULL, NULL, true , NULL }, { "ms.deletePlannedOrdersByPlannerCode", tr("Delete Planned Order&s..."), SLOT(sDeletePlannedOrdersByPlannerCode()), plannedOrdersMenu, "DeletePlannedOrders", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, // Schedule | Report { "menu", tr("&Reports"), (char*)reportsMenu, mainMenu, "true", NULL, NULL, true , NULL }, // Schedule | Report | Planned Orders { "ms.dspPlannedOrders", tr("Planned &Orders..."), SLOT(sDspPlannedOrders()), reportsMenu, "ViewPlannedOrders", QPixmap(":/images/dspPlannedOrdersByPlannerCode.png"), toolBar, true , tr("Planned Orders") }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, { "ms.dspRunningAvailability", tr("&Running Availability..."), SLOT(sDspRunningAvailability()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL }, { "ms.dspTimePhasedAvailabiltiy", tr("&Time-Phased Availability..."), SLOT(sDspTimePhasedAvailability()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL }, { "ms.dspMRPDetail", tr("&MRP Detail..."), SLOT(sDspMRPDetail()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL }, { "separator", NULL, NULL, reportsMenu, "true", NULL, NULL, true , NULL }, { "ms.dspExpediteExceptionsByPlannerCode", tr("E&xpedite Exceptions..."), SLOT(sDspExpediteExceptionsByPlannerCode()), reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL }, { "ms.dspReorderExceptionsByPlannerCode", tr("Reorder &Exceptions..."), SLOT(sDspReorderExceptionsByPlannerCode()),reportsMenu, "ViewInventoryAvailability", NULL, NULL, true , NULL }, { "separator", NULL, NULL, mainMenu, "true", NULL, NULL, true , NULL }, { "ms.setup", tr("&Setup..."), SLOT(sSetup()), mainMenu, NULL, NULL, NULL, true, NULL} }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(mainMenu, "Schedule"); QAction * m = parent->menuBar()->addMenu(mainMenu); if(m) m->setText(tr("Sche&dule")); } void menuSchedule::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if ((acts[i].toolBar != NULL) && (!acts[i].toolTip.isEmpty())) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].toolTip) ; } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar, acts[i].actionTitle) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } void menuSchedule::sCreatePlannedOrder() { ParameterList params; params.append("mode", "new"); plannedOrder newdlg(parent, "", TRUE); newdlg.set(params); newdlg.exec(); } void menuSchedule::sCreatePlannedReplenOrdersByItem() { createPlannedOrdersByItem(parent, "", TRUE).exec(); } void menuSchedule::sCreatePlannedReplenOrdersByPlannerCode() { createPlannedOrdersByPlannerCode(parent, "", TRUE).exec(); } void menuSchedule::sDeletePlannedOrder() { deletePlannedOrder(parent, "", TRUE).exec(); } void menuSchedule::sDeletePlannedOrdersByPlannerCode() { deletePlannedOrdersByPlannerCode(parent, "", TRUE).exec(); } void menuSchedule::sFirmPlannedOrdersByPlannerCode() { firmPlannedOrdersByPlannerCode(parent, "", TRUE).exec(); } void menuSchedule::sReleasePlannedOrdersByPlannerCode() { releasePlannedOrdersByPlannerCode(parent, "", TRUE).exec(); } void menuSchedule::sDspPlannedOrders() { omfgThis->handleNewWindow(new dspPlannedOrders()); } void menuSchedule::sDspTimePhasedAvailability() { omfgThis->handleNewWindow(new dspTimePhasedAvailability()); } void menuSchedule::sDspRunningAvailability() { omfgThis->handleNewWindow(new dspRunningAvailability()); } void menuSchedule::sDspMRPDetail() { omfgThis->handleNewWindow(new dspMRPDetail()); } void menuSchedule::sDspExpediteExceptionsByPlannerCode() { omfgThis->handleNewWindow(new dspExpediteExceptionsByPlannerCode()); } void menuSchedule::sDspReorderExceptionsByPlannerCode() { omfgThis->handleNewWindow(new dspReorderExceptionsByPlannerCode()); } void menuSchedule::sSetup() { ParameterList params; params.append("module", Xt::ScheduleModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/menuSchedule.h000066400000000000000000000033731217451700100201750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuSchedule_h #define menuSchedule_h #include #include class QToolBar; class QMenu; class GUIClient; class menuSchedule : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; const QString toolTip; }; public: menuSchedule(GUIClient *); public slots: void sCreatePlannedReplenOrdersByItem(); void sCreatePlannedReplenOrdersByPlannerCode(); void sCreatePlannedOrder(); void sDeletePlannedOrder(); void sDeletePlannedOrdersByPlannerCode(); void sFirmPlannedOrdersByPlannerCode(); void sReleasePlannedOrdersByPlannerCode(); void sDspPlannedOrders(); void sDspTimePhasedAvailability(); void sDspRunningAvailability(); void sDspMRPDetail(); void sDspExpediteExceptionsByPlannerCode(); void sDspReorderExceptionsByPlannerCode(); void sSetup(); private: GUIClient *parent; QToolBar *toolBar; QMenu *mainMenu; QMenu *plannedOrdersMenu; QMenu *plannedOrdersMrpMenu; QMenu *capacityPlanMenu; QMenu *capacityPlanTpPrdMenu; QMenu *reportsMenu; void addActionsToMenu(actionProperties [], unsigned int); }; #endif qt-client-4.1.0/guiclient/menuSystem.cpp000066400000000000000000000411761217451700100202630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "xtsettings.h" #include "guiclient.h" #include "helpDownload.h" #include #include #include #include "importhelper.h" #include "version.h" #include "menuSystem.h" #include "eventManager.h" #include "users.h" #include "userPreferences.h" #include "hotkeys.h" #include "errorLog.h" #include "customCommands.h" #include "employee.h" #include "employees.h" #include "empGroup.h" #include "empGroups.h" #include "searchForEmp.h" #include "groups.h" #include "images.h" #include "metasqls.h" #include "package.h" #include "packages.h" #include "reports.h" #include "scripts.h" #include "helpView.h" #include "uiforms.h" #include "fixACL.h" #include "fixSerial.h" #include "exportData.h" #include "importData.h" #include "setup.h" extern QString __path; bool menuSystem::loadCSVPlugin() { return ImportHelper::getCSVImpPlugin(parent); } menuSystem::menuSystem(GUIClient *Pparent) : QObject(Pparent) { setObjectName("sysModule"); parent = Pparent; toolBar = new QToolBar(tr("Community Tools")); toolBar->setObjectName("Community Tools"); toolBar->setIconSize(QSize(32, 32)); QList toolbars = qFindChildren(parent); parent->insertToolBar(toolbars.at(0), toolBar); errorLogListener::initialize(); systemMenu = new QMenu(parent); masterInfoMenu = new QMenu(parent); sysUtilsMenu = new QMenu(parent); helpMenu = new QMenu(parent); designMenu = new QMenu(parent); employeeMenu = new QMenu(parent); systemMenu->setObjectName("menu.sys"); masterInfoMenu->setObjectName("menu.sys.masterinfo"); sysUtilsMenu->setObjectName("menu.sys.utilities"); helpMenu->setObjectName("menu.help"); designMenu->setObjectName("menu.sys.design"); employeeMenu->setObjectName("menu.sys.employee"); actionProperties acts[] = { { "sys.eventManager", tr("E&vent Manager..."), SLOT(sEventManager()), systemMenu, "true", NULL, NULL, true }, { "sys.viewDatabaseLog", tr("View Database &Log..."), SLOT(sErrorLog()), systemMenu, "true", NULL, NULL, true }, { "separator", NULL, NULL, systemMenu, "true", NULL, NULL, true }, #ifndef Q_WS_MACX { "sys.preferences", tr("P&references..."), SLOT(sPreferences()), systemMenu, "MaintainPreferencesSelf MaintainPreferencesOthers", NULL, NULL, true }, #endif { "sys.hotkeys", tr("&Hot Keys..."), SLOT(sHotKeys()), systemMenu, "true", NULL, NULL, !(_privileges->check("MaintainPreferencesSelf") || _privileges->check("MaintainPreferencesOthers")) }, { "sys.rescanPrivileges", tr("Rescan &Privileges"), SLOT(sRescanPrivileges()), systemMenu, "true", NULL, NULL, true }, { "separator", NULL, NULL, systemMenu, "true", NULL, NULL, true }, { "sys.maintainUsers", tr("Maintain &Users..."), SLOT(sMaintainUsers()), systemMenu, "MaintainUsers", NULL, NULL, true }, { "sys.maintainGroups", tr("Maintain &Roles..."), SLOT(sMaintainGroups()), systemMenu, "MaintainGroups", NULL, NULL, true }, { "menu", tr("&Employees"), (char*)employeeMenu, systemMenu, "true", NULL, NULL, true }, { "sys.employee", tr("&New..."), SLOT(sNewEmployee()), employeeMenu, "MaintainEmployees", NULL, NULL, true }, { "sys.listEmployees", tr("&List..."), SLOT(sListEmployees()), employeeMenu, "ViewEmployees MaintainEmployees", NULL, NULL, true }, { "sys.searchEmployees", tr("&Search..."), SLOT(sSearchEmployees()), employeeMenu, "ViewEmployees MaintainEmployees", NULL, NULL, true }, { "separator", NULL, NULL, employeeMenu, "true", NULL, NULL, true }, { "sys.employeeGroups", tr("Employee &Groups..."), SLOT(sEmployeeGroups()), employeeMenu, "ViewEmployeeGroups MaintainEmployeeGroups", NULL, NULL, true }, { "separator", NULL, NULL, systemMenu, "true", NULL, NULL, true }, // Design { "menu", tr("&Design"), (char*)designMenu, systemMenu, "true", NULL, NULL, true }, { "sys.reports", tr("&Reports..."), SLOT(sReports()), designMenu, "MaintainReports", NULL, NULL, true }, { "sys.metasqls", tr("&MetaSQL Statements..."), SLOT(sMetasqls()), designMenu, "MaintainMetaSQL ViewMetaSQL", NULL, NULL, true }, { "separator", NULL, NULL, designMenu, "true", NULL, NULL, true }, { "sys.uiforms", tr("S&creens..."), SLOT(sUIForms()), designMenu, "MaintainScreens", NULL, NULL, true }, { "sys.scripts", tr("Scr&ipts..."), SLOT(sScripts()), designMenu, "MaintainScripts", NULL, NULL, true }, { "separator", NULL, NULL, designMenu, "true", NULL, NULL, true }, { "sys.customCommands",tr("Custom Command&s..."), SLOT(sCustomCommands()),designMenu, "MaintainCustomCommands", NULL, NULL, true }, { "separator", NULL, NULL, designMenu, "true", NULL, NULL, true }, { "sys.packages", tr("&Packages..."), SLOT(sPackages()), designMenu, "ViewPackages", NULL, NULL, true }, // Utilities { "menu", tr("&Utilities"),(char*)sysUtilsMenu, systemMenu, "true", NULL, NULL, true }, { "sys.fixACL", tr("&Access Control"), SLOT(sFixACL()), sysUtilsMenu, "fixACL+#superuser", NULL, NULL, true }, { "sys.fixSerial", tr("&Serial Columns"), SLOT(sFixSerial()), sysUtilsMenu, "FixSerial+#superuser", NULL, NULL, true }, { "separator", NULL, NULL, sysUtilsMenu, "true", NULL, NULL, true }, { "sys.CSVAtlases", tr("Maintain CS&V Atlases..."), SLOT(sCSVAtlases()), sysUtilsMenu, "ConfigureImportExport", NULL, NULL, loadCSVPlugin() }, { "sys.importData", tr("&Import Data"), SLOT(sImportData()), sysUtilsMenu, "ImportXML", NULL, NULL, true }, { "sys.exportData", tr("&Export Data"), SLOT(sExportData()), sysUtilsMenu, "ExportXML", NULL, NULL, true }, { "separator", NULL, NULL, sysUtilsMenu, "true", NULL, NULL, true }, { "sys.printAlignmentPage", tr("Print &Alignment Page..."), SLOT(sPrintAlignment()), sysUtilsMenu, "true", NULL, NULL, true }, // Setup { "sys.setup", tr("&Setup..."), SLOT(sSetup()), systemMenu, NULL, NULL, NULL, true }, { "separator", NULL, NULL, systemMenu, "true", NULL, NULL, true }, { "sys.exit", tr("E&xit xTuple ERP..."), SLOT(sExit()), systemMenu, "true", NULL, NULL, true }, }; addActionsToMenu(acts, sizeof(acts) / sizeof(acts[0])); parent->populateCustomMenu(systemMenu, "System"); QAction *m = parent->menuBar()->addMenu(systemMenu); if(m) m->setText(tr("S&ystem")); // Community communityMenu = new QMenu(); actionProperties community[] = { { "community.home", tr("xTuple.org &Home"), SLOT(sCommunityHome()), communityMenu, "true", QPixmap(":images/community.png"), toolBar, true }, { "separator", NULL, NULL, communityMenu, "true", NULL, NULL, true }, { "community.editAccount", tr("My Online User &Account"), SLOT(sCommunityEditAccount()), communityMenu, "true", NULL, NULL, true }, { "community.support", tr("Online Customer &Support"), SLOT(sCommunitySupport()), communityMenu, "true", NULL, NULL, true }, { "community.wiki", tr("Online Documentation / &Wiki"), SLOT(sCommunityWiki()), communityMenu, "true", NULL, NULL, true }, { "separator", NULL, NULL, communityMenu, "true", NULL, NULL, true }, { "community.xchange", tr("&xChange online store"), SLOT(sCommunityXchange()), communityMenu, "true", QPixmap(":images/xchange.png"), toolBar, true }, { "separator", NULL, NULL, communityMenu, "true", NULL, NULL, true }, { "community.forums", tr("Discussion &Forums"), SLOT(sCommunityForums()), communityMenu, "true", NULL, NULL, true }, { "community.issues", tr("&Bugs and Feature Requests"), SLOT(sCommunityIssues()), communityMenu, "true", NULL, NULL, true }, { "community.downloads", tr("&Downloads"), SLOT(sCommunityDownloads()), communityMenu, "true", NULL, NULL, true }, { "community.blogs", tr("Bl&ogs"), SLOT(sCommunityBlogs()), communityMenu, "true", NULL, NULL, true }, { "community.translation", tr("&Translation Portal"), SLOT(sCommunityTranslation()), communityMenu, "true", NULL, NULL, true }, }; addActionsToMenu(community, sizeof(community) / sizeof(community[0])); m = parent->menuBar()->addMenu(communityMenu); if(m) m->setText(tr("C&ommunity")); // Help helpMenu = new QMenu(); actionProperties help[] = { { "help.about", tr("&About..."), SLOT(sAbout()), helpMenu, "true", NULL, NULL, true }, #ifndef Q_WS_MACX { "separator", NULL, NULL, helpMenu, "true", NULL, NULL, true }, #endif { "help.tableOfContents", tr("Table of &Contents..."), SLOT(sTOC()), helpMenu, "true", NULL, NULL, true }, { "help.download", tr("Download..."), SLOT(sDownload()), helpMenu, "true", NULL, NULL, true } }; addActionsToMenu(help, sizeof(help) / sizeof(help[0])); m = parent->menuBar()->addMenu(helpMenu); if(m) m->setText(tr("&Help")); } void menuSystem::addActionsToMenu(actionProperties acts[], unsigned int numElems) { QAction * m = 0; for (unsigned int i = 0; i < numElems; i++) { if (! acts[i].visible) { continue; } else if (acts[i].actionName == QString("menu")) { m = acts[i].menu->addMenu((QMenu*)(acts[i].slot)); if(m) m->setText(acts[i].actionTitle); } else if (acts[i].actionName == QString("separator")) { acts[i].menu->addSeparator(); } else if (acts[i].toolBar != NULL) { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv, (acts[i].pixmap), acts[i].toolBar) ; } else { new Action( parent, acts[i].actionName, acts[i].actionTitle, this, acts[i].slot, acts[i].menu, acts[i].priv ) ; } } } void menuSystem::sEventManager() { omfgThis->handleNewWindow(new eventManager()); } void menuSystem::sPreferences() { userPreferences(parent, "", TRUE).exec(); } void menuSystem::sHotKeys() { ParameterList params; params.append("currentUser"); hotkeys newdlg(omfgThis, "", TRUE); newdlg.set(params); if (newdlg.exec() == QDialog::Accepted) sRescanPrivileges(); } void menuSystem::sRescanPrivileges() { _privileges->load(); omfgThis->saveToolbarPositions(); _preferences->load(); omfgThis->initMenuBar(); } void menuSystem::sCustomCommands() { omfgThis->handleNewWindow(new customCommands()); } void menuSystem::sPackages() { omfgThis->handleNewWindow(new packages()); } void menuSystem::sReports() { omfgThis->handleNewWindow(new reports()); } void menuSystem::sMetasqls() { omfgThis->handleNewWindow(new metasqls()); } void menuSystem::sScripts() { omfgThis->handleNewWindow(new scripts()); } void menuSystem::sUIForms() { omfgThis->handleNewWindow(new uiforms()); } void menuSystem::sSetup() { ParameterList params; params.append("module", Xt::SystemModule); setup newdlg(parent); newdlg.set(params); newdlg.exec(); } void menuSystem::sMaintainUsers() { omfgThis->handleNewWindow(new users()); } void menuSystem::sMaintainGroups() { omfgThis->handleNewWindow(new groups()); } void menuSystem::sNewEmployee() { ParameterList params; employee newdlg(parent); params.append("mode", "new"); newdlg.set(params); newdlg.exec(); } void menuSystem::sListEmployees() { omfgThis->handleNewWindow(new employees()); } void menuSystem::sSearchEmployees() { omfgThis->handleNewWindow(new searchForEmp()); } void menuSystem::sEmployeeGroups() { omfgThis->handleNewWindow(new empGroups()); } void menuSystem::sErrorLog() { omfgThis->handleNewWindow(new errorLog()); } void menuSystem::sPrintAlignment() { orReport report("Alignment"); if (report.isValid()) report.print(); else report.reportError(omfgThis); } void menuSystem::sExit() { parent->close(); } void menuSystem::sAbout() { QMessageBox::about( parent, tr("About..."), tr( "%1\nVersion %2\n%3") .arg(_Name) .arg(_Version) .arg(_Copyright) ); } void menuSystem::sTOC() { helpView *_help = helpView::getInstance(parent); _help->show(); } void menuSystem::sDownload() { omfgThis->handleNewWindow(new helpDownload()); } void menuSystem::sFixACL() { omfgThis->handleNewWindow(new fixACL()); } void menuSystem::sFixSerial() { omfgThis->handleNewWindow(new fixSerial()); } void menuSystem::sExportData() { omfgThis->handleNewWindow(new exportData()); } void menuSystem::sCSVAtlases() { #ifdef Q_WS_MAC if (_preferences->value("InterfaceWindowOption") == "Workspace") { QMessageBox::critical( parent, tr("Interface Option is Invalid"), tr("

    The Maintain CSV Atlases utility " "is only available when user preferences " "are set to show windows as free-floating.") ); return; } #endif omfgThis->handleNewWindow(ImportHelper::getCSVImpPlugin(parent)->getCSVToolWindow(omfgThis, 0)); omfgThis->handleNewWindow(ImportHelper::getCSVImpPlugin(parent)->getCSVAtlasWindow(omfgThis, 0)); } void menuSystem::sImportData() { omfgThis->handleNewWindow(new importData()); } void menuSystem::sCommunityHome() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/"); } void menuSystem::sCommunityEditAccount() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/user"); } void menuSystem::sCommunityForums() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/forum"); } void menuSystem::sCommunityBlogs() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/blog"); } void menuSystem::sCommunityIssues() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/issuetracker/view_all_bug_page.php"); } void menuSystem::sCommunityWiki() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/docs"); } void menuSystem::sCommunityDownloads() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.com/docs/download"); } void menuSystem::sCommunitySupport() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/support"); } void menuSystem::sCommunityTranslation() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.org/translate"); } void menuSystem::sCommunityXchange() { omfgThis->launchBrowser(omfgThis, "http://www.xtuple.com/xchange"); } qt-client-4.1.0/guiclient/menuSystem.h000066400000000000000000000042671217451700100177300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuSystem_h #define menuSystem_h #include #include class QMenu; class QPixmap; class QToolBar; class GUIClient; class Action; class menuSystem : public QObject { Q_OBJECT struct actionProperties { const char* actionName; const QString actionTitle; const char* slot; QMenu* menu; QString priv; QPixmap pixmap; QToolBar* toolBar; bool visible; }; public: menuSystem(GUIClient *); public slots: void sSetup(); void sEventManager(); void sPreferences(); void sHotKeys(); void sRescanPrivileges(); void sMaintainUsers(); void sMaintainGroups(); void sNewEmployee(); void sListEmployees(); void sSearchEmployees(); void sEmployeeGroups(); void sErrorLog(); void sCustomCommands(); void sScripts(); void sUIForms(); void sPackages(); void sMetasqls(); void sReports(); void sFixACL(); void sFixSerial(); void sExportData(); void sImportData(); void sCSVAtlases(); void sPrintAlignment(); void sExit(); void sAbout(); void sTOC(); void sDownload(); void sCommunityHome(); void sCommunityEditAccount(); void sCommunityForums(); void sCommunityBlogs(); void sCommunityIssues(); void sCommunityWiki(); void sCommunityDownloads(); void sCommunitySupport(); void sCommunityTranslation(); void sCommunityXchange(); private: GUIClient *parent; QToolBar *toolBar; QMenu *communityMenu; QMenu *designMenu; QMenu *employeeMenu; QMenu *helpMenu; QMenu *masterInfoMenu; QMenu *sysUtilsMenu; QMenu *systemMenu; void addActionsToMenu(actionProperties [], unsigned int); bool loadCSVPlugin(); }; #endif qt-client-4.1.0/guiclient/menuWindow.cpp000066400000000000000000000166301217451700100202430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "xtsettings.h" #include "guiclient.h" #include "menuWindow.h" class MenuWindowPrivate { public: MenuWindowPrivate() : _cascade(0), _closeActive(0), _closeAll(0), _geometryMenu(0), _lastActive(0), _rememberPos(0), _rememberSize(0), _retab(), _tile(0) { } Action *_cascade; Action *_closeActive; Action *_closeAll; QMenu *_geometryMenu; QWidget *_lastActive; Action *_rememberPos; Action *_rememberSize; Action *_retab; Action *_tile; }; menuWindow::menuWindow(GUIClient *pParent) : QObject(pParent), _parent(pParent), _windowMenu(0), _data(0) { setObjectName("winModule"); _data = new MenuWindowPrivate(); _windowMenu = new QMenu(tr("&Window"), _parent); _windowMenu->setObjectName("menu.window"); _data->_closeActive = new Action(_parent, "window.closeActiveWindow", tr("Close &Active Window"), this, SLOT(sCloseActive()), _windowMenu, true); _data->_closeAll = new Action(_parent, "window.closeAllWindows", tr("Close A&ll Windows"), this, SLOT(sCloseAll()), _windowMenu, true); _data->_cascade = new Action(_parent, "window.cascade", tr("&Cascade"), this, SLOT(sCascade()), _windowMenu, true); _data->_tile = new Action(_parent, "window.tile", tr("&Tile"), this, SLOT(sTile()), _windowMenu, true); _data->_retab = new Action(_parent, "window.retab", tr("T&ab View"), this, SLOT(sRestoreTabbedMode()), _windowMenu, false); _data->_rememberPos = new Action(_parent, "window.rememberPositionToggle", tr("Remember Position"), this, SLOT(sRememberPositionToggle()), _windowMenu, true); _data->_rememberPos->setCheckable(true); _data->_rememberSize = new Action(_parent, "window.rememberSizeToggle", tr("Remember Size"), this, SLOT(sRememberSizeToggle()), _windowMenu, true); _data->_rememberSize->setCheckable(true); (void)_parent->menuBar()->addMenu(_windowMenu); connect(_windowMenu, SIGNAL(aboutToShow()), this, SLOT(sPrepareWindowMenu())); connect(_windowMenu, SIGNAL(aboutToHide()), this, SLOT(sHideWindowMenu())); _parent->populateCustomMenu(_windowMenu, "Window"); } menuWindow::~menuWindow() { if (_data) delete _data; _data = 0; } void menuWindow::sPrepareWindowMenu() { _windowMenu->clear(); if (! _parent->showTopLevel()) { _windowMenu->addAction(_data->_cascade); _windowMenu->addAction(_data->_tile); _windowMenu->addAction(_data->_retab); _windowMenu->addSeparator(); } _windowMenu->addAction(_data->_closeActive); _windowMenu->addAction(_data->_closeAll); QWidgetList windows = _parent->windowList(); bool b = !windows.isEmpty(); _data->_cascade->setEnabled(b); _data->_tile->setEnabled(b); _data->_retab->setEnabled(b && _parent->workspace()->viewMode() != QMdiArea::TabbedView); _data->_closeActive->setEnabled(b); _data->_closeAll->setEnabled(b); _windowMenu->addSeparator(); if (_parent->showTopLevel()) _data->_lastActive = QApplication::activeWindow(); else if (_parent->workspace() && _parent->workspace()->activeSubWindow()) _data->_lastActive = _parent->workspace()->activeSubWindow()->widget(); else _data->_lastActive = 0; if (_data->_lastActive) { if(!_data->_geometryMenu) _data->_geometryMenu = new QMenu(); _data->_geometryMenu->clear(); _data->_geometryMenu->setTitle(_data->_lastActive->windowTitle()); QString objName = _data->_lastActive->objectName(); _data->_rememberPos->setChecked(xtsettingsValue(objName + "/geometry/rememberPos", true).toBool()); _data->_geometryMenu->addAction(_data->_rememberPos); _data->_rememberSize->setChecked(xtsettingsValue(objName + "/geometry/rememberSize", true).toBool()); _data->_geometryMenu->addAction(_data->_rememberSize); _windowMenu->addMenu(_data->_geometryMenu); _windowMenu->addSeparator(); } QAction *m = 0; foreach (QWidget *wind, windows) { m = _windowMenu->addAction(wind->windowTitle(), this, SLOT(sActivateWindow())); if(m) { m->setData(qVariantFromValue(wind)); m->setCheckable(true); m->setChecked((_data->_lastActive == wind)); } } } void menuWindow::sHideWindowMenu() { _data->_cascade->setEnabled(true); _data->_tile->setEnabled(true); _data->_retab->setEnabled(_parent->workspace()->viewMode() != QMdiArea::TabbedView); _data->_closeActive->setEnabled(true); _data->_closeAll->setEnabled(true); } void menuWindow::sActivateWindow() { QWidget *wind = 0; if (QAction *m = qobject_cast(sender())) // not == wind = qVariantValue(m->data()); if (wind) { if (_parent->showTopLevel()) wind->activateWindow(); else wind->setFocus(); } } void menuWindow::sCascade() { _parent->workspace()->cascadeSubWindows(); _parent->workspace()->setViewMode(QMdiArea::SubWindowView); _parent->workspace()->setOption(QMdiArea::DontMaximizeSubWindowOnActivation, true); _data->_retab->setEnabled(true); } void menuWindow::sCloseActive() { if (_parent->showTopLevel()) { if (_parent->windowList().contains(QApplication::activeWindow())) QApplication::activeWindow()->close(); } else _parent->workspace()->closeActiveSubWindow(); } void menuWindow::sCloseAll() { if (_parent->showTopLevel()) { foreach(QWidget *w, _parent->windowList()) w->close(); } else _parent->workspace()->closeAllSubWindows(); } void menuWindow::sRememberPositionToggle() { if (! _data->_lastActive) return; xtsettingsSetValue(_data->_lastActive->objectName() + "/geometry/rememberPos", _data->_rememberPos->isChecked()); } void menuWindow::sRememberSizeToggle() { if (!_data->_lastActive) return; xtsettingsSetValue(_data->_lastActive->objectName() + "/geometry/rememberSize", _data->_rememberSize->isChecked()); } void menuWindow::sRestoreTabbedMode() { QMdiSubWindow *last = _parent->workspace()->activeSubWindow(); _parent->workspace()->setViewMode(QMdiArea::TabbedView); _parent->workspace()->setOption(QMdiArea::DontMaximizeSubWindowOnActivation, false); _data->_retab->setEnabled(false); foreach (QWidget *wind, _parent->windowList()) wind->showMaximized(); _parent->workspace()->setActiveSubWindow(last); } void menuWindow::sTile() { _parent->workspace()->tileSubWindows(); _parent->workspace()->setViewMode(QMdiArea::SubWindowView); _parent->workspace()->setOption(QMdiArea::DontMaximizeSubWindowOnActivation, true); _data->_retab->setEnabled(true); } qt-client-4.1.0/guiclient/menuWindow.h000066400000000000000000000020501217451700100176770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef menuWindow_h #define menuWindow_h #include class GUIClient; class QMenu; class MenuWindowPrivate; class menuWindow : public QObject { Q_OBJECT public: menuWindow(GUIClient *); ~menuWindow(); public slots: void sActivateWindow(); void sCascade(); void sCloseActive(); void sCloseAll(); void sHideWindowMenu(); void sPrepareWindowMenu(); void sRememberPositionToggle(); void sRememberSizeToggle(); void sRestoreTabbedMode(); void sTile(); private: GUIClient *_parent; QMenu *_windowMenu; MenuWindowPrivate *_data; }; #endif qt-client-4.1.0/guiclient/metasqls.cpp000066400000000000000000000142441217451700100177370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "metasqls.h" #include #include #include #include #include #include #include #include "errorReporter.h" #include "mqledit.h" #include "storedProcErrorLookup.h" bool metasqls::userHasPriv(const int priv) { return (priv == cView && _privileges->check("ViewMetaSQL")) || ((priv == cEdit || priv == cNew) && _privileges->check("MaintainMetaSQL")); } metasqls::metasqls(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_byPackage, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_list, SIGNAL(itemSelected(int)), this, SLOT(sEdit())); connect(_list, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); connect(_list, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _list->addColumn(tr("Group"), _itemColumn, Qt::AlignLeft, true, "metasql_group"); _list->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "metasql_name"); _list->addColumn(tr("Grade"), _seqColumn, Qt::AlignRight,false,"metasql_grade"); _list->addColumn(tr("Notes"), -1, Qt::AlignLeft, true, "metasql_notes"); _list->addColumn(tr("Package"),_itemColumn, Qt::AlignLeft, false,"pkgname"); if (! userHasPriv(cEdit) && userHasPriv(cView)) { _new->setEnabled(false); _edit->setText(tr("View")); } sFillList(); } metasqls::~metasqls() { // no need to delete child widgets, Qt does it all for us } void metasqls::languageChange() { retranslateUi(this); } void metasqls::sNew() { MQLEdit *newdlg = new MQLEdit(0); omfgThis->handleNewWindow(newdlg, Qt::NonModal, true); newdlg->forceTestMode(! _privileges->check("ExecuteMetaSQL")); connect(newdlg, SIGNAL(destroyed()), this, SLOT(sFillList())); } void metasqls::sDelete() { if (QMessageBox::question(this, tr("Delete MetaSQL?"), tr("Are you sure you want to delete this " "MetaSQL statement?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; // replace deleteMetaSQL with triggers then remove storedprocerrorlookup call XSqlQuery delq; delq.prepare("SELECT deleteMetaSQL(:metasql_id) AS returnVal;"); delq.bindValue(":metasql_id", _list->id()); delq.exec(); if (delq.first()) { int returnVal = delq.value("returnVal").toInt(); if (returnVal < 0) { ErrorReporter::error(QtCriticalMsg, this, tr("Deleting MetaSQL Statement"), storedProcErrorLookup("deleteMetaSQL", returnVal), __FILE__, __LINE__); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting MetaSQL Statement"), delq, __FILE__, __LINE__)) return; sFillList(); } void metasqls::sEdit() { MQLEdit *newdlg = new MQLEdit(0); newdlg->fileDatabaseOpen(_list->id()); newdlg->setReadOnly(! userHasPriv(cEdit) && userHasPriv(cView)); newdlg->forceTestMode(! _privileges->check("ExecuteMetaSQL")); omfgThis->handleNewWindow(newdlg, Qt::NonModal, true); connect(newdlg, SIGNAL(destroyed()), this, SLOT(sFillList())); } bool metasqls::setParams(ParameterList ¶ms) { if (_byPackage->isChecked()) params.append("byPackage"); return true; } void metasqls::sFillList() { QString errmsg; bool ok; MetaSQLQuery getm = MQLUtil::mqlLoad("metasqls", "detail", errmsg, &ok); if (! ok) { ErrorReporter::error(QtCriticalMsg, this, tr("Getting MetaSQL Statements"), errmsg, __FILE__, __LINE__); return; } ParameterList getp; if (! setParams(getp)) return; XSqlQuery getq = getm.toQuery(getp); _list->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting MetaSQL Statements"), getq, __FILE__, __LINE__)) return; } void metasqls::sPopulateMenu(QMenu *pMenu) { QAction *menuAction; menuAction = pMenu->addAction(_privileges->check("MaintainMetaSQL") ? tr("Edit...") : tr("View..."), this, SLOT(sEdit())); menuAction->setEnabled(_privileges->check("MaintainMetaSQL") || _privileges->check("ViewMetaSQL")); menuAction = pMenu->addAction(tr("Print"), this, SLOT(sPrintMetaSQL())); menuAction->setEnabled(_privileges->check("MaintainMetaSQL") || _privileges->check("ViewMetaSQL")); menuAction = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuAction->setEnabled(_privileges->check("MaintainMetaSQL")); } void metasqls::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("MetaSQLMasterList", params); if (report.isValid()) report.print(); else report.reportError(this); } void metasqls::sPrintMetaSQL() { MQLEdit newdlg(this); newdlg.setReadOnly(! userHasPriv(cEdit) && userHasPriv(cView)); newdlg.fileDatabaseOpen(_list->id()); newdlg.filePrint(); } void metasqls::sHandleButtons() { _delete->setEnabled(_list->id() >= 0 && _privileges->check("MaintainMetaSQL")); _edit->setEnabled(_list->id() >= 0 && (_privileges->check("MaintainMetaSQL") || _privileges->check("ViewMetaSQL"))); } qt-client-4.1.0/guiclient/metasqls.h000066400000000000000000000023141217451700100173770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef METASQLS_H #define METASQLS_H #include "guiclient.h" #include "xwidget.h" #include #include #include "ui_metasqls.h" class metasqls : public XWidget, public Ui::metasqls { Q_OBJECT public: metasqls(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~metasqls(); static bool userHasPriv(const int priv = cView); public slots: virtual bool setParams(ParameterList ¶ms); virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sNew(); virtual void sPopulateMenu(QMenu *pMenu); virtual void sPrint(); virtual void sPrintMetaSQL(); protected slots: virtual void languageChange(); }; #endif // METASQLS_H qt-client-4.1.0/guiclient/metasqls.ui000066400000000000000000000102201217451700100175600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. metasqls 0 0 420 448 MetaSQL Statements Close Print Qt::Vertical QSizePolicy::Fixed 20 20 New false Edit false Delete Qt::Vertical 20 40 MetaSQL Statements: Organize By Package true Qt::Horizontal 40 20 XCheckBox QCheckBox

    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _close clicked() metasqls close() 418 27 235 231 qt-client-4.1.0/guiclient/miscCheck.cpp000066400000000000000000000302751217451700100200010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "miscCheck.h" #include #include #include #include "storedProcErrorLookup.h" miscCheck::miscCheck(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sPopulateBankInfo(int))); connect(_cust, SIGNAL(newId(int)), this, SLOT(sHandleButtons())); connect(_custRB, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxauth, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); connect(_taxauthRB, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_vend, SIGNAL(newId(int)), this, SLOT(sHandleButtons())); connect(_vendRB, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_cust, SIGNAL(valid(bool)), this, SLOT(sCustomerSelected())); _captive = FALSE; _raheadid = -1; _aropenamt = 0; _bankaccnt->setType(XComboBox::APBankAccounts); } miscCheck::~miscCheck() { // no need to delete child widgets, Qt does it all for us } void miscCheck::languageChange() { retranslateUi(this); } enum SetResponse miscCheck::set(const ParameterList &pParams) { XWidget::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) _vend->setId(param.toInt()); param = pParams.value("bankaccnt_id", &valid); if (valid) _bankaccnt->setId(param.toInt()); param = pParams.value("check_id", &valid); if (valid) { connect(_cmCluster, SIGNAL(newId(int)), this, SLOT(sCreditMemoSelected())); _checkid = param.toInt(); populate(); } if (pParams.inList("new")) { _mode = cNew; _save->setText(tr("C&reate")); connect(_cmCluster, SIGNAL(newId(int)), this, SLOT(sCreditMemoSelected())); } else if (pParams.inList("edit")) { _mode = cEdit; _bankaccnt->setEnabled(FALSE); } return NoError; } void miscCheck::sSave() { double _amt; _amt=_amount->localValue(); XSqlQuery check; if (!_date->isValid()) { QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"), tr("

    You must enter a date for this check.") ); _date->setFocus(); return; } if (_amount->isZero()) { QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"), tr("

    You must enter an amount for this check.") ); _date->setFocus(); return; } if ( (_applytocm->isChecked()) && (_cmCluster->id() == -1) ) { QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"), tr("

    You must select a Credit Memo for this " "expensed check.") ); _expcat->setFocus(); return; } if (_applytocm->isChecked() && _cmCluster->isValid() && (_amt > _aropenamt)) { QMessageBox::warning( this, tr("Invalid Amount"), tr("

    You must enter an amount less than or equal to the " "credit memo selected.") ); _amount->setLocalValue(_aropenamt); _amount->setFocus(); return; } if ( (_expense->isChecked()) && (_expcat->id() == -1) ) { QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"), tr("

    You must select an Expense Category for this " "expensed check.") ); _expcat->setFocus(); return; } if (_mode == cNew) { check.prepare("SELECT createCheck(:bankaccnt_id, :reciptype, :recipid," " :checkDate, :amount, :curr_id, :expcat_id," " NULL, :for, :notes, TRUE, :cmhead_id) AS result;" ); check.bindValue(":bankaccnt_id", _bankaccnt->id()); } else if (_mode == cEdit) { check.prepare( "UPDATE checkhead " "SET checkhead_recip_id=:recipid," " checkhead_recip_type=:reciptype," " checkhead_checkdate=:checkDate, " " checkhead_amount=:amount, checkhead_curr_id=:curr_id, " " checkhead_expcat_id=:expcat_id, checkhead_for=:for," " checkhead_notes=:notes " "WHERE (checkhead_id=:check_id);" ); check.bindValue(":check_id", _checkid); } if (_vendRB->isChecked()) { check.bindValue(":reciptype", "V"); check.bindValue(":recipid", _vend->id()); } else if (_custRB->isChecked()) { check.bindValue(":reciptype", "C"); check.bindValue(":recipid", _cust->id()); } else if (_taxauthRB->isChecked()) { check.bindValue(":reciptype", "T"); check.bindValue(":recipid", _taxauth->id()); } check.bindValue(":checkDate", _date->date()); check.bindValue(":amount", _amt); check.bindValue(":curr_id", _amount->id()); check.bindValue(":for", _for->text().trimmed()); check.bindValue(":notes", _notes->toPlainText().trimmed()); if (_expense->isChecked()) check.bindValue(":expcat_id", _expcat->id()); if ( (_applytocm->isChecked()) && (_cmCluster->isValid()) ) check.bindValue(":cmhead_id",_cmCluster->id()); check.exec(); if (_mode == cNew && check.first()) { _checkid = check.value("result").toInt(); if (_checkid < 0) { systemError(this, storedProcErrorLookup("createCheck", _checkid), __FILE__, __LINE__); return; } check.prepare( "SELECT checkhead_number " "FROM checkhead " "WHERE (checkhead_id=:check_id);" ); check.bindValue(":check_id", _checkid); check.exec(); if (check.first()) { // Since we are no longer assigning check number at creation this is not needed /* QMessageBox::information( this, tr("New Check Created"), tr("

    A new Check has been created and " "assigned #%1") .arg(check.value("checkhead_number").toString()) ); */ } else if (check.lastError().type() != QSqlError::NoError) { systemError(this, check.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (check.lastError().type() != QSqlError::NoError) { systemError(this, check.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(_bankaccnt->id(), _checkid, TRUE); if (_captive) close(); } void miscCheck::sPopulateBankInfo(int pBankaccntid) { XSqlQuery miscPopulateBankInfo; if ( pBankaccntid != -1 ) { XSqlQuery checkNumber; checkNumber.prepare( "SELECT bankaccnt_nextchknum, bankaccnt_curr_id " "FROM bankaccnt " "WHERE (bankaccnt_id=:bankaccnt_id);" ); checkNumber.bindValue(":bankaccnt_id", pBankaccntid); checkNumber.exec(); if (checkNumber.first()) { _amount->setId(checkNumber.value("bankaccnt_curr_id").toInt()); } else if (miscPopulateBankInfo.lastError().type() != QSqlError::NoError) { systemError(this, checkNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_cmCluster->isValid()) sCreditMemoSelected(); } void miscCheck::populate() { XSqlQuery miscpopulate; miscpopulate.prepare( "SELECT checkhead_recip_type, checkhead_recip_id," " checkhead_bankaccnt_id, checkhead_number," " checkhead_checkdate, checkhead_expcat_id," " checkhead_for, checkhead_notes," " checkhead_amount, checkhead_curr_id, aropen_id AS checkhead_cmhead_id " "FROM checkhead " " LEFT OUTER JOIN checkitem ON (checkhead_id=checkitem_checkhead_id) " " AND (checkitem_aropen_id IS NOT NULL) " " LEFT OUTER JOIN aropen ON (checkitem_aropen_id=aropen_id) " " AND (aropen_doctype = 'C') " "WHERE checkhead_id=:check_id;"); miscpopulate.bindValue(":check_id", _checkid); miscpopulate.exec(); if (miscpopulate.first()) { if (miscpopulate.value("checkhead_recip_type").toString() == "V") { _vendRB->setChecked(true); _vend->setId(miscpopulate.value("checkhead_recip_id").toInt()); } else if (miscpopulate.value("checkhead_recip_type").toString() == "C") { _custRB->setChecked(true); _cust->setId(miscpopulate.value("checkhead_recip_id").toInt()); } else if (miscpopulate.value("checkhead_recip_type").toString() == "T") { _taxauthRB->setChecked(true); _taxauth->setId(miscpopulate.value("checkhead_recip_id").toInt()); } // bank accnt must be set before check number and currency _bankaccnt->setId(miscpopulate.value("checkhead_bankaccnt_id").toInt()); _date->setDate(miscpopulate.value("checkhead_checkdate").toDate(), true); _amount->set(miscpopulate.value("checkhead_amount").toDouble(), miscpopulate.value("checkhead_curr_id").toInt(), miscpopulate.value("checkhead_checkdate").toDate(), false); _for->setText(miscpopulate.value("checkhead_for")); _notes->setText(miscpopulate.value("checkhead_notes").toString()); if (!miscpopulate.value("checkhead_cmhead_id").isNull()) { _applytocm->setChecked(TRUE); _cmCluster->setId(miscpopulate.value("checkhead_cmhead_id").toInt()); } else if (miscpopulate.value("checkhead_expcat_id").isNull() || miscpopulate.value("checkhead_expcat_id").toInt() == -1) _memo->setChecked(TRUE); else { _expense->setChecked(TRUE); _expcat->setId(miscpopulate.value("checkhead_expcat_id").toInt()); } if (!miscpopulate.value("checkhead_cmhead_id").isNull()) { _recipGroup->setEnabled(FALSE); _chargeToGroup->setEnabled(FALSE); _amount->setEnabled(FALSE); _for->setEnabled(FALSE); } } } void miscCheck::sHandleButtons() { if (_vendRB->isChecked()) { _widgetStack->setCurrentIndex(0); _memo->setText("Create Credit Memo"); } else if (_custRB->isChecked()) { _widgetStack->setCurrentIndex(1); _memo->setText("Create Debit Memo"); _cmCluster->setId(-1); _cmCluster->setCustId(_cust->id()); } else { _widgetStack->setCurrentIndex(2); _memo->setText("Create Credit Memo"); } _save->setEnabled((_cust->isValid() && _custRB->isChecked()) || (_vend->isValid() && _vendRB->isChecked()) || (_taxauth->id() > 0 && _taxauthRB->isChecked())); } void miscCheck::sCustomerSelected() { _cmCluster->setEnabled(_cust->isValid() && _applytocm->isChecked()); } void miscCheck::sCreditMemoSelected() { XSqlQuery miscCreditMemoSelected; if (_cmCluster->id() != -1) { if(!_date->isValid()) _date->setDate(QDate::currentDate()); miscCreditMemoSelected.prepare("SELECT aropen_curr_id, " " round((aropen_amount-aropen_paid- " //Subtract amount for existing checks "(SELECT COALESCE(SUM(checkhead_amount),0) " " FROM checkhead,checkitem " " WHERE ((checkhead_id=checkitem_checkhead_id) " " AND (NOT checkhead_posted) " " AND (NOT checkhead_void) " " AND (checkhead_id <> :check_id) " " AND (checkitem_aropen_id=aropen_id))) " ") * aropen_curr_rate / currRate(:curr_id,aropen_docdate),2) AS amount " " FROM aropen " " WHERE (aropen_id=:aropen_id); "); miscCreditMemoSelected.bindValue(":aropen_id", _cmCluster->id()); miscCreditMemoSelected.bindValue(":curr_id", _amount->id()); miscCreditMemoSelected.bindValue(":date", _date->date()); miscCreditMemoSelected.bindValue(":check_id", _checkid); miscCreditMemoSelected.exec(); if (miscCreditMemoSelected.first()) { _aropenamt=miscCreditMemoSelected.value("amount").toDouble(); if (_mode == cNew) _amount->setLocalValue(miscCreditMemoSelected.value("amount").toDouble()); } else if (miscCreditMemoSelected.lastError().type() != QSqlError::NoError) { systemError(this, miscCreditMemoSelected.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _aropenamt=0; } } qt-client-4.1.0/guiclient/miscCheck.h000066400000000000000000000023521217451700100174410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MISCCHECK_H #define MISCCHECK_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_miscCheck.h" class miscCheck : public XWidget, public Ui::miscCheck { Q_OBJECT public: miscCheck(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~miscCheck(); virtual void populate(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sHandleButtons(); virtual void sPopulateBankInfo( int pBankaccntid ); virtual void sSave(); virtual void sCustomerSelected(); virtual void sCreditMemoSelected(); protected slots: virtual void languageChange(); private: bool _captive; int _checkid; int _mode; int _raheadid; int _aropenid; double _aropenamt; }; #endif // MISCCHECK_H qt-client-4.1.0/guiclient/miscCheck.ui000066400000000000000000000455631217451700100176420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. miscCheck 0 0 724 435 Miscellaneous Check Qt::Horizontal 498 17 false Save true true Cancel Write Check To: 12 Vendor true Customer Tax Authority 16 75 0 0 Qt::StrongFocus Vendor #: Qt::Vertical 20 0 0 true Qt::StrongFocus Qt::Vertical 20 0 0 Tax Authority #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxauth true XComboBox::TaxAuths Qt::Vertical 20 0 Qt::Horizontal 40 20 true Charge To: Expense Category true Qt::StrongFocus false Apply to Credit Memo false AropenLineEdit::CreditMemo Create Credit Memo Qt::Vertical 20 0 Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 261 20 Bank Account: XComboBox::APBankAccounts 0 0 0 27 Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 150 0 false Qt::Horizontal 191 20 Memo: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 0 1 QFrame::NoFrame QFrame::Raised 0 0 Notes: 0 1 Qt::ClickFocus true AropenCluster QWidget

    aropencluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    CustCluster QWidget
    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ExpenseCluster QWidget
    expensecluster.h
    VendorCluster QWidget
    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _vendRB _custRB _taxauthRB _vend _expense _expcat _applytocm _memo _date _amount _for _bankaccnt _notes _close _cust _taxauth _close clicked() miscCheck close() 820 55 20 20 _date newDate(QDate) _amount setEffective(QDate) 175 300 175 337 _memo toggled(bool) _expcat setReadOnly(bool) 592 234 804 139 _expense toggled(bool) _expcat setEnabled(bool) 581 116 804 139 _custRB toggled(bool) _applytocm setEnabled(bool) 276 110 606 177 _taxauthRB toggled(bool) _memo setDisabled(bool) 400 110 592 234 _vendRB clicked() _expense click() 86 110 581 116 _taxauthRB clicked() _expense click() 400 110 581 116 _applytocm toggled(bool) _cmCluster setEnabled(bool) 548 169 661 167 qt-client-4.1.0/guiclient/miscVoucher.cpp000066400000000000000000000470471217451700100204040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "miscVoucher.h" #include #include #include #include #include #include "guiErrorCheck.h" #include "errorReporter.h" #include "voucherMiscDistrib.h" miscVoucher::miscVoucher(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_amountDistributed, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue())); connect(_amountToDistribute, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue())); connect(_amountToDistribute, SIGNAL(effectiveChanged(const QDate&)), this, SLOT(sFillMiscList())); connect(_amountToDistribute, SIGNAL(idChanged(int)), this, SLOT(sFillMiscList())); connect(_amountToDistribute, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDeleteMiscDistribution())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEditMiscDistribution())); connect(_invoiceDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDistDate())); connect(_invoiceDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDueDate())); connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate())); connect(_new, SIGNAL(clicked()), this, SLOT(sNewMiscDistribution())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_voucherNumber, SIGNAL(editingFinished()), this, SLOT(sHandleVoucherNumber())); _terms->setType(XComboBox::APTerms); _vendor->setShowInactive(false); _recurring->setParent(-1, "V"); _miscDistrib->addColumn(tr("Account"), -1, Qt::AlignLeft, true, "account" ); _miscDistrib->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "vodist_amount" ); } miscVoucher::~miscVoucher() { // no need to delete child widgets, Qt does it all for us } void miscVoucher::languageChange() { retranslateUi(this); } enum SetResponse miscVoucher::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) _vendor->setId(param.toInt()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; if (_metrics->value("VoucherNumberGeneration") == "A") populateNumber(); connect(_vendor, SIGNAL(newId(int)), this, SLOT(sPopulateVendorInfo(int))); XSqlQuery insq; insq.prepare("INSERT INTO vohead (" " vohead_number, vohead_misc," " vohead_posted, vohead_pohead_id, vohead_docdate" ") VALUES (" " :vohead_number, true," " false, -1, CURRENT_DATE)" " RETURNING vohead_id;" ); insq.bindValue(":vohead_id", _voheadid); insq.bindValue(":vohead_number", _voucherNumber->text()); insq.exec(); if (insq.first()) { _voheadid = insq.value("vohead_id").toInt(); _recurring->setParent(_voheadid, "V"); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Creating Voucher"), insq, __FILE__, __LINE__)) return UndefinedError; } else if (param.toString() == "edit") { _mode = cEdit; _voucherNumber->setEnabled(false); _vendor->setEnabled(false); } else if (param.toString() == "view") { _mode = cView; _voucherNumber->setEnabled(false); _vendor->setReadOnly(true); _taxzone->setEnabled(false); _amountToDistribute->setEnabled(false); _distributionDate->setEnabled(false); _invoiceDate->setEnabled(false); _dueDate->setEnabled(false); _terms->setEnabled(false); _terms->setType(XComboBox::Terms); _vendor->setShowInactive(true); _invoiceNum->setEnabled(false); _reference->setEnabled(false); _miscDistrib->setEnabled(false); _new->setEnabled(false); _flagFor1099->setEnabled(false); _notes->setEnabled(false); _close->setText(tr("&Close")); _save->hide(); } } param = pParams.value("vohead_id", &valid); if (valid) { _voheadid = param.toInt(); populate(); } return NoError; } void miscVoucher::sSave() { QList errors; errors << GuiErrorCheck(! _invoiceDate->isValid(), _invoiceDate, tr("

    You must enter an Invoice Date before you " "may save this Voucher.")) << GuiErrorCheck(! _dueDate->isValid(), _dueDate, tr("

    You must enter a Due Date before you may " "save this Voucher.")) << GuiErrorCheck(! _distributionDate->isValid(), _distributionDate, tr("

    You must enter a Distribution Date before " "you may save this Voucher.")) << GuiErrorCheck(_amountToDistribute->isZero(), _amountToDistribute, tr("

    You must enter an Amount to Distribute " "before you may save this Voucher.")) << GuiErrorCheck(! _balance->isZero(), _amountToDistribute, tr("

    You must fully distribute the Amount before " "you may save this Voucher.")) << GuiErrorCheck(_metrics->boolean("ReqInvMiscVoucher") && _invoiceNum->text().trimmed().isEmpty(), _invoiceNum, tr("

    You must enter a Vendor Invoice Number " "before you may save this Voucher.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Voucher"), errors)) return; if (_invoiceNum->text().trimmed().length() > 0) { XSqlQuery dupq; dupq.prepare( "SELECT vohead_id " "FROM vohead " "WHERE ( (vohead_invcnumber=:vohead_invcnumber)" " AND (vohead_vend_id=:vend_id)" " AND (vohead_id<>:vohead_id) );" ); dupq.bindValue(":vohead_invcnumber", _invoiceNum->text().trimmed()); dupq.bindValue(":vend_id", _vendor->id()); dupq.bindValue(":vohead_id", _voheadid); dupq.exec(); if (dupq.first()) { if (QMessageBox::question(this, windowTitle(), tr("

    A Voucher for this Vendor has already " "been entered with the same Vendor Invoice " "Number. Are you sure you want to use this " "number again?" ), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { _invoiceNum->setFocus(); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Reused Invoice Check"), dupq, __FILE__, __LINE__)) return; } RecurrenceWidget::RecurrenceChangePolicy cp = _recurring->getChangePolicy(); if (cp == RecurrenceWidget::NoPolicy) return; XSqlQuery rollbackq; rollbackq.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); XSqlQuery updq; updq.prepare( "UPDATE vohead " "SET vohead_number=:vohead_number," " vohead_vend_id=:vohead_vend_id," " vohead_distdate=:vohead_distdate," " vohead_docdate=:vohead_docdate," " vohead_duedate=:vohead_duedate," " vohead_terms_id=:vohead_terms_id," " vohead_taxzone_id=:vohead_taxzone_id," " vohead_invcnumber=:vohead_invcnumber," " vohead_reference=:vohead_reference," " vohead_amount=:vohead_amount," " vohead_1099=:vohead_1099," " vohead_curr_id=:vohead_curr_id," " vohead_recurring_vohead_id=:vohead_recurring_vohead_id," " vohead_notes=:vohead_notes" " WHERE (vohead_id=:vohead_id);" ); updq.bindValue(":vohead_id", _voheadid); updq.bindValue(":vohead_number", _voucherNumber->text().toInt()); updq.bindValue(":vohead_vend_id", _vendor->id()); updq.bindValue(":vohead_terms_id", _terms->id()); if (_taxzone->isValid()) updq.bindValue(":vohead_taxzone_id", _taxzone->id()); updq.bindValue(":vohead_distdate", _distributionDate->date()); updq.bindValue(":vohead_docdate", _invoiceDate->date()); updq.bindValue(":vohead_duedate", _dueDate->date()); updq.bindValue(":vohead_invcnumber", _invoiceNum->text().trimmed()); updq.bindValue(":vohead_reference", _reference->text().trimmed()); updq.bindValue(":vohead_amount", _amountToDistribute->localValue()); updq.bindValue(":vohead_1099", QVariant(_flagFor1099->isChecked())); updq.bindValue(":vohead_curr_id", _amountToDistribute->id()); if(_recurring->isRecurring()) { if(_recurring->parentId() != 0) updq.bindValue(":vohead_recurring_vohead_id", _recurring->parentId()); else updq.bindValue(":vohead_recurring_vohead_id", _voheadid); } updq.bindValue(":vohead_notes", _notes->toPlainText()); updq.exec(); if (updq.lastError().type() != QSqlError::NoError) { rollbackq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Saving Voucher"), updq, __FILE__, __LINE__); return; } QString errmsg; if (! _recurring->save(true, cp, &errmsg)) { rollbackq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Saving Voucher Recurrence"), errmsg, __FILE__, __LINE__); return; } XSqlQuery commitq("COMMIT;"); omfgThis->sVouchersUpdated(); _voheadid = -1; if(cNew != _mode) { close(); return; } _voucherNumber->clear(); _vendor->setId(-1); _amountToDistribute->clear(); _amountDistributed->clear(); _balance->clear(); _invoiceDate->setNull(); _distributionDate->setNull(); _dueDate->setNull(); _invoiceNum->clear(); _reference->clear(); _flagFor1099->setChecked(false); _miscDistrib->clear(); _notes->setText(""); _cachedAmountDistributed = 0.0; ParameterList params; params.append("mode", "new"); set(params); } void miscVoucher::sHandleVoucherNumber() { if (_voucherNumber->text().length() == 0) { if ((_metrics->value("VoucherNumberGeneration") == "A") || (_metrics->value("VoucherNumberGeneration") == "O")) populateNumber(); else { QMessageBox::critical( this, tr("Enter Voucher Number"), tr("

    You must enter a valid Voucher Number " "before continuing.") ); _voucherNumber->setFocus(); return; } } else { XSqlQuery editq; editq.prepare( "SELECT vohead_id " "FROM vohead " "WHERE (vohead_number=:vohead_number);" ); editq.bindValue(":vohead_number", _voucherNumber->text().toInt()); editq.exec(); if (editq.first()) { _voheadid = editq.value("vohead_id").toInt(); _voucherNumber->setEnabled(false); _vendor->setEnabled(false); _mode = cEdit; populate(); return; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Looking for Existing Voucher"), editq, __FILE__, __LINE__)) return; } } void miscVoucher::sPopulateVendorInfo(int pVendid) { XSqlQuery vendq; vendq.prepare("SELECT vend_terms_id, vend_1099, vend_curr_id, vend_taxzone_id" " FROM vendinfo" " WHERE (vend_id=:vend_id);" ); vendq.bindValue(":vend_id", pVendid); vendq.exec(); if (vendq.first()) { _terms->setId(vendq.value("vend_terms_id").toInt()); _flagFor1099->setChecked(vendq.value("vend_1099").toBool()); _amountToDistribute->setId(vendq.value("vend_curr_id").toInt()); _taxzone->setId(vendq.value("vend_taxzone_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Vendor Info"), vendq, __FILE__, __LINE__)) return; } void miscVoucher::sNewMiscDistribution() { ParameterList params; params.append("mode", "new"); params.append("vohead_id", _voheadid); params.append("vend_id", _vendor->id()); params.append("voucher_type"); params.append("curr_id", _amountToDistribute->id()); params.append("curr_effective", _amountToDistribute->effective()); params.append("amount", _balance->localValue()); if (_taxzone->isValid()) params.append("taxzone_id", _taxzone->id()); voucherMiscDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillMiscList(); sPopulateDistributed(); } } void miscVoucher::sEditMiscDistribution() { ParameterList params; params.append("mode", "edit"); params.append("vohead_id", _voheadid); params.append("voucher_type"); params.append("vodist_id", _miscDistrib->id()); params.append("curr_id", _amountToDistribute->id()); params.append("curr_effective", _amountToDistribute->effective()); if (_taxzone->isValid()) params.append("taxzone_id", _taxzone->id()); voucherMiscDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillMiscList(); sPopulateDistributed(); } } void miscVoucher::sDeleteMiscDistribution() { XSqlQuery delq; delq.prepare("DELETE FROM vodist WHERE (vodist_id=:vodist_id);"); delq.bindValue(":vodist_id", _miscDistrib->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Misc Distribution"), delq, __FILE__, __LINE__)) return; sFillMiscList(); sPopulateDistributed(); } void miscVoucher::sFillMiscList() { XSqlQuery getq; getq.prepare("SELECT vodist_id," " (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account," " vodist_amount, 'curr' AS vodist_amount_xtnumericrole " "FROM vodist, accnt " "WHERE ( (vodist_poitem_id=-1)" " AND (vodist_accnt_id=accnt_id)" " AND (vodist_vohead_id=:vohead_id) ) " "UNION ALL " "SELECT vodist_id, (expcat_code || ' - ' || expcat_descrip) AS account," " vodist_amount, 'curr' AS vodist_amount_xtnumericrole " " FROM vodist, expcat " " WHERE ( (vodist_poitem_id=-1)" " AND (vodist_expcat_id=expcat_id)" " AND (vodist_vohead_id=:vohead_id) ) " "UNION ALL " "SELECT vodist_id, (tax_code || ' - ' || tax_descrip) AS account," " vodist_amount, 'curr' AS vodist_amount_xtnumericrole " " FROM vodist, tax " " WHERE ( (vodist_poitem_id=-1)" " AND (vodist_tax_id=tax_id)" " AND (vodist_vohead_id=:vohead_id) ) " "ORDER BY account;" ); getq.bindValue(":vohead_id", _voheadid); getq.exec(); _miscDistrib->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Misc. Distributions"), getq, __FILE__, __LINE__)) return; } void miscVoucher::sPopulateDistributed() { XSqlQuery sumq; sumq.prepare( "SELECT COALESCE(SUM(vodist_amount), 0) AS distrib " "FROM vodist " "WHERE (vodist_vohead_id=:vohead_id);" ); sumq.bindValue(":vohead_id", _voheadid); sumq.exec(); if (sumq.first()) { _amountDistributed->setLocalValue(sumq.value("distrib").toDouble()); sPopulateBalanceDue(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Total"), sumq, __FILE__, __LINE__)) return; } void miscVoucher::sPopulateBalanceDue() { _balance->setLocalValue(_amountToDistribute->localValue() - _amountDistributed->localValue()); if (_balance->isZero()) _balance->setPaletteForegroundColor(QColor("black")); else _balance->setPaletteForegroundColor(QColor("red")); } void miscVoucher::populateNumber() { XSqlQuery numq; numq.exec("SELECT fetchVoNumber() AS vouchernumber;"); if (numq.first()) { _voucherNumber->setText(numq.value("vouchernumber").toString()); _voucherNumber->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Number"), numq, __FILE__, __LINE__)) return; } void miscVoucher::populate() { XSqlQuery vohead; vohead.prepare( "SELECT vohead.* " "FROM vohead " "WHERE (vohead_id=:vohead_id);" ); vohead.bindValue(":vohead_id", _voheadid); vohead.exec(); if (vohead.first()) { _voucherNumber->setText(vohead.value("vohead_number").toString()); _vendor->setId(vohead.value("vohead_vend_id").toInt()); _taxzone->setId(vohead.value("vohead_taxzone_id").toInt()); _amountToDistribute->set(vohead.value("vohead_amount").toDouble(), vohead.value("vohead_curr_id").toInt(), vohead.value("vohead_docdate").toDate(), false); _terms->setId(vohead.value("vohead_terms_id").toInt()); _distributionDate->setDate(vohead.value("vohead_distdate").toDate(), true); _invoiceDate->setDate(vohead.value("vohead_docdate").toDate()); _dueDate->setDate(vohead.value("vohead_duedate").toDate()); _invoiceNum->setText(vohead.value("vohead_invcnumber").toString()); _reference->setText(vohead.value("vohead_reference").toString()); _flagFor1099->setChecked(vohead.value("vohead_1099").toBool()); _notes->setText(vohead.value("vohead_notes").toString()); if(vohead.value("vohead_recurring_vohead_id").toInt() != 0) _recurring->setParent(vohead.value("vohead_recurring_vohead_id").toInt(), "V"); else _recurring->setParent(_voheadid, "V"); sFillMiscList(); sPopulateDistributed(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Voucher"), vohead, __FILE__, __LINE__)) return; } void miscVoucher::closeEvent(QCloseEvent *pEvent) { if ( (_mode == cNew) && (_voheadid != -1) ) { XSqlQuery delq; delq.prepare("DELETE FROM vohead WHERE (vohead_id=:vohead_id);" "SELECT releaseVoNumber(:number);"); delq.bindValue(":vohead_id", _voheadid); delq.bindValue(":number", _voucherNumber->text().toInt()); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Voucher"), delq, __FILE__, __LINE__); } pEvent->accept(); } void miscVoucher::sPopulateDistDate() { if ( _invoiceDate->isValid() && (!_distributionDate->isValid()) ) { _distributionDate->setDate(_invoiceDate->date(), true); sPopulateDueDate(); } } void miscVoucher::sPopulateDueDate() { if ( _invoiceDate->isValid() && _terms->isValid() && (!_dueDate->isValid()) ) { XSqlQuery dateq; dateq.prepare("SELECT determineDueDate(:terms_id, :invoiceDate) AS duedate;"); dateq.bindValue(":terms_id", _terms->id()); dateq.bindValue(":invoiceDate", _invoiceDate->date()); dateq.exec(); if (dateq.first()) _dueDate->setDate(dateq.value("duedate").toDate()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Due Date"), dateq, __FILE__, __LINE__)) return; } } void miscVoucher::keyPressEvent( QKeyEvent * e ) { if(e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { _save->animateClick(); e->accept(); } else e->ignore(); } qt-client-4.1.0/guiclient/miscVoucher.h000066400000000000000000000031371217451700100200410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef MISCVOUCHER_H #define MISCVOUCHER_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_miscVoucher.h" class miscVoucher : public XWidget, public Ui::miscVoucher { Q_OBJECT public: miscVoucher(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~miscVoucher(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sHandleVoucherNumber(); virtual void sPopulateVendorInfo( int pVendid ); virtual void sNewMiscDistribution(); virtual void sEditMiscDistribution(); virtual void sDeleteMiscDistribution(); virtual void sFillMiscList(); virtual void sPopulateDistributed(); virtual void sPopulateBalanceDue(); virtual void populateNumber(); virtual void populate(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sPopulateDistDate(); virtual void sPopulateDueDate(); protected: virtual void keyPressEvent( QKeyEvent * e ); protected slots: virtual void languageChange(); private: int _voheadid; double _cachedAmountDistributed; int _mode; }; #endif // MISCVOUCHER_H qt-client-4.1.0/guiclient/miscVoucher.ui000066400000000000000000000523271217451700100202340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. miscVoucher 0 0 600 400 Miscellaneous Voucher 12 Qt::Horizontal 441 20 false &Save &Cancel true Voucher #: 100 32767 Qt::NoFocus Qt::StrongFocus 3 Vendor #: Qt::Vertical 20 40 Invoice Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Amount to Distribute: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 180 0 Amount Distributed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Qt::Horizontal 40 20 Vendor Invoice #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Reference: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true None XComboBox::TaxZones Qt::Horizontal 0 20 Flag for &1099 Qt::Horizontal 40 20 0 1 0 Misc. Distributions 0 0 0 100 &New true false &Edit true false &Delete true Qt::Vertical QSizePolicy::Expanding 20 20 Notes true Advanced RecurrenceWidget::Daily Qt::Horizontal 40 20 Qt::Vertical 20 40 CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    RecurrenceWidget QWidget
    recurrencewidget.h
    VendorCluster QWidget
    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _voucherNumber _vendor _invoiceDate _distributionDate _dueDate _terms _amountToDistribute _amountDistributed _balance _invoiceNum _reference _taxzone _flagFor1099 tabWidget _miscDistrib _new _edit _delete _notes _save _close _amountToDistribute idChanged(int) _amountDistributed setId(int) 20 20 20 20 _amountToDistribute effectiveChanged(QDate) _amountDistributed setEffective(QDate) 20 20 20 20 _amountToDistribute idChanged(int) _balance setId(int) 20 20 20 20 _amountToDistribute effectiveChanged(QDate) _balance setEffective(QDate) 20 20 20 20 _close clicked() miscVoucher close() 20 20 20 20 _distributionDate newDate(QDate) _amountToDistribute setEffective(QDate) 20 20 20 20 _vendor valid(bool) _save setEnabled(bool) 20 20 20 20 _miscDistrib valid(bool) _edit setEnabled(bool) 20 20 20 20 _miscDistrib valid(bool) _delete setEnabled(bool) 20 20 20 20 _miscDistrib itemSelected(int) _edit animateClick() 20 20 20 20 qt-client-4.1.0/guiclient/newForm.ui000066400000000000000000000073331217451700100173570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. newForm 0 0 472 254 New Form QFormLayout::FieldsStayAtSizeHint 18 18 Search Criterion: _searchMe 14 12 &Close Query Qt::Vertical QSizePolicy::Preferred 20 0 Results: _results XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _searchMe _results _query _close _close clicked() newForm close() 335 31 246 7
    qt-client-4.1.0/guiclient/openPurchaseOrder.cpp000066400000000000000000000043461217451700100215400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2009 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "openPurchaseOrder.h" #include #include #include #include #include #include //#include "purchaseOrder.h" openPurchaseOrder::openPurchaseOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _po->addColumn(tr("PO #"), -1, Qt::AlignLeft, true, "pohead_number"); _po->addColumn(tr("PO Date"), -1, Qt::AlignLeft, true, "pohead_orderdate"); _po->addColumn(tr("Created By"), -1, Qt::AlignLeft, true, "pohead_agent_username"); } openPurchaseOrder::~openPurchaseOrder() { // no need to delete child widgets, Qt does it all for us } void openPurchaseOrder::languageChange() { // retranslateUi(this); } void openPurchaseOrder::sSelect() { done(_po->id()); } enum SetResponse openPurchaseOrder::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("vend_name", &valid); vendor_id = pParams.value("vend_id", &valid).toInt(); _vend_namelit -> setText(param.toString()); sFillList(); return NoError; } void openPurchaseOrder::sFillList() { XSqlQuery openFillList; openFillList.prepare( "SELECT pohead_id, pohead_number, pohead_orderdate, pohead_agent_username from pohead where pohead_vend_id = :vend_id and pohead_status = 'U' order by pohead_id desc ;" ); openFillList.bindValue(":vend_id", vendor_id); openFillList.exec(); _po->populate(openFillList,TRUE); if (openFillList.lastError().type() != QSqlError::NoError) { systemError(this, openFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/openPurchaseOrder.h000066400000000000000000000020621217451700100211760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPENPURCHASEORDER_H #define OPENPURCHASEORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_openPurchaseOrder.h" class openPurchaseOrder : public XDialog, public Ui::openPurchaseOrder { Q_OBJECT public: openPurchaseOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~openPurchaseOrder(); int vendor_id; public slots: virtual void sFillList(); virtual void sSelect(); virtual enum SetResponse set(const ParameterList & pParams); protected slots: virtual void languageChange(); }; #endif // OPENPURCHASEORDER_H qt-client-4.1.0/guiclient/openPurchaseOrder.ui000066400000000000000000000056511217451700100213730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. openPurchaseOrder 0 0 603 395 0 0 Open Purchase Orders false Open Purchase Orders for : Close Select true Qt::Vertical 20 40 XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    qt-client-4.1.0/guiclient/openReturnAuthorizations.cpp000066400000000000000000000215401217451700100232100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "openReturnAuthorizations.h" #include #include #include #include #include #include "mqlutil.h" #include "returnAuthorization.h" #include "openReturnAuthorizations.h" #include "printRaForm.h" openReturnAuthorizations::openReturnAuthorizations(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_ra, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_ra, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_expired, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_unauthorized, SIGNAL(clicked()), this, SLOT(sFillList())); _ra->addColumn(tr("Return #"), _orderColumn, Qt::AlignLeft, true, "rahead_number" ); _ra->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "custnumber" ); _ra->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "rahead_billtoname" ); _ra->addColumn(tr("Disposition"), _itemColumn, Qt::AlignLeft, true, "disposition" ); _ra->addColumn(tr("Created"), _dateColumn, Qt::AlignCenter, true, "rahead_authdate" ); _ra->addColumn(tr("Expires"), -1, Qt::AlignCenter, true, "rahead_expiredate" ); if (_privileges->check("MaintainReturns")) { connect(_ra, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_ra, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_ra, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_ra, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(omfgThis, SIGNAL(returnAuthorizationsUpdated()), this, SLOT(sFillList())); } openReturnAuthorizations::~openReturnAuthorizations() { // no need to delete child widgets, Qt does it all for us } void openReturnAuthorizations::languageChange() { retranslateUi(this); } enum SetResponse openReturnAuthorizations::set(const ParameterList& pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("run", &valid); if (valid) { connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); sFillList(); } return NoError; } void openReturnAuthorizations::setParams(ParameterList ¶ms) { if (_preferences->boolean("selectedSites") || _warehouse->isSelected()) params.append("selectedSites"); _warehouse->appendValue(params); if(_expired->isChecked()) params.append("showExpired"); if(_unauthorized->isChecked()) params.append("showUnauthorized"); params.append("undefined", tr("Undefined")); params.append("credit", tr("Credit")); params.append("return", tr("Return")); params.append("replace", tr("Replace")); params.append("service", tr("Service")); params.append("substitute", tr("Substitute")); } void openReturnAuthorizations::sPrint() { ParameterList params; setParams(params); orReport report("ListOpenReturnAuthorizations", params); if (report.isValid()) report.print(); else report.reportError(this); } void openReturnAuthorizations::sNew() { ParameterList params; params.append("mode", "new"); returnAuthorization *newdlg = new returnAuthorization(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void openReturnAuthorizations::sEdit() { if (!checkSitePrivs(_ra->id())) return; ParameterList params; params.append("mode", "edit"); params.append("rahead_id", _ra->id()); returnAuthorization *newdlg = new returnAuthorization(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void openReturnAuthorizations::sView() { if (!checkSitePrivs(_ra->id())) return; ParameterList params; params.append("mode", "view"); params.append("rahead_id", _ra->id()); returnAuthorization *newdlg = new returnAuthorization(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void openReturnAuthorizations::sDelete() { XSqlQuery openDelete; if (!checkSitePrivs(_ra->id())) return; XSqlQuery checkwo; checkwo.prepare("SELECT wo_id, wo_status " "FROM wo LEFT OUTER JOIN coitem ON (wo_id=coitem_order_id)" " LEFT OUTER JOIN raitem ON (coitem_id=raitem_new_coitem_id) " "WHERE (raitem_rahead_id = :rahead_id);"); checkwo.bindValue(":rahead_id", _ra->id()); checkwo.exec(); if (checkwo.first()) { if ( QMessageBox::warning( this, tr("Delete Return Authorization?"), tr("

    One or more Line Items on this Return Authorization " "have associated Work Order(s). Work Orders which have not " "been processed will be closed but those with transaction " "history will not be deleted or closed upon deletion of " "this Return Authorization.

    Are you sure that you want to " "completely delete the selected Return Authorization?"), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 0 ) { openDelete.prepare("DELETE FROM rahead WHERE (rahead_id=:rahead_id);"); openDelete.bindValue(":rahead_id", _ra->id()); openDelete.exec(); if (openDelete.lastError().type() != QSqlError::NoError) { systemError(this, openDelete.lastError().databaseText(), __FILE__, __LINE__); } } } else if (checkwo.lastError().type() != QSqlError::NoError) { systemError(this, checkwo.lastError().databaseText(), __FILE__, __LINE__); } else { if ( QMessageBox::warning( this, tr("Delete Return Authorization?"), tr("Are you sure that you want to completely delete the selected Return Authorization?"), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 0 ) { openDelete.prepare("DELETE FROM rahead WHERE (rahead_id=:rahead_id);"); openDelete.bindValue(":rahead_id", _ra->id()); openDelete.exec(); if (openDelete.lastError().type() != QSqlError::NoError) { systemError(this, openDelete.lastError().databaseText(), __FILE__, __LINE__); } } } omfgThis->sReturnAuthorizationsUpdated(); } void openReturnAuthorizations::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainReturns")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainReturns")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Print Return Authorization Form..."), this, SLOT(sPrintForms())); } void openReturnAuthorizations::sFillList() { XSqlQuery openFillList; MetaSQLQuery mql = mqlLoad("returnAuthorizations", "detail"); ParameterList params; setParams(params); openFillList = mql.toQuery(params); _ra->populate(openFillList); if (openFillList.lastError().type() != QSqlError::NoError) { systemError(this, openFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _ra->setDragString("raheadid="); } void openReturnAuthorizations::sPrintForms() { if (!checkSitePrivs(_ra->id())) return; ParameterList params; params.append("rahead_id", _ra->id()); printRaForm newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } bool openReturnAuthorizations::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkRASitePrivs(:raheadid) AS result;"); check.bindValue(":raheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Return Authorization as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/openReturnAuthorizations.h000066400000000000000000000025731217451700100226620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPENRETURNAUTHORIZATIONS_H #define OPENRETURNAUTHORIZATIONS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_openReturnAuthorizations.h" class openReturnAuthorizations : public XWidget, public Ui::openReturnAuthorizations { Q_OBJECT public: openReturnAuthorizations(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~openReturnAuthorizations(); virtual void setParams(ParameterList &); virtual bool checkSitePrivs(int ordid); public slots: virtual enum SetResponse set(const ParameterList&); virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sFillList(); // virtual void sDeliver(); virtual void sPrintForms(); protected slots: virtual void languageChange(); }; #endif // OPENRETURNAUTHORIZATIONS_H qt-client-4.1.0/guiclient/openReturnAuthorizations.ui000066400000000000000000000231411217451700100230420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. openReturnAuthorizations 0 0 800 600 600 400 List Open Return Authorizations 12 12 false Show Unauthorized true Expired true Qt::Horizontal QSizePolicy::Expanding 0 20 0 &Close &Print Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 0 0 20 Return Authorizations: 0 0 0 true &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 166 WarehouseGroup QGroupBox

    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _unauthorized _expired _ra _new _edit _view _delete _close _print _close clicked() openReturnAuthorizations close() 20 20 20 20 _ra valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/openSalesOrders.cpp000066400000000000000000000216531217451700100212200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "openSalesOrders.h" #include #include #include #include "copySalesOrder.h" #include "dspSalesOrderStatus.h" #include "dspShipmentsBySalesOrder.h" #include "errorReporter.h" #include "issueToShipping.h" #include "printPackingList.h" #include "printSoForm.h" #include "salesOrder.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" openSalesOrders::openSalesOrders(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "openSalesOrders", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Open Sales Orders")); setMetaSQLOptions("opensalesorders", "detail"); setReportName("ListOpenSalesOrders"); setParameterWidgetVisible(true); setNewVisible(true); setQueryOnStartEnabled(true); setAutoUpdateEnabled(true); _custid = -1; optionsWidget()->hide(); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _dates->setStartDate(QDate().currentDate().addDays(-90)); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("P/O Number"), "poNumber", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesRepsActive); list()->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number"); list()->addColumn(tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number"); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cohead_billtoname"); list()->addColumn(tr("Ship-To"), _itemColumn, Qt::AlignLeft, false,"cohead_shiptoname"); list()->addColumn(tr("Cust. P/O Number"), -1 , Qt::AlignLeft, true, "cohead_custponumber"); list()->addColumn(tr("Ordered"), _dateColumn, Qt::AlignCenter,true, "cohead_orderdate"); list()->addColumn(tr("Scheduled"), _dateColumn, Qt::AlignCenter,true, "scheddate"); list()->addColumn(tr("Status"), _statusColumn, Qt::AlignLeft, false, "status"); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, false, "notes"); if (_privileges->check("MaintainSalesOrders")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillList())); } enum SetResponse openSalesOrders::set(const ParameterList& pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("run", &valid); if (valid) sFillList(); return NoError; } bool openSalesOrders::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; if (_dates->isVisible()) { if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Start Date"), tr("You must enter a valid Start Date.") ); _dates->setFocus(); return false; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter End Date"), tr("You must enter a valid End Date.") ); _dates->setFocus(); return false; } _dates->appendValue(params); } params.append("error", tr("Error")); if (_showClosed->isChecked() && _showClosed->isVisible()) params.append("showClosed"); return true; } void openSalesOrders::sNew() { salesOrder::newSalesOrder(_custid, this); } void openSalesOrders::sEdit() { if (checkSitePrivs()) salesOrder::editSalesOrder(list()->id(), false, this); } void openSalesOrders::sView() { if (checkSitePrivs()) salesOrder::viewSalesOrder(list()->id(), this); } void openSalesOrders::sCopy() { if (!checkSitePrivs()) return; ParameterList params; params.append("sohead_id", list()->id()); copySalesOrder newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void openSalesOrders::sDelete() { (void)salesOrder::deleteSalesOrder(list()->id()); } void openSalesOrders::sPrintPackingList() { if (!checkSitePrivs()) return; ParameterList params; params.append("sohead_id", list()->id()); printPackingList newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void openSalesOrders::sAddToPackingListBatch() { XSqlQuery openAddToPackingListBatch; if (!checkSitePrivs()) return; openAddToPackingListBatch.prepare("SELECT addToPackingListBatch(:sohead_id) AS result;"); openAddToPackingListBatch.bindValue(":sohead_id", list()->id()); openAddToPackingListBatch.exec(); if (openAddToPackingListBatch.first()) { int result = openAddToPackingListBatch.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("addToPackingListBatch", result), __FILE__, __LINE__); return; } } else if (openAddToPackingListBatch.lastError().type() != QSqlError::NoError) { systemError(this, openAddToPackingListBatch.lastError().databaseText(), __FILE__, __LINE__); return; } } void openSalesOrders::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Copy..."), this, SLOT(sCopy())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList())); menuItem->setEnabled(_privileges->check("PrintPackingLists")); menuItem = pMenu->addAction(tr("Add to Packing List Batch..."), this, SLOT(sAddToPackingListBatch())); menuItem->setEnabled(_privileges->check("MaintainPackingListBatch")); menuItem = pMenu->addAction(tr("Print Sales Order Form..."), this, SLOT(sPrintForms())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Issue to Shipping..."), this, SLOT(sIssueToShipping())); menuItem->setEnabled(_privileges->check("IssueStockToShipping")); pMenu->addAction(tr("Shipment Status..."), this, SLOT(sDspShipmentStatus())); pMenu->addAction(tr("Shipments..."), this, SLOT(sShipment())); } void openSalesOrders::sPrintForms() { if (!checkSitePrivs()) return; ParameterList params; params.append("sohead_id", list()->id()); printSoForm newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } bool openSalesOrders::checkSitePrivs() { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkSOSitePrivs(:coheadid) AS result;"); check.bindValue(":coheadid", list()->id()); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Sales Order as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } void openSalesOrders::sIssueToShipping() { ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); issueToShipping *newdlg = new issueToShipping(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void openSalesOrders::sDspShipmentStatus() { ParameterList params; params.append("sohead_id", list()->id()); params.append("run"); dspSalesOrderStatus *newdlg = new dspSalesOrderStatus(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void openSalesOrders::sShipment() { ParameterList params; params.append("sohead_id", list()->id()); dspShipmentsBySalesOrder* newdlg = new dspShipmentsBySalesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void openSalesOrders::setCustId(int custId) { _custid = custId; parameterWidget()->setDefault(tr("Customer"), custId, true ); } int openSalesOrders::custId() { return _custid; } qt-client-4.1.0/guiclient/openSalesOrders.h000066400000000000000000000027231217451700100206620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPENSALESORDERS_H #define OPENSALESORDERS_H #include "display.h" #include #include "ui_openSalesOrders.h" class openSalesOrders : public display, public Ui::openSalesOrders { Q_OBJECT public: openSalesOrders(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); Q_INVOKABLE virtual void setCustId(int custId); Q_INVOKABLE virtual int custId(); Q_INVOKABLE virtual bool checkSitePrivs(); public slots: virtual enum SetResponse set(const ParameterList&); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sCopy(); virtual void sDelete(); virtual void sPrintPackingList(); virtual void sAddToPackingListBatch(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sPrintForms(); virtual void sIssueToShipping(); virtual void sDspShipmentStatus(); virtual void sShipment(); virtual bool setParams(ParameterList &); private: int _custid; }; #endif // OPENSALESORDERS_H qt-client-4.1.0/guiclient/openSalesOrders.ui000066400000000000000000000034151217451700100210470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. openSalesOrders 0 0 277 142 List Open Sales Orders Order Date Show Closed true DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    qt-client-4.1.0/guiclient/openVouchers.cpp000066400000000000000000000265371217451700100205760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "openVouchers.h" #include #include #include #include #include #include #include #include #include #include "errorReporter.h" #include "failedPostList.h" #include "getGLDistDate.h" #include "miscVoucher.h" #include "storedProcErrorLookup.h" #include "voucher.h" openVouchers::openVouchers(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sFillList())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_vohead, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_newMisc, SIGNAL(clicked()), this, SLOT(sNewMisc())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _vohead->addColumn(tr("Vchr. #"), _orderColumn, Qt::AlignRight, true, "vohead_number" ); _vohead->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "ponumber" ); _vohead->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vendor" ); _vohead->addColumn(tr("Vend. Type"), _itemColumn, Qt::AlignLeft, true, "vendtype_code" ); _vohead->addColumn(tr("Vendor Invc. #"), _itemColumn, Qt::AlignRight, true, "vohead_invcnumber" ); _vohead->addColumn(tr("Dist. Date"), _dateColumn, Qt::AlignCenter, true, "vohead_distdate" ); _vohead->addColumn(tr("G/L Post Date"), _dateColumn, Qt::AlignCenter, true, "postdate" ); _vohead->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "vohead_amount" ); if (! _privileges->check("ChangeVOPostDate")) _vohead->hideColumn(6); if (_privileges->check("MaintainVouchers")) { connect(_vohead, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_vohead, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_vohead, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); _newMisc->setEnabled(FALSE); connect(_vohead, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } if (_privileges->check("PostVouchers")) connect(_vohead, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); connect(omfgThis, SIGNAL(vouchersUpdated()), this, SLOT(sFillList())); sFillList(); } openVouchers::~openVouchers() { // no need to delete child widgets, Qt does it all for us } void openVouchers::languageChange() { retranslateUi(this); } bool openVouchers::setParams(ParameterList ¶ms) { _vendorgroup->appendValue(params); params.append("misc", tr("Misc.")); return true; } void openVouchers::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("UnpostedVouchers", params); if (report.isValid()) report.print(); else report.reportError(this); } void openVouchers::sNew() { ParameterList params; params.append("mode", "new"); voucher *newdlg = new voucher(); omfgThis->handleNewWindow(newdlg); newdlg->set(params); } void openVouchers::sNewMisc() { ParameterList params; params.append("mode", "new"); if (_vendorgroup->isSelectedVend()) params.append("vend_id", _vendorgroup->vendId()); miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void openVouchers::sEdit() { if (!checkSitePrivs(_vohead->id())) return; ParameterList params; params.append("mode", "edit"); params.append("vohead_id", _vohead->id()); if (_vohead->altId() == -1) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void openVouchers::sView() { if (!checkSitePrivs(_vohead->id())) return; ParameterList params; params.append("mode", "view"); params.append("vohead_id", _vohead->id()); if (_vohead->altId() == -1) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void openVouchers::sDelete() { if (QMessageBox::question(this, tr("Delete Selected Vouchers"), tr("

    Are you sure that you want to delete the " "selected Vouchers?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("DELETE FROM vohead WHERE vohead_id=:vohead_id;"); QListselected = _vohead->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); delq.bindValue(":vohead_id", id); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Voucher"), delq, __FILE__, __LINE__); } } omfgThis->sVouchersUpdated(); } } void openVouchers::sPost() { bool changeDate = false; QDate newDate = QDate::currentDate(); if (_privileges->check("ChangeVOPostDate")) { getGLDistDate newdlg(this, "", TRUE); newdlg.sSetDefaultLit(tr("Distribution Date")); if (newdlg.exec() == XDialog::Accepted) { newDate = newdlg.date(); changeDate = (newDate.isValid()); } else return; } XSqlQuery setDate; setDate.prepare("UPDATE vohead SET vohead_gldistdate=:distdate " "WHERE vohead_id=:vohead_id;"); QListselected = _vohead->selectedItems(); QListtriedToClosed; for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); if (changeDate) { setDate.bindValue(":distdate", newDate); setDate.bindValue(":vohead_id", id); setDate.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Changing Dist. Date"), setDate, __FILE__, __LINE__); } } } XSqlQuery post; post.prepare("SELECT fetchJournalNumber('AP-VO') AS result;"); post.exec(); int journalNumber = 0; if(post.first()) journalNumber = post.value("result").toInt(); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Journal Number"), post, __FILE__, __LINE__)) return; post.prepare("SELECT postVoucher(:vohead_id, :journalNumber, FALSE) AS result;"); bool tryagain = false; do { for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); post.bindValue(":vohead_id", id); post.bindValue(":journalNumber", journalNumber); post.exec(); if (post.first()) { int result = post.value("result").toInt(); if (result < 0) ErrorReporter::error(QtCriticalMsg, this, tr("Posting Voucher"), storedProcErrorLookup("postVoucher", result), __FILE__, __LINE__); } // contains() string is hard-coded in stored procedure else if (post.lastError().databaseText().contains("post to closed period")) { if (changeDate) { triedToClosed = selected; break; } else triedToClosed.append(selected[i]); } else ErrorReporter::error(QtCriticalMsg, this, tr("Posting Voucher"), post, __FILE__, __LINE__); } } if (triedToClosed.size() > 0) { failedPostList newdlg(this, "", true); newdlg.sSetList(triedToClosed, _vohead->headerItem(), _vohead->header()); tryagain = (newdlg.exec() == XDialog::Accepted); selected = triedToClosed; triedToClosed.clear(); } } while (tryagain); if (_printJournal->isChecked()) { ParameterList params; params.append("source", "A/P"); params.append("sourceLit", tr("A/P")); params.append("startJrnlnum", journalNumber); params.append("endJrnlnum", journalNumber); if (_metrics->boolean("UseJournals")) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); } orReport report("GLSeries", params); if (report.isValid()) report.print(); else report.reportError(this); } omfgThis->sVouchersUpdated(); } void openVouchers::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Voucher..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainVouchers")); menuItem = pMenu->addAction(tr("View Voucher..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete Voucher..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainVouchers")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post Voucher..."), this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostVouchers")); } void openVouchers::sFillList() { ParameterList params; if (! setParams(params)) return; bool ok = true; QString errorString; MetaSQLQuery mql = MQLUtil::mqlLoad("openVouchers", "populate", errorString, &ok); if(!ok) { ErrorReporter::error(QtCriticalMsg, this, tr("Getting Open Vouchers"), errorString, __FILE__, __LINE__); return; } XSqlQuery r = mql.toQuery(params); _vohead->clear(); _vohead->populate(r, TRUE); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Open Vouchers"), r, __FILE__, __LINE__)) return; } bool openVouchers::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkVoucherSitePrivs(:voheadid) AS result;"); check.bindValue(":voheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("

    You may not view or edit this Voucher as " "it references a Site for which you have not " "been granted privileges.")) ; return false; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Privileges"), check, __FILE__, __LINE__)) return false; } return true; } qt-client-4.1.0/guiclient/openVouchers.h000066400000000000000000000023001217451700100202210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPENVOUCHERS_H #define OPENVOUCHERS_H #include "guiclient.h" #include "xwidget.h" #include "ui_openVouchers.h" class openVouchers : public XWidget, public Ui::openVouchers { Q_OBJECT public: openVouchers(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~openVouchers(); virtual bool setParams(ParameterList &); virtual bool checkSitePrivs(int orderid); public slots: virtual void sPrint(); virtual void sNew(); virtual void sNewMisc(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPost(); virtual void sPopulateMenu(QMenu * pMenu); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // OPENVOUCHERS_H qt-client-4.1.0/guiclient/openVouchers.ui000066400000000000000000000163451217451700100204250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. openVouchers 0 0 687 416 List Unposted Vouchers 0 0 0 0 20 Vouchers: 0 0 QAbstractItemView::ExtendedSelection 0 5 &Close &Print 0 true &New true &New Misc. false &Edit false &View false Post false &Delete Qt::Vertical QSizePolicy::Expanding 20 50 Qt::Horizontal 40 20 Print Journal VendorGroup QWidget

    vendorgroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _vohead _new _newMisc _edit _view _post _delete _printJournal _print _close _close clicked() openVouchers close() 20 20 20 20 _vohead valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/opportunity.cpp000066400000000000000000001250351217451700100205230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunity.h" #include #include #include #include #include #include #include "errorReporter.h" #include "storedProcErrorLookup.h" #include "todoItem.h" #include "salesOrder.h" #include "salesOrderList.h" #include "quoteList.h" #include "printQuote.h" #include "printSoForm.h" #include "characteristicAssignment.h" opportunity::opportunity(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_crmacct, SIGNAL(newId(int)), this, SLOT(sHandleCrmacct(int))); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sCancel())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_deleteTodoItem, SIGNAL(clicked()), this, SLOT(sDeleteTodoItem())); connect(_viewTodoItem, SIGNAL(clicked()), this, SLOT(sViewTodoItem())); connect(_editTodoItem, SIGNAL(clicked()), this, SLOT(sEditTodoItem())); connect(_newTodoItem, SIGNAL(clicked()), this, SLOT(sNewTodoItem())); connect(_todoList, SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick())); connect(_todoList, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this, SLOT(sPopulateTodoMenu(QMenu*))); connect(_todoList, SIGNAL(valid(bool)), this, SLOT(sHandleTodoPrivs())); connect(_deleteSale, SIGNAL(clicked()), this, SLOT(sDeleteSale())); connect(_viewSale, SIGNAL(clicked()), this, SLOT(sViewSale())); connect(_editSale, SIGNAL(clicked()), this, SLOT(sEditSale())); connect(_convertQuote, SIGNAL(clicked()), this, SLOT(sConvertQuote())); connect(_printSale, SIGNAL(clicked()), this, SLOT(sPrintSale())); connect(_salesList, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateSalesMenu(QMenu*))); connect(_salesList, SIGNAL(valid(bool)), this, SLOT(sHandleSalesPrivs())); connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillSalesList())); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sFillSalesList())); connect(_charass, SIGNAL(itemSelected(int)), _editCharacteristic, SLOT(animateClick())); connect(_newCharacteristic, SIGNAL(clicked()), this, SLOT(sNewCharacteristic())); connect(_editCharacteristic, SIGNAL(clicked()), this, SLOT(sEditCharacteristic())); connect(_deleteCharacteristic, SIGNAL(clicked()), this, SLOT(sDeleteCharacteristic())); connect(_assignedTo, SIGNAL(newId(int)), this, SLOT(sHandleAssigned())); _probability->setValidator(new QIntValidator(this)); _opheadid = -1; _custid = -1; _prospectid = -1; _todoList->addColumn(tr("Active"), _statusColumn, Qt::AlignRight, true, "todoitem_active"); _todoList->addColumn(tr("Priority"), _userColumn, Qt::AlignRight, true, "incdtpriority_name"); _todoList->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false, "todoitem_owner_username"); _todoList->addColumn(tr("Assigned"), _userColumn, Qt::AlignLeft, true, "todoitem_username" ); _todoList->addColumn(tr("Name"), 100, Qt::AlignLeft, true, "todoitem_name" ); _todoList->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "todoitem_description" ); _todoList->addColumn(tr("Status"), _statusColumn, Qt::AlignLeft, true, "todoitem_status" ); _todoList->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft, true, "todoitem_due_date" ); _salesList->addColumn(tr("Doc #"), _orderColumn, Qt::AlignLeft, true, "sale_number" ); _salesList->addColumn(tr("Type"), -1, Qt::AlignLeft, true, "sale_type" ); _salesList->addColumn(tr("Date"), _dateColumn, Qt::AlignLeft, true, "sale_date" ); _salesList->addColumn(tr("Ext. Price"), _priceColumn, Qt::AlignRight, true, "sale_extprice"); _charass->addColumn(tr("Characteristic"), _itemColumn, Qt::AlignLeft, true, "char_name" ); _charass->addColumn(tr("Value"), -1, Qt::AlignLeft, true, "charass_value" ); _charass->addColumn(tr("Default"), _ynColumn, Qt::AlignCenter,true, "charass_default" ); _owner->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); _saved = false; } /* * Destroys the object and frees any allocated resources */ opportunity::~opportunity() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void opportunity::languageChange() { retranslateUi(this); } enum SetResponse opportunity::set(const ParameterList &pParams) { XSqlQuery opportunityet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("ophead_id", &valid); if (valid) { _opheadid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); _comments->setReadOnly(true); _documents->setReadOnly(true); param = pParams.value("crmacct_id", &valid); if (valid) _crmacct->setId(param.toInt()); _startDate->setDate(omfgThis->dbDate()); opportunityet.exec("SELECT NEXTVAL('ophead_ophead_id_seq') AS result;"); if (opportunityet.first()) { _opheadid = opportunityet.value("result").toInt(); } else if(opportunityet.lastError().type() != QSqlError::NoError) { systemError(this, opportunityet.lastError().databaseText(), __FILE__, __LINE__); } opportunityet.exec("SELECT fetchNextNumber('OpportunityNumber') AS result;"); if (opportunityet.first()) { _number->setText(opportunityet.value("result").toString()); } else if(opportunityet.lastError().type() != QSqlError::NoError) { systemError(this, opportunityet.lastError().databaseText(), __FILE__, __LINE__); } } else if (param.toString() == "edit") { _mode = cEdit; connect(_charass, SIGNAL(valid(bool)), _editCharacteristic, SLOT(setEnabled(bool))); connect(_charass, SIGNAL(valid(bool)), _deleteCharacteristic, SLOT(setEnabled(bool))); _crmacct->setEnabled(true); _buttonBox->setFocus(); } else if (param.toString() == "view") { _mode = cView; _crmacct->setEnabled(false); _owner->setEnabled(false); _oppstage->setEnabled(false); _oppsource->setEnabled(false); _opptype->setEnabled(false); _notes->setReadOnly(true); _name->setEnabled(false); _targetDate->setEnabled(false); _actualDate->setEnabled(false); _amount->setEnabled(false); _probability->setEnabled(false); _deleteTodoItem->setEnabled(false); _editTodoItem->setEnabled(false); _newTodoItem->setEnabled(false); _deleteSale->setEnabled(false); _editSale->setEnabled(false); _printSale->setEnabled(false); _newSale->setEnabled(false); _attachSale->setEnabled(false); _newCharacteristic->setEnabled(FALSE); _buttonBox->setStandardButtons(QDialogButtonBox::Close); _cntct->setReadOnly(true); _comments->setReadOnly(true); _documents->setReadOnly(true); } } param = pParams.value("crmacct_id", &valid); if (valid) { _crmacct->setId(param.toInt()); _crmacct->setEnabled(false); } sHandleTodoPrivs(); sHandleSalesPrivs(); return NoError; } void opportunity::sCancel() { XSqlQuery cancelOppo; if(cNew == _mode) { cancelOppo.prepare("SELECT releaseNumber('OpportunityNumber', :number);"); cancelOppo.bindValue(":number", _number->text().toInt()); cancelOppo.exec(); if (cancelOppo.lastError().type() != QSqlError::NoError) { systemError(this, cancelOppo.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_saved && cNew == _mode) { cancelOppo.prepare("SELECT deleteOpportunity(:ophead_id) AS result;"); cancelOppo.bindValue(":ophead_id", _opheadid); cancelOppo.exec(); if (cancelOppo.first()) { int result = cancelOppo.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteOpportunity", result)); return; } } else if (cancelOppo.lastError().type() != QSqlError::NoError) { systemError(this, cancelOppo.lastError().databaseText(), __FILE__, __LINE__); return; } } reject(); } void opportunity::sSave() { if (! save(false)) // if error return; done(_opheadid); } bool opportunity::save(bool partial) { XSqlQuery opportunityave; if (! partial) { if(_crmacct->id() == -1) { QMessageBox::critical( this, tr("Incomplete Information"), tr("You must specify the Account that this opportunity is for.") ); return false; } if(_name->text().trimmed().isEmpty()) { QMessageBox::critical( this, tr("Incomplete Information"), tr("You must specify a Name for this opportunity report.") ); _name->setFocus(); return false; } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); if (!opportunityave.exec("BEGIN")) { rollback.exec(); systemError(this, opportunityave.lastError().databaseText(), __FILE__, __LINE__); return false; } if (cNew == _mode && !_saved) opportunityave.prepare("INSERT INTO ophead" " (ophead_id, ophead_name, ophead_crmacct_id," " ophead_owner_username," " ophead_opstage_id, ophead_opsource_id," " ophead_optype_id, ophead_probability_prcnt," " ophead_amount, ophead_curr_id, ophead_target_date," " ophead_actual_date," " ophead_notes, ophead_active, ophead_cntct_id, " " ophead_username, ophead_start_date, ophead_assigned_date, " " ophead_priority_id, ophead_number) " "VALUES(:ophead_id, :ophead_name, :ophead_crmacct_id," " :ophead_owner_username," " :ophead_opstage_id, :ophead_opsource_id," " :ophead_optype_id, :ophead_probability_prcnt," " :ophead_amount, :ophead_curr_id, :ophead_target_date," " :ophead_actual_date," " :ophead_notes, :ophead_active, :ophead_cntct_id, " " :ophead_username, :ophead_start_date, :ophead_assigned_date, " " :ophead_priority_id, :ophead_number); " ); else if (cEdit == _mode || _saved) opportunityave.prepare("UPDATE ophead" " SET ophead_name=:ophead_name," " ophead_crmacct_id=:ophead_crmacct_id," " ophead_owner_username=:ophead_owner_username," " ophead_opstage_id=:ophead_opstage_id," " ophead_opsource_id=:ophead_opsource_id," " ophead_optype_id=:ophead_optype_id," " ophead_probability_prcnt=:ophead_probability_prcnt," " ophead_amount=:ophead_amount," " ophead_curr_id=:ophead_curr_id," " ophead_target_date=:ophead_target_date," " ophead_actual_date=:ophead_actual_date," " ophead_notes=:ophead_notes," " ophead_active=:ophead_active, " " ophead_cntct_id=:ophead_cntct_id, " " ophead_username=:ophead_username, " " ophead_start_date=:ophead_start_date, " " ophead_assigned_date=:ophead_assigned_date, " " ophead_priority_id=:ophead_priority_id " " WHERE (ophead_id=:ophead_id); "); opportunityave.bindValue(":ophead_id", _opheadid); opportunityave.bindValue(":ophead_name", _name->text()); opportunityave.bindValue(":ophead_active", QVariant(_active->isChecked())); if (_crmacct->id() > 0) opportunityave.bindValue(":ophead_crmacct_id", _crmacct->id()); opportunityave.bindValue(":ophead_owner_username", _owner->username()); opportunityave.bindValue(":ophead_username", _assignedTo->username()); if(_oppstage->isValid()) opportunityave.bindValue(":ophead_opstage_id", _oppstage->id()); if(_oppsource->isValid()) opportunityave.bindValue(":ophead_opsource_id", _oppsource->id()); if(_opptype->isValid()) opportunityave.bindValue(":ophead_optype_id", _opptype->id()); if(!_probability->text().isEmpty()) opportunityave.bindValue(":ophead_probability_prcnt", _probability->text().toInt()); if(!_amount->isZero()) { opportunityave.bindValue(":ophead_amount", _amount->localValue()); opportunityave.bindValue(":ophead_curr_id", _amount->id()); } if(_startDate->isValid()) opportunityave.bindValue(":ophead_start_date", _startDate->date()); if(_assignDate->isValid()) opportunityave.bindValue(":ophead_assigned_date", _assignDate->date()); if(_targetDate->isValid()) opportunityave.bindValue(":ophead_target_date", _targetDate->date()); if(_actualDate->isValid()) opportunityave.bindValue(":ophead_actual_date", _actualDate->date()); opportunityave.bindValue(":ophead_notes", _notes->toPlainText()); if (_cntct->isValid()) opportunityave.bindValue(":ophead_cntct_id", _cntct->id()); if (_priority->isValid()) opportunityave.bindValue(":ophead_priority_id", _priority->id()); opportunityave.bindValue(":ophead_number", _number->text()); if(!opportunityave.exec() && opportunityave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, opportunityave.lastError().databaseText(), __FILE__, __LINE__); return false; } opportunityave.exec("COMMIT;"); if(opportunityave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, opportunityave.lastError().databaseText(), __FILE__, __LINE__); return false; } _saved = true; return true; } void opportunity::populate() { XSqlQuery opportunitypopulate; opportunitypopulate.prepare("SELECT ophead_name," " ophead_crmacct_id," " ophead_owner_username," " ophead_opstage_id, ophead_opsource_id," " ophead_optype_id," " ophead_probability_prcnt, ophead_amount," " COALESCE(ophead_curr_id, basecurrid()) AS curr_id," " ophead_target_date, ophead_actual_date," " ophead_notes, ophead_active, ophead_cntct_id, " " ophead_username, ophead_start_date, ophead_assigned_date, " " ophead_number, ophead_priority_id " " FROM ophead" " WHERE(ophead_id=:ophead_id); "); opportunitypopulate.bindValue(":ophead_id", _opheadid); opportunitypopulate.exec(); if(opportunitypopulate.first()) { _number->setText(opportunitypopulate.value("ophead_number").toString()); _name->setText(opportunitypopulate.value("ophead_name").toString()); _active->setChecked(opportunitypopulate.value("ophead_active").toBool()); _crmacct->setId(opportunitypopulate.value("ophead_crmacct_id").toInt()); _owner->setUsername(opportunitypopulate.value("ophead_owner_username").toString()); _assignedTo->setUsername(opportunitypopulate.value("ophead_username").toString()); _oppstage->setNull(); if(!opportunitypopulate.value("ophead_opstage_id").toString().isEmpty()) _oppstage->setId(opportunitypopulate.value("ophead_opstage_id").toInt()); _priority->setNull(); if(!opportunitypopulate.value("ophead_priority_id").toString().isEmpty()) _priority->setId(opportunitypopulate.value("ophead_priority_id").toInt()); _oppsource->setNull(); if(!opportunitypopulate.value("ophead_opsource_id").toString().isEmpty()) _oppsource->setId(opportunitypopulate.value("ophead_opsource_id").toInt()); _opptype->setNull(); if(!opportunitypopulate.value("ophead_optype_id").toString().isEmpty()) _opptype->setId(opportunitypopulate.value("ophead_optype_id").toInt()); _probability->clear(); if(!opportunitypopulate.value("ophead_probability_prcnt").toString().isEmpty()) _probability->setText(opportunitypopulate.value("ophead_probability_prcnt").toDouble()); _amount->clear(); _amount->setId(opportunitypopulate.value("curr_id").toInt()); if(!opportunitypopulate.value("ophead_amount").toString().isEmpty()) _amount->setLocalValue(opportunitypopulate.value("ophead_amount").toDouble()); _startDate->clear(); if(!opportunitypopulate.value("ophead_start_date").toString().isEmpty()) _startDate->setDate(opportunitypopulate.value("ophead_start_date").toDate()); _assignDate->clear(); if(!opportunitypopulate.value("ophead_assigned_date").toString().isEmpty()) _assignDate->setDate(opportunitypopulate.value("ophead_assigned_date").toDate()); _targetDate->clear(); if(!opportunitypopulate.value("ophead_target_date").toString().isEmpty()) _targetDate->setDate(opportunitypopulate.value("ophead_target_date").toDate()); _actualDate->clear(); if(!opportunitypopulate.value("ophead_actual_date").toString().isEmpty()) _actualDate->setDate(opportunitypopulate.value("ophead_actual_date").toDate()); _notes->setText(opportunitypopulate.value("ophead_notes").toString()); _comments->setId(_opheadid); _documents->setId(_opheadid); _cntct->setId(opportunitypopulate.value("ophead_cntct_id").toInt()); sFillTodoList(); sFillSalesList(); sFillCharList(); } } void opportunity::sNewTodoItem() { if (! save(true)) return; ParameterList params; params.append("mode", "new"); params.append("ophead_id", _opheadid); if (_crmacct->isValid()) params.append("crmacct_id", _crmacct->id()); todoItem newdlg(this, 0, true); newdlg.set(params); if (!newdlg.exec() == XDialog::Rejected) sFillTodoList(); } void opportunity::sEditTodoItem() { ParameterList params; params.append("mode", "edit"); params.append("todoitem_id", _todoList->id()); todoItem newdlg(this, 0, true); newdlg.set(params); if (!newdlg.exec() == XDialog::Rejected) sFillTodoList(); } void opportunity::sViewTodoItem() { ParameterList params; params.append("mode", "view"); params.append("todoitem_id", _todoList->id()); todoItem newdlg(this, 0, true); newdlg.set(params); newdlg.exec(); } void opportunity::sDeleteTodoItem() { XSqlQuery opportunityDeleteTodoItem; opportunityDeleteTodoItem.prepare("SELECT deleteTodoItem(:todoitem_id) AS result;"); opportunityDeleteTodoItem.bindValue(":todoitem_id", _todoList->id()); opportunityDeleteTodoItem.exec(); if (opportunityDeleteTodoItem.first()) { int result = opportunityDeleteTodoItem.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteTodoItem", result)); return; } else sFillTodoList(); } else if (opportunityDeleteTodoItem.lastError().type() != QSqlError::NoError) { systemError(this, opportunityDeleteTodoItem.lastError().databaseText(), __FILE__, __LINE__); return; } } void opportunity::sFillTodoList() { XSqlQuery opportunityFillTodoList; opportunityFillTodoList.prepare("SELECT todoitem_id, incdtpriority_name, incdtpriority_order, " " todoitem_owner_username, todoitem_username, todoitem_name, " " firstLine(todoitem_description) AS todoitem_description, " " todoitem_status, todoitem_due_date, todoitem_active, " " CASE " " WHEN (todoitem_status != 'C' AND todoitem_due_date < current_date) THEN " " 'error' " " WHEN (todoitem_status != 'C' AND todoitem_due_date > current_date) THEN " " 'altemphasis' " " END AS qtforegroundrole " " FROM todoitem " " LEFT OUTER JOIN incdtpriority ON (incdtpriority_id=todoitem_priority_id) " "WHERE ( (todoitem_ophead_id=:ophead_id) ) " "ORDER BY incdtpriority_order, todoitem_username;"); opportunityFillTodoList.bindValue(":ophead_id", _opheadid); opportunityFillTodoList.exec(); if (opportunityFillTodoList.lastError().type() != QSqlError::NoError) { systemError(this, opportunityFillTodoList.lastError().databaseText(), __FILE__, __LINE__); return; } _todoList->populate(opportunityFillTodoList); } void opportunity::sPopulateTodoMenu(QMenu *pMenu) { QAction *menuItem; bool newPriv = (cNew == _mode || cEdit == _mode) && (_privileges->check("MaintainPersonalToDoItems") || _privileges->check("MaintainAllToDoItems") ); bool editPriv = (cNew == _mode || cEdit == _mode) && ( (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")) ); bool viewPriv = (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")) || (_privileges->check("MaintainAllToDoItems")); menuItem = pMenu->addAction(tr("New..."), this, SLOT(sNewTodoItem())); menuItem->setEnabled(newPriv); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEditTodoItem())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sViewTodoItem())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDeleteTodoItem())); menuItem->setEnabled(editPriv); } void opportunity::sHandleTodoPrivs() { bool newPriv = (cNew == _mode || cEdit == _mode) && (_privileges->check("MaintainPersonalToDoItems") || _privileges->check("MaintainAllToDoItems") ); bool editPriv = false; bool viewPriv = false; if(_todoList->currentItem()) { editPriv = (cNew == _mode || cEdit == _mode) && ( (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")) ); viewPriv = (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_username") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _todoList->currentItem()->rawValue("todoitem_owner_username") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")) || (_privileges->check("MaintainAllToDoItems")); } _newTodoItem->setEnabled(newPriv); _editTodoItem->setEnabled(editPriv && _todoList->id() > 0); _viewTodoItem->setEnabled((editPriv || viewPriv) && _todoList->id() > 0); _deleteTodoItem->setEnabled(editPriv && _todoList->id() > 0); if (editPriv) { disconnect(_todoList,SIGNAL(itemSelected(int)),_viewTodoItem, SLOT(animateClick())); connect(_todoList, SIGNAL(itemSelected(int)), _editTodoItem, SLOT(animateClick())); } else if (viewPriv) { disconnect(_todoList,SIGNAL(itemSelected(int)),_editTodoItem, SLOT(animateClick())); connect(_todoList, SIGNAL(itemSelected(int)), _viewTodoItem, SLOT(animateClick())); } } void opportunity::sPrintSale() { if (_salesList->altId() == 0) sPrintQuote(); else sPrintSalesOrder(); } void opportunity::sEditSale() { if (_salesList->altId() == 0) sEditQuote(); else sEditSalesOrder(); } void opportunity::sViewSale() { if (_salesList->altId() == 0) sViewQuote(); else sViewSalesOrder(); } void opportunity::sDeleteSale() { if (_salesList->altId() == 0) sDeleteQuote(); else sDeleteSalesOrder(); } void opportunity::sPrintQuote() { printQuote newdlg(this); ParameterList params; params.append("quhead_id", _salesList->id()); params.append("persistentPrint"); newdlg.set(params); if (! newdlg.isSetup()) { if (newdlg.exec() != QDialog::Rejected) newdlg.setSetup(true); } } void opportunity::sConvertQuote() { if (QMessageBox::question(this, tr("Convert Selected Quote"), tr("

    Are you sure that you want to convert " "the selected Quote to a Sales Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { int quheadid = _salesList->id(); XSqlQuery convert; convert.prepare("SELECT convertQuote(:quhead_id) AS sohead_id;"); XSqlQuery prospectq; prospectq.prepare("SELECT convertProspectToCustomer(quhead_cust_id) AS result " "FROM quhead " "WHERE (quhead_id=:quhead_id);"); bool tryagain = false; do { int soheadid = -1; convert.bindValue(":quhead_id", quheadid); convert.exec(); if (convert.first()) { soheadid = convert.value("sohead_id").toInt(); if (soheadid == -3) { if ((_metrics->value("DefaultSalesRep").toInt() > 0) && (_metrics->value("DefaultTerms").toInt() > 0) && (_metrics->value("DefaultCustType").toInt() > 0) && (_metrics->value("DefaultShipFormId").toInt() > 0) && (_privileges->check("MaintainCustomerMasters"))) { if (QMessageBox::question(this, tr("Quote for Prospect"), tr("

    This Quote is for a Prospect, not " "a Customer. Do you want to convert " "the Prospect to a Customer using global " "default values?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { prospectq.bindValue(":quhead_id", quheadid); prospectq.exec(); if (prospectq.first()) { int result = prospectq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("convertProspectToCustomer", result), __FILE__, __LINE__); continue; } convert.exec(); if (convert.first()) { soheadid = convert.value("sohead_id").toInt(); if (soheadid < 0) { QMessageBox::warning(this, tr("Cannot Convert Quote"), storedProcErrorLookup("convertQuote", soheadid) .arg(quheadid)); continue; } } } else if (prospectq.lastError().type() != QSqlError::NoError) { systemError(this, prospectq.lastError().databaseText(), __FILE__, __LINE__); continue; } } else { QMessageBox::information(this, tr("Quote for Prospect"), tr("

    The prospect must be manually " "converted to customer from either the " "CRM Account or Customer windows before " "coverting this quote.")); continue; } } else { QMessageBox::information(this, tr("Quote for Prospect"), tr("

    The prospect must be manually " "converted to customer from either the " "CRM Account or Customer windows before " "coverting this quote.")); continue; } } else if (soheadid < 0) { QMessageBox::warning(this, tr("Cannot Convert Quote"), storedProcErrorLookup("convertQuote", soheadid) .arg(quheadid)); continue; } ParameterList params; params.append("mode", "edit"); params.append("sohead_id", soheadid); salesOrder *newdlg = new salesOrder(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (convert.lastError().type() != QSqlError::NoError) { systemError(this, convert.lastError().databaseText(), __FILE__, __LINE__); continue; } } while (tryagain); } // if user wants to convert } void opportunity::sNewQuote() { if (! save(false)) return; ParameterList params; params.append("mode", "newQuote"); if (_custid > -1) params.append("cust_id", _custid); else params.append("cust_id", _prospectid); params.append("ophead_id", _opheadid); salesOrder *newdlg = new salesOrder(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); sFillSalesList(); } void opportunity::sAttachQuote() { XSqlQuery opportunityAttachQuote; ParameterList params; params.append("cust_id", _custid); params.append("openOnly", true); quoteList newdlg(this, "", TRUE); newdlg.set(params); int id = newdlg.exec(); if(id != QDialog::Rejected) { opportunityAttachQuote.prepare("SELECT attachQuoteToOpportunity(:quhead_id, :ophead_id) AS result;"); opportunityAttachQuote.bindValue(":quhead_id", id); opportunityAttachQuote.bindValue(":ophead_id", _opheadid); opportunityAttachQuote.exec(); if (opportunityAttachQuote.first()) { int result = opportunityAttachQuote.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("attachQuoteToOpportunity", result), __FILE__, __LINE__); return; } else sFillSalesList(); } else if (opportunityAttachQuote.lastError().type() != QSqlError::NoError) { systemError(this, opportunityAttachQuote.lastError().databaseText(), __FILE__, __LINE__); return; } } } void opportunity::sEditQuote() { ParameterList params; params.append("mode", "editQuote"); params.append("quhead_id", _salesList->id()); salesOrder *newdlg = new salesOrder(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); sFillSalesList(); } void opportunity::sViewQuote() { ParameterList params; params.append("mode", "viewQuote"); params.append("quhead_id", _salesList->id()); salesOrder *newdlg = new salesOrder(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void opportunity::sDeleteQuote() { XSqlQuery opportunityDeleteQuote; if ( QMessageBox::warning( this, tr("Delete Selected Quote"), tr("Are you sure that you want to delete the selected Quote?" ), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 0) { opportunityDeleteQuote.prepare("SELECT deleteQuote(:quhead_id) AS result;"); opportunityDeleteQuote.bindValue(":quhead_id", _salesList->id()); opportunityDeleteQuote.exec(); if (opportunityDeleteQuote.first()) { int result = opportunityDeleteQuote.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteQuote", result), __FILE__, __LINE__); return; } else sFillSalesList(); } else if (opportunityDeleteQuote.lastError().type() != QSqlError::NoError) { systemError(this, opportunityDeleteQuote.lastError().databaseText(), __FILE__, __LINE__); return; } } } void opportunity::sPrintSalesOrder() { ParameterList params; params.append("sohead_id", _salesList->id()); printSoForm newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void opportunity::sNewSalesOrder() { if (! save(false)) return; ParameterList params; params.append("mode", "new"); params.append("cust_id", _custid); params.append("ophead_id", _opheadid); salesOrder *newdlg = new salesOrder(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); sFillSalesList(); } void opportunity::sAttachSalesOrder() { XSqlQuery opportunityAttachSalesOrder; ParameterList params; params.append("soType", (cSoOpen | cSoCustomer)); params.append("cust_id", _custid); salesOrderList newdlg(this, "", TRUE); newdlg.set(params); int id = newdlg.exec(); if(id != QDialog::Rejected) { opportunityAttachSalesOrder.prepare("SELECT attachSalesOrderToOpportunity(:cohead_id, :ophead_id) AS result;"); opportunityAttachSalesOrder.bindValue(":cohead_id", id); opportunityAttachSalesOrder.bindValue(":ophead_id", _opheadid); opportunityAttachSalesOrder.exec(); if (opportunityAttachSalesOrder.first()) { int result = opportunityAttachSalesOrder.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("attachSalesOrderToOpportunity", result), __FILE__, __LINE__); return; } else sFillSalesList(); } else if (opportunityAttachSalesOrder.lastError().type() != QSqlError::NoError) { systemError(this, opportunityAttachSalesOrder.lastError().databaseText(), __FILE__, __LINE__); return; } } } void opportunity::sEditSalesOrder() { ParameterList params; params.append("mode", "edit"); params.append("sohead_id", _salesList->id()); salesOrder *newdlg = new salesOrder(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); sFillSalesList(); } void opportunity::sViewSalesOrder() { ParameterList params; params.append("mode", "view"); params.append("sohead_id", _salesList->id()); salesOrder *newdlg = new salesOrder(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void opportunity::sDeleteSalesOrder() { (void)salesOrder::deleteSalesOrder(_salesList->id()); } void opportunity::sFillSalesList() { XSqlQuery opportunityFillSalesList; opportunityFillSalesList.prepare("SELECT id, alt_id, sale_type, sale_number, sale_date, sale_extprice, " " 'curr' AS sale_extprice_xtnumericrole, " " 0 AS sale_extprice_xttotalrole " "FROM ( " "SELECT quhead_id AS id, 0 AS alt_id, :quote AS sale_type, " " quhead_number AS sale_number, quhead_quotedate AS sale_date, " " calcQuoteAmt(quhead_id) AS sale_extprice " "FROM quhead " "WHERE ((quhead_ophead_id=:ophead_id) " " AND (quhead_status='O'))" "UNION " "SELECT cohead_id AS id, 1 AS alt_id, :salesorder AS sale_type, " " cohead_number AS sale_number, cohead_orderdate AS sale_date, " " calcSalesOrderAmt(cohead_id) AS sale_extprice " "FROM cohead " "WHERE (cohead_ophead_id=:ophead_id) " " ) AS data " "ORDER BY sale_date;"); opportunityFillSalesList.bindValue(":ophead_id", _opheadid); opportunityFillSalesList.bindValue(":quote", tr("Quote")); opportunityFillSalesList.bindValue(":salesorder", tr("Sales Order")); opportunityFillSalesList.exec(); if (opportunityFillSalesList.lastError().type() != QSqlError::NoError) { systemError(this, opportunityFillSalesList.lastError().databaseText(), __FILE__, __LINE__); return; } _salesList->populate(opportunityFillSalesList, true); } void opportunity::sPopulateSalesMenu(QMenu *pMenu) { bool editPriv = false; bool viewPriv = false; bool convertPriv = false; if(_salesList->currentItem()) { editPriv = (cNew == _mode || cEdit == _mode) && ( (0 == _salesList->currentItem()->altId() && _privileges->check("MaintainQuotes")) || (1 == _salesList->currentItem()->altId() && _privileges->check("MaintainSalesOrders")) ); viewPriv = (cNew == _mode || cEdit == _mode) && ( (0 == _salesList->currentItem()->altId() && _privileges->check("ViewQuotes")) || (1 == _salesList->currentItem()->altId() && _privileges->check("ViewSalesOrders")) ); convertPriv = (cNew == _mode || cEdit == _mode) && (0 == _salesList->currentItem()->altId() && _privileges->check("ConvertQuotes")); } QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEditSale())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sViewSale())); menuItem->setEnabled((editPriv || viewPriv)); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteSale())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("Print..."), this, SLOT(sPrintSale())); menuItem->setEnabled((editPriv || viewPriv)); } void opportunity::sHandleSalesPrivs() { bool isCustomer = (_custid > -1); bool newQuotePriv = ((cNew == _mode || cEdit == _mode) && _privileges->check("MaintainQuotes")); bool newSalesOrderPriv = ((cNew == _mode || cEdit == _mode) && isCustomer && _privileges->check("MaintainSalesOrders")); bool editPriv = false; bool viewPriv = false; bool convertPriv = false; QAction *menuItem; QMenu * newMenu = new QMenu; menuItem = newMenu->addAction(tr("Quote"), this, SLOT(sNewQuote())); menuItem->setEnabled(newQuotePriv); menuItem = newMenu->addAction(tr("Sales Order"), this, SLOT(sNewSalesOrder())); menuItem->setEnabled(newSalesOrderPriv); _newSale->setMenu(newMenu); QMenu * attachMenu = new QMenu; menuItem = attachMenu->addAction(tr("Quote"), this, SLOT(sAttachQuote())); menuItem->setEnabled(newQuotePriv); menuItem = attachMenu->addAction(tr("Sales Order"), this, SLOT(sAttachSalesOrder())); menuItem->setEnabled(newSalesOrderPriv); _attachSale->setMenu(attachMenu); if(_salesList->currentItem()) { editPriv = (cNew == _mode || cEdit == _mode) && ( (0 == _salesList->currentItem()->altId() && _privileges->check("MaintainQuotes")) || (1 == _salesList->currentItem()->altId() && _privileges->check("MaintainSalesOrders")) ); viewPriv = (cNew == _mode || cEdit == _mode) && ( (0 == _salesList->currentItem()->altId() && _privileges->check("ViewQuotes")) || (1 == _salesList->currentItem()->altId() && _privileges->check("ViewSalesOrders")) ); convertPriv = (cNew == _mode || cEdit == _mode) && (0 == _salesList->currentItem()->altId() && _privileges->check("ConvertQuotes")); } _convertQuote->setEnabled(convertPriv && _salesList->id() > 0); _editSale->setEnabled(editPriv && _salesList->id() > 0); _viewSale->setEnabled((editPriv || viewPriv) && _salesList->id() > 0); _printSale->setEnabled((editPriv || viewPriv) && _salesList->id() > 0); _deleteSale->setEnabled(editPriv && _salesList->id() > 0); if (editPriv) { disconnect(_salesList,SIGNAL(itemSelected(int)),_viewSale, SLOT(animateClick())); connect(_salesList, SIGNAL(itemSelected(int)), _editSale, SLOT(animateClick())); } else if (viewPriv) { disconnect(_salesList,SIGNAL(itemSelected(int)),_editSale, SLOT(animateClick())); connect(_salesList, SIGNAL(itemSelected(int)), _viewSale, SLOT(animateClick())); } } void opportunity::sNewCharacteristic() { if (! save(true)) return; ParameterList params; params.append("mode", "new"); params.append("ophead_id", _opheadid); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharList(); } void opportunity::sEditCharacteristic() { ParameterList params; params.append("mode", "edit"); params.append("charass_id", _charass->id()); characteristicAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCharList(); } void opportunity::sDeleteCharacteristic() { XSqlQuery opportunityDeleteCharacteristic; opportunityDeleteCharacteristic.prepare( "DELETE FROM charass " "WHERE (charass_id=:charass_id);" ); opportunityDeleteCharacteristic.bindValue(":charass_id", _charass->id()); opportunityDeleteCharacteristic.exec(); sFillCharList(); } void opportunity::sFillCharList() { XSqlQuery opportunityFillCharList; opportunityFillCharList.prepare( "SELECT charass_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS charass_value, " "charass_default " "FROM charass, char " "WHERE ( (charass_target_type='OPP')" " AND (charass_char_id=char_id)" " AND (charass_target_id=:ophead_id) ) " "ORDER BY char_order, char_name;" ); opportunityFillCharList.bindValue(":ophead_id", _opheadid); opportunityFillCharList.exec(); _charass->populate(opportunityFillCharList); } void opportunity::sHandleCrmacct(int pCrmacctid) { XSqlQuery crmacct; crmacct.prepare( "SELECT COALESCE(crmacct_cust_id, -1) AS cust_id, " " COALESCE(crmacct_prospect_id, -1) AS prospect_id " "FROM crmacct " "WHERE (crmacct_id=:crmacct_id);" ); crmacct.bindValue(":crmacct_id", pCrmacctid); crmacct.exec(); if (crmacct.first()) { _custid = crmacct.value("cust_id").toInt(); _prospectid = crmacct.value("prospect_id").toInt(); } if (_custid == -1 && _prospectid == -1) _salesTab->setEnabled(false); else _salesTab->setEnabled(true); sHandleSalesPrivs(); } void opportunity::sHandleAssigned() { if (_assignedTo->isValid() && !_assignDate->isValid()) _assignDate->setDate(omfgThis->dbDate()); } qt-client-4.1.0/guiclient/opportunity.h000066400000000000000000000044161217451700100201670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITY_H #define OPPORTUNITY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_opportunity.h" class opportunity : public XDialog, public Ui::opportunity { Q_OBJECT public: opportunity(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~opportunity(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sCancel(); virtual void sSave(); virtual bool save(bool); virtual void sDeleteTodoItem(); virtual void sEditTodoItem(); virtual void sFillTodoList(); virtual void sHandleTodoPrivs(); virtual void sNewTodoItem(); virtual void sPopulateTodoMenu(QMenu*); virtual void sViewTodoItem(); virtual void sDeleteSale(); virtual void sEditSale(); virtual void sFillSalesList(); virtual void sHandleAssigned(); virtual void sHandleSalesPrivs(); virtual void sPopulateSalesMenu(QMenu*); virtual void sPrintSale(); virtual void sViewSale(); virtual void sDeleteQuote(); virtual void sEditQuote(); virtual void sNewQuote(); virtual void sAttachQuote(); virtual void sPrintQuote(); virtual void sConvertQuote(); virtual void sViewQuote(); virtual void sDeleteSalesOrder(); virtual void sEditSalesOrder(); virtual void sNewSalesOrder(); virtual void sAttachSalesOrder(); virtual void sPrintSalesOrder(); virtual void sViewSalesOrder(); virtual void sFillCharList(); virtual void sNewCharacteristic(); virtual void sEditCharacteristic(); virtual void sDeleteCharacteristic(); virtual void sHandleCrmacct(int); protected slots: virtual void languageChange(); private: int _opheadid; int _custid; int _prospectid; int _mode; bool _saved; }; #endif // OPPORTUNITY_H qt-client-4.1.0/guiclient/opportunity.ui000066400000000000000000000626031217451700100203570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunity 0 0 702 528 Opportunity Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Active true Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 0 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save CRM Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 250 0 Qt::StrongFocus Qt::Horizontal Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Probability: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _probability 50 0 50 16777215 Qt::AlignRight % Owner: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Qt::Horizontal Assigned to: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal Stage: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _oppstage XComboBox::OpportunityStages Lead Source: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _oppsource XComboBox::OpportunitySources Opp. Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _opptype XComboBox::OpportunityTypes true XComboBox::IncidentPriority XComboBox::First Priority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 1 0 Additional Contact Qt::Vertical 20 40 Dates Started: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Assigned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Target Close: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _targetDate Actual Close: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _actualDate Qt::Vertical 20 40 Notes true Characteristics 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 To-Do's New Edit View Delete Qt::Vertical 20 40 Sales 0 false Print false Convert Qt::Vertical QSizePolicy::Fixed 20 5 New false Edit false View false Delete Qt::Vertical 20 5 Attach Qt::Vertical 20 0 Comments Qt::StrongFocus Comments::Opportunity Documents Documents::Opportunity Comments QWidget

    comments.h
    ContactCluster QWidget
    contactcluster.h
    CRMAcctCluster QWidget
    crmacctcluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    Documents QWidget
    documents.h
    UsernameCluster QWidget
    usernamecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _name _active _crmacct _amount _probability _owner _assignedTo _oppstage _priority _oppsource _opptype _cntct _startDate _assignDate _targetDate _actualDate _tab _notes _charass _newCharacteristic _editCharacteristic _deleteCharacteristic _todoList _newTodoItem _editTodoItem _viewTodoItem _salesList _printSale _convertQuote _newSale _editSale _viewSale _deleteSale _attachSale _comments _deleteTodoItem _buttonBox _crmacct newId(int) _cntct setSearchAcct(int) 280 94 230 281 qt-client-4.1.0/guiclient/opportunityList.cpp000066400000000000000000000217111217451700100213530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunityList.h" #include "xdialog.h" #include #include #include #include #include #include "characteristic.h" #include "guiclient.h" #include "opportunity.h" #include "parameterwidget.h" #include "storedProcErrorLookup.h" opportunityList::opportunityList(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "opportunityList", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Opportunities")); setReportName("OpportunityList"); setMetaSQLOptions("opportunities", "detail"); setUseAltId(true); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); list()->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, false, "ophead_number" ); list()->addColumn(tr("Active"), _orderColumn, Qt::AlignLeft, false, "ophead_active" ); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "ophead_name" ); list()->addColumn(tr("CRM Acct."), _userColumn, Qt::AlignLeft, true, "crmacct_number" ); list()->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, true, "ophead_owner_username" ); list()->addColumn(tr("Assigned"), _userColumn, Qt::AlignLeft, false, "ophead_username" ); list()->addColumn(tr("Stage"), _orderColumn, Qt::AlignLeft, true, "opstage_name" ); list()->addColumn(tr("Priority"), _orderColumn, Qt::AlignLeft, true, "incdtpriority_name" ); list()->addColumn(tr("Source"), _orderColumn, Qt::AlignLeft, true, "opsource_name" ); list()->addColumn(tr("Type"), _orderColumn, Qt::AlignLeft, true, "optype_name" ); list()->addColumn(tr("Prob.%"), _prcntColumn, Qt::AlignCenter, true, "ophead_probability_prcnt" ); list()->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "ophead_amount" ); list()->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, false, "f_currency" ); list()->addColumn(tr("Target Date"), _dateColumn, Qt::AlignLeft, true, "ophead_target_date" ); list()->addColumn(tr("Actual Date"), _dateColumn, Qt::AlignLeft, false, "ophead_actual_date" ); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen())); if (!_privileges->check("MaintainAllOpportunities") && !_privileges->check("MaintainPersonalOpportunities")) newAction()->setEnabled(FALSE); parameterWidget()->append(tr("User"), "username", ParameterWidget::User, omfgThis->username()); parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User); parameterWidget()->append(tr("Assigned To"), "assigned_username", ParameterWidget::User); parameterWidget()->append(tr("Target Date on or After"), "startDate", ParameterWidget::Date); parameterWidget()->append(tr("Target Date on or Before"), "endDate", ParameterWidget::Date); parameterWidget()->append(tr("CRM Account"), "crmacct_id", ParameterWidget::Crmacct); parameterWidget()->appendComboBox(tr("Type"), "optype_id", XComboBox::OpportunityTypes); parameterWidget()->append(tr("Type Pattern"), "optype_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Source"), "opsource_id", XComboBox::OpportunitySources); parameterWidget()->append(tr("Source Pattern"), "opsource_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Stage"), "opstage_id", XComboBox::OpportunityStages); parameterWidget()->append(tr("Stage Pattern"), "opstage_pattern", ParameterWidget::Text); setupCharacteristics(characteristic::Opportunities); parameterWidget()->applyDefaultFilterSet(); } void opportunityList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("ophead_owner_username") && _privileges->check("MaintainPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("ophead_username") && _privileges->check("MaintainPersonalOpportunities")) || (_privileges->check("MaintainAllOpportunities")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("ophead_owner_username") && _privileges->check("ViewPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("ophead_username") && _privileges->check("ViewPersonalOpportunities")) || (_privileges->check("ViewAllOpportunities")); menuItem = pMenu->addAction(tr("New..."), this, SLOT(sNew())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(editPriv); pMenu->addSeparator(); if (list()->altId() == 0) { menuItem = pMenu->addAction(tr("Deactivate"), this, SLOT(sDeactivate())); menuItem->setEnabled(editPriv); } else { menuItem = pMenu->addAction(tr("Activate"), this, SLOT(sActivate())); menuItem->setEnabled(editPriv); } } enum SetResponse opportunityList::set(const ParameterList& pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("run", &valid); if (valid) sFillList(); return NoError; } void opportunityList::sNew() { ParameterList params; setParams(params); params.append("mode","new"); opportunity newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunityList::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("ophead_id", list()->id()); opportunity newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunityList::sView() { ParameterList params; params.append("mode", "view"); params.append("ophead_id", list()->id()); opportunity newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void opportunityList::sDelete() { XSqlQuery opportunityDelete; opportunityDelete.prepare("SELECT deleteOpportunity(:ophead_id) AS result;"); opportunityDelete.bindValue(":ophead_id", list()->id()); opportunityDelete.exec(); if (opportunityDelete.first()) { int result = opportunityDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteOpportunity", result)); return; } else sFillList(); } else if (opportunityDelete.lastError().type() != QSqlError::NoError) { systemError(this, opportunityDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void opportunityList::sDeactivate() { XSqlQuery opportunityDeactivate; opportunityDeactivate.prepare("UPDATE ophead SET ophead_active=false WHERE ophead_id=:ophead_id;"); opportunityDeactivate.bindValue(":ophead_id", list()->id()); opportunityDeactivate.exec(); if (opportunityDeactivate.lastError().type() != QSqlError::NoError) systemError(this, opportunityDeactivate.lastError().databaseText(), __FILE__, __LINE__); else sFillList(); } void opportunityList::sActivate() { XSqlQuery opportunityActivate; opportunityActivate.prepare("UPDATE ophead SET ophead_active=true WHERE ophead_id=:ophead_id;"); opportunityActivate.bindValue(":ophead_id", list()->id()); opportunityActivate.exec(); if (opportunityActivate.lastError().type() != QSqlError::NoError) systemError(this, opportunityActivate.lastError().databaseText(), __FILE__, __LINE__); else sFillList(); } bool opportunityList::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; if (!findChild("_showInactive")->isChecked()) params.append("activeOnly"); return true; } void opportunityList::sOpen() { bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("ophead_owner_username") && _privileges->check("MaintainPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("ophead_username") && _privileges->check("MaintainPersonalOpportunities")) || (_privileges->check("MaintainAllOpportunities")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("ophead_owner_username") && _privileges->check("ViewPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("ophead_username") && _privileges->check("ViewPersonalOpportunities")) || (_privileges->check("ViewAllOpportunities")); if (editPriv) sEdit(); else if (viewPriv) sView(); } qt-client-4.1.0/guiclient/opportunityList.h000066400000000000000000000022641217451700100210220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITYLIST_H #define OPPORTUNITYLIST_H #include "guiclient.h" #include "display.h" #include #include "ui_opportunityList.h" class opportunityList : public display, public Ui::opportunityList { Q_OBJECT public: opportunityList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); Q_INVOKABLE virtual bool setParams(ParameterList &); public slots: virtual SetResponse set(const ParameterList&); virtual void sDelete(); virtual void sEdit(); virtual void sNew(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sView(); virtual void sOpen(); virtual void sDeactivate(); virtual void sActivate(); }; #endif // OPPORTUNITYLIST_H qt-client-4.1.0/guiclient/opportunityList.ui000066400000000000000000000025111217451700100212030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunityList 0 0 133 37 Opportunity List Show Inactive XCheckBox QCheckBox
    xcheckbox.h
    _showInactive
    qt-client-4.1.0/guiclient/opportunitySource.cpp000066400000000000000000000113171217451700100217010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunitySource.h" #include #include /* * Constructs a opportunitySource as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ opportunitySource::opportunitySource(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } /* * Destroys the object and frees any allocated resources */ opportunitySource::~opportunitySource() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void opportunitySource::languageChange() { retranslateUi(this); } enum SetResponse opportunitySource::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("opsource_id", &valid); if (valid) { _opsourceid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _name->setFocus(); } else if (param.toString() == "edit") { _mode = cEdit; _name->setFocus(); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); _buttonBox->setFocus(); } } return NoError; } void opportunitySource::sCheck() { XSqlQuery opportunityCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length() != 0)) { opportunityCheck.prepare( "SELECT opsource_id " "FROM opsource " "WHERE (UPPER(opsource_name)=UPPER(:opsource_name));" ); opportunityCheck.bindValue(":opsource_name", _name->text()); opportunityCheck.exec(); if (opportunityCheck.first()) { _opsourceid = opportunityCheck.value("opsource_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void opportunitySource::sSave() { XSqlQuery opportunitySave; _name->setText(_name->text().trimmed().toUpper()); if (_name->text().length() == 0) { QMessageBox::information( this, tr("Invalid Name"), tr("You must enter a valid Name for this Opportunity Source.") ); _name->setFocus(); return; } if (_mode == cNew) { opportunitySave.exec("SELECT NEXTVAL('opsource_opsource_id_seq') AS opsource_id"); if (opportunitySave.first()) _opsourceid = opportunitySave.value("opsource_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } opportunitySave.prepare( "INSERT INTO opsource " "( opsource_id, opsource_name, opsource_descrip)" "VALUES " "( :opsource_id, :opsource_name, :opsource_descrip );" ); } else if (_mode == cEdit) opportunitySave.prepare( "UPDATE opsource " " SET opsource_name=:opsource_name," " opsource_descrip=:opsource_descrip " " WHERE(opsource_id=:opsource_id);" ); opportunitySave.bindValue(":opsource_id", _opsourceid); opportunitySave.bindValue(":opsource_name", _name->text()); opportunitySave.bindValue(":opsource_descrip", _description->text().trimmed()); opportunitySave.exec(); done(_opsourceid); } void opportunitySource::populate() { XSqlQuery opportunitypopulate; opportunitypopulate.prepare( "SELECT opsource_name, opsource_descrip " " FROM opsource " " WHERE(opsource_id=:opsource_id);" ); opportunitypopulate.bindValue(":opsource_id", _opsourceid); opportunitypopulate.exec(); if (opportunitypopulate.first()) { _name->setText(opportunitypopulate.value("opsource_name")); _description->setText(opportunitypopulate.value("opsource_descrip")); } } qt-client-4.1.0/guiclient/opportunitySource.h000066400000000000000000000021431217451700100213430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITYSOURCE_H #define OPPORTUNITYSOURCE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_opportunitySource.h" class opportunitySource : public XDialog, public Ui::opportunitySource { Q_OBJECT public: opportunitySource(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~opportunitySource(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _opsourceid; }; #endif // OPPORTUNITYSOURCE_H qt-client-4.1.0/guiclient/opportunitySource.ui000066400000000000000000000103451217451700100215340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunitySource 0 0 466 83 Opportunity Source 0 5 5 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 347 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _name _description
    qt-client-4.1.0/guiclient/opportunitySources.cpp000066400000000000000000000102631217451700100220630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunitySources.h" #include #include //#include #include #include #include "opportunitySource.h" #include "guiclient.h" /* * Constructs a opportunitySources as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ opportunitySources::opportunitySources(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); // statusBar()->hide(); _print->hide(); _oplist->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "opsource_name" ); _oplist->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "opsource_descrip" ); if (_privileges->check("MaintainOpportunitySources")) { connect(_oplist, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_oplist, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_oplist, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_oplist, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(); } /* * Destroys the object and frees any allocated resources */ opportunitySources::~opportunitySources() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void opportunitySources::languageChange() { retranslateUi(this); } void opportunitySources::sDelete() { XSqlQuery opportunityDelete; opportunityDelete.prepare( "SELECT ophead_id " "FROM ophead " "WHERE (ophead_opsource_id=:opsource_id);" ); opportunityDelete.bindValue(":opsource_id", _oplist->id()); opportunityDelete.exec(); if (opportunityDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Opportunity Source"), tr( "The selected Opportunity Source cannot be deleted as there are one or more Opportunities currently assigned to it.\n" "You must reassign these Opportunities before you may delete the selected Opportunity Source." ) ); return; } opportunityDelete.prepare( "DELETE FROM opsource " "WHERE (opsource_id=:opsource_id);" ); opportunityDelete.bindValue(":opsource_id", _oplist->id()); opportunityDelete.exec(); sFillList(); } void opportunitySources::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("opsource_id", _oplist->id()); opportunitySource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunitySources::sView() { ParameterList params; params.append("mode", "view"); params.append("opsource_id", _oplist->id()); opportunitySource newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void opportunitySources::sFillList() { _oplist->populate( "SELECT opsource_id, opsource_name, opsource_descrip " " FROM opsource " " ORDER BY opsource_name;" ); } void opportunitySources::sNew() { ParameterList params; params.append("mode", "new"); opportunitySource newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunitySources::sPrint() { orReport report("OpportunitySourceMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/opportunitySources.h000066400000000000000000000020251217451700100215250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITYSOURCES_H #define OPPORTUNITYSOURCES_H #include "xwidget.h" #include "ui_opportunitySources.h" class opportunitySources : public XWidget, public Ui::opportunitySources { Q_OBJECT public: opportunitySources(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~opportunitySources(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // OPPORTUNITYSOURCES_H qt-client-4.1.0/guiclient/opportunitySources.ui000066400000000000000000000110651217451700100217170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunitySources 0 0 600 400 List Opportunity Sources 0 Opportunity Sources: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _oplist _new _edit _view _delete _print _close _oplist valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() opportunitySources close() 20 20 20 20
    qt-client-4.1.0/guiclient/opportunityStage.cpp000066400000000000000000000116621217451700100215070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunityStage.h" #include #include /* * Constructs a opportunityStage as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ opportunityStage::opportunityStage(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } /* * Destroys the object and frees any allocated resources */ opportunityStage::~opportunityStage() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void opportunityStage::languageChange() { retranslateUi(this); } enum SetResponse opportunityStage::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("opstage_id", &valid); if (valid) { _opstageid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _name->setFocus(); } else if (param.toString() == "edit") { _mode = cEdit; _name->setFocus(); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _opInactive->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); _buttonBox->setFocus(); } } return NoError; } void opportunityStage::sCheck() { XSqlQuery opportunityCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length() != 0)) { opportunityCheck.prepare( "SELECT opstage_id " "FROM opstage " "WHERE (UPPER(opstage_name)=UPPER(:opstage_name));" ); opportunityCheck.bindValue(":opstage_name", _name->text()); opportunityCheck.exec(); if (opportunityCheck.first()) { _opstageid = opportunityCheck.value("opstage_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void opportunityStage::sSave() { XSqlQuery opportunitySave; _name->setText(_name->text().trimmed().toUpper()); if (_name->text().length() == 0) { QMessageBox::information( this, tr("Invalid Name"), tr("You must enter a valid Name for this Opportunity Stage.") ); _name->setFocus(); return; } if (_mode == cNew) { opportunitySave.exec("SELECT NEXTVAL('opstage_opstage_id_seq') AS opstage_id"); if (opportunitySave.first()) _opstageid = opportunitySave.value("opstage_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } opportunitySave.prepare( "INSERT INTO opstage " "( opstage_id, opstage_name, opstage_descrip, opstage_opinactive)" "VALUES " "( :opstage_id, :opstage_name, :opstage_descrip, :opstage_opinactive );" ); } else if (_mode == cEdit) opportunitySave.prepare( "UPDATE opstage " " SET opstage_name=:opstage_name," " opstage_descrip=:opstage_descrip," " opstage_opinactive=:opstage_opinactive " " WHERE(opstage_id=:opstage_id);" ); opportunitySave.bindValue(":opstage_id", _opstageid); opportunitySave.bindValue(":opstage_name", _name->text()); opportunitySave.bindValue(":opstage_descrip", _description->text().trimmed()); opportunitySave.bindValue(":opstage_opinactive", QVariant(_opInactive->isChecked())); opportunitySave.exec(); done(_opstageid); } void opportunityStage::populate() { XSqlQuery opportunitypopulate; opportunitypopulate.prepare( "SELECT * " " FROM opstage " " WHERE(opstage_id=:opstage_id);" ); opportunitypopulate.bindValue(":opstage_id", _opstageid); opportunitypopulate.exec(); if (opportunitypopulate.first()) { _name->setText(opportunitypopulate.value("opstage_name")); _description->setText(opportunitypopulate.value("opstage_descrip")); _opInactive->setChecked(opportunitypopulate.value("opstage_opinactive").toBool()); } } qt-client-4.1.0/guiclient/opportunityStage.h000066400000000000000000000021321217451700100211440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITYSTAGE_H #define OPPORTUNITYSTAGE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_opportunityStage.h" class opportunityStage : public XDialog, public Ui::opportunityStage { Q_OBJECT public: opportunityStage(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~opportunityStage(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _opstageid; }; #endif // OPPORTUNITYSTAGE_H qt-client-4.1.0/guiclient/opportunityStage.ui000066400000000000000000000112041217451700100213320ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunityStage 0 0 472 114 Opportunity Stage 5 5 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Mark Opportunity Inactive at this Stage true Qt::Vertical QSizePolicy::Expanding 40 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save qPixmapFromMimeStage XCheckBox QCheckBox
    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _name _description
    qt-client-4.1.0/guiclient/opportunityStages.cpp000066400000000000000000000102151217451700100216630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunityStages.h" #include #include //#include #include #include #include "opportunityStage.h" #include "guiclient.h" /* * Constructs a opportunityStages as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ opportunityStages::opportunityStages(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); // statusBar()->hide(); _print->hide(); _oplist->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "opstage_name" ); _oplist->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "opstage_descrip" ); if (_privileges->check("MaintainOpportunityStages")) { connect(_oplist, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_oplist, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_oplist, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_oplist, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(); } /* * Destroys the object and frees any allocated resources */ opportunityStages::~opportunityStages() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void opportunityStages::languageChange() { retranslateUi(this); } void opportunityStages::sDelete() { XSqlQuery opportunityDelete; opportunityDelete.prepare( "SELECT ophead_id " "FROM ophead " "WHERE (ophead_opstage_id=:opstage_id);" ); opportunityDelete.bindValue(":opstage_id", _oplist->id()); opportunityDelete.exec(); if (opportunityDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Opportunity Stage"), tr( "The selected Opportunity Stage cannot be deleted as there are one or more Opportunities currently assigned to it.\n" "You must reassign these Opportunities before you may delete the selected Opportunity Stage." ) ); return; } opportunityDelete.prepare( "DELETE FROM opstage " "WHERE (opstage_id=:opstage_id);" ); opportunityDelete.bindValue(":opstage_id", _oplist->id()); opportunityDelete.exec(); sFillList(); } void opportunityStages::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("opstage_id", _oplist->id()); opportunityStage newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunityStages::sView() { ParameterList params; params.append("mode", "view"); params.append("opstage_id", _oplist->id()); opportunityStage newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void opportunityStages::sFillList() { _oplist->populate( "SELECT opstage_id, opstage_name, opstage_descrip " " FROM opstage " " ORDER BY opstage_name;" ); } void opportunityStages::sNew() { ParameterList params; params.append("mode", "new"); opportunityStage newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunityStages::sPrint() { orReport report("OpportunityStageMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/opportunityStages.h000066400000000000000000000020151217451700100213270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITYSTAGES_H #define OPPORTUNITYSTAGES_H #include "xwidget.h" #include "ui_opportunityStages.h" class opportunityStages : public XWidget, public Ui::opportunityStages { Q_OBJECT public: opportunityStages(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~opportunityStages(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // OPPORTUNITYSTAGES_H qt-client-4.1.0/guiclient/opportunityStages.ui000066400000000000000000000110601217451700100215150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunityStages 0 0 600 400 List Opportunity Stages 0 Opportunity Stages: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _oplist _new _edit _view _delete _print _close _oplist valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() opportunityStages close() 20 20 20 20
    qt-client-4.1.0/guiclient/opportunityType.cpp000066400000000000000000000111431217451700100213570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunityType.h" #include #include /* * Constructs a opportunityType as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ opportunityType::opportunityType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } /* * Destroys the object and frees any allocated resources */ opportunityType::~opportunityType() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void opportunityType::languageChange() { retranslateUi(this); } enum SetResponse opportunityType::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("optype_id", &valid); if (valid) { _optypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _name->setFocus(); } else if (param.toString() == "edit") { _mode = cEdit; _name->setFocus(); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); _buttonBox->setFocus(); } } return NoError; } void opportunityType::sCheck() { XSqlQuery opportunityCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length() != 0)) { opportunityCheck.prepare( "SELECT optype_id " "FROM optype " "WHERE (UPPER(optype_name)=UPPER(:optype_name));" ); opportunityCheck.bindValue(":optype_name", _name->text()); opportunityCheck.exec(); if (opportunityCheck.first()) { _optypeid = opportunityCheck.value("optype_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void opportunityType::sSave() { XSqlQuery opportunitySave; _name->setText(_name->text().trimmed().toUpper()); if (_name->text().length() == 0) { QMessageBox::information( this, tr("Invalid Name"), tr("You must enter a valid Name for this Opportunity Type.") ); _name->setFocus(); return; } if (_mode == cNew) { opportunitySave.exec("SELECT NEXTVAL('optype_optype_id_seq') AS optype_id"); if (opportunitySave.first()) _optypeid = opportunitySave.value("optype_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } opportunitySave.prepare( "INSERT INTO optype " "( optype_id, optype_name, optype_descrip)" "VALUES " "( :optype_id, :optype_name, :optype_descrip );" ); } else if (_mode == cEdit) opportunitySave.prepare( "UPDATE optype " " SET optype_name=:optype_name," " optype_descrip=:optype_descrip " " WHERE(optype_id=:optype_id);" ); opportunitySave.bindValue(":optype_id", _optypeid); opportunitySave.bindValue(":optype_name", _name->text()); opportunitySave.bindValue(":optype_descrip", _description->text().trimmed()); opportunitySave.exec(); done(_optypeid); } void opportunityType::populate() { XSqlQuery opportunitypopulate; opportunitypopulate.prepare( "SELECT optype_name, optype_descrip " " FROM optype " " WHERE(optype_id=:optype_id);" ); opportunitypopulate.bindValue(":optype_id", _optypeid); opportunitypopulate.exec(); if (opportunitypopulate.first()) { _name->setText(opportunitypopulate.value("optype_name")); _description->setText(opportunitypopulate.value("optype_descrip")); } } qt-client-4.1.0/guiclient/opportunityType.h000066400000000000000000000021211217451700100210200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITYTYPE_H #define OPPORTUNITYTYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_opportunityType.h" class opportunityType : public XDialog, public Ui::opportunityType { Q_OBJECT public: opportunityType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~opportunityType(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _optypeid; }; #endif // OPPORTUNITYTYPE_H qt-client-4.1.0/guiclient/opportunityType.ui000066400000000000000000000103371217451700100212160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunityType 0 0 466 83 Opportunity Type 0 5 5 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 347 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _name _description
    qt-client-4.1.0/guiclient/opportunityTypes.cpp000066400000000000000000000101471217451700100215450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunityTypes.h" #include #include //#include #include #include #include "opportunityType.h" #include "guiclient.h" /* * Constructs a opportunityTypes as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ opportunityTypes::opportunityTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); // statusBar()->hide(); _print->hide(); _oplist->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "optype_name" ); _oplist->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "optype_descrip" ); if (_privileges->check("MaintainOpportunityTypes")) { connect(_oplist, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_oplist, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_oplist, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_oplist, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(); } /* * Destroys the object and frees any allocated resources */ opportunityTypes::~opportunityTypes() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void opportunityTypes::languageChange() { retranslateUi(this); } void opportunityTypes::sDelete() { XSqlQuery opportunityDelete; opportunityDelete.prepare( "SELECT ophead_id " "FROM ophead " "WHERE (ophead_optype_id=:optype_id);" ); opportunityDelete.bindValue(":optype_id", _oplist->id()); opportunityDelete.exec(); if (opportunityDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Opportunity Type"), tr( "The selected Opportunity Type cannot be deleted as there are one or more Opportunities currently assigned to it.\n" "You must reassign these Opportunities before you may delete the selected Opportunity Type." ) ); return; } opportunityDelete.prepare( "DELETE FROM optype " "WHERE (optype_id=:optype_id);" ); opportunityDelete.bindValue(":optype_id", _oplist->id()); opportunityDelete.exec(); sFillList(); } void opportunityTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("optype_id", _oplist->id()); opportunityType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunityTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("optype_id", _oplist->id()); opportunityType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void opportunityTypes::sFillList() { _oplist->populate( "SELECT optype_id, optype_name, optype_descrip " " FROM optype " " ORDER BY optype_name;" ); } void opportunityTypes::sNew() { ParameterList params; params.append("mode", "new"); opportunityType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void opportunityTypes::sPrint() { orReport report("OpportunityTypeMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/opportunityTypes.h000066400000000000000000000020051217451700100212040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef OPPORTUNITYTYPES_H #define OPPORTUNITYTYPES_H #include "xwidget.h" #include "ui_opportunityTypes.h" class opportunityTypes : public XWidget, public Ui::opportunityTypes { Q_OBJECT public: opportunityTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~opportunityTypes(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // OPPORTUNITYTYPES_H qt-client-4.1.0/guiclient/opportunityTypes.ui000066400000000000000000000110531217451700100213750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. opportunityTypes 0 0 600 400 List Opportunity Types 0 Opportunity Types: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _oplist _new _edit _view _delete _print _close _oplist valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() opportunityTypes close() 20 20 20 20
    qt-client-4.1.0/guiclient/package.cpp000066400000000000000000000270371217451700100175050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "package.h" #include #include #include #include #include "mqlutil.h" #include "storedProcErrorLookup.h" #define DEBUG false // TODO: XDialog should have a default implementation that returns FALSE bool package::userHasPriv(const int pMode) { bool retval = false; bool canmaintain = false; if (pMode == cNew || pMode == cEdit) { XSqlQuery su; su.exec("SELECT isDBA() as rolsuper;"); if (su.first()) canmaintain = su.value("rolsuper").toBool(); else if (su.lastError().type() != QSqlError::NoError) { systemError(0, su.lastError().databaseText(), __FILE__, __LINE__); return false; } } switch (pMode) { case cView: retval = _privileges->check("ViewPackages") || canmaintain; break; case cNew: case cEdit: retval = canmaintain; break; default: retval = false; break; } return retval; } // TODO: this code really belongs in XDialog void package::setVisible(bool visible) { if (! visible) XDialog::setVisible(false); else if (! userHasPriv(_mode)) { systemError(this, tr("You do not have sufficient privilege to view this window"), __FILE__, __LINE__); reject(); } else XDialog::setVisible(true); } package::package(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _rec->addColumn(tr("Type"), -1, Qt::AlignLeft, true, "pkgitem_type"); _rec->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "pkgitem_name"); _rec->addColumn(tr("Description"),-1, Qt::AlignLeft, true, "pkgitem_descrip"); _req->addColumn(tr("Package"), -1, Qt::AlignLeft, true, "pkghead_name"); _req->addColumn(tr("Description"),-1, Qt::AlignLeft, true, "pkghead_descrip"); _req->addColumn(tr("Version"), -1, Qt::AlignRight,true, "pkghead_version"); _dep->addColumn(tr("Package"), -1, Qt::AlignLeft, true, "pkghead_name"); _dep->addColumn(tr("Description"),-1, Qt::AlignLeft, true, "pkghead_descrip"); _dep->addColumn(tr("Version"), -1, Qt::AlignRight,true, "pkghead_version"); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_showSystemDetails, SIGNAL(toggled(bool)), this, SLOT(populate())); _mode = cNew; _pkgheadid = -1; _priorEnabledState = false; } package::~package() { // no need to delete child widgets, Qt does it all for us } void package::languageChange() { retranslateUi(this); } enum SetResponse package::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("pkghead_id", &valid); if (valid) { _pkgheadid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; _name->setEnabled(false); _version->setEnabled(false); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(false); _version->setEnabled(false); _description->setEnabled(false); _developer->setEnabled(false); _notes->setEnabled(false); _enabled->setEnabled(false); _indev->setEnabled(false); _save->hide(); _close->setText(tr("&Close")); } } return NoError; } void package::sCheck() { XSqlQuery packageCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { packageCheck.prepare( "SELECT pkghead_id " "FROM pkghead " "WHERE (UPPER(pkghead_name)=UPPER(:pkghead_name));" ); packageCheck.bindValue(":pkghead_code", _name->text()); packageCheck.exec(); if (packageCheck.first()) { _pkgheadid = packageCheck.value("pkghead_id").toInt(); _mode = cEdit; populate(); } } } void package::sSave() { XSqlQuery packageSave; if (_mode == cNew) { packageSave.exec("SELECT NEXTVAL('pkghead_pkghead_id_seq') AS _pkghead_id"); if (packageSave.first()) _pkgheadid = packageSave.value("_pkghead_id").toInt(); else if (packageSave.lastError().type() != QSqlError::NoError) { systemError(this, packageSave.lastError().databaseText(), __FILE__, __LINE__); return; } packageSave.prepare( "INSERT INTO pkghead (" " pkghead_id, pkghead_name, pkghead_descrip," " pkghead_version, pkghead_developer, pkghead_notes," " pkghead_indev" ") VALUES (" " :pkghead_id, :pkghead_name, :pkghead_descrip, " " :pkghead_version, :pkghead_developer, :pkghead_notes," " :pkghead_indev);"); } else if (_mode == cEdit) { packageSave.prepare( "SELECT pkghead_id " "FROM pkghead " "WHERE ( (UPPER(pkghead_name)=UPPER(:pkghead_name))" " AND (pkghead_id<>:pkghead_id) );" ); packageSave.bindValue(":pkghead_id", _pkgheadid); packageSave.bindValue(":pkghead_name", _name->text()); packageSave.exec(); if (packageSave.first()) { QMessageBox::warning( this, tr("Cannot Save Package"), tr("

    You may not rename this Package to %1 as " "this value is used by a different Package.") ); return; } packageSave.prepare( "UPDATE pkghead " "SET pkghead_name=:pkghead_name," " pkghead_descrip=:pkghead_descrip," " pkghead_version=:pkghead_version," " pkghead_developer=:pkghead_developer," " pkghead_notes=:pkghead_notes," " pkghead_indev=:pkghead_indev " "WHERE (pkghead_id=:pkghead_id);" ); } packageSave.bindValue(":pkghead_id", _pkgheadid); packageSave.bindValue(":pkghead_name", _name->text()); packageSave.bindValue(":pkghead_descrip", _description->text()); packageSave.bindValue(":pkghead_version", _version->text()); packageSave.bindValue(":pkghead_developer",_developer->text()); packageSave.bindValue(":pkghead_notes", _notes->toPlainText()); packageSave.bindValue(":pkghead_indev", _indev->isChecked()); packageSave.exec(); if (packageSave.lastError().type() != QSqlError::NoError) { systemError(this, packageSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (DEBUG) qDebug("_enabled->isChecked: %d\tprior state: %d", _enabled->isChecked(), _priorEnabledState); if (_enabled->isChecked() != _priorEnabledState) { XSqlQuery eq; QString funcname; if (_enabled->isChecked()) { eq.prepare("SELECT enablePackage(:id) AS result;"); funcname = "enablePackage"; } else { eq.prepare("SELECT disablePackage(:id) AS result;"); funcname = "disablePackage"; } eq.bindValue(":id", _pkgheadid); eq.exec(); if (eq.first()) { int result = eq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup(funcname, result), __FILE__, __LINE__); return; } } else if (eq.lastError().type() != QSqlError::NoError) { systemError(this, eq.lastError().databaseText(), __FILE__, __LINE__); return; } } done(_pkgheadid); } void package::populate() { XSqlQuery packagepopulate; if (DEBUG) qDebug("package::populate() entered"); packagepopulate.prepare("SELECT *, packageIsEnabled(pkghead_name) AS enabled " "FROM pkghead WHERE (pkghead_id=:pkghead_id);"); packagepopulate.bindValue(":pkghead_id", _pkgheadid); packagepopulate.exec(); if (packagepopulate.first()) { if (DEBUG) qDebug("package::populate() select pkghead succeeded"); _name->setText(packagepopulate.value("pkghead_name").toString()); _description->setText(packagepopulate.value("pkghead_descrip").toString()); if (DEBUG) qDebug("package::populate() select pkghead half done"); _version->setText(packagepopulate.value("pkghead_version").toString()); _developer->setText(packagepopulate.value("pkghead_developer").toString()); _notes->setText(packagepopulate.value("pkghead_notes").toString()); _enabled->setChecked(packagepopulate.value("enabled").toBool()); _priorEnabledState = _enabled->isChecked(); _indev->setChecked(packagepopulate.value("pkghead_indev").toBool()); if (DEBUG) qDebug("package::populate() select pkghead complete"); } else if (packagepopulate.lastError().type() != QSqlError::NoError) { systemError(this, packagepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } ParameterList params; params.append("pkgname", _name->text()); params.append("script", tr("Script")); params.append("cmd", tr("Custom Command")); params.append("function",tr("Stored Procedure")); params.append("trigger", tr("Trigger")); params.append("image", tr("Image")); params.append("metasql", tr("MetaSQL")); params.append("priv", tr("Privilege")); params.append("report", tr("Report")); params.append("schema", tr("Schema")); params.append("table", tr("Table")); params.append("uiform", tr("Screen")); params.append("view", tr("View")); params.append("sequence",tr("Sequence")); params.append("index", tr("Index")); if (_showSystemDetails->isChecked()) params.append("showsystemdetails"); MetaSQLQuery itemmql = mqlLoad("package", "items"); packagepopulate = itemmql.toQuery(params); packagepopulate.exec(); if (DEBUG) qDebug("package::populate() select pkgitem exec'ed"); _rec->populate(packagepopulate); if (DEBUG) qDebug("package::populate() populate pkgitem done"); if (packagepopulate.lastError().type() != QSqlError::NoError) { systemError(this, packagepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } // TODO: make this recursive? packagepopulate.prepare("SELECT * " "FROM pkgdep, pkghead " "WHERE ((pkgdep_pkghead_id=pkghead_id)" " AND (pkgdep_parent_pkghead_id=:pkghead_id));"); packagepopulate.bindValue(":pkghead_id", _pkgheadid); packagepopulate.exec(); if (DEBUG) qDebug("package::populate() select pkgdep exec'ed"); _dep->populate(packagepopulate); if (DEBUG) qDebug("package::populate() populate pkgdep done"); if (packagepopulate.lastError().type() != QSqlError::NoError) { systemError(this, packagepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } // TODO: make this recursive? packagepopulate.prepare("SELECT * " "FROM pkgdep, pkghead " "WHERE ((pkgdep_parent_pkghead_id=pkghead_id)" " AND (pkgdep_pkghead_id=:pkghead_id));"); packagepopulate.bindValue(":pkghead_id", _pkgheadid); packagepopulate.exec(); if (DEBUG) qDebug("package::populate() select pkgdep exec'ed"); _req->populate(packagepopulate); if (DEBUG) qDebug("package::populate() populate pkgdep done"); if (packagepopulate.lastError().type() != QSqlError::NoError) { systemError(this, packagepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/package.h000066400000000000000000000022061217451700100171410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PACKAGE_H #define PACKAGE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_package.h" class package : public XDialog, public Ui::package { Q_OBJECT public: package(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~package(); static bool userHasPriv(const int = cView); virtual void setVisible(bool); public slots: virtual enum SetResponse set(const ParameterList &pParams); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _pkgheadid; bool _priorEnabledState; }; #endif // PACKAGE_H qt-client-4.1.0/guiclient/package.ui000066400000000000000000000177111217451700100173360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. package 0 0 600 400 Package Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 0 Version: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 70 16777215 Qt::Horizontal 40 20 &Cancel Save Qt::Vertical 20 40 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Developer: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 0 0 Notes Contents Qt::Horizontal 40 20 Show System Details Requirements This package requires the following packages: Dependencies The following packages depend on this package: Enabled Modifications Allowed XCheckBox QCheckBox

    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    XTextEdit QTextEdit
    xtextedit.h
    _name _version _description _developer _enabled _indev _tab _notes _rec _req _dep _close _save _close clicked() package reject() 548 29 501 9 qt-client-4.1.0/guiclient/packages.cpp000066400000000000000000000243201217451700100176600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "packages.h" #include #include #include #include #include #include #include #include "package.h" #include "storedProcErrorLookup.h" packages::packages(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_disable, SIGNAL(clicked()), this, SLOT(sDisable())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_enable, SIGNAL(clicked()), this, SLOT(sEnable())); connect(_load, SIGNAL(clicked()), this, SLOT(sLoad())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_package, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _package->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "pkghead_name"); _package->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "pkghead_descrip"); _package->addColumn(tr("Version"), _itemColumn, Qt::AlignRight,true, "pkghead_version"); _package->addColumn(tr("Enabled"), _ynColumn, Qt::AlignCenter,true, "enabled"); _load->setEnabled(package::userHasPriv(cNew)); // It would be nice if we could create (8225) and export (8224) packages //_new->setEnabled(package::userHasPriv(cNew)); _new->setVisible(false); _edit->setEnabled(package::userHasPriv(cEdit)); if (package::userHasPriv(cEdit)) { disconnect(_package, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); connect(_package, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_package,SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else connect(_package, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); if (package::userHasPriv(cNew)) { connect(_package, SIGNAL(valid(bool)), this, SLOT(sHandleButtons(bool))); } sHandleAutoUpdate(_autoUpdate->isChecked()); } packages::~packages() { // no need to delete child widgets, Qt does it all for us } void packages::languageChange() { retranslateUi(this); } void packages::sFillList() { XSqlQuery packagesFillList; packagesFillList.prepare( "SELECT *, packageIsEnabled(pkghead_name) AS enabled " "FROM pkghead " "ORDER BY pkghead_name, pkghead_version DESC;" ); packagesFillList.exec(); _package->populate(packagesFillList); if (packagesFillList.lastError().type() != QSqlError::NoError) { systemError(this, packagesFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void packages::sDelete() { XSqlQuery packagesDelete; if (QMessageBox::question(this, tr("Delete Package?"), tr("

    Are you sure you want to delete the package " "%1?
    If you answer 'Yes' then you should " "have backed up your database first.") .arg(_package->currentItem()->text(0)), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; packagesDelete.prepare( "SELECT deletePackage(:pkghead_id) AS result;" ); packagesDelete.bindValue(":pkghead_id", _package->id()); packagesDelete.exec(); if (packagesDelete.first()) { int result = packagesDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deletePackage", result), __FILE__, __LINE__); return; } } else if (packagesDelete.lastError().type() != QSqlError::NoError) { systemError(this, packagesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } // TODO: implement the updater as a Qt application plugin and call it directly // for now, launch it as an external program but try to preset the db connection info #include #include #include #include #include void packages::sLoad() { QProcess proc(this); #ifdef Q_WS_MACX QString proc_path = QDir::cleanPath(qApp->applicationDirPath() + "/../../../updater.app/Contents/MacOS/updater"); QString proc_path2= QDir::cleanPath(qApp->applicationDirPath() + "/../../../../Updater/updater.app/Contents/MacOS/updater"); #elif defined Q_WS_WIN QString proc_path = QDir::cleanPath(qApp->applicationDirPath() + "/updater.exe"); QString proc_path2= QDir::cleanPath(qApp->applicationDirPath() + "/../Updater/updater.exe"); #else QString proc_path = QDir::cleanPath(qApp->applicationDirPath() + "/updater"); QString proc_path2= QDir::cleanPath(qApp->applicationDirPath() + "/../Updater/updater"); #endif if (! QFile::exists(proc_path)) proc_path = proc_path2; if (! QFile::exists(proc_path)) { #ifdef Q_WS_MACX if (QMessageBox::question(this, tr("Could Not Find Updater"), tr("

    xTuple ERP could not find the Updater " "application. Would you like to look for it?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::No) return; #endif proc_path = QFileDialog::getOpenFileName(this, tr("Find Updater Application")); if (proc_path.isEmpty()) return; #ifdef Q_WS_MACX proc_path += "/Contents/MacOS/updater"; #endif } QStringList proc_args; QSqlDatabase db = QSqlDatabase::database(); QString dbURL; buildDatabaseURL(dbURL, "QPSQL", db.hostName(), db.databaseName(), QString::number(db.port())); proc_args << "-databaseURL=" + dbURL; if (! db.userName().isEmpty()) proc_args << "-username=" + db.userName(); if (! db.password().isEmpty()) proc_args << "-passwd=" + db.password(); QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); proc.start(proc_path, proc_args); if (proc.waitForStarted() && proc.waitForFinished(-1) && proc.exitStatus() == QProcess::NormalExit && proc.exitCode() == 0) { QApplication::restoreOverrideCursor(); sFillList(); } else { if (! db.password().isEmpty()) { proc_args.removeLast(); proc_args << "-passwd=XXXXX"; } QApplication::restoreOverrideCursor(); systemError(this, tr("

    There was an error running the Updater program: " "
    %1 %2

    %3
    ") .arg(proc_path) .arg(proc_args.join(" ")) .arg(QString(proc.readAllStandardError()))); return; } sFillList(); } void packages::sNew() { ParameterList params; params.append("mode", "new"); package newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void packages::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("pkghead_id", _package->id()); package newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void packages::sView() { ParameterList params; params.append("mode", "view"); params.append("pkghead_id", _package->id()); package newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void packages::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(package::userHasPriv(cView)); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(package::userHasPriv(cNew)); menuItem = pMenu->addAction(tr("Enable"), this, SLOT(sEnable())); menuItem->setEnabled(package::userHasPriv(cNew)); menuItem = pMenu->addAction(tr("Disable"), this, SLOT(sDisable())); menuItem->setEnabled(package::userHasPriv(cNew)); } void packages::sPrint() { orReport report("PackageMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void packages::sHandleAutoUpdate(const bool pAutoUpdate) { if (pAutoUpdate) connect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); else disconnect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); sFillList(); } void packages::sEnable() { XSqlQuery eq; eq.prepare("SELECT enablePackage(:id) AS result;"); eq.bindValue(":id", _package->id()); eq.exec(); if (eq.first()) { int result = eq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("enablePackage", result) .arg(_package->id()), __FILE__, __LINE__); return; } } else if (eq.lastError().type() != QSqlError::NoError) { systemError(this, eq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void packages::sDisable() { XSqlQuery dq; dq.prepare("SELECT disablePackage(:id) AS result;"); dq.bindValue(":id", _package->id()); dq.exec(); if (dq.first()) { int result = dq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("disablePackage", result) .arg(_package->id()), __FILE__, __LINE__); return; } } else if (dq.lastError().type() != QSqlError::NoError) { systemError(this, dq.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void packages::sHandleButtons(const bool pvalid) { _delete->setEnabled(pvalid); _disable->setEnabled(pvalid && _package->currentItem()->rawValue("enabled").toBool()); _enable->setEnabled(pvalid && ! _package->currentItem()->rawValue("enabled").toBool()); } qt-client-4.1.0/guiclient/packages.h000066400000000000000000000023161217451700100173260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PACKAGES_H #define PACKAGES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_packages.h" class packages : public XWidget, public Ui::packages { Q_OBJECT public: packages(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~packages(); public slots: virtual void sDelete(); virtual void sDisable(); virtual void sEdit(); virtual void sEnable(); virtual void sFillList(); virtual void sHandleAutoUpdate(const bool); virtual void sHandleButtons(const bool); virtual void sLoad(); virtual void sNew(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); virtual void sView(); protected slots: virtual void languageChange(); }; #endif // PACKAGES_H qt-client-4.1.0/guiclient/packages.ui000066400000000000000000000170351217451700100175200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. packages 0 0 424 407 List Packages 0 0 Packages: 0 0 5 5 Qt::Horizontal 40 20 Automatically Update &Close Qt::Vertical QSizePolicy::Fixed 20 10 Print false Load false &New false Edit false &View Qt::Vertical QSizePolicy::Fixed 20 10 false Enable false Disable Qt::Vertical QSizePolicy::Fixed 20 10 false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _package _load _new _edit _view _delete _print _close _package itemSelected(int) _view animateClick() 26 44 370 86 _package valid(bool) _view setEnabled(bool) 26 44 370 86 _close clicked() packages close() 369 26 20 20
    qt-client-4.1.0/guiclient/packingListBatch.cpp000066400000000000000000000317511217451700100213220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "packingListBatch.h" #include #include #include #include #include #include #include #include "mqlutil.h" #include "printPackingList.h" #include "salesOrder.h" #include "salesOrderList.h" #include "storedProcErrorLookup.h" #include "transferOrder.h" #include "transferOrderList.h" packingListBatch::packingListBatch(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_add, SIGNAL(clicked()), this, SLOT(sAddSO())); connect(_addTO, SIGNAL(clicked()), this, SLOT(sAddTO())); connect(_autoUpdate, SIGNAL(toggled(bool)), this, SLOT(sHandleAutoUpdate(bool))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deletePrinted, SIGNAL(clicked()), this, SLOT(sClearPrinted())); connect(_pack, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_printBatch, SIGNAL(clicked()), this, SLOT(sPrintBatch())); connect(_printEditList, SIGNAL(clicked()), this, SLOT(sPrintEditList())); connect(_printPackingList, SIGNAL(clicked()), this, SLOT(sPrintPackingList())); setAcceptDrops(TRUE); _pack->addColumn(tr("Order #"), 80, Qt::AlignCenter, true, "order_number" ); _pack->addColumn(tr("Type"), 40, Qt::AlignCenter, true, "pack_head_type" ); _pack->addColumn(tr("Shipment #"), 80, Qt::AlignCenter, true, "shipment_number" ); _pack->addColumn(tr("Customer #"), _itemColumn, Qt::AlignLeft, true, "number" ); _pack->addColumn(tr("Customer Name"), -1, Qt::AlignLeft, true, "name" ); _pack->addColumn(tr("Ship Via"), 80, Qt::AlignLeft, true, "shipvia"); _pack->addColumn(tr("Hold Type"), _dateColumn, Qt::AlignCenter, true, "f_holdtype" ); _pack->addColumn(tr("Printed"), _dateColumn, Qt::AlignCenter, true, "pack_printed" ); if (_privileges->check("MaintainPackingListBatch")) { _add->setEnabled(TRUE); _addTO->setEnabled(TRUE); _deletePrinted->setEnabled(TRUE); connect(_pack, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); } if (_privileges->check("PrintPackingLists")) { _printBatch->setEnabled(TRUE); connect(_pack, SIGNAL(valid(bool)), _printPackingList, SLOT(setEnabled(bool))); } _addTO->setVisible(_metrics->boolean("MultiWhs")); sFillList(); sHandleAutoUpdate(_autoUpdate->isChecked()); } packingListBatch::~packingListBatch() { // no need to delete child widgets, Qt does it all for us } void packingListBatch::languageChange() { retranslateUi(this); } void packingListBatch::sPrintBatch() { XSqlQuery packingPrintBatch; XSqlQuery updateq; updateq.prepare("UPDATE pack " "SET pack_printed=TRUE " "WHERE (pack_id=:packid);" ); ParameterList params; if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); MetaSQLQuery mql = mqlLoad("packingListBatch", "print"); packingPrintBatch = mql.toQuery(params); if (packingPrintBatch.lastError().type() != QSqlError::NoError) { systemError(this, packingPrintBatch.lastError().databaseText(), __FILE__, __LINE__); return; } QPrinter printer(QPrinter::HighResolution); bool setupPrinter = TRUE; bool userCanceled = false; if (orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return; } while (packingPrintBatch.next()) { int osmiscid = packingPrintBatch.value("pack_shiphead_id").toInt(); bool usePickForm; if (_printPick->isChecked()) usePickForm = true; else if (_printPack->isChecked()) usePickForm = false; else if (osmiscid > 0) usePickForm = false; else usePickForm = true; // skip when PackForm and no shiphead_id if (!usePickForm && osmiscid <= 0) continue; // set sohead_id, tohead_id, and shiphead_id for customer and 3rd-party use ParameterList params; params.append("head_id", packingPrintBatch.value("pack_head_id").toInt()); params.append("head_type", packingPrintBatch.value("pack_head_type").toString()); if (packingPrintBatch.value("pack_head_type").toString() == "SO") params.append("sohead_id", packingPrintBatch.value("pack_head_id").toInt()); else if (packingPrintBatch.value("pack_head_type").toString() == "TO") params.append("tohead_id", packingPrintBatch.value("pack_head_id").toInt()); if (osmiscid > 0) { params.append("shiphead_id", osmiscid); } if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); orReport report(packingPrintBatch.value(usePickForm ? "pickform" : "packform").toString(), params); if (! report.isValid()) { report.reportError(this); } else if (report.print(&printer, setupPrinter)) { setupPrinter = FALSE; updateq.bindValue(":packid", packingPrintBatch.value("pack_id").toInt()); updateq.exec(); if (updateq.lastError().type() != QSqlError::NoError) { systemError(this, updateq.lastError().databaseText(), __FILE__, __LINE__); orReport::endMultiPrint(&printer); return; } emit finishedPrinting(packingPrintBatch.value("pack_head_id").toInt(), packingPrintBatch.value("pack_head_type").toString(), packingPrintBatch.value("pack_shiphead_id").toInt()); } else { report.reportError(this); orReport::endMultiPrint(&printer); return; } } orReport::endMultiPrint(&printer); if (setupPrinter) { QMessageBox::warning(this, tr("Nothing to Print"), tr("

    All of the Packing Lists appear to have been " "printed already.")); } else { sFillList(); } } void packingListBatch::setParams(ParameterList & params) { if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); params.append("none", tr("None")); params.append("credit", tr("Credit")); params.append("ship", tr("Ship")); params.append("pack", tr("Pack")); params.append("return", tr("Return")); params.append("other", tr("Other")); } void packingListBatch::sPrintEditList() { ParameterList params; setParams(params); orReport report("PackingListBatchEditList", params); if (report.isValid()) report.print(); else report.reportError(this); } void packingListBatch::sClearPrinted() { XSqlQuery packingClearPrinted; packingClearPrinted.exec( "DELETE FROM pack " "WHERE ( (pack_printed)" " AND (pack_head_type='SO')" " AND (checkSOSitePrivs(pack_head_id)) );" ); if (packingClearPrinted.lastError().type() != QSqlError::NoError) { systemError(this, packingClearPrinted.lastError().databaseText(), __FILE__, __LINE__); return; } packingClearPrinted.exec( "DELETE FROM pack " "WHERE ( (pack_printed)" " AND (pack_head_type='TO') );" ); if (packingClearPrinted.lastError().type() != QSqlError::NoError) { systemError(this, packingClearPrinted.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void packingListBatch::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewSalesOrder())); menuItem->setEnabled(_pack->currentItem()->rawValue("pack_head_type") == "SO" && (_privileges->check("MaintainSalesOrders") || _privileges->check("ViewSalesOrders"))); menuItem = pMenu->addAction(tr("View Transfer Order..."), this, SLOT(sViewTransferOrder())); menuItem->setEnabled(_pack->currentItem()->rawValue("pack_head_type") == "TO" && (_privileges->check("MaintainTransferOrders") || _privileges->check("ViewTransferOrders"))); } void packingListBatch::sViewSalesOrder() { salesOrder::viewSalesOrder(_pack->id()); } void packingListBatch::sViewTransferOrder() { transferOrder::viewTransferOrder(_pack->id()); } void packingListBatch::sAddSO() { XSqlQuery packingAddSO; ParameterList params; params.append("soType", cSoOpen); salesOrderList newdlg(this, "", TRUE); newdlg.set(params); int soid; if ((soid = newdlg.exec()) != QDialog::Rejected) { packingAddSO.prepare("SELECT addToPackingListBatch('SO', :sohead_id) AS result;"); packingAddSO.bindValue(":sohead_id", soid); packingAddSO.exec(); if (packingAddSO.first()) sFillList(); else if (packingAddSO.lastError().type() != QSqlError::NoError) { systemError(this, packingAddSO.lastError().databaseText(), __FILE__, __LINE__); return; } } } void packingListBatch::sAddTO() { XSqlQuery packingAddTO; ParameterList params; params.append("toType", cToOpen); transferOrderList newdlg(this, "", TRUE); newdlg.set(params); int toid; if ((toid = newdlg.exec()) != QSqlError::NoError) { packingAddTO.prepare("SELECT addToPackingListBatch('TO', :tohead_id) AS result;"); packingAddTO.bindValue(":tohead_id", toid); packingAddTO.exec(); if (packingAddTO.first()) sFillList(); else if (packingAddTO.lastError().type() != QSqlError::NoError) { systemError(this, packingAddTO.lastError().databaseText(), __FILE__, __LINE__); return; } } } void packingListBatch::sDelete() { XSqlQuery packingDelete; QString sql( "DELETE FROM pack " "WHERE ((pack_head_id=)" " AND (pack_head_type=)" " " " AND (pack_shiphead_id=)" " " " AND (pack_shiphead_id IS NULL)" "" ");" ); ParameterList params; params.append("head_id", _pack->id()); params.append("head_type", _pack->currentItem()->rawValue("pack_head_type")); if (_pack->altId() > 0) params.append("shiphead_id", _pack->altId()); MetaSQLQuery mql(sql); packingDelete = mql.toQuery(params); if (packingDelete.lastError().type() != QSqlError::NoError) { systemError(this, packingDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void packingListBatch::sPrintPackingList() { XSqlQuery packingPrintPackingList; if (_pack->altId() == -1) { QMessageBox::critical(this, tr("Shipment Number Required"), tr("

    Packing Lists may only be printed for " "existing Shipments and there is no Shipment for " "this Order. Issue Stock To Shipping to " "create a Shipment.")); return; } ParameterList params; if (_pack->currentItem()->rawValue("pack_head_type") == "TO") { params.append("head_id", _pack->id()); params.append("shiphead_id", _pack->altId()); params.append("head_type", _pack->currentItem()->rawValue("pack_head_type")); params.append("print"); } else { params.append("sohead_id", _pack->id()); params.append("shiphead_id", _pack->altId()); } printPackingList newdlg(this, "", TRUE); if (newdlg.set(params) == NoError_Print || newdlg.exec() != XDialog::Rejected) { QString sql( "UPDATE pack " "SET pack_printed=TRUE " "WHERE ((pack_head_id=)" " AND (pack_head_type=)" " " " AND (pack_shiphead_id=)" " " " AND (pack_shiphead_id IS NULL)" "" ");" ); ParameterList params; params.append("head_id", _pack->id()); params.append("head_type", _pack->currentItem()->rawValue("pack_head_type")); if (_pack->altId() > 0) params.append("shiphead_id", _pack->altId()); MetaSQLQuery mql(sql); packingPrintPackingList = mql.toQuery(params); if (packingPrintPackingList.lastError().type() != QSqlError::NoError) { systemError(this, packingPrintPackingList.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void packingListBatch::sFillList() { XSqlQuery packingFillList; ParameterList params; setParams(params); MetaSQLQuery mql = mqlLoad("packingListBatch", "detail"); packingFillList = mql.toQuery(params); if (packingFillList.lastError().type() != QSqlError::NoError) { systemError(this, packingFillList.lastError().databaseText(), __FILE__, __LINE__); return; } _pack->populate(packingFillList, true); } void packingListBatch::sHandleAutoUpdate(bool pAutoUpdate) { if (pAutoUpdate) connect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); else disconnect(omfgThis, SIGNAL(tick()), this, SLOT(sFillList())); } qt-client-4.1.0/guiclient/packingListBatch.h000066400000000000000000000026751217451700100207720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PACKINGLISTBATCH_H #define PACKINGLISTBATCH_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_packingListBatch.h" class packingListBatch : public XWidget, public Ui::packingListBatch { Q_OBJECT public: packingListBatch(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~packingListBatch(); public slots: virtual void sAddSO(); virtual void sAddTO(); virtual void sClearPrinted(); virtual void sDelete(); virtual void sFillList(); virtual void sHandleAutoUpdate( bool pAutoUpdate ); virtual void sPopulateMenu( QMenu * ); virtual void sPrintBatch(); virtual void sPrintEditList(); virtual void sPrintPackingList(); virtual void sViewSalesOrder(); virtual void sViewTransferOrder(); virtual void setParams(ParameterList &); signals: void finishedPrinting(int orderid, QString ordertype, int shipheadid); protected slots: virtual void languageChange(); }; #endif // PACKINGLISTBATCH_H qt-client-4.1.0/guiclient/packingListBatch.ui000066400000000000000000000204651217451700100211550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. packingListBatch 0 0 588 450 Packing List Batch 7 0 Form Auto Select true Pick List false Qt::Horizontal 0 20 Packing List 0 20 Selected Orders 0 0 &Close Print &Edit List Qt::Vertical QSizePolicy::Fixed 20 10 false Print &Batch false &Delete Printed Qt::Vertical QSizePolicy::Fixed 20 10 false &Add S/O false Add T/O false De&lete Order false &Print Packing List Qt::Vertical QSizePolicy::Expanding 20 20 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Automatically Update XCheckBox QCheckBox

    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _pack _close _printEditList _autoUpdate _close clicked() packingListBatch close() 20 20 20 20 qt-client-4.1.0/guiclient/paymentechprocessor.cpp000066400000000000000000000527761217451700100222170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "guiclient.h" #include "paymentechprocessor.h" #define DEBUG false /** @ingroup creditcards @class PaymentechProcessor */ PaymentechProcessor::PaymentechProcessor() : CreditCardProcessor() { _company = "Paymentech"; _defaultLivePort = 443; _defaultLiveServer = "https://netconnectka1.paymentech.net/NetConnect/controller"; _defaultTestPort = 443; _defaultTestServer = "https://netconnectkavar1.paymentech.net/NetConnect/controller"; _msgHash.insert(-200, tr("A Login is required.")); _msgHash.insert(-201, tr("A Password is required.")); _msgHash.insert(-202, tr("A Division Number must be no more than 10 characters long.")); _msgHash.insert(-205, tr("The response from the Gateway appears to be " "incorrectly formatted (could not find field %1 " "as there are only %2 fields present).")); _msgHash.insert(-206, tr("The response from the Gateway failed the MD5 " "security check.")); _msgHash.insert( 206, tr("The response from the Gateway has failed the MD5 " "security check but will be processed anyway.")); _msgHash.insert(-207, tr("The Gateway returned the following error: %1")); _msgHash.insert(-209, tr("The selected credit card is not a know type for Paymentech.")); } int PaymentechProcessor::buildCommon(QString &pordernum, const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &prequest, QString pordertype, const QString &pAuthcode, const QString &pRespdate) { Q_UNUSED(pcurrid); XSqlQuery anq; anq.prepare( "SELECT ccard_active," " formatbytea(decrypt(setbytea(ccard_number), setbytea(:key),'bf')) AS ccard_number," " formatccnumber(decrypt(setbytea(ccard_number),setbytea(:key),'bf')) AS ccard_number_x," " formatbytea(decrypt(setbytea(ccard_name), setbytea(:key),'bf')) AS ccard_name," " formatbytea(decrypt(setbytea(ccard_address1), setbytea(:key),'bf')) AS ccard_address1," " formatbytea(decrypt(setbytea(ccard_address2), setbytea(:key),'bf')) AS ccard_address2," " formatbytea(decrypt(setbytea(ccard_city), setbytea(:key),'bf')) AS ccard_city," " formatbytea(decrypt(setbytea(ccard_state), setbytea(:key),'bf')) AS ccard_state," " formatbytea(decrypt(setbytea(ccard_zip), setbytea(:key),'bf')) AS ccard_zip," " formatbytea(decrypt(setbytea(ccard_country), setbytea(:key),'bf')) AS ccard_country," " formatbytea(decrypt(setbytea(ccard_month_expired),setbytea(:key),'bf')) AS ccard_month_expired," " formatbytea(decrypt(setbytea(ccard_year_expired),setbytea(:key), 'bf')) AS ccard_year_expired," " ccard_type," " custinfo.* " " FROM ccard, custinfo " "WHERE ((ccard_id=:ccardid)" " AND (ccard_cust_id=cust_id));"); anq.bindValue(":ccardid", pccardid); anq.bindValue(":key", omfgThis->_key); anq.exec(); if (anq.first()) { if (!anq.value("ccard_active").toBool()) { _errorMsg = errorMsg(-10); return -10; } } else if (anq.lastError().type() != QSqlError::NoError) { _errorMsg = anq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } _extraHeaders.clear(); _extraHeaders.append(qMakePair(QString("Stateless-Transaction"), QString("true"))); _extraHeaders.append(qMakePair(QString("Auth-MID"), QString(_metricsenc->value("CCPTDivisionNumber").rightJustified(10, '0', true)))); _extraHeaders.append(qMakePair(QString("Auth-User"), QString(_metricsenc->value("CCLogin")))); _extraHeaders.append(qMakePair(QString("Auth-Password"), QString(_metricsenc->value("CCPassword")))); _extraHeaders.append(qMakePair(QString("Content-type"), QString("SALEM05210/SLM"))); prequest = "P74V"; prequest += pordernum.leftJustified(22, ' ', true); QString ccardType = anq.value("ccard_type").toString(); if("V" == ccardType) // Visa ccardType = "VI"; else if("M" == ccardType) // Master Card ccardType = "MC"; else if("A" == ccardType) // American Express ccardType = "AX"; else if("D" == ccardType) // Discover ccardType = "DI"; else if("P" == ccardType) // PayPal ccardType = "PY"; else { _errorMsg = errorMsg(-209); return -209; } prequest += ccardType; prequest += anq.value("ccard_number").toString().leftJustified(19, ' ', true); QString work_month; work_month.setNum(anq.value("ccard_month_expired").toDouble()); if (work_month.length() == 1) work_month = "0" + work_month; prequest += work_month + anq.value("ccard_year_expired").toString().right(2); prequest += _metricsenc->value("CCPTDivisionNumber").rightJustified(10, '0', true); double shiftedAmt = pamount * 100.0; int amount = (int)shiftedAmt; prequest += QString::number(amount).rightJustified(12, '0', true); // TODO: this needs to be changed to support non-us prequest += "840"; // CurrencyCode: U.S. Dollars prequest += "7"; // TransactionType: 1 - single trans over mail/phone card holder not present, 7 - e-commerce prequest += " "; // EncryptionFlag, PaymentIndicator: both optional not using prequest += pordertype; // ActionCode 2 digit prequest += " "; // Reserved if(pordertype == "AU") { // Bill To Address Information prequest += "AB"; prequest += " "; // TelephoneType, TelephoneNumber (1,14, Optional) QStringList nameParts = anq.value("ccard_name").toString().split(QRegExp("\\s+")); QString name = ""; if(!nameParts.isEmpty()) { QString lName = nameParts.takeLast(); QString fName = nameParts.join(" "); name = fName + " *" + lName; } prequest += name.leftJustified(30, ' ', true); prequest += anq.value("ccard_address1").toString().leftJustified(30, ' ', true); prequest += anq.value("ccard_address2").toString().leftJustified(28, ' ', true); QString cntry = anq.value("ccard_country").toString(); XSqlQuery qCntry; qCntry.prepare("SELECT 1 AS ord, country_abbr FROM country WHERE country_name = :cname" " UNION " "SELECT 2 AS ord, country_abbr FROM country WHERE country_abbr = :cname" " ORDER BY ord LIMIT 1;"); qCntry.bindValue(":cname", cntry); qCntry.exec(); if(qCntry.first()) cntry = qCntry.value("country_abbr").toString(); else cntry = ""; prequest += cntry.leftJustified(2, ' ', true); prequest += anq.value("ccard_city").toString().leftJustified(20, ' ', true); QString state = anq.value("ccard_state").toString(); XSqlQuery qState; qState.prepare("SELECT 1 AS ord, state_abbr FROM state WHERE state_name = :cname" " UNION " "SELECT 2 AS ord, state_abbr FROM state WHERE state_abbr = :cname" " ORDER BY ord LIMIT 1;"); qState.bindValue(":cname", state); qState.exec(); if(qState.first()) state = qState.value("state_abbr").toString(); else state = ""; prequest += state.leftJustified(2, ' ', true); prequest += anq.value("ccard_zip").toString().leftJustified(10, ' ', true); } // end Address Billing record if(pordertype == "AR") { prequest += "PA"; prequest += pRespdate.leftJustified(6, '0', true); prequest += pAuthcode.leftJustified(6, ' ', true); prequest += " "; // DebitTraceNumber: leave blank } if (! pcvv.isEmpty()) { prequest += "FR"; prequest += "1"; prequest += pcvv.leftJustified(4, ' ', true); } // version records -- should always include prequest += "VVISAN\r"; // add version record to end prequest = prequest.toUpper(); _extraHeaders.append(qMakePair(QString("Content-Length"), QString("%1").arg(prequest.size()))); if (DEBUG) qDebug("Paymentech:buildCommon built %s\n", prequest.toAscii().data()); return 0; } int PaymentechProcessor::doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("Paymentech:doAuthorize(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); int returnValue = 0; double amount = pamount; //double tax = ptax; //double freight = pfreight; //double duty = pduty; int currid = pcurrid; QString request; returnValue = buildCommon(pneworder, pccardid, pcvv, amount, currid, request, "AU"); if (returnValue != 0) return returnValue; QString response; returnValue = sendViaHTTP(request, response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "A", amount, currid, pneworder, preforder, pccpayid, pparams); return returnValue; } /** \brief This function actually does an Authorization then a Charge Preauth. Changes don't occurr real-time so we do the preauth real-time and if that succeeds just put the record in the correct state to be charged later. If the processor can't do the charge then the transaction must be undone. */ int PaymentechProcessor::doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("Paymentech:doCharge(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = 0; int refid = 0; returnValue = authorize(pccardid, pcvv, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder, preforder, pccpayid, "", refid); // don't return here because the caller needs all of the parameter data double amount = pamount; int currid = pcurrid; XSqlQuery ccq; ccq.prepare("SELECT ccpay_r_avs, ccpay_r_ordernum, ccpay_r_error," " ccpay_r_code, ccpay_r_shipping, ccpay_r_tax," " ccpay_r_ref, ccpay_r_message, ccpay_yp_r_tdate" " FROM ccpay" " WHERE(ccpay_id=:ccpayid);"); ccq.bindValue(":ccpayid", pccpayid); ccq.exec(); if(!ccq.first()) { return -1; } pparams.append("ccard_id", pccardid); pparams.append("currid", currid); pparams.append("auth_charge", "C"); pparams.append("type", "C"); pparams.append("status", "C"); pparams.append("reforder", (preforder.isEmpty()) ? pneworder : preforder); pparams.append("ordernum", pneworder); pparams.append("approved", "SUBMITTED"); pparams.append("avs", ccq.value("ccpay_r_avs").toString()); pparams.append("xactionid", ccq.value("ccpay_r_ordernum").toString()); pparams.append("error", ccq.value("ccpay_r_error").toString()); pparams.append("code", ccq.value("ccpay_r_code").toString()); pparams.append("shipping", ccq.value("ccpay_r_shipping").toString()); pparams.append("tax", ccq.value("ccpay_r_tax").toString()); pparams.append("ref", ccq.value("ccpay_r_ref").toString()); pparams.append("message", ccq.value("ccpay_r_message").toString()); pparams.append("tdate", ccq.value("ccpay_yp_r_tdate").toString()); pparams.append("auth", false); pparams.append("amount", amount); return returnValue; } /** \brief Updated a previously created auth record as a charge with approved string "SUBMITTED" and a separate process will do the actuall processing of the charge updating the record appropriately. If the later processing fails then the appropriate step must be taken to undo any record money. */ int PaymentechProcessor::doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { Q_UNUSED(pcvv); if (DEBUG) qDebug("Paymentech:doChargePreauthorized(%d, pcvv, %f, %d, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = 0; double amount = pamount; int currid = pcurrid; XSqlQuery ccq; ccq.prepare("SELECT ccpay_r_avs, ccpay_r_ordernum, ccpay_r_error," " ccpay_r_code, ccpay_r_shipping, ccpay_r_tax," " ccpay_r_ref, ccpay_r_message, ccpay_yp_r_tdate" " FROM ccpay" " WHERE(ccpay_id=:ccpayid);"); ccq.bindValue(":ccpayid", pccpayid); ccq.exec(); if(!ccq.first()) { return -1; } pparams.append("ccard_id", pccardid); pparams.append("currid", currid); pparams.append("auth_charge", "CP"); pparams.append("type", "CP"); pparams.append("status", "C"); pparams.append("reforder", (preforder.isEmpty()) ? pneworder : preforder); pparams.append("ordernum", pneworder); pparams.append("approved", "SUBMITTED"); pparams.append("avs", ccq.value("ccpay_r_avs").toString()); pparams.append("xactionid", ccq.value("ccpay_r_ordernum").toString()); pparams.append("error", ccq.value("ccpay_r_error").toString()); pparams.append("code", ccq.value("ccpay_r_code").toString()); pparams.append("shipping", ccq.value("ccpay_r_shipping").toString()); pparams.append("tax", ccq.value("ccpay_r_tax").toString()); pparams.append("ref", ccq.value("ccpay_r_ref").toString()); pparams.append("message", ccq.value("ccpay_r_message").toString()); pparams.append("tdate", ccq.value("ccpay_yp_r_tdate").toString()); pparams.append("auth", false); pparams.append("amount", amount); return returnValue; } /** \brief Create a credit record that will be processed later by a processor. If the processing fails then the record needs to undo any transactions. */ int PaymentechProcessor::doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { Q_UNUSED(pcvv); if (DEBUG) qDebug("Paymentech:doCredit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = 0; double amount = pamount; int currid = pcurrid; pparams.append("ccard_id", pccardid); pparams.append("currid", currid); pparams.append("auth_charge", "R"); pparams.append("type", "R"); pparams.append("status", "R"); pparams.append("reforder", (preforder.isEmpty()) ? pneworder : preforder); pparams.append("ordernum", pneworder); pparams.append("approved", "SUBMITTED"); pparams.append("auth", false); pparams.append("amount", amount); return returnValue; } int PaymentechProcessor::doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("Paymentech:doVoidPrevious(%d, pcvv, %f, %d, %s, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), qPrintable(papproval), pccpayid); QString tmpErrorMsg = _errorMsg; int returnValue = 0; double amount = pamount; int currid = pcurrid; QString authcode; QString respdate; XSqlQuery ccq; ccq.prepare("SELECT ccpay_status, ccpay_r_approved, ccpay_r_code, ccpay_yp_r_tdate FROM ccpay WHERE (ccpay_id=:ccpayid);"); ccq.bindValue(":ccpayid", pccpayid); ccq.exec(); if(!ccq.first()) { return -1; } if(ccq.value("ccpay_status").toString() == "C" && ccq.value("ccpay_r_approved").toString() != "SUBMITTED") { return -60; // we can not void a processed charge. } authcode = ccq.value("ccpay_r_code").toString(); respdate = ccq.value("ccpay_yp_r_tdate").toString(); QString request; returnValue = buildCommon(pneworder, pccardid, pcvv, amount, currid, request, "AR", authcode, respdate); // TODO: This may need to be different if it was charged already if (returnValue != 0) return returnValue; QString response; returnValue = sendViaHTTP(request, response); _errorMsg = tmpErrorMsg; if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "V", amount, currid, pneworder, preforder, pccpayid, pparams); if (! tmpErrorMsg.isEmpty()) _errorMsg = tmpErrorMsg; return returnValue; } int PaymentechProcessor::handleResponse(const QString &presponse, const int pccardid, const QString &ptype, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("Paymentech::handleResponse(%s, %d, %s, %f, %d, %s, %d, pparams)", presponse.toAscii().data(), pccardid, ptype.toAscii().data(), pamount, pcurrid, preforder.toAscii().data(), pccpayid); int returnValue = 0; QString r_approved; QString r_avs; QString r_code; QString r_cvv; QString r_error; QString r_message; QString r_ordernum; QString r_reason; // not stored QString r_ref; QString r_shipping; QString r_tax; QString r_date; QString status; QString r_response; r_response = presponse.mid(26, 3).trimmed(); int i_response = r_response.toInt(); if ((i_response >= 100 && i_response < 200) || i_response == 704) r_approved = "APPROVED"; else if((i_response >= 200 && i_response < 300 && i_response != 260) || (i_response >= 740 && i_response <= 768)) r_approved = "ERROR"; // REJECTED else r_approved = "DECLINED"; r_reason = r_response; r_message = r_response; r_date = presponse.mid(29, 6).trimmed(); r_code = presponse.mid(35, 6).trimmed(); r_avs = presponse.mid(41, 2).trimmed(); r_ordernum = presponse.mid(4, 22).trimmed(); r_cvv = presponse.mid(43, 1).trimmed(); if (r_approved == "APPROVED") { _errorMsg = errorMsg(0).arg(r_code); if (ptype == "A") status = "A"; // Authorized else if (ptype == "V") status = "V"; // Voided else status = "C"; // Completed/Charged } else if (r_approved == "DECLINED") { _errorMsg = errorMsg(-92).arg(r_message); returnValue = -92; status = "D"; } else if (r_approved == "ERROR") { r_error = r_message; _errorMsg = errorMsg(-12).arg(r_error).arg(_company); returnValue = -12; status = "X"; } else if (r_approved.isEmpty() && ! r_message.isEmpty()) { _errorMsg = errorMsg(-95).arg(r_message).arg(_company); returnValue = -95; status = "X"; } else if (r_approved.isEmpty()) { _errorMsg = errorMsg(-100).arg(r_error).arg(r_message).arg(presponse); returnValue = -100; status = "X"; } QStringList validAvs; // TODO: is this list correct? validAvs << "N1" << "N2" << " " << "IG" << "IU" << "ID" << "IA" << "IB" << "IP" << "A1" << "A3" << "A4" << "A7" << "I3" << "I4"; _passedAvs = validAvs.contains(r_avs); // always use the CVV checking configured on the gateway QString validCvv("MPU "); _passedCvv = validCvv.contains(r_cvv); if (DEBUG) qDebug("Paymentech:%s _passedAvs %d\t%s _passedCvv %d", qPrintable(r_avs), _passedAvs, qPrintable(r_cvv), _passedCvv); pparams.append("ccard_id", pccardid); pparams.append("currid", pcurrid); pparams.append("auth_charge", ptype); pparams.append("type", ptype); pparams.append("reforder", (preforder.isEmpty()) ? pneworder : preforder); pparams.append("status", status); pparams.append("avs", r_avs); pparams.append("ordernum", pneworder); pparams.append("xactionid", r_ordernum); pparams.append("error", r_error); pparams.append("approved", r_approved); pparams.append("code", r_code); pparams.append("shipping", r_shipping); pparams.append("tax", r_tax); pparams.append("ref", r_ref); pparams.append("message", r_message); pparams.append("tdate", r_date); pparams.append("auth", (ptype == "A")); if (DEBUG) qDebug("Paymentech:r_error.isEmpty() = %d", r_error.isEmpty()); if (returnValue == 0) pparams.append("amount", pamount); else pparams.append("amount", 0); // no money changed hands this attempt if (DEBUG) qDebug("Paymentech::handleResponse returning %d %s", returnValue, errorMsg().toAscii().data()); return returnValue; } int PaymentechProcessor::doTestConfiguration() { if (DEBUG) qDebug("Pt:doTestConfiguration()"); int returnValue = 0; if (_metricsenc->value("CCLogin").isEmpty()) { _errorMsg = errorMsg(-200); returnValue = -200; } else if (_metricsenc->value("CCPassword").isEmpty()) { _errorMsg = errorMsg(-201); returnValue = -201; } else if (_metricsenc->value("CCPTDivisionNumber").size() > 10) { _errorMsg = errorMsg(-202); returnValue = -202; } return returnValue; } bool PaymentechProcessor::handlesCreditCards() { return true; } qt-client-4.1.0/guiclient/paymentechprocessor.h000066400000000000000000000044601217451700100216470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PAYMENTECGPROCESSOR_H #define PATNEBTECHPROCESSOR_H #include #include #include "creditcardprocessor.h" class PaymentechProcessor : public CreditCardProcessor { Q_OBJECT public: PaymentechProcessor(); protected: virtual int buildCommon(QString &pordernum, const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &prequest, QString pordertype, const QString &pAuthcode = QString::null, const QString &pRespdate = QString::null); virtual int doTestConfiguration(); virtual int doAuthorize(const int, const QString &pcvv, double &, const double, const bool, const double, const double, const int, QString&, QString&, int&, ParameterList &); virtual int doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams); virtual bool handlesCreditCards(); virtual int handleResponse(const QString&, const int, const QString&, const double, const int, QString&, QString&, int&, ParameterList&); }; #endif // PAYMENTECHPROCESSOR_H qt-client-4.1.0/guiclient/plannedOrder.cpp000066400000000000000000000377601217451700100205330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "plannedOrder.h" #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" plannedOrder::plannedOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl), _captive(false) { setupUi(this); connect(_create, SIGNAL(clicked()), this, SLOT(sCreate())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sHandleItemsite(int))); connect(_dueDate, SIGNAL(newDate(const QDate &)), this, SLOT(sUpdateStartDate())); connect(_leadTime, SIGNAL(valueChanged(int)), this, SLOT(sUpdateStartDate())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured | ItemLineEdit::cActive); _qty->setValidator(omfgThis->qtyVal()); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } plannedOrder::~plannedOrder() { // no need to delete child widgets, Qt does it all for us } void plannedOrder::languageChange() { retranslateUi(this); } enum SetResponse plannedOrder::set(const ParameterList &pParams) { XSqlQuery plannedet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); } param = pParams.value("planord_id", &valid); if (valid) { _captive = TRUE; _planordid = param.toInt(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; populateFoNumber(); } else if (param.toString() == "edit") { _mode = cEdit; populate(); } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _typeGroup->setEnabled(FALSE); _qty->setEnabled(FALSE); _startDate->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _leadTimeLit->hide(); _leadTime->hide(); _daysLit->hide(); populate(); } } return NoError; } void plannedOrder::sClose() { XSqlQuery plannedClose; if (_mode == cNew) { plannedClose.prepare("SELECT releasePlanNumber(:orderNumber);"); plannedClose.bindValue(":orderNumber", _number->text().toInt()); plannedClose.exec(); } reject(); } void plannedOrder::sCreate() { XSqlQuery plannedCreate; QList errors; errors << GuiErrorCheck(!_item->isValid(), _item, tr("You must enter or select a valid Item number before creating this Planned Order")) << GuiErrorCheck(!_qty->text().length(), _qty, tr("You must enter a valid Qty. Ordered before creating this Planned Order")) << GuiErrorCheck(!_dueDate->isValid(), _dueDate, tr("You must enter a valid Due Date before creating this Planned Order")) ; plannedCreate.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); plannedCreate.bindValue(":item_id", _item->id()); plannedCreate.bindValue(":warehous_id", _warehouse->id()); plannedCreate.exec(); if (!plannedCreate.first()) { errors << GuiErrorCheck(true, _item, tr("The Item and Site entered is an invalid Item Site combination.") ); } int itemsiteid = plannedCreate.value("itemsite_id").toInt(); int _supplyItemsiteId = -1; if (_toButton->isChecked()) { plannedCreate.prepare("SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) ); "); plannedCreate.bindValue(":item_id", _item->id()); plannedCreate.bindValue(":warehous_id", _fromWarehouse->id()); plannedCreate.exec(); if (plannedCreate.first()) { if (plannedCreate.value("itemsite_id").toInt() == itemsiteid) { errors << GuiErrorCheck(true, _item, tr("The Supplied From Site must be different from the Transfer To Site.") ); } else _supplyItemsiteId = plannedCreate.value("itemsite_id").toInt(); } else { errors << GuiErrorCheck(true, _item, tr("Cannot find Supplied From Item Site.") ); } } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Planned Order"), errors)) return; int foid = 0; if(cEdit == _mode) plannedCreate.prepare( "UPDATE planord " "SET planord_number=:planord_number, " " planord_type=:planord_type, " " planord_itemsite_id=:planord_itemsite_id, " " planord_supply_itemsite_id=:planord_supply_itemsite_id, " " planord_comments=:planord_comments, " " planord_qty=:planord_qty, " " planord_duedate=:planord_duedate, " " planord_startdate=COALESCE(:planord_startdate, date(:planord_duedate) - :planord_leadtime) " "WHERE (planord_id=:planord_id);" ); else plannedCreate.prepare( "SELECT createPlannedOrder( :planord_number, :planord_itemsite_id, :planord_qty, " " COALESCE(:planord_startdate, date(:planord_duedate) - :planord_leadtime), :planord_duedate, " " :planord_type, :planord_supply_itemsite_id, :planord_notes) AS result;" ); plannedCreate.bindValue(":planord_number", _number->text().toInt()); plannedCreate.bindValue(":planord_itemsite_id", itemsiteid); if (_poButton->isChecked()) plannedCreate.bindValue(":planord_type", "P"); else if (_woButton->isChecked()) plannedCreate.bindValue(":planord_type", "W"); else if (_toButton->isChecked()) { plannedCreate.bindValue(":planord_type", "T"); plannedCreate.bindValue(":planord_supply_itemsite_id", _supplyItemsiteId); } plannedCreate.bindValue(":planord_qty", _qty->toDouble()); plannedCreate.bindValue(":planord_duedate", _dueDate->date()); plannedCreate.bindValue(":planord_startdate", _startDate->date()); plannedCreate.bindValue(":planord_leadtime", _leadTime->value()); plannedCreate.bindValue(":planord_comments", _notes->toPlainText()); plannedCreate.bindValue(":planord_id", _planordid); plannedCreate.exec(); if (plannedCreate.lastError().type() != QSqlError::NoError) { systemError(this, plannedCreate.lastError().databaseText(), __FILE__, __LINE__); return; } if(cEdit == _mode) { plannedCreate.prepare( "SELECT explodePlannedOrder( :planord_id, true) AS result;" ); plannedCreate.bindValue(":planord_id", _planordid); plannedCreate.exec(); if (plannedCreate.first()) { double result = plannedCreate.value("result").toDouble(); if (result < 0.0) { systemError(this, tr("ExplodePlannedOrder returned %, indicating an " "error occurred.").arg(result), __FILE__, __LINE__); return; } } else if (plannedCreate.lastError().type() != QSqlError::NoError) { systemError(this, plannedCreate.lastError().databaseText(), __FILE__, __LINE__); return; } } else { if (!plannedCreate.first()) { systemError( this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } foid = XDialog::Rejected; switch (plannedCreate.value("result").toInt()) { case -1: QMessageBox::critical( this, tr("Planned Order not Exploded"), tr( "The Planned Order was created but not Exploded as there is no valid Bill of Materials for the selected Item.\n" "You must create a valid Bill of Materials before you may explode this Planned Order." )); break; case -2: QMessageBox::critical( this, tr("Planned Order not Exploded"), tr( "The Planned Order was created but not Exploded as Component Items defined in the Bill of Materials\n" "for the selected Planned Order Item do not exist in the selected Planned Order Site.\n" "You must create Item Sites for these Component Items before you may explode this Planned Order." )); break; default: foid = plannedCreate.value("result").toInt(); break; } } if (_captive) done(foid); else { populateFoNumber(); _item->setId(-1); _typeGroup->setEnabled(FALSE); _qty->clear(); _dueDate->setNull(); _leadTime->setValue(0); _startDate->setNull(); _notes->clear(); _close->setText(tr("&Close")); _item->setFocus(); } } void plannedOrder::populate() { XSqlQuery planord; planord.prepare( "SELECT planord.*, itemsite.itemsite_leadtime AS leadtime, " " supply.itemsite_warehous_id AS supplywarehousid " "FROM planord JOIN itemsite ON (planord_itemsite_id=itemsite.itemsite_id)" " LEFT OUTER JOIN itemsite supply ON (planord_supply_itemsite_id=supply.itemsite_id) " "WHERE (planord_id=:planord_id);" ); planord.bindValue(":planord_id", _planordid); planord.exec(); if (planord.first()) { _number->setText(planord.value("planord_number").toString()); _item->setItemsiteid(planord.value("planord_itemsite_id").toInt()); _qty->setDouble(planord.value("planord_qty").toDouble()); _leadTime->setValue(planord.value("leadtime").toInt()); _dueDate->setDate(planord.value("planord_duedate").toDate()); _startDate->setDate(planord.value("planord_startdate").toDate()); _notes->setText(planord.value("planord_comments").toString()); if (planord.value("planord_type").toString() == "P") _poButton->setChecked(TRUE); else if (planord.value("planord_type").toString() == "W") _woButton->setChecked(TRUE); else { _toButton->setChecked(TRUE); _fromWarehouse->setId(planord.value("supplywarehousid").toInt()); } } else if (planord.lastError().type() != QSqlError::NoError) { systemError(this, planord.lastError().databaseText(), __FILE__, __LINE__); return; } } void plannedOrder::sUpdateStartDate() { if (!_warehouse->isValid() || !_dueDate->isValid()) return; if (_leadTime->value() == 0) { _startDate->setDate(_dueDate->date()); return; } XSqlQuery startDate; if (_metrics->boolean("UseSiteCalendar")) startDate.prepare("SELECT calculateNextWorkingDate(:warehous_id, :dueDate, (:leadTime * -1)) AS startdate;"); else startDate.prepare("SELECT (DATE(:dueDate) - :leadTime) AS startdate;"); startDate.bindValue(":dueDate", _dueDate->date()); startDate.bindValue(":leadTime", _leadTime->value()); startDate.bindValue(":warehous_id", _warehouse->id()); startDate.exec(); if (startDate.first()) _startDate->setDate(startDate.value("startdate").toDate()); else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } void plannedOrder::sHandleItemsite(int pWarehousid) { if (_metrics->boolean("UseSiteCalendar")) { _dueDate->setCalendarSiteId(pWarehousid); _startDate->setCalendarSiteId(pWarehousid); } XSqlQuery plannedHandleItemsite; plannedHandleItemsite.prepare( "SELECT itemsite_leadtime, itemsite_wosupply, itemsite_posupply, item_type " "FROM itemsite JOIN item ON (item_id=itemsite_item_id) " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); plannedHandleItemsite.bindValue(":item_id", _item->id()); plannedHandleItemsite.bindValue(":warehous_id", pWarehousid); plannedHandleItemsite.exec(); if (!plannedHandleItemsite.first()) { systemError(this, plannedHandleItemsite.lastError().databaseText(), __FILE__, __LINE__); return; } _leadTime->setValue(plannedHandleItemsite.value("itemsite_leadtime").toInt()); if ( plannedHandleItemsite.value("itemsite_posupply").toBool() && (plannedHandleItemsite.value("item_type").toString() == "P" || plannedHandleItemsite.value("item_type").toString() == "O" || plannedHandleItemsite.value("item_type").toString() == "T" || plannedHandleItemsite.value("item_type").toString() == "M") ) _poButton->setEnabled(TRUE); else _poButton->setEnabled(FALSE); if ( plannedHandleItemsite.value("itemsite_wosupply").toBool() && (plannedHandleItemsite.value("item_type").toString() == "P" || plannedHandleItemsite.value("item_type").toString() == "T" || plannedHandleItemsite.value("item_type").toString() == "M") ) _woButton->setEnabled(TRUE); else _woButton->setEnabled(FALSE); if ( plannedHandleItemsite.value("itemsite_wosupply").toBool() && plannedHandleItemsite.value("itemsite_posupply").toBool() && plannedHandleItemsite.value("item_type").toString() == "P" ) { _poButton->setChecked(TRUE); _woButton->setChecked(FALSE); } else if ( plannedHandleItemsite.value("itemsite_wosupply").toBool() ) { _poButton->setChecked(FALSE); _woButton->setChecked(TRUE); } else { _poButton->setChecked(TRUE); _woButton->setChecked(FALSE); } plannedHandleItemsite.prepare( "SELECT COALESCE(COUNT(*), 0) AS supplysites " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id <> :warehous_id) );" ); plannedHandleItemsite.bindValue(":item_id", _item->id()); plannedHandleItemsite.bindValue(":warehous_id", pWarehousid); plannedHandleItemsite.exec(); if (!plannedHandleItemsite.first()) { systemError(this, plannedHandleItemsite.lastError().databaseText(), __FILE__, __LINE__); return; } if (plannedHandleItemsite.value("supplysites").toInt() > 0) _toButton->setEnabled(TRUE); else _toButton->setEnabled(FALSE); plannedHandleItemsite.prepare( "SELECT COALESCE(supply.itemsite_id, -1) AS supplyitemsiteid," " COALESCE(supply.itemsite_warehous_id, -1) AS supplywarehousid " "FROM itemsite LEFT OUTER JOIN itemsite supply ON (supply.itemsite_id=itemsite.itemsite_supply_itemsite_id)" "WHERE ( (itemsite.itemsite_item_id=:item_id)" " AND (itemsite.itemsite_warehous_id=:warehous_id) );" ); plannedHandleItemsite.bindValue(":item_id", _item->id()); plannedHandleItemsite.bindValue(":warehous_id", pWarehousid); plannedHandleItemsite.exec(); if (!plannedHandleItemsite.first()) { systemError(this, plannedHandleItemsite.lastError().databaseText(), __FILE__, __LINE__); return; } if (plannedHandleItemsite.value("supplyitemsiteid").toInt() != -1) { _toButton->setChecked(TRUE); _fromWarehouse->setId(plannedHandleItemsite.value("supplywarehousid").toInt()); } else _fromWarehouse->setId(pWarehousid); } void plannedOrder::populateFoNumber() { XSqlQuery plannedpopulateFoNumber; plannedpopulateFoNumber.exec("SELECT fetchPlanNumber() AS foNumber;"); if (plannedpopulateFoNumber.first()) _number->setText(plannedpopulateFoNumber.value("foNumber").toString()); else { { systemError(this, plannedpopulateFoNumber.lastError().databaseText(), __FILE__, __LINE__); return; } _number->setText("Error"); return; } } qt-client-4.1.0/guiclient/plannedOrder.h000066400000000000000000000023231217451700100201630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PLANNEDORDERS_H #define PLANNEDORDERS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_plannedOrder.h" class plannedOrder : public XDialog, public Ui::plannedOrder { Q_OBJECT public: plannedOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~plannedOrder(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sClose(); virtual void sCreate(); virtual void sUpdateStartDate(); virtual void sHandleItemsite( int pWarehousid ); virtual void populate(); virtual void populateFoNumber(); protected slots: virtual void languageChange(); private: int _mode; int _planordid; bool _captive; }; #endif // PLANNEDORDERS_H qt-client-4.1.0/guiclient/plannedOrder.ui000066400000000000000000000446551217451700100203670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. plannedOrder true 0 0 709 508 Planned Order 12 12 5 Planned Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 100 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 &Cancel false &Save true Qt::Vertical QSizePolicy::Expanding 20 20 3 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter WComboBox::Supply Qt::Vertical 20 0 false Purchase Order true Work Order Transfer Order From Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false WComboBox::Supply Qt::Horizontal 40 20 0 General Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 20 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 32767 Lead Time: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 999 Days Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 68 21 Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 false 100 32767 Qt::Horizontal QSizePolicy::Expanding 229 20 Qt::Vertical 20 0 Notes DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _qty _dueDate _leadTime _startDate _create _close _item valid(bool) _create setEnabled(bool) 20 20 20 20 _item newId(int) _fromWarehouse findItemsites(int) 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _toButton toggled(bool) _fromWarehouse setEnabled(bool) 96 252 292 251 _item valid(bool) _typeGroup setEnabled(bool) 211 110 273 227
    qt-client-4.1.0/guiclient/plannerCode.cpp000066400000000000000000000160561217451700100203430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "plannerCode.h" #include #include plannerCode::plannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if (_metrics->value("Application") != "PostBooks") { QButtonGroup* _explosionGroupInt = new QButtonGroup(this); _explosionGroupInt->addButton(_singleLevel); _explosionGroupInt->addButton(_multipleLevel); _singleLevel->setChecked(true); _explosionGroup->setEnabled(false); } else { _mrpexcpResched->hide(); _mrpexcpDelete->hide(); _autoExplode->hide(); _explosionGroup->hide(); } connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } plannerCode::~plannerCode() { // no need to delete child widgets, Qt does it all for us } void plannerCode::languageChange() { retranslateUi(this); } enum SetResponse plannerCode::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("plancode_id", &valid); if (valid) { _plancodeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _mrpexcpResched->setEnabled(FALSE); _mrpexcpDelete->setEnabled(FALSE); _autoExplode->setEnabled(FALSE); _explosionGroup->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } bool plannerCode::sCheck() { XSqlQuery plannerCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().length() != 0)) { plannerCheck.prepare( "SELECT plancode_id " "FROM plancode " "WHERE (UPPER(plancode_code)=UPPER(:plancode_code));" ); plannerCheck.bindValue(":plancode_code", _code->text()); plannerCheck.exec(); if (plannerCheck.first()) { _plancodeid = plannerCheck.value("plancode_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); return TRUE; } } return FALSE; } void plannerCode::sSave() { XSqlQuery plannerSave; _code->setText(_code->text().trimmed().toUpper()); if (_code->text().length() == 0) { QMessageBox::information( this, tr("Invalid Planner Code"), tr("You must enter a valid Code for this Planner.") ); _code->setFocus(); return; } if (_mode == cNew) { if (sCheck()) { QMessageBox::warning( this, tr("Cannot Save Planner Code"), tr("This Planner code already exists. You have been placed in edit mode.") ); return; } plannerSave.exec("SELECT NEXTVAL('plancode_plancode_id_seq') AS plancode_id"); if (plannerSave.first()) _plancodeid = plannerSave.value("plancode_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } plannerSave.prepare( "INSERT INTO plancode " "( plancode_id, plancode_code, plancode_name," " plancode_mpsexplosion, plancode_consumefcst," " plancode_mrpexcp_resched, plancode_mrpexcp_delete ) " "VALUES " "( :plancode_id, :plancode_code, :plancode_name," " :plancode_mpsexplosion, :plancode_consumefcst," " :plancode_mrpexcp_resched, :plancode_mrpexcp_delete );" ); } else if (_mode == cEdit) plannerSave.prepare("SELECT plancode_id" " FROM plancode" " WHERE((plancode_id != :plancode_id)" " AND (plancode_code = :plancode_code));"); plannerSave.bindValue(":plancode_id", _plancodeid); plannerSave.bindValue(":plancode_code", _code->text()); plannerSave.exec(); if(plannerSave.first()) { QMessageBox::warning( this, tr("Cannot Save Planner Code"), tr("You may not rename this Planner code with the entered name as it is in use by another Planner code.") ); _code->setFocus(); return; } plannerSave.prepare( "UPDATE plancode " "SET plancode_code=:plancode_code, plancode_name=:plancode_name," " plancode_mpsexplosion=:plancode_mpsexplosion," " plancode_consumefcst=:plancode_consumefcst," " plancode_mrpexcp_resched=:plancode_mrpexcp_resched, " " plancode_mrpexcp_delete=:plancode_mrpexcp_delete " "WHERE (plancode_id=:plancode_id);" ); plannerSave.bindValue(":plancode_id", _plancodeid); plannerSave.bindValue(":plancode_code", _code->text()); plannerSave.bindValue(":plancode_name", _description->text().trimmed()); plannerSave.bindValue(":plancode_consumefcst", false); plannerSave.bindValue(":plancode_mrpexcp_resched", QVariant(_mrpexcpResched->isChecked())); plannerSave.bindValue(":plancode_mrpexcp_delete", QVariant(_mrpexcpDelete->isChecked())); if (_autoExplode->isChecked()) { if (_singleLevel->isChecked()) plannerSave.bindValue(":plancode_mpsexplosion", "S"); else plannerSave.bindValue(":plancode_mpsexplosion", "M"); } else plannerSave.bindValue(":plancode_mpsexplosion", "N"); plannerSave.exec(); done(_plancodeid); } void plannerCode::populate() { XSqlQuery plannerpopulate; plannerpopulate.prepare( "SELECT * " "FROM plancode " "WHERE (plancode_id=:plancode_id);" ); plannerpopulate.bindValue(":plancode_id", _plancodeid); plannerpopulate.exec(); if (plannerpopulate.first()) { _code->setText(plannerpopulate.value("plancode_code")); _description->setText(plannerpopulate.value("plancode_name")); _mrpexcpResched->setChecked(plannerpopulate.value("plancode_mrpexcp_resched").toBool()); _mrpexcpDelete->setChecked(plannerpopulate.value("plancode_mrpexcp_delete").toBool()); if (plannerpopulate.value("plancode_mpsexplosion").toString() == "N") _autoExplode->setChecked(FALSE); else { _autoExplode->setChecked(TRUE); if (plannerpopulate.value("plancode_mpsexplosion").toString() == "S") _singleLevel->setChecked(TRUE); else if (plannerpopulate.value("plancode_mpsexplosion").toString() == "M") _multipleLevel->setChecked(TRUE); } } } qt-client-4.1.0/guiclient/plannerCode.h000066400000000000000000000020631217451700100200010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PLANNERCODE_H #define PLANNERCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_plannerCode.h" class plannerCode : public XDialog, public Ui::plannerCode { Q_OBJECT public: plannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~plannerCode(); virtual void populate(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool sCheck(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _plancodeid; }; #endif // PLANNERCODE_H qt-client-4.1.0/guiclient/plannerCode.ui000066400000000000000000000152011217451700100201650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. plannerCode 0 0 497 258 Planner Code 7 5 10 10 C&ode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Reschedule Unreleased Supply Orders per MRP Exceptions Delete Unreleased Supply Orders per MRP Exceptions Automatically Explode Planned Orders Qt::Horizontal QSizePolicy::Preferred 20 16 false Single Level Explosion true Multiple Level Explosion Qt::Horizontal QSizePolicy::Expanding 31 10 Qt::Vertical QSizePolicy::Expanding 16 16 5 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit
    xlineedit.h
    1
    _code _description _mrpexcpResched _mrpexcpDelete _autoExplode _singleLevel _multipleLevel _buttonBox parameter.h
    qt-client-4.1.0/guiclient/plannerCodes.cpp000066400000000000000000000100161217451700100205140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "plannerCodes.h" #include #include //#include #include #include #include "plannerCode.h" #include "guiclient.h" /* * Constructs a plannerCodes as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ plannerCodes::plannerCodes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); // statusBar()->hide(); _plancode->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "plancode_code" ); _plancode->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "plancode_name" ); if (_privileges->check("MaintainPlannerCodes")) { connect(_plancode, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_plancode, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_plancode, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_plancode, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(); } /* * Destroys the object and frees any allocated resources */ plannerCodes::~plannerCodes() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void plannerCodes::languageChange() { retranslateUi(this); } void plannerCodes::sDelete() { XSqlQuery plannerDelete; plannerDelete.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE (itemsite_plancode_id=:plancode_id);" ); plannerDelete.bindValue(":plancode_id", _plancode->id()); plannerDelete.exec(); if (plannerDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Planner Code"), tr( "The selected Planner Code cannot be deleted as there are one or more Item Sites currently assigned to it.\n" "You must reassign these Item Sites before you may delete the selected Planner Code." ) ); return; } plannerDelete.prepare( "DELETE FROM plancode " "WHERE (plancode_id=:plancode_id);" ); plannerDelete.bindValue(":plancode_id", _plancode->id()); plannerDelete.exec(); sFillList(); } void plannerCodes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("plancode_id", _plancode->id()); plannerCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void plannerCodes::sView() { ParameterList params; params.append("mode", "view"); params.append("plancode_id", _plancode->id()); plannerCode newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void plannerCodes::sFillList() { _plancode->populate( "SELECT plancode_id, plancode_code, plancode_name " "FROM plancode " "ORDER BY plancode_code;" ); } void plannerCodes::sNew() { ParameterList params; params.append("mode", "new"); plannerCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void plannerCodes::sPrint() { orReport report("PlannerCodeMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/plannerCodes.h000066400000000000000000000017451217451700100201720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PLANNERCODES_H #define PLANNERCODES_H #include "xwidget.h" #include "ui_plannerCodes.h" class plannerCodes : public XWidget, public Ui::plannerCodes { Q_OBJECT public: plannerCodes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~plannerCodes(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // PLANNERCODES_H qt-client-4.1.0/guiclient/plannerCodes.ui000066400000000000000000000110611217451700100203500ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. plannerCodes 0 0 600 400 List Planner Codes 0 Planner Codes: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _plancode _new _edit _view _delete _print _close _plancode valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() plannerCodes close() 20 20 20 20
    qt-client-4.1.0/guiclient/pluginmanager_p.h000066400000000000000000000116171217451700100207240ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain ** additional rights. These rights are described in the Nokia Qt LGPL ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this ** package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef PLUGINMANAGER_H #define PLUGINMANAGER_H #include "shared_global_p.h" #include #include #include QT_BEGIN_NAMESPACE class QDesignerFormEditorInterface; class QDesignerCustomWidgetInterface; class QDesignerPluginManagerPrivate; class QDesignerCustomWidgetSharedData; /* Information contained in the Dom XML of a custom widget. */ class QDESIGNER_SHARED_EXPORT QDesignerCustomWidgetData { public: explicit QDesignerCustomWidgetData(const QString &pluginPath = QString()); enum ParseResult { ParseOk, ParseWarning, ParseError }; ParseResult parseXml(const QString &xml, const QString &name, QString *errorMessage); QDesignerCustomWidgetData(const QDesignerCustomWidgetData&); QDesignerCustomWidgetData& operator=(const QDesignerCustomWidgetData&); ~QDesignerCustomWidgetData(); bool isNull() const; QString pluginPath() const; // Data as parsed from the widget's domXML(). QString xmlClassName() const; // Optional. The language the plugin is supposed to be used with. QString xmlLanguage() const; // Optional. method used to add pages to a container with a container extension QString xmlAddPageMethod() const; // Optional. Base class QString xmlExtends() const; // Optional. The name to be used in the widget box. QString xmlDisplayName() const; private: QSharedDataPointer m_d; }; class QDESIGNER_SHARED_EXPORT QDesignerPluginManager: public QObject { Q_OBJECT public: typedef QList CustomWidgetList; explicit QDesignerPluginManager(QDesignerFormEditorInterface *core); virtual ~QDesignerPluginManager(); QDesignerFormEditorInterface *core() const; QObject *instance(const QString &plugin) const; QStringList registeredPlugins() const; QStringList findPlugins(const QString &path); QStringList pluginPaths() const; void setPluginPaths(const QStringList &plugin_paths); QStringList disabledPlugins() const; void setDisabledPlugins(const QStringList &disabled_plugins); QStringList failedPlugins() const; QString failureReason(const QString &pluginName) const; QObjectList instances() const; CustomWidgetList registeredCustomWidgets() const; QDesignerCustomWidgetData customWidgetData(QDesignerCustomWidgetInterface *w) const; bool registerNewPlugins(); public slots: bool syncSettings(); void ensureInitialized(); private: void updateRegisteredPlugins(); void registerPath(const QString &path); void registerPlugin(const QString &plugin); private: static QStringList defaultPluginPaths(); QDesignerPluginManagerPrivate *m_d; }; QT_END_NAMESPACE #endif // PLUGINMANAGER_H qt-client-4.1.0/guiclient/poLiabilityDistrib.cpp000066400000000000000000000067651217451700100217210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "poLiabilityDistrib.h" #include #include #include #include /* * Constructs a poLiabilityDistrib as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ poLiabilityDistrib::poLiabilityDistrib(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _account->setType(GLCluster::cRevenue | GLCluster::cExpense | GLCluster::cAsset | GLCluster::cLiability); // signals and slots connections connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); } /* * Destroys the object and frees any allocated resources */ poLiabilityDistrib::~poLiabilityDistrib() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void poLiabilityDistrib::languageChange() { retranslateUi(this); } enum SetResponse poLiabilityDistrib::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("recv_id", &valid); if (valid) { _recvid = param.toInt(); populate(); } return NoError; } void poLiabilityDistrib::populate() { XSqlQuery popopulate; popopulate.prepare( "SELECT recv_value " "FROM recv " "WHERE (recv_id=:recv_id);" ) ; popopulate.bindValue(":recv_id", _recvid); popopulate.exec(); if (popopulate.first()) { _amount->setLocalValue(popopulate.value("recv_value").toDouble()); } } void poLiabilityDistrib::sPost() { XSqlQuery poPost; if (!_account->isValid()) { QMessageBox::warning( this, tr("Select Account"), tr("You must select an Account to post the P/O Liability Distribution to.") ); _account->setFocus(); return; } poPost.prepare( "SELECT insertGLTransaction( 'G/L', 'PO', pohead_number, 'Qty. ' || formatqty(recv_qty) || ' for ' || COALESCE(item_number,poitem_vend_item_number) || ' marked as invoiced'," " :creditAccntid, COALESCE(costcat_liability_accnt_id,expcat_liability_accnt_id) ,-1, :amount, current_date ) AS result" " FROM recv, pohead, poitem " " LEFT OUTER JOIN expcat ON (poitem_expcat_id=expcat_id) " " LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id) " " LEFT OUTER JOIN costcat ON (itemsite_costcat_id=costcat_id) " " LEFT OUTER JOIN item ON (itemsite_item_id=item_id) " " WHERE ( (recv_id=:recv_id) " " AND (poitem_id=recv_orderitem_id) " " AND (pohead_id=poitem_pohead_id) );" ); poPost.bindValue(":creditAccntid", _account->id()); poPost.bindValue(":amount", _amount->baseValue()); poPost.bindValue(":recv_id", _recvid); poPost.exec(); if (!poPost.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } done(_recvid); } qt-client-4.1.0/guiclient/poLiabilityDistrib.h000066400000000000000000000020741217451700100213530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POLIABILITYDISTRIB_H #define POLIABILITYDISTRIB_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_poLiabilityDistrib.h" class poLiabilityDistrib : public XDialog, public Ui::poLiabilityDistrib { Q_OBJECT public: poLiabilityDistrib(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~poLiabilityDistrib(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sPost(); protected slots: virtual void languageChange(); private: int _recvid; }; #endif // POLIABILITYDISTRIB_H qt-client-4.1.0/guiclient/poLiabilityDistrib.ui000066400000000000000000000140241217451700100215370ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. poLiabilityDistrib 0 0 574 128 P/O Liability Distribution 9 6 0 6 9 6 Account: 0 6 Amount to Distribute: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing false 1 13 0 0 100 0 100 0 Qt::Horizontal QSizePolicy::Expanding 171 20 Qt::Vertical 441 16 0 0 0 5 &Cancel &Post true Qt::Vertical QSizePolicy::Expanding 20 0 GLCluster QWidget
    glcluster.h
    CurrCluster QWidget
    currcluster.h
    1
    _account _post _close _close clicked() poLiabilityDistrib reject() 519 31 20 20
    qt-client-4.1.0/guiclient/poitemTableModel.cpp000066400000000000000000000365241217451700100213410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ // TODO: drag/drop support? #include "poitemTableModel.h" #include #include #include #include #include #include "guiclient.h" #include "currcluster.h" PoitemTableModel::PoitemTableModel(QObject * parent, QSqlDatabase db) : QSqlRelationalTableModel(parent, db) { setTable("poitem"); // select statement on which everything else is based _selectStatement = QString("SELECT pohead_number, " " item_id, item_number," " warehous_id, warehous_code," " poitem_unitprice * poitem_qty_ordered AS extprice," " prj_number," " expcat_code," " 0 AS itemsrc_minordqty, 0 AS itemsrc_multordqty, " " 1 AS itemsrc_invvendoruomratio," " CURRENT_DATE AS earliestdate, " " poitem.* " "FROM pohead" " JOIN poitem ON (poitem_pohead_id=pohead_id)" " LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id)" " LEFT OUTER JOIN item ON (itemsite_item_id=item_id)" " LEFT OUTER JOIN whsinfo ON (itemsite_warehous_id=warehous_id)" " LEFT OUTER JOIN prj ON (poitem_prj_id=prj_id)" " LEFT OUTER JOIN expcat ON (poitem_expcat_id=expcat_id)" ); setEditStrategy(QSqlTableModel::OnManualSubmit); // OnRow? setSort(POITEM_LINENUMBER_COL, Qt::AscendingOrder); // insert only those columns not directly part of the poitem table insertColumns(0, 7); setHeaderData(POITEM_LINENUMBER_COL, Qt::Horizontal, tr("#")); setHeaderData(ITEM_NUMBER_COL, Qt::Horizontal, tr("Item")); setHeaderData(WAREHOUS_CODE_COL, Qt::Horizontal, tr("Supplying Site")); setHeaderData(POITEM_VEND_ITEM_NUMBER_COL, Qt::Horizontal, tr("Vend Item #")); setHeaderData(POITEM_VEND_ITEM_DESCRIP_COL,Qt::Horizontal, tr("Vend Description")); setHeaderData(POITEM_VEND_UOM_COL, Qt::Horizontal, tr("Vend UOM")); setHeaderData(POITEM_QTY_ORDERED_COL, Qt::Horizontal, tr("Qty.")); setHeaderData(POITEM_UNITPRICE_COL, Qt::Horizontal, tr("Unit Price")); setHeaderData(EXTPRICE_COL, Qt::Horizontal, tr("Ext. Price")); setHeaderData(POITEM_FREIGHT_COL, Qt::Horizontal, tr("Freight")); setHeaderData(POITEM_DUEDATE_COL, Qt::Horizontal, tr("Due Date")); setHeaderData(PRJ_NUMBER_COL, Qt::Horizontal, tr("Project #")); setHeaderData(EXPCAT_CODE_COL, Qt::Horizontal, tr("Expense Cat.")); _poheadid = -1; _poitemid = -1; findHeadData(); _dirty = false; select(); connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(markDirty(QModelIndex, QModelIndex))); } void PoitemTableModel::findHeadData() { _poheadcurrid = CurrDisplay::baseId(); _poheaddate = QDate(); _postatus = "U"; // safest default _vendid = -1; _vendrestrictpurch = false; XSqlQuery poheadq; XSqlQuery vendq; if (_poheadid > 0) { poheadq.prepare("SELECT pohead_id, pohead_curr_id, pohead_orderdate," " pohead_status " "FROM pohead " "WHERE (pohead_id=:pohead_id);"); poheadq.bindValue(":pohead_id", _poheadid); vendq.prepare("SELECT vend_id, vend_restrictpurch " "FROM vendinfo, pohead " "WHERE ((vend_id=pohead_vend_id)" " AND (pohead_id=:id));"); vendq.bindValue(":id", _poheadid); } else if (_poitemid > 0) { poheadq.prepare("SELECT pohead_id, pohead_curr_id, pohead_orderdate," " pohead_status " "FROM pohead " "WHERE pohead_id IN (SELECT poitem_pohead_id " " FROM poitem WHERE poitem_id=:poitem_id);"); poheadq.bindValue(":poitem_id", _poitemid); vendq.prepare("SELECT vend_id, vend_restrictpurch " "FROM vendinfo, pohead, poitem " "WHERE ((vend_id=pohead_vend_id)" " AND (pohead_id=poitem_pohead_id)" " AND (poitem_id=:id));"); vendq.bindValue(":id", _poitemid); } else if (_poitemid <= 0 && _poheadid <= 0) return; poheadq.exec(); if (poheadq.first()) { _poheadcurrid = poheadq.value("pohead_curr_id").toInt(); _poheaddate = poheadq.value("pohead_orderdate").toDate(); _postatus = poheadq.value("pohead_status").toString(); } else if (poheadq.lastError().type() != QSqlError::NoError) { systemError(0, poheadq.lastError().databaseText(), __FILE__, __LINE__); return; } vendq.exec(); if (vendq.first()) { _vendid = vendq.value("vend_id").toInt(); _vendrestrictpurch = vendq.value("vend_restrictpurch").toBool(); } else if (vendq.lastError().type() != QSqlError::NoError) { systemError(0, vendq.lastError().databaseText(), __FILE__, __LINE__); return; } } void PoitemTableModel::setHeadId(const int pId) { setFilter(QString("poitem_pohead_id=%1").arg(pId)); _poheadid = pId; _poitemid = -1; findHeadData(); } void PoitemTableModel::setItemId(const int pId) { setFilter(QString("poitem_id=%1").arg(pId)); _poheadid = -1; _poitemid = pId; findHeadData(); } void PoitemTableModel::setTransDate(const QDate pDate) { _poheaddate = pDate; } void PoitemTableModel::setCurrId(const int pId) { _poheadcurrid = pId; } QString PoitemTableModel::selectStatement() const { QString strFilter = filter(); if(strFilter.isEmpty()) strFilter = "poitem_pohead_id=-1"; return _selectStatement + " WHERE " + strFilter + " ORDER BY poitem_linenumber" ; } bool PoitemTableModel::select() { bool returnVal = QSqlRelationalTableModel::select(); if (returnVal) { insertRow(rowCount()); _dirty = false; connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(markDirty(QModelIndex, QModelIndex))); } return returnVal; } bool PoitemTableModel::submitAll() { XSqlQuery begin("BEGIN;"); bool returnVal = QSqlRelationalTableModel::submitAll(); if (returnVal) { _dirty = false; XSqlQuery commit("COMMIT;"); } else { XSqlQuery rollback("ROLLBACK;"); systemError(0, lastError().databaseText(), __FILE__, __LINE__); return returnVal; } select(); return returnVal; } Qt::ItemFlags PoitemTableModel::flags(const QModelIndex& index) const { Qt::ItemFlags flags = QSqlRelationalTableModel::flags(index); if (index.column() == POITEM_VEND_UOM_COL || index.column() == EXTPRICE_COL) flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled); return flags; } bool PoitemTableModel::isDirty() const { return _dirty; } bool PoitemTableModel::removeRow(int row, const QModelIndex & parent) { return QSqlRelationalTableModel::removeRow(row, parent); } /* Make sure the row is internally consistent. If so then fix it so the parent class has a valid row to insert (some of the SELECTed columns shouldn't be directly modified in the db 'cause they're not part of the model's current table). */ bool PoitemTableModel::validRow(QSqlRecord& record) { QString errormsg; QString warningmsg; // TODO: what is a better way to decide if this is an inventory item or not? bool inventoryItem = ! record.value("item_number").toString().isEmpty(); if (! inventoryItem && record.value("poitem_expcat_id").toInt() < 0) errormsg = tr("

    You must specify an Expense Category for this " "non-Inventory Item before you may save it."); else if (inventoryItem && record.value("item_number").toString().isEmpty()) errormsg = tr("

    You must select an Item Number before you may save."); else if (inventoryItem && record.value("warehous_id").toInt() <= 0 && (_metrics->boolean("MultiWhs"))) errormsg = tr("

    You must select a Supplying Site before you may save."); else if (record.value("poitem_qty_ordered").toDouble() <= 0) errormsg = tr("

    You must enter a quantity before you may save this " "Purchase Order Item."); else if (record.value("itemsrc_minordqty").toDouble() > 0 && record.value("poitem_qty_ordered").toDouble() < record.value("itemsrc_minordqty").toDouble()) warningmsg = tr("

    The quantity that you are ordering is below the " "Minimum Order Quantity for this Item Source. You may " "continue but this Vendor may not honor pricing or " "delivery quotations. "); else if (record.value("itemsrc_multordqty").toDouble() > 0 && record.value("poitem_qty_ordered").toInt() % (int)(record.value("itemsrc_multordqty").toDouble())) warningmsg = tr("

    The quantity that you are ordering does not fall " "within the Order Multiple for this Item Source. You may " "continue but this Vendor may not honor pricing or " "delivery quotations."); else if (! record.value("poitem_duedate").toDate().isValid()) errormsg = tr("

    You must enter a due date."); else if (record.value("earliestDate").toDate().isValid() && record.value("poitem_duedate").toDate() < record.value("earliestDate").toDate()) warningmsg = tr("

    The Due Date that you are requesting does not fall " "within the Lead Time Days for this Item Source. You may " "continue but this Vendor may not honor pricing or " "delivery quotations or may not be able to deliver by the " "requested Due Date."); else if (record.value("poitem_pohead_id").toInt() <= 0 && _poheadid <= 0) errormsg = tr("

    There is no Purchase Order header yet. " "Try entering a Vendor if you are using the Purchase Order " "window."); else if (inventoryItem && record.value("item_id").toInt() > 0 && record.value("warehous_id").toInt() > 0) { XSqlQuery isq; isq.prepare("SELECT itemsite_id, item_id " "FROM itemsite, item " "WHERE ((itemsite_item_id=item_id)" " AND (itemsite_warehous_id=:whs_id)" " AND (item_id=:item_id));"); isq.bindValue(":whs_id", record.value("warehous_id").toInt()); isq.bindValue(":item_id", record.value("item_id").toInt()); isq.exec(); if (isq.first()) { int itemsiteid = isq.value("itemsite_id").toInt(); if (itemsiteid != record.value("poitem_itemsite_id").toInt()) record.setValue("poitem_itemsite_id", itemsiteid); } else if (isq.lastError().type() != QSqlError::NoError) errormsg = isq.lastError().databaseText(); else errormsg = tr("

    There is no Item Site for this Site (%1) and " "Item Number (%2).") .arg(record.value("warehous_code").toInt()) .arg(record.value("item_number").toString()); } int index = record.indexOf("poitem_pohead_id"); //returns 14, based on #define value in header, fixes problem with poitem_pohead_id not being assigned if (index > 0) { QSqlField field("poitem_pohead_id", QVariant::Int); field.setValue(_poheadid); record.append(field); } else record.setValue(index, _poheadid); XSqlQuery ln; /* ln.prepare("SELECT MAX(poitem_linenumber) + 1 AS newln " "FROM poitem " "WHERE (poitem_pohead_id=:pohead_id);"); */ // get the smallest available line number ln.prepare("SELECT MIN(sequence_value) AS newln " "FROM sequence " "WHERE sequence_value NOT IN (SELECT poitem_linenumber " " FROM poitem" " WHERE (poitem_pohead_id=:pohead_id));"); ln.bindValue(":pohead_id", _poheadid); if (record.indexOf("poitem_linenumber") < 0) { ln.exec(); if (ln.first()) { QSqlField field("poitem_linenumber", QVariant::Int); field.setValue(ln.value("newln")); record.append(field); } else if (ln.lastError().type() != QSqlError::NoError) { errormsg = ln.lastError().databaseText(); } } else if (record.value("poitem_linenumber").toInt() <= 0) { ln.exec(); if (ln.first()) record.setValue("poitem_linenumber", ln.value("newln")); else if (ln.lastError().type() != QSqlError::NoError) { errormsg = ln.lastError().databaseText(); } } if (record.value("poitem_id").isNull()) { XSqlQuery idq("SELECT NEXTVAL('poitem_poitem_id_seq') AS poitem_id;"); if (idq.first()) record.setValue("poitem_id", idq.value("poitem_id")); else { errormsg = idq.lastError().databaseText(); } } if (_postatus.isEmpty()) findHeadData(); index = record.indexOf("poitem_status"); if (index < 0) { QSqlField field("poitem_status", QVariant::String); field.setValue(_postatus); record.append(field); } else if (record.field(index).value().toString().isEmpty()) record.setValue(index, _postatus); if (record.field("poitem_invvenduomratio").value().isNull() && record.field("itemsrc_invvendoruomratio").value().isNull()) record.setValue("poitem_invvenduomratio", 1); else if (record.field("poitem_invvenduomratio").value().isNull()) record.setValue("poitem_invvenduomratio", record.value("itemsrc_invvendoruomratio")); if (! errormsg.isEmpty()) { setLastError(QSqlError(QString("PoitemTableModel::validRow() error"), errormsg, QSqlError::UnknownError)); return false; } else if (! warningmsg.isEmpty()) { if (QMessageBox::question(0, tr("Are you sure you want to continue?"), warningmsg + tr("

    Do you wish to Save this Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return false; } record.remove(record.indexOf("earliestdate")); record.remove(record.indexOf("itemsrc_invvendoruomratio")); record.remove(record.indexOf("itemsrc_multordqty")); record.remove(record.indexOf("itemsrc_minordqty")); record.remove(record.indexOf("expcat_code")); record.remove(record.indexOf("prj_number")); record.remove(record.indexOf("extprice")); record.remove(record.indexOf("warehous_code")); record.remove(record.indexOf("warehous_id")); record.remove(record.indexOf("item_number")); record.remove(record.indexOf("item_id")); record.remove(record.indexOf("pohead_number")); return true; } bool PoitemTableModel::insertRowIntoTable(const QSqlRecord& record) { if (record.isEmpty()) return true; bool isNull = true; for (int i = 0; i < record.count(); i++) { if (i == record.indexOf("poitem_pohead_id") || (record.value(i).toString().isEmpty() && (i == record.indexOf("poitem_status") || i == record.indexOf("poitem_vend_item_descrip") || i == record.indexOf("poitem_vend_uom") || i == record.indexOf("poitem_vend_item_number") || i == record.indexOf("poitem_comments") ))) continue; isNull &= record.isNull(i); } if (isNull) return true; QSqlRecord newRecord(record); if (! validRow(newRecord)) return false; return QSqlRelationalTableModel::insertRowIntoTable(newRecord); } bool PoitemTableModel::updateRowInTable(int row, const QSqlRecord& record) { // touch everything so we can distinguish unchanged fields from NULL/0 as new val for (int i = 0; i < columnCount(); i++) setData(index(row, i), data(index(row, i))); QSqlRecord newRecord(record); if (! validRow(newRecord)) return false; return QSqlRelationalTableModel::updateRowInTable(row, newRecord); } void PoitemTableModel::markDirty(QModelIndex, QModelIndex) { _dirty = true; disconnect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(markDirty(QModelIndex, QModelIndex))); } qt-client-4.1.0/guiclient/poitemTableModel.h000066400000000000000000000100051217451700100207700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POITEMTABLEMODEL_H #define POITEMTABLEMODEL_H #include #include #include #include #include #include #include /* Represent as a Table Model either the entire POITEM table, the POITEMS for a single POHEAD_ID, or a single POITEM row. This should probably be written as a an XAbstractTableModel that includes xTuple-generic concepts and PoitemTableModel as a subclass of that abstract class but we don't yet know what all of those abstractions should be. */ // these #defines have to match the order of fields in the select statement #define POHEAD_NUMBER 0 #define ITEM_ID_COL 1 #define ITEM_NUMBER_COL 2 #define WAREHOUS_ID_COL 3 #define WAREHOUS_CODE_COL 4 #define EXTPRICE_COL 5 #define PRJ_NUMBER_COL 6 #define EXPCAT_CODE_COL 7 #define ITEMSRC_MINORDQTY_COL 8 #define ITEMSRC_MULTORDQTY_COL 9 #define ITEMSRC_INVVENDORUOMRATIO_COL 10 #define EARLIESTDATE_COL 11 #define POITEM_ID_COL 12 #define POITEM_STATUS_COL 13 #define POITEM_POHEAD_ID_COL 14 #define POITEM_LINENUMBER_COL 15 #define POITEM_DUEDATE_COL 16 #define POITEM_ITEMSITE_ID_COL 17 #define POITEM_VEND_ITEM_DESCRIP_COL 18 #define POITEM_VEND_UOM_COL 19 #define POITEM_INVVENDUOMRATIO_COL 20 #define POITEM_QTY_ORDERED_COL 21 #define POITEM_QTY_RECEIVED_COL 22 #define POITEM_QTY_RETURNED_COL 23 #define POITEM_QTY_VOUCHERED_COL 24 #define POITEM_UNITPRICE_COL 25 #define POITEM_VEND_ITEM_NUMBER_COL 26 #define POITEM_COMMENTS_COL 27 #define POITEM_QTY_TORECEIVE_COL 28 #define POITEM_EXPCAT_ID_COL 29 #define POITEM_ITEMSRC_ID_COL 30 #define POITEM_FREIGHT_COL 31 #define POITEM_FREIGHT_RECEIVED_COL 32 #define POITEM_FREIGHT_VOUCHERED_COL 33 #define POITEM_PRJ_ID_COL 34 #define POITEM_STDCOST_COL 35 #define POITEM_BOM_REV_ID_COL 36 #define POITEM_BOO_REV_ID_COL 37 #define POITEM_MANUF_NAME_COL 38 #define POITEM_MANUF_ITEM_NUMBER_COL 39 #define POITEM_MANUF_ITEM_DESCRIP_COL 40 #define POITEM_TAXTYPE_ID_COL 41 #define POITEM_TAX_RECOVERABLE_COL 42 #define POITEM_RLSD_DUEDATE_COL 43 #define POITEM_ORDER_ID_COL 44 #define POITEM_ORDER_TYPE_COL 45 class PoitemTableModel : public QSqlRelationalTableModel { Q_OBJECT public: PoitemTableModel(QObject * parent = 0, QSqlDatabase = QSqlDatabase()); virtual Qt::ItemFlags flags (const QModelIndex &) const; inline virtual int currId() const {return _poheadcurrid; }; inline virtual int headId() const { return _poheadid; }; inline virtual int itemId() const { return _poitemid; }; virtual bool isDirty() const; virtual bool removeRow(int, const QModelIndex & = QModelIndex()); inline virtual QDate transDate() const {return _poheaddate; }; int _vendid; bool _vendrestrictpurch; public slots: virtual bool select(); virtual void setCurrId(const int pId = -1); virtual void setHeadId(const int pId = -1); virtual void setItemId(const int pId = -1); virtual void setTransDate(const QDate); virtual bool submitAll(); protected: virtual bool insertRowIntoTable(const QSqlRecord&); virtual QString selectStatement() const; virtual bool updateRowInTable(int, const QSqlRecord&); virtual bool validRow(QSqlRecord&); QString _selectStatement; protected slots: virtual void markDirty(QModelIndex, QModelIndex); private: void findHeadData(); bool _dirty; int _poheadcurrid; QDate _poheaddate; int _poheadid; int _poitemid; QString _postatus; }; #endif // POITEMTABLEMODEL_H qt-client-4.1.0/guiclient/poitemTableView.cpp000066400000000000000000000610671217451700100212130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* TODO: return to the editor if validation fails TODO: refactor: move some of the logic from PoitemTableDelegate::setModelData() into poitemTableModel move PoitemTableDelegate into a separate file and split into PoitemDelegate and subclass it to PoitemTableDelegate rewrite purchaseOrderItem to use PoitemDelegate */ #include "poitemTableView.h" #include #include #include #include #include #include "guiclient.h" #include "datecluster.h" #include "expensecluster.h" #include "itemcluster.h" #include "poitemTableModel.h" #include "projectcluster.h" #include "wcombobox.h" #include "xtreewidget.h" // for column widths #include "itemSourceSearch.h" #define QE_NONINVENTORY #define DEBUG false PoitemTableView::PoitemTableView(QWidget* parent) : QTableView(parent) { XSqlQuery PoitemetModelData; PoitemTableDelegate *delegate = new PoitemTableDelegate(this); setItemDelegate(delegate); setShowGrid(false); #ifdef Q_WS_MAC QFont f = font(); f.setPointSize(f.pointSize() - 2); setFont(f); #endif } void PoitemTableView::closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint) { if (DEBUG) qDebug("PoitemTableView::closeEditor(%p, %d)", editor, hint); QTableView::closeEditor(editor, hint); if (editor->objectName() == "poitem_duedate" && hint == QAbstractItemDelegate::EditNextItem) { setCurrentIndex(model()->index(model()->rowCount() - 1, ITEM_NUMBER_COL)); } if (DEBUG) qDebug("PoitemTableView::closeEditor() returning with index %d, %d", currentIndex().column(), currentIndex().row()); } void PoitemTableView::setModel(QAbstractItemModel* model) { if (DEBUG) qDebug("PoitemTableView::setModel(%p)", model); QTableView::setModel(model); setColumnWidth(ITEM_NUMBER_COL, _itemColumn); setColumnWidth(WAREHOUS_CODE_COL, 100); //_whsColumn too small setColumnWidth(POITEM_VEND_ITEM_DESCRIP_COL, 200); setColumnWidth(POITEM_QTY_ORDERED_COL, _qtyColumn); setColumnWidth(POITEM_UNITPRICE_COL, _priceColumn); setColumnWidth(EXTPRICE_COL, _moneyColumn); setColumnWidth(POITEM_FREIGHT_COL, _priceColumn); setColumnWidth(POITEM_DUEDATE_COL, _dateColumn); #ifdef QE_NONINVENTORY setColumnWidth(EXPCAT_CODE_COL, 100); #endif setColumnWidth(POITEM_VEND_ITEM_NUMBER_COL, _itemColumn); QHeaderView *header = horizontalHeader(); int dest = 0; header->moveSection(header->visualIndex(ITEM_NUMBER_COL), dest++); if (_metrics->boolean("MultiWhs")) { header->moveSection(header->visualIndex(WAREHOUS_CODE_COL), dest++); } header->moveSection(header->visualIndex(POITEM_VEND_ITEM_NUMBER_COL), dest++); header->moveSection(header->visualIndex(POITEM_VEND_ITEM_DESCRIP_COL), dest++); #ifdef QE_NONINVENTORY header->moveSection(header->visualIndex(EXPCAT_CODE_COL), dest++); #endif header->moveSection(header->visualIndex(POITEM_QTY_ORDERED_COL), dest++); header->moveSection(header->visualIndex(POITEM_UNITPRICE_COL), dest++); header->moveSection(header->visualIndex(EXTPRICE_COL), dest++); header->moveSection(header->visualIndex(POITEM_FREIGHT_COL), dest++); header->moveSection(header->visualIndex(POITEM_DUEDATE_COL), dest++); // if we didn't explicitly place the logical section, hide it for (int i = dest; i < header->count(); i++) header->hideSection(header->logicalIndex(i)); connect(model, SIGNAL(headerDataChanged(Qt::Orientation, int, int)), this, SLOT(sHeaderDataChanged(Qt::Orientation, int, int))); //header->setStretchLastSection(true); if (DEBUG) qDebug("PoitemTableView::setModel returning"); } void PoitemTableView::sHeaderDataChanged(Qt::Orientation porientation, int first, int last) { if (Qt::Vertical == porientation) { for (int i = first; i <= last; i++) if (model()->headerData(i, Qt::Vertical, Qt::DisplayRole) == "!") hideRow(i); } } void PoitemTableView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous ) { if (DEBUG) qDebug("PoitemTableView::currentChanged(current %d,%d prev %d,%d)", current.row(), current.column(), previous.row(), previous.column()); if (current != QModelIndex() && current != previous) { if (DEBUG) qDebug("PoitemTableView::currentChanged setting current"); setCurrentIndex(current); if (DEBUG) qDebug("PoitemTableView::currentChanged scrolling to current"); scrollTo(current); if (DEBUG) qDebug("PoitemTableView::currentChanged editing current"); edit(current); } if (DEBUG) qDebug("PoitemTableView::currentChanged returning"); } /////////////////////////////////////////////////////////////////////////// PoitemTableDelegate::PoitemTableDelegate(QObject *parent) : QItemDelegate(parent) { } QWidget *PoitemTableDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*style*/, const QModelIndex &index) const { const QAbstractItemModel *model = index.model(); QWidget *editor = 0; switch (index.column()) { case ITEM_NUMBER_COL: { ItemLineEdit *item = new ItemLineEdit(parent); item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured | ItemLineEdit::cActive); item->setDefaultType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cActive); if ((qobject_cast(model))->_vendrestrictpurch) { int vendid = (qobject_cast(model))->_vendid; // TODO: put queries in ItemLineEdit, trigger them with a setVendId() item->setQuery( QString("SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2," " uom_name, item_type, item_config " "FROM item, itemsite, itemsrc, uom " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsrc_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (itemsite_active)" " AND (item_active)" " AND (itemsrc_active)" " AND (itemsrc_vend_id=%1) ) " "ORDER BY item_number;" ) .arg(vendid) ); item->setValidationQuery( QString("SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2," " uom_name, item_type, item_config " "FROM item, itemsite, itemsrc, uom " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsrc_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (itemsite_active)" " AND (item_active)" " AND (itemsrc_active)" " AND (itemsrc_vend_id=%1) " " AND (itemsite_item_id=:item_id) ) " "ORDER BY item_number;" ) .arg(vendid) ); } editor = item; break; } case WAREHOUS_CODE_COL: { int itemid = model->data(model->index(index.row(), ITEM_ID_COL)).toInt(); if (itemid <= 0) // probably non-inventory item so don't pick a whs break; WComboBox *whs = new WComboBox(parent); whs->setType(WComboBox::Supply); whs->findItemsites(itemid); editor = whs; break; } case POITEM_VEND_ITEM_NUMBER_COL: { editor = new XLineEdit(parent); editor->setObjectName("poitem_vend_item_number"); break; } case POITEM_VEND_ITEM_DESCRIP_COL: { editor = new XLineEdit(parent); editor->setObjectName("poitem_vend_item_descrip"); break; } case POITEM_QTY_ORDERED_COL: { XLineEdit *qty = new XLineEdit(parent); qty->setValidator(omfgThis->qtyVal()); editor = qty; break; } case POITEM_UNITPRICE_COL: case POITEM_FREIGHT_COL: { XLineEdit *price = new XLineEdit(parent); price->setValidator(omfgThis->priceVal()); editor = price; break; } case POITEM_DUEDATE_COL: { XDateEdit *duedate = new XDateEdit(parent); duedate->setFocusPolicy(Qt::StrongFocus); editor = duedate; editor->setObjectName("poitem_duedate"); break; } #ifdef QE_NONINVENTORY case EXPCAT_CODE_COL: { ExpenseLineEdit *expcat = new ExpenseLineEdit(parent); editor = expcat; break; } #endif default: { editor = 0; break; } } if (editor) { #ifdef Q_WS_MAC // compensate for many custom widgets making themselves smaller on OS X QFont f = editor->font(); f.setPointSize(f.pointSize() + 2); editor->setFont(f); #endif editor->installEventFilter(const_cast(this)); if (DEBUG) qDebug("createEditor: editor has focus policy %d", editor->focusPolicy()); } return editor; } void PoitemTableDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { const QAbstractItemModel *model = index.model(); XLineEdit *lineedit = 0; switch (index.column()) { case ITEM_NUMBER_COL: { ItemLineEdit *item = static_cast(editor); if (model->data(model->index(index.row(), POITEM_ITEMSITE_ID_COL)).toInt() > 0) item->setItemsiteid(model->data(model->index(index.row(), POITEM_ITEMSITE_ID_COL)).toInt()); break; } case WAREHOUS_CODE_COL: { WComboBox *whs = static_cast(editor); whs->setId(model->data(model->index(index.row(), WAREHOUS_ID_COL)).toInt()); break; } case POITEM_VEND_ITEM_NUMBER_COL: lineedit = static_cast(editor); lineedit->setText(model->data(index).toString()); break; case POITEM_VEND_ITEM_DESCRIP_COL: lineedit = static_cast(editor); lineedit->setText(model->data(index).toString()); break; case POITEM_QTY_ORDERED_COL: case POITEM_UNITPRICE_COL: case POITEM_FREIGHT_COL: lineedit = static_cast(editor); lineedit->setDouble(model->data(index).toDouble()); break; case POITEM_DUEDATE_COL: { XDateEdit *duedate = static_cast(editor); duedate->setDate(index.data().toDate()); break; } #ifdef QE_NONINVENTORY case EXPCAT_CODE_COL: { ExpenseLineEdit *exp = static_cast(editor); exp->setId(model->data(model->index(index.row(), POITEM_EXPCAT_ID_COL)).toInt()); break; } #endif default: break; } } void PoitemTableDelegate::setModelData(QWidget *editor, QAbstractItemModel *pModel, const QModelIndex &index) const { XSqlQuery PoitemetModelData; if (DEBUG) qDebug("PoitemTableDelegate::setModelData() entered"); bool hitError = false; QVariant oldval = pModel->data(index); PoitemTableModel *model = static_cast(pModel); switch (index.column()) { case ITEM_NUMBER_COL: { ItemLineEdit *item = static_cast(editor); if (item->itemNumber() != oldval.toString()) { if (item->itemNumber().isEmpty()) { model->setData(index, QVariant()); model->setData(model->index(index.row(), ITEM_ID_COL), QVariant()); model->setData(model->index(index.row(), POITEM_ITEMSITE_ID_COL), QVariant()); model->setData(model->index(index.row(), WAREHOUS_ID_COL), QVariant()); model->setData(model->index(index.row(), WAREHOUS_CODE_COL), QVariant()); model->setData(model->index(index.row(), POITEM_ITEMSRC_ID_COL), QVariant()); model->setData(model->index(index.row(), POITEM_VEND_ITEM_NUMBER_COL), QVariant()); model->setData(model->index(index.row(), POITEM_VEND_ITEM_DESCRIP_COL), QVariant()); model->setData(model->index(index.row(), POITEM_VEND_UOM_COL), QVariant()); model->setData(model->index(index.row(), ITEMSRC_MINORDQTY_COL), QVariant()); model->setData(model->index(index.row(), ITEMSRC_MULTORDQTY_COL), QVariant()); model->setData(model->index(index.row(), ITEMSRC_INVVENDORUOMRATIO_COL), QVariant()); model->setData(model->index(index.row(), POITEM_INVVENDUOMRATIO_COL), QVariant()); model->setData(model->index(index.row(), EARLIESTDATE_COL), QVariant()); } else { model->setData(index, item->itemNumber()); model->setData(model->index(index.row(), ITEM_ID_COL), item->id()); if (item->isValid()) { XSqlQuery itemq; itemq.prepare("SELECT (warehous_id=:preferred) AS preferred, " " itemsite_id, warehous_id, warehous_code " "FROM itemsite, whsinfo " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=warehous_id)) " "ORDER BY preferred DESC, warehous_code " "LIMIT 1;"); itemq.bindValue(":item_id", item->id()); itemq.bindValue(":preferred", _x_preferences->value("PreferredWarehouse").toInt()); itemq.exec(); if (itemq.first()) { model->setData(model->index(index.row(), POITEM_ITEMSITE_ID_COL), itemq.value("itemsite_id").toInt()); model->setData(model->index(index.row(), WAREHOUS_ID_COL), itemq.value("warehous_id").toInt()); model->setData(model->index(index.row(), WAREHOUS_CODE_COL), itemq.value("warehous_code").toString()); } else if (itemq.lastError().type() != QSqlError::NoError) { systemError(0, itemq.lastError().databaseText(), __FILE__, __LINE__); hitError = true; break; } else { systemError(0, QString("Could not find Item Site for %1 (%2).") .arg(item->itemNumber()).arg(item->id())); hitError = true; break; } if (_metrics->boolean("RequireStdCostForPOItem")) { XSqlQuery stdcostq; stdcostq.prepare("SELECT stdCost(:item_id) AS result"); stdcostq.bindValue(":item_id", item->id()); stdcostq.exec(); if(stdcostq.first() && stdcostq.value("result").toDouble() == 0.0) { QMessageBox::critical(0, tr("Selected Item Missing Cost"), tr("

    The selected item has no Std. Costing information. " "Please see your controller to correct this situation " "before continuing.")); model->setData(index, QString()); model->setData(model->index(index.row(), POITEM_ITEMSITE_ID_COL), QVariant()); model->setData(model->index(index.row(), WAREHOUS_ID_COL), QVariant()); model->setData(model->index(index.row(), WAREHOUS_CODE_COL), QString()); model->setData(index, QString()); hitError = true; break; } else if (stdcostq.lastError().type() != QSqlError::NoError) { systemError(0, stdcostq.lastError().databaseText(), __FILE__, __LINE__); hitError = true; break; } } XSqlQuery itemsrcq; itemsrcq.prepare( "SELECT pohead_vend_id, itemsrc_id, itemsrc_vend_item_number," " itemsrc_vend_item_descrip, itemsrc_vend_uom," " itemsrc_minordqty," " itemsrc_multordqty," " itemsrc_invvendoruomratio," " itemsrc_manuf_name," " itemsrc_manuf_item_number," " itemsrc_manuf_item_descrip," " (CURRENT_DATE + itemsrc_leadtime) AS earliestdate " "FROM pohead, itemsrc " "WHERE ( (itemsrc_vend_id=pohead_vend_id)" " AND (itemsrc_item_id=:item_id)" " AND (pohead_id=:pohead_id) );" ); itemsrcq.bindValue(":item_id", item->id()); itemsrcq.bindValue(":pohead_id", model->headId()); itemsrcq.exec(); if (itemsrcq.size() > 1) { itemsrcq.first(); ParameterList params; params.append("vend_id", itemsrcq.value("pohead_vend_id").toInt()); params.append("search", item->itemNumber()); itemSourceSearch newdlg(0, "", true); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) { int itemsrcid = newdlg.itemsrcId(); if(itemsrcid != -1) { itemsrcq.prepare( "SELECT itemsrc_id, itemsrc_vend_item_number," " itemsrc_vend_item_descrip, itemsrc_vend_uom," " itemsrc_minordqty," " itemsrc_multordqty," " itemsrc_invvendoruomratio," " itemsrc_manuf_name," " itemsrc_manuf_item_number," " itemsrc_manuf_item_descrip," " (CURRENT_DATE + itemsrc_leadtime) AS earliestdate " "FROM pohead, itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); itemsrcq.bindValue(":itemsrc_id", itemsrcid); itemsrcq.exec(); } } else itemsrcq.clear(); } if (itemsrcq.first()) { model->setData(model->index(index.row(), POITEM_ITEMSRC_ID_COL), itemsrcq.value("itemsrc_id").toInt()); model->setData(model->index(index.row(), POITEM_VEND_ITEM_NUMBER_COL), itemsrcq.value("itemsrc_vend_item_number").toString()); model->setData(model->index(index.row(), POITEM_VEND_ITEM_DESCRIP_COL), itemsrcq.value("itemsrc_vend_item_descrip").toString()); model->setData(model->index(index.row(), POITEM_VEND_UOM_COL), itemsrcq.value("itemsrc_vend_uom").toString()); model->setData(model->index(index.row(), ITEMSRC_MINORDQTY_COL), itemsrcq.value("itemsrc_minordqty").toDouble()); model->setData(model->index(index.row(), ITEMSRC_MULTORDQTY_COL), itemsrcq.value("itemsrc_multordqty").toDouble()); model->setData(model->index(index.row(), ITEMSRC_INVVENDORUOMRATIO_COL), itemsrcq.value("itemsrc_invvendoruomratio").toDouble()); model->setData(model->index(index.row(), POITEM_INVVENDUOMRATIO_COL), itemsrcq.value("itemsrc_invvendoruomratio").toDouble()); model->setData(model->index(index.row(), POITEM_MANUF_NAME_COL), itemsrcq.value("itemsrc_manuf_name").toString()); model->setData(model->index(index.row(), POITEM_MANUF_ITEM_NUMBER_COL), itemsrcq.value("itemsrc_manuf_item_number").toString()); model->setData(model->index(index.row(), POITEM_MANUF_ITEM_DESCRIP_COL), itemsrcq.value("itemsrc_manuf_item_descrip").toString()); model->setData(model->index(index.row(), EARLIESTDATE_COL), itemsrcq.value("earliestdate").toDate()); if (_metrics->boolean("UseEarliestAvailDateOnPOItem")) model->setData(model->index(index.row(), POITEM_DUEDATE_COL), itemsrcq.value("earliestdate").toDate()); } else if (itemsrcq.lastError().type() != QSqlError::NoError) { systemError(0, itemsrcq.lastError().databaseText(), __FILE__, __LINE__); hitError = true; break; } } } } break; } case WAREHOUS_CODE_COL: { WComboBox *whs = static_cast(editor); if (whs->id() < 0) { model->setData(model->index(index.row(), WAREHOUS_ID_COL), QVariant()); model->setData(index, QVariant()); } else if (whs->id() != oldval.toInt()) { model->setData(model->index(index.row(), WAREHOUS_ID_COL), whs->id()); model->setData(index, whs->currentText()); if (whs->isValid()) { XSqlQuery itemq; itemq.prepare("SELECT itemsite_id " "FROM itemsite " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:whs_id)) " "LIMIT 1;"); itemq.bindValue(":item_id", model->index(index.row(), ITEM_ID_COL).data()); itemq.bindValue(":whs_id", whs->id()); itemq.exec(); if (itemq.first()) { model->setData(model->index(index.row(), POITEM_ITEMSITE_ID_COL), itemq.value("itemsite_id").toInt()); } else if (itemq.lastError().type() != QSqlError::NoError) { systemError(0, itemq.lastError().databaseText(), __FILE__, __LINE__); hitError = true; break; } else { systemError(0, QString("Could not find Item Site for %1 in %2.") .arg(model->index(index.row(), ITEM_NUMBER_COL).data().toString()) .arg(whs->currentText())); hitError = true; break; } } } break; } case POITEM_VEND_ITEM_DESCRIP_COL: { XLineEdit *lineedit = static_cast(editor); if (lineedit->text() != oldval.toString()) model->setData(index, lineedit->text()); break; } case POITEM_VEND_ITEM_NUMBER_COL: { XLineEdit *lineedit = static_cast(editor); if (lineedit->text() != oldval.toString()) model->setData(index, lineedit->text()); break; } case POITEM_FREIGHT_COL: { XLineEdit *lineedit = static_cast(editor); if (lineedit->toDouble() != oldval.toDouble()) model->setData(index, lineedit->toDouble()); break; } case POITEM_QTY_ORDERED_COL: { XLineEdit *lineedit = static_cast(editor); if (lineedit->text().isEmpty()) { model->setData(index, QVariant()); model->setData(model->index(index.row(), EXTPRICE_COL), QVariant()); break; } double qty = lineedit->toDouble(); if (qty != oldval.toDouble()) { model->setData(index, qty); if (model->data(model->index(index.row(), POITEM_QTY_ORDERED_COL)).toDouble() > 0 && model->data(model->index(index.row(), POITEM_ITEMSRC_ID_COL)).toInt() > 0) { PoitemetModelData.prepare( "SELECT ROUND(currToCurr(itemsrcp_curr_id, :curr_id, itemsrcp_price, :effective), :prec) " "AS new_itemsrcp_price " "FROM itemsrcp " "WHERE ( (itemsrcp_itemsrc_id=:itemsrc_id)" " AND (itemsrcp_qtybreak <= :qty) ) " "ORDER BY itemsrcp_qtybreak DESC " "LIMIT 1;" ); PoitemetModelData.bindValue(":itemsrc_id", model->data(model->index(index.row(), POITEM_ITEMSRC_ID_COL)).toInt()); PoitemetModelData.bindValue(":qty", model->data(model->index(index.row(), POITEM_QTY_ORDERED_COL)).toDouble()); PoitemetModelData.bindValue(":curr_id", model->currId()); PoitemetModelData.bindValue(":effective", model->transDate().toString()); PoitemetModelData.bindValue(":prec", omfgThis->priceVal()->decimals()); PoitemetModelData.exec(); if (PoitemetModelData.first()) { model->setData(model->index(index.row(), POITEM_UNITPRICE_COL), PoitemetModelData.value("new_itemsrcp_price").toDouble()); } else if (PoitemetModelData.lastError().type() != QSqlError::NoError) { systemError(0, PoitemetModelData.lastError().databaseText(), __FILE__, __LINE__); hitError = true; break; } else model->setData(model->index(index.row(), POITEM_UNITPRICE_COL), 0); } double prc = model->data(model->index(index.row(), POITEM_UNITPRICE_COL)).toDouble(); model->setData(model->index(index.row(), EXTPRICE_COL), (qty * prc)); } break; } case POITEM_UNITPRICE_COL: { XLineEdit *lineedit = static_cast(editor); if (lineedit->text().isEmpty()) { model->setData(index, QVariant()); model->setData(model->index(index.row(), EXTPRICE_COL), QVariant()); break; } double prc = lineedit->text().toDouble(); if (prc != oldval.toDouble()) { model->setData(index, prc); double qty = model->data(model->index(index.row(),POITEM_QTY_ORDERED_COL)).toDouble(); model->setData(model->index(index.row(), EXTPRICE_COL), (qty * prc)); } break; } case POITEM_DUEDATE_COL: { XDateEdit *duedate = static_cast(editor); duedate->parseDate(); if (duedate->date() != oldval.toDate()) { if (DEBUG) qDebug("PoitemTableDelegate::setModelData() setting duedate to %s with null %d, valid %d", qPrintable(duedate->date().toString()), duedate->isNull(), duedate->isValid()); model->setData(index, duedate->date()); } break; } #ifdef QE_NONINVENTORY case EXPCAT_CODE_COL: { ExpenseLineEdit *exp = static_cast(editor); if (exp->id() != oldval.toInt()) { model->setData(model->index(index.row(), POITEM_EXPCAT_ID_COL), exp->id()); model->setData(index, exp->text()); } break; } #endif default: break; } QTableView *view = qobject_cast(parent()); if (view) { if (hitError) view->setCurrentIndex(index); else if (index.row() >= (model->rowCount() - 1)) { QHeaderView* header = view->horizontalHeader(); if (header->visualIndex(index.column()) >= (header->count() - header->hiddenSectionCount() - 1)) { model->insertRow(model->rowCount()); } } } return; } void PoitemTableDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &) const { editor->setGeometry(option.rect); } qt-client-4.1.0/guiclient/poitemTableView.h000066400000000000000000000031221217451700100206440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POITEMTABLEVIEW_H #define POITEMTABLEVIEW_H #include #include #include #include // this has to be in the .h or MOC won't find it class PoitemTableDelegate : public QItemDelegate { Q_OBJECT public: PoitemTableDelegate(QObject *parent = 0); virtual QWidget *createEditor(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const; virtual void setEditorData(QWidget *, const QModelIndex &) const; virtual void setModelData(QWidget *, QAbstractItemModel *, const QModelIndex &) const; virtual void updateEditorGeometry(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const; }; class PoitemTableView : public QTableView { Q_OBJECT public: PoitemTableView(QWidget* = 0); virtual void setModel(QAbstractItemModel* model); public slots: virtual void sHeaderDataChanged(Qt::Orientation, int, int); protected slots: virtual void currentChanged(const QModelIndex &, const QModelIndex &) ; virtual void closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint); private: QList _hideList; }; #endif // POITEMTABLEVIEW_H qt-client-4.1.0/guiclient/postCashReceipts.cpp000066400000000000000000000121551217451700100213700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postCashReceipts.h" #include #include #include #include #include "errorReporter.h" #include "guiclient.h" postCashReceipts::postCashReceipts(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); } postCashReceipts::~postCashReceipts() { // no need to delete child widgets, Qt does it all for us } void postCashReceipts::languageChange() { retranslateUi(this); } void postCashReceipts::sPost() { XSqlQuery postPost; int journalNumber; postPost.exec("SELECT fetchJournalNumber('C/R') AS journalnumber;"); if (postPost.first()) journalNumber = postPost.value("journalnumber").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } postPost.exec( "SELECT cashrcpt_id, cust_number " "FROM cashrcpt, custinfo " "WHERE ( (NOT cashrcpt_posted)" " AND (NOT cashrcpt_void)" " AND (cashrcpt_cust_id=cust_id) );" ); if (postPost.first()) { int counter = 0; XSqlQuery post; post.prepare("SELECT postCashReceipt(:cashrcpt_id, :journalNumber) AS result;"); do { message( tr("Posting Cash Receipt #%1...") .arg(postPost.value("cust_number").toString()) ); post.bindValue(":cashrcpt_id", postPost.value("cashrcpt_id")); post.bindValue(":journalNumber", journalNumber); post.exec(); if (post.first()) { switch (post.value("result").toInt()) { case -1: QMessageBox::critical( this, tr("Cannot Post Cash Receipt"), tr( "The selected Cash Receipt cannot be posted as the amount distributed is greater than\n" "the amount received. You must correct this before you may post this Cash Receipt." ) ); break; case -5: QMessageBox::critical( this, tr("Cannot Post Cash Receipt"), tr( "A Cash Receipt for Customer #%1 cannot be posted as the A/R Account cannot be determined.\n" "You must make a A/R Account Assignment for the Customer Type to which this Customer\n" "is assigned for you may post this Cash Receipt." ) .arg(postPost.value("cust_number").toString()) ); break; case -6: QMessageBox::critical( this, tr("Cannot Post Cash Receipt"), tr( "A Cash Receipt for Customer #%1 cannot be posted as the Bank Account cannot be determined.\n" "You must make a Bank Account Assignment for this Cash Receipt before you may post it." ) .arg(postPost.value("cust_number").toString()) ); break; case -7: QMessageBox::critical( this, tr("Cannot Post Cash Receipt"), tr( "A Cash Receipt for Customer #%1 cannot be posted due to an unknown error.\n" "Contact you Systems Administrator." ) .arg(postPost.value("cust_number").toString()) ); default: counter++; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Posting"), post, __FILE__, __LINE__)) { break; } } while (postPost.next()); resetMessage(); if ( (counter) && (_printJournal->isChecked()) ) { ParameterList params; params.append("source", "A/R"); params.append("sourceLit", tr("A/R")); params.append("startJrnlnum", journalNumber); params.append("endJrnlnum", journalNumber); if (_metrics->boolean("UseJournals")) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); } orReport report("GLSeries", params); if (report.isValid()) report.print(); else report.reportError(this); } omfgThis->sCashReceiptsUpdated(-1, true); accept(); } else { QMessageBox::information( this, tr("No Unposted Cash Receipts"), tr("There are no unposted Cash Receipts to post.") ); } } qt-client-4.1.0/guiclient/postCashReceipts.h000066400000000000000000000015731217451700100210370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCASHRECEIPTS_H #define POSTCASHRECEIPTS_H #include "xdialog.h" #include "ui_postCashReceipts.h" class postCashReceipts : public XDialog, public Ui::postCashReceipts { Q_OBJECT public: postCashReceipts(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postCashReceipts(); protected slots: virtual void languageChange(); virtual void sPost(); }; #endif // POSTCASHRECEIPTS_H qt-client-4.1.0/guiclient/postCashReceipts.ui000066400000000000000000000122451217451700100212230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postCashReceipts 0 0 327 82 Post Cash Receipts 5 7 0 0 P&rint Journal true 20 20 Expanding Vertical 0 0 20 20 Expanding Horizontal 0 0 0 5 &Cancel &Post true 20 20 Expanding Vertical _printJournal _post _close parameter.h _close clicked() postCashReceipts close() qt-client-4.1.0/guiclient/postCheck.cpp000066400000000000000000000073341217451700100200330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postCheck.h" #include #include #include #include "storedProcErrorLookup.h" postCheck::postCheck(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sHandleBankAccount(int))); _captive = FALSE; _check->setAllowNull(TRUE); _bankaccnt->setType(XComboBox::APBankAccounts); } postCheck::~postCheck() { // no need to delete child widgets, Qt does it all for us } void postCheck::languageChange() { retranslateUi(this); } enum SetResponse postCheck::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("check_id", &valid); if (valid) { populate(param.toInt()); _bankaccnt->setEnabled(FALSE); _check->setEnabled(FALSE); } return NoError; } void postCheck::sPost() { XSqlQuery postPost; postPost.prepare( "SELECT checkhead_bankaccnt_id," " postCheck(checkhead_id, NULL) AS result " "FROM checkhead " "WHERE ((checkhead_id=:checkhead_id)" " AND (NOT checkhead_posted) );" ); postPost.bindValue(":checkhead_id", _check->id()); postPost.exec(); if (postPost.first()) { int result = postPost.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postCheck", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(postPost.value("checkhead_bankaccnt_id").toInt(), _check->id(), TRUE); if (_captive) accept(); else { sHandleBankAccount(_bankaccnt->id()); _close->setText(tr("&Close")); } } else if (postPost.lastError().type() != QSqlError::NoError) { systemError(this, postPost.lastError().databaseText(), __FILE__, __LINE__); return; } } void postCheck::sHandleBankAccount(int pBankaccntid) { XSqlQuery postHandleBankAccount; postHandleBankAccount.prepare( "SELECT checkhead_id," " (TEXT(checkhead_number) || '-' || checkrecip_name) " "FROM checkhead LEFT OUTER JOIN" " checkrecip ON ((checkhead_recip_id=checkrecip_id)" " AND (checkhead_recip_type=checkrecip_type))" "WHERE ((NOT checkhead_void)" " AND (NOT checkhead_posted)" " AND (checkhead_printed)" " AND (checkhead_bankaccnt_id=:bankaccnt_id) ) " "ORDER BY checkhead_number;" ); postHandleBankAccount.bindValue(":bankaccnt_id", pBankaccntid); postHandleBankAccount.exec(); _check->populate(postHandleBankAccount); _check->setNull(); } void postCheck::populate(int pcheckid) { XSqlQuery postpopulate; postpopulate.prepare( "SELECT checkhead_bankaccnt_id " "FROM checkhead " "WHERE (checkhead_id=:check_id);" ); postpopulate.bindValue(":check_id", pcheckid); postpopulate.exec(); if (postpopulate.first()) { _bankaccnt->setId(postpopulate.value("checkhead_bankaccnt_id").toInt()); _check->setId(pcheckid); } else if (postpopulate.lastError().type() != QSqlError::NoError) { systemError(this, postpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/postCheck.h000066400000000000000000000021011217451700100174630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCHECK_H #define POSTCHECK_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postCheck.h" class postCheck : public XDialog, public Ui::postCheck { Q_OBJECT public: postCheck(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postCheck(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPost(); virtual void sHandleBankAccount( int pBankaccntid ); virtual void populate( int pcheckid ); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // POSTCHECK_H qt-client-4.1.0/guiclient/postCheck.ui000066400000000000000000000164701217451700100176670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postCheck 0 0 482 78 Post Check 5 7 0 0 5 0 5 0 Bank Account: Qt::AlignVCenter|Qt::AlignRight Check #: Qt::AlignVCenter|Qt::AlignRight 5 0 7 0 0 0 7 0 0 0 10 26 Expanding Vertical 0 0 5 0 &Cancel false &Post true true 10 16 Expanding Vertical XComboBox QComboBox

    xcombobox.h
    0 _bankaccnt _check _post _close parameter.h _close clicked() postCheck reject() _check notNull(bool) _post setEnabled(bool) qt-client-4.1.0/guiclient/postChecks.cpp000066400000000000000000000070021217451700100202060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postChecks.h" #include #include #include #include "storedProcErrorLookup.h" postChecks::postChecks(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sHandleBankAccount(int))); _numberOfChecks->setPrecision(0); _bankaccnt->setAllowNull(TRUE); _bankaccnt->setType(XComboBox::APBankAccounts); if (_preferences->boolean("XCheckBox/forgetful")) _printJournal->setChecked(true); } postChecks::~postChecks() { // no need to delete child widgets, Qt does it all for us } void postChecks::languageChange() { retranslateUi(this); } enum SetResponse postChecks::set(const ParameterList & pParams ) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("bankaccnt_id", &valid); if (valid) _bankaccnt->setId(param.toInt()); return NoError; } void postChecks::sPost() { XSqlQuery postPost; postPost.prepare("SELECT postChecks(:bankaccnt_id) AS result;"); postPost.bindValue(":bankaccnt_id", _bankaccnt->id()); postPost.exec(); if (postPost.first()) { int result = postPost.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("postChecks", result), __FILE__, __LINE__); omfgThis->sChecksUpdated(_bankaccnt->id(), -1, TRUE); if (_printJournal->isChecked()) { ParameterList params; params.append("source", "A/P"); params.append("sourceLit", tr("A/P")); params.append("startJrnlnum", result); params.append("endJrnlnum", result); if (_metrics->boolean("UseJournals")) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); } orReport report("GLSeries", params); if (report.isValid()) report.print(); else report.reportError(this); } accept(); } else if (postPost.lastError().type() != QSqlError::NoError) { systemError(this, postPost.lastError().databaseText(), __FILE__, __LINE__); return; } } void postChecks::sHandleBankAccount(int pBankaccntid) { XSqlQuery postHandleBankAccount; postHandleBankAccount.prepare( "SELECT COUNT(*) AS numofchecks " "FROM checkhead " "WHERE ( (NOT checkhead_void)" " AND (NOT checkhead_posted)" " AND (checkhead_printed)" " AND (checkhead_bankaccnt_id=:bankaccnt_id) );" ); postHandleBankAccount.bindValue(":bankaccnt_id", pBankaccntid); postHandleBankAccount.exec(); if (postHandleBankAccount.first()) _numberOfChecks->setDouble(postHandleBankAccount.value("numofchecks").toDouble()); else if (postHandleBankAccount.lastError().type() != QSqlError::NoError) { systemError(this, postHandleBankAccount.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/postChecks.h000066400000000000000000000020261217451700100176540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCHECKS_H #define POSTCHECKS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postChecks.h" class postChecks : public XDialog, public Ui::postChecks { Q_OBJECT public: postChecks(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postChecks(); public slots: virtual SetResponse set(const ParameterList &pParams); virtual void sPost(); virtual void sHandleBankAccount( int pBankaccntid ); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // POSTCHECKS_H qt-client-4.1.0/guiclient/postChecks.ui000066400000000000000000000145741217451700100200550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postChecks 0 0 552 90 Post Checks 7 5 5 5 5 0 5 5 5 Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Number of Unposted Checks: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 Print Check Journal Qt::Horizontal QSizePolicy::Expanding 26 10 Qt::Vertical QSizePolicy::Expanding 16 70 0 5 &Cancel &Post true true Qt::Vertical QSizePolicy::Expanding 10 31 XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _bankaccnt _printJournal _post _close _close clicked() postChecks reject() 20 20 20 20
    qt-client-4.1.0/guiclient/postCostsByClassCode.cpp000066400000000000000000000100141217451700100221520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postCostsByClassCode.h" #include #include postCostsByClassCode::postCostsByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_selectAll, SIGNAL(clicked()), this, SLOT(sSelectAll())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _classCode->setType(ParameterGroup::ClassCode); if (!_metrics->boolean("Routings")) { _directLabor->hide(); _lowerDirectLabor->hide(); _overhead->hide(); _lowerOverhead->hide(); _machOverhead->hide(); _lowerMachOverhead->hide(); } else if (_metrics->value("TrackMachineOverhead") != "M") { _machOverhead->setEnabled(FALSE); _machOverhead->setChecked(TRUE); _lowerMachOverhead->setEnabled(FALSE); _lowerMachOverhead->setChecked(TRUE); } } postCostsByClassCode::~postCostsByClassCode() { // no need to delete child widgets, Qt does it all for us } void postCostsByClassCode::languageChange() { retranslateUi(this); } void postCostsByClassCode::sSelectAll() { _material->setChecked(TRUE); _lowerMaterial->setChecked(TRUE); _user->setChecked(TRUE); _lowerUser->setChecked(TRUE); if (_metrics->boolean("Routings")) { _directLabor->setChecked(TRUE); _lowerDirectLabor->setChecked(TRUE); _overhead->setChecked(TRUE); _lowerOverhead->setChecked(TRUE); if (_metrics->value("TrackMachineOverhead") == "M") { _machOverhead->setChecked(TRUE); _lowerMachOverhead->setChecked(TRUE); } } } void postCostsByClassCode::sPost() { XSqlQuery postPost; QString sql = "SELECT doPostCosts(item_id, TRUE, :material, :lowMaterial, " " :directLabor, :lowDirectLabor, :overhead, :lowOverhead, " " :machOverhead, :lowMachOverhead, :user, :lowUser, :rollUp) " " FROM item, classcode " " WHERE(item_classcode_id=classcode_id)"; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id);"; else if (_classCode->isPattern()) sql += " AND (classcode_code ~ :classcode_pattern);"; else sql = "SELECT doPostCosts(:material, :lowMaterial, " " :directLabor, :lowDirectLabor, :overhead, :lowOverhead, " " :machOverhead, :lowMachOverhead, :user, :lowUser, :rollUp);"; postPost.prepare(sql); postPost.bindValue(":material", _material->isChecked() ? "t" : "f"); postPost.bindValue(":lowMaterial", _lowerMaterial->isChecked() ? "t" : "f"); postPost.bindValue(":directLabor", _directLabor->isChecked() ? "t" : "f"); postPost.bindValue(":lowDirectLabor", _lowerDirectLabor->isChecked() ? "t" : "f"); postPost.bindValue(":overhead", _overhead->isChecked() ? "t" : "f"); postPost.bindValue(":lowOverhead", _lowerOverhead->isChecked() ? "t" : "f"); postPost.bindValue(":machOverhead", _machOverhead->isChecked() ? "t" : "f"); postPost.bindValue(":lowMachOverhead", _lowerMachOverhead->isChecked() ? "t" : "f"); postPost.bindValue(":user", _user->isChecked() ? "t" : "f"); postPost.bindValue(":lowUser", _lowerUser->isChecked() ? "t" : "f"); postPost.bindValue(":rollUp", _rollUp->isChecked() ? "t" : "f"); _classCode->bindValue(postPost); postPost.exec(); if (postPost.lastError().type() != QSqlError::NoError) { systemError(this, postPost.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/postCostsByClassCode.h000066400000000000000000000017651217451700100216340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCOSTSBYCLASSCODE_H #define POSTCOSTSBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postCostsByClassCode.h" class postCostsByClassCode : public XDialog, public Ui::postCostsByClassCode { Q_OBJECT public: postCostsByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postCostsByClassCode(); public slots: virtual void sSelectAll(); virtual void sPost(); protected slots: virtual void languageChange(); }; #endif // POSTCOSTSBYCLASSCODE_H qt-client-4.1.0/guiclient/postCostsByClassCode.ui000066400000000000000000000401561217451700100220170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postCostsByClassCode 0 0 527 471 Post Actual Costs by Class Code 12 12 0 5 false 0 &Roll Up Standard Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Post Material Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Post Lower Level Material Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Post Direct Labor Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 Post Lower Level Direct Labor Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Post Overhead Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 Post Lower Level Overhead Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Post Machine Overhead Qt::Horizontal QSizePolicy::Expanding 20 0 0 Post Lower Machine Overhead Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Post User Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Post Lower Level User Costs Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 16 0 5 &Cancel &Post true true true &Select all Costs Qt::Vertical QSizePolicy::Expanding 20 70 ParameterGroup QGroupBox
    parametergroup.h
    1
    _rollUp _material _lowerMaterial _directLabor _lowerDirectLabor _overhead _lowerOverhead _machOverhead _lowerMachOverhead _user _lowerUser _post _selectAll _close _close clicked() postCostsByClassCode reject() 20 20 20 20
    qt-client-4.1.0/guiclient/postCostsByItem.cpp000066400000000000000000000076751217451700100212330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postCostsByItem.h" #include #include postCostsByItem::postCostsByItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_item, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_selectAll, SIGNAL(clicked()), this, SLOT(sSelectAll())); if (!_metrics->boolean("Routings")) { _directLabor->hide(); _lowerDirectLabor->hide(); _overhead->hide(); _lowerOverhead->hide(); _machOverhead->hide(); _lowerMachOverhead->hide(); } else if (_metrics->value("TrackMachineOverhead") != "M") { _machOverhead->setEnabled(FALSE); _machOverhead->setChecked(TRUE); _lowerMachOverhead->setEnabled(FALSE); _lowerMachOverhead->setChecked(TRUE); } _captive = FALSE; } postCostsByItem::~postCostsByItem() { // no need to delete child widgets, Qt does it all for us } void postCostsByItem::languageChange() { retranslateUi(this); } enum SetResponse postCostsByItem::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(TRUE); } return NoError; } void postCostsByItem::sSelectAll() { _material->setChecked(TRUE); _lowerMaterial->setChecked(TRUE); _user->setChecked(TRUE); _lowerUser->setChecked(TRUE); if (_metrics->boolean("Routings")) { _directLabor->setChecked(TRUE); _lowerDirectLabor->setChecked(TRUE); _overhead->setChecked(TRUE); _lowerOverhead->setChecked(TRUE); if (_metrics->value("TrackMachineOverhead") == "M") { _machOverhead->setChecked(TRUE); _lowerMachOverhead->setChecked(TRUE); } } } void postCostsByItem::sPost() { XSqlQuery sql; sql.prepare( "SELECT doPostCosts(:item_id, TRUE, " " :material, :lowMaterial, :labor, :lowLabor, " " :overhead, :lowOverhead, :machOverhead, :lowMachOverhead, " " :user, :lowUser, :rollUp)" ); sql.bindValue(":item_id", _item->id()); sql.bindValue(":material", _material->isChecked() ? "t" : "f"); sql.bindValue(":lowMaterial", _lowerMaterial->isChecked() ? "t" : "f"); sql.bindValue(":labor", _directLabor->isChecked() ? "t" : "f"); sql.bindValue(":lowLabor", _lowerDirectLabor->isChecked() ? "t" : "f"); sql.bindValue(":overhead", _overhead->isChecked() ? "t" : "f"); sql.bindValue(":lowOverhead", _lowerOverhead->isChecked() ? "t" : "f"); sql.bindValue(":machOverhead", _machOverhead->isChecked() ? "t" : "f"); sql.bindValue(":lowMachOverhead", _lowerMachOverhead->isChecked() ? "t" : "f"); sql.bindValue(":user", _user->isChecked() ? "t" : "f"); sql.bindValue(":lowUser", _lowerUser->isChecked() ? "t" : "f"); sql.bindValue(":rollUp", _rollUp->isChecked() ? "t" : "f"); sql.exec(); if (sql.lastError().type() != QSqlError::NoError) { systemError(this, tr("A SystemError occurred at %1::%2") .arg(__FILE__) .arg(__LINE__)); return; } if (_captive) accept(); else { _close->setText(tr("&Close")); _item->setId(-1); _item->setFocus(); } } qt-client-4.1.0/guiclient/postCostsByItem.h000066400000000000000000000020551217451700100206630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCOSTSBYITEM_H #define POSTCOSTSBYITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postCostsByItem.h" class postCostsByItem : public XDialog, public Ui::postCostsByItem { Q_OBJECT public: postCostsByItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postCostsByItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSelectAll(); virtual void sPost(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // POSTCOSTSBYITEM_H qt-client-4.1.0/guiclient/postCostsByItem.ui000066400000000000000000000374311217451700100210570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postCostsByItem 0 0 502 382 Post Actual Costs by Item 0 5 7 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 &Roll Up Standard Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Post Material Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Post Lower Level Material Costs Qt::Horizontal QSizePolicy::Expanding 20 20 2 0 Post Direct Labor Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 Post Lower Level Direct Labor Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Post Overhead Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 Post Lower Level Overhead Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Post Machine Overhead Qt::Horizontal QSizePolicy::Expanding 20 0 0 Post Lower Machine Overhead Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Post User Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Post Lower Level User Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel false &Post true &Select all Costs Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 ItemCluster QWidget
    itemcluster.h
    1
    _item _rollUp _material _lowerMaterial _directLabor _lowerDirectLabor _overhead _lowerOverhead _machOverhead _lowerMachOverhead _user _lowerUser _post _selectAll _close _item valid(bool) _post setEnabled(bool) 20 20 20 20 _close clicked() postCostsByItem reject() 20 20 20 20
    qt-client-4.1.0/guiclient/postCountSlips.cpp000066400000000000000000000033251217451700100211150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postCountSlips.h" #include #include postCountSlips::postCountSlips(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); } postCountSlips::~postCountSlips() { // no need to delete child widgets, Qt does it all for us } void postCountSlips::languageChange() { retranslateUi(this); } void postCountSlips::sPost() { XSqlQuery postPost; QString sql( "SELECT postCountSlip(cntslip_id) " "FROM cntslip, invcnt, itemsite " "WHERE ((NOT cntslip_posted)" " AND (cntslip_cnttag_id=invcnt_id)" " AND (invcnt_itemsite_id=itemsite_id)" ); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ");"; postPost.prepare(sql); _warehouse->bindValue(postPost); postPost.exec(); if(!postPost.first()) QMessageBox::information(this, tr("No Count Slips Posted"), tr("No count slips were posted! Either there were no count slips available to\n" "be posted or an error occurred trying to post the count slips.") ); accept(); } qt-client-4.1.0/guiclient/postCountSlips.h000066400000000000000000000016171217451700100205640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCOUNTSLIPS_H #define POSTCOUNTSLIPS_H #include "guiclient.h" #include "xdialog.h" #include "ui_postCountSlips.h" class postCountSlips : public XDialog, public Ui::postCountSlips { Q_OBJECT public: postCountSlips(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postCountSlips(); public slots: virtual void sPost(); protected slots: virtual void languageChange(); }; #endif // POSTCOUNTSLIPS_H qt-client-4.1.0/guiclient/postCountSlips.ui000066400000000000000000000111201217451700100207400ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postCountSlips 0 0 345 140 Post Count Slips by Site 12 12 0 false Qt::Vertical QSizePolicy::Preferred 20 47 0 0 Qt::Horizontal QSizePolicy::Expanding 16 20 5 &Cancel &Post true Qt::Vertical QSizePolicy::Expanding 20 16 WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _post _close _close clicked() postCountSlips reject() 20 20 20 20
    qt-client-4.1.0/guiclient/postCountTags.cpp000066400000000000000000000047741217451700100207320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postCountTags.h" #include #include #include #include #include "storedProcErrorLookup.h" postCountTags::postCountTags(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _codeGroup = new QButtonGroup(this); _codeGroup->addButton(_plancode); _codeGroup->addButton(_classcode); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_codeGroup, SIGNAL(buttonClicked(int)), this, SLOT(sParameterTypeChanged())); _parameter->setType(ParameterGroup::ClassCode); if(!_privileges->check("ThawInventory")) { _thaw->setChecked(FALSE); _thaw->setEnabled(FALSE); } } postCountTags::~postCountTags() { // no need to delete child widgets, Qt does it all for us } void postCountTags::languageChange() { retranslateUi(this); } bool postCountTags::setParams(ParameterList ¶ms) { params.append("thaw", QVariant(_thaw->isChecked())); _warehouse->appendValue(params); _parameter->appendValue(params); return true; } void postCountTags::sPost() { ParameterList postp; if (! setParams(postp)) return; bool valid = false; QString errmsg; MetaSQLQuery postm = MQLUtil::mqlLoad("postCountTags", "post", errmsg, &valid); if (! valid) { QMessageBox::critical(this, tr("Query Error"), errmsg); return; } XSqlQuery postq = postm.toQuery(postp); if (postq.first()) { int result = postq.value("result").toInt(); if (result < 0) { QMessageBox::critical(this, tr("One or More Posts Failed"), storedProcErrorLookup("postCountTag", result)); return; } } else if (postq.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("Database Error"), postq.lastError().text()); return; } accept(); } void postCountTags::sParameterTypeChanged() { if(_plancode->isChecked()) _parameter->setType(ParameterGroup::PlannerCode); else _parameter->setType(ParameterGroup::ClassCode); } qt-client-4.1.0/guiclient/postCountTags.h000066400000000000000000000020311217451700100203570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCOUNTTAGS_H #define POSTCOUNTTAGS_H #include "guiclient.h" #include "xdialog.h" #include "ui_postCountTags.h" class postCountTags : public XDialog, public Ui::postCountTags { Q_OBJECT public: postCountTags(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postCountTags(); Q_INVOKABLE virtual bool setParams(ParameterList ¶ms); public slots: virtual void sPost(); virtual void sParameterTypeChanged(); protected slots: virtual void languageChange(); private: QButtonGroup* _codeGroup; }; #endif // POSTCOUNTTAGS_H qt-client-4.1.0/guiclient/postCountTags.ui000066400000000000000000000154241217451700100205570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postCountTags 0 0 480 400 Post Count Tags 12 12 Qt::StrongFocus false Item Sites by Class Code true Planner Code Qt::Horizontal 40 20 Qt::StrongFocus false 0 20 Thaw Frozen Inventory true Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 0 17 0 &Cancel &Post true Qt::Vertical QSizePolicy::Expanding 77 0 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _thaw _classcode _plancode _post _close _close clicked() postCountTags reject() 462 31 20 20
    qt-client-4.1.0/guiclient/postCreditMemos.cpp000066400000000000000000000123351217451700100212260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postCreditMemos.h" #include #include #include #include "distributeInventory.h" postCreditMemos::postCreditMemos(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); if (_preferences->boolean("XCheckBox/forgetful")) _printJournal->setChecked(true); } postCreditMemos::~postCreditMemos() { // no need to delete child widgets, Qt does it all for us } void postCreditMemos::languageChange() { retranslateUi(this); } void postCreditMemos::sPost() { XSqlQuery postPost; postPost.exec( "SELECT cmhead_printed, COUNT(*) AS number " "FROM ( SELECT cmhead_id, cmhead_printed " " FROM cmhead " " WHERE (NOT cmhead_posted) ) AS data " "WHERE (checkCreditMemoSitePrivs(cmhead_id)) " "GROUP BY cmhead_printed;" ); if (postPost.first()) { int printed = 0; int unprinted = 0; do { if (postPost.value("cmhead_printed").toBool()) printed = postPost.value("number").toInt(); else unprinted = postPost.value("number").toInt(); } while (postPost.next()); if ( ( (unprinted) && (!printed) ) && (!_postUnprinted->isChecked()) ) { QMessageBox::warning( this, tr("No Credit Memos to Post"), tr( "Although there are unposted Credit Memos, there are no unposted Credit Memos that have been printed.\n" "You must manually print these Credit Memos or select 'Post Unprinted Credit Memos' before these Credit Memos\n" "may be posted." ) ); _postUnprinted->setFocus(); return; } } else { QMessageBox::warning( this, tr("No Credit Memos to Post"), tr("There are no Credit Memos, printed or not, to post.\n" ) ); _close->setFocus(); return; } postPost.exec("SELECT fetchJournalNumber('AR-CM') AS result"); if (!postPost.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } int journalNumber = postPost.value("result").toInt(); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); postPost.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations postPost.prepare("SELECT postCreditMemos(:postUnprinted, :journalNumber) AS result;"); postPost.bindValue(":postUnprinted", QVariant(_postUnprinted->isChecked())); postPost.bindValue(":journalNumber", journalNumber); postPost.exec(); if (postPost.first()) { int result = postPost.value("result").toInt(); if (result == -5) { rollback.exec(); QMessageBox::critical( this, tr("Cannot Post one or more Credit Memos"), tr( "The G/L Account Assignments for one or more of the Credit Memos that you are trying to post are not\n" "configured correctly. Because of this, G/L Transactions cannot be posted for these Credit Memos.\n" "You must contact your Systems Administrator to have this corrected before you may\n" "post these Credit Memos." ) ); return; } else if (result < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at postCreditMemos::%1, Error #%2.") .arg(__LINE__) .arg(postPost.value("result").toInt()) ); return; } else if (distributeInventory::SeriesAdjust(postPost.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Post Credit Memos"), tr("Transaction Canceled") ); return; } postPost.exec("COMMIT;"); if (_printJournal->isChecked()) { ParameterList params; params.append("source", "A/R"); params.append("sourceLit", tr("A/R")); params.append("startJrnlnum", journalNumber); params.append("endJrnlnum", journalNumber); if (_metrics->boolean("UseJournals")) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); } orReport report("GLSeries", params); if (report.isValid()) report.print(); else report.reportError(this); } } else { rollback.exec(); systemError( this, tr("A System Error occurred at postCreditMemos::%1.") .arg(__LINE__) ); return; } omfgThis->sCreditMemosUpdated(); accept(); } qt-client-4.1.0/guiclient/postCreditMemos.h000066400000000000000000000016271217451700100206750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTCREDITMEMOS_H #define POSTCREDITMEMOS_H #include "guiclient.h" #include "xdialog.h" #include "ui_postCreditMemos.h" class postCreditMemos : public XDialog, public Ui::postCreditMemos { Q_OBJECT public: postCreditMemos(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postCreditMemos(); public slots: virtual void sPost(); protected slots: virtual void languageChange(); }; #endif // POSTCREDITMEMOS_H qt-client-4.1.0/guiclient/postCreditMemos.ui000066400000000000000000000131421217451700100210560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postCreditMemos 0 0 354 83 Post Credit Memos 5 7 0 0 0 5 0 0 Post Unprinted Credit Memos Qt::Horizontal QSizePolicy::Expanding 0 10 0 0 P&rint Credit Memo Journal Qt::Horizontal QSizePolicy::Expanding 100 10 Qt::Vertical QSizePolicy::Expanding 20 51 0 0 0 5 &Cancel &Post true Qt::Vertical QSizePolicy::Preferred 20 20 XCheckBox QCheckBox
    xcheckbox.h
    _postUnprinted _printJournal _post _close _close clicked() postCreditMemos close() 20 20 20 20
    qt-client-4.1.0/guiclient/postInvoices.cpp000066400000000000000000000143711217451700100205740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postInvoices.h" #include #include #include #include "distributeInventory.h" #include postInvoices::postInvoices(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); if (_preferences->boolean("XCheckBox/forgetful")) _printJournal->setChecked(true); } postInvoices::~postInvoices() { // no need to delete child widgets, Qt does it all for us } void postInvoices::languageChange() { retranslateUi(this); } void postInvoices::sPost() { XSqlQuery postPost; postPost.exec( "SELECT invchead_printed, COUNT(*) AS number " "FROM ( " " SELECT * FROM invchead WHERE NOT (invchead_posted)) AS data " "WHERE (checkInvoiceSitePrivs(invchead_id)) " "GROUP BY invchead_printed;" ); if (postPost.first()) { int printed = 0; int unprinted = 0; do { if (postPost.value("invchead_printed").toBool()) printed = postPost.value("number").toInt(); else unprinted = postPost.value("number").toInt(); } while (postPost.next()); if ( ( (unprinted) && (!printed) ) && (!_postUnprinted->isChecked()) ) { QMessageBox::warning( this, tr("No Invoices to Post"), tr( "Although there are unposted Invoices, there are no unposted Invoices that have been printed.\n" "You must manually print these Invoices or select 'Post Unprinted Invoices' before these Invoices\n" "may be posted." ) ); _postUnprinted->setFocus(); return; } } else { QMessageBox::warning( this, tr("No Invoices to Post"), tr("There are no Invoices, printed or not, to post.\n" ) ); _close->setFocus(); return; } bool inclZero = false; postPost.exec("SELECT COUNT(invchead_id) AS numZeroInvcs " "FROM invchead " "WHERE ( (NOT invchead_posted) " " AND (invoiceTotal(invchead_id) <= 0.0) " " AND (checkInvoiceSitePrivs(invchead_id)) );"); if (postPost.first() && postPost.value("numZeroInvcs").toInt() > 0) { int toPost = QMessageBox::question(this, tr("Invoices for 0 Amount"), tr("There are %1 invoices with a total value of 0.\n" "Would you like to post them?") .arg(postPost.value("numZeroInvcs").toString()), tr("Post All"), tr("Post Only Non-0"), tr("Cancel"), 1, 2); if (toPost == 2) return; else if (toPost == 1) inclZero = false; else inclZero = true; } else if (postPost.lastError().type() != QSqlError::NoError) { systemError(this, postPost.lastError().databaseText(), __FILE__, __LINE__); return; } postPost.exec("SELECT fetchJournalNumber('AR-IN') AS journal;"); if (!postPost.first()) { systemError( this, tr("A System Error occurred at %1::%2, Error #%3.") .arg(__FILE__) .arg(__LINE__) .arg(postPost.value("journal").toInt()) ); return; } int journalNumber = postPost.value("journal").toInt(); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); postPost.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations postPost.prepare("SELECT postInvoices(:postUnprinted, :inclZero, :journalNumber) AS result;"); postPost.bindValue(":postUnprinted", QVariant(_postUnprinted->isChecked())); postPost.bindValue(":inclZero", inclZero); postPost.bindValue(":journalNumber", journalNumber); postPost.exec(); if (postPost.first()) { int result = postPost.value("result").toInt(); if (result == -5) { rollback.exec(); QMessageBox::critical( this, tr("Cannot Post one or more Invoices"), tr( "The G/L Account Assignments for one or more of the Invoices that you are trying to post are not\n" "configured correctly. Because of this, G/L Transactions cannot be posted for these Invoices.\n" "You must contact your Systems Administrator to have this corrected before you may\n" "post these Invoices." ) ); return; } else if (result < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at %1::%2, Error #%3.") .arg(__FILE__) .arg(__LINE__) .arg(postPost.value("result").toInt()) ); return; } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Post Invoices"), tr("Transaction Canceled") ); return; } postPost.exec("COMMIT;"); if (_printJournal->isChecked()) { ParameterList params; params.append("source", "A/R"); params.append("sourceLit", tr("A/R")); params.append("startJrnlnum", journalNumber); params.append("endJrnlnum", journalNumber); if (_metrics->boolean("UseJournals")) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); } orReport report("GLSeries", params); if (report.isValid()) report.print(); else report.reportError(this); } omfgThis->sInvoicesUpdated(-1, TRUE); omfgThis->sSalesOrdersUpdated(-1); } else if (postPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError( this, postPost.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/postInvoices.h000066400000000000000000000015771217451700100202450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTINVOICES_H #define POSTINVOICES_H #include "guiclient.h" #include "xdialog.h" #include "ui_postInvoices.h" class postInvoices : public XDialog, public Ui::postInvoices { Q_OBJECT public: postInvoices(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postInvoices(); public slots: virtual void sPost(); protected slots: virtual void languageChange(); }; #endif // POSTINVOICES_H qt-client-4.1.0/guiclient/postInvoices.ui000066400000000000000000000112611217451700100204220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postInvoices 0 0 342 120 Post Invoices 0 0 Post Unprinted Invoices Qt::Horizontal QSizePolicy::Expanding 0 10 P&rint Journal Qt::Horizontal QSizePolicy::Expanding 0 10 Qt::Vertical QSizePolicy::Expanding 20 51 &Cancel &Post true Qt::Vertical QSizePolicy::Preferred 20 16 XCheckBox QCheckBox
    xcheckbox.h
    _postUnprinted _printJournal _post _close _close clicked() postInvoices close() 20 20 20 20
    qt-client-4.1.0/guiclient/postJournals.cpp000066400000000000000000000136731217451700100206160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its postJournals. */ #include "postJournals.h" #include "dspJournals.h" #include #include #include "mqlutil.h" #include #include #include postJournals::postJournals(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _journalDates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), true); _journalDates->setEndNull(tr("Latest"), omfgThis->endOfTime(), true); _distDate->setDate(omfgThis->dbDate()); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_query, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_selectAll, SIGNAL(clicked()), _sources, SLOT(selectAll())); connect(_preview, SIGNAL(toggled(bool)), this, SLOT(sHandlePreview())); connect(_sources, SIGNAL(valid(bool)), this, SLOT(sHandleSelection())); connect(_sources, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); _sources->addColumn(tr("Source"), _docTypeColumn, Qt::AlignLeft, true, "sltrans_source"); _sources->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); sHandlePreview(); sFillList(); } postJournals::~postJournals() { } void postJournals::languageChange() { retranslateUi(this); } void postJournals::sPost() { QStringList sources; QList journalnumbers; XSqlQuery qry; MetaSQLQuery mql = mqlLoad("postJournals", "post"); QList selected = _sources->selectedItems(); for (int i = 0; i < selected.size(); i++) sources << selected.at(i)->rawValue("sltrans_source").toString(); ParameterList params; _journalDates->appendValue(params); params.append("distDate", _distDate->date()); params.append("source_list", sources); XSqlQuery jrnls; jrnls = mql.toQuery(params); if (jrnls.lastError().type() != QSqlError::NoError) { systemError(this, jrnls.lastError().databaseText(), __FILE__, __LINE__); return; } while (jrnls.next()) journalnumbers << jrnls.value("result").toInt(); if (_print->isChecked() && journalnumbers.size()) sPrint(journalnumbers); sFillList(); } void postJournals::sFillList() { MetaSQLQuery mql = mqlLoad("postJournals", "detail"); ParameterList params; _journalDates->appendValue(params); params.append("AP", tr("Accounts Payable")); params.append("AR", tr("Accounts Receivable")); params.append("GL", tr("General Ledger")); params.append("IM", tr("Inventory Management")); params.append("PD", tr("Products")); params.append("PO", tr("Purchase Order")); params.append("SO", tr("Sales Order")); params.append("SR", tr("Shipping and Receiving")); params.append("WO", tr("Work Order")); params.append("Other", tr("Other")); if (_preview->isChecked()) params.append("preview"); XSqlQuery qry; qry = mql.toQuery(params); _sources->populate(qry, true); _sources->expandAll(); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } } void postJournals::sHandlePreview() { _sources->clear(); _sources->setColumnCount(2); if (_preview->isChecked()) { _sources->addColumn(tr("Debit"), _bigMoneyColumn, Qt::AlignRight, true, "debit"); _sources->addColumn(tr("Credit"),_bigMoneyColumn, Qt::AlignRight, true, "credit"); _sources->setSelectionMode(QAbstractItemView::SingleSelection); _selectAll->setEnabled(false); } else { _sources->setSelectionMode(QAbstractItemView::ExtendedSelection); _selectAll->setEnabled(true); } _sources->addColumn(tr("Entries"), _qtyColumn, Qt::AlignRight, true, "journals"); } void postJournals::sHandleSelection() { _post->setEnabled(_sources->id() == 0); } void postJournals::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *) { QAction *menuItem; if (_sources->id() == 0) { menuItem = pMenu->addAction(tr("Post"), this, SLOT(sPost())); pMenu->addSeparator(); } menuItem = pMenu->addAction(tr("View Journal..."), this, SLOT(sViewTransactions())); menuItem->setEnabled(_privileges->check("ViewJournals")); } void postJournals::sViewTransactions() { ParameterList params; if (_sources->id()) params.append("accnt_id", _sources->id()); _journalDates->appendValue(params); params.append("source", _sources->rawValue("sltrans_source")); params.append("posted", false); params.append("run"); dspJournals *newdlg = new dspJournals(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void postJournals::sPrint(QList journalnumbers) { if (!journalnumbers.size()) return; QPrinter printer(QPrinter::HighResolution); bool setupPrinter = true; bool userCanceled = false; if (orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("

    Could not initialize printing system for " "multiple reports.")); return; } for (int i = 0; i < journalnumbers.size(); i++) { ParameterList params; params.append("startDate", _distDate->date()); params.append("endDate", _distDate->date()); params.append("startJrnlnum", journalnumbers.at(i)); params.append("endJrnlnum", journalnumbers.at(i)); params.append("gltrans", true); params.append("title",tr("General Ledger Series")); params.append("table", "gltrans"); orReport report("GLSeries", params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = false; else { report.reportError(this); break; } } orReport::endMultiPrint(&printer); } qt-client-4.1.0/guiclient/postJournals.h000066400000000000000000000020551217451700100202530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its postJournals. */ #ifndef POSTJOURNALS_H #define POSTJOURNALS_H #include "guiclient.h" #include "xwidget.h" #include "ui_postJournals.h" class postJournals : public XWidget, public Ui::postJournals { Q_OBJECT public: postJournals(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~postJournals(); public slots: void sPost(); void sFillList(); void sHandlePreview(); void sHandleSelection(); void sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *); void sViewTransactions(); void sPrint(QList); protected slots: void languageChange(); }; #endif // POSTJOURNALS_H qt-client-4.1.0/guiclient/postJournals.ui000066400000000000000000000154071217451700100204460ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postJournals 0 0 611 400 Post Journals Transaction Dates Qt::StrongFocus Qt::Horizontal 40 20 General Ledger Distribution Date: Qt::Horizontal 40 20 Preview Posting true Qt::Vertical 20 0 false Post Cancel Query Select All Qt::Vertical 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 Eligible Sources Print on Post DateCluster QWidget

    datecluster.h
    DLineEdit QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _cancel clicked() postJournals close() 548 61 305 199 qt-client-4.1.0/guiclient/postMiscProduction.cpp000066400000000000000000000223521217451700100217550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postMiscProduction.h" #include #include #include #include "distributeInventory.h" #include "storedProcErrorLookup.h" postMiscProduction::postMiscProduction(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _captive = FALSE; _itemsiteid = -1; _sense = 1; _qty = 0; _item->setType(ItemLineEdit::cManufactured); _qtyToPost->setValidator(omfgThis->qtyVal()); _immediateTransfer->setEnabled(_privileges->check("CreateInterWarehouseTrans")); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); _immediateTransfer->hide(); _transferWarehouse->hide(); } else _transferWarehouse->setEnabled(_immediateTransfer->isChecked()); if (_preferences->boolean("XCheckBox/forgetful")) _backflush->setChecked(true); _nonPickItems->setEnabled(_backflush->isChecked() && _privileges->check("ChangeNonPickItems")); // TODO: unhide as part of implementation of 5847 _nonPickItems->hide(); } postMiscProduction::~postMiscProduction() { // no need to delete child widgets, Qt does it all for us } void postMiscProduction::languageChange() { retranslateUi(this); } enum SetResponse postMiscProduction::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _item->setItemsiteid(param.toInt()); _warehouse->setEnabled(FALSE); _item->setReadOnly(TRUE); } return NoError; } void postMiscProduction::sPost() { XSqlQuery postPost; if (!okToPost()) return; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); postPost.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations if (_qty > 0) { if (!createwo()) { rollback.exec(); return; } if (!post()) { rollback.exec(); return; } if (!closewo()) { rollback.exec(); return; } if (_immediateTransfer->isChecked()) { if (!transfer()) { rollback.exec(); return; } } } else { _sense = -1; if (_immediateTransfer->isChecked()) { if (!transfer()) { rollback.exec(); return; } } if (!createwo()) { rollback.exec(); return; } if (!post()) { rollback.exec(); return; } if (!closewo()) { rollback.exec(); return; } } postPost.exec("COMMIT;"); if (_captive) accept(); else clear(); } bool postMiscProduction::okToPost() { _qty = _qtyToPost->toDouble(); if (_disassembly->isChecked()) _qty = _qty * -1; if (_qty == 0) { QMessageBox::warning( this, tr("Invalid Quantity"), tr( "The quantity may not be zero." ) ); return false; } if (_immediateTransfer->isChecked()) { if (_warehouse->id() == _transferWarehouse->id()) { QMessageBox::warning( this, tr("Cannot Post Immediate Transfer"), tr( "Transaction canceled. Cannot post an immediate transfer for the newly posted production as the\n" "transfer Site is the same as the production Site. You must manually\n" "transfer the production to the intended Site." ) ); return false; } } return true; } bool postMiscProduction::createwo() { _itemsiteid = 0; XSqlQuery itemsite; itemsite.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); itemsite.bindValue(":item_id", _item->id()); if (_qty > 0) itemsite.bindValue(":warehous_id", _warehouse->id()); else itemsite.bindValue(":warehous_id", _transferWarehouse->id()); itemsite.exec(); if (itemsite.first()) { _itemsiteid = itemsite.value("itemsite_id").toInt(); } else if (itemsite.lastError().type() != QSqlError::NoError) { systemError(this, itemsite.lastError().databaseText(), __FILE__, __LINE__); return false; } else { systemError(this, "Itemsite not found", __FILE__, __LINE__); return false; } _woid = 0; XSqlQuery wo; wo.prepare( "SELECT createWo(fetchWoNumber(), :itemsite_id, :qty, CURRENT_DATE, CURRENT_DATE, :comments) AS result;" ); wo.bindValue(":itemsite_id", _itemsiteid); wo.bindValue(":qty", _qty); wo.bindValue(":comments", (tr("Post Misc Production, Document Number ") + _documentNum->text().trimmed() + ", " + _comments->toPlainText())); wo.exec(); if (wo.first()) { _woid = wo.value("result").toInt(); if (_woid < 0) { systemError(this, storedProcErrorLookup("createWo", _woid), __FILE__, __LINE__); return false; } } else if (wo.lastError().type() != QSqlError::NoError) { systemError(this, wo.lastError().databaseText(), __FILE__, __LINE__); return false; } // Delete any Child W/O's created XSqlQuery child; child.prepare( "SELECT MAX(deleteWo(wo_id, TRUE)) AS result " "FROM wo " "WHERE ((wo_ordtype='W') AND (wo_ordid=:ordid));"); child.bindValue(":ordid", _woid); child.exec(); if (child.first()) { if (child.value("result").toInt() < 0) { systemError(this, storedProcErrorLookup("deleteWo", child.value("result").toInt()), __FILE__, __LINE__); return false; } } else if (child.lastError().type() != QSqlError::NoError) { systemError(this, child.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } bool postMiscProduction::post() { int _itemlocseries = 0; XSqlQuery post; post.prepare("SELECT postProduction(:wo_id, :qty, :backflushMaterials, 0, CURRENT_DATE) AS result;"); post.bindValue(":wo_id", _woid); post.bindValue(":qty", _qty); post.bindValue(":backflushMaterials", QVariant(_backflush->isChecked())); post.exec(); if (post.first()) { _itemlocseries = post.value("result").toInt(); if (_itemlocseries < 0) { systemError(this, storedProcErrorLookup("postProduction", _itemlocseries), __FILE__, __LINE__); return false; } } else if (post.lastError().type() != QSqlError::NoError) { systemError(this, post.lastError().databaseText(), __FILE__, __LINE__); return false; } // Distribute Inventory if (distributeInventory::SeriesAdjust(_itemlocseries, this) == XDialog::Rejected) { QMessageBox::information( this, tr("Post Misc. Production"), tr("Transaction Canceled") ); return false; } return true; } bool postMiscProduction::closewo() { XSqlQuery close; close.prepare("SELECT closeWo(:wo_id, TRUE, CURRENT_DATE) AS result;"); close.bindValue(":wo_id", _woid); close.exec(); if (close.first()) { if (close.value("result").toInt() < 0) { systemError(this, storedProcErrorLookup("closeWo", close.value("result").toInt()), __FILE__, __LINE__); return false; } } else if (close.lastError().type() != QSqlError::NoError) { systemError(this, close.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } bool postMiscProduction::transfer() { XSqlQuery posttransfer; posttransfer.prepare( "SELECT interWarehouseTransfer( :item_id, :from_warehous_id, :to_warehous_id," " :qty, 'W', :documentNumber, 'Transfer from Misc. Production Posting' ) AS result;" ); posttransfer.bindValue(":item_id", _item->id()); posttransfer.bindValue(":from_warehous_id", _warehouse->id()); posttransfer.bindValue(":to_warehous_id", _transferWarehouse->id()); posttransfer.bindValue(":qty", _qty * _sense); posttransfer.bindValue(":documentNumber", _documentNum->text().trimmed()); posttransfer.exec(); if (posttransfer.first()) { if (distributeInventory::SeriesAdjust(posttransfer.value("result").toInt(), this) == XDialog::Rejected) { QMessageBox::information( this, tr("Post Misc. Production"), tr("Transaction Canceled") ); return false; } } else { systemError( this, tr("A System Error occurred at interWarehousTransfer::%1, Item Site ID #%2, Site ID #%3 to Site ID #%4.") .arg(__LINE__) .arg(_item->id()) .arg(_warehouse->id()) .arg(_transferWarehouse->id())); return false; } return true; } void postMiscProduction::clear() { _item->setId(-1); _qtyToPost->clear(); _documentNum->clear(); _comments->clear(); _close->setText(tr("&Close")); _item->setFocus(); } qt-client-4.1.0/guiclient/postMiscProduction.h000066400000000000000000000026331217451700100214220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTMISCPRODUCTION_H #define POSTMISCPRODUCTION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postMiscProduction.h" class postMiscProduction : public XDialog, public Ui::postMiscProduction { Q_OBJECT public: postMiscProduction(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postMiscProduction(); Q_INVOKABLE int getwoid() { return _woid; } Q_INVOKABLE bool captive() { return _captive; } Q_INVOKABLE bool okToPost(); Q_INVOKABLE bool createwo(); Q_INVOKABLE bool closewo(); Q_INVOKABLE bool transfer(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void clear(); virtual void sPost(); protected slots: virtual void languageChange(); private: bool post(); bool _captive; int _sense; int _itemsiteid; int _woid; double _qty; }; #endif // POSTMISCPRODUCTION_H qt-client-4.1.0/guiclient/postMiscProduction.ui000066400000000000000000000335771217451700100216230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postMiscProduction 0 0 529 521 Post Miscellaneous Production 7 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel false &Post true Qt::Vertical QSizePolicy::Preferred 20 20 12 Assembly true Disassembly Qt::Horizontal 40 20 &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse WComboBox::Supply Qt::Horizontal QSizePolicy::Preferred 20 20 &Qty. to Post: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyToPost 0 0 Qt::AlignRight Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Backflush &Materials false 0 Qt::Horizontal QSizePolicy::Fixed 10 20 0 0 &Issue Items not on Pick List Qt::Vertical 20 0 0 Co&mments: _comments Immediate &Transfer to Site: 0 false WComboBox::NonTransit Qt::Horizontal QSizePolicy::Expanding 20 20 ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _qtyToPost _documentNum _comments _immediateTransfer _transferWarehouse _post _close _item valid(bool) _post setEnabled(bool) 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _close clicked() postMiscProduction reject() 20 20 20 20 _item newId(int) _transferWarehouse findItemsites(int) 20 20 20 20 _immediateTransfer toggled(bool) _transferWarehouse setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/postPoReturnCreditMemo.cpp000066400000000000000000000054311217451700100225410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postPoReturnCreditMemo.h" #include #include #include postPoReturnCreditMemo::postPoReturnCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _qty->setPrecision(omfgThis->qtyVal()); _porejectid = -1; } postPoReturnCreditMemo::~postPoReturnCreditMemo() { // no need to delete child widgets, Qt does it all for us } void postPoReturnCreditMemo::languageChange() { retranslateUi(this); } enum SetResponse postPoReturnCreditMemo::set(const ParameterList & pParams) { XSqlQuery postet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("poreject_id", &valid); if(valid) { _porejectid = param.toInt(); postet.prepare("SELECT pohead_curr_id," " COALESCE(item_number, poitem_vend_item_number) AS itemnumber," " poreject_qty," " (COALESCE(recv_purchcost, poitem_unitprice) * poreject_qty) AS itemAmount" " FROM poreject JOIN poitem ON (poitem_id=poreject_poitem_id)" " JOIN pohead ON (pohead_id=poitem_pohead_id)" " LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id)" " LEFT OUTER JOIN item ON (itemsite_item_id=item_id)" " LEFT OUTER JOIN recv ON (recv_id=poreject_recv_id) " " WHERE (poreject_id=:poreject_id);"); postet.bindValue(":poreject_id", _porejectid); postet.exec(); if(postet.first()) { _item->setText(postet.value("itemNumber").toString()); _qty->setDouble(postet.value("poreject_qty").toDouble()); _amount->set(postet.value("itemAmount").toDouble(), postet.value("pohead_curr_id").toInt(), QDate::currentDate(), FALSE); } } return NoError; } void postPoReturnCreditMemo::sPost() { XSqlQuery postPost; postPost.prepare("SELECT postPoReturnCreditMemo(:poreject_id, :amount) AS result;"); postPost.bindValue(":poreject_id", _porejectid); postPost.bindValue(":amount", _amount->localValue()); if(!postPost.exec()) { systemError( this, tr("A System Error occurred at postPoReturnCreditMemo::%1.") .arg(__LINE__) ); return; } accept(); } qt-client-4.1.0/guiclient/postPoReturnCreditMemo.h000066400000000000000000000020751217451700100222070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTPORETURNCREDITMEMO_H #define POSTPORETURNCREDITMEMO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postPoReturnCreditMemo.h" class postPoReturnCreditMemo : public XDialog, public Ui::postPoReturnCreditMemo { Q_OBJECT public: postPoReturnCreditMemo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postPoReturnCreditMemo(); public slots: virtual enum SetResponse set(const ParameterList &); virtual void sPost(); protected slots: virtual void languageChange(); private: int _porejectid; }; #endif // POSTPORETURNCREDITMEMO_H qt-client-4.1.0/guiclient/postPoReturnCreditMemo.ui000066400000000000000000000154461217451700100224030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postPoReturnCreditMemo 0 0 389 208 Post PO Return Credit Memo 9 6 0 6 5 1 0 0 The selected P/O Return will create a Credit Memo for the following amount. You may change this value if necessary before posting. Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop true 0 0 0 6 Amount: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 _amount Line Item: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 5 0 0 false Reject Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter n/a n/a Qt::Vertical 21 0 0 0 0 5 &Cancel &Post true Qt::Vertical QSizePolicy::Expanding 20 0 CurrCluster CurrDisplay
    currcluster.h
    _amount _post _close _close clicked() postPoReturnCreditMemo reject() 327 27 289 13
    qt-client-4.1.0/guiclient/postProduction.cpp000066400000000000000000000336121217451700100211420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postProduction.h" #include #include #include #include "closeWo.h" #include "distributeInventory.h" #include "inputManager.h" #include "scrapWoMaterialFromWIP.h" #include "storedProcErrorLookup.h" #define DEBUG false postProduction::postProduction(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if (DEBUG) qDebug("postProduction()'s _qty is at %p, _post is at %p", _qty, _post); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_wo, SIGNAL(newId(int)), this, SLOT(sHandleWoid(int))); _captive = false; _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); _wo->setType(cWoExploded | cWoReleased | cWoIssued); omfgThis->inputManager()->notify(cBCWorkOrder, this, this, SLOT(sCatchWoid(int))); _closeWo->setEnabled(_privileges->check("CloseWorkOrders")); _qty->setValidator(omfgThis->qtyVal()); _qtyOrdered->setPrecision(decimalPlaces("qty")); _qtyReceived->setPrecision(decimalPlaces("qty")); _qtyBalance->setPrecision(decimalPlaces("qty")); if (!_metrics->boolean("MultiWhs")) { _immediateTransfer->hide(); _transferWarehouse->hide(); } if (_preferences->boolean("XCheckBox/forgetful")) _backflush->setChecked(true); _nonPickItems->setEnabled(_backflush->isChecked() && _privileges->check("ChangeNonPickItems")); // TODO: unhide as part of implementation of 5847 _nonPickItems->hide(); _transferWarehouse->setEnabled(_immediateTransfer->isChecked()); } postProduction::~postProduction() { // no need to delete child widgets, Qt does it all for us } void postProduction::languageChange() { retranslateUi(this); } enum SetResponse postProduction::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } param = pParams.value("backflush", &valid); if (valid) _backflush->setChecked(param.toBool()); return NoError; } void postProduction::sHandleWoid(int pWoid) { XSqlQuery postHandleWoid; if (DEBUG) qDebug("postProduction::sHandleWoid(%d) entered with method %s", pWoid, qPrintable(_wo->method())); if (_wo->method() == "D") { _qtyOrderedLit->setText(tr("Qty. to Disassemble:")); _qtyReceivedLit->setText(tr("Qty. Disassembled:")); _backflush->setEnabled(FALSE); _backflush->setChecked(FALSE); } else { _qtyOrderedLit->setText(tr("Qty. Ordered:")); _qtyReceivedLit->setText(tr("Qty. Received:")); postHandleWoid.prepare( "SELECT womatl_issuemethod " "FROM womatl " "WHERE (womatl_wo_id=:womatl_wo_id);" ); postHandleWoid.bindValue(":womatl_wo_id", pWoid); postHandleWoid.exec(); if (postHandleWoid.first()) { if (postHandleWoid.findFirst("womatl_issuemethod", "L") != -1) { _backflush->setEnabled(FALSE); _backflush->setChecked(TRUE); } else if (postHandleWoid.findFirst("womatl_issuemethod", "M") != -1) { _backflush->setEnabled(TRUE); _backflush->setChecked(TRUE); } else { _backflush->setEnabled(FALSE); _backflush->setChecked(FALSE); } } } } void postProduction::sReadWorkOrder(int pWoid) { _wo->setId(pWoid); } void postProduction::sScrap() { ParameterList params; params.append("wo_id", _wo->id()); params.append("transDate", _transDate->date()); scrapWoMaterialFromWIP newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } bool postProduction::okToPost() { if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return false; } /* XSqlQuery type; type.prepare( "SELECT itemsite_costmethod " "FROM itemsite,wo " "WHERE ((wo_id=:wo_id) " "AND (wo_itemsite_id=itemsite_id)); "); type.bindValue(":wo_id", _wo->id()); type.exec(); if (type.first() && type.value("itemsite_costmethod").toString() == "J") { QMessageBox::critical( this, tr("Invalid Work Order"), tr("

    Work Orders Item Sites with the Job cost method " "are posted when shipping the Sales Order they are " "associated with.") ); return false; } else if (type.lastError().type() != QSqlError::NoError) { systemError(this, type.lastError().databaseText(), __FILE__, __LINE__); return false; } */ if (_immediateTransfer->isChecked() && _wo->currentWarehouse() == _transferWarehouse->id()) { QMessageBox::critical(this, tr("Same Transfer and Production Sites"), tr("

    You have selected an Interwarehouse Transfer " "but the Transfer and Production Sites are the " "same. Either choose a different Transfer Site or " "uncheck the Immediate Transfer box.")); _transferWarehouse->setFocus(); return false; } return true; } QString postProduction::updateWoAfterPost() { QString result = QString::null; if (_productionNotes->toPlainText().trimmed().length()) { XSqlQuery woq; woq.prepare( "UPDATE wo " "SET wo_prodnotes=(wo_prodnotes || :productionNotes || '\n') " "WHERE (wo_id=:wo_id);" ); woq.bindValue(":productionNotes", _productionNotes->toPlainText().trimmed()); woq.bindValue(":wo_id", _wo->id()); woq.exec(); if (woq.lastError().type() != QSqlError::NoError) result = woq.lastError().databaseText(); } if (DEBUG) qDebug("postProduction::updateWoAfterPost() returning %s", qPrintable(result)); return result; } QString postProduction::handleSeriesAdjustAfterPost(int itemlocSeries) { QString result = QString::null; if (distributeInventory::SeriesAdjust(itemlocSeries, this) == XDialog::Rejected) result = tr("Transaction Canceled"); if (DEBUG) qDebug("postProduction::handleSeriesAdjustAfterPost() returning %s", qPrintable(result)); return result; } QString postProduction::handleTransferAfterPost() { QString result = QString::null; if (_immediateTransfer->isChecked()) { if (_wo->currentWarehouse() == _transferWarehouse->id()) result = tr("

    Cannot post an immediate transfer for the newly posted " "production as the transfer Site is the same as the " "production Site. You must manually transfer the " "production to the intended Site."); else { XSqlQuery xferq; xferq.prepare("SELECT interWarehouseTransfer(itemsite_item_id, " " itemsite_warehous_id, :to_warehous_id, :qty," " 'W', formatWoNumber(wo_id)," " 'Immediate Transfer from Production Posting') AS result" " FROM wo, itemsite " " WHERE ( (wo_itemsite_id=itemsite_id)" " AND (wo_id=:wo_id) );" ); xferq.bindValue(":wo_id", _wo->id()); xferq.bindValue(":to_warehous_id", _transferWarehouse->id()); xferq.bindValue(":qty", _qty->toDouble()); xferq.exec(); if (xferq.first() && distributeInventory::SeriesAdjust(xferq.value("result").toInt(), this) == XDialog::Rejected) result = tr("Transaction Canceled"); else if (xferq.lastError().type() != QSqlError::NoError) result = xferq.lastError().databaseText(); } } if (DEBUG) qDebug("postProduction::handleTransferAfterPost() returning %s", qPrintable(result)); return result; } QString postProduction::handleIssueToParentAfterPost(int itemlocSeries) { QString result = QString::null; XSqlQuery issueq; // If this is a child W/O and the originating womatl // is auto issue then issue this receipt to the parent W/O issueq.prepare("SELECT issueWoMaterial(womatl_id, :qty," " :itemlocseries, NOW(), invhist_id ) AS result " "FROM wo, womatl, invhist " "WHERE (wo_id=:wo_id)" " AND (womatl_id=wo_womatl_id)" " AND (womatl_issuewo)" " AND (invhist_series=:itemlocseries)" " AND (invhist_transtype='RM');"); issueq.bindValue(":itemlocseries", itemlocSeries); issueq.bindValue(":wo_id", _wo->id()); issueq.bindValue(":qty", _qty->toDouble()); issueq.exec(); if (issueq.first()) { if (issueq.value("result").toInt() < 0) result = "issueWoMaterial failed"; else { issueq.prepare("SELECT postItemLocSeries(:itemlocseries);"); issueq.bindValue(":itemlocseries", itemlocSeries); issueq.exec(); if (issueq.lastError().type() != QSqlError::NoError) result = issueq.lastError().databaseText(); } } else if (issueq.lastError().type() != QSqlError::NoError) result = issueq.lastError().databaseText(); // If this is a W/O for a Job Cost item and the parent is a S/O // then issue this receipt to the S/O issueq.prepare("SELECT issueToShipping('SO', coitem_id, :qty," " :itemlocseries, NOW(), invhist_id) AS result " "FROM wo, itemsite, coitem, invhist " "WHERE (wo_id=:wo_id)" " AND (wo_ordtype='S')" " AND (itemsite_id=wo_itemsite_id)" " AND (itemsite_costmethod='J')" " AND (coitem_id=wo_ordid)" " AND (invhist_series=:itemlocseries)" " AND (invhist_transtype='RM');"); issueq.bindValue(":itemlocseries", itemlocSeries); issueq.bindValue(":wo_id", _wo->id()); issueq.bindValue(":qty", _qty->toDouble()); issueq.exec(); if (issueq.first()) { if (issueq.value("result").toInt() < 0) result = "issueToShipping failed"; else { issueq.prepare("SELECT postItemLocSeries(:itemlocseries);"); issueq.bindValue(":itemlocseries", itemlocSeries); issueq.exec(); if (issueq.lastError().type() != QSqlError::NoError) result = issueq.lastError().databaseText(); } } else if (issueq.lastError().type() != QSqlError::NoError) result = issueq.lastError().databaseText(); if (DEBUG) qDebug("postProduction::handleIssueToParentAfterPost() returning %s", qPrintable(result)); return result; } void postProduction::sPost() { XSqlQuery postPost; if (! okToPost()) return; // xtmfg calls postProduction::okToPost() but not ::sPost() && has a situation // where qty 0 is OK, so don't move the _qty == 0 check to okToPost() if (_qty->toDouble() == 0.0) { QMessageBox::critical(this, tr("Enter Quantity to Post"), tr("You must enter a quantity of production to Post.") ); _qty->setFocus(); return; } int itemlocSeries = 0; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); postPost.exec("BEGIN;"); // handle cancel of lot, serial, or loc distributions postPost.prepare("SELECT postProduction(:wo_id, :qty, :backflushMaterials, 0, :date) AS result;"); postPost.bindValue(":wo_id", _wo->id()); if (_wo->method() == "A") postPost.bindValue(":qty", _qty->toDouble()); else postPost.bindValue(":qty", _qty->toDouble() * -1); postPost.bindValue(":backflushMaterials", QVariant(_backflush->isChecked())); postPost.bindValue(":date", _transDate->date()); postPost.exec(); if (postPost.first()) { itemlocSeries = postPost.value("result").toInt(); if (itemlocSeries < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postProduction", itemlocSeries), __FILE__, __LINE__); return; } QString errmsg = updateWoAfterPost(); if (! errmsg.isEmpty()) { rollback.exec(); systemError(this, errmsg, __FILE__, __LINE__); return; } errmsg = handleSeriesAdjustAfterPost(itemlocSeries); if (! errmsg.isEmpty()) { rollback.exec(); QMessageBox::information(this, tr("Post Production"), errmsg); return; } errmsg = handleIssueToParentAfterPost(itemlocSeries); if (! errmsg.isEmpty()) { rollback.exec(); systemError(this, errmsg, __FILE__, __LINE__); return; } errmsg = handleTransferAfterPost(); if (! errmsg.isEmpty()) { rollback.exec(); systemError(this, errmsg, __FILE__, __LINE__); return; } postPost.exec("COMMIT;"); omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); if (_closeWo->isChecked()) { ParameterList params; params.append("wo_id", _wo->id()); params.append("transDate", _transDate->date()); closeWo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } else if (postPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, postPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (_scrap->isChecked()) sScrap(); if (_captive) done(itemlocSeries); else clear(); } void postProduction::sCatchWoid(int pWoid) { _wo->setId(pWoid); _qty->setFocus(); } void postProduction::clear() { _wo->setId(-1); _qty->clear(); _productionNotes->clear(); _immediateTransfer->setChecked(FALSE); _closeWo->setChecked(FALSE); _close->setText(tr("&Close")); _wo->setFocus(); } qt-client-4.1.0/guiclient/postProduction.h000066400000000000000000000030051217451700100206000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTPRODUCTION_H #define POSTPRODUCTION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postProduction.h" class postProduction : public XDialog, public Ui::postProduction { Q_OBJECT public: postProduction(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postProduction(); Q_INVOKABLE bool captive() { return _captive; } Q_INVOKABLE QString handleSeriesAdjustAfterPost(int itemlocSeries); Q_INVOKABLE QString handleTransferAfterPost(); Q_INVOKABLE QString handleIssueToParentAfterPost(int itemlocSeries); Q_INVOKABLE bool okToPost(); Q_INVOKABLE QString updateWoAfterPost(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void clear(); virtual void sHandleWoid( int pWoid ); virtual void sReadWorkOrder( int pWoid ); virtual void sPost(); virtual void sScrap(); virtual void sCatchWoid( int pWoid ); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // POSTPRODUCTION_H qt-client-4.1.0/guiclient/postProduction.ui000066400000000000000000000437171217451700100210040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postProduction 0 0 545 600 Post Production Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Cancel false &Post true Qt::Vertical 20 20 Qt::StrongFocus Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Qty. to Post: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty Qt::AlignRight Qt::Vertical 20 0 Backflush &Materials true 0 Qt::Horizontal QSizePolicy::Fixed 10 20 0 0 &Issue Items not on Pick List 0 0 Close &Work Order after Posting Qt::Vertical 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 0 0 20 Production Notes: 0 2 true true Immediate &Transfer to Site: false Qt::Horizontal QSizePolicy::Expanding 20 20 Scrap on Post Qt::Horizontal 40 20 DLineEdit QWidget

    datecluster.h
    WComboBox XComboBox
    wcombobox.h
    WoCluster QWidget
    wocluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    XTextEdit QTextEdit
    xtextedit.h
    _transDate _wo _qty _backflush _nonPickItems _closeWo _productionNotes _transferWarehouse _close _immediateTransfer _wo qtyOrderedChanged(double) _qtyOrdered setDouble(double) 20 20 20 20 _wo qtyReceivedChanged(double) _qtyReceived setDouble(double) 20 20 20 20 _wo qtyBalanceChanged(double) _qtyBalance setDouble(double) 20 20 20 20 _wo valid(bool) _post setEnabled(bool) 20 20 20 20 _backflush toggled(bool) _nonPickItems setEnabled(bool) 20 20 20 20 _close clicked() postProduction reject() 20 20 20 20 _wo newItemid(int) _transferWarehouse findItemsites(int) 20 20 20 20 _immediateTransfer toggled(bool) _transferWarehouse setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/postPurchaseOrder.cpp000066400000000000000000000032751217451700100215640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postPurchaseOrder.h" #include postPurchaseOrder::postPurchaseOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_po, SIGNAL(valid(bool)), _release, SLOT(setEnabled(bool))); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _captive = false; } postPurchaseOrder::~postPurchaseOrder() { // no need to delete child widgets, Qt does it all for us } void postPurchaseOrder::languageChange() { retranslateUi(this); } enum SetResponse postPurchaseOrder::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = true; QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _po->setId(param.toInt()); } return NoError; } void postPurchaseOrder::sRelease() { XSqlQuery postRelease; postRelease.prepare("SELECT releasePurchaseOrder(:pohead_id) AS result;"); postRelease.bindValue(":pohead_id", _po->id()); postRelease.exec(); omfgThis->sPurchaseOrdersUpdated(_po->id(), true); if (_captive) accept(); else { _close->setText(tr("&Close")); _po->setId(-1); _po->setFocus(); } } qt-client-4.1.0/guiclient/postPurchaseOrder.h000066400000000000000000000020371217451700100212240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTPURCHASEORDER_H #define POSTPURCHASEORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postPurchaseOrder.h" class postPurchaseOrder : public XDialog, public Ui::postPurchaseOrder { Q_OBJECT public: postPurchaseOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postPurchaseOrder(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sRelease(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // POSTPURCHASEORDER_H qt-client-4.1.0/guiclient/postPurchaseOrder.ui000066400000000000000000000075301217451700100214150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postPurchaseOrder 0 0 409 84 Release Purchase Order 0 5 OrderLineEdit::Unposted OrderLineEdit::Purchase Qt::Horizontal QSizePolicy::Expanding 20 20 &Cancel false &Release true true Qt::Vertical QSizePolicy::Expanding 20 20 OrderCluster QWidget
    ordercluster.h
    _release _close parameter.h _po valid(bool) _release setEnabled(bool) 20 20 20 20 _close clicked() postPurchaseOrder reject() 20 20 20 20
    qt-client-4.1.0/guiclient/postPurchaseOrdersByAgent.cpp000066400000000000000000000040301217451700100232070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postPurchaseOrdersByAgent.h" #include #include postPurchaseOrdersByAgent::postPurchaseOrdersByAgent(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _agent->setText(omfgThis->username()); } postPurchaseOrdersByAgent::~postPurchaseOrdersByAgent() { // no need to delete child widgets, Qt does it all for us } void postPurchaseOrdersByAgent::languageChange() { retranslateUi(this); } void postPurchaseOrdersByAgent::sRelease() { XSqlQuery postRelease; static bool run = false; if (run) return; run = true; QString sql("SELECT COUNT(releasePurchaseOrder(pohead_id)) AS result " " FROM ( SELECT pohead_id, pohead_agent_username " " FROM pohead, poitem " " WHERE ( (poitem_pohead_id=pohead_id)" " AND (poitem_status='U') ) ) AS data " " WHERE ( (checkPOSitePrivs(pohead_id))"); if(_selectedAgent->isChecked()) sql += " AND (pohead_agent_username=:username)"; sql += ")"; postRelease.prepare(sql); postRelease.bindValue(":username", _agent->currentText()); postRelease.exec(); if (postRelease.first()) { QMessageBox::information( this, tr("Purchase Orders Released"), tr("%1 Purchase Orders have been released.") .arg(postRelease.value("result").toString()) ); omfgThis->sPurchaseOrdersUpdated(-1, TRUE); } accept(); run = false; } qt-client-4.1.0/guiclient/postPurchaseOrdersByAgent.h000066400000000000000000000017521217451700100226640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTPURCHASEORDERSBYAGENT_H #define POSTPURCHASEORDERSBYAGENT_H #include "guiclient.h" #include "xdialog.h" #include "ui_postPurchaseOrdersByAgent.h" class postPurchaseOrdersByAgent : public XDialog, public Ui::postPurchaseOrdersByAgent { Q_OBJECT public: postPurchaseOrdersByAgent(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postPurchaseOrdersByAgent(); public slots: virtual void sRelease(); protected slots: virtual void languageChange(); }; #endif // POSTPURCHASEORDERSBYAGENT_H qt-client-4.1.0/guiclient/postPurchaseOrdersByAgent.ui000066400000000000000000000126741217451700100230570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postPurchaseOrdersByAgent 0 0 436 98 Release Purchase Orders by Purchasing Agent 9 6 0 0 9 6 All Purchasing Agents 0 6 Purchasing Agent: true 7 0 0 0 XComboBox::Agent Qt::Vertical QSizePolicy::MinimumExpanding 328 0 0 0 0 5 &Cancel true &Release true true Qt::Vertical QSizePolicy::Expanding 20 0 XComboBox QComboBox
    xcombobox.h
    _allAgents _selectedAgent _agent _release _close _close clicked() postPurchaseOrdersByAgent reject() 20 20 20 20
    qt-client-4.1.0/guiclient/postStandardJournal.cpp000066400000000000000000000055111217451700100221040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postStandardJournal.h" #include #include #include "glSeries.h" postStandardJournal::postStandardJournal(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit())); if (!_metrics->boolean("EnableBatchManager")) _submit->hide(); _captive = false; _doSubmit = false; _stdjrnl->setAllowNull(TRUE); _stdjrnl->populate( "SELECT stdjrnl_id, stdjrnl_name " "FROM stdjrnl " "ORDER BY stdjrnl_name;" ); } postStandardJournal::~postStandardJournal() { // no need to delete child widgets, Qt does it all for us } void postStandardJournal::languageChange() { retranslateUi(this); } enum SetResponse postStandardJournal::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("stdjrnl_id", &valid); if (valid) { _stdjrnl->setId(param.toInt()); _stdjrnl->setEnabled(false); } return NoError; } void postStandardJournal::sPost() { XSqlQuery postPost; if (!_distDate->isValid()) { QMessageBox::critical( this, tr("Cannot Post Standard Journal"), tr("You must enter a Distribution Date before you may post this Standard Journal.") ); _distDate->setFocus(); return; } postPost.prepare("SELECT postStandardJournal(:stdjrnl_id, :distDate, :reverse) AS result;"); postPost.bindValue(":stdjrnl_id", _stdjrnl->id()); postPost.bindValue(":distDate", _distDate->date()); postPost.bindValue(":reverse", QVariant(_reverse->isChecked())); postPost.exec(); if (postPost.first()) { ParameterList params; params.append("mode", "postStandardJournal"); params.append("glSequence", postPost.value("result")); if(_doSubmit) params.append("submit"); glSeries newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); if (_captive) accept(); { _stdjrnl->setNull(); _close->setText(tr("&Close")); _stdjrnl->setFocus(); } } void postStandardJournal::sSubmit() { _doSubmit = true; sPost(); _doSubmit = false; } qt-client-4.1.0/guiclient/postStandardJournal.h000066400000000000000000000021361217451700100215510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTSTANDARDJOURNAL_H #define POSTSTANDARDJOURNAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postStandardJournal.h" class postStandardJournal : public XDialog, public Ui::postStandardJournal { Q_OBJECT public: postStandardJournal(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postStandardJournal(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPost(); virtual void sSubmit(); protected slots: virtual void languageChange(); private: bool _captive; bool _doSubmit; }; #endif // POSTSTANDARDJOURNAL_H qt-client-4.1.0/guiclient/postStandardJournal.ui000066400000000000000000000167451217451700100217520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postStandardJournal 0 0 431 105 Post Standard Journal 5 7 0 0 0 5 Qt::Horizontal QSizePolicy::Minimum 100 20 Standard Journal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _stdjrnl Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _distDate Reverse Journal Entries 0 0 Qt::Horizontal QSizePolicy::Expanding 31 10 Qt::Vertical QSizePolicy::Expanding 16 16 0 0 0 5 &Cancel false &Post true true false Schedule Qt::Vertical QSizePolicy::Expanding 16 43 DLineEdit XLineEdit
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    _stdjrnl _distDate _reverse _post _submit _close _close clicked() postStandardJournal reject() 369 27 20 20 _stdjrnl notNull(bool) _post setEnabled(bool) 132 27 369 59 _stdjrnl notNull(bool) _submit setEnabled(bool) 225 25 361 80
    qt-client-4.1.0/guiclient/postStandardJournalGroup.cpp000066400000000000000000000056631217451700100231310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postStandardJournalGroup.h" #include #include #include "glSeries.h" postStandardJournalGroup::postStandardJournalGroup(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit())); if (!_metrics->boolean("EnableBatchManager")) _submit->hide(); _captive = false; _doSubmit = false; _stdjrnlgrp->setAllowNull(TRUE); _stdjrnlgrp->populate( "SELECT stdjrnlgrp_id, stdjrnlgrp_name " "FROM stdjrnlgrp " "ORDER BY stdjrnlgrp_name;" ); } postStandardJournalGroup::~postStandardJournalGroup() { // no need to delete child widgets, Qt does it all for us } void postStandardJournalGroup::languageChange() { retranslateUi(this); } enum SetResponse postStandardJournalGroup::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("stdjrnlgrp_id", &valid); if (valid) { _stdjrnlgrp->setId(param.toInt()); _stdjrnlgrp->setEnabled(false); } return NoError; } void postStandardJournalGroup::sPost() { XSqlQuery postPost; if (!_distDate->isValid()) { QMessageBox::critical( this, tr("Cannot Post Standard Journal Group"), tr("You must enter a Distribution Date before you may post this Standard Journal Group.") ); _distDate->setFocus(); return; } postPost.prepare("SELECT postStandardJournalGroup(:stdjrnlgrp_id, :distDate, :reverse) AS result;"); postPost.bindValue(":stdjrnlgrp_id", _stdjrnlgrp->id()); postPost.bindValue(":distDate", _distDate->date()); postPost.bindValue(":reverse", QVariant(_reverse->isChecked())); postPost.exec(); if (postPost.first()) { ParameterList params; params.append("mode", "postStandardJournal"); params.append("glSequence", postPost.value("result")); if(_doSubmit) params.append("submit"); glSeries newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); if (_captive) accept(); { _stdjrnlgrp->setNull(); _close->setText(tr("&Close")); _stdjrnlgrp->setFocus(); } } void postStandardJournalGroup::sSubmit() { _doSubmit = true; sPost(); _doSubmit = false; } qt-client-4.1.0/guiclient/postStandardJournalGroup.h000066400000000000000000000022061217451700100225640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTSTANDARDJOURNALGROUP_H #define POSTSTANDARDJOURNALGROUP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postStandardJournalGroup.h" class postStandardJournalGroup : public XDialog, public Ui::postStandardJournalGroup { Q_OBJECT public: postStandardJournalGroup(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postStandardJournalGroup(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPost(); virtual void sSubmit(); protected slots: virtual void languageChange(); private: bool _captive; bool _doSubmit; }; #endif // POSTSTANDARDJOURNALGROUP_H qt-client-4.1.0/guiclient/postStandardJournalGroup.ui000066400000000000000000000170121217451700100227530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postStandardJournalGroup 0 0 450 105 Post Standard Journal Group 5 7 0 0 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 31 10 Reverse Journal Entries Standard Journal Group: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _stdjrnlgrp Qt::Horizontal QSizePolicy::Minimum 142 20 Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _distDate Qt::Vertical QSizePolicy::Expanding 16 16 0 0 0 5 &Cancel false &Post true true false Schedule Qt::Vertical QSizePolicy::Expanding 16 43 DLineEdit XLineEdit
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    _stdjrnlgrp _distDate _reverse _post _submit _close _close clicked() postStandardJournalGroup reject() 388 27 20 20 _stdjrnlgrp notNull(bool) _post setEnabled(bool) 174 27 388 59 _stdjrnlgrp notNull(bool) _submit setEnabled(bool) 279 30 390 87
    qt-client-4.1.0/guiclient/postVouchers.cpp000066400000000000000000000070201217451700100206040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "postVouchers.h" #include #include #include postVouchers::postVouchers(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); if (_preferences->boolean("XCheckBox/forgetful")) _printJournal->setChecked(true); } postVouchers::~postVouchers() { // no need to delete child widgets, Qt does it all for us } void postVouchers::languageChange() { retranslateUi(this); } void postVouchers::sPost() { XSqlQuery postPost; postPost.prepare("SELECT count(*) AS unposted FROM vohead WHERE (NOT vohead_posted)"); postPost.exec(); if(postPost.first() && postPost.value("unposted").toInt()==0) { QMessageBox::critical( this, tr("No Vouchers to Post"), tr("There are no Vouchers to post.") ); return; } postPost.prepare("SELECT postVouchers(FALSE) AS result;"); postPost.exec(); if (postPost.first()) { int result = postPost.value("result").toInt(); if (result == -5) { QMessageBox::critical( this, tr("Cannot Post Voucher"), tr( "The Cost Category(s) for one or more Item Sites for the Purchase Order covered by one or more\n" "of the Vouchers that you are trying to post is not configured with Purchase Price Variance or\n" "P/O Liability Clearing Account Numbers or the Vendor of these Vouchers is not configured with an\n" "A/P Account Number. Because of this, G/L Transactions cannot be posted for these Vouchers.\n" "You must contact your Systems Administrator to have this corrected before you may\n" "post Vouchers." ) ); return; } else if (result < 0) { systemError( this, tr("A System Error occurred at %1::%2, Error #%3.") .arg(__FILE__) .arg(__LINE__) .arg(result) ); return; } omfgThis->sVouchersUpdated(); if (_printJournal->isChecked()) { ParameterList params; params.append("source", "A/P"); params.append("sourceLit", tr("A/P")); params.append("startJrnlnum", result); params.append("endJrnlnum", result); if (_metrics->boolean("UseJournals")) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); } orReport report("GLSeries", params); if (report.isValid()) report.print(); else report.reportError(this); } } else { systemError( this, tr("A System Error occurred at %1::%2.\n%3") .arg(__FILE__) .arg(__LINE__) .arg(postPost.lastError().databaseText()) ); return; } accept(); } qt-client-4.1.0/guiclient/postVouchers.h000066400000000000000000000016261217451700100202570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef POSTVOUCHERS_H #define POSTVOUCHERS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_postVouchers.h" class postVouchers : public XDialog, public Ui::postVouchers { Q_OBJECT public: postVouchers(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~postVouchers(); public slots: virtual void sPost(); protected slots: virtual void languageChange(); }; #endif // POSTVOUCHERS_H qt-client-4.1.0/guiclient/postVouchers.ui000066400000000000000000000105701217451700100204430ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. postVouchers 0 0 325 87 Post Vouchers 5 7 0 0 P&rint Journal Qt::Vertical QSizePolicy::Expanding 20 20 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 0 5 &Cancel &Post true Qt::Vertical QSizePolicy::Preferred 20 20 XCheckBox QCheckBox
    xcheckbox.h
    _printJournal _post _close _close clicked() postVouchers reject() 20 20 20 20
    qt-client-4.1.0/guiclient/prepareCheckRun.cpp000066400000000000000000000043471217451700100211720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "prepareCheckRun.h" #include #include #include #include "storedProcErrorLookup.h" prepareCheckRun::prepareCheckRun(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_prepare, SIGNAL(clicked()), this, SLOT(sPrint())); _checkDate->setDate(omfgThis->dbDate()); } prepareCheckRun::~prepareCheckRun() { // no need to delete child widgets, Qt does it all for us } void prepareCheckRun::languageChange() { retranslateUi(this); } enum SetResponse prepareCheckRun::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("bankaccnt_id", &valid); if (valid) { _bankaccnt->setId(param.toInt()); if (_bankaccnt->isValid()) _bankaccnt->setEnabled(FALSE); } return NoError; } void prepareCheckRun::sPrint() { XSqlQuery preparePrint; if(!_bankaccnt->isValid()) { QMessageBox::warning(this, tr("No Bank Account"), tr("You must select a Bank Account before you may continue.")); return; } preparePrint.prepare("SELECT createChecks(:bankaccnt_id, :checkDate) AS result;"); preparePrint.bindValue(":bankaccnt_id", _bankaccnt->id()); preparePrint.bindValue(":checkDate", _checkDate->date()); preparePrint.exec(); if (preparePrint.first()) { int result = preparePrint.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("createChecks", result), __FILE__, __LINE__); return; } } else if (preparePrint.lastError().type() != QSqlError::NoError) { systemError(this, preparePrint.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(_bankaccnt->id(), -1, TRUE); accept(); } qt-client-4.1.0/guiclient/prepareCheckRun.h000066400000000000000000000017531217451700100206350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PREPARECHECKRUN_H #define PREPARECHECKRUN_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_prepareCheckRun.h" class prepareCheckRun : public XDialog, public Ui::prepareCheckRun { Q_OBJECT public: prepareCheckRun(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~prepareCheckRun(); public slots: enum SetResponse set(const ParameterList &pParams); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // PREPARECHECKRUN_H qt-client-4.1.0/guiclient/prepareCheckRun.ui000066400000000000000000000230001217451700100210100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. prepareCheckRun 0 0 442 77 Prepare Check Run 7 5 5 5 5 0 0 0 0 0 5 0 0 0 0 5 0 0 0 0 Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Check Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 0 0 0 0 0 true XComboBox::APBankAccounts 0 0 0 0 0 0 0 0 0 0 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 71 10 Qt::Vertical QSizePolicy::Expanding 16 16 0 0 0 0 0 5 0 0 0 0 &Cancel &Prepare true true Qt::Vertical QSizePolicy::Expanding 10 31 DLineEdit QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    _bankaccnt _checkDate _prepare _close _close clicked() prepareCheckRun reject() 20 20 20 20
    qt-client-4.1.0/guiclient/priceList.cpp000066400000000000000000000205271217451700100200450ustar00rootroot00000000000000 /* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "priceList.h" #include #include #include "mqlutil.h" priceList::priceList(QWidget* parent, const char * name, Qt::WindowFlags fl) : XDialog(parent, name, fl) { setupUi(this); connect(_cust, SIGNAL(newId(int)), this, SLOT(sNewCust())); connect(_item, SIGNAL(newId(int)), this, SLOT(sNewItem())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sNewItem())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_price, SIGNAL(itemSelected(int)), _select, SLOT(animateClick())); connect(_price, SIGNAL(itemSelected(int)), this, SLOT(sSelect())); connect(_price, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); _price->addColumn(tr("Schedule"), -1, Qt::AlignLeft, true, "schedulename"); _price->addColumn(tr("Source"), _itemColumn, Qt::AlignLeft, true, "type"); _price->addColumn(tr("Qty. Break"), _qtyColumn, Qt::AlignRight, true, "qty_break"); _price->addColumn(tr("Qty. UOM"), _qtyColumn, Qt::AlignRight, true, "qty_uom"); _price->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "base_price"); _price->addColumn(tr("Price UOM"), _priceColumn, Qt::AlignRight, true, "price_uom"); _price->addColumn(tr("Percent"), _prcntColumn, Qt::AlignRight, true, "discountpercent"); _price->addColumn(tr("Fixed Amt."), _priceColumn, Qt::AlignRight, true, "discountfixed"); _price->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "price_type"); _price->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currency"); _price->addColumn(tr("Price (in Base)"), _priceColumn, Qt::AlignRight, true, "price"); // column title reset in priceList::set if (omfgThis->singleCurrency()) { _price->hideColumn(_price->column("price")); _price->hideColumn(_price->column("currency")); } _shiptoid = -1; _shiptonum = ""; _prodcatid = -1; _custtypeid = -1; _custtypecode = ""; _qty->setValidator(omfgThis->qtyVal()); _listPrice->setPrecision(omfgThis->priceVal()); _unitCost->setPrecision(omfgThis->costVal()); } priceList::~priceList() { // no need to delete child widgets, Qt does it all for us } void priceList::languageChange() { retranslateUi(this); } enum SetResponse priceList::set(const ParameterList &pParams) { XSqlQuery priceet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) { _cust->setId(param.toInt()); _cust->setReadOnly(true); } param = pParams.value("shipto_id", &valid); if (valid) { _shiptoid = param.toInt(); sNewShipto(); } param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(true); } param = pParams.value("warehouse_id", &valid); if (valid) { _warehouse->setId(param.toInt()); _warehouse->setEnabled(false); } param = pParams.value("curr_id", &valid); if (valid) { _curr_id = param.toInt(); if (! omfgThis->singleCurrency()) { priceet.prepare("SELECT currConcat(:curr_id) AS currConcat;"); priceet.bindValue(":curr_id", _curr_id); priceet.exec(); if (priceet.first()) _price->headerItem()->setText(_price->column("price"), tr("Price\n(in %1)") .arg(priceet.value("currConcat").toString())); } } param = pParams.value("effective", &valid); _effective = (valid) ? param.toDate() : QDate::currentDate(); param = pParams.value("asof", &valid); _asOf = (valid) ? param.toDate() : QDate::currentDate(); param = pParams.value("qty", &valid); if (valid) { _qty->setDouble(param.toDouble()); _qty->setEnabled(false); } sFillList(); return NoError; } void priceList::sNewCust() { if (_cust->isValid()) { XSqlQuery custq; custq.prepare("SELECT custtype_id, custtype_code" " FROM custinfo LEFT OUTER JOIN custtype ON (custtype_id=cust_custtype_id)" " WHERE (cust_id=:id);"); custq.bindValue(":id", _cust->id()); custq.exec(); if (custq.first()) { _custtypeid = custq.value("custtype_id").toInt(); _custtypecode = custq.value("custtype_code").toString(); } else if (custq.lastError().type() != QSqlError::NoError) { systemError(this, custq.lastError().text(), __FILE__, __LINE__); return; } } } void priceList::sNewShipto() { if (_shiptoid > 0) { XSqlQuery shiptoq; shiptoq.prepare("SELECT shipto_num" " FROM shiptoinfo" " WHERE (shipto_id=:id);"); shiptoq.bindValue(":id", _shiptoid); shiptoq.exec(); if (shiptoq.first()) { _shiptonum = shiptoq.value("shipto_num").toString(); } else if (shiptoq.lastError().type() != QSqlError::NoError) { systemError(this, shiptoq.lastError().text(), __FILE__, __LINE__); return; } } } void priceList::sNewItem() { _listPrice->clear(); _unitCost->clear(); if (_item->isValid()) { XSqlQuery itemq; itemq.prepare("SELECT item_listprice, item_listcost, item_prodcat_id," " itemCost(itemsite_id) AS item_unitcost" " FROM item LEFT OUTER JOIN itemsite ON (itemsite_item_id=item_id AND itemsite_warehous_id=:warehous_id)" " WHERE (item_id=:item_id);"); itemq.bindValue(":item_id", _item->id()); itemq.bindValue(":warehous_id", _warehouse->id()); itemq.exec(); if (itemq.first()) { _listPrice->setDouble(itemq.value("item_listprice").toDouble()); if (_metrics->boolean("WholesalePriceCosting")) _unitCost->setDouble(itemq.value("item_listcost").toDouble()); else _unitCost->setDouble(itemq.value("item_unitcost").toDouble()); _prodcatid = itemq.value("item_prodcat_id").toInt(); } else if (itemq.lastError().type() != QSqlError::NoError) { systemError(this, itemq.lastError().text(), __FILE__, __LINE__); return; } } } void priceList::sSelect() { _selectedPrice = _price->rawValue("base_price").toDouble(); accept(); } void priceList::sFillList() { bool ok = false; QString errString; MetaSQLQuery pricelistm = MQLUtil::mqlLoad("pricelist", "detail", errString, &ok); if (! ok) { systemError(this, errString, __FILE__, __LINE__); return; } ParameterList pricelistp; pricelistp.append("na", tr("N/A")); pricelistp.append("customer", tr("Customer")); pricelistp.append("shipTo", tr("Cust. Ship-To")); pricelistp.append("shipToPattern", tr("Cust. Ship-To Pattern")); pricelistp.append("custType", tr("Cust. Type")); pricelistp.append("custTypePattern", tr("Cust. Type Pattern")); pricelistp.append("sale", tr("Sale")); pricelistp.append("listPrice", tr("List Price")); pricelistp.append("nominal", tr("Nominal")); pricelistp.append("discount", tr("Discount")); pricelistp.append("markup", tr("Markup")); pricelistp.append("item_id", _item->id()); pricelistp.append("prodcat_id", _prodcatid); pricelistp.append("cust_id", _cust->id()); pricelistp.append("custtype_id", _custtypeid); pricelistp.append("custtype_code", _custtypecode); pricelistp.append("shipto_id", _shiptoid); pricelistp.append("shipto_num", _shiptonum); pricelistp.append("curr_id", _curr_id); pricelistp.append("effective", _effective); pricelistp.append("asof", _asOf); pricelistp.append("item_listprice", _listPrice->toDouble()); pricelistp.append("item_unitcost", _unitCost->toDouble()); XSqlQuery pricelistq = pricelistm.toQuery(pricelistp); _price->populate(pricelistq, true); } qt-client-4.1.0/guiclient/priceList.h000066400000000000000000000023621217451700100175070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRICELIST_H #define PRICELIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_priceList.h" class priceList : public XDialog, public Ui::priceList { Q_OBJECT public: priceList(QWidget* parent = 0, const char * = 0, Qt::WindowFlags fl = 0); ~priceList(); double _selectedPrice; int _curr_id; public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSelect(); virtual void sFillList(); protected: int _shiptoid; QString _shiptonum; int _prodcatid; int _custtypeid; QString _custtypecode; QDate _effective; QDate _asOf; protected slots: virtual void languageChange(); virtual void sNewCust(); virtual void sNewShipto(); virtual void sNewItem(); }; #endif // PRICELIST_H qt-client-4.1.0/guiclient/priceList.ui000066400000000000000000000175461217451700100177070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. priceList 0 0 652 405 Price List false true Quantity: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty 0 0 80 16777215 List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 4 158 &Cancel false &Select true true Qt::Vertical QSizePolicy::Expanding 89 20 &Items: _price 0 2 0 100 CustCluster QWidget
    custcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _cust _item _qty _select _close _close clicked() priceList reject() 479 31 20 20 _price itemSelected(int) _select animateClick() 29 212 479 66 _price valid(bool) _select setEnabled(bool) 29 212 479 66
    qt-client-4.1.0/guiclient/pricingScheduleAssignment.cpp000066400000000000000000000216131217451700100232450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "pricingScheduleAssignment.h" #include #include pricingScheduleAssignment::pricingScheduleAssignment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_selectedCustomerType, SIGNAL(toggled(bool)), _customerTypes, SLOT(setEnabled(bool))); connect(_customerTypePattern, SIGNAL(toggled(bool)), _customerType, SLOT(setEnabled(bool))); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sAssign())); connect(_selectedCustomerShipto, SIGNAL(toggled(bool)), _customerShipto, SLOT(setEnabled(bool))); connect(_cust, SIGNAL(newId(int)), this, SLOT(sCustomerSelected())); _customerTypes->setType(XComboBox::CustomerTypes); _ipshead->setAllowNull(true); _ipshead->populate( "SELECT ipshead_id, (ipshead_name || ' - ' || ipshead_descrip) " "FROM ipshead " "WHERE (CURRENT_DATE < ipshead_expires) " "ORDER BY ipshead_name;" ); } pricingScheduleAssignment::~pricingScheduleAssignment() { // no need to delete child widgets, Qt does it all for us } void pricingScheduleAssignment::languageChange() { retranslateUi(this); } enum SetResponse pricingScheduleAssignment::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("ipsass_id", &valid); if (valid) { _ipsassid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _customerGroup->setEnabled(FALSE); _ipshead->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void pricingScheduleAssignment::sAssign() { XSqlQuery pricingAssign; if (!_ipshead->isValid()) { QMessageBox::critical(this, tr("Cannot Save Pricing Schedule Assignment"), tr("

    You must select a Pricing Schedule.")); return; } pricingAssign.prepare( "SELECT ipsass_id " "FROM ipsass " "WHERE ( (ipsass_ipshead_id=:ipsass_ipshead_id)" " AND (ipsass_cust_id=:ipsass_cust_id)" " AND (ipsass_shipto_id=:ipsass_shipto_id)" " AND (ipsass_shipto_pattern=:ipsass_shipto_pattern)" " AND (ipsass_custtype_id=:ipsass_custtype_id)" " AND (ipsass_custtype_pattern=:ipsass_custtype_pattern) );" ); pricingAssign.bindValue(":ipsass_ipshead_id", _ipshead->id()); if (_selectedCustomer->isChecked() || _selectedShiptoPattern->isChecked()) pricingAssign.bindValue(":ipsass_cust_id", _cust->id()); else pricingAssign.bindValue(":ipsass_cust_id", -1); if (_selectedCustomerShipto->isChecked()) pricingAssign.bindValue(":ipsass_shipto_id", _customerShipto->id()); else pricingAssign.bindValue(":ipsass_shipto_id", -1); if (_selectedCustomerType->isChecked()) pricingAssign.bindValue(":ipsass_custtype_id", _customerTypes->id()); else pricingAssign.bindValue(":ipsass_custtype_id", -1); if (_customerTypePattern->isChecked()) pricingAssign.bindValue(":ipsass_custtype_pattern", _customerType->text()); else pricingAssign.bindValue(":ipsass_custtype_pattern", ""); if (_selectedShiptoPattern->isChecked()) pricingAssign.bindValue(":ipsass_shipto_pattern", _shiptoPattern->text()); else pricingAssign.bindValue(":ipsass_shipto_pattern", ""); pricingAssign.exec(); if (pricingAssign.first()) { QMessageBox::critical(this, tr("Cannot Save Pricing Schedule Assignment"), tr("

    This Pricing Schedule Assignment already exists.")); return; } if (_mode == cNew) { pricingAssign.exec("SELECT NEXTVAL('ipsass_ipsass_id_seq') AS ipsass_id;"); if (pricingAssign.first()) _ipsassid = pricingAssign.value("ipsass_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } pricingAssign.prepare( "INSERT INTO ipsass " "( ipsass_id, ipsass_ipshead_id," " ipsass_cust_id, ipsass_shipto_id, ipsass_shipto_pattern," " ipsass_custtype_id, ipsass_custtype_pattern ) " "VALUES " "( :ipsass_id, :ipsass_ipshead_id," " :ipsass_cust_id, :ipsass_shipto_id, :ipsass_shipto_pattern," " :ipsass_custtype_id, :ipsass_custtype_pattern );" ); } else pricingAssign.prepare( "UPDATE ipsass " "SET ipsass_id=:ipsass_id, ipsass_ipshead_id=:ipsass_ipshead_id," " ipsass_cust_id=:ipsass_cust_id," " ipsass_shipto_id=:ipsass_shipto_id," " ipsass_shipto_pattern=:ipsass_shipto_pattern," " ipsass_custtype_id=:ipsass_custtype_id," " ipsass_custtype_pattern=:ipsass_custtype_pattern " "WHERE (ipsass_id=:ipsass_id);" ); pricingAssign.bindValue(":ipsass_id", _ipsassid); pricingAssign.bindValue(":ipsass_ipshead_id", _ipshead->id()); if (_selectedCustomer->isChecked() || _selectedShiptoPattern->isChecked()) pricingAssign.bindValue(":ipsass_cust_id", _cust->id()); else pricingAssign.bindValue(":ipsass_cust_id", -1); if (_selectedCustomerShipto->isChecked()) pricingAssign.bindValue(":ipsass_shipto_id", _customerShipto->id()); else pricingAssign.bindValue(":ipsass_shipto_id", -1); if (_selectedCustomerType->isChecked()) pricingAssign.bindValue(":ipsass_custtype_id", _customerTypes->id()); else pricingAssign.bindValue(":ipsass_custtype_id", -1); if (_customerTypePattern->isChecked()) pricingAssign.bindValue(":ipsass_custtype_pattern", _customerType->text()); else pricingAssign.bindValue(":ipsass_custtype_pattern", ""); if (_selectedShiptoPattern->isChecked()) pricingAssign.bindValue(":ipsass_shipto_pattern", _shiptoPattern->text()); else pricingAssign.bindValue(":ipsass_shipto_pattern", ""); pricingAssign.exec(); done(_ipsassid); } void pricingScheduleAssignment::populate() { XSqlQuery pricingpopulate; pricingpopulate.prepare( "SELECT ipsass_ipshead_id, ipsass_cust_id," " ipsass_custtype_id, ipsass_custtype_pattern," " ipsass_shipto_pattern," " ipsass_shipto_id, shipto_cust_id " "FROM ipsass LEFT OUTER JOIN shiptoinfo ON (ipsass_shipto_id=shipto_id) " "WHERE (ipsass_id=:ipsass_id);" ); pricingpopulate.bindValue(":ipsass_id", _ipsassid); pricingpopulate.exec(); if (pricingpopulate.first()) { _ipshead->setId(pricingpopulate.value("ipsass_ipshead_id").toInt()); if (!pricingpopulate.value("ipsass_shipto_pattern").toString().isEmpty()) { _selectedShiptoPattern->setChecked(TRUE); _shiptoPattern->setText(pricingpopulate.value("ipsass_shipto_pattern").toString()); _cust->setId(pricingpopulate.value("ipsass_cust_id").toInt()); } else if (pricingpopulate.value("ipsass_cust_id").toInt() != -1) { _selectedCustomer->setChecked(TRUE); _cust->setId(pricingpopulate.value("ipsass_cust_id").toInt()); } else if (pricingpopulate.value("ipsass_shipto_id").toInt() != -1) { int shiptoid = pricingpopulate.value("ipsass_shipto_id").toInt(); _selectedCustomerShipto->setChecked(TRUE); _cust->setId(pricingpopulate.value("shipto_cust_id").toInt()); _customerShipto->setId(shiptoid); } else if (pricingpopulate.value("ipsass_custtype_id").toInt() != -1) { _selectedCustomerType->setChecked(TRUE); _customerTypes->setId(pricingpopulate.value("ipsass_custtype_id").toInt()); } else { _customerTypePattern->setChecked(TRUE); _customerType->setText(pricingpopulate.value("ipsass_custtype_pattern").toString()); } } } void pricingScheduleAssignment::sCustomerSelected() { XSqlQuery pricingCustomerSelected; _customerShipto->clear(); pricingCustomerSelected.prepare("SELECT shipto_id, shipto_num" " FROM shiptoinfo" " WHERE (shipto_cust_id=:cust_id); "); pricingCustomerSelected.bindValue(":cust_id", _cust->id()); pricingCustomerSelected.exec(); _customerShipto->populate(pricingCustomerSelected); } qt-client-4.1.0/guiclient/pricingScheduleAssignment.h000066400000000000000000000022601217451700100227070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRICINGSCHEDULEASSIGNMENT_H #define PRICINGSCHEDULEASSIGNMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_pricingScheduleAssignment.h" class pricingScheduleAssignment : public XDialog, public Ui::pricingScheduleAssignment { Q_OBJECT public: pricingScheduleAssignment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~pricingScheduleAssignment(); virtual SetResponse set( const ParameterList & pParams ); public slots: virtual void sAssign(); virtual void populate(); protected slots: virtual void languageChange(); virtual void sCustomerSelected(); private: int _mode; int _ipsassid; }; #endif // PRICINGSCHEDULEASSIGNMENT_H qt-client-4.1.0/guiclient/pricingScheduleAssignment.ui000066400000000000000000000222711217451700100231010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. pricingScheduleAssignment 0 0 691 291 Pricing Schedule Assignment 5 Selected Customer: true false false Selected Customer Ship-To: false 0 0 Selected Cust. Ship-To Pattern: false Selected Customer Type: false 0 0 Customer Type Pattern: false Pricing Schedule: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ipshead 0 0 200 0 Qt::Horizontal QSizePolicy::Expanding 190 28 Qt::Vertical QSizePolicy::Expanding 21 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save CustCluster QWidget

    custcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _selectedCustomer _cust _selectedCustomerShipto _customerShipto _selectedShiptoPattern _shiptoPattern _selectedCustomerType _customerTypes _customerTypePattern _customerType _ipshead _buttonBox _selectedCustomerType toggled(bool) _customerTypes setEnabled(bool) 93 108 390 107 _customerTypePattern toggled(bool) _customerType setEnabled(bool) 86 136 283 135 _buttonBox rejected() pricingScheduleAssignment close() 599 118 500 96 _selectedCustomerShipto toggled(bool) _customerShipto setEnabled(bool) 58 53 310 52 _selectedShiptoPattern toggled(bool) _shiptoPattern setEnabled(bool) 58 81 250 80 _selectedCustomer toggled(bool) _cust setEnabled(bool) 94 37 344 36 qt-client-4.1.0/guiclient/pricingScheduleAssignments.cpp000066400000000000000000000134071217451700100234320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "pricingScheduleAssignments.h" #include #include //#include #include #include #include "pricingScheduleAssignment.h" /* * Constructs a pricingScheduleAssignments as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ pricingScheduleAssignments::pricingScheduleAssignments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_ipsass, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); // statusBar()->hide(); _ipsass->addColumn(tr("Ship-To"), _itemColumn, Qt::AlignCenter, true, "shiptonum" ); _ipsass->addColumn(tr("Customer #"), _itemColumn, Qt::AlignCenter, true, "custnumber" ); _ipsass->addColumn(tr("Cust. Name"), 150, Qt::AlignCenter, true, "custname" ); _ipsass->addColumn(tr("Cust. Type"), _itemColumn, Qt::AlignCenter, true, "custtype" ); _ipsass->addColumn(tr("Pricing Schedule"), -1, Qt::AlignCenter, true, "ipshead_name" ); if (_privileges->check("AssignPricingSchedules")) { connect(_ipsass, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_ipsass, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_ipsass, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_ipsass, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } /* * Destroys the object and frees any allocated resources */ pricingScheduleAssignments::~pricingScheduleAssignments() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void pricingScheduleAssignments::languageChange() { retranslateUi(this); } void pricingScheduleAssignments::sPrint() { orReport report("PricingScheduleAssignments"); if (report.isValid()) report.print(); else report.reportError(this); } void pricingScheduleAssignments::sNew() { ParameterList params; params.append("mode", "new"); pricingScheduleAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void pricingScheduleAssignments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("ipsass_id", _ipsass->id()); pricingScheduleAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void pricingScheduleAssignments::sView() { ParameterList params; params.append("mode", "view"); params.append("ipsass_id", _ipsass->id()); pricingScheduleAssignment newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void pricingScheduleAssignments::sDelete() { XSqlQuery pricingDelete; pricingDelete.prepare( "DELETE FROM ipsass " "WHERE (ipsass_id=:ipsass_id);" ); pricingDelete.bindValue(":ipsass_id", _ipsass->id()); pricingDelete.exec(); sFillList(); } void pricingScheduleAssignments::sFillList() { _ipsass->populate( "SELECT ipsass_id," " CASE WHEN (ipsass_shipto_id != -1) THEN (SELECT shipto_num FROM shiptoinfo WHERE (shipto_id=ipsass_shipto_id))" " WHEN (COALESCE(LENGTH(ipsass_shipto_pattern), 0) > 0) THEN ipsass_shipto_pattern" " ELSE TEXT('ANY')" " END AS shiptonum," " CASE WHEN (ipsass_shipto_id != -1) THEN (SELECT cust_number FROM shiptoinfo, custinfo WHERE ((shipto_cust_id=cust_id) AND (shipto_id=ipsass_shipto_id))) " " WHEN (ipsass_cust_id=-1) THEN TEXT('Any')" " ELSE (SELECT cust_number FROM custinfo WHERE (cust_id=ipsass_cust_id))" " END AS custnumber," " CASE WHEN (ipsass_shipto_id != -1) THEN (SELECT cust_name FROM shiptoinfo, custinfo WHERE ((shipto_cust_id=cust_id) AND (shipto_id=ipsass_shipto_id))) " " WHEN (ipsass_cust_id=-1) THEN ''" " ELSE (SELECT cust_name FROM custinfo WHERE (cust_id=ipsass_cust_id))" " END AS custname," " CASE WHEN (ipsass_cust_id != -1) THEN TEXT('N/A')" " WHEN (ipsass_shipto_id != -1) THEN TEXT('N/A')" " WHEN (COALESCE(LENGTH(ipsass_shipto_pattern),0) > 0) THEN TEXT('N/A')" " WHEN (ipsass_custtype_id=-1) THEN ipsass_custtype_pattern" " ELSE (SELECT custtype_code FROM custtype WHERE (custtype_id=ipsass_custtype_id))" " END AS custtype," " ipshead_name " "FROM ipsass, ipshead " "WHERE (ipshead_id=ipsass_ipshead_id) " "ORDER BY custname, custtype;" ); } qt-client-4.1.0/guiclient/pricingScheduleAssignments.h000066400000000000000000000021251217451700100230720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRICINGSCHEDULEASSIGNMENTS_H #define PRICINGSCHEDULEASSIGNMENTS_H #include "xwidget.h" #include "ui_pricingScheduleAssignments.h" class pricingScheduleAssignments : public XWidget, public Ui::pricingScheduleAssignments { Q_OBJECT public: pricingScheduleAssignments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~pricingScheduleAssignments(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // PRICINGSCHEDULEASSIGNMENTS_H qt-client-4.1.0/guiclient/pricingScheduleAssignments.ui000066400000000000000000000145021217451700100232620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. pricingScheduleAssignments 0 0 698 301 List Pricing Schedule Assignments 0 0 7 0 0 0 0 20 Pricing Schedule Assignments: 7 7 0 0 0 5 &Close &Print 0 0 &New false &View false &Edit false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _ipsass _new _view _edit _delete _print _close parameter.h _close clicked() pricingScheduleAssignments close() _ipsass valid(bool) _view setEnabled(bool)
    qt-client-4.1.0/guiclient/printArOpenItem.cpp000066400000000000000000000066431217451700100211720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printArOpenItem.h" #include #include printArOpenItem::printArOpenItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printSinglecopyDocument(parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); _docinfoQueryString = "SELECT aropen_id AS docid, aropen_id," " aropen_docnumber AS docnumber," " false AS printed," " 'AROpenItem' AS reportname," " aropen_doctype" " FROM aropen" " WHERE (aropen_id=);" ; setReportKey("aropen_id"); connect(_aropen, SIGNAL(valid(bool)), this, SLOT(setPrintEnabled(bool))); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sPopulate(XSqlQuery*))); } printArOpenItem::~printArOpenItem() { // no need to delete child widgets, Qt does it all for us } void printArOpenItem::languageChange() { retranslateUi(this); } // standard document type abbreviation, not the aropen-specific abbreviation QString printArOpenItem::doctype() { switch (_aropen->type()) { case AropenLineEdit::Invoice: return "IN"; case AropenLineEdit::DebitMemo: return "DM"; case AropenLineEdit::CreditMemo: return "CM"; case AropenLineEdit::CashDeposit: return "CR"; default: qWarning("printArOpenItem::doctype() unknown for %d", _aropen->type()); return ""; } } ParameterList printArOpenItem::getParams(XSqlQuery *docq) { ParameterList params; params.append("aropen_id", docq->value("aropen_id").toInt()); switch (docq->value("aropen_doctype").toChar().toAscii()) { case 'I': case 'D': params.append("docTypeID", 1); params.append("creditMemo", tr("Credit Memo")); params.append("cashdeposit", tr("Cash Deposit")); params.append("check", tr("Check")); params.append("certifiedCheck", tr("Certified Check")); params.append("masterCard", tr("Master Card")); params.append("visa", tr("Visa")); params.append("americanExpress", tr("American Express")); params.append("discoverCard", tr("Discover Card")); params.append("otherCreditCard", tr("Other Credit Card")); params.append("cash", tr("Cash")); params.append("wireTransfer", tr("Wire Transfer")); params.append("other", tr("Other")); break; case 'C': case 'R': params.append("docTypeRC", 1); params.append("invoice", tr("Invoice")); params.append("debitMemo", tr("Debit Memo")); params.append("apcheck", tr("A/P Check")); params.append("cashreceipt", tr("Cash Receipt")); break; default: params.append("checkParamsReturn", false); } return params; } void printArOpenItem::sPopulate(XSqlQuery *qry) { _aropen->setId(qry->value("docid").toInt()); } qt-client-4.1.0/guiclient/printArOpenItem.h000066400000000000000000000021031217451700100206220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTAROPENITEM_H #define PRINTAROPENITEM_H #include "printSinglecopyDocument.h" #include "ui_printArOpenItem.h" class printArOpenItem : public printSinglecopyDocument, public Ui::printArOpenItem { Q_OBJECT public: printArOpenItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printArOpenItem(); Q_INVOKABLE virtual QString doctype(); Q_INVOKABLE virtual ParameterList getParams(XSqlQuery *docq); public slots: virtual void sPopulate(XSqlQuery *qry); protected slots: virtual void languageChange(); }; #endif // PRINTAROPENITEM_H qt-client-4.1.0/guiclient/printArOpenItem.ui000066400000000000000000000025421217451700100210170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printArOpenItem 0 0 285 46 Print A/R Open Item A/R Open Item: AropenCluster QWidget
    aropencluster.h
    parameter.h
    qt-client-4.1.0/guiclient/printCheck.cpp000066400000000000000000000453761217451700100202120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printCheck.h" #include #include #include #include #include #include #include #include #include #include #include #include "xtsettings.h" #include "confirmAchOK.h" #include "storedProcErrorLookup.h" QString printCheck::eftFileDir = QString(); printCheck::printCheck(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sHandleBankAccount(int))); connect(_check, SIGNAL(newID(int)), this, SLOT(sEnableCreateEFT())); connect(_createEFT, SIGNAL(clicked()), this, SLOT(sCreateEFT())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _captive = FALSE; _setCheckNumber = -1; _check->setAllowNull(TRUE); _bankaccnt->setType(XComboBox::APBankAccounts); _createEFT->setVisible(_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")); } printCheck::~printCheck() { // no need to delete child widgets, Qt does it all for us } void printCheck::languageChange() { retranslateUi(this); } enum SetResponse printCheck::set(const ParameterList &pParams) { XWidget::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("check_id", &valid); if (valid) { populate(param.toInt()); _bankaccnt->setEnabled(FALSE); _check->setEnabled(FALSE); } return NoError; } void printCheck::sPrint() { XSqlQuery printPrint; if(_setCheckNumber != -1 && _setCheckNumber != _nextCheckNum->text().toInt()) { printPrint.prepare("SELECT checkhead_id " "FROM checkhead " "WHERE ( (checkhead_bankaccnt_id=:bankaccnt_id) " " AND (checkhead_id <> :checkhead_id) " " AND (checkhead_number=:nextCheckNumber));"); printPrint.bindValue(":bankaccnt_id", _bankaccnt->id()); printPrint.bindValue(":checkhead_id", _check->id()); printPrint.bindValue(":nextCheckNumber", _nextCheckNum->text().toInt()); printPrint.exec(); if (printPrint.first()) { QMessageBox::information( this, tr("Check Number Already Used"), tr("

    The selected Check Number has already been used.") ); return; } else if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_createEFT->isEnabled() && QMessageBox::question(this, tr("Print Anyway?"), tr("

    The recipient of this check has been " "configured for EFT transactions. Do you want " "to print this check for them anyway?

    If you " "answer 'Yes' then a check will be printed. " "If you say 'No' then you should click %1. ") .arg(_createEFT->text()), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::No) return; printPrint.prepare( "SELECT checkhead_printed, form_report_name AS report_name, bankaccnt_id " "FROM checkhead, bankaccnt, form " "WHERE ((checkhead_bankaccnt_id=bankaccnt_id)" " AND (bankaccnt_check_form_id=form_id)" " AND (checkhead_id=:checkhead_id) );" ); printPrint.bindValue(":checkhead_id", _check->id()); printPrint.exec(); if (printPrint.first()) { if(printPrint.value("checkhead_printed").toBool()) { QMessageBox::information( this, tr("Check Already Printed"), tr("

    The selected Check has already been printed.") ); return; } QString reportname = printPrint.value("report_name").toString(); // get the report definition out of the database // this should somehow be condensed into a common code call or something // in the near future to facilitate easier conversion in other places // of the application to use the new rendering engine directly XSqlQuery report; report.prepare( "SELECT report_source " " FROM report " " WHERE (report_name=:report_name) " "ORDER BY report_grade DESC LIMIT 1;" ); report.bindValue(":report_name", reportname); report.exec(); QDomDocument docReport; if (report.first()) { QString errorMessage; int errorLine; if (!docReport.setContent(report.value("report_source").toString(), &errorMessage, &errorLine)) { systemError(this, errorMessage, __FILE__, __LINE__); return; } } else { systemError(this, report.lastError().databaseText(), __FILE__, __LINE__); return; } // end getting the report definition out the database if(_setCheckNumber != -1 && _setCheckNumber != _nextCheckNum->text().toInt()) { printPrint.prepare("SELECT setNextCheckNumber(:bankaccnt_id, :nextCheckNumber) AS result;"); printPrint.bindValue(":bankaccnt_id", _bankaccnt->id()); printPrint.bindValue(":nextCheckNumber", _nextCheckNum->text().toInt()); printPrint.exec(); if (printPrint.first()) { int result = printPrint.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("setNextCheckNumber", result), __FILE__, __LINE__); return; } } else if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } } printPrint.prepare("UPDATE checkhead SET checkhead_number=fetchNextCheckNumber(checkhead_bankaccnt_id)" " WHERE(checkhead_id=:checkhead_id);"); printPrint.bindValue(":checkhead_id", _check->id()); printPrint.exec(); if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } ParameterList params; params.append("checkhead_id", _check->id()); // replace with new renderer code so we can get a page count ORPreRender pre; pre.setDom(docReport); pre.setParamList(params); ORODocument * doc = pre.generate(); ReportPrinter printer(QPrinter::HighResolution); ORPrintRender render; render.setupPrinter(doc, &printer); QPrintDialog pd(&printer); pd.setMinMax(1, doc->pages()); if(pd.exec() == XDialog::Accepted) { render.render(doc, &printer); } else return; int page_num = 1; while(page_num < doc->pages()) { page_num++; XSqlQuery qq; qq.prepare("INSERT INTO checkhead" " (checkhead_recip_id, checkhead_recip_type," " checkhead_bankaccnt_id, checkhead_printed," " checkhead_checkdate, checkhead_number," " checkhead_amount, checkhead_void," " checkhead_misc," " checkhead_for, checkhead_notes," " checkhead_curr_id, checkhead_deleted) " "SELECT checkhead_recip_id, checkhead_recip_type," " checkhead_bankaccnt_id, TRUE," " checkhead_checkdate, fetchNextCheckNumber(checkhead_bankaccnt_id)," " checkhead_amount, TRUE, TRUE," " 'Continuation of Check #'||checkhead_number," " 'Continuation of Check #'||checkhead_number," " checkhead_curr_id, TRUE" " FROM checkhead" " WHERE(checkhead_id=:checkhead_id);"); qq.bindValue(":checkhead_id", _check->id()); if(!qq.exec()) { systemError(this, "Received error but will continue anyway:\n"+qq.lastError().databaseText(), __FILE__, __LINE__); } } omfgThis->sChecksUpdated(_bankaccnt->id(), _check->id(), TRUE); } else if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } else // join failed { QMessageBox::critical(this, tr("Cannot Print Check"), tr("

    The selected Check cannot be printed as the " "Bank Account that it is to draw upon does not " "have a valid Check Format assigned to it. " "Please assign a valid Check Format to this Bank " "Account before attempting to print this Check.")); return; } if ( QMessageBox::question( this, tr("Check Printed"), tr("Was the selected Check printed successfully?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) markCheckAsPrinted(_check->id()); else if ( QMessageBox::question(this, tr("Mark Check as Voided"), tr("

    Would you like to mark the selected " "Check as Void and create a replacement " "check?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { printPrint.prepare("SELECT voidCheck(:checkhead_id) AS result;"); printPrint.bindValue(":checkhead_id", _check->id()); printPrint.exec(); if (printPrint.first()) { int result = printPrint.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("voidCheck", result), __FILE__, __LINE__); return; } } else if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } printPrint.prepare( "SELECT checkhead_bankaccnt_id," " replaceVoidedCheck(checkhead_id) AS result " "FROM checkhead " "WHERE (checkhead_id=:checkhead_id);" ); printPrint.bindValue(":checkhead_id", _check->id()); printPrint.exec(); if (printPrint.first()) { int result = printPrint.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("replaceVoidedCheck", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(printPrint.value("checkhead_bankaccnt_id").toInt(), _check->id(), TRUE); sHandleBankAccount(_bankaccnt->id()); _print->setFocus(); } else if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } } } void printCheck::sHandleBankAccount(int pBankaccntid) { XSqlQuery printHandleBankAccount; if (_bankaccnt->id() != -1) { XSqlQuery checkNumber; checkNumber.prepare( "SELECT bankaccnt_nextchknum, bankaccnt_ach_enabled " "FROM bankaccnt " "WHERE (bankaccnt_id=:bankaccnt_id);" ); checkNumber.bindValue(":bankaccnt_id", _bankaccnt->id()); checkNumber.exec(); if (checkNumber.first()) { _setCheckNumber = checkNumber.value("bankaccnt_nextchknum").toInt(); _createEFT->setEnabled(checkNumber.value("bankaccnt_ach_enabled").toBool()); _nextCheckNum->setText(checkNumber.value("bankaccnt_nextchknum").toString()); } else if (printHandleBankAccount.lastError().type() != QSqlError::NoError) { systemError(this, printHandleBankAccount.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _setCheckNumber = -1; _nextCheckNum->clear(); } printHandleBankAccount.prepare( "SELECT checkhead_id," " (CASE WHEN(checkhead_number=-1) THEN TEXT('Unspecified')" " ELSE TEXT(checkhead_number)" " END || '-' || checkrecip_name) " "FROM checkhead LEFT OUTER JOIN " " checkrecip ON ((checkhead_recip_id=checkrecip_id)" " AND (checkhead_recip_type=checkrecip_type))" "WHERE ((NOT checkhead_void)" " AND (NOT checkhead_printed)" " AND (NOT checkhead_posted)" " AND (checkhead_bankaccnt_id=:bankaccnt_id) ) " "ORDER BY checkhead_number;" ); printHandleBankAccount.bindValue(":bankaccnt_id", pBankaccntid); printHandleBankAccount.exec(); _check->populate(printHandleBankAccount); _check->setNull(); if (printHandleBankAccount.lastError().type() != QSqlError::NoError) { systemError(this, printHandleBankAccount.lastError().databaseText(), __FILE__, __LINE__); return; } } void printCheck::populate(int pcheckid) { XSqlQuery printpopulate; printpopulate.prepare( "SELECT checkhead_bankaccnt_id " "FROM checkhead " "WHERE (checkhead_id=:checkhead_id);" ); printpopulate.bindValue(":checkhead_id", pcheckid); printpopulate.exec(); if (printpopulate.first()) { _bankaccnt->setId(printpopulate.value("checkhead_bankaccnt_id").toInt()); _check->setId(pcheckid); } else if (printpopulate.lastError().type() != QSqlError::NoError) { systemError(this, printpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void printCheck::sCreateEFT() { XSqlQuery printCreateEFT; XSqlQuery releasenum; releasenum.prepare("SELECT releaseNumber('ACHBatch', :batch);"); QString batch; MetaSQLQuery mql("SELECT *" " FROM (," " , );"); ParameterList params; params.append("func", _metrics->value("EFTFunction")); params.append("bank", _bankaccnt->id()); params.append("check",_check->id()); params.append("key", omfgThis->_key); printCreateEFT = mql.toQuery(params); if (printCreateEFT.first()) { batch = printCreateEFT.value("achline_batch").toString(); releasenum.bindValue(":batch", batch); if (eftFileDir.isEmpty()) { eftFileDir = xtsettingsValue("ACHOutputDirectory").toString(); } QString suffixes = "*.ach *.aba *.dat *.txt"; if (! suffixes.contains(_metrics->value("ACHDefaultSuffix"))) suffixes = "*" + _metrics->value("ACHDefaultSuffix") + " " + suffixes; QString filename = QFileDialog::getSaveFileName(this, tr("EFT Output File"), printCheck::eftFileDir + QDir::separator() + "eft" + batch + _metrics->value("ACHDefaultSuffix"), "(" + suffixes + ")"); if (filename.isEmpty()) { releasenum.exec(); return; } QFileInfo fileinfo(filename); eftFileDir = fileinfo.absolutePath(); QFile eftfile(filename); if (! eftfile.open(QIODevice::WriteOnly)) { releasenum.exec(); QMessageBox::critical(this, tr("Could Not Open File"), tr("Could not open %1 for writing EFT data.") .arg(filename)); return; } do { eftfile.write(printCreateEFT.value("achline_value").toString().toAscii()); eftfile.write("\n"); } while (printCreateEFT.next()); eftfile.close(); if (printCreateEFT.lastError().type() != QSqlError::NoError) { releasenum.exec(); eftfile.remove(); systemError(this, printCreateEFT.lastError().databaseText(), __FILE__, __LINE__); return; } if (confirmAchOK::askOK(this, eftfile)) markCheckAsPrinted(_check->id()); else { releasenum.exec(); XSqlQuery clearq; clearq.prepare("UPDATE checkhead " "SET checkhead_printed=false," " checkhead_ach_batch=NULL " "WHERE (checkhead_id=:checkhead_id);"); clearq.bindValue(":checkhead_id", _check->id()); clearq.exec(); if (clearq.lastError().type() != QSqlError::NoError) { systemError(this, clearq.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (printCreateEFT.lastError().type() != QSqlError::NoError) { systemError(this, printCreateEFT.lastError().databaseText(), __FILE__, __LINE__); return; } } void printCheck::sEnableCreateEFT() { XSqlQuery printEnableCreateEFT; if (_bankaccnt->isValid() && _check->isValid() && _metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")) { printEnableCreateEFT.prepare("SELECT bankaccnt_ach_enabled AND vend_ach_enabled AS eftenabled " "FROM bankaccnt" " JOIN checkhead ON (checkhead_bankaccnt_id=bankaccnt_id)" " JOIN vendinfo ON (checkhead_recip_id=vend_id" " AND checkhead_recip_type='V') " "WHERE ((bankaccnt_id=:bankaccnt_id)" " AND (checkhead_id=:checkhead_id));"); printEnableCreateEFT.bindValue(":bankaccnt_id", _bankaccnt->id()); printEnableCreateEFT.bindValue(":checkhead_id", _check->id()); printEnableCreateEFT.exec(); if (printEnableCreateEFT.first()) _createEFT->setEnabled(printEnableCreateEFT.value("eftenabled").toBool()); else if (printEnableCreateEFT.lastError().type() != QSqlError::NoError) { systemError(this, printEnableCreateEFT.lastError().databaseText(), __FILE__, __LINE__); return; } else // not found _createEFT->setEnabled(false); } else _createEFT->setEnabled(false); } void printCheck::storeEftFileDir() { if (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled") && !eftFileDir.isEmpty()) { xtsettingsSetValue("ACHOutputDirectory", eftFileDir); } } void printCheck::done(int /*p*/) { storeEftFileDir(); close(); } void printCheck::markCheckAsPrinted(const int pcheckid) { XSqlQuery markq; markq.prepare("SELECT checkhead_bankaccnt_id," " markCheckAsPrinted(checkhead_id) AS result " "FROM checkhead " "WHERE (checkhead_id=:checkhead_id);" ); markq.bindValue(":checkhead_id", pcheckid); markq.exec(); if (markq.first()) { int result = markq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("markCheckAsPrinted", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(markq.value("checkhead_bankaccnt_id").toInt(), pcheckid, TRUE); if (_captive) close(); else { sHandleBankAccount(_bankaccnt->id()); _close->setText(tr("&Close")); } } } qt-client-4.1.0/guiclient/printCheck.h000066400000000000000000000025071217451700100176440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTCHECK_H #define PRINTCHECK_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_printCheck.h" class QCloseEvent; class printCheck : public XWidget, public Ui::printCheck { Q_OBJECT public: printCheck(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); ~printCheck(); static QString eftFileDir; public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void done(int r); virtual void sCreateEFT(); virtual void sEnableCreateEFT(); virtual void sHandleBankAccount( int pBankaccntid ); virtual void sPrint(); virtual void populate( int pcheckid ); protected slots: virtual void languageChange(); protected: virtual void storeEftFileDir(); private: bool _captive; int _setCheckNumber; virtual void markCheckAsPrinted(const int); }; #endif // PRINTCHECK_H qt-client-4.1.0/guiclient/printCheck.ui000066400000000000000000000133121217451700100200260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printCheck 0 0 428 131 Print Check Bank Account: _bankaccnt 0 0 Check: _check 0 0 Next Check #: _nextCheckNum 0 0 0 Qt::Horizontal 40 20 &Cancel false &Print true true false Create EFT File Qt::Vertical QSizePolicy::Expanding 131 13 XComboBox QComboBox

    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _bankaccnt _check _nextCheckNum _print _close _close clicked() printCheck close() 348 33 20 20 _check notNull(bool) _print setEnabled(bool) 245 66 348 58 qt-client-4.1.0/guiclient/printChecks.cpp000066400000000000000000000414451217451700100203660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printChecks.h" #include #include #include #include #include #include #include #include #include #include "mqlutil.h" #include "xtsettings.h" #include "confirmAchOK.h" #include "printCheck.h" #include "printChecksReview.h" #include "storedProcErrorLookup.h" printChecks::printChecks(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sHandleBankAccount(int))); connect(_createEFT, SIGNAL(clicked()), this, SLOT(sCreateEFT())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _setCheckNumber = -1; _bankaccnt->setAllowNull(TRUE); _bankaccnt->setType(XComboBox::APBankAccounts); _createEFT->setVisible(_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")); } printChecks::~printChecks() { // no need to delete child widgets, Qt does it all for us } void printChecks::languageChange() { retranslateUi(this); } enum SetResponse printChecks::set(const ParameterList & pParams ) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("bankaccnt_id", &valid); if (valid) _bankaccnt->setId(param.toInt()); return NoError; } void printChecks::sPrint() { XSqlQuery printPrint; if (_somerecips_eft_enabled && QMessageBox::question(this, tr("Print Anyway?"), tr("

    Some of the recipients of checks in this " "check run have been configured for EFT " "transactions. Do you want to print checks " "for them anyway?

    If you answer 'Yes' then " "a check will be printed. If you say 'No' then " "you should click %1 first and then " "click %2.") .arg(_createEFT->text(), _print->text()), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::No) return; QList printedChecks; bool firstRun = TRUE; ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); bool setup = true; QList singleCheckPrerendered; XSqlQuery checks; MetaSQLQuery mql = mqlLoad("checks", "detail"); params.append("toPrintOnly"); params.append("numtoprint", _numberOfChecks->value()); if (_orderByName->isChecked()) params.append("orderByName"); checks = mql.toQuery(params); QDomDocument docReport; while (checks.next()) { if (setup) { // get the report definition out of the database // this should somehow be condensed into a common code call or something // in the near future to facilitate easier conversion in other places // of the application to use the new rendering engine directly XSqlQuery report; report.prepare( "SELECT report_source " " FROM report " " WHERE (report_name=:report_name) " "ORDER BY report_grade DESC LIMIT 1;" ); report.bindValue(":report_name", checks.value("report_name").toString()); report.exec(); if (report.first()) { QString errorMessage; int errorLine; if (!docReport.setContent(report.value("report_source").toString(), &errorMessage, &errorLine)) { systemError(this, errorMessage, __FILE__, __LINE__); return; } } else { systemError(this, report.lastError().databaseText(), __FILE__, __LINE__); return; } // end getting the report definition out the database if(_setCheckNumber != -1 && _setCheckNumber != _nextCheckNum->text().toInt() && firstRun) { printPrint.prepare("SELECT setNextCheckNumber(:bankaccnt_id, :nextCheckNumber) AS result;"); printPrint.bindValue(":bankaccnt_id", _bankaccnt->id()); printPrint.bindValue(":nextCheckNumber", _nextCheckNum->text().toInt()); printPrint.exec(); if (printPrint.first()) { int result = printPrint.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("setNextCheckNumber", result), __FILE__, __LINE__); return; } } else if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } firstRun = FALSE; } } printPrint.prepare("UPDATE checkhead SET checkhead_number=fetchNextCheckNumber(checkhead_bankaccnt_id)" " WHERE(checkhead_id=:checkhead_id);"); printPrint.bindValue(":checkhead_id", checks.value("checkhead_id").toInt()); printPrint.exec(); if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } ParameterList params; params.append("checkhead_id", checks.value("checkhead_id").toInt()); ORPreRender pre; pre.setDom(docReport); pre.setParamList(params); ORODocument * doc = pre.generate(); printedChecks.append(checks.value("checkhead_id").toInt()); int page_num = 1; while(page_num < doc->pages()) { page_num++; XSqlQuery qq; qq.prepare("INSERT INTO checkhead" " (checkhead_recip_id, checkhead_recip_type," " checkhead_bankaccnt_id, checkhead_printed," " checkhead_checkdate, checkhead_number," " checkhead_amount, checkhead_void," " checkhead_misc," " checkhead_for, checkhead_notes," " checkhead_curr_id, checkhead_deleted) " "SELECT checkhead_recip_id, checkhead_recip_type," " checkhead_bankaccnt_id, TRUE," " checkhead_checkdate, fetchNextCheckNumber(checkhead_bankaccnt_id)," " checkhead_amount, TRUE, TRUE," " 'Continuation of Check #'||checkhead_number," " 'Continuation of Check #'||checkhead_number," " checkhead_curr_id, TRUE" " FROM checkhead" " WHERE(checkhead_id=:checkhead_id);"); qq.bindValue(":checkhead_id", checks.value("checkhead_id").toInt()); if(!qq.exec()) { systemError(this, "Received error but will continue anyway:\n"+qq.lastError().databaseText(), __FILE__, __LINE__); } } singleCheckPrerendered.append(doc); } if (checks.lastError().type() != QSqlError::NoError) { systemError(this, checks.lastError().databaseText(), __FILE__, __LINE__); return; } if(!printedChecks.empty()) { ReportPrinter printer(QPrinter::HighResolution); ORODocument entireCheckRunPrerendered; for (int j = 0; j < singleCheckPrerendered.size(); j++) { for (int i = 0; i < singleCheckPrerendered.at(j)->pages(); i++) { entireCheckRunPrerendered.addPage(singleCheckPrerendered.at(j)->page(i)); } } ORPrintRender render; render.setupPrinter(&entireCheckRunPrerendered, &printer); QPrintDialog pd(&printer, this); pd.setMinMax(1, entireCheckRunPrerendered.pages()); if(pd.exec() != XDialog::Accepted) return; render.render(&entireCheckRunPrerendered, &printer); QList::iterator it; if ( QMessageBox::question(this, tr("All Checks Printed"), tr("

    Did all the Checks print successfully?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery postCheck; postCheck.prepare( "SELECT markCheckAsPrinted(:checkhead_id) AS result;"); for( it = printedChecks.begin(); it != printedChecks.end(); ++it) { postCheck.bindValue(":checkhead_id", (*it)); postCheck.exec(); if (postCheck.first()) { int result = postCheck.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("markCheckAsPrinted", result), __FILE__, __LINE__); return; } } else if (postCheck.lastError().type() != QSqlError::NoError) { systemError(this, postCheck.lastError().databaseText(), __FILE__, __LINE__); return; } } } else { printChecksReview newdlg(this, "", TRUE); QString query = QString( "SELECT checkhead_id, checkhead_number" " FROM checkhead" " WHERE (checkhead_id IN (" ); bool first = true; for( it = printedChecks.begin(); it != printedChecks.end(); ++it) { if(!first) query += ","; query += QString::number((*it)); first = false; } query += ") ); "; newdlg._checks->populate(query); newdlg.sSelectAll(); newdlg.sMarkPrinted(); newdlg._checks->clearSelection(); newdlg.exec(); } } else QMessageBox::information( this, tr("No Checks Printed"), tr("

    No Checks were printed for the selected " "Bank Account.") ); omfgThis->sChecksUpdated(_bankaccnt->id(), -1, TRUE); sHandleBankAccount(_bankaccnt->id()); } void printChecks::sHandleBankAccount(int pBankaccntid) { XSqlQuery printHandleBankAccount; printHandleBankAccount.prepare( "SELECT bankaccnt_nextchknum," " BOOL_OR(bankaccnt_ach_enabled) AS bank_eft_enabled," " COUNT(*) AS numofchecks," " BOOL_OR(COALESCE(vend_ach_enabled, false)) AS somerecip_eft_enabled," " BOOL_AND(COALESCE(vend_ach_enabled, false)) AS allrecip_eft_enabled " " FROM bankaccnt, checkhead" " LEFT OUTER JOIN vendinfo ON (checkhead_recip_type='V'" " AND checkhead_recip_id=vend_id) " " WHERE((NOT checkhead_void)" " AND (NOT checkhead_printed)" " AND (checkhead_bankaccnt_id=bankaccnt_id)" " AND (checkhead_bankaccnt_id=:bankaccnt_id))" " GROUP BY bankaccnt_nextchknum;" ); printHandleBankAccount.bindValue(":bankaccnt_id", pBankaccntid); printHandleBankAccount.exec(); if (printHandleBankAccount.first()) { _setCheckNumber = printHandleBankAccount.value("bankaccnt_nextchknum").toInt(); _nextCheckNum->setText(printHandleBankAccount.value("bankaccnt_nextchknum").toString()); _numberOfChecks->setMaximum(printHandleBankAccount.value("numofchecks").toInt()); _numberOfChecks->setValue(printHandleBankAccount.value("numofchecks").toInt()); _allrecips_eft_enabled = printHandleBankAccount.value("allrecip_eft_enabled").toBool(); _somerecips_eft_enabled = printHandleBankAccount.value("somerecip_eft_enabled").toBool(); _print->setEnabled(printHandleBankAccount.value("numofchecks").toInt() > 0); _createEFT->setEnabled(printHandleBankAccount.value("bank_eft_enabled").toBool() && printHandleBankAccount.value("somerecip_eft_enabled").toBool() && printHandleBankAccount.value("numofchecks").toInt() > 0); } else if (printHandleBankAccount.lastError().type() != QSqlError::NoError) { systemError(this, printHandleBankAccount.lastError().databaseText(), __FILE__, __LINE__); return; } else // not found { _setCheckNumber = -1; _nextCheckNum->clear(); _numberOfChecks->clear(); _allrecips_eft_enabled = false; _somerecips_eft_enabled = false; _print->setEnabled(false); _createEFT->setEnabled(false); } } void printChecks::sCreateEFT() { XSqlQuery printCreateEFT; if (_somerecips_eft_enabled && !_allrecips_eft_enabled && QMessageBox::question(this, tr("Print Anyway?"), tr("

    Some but not all of the checks in this run " "are for Vendors configured to receive EFT " "transactions. Do you want to create the EFT " "file anyway?

    If you answer 'Yes' then an " "EFT file will be created but you will have to " "click Print to get the remainder of the " "checks in this run. If you say 'No' then you " "will get a warning when you click Print " "asking whether you want to print checks for " "EFT recipients."), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::No) return; XSqlQuery releasenum; releasenum.prepare("SELECT releaseNumber('ACHBatch', :batch);"); QString batch; MetaSQLQuery mql("SELECT *" " FROM (," " NULL, );"); ParameterList params; params.append("func", _metrics->value("EFTFunction")); params.append("bank", _bankaccnt->id()); params.append("key", omfgThis->_key); printCreateEFT = mql.toQuery(params); if (printCreateEFT.first()) { batch = printCreateEFT.value("achline_batch").toString(); releasenum.bindValue(":batch", batch); if (printCheck::eftFileDir.isEmpty()) { printCheck::eftFileDir = xtsettingsValue("ACHOutputDirectory").toString(); } QString suffixes = "*.ach *.aba *.dat *.txt"; if (! suffixes.contains(_metrics->value("ACHDefaultSuffix"))) suffixes = "*" + _metrics->value("ACHDefaultSuffix") + " " + suffixes; QString filename = QFileDialog::getSaveFileName(this, tr("EFT Output File"), printCheck::eftFileDir + QDir::separator() + "eft" + batch + _metrics->value("ACHDefaultSuffix"), "(" + suffixes + ")"); if (filename.isEmpty()) { releasenum.exec(); return; } QFileInfo fileinfo(filename); printCheck::eftFileDir = fileinfo.absolutePath(); QFile eftfile(filename); if (! eftfile.open(QIODevice::WriteOnly)) { releasenum.exec(); QMessageBox::critical(this, tr("Could Not Open File"), tr("Could not open %1 for writing EFT data.") .arg(filename)); return; } do { eftfile.write(printCreateEFT.value("achline_value").toString().toAscii()); eftfile.write("\n"); } while (printCreateEFT.next()); eftfile.close(); if (printCreateEFT.lastError().type() != QSqlError::NoError) { releasenum.exec(); eftfile.remove(); systemError(this, printCreateEFT.lastError().databaseText(), __FILE__, __LINE__); return; } if (confirmAchOK::askOK(this, eftfile)) markChecksAsPrinted(batch); else { releasenum.exec(); XSqlQuery clearq; clearq.prepare("UPDATE checkhead " "SET checkhead_printed=false," " checkhead_ach_batch=NULL " "WHERE (checkhead_ach_batch=:checkhead_ach_batch);"); clearq.bindValue(":checkhead_ach_batch", batch); clearq.exec(); if (clearq.lastError().type() != QSqlError::NoError) { systemError(this, clearq.lastError().databaseText(), __FILE__, __LINE__); return; } } sHandleBankAccount(_bankaccnt->id()); } else if (printCreateEFT.lastError().type() != QSqlError::NoError) { systemError(this, printCreateEFT.lastError().databaseText(), __FILE__, __LINE__); return; } } void printChecks::markChecksAsPrinted(const QString pbatch) { XSqlQuery markq; markq.prepare("SELECT MIN(checkhead_bankaccnt_id) AS bankaccnt_id," " MIN(markCheckAsPrinted(checkhead_id)) AS result " "FROM checkhead " "WHERE (checkhead_ach_batch=:checkhead_ach_batch);" ); markq.bindValue(":checkhead_ach_batch", pbatch); markq.exec(); if (markq.first()) { int result = markq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("markCheckAsPrinted", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(markq.value("bankaccnt_id").toInt(), -1, TRUE); } } qt-client-4.1.0/guiclient/printChecks.h000066400000000000000000000023201217451700100200200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTCHECKS_H #define PRINTCHECKS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_printChecks.h" class printChecks : public XDialog, public Ui::printChecks { Q_OBJECT public: printChecks(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printChecks(); public slots: virtual SetResponse set(const ParameterList &pParams); virtual void sCreateEFT(); virtual void sHandleBankAccount( int pBankaccntid ); virtual void sPrint(); protected slots: virtual void languageChange(); virtual void markChecksAsPrinted(const QString); private: bool _captive; int _setCheckNumber; bool _allrecips_eft_enabled; bool _somerecips_eft_enabled; }; #endif // PRINTCHECKS_H qt-client-4.1.0/guiclient/printChecks.ui000066400000000000000000000143571217451700100202230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printChecks 0 0 620 164 Print Checks Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Next Check #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 # of Checks to Print: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 9999 Qt::Horizontal QSizePolicy::Expanding 0 36 Order Checks By Name Qt::Horizontal 40 20 0 5 &Cancel false &Print true true false Create EFT File Qt::Vertical QSizePolicy::Expanding 10 0 XCheckBox QCheckBox

    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _bankaccnt _nextCheckNum _numberOfChecks _orderByName _close _print _createEFT _close clicked() printChecks reject() 487 33 20 20 qt-client-4.1.0/guiclient/printChecksReview.cpp000066400000000000000000000126701217451700100215460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printChecksReview.h" #include #include #include "guiclient.h" #include "storedProcErrorLookup.h" printChecksReview::printChecksReview(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_complete, SIGNAL(clicked()), this, SLOT(sComplete())); connect(_printed, SIGNAL(clicked()), this, SLOT(sMarkPrinted())); connect(_replace, SIGNAL(clicked()), this, SLOT(sMarkReplaced())); connect(_selectAll, SIGNAL(clicked()), this, SLOT(sSelectAll())); connect(_unmark, SIGNAL(clicked()), this, SLOT(sUnmark())); connect(_voided, SIGNAL(clicked()), this, SLOT(sMarkVoided())); _checks->addColumn(tr("Check Number"), -1, Qt::AlignLeft ); _checks->addColumn(tr("Action"), _itemColumn, Qt::AlignLeft ); } printChecksReview::~printChecksReview() { // no need to delete child widgets, Qt does it all for us } void printChecksReview::languageChange() { retranslateUi(this); } static const int ActionUnmark = -1; static const int ActionPrinted = 1; static const int ActionVoided = 2; static const int ActionReplaced = 3; /* TODO: refactor printChecks/printChecksReview so that printChecks hands printChecksReview a list of checks to be reviewed instead of populating printChecksReview directly. Then printChecksReview could populate its GUI from this list. This will allow printChecksReview to have real error reporting and recovery: requery the db for the entire passed-in list and show the current state of each check so the user can decide what to reprocess if there were errors. */ void printChecksReview::sComplete() { XSqlQuery checkPrint; checkPrint.prepare( "SELECT markCheckAsPrinted(:check_id) AS result;"); XSqlQuery checkVoid; checkVoid.prepare( "SELECT voidCheck(:check_id) AS result;" ); XSqlQuery checkReplace; checkReplace.prepare( "SELECT replaceVoidedCheck(:check_id) AS result;" ); // no returns in the loop: process as much as possible, regardless of errors for (int i = 0; i < _checks->topLevelItemCount(); i++) { XTreeWidgetItem *cursor = (XTreeWidgetItem*)(_checks->topLevelItem(i)); switch(cursor->altId()) { case ActionPrinted: checkPrint.bindValue(":check_id", cursor->id()); checkPrint.exec(); if (checkPrint.first()) { int result = checkPrint.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("markCheckPrinted", result), __FILE__, __LINE__); } else if (checkPrint.lastError().type() != QSqlError::NoError) systemError(this, checkPrint.lastError().databaseText(), __FILE__, __LINE__); break; case ActionVoided: checkVoid.bindValue(":check_id", cursor->id()); checkVoid.exec(); if (checkVoid.first()) { int result = checkVoid.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("voidCheck", result), __FILE__, __LINE__); } else if (checkVoid.lastError().type() != QSqlError::NoError) systemError(this, checkVoid.lastError().databaseText(), __FILE__, __LINE__); break; case ActionReplaced: checkVoid.bindValue(":check_id", cursor->id()); checkVoid.exec(); if (checkVoid.first()) { int result = checkVoid.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("voidCheck", result), __FILE__, __LINE__); } else if (checkVoid.lastError().type() != QSqlError::NoError) systemError(this, checkVoid.lastError().databaseText(), __FILE__, __LINE__); checkReplace.bindValue(":check_id", cursor->id()); checkReplace.exec(); if (checkReplace.first()) { int result = checkReplace.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("replaceVoidedCheck", result), __FILE__, __LINE__); } else if (checkReplace.lastError().type() != QSqlError::NoError) systemError(this, checkReplace.lastError().databaseText(), __FILE__, __LINE__); break; } } // TODO: after refactoring, handle any errors in the loop here and *return* close(); } void printChecksReview::sUnmark() { markSelected(ActionUnmark); } void printChecksReview::sMarkPrinted() { markSelected(ActionPrinted); } void printChecksReview::sMarkVoided() { markSelected(ActionVoided); } void printChecksReview::sMarkReplaced() { markSelected(ActionReplaced); } void printChecksReview::sSelectAll() { _checks->selectAll(); } void printChecksReview::markSelected( int actionId ) { QString action; switch(actionId) { case ActionPrinted: action = tr("Printed"); break; case ActionVoided: action = tr("Voided"); break; case ActionReplaced: action = tr("Replace"); break; case ActionUnmark: default: actionId = -1; action = ""; }; QList selected = _checks->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem *cursor = (XTreeWidgetItem*)selected[i]; cursor->setText(1, action); cursor->setAltId(actionId); } } qt-client-4.1.0/guiclient/printChecksReview.h000066400000000000000000000021571217451700100212120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTCHECKSREVIEW_H #define PRINTCHECKSREVIEW_H #include "xdialog.h" #include "ui_printChecksReview.h" class printChecksReview : public XDialog, public Ui::printChecksReview { Q_OBJECT public: printChecksReview(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printChecksReview(); public slots: virtual void sUnmark(); virtual void sMarkPrinted(); virtual void sMarkVoided(); virtual void sMarkReplaced(); virtual void sSelectAll(); protected: virtual void markSelected( int ); protected slots: virtual void languageChange(); virtual void sComplete(); private: }; #endif // PRINTCHECKSREVIEW_H qt-client-4.1.0/guiclient/printChecksReview.ui000066400000000000000000000132061217451700100213750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printChecksReview 0 0 482 335 Review Printed Checks Make any necessary adjustments by marking the listed Checks appropriately. 0 QAbstractItemView::ExtendedSelection 0 0 0 Complete QFrame::HLine QFrame::Sunken &Unmark Mark as &Printed &Void Void && &Replace QFrame::HLine QFrame::Sunken Select All 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _checks _unmark _printed _voided _replace _selectAll _complete
    qt-client-4.1.0/guiclient/printCreditMemo.cpp000066400000000000000000000043451217451700100212140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printCreditMemo.h" #include #include #include printCreditMemo::printCreditMemo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printMulticopyDocument("CreditMemoCopies", "CreditMemoWatermark", "CreditMemoShowPrices", "PostARDocuments", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("CM"); setReportKey("cmhead_id"); _distributeInventory = true; _docinfoQueryString = "SELECT cmhead_id AS docid," " cmhead_number AS docnumber," " cmhead_printed AS printed," " cmhead_posted AS posted," " cmhead_cust_id," " findCustomerForm(cmhead_cust_id, 'C') AS reportname " "FROM cmhead " "WHERE (cmhead_id=);" ; _markOnePrintedQry = "UPDATE cmhead " " SET cmhead_printed=TRUE " " WHERE (cmhead_id=);" ; _postFunction = "postCreditMemo"; _postQuery = "SELECT postCreditMemo(, 0) AS result;" ; connect(this, SIGNAL(docUpdated(int)), this, SLOT(sHandleDocUpdated(int))); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sHandlePopulated(XSqlQuery*))); } printCreditMemo::~printCreditMemo() { } void printCreditMemo::languageChange() { retranslateUi(this); } void printCreditMemo::sHandlePopulated(XSqlQuery *qry) { if (qry) { _number->setText(qry->value("docnumber").toString()); _cust->setId(qry->value("cmhead_cust_id").toInt()); } } void printCreditMemo::sHandleDocUpdated(int docid) { Q_UNUSED(docid); omfgThis->sCreditMemosUpdated(); } qt-client-4.1.0/guiclient/printCreditMemo.h000066400000000000000000000020011217451700100206440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTCREDITMEMO_H #define PRINTCREDITMEMO_H #include "printMulticopyDocument.h" #include "ui_printCreditMemo.h" class printCreditMemo : public printMulticopyDocument, public Ui::printCreditMemo { Q_OBJECT public: printCreditMemo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printCreditMemo(); protected slots: virtual void languageChange(); virtual void sHandleDocUpdated(int docid); virtual void sHandlePopulated(XSqlQuery *qry); protected: }; #endif // PRINTCREDITMEMO_H qt-client-4.1.0/guiclient/printCreditMemo.ui000066400000000000000000000067251217451700100210530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printCreditMemo 0 0 263 116 Print Credit Memo 7 5 Credit Memo #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Horizontal QSizePolicy::Expanding 31 10 Qt::Vertical 20 40 CustCluster QWidget
    custcluster.h
    parameter.h qprinter.h
    qt-client-4.1.0/guiclient/printCreditMemos.cpp000066400000000000000000000047121217451700100213750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printCreditMemos.h" #include #include #include #include #include "storedProcErrorLookup.h" #include "distributeInventory.h" printCreditMemos::printCreditMemos(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printMulticopyDocument("CreditMemoCopies", "CreditMemoWatermark", "CreditMemoShowPrices", "PostARDocuments", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("CM"); setReportKey("cmhead_id"); _distributeInventory = true; _docinfoQueryString = "SELECT cmhead_id AS docid," " cmhead_number AS docnumber," " cmhead_printed AS printed," " cmhead_posted AS posted," " cmhead_cust_id," " findCustomerForm(cmhead_cust_id, 'C') AS reportname" " FROM cmhead " " WHERE (NOT cmhead_hold" " AND NOT COALESCE(cmhead_printed, false)" " AND checkCreditMemoSitePrivs(cmhead_id));" ; _markAllPrintedQry = "UPDATE cmhead" " SET cmhead_printed=TRUE " " WHERE cmhead_id IN (" "" " , " " " "" ");" ; _postFunction = "postCreditMemo"; _postQuery = "SELECT postCreditMemo(, 0) AS result;" ; connect(this, SIGNAL(finishedWithAll()), this, SLOT(sHandleFinishedWithAll())); } printCreditMemos::~printCreditMemos() { // no need to delete child widgets, Qt does it all for us } void printCreditMemos::languageChange() { retranslateUi(this); } void printCreditMemos::sHandleFinishedWithAll() { omfgThis->sCreditMemosUpdated(); this->close(); } qt-client-4.1.0/guiclient/printCreditMemos.h000066400000000000000000000017051217451700100210410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTCREDITMEMOS_H #define PRINTCREDITMEMOS_H #include "printMulticopyDocument.h" #include "ui_printCreditMemos.h" class printCreditMemos : public printMulticopyDocument, public Ui::printCreditMemos { Q_OBJECT public: printCreditMemos(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printCreditMemos(); protected slots: virtual void languageChange(); virtual void sHandleFinishedWithAll(); }; #endif // PRINTCREDITMEMOS_H qt-client-4.1.0/guiclient/printCreditMemos.ui000066400000000000000000000016621217451700100212310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printCreditMemos 0 0 339 84 Print Credit Memos qt-client-4.1.0/guiclient/printInvoice.cpp000066400000000000000000000055231217451700100205570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printInvoice.h" #include #include printInvoice::printInvoice(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : printMulticopyDocument("InvoiceCopies", "InvoiceWatermark", "InvoiceShowPrices", "PostMiscInvoices", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("IN"); setReportKey("invchead_id"); _distributeInventory = true; _docinfoQueryString = "SELECT invchead_id AS docid," " invchead_invcnumber AS docnumber," " invchead_printed AS printed," " invchead_posted AS posted," " invchead_cust_id," " findCustomerForm(invchead_cust_id, 'I') AS reportname " "FROM invchead " "WHERE (invchead_id=);" ; _askBeforePostingQry = "SELECT invoiceTotal() = 0 AS ask;" ; _askBeforePostingMsg = tr("

    Invoice %1 has a total value of 0.
    " "Would you like to post it anyway?

    "); _errCheckBeforePostingQry = "SELECT EXISTS(SELECT *" " FROM curr_rate, invchead " " WHERE ((curr_id=invchead_curr_id)" " AND (invchead_invcdate BETWEEN curr_effective AND curr_expires)" " AND (invchead_id=))) AS ok;" ; _errCheckBeforePostingMsg = tr("Could not post Invoice %1 because of a missing exchange rate."); _markOnePrintedQry = "UPDATE invchead" " SET invchead_printed=TRUE" " WHERE (invchead_id=);" ; _postFunction = "postInvoice"; _postQuery = "SELECT postInvoice() AS result;" ; connect(this, SIGNAL(docUpdated(int)), this, SLOT(sHandleDocUpdated(int))); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sHandlePopulated(XSqlQuery*))); } printInvoice::~printInvoice() { } void printInvoice::languageChange() { retranslateUi(this); } void printInvoice::sHandlePopulated(XSqlQuery *qry) { if (qry) { _invoiceNum->setText(qry->value("docnumber").toString()); _cust->setId(qry->value("invchead_cust_id").toInt()); } } void printInvoice::sHandleDocUpdated(int docid) { omfgThis->sInvoicesUpdated(docid, TRUE); } qt-client-4.1.0/guiclient/printInvoice.h000066400000000000000000000017461217451700100202270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTINVOICE_H #define PRINTINVOICE_H #include "printMulticopyDocument.h" #include "ui_printInvoice.h" class printInvoice : public printMulticopyDocument, public Ui::printInvoice { Q_OBJECT public: printInvoice(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~printInvoice(); protected slots: virtual void languageChange(); virtual void sHandlePopulated(XSqlQuery *qry); virtual void sHandleDocUpdated(int docid); protected: }; #endif // PRINTINVOICE_H qt-client-4.1.0/guiclient/printInvoice.ui000066400000000000000000000070601217451700100204100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printInvoice 0 0 263 116 Print Invoice 7 5 First Invoice #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 100 20 Qt::Horizontal QSizePolicy::Expanding 31 10 Qt::Vertical 20 40 CustCluster QWidget
    custcluster.h
    parameter.h qprinter.h
    qt-client-4.1.0/guiclient/printInvoices.cpp000066400000000000000000000107011217451700100207340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printInvoices.h" #include #include #include #include #include "errorReporter.h" printInvoices::printInvoices(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : printMulticopyDocument("InvoiceCopies", "InvoiceWatermark", "InvoiceShowPrices", "PostMiscInvoices", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("IN"); setReportKey("invchead_id"); _distributeInventory = true; _shipvia->populate( "SELECT MIN(invchead_id), invchead_shipvia " " FROM invchead " " WHERE ( (NOT invchead_printed)" " AND (NOT invchead_posted) )" " GROUP BY invchead_shipvia" " ORDER BY invchead_shipvia;" ); QString errmsg; bool ok = false; MetaSQLQuery mql = MQLUtil::mqlLoad("invoices", "print", errmsg, &ok); if (ok) _docinfoQueryString = mql.getSource(); else ErrorReporter::error(QtCriticalMsg, this, tr("Getting Invoices to Print"), errmsg, __FILE__, __LINE__); _markAllPrintedQry = "UPDATE invchead" " SET invchead_printed=TRUE " " WHERE invchead_id IN (" "" " , " " " "" ");" ; _postFunction = "postInvoice"; _postQuery = "SELECT postInvoice() AS result;" ; _askBeforePostingQry = "SELECT invoiceTotal() = 0 AS ask;" ; _askBeforePostingMsg = tr("

    Invoice %1 has a total value of 0.
    " "Would you like to post it anyway?

    "); _errCheckBeforePostingQry = "SELECT EXISTS(SELECT *" " FROM curr_rate, invchead " " WHERE ((curr_id=invchead_curr_id)" " AND (invchead_invcdate BETWEEN curr_effective AND curr_expires)" " AND (invchead_id=))) AS ok;" ; _errCheckBeforePostingMsg = tr("Could not post Invoice %1 because of a missing exchange rate."); connect(this, SIGNAL(aboutToStart(XSqlQuery*)), this, SLOT(sHandleAboutToStart(XSqlQuery*))); connect(this, SIGNAL(finishedWithAll()), this, SLOT(sHandleFinishedWithAll())); } printInvoices::~printInvoices() { // no need to delete child widgets, Qt does it all for us } void printInvoices::languageChange() { retranslateUi(this); } ParameterList printInvoices::getParamsDocList() { ParameterList params = printMulticopyDocument::getParamsDocList(); if (_selectedShipvia->isChecked()) params.append("shipvia", _shipvia->currentText()); return params; } ParameterList printInvoices::getParamsOneCopy(const int row, XSqlQuery *qry) { ParameterList params = printMulticopyDocument::getParamsOneCopy(row, qry); if (_selectedShipvia->isChecked()) params.append("shipvia", _shipvia->currentText()); return params; } void printInvoices::sHandleAboutToStart(XSqlQuery *qry) { int invoiceNumber = qry->value("invchead_invcnumber").toInt(); if (invoiceNumber == 0) { XSqlQuery local; local.prepare("UPDATE invchead" " SET invchead_invcnumber=text(fetchInvcNumber())" " WHERE (invchead_id=:invchead_id)" " RETURNING invchead_invcnumber;" ); local.bindValue(":invchead_id", qry->value("invchead_id")); local.exec(); if (local.first()) ; // TODO: what should we should do with the new invchead_invcnumber? else ErrorReporter::error(QtCriticalMsg, this, tr("Updating Invoice"), local, __FILE__, __LINE__); } } void printInvoices::sHandleFinishedWithAll() { omfgThis->sInvoicesUpdated(-1, TRUE); } qt-client-4.1.0/guiclient/printInvoices.h000066400000000000000000000021561217451700100204060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTINVOICES_H #define PRINTINVOICES_H #include "printMulticopyDocument.h" #include "ui_printInvoices.h" class printInvoices : public printMulticopyDocument, public Ui::printInvoices { Q_OBJECT public: printInvoices(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printInvoices(); Q_INVOKABLE virtual ParameterList getParamsDocList(); Q_INVOKABLE virtual ParameterList getParamsOneCopy(const int row, XSqlQuery *qry); protected slots: virtual void languageChange(); virtual void sHandleAboutToStart(XSqlQuery*); virtual void sHandleFinishedWithAll(); }; #endif // PRINTINVOICES_H qt-client-4.1.0/guiclient/printInvoices.ui000066400000000000000000000057601217451700100206000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printInvoices 0 0 389 115 Print Invoices All Ship Vias true Selected Ship Via false 0 0 XComboBox::Adhoc Qt::Vertical QSizePolicy::Expanding 10 41 XComboBox QComboBox
    xcombobox.h
    _selectedShipvia toggled(bool) _shipvia setEnabled(bool) 88 62 276 62
    qt-client-4.1.0/guiclient/printItemLabelsByClassCode.cpp000066400000000000000000000047371217451700100232660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printItemLabelsByClassCode.h" #include #include #include printItemLabelsByClassCode::printItemLabelsByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _captive = FALSE; _classCode->setType(ParameterGroup::ClassCode); _report->populate( "SELECT labelform_id, labelform_name " "FROM labelform " "ORDER BY labelform_name;" ); } printItemLabelsByClassCode::~printItemLabelsByClassCode() { // no need to delete child widgets, Qt does it all for us } void printItemLabelsByClassCode::languageChange() { retranslateUi(this); } enum SetResponse printItemLabelsByClassCode::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("classcode_id", &valid); if (valid) _classCode->setId(param.toInt()); param = pParams.value("classcode_pattern", &valid); if (valid) _classCode->setPattern(param.toString()); return NoError; } void printItemLabelsByClassCode::sPrint() { XSqlQuery printPrint; printPrint.prepare( "SELECT labelform_report_name AS report_name " "FROM labelform " "WHERE ( (labelform_id=:labelform_id) );"); printPrint.bindValue(":labelform_id", _report->id()); printPrint.exec(); if (printPrint.first()) { ParameterList params; _warehouse->appendValue(params); _classCode->appendValue(params); orReport report(printPrint.value("report_name").toString(), params); if (report.isValid()) report.print(); else report.reportError(this); } else QMessageBox::warning( this, tr("Could not locate report"), tr("Could not locate the report definition the form \"%1\"") .arg(_report->currentText()) ); } qt-client-4.1.0/guiclient/printItemLabelsByClassCode.h000066400000000000000000000021471217451700100227240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTITEMLABELSBYCLASSCODE_H #define PRINTITEMLABELSBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_printItemLabelsByClassCode.h" class printItemLabelsByClassCode : public XDialog, public Ui::printItemLabelsByClassCode { Q_OBJECT public: printItemLabelsByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printItemLabelsByClassCode(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPrint(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // PRINTITEMLABELSBYCLASSCODE_H qt-client-4.1.0/guiclient/printItemLabelsByClassCode.ui000066400000000000000000000146511217451700100231150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printItemLabelsByClassCode 0 0 474 300 Print Item Labels by Class Code 12 12 0 5 false 0 false 0 5 Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 31 20 Qt::Vertical QSizePolicy::Expanding 20 23 5 Cancel &Print true Qt::Vertical QSizePolicy::Expanding 20 20 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    _classCode _warehouse _report _print _close parameter.h _close clicked() printItemLabelsByClassCode reject() 20 20 20 20
    qt-client-4.1.0/guiclient/printLabelsByInvoice.cpp000066400000000000000000000056541217451700100222020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printLabelsByInvoice.h" #include #include #include #include #include "guiclient.h" printLabelsByInvoice::printLabelsByInvoice(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_invoiceNumber, SIGNAL(editingFinished()), this, SLOT(sParseInvoiceNumber())); connect(_from, SIGNAL(valueChanged(int)), this, SLOT(sSetToMin(int))); _invcheadid = -1; _report->populate( "SELECT labelform_id, labelform_name " "FROM labelform " "ORDER BY labelform_name;" ); } printLabelsByInvoice::~printLabelsByInvoice() { // no need to delete child widgets, Qt does it all for us } void printLabelsByInvoice::languageChange() { retranslateUi(this); } void printLabelsByInvoice::sPrint() { XSqlQuery query; query.prepare( "SELECT labelform_report_name AS report_name " "FROM labelform " "WHERE ( (labelform_id=:labelform_id) );" ); query.bindValue(":labelform_id", _report->id()); query.exec(); if (query.first()) { ParameterList params; params.append("invchead_id", _invcheadid); params.append("labelFrom", _from->value()); params.append("labelTo", _to->value()); orReport report(query.value("report_name").toString(), params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } _invoiceNumber->clear(); _invoiceNumber->setFocus(); } else QMessageBox::warning(this, tr("Could not locate report"), tr("Could not locate the report definition the form \"%1\"") .arg(_report->currentText()) ); } void printLabelsByInvoice::sParseInvoiceNumber() { XSqlQuery query; query.prepare( "SELECT invchead_id " "FROM invchead " "WHERE (invchead_invcnumber=:invoiceNumber);" ); query.bindValue(":invoiceNumber", _invoiceNumber->text()); query.exec(); if (query.first()) { _print->setEnabled(TRUE); _invcheadid = query.value("invchead_id").toInt(); } else { _print->setEnabled(FALSE); _invoiceNumber->clear(); _invoiceNumber->setFocus(); _invcheadid = -1; } } void printLabelsByInvoice::sSetToMin(int pValue) { _to->setMinimum(pValue); } qt-client-4.1.0/guiclient/printLabelsByInvoice.h000066400000000000000000000020321217451700100216320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTLABELSBYINVOICE_H #define PRINTLABELSBYINVOICE_H #include "xdialog.h" #include "ui_printLabelsByInvoice.h" class printLabelsByInvoice : public XDialog, public Ui::printLabelsByInvoice { Q_OBJECT public: printLabelsByInvoice(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printLabelsByInvoice(); public slots: virtual void sPrint(); virtual void sParseInvoiceNumber(); virtual void sSetToMin( int pValue ); protected slots: virtual void languageChange(); private: int _invcheadid; }; #endif // PRINTLABELSBYINVOICE_H qt-client-4.1.0/guiclient/printLabelsByInvoice.ui000066400000000000000000000220131217451700100220210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printLabelsByInvoice 0 0 422 108 Print Labels by Invoice 5 7 0 0 0 5 0 5 &Invoice #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _invoiceNumber Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Labels: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 0 0 5 0 0 0 100 32767 Qt::Horizontal QSizePolicy::MinimumExpanding 61 20 0 0 0 5 from 9999 1 to 9999 1 Qt::Horizontal QSizePolicy::Expanding 65 16 Qt::Vertical QSizePolicy::Expanding 20 16 0 5 Cancel false &Print true Qt::Vertical QSizePolicy::Expanding 20 20 XComboBox QComboBox
    xcombobox.h
    0
    XLineEdit QLineEdit
    xlineedit.h
    0
    _invoiceNumber _report _from _to _print _close _close clicked() printLabelsByInvoice reject() 20 20 20 20
    qt-client-4.1.0/guiclient/printLabelsByOrder.cpp000066400000000000000000000065561217451700100216630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printLabelsByOrder.h" #include #include #include #include printLabelsByOrder::printLabelsByOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_labelFrom, SIGNAL(valueChanged(int)), this, SLOT(sSetToMin(int))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _captive = FALSE; _report->populate( "SELECT labelform_id, labelform_name " "FROM labelform " "ORDER BY labelform_name;" ); _order->setAllowedTypes(OrderLineEdit::Purchase | OrderLineEdit::Return | OrderLineEdit::Transfer); _order->setAllowedStatuses(OrderLineEdit::Unposted | OrderLineEdit::Open); } printLabelsByOrder::~printLabelsByOrder() { // no need to delete child widgets, Qt does it all for us } void printLabelsByOrder::languageChange() { retranslateUi(this); } enum SetResponse printLabelsByOrder::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("ordertype", &valid); if (valid) { _order->setAllowedType(param.toString()); } param = pParams.value("orderid", &valid); if (valid) { _order->setId(param.toInt()); _order->setReadOnly(true); } return NoError; } void printLabelsByOrder::sPrint() { XSqlQuery printPrint; printPrint.prepare( "SELECT labelform_report_name AS report_name " "FROM labelform " "WHERE ( (labelform_id=:labelform_id) );" ); printPrint.bindValue(":labelform_id", _report->id()); printPrint.exec(); if (printPrint.first()) { ParameterList params; params.append("orderhead_type", _order->type()); params.append("orderhead_id", _order->id()); if (_order->isPO()) params.append("pohead_id", _order->id()); else if (_order->isTO()) params.append("tohead_id", _order->id()); else if (_order->isRA()) params.append("rahead_id", _order->id()); params.append("labelFrom", _labelFrom->value()); params.append("labelTo", _labelTo->value()); orReport report(printPrint.value("report_name").toString(), params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } _order->setId(-1); _order->setFocus(); } else if (printPrint.lastError().type() != QSqlError::NoError) { systemError(this, printPrint.lastError().databaseText(), __FILE__, __LINE__); return; } else QMessageBox::warning(this, tr("Could not locate report"), tr("

    Could not locate the report definition for the form \"%1\"") .arg(_report->currentText()) ); if (_captive) accept(); } void printLabelsByOrder::sSetToMin(int pValue) { _labelTo->setMinimum(pValue); } qt-client-4.1.0/guiclient/printLabelsByOrder.h000066400000000000000000000021201217451700100213070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTLABELSBYORDER_H #define PRINTLABELSBYORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_printLabelsByOrder.h" class printLabelsByOrder : public XDialog, public Ui::printLabelsByOrder { Q_OBJECT public: printLabelsByOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printLabelsByOrder(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPrint(); virtual void sSetToMin( int pValue ); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // PRINTLABELSBYORDER_H qt-client-4.1.0/guiclient/printLabelsByOrder.ui000066400000000000000000000211121217451700100214770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printLabelsByOrder 0 0 422 190 Print Labels by Order 7 5 5 5 5 0 5 5 5 Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report Labels: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _labelFrom 5 0 5 from _labelFrom 1 9999 to _labelTo 1 9999 Qt::Horizontal QSizePolicy::Expanding 65 16 Qt::Vertical QSizePolicy::Expanding 20 16 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 Cancel false &Print true Qt::Vertical QSizePolicy::Expanding 20 20 OrderCluster QWidget

    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    _order _report _labelFrom _labelTo _print _close _close clicked() printLabelsByOrder reject() 20 20 20 20 _order valid(bool) _print setEnabled(bool) 165 42 375 46 qt-client-4.1.0/guiclient/printLabelsBySo.cpp000066400000000000000000000046701217451700100211640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printLabelsBySo.h" #include #include #include #include #include "guiclient.h" printLabelsBySo::printLabelsBySo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _so->setAllowedTypes(OrderLineEdit::Sales); QPushButton* _print = _buttonBox->button(QDialogButtonBox::Ok); _print->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sPrint())); connect(_so, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool))); connect(_from, SIGNAL(valueChanged(int)), this, SLOT(sSetToMin(int))); _report->populate( "SELECT labelform_id, labelform_name " "FROM labelform " "ORDER BY labelform_name;" ); } printLabelsBySo::~printLabelsBySo() { // no need to delete child widgets, Qt does it all for us } void printLabelsBySo::languageChange() { retranslateUi(this); } void printLabelsBySo::sPrint() { XSqlQuery printPrint; printPrint.prepare( "SELECT labelform_report_name AS report_name " "FROM labelform " "WHERE ( (labelform_id=:labelform_id) );"); printPrint.bindValue(":labelform_id", _report->id()); printPrint.exec(); if (printPrint.first()) { ParameterList params; params.append("sohead_id", _so->id()); params.append("labelFrom", _from->value()); params.append("labelTo", _to->value()); orReport report(printPrint.value("report_name").toString(), params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } _so->setId(-1); _so->setFocus(); } else QMessageBox::warning(this, tr("Could not locate report"), tr("Could not locate the report definition the form \"%1\"") .arg(_report->currentText()) ); } void printLabelsBySo::sSetToMin(int pValue) { _to->setMinimum(pValue); } qt-client-4.1.0/guiclient/printLabelsBySo.h000066400000000000000000000016531217451700100206270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTLABELSBYSO_H #define PRINTLABELSBYSO_H #include "xdialog.h" #include "ui_printLabelsBySo.h" class printLabelsBySo : public XDialog, public Ui::printLabelsBySo { Q_OBJECT public: printLabelsBySo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printLabelsBySo(); public slots: virtual void sPrint(); virtual void sSetToMin( int pValue ); protected slots: virtual void languageChange(); }; #endif // PRINTLABELSBYSO_H qt-client-4.1.0/guiclient/printLabelsBySo.ui000066400000000000000000000163441217451700100210200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printLabelsBySo 0 0 469 104 Print Labels by Sales Order 7 5 0 5 Sales Order #: false 5 5 Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Labels: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 5 from 1 9999 to 1 9999 Qt::Horizontal QSizePolicy::Expanding 65 16 Qt::Vertical QSizePolicy::Expanding 20 16 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Qt::Vertical QSizePolicy::Expanding 20 20 OrderCluster QWidget
    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    _report _from _to
    qt-client-4.1.0/guiclient/printLabelsByTo.cpp000066400000000000000000000050071217451700100211600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printLabelsByTo.h" #include #include #include #include #include "guiclient.h" printLabelsByTo::printLabelsByTo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _print = _buttonBox->button(QDialogButtonBox::Ok); _print->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sPrint())); connect(_order, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool))); connect(_from, SIGNAL(valueChanged(int)), this, SLOT(sSetToMin(int))); _order->setAllowedTypes(OrderLineEdit::Transfer); _order->setAllowedStatuses(OrderLineEdit::Open | OrderLineEdit::Closed); _report->populate( "SELECT labelform_id, labelform_name " "FROM labelform " "ORDER BY labelform_name;" ); } printLabelsByTo::~printLabelsByTo() { // no need to delete child widgets, Qt does it all for us } void printLabelsByTo::languageChange() { retranslateUi(this); } void printLabelsByTo::sPrint() { XSqlQuery printPrint; printPrint.prepare( "SELECT labelform_report_name AS report_name " "FROM labelform " "WHERE ( (labelform_id=:labelform_id) );"); printPrint.bindValue(":labelform_id", _report->id()); printPrint.exec(); if (printPrint.first()) { ParameterList params; params.append("tohead_id", _order->id()); params.append("labelFrom", _from->value()); params.append("labelTo", _to->value()); orReport report(printPrint.value("report_name").toString(), params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } _order->setId(-1); _order->setFocus(); } else QMessageBox::warning(this, tr("Could not locate report"), tr("Could not locate the report definition the form \"%1\"") .arg(_report->currentText()) ); } void printLabelsByTo::sSetToMin(int pValue) { _to->setMinimum(pValue); } qt-client-4.1.0/guiclient/printLabelsByTo.h000066400000000000000000000017451217451700100206320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTLABELSBYTO_H #define PRINTLABELSBYTO_H #include #include "xdialog.h" #include "ui_printLabelsByTo.h" class printLabelsByTo : public XDialog, public Ui::printLabelsByTo { Q_OBJECT public: printLabelsByTo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printLabelsByTo(); public slots: virtual void sPrint(); virtual void sSetToMin( int pValue ); protected slots: virtual void languageChange(); private: QPushButton* _print; }; #endif // PRINTLABELSBYTO_H qt-client-4.1.0/guiclient/printLabelsByTo.ui000066400000000000000000000160271217451700100210170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printLabelsByTo 0 0 451 148 Print Labels by Transfer Order 7 5 0 5 5 5 Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Labels: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 5 from 1 9999 to 1 9999 Qt::Horizontal QSizePolicy::Expanding 65 16 Qt::Vertical QSizePolicy::Expanding 20 0 0 Qt::Horizontal QSizePolicy::Expanding 0 20 5 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Qt::Vertical QSizePolicy::Expanding 20 20 OrderCluster QWidget
    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    _report _from _to
    qt-client-4.1.0/guiclient/printMulticopyDocument.cpp000066400000000000000000000373301217451700100226500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printMulticopyDocument.h" #include #include #include #include #include #include #include "distributeInventory.h" #include "errorReporter.h" #include "storedProcErrorLookup.h" class printMulticopyDocumentPrivate : public Ui::printMulticopyDocument { public: printMulticopyDocumentPrivate(::printMulticopyDocument *parent, QString postPrivilege = QString()) : _alert(true), _captive(false), _docid(-1), _parent(parent), _postPrivilege(postPrivilege), _printer(0), _mpIsInitialized(false) { setupUi(_parent); _printer = new QPrinter(QPrinter::HighResolution); _print->setFocus(); } ~printMulticopyDocumentPrivate() { if (_printer) { delete _printer; _printer = 0; } } bool _alert; bool _captive; int _docid; QString _doctype; QString _doctypefull; ::printMulticopyDocument *_parent; QString _postPrivilege; QPrinter *_printer; bool _mpIsInitialized; QList _printed; QString _reportKey; }; printMulticopyDocument::printMulticopyDocument(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { _data = new printMulticopyDocumentPrivate(this); connect(_data->_print, SIGNAL(clicked()), this, SLOT(sPrint())); // This indirection allows scripts to replace core behavior - 14285 connect(this, SIGNAL(timeToPrintOneDoc(XSqlQuery*)), this, SLOT(sPrintOneDoc(XSqlQuery*))); connect(this, SIGNAL(timeToMarkOnePrinted(XSqlQuery*)), this, SLOT(sMarkOnePrinted(XSqlQuery*))); connect(this, SIGNAL(timeToPostOneDoc(XSqlQuery*)), this, SLOT(sPostOneDoc(XSqlQuery*))); _distributeInventory = false; } printMulticopyDocument::printMulticopyDocument(QString numCopiesMetric, QString watermarkMetric, QString showPriceMetric, QString postPrivilege, QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { _data = new printMulticopyDocumentPrivate(this, postPrivilege); _data->_copies->setWatermarkMetric(watermarkMetric); _data->_copies->setShowPriceMetric(showPriceMetric); _data->_copies->setNumCopiesMetric(numCopiesMetric); connect(_data->_print, SIGNAL(clicked()), this, SLOT(sPrint())); // This indirection allows scripts to replace core behavior - 14285 connect(this, SIGNAL(timeToPrintOneDoc(XSqlQuery*)), this, SLOT(sPrintOneDoc(XSqlQuery*))); connect(this, SIGNAL(timeToMarkOnePrinted(XSqlQuery*)), this, SLOT(sMarkOnePrinted(XSqlQuery*))); connect(this, SIGNAL(timeToPostOneDoc(XSqlQuery*)), this, SLOT(sPostOneDoc(XSqlQuery*))); _distributeInventory = false; setPostPrivilege(postPrivilege); } printMulticopyDocument::~printMulticopyDocument() { if (_data) { delete _data; _data = 0; } } void printMulticopyDocument::languageChange() { _data->retranslateUi(this); } enum SetResponse printMulticopyDocument::set(const ParameterList &pParams) { XDialog::set(pParams); _data->_captive = true; QVariant param; bool valid; param = pParams.value(reportKey(), &valid); if (valid) setId(param.toInt()); param = pParams.value("docid", &valid); if (valid) setId(param.toInt()); if (pParams.inList("print")) { sPrint(); return NoError_Print; } if (pParams.inList("persistentPrint")) { _data->_alert = FALSE; if (_data->_mpIsInitialized) { sPrint(); return NoError_Print; } else return Error_NoSetup; } return NoError; } void printMulticopyDocument::sAddToPrintedList(XSqlQuery *docq) { QVariant docid = docq->value("docid"); if (! _data->_printed.contains(docid)) _data->_printed.append(docid); } bool printMulticopyDocument::sMarkOnePrinted(XSqlQuery *docq) { bool wasMarked = false; if (_markOnePrintedQry.isEmpty()) wasMarked = true; // not really but a reflection of best effort else { ParameterList markp; markp.append("docid", docq->value("docid")); markp.append("docnumber", docq->value("docnumber")); MetaSQLQuery markm(_markOnePrintedQry); XSqlQuery markq = markm.toQuery(markp); if (! ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), markq, __FILE__, __LINE__)) wasMarked = true; if (wasMarked && _data->_alert) emit docUpdated(docq->value("docid").toInt()); } if (wasMarked) sAddToPrintedList(docq); return wasMarked; } bool printMulticopyDocument::sPostOneDoc(XSqlQuery *docq) { if (! _postQuery.isEmpty() && _data->_post->isChecked() && isOnPrintedList(docq->value("docid").toInt()) && ! docq->value("posted").toBool()) { QString docnumber = docq->value("docnumber").toString(); message(tr("Posting %1 #%2").arg(_data->_doctypefull, docnumber)); ParameterList postp; postp.append("docid", docq->value("docid")); postp.append("docnumber", docq->value("docnumber")); if (! _askBeforePostingQry.isEmpty()) { MetaSQLQuery askm(_askBeforePostingQry); XSqlQuery askq = askm.toQuery(postp); if (ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Post %1").arg(docnumber), askq, __FILE__, __LINE__)) return false; else if (askq.value("ask").toBool() && QMessageBox::question(this, tr("Post Anyway?"), _askBeforePostingMsg.arg(docnumber), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return false; } if (! _errCheckBeforePostingQry.isEmpty()) { MetaSQLQuery errm(_errCheckBeforePostingQry); XSqlQuery errq = errm.toQuery(postp); if (ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Post %1").arg(docnumber), errq, __FILE__, __LINE__)) return false; else if (! errq.first() || ! errq.value("ok").toBool()) { ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Post %1").arg(docnumber), _errCheckBeforePostingMsg, __FILE__, __LINE__); return false; } } //TODO: find a way to do this without holding locks during user input XSqlQuery("BEGIN;"); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); MetaSQLQuery postm(_postQuery); XSqlQuery postq = postm.toQuery(postp); if (postq.first()) { int result = postq.value("result").toInt(); if (result < 0) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Post %1").arg(docnumber), storedProcErrorLookup(_postFunction, result), __FILE__, __LINE__); return false; } if (_distributeInventory && (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected)) { rollback.exec(); QMessageBox::information(this, tr("Posting Canceled"), tr("Transaction Canceled") ); return false; } } else if (postq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Post %1").arg(docnumber), postq, __FILE__, __LINE__); return false; } XSqlQuery("COMMIT;"); emit posted(_data->_docid); } return true; } void printMulticopyDocument::sPrint() { if (! isOkToPrint()) return; bool mpStartedInitialized = _data->_mpIsInitialized; _data->_printed.clear(); MetaSQLQuery docinfom(_docinfoQueryString); ParameterList alldocsp = getParamsDocList(); XSqlQuery docinfoq = docinfom.toQuery(alldocsp); while (docinfoq.next()) { message(tr("Processing %1 #%2") .arg(_data->_doctypefull, docinfoq.value("docnumber").toString())); // This indirection allows scripts to replace core behavior - 14285 emit aboutToStart(&docinfoq); emit timeToPrintOneDoc(&docinfoq); emit timeToMarkOnePrinted(&docinfoq); emit timeToPostOneDoc(&docinfoq); message(""); } if (! mpStartedInitialized) { orReport::endMultiPrint(_data->_printer); _data->_mpIsInitialized = false; } if (_data->_printed.size() == 0) QMessageBox::information(this, tr("No Documents to Print"), tr("There aren't any documents to print.")); else if (! _markAllPrintedQry.isEmpty() && QMessageBox::question(this, tr("Mark Documents as Printed?"), tr("

    Did all of the documents print correctly?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { ParameterList allp; allp.append("printedDocs", QVariant(_data->_printed)); MetaSQLQuery markAllPrintedm(_markAllPrintedQry); XSqlQuery markPrintedq = markAllPrintedm.toQuery(allp); ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), markPrintedq, __FILE__, __LINE__); // don't return if (_data->_alert) emit docUpdated(-1); } _data->_printed.clear(); emit finishedWithAll(); if (_data->_captive) accept(); else clear(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Print"), docinfoq, __FILE__, __LINE__)) return; } bool printMulticopyDocument::sPrintOneDoc(XSqlQuery *docq) { QString reportname = docq->value("reportname").toString(); QString docnumber = docq->value("docnumber").toString(); bool printedOk = false; if (! _data->_mpIsInitialized) { bool userCanceled = false; if (orReport::beginMultiPrint(_data->_printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return false; } } orReport report(reportname); if (! report.isValid()) QMessageBox::critical(this, tr("Cannot Find Form"), tr("

    Cannot find form '%1' for %2 %3. " "It cannot be printed until the Form " "Assignment is updated to remove references " "to this Form or the Form is created.") .arg(reportname, _data->_doctypefull, docnumber)); else { for (int i = 0; i < _data->_copies->numCopies(); i++) { report.setParamList(getParamsOneCopy(i, docq)); if (! report.isValid()) { ErrorReporter::error(QtCriticalMsg, this, tr("Invalid Parameters"), tr("

    Report '%1' cannot be run. Parameters " "are missing.").arg(reportname), __FILE__, __LINE__); printedOk = false; continue; } else if (report.print(_data->_printer, ! _data->_mpIsInitialized)) { _data->_mpIsInitialized = true; printedOk = true; } else { report.reportError(this); printedOk = false; continue; } } } if (printedOk) emit finishedPrinting(docq->value("docid").toInt()); return printedOk; } void printMulticopyDocument::populate() { ParameterList getp = getParamsDocList(); MetaSQLQuery getm(_docinfoQueryString); XSqlQuery getq = getm.toQuery(getp); if (getq.first()) { if (getq.value("posted").toBool()) { _data->_post->setChecked(false); _data->_post->hide(); } else _data->_post->setVisible(! _data->_postPrivilege.isEmpty()); emit populated(&getq); } } void printMulticopyDocument::clear() { } XDocCopySetter *printMulticopyDocument::copies() { return _data->_copies; } QString printMulticopyDocument::doctype() { return _data->_doctype; } ParameterList printMulticopyDocument::getParamsDocList() { ParameterList params; if (_data->_docid > 0) { params.append(_data->_reportKey, _data->_docid); params.append("docid", _data->_docid); } return params; } ParameterList printMulticopyDocument::getParamsOneCopy(int row, XSqlQuery *qry) { ParameterList params; params.append(_data->_reportKey, qry->value("docid")); params.append("showcosts", (_data->_copies->showCosts(row) ? "TRUE" : "FALSE")); params.append("watermark", _data->_copies->watermark(row)); return params; } int printMulticopyDocument::id() { return _data->_docid; } bool printMulticopyDocument::isOkToPrint() { return true; } bool printMulticopyDocument::isOnPrintedList(const int docid) { return _data->_printed.contains(docid); } bool printMulticopyDocument::isSetup() { return _data->_mpIsInitialized; } QWidget *printMulticopyDocument::optionsWidget() { return _data->_optionsFrame; } QString printMulticopyDocument::reportKey() { return _data->_reportKey; } void printMulticopyDocument::setDoctype(QString doctype) { _data->_doctype = doctype; if (doctype == "AR") _data->_doctypefull = tr("A/R Statement"); else if (doctype == "CM") _data->_doctypefull = tr("Credit Memo"); else if (doctype == "IN") _data->_doctypefull = tr("Invoice"); else if (doctype == "L") _data->_doctypefull = tr("Pick List"); else if (doctype == "P") _data->_doctypefull = tr("Packing List"); else if (doctype == "PO") _data->_doctypefull = tr("Purchase Order"); else if (doctype == "QT") _data->_doctypefull = tr("Quote"); else if (doctype == "SO") _data->_doctypefull = tr("Sales Order"); else qWarning("printMulticopyDocument could not figure out doctypefull for %s", qPrintable(doctype)); } void printMulticopyDocument::setId(int docid) { _data->_docid = docid; populate(); emit newId(_data->_docid); } void printMulticopyDocument::setNumCopiesMetric(QString metric) { _data->_copies->setNumCopiesMetric(metric); } void printMulticopyDocument::setPostPrivilege(QString priv) { _data->_postPrivilege = priv; _data->_post->setVisible(! priv.isEmpty()); _data->_post->setChecked(_privileges->check(priv)); _data->_post->setEnabled(_privileges->check(priv)); } void printMulticopyDocument::setReportKey(QString key) { _data->_reportKey = key; } void printMulticopyDocument::setSetup(bool pSetup) { _data->_mpIsInitialized = pSetup; } void printMulticopyDocument::setShowPriceMetric(QString metric) { _data->_copies->setShowPriceMetric(metric); } void printMulticopyDocument::setWatermarkMetric(QString metric) { _data->_copies->setWatermarkMetric(metric); } qt-client-4.1.0/guiclient/printMulticopyDocument.h000066400000000000000000000077011217451700100223140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTMULTICOPYDOCUMENT_H #define PRINTMULTICOPYDOCUMENT_H #include "ui_printMulticopyDocument.h" #include #include "distributeInventory.h" #include "guiclient.h" #include "xdialog.h" class XDocCopySetter; class printMulticopyDocumentPrivate; class printMulticopyDocument : public XDialog { Q_OBJECT friend class printMulticopyDocumentPrivate; Q_PROPERTY(QString doctype READ doctype WRITE setDoctype) Q_PROPERTY(QString reportKey READ reportKey WRITE setReportKey) public: printMulticopyDocument(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); printMulticopyDocument(QString numCopiesMetric, QString watermarkMetric, QString showPriceMetric, QString postPrivilege = QString(), QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~printMulticopyDocument(); Q_INVOKABLE virtual enum SetResponse set(const ParameterList &pParams); Q_INVOKABLE virtual void clear(); Q_INVOKABLE virtual XDocCopySetter *copies(); virtual QString doctype(); Q_INVOKABLE virtual ParameterList getParamsDocList(); Q_INVOKABLE virtual ParameterList getParamsOneCopy(const int row, XSqlQuery *qry); Q_INVOKABLE virtual int id(); Q_INVOKABLE virtual bool isOkToPrint(); Q_INVOKABLE virtual bool isOnPrintedList(const int docid); Q_INVOKABLE virtual bool isSetup(); Q_INVOKABLE virtual QWidget *optionsWidget(); Q_INVOKABLE virtual void populate(); virtual QString reportKey(); Q_INVOKABLE virtual void setNumCopiesMetric(QString metric); Q_INVOKABLE virtual void setPostPrivilege(QString priv); virtual void setReportKey(QString key); Q_INVOKABLE virtual void setSetup(bool setup); Q_INVOKABLE virtual void setShowPriceMetric(QString metric); Q_INVOKABLE virtual void setWatermarkMetric(QString metric); public slots: virtual void sAddToPrintedList(XSqlQuery *docq); virtual bool sMarkOnePrinted(XSqlQuery *docq); virtual bool sPostOneDoc(XSqlQuery *docq); virtual void sPrint(); virtual bool sPrintOneDoc(XSqlQuery *docq); virtual void setDoctype(QString doctype); virtual void setId(int docid); signals: void docUpdated(int); void aboutToStart(XSqlQuery *qry); void finishedPrinting(int); void finishedWithAll(); void newId(int id); void populated(XSqlQuery *docq); void posted(int); void timeToMarkOnePrinted(XSqlQuery *docq); void timeToPrintOneDoc(XSqlQuery *docq); void timeToPostOneDoc(XSqlQuery *docq); protected slots: virtual void languageChange(); protected: printMulticopyDocumentPrivate *_data; bool _distributeInventory; QString _docinfoQueryString; QString _askBeforePostingQry; QString _askBeforePostingMsg; QString _errCheckBeforePostingQry; QString _errCheckBeforePostingMsg; QString _markAllPrintedQry; QString _markOnePrintedQry; QString _postFunction; QString _postQuery; private: }; #endif // PRINTMULTICOPYDOCUMENT_H qt-client-4.1.0/guiclient/printMulticopyDocument.ui000066400000000000000000000070041217451700100224760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printMulticopyDocument 0 0 601 356 Print Multiple Copies of Document &Cancel &Print true true Qt::Vertical QSizePolicy::Expanding 10 41 Post after Printing 0 5 QFrame::NoFrame QFrame::Plain XCheckBox QCheckBox

    xcheckbox.h
    XDocCopySetter QWidget
    xdoccopysetter.h
    parameter.h qprinter.h _close clicked() printMulticopyDocument reject() 20 20 20 20 qt-client-4.1.0/guiclient/printOptions.cpp000066400000000000000000000037641217451700100206230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printOptions.h" #include "xtsettings.h" #include printOptions::printOptions(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_printerGroup, SIGNAL(toggled(bool)), this, SLOT(sHandleCheckbox())); QPrinterInfo pinfo; QList plist = pinfo.availablePrinters(); for (int i = 0; i < plist.size(); ++i) _printers->addItem(plist.at(i).printerName()); } printOptions::~printOptions() { // no need to delete child widgets, Qt does it all for us } void printOptions::languageChange() { retranslateUi(this); } enum SetResponse printOptions::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("parentName", &valid); if (valid) { _parentName = param.toString(); _autoPrint->setChecked(xtsettingsValue(QString("%1.autoPrint").arg(_parentName)).toBool()); _printers->setCurrentIndex(_printers->findText(xtsettingsValue(QString("%1.defaultPrinter").arg(_parentName)).toString())); _printerGroup->setChecked(!_printers->currentText().isEmpty()); } return NoError; } void printOptions::sHandleCheckbox() { if (!_printerGroup->isChecked()) _printers->clearEditText(); } void printOptions::sSave() { xtsettingsSetValue(QString("%1.autoPrint").arg(_parentName), (bool)_autoPrint->isChecked()); xtsettingsSetValue(QString("%1.defaultPrinter").arg(_parentName), _printers->currentText()); accept(); } qt-client-4.1.0/guiclient/printOptions.h000066400000000000000000000020371217451700100202600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTOPTIONS_H #define PRINTOPTIONS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_printOptions.h" class printOptions : public XDialog, public Ui::printOptions { Q_OBJECT public: printOptions(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printOptions(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sHandleCheckbox(); protected slots: virtual void languageChange(); private: QString _parentName; }; #endif // PRINTOPTIONS_H qt-client-4.1.0/guiclient/printOptions.ui000066400000000000000000000044771217451700100204600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printOptions 0 0 400 118 Print Options Print Automatically Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok Always use this printer true false true _buttonBox rejected() printOptions reject() 316 260 286 274 qt-client-4.1.0/guiclient/printPackingList.cpp000066400000000000000000000327421217451700100213760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printPackingList.h" #include #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "inputManager.h" /* printPackingList is a subclass of printSinglecopyDocument that overrides most of the behavior of its parent. The logic of this window is so complex that it's hard to know how to simplify it to better fit the printSinglecopyDocument model. TODO: figure out how to simplify it anyway. use orderhead table? */ class printPackingListPrivate { public: printPackingListPrivate(::printPackingList *parent) : _shipformid(-1) { Q_UNUSED(parent); } int _shipformid; }; printPackingList::printPackingList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printSinglecopyDocument(parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); _pldata = new printPackingListPrivate(this); setDoctype("P"); // a simple singleton select allows using printSinglecopyDocument::sPrint() _docinfoQueryString = "SELECT AS docid," " AS docnumber," " false AS printed," " AS reportname" ";" ; connect(_order, SIGNAL(valid(bool)), this, SLOT(sPopulate())); connect(_reprint, SIGNAL(toggled(bool)), this, SLOT(sHandleReprint())); connect(_shipment, SIGNAL(newId(int)), this, SLOT(sHandleShipment())); _order->setAllowedStatuses(OrderLineEdit::Open); _order->setAllowedTypes(OrderLineEdit::Sales | OrderLineEdit::Transfer); _order->setFromSitePrivsEnforced(TRUE); _shipment->setStatus(ShipmentClusterLineEdit::Unshipped); _orderDate->setEnabled(false); omfgThis->inputManager()->notify(cBCSalesOrder, this, _order, SLOT(setId(int))); } printPackingList::~printPackingList() { if (_pldata) { delete _pldata; _pldata = 0; } } void printPackingList::languageChange() { retranslateUi(this); } enum SetResponse printPackingList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("sohead_id", &valid); if (valid) { _order->setAllowedStatuses(OrderLineEdit::AnyStatus); _order->setId(param.toInt(), "SO"); } param = pParams.value("tohead_id", &valid); if (valid) { _order->setAllowedStatuses(OrderLineEdit::AnyStatus); _order->setId(param.toInt(), "TO"); } QString ordertype; param = pParams.value("head_type", &valid); if (valid) ordertype = param.toString(); param = pParams.value("head_id", &valid); if (valid) { if (ordertype.isEmpty()) return UndefinedError; else { _order->setAllowedStatuses(OrderLineEdit::AnyStatus); _order->setId(param.toInt(), ordertype); } } param = pParams.value("shiphead_id", &valid); if (valid) { _shipment->setId(param.toInt()); XSqlQuery shipq; shipq.prepare("SELECT shiphead_order_type, shiphead_order_id, shiphead_shipform_id " "FROM shiphead " "WHERE shiphead_id=:shiphead_id;"); shipq.bindValue(":shiphead_id", param); shipq.exec(); if (shipq.first()) { _pldata->_shipformid = shipq.value("shiphead_shipform_id").toInt(); ordertype = shipq.value("shiphead_order_type").toString(); if (ordertype == "SO" || ordertype == "TO") { _order->setAllowedStatuses(OrderLineEdit::AnyStatus); _order->setId(shipq.value("shiphead_order_id").toInt(), ordertype); } else return UndefinedError; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Shipment"), shipq, __FILE__, __LINE__)) return UndefinedError; } sHandleReprint(); setId(_order->id()); return printSinglecopyDocument::set(pParams); } ParameterList printPackingList::getParams(XSqlQuery *docq) { Q_UNUSED(docq); // unlike other printSinglecopyDocuments, don't call parent::getParams ParameterList params; setReportKey(reportKey()); params.append("head_id", _order->id()); if (_order->isSO()) params.append("head_type", "SO"); else if (_order->isTO()) params.append("head_type", "TO"); params.append(reportKey(), _order->id()); params.append("docid", _order->id()); params.append("form", doctype()); if (_pldata->_shipformid > 0 && ! _printPick->isChecked()) params.append("shipformid", _pldata->_shipformid); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_metrics->boolean("EnableReturnAuth")) params.append("EnableReturnAuth"); if (_shipment->id() > 0) params.append("shiphead_id", _shipment->id()); if (_metrics->boolean("EnableSOReservations")) params.append("EnableSOReservations"); if (_metrics->boolean("EnableSOReservationsByLocation")) params.append("EnableSOReservationsByLocation"); QString msg; bool valid = false; MetaSQLQuery formm = MQLUtil::mqlLoad("packingList", "getreport", msg, &valid); if (! valid) ErrorReporter::error(QtCriticalMsg, this, tr("Error Finding Form"), msg, __FILE__, __LINE__); XSqlQuery formq = formm.toQuery(params); if (formq.first()) params.append("reportname", formq.value("reportname").toString()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Finding Form"), formq, __FILE__, __LINE__)) { params.clear(); return params; } return params; } ParameterList printPackingList::getParamsDocList() { // unlike other printSinglecopyDocuments ParameterList params = getParams(0); return params; } bool printPackingList::isOkToPrint() { QList errors; errors << GuiErrorCheck(! _order->isValid() && _order->type() == "SO", _order, tr("You must enter a Sales Order Number")) << GuiErrorCheck(! _order->isValid() && _order->type() == "TO", _order, tr("You must enter a Transfer Order Number")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Print"), errors)) return false; return true; } QString printPackingList::reportKey() { if (_order->isSO()) return "sohead_id"; else if (_order->isTO()) return "tohead_id"; return ""; } void printPackingList::sPopulate() { if (_order->isSO() && _order->isValid()) { _shipment->setType(ShipmentClusterLineEdit::SalesOrder); _shipment->limitToOrder(_order->id()); } else if (_order->isTO() && _order->isValid()) { _shipment->setType(ShipmentClusterLineEdit::TransferOrder); _shipment->limitToOrder(_order->id()); } else { _shipment->setType(ShipmentClusterLineEdit::All); _shipment->removeOrderLimit(); } setPrintEnabled(_order->isValid()); if (! _order->type().isEmpty()) { ParameterList destp; if (_order->isSO()) destp.append("sohead_id", _order->id()); else if (_order->isTO()) destp.append("tohead_id", _order->id()); QString dests = "" "SELECT cohead_number AS order_number," " cohead_orderdate AS orderdate," " cohead_custponumber AS alternate_number," " cust_name AS name, cntct_phone AS phone " "FROM cohead " " JOIN custinfo ON (cohead_cust_id=cust_id)" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" "WHERE ( (cohead_cust_id=cust_id)" " AND (cohead_id=) );" "" "SELECT tohead_number AS order_number," " tohead_orderdate AS orderdate," " '' AS alternate_number," " tohead_destname AS name, tohead_destphone AS phone " "FROM tohead " "WHERE (tohead_id=);" "" ; MetaSQLQuery destm(dests); XSqlQuery destq = destm.toQuery(destp); if (destq.first()) { _orderDate->setDate(destq.value("orderdate").toDate()); _poNumber->setText(destq.value("alternate_number").toString()); _custName->setText(destq.value("name").toString()); _custPhone->setText(destq.value("phone").toString()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Recipient Information"), destq, __FILE__, __LINE__)) return; ParameterList params; params.append("order_id", _order->id()); params.append("ordertype", _order->type()); if (_shipment->id() > 0) params.append("shiphead_id", _shipment->id()); MetaSQLQuery mql("SELECT shiphead_id " "FROM shiphead " "WHERE ((shiphead_order_id=) " " AND (shiphead_order_type = )" "" " AND (shiphead_id=)" "" " AND (NOT shiphead_shipped) " "" ") " "ORDER BY shiphead_number " "LIMIT 1;"); XSqlQuery shipq = mql.toQuery(params); if (shipq.first()) { if (shipq.value("shiphead_id").toInt() != _shipment->id()) _shipment->setId(shipq.value("shiphead_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Finding Shipment"), shipq, __FILE__, __LINE__)) return; else { _shipment->setId(-1); } } else { _shipment->removeOrderLimit(); _shipment->clear(); _orderDate->clear(); _poNumber->clear(); _custName->clear(); _custPhone->clear(); _pldata->_shipformid = -1; } } void printPackingList::clear() { _order->setId(-1); _order->setFocus(); } QString printPackingList::doctype() { if (_printPack->isChecked()) return "P"; else if (_printPick->isChecked()) return "L"; else return (_shipment->id() > 0) ? "P" : "L"; } void printPackingList::sHandleShipment() { if (! _shipment->isValid()) return; ParameterList params; params.append("shiphead_id", _shipment->id()); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); QString msg; bool valid = false; MetaSQLQuery mql = MQLUtil::mqlLoad("packingList", "shipment", msg, &valid); XSqlQuery plq = mql.toQuery(params); if (plq.first()) { _pldata->_shipformid = plq.value("shiphead_shipform_id").toInt(); QString ordertype = plq.value("shiphead_order_type").toString(); int orderid = plq.value("shiphead_order_id").toInt(); if (ordertype == "SO" && ! _order->isValid()) _order->setId(orderid); else if (ordertype == "TO" && ! _order->isValid()) _order->setId(orderid); else if (orderid != _order->id()) { if (ordertype == "SO") { if (QMessageBox::question(this, tr("Shipment for different Order"), tr("

    Shipment %1 is for Sales Order %2. " "Are you sure the Shipment Number is correct?") .arg(_shipment->number()) .arg(plq.value("number").toString()), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) _order->setId(plq.value("shiphead_order_id").toInt()); else { _pldata->_shipformid = -1; _shipment->clear(); } } else if (ordertype == "TO") { if (QMessageBox::question(this, tr("Shipment for different Order"), tr("

    Shipment %1 is for Transfer Order %2. " "Are you sure the Shipment Number is correct?") .arg(_shipment->number()) .arg(plq.value("number").toString()), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) _order->setId(plq.value("shiphead_order_id").toInt()); else { _pldata->_shipformid = -1; _shipment->clear(); } } } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Finding Packing List Data"), plq, __FILE__, __LINE__)) return; } void printPackingList::sHandleReprint() { if (_reprint->isChecked()) { _order->setAllowedStatuses(OrderLineEdit::AnyStatus); _shipment->setStatus(ShipmentClusterLineEdit::AllStatus); } else { _order->setAllowedStatuses(OrderLineEdit::Open); _shipment->setStatus(ShipmentClusterLineEdit::Unshipped); } } qt-client-4.1.0/guiclient/printPackingList.h000066400000000000000000000027541217451700100210430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTPACKINGLIST_H #define PRINTPACKINGLIST_H #include "printSinglecopyDocument.h" #include "ui_printPackingList.h" class printPackingListPrivate; class printPackingList : public printSinglecopyDocument, public Ui::printPackingList { Q_OBJECT public: printPackingList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printPackingList(); Q_INVOKABLE virtual void clear(); virtual QString doctype(); Q_INVOKABLE virtual ParameterList getParams(XSqlQuery *docq); Q_INVOKABLE virtual ParameterList getParamsDocList(); Q_INVOKABLE virtual bool isOkToPrint(); virtual QString reportKey(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sHandleShipment(); virtual void sHandleReprint(); virtual void sPopulate(); protected slots: virtual void languageChange(); protected: printPackingListPrivate *_pldata; }; #endif // PRINTPACKINGLIST_H qt-client-4.1.0/guiclient/printPackingList.ui000066400000000000000000000212751217451700100212300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printPackingList 0 0 640 354 0 0 Print Packing List Form Auto Select true Pick List false Qt::Horizontal 0 20 Packing List 0 0 Reprint 0 0 Qt::StrongFocus Qt::Horizontal 0 20 Qt::StrongFocus Shipment#: Qt::Vertical 20 0 Customer Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Customer Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Purchase Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 Qt::Vertical 20 1 DLineEdit QWidget

    datecluster.h
    1 OrderCluster QWidget
    ordercluster.h
    ShipmentCluster QWidget
    shipmentcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _auto _printPack _printPick _reprint _order _shipment _orderDate qt-client-4.1.0/guiclient/printPackingListBatchByShipvia.cpp000066400000000000000000000120401217451700100241440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printPackingListBatchByShipvia.h" #include #include #include #include #include #include #include "mqlutil.h" printPackingListBatchByShipvia::printPackingListBatchByShipvia(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _dates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _dates->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); sPopulateShipVia(); } printPackingListBatchByShipvia::~printPackingListBatchByShipvia() { // no need to delete child widgets, Qt does it all for us } void printPackingListBatchByShipvia::languageChange() { retranslateUi(this); } void printPackingListBatchByShipvia::sPrint() { QPrinter printer(QPrinter::HighResolution); bool setupPrinter = TRUE; if (!_dates->allValid()) { QMessageBox::warning( this, tr("Enter a Valid Start and End Date"), tr("You must enter a valid Start and End Date for this report.") ); _dates->setFocus(); return; } XSqlQuery prtd; QString prts("UPDATE pack SET pack_printed=TRUE" " WHERE ((pack_head_id=) " " AND (pack_head_type=)" "" " AND (pack_shiphead_id=)" "" " AND (pack_shiphead_id IS NULL)" "" ");" ); XSqlQuery packq; ParameterList params; _dates->appendValue(params); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); params.append("shipvia", _shipvia->currentText()); MetaSQLQuery packm = mqlLoad("packingListBatchByShipVia", "print"); packq = packm.toQuery(params); if (packq.lastError().type() != QSqlError::NoError) { systemError(this, packq.lastError().databaseText(), __FILE__, __LINE__); return; } bool userCanceled = false; if (orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return; } while (packq.next()) { ParameterList params; params.append("head_id", packq.value("pack_head_id").toInt()); params.append("head_type", packq.value("pack_head_type").toString()); if (packq.value("pack_head_type").toString() == "SO") params.append("sohead_id", packq.value("pack_head_id").toInt()); else if (packq.value("pack_head_type").toString() == "TO") params.append("tohead_id", packq.value("pack_head_id").toInt()); if (! packq.value("pack_shiphead_id").isNull()) { params.append("shiphead_id", packq.value("pack_shiphead_id").toInt()); } if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (packq.value("orderhead_status").toString() != "C") { bool usePickForm; if (_auto->isChecked()) usePickForm = packq.value("pack_shiphead_id").isNull(); else usePickForm = _pick->isChecked(); orReport report(packq.value( usePickForm ? "pickform" : "packform").toString(), params); if (report.isValid()) { if (report.print(&printer, setupPrinter)) { setupPrinter = FALSE; emit finishedPrinting(packq.value("pack_head_id").toInt(), packq.value("pack_head_type").toString(), packq.value("pack_shiphead_id").toInt()); } else { orReport::endMultiPrint(&printer); return; } } else { report.reportError(this); orReport::endMultiPrint(&printer); return; } } MetaSQLQuery mql(prts); prtd = mql.toQuery(params); if (prtd.lastError().type() != QSqlError::NoError) { systemError(this, prtd.lastError().databaseText(), __FILE__, __LINE__); orReport::endMultiPrint(&printer); return; } } orReport::endMultiPrint(&printer); sPopulateShipVia(); } void printPackingListBatchByShipvia::sPopulateShipVia() { XSqlQuery printPopulateShipVia; ParameterList params; if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); MetaSQLQuery mql = mqlLoad("packingListBatchByShipVia", "shipVia"); printPopulateShipVia = mql.toQuery(params); _shipvia->populate(printPopulateShipVia); if (printPopulateShipVia.lastError().type() != QSqlError::NoError) systemError(this, printPopulateShipVia.lastError().databaseText(), __FILE__, __LINE__); } qt-client-4.1.0/guiclient/printPackingListBatchByShipvia.h000066400000000000000000000022241217451700100236140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTPACKINGLISTBATCHBYSHIPVIA_H #define PRINTPACKINGLISTBATCHBYSHIPVIA_H #include "guiclient.h" #include "xdialog.h" #include "ui_printPackingListBatchByShipvia.h" class printPackingListBatchByShipvia : public XDialog, public Ui::printPackingListBatchByShipvia { Q_OBJECT public: printPackingListBatchByShipvia(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printPackingListBatchByShipvia(); public slots: virtual void sPrint(); virtual void sPopulateShipVia(); signals: void finishedPrinting(int orderid, QString ordertype, int shipheadid); protected slots: virtual void languageChange(); private: }; #endif // PRINTPACKINGLISTBATCHBYSHIPVIA_H qt-client-4.1.0/guiclient/printPackingListBatchByShipvia.ui000066400000000000000000000136071217451700100240110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printPackingListBatchByShipvia 0 0 546 187 Print Packing List Batch by Ship Via Ship Via: Qt::Horizontal QSizePolicy::MinimumExpanding 194 18 &Cancel &Print Qt::Vertical QSizePolicy::Expanding 20 40 Form Auto Select true Packing List Pick List false Schedule Date Range Qt::StrongFocus Qt::Horizontal 18 20 DateCluster QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    _shipvia _auto _pack _pick _dates _print _cancel _cancel clicked() printPackingListBatchByShipvia close() 20 20 20 20
    qt-client-4.1.0/guiclient/printPoForm.cpp000066400000000000000000000065431217451700100203700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printPoForm.h" #include #include "errorReporter.h" printPoForm::printPoForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printSinglecopyDocument(parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("PO"); setReportKey("pohead_id"); _docinfoQueryString = "SELECT pohead_id AS docid, pohead_id," " pohead_number AS docnumber," " pohead_printed AS printed," "" " (SELECT form_report_name" " FROM form" " WHERE ((form_name=)" " AND (form_key='PO')))" "" " COALESCE((SELECT MIN(form_report_name)" " FROM form WHERE (form_key='PO'))," " 'PurchaseOrder')" " AS reportname" " FROM pohead" " WHERE (pohead_id=);" ; _report->populate( "SELECT form_id, form_name, form_name " "FROM form " "WHERE (form_key='PO') " "ORDER BY form_name;" ); connect(_po, SIGNAL(newId(int, QString)), this, SLOT(sHandleNewOrderId())); connect(_report, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); connect(this, SIGNAL(finishedWithAll()), this, SLOT(sFinishedWithAll())); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sPopulate(XSqlQuery*))); } printPoForm::~printPoForm() { // no need to delete child widgets, Qt does it all for us } void printPoForm::languageChange() { retranslateUi(this); } ParameterList printPoForm::getParamsDocList() { ParameterList params = printSinglecopyDocument::getParamsDocList(); if (_report->isValid()) params.append("reportname", _report->code()); return params; } void printPoForm::sFinishedWithAll() { _po->setId(-1); } void printPoForm::sHandleButtons() { setPrintEnabled(_po->isValid() && _report->isValid()); } void printPoForm::sHandleNewOrderId() { setId(_po->id()); if (_po->isValid()) { ParameterList params; params.append("docid", _po->id()); MetaSQLQuery mql(_docinfoQueryString); XSqlQuery qry = mql.toQuery(params); if (qry.first()) _report->setCode(qry.value("reportname").toString()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Purchase Order Form"), qry, __FILE__, __LINE__)) return; } sHandleButtons(); } void printPoForm::sPopulate(XSqlQuery *docq) { _po->setId(docq->value("docid").toInt()); _report->setCode(docq->value("reportname").toString()); } qt-client-4.1.0/guiclient/printPoForm.h000066400000000000000000000021261217451700100200260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTPOFORM_H #define PRINTPOFORM_H #include "printSinglecopyDocument.h" #include "ui_printPoForm.h" class printPoForm : public printSinglecopyDocument, public Ui::printPoForm { Q_OBJECT public: printPoForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printPoForm(); Q_INVOKABLE virtual ParameterList getParamsDocList(); public slots: virtual void sFinishedWithAll(); virtual void sHandleButtons(); virtual void sHandleNewOrderId(); virtual void sPopulate(XSqlQuery *docq); protected slots: virtual void languageChange(); }; #endif // PRINTPOFORM_H qt-client-4.1.0/guiclient/printPoForm.ui000066400000000000000000000054241217451700100202200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printPoForm 0 0 460 138 Print Purchase Order Form OrderLineEdit::Purchase Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::Expanding 433 0 OrderCluster QWidget
    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    _report
    qt-client-4.1.0/guiclient/printPurchaseOrder.cpp000066400000000000000000000060751217451700100217340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printPurchaseOrder.h" #include #include #include "errorReporter.h" printPurchaseOrder::printPurchaseOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printMulticopyDocument("POCopies", "POWatermark", "POShowPrices", "", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("PO"); setReportKey("pohead_id"); _docinfoQueryString = "SELECT pohead_id AS docid, pohead_id," " pohead_number AS docnumber," " pohead_printed AS printed," " false AS posted," " 'PurchaseOrder' AS reportname," " pohead_saved" " FROM pohead" " WHERE (pohead_id=);" ; _markOnePrintedQry = "UPDATE pohead" " SET pohead_printed=TRUE " " WHERE (pohead_id=);" ; connect(_po, SIGNAL(newId(int, QString)), this, SLOT(setId(int))); connect(this, SIGNAL(docUpdated(int)), this, SLOT(sHandleDocUpdated(int))); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sHandlePopulated(XSqlQuery*))); } printPurchaseOrder::~printPurchaseOrder() { } void printPurchaseOrder::languageChange() { retranslateUi(this); } ParameterList printPurchaseOrder::getParamsOneCopy(const int row, XSqlQuery *qry) { ParameterList params = printMulticopyDocument::getParamsOneCopy(row, qry); params.append("title", copies()->watermark(row)); return params; } bool printPurchaseOrder::isOkToPrint() { MetaSQLQuery mql(_docinfoQueryString); ParameterList params; params.append("docid", id()); XSqlQuery okq = mql.toQuery(params); if (okq.first() && ! okq.value("pohead_saved").toBool()) { QMessageBox::warning( this, tr("Cannot Print P/O"), tr("

    The Purchase Order you are trying to print has " "not been completed. Please wait until the " "Purchase Order has been completely saved.") ); return false; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Has P/O Been Saved?"), okq, __FILE__, __LINE__)) return false; return true; } void printPurchaseOrder::sHandleDocUpdated(int docid) { omfgThis->sPurchaseOrdersUpdated(docid, false); } void printPurchaseOrder::sHandlePopulated(XSqlQuery *docq) { if (docq && _po->id() != docq->value("docid").toInt()) _po->setId(docq->value("docid").toInt()); } qt-client-4.1.0/guiclient/printPurchaseOrder.h000066400000000000000000000023121217451700100213670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTPURCHASEORDER_H #define PRINTPURCHASEORDER_H #include "printMulticopyDocument.h" #include "ui_printPurchaseOrder.h" class printPurchaseOrder : public printMulticopyDocument, public Ui::printPurchaseOrder { Q_OBJECT public: printPurchaseOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printPurchaseOrder(); Q_INVOKABLE virtual ParameterList getParamsOneCopy(const int row, XSqlQuery *qry); Q_INVOKABLE virtual bool isOkToPrint(); protected slots: virtual void languageChange(); virtual void sHandleDocUpdated(int docid); virtual void sHandlePopulated(XSqlQuery *docq); }; #endif // PRINTPURCHASEORDER_H qt-client-4.1.0/guiclient/printPurchaseOrder.ui000066400000000000000000000035151217451700100215630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printPurchaseOrder 0 0 255 102 Print Purchase Order OrderLineEdit::Open|OrderLineEdit::Unposted OrderLineEdit::Purchase Qt::Vertical QSizePolicy::Expanding 20 20 OrderCluster QWidget

    ordercluster.h
    parameter.h qt-client-4.1.0/guiclient/printPurchaseOrdersByAgent.cpp000066400000000000000000000102551217451700100233640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printPurchaseOrdersByAgent.h" #include #include #include #include #include #include "guiclient.h" printPurchaseOrdersByAgent::printPurchaseOrdersByAgent(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _agent->setType(XComboBox::Agent); _agent->setText(omfgThis->username()); _vendorCopy->setChecked(_metrics->boolean("POVendor")); if (_metrics->value("POInternal").toInt() > 0) { _internalCopy->setChecked(TRUE); _numOfCopies->setValue(_metrics->value("POInternal").toInt()); } else { _internalCopy->setChecked(FALSE); _numOfCopies->setEnabled(FALSE); } } printPurchaseOrdersByAgent::~printPurchaseOrdersByAgent() { // no need to delete child widgets, Qt does it all for us } void printPurchaseOrdersByAgent::languageChange() { retranslateUi(this); } void printPurchaseOrdersByAgent::sPrint() { XSqlQuery markprinted; markprinted.prepare("UPDATE pohead" " SET pohead_printed=true" " WHERE (pohead_id=:pohead_id);"); XSqlQuery pohead; pohead.prepare( "SELECT pohead_id " "FROM pohead " "WHERE ( (pohead_agent_username=:username)" " AND (pohead_status='O')" " AND (NOT pohead_printed)" " AND (pohead_saved) );" ); pohead.bindValue(":username", _agent->currentText()); pohead.exec(); if (pohead.first()) { QPrinter *printer = new QPrinter(QPrinter::HighResolution); bool setupPrinter = TRUE; bool userCanceled = false; if (orReport::beginMultiPrint(printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return; } do { if (_vendorCopy->isChecked()) { ParameterList params; params.append("pohead_id", pohead.value("pohead_id").toInt()); params.append("title", "Vendor Copy"); orReport report("PurchaseOrder", params); if (report.isValid() && report.print(printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); orReport::endMultiPrint(printer); return; } } if (_internalCopy->isChecked()) { for (int counter = _numOfCopies->value(); counter; counter--) { ParameterList params; params.append("pohead_id", pohead.value("pohead_id")); params.append("title", QString("Internal Copy #%1").arg(counter)); orReport report("PurchaseOrder", params); if (report.isValid() && report.print(printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); orReport::endMultiPrint(printer); return; } } } markprinted.bindValue(":pohead_id", pohead.value("pohead_id").toInt()); markprinted.exec(); if (markprinted.lastError().type() != QSqlError::NoError) { systemError(this, markprinted.lastError().databaseText(), __FILE__, __LINE__); orReport::endMultiPrint(printer); return; } emit finishedPrinting(pohead.value("pohead_id").toInt()); } while (pohead.next()); orReport::endMultiPrint(printer); } else if (pohead.lastError().type() != QSqlError::NoError) { systemError(this, pohead.lastError().databaseText(), __FILE__, __LINE__); return; } else QMessageBox::information( this, tr("No Purchase Orders to Print"), tr("There are no posted, unprinted Purchase Orders entered by the selected Purchasing Agent to print.") ); accept(); } qt-client-4.1.0/guiclient/printPurchaseOrdersByAgent.h000066400000000000000000000020231217451700100230230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTPURCHASEORDERSBYAGENT_H #define PRINTPURCHASEORDERSBYAGENT_H #include "xdialog.h" #include "ui_printPurchaseOrdersByAgent.h" class printPurchaseOrdersByAgent : public XDialog, public Ui::printPurchaseOrdersByAgent { Q_OBJECT public: printPurchaseOrdersByAgent(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printPurchaseOrdersByAgent(); public slots: virtual void sPrint(); signals: void finishedPrinting(int); protected slots: virtual void languageChange(); }; #endif // PRINTPURCHASEORDERSBYAGENT_H qt-client-4.1.0/guiclient/printPurchaseOrdersByAgent.ui000066400000000000000000000244301217451700100232170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printPurchaseOrdersByAgent 0 0 432 119 Print Purchase Orders by Purchasing Agent 5 0 0 5 0 5 0 5 Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 0 0 0 0 0 Copies: 5 5 0 0 &Vendor Qt::Vertical QSizePolicy::MinimumExpanding 20 20 0 0 &Internal 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 # of C&opies: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _numOfCopies false Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 0 5 &Cancel true &Print true true Qt::Vertical QSizePolicy::MinimumExpanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 XComboBox QComboBox
    xcombobox.h
    0
    _agent _vendorCopy _internalCopy _numOfCopies _print _close _close clicked() printPurchaseOrdersByAgent reject() 20 20 20 20 _internalCopy toggled(bool) _numOfCopies setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/printQuote.cpp000066400000000000000000000054061217451700100202600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printQuote.h" #include #include "errorReporter.h" printQuote::printQuote(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl) : printSinglecopyDocument(parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("QT"); setReportKey("quhead_id"); _docinfoQueryString = "SELECT quhead_id AS docid, quhead_id," " quhead_number AS docnumber," " false AS printed," "" " " "" " findCustomerForm(quhead_cust_id, 'Q')" " AS reportname" " FROM quhead" " WHERE (quhead_id=);" ; connect(_quote, SIGNAL(newId(int)), this, SLOT(sHandleNewQuoteId())); connect(_report, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); connect(this, SIGNAL(finishedWithAll()), this, SLOT(sFinishedWithAll())); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sPopulate(XSqlQuery*))); } printQuote::~printQuote() { } void printQuote::languageChange() { retranslateUi(this); } ParameterList printQuote::getParamsDocList() { ParameterList params = printSinglecopyDocument::getParamsDocList(); if (_report->isValid()) params.append("reportname", _report->code()); return params; } void printQuote::sFinishedWithAll() { _quote->setId(-1); } void printQuote::sHandleButtons() { setPrintEnabled(_quote->isValid() && _report->isValid()); } void printQuote::sHandleNewQuoteId() { setId(_quote->id()); if (_quote->isValid()) { ParameterList params; params.append("docid", _quote->id()); MetaSQLQuery mql(_docinfoQueryString); XSqlQuery qry = mql.toQuery(params); if (qry.first()) _report->setCode(qry.value("reportname").toString()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Quote Form"), qry, __FILE__, __LINE__)) return; } sHandleButtons(); } void printQuote::sPopulate(XSqlQuery *docq) { _quote->setId(docq->value("docid").toInt()); _report->setCode(docq->value("reportname").toString()); } qt-client-4.1.0/guiclient/printQuote.h000066400000000000000000000021131217451700100177150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _PRINTQUOTE_H #define _PRINTQUOTE_H #include "printSinglecopyDocument.h" #include "ui_printQuote.h" class printQuote : public printSinglecopyDocument, public Ui::printQuote { Q_OBJECT public: printQuote(QWidget* parent = 0, const char* name = 0, bool modal = 0, Qt::WFlags fl = 0); ~printQuote(); Q_INVOKABLE virtual ParameterList getParamsDocList(); public slots: virtual void sFinishedWithAll(); virtual void sHandleButtons(); virtual void sHandleNewQuoteId(); virtual void sPopulate(XSqlQuery *docq); protected slots: virtual void languageChange(); }; #endif // _PRINTQUOTE_H qt-client-4.1.0/guiclient/printQuote.ui000066400000000000000000000056331217451700100201150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printQuote 0 0 235 132 Print Quote QFormLayout::FieldsStayAtSizeHint Quote: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true true Report: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report 0 0 true [ Select a Report ] XComboBox::Reports QuoteCluster QWidget
    quotecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    _report
    qt-client-4.1.0/guiclient/printRaForm.cpp000066400000000000000000000045621217451700100203530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printRaForm.h" #include #include #include #include #include "guiclient.h" printRaForm::printRaForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_ra, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool))); _captive = FALSE; _report->populate( "SELECT form_id, form_name " "FROM form " "WHERE (form_key='RA') " "ORDER BY form_name;" ); } printRaForm::~printRaForm() { // no need to delete child widgets, Qt does it all for us } void printRaForm::languageChange() { retranslateUi(this); } enum SetResponse printRaForm::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("rahead_id", &valid); if (valid) { _ra->setId(param.toInt()); } return NoError; } void printRaForm::sPrint() { XSqlQuery printPrint; printPrint.prepare( "SELECT form_report_name AS report_name " " FROM form " " WHERE ( (form_id=:form_id) );"); printPrint.bindValue(":form_id", _report->id()); printPrint.exec(); if (printPrint.first()) { ParameterList params; params.append("rahead_id", _ra->id()); orReport report(printPrint.value("report_name").toString(), params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } if (_captive) accept(); else { _ra->setId(-1); _ra->setFocus(); } } else QMessageBox::warning( this, tr("Could not locate report"), tr("Could not locate the report definition the form \"%1\"") .arg(_report->currentText()) ); } qt-client-4.1.0/guiclient/printRaForm.h000066400000000000000000000017571217451700100200230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTRAFORM_H #define PRINTRAFORM_H #include "xdialog.h" #include #include "ui_printRaForm.h" #include "guiclient.h" class printRaForm : public XDialog, public Ui::printRaForm { Q_OBJECT public: printRaForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printRaForm(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPrint(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // PRINTRAFORM_H qt-client-4.1.0/guiclient/printRaForm.ui000066400000000000000000000147101217451700100202020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printRaForm 0 0 445 115 Print Return Authorization Form 0 0 Return Auth.: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 5 Qt::StrongFocus 5 0 0 0 0 Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Vertical QSizePolicy::Expanding 306 16 0 0 0 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 5 0 0 0 0 Cancel false &Print true Qt::Vertical QSizePolicy::Expanding 20 20 RaCluster QWidget
    racluster.h
    XComboBox QComboBox
    xcombobox.h
    _ra _report _print _close _close clicked() printRaForm reject() 20 20 20 20
    qt-client-4.1.0/guiclient/printShippingForm.cpp000066400000000000000000000275541217451700100216000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printShippingForm.h" #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "mqlutil.h" printShippingForm::printShippingForm(QWidget *parent, const char *name, Qt::WFlags fl) : printMulticopyDocument("ShippingFormCopies", "ShippingFormWatermark", "ShippingFormShowPrices", "", parent, name, false, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("P"); setReportKey("shiphead_id"); _distributeInventory = false; _docinfoQueryString = "SELECT shiphead_id AS docid," " shiphead_number AS docnumber," " (shiphead_sfstatus = 'P') AS printed," " NULL AS posted," " shipform_report_name AS reportname," " shiphead_order_id, shiphead_order_type," " shiphead_shipchrg_id," "" " AS shipform_id" " FROM shiphead" " JOIN shipform ON (shipform_id=)" "" " shipform_id" " FROM shiphead" " JOIN shipform ON (shiphead_shipform_id=shipform_id)" "" " WHERE (shiphead_id=);" ; _markOnePrintedQry = "UPDATE shiphead" " SET shiphead_sfstatus='P'" " WHERE (shiphead_id=);" ; // programatically hiding -- see issue # 5853. TODO: remove it altogether? _shipchrg->hide(); _shipchrgLit->hide(); connect(_shipment, SIGNAL(newId(int)), this, SLOT(sHandleShipment())); connect(_order, SIGNAL(numberChanged(QString,QString)), this, SLOT(sHandleOrder())); _order->setAllowedTypes(OrderLineEdit::Sales | OrderLineEdit::Transfer); _order->setLabel(""); _shipment->setStatus(ShipmentClusterLineEdit::AllStatus); _shipment->setStrict(true); } printShippingForm::~printShippingForm() { // no need to delete child widgets, Qt does it all for us } void printShippingForm::languageChange() { retranslateUi(this); } void printShippingForm::clear() { depopulate(); _shipment->setId(-1); _order->setId(-1); _order->setEnabled(true); _order->setFocus(); } ParameterList printShippingForm::getParamsDocList() { ParameterList params = printMulticopyDocument::getParamsDocList(); params.append("shipformid", _shippingForm->id()); return params; } ParameterList printShippingForm::getParamsOneCopy(const int row, XSqlQuery *qry) { ParameterList params = printMulticopyDocument::getParamsOneCopy(row, qry); params.append("shipchrg_id", _shipchrg->id()); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); return params; } bool printShippingForm::isOkToPrint() { QList errors; errors<< GuiErrorCheck(!_shipment->isValid(), _shipment, tr("You must enter a Shipment Number.")) << GuiErrorCheck(_shippingForm->id() == -1, _shippingForm, tr("You must select a Shipping Form to print.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Print Shipping Form"), errors)) return false; return true; } // TODO: is there a better way than overriding ::populate()? void printShippingForm::populate() { int orderid = -1; QString ordertype; _shipment->setId(id()); XSqlQuery getq; getq.prepare("SELECT shiphead_order_id, shiphead_order_type," " shiphead_shipchrg_id, shiphead_shipform_id " "FROM shiphead " "WHERE (shiphead_id=:shiphead_id);" ); getq.bindValue(":shiphead_id", _shipment->id()); getq.exec(); if (getq.first()) { ordertype = getq.value("shiphead_order_type").toString(); orderid = getq.value("shiphead_order_id").toInt(); if (! getq.value("shiphead_shipform_id").isNull()) _shippingForm->setId(getq.value("shiphead_shipform_id").toInt()); _shipchrg->setId(getq.value("shiphead_shipchrg_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Shipment"), getq, __FILE__, __LINE__)) return; ParameterList headp; if (ordertype == "SO") { headp.append("sohead_id", orderid); _order->setId(orderid, "SO"); } else if (ordertype == "TO") { headp.append("tohead_id", orderid); _order->setId(orderid,"TO"); } QString heads = "" "SELECT cohead_id AS order_id, cohead_shiptoname AS shipto," " cohead_shiptoaddress1 AS addr1," " cohead_shipform_id AS shipform_id " "FROM cohead " "WHERE (cohead_id=);" "" "SELECT tohead_id AS order_id, tohead_destname AS shipto," " tohead_destaddress1 AS addr1," " tohead_shipform_id AS shipform_id " "FROM tohead " "WHERE (tohead_id=);" "" ; MetaSQLQuery headm(heads); XSqlQuery headq = headm.toQuery(headp); if (headq.first()) { _shipToName->setText(headq.value("shipto").toString()); _shipToAddr1->setText(headq.value("addr1").toString()); if (_shippingForm->id() <= 0) _shippingForm->setId(headq.value("shipform_id").toInt()); _order->setEnabled(false); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Order"), headq, __FILE__, __LINE__)) return; } void printShippingForm::sHandleShipment() { if (_shipment->isValid()) { setId(_shipment->id()); bool ok = false; QString errmsg; MetaSQLQuery sfm = MQLUtil::mqlLoad("shippingForm", "shipment", errmsg, &ok); if (! ok) { ErrorReporter::error(QtCriticalMsg, this, tr("Getting Shipping Form"), errmsg, __FILE__, __LINE__); return; } ParameterList params; params.append("shiphead_id", _shipment->id()); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_order->isValid() && _order->isSO()) params.append("sohead_id", _order->id()); if (_order->isValid() && _order->isTO()) params.append("tohead_id", _order->id()); XSqlQuery sfq = sfm.toQuery(params); if (sfq.first()) { int orderid = sfq.value("order_id").toInt(); if ((sfq.value("shiphead_order_type").toString() == "SO") && ((_order->id() != orderid) || (!_order->isSO()))) _order->setId(orderid, "SO"); else if ((sfq.value("shiphead_order_type").toString() == "TO") && ((_order->id() != orderid) || (!_order->isTO()))) _order->setId(orderid,"TO"); _shipToName->setText(sfq.value("shipto").toString()); _shipToAddr1->setText(sfq.value("addr1").toString()); _shippingForm->setId(sfq.value("shipform_id").toInt()); _shipchrg->setId(sfq.value("shiphead_shipchrg_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Shipping Form"), sfq, __FILE__, __LINE__)) return; else { QMessageBox::critical(this, tr("Could not find data"), tr("

    Could not find shipment on this order.")); _shipment->setId(-1); } } else { depopulate(); } } void printShippingForm::sHandleSo() { _shipment->clear(); _shipment->setType(ShipmentClusterLineEdit::SalesOrder); _shipment->limitToOrder(_order->id()); QString sql("SELECT cohead_id AS order_id, cohead_shiptoname AS shipto, " " cohead_shiptoaddress1 AS addr1, shiphead_order_type, " " shiphead_id, shiphead_shipchrg_id, shiphead_shipped, " " COALESCE(shiphead_shipform_id, cohead_shipform_id) AS shipform_id " "FROM cohead, shiphead " "WHERE ((cohead_id=shiphead_order_id)" " AND (shiphead_order_type='SO')" " AND (cohead_id= )" "" " AND (shiphead_id= )" "" ") " "ORDER BY shiphead_shipped " "LIMIT 1;"); ParameterList params; MetaSQLQuery mql(sql); params.append("sohead_id", _order->id()); if (_shipment->isValid()) params.append("shiphead_id", _shipment->id()); XSqlQuery soq = mql.toQuery(params); if (soq.first()) { if (_shipment->id() != soq.value("shiphead_id").toInt()) { setId(soq.value("shiphead_id").toInt()); _shipment->setId(soq.value("shiphead_id").toInt()); } _shipToName->setText(soq.value("shipto").toString()); _shipToAddr1->setText(soq.value("addr1").toString()); _shippingForm->setId(soq.value("shipform_id").toInt()); _shipchrg->setId(soq.value("shiphead_shipchrg_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Sales Order"), soq, __FILE__, __LINE__)) return; else depopulate(); } void printShippingForm::sHandleOrder() { if (_order->isSO()) sHandleSo(); else if (_order->isTO()) sHandleTo(); else { _shipment->removeOrderLimit(); _shipment->clear(); depopulate(); } } void printShippingForm::sHandleTo() { _shipment->clear(); _shipment->setType(ShipmentClusterLineEdit::TransferOrder); _shipment->limitToOrder(_order->id()); QString sql("SELECT tohead_id AS order_id, tohead_destname AS shipto, " " tohead_destaddress1 AS addr1, shiphead_order_type, " " shiphead_id, shiphead_shipchrg_id, shiphead_shipped, " " COALESCE(shiphead_shipform_id, tohead_shipform_id) AS shipform_id " "FROM tohead, shiphead " "WHERE ((tohead_id=shiphead_order_id)" " AND (shiphead_order_type='TO')" " AND (tohead_id= )" "" " AND (shiphead_id= )" "" ") " "ORDER BY shiphead_shipped " "LIMIT 1;"); ParameterList params; MetaSQLQuery mql(sql); params.append("tohead_id", _order->id()); if (_shipment->isValid()) params.append("shiphead_id", _shipment->id()); XSqlQuery toq = mql.toQuery(params); if (toq.first()) { if (_shipment->id() != toq.value("shiphead_id").toInt()) { setId(toq.value("shiphead_id").toInt()); _shipment->setId(toq.value("shiphead_id").toInt()); } _shipToName->setText(toq.value("shipto").toString()); _shipToAddr1->setText(toq.value("addr1").toString()); _shippingForm->setId(toq.value("shipform_id").toInt()); _shipchrg->setId(toq.value("shiphead_shipchrg_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Order"), toq, __FILE__, __LINE__)) return; else depopulate(); } void printShippingForm::depopulate() { //_shipment->clear(); _shipToName->clear(); _shipToAddr1->clear(); _shippingForm->setId(-1); _shipchrg->setId(-1); } qt-client-4.1.0/guiclient/printShippingForm.h000066400000000000000000000025331217451700100212330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTSHIPPINGFORM_H #define PRINTSHIPPINGFORM_H #include "printMulticopyDocument.h" #include "ui_printShippingForm.h" class printShippingForm : public printMulticopyDocument, public Ui::printShippingForm { Q_OBJECT public: printShippingForm(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = 0); ~printShippingForm(); Q_INVOKABLE virtual void clear(); Q_INVOKABLE virtual ParameterList getParamsDocList(); Q_INVOKABLE virtual ParameterList getParamsOneCopy(const int row, XSqlQuery *qry); Q_INVOKABLE virtual bool isOkToPrint(); Q_INVOKABLE virtual void populate(); public slots: virtual void sHandleShipment(); virtual void sHandleOrder(); virtual void sHandleTo(); virtual void sHandleSo(); protected slots: virtual void languageChange(); protected: virtual void depopulate(); }; #endif // PRINTSHIPPINGFORM_H qt-client-4.1.0/guiclient/printShippingForm.ui000066400000000000000000000135661217451700100214310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printShippingForm 0 0 349 235 Print Shipping Form Order#: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Shipment#: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Ship To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 Qt::Vertical QSizePolicy::Preferred 20 13 Shipping &Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shippingForm 0 0 XComboBox::ShippingForms Shipping Charges: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipchrg true 0 0 true XComboBox::ShippingCharges OrderCluster QWidget

    ordercluster.h
    ShipmentCluster QWidget
    shipmentcluster.h
    XComboBox QComboBox
    xcombobox.h
    _shipment _shippingForm _shipchrg qt-client-4.1.0/guiclient/printShippingForms.cpp000066400000000000000000000074471217451700100217620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printShippingForms.h" #include "guiErrorCheck.h" printShippingForms::printShippingForms(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printMulticopyDocument("ShippingFormCopies", "ShippingFormWatermark", "ShippingFormShowPrices", "", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); setDoctype("P"); setReportKey("shiphead_id"); _distributeInventory = false; if (_preferences->boolean("XCheckBox/forgetful")) { _printNew->setChecked(true); _printDirty->setChecked(true); } // TODO: tohead? _docinfoQueryString = "SELECT shiphead_id AS docid," " shiphead_number AS docnumber," " (shiphead_sfstatus = 'P') AS printed," " NULL AS posted," " shipform_report_name AS reportname," " shiphead_id, shiphead_shipchrg_id" " FROM shiphead" " JOIN cohead ON (shiphead_order_id=cohead_id" " AND shiphead_order_type='SO')" " JOIN shipform ON (shipform_id=COALESCE(shiphead_shipform_id," " cohead_shipform_id))" " WHERE NOT shiphead_shipped" "" " AND (shiphead_sfstatus IN (" " " " , " " " " " " ))" "" " ORDER BY shiphead_id;" ; _markOnePrintedQry = "UPDATE shiphead" " SET shiphead_sfstatus='P'" " WHERE (shiphead_id=);" ; } printShippingForms::~printShippingForms() { // no need to delete child widgets, Qt does it all for us } void printShippingForms::languageChange() { retranslateUi(this); } ParameterList printShippingForms::getParamsDocList() { ParameterList params = printMulticopyDocument::getParamsDocList(); QList printFlags; if (_printNew->isChecked()) printFlags << "N"; if (_printDirty->isChecked()) printFlags << "D"; if (printFlags.size() > 0) params.append("printFlags", printFlags); return params; } ParameterList printShippingForms::getParamsOneCopy(const int row, XSqlQuery *qry) { ParameterList params = printMulticopyDocument::getParamsOneCopy(row, qry); params.append("shiphead_id", qry->value("shiphead_id")); params.append("shipchrg_id", qry->value("shiphead_shipchrg_id")); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (copies()->showCosts(row)) params.append("showcosts"); return params; } bool printShippingForms::isOkToPrint() { QList errors; errors<< GuiErrorCheck(!_printNew->isChecked() && !_printDirty->isChecked(), _printNew, tr("You must indicate if you wish to print Shipping " "Forms for New and/or Changed Shipments.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Print Shipping Forms"), errors)) return false; return true; } qt-client-4.1.0/guiclient/printShippingForms.h000066400000000000000000000021721217451700100214150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTSHIPPINGFORMS_H #define PRINTSHIPPINGFORMS_H #include "printMulticopyDocument.h" #include "ui_printShippingForms.h" class printShippingForms : public printMulticopyDocument, public Ui::printShippingForms { Q_OBJECT public: printShippingForms(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printShippingForms(); public slots: Q_INVOKABLE virtual ParameterList getParamsDocList(); Q_INVOKABLE virtual ParameterList getParamsOneCopy(const int row, XSqlQuery *qry); Q_INVOKABLE virtual bool isOkToPrint(); protected slots: virtual void languageChange(); }; #endif // PRINTSHIPPINGFORMS_H qt-client-4.1.0/guiclient/printShippingForms.ui000066400000000000000000000054321217451700100216050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printShippingForms 0 0 342 86 Print Shipping Forms Print Shipping Forms for new Shipments Qt::Horizontal QSizePolicy::Expanding 46 10 Print Shipping Forms for Changed Shipments Qt::Horizontal QSizePolicy::Expanding 41 10 Qt::Vertical 20 0 XCheckBox QCheckBox
    xcheckbox.h
    _printNew _printDirty
    qt-client-4.1.0/guiclient/printSinglecopyDocument.cpp000066400000000000000000000242101217451700100227700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printSinglecopyDocument.h" #include #include #include #include #include #include "errorReporter.h" class printSinglecopyDocumentPrivate : public Ui::printSinglecopyDocument { public: printSinglecopyDocumentPrivate(::printSinglecopyDocument *parent) : _alert(true), _captive(false), _docid(-1), _parent(parent), _printer(0), _mpIsInitialized(false) { setupUi(_parent); _printer = new QPrinter(QPrinter::HighResolution); _print->setFocus(); } ~printSinglecopyDocumentPrivate() { if (_printer) { delete _printer; _printer = 0; } } bool _alert; bool _captive; int _docid; QString _doctype; QString _doctypefull; ::printSinglecopyDocument *_parent; QPrinter *_printer; bool _mpIsInitialized; QList _printed; QString _reportKey; }; printSinglecopyDocument::printSinglecopyDocument(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { _data = new printSinglecopyDocumentPrivate(this); connect(_data->_print, SIGNAL(clicked()), this, SLOT(sPrint())); // This indirection allows scripts to replace core behavior - 14285 connect(this, SIGNAL(timeToPrintOneDoc(XSqlQuery*)), this, SLOT(sPrintOneDoc(XSqlQuery*))); connect(this, SIGNAL(timeToMarkOnePrinted(XSqlQuery*)), this, SLOT(sMarkOnePrinted(XSqlQuery*))); } printSinglecopyDocument::~printSinglecopyDocument() { if (_data) { delete _data; _data = 0; } } void printSinglecopyDocument::languageChange() { _data->retranslateUi(this); } enum SetResponse printSinglecopyDocument::set(const ParameterList &pParams) { XDialog::set(pParams); _data->_captive = true; QVariant param; bool valid; if (! reportKey().isEmpty()) { param = pParams.value(reportKey(), &valid); if (valid) setId(param.toInt()); } param = pParams.value("docid", &valid); if (valid) setId(param.toInt()); if (pParams.inList("print")) { sPrint(); return NoError_Print; } if (pParams.inList("persistentPrint")) { _data->_alert = FALSE; if (isSetup()) { sPrint(); return NoError_Print; } else return Error_NoSetup; } return NoError; } void printSinglecopyDocument::sAddToPrintedList(XSqlQuery *docq) { QVariant docid = docq->value("docid"); if (! _data->_printed.contains(docid)) _data->_printed.append(docid); } void printSinglecopyDocument::sClearPrintedList() { _data->_printed.clear(); } bool printSinglecopyDocument::sMarkOnePrinted(XSqlQuery *docq) { bool wasMarked = false; if (_markOnePrintedQry.isEmpty()) wasMarked = true; // not really but a reflection of best effort else { ParameterList markp; markp.append("docid", docq->value("docid")); markp.append("docnumber", docq->value("docnumber")); MetaSQLQuery markm(_markOnePrintedQry); XSqlQuery markq = markm.toQuery(markp); if (! ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), markq, __FILE__, __LINE__)) wasMarked = true; if (wasMarked && _data->_alert) emit docUpdated(docq->value("docid").toInt()); } if (wasMarked) sAddToPrintedList(docq); return wasMarked; } void printSinglecopyDocument::sPrint() { if (! isOkToPrint()) return; bool mpStartedInitialized = isSetup(); sClearPrintedList(); MetaSQLQuery docinfom(_docinfoQueryString); ParameterList alldocsp = getParamsDocList(); XSqlQuery docinfoq = docinfom.toQuery(alldocsp); while (docinfoq.next()) { message(tr("Processing %1 #%2") .arg(_data->_doctypefull, docinfoq.value("docnumber").toString())); // This indirection allows scripts to replace core behavior - 14285 emit aboutToStart(&docinfoq); emit timeToPrintOneDoc(&docinfoq); emit timeToMarkOnePrinted(&docinfoq); message(""); } if (! mpStartedInitialized) { orReport::endMultiPrint(_data->_printer); setSetup(false); } if (_data->_printed.size() == 0) QMessageBox::information(this, tr("No Documents to Print"), tr("There aren't any documents to print.")); else if (! _markAllPrintedQry.isEmpty() && QMessageBox::question(this, tr("Mark Documents as Printed?"), tr("

    Did all of the documents print correctly?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { ParameterList allp; allp.append("printedDocs", QVariant(_data->_printed)); MetaSQLQuery markAllPrintedm(_markAllPrintedQry); XSqlQuery markPrintedq = markAllPrintedm.toQuery(allp); ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), markPrintedq, __FILE__, __LINE__); // don't return if (_data->_alert) emit docUpdated(-1); } sClearPrintedList(); emit finishedWithAll(); if (_data->_captive) accept(); else clear(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Print"), docinfoq, __FILE__, __LINE__)) return; } bool printSinglecopyDocument::sPrintOneDoc(XSqlQuery *docq) { QString reportname = docq->value("reportname").toString(); QString docnumber = docq->value("docnumber").toString(); bool printedOk = false; if (! isSetup()) { bool userCanceled = false; if (orReport::beginMultiPrint(_data->_printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return false; } } orReport report(reportname); if (! report.isValid()) QMessageBox::critical(this, tr("Cannot Find Form"), tr("

    Cannot find form '%1' for %2 %3. " "It cannot be printed until the Form " "Assignment is updated to remove references " "to this Form or the Form is created.") .arg(reportname, _data->_doctypefull, docnumber)); else { report.setParamList(getParams(docq)); if (! report.isValid()) { ErrorReporter::error(QtCriticalMsg, this, tr("Invalid Parameters"), tr("

    Report '%1' cannot be run. Parameters " "are missing.").arg(reportname), __FILE__, __LINE__); printedOk = false; } else if (report.print(_data->_printer, ! isSetup())) { setSetup(true); printedOk = true; } else { report.reportError(this); printedOk = false; } } if (printedOk) emit finishedPrinting(docq->value("docid").toInt()); return printedOk; } void printSinglecopyDocument::sPopulate() { ParameterList getp = getParamsDocList(); MetaSQLQuery getm(_docinfoQueryString); XSqlQuery getq = getm.toQuery(getp); if (getq.first()) emit populated(&getq); } void printSinglecopyDocument::clear() { } QString printSinglecopyDocument::doctype() { return _data->_doctype; } ParameterList printSinglecopyDocument::getParamsDocList() { ParameterList params; if (_data->_docid > 0) { params.append(reportKey(), _data->_docid); params.append("docid", _data->_docid); } return params; } ParameterList printSinglecopyDocument::getParams(XSqlQuery *docq) { ParameterList params; if (! reportKey().isEmpty() && docq) { QVariant docid = docq->record().contains("docid") ? docq->value("docid") : docq->value(reportKey()); params.append(reportKey(), docid); params.append("docid", docid); } return params; } int printSinglecopyDocument::id() { return _data->_docid; } bool printSinglecopyDocument::isOkToPrint() { return true; } bool printSinglecopyDocument::isOnPrintedList(const int docid) { return _data->_printed.contains(docid); } bool printSinglecopyDocument::isSetup() { return _data->_mpIsInitialized; } QWidget *printSinglecopyDocument::optionsWidget() { return _data->_optionsFrame; } QString printSinglecopyDocument::reportKey() { return _data->_reportKey; } void printSinglecopyDocument::setDoctype(QString doctype) { _data->_doctype = doctype; if (doctype == "AR") _data->_doctypefull = tr("A/R Statement"); else if (doctype == "CM") _data->_doctypefull = tr("Credit Memo"); else if (doctype == "IN") _data->_doctypefull = tr("Invoice"); else if (doctype == "L") _data->_doctypefull = tr("Pick List"); else if (doctype == "P") _data->_doctypefull = tr("Packing List"); else if (doctype == "PO") _data->_doctypefull = tr("Purchase Order"); else if (doctype == "QT") _data->_doctypefull = tr("Quote"); else if (doctype == "SO") _data->_doctypefull = tr("Sales Order"); else qWarning("printSinglecopyDocument could not figure out doctypefull for %s", qPrintable(doctype)); } void printSinglecopyDocument::setId(int docid) { if (_data->_docid != docid) { _data->_docid = docid; sPopulate(); emit newId(_data->_docid); } } void printSinglecopyDocument::setPrintEnabled(bool enabled) { _data->_print->setEnabled(enabled); } void printSinglecopyDocument::setReportKey(QString key) { _data->_reportKey = key; } void printSinglecopyDocument::setSetup(bool pSetup) { _data->_mpIsInitialized = pSetup; } qt-client-4.1.0/guiclient/printSinglecopyDocument.h000066400000000000000000000055371217451700100224500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTSINGLECOPYDOCUMENT_H #define PRINTSINGLECOPYDOCUMENT_H #include "ui_printSinglecopyDocument.h" #include #include "guiclient.h" #include "xdialog.h" class XDocCopySetter; class printSinglecopyDocumentPrivate; class printSinglecopyDocument : public XDialog { Q_OBJECT friend class printSinglecopyDocumentPrivate; Q_PROPERTY(QString doctype READ doctype WRITE setDoctype) Q_PROPERTY(QString reportKey READ reportKey WRITE setReportKey) public: printSinglecopyDocument(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~printSinglecopyDocument(); Q_INVOKABLE virtual void clear(); virtual QString doctype(); Q_INVOKABLE virtual ParameterList getParams(XSqlQuery *docq); Q_INVOKABLE virtual ParameterList getParamsDocList(); Q_INVOKABLE virtual int id(); Q_INVOKABLE virtual bool isOkToPrint(); Q_INVOKABLE virtual bool isOnPrintedList(const int docid); Q_INVOKABLE virtual bool isSetup(); Q_INVOKABLE virtual QWidget *optionsWidget(); virtual QString reportKey(); virtual void setReportKey(QString key); Q_INVOKABLE virtual void setSetup(bool setup); public slots: virtual enum SetResponse set(const ParameterList &pParams); virtual void sAddToPrintedList(XSqlQuery *docq); virtual void sClearPrintedList(); virtual bool sMarkOnePrinted(XSqlQuery *docq); virtual void sPopulate(); virtual void sPrint(); virtual bool sPrintOneDoc(XSqlQuery *docq); virtual void setDoctype(QString doctype); virtual void setId(int docid); virtual void setPrintEnabled(bool enabled); signals: void docUpdated(int); void aboutToStart(XSqlQuery *qry); void finishedPrinting(int); void finishedWithAll(); void newId(int id); void populated(XSqlQuery *docq); void timeToMarkOnePrinted(XSqlQuery *docq); void timeToPrintOneDoc(XSqlQuery *docq); protected slots: virtual void languageChange(); protected: printSinglecopyDocumentPrivate *_data; QString _docinfoQueryString; QString _markAllPrintedQry; QString _markOnePrintedQry; }; #endif // PRINTSINGLECOPYDOCUMENT_H qt-client-4.1.0/guiclient/printSinglecopyDocument.ui000066400000000000000000000050561217451700100226320ustar00rootroot00000000000000 printSinglecopyDocument 0 0 151 97 Print One Copy of Document Cancel false Print Qt::Vertical 20 40 QFrame::NoFrame QFrame::Plain Qt::Horizontal 40 20 Qt::Vertical 20 0 _cancel clicked() printSinglecopyDocument reject() 98 27 75 48 qt-client-4.1.0/guiclient/printSoForm.cpp000066400000000000000000000075571217451700100204010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printSoForm.h" #include #include "errorReporter.h" printSoForm::printSoForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printSinglecopyDocument(parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); _so->setAllowedTypes(OrderLineEdit::Sales); setDoctype("SO"); setReportKey("sohead_id"); _docinfoQueryString = "SELECT cohead_id AS docid, cohead_id," " cohead_number AS docnumber," " false AS printed," "" " (SELECT form_report_name" " FROM form" " WHERE ((form_name=)" " AND (form_key='SO')))" "" " COALESCE((SELECT MIN(form_report_name)" " FROM form WHERE (form_key='SO'))," " 'SalesOrderAcknowledgement')" " AS reportname" " FROM cohead" " WHERE (cohead_id=);" ; _report->populate( "SELECT form_id, form_name " "FROM form " "WHERE (form_key='SO') " "ORDER BY form_name;" ); connect(_so, SIGNAL(newId(int, QString)), this, SLOT(sHandleNewOrderId())); connect(_report, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); connect(this, SIGNAL(finishedWithAll()), this, SLOT(sFinishedWithAll())); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sPopulate(XSqlQuery*))); } printSoForm::~printSoForm() { // no need to delete child widgets, Qt does it all for us } void printSoForm::languageChange() { retranslateUi(this); } enum SetResponse printSoForm::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("cohead_id", &valid); if (valid) setId(param.toInt()); return printSinglecopyDocument::set(pParams); } ParameterList printSoForm::getParams(XSqlQuery *docq) { ParameterList params = printSinglecopyDocument::getParams(docq); params.append("includeFormatted", true); params.append("excludeCancelled", true); params.append("reportname", _report->code()); return params; } ParameterList printSoForm::getParamsDocList() { ParameterList params = printSinglecopyDocument::getParamsDocList(); if (_report->isValid()) params.append("reportname", _report->code()); return params; } void printSoForm::sFinishedWithAll() { _so->setId(-1); } void printSoForm::sHandleButtons() { setPrintEnabled(_so->isValid() && _report->isValid()); } void printSoForm::sHandleNewOrderId() { setId(_so->id()); if (_so->isValid()) { ParameterList params; params.append("docid", _so->id()); MetaSQLQuery mql(_docinfoQueryString); XSqlQuery qry = mql.toQuery(params); if (qry.first()) _report->setCode(qry.value("reportname").toString()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Sales Order Form"), qry, __FILE__, __LINE__)) return; } sHandleButtons(); } void printSoForm::sPopulate(XSqlQuery *docq) { if (docq) _so->setId(docq->value("docid").toInt()); } qt-client-4.1.0/guiclient/printSoForm.h000066400000000000000000000023571217451700100200370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTSOFORM_H #define PRINTSOFORM_H #include "printSinglecopyDocument.h" #include "ui_printSoForm.h" #include "guiclient.h" class printSoForm : public printSinglecopyDocument, public Ui::printSoForm { Q_OBJECT public: printSoForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printSoForm(); Q_INVOKABLE virtual ParameterList getParams(XSqlQuery *docq); Q_INVOKABLE virtual ParameterList getParamsDocList(); public slots: virtual enum SetResponse set( const ParameterList & pParams); virtual void sFinishedWithAll(); virtual void sHandleButtons(); virtual void sHandleNewOrderId(); virtual void sPopulate(XSqlQuery *docq); protected slots: virtual void languageChange(); }; #endif // PRINTSOFORM_H qt-client-4.1.0/guiclient/printSoForm.ui000066400000000000000000000041551217451700100202230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printSoForm 0 0 291 99 Print Sales Order Form Sales Order #: false Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 OrderCluster QWidget

    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    _report qt-client-4.1.0/guiclient/printStatementByCustomer.cpp000066400000000000000000000073771217451700100231550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printStatementByCustomer.h" #include #include #include #include "errorReporter.h" printStatementByCustomer::printStatementByCustomer(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printSinglecopyDocument(parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); _asOf->setDate(omfgThis->dbDate(), true); _cust->setType(CLineEdit::ActiveCustomers); setDoctype("AR"); setReportKey("cust_id"); _docinfoQueryString = "SELECT cust_id AS docid, cust_id," " cust_number AS docnumber," " false AS printed," " findCustomerForm(cust_id, 'S') AS reportname" " FROM custinfo" " WHERE (cust_id=);" ; connect(_cust, SIGNAL(valid(bool)), this, SLOT(setPrintEnabled(bool))); connect(_cust, SIGNAL(newId(int)), this, SLOT(setId(int))); connect(this, SIGNAL(populated(XSqlQuery*)), this, SLOT(sPopulate(XSqlQuery*))); } printStatementByCustomer::~printStatementByCustomer() { // no need to delete child widgets, Qt does it all for us } void printStatementByCustomer::languageChange() { retranslateUi(this); } enum SetResponse printStatementByCustomer::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("asofDate", &valid); if (valid) _asOf->setDate(param.toDate()); return printSinglecopyDocument::set(pParams); // this does XDialog::set() } void printStatementByCustomer::clear() { setId(-1); _cust->setId(-1); _cust->setFocus(); } ParameterList printStatementByCustomer::getParams(XSqlQuery *docq) { return getParams(); } ParameterList printStatementByCustomer::getParams() { ParameterList params; params.append("docid", _cust->id()); params.append("cust_id", _cust->id()); params.append("invoice", tr("Invoice")); params.append("debit", tr("Debit Memo")); params.append("credit", tr("Credit Memo")); params.append("deposit", tr("Deposit")); params.append("asofdate", _asOf->date()); return params; } bool printStatementByCustomer::isOkToPrint() { if (!_cust->isValid()) { QMessageBox::warning(this, tr("Enter a Valid Customer Number"), tr("

    You must enter a valid Customer Number for " "this Statement.") ); _cust->setFocus(); return false; } ParameterList params = getParams(); if (params.value("checkParamsReturn") == false) return false; MetaSQLQuery agem("SELECT * FROM araging (, true)" " WHERE (araging_cust_id = );"); XSqlQuery ageq = agem.toQuery(params); if (ageq.first()) ; // fall through - cust is OK else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), ageq, __FILE__, __LINE__)) return false; else { QMessageBox::warning(this, tr("No Statement to Print"), tr("

    No statement is available for the specified " "Customer and Asof Date.") ); return false; } return true; } void printStatementByCustomer::sPopulate(XSqlQuery *docq) { _cust->setId(docq->value("docid").toInt()); } qt-client-4.1.0/guiclient/printStatementByCustomer.h000066400000000000000000000024741217451700100226130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTSTATEMENTBYCUSTOMER_H #define PRINTSTATEMENTBYCUSTOMER_H #include "printSinglecopyDocument.h" #include "ui_printStatementByCustomer.h" class printStatementByCustomer : public printSinglecopyDocument, public Ui::printStatementByCustomer { Q_OBJECT public: printStatementByCustomer(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printStatementByCustomer(); Q_INVOKABLE virtual void clear(); Q_INVOKABLE virtual ParameterList getParams(XSqlQuery *docq); Q_INVOKABLE virtual ParameterList getParams(); Q_INVOKABLE virtual bool isOkToPrint(); public slots: virtual enum SetResponse set(const ParameterList &pParams); virtual void sPopulate(XSqlQuery *docq); protected slots: virtual void languageChange(); }; #endif // PRINTSTATEMENTBYCUSTOMER_H qt-client-4.1.0/guiclient/printStatementByCustomer.ui000066400000000000000000000044431217451700100227770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printStatementByCustomer 0 0 267 140 Print Statement by Customer As of : Qt::Vertical 20 40 CustCluster QWidget

    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    _cust parameter.h qt-client-4.1.0/guiclient/printStatementsByCustomerType.cpp000066400000000000000000000046261217451700100241740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printStatementsByCustomerType.h" #include #include "mqlutil.h" #include "errorReporter.h" printStatementsByCustomerType::printStatementsByCustomerType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : printSinglecopyDocument(parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); _asOf->setDate(omfgThis->dbDate(), true); _customerTypes->setType(ParameterGroup::CustomerType); if (_preferences->boolean("XCheckBox/forgetful")) _dueonly->setChecked(true); setPrintEnabled(true); setDoctype("AR"); setReportKey("cust_id"); bool ok = false; QString msg; MetaSQLQuery custm = MQLUtil::mqlLoad("customers", "statement", msg, &ok); if (ok) _docinfoQueryString = custm.getSource(); else ErrorReporter::error(QtCriticalMsg, this, tr("Getting Customers to Print"), msg, __FILE__, __LINE__); } printStatementsByCustomerType::~printStatementsByCustomerType() { // no need to delete child widgets, Qt does it all for us } void printStatementsByCustomerType::languageChange() { retranslateUi(this); } ParameterList printStatementsByCustomerType::getParams(XSqlQuery *docq) { ParameterList params = printSinglecopyDocument::getParams(docq); params.append("invoice", tr("Invoice")); params.append("debit", tr("Debit Memo")); params.append("credit", tr("Credit Memo")); params.append("deposit", tr("Deposit")); params.append("cust_id", docq->value("cust_id").toInt()); params.append("asofdate", _asOf->date()); return params; } ParameterList printStatementsByCustomerType::getParamsDocList() { ParameterList params = printSinglecopyDocument::getParamsDocList(); _customerTypes->appendValue(params); if (_graceDays->value() > 0) params.append("graceDays", _graceDays->value()); if (_dueonly->isChecked()) params.append("graceDays", _graceDays->value()); params.append("asofDate", _asOf->date()); return params; } qt-client-4.1.0/guiclient/printStatementsByCustomerType.h000066400000000000000000000022161217451700100236320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTSTATEMENTSBYCUSTOMERTYPE_H #define PRINTSTATEMENTSBYCUSTOMERTYPE_H #include "printSinglecopyDocument.h" #include "ui_printStatementsByCustomerType.h" class printStatementsByCustomerType : public printSinglecopyDocument, public Ui::printStatementsByCustomerType { Q_OBJECT public: printStatementsByCustomerType(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~printStatementsByCustomerType(); Q_INVOKABLE virtual ParameterList getParams(XSqlQuery *docq); Q_INVOKABLE virtual ParameterList getParamsDocList(); protected slots: virtual void languageChange(); }; #endif // PRINTSTATEMENTSBYCUSTOMERTYPE_H qt-client-4.1.0/guiclient/printStatementsByCustomerType.ui000066400000000000000000000077021217451700100240250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printStatementsByCustomerType 0 0 502 230 Print Statements by Customer Type false As of : Qt::Horizontal 40 20 Grace Period: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 990 &Only Print Customers with Past Due Amounts Qt::Horizontal 66 11 Qt::Vertical 20 0 DLineEdit QWidget
    datecluster.h
    1
    ParameterGroup QGroupBox
    parametergroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _dueonly toggled(bool) _graceDays setEnabled(bool) 355 121 104 121
    qt-client-4.1.0/guiclient/printVendorForm.cpp000066400000000000000000000041451217451700100212430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printVendorForm.h" #include #include #include #include #include "guiclient.h" printVendorForm::printVendorForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_vendor, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool))); _report->populate( "SELECT form_id, form_name " "FROM form " "WHERE (form_key='Vend') " "ORDER BY form_name;" ); } printVendorForm::~printVendorForm() { // no need to delete child widgets, Qt does it all for us } void printVendorForm::languageChange() { retranslateUi(this); } void printVendorForm::sPrint() { XSqlQuery printPrint; printPrint.prepare( "SELECT form_report_name AS report_name " " FROM form " " WHERE((form_id=:form_id));"); printPrint.bindValue(":form_id", _report->id()); printPrint.exec(); if (printPrint.first()) { ParameterList params; params.append("vend_id", _vendor->id()); orReport report(printPrint.value("report_name").toString(), params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } _vendor->setId(-1); _vendor->setFocus(); } else QMessageBox::warning( this, tr("Could not locate report"), tr("Could not locate the report definition the form \"%1\"") .arg(_report->currentText()) ); } qt-client-4.1.0/guiclient/printVendorForm.h000066400000000000000000000016011217451700100207020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTVENDORFORM_H #define PRINTVENDORFORM_H #include "xdialog.h" #include "ui_printVendorForm.h" class printVendorForm : public XDialog, public Ui::printVendorForm { Q_OBJECT public: printVendorForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printVendorForm(); public slots: virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // PRINTVENDORFORM_H qt-client-4.1.0/guiclient/printVendorForm.ui000066400000000000000000000127351217451700100211020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printVendorForm 0 0 414 113 Print Vendor Form 7 5 0 5 Vendor: 5 Report Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Vertical QSizePolicy::Expanding 20 16 0 Qt::Horizontal QSizePolicy::Expanding 16 20 5 Cancel false &Print true Qt::Vertical QSizePolicy::Expanding 20 20 VendorCluster QWidget
    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    _vendor _report _print _close _close clicked() printVendorForm reject() 20 20 20 20 _vendor valid(bool) _print setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/printWoForm.cpp000066400000000000000000000043601217451700100203720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printWoForm.h" #include #include #include #include #include "guiclient.h" #include "inputManager.h" printWoForm::printWoForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_wo, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _wo->setType(cWoOpen | cWoExploded | cWoReleased | cWoIssued | cWoClosed); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _report->populate( "SELECT form_id, form_name " "FROM form " "WHERE (form_key='WO') " "ORDER BY form_name;" ); } printWoForm::~printWoForm() { // no need to delete child widgets, Qt does it all for us } void printWoForm::languageChange() { retranslateUi(this); } void printWoForm::sPrint() { XSqlQuery printPrint; printPrint.prepare( "SELECT form_report_name AS report_name " " FROM form " " WHERE ( (form_id=:form_id) );"); printPrint.bindValue(":form_id", _report->id()); printPrint.exec(); if (printPrint.first()) { ParameterList params; params.append("wo_id", _wo->id()); orReport report(printPrint.value("report_name").toString(), params); if (report.isValid()) report.print(); else { report.reportError(this); reject(); } _wo->setId(-1); _wo->setFocus(); } else QMessageBox::warning( this, tr("Could not locate report"), tr("Could not locate the report definition the form \"%1\"") .arg(_report->currentText()) ); } qt-client-4.1.0/guiclient/printWoForm.h000066400000000000000000000015411217451700100200350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTWOFORM_H #define PRINTWOFORM_H #include "xdialog.h" #include "ui_printWoForm.h" class printWoForm : public XDialog, public Ui::printWoForm { Q_OBJECT public: printWoForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printWoForm(); public slots: virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // PRINTWOFORM_H qt-client-4.1.0/guiclient/printWoForm.ui000066400000000000000000000150741217451700100202310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printWoForm 0 0 416 163 Print Work Order Form 5 7 0 0 0 5 0 5 Form Name: Qt::AlignVCenter|Qt::AlignRight 7 0 0 0 20 20 Expanding Vertical 0 0 0 20 Preferred Horizontal 0 5 Cancel false &Print true 20 20 Expanding Vertical XComboBox QComboBox
    xcombobox.h
    0
    _wo _report _print _close _wo valid(bool) _print setEnabled(bool) _close clicked() printWoForm reject()
    qt-client-4.1.0/guiclient/printWoPickList.cpp000066400000000000000000000041661217451700100212150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printWoPickList.h" #include #include #include printWoPickList::printWoPickList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_wo, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _captive = FALSE; _wo->setType(cWoExploded | cWoReleased | cWoIssued); connect(_close, SIGNAL(clicked()), this, SLOT(close())); } printWoPickList::~printWoPickList() { // no need to delete child widgets, Qt does it all for us } void printWoPickList::languageChange() { retranslateUi(this); } enum SetResponse printWoPickList::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } if (pParams.inList("print")) { sPrint(); return NoError_Print; } return NoError; } void printWoPickList::sPrint() { QPrinter printer(QPrinter::HighResolution); ParameterList params; params.append("wo_id", _wo->id()); orReport report("PickList", params); bool userCanceled = false; if (orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return; } if (report.isValid()) { for (int counter = 0; counter < _copies->value(); counter++) if (!report.print(&printer, (counter == 0))) { report.reportError(this); break; } } orReport::endMultiPrint(&printer); } qt-client-4.1.0/guiclient/printWoPickList.h000066400000000000000000000020161217451700100206520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTWOPICKLIST_H #define PRINTWOPICKLIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_printWoPickList.h" class printWoPickList : public XDialog, public Ui::printWoPickList { Q_OBJECT public: printWoPickList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printWoPickList(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPrint(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // PRINTWOPICKLIST_H qt-client-4.1.0/guiclient/printWoPickList.ui000066400000000000000000000167461217451700100210570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printWoPickList 0 0 434 185 Print W/O Pick List 5 7 0 0 0 5 0 0 0 5 Co&pies: Qt::AlignVCenter|Qt::AlignRight _copies 1 20 20 Expanding Horizontal 20 20 Expanding Vertical 0 0 20 20 Preferred Horizontal 0 0 0 5 &Cancel false &Print 20 20 Expanding Vertical _wo _copies _print _close parameter.h _wo valid(bool) _print setEnabled(bool) qt-client-4.1.0/guiclient/printWoTraveler.cpp000066400000000000000000000172601217451700100212560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "printWoTraveler.h" #include #include #include #include #include "inputManager.h" #include "storedProcErrorLookup.h" #define DEBUG false printWoTraveler::printWoTraveler(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_packingList,SIGNAL(toggled(bool)), this, SLOT(sHandlePrintButton())); connect(_pickList, SIGNAL(toggled(bool)), this, SLOT(sHandlePrintButton())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_wo, SIGNAL(newId(int)), this, SLOT(sHandleOptions(int))); connect(_wo, SIGNAL(valid(bool)), this, SLOT(sHandlePrintButton())); connect(_woLabel, SIGNAL(toggled(bool)), this, SLOT(sHandlePrintButton())); _captive = FALSE; omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _wo->setType(cWoExploded | cWoReleased | cWoIssued); if (!_privileges->check("ReleaseWorkOrders")) _releaseWo->setEnabled(FALSE); _errorPrinting = false; } printWoTraveler::~printWoTraveler() { // no need to delete child widgets, Qt does it all for us } void printWoTraveler::languageChange() { retranslateUi(this); } enum SetResponse printWoTraveler::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _releaseWo->setFocus(); } if (pParams.inList("print")) { sPrint(); return NoError_Print; } return NoError; } void printWoTraveler::sHandleOptions(int pWoid) { if (pWoid != -1) { XSqlQuery check; check.prepare( "SELECT womatl_id " "FROM womatl " "WHERE (womatl_wo_id=:wo_id) " "LIMIT 1;" ); check.bindValue(":wo_id", pWoid); check.exec(); if (check.lastError().type() != QSqlError::NoError) { systemError(this, check.lastError().databaseText(), __FILE__, __LINE__); return; } if (check.first()) { _pickList->setEnabled(true); _pickList->setForgetful(false); _pickList->setObjectName("_pickList"); } else { _pickList->setEnabled(false); _pickList->setForgetful(true); _pickList->setChecked(false); } check.prepare( "SELECT wo_id " "FROM wo " "WHERE ( (wo_ordtype='S')" " AND (wo_id=:wo_id) );" ); check.bindValue(":wo_id", pWoid); check.exec(); if (check.lastError().type() != QSqlError::NoError) { systemError(this, check.lastError().databaseText(), __FILE__, __LINE__); return; } if (check.first()) { _packingList->setEnabled(true); _packingList->setForgetful(false); _packingList->setObjectName("_packingList"); } else { _packingList->setEnabled(false); _packingList->setForgetful(true); _packingList->setChecked(false); } } } void printWoTraveler::sPrint() { if (DEBUG) qDebug("printWoTraveler::sPrint() entered"); QPrinter printer(QPrinter::HighResolution); bool setupPrinter = TRUE; bool userCanceled = false; _errorPrinting = false; if (orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return; } if (DEBUG) qDebug("printWoTraveler::sPrint() multiprint started"); if (_pickList->isChecked()) { ParameterList params; params.append("wo_id", _wo->id()); orReport report("PickList", params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); _errorPrinting = true; } } if (DEBUG) qDebug("printWoTraveler::sPrint() PickList handled"); if (_woLabel->isChecked() && ! _errorPrinting) { XSqlQuery query; query.prepare( "SELECT wo_id, CAST(wo_qtyord AS INTEGER) AS wo_qtyord_int " "FROM wo " " WHERE (wo_id=:wo_id);" ); query.bindValue(":wo_id", _wo->id()); query.exec(); if (query.first()) { ParameterList params; params.append("wo_id", query.value("wo_id")); params.append("labelTo", query.value("wo_qtyord_int")); orReport report("WOLabel", params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); _errorPrinting = true; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); _errorPrinting = true; } } if (DEBUG) qDebug("printWoTraveler::sPrint() WOLabel handled"); if (_packingList->isChecked() && ! _errorPrinting) { XSqlQuery query; query.prepare( "SELECT cohead_id, findCustomerForm(cohead_cust_id, 'L') AS reportname " "FROM cohead, coitem, wo " "WHERE ( (coitem_cohead_id=cohead_id)" " AND (wo_ordid=coitem_id)" " AND (wo_ordtype='S')" " AND (wo_id=:wo_id) );" ); query.bindValue(":wo_id", _wo->id()); query.exec(); if (query.first()) { ParameterList params; params.append("sohead_id", query.value("cohead_id")); params.append("head_id", query.value("cohead_id")); params.append("head_type", "SO"); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); orReport report(query.value("reportname").toString(), params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); _errorPrinting = true; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); _errorPrinting = true; } } if (DEBUG) qDebug("printWoTraveler::sPrint() PackingList handled"); if (! _errorPrinting) { emit finishedPrinting(&printer); } if (DEBUG) qDebug("printWoTraveler::sPrint() finishedPrinting handled"); orReport::endMultiPrint(&printer); if (_errorPrinting) return; if (_releaseWo->isChecked()) { XSqlQuery release; release.prepare("SELECT releaseWo(:wo_id, FALSE) AS result;"); release.bindValue(":wo_id", _wo->id()); release.exec(); if (release.first()) { int result = release.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("releaseWo", result), __FILE__, __LINE__); return; } } else if (release.lastError().type() != QSqlError::NoError) { systemError(this, release.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); } if (_captive) close(); else { _errorPrinting = false; _wo->setId(-1); _wo->setFocus(); } } void printWoTraveler::sHandlePrintButton() { _print->setEnabled( _wo->isValid() && (_pickList->isChecked() || _packingList->isChecked() || _woLabel->isChecked()) ); } qt-client-4.1.0/guiclient/printWoTraveler.h000066400000000000000000000025221217451700100207160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRINTWOTRAVELER_H #define PRINTWOTRAVELER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_printWoTraveler.h" class printWoTraveler : public XDialog, public Ui::printWoTraveler { Q_OBJECT public: printWoTraveler(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~printWoTraveler(); Q_INVOKABLE virtual bool errorPrinting() const { return _errorPrinting; } Q_INVOKABLE virtual void setErrorPrinting(bool p) { _errorPrinting = p; } public slots: virtual enum SetResponse set(const ParameterList &pParams); virtual void sHandleOptions( int pWoid ); virtual void sPrint(); virtual void sHandlePrintButton(); signals: void finishedPrinting(QPrinter *printer); protected slots: virtual void languageChange(); private: bool _captive; bool _errorPrinting; }; #endif // PRINTWOTRAVELER_H qt-client-4.1.0/guiclient/printWoTraveler.ui000066400000000000000000000150041217451700100211030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. printWoTraveler 0 0 444 324 0 0 Print W/O Traveler 0 5 0 0 290 130 Qt::Horizontal QSizePolicy::Expanding 20 20 &Cancel false &Print true Qt::Vertical 20 20 Release &Work Order Qt::Horizontal QSizePolicy::Expanding 20 20 Documents: Print P&ick List Print Packing List Print Work Order Label Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 WoCluster QWidget
    wocluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _wo _releaseWo _pickList _packingList _woLabel _print _close _close clicked() printWoTraveler reject() 20 20 20 20
    qt-client-4.1.0/guiclient/productCategories.cpp000066400000000000000000000117051217451700100215730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "productCategories.h" #include #include #include #include #include #include #include "productCategory.h" productCategories::productCategories(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_prodcat, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_deleteUnused, SIGNAL(clicked()), this, SLOT(sDeleteUnused())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_prodcat, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); _prodcat->addColumn(tr("Category"), 70, Qt::AlignLeft, true, "prodcat_code" ); _prodcat->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "prodcat_descrip" ); if (_privileges->check("MaintainProductCategories")) { connect(_prodcat, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_prodcat, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_prodcat, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_prodcat, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); _deleteUnused->setEnabled(FALSE); } sFillList(-1); } productCategories::~productCategories() { // no need to delete child widgets, Qt does it all for us } void productCategories::languageChange() { retranslateUi(this); } void productCategories::sDelete() { XSqlQuery productDelete; productDelete.prepare("SELECT deleteProductCategory(:prodcat_id) AS result;"); productDelete.bindValue(":prodcat_id", _prodcat->id()); productDelete.exec(); if (productDelete.first()) { switch (productDelete.value("result").toInt()) { case -1: QMessageBox::warning( this, tr("Cannot Delete Product Category"), tr( "You cannot delete the selected Product Category because there are currently items assigned to it.\n" "You must first re-assign these items before deleting the selected Product Category." ) ); return; } sFillList(-1); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } void productCategories::sNew() { ParameterList params; params.append("mode", "new"); productCategory newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void productCategories::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("prodcat_id", _prodcat->id()); productCategory newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void productCategories::sView() { ParameterList params; params.append("mode", "view"); params.append("prodcat_id", _prodcat->id()); productCategory newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void productCategories::sPopulateMenu( QMenu * menu ) { QAction *menuItem; menuItem = menu->addAction("Edit Product Cateogry...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainProductCategories")); menuItem = menu->addAction("Delete Product Category...", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainProductCategories")); } void productCategories::sPrint() { orReport report("ProductCategoriesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void productCategories::sDeleteUnused() { XSqlQuery productDeleteUnused; if ( QMessageBox::warning( this, tr("Delete Unused Product Categories"), tr("Are you sure that you wish to delete all unused Product Categories?"), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 0 ) { productDeleteUnused.exec("SELECT deleteUnusedProductCategories() AS result;"); sFillList(-1); } } void productCategories::sFillList(int pId) { _prodcat->populate( "SELECT prodcat_id, prodcat_code, prodcat_descrip " "FROM prodcat " "ORDER BY prodcat_code;", pId ); } qt-client-4.1.0/guiclient/productCategories.h000066400000000000000000000021751217451700100212410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRODUCTCATEGORIES_H #define PRODUCTCATEGORIES_H #include "guiclient.h" #include "xwidget.h" #include "ui_productCategories.h" class productCategories : public XWidget, public Ui::productCategories { Q_OBJECT public: productCategories(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~productCategories(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(int pId); virtual void sPopulateMenu( QMenu * menu ); virtual void sPrint(); virtual void sDeleteUnused(); protected slots: virtual void languageChange(); }; #endif // PRODUCTCATEGORIES_H qt-client-4.1.0/guiclient/productCategories.ui000066400000000000000000000134241217451700100214260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. productCategories 0 0 600 400 List Product Categories 0 0 0 0 20 Product Categories: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Preferred 20 5 Delete &Unused Qt::Vertical QSizePolicy::Expanding 20 0 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _prodcat _new _edit _view _delete _deleteUnused _print _close _close clicked() productCategories close() 20 20 20 20 _prodcat valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/productCategory.cpp000066400000000000000000000127421217451700100212650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "productCategory.h" #include #include productCategory::productCategory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_category, SIGNAL(editingFinished()), this, SLOT(sCheck())); } productCategory::~productCategory() { // no need to delete child widgets, Qt does it all for us } void productCategory::languageChange() { retranslateUi(this); } enum SetResponse productCategory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("prodcat_id", &valid); if (valid) { _prodcatid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _category->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void productCategory::sCheck() { XSqlQuery productCheck; _category->setText(_category->text().trimmed()); if ( (_mode == cNew) && (_category->text().length()) ) { productCheck.prepare( "SELECT prodcat_id " "FROM prodcat " "WHERE (UPPER(prodcat_code)=UPPER(:prodcat_code));" ); productCheck.bindValue(":prodcat_code", _category->text()); productCheck.exec(); if (productCheck.first()) { _prodcatid = productCheck.value("prodcat_id").toInt(); _mode = cEdit; populate(); _category->setEnabled(FALSE); } } } void productCategory::sSave() { XSqlQuery productSave; if (_category->text().trimmed().isEmpty()) { QMessageBox::critical(this, tr("Missing Category"), tr("You must name this Category before saving it.")); _category->setFocus(); return; } if (_mode == cEdit) { productSave.prepare( "SELECT prodcat_id " "FROM prodcat " "WHERE ( (prodcat_id<>:prodcat_id)" " AND (prodcat_code=:prodcat_code) );"); productSave.bindValue(":prodcat_id", _prodcatid); productSave.bindValue(":prodcat_code", _category->text()); productSave.exec(); if (productSave.first()) { QMessageBox::critical( this, tr("Cannot Create Product Category"), tr( "A Product Category with the entered code already exists." "You may not create a Product Category with this code." ) ); _category->setFocus(); return; } productSave.prepare( "UPDATE prodcat " "SET prodcat_code=:prodcat_code, prodcat_descrip=:prodcat_descrip " "WHERE (prodcat_id=:prodcat_id);" ); productSave.bindValue(":prodcat_id", _prodcatid); productSave.bindValue(":prodcat_code", _category->text().toUpper()); productSave.bindValue(":prodcat_descrip", _description->text()); productSave.exec(); } else if (_mode == cNew) { productSave.prepare( "SELECT prodcat_id " "FROM prodcat " "WHERE (prodcat_code=:prodcat_code);"); productSave.bindValue(":prodcat_code", _category->text().trimmed()); productSave.exec(); if (productSave.first()) { QMessageBox::critical( this, tr("Cannot Create Product Category"), tr( "A Product Category with the entered code already exists.\n" "You may not create a Product Category with this code." ) ); _category->setFocus(); return; } productSave.exec("SELECT NEXTVAL('prodcat_prodcat_id_seq') AS prodcat_id;"); if (productSave.first()) _prodcatid = productSave.value("prodcat_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } productSave.prepare( "INSERT INTO prodcat " "( prodcat_id, prodcat_code, prodcat_descrip ) " "VALUES " "( :prodcat_id, :prodcat_code, :prodcat_descrip );" ); productSave.bindValue(":prodcat_id", _prodcatid); productSave.bindValue(":prodcat_code", _category->text().toUpper()); productSave.bindValue(":prodcat_descrip", _description->text()); productSave.exec(); } done(_prodcatid); } void productCategory::populate() { XSqlQuery productpopulate; productpopulate.prepare( "SELECT prodcat_code, prodcat_descrip " "FROM prodcat " "WHERE (prodcat_id=:prodcat_id);" ); productpopulate.bindValue(":prodcat_id", _prodcatid); productpopulate.exec(); if (productpopulate.first()) { _category->setText(productpopulate.value("prodcat_code").toString()); _description->setText(productpopulate.value("prodcat_descrip").toString()); } } qt-client-4.1.0/guiclient/productCategory.h000066400000000000000000000021261217451700100207250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PRODUCTCATEGORY_H #define PRODUCTCATEGORY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_productCategory.h" class productCategory : public XDialog, public Ui::productCategory { Q_OBJECT public: productCategory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~productCategory(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _prodcatid; }; #endif // PRODUCTCATEGORY_H qt-client-4.1.0/guiclient/productCategory.ui000066400000000000000000000072661217451700100211250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. productCategory 0 0 400 100 Product Category Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _category _description parameter.h
    qt-client-4.1.0/guiclient/profitCenter.cpp000066400000000000000000000130021217451700100205410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "profitCenter.h" #include #include #include profitCenter::profitCenter(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _number->setMaxLength(_metrics->value("GLProfitSize").toInt()); _cachedNumber = ""; } profitCenter::~profitCenter() { // no need to delete child widgets, Qt does it all for us } void profitCenter::languageChange() { retranslateUi(this); } enum SetResponse profitCenter::set(const ParameterList &pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("prftcntr_id", &valid); if (valid) { _prftcntrid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(false); _descrip->setEnabled(false); _save->setVisible(false); _close->setText(tr("&Close")); } } return NoError; } void profitCenter::sSave() { XSqlQuery profitSave; if (_number->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Profit Center"), tr("You must enter a valid Number.") ); return; } profitSave.prepare("SELECT prftcntr_id" " FROM prftcntr" " WHERE((prftcntr_id != :prftcntr_id)" " AND (prftcntr_number=:prftcntr_number))"); profitSave.bindValue(":prftcntr_id", _prftcntrid); profitSave.bindValue(":prftcntr_number", _number->text()); profitSave.exec(); if(profitSave.first()) { QMessageBox::critical(this, tr("Duplicate Profit Center Number"), tr("A Profit Center Number already exists for the one specified.") ); return; } if (_mode == cNew) { profitSave.exec("SELECT NEXTVAL('prftcntr_prftcntr_id_seq') AS prftcntr_id;"); if (profitSave.first()) _prftcntrid = profitSave.value("prftcntr_id").toInt(); else if (profitSave.lastError().type() != QSqlError::NoError) { systemError(this, profitSave.lastError().databaseText(), __FILE__, __LINE__); return; } profitSave.prepare( "INSERT INTO prftcntr " "( prftcntr_id, prftcntr_number, prftcntr_descrip ) " "VALUES " "( :prftcntr_id, :prftcntr_number, :prftcntr_descrip );" ); } else if (_mode == cEdit) { if (_number->text() != _cachedNumber && QMessageBox::question(this, tr("Change All Accounts?"), tr("

    The old Profit Center Number might be " "used by existing Accounts. Would you like to " "change all accounts that use it to Profit " "Center Number %1?

    If you answer 'No' then " "change the Number back to %2 and Save again.") .arg(_number->text()) .arg(_cachedNumber), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; profitSave.prepare( "UPDATE prftcntr " "SET prftcntr_number=:prftcntr_number," " prftcntr_descrip=:prftcntr_descrip " "WHERE (prftcntr_id=:prftcntr_id);" ); } profitSave.bindValue(":prftcntr_id", _prftcntrid); profitSave.bindValue(":prftcntr_number", _number->text()); profitSave.bindValue(":prftcntr_descrip", _descrip->toPlainText()); profitSave.exec(); if (profitSave.lastError().type() != QSqlError::NoError) { systemError(this, profitSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cEdit) { profitSave.prepare( "UPDATE accnt " "SET accnt_profit=:prftcntr_number " "WHERE (accnt_profit=:old_prftcntr_number);" ); profitSave.bindValue(":prftcntr_number", _number->text()); profitSave.bindValue(":old_prftcntr_number", _cachedNumber); profitSave.exec(); if (profitSave.lastError().type() != QSqlError::NoError) { systemError(this, profitSave.lastError().databaseText(), __FILE__, __LINE__); return; } } done(_prftcntrid); } void profitCenter::populate() { XSqlQuery profitpopulate; profitpopulate.prepare( "SELECT * " "FROM prftcntr " "WHERE (prftcntr_id=:prftcntr_id);" ); profitpopulate.bindValue(":prftcntr_id", _prftcntrid); profitpopulate.exec(); if (profitpopulate.first()) { _number->setText(profitpopulate.value("prftcntr_number").toString()); _descrip->setText(profitpopulate.value("prftcntr_descrip").toString()); _cachedNumber = profitpopulate.value("prftcntr_number").toString(); } else if (profitpopulate.lastError().type() != QSqlError::NoError) { systemError(this, profitpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/profitCenter.h000066400000000000000000000020711217451700100202120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PROFITCENTER_H #define PROFITCENTER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_profitCenter.h" class profitCenter : public XDialog, public Ui::profitCenter { Q_OBJECT public: profitCenter(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~profitCenter(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _prftcntrid; QString _cachedNumber; }; #endif // PROFITCENTER_H qt-client-4.1.0/guiclient/profitCenter.ui000066400000000000000000000127101217451700100204010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. profitCenter 0 0 434 145 Profit Center Number 5 7 0 5 Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 51 10 0 6 5 0 0 0 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 26 58 0 5 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit

    xlineedit.h
    0 XTextEdit QTextEdit
    xtextedit.h
    _number _descrip _save _close _close clicked() profitCenter reject() 20 20 20 20 qt-client-4.1.0/guiclient/profitCenters.cpp000066400000000000000000000101321217451700100207250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "profitCenters.h" #include #include #include #include #include #include "profitCenter.h" #include "storedProcErrorLookup.h" profitCenters::profitCenters(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_prftcntr, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainChartOfAccounts")) { connect(_prftcntr, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_prftcntr, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_prftcntr, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_prftcntr, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _prftcntr->addColumn(tr("Number"),_itemColumn, Qt::AlignCenter,true, "prftcntr_number"); _prftcntr->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "prftcntr_descrip"); sFillList(); } profitCenters::~profitCenters() { // no need to delete child widgets, Qt does it all for us } void profitCenters::languageChange() { retranslateUi(this); } void profitCenters::sNew() { ParameterList params; params.append("mode", "new"); profitCenter *newdlg = new profitCenter(this, "", TRUE); newdlg->set(params); if (newdlg->exec() != XDialog::Rejected) sFillList(); } void profitCenters::sEdit() { ParameterList params; params.append("prftcntr_id", _prftcntr->id()); params.append("mode", "edit"); profitCenter *newdlg = new profitCenter(this, "", TRUE); newdlg->set(params); if (newdlg->exec() != XDialog::Rejected) sFillList(); } void profitCenters::sView() { ParameterList params; params.append("prftcntr_id", _prftcntr->id()); params.append("mode", "view"); profitCenter *newdlg = new profitCenter(this, "", TRUE); newdlg->set(params); newdlg->exec(); } void profitCenters::sDelete() { XSqlQuery profitDelete; profitDelete.prepare( "SELECT deleteProfitCenter(:id) AS result;" ); profitDelete.bindValue(":id", _prftcntr->id()); profitDelete.exec(); if (profitDelete.first()) { int result = profitDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteProfitCenter", result), __FILE__, __LINE__); return; } } else if (profitDelete.lastError().type() != QSqlError::NoError) { systemError(this, profitDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void profitCenters::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; pMenu->addAction("View...", this, SLOT(sView())); menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainChartOfAccounts")); menuItem = pMenu->addAction("Delete...", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainChartOfAccounts")); } void profitCenters::sFillList() { XSqlQuery profitFillList; profitFillList.prepare( "SELECT prftcntr_id," " prftcntr_number, prftcntr_descrip " "FROM prftcntr " "ORDER BY prftcntr_number;" ); profitFillList.exec(); _prftcntr->populate(profitFillList); if (profitFillList.lastError().type() != QSqlError::NoError) { systemError(this, profitFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/profitCenters.h000066400000000000000000000020321217451700100203720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PROFITCENTERS_H #define PROFITCENTERS_H #include "guiclient.h" #include "xwidget.h" #include "ui_profitCenters.h" class profitCenters : public XWidget, public Ui::profitCenters { Q_OBJECT public: profitCenters(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~profitCenters(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // PROFITCENTERS_H qt-client-4.1.0/guiclient/profitCenters.ui000066400000000000000000000122511217451700100205640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. profitCenters 0 0 418 391 List Profit Centers 0 0 Profit Centers: 0 5 &Close 0 0 &New false &Edit false &View false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _prftcntr _new _edit _view _delete _close _close clicked() profitCenters close() _prftcntr valid(bool) _view setEnabled(bool)
    qt-client-4.1.0/guiclient/project.cpp000066400000000000000000000414701217451700100175550ustar00rootroot00000000000000 /* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "project.h" #include #include #include #include #include #include #include "mqlutil.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "task.h" #include "dspOrderActivityByProject.h" const char *_projectStatuses[] = { "P", "O", "C" }; project::project(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_printTasks, SIGNAL(clicked()), this, SLOT(sPrintTasks())); connect(_newTask, SIGNAL(clicked()), this, SLOT(sNewTask())); connect(_editTask, SIGNAL(clicked()), this, SLOT(sEditTask())); connect(_viewTask, SIGNAL(clicked()), this, SLOT(sViewTask())); connect(_deleteTask, SIGNAL(clicked()), this, SLOT(sDeleteTask())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sNumberChanged())); connect(_activity, SIGNAL(clicked()), this, SLOT(sActivity())); connect(_crmacct, SIGNAL(newId(int)), this, SLOT(sCRMAcctChanged(int))); _prjtask->addColumn( tr("Number"), _itemColumn, Qt::AlignLeft, true, "prjtask_number" ); _prjtask->addColumn( tr("Name"), _itemColumn, Qt::AlignLeft, true, "prjtask_name" ); _prjtask->addColumn( tr("Description"), -1, Qt::AlignLeft, true, "prjtask_descrip" ); _prjtask->addColumn( tr("Hours Balance"), _itemColumn, Qt::AlignRight, true, "prjtaskhrbal" ); _prjtask->addColumn( tr("Expense Balance"), _itemColumn, Qt::AlignRight, true, "prjtaskexpbal" ); _owner->setUsername(omfgThis->username()); _assignedTo->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); _totalHrBud->setPrecision(omfgThis->qtyVal()); _totalHrAct->setPrecision(omfgThis->qtyVal()); _totalHrBal->setPrecision(omfgThis->qtyVal()); _totalExpBud->setPrecision(omfgThis->moneyVal()); _totalExpAct->setPrecision(omfgThis->moneyVal()); _totalExpBal->setPrecision(omfgThis->moneyVal()); _saved=false; populate(); } project::~project() { // no need to delete child widgets, Qt does it all for us } void project::languageChange() { retranslateUi(this); } enum SetResponse project::set(const ParameterList &pParams) { XSqlQuery projectet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("username", &valid); if (valid) _assignedTo->setUsername(param.toString()); param = pParams.value("prj_id", &valid); if (valid) { _prjid = param.toInt(); populate(); } param = pParams.value("crmacct_id", &valid); if (valid) { _crmacct->setId(param.toInt()); _crmacct->setEnabled(false); } param = pParams.value("cntct_id", &valid); if (valid) { _cntct->setId(param.toInt()); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; connect(_assignedTo, SIGNAL(newId(int)), this, SLOT(sAssignedToChanged(int))); connect(_status, SIGNAL(currentIndexChanged(int)), this, SLOT(sStatusChanged(int))); connect(_prjtask, SIGNAL(valid(bool)), _editTask, SLOT(setEnabled(bool))); connect(_prjtask, SIGNAL(valid(bool)), _deleteTask, SLOT(setEnabled(bool))); connect(_prjtask, SIGNAL(itemSelected(int)), _editTask, SLOT(animateClick())); projectet.exec("SELECT NEXTVAL('prj_prj_id_seq') AS prj_id;"); if (projectet.first()) _prjid = projectet.value("prj_id").toInt(); else if (projectet.lastError().type() == QSqlError::NoError) { systemError(this, projectet.lastError().text(), __FILE__, __LINE__); return UndefinedError; } _comments->setId(_prjid); _documents->setId(_prjid); _recurring->setParent(_prjid, "J"); } else if (param.toString() == "edit") { _mode = cEdit; _number->setEnabled(FALSE); connect(_assignedTo, SIGNAL(newId(int)), this, SLOT(sAssignedToChanged(int))); connect(_status, SIGNAL(currentIndexChanged(int)), this, SLOT(sStatusChanged(int))); connect(_prjtask, SIGNAL(valid(bool)), _editTask, SLOT(setEnabled(bool))); connect(_prjtask, SIGNAL(valid(bool)), _deleteTask, SLOT(setEnabled(bool))); connect(_prjtask, SIGNAL(itemSelected(int)), _editTask, SLOT(animateClick())); } else if (param.toString() == "view") { _mode = cView; _owner->setEnabled(FALSE); _number->setEnabled(FALSE); _status->setEnabled(FALSE); _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _so->setEnabled(FALSE); _wo->setEnabled(FALSE); _po->setEnabled(FALSE); _assignedTo->setEnabled(FALSE); _crmacct->setEnabled(false); _cntct->setEnabled(false); _newTask->setEnabled(FALSE); connect(_prjtask, SIGNAL(itemSelected(int)), _viewTask, SLOT(animateClick())); _comments->setReadOnly(TRUE); _documents->setReadOnly(TRUE); _started->setEnabled(FALSE); _assigned->setEnabled(FALSE); _due->setEnabled(FALSE); _completed->setEnabled(FALSE); _recurring->setEnabled(FALSE); _buttonBox->removeButton(_buttonBox->button(QDialogButtonBox::Save)); _buttonBox->removeButton(_buttonBox->button(QDialogButtonBox::Cancel)); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void project::populate() { XSqlQuery projectpopulate; projectpopulate.prepare( "SELECT * " "FROM prj " "WHERE (prj_id=:prj_id);" ); projectpopulate.bindValue(":prj_id", _prjid); projectpopulate.exec(); if (projectpopulate.first()) { _saved = true; _owner->setUsername(projectpopulate.value("prj_owner_username").toString()); _number->setText(projectpopulate.value("prj_number").toString()); _name->setText(projectpopulate.value("prj_name").toString()); _descrip->setText(projectpopulate.value("prj_descrip").toString()); _so->setChecked(projectpopulate.value("prj_so").toBool()); _wo->setChecked(projectpopulate.value("prj_wo").toBool()); _po->setChecked(projectpopulate.value("prj_po").toBool()); _assignedTo->setUsername(projectpopulate.value("prj_username").toString()); _cntct->setId(projectpopulate.value("prj_cntct_id").toInt()); _crmacct->setId(projectpopulate.value("prj_crmacct_id").toInt()); _started->setDate(projectpopulate.value("prj_start_date").toDate()); _assigned->setDate(projectpopulate.value("prj_assigned_date").toDate()); _due->setDate(projectpopulate.value("prj_due_date").toDate()); _completed->setDate(projectpopulate.value("prj_completed_date").toDate()); for (int counter = 0; counter < _status->count(); counter++) { if (QString(projectpopulate.value("prj_status").toString()[0]) == _projectStatuses[counter]) _status->setCurrentIndex(counter); } _recurring->setParent(projectpopulate.value("prj_recurring_prj_id").isNull() ? _prjid : projectpopulate.value("prj_recurring_prj_id").toInt(), "J"); } sFillTaskList(); _comments->setId(_prjid); _documents->setId(_prjid); emit populated(_prjid); } void project::sAssignedToChanged(const int newid) { if (newid == -1) _assigned->clear(); else _assigned->setDate(omfgThis->dbDate()); } void project::sStatusChanged(const int pStatus) { switch(pStatus) { case 0: // Concept default: _started->clear(); _completed->clear(); break; case 1: // In Process _started->setDate(omfgThis->dbDate()); _completed->clear(); break; case 2: // Completed _completed->setDate(omfgThis->dbDate()); break; } } void project::sCRMAcctChanged(const int newid) { _cntct->setSearchAcct(newid); } void project::sClose() { XSqlQuery projectClose; if (_mode == cNew) { projectClose.prepare( "SELECT deleteproject(:prj_id);" ); projectClose.bindValue(":prj_id", _prjid); projectClose.exec(); } reject(); } bool project::sSave(bool partial) { XSqlQuery projectSave; QList errors; errors<< GuiErrorCheck(_number->text().isEmpty(), _number, tr("No Project Number was specified. You must specify a project number " "before saving it.")) << GuiErrorCheck(!partial && !_due->isValid(), _due, tr("You must specify a due date before " "saving it.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Project"), errors)) return false; RecurrenceWidget::RecurrenceChangePolicy cp = _recurring->getChangePolicy(); if (cp == RecurrenceWidget::NoPolicy) return false; XSqlQuery rollbackq; rollbackq.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); if (!_saved) projectSave.prepare( "INSERT INTO prj " "( prj_id, prj_number, prj_name, prj_descrip," " prj_so, prj_wo, prj_po, prj_status, prj_owner_username, " " prj_start_date, prj_due_date, prj_assigned_date," " prj_completed_date, prj_username, prj_recurring_prj_id," " prj_crmacct_id, prj_cntct_id) " "VALUES " "( :prj_id, :prj_number, :prj_name, :prj_descrip," " :prj_so, :prj_wo, :prj_po, :prj_status, :prj_owner_username," " :prj_start_date, :prj_due_date, :prj_assigned_date," " :prj_completed_date, :username, :prj_recurring_prj_id," " :prj_crmacct_id, :prj_cntct_id);" ); else projectSave.prepare( "UPDATE prj " "SET prj_number=:prj_number, prj_name=:prj_name, prj_descrip=:prj_descrip," " prj_so=:prj_so, prj_wo=:prj_wo, prj_po=:prj_po, prj_status=:prj_status, " " prj_owner_username=:prj_owner_username, prj_start_date=:prj_start_date, " " prj_due_date=:prj_due_date, prj_assigned_date=:prj_assigned_date," " prj_completed_date=:prj_completed_date," " prj_username=:username," " prj_recurring_prj_id=:prj_recurring_prj_id," " prj_crmacct_id=:prj_crmacct_id," " prj_cntct_id=:prj_cntct_id " "WHERE (prj_id=:prj_id);" ); projectSave.bindValue(":prj_id", _prjid); projectSave.bindValue(":prj_number", _number->text().trimmed().toUpper()); projectSave.bindValue(":prj_name", _name->text()); projectSave.bindValue(":prj_descrip", _descrip->toPlainText()); projectSave.bindValue(":prj_status", _projectStatuses[_status->currentIndex()]); projectSave.bindValue(":prj_so", QVariant(_so->isChecked())); projectSave.bindValue(":prj_wo", QVariant(_wo->isChecked())); projectSave.bindValue(":prj_po", QVariant(_po->isChecked())); projectSave.bindValue(":prj_owner_username", _owner->username()); projectSave.bindValue(":username", _assignedTo->username()); if (_crmacct->id() > 0) projectSave.bindValue(":prj_crmacct_id", _crmacct->id()); if (_cntct->id() > 0) projectSave.bindValue(":prj_cntct_id", _cntct->id()); projectSave.bindValue(":prj_start_date", _started->date()); projectSave.bindValue(":prj_due_date", _due->date()); projectSave.bindValue(":prj_assigned_date", _assigned->date()); projectSave.bindValue(":prj_completed_date", _completed->date()); if (_recurring->isRecurring()) projectSave.bindValue(":prj_recurring_prj_id", _recurring->parentId()); projectSave.exec(); if (projectSave.lastError().type() != QSqlError::NoError) { rollbackq.exec(); systemError(this, projectSave.lastError().databaseText(), __FILE__, __LINE__); return false; } QString errmsg; if (! _recurring->save(true, cp, &errmsg)) { qDebug("recurring->save failed"); rollbackq.exec(); systemError(this, errmsg, __FILE__, __LINE__); return false; } projectSave.exec("COMMIT;"); emit saved(_prjid); if (!partial) done(_prjid); else _saved=true; return true; } void project::sPrintTasks() { ParameterList params; params.append("prj_id", _prjid); orReport report("ProjectTaskList", params); if(report.isValid()) report.print(); else report.reportError(this); } void project::sNewTask() { if (!_saved) { if (!sSave(true)) return; } ParameterList params; params.append("mode", "new"); params.append("prj_id", _prjid); params.append("prj_owner_username", _owner->username()); params.append("prj_username", _assignedTo->username()); params.append("prj_start_date", _started->date()); params.append("prj_due_date", _due->date()); params.append("prj_assigned_date", _assigned->date()); params.append("prj_completed_date", _completed->date()); task newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillTaskList(); } void project::sEditTask() { ParameterList params; params.append("mode", "edit"); params.append("prjtask_id", _prjtask->id()); task newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillTaskList(); } void project::sViewTask() { ParameterList params; params.append("mode", "view"); params.append("prjtask_id", _prjtask->id()); task newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void project::sDeleteTask() { XSqlQuery projectDeleteTask; projectDeleteTask.prepare("SELECT deleteProjectTask(:prjtask_id) AS result; "); projectDeleteTask.bindValue(":prjtask_id", _prjtask->id()); projectDeleteTask.exec(); if(projectDeleteTask.first()) { int result = projectDeleteTask.value("result").toInt(); if(result < 0) { QString errmsg; switch(result) { case -1: errmsg = tr("Project task not found."); break; case -2: errmsg = tr("Actual hours have been posted to this project task."); break; case -3: errmsg = tr("Actual expenses have been posted to this project task."); break; default: errmsg = tr("Error #%1 encountered while trying to delete project task.").arg(result); } QMessageBox::critical( this, tr("Cannot Delete Project Task"), tr("Could not delete the project task for one or more reasons.\n") + errmsg); return; } } emit deletedTask(); sFillTaskList(); } void project::sFillTaskList() { MetaSQLQuery mql = mqlLoad("projectTasks", "detail"); ParameterList params; params.append("prj_id", _prjid); XSqlQuery qry = mql.toQuery(params); if (qry.first()) { _totalHrBud->setDouble(qry.value("totalhrbud").toDouble()); _totalHrAct->setDouble(qry.value("totalhract").toDouble()); _totalHrBal->setDouble(qry.value("totalhrbal").toDouble()); _totalExpBud->setDouble(qry.value("totalexpbud").toDouble()); _totalExpAct->setDouble(qry.value("totalexpact").toDouble()); _totalExpBal->setDouble(qry.value("totalexpbal").toDouble()); } if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } else { _totalHrBud->setDouble(0.0); _totalHrAct->setDouble(0.0); _totalHrBal->setDouble(0.0); _totalExpBud->setDouble(0.0); _totalExpAct->setDouble(0.0); _totalExpBal->setDouble(0.0); } _prjtask->populate(qry); } void project::sNumberChanged() { XSqlQuery projectNumberChanged; if((cNew == _mode) && (_number->text().length())) { _number->setText(_number->text().trimmed().toUpper()); projectNumberChanged.prepare( "SELECT prj_id" " FROM prj" " WHERE (prj_number=:prj_number);" ); projectNumberChanged.bindValue(":prj_number", _number->text()); projectNumberChanged.exec(); if(projectNumberChanged.first()) { _number->setEnabled(FALSE); _prjid = projectNumberChanged.value("prj_id").toInt(); _mode = cEdit; populate(); } else { _number->setEnabled(FALSE); _mode = cNew; } } } void project::sActivity() { ParameterList params; params.append("prj_id", _prjid); params.append("run", true); dspOrderActivityByProject *newdlg = new dspOrderActivityByProject(this,"dspOrderActivityByProject",Qt::Dialog ); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/project.h000066400000000000000000000030071217451700100172140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PROJECT_H #define PROJECT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_project.h" class project : public XDialog, public Ui::project { Q_OBJECT public: project(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~project(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sAssignedToChanged(const int); virtual void sStatusChanged(const int); virtual void sCRMAcctChanged(const int); virtual void sClose(); virtual bool sSave(bool partial = false); virtual void sPrintTasks(); virtual void sNewTask(); virtual void sEditTask(); virtual void sViewTask(); virtual void sDeleteTask(); virtual void sFillTaskList(); virtual void sNumberChanged(); virtual void sActivity(); protected slots: virtual void languageChange(); private: int _mode; int _prjid; bool _saved; signals: void saved(int); void populated(int); void deletedTask(); }; #endif // PROJECT_H qt-client-4.1.0/guiclient/project.ui000066400000000000000000000625711217451700100174150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. project 0 0 684 636 Project 12 Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 46 16 Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Concept In-Process Complete Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save CRM Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::StrongFocus Qt::Horizontal Owner: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Qt::Horizontal Qt::StrongFocus Qt::Horizontal Assigned To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Started: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Assigned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Completed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true Qt::Horizontal 40 20 0 1 0 Tasks 7 5 0 0 0 Print Qt::Vertical QSizePolicy::Preferred 20 10 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Additional Assignable Orders 12 Qt::StrongFocus Sales Orders true Qt::StrongFocus Purchase Orders true Qt::StrongFocus Work Orders true Qt::Horizontal 0 20 Activity... Summary Total Hours Budgeted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter TextLabel Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Hours Actual: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter TextLabel Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter TextLabel Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Expenses Budgeted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter TextLabel Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Expenses Actual: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter TextLabel Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter TextLabel Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Horizontal 0 20 Notes true true Comments 5 Comments::Project Documents Documents::Project Advanced Qt::StrongFocus Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    CRMAcctCluster QWidget
    crmacctcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    Documents QWidget
    documents.h
    RecurrenceWidget QWidget
    recurrencewidget.h
    UsernameCluster QWidget
    usernamecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _status _name _crmacct _owner _assignedTo _due _started _assigned _completed _cntct _tab _prjtask _printTasks _newTask _editTask _viewTask _deleteTask _so _po _wo _activity _descrip _recurring _buttonBox _prjtask valid(bool) _viewTask setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/projects.cpp000066400000000000000000000240271217451700100177370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "projects.h" #include #include #include #include #include #include #include #include "parameterwidget.h" #include "project.h" projects::projects(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "projects", fl) { setupUi(optionsWidget()); setWindowTitle(tr("Projects")); setMetaSQLOptions("projects", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen())); if (!_privileges->check("MaintainAllProjects") && !_privileges->check("MaintainPersonalProjects")) newAction()->setEnabled(FALSE); list()->addColumn(tr("Number"), _orderColumn, Qt::AlignLeft, true, "prj_number"); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "prj_name"); list()->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "prj_descrip"); list()->addColumn(tr("Status"), _itemColumn, Qt::AlignCenter, true, "prj_status" ); list()->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false, "prj_owner_username"); list()->addColumn(tr("Assigned To"), _userColumn, Qt::AlignLeft, true, "prj_username"); list()->addColumn(tr("CRM Account"), _userColumn, Qt::AlignLeft, true, "crmacct_number"); list()->addColumn(tr("Contact"), _userColumn, Qt::AlignLeft, true, "contact_name"); list()->addColumn(tr("Due"), _dateColumn, Qt::AlignCenter, true, "prj_due_date"); list()->addColumn(tr("Assigned"), _dateColumn, Qt::AlignCenter, true, "prj_assigned_date"); list()->addColumn(tr("Started"), _dateColumn, Qt::AlignCenter, true, "prj_start_date"); list()->addColumn(tr("Completed"), _dateColumn, Qt::AlignCenter, true, "prj_completed_date"); list()->addColumn(tr("Budget Hrs."), _costColumn, Qt::AlignRight, true, "budget_hrs"); list()->addColumn(tr("Actual Hrs."), _costColumn, Qt::AlignRight, true, "actual_hrs"); list()->addColumn(tr("Balance Hrs."), _costColumn, Qt::AlignRight, true, "balance_hrs"); connect(omfgThis, SIGNAL(projectsUpdated(int)), this, SLOT(sFillList())); connect(_showComplete, SIGNAL(toggled(bool)), this, SLOT(sFillList())); parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User); parameterWidget()->append(tr("AssignedTo"), "assigned_username", ParameterWidget::User); parameterWidget()->append(tr("CRM Account"), "crmacct_id", ParameterWidget::Crmacct); parameterWidget()->append(tr("Contact"), "cntct_id", ParameterWidget::Contact); parameterWidget()->append(tr("Start Start Date"), "startStartDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Start End Date"), "startEndDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Due Start Date"), "dueStartDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Due End Date"), "dueEndDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Assigned Start Date"), "assignedStartDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Assigned End Date"), "assignedEndDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Completed Start Date"), "completedStartDate", ParameterWidget::Date, QDate::currentDate()); parameterWidget()->append(tr("Completed End Date"), "completedEndDate", ParameterWidget::Date, QDate::currentDate()); sFillList(); } void projects::sNew() { ParameterList params; params.append("mode", "new"); project newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void projects::sEdit() { ParameterList params; params.append("prj_id", list()->id()); params.append("mode", "edit"); project newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void projects::sView() { ParameterList params; params.append("prj_id", list()->id()); params.append("mode", "view"); project newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void projects::sDelete() { XSqlQuery projectsDelete; projectsDelete.prepare("SELECT deleteProject(:prj_id) AS result"); projectsDelete.bindValue(":prj_id", list()->id()); projectsDelete.exec(); if(projectsDelete.first()) { int result = projectsDelete.value("result").toInt(); if(result < 0) { QString errmsg; switch(result) { case -1: errmsg = tr("One or more Quote's refer to this project."); break; case -2: errmsg = tr("One or more Sales Orders refer to this project."); break; case -3: errmsg = tr("One or more Work Orders refer to this project."); break; case -4: errmsg = tr("One or more Purchase Requests refer to this project."); break; case -5: errmsg = tr("One or more Purchase order Items refer to this project."); break; case -6: errmsg = tr("One or more Invoices refer to this project."); break; default: errmsg = tr("Error #%1 encountered while trying to delete project.").arg(result); } QMessageBox::critical( this, tr("Cannot Delete Project"), tr("Could not delete the project for one or more reasons.\n") + errmsg); return; } else if (projectsDelete.lastError().type() != QSqlError::NoError) { systemError(this, projectsDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } void projects::sCopy() { XSqlQuery projectsCopy; bool ok; QString newNumber = QInputDialog::getText(this, tr("Project Number"), tr("Project Number for the new Project:"), QLineEdit::Normal, "", &ok); if(!ok) return; int newDueOffset = QInputDialog::getInt(this, tr("Due Date"), tr("Offset from old Due Date:"), 0, 0, 365, 1, &ok); if ( !ok ) return; projectsCopy.prepare("SELECT copyProject(:prj_id, :newNumber, :newDueOffset) AS result"); projectsCopy.bindValue(":prj_id", list()->id()); projectsCopy.bindValue(":newNumber", newNumber); projectsCopy.bindValue(":newDueOffset", newDueOffset); projectsCopy.exec(); if(projectsCopy.first()) { int result = projectsCopy.value("result").toInt(); if(result < 0) { QString errmsg; switch(result) { case -1: errmsg = tr("Project Number for the new Project cannot be blank."); break; case -2: errmsg = tr("The Project Number entered for the new Project already exists."); break; case -3: errmsg = tr("Source Project not found."); break; default: errmsg = tr("Error #%1 encountered while trying to copy project.").arg(result); } QMessageBox::critical( this, tr("Cannot Copy Project"), tr("Could not copy the project for one or more reasons.\n") + errmsg); return; } else if (projectsCopy.lastError().type() != QSqlError::NoError) { systemError(this, projectsCopy.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } void projects::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("prj_owner_username") && _privileges->check("MaintainPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("prj_username") && _privileges->check("MaintainPersonalProjects")) || (_privileges->check("MaintainAllProjects")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("prj_owner_username") && _privileges->check("ViewPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("prj_username") && _privileges->check("ViewPersonalProjects")) || (_privileges->check("ViewAllProjects")); menuItem = pMenu->addAction("View...", this, SLOT(sView())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction("Delete...", this, SLOT(sDelete())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction("Copy...", this, SLOT(sCopy())); menuItem->setEnabled(editPriv); } bool projects::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; if (_showComplete->isChecked()) params.append("showComplete",true); params.append("planning", tr("Concept")); params.append("open", tr("In-Process")); params.append("complete", tr("Complete")); params.append("undefined", tr("Undefined")); return true; } void projects::sOpen() { bool editPriv = (omfgThis->username() == list()->currentItem()->rawValue("prj_owner_username") && _privileges->check("MaintainPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("prj_username") && _privileges->check("MaintainPersonalProjects")) || (_privileges->check("MaintainAllProjects")); bool viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("prj_owner_username") && _privileges->check("ViewPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("prj_username") && _privileges->check("ViewPersonalProjects")) || (_privileges->check("ViewAllProjects")); if (editPriv) sEdit(); else if (viewPriv) sView(); } qt-client-4.1.0/guiclient/projects.h000066400000000000000000000017471217451700100174100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PROJECTS_H #define PROJECTS_H #include "display.h" #include "ui_projects.h" class projects : public display, public Ui::projects { Q_OBJECT public: projects(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sCopy(); virtual void sOpen(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual bool setParams(ParameterList &); }; #endif // PROJECTS_H qt-client-4.1.0/guiclient/projects.ui000066400000000000000000000023741217451700100175730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. projects 0 0 215 37 List Projects Show Complete XCheckBox QCheckBox
    xcheckbox.h
    qt-client-4.1.0/guiclient/prospect.cpp000066400000000000000000000370641217451700100177520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "prospect.h" #include #include #include #include #include #include #include #include "crmaccount.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "printQuote.h" #include "salesOrder.h" #include "storedProcErrorLookup.h" prospect::prospect(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_crmacct, SIGNAL(clicked()), this, SLOT(sCrmAccount())); connect(_deleteQuote, SIGNAL(clicked()), this, SLOT(sDeleteQuote())); connect(_editQuote, SIGNAL(clicked()), this, SLOT(sEditQuote())); connect(_newQuote, SIGNAL(clicked()), this, SLOT(sNewQuote())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sCheckNumber())); connect(_printQuote, SIGNAL(clicked()), this, SLOT(sPrintQuote())); connect(_quotes, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateQuotesMenu(QMenu*))); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_viewQuote, SIGNAL(clicked()), this, SLOT(sViewQuote())); connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillQuotesList())); if (_privileges->check("MaintainQuotes")) connect(_quotes, SIGNAL(itemSelected(int)), _editQuote, SLOT(animateClick())); else connect(_quotes, SIGNAL(itemSelected(int)), _viewQuote, SLOT(animateClick())); _prospectid = -1; _crmacctid = -1; _taxzone->setAllowNull(true); _taxzone->setType(XComboBox::TaxZones); _quotes->addColumn(tr("Quote #"), _orderColumn, Qt::AlignLeft, true, "quhead_number" ); _quotes->addColumn(tr("Quote Date"), _dateColumn, Qt::AlignLeft, true, "quhead_quotedate" ); _NumberGen = -1; } prospect::~prospect() { // no need to delete child widgets, Qt does it all for us } void prospect::languageChange() { retranslateUi(this); } enum SetResponse prospect::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("crmacct_id", &valid); if (valid) _crmacctid = param.toInt(); param = pParams.value("prospect_id", &valid); if (valid) _prospectid = param.toInt(); if (_crmacctid >= 0 || _prospectid >= 0) if (! sPopulate()) return UndefinedError; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; if(((_metrics->value("CRMAccountNumberGeneration") == "A") || (_metrics->value("CRMAccountNumberGeneration") == "O")) && _number->text().isEmpty() ) { XSqlQuery getq; getq.exec("SELECT fetchCRMAccountNumber() AS number;"); if (getq.first()) { _number->setText(getq.value("number")); _NumberGen = getq.value("number").toInt(); } } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _save->hide(); disconnect(_quotes, SIGNAL(itemSelected(int)), _editQuote, SLOT(animateClick())); disconnect(_quotes, SIGNAL(valid(bool)), _editQuote, SLOT(setEnabled(bool))); disconnect(_quotes, SIGNAL(valid(bool)), _editQuote, SLOT(setEnabled(bool))); disconnect(_quotes, SIGNAL(valid(bool)), _deleteQuote, SLOT(setEnabled(bool))); connect(_quotes, SIGNAL(itemSelected(int)), _viewQuote, SLOT(animateClick())); _close->setText(tr("&Close")); } } bool canEdit = (cEdit == _mode || cNew == _mode); _number->setEnabled(canEdit && _metrics->value("CRMAccountNumberGeneration") != "A"); _active->setEnabled(canEdit); _contact->setEnabled(canEdit); _name->setEnabled(canEdit); _newQuote->setEnabled(canEdit); _notes->setReadOnly(! canEdit); _salesrep->setEnabled(canEdit); _site->setEnabled(canEdit); _taxzone->setEnabled(canEdit); return NoError; } int prospect::id() const { return _prospectid; } /** \return one of cNew, cEdit, cView, ... \todo change possible modes to an enum in guiclient.h (and add cUnknown?) */ int prospect::mode() const { return _mode; } void prospect::sSave() { QList errors; errors << GuiErrorCheck(_number->text().trimmed().isEmpty(), _number, tr("You must enter a number for this Prospect")) ; // disallow overlap of prospect and customer numbers if (_number->text().trimmed() != _cachedNumber) { XSqlQuery dupq; dupq.prepare( "SELECT prospect_name AS name " "FROM prospect " "WHERE (UPPER(prospect_number)=UPPER(:prospect_number)) " " AND (prospect_id<>:prospect_id) " "UNION " "SELECT cust_name AS name " "FROM custinfo " "WHERE (UPPER(cust_number)=UPPER(:prospect_number));" ); dupq.bindValue(":prospect_number", _number->text().trimmed()); dupq.bindValue(":prospect_id", _prospectid); dupq.exec(); if (dupq.first()) errors << GuiErrorCheck(true, _number, tr("

    The newly entered Prospect Number cannot " "be used as it is currently in use by '%1'. " "Please enter a different Prospect Number." ) .arg(dupq.value("name").toString()) ); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Prospect"), errors)) return; XSqlQuery upsq; if (_mode == cEdit) { upsq.prepare( "UPDATE prospect SET " " prospect_number=:prospect_number," " prospect_name=:prospect_name," " prospect_cntct_id=:prospect_cntct_id," " prospect_comments=:prospect_comments," " prospect_taxzone_id=:prospect_taxzone_id," " prospect_salesrep_id=:prospect_salesrep_id," " prospect_warehous_id=:prospect_warehous_id," " prospect_active=:prospect_active" " WHERE (prospect_id=:prospect_id)" " RETURNING prospect_id;" ); upsq.bindValue(":prospect_id", _prospectid); } else upsq.prepare("INSERT INTO prospect " "( prospect_id, prospect_number, prospect_name," " prospect_cntct_id, prospect_taxzone_id, prospect_comments," " prospect_salesrep_id, prospect_warehous_id, prospect_active )" " VALUES " "( DEFAULT, :prospect_number, :prospect_name," " :prospect_cntct_id, :prospect_taxzone_id, :prospect_comments," " :prospect_salesrep_id, :prospect_warehous_id, :prospect_active )" " RETURNING prospect_id;"); upsq.bindValue(":prospect_number", _number->text().trimmed()); upsq.bindValue(":prospect_name", _name->text().trimmed()); upsq.bindValue(":prospect_comments", _notes->toPlainText()); upsq.bindValue(":prospect_active", QVariant(_active->isChecked())); if (_contact->isValid()) upsq.bindValue(":prospect_cntct_id", _contact->id()); if (_taxzone->isValid()) upsq.bindValue(":prospect_taxzone_id", _taxzone->id()); if (_salesrep->isValid()) upsq.bindValue(":prospect_salesrep_id", _salesrep->id()); if (_site->isValid()) upsq.bindValue(":prospect_warehous_id", _site->id()); upsq.exec(); if (upsq.first()) _prospectid = upsq.value("prospect_id").toInt(); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Saving Prospect"), upsq, __FILE__, __LINE__)) return; _NumberGen = -1; omfgThis->sProspectsUpdated(); emit saved(_prospectid); if (_mode == cNew) { omfgThis->sCrmAccountsUpdated(_crmacctid); emit newId(_prospectid); // cluster listeners couldn't handle set()'s emit } close(); } void prospect::sCheckNumber() { _number->setText(_number->text().trimmed().toUpper()); if (_mode == cNew) { if (-1 != _NumberGen && _number->text().toInt() != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } XSqlQuery getq; getq.prepare( "SELECT prospect_id " "FROM prospect " "WHERE (prospect_number=:prospect);" ); getq.bindValue(":prospect", _number->text()); getq.exec(); if (getq.first()) { _prospectid = getq.value("prospect_id").toInt(); _mode = cEdit; sPopulate(); emit newId(_prospectid); _name->setFocus(); } } } void prospect::sPrintQuote() { ParameterList params; params.append("quhead_id", _quotes->id()); printQuote newdlg(this, "printQuote", true); newdlg.set(params); newdlg.exec(); } void prospect::sNewQuote() { ParameterList params; params.append("mode", "newQuote"); params.append("cust_id", _prospectid); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void prospect::sEditQuote() { ParameterList params; params.append("mode", "editQuote"); params.append("quhead_id", _quotes->id()); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void prospect::sViewQuote() { ParameterList params; params.append("mode", "viewQuote"); params.append("quhead_id", _quotes->id()); salesOrder *newdlg = new salesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void prospect::sDeleteQuote() { if (QMessageBox::question(this, tr("Delete Selected Quote"), tr("Are you sure that you want to delete the selected Quote?" ), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("SELECT deleteQuote(:quhead_id) AS result;"); delq.bindValue(":quhead_id", _quotes->id()); delq.exec(); if (delq.first()) { int result = delq.value("result").toInt(); if (result < 0) { ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Quote"), storedProcErrorLookup("deleteQuote", result), __FILE__, __LINE__); return; } else omfgThis->sQuotesUpdated(-1); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Quote"), delq, __FILE__, __LINE__)) return; } void prospect::sFillQuotesList() { XSqlQuery getq; getq.prepare("SELECT quhead_id, quhead_number, quhead_quotedate " "FROM quhead " "WHERE (quhead_cust_id=:prospect_id) " "ORDER BY quhead_number;"); getq.bindValue(":prospect_id", _prospectid); getq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Quote"), getq, __FILE__, __LINE__)) return; _quotes->populate(getq); } void prospect::sPopulateQuotesMenu(QMenu *menuThis) { menuThis->addAction(tr("Edit..."), this, SLOT(sEditQuote())); menuThis->addAction(tr("View..."), this, SLOT(sViewQuote())); menuThis->addAction(tr("Delete..."), this, SLOT(sDeleteQuote())); menuThis->addAction(tr("Print..."), this, SLOT(sPrintQuote())); } bool prospect::sPopulate() { XSqlQuery getq; if (_prospectid >= 0) { getq.prepare("SELECT prospect.*, crmacct_id, crmacct_owner_username" " FROM prospect, crmacct" " WHERE ((prospect_id=:prospect_id)" " AND (prospect_id=crmacct_prospect_id));" ); getq.bindValue(":prospect_id", _prospectid); } else if (_crmacctid >= 0) { getq.prepare("SELECT crmacct_active AS prospect_active," " crmacct_name AS prospect_name," " crmacct_number AS prospect_number," " crmacct_cntct_id_1 AS prospect_cntct_id," " crmacct_owner_username AS prospect_owner_username," " NULL AS prospect_comments, -1 AS prospect_taxzone_id," " -1 AS prospect_salesrep_id, -1 AS prospect_warehous_id," " crmacct_id, crmacct_owner_username" " FROM crmacct" " WHERE (crmacct_id=:id);"); getq.bindValue(":id", _crmacctid); } getq.exec(); if (getq.first()) { _crmacctid = getq.value("crmacct_id").toInt(); _number->setText(getq.value("prospect_number").toString()); _cachedNumber = getq.value("prospect_number").toString(); _name->setText(getq.value("prospect_name").toString()); _contact->setId(getq.value("prospect_cntct_id").toInt()); _taxzone->setId(getq.value("prospect_taxzone_id").toInt()); _salesrep->setId(getq.value("prospect_salesrep_id").toInt()); _site->setId(getq.value("prospect_warehous_id").toInt()); _notes->setText(getq.value("prospect_comments").toString()); _active->setChecked(getq.value("prospect_active").toBool()); _crmowner = getq.value("crmacct_owner_username").toString(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Prospect"), getq, __FILE__, __LINE__)) return false; _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); sFillQuotesList(); emit populated(); return true; } void prospect::closeEvent(QCloseEvent *pEvent) { if(cNew == _mode && -1 != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; ErrorReporter::error(QtCriticalMsg, this, tr("Getting Prospect"), query, __FILE__, __LINE__); } XWidget::closeEvent(pEvent); } void prospect::sCrmAccount() { ParameterList params; params.append("crmacct_id", _crmacctid); if ((cView == _mode && _privileges->check("ViewAllCRMAccounts")) || (cView == _mode && _privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner) || (cEdit == _mode && _privileges->check("ViewAllCRMAccounts") && ! _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("ViewPersonalCRMAccounts") && ! _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else if ((cEdit == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if ((cNew == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cNew == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else { qWarning("tried to open CRM Account window without privilege"); return; } crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/prospect.h000066400000000000000000000031671217451700100174140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PROSPECT_H #define PROSPECT_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_prospect.h" class prospect : public XWidget, public Ui::prospect { Q_OBJECT public: prospect(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~prospect(); Q_INVOKABLE virtual int id() const; Q_INVOKABLE virtual int mode() const; public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sCheckNumber(); virtual void sDeleteQuote(); virtual void sEditQuote(); virtual void sNewQuote(); virtual void sPrintQuote(); virtual void sSave(); virtual void sViewQuote(); virtual void sFillQuotesList(); virtual void sPopulateQuotesMenu(QMenu * menuThis); virtual bool sPopulate(); signals: void newId(int); void populated(); void saved(int); protected slots: virtual void languageChange(); virtual void sCrmAccount(); protected: virtual void closeEvent(QCloseEvent*); private: int _crmacctid; int _mode; int _prospectid; int _NumberGen; QString _cachedNumber; QString _crmowner; }; #endif // PROSPECT_H qt-client-4.1.0/guiclient/prospect.ui000066400000000000000000000325471217451700100176060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. prospect 0 0 580 370 Prospect 12 Prospect #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number Qt::StrongFocus Qt::Horizontal 40 0 false CRM Account... Save Cancel Qt::Vertical 20 0 Prospect Name: _name Active true Qt::Horizontal 0 20 true Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Sales Rep: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _salesrep true XComboBox::SalesReps Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxzone 0 1 0 Contact Qt::StrongFocus false false Qt::Vertical 20 40 Qt::Vertical 20 0 Qt::Horizontal 0 20 Notes Quotes 0 New false Edit false View false Delete false Print Qt::Vertical 20 40 ContactCluster QWidget

    contactcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _name _tabs _contact _notes _quotes _newQuote _editQuote _viewQuote _deleteQuote _printQuote _close _close clicked() prospect close() 737 26 399 299 _quotes valid(bool) _editQuote setEnabled(bool) 317 432 674 356 _quotes valid(bool) _viewQuote setEnabled(bool) 317 432 674 388 _quotes valid(bool) _deleteQuote setEnabled(bool) 317 432 674 420 _quotes valid(bool) _printQuote setEnabled(bool) 317 432 674 452 qt-client-4.1.0/guiclient/prospects.cpp000066400000000000000000000116421217451700100201270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "prospects.h" #include #include #include #include #include #include "errorReporter.h" #include "parameterwidget.h" #include "prospect.h" #include "storedProcErrorLookup.h" prospects::prospects(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "prospects", fl) { setWindowTitle(tr("Prospects")); setMetaSQLOptions("prospects", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); parameterWidget()->append(tr("Prospect Number Pattern"), "prospect_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Prospect Name Pattern"), "prospect_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Contact Name Pattern"), "cntct_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Phone Pattern"), "cntct_phone_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Email Pattern"), "cntct_email_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text); parameterWidget()->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text); parameterWidget()->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Postal Code Pattern"), "addr_postalcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text); if (_privileges->check("MaintainProspectMasters")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(FALSE); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } list()->addColumn(tr("Number"), _orderColumn, Qt::AlignCenter, true, "prospect_number" ); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "prospect_name" ); list()->addColumn(tr("First"), 50, Qt::AlignLeft , true, "cntct_first_name" ); list()->addColumn(tr("Last"), -1, Qt::AlignLeft , true, "cntct_last_name" ); list()->addColumn(tr("Phone"), 100, Qt::AlignLeft , true, "cntct_phone" ); list()->addColumn(tr("Email"), 100, Qt::AlignLeft , true, "cntct_email" ); list()->addColumn(tr("Address"), -1, Qt::AlignLeft , false, "addr_line1" ); list()->addColumn(tr("City"), 75, Qt::AlignLeft , false, "addr_city" ); list()->addColumn(tr("State"), 50, Qt::AlignLeft , false, "addr_state" ); list()->addColumn(tr("Country"), 100, Qt::AlignLeft , false, "addr_country" ); list()->addColumn(tr("Postal Code"), 75, Qt::AlignLeft , false, "addr_postalcode" ); connect(omfgThis, SIGNAL(prospectsUpdated()), SLOT(sFillList())); } void prospects::sNew() { ParameterList params; params.append("mode", "new"); prospect *newdlg = new prospect(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void prospects::sEdit() { ParameterList params; params.append("prospect_id", list()->id()); params.append("mode", "edit"); prospect *newdlg = new prospect(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void prospects::sView() { ParameterList params; params.append("prospect_id", list()->id()); params.append("mode", "view"); prospect *newdlg = new prospect(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void prospects::sDelete() { if (QMessageBox::question(this, tr("Delete?"), tr("

    Are you sure you want to delete the " "selected Prospect?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM prospect WHERE (prospect_id=:prospect_id);"); delq.bindValue(":prospect_id", list()->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting"), delq, __FILE__, __LINE__)) return; } void prospects::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction("View...", this, SLOT(sView())); menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainProspectMasters")); menuItem = pMenu->addAction("Delete", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainProspectMasters")); } qt-client-4.1.0/guiclient/prospects.h000066400000000000000000000015641217451700100175760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PROSPECTS_H #define PROSPECTS_H #include "display.h" #include class prospects : public display { Q_OBJECT public: prospects(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sNew(); virtual void sView(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // PROSPECTS_H qt-client-4.1.0/guiclient/purchaseOrder.cpp000066400000000000000000001756051217451700100207250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purchaseOrder.h" #include #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "comment.h" #include "itemSourceList.h" #include "mqlutil.h" #include "poitemTableModel.h" #include "printPurchaseOrder.h" #include "purchaseOrderItem.h" #include "vendorAddressList.h" #include "taxBreakdown.h" #include "salesOrder.h" #include "workOrder.h" #include "openPurchaseOrder.h" #define cDelete 0x01 #define cClose 0x02 purchaseOrder::purchaseOrder(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { XSqlQuery purchasepurchaseOrder; setupUi(this); _so->setNameVisible(false); _so->setDescriptionVisible(false); _orderNumber->setValidator(new QIntValidator(this)); connect(_poitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sCalculateTotals())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_orderDate, SIGNAL(newDate(QDate)), this, SLOT(sHandleOrderDate())); connect(_orderNumber, SIGNAL(editingFinished()), this, SLOT(sHandleOrderNumber())); connect(_orderNumber, SIGNAL(textChanged(const QString&)), this, SLOT(sSetUserOrderNumber())); connect(_poCurrency, SIGNAL(newID(int)), this, SLOT(sCurrencyChanged())); connect(_poitem, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleDeleteButton())); connect(_purchaseOrderInformation, SIGNAL(currentChanged(int)), this, SLOT(sTabChanged(int))); connect(_qecurrency, SIGNAL(newID(int)), this, SLOT(sCurrencyChanged())); connect(_qedelete, SIGNAL(clicked()), this, SLOT(sQEDelete())); connect(_qesave, SIGNAL(clicked()), this, SLOT(sQESave())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_tax, SIGNAL(valueChanged()), this, SLOT(sCalculateTotals())); connect(_taxZone, SIGNAL(newID(int)), this, SLOT(sTaxZoneChanged())); connect(_vendaddrList, SIGNAL(clicked()), this, SLOT(sVendaddrList())); connect(_vendor, SIGNAL(newId(int)), this, SLOT(sHandleVendor(int))); connect(_vendAddr, SIGNAL(changed()), _vendaddrCode, SLOT(clear())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sHandleShipTo())); connect(_vendAddr, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _vendCntct, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); connect(_shiptoAddr, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _shiptoCntct, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); #ifndef Q_WS_MAC _vendaddrList->setMaximumWidth(25); #endif _poCurrency->setLabel(_poCurrencyLit); _poitem->addColumn(tr("#"), _whsColumn, Qt::AlignCenter,true, "poitem_linenumber"); _poitem->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter,true, "poitem_status"); _poitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); _poitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); _poitem->addColumn(tr("Orgl. Due Date"), _dateColumn, Qt::AlignRight, false, "orgl_duedate"); _poitem->addColumn(tr("Due Date Now"), _dateColumn, Qt::AlignRight, true, "poitem_duedate"); _poitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered"); _poitem->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, false, "poitem_qty_received"); _poitem->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight, false, "poitem_qty_returned"); _poitem->addColumn(tr("Vouchered"), _qtyColumn, Qt::AlignRight, false, "poitem_qty_vouchered"); _poitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "poitem_vend_uom"); _poitem->addColumn(tr("Unit Price"), _priceColumn, Qt::AlignRight, true, "poitem_unitprice"); _poitem->addColumn(tr("Ext. Price"), _moneyColumn, Qt::AlignRight, true, "extprice"); _poitem->addColumn(tr("Freight"), _moneyColumn, Qt::AlignRight, false, "poitem_freight"); _poitem->addColumn(tr("Freight Recv."), _moneyColumn, Qt::AlignRight, false, "poitem_freight_received"); _poitem->addColumn(tr("Freight Vchr."), _moneyColumn, Qt::AlignRight, false, "poitem_freight_vouchered"); _poitem->addColumn(tr("Std. Cost"), _moneyColumn, Qt::AlignRight, false, "poitem_stdcost"); _poitem->addColumn(tr("Vend. Item#"), _itemColumn, Qt::AlignCenter,false, "poitem_vend_item_number"); _poitem->addColumn(tr("Manufacturer"), _itemColumn, Qt::AlignRight, false, "poitem_manuf_name"); _poitem->addColumn(tr("Manuf. Item#"), _itemColumn, Qt::AlignRight, false, "poitem_manuf_item_number"); _poitem->addColumn(tr("Demand Type"), _itemColumn, Qt::AlignCenter,false, "demand_type"); _poitem->addColumn(tr("Order"), _itemColumn, Qt::AlignRight, false, "order_number"); _qeitem = new PoitemTableModel(this); _qeitemView->setModel(_qeitem); _qeitem->select(); purchasepurchaseOrder.exec("SELECT usr_id " "FROM usr " "WHERE (usr_username=getEffectiveXtUser());"); if(purchasepurchaseOrder.first()) _agent->setId(purchasepurchaseOrder.value("usr_id").toInt()); _captive = false; _userOrderNumber = false; _printed = false; _NumberGen = -1; setPoheadid(-1); _vendaddrid = -1; _cachedTabIndex = 0; _mode = cView; // initialize _mode to something safe - bug 3768 _printPO->setChecked(_metrics->boolean("DefaultPrintPOOnSave")); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _receivingWhseLit->hide(); _warehouse->hide(); } if (_metrics->boolean("EnableDropShipments")) _dropShip->setEnabled(FALSE); else _dropShip->hide(); _so->setReadOnly(TRUE); } void purchaseOrder::setPoheadid(const int pId) { _poheadid = pId; _qeitem->setHeadId(pId); } purchaseOrder::~purchaseOrder() { // no need to delete child widgets, Qt does it all for us } void purchaseOrder::languageChange() { retranslateUi(this); } enum SetResponse purchaseOrder::set(const ParameterList &pParams) { XSqlQuery purchaseet; XWidget::set(pParams); QVariant param; bool valid; int itemsiteid; int parentwo = -1; int parentso = -1; int prjid = -1; double qty; QDate dueDate; QString prnotes; setPoheadid(-1); int _prid = -1; param = pParams.value("pr_id", &valid); if (valid) _prid = param.toInt(); param = pParams.value("itemsite_id", &valid); if (valid) itemsiteid = param.toInt(); else itemsiteid = -1; param = pParams.value("qty", &valid); if (valid) qty = param.toDouble(); else qty = 0.0; param = pParams.value("dueDate", &valid); if (valid) dueDate = param.toDate(); param = pParams.value("mode", &valid); if (valid) { if ( (param.toString() == "new") || (param.toString() == "releasePr") ) { _mode = cNew; if (param.toString() == "releasePr") { purchaseet.prepare( "SELECT pr_itemsite_id, pr_qtyreq, pr_duedate," " CASE WHEN(pr_order_type='W') THEN pr_order_id" " ELSE -1" " END AS parentwo," " CASE WHEN(pr_order_type='S') THEN pr_order_id" " ELSE -1" " END AS parentso," " pr_prj_id, pr_releasenote " "FROM pr " "WHERE (pr_id=:pr_id);" ); purchaseet.bindValue(":pr_id", _prid); purchaseet.exec(); if (purchaseet.first()) { itemsiteid = purchaseet.value("pr_itemsite_id").toInt(); qty = purchaseet.value("pr_qtyreq").toDouble(); dueDate = purchaseet.value("pr_duedate").toDate(); parentwo = purchaseet.value("parentwo").toInt(); parentso = purchaseet.value("parentso").toInt(); prjid = purchaseet.value("pr_prj_id").toInt(); prnotes = purchaseet.value("pr_releasenote").toString(); } else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return UndefinedError; } } connect(_poitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_poitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_poitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_vendor, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); //_new->setEnabled(TRUE); int itemsrcid =-1; int openpoid =-1; if (itemsiteid != -1) { purchaseet.prepare( "SELECT itemsite_item_id, itemsrc_id, itemsrc_default " "FROM itemsite, itemsrc " "WHERE ( (itemsrc_item_id=itemsite_item_id)" " AND (itemsite_id=:itemsite_id) ) " "LIMIT 1;" ); purchaseet.bindValue(":itemsite_id", itemsiteid); purchaseet.exec(); if (!purchaseet.first()) { QMessageBox::warning(omfgThis, tr("Cannot Create P/O"), tr("

    A Purchase Order cannot be automatically " "created for this Item as there are no Item " "Sources for it. You must create one or " "more Item Sources for this Item before " "the application can automatically create " "Purchase Orders for it." ) ); return UndefinedError; } if (purchaseet.first()) { XSqlQuery itemsrcdefault; itemsrcdefault.prepare("SELECT itemsrc_id FROM itemsrc " "WHERE ((itemsrc_item_id=:item_id) AND ( itemsrc_default='TRUE')) "); itemsrcdefault.bindValue(":item_id", purchaseet.value("itemsite_item_id").toInt()); itemsrcdefault.exec(); if (itemsrcdefault.first()) { itemsrcid=(itemsrcdefault.value("itemsrc_id").toInt()); } else { ParameterList itemSourceParams; itemSourceParams.append("item_id", purchaseet.value("itemsite_item_id").toInt()); itemSourceParams.append("qty", qty); itemSourceList newdlg(omfgThis, "", TRUE); newdlg.set(itemSourceParams); itemsrcid = newdlg.exec(); if (itemsrcid == XDialog::Rejected) { deleteLater(); return UndefinedError; } } } purchaseet.prepare( "SELECT itemsrc_vend_id, vend_name " "FROM itemsrc LEFT OUTER JOIN vendinfo ON (vend_id = itemsrc_vend_id) " "WHERE (itemsrc_id=:itemsrc_id);" ); purchaseet.bindValue(":itemsrc_id", itemsrcid); purchaseet.exec(); if (!purchaseet.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return UndefinedError; } else { int vendid = purchaseet.value("itemsrc_vend_id").toInt(); QString vendname = purchaseet.value("vend_name").toString(); purchaseet.prepare( "SELECT pohead_id " "FROM pohead " "WHERE ( (pohead_status='U')" " AND (pohead_vend_id=:vend_id) ) " "ORDER BY pohead_number " "LIMIT 1;" ); purchaseet.bindValue(":vend_id", vendid); purchaseet.exec(); if (purchaseet.first()) { if(QMessageBox::question( this, tr("Purchase Order Exists"), tr("An Unreleased Purchase Order already exists for this Vendor.\n" "Would you like to use this Purchase Order?\n" "Click Yes to use the existing Purchase Order otherwise a new one will be created."), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) { ParameterList openPurchaseOrderParams; openPurchaseOrderParams.append("vend_id", vendid); openPurchaseOrderParams.append("vend_name", vendname); openPurchaseOrder newdlg(omfgThis, "", TRUE); newdlg.set(openPurchaseOrderParams); openpoid = newdlg.exec(); if (openpoid == XDialog::Rejected) { deleteLater(); return UndefinedError; } // Use an existing pohead _mode = cEdit; setPoheadid(openpoid); _orderNumber->setEnabled(FALSE); _orderDate->setEnabled(FALSE); _vendor->setReadOnly(TRUE); populate(); } else { _vendor->setId(vendid); createHeader(); } } else { // Create a new pohead for the chosen vend _vendor->setId(vendid); createHeader(); } // Start to create the new Poitem ParameterList newItemParams; newItemParams.append("mode", "new"); newItemParams.append("pohead_id", _poheadid); newItemParams.append("itemsite_id", itemsiteid); newItemParams.append("itemsrc_id", itemsrcid); if (qty > 0.0) newItemParams.append("qty", qty); if (!dueDate.isNull()) newItemParams.append("dueDate", dueDate); if (parentwo != -1) newItemParams.append("parentWo", parentwo); if (parentso != -1) newItemParams.append("parentSo", parentso); if (prjid != -1) newItemParams.append("prj_id", prjid); newItemParams.append("pr_releasenote", prnotes); purchaseOrderItem poItem(this, "", TRUE); poItem.set(newItemParams); if (poItem.exec() != XDialog::Rejected) { if(_mode == cEdit) { // check for another open window QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if (strcmp(w->metaObject()->className(), "purchaseOrder") == 0 && w != this) { purchaseOrder *other = (purchaseOrder*)w; if(_poheadid == other->_poheadid) { if(_prid != -1 && cEdit == other->_mode) { purchaseet.prepare("SELECT deletePr(:pr_id) AS _result;"); purchaseet.bindValue(":pr_id", _prid); purchaseet.exec(); omfgThis->sPurchaseRequestsUpdated(); } other->sFillList(); return UndefinedError; } } } } sFillList(); } else _prid = -1; } } else // This is a new P/O without a chosen Itemsite Line Item createHeader(); } else if (param.toString() == "edit") { _mode = cEdit; _orderNumber->setEnabled(FALSE); _orderDate->setEnabled(FALSE); _warehouse->setEnabled(FALSE); _vendor->setReadOnly(TRUE); connect(_poitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_poitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); _new->setEnabled(TRUE); } else if (param.toString() == "view") { _mode = cView; _orderNumber->setEnabled(FALSE); _orderDate->setEnabled(FALSE); _warehouse->setEnabled(FALSE); _taxZone->setEnabled(FALSE); _agent->setEnabled(FALSE); _terms->setEnabled(FALSE); _terms->setType(XComboBox::Terms); _vendor->setReadOnly(TRUE); _vendCntct->setEnabled(FALSE); _vendAddr->setEnabled(FALSE); _shiptoCntct->setEnabled(FALSE); _shiptoAddr->setEnabled(FALSE); _shipVia->setEnabled(FALSE); _fob->setEnabled(FALSE); _status->setEnabled(FALSE); _notes->setEnabled(FALSE); _new->setEnabled(FALSE); _freight->setEnabled(FALSE); _tax->setEnabled(FALSE); _vendaddrList->hide(); _purchaseOrderInformation->removeTab(_purchaseOrderInformation->indexOf(_quickEntryTab)); _poCurrency->setEnabled(FALSE); _qeitemView->setEnabled(FALSE); _qesave->setEnabled(FALSE); _qedelete->setEnabled(FALSE); _qecurrency->setEnabled(FALSE); _comments->setReadOnly(TRUE); _documents->setReadOnly(TRUE); _delete->hide(); _edit->setText(tr("&View")); _close->setText(tr("&Close")); _save->hide(); connect(_poitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_poitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); } } if (_prid != -1 && cNew != _mode) { purchaseet.prepare("SELECT deletePr(:pr_id) AS _result;"); purchaseet.bindValue(":pr_id", _prid); purchaseet.exec(); _prid = -1; omfgThis->sPurchaseRequestsUpdated(); } if(_prid != -1) _pridList.append(_prid); param = pParams.value("pohead_id", &valid); if (valid) { setPoheadid(param.toInt()); populate(); } param = pParams.value("captive", &valid); if (valid) _captive = true; return NoError; } void purchaseOrder::createHeader() { XSqlQuery purchasecreateHeader; // Determine the new PO Number if ( (_metrics->value("PONumberGeneration") == "A") || (_metrics->value("PONumberGeneration") == "O") ) { populateOrderNumber(); // Tabbed mode has problems with this behavior if(omfgThis->showTopLevel()) _vendor->setFocus(); } else if (omfgThis->showTopLevel()) _orderNumber->setFocus(); purchasecreateHeader.exec("SELECT NEXTVAL('pohead_pohead_id_seq') AS pohead_id;"); if (purchasecreateHeader.first()) setPoheadid(purchasecreateHeader.value("pohead_id").toInt()); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } // need to set at least the _order date before the INSERT _comments->setId(_poheadid); _documents->setId(_poheadid); _orderDate->setDate(omfgThis->dbDate(), true); _status->setCurrentIndex(0); _vendor->setShowInactive(false); purchasecreateHeader.prepare( "INSERT INTO pohead " "( pohead_id, pohead_number, pohead_status," " pohead_agent_username, pohead_vend_id, pohead_taxzone_id," " pohead_orderdate, pohead_curr_id, pohead_saved) " "VALUES " "( :pohead_id, :pohead_number, 'U'," " :pohead_agent_username, :pohead_vend_id, :pohead_taxzone_id, " " :pohead_orderdate, :pohead_curr_id, false );" ); purchasecreateHeader.bindValue(":pohead_id", _poheadid); purchasecreateHeader.bindValue(":pohead_agent_username", _agent->currentText()); purchasecreateHeader.bindValue(":pohead_number", _orderNumber->text().isEmpty() ? "TEMP" + QString(0 - _poheadid) : _orderNumber->text()); if (_vendor->isValid()) purchasecreateHeader.bindValue(":pohead_vend_id", _vendor->id()); if (_taxZone->isValid()) purchasecreateHeader.bindValue(":pohead_taxzone_id", _taxZone->id()); purchasecreateHeader.bindValue(":pohead_orderdate", _orderDate->date()); purchasecreateHeader.bindValue(":pohead_curr_id", _poCurrency->id()); purchasecreateHeader.exec(); if (purchasecreateHeader.lastError().type() != QSqlError::NoError) systemError(this, purchasecreateHeader.lastError().databaseText(), __FILE__, __LINE__); // Populate Ship To contact and addresses for the Receiving Site sHandleShipTo(); } void purchaseOrder::populate() { XSqlQuery po; po.prepare( "SELECT pohead.*, COALESCE(pohead_warehous_id, -1) AS warehous_id," " COALESCE(pohead_cohead_id, -1) AS cohead_id," " CASE WHEN (pohead_status='U') THEN 0" " WHEN (pohead_status='O') THEN 1" " WHEN (pohead_status='C') THEN 2" " END AS status," " COALESCE(pohead_terms_id, -1) AS terms_id," " COALESCE(pohead_vend_id, -1) AS vend_id," " COALESCE(vendaddr_id, -1) AS vendaddrid," " vendaddr_code " "FROM pohead JOIN vendinfo ON (pohead_vend_id=vend_id)" " LEFT OUTER JOIN vendaddrinfo ON (pohead_vendaddr_id=vendaddr_id)" " LEFT OUTER JOIN cohead ON (pohead_cohead_id=cohead_id) " "WHERE (pohead_id=:pohead_id);" ); po.bindValue(":pohead_id", _poheadid); po.exec(); if (po.first()) { _orderNumber->setText(po.value("pohead_number")); _warehouse->setId(po.value("warehous_id").toInt()); _orderDate->setDate(po.value("pohead_orderdate").toDate(), true); if(po.value("pohead_released").isValid()) _releaseDate->setDate(po.value("pohead_released").toDate(), true); _agent->setText(po.value("pohead_agent_username").toString()); _status->setCurrentIndex(po.value("status").toInt()); _printed = po.value("pohead_printed").toBool(); _terms->setId(po.value("terms_id").toInt()); _shipVia->setText(po.value("pohead_shipvia")); _fob->setText(po.value("pohead_fob")); _notes->setText(po.value("pohead_comments").toString()); _so->setId(po.value("cohead_id").toInt()); if ((po.value("cohead_id").toInt())!=-1) { _dropShip->setEnabled(TRUE); _dropShip->setChecked(po.value("pohead_dropship").toBool()); } else { _dropShip->setChecked(FALSE); _dropShip->setEnabled(FALSE); } _vendaddrid = po.value("vendaddrid").toInt(); _vendCntct->setId(po.value("pohead_vend_cntct_id").toInt()); _vendCntct->setHonorific(po.value("pohead_vend_cntct_honorific").toString()); _vendCntct->setFirst(po.value("pohead_vend_cntct_first_name").toString()); _vendCntct->setMiddle(po.value("pohead_vend_cntct_middle").toString()); _vendCntct->setLast(po.value("pohead_vend_cntct_last_name").toString()); _vendCntct->setSuffix(po.value("pohead_vend_cntct_suffix").toString()); _vendCntct->setPhone(po.value("pohead_vend_cntct_phone").toString()); _vendCntct->setTitle(po.value("pohead_vend_cntct_title").toString()); _vendCntct->setFax(po.value("pohead_vend_cntct_fax").toString()); _vendCntct->setEmailAddress(po.value("pohead_vend_cntct_email").toString()); _shiptoCntct->setId(po.value("pohead_shipto_cntct_id").toInt()); _shiptoCntct->setHonorific(po.value("pohead_shipto_cntct_honorific").toString()); _shiptoCntct->setFirst(po.value("pohead_shipto_cntct_first_name").toString()); _shiptoCntct->setMiddle(po.value("pohead_shipto_cntct_middle").toString()); _shiptoCntct->setLast(po.value("pohead_shipto_cntct_last_name").toString()); _shiptoCntct->setSuffix(po.value("pohead_shipto_cntct_suffix").toString()); _shiptoCntct->setPhone(po.value("pohead_shipto_cntct_phone").toString()); _shiptoCntct->setTitle(po.value("pohead_shipto_cntct_title").toString()); _shiptoCntct->setFax(po.value("pohead_shipto_cntct_fax").toString()); _shiptoCntct->setEmailAddress(po.value("pohead_shipto_cntct_email").toString()); disconnect(_vendAddr, SIGNAL(changed()), _vendaddrCode, SLOT(clear())); if (_vendaddrid == -1) _vendaddrCode->setText(tr("Main")); else _vendaddrCode->setText(po.value("vendaddr_code")); _vendAddr->setId(_vendaddrid); _vendAddr->setLine1(po.value("pohead_vendaddress1").toString()); _vendAddr->setLine2(po.value("pohead_vendaddress2").toString()); _vendAddr->setLine3(po.value("pohead_vendaddress3").toString()); _vendAddr->setCity(po.value("pohead_vendcity").toString()); _vendAddr->setState(po.value("pohead_vendstate").toString()); _vendAddr->setPostalCode(po.value("pohead_vendzipcode").toString()); _vendAddr->setCountry(po.value("pohead_vendcountry").toString()); connect(_vendAddr, SIGNAL(changed()), _vendaddrCode, SLOT(clear())); _shiptoAddr->setId(po.value("pohead_shiptoaddress_id").toInt()); _shiptoAddr->setLine1(po.value("pohead_shiptoaddress1").toString()); _shiptoAddr->setLine2(po.value("pohead_shiptoaddress2").toString()); _shiptoAddr->setLine3(po.value("pohead_shiptoaddress3").toString()); _shiptoAddr->setCity(po.value("pohead_shiptocity").toString()); _shiptoAddr->setState(po.value("pohead_shiptostate").toString()); _shiptoAddr->setPostalCode(po.value("pohead_shiptozipcode").toString()); _shiptoAddr->setCountry(po.value("pohead_shiptocountry").toString()); _comments->setId(_poheadid); _documents->setId(_poheadid); _vendor->setId(po.value("vend_id").toInt()); _taxZone->setId(po.value("pohead_taxzone_id").toInt()); _poCurrency->setId(po.value("pohead_curr_id").toInt()); _freight->setLocalValue(po.value("pohead_freight").toDouble()); } sFillList(); } void purchaseOrder::sSave() { XSqlQuery purchaseSave; _save->setFocus(); if(_orderNumber->hasFocus()) sHandleOrderNumber(); QList errors; errors << GuiErrorCheck(_orderNumber->text().isEmpty(), _orderNumber, tr("You may not save this Purchase Order until you have entered a valid Purchase Order Number.")) << GuiErrorCheck(!_vendor->isValid(), _vendor, tr("You may not save this Purchase Order until you have selected a Vendor." )) << GuiErrorCheck(_metrics->boolean("RequirePOTax") && !_taxZone->isValid(), _taxZone, tr("You may not save this Purchase Order until you have selected a Tax Zone." )) ; if (_qeitem->isDirty() && ! sQESave()) return; purchaseSave.prepare( "SELECT poitem_id " "FROM poitem " "WHERE (poitem_pohead_id=:pohead_id) " "LIMIT 1;" ); purchaseSave.bindValue(":pohead_id", _poheadid); purchaseSave.exec(); if (!purchaseSave.first()) { errors << GuiErrorCheck(true, _new, tr( "You may not save this Purchase Order until you have created at least one Line Item for it." )); } purchaseSave.prepare( "SELECT pohead_status " "FROM pohead " "WHERE (pohead_id=:pohead_id);" ); purchaseSave.bindValue(":pohead_id", _poheadid); purchaseSave.exec(); if (purchaseSave.first()) { if ((purchaseSave.value("pohead_status") == "O") && (_status->currentIndex() == 0)) { errors << GuiErrorCheck(true, _status, tr( "This Purchase Order has been released. You may not set its Status back to 'Unreleased'." )); } } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Purchase Order"), errors)) return; purchaseSave.prepare( "UPDATE pohead " "SET pohead_warehous_id=:pohead_warehous_id, pohead_orderdate=:pohead_orderdate," " pohead_shipvia=:pohead_shipvia, pohead_taxzone_id=:pohead_taxzone_id," " pohead_freight=:pohead_freight," " pohead_fob=:pohead_fob, pohead_agent_username=:pohead_agent_username," " pohead_terms_id=:pohead_terms_id," " pohead_vendaddr_id=:pohead_vendaddr_id," " pohead_comments=:pohead_comments, " " pohead_curr_id=:pohead_curr_id," " pohead_status=:pohead_status," " pohead_saved=true," " pohead_vend_cntct_id=:pohead_vend_cntct_id," " pohead_vend_cntct_honorific=:pohead_vend_cntct_honorific," " pohead_vend_cntct_first_name=:pohead_vend_cntct_first_name," " pohead_vend_cntct_middle=:pohead_vend_cntct_middle," " pohead_vend_cntct_last_name=:pohead_vend_cntct_last_name," " pohead_vend_cntct_suffix=:pohead_vend_cntct_suffix," " pohead_vend_cntct_phone=:pohead_vend_cntct_phone," " pohead_vend_cntct_title=:pohead_vend_cntct_title," " pohead_vend_cntct_fax=:pohead_vend_cntct_fax," " pohead_vend_cntct_email=:pohead_vend_cntct_email," " pohead_vendaddress1=:pohead_vendaddress1," " pohead_vendaddress2=:pohead_vendaddress2," " pohead_vendaddress3=:pohead_vendaddress3," " pohead_vendcity=:pohead_vendcity," " pohead_vendstate=:pohead_vendstate," " pohead_vendzipcode=:pohead_vendzipcode," " pohead_vendcountry=:pohead_vendcountry," " pohead_shipto_cntct_id=:pohead_shipto_cntct_id," " pohead_shipto_cntct_honorific=:pohead_shipto_cntct_honorific," " pohead_shipto_cntct_first_name=:pohead_shipto_cntct_first_name," " pohead_shipto_cntct_middle=:pohead_shipto_cntct_middle," " pohead_shipto_cntct_last_name=:pohead_shipto_cntct_last_name," " pohead_shipto_cntct_suffix=:pohead_shipto_cntct_suffix," " pohead_shipto_cntct_phone=:pohead_shipto_cntct_phone," " pohead_shipto_cntct_title=:pohead_shipto_cntct_title," " pohead_shipto_cntct_fax=:pohead_shipto_cntct_fax," " pohead_shipto_cntct_email=:pohead_shipto_cntct_email," " pohead_shiptoaddress_id=:pohead_shiptoaddress_id," " pohead_shiptoaddress1=:pohead_shiptoaddress1," " pohead_shiptoaddress2=:pohead_shiptoaddress2," " pohead_shiptoaddress3=:pohead_shiptoaddress3," " pohead_shiptocity=:pohead_shiptocity," " pohead_shiptostate=:pohead_shiptostate," " pohead_shiptozipcode=:pohead_shiptozipcode," " pohead_shiptocountry=:pohead_shiptocountry," " pohead_dropship=:pohead_dropship " "WHERE (pohead_id=:pohead_id);" ); purchaseSave.bindValue(":pohead_id", _poheadid); if (_warehouse->isValid()) purchaseSave.bindValue(":pohead_warehous_id", _warehouse->id()); if (_taxZone->id() != -1) purchaseSave.bindValue(":pohead_taxzone_id", _taxZone->id()); purchaseSave.bindValue(":pohead_orderdate", _orderDate->date()); purchaseSave.bindValue(":pohead_shipvia", _shipVia->currentText()); purchaseSave.bindValue(":pohead_fob", _fob->text()); purchaseSave.bindValue(":pohead_agent_username", _agent->currentText()); if (_terms->isValid()) purchaseSave.bindValue(":pohead_terms_id", _terms->id()); if (_vendaddrid != -1) purchaseSave.bindValue(":pohead_vendaddr_id", _vendaddrid); purchaseSave.bindValue(":pohead_comments", _notes->toPlainText()); if (_vendCntct->isValid()) purchaseSave.bindValue(":pohead_vend_cntct_id", _vendCntct->id()); purchaseSave.bindValue(":pohead_vend_cntct_honorific", _vendCntct->honorific()); purchaseSave.bindValue(":pohead_vend_cntct_first_name", _vendCntct->first()); purchaseSave.bindValue(":pohead_vend_cntct_middle", _vendCntct->middle()); purchaseSave.bindValue(":pohead_vend_cntct_last_name", _vendCntct->last()); purchaseSave.bindValue(":pohead_vend_cntct_suffix", _vendCntct->suffix()); purchaseSave.bindValue(":pohead_vend_cntct_phone", _vendCntct->phone()); purchaseSave.bindValue(":pohead_vend_cntct_title", _vendCntct->title()); purchaseSave.bindValue(":pohead_vend_cntct_fax", _vendCntct->fax()); purchaseSave.bindValue(":pohead_vend_cntct_email", _vendCntct->emailAddress()); purchaseSave.bindValue(":pohead_vendaddress1", _vendAddr->line1()); purchaseSave.bindValue(":pohead_vendaddress2", _vendAddr->line2()); purchaseSave.bindValue(":pohead_vendaddress3", _vendAddr->line3()); purchaseSave.bindValue(":pohead_vendcity", _vendAddr->city()); purchaseSave.bindValue(":pohead_vendstate", _vendAddr->state()); purchaseSave.bindValue(":pohead_vendzipcode", _vendAddr->postalCode()); purchaseSave.bindValue(":pohead_vendcountry", _vendAddr->country()); if (_shiptoCntct->isValid()) purchaseSave.bindValue(":pohead_shipto_cntct_id", _shiptoCntct->id()); purchaseSave.bindValue(":pohead_shipto_cntct_honorific", _shiptoCntct->honorific()); purchaseSave.bindValue(":pohead_shipto_cntct_first_name", _shiptoCntct->first()); purchaseSave.bindValue(":pohead_shipto_cntct_middle", _shiptoCntct->middle()); purchaseSave.bindValue(":pohead_shipto_cntct_last_name", _shiptoCntct->last()); purchaseSave.bindValue(":pohead_shipto_cntct_suffix", _shiptoCntct->suffix()); purchaseSave.bindValue(":pohead_shipto_cntct_phone", _shiptoCntct->phone()); purchaseSave.bindValue(":pohead_shipto_cntct_title", _shiptoCntct->title()); purchaseSave.bindValue(":pohead_shipto_cntct_fax", _shiptoCntct->fax()); purchaseSave.bindValue(":pohead_shipto_cntct_email", _shiptoCntct->emailAddress()); if (_shiptoAddr->isValid()) purchaseSave.bindValue(":pohead_shiptoaddress_id", _shiptoAddr->id()); purchaseSave.bindValue(":pohead_shiptoaddress1", _shiptoAddr->line1()); purchaseSave.bindValue(":pohead_shiptoaddress2", _shiptoAddr->line2()); purchaseSave.bindValue(":pohead_shiptoaddress3", _shiptoAddr->line3()); purchaseSave.bindValue(":pohead_shiptocity", _shiptoAddr->city()); purchaseSave.bindValue(":pohead_shiptostate", _shiptoAddr->state()); purchaseSave.bindValue(":pohead_shiptozipcode", _shiptoAddr->postalCode()); purchaseSave.bindValue(":pohead_shiptocountry", _shiptoAddr->country()); purchaseSave.bindValue(":pohead_freight", _freight->localValue()); purchaseSave.bindValue(":pohead_curr_id", _poCurrency->id()); if (_status->currentIndex() == 0) purchaseSave.bindValue(":pohead_status", "U"); else if (_status->currentIndex() == 1) purchaseSave.bindValue(":pohead_status", "O"); else if (_status->currentIndex() == 2) purchaseSave.bindValue(":pohead_status", "C"); purchaseSave.bindValue(":pohead_dropship", QVariant(_dropShip->isChecked())); purchaseSave.exec(); omfgThis->sPurchaseOrdersUpdated(_poheadid, TRUE); if (!_pridList.isEmpty()) { purchaseSave.prepare("SELECT deletePr(:pr_id) AS _result;"); for(int i = 0; i < _pridList.size(); ++i) { purchaseSave.bindValue(":pr_id", _pridList.at(i)); purchaseSave.exec(); } omfgThis->sPurchaseRequestsUpdated(); } if (_printPO->isChecked() && (_status->currentIndex() != 2)) // don't print closed { ParameterList params; params.append("pohead_id", _poheadid); printPurchaseOrder newdlgP(this, "", true); newdlgP.set(params); newdlgP.exec(); } emit saved(_poheadid); if (_mode == cNew && !_captive) { _purchaseOrderInformation->setCurrentIndex(0); _agent->setText(omfgThis->username()); _terms->setId(-1); _vendor->setReadOnly(false); _vendor->setId(-1); _taxZone->setId(-1); _orderNumber->clear(); _orderDate->clear(); _shipVia->clear(); _status->setCurrentIndex(0); _fob->clear(); _notes->clear(); _tax->clear(); _freight->clear(); _total->clear(); _poitem->clear(); _poCurrency->setEnabled(true); _qecurrency->setEnabled(true); _qeitem->removeRows(0, _qeitem->rowCount()); _vendaddrCode->clear(); _vendCntct->clear(); _vendAddr->clear(); _shiptoCntct->clear(); _shiptoAddr->clear(); createHeader(); _subtotal->clear(); } else { close(); } } void purchaseOrder::sNew() { if (!saveDetail()) return; ParameterList params; params.append("mode", "new"); params.append("pohead_id", _poheadid); params.append("vend_id", _vendor->id()); params.append("warehous_id", _warehouse->id()); params.append("dropship", QVariant(_dropShip->isChecked())); purchaseOrderItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillList(); _vendor->setReadOnly(true); } } void purchaseOrder::sEdit() { if (!saveDetail()) return; ParameterList params; params.append("pohead_id", _poheadid); params.append("vend_id", _vendor->id()); params.append("warehous_id", _warehouse->id()); params.append("dropship", QVariant(_dropShip->isChecked())); params.append("poitem_id", _poitem->id()); if (_mode == cEdit || _mode == cNew) params.append("mode", "edit"); else if (_mode == cView) params.append("mode", "view"); purchaseOrderItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void purchaseOrder::sDelete() { XSqlQuery purchaseDelete; if (_deleteMode == cDelete) { if (QMessageBox::question(this, tr("Delete Purchase Order Item?"), tr("

    Are you sure you want to delete this " "Purchase Order Line Item?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; purchaseDelete.prepare( "DELETE FROM poitem " "WHERE (poitem_id=:poitem_id);" ); purchaseDelete.bindValue(":poitem_id", _poitem->id()); purchaseDelete.exec(); if (purchaseDelete.lastError().type() != QSqlError::NoError) { systemError(this, purchaseDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } else { if (QMessageBox::question(this, tr("Close Purchase Order Item?"), tr("

    Are you sure you want to close this " "Purchase Order Line Item?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; purchaseDelete.prepare( "UPDATE poitem SET poitem_status='C' " "WHERE (poitem_id=:poitem_id);" ); purchaseDelete.bindValue(":poitem_id", _poitem->id()); purchaseDelete.exec(); if (purchaseDelete.lastError().type() != QSqlError::NoError) { systemError(this, purchaseDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } void purchaseOrder::sVendaddrList() { XSqlQuery purchaseVendaddrList; ParameterList params; params.append("vend_id", _vendor->id()); vendorAddressList newdlg(this, "", TRUE); newdlg.set(params); int vendaddrid; if ((vendaddrid = newdlg.exec()) != XDialog::Rejected) { if (vendaddrid != -1) { purchaseVendaddrList.prepare( "SELECT vendaddr_code AS code, " " vendaddr_name AS name, " " addr_line1, addr_line2, addr_line3, " " addr_city, addr_state, addr_postalcode, addr_country " "FROM vendaddrinfo " "LEFT OUTER JOIN addr ON (vendaddr_addr_id=addr_id) " "WHERE (vendaddr_id=:vendaddr_id);" ); purchaseVendaddrList.bindValue(":vendaddr_id", vendaddrid); } else { purchaseVendaddrList.prepare( "SELECT 'Main' AS code, " " vend_name AS name, " " addr_line1, addr_line2, addr_line3, " " addr_city, addr_state, addr_postalcode, addr_country " "FROM vendinfo " "LEFT OUTER JOIN addr ON (vend_addr_id=addr_id) " "WHERE (vend_id=:vend_id);" ); purchaseVendaddrList.bindValue(":vend_id", _vendor->id()); } purchaseVendaddrList.exec(); if (purchaseVendaddrList.first()) { _vendaddrid = vendaddrid; disconnect(_vendAddr, SIGNAL(changed()), _vendaddrCode, SLOT(clear())); _vendaddrCode->setText(purchaseVendaddrList.value("code").toString()); _vendAddr->setLine1(purchaseVendaddrList.value("addr_line1").toString()); _vendAddr->setLine2(purchaseVendaddrList.value("addr_line2").toString()); _vendAddr->setLine3(purchaseVendaddrList.value("addr_line3").toString()); _vendAddr->setCity(purchaseVendaddrList.value("addr_city").toString()); _vendAddr->setState(purchaseVendaddrList.value("addr_state").toString()); _vendAddr->setPostalCode(purchaseVendaddrList.value("addr_postalcode").toString()); _vendAddr->setCountry(purchaseVendaddrList.value("addr_country").toString()); connect(_vendAddr, SIGNAL(changed()), _vendaddrCode, SLOT(clear())); } } } void purchaseOrder::sHandleDeleteButton() { if ( (_mode == cNew) || (_mode == cEdit)) { QTreeWidgetItem *selected = _poitem->currentItem(); if (selected == 0) _delete->setEnabled(FALSE); else if (_poitem->currentItem()->rawValue("poitem_status") == "U") { _deleteMode = cDelete; _delete->setEnabled(TRUE); _delete->setText(tr("&Delete")); } else { _deleteMode = cClose; _delete->setEnabled(TRUE); _delete->setText(tr("C&lose")); } } } void purchaseOrder::sHandleVendor(int pVendid) { XSqlQuery purchaseHandleVendor; if ( (pVendid != -1) && (_mode == cNew) ) { purchaseHandleVendor.prepare( "UPDATE pohead " "SET pohead_warehous_id=:pohead_warehous_id, " " pohead_vend_id=:pohead_vend_id, pohead_curr_id=:pohead_curr_id " "WHERE (pohead_id=:pohead_id);" ); if (_warehouse->isValid()) purchaseHandleVendor.bindValue(":pohead_warehous_id", _warehouse->id()); purchaseHandleVendor.bindValue(":pohead_vend_id", pVendid); purchaseHandleVendor.bindValue(":pohead_id", _poheadid); purchaseHandleVendor.bindValue(":pohead_curr_id", _poCurrency->id()); purchaseHandleVendor.exec(); if (purchaseHandleVendor.lastError().type() != QSqlError::NoError) { systemError(this, purchaseHandleVendor.lastError().text(), __FILE__, __LINE__); return; } XSqlQuery vq; vq.prepare("SELECT addr.*, cntct.*, vend_terms_id, vend_curr_id," " vend_fobsource, vend_fob, vend_shipvia," " vend_name," " COALESCE(vend_addr_id, -1) AS vendaddrid," " COALESCE(vend_taxzone_id, -1) AS vendtaxzoneid," " crmacct_id" " FROM vendinfo" " LEFT OUTER JOIN addr ON (vend_addr_id=addr_id)" " LEFT OUTER JOIN crmacct ON (vend_id=crmacct_vend_id)" " LEFT OUTER JOIN cntct ON (vend_cntct1_id=cntct_id) " "WHERE (vend_id=:vend_id) " "LIMIT 1;" ); vq.bindValue(":vend_id", pVendid); vq.exec(); if (vq.first()) { _taxZone->setId(vq.value("vendtaxzoneid").toInt()); _poCurrency->setId(vq.value("vend_curr_id").toInt()); _terms->setId(vq.value("vend_terms_id").toInt()); _shipVia->setText(vq.value("vend_shipvia")); if (vq.value("vend_fobsource").toString() == "V") { _useWarehouseFOB = FALSE; _fob->setText(vq.value("vend_fob")); } else { _useWarehouseFOB = TRUE; _fob->setText(tr("Destination")); } if (vq.value("cntct_id").toInt()) { _vendCntct->setId(vq.value("cntct_id").toInt()); _vendCntct->setHonorific(vq.value("cntct_honorific").toString()); _vendCntct->setFirst(vq.value("cntct_first_name").toString()); _vendCntct->setMiddle(vq.value("cntct_middle").toString()); _vendCntct->setLast(vq.value("cntct_last_name").toString()); _vendCntct->setSuffix(vq.value("cntct_suffix").toString()); _vendCntct->setPhone(vq.value("cntct_phone").toString()); _vendCntct->setTitle(vq.value("cntct_title").toString()); _vendCntct->setFax(vq.value("cntct_fax").toString()); _vendCntct->setEmailAddress(vq.value("cntct_email").toString()); } if (vq.value("addr_id").toInt()) { _vendaddrid = -1; disconnect(_vendAddr, SIGNAL(changed()), _vendaddrCode, SLOT(clear())); _vendaddrCode->setText(tr("Main")); _vendAddr->setId(vq.value("addr_id").toInt()); _vendAddr->setLine1(vq.value("addr_line1").toString()); _vendAddr->setLine2(vq.value("addr_line2").toString()); _vendAddr->setLine3(vq.value("addr_line3").toString()); _vendAddr->setCity(vq.value("addr_city").toString()); _vendAddr->setState(vq.value("addr_state").toString()); _vendAddr->setPostalCode(vq.value("addr_postalcode").toString()); _vendAddr->setCountry(vq.value("addr_country").toString()); connect(_vendAddr, SIGNAL(changed()), _vendaddrCode, SLOT(clear())); } if (vq.value("crmacct_id").toInt()) _vendCntct->setSearchAcct(vq.value("crmacct_id").toInt()); } else if (vq.lastError().type() != QSqlError::NoError) { systemError(this, vq.lastError().text(), __FILE__, __LINE__); return; } _qeitem->setHeadId(_poheadid); } } void purchaseOrder::sFillList() { XSqlQuery purchaseFillList; MetaSQLQuery mql = mqlLoad("poItems", "list"); ParameterList params; params.append("pohead_id", _poheadid); params.append("closed", tr("Closed")); params.append("unposted", tr("Unposted")); params.append("partial", tr("Partial")); params.append("received", tr("Received")); params.append("open", tr("Open")); params.append("so", tr("SO")); params.append("wo", tr("WO")); purchaseFillList = mql.toQuery(params); _poitem->populate(purchaseFillList); if (purchaseFillList.lastError().type() != QSqlError::NoError) { systemError(this, purchaseFillList.lastError().databaseText(), __FILE__, __LINE__); return; } sCalculateTax(); sCalculateTotals(); _poCurrency->setEnabled(_poitem->topLevelItemCount() == 0); _qecurrency->setEnabled(_poitem->topLevelItemCount() == 0); _qeitem->select(); } void purchaseOrder::sCalculateTotals() { XSqlQuery purchaseCalculateTotals; purchaseCalculateTotals.prepare( "SELECT SUM(poitem_qty_ordered * poitem_unitprice) AS total," " SUM(poitem_qty_ordered * poitem_unitprice) AS f_total," " SUM(poitem_freight) AS freightsub " "FROM poitem " "WHERE (poitem_pohead_id=:pohead_id);" ); purchaseCalculateTotals.bindValue(":pohead_id", _poheadid); purchaseCalculateTotals.exec(); if (purchaseCalculateTotals.first()) { _subtotal->setLocalValue(purchaseCalculateTotals.value("f_total").toDouble()); _totalFreight->setLocalValue(purchaseCalculateTotals.value("freightsub").toDouble() + _freight->localValue()); _total->setLocalValue(purchaseCalculateTotals.value("total").toDouble() + _tax->localValue() + purchaseCalculateTotals.value("freightsub").toDouble() + _freight->localValue()); } } void purchaseOrder::sSetUserOrderNumber() { _userOrderNumber = TRUE; } void purchaseOrder::sHandleOrderNumber() { XSqlQuery purchaseHandleOrderNumber; if(-1 != _NumberGen && _orderNumber->text().toInt() != _NumberGen) sReleaseNumber(); if (_orderNumber->text().length() == 0) { if ( (_metrics->value("PONumberGeneration") == "A") || (_metrics->value("PONumberGeneration") == "O") ) populateOrderNumber(); else return; } else if (_userOrderNumber) { purchaseHandleOrderNumber.prepare( "SELECT pohead_id " "FROM pohead " "WHERE (pohead_number=:pohead_number);" ); purchaseHandleOrderNumber.bindValue(":pohead_number", _orderNumber->text()); purchaseHandleOrderNumber.exec(); if (purchaseHandleOrderNumber.first()) { int poheadid = purchaseHandleOrderNumber.value("pohead_id").toInt(); if(poheadid == _poheadid) return; if(cNew != _mode || !_pridList.isEmpty()) { QMessageBox::warning( this, tr("Enter Purchase Order #"), tr("The Purchase Order number you entered is already in use. Please enter a different number.") ); _orderNumber->clear(); _orderNumber->setFocus(); return; } purchaseHandleOrderNumber.prepare( "DELETE FROM pohead " "WHERE (pohead_id=:pohead_id);" "DELETE FROM poitem " "WHERE (poitem_pohead_id=:pohead_id);" "SELECT releasePoNumber(:orderNumber);" ); purchaseHandleOrderNumber.bindValue(":pohead_id", _poheadid); purchaseHandleOrderNumber.bindValue(":orderNumber", _orderNumber->text().toInt()); purchaseHandleOrderNumber.exec(); if (purchaseHandleOrderNumber.lastError().type() != QSqlError::NoError) systemError(this, purchaseHandleOrderNumber.lastError().databaseText(), __FILE__, __LINE__); _mode = cEdit; setPoheadid(poheadid); populate(); _orderNumber->setEnabled(FALSE); _orderDate->setEnabled(FALSE); _vendor->setReadOnly(TRUE); } } if(_poheadid != -1) { purchaseHandleOrderNumber.prepare("UPDATE pohead" " SET pohead_number=:pohead_number" " WHERE (pohead_id=:pohead_id);"); purchaseHandleOrderNumber.bindValue(":pohead_id", _poheadid); purchaseHandleOrderNumber.bindValue(":pohead_number", _orderNumber->text()); purchaseHandleOrderNumber.exec(); if (purchaseHandleOrderNumber.lastError().type() != QSqlError::NoError) systemError(this, purchaseHandleOrderNumber.lastError().databaseText(), __FILE__, __LINE__); } } void purchaseOrder::populateOrderNumber() { XSqlQuery on; on.exec("SELECT fetchPoNumber() AS ponumber;"); if (on.first()) { _orderNumber->setText(on.value("ponumber")); _NumberGen = on.value("ponumber").toInt(); } else if (on.lastError().type() != QSqlError::NoError) { systemError(this, on.lastError().databaseText(), __FILE__, __LINE__); return; } if (_metrics->value("PONumberGeneration") == "A") _orderNumber->setEnabled(FALSE); } void purchaseOrder::closeEvent(QCloseEvent *pEvent) { XSqlQuery purchasecloseEvent; if ((_mode == cNew) && (_poheadid != -1) && !_captive) { if (_poitem->topLevelItemCount() > 0 && QMessageBox::question(this, tr("Delete Purchase Order?"), tr("

    Are you sure you want to delete this " "Purchase Order and all of its associated " "Line Items?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { pEvent->ignore(); return; } purchasecloseEvent.prepare( "DELETE FROM pohead " "WHERE (pohead_id=:pohead_id);" "DELETE FROM poitem " "WHERE (poitem_pohead_id=:pohead_id);" ); purchasecloseEvent.bindValue(":pohead_id", _poheadid); purchasecloseEvent.exec(); if (purchasecloseEvent.lastError().type() != QSqlError::NoError) systemError(this, purchasecloseEvent.lastError().databaseText(), __FILE__, __LINE__); sReleaseNumber(); } else if (_mode == cEdit && _poitem->topLevelItemCount() == 0) { if (QMessageBox::question(this, tr("Delete Purchase Order?"), tr("

    This Purchase Order does not have any line items. " "Are you sure you want to delete this Purchase Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { pEvent->ignore(); return; } purchasecloseEvent.prepare( "DELETE FROM pohead " "WHERE (pohead_id=:pohead_id);" ); purchasecloseEvent.bindValue(":pohead_id", _poheadid); purchasecloseEvent.exec(); if (purchasecloseEvent.lastError().type() != QSqlError::NoError) systemError(this, purchasecloseEvent.lastError().databaseText(), __FILE__, __LINE__); } // TODO: if sQeSave == false then find a way to return control to the user if (_qeitem->isDirty()) { // it shouldn't even ask to save these if the screen is canceled for new PO if(_mode == cEdit) { if (QMessageBox::question(this, tr("Save Quick Entry Data?"), tr("Do you want to save your Quick Entry changes?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) sQESave(); } } XWidget::closeEvent(pEvent); } void purchaseOrder::sReleaseNumber() { XSqlQuery purchaseReleaseNumber; if(-1 != _NumberGen) { purchaseReleaseNumber.prepare("SELECT releasePoNumber(:number);" ); purchaseReleaseNumber.bindValue(":number", _NumberGen); purchaseReleaseNumber.exec(); if (purchaseReleaseNumber.lastError().type() != QSqlError::NoError) systemError(this, purchaseReleaseNumber.lastError().databaseText(), __FILE__, __LINE__); _NumberGen = -1; } } bool purchaseOrder::sQESave() { _qesave->setFocus(); if (! _qeitem->submitAll()) { // no need to report an error here as it will have already been reported // by the poitemTableModel (where it originated) return false; } sFillList(); return true; } void purchaseOrder::sQEDelete() { if (! _qeitem->removeRow(_qeitemView->currentIndex().row())) { systemError(this, tr("Removing row from view failed"), __FILE__, __LINE__); return; } } void purchaseOrder::sCurrencyChanged() { // The user can only set the QE currency from the QE tab if (_purchaseOrderInformation->currentWidget()->isAncestorOf(_qecurrency) && _poCurrency->id() != _qecurrency->id()) _poCurrency->setId(_qecurrency->id()); else _qecurrency->setId(_poCurrency->id()); static_cast(_qeitemView->model())->setCurrId(_poCurrency->id()); } void purchaseOrder::sTabChanged(int pIndex) { if (pIndex != _cachedTabIndex && _cachedTabIndex == _purchaseOrderInformation->indexOf(_quickEntryTab) && _qeitem->isDirty()) { if (QMessageBox::question(this, tr("Save Quick Entry Data?"), tr("Do you want to save your Quick Entry changes?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) if (! sQESave()) { _purchaseOrderInformation->setCurrentIndex(_cachedTabIndex); return; } } _cachedTabIndex = pIndex; } void purchaseOrder::sHandleOrderDate() { static_cast(_qeitemView->model())->setTransDate(_orderDate->date()); } void purchaseOrder::sTaxZoneChanged() { if (_poheadid == -1 ) { XSqlQuery taxq; taxq.prepare("UPDATE pohead SET " " pohead_taxzone_id=:taxzone_id " "WHERE (pohead_id=:pohead_id) "); if (_taxZone->isValid()) taxq.bindValue(":taxzone_id", _taxZone->id()); taxq.bindValue(":pohead_id", _poheadid); taxq.bindValue(":freight", _freight->localValue()); taxq.exec(); if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } sCalculateTax(); } } void purchaseOrder::sCalculateTax() { XSqlQuery taxq; taxq.prepare( "SELECT SUM(tax) AS tax " "FROM (" "SELECT ROUND(SUM(taxdetail_tax),2) AS tax " "FROM tax " " JOIN calculateTaxDetailSummary('PO', :pohead_id, 'T') ON (taxdetail_tax_id=tax_id)" "GROUP BY tax_id) AS data;" ); taxq.bindValue(":pohead_id", _poheadid); taxq.exec(); if (taxq.first()) _tax->setLocalValue(taxq.value("tax").toDouble()); else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } } void purchaseOrder::sTaxDetail() { if (!saveDetail()) return; ParameterList params; params.append("order_id", _poheadid); params.append("order_type", "PO"); // mode => view since there are no fields to hold modified tax data if (_mode == cView) params.append("mode", "view"); taxBreakdown newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) populate(); } bool purchaseOrder::saveDetail() { if (_mode == cView) return true; QList errors; errors << GuiErrorCheck(_metrics->boolean("RequirePOTax") && !_taxZone->isValid(), _taxZone, tr("You may not save this Purchase Order until you have selected a Tax Zone." )); if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Purchase Order"), errors)) return false; XSqlQuery taxq; taxq.prepare( "UPDATE pohead " "SET pohead_warehous_id=:pohead_warehous_id," " pohead_vend_id=:pohead_vend_id," " pohead_number=:pohead_number," " pohead_taxzone_id=:pohead_taxzone_id, " " pohead_curr_id=:pohead_curr_id, " " pohead_orderdate=:pohead_orderdate, " " pohead_freight = :pohead_freight " "WHERE (pohead_id=:pohead_id);" ); if (_warehouse->isValid()) taxq.bindValue(":pohead_warehous_id", _warehouse->id()); taxq.bindValue(":pohead_vend_id", _vendor->id()); taxq.bindValue(":pohead_number", _orderNumber->text()); taxq.bindValue(":pohead_id", _poheadid); if (_taxZone->isValid()) taxq.bindValue(":pohead_taxzone_id", _taxZone->id()); taxq.bindValue(":pohead_curr_id", _poCurrency->id()); taxq.bindValue(":pohead_orderdate", _orderDate->date()); taxq.bindValue(":pohead_freight", _freight->localValue()); taxq.exec(); if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return false; } return true; } void purchaseOrder::sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ) { QAction *menuItem; if (pSelected->text(_poitem->column("demand_type")) == tr("SO")) { menuItem = pMenu->addAction(tr("View Sales Order..."), this, SLOT(sViewSo())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); menuItem = pMenu->addAction(tr("Edit Sales Order..."), this, SLOT(sEditSo())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); } else if (pSelected->text(_poitem->column("demand_type")) == "WO") { menuItem = pMenu->addAction(tr("View Work Order..."), this, SLOT(sViewWo())); menuItem->setEnabled(_privileges->check("ViewWorkOrders")); menuItem = pMenu->addAction(tr("Edit Work Order..."), this, SLOT(sEditWo())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); } } void purchaseOrder::sViewSo() { XSqlQuery fetchso; fetchso.prepare( "SELECT pohead_cohead_id " "FROM pohead " "WHERE pohead_id = :pohead_id " ); fetchso.bindValue(":pohead_id", _poheadid); fetchso.exec(); if (fetchso.first()) salesOrder::viewSalesOrder(fetchso.value("pohead_cohead_id").toInt()); } void purchaseOrder::sEditSo() { XSqlQuery fetchso; fetchso.prepare( "SELECT pohead_cohead_id " "FROM pohead " "WHERE pohead_id = :pohead_id " ); fetchso.bindValue(":pohead_id", _poheadid); fetchso.exec(); if (fetchso.first()) salesOrder::editSalesOrder(fetchso.value("pohead_cohead_id").toInt(), TRUE); } void purchaseOrder::sViewWo() { XSqlQuery fetchwo; fetchwo.prepare( "SELECT womatl_wo_id " "FROM pohead JOIN poitem ON (poitem_pohead_id=pohead_id AND poitem_order_type='W')" " JOIN womatl ON (womatl_id=poitem_order_id) " "WHERE (pohead_id=:pohead_id);" ); fetchwo.bindValue(":pohead_id", _poheadid); fetchwo.exec(); if (fetchwo.first()) { ParameterList params; params.append("mode", "view"); params.append("wo_id", (fetchwo.value("womatl_wo_id").toInt())); workOrder *newdlg = new workOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void purchaseOrder::sEditWo() { XSqlQuery fetchwo; fetchwo.prepare( "SELECT womatl_wo_id " "FROM pohead JOIN poitem ON (poitem_pohead_id=pohead_id AND poitem_order_type='W')" " JOIN womatl ON (womatl_id=poitem_order_id) " "WHERE (pohead_id=:pohead_id);" ); fetchwo.bindValue(":pohead_id", _poheadid); fetchwo.exec(); if (fetchwo.first()) { ParameterList params; params.append("mode", "edit"); params.append("wo_id", (fetchwo.value("womatl_wo_id").toInt())); workOrder *newdlg = new workOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void purchaseOrder::sHandleShipTo() { XSqlQuery purchaseHandleShipTo; purchaseHandleShipTo.prepare( "SELECT cntct.*, addr.* " "FROM whsinfo LEFT OUTER JOIN cntct ON (warehous_cntct_id=cntct_id)" " LEFT OUTER JOIN addr ON (warehous_addr_id=addr_id) " "WHERE (warehous_id=:warehous_id);" ); purchaseHandleShipTo.bindValue(":warehous_id", _warehouse->id()); purchaseHandleShipTo.exec(); if (purchaseHandleShipTo.first()) { _shiptoCntct->setId(purchaseHandleShipTo.value("cntct_id").toInt()); _shiptoCntct->setHonorific(purchaseHandleShipTo.value("cntct_honorific").toString()); _shiptoCntct->setFirst(purchaseHandleShipTo.value("cntct_first_name").toString()); _shiptoCntct->setMiddle(purchaseHandleShipTo.value("cntct_middle").toString()); _shiptoCntct->setLast(purchaseHandleShipTo.value("cntct_last_name").toString()); _shiptoCntct->setSuffix(purchaseHandleShipTo.value("cntct_suffix").toString()); _shiptoCntct->setPhone(purchaseHandleShipTo.value("cntct_phone").toString()); _shiptoCntct->setTitle(purchaseHandleShipTo.value("cntct_title").toString()); _shiptoCntct->setFax(purchaseHandleShipTo.value("cntct_fax").toString()); _shiptoCntct->setEmailAddress(purchaseHandleShipTo.value("cntct_email").toString()); _shiptoAddr->setId(purchaseHandleShipTo.value("addr_id").toInt()); _shiptoAddr->setLine1(purchaseHandleShipTo.value("addr_line1").toString()); _shiptoAddr->setLine2(purchaseHandleShipTo.value("addr_line2").toString()); _shiptoAddr->setLine3(purchaseHandleShipTo.value("addr_line3").toString()); _shiptoAddr->setCity(purchaseHandleShipTo.value("addr_city").toString()); _shiptoAddr->setState(purchaseHandleShipTo.value("addr_state").toString()); _shiptoAddr->setPostalCode(purchaseHandleShipTo.value("addr_postalcode").toString()); _shiptoAddr->setCountry(purchaseHandleShipTo.value("addr_country").toString()); } } qt-client-4.1.0/guiclient/purchaseOrder.h000066400000000000000000000045401217451700100203570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURCHASEORDER_H #define PURCHASEORDER_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_purchaseOrder.h" class PoitemTableModel; class purchaseOrder : public XWidget, public Ui::purchaseOrder { Q_OBJECT public: purchaseOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~purchaseOrder(); virtual void createHeader(); virtual void populateOrderNumber(); virtual bool saveDetail(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sSave(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sVendaddrList(); virtual void sHandleDeleteButton(); virtual void sHandleOrderDate(); virtual void sHandleVendor( int pVendid ); virtual void sFillList(); virtual void sCalculateTotals(); virtual void sSetUserOrderNumber(); virtual void sHandleOrderNumber(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sCalculateTax(); virtual void sTaxZoneChanged(); virtual void sTaxDetail(); virtual void sViewSo(); virtual void sViewWo(); virtual void sEditSo(); virtual void sEditWo(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sHandleShipTo(); virtual void sReleaseNumber(); protected slots: virtual void languageChange(); virtual void sCurrencyChanged(); virtual void sQEDelete(); virtual bool sQESave(); virtual void sTabChanged(int); signals: void saved(int); private: void setPoheadid(const int); bool _captive; bool _userOrderNumber; bool _useWarehouseFOB; int _cachedTabIndex; int _deleteMode; int _vendaddrid; int _poheadid; QList _pridList; int _mode; bool _printed; PoitemTableModel* _qeitem; int _NumberGen; }; #endif // PURCHASEORDER_H qt-client-4.1.0/guiclient/purchaseOrder.ui000066400000000000000000001257441217451700100205570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purchaseOrder 0 0 600 400 Purchase Order 0 Header Information 0 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 200 16777215 true XComboBox::APTerms Purchasing Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Agent Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true None XComboBox::TaxZones Print on Save Qt::Horizontal false Release Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unreleased Open Closed Sales Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal Qt::Vertical 20 40 Vendor: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Vendor Address 0 0 0 36 16777215 36 QFrame::NoFrame QFrame::Raised 0 Address: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 60 16777215 Qt::NoFocus ... Qt::Horizontal 0 26 Ship To: 0 0 0 36 16777215 36 QFrame::NoFrame QFrame::Raised 0 Receiving Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Drop Ship Qt::Horizontal 40 26 true true Qt::Horizontal QSizePolicy::Fixed 25 20 FOB: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true XComboBox::ShipVias Qt::Horizontal QSizePolicy::Expanding 0 0 Qt::Vertical QSizePolicy::Expanding 20 13 Line Items 0 1 0 false &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 1 0 QFrame::NoFrame QFrame::Plain 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Currencies Qt::Vertical QSizePolicy::Expanding 20 20 true false false false false Misc. Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Subtotal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false false false false Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Freight Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Tax: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 Notes true Comments Comments::PurchaseOrder Quick Entry 5 false 0 false Save Quick Entries false Delete Quick Entry Qt::Vertical 20 40 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Currencies Qt::Horizontal 40 20 Documents Documents::PurchaseOrder Qt::Horizontal QSizePolicy::Expanding 175 20 &Save &Cancel _purchaseOrderInformation AddressCluster QWidget

    addresscluster.h
    Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    Documents QWidget
    documents.h
    OrderCluster QWidget
    ordercluster.h
    VendorCluster QWidget
    vendorcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    PoitemTableView QWidget
    poitemTableView.h
    1
    _orderNumber _orderDate _releaseDate _vendor _terms _taxZone _status _agent _printPO _so _vendaddrCode _vendAddr _vendCntct _warehouse _dropShip _shiptoAddr _shiptoCntct _fob _shipVia _purchaseOrderInformation _poitem _new _edit _delete _poCurrency _tax _freight _total _notes _qesave _qedelete _qecurrency _save _close _close clicked() purchaseOrder close() 20 20 20 20 _orderDate newDate(QDate) _freight setEffective(QDate) 20 20 20 20 _orderDate newDate(QDate) _subtotal setEffective(QDate) 20 20 20 20 _orderDate newDate(QDate) _tax setEffective(QDate) 20 20 20 20 _orderDate newDate(QDate) _totalFreight setEffective(QDate) 20 20 20 20 _orderDate newDate(QDate) _total setEffective(QDate) 20 20 20 20 _poCurrency newID(int) _freight setId(int) 20 20 20 20 _poCurrency newID(int) _subtotal setId(int) 20 20 20 20 _poCurrency newID(int) _totalFreight setId(int) 20 20 20 20 _poCurrency newID(int) _tax setId(int) 20 20 20 20 _poCurrency newID(int) _total setId(int) 20 20 20 20 _vendor valid(bool) _qeitemView setEnabled(bool) 309 172 196 275 _vendor valid(bool) _qesave setEnabled(bool) 309 172 559 88 _vendor valid(bool) _qedelete setEnabled(bool) 309 172 559 120 _so valid(bool) _dropShip setEnabled(bool) 678 186 611 263 qt-client-4.1.0/guiclient/purchaseOrderItem.cpp000066400000000000000000001340431217451700100215330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purchaseOrderItem.h" #include #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "mqlutil.h" #include "taxDetail.h" #include "itemCharacteristicDelegate.h" #include "itemSourceSearch.h" #include "itemSourceList.h" #include "vendorPriceList.h" purchaseOrderItem::purchaseOrderItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery purchasepurchaseOrderItem; setupUi(this); #ifndef Q_WS_MAC _vendorItemNumberList->setMaximumWidth(25); #else _listPrices->setMinimumWidth(60); #endif _vendid = -1; _preferredWarehouseid = -1; _invVendUOMRatio = 1; _minimumOrder = 0; _orderMultiple = 0; _maxCost = 0.0; _dropship = false; _costmethod = ""; connect(_ordered, SIGNAL(editingFinished()), this, SLOT(sDeterminePrice())); connect(_inventoryItem, SIGNAL(toggled(bool)), this, SLOT(sInventoryItemToggled(bool))); connect(_item, SIGNAL(privateIdChanged(int)), this, SLOT(sFindWarehouseItemsites(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo(int))); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateItemsiteInfo())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_vendorItemNumberList, SIGNAL(clicked()), this, SLOT(sVendorItemNumberSearch())); connect(_notesButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_listPrices, SIGNAL(clicked()), this, SLOT(sVendorListPrices())); connect(_taxLit, SIGNAL(leftClickedURL(QString)), this, SLOT(sTaxDetail())); // new slot added for tax url // connect(_extendedPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateTax())); // new slot added for price // connect(_taxtype, SIGNAL(newID(int)), this, SLOT(sCalculateTax())); // new slot added for taxtype // _bomRevision->setMode(RevisionLineEdit::Use); _bomRevision->setType("BOM"); _booRevision->setMode(RevisionLineEdit::Use); _booRevision->setType("BOO"); _parentwo = -1; _parentso = -1; _itemsrcid = -1; _taxzoneid = -1; // _taxzoneid added // _orderQtyCache = -1; _overriddenUnitPrice = false; _ordered->setValidator(omfgThis->qtyVal()); _project->setType(ProjectLineEdit::PurchaseOrder); if(!_metrics->boolean("UseProjects")) _project->hide(); _itemchar = new QStandardItemModel(0, 2, this); _itemchar->setHeaderData( 0, Qt::Horizontal, tr("Name"), Qt::DisplayRole); _itemchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole); _itemcharView->setModel(_itemchar); ItemCharacteristicDelegate * delegate = new ItemCharacteristicDelegate(this); _itemcharView->setItemDelegate(delegate); _minOrderQty->setValidator(omfgThis->qtyVal()); _orderQtyMult->setValidator(omfgThis->qtyVal()); _received->setValidator(omfgThis->qtyVal()); _invVendorUOMRatio->setValidator(omfgThis->ratioVal()); purchasepurchaseOrderItem.exec("SELECT DISTINCT itemsrc_manuf_name FROM itemsrc ORDER BY 1;"); for (int i = 0; purchasepurchaseOrderItem.next(); i++) _manufName->append(i, purchasepurchaseOrderItem.value("itemsrc_manuf_name").toString()); _manufName->setId(-1); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } //If not Revision Control, hide controls if (!_metrics->boolean("RevControl")) _tab->removeTab(_tab->indexOf(_revision)); adjustSize(); //TO DO: Implement later _taxRecoverable->hide(); } /* * Destroys the object and frees any allocated resources */ purchaseOrderItem::~purchaseOrderItem() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void purchaseOrderItem::languageChange() { retranslateUi(this); } enum SetResponse purchaseOrderItem::set(const ParameterList &pParams) { XSqlQuery purchaseet; XDialog::set(pParams); QVariant param; bool valid; bool haveQty = FALSE; bool haveDate = FALSE; param = pParams.value("vend_id", &valid); if (valid) _vendid = param.toInt(); param = pParams.value("warehous_id", &valid); if (valid) _preferredWarehouseid = param.toInt(); param = pParams.value("dropship", &valid); if (valid) _dropship = param.toBool(); param = pParams.value("parentWo", &valid); if (valid) _parentwo = param.toInt(); param = pParams.value("parentSo", &valid); if (valid) _parentso = param.toInt(); if (_metrics->boolean("CopyPRtoPOItem")) { param = pParams.value("pr_releasenote", &valid); if(valid) _notes->setText(param.toString()); } param = pParams.value("pohead_id", &valid); if (valid) { _poheadid = param.toInt(); purchaseet.prepare( "SELECT pohead_taxzone_id, pohead_number, pohead_orderdate, pohead_status, " // pohead_taxzone_id added " vend_id, vend_restrictpurch, pohead_curr_id " "FROM pohead, vendinfo " "WHERE ( (pohead_vend_id=vend_id)" " AND (pohead_id=:pohead_id) );" ); purchaseet.bindValue(":pohead_id", param.toInt()); purchaseet.exec(); if (purchaseet.first()) { _poNumber->setText(purchaseet.value("pohead_number").toString()); _poStatus = purchaseet.value("pohead_status").toString(); _unitPrice->setEffective(purchaseet.value("pohead_orderdate").toDate()); _unitPrice->setId(purchaseet.value("pohead_curr_id").toInt()); _taxzoneid=purchaseet.value("pohead_taxzone_id").toInt(); // added to pick up tax zone id. _tax->setEffective(purchaseet.value("pohead_orderdate").toDate()); _tax->setId(purchaseet.value("pohead_curr_id").toInt()); if (purchaseet.value("vend_restrictpurch").toBool()) { _item->setQuery( QString( "SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2," " (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " uom_name, item_type, item_config, item_active, item_upccode " "FROM item, itemsite, itemsrc, uom " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsrc_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (itemsite_active)" " AND (item_active)" " AND (itemsrc_active)" " AND (itemsrc_vend_id=%1) ) " "ORDER BY item_number" ) .arg(purchaseet.value("vend_id").toInt()) ); _item->setValidationQuery( QString( "SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2," " (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " uom_name, item_type, item_config, item_active, item_upccode " "FROM item, itemsite, itemsrc, uom " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsrc_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (itemsite_active)" " AND (item_active)" " AND (itemsrc_active)" " AND (itemsrc_vend_id=%1) " " AND (itemsite_item_id=:item_id) ) ") .arg(purchaseet.value("vend_id").toInt()) ); } else { _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured | ItemLineEdit::cTooling | ItemLineEdit::cActive); _item->setDefaultType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cActive); } } else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return UndefinedError; } } param = pParams.value("poitem_id", &valid); if (valid) { _poitemid = param.toInt(); purchaseet.prepare( "SELECT pohead_number, pohead_id " "FROM pohead, poitem " "WHERE ( (pohead_id=poitem_pohead_id) " " AND (poitem_id=:poitem_id) );" ); purchaseet.bindValue(":poitem_id", param.toInt()); purchaseet.exec(); if (purchaseet.first()) { _poNumber->setText(purchaseet.value("pohead_number").toString()); _poheadid = purchaseet.value("pohead_id").toInt(); } populate(); sCalculateTax(); } // connect here and not in the .ui to avoid timing issues at initialization connect(_unitPrice, SIGNAL(valueChanged()), this, SLOT(sPopulateExtPrice())); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _save->setEnabled(false); purchaseet.exec("SELECT NEXTVAL('poitem_poitem_id_seq') AS poitem_id;"); if (purchaseet.first()) _poitemid = purchaseet.value("poitem_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return UndefinedError; } if(_parentwo != -1) { purchaseet.prepare("SELECT wo_number" " FROM womatl JOIN wo ON (wo_id=womatl_wo_id)" " WHERE (womatl_id=:parentwo); "); purchaseet.bindValue(":parentwo", _parentwo); purchaseet.exec(); if(purchaseet.first()) { _so->setText(purchaseet.value("wo_number").toString()); _soLine->setText(""); } } if(_parentso != -1) { purchaseet.prepare( "INSERT INTO charass" " (charass_target_type, charass_target_id," " charass_char_id, charass_value) " "SELECT 'PI', :orderid, charass_char_id, charass_value" " FROM charass" " WHERE ((charass_target_type='SI')" " AND (charass_target_id=:soitem_id));"); purchaseet.bindValue(":orderid", _poitemid); purchaseet.bindValue(":soitem_id", _parentso); purchaseet.exec(); } purchaseet.prepare( "SELECT (COALESCE(MAX(poitem_linenumber), 0) + 1) AS _linenumber " "FROM poitem " "WHERE (poitem_pohead_id=:pohead_id);" ); purchaseet.bindValue(":pohead_id", _poheadid); purchaseet.exec(); if (purchaseet.first()) _lineNumber->setText(purchaseet.value("_linenumber").toString()); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return UndefinedError; } _bomRevision->setEnabled(_privileges->boolean("UseInactiveRevisions")); _booRevision->setEnabled(_privileges->boolean("UseInactiveRevisions")); _comments->setId(_poitemid); _tab->setTabEnabled(_tab->indexOf(_demandTab), FALSE); } else if (param.toString() == "edit") { _mode = cEdit; _typeGroup->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _typeGroup->setEnabled(FALSE); _vendorItemNumber->setEnabled(FALSE); _vendorItemNumberList->setEnabled(FALSE); _vendorDescrip->setEnabled(FALSE); _warehouse->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _ordered->setEnabled(FALSE); _unitPrice->setEnabled(FALSE); _freight->setEnabled(FALSE); _notes->setReadOnly(TRUE); _comments->setReadOnly(TRUE); _project->setEnabled(FALSE); _taxtype->setEnabled(FALSE); _taxRecoverable->setEnabled(FALSE); _bomRevision->setEnabled(FALSE); _booRevision->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } param = pParams.value("itemsite_id", &valid); if (valid) { _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); } param = pParams.value("itemsrc_id", &valid); if (valid) sPopulateItemSourceInfo(param.toInt()); param = pParams.value("qty", &valid); if (valid) { _ordered->setDouble((param.toDouble()/_invVendUOMRatio)); if (_item->isValid()) sDeterminePrice(); haveQty = TRUE; } param = pParams.value("dueDate", &valid); if (valid) { _dueDate->setDate(param.toDate()); haveDate = TRUE; } param = pParams.value("prj_id", &valid); if (valid) _project->setId(param.toInt()); if(_parentso != -1) { purchaseet.prepare("SELECT cohead_number, coitem_linenumber, coitem_prcost" " FROM coitem JOIN cohead ON (cohead_id=coitem_cohead_id)" " WHERE (coitem_id=:parentso); "); purchaseet.bindValue(":parentso", _parentso); purchaseet.exec(); if(purchaseet.first()) { _so->setText(purchaseet.value("cohead_number").toString()); _soLine->setText(purchaseet.value("coitem_linenumber").toString()); if(purchaseet.value("coitem_prcost").toDouble() > 0) { _overriddenUnitPrice = true; _unitPrice->setLocalValue(purchaseet.value("coitem_prcost").toDouble()); sPopulateExtPrice(); } } } return NoError; } void purchaseOrderItem::populate() { XSqlQuery purchasepopulate; MetaSQLQuery mql = mqlLoad("purchaseOrderItems", "detail"); ParameterList params; params.append("poitem_id", _poitemid); params.append("sonum", tr("Sales Order #")), params.append("wonum", tr("Work Order #")), purchasepopulate = mql.toQuery(params); if (purchasepopulate.lastError().type() != QSqlError::NoError) { systemError(this, purchasepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } if (purchasepopulate.first()) { _poNumber->setText(purchasepopulate.value("pohead_number").toString()); _lineNumber->setText(purchasepopulate.value("poitem_linenumber").toString()); _taxzoneid=purchasepopulate.value("pohead_taxzone_id").toInt(); // added to pick up tax zone id. _dueDate->setDate(purchasepopulate.value("poitem_duedate").toDate()); _ordered->setDouble(purchasepopulate.value("poitem_qty_ordered").toDouble()); _orderQtyCache = _ordered->toDouble(); _received->setDouble(purchasepopulate.value("poitem_qty_received").toDouble()); _unitPrice->set(purchasepopulate.value("poitem_unitprice").toDouble(), purchasepopulate.value("pohead_curr_id").toInt(), purchasepopulate.value("pohead_orderdate").toDate(), false); _freight->setLocalValue(purchasepopulate.value("poitem_freight").toDouble()); _extendedPrice->setLocalValue(purchasepopulate.value("extended_price").toDouble()); _taxtype->setId(purchasepopulate.value("poitem_taxtype_id").toInt()); _taxRecoverable->setChecked(purchasepopulate.value("poitem_tax_recoverable").toBool()); _notes->setText(purchasepopulate.value("poitem_comments").toString()); _project->setId(purchasepopulate.value("poitem_prj_id").toInt()); if(purchasepopulate.value("override_cost").toDouble() > 0) _overriddenUnitPrice = true; if(purchasepopulate.value("poitem_order_id") != -1) { _ordered->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _soLit->setText(purchasepopulate.value("demand_type").toString()); _so->setText(purchasepopulate.value("order_number").toString()); // _soLine->setText(purchasepopulate.value("orderline_number").toString()); } else _tab->setTabEnabled(_tab->indexOf(_demandTab), FALSE); if (purchasepopulate.value("poitem_itemsite_id").toInt() == -1) { _nonInventoryItem->setChecked(TRUE); _expcat->setId(purchasepopulate.value("poitem_expcat_id").toInt()); sPopulateItemSourceInfo(-1); _vendorItemNumber->setText(purchasepopulate.value("poitem_vend_item_number").toString()); _vendorDescrip->setText(purchasepopulate.value("poitem_vend_item_descrip").toString()); _vendorUOM->setText(purchasepopulate.value("poitem_vend_uom").toString()); _uom->setText(purchasepopulate.value("poitem_vend_uom").toString()); } else { _inventoryItem->setChecked(TRUE); _item->setItemsiteid(purchasepopulate.value("poitem_itemsite_id").toInt()); sPopulateItemSourceInfo(_item->id()); if (_metrics->boolean("RevControl")) { _bomRevision->setId(purchasepopulate.value("poitem_bom_rev_id").toInt()); _booRevision->setId(purchasepopulate.value("poitem_boo_rev_id").toInt()); _bomRevision->setEnabled(purchasepopulate.value("poitem_status").toString() == "U" && _privileges->boolean("UseInactiveRevisions")); _booRevision->setEnabled(purchasepopulate.value("poitem_status").toString() == "U" && _privileges->boolean("UseInactiveRevisions")); } } _itemsrcid = purchasepopulate.value("poitem_itemsrc_id").toInt(); _vendorItemNumber->setText(purchasepopulate.value("poitem_vend_item_number").toString()); _vendorDescrip->setText(purchasepopulate.value("poitem_vend_item_descrip").toString()); _vendorUOM->setText(purchasepopulate.value("poitem_vend_uom").toString()); _uom->setText(purchasepopulate.value("poitem_vend_uom").toString()); _invVendorUOMRatio->setDouble(purchasepopulate.value("poitem_invvenduomratio").toDouble()); _invVendUOMRatio = purchasepopulate.value("poitem_invvenduomratio").toDouble(); _manufName->setText(purchasepopulate.value("poitem_manuf_name").toString()); if (_manufName->id() < 0) { _manufName->append(_manufName->count(), purchasepopulate.value("poitem_manuf_name").toString()); _manufName->setText(purchasepopulate.value("poitem_manuf_name").toString()); } _manufItemNumber->setText(purchasepopulate.value("poitem_manuf_item_number").toString()); _manufItemDescrip->setText(purchasepopulate.value("poitem_manuf_item_descrip").toString()); if (_itemsrcid != -1) { _vendorUOM->setEnabled(FALSE); _manufName->setEnabled(FALSE); _manufItemNumber->setEnabled(FALSE); _manufItemDescrip->setEnabled(FALSE); if(_vendorItemNumber->text().isEmpty()) _vendorItemNumber->setText(purchasepopulate.value("itemsrc_vend_item_number").toString()); if(_vendorDescrip->toPlainText().isEmpty()) _vendorDescrip->setText(purchasepopulate.value("itemsrc_vend_item_descrip").toString()); _minOrderQty->setDouble(purchasepopulate.value("itemsrc_minordqty").toDouble()); _orderQtyMult->setDouble(purchasepopulate.value("itemsrc_multordqty").toDouble()); _minimumOrder = purchasepopulate.value("itemsrc_minordqty").toDouble(); _orderMultiple = purchasepopulate.value("itemsrc_multordqty").toDouble(); if(_manufName->currentText().isEmpty()) _manufName->setText(purchasepopulate.value("itemsrc_manuf_name").toString()); if(_manufItemNumber->text().isEmpty()) _manufItemNumber->setText(purchasepopulate.value("itemsrc_manuf_item_number").toString()); if(_manufItemDescrip->toPlainText().isEmpty()) _manufItemDescrip->setText(purchasepopulate.value("itemsrc_manuf_item_descrip").toString()); } purchasepopulate.prepare( "SELECT DISTINCT char_id, char_name," " COALESCE(b.charass_value, (SELECT c.charass_value FROM charass c WHERE ((c.charass_target_type='I') AND (c.charass_target_id=:item_id) AND (c.charass_default) AND (c.charass_char_id=char_id)) LIMIT 1)) AS charass_value" " FROM charass a, char " " LEFT OUTER JOIN charass b" " ON (b.charass_target_type='PI'" " AND b.charass_target_id=:poitem_id" " AND b.charass_char_id=char_id) " " WHERE ( (a.charass_char_id=char_id)" " AND (a.charass_target_type='I')" " AND (a.charass_target_id=:item_id) ) " " ORDER BY char_name;" ); purchasepopulate.bindValue(":item_id", _item->id()); purchasepopulate.bindValue(":poitem_id", _poitemid); purchasepopulate.exec(); int row = 0; QModelIndex idx; while(purchasepopulate.next()) { _itemchar->insertRow(_itemchar->rowCount()); idx = _itemchar->index(row, 0); _itemchar->setData(idx, purchasepopulate.value("char_name"), Qt::DisplayRole); _itemchar->setData(idx, purchasepopulate.value("char_id"), Qt::UserRole); idx = _itemchar->index(row, 1); _itemchar->setData(idx, purchasepopulate.value("charass_value"), Qt::DisplayRole); _itemchar->setData(idx, _item->id(), Xt::IdRole); _itemchar->setData(idx, _item->id(), Qt::UserRole); row++; } _comments->setId(_poitemid); } } void purchaseOrderItem::sSave() { QList errors; errors << GuiErrorCheck(!_inventoryItem->isChecked() && _expcat->id() == -1, _expcat, tr("

    You must specify an Expense Category for this non-Inventory Item before you may save.")) << GuiErrorCheck(_inventoryItem->isChecked() && !_item->isValid(), _item, tr("

    You must select an Item Number before you may save.")) << GuiErrorCheck(_inventoryItem->isChecked() && _warehouse->id() == -1, _warehouse, tr("

    You must select a Supplying Site before you may save.")) << GuiErrorCheck(!_dueDate->isValid(), _dueDate, tr("

    You must enter a due date before you may save this Purchase Order Item.")) << GuiErrorCheck(_metrics->boolean("RequirePOTax") && !_taxtype->isValid(), _taxtype, tr("

    You must select a Tax Type before you may save." )) << GuiErrorCheck(_so->text().length() == 0 && _costmethod == "J", _item, tr("

    You may not purchase a Job Item without an associated demand.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Purchase Order Item"), errors)) return; XSqlQuery purchaseSave; if (_ordered->toDouble() == 0.0) { if (QMessageBox::critical( this, tr("Zero Order Quantity"), tr( "

    The quantity that you are ordering is zero. " "

    Do you wish to Continue or Change the Order Qty?" ), QString("&Continue"), QString("Change Order &Qty."), QString::null, 1, 1 ) == 1) { _ordered->setFocus(); return; } } if (_ordered->toDouble() < _minimumOrder) { if (QMessageBox::critical( this, tr("Invalid Order Quantity"), tr( "

    The quantity that you are ordering is below the Minimum Order Quantity for this " "Item Source. You may continue but this Vendor may not honor pricing or delivery quotations. " "

    Do you wish to Continue or Change the Order Qty?" ), QString("&Continue"), QString("Change Order &Qty."), QString::null, 1, 1 ) == 1) { _ordered->setFocus(); return; } } if ((int)_orderMultiple) { if (qRound(_ordered->toDouble()) % (int)_orderMultiple) { if (QMessageBox::critical( this, tr("Invalid Order Quantity"), tr( "

    The quantity that you are ordering does not fall within the Order Multiple for this " "Item Source. You may continue but this Vendor may not honor pricing or delivery quotations. " "

    Do you wish to Continue or Change the Order Qty?" ), QString("&Continue"), QString("Change Order &Qty."), QString::null, 1, 1 ) == 1) { _ordered->setFocus(); return; } } } if (_unitPrice->baseValue() > _maxCost && _maxCost > 0.0) { if (QMessageBox::critical( this, tr("Invalid Unit Price"), tr( "

    The Unit Price is above the Maximum Desired Cost for this Item." "

    Do you wish to Continue or Change the Unit Price?" ), QString("&Continue"), QString("Change Unit &Price."), QString::null, 1, 1 ) == 1) { _unitPrice->setFocus(); return; } } if (_dueDate->date() < _earliestDate->date()) { if (QMessageBox::critical( this, tr("Invalid Due Date "), tr( "

    The Due Date that you are requesting does not fall within the Lead Time Days for this " "Item Source. You may continue but this Vendor may not honor pricing or delivery quotations " "or may not be able to deliver by the requested Due Date. " "

    Do you wish to Continue or Change the Due Date?" ), QString("&Continue"), QString("Change Order &Due Date"), QString::null, 1, 1 ) == 1) { _dueDate->setFocus(); return; } } if (_mode == cNew) { purchaseSave.prepare( "INSERT INTO poitem " "( poitem_id, poitem_pohead_id, poitem_status, poitem_linenumber," " poitem_taxtype_id, poitem_tax_recoverable," " poitem_itemsite_id, poitem_expcat_id," " poitem_itemsrc_id, poitem_vend_item_number, poitem_vend_item_descrip," " poitem_vend_uom, poitem_invvenduomratio," " poitem_qty_ordered," " poitem_unitprice, poitem_freight, poitem_duedate, " " poitem_bom_rev_id, poitem_boo_rev_id, " " poitem_comments, poitem_prj_id, poitem_stdcost, poitem_manuf_name, " " poitem_manuf_item_number, poitem_manuf_item_descrip, poitem_rlsd_duedate ) " "VALUES " "( :poitem_id, :poitem_pohead_id, :status, :poitem_linenumber," " :poitem_taxtype_id, :poitem_tax_recoverable," " :poitem_itemsite_id, :poitem_expcat_id," " :poitem_itemsrc_id, :poitem_vend_item_number, :poitem_vend_item_descrip," " :poitem_vend_uom, :poitem_invvenduomratio," " :poitem_qty_ordered," " :poitem_unitprice, :poitem_freight, :poitem_duedate, " " :poitem_bom_rev_id, :poitem_boo_rev_id, " " :poitem_comments, :poitem_prj_id, stdcost(:item_id), :poitem_manuf_name, " " :poitem_manuf_item_number, :poitem_manuf_item_descrip, :poitem_duedate) ;" ); purchaseSave.bindValue(":status", _poStatus); purchaseSave.bindValue(":item_id", _item->id()); if (_inventoryItem->isChecked()) { XSqlQuery itemsiteid; itemsiteid.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); itemsiteid.bindValue(":item_id", _item->id()); itemsiteid.bindValue(":warehous_id", _warehouse->id()); itemsiteid.exec(); if (itemsiteid.first()) purchaseSave.bindValue(":poitem_itemsite_id", itemsiteid.value("itemsite_id").toInt()); else { QMessageBox::critical( this, tr("Invalid Item/Site"), tr("

    The Item and Site you have selected does not appear to be a valid combination. " "Make sure you have a Site selected and that there is a valid itemsite for " "this Item and Site combination.") ); return; } } else { purchaseSave.bindValue(":poitem_expcat_id", _expcat->id()); } } else if (_mode == cEdit) purchaseSave.prepare( "UPDATE poitem " "SET poitem_itemsrc_id=:poitem_itemsrc_id," " poitem_taxtype_id=:poitem_taxtype_id," " poitem_tax_recoverable=:poitem_tax_recoverable," " poitem_vend_item_number=:poitem_vend_item_number," " poitem_vend_item_descrip=:poitem_vend_item_descrip," " poitem_vend_uom=:poitem_vend_uom, poitem_invvenduomratio=:poitem_invvenduomratio," " poitem_qty_ordered=:poitem_qty_ordered, poitem_unitprice=:poitem_unitprice," " poitem_freight=:poitem_freight," " poitem_duedate=:poitem_duedate, poitem_comments=:poitem_comments," " poitem_prj_id=:poitem_prj_id, " " poitem_bom_rev_id=:poitem_bom_rev_id, " " poitem_boo_rev_id=:poitem_boo_rev_id, " " poitem_manuf_name=:poitem_manuf_name, " " poitem_manuf_item_number=:poitem_manuf_item_number, " " poitem_manuf_item_descrip=:poitem_manuf_item_descrip " "WHERE (poitem_id=:poitem_id);" ); purchaseSave.bindValue(":poitem_id", _poitemid); if (_taxtype->id() != -1) purchaseSave.bindValue(":poitem_taxtype_id", _taxtype->id()); purchaseSave.bindValue(":poitem_tax_recoverable", QVariant(_taxRecoverable->isChecked())); purchaseSave.bindValue(":poitem_pohead_id", _poheadid); purchaseSave.bindValue(":poitem_linenumber", _lineNumber->text().toInt()); if (_itemsrcid != -1) purchaseSave.bindValue(":poitem_itemsrc_id", _itemsrcid); purchaseSave.bindValue(":poitem_vend_item_number", _vendorItemNumber->text()); purchaseSave.bindValue(":poitem_vend_item_descrip", _vendorDescrip->toPlainText()); purchaseSave.bindValue(":poitem_vend_uom", _vendorUOM->text()); purchaseSave.bindValue(":poitem_invvenduomratio", _invVendorUOMRatio->toDouble()); purchaseSave.bindValue(":poitem_qty_ordered", _ordered->toDouble()); purchaseSave.bindValue(":poitem_unitprice", _unitPrice->localValue()); purchaseSave.bindValue(":poitem_freight", _freight->localValue()); purchaseSave.bindValue(":poitem_duedate", _dueDate->date()); purchaseSave.bindValue(":poitem_manuf_name", _manufName->currentText()); purchaseSave.bindValue(":poitem_manuf_item_number", _manufItemNumber->text()); purchaseSave.bindValue(":poitem_manuf_item_descrip", _manufItemDescrip->toPlainText()); purchaseSave.bindValue(":poitem_comments", _notes->toPlainText()); if (_project->isValid()) purchaseSave.bindValue(":poitem_prj_id", _project->id()); if (_metrics->boolean("RevControl")) { purchaseSave.bindValue(":poitem_bom_rev_id", _bomRevision->id()); purchaseSave.bindValue(":poitem_boo_rev_id", _booRevision->id()); } purchaseSave.exec(); if (purchaseSave.lastError().type() != QSqlError::NoError) { systemError(this, purchaseSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_parentwo != -1) { purchaseSave.prepare("UPDATE poitem SET poitem_order_id=:parentwo, poitem_order_type='W' WHERE (poitem_id=:poitem_id);"); purchaseSave.bindValue(":parentwo", _parentwo); purchaseSave.bindValue(":poitem_id", _poitemid); purchaseSave.exec(); } if (_parentso != -1) { purchaseSave.prepare("UPDATE poitem SET poitem_order_id=:parentso, poitem_order_type='S' WHERE (poitem_id=:poitem_id);"); purchaseSave.bindValue(":parentso", _parentso); purchaseSave.bindValue(":poitem_id", _poitemid); purchaseSave.exec(); purchaseSave.prepare("UPDATE coitem SET coitem_order_id=:poitem_id, coitem_order_type='P' WHERE (coitem_id=:parentso);"); purchaseSave.bindValue(":parentso", _parentso); purchaseSave.bindValue(":poitem_id", _poitemid); purchaseSave.exec(); } if ( _mode != cView ) { purchaseSave.prepare("SELECT updateCharAssignment('PI', :target_id, :char_id, :char_value);"); QModelIndex idx1, idx2; for(int i = 0; i < _itemchar->rowCount(); i++) { idx1 = _itemchar->index(i, 0); idx2 = _itemchar->index(i, 1); purchaseSave.bindValue(":target_id", _poitemid); purchaseSave.bindValue(":char_id", _itemchar->data(idx1, Qt::UserRole)); purchaseSave.bindValue(":char_value", _itemchar->data(idx2, Qt::DisplayRole)); purchaseSave.exec(); } } done(_poitemid); } void purchaseOrderItem::sPopulateExtPrice() { _extendedPrice->setLocalValue(_ordered->toDouble() * _unitPrice->localValue()); } void purchaseOrderItem::sFindWarehouseItemsites( int id ) { _warehouse->findItemsites(id); if(_preferredWarehouseid > 0) _warehouse->setId(_preferredWarehouseid); } void purchaseOrderItem::sPopulateItemInfo(int pItemid) { XSqlQuery item; if (pItemid != -1 && _mode == cNew) { item.prepare("SELECT stdCost(item_id) AS stdcost, " " getItemTaxType(item_id, pohead_taxzone_id) AS taxtype_id, " " item_tax_recoverable, COALESCE(item_maxcost, 0.0) AS maxcost " "FROM item, pohead " "WHERE ( (item_id=:item_id) " " AND (pohead_id=:pohead_id) );"); item.bindValue(":item_id", pItemid); item.bindValue(":pohead_id", _poheadid); item.exec(); if (item.first()) { // Reset order qty cache _orderQtyCache = -1; if(_metrics->boolean("RequireStdCostForPOItem") && item.value("stdcost").toDouble() == 0.0) { QMessageBox::critical( this, tr("Selected Item Missing Cost"), tr("

    The selected item has no Std. Costing information. " "Please see your controller to correct this situation " "before continuing.")); _item->setId(-1); return; } _taxtype->setId(item.value("taxtype_id").toInt()); _taxRecoverable->setChecked(item.value("item_tax_recoverable").toBool()); _maxCost = item.value("maxcost").toDouble(); sPopulateItemsiteInfo(); item.prepare( "SELECT DISTINCT char_id, char_name," " COALESCE(b.charass_value, (SELECT c.charass_value FROM charass c WHERE ((c.charass_target_type='I') AND (c.charass_target_id=:item_id) AND (c.charass_default) AND (c.charass_char_id=char_id)) LIMIT 1)) AS charass_value" " FROM charass a, char " " LEFT OUTER JOIN charass b" " ON (b.charass_target_type='PI'" " AND b.charass_target_id=:poitem_id" " AND b.charass_char_id=char_id) " " WHERE ( (a.charass_char_id=char_id)" " AND (a.charass_target_type='I')" " AND (a.charass_target_id=:item_id) ) " " ORDER BY char_name;" ); item.bindValue(":item_id", pItemid); item.bindValue(":poitem_id", _poitemid); item.exec(); int row = 0; _itemchar->removeRows(0, _itemchar->rowCount()); QModelIndex idx; while(item.next()) { _itemchar->insertRow(_itemchar->rowCount()); idx = _itemchar->index(row, 0); _itemchar->setData(idx, item.value("char_name"), Qt::DisplayRole); _itemchar->setData(idx, item.value("char_id"), Qt::UserRole); idx = _itemchar->index(row, 1); _itemchar->setData(idx, item.value("charass_value"), Qt::DisplayRole); _itemchar->setData(idx, pItemid, Xt::IdRole); _itemchar->setData(idx, pItemid, Qt::UserRole); row++; } item.prepare("SELECT itemsrc_id " "FROM itemsrc, pohead " "WHERE ( (itemsrc_vend_id=pohead_vend_id)" " AND (itemsrc_item_id=:item_id)" " AND (:effective BETWEEN itemsrc_effective AND (itemsrc_expires - 1))" " AND (itemsrc_active)" " AND (pohead_id=:pohead_id) );" ); item.bindValue(":item_id", pItemid); item.bindValue(":pohead_id", _poheadid); item.bindValue(":effective", _unitPrice->effective()); item.exec(); if (item.size() == 1) { item.first(); if (item.value("itemsrc_id").toInt() != _itemsrcid) sPopulateItemSourceInfo(item.value("itemsrc_id").toInt()); } else if (item.size() > 1) { bool isCurrent = false; while (item.next()) { if (item.value("itemsrc_id").toInt() == _itemsrcid) isCurrent = true; } if (!isCurrent) { _vendorItemNumber->clear(); sVendorItemNumberList(); } } else { _itemsrcid = -1; _vendorItemNumber->clear(); _vendorDescrip->clear(); _vendorUOM->setText(_item->uom()); _uom->setText(_item->uom()); _minOrderQty->clear(); _orderQtyMult->clear(); _invVendorUOMRatio->setDouble(1.0); _earliestDate->setDate(omfgThis->dbDate()); _manufName->setId(-1); _manufItemNumber->clear(); _manufItemDescrip->clear(); _invVendUOMRatio = 1; _minimumOrder = 0; _orderMultiple = 0; } } } } void purchaseOrderItem::sPopulateItemsiteInfo() { XSqlQuery itemsite; if (_item->isValid() && _warehouse->isValid()) { itemsite.prepare("SELECT * " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id) " " AND (itemsite_warehous_id=:warehous_id) );"); itemsite.bindValue(":item_id", _item->id()); itemsite.bindValue(":warehous_id", _warehouse->id()); itemsite.exec(); if (itemsite.first()) { _costmethod = itemsite.value("itemsite_costmethod").toString(); if (_costmethod == "J") _tab->setTabEnabled(_tab->indexOf(_demandTab), true); } } } void purchaseOrderItem::sPopulateItemSourceInfo(int pItemsrcid) { XSqlQuery src; bool skipClear = false; if (!_item->isValid()) skipClear = true; if (_mode == cNew) { if (pItemsrcid != -1) { src.prepare( "SELECT itemsrc_id, itemsrc_item_id, itemsrc_vend_item_number," " itemsrc_vend_item_descrip, itemsrc_vend_uom," " itemsrc_minordqty," " itemsrc_multordqty," " itemsrc_invvendoruomratio," " (CURRENT_DATE + itemsrc_leadtime) AS earliestdate, " " itemsrc_manuf_name, " " itemsrc_manuf_item_number, " " itemsrc_manuf_item_descrip " "FROM itemsrc " "WHERE (itemsrc_id=:itemsrc_id);" ); src.bindValue(":itemsrc_id", pItemsrcid); src.exec(); if (src.first()) { _itemsrcid = src.value("itemsrc_id").toInt(); _item->setId(src.value("itemsrc_item_id").toInt()); _vendorItemNumber->setText(src.value("itemsrc_vend_item_number").toString()); _vendorDescrip->setText(src.value("itemsrc_vend_item_descrip").toString()); _vendorUOM->setText(src.value("itemsrc_vend_uom").toString()); _uom->setText(src.value("itemsrc_vend_uom").toString()); _minOrderQty->setDouble(src.value("itemsrc_minordqty").toDouble()); _orderQtyMult->setDouble(src.value("itemsrc_multordqty").toDouble()); _invVendorUOMRatio->setDouble(src.value("itemsrc_invvendoruomratio").toDouble()); _earliestDate->setDate(src.value("earliestdate").toDate()); _invVendUOMRatio = src.value("itemsrc_invvendoruomratio").toDouble(); _minimumOrder = src.value("itemsrc_minordqty").toDouble(); _orderMultiple = src.value("itemsrc_multordqty").toDouble(); _manufName->setCode(src.value("itemsrc_manuf_name").toString()); _manufItemNumber->setText(src.value("itemsrc_manuf_item_number").toString()); _manufItemDescrip->setText(src.value("itemsrc_manuf_item_descrip").toString()); if (_ordered->toDouble() != 0) sDeterminePrice(); _ordered->setFocus(); if(_metrics->boolean("UseEarliestAvailDateOnPOItem")) _dueDate->setDate(_earliestDate->date()); skipClear = true; } } if(!skipClear) { _itemsrcid = -1; _vendorItemNumber->clear(); _vendorDescrip->clear(); _vendorUOM->setText(_item->uom()); _uom->setText(_item->uom()); _minOrderQty->clear(); _orderQtyMult->clear(); _invVendorUOMRatio->setDouble(1.0); _earliestDate->setDate(omfgThis->dbDate()); _manufName->setId(-1); _manufItemNumber->clear(); _manufItemDescrip->clear(); _invVendUOMRatio = 1; _minimumOrder = 0; _orderMultiple = 0; } } } void purchaseOrderItem::sDeterminePrice() { XSqlQuery purchaseDeterminePrice; if ((_orderQtyCache != -1) && (_orderQtyCache != _ordered->toDouble())) { if (QMessageBox::question(this, tr("Update Price?"), tr("

    The Item qty. has changed. Do you want to update the Price?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::No) { _orderQtyCache = _ordered->toDouble(); sPopulateExtPrice(); return; } } if ( (!_overriddenUnitPrice) && (_itemsrcid != -1) && (_ordered->toDouble() != 0.0) && (_orderQtyCache != _ordered->toDouble())) { purchaseDeterminePrice.prepare( "SELECT itemsrcPrice(:itemsrc_id, :warehous_id, :dropship," " :qty, :curr_id, :effective) AS new_itemsrc_price;"); purchaseDeterminePrice.bindValue(":itemsrc_id", _itemsrcid); purchaseDeterminePrice.bindValue(":warehous_id", _warehouse->id()); purchaseDeterminePrice.bindValue(":dropship", _dropship); purchaseDeterminePrice.bindValue(":qty", _ordered->toDouble()); purchaseDeterminePrice.bindValue(":curr_id", _unitPrice->id()); purchaseDeterminePrice.bindValue(":effective", _unitPrice->effective()); purchaseDeterminePrice.exec(); if (purchaseDeterminePrice.first()) _unitPrice->setLocalValue(purchaseDeterminePrice.value("new_itemsrc_price").toDouble()); else _unitPrice->clear(); } if (_ordered->toDouble() != 0.0) _orderQtyCache = _ordered->toDouble(); sPopulateExtPrice(); _save->setEnabled(true); } void purchaseOrderItem::sInventoryItemToggled( bool yes ) { if(yes) sPopulateItemSourceInfo(_item->id()); else sPopulateItemSourceInfo(-1); } void purchaseOrderItem::sVendorItemNumberSearch() { ParameterList params; params.append("vend_id", _vendid); if (!_vendorItemNumber->text().isEmpty()) params.append("search", _vendorItemNumber->text()); else if (_item->id() != -1) params.append("search", _item->itemNumber()); itemSourceSearch newdlg(this, "", true); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) { int itemsrcid = newdlg.itemsrcId(); if(itemsrcid != -1) { _inventoryItem->setChecked(TRUE); sPopulateItemSourceInfo(itemsrcid); } else { _nonInventoryItem->setChecked(TRUE); _expcat->setId(newdlg.expcatId()); _vendorItemNumber->setText(newdlg.vendItemNumber()); _vendorDescrip->setText(newdlg.vendItemDescrip()); _manufName->setText(newdlg.manufName()); _manufItemNumber->setText(newdlg.manufItemNumber()); _manufItemDescrip->setText(newdlg.manufItemDescrip()); } } } void purchaseOrderItem::sVendorItemNumberList() { ParameterList params; params.append("item_id", _item->id()); params.append("vend_id", _vendid); itemSourceList newdlg(this, "", true); newdlg.set(params); int itemsrcid = newdlg.exec(); if(itemsrcid > 0) { _inventoryItem->setChecked(TRUE); sPopulateItemSourceInfo(itemsrcid); } } void purchaseOrderItem::sHandleButtons() { if (_notesButton->isChecked()) _remarksStack->setCurrentIndex(0); else _remarksStack->setCurrentIndex(1); } void purchaseOrderItem::sVendorListPrices() { ParameterList params; params.append("itemsrc_id", _itemsrcid); params.append("qty", _ordered->toDouble()); vendorPriceList newdlg(this, "", TRUE); newdlg.set(params); if ( (newdlg.exec() == XDialog::Accepted)) { if (_ordered->text().toDouble() < newdlg._selectedQty) { if (QMessageBox::question(this, tr("Update Quantity?"), tr("

    You must order at least %1 to qualify for this price. Do you want to update the Quantity?").arg(QString().setNum(newdlg._selectedQty)), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::No) return; _ordered->setDouble(newdlg._selectedQty); _orderQtyCache = -1; sDeterminePrice(); } } } void purchaseOrderItem::sCalculateTax() { XSqlQuery calcq; calcq.prepare("SELECT calculateTax(pohead_taxzone_id,:taxtype_id,pohead_orderdate,pohead_curr_id,ROUND(:ext,2)) AS tax " "FROM pohead " "WHERE (pohead_id=:pohead_id); " ); calcq.bindValue(":pohead_id", _poheadid); calcq.bindValue(":taxtype_id", _taxtype->id()); calcq.bindValue(":ext", _extendedPrice->localValue()); calcq.exec(); if (calcq.first()) _tax->setLocalValue(calcq.value("tax").toDouble()); else if (calcq.lastError().type() != QSqlError::NoError) { systemError(this, calcq.lastError().databaseText(), __FILE__, __LINE__); return; } } void purchaseOrderItem::sTaxDetail() // new function added from raitem { taxDetail newdlg(this, "", true); ParameterList params; params.append("taxzone_id", _taxzoneid); params.append("taxtype_id", _taxtype->id()); params.append("date", _tax->effective()); params.append("curr_id", _tax->id()); params.append("subtotal", _extendedPrice->localValue()); //params.append("readOnly"); if (newdlg.set(params) == NoError && newdlg.exec()) { if (_taxtype->id() != newdlg.taxtype()) _taxtype->setId(newdlg.taxtype()); } } qt-client-4.1.0/guiclient/purchaseOrderItem.h000066400000000000000000000041501217451700100211730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURCHASEORDERITEM_H #define PURCHASEORDERITEM_H #include "guiclient.h" #include "xdialog.h" #include #include #include "ui_purchaseOrderItem.h" class purchaseOrderItem : public XDialog, public Ui::purchaseOrderItem { Q_OBJECT public: purchaseOrderItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~purchaseOrderItem(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sDeterminePrice(); virtual void sCalculateTax(); // new function added virtual void sTaxDetail(); // new function added protected slots: virtual void languageChange(); virtual void sSave(); virtual void sPopulateExtPrice(); virtual void sFindWarehouseItemsites( int pId ); virtual void sPopulateItemInfo( int pItemid ); virtual void sPopulateItemsiteInfo(); virtual void sPopulateItemSourceInfo( int pItemsrcid ); virtual void sInventoryItemToggled( bool yes ); virtual void sVendorItemNumberSearch(); virtual void sVendorItemNumberList(); virtual void sHandleButtons(); virtual void sVendorListPrices(); private: int _itemsrcid; int _mode; int _poheadid; int _poitemid; int _parentwo; int _parentso; int _vendid; int _preferredWarehouseid; int _taxzoneid; double _invVendUOMRatio; double _minimumOrder; double _orderMultiple; double _orderQtyCache; double _maxCost; bool _overriddenUnitPrice; bool _dropship; QString _poStatus; QString _costmethod; QStandardItemModel * _itemchar; }; #endif // PURCHASEORDERITEM_H qt-client-4.1.0/guiclient/purchaseOrderItem.ui000066400000000000000000001542201217451700100213650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purchaseOrderItem 0 0 744 844 0 0 Purchase Order Item 12 12 Order Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 16 16 &Save true &Cancel Inventory true Qt::StrongFocus Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter WComboBox::Supply Qt::Vertical 20 31 Qt::Horizontal 0 20 Non-Inventory 0 false Qt::StrongFocus true Qt::Horizontal QSizePolicy::Expanding 0 10 0 24 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ordered 0 0 Qt::AlignRight Qt::Horizontal 0 20 0 24 Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 24 Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true true None XComboBox::TaxTypes Qt::Horizontal 0 20 Recoverable true Qt::Vertical 20 0 Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _unitPrice CurrDisplay::PurchPrice false 0 0 30 16777215 Qt::NoFocus ... Qt::Vertical 20 0 Qt::Horizontal 0 20 Extended Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _extendedPrice CurrDisplay::ExtPrice false false false Qt::Horizontal 0 20 Line Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _freight true false Qt::Horizontal 0 20 Tax: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 CurrDisplay::PurchPrice false Qt::Horizontal 0 20 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _dueDate Qt::Vertical 20 0 Qt::Horizontal 40 20 Qt::StrongFocus Project #: 0 1 600 0 Qt::ClickFocus 0 Vendor Source Vend. Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 ... Min. Order Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Qty. Mult.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Vendor UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Inv./Vend. UOM Ratio: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 80 0 0 0 Earliest Avail. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _earliestDate false Qt::Vertical 20 0 0 0 Vendor Description: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing Qt::Vertical 20 0 Qt::ClickFocus true Manufacturer Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true 0 0 Qt::Horizontal QSizePolicy::Preferred 150 20 0 Description true Remarks 12 Notes true Comments Qt::Horizontal 40 20 0 0 0 true Qt::ClickFocus Comments::PurchaseOrderItem Characteristics Qt::ClickFocus QAbstractItemView::AllEditTriggers false false Revision true Bill of Materials false RevisionLineEdit::Use RevisionLineEdit::BOM true Bill of Operations false RevisionLineEdit::Use RevisionLineEdit::BOO Qt::Horizontal 40 20 Qt::Vertical 20 0 Qt::Vertical 20 0 Demand 5 Order #: Line # true Qt::Vertical 20 40 Qt::Horizontal QSizePolicy::Expanding 464 20 Comments QWidget

    comments.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ExpenseCluster QWidget
    expensecluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    ProjectCluster QWidget
    projectcluster.h
    RevisionCluster QWidget
    revisioncluster.h
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _inventoryItem _item _warehouse _nonInventoryItem _expcat _ordered _received _taxtype _taxRecoverable _unitPrice _extendedPrice _freight _tax _dueDate _project _tab _vendorItemNumber _vendorItemNumberList _vendorDescrip _minOrderQty _orderQtyMult _invVendorUOMRatio _manufItemDescrip _notesButton _commentsButton _notes _itemcharView _save _close _comments _earliestDate _manufItemNumber _manufName _inventoryItem toggled(bool) _warehouse setEnabled(bool) 70 89 476 120 _inventoryItem toggled(bool) _warehouseLit setEnabled(bool) 70 89 390 120 _inventoryItem toggled(bool) _item setEnabled(bool) 70 89 83 153 _item warehouseIdChanged(int) _warehouse setId(int) 83 153 476 120 _unitPrice effectiveChanged(QDate) _freight setEffective(QDate) 472 287 564 347 _unitPrice effectiveChanged(QDate) _extendedPrice setEffective(QDate) 472 287 564 317 _close clicked() purchaseOrderItem reject() 573 32 20 20 _unitPrice idChanged(int) _freight setId(int) 472 287 564 347 _unitPrice idChanged(int) _extendedPrice setId(int) 472 287 564 317 _inventoryItem toggled(bool) _expcat setReadOnly(bool) 114 89 175 186 _nonInventoryItem toggled(bool) _expcat setEnabled(bool) 122 165 119 187 _item newId(int) _bomRevision setTargetId(int) 190 102 42 547 _item newId(int) _booRevision setTargetId(int) 190 102 264 547 _nonInventoryItem toggled(bool) _bomRevision setDisabled(bool) 299 178 42 547 _nonInventoryItem toggled(bool) _booRevision setDisabled(bool) 299 178 264 547 qt-client-4.1.0/guiclient/purchaseRequest.cpp000066400000000000000000000252031217451700100212660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purchaseRequest.h" #include #include #include #include #include purchaseRequest::purchaseRequest(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_create, SIGNAL(clicked()), this, SLOT(sCreate())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sCheckWarehouse(int))); connect(_number, SIGNAL(textEdited(QString)), this, SLOT(sReleaseNumber())); _planordid = -1; _NumberGen = -1; _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured); _item->setDefaultType(ItemLineEdit::cGeneralPurchased); _lastWarehousid = _warehouse->id(); _number->setValidator(omfgThis->orderVal()); _qty->setValidator(omfgThis->qtyVal()); _project->setType(ProjectLineEdit::PurchaseOrder); if(!_metrics->boolean("UseProjects")) _project->hide(); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } purchaseRequest::~purchaseRequest() { // no need to delete child widgets, Qt does it all for us } void purchaseRequest::languageChange() { retranslateUi(this); } enum SetResponse purchaseRequest::set(const ParameterList &pParams) { XSqlQuery purchaseet; XDialog::set(pParams); QVariant param; bool valid; int prid = -1; param = pParams.value("itemsite_id", &valid); if (valid) { _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); } param = pParams.value("qty", &valid); if (valid) _qty->setDouble(param.toDouble()); param = pParams.value("dueDate", &valid); if (valid) _dueDate->setDate(param.toDate()); param = pParams.value("planord_id", &valid); if (valid) _planordid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; populateNumber(); } else if (param.toString() == "view") { _mode = cView; param = pParams.value("pr_id", &valid); if (valid) prid = param.toInt(); _number->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _qty->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _notes->setEnabled(FALSE); _project->setEnabled(FALSE); _create->hide(); purchaseet.prepare( "SELECT pr_itemsite_id," " pr_number," " pr_qtyreq," " pr_duedate," " pr_prj_id " "FROM pr " "WHERE (pr_id=:pr_id);" ); purchaseet.bindValue(":pr_id", prid); purchaseet.exec(); if (purchaseet.first()) { _number->setText(purchaseet.value("pr_number").toString()); _item->setItemsiteid(purchaseet.value("pr_itemsite_id").toInt()); _qty->setDouble(purchaseet.value("pr_qtyreq").toDouble()); _dueDate->setDate(purchaseet.value("pr_duedate").toDate()); _project->setId(purchaseet.value("pr_prj_id").toInt()); } } else if (param.toString() == "release") { _mode = cRelease; _captive = TRUE; _number->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _qty->setEnabled(FALSE); _dueDate->setEnabled(FALSE); purchaseet.prepare( "SELECT planord_itemsite_id, planord_duedate," " planord_qty, planord_comments " "FROM planord " "WHERE (planord_id=:planord_id);" ); purchaseet.bindValue(":planord_id", _planordid); purchaseet.exec(); if (purchaseet.first()) { _item->setItemsiteid(purchaseet.value("planord_itemsite_id").toInt()); _qty->setDouble(purchaseet.value("planord_qty").toDouble()); _dueDate->setDate(purchaseet.value("planord_duedate").toDate()); _notes->setText(purchaseet.value("planord_comments").toString()); populateNumber(); } } } return NoError; } void purchaseRequest::sClose() { closeEvent(NULL); reject(); } void purchaseRequest::sCreate() { XSqlQuery purchaseCreate; if (!_number->text().length()) { QMessageBox::information( this, tr("Invalid Purchase Request Number"), tr("You must enter a valid Purchase Request number before creating this Purchase Request") ); _number->setFocus(); return; } if (!(_item->isValid())) { QMessageBox::information( this, tr("No Item Number Selected"), tr("You must enter or select a valid Item number before creating this Purchase Request") ); return; } if (_qty->toDouble() == 0.0) { QMessageBox::information( this, tr("Invalid Quantity Ordered"), tr( "You have entered an invalid Qty. Ordered.\n" "Please correct before creating this Purchase Request." ) ); _qty->setFocus(); return; } if (!_dueDate->isValid()) { QMessageBox::information( this, tr("Invalid Due Date Entered"), tr( "You have entered an invalid Due Date.\n" "Please correct before creating this Purchase Request." ) ); _dueDate->setFocus(); return; } purchaseCreate.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); purchaseCreate.bindValue(":item_id", _item->id()); purchaseCreate.bindValue(":warehous_id", _warehouse->id()); purchaseCreate.exec(); if (!purchaseCreate.first()) { QMessageBox::warning(this, tr("Invalid Site"), tr("The selected Site for this Purchase Request is not\n" "a \"Supplied At\" Site. You must select a different\n" "Site before creating the Purchase Request.") ); return; } int prid = -1; int itemsiteid = purchaseCreate.value("itemsite_id").toInt(); if (_mode == cNew) { purchaseCreate.prepare( "SELECT createPr( :orderNumber, :itemsite_id, :qty," " :dueDate, :notes ) AS prid;" ); purchaseCreate.bindValue(":orderNumber", _number->text().toInt()); purchaseCreate.bindValue(":itemsite_id", itemsiteid); purchaseCreate.bindValue(":qty", _qty->toDouble()); purchaseCreate.bindValue(":dueDate", _dueDate->date()); purchaseCreate.bindValue(":notes", _notes->toPlainText()); purchaseCreate.exec(); if (!purchaseCreate.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } else prid = purchaseCreate.value("prid").toInt(); } else if (_mode == cRelease) { purchaseCreate.prepare("SELECT createPr(:orderNumber, 'F', :planord_id, :notes) AS prid;"); purchaseCreate.bindValue(":orderNumber", _number->text().toInt()); purchaseCreate.bindValue(":planord_id", _planordid); purchaseCreate.bindValue(":notes", _notes->toPlainText()); purchaseCreate.exec(); if (purchaseCreate.first()) { prid = purchaseCreate.value("prid").toInt(); purchaseCreate.prepare("SELECT releasePlannedOrder(:planord_id, FALSE) AS result;"); purchaseCreate.bindValue(":planord_id", _planordid); purchaseCreate.exec(); } } if(-1 != prid) { purchaseCreate.prepare("UPDATE pr SET pr_prj_id=:prj_id WHERE (pr_id=:pr_id);"); purchaseCreate.bindValue(":pr_id", prid); purchaseCreate.bindValue(":prj_id", _project->id()); purchaseCreate.exec(); } omfgThis->sPurchaseRequestsUpdated(); if (_captive) done(prid); else { populateNumber(); _item->setId(-1); _qty->clear(); _dueDate->setNull(); _notes->clear(); _item->setFocus(); } } void purchaseRequest::populateNumber() { XSqlQuery purchasepopulateNumber; QString generationMethod = _metrics->value("PrNumberGeneration"); if ((generationMethod == "A") || (generationMethod == "O")) { purchasepopulateNumber.exec("SELECT fetchPrNumber() AS number;"); if (!purchasepopulateNumber.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); _number->setText("Error"); return; } _number->setText(purchasepopulateNumber.value("number").toString()); _NumberGen = purchasepopulateNumber.value("number").toInt(); } if (generationMethod == "M") { _number->setEnabled(TRUE); _number->setFocus(); } else if (generationMethod == "O") { _number->setEnabled(TRUE); _item->setFocus(); } else if (generationMethod == "A") { _number->setEnabled(FALSE); _item->setFocus(); } } void purchaseRequest::closeEvent(QCloseEvent *pEvent) { if ( ((_mode == cNew) || (_mode == cRelease)) && ((_metrics->value("PrNumberGeneration") == "A") || (_metrics->value("PrNumberGeneration") == "O")) ) sReleaseNumber(); if (pEvent != NULL) XDialog::closeEvent(pEvent); } void purchaseRequest::sNumberChanged() { if(-1 != _NumberGen && _number->text().toInt() != _NumberGen) sReleaseNumber(); } void purchaseRequest::sReleaseNumber() { XSqlQuery purchaseReleaseNumber; if(-1 != _NumberGen) { purchaseReleaseNumber.prepare("SELECT releasePrNumber(:number);" ); purchaseReleaseNumber.bindValue(":number", _NumberGen); purchaseReleaseNumber.exec(); if (purchaseReleaseNumber.lastError().type() != QSqlError::NoError) systemError(this, purchaseReleaseNumber.lastError().databaseText(), __FILE__, __LINE__); _NumberGen = -1; } } void purchaseRequest::sCheckWarehouse( int pWarehousid ) { if(_mode != cRelease) return; if(_lastWarehousid == pWarehousid) return; _lastWarehousid = pWarehousid; if(pWarehousid == -1) { QMessageBox::warning(this, tr("Invalid Site"), tr("The selected Site for this Purchase Request is not\n" "a \"Supplied At\" Site. You must select a different\n" "Site before creating the Purchase Request.") ); _warehouse->setEnabled(TRUE); } } qt-client-4.1.0/guiclient/purchaseRequest.h000066400000000000000000000025001217451700100207260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURCHASEREQUEST_H #define PURCHASEREQUEST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_purchaseRequest.h" class purchaseRequest : public XDialog, public Ui::purchaseRequest { Q_OBJECT public: purchaseRequest(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~purchaseRequest(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sClose(); virtual void sCreate(); virtual void populateNumber(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sNumberChanged(); virtual void sReleaseNumber(); protected slots: virtual void languageChange(); virtual void sCheckWarehouse(int); private: int _mode; bool _captive; int _planordid; int _lastWarehousid; int _NumberGen; }; #endif // PURCHASEREQUEST_H qt-client-4.1.0/guiclient/purchaseRequest.ui000066400000000000000000000313441217451700100211240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purchaseRequest true 0 0 513 454 Purchase Request 12 12 5 5 5 Purchase Request #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::StrongFocus 1 &Close false C&reate true Qt::Vertical QSizePolicy::Preferred 20 40 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 0 WComboBox::Supply Qt::Horizontal QSizePolicy::Expanding 20 0 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 0 0 0 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 0 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 Qt::StrongFocus Project #: Qt::Vertical 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Notes: 0 1 true true DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    ProjectCluster QWidget
    projectcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _item _warehouse _qty _dueDate _project _notes _create _close _item valid(bool) _create setEnabled(bool) 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/purgeClosedWorkOrders.cpp000066400000000000000000000045171217451700100224060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purgeClosedWorkOrders.h" #include /* * Constructs a purgeClosedWorkOrders as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ purgeClosedWorkOrders::purgeClosedWorkOrders(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_purge, SIGNAL(clicked()), this, SLOT(sPurge())); } /* * Destroys the object and frees any allocated resources */ purgeClosedWorkOrders::~purgeClosedWorkOrders() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void purgeClosedWorkOrders::languageChange() { retranslateUi(this); } void purgeClosedWorkOrders::sPurge() { XSqlQuery purgePurge; // note that below is the code for performing this as a stored procedure // and we should implement this after version 2.1 if (_cutOffDate->isValid()) { if (_warehouse->isAll()) purgePurge.prepare("SELECT MIN(deleteWo(wo_id, false)) AS result" " FROM wo" " WHERE ((wo_status = 'C')" " AND (wo_duedate <= :cutoffDate))"); else purgePurge.prepare("SELECT MIN(deleteWo(wo_id, false)) AS result" " FROM wo, itemsite" " WHERE ((wo_status = 'C')" " AND (wo_duedate <= :cutoffDate)" " AND (wo_itemsite_id = itemsite_id)" " AND (itemsite_warehous_id = :whs_id))"); purgePurge.bindValue(":cutoffDate", _cutOffDate->date()); purgePurge.bindValue(":whs_id", _warehouse->id()); purgePurge.exec(); _cutOffDate->clear(); _cutOffDate->setFocus(); } } qt-client-4.1.0/guiclient/purgeClosedWorkOrders.h000066400000000000000000000017101217451700100220430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURGECLOSEDWORKORDERS_H #define PURGECLOSEDWORKORDERS_H #include "guiclient.h" #include "xdialog.h" #include "ui_purgeClosedWorkOrders.h" class purgeClosedWorkOrders : public XDialog, public Ui::purgeClosedWorkOrders { Q_OBJECT public: purgeClosedWorkOrders(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~purgeClosedWorkOrders(); public slots: virtual void sPurge(); protected slots: virtual void languageChange(); }; #endif // PURGECLOSEDWORKORDERS_H qt-client-4.1.0/guiclient/purgeClosedWorkOrders.ui000066400000000000000000000124141217451700100222340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purgeClosedWorkOrders 0 0 362 125 Purge Closed Work Orders 0 5 5 Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Preferred 0 10 false Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal QSizePolicy::Expanding 25 20 5 &Cancel &Purge true Qt::Vertical QSizePolicy::Expanding 20 0 DLineEdit QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _cutOffDate _warehouse _purge _close _close clicked() purgeClosedWorkOrders reject() 20 20 20 20
    qt-client-4.1.0/guiclient/purgeCreditMemos.cpp000066400000000000000000000034141217451700100213610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purgeCreditMemos.h" #include #include purgeCreditMemos::purgeCreditMemos(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_purge, SIGNAL(clicked()), this, SLOT(sPurge())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); } purgeCreditMemos::~purgeCreditMemos() { // no need to delete child widgets, Qt does it all for us } void purgeCreditMemos::languageChange() { retranslateUi(this); } void purgeCreditMemos::sPurge() { XSqlQuery purgePurge; if (!_cutOffDate->isValid()) { QMessageBox::warning( this, tr("Enter Cutoff Date"), tr("You must enter a valid cutoff date before purging Invoice Records.") ); return; } if ( QMessageBox::warning( this, tr("Delete Invoice Records"), tr( "You will not be able to re-print a Credit Memo if you delete it.\n" "Are you sure that you want to delete the selected Credit Memos?" ), tr("Yes"), tr("No"), QString::null, 0, 1) == 0) { purgePurge.prepare("SELECT purgeCreditMemos(:cutOffDate) AS result;"); purgePurge.bindValue(":cutOffDate", _cutOffDate->date()); purgePurge.exec(); accept(); } } qt-client-4.1.0/guiclient/purgeCreditMemos.h000066400000000000000000000016401217451700100210250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURGECREDITMEMOS_H #define PURGECREDITMEMOS_H #include "guiclient.h" #include "xdialog.h" #include "ui_purgeCreditMemos.h" class purgeCreditMemos : public XDialog, public Ui::purgeCreditMemos { Q_OBJECT public: purgeCreditMemos(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~purgeCreditMemos(); public slots: virtual void sPurge(); protected slots: virtual void languageChange(); }; #endif // PURGECREDITMEMOS_H qt-client-4.1.0/guiclient/purgeCreditMemos.ui000066400000000000000000000136571217451700100212260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purgeCreditMemos 0 0 332 80 5 5 0 0 Purge Credit Memos 5 7 0 0 0 0 0 5 Cu&t Off Date: Qt::AlignVCenter|Qt::AlignRight _cutOffDate 67 20 Expanding Horizontal 20 36 Expanding Vertical 0 0 0 5 &Cancel &Purge true 20 16 Expanding Vertical _cutOffDate _purge _close _close clicked() purgeCreditMemos reject() qt-client-4.1.0/guiclient/purgeInvoices.cpp000066400000000000000000000106441217451700100207300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purgeInvoices.h" #include #include #include #include purgeInvoices::purgeInvoices(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_purge, SIGNAL(clicked()), this, SLOT(sPurge())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); } purgeInvoices::~purgeInvoices() { // no need to delete child widgets, Qt does it all for us } void purgeInvoices::languageChange() { retranslateUi(this); } void purgeInvoices::sPurge() { XSqlQuery purgePurge; if (!_cutOffDate->isValid()) { QMessageBox::warning( this, tr("Enter Cutoff Date"), tr("You must enter a valid cutoff date before purging Invoice Records.") ); return; } if ( QMessageBox::warning( this, tr("Delete Invoice Records"), tr( "This function will purge Invoices and all of the associated documents including:\n" "Return Authorizations, Lot/Serial Registrations, Sales Orders, Shipments, and Billing.\n" "The results of the process are saved in the log file purgeInvoices.log.\n" "You will not be able to re-print an Invoice if you delete that Invoice's Records.\n" "\n" "Are you sure that you want to delete the selected Invoice Records?" ), tr("Yes"), tr("No"), QString::null, 0, 1) == 0) { QString logpath; QString logname; QString logtogether; logpath = ""; logname = "purgeInvoices.log"; logtogether = logpath + logname; QFile logfile(logtogether); logfile.remove(); logfile.open(QIODevice::WriteOnly); int _invoices = 1; int _kount = 1; XSqlQuery invoices; invoices.prepare("SELECT COUNT(*) AS invoice_count " "FROM invchead " "WHERE ( (invchead_invcdate <= :cutOffDate) " " AND (invchead_posted) " " AND (invchead_recurring_invchead_id!=invchead_id) " " AND (checkInvoiceSitePrivs(invchead_id)) );"); invoices.bindValue(":cutOffDate", _cutOffDate->date()); invoices.exec(); if (invoices.first()) _invoices = (invoices.value("invoice_count").toInt()); QProgressDialog _progress(tr("Purge Invoices in progress..."), tr("Cancel"), 0, _invoices, this); _progress.setWindowModality(Qt::WindowModal); invoices.prepare("SELECT invchead_id, invchead_invcnumber " "FROM invchead " "WHERE ( (invchead_invcdate <= :cutOffDate) " " AND (invchead_posted) " " AND (NOT invchead_recurring) " " AND (checkInvoiceSitePrivs(invchead_id)) );"); invoices.bindValue(":cutOffDate", _cutOffDate->date()); invoices.exec(); while (invoices.next()) { purgePurge.prepare("SELECT purgeInvoiceRecord(:cutOffDate, :invchead_id) AS result;"); purgePurge.bindValue(":cutOffDate", _cutOffDate->date()); purgePurge.bindValue(":invchead_id", invoices.value("invchead_id").toInt()); purgePurge.exec(); if (purgePurge.first()) { QString logmessage = "Invoice "; logmessage += invoices.value("invchead_invcnumber").toString(); logmessage += ", result="; logmessage += purgePurge.value("result").toString(); logfile.write(logmessage.toAscii()); logfile.write("\n"); } if (_progress.wasCanceled()) break; _progress.setValue(_kount); _kount++; } _progress.setValue(_invoices); // Purge T/O shipments that aren't invoiced purgePurge.prepare("SELECT purgeShipments(:cutOffDate) AS result;"); purgePurge.bindValue(":cutOffDate", _cutOffDate->date()); purgePurge.exec(); accept(); } } qt-client-4.1.0/guiclient/purgeInvoices.h000066400000000000000000000016101217451700100203660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURGEINVOICES_H #define PURGEINVOICES_H #include "guiclient.h" #include "xdialog.h" #include "ui_purgeInvoices.h" class purgeInvoices : public XDialog, public Ui::purgeInvoices { Q_OBJECT public: purgeInvoices(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~purgeInvoices(); public slots: virtual void sPurge(); protected slots: virtual void languageChange(); }; #endif // PURGEINVOICES_H qt-client-4.1.0/guiclient/purgeInvoices.ui000066400000000000000000000136421217451700100205640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purgeInvoices 0 0 332 80 5 5 0 0 Purge Invoices 5 7 0 0 0 0 0 5 Cu&t Off Date: Qt::AlignVCenter|Qt::AlignRight _cutOffDate 20 20 Expanding Horizontal 20 36 Expanding Vertical 0 0 0 5 &Cancel &Purge true 20 16 Expanding Vertical _cutOffDate _purge _close _close clicked() purgeInvoices reject() qt-client-4.1.0/guiclient/purgePostedCountSlips.cpp000066400000000000000000000026271217451700100224350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purgePostedCountSlips.h" purgePostedCountSlips::purgePostedCountSlips(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_purge, SIGNAL(clicked()), this, SLOT(sPurge())); } purgePostedCountSlips::~purgePostedCountSlips() { // no need to delete child widgets, Qt does it all for us } void purgePostedCountSlips::languageChange() { retranslateUi(this); } void purgePostedCountSlips::sPurge() { XSqlQuery purgePurge; if (_cutOffDate->isValid()) { purgePurge.prepare("SELECT purgePostedCountSlips(:cutOffDate, :warehous_id) AS _result;"); purgePurge.bindValue(":cutOffDate", _cutOffDate->date()); purgePurge.bindValue(":warehous_id", ((_warehouse->isSelected()) ? _warehouse->id() : -1)); purgePurge.exec(); _cutOffDate->clear(); _close->setText(tr("&Close")); } } qt-client-4.1.0/guiclient/purgePostedCountSlips.h000066400000000000000000000017101217451700100220720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURGEPOSTEDCOUNTSLIPS_H #define PURGEPOSTEDCOUNTSLIPS_H #include "guiclient.h" #include "xdialog.h" #include "ui_purgePostedCountSlips.h" class purgePostedCountSlips : public XDialog, public Ui::purgePostedCountSlips { Q_OBJECT public: purgePostedCountSlips(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~purgePostedCountSlips(); public slots: virtual void sPurge(); protected slots: virtual void languageChange(); }; #endif // PURGEPOSTEDCOUNTSLIPS_H qt-client-4.1.0/guiclient/purgePostedCountSlips.ui000066400000000000000000000146631217451700100222730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purgePostedCountSlips 0 0 350 153 Purge Posted Count Slips 0 5 5 Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Preferred 0 10 false Qt::Vertical QSizePolicy::Expanding 20 16 0 Qt::Horizontal QSizePolicy::Expanding 16 20 5 true 0 0 0 0 &Cancel &Purge true Qt::Vertical QSizePolicy::Preferred 20 20 DLineEdit QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _cutOffDate _warehouse _purge _close _close clicked() purgePostedCountSlips reject() 20 20 20 20
    qt-client-4.1.0/guiclient/purgePostedCounts.cpp000066400000000000000000000026301217451700100215770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purgePostedCounts.h" purgePostedCounts::purgePostedCounts(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_purge, SIGNAL(clicked()), this, SLOT(sPurge())); } purgePostedCounts::~purgePostedCounts() { // no need to delete child widgets, Qt does it all for us } void purgePostedCounts::languageChange() { retranslateUi(this); } void purgePostedCounts::sPurge() { XSqlQuery purgePurge; if (_cutOffDate->isValid()) { purgePurge.prepare("SELECT purgePostedCountTags(:cutOffDate, :warehous_id) AS _result;"); purgePurge.bindValue(":cutOffDate", _cutOffDate->date()); purgePurge.bindValue(":warehous_id", ((_warehouse->isSelected()) ? _warehouse->id() : -1)); purgePurge.exec(); _cutOffDate->clear(); _cutOffDate->setFocus(); _close->setText(tr("&Cancel")); } } qt-client-4.1.0/guiclient/purgePostedCounts.h000066400000000000000000000016501217451700100212450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef PURGEPOSTEDCOUNTS_H #define PURGEPOSTEDCOUNTS_H #include "guiclient.h" #include "xdialog.h" #include "ui_purgePostedCounts.h" class purgePostedCounts : public XDialog, public Ui::purgePostedCounts { Q_OBJECT public: purgePostedCounts(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~purgePostedCounts(); public slots: virtual void sPurge(); protected slots: virtual void languageChange(); }; #endif // PURGEPOSTEDCOUNTS_H qt-client-4.1.0/guiclient/purgePostedCounts.ui000066400000000000000000000161031217451700100214320ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. purgePostedCounts 0 0 321 153 Purge Posted Count Tags 0 5 5 Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 100 32767 Qt::Horizontal QSizePolicy::Preferred 0 10 false Qt::Vertical QSizePolicy::Expanding 20 27 0 Qt::Horizontal QSizePolicy::Expanding 16 20 5 true 0 0 0 0 &Cancel &Purge true Qt::Vertical QSizePolicy::Expanding 20 20 DLineEdit QWidget
    datecluster.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _cutOffDate _warehouse _purge _close _close clicked() purgePostedCounts reject() 20 20 20 20
    qt-client-4.1.0/guiclient/qdesigner_integration_p.h000066400000000000000000000132631217451700100224560ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain ** additional rights. These rights are described in the Nokia Qt LGPL ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this ** package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** $QT_END_LICENSE$ ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef QDESIGNER_INTEGRATION_H #define QDESIGNER_INTEGRATION_H #include "shared_global_p.h" #include #include QT_BEGIN_NAMESPACE class QDesignerFormEditorInterface; class QDesignerFormWindowInterface; class QDesignerResourceBrowserInterface; class QVariant; class QWidget; namespace qdesigner_internal { struct Selection; class QDesignerIntegrationPrivate; class QDESIGNER_SHARED_EXPORT QDesignerIntegration: public QDesignerIntegrationInterface { Q_OBJECT public: explicit QDesignerIntegration(QDesignerFormEditorInterface *core, QObject *parent = 0); virtual ~QDesignerIntegration(); static void requestHelp(const QDesignerFormEditorInterface *core, const QString &manual, const QString &document); virtual QWidget *containerWindow(QWidget *widget) const; // Load plugins into widget database and factory. static void initializePlugins(QDesignerFormEditorInterface *formEditor); void emitObjectNameChanged(QDesignerFormWindowInterface *formWindow, QObject *object, const QString &newName, const QString &oldName); void emitNavigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames); void emitNavigateToSlot(const QString &slotSignature); // Create a resource browser specific to integration. Language integration takes precedence virtual QDesignerResourceBrowserInterface *createResourceBrowser(QWidget *parent = 0); enum ResourceFileWatcherBehaviour { NoWatcher, ReloadSilently, PromptAndReload }; ResourceFileWatcherBehaviour resourceFileWatcherBehaviour() const; bool isResourceEditingEnabled() const; bool isSlotNavigationEnabled() const; QString contextHelpId() const; protected: void setResourceFileWatcherBehaviour(ResourceFileWatcherBehaviour behaviour); // PromptAndReload by default void setResourceEditingEnabled(bool enable); // true by default void setSlotNavigationEnabled(bool enable); // false by default signals: void propertyChanged(QDesignerFormWindowInterface *formWindow, const QString &name, const QVariant &value); void objectNameChanged(QDesignerFormWindowInterface *formWindow, QObject *object, const QString &newName, const QString &oldName); void helpRequested(const QString &manual, const QString &document); void navigateToSlot(const QString &objectName, const QString &signalSignature, const QStringList ¶meterNames); void navigateToSlot(const QString &slotSignature); public slots: virtual void updateProperty(const QString &name, const QVariant &value, bool enableSubPropertyHandling); // Additional signals of designer property editor virtual void resetProperty(const QString &name); virtual void addDynamicProperty(const QString &name, const QVariant &value); virtual void removeDynamicProperty(const QString &name); virtual void updateActiveFormWindow(QDesignerFormWindowInterface *formWindow); virtual void setupFormWindow(QDesignerFormWindowInterface *formWindow); virtual void updateSelection(); virtual void updateGeometry(); virtual void activateWidget(QWidget *widget); void updateCustomWidgetPlugins(); private slots: void updatePropertyPrivate(const QString &name, const QVariant &value); private: void initialize(); void getSelection(Selection &s); QObject *propertyEditorObject(); QDesignerIntegrationPrivate *m_d; }; } // namespace qdesigner_internal QT_END_NAMESPACE #endif // QDESIGNER_INTEGRATION_H qt-client-4.1.0/guiclient/quotes.cpp000066400000000000000000000375571217451700100174420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "quotes.h" #include #include #include #include #include #include #include #include "customer.h" #include "failedPostList.h" #include "parameterwidget.h" #include "printQuote.h" #include "salesOrder.h" #include "storedProcErrorLookup.h" quotes::quotes(QWidget* parent, const char *name, Qt::WFlags fl) : display(parent, "quotes", fl) { setupUi(optionsWidget()); if (name) setObjectName(name); setWindowTitle(tr("Quotes")); setMetaSQLOptions("quotes", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setQueryOnStartEnabled(true); _convertedtoSo->setVisible(false); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->append(tr("Exclude Prospects"), "customersOnly", ParameterWidget::Exists); parameterWidget()->append(tr("Customer"), "cust_id", ParameterWidget::Customer); parameterWidget()->appendComboBox(tr("Customer Type"), "custtype_id", XComboBox::CustomerTypes); parameterWidget()->append(tr("Customer Type Pattern"), "custtype_pattern", ParameterWidget::Text); parameterWidget()->append(tr("P/O Number"), "poNumber", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Sales Rep."), "salesrep_id", XComboBox::SalesRepsActive); parameterWidget()->append(tr("Start Date"), "startDate", ParameterWidget::Date); parameterWidget()->append(tr("End Date"), "endDate", ParameterWidget::Date); list()->addColumn(tr("Quote #"), _orderColumn, Qt::AlignRight, true, "quhead_number"); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "quhead_billtoname"); list()->addColumn(tr("P/O Number"), -1, Qt::AlignLeft, true, "quhead_custponumber"); list()->addColumn(tr("Status"), _dateColumn, Qt::AlignCenter,true, "quhead_status"); list()->addColumn(tr("Quote Date"), _dateColumn, Qt::AlignCenter,true, "quhead_quotedate"); list()->addColumn(tr("Expire Date"), _dateColumn, Qt::AlignCenter,false, "quhead_expire"); list()->addColumn(tr("Notes"), -1, Qt::AlignCenter,true, "notes"); list()->setSelectionMode(QAbstractItemView::ExtendedSelection); if (_privileges->check("MaintainQuotes")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(FALSE); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sFillList())); } enum SetResponse quotes::set(const ParameterList& pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("run", &valid); if (valid) sFillList(); return NoError; } void quotes::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Print..."), this, SLOT(sPrint())); menuItem->setEnabled(_privileges->check("PrintQuotes")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Convert to S/O..."), this, SLOT(sConvertSalesOrder())); menuItem->setEnabled(_privileges->check("ConvertQuotes")); menuItem = pMenu->addAction(tr("Convert to Invoice..."), this, SLOT(sConvertInvoice())); menuItem->setEnabled(_privileges->check("ConvertQuotesInvoice")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Copy"), this, SLOT(sCopy())); menuItem->setEnabled(_privileges->check("MaintainQuotes")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainQuotes")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainQuotes")); } void quotes::sPrint() { printQuote newdlg(this); foreach (XTreeWidgetItem *item, list()->selectedItems()) { ParameterList params; params.append("quhead_id", item->id()); params.append("persistentPrint"); newdlg.set(params); if (! newdlg.isSetup()) { if (newdlg.exec() == QDialog::Rejected) break; newdlg.setSetup(true); } } } void quotes::sConvert(int pType) { QString docType = "Sales Order"; if (pType == 1) docType = "Invoice"; if (QMessageBox::question(this, tr("Convert Selected Quote(s)"), tr("

    Are you sure that you want to convert " "the selected Quote(s) to %1(s)?").arg(docType), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery convert; convert.prepare("SELECT convertQuote(:quhead_id) AS sohead_id;"); if (pType == 1) convert.prepare("SELECT convertQuoteToInvoice(:quhead_id) AS sohead_id;"); XSqlQuery prospectq; prospectq.prepare("SELECT convertProspectToCustomer(quhead_cust_id) AS result " "FROM quhead " "WHERE (quhead_id=:quhead_id);"); bool tryagain = false; QList converted; do { tryagain = false; int soheadid = -1; QList selected = list()->selectedItems(); QList notConverted; for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int quheadid = ((XTreeWidgetItem*)(selected[i]))->id(); XSqlQuery check; check.prepare("SELECT * FROM quhead WHERE (quhead_id = :quhead_id) AND (quhead_status ='C');"); check.bindValue(":quhead_id", quheadid); check.exec(); if (check.first()) { QMessageBox::critical(this, tr("Can not Convert"), tr("

    One or more of the selected Quotes have" " been converted. You cannot convert an already" " converted Quote.")); return; } else { convert.bindValue(":quhead_id", quheadid); convert.exec(); } if (convert.first()) { soheadid = convert.value("sohead_id").toInt(); if (soheadid == -3) { if ((_metrics->value("DefaultSalesRep").toInt() > 0) && (_metrics->value("DefaultTerms").toInt() > 0) && (_metrics->value("DefaultCustType").toInt() > 0) && (_metrics->value("DefaultShipFormId").toInt() > 0) && (_privileges->check("MaintainCustomerMasters"))) { if (QMessageBox::question(this, tr("Quote for Prospect"), tr("

    This Quote is for a Prospect, not " "a Customer. Do you want to convert " "the Prospect to a Customer using global " "default values?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { prospectq.bindValue(":quhead_id", quheadid); prospectq.exec(); if (prospectq.first()) { int result = prospectq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("convertProspectToCustomer", result), __FILE__, __LINE__); notConverted.append(selected[i]); continue; } convert.exec(); if (convert.first()) { soheadid = convert.value("sohead_id").toInt(); if (soheadid < 0) { QMessageBox::warning(this, tr("Cannot Convert Quote"), storedProcErrorLookup("convertQuote", soheadid) .arg(selected[i] ? selected[i]->text(0) : "")); notConverted.append(selected[i]); continue; } } } else if (prospectq.lastError().type() != QSqlError::NoError) { systemError(this, prospectq.lastError().databaseText(), __FILE__, __LINE__); notConverted.append(selected[i]); continue; } } else { QMessageBox::information(this, tr("Quote for Prospect"), tr("

    The prospect must be manually " "converted to customer from either the " "CRM Account or Customer windows before " "coverting this quote.")); notConverted.append(selected[i]); continue; } } else { QMessageBox::information(this, tr("Quote for Prospect"), tr("

    The prospect must be manually " "converted to customer from either the " "CRM Account or Customer windows before " "coverting this quote.")); notConverted.append(selected[i]); continue; } } else if (soheadid < 0) { QMessageBox::warning(this, tr("Cannot Convert Quote"), storedProcErrorLookup("convertQuote", soheadid) .arg(selected[i] ? selected[i]->text(0) : "")); notConverted.append(selected[i]); continue; } converted << quheadid; if (pType == 0) { omfgThis->sSalesOrdersUpdated(soheadid); salesOrder::editSalesOrder(soheadid, true); } else omfgThis->sQuotesUpdated(soheadid); } else if (convert.lastError().type() != QSqlError::NoError) { notConverted.append(selected[i]); systemError(this, convert.lastError().databaseText(), __FILE__, __LINE__); continue; } } } if (notConverted.size() > 0) { failedPostList newdlg(this, "", true); newdlg.setLabel(tr("

    The following Quotes could not be converted.")); newdlg.sSetList(notConverted, list()->headerItem(), list()->header()); tryagain = (newdlg.exec() == XDialog::Accepted); selected = notConverted; notConverted.clear(); } } while (tryagain); for (int i = 0; i < converted.size(); i++) { omfgThis->sQuotesUpdated(converted[i]); } } // if user wants to convert } void quotes::sConvertSalesOrder() { sConvert(0); } void quotes::sConvertInvoice() { sConvert(1); } void quotes::sCopy() { QList selected = list()->selectedItems(); int lastid = -1; for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int qid = ((XTreeWidgetItem*)(selected[i]))->id(); XSqlQuery qq; qq.prepare("SELECT copyQuote(:qid, null) AS result;"); qq.bindValue(":qid", qid); if(qq.exec() && qq.first()) { lastid = qq.value("result").toInt(); } else if(qq.lastError().type() != QSqlError::NoError) { systemError(this, qq.lastError().text(), __FILE__, __LINE__); return; } } } if(lastid != -1) omfgThis->sQuotesUpdated(lastid); } void quotes::sNew() { ParameterList params; params.append("mode", "newQuote"); parameterWidget()->appendValue(params); // To pick up customer id, if any salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void quotes::sEdit() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { ParameterList params; params.append("mode", "editQuote"); params.append("quhead_id", ((XTreeWidgetItem*)(selected[i]))->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); break; } } } void quotes::sView() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { ParameterList params; params.append("mode", "viewQuote"); params.append("quhead_id", ((XTreeWidgetItem*)(selected[i]))->id()); salesOrder *newdlg = new salesOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); break; } } } void quotes::sDelete() { XSqlQuery quotesDelete; if (QMessageBox::question(this, tr("Delete Selected Quotes"), tr("

    Are you sure that you want to delete the " "selected Quotes?" ), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { quotesDelete.prepare("SELECT deleteQuote(:quhead_id) AS result;"); int counter = 0; QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { quotesDelete.bindValue(":quhead_id", ((XTreeWidgetItem*)(selected[i]))->id()); quotesDelete.exec(); if (quotesDelete.first()) { int result = quotesDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteQuote", result), __FILE__, __LINE__); continue; } counter++; } else if (quotesDelete.lastError().type() != QSqlError::NoError) { systemError(this, tr("A System Error occurred deleting Quote #%1\n%2.") .arg(selected[i]->text(0)) .arg(quotesDelete.lastError().databaseText()), __FILE__, __LINE__); continue; } } } if (counter) omfgThis->sQuotesUpdated(-1); } } bool quotes::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkQuoteSitePrivs(:quheadid) AS result;"); check.bindValue(":quheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view, edit, or convert this Quote as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } bool quotes::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; if(_showExpired->isChecked()) params.append("showExpired"); if(_convertedtoSo->isChecked()) params.append("showConverted"); params.append("open", tr("Open")); params.append("converted", tr("Converted")); params.append("undefined", tr("Undefined")); return true; } qt-client-4.1.0/guiclient/quotes.h000066400000000000000000000023331217451700100170670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef QUOTES_H #define QUOTES_H #include "display.h" #include "ui_quotes.h" class quotes : public display, public Ui::quotes { Q_OBJECT public: quotes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); public slots: virtual enum SetResponse set(const ParameterList&); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sPrint(); virtual void sConvert(int); virtual void sConvertSalesOrder(); virtual void sConvertInvoice(); virtual void sCopy(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual bool setParams(ParameterList &); signals: void finishedPrinting(int); }; #endif // QUOTES_H qt-client-4.1.0/guiclient/quotes.ui000066400000000000000000000041041217451700100172530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. quotes 0 0 356 51 List Quotes 12 Show Expired true Show Converted true Qt::Horizontal 40 20 XCheckBox QCheckBox

    xcheckbox.h
    qt-client-4.1.0/guiclient/rcguiclient.rc000066400000000000000000000001001217451700100202220ustar00rootroot00000000000000IDI_ICON1 ICON DISCARDABLE "xTuple.ico" qt-client-4.1.0/guiclient/reasonCode.cpp000066400000000000000000000124631217451700100201710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reasonCode.h" #include #include const char *_docTypes[] = { "ARCM", "ARDM", "RA" }; reasonCode::reasonCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _rsncodeid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } reasonCode::~reasonCode() { // no need to delete child widgets, Qt does it all for us } void reasonCode::languageChange() { retranslateUi(this); } enum SetResponse reasonCode::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("rsncode_id", &valid); if (valid) { _rsncodeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void reasonCode::sSave() { XSqlQuery reasonSave; if (_code->text().length() == 0) { QMessageBox::information( this, tr("Invalid Reason Code"), tr("You must enter a valid code for this Reason Code.") ); _code->setFocus(); return; } reasonSave.prepare( "SELECT rsncode_id" " FROM rsncode" " WHERE((UPPER(rsncode_code)=UPPER(:rsncode_code))" " AND (rsncode_id != :rsncode_id));" ); reasonSave.bindValue(":rsncode_code", _code->text()); reasonSave.bindValue(":rsncode_id", _rsncodeid); reasonSave.exec(); if (reasonSave.first()) { QMessageBox::information( this, tr("Cannot Save Reason Code"), tr("The Code you have entered for this Reason Code already exists. " "Please enter in a different Code for this Reason Code.")); _code->setFocus(); return; } if (_mode == cNew) { reasonSave.exec("SELECT NEXTVAL('rsncode_rsncode_id_seq') AS rsncode_id"); if (reasonSave.first()) _rsncodeid = reasonSave.value("rsncode_id").toInt(); reasonSave.prepare( "INSERT INTO rsncode " "(rsncode_id, rsncode_code, rsncode_descrip, rsncode_doctype) " "VALUES " "(:rsncode_id, :rsncode_code, :rsncode_descrip, :rsncode_doctype);" ); } else if (_mode == cEdit) reasonSave.prepare( "UPDATE rsncode " "SET rsncode_code=:rsncode_code," " rsncode_descrip=:rsncode_descrip," " rsncode_doctype=:rsncode_doctype " "WHERE (rsncode_id=:rsncode_id);" ); reasonSave.bindValue(":rsncode_id", _rsncodeid); reasonSave.bindValue(":rsncode_code", _code->text()); reasonSave.bindValue(":rsncode_descrip", _description->text().trimmed()); if (!_allDocTypes->isChecked()) reasonSave.bindValue(":rsncode_doctype", _docTypes[_docType->currentIndex()]); reasonSave.exec(); done(_rsncodeid); } void reasonCode::sCheck() { XSqlQuery reasonCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().length())) { reasonCheck.prepare( "SELECT rsncode_id" " FROM rsncode" " WHERE((UPPER(rsncode_code)=UPPER(:rsncode_code))" " AND (rsncode_id != :rsncode_id));" ); reasonCheck.bindValue(":rsncode_code", _code->text()); reasonCheck.bindValue(":rsncode_id", _rsncodeid); reasonCheck.exec(); if (reasonCheck.first()) { _rsncodeid = reasonCheck.value("rsncode_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void reasonCode::populate() { XSqlQuery reasonpopulate; reasonpopulate.prepare( "SELECT rsncode.* " "FROM rsncode " "WHERE (rsncode_id=:rsncode_id);" ); reasonpopulate.bindValue(":rsncode_id", _rsncodeid); reasonpopulate.exec(); if (reasonpopulate.first()) { _code->setText(reasonpopulate.value("rsncode_code").toString()); _description->setText(reasonpopulate.value("rsncode_descrip").toString()); if (reasonpopulate.value("rsncode_doctype").toString() == "ARCM") { _selectedDocType->setChecked(TRUE); _docType->setCurrentIndex(0); } else if (reasonpopulate.value("rsncode_doctype").toString() == "ARDM") { _selectedDocType->setChecked(TRUE); _docType->setCurrentIndex(1); } else if (reasonpopulate.value("rsncode_doctype").toString() == "RA") { _selectedDocType->setChecked(TRUE); _docType->setCurrentIndex(2); } else _allDocTypes->setChecked(TRUE); } } qt-client-4.1.0/guiclient/reasonCode.h000066400000000000000000000020561217451700100176330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REASONCODE_H #define REASONCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_reasonCode.h" class reasonCode : public XDialog, public Ui::reasonCode { Q_OBJECT public: reasonCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reasonCode(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sCheck(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _rsncodeid; }; #endif // REASONCODE_H qt-client-4.1.0/guiclient/reasonCode.ui000066400000000000000000000203411217451700100200160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reasonCode 0 0 421 200 Reason Code 5 5 C&ode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Document Type All Document Types true Qt::Horizontal 40 15 5 Selected: false A/R Credit Memo A/R Debit Memo Return Authorization Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _code _description parameter.h _selectedDocType toggled(bool) _docType setEnabled(bool) 65 135 197 135
    qt-client-4.1.0/guiclient/reasonCodes.cpp000066400000000000000000000107071217451700100203530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reasonCodes.h" #include #include #include #include #include "reasonCode.h" reasonCodes::reasonCodes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_rsncode, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_rsncode, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); if (_privileges->check("MaintainReasonCodes")) { connect(_rsncode, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_rsncode, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_rsncode, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_rsncode, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _rsncode->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "rsncode_code" ); _rsncode->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "rsncode_descrip" ); sFillList(); } reasonCodes::~reasonCodes() { // no need to delete child widgets, Qt does it all for us } void reasonCodes::languageChange() { retranslateUi(this); } void reasonCodes::sNew() { ParameterList params; params.append("mode", "new"); reasonCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void reasonCodes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("rsncode_id", _rsncode->id()); reasonCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void reasonCodes::sView() { ParameterList params; params.append("mode", "view"); params.append("rsncode_id", _rsncode->id()); reasonCode newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void reasonCodes::sDelete() { XSqlQuery reasonDelete; reasonDelete.prepare( "SELECT cmhead_id " "FROM cmhead " "WHERE (cmhead_rsncode_id=:rsncode_id) " "LIMIT 1;" ); reasonDelete.bindValue(":rsncode_id", _rsncode->id()); reasonDelete.exec(); if (reasonDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Reason Code"), tr( "You may not delete the selected Reason Code as there are Credit Memo records that refer it.\n" "You must purge these records before you may delete the selected Reason Code." ) ); return; } reasonDelete.prepare( "SELECT aropen_id " "FROM aropen " "WHERE (aropen_rsncode_id=:rsncode_id) " "LIMIT 1;" ); reasonDelete.bindValue(":rsncode_id", _rsncode->id()); reasonDelete.exec(); if (reasonDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Reason Code"), tr( "You may not delete the selected Reason Code as there are A/R Open Item records that refer it.\n" "You must purge these records before you may delete the selected Reason Code." ) ); return; } reasonDelete.prepare( "DELETE FROM rsncode " "WHERE (rsncode_id=:rsncode_id);" ); reasonDelete.bindValue(":rsncode_id", _rsncode->id()); reasonDelete.exec(); sFillList(); } void reasonCodes::sFillList() { _rsncode->populate( "SELECT rsncode_id, rsncode_code, rsncode_descrip " "FROM rsncode " "ORDER BY rsncode_code;" ); } void reasonCodes::sPopulateMenu( QMenu * ) { } void reasonCodes::sPrint() { orReport report("ReasonCodeMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/reasonCodes.h000066400000000000000000000020661217451700100200170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REASONCODES_H #define REASONCODES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_reasonCodes.h" class reasonCodes : public XWidget, public Ui::reasonCodes { Q_OBJECT public: reasonCodes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~reasonCodes(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // REASONCODES_H qt-client-4.1.0/guiclient/reasonCodes.ui000066400000000000000000000111311217451700100201760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reasonCodes 0 0 600 400 List Reason Codes 0 Reason Codes: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _rsncode _new _edit _view _delete _print _close parameter.h _rsncode valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() reasonCodes close() 20 20 20 20
    qt-client-4.1.0/guiclient/reassignClassCodeByClassCode.cpp000066400000000000000000000044331217451700100235550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reassignClassCodeByClassCode.h" #include reassignClassCodeByClassCode::reassignClassCodeByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_classCodePattern, SIGNAL(toggled(bool)), _classCode, SLOT(setEnabled(bool))); connect(_selectedClassCode, SIGNAL(toggled(bool)), _classCodes, SLOT(setEnabled(bool))); connect(_reassign, SIGNAL(clicked()), this, SLOT(sReassign())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _classCodes->setType(XComboBox::ClassCodes); _newClassCode->setType(XComboBox::ClassCodes); } reassignClassCodeByClassCode::~reassignClassCodeByClassCode() { // no need to delete child widgets, Qt does it all for us } void reassignClassCodeByClassCode::languageChange() { retranslateUi(this); } void reassignClassCodeByClassCode::sReassign() { XSqlQuery reassignReassign; if ( (_classCodePattern->isChecked()) && (_classCode->text().length() == 0) ) { QMessageBox::warning(this, tr("Missing Class Code Pattern"), tr("

    You must enter a Class Code Pattern.")); _classCode->setFocus(); return; } QString sql( "UPDATE item " "SET item_classcode_id=:new_classcode_id "); if (_selectedClassCode->isChecked()) sql += "WHERE (item_classcode_id=:old_classcode_id);"; else if (_classCodePattern->isChecked()) sql += "WHERE (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :old_classcode_code)));"; reassignReassign.prepare(sql); reassignReassign.bindValue(":new_classcode_id", _newClassCode->id()); reassignReassign.bindValue(":old_classcode_id", _classCodes->id()); reassignReassign.bindValue(":old_classcode_code", _classCode->text()); reassignReassign.exec(); accept(); } qt-client-4.1.0/guiclient/reassignClassCodeByClassCode.h000066400000000000000000000020031217451700100232110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REASSIGNCLASSCODEBYCLASSCODE_H #define REASSIGNCLASSCODEBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_reassignClassCodeByClassCode.h" class reassignClassCodeByClassCode : public XDialog, public Ui::reassignClassCodeByClassCode { Q_OBJECT public: reassignClassCodeByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reassignClassCodeByClassCode(); public slots: virtual void sReassign(); protected slots: virtual void languageChange(); }; #endif // REASSIGNCLASSCODEBYCLASSCODE_H qt-client-4.1.0/guiclient/reassignClassCodeByClassCode.ui000066400000000000000000000177531217451700100234210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reassignClassCodeByClassCode 0 0 513 102 Reassign Class Code by Class Code 5 7 0 0 0 5 5 0 0 5 Selected Class Code: false 7 0 0 0 0 5 Class Code Pattern: true 0 5 New Class Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 0 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 0 0 0 5 &Cancel &Reassign true Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit

    xlineedit.h
    0 XComboBox QComboBox
    xcombobox.h
    0
    _selectedClassCode _classCodes _classCodePattern _classCode _newClassCode _reassign _close _classCodePattern toggled(bool) _classCode setEnabled(bool) 20 20 20 20 _selectedClassCode toggled(bool) _classCodes setEnabled(bool) 20 20 20 20 _close clicked() reassignClassCodeByClassCode reject() 20 20 20 20 qt-client-4.1.0/guiclient/reassignCustomerTypeByCustomerType.cpp000066400000000000000000000045641217451700100251700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reassignCustomerTypeByCustomerType.h" #include reassignCustomerTypeByCustomerType::reassignCustomerTypeByCustomerType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_customerTypePattern, SIGNAL(toggled(bool)), _customerType, SLOT(setEnabled(bool))); connect(_selectedCustomerType, SIGNAL(toggled(bool)), _customerTypes, SLOT(setEnabled(bool))); connect(_reassign, SIGNAL(clicked()), this, SLOT(sReassign())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _customerTypes->setType(XComboBox::CustomerTypes); _newCustomerType->setType(XComboBox::CustomerTypes); } reassignCustomerTypeByCustomerType::~reassignCustomerTypeByCustomerType() { // no need to delete child widgets, Qt does it all for us } void reassignCustomerTypeByCustomerType::languageChange() { retranslateUi(this); } void reassignCustomerTypeByCustomerType::sReassign() { XSqlQuery reassignReassign; if ( (_customerTypePattern->isChecked()) && (_customerType->text().length() == 0) ) { QMessageBox::warning(this, tr("Missing Customer Type Pattern"), tr("

    You must enter a Customer Type Pattern.")); _customerType->setFocus(); return; } QString sql( "UPDATE custinfo " "SET cust_custtype_id=:new_custtype_id " ); if (_selectedCustomerType->isChecked()) sql += "WHERE (cust_custtype_id=:old_custtype_id);"; else if (_customerTypePattern->isChecked()) sql += "WHERE (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ :old_custtype_code)));"; reassignReassign.prepare(sql); reassignReassign.bindValue(":new_custtype_id", _newCustomerType->id()); reassignReassign.bindValue(":old_custtype_id", _customerTypes->id()); reassignReassign.bindValue(":old_custtype_code", _customerType->text()); reassignReassign.exec(); accept(); } qt-client-4.1.0/guiclient/reassignCustomerTypeByCustomerType.h000066400000000000000000000020631217451700100246250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REASSIGNCUSTOMERTYPEBYCUSTOMERTYPE_H #define REASSIGNCUSTOMERTYPEBYCUSTOMERTYPE_H #include "guiclient.h" #include "xdialog.h" #include "ui_reassignCustomerTypeByCustomerType.h" class reassignCustomerTypeByCustomerType : public XDialog, public Ui::reassignCustomerTypeByCustomerType { Q_OBJECT public: reassignCustomerTypeByCustomerType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reassignCustomerTypeByCustomerType(); public slots: virtual void sReassign(); protected slots: virtual void languageChange(); }; #endif // REASSIGNCUSTOMERTYPEBYCUSTOMERTYPE_H qt-client-4.1.0/guiclient/reassignCustomerTypeByCustomerType.ui000066400000000000000000000200711217451700100250120ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reassignCustomerTypeByCustomerType 0 0 513 102 Reassign Customer Type by Customer Type 5 7 0 0 0 5 5 0 0 5 Selected Customer Type: false 7 0 0 0 0 5 Customer Type Pattern: true 0 5 New Customer Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 0 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 0 0 0 5 &Cancel &Reassign true Qt::Vertical QSizePolicy::Expanding 20 20 XComboBox QComboBox

    xcombobox.h
    0 XLineEdit QLineEdit
    xlineedit.h
    0
    _selectedCustomerType _customerTypes _customerTypePattern _customerType _newCustomerType _reassign _close _customerTypePattern toggled(bool) _customerType setEnabled(bool) 20 20 20 20 _selectedCustomerType toggled(bool) _customerTypes setEnabled(bool) 20 20 20 20 _close clicked() reassignCustomerTypeByCustomerType reject() 20 20 20 20 qt-client-4.1.0/guiclient/reassignLotSerial.cpp000066400000000000000000000172351217451700100215430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reassignLotSerial.h" #include "math.h" #include #include #include #include #include "storedProcErrorLookup.h" reassignLotSerial::reassignLotSerial(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_reassign, SIGNAL(clicked()), this, SLOT(sReassign())); _captive = FALSE; _item->setType(ItemLineEdit::cLotSerialControlled); _qty->setValidator(omfgThis->qtyPerVal()); _source->addColumn(tr("Location"), _itemColumn, Qt::AlignLeft , true, "locationname" ); _source->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft , true, "ls_number" ); _source->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter, true, "itemloc_expiration" ); _source->addColumn(tr("Warranty"), _dateColumn, Qt::AlignCenter, true, "itemloc_warrpurc"); _source->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight , true, "itemloc_qty" ); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } reassignLotSerial::~reassignLotSerial() { // no need to delete child widgets, Qt does it all for us } void reassignLotSerial::languageChange() { retranslateUi(this); } enum SetResponse reassignLotSerial::set(const ParameterList &pParams) { XSqlQuery reassignet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); _item->setReadOnly(TRUE); } param = pParams.value("itemloc_id", &valid); if (valid) { reassignet.prepare( "SELECT itemloc_itemsite_id " "FROM itemloc " "WHERE (itemloc_id=:itemloc_id);" ); reassignet.bindValue(":itemloc_id", param.toInt()); reassignet.exec(); if (reassignet.first()) { _captive = TRUE; _item->setItemsiteid(reassignet.value("itemloc_itemsite_id").toInt()); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); for (int i = 0; i < _source->topLevelItemCount(); i++) { if (((XTreeWidget*)(_source->topLevelItem(i)))->id() == param.toInt()) _source->setCurrentItem(_source->topLevelItem(i)); } } else if (reassignet.lastError().type() != QSqlError::NoError) { systemError(this, reassignet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } return NoError; } void reassignLotSerial::sReassign() { XSqlQuery reassignReassign; if (_expirationDate->isEnabled()) { if (!_expirationDate->isValid() || _expirationDate->isNull()) { QMessageBox::critical( this, tr("Enter a valid date"), tr("You must enter a valid expiration date before you can continue.") ); _expirationDate->setFocus(); return; } } if (_source->currentItem() == 0) { QMessageBox::critical( this, tr("Select Source Location"), tr("You must select a Source Location before reassigning its Lot/Serial #.") ); _source->setFocus(); return; } if (_qty->toDouble() == 0) { QMessageBox::critical( this, tr("Enter Quantity to Reassign"), tr("You must enter a quantity to reassign.") ); _qty->setFocus(); return; } if (_lotNumber->text().length() == 0) { QMessageBox::critical( this, tr("Enter New Lot Number to Reassign"), tr("You must enter a New Lot Number to reassign.") ); _qty->setFocus(); return; } QDoubleValidator* qtyVal = (QDoubleValidator*)(_qty->validator()); reassignReassign.prepare("SELECT reassignLotSerial(:source, CAST (:qty AS NUMERIC(100,:decimals)), " " :lotNumber, :expirationDate, :warrantyDate) AS result;"); reassignReassign.bindValue(":source", _source->id()); reassignReassign.bindValue(":qty", _qty->toDouble()); reassignReassign.bindValue(":decimals", qtyVal->decimals()); reassignReassign.bindValue(":lotNumber", _lotNumber->text()); if (_expirationDate->isEnabled()) reassignReassign.bindValue(":expirationDate", _expirationDate->date()); else reassignReassign.bindValue(":expirationDate", omfgThis->endOfTime()); if (_warrantyDate->isEnabled()) reassignReassign.bindValue(":warrantyDate", _warrantyDate->date()); reassignReassign.exec(); if (reassignReassign.first()) { int result = reassignReassign.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("reassignLotSerial", result), __FILE__, __LINE__); return; } } else if (reassignReassign.lastError().type() != QSqlError::NoError) { systemError(this, reassignReassign.lastError().databaseText(), __FILE__, __LINE__); return; } if (_captive) accept(); else { _close->setText(tr("&Close")); sFillList(); if (_qty->isEnabled()) _qty->clear(); _qty->setFocus(); _lotNumber->clear(); _expirationDate->setNull(); _warrantyDate->setNull(); } } void reassignLotSerial::sFillList() { XSqlQuery reassignFillList; if (_item->isValid()) { reassignFillList.prepare( "SELECT itemsite_id, itemsite_perishable, itemsite_controlmethod, itemsite_warrpurc " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); reassignFillList.bindValue(":item_id", _item->id()); reassignFillList.bindValue(":warehous_id", _warehouse->id()); reassignFillList.exec(); if (reassignFillList.first()) { if (reassignFillList.value("itemsite_controlmethod").toString() == "S") { _qty->setEnabled(FALSE); _qty->setDouble(1.0); } else if (reassignFillList.value("itemsite_controlmethod").toString() == "L") _qty->setEnabled(TRUE); else { _source->clear(); return; } int itemsiteid = reassignFillList.value("itemsite_id").toInt(); _expirationDate->setEnabled(reassignFillList.value("itemsite_perishable").toBool()); _warrantyDate->setEnabled(reassignFillList.value("itemsite_warrpurc").toBool()); reassignFillList.prepare( "SELECT itemloc_id, formatLocationName(itemloc_location_id) AS locationname, ls_number," " itemloc_expiration, itemloc_warrpurc, itemloc_qty, " " 'qty' AS itemloc_qty_xtnumericrole " "FROM itemloc " " LEFT OUTER JOIN ls ON (itemloc_ls_id=ls_id), itemsite " "WHERE ( (itemloc_itemsite_id=itemsite_id)" " AND (itemsite_id=:itemsite_id) ) " "ORDER BY locationname;" ); reassignFillList.bindValue(":never", tr("Never")); reassignFillList.bindValue(":itemsite_id", itemsiteid); reassignFillList.exec(); _source->populate(reassignFillList); } else if (reassignFillList.lastError().type() != QSqlError::NoError) { systemError(this, reassignFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } else _source->clear(); } qt-client-4.1.0/guiclient/reassignLotSerial.h000066400000000000000000000020761217451700100212050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REASSIGNLOTSERIAL_H #define REASSIGNLOTSERIAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_reassignLotSerial.h" class reassignLotSerial : public XDialog, public Ui::reassignLotSerial { Q_OBJECT public: reassignLotSerial(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reassignLotSerial(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sReassign(); virtual void sFillList(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // REASSIGNLOTSERIAL_H qt-client-4.1.0/guiclient/reassignLotSerial.ui000066400000000000000000000263721217451700100214000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reassignLotSerial 0 0 503 500 Reassign Lot/Serial # 7 0 5 0 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 0 5 &Cancel false &Reassign true true Qt::Vertical QSizePolicy::Expanding 20 20 0 0 0 Source: 0 0 300 100 New Lot Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignLeading New Expiration Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::Horizontal 40 20 New Warranty Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::Horizontal 40 20 Qty. to Reassign: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight DLineEdit QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _item _warehouse _source _qty _lotNumber _expirationDate _reassign _close parameter.h _source valid(bool) _reassign setEnabled(bool) 20 20 20 20 _close clicked() reassignLotSerial reject() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20
    qt-client-4.1.0/guiclient/reassignProductCategoryByProductCategory.cpp000066400000000000000000000046311217451700100263110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reassignProductCategoryByProductCategory.h" #include reassignProductCategoryByProductCategory::reassignProductCategoryByProductCategory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_productCategoryPattern, SIGNAL(toggled(bool)), _productCategory, SLOT(setEnabled(bool))); connect(_selectedProductCategory, SIGNAL(toggled(bool)), _productCategories, SLOT(setEnabled(bool))); connect(_reassign, SIGNAL(clicked()), this, SLOT(sReassign())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _productCategories->setType(XComboBox::ProductCategories); _newProductCategory->setType(XComboBox::ProductCategories); } reassignProductCategoryByProductCategory::~reassignProductCategoryByProductCategory() { // no need to delete child widgets, Qt does it all for us } void reassignProductCategoryByProductCategory::languageChange() { retranslateUi(this); } void reassignProductCategoryByProductCategory::sReassign() { if ( (_productCategoryPattern->isChecked()) && (_productCategory->text().length() == 0) ) { QMessageBox::warning(this, tr("Missing Product Category Pattern"), tr("

    You must enter a Product Category Pattern.")); _productCategory->setFocus(); return; } QString sql( "UPDATE item " "SET item_prodcat_id=:new_prodcat_id " ); if (_selectedProductCategory->isChecked()) sql += "WHERE (item_prodcat_id=:old_prodcat_id);"; else if (_productCategoryPattern->isChecked()) sql += "WHERE (item_prodcat_id IN (SELECT prodcat_id FROM prodcat WHERE (prodcat_code ~ :old_prodcat_code)));"; XSqlQuery reassign; reassign.prepare(sql); reassign.bindValue(":new_prodcat_id", _newProductCategory->id()); reassign.bindValue(":old_prodcat_id", _productCategories->id()); reassign.bindValue(":old_prodcat_code", _productCategory->text()); reassign.exec(); accept(); } qt-client-4.1.0/guiclient/reassignProductCategoryByProductCategory.h000066400000000000000000000021431217451700100257520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REASSIGNPRODUCTCATEGORYBYPRODUCTCATEGORY_H #define REASSIGNPRODUCTCATEGORYBYPRODUCTCATEGORY_H #include "guiclient.h" #include "xdialog.h" #include "ui_reassignProductCategoryByProductCategory.h" class reassignProductCategoryByProductCategory : public XDialog, public Ui::reassignProductCategoryByProductCategory { Q_OBJECT public: reassignProductCategoryByProductCategory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reassignProductCategoryByProductCategory(); public slots: virtual void sReassign(); protected slots: virtual void languageChange(); }; #endif // REASSIGNPRODUCTCATEGORYBYPRODUCTCATEGORY_H qt-client-4.1.0/guiclient/reassignProductCategoryByProductCategory.ui000066400000000000000000000202121217451700100261350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reassignProductCategoryByProductCategory 0 0 513 102 Reassign Product Category by Product Category 5 7 0 0 0 5 5 0 0 5 Selected Product Category: false 7 0 0 0 0 5 Product Category Pattern: true 0 5 New Product Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 0 0 0 Qt::Vertical QSizePolicy::Expanding 20 20 0 0 0 5 &Cancel &Reassign true Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit

    xlineedit.h
    0 XComboBox QComboBox
    xcombobox.h
    0
    _selectedProductCategory _productCategories _productCategoryPattern _productCategory _newProductCategory _reassign _close _productCategoryPattern toggled(bool) _productCategory setEnabled(bool) 20 20 20 20 _selectedProductCategory toggled(bool) _productCategories setEnabled(bool) 20 20 20 20 _close clicked() reassignProductCategoryByProductCategory reject() 20 20 20 20 qt-client-4.1.0/guiclient/recallOrders.cpp000066400000000000000000000134731217451700100205320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "recallOrders.h" #include #include //#include #include #include #include #include "storedProcErrorLookup.h" recallOrders::recallOrders(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_recall, SIGNAL(clicked()), this, SLOT(sRecall())); connect(_showInvoiced, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(omfgThis, SIGNAL(invoicesUpdated(int, bool)), this, SLOT(sFillList())); _showInvoiced->setEnabled(_privileges->check("RecallInvoicedShipment")); _ship->addColumn(tr("Ship Date"), _dateColumn, Qt::AlignCenter, true, "shiphead_shipdate" ); _ship->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft , true, "number"); _ship->addColumn(tr("Shipment #"), _orderColumn, Qt::AlignLeft , true, "shiphead_number"); _ship->addColumn(tr("Customer"), -1, Qt::AlignLeft , true, "cohead_billtoname" ); _ship->addColumn(tr("Invoiced"), _ynColumn, Qt::AlignCenter, true, "shipitem_invoiced" ); sFillList(); } recallOrders::~recallOrders() { // no need to delete child widgets, Qt does it all for us } void recallOrders::languageChange() { retranslateUi(this); } void recallOrders::sRecall() { XSqlQuery recallRecall; if (!checkSitePrivs(_ship->id())) return; if (_ship->altId() != -1) { int answer = QMessageBox::question(this, tr("Purge Invoice?"), tr("

    There is an unposted Invoice associated " "this Shipment. This Invoice will be purged " "as part of the recall process.

    " "OK to continue? "), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); if (answer == QMessageBox::No) return; } recallRecall.prepare("SELECT recallShipment(:shiphead_id) AS result;"); recallRecall.bindValue(":shiphead_id", _ship->id()); recallRecall.exec(); if (recallRecall.first()) { int result = recallRecall.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("recallShipment", result), __FILE__, __LINE__); return; } sFillList(); } else if (recallRecall.lastError().type() != QSqlError::NoError) { systemError(this, recallRecall.lastError().databaseText(), __FILE__, __LINE__); return; } } void recallOrders::sFillList() { ParameterList params; if (_showInvoiced->isChecked()) params.append("showInvoiced", true); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); QString sql = "SELECT DISTINCT shiphead_id, COALESCE(invchead_id, -1) AS invchead_id, shiphead_shipdate, " " cohead_number AS number, shiphead_number, cohead_billtoname, " " shipitem_invoiced " "FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id)" " JOIN coitem ON (coitem_id=shipitem_orderitem_id)" " JOIN cohead ON (cohead_id=coitem_cohead_id)" " JOIN itemsite ON (itemsite_id=coitem_itemsite_id)" " JOIN site() ON (warehous_id=itemsite_warehous_id)" " LEFT OUTER JOIN invcitem ON (invcitem_id=shipitem_invcitem_id)" " LEFT OUTER JOIN invchead ON (invchead_id=invcitem_invchead_id) " "WHERE ( (shiphead_shipped)" " AND (shiphead_order_type='SO')" "" " AND (NOT shipitem_invoiced OR invchead_posted=FALSE)" "" " AND (NOT shipitem_invoiced) " "" " ) " "" "UNION " "SELECT DISTINCT shiphead_id, -1 AS invchead_id, shiphead_shipdate, " " tohead_number AS number, shiphead_number, '' AS cohead_billtoname, " " false AS shipitem_invoiced " "FROM shiphead JOIN tohead ON (tohead_id=shiphead_order_id)" " JOIN toitem ON (toitem_tohead_id=tohead_id) " "WHERE ((shiphead_shipped)" " AND (shiphead_order_type='TO')" " AND (tohead_status <> 'C')) " "" "ORDER BY shiphead_shipdate DESC, number;" ; MetaSQLQuery mql(sql); XSqlQuery r = mql.toQuery(params); _ship->clear(); _ship->populate(r, true); if (r.lastError().type() != QSqlError::NoError) { systemError(this, r.lastError().databaseText(), __FILE__, __LINE__); return; } } bool recallOrders::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkShipmentSitePrivs(:shipheadid) AS result;"); check.bindValue(":shipheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not recall this Shipment as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/recallOrders.h000066400000000000000000000017021217451700100201670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RECALLORDERS_H #define RECALLORDERS_H #include "guiclient.h" #include "xwidget.h" #include "ui_recallOrders.h" class recallOrders : public XWidget, public Ui::recallOrders { Q_OBJECT public: recallOrders(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~recallOrders(); virtual bool checkSitePrivs(int orderid); public slots: virtual void sRecall(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // RECALLORDERS_H qt-client-4.1.0/guiclient/recallOrders.ui000066400000000000000000000124231217451700100203570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. recallOrders 0 0 595 345 Recall Orders to Shipping 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Close 0 0 0 5 Shipped Orders: Show Invoiced Orders 0 5 0 0 false &Recall Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

    xtreewidget.h
    0 _showInvoiced _ship _recall _close _close clicked() recallOrders close() 20 20 20 20 _ship valid(bool) _recall setEnabled(bool) 20 20 20 20 _ship itemSelected(int) _recall animateClick() 20 20 20 20 qt-client-4.1.0/guiclient/reconcileBankaccount.cpp000066400000000000000000000700211217451700100222150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reconcileBankaccount.h" #include #include #include #include #include #include #include #include #include "mqlutil.h" #include "bankAdjustment.h" #include "storedProcErrorLookup.h" reconcileBankaccount::reconcileBankaccount(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_addAdjustment, SIGNAL(clicked()), this, SLOT(sAddAdjustment())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sBankaccntChanged())); connect(_cancel, SIGNAL(clicked()), this, SLOT(sCancel())); connect(_checks, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(sChecksToggleCleared())); connect(_endBal, SIGNAL(editingFinished()), this, SLOT(populate())); connect(_openBal, SIGNAL(editingFinished()), this, SLOT(populate())); connect(_receipts, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(sReceiptsToggleCleared())); connect(_reconcile, SIGNAL(clicked()), this, SLOT(sReconcile())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_update, SIGNAL(clicked()), this, SLOT(populate())); connect(_startDate, SIGNAL(newDate(QDate)), this, SLOT(sDateChanged())); connect(_endDate, SIGNAL(newDate(QDate)), this, SLOT(sDateChanged())); _receipts->addColumn(tr("Cleared"), _ynColumn * 2, Qt::AlignCenter ); _receipts->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter ); _receipts->addColumn(tr("Doc. Type"), _ynColumn * 2, Qt::AlignCenter ); _receipts->addColumn(tr("Doc. Number"), _itemColumn, Qt::AlignLeft ); _receipts->addColumn(tr("Notes"), -1, Qt::AlignLeft ); _receipts->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter ); _receipts->addColumn(tr("Exch. Rate"), _bigMoneyColumn, Qt::AlignRight ); _receipts->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight ); _receipts->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight ); _checks->addColumn(tr("Cleared"), _ynColumn * 2, Qt::AlignCenter , true, "cleared"); _checks->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter , true, "transdate"); _checks->addColumn(tr("Doc. Type"), _ynColumn * 2, Qt::AlignCenter , true, "doc_type"); _checks->addColumn(tr("Doc. Number"), _itemColumn, Qt::AlignLeft , true, "doc_number"); _checks->addColumn(tr("Notes"), -1, Qt::AlignLeft , true, "notes"); _checks->addColumn(tr("Currency"), _currencyColumn, Qt::AlignCenter , true, "doc_curr"); _checks->addColumn(tr("Exch. Rate"), _bigMoneyColumn, Qt::AlignRight , true, "doc_exchrate"); _checks->addColumn(tr("Base Amount"), _bigMoneyColumn, Qt::AlignRight , true, "base_amount"); _checks->addColumn(tr("Amount"), _bigMoneyColumn, Qt::AlignRight , true, "amount"); _clearedReceipts->setPrecision(omfgThis->moneyVal()); _clearedChecks->setPrecision(omfgThis->moneyVal()); _endBal2->setPrecision(omfgThis->moneyVal()); _clearBal->setPrecision(omfgThis->moneyVal()); _diffBal->setPrecision(omfgThis->moneyVal()); _bankrecid = -1; // do this before _bankaccnt->populate() _bankaccntid = -1; // do this before _bankaccnt->populate() _datesAreOK = false; _bankaccnt->populate("SELECT bankaccnt_id," " (bankaccnt_name || '-' || bankaccnt_descrip) " "FROM bankaccnt " "ORDER BY bankaccnt_name;"); _currency->setLabel(_currencyLit); if (!_privileges->check("MaintainBankAdjustments")) _addAdjustment->setEnabled(FALSE); connect(omfgThis, SIGNAL(bankAdjustmentsUpdated(int, bool)), this, SLOT(populate())); connect(omfgThis, SIGNAL(checksUpdated(int, int, bool)), this, SLOT(populate())); connect(omfgThis, SIGNAL(cashReceiptsUpdated(int, bool)), this, SLOT(populate())); connect(omfgThis, SIGNAL(glSeriesUpdated()), this, SLOT(populate())); } reconcileBankaccount::~reconcileBankaccount() { // no need to delete child widgets, Qt does it all for us } void reconcileBankaccount::languageChange() { retranslateUi(this); } void reconcileBankaccount::sCancel() { XSqlQuery reconcileCancel; if(_bankrecid != -1) { reconcileCancel.prepare("SELECT count(*) AS num" " FROM bankrec" " WHERE (bankrec_id=:bankrecid); "); reconcileCancel.bindValue(":bankrecid", _bankrecid); reconcileCancel.exec(); if (reconcileCancel.first() && reconcileCancel.value("num").toInt() > 0) { if (QMessageBox::question(this, tr("Cancel Bank Reconciliation?"), tr("

    Are you sure you want to Cancel this Bank " "Reconciliation and delete all of the Cleared " "notations for this time period?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return; } reconcileCancel.prepare( "SELECT deleteBankReconciliation(:bankrecid) AS result;" ); reconcileCancel.bindValue(":bankrecid", _bankrecid); reconcileCancel.exec(); if (reconcileCancel.first()) { int result = reconcileCancel.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteBankReconciliation", result), __FILE__, __LINE__); return; } } else if (reconcileCancel.lastError().type() != QSqlError::NoError) { systemError(this, reconcileCancel.lastError().databaseText(), __FILE__, __LINE__); return; } } } close(); } bool reconcileBankaccount::sSave(bool closeWhenDone) { XSqlQuery reconcileSave; reconcileSave.prepare("SELECT count(*) AS num" " FROM bankrec" " WHERE (bankrec_id=:bankrecid); "); reconcileSave.bindValue(":bankrecid", _bankrecid); reconcileSave.exec(); if (reconcileSave.first() && reconcileSave.value("num").toInt() > 0) reconcileSave.prepare("UPDATE bankrec" " SET bankrec_bankaccnt_id=:bankaccntid," " bankrec_opendate=:startDate," " bankrec_enddate=:endDate," " bankrec_openbal=:openbal," " bankrec_endbal=:endbal " " WHERE (bankrec_id=:bankrecid); "); else if (reconcileSave.value("num").toInt() == 0) reconcileSave.prepare("INSERT INTO bankrec " "(bankrec_id, bankrec_bankaccnt_id," " bankrec_opendate, bankrec_enddate," " bankrec_openbal, bankrec_endbal) " "VALUES " "(:bankrecid, :bankaccntid," " :startDate, :endDate," " :openbal, :endbal); "); else if (reconcileSave.lastError().type() != QSqlError::NoError) { systemError(this, reconcileSave.lastError().databaseText(), __FILE__, __LINE__); return false; } reconcileSave.bindValue(":bankrecid", _bankrecid); reconcileSave.bindValue(":bankaccntid", _bankaccntid); reconcileSave.bindValue(":startDate", _startDate->date()); reconcileSave.bindValue(":endDate", _endDate->date()); reconcileSave.bindValue(":openbal", _openBal->localValue()); reconcileSave.bindValue(":endbal", _endBal->localValue()); reconcileSave.exec(); if (reconcileSave.lastError().type() != QSqlError::NoError) { systemError(this, tr("

    There was an error creating records to reconcile " "this account:

    %1
    ") .arg(reconcileSave.lastError().databaseText()), __FILE__, __LINE__); return false; } if (closeWhenDone) return close(); return true; } void reconcileBankaccount::sReconcile() { XSqlQuery reconcileReconcile; if(_bankrecid == -1) { QMessageBox::critical( this, tr("Cannot Reconcile Account"), tr("

    There was an error trying to reconcile this account. " "Please contact your Systems Administrator.") ); return; } if (!_startDate->isValid()) { QMessageBox::warning( this, tr("Missing Opening Date"), tr("

    No Opening Date was specified for this reconciliation. Please specify an Opening Date.") ); _startDate->setFocus(); return; } if (!_endDate->isValid()) { QMessageBox::warning( this, tr("Missing Ending Date"), tr("

    No Ending Date was specified for this reconciliation. Please specify an Ending Date.") ); _endDate->setFocus(); return; } if (_endDate->date() < _startDate->date()) { QMessageBox::warning( this, tr("Invalid End Date"), tr("The end date cannot be earlier than the start date.") ); _endDate->setFocus(); return; } if(!_datesAreOK) { QMessageBox::critical( this, tr("Dates already reconciled"), tr("The date range you have entered already has " "reconciled dates in it. Please choose a different " "date range.") ); _startDate->setFocus(); _datesAreOK = false; return; } double begBal = _openBal->localValue(); double endBal = _endBal->localValue(); // calculate cleared balance MetaSQLQuery mbal = mqlLoad("bankrec", "clearedbalance"); ParameterList params; params.append("bankaccntid", _bankaccnt->id()); params.append("bankrecid", _bankrecid); params.append("endBal", endBal); params.append("begBal", begBal); params.append("curr_id", _currency->id()); params.append("effective", _startDate->date()); params.append("expires", _endDate->date()); XSqlQuery bal = mbal.toQuery(params); if(!bal.first()) { systemError(this, bal.lastError().databaseText(), __FILE__, __LINE__); return; } if(bal.value("diff_value").toDouble() != 0.0) { QMessageBox::critical( this, tr("Balances Do Not Match"), tr("The cleared amounts do not balance with the specified\n" "beginning and ending balances.\n" "Please correct this before continuing.") ); return; } if (! sSave(false)) return; reconcileReconcile.prepare("SELECT postBankReconciliation(:bankrecid) AS result;"); reconcileReconcile.bindValue(":bankrecid", _bankrecid); reconcileReconcile.exec(); if (reconcileReconcile.first()) { int result = reconcileReconcile.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postBankReconciliation", result), __FILE__, __LINE__); return; } _bankrecid = -1; close(); } else if (reconcileReconcile.lastError().type() != QSqlError::NoError) { systemError(this, reconcileReconcile.lastError().databaseText(), __FILE__, __LINE__); return; } } /* Note that the SELECTs here are UNIONs of the gltrans table (in the base currency), sltrans table (in the base currency) and the bankadj table (in the bank account's currency). */ void reconcileBankaccount::populate() { qApp->setOverrideCursor(QCursor(Qt::WaitCursor)); double begBal = _openBal->localValue(); double endBal = _endBal->localValue(); int currid = -1; ParameterList params; params.append("bankaccntid", _bankaccnt->id()); params.append("bankrecid", _bankrecid); // fill receipts list currid = _receipts->id(); _receipts->clear(); MetaSQLQuery mrcp = mqlLoad("bankrec", "receipts"); XSqlQuery rcp = mrcp.toQuery(params); if (rcp.lastError().type() != QSqlError::NoError) { systemError(this, rcp.lastError().databaseText(), __FILE__, __LINE__); return; } int jrnlnum = 0; XTreeWidgetItem * parent = 0; XTreeWidgetItem * lastChild = 0; XTreeWidgetItem * last = 0; bool cleared = TRUE; double amount = 0.0; bool amountNull = true; while (rcp.next()) { if(rcp.value("use").toString() == "C/R") { if(rcp.value("jrnlnum").toInt() != jrnlnum || (0 == parent)) { if(parent != 0) { parent->setText(0, (cleared ? tr("Yes") : tr("No"))); parent->setText(8, amountNull ? tr("?????") : formatMoney(amount)); } jrnlnum = rcp.value("jrnlnum").toInt(); last = new XTreeWidgetItem( _receipts, last, jrnlnum, 9, "", formatDate(rcp.value("f_jrnldate").toDate()), tr("JS"), rcp.value("jrnlnum")); parent = last; cleared = true; amount = 0.0; amountNull = true; lastChild = 0; } cleared = (cleared && rcp.value("cleared").toBool()); amount += rcp.value("amount").toDouble(); amountNull = rcp.value("amount").isNull(); lastChild = new XTreeWidgetItem( parent, lastChild, rcp.value("id").toInt(), rcp.value("altid").toInt(), (rcp.value("cleared").toBool() ? tr("Yes") : tr("No")), formatDate(rcp.value("f_date").toDate()), rcp.value("doc_type"), rcp.value("docnumber"), rcp.value("notes"), rcp.value("doc_curr"), rcp.value("doc_exchrate").isNull() ? tr("?????") : formatUOMRatio(rcp.value("doc_exchrate").toDouble()), rcp.value("base_amount").isNull() ? tr("?????") : formatMoney(rcp.value("base_amount").toDouble()), rcp.value("amount").isNull() ? tr("?????") : formatMoney(rcp.value("amount").toDouble()) ); } else { if(parent != 0) { parent->setText(0, (cleared ? tr("Yes") : tr("No"))); parent->setText(8, formatMoney(amount)); } parent = 0; cleared = true; amount = 0.0; amountNull = true; lastChild = 0; last = new XTreeWidgetItem( _receipts, last, rcp.value("id").toInt(), rcp.value("altid").toInt(), (rcp.value("cleared").toBool() ? tr("Yes") : tr("No")), formatDate(rcp.value("f_date").toDate()), rcp.value("doc_type"), rcp.value("docnumber"), rcp.value("notes"), rcp.value("doc_curr"), rcp.value("doc_exchrate").isNull() ? tr("?????") : formatUOMRatio(rcp.value("doc_exchrate").toDouble()), rcp.value("base_amount").isNull() ? tr("?????") : formatMoney(rcp.value("base_amount").toDouble()), rcp.value("amount").isNull() ? tr("?????") : formatMoney(rcp.value("amount").toDouble()) ); } } if(parent != 0) { parent->setText(0, (cleared ? tr("Yes") : tr("No"))); parent->setText(8, amountNull ? tr("?????") : formatMoney(amount)); } if(currid != -1) _receipts->setCurrentItem(_receipts->topLevelItem(currid)); if(_receipts->currentItem()) _receipts->scrollToItem(_receipts->currentItem()); // fill checks list currid = _checks->id(); _checks->clear(); MetaSQLQuery mchk = mqlLoad("bankrec", "checks"); XSqlQuery chk = mchk.toQuery(params); if (chk.lastError().type() != QSqlError::NoError) { systemError(this, chk.lastError().databaseText(), __FILE__, __LINE__); return; } _checks->populate(chk, TRUE); if(currid != -1) _checks->setCurrentItem(_checks->topLevelItem(currid)); if(_checks->currentItem()) _checks->scrollToItem(_checks->currentItem()); params.append("summary", true); // fill receipts cleared value rcp = mrcp.toQuery(params); if (rcp.first()) _clearedReceipts->setDouble(rcp.value("cleared_amount").toDouble()); else if (rcp.lastError().type() != QSqlError::NoError) { systemError(this, rcp.lastError().databaseText(), __FILE__, __LINE__); return; } // fill checks cleared value chk = mchk.toQuery(params); if (chk.first()) _clearedChecks->setDouble(chk.value("cleared_amount").toDouble()); else if (chk.lastError().type() != QSqlError::NoError) { systemError(this, chk.lastError().databaseText(), __FILE__, __LINE__); return; } // calculate cleared balance MetaSQLQuery mbal = mqlLoad("bankrec", "clearedbalance"); params.append("endBal", endBal); params.append("begBal", begBal); params.append("curr_id", _currency->id()); params.append("effective", _startDate->date()); params.append("expires", _endDate->date()); XSqlQuery bal = mbal.toQuery(params); bool enableRec = FALSE; if(bal.first()) { _clearBal->setDouble(bal.value("cleared_amount").toDouble()); _endBal2->setDouble(bal.value("end_amount").toDouble()); _diffBal->setDouble(bal.value("diff_amount").toDouble()); QString stylesheet; if(bal.value("diff_value").toDouble() == 0.0) { if(_startDate->isValid() && _endDate->isValid()) enableRec = TRUE; } else stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); _diffBal->setStyleSheet(stylesheet); } else if (bal.lastError().type() != QSqlError::NoError) { systemError(this, bal.lastError().databaseText(), __FILE__, __LINE__); return; } //_reconcile->setEnabled(enableRec); qApp->restoreOverrideCursor(); } void reconcileBankaccount::sAddAdjustment() { ParameterList params; params.append("mode", "new"); params.append("bankaccnt_id", _bankaccnt->id()); bankAdjustment *newdlg = new bankAdjustment(); newdlg->setWindowModality(Qt::WindowModal); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void reconcileBankaccount::sReceiptsToggleCleared() { XSqlQuery reconcileReceiptsToggleCleared; XTreeWidgetItem *item = (XTreeWidgetItem*)_receipts->currentItem(); XTreeWidgetItem *child = 0; bool setto = true; if(0 == item) return; _receipts->scrollToItem(item); if(item->altId() == 9) { setto = item->text(0) == tr("No"); for (int i = 0; i < item->childCount(); i++) { child = item->child(i); if(child->text(0) != (setto ? tr("Yes") : tr("No"))) { double rate = QLocale().toDouble(child->text(6)); double baseamount = QLocale().toDouble(child->text(7)); double amount = QLocale().toDouble(child->text(8)); if (_rateEdit->isChecked() && child->text(0) != tr("Yes")) { bool ok; rate = QInputDialog::getDouble(this, tr("Currency Exchange Rate"), tr("New Rate:"), rate, 0, 100, 5, &ok); if ( !ok ) return; amount = rate * baseamount; } reconcileReceiptsToggleCleared.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid, :currrate, :amount) AS cleared"); reconcileReceiptsToggleCleared.bindValue(":bankrecid", _bankrecid); reconcileReceiptsToggleCleared.bindValue(":sourceid", child->id()); if(child->altId()==1) reconcileReceiptsToggleCleared.bindValue(":source", "GL"); else if(child->altId()==2) reconcileReceiptsToggleCleared.bindValue(":source", "SL"); else if(child->altId()==3) reconcileReceiptsToggleCleared.bindValue(":source", "AD"); reconcileReceiptsToggleCleared.bindValue(":currrate", rate); reconcileReceiptsToggleCleared.bindValue(":amount", amount); reconcileReceiptsToggleCleared.exec(); if(reconcileReceiptsToggleCleared.first()) child->setText(0, (reconcileReceiptsToggleCleared.value("cleared").toBool() ? tr("Yes") : tr("No") )); else if (reconcileReceiptsToggleCleared.lastError().type() != QSqlError::NoError) { systemError(this, reconcileReceiptsToggleCleared.lastError().databaseText(), __FILE__, __LINE__); return; } } } item->setText(0, (setto ? tr("Yes") : tr("No"))); } else { double rate = QLocale().toDouble(item->text(6)); double baseamount = QLocale().toDouble(item->text(7)); double amount = QLocale().toDouble(item->text(8)); if (_rateEdit->isChecked() && item->text(0) != tr("Yes")) { bool ok; rate = QInputDialog::getDouble(this, tr("Currency Exchange Rate"), tr("New Rate:"), rate, 0, 100, 5, &ok); if ( !ok ) return; amount = rate * baseamount; } reconcileReceiptsToggleCleared.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid, :currrate, :amount) AS cleared"); reconcileReceiptsToggleCleared.bindValue(":bankrecid", _bankrecid); reconcileReceiptsToggleCleared.bindValue(":sourceid", item->id()); if(item->altId()==1) reconcileReceiptsToggleCleared.bindValue(":source", "GL"); else if(item->altId()==2) reconcileReceiptsToggleCleared.bindValue(":source", "SL"); else if(item->altId()==3) reconcileReceiptsToggleCleared.bindValue(":source", "AD"); reconcileReceiptsToggleCleared.bindValue(":currrate", rate); reconcileReceiptsToggleCleared.bindValue(":amount", amount); reconcileReceiptsToggleCleared.exec(); if(reconcileReceiptsToggleCleared.first()) { item->setText(0, (reconcileReceiptsToggleCleared.value("cleared").toBool() ? tr("Yes") : tr("No") )); item = (XTreeWidgetItem*)item->QTreeWidgetItem::parent(); if(item != 0 && item->altId() == 9) { setto = true; for (int i = 0; i < item->childCount(); i++) { setto = (setto && (item->child(i)->text(0) == tr("Yes"))); } item->setText(0, (setto ? tr("Yes") : tr("No"))); } } else { populate(); if (reconcileReceiptsToggleCleared.lastError().type() != QSqlError::NoError) { systemError(this, reconcileReceiptsToggleCleared.lastError().databaseText(), __FILE__, __LINE__); return; } } } } void reconcileBankaccount::sChecksToggleCleared() { XSqlQuery reconcileChecksToggleCleared; XTreeWidgetItem *item = (XTreeWidgetItem*)_checks->currentItem(); if(0 == item) return; _checks->scrollToItem(item); double rate = item->rawValue("doc_exchrate").toDouble(); double baseamount = item->rawValue("base_amount").toDouble(); double amount = item->rawValue("amount").toDouble(); if (_rateEdit->isChecked() && item->text(0) != tr("Yes")) { bool ok; rate = QInputDialog::getDouble(this, tr("Currency Exchange Rate"), tr("New Rate:"), rate, 0, 100, 5, &ok); if ( !ok ) return; amount = rate * baseamount; } reconcileChecksToggleCleared.prepare("SELECT toggleBankrecCleared(:bankrecid, :source, :sourceid, :currrate, :amount) AS cleared"); reconcileChecksToggleCleared.bindValue(":bankrecid", _bankrecid); reconcileChecksToggleCleared.bindValue(":sourceid", item->id()); if(item->altId()==1) reconcileChecksToggleCleared.bindValue(":source", "GL"); else if(item->altId()==2) reconcileChecksToggleCleared.bindValue(":source", "SL"); else if(item->altId()==3) reconcileChecksToggleCleared.bindValue(":source", "AD"); reconcileChecksToggleCleared.bindValue(":currrate", rate); reconcileChecksToggleCleared.bindValue(":amount", amount); reconcileChecksToggleCleared.exec(); if(reconcileChecksToggleCleared.first()) item->setText(0, (reconcileChecksToggleCleared.value("cleared").toBool() ? tr("Yes") : tr("No") )); else { populate(); if (reconcileChecksToggleCleared.lastError().type() != QSqlError::NoError) { systemError(this, reconcileChecksToggleCleared.lastError().databaseText(), __FILE__, __LINE__); return; } } } void reconcileBankaccount::sBankaccntChanged() { XSqlQuery reconcileBankaccntChanged; if(_bankrecid != -1) { reconcileBankaccntChanged.prepare("SELECT count(*) AS num" " FROM bankrecitem" " WHERE (bankrecitem_bankrec_id=:bankrecid); "); reconcileBankaccntChanged.bindValue(":bankrecid", _bankrecid); reconcileBankaccntChanged.exec(); if (reconcileBankaccntChanged.first() && reconcileBankaccntChanged.value("num").toInt() > 0) { if (QMessageBox::question(this, tr("Save Bank Reconciliation?"), tr("

    Do you want to save this Bank Reconciliation?"), QMessageBox::No, QMessageBox::Yes | QMessageBox::Default) == QMessageBox::Yes) { sSave(false); } else { reconcileBankaccntChanged.prepare( "SELECT deleteBankReconciliation(:bankrecid) AS result;" ); reconcileBankaccntChanged.bindValue(":bankrecid", _bankrecid); reconcileBankaccntChanged.exec(); if (reconcileBankaccntChanged.first()) { int result = reconcileBankaccntChanged.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteBankReconciliation", result), __FILE__, __LINE__); return; } } else if (reconcileBankaccntChanged.lastError().type() != QSqlError::NoError) { systemError(this, reconcileBankaccntChanged.lastError().databaseText(), __FILE__, __LINE__); return; } } } } _bankaccntid = _bankaccnt->id(); XSqlQuery accntq; accntq.prepare("SELECT bankaccnt_curr_id " "FROM bankaccnt WHERE bankaccnt_id = :accntId;"); accntq.bindValue(":accntId", _bankaccnt->id()); accntq.exec(); if (accntq.first()) _currency->setId(accntq.value("bankaccnt_curr_id").toInt()); else if (accntq.lastError().type() != QSqlError::NoError) { systemError(this, accntq.lastError().databaseText(), __FILE__, __LINE__); return; } accntq.prepare("SELECT * FROM bankrec " "WHERE ((bankrec_bankaccnt_id=:accntId)" " AND (NOT bankrec_posted));"); accntq.bindValue(":accntId", _bankaccnt->id()); accntq.exec(); if (accntq.first()) { _bankrecid = accntq.value("bankrec_id").toInt(); _startDate->setDate(accntq.value("bankrec_opendate").toDate(), true); _endDate->setDate(accntq.value("bankrec_enddate").toDate(), true); _openBal->setLocalValue(accntq.value("bankrec_openbal").toDouble()); _endBal->setLocalValue(accntq.value("bankrec_endbal").toDouble()); } else if (accntq.lastError().type() != QSqlError::NoError) { systemError(this, accntq.lastError().databaseText(), __FILE__, __LINE__); return; } else { accntq.prepare("SELECT NEXTVAL('bankrec_bankrec_id_seq') AS bankrec_id"); accntq.exec(); if (accntq.first()) _bankrecid = accntq.value("bankrec_id").toInt(); else if (accntq.lastError().type() != QSqlError::NoError) { systemError(this, accntq.lastError().databaseText(), __FILE__, __LINE__); return; } accntq.prepare("SELECT bankrec_enddate + 1 AS startdate, " " bankrec_endbal AS openbal " "FROM bankrec " "WHERE (bankrec_bankaccnt_id=:accntId) " "ORDER BY bankrec_enddate DESC " "LIMIT 1"); accntq.bindValue(":accntId", _bankaccnt->id()); accntq.exec(); if (accntq.first()) { _startDate->setDate(accntq.value("startdate").toDate()); _openBal->setLocalValue(accntq.value("openbal").toDouble()); } else { _startDate->clear(); _openBal->clear(); } if (accntq.lastError().type() != QSqlError::NoError) { systemError(this, accntq.lastError().databaseText(), __FILE__, __LINE__); return; } } populate(); } void reconcileBankaccount::sDateChanged() { XSqlQuery reconcileDateChanged; reconcileDateChanged.prepare("SELECT TRUE AS reconciled " "FROM bankrec " "WHERE ((bankrec_bankaccnt_id = :bankaccnt_id) " "AND (bankrec_posted) " "AND (bankrec_opendate <= :end_date) " "AND (bankrec_enddate >= :start_date)) " "GROUP BY bankrec_bankaccnt_id"); reconcileDateChanged.bindValue(":bankaccnt_id", _bankaccnt->id()); reconcileDateChanged.bindValue(":end_date", _endDate->date().toString(Qt::ISODate)); reconcileDateChanged.bindValue(":start_date", _startDate->date().toString(Qt::ISODate)); reconcileDateChanged.exec(); if(reconcileDateChanged.first()) { QMessageBox::critical( this, tr("Dates already reconciled"), tr("The date range you have entered already has " "reconciled dates in it. Please choose a different " "date range.") ); _startDate->setFocus(); _datesAreOK = false; return; } else if(reconcileDateChanged.lastError().type() != QSqlError::NoError) { systemError(this, reconcileDateChanged.lastError().databaseText(), __FILE__, __LINE__); _datesAreOK = false; return; } else { _datesAreOK = true; } } qt-client-4.1.0/guiclient/reconcileBankaccount.h000066400000000000000000000024361217451700100216670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RECONCILEBANKACCOUNT_H #define RECONCILEBANKACCOUNT_H #include "guiclient.h" #include "xwidget.h" #include "ui_reconcileBankaccount.h" class reconcileBankaccount : public XWidget, public Ui::reconcileBankaccount { Q_OBJECT public: reconcileBankaccount(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~reconcileBankaccount(); public slots: virtual void populate(); virtual void sAddAdjustment(); virtual void sBankaccntChanged(); virtual void sCancel(); virtual void sChecksToggleCleared(); virtual void sReceiptsToggleCleared(); virtual void sReconcile(); virtual bool sSave(bool = true); virtual void sDateChanged(); protected slots: virtual void languageChange(); private: int _bankrecid; int _bankaccntid; bool _datesAreOK; }; #endif // RECONCILEBANKACCOUNT_H qt-client-4.1.0/guiclient/reconcileBankaccount.ui000066400000000000000000000503121217451700100220510ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reconcileBankaccount 0 0 800 600 Reconcile Bank Account 12 12 Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Preferred 20 20 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false XComboBox::Currencies Exchange Rate Edit Qt::Horizontal 40 20 0 Qt::StrongFocus &Cancel Qt::WheelFocus Reconcile Qt::StrongFocus Save Qt::Vertical 20 40 Qt::NoFocus Update Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Opening Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 125 0 true false false false Qt::Horizontal QSizePolicy::Expanding 20 26 End Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Ending Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 125 0 true false false false Qt::Horizontal QSizePolicy::Preferred 20 20 0 1 QFrame::NoFrame QFrame::Raised 0 0 Deposits: 0 2 true 0 Payments: 0 2 true 0 Qt::NoFocus Add Adjustment Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 40 20 Cleared Deposits: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ending Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Cleared Payments: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Cleared Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Difference: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Preferred 20 10 CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _bankaccnt _currency _startDate _endDate _openBal _endBal _receipts _checks _save _reconcile _cancel _startDate newDate(QDate) _openBal setEffective(QDate) 20 20 20 20 _endDate newDate(QDate) _endBal setEffective(QDate) 20 20 20 20 _currency newID(int) _openBal setId(int) 20 20 20 20 _currency newID(int) _endBal setId(int) 20 20 20 20 qt-client-4.1.0/guiclient/registrationKey.cpp000066400000000000000000000033341217451700100212670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "registrationKey.h" #include #include "xtupleproductkey.h" registrationKey::registrationKey(QWidget* parent, const char * name, Qt::WFlags fl) : XAbstractConfigure(parent, fl) { setupUi(this); if (name) setObjectName(name); connect(_key, SIGNAL(editingFinished()), this, SLOT(sCheck())); _key->setText(_metrics->value("RegistrationKey")); sCheck(); } void registrationKey::languageChange() { retranslateUi(this); } bool registrationKey::sSave() { XTupleProductKey pk(_key->text()); if(pk.valid()) _metrics->set("RegistrationKey", _key->text()); else { QMessageBox::critical(this, tr("Invalid Registration Key"), tr("

    The Registration Key you have entered " "does not appear to be valid.")); return false; } return true; } void registrationKey::sCheck() { XTupleProductKey pk(_key->text()); if(pk.valid()) { _customer->setText(pk.customerId()); _expirationDate->setText(pk.expiration().toString()); if(pk.users() == 0) _users->setText(tr("Unlimited")); else _users->setText(QString("%1").arg(pk.users())); } else { _customer->setText(tr("Unknown")); _expirationDate->setText(tr("Unknown")); _users->setText(tr("Unknown")); } } qt-client-4.1.0/guiclient/registrationKey.h000066400000000000000000000016271217451700100207370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __REGISTRATIONKEY_H__ #define __REGISTRATIONKEY_H__ #include "xabstractconfigure.h" #include "ui_registrationKey.h" class registrationKey : public XAbstractConfigure, public Ui::registrationKey { Q_OBJECT public: registrationKey(QWidget* parent = 0, const char * = 0, Qt::WFlags fl = Qt::Window); public slots: virtual bool sSave(); virtual void sCheck(); protected slots: virtual void languageChange(); }; #endif // __REGISTRATIONKEY_H__ qt-client-4.1.0/guiclient/registrationKey.ui000066400000000000000000000075011217451700100211220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. registrationKey 0 0 365 157 Registration Key Registration Key 0 Customer: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 TextLabel Expiration Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 TextLabel Max Concurrent Users: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 TextLabel Qt::Vertical 20 40 qt-client-4.1.0/guiclient/registrationKeyDialog.cpp000066400000000000000000000031701217451700100224050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "registrationKeyDialog.h" #include "xtupleproductkey.h" #include registrationKeyDialog::registrationKeyDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, modal ? (fl | Qt::Dialog) : fl) { setupUi(this); // signals and slots connections connect(_key, SIGNAL(textChanged(const QString&)), this, SLOT(sCheckKey())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); } registrationKeyDialog::~registrationKeyDialog() { // no need to delete child widgets, Qt does it all for us } void registrationKeyDialog::languageChange() { retranslateUi(this); } void registrationKeyDialog::sCheckKey() { XTupleProductKey pkey(_key->text()); if(pkey.valid() && pkey.expiration() > QDate::currentDate()) _select->setEnabled(true); } void registrationKeyDialog::sSelect() { XTupleProductKey pk(_key->text()); if(pk.valid()) { XSqlQuery keyq; keyq.prepare("UPDATE metric SET metric_value=:key WHERE metric_name='RegistrationKey';"); keyq.bindValue(":key", _key->text()); keyq.exec(); } done(0); } void registrationKeyDialog::sClose() { done(-1); } qt-client-4.1.0/guiclient/registrationKeyDialog.h000066400000000000000000000020671217451700100220560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REGISTRATIONKEYDIALOG_H #define REGISTRATIONKEYDIALOG_H #include "guiclient.h" #include #include "ui_registrationKeyDialog.h" class registrationKeyDialog : public QDialog, public Ui::registrationKeyDialog { Q_OBJECT public: registrationKeyDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~registrationKeyDialog(); public slots: virtual void sCheckKey(); virtual void sSelect(); virtual void sClose(); protected slots: virtual void languageChange(); private: int _bankaccntid; QString _type; }; #endif // REGISTRATIONKEYDIALOG_H qt-client-4.1.0/guiclient/registrationKeyDialog.ui000066400000000000000000000067441217451700100222520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. registrationKeyDialog 0 0 410 108 Expired Registration Key 7 5 0 New Registration Key 0 Qt::Vertical QSizePolicy::Expanding 16 16 0 5 &Cancel false &Select true true Qt::Vertical QSizePolicy::Expanding 10 21 _select _close parameter.h qt-client-4.1.0/guiclient/rejectCode.cpp000066400000000000000000000112061217451700100201500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "rejectCode.h" #include #include rejectCode::rejectCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } rejectCode::~rejectCode() { // no need to delete child widgets, Qt does it all for us } void rejectCode::languageChange() { retranslateUi(this); } enum SetResponse rejectCode::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("rjctcode_id", &valid); if (valid) { _rjctcodeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void rejectCode::sSave() { XSqlQuery rejectSave; if (_code->text().length() == 0) { QMessageBox::information( this, tr("Invalid Reject Code"), tr("You must enter a valid code for this Reject Code.") ); _code->setFocus(); return; } if (_mode == cNew) { if (sCheck()) { QMessageBox::warning( this, tr("Cannot Save Reject Code"), tr("This Reject code already exists. You have been placed in edit mode.") ); return; } rejectSave.exec("SELECT NEXTVAL('rjctcode_rjctcode_id_seq') AS rjctcode_id"); if (rejectSave.first()) _rjctcodeid = rejectSave.value("rjctcode_id").toInt(); rejectSave.prepare( "INSERT INTO rjctcode " "(rjctcode_id, rjctcode_code, rjctcode_descrip) " "VALUES " "(:rjctcode_id, :rjctcode_code, :rjctcode_descrip);" ); } else if (_mode == cEdit) rejectSave.prepare("SELECT rjctcode_id" " FROM rjctcode" " WHERE((rjctcode_id != :rjctcode_id)" " AND (rjctcode_code = :rjctcode_code));"); rejectSave.bindValue(":rjctcode_id", _rjctcodeid); rejectSave.bindValue(":rjctcode_code", _code->text()); rejectSave.exec(); if (rejectSave.first()) { QMessageBox::warning( this, tr("Cannot Save Reject Code"), tr("You may not rename this Reject code with the entered name as it is in use by another Reject code.") ); return; } rejectSave.prepare( "UPDATE rjctcode " "SET rjctcode_code=:rjctcode_code," " rjctcode_descrip=:rjctcode_descrip " "WHERE (rjctcode_id=:rjctcode_id);" ); rejectSave.bindValue(":rjctcode_id", _rjctcodeid); rejectSave.bindValue(":rjctcode_code", _code->text()); rejectSave.bindValue(":rjctcode_descrip", _description->text().trimmed()); rejectSave.exec(); done(_rjctcodeid); } bool rejectCode::sCheck() { XSqlQuery rejectCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().length())) { rejectCheck.prepare( "SELECT rjctcode_id " "FROM rjctcode " "WHERE (UPPER(rjctcode_code)=UPPER(:rjctcode_code));" ); rejectCheck.bindValue(":rjctcode_code", _code->text()); rejectCheck.exec(); if (rejectCheck.first()) { _rjctcodeid = rejectCheck.value("rjctcode_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); return TRUE; } } return FALSE; } void rejectCode::populate() { XSqlQuery rejectpopulate; rejectpopulate.prepare( "SELECT rjctcode_code, rjctcode_descrip " "FROM rjctcode " "WHERE (rjctcode_id=:rjctcode_id);" ); rejectpopulate.bindValue(":rjctcode_id", _rjctcodeid); rejectpopulate.exec(); if (rejectpopulate.first()) { _code->setText(rejectpopulate.value("rjctcode_code").toString()); _description->setText(rejectpopulate.value("rjctcode_descrip").toString()); } } qt-client-4.1.0/guiclient/rejectCode.h000066400000000000000000000020571217451700100176210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REJECTCODE_H #define REJECTCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_rejectCode.h" class rejectCode : public XDialog, public Ui::rejectCode { Q_OBJECT public: rejectCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~rejectCode(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual bool sCheck(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _rjctcodeid; }; #endif // REJECTCODE_H qt-client-4.1.0/guiclient/rejectCode.ui000066400000000000000000000075321217451700100200120ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. rejectCode 0 0 400 100 Reject Code C&ode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit

    xlineedit.h
    1 _code _description parameter.h qt-client-4.1.0/guiclient/rejectCodes.cpp000066400000000000000000000076361217451700100203470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "rejectCodes.h" #include #include #include #include #include "rejectCode.h" rejectCodes::rejectCodes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_rjctcode, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_rjctcode, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); if (_privileges->check("MaintainRejectCodes")) { connect(_rjctcode, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_rjctcode, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_rjctcode, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_rjctcode, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _rjctcode->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "rjctcode_code" ); _rjctcode->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "rjctcode_descrip" ); sFillList(); } rejectCodes::~rejectCodes() { // no need to delete child widgets, Qt does it all for us } void rejectCodes::languageChange() { retranslateUi(this); } void rejectCodes::sNew() { ParameterList params; params.append("mode", "new"); rejectCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void rejectCodes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("rjctcode_id", _rjctcode->id()); rejectCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void rejectCodes::sView() { ParameterList params; params.append("mode", "view"); params.append("rjctcode_id", _rjctcode->id()); rejectCode newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void rejectCodes::sDelete() { XSqlQuery rejectDelete; rejectDelete.prepare( "SELECT poreject_id " "FROM poreject " "WHERE (poreject_rjctcode_id=:rjctcode_id) " "LIMIT 1;" ); rejectDelete.bindValue(":rjctcode_id", _rjctcode->id()); rejectDelete.exec(); if (rejectDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Reject Code"), tr( "You may not delete the selected Reject Code as there are Material Reject records that refer it.\n" "You must purge these records before you may delete the selected Reject Code." ) ); return; } rejectDelete.prepare( "DELETE FROM rjctcode " "WHERE (rjctcode_id=:rjctcode_id);" ); rejectDelete.bindValue(":rjctcode_id", _rjctcode->id()); rejectDelete.exec(); sFillList(); } void rejectCodes::sFillList() { _rjctcode->populate( "SELECT rjctcode_id, rjctcode_code, rjctcode_descrip " "FROM rjctcode " "ORDER BY rjctcode_code;" ); } void rejectCodes::sPopulateMenu( QMenu * ) { } void rejectCodes::sPrint() { orReport report("RejectCodeMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/rejectCodes.h000066400000000000000000000020661217451700100200040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REJECTCODES_H #define REJECTCODES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_rejectCodes.h" class rejectCodes : public XWidget, public Ui::rejectCodes { Q_OBJECT public: rejectCodes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~rejectCodes(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // REJECTCODES_H qt-client-4.1.0/guiclient/rejectCodes.ui000066400000000000000000000111701217451700100201660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. rejectCodes 0 0 600 400 List Reject Codes 0 Reject Codes: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _rjctcode _new _edit _view _delete _print _close parameter.h _rjctcode valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() rejectCodes close() 20 20 20 20
    qt-client-4.1.0/guiclient/relativeCalendarItem.cpp000066400000000000000000000163141217451700100221720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "relativeCalendarItem.h" #include #include static const char *offsetTypes[] = { "D", "W", "M", "Y" }; relativeCalendarItem::relativeCalendarItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_offsetType, SIGNAL(activated(int)), this, SLOT(sHandleNewOffsetType(int))); } relativeCalendarItem::~relativeCalendarItem() { // no need to delete child widgets, Qt does it all for us } void relativeCalendarItem::languageChange() { retranslateUi(this); } enum SetResponse relativeCalendarItem::set(const ParameterList &pParams) { XSqlQuery relativeet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("calhead_id", &valid); if (valid) _calheadid = param.toInt(); else _calheadid = -1; param = pParams.value("calendarName", &valid); if (valid) _calendarName->setText(param.toString()); else if (_calheadid != -1) { relativeet.prepare( "SELECT calhead_name " "FROM calhead " "WHERE (calhead_id=:calhead_id);" ); relativeet.bindValue(":calhead_id", _calheadid); relativeet.exec(); if (relativeet.first()) _calendarName->setText(relativeet.value("calhead_name").toString()); } param = pParams.value("calitem_id", &valid); if (valid) { _calitemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } } return NoError; } void relativeCalendarItem::populate() { XSqlQuery relativepopulate; relativepopulate.prepare( "SELECT calhead_id, calhead_name " "FROM calhead, rcalitem " "WHERE ( (rcalitem_calhead_id=calhead_id)" " AND (rcalitem_id=:rcalitem_id) );" ); relativepopulate.bindValue(":rcalitem_id", _calitemid); relativepopulate.exec(); if (relativepopulate.first()) { _calheadid = relativepopulate.value("calhead_id").toInt(); _calendarName->setText(relativepopulate.value("calhead_name").toString()); } relativepopulate.prepare( "SELECT rcalitem_name," " rcalitem_offsettype, rcalitem_offsetcount," " rcalitem_periodtype, rcalitem_periodcount " "FROM rcalitem " "WHERE (rcalitem_id=:rcalitem_id);" ); relativepopulate.bindValue(":rcalitem_id", _calitemid); relativepopulate.exec(); if (relativepopulate.first()) { int counter; _name->setText(relativepopulate.value("rcalitem_name").toString()); _offsetCount->setValue(relativepopulate.value("rcalitem_offsetcount").toInt()); for (counter = 0; counter < _offsetType->count(); counter++) { if (relativepopulate.value("rcalitem_offsettype").toString() == offsetTypes[counter]) { _offsetType->setCurrentIndex(counter); break; } } _periodCount->setValue(relativepopulate.value("rcalitem_periodcount").toInt()); for (counter = 0; counter < _offsetType->count(); counter++) { if (relativepopulate.value("rcalitem_periodtype").toString() == offsetTypes[counter]) { _periodType->setCurrentIndex(counter); break; } } } else reject(); } void relativeCalendarItem::sHandleNewOffsetType(int pOffsetType) { _periodType->setCurrentIndex(pOffsetType); } void relativeCalendarItem::sSave() { XSqlQuery relativeSave; if (_mode == cNew) relativeSave.prepare( "SELECT rcalitem_id " "FROM rcalitem " "WHERE ( (rcalitem_calhead_id=:calhead_id)" " AND (rcalitem_offsettype=:offsetType)" " AND (rcalitem_offsetcount=:offsetCount)" " AND (rcalitem_periodtype=:periodType)" " AND (rcalitem_periodcount=:periodCount) );" ); else if (_mode == cEdit) relativeSave.prepare( "SELECT rcalitem_id " "FROM rcalitem " "WHERE ( (rcalitem_calhead_id=:calhead_id)" " AND (rcalitem_offsettype=:offsetType)" " AND (rcalitem_offsetcount=:offsetCount)" " AND (rcalitem_periodtype=:periodType)" " AND (rcalitem_periodcount=:periodCount)" " AND (rcalitem_id<>:rcalitem_id) );" ); relativeSave.bindValue(":rcalitem_id", _calitemid); relativeSave.bindValue(":calhead_id", _calheadid); relativeSave.bindValue(":offsetType", offsetTypes[_offsetType->currentIndex()]); relativeSave.bindValue(":offsetCount", _offsetCount->value()); relativeSave.bindValue(":periodType", offsetTypes[_periodType->currentIndex()]); relativeSave.bindValue(":periodCount", _periodCount->value()); relativeSave.exec(); if (relativeSave.first()) { QMessageBox::critical( this, tr("Cannon Create Duplicate Calendar Item"), tr( "A Relative Calendar Item for the selected Calendar exists that has the save Offset and Period as this Calendar Item.\n" "You may not create duplicate Calendar Items." ) ); return; } if (_mode == cNew) { relativeSave.exec("SELECT NEXTVAL('xcalitem_xcalitem_id_seq') AS _calitem_id;"); if (relativeSave.first()) _calitemid = relativeSave.value("_calitem_id").toInt(); relativeSave.prepare( "INSERT INTO rcalitem " "( rcalitem_id, rcalitem_calhead_id, rcalitem_name," " rcalitem_offsettype, rcalitem_offsetcount," " rcalitem_periodtype, rcalitem_periodcount ) " "VALUES " "( :rcalitem_id, :rcalitem_calhead_id, :rcalitem_name," " :rcalitem_offsettype, :rcalitem_offsetcount," " :rcalitem_periodtype, :rcalitem_periodcount );" ); } else if (_mode == cEdit) relativeSave.prepare( "UPDATE rcalitem " "SET rcalitem_name=:rcalitem_name," " rcalitem_offsettype=:rcalitem_offsettype, rcalitem_offsetcount=:rcalitem_offsetcount," " rcalitem_periodtype=:rcalitem_periodtype, rcalitem_periodcount=:rcalitem_periodcount " "WHERE (rcalitem_id=:rcalitem_id);" ); relativeSave.bindValue(":rcalitem_id", _calitemid); relativeSave.bindValue(":rcalitem_calhead_id", _calheadid); relativeSave.bindValue(":rcalitem_name", _name->text()); relativeSave.bindValue(":rcalitem_offsettype", offsetTypes[_offsetType->currentIndex()]); relativeSave.bindValue(":rcalitem_offsetcount", _offsetCount->value()); relativeSave.bindValue(":rcalitem_periodtype", offsetTypes[_periodType->currentIndex()]); relativeSave.bindValue(":rcalitem_periodcount", _periodCount->value()); relativeSave.exec(); done(_calitemid); } qt-client-4.1.0/guiclient/relativeCalendarItem.h000066400000000000000000000022611217451700100216330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RELATIVECALENDARITEM_H #define RELATIVECALENDARITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_relativeCalendarItem.h" class relativeCalendarItem : public XDialog, public Ui::relativeCalendarItem { Q_OBJECT public: relativeCalendarItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~relativeCalendarItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sHandleNewOffsetType( int pOffsetType ); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _calitemid; int _calheadid; }; #endif // RELATIVECALENDARITEM_H qt-client-4.1.0/guiclient/relativeCalendarItem.ui000066400000000000000000000265131217451700100220270ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. relativeCalendarItem 0 0 386 120 Relative Calendar Item 5 7 0 0 0 5 0 5 Calendar Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 5 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 5 0 0 Period Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Offset: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Period Length: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 999 -999 1 0 0 0 Days Weeks Months Years 0 5 999 0 1 1 0 0 0 Days Weeks Months Years Qt::Vertical QSizePolicy::Preferred 20 16 0 0 0 5 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QWidget
    xlineedit.h
    1
    _name _offsetCount _offsetType _periodCount _periodType _save _close _close clicked() relativeCalendarItem reject() 20 20 20 20
    qt-client-4.1.0/guiclient/releasePlannedOrdersByPlannerCode.cpp000066400000000000000000000047521217451700100246200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "releasePlannedOrdersByPlannerCode.h" #include #include releasePlannedOrdersByPlannerCode::releasePlannedOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _plannerCode->setType(ParameterGroup::PlannerCode); // TODO Always append to existing unreleased Transfer Orders _appendTransferOrder->hide(); _appendTransferOrder->setChecked(TRUE); } releasePlannedOrdersByPlannerCode::~releasePlannedOrdersByPlannerCode() { // no need to delete child widgets, Qt does it all for us } void releasePlannedOrdersByPlannerCode::languageChange() { retranslateUi(this); } void releasePlannedOrdersByPlannerCode::sRelease() { XSqlQuery releaseRelease; if (!_cutoffDate->isValid()) { QMessageBox::critical( this, tr("Enter Cutoff Date"), tr("Please enter a valid Cutoff Date.") ); _cutoffDate->setFocus(); return; } QString sql( "SELECT releasePlannedOrder(planord_id, TRUE, :appendTransferOrder) " "FROM planord, itemsite " "WHERE ( (planord_itemsite_id=itemsite_id)" " AND (planord_startdate<=:cutOffDate)" ); if (_warehouse->isChecked()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_firmedOnly->isChecked()) sql += " AND (planord_firm)"; if (_plannerCode->isSelected()) sql += " AND (itemsite_plancode_id=:plancode_id)"; else if (_plannerCode->isPattern()) sql += " AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ :plancode_pattern)))"; sql += ");"; releaseRelease.prepare(sql); releaseRelease.bindValue(":cutOffDate", _cutoffDate->date()); // releaseRelease.bindValue(":appendTransferOrder", QVariant(_appendTransferOrder->isChecked())); releaseRelease.bindValue(":appendTransferOrder", true); _warehouse->bindValue(releaseRelease); _plannerCode->bindValue(releaseRelease); releaseRelease.exec(); accept(); } qt-client-4.1.0/guiclient/releasePlannedOrdersByPlannerCode.h000066400000000000000000000021011217451700100242470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RELEASEPLANNEDORDERSBYPLANNERCODE_H #define RELEASEPLANNEDORDERSBYPLANNERCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_releasePlannedOrdersByPlannerCode.h" class releasePlannedOrdersByPlannerCode : public XDialog, public Ui::releasePlannedOrdersByPlannerCode { Q_OBJECT public: releasePlannedOrdersByPlannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~releasePlannedOrdersByPlannerCode(); public slots: virtual void sRelease(); protected slots: virtual void languageChange(); }; #endif // RELEASEPLANNEDORDERSBYPLANNERCODE_H qt-client-4.1.0/guiclient/releasePlannedOrdersByPlannerCode.ui000066400000000000000000000150711217451700100244470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. releasePlannedOrdersByPlannerCode 0 0 671 318 Release Planned Orders by Planner Code 12 12 Qt::StrongFocus false Qt::StrongFocus false Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Only Release Firmed Append planned transfer orders to existing unreleased transfer orders Qt::Horizontal 13 14 0 &Cancel &Release true true Qt::Vertical 20 20 DLineEdit QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    1
    WarehouseGroup QGroupBox
    warehousegroup.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    _plannerCode _warehouse _cutoffDate _release _close _close clicked() releasePlannedOrdersByPlannerCode reject() 20 20 20 20
    qt-client-4.1.0/guiclient/releaseTransferOrdersByAgent.cpp000066400000000000000000000042121217451700100236560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "releaseTransferOrdersByAgent.h" #include #include releaseTransferOrdersByAgent::releaseTransferOrdersByAgent(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _agent->setText(omfgThis->username()); } releaseTransferOrdersByAgent::~releaseTransferOrdersByAgent() { // no need to delete child widgets, Qt does it all for us } void releaseTransferOrdersByAgent::languageChange() { retranslateUi(this); } void releaseTransferOrdersByAgent::sRelease() { XSqlQuery releaseRelease; static bool run = false; if (run) return; run = true; QString sql("SELECT COUNT(releaseTransferOrder(tohead_id)) AS result " " FROM ( SELECT DISTINCT tohead_id, tohead_agent_username " " FROM tohead, toitem " " WHERE ( (toitem_tohead_id=tohead_id)" " AND (toitem_status='U') ) ) AS data " // TODO: site priv checking for TO's? // " WHERE ( (checkTOSitePrivs(tohead_id))"); " WHERE ( TRUE"); if(_selectedAgent->isChecked()) sql += " AND (tohead_agent_username=:username)"; sql += ")"; releaseRelease.prepare(sql); releaseRelease.bindValue(":username", _agent->currentText()); releaseRelease.exec(); if (releaseRelease.first()) { QMessageBox::information( this, tr("Transfer Orders Released"), tr("%1 Transfer Orders have been released.") .arg(releaseRelease.value("result").toString()) ); omfgThis->sTransferOrdersUpdated(-1); } accept(); run = false; } qt-client-4.1.0/guiclient/releaseTransferOrdersByAgent.h000066400000000000000000000020021217451700100233160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RELEASETRANSFERORDERSBYAGENT_H #define RELEASETRANSFERORDERSBYAGENT_H #include "guiclient.h" #include "xdialog.h" #include "ui_releaseTransferOrdersByAgent.h" class releaseTransferOrdersByAgent : public XDialog, public Ui::releaseTransferOrdersByAgent { Q_OBJECT public: releaseTransferOrdersByAgent(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~releaseTransferOrdersByAgent(); public slots: virtual void sRelease(); protected slots: virtual void languageChange(); }; #endif // RELEASETRANSFERORDERSBYAGENT_H qt-client-4.1.0/guiclient/releaseTransferOrdersByAgent.ui000066400000000000000000000117461217451700100235230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. releaseTransferOrdersByAgent 0 0 400 100 Release Transfer Orders by Agent All Agents Agent: true 0 0 XComboBox::Agent Qt::Horizontal 40 20 0 0 0 &Cancel true &Release true true Qt::Vertical QSizePolicy::Expanding 20 0 XComboBox QComboBox
    xcombobox.h
    _allAgents _selectedAgent _agent _release _close _close clicked() releaseTransferOrdersByAgent reject() 334 31 20 20 _selectedAgent toggled(bool) _agent setEnabled(bool) 68 66 108 68
    qt-client-4.1.0/guiclient/releaseWorkOrdersByPlannerCode.cpp000066400000000000000000000152771217451700100241650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "releaseWorkOrdersByPlannerCode.h" #include #include #include #include releaseWorkOrdersByPlannerCode::releaseWorkOrdersByPlannerCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); QButtonGroup* _dateGroupInt = new QButtonGroup(this); _dateGroupInt->addButton(_startDate); _dateGroupInt->addButton(_dueDate); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); _plannerCode->setType(ParameterGroup::PlannerCode); } releaseWorkOrdersByPlannerCode::~releaseWorkOrdersByPlannerCode() { // no need to delete child widgets, Qt does it all for us } void releaseWorkOrdersByPlannerCode::languageChange() { retranslateUi(this); } bool releaseWorkOrdersByPlannerCode::setParams(ParameterList &pParams) { if (!_cutoffDate->isValid()) { QMessageBox::critical( this, tr("Enter Cutoff Date"), tr("Please enter a valid Cutoff Date.") ); _cutoffDate->setFocus(); return false; } pParams.append("cutOffDate", _cutoffDate->date()); if (_startDate->isChecked()) pParams.append("byStartDate"); else if (_dueDate->isChecked()) pParams.append("byDueDate"); _warehouse->appendValue(pParams); _plannerCode->appendValue(pParams); return true; } void releaseWorkOrdersByPlannerCode::sRelease() { XSqlQuery releaseRelease; /* we're going to use essentially the same query twice: 1 - to print the paperwork 2 - to release the work orders */ QString sql( "SELECT " " wo_id, CAST(wo_qtyord AS INTEGER) AS wo_qtyord_int " " " " releaseWo(wo_id, FALSE) " " " "FROM wo, itemsite, plancode " "WHERE ((wo_itemsite_id=itemsite_id)" " AND (itemsite_plancode_id=plancode_id)" " AND (wo_status='E')" "" " AND (wo_startdate<=)" "" " AND (wo_duedate<=)" "" "" " AND (itemsite_warehous_id=)" "" "" " AND (itemsite_plancode_id=)" "" " AND (itemsite_plancode_id IN (" " SELECT plancode_id" " FROM plancode" " WHERE (plancode_code ~ )))" "" ");" ); if (_pickList->isChecked() || _routing->isChecked() || _woLabel->isChecked() || _packingList->isChecked()) { ParameterList wop; if (! setParams(wop)) return; wop.append("paperwork"); MetaSQLQuery wom(sql); releaseRelease = wom.toQuery(wop); if (releaseRelease.lastError().type() != QSqlError::NoError) { systemError(this, releaseRelease.lastError().databaseText(), __FILE__, __LINE__); return; } QPrinter printer(QPrinter::HighResolution); bool setupPrinter = TRUE; bool userCanceled = false; while (releaseRelease.next()) { if (setupPrinter && orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("

    Could not initialize printing system for " "multiple reports.")); return; } ParameterList params; params.append("wo_id", releaseRelease.value("wo_id")); params.append("labelTo", releaseRelease.value("wo_qtyord_int")); if (_pickList->isChecked()) { orReport report("PickList", params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); orReport::endMultiPrint(&printer); return; } } if (_routing->isChecked()) { orReport report("Routing", params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); orReport::endMultiPrint(&printer); return; } } if (_woLabel->isChecked()) { orReport report("WOLabel", params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); orReport::endMultiPrint(&printer); return; } } if (_packingList->isChecked()) { XSqlQuery query; query.prepare( "SELECT cohead_id, findCustomerForm(cohead_cust_id, 'L') AS reportname " "FROM cohead, coitem, wo " "WHERE ( (coitem_cohead_id=cohead_id)" " AND (wo_ordid=coitem_id)" " AND (wo_ordtype='S')" " AND (wo_id=:wo_id) );" ); query.bindValue(":wo_id", releaseRelease.value("wo_id")); // from outer loop query query.exec(); if (query.first()) { ParameterList params; params.append("sohead_id", query.value("cohead_id")); params.append("head_id", query.value("cohead_id")); params.append("head_type", "SO"); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); orReport report(query.value("reportname").toString(), params); if (report.isValid() && report.print(&printer, setupPrinter)) setupPrinter = FALSE; else { report.reportError(this); orReport::endMultiPrint(&printer); return; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); orReport::endMultiPrint(&printer); return; } } } if (! setupPrinter) // we tried to print something orReport::endMultiPrint(&printer); if (QMessageBox::question(this, tr("Print Correctly?"), tr("

    Did the documents all print correctly?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; } ParameterList params; if (! setParams(params)) return; MetaSQLQuery mql(sql); releaseRelease = mql.toQuery(params); if (releaseRelease.lastError().type() != QSqlError::NoError) { systemError(this, releaseRelease.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sWorkOrdersUpdated(-1, TRUE); accept(); } qt-client-4.1.0/guiclient/releaseWorkOrdersByPlannerCode.h000066400000000000000000000021271217451700100236200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RELEASEWORKORDERSBYPLANNERCODE_H #define RELEASEWORKORDERSBYPLANNERCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_releaseWorkOrdersByPlannerCode.h" class releaseWorkOrdersByPlannerCode : public XDialog, public Ui::releaseWorkOrdersByPlannerCode { Q_OBJECT public: releaseWorkOrdersByPlannerCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~releaseWorkOrdersByPlannerCode(); virtual bool setParams(ParameterList &); public slots: virtual void sRelease(); protected slots: virtual void languageChange(); }; #endif // RELEASEWORKORDERSBYPLANNERCODE_H qt-client-4.1.0/guiclient/releaseWorkOrdersByPlannerCode.ui000066400000000000000000000176471217451700100240230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. releaseWorkOrdersByPlannerCode 0 0 636 292 Release Work Orders by Planner Code false 0 0 false 5 by Due Date by Start Date true 0 0 0 0 Cutoff Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Preferred 20 0 Documents: Print P&ick List Print &Routing Print Packing List Print Work Order Label Qt::Vertical 20 13 Qt::Horizontal 0 20 &Cancel &Release true true Qt::Vertical 72 0 DLineEdit QWidget

    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    _plannerCode _cutoffDate _startDate _warehouse _release _close _close clicked() releaseWorkOrdersByPlannerCode reject() 20 20 20 20 qt-client-4.1.0/guiclient/relocateInventory.cpp000066400000000000000000000267211217451700100216250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "relocateInventory.h" #include #include #include #include "inputManager.h" #include "storedProcErrorLookup.h" relocateInventory::relocateInventory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_item, SIGNAL(newId(int)), this, SLOT(sHandleItem())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_move, SIGNAL(clicked()), this, SLOT(sMove())); _captive = FALSE; _item->setType(ItemLineEdit::cLocationControlled); _qty->setValidator(omfgThis->transQtyVal()); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); _source->addColumn(tr("Location"),_itemColumn, Qt::AlignLeft, true, "location"); _source->addColumn(tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "lotserial"); _source->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight,true, "itemloc_qty"); _target->addColumn(tr("Location"), -1, Qt::AlignLeft, true, "locationname"); _target->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qty"); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } _defaultToTarget->hide(); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); } relocateInventory::~relocateInventory() { // no need to delete child widgets, Qt does it all for us } void relocateInventory::languageChange() { retranslateUi(this); } enum SetResponse relocateInventory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); } int locid; param = pParams.value("source_location_id", &valid); if (valid) { locid = param.toInt(); for (int i = 0; i < _source->topLevelItemCount(); i++) { XTreeWidgetItem* cursor = (XTreeWidgetItem*)(_source->topLevelItem(i)); if (cursor->altId() == locid) { _source->setCurrentItem(cursor); _source->scrollToItem(cursor); _source->setEnabled(false); } } } param = pParams.value("target_location_id", &valid); if (valid) { locid = param.toInt(); for (int i = 0; i < _target->topLevelItemCount(); i++) { XTreeWidgetItem* cursor = (XTreeWidgetItem*)(_target->topLevelItem(i)); if (cursor->id() == locid) { _target->setCurrentItem(cursor); _target->scrollToItem(cursor); _target->setEnabled(false); } } } param = pParams.value("itemloc_id", &valid); if (valid) { _captive = TRUE; XSqlQuery itemsiteid; itemsiteid.prepare( "SELECT itemloc_itemsite_id " "FROM itemloc " "WHERE (itemloc_id=:itemloc_id);" ); itemsiteid.bindValue(":itemloc_id", param.toInt()); itemsiteid.exec(); if (itemsiteid.first()) { _item->setItemsiteid(itemsiteid.value("itemloc_itemsite_id").toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); for (int i = 0; i < _source->topLevelItemCount(); i++) { XTreeWidgetItem* cursor = (XTreeWidgetItem*)(_source->topLevelItem(i)); if (cursor->id() == param.toInt()) { _source->setCurrentItem(cursor); _source->scrollToItem(cursor); } } _source->setEnabled(FALSE); } } param = pParams.value("qty", &valid); if (valid) { _qty->setDouble(param.toDouble()); _qty->setEnabled(false); } return NoError; } void relocateInventory::sHandleItem() { if (_item->isFractional()) _qty->setValidator(omfgThis->transQtyVal()); else _qty->setValidator(new QIntValidator(this)); } void relocateInventory::sMove() { struct { bool condition; QString msg; QWidget *widget; } error[] = { { ! _item->isValid(), tr("You must select an Item before posting this transaction."), _item }, { _qty->text().length() == 0 || _qty->toDouble() <= 0, tr("

    You must enter a positive Quantity before posting this Transaction."), _qty }, { _source->id() < 0, tr("

    You must select a Source Location before relocating Inventory."), _source }, { _target->id() < 0, tr("

    You must select a Target Location before relocating Inventory."), _target }, { _source->id() > 0 && _target->id() > 0 && _source->rawValue("location") == _target->rawValue("locationname"), tr("

    Please select different Locations for the Source and Target."), _target }, { true, "", NULL } }; int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Post Transaction"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery relocate; relocate.prepare( "SELECT relocateInventory(:source, :target, itemsite_id," ":qty, :comments, :date) AS result " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id));" ); relocate.bindValue(":source", _source->id()); relocate.bindValue(":target", _target->id()); relocate.bindValue(":qty", _qty->toDouble()); relocate.bindValue(":comments", _notes->toPlainText().trimmed()); relocate.bindValue(":item_id", _item->id()); relocate.bindValue(":warehous_id", _warehouse->id()); relocate.bindValue(":date", _transDate->date()); relocate.exec(); if (relocate.first()) { int result = relocate.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("relocateInventory", result), __FILE__, __LINE__); return; } } else if (relocate.lastError().type() != QSqlError::NoError) { systemError(this, relocate.lastError().databaseText(), __FILE__, __LINE__); return; } sChangeDefaultLocation(); if (_captive) accept(); else { _close->setText(tr("&Close")); sFillList(); _qty->clear(); _notes->clear(); _transDate->setDate(omfgThis->dbDate()); _item->setFocus(); } } void relocateInventory::sFillList() { sShowHideDefaultToTarget(); if (_item->isValid()) { XSqlQuery query; query.prepare( "SELECT itemloc.*," " CASE WHEN (itemloc_location_id=-1) THEN :undefined" " ELSE formatLocationName(itemloc_location_id)" " END AS location," " formatlotserialnumber(itemloc_ls_id) AS lotserial," " 'qty' AS itemloc_qty_xtnumericrole," " CASE WHEN (itemloc_location_id=itemsite_location_id) THEN 'altemphasis' " " END AS location_qtforegroundrole " "FROM itemloc, itemsite " "WHERE ( (itemloc_itemsite_id=itemsite_id)" " AND (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) ) " "ORDER BY location;" ); query.bindValue(":undefined", tr("Undefined")); query.bindValue(":item_id", _item->id()); query.bindValue(":warehous_id", _warehouse->id()); query.exec(); _source->populate(query, true); if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } query.prepare( "SELECT location_id, locationname, qty," " 'qty' AS qty_xtnumericrole," " CASE WHEN (qty=0) THEN '' " " END AS qty_qtdisplayrole," " CASE WHEN (location_id=itemsite_location_id) THEN 'altemphasis' " " END AS locationname_qtforegroundrole " "FROM ( " "SELECT location_id, itemsite_location_id," " formatLocationName(location_id) AS locationname," " ( SELECT COALESCE(SUM(itemloc_qty), 0)" " FROM itemloc, itemsite" " WHERE ( (itemloc_location_id=location_id)" " AND (itemloc_itemsite_id=itemsite_id)" " AND (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=location_warehous_id))) AS qty " "FROM location, itemsite " "WHERE ( (itemsite_warehous_id=:warehous_id)" " AND (location_warehous_id=:warehous_id)" " AND (itemsite_item_id=:item_id)" " AND (validLocation(location_id, itemsite_id)) ) " "ORDER BY locationname ) AS data" ); query.bindValue(":warehous_id", _warehouse->id()); query.bindValue(":item_id", _item->id()); query.exec(); _target->populate(query); if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _source->clear(); _target->clear(); } } void relocateInventory::sShowHideDefaultToTarget() { if (!_metrics->boolean("SetDefaultLocations")) return; XSqlQuery query; query.prepare(" SELECT itemsite_id, itemsite_loccntrl, itemsite_location_id " " FROM itemsite " " WHERE (itemsite_item_id=:item_id) " " AND (itemsite_warehous_id=:warehous_id);"); query.bindValue(":item_id", _item->id()); query.bindValue(":warehous_id", _warehouse->id()); query.exec(); if(query.first()) { if(query.value("itemsite_id").toInt() != -1 && query.value("itemsite_loccntrl").toBool()) { _defaultToTarget->show(); //Allow default location update with correct privileges if (_privileges->check("MaintainItemSites")) _defaultToTarget->setEnabled(true); else _defaultToTarget->setEnabled(false); _defaultToTarget->setChecked(false); } else { _defaultToTarget->hide(); _defaultToTarget->setChecked(false); } } else { _defaultToTarget->hide(); _defaultToTarget->setChecked(false); } } void relocateInventory::sChangeDefaultLocation() { if (_defaultToTarget->isChecked()) { XSqlQuery query; query.prepare( " UPDATE itemsite" " SET itemsite_location_id=:target_id" " WHERE (itemsite_item_id=:item_id) "); query.bindValue(":target_id", _target->id()); query.bindValue(":item_id", _item->id()); query.exec(); sFillList(); if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/relocateInventory.h000066400000000000000000000023031217451700100212600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RELOCATEINVENTORY_H #define RELOCATEINVENTORY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_relocateInventory.h" class relocateInventory : public XDialog, public Ui::relocateInventory { Q_OBJECT public: relocateInventory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~relocateInventory(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sHandleItem(); virtual void sMove(); virtual void sChangeDefaultLocation(); virtual void sShowHideDefaultToTarget(); protected slots: virtual void languageChange(); private: bool _captive; private slots: virtual void sFillList(); }; #endif // RELOCATEINVENTORY_H qt-client-4.1.0/guiclient/relocateInventory.ui000066400000000000000000000313771217451700100214630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. relocateInventory 0 0 617 600 Relocate Inventory 12 12 Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate Qt::Horizontal 40 20 Qt::StrongFocus 0 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 0 Set Target Location as Default on Move true 0 5 &Cancel false &Move true true Qt::Vertical QSizePolicy::Expanding 20 20 7 0 Source: 0 0 300 100 0 Target: 0 0 200 100 0 5 Qty. to Move: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 20 0 Notes: true DLineEdit QWidget

    datecluster.h
    1 ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _warehouse _source _target _qty _move _close _transDate parameter.h _item valid(bool) _move setEnabled(bool) 20 20 20 20 _close clicked() relocateInventory reject() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 qt-client-4.1.0/guiclient/reports.cpp000066400000000000000000000131471217451700100176050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reports.h" #include #include #include #include #include #include #include #include "errorReporter.h" reports::reports(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_byPackage, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_report, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_report, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_report, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); _report->addColumn(tr("Name"), 200, Qt::AlignLeft, true, "report_name" ); _report->addColumn(tr("Grade"), _seqColumn, Qt::AlignRight,true, "report_grade"); _report->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "report_descrip"); _report->addColumn(tr("Package"),_itemColumn, Qt::AlignLeft, false,"pkgname"); connect(omfgThis, SIGNAL(reportsChanged(int, bool)), this, SLOT(sFillList())); sFillList(); } reports::~reports() { // no need to delete child widgets, Qt does it all for us } void reports::languageChange() { retranslateUi(this); } bool reports::setParams(ParameterList ¶ms) { if (_byPackage->isChecked()) params.append("byPackage"); return true; } void reports::sFillList() { QString errmsg; bool ok; MetaSQLQuery getm = MQLUtil::mqlLoad("reports", "detail", errmsg, &ok); if (! ok) { ErrorReporter::error(QtCriticalMsg, this, tr("Getting Reports"), errmsg, __FILE__, __LINE__); return; } ParameterList getp; if (! setParams(getp)) return; XSqlQuery getq = getm.toQuery(getp); _report->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Reports"), getq, __FILE__, __LINE__)) return; } void reports::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("ReportsMasterList", params); if (report.isValid()) report.print(); else report.reportError(this); } void reports::sNew() { if (!omfgThis->_reportHandler) { omfgThis->_reportHandler = new ReportHandler(omfgThis, "report handler"); if(_preferences->value("InterfaceWindowOption") != "TopLevel") omfgThis->_reportHandler->setParentWindow(omfgThis->workspace()); omfgThis->_reportHandler->setAllowDBConnect(FALSE); omfgThis->_reportHandler->setPlaceMenusOnWindows(TRUE); omfgThis->_reportHandler->setPlaceToolbarsOnWindows(TRUE); connect(omfgThis->_reportHandler, SIGNAL(reportsChanged(int, bool)), omfgThis, SLOT(sReportsChanged(int, bool))); } omfgThis->_reportHandler->fileNew(); } void reports::sEdit() { if (!omfgThis->_reportHandler) { omfgThis->_reportHandler = new ReportHandler(omfgThis, "report handler"); if(_preferences->value("InterfaceWindowOption") != "TopLevel") omfgThis->_reportHandler->setParentWindow(omfgThis->workspace()); omfgThis->_reportHandler->setAllowDBConnect(FALSE); omfgThis->_reportHandler->setPlaceMenusOnWindows(TRUE); omfgThis->_reportHandler->setPlaceToolbarsOnWindows(TRUE); connect(omfgThis->_reportHandler, SIGNAL(reportsChanged(int, bool)), omfgThis, SLOT(sReportsChanged(int, bool))); } XSqlQuery getq; getq.prepare("SELECT report_name, report_grade, report_source " " FROM report " " WHERE (report_id=:report_id);"); getq.bindValue(":report_id", _report->id()); getq.exec(); if (getq.first()) { QDomDocument doc; QString errorMessage; int errorLine; int errorColumn; if (doc.setContent(getq.value("report_source").toString(), &errorMessage, &errorLine, &errorColumn)) omfgThis->_reportHandler->fileOpen(doc, getq.value("report_name").toString(), getq.value("report_grade").toInt()); else { ErrorReporter::error(QtCriticalMsg, this, tr("Error Loading Report"), errorMessage, getq.value("report_name").toString(), errorLine); return; } } } void reports::sDelete() { if (QMessageBox::question(this, tr("Delete Report?"), tr("

    Are you sure that you want to completely " "delete the selected Report?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare( "DELETE FROM report WHERE (report_id=:report_id);" ); delq.bindValue(":report_id", _report->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Report"), delq, __FILE__, __LINE__)) return; sFillList(); } } qt-client-4.1.0/guiclient/reports.h000066400000000000000000000017551217451700100172540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REPORTS_H #define REPORTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_reports.h" class reports : public XWidget, public Ui::reports { Q_OBJECT public: reports(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~reports(); public slots: virtual bool setParams(ParameterList ¶ms); virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // REPORTS_H qt-client-4.1.0/guiclient/reports.ui000066400000000000000000000143071217451700100174370ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reports 0 0 560 344 List Report Definitions 12 10 10 0 0 0 20 Report Definitions: Qt::Horizontal 40 20 Organize By Package 0 0 &Close &Print &New false &Edit Qt::Vertical QSizePolicy::Fixed 20 10 false &Delete Qt::Vertical QSizePolicy::Expanding 20 185 XCheckBox QCheckBox

    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _report _close clicked() reports close() 20 20 20 20 _report valid(bool) _edit setEnabled(bool) 20 20 20 20 _report valid(bool) _delete setEnabled(bool) 20 20 20 20 _report itemSelected(int) _edit animateClick() 20 20 20 20 qt-client-4.1.0/guiclient/reprintCreditMemos.cpp000066400000000000000000000042601217451700100217220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reprintCreditMemos.h" #include #include #include #include reprintCreditMemos::reprintCreditMemos(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : reprintMulticopyDocument("CreditMemoCopies", "CreditMemoWatermark", "CreditMemoShowPrices", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); list()->addColumn(tr("C/M #"), _orderColumn, Qt::AlignRight, true, "docnumber"); list()->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter,true, "cmhead_docdate"); list()->addColumn(tr("Cust. #"), -1, Qt::AlignLeft, true, "cust_number"); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name"); list()->addColumn(tr("Report"), -1, Qt::AlignLeft, false, "reportname"); _docListQueryString = "SELECT cmhead_id, cust_id," " cmhead_number AS docnumber, cmhead_docdate," " cust_number, cust_name," " findCustomerForm(cust_id, 'C') AS reportname" " FROM cmhead" " JOIN custinfo ON (cmhead_cust_id=cust_id)" " WHERE checkCreditMemoSitePrivs(cmhead_id)" " ORDER BY cmhead_docdate DESC;" ; setDoctype("CM"); setReportKey("cmhead_id"); sPopulate(); } reprintCreditMemos::~reprintCreditMemos() { // no need to delete child widgets, Qt does it all for us } void reprintCreditMemos::languageChange() { retranslateUi(this); } qt-client-4.1.0/guiclient/reprintCreditMemos.h000066400000000000000000000017231217451700100213700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REPRINTCREDITMEMOS_H #define REPRINTCREDITMEMOS_H #include "reprintMulticopyDocument.h" #include "ui_reprintCreditMemos.h" class reprintCreditMemos : public reprintMulticopyDocument, public Ui::reprintCreditMemos { Q_OBJECT public: reprintCreditMemos(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~reprintCreditMemos(); protected slots: virtual void languageChange(); }; #endif // REPRINTCREDITMEMOS_H qt-client-4.1.0/guiclient/reprintCreditMemos.ui000066400000000000000000000017741217451700100215640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reprintCreditMemos 0 0 355 24 Re-Print Credit Memos parameter.h qt-client-4.1.0/guiclient/reprintInvoices.cpp000066400000000000000000000047001217451700100212650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reprintInvoices.h" #include #include "errorReporter.h" reprintInvoices::reprintInvoices(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : reprintMulticopyDocument("InvoiceCopies", "InvoiceWatermark", "InvoiceShowPrices", parent, name, modal, fl) { setupUi(optionsWidget()); setWindowTitle(optionsWidget()->windowTitle()); list()->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignRight, true, "docnumber"); list()->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter,true, "invchead_invcdate"); list()->addColumn(tr("Cust. #"), -1, Qt::AlignLeft, true, "cust_number"); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name"); list()->addColumn(tr("Total Amount"),_bigMoneyColumn, Qt::AlignRight, true, "extprice" ); list()->addColumn(tr("Balance"), _bigMoneyColumn, Qt::AlignRight, true, "balance" ); list()->addColumn(tr("Report"), -1, Qt::AlignLeft, false,"reportname"); QString errmsg; bool ok = false; MetaSQLQuery mql = MQLUtil::mqlLoad("invoices", "detail", errmsg, &ok); if (! ok) ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Invoices"), errmsg, __FILE__, __LINE__); setDoctype("IN"); setReportKey("invchead_id"); _docListQueryString = mql.getSource(); } reprintInvoices::~reprintInvoices() { // no need to delete child widgets, Qt does it all for us } void reprintInvoices::languageChange() { retranslateUi(this); } ParameterList reprintInvoices::getParamsDocList() { ParameterList params; params.append("invc_pattern", _invoicePattern->text().trimmed()); params.append("getForm"); if (_dates->allValid()) _dates->appendValue(params); if (_balanceOnly->isChecked()) params.append("balanceOnly"); return params; } qt-client-4.1.0/guiclient/reprintInvoices.h000066400000000000000000000017101217451700100207300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REPRINTINVOICES_H #define REPRINTINVOICES_H #include "reprintMulticopyDocument.h" #include "ui_reprintInvoices.h" class reprintInvoices : public reprintMulticopyDocument, public Ui::reprintInvoices { Q_OBJECT public: reprintInvoices(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reprintInvoices(); Q_INVOKABLE ParameterList getParamsDocList(); protected slots: virtual void languageChange(); }; #endif // REPRINTINVOICES_H qt-client-4.1.0/guiclient/reprintInvoices.ui000066400000000000000000000056231217451700100211250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reprintInvoices 0 0 374 126 Re-Print Invoices Search for Invoice Number: Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft _invoicePattern Qt::Horizontal 40 20 Qt::StrongFocus Only include Invoices with Balance Qt::Vertical 20 40 DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    _invoicePattern _dates
    qt-client-4.1.0/guiclient/reprintMulticopyDocument.cpp000066400000000000000000000211511217451700100231710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reprintMulticopyDocument.h" #include #include #include #include #include #include #include "errorReporter.h" #include "storedProcErrorLookup.h" class reprintMulticopyDocumentPrivate : public Ui::reprintMulticopyDocument { public: reprintMulticopyDocumentPrivate(::reprintMulticopyDocument *parent) : _mpIsInitialized(false), _parent(parent), _printer(0) { setupUi(_parent); _printer = new QPrinter(QPrinter::HighResolution); _print->setFocus(); } ~reprintMulticopyDocumentPrivate() { if (_printer) { delete _printer; _printer = 0; } } QString _doctype; QString _doctypefull; bool _mpIsInitialized; ::reprintMulticopyDocument *_parent; QList _printed; QPrinter *_printer; QString _reportKey; }; reprintMulticopyDocument::reprintMulticopyDocument(QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { _data = new reprintMulticopyDocumentPrivate(this); connect(_data->_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_data->_query, SIGNAL(clicked()), this, SLOT(sPopulate())); // this indirection allows scripts to replace core behavior - 14285 connect(this, SIGNAL(timeToPrintOneDoc(XTreeWidgetItem*)), this, SLOT(sPrintOneDoc(XTreeWidgetItem*))); } reprintMulticopyDocument::reprintMulticopyDocument(QString numCopiesMetric, QString watermarkMetric, QString showPriceMetric, QWidget *parent, const char *name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { _data = new reprintMulticopyDocumentPrivate(this); _data->_copies->setWatermarkMetric(watermarkMetric); _data->_copies->setShowPriceMetric(showPriceMetric); _data->_copies->setNumCopiesMetric(numCopiesMetric); connect(_data->_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_data->_query, SIGNAL(clicked()), this, SLOT(sPopulate())); // this indirection allows scripts to replace core behavior - 14285 connect(this, SIGNAL(timeToPrintOneDoc(XTreeWidgetItem*)), this, SLOT(sPrintOneDoc(XTreeWidgetItem*))); } reprintMulticopyDocument::~reprintMulticopyDocument() { if (_data) { delete _data; _data = 0; } } void reprintMulticopyDocument::languageChange() { _data->retranslateUi(this); } enum SetResponse reprintMulticopyDocument::set(const ParameterList &pParams) { XDialog::set(pParams); return NoError; } void reprintMulticopyDocument::sAddToPrintedList(XTreeWidgetItem *item) { QVariant docid = item->id(); if (!_data->_printed.contains(docid)) _data->_printed.append(docid); } void reprintMulticopyDocument::sPrint() { _data->_printed.clear(); foreach (XTreeWidgetItem *item, list()->selectedItems()) { message(tr("Printing %1 #%2") .arg(_data->_doctypefull, item->text("docnumber"))); emit aboutToStart(item); emit timeToPrintOneDoc(item); message(""); } orReport::endMultiPrint(_data->_printer); _data->_mpIsInitialized = false; if (_data->_printed.size() == 0) QMessageBox::information(this, tr("No Documents to Print"), tr("There aren't any documents to print.")); _data->_printed.clear(); emit finishedWithAll(); list()->clearSelection(); } bool reprintMulticopyDocument::sPrintOneDoc(XTreeWidgetItem *item) { QString reportname = item->text("reportname"); bool printedOk = false; if (! _data->_mpIsInitialized) { bool userCanceled = false; if (orReport::beginMultiPrint(_data->_printer, userCanceled) == false) { if(!userCanceled) systemError(this, tr("Could not initialize printing system for multiple reports.")); return false; } } orReport report(reportname); if (! report.isValid()) QMessageBox::critical(this, tr("Cannot Find Form"), tr("

    Cannot find form '%1' for %2 %3." "It cannot be printed until the Form" "Assignment is updated to remove references " "to this Form or the Form is created.") .arg(reportname, _data->_doctypefull, item->text("docnumber"))); else { for (int i = 0; i < _data->_copies->numCopies(); i++) { report.setParamList(getParamsOneCopy(i, item)); if (! report.isValid()) { ErrorReporter::error(QtCriticalMsg, this, tr("Invalid Parameters"), tr("

    Report '%1' cannot be run. Parameters " "are missing.").arg(reportname), __FILE__, __LINE__); break; } else if (report.print(_data->_printer, ! _data->_mpIsInitialized)) { _data->_mpIsInitialized = true; printedOk = true; } else { report.reportError(this); break; } } } if (printedOk) { emit finishedPrinting(item->id()); sAddToPrintedList(item); } return printedOk; } void reprintMulticopyDocument::sPopulate() { ParameterList getp = getParamsDocList(); MetaSQLQuery getm(_docListQueryString); XSqlQuery getq = getm.toQuery(getp); list()->populate(getq); ErrorReporter::error(QtCriticalMsg, this, tr("Getting Documents"), getq, __FILE__, __LINE__); } XDocCopySetter *reprintMulticopyDocument::copies() { return _data->_copies; } QString reprintMulticopyDocument::doctype() { return _data->_doctype; } ParameterList reprintMulticopyDocument::getParamsDocList() { ParameterList params; params.append(_data->_reportKey, list()->id()); return params; } ParameterList reprintMulticopyDocument::getParamsOneCopy(int row, XTreeWidgetItem *item) { ParameterList params; params.append(_data->_reportKey, item->id()); params.append("showcosts", (_data->_copies->showCosts(row) ? "TRUE" : "FALSE")); params.append("watermark", _data->_copies->watermark(row)); return params; } bool reprintMulticopyDocument::isOnPrintedList(const int docid) { return _data->_printed.contains(docid); } XTreeWidget *reprintMulticopyDocument::list() { return _data->_list; } QWidget *reprintMulticopyDocument::optionsWidget() { return _data->_optionsFrame; } QString reprintMulticopyDocument::reportKey() { return _data->_reportKey; } void reprintMulticopyDocument::setDoctype(QString doctype) { _data->_doctype = doctype; if (doctype == "AR") _data->_doctypefull = tr("A/R Statement"); else if (doctype == "CM") _data->_doctypefull = tr("Credit Memo"); else if (doctype == "IN") _data->_doctypefull = tr("Invoice"); else if (doctype == "L") _data->_doctypefull = tr("Pick List"); else if (doctype == "P") _data->_doctypefull = tr("Packing List"); else if (doctype == "PO") _data->_doctypefull = tr("Purchase Order"); else if (doctype == "QT)") _data->_doctypefull = tr("Quote"); else if (doctype == "SO") _data->_doctypefull = tr("Sales Order"); else qWarning("printMulticopyDocument could not figure out doctypefull for %s", qPrintable(doctype)); } void reprintMulticopyDocument::setNumCopiesMetric(QString metric) { _data->_copies->setNumCopiesMetric(metric); } void reprintMulticopyDocument::setReportKey(QString key) { _data->_reportKey = key; } void reprintMulticopyDocument::setShowPriceMetric(QString metric) { _data->_copies->setShowPriceMetric(metric); } void reprintMulticopyDocument::setWatermarkMetric(QString metric) { _data->_copies->setWatermarkMetric(metric); } qt-client-4.1.0/guiclient/reprintMulticopyDocument.h000066400000000000000000000057541217451700100226510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REPRINTMULTICOPYDOCUMENT_H #define REPRINTMULTICOPYDOCUMENT_H #include "ui_reprintMulticopyDocument.h" #include #include "distributeInventory.h" #include "guiclient.h" #include "xdialog.h" class XDocCopySetter; class reprintMulticopyDocumentPrivate; class reprintMulticopyDocument : public XDialog { Q_OBJECT friend class reprintMulticopyDocumentPrivate; Q_PROPERTY(QString doctype READ doctype WRITE setDoctype) Q_PROPERTY(QString reportKey READ reportKey WRITE setReportKey) public: reprintMulticopyDocument(QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); reprintMulticopyDocument(QString numCopiesMetric, QString watermarkMetric, QString showPriceMetric, QWidget *parent = 0, const char *name = 0, bool modal = false, Qt::WFlags fl = 0); ~reprintMulticopyDocument(); Q_INVOKABLE virtual XDocCopySetter *copies(); virtual QString doctype(); Q_INVOKABLE virtual ParameterList getParamsDocList(); Q_INVOKABLE virtual ParameterList getParamsOneCopy(int row, XTreeWidgetItem *item); Q_INVOKABLE virtual bool isOnPrintedList(const int docid); Q_INVOKABLE virtual XTreeWidget *list(); Q_INVOKABLE virtual QWidget *optionsWidget(); virtual QString reportKey(); Q_INVOKABLE virtual void setNumCopiesMetric(QString metric); virtual void setReportKey(QString key); Q_INVOKABLE virtual void setShowPriceMetric(QString metric); Q_INVOKABLE virtual void setWatermarkMetric(QString metric); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sAddToPrintedList(XTreeWidgetItem *item); virtual void sPopulate(); virtual void sPrint(); virtual bool sPrintOneDoc(XTreeWidgetItem *item); virtual void setDoctype(QString doctype); signals: void docUpdated(int); void aboutToStart(XTreeWidgetItem*); void finishedPrinting(int); void finishedWithAll(); void timeToPrintOneDoc(XTreeWidgetItem*); protected slots: virtual void languageChange(); protected: reprintMulticopyDocumentPrivate *_data; QString _docListQueryString; }; #endif // REPRINTMULTICOPYDOCUMENT_H qt-client-4.1.0/guiclient/reprintMulticopyDocument.ui000066400000000000000000000111751217451700100230310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reprintMulticopyDocument 0 0 559 343 Reprint Multiple Copies of Document &Close Query false &Print true true Qt::Vertical QSizePolicy::Expanding 10 41 0 6 QFrame::NoFrame QFrame::Plain 0 7 QAbstractItemView::ExtendedSelection Select Documents to reprint: XDocCopySetter QWidget

    xdoccopysetter.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    parameter.h qprinter.h _close clicked() reprintMulticopyDocument reject() 20 20 20 20 _list valid(bool) _print setEnabled(bool) 227 104 508 61 qt-client-4.1.0/guiclient/reprioritizeWo.cpp000066400000000000000000000060631217451700100211430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reprioritizeWo.h" #include #include reprioritizeWo::reprioritizeWo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_reprioritize, SIGNAL(clicked()), this, SLOT(sReprioritize())); connect(_wo, SIGNAL(newId(int)), this, SLOT(sPopulateWoInfo(int))); _captive = FALSE; _wo->setType(cWoOpen | cWoExploded); if (_preferences->boolean("XCheckBox/forgetful")) _changeChildren->setChecked(true); } reprioritizeWo::~reprioritizeWo() { // no need to delete child widgets, Qt does it all for us } void reprioritizeWo::languageChange() { retranslateUi(this); } enum SetResponse reprioritizeWo::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } return NoError; } void reprioritizeWo::sReprioritize() { XSqlQuery reprioritizeReprioritize; if (_wo->status() == 'R') { QMessageBox::warning( this, tr("Cannot Reschedule Released W/O"), tr( "The selected Work Order has been Released.\n" "You must Recall this Work Order before Rescheduling it." ) ); return; } reprioritizeReprioritize.prepare("SELECT reprioritizeWo(:wo_id, :newPriority, :reprioritizeChildren);"); reprioritizeReprioritize.bindValue(":wo_id", _wo->id()); reprioritizeReprioritize.bindValue(":newPriority", _new->value()); reprioritizeReprioritize.bindValue(":reprioritizeChildren", QVariant(_changeChildren->isChecked())); reprioritizeReprioritize.exec(); omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); if (_captive) close(); else { _wo->setId(-1); _close->setText(tr("&Close")); _wo->setFocus(); } } void reprioritizeWo::sPopulateWoInfo(int pWoid) { XSqlQuery reprioritizePopulateWoInfo; if (pWoid != -1) { reprioritizePopulateWoInfo.prepare( "SELECT wo_priority " "FROM wo " "WHERE (wo_id=:wo_id);" ); reprioritizePopulateWoInfo.bindValue(":wo_id", pWoid); reprioritizePopulateWoInfo.exec(); if (reprioritizePopulateWoInfo.first()) { _current->setText(reprioritizePopulateWoInfo.value("wo_priority").toString()); _new->setValue(reprioritizePopulateWoInfo.value("wo_priority").toInt()); return; } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } _current->clear(); _new->setValue(1); } qt-client-4.1.0/guiclient/reprioritizeWo.h000066400000000000000000000020601217451700100206010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REPRIORITIZEWO_H #define REPRIORITIZEWO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_reprioritizeWo.h" class reprioritizeWo : public XDialog, public Ui::reprioritizeWo { Q_OBJECT public: reprioritizeWo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reprioritizeWo(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sReprioritize(); virtual void sPopulateWoInfo(int); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // REPRIORITIZEWO_H qt-client-4.1.0/guiclient/reprioritizeWo.ui000066400000000000000000000212651217451700100207770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reprioritizeWo 0 0 450 210 Reprioritize Work Order 5 0 0 5 0 2 Qt::Horizontal QSizePolicy::Expanding 20 20 0 5 &Cancel false &Reprioritize Qt::Vertical QSizePolicy::Preferred 20 20 0 5 0 0 Current Priority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 36 10 New Priority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 99 1 Qt::Horizontal QSizePolicy::Expanding 128 20 0 0 Reprioritize Child Work Orders (if any) Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 16 XCheckBox QCheckBox
    xcheckbox.h
    WoCluster QWidget
    wocluster.h
    _wo _new _changeChildren _reprioritize _close _close clicked() reprioritizeWo accept() 20 20 20 20 _wo valid(bool) _reprioritize setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/reschedulePoitem.cpp000066400000000000000000000105301217451700100214010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reschedulePoitem.h" #include #include reschedulePoitem::reschedulePoitem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_reschedule, SIGNAL(clicked()), this, SLOT(sReschedule())); connect(_po, SIGNAL(valid(bool)), _poitem, SLOT(setEnabled(bool))); connect(_po, SIGNAL(newId(int, QString)), this, SLOT(sPopulatePoitem(int))); connect(_poitem, SIGNAL(newID(int)), this, SLOT(sPopulate(int))); connect(_poitem, SIGNAL(valid(bool)), _reschedule, SLOT(setEnabled(bool))); } reschedulePoitem::~reschedulePoitem() { // no need to delete child widgets, Qt does it all for us } void reschedulePoitem::languageChange() { retranslateUi(this); } enum SetResponse reschedulePoitem::set(const ParameterList &pParams) { XSqlQuery rescheduleet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) { _po->setId(param.toInt()); _po->setReadOnly(true); } param = pParams.value("poitem_id", &valid); if (valid) { rescheduleet.prepare( "SELECT pohead_id " "FROM pohead, poitem " "WHERE ((poitem_pohead_id=pohead_id)" " AND (pohead_status='O')" " AND (poitem_id=:poitem_id));" ); rescheduleet.bindValue(":poitem_id", param.toInt()); rescheduleet.exec(); if (rescheduleet.first()) { _po->setId(rescheduleet.value("pohead_id").toInt()); _po->setReadOnly(true); _poitem->setId(param.toInt()); _poitem->setEnabled(false); } else { QMessageBox::critical(this, tr("P/O Not Open"), tr("The P/O line item you are trying to reschedule does\n" "not belong to an Open P/O.") ); return UndefinedError; } } return NoError; } void reschedulePoitem::sPopulatePoitem(int pPoheadid) { XSqlQuery reschedulePopulatePoitem; reschedulePopulatePoitem.prepare( "SELECT poitem_id," " ( poitem_linenumber || '-' ||" " COALESCE(item_number, poitem_vend_item_number) || ' (' ||" " COALESCE(item_descrip1, firstLine(poitem_vend_item_descrip)) || ')' ) " "FROM poitem LEFT OUTER JOIN " " ( itemsite JOIN item " " ON (itemsite_item_id=item_id)" " ) ON (poitem_itemsite_id=itemsite_id) " "WHERE ( (poitem_status <> 'C')" " AND (poitem_pohead_id=:pohead_id) ) " "ORDER BY poitem_linenumber;" ); reschedulePopulatePoitem.bindValue(":pohead_id", pPoheadid); reschedulePopulatePoitem.exec(); _poitem->populate(reschedulePopulatePoitem); } void reschedulePoitem::sPopulate(int pPoitemid) { XSqlQuery reschedulePopulate; if (pPoitemid == -1) { _current->clear(); _new->clear(); } else { reschedulePopulate.prepare( "SELECT poitem_duedate " "FROM poitem " "WHERE (poitem_id=:poitem_id);" ); reschedulePopulate.bindValue(":poitem_id", pPoitemid); reschedulePopulate.exec(); if (reschedulePopulate.first()) { _current->setDate(reschedulePopulate.value("poitem_duedate").toDate()); } } } void reschedulePoitem::sReschedule() { XSqlQuery rescheduleReschedule; if (!_new->isValid()) { QMessageBox::critical( this, tr("Invalid Reschedule Date"), tr("

    You must enter a reschedule due date before " "you may save this Purchase Order Item.") ); _new->setFocus(); return; } rescheduleReschedule.prepare("SELECT changePoitemDueDate(:poitem_id, :dueDate);"); rescheduleReschedule.bindValue(":poitem_id", _poitem->id()); rescheduleReschedule.bindValue(":dueDate", _new->date()); rescheduleReschedule.exec(); omfgThis->sPurchaseOrdersUpdated(_po->id(), true); accept(); } qt-client-4.1.0/guiclient/reschedulePoitem.h000066400000000000000000000021701217451700100210470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RESCHEDULEPOITEM_H #define RESCHEDULEPOITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_reschedulePoitem.h" class reschedulePoitem : public XDialog, public Ui::reschedulePoitem { Q_OBJECT public: reschedulePoitem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reschedulePoitem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulatePoitem(int pPoheadid); virtual void sPopulate(int pPoheadid); virtual void sReschedule(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // RESCHEDULEPOITEM_H qt-client-4.1.0/guiclient/reschedulePoitem.ui000066400000000000000000000134151217451700100212410ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reschedulePoitem 0 0 350 197 Reschedule Purchase Order Item OrderLineEdit::Open OrderLineEdit::Purchase &Cancel false &Reschedule Qt::Vertical QSizePolicy::Preferred 20 16 Line Item: false 0 0 Current Qt::AlignCenter Rescheduled Qt::AlignCenter Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Vertical QSizePolicy::Expanding 20 0 DLineEdit QWidget

    datecluster.h
    OrderCluster QWidget
    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    _new _reschedule _close parameter.h _close clicked() reschedulePoitem reject() 20 20 20 20 _po valid(bool) _poitem setEnabled(bool) 20 20 20 20 _poitem valid(bool) _reschedule setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/rescheduleWo.cpp000066400000000000000000000057471217451700100205470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "rescheduleWo.h" #include #include rescheduleWo::rescheduleWo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_reschedule, SIGNAL(clicked()), this, SLOT(sReschedule())); _captive = FALSE; _wo->setType(cWoOpen | cWoExploded); _cmnttype->setType(XComboBox::AllCommentTypes); if (_preferences->boolean("XCheckBox/forgetful")) _changeChildren->setChecked(true); _commentGroup->setEnabled(_postComment->isChecked()); } rescheduleWo::~rescheduleWo() { // no need to delete child widgets, Qt does it all for us } void rescheduleWo::languageChange() { retranslateUi(this); } enum SetResponse rescheduleWo::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } return NoError; } void rescheduleWo::sReschedule() { XSqlQuery rescheduleReschedule; if ((_newStartDate->isValid()) && (_newDueDate->isValid())) { if (_wo->status() == 'R') { QMessageBox::warning( this, tr("Cannot Reschedule Released W/O"), tr( "The selected Work Order has been Released.\n" "You must Recall this Work Order before Rescheduling it." ) ); return; } rescheduleReschedule.prepare("SELECT changeWoDates(:wo_id, :startDate, :dueDate, :rescheduleChildren);"); rescheduleReschedule.bindValue(":wo_id", _wo->id()); rescheduleReschedule.bindValue(":startDate", _newStartDate->date()); rescheduleReschedule.bindValue(":dueDate", _newDueDate->date()); rescheduleReschedule.bindValue(":rescheduleChildren", QVariant(_changeChildren->isChecked())); rescheduleReschedule.exec(); if (_postComment->isChecked()) { rescheduleReschedule.prepare("SELECT postComment(:cmnttype_id, 'W', :wo_id, :comment) AS _result"); rescheduleReschedule.bindValue(":cmnttype_id", _cmnttype->id()); rescheduleReschedule.bindValue(":wo_id", _wo->id()); rescheduleReschedule.bindValue(":comment", _comment->toPlainText()); rescheduleReschedule.exec(); } omfgThis->sWorkOrdersUpdated(_wo->id(), TRUE); if (_captive) close(); else { _wo->setId(-1); _close->setText(tr("&Close")); _wo->setFocus(); } } else { QMessageBox::warning( this, tr("Valid Dates Required"), tr("You must specify a valid Start/Due date.") ); } } qt-client-4.1.0/guiclient/rescheduleWo.h000066400000000000000000000017671217451700100202120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RESCHEDULEWO_H #define RESCHEDULEWO_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_rescheduleWo.h" class rescheduleWo : public XDialog, public Ui::rescheduleWo { Q_OBJECT public: rescheduleWo(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~rescheduleWo(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sReschedule(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // RESCHEDULEWO_H qt-client-4.1.0/guiclient/rescheduleWo.ui000066400000000000000000000276451217451700100204030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. rescheduleWo 0 0 508 454 Reschedule Work Order 2 Qt::Horizontal QSizePolicy::Expanding 20 20 5 &Cancel false &Reschedule Qt::Vertical QSizePolicy::Preferred 20 20 false 100 0 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Current Qt::AlignCenter Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Rescheduled Qt::AlignCenter false 100 0 Qt::Horizontal QSizePolicy::Expanding 204 71 0 Reschedule Child Work Orders (if any) Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Post Comment Qt::Horizontal QSizePolicy::Expanding 46 10 false 0 0 0 5 5 5 5 0 5 Comment Type: Qt::Horizontal QSizePolicy::Expanding 51 10 DLineEdit QWidget
    datecluster.h
    WoCluster QWidget
    wocluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTextEdit QTextEdit
    xtextedit.h
    _wo _newStartDate _newDueDate _changeChildren _postComment _cmnttype _comment _reschedule _close _wo valid(bool) _reschedule setEnabled(bool) 20 20 20 20 _wo startDateChanged(QDate) _currentStartDate setDate(QDate) 20 20 20 20 _wo dueDateChanged(QDate) _currentDueDate setDate(QDate) 20 20 20 20 _close clicked() rescheduleWo accept() 20 20 20 20 _postComment toggled(bool) _commentGroup setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/reserveSalesOrderItem.cpp000066400000000000000000000121461217451700100223630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reserveSalesOrderItem.h" #include #include #include #include #include #include "xmessagebox.h" #include "storedProcErrorLookup.h" reserveSalesOrderItem::reserveSalesOrderItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_issue, SIGNAL(clicked()), this, SLOT(sIssue())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _item->setReadOnly(TRUE); _qtyToIssue->setValidator(omfgThis->qtyVal()); _qtyOrdered->setPrecision(omfgThis->qtyVal()); _qtyShipped->setPrecision(omfgThis->qtyVal()); _balance->setPrecision(omfgThis->qtyVal()); _reserved->setPrecision(omfgThis->qtyVal()); _onHand->setPrecision(omfgThis->qtyVal()); _allocated->setPrecision(omfgThis->qtyVal()); _unreserved->setPrecision(omfgThis->qtyVal()); } reserveSalesOrderItem::~reserveSalesOrderItem() { // no need to delete child widgets, Qt does it all for us } void reserveSalesOrderItem::languageChange() { retranslateUi(this); } enum SetResponse reserveSalesOrderItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("soitem_id", &valid); if (valid) { _itemid = param.toInt(); //_orderNumberLit->setText(tr("Sales Order #:")); populate(); } param = pParams.value("qty", &valid); if (valid) _qtyToIssue->setDouble(param.toDouble()); return NoError; } void reserveSalesOrderItem::sIssue() { if (_qtyToIssue->toDouble() <= 0) { QMessageBox::warning( this, tr("Invalid Quantity to Issue to Shipping"), tr( "

    Please enter a non-negative, non-zero value to indicate the amount " "of Stock you wish to Reserve for this Order Line." )); _qtyToIssue->setFocus(); return; } XSqlQuery issue; issue.prepare("SELECT reserveSoLineQty(:lineitem_id, :qty) AS result;"); issue.bindValue(":lineitem_id", _itemid); issue.bindValue(":qty", _qtyToIssue->toDouble()); issue.exec(); if (issue.first()) { int result = issue.value("result").toInt(); if (result < 0) { systemError( this, storedProcErrorLookup("reserveSoLineQty", result), __FILE__, __LINE__); return; } } else if (issue.lastError().type() != QSqlError::NoError) { systemError(this, issue.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void reserveSalesOrderItem::populate() { ParameterList itemp; itemp.append("soitem_id", _itemid); QString sql = "SELECT cohead_number AS order_number," " coitem_linenumber," " itemsite_item_id AS item_id," " warehous_code," " uom_name," " itemsite_qtyonhand," " qtyReserved(itemsite_id) AS totreserved," " qtyUnreserved(itemsite_id) AS totunreserved," " coitem_qtyord," " coitem_qtyshipped," " formatQty(coitem_qtyreturned) AS qtyreturned," " coitem_qtyreserved," " noNeg(coitem_qtyord - coitem_qtyshipped +" " coitem_qtyreturned - coitem_qtyreserved) AS balance " "FROM cohead, coitem, itemsite, item, whsinfo, uom " "WHERE ((coitem_cohead_id=cohead_id)" " AND (coitem_itemsite_id=itemsite_id)" " AND (coitem_status <> 'X')" " AND (coitem_qty_uom_id=uom_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (coitem_id=) );"; MetaSQLQuery itemm(sql); XSqlQuery itemq = itemm.toQuery(itemp); if (itemq.first()) { _salesOrderNumber->setText(itemq.value("order_number").toString()); _salesOrderLine->setText(itemq.value("coitem_linenumber").toString()); _item->setId(itemq.value("item_id").toInt()); _warehouse->setText(itemq.value("warehous_code").toString()); _qtyUOM->setText(itemq.value("uom_name").toString()); _qtyOrdered->setDouble(itemq.value("coitem_qtyord").toDouble()); _qtyShipped->setDouble(itemq.value("coitem_qtyshipped").toDouble()); _balance->setDouble(itemq.value("balance").toDouble()); _reserved->setDouble(itemq.value("coitem_qtyreserved").toDouble()); _onHand->setDouble(itemq.value("itemsite_qtyonhand").toDouble()); _allocated->setDouble(itemq.value("totreserved").toDouble()); _unreserved->setDouble(itemq.value("totunreserved").toDouble()); } else if (itemq.lastError().type() != QSqlError::NoError) { systemError(this, itemq.lastError().databaseText(), __FILE__, __LINE__); return; } _qtyToIssue->setDouble(itemq.value("balance").toDouble()); } qt-client-4.1.0/guiclient/reserveSalesOrderItem.h000066400000000000000000000021331217451700100220230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RESERVESALESORDERITEM_H #define RESERVESALESORDERITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_reserveSalesOrderItem.h" class reserveSalesOrderItem : public XDialog, public Ui::reserveSalesOrderItem { Q_OBJECT public: reserveSalesOrderItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reserveSalesOrderItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sIssue(); protected slots: virtual void languageChange(); virtual void populate(); private: int _itemid; }; #endif // RESERVESALESORDERITEM_H qt-client-4.1.0/guiclient/reserveSalesOrderItem.ui000066400000000000000000000447131217451700100222230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reserveSalesOrderItem 0 0 557 452 Reserve Stock to Order 12 12 Sales Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::StrongFocus Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 40 20 _item _warehouseLit _warehouse _warehouseLit Order Item Balance Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. at Shipping Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Unreserved Qty: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Reserved: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 true Availability On Hand: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Reserved: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unreserved: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 To Reserve Qty: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 20 Qt::AlignRight UOM: 1 0 0 0 Qt::Horizontal QSizePolicy::Expanding 0 20 0 0 &Cancel &Reserve true Qt::Vertical QSizePolicy::Expanding 20 0 ItemCluster QWidget

    itemcluster.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    _item _qtyToIssue _issue _close _close clicked() reserveSalesOrderItem reject() 20 20 20 20 qt-client-4.1.0/guiclient/resetQOHBalances.cpp000066400000000000000000000057361217451700100212370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "resetQOHBalances.h" #include #include #include "storedProcErrorLookup.h" resetQOHBalances::resetQOHBalances(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_reset, SIGNAL(clicked()), this, SLOT(sReset())); _classCode->setType(ParameterGroup::ClassCode); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); _username->setText(omfgThis->username()); } resetQOHBalances::~resetQOHBalances() { // no need to delete child widgets, Qt does it all for us } void resetQOHBalances::languageChange() { retranslateUi(this); } void resetQOHBalances::sReset() { XSqlQuery resetReset; if (QMessageBox::question(this, tr("Reset Selected QOH Balances?"), tr( "

    You are about to issue Adjustment " "Transactions for all Item Sites within " "the selected Site and Class Code(s) " "that are not Lot/Serial or Location " "Controlled to adjust their QOH values to " "0.
    Are you sure that you want to do this?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; QString sql( "SELECT resetQOHBalance(itemsite_id, :date) AS result " "FROM itemsite, item " "WHERE ((itemsite_qtyonhand < 0)" " AND (itemsite_item_id=item_id)" ); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += ");"; resetReset.prepare(sql); _warehouse->bindValue(resetReset); _classCode->bindValue(resetReset); resetReset.bindValue(":date", _transDate->date()); resetReset.exec(); if (resetReset.first()) { int result = resetReset.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("resetQOHBalance", result), __FILE__, __LINE__); return; } } else if (resetReset.lastError().type() != QSqlError::NoError) { systemError(this, resetReset.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/resetQOHBalances.h000066400000000000000000000016401217451700100206720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RESETQOHBALANCES_H #define RESETQOHBALANCES_H #include "guiclient.h" #include "xdialog.h" #include "ui_resetQOHBalances.h" class resetQOHBalances : public XDialog, public Ui::resetQOHBalances { Q_OBJECT public: resetQOHBalances(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~resetQOHBalances(); public slots: virtual void sReset(); protected slots: virtual void languageChange(); }; #endif // RESETQOHBALANCES_H qt-client-4.1.0/guiclient/resetQOHBalances.ui000066400000000000000000000137631217451700100210710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. resetQOHBalances 0 0 418 310 Reset Quantity-On-Hand Balances 12 12 5 7 0 false 0 0 &Cancel &Reset true Qt::Vertical QSizePolicy::Expanding 61 20 false Transaction Date: _transDate Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _username Qt::Vertical QSizePolicy::Expanding 20 0 DLineEdit QWidget

    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _reset _close _close clicked() resetQOHBalances reject() 20 20 20 20 qt-client-4.1.0/guiclient/returnAuthCheck.cpp000066400000000000000000000157671217451700100212200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "returnAuthCheck.h" #include "storedProcErrorLookup.h" #include #include #include returnAuthCheck::returnAuthCheck(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sPopulateBankInfo(int))); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _date->setDate(omfgThis->dbDate(), true); _bankaccnt->setAllowNull(TRUE); _bankaccnt->setType(XComboBox::APBankAccounts); _cmheadcurrid = CurrDisplay::baseId(); } returnAuthCheck::~returnAuthCheck() { // no need to delete child widgets, Qt does it all for us } void returnAuthCheck::languageChange() { retranslateUi(this); } enum SetResponse returnAuthCheck::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("amount", &valid); if (valid) _amount->setLocalValue(param.toDouble()); param = pParams.value("cmhead_id", &valid); if (valid) _cmheadid=param.toInt(); populate(); return NoError; } void returnAuthCheck::sSave() { XSqlQuery returnSave; if (!_date->isValid()) { QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"), tr("

    You must enter a date for this check.") ); _date->setFocus(); return; } else if (_amount->isZero()) { QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"), tr("

    You must enter an amount for this check.") ); return; } else if (!_bankaccnt->isValid()) { QMessageBox::warning( this, tr("Cannot Create Miscellaneous Check"), tr("

    You must select a bank account for this check.") ); _date->setFocus(); return; } else { returnSave.prepare("SELECT createCheck(:bankaccnt_id, 'C', :recipid," " :checkDate, :amount, :curr_id, NULL," " NULL, :for, :notes, TRUE, :aropen_id) AS result; "); returnSave.bindValue(":bankaccnt_id", _bankaccnt->id()); returnSave.bindValue(":recipid", _custid); returnSave.bindValue(":checkDate", _date->date()); returnSave.bindValue(":amount", _amount->localValue()); returnSave.bindValue(":curr_id", _amount->id()); returnSave.bindValue(":for", _for->text().trimmed()); returnSave.bindValue(":notes", _notes->toPlainText().trimmed()); returnSave.bindValue(":aropen_id", _aropenid); returnSave.exec(); if (returnSave.first()) { _checkid = returnSave.value("result").toInt(); if (_checkid < 0) { systemError(this, storedProcErrorLookup("createCheck", _checkid), __FILE__, __LINE__); return; } returnSave.prepare( "SELECT checkhead_number " "FROM checkhead " "WHERE (checkhead_id=:check_id);" ); returnSave.bindValue(":check_id", _checkid); returnSave.exec(); if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(TRUE); } else if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } void returnAuthCheck::sClose() { done(-1); } void returnAuthCheck::sPopulateBankInfo(int pBankaccntid) { XSqlQuery returnPopulateBankInfo; if ( pBankaccntid == -1 ) { _amount->setId(_cmheadcurrid); _checkNum->clear(); } else { XSqlQuery checkNumber; checkNumber.prepare( "SELECT bankaccnt_nextchknum, bankaccnt_curr_id " "FROM bankaccnt " "WHERE (bankaccnt_id=:bankaccnt_id);" ); checkNumber.bindValue(":bankaccnt_id", pBankaccntid); checkNumber.exec(); if (checkNumber.first()) { if (checkNumber.value("bankaccnt_curr_id").toInt() != _cmheadcurrid) { QMessageBox::critical(this, tr("Bank Uses Different Currency"), tr("

    The currency of the bank account is not " "the same as the currency of the credit " "memo. You may not use this bank account.")); _amount->setId(_cmheadcurrid); _bankaccnt->setId(-1); return; } _checkNum->setText(checkNumber.value("bankaccnt_nextchknum").toString()); _amount->setId(checkNumber.value("bankaccnt_curr_id").toInt()); } else if (returnPopulateBankInfo.lastError().type() != QSqlError::NoError) { systemError(this, checkNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } } void returnAuthCheck::populate() { XSqlQuery returnpopulate; returnpopulate.prepare("SELECT cust_id,cust_name,cmhead_number,cmhead_curr_id, " "'Return Authorization ' || rahead_number::text AS memo, " "'Applied Against Credit Memo ' || cmhead_number::text AS note, " "aropen_id,aropen_amount " "FROM rahead,cmhead,custinfo,aropen " "WHERE ((cmhead_cust_id=cust_id) " "AND (rahead_id=cmhead_rahead_id) " "AND (cmhead_id=:cmhead_id) " "AND (aropen_doctype='C') " "AND (aropen_docnumber=cmhead_number));"); returnpopulate.bindValue(":cmhead_id",_cmheadid); returnpopulate.exec(); if (returnpopulate.first()) { _custid=returnpopulate.value("cust_id").toInt(); _aropenid=returnpopulate.value("aropen_id").toInt(); _custName->setText(returnpopulate.value("cust_name").toString()); _creditmemo->setText(returnpopulate.value("cmhead_number").toString()); _cmheadcurrid = returnpopulate.value("cmhead_curr_id").toInt(); _amount->setId(returnpopulate.value("cmhead_curr_id").toInt()); _amount->setLocalValue(returnpopulate.value("aropen_amount").toDouble()); _for->setText(returnpopulate.value("memo").toString()); _notes->setText(returnpopulate.value("note").toString()); } else if (returnpopulate.lastError().type() != QSqlError::NoError) { systemError(this, returnpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } returnpopulate.prepare("SELECT bankaccnt_id " "FROM bankaccnt " "WHERE (bankaccnt_ap" " AND (bankaccnt_type='K')" " AND (bankaccnt_curr_id=:cmcurrid));"); returnpopulate.bindValue(":cmcurrid", _cmheadcurrid); returnpopulate.exec(); if (returnpopulate.first()) _bankaccnt->setId(returnpopulate.value("bankaccnt_id").toInt()); else if (returnpopulate.lastError().type() != QSqlError::NoError) { systemError(this, returnpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } else _bankaccnt->setId(-1); } qt-client-4.1.0/guiclient/returnAuthCheck.h000066400000000000000000000023221217451700100206440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RETURNAUTHCHECK_H #define RETURNAUTHCHECK_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_returnAuthCheck.h" class returnAuthCheck : public XDialog, public Ui::returnAuthCheck { Q_OBJECT public: returnAuthCheck(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~returnAuthCheck(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sClose(); virtual void sPopulateBankInfo(int pBankaccntid); virtual void populate(); protected slots: virtual void languageChange(); private: int _bankaccntid; int _checkid; int _custid; int _aropenid; int _cmheadid; int _cmheadcurrid; }; #endif // RETURNAUTHCHECK_H qt-client-4.1.0/guiclient/returnAuthCheck.ui000066400000000000000000000227771217451700100210520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. returnAuthCheck 0 0 400 300 Return Authorization Check Customer: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 5 0 0 0 0 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 10 21 Credit Memo: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 1 0 Qt::Vertical 20 40 Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 261 20 Bank Account: 0 0 0 27 Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 150 0 Qt::NoFocus false false Qt::Horizontal 191 20 Check Number: Memo: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::NoFocus Qt::Horizontal 40 20 0 0 Notes: 0 1 Qt::ClickFocus CurrCluster CurrDisplay

    currcluster.h
    DLineEdit QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    XTextEdit QTextEdit
    xtextedit.h
    _date _bankaccnt _save _close _notes qt-client-4.1.0/guiclient/returnAuthItemLotSerial.cpp000066400000000000000000000215011217451700100226770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "returnAuthItemLotSerial.h" #include #include #include /* * Constructs a returnAuthItemLotSerial as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ returnAuthItemLotSerial::returnAuthItemLotSerial(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _crmacctid = -1; _raitemid = -1; _raitemlsid = -1; _warehouseid = -1; // signals and slots connections connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_lotSerial, SIGNAL(newId(int)), this, SLOT(sCheck())); connect(_cancel, SIGNAL(clicked()), this, SLOT(close())); _qtyAuth->setValidator(omfgThis->qtyVal()); _qtyRegistered->setPrecision(omfgThis->qtyVal()); _qtyReceived->setPrecision(omfgThis->qtyVal()); adjustSize(); } /* * Destroys the object and frees any allocated resources */ returnAuthItemLotSerial::~returnAuthItemLotSerial() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void returnAuthItemLotSerial::languageChange() { retranslateUi(this); } enum SetResponse returnAuthItemLotSerial::set(const ParameterList &pParams) { XSqlQuery returnet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _lotSerial->setItemId(param.toInt()); if (_warehouseid != -1) populateItemsite(); } param = pParams.value("raitem_id", &valid); if (valid) { _raitemid = param.toInt(); returnet.prepare("SELECT crmacct_id " "FROM raitem,rahead,crmacct " "WHERE ((raitem_id=:raitem_id) " "AND (raitem_rahead_id=rahead_id) " "AND (crmacct_cust_id=rahead_cust_id)); "); returnet.bindValue(":raitem_id", _raitemid); returnet.exec(); if (returnet.first()) _crmacctid = returnet.value("crmacct_id").toInt(); else if (returnet.lastError().type() != QSqlError::NoError) { systemError(this, returnet.lastError().databaseText(), __FILE__, __LINE__); done(-1); } } param = pParams.value("warehouse_id", &valid); if (valid) { _warehouseid = param.toInt(); if (_item->id() != -1) populateItemsite(); } param = pParams.value("uom", &valid); if (valid) _qtyUOM->setText(param.toString()); param = pParams.value("ls_id", &valid); if (valid) _lotSerial->setId(param.toInt()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _lotSerial->setEnabled(FALSE); _qtyAuth->setEnabled(FALSE); _cancel->setText(tr("&Close")); _save->hide(); } } return NoError; } void returnAuthItemLotSerial::sSave() { XSqlQuery returnSave; if (_lotSerial->id() == -1) { QMessageBox::information( this, tr("No Lot/Serial Number Selected"), tr("You must select a Lot/Serial Number.") ); _lotSerial->setFocus(); return; } if (_mode == cNew) { XSqlQuery number; number.exec("SELECT NEXTVAL('raitemls_raitemls_id_seq') AS raitemls_id;"); if (number.first()) { _raitemlsid = number.value("raitemls_id").toInt(); returnSave.prepare( "INSERT INTO raitemls " "( raitemls_id,raitemls_raitem_id,raitemls_ls_id,raitemls_qtyauthorized,raitemls_qtyreceived ) " "VALUES " "( :raitemls_id,:raitem_id,:ls_id,:qty,0 );" ); } } else if (_mode == cEdit) returnSave.prepare( "UPDATE raitemls " "SET raitemls_ls_id=:ls_id,raitemls_qtyauthorized=:qty " "WHERE (raitemls_id=:raitemls_id);" ); returnSave.bindValue(":raitemls_id", _raitemlsid); returnSave.bindValue(":raitem_id", _raitemid); returnSave.bindValue(":ls_id", _lotSerial->id()); returnSave.bindValue(":qty", _qtyAuth->toDouble()); returnSave.exec(); if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); done(-1); } else done(_raitemlsid); } void returnAuthItemLotSerial::sCheck() { XSqlQuery returnCheck; returnCheck.prepare( "SELECT raitemls_id " "FROM raitemls " "WHERE ((raitemls_raitem_id=:raitem_id)" " AND (raitemls_ls_id=:ls_id));" ); returnCheck.bindValue(":raitem_id", _raitemid); returnCheck.bindValue(":ls_id", _lotSerial->id()); returnCheck.exec(); if (returnCheck.first()) { _raitemlsid = returnCheck.value("raitemls_id").toInt(); _mode = cEdit; populate(); } else { _raitemlsid = -1; _mode = cNew; _qtyAuth->setDouble(0); populateLotSerial(); } } void returnAuthItemLotSerial::populate() { XSqlQuery returnpopulate; returnpopulate.prepare( "SELECT itemsite_item_id, uom_name,raitemls_ls_id, raitemls_qtyauthorized," "raitemls_qtyreceived," "COALESCE(SUM(lsreg_qty / raitem_qty_invuomratio),0) AS qtyregistered, " "itemsite_warehous_id " "FROM raitemls " " LEFT OUTER JOIN lsreg ON (lsreg_crmacct_id=:crmacct_id) " " AND (lsreg_ls_id=raitemls_ls_id), " "raitem, uom, itemsite " "WHERE ((raitemls_id=:raitemls_id) " "AND (raitemls_raitem_id=raitem_id) " "AND (uom_id=raitem_qty_uom_id) " "AND (itemsite_id=raitem_itemsite_id)) " "GROUP BY itemsite_item_id,uom_name,raitemls_ls_id,raitemls_qtyauthorized,raitemls_qtyreceived, " "itemsite_warehous_id" ); returnpopulate.bindValue(":raitemls_id", _raitemlsid); returnpopulate.bindValue(":crmacct_id", _crmacctid); returnpopulate.exec(); if (returnpopulate.first()) { _item->setId(returnpopulate.value("itemsite_item_id").toInt()); _lotSerial->setId(returnpopulate.value("raitemls_ls_id").toInt()); _qtyAuth->setDouble(returnpopulate.value("raitemls_qtyauthorized").toDouble()); _qtyUOM->setText(returnpopulate.value("uom_name").toString()); _qtyReceived->setDouble(returnpopulate.value("raitemls_qtyreceived").toDouble()); _qtyRegistered->setDouble(returnpopulate.value("qtyregistered").toDouble()); _warehouseid = returnpopulate.value("itemsite_warehous_id").toInt(); populateItemsite(); } else if (returnpopulate.lastError().type() != QSqlError::NoError) { systemError(this, returnpopulate.lastError().databaseText(), __FILE__, __LINE__); done(-1); } } void returnAuthItemLotSerial::populateItemsite() { XSqlQuery returnpopulateItemsite; returnpopulateItemsite.prepare("SELECT itemsite_controlmethod " "FROM itemsite " "WHERE (itemsite_item_id=:item_id) " "AND (itemsite_warehous_id=:warehous_id)); "); returnpopulateItemsite.bindValue(":item_id", _item->id()); returnpopulateItemsite.bindValue(":warehous_id", _warehouseid); if (returnpopulateItemsite.first()) { if (returnpopulateItemsite.value("itemsite_controlmethod").toString() == "S") { _qtyAuth->setEnabled(false); _qtyAuth->setDouble(1); } } else if (returnpopulateItemsite.lastError().type() != QSqlError::NoError) { systemError(this, returnpopulateItemsite.lastError().databaseText(), __FILE__, __LINE__); done(-1); } } void returnAuthItemLotSerial::populateLotSerial() { XSqlQuery returnpopulateLotSerial; returnpopulateLotSerial.prepare( "SELECT COALESCE(SUM(lsreg_qty / raitem_qty_invuomratio),0) AS qtyregistered " "FROM lsreg, raitem " "WHERE ((lsreg_ls_id=:ls_id) " "AND (lsreg_crmacct_id=:crmacct_id) " "AND (raitem_id=:raitem_id));" ); returnpopulateLotSerial.bindValue(":ls_id", _lotSerial->id()); returnpopulateLotSerial.bindValue(":crmacct_id", _crmacctid); returnpopulateLotSerial.bindValue(":raitem_id", _raitemid); returnpopulateLotSerial.exec(); if (returnpopulateLotSerial.first()) { _qtyRegistered->setDouble(returnpopulateLotSerial.value("qtyregistered").toDouble()); _qtyReceived->setDouble(0); } else if (returnpopulateLotSerial.lastError().type() != QSqlError::NoError) { systemError(this, returnpopulateLotSerial.lastError().databaseText(), __FILE__, __LINE__); done(-1); } } void returnAuthItemLotSerial::closeEvent() { done(0); } qt-client-4.1.0/guiclient/returnAuthItemLotSerial.h000066400000000000000000000023771217451700100223560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RETURNAUTHITEMLOTSERIAL_H #define RETURNAUTHITEMLOTSERIAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_returnAuthItemLotSerial.h" class returnAuthItemLotSerial : public XDialog, public Ui::returnAuthItemLotSerial { Q_OBJECT public: returnAuthItemLotSerial(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~returnAuthItemLotSerial(); public slots: enum SetResponse set(const ParameterList & pParams ); void sSave(); void sCheck(); void populate(); void populateItemsite(); void populateLotSerial(); protected slots: void languageChange(); void closeEvent(); private: int _crmacctid; int _mode; int _raitemid; int _raitemlsid; int _warehouseid; }; #endif // RETURNAUTHITEMLOTSERIAL_H qt-client-4.1.0/guiclient/returnAuthItemLotSerial.ui000066400000000000000000000161411217451700100225360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. returnAuthItemLotSerial 0 0 473 338 Return Authorization Item Lot/Serial true false Qt::StrongFocus Lot/Serial #: false &Cancel &Save Qt::Vertical 20 71 Qty. &Auth.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyAuth 0 0 32767 20 Qt::AlignRight Qty. Registered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qty. UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter ItemCluster QWidget
    itemcluster.h
    1
    LotserialCluster QWidget
    lotserialcluster.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _lotSerial _qtyAuth _save _cancel _item newId(int) _lotSerial setItemId(int) 125 40 137 100
    qt-client-4.1.0/guiclient/returnAuthorization.cpp000066400000000000000000002342351217451700100222120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "returnAuthorization.h" #include #include #include #include #include #include "creditcardprocessor.h" #include "enterPoitemReceipt.h" #include "enterPoReceipt.h" #include "errorReporter.h" #include "mqlutil.h" #include "returnAuthorizationItem.h" #include "storedProcErrorLookup.h" #include "taxBreakdown.h" #include "freightBreakdown.h" #include "printRaForm.h" #include "salesOrder.h" #include "salesOrderItem.h" #include "dspShipmentsBySalesOrder.h" #include "dspSalesOrderStatus.h" returnAuthorization::returnAuthorization(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); _origso->setAllowedTypes(OrderLineEdit::Sales); _newso->setAllowedTypes(OrderLineEdit::Sales); _shipTo->setNameVisible(false); _shipTo->setDescriptionVisible(false); connect(_copyToShipto, SIGNAL(clicked()), this, SLOT(sCopyToShipto())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_shipTo, SIGNAL(newId(int)), this, SLOT(populateShipto(int))); connect(_save, SIGNAL(clicked()), this, SLOT(sSaveClick())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_freightLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sFreightDetail())); connect(_subtotal, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_tax, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_miscCharge, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); connect(_taxzone, SIGNAL(newID(int)), this, SLOT(sTaxZoneChanged())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sRecvWhsChanged())); connect(_shipWhs, SIGNAL(newID(int)), this, SLOT(sShipWhsChanged())); connect(_origso, SIGNAL(newId(int,QString)), this, SLOT(sOrigSoChanged())); connect(_shipToAddr, SIGNAL(changed()), this, SLOT(sClearShiptoNumber())); connect(_shipToName, SIGNAL(textChanged(QString)), this, SLOT(sClearShiptoNumber())); connect(_disposition, SIGNAL(currentIndexChanged(int)), this, SLOT(sDispositionChanged())); connect(_creditBy, SIGNAL(currentIndexChanged(int)), this, SLOT(sCreditByChanged())); connect(_authorizeLine, SIGNAL(clicked()), this, SLOT(sAuthorizeLine())); connect(_clearAuthorization, SIGNAL(clicked()), this, SLOT(sClearAuthorization())); connect(_authorizeAll, SIGNAL(clicked()), this, SLOT(sAuthorizeAll())); connect(_enterReceipt, SIGNAL(clicked()), this, SLOT(sEnterReceipt())); connect(_receiveAll, SIGNAL(clicked()), this, SLOT(sReceiveAll())); connect(_raitem, SIGNAL(valid(bool)), this, SLOT(sHandleEnterReceipt(bool))); connect(_raitem, SIGNAL(valid(bool)), this, SLOT(sHandleAction())); connect(_action, SIGNAL(clicked()), this, SLOT(sAction())); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sHandleSalesOrderEvent(int, bool))); connect(_refund, SIGNAL(clicked()), this, SLOT(sRefund())); connect(_postReceipts, SIGNAL(clicked()), this, SLOT(sPostReceipts())); connect(_raitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_authNumber, SIGNAL(textEdited(QString)), this, SLOT(sCheckNumber())); connect(_cust, SIGNAL(newCrmacctId(int)), _billToAddr, SLOT(setSearchAcct(int))); connect(_cust, SIGNAL(newCrmacctId(int)), _shipToAddr, SLOT(setSearchAcct(int))); connect(_cust, SIGNAL(newId(int)), _shipTo, SLOT(setCustid(int))); _commission->setValidator(omfgThis->percentVal()); _newso->setReadOnly(true); _custtaxzoneid = -1; _ignoreShiptoSignals = false; _ignoreSoSignals = false; _ignoreWhsSignals = false; _ffBillto = TRUE; _ffShipto = TRUE; _custEmail = FALSE; _saved = FALSE; _calcfreight = false; _freightCache = 0; _authNumber->setValidator(omfgThis->orderVal()); _comments->setType(Comments::ReturnAuth); _currency->setLabel(_currencyLit); _raitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter,true, "f_linenumber"); _raitem->addColumn(tr("Kit Seq. #"), _seqColumn, Qt::AlignRight, false, "raitem_subnumber"); _raitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _raitem->addColumn(tr("UOM"), _statusColumn,Qt::AlignLeft, true, "uom_name" ); _raitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip" ); _raitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _raitem->addColumn(tr("Status"), _statusColumn,Qt::AlignCenter, true, "raitem_status" ); _raitem->addColumn(tr("Disposition"), _itemColumn, Qt::AlignLeft, true, "disposition" ); _raitem->addColumn(tr("Warranty"), _qtyColumn,Qt::AlignCenter, true, "raitem_warranty"); _raitem->addColumn(tr("Sold"), _qtyColumn, Qt::AlignRight, true, "oldcoitem_qtyshipped" ); _raitem->addColumn(tr("Authorized"), _qtyColumn, Qt::AlignRight, true, "raitem_qtyauthorized" ); _raitem->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "raitem_qtyreceived" ); _raitem->addColumn(tr("To Receive"), _qtyColumn, Qt::AlignRight, true, "raitem_qtytoreceive" ); _raitem->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "newcoitem_qtyshipped" ); _raitem->addColumn(tr("Credit Price"), _priceColumn, Qt::AlignRight, true, "raitem_unitprice" ); _raitem->addColumn(tr("Extended"), _moneyColumn, Qt::AlignRight, true, "raitem_extprice" ); _raitem->addColumn(tr("Credited"), _moneyColumn, Qt::AlignRight, true, "raitem_amtcredited" ); _raitem->addColumn(tr("Sale Price"), _priceColumn, Qt::AlignRight, true, "raitem_saleprice" ); _raitem->addColumn(tr("Extended"), _moneyColumn, Qt::AlignRight, true, "raitem_extsaleprice" ); _raitem->addColumn(tr("Net Due"), _moneyColumn, Qt::AlignRight, true, "raitem_netdue" ); _raitem->addColumn(tr("Orig. Order"), _itemColumn, Qt::AlignLeft, true, "oldcohead_number" ); _raitem->addColumn(tr("New Order"), _itemColumn, Qt::AlignLeft, true, "newcohead_number" ); _raitem->addColumn(tr("Sched. Date"), _dateColumn, Qt::AlignLeft, true, "raitem_scheddate" ); _raitem->addColumn(tr("Item Type"), _statusColumn,Qt::AlignLeft, false, "item_type" ); _raitem->setSelectionMode(QAbstractItemView::ExtendedSelection); _authorizeLine->hide(); _clearAuthorization->hide(); _authorizeAll->hide(); if (! _metrics->boolean("CCAccept") || !_privileges->check("ProcessCreditCards")) { _refund->hide(); _CCCVVLit->hide(); _CCCVV->hide(); } if (! _metrics->boolean("CCAccept")) _creditBy->removeItem(3); _printRA->setChecked(_metrics->boolean("DefaultPrintRAOnSave")); _receiveAll->setEnabled(_privileges->check("EnterReceipts")); _postReceipts->setEnabled(_privileges->check("EnterReceipts")); //If not multi-warehouse hide whs controls if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); _shipWhs->hide(); _shipWhsLit->hide(); } _miscChargeAccount->setType(GLCluster::cRevenue | GLCluster::cExpense); _incident->setDescriptionVisible(true); } returnAuthorization::~returnAuthorization() { // no need to delete child widgets, Qt does it all for us } void returnAuthorization::languageChange() { retranslateUi(this); } enum SetResponse returnAuthorization::set(const ParameterList &pParams) { XSqlQuery returnet; XWidget::set(pParams); QVariant param; bool valid; QString metric; param = pParams.value("mode", &valid); if (valid) { _mode = cNew; if (param.toString() == "new") { returnet.prepare("SELECT NEXTVAL('rahead_rahead_id_seq') AS rahead_id;"); returnet.exec(); if (returnet.first()) { _raheadid = returnet.value("rahead_id").toInt(); _comments->setId(_raheadid); } else if (returnet.lastError().type() != QSqlError::NoError) { systemError(this, returnet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } setNumber(); _authDate->setDate(omfgThis->dbDate(), true); _calcfreight = _metrics->boolean("CalculateFreight"); returnet.prepare("INSERT INTO rahead (" " rahead_id, rahead_number, rahead_authdate" ") VALUES (" " :rahead_id, COALESCE(:rahead_number,0), :rahead_authdate" ");"); returnet.bindValue(":rahead_id", _raheadid); if (!_authNumber->text().isEmpty()) returnet.bindValue(":rahead_number", _authNumber->text()); returnet.exec(); if (returnet.lastError().type() != QSqlError::NoError) { systemError(this, returnet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } metric = _metrics->value("DefaultRaDisposition"); if (metric == "C") _disposition->setCurrentIndex(0); else if (metric == "R") _disposition->setCurrentIndex(1); else if (metric == "P") _disposition->setCurrentIndex(2); else if (metric == "V") _disposition->setCurrentIndex(3); else if (metric == "M") _disposition->setCurrentIndex(4); else _disposition->setCurrentIndex(5); metric = _metrics->value("DefaultRaTiming"); if (metric == "I") _timing->setCurrentIndex(0); else if (metric == "R") _timing->setCurrentIndex(1); else _timing->setCurrentIndex(2); metric = _metrics->value("DefaultRaCreditMethod"); if (metric == "N") _creditBy->setCurrentIndex(0); else if (metric == "M") _creditBy->setCurrentIndex(1); else if (metric == "K") _creditBy->setCurrentIndex(2); else if (metric == "C") _creditBy->setCurrentIndex(3); else _creditBy->setCurrentIndex(4); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustomerInfo())); connect(_cust, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); } else if (param.toString() == "edit") { _mode = cEdit; _authNumber->setEnabled(FALSE); _cancel->setText("&Close"); connect(_authNumber, SIGNAL(editingFinished()), this, SLOT(sCheckAuthorizationNumber())); } else if (param.toString() == "view") { _mode = cView; disconnect(_raitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); } } param = pParams.value("incdt_id", &valid); if (valid) _incident->setId(param.toInt()); param = pParams.value("cust_id", &valid); if(cNew == _mode && valid) _cust->setId(param.toInt()); param = pParams.value("sohead_id", &valid); if (cNew == _mode && valid) _origso->setId(param.toInt()); param = pParams.value("rahead_id", &valid); if (valid) { _raheadid = param.toInt(); _comments->setId(_raheadid); populate(); } if (_mode == cView) { _authNumber->setEnabled(FALSE); _authDate->setEnabled(FALSE); _expireDate->setEnabled(FALSE); _salesRep->setEnabled(FALSE); _commission->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _rsnCode->setEnabled(FALSE); _disposition->setEnabled(FALSE); _timing->setEnabled(FALSE); _creditBy->setEnabled(FALSE); _origso->setEnabled(FALSE); _newso->setEnabled(FALSE); _incident->setEnabled(FALSE); _project->setEnabled(FALSE); _cust->setReadOnly(TRUE); _billToName->setEnabled(FALSE); _billToAddr->setEnabled(FALSE); _customerPO->setEnabled(FALSE); _miscCharge->setEnabled(FALSE); _miscChargeDescription->setEnabled(FALSE); _miscChargeAccount->setReadOnly(TRUE); _freight->setEnabled(FALSE); _notes->setEnabled(FALSE); _comments->setReadOnly(true); _copyToShipto->setEnabled(FALSE); _shipTo->setEnabled(FALSE); _shipToName->setEnabled(FALSE); _shipToAddr->setEnabled(FALSE); _currency->setEnabled(FALSE); _warehouse->setEnabled(FALSE); _shipWhs->setEnabled(FALSE); _shippingZone->setEnabled(FALSE); _saleType->setEnabled(FALSE); _save->hide(); _new->hide(); _delete->hide(); _edit->hide(); _action->hide(); _authorizeLine->hide(); _clearAuthorization->hide(); _authorizeAll->hide(); _enterReceipt->hide(); _receiveAll->hide(); _postReceipts->hide(); _cancel->setText("&Close"); } return NoError; } void returnAuthorization::setNumber() { XSqlQuery returnetNumber; if ( (_metrics->value("RANumberGeneration") == "A") || (_metrics->value("RANumberGeneration") == "O") ) { returnetNumber.prepare("SELECT fetchRaNumber() AS ranumber;"); returnetNumber.exec(); if (returnetNumber.first()) { _authNumber->setText(returnetNumber.value("ranumber").toString()); if (_metrics->value("RANumberGeneration") == "A") _authNumber->setEnabled(FALSE); } else if (returnetNumber.lastError().type() != QSqlError::NoError) { systemError(this, returnetNumber.lastError().databaseText(), __FILE__, __LINE__); return; } } else _authNumber->setFocus(); } bool returnAuthorization::sSave(bool partial) { XSqlQuery returnSave; const char *dispositionTypes[] = { "C", "R", "P", "V", "M", "" }; const char *timingTypes[] = { "I", "R", "" }; const char *creditMethods[] = { "N", "M", "K", "C", "" }; QString disposition = QString(dispositionTypes[_disposition->currentIndex()]); QString timing = QString(timingTypes[_timing->currentIndex()]); QString creditBy = QString(creditMethods[_creditBy->currentIndex()]); if ( !partial && (disposition.isEmpty()) ) { QMessageBox::warning( this, tr("Invalid Disposition"), tr("

    You must enter a Disposition." ) ); _disposition->setFocus(); return false; } if ( !partial && (timing.isEmpty()) ) { QMessageBox::warning( this, tr("Invalid Timing"), tr("

    You must enter a Timing." ) ); _timing->setFocus(); return false; } if ( !partial && (creditBy.isEmpty()) ) { QMessageBox::warning( this, tr("Invalid Credit Method"), tr("

    You must enter a Credit Method." ) ); _creditBy->setFocus(); return false; } if (_authNumber->text().isEmpty()) { if(partial && !isVisible()) return false; QMessageBox::critical( this, tr("Cannot Save Return Authorization"), tr("You may not save this Return Authorization until you have entered a valid Authorization Number.") ); _authNumber->setFocus(); return false; } if ( !partial && (disposition == "C") && (creditBy == "N") ) { QMessageBox::warning( this, tr("Invalid Credit Method"), tr("

    You may not enter a Disposition of Credit " "and a Credit By of None." ) ); _creditBy->setFocus(); return false; } if ( ! _miscCharge->isZero() && (!_miscChargeAccount->isValid()) ) { QMessageBox::warning( this, tr("No Misc. Charge Account Number"), tr("

    You may not enter a Misc. Charge without " "indicating the G/L Sales Account number for the " "charge. Please set the Misc. Charge amount to 0 " "or select a Misc. Charge Sales Account." ) ); _returnAuthInformation->setCurrentIndex(_returnAuthInformation->indexOf(_lineItemsPage)); _miscChargeAccount->setFocus(); return false; } if (!partial && _raitem->topLevelItemCount() == 0) { QMessageBox::warning( this, tr("Create Line Items for this Order"), tr("

    You must create at least one Line Item for " "this Return Authorization before you may save it.")); _new->setFocus(); return FALSE; } if (_total->localValue() < 0 ) { QMessageBox::information(this, tr("Total Less than Zero"), tr("

    The Total must be a positive value.") ); _cust->setFocus(); return false; } if ( !partial && !_warehouse->isValid() ) { QMessageBox::warning( this, tr("Invalid Receiving Site"), tr("

    You must enter a valid Receiving Site." ) ); _warehouse->setFocus(); return false; } if ( !partial && !_shipWhs->isValid() ) { QMessageBox::warning( this, tr("Invalid Shipping Site"), tr("

    You must enter a valid Shipping Site." ) ); _shipWhs->setFocus(); return false; } // save address info in case someone wants to use 'em again later // but don't make any global changes to the data and ignore errors _billToAddr->save(AddressCluster::CHANGEONE); _shipToAddr->save(AddressCluster::CHANGEONE); returnSave.prepare( "UPDATE rahead " " SET rahead_cust_id=:rahead_cust_id,rahead_number=:rahead_number," " rahead_authdate=:rahead_authdate,rahead_expiredate=:rahead_expiredate," " rahead_salesrep_id=:rahead_salesrep_id, rahead_commission=:rahead_commission," " rahead_taxzone_id=:rahead_taxzone_id,rahead_rsncode_id=:rahead_rsncode_id," " rahead_disposition=:rahead_disposition,rahead_timing=:rahead_timing," " rahead_creditmethod=:rahead_creditmethod,rahead_orig_cohead_id=:rahead_orig_cohead_id," " rahead_incdt_id=:rahead_incdt_id,rahead_prj_id=:rahead_prj_id," " rahead_billtoname=:rahead_billtoname, rahead_billtoaddress1=:rahead_billtoaddress1," " rahead_billtoaddress2=:rahead_billtoaddress2, rahead_billtoaddress3=:rahead_billtoaddress3," " rahead_billtocity=:rahead_billtocity, rahead_billtostate=:rahead_billtostate," " rahead_billtozip=:rahead_billtozip,rahead_billtocountry=:rahead_billtocountry," " rahead_shipto_id=:rahead_shipto_id," " rahead_shipto_name=:rahead_shipto_name, rahead_shipto_address1=:rahead_shipto_address1," " rahead_shipto_address2=:rahead_shipto_address2, rahead_shipto_address3=:rahead_shipto_address3," " rahead_shipto_city=:rahead_shipto_city, rahead_shipto_state=:rahead_shipto_state," " rahead_shipto_zipcode=:rahead_shipto_zipcode,rahead_shipto_country=:rahead_shipto_country," " rahead_custponumber=:rahead_custponumber,rahead_notes=:rahead_notes, " " rahead_misc_accnt_id=:rahead_misc_accnt_id,rahead_misc=:rahead_misc, " " rahead_misc_descrip=:rahead_misc_descrip, rahead_curr_id=:rahead_curr_id," " rahead_freight=:rahead_freight, rahead_calcfreight=:rahead_calcfreight," " rahead_printed=:rahead_printed," " rahead_warehous_id=:rahead_warehous_id, rahead_cohead_warehous_id=:rahead_cohead_warehous_id," " rahead_shipzone_id=:rahead_shipzone_id, rahead_saletype_id=:rahead_saletype_id " " WHERE(rahead_id=:rahead_id);" ); returnSave.bindValue(":rahead_id", _raheadid); returnSave.bindValue(":rahead_number", _authNumber->text().toInt()); returnSave.bindValue(":rahead_authdate", _authDate->date()); returnSave.bindValue(":rahead_expiredate", _expireDate->date()); if (_salesRep->isValid() && _cust->isValid()) returnSave.bindValue(":rahead_salesrep_id", _salesRep->id()); returnSave.bindValue(":rahead_commission", (_commission->toDouble() / 100)); if (_taxzone->isValid()) returnSave.bindValue(":rahead_taxzone_id", _taxzone->id()); if (_rsnCode->id() > 0) returnSave.bindValue(":rahead_rsncode_id", _rsnCode->id()); if (!disposition.isEmpty()) returnSave.bindValue(":rahead_disposition", disposition); if (!timing.isEmpty()) returnSave.bindValue(":rahead_timing", timing); if (!creditBy.isEmpty()) returnSave.bindValue(":rahead_creditmethod", creditBy); if (_origso->isValid()) returnSave.bindValue(":rahead_orig_cohead_id", _origso->id()); if (_newso->isValid()) returnSave.bindValue(":rahead_new_cohead_id", _newso->id()); if (_incident->isValid()) returnSave.bindValue(":rahead_incdt_id", _incident->id()); if (_project->isValid()) returnSave.bindValue(":rahead_prj_id", _project->id()); if (_cust->isValid()) returnSave.bindValue(":rahead_cust_id", _cust->id()); returnSave.bindValue(":rahead_billtoname", _billToName->text().trimmed()); returnSave.bindValue(":rahead_billtoaddress1", _billToAddr->line1()); returnSave.bindValue(":rahead_billtoaddress2", _billToAddr->line2()); returnSave.bindValue(":rahead_billtoaddress3", _billToAddr->line3()); returnSave.bindValue(":rahead_billtocity", _billToAddr->city()); returnSave.bindValue(":rahead_billtostate", _billToAddr->state()); returnSave.bindValue(":rahead_billtozip", _billToAddr->postalCode()); returnSave.bindValue(":rahead_billtocountry", _billToAddr->country()); if (_shipTo->id() > 0) returnSave.bindValue(":rahead_shipto_id", _shipTo->id()); returnSave.bindValue(":rahead_shipto_name", _shipToName->text().trimmed()); returnSave.bindValue(":rahead_shipto_address1", _shipToAddr->line1()); returnSave.bindValue(":rahead_shipto_address2", _shipToAddr->line2()); returnSave.bindValue(":rahead_shipto_address3", _shipToAddr->line3()); returnSave.bindValue(":rahead_shipto_city", _shipToAddr->city()); returnSave.bindValue(":rahead_shipto_state", _shipToAddr->state()); returnSave.bindValue(":rahead_shipto_zipcode", _shipToAddr->postalCode()); returnSave.bindValue(":rahead_shipto_country", _shipToAddr->country()); returnSave.bindValue(":rahead_custponumber", _customerPO->text().trimmed()); returnSave.bindValue(":rahead_notes", _notes->toPlainText()); returnSave.bindValue(":rahead_misc", _miscCharge->localValue()); if (_miscChargeAccount->id() != -1) returnSave.bindValue(":rahead_misc_accnt_id", _miscChargeAccount->id()); returnSave.bindValue(":rahead_misc_descrip", _miscChargeDescription->text()); returnSave.bindValue(":rahead_curr_id", _currency->id()); returnSave.bindValue(":rahead_freight", _freight->localValue()); returnSave.bindValue(":rahead_calcfreight", _calcfreight); returnSave.bindValue(":rahead_warehous_id", _warehouse->id()); returnSave.bindValue(":rahead_cohead_warehous_id", _shipWhs->id()); returnSave.bindValue(":rahead_shipzone_id", _shippingZone->id()); returnSave.bindValue(":rahead_saletype_id", _saleType->id()); returnSave.exec(); if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); return false; } omfgThis->sReturnAuthorizationsUpdated(); omfgThis->sProjectsUpdated(_project->id()); _saved = TRUE; _comments->setId(_raheadid); connect(_authNumber, SIGNAL(editingFinished()), this, SLOT(sCheckAuthorizationNumber())); emit saved(_raheadid); return true; } void returnAuthorization::sPostReceipts() { sSave(true); enterPoReceipt::post("RA", _raheadid); populate(); _mode = cEdit; _cancel->setText("&Close"); } void returnAuthorization::sSaveClick() { if (sSave(false)) { if (_printRA->isChecked()) { ParameterList params; params.append("rahead_id", _raheadid); printRaForm newdlgS(this, "", true); newdlgS.set(params); newdlgS.exec(); /* TO DO: This isn't going to work right now because the EDI profile is specific to S/O. We really need to rearchitect the EDI profiles for customers to one to many With profile types for Invoice, S/O, R/A etc... if (_custEmail && _metrics->boolean("EnableBatchManager")) { deliverReturnAuthorization newdlgD(this, "", true); newdlgD.set(params); newdlgD.exec(); } */ } _raheadid=-1; close(); } } void returnAuthorization::sOrigSoChanged() { XSqlQuery returnOrigSoChanged; if (_origso->isValid()) { _authorizeLine->show(); _clearAuthorization->show(); _authorizeAll->show(); } else { _authorizeLine->hide(); _clearAuthorization->hide(); _authorizeAll->hide(); } if (_origso->isValid()) { returnOrigSoChanged.prepare("SELECT rahead_number FROM rahead,raitem " " WHERE((rahead_orig_cohead_id=:cohead_id) " " AND (rahead_id != :rahead_id) " " AND (raitem_rahead_id=rahead_id) " " AND (raitem_status = 'O') " " AND (raitem_qtyauthorized > 0)); "); returnOrigSoChanged.bindValue(":cohead_id",_origso->id()); returnOrigSoChanged.bindValue(":rahead_id",_raheadid); returnOrigSoChanged.exec(); if (returnOrigSoChanged.first()) { QMessageBox::critical(this, tr("Invalid Sales Order"), tr("This sales order is already linked to open return authorization %1.").arg(returnOrigSoChanged.value("rahead_number").toString()) ); _origso->setId(-1); if (_cust->isValid()) _origso->setCustId(_cust->id()); else _origso->setCustId(-1); return; } } if (!_ignoreSoSignals) { if (_origso->isValid()) { if ( !_warehouse->isValid() ) { QMessageBox::warning( this, tr("Invalid Receiving Site"), tr("

    You must enter a valid Receiving Site." ) ); _warehouse->setFocus(); _origso->setId(-1); return; } if ( !_shipWhs->isValid() ) { QMessageBox::warning( this, tr("Invalid Shipping Site"), tr("

    You must enter a valid Shipping Site." ) ); _shipWhs->setFocus(); _origso->setId(-1); return; } XSqlQuery sohead; sohead.prepare( "SELECT cohead.*,custinfo.*, custtype_code, " " cohead_commission, " " shipto_num " "FROM cohead " " LEFT OUTER JOIN shiptoinfo ON (cohead_shipto_id=shipto_id), " " custinfo, custtype " "WHERE ((cohead_id=:cohead_id) " "AND (cohead_cust_id=cust_id) " "AND (cust_custtype_id=custtype_id) ) " "LIMIT 1;" ); sohead.bindValue(":cohead_id", _origso->id()); sohead.exec(); if (sohead.first()) { _salesRep->setId(sohead.value("cohead_salesrep_id").toInt()); _commission->setDouble(sohead.value("cohead_commission").toDouble() * 100); _taxzone->setId(sohead.value("cohead_taxzone_id").toInt()); _customerPO->setText(sohead.value("cohead_custponumber")); _project->setId(sohead.value("cohead_prj_id").toInt()); _shippingZone->setId(sohead.value("cohead_shipzone_id").toInt()); _saleType->setId(sohead.value("cohead_saletype_id").toInt()); _cust->setEnabled(FALSE); _cust->setId(sohead.value("cohead_cust_id").toInt()); _custType->setText(sohead.value("custtype_code").toString()); _billToName->setText(sohead.value("cohead_billtoname")); _billToAddr->setLine1(sohead.value("cohead_billtoaddress1").toString()); _billToAddr->setLine2(sohead.value("cohead_billtoaddress2").toString()); _billToAddr->setLine3(sohead.value("cohead_billtoaddress3").toString()); _billToAddr->setCity(sohead.value("cohead_billtocity").toString()); _billToAddr->setState(sohead.value("cohead_billtostate").toString()); _billToAddr->setPostalCode(sohead.value("cohead_billtozipcode").toString()); _billToAddr->setCountry(sohead.value("cohead_billtocountry").toString()); if ( (_mode == cNew) || (_mode == cEdit) ) _ffBillto = sohead.value("cust_ffbillto").toBool(); else _ffBillto = FALSE; _billToName->setEnabled(_ffBillto); _billToAddr->setEnabled(_ffBillto); _ignoreShiptoSignals = true; _shipTo->setId(sohead.value("cohead_shipto_id").toInt()); _shipToName->setText(sohead.value("cohead_shiptoname")); _shipToAddr->setLine1(sohead.value("cohead_shiptoaddress1").toString()); _shipToAddr->setLine2(sohead.value("cohead_shiptoaddress2").toString()); _shipToAddr->setLine3(sohead.value("cohead_shiptoaddress3").toString()); _shipToAddr->setCity(sohead.value("cohead_shiptocity").toString()); _shipToAddr->setState(sohead.value("cohead_shiptostate").toString()); _shipToAddr->setPostalCode(sohead.value("cohead_shiptozipcode").toString()); _shipToAddr->setCountry(sohead.value("cohead_shiptocountry").toString()); if ( (_mode == cNew) || (_mode == cEdit) ) _ffShipto = sohead.value("cust_ffshipto").toBool(); else _ffShipto = FALSE; _copyToShipto->setEnabled(_ffShipto); _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _ignoreShiptoSignals = FALSE; sSave(true); sFillList(); } else if (sohead.lastError().type() != QSqlError::NoError) { systemError(this, sohead.lastError().databaseText(), __FILE__, __LINE__); _origso->setId(-1); return; } } } } void returnAuthorization::populateShipto(int pShiptoid) { if (pShiptoid != -1) { XSqlQuery query; query.prepare( "SELECT * " "FROM shiptoinfo " "WHERE (shipto_id=:shipto_id);" ); query.bindValue(":shipto_id", pShiptoid); query.exec(); if (query.first()) { _ignoreShiptoSignals = true; _shipTo->setId(query.value("shipto_id").toInt()); _shipToName->setText(query.value("shipto_name")); _shipToAddr->setId(query.value("shipto_addr_id").toInt()); _taxzone->setId(query.value("shipto_taxzone_id").toInt()); _salesRep->setId(query.value("shipto_salesrep_id").toInt()); _shippingZone->setId(query.value("shipto_shipzone_id").toInt()); _commission->setDouble(query.value("shipto_commission").toDouble() * 100); _ignoreShiptoSignals = false; } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _shipTo->setId(-1); _shipToName->clear(); _shipToAddr->clear(); } } void returnAuthorization::sPopulateCustomerInfo() { if (_cust->isValid()) { _origso->setCustId(_cust->id()); XSqlQuery query; query.prepare( "SELECT custtype_code, cust_salesrep_id," " cust_commprcnt," " cust_taxzone_id, cust_curr_id, " " cust_name, cntct_addr_id, " " cust_ffshipto, cust_ffbillto, " " COALESCE(shipto_id, -1) AS shiptoid, " " cust_soemaildelivery " "FROM custinfo " " LEFT OUTER JOIN shiptoinfo ON ((cust_id=shipto_cust_id) " " AND (shipto_default)) " " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id), " " custtype " "WHERE ( (cust_id=:cust_id) " "AND (custtype_id=cust_custtype_id) );" ); query.bindValue(":cust_id", _cust->id()); query.exec(); if (query.first()) { _custType->setText(query.value("custtype_code").toString()); _salesRep->setId(query.value("cust_salesrep_id").toInt()); _commission->setDouble(query.value("cust_commprcnt").toDouble() * 100); _custtaxzoneid = query.value("cust_taxzone_id").toInt(); _taxzone->setId(query.value("cust_taxzone_id").toInt()); _currency->setId(query.value("cust_curr_id").toInt()); _billToName->setText(query.value("cust_name")); _billToAddr->setId(query.value("cntct_addr_id").toInt()); if ( (_mode == cNew) || (_mode == cEdit) ) _ffBillto = query.value("cust_ffbillto").toBool(); else _ffBillto = FALSE; _billToName->setEnabled(_ffBillto); _billToAddr->setEnabled(_ffBillto); if ( (_mode == cNew) || (_mode == cEdit) ) _ffShipto = query.value("cust_ffshipto").toBool(); else _ffShipto = FALSE; _copyToShipto->setEnabled(_ffShipto); _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _custEmail = query.value("cust_soemaildelivery").toBool(); populateShipto(query.value("shiptoid").toInt()); } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _origso->setCustId(-1); _salesRep->setCurrentIndex(-1); _taxzone->setId(-1); _custtaxzoneid = -1; _billToName->setEnabled(TRUE); _billToAddr->setEnabled(TRUE); _billToName->clear(); _billToAddr->clear(); _shipTo->setEnabled(TRUE); _shipToName->setEnabled(TRUE); _shipToAddr->setEnabled(TRUE); _shipTo->setId(-1); _shipToName->clear(); _shipToAddr->clear(); } } void returnAuthorization::sCheckAuthorizationNumber() { if ( (_authNumber->text().length()) && ( (_metrics->value("RANumberGeneration") == "O") || (_metrics->value("RANumberGeneration") == "M") ) ) { _authNumber->setEnabled(FALSE); XSqlQuery query; query.prepare( "SELECT rahead_id " "FROM rahead " "WHERE ((rahead_number=:rahead_number)" " AND (rahead_id <> :rahead_id))"); query.bindValue(":rahead_number", _authNumber->text()); query.bindValue(":rahead_id", _raheadid); query.exec(); if (query.first()) { _raheadid = query.value("rahead_id").toInt(); if (_cust->id() > 0) _cust->setReadOnly(TRUE); populate(); _mode = cEdit; } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } } void returnAuthorization::sClearShiptoNumber() { if (!_ignoreShiptoSignals) { // Convert the captive shipto to a free-form shipto _shipTo->blockSignals(true); _shipTo->setId(-1); _shipTo->setCustid(_cust->id()); _shipTo->blockSignals(false); } } void returnAuthorization::sCopyToShipto() { _shipTo->setId(-1); _shipToName->setText(_billToName->text()); if (_billToAddr->id() > 0) _shipToAddr->setId(_billToAddr->id()); else { _shipToAddr->setLine1(_billToAddr->line1()); _shipToAddr->setLine2(_billToAddr->line2()); _shipToAddr->setLine3(_billToAddr->line1()); _shipToAddr->setCity(_billToAddr->city()); _shipToAddr->setState(_billToAddr->state()); _shipToAddr->setPostalCode(_billToAddr->postalCode()); _shipToAddr->setCountry(_billToAddr->country()); } _taxzone->setId(_custtaxzoneid); } void returnAuthorization::sNew() { if (sSave(true)) { ParameterList params; params.append("mode", "new"); params.append("rahead_id", _raheadid); params.append("orig_cohead_id", _origso->id()); if (_warehouse->isValid()) params.append("warehous_id", _warehouse->id()); if (_shipWhs->isValid()) params.append("shipwarehous_id", _shipWhs->id()); returnAuthorizationItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { populate(); } } } void returnAuthorization::sEdit() { if (sSave(true)) { bool fill; fill = FALSE; QList selected = _raitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("raitem_id", ((XTreeWidgetItem*)(selected[i]))->id()); params.append("rahead_id", _raheadid); params.append("orig_cohead_id", _origso->id()); if (_mode==cView || ((XTreeWidgetItem*)(selected[i]))->altId() == -1) params.append("mode", "view"); else if (((XTreeWidgetItem*)(selected[i]))->rawValue("item_type") == "K") params.append("mode", "view"); else params.append("mode", "edit"); returnAuthorizationItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) fill = TRUE; } if (fill) { populate(); } } } void returnAuthorization::sView() { QList selected = _raitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("raitem_id", ((XTreeWidgetItem*)(selected[i]))->id()); params.append("rahead_id", _raheadid); params.append("orig_cohead_id", _origso->id()); params.append("mode", "view"); returnAuthorizationItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void returnAuthorization::sDelete() { XSqlQuery returnDelete; if (QMessageBox::question(this, "Delete current Line Item?", tr("

    Are you sure that you want to delete the " "the selected Line Item(s)?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { QList selected = _raitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XSqlQuery checkwo; checkwo.prepare("SELECT wo_id, wo_status " "FROM wo LEFT OUTER JOIN coitem ON (wo_id=coitem_order_id)" " LEFT OUTER JOIN raitem ON (coitem_id=raitem_new_coitem_id) " "WHERE (raitem_id = :raitem_id);"); checkwo.bindValue(":raitem_id", ((XTreeWidgetItem*)(selected[i]))->id()); checkwo.exec(); if (checkwo.first()) { if (checkwo.value("wo_status").toString() == "E") { QMessageBox::information(this, tr("Work Order Closed"), tr("The current Return Authorization Line Item has " "associated Work Order which has not been processed. " "This Work Order will be closed upon deletion of this " "line item.")); } else if (checkwo.value("wo_status").toString() == "I") { QMessageBox::information(this, tr("Work Order Unchanged"), tr("The current Return Authorization Line Item has " "an associated Work Order with Transaction History. " "This Work Order will not be closed/deleted upon " "deletion of this line item.")); } } else if (checkwo.lastError().type() != QSqlError::NoError) { systemError(this, checkwo.lastError().databaseText(), __FILE__, __LINE__); } returnDelete.prepare( "DELETE FROM raitem " "WHERE (raitem_id=:raitem_id);" ); returnDelete.bindValue(":raitem_id", ((XTreeWidgetItem*)(selected[i]))->id()); returnDelete.exec(); if (returnDelete.lastError().type() != QSqlError::NoError) { systemError(this, returnDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillList(); } } void returnAuthorization::sFillList() { XSqlQuery returnFillList; returnFillList.prepare( "SELECT raitem_id, " " CASE WHEN (raitem_status='C') THEN -1" " WHEN (raitem_disposition='C') THEN 0" " WHEN (raitem_disposition='R') THEN 1" " WHEN (raitem_disposition='P') THEN 2" " WHEN (raitem_disposition='V') THEN 3" " WHEN (raitem_disposition='S') THEN 4" " ELSE -1 END AS disposition_code," " formatRaLineNumber(raitem_id) AS f_linenumber, raitem_subnumber," " item_number, uom_name, item_type," " (item_descrip1 || ' ' || item_descrip2) AS item_descrip, warehous_code," " raitem_status, " " CASE WHEN (raitem_disposition='C') THEN :credit " " WHEN (raitem_disposition='R') THEN :return " " WHEN (raitem_disposition='P') THEN :replace " " WHEN (raitem_disposition='V') THEN :service " " WHEN (raitem_disposition='S') THEN :ship " " ELSE 'Error' END AS disposition, " " raitem_warranty," " COALESCE(oc.coitem_qtyshipped,0) AS oldcoitem_qtyshipped," " raitem_qtyauthorized," " raitem_qtyreceived," " qtyToReceive('RA', raitem_id) AS raitem_qtytoreceive," " COALESCE(nc.coitem_qtyshipped,0) AS newcoitem_qtyshipped," " raitem_unitprice," " round((raitem_qtyauthorized * raitem_qty_invuomratio) * (raitem_unitprice / raitem_price_invuomratio),2) AS raitem_extprice," " raitem_amtcredited," " raitem_saleprice," " round((raitem_qtyauthorized * raitem_qty_invuomratio) * (raitem_saleprice / raitem_price_invuomratio),2) AS raitem_extsaleprice," " round((raitem_qtyauthorized * raitem_qty_invuomratio) * (raitem_unitprice / raitem_price_invuomratio),2) - " " round((raitem_qtyauthorized * raitem_qty_invuomratio) * (raitem_saleprice / raitem_price_invuomratio),2) AS raitem_netdue," " och.cohead_number::text || '-' || oc.coitem_linenumber::text AS oldcohead_number, " " COALESCE(och.cohead_id,-1) AS oldcohead_number_xtidrole, " " nch.cohead_number::text || '-' || nc.coitem_linenumber::text AS newcohead_number, " " COALESCE(nch.cohead_id,-1) AS newcohead_number_xtidrole, " " raitem_scheddate, " " 'qty' AS oldcoitem_qtyshipped_xtnumericrole, " " 'qty' AS raitem_qtyauthorized_xtnumericrole, " " 'qty' AS raitem_qtyreceived_xtnumericrole, " " 'qty' AS raitem_qtytoreceive_xtnumericrole, " " 'qty' AS newcoitem_qtyshipped_xtnumericrole, " " 'salesprice' AS raitem_unitprice_xtnumericrole, " " 'extprice' AS raitem_extprice_xtnumericrole, " " 'curr' AS raitem_amtcredited_xtnumericrole, " " 'salesprice' AS raitem_saleprice_xtnumericrole, " " 'extprice' AS raitem_extsaleprice_xtnumericrole, " " 'extprice' AS raitem_netdue_xtnumericrole, " " :na AS raitem_scheddate_xtnullrole," " CASE WHEN raitem_subnumber = 0 THEN 0" " ELSE 1 END AS xtindentrole " "FROM raitem " " LEFT OUTER JOIN coitem oc ON (raitem_orig_coitem_id=oc.coitem_id) " " LEFT OUTER JOIN cohead och ON (och.cohead_id=oc.coitem_cohead_id) " " LEFT OUTER JOIN coitem nc ON (raitem_new_coitem_id=nc.coitem_id) " " LEFT OUTER JOIN cohead nch ON (nch.cohead_id=nc.coitem_cohead_id)," " itemsite, item, whsinfo, uom " "WHERE ( (raitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (raitem_rahead_id=:rahead_id) " " AND (raitem_qty_uom_id=uom_id) ) " "ORDER BY raitem_linenumber, raitem_subnumber;" ); returnFillList.bindValue(":rahead_id", _raheadid); returnFillList.bindValue(":credit", tr("Credit")); returnFillList.bindValue(":return", tr("Return")); returnFillList.bindValue(":replace", tr("Replace")); returnFillList.bindValue(":service", tr("Service")); returnFillList.bindValue(":ship", tr("Ship")); returnFillList.bindValue(":na", tr("N/A")); returnFillList.exec(); _raitem->populate(returnFillList, true); if ((returnFillList.first()) && (_mode == cEdit)) { _cust->setDisabled(_cust->isValid()); } else if (returnFillList.lastError().type() != QSqlError::NoError) { systemError(this, returnFillList.lastError().databaseText(), __FILE__, __LINE__); return; } sCalculateSubtotal(); if (_creditBy->currentIndex() != 0 && _calcfreight) { returnFillList.prepare("SELECT SUM(freightdata_total) AS freight " "FROM freightDetail('RA', :head_id, :cust_id, :shipto_id, :orderdate, :shipvia, :curr_id);"); returnFillList.bindValue(":head_id", _raheadid); returnFillList.bindValue(":cust_id", _cust->id()); returnFillList.bindValue(":shipto_id", _shipTo->id()); returnFillList.bindValue(":orderdate", _authDate->date()); returnFillList.bindValue(":shipvia", ""); returnFillList.bindValue(":curr_id", _currency->id()); returnFillList.exec(); if (returnFillList.first()) { _freightCache = returnFillList.value("freight").toDouble(); disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(_freightCache); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } else if (returnFillList.lastError().type() != QSqlError::NoError) { systemError(this, returnFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } else _freight->setLocalValue(_freightCache); sCalculateNetDue(); sCalculateTax(); _currency->setEnabled((_raitem->topLevelItemCount() == 0) && (_mode == cEdit)); //Disable order changes if any order qty authorized returnFillList.prepare("SELECT raitem_id " "FROM raitem " "WHERE ( (raitem_rahead_id=:rahead_id) " "AND (raitem_orig_coitem_id IS NOT NULL) " "AND (raitem_qtyauthorized > 0) );"); returnFillList.bindValue(":rahead_id", _raheadid); returnFillList.exec(); _origso->setEnabled((!returnFillList.first()) && (_mode == cEdit || _mode == cNew)); //Disable changes if any transactions returnFillList.prepare("SELECT raitem_id " "FROM raitem " " LEFT OUTER JOIN coitem ON (raitem_new_coitem_id=coitem_id) " "WHERE ( (raitem_rahead_id=:rahead_id) " "AND (((raitem_qtyreceived + COALESCE(coitem_qtyshipped,0) + " " raitem_amtcredited) > 0 OR raitem_status = 'C')) );"); returnFillList.bindValue(":rahead_id", _raheadid); returnFillList.exec(); if (returnFillList.first()) { _salesRep->setEnabled(false); _commission->setEnabled(false); _taxzone->setEnabled(false); _disposition->setEnabled(false); _timing->setEnabled(false); _cust->setEnabled(false); _billToName->setEnabled(false); _billToAddr->setEnabled(false); } else { _salesRep->setEnabled(true); _commission->setEnabled(true); _taxzone->setEnabled(true); _disposition->setEnabled(true); _timing->setEnabled(true); _cust->setEnabled(!_origso->isValid()); _billToName->setEnabled(true); _billToAddr->setEnabled(true); } _comments->refresh(); sCreditByChanged(); } void returnAuthorization::sCalculateSubtotal() { // Determine the subtotal and line item tax XSqlQuery query; query.prepare( "SELECT SUM(round((raitem_qtyauthorized * raitem_qty_invuomratio) * (raitem_unitprice / raitem_price_invuomratio),2)) AS subtotal," " SUM(round((raitem_qtyauthorized * raitem_qty_invuomratio) * stdCost(item_id),2)) AS totalcost " "FROM raitem, itemsite, item " "WHERE ( (raitem_rahead_id=:rahead_id)" " AND (raitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id) );" ); query.bindValue(":rahead_id", _raheadid); query.exec(); if (query.first()) _subtotal->setLocalValue(query.value("subtotal").toDouble()); } void returnAuthorization::sCalculateNetDue() { XSqlQuery query; query.prepare( "SELECT SUM(round( ((raitem_qtyauthorized * raitem_qty_invuomratio) * (raitem_unitprice / raitem_price_invuomratio)) - " " ((raitem_qtyauthorized * raitem_qty_invuomratio) * (raitem_saleprice / raitem_price_invuomratio)),2)) AS netdue " "FROM raitem, itemsite, item " "WHERE ( (raitem_rahead_id=:rahead_id)" " AND (raitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id) );" ); query.bindValue(":rahead_id", _raheadid); query.exec(); if (query.first()) _netdue->setLocalValue(query.value("netdue").toDouble()); } void returnAuthorization::sCalculateTotal() { _total->setLocalValue(_subtotal->localValue() + _tax->localValue() + _freight->localValue() + _miscCharge->localValue() ); } void returnAuthorization::populate() { XSqlQuery rahead; rahead.prepare( "SELECT rahead.*, custtype_code, " " cust_name, cust_ffbillto, cust_ffshipto, shipto_num, " " rahead_commission " "FROM rahead " " LEFT OUTER JOIN shiptoinfo ON (rahead_shipto_id=shipto_id) " " LEFT OUTER JOIN custinfo ON (rahead_cust_id=cust_id) " " LEFT OUTER JOIN custtype ON (cust_custtype_id=custtype_id) " "WHERE (rahead_id=:rahead_id);" ); rahead.bindValue(":rahead_id", _raheadid); rahead.exec(); if (rahead.first()) { _authNumber->setText(rahead.value("rahead_number")); _authDate->setDate(rahead.value("rahead_authdate").toDate(), true); _expireDate->setDate(rahead.value("rahead_expiredate").toDate()); _cust->setId(rahead.value("rahead_cust_id").toInt()); _custType->setText(rahead.value("custtype_code").toString()); _shipTo->setId(rahead.value("rahead_shipto_id").toInt()); _salesRep->setId(rahead.value("rahead_salesrep_id").toInt()); _commission->setDouble(rahead.value("rahead_commission").toDouble() * 100); // do taxzone first so we can overwrite the result of the signal cascade _taxzone->setId(rahead.value("rahead_taxzone_id").toInt()); if (!rahead.value("rahead_rsncode_id").isNull() && rahead.value("rahead_rsncode_id").toInt() != -1) _rsnCode->setId(rahead.value("rahead_rsncode_id").toInt()); if (rahead.value("rahead_timing").toString() == "I") _timing->setCurrentIndex(0); else _timing->setCurrentIndex(1); if (rahead.value("rahead_creditmethod").toString() == "N") _creditBy->setCurrentIndex(0); else if (rahead.value("rahead_creditmethod").toString() == "M") _creditBy->setCurrentIndex(1); else if (rahead.value("rahead_creditmethod").toString() == "K") _creditBy->setCurrentIndex(2); else if (rahead.value("rahead_creditmethod").toString() == "C") _creditBy->setCurrentIndex(3); _ignoreSoSignals = TRUE; _origso->setId(rahead.value("rahead_orig_cohead_id").toInt()); _newso->setId(rahead.value("rahead_new_cohead_id").toInt(),"SO"); _ignoreSoSignals = FALSE; _incident->setId(rahead.value("rahead_incdt_id").toInt()); _project->setId(rahead.value("rahead_prj_id").toInt()); _ffBillto = rahead.value("cust_ffbillto").toBool(); _billToName->setEnabled(_ffBillto); _billToAddr->setEnabled(_ffBillto); _billToName->setText(rahead.value("rahead_billtoname")); _billToAddr->setLine1(rahead.value("rahead_billtoaddress1").toString()); _billToAddr->setLine2(rahead.value("rahead_billtoaddress2").toString()); _billToAddr->setLine3(rahead.value("rahead_billtoaddress3").toString()); _billToAddr->setCity(rahead.value("rahead_billtocity").toString()); _billToAddr->setState(rahead.value("rahead_billtostate").toString()); _billToAddr->setPostalCode(rahead.value("rahead_billtozip").toString()); _billToAddr->setCountry(rahead.value("rahead_billtocountry").toString()); _ffShipto = rahead.value("cust_ffshipto").toBool(); _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _copyToShipto->setEnabled(_ffShipto); _ignoreShiptoSignals = true; _shipToName->setText(rahead.value("rahead_shipto_name")); _shipToAddr->setLine1(rahead.value("rahead_shipto_address1").toString()); _shipToAddr->setLine2(rahead.value("rahead_shipto_address2").toString()); _shipToAddr->setLine3(rahead.value("rahead_shipto_address3").toString()); _shipToAddr->setCity(rahead.value("rahead_shipto_city").toString()); _shipToAddr->setState(rahead.value("rahead_shipto_state").toString()); _shipToAddr->setPostalCode(rahead.value("rahead_shipto_zipcode").toString()); _shipToAddr->setCountry(rahead.value("rahead_shipto_country").toString()); _ignoreShiptoSignals = false; _customerPO->setText(rahead.value("rahead_custponumber")); _currency->setId(rahead.value("rahead_curr_id").toInt()); _calcfreight = rahead.value("rahead_calcfreight").toBool(); // Auto calculated _freight is populated in sFillItemList if (!_calcfreight) { disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freightCache = rahead.value("rahead_freight").toDouble(); _freight->setLocalValue(_freightCache); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } _ignoreWhsSignals = TRUE; _warehouse->setId(rahead.value("rahead_warehous_id").toInt()); _shipWhs->setId(rahead.value("rahead_cohead_warehous_id").toInt()); _ignoreWhsSignals = FALSE; _miscCharge->setLocalValue(rahead.value("rahead_misc").toDouble()); _miscChargeDescription->setText(rahead.value("rahead_misc_descrip")); _miscChargeAccount->setId(rahead.value("rahead_misc_accnt_id").toInt()); _shippingZone->setId(rahead.value("rahead_shipzone_id").toInt()); _saleType->setId(rahead.value("rahead_saletype_id").toInt()); _notes->setText(rahead.value("rahead_notes").toString()); if (rahead.value("rahead_headcredited").toBool()) { _freight->setEnabled(FALSE); _miscCharge->setEnabled(FALSE); _miscChargeDescription->setEnabled(FALSE); _miscChargeAccount->setEnabled(FALSE); } _ignoreSoSignals = TRUE; if (rahead.value("rahead_disposition").toString() == "C") sDispositionChanged(); else if (rahead.value("rahead_disposition").toString() == "R") _disposition->setCurrentIndex(1); else if (rahead.value("rahead_disposition").toString() == "P") _disposition->setCurrentIndex(2); else if (rahead.value("rahead_disposition").toString() == "V") _disposition->setCurrentIndex(3); else if (rahead.value("rahead_disposition").toString() == "M") _disposition->setCurrentIndex(4); _ignoreSoSignals = FALSE; _saved = TRUE; sFillList(); } else if (rahead.lastError().type() != QSqlError::NoError) { systemError(this, rahead.lastError().databaseText(), __FILE__, __LINE__); return; } } void returnAuthorization::closeEvent(QCloseEvent *pEvent) { XSqlQuery returncloseEvent; if ( (_mode == cNew) && (_raheadid != -1) ) { returncloseEvent.prepare( "UPDATE raitem SET raitem_qtyauthorized=0 " "WHERE (raitem_rahead_id=:rahead_id); " "SELECT importcoitemstora(:rahead_id,NULL);" "DELETE FROM rahead " "WHERE (rahead_id=:rahead_id);" ); returncloseEvent.bindValue(":rahead_id", _raheadid); returncloseEvent.exec(); if (returncloseEvent.lastError().type() != QSqlError::NoError) { systemError(this, returncloseEvent.lastError().databaseText(), __FILE__, __LINE__); return; } else { omfgThis->sReturnAuthorizationsUpdated(); omfgThis->sProjectsUpdated(_project->id()); } if ( (_metrics->value("RANumberGeneration") == "A") || (_metrics->value("RANumberGeneration") == "O") ) { returncloseEvent.prepare("SELECT releaseRaNumber(:number) AS result;"); returncloseEvent.bindValue(":number", _authNumber->text()); returncloseEvent.exec(); if (returncloseEvent.lastError().type() != QSqlError::NoError) { systemError(this, returncloseEvent.lastError().databaseText(), __FILE__, __LINE__); return; } } } XWidget::closeEvent(pEvent); } void returnAuthorization::sTaxDetail() { if (!sSave(true)) return; ParameterList params; params.append("order_id", _raheadid); params.append("order_type", "RA"); // mode => view since there are no fields to hold modified tax data if (_mode == cView) params.append("mode", "view"); taxBreakdown newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) populate(); } void returnAuthorization::sCalculateTax() { XSqlQuery taxq; taxq.prepare( "SELECT calcRATaxAmt(:rahead_id) AS tax;" ); taxq.bindValue(":rahead_id", _raheadid); taxq.exec(); if (taxq.first()) _tax->setLocalValue(taxq.value("tax").toDouble()); else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } } void returnAuthorization::sTaxZoneChanged() { if (_saved) sSave(true); sCalculateTax(); } void returnAuthorization::sRecvWhsChanged() { if (!_ignoreWhsSignals) { if ( (_raheadid == -1) || (!_warehouse->isValid()) ) return; XSqlQuery whsq; whsq.prepare("SELECT raitem_id " "FROM raitem JOIN itemsite ON (itemsite_id=raitem_itemsite_id) " "WHERE ( (raitem_rahead_id=:rahead_id)" " AND (itemsite_warehous_id <> :warehous_id) )" "LIMIT 1;"); whsq.bindValue(":rahead_id", _raheadid); whsq.bindValue(":warehous_id", _warehouse->id()); whsq.exec(); if (whsq.first()) QMessageBox::information(this, tr("Receiving Site Warning"), tr("This Return Authorization has line items with a different Receiving Site. " "You may need to review the line items.")); } } void returnAuthorization::sShipWhsChanged() { if (!_ignoreWhsSignals) { if ( (_raheadid == -1) || (!_shipWhs->isValid()) ) return; XSqlQuery whsq; whsq.prepare("SELECT raitem_id " "FROM raitem JOIN itemsite ON (itemsite_id=raitem_coitem_itemsite_id) " "WHERE ( (raitem_rahead_id=:rahead_id)" " AND (itemsite_warehous_id <> :warehous_id) )" "LIMIT 1;"); whsq.bindValue(":rahead_id", _raheadid); whsq.bindValue(":warehous_id", _shipWhs->id()); whsq.exec(); if (whsq.first()) QMessageBox::information(this, tr("Shipping Site Warning"), tr("This Return Authorization has line items with a different Shipping Site. " "You may need to review the line items.")); } } void returnAuthorization::sDispositionChanged() { _new->setEnabled(_cust->isValid() || (_disposition->currentIndex() == 1 && _creditBy->currentIndex() == 0)); bool enableReceipt = _privileges->check("EnterReceipts") && (_disposition->currentIndex() != 0); _receiveAll->setEnabled(enableReceipt); _postReceipts->setEnabled(enableReceipt); if (_disposition->currentIndex() == 0) { _timing->setCurrentIndex(0); _timing->setEnabled(FALSE); if (_creditBy->currentIndex() == 0) _creditBy->setCurrentIndex(1); } else _timing->setEnabled(TRUE); _refund->setEnabled(_creditBy->currentIndex() == 3); if (!_ignoreSoSignals) { // Save the change so that disposition of raitems is changed sSave(true); sFillList(); } } void returnAuthorization::sCreditByChanged() { if (_creditBy->currentIndex() == 0 && _total->localValue() > 0) { QMessageBox::information(this, tr("Credit By 'None' not allowed"), tr("

    This Return Authorization has authorized " "credit amounts. You may not set the Credit By " "to 'None' unless all credit amounts are zero.")); _creditBy->setCurrentIndex(1); } else if (_creditBy->currentIndex() == 0 || _total->localValue() == 0) { _currency->setEnabled(true); _miscChargeDescription->setEnabled(false); _miscChargeAccount->setEnabled(false); _miscCharge->setEnabled(false); _freight->setEnabled(false); } else { _currency->setEnabled(false); _miscChargeDescription->setEnabled(true); _miscChargeAccount->setEnabled(true); _miscCharge->setEnabled(true); _freight->setEnabled(true); } } void returnAuthorization::sAuthorizeLine() { XSqlQuery returnAuthorizeLine; QList selected = _raitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { QString sql ( "SELECT authReturnItem(:raitem_id) AS result;" ); returnAuthorizeLine.prepare(sql); returnAuthorizeLine.bindValue(":raitem_id", ((XTreeWidgetItem*)(selected[i]))->id()); returnAuthorizeLine.exec(); if (returnAuthorizeLine.lastError().type() != QSqlError::NoError) { systemError(this, returnAuthorizeLine.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_newso->isValid()) omfgThis->sSalesOrdersUpdated(_newso->id()); sFillList(); } void returnAuthorization::sClearAuthorization() { XSqlQuery returnClearAuthorization; QList selected = _raitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { returnClearAuthorization.prepare ( "SELECT clearReturnItem(:raitem_id) AS result;" ); returnClearAuthorization.bindValue(":raitem_id", ((XTreeWidgetItem*)(selected[i]))->id()); returnClearAuthorization.exec(); if (returnClearAuthorization.lastError().type() != QSqlError::NoError) { systemError(this, returnClearAuthorization.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_newso->isValid()) omfgThis->sSalesOrdersUpdated(_newso->id()); sFillList(); } void returnAuthorization::sAuthorizeAll() { XSqlQuery returnAuthorizeAll; QString sql ( "SELECT authReturnItem(raitem_id) AS result " "FROM raitem " "WHERE (raitem_rahead_id=:raitem_rahead_id);" ); returnAuthorizeAll.prepare(sql); returnAuthorizeAll.bindValue(":raitem_rahead_id", _raheadid); returnAuthorizeAll.exec(); if (returnAuthorizeAll.lastError().type() != QSqlError::NoError) { systemError(this, returnAuthorizeAll.lastError().databaseText(), __FILE__, __LINE__); return; } if (_newso->isValid()) omfgThis->sSalesOrdersUpdated(_newso->id()); sFillList(); } void returnAuthorization::sEnterReceipt() { XSqlQuery returnEnterReceipt; ParameterList params; returnEnterReceipt.prepare("SELECT * " "FROM recv " "WHERE ((recv_orderitem_id=:id)" " AND (recv_order_type = 'RA')" " AND (NOT recv_posted));"); returnEnterReceipt.bindValue(":id", _raitem->id()); returnEnterReceipt.exec(); if (returnEnterReceipt.first()) { params.append("recv_id", returnEnterReceipt.value("recv_id")); params.append("mode", "edit"); } else if (returnEnterReceipt.lastError().type() != QSqlError::NoError) { systemError(this, returnEnterReceipt.lastError().databaseText(), __FILE__, __LINE__); return; } else { params.append("lineitem_id", _raitem->id()); params.append("order_type", "RA"); params.append("mode", "new"); } enterPoitemReceipt newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void returnAuthorization::sReceiveAll() { XSqlQuery returnReceiveAll; ParameterList params; params.append("orderid", _raheadid); params.append("ordertype", "RA"); params.append("nonInventory", tr("Non-Inventory")); params.append("na", tr("N/A")); params.append("EnableReturnAuth", TRUE); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); MetaSQLQuery recvm = mqlLoad("receipt", "receiveAll"); returnReceiveAll = recvm.toQuery(params); while (returnReceiveAll.next()) { int result = returnReceiveAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("enterReceipt", result), __FILE__, __LINE__); return; } omfgThis->sPurchaseOrderReceiptsUpdated(); } if (returnReceiveAll.lastError().type() != QSqlError::NoError) { systemError(this, returnReceiveAll.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void returnAuthorization::sHandleEnterReceipt(bool p) { if (p) _enterReceipt->setEnabled(_raitem->altId() == 1 || _raitem->altId() == 2 || _raitem->altId() == 3); else _enterReceipt->setEnabled(false); } void returnAuthorization::sHandleAction() { QList selected = _raitem->selectedItems(); if (selected.size() > 1) { _action->setText("Close"); _action->setEnabled(FALSE); } else if (_raitem->altId() == -1) { _action->setText("Open"); _edit->setEnabled(FALSE); } else { _action->setText("Close"); _edit->setEnabled(TRUE); } } void returnAuthorization::sAction() { XSqlQuery returnAction; returnAction.prepare("UPDATE raitem SET " "raitem_status = :status " "WHERE (raitem_id=:raitem_id); "); returnAction.bindValue(":raitem_id", _raitem->id()); if (_raitem->altId() == -1) returnAction.bindValue(":status",QString("O")); else returnAction.bindValue(":status",QString("C")); returnAction.exec(); if (returnAction.lastError().type() != QSqlError::NoError) { systemError(this, returnAction.lastError().databaseText(), __FILE__, __LINE__); return; } else sFillList(); } void returnAuthorization::sHandleSalesOrderEvent(int pSoheadid, bool) { if ((pSoheadid == _origso->id()) || (pSoheadid == _newso->id())) { sFillList(); } } void returnAuthorization::sRefund() { if (! sSave(true)) return; XSqlQuery begin("BEGIN;"); bool _post = _disposition->currentIndex() == 0 && _timing->currentIndex() == 0 && _creditBy->currentIndex() == 3; XSqlQuery cmq; cmq.prepare("SELECT createRaCreditMemo(:rahead_id,:post) AS result;"); cmq.bindValue(":rahead_id", _raheadid); cmq.bindValue(":post", QVariant(_post)); cmq.exec(); if (cmq.first()) { int cmheadid = cmq.value("result").toInt(); ParameterList ccp; ccp.append("cmhead_id", cmheadid); MetaSQLQuery ccm = mqlLoad("creditMemoCreditCards", "detail"); XSqlQuery ccq = ccm.toQuery(ccp); if (ccq.first()) { int ccpayid = ccq.value("ccpay_id").toInt(); QMessageBox::information( this, tr("New Credit Memo Created"), tr("

    A new CreditMemo has been created and " "assigned #%1") .arg(ccq.value("cmhead_number").toString())); CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (! cardproc) ErrorReporter::error(QtCriticalMsg, this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg(), __FILE__, __LINE__); else { QString docnum = ccq.value("cmhead_number").toString(); QString refnum = ccq.value("cohead_number").toString(); QString reftype; int refid = -1; if(_post) { reftype = "aropen"; XSqlQuery arq; arq.prepare("SELECT aropen_id FROM aropen" " WHERE aropen_doctype='C'" " AND aropen_docnumber=:cmhead_number;"); arq.bindValue(":cmhead_number", docnum); arq.exec(); if (arq.first()) refid = arq.value("aropen_id").toInt(); else if (arq.lastError().type() != QSqlError::NoError) { XSqlQuery rollback("ROLLBACK;"); ErrorReporter::error(QtCriticalMsg, this, tr("Getting A/R Open"), ccq, __FILE__, __LINE__); return; } } else { refid = cmheadid; reftype = "cmhead"; } int returnValue = cardproc->credit(ccq.value("ccard_id").toInt(), _CCCVV->text(), ccq.value("total").toDouble(), ccq.value("tax_in_cmcurr").toDouble(), ccq.value("cmhead_tax_id").isNull(), ccq.value("cmhead_freight").toDouble(), 0, ccq.value("cmhead_curr_id").toInt(), docnum, refnum, ccpayid, reftype, refid); if (returnValue < 0) { QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); XSqlQuery rollback("ROLLBACK;"); return; } else if (returnValue > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (! cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); } } else if (ccq.lastError().type() != QSqlError::NoError) { systemError(this, ccq.lastError().databaseText(), __FILE__, __LINE__); XSqlQuery rollback("ROLLBACK;"); return; } else { QMessageBox::critical(this, tr("Credit Card Processing Error"), tr("Could not find a Credit Card to use for " "this Credit transaction.")); XSqlQuery rollback("ROLLBACK;"); return; } } else if (cmq.lastError().type() != QSqlError::NoError) { XSqlQuery rollback("ROLLBACK;"); ErrorReporter::error(QtCriticalMsg, this, tr("Creating R/A Credit Memo"), cmq, __FILE__, __LINE__); return; } XSqlQuery commit("COMMIT;"); } void returnAuthorization::sPopulateMenu( QMenu * pMenu, QTreeWidgetItem *selected) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Line..."), this, SLOT(sEdit())); if (((XTreeWidgetItem *)selected)->rawValue("raitem_status").toString() == "O") menuItem = pMenu->addAction(tr("Close Line..."), this, SLOT(sAction())); if (((XTreeWidgetItem *)selected)->rawValue("raitem_status").toString() == "C") menuItem = pMenu->addAction(tr("Open Line..."), this, SLOT(sAction())); menuItem = pMenu->addAction(tr("Delete Line..."), this, SLOT(sDelete())); pMenu->addSeparator(); if (((XTreeWidgetItem *)selected)->id("oldcohead_number") > -1) { pMenu->addAction(tr("View Original Order..."), this, SLOT(sViewOrigOrder())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); } pMenu->addSeparator(); if (((XTreeWidgetItem *)selected)->id("newcohead_number") > -1) { menuItem = pMenu->addAction(tr("Edit New Order..."), this, SLOT(sEditNewOrder())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); pMenu->addAction(tr("View New Order..."), this, SLOT(sViewNewOrder())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit New Order Line..."), this, SLOT(sEditNewOrderLine())); menuItem->setEnabled(_privileges->check("MaintainSalesOrders")); pMenu->addAction(tr("View New Order Line..."), this, SLOT(sViewNewOrderLine())); menuItem->setEnabled(_privileges->check("ViewSalesOrders")); pMenu->addSeparator(); pMenu->addAction(tr("New Order Shipment Status..."), this, SLOT(sShipmentStatus())); pMenu->addAction(tr("New Order Shipments..."), this, SLOT(sShipment())); } } void returnAuthorization::sViewOrigOrder() { salesOrder::viewSalesOrder(_origso->id()); } void returnAuthorization::sEditNewOrder() { salesOrder::editSalesOrder(_newso->id(), false); } void returnAuthorization::sViewNewOrder() { salesOrder::viewSalesOrder(_newso->id()); } void returnAuthorization::sEditNewOrderLine() { XSqlQuery returnEditNewOrderLine; returnEditNewOrderLine.prepare("SELECT coitem_id, cohead_number, " " cohead_curr_id, cohead_orderdate " "FROM raitem, cohead, coitem " "WHERE ((raitem_id=:raitem_id) " "AND (raitem_new_coitem_id=coitem_id) " "AND (coitem_cohead_id=cohead_id));"); returnEditNewOrderLine.bindValue(":raitem_id", _raitem->id()); returnEditNewOrderLine.exec(); if (returnEditNewOrderLine.first()) { ParameterList params; params.append("soitem_id", returnEditNewOrderLine.value("coitem_id").toInt()); params.append("cust_id", _cust->id()); params.append("orderNumber", returnEditNewOrderLine.value("cohead_number").toString()); params.append("curr_id", returnEditNewOrderLine.value("cohead_curr_id").toInt()); params.append("orderDate", returnEditNewOrderLine.value("cohead_orderdate").toDate()); params.append("mode", "edit"); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } } void returnAuthorization::sViewNewOrderLine() { XSqlQuery returnViewNewOrderLine; returnViewNewOrderLine.prepare("SELECT coitem_id, cohead_number, " " cohead_curr_id, cohead_orderdate " "FROM raitem, cohead, coitem " "WHERE ((raitem_id=:raitem_id) " "AND (raitem_new_coitem_id=coitem_id) " "AND (coitem_cohead_id=cohead_id));"); returnViewNewOrderLine.bindValue(":raitem_id", _raitem->id()); returnViewNewOrderLine.exec(); if (returnViewNewOrderLine.first()) { ParameterList params; params.append("soitem_id", returnViewNewOrderLine.value("coitem_id").toInt()); params.append("cust_id", _cust->id()); params.append("orderNumber", returnViewNewOrderLine.value("cohead_number").toString()); params.append("curr_id", returnViewNewOrderLine.value("cohead_curr_id").toInt()); params.append("orderDate", returnViewNewOrderLine.value("cohead_orderdate").toDate()); params.append("mode", "view"); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } } void returnAuthorization::sShipmentStatus() { ParameterList params; params.append("sohead_id", _newso->id()); params.append("run"); dspSalesOrderStatus *newdlg = new dspSalesOrderStatus(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void returnAuthorization::sShipment() { ParameterList params; params.append("sohead_id", _newso->id() ); dspShipmentsBySalesOrder* newdlg = new dspShipmentsBySalesOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void returnAuthorization::sCheckNumber() { XSqlQuery returnCheckNumber; returnCheckNumber.prepare( "SELECT rahead_id " "FROM rahead " "WHERE (rahead_number=:rahead_number);" ); returnCheckNumber.bindValue(":rahead_number", _authNumber->text()); returnCheckNumber.exec(); if (returnCheckNumber.first()) { _mode = cEdit; _raheadid = returnCheckNumber.value("rahead_id").toInt(); populate(); _authNumber->setEnabled(FALSE); _cust->setReadOnly(TRUE); } else if (returnCheckNumber.lastError().type() != QSqlError::NoError) { systemError(this, returnCheckNumber.lastError().databaseText(), __FILE__, __LINE__); return; } sSave(true); sFillList(); } void returnAuthorization::sFreightChanged() { if (_freight->localValue() == _freightCache) return; if (_freight->isEnabled()) { if (_calcfreight) { int answer; answer = QMessageBox::question(this, tr("Manual Freight?"), tr("

    Manually editing the freight will disable " "automatic Freight recalculations. Are you " "sure you want to do this?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::Yes) _calcfreight = false; else { disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(_freightCache); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } } else if ( (!_calcfreight) && (_freight->localValue() == 0) && (_metrics->boolean("CalculateFreight"))) { int answer; answer = QMessageBox::question(this, tr("Automatic Freight?"), tr("

    Manually clearing the freight will enable " "automatic Freight recalculations. Are you " "sure you want to do this?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::Yes) { _calcfreight = true; disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(_freightCache); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } } else _freightCache = _freight->localValue(); } sSave(true); sCalculateTax(); sCalculateTotal(); } void returnAuthorization::sFreightDetail() { ParameterList params; params.append("calcfreight", _calcfreight); params.append("order_type", "RA"); params.append("order_id", _raheadid); params.append("document_number", _authNumber->text()); params.append("cust_id", _cust->id()); params.append("shipto_id", _shipTo->id()); params.append("orderdate", _authDate->date()); params.append("shipvia", ""); params.append("curr_id", _currency->id()); // mode => view since there are no fields to hold modified freight data params.append("mode", "view"); freightBreakdown newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/returnAuthorization.h000066400000000000000000000060201217451700100216440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RETURNAUTHORIZATION_H #define RETURNAUTHORIZATION_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_returnAuthorization.h" class returnAuthorization : public XWidget, public Ui::returnAuthorization { Q_OBJECT public: returnAuthorization(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~returnAuthorization(); virtual void setNumber(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCalculateTax(); virtual bool sSave( bool partial ); virtual void sSaveClick(); virtual void populateShipto( int pShiptoid ); virtual void sPopulateCustomerInfo(); virtual void sCheckAuthorizationNumber(); virtual void sClearShiptoNumber(); virtual void sCopyToShipto(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sAction(); virtual void sDelete(); virtual void sFillList(); virtual void sCalculateSubtotal(); virtual void sCalculateTotal(); virtual void sCalculateNetDue(); virtual void populate(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sTaxZoneChanged(); virtual void sRecvWhsChanged(); virtual void sShipWhsChanged(); virtual void sTaxDetail(); virtual void sOrigSoChanged(); virtual void sDispositionChanged(); virtual void sCreditByChanged(); virtual void sAuthorizeLine(); virtual void sClearAuthorization(); virtual void sAuthorizeAll(); virtual void sEnterReceipt(); virtual void sReceiveAll(); virtual void sHandleEnterReceipt(bool); virtual void sHandleAction(); virtual void sHandleSalesOrderEvent( int pSoheadid, bool ); virtual void sRefund(); virtual void sPostReceipts(); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem *selected); virtual void sViewOrigOrder(); virtual void sEditNewOrder(); virtual void sViewNewOrder(); virtual void sEditNewOrderLine(); virtual void sViewNewOrderLine(); virtual void sShipment(); virtual void sShipmentStatus(); virtual void sCheckNumber(); virtual void sFreightChanged(); virtual void sFreightDetail(); protected slots: virtual void languageChange(); signals: void saved(int); private: int _mode; int _raheadid; int _custtaxzoneid; bool _custEmail; bool _ffBillto; bool _ffShipto; bool _ignoreShiptoSignals; bool _ignoreSoSignals; bool _ignoreWhsSignals; bool _saved; bool _calcfreight; double _subtotalCache; double _freightCache; }; #endif // RETURNAUTHORIZATION_H qt-client-4.1.0/guiclient/returnAuthorization.ui000066400000000000000000001601401217451700100220360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. returnAuthorization 0 0 993 599 0 0 Return Authorization 0 Qt::Horizontal 40 20 &Save &Cancel 0 &Header Information 2 Auth. #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 0 20 Auth. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Expire Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Sales Rep.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Commission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billToAddr 0 0 200 16777215 XComboBox::SalesReps 0 0 40 19 Qt::AlignRight 0 0 % Qt::AlignVCenter _billToAddr 0 0 200 16777215 true None XComboBox::TaxZones Qt::Horizontal 0 20 Disposition: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Credit Return Replace Service Substitute [ no default ] Credit/Ship: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Immediately Upon Receipt [ no default ] Credit by: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true None Credit Memo Check Credit Card [ no default ] Qt::Horizontal 0 20 Recv. Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse 200 16777215 Qt::WheelFocus true None Ship Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 16777215 true None Reason Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 16777215 XComboBox::ReturnReasonCodes Print on Save Shipping Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Sale Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::ShippingZones XComboBox::SaleTypes Qt::Horizontal Original Order #: Qt::Horizontal false false Qt::Horizontal 0 20 false New Order #: Qt::Horizontal false false Qt::Horizontal 0 20 Qt::StrongFocus Project #: false Qt::Horizontal Bill To 2 0 32 16777215 32 QFrame::NoFrame QFrame::Raised 0 false false Qt::Horizontal Qt::Horizontal QSizePolicy::Expanding 4 17 true Copy to Ship-from -> Cust. Type: Undefined Qt::Horizontal QSizePolicy::Expanding 0 0 16777215 16777215 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billToName true true Qt::StrongFocus Ship To 2 0 32 16777215 32 QFrame::NoFrame QFrame::Raised 0 Ship From# false false Qt::Horizontal Qt::Horizontal 0 20 0 0 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipToName true true Qt::StrongFocus Cust. PO #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Incident: Qt::Horizontal Qt::Horizontal 31 0 &Line Items 0 1 Qt::StrongFocus QAbstractItemView::SingleSelection true &New false &Edit false Qt::ClickFocus &View false Qt::ClickFocus Close false &Delete false Qt::ClickFocus Authorize &Line false Qt::ClickFocus Clear Authori&zation true Qt::ClickFocus &Authorize All false Qt::ClickFocus Enter &Receipt... true Qt::ClickFocus Rece&ive All Qt::ClickFocus &Post Receipts Qt::Vertical 20 40 false Qt::ClickFocus Re&fund CVV Code: 0 0 Qt::StrongFocus 0 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false XComboBox::Currencies Qt::Horizontal 40 20 Subtotal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 0 Misc. Charge Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Misc. Charge: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true false false false false Misc. Charge Credit Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false false Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Total Credit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Net Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 N&otes Co&mments Comments::Uninitialized AddressCluster QWidget

    addresscluster.h
    Comments QWidget
    comments.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    CustCluster QWidget
    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    GLCluster QWidget
    glcluster.h
    IncidentCluster QWidget
    incidentcluster.h
    OrderCluster QWidget
    ordercluster.h
    ProjectCluster QWidget
    projectcluster.h
    ShiptoCluster QWidget
    shiptocluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _authNumber _authDate _expireDate _rsnCode _salesRep _commission _taxzone _shippingZone _disposition _timing _creditBy _saleType _warehouse _shipWhs _printRA _origso _newso _project _cust _copyToShipto _shipTo _billToName _billToAddr _shipToName _shipToAddr _customerPO _incident _currency _miscChargeDescription _miscChargeAccount _miscCharge _freight _total _CCCVV _new _edit _view _action _delete _authorizeLine _clearAuthorization _authorizeAll _enterReceipt _receiveAll _postReceipts _refund _raitem _save _notes _cancel _returnAuthInformation _raitem itemSelected(int) _edit animateClick() 341 242 722 131 _cancel clicked() returnAuthorization close() 752 43 399 299 _authDate newDate(QDate) _miscCharge setEffective(QDate) 184 131 206 265 _authDate newDate(QDate) _total setEffective(QDate) 184 131 206 265 _authDate newDate(QDate) _tax setEffective(QDate) 184 131 206 265 _authDate newDate(QDate) _freight setEffective(QDate) 184 131 206 265 _authDate newDate(QDate) _subtotal setEffective(QDate) 184 131 206 265 _raitem valid(bool) _delete setEnabled(bool) 206 265 206 265 _raitem valid(bool) _edit setEnabled(bool) 206 265 206 265 _currency newID(int) _total setId(int) 206 265 206 265 _currency newID(int) _tax setId(int) 206 265 206 265 _currency newID(int) _subtotal setId(int) 206 265 206 265 _currency newID(int) _miscCharge setId(int) 206 265 206 265 _currency newID(int) _freight setId(int) 206 265 206 265 _raitem valid(bool) _authorizeLine setEnabled(bool) 345 241 727 207 _raitem valid(bool) _clearAuthorization setEnabled(bool) 345 241 727 230 _raitem valid(bool) _action setEnabled(bool) 294 227 631 153 _raitem valid(bool) _view setEnabled(bool) 294 227 631 153 qt-client-4.1.0/guiclient/returnAuthorizationItem.cpp000066400000000000000000002150441217451700100230260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "returnAuthorizationItem.h" #include #include #include #include #include "priceList.h" #include "taxDetail.h" #include "storedProcErrorLookup.h" #include "returnAuthItemLotSerial.h" returnAuthorizationItem::returnAuthorizationItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery returnreturnAuthorizationItem; setupUi(this); #ifndef Q_WS_MAC _listPrices->setMaximumWidth(25); _saleListPrices->setMaximumWidth(25); #endif _coitemid = -1; _coitemitemsiteid = -1; _costmethod = ""; _creditmethod = ""; _crmacctid = -1; _custid = -1; _dispositionCache = -1; _invuomid = -1; _mode = cNew; _orderId = -1; _origsoid = -1; _preferredShipWarehousid = -1; _preferredWarehousid = -1; _priceRatio = 1.0; _priceinvuomratio = 1.0; _qtyAuthCache = 0.0; _qtycredited = 0; _qtyinvuomratio = 1.0; _raheadid = -1; _raitemid = -1; _shiptoid = -1; _soldQty = 0; _status = "O"; _taxzoneid = -1; _unitcost = 0; // order and id are important. don't change them without makeing adjustments below _disposition->append(0, tr("Credit"), "C"); _disposition->append(1, tr("Return"), "R"); _disposition->append(2, tr("Replace"), "P"); _disposition->append(3, tr("Service"), "V"); _disposition->append(4, tr("Ship"), "S"); connect(_discountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_saleDiscountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateSaleFromDiscount())); connect(_extendedPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateTax())); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo())); connect(_item, SIGNAL(warehouseIdChanged(int)), this, SLOT(sPopulateItemsiteInfo())); connect(_shipWhs, SIGNAL(newID(int)), this, SLOT(sPopulateItemsiteInfo())); connect(_listPrices, SIGNAL(clicked()), this, SLOT(sListPrices())); connect(_saleListPrices, SIGNAL(clicked()), this, SLOT(sSaleListPrices())); connect(_netUnitPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateDiscountPrcnt())); connect(_netUnitPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateExtendedPrice())); connect(_netUnitPrice, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup())); connect(_saleNetUnitPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateSaleDiscountPrcnt())); connect(_saleNetUnitPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateSaleExtendedPrice())); connect(_qtyAuth, SIGNAL(textChanged(const QString&)), this, SLOT(sCalculateExtendedPrice())); connect(_qtyAuth, SIGNAL(textChanged(const QString&)), this, SLOT(sCalculateSaleExtendedPrice())); connect(_qtyAuth, SIGNAL(textChanged(const QString&)), this, SLOT(sPopulateOrderInfo())); connect(_qtyAuth, SIGNAL(textChanged(const QString&)), this, SLOT(sCalcWoUnitCost())); connect(_save, SIGNAL(clicked()), this, SLOT(sSaveClicked())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_taxType, SIGNAL(newID(int)), this, SLOT(sCalculateTax())); connect(_qtyUOM, SIGNAL(newID(int)), this, SLOT(sQtyUOMChanged())); connect(_qtyUOM, SIGNAL(newID(int)), this, SLOT(sPopulateOrderInfo())); connect(_pricingUOM, SIGNAL(newID(int)), this, SLOT(sPriceUOMChanged())); connect(_disposition, SIGNAL(newID(int)), this, SLOT(sDispositionChanged())); connect(_shipWhs, SIGNAL(newID(int)), this, SLOT(sDetermineAvailability())); connect(_scheduledDate, SIGNAL(newDate(const QDate&)), this, SLOT(sDetermineAvailability())); connect(_qtyAuth, SIGNAL(editingFinished()), this, SLOT(sDetermineAvailability())); connect(_createOrder, SIGNAL(toggled(bool)), this, SLOT(sHandleWo(bool))); connect(_showAvailability, SIGNAL(toggled(bool)), this, SLOT(sDetermineAvailability())); connect(this, SIGNAL(rejected()), this, SLOT(rejectEvent())); connect(_authLotSerial, SIGNAL(toggled(bool)), _qtyUOM, SLOT(setDisabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _raitemls->addColumn(tr("Lot/Serial"), -1, Qt::AlignLeft , true, "ls_number" ); _raitemls->addColumn(tr("Warranty"), _dateColumn, Qt::AlignRight, true, "lsreg_expiredate" ); _raitemls->addColumn(tr("Registered"), _qtyColumn, Qt::AlignRight, true, "raitemls_qtyregistered" ); _raitemls->addColumn(tr("Authorized"), _qtyColumn, Qt::AlignRight, true, "raitemls_qtyauthorized" ); _raitemls->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "raitemls_qtyreceived" ); _item->setType(ItemLineEdit::cSold | ItemLineEdit::cActive); _item->addExtraClause( QString("(itemsite_active)") ); // ItemLineEdit::cActive doesn't compare against the itemsite record _item->addExtraClause( QString("(itemsite_sold)") ); // ItemLineEdit::cSold doesn't compare against the itemsite record _orderQty->setValidator(omfgThis->qtyVal()); _qtyAuth->setValidator(omfgThis->qtyVal()); _discountFromSale->setValidator(omfgThis->negPercentVal()); _saleDiscountFromSale->setValidator(omfgThis->negPercentVal()); _taxType->setEnabled(_privileges->check("OverrideTax")); _availabilityGroup->setEnabled(_showAvailability->isChecked()); _qtySold->setPrecision(omfgThis->qtyVal()); _qtyReceived->setPrecision(omfgThis->qtyVal()); _qtyShipped->setPrecision(omfgThis->qtyVal()); _onHand->setPrecision(omfgThis->qtyVal()); _allocated->setPrecision(omfgThis->qtyVal()); _unallocated->setPrecision(omfgThis->qtyVal()); _onOrder->setPrecision(omfgThis->qtyVal()); _available->setPrecision(omfgThis->qtyVal()); _discountFromList->setPrecision(omfgThis->percentVal()); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); _shipWhs->hide(); _shipWhsLit->hide(); } //Remove lot/serial if no lot/serial tracking if (!_metrics->boolean("LotSerialControl")) _tab->removeTab(_tab->indexOf(_lotserial)); adjustSize(); _altcosAccntid->setType(GLCluster::cRevenue | GLCluster::cExpense); returnreturnAuthorizationItem.exec("BEGIN;"); //In case problems or we cancel out } returnAuthorizationItem::~returnAuthorizationItem() { // no need to delete child widgets, Qt does it all for us } void returnAuthorizationItem::languageChange() { retranslateUi(this); } enum SetResponse returnAuthorizationItem::set(const ParameterList &pParams) { XSqlQuery returnet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("rahead_id", &valid); if (valid) { _raheadid = param.toInt(); returnet.prepare("SELECT *, " " COALESCE(cust_preferred_warehous_id,-1) AS prefwhs, " " COALESCE(rahead_orig_cohead_id,-1) AS cohead_id, " " crmacct_id " "FROM rahead, custinfo, crmacct " "WHERE ( (rahead_cust_id=cust_id) " "AND (rahead_id=:rahead_id) " "AND (rahead_cust_id=crmacct_cust_id) );"); returnet.bindValue(":rahead_id", _raheadid); returnet.exec(); if (returnet.first()) { _authNumber->setText(returnet.value("rahead_number").toString()); _taxzoneid = returnet.value("rahead_taxzone_id").toInt(); _tax->setId(returnet.value("rahead_curr_id").toInt()); _rsnCode->setId(returnet.value("rahead_rsncode_id").toInt()); _custid = returnet.value("rahead_cust_id").toInt(); _shiptoid = returnet.value("rahead_shipto_id").toInt(); _netUnitPrice->setId(returnet.value("rahead_curr_id").toInt()); _netUnitPrice->setEffective(returnet.value("rahead_authdate").toDate()); _saleNetUnitPrice->setId(returnet.value("rahead_curr_id").toInt()); _saleNetUnitPrice->setEffective(returnet.value("rahead_authdate").toDate()); _preferredWarehousid = returnet.value("prefwhs").toInt(); _creditmethod = returnet.value("rahead_creditmethod").toString(); _crmacctid = returnet.value("crmacct_id").toInt(); } else if (returnet.lastError().type() != QSqlError::NoError) { systemError(this, returnet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("warehous_id", &valid); if (valid) { _preferredWarehousid = param.toInt(); _warehouse->setId(_preferredWarehousid); } param = pParams.value("shipwarehous_id", &valid); if (valid) { _preferredShipWarehousid = param.toInt(); _shipWhs->setId(_preferredShipWarehousid); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; connect(_discountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_saleDiscountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateSaleFromDiscount())); returnet.prepare( "SELECT (COALESCE(MAX(raitem_linenumber), 0) + 1) AS n_linenumber " "FROM raitem " "WHERE (raitem_rahead_id=:rahead_id);" ); returnet.bindValue(":rahead_id", _raheadid); returnet.exec(); if (returnet.first()) _lineNumber->setText(returnet.value("n_linenumber").toString()); else if (returnet.lastError().type() == QSqlError::NoError) { systemError(this, returnet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } returnet.prepare( "SELECT rahead_disposition " "FROM rahead " "WHERE (rahead_id=:rahead_id);" ); returnet.bindValue(":rahead_id", _raheadid); returnet.exec(); if (returnet.first()) { _disposition->setCode(returnet.value("rahead_disposition").toString()); } else if (returnet.lastError().type() == QSqlError::NoError) { systemError(this, returnet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _origSoNumber->hide(); _origSoNumberLit->hide(); _origSoLineNumber->hide(); _origSoLineNumberLit->hide(); _newSoNumber->hide(); _newSoNumberLit->hide(); _newSoLineNumber->hide(); _newSoLineNumberLit->hide(); _qtySold->hide(); _qtySoldLit->hide(); _discountFromSalePrcntLit->hide(); _discountFromSale->hide(); _salePrice->hide(); _salePriceLit->hide(); _comments->setType(Comments::ReturnAuthItem); _comments->setReadOnly(true); } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _shipWhs->setEnabled(FALSE); _comments->setType(Comments::ReturnAuthItem); _comments->setReadOnly(false); connect(_discountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_saleDiscountFromSale, SIGNAL(editingFinished()), this, SLOT(sCalculateSaleFromDiscount())); } else if (param.toString() == "view") { _mode = cView; _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _shipWhs->setEnabled(FALSE); _disposition->setEnabled(FALSE); _qtyAuth->setEnabled(FALSE); _qtyUOM->setEnabled(FALSE); _netUnitPrice->setEnabled(FALSE); _saleNetUnitPrice->setEnabled(FALSE); _listPrices->setEnabled(FALSE); _saleListPrices->setEnabled(FALSE); _pricingUOM->setEnabled(FALSE); _salePricingUOM->setEnabled(FALSE); _discountFromSale->setEnabled(FALSE); _saleDiscountFromSale->setEnabled(FALSE); _notes->setReadOnly(TRUE); _taxType->setEnabled(FALSE); _rsnCode->setEnabled(FALSE); _altcosAccntid->setEnabled(FALSE); _showAvailability->setEnabled(FALSE); _createOrder->setEnabled(FALSE); _scheduledDate->setEnabled(FALSE); _warranty->setEnabled(FALSE); _comments->setType(Comments::ReturnAuthItem); _comments->setReadOnly(TRUE); _save->hide(); _close->setText(tr("&Close")); } } param = pParams.value("orig_cohead_id", &valid); if (valid) _origsoid = param.toInt(); param = pParams.value("raitem_id", &valid); if (valid) { _raitemid = param.toInt(); populate(); } return NoError; } void returnAuthorizationItem::sSaveClicked() { XSqlQuery returnSaveClicked; if (sSave()) { returnSaveClicked.exec("COMMIT;"); done(_raitemid); } } bool returnAuthorizationItem::sSave() { XSqlQuery returnSave; if (!(_scheduledDate->isValid()) && _scheduledDate->isEnabled()) { QMessageBox::warning( this, windowTitle(), tr("

    You must enter a valid Schedule Date.") ); _scheduledDate->setFocus(); return false; } if ( (_coitemid != -1) && (_qtyAuth->toDouble() > _soldQty) ) if (QMessageBox::question(this, tr("Over Authorize"), tr("

    The authorized quantity exceeds " "the original sold quantity on the " "original Sales Order. " "Do you want to correct the quantity?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { _qtyAuth->setFocus(); return false; } if (_mode == cNew) { returnSave.exec("SELECT NEXTVAL('raitem_raitem_id_seq') AS _raitem_id"); if (returnSave.first()) { _raitemid = returnSave.value("_raitem_id").toInt(); _comments->setId(_raitemid); } else if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); reject(); } returnSave.prepare( "INSERT INTO raitem " "( raitem_id, raitem_rahead_id, raitem_linenumber, raitem_itemsite_id," " raitem_disposition, raitem_qtyauthorized, " " raitem_qty_uom_id, raitem_qty_invuomratio," " raitem_price_uom_id, raitem_price_invuomratio," " raitem_unitprice, raitem_taxtype_id, " " raitem_notes, raitem_rsncode_id, raitem_cos_accnt_id, " " raitem_scheddate, raitem_warranty, raitem_coitem_itemsite_id, " " raitem_saleprice, raitem_unitcost, raitem_custpn ) " "SELECT :raitem_id, :rahead_id, :raitem_linenumber, rcv.itemsite_id," " :raitem_disposition, :raitem_qtyauthorized," " :qty_uom_id, :qty_invuomratio," " :price_uom_id, :price_invuomratio," " :raitem_unitprice, :raitem_taxtype_id, " " :raitem_notes, :raitem_rsncode_id, :raitem_cos_accnt_id, " " :raitem_scheddate, :raitem_warranty, shp.itemsite_id, " " :raitem_saleprice, :raitem_unitcost, :raitem_custpn " "FROM itemsite rcv " " LEFT OUTER JOIN itemsite shp ON " " (shp.itemsite_item_id=rcv.itemsite_item_id) " " AND (shp.itemsite_warehous_id=COALESCE(:shipWhs_id,-1)) " "WHERE ( (rcv.itemsite_item_id=:item_id)" " AND (rcv.itemsite_warehous_id=:warehous_id) );" ); } else { returnSave.prepare( "UPDATE raitem " "SET raitem_disposition=:raitem_disposition, " " raitem_qtyauthorized=:raitem_qtyauthorized, " " raitem_qty_uom_id=:qty_uom_id," " raitem_qty_invuomratio=:qty_invuomratio," " raitem_price_uom_id=:price_uom_id," " raitem_price_invuomratio=:price_invuomratio," " raitem_unitprice=:raitem_unitprice," " raitem_taxtype_id=:raitem_taxtype_id, " " raitem_notes=:raitem_notes," " raitem_rsncode_id=:raitem_rsncode_id, " " raitem_cos_accnt_id=:raitem_cos_accnt_id, " " raitem_scheddate=:raitem_scheddate, " " raitem_warranty=:raitem_warranty, " " raitem_saleprice=:raitem_saleprice, " " raitem_coitem_itemsite_id=:coitem_itemsite_id, " " raitem_unitcost=:raitem_unitcost, " " raitem_custpn=:raitem_custpn " "WHERE (raitem_id=:raitem_id);" ); if (_disposition->code() == "P" || _disposition->code() == "V" || _disposition->code() == "S") { XSqlQuery coitemsite; coitemsite.prepare("SELECT itemsite_id " "FROM itemsite " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) " " AND (itemsite_active) " " AND (itemsite_sold));"); coitemsite.bindValue(":item_id", _item->id()); coitemsite.bindValue(":warehous_id",_shipWhs->id()); coitemsite.exec(); if (coitemsite.first()) _coitemitemsiteid=coitemsite.value("itemsite_id").toInt(); else { QMessageBox::critical( this, tr("Item site not found"), tr("

    No valid item site record was found for the selected " "item at the selected shipping site.") ); return false; } returnSave.bindValue(":coitem_itemsite_id",_coitemitemsiteid); } } returnSave.bindValue(":raitem_id", _raitemid); returnSave.bindValue(":rahead_id", _raheadid); returnSave.bindValue(":raitem_linenumber", _lineNumber->text().toInt()); returnSave.bindValue(":raitem_qtyauthorized", _qtyAuth->toDouble()); returnSave.bindValue(":raitem_disposition", _disposition->code()); returnSave.bindValue(":qty_uom_id", _qtyUOM->id()); returnSave.bindValue(":qty_invuomratio", _qtyinvuomratio); returnSave.bindValue(":price_uom_id", _pricingUOM->id()); returnSave.bindValue(":price_invuomratio", _priceinvuomratio); returnSave.bindValue(":raitem_unitprice", _netUnitPrice->localValue()); if (_taxType->isValid()) returnSave.bindValue(":raitem_taxtype_id", _taxType->id()); returnSave.bindValue(":raitem_notes", _notes->toPlainText()); returnSave.bindValue(":raitem_notes", _notes->toPlainText()); if (_rsnCode->isValid()) returnSave.bindValue(":raitem_rsncode_id", _rsnCode->id()); returnSave.bindValue(":item_id", _item->id()); returnSave.bindValue(":warehous_id", _warehouse->id()); if (_disposition->code() == "P" || _disposition->code() == "V" || _disposition->code() == "S") returnSave.bindValue(":shipWhs_id", _shipWhs->id()); if (_altcosAccntid->id() != -1) returnSave.bindValue(":raitem_cos_accnt_id", _altcosAccntid->id()); returnSave.bindValue(":raitem_scheddate", _scheduledDate->date()); returnSave.bindValue(":raitem_warranty",QVariant(_warranty->isChecked())); returnSave.bindValue(":raitem_saleprice", _saleNetUnitPrice->localValue()); if (_costmethod=="A") returnSave.bindValue(":raitem_unitcost", _unitCost->localValue()); returnSave.bindValue(":raitem_custpn", _customerPN->text()); returnSave.exec(); if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); reject(); } // Check to see if a S/O should be re-scheduled if (_orderId != -1) { if (_qtyAuth->toDouble() == 0) { returnSave.prepare("SELECT deletewo(:woid, true, true) AS result;"); returnSave.bindValue(":woid", _orderId); returnSave.exec(); if (returnSave.value("result").toInt() < 0) { systemError(this, storedProcErrorLookup("deleteWo", returnSave.value("result").toInt()), __FILE__, __LINE__); reject(); } else if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); reject(); } } else if (_scheduledDate->date() != _cScheduledDate) { if (QMessageBox::question(this, tr("Reschedule W/O?"), tr("

    The Scheduled Date for this Line " "Item has been changed. Should the " "W/O for this Line Item be Re-" "Scheduled to reflect this change?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { returnSave.prepare("SELECT changeWoDates(:wo_id, :schedDate, :schedDate, TRUE) AS result;"); returnSave.bindValue(":wo_id", _orderId); returnSave.bindValue(":schedDate", _scheduledDate->date()); returnSave.exec(); if (returnSave.first()) { int result = returnSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("changeWoDates", result), __FILE__, __LINE__); reject(); } _cScheduledDate = _scheduledDate->date(); } else if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); reject(); } } } if (_qtyAuth->toDouble() != _cQtyOrdered && _qtyAuth->toDouble() > 0) { if (_item->itemType() == "M") { if (QMessageBox::question(this, tr("Change W/O Quantity?"), tr("

    The quantity authorized for this Return " "Authorization Line Item has been changed. " "Should the quantity required for the " "associated Work Order be changed to " "reflect this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { returnSave.prepare("SELECT changeWoQty(:wo_id, :qty, TRUE) AS result;"); returnSave.bindValue(":wo_id", _orderId); returnSave.bindValue(":qty", _qtyAuth->toDouble() * _qtyinvuomratio); returnSave.exec(); if (returnSave.first()) { int result = returnSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("changeWoQty", result), __FILE__, __LINE__); reject(); } } else if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); reject(); } } } } } //If this save has resulted in a link to an shipping S/O, we need to signal that if (_disposition->code() == "P" || _disposition->code() == "V" || _disposition->code() == "S") { XSqlQuery so; so.prepare("SELECT raitem_new_coitem_id, cohead_number, " " cust_name " "FROM raitem,custinfo,cohead,coitem " "WHERE ((raitem_id=:raitem_id) " "AND (raitem_new_coitem_id IS NOT NULL) " "AND (raitem_new_coitem_id=coitem_id) " "AND (cust_id=cohead_cust_id) " "AND (coitem_cohead_id=cohead_id));"); so.bindValue(":raitem_id", _raitemid); so.exec(); if (so.first()) { omfgThis->sSalesOrdersUpdated(returnSave.value("rahead_new_cohead_id").toInt()); // If requested, create a new W/O or P/R for this coitem if ( ( (_mode == cNew) || (_mode == cEdit) ) && (_createOrder->isChecked()) && (_qtyAuth->toDouble() > 0) && (_orderId == -1) ) { QString chartype; if (_item->itemType() == "M") { returnSave.prepare( "SELECT createWo(:orderNumber, itemsite_id, :qty, itemsite_leadtime, :dueDate, :comments, :parent_type, :parent_id) AS result, itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); returnSave.bindValue(":orderNumber", so.value("cohead_number").toInt()); returnSave.bindValue(":qty", _orderQty->toDouble()); returnSave.bindValue(":dueDate", _scheduledDate->date()); returnSave.bindValue(":comments", so.value("cust_name").toString() + "\n" + _notes->toPlainText()); returnSave.bindValue(":item_id", _item->id()); returnSave.bindValue(":warehous_id", _shipWhs->id()); returnSave.bindValue(":parent_type", QString("S")); returnSave.bindValue(":parent_id", so.value("raitem_new_coitem_id").toInt()); returnSave.exec(); } if (returnSave.first()) { _orderId = returnSave.value("result").toInt(); if (_orderId < 0) { QString procname; if (_item->itemType() == "M") procname = "createWo"; else procname = "unnamed stored procedure"; systemError(this, storedProcErrorLookup(procname, _orderId), __FILE__, __LINE__); reject(); } if (_item->itemType() == "M") { omfgThis->sWorkOrdersUpdated(_orderId, TRUE); // Update the newly created coitem with the newly create wo_id returnSave.prepare( "UPDATE coitem " "SET coitem_order_type='W', coitem_order_id=:orderid " "WHERE (coitem_id=:soitem_id);" ); returnSave.bindValue(":orderid", _orderId); returnSave.bindValue(":soitem_id", so.value("raitem_new_coitem_id").toInt()); returnSave.exec(); if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); reject(); } } } } // Update W/O with any changes to notes if ( (_mode == cEdit) && (_createOrder->isChecked()) && (_qtyAuth->toDouble() > 0) && (_orderId != -1) && (_notes->toPlainText().length() > 0) ) { if (_item->itemType() == "M") { returnSave.prepare("UPDATE wo SET wo_prodnotes=:comments WHERE (wo_id=:wo_id);"); returnSave.bindValue(":wo_id", _orderId); returnSave.bindValue(":comments", so.value("cust_name").toString() + "\n" + _notes->toPlainText()); returnSave.exec(); if (returnSave.lastError().type() != QSqlError::NoError) { systemError(this, returnSave.lastError().databaseText(), __FILE__, __LINE__); reject(); } } } } } _mode = cEdit; return true; } void returnAuthorizationItem::sPopulateItemInfo() { XSqlQuery uom; uom.prepare("SELECT uom_id, uom_name" " FROM item" " JOIN uom ON (item_inv_uom_id=uom_id)" " WHERE(item_id=:item_id)" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_to_uom_id=uom_id)" " WHERE((itemuomconv_from_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_from_uom_id=uom_id)" " WHERE((itemuomconv_to_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " ORDER BY uom_name;"); uom.bindValue(":item_id", _item->id()); uom.exec(); _qtyUOM->populate(uom); _pricingUOM->populate(uom); _salePricingUOM->populate(uom); XSqlQuery item; item.prepare( "SELECT item_inv_uom_id, item_price_uom_id," " iteminvpricerat(item_id) AS iteminvpricerat," " item_listprice, " " stdCost(item_id) AS stdcost," " getItemTaxType(item_id, :taxzone_id) AS taxtype_id " " FROM item" " WHERE (item_id=:item_id);" ); item.bindValue(":item_id", _item->id()); item.bindValue(":taxzone_id", _taxzoneid); item.exec(); if (item.first()) { _priceRatio = item.value("iteminvpricerat").toDouble(); _qtyUOM->setId(item.value("item_inv_uom_id").toInt()); _pricingUOM->setId(item.value("item_price_uom_id").toInt()); _salePricingUOM->setId(item.value("item_price_uom_id").toInt()); _priceinvuomratio = item.value("iteminvpricerat").toDouble(); _qtyinvuomratio = 1.0; _invuomid = item.value("item_inv_uom_id").toInt(); _listPrice->setBaseValue(item.value("item_listprice").toDouble()); _unitCost->setBaseValue(item.value("stdcost").toDouble()); _taxType->setId(item.value("taxtype_id").toInt()); } else if (item.lastError().type() != QSqlError::NoError) { systemError(this, item.lastError().databaseText(), __FILE__, __LINE__); return; } if (_item->itemType() == "M" && _costmethod != "J") _createOrder->setEnabled(_mode == cNew || _mode == cEdit); else _createOrder->setEnabled(FALSE); if (_costmethod == "J") _createOrder->setChecked(TRUE); _warehouse->findItemsites(_item->id()); _shipWhs->findItemsites(_item->id()); if(_preferredWarehousid > 0) _warehouse->setId(_preferredWarehousid); if(_preferredShipWarehousid > 0) _shipWhs->setId(_preferredShipWarehousid); } void returnAuthorizationItem::sPopulateItemsiteInfo() { if (_item->isValid()) { XSqlQuery itemsite; itemsite.prepare( "SELECT itemsite_leadtime, itemsite_controlmethod, " " itemsite_createwo, itemsite_createpr, " " itemsite_costmethod, itemsite_id " "FROM item, itemsite " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (item_id=:item_id) );" ); itemsite.bindValue(":warehous_id", _shipWhs->id()); itemsite.bindValue(":item_id", _item->id()); itemsite.exec(); if (itemsite.first()) { _leadTime = itemsite.value("itemsite_leadtime").toInt(); _costmethod = itemsite.value("itemsite_costmethod").toString(); if (_costmethod == "J") { _createOrder->setChecked(TRUE); _createOrder->setEnabled(FALSE); } else if (cNew == _mode) { if ( _disposition->code() == "V" && _costmethod != "J") { QMessageBox::warning( this, tr("Cannot use Service Disposition"), tr("

    Only Items Sites using the Job cost method may have a Disposition of Service.") ); _item->setId(-1); _item->setFocus(); return; } if (_item->itemType() == "M" && _costmethod != "J") _createOrder->setChecked(itemsite.value("itemsite_createwo").toBool()); else { _createOrder->setChecked(FALSE); _createOrder->setEnabled(FALSE); } } if ( _disposition->code() == "R" || _disposition->code() == "P") { if (_costmethod == "A") { if (cNew != _mode) _unitCost->setLocalValue(_unitcost); else if (_origsoid != -1) { XSqlQuery uc; uc.prepare("SELECT COALESCE(SUM(cohist_unitcost * cohist_qtyshipped) / " " SUM(cohist_qtyshipped),0) AS unitcost " "FROM cohist " " JOIN cohead ON ((cohist_doctype='I') " " AND (cohist_ordernumber=cohead_number)) " "WHERE ((cohead_id=:cohead_id) " " AND (cohist_itemsite_id=:itemsite_id); "); uc.bindValue(":cohead_id", _origsoid); uc.bindValue(":itemsite_id", itemsite.value("itemsite_id").toInt()); uc.exec(); if (uc.first()) _unitCost->setLocalValue(uc.value("unitcost").toDouble()); else if (uc.lastError().type() != QSqlError::NoError) { systemError(this, itemsite.lastError().databaseText(), __FILE__, __LINE__); return; } } _unitCost->setEnabled(cView != _mode); } else _unitCost->setEnabled(_costmethod == "A"); } else _unitCost->setEnabled(false); _tab->setTabEnabled(_tab->indexOf(_lotserial), (itemsite.value("itemsite_controlmethod").toString() == "L" || itemsite.value("itemsite_controlmethod").toString() == "S")); } else if (itemsite.lastError().type() != QSqlError::NoError) { systemError(this, itemsite.lastError().databaseText(), __FILE__, __LINE__); return; } } } void returnAuthorizationItem::populate() { XSqlQuery raitem; raitem.prepare("SELECT rahead_number, rahead_curr_id, rahead_authdate, rahead_taxzone_id, raitem.*, " " formatRaLineNumber(raitem_id) AS linenumber," " och.cohead_number AS orig_number, formatSoLineNumber(oc.coitem_id) AS orig_linenumber, " " nch.cohead_number AS new_number, formatSoLineNumber(nc.coitem_id) AS new_linenumber, " " COALESCE(raitem_orig_coitem_id,-1) AS ra_coitem_id, oc.coitem_price, " " oc.coitem_qtyshipped AS qtysold," " raitem_qtyauthorized AS qtyauth," " raitem_qtyreceived AS qtyrcvd," " nc.coitem_qtyshipped AS qtyshipd," " rahead_curr_id AS taxcurr, " " item_inv_uom_id, " " COALESCE(nc.coitem_order_id,-1) AS coitem_order_id, " " nc.coitem_order_type AS coitem_order_type, " " rcv.itemsite_warehous_id AS itemsite_warehous_id, " " shp.itemsite_warehous_id AS shipWhs_id, " " qtyToReceive('RA', raitem_id) AS qtytorcv, " " crmacct_id, " " nc.coitem_price AS saleprice, " " nch.cohead_curr_id AS salecurrid, " " nch.cohead_orderdate AS saledate " "FROM raitem " " LEFT OUTER JOIN coitem oc ON (raitem_orig_coitem_id=oc.coitem_id) " " LEFT OUTER JOIN cohead och ON (oc.coitem_cohead_id=och.cohead_id) " " LEFT OUTER JOIN coitem nc ON (raitem_new_coitem_id=nc.coitem_id) " " LEFT OUTER JOIN cohead nch ON (nc.coitem_cohead_id=nch.cohead_id)" " LEFT OUTER JOIN itemsite shp ON (raitem_coitem_itemsite_id=shp.itemsite_id)," " rahead, itemsite rcv, item, crmacct " "WHERE ((raitem_rahead_id=rahead_id)" " AND (raitem_id=:raitem_id) " " AND (raitem_itemsite_id=rcv.itemsite_id) " " AND (item_id=rcv.itemsite_item_id) " " AND (rahead_cust_id=crmacct_cust_id) );" ); raitem.bindValue(":raitem_id", _raitemid); _comments->setId(_raitemid); raitem.exec(); if (raitem.first()) { _authNumber->setText(raitem.value("rahead_number").toString()); _unitcost = raitem.value("raitem_unitcost").toDouble(); if (raitem.value("new_number").toInt() > 0) { _newSoNumber->setText(raitem.value("new_number").toString()); _newSoLineNumber->setText(raitem.value("new_linenumber").toString()); } else { _newSoNumberLit->hide(); _newSoLineNumberLit->hide(); _newSoNumber->hide(); _newSoLineNumber->hide(); } _disposition->setCode(raitem.value("raitem_disposition").toString()); _orderId = raitem.value("coitem_order_id").toInt(); _netUnitPrice->setId(raitem.value("rahead_curr_id").toInt()); _netUnitPrice->setEffective(raitem.value("rahead_authdate").toDate()); _netUnitPrice->setLocalValue(raitem.value("raitem_unitprice").toDouble()); _saleNetUnitPrice->setId(raitem.value("salecurrid").toInt()); _saleNetUnitPrice->setEffective(raitem.value("saledate").toDate()); _saleNetUnitPrice->setLocalValue(raitem.value("saleprice").toDouble()); // do _item and _taxzone before other tax stuff because of signal cascade _taxzoneid = raitem.value("rahead_taxzone_id").toInt(); _item->setItemsiteid(raitem.value("raitem_itemsite_id").toInt()); _warehouse->setId(raitem.value("itemsite_warehous_id").toInt()); _shipWhs->setId(raitem.value("shipWhs_id").toInt()); _taxType->setId(raitem.value("raitem_taxtype_id").toInt()); _tax->setId(raitem.value("taxcurr").toInt()); _invuomid=raitem.value("item_inv_uom_id").toInt(); _qtyUOM->setId(raitem.value("raitem_qty_uom_id").toInt()); _pricingUOM->setId(raitem.value("raitem_price_uom_id").toInt()); _qtyinvuomratio = raitem.value("raitem_qty_invuomratio").toDouble(); _priceinvuomratio = raitem.value("raitem_price_invuomratio").toDouble(); _lineNumber->setText(raitem.value("linenumber").toString()); _qtyAuth->setDouble(raitem.value("qtyauth").toDouble()); _qtyReceived->setDouble(raitem.value("qtyrcvd").toDouble()); _qtyShipped->setDouble(raitem.value("qtyshipd").toDouble()); _notes->setText(raitem.value("raitem_notes").toString()); _rsnCode->setId(raitem.value("raitem_rsncode_id").toInt()); _altcosAccntid->setId(raitem.value("raitem_cos_accnt_id").toInt()); _scheduledDate->setDate(raitem.value("raitem_scheddate").toDate()); _warranty->setChecked(raitem.value("raitem_warranty").toBool()); _status = raitem.value("raitem_status").toString(); _qtycredited = raitem.value("raitem_qtycredited").toDouble(); _customerPN->setText(raitem.value("raitem_custpn").toString()); _cQtyOrdered = _qtyAuth->toDouble(); _cScheduledDate = _scheduledDate->date(); _crmacctid = raitem.value("crmacct_id").toInt(); _coitemid = raitem.value("ra_coitem_id").toInt(); _coitemitemsiteid = raitem.value("raitem_coitem_itemsite_id").toInt(); if (_coitemitemsiteid == 0) _coitemitemsiteid = -1; if (_coitemid != -1) { _origSoNumber->setText(raitem.value("orig_number").toString()); _origSoLineNumber->setText(raitem.value("orig_linenumber").toString()); _qtySold->setDouble(raitem.value("qtysold").toDouble()); _soldQty=raitem.value("qtysold").toDouble(); _qtyUOM->setEnabled(FALSE); _pricingUOM->setEnabled(FALSE); _salePricingUOM->setEnabled(FALSE); _salePrice->setId(raitem.value("rahead_curr_id").toInt()); _salePrice->setEffective(raitem.value("rahead_authdate").toDate()); _salePrice->setLocalValue(raitem.value("coitem_price").toDouble()); } else { _origSoNumber->hide(); _origSoNumberLit->hide(); _origSoLineNumber->hide(); _origSoLineNumberLit->hide(); _discountFromSalePrcntLit->hide(); _discountFromSale->hide(); _qtySold->hide(); _qtySoldLit->hide(); _salePrice->hide(); _salePriceLit->hide(); } sDetermineAvailability(); if (raitem.value("qtyrcvd").toDouble() > 0 || raitem.value("qtyshipd").toDouble() > 0 || raitem.value("qtytorcv").toDouble() > 0 || _qtycredited > 0) _disposition->setEnabled(FALSE); if (_orderId != -1) { XSqlQuery query; if (raitem.value("coitem_order_type").toString() == "W") { query.prepare( "SELECT wo_status," " wo_qtyord AS qty," " wo_duedate, warehous_id, warehous_code " "FROM wo, itemsite, whsinfo " "WHERE ((wo_itemsite_id=itemsite_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (wo_id=:wo_id));" ); query.bindValue(":wo_id", _orderId); query.exec(); if (query.first()) { _createOrder->setChecked(TRUE); _orderQty->setDouble(query.value("qty").toDouble()); _orderDueDate->setDate(query.value("wo_duedate").toDate()); _orderStatus->setText(query.value("wo_status").toString()); if ((query.value("wo_status").toString() == "R") || (query.value("wo_status").toString() == "C") || (query.value("wo_status").toString() == "I")) { _createOrder->setEnabled(FALSE); if (_costmethod == "J") _qtyAuth->setEnabled(false); } } else { _orderId = -1; _createOrder->setChecked(FALSE); } } } } else if (raitem.lastError().type() != QSqlError::NoError) { systemError(this, raitem.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void returnAuthorizationItem::sCalculateExtendedPrice() { _extendedPrice->setLocalValue(((_qtyAuth->toDouble() * _qtyinvuomratio) / _priceinvuomratio) * _netUnitPrice->localValue()); } void returnAuthorizationItem::sCalculateDiscountPrcnt() { double unitPrice = _netUnitPrice->localValue(); if (unitPrice == 0.0) { _discountFromList->setText("N/A"); _discountFromSale->setText("N/A"); } else { if (_listPrice->isZero()) _discountFromList->setText("N/A"); else _discountFromList->setDouble((1 - (unitPrice / _listPrice->localValue())) * 100 ); if (_salePrice->isZero()) _discountFromSale->setText("N/A"); else _discountFromSale->setDouble((1 - (unitPrice / _salePrice->localValue())) * 100 ); } } void returnAuthorizationItem::sCalculateFromDiscount() { double discount = _discountFromSale->toDouble() / 100.0; if (_salePrice->isZero()) _discountFromSale->setText(tr("N/A")); else _netUnitPrice->setLocalValue(_salePrice->localValue() - (_salePrice->localValue() * discount)); } void returnAuthorizationItem::sPriceGroup() { if (! omfgThis->singleCurrency()) _priceGroup->setTitle(tr("In %1:").arg(_netUnitPrice->currAbbr())); } void returnAuthorizationItem::sCalculateSaleExtendedPrice() { _saleExtendedPrice->setLocalValue(((_qtyAuth->toDouble() * _qtyinvuomratio) / _priceinvuomratio) * _saleNetUnitPrice->localValue()); } void returnAuthorizationItem::sCalculateSaleDiscountPrcnt() { double unitPrice = _saleNetUnitPrice->localValue(); if (unitPrice == 0.0) { _saleDiscountFromSale->setText("N/A"); } else { if (_listPrice->isZero()) _saleDiscountFromSale->setText("N/A"); else _saleDiscountFromSale->setDouble((1 - (unitPrice / _listPrice->localValue())) * 100 ); } } void returnAuthorizationItem::sCalculateSaleFromDiscount() { double discount = _saleDiscountFromSale->toDouble() / 100.0; if (_listPrice->isZero()) _saleDiscountFromSale->setText(tr("N/A")); else _saleNetUnitPrice->setLocalValue(_listPrice->localValue() - (_listPrice->localValue() * discount)); } void returnAuthorizationItem::sListPrices() { XSqlQuery returnListPrices; returnListPrices.prepare( "SELECT formatSalesPrice(currToCurr(ipshead_curr_id, :curr_id, ipsprice_price, :effective)) AS price" " FROM ipsass, ipshead, ipsprice " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_cust_id=:cust_id)" " AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) = 0)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1) ) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_shipto_id=:shipto_id)" " AND (ipsass_shipto_id != -1)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice, custinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_custtype_id=cust_custtype_id)" " AND (cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice, custtype, custinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (coalesce(length(ipsass_custtype_pattern), 0) > 0)" " AND (custtype_code ~ ipsass_custtype_pattern)" " AND (cust_custtype_id=custtype_id)" " AND (cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)))" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice, shiptoinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (shipto_id=:shipto_id)" " AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) > 0)" " AND (shipto_num ~ ipsass_shipto_pattern)" " AND (ipsass_cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM sale, ipshead, ipsprice " " WHERE ((sale_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (CURRENT_DATE BETWEEN sale_startdate AND (sale_enddate - 1)) ) " " UNION SELECT formatSalesPrice(item_listprice - (item_listprice * cust_discntprcnt)) AS price " " FROM item, custinfo " " WHERE ( (item_sold)" " AND (NOT item_exclusive)" " AND (item_id=:item_id)" " AND (cust_id=:cust_id) );"); returnListPrices.bindValue(":item_id", _item->id()); returnListPrices.bindValue(":cust_id", _custid); returnListPrices.bindValue(":shipto_id", _shiptoid); returnListPrices.bindValue(":curr_id", _netUnitPrice->id()); returnListPrices.bindValue(":effective", _netUnitPrice->effective()); returnListPrices.exec(); if (returnListPrices.size() == 1) { returnListPrices.first(); _netUnitPrice->setLocalValue(returnListPrices.value("price").toDouble() * (_priceRatio / _priceinvuomratio)); } else { ParameterList params; params.append("cust_id", _custid); params.append("shipto_id", _shiptoid); params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); // don't params.append("qty", ...) as we don't know how many were purchased params.append("curr_id", _netUnitPrice->id()); params.append("effective", _netUnitPrice->effective()); priceList newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) { _netUnitPrice->setLocalValue(newdlg._selectedPrice * (_priceRatio / _priceinvuomratio)); sCalculateDiscountPrcnt(); } } } void returnAuthorizationItem::sSaleListPrices() { XSqlQuery returnSaleListPrices; returnSaleListPrices.prepare( "SELECT formatSalesPrice(currToCurr(ipshead_curr_id, :curr_id, ipsprice_price, :effective)) AS price" " FROM ipsass, ipshead, ipsprice " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_cust_id=:cust_id)" " AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) = 0)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1) ) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_shipto_id=:shipto_id)" " AND (ipsass_shipto_id != -1)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice, custinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (ipsass_custtype_id=cust_custtype_id)" " AND (cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice, custtype, custinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (coalesce(length(ipsass_custtype_pattern), 0) > 0)" " AND (custtype_code ~ ipsass_custtype_pattern)" " AND (cust_custtype_id=custtype_id)" " AND (cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)))" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM ipsass, ipshead, ipsprice, shiptoinfo " " WHERE ( (ipsass_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (shipto_id=:shipto_id)" " AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) > 0)" " AND (shipto_num ~ ipsass_shipto_pattern)" " AND (ipsass_cust_id=:cust_id)" " AND (CURRENT_DATE BETWEEN ipshead_effective AND (ipshead_expires - 1)) )" " UNION SELECT formatSalesPrice(ipsprice_price) AS price" " FROM sale, ipshead, ipsprice " " WHERE ((sale_ipshead_id=ipshead_id)" " AND (ipsprice_ipshead_id=ipshead_id)" " AND (ipsprice_item_id=:item_id)" " AND (CURRENT_DATE BETWEEN sale_startdate AND (sale_enddate - 1)) ) " " UNION SELECT formatSalesPrice(item_listprice - (item_listprice * cust_discntprcnt)) AS price " " FROM item, custinfo " " WHERE ( (item_sold)" " AND (NOT item_exclusive)" " AND (item_id=:item_id)" " AND (cust_id=:cust_id) );"); returnSaleListPrices.bindValue(":item_id", _item->id()); returnSaleListPrices.bindValue(":cust_id", _custid); returnSaleListPrices.bindValue(":shipto_id", _shiptoid); returnSaleListPrices.bindValue(":curr_id", _saleNetUnitPrice->id()); returnSaleListPrices.bindValue(":effective", _saleNetUnitPrice->effective()); returnSaleListPrices.exec(); if (returnSaleListPrices.size() == 1) { returnSaleListPrices.first(); _saleNetUnitPrice->setLocalValue(returnSaleListPrices.value("price").toDouble() * (_priceRatio / _priceinvuomratio)); } else { ParameterList params; params.append("cust_id", _custid); params.append("shipto_id", _shiptoid); params.append("item_id", _item->id()); // don't params.append("qty", ...) as we don't know how many were purchased params.append("curr_id", _saleNetUnitPrice->id()); params.append("effective", _saleNetUnitPrice->effective()); priceList newdlg(this); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) { _saleNetUnitPrice->setLocalValue(newdlg._selectedPrice * (_priceRatio / _priceinvuomratio)); sCalculateSaleDiscountPrcnt(); } } } void returnAuthorizationItem::sCalculateTax() { XSqlQuery calcq; calcq.prepare("SELECT calculateTax(rahead_taxzone_id,:taxtype_id,rahead_authdate,rahead_curr_id,ROUND(:ext,2)) AS tax " "FROM rahead " "WHERE (rahead_id=:rahead_id); " ); calcq.bindValue(":rahead_id", _raheadid); calcq.bindValue(":taxtype_id", _taxType->id()); calcq.bindValue(":ext", _extendedPrice->localValue()); calcq.exec(); if (calcq.first()) _tax->setLocalValue(calcq.value("tax").toDouble()); else if (calcq.lastError().type() != QSqlError::NoError) { systemError(this, calcq.lastError().databaseText(), __FILE__, __LINE__); return; } } void returnAuthorizationItem::sTaxDetail() { taxDetail newdlg(this, "", true); ParameterList params; params.append("taxzone_id", _taxzoneid); params.append("taxtype_id", _taxType->id()); params.append("date", _netUnitPrice->effective()); params.append("curr_id", _netUnitPrice->id()); params.append("subtotal", _extendedPrice->localValue()); params.append("readOnly"); if (newdlg.set(params) == NoError && newdlg.exec()) { if (_taxType->id() != newdlg.taxtype()) _taxType->setId(newdlg.taxtype()); } } void returnAuthorizationItem::sQtyUOMChanged() { if(_qtyUOM->id() == _invuomid || _item->id() == -1) _qtyinvuomratio = 1.0; else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio" " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _qtyUOM->id()); invuom.exec(); if(invuom.first()) _qtyinvuomratio = invuom.value("ratio").toDouble(); else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } if(_qtyUOM->id() != _invuomid) { _pricingUOM->setId(_qtyUOM->id()); _pricingUOM->setEnabled(false); _salePricingUOM->setId(_qtyUOM->id()); _salePricingUOM->setEnabled(false); } else { bool isEditing = (_mode == cNew || _mode == cEdit); _pricingUOM->setEnabled(isEditing); _salePricingUOM->setEnabled(isEditing); } sCalculateExtendedPrice(); sCalculateSaleExtendedPrice(); } void returnAuthorizationItem::sPriceUOMChanged() { if(_pricingUOM->id() == -1 || _qtyUOM->id() == -1) return; if(_pricingUOM->id() == _invuomid) _priceinvuomratio = 1.0; else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio" " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _pricingUOM->id()); invuom.exec(); if(invuom.first()) _priceinvuomratio = invuom.value("ratio").toDouble(); else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } //_ratio->setText(formatUOMRatio(_priceinvuomratio)); updatePriceInfo(); } void returnAuthorizationItem::updatePriceInfo() { XSqlQuery item; item.prepare("SELECT item_listprice" " FROM item" " WHERE(item_id=:item_id);"); item.bindValue(":item_id", _item->id()); item.exec(); item.first(); _listPrice->setBaseValue((item.value("item_listprice").toDouble() * _priceRatio) * _priceinvuomratio); sCalculateExtendedPrice(); } void returnAuthorizationItem::sDispositionChanged() { bool isEditing = (_mode == cNew || _mode == cEdit); if ( (_disposition->code() == "V") && // service (_item->id() != -1) && (_costmethod != "J") ) { QMessageBox::warning( this, tr("Cannot use Service Disposition"), tr("

    Only Items Sites using the Job cost method may have a Disposition of Service.") ); _disposition->setFocus(); _disposition->setId(_dispositionCache); return; } else if (_disposition->code() == "V") { _shipWhs->setId(_warehouse->id()); _shipWhs->setEnabled(false); } else if ( (_disposition->id() < 2) && // credit or return (_orderId != -1) ) { QMessageBox::warning( this, tr("Cannot change Disposition"), tr("

    A work order is associated with this Return. " "First delete the work order, then change this disposition.") ); _disposition->setFocus(); _disposition->setId(_dispositionCache); return; } else if (_disposition->code() == "C" || _disposition->code() == "R") { _shipWhs->setId(_warehouse->id()); _shipWhs->setVisible(false); } else { _shipWhs->setVisible(true); _shipWhs->setEnabled(isEditing); } if (_mode == cNew) _item->addExtraClause( QString("(item_id IN (SELECT custitem FROM custitem(%1, %2) ) )").arg(_custid).arg(_shiptoid) ); if (_disposition->code() == "V" || _disposition->code() == "S") // service or ship { _netUnitPrice->setLocalValue(0); _netUnitPrice->setEnabled(FALSE); _listPrices->setEnabled(FALSE); _pricingUOM->setEnabled(FALSE); _discountFromSale->setEnabled(FALSE); } else { _netUnitPrice->setEnabled(isEditing); _listPrices->setEnabled(isEditing); _pricingUOM->setEnabled(isEditing); _discountFromSale->setEnabled(isEditing); } if (_disposition->code() == "P" || _disposition->code() == "V" || _disposition->code() == "S") // replace, service, or ship { _tab->setTabEnabled(_tab->indexOf(_supply),TRUE); _scheduledDate->setEnabled(isEditing); _altcosAccntid->setEnabled(isEditing); _shipWhsLit->setVisible(TRUE); _shipWhs->setVisible(TRUE); _saleNetUnitPrice->setEnabled(isEditing); _saleListPrices->setEnabled(isEditing); _salePricingUOM->setEnabled(isEditing); _saleDiscountFromSale->setEnabled(isEditing); } else { _tab->setTabEnabled(_tab->indexOf(_supply),FALSE); _scheduledDate->clear(); _scheduledDate->setEnabled(FALSE); _altcosAccntid->setEnabled(isEditing); _shipWhsLit->setVisible(FALSE); _shipWhs->setVisible(FALSE); _saleNetUnitPrice->setLocalValue(0); _saleNetUnitPrice->setEnabled(FALSE); _saleListPrices->setEnabled(FALSE); _salePricingUOM->setEnabled(FALSE); _saleDiscountFromSale->setEnabled(FALSE); } if (_creditmethod == "N") { _netUnitPrice->setLocalValue(0); _netUnitPrice->setEnabled(FALSE); _listPrices->setEnabled(FALSE); _pricingUOM->setEnabled(FALSE); _discountFromSale->setEnabled(FALSE); disconnect(_item, SIGNAL(valid(bool)), _listPrices, SLOT(setEnabled(bool))); } _dispositionCache = _disposition->id(); sPopulateItemInfo(); sPopulateItemsiteInfo(); } void returnAuthorizationItem::sHandleWo(bool pCreate) { if (pCreate) { if (_orderId == -1) sPopulateOrderInfo(); } else { if (_orderId != -1) { XSqlQuery query; if (_item->itemType() == "M") { if (QMessageBox::question(this, tr("Delete Work Order"), tr("

    You are requesting to delete the Work " "Order created for the Sales Order Item linked to this Return. " "Are you sure you want to do this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { query.prepare("UPDATE coitem SET coitem_order_id=-1,coitem_order_type=NULL " "FROM wo " "WHERE ((coitem_id=wo_ordid) " "AND (wo_id=:wo_id)); " "SELECT deleteWo(:wo_id, TRUE) AS result;"); query.bindValue(":wo_id", _orderId); query.exec(); if (query.first()) { int result = query.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteWo", result), __FILE__, __LINE__); _createOrder->setChecked(true); // if (pCreate) => won't recurse return; } else { _orderId = -1; _orderQty->clear(); _orderDueDate->clear(); _orderStatus->clear(); if (_qtyReceived->toDouble() == 0 && _qtyShipped->toDouble() == 0 && _qtycredited == 0 && _status == "O") _disposition->setEnabled(_mode == cNew || _mode == cEdit); _createOrder->setChecked(FALSE); } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); _createOrder->setChecked(true); // if (pCreate) => won't recurse return; } omfgThis->sWorkOrdersUpdated(-1, TRUE); } else _createOrder->setChecked(TRUE); } } } } void returnAuthorizationItem::sPopulateOrderInfo() { if (_createOrder->isChecked()) { _orderDueDate->setDate(_scheduledDate->date()); if (_createOrder->isChecked()) { XSqlQuery qty; qty.prepare( "SELECT validateOrderQty(itemsite_id, :qty, TRUE) AS qty " "FROM itemsite " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id));" ); qty.bindValue(":qty", _qtyAuth->toDouble() * _qtyinvuomratio); qty.bindValue(":item_id", _item->id()); qty.bindValue(":warehous_id", ((_item->itemType() == "M") ? _shipWhs->id() : _shipWhs->id())); qty.exec(); if (qty.first()) _orderQty->setDouble(qty.value("qty").toDouble()); else if (qty.lastError().type() != QSqlError::NoError) { systemError(this, qty.lastError().databaseText(), __FILE__, __LINE__); return; } } } } void returnAuthorizationItem::sDetermineAvailability() { if( (_item->id()==_availabilityLastItemid) && (_shipWhs->id()==_availabilityLastWarehousid) && (_scheduledDate->date()==_availabilityLastSchedDate) && (_showAvailability->isChecked()==_availabilityLastShow) && ((_qtyAuth->toDouble() * _qtyinvuomratio)==_availabilityQtyOrdered) ) return; _availabilityLastItemid = _item->id(); _availabilityLastWarehousid = _shipWhs->id(); _availabilityLastSchedDate = _scheduledDate->date(); _availabilityLastShow = _showAvailability->isChecked(); _availabilityQtyOrdered = (_qtyAuth->toDouble() * _qtyinvuomratio); if ((_item->isValid()) && (_scheduledDate->isValid()) && (_showAvailability->isChecked()) ) { XSqlQuery availability; availability.prepare( "SELECT itemsite_id," " qoh," " allocated," " noNeg(qoh - allocated) AS unallocated," " ordered," " (qoh - allocated + ordered) AS available," " itemsite_leadtime " "FROM ( SELECT itemsite_id, itemsite_qtyonhand AS qoh," " qtyAllocated(itemsite_id, DATE(:date)) AS allocated," " qtyOrdered(itemsite_id, DATE(:date)) AS ordered, " " itemsite_leadtime " " FROM itemsite, item " " WHERE ((itemsite_item_id=item_id)" " AND (item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id)) ) AS data;" ); availability.bindValue(":date", _scheduledDate->date()); availability.bindValue(":item_id", _item->id()); availability.bindValue(":warehous_id", _shipWhs->id()); availability.exec(); if (availability.first()) { _onHand->setDouble(availability.value("qoh").toDouble()); _allocated->setDouble(availability.value("allocated").toDouble()); _unallocated->setDouble(availability.value("unallocated").toDouble()); _onOrder->setDouble(availability.value("ordered").toDouble()); _available->setDouble(availability.value("available").toDouble()); _leadtime->setText(availability.value("itemsite_leadtime").toString()); QString stylesheet; if (availability.value("available").toDouble() < _availabilityQtyOrdered) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); _available->setStyleSheet(stylesheet); } else if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _onHand->clear(); _allocated->clear(); _unallocated->clear(); _onOrder->clear(); _available->clear(); _leadtime->clear(); } } void returnAuthorizationItem::sCalcWoUnitCost() { XSqlQuery returnCalcWoUnitCost; if (_costmethod == "J" && _orderId > -1 && _qtyAuth->toDouble() != 0) { returnCalcWoUnitCost.prepare("SELECT COALESCE(SUM(wo_postedvalue),0) AS wo_value " "FROM wo,raitem " "WHERE ((wo_ordtype='S') " " AND (wo_ordid=raitem_new_coitem_id) " " AND (raitem_id=:raitem_id));"); returnCalcWoUnitCost.bindValue(":raitem_id", _raitemid); returnCalcWoUnitCost.exec(); if (returnCalcWoUnitCost.first()) _unitCost->setBaseValue(returnCalcWoUnitCost.value("wo_value").toDouble() / _qtyAuth->toDouble() * _qtyinvuomratio); } } void returnAuthorizationItem::sNew() { if (sSave()) { ParameterList params; params.append("raitem_id", _raitemid); params.append("item_id", _item->id()); params.append("warehouse_id", _warehouse->id()); params.append("uom", _qtyUOM->currentText()); params.append("mode", "new"); returnAuthItemLotSerial newdlg(this, "", TRUE); newdlg.set(params); int raitemlsid = newdlg.exec(); if (raitemlsid > 0) populate(); else if (raitemlsid == -1) reject(); } } void returnAuthorizationItem::sEdit() { if (sSave()) { bool fill; fill = FALSE; QList selected = _raitemls->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("raitem_id", _raitemid); params.append("item_id", _item->id()); params.append("warehouse_id", _warehouse->id()); params.append("uom", _qtyUOM->currentText()); params.append("ls_id", ((XTreeWidgetItem*)(selected[i]))->altId()); if (_mode==cView) params.append("mode", "view"); else params.append("mode", "edit"); returnAuthItemLotSerial newdlg(this, "", TRUE); newdlg.set(params); int raitemlsid = newdlg.exec(); if (raitemlsid > 0) fill = TRUE; else if (raitemlsid == -1) reject(); } if (fill) populate(); } } void returnAuthorizationItem::sDelete() { XSqlQuery returnDelete; QList selected = _raitemls->selectedItems(); for (int i = 0; i < selected.size(); i++) { QString sql ( "DELETE FROM raitemls WHERE (raitemls_id=:raitemls_id);" ); returnDelete.prepare(sql); returnDelete.bindValue(":raitemls_id", ((XTreeWidgetItem*)(selected[i]))->id()); returnDelete.exec(); if (returnDelete.lastError().type() != QSqlError::NoError) { systemError(this, returnDelete.lastError().databaseText(), __FILE__, __LINE__); reject(); } } populate(); } void returnAuthorizationItem::sFillList() { XSqlQuery returnFillList; returnFillList.prepare("SELECT raitemls_id,ls_id,ls_number, " " MAX(lsreg_expiredate) AS lsreg_expiredate, " " COALESCE(SUM(lsreg_qty / raitem_qty_invuomratio),0) AS raitemls_qtyregistered, " " raitemls_qtyauthorized, raitemls_qtyreceived, " " 'qty' AS raitemls_qtyregistered_xtnumericrole, " " 'qty' AS raitemls_qtyauthorized_xtnumericrole, " " 'qty' AS raitemls_qtyreceived_xtnumericrole " "FROM raitemls " " LEFT OUTER JOIN lsreg ON (lsreg_ls_id=raitemls_ls_id) " " AND (lsreg_crmacct_id=:crmacct_id), " " ls, raitem " "WHERE ( (raitemls_raitem_id=raitem_id) " " AND (raitem_id=:raitem_id) " " AND (raitemls_ls_id=ls_id) ) " "GROUP BY raitemls_id,ls_id,ls_number,raitemls_qtyauthorized," " raitemls_qtyreceived " "ORDER BY ls_number;" ); returnFillList.bindValue(":raitem_id", _raitemid); returnFillList.bindValue(":crmacct_id", _crmacctid); returnFillList.bindValue(":na", tr("N/A")); returnFillList.exec(); _raitemls->populate(returnFillList,true); _authLotSerial->setDisabled(returnFillList.first()); _authLotSerial->setChecked(returnFillList.first()); if (returnFillList.lastError().type() != QSqlError::NoError) { systemError(this, returnFillList.lastError().databaseText(), __FILE__, __LINE__); reject(); } } void returnAuthorizationItem::rejectEvent() { XSqlQuery returnrejectEvent; returnrejectEvent.exec("ROLLBACK"); } qt-client-4.1.0/guiclient/returnAuthorizationItem.h000066400000000000000000000055551217451700100224770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RETURNAUTHORIZATIONITEM_H #define RETURNAUTHORIZATIONITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_returnAuthorizationItem.h" class returnAuthorizationItem : public XDialog, public Ui::returnAuthorizationItem { Q_OBJECT public: returnAuthorizationItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~returnAuthorizationItem(); public slots: SetResponse set(const ParameterList & pParams ); void sPopulateItemInfo(); void sPopulateItemsiteInfo(); void populate(); void sCalculateDiscountPrcnt(); void sCalculateFromDiscount(); void sCalculateSaleDiscountPrcnt(); void sCalculateSaleFromDiscount(); void sListPrices(); void sSaleListPrices(); void sCalculateTax(); void sPriceGroup(); void sTaxDetail(); void sQtyUOMChanged(); void sPriceUOMChanged(); void sDispositionChanged(); void sDetermineAvailability(); void sHandleWo( bool pCreate ); void sPopulateOrderInfo(); void sCalcWoUnitCost(); //Lot/Serial page void sNew(); void sEdit(); void sDelete(); void sFillList(); protected slots: void languageChange(); bool sSave(); void sSaveClicked(); void sCalculateExtendedPrice(); void sCalculateSaleExtendedPrice(); void updatePriceInfo(); void rejectEvent(); private: int _mode; int _raitemid; int _raheadid; int _custid; int _crmacctid; int _coitemid; int _shiptoid; QString _creditmethod; double _priceRatio; double _listPriceCache; double _salePriceCache; double _qtyAuthCache; int _taxzoneid; double _qtySoldCache; double _qtycredited; int _dispositionCache; int _invuomid; double _qtyinvuomratio; double _priceinvuomratio; int _orderId; int _availabilityLastItemid; int _availabilityLastWarehousid; QDate _availabilityLastSchedDate; bool _availabilityLastShow; double _availabilityQtyOrdered; int _leadTime; QDate _cScheduledDate; double _cQtyOrdered; int _preferredWarehousid; int _preferredShipWarehousid; QString _status; double _soldQty; int _coitemitemsiteid; double _unitcost; int _origsoid; QString _costmethod; }; #endif // RETURNAUTHORIZATIONITEM_H qt-client-4.1.0/guiclient/returnAuthorizationItem.ui000066400000000000000000002262141217451700100226620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. returnAuthorizationItem true 0 0 812 865 0 0 0 0 Return Authorization Item 12 12 12 Auth. #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 60 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Original Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 60 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter New Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 60 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 53 13 true &Cancel false &Save true Qt::Vertical 20 0 1 0 Disposition: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true [ Pick One ] Reason Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 16777215 true XComboBox::ReturnReasonCodes Qt::Horizontal 0 20 Qt::StrongFocus &Recv. Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::WheelFocus Ship Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Horizontal 0 20 Customer P/N: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qty. &Auth.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyAuth Qty. &UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyUOM Qt::WheelFocus Qt::Horizontal 16 20 Qty. Sold: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 32767 32767 Qt::AlignRight Qt::Horizontal 40 20 Qt::Vertical 20 0 0 Credit &Restock Charge %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _discountFromSale 0 0 80 32767 Qt::StrongFocus Qt::AlignRight Qt::Horizontal 0 20 Qt::StrongFocus CurrDisplay::Cost false false ... Qt::Horizontal 0 20 Net Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Price UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _pricingUOM Qt::WheelFocus Qt::Horizontal 0 20 Qt::NoFocus false false false Qt::Horizontal 0 20 Extended Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Sale Discount %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _discountFromSale 0 0 80 32767 Qt::StrongFocus Qt::AlignRight Qt::Horizontal 0 20 Qt::StrongFocus CurrDisplay::Cost false false Qt::StrongFocus ... Qt::Horizontal 0 20 Net Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Price UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _pricingUOM Qt::WheelFocus Qt::Horizontal 0 20 Qt::NoFocus false false false Qt::Horizontal 0 20 Extended Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Sc&heduled Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _scheduledDate Qt::StrongFocus Qt::Horizontal 0 20 Qt::StrongFocus Warranty 0 1 0 &Supply Show Availability false 16777215 16777215 Availability On Hand: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Allocated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unallocated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter On Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Available: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Leadtime: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 80 21 Qt::Horizontal 0 20 Create Work Order true false W/O Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderQty false 80 32767 Qt::NoFocus Qt::AlignRight W/O Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderDueDate false Qt::NoFocus W/O Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 0 20 Qt::Vertical 20 0 &Lot/Serial Authorize &only these Lot/Serial Numbers false Qt::NoFocus 0 Qt::ClickFocus &New false Qt::ClickFocus &Edit false Qt::NoFocus Delete Qt::Vertical 20 16 &Detail Costs Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::Cost false Sale Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::Cost false List Discount %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::Cost false false false Qt::Vertical QSizePolicy::MinimumExpanding 20 0 Qt::Horizontal 0 20 Tax true Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::NoFocus true None XComboBox::TaxTypes Qt::Horizontal 0 20 Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::NoFocus CurrDisplay::SalesPrice false Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::MinimumExpanding 20 0 No&tes 0 0 Qt::ClickFocus A&ccounting Alternate Cost of Sales Account: Qt::ClickFocus Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::MinimumExpanding 20 0 Co&mments Comments QWidget

    comments.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    GLCluster QWidget
    glcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _shipWhs _qtyAuth _qtyUOM _priceTab _discountFromSale _netUnitPrice _listPrices _pricingUOM _saleDiscountFromSale _saleNetUnitPrice _saleListPrices _salePricingUOM _scheduledDate _warranty _tab _showAvailability _createOrder _authLotSerial _new _edit _notes _altcosAccntid _save _close _disposition _rsnCode _close clicked() returnAuthorizationItem reject() 632 35 20 20 _item valid(bool) _save setEnabled(bool) 209 193 670 60 _netUnitPrice idChanged(int) _extendedPrice setId(int) 475 276 430 332 _netUnitPrice idChanged(int) _listPrice setId(int) 475 276 148 544 _netUnitPrice idChanged(int) _salePrice setId(int) 475 276 148 544 _netUnitPrice effectiveChanged(QDate) _extendedPrice setEffective(QDate) 475 276 430 332 _netUnitPrice effectiveChanged(QDate) _salePrice setEffective(QDate) 475 276 148 544 _netUnitPrice effectiveChanged(QDate) _listPrice setEffective(QDate) 475 276 148 544 _authLotSerial toggled(bool) _authLotSerialGroup setEnabled(bool) 181 718 181 718 _authLotSerial toggled(bool) _qtyAuth setDisabled(bool) 181 718 214 251 _raitemls itemSelected(int) _edit animateClick() 280 718 280 718 _raitemls valid(bool) _delete setEnabled(bool) 280 718 280 718 _raitemls valid(bool) _edit setEnabled(bool) 280 718 280 718 _showAvailability toggled(bool) _availabilityGroup setEnabled(bool) 96 473 83 499 _item aliasChanged(QString) _customerPN setText(QString) 208 190 409 244 qt-client-4.1.0/guiclient/returnAuthorizationWorkbench.cpp000066400000000000000000000407021217451700100240470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "returnAuthorizationWorkbench.h" #include #include #include #include #include #include #include #include "creditcardprocessor.h" #include "mqlutil.h" #include "printCreditMemo.h" #include "returnAuthorization.h" #include "returnAuthCheck.h" #include "storedProcErrorLookup.h" returnAuthorizationWorkbench::returnAuthorizationWorkbench(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_ra, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateReviewMenu(QMenu*,QTreeWidgetItem*))); connect(_radue, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateDueMenu(QMenu*,QTreeWidgetItem*))); connect(_query, SIGNAL(clicked()), this, SLOT(sFillLists())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_editdue, SIGNAL(clicked()), this, SLOT(sEditDue())); connect(_viewdue, SIGNAL(clicked()), this, SLOT(sViewDue())); connect(_printdue, SIGNAL(clicked()), this, SLOT(sPrintDue())); connect(_process, SIGNAL(clicked()), this, SLOT(sProcess())); connect(_radue, SIGNAL(valid(bool)), this, SLOT(sHandleButton())); connect(omfgThis, SIGNAL(returnAuthorizationsUpdated()), this, SLOT(sFillListReview())); connect(omfgThis, SIGNAL(returnAuthorizationsUpdated()), this, SLOT(sFillListDue())); _ra->addColumn(tr("Auth. #"), _orderColumn, Qt::AlignLeft, true, "rahead_number" ); _ra->addColumn(tr("Customer"), _bigMoneyColumn, Qt::AlignLeft, true, "cust_name" ); _ra->addColumn(tr("Authorized"), _dateColumn, Qt::AlignRight, true, "rahead_authdate" ); _ra->addColumn(tr("Expires"), _dateColumn, Qt::AlignRight, true, "rahead_expiredate" ); _ra->addColumn(tr("Disposition"), _itemColumn, Qt::AlignRight, true, "disposition" ); _ra->addColumn(tr("Credit By"), _itemColumn, Qt::AlignRight, true, "creditmethod" ); _ra->addColumn(tr("Awaiting"), -1, Qt::AlignCenter, true, "awaiting" ); _radue->addColumn(tr("Auth. #"), _orderColumn, Qt::AlignLeft, true, "rahead_number" ); _radue->addColumn(tr("Customer"), _bigMoneyColumn, Qt::AlignLeft, true, "cust_name" ); _radue->addColumn(tr("Authorized"), _dateColumn, Qt::AlignRight,true, "rahead_authdate"); _radue->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight,true, "amount" ); _radue->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight,true, "currency" ); _radue->addColumn(tr("Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _bigMoneyColumn, Qt::AlignRight,true, "baseamount" ); _radue->addColumn(tr("Credit By"), -1, Qt::AlignRight,true, "creditmethod" ); if (!_privileges->check("MaintainReturns")) { _new->setEnabled(false); _edit->setEnabled(false); _editdue->setEnabled(false); } if (_metrics->boolean("CCAccept") && _privileges->check("ProcessCreditCards")) { /* if (! CreditCardProcessor::getProcessor()) QMessageBox::warning(this, tr("Credit Card Processing error"), CreditCardProcessor::errorMsg()); */ } else { _creditcard->setChecked(false); _creditcard->hide(); } if (!_privileges->check("PostARDocuments")) { _postmemos->setChecked(false); _postmemos->setEnabled(false); } } returnAuthorizationWorkbench::~returnAuthorizationWorkbench() { // no need to delete child widgets, Qt does it all for us } void returnAuthorizationWorkbench::languageChange() { retranslateUi(this); } void returnAuthorizationWorkbench::sPrint() { ParameterList params; _customerSelector->appendValue(params); if(_expired->isChecked()) params.append("showExpired"); if(_unauthorized->isChecked()) params.append("showUnauthorized"); if (_closed->isChecked()) { params.append("showClosed"); _dates->appendValue(params); } if (_receipts->isChecked()) params.append("showReceipts"); if (_shipments->isChecked()) params.append("showShipments"); if (_payment->isChecked()) params.append("showPayments"); orReport report("ReturnAuthorizationWorkbenchReview", params); if (report.isValid()) report.print(); else report.reportError(this); } void returnAuthorizationWorkbench::sNew() { ParameterList params; params.append("mode", "new"); if (_customerSelector->isSelectedCust()) params.append("cust_id", _customerSelector->custId()); returnAuthorization *newdlg = new returnAuthorization(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void returnAuthorizationWorkbench::sEdit() { if (!checkSitePrivs(_ra->id())) return; ParameterList params; params.append("mode", "edit"); params.append("rahead_id", _ra->id()); returnAuthorization *newdlg = new returnAuthorization(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void returnAuthorizationWorkbench::sView() { if (!checkSitePrivs(_ra->id())) return; ParameterList params; params.append("mode", "view"); params.append("rahead_id", _ra->id()); returnAuthorization *newdlg = new returnAuthorization(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void returnAuthorizationWorkbench::sPrintDue() { ParameterList params; setParams(params); orReport report("ReturnAuthorizationWorkbenchDueCredit", params); if (report.isValid()) report.print(); else report.reportError(this); } void returnAuthorizationWorkbench::sEditDue() { if (!checkSitePrivs(_radue->id())) return; ParameterList params; params.append("mode", "edit"); params.append("rahead_id", _radue->id()); returnAuthorization *newdlg = new returnAuthorization(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void returnAuthorizationWorkbench::sViewDue() { if (!checkSitePrivs(_radue->id())) return; ParameterList params; params.append("mode", "view"); params.append("rahead_id", _radue->id()); returnAuthorization *newdlg = new returnAuthorization(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void returnAuthorizationWorkbench::sHandleButton() { _process->setEnabled(((_radue->altId() == 1 && _privileges->check("MaintainCreditMemos")) || (_radue->altId() == 2 && _privileges->check("MaintainPayments") && _privileges->check("MaintainCreditMemos") && _privileges->check("PostARDocuments")) || (_radue->altId() == 3 && _privileges->check("ProcessCreditCards") && _privileges->check("PostARDocuments") && _privileges->check("MaintainCreditMemos")))); if (_radue->altId() > 1) _postmemos->hide(); else _postmemos->show(); } void returnAuthorizationWorkbench::sProcess() { XSqlQuery returnProcess; if (!checkSitePrivs(_radue->id())) return; bool _post = ((_radue->altId() > 1) || (_radue->altId() == 1 && _postmemos->isChecked())) ; returnProcess.prepare("SELECT createRaCreditMemo(:rahead_id,:post) AS result;"); returnProcess.bindValue(":rahead_id",_radue->id()); returnProcess.bindValue(":post",QVariant(_post)); returnProcess.exec(); if (returnProcess.first()) { int cmheadid = returnProcess.value("result").toInt(); if (cmheadid < 0) { systemError(this, storedProcErrorLookup("createRaCreditMemo", cmheadid), __FILE__, __LINE__); return; } returnProcess.prepare( "SELECT cmhead_number " "FROM cmhead " "WHERE (cmhead_id=:cmhead_id);" ); returnProcess.bindValue(":cmhead_id", cmheadid); returnProcess.exec(); if (returnProcess.first()) { QMessageBox::information( this, tr("New Credit Memo Created"), tr("

    A new CreditMemo has been created and " "assigned #%1") .arg(returnProcess.value("cmhead_number").toString())); if (_printmemo->isChecked()) { ParameterList params; params.append("cmhead_id", cmheadid); if (_post) params.append("posted"); printCreditMemo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } if (_radue->altId() == 2) { ParameterList params; params.append("cmhead_id", cmheadid); returnAuthCheck newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillListDue(); } else if (_radue->altId() == 3) { ParameterList ccp; ccp.append("cmhead_id", cmheadid); MetaSQLQuery ccm = mqlLoad("creditMemoCreditCards", "detail"); XSqlQuery ccq = ccm.toQuery(ccp); if (ccq.first()) { int ccpayid = ccq.value("ccpay_id").toInt(); CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (! cardproc) QMessageBox::critical(this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); else if (! cardproc->errorMsg().isEmpty()) QMessageBox::critical(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else { QString docnum = returnProcess.value("cmhead_number").toString(); QString refnum = ccq.value("cohead_number").toString(); int refid = -1; int returnValue = cardproc->credit(ccq.value("ccard_id").toInt(), "-2", ccq.value("total").toDouble(), ccq.value("tax_in_cmcurr").toDouble(), ccq.value("cmhead_tax_id").isNull(), ccq.value("cmhead_freight").toDouble(), 0, ccq.value("cmhead_curr_id").toInt(), docnum, refnum, ccpayid, QString(), refid); if (returnValue < 0) QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); else if (returnValue > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (! cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); } // requery regardless 'cause the new credit memo means nothing's "due" sFillListDue(); } else if (ccq.lastError().type() != QSqlError::NoError) { systemError(this, ccq.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::critical(this, tr("Credit Card Processing Error"), tr("Could not find a Credit Card to use for " "this Credit transaction.")); sFillListDue(); return; } } else sFillListDue(); } else if (returnProcess.lastError().type() != QSqlError::NoError) { systemError(this, returnProcess.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (returnProcess.lastError().type() != QSqlError::NoError) { systemError(this, returnProcess.lastError().databaseText(), __FILE__, __LINE__); return; } } void returnAuthorizationWorkbench::setParams(ParameterList ¶ms) { _customerSelector->appendValue(params); params.append("credit", tr("Credit")); params.append("return", tr("Return")); params.append("replace", tr("Replace")); params.append("service", tr("Service")); params.append("none", tr("None")); params.append("creditmemo", tr("Memo")); params.append("check", tr("Check")); params.append("creditcard", tr("Card")); params.append("undefined", tr("Undefined")); params.append("payment", tr("Payment")); params.append("receipt", tr("Receipt")); params.append("ship", tr("Shipment")); params.append("never", tr("Never")); params.append("closed", tr("Closed")); if (_creditmemo->isChecked()) params.append("doM"); if (_check->isChecked()) params.append("doK"); if (_creditcard->isChecked()) params.append("doC"); if (!_expired->isChecked()) params.append("showUnexpired"); if (!_unauthorized->isChecked()) params.append("showAuthorized"); if (_closed->isChecked()) params.append("showClosed"); if (_receipts->isChecked() || _shipments->isChecked() || _payment->isChecked() || _closed->isChecked()) params.append("awaitingFilter"); if (_receipts->isChecked()) params.append("awaitingReceipts"); if (_shipments->isChecked()) params.append("awaitingShipments"); if (_payment->isChecked()) params.append("awaitingPayments"); _dates->appendValue(params); } void returnAuthorizationWorkbench::sFillLists() { if (_customerSelector->isSelectedCust() && _customerSelector->custId() == -1) { QMessageBox::information( this, tr("Customer not selected"), tr("

    Please select a customer.") ); _customerSelector->setFocus(); return; } sFillListReview(); sFillListDue(); } void returnAuthorizationWorkbench::sFillListReview() { _ra->clear(); //Fill Review List if (_closed->isChecked() && !_dates->allValid()) { QMessageBox::information( this, tr("Invalid Dates"), tr("

    Invalid dates specified. Please specify a " "valid date range.") ); _dates->setFocus(); return; } else if ((_receipts->isChecked()) || (_shipments->isChecked()) || (_payment->isChecked()) || (_closed->isChecked()) || (_unauthorized->isChecked())) { MetaSQLQuery mql = mqlLoad("returnauthorizationworkbench", "review"); ParameterList params; setParams(params); XSqlQuery rareview = mql.toQuery(params); _ra->populate(rareview); if (rareview.lastError().type() != QSqlError::NoError) { systemError(this, rareview.lastError().databaseText(), __FILE__, __LINE__); return; } } } void returnAuthorizationWorkbench::sFillListDue() { _radue->clear(); //Fill Due Credit List if ((_creditmemo->isChecked()) || (_check->isChecked()) || (_creditcard->isChecked())) { MetaSQLQuery mql = mqlLoad("returnauthorizationworkbench", "duecredit"); ParameterList params; setParams(params); XSqlQuery radue = mql.toQuery(params); _radue->populate(radue,TRUE); if (radue.lastError().type() != QSqlError::NoError) { systemError(this, radue.lastError().databaseText(), __FILE__, __LINE__); return; } } } bool returnAuthorizationWorkbench::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkRASitePrivs(:raheadid) AS result;"); check.bindValue(":raheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Return Authorization as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } void returnAuthorizationWorkbench::sPopulateReviewMenu(QMenu *pMenu, QTreeWidgetItem * /*pSelected*/) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainReturns")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); } void returnAuthorizationWorkbench::sPopulateDueMenu(QMenu *pMenu, QTreeWidgetItem * /*pSelected*/) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEditDue())); menuItem->setEnabled(_privileges->check("MaintainReturns")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sViewDue())); menuItem = pMenu->addAction(tr("Process..."), this, SLOT(sProcess())); menuItem->setEnabled((_radue->altId() == 1 && _privileges->check("MaintainCreditMemos")) || (_radue->altId() == 2 && _privileges->check("MaintainPayments") && _privileges->check("MaintainCreditMemos") && _privileges->check("PostARDocuments")) || (_radue->altId() == 3 && _privileges->check("ProcessCreditCards") && _privileges->check("PostARDocuments") && _privileges->check("MaintainCreditMemos"))); } qt-client-4.1.0/guiclient/returnAuthorizationWorkbench.h000066400000000000000000000031251217451700100235120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RETURNAUTHORIZATIONWORKBENCH_H #define RETURNAUTHORIZATIONWORKBENCH_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_returnAuthorizationWorkbench.h" class returnAuthorizationWorkbench : public XWidget, public Ui::returnAuthorizationWorkbench { Q_OBJECT public: returnAuthorizationWorkbench(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~returnAuthorizationWorkbench(); virtual bool checkSitePrivs(int ordid); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPrintDue(); virtual void sEditDue(); virtual void sViewDue(); virtual void sProcess(); virtual void sHandleButton(); virtual void sFillLists(); virtual void sFillListReview(); virtual void sFillListDue(); virtual void sPopulateReviewMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sPopulateDueMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); protected slots: virtual void languageChange(); virtual void setParams(ParameterList&); }; #endif // RETURNAUTHORIZATIONWORKBENCH_H qt-client-4.1.0/guiclient/returnAuthorizationWorkbench.ui000066400000000000000000000500461217451700100237040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. returnAuthorizationWorkbench 0 0 839 600 600 400 Return Authorization Workbench 12 12 Qt::Horizontal 0 20 0 &Close false false &Query Qt::Vertical QSizePolicy::Expanding 16 0 0 1 0 Review Returns Awaiting 12 Receipt Shipment Payment Include Expired true Unauthorized true Include Closed true false Qt::Horizontal 40 20 0 Return Authorizations: 0 true &Print false false true &New false false false Edit false false false View false false Qt::Vertical QSizePolicy::Expanding 16 46 Due Credit 5 Credit Memo Check Credit Card Qt::Horizontal 40 20 0 Returns Eligible for Credit: qt_scrollarea_viewport 0 5 true &Print false false false Edit false false false View false false false Process false false Qt::Vertical QSizePolicy::Expanding 16 46 5 Post Credit Memos Immediately Print Credit Memo Qt::Horizontal 40 20 CustomerSelector QWidget

    customerselector.h
    DateCluster QWidget
    datecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _tabReview _receipts _shipments _payment _unauthorized _expired _closed _ra _print _new _edit _view _close _query _viewdue _process _printdue _editdue _creditmemo _check _radue _postmemos _printmemo _creditcard _close clicked() returnAuthorizationWorkbench close() 554 25 302 223 _ra valid(bool) _edit setEnabled(bool) 256 312 540 262 _ra valid(bool) _view setEnabled(bool) 256 312 540 262 _radue valid(bool) _editdue setEnabled(bool) 256 286 545 218 _radue valid(bool) _viewdue setEnabled(bool) 256 286 545 241 _radue itemSelected(int) _editdue animateClick() 256 281 545 207 qt-client-4.1.0/guiclient/returnWoMaterialBatch.cpp000066400000000000000000000130051217451700100223460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "returnWoMaterialBatch.h" #include #include #include "inputManager.h" #include "distributeInventory.h" returnWoMaterialBatch::returnWoMaterialBatch(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery returnreturnWoMaterialBatch; setupUi(this); connect(_wo, SIGNAL(valid(bool)), _return, SLOT(setEnabled(bool))); connect(_return, SIGNAL(clicked()), this, SLOT(sReturn())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _captive = FALSE; _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); returnreturnWoMaterialBatch.bindValue(":date", _transDate->date()); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); // Change to Issued only //_wo->setType(cWoExploded | cWoReleased | cWoIssued); _wo->setType(cWoIssued); } returnWoMaterialBatch::~returnWoMaterialBatch() { // no need to delete child widgets, Qt does it all for us } void returnWoMaterialBatch::languageChange() { retranslateUi(this); } enum SetResponse returnWoMaterialBatch::set(const ParameterList &pParams) { XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); } return NoError; } void returnWoMaterialBatch::sReturn() { XSqlQuery returnReturn; if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return; } returnReturn.prepare( "SELECT wo_qtyrcv, wo_status " "FROM wo " "WHERE (wo_id=:wo_id);" ); returnReturn.bindValue(":wo_id", _wo->id()); returnReturn.exec(); if (returnReturn.first()) { if (_wo->method() == "A" && returnReturn.value("wo_qtyrcv").toDouble() != 0) { QMessageBox::warning( this, tr("Cannot return Work Order Material"), tr( "This Work Order has had material received against it\n" "and thus the material issued against it cannot be returned.\n" "You must instead return each Work Order Material item individually.\n" ) ); _wo->setId(-1); _wo->setFocus(); } else { if(returnReturn.value("wo_status").toString() == "E" || returnReturn.value("wo_status").toString() == "R" || returnReturn.value("wo_status").toString() == "I") { XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery items; items.prepare("SELECT womatl_id," " CASE WHEN wo_qtyord >= 0 THEN" " womatl_qtyiss" " ELSE" " ((womatl_qtyreq - womatl_qtyiss) * -1)" " END AS qty" " FROM wo, womatl, itemsite" " WHERE((wo_id=womatl_wo_id)" " AND (womatl_itemsite_id=itemsite_id)" " AND ( (wo_qtyord < 0) OR (womatl_issuemethod IN ('S','M')) )" " AND (womatl_wo_id=:wo_id))"); items.bindValue(":wo_id", _wo->id()); items.exec(); while(items.next()) { if(items.value("qty").toDouble() == 0.0) continue; returnReturn.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations returnReturn.prepare("SELECT returnWoMaterial(:womatl_id, :qty, 0, :date) AS result;"); returnReturn.bindValue(":womatl_id", items.value("womatl_id").toInt()); returnReturn.bindValue(":qty", items.value("qty").toDouble()); returnReturn.bindValue(":date", _transDate->date()); returnReturn.exec(); if (returnReturn.first()) { if (returnReturn.value("result").toInt() < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2, Error #%3.") .arg(__LINE__) .arg(_wo->id()) .arg(returnReturn.value("result").toInt()) ); return; } if (distributeInventory::SeriesAdjust(returnReturn.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Material Return"), tr("Transaction Canceled") ); return; } } else { rollback.exec(); systemError( this, tr("A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2.") .arg(__LINE__) .arg(_wo->id()) ); return; } returnReturn.exec("COMMIT;"); } } } } if (_captive) accept(); else { _wo->setId(-1); _wo->setFocus(); } } qt-client-4.1.0/guiclient/returnWoMaterialBatch.h000066400000000000000000000021001217451700100220050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RETURNWOMATERIALBATCH_H #define RETURNWOMATERIALBATCH_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_returnWoMaterialBatch.h" class returnWoMaterialBatch : public XDialog, public Ui::returnWoMaterialBatch { Q_OBJECT public: returnWoMaterialBatch(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~returnWoMaterialBatch(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sReturn(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // RETURNWOMATERIALBATCH_H qt-client-4.1.0/guiclient/returnWoMaterialBatch.ui000066400000000000000000000146731217451700100222150ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. returnWoMaterialBatch 0 0 514 252 Return Work Order Material Batch 12 12 Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 290 130 Qt::StrongFocus 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 &Cancel false &Post true Qt::Vertical QSizePolicy::Expanding 20 20 DLineEdit QWidget
    datecluster.h
    WoCluster QWidget
    wocluster.h
    _transDate _wo _return _close parameter.h _wo valid(bool) _return setEnabled(bool) 20 20 20 20 _close clicked() returnWoMaterialBatch reject() 20 20 20 20
    qt-client-4.1.0/guiclient/returnWoMaterialItem.cpp000066400000000000000000000124351217451700100222310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "returnWoMaterialItem.h" #include #include #include #include "distributeInventory.h" #include "inputManager.h" #include "storedProcErrorLookup.h" returnWoMaterialItem::returnWoMaterialItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_return, SIGNAL(clicked()), this, SLOT(sReturn())); connect(_womatl, SIGNAL(newId(int)), this, SLOT(sSetQOH(int))); connect(_qty, SIGNAL(textChanged(const QString&)), this, SLOT(sUpdateQty())); _captive = FALSE; _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _qty->setValidator(omfgThis->qtyVal()); _beforeQty->setPrecision(omfgThis->transQtyVal()); _afterQty->setPrecision(omfgThis->transQtyVal()); // Change to Issued only //_wo->setType(cWoExploded | cWoReleased | cWoIssued); _wo->setType(cWoIssued); } returnWoMaterialItem::~returnWoMaterialItem() { // no need to delete child widgets, Qt does it all for us } void returnWoMaterialItem::languageChange() { retranslateUi(this); } enum SetResponse returnWoMaterialItem::set(const ParameterList &pParams) { XSqlQuery returnet; XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("womatl_id", &valid); if (valid) { returnet.prepare("SELECT womatl_wo_id FROM womatl WHERE (womatl_id=:womatl_id); "); returnet.bindValue(":womatl_id", param.toInt()); returnet.exec(); if(returnet.first()) { _wo->setId(returnet.value("womatl_wo_id").toInt()); _wo->setEnabled(false); } if (valid) { _womatl->setId(param.toInt()); _womatl->setEnabled(false); } } return NoError; } void returnWoMaterialItem::sReturn() { if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return; } else if (!_wo->isValid()) { QMessageBox::critical( this, tr("Select Work Order"), tr("You must select the Work Order from which you with to return Materal") ); _wo->setFocus(); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery returnItem; returnItem.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations returnItem.prepare("SELECT returnWoMaterial(:womatl_id, :qty, :date) AS result;"); returnItem.bindValue(":womatl_id", _womatl->id()); returnItem.bindValue(":qty", _qty->toDouble()); returnItem.bindValue(":date", _transDate->date()); returnItem.exec(); if (returnItem.first()) { int result = returnItem.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("returnWoMaterial", result), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(returnItem.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Material Return"), tr("Transaction Canceled") ); return; } returnItem.exec("COMMIT;"); } else if (returnItem.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, returnItem.lastError().databaseText(), __FILE__, __LINE__); return; } if (_captive) accept(); else { _qty->clear(); _close->setText(tr("&Close")); _womatl->setWoid(_wo->id()); _womatl->setFocus(); } } void returnWoMaterialItem::sSetQOH(int pWomatlid) { if (pWomatlid == -1) { _cachedQOH = 0.0; _beforeQty->clear(); _afterQty->clear(); } else { if (_wo->method() == "A") _qty->setDouble(_womatl->qtyIssued()); else _qty->setDouble((_womatl->qtyIssued() - _womatl->qtyRequired())); XSqlQuery qoh; qoh.prepare( "SELECT itemuomtouom(itemsite_item_id, NULL, womatl_uom_id, itemsite_qtyonhand) AS qtyonhand," " uom_name " " FROM womatl, itemsite, uom" " WHERE((womatl_itemsite_id=itemsite_id)" " AND (womatl_uom_id=uom_id)" " AND (womatl_id=:womatl_id) );" ); qoh.bindValue(":womatl_id", pWomatlid); qoh.exec(); if (qoh.first()) { _uom->setText(qoh.value("uom_name").toString()); _cachedQOH = qoh.value("qtyonhand").toDouble(); _beforeQty->setDouble(_cachedQOH); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } sUpdateQty(); } void returnWoMaterialItem::sUpdateQty() { if (_womatl->isValid()) _afterQty->setDouble(_cachedQOH + _qty->toDouble()); } qt-client-4.1.0/guiclient/returnWoMaterialItem.h000066400000000000000000000022311217451700100216670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RETURNWOMATERIALITEM_H #define RETURNWOMATERIALITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_returnWoMaterialItem.h" class returnWoMaterialItem : public XDialog, public Ui::returnWoMaterialItem { Q_OBJECT public: returnWoMaterialItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~returnWoMaterialItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sReturn(); virtual void sSetQOH( int pWomatlid ); virtual void sUpdateQty(); protected slots: virtual void languageChange(); private: bool _captive; double _cachedQOH; }; #endif // RETURNWOMATERIALITEM_H qt-client-4.1.0/guiclient/returnWoMaterialItem.ui000066400000000000000000000301051217451700100220560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. returnWoMaterialItem 0 0 641 570 Return Work Order Material Item 12 12 Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::StrongFocus 0 0 0 170 Qt::StrongFocus Qt::Horizontal 40 20 Qt::AlignRight Qty. to Return: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight UOM: Qt::AlignCenter Qt::AlignCenter 80 0 QOH Before: Qt::AlignCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 QOH After: Qt::AlignCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 0 0 Qt::Vertical QSizePolicy::Expanding 0 20 5 0 &Cancel false &Post true Qt::Vertical QSizePolicy::Expanding 20 20 DLineEdit QWidget
    datecluster.h
    WoCluster QWidget
    wocluster.h
    WomatlCluster QWidget
    womatlcluster.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    _transDate _wo _womatl _qty _return _close _womatl valid(bool) _return setEnabled(bool) 20 20 20 20 _wo newId(int) _womatl setWoid(int) 20 20 20 20 _close clicked() returnWoMaterialItem reject() 20 20 20 20
    qt-client-4.1.0/guiclient/reverseGLSeries.cpp000066400000000000000000000073771217451700100211700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "reverseGLSeries.h" #include #include reverseGLSeries::reverseGLSeries(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_cancel, SIGNAL(clicked()), this, SLOT(reject())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _glseries = -1; } reverseGLSeries::~reverseGLSeries() { // no need to delete child widgets, Qt does it all for us } void reverseGLSeries::languageChange() { retranslateUi(this); } enum SetResponse reverseGLSeries::set( const ParameterList & pParams ) { XSqlQuery reverseet; XDialog::set(pParams); QVariant param; bool valid = false; param = pParams.value("glseries", &valid); if(valid) { _glseries = param.toInt(); reverseet.prepare("SELECT gltrans_journalnumber AS journalnumber, gltrans_date AS transdate " "FROM gltrans " "WHERE (gltrans_sequence=:glseries) " "UNION " "SELECT sltrans_journalnumber AS journalnumber, sltrans_date AS transdate " "FROM sltrans " "WHERE (sltrans_sequence=:glseries); " ); reverseet.bindValue(":glseries", _glseries); reverseet.exec(); if(reverseet.first()) { _notes->setText(tr("Reversal for Journal #") + reverseet.value("journalnumber").toString()); _journalNum->setText(reverseet.value("journalnumber").toString()); _distDate->setDate(reverseet.value("transdate").toDate()); } else { systemError( this, tr("A System Error occurred at reverseGLSeries::%1.") .arg(__LINE__) ); return UndefinedError; } } return NoError; } void reverseGLSeries::sPost() { XSqlQuery reversePost; if(!_distDate->isValid()) { QMessageBox::warning(this, tr("Cannot Reverse Series"), tr("A valid distribution date must be entered before the G/L Series can be reversed.") ); _distDate->setFocus(); return; } if(_metrics->boolean("MandatoryGLEntryNotes") && _notes->toPlainText().trimmed().isEmpty()) { QMessageBox::information( this, tr("Cannot Post G/L Series"), tr("You must enter some Notes to describe this transaction.") ); _notes->setFocus(); return; } reversePost.prepare("SELECT reverseGLSeries(:glseries, :distdate, :notes) AS result;"); reversePost.bindValue(":glseries", _glseries); reversePost.bindValue(":distdate", _distDate->date()); reversePost.bindValue(":notes", _notes->toPlainText()); reversePost.exec(); if(reversePost.first()) { int result = reversePost.value("result").toInt(); if(result < 0) { switch(result) { case -1: default: QMessageBox::warning( this, tr("Error Reversing G/L Series"), tr("An Unknown Error was encountered while reversing the G/L Series.") ); } return; } else QMessageBox::information( this, tr("Reversed G/L Series"), tr("Reversing Journal #%1 was sucessfully created.").arg(reversePost.value("result").toString()) ); } else systemError( this, tr("A System Error occurred at reverseGLSeries::%1.") .arg(__LINE__) ); accept(); } qt-client-4.1.0/guiclient/reverseGLSeries.h000066400000000000000000000020131217451700100206130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef REVERSEGLSERIES_H #define REVERSEGLSERIES_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_reverseGLSeries.h" class reverseGLSeries : public XDialog, public Ui::reverseGLSeries { Q_OBJECT public: reverseGLSeries(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~reverseGLSeries(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sPost(); protected: int _glseries; protected slots: virtual void languageChange(); }; #endif // REVERSEGLSERIES_H qt-client-4.1.0/guiclient/reverseGLSeries.ui000066400000000000000000000121511217451700100210050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. reverseGLSeries 0 0 438 326 Reverse Journal 0 Journal Number: Distribution Date: JOURNAL NUMBER Qt::Vertical QSizePolicy::Expanding 20 0 0 Qt::Horizontal QSizePolicy::Expanding 40 0 &Post &Cancel Qt::Vertical QSizePolicy::Minimum 20 0 0 Notes: DLineEdit QWidget
    datecluster.h
    XTextEdit QTextEdit
    xtextedit.h
    _distDate _notes _cancel _cancel clicked() reverseGLSeries reject() 20 20 20 20
    qt-client-4.1.0/guiclient/sale.cpp000066400000000000000000000123471217451700100170340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "sale.h" #include #include sale::sale(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _saleid = -1; connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _ipshead->populate( QString( "SELECT ipshead_id, ipshead_name " "FROM ipshead " "ORDER BY ipshead_name;" ) ); } sale::~sale() { // no need to delete child widgets, Qt does it all for us } void sale::languageChange() { retranslateUi(this); } enum SetResponse sale::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("sale_id", &valid); if (valid) { _saleid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _dates->setEnabled(FALSE); _ipshead->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void sale::sSave() { XSqlQuery saleSave; _name->setText(_name->text().trimmed()); if (_name->text().length() == 0) { QMessageBox::critical( this, tr("Enter Sale Name"), tr("You must enter a name for this Sale before saving it.") ); _name->setFocus(); return; } saleSave.prepare("SELECT sale_id" " FROM sale" " WHERE((sale_name=:sale_name)" " AND (sale_id != :sale_id))"); saleSave.bindValue(":sale_id", _saleid); saleSave.bindValue(":sale_name", _name->text().trimmed()); saleSave.exec(); if(saleSave.first()) { QMessageBox::critical( this, tr("Cannot Save Sale"), tr("You cannot enter a duplicate name for this Sale before saving it.") ); _name->setFocus(); return; } if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Start Date"), tr("You must enter a start date for this Sale.") ); _dates->setFocus(); return; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter End Date"), tr("You must enter an end date for this Sale.") ); _dates->setFocus(); return; } if (_dates->endDate() < _dates->startDate()) { QMessageBox::critical( this, tr("Invalid End Date"), tr("The start date cannot be earlier than the end date.") ); _dates->setFocus(); return; } if (_mode == cNew) { saleSave.exec("SELECT NEXTVAL('sale_sale_id_seq') AS _sale_id;"); if (saleSave.first()) _saleid = saleSave.value("_sale_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } saleSave.prepare( "INSERT INTO sale " "( sale_id, sale_name, sale_descrip," " sale_ipshead_id, sale_startdate, sale_enddate ) " "VALUES " "( :sale_id, :sale_name, :sale_descrip," " :sale_ipshead_id, :sale_startdate, :sale_enddate );" ); } else saleSave.prepare( "UPDATE sale " "SET sale_name=:sale_name, sale_descrip=:sale_descrip," " sale_ipshead_id=:sale_ipshead_id," " sale_startdate=:sale_startdate, sale_enddate=:sale_enddate " "WHERE (sale_id=:sale_id);" ); saleSave.bindValue(":sale_id", _saleid); saleSave.bindValue(":sale_name", _name->text()); saleSave.bindValue(":sale_descrip", _description->text()); saleSave.bindValue(":sale_ipshead_id", _ipshead->id()); saleSave.bindValue(":sale_startdate", _dates->startDate()); saleSave.bindValue(":sale_enddate", _dates->endDate()); saleSave.exec(); done(_saleid); } void sale::populate() { XSqlQuery salepopulate; salepopulate.prepare( "SELECT sale_name, sale_descrip, sale_ipshead_id," " sale_startdate, sale_enddate " "FROM sale " "WHERE (sale_id=:sale_id);" ); salepopulate.bindValue(":sale_id", _saleid); salepopulate.exec(); if (salepopulate.first()) { _name->setText(salepopulate.value("sale_name").toString()); _description->setText(salepopulate.value("sale_descrip").toString()); _dates->setStartDate(salepopulate.value("sale_startdate").toDate()); _dates->setEndDate(salepopulate.value("sale_enddate").toDate()); _ipshead->setId(salepopulate.value("sale_ipshead_id").toInt()); } } qt-client-4.1.0/guiclient/sale.h000066400000000000000000000017421217451700100164760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALE_H #define SALE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_sale.h" class sale : public XDialog, public Ui::sale { Q_OBJECT public: sale(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~sale(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); private: int _mode; int _saleid; }; #endif // SALE_H qt-client-4.1.0/guiclient/sale.ui000066400000000000000000000141051217451700100166610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. sale 0 0 337 166 Sale 7 5 0 5 Schedule: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 0 5 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 20 DateCluster QWidget
    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _name _description _ipshead _save _close parameter.h _close clicked() sale reject() 20 20 20 20
    qt-client-4.1.0/guiclient/saleType.cpp000066400000000000000000000072741217451700100177010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "saleType.h" #include #include "mqlutil.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include #include saleType::saleType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _saletypeid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } saleType::~saleType() { // no need to delete child widgets, Qt does it all for us } void saleType::languageChange() { retranslateUi(this); } enum SetResponse saleType::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("saletype_id", &valid); if (valid) { _saletypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(false); _active->setEnabled(false); _description->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void saleType::sSave() { XSqlQuery saleTypeSave; QList errors; errors << GuiErrorCheck(_code->text().length() == 0, _code, tr("You must enter a valid Sale Type Code " "before continuing")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Sale Type"), errors)) return; MetaSQLQuery mql = mqlLoad("saletype", "table"); ParameterList params; if (_mode == cNew) params.append("NewMode"); else { params.append("EditMode"); params.append("saletype_id", _saletypeid); } params.append("saletype_code", _code->text()); params.append("saletype_descr", _description->text()); params.append("saletype_active", QVariant(_active->isChecked())); saleTypeSave = mql.toQuery(params); if (saleTypeSave.first() && _mode == cNew) _saletypeid = saleTypeSave.value("saletype_id").toInt(); done(_saletypeid); } void saleType::sCheck() { _code->setText(_code->text().trimmed()); if ( (_mode == cNew) && (_code->text().length()) ) { MetaSQLQuery mql = mqlLoad("saletype", "table"); ParameterList params; params.append("ViewMode"); params.append("saletype_code", _code->text()); XSqlQuery saleTypeCheck = mql.toQuery(params); if (saleTypeCheck.first()) { _saletypeid = saleTypeCheck.value("saletype_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void saleType::populate() { MetaSQLQuery mql = mqlLoad("saletype", "table"); ParameterList params; params.append("ViewMode"); params.append("saletype_id", _saletypeid); XSqlQuery saleTypePopulate = mql.toQuery(params); if (saleTypePopulate.first()) { _code->setText(saleTypePopulate.value("saletype_code")); _description->setText(saleTypePopulate.value("saletype_descr")); _active->setChecked(saleTypePopulate.value("saletype_active").toBool()); } } qt-client-4.1.0/guiclient/saleType.h000066400000000000000000000020411217451700100173310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALETYPE_H #define SALETYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_saleType.h" class saleType : public XDialog, public Ui::saleType { Q_OBJECT public: saleType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~saleType(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _mode; int _saletypeid; }; #endif // SALETYPE_H qt-client-4.1.0/guiclient/saleType.ui000066400000000000000000000120701217451700100175220ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. saleType 0 0 430 86 Sale Type 0 5 5 &Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal 40 20 Active true Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _code _active _description _buttonBox parameter.h
    qt-client-4.1.0/guiclient/saleTypes.cpp000066400000000000000000000072321217451700100200560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "saleTypes.h" #include #include #include #include #include "mqlutil.h" #include #include #include "saleType.h" #include "storedProcErrorLookup.h" #include "errorReporter.h" #include "guiclient.h" saleTypes::saleTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_saletype, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); _saletype->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "saletype_code" ); _saletype->addColumn(tr("Active"), _ynColumn, Qt::AlignCenter, true, "saletype_active" ); _saletype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "saletype_descr" ); if (_privileges->check("MaintainSaleTypes")) { connect(_saletype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_saletype, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_saletype, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_saletype, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(-1); } saleTypes::~saleTypes() { // no need to delete child widgets, Qt does it all for us } void saleTypes::languageChange() { retranslateUi(this); } void saleTypes::sDelete() { MetaSQLQuery mql = mqlLoad("saletype", "table"); ParameterList params; params.append("DeleteMode"); params.append("saletype_id", _saletype->id()); XSqlQuery saleTypeDelete = mql.toQuery(params); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error deleting Sale Type"), saleTypeDelete, __FILE__, __LINE__)) return; sFillList(-1); } void saleTypes::sNew() { ParameterList params; params.append("mode", "new"); saleType newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void saleTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("saletype_id", _saletype->id()); saleType newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void saleTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("saletype_id", _saletype->id()); saleType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void saleTypes::sFillList(int pId) { MetaSQLQuery mql = mqlLoad("saletype", "table"); ParameterList params; params.append("ViewMode"); XSqlQuery saleTypePopulate = mql.toQuery(params); _saletype->populate( saleTypePopulate, pId ); } void saleTypes::sPrint() { orReport report("SaleTypesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/saleTypes.h000066400000000000000000000017261217451700100175250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALETYPES_H #define SALETYPES_H #include "xwidget.h" #include "ui_saleTypes.h" class saleTypes : public XWidget, public Ui::saleTypes { Q_OBJECT public: saleTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~saleTypes(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList( int pId ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // SALETYPES_H qt-client-4.1.0/guiclient/saleTypes.ui000066400000000000000000000110401217451700100177010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. saleTypes 0 0 600 400 List Sale Types 0 Sale Type: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _saletype _new _edit _view _delete _print _close _close clicked() saleTypes close() 20 20 20 20 _saletype valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/sales.cpp000066400000000000000000000056561217451700100172240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "sales.h" #include #include #include #include "sale.h" #include "guiclient.h" sales::sales(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_sale, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_sale, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_sale, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); _sale->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "sale_name" ); _sale->addColumn(tr("Schedule"), -1 , Qt::AlignLeft, true, "ipshead_name" ); _sale->addColumn(tr("Start"), _dateColumn, Qt::AlignCenter, true, "sale_startdate" ); _sale->addColumn(tr("End"), _dateColumn, Qt::AlignCenter, true, "sale_enddate" ); sFillList(); } sales::~sales() { // no need to delete child widgets, Qt does it all for us } void sales::languageChange() { retranslateUi(this); } void sales::sNew() { ParameterList params; params.append("mode", "new"); sale newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) sFillList(); } void sales::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("sale_id", _sale->id()); sale newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) sFillList(); } void sales::sDelete() { if (QMessageBox::question(this, tr("Delete Selected Sale?"), tr("

    Are you sure that you want to delete the " "selected Sale?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery salesDelete; salesDelete.prepare( "DELETE FROM sale " "WHERE (sale_id=:sale_id);" ); salesDelete.bindValue(":sale_id", _sale->id()); salesDelete.exec(); sFillList(); } } void sales::sFillList() { QString sql( "SELECT sale_id, sale_name, ipshead_name," " sale_startdate, sale_enddate " "FROM sale, ipshead " "WHERE (sale_ipshead_id=ipshead_id) " "ORDER BY sale_name;" ); _sale->populate(sql); } qt-client-4.1.0/guiclient/sales.h000066400000000000000000000015701217451700100166600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALES_H #define SALES_H #include "xwidget.h" #include "ui_sales.h" class sales : public XWidget, public Ui::sales { Q_OBJECT public: sales(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~sales(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SALES_H qt-client-4.1.0/guiclient/sales.ui000066400000000000000000000125471217451700100170540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. sales 0 0 588 214 0 List Sales 0 0 Sales: 7 7 0 0 0 5 &Close 0 0 &New false &Edit false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget

    xtreewidget.h
    0 _sale _new _edit _delete _close _sale valid(bool) _delete setEnabled(bool) _sale itemSelected(int) _edit animateClick() _sale valid(bool) _edit setEnabled(bool) _close clicked() sales close() qt-client-4.1.0/guiclient/salesAccount.cpp000066400000000000000000000321031217451700100205240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "errorReporter.h" #include "guiErrorCheck.h" #include "salesAccount.h" #include #include #include #include salesAccount::salesAccount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); ParameterList params; params.append("any", tr("Any")); MetaSQLQuery warehousemql("SELECT -1, AS warehous_code, 0 AS sort " "UNION SELECT warehous_id, warehous_code, 1 AS sort " "FROM whsinfo " "ORDER BY sort, warehous_code"); _warehouse->populate(warehousemql.toQuery(params)); MetaSQLQuery shippingzonemql("SELECT -1, AS shipzone_name, 0 AS sort " "UNION SELECT shipzone_id, shipzone_name, 1 AS sort " "FROM shipzone " "ORDER BY sort, shipzone_name"); _shippingZones->populate(shippingzonemql.toQuery(params)); MetaSQLQuery saletypemql("SELECT -1, AS saletype_code, 0 AS sort " "UNION SELECT saletype_id, saletype_code, 1 AS sort " "FROM saletype " "WHERE (saletype_active) " "ORDER BY sort, saletype_code"); _saleTypes->populate(saletypemql.toQuery(params)); _customerTypes->setType(ParameterGroup::CustomerType); _productCategories->setType(ParameterGroup::ProductCategory); if (! _metrics->boolean("EnableReturnAuth")) { _corLit->setVisible(false); _cor->setVisible(false); _returnsLit->setVisible(false); _returns->setVisible(false); _cowLit->setVisible(false); _cow->setVisible(false); } _sales->setType(GLCluster::cRevenue); _credit->setType(GLCluster::cRevenue); _cos->setType(GLCluster::cExpense); _returns->setType(GLCluster::cRevenue); _cor->setType(GLCluster::cExpense); _cow->setType(GLCluster::cExpense); } salesAccount::~salesAccount() { // no need to delete child widgets, Qt does it all for us } void salesAccount::languageChange() { retranslateUi(this); } enum SetResponse salesAccount::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("salesaccnt_id", &valid); if (valid) { _salesaccntid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _warehouse->setEnabled(FALSE); _shippingZones->setEnabled(FALSE); _saleTypes->setEnabled(FALSE); _customerTypes->setEnabled(FALSE); _productCategories->setEnabled(FALSE); _sales->setReadOnly(TRUE); _credit->setReadOnly(TRUE); _cos->setReadOnly(TRUE); _returns->setReadOnly(TRUE); _cor->setReadOnly(TRUE); _cow->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void salesAccount::sSave() { XSqlQuery salesSave; QList errors; if (_metrics->boolean("InterfaceARToGL")) { errors << GuiErrorCheck(!_sales->isValid(), _sales, tr("

    You must select a Sales Account for this Assignment.")) << GuiErrorCheck(!_credit->isValid(), _credit, tr("

    You must select a Credit Memo Account for this Assignment.")) << GuiErrorCheck(!_cos->isValid(), _cos, tr("

    You must select a Cost of Sales Account for this Assignment.")) << GuiErrorCheck(_metrics->boolean("EnableReturnAuth") && !_returns->isValid(), _returns, tr("

    You must select a Returns Account for this Assignment.")) << GuiErrorCheck(_metrics->boolean("EnableReturnAuth") && !_cor->isValid(), _cor, tr("

    You must select a Cost of Returns Account for this Assignment.")) << GuiErrorCheck(_metrics->boolean("EnableReturnAuth") && !_cow->isValid(), _cow, tr("

    You must select a Cost of Warranty Account for this Assignment.")) ; } salesSave.prepare("SELECT salesaccnt_id" " FROM salesaccnt" " WHERE((salesaccnt_warehous_id=:salesaccnt_warehous_id)" " AND (salesaccnt_shipzone_id=:salesaccnt_shipzone_id)" " AND (salesaccnt_saletype_id=:salesaccnt_saletype_id)" " AND (salesaccnt_custtype=:salesaccnt_custtype)" " AND (salesaccnt_custtype_id=:salesaccnt_custtype_id)" " AND (salesaccnt_prodcat=:salesaccnt_prodcat)" " AND (salesaccnt_prodcat_id=:salesaccnt_prodcat_id)" " AND (salesaccnt_id != :salesaccnt_id))"); salesSave.bindValue(":salesaccnt_id", _salesaccntid); salesSave.bindValue(":salesaccnt_warehous_id", _warehouse->id()); salesSave.bindValue(":salesaccnt_shipzone_id", _shippingZones->id()); salesSave.bindValue(":salesaccnt_saletype_id", _saleTypes->id()); if (_customerTypes->isAll()) { salesSave.bindValue(":salesaccnt_custtype", ".*"); salesSave.bindValue(":salesaccnt_custtype_id", -1); } else if (_customerTypes->isSelected()) { salesSave.bindValue(":salesaccnt_custtype", "[^a-zA-Z0-9_]"); salesSave.bindValue(":salesaccnt_custtype_id", _customerTypes->id()); } else { salesSave.bindValue(":salesaccnt_custtype", _customerTypes->pattern()); salesSave.bindValue(":salesaccnt_custtype_id", -1); } if (_productCategories->isAll()) { salesSave.bindValue(":salesaccnt_prodcat", ".*"); salesSave.bindValue(":salesaccnt_prodcat_id", -1); } else if (_productCategories->isSelected()) { salesSave.bindValue(":salesaccnt_prodcat", "[^a-zA-Z0-9_]"); salesSave.bindValue(":salesaccnt_prodcat_id", _productCategories->id()); } else { salesSave.bindValue(":salesaccnt_prodcat", _productCategories->pattern()); salesSave.bindValue(":salesaccnt_prodcat_id", -1); } salesSave.exec(); if(salesSave.first()) { errors << GuiErrorCheck(true, _warehouse, tr("

    You cannot specify a duplicate Warehouse/Customer Type/Product Category for the Sales Account Assignment.")); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Sales Account Assignment"), errors)) return; if (_mode == cNew) { salesSave.prepare( "INSERT INTO salesaccnt " "( salesaccnt_warehous_id," " salesaccnt_shipzone_id, salesaccnt_saletype_id," " salesaccnt_custtype, salesaccnt_custtype_id," " salesaccnt_prodcat, salesaccnt_prodcat_id," " salesaccnt_sales_accnt_id," " salesaccnt_credit_accnt_id," " salesaccnt_cos_accnt_id," " salesaccnt_returns_accnt_id," " salesaccnt_cor_accnt_id," " salesaccnt_cow_accnt_id) " "VALUES " "( :salesaccnt_warehous_id," " :salesaccnt_shipzone_id, :salesaccnt_saletype_id," " :salesaccnt_custtype, :salesaccnt_custtype_id," " :salesaccnt_prodcat, :salesaccnt_prodcat_id," " :salesaccnt_sales_accnt_id," " :salesaccnt_credit_accnt_id," " :salesaccnt_cos_accnt_id," " :salesaccnt_returns_accnt_id," " :salesaccnt_cor_accnt_id," " :salesaccnt_cow_accnt_id ) " "RETURNING salesaccnt_id;" ); } else if (_mode == cEdit) salesSave.prepare( "UPDATE salesaccnt " "SET salesaccnt_warehous_id=:salesaccnt_warehous_id," " salesaccnt_shipzone_id=:salesaccnt_shipzone_id," " salesaccnt_saletype_id=:salesaccnt_saletype_id," " salesaccnt_custtype=:salesaccnt_custtype," " salesaccnt_custtype_id=:salesaccnt_custtype_id," " salesaccnt_prodcat=:salesaccnt_prodcat," " salesaccnt_prodcat_id=:salesaccnt_prodcat_id," " salesaccnt_sales_accnt_id=:salesaccnt_sales_accnt_id," " salesaccnt_credit_accnt_id=:salesaccnt_credit_accnt_id," " salesaccnt_cos_accnt_id=:salesaccnt_cos_accnt_id," " salesaccnt_returns_accnt_id=:salesaccnt_returns_accnt_id," " salesaccnt_cor_accnt_id=:salesaccnt_cor_accnt_id," " salesaccnt_cow_accnt_id=:salesaccnt_cow_accnt_id " "WHERE (salesaccnt_id=:salesaccnt_id);" ); salesSave.bindValue(":salesaccnt_id", _salesaccntid); salesSave.bindValue(":salesaccnt_sales_accnt_id", _sales->id()); salesSave.bindValue(":salesaccnt_credit_accnt_id", _credit->id()); salesSave.bindValue(":salesaccnt_cos_accnt_id", _cos->id()); if (_returns->isValid()) salesSave.bindValue(":salesaccnt_returns_accnt_id", _returns->id()); if (_cor->isValid()) salesSave.bindValue(":salesaccnt_cor_accnt_id", _cor->id()); if (_cow->isValid()) salesSave.bindValue(":salesaccnt_cow_accnt_id", _cow->id()); salesSave.bindValue(":salesaccnt_warehous_id", _warehouse->id()); salesSave.bindValue(":salesaccnt_shipzone_id", _shippingZones->id()); salesSave.bindValue(":salesaccnt_saletype_id", _saleTypes->id()); if (_customerTypes->isAll()) { salesSave.bindValue(":salesaccnt_custtype", ".*"); salesSave.bindValue(":salesaccnt_custtype_id", -1); } else if (_customerTypes->isSelected()) { salesSave.bindValue(":salesaccnt_custtype", "[^a-zA-Z0-9_]"); salesSave.bindValue(":salesaccnt_custtype_id", _customerTypes->id()); } else { salesSave.bindValue(":salesaccnt_custtype", _customerTypes->pattern()); salesSave.bindValue(":salesaccnt_custtype_id", -1); } if (_productCategories->isAll()) { salesSave.bindValue(":salesaccnt_prodcat", ".*"); salesSave.bindValue(":salesaccnt_prodcat_id", -1); } else if (_productCategories->isSelected()) { salesSave.bindValue(":salesaccnt_prodcat", "[^a-zA-Z0-9_]"); salesSave.bindValue(":salesaccnt_prodcat_id", _productCategories->id()); } else { salesSave.bindValue(":salesaccnt_prodcat", _productCategories->pattern()); salesSave.bindValue(":salesaccnt_prodcat_id", -1); } salesSave.exec(); if (_mode == cNew && salesSave.first()) _salesaccntid = salesSave.value("salesaccnt_id").toInt(); else if (salesSave.lastError().type() != QSqlError::NoError) { systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_salesaccntid); } void salesAccount::populate() { XSqlQuery salespopulate; salespopulate.prepare( "SELECT * " "FROM salesaccnt " "WHERE (salesaccnt_id=:salesaccnt_id);" ); salespopulate.bindValue(":salesaccnt_id", _salesaccntid); salespopulate.exec(); if (salespopulate.first()) { _warehouse->setId(salespopulate.value("salesaccnt_warehous_id").toInt()); _shippingZones->setId(salespopulate.value("salesaccnt_shipzone_id").toInt()); _saleTypes->setId(salespopulate.value("salesaccnt_saletype_id").toInt()); if (salespopulate.value("salesaccnt_custtype_id").toInt() != -1) _customerTypes->setId(salespopulate.value("salesaccnt_custtype_id").toInt()); else if (salespopulate.value("salesaccnt_custtype").toString() != ".*") _customerTypes->setPattern(salespopulate.value("salesaccnt_custtype").toString()); if (salespopulate.value("salesaccnt_prodcat_id").toInt() != -1) _productCategories->setId(salespopulate.value("salesaccnt_prodcat_id").toInt()); else if (salespopulate.value("salesaccnt_prodcat").toString() != ".*") _productCategories->setPattern(salespopulate.value("salesaccnt_prodcat").toString()); _sales->setId(salespopulate.value("salesaccnt_sales_accnt_id").toInt()); _credit->setId(salespopulate.value("salesaccnt_credit_accnt_id").toInt()); _cos->setId(salespopulate.value("salesaccnt_cos_accnt_id").toInt()); if (!salespopulate.value("salesaccnt_returns_accnt_id").isNull()) _returns->setId(salespopulate.value("salesaccnt_returns_accnt_id").toInt()); if (!salespopulate.value("salesaccnt_cor_accnt_id").isNull()) _cor->setId(salespopulate.value("salesaccnt_cor_accnt_id").toInt()); if (!salespopulate.value("salesaccnt_cow_accnt_id").isNull()) _cow->setId(salespopulate.value("salesaccnt_cow_accnt_id").toInt()); } else if (salespopulate.lastError().type() != QSqlError::NoError) { systemError(this, salespopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/salesAccount.h000066400000000000000000000020461217451700100201740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESACCOUNT_H #define SALESACCOUNT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_salesAccount.h" class salesAccount : public XDialog, public Ui::salesAccount { Q_OBJECT public: salesAccount(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~salesAccount(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); private: int _mode; int _salesaccntid; }; #endif // SALESACCOUNT_H qt-client-4.1.0/guiclient/salesAccount.ui000066400000000000000000000216351217451700100203670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesAccount 0 0 448 574 Sales Account Assignment 5 &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse 0 false Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save false false Shipping Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 200 26 false Sale Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal 40 20 Inventory Sa&les Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _sales Credit &Memo Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _credit C&ost of Sales Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _cos &Returns Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _returns Cost of R&eturns Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _cor Cost of W&arranty Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _cow GLCluster QWidget

    glcluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    XComboBox QComboBox
    xcombobox.h
    _warehouse _customerTypes _productCategories _sales _credit _cos _buttonBox rejected() salesAccount reject() 481 91 263 288 qt-client-4.1.0/guiclient/salesAccounts.cpp000066400000000000000000000113501217451700100207100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesAccounts.h" #include #include #include "mqlutil.h" #include #include #include #include "salesAccount.h" #include "guiclient.h" salesAccounts::salesAccounts(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _salesaccnt->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter , true, "warehouscode"); _salesaccnt->addColumn(tr("Cust. Type"), _itemColumn, Qt::AlignCenter , true, "custtypecode"); _salesaccnt->addColumn(tr("Shipping Zone"), _itemColumn, Qt::AlignCenter , true, "shipzonecode"); _salesaccnt->addColumn(tr("Sale Type"), _itemColumn, Qt::AlignCenter , true, "saletypecode"); _salesaccnt->addColumn(tr("Prod. Cat."), _itemColumn, Qt::AlignCenter , true, "prodcatcode"); _salesaccnt->addColumn(tr("Sales Accnt. #"), _itemColumn, Qt::AlignCenter , true, "salesaccount"); _salesaccnt->addColumn(tr("Credit Accnt. #"), _itemColumn, Qt::AlignCenter , true, "creditaccount"); _salesaccnt->addColumn(tr("COS Accnt. #"), _itemColumn, Qt::AlignCenter , true, "cosaccount"); _salesaccnt->addColumn(tr("Returns Accnt. #"), _itemColumn, Qt::AlignCenter , true, "returnsaccount"); _salesaccnt->addColumn(tr("Cost of Returns Accnt. #"), _itemColumn, Qt::AlignCenter , true, "coraccount" ); _salesaccnt->addColumn(tr("Cost of Warranty Accnt. #"), _itemColumn, Qt::AlignCenter , true, "cowaccount" ); if (! _metrics->boolean("EnableReturnAuth")) { _salesaccnt->hideColumn("returnsaccount");; _salesaccnt->hideColumn("coraccount"); _salesaccnt->hideColumn("cowaccount"); } if (_privileges->check("MaintainSalesAccount")) { connect(_salesaccnt, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_salesaccnt, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_salesaccnt, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_salesaccnt, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } salesAccounts::~salesAccounts() { // no need to delete child widgets, Qt does it all for us } void salesAccounts::languageChange() { retranslateUi(this); } void salesAccounts::sPrint() { orReport report("SalesAccountAssignmentsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void salesAccounts::sNew() { ParameterList params; params.append("mode", "new"); salesAccount newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void salesAccounts::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("salesaccnt_id", _salesaccnt->id()); salesAccount newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void salesAccounts::sView() { ParameterList params; params.append("mode", "view"); params.append("salesaccnt_id", _salesaccnt->id()); salesAccount newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void salesAccounts::sDelete() { XSqlQuery salesDelete; salesDelete.prepare( "DELETE FROM salesaccnt " "WHERE (salesaccnt_id=:salesaccnt_id);" ); salesDelete.bindValue(":salesaccnt_id", _salesaccnt->id()); salesDelete.exec(); if (salesDelete.lastError().type() != QSqlError::NoError) { systemError(this, salesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void salesAccounts::sFillList() { MetaSQLQuery mql = mqlLoad("salesAccounts", "detail"); ParameterList params; params.append("any", tr("Any")); params.append("notapplicable", tr("N/A")); XSqlQuery fillq = mql.toQuery(params); _salesaccnt->populate(fillq); if (fillq.lastError().type() != QSqlError::NoError) { systemError(this, fillq.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/salesAccounts.h000066400000000000000000000017551217451700100203650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESACCOUNTS_H #define SALESACCOUNTS_H #include "xwidget.h" #include "ui_salesAccounts.h" class salesAccounts : public XWidget, public Ui::salesAccounts { Q_OBJECT public: salesAccounts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~salesAccounts(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SALESACCOUNTS_H qt-client-4.1.0/guiclient/salesAccounts.ui000066400000000000000000000121761217451700100205520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesAccounts 0 0 600 400 List Sales Account Assignments 0 0 0 0 20 Sales Account Assignments: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _salesaccnt _new _view _delete _print _close _close clicked() salesAccounts close() 20 20 20 20 _salesaccnt valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/salesCategories.cpp000066400000000000000000000134121217451700100212170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesCategories.h" #include #include #include #include "salesCategory.h" salesCategories::salesCategories(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_salescat, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); _salescat->addColumn(tr("Category"), _itemColumn, Qt::AlignLeft, true, "salescat_name" ); _salescat->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "salescat_descrip" ); if (_privileges->check("MaintainSalesCategories")) { connect(_salescat, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_salescat, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_salescat, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_salescat, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_salescat, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } salesCategories::~salesCategories() { // no need to delete child widgets, Qt does it all for us } void salesCategories::languageChange() { retranslateUi(this); } void salesCategories::sDelete() { XSqlQuery salesDelete; salesDelete.prepare("SELECT deleteSalesCategory(:salescat_id) AS result;"); salesDelete.bindValue(":salescat_id", _salescat->id()); salesDelete.exec(); if (salesDelete.first()) { int result = salesDelete.value("result").toInt(); switch (result) { case -1: QMessageBox::warning( this, tr("Cannot Delete Sales Category"), tr( "The selected Sales Category cannot be deleted as there are unposted Invoice Lines assigned to it.\n" "You must reassign these Invoice Lines before you may delete the selected Sales Category." ) ); break; case -2: result = QMessageBox::warning( this, tr("Cannot Delete Sales Category"), tr( "The selected Sales Category cannot be deleted as there are closed Invoice Lines assigned to it.\n" "Would you like to mark the selected Sales Category as inactive instead?" ), tr("&Yes"), tr("&No"), QString::null ); if (result == 0) { salesDelete.prepare( "UPDATE salescat " "SET salescat_active=FALSE " "WHERE (salescat_id=:salescat_id);" ); salesDelete.bindValue(":salescat_id", _salescat->id()); salesDelete.exec(); sFillList(); } break; case -3: result = QMessageBox::warning( this, tr("Cannot Delete Sales Category"), tr( "The selected Sales Category cannot be deleted as there are A/R Open Items assigned to it.\n" "Would you like to mark the selected Sales Category as inactive instead?" ), tr("&Yes"), tr("&No"), QString::null ); if (result == 0) { salesDelete.prepare( "UPDATE salescat " "SET salescat_active=FALSE " "WHERE (salescat_id=:salescat_id);" ); salesDelete.bindValue(":salescat_id", _salescat->id()); salesDelete.exec(); sFillList(); } break; default: sFillList(); break; } } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } void salesCategories::sNew() { ParameterList params; params.append("mode", "new"); salesCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void salesCategories::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("salescat_id", _salescat->id()); salesCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void salesCategories::sCopy() { ParameterList params; params.append("mode", "copy"); params.append("salescat_id", _salescat->id()); salesCategory newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void salesCategories::sView() { ParameterList params; params.append("mode", "view"); params.append("salescat_id", _salescat->id()); salesCategory newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void salesCategories::sPrint() { orReport report("SalesCategoriesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void salesCategories::sFillList() { _salescat->populate( "SELECT salescat_id, salescat_name, salescat_descrip " "FROM salescat " "ORDER BY salescat_name;" ); } qt-client-4.1.0/guiclient/salesCategories.h000066400000000000000000000021051217451700100206610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESCATEGORIES_H #define SALESCATEGORIES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_salesCategories.h" class salesCategories : public XWidget, public Ui::salesCategories { Q_OBJECT public: salesCategories(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~salesCategories(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sCopy(); virtual void sView(); virtual void sPrint(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SALESCATEGORIES_H qt-client-4.1.0/guiclient/salesCategories.ui000066400000000000000000000117541217451700100210610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesCategories 0 0 400 400 List Sales Categories 0 Sales Categories: &Close &Print Qt::Vertical QSizePolicy::Fixed 20 5 true &New false &Edit false &View false Co&py false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _salescat _new _edit _view _copy _delete _print _close parameter.h _close clicked() salesCategories close() 20 20 20 20 _salescat valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/salesCategory.cpp000066400000000000000000000151731217451700100207150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "errorReporter.h" #include "guiErrorCheck.h" #include "salesCategory.h" #include #include salesCategory::salesCategory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _salescatid = -1; // signals and slots connections connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_category, SIGNAL(editingFinished()), this, SLOT(sCheck())); _sales->setType(GLCluster::cRevenue); _prepaid->setType(GLCluster::cRevenue); _araccnt->setType(GLCluster::cAsset); } salesCategory::~salesCategory() { // no need to delete child widgets, Qt does it all for us } void salesCategory::languageChange() { retranslateUi(this); } enum SetResponse salesCategory::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("salescat_id", &valid); if (valid) { _salescatid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "copy") { _mode = cCopy; _salescatid = -1; _category->clear(); } else if (param.toString() == "view") { _mode = cView; _category->setEnabled(FALSE); _active->setEnabled(FALSE); _description->setEnabled(FALSE); _sales->setReadOnly(TRUE); _prepaid->setReadOnly(TRUE); _araccnt->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void salesCategory::sCheck() { XSqlQuery salesCheck; _category->setText(_category->text().trimmed().toUpper()); if ((_mode == cNew) && (_category->text().length() != 0)) { salesCheck.prepare( "SELECT salescat_id " "FROM salescat " "WHERE (UPPER(salescat_name)=:salescat_name);" ); salesCheck.bindValue(":salescat_name", _category->text().trimmed()); salesCheck.exec(); if (salesCheck.first()) { _salescatid = salesCheck.value("salescat_id").toInt(); _mode = cEdit; populate(); _category->setEnabled(FALSE); } } } void salesCategory::sSave() { XSqlQuery salesSave; QList errors; errors << GuiErrorCheck(_category->text().trimmed().isEmpty(), _category, tr("

    You must specify a name for the Sales Category.")); salesSave.prepare("SELECT salescat_id" " FROM salescat" " WHERE((salescat_name=:salescat_name)" " AND (salescat_id != :salescat_id))"); salesSave.bindValue(":salescat_id", _salescatid); salesSave.bindValue(":salescat_name", _category->text().trimmed()); salesSave.exec(); if(salesSave.first()) { errors << GuiErrorCheck(true, _category, tr("

    You cannot specify a duplicate name for the Sales Category.")); } if (_metrics->boolean("InterfaceARToGL")) { errors << GuiErrorCheck(!_sales->isValid(), _sales, tr("

    You must select a Sales Account Number for this Sales Category before you may save it.")) << GuiErrorCheck(!_prepaid->isValid(), _prepaid, tr("

    You must select a Prepaid Account Number for this Sales Category before you may save it.")) << GuiErrorCheck(!_araccnt->isValid(), _araccnt, tr("

    You must select an A/R Account Number for this Sales Category before you may save it.")) ; } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Sales Category"), errors)) return; if ( (_mode == cNew) || (_mode == cCopy) ) { salesSave.exec("SELECT NEXTVAL('salescat_salescat_id_seq') AS salescat_id"); if (salesSave.first()) _salescatid = salesSave.value("salescat_id").toInt(); salesSave.prepare( "INSERT INTO salescat" "( salescat_id, salescat_name, salescat_active, salescat_descrip," " salescat_sales_accnt_id, salescat_prepaid_accnt_id, salescat_ar_accnt_id ) " "VALUES " "( :salescat_id, :salescat_name, :salescat_active, :salescat_descrip," " :salescat_sales_accnt_id, :salescat_prepaid_accnt_id, :salescat_ar_accnt_id );" ); } else if (_mode == cEdit) salesSave.prepare( "UPDATE salescat " "SET salescat_name=:salescat_name, salescat_active=:salescat_active," " salescat_descrip=:salescat_descrip," " salescat_sales_accnt_id=:salescat_sales_accnt_id," " salescat_prepaid_accnt_id=:salescat_prepaid_accnt_id," " salescat_ar_accnt_id=:salescat_ar_accnt_id " "WHERE (salescat_id=:salescat_id);" ); salesSave.bindValue(":salescat_id", _salescatid); salesSave.bindValue(":salescat_name", _category->text().trimmed()); salesSave.bindValue(":salescat_active", QVariant(_active->isChecked())); salesSave.bindValue(":salescat_descrip", _description->text().trimmed()); salesSave.bindValue(":salescat_sales_accnt_id", _sales->id()); salesSave.bindValue(":salescat_prepaid_accnt_id", _prepaid->id()); salesSave.bindValue(":salescat_ar_accnt_id", _araccnt->id()); salesSave.exec(); done(_salescatid); } void salesCategory::populate() { XSqlQuery salespopulate; salespopulate.prepare( "SELECT * " "FROM salescat " "WHERE (salescat_id=:salescat_id);" ); salespopulate.bindValue(":salescat_id", _salescatid); salespopulate.exec(); if (salespopulate.first()) { if (_mode != cCopy) { _category->setText(salespopulate.value("salescat_name").toString()); _description->setText(salespopulate.value("salescat_descrip").toString()); _active->setChecked(salespopulate.value("salescat_active").toBool()); } else _active->setChecked(TRUE); _sales->setId(salespopulate.value("salescat_sales_accnt_id").toInt()); _prepaid->setId(salespopulate.value("salescat_prepaid_accnt_id").toInt()); _araccnt->setId(salespopulate.value("salescat_ar_accnt_id").toInt()); } } qt-client-4.1.0/guiclient/salesCategory.h000066400000000000000000000020531217451700100203530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESCATEGORY_H #define SALESCATEGORY_H #include "guiclient.h" #include "xdialog.h" #include "ui_salesCategory.h" class salesCategory : public XDialog, public Ui::salesCategory { Q_OBJECT public: salesCategory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~salesCategory(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _salescatid; }; #endif // SALESCATEGORY_H qt-client-4.1.0/guiclient/salesCategory.ui000066400000000000000000000125301217451700100205420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesCategory 0 0 510 232 Sales Category Ca&tegory: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _category &Active true &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Non Inv Sales Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _sales Prepaid Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _sales Receivables Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _sales Qt::Vertical QSizePolicy::Expanding 20 0 GLCluster QWidget

    glcluster.h
    XLineEdit QLineEdit
    xlineedit.h
    _category _active _description _sales _prepaid _araccnt parameter.h qt-client-4.1.0/guiclient/salesHistoryInformation.cpp000066400000000000000000000236341217451700100230100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesHistoryInformation.h" #include salesHistoryInformation::salesHistoryInformation(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int))); connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int))); _orderNumber->setValidator(omfgThis->orderVal()); _invoiceNumber->setValidator(omfgThis->orderVal()); _shipped->setValidator(omfgThis->qtyVal()); _unitPrice->setValidator(omfgThis->priceVal()); _unitCost->setValidator(omfgThis->priceVal()); _commission->setValidator(omfgThis->negMoneyVal()); _extendedPrice->setPrecision(omfgThis->moneyVal()); _extendedCost->setPrecision(omfgThis->moneyVal()); _salesrep->setType(XComboBox::SalesReps); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } salesHistoryInformation::~salesHistoryInformation() { // no need to delete child widgets, Qt does it all for us } void salesHistoryInformation::languageChange() { retranslateUi(this); } enum SetResponse salesHistoryInformation::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("sohist_id", &valid); if (valid) { _sohistid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _orderNumber->setEnabled(FALSE); _invoiceNumber->setEnabled(FALSE); _orderDate->setEnabled(FALSE); _invoiceDate->setEnabled(FALSE); _billtoName->setEnabled(FALSE); _billtoAddress1->setEnabled(FALSE); _billtoAddress2->setEnabled(FALSE); _billtoAddress3->setEnabled(FALSE); _billtoCity->setEnabled(FALSE); _billtoState->setEnabled(FALSE); _billtoZip->setEnabled(FALSE); _shiptoName->setEnabled(FALSE); _shiptoAddress1->setEnabled(FALSE); _shiptoAddress2->setEnabled(FALSE); _shiptoAddress3->setEnabled(FALSE); _shiptoCity->setEnabled(FALSE); _shiptoState->setEnabled(FALSE); _shiptoZip->setEnabled(FALSE); _shipped->setEnabled(FALSE); _unitPrice->setEnabled(FALSE); _unitCost->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _salesrep->setEnabled(FALSE); _commission->setEnabled(FALSE); _commissionPaid->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void salesHistoryInformation::sSave() { XSqlQuery salesSave; salesSave.prepare( "UPDATE cohist " "SET cohist_ordernumber=:cohist_ordernumber, cohist_invcnumber=:cohist_invcnumber," " cohist_orderdate=:cohist_orderdate, cohist_invcdate=:cohist_invcdate," " cohist_billtoname=:cohist_billtoname, cohist_billtoaddress1=:cohist_billtoaddress1," " cohist_billtoaddress2=cohist_billtoaddress2, cohist_billtoaddress3=:cohist_billtoaddress3," " cohist_billtocity=:cohist_billtocity, cohist_billtostate=:cohist_billtostate," " cohist_billtozip=:cohist_billtozip," " cohist_shiptoname=:cohist_shiptoname, cohist_shiptoaddress1=:cohist_shiptoaddress1," " cohist_shiptoaddress2=:cohist_shiptoaddress2, cohist_shiptoaddress3=:cohist_shiptoaddress3," " cohist_shiptocity=:cohist_shiptocity, cohist_shiptostate=:cohist_shiptostate," " cohist_shiptozip=:cohist_shiptozip," " cohist_itemsite_id=itemsite_id," " cohist_qtyshipped=:cohist_qtyshipped," " cohist_unitprice=:cohist_unitprice, cohist_unitcost=:cohist_unitcost," " cohist_salesrep_id=:cohist_salesrep_id, cohist_commission=:cohist_commission," " cohist_commissionpaid=:cohist_commissionpaid " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (cohist_id=:cohist_id) );" ); salesSave.bindValue(":cohist_id", _sohistid); salesSave.bindValue(":cohist_ordernumber", _orderNumber->text().toInt()); salesSave.bindValue(":cohist_invcnumber", _invoiceNumber->text().toInt()); salesSave.bindValue(":cohist_orderdate", _orderDate->date()); salesSave.bindValue(":cohist_invcdate", _invoiceDate->date()); salesSave.bindValue(":cohist_billtoname", _billtoName->text().trimmed()); salesSave.bindValue(":cohist_billtoaddress1", _billtoAddress1->text().trimmed()); salesSave.bindValue(":cohist_billtoaddress2", _billtoAddress2->text().trimmed()); salesSave.bindValue(":cohist_billtoaddress3", _billtoAddress3->text().trimmed()); salesSave.bindValue(":cohist_billtocity", _billtoCity->text().trimmed()); salesSave.bindValue(":cohist_billtostate", _billtoState->text().trimmed()); salesSave.bindValue(":cohist_billtozip", _billtoZip->text().trimmed()); salesSave.bindValue(":cohist_shiptoname", _shiptoName->text().trimmed()); salesSave.bindValue(":cohist_shiptoaddress1", _shiptoAddress1->text().trimmed()); salesSave.bindValue(":cohist_shiptoaddress2", _shiptoAddress2->text().trimmed()); salesSave.bindValue(":cohist_shiptoaddress3", _shiptoAddress3->text().trimmed()); salesSave.bindValue(":cohist_shiptocity", _shiptoCity->text().trimmed()); salesSave.bindValue(":cohist_shiptostate", _shiptoState->text().trimmed()); salesSave.bindValue(":cohist_shiptozip", _shiptoZip->text().trimmed()); salesSave.bindValue(":cohist_qtyshipped", _shipped->toDouble()); salesSave.bindValue(":cohist_unitprice", _unitPrice->toDouble()); salesSave.bindValue(":cohist_unitcost", _unitCost->toDouble()); salesSave.bindValue(":item_id", _item->id()); salesSave.bindValue(":warehous_id", _warehouse->id()); salesSave.bindValue(":cohist_salesrep_id", _salesrep->id()); salesSave.bindValue(":cohist_commission", _commission->toDouble()); salesSave.bindValue(":cohist_commissionpaid", QVariant(_commissionPaid->isChecked())); // _isCcPayment is read-only, so don't save it salesSave.exec(); done(_sohistid); } void salesHistoryInformation::populate() { XSqlQuery salespopulate; salespopulate.prepare( "SELECT cohist_ordernumber, cohist_invcnumber," " cohist_orderdate, cohist_invcdate," " cohist_billtoname, cohist_billtoaddress1," " cohist_billtoaddress2, cohist_billtoaddress3," " cohist_billtocity, cohist_billtostate, cohist_billtozip," " cohist_shiptoname, cohist_shiptoaddress1," " cohist_shiptoaddress2, cohist_shiptoaddress3," " cohist_shiptocity, cohist_shiptostate, cohist_shiptozip," " cohist_itemsite_id, cohist_salesrep_id, cohist_commissionpaid," " cohist_qtyshipped, cohist_unitprice, cohist_unitcost," " (cohist_qtyshipped * cohist_unitprice) AS extprice," " (cohist_qtyshipped * cohist_unitcost) AS extcost," " cohist_commission, cohist_cohead_ccpay_id " "FROM cohist " "WHERE (cohist_id=:sohist_id);" ); salespopulate.bindValue(":sohist_id", _sohistid); salespopulate.exec(); if (salespopulate.first()) { _orderNumber->setText(salespopulate.value("cohist_ordernumber")); _invoiceNumber->setText(salespopulate.value("cohist_invcnumber")); _orderDate->setDate(salespopulate.value("cohist_orderdate").toDate()); _invoiceDate->setDate(salespopulate.value("cohist_invcdate").toDate()); _billtoName->setText(salespopulate.value("cohist_billtoname")); _billtoAddress1->setText(salespopulate.value("cohist_billtoaddress1")); _billtoAddress2->setText(salespopulate.value("cohist_billtoaddress2")); _billtoAddress3->setText(salespopulate.value("cohist_billtoaddress3")); _billtoCity->setText(salespopulate.value("cohist_billtocity")); _billtoState->setText(salespopulate.value("cohist_billtostate")); _billtoZip->setText(salespopulate.value("cohist_billtozip")); _shiptoName->setText(salespopulate.value("cohist_shiptoname")); _shiptoAddress1->setText(salespopulate.value("cohist_shiptoaddress1")); _shiptoAddress2->setText(salespopulate.value("cohist_shiptoaddress2")); _shiptoAddress3->setText(salespopulate.value("cohist_shiptoaddress3")); _shiptoCity->setText(salespopulate.value("cohist_shiptocity")); _shiptoState->setText(salespopulate.value("cohist_shiptostate")); _shiptoZip->setText(salespopulate.value("cohist_shiptozip")); _item->setItemsiteid(salespopulate.value("cohist_itemsite_id").toInt()); _shipped->setDouble(salespopulate.value("cohist_qtyshipped").toDouble()); _unitPrice->setDouble(salespopulate.value("cohist_unitprice").toDouble()); _unitCost->setDouble(salespopulate.value("cohist_unitcost").toDouble()); _extendedPrice->setDouble(salespopulate.value("extprice").toDouble()); _extendedCost->setDouble(salespopulate.value("extcost").toDouble()); _salesrep->setId(salespopulate.value("cohist_salesrep_id").toInt()); _commission->setDouble(salespopulate.value("cohist_commission").toDouble()); _commissionPaid->setChecked(salespopulate.value("cohist_commissionpaid").toBool()); _isCcPayment->setChecked(! salespopulate.value("cohist_cohead_ccpay_id").isNull()); } } qt-client-4.1.0/guiclient/salesHistoryInformation.h000066400000000000000000000021721217451700100224470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESHISTORYINFORMATION_H #define SALESHISTORYINFORMATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_salesHistoryInformation.h" class salesHistoryInformation : public XDialog, public Ui::salesHistoryInformation { Q_OBJECT public: salesHistoryInformation(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~salesHistoryInformation(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _sohistid; }; #endif // SALESHISTORYINFORMATION_H qt-client-4.1.0/guiclient/salesHistoryInformation.ui000066400000000000000000000637151217451700100226470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesHistoryInformation 0 0 847 482 Sales History Information Order Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Invoice Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Qt::AlignRight 0 0 100 32767 Qt::AlignRight Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Invoice Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Preferred 10 25 Qt::Horizontal QSizePolicy::Expanding 150 20 &Cancel &Save true true Qt::Vertical QSizePolicy::Preferred 10 0 0 0 Bill-To 0 5 1 40 32767 0 0 Ship-To 0 5 1 40 32767 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::Horizontal QSizePolicy::Expanding 0 20 80 32767 Qt::AlignRight 80 32767 Qt::AlignRight 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Extended Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Extended Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 0 Qt::AlignRight 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 16 20 false Is a Credit Card payment Qt::Vertical QSizePolicy::Preferred 20 30 Sales Rep.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Commission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true 80 32767 Qt::AlignRight Paid Qt::Horizontal QSizePolicy::Expanding 26 10 Qt::Vertical QSizePolicy::Expanding 20 16 DLineEdit QWidget
    datecluster.h
    ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _orderNumber _invoiceNumber _orderDate _invoiceDate _billtoName _billtoAddress1 _billtoAddress2 _billtoAddress3 _billtoCity _billtoState _billtoZip _shiptoName _shiptoAddress1 _shiptoAddress2 _shiptoAddress3 _shiptoCity _shiptoState _shiptoZip _item _warehouse _shipped _unitPrice _unitCost _isCcPayment _salesrep _commission _commissionPaid _save _close _close clicked() salesHistoryInformation reject() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/salesOrder.cpp000066400000000000000000006114041217451700100202120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesOrder.h" #include #include #include #include #include #include #include #include #include #include #include "creditCard.h" #include "creditcardprocessor.h" #include "crmacctcluster.h" #include "customer.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "distributeInventory.h" #include "issueLineToShipping.h" #include "mqlutil.h" #include "salesOrderItem.h" #include "storedProcErrorLookup.h" #include "taxBreakdown.h" #include "freightBreakdown.h" #include "printPackingList.h" #include "printSoForm.h" #include "printQuote.h" #include "prospect.h" #include "allocateARCreditMemo.h" #include "reserveSalesOrderItem.h" #include "dspReservations.h" #include "purchaseRequest.h" #include "purchaseOrder.h" #include "workOrder.h" #define cNewQuote (0x20 | cNew) #define cEditQuote (0x20 | cEdit) #define cViewQuote (0x20 | cView) #define ISQUOTE(mode) (((mode) & 0x20) == 0x20) #define ISORDER(mode) (!ISQUOTE(mode)) #define ISNEW(mode) (((mode) & 0x0F) == cNew) #define ISEDIT(mode) (((mode) & 0x0F) == cEdit) #define ISVIEW(mode) (((mode) & 0x0F) == cView) #define cClosed 0x01 #define cActiveOpen 0x02 #define cInactiveOpen 0x04 #define cCanceled 0x08 #define iDontUpdate 1 #define iAskToUpdate 2 #define iJustUpdate 3 const struct { const char * full; QString abbr; bool cc; } _fundsTypes[] = { { QT_TRANSLATE_NOOP("cashReceipt", "Cash"), "K", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Check"), "C", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Certified Check"), "T", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Wire Transfer"), "W", false }, { QT_TRANSLATE_NOOP("cashReceipt", "Other"), "O", false } }; salesOrder::salesOrder(QWidget *parent, const char *name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); sCheckValidContacts(); connect(_action, SIGNAL(clicked()), this, SLOT(sAction())); connect(_authorize, SIGNAL(clicked()), this, SLOT(sAuthorizeCC())); connect(_charge, SIGNAL(clicked()), this, SLOT(sChargeCC())); connect(_postCash, SIGNAL(clicked()), this, SLOT(sEnterCashPayment())); connect(_clear, SIGNAL(pressed()), this, SLOT(sClear())); connect(_copyToShipto, SIGNAL(clicked()), this, SLOT(sCopyToShipto())); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulateCustomerInfo(int))); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_downCC, SIGNAL(clicked()), this, SLOT(sMoveDown())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_editCC, SIGNAL(clicked()), this, SLOT(sEditCreditCard())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_newCC, SIGNAL(clicked()), this, SLOT(sNewCreditCard())); //connect(_newCust, SIGNAL(clicked()), this, SLOT(sNewCust())); connect(_orderNumber, SIGNAL(editingFinished()), this, SLOT(sHandleOrderNumber())); connect(_orderNumber, SIGNAL(textChanged(const QString &)), this, SLOT(sSetUserEnteredOrderNumber())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_saveAndAdd, SIGNAL(clicked()), this, SLOT(sSaveAndAdd())); connect(_shippingCharges, SIGNAL(newID(int)), this, SLOT(sHandleShipchrg(int))); connect(_shipVia, SIGNAL(editTextChanged(const QString &)), this, SLOT(sFillItemList())); connect(_shipToAddr, SIGNAL(changed()), this, SLOT(sConvertShipTo())); connect(_shipToName, SIGNAL(textChanged(const QString &)), this, SLOT(sConvertShipTo())); connect(_shipTo, SIGNAL(newId(int)), this, SLOT(sParseShipToNumber())); connect(_showCanceled, SIGNAL(toggled(bool)), this, SLOT(sFillItemList())); connect(_soitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem *)), this, SLOT(sPopulateMenu(QMenu *))); connect(_soitem, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); connect(_taxZone, SIGNAL(newID(int)), this, SLOT(sTaxZoneChanged())); connect(_taxLit, SIGNAL(leftClickedURL(const QString &)), this, SLOT(sTaxDetail())); connect(_freightLit, SIGNAL(leftClickedURL(const QString &)), this, SLOT(sFreightDetail())); connect(_upCC, SIGNAL(clicked()), this, SLOT(sMoveUp())); connect(_viewCC, SIGNAL(clicked()), this, SLOT(sViewCreditCard())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateFOB(int))); connect(_issueStock, SIGNAL(clicked()), this, SLOT(sIssueStock())); connect(_issueLineBalance, SIGNAL(clicked()), this, SLOT(sIssueLineBalance())); connect(_reserveStock, SIGNAL(clicked()), this, SLOT(sReserveStock())); connect(_reserveLineBalance, SIGNAL(clicked()), this, SLOT(sReserveLineBalance())); connect(_subtotal, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_miscCharge, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); if (_privileges->check("ApplyARMemos")) connect(_allocatedCMLit, SIGNAL(leftClickedURL(const QString &)), this, SLOT(sCreditAllocate())); connect(_allocatedCM, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_outstandingCM, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_authCC, SIGNAL(valueChanged()), this, SLOT(sCalculateTotal())); connect(_more, SIGNAL(clicked()), this, SLOT(sHandleMore())); connect(_orderDate, SIGNAL(newDate(QDate)), this, SLOT(sOrderDateChanged())); connect(_shipDate, SIGNAL(newDate(QDate)), this, SLOT(sShipDateChanged())); connect(_cust, SIGNAL(newCrmacctId(int)), _billToAddr, SLOT(setSearchAcct(int))); connect(_cust, SIGNAL(newCrmacctId(int)), _shipToAddr, SLOT(setSearchAcct(int))); connect(_billToAddr, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _billToCntct, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); connect(_shipToAddr, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _shipToCntct, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); _saved = false; setFreeFormShipto(false); _soheadid = -1; _orderNumberGen = 0; _numSelected = 0; _calcfreight = false; _freightCache = 0; _taxzoneidCache = -1; _custtaxzoneid = -1; _amountOutstanding = 0.0; _crmacctid =-1; _locked =false; _captive = FALSE; _ignoreSignals = TRUE; _orderCurrency->setLabel(_orderCurrencyLit); _shipTo->setNameVisible(false); _shipTo->setDescriptionVisible(false); _orderNumber->setValidator(omfgThis->orderVal()); _CCCVV->setValidator(new QIntValidator(100, 9999, this)); _weight->setValidator(omfgThis->weightVal()); _commission->setValidator(omfgThis->percentVal()); _applDate->setDate(omfgThis->dbDate(), true); _distDate->setDate(omfgThis->dbDate(), true); _soitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter,true, "f_linenumber"); _soitem->addColumn(tr("Kit Seq. #"), _seqColumn, Qt::AlignRight, false,"coitem_subnumber"); _soitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); _soitem->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, false,"item_type"); _soitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); _soitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _soitem->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter,true, "enhanced_status"); _soitem->addColumn(tr("Firm"), 0, Qt::AlignCenter,false, "coitem_firm"); _soitem->addColumn(tr("Sched. Date"),_dateColumn, Qt::AlignCenter,true, "coitem_scheddate"); _soitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "coitem_qtyord"); _soitem->addColumn(tr("Qty UOM"), (int)(_uomColumn*1.5), Qt::AlignLeft, true, "qty_uom"); _soitem->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "qtyshipped"); _soitem->addColumn(tr("At Shipping"), _qtyColumn, Qt::AlignRight, false, "qtyatshipping"); _soitem->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, false, "balance"); _soitem->addColumn(tr("Price UOM"), _uomColumn, Qt::AlignLeft, false, "price_uom"); _soitem->addColumn(tr("Price"), _priceColumn, Qt::AlignRight, true, "coitem_price"); _soitem->addColumn(tr("Extended"), _priceColumn, Qt::AlignRight, true, "extprice"); _soitem->addColumn(tr("Cust. Price"), _priceColumn, Qt::AlignRight, false, "coitem_custprice"); _soitem->addColumn(tr("Cust. Discount"), _priceColumn, Qt::AlignRight, false, "discountfromcust"); _soitem->addColumn(tr("Supply Type"), _itemColumn, Qt::AlignCenter, false, "spplytype"); _soitem->addColumn(tr("Order Number"),_itemColumn, Qt::AlignCenter, false, "ordrnumbr"); _cc->addColumn(tr("Sequence"),_itemColumn, Qt::AlignLeft, true, "ccard_seq"); _cc->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "type"); _cc->addColumn(tr("Number"), _itemColumn, Qt::AlignRight,true, "f_number"); _cc->addColumn(tr("Active"), _itemColumn, Qt::AlignLeft, true, "ccard_active"); _cc->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "ccard_name"); _cc->addColumn(tr("Expiration Date"), -1, Qt::AlignLeft, true, "expiration"); _printSO->setChecked(_metrics->boolean("DefaultPrintSOOnSave")); _quotestatusLit->hide(); _quotestaus->hide(); sPopulateFOB(_warehouse->id()); _ignoreSignals = FALSE; if (!_privileges->check("ShowMarginsOnSalesOrder")) { _margin->hide(); _marginLit->hide(); } _project->setType(ProjectLineEdit::SalesOrder); if (!_metrics->boolean("UseProjects")) _project->hide(); // If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _shippingWhseLit->hide(); _warehouse->hide(); } if (!_metrics->boolean("EnableReturnAuth")) _holdType->removeItem(4); if (!_metrics->boolean("CCAccept") || !_privileges->check("ProcessCreditCards")) { _paymentInformation->removeTab(_paymentInformation->indexOf(_creditCardPage)); } if (_metrics->boolean("EnableSOReservations")) { _requireInventory->setChecked(true); _requireInventory->setEnabled(false); } if (!_metrics->boolean("AlwaysShowSaveAndAdd")) _saveAndAdd->hide(); _more->setChecked(_preferences->boolean("SoShowAll")); _miscChargeAccount->setType(GLCluster::cRevenue | GLCluster::cExpense); for (unsigned int i = 0; i < sizeof(_fundsTypes) / sizeof(_fundsTypes[1]); i++) { _fundsType->append(i, tr(_fundsTypes[i].full), _fundsTypes[i].abbr); } _bankaccnt->setType(XComboBox::ARBankAccounts); _salescat->setType(XComboBox::SalesCategoriesActive); sHandleMore(); } salesOrder::~salesOrder() { // no need to delete child widgets, Qt does it all for us } void salesOrder::languageChange() { retranslateUi(this); } enum SetResponse salesOrder:: set(const ParameterList &pParams) { XSqlQuery setSales; XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { setObjectName("salesOrder new"); _mode = cNew; emit newModeType(2); emit newModeState(1); _cust->setType(CLineEdit::ActiveCustomers); _salesRep->setType(XComboBox::SalesRepsActive); _comments->setType(Comments::SalesOrder); _documents->setType(Documents::SalesOrder); _calcfreight = _metrics->boolean("CalculateFreight"); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sHandleSalesOrderEvent(int, bool))); } else if (param.toString() == "newQuote") { _mode = cNewQuote; emit newModeType(1); emit newModeState(1); _cust->setType(CLineEdit::ActiveCustomersAndProspects); _salesRep->setType(XComboBox::SalesRepsActive); _calcfreight = _metrics->boolean("CalculateFreight"); _action->hide(); _CCAmount->hide(); _CCCVVLit->hide(); _CCCVV->hide(); _newCC->hide(); _editCC->hide(); _viewCC->hide(); _upCC->hide(); _downCC->hide(); _authorize->hide(); _charge->hide(); _paymentInformation->removeTab(_paymentInformation->indexOf(_cashPage)); _quotestatusLit->show(); _quotestaus->show(); _quotestaus->setText("Open"); connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sHandleSalesOrderEvent(int, bool))); } else if (param.toString() == "edit") { _mode = cEdit; emit newModeType(2); emit newModeState(2); if (_metrics->boolean("AlwaysShowSaveAndAdd")) _saveAndAdd->setEnabled(true); else _saveAndAdd->hide(); _comments->setType(Comments::SalesOrder); _documents->setType(Documents::SalesOrder); _cust->setType(CLineEdit::AllCustomers); connect(omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sHandleSalesOrderEvent(int, bool))); } else if (param.toString() == "editQuote") { _mode = cEditQuote; emit newModeType(1); emit newModeState(2); _cust->setType(CLineEdit::AllCustomersAndProspects); _action->setEnabled(FALSE); _action->hide(); _CCAmount->hide(); _CCCVVLit->hide(); _CCCVV->hide(); _newCC->hide(); _editCC->hide(); _viewCC->hide(); _upCC->hide(); _downCC->hide(); _authorize->hide(); _charge->hide(); _paymentInformation->removeTab(_paymentInformation->indexOf(_cashPage)); _quotestatusLit->show(); _quotestaus->show(); connect(omfgThis, SIGNAL(quotesUpdated(int, bool)), this, SLOT(sHandleSalesOrderEvent(int, bool))); } else if (param.toString() == "view") { setViewMode(); _cust->setType(CLineEdit::AllCustomers); _issueStock->hide(); _issueLineBalance->hide(); _reserveStock->hide(); _reserveLineBalance->hide(); _paymentInformation->removeTab(_paymentInformation->indexOf(_cashPage)); } else if (param.toString() == "viewQuote") { _mode = cViewQuote; emit newModeType(1); emit newModeState(3); _orderNumber->setEnabled(FALSE); _packDate->setEnabled(FALSE); _cust->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _salesRep->setEnabled(FALSE); _commission->setEnabled(FALSE); _taxZone->setEnabled(FALSE); _terms->setEnabled(FALSE); _terms->setType(XComboBox::Terms); _fob->setEnabled(FALSE); _shipVia->setEnabled(FALSE); _shippingCharges->setEnabled(FALSE); _shippingForm->setEnabled(FALSE); _miscCharge->setEnabled(FALSE); _miscChargeDescription->setEnabled(FALSE); _miscChargeAccount->setReadOnly(TRUE); _freight->setEnabled(FALSE); _orderComments->setEnabled(FALSE); _shippingComments->setEnabled(FALSE); _custPONumber->setEnabled(FALSE); _holdType->setEnabled(FALSE); _edit->setText(tr("View")); _cust->setType(CLineEdit::AllCustomersAndProspects); _comments->setReadOnly(true); _documents->setReadOnly(true); _copyToShipto->setEnabled(FALSE); _orderCurrency->setEnabled(FALSE); _paymentInformation->removeTab(_paymentInformation->indexOf(_cashPage)); _save->hide(); _clear->hide(); _action->hide(); _delete->hide(); _quotestatusLit->show(); _quotestaus->show(); } } sHandleMore(); if (ISNEW(_mode)) { _ignoreSignals = TRUE; populateOrderNumber(); // try setfocus in spite of bug 17344 - users dislike changes to salesOrder flow if (omfgThis->viewMode() == GUIClient::FreeFloatingView || omfgThis->viewMode() == GUIClient::SubWindowView) { if (_orderNumber->text().isEmpty()) _orderNumber->setFocus(); else _cust->setFocus(); } _ignoreSignals = FALSE; if (ISORDER(_mode)) setSales.exec("SELECT NEXTVAL('cohead_cohead_id_seq') AS head_id;"); else // (ISQUOTE(_mode)) setSales.exec("SELECT NEXTVAL('quhead_quhead_id_seq') AS head_id;"); if (setSales.first()) { _soheadid = setSales.value("head_id").toInt(); emit newId(_soheadid); _comments->setId(_soheadid); _documents->setId(_soheadid); _orderDateCache = omfgThis->dbDate(); _orderDate->setDate(_orderDateCache, true); } else if (setSales.lastError().type() != QSqlError::NoError) { systemError(this, setSales.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } if (ISORDER(_mode)) { populateCMInfo(); populateCCInfo(); sFillCcardList(); } _captive = FALSE; _edit->setEnabled(FALSE); _action->setEnabled(FALSE); _delete->setEnabled(FALSE); _close->setText("&Cancel"); connect(_cust, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); } else if (ISEDIT(_mode)) { _captive = TRUE; _orderNumber->setEnabled(FALSE); _cust->setReadOnly(TRUE); _orderCurrency->setEnabled(FALSE); connect(_cust, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); } else if (ISVIEW(_mode)) { _CCAmount->hide(); _CCCVVLit->hide(); _CCCVV->hide(); _newCC->hide(); _editCC->hide(); _viewCC->hide(); _upCC->hide(); _downCC->hide(); _authorize->hide(); _charge->hide(); _project->setReadOnly(true); } if (ISQUOTE(_mode)) { setWindowTitle(tr("Quote")); _comments->setType(Comments::Quote); _documents->setType(Documents::Quote); _saveAndAdd->hide(); _fromQuote->hide(); _fromQuoteLit->hide(); _shipComplete->hide(); _allocatedCM->hide(); _allocatedCMLit->hide(); _outstandingCM->hide(); _outstandingCMLit->hide(); _authCC->hide(); _authCCLit->hide(); _balance->hide(); _balanceLit->hide(); _holdType->hide(); _holdTypeLit->hide(); _shippingCharges->hide(); _shippingChargesLit->hide(); _shippingForm->hide(); _shippingFormLit->hide(); _salesOrderInformation->removeTab(_salesOrderInformation->indexOf(_paymentPage)); _showCanceled->hide(); _total->setBaseVisible(true); } else { _expireLit->hide(); _expire->hide(); } if (_metrics->boolean("HideSOMiscCharge")) { _miscChargeDescriptionLit->hide(); _miscChargeDescription->hide(); _miscChargeAccountLit->hide(); _miscChargeAccount->hide(); _miscChargeAmountLit->hide(); _miscCharge->hide(); } if (ISQUOTE(_mode) || !_metrics->boolean("EnableSOShipping")) { _requireInventory->hide(); _issueStock->hide(); _issueLineBalance->hide(); _amountAtShippingLit->hide(); _amountAtShipping->hide(); _soitem->hideColumn("qtyatshipping"); _soitem->hideColumn("balance"); } else _soitem->setSelectionMode(QAbstractItemView::ExtendedSelection); if (ISQUOTE(_mode) || !_metrics->boolean("EnableSOReservations")) { _reserveStock->hide(); _reserveLineBalance->hide(); } param = pParams.value("cust_id", &valid); if (valid) _cust->setId(param.toInt()); param = pParams.value("ophead_id", &valid); if (valid) _opportunity->setId(param.toInt()); param = pParams.value("sohead_id", &valid); if (valid) { _soheadid = param.toInt(); emit newId(_soheadid); if (cEdit == _mode) setObjectName(QString("salesOrder edit %1").arg(_soheadid)); else if (cView == _mode) setObjectName(QString("salesOrder view %1").arg(_soheadid)); populate(); populateCMInfo(); populateCCInfo(); sFillCcardList(); } param = pParams.value("quhead_id", &valid); if (valid) { _soheadid = param.toInt(); emit newId(_soheadid); populate(); } if ( (pParams.inList("enableSaveAndAdd")) && ((_mode == cNew) || (_mode == cEdit)) ) { _saveAndAdd->show(); _saveAndAdd->setEnabled(true); } if (ISNEW(_mode) || ISEDIT(_mode)) { _orderDate->setEnabled(_privileges->check("OverrideSODate")); _packDate->setEnabled(_privileges->check("AlterPackDate")); } else { _orderDate->setEnabled(FALSE); _packDate->setEnabled(FALSE); } param = pParams.value("captive", &valid); if (valid) _captive = true; return NoError; } /** \return one of cNew, cEdit, cView, ... \todo change possible modes to an enum in guiclient.h (and add cUnknown?) */ int salesOrder::modeState() const { if (ISNEW(_mode)) return 1; else if (ISEDIT(_mode)) return 2; else return 3; } /** \return one of isOrder, isQuote, ... */ int salesOrder::modeType() const { if (ISQUOTE(_mode)) return 1; else return 2; } void salesOrder::sSave() { if (save(false)) { if (_printSO->isChecked()) { if (ISQUOTE(_mode)) { ParameterList params; params.append("quhead_id", _soheadid); printQuote newdlgX(this, "", true); newdlgX.set(params); newdlgX.exec(); } else { ParameterList params; params.append("sohead_id", _soheadid); printSoForm newdlgX(this, "", true); newdlgX.set(params); newdlgX.exec(); } } if (_captive) close(); else clear(); } } void salesOrder::sSaveAndAdd() { XSqlQuery saveSales; if (save(false)) { saveSales.prepare("SELECT addToPackingListBatch(:sohead_id) AS result;"); saveSales.bindValue(":sohead_id", _soheadid); saveSales.exec(); if (_printSO->isChecked()) { if (ISQUOTE(_mode)) { ParameterList params; params.append("quhead_id", _soheadid); printQuote newdlgS(this, "", true); newdlgS.set(params); newdlgS.exec(); } else { ParameterList params; params.append("sohead_id", _soheadid); printPackingList newdlgP(this, "", true); newdlgP.set(params); newdlgP.exec(); printSoForm newdlgS(this, "", true); newdlgS.set(params); newdlgS.exec(); } } if (_captive) close(); else clear(); } } bool salesOrder::save(bool partial) { XSqlQuery saveSales; QList errors; errors << GuiErrorCheck(!_orderDate->isValid(), _orderDate, tr("You must enter an Order Date for this order before you may save it.") ) << GuiErrorCheck((!_shipDate->isValid()) && (_metrics->value("soPriceEffective") == "ScheduleDate"), _shipDate, tr("You must enter an Scheduled Date for this order before you may save it.") ) << GuiErrorCheck(!_cust->isValid(), _cust, tr("You must select a Customer for this order before you may save it.") ) << GuiErrorCheck(!_salesRep->isValid(), _salesRep, tr("You must select a Sales Rep. for this order before you may save it.") ) << GuiErrorCheck(!_terms->isValid(), _terms, tr("You must select the Terms for this order before you may save it.") ) << GuiErrorCheck((_shipTo->id() == -1) && (!_shipToAddr->isEnabled()), _shipTo, tr("You must select a Ship-To for this order before you may save it.") ) << GuiErrorCheck(_total->localValue() < 0, _cust, tr("

    The Total must be a positive value.") ) << GuiErrorCheck(!partial && _soitem->topLevelItemCount() == 0, _new, tr("

    You must create at least one Line Item for this order before you may save it.") ) << GuiErrorCheck(_orderNumber->text().toInt() == 0, _orderNumber, tr( "

    You must enter a valid Number for this order before you may save it." ) ) << GuiErrorCheck((!_miscCharge->isZero()) && (!_miscChargeAccount->isValid()), _miscChargeAccount, tr("

    You may not enter a Misc. Charge without " "indicating the G/L Sales Account number for the " "charge. Please set the Misc. Charge amount to 0 " "or select a Misc. Charge Sales Account." ) ) << GuiErrorCheck(_received->localValue() > 0.0, _postCash, tr( "

    You must Post Cash Payment before you may save it." ) ) ; if (_opportunity->isValid()) { saveSales.prepare( "SELECT crmacct_cust_id, crmacct_prospect_id " "FROM crmacct JOIN ophead ON (crmacct_id = ophead_crmacct_id) " "WHERE (ophead_id = :ophead_id);" ); saveSales.bindValue(":ophead_id", _opportunity->id()); saveSales.exec(); if (saveSales.first()) { if (saveSales.value("crmacct_cust_id").toInt() == 0 && saveSales.value("crmacct_prospect_id").toInt() == 0) { errors << GuiErrorCheck(true, _opportunity, tr("Only opportunities from Customers or Prospects can be related.") ); } } else if (saveSales.lastError().type() != QSqlError::NoError) { systemError(this, saveSales.lastError().databaseText(), __FILE__, __LINE__); return FALSE; } } if (ISORDER(_mode)) { if (_usesPos && !partial) { if (_custPONumber->text().trimmed().length() == 0) { errors << GuiErrorCheck(true, _custPONumber, tr("You must enter a Customer P/O for this Sales Order before you may save it.") ); } if (!_blanketPos) { saveSales.prepare( "SELECT cohead_id" " FROM cohead" " WHERE ((cohead_cust_id=:cohead_cust_id)" " AND (cohead_id<>:cohead_id)" " AND (UPPER(cohead_custponumber) = UPPER(:cohead_custponumber)) )" " UNION " "SELECT quhead_id" " FROM quhead" " WHERE ((quhead_cust_id=:cohead_cust_id)" " AND (quhead_id<>:cohead_id)" " AND (UPPER(quhead_custponumber) = UPPER(:cohead_custponumber)) );" ); saveSales.bindValue(":cohead_cust_id", _cust->id()); saveSales.bindValue(":cohead_id", _soheadid); saveSales.bindValue(":cohead_custponumber", _custPONumber->text()); saveSales.exec(); if (saveSales.first()) { errors << GuiErrorCheck(true, _custPONumber, tr("

    This Customer does not use Blanket P/O " "Numbers and the P/O Number you entered has " "already been used for another Sales Order." "Please verify the P/O Number and either" "enter a new P/O Number or add to the" "existing Sales Order." ) ); } else if (saveSales.lastError().type() != QSqlError::NoError) { systemError(this, saveSales.lastError().databaseText(), __FILE__, __LINE__); return FALSE; } } } } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Sales Order"), errors)) return false; if ((_mode == cEdit) || ((_mode == cNew) && _saved)) saveSales.prepare( "UPDATE cohead " "SET cohead_custponumber=:custponumber, cohead_shipto_id=:shipto_id, cohead_cust_id=:cust_id," " cohead_billtoname=:billtoname, cohead_billtoaddress1=:billtoaddress1," " cohead_billtoaddress2=:billtoaddress2, cohead_billtoaddress3=:billtoaddress3," " cohead_billtocity=:billtocity, cohead_billtostate=:billtostate, cohead_billtozipcode=:billtozipcode," " cohead_billtocountry=:billtocountry," " cohead_shiptoname=:shiptoname, cohead_shiptoaddress1=:shiptoaddress1," " cohead_shiptoaddress2=:shiptoaddress2, cohead_shiptoaddress3=:shiptoaddress3," " cohead_shiptocity=:shiptocity, cohead_shiptostate=:shiptostate, cohead_shiptozipcode=:shiptozipcode," " cohead_shiptocountry=:shiptocountry," " cohead_orderdate=:orderdate, cohead_packdate=:packdate," " cohead_salesrep_id=:salesrep_id, cohead_commission=:commission," " cohead_taxzone_id=:taxzone_id, cohead_terms_id=:terms_id," " cohead_fob=:fob, cohead_shipvia=:shipvia, cohead_warehous_id=:warehous_id," " cohead_freight=:freight, cohead_calcfreight=:calcfreight," " cohead_misc=:misc, cohead_misc_accnt_id=:misc_accnt_id, cohead_misc_descrip=:misc_descrip," " cohead_holdtype=:holdtype," " cohead_ordercomments=:ordercomments, cohead_shipcomments=:shipcomments," " cohead_shipchrg_id=:shipchrg_id, cohead_shipform_id=:shipform_id," " cohead_prj_id=:prj_id," " cohead_ophead_id=:ophead_id," " cohead_curr_id = :curr_id," " cohead_shipcomplete=:cohead_shipcomplete," " cohead_shipto_cntct_id=:shipto_cntct_id," " cohead_shipto_cntct_honorific=:shipto_cntct_honorific," " cohead_shipto_cntct_first_name=:shipto_cntct_first_name," " cohead_shipto_cntct_middle=:shipto_cntct_middle," " cohead_shipto_cntct_last_name=:shipto_cntct_last_name," " cohead_shipto_cntct_suffix=:shipto_cntct_suffix," " cohead_shipto_cntct_phone=:shipto_cntct_phone," " cohead_shipto_cntct_title=:shipto_cntct_title," " cohead_shipto_cntct_fax=:shipto_cntct_fax," " cohead_shipto_cntct_email=:shipto_cntct_email," " cohead_billto_cntct_id=:billto_cntct_id," " cohead_billto_cntct_honorific=:billto_cntct_honorific," " cohead_billto_cntct_first_name=:billto_cntct_first_name," " cohead_billto_cntct_middle=:billto_cntct_middle," " cohead_billto_cntct_last_name=:billto_cntct_last_name," " cohead_billto_cntct_suffix=:billto_cntct_suffix," " cohead_billto_cntct_phone=:billto_cntct_phone," " cohead_billto_cntct_title=:billto_cntct_title," " cohead_billto_cntct_fax=:billto_cntct_fax," " cohead_billto_cntct_email=:billto_cntct_email, " " cohead_shipzone_id=:shipzone_id," " cohead_saletype_id=:saletype_id " "WHERE (cohead_id=:id);" ); else if (_mode == cNew) { if (_metrics->boolean("AutoCreateProjectsForOrders")) { XSqlQuery prj; prj.prepare("INSERT INTO prj (prj_number, prj_name, prj_descrip, prj_status, prj_so, prj_wo, prj_po) " " VALUES (:number, :number, :descrip, 'O', TRUE, TRUE, TRUE) " "RETURNING prj_id"); prj.bindValue(":number", _orderNumber->text()); prj.bindValue(":descrip", tr("Auto Generated Project from Sales Order.")); prj.exec(); if (prj.first()) _project->setId(prj.value("prj_id").toInt()); } saveSales.prepare("INSERT INTO cohead " "(cohead_id, cohead_number, cohead_cust_id," " cohead_custponumber, cohead_shipto_id," " cohead_billtoname, cohead_billtoaddress1," " cohead_billtoaddress2, cohead_billtoaddress3," " cohead_billtocity, cohead_billtostate, cohead_billtozipcode," " cohead_billtocountry," " cohead_shiptoname, cohead_shiptoaddress1," " cohead_shiptoaddress2, cohead_shiptoaddress3," " cohead_shiptocity, cohead_shiptostate, cohead_shiptozipcode," " cohead_shiptocountry," " cohead_orderdate, cohead_packdate," " cohead_salesrep_id, cohead_commission," " cohead_taxzone_id, cohead_terms_id," " cohead_fob, cohead_shipvia, cohead_warehous_id," " cohead_freight, cohead_calcfreight," " cohead_misc, cohead_misc_accnt_id, cohead_misc_descrip," " cohead_holdtype," " cohead_ordercomments, cohead_shipcomments," " cohead_shipchrg_id, cohead_shipform_id," " cohead_prj_id, cohead_ophead_id," " cohead_curr_id," " cohead_shipcomplete," " cohead_shipto_cntct_id," " cohead_shipto_cntct_honorific," " cohead_shipto_cntct_first_name," " cohead_shipto_cntct_middle," " cohead_shipto_cntct_last_name," " cohead_shipto_cntct_suffix," " cohead_shipto_cntct_phone," " cohead_shipto_cntct_title," " cohead_shipto_cntct_fax," " cohead_shipto_cntct_email," " cohead_billto_cntct_id," " cohead_billto_cntct_honorific," " cohead_billto_cntct_first_name," " cohead_billto_cntct_middle," " cohead_billto_cntct_last_name," " cohead_billto_cntct_suffix," " cohead_billto_cntct_phone," " cohead_billto_cntct_title," " cohead_billto_cntct_fax," " cohead_billto_cntct_email," " cohead_shipzone_id, cohead_saletype_id)" " VALUES (:id,:number, :cust_id," " :custponumber,:shipto_id," " :billtoname, :billtoaddress1," " :billtoaddress2, :billtoaddress3," " :billtocity, :billtostate, :billtozipcode," " :billtocountry," " :shiptoname, :shiptoaddress1," " :shiptoaddress2, :shiptoaddress3," " :shiptocity, :shiptostate, :shiptozipcode," " :shiptocountry," " :orderdate, :packdate," " :salesrep_id, :commission," " :taxzone_id, :terms_id," " :fob, :shipvia, :warehous_id," " :freight, :calcfreight," " :misc, :misc_accnt_id, :misc_descrip," " :holdtype," " :ordercomments, :shipcomments," " :shipchrg_id, :shipform_id," " :prj_id, :ophead_id," " :curr_id," " :cohead_shipcomplete," " :shipto_cntct_id," " :shipto_cntct_honorific," " :shipto_cntct_first_name," " :shipto_cntct_middle," " :shipto_cntct_last_name," " :shipto_cntct_suffix," " :shipto_cntct_phone," " :shipto_cntct_title," " :shipto_cntct_fax," " :shipto_cntct_email," " :billto_cntct_id," " :billto_cntct_honorific," " :billto_cntct_first_name," " :billto_cntct_middle," " :billto_cntct_last_name," " :billto_cntct_suffix," " :billto_cntct_phone," " :billto_cntct_title," " :billto_cntct_fax," " :billto_cntct_email," " :shipzone_id, :saletype_id) "); } else if ((_mode == cEditQuote) || ((_mode == cNewQuote) && _saved)) saveSales.prepare( "UPDATE quhead " "SET quhead_custponumber=:custponumber, quhead_shipto_id=:shipto_id," " quhead_billtoname=:billtoname, quhead_billtoaddress1=:billtoaddress1," " quhead_billtoaddress2=:billtoaddress2, quhead_billtoaddress3=:billtoaddress3," " quhead_billtocity=:billtocity, quhead_billtostate=:billtostate, quhead_billtozip=:billtozipcode," " quhead_billtocountry=:billtocountry," " quhead_shiptoname=:shiptoname, quhead_shiptoaddress1=:shiptoaddress1," " quhead_shiptoaddress2=:shiptoaddress2, quhead_shiptoaddress3=:shiptoaddress3," " quhead_shiptocity=:shiptocity, quhead_shiptostate=:shiptostate, quhead_shiptozipcode=:shiptozipcode," " quhead_shiptocountry=:shiptocountry," " quhead_quotedate=:orderdate, quhead_packdate=:packdate," " quhead_salesrep_id=:salesrep_id, quhead_commission=:commission," " quhead_taxzone_id=:taxzone_id, quhead_terms_id=:terms_id," " quhead_shipvia=:shipvia, quhead_fob=:fob," " quhead_freight=:freight, quhead_calcfreight=:calcfreight," " quhead_misc=:misc, quhead_misc_accnt_id=:misc_accnt_id, quhead_misc_descrip=:misc_descrip," " quhead_ordercomments=:ordercomments, quhead_shipcomments=:shipcomments," " quhead_prj_id=:prj_id, quhead_ophead_id=:ophead_id, quhead_warehous_id=:warehous_id," " quhead_curr_id = :curr_id, quhead_expire=:expire," " quhead_shipto_cntct_id=:shipto_cntct_id," " quhead_shipto_cntct_honorific=:shipto_cntct_honorific," " quhead_shipto_cntct_first_name=:shipto_cntct_first_name," " quhead_shipto_cntct_middle=:shipto_cntct_middle," " quhead_shipto_cntct_last_name=:shipto_cntct_last_name," " quhead_shipto_cntct_suffix=:shipto_cntct_suffix," " quhead_shipto_cntct_phone=:shipto_cntct_phone," " quhead_shipto_cntct_title=:shipto_cntct_title," " quhead_shipto_cntct_fax=:shipto_cntct_fax," " quhead_shipto_cntct_email=:shipto_cntct_email," " quhead_billto_cntct_id=:billto_cntct_id," " quhead_billto_cntct_honorific=:billto_cntct_honorific," " quhead_billto_cntct_first_name=:billto_cntct_first_name," " quhead_billto_cntct_middle=:billto_cntct_middle," " quhead_billto_cntct_last_name=:billto_cntct_last_name," " quhead_billto_cntct_suffix=:billto_cntct_suffix," " quhead_billto_cntct_phone=:billto_cntct_phone," " quhead_billto_cntct_title=:billto_cntct_title," " quhead_billto_cntct_fax=:billto_cntct_fax," " quhead_billto_cntct_email=:billto_cntct_email," " quhead_shipzone_id=:shipzone_id," " quhead_saletype_id=:saletype_id " "WHERE (quhead_id=:id);" ); else if (_mode == cNewQuote) saveSales.prepare( "INSERT INTO quhead (" " quhead_id, quhead_number, quhead_cust_id," " quhead_custponumber, quhead_shipto_id," " quhead_billtoname, quhead_billtoaddress1," " quhead_billtoaddress2, quhead_billtoaddress3," " quhead_billtocity, quhead_billtostate, quhead_billtozip," " quhead_billtocountry," " quhead_shiptoname, quhead_shiptoaddress1," " quhead_shiptoaddress2, quhead_shiptoaddress3," " quhead_shiptocity, quhead_shiptostate, quhead_shiptozipcode," " quhead_shiptocountry," " quhead_quotedate, quhead_packdate," " quhead_salesrep_id, quhead_commission," " quhead_taxzone_id, quhead_terms_id," " quhead_shipvia, quhead_fob," " quhead_freight, quhead_calcfreight," " quhead_misc, quhead_misc_accnt_id, quhead_misc_descrip," " quhead_ordercomments, quhead_shipcomments," " quhead_prj_id, quhead_ophead_id, quhead_warehous_id," " quhead_curr_id, quhead_expire," " quhead_shipto_cntct_id," " quhead_shipto_cntct_honorific," " quhead_shipto_cntct_first_name," " quhead_shipto_cntct_middle," " quhead_shipto_cntct_last_name," " quhead_shipto_cntct_suffix," " quhead_shipto_cntct_phone," " quhead_shipto_cntct_title," " quhead_shipto_cntct_fax," " quhead_shipto_cntct_email," " quhead_billto_cntct_id," " quhead_billto_cntct_honorific," " quhead_billto_cntct_first_name," " quhead_billto_cntct_middle," " quhead_billto_cntct_last_name," " quhead_billto_cntct_suffix," " quhead_billto_cntct_phone," " quhead_billto_cntct_title," " quhead_billto_cntct_fax," " quhead_billto_cntct_email," " quhead_status," " quhead_shipzone_id, quhead_saletype_id)" " VALUES (" " :id, :number, :cust_id," " :custponumber, :shipto_id," " :billtoname, :billtoaddress1," " :billtoaddress2, :billtoaddress3," " :billtocity, :billtostate, :billtozipcode," " :billtocountry," " :shiptoname, :shiptoaddress1," " :shiptoaddress2, :shiptoaddress3," " :shiptocity, :shiptostate, :shiptozipcode," " :shiptocountry," " :orderdate, :packdate," " :salesrep_id, :commission," " :taxzone_id, :terms_id," " :shipvia, :fob," " :freight, :calcfreight," " :misc, :misc_accnt_id, :misc_descrip," " :ordercomments, :shipcomments," " :prj_id, :ophead_id, :warehous_id," " :curr_id, :expire," " :shipto_cntct_id," " :shipto_cntct_honorific," " :shipto_cntct_first_name," " :shipto_cntct_middle," " :shipto_cntct_last_name," " :shipto_cntct_suffix," " :shipto_cntct_phone," " :shipto_cntct_title," " :shipto_cntct_fax," " :shipto_cntct_email," " :billto_cntct_id," " :billto_cntct_honorific," " :billto_cntct_first_name," " :billto_cntct_middle," " :billto_cntct_last_name," " :billto_cntct_suffix," " :billto_cntct_phone," " :billto_cntct_title," " :billto_cntct_fax," " :billto_cntct_email," " :quhead_status," " :shipzone_id, :saletype_id) "); saveSales.bindValue(":id", _soheadid ); saveSales.bindValue(":number", _orderNumber->text()); saveSales.bindValue(":orderdate", _orderDate->date()); if (_packDate->isValid()) saveSales.bindValue(":packdate", _packDate->date()); else saveSales.bindValue(":packdate", _orderDate->date()); saveSales.bindValue(":cust_id", _cust->id()); if (_warehouse->id() != -1) saveSales.bindValue(":warehous_id", _warehouse->id()); saveSales.bindValue(":custponumber", _custPONumber->text().trimmed()); if (_shipTo->id() > 0) saveSales.bindValue(":shipto_id", _shipTo->id()); saveSales.bindValue(":billtoname", _billToName->text()); saveSales.bindValue(":billtoaddress1", _billToAddr->line1()); saveSales.bindValue(":billtoaddress2", _billToAddr->line2()); saveSales.bindValue(":billtoaddress3", _billToAddr->line3()); saveSales.bindValue(":billtocity", _billToAddr->city()); saveSales.bindValue(":billtostate", _billToAddr->state()); saveSales.bindValue(":billtozipcode", _billToAddr->postalCode()); saveSales.bindValue(":billtocountry", _billToAddr->country()); saveSales.bindValue(":shiptoname", _shipToName->text()); saveSales.bindValue(":shiptoaddress1", _shipToAddr->line1()); saveSales.bindValue(":shiptoaddress2", _shipToAddr->line2()); saveSales.bindValue(":shiptoaddress3", _shipToAddr->line3()); saveSales.bindValue(":shiptocity", _shipToAddr->city()); saveSales.bindValue(":shiptostate", _shipToAddr->state()); saveSales.bindValue(":shiptozipcode", _shipToAddr->postalCode()); saveSales.bindValue(":shiptocountry", _shipToAddr->country()); saveSales.bindValue(":ordercomments", _orderComments->toPlainText()); saveSales.bindValue(":shipcomments", _shippingComments->toPlainText()); saveSales.bindValue(":fob", _fob->text()); saveSales.bindValue(":shipvia", _shipVia->currentText()); if (_shipToCntct->isValid()) saveSales.bindValue(":shipto_cntct_id", _shipToCntct->id()); saveSales.bindValue(":shipto_cntct_honorific", _shipToCntct->honorific()); saveSales.bindValue(":shipto_cntct_first_name", _shipToCntct->first()); saveSales.bindValue(":shipto_cntct_middle", _shipToCntct->middle()); saveSales.bindValue(":shipto_cntct_last_name", _shipToCntct->last()); saveSales.bindValue(":shipto_cntct_suffix", _shipToCntct->suffix()); saveSales.bindValue(":shipto_cntct_phone", _shipToCntct->phone()); saveSales.bindValue(":shipto_cntct_title", _shipToCntct->title()); saveSales.bindValue(":shipto_cntct_fax", _shipToCntct->fax()); saveSales.bindValue(":shipto_cntct_email", _shipToCntct->emailAddress()); if (_billToCntct->isValid()) saveSales.bindValue(":billto_cntct_id", _billToCntct->id()); saveSales.bindValue(":billto_cntct_honorific", _billToCntct->honorific()); saveSales.bindValue(":billto_cntct_first_name", _billToCntct->first()); saveSales.bindValue(":billto_cntct_middle", _billToCntct->middle()); saveSales.bindValue(":billto_cntct_last_name", _billToCntct->last()); saveSales.bindValue(":billto_cntct_suffix", _billToCntct->suffix()); saveSales.bindValue(":billto_cntct_phone", _billToCntct->phone()); saveSales.bindValue(":billto_cntct_title", _billToCntct->title()); saveSales.bindValue(":billto_cntct_fax", _billToCntct->fax()); saveSales.bindValue(":billto_cntct_email", _billToCntct->emailAddress()); if (_salesRep->id() != -1) saveSales.bindValue(":salesrep_id", _salesRep->id()); if (_taxZone->isValid()) saveSales.bindValue(":taxzone_id", _taxZone->id()); if (_terms->id() != -1) saveSales.bindValue(":terms_id", _terms->id()); saveSales.bindValue(":shipchrg_id", _shippingCharges->id()); if(_shippingForm->id() > 0) saveSales.bindValue(":shipform_id", _shippingForm->id()); saveSales.bindValue(":freight", _freight->localValue()); saveSales.bindValue(":calcfreight", _calcfreight); saveSales.bindValue(":commission", (_commission->toDouble() / 100.0)); saveSales.bindValue(":misc", _miscCharge->localValue()); if (_miscChargeAccount->id() != -1) saveSales.bindValue(":misc_accnt_id", _miscChargeAccount->id()); saveSales.bindValue(":misc_descrip", _miscChargeDescription->text().trimmed()); saveSales.bindValue(":curr_id", _orderCurrency->id()); saveSales.bindValue(":cohead_shipcomplete", QVariant(_shipComplete->isChecked())); if (_project->isValid()) saveSales.bindValue(":prj_id", _project->id()); if (_opportunity->isValid()) saveSales.bindValue(":ophead_id", _opportunity->id()); if (_expire->isValid()) saveSales.bindValue(":expire", _expire->date()); if (_holdType->currentIndex() == 0) saveSales.bindValue(":holdtype", "N"); else if (_holdType->currentIndex() == 1) saveSales.bindValue(":holdtype", "C"); else if (_holdType->currentIndex() == 2) saveSales.bindValue(":holdtype", "S"); else if (_holdType->currentIndex() == 3) saveSales.bindValue(":holdtype", "P"); else if (_holdType->currentIndex() == 4) saveSales.bindValue(":holdtype", "R"); if(_shippingZone->isValid()) saveSales.bindValue(":shipzone_id", _shippingZone->id()); if(_saleType->isValid()) saveSales.bindValue(":saletype_id", _saleType->id()); saveSales.bindValue(":quhead_status", "O"); saveSales.exec(); if (saveSales.lastError().type() != QSqlError::NoError) { systemError(this, saveSales.lastError().databaseText(), __FILE__, __LINE__); return false; } // if this is a new so record and we haven't saved already // then we need to lock this record. if ((cNew == _mode) && (!_saved) && !_locked) { // should I bother to check because no one should have this but us? saveSales.prepare("SELECT tryLock(oid::integer, :head_id) AS locked " "FROM pg_class " "WHERE relname=:table;"); saveSales.bindValue(":head_id", _soheadid); if (ISORDER(_mode)) saveSales.bindValue(":table", "cohead"); else saveSales.bindValue(":table", "quhead"); saveSales.exec(); if (saveSales.first()) _locked = saveSales.value("locked").toBool(); else if (saveSales.lastError().type() != QSqlError::NoError) { systemError(this, saveSales.lastError().databaseText(), __FILE__, __LINE__); return false; } } _saved = true; if (!partial) { if ((cNew == _mode) && _metrics->boolean("AutoAllocateCreditMemos")) { sAllocateCreditMemos(); } if ( (_mode == cNew) || (_mode == cEdit) ) { omfgThis->sSalesOrdersUpdated(_soheadid); omfgThis->sProjectsUpdated(_soheadid); } else if ( (_mode == cNewQuote) || (_mode == cEditQuote) ) omfgThis->sQuotesUpdated(_soheadid); } else { populateCMInfo(); populateCCInfo(); } emit saved(_soheadid); return TRUE; } void salesOrder::sPopulateMenu(QMenu *pMenu) { if ((_mode == cNew) || (_mode == cEdit)) { QAction *menuItem; bool didsomething = false; if (_numSelected == 1) { didsomething = true; if (_lineMode == cClosed) pMenu->addAction(tr("Open Line..."), this, SLOT(sAction())); else if (_lineMode == cActiveOpen) { pMenu->addAction(tr("Edit Line..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("Firm Line..."), this, SLOT(sFirm())); menuItem->setEnabled(_privileges->check("FirmSalesOrder")); pMenu->addAction(tr("Close Line..."), this, SLOT(sAction())); } else if (_lineMode == cInactiveOpen) { pMenu->addAction(tr("Edit Line..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("Firm Line..."), this, SLOT(sFirm())); menuItem->setEnabled(_privileges->check("FirmSalesOrder")); pMenu->addAction(tr("Close Line..."), this, SLOT(sAction())); pMenu->addAction(tr("Delete Line..."), this, SLOT(sDelete())); } else { menuItem = pMenu->addAction(tr("Soften Line..."), this, SLOT(sSoften())); menuItem->setEnabled(_privileges->check("FirmSalesOrder")); } } if (_metrics->boolean("EnableSOReservations")) { if (didsomething) pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Show Reservations..."), this, SLOT(sShowReservations())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Unreserve Stock"), this, SLOT(sUnreserveStock())); menuItem->setEnabled(_privileges->check("MaintainReservations")); menuItem = pMenu->addAction(tr("Reserve Stock..."), this, SLOT(sReserveStock())); menuItem->setEnabled(_privileges->check("MaintainReservations")); menuItem = pMenu->addAction(tr("Reserve Line Balance"), this, SLOT(sReserveLineBalance())); menuItem->setEnabled(_privileges->check("MaintainReservations")); didsomething = true; } if (_metrics->boolean("EnableSOShipping")) { if (didsomething) pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Return Stock"), this, SLOT(sReturnStock())); menuItem->setEnabled(_privileges->check("IssueStockToShipping")); menuItem = pMenu->addAction(tr("Issue Stock..."), this, SLOT(sIssueStock())); menuItem->setEnabled(_privileges->check("IssueStockToShipping")); menuItem = pMenu->addAction(tr("Issue Line Balance"), this, SLOT(sIssueLineBalance())); menuItem->setEnabled(_privileges->check("IssueStockToShipping")); didsomething = true; } XSqlQuery createOrder; createOrder.prepare( "SELECT coitem_order_type " "FROM coitem " "WHERE (coitem_id=:coitem_id);"); QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { createOrder.bindValue(":coitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); createOrder.exec(); if (createOrder.first()) { if (didsomething) pMenu->addSeparator(); if (createOrder.value("coitem_order_type").toString() == "P") { XSqlQuery checkPO; checkPO.prepare( "SELECT pohead_id " "FROM pohead JOIN poitem ON (pohead_id=poitem_pohead_id) " " RIGHT OUTER JOIN coitem ON (poitem_id=coitem_order_id) " "WHERE (coitem_id=:coitem_id);" ); checkPO.bindValue(":coitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); checkPO.exec(); if (checkPO.first()) { menuItem = pMenu->addAction(tr("View Purchase Order..."), this, SLOT(sViewPO())); menuItem->setEnabled(_privileges->check("ViewPurchaseOrders")); menuItem = pMenu->addAction(tr("Edit Purchase Order..."), this, SLOT(sMaintainPO())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); } else if (checkPO.lastError().type() != QSqlError::NoError) { systemError(this, checkPO.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (createOrder.value("coitem_order_type").toString() == "R") { XSqlQuery checkPR; checkPR.prepare( "SELECT pr_id " "FROM pr JOIN coitem ON (pr_id=coitem_order_id) " "WHERE (coitem_id=:coitem_id);" ); checkPR.bindValue(":coitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); checkPR.exec(); if (checkPR.first()) { menuItem = pMenu->addAction(tr("Release P/R..."), this, SLOT(sReleasePR())); menuItem->setEnabled(_privileges->check("MaintainPurchaseOrders")); menuItem = pMenu->addAction(tr("View Purchase Request..."), this, SLOT(sViewPR())); menuItem->setEnabled(_privileges->check("ViewPurchaseRequests")); } else if (checkPR.lastError().type() != QSqlError::NoError) { systemError(this, checkPR.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (createOrder.value("coitem_order_type").toString() == "W") { XSqlQuery checkWO; checkWO.prepare( "SELECT wo_id " "FROM wo JOIN coitem ON (wo_id=coitem_order_id)" "WHERE (coitem_id=:coitem_id);" ); checkWO.bindValue(":coitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); checkWO.exec(); if (checkWO.first()) { menuItem = pMenu->addAction(tr("View Work Order..."), this, SLOT(sViewWO())); menuItem->setEnabled(_privileges->check("ViewWorkOrders")); menuItem = pMenu->addAction(tr("Edit Work Order..."), this, SLOT(sMaintainWO())); menuItem->setEnabled(_privileges->check("MaintainWorkOrders")); } else if (checkWO.lastError().type() != QSqlError::NoError) { systemError(this, checkWO.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (createOrder.lastError().type() != QSqlError::NoError) { systemError(this, createOrder.lastError().databaseText(), __FILE__, __LINE__); return; } didsomething = true; } } } void salesOrder::populateOrderNumber() { XSqlQuery populateSales; if (_mode == cNew) { if ( (_metrics->value("CONumberGeneration") == "A") || (_metrics->value("CONumberGeneration") == "O") ) { populateSales.exec("SELECT fetchSoNumber() AS sonumber;"); if (populateSales.first()) { _orderNumber->setText(populateSales.value("sonumber").toString()); _orderNumberGen = populateSales.value("sonumber").toInt(); _userEnteredOrderNumber = FALSE; if (_metrics->value("CONumberGeneration") == "A") _orderNumber->setEnabled(FALSE); } else if (populateSales.lastError().type() != QSqlError::NoError) { systemError(this, populateSales.lastError().databaseText(), __FILE__, __LINE__); return; } } _userEnteredOrderNumber = FALSE; } else if (_mode == cNewQuote) { if ( (_metrics->value("QUNumberGeneration") == "A") || (_metrics->value("QUNumberGeneration") == "O") || (_metrics->value("QUNumberGeneration") == "S") ) { if (_metrics->value("QUNumberGeneration") == "S") populateSales.prepare("SELECT fetchSoNumber() AS qunumber;"); else populateSales.prepare("SELECT fetchQuNumber() AS qunumber;"); populateSales.exec(); if (populateSales.first()) { _orderNumber->setText(populateSales.value("qunumber").toString()); _orderNumberGen = populateSales.value("qunumber").toInt(); _userEnteredOrderNumber = FALSE; if ( (_metrics->value("QUNumberGeneration") == "A") || (_metrics->value("QUNumberGeneration") == "S") ) _orderNumber->setEnabled(FALSE); } else if (populateSales.lastError().type() != QSqlError::NoError) { systemError(this, populateSales.lastError().databaseText(), __FILE__, __LINE__); return; } _userEnteredOrderNumber = FALSE; } } } void salesOrder::sSetUserEnteredOrderNumber() { _userEnteredOrderNumber = TRUE; } void salesOrder::sHandleOrderNumber() { if (_ignoreSignals || !isActiveWindow()) return; if (_orderNumber->text().length() == 0) { if (_mode == cNew) { if ( (_metrics->value("CONumberGeneration") == "A") || (_metrics->value("CONumberGeneration") == "O") ) populateOrderNumber(); else { QMessageBox::warning( this, tr("Enter S/O #"), tr( "You must enter a S/O # for this Sales Order before you may continue." ) ); _orderNumber->setFocus(); return; } } else if (_mode == cNewQuote) { if ( (_metrics->value("QUNumberGeneration") == "A") || (_metrics->value("QUNumberGeneration") == "O") || (_metrics->value("QUNumberGeneration") == "S") ) populateOrderNumber(); else { QMessageBox::warning( this, tr("Enter Quote #"), tr( "You must enter a Quote # for this Quote before you may continue." ) ); _orderNumber->setFocus(); return; } } } else { XSqlQuery query; if ( (_mode == cNew) && (_userEnteredOrderNumber) ) { query.prepare("SELECT deleteSO(:sohead_id, :sohead_number) AS result;"); query.bindValue(":sohead_id", _soheadid); query.bindValue(":sohead_number", _orderNumber->text()); query.exec(); if (query.first()) { int result = query.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteSO", result), __FILE__, __LINE__); return; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } query.prepare( "SELECT cohead_id " "FROM cohead " "WHERE (cohead_number=:cohead_number);" ); query.bindValue(":cohead_number", _orderNumber->text()); query.exec(); if (query.first()) { _mode = cEdit; emit newModeType(2); emit newModeState(2); _soheadid = query.value("cohead_id").toInt(); populate(); _orderNumber->setEnabled(FALSE); _cust->setReadOnly(TRUE); populateCMInfo(); populateCCInfo(); sFillCcardList(); } else { QString orderNumber = _orderNumber->text(); if (_metrics->value("CONumberGeneration") == "O") { query.prepare( "SELECT releaseSoNumber(:orderNumber);" ); query.bindValue(":orderNumber", _orderNumberGen); query.exec(); _orderNumber->setText(orderNumber); _userEnteredOrderNumber = FALSE; _orderNumber->setEnabled(FALSE); } else { _orderNumber->setText(orderNumber); _orderNumber->setEnabled(FALSE); } } } else if ((_mode == cNewQuote) && (_userEnteredOrderNumber)) { query.prepare("SELECT deleteQuote(:quhead_id, :quhead_number) AS result;"); query.bindValue(":quhead_id", _soheadid); query.bindValue(":quhead_number", _orderNumberGen); query.exec(); if (query.first()) { int result = query.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteQuote", result), __FILE__, __LINE__); return; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } query.prepare( "SELECT quhead_id " "FROM quhead " "WHERE (quhead_number=:quhead_number);" ); query.bindValue(":quhead_number", _orderNumber->text()); query.exec(); if (query.first()) { QMessageBox::warning( this, tr("Quote Order Number Already exists."), tr( "

    The Quote Order Number you have entered " "already exists. Please enter a new one." ) ); clear(); _orderNumber->setFocus(); return; } else { QString orderNumber = _orderNumber->text(); if ((_metrics->value("QUNumberGeneration") == "S") || (_metrics->value("QUNumberGeneration") == "A")) { clear(); if (_metrics->value("QUNumberGeneration") == "S") query.prepare( "SELECT releaseSoNumber(:orderNumber);" ); else query.prepare( "SELECT releaseQUNumber(:orderNumber);" ); query.bindValue(":orderNumber", _orderNumberGen); query.exec(); _orderNumber->setText(orderNumber); _userEnteredOrderNumber = FALSE; _orderNumber->setEnabled(FALSE); } else { _orderNumber->setText(orderNumber); _mode = cNewQuote; emit newModeType(1); emit newModeState(1); _orderNumber->setEnabled(FALSE); } } } } } void salesOrder::sPopulateFOB(int pWarehousid) { XSqlQuery fob; fob.prepare( "SELECT warehous_fob " "FROM whsinfo " "WHERE (warehous_id=:warehous_id);" ); fob.bindValue(":warehous_id", pWarehousid); fob.exec(); if (fob.first()) _fob->setText(fob.value("warehous_fob")); } // Is the first SELECT here responsible for the bug where the Currency kept disappearing? void salesOrder::sPopulateCustomerInfo(int pCustid) { _holdType->setCurrentIndex(0); if (_cust->isValid()) { QString sql("SELECT cust_name, addr_id, " " cust_salesrep_id, cust_shipchrg_id, cust_shipform_id," " cust_commprcnt AS commission," " cust_creditstatus, cust_terms_id," " cust_taxzone_id, cust_cntct_id," " cust_ffshipto, cust_ffbillto, cust_usespos," " cust_blanketpos, cust_shipvia," " COALESCE(shipto_id, -1) AS shiptoid," " cust_preferred_warehous_id, " " cust_curr_id, COALESCE(crmacct_id,-1) AS crmacct_id, " " true AS iscustomer " "FROM custinfo " " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) " " LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) " " LEFT OUTER JOIN shiptoinfo ON ((shipto_cust_id=cust_id)" " AND (shipto_default)) " "LEFT OUTER JOIN crmacct ON (crmacct_cust_id = cust_id) " "WHERE (cust_id=) " "" "UNION " "SELECT prospect_name AS cust_name, addr_id, " " prospect_salesrep_id AS cust_salesrep_id, NULL AS cust_shipchrg_id," " NULL AS cust_shipform_id," " 0.0 AS commission," " NULL AS cust_creditstatus, NULL AS cust_terms_id," " prospect_taxzone_id AS cust_taxzone_id, prospect_cntct_id AS cust_cntct_id, " " TRUE AS cust_ffshipto, NULL AS cust_ffbillto, " " NULL AS cust_usespos, NULL AS cust_blanketpos," " NULL AS cust_shipvia," " -1 AS shiptoid," " prospect_warehous_id AS cust_preferred_warehous_id, " " NULL AS cust_curr_id, COALESCE(crmacct_id,-1) AS crmacct_id, " " false AS iscustomer " "FROM prospect " " LEFT OUTER JOIN cntct ON (prospect_cntct_id=cntct_id) " " LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) " " LEFT OUTER JOIN crmacct ON (crmacct_prospect_id = prospect_id) " "WHERE (prospect_id=) " "" ";" ); MetaSQLQuery mql(sql); ParameterList params; params.append("cust_id", pCustid); if (ISQUOTE(_mode)) params.append("isQuote"); XSqlQuery cust = mql.toQuery(params); if (cust.first()) { if (_mode == cNew) { if ( (cust.value("cust_creditstatus").toString() == "H") && (!_privileges->check("CreateSOForHoldCustomer")) ) { QMessageBox::warning( this, tr("Selected Customer on Credit Hold"), tr( "

    The selected Customer has been placed " "on a Credit Hold and you do not have " "privilege to create Sales Orders for " "Customers on Credit Hold. The selected " "Customer must be taken off of Credit Hold " "before you may create a new Sales Order " "for the Customer." ) ); _cust->setId(-1); _billToAddr->setId(-1); _billToName->clear(); _shipTo->setCustid(-1); _cust->setFocus(); return; } if ( (cust.value("cust_creditstatus").toString() == "W") && (!_privileges->check("CreateSOForWarnCustomer")) ) { QMessageBox::warning( this, tr("Selected Customer on Credit Warning"), tr( "

    The selected Customer has been placed on " "a Credit Warning and you do not have " "privilege to create Sales Orders for " "Customers on Credit Warning. The " "selected Customer must be taken off of " "Credit Warning before you may create a " "new Sales Order for the Customer." ) ); _cust->setId(-1); _billToAddr->setId(-1); _billToName->clear(); _shipTo->setCustid(-1); _cust->setFocus(); return; } if ( (cust.value("cust_creditstatus").toString() == "H") || (cust.value("cust_creditstatus").toString() == "W") ) _holdType->setCurrentIndex(1); } _billToName->setText(cust.value("cust_name").toString()); _billToAddr->setId(cust.value("addr_id").toInt()); sFillCcardList(); _usesPos = cust.value("cust_usespos").toBool(); _blanketPos = cust.value("cust_blanketpos").toBool(); _salesRep->setId(cust.value("cust_salesrep_id").toInt()); _shippingCharges->setId(cust.value("cust_shipchrg_id").toInt()); _shippingForm->setId(cust.value("cust_shipform_id").toInt()); _commission->setDouble(cust.value("commission").toDouble() * 100); _terms->setId(cust.value("cust_terms_id").toInt()); _custtaxzoneid = cust.value("cust_taxzone_id").toInt(); _billToCntct->setId(cust.value("cust_cntct_id").toInt()); _billToCntct->setSearchAcct(cust.value("crmacct_id").toInt()); _shipToCntct->setSearchAcct(cust.value("crmacct_id").toInt()); _crmacctid=cust.value("crmacct_id").toInt(); if (ISNEW(_mode)) _taxZone->setId(cust.value("cust_taxzone_id").toInt()); _shipVia->setText(cust.value("cust_shipvia")); _orderCurrency->setId(cust.value("cust_curr_id").toInt()); if (cust.value("cust_preferred_warehous_id").toInt() > 0) _warehouse->setId(cust.value("cust_preferred_warehous_id").toInt()); setFreeFormShipto(cust.value("cust_ffshipto").toBool()); _shipTo->setCustid(pCustid); if (ISNEW(_mode) && cust.value("shiptoid").toInt() != -1) populateShipto(cust.value("shiptoid").toInt()); else { _ignoreSignals = true; _shipTo->setId(cust.value("shiptoid").toInt()); _shipToName->clear(); _shipToAddr->clear(); _shipToCntct->clear(); _ignoreSignals = false; } if ((_mode == cNew) || (_mode == cNewQuote ) || (_mode == cEdit) || (_mode == cEditQuote )) { bool ffBillTo = cust.value("cust_ffbillto").toBool(); _billToName->setEnabled(ffBillTo); _billToAddr->setEnabled(ffBillTo); _billToCntct->setEnabled(ffBillTo); if (!cust.value("iscustomer").toBool()) _shipTo->setEnabled(false); } } else if (cust.lastError().type() != QSqlError::NoError) { systemError(this, cust.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _salesRep->setCurrentIndex(-1); _commission->clear(); _terms->setCurrentIndex(-1); _taxZone->setCurrentIndex(-1); _taxzoneidCache = -1; _custtaxzoneid = -1; _shipTo->setCustid(-1); _shipToName->clear(); _shipToAddr->clear(); _shipToCntct->clear(); _billToCntct->clear(); } } void salesOrder::sParseShipToNumber() { if (_ignoreSignals) return; populateShipto(_shipTo->id()); if (_soitem->topLevelItemCount()) sRecalculatePrice(); } void salesOrder::populateShipto(int pShiptoid) { if (pShiptoid != -1) { XSqlQuery shipto; shipto.prepare( "SELECT shipto_num, shipto_name, shipto_addr_id, " " cntct_phone, shipto_cntct_id, shipto_shipzone_id," " shipto_shipvia, shipto_shipcomments," " shipto_shipchrg_id, shipto_shipform_id," " COALESCE(shipto_taxzone_id, -1) AS shipto_taxzone_id," " shipto_salesrep_id, shipto_commission AS commission " "FROM shiptoinfo LEFT OUTER JOIN " " cntct ON (shipto_cntct_id = cntct_id) " "WHERE (shipto_id=:shipto_id);" ); shipto.bindValue(":shipto_id", pShiptoid); shipto.exec(); if (shipto.first()) { // Populate the dlg with the shipto information _ignoreSignals=true; if (_shipTo->id() != pShiptoid) _shipTo->setId(pShiptoid); _shipToName->setText(shipto.value("shipto_name").toString()); _shipToAddr->setId(shipto.value("shipto_addr_id").toInt()); _shipToCntct->setId(shipto.value("shipto_cntct_id").toInt()); _shippingCharges->setId(shipto.value("shipto_shipchrg_id").toInt()); _shippingForm->setId(shipto.value("shipto_shipform_id").toInt()); _salesRep->setId(shipto.value("shipto_salesrep_id").toInt()); _commission->setDouble(shipto.value("commission").toDouble() * 100); _shipVia->setText(shipto.value("shipto_shipvia")); _shippingZone->setId(shipto.value("shipto_shipzone_id").toInt()); _shippingComments->setText(shipto.value("shipto_shipcomments").toString()); if ( (ISNEW(_mode)) && (shipto.value("shipto_taxzone_id").toInt() > 0) ) _taxZone->setId(shipto.value("shipto_taxzone_id").toInt()); _ignoreSignals=false; } else if (shipto.lastError().type() != QSqlError::NoError) { systemError(this, shipto.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _shipTo->setId(-1); _shipToName->clear(); _shipToAddr->clear(); _shipToCntct->clear(); _shippingComments->clear(); } if (_saved) save(true); sFillItemList(); } void salesOrder::sConvertShipTo() { if (!_ignoreSignals) { // Convert the captive shipto to a free-form shipto _shipTo->blockSignals(true); _shipTo->setId(-1); _shipTo->setCustid(_cust->id()); _shipTo->blockSignals(false); } } void salesOrder::sNew() { if ( !_saved && ((_mode == cNew) || (_mode == cNewQuote)) ) { if (!save(true)) return; // TODO - why populate? //else // populate(); } ParameterList params; params.append("sohead_id", _soheadid); params.append("cust_id", _cust->id()); params.append("shipto_id", _shipTo->id()); params.append("orderNumber", _orderNumber->text()); params.append("curr_id", _orderCurrency->id()); params.append("orderDate", _orderDate->date()); params.append("taxzone_id", _taxZone->id()); if (_warehouse->id() != -1) params.append("warehous_id", _warehouse->id()); if (_shipDate->isValid()) params.append("shipDate", _shipDate->date()); if ((_mode == cNew) || (_mode == cEdit)) params.append("mode", "new"); else if ((_mode == cNewQuote) || (_mode == cEditQuote)) params.append("mode", "newQuote"); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); sFillItemList(); } void salesOrder::sCopyToShipto() { _shipTo->setId(-1); _shipToName->setText(_billToName->text()); _shipToAddr->setId(_billToAddr->id()); if (_billToAddr->id() <= 0) { _shipToAddr->setLine1(_billToAddr->line1()); _shipToAddr->setLine2(_billToAddr->line2()); _shipToAddr->setLine3(_billToAddr->line3()); _shipToAddr->setCity(_billToAddr->city()); _shipToAddr->setState(_billToAddr->state()); _shipToAddr->setPostalCode(_billToAddr->postalCode()); _shipToAddr->setCountry(_billToAddr->country()); } _shipToCntct->setId(_billToCntct->id()); _taxZone->setId(_custtaxzoneid); } void salesOrder::sEdit() { ParameterList params; params.append("soitem_id", _soitem->id()); params.append("cust_id", _cust->id()); params.append("shipto_id", _shipTo->id()); params.append("orderNumber", _orderNumber->text()); params.append("curr_id", _orderCurrency->id()); params.append("orderDate", _orderDate->date()); params.append("taxzone_id", _taxZone->id()); if (_mode == cView) params.append("mode", "view"); else if (_mode == cViewQuote) params.append("mode", "viewQuote"); else if (((_mode == cNew) || (_mode == cEdit)) && _soitem->currentItem()->rawValue("coitem_subnumber").toInt() != 0) params.append("mode", "view"); else if ((_mode == cNew) || (_mode == cEdit)) params.append("mode", "edit"); else if ((_mode == cNewQuote) || (_mode == cEditQuote)) params.append("mode", "editQuote"); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); if ( ( (_mode == cNew) || (_mode == cNewQuote) || (_mode == cEdit) || (_mode == cEditQuote) ) ) sFillItemList(); } void salesOrder::sHandleButtons() { XTreeWidgetItem *selected = 0; _numSelected = 0; QList selectedlist = _soitem->selectedItems(); _numSelected = selectedlist.size(); if (_numSelected > 0) selected = (XTreeWidgetItem *)(selectedlist[0]); if (selected) { _issueStock->setEnabled(_privileges->check("IssueStockToShipping")); _issueLineBalance->setEnabled(_privileges->check("IssueStockToShipping")); _reserveStock->setEnabled(_privileges->check("MaintainReservations")); _reserveLineBalance->setEnabled(_privileges->check("MaintainReservations")); if ( (_numSelected == 1) && (!selected->rawValue("coitem_firm").toBool()) ) { _edit->setEnabled(TRUE); _delete->setEnabled(TRUE); int lineMode = selected->altId(); if (ISQUOTE(_mode)) { _action->setText(tr("Close")); _action->setEnabled(FALSE); _delete->setEnabled(TRUE); } else { if (lineMode == 1) { _lineMode = cClosed; _action->setText(tr("Open")); _action->setEnabled(TRUE); _delete->setEnabled(FALSE); } else if (lineMode == 2) { _lineMode = cActiveOpen; _action->setText(tr("Close")); _action->setEnabled(TRUE); _delete->setEnabled(FALSE); } else if (lineMode == 3) { _lineMode = cInactiveOpen; _action->setText(tr("Close")); _action->setEnabled(TRUE); _delete->setEnabled(TRUE); } else if (lineMode == 4) { _lineMode = cCanceled; _action->setEnabled(FALSE); _delete->setEnabled(FALSE); } else { _action->setEnabled(FALSE); _delete->setEnabled(FALSE); } if (1 == lineMode || // closed 4 == lineMode || // cancelled selected->rawValue("item_type").toString() == "K" // kit item ) { _issueStock->setEnabled(FALSE); _issueLineBalance->setEnabled(FALSE); _reserveStock->setEnabled(FALSE); _reserveLineBalance->setEnabled(FALSE); for (int i = 0; i < selected->childCount(); i++) { if (selected->child(i)->altId() == 1 || selected->child(i)->altId() == 2 || selected->child(i)->altId() == 4) { _delete->setEnabled(FALSE); break; } } } if (!selected->rawValue("coitem_subnumber").toInt() == 0) { _edit->setText(tr("View")); _delete->setEnabled(FALSE); } else if (cNew == _mode || cEdit == _mode || cNewQuote == _mode || cEditQuote == _mode) { _edit->setText(tr("&Edit")); } } } else { _lineMode = 0; _edit->setEnabled(FALSE); _action->setEnabled(FALSE); _delete->setEnabled(FALSE); } } else { _edit->setEnabled(FALSE); _action->setEnabled(FALSE); _delete->setEnabled(FALSE); _issueStock->setEnabled(FALSE); _issueLineBalance->setEnabled(FALSE); _reserveStock->setEnabled(FALSE); _reserveLineBalance->setEnabled(FALSE); } } void salesOrder::sFirm() { XSqlQuery firmSales; if (_lineMode == cCanceled) return; if ( (_mode == cNew) || (_mode == cEdit) ) { firmSales.prepare( "UPDATE coitem " "SET coitem_firm=true " "WHERE (coitem_id=:coitem_id);" ); firmSales.bindValue(":coitem_id", _soitem->id()); firmSales.exec(); sFillItemList(); } } void salesOrder::sSoften() { XSqlQuery softenSales; if (_lineMode == cCanceled) return; if ( (_mode == cNew) || (_mode == cEdit) ) { softenSales.prepare( "UPDATE coitem " "SET coitem_firm=false " "WHERE (coitem_id=:coitem_id);" ); softenSales.bindValue(":coitem_id", _soitem->id()); softenSales.exec(); sFillItemList(); } } void salesOrder::sAction() { XSqlQuery actionSales; if (_lineMode == cCanceled) return; if ( (_mode == cNew) || (_mode == cEdit) ) { if (_lineMode == cClosed) actionSales.prepare( "UPDATE coitem " "SET coitem_status='O' " "WHERE (coitem_id=:coitem_id);" ); else { actionSales.prepare( "SELECT qtyAtShipping(:coitem_id) AS atshipping;"); actionSales.bindValue(":coitem_id", _soitem->id()); actionSales.exec(); if (actionSales.first() && actionSales.value("atshipping").toDouble() > 0) { QMessageBox::information(this, tr("Cannot Close Item"), tr("The item cannot be Closed at this time as there is inventory at shipping.") ); return; } if (_metrics->boolean("EnableSOReservations")) sUnreserveStock(); actionSales.prepare( "UPDATE coitem " "SET coitem_status='C' " "WHERE (coitem_id=:coitem_id);" ); } actionSales.bindValue(":coitem_id", _soitem->id()); actionSales.exec(); sFillItemList(); } } void salesOrder::sDelete() { XSqlQuery deleteSales; if ( (_mode == cEdit) || (_mode == cNew) ) { if (QMessageBox::question(this, tr("Delete Selected Line Item?"), tr("

    Are you sure that you want to delete the " "selected Line Item?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { if (_metrics->boolean("EnableSOReservations")) sUnreserveStock(); deleteSales.prepare( "SELECT deleteSOItem(:soitem_id) AS result;"); deleteSales.bindValue(":soitem_id", _soitem->id()); deleteSales.exec(); if (deleteSales.first()) { int result = deleteSales.value("result").toInt(); if (result == -20) QMessageBox::information(this, tr("Cannot Delete Related Purchase Order"), storedProcErrorLookup("deleteSOItem", result)); else if (result < 0) systemError(this, storedProcErrorLookup("deleteSOItem", result), __FILE__, __LINE__); } else if (deleteSales.lastError().type() != QSqlError::NoError) systemError(this, deleteSales.lastError().databaseText(), __FILE__, __LINE__); sFillItemList(); if (_soitem->topLevelItemCount() == 0) { if (QMessageBox::question(this, tr("Cancel Sales Order?"), tr("

    You have deleted all of the Line " "Items for this Sales Order. Would you " "like to cancel this Sales Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { deleteSales.prepare( "SELECT deleteSO(:sohead_id, :sohead_number) AS result;"); deleteSales.bindValue(":sohead_id", _soheadid); deleteSales.bindValue(":sohead_number", _orderNumber->text()); deleteSales.exec(); if (deleteSales.first()) { int result = deleteSales.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("deleteSO", result), __FILE__, __LINE__); } else if (deleteSales.lastError().type() != QSqlError::NoError) systemError(this, deleteSales.lastError().databaseText(), __FILE__, __LINE__); omfgThis->sSalesOrdersUpdated(_soheadid); _captive = false; clear(); } } } } else if ( (_mode == cNewQuote) || (_mode == cEditQuote) ) { deleteSales.prepare( "DELETE FROM quitem " "WHERE (quitem_id=:quitem_id);" ); deleteSales.bindValue(":quitem_id", _soitem->id()); deleteSales.exec(); sFillItemList(); if (_soitem->topLevelItemCount() == 0) { if ( QMessageBox::question(this, tr("Cancel Quote?"), tr("

    You have deleted all of the order " "lines for this Quote. Would you like to " "cancel this Quote?."), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { deleteSales.prepare("SELECT deleteQuote(:quhead_id, :quhead_number) AS result;"); deleteSales.bindValue(":quhead_id", _soheadid); deleteSales.bindValue(":quhead_number", _orderNumber->text()); deleteSales.exec(); if (deleteSales.first() && !deleteSales.value("result").toBool()) systemError(this, tr("Could not delete Quote."), __FILE__, __LINE__); else if (deleteSales.lastError().type() != QSqlError::NoError) systemError(this, deleteSales.lastError().databaseText(), __FILE__, __LINE__); omfgThis->sQuotesUpdated(_soheadid); _captive = false; clear(); } } } } void salesOrder::populate() { if ( (_mode == cNew) || (_mode == cEdit) || (_mode == cView) ) { XSqlQuery so; if (_mode == cEdit && !_locked) { // Lock the record so.prepare("SELECT tryLock(oid::integer, :sohead_id) AS locked " "FROM pg_class " "WHERE relname=:table;"); so.bindValue(":sohead_id", _soheadid); if (ISORDER(_mode)) so.bindValue(":table", "cohead"); else so.bindValue(":table", "quhead"); so.exec(); if (so.first()) { if (so.value("locked").toBool() != true) { QMessageBox::critical( this, tr("Record Currently Being Edited"), tr("

    The record you are trying to edit is currently being edited " "by another user. Continue in View Mode.") ); setViewMode(); } else _locked = true; } else { QMessageBox::critical( this, tr("Cannot Lock Record for Editing"), tr("

    There was an unexpected error while trying to lock the record " "for editing. Please report this to your administator.") ); setViewMode(); } } so.prepare( "SELECT cohead.*," " COALESCE(cohead_shipto_id,-1) AS cohead_shipto_id," " cohead_commission AS commission," " COALESCE(cohead_taxzone_id,-1) AS taxzone_id," " COALESCE(cohead_warehous_id,-1) as cohead_warehous_id," " COALESCE(cohead_shipzone_id,-1) as cohead_shipzone_id," " COALESCE(cohead_saletype_id,-1) as cohead_saletype_id," " cust_name, cust_ffshipto, cust_blanketpos," " COALESCE(cohead_misc_accnt_id,-1) AS cohead_misc_accnt_id," " CASE WHEN(cohead_wasquote) THEN COALESCE(cohead_quote_number, cohead_number)" " ELSE formatBoolYN(cohead_wasquote)" " END AS fromQuote," " COALESCE(cohead_prj_id,-1) AS cohead_prj_id, " " COALESCE(cohead_ophead_id,-1) AS cohead_ophead_id " "FROM custinfo, cohead " "WHERE ( (cohead_cust_id=cust_id)" " AND (cohead_id=:cohead_id) );" ); so.bindValue(":cohead_id", _soheadid); so.exec(); if (so.first()) { _orderNumber->setText(so.value("cohead_number").toString()); _orderNumber->setEnabled(FALSE); _orderDateCache = so.value("cohead_orderdate").toDate(); _orderDate->setDate(_orderDateCache, true); _packDate->setDate(so.value("cohead_packdate").toDate()); _fromQuote->setText(so.value("fromQuote").toString()); _cust->setId(so.value("cohead_cust_id").toInt()); setFreeFormShipto(so.value("cust_ffshipto").toBool()); _blanketPos = so.value("cust_blanketpos").toBool(); _warehouse->setId(so.value("cohead_warehous_id").toInt()); _salesRep->setId(so.value("cohead_salesrep_id").toInt()); _commission->setDouble(so.value("commission").toDouble() * 100); _taxzoneidCache = so.value("taxzone_id").toInt(); _taxZone->setId(so.value("taxzone_id").toInt()); _terms->setId(so.value("cohead_terms_id").toInt()); _orderCurrency->setId(so.value("cohead_curr_id").toInt()); _project->setId(so.value("cohead_prj_id").toInt()); _opportunity->setId(so.value("cohead_ophead_id").toInt()); _shipToCntct->setId(so.value("cohead_shipto_cntct_id").toInt()); _shipToCntct->setHonorific(so.value("cohead_shipto_cntct_honorific").toString()); _shipToCntct->setFirst(so.value("cohead_shipto_cntct_first_name").toString()); _shipToCntct->setMiddle(so.value("cohead_shipto_cntct_middle").toString()); _shipToCntct->setLast(so.value("cohead_shipto_cntct_last_name").toString()); _shipToCntct->setSuffix(so.value("cohead_shipto_cntct_suffix").toString()); _shipToCntct->setPhone(so.value("cohead_shipto_cntct_phone").toString()); _shipToCntct->setTitle(so.value("cohead_shipto_cntct_title").toString()); _shipToCntct->setFax(so.value("cohead_shipto_cntct_fax").toString()); _shipToCntct->setEmailAddress(so.value("cohead_shipto_cntct_email").toString()); _billToCntct->setId(so.value("cohead_billto_cntct_id").toInt()); _billToCntct->setHonorific(so.value("cohead_billto_cntct_honorific").toString()); _billToCntct->setFirst(so.value("cohead_billto_cntct_first_name").toString()); _billToCntct->setMiddle(so.value("cohead_billto_cntct_middle").toString()); _billToCntct->setLast(so.value("cohead_billto_cntct_last_name").toString()); _billToCntct->setSuffix(so.value("cohead_billto_cntct_suffix").toString()); _billToCntct->setPhone(so.value("cohead_billto_cntct_phone").toString()); _billToCntct->setTitle(so.value("cohead_billto_cntct_title").toString()); _billToCntct->setFax(so.value("cohead_billto_cntct_fax").toString()); _billToCntct->setEmailAddress(so.value("cohead_billto_cntct_email").toString()); _billToName->setText(so.value("cohead_billtoname").toString()); if (_billToAddr->line1() !=so.value("cohead_billtoaddress1").toString() || _billToAddr->line2() !=so.value("cohead_billtoaddress2").toString() || _billToAddr->line3() !=so.value("cohead_billtoaddress3").toString() || _billToAddr->city() !=so.value("cohead_billtocity").toString() || _billToAddr->state() !=so.value("cohead_billtostate").toString() || _billToAddr->postalCode()!=so.value("cohead_billtozipcode").toString() || _billToAddr->country()!=so.value("cohead_billtocountry").toString() ) { _billToAddr->setId(-1); _billToAddr->setLine1(so.value("cohead_billtoaddress1").toString()); _billToAddr->setLine2(so.value("cohead_billtoaddress2").toString()); _billToAddr->setLine3(so.value("cohead_billtoaddress3").toString()); _billToAddr->setCity(so.value("cohead_billtocity").toString()); _billToAddr->setState(so.value("cohead_billtostate").toString()); _billToAddr->setPostalCode(so.value("cohead_billtozipcode").toString()); _billToAddr->setCountry(so.value("cohead_billtocountry").toString()); } _ignoreSignals=true; _shipToName->setText(so.value("cohead_shiptoname").toString()); if (_shipToAddr->line1() !=so.value("cohead_shiptoaddress1").toString() || _shipToAddr->line2() !=so.value("cohead_shiptoaddress2").toString() || _shipToAddr->line3() !=so.value("cohead_shiptoaddress3").toString() || _shipToAddr->city() !=so.value("cohead_shiptocity").toString() || _shipToAddr->state() !=so.value("cohead_shiptostate").toString() || _shipToAddr->postalCode()!=so.value("cohead_shiptozipcode").toString() || _shipToAddr->country()!=so.value("cohead_shiptocountry").toString() ) { _shipToAddr->setId(-1); _shipToAddr->setLine1(so.value("cohead_shiptoaddress1").toString()); _shipToAddr->setLine2(so.value("cohead_shiptoaddress2").toString()); _shipToAddr->setLine3(so.value("cohead_shiptoaddress3").toString()); _shipToAddr->setCity(so.value("cohead_shiptocity").toString()); _shipToAddr->setState(so.value("cohead_shiptostate").toString()); _shipToAddr->setPostalCode(so.value("cohead_shiptozipcode").toString()); _shipToAddr->setCountry(so.value("cohead_shiptocountry").toString()); } _shipTo->setId(so.value("cohead_shipto_id").toInt()); _ignoreSignals=false; if (_mode == cView) _shipTo->setEnabled(FALSE); _custPONumber->setText(so.value("cohead_custponumber")); _shipVia->setText(so.value("cohead_shipvia")); _fob->setText(so.value("cohead_fob")); if (so.value("cohead_holdtype").toString() == "N") _holdType->setCurrentIndex(0); else if (so.value("cohead_holdtype").toString() == "C") _holdType->setCurrentIndex(1); else if (so.value("cohead_holdtype").toString() == "S") _holdType->setCurrentIndex(2); else if (so.value("cohead_holdtype").toString() == "P") _holdType->setCurrentIndex(3); else if (so.value("cohead_holdtype").toString() == "R") _holdType->setCurrentIndex(4); _miscCharge->setLocalValue(so.value("cohead_misc").toDouble()); _miscChargeDescription->setText(so.value("cohead_misc_descrip")); _miscChargeAccount->setId(so.value("cohead_misc_accnt_id").toInt()); _orderComments->setText(so.value("cohead_ordercomments").toString()); _shippingComments->setText(so.value("cohead_shipcomments").toString()); _shippingCharges->setId(so.value("cohead_shipchrg_id").toInt()); _shippingForm->setId(so.value("cohead_shipform_id").toInt()); _shippingZone->setId(so.value("cohead_shipzone_id").toInt()); _saleType->setId(so.value("cohead_saletype_id").toInt()); _calcfreight = so.value("cohead_calcfreight").toBool(); // Auto calculated _freight is populated in sFillItemList if (!_calcfreight) { disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(so.value("cohead_freight").toDouble()); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } _shipComplete->setChecked(so.value("cohead_shipcomplete").toBool()); _comments->setId(_soheadid); _documents->setId(_soheadid); // Check for link to Return Authorization if (_metrics->boolean("EnableReturnAuth")) { so.prepare("SELECT rahead_number " "FROM rahead " "WHERE (rahead_new_cohead_id=:sohead_id);"); so.bindValue(":sohead_id",_soheadid); so.exec(); if (so.first()) { _fromQuoteLit->setText(tr("From Return Authorization:")); _fromQuote->setText(so.value("rahead_number").toString()); } } emit populated(); sFillItemList(); } else if (so.lastError().type() != QSqlError::NoError) { systemError(this, so.lastError().databaseText(), __FILE__, __LINE__); return; } } else if ( (_mode == cNewQuote) ||(_mode == cEditQuote) || (_mode == cViewQuote) ) { XSqlQuery qu; qu.prepare( "SELECT quhead.*," " COALESCE(quhead_shipto_id,-1) AS quhead_shipto_id," " quhead_commission AS commission," " COALESCE(quhead_taxzone_id, -1) AS quhead_taxzone_id," " COALESCE(quhead_shipzone_id,-1) as quhead_shipzone_id," " COALESCE(quhead_saletype_id,-1) as quhead_saletype_id," " cust_ffshipto, cust_blanketpos," " COALESCE(quhead_misc_accnt_id,-1) AS quhead_misc_accnt_id, " " COALESCE(quhead_ophead_id,-1) AS quhead_ophead_id, " " CASE WHEN quhead_status IN ('O','') THEN 'Open' " " ELSE CASE WHEN quhead_status ='C' THEN 'Converted' " " END " " END AS status " "FROM quhead, custinfo " "WHERE ( (quhead_cust_id=cust_id)" " AND (quhead_id=:quhead_id) )" "UNION " "SELECT quhead.*," " COALESCE(quhead_shipto_id,-1) AS quhead_shipto_id," " quhead_commission AS commission," " COALESCE(quhead_taxzone_id, -1) AS quhead_taxzone_id," " COALESCE(quhead_shipzone_id,-1) as quhead_shipzone_id," " COALESCE(quhead_saletype_id,-1) as quhead_saletype_id," " TRUE AS cust_ffshipto, NULL AS cust_blanketpos," " COALESCE(quhead_misc_accnt_id, -1) AS quhead_misc_accnt_id, " " COALESCE(quhead_ophead_id,-1) AS quhead_ophead_id, " " CASE WHEN quhead_status IN ('O','') THEN 'Open' " " ELSE CASE WHEN quhead_status ='C' THEN 'Converted' " " END " " END AS status " "FROM quhead, prospect " "WHERE ( (quhead_cust_id=prospect_id)" " AND (quhead_id=:quhead_id) )" ";" ); qu.bindValue(":quhead_id", _soheadid); qu.exec(); if (qu.first()) { _orderNumber->setText(qu.value("quhead_number").toString()); _orderNumber->setEnabled(FALSE); _orderDateCache = qu.value("quhead_quotedate").toDate(); _orderDate->setDate(_orderDateCache, true); _packDate->setDate(qu.value("quhead_packdate").toDate()); if (!qu.value("quhead_expire").isNull()) _expire->setDate(qu.value("quhead_expire").toDate()); _cust->setId(qu.value("quhead_cust_id").toInt()); setFreeFormShipto(qu.value("cust_ffshipto").toBool()); _blanketPos = qu.value("cust_blanketpos").toBool(); _warehouse->setId(qu.value("quhead_warehous_id").toInt()); _salesRep->setId(qu.value("quhead_salesrep_id").toInt()); _commission->setDouble(qu.value("commission").toDouble() * 100); _taxzoneidCache = qu.value("quhead_taxzone_id").toInt(); _taxZone->setId(qu.value("quhead_taxzone_id").toInt()); _terms->setId(qu.value("quhead_terms_id").toInt()); _orderCurrency->setId(qu.value("quhead_curr_id").toInt()); _project->setId(qu.value("quhead_prj_id").toInt()); _opportunity->setId(qu.value("quhead_ophead_id").toInt()); _billToName->setText(qu.value("quhead_billtoname").toString()); _billToAddr->setLine1(qu.value("quhead_billtoaddress1").toString()); _billToAddr->setLine2(qu.value("quhead_billtoaddress2").toString()); _billToAddr->setLine3(qu.value("quhead_billtoaddress3").toString()); _billToAddr->setCity(qu.value("quhead_billtocity").toString()); _billToAddr->setState(qu.value("quhead_billtostate").toString()); _billToAddr->setPostalCode(qu.value("quhead_billtozip").toString()); _billToAddr->setCountry(qu.value("quhead_billtocountry").toString()); _shipToCntct->setId(qu.value("quhead_shipto_cntct_id").toInt()); _shipToCntct->setHonorific(qu.value("quhead_shipto_cntct_honorific").toString()); _shipToCntct->setFirst(qu.value("quhead_shipto_cntct_first_name").toString()); _shipToCntct->setMiddle(qu.value("quhead_shipto_cntct_middle").toString()); _shipToCntct->setLast(qu.value("quhead_shipto_cntct_last_name").toString()); _shipToCntct->setSuffix(qu.value("quhead_shipto_cntct_suffix").toString()); _shipToCntct->setPhone(qu.value("quhead_shipto_cntct_phone").toString()); _shipToCntct->setTitle(qu.value("quhead_shipto_cntct_title").toString()); _shipToCntct->setFax(qu.value("quhead_shipto_cntct_fax").toString()); _shipToCntct->setEmailAddress(qu.value("quhead_shipto_cntct_email").toString()); _billToCntct->setId(qu.value("quhead_billto_cntct_id").toInt()); _billToCntct->setHonorific(qu.value("quhead_billto_cntct_honorific").toString()); _billToCntct->setFirst(qu.value("quhead_billto_cntct_first_name").toString()); _billToCntct->setMiddle(qu.value("quhead_billto_cntct_middle").toString()); _billToCntct->setLast(qu.value("quhead_billto_cntct_last_name").toString()); _billToCntct->setSuffix(qu.value("quhead_billto_cntct_suffix").toString()); _billToCntct->setPhone(qu.value("quhead_billto_cntct_phone").toString()); _billToCntct->setTitle(qu.value("quhead_billto_cntct_title").toString()); _billToCntct->setFax(qu.value("quhead_billto_cntct_fax").toString()); _billToCntct->setEmailAddress(qu.value("quhead_billto_cntct_email").toString()); _ignoreSignals=true; _shipToName->setText(qu.value("quhead_shiptoname").toString()); if (_shipToAddr->line1() !=qu.value("quhead_shiptoaddress1").toString() || _shipToAddr->line2() !=qu.value("quhead_shiptoaddress2").toString() || _shipToAddr->line3() !=qu.value("quhead_shiptoaddress3").toString() || _shipToAddr->city() !=qu.value("quhead_shiptocity").toString() || _shipToAddr->state() !=qu.value("quhead_shiptostate").toString() || _shipToAddr->postalCode()!=qu.value("quhead_shiptozipcode").toString() || _shipToAddr->country()!=qu.value("quhead_shiptocountry").toString() ) { _shipToAddr->setId(-1); _shipToAddr->setLine1(qu.value("quhead_shiptoaddress1").toString()); _shipToAddr->setLine2(qu.value("quhead_shiptoaddress2").toString()); _shipToAddr->setLine3(qu.value("quhead_shiptoaddress3").toString()); _shipToAddr->setCity(qu.value("quhead_shiptocity").toString()); _shipToAddr->setState(qu.value("quhead_shiptostate").toString()); _shipToAddr->setPostalCode(qu.value("quhead_shiptozipcode").toString()); _shipToAddr->setCountry(qu.value("quhead_shiptocountry").toString()); } _shipTo->setId(qu.value("quhead_shipto_id").toInt()); _ignoreSignals=false; if (_mode == cViewQuote) _shipTo->setEnabled(FALSE); _custPONumber->setText(qu.value("quhead_custponumber")); _shipVia->setText(qu.value("quhead_shipvia")); _shippingZone->setId(qu.value("quhead_shipzone_id").toInt()); _saleType->setId(qu.value("quhead_saletype_id").toInt()); _fob->setText(qu.value("quhead_fob")); _calcfreight = qu.value("quhead_calcfreight").toBool(); // Auto calculated _freight is populated in sFillItemList if (!_calcfreight) { disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(qu.value("quhead_freight").toDouble()); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } _miscCharge->setLocalValue(qu.value("quhead_misc").toDouble()); _miscChargeDescription->setText(qu.value("quhead_misc_descrip")); _miscChargeAccount->setId(qu.value("quhead_misc_accnt_id").toInt()); _orderComments->setText(qu.value("quhead_ordercomments").toString()); _shippingComments->setText(qu.value("quhead_shipcomments").toString()); _quotestaus->setText(qu.value("status")); _comments->setId(_soheadid); _documents->setId(_soheadid); sFillItemList(); emit populated(); // TODO - a partial save is not saving everything save(false); } else if (qu.lastError().type() != QSqlError::NoError) { systemError(this, qu.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrder::sFillItemList() { XSqlQuery fillSales; if (ISORDER(_mode)) fillSales.prepare( "SELECT COALESCE(getSoSchedDate(:head_id),:ship_date) AS shipdate;" ); else fillSales.prepare( "SELECT COALESCE(MIN(quitem_scheddate),:ship_date) AS shipdate " "FROM quitem " "WHERE (quitem_quhead_id=:head_id);" ); fillSales.bindValue(":head_id", _soheadid); fillSales.bindValue(":ship_date", _shipDate->date()); fillSales.exec(); if (fillSales.first()) { _shipDateCache = fillSales.value("shipdate").toDate(); _shipDate->setDate(_shipDateCache); if (ISNEW(_mode)) _packDate->setDate(fillSales.value("shipdate").toDate()); } else if (fillSales.lastError().type() != QSqlError::NoError) { systemError(this, fillSales.lastError().databaseText(), __FILE__, __LINE__); return; } _soitem->clear(); if (ISORDER(_mode)) { MetaSQLQuery mql = mqlLoad("salesOrderItems", "list"); ParameterList params; if (!_showCanceled->isChecked()) params.append("excludeCancelled", true); params.append("sohead_id", _soheadid); XSqlQuery fl = mql.toQuery(params); _soitem->populate(fl, true); if (fl.lastError().type() != QSqlError::NoError) { systemError(this, fl.lastError().databaseText(), __FILE__, __LINE__); return; } _cust->setReadOnly(fl.size() || !ISNEW(_mode)); _amountAtShipping->setLocalValue(0.0); QString sql = "SELECT ROUND(((COALESCE(SUM(shipitem_qty),0)-coitem_qtyshipped) *" " coitem_qty_invuomratio) *" " (coitem_price / coitem_price_invuomratio),2) AS shippingAmount " " FROM coitem LEFT OUTER JOIN " " (shipitem JOIN shiphead ON (shipitem_shiphead_id=shiphead_id" " AND shiphead_order_id=:cohead_id" " AND shiphead_order_type='SO')) ON (shipitem_orderitem_id=coitem_id)" " WHERE ((coitem_cohead_id=:cohead_id)"; if (!_showCanceled->isChecked()) sql += " AND (coitem_status != 'X') "; sql += ") GROUP BY coitem_id, coitem_qtyshipped, coitem_qty_invuomratio," "coitem_price, coitem_price_invuomratio;"; fillSales.prepare(sql); fillSales.bindValue(":cohead_id", _soheadid); fillSales.bindValue(":cust_id", _cust->id()); fillSales.exec(); while (fillSales.next()) _amountAtShipping->setLocalValue(_amountAtShipping->localValue() + fillSales.value("shippingAmount").toDouble()); if (fillSales.lastError().type() != QSqlError::NoError) { systemError(this, fillSales.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (ISQUOTE(_mode)) { XSqlQuery fl; fl.prepare( "SELECT quitem_id," " quitem_linenumber AS f_linenumber," " 0 AS coitem_subnumber, item_type," " item_number, (item_descrip1 || ' ' || item_descrip2) AS description," " warehous_code, '' AS enhanced_status," " quitem_scheddate AS coitem_scheddate," " quom.uom_name AS qty_uom," " quitem_qtyord AS coitem_qtyord," " 0 AS qtyshipped, 0 AS qtyatshipping, 0 AS balance," " puom.uom_name AS price_uom," " quitem_price AS coitem_price," " ROUND((quitem_qtyord * quitem_qty_invuomratio) *" " (quitem_price / quitem_price_invuomratio),2) AS extprice," " quitem_custprice AS coitem_custprice," " 'qty' AS coitem_qtyord_xtnumericrole," " 'qty' AS qtyshipped_xtnumericrole," " 'qty' AS balance_xtnumericrole," " 'qty' AS qtyatshipping_xtnumericrole," " 'salesprice' AS coitem_price_xtnumericrole," " 'curr' AS extprice_xtnumericrole " " FROM item, uom AS quom, uom AS puom," " quitem LEFT OUTER JOIN (itemsite JOIN whsinfo ON (itemsite_warehous_id=warehous_id)) ON (quitem_itemsite_id=itemsite_id) " " WHERE ( (quitem_item_id=item_id)" " AND (quitem_qty_uom_id=quom.uom_id)" " AND (quitem_price_uom_id=puom.uom_id)" " AND (quitem_quhead_id=:quhead_id) ) " "ORDER BY quitem_linenumber;" ); fl.bindValue(":quhead_id", _soheadid); fl.exec(); _cust->setReadOnly(fl.size() || !ISNEW(_mode)); _soitem->populate(fl); if (fl.lastError().type() != QSqlError::NoError) { systemError(this, fl.lastError().databaseText(), __FILE__, __LINE__); return; } } // Determine the subtotal if (ISORDER(_mode)) fillSales.prepare( "SELECT SUM(round((coitem_qtyord * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio),2)) AS subtotal," " SUM(round((coitem_qtyord * coitem_qty_invuomratio) * (coitem_unitcost / coitem_price_invuomratio),2)) AS totalcost " "FROM cohead JOIN coitem ON (coitem_cohead_id=cohead_id) " "WHERE ( (cohead_id=:head_id)" " AND (coitem_status <> 'X') );" ); else fillSales.prepare( "SELECT SUM(round((quitem_qtyord * quitem_qty_invuomratio) * (quitem_price / quitem_price_invuomratio),2)) AS subtotal," " SUM(round((quitem_qtyord * quitem_qty_invuomratio) * (quitem_unitcost / quitem_price_invuomratio),2)) AS totalcost " "FROM quhead JOIN quitem ON (quitem_quhead_id=quhead_id) " "WHERE (quhead_id=:head_id);" ); fillSales.bindValue(":head_id", _soheadid); fillSales.exec(); if (fillSales.first()) { _subtotal->setLocalValue(fillSales.value("subtotal").toDouble()); _margin->setLocalValue(fillSales.value("subtotal").toDouble() - fillSales.value("totalcost").toDouble()); } else if (fillSales.lastError().type() != QSqlError::NoError) { systemError(this, fillSales.lastError().databaseText(), __FILE__, __LINE__); return; } if (ISORDER(_mode)) fillSales.prepare("SELECT SUM(COALESCE(coitem_qtyord * coitem_qty_invuomratio, 0.00) *" " COALESCE(item_prodweight, 0.00)) AS netweight," " SUM(COALESCE(coitem_qtyord * coitem_qty_invuomratio, 0.00) *" " (COALESCE(item_prodweight, 0.00) +" " COALESCE(item_packweight, 0.00))) AS grossweight " "FROM coitem, itemsite, item, cohead " "WHERE ((coitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (coitem_cohead_id=cohead_id)" " AND (coitem_status<>'X')" " AND (coitem_cohead_id=:head_id)) " "GROUP BY cohead_freight;"); else if (ISQUOTE(_mode)) fillSales.prepare("SELECT SUM(COALESCE(quitem_qtyord * quitem_qty_invuomratio, 0.00) *" " COALESCE(item_prodweight, 0.00)) AS netweight," " SUM(COALESCE(quitem_qtyord * quitem_qty_invuomratio, 0.00) *" " (COALESCE(item_prodweight, 0.00) +" " COALESCE(item_packweight, 0.00))) AS grossweight " " FROM quitem, item, quhead " " WHERE ( (quitem_item_id=item_id)" " AND (quitem_quhead_id=quhead_id)" " AND (quitem_quhead_id=:head_id)) " " GROUP BY quhead_freight;"); fillSales.bindValue(":head_id", _soheadid); fillSales.exec(); if (fillSales.first()) _weight->setDouble(fillSales.value("grossweight").toDouble()); else if (fillSales.lastError().type() != QSqlError::NoError) { systemError(this, fillSales.lastError().databaseText(), __FILE__, __LINE__); return; } if (_calcfreight) { if (ISORDER(_mode)) fillSales.prepare("SELECT SUM(freightdata_total) AS freight " "FROM freightDetail('SO', :head_id, :cust_id, :shipto_id, :orderdate, :shipvia, :curr_id);"); else if (ISQUOTE(_mode)) fillSales.prepare("SELECT SUM(freightdata_total) AS freight " "FROM freightDetail('QU', :head_id, :cust_id, :shipto_id, :orderdate, :shipvia, :curr_id);"); fillSales.bindValue(":head_id", _soheadid); fillSales.bindValue(":cust_id", _cust->id()); fillSales.bindValue(":shipto_id", _shipTo->id()); fillSales.bindValue(":orderdate", _orderDate->date()); fillSales.bindValue(":shipvia", _shipVia->currentText()); fillSales.bindValue(":curr_id", _orderCurrency->id()); fillSales.exec(); if (fillSales.first()) { _freightCache = fillSales.value("freight").toDouble(); disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(_freightCache); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } else if (fillSales.lastError().type() != QSqlError::NoError) { systemError(this, fillSales.lastError().databaseText(), __FILE__, __LINE__); return; } } sCalculateTax(); // triggers sCalculateTotal(); _orderCurrency->setEnabled(_soitem->topLevelItemCount() == 0); } void salesOrder::sCalculateTotal() { _total->setLocalValue(_subtotal->localValue() + _tax->localValue() + _miscCharge->localValue() + _freight->localValue()); double balance = _total->localValue() - _allocatedCM->localValue() - _authCC->localValue() - _amountOutstanding; if (balance < 0) balance = 0; _balance->setLocalValue(balance); _CCAmount->setLocalValue(balance); if (ISVIEW(_mode) || balance==0) { _authorize->hide(); _charge->hide(); } else { _authorize->setVisible(_metrics->boolean("CCEnablePreauth")); _charge->setVisible(_metrics->boolean("CCEnableCharge")); } } bool salesOrder::deleteForCancel() { XSqlQuery query; if (ISNEW(_mode) && _soitem->topLevelItemCount() > 0 && !_captive) { int answer; if (_mode == cNew) answer = QMessageBox::question(this, tr("Delete Sales Order?"), tr("

    Are you sure you want to delete this " "Sales Order and its associated Line Items?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); else answer = QMessageBox::question(this, tr("Delete Quote?"), tr("

    Are you sure you want to delete this " "Quote and its associated Line Items?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::No) return false; } if (_mode == cNew && !_captive) { query.prepare("SELECT deleteSO(:sohead_id, :sohead_number) AS result;"); query.bindValue(":sohead_id", _soheadid); query.bindValue(":sohead_number", _orderNumber->text()); query.exec(); if (query.first()) { int result = query.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("deleteSO", result), __FILE__, __LINE__); } else if (query.lastError().type() != QSqlError::NoError) systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); if ((_metrics->value("CONumberGeneration") == "A") || (_metrics->value("CONumberGeneration") == "O")) { query.prepare( "SELECT releaseSONumber(:orderNumber);" ); query.bindValue(":orderNumber", _orderNumber->text()); query.exec(); if (query.lastError().type() != QSqlError::NoError) systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); } } else if (_mode == cNewQuote && !_captive) { query.prepare("SELECT deleteQuote(:head_id, :quhead_number) AS result;"); query.bindValue(":head_id", _soheadid); query.bindValue(":quhead_number", _orderNumberGen); query.exec(); if (query.first()) { int result = query.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("deleteQuote", result), __FILE__, __LINE__); } else if (query.lastError().type() != QSqlError::NoError) systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); if ((_metrics->value("QUNumberGeneration") == "S") || (_metrics->value("QUNumberGeneration") == "A") || (_metrics->value("QUNumberGeneration") == "O")) { if (_metrics->value("QUNumberGeneration") == "S") query.prepare( "SELECT releaseSoNumber(:orderNumber);" ); else query.prepare( "SELECT releaseQUNumber(:orderNumber);" ); query.bindValue(":orderNumber", _orderNumberGen); query.exec(); if (query.lastError().type() != QSqlError::NoError) systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); } } if (cView != _mode && _locked) { query.prepare("SELECT pg_advisory_unlock(oid::integer, :sohead_id) AS result " "FROM pg_class " "WHERE relname=:table;"); query.bindValue(":sohead_id", _soheadid); if (ISORDER(_mode)) query.bindValue(":table", "cohead"); else query.bindValue(":table", "quhead"); query.exec(); if (query.first() && !query.value("result").toBool()) systemError(this, tr("Could not release this Sales Order record."), __FILE__, __LINE__); else if (query.lastError().type() != QSqlError::NoError) systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); else _locked=false; } return true; } void salesOrder::sClear() { if (!deleteForCancel()) return; _captive = false; clear(); } void salesOrder::clear() { XSqlQuery clearSales; if (cView != _mode && _locked) { clearSales.prepare("SELECT pg_advisory_unlock(oid::integer, :sohead_id) AS result " "FROM pg_class " "WHERE relname=:table;"); clearSales.bindValue(":sohead_id", _soheadid); if (ISORDER(_mode)) clearSales.bindValue(":table", "cohead"); else clearSales.bindValue(":table", "quhead"); clearSales.exec(); if (clearSales.first() && !clearSales.value("result").toBool()) systemError(this, tr("Could not release this Sales Order record."), __FILE__, __LINE__); else if (clearSales.lastError().type() != QSqlError::NoError) systemError(this, clearSales.lastError().databaseText(), __FILE__, __LINE__); else _locked=false; } _salesOrderInformation->setCurrentIndex(0); _orderNumber->setEnabled(TRUE); _orderNumberGen = 0; _orderNumber->clear(); _shipDate->clear(); _ignoreSignals = true; _cust->setId(-1); _shipTo->setId(-1); _ignoreSignals = false; _warehouse->setId(_preferences->value("PreferredWarehouse").toInt()); _salesRep->setCurrentIndex(-1); _commission->clear(); _billToAddr->setId(-1); _shipToAddr->setId(-1); _billToName->clear(); _shipToName->clear(); _taxZone->setCurrentIndex(-1); _taxzoneidCache = -1; _custtaxzoneid = -1; _terms->setCurrentIndex(-1); _shipVia->setCurrentIndex(-1); _shippingCharges->setCurrentIndex(-1); _shippingForm->setCurrentIndex(-1); _holdType->setCurrentIndex(0); _calcfreight = _metrics->boolean("CalculateFreight"); _freightCache = 0; disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->clear(); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _orderComments->clear(); _shippingComments->clear(); _custPONumber->clear(); _miscCharge->clear(); _miscChargeDescription->clear(); _miscChargeAccount->setId(-1); _subtotal->clear(); _tax->clear(); _miscCharge->clear(); _total->clear(); _orderCurrency->setCurrentIndex(0); _orderCurrency->setEnabled(true); _weight->clear(); _allocatedCM->clear(); _outstandingCM->clear(); _authCC->clear(); _balance->clear(); _CCAmount->clear(); _CCCVV->clear(); _project->setId(-1); _fromQuoteLit->setText(tr("From Quote:")); _fromQuote->setText(tr("No")); _shipComplete->setChecked(false); if ( (_mode == cEdit) || (_mode == cNew) ) { _mode = cNew; emit newModeType(2); emit newModeState(1); setObjectName("salesOrder new"); _orderDateCache = omfgThis->dbDate(); _orderDate->setDate(_orderDateCache, true); } else if ( (_mode == cEditQuote) || (_mode == cNewQuote) ) { _mode = cNewQuote; emit newModeType(1); emit newModeState(1); } populateOrderNumber(); if (_orderNumber->text().isEmpty()) _orderNumber->setFocus(); else _cust->setFocus(); XSqlQuery headid; if (ISORDER(_mode)) headid.exec("SELECT NEXTVAL('cohead_cohead_id_seq') AS _soheadid"); else headid.exec("SELECT NEXTVAL('quhead_quhead_id_seq') AS _soheadid"); if (headid.first()) { _soheadid = headid.value("_soheadid").toInt(); emit newId(_soheadid); _comments->setId(_soheadid); _documents->setId(_soheadid); if (ISORDER(_mode)) { populateCMInfo(); populateCCInfo(); sFillCcardList(); } } else if (headid.lastError().type() != QSqlError::NoError) systemError(this, headid.lastError().databaseText(), __FILE__, __LINE__); _soitem->clear(); _cust->setReadOnly(FALSE); _saved = false; } void salesOrder::closeEvent(QCloseEvent *pEvent) { if (!deleteForCancel()) { pEvent->ignore(); return; } disconnect(_orderNumber, SIGNAL(editingFinished()), this, SLOT(sHandleOrderNumber())); if (cNew == _mode && _saved) omfgThis->sSalesOrdersUpdated(-1); else if (cNewQuote == _mode && _saved) omfgThis->sQuotesUpdated(-1); _preferences->set("SoShowAll", _more->isChecked()); XWidget::closeEvent(pEvent); } void salesOrder::sHandleShipchrg(int pShipchrgid) { if ( (_mode == cView) || (_mode == cViewQuote) ) _freight->setEnabled(FALSE); else { XSqlQuery query; query.prepare( "SELECT shipchrg_custfreight " "FROM shipchrg " "WHERE (shipchrg_id=:shipchrg_id);" ); query.bindValue(":shipchrg_id", pShipchrgid); query.exec(); if (query.first()) { if (query.value("shipchrg_custfreight").toBool()) { _calcfreight = _metrics->boolean("CalculateFreight"); _freight->setEnabled(TRUE); sFillItemList(); } else { _calcfreight = FALSE; _freightCache = 0; _freight->setEnabled(FALSE); disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->clear(); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); sCalculateTax(); } } } } void salesOrder::sHandleSalesOrderEvent(int pSoheadid, bool) { if (pSoheadid == _soheadid) sFillItemList(); } void salesOrder::sTaxDetail() { XSqlQuery taxq; if (!ISVIEW(_mode)) { if (ISORDER(_mode)) taxq.prepare("UPDATE cohead SET cohead_taxzone_id=:taxzone_id, " " cohead_freight=:freight," " cohead_orderdate=:date " "WHERE (cohead_id=:head_id);"); else taxq.prepare("UPDATE quhead SET quhead_taxzone_id=:taxzone_id, " " quhead_freight=:freight," " quhead_quotedate=:date " "WHERE (quhead_id=:head_id);"); if (_taxZone->isValid()) taxq.bindValue(":taxzone_id", _taxZone->id()); taxq.bindValue(":freight", _freight->localValue()); taxq.bindValue(":date", _orderDate->date()); taxq.bindValue(":head_id", _soheadid); taxq.exec(); if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } } ParameterList params; params.append("order_id", _soheadid); if (ISORDER(_mode)) params.append("order_type", "S"); else params.append("order_type", "Q"); // mode => view since there are no fields to hold modified tax data params.append("mode", "view"); taxBreakdown newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) { populate(); } } void salesOrder::sFreightDetail() { ParameterList params; params.append("calcfreight", _calcfreight); if (ISORDER(_mode)) params.append("order_type", "SO"); else params.append("order_type", "QU"); params.append("order_id", _soheadid); params.append("document_number", _orderNumber->text()); params.append("cust_id", _cust->id()); params.append("shipto_id", _shipTo->id()); params.append("orderdate", _orderDate->date()); params.append("shipvia", _shipVia->currentText()); params.append("curr_id", _orderCurrency->id()); // mode => view since there are no fields to hold modified freight data params.append("mode", "view"); freightBreakdown newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); if (_saved) populate(); } void salesOrder::setFreeFormShipto(bool pFreeForm) { _ffShipto = pFreeForm; // If we are in view mode it doesn't matter as we // always want these fields disabled. if ( (_mode == cView) || (_mode == cViewQuote) ) _ffShipto = false; _shipToName->setEnabled(_ffShipto); _shipToAddr->setEnabled(_ffShipto); _shipToCntct->setEnabled(_ffShipto); _copyToShipto->setEnabled(_ffShipto); } void salesOrder::setViewMode() { if (cEdit == _mode) { // Undo some changes set for the edit mode _captive = false; disconnect( _cust, SIGNAL(valid(bool)), _new, SLOT(setEnabled(bool))); disconnect( omfgThis, SIGNAL(salesOrdersUpdated(int, bool)), this, SLOT(sHandleSalesOrderEvent(int, bool))); _new->setEnabled(false); } _mode = cView; emit newModeType(2); emit newModeState(3); setObjectName(QString("salesOrder view %1").arg(_soheadid)); _orderNumber->setEnabled(FALSE); _packDate->setEnabled(FALSE); _shipDate->setEnabled(FALSE); _opportunity->setEnabled(FALSE); _cust->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _salesRep->setEnabled(FALSE); _commission->setEnabled(FALSE); _taxZone->setEnabled(FALSE); _terms->setEnabled(FALSE); _fob->setEnabled(FALSE); _shipVia->setEnabled(FALSE); _shippingCharges->setEnabled(FALSE); _shippingForm->setEnabled(FALSE); _miscCharge->setEnabled(FALSE); _miscChargeDescription->setEnabled(FALSE); _miscChargeAccount->setReadOnly(TRUE); _miscChargeAccount->setEnabled(FALSE); _freight->setEnabled(FALSE); _orderComments->setEnabled(FALSE); _shippingComments->setEnabled(FALSE); _custPONumber->setEnabled(FALSE); _holdType->setEnabled(FALSE); _edit->setText(tr("View")); _comments->setType(Comments::SalesOrder); _comments->setReadOnly(true); _documents->setType(Documents::SalesOrder); _documents->setReadOnly(true); _shipComplete->setEnabled(false); setFreeFormShipto(false); _orderCurrency->setEnabled(FALSE); _printSO->setEnabled(FALSE); _shippingZone->setEnabled(FALSE); _saleType->setEnabled(FALSE); _save->hide(); _clear->hide(); _project->setReadOnly(true); if (_metrics->boolean("AlwaysShowSaveAndAdd")) _saveAndAdd->setEnabled(false); else _saveAndAdd->hide(); _action->hide(); _delete->hide(); } /** @brief Delete a Sales Order by internal id. deleteSalesOrder method deletes a single sales order given its id. This enforces the common rules of the user interface, such as asking whether the user really wants to delete the order and providing alternatives if the order cannot be deleted for business reasons. @param pId The internal id of the sales order to delete @param parent The parent window, if any, requesting the delete @return true if the sales order was deleted or closed, otherwise false */ bool salesOrder::deleteSalesOrder(int pId, QWidget *parent) { // TODO: move to the delete trigger? if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkSOSitePrivs(:coheadid) AS result;"); check.bindValue(":coheadid", pId); check.exec(); if (check.first() && ! check.value("result").toBool()) { QMessageBox::critical(parent, tr("Access Denied"), tr("You may not delete this Sales Order as it " "refers to a Site for which you have not been " "granted privileges.")) ; return false; } } QString question = tr("

    Are you sure that you want to completely " "delete the selected Sales Order?"); XSqlQuery woq; woq.prepare("SELECT BOOL_OR(woStarted(coitem_order_id)) AS workstarted" " FROM coitem" " WHERE ((coitem_order_type='W')" " AND (coitem_cohead_id=:coheadid));"); woq.bindValue(":coheadid", pId); woq.exec(); if (woq.first() && woq.value("workstarted").toBool()) question = tr("

    A work order for one of the line items on the selected " "Sales Order is already in progress. Are you sure that you " "want to completely delete the Sales Order?"); else if (ErrorReporter::error(QtCriticalMsg, parent, tr("Getting Work Order Information"), woq, __FILE__, __LINE__)) return false; if (QMessageBox::question(parent, tr("Delete Sales Order?"), question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("SELECT deleteSo(:sohead_id) AS result;"); delq.bindValue(":sohead_id", pId); delq.exec(); if (delq.first()) { bool closeInstead = false; int result = delq.value("result").toInt(); if (result == -1 && _privileges->check("ProcessCreditCards")) { if (QMessageBox::question(parent, tr("Cannot Delete Sales Order"), storedProcErrorLookup("deleteSo", result) + "
    Would you like to refund the amount " "charged and close the Sales Order instead?", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes) { CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (! cardproc) QMessageBox::critical(parent, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); else { XSqlQuery ccq; ccq.prepare("SELECT ccpay_id, ccpay_ccard_id, ccpay_curr_id," " SUM(ccpay_amount * sense) AS amount," " SUM(ccpay_r_tax * sense) AS tax," " SUM(ccpay_r_shipping * sense) AS freight," " (SELECT cohead_number" " FROM cohead" " WHERE cohead_id=:coheadid) AS docnum" " FROM (SELECT ccpay_id, ccpay_ccard_id, ccpay_curr_id," " CASE WHEN ccpay_status = 'C' THEN 1" " WHEN ccpay_status = 'R' THEN -1" " END AS sense," " ccpay_amount," " COALESCE(ccpay_r_tax::NUMERIC, 0) AS ccpay_r_tax," " COALESCE(ccpay_r_shipping::NUMERIC, 0) AS ccpay_r_shipping " " FROM ccpay, payco " " WHERE ((ccpay_id=payco_ccpay_id)" " AND (ccpay_status IN ('C', 'R'))" " AND (payco_cohead_id=:coheadid)) " " ) AS dummy " "GROUP BY ccpay_id, ccpay_ccard_id, ccpay_curr_id;"); ccq.bindValue(":coheadid", pId); ccq.exec(); if (ccq.first()) do { QString docnum = ccq.value("docnum").toString(); QString refnum = docnum; int ccpayid = ccq.value("ccpay_id").toInt(); int coheadid = pId; int returnVal = cardproc->credit(ccq.value("ccpay_ccard_id").toInt(), "-2", ccq.value("amount").toDouble(), ccq.value("tax").toDouble(), true, ccq.value("freight").toDouble(), 0, ccq.value("ccpay_curr_id").toInt(), docnum, refnum, ccpayid, "cohead", coheadid); if (returnVal < 0) { QMessageBox::critical(parent, tr("Credit Card Processing Error"), cardproc->errorMsg()); return false; } else if (returnVal > 0) { QMessageBox::warning(parent, tr("Credit Card Processing Warning"), cardproc->errorMsg()); closeInstead = true; } else if (! cardproc->errorMsg().isEmpty()) { QMessageBox::information(parent, tr("Credit Card Processing Note"), cardproc->errorMsg()); closeInstead = true; } else closeInstead = true; } while (ccq.next()); else if (ErrorReporter::error(QtCriticalMsg, parent, tr("Credit Card Processing Error"), ccq, __FILE__, __LINE__)) return false; else { ErrorReporter::error(QtCriticalMsg, parent, tr("Credit Card Processing Error"), tr("Could not find the ccpay records!"), __FILE__, __LINE__); return false; } } } } else if (result == -2 || result == -5) { if ( QMessageBox::question(parent, tr("Cannot Delete Sales Order"), storedProcErrorLookup("deleteSo", result) + "
    Would you like to Close the selected " "Sales Order instead?", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No) == QMessageBox::Yes) closeInstead = true; } else if (result == -20) QMessageBox::information(parent, "Cannot Delete Purchase Order", storedProcErrorLookup("deleteSo", result)); else if (result < 0) { systemError(parent, storedProcErrorLookup("deleteSo", result), __FILE__, __LINE__); return false; } if (closeInstead) { XSqlQuery closeq; closeq.prepare( "UPDATE coitem " "SET coitem_status='C' " "WHERE ((coitem_status <> 'X')" " AND (coitem_cohead_id=:sohead_id));" ); closeq.bindValue(":sohead_id", pId); closeq.exec(); if (ErrorReporter::error(QtCriticalMsg, parent, tr("Error Closing"), closeq, __FILE__, __LINE__)) return false; } omfgThis->sSalesOrdersUpdated(-1); omfgThis->sProjectsUpdated(-1); return true; } else if (ErrorReporter::error(QtCriticalMsg, parent, tr("Deleting Sales Order"), delq, __FILE__, __LINE__)) return false; } return false; } void salesOrder::newSalesOrder(int pCustid, QWidget *parent) { // Check for an Item window in new mode already. if (pCustid == -1) { QWidgetList list = omfgThis->windowList(); for (int i = 0; i < list.size(); i++) { QWidget *w = list.at(i); if (QString::compare(w->objectName(), "salesOrder new")==0) { w->setFocus(); if (omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } } // If none found then create one. ParameterList params; params.append("mode", "new"); if (pCustid != -1) params.append("cust_id", pCustid); salesOrder *newdlg = new salesOrder(parent); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void salesOrder::editSalesOrder( int pId, bool enableSaveAndAdd, QWidget *parent ) { // Check for an Item window in edit mode for the specified salesOrder already. QString n = QString("salesOrder edit %1").arg(pId); QWidgetList list = omfgThis->windowList(); for (int i = 0; i < list.size(); i++) { QWidget *w = list.at(i); if (QString::compare(w->objectName(), n)==0) { w->setFocus(); if (omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "edit"); params.append("sohead_id", pId); if (enableSaveAndAdd) params.append("enableSaveAndAdd"); salesOrder *newdlg = new salesOrder(parent); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void salesOrder::viewSalesOrder( int pId, QWidget *parent ) { // Check for an Item window in edit mode for the specified salesOrder already. QString n = QString("salesOrder view %1").arg(pId); QWidgetList list = omfgThis->windowList(); for (int i = 0; i < list.size(); i++) { QWidget *w = list.at(i); if (QString::compare(w->objectName(), n)==0) { w->setFocus(); if (omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "view"); params.append("sohead_id", pId); salesOrder *newdlg = new salesOrder(parent); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void salesOrder::populateCMInfo() { XSqlQuery populateSales; if (cNew != _mode && cEdit != _mode && cView != _mode) return; // Allocated C/M's populateSales.prepare("SELECT COALESCE(SUM(currToCurr(aropenalloc_curr_id, :curr_id," " aropenalloc_amount, :effective)),0) AS amount" " FROM aropenalloc, aropen" " WHERE ( (aropenalloc_doctype='S')" " AND (aropenalloc_doc_id=:doc_id)" " AND (aropenalloc_aropen_id=aropen_id) ); "); populateSales.bindValue(":doc_id", _soheadid); populateSales.bindValue(":curr_id", _allocatedCM->id()); populateSales.bindValue(":effective", _allocatedCM->effective()); populateSales.exec(); if (populateSales.first()) _allocatedCM->setLocalValue(populateSales.value("amount").toDouble()); else _allocatedCM->setLocalValue(0); // Unallocated C/M's populateSales.prepare("SELECT SUM(amount) AS f_amount" " FROM (SELECT aropen_id," " currToCurr(aropen_curr_id, :curr_id," " noNeg(aropen_amount - aropen_paid - SUM(COALESCE(aropenalloc_amount,0)))," " :effective) AS amount " " FROM cohead, aropen LEFT OUTER JOIN aropenalloc ON (aropenalloc_aropen_id=aropen_id)" " WHERE ( (aropen_cust_id=cohead_cust_id)" " AND (aropen_doctype IN ('C', 'R'))" " AND (aropen_open)" " AND (cohead_id=:cohead_id) )" " GROUP BY aropen_id, aropen_amount, aropen_paid, aropen_curr_id) AS data; "); populateSales.bindValue(":cohead_id", _soheadid); populateSales.bindValue(":curr_id", _outstandingCM->id()); populateSales.bindValue(":effective", _outstandingCM->effective()); populateSales.exec(); if (populateSales.first()) _outstandingCM->setLocalValue(populateSales.value("f_amount").toDouble()); else _outstandingCM->setLocalValue(0); } void salesOrder::populateCCInfo() { XSqlQuery populateSales; if (cNew != _mode && cEdit != _mode && cView != _mode) return; int ccValidDays = _metrics->value("CCValidDays").toInt(); if (ccValidDays < 1) ccValidDays = 7; populateSales.prepare("SELECT COALESCE(SUM(currToCurr(payco_curr_id, :curr_id," " payco_amount, :effective)),0) AS amount" " FROM ccpay, payco" " WHERE ( (ccpay_status = 'A')" " AND (date_part('day', CURRENT_TIMESTAMP - ccpay_transaction_datetime) < :ccValidDays)" " AND (payco_ccpay_id=ccpay_id)" " AND (payco_cohead_id=:cohead_id) ); "); populateSales.bindValue(":cohead_id", _soheadid); populateSales.bindValue(":ccValidDays", ccValidDays); populateSales.bindValue(":curr_id", _authCC->id()); populateSales.bindValue(":effective", _authCC->effective()); populateSales.exec(); if (populateSales.first()) _authCC->setLocalValue(populateSales.value("amount").toDouble()); else _authCC->setLocalValue(0); } void salesOrder::sNewCreditCard() { ParameterList params; params.append("mode", "new"); params.append("cust_id", _cust->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCcardList(); } void salesOrder::sEditCreditCard() { ParameterList params; params.append("mode", "edit"); params.append("cust_id", _cust->id()); params.append("ccard_id", _cc->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillCcardList(); } void salesOrder::sViewCreditCard() { ParameterList params; params.append("mode", "view"); params.append("cust_id", _cust->id()); params.append("ccard_id", _cc->id()); creditCard newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void salesOrder::sMoveUp() { XSqlQuery moveSales; moveSales.prepare("SELECT moveCcardUp(:ccard_id) AS result;"); moveSales.bindValue(":ccard_id", _cc->id()); moveSales.exec(); sFillCcardList(); } void salesOrder::sMoveDown() { XSqlQuery moveSales; moveSales.prepare("SELECT moveCcardDown(:ccard_id) AS result;"); moveSales.bindValue(":ccard_id", _cc->id()); moveSales.exec(); sFillCcardList(); } void salesOrder::sFillCcardList() { if (ISQUOTE(_mode) || (!_metrics->boolean("CCAccept") || !_privileges->check("ProcessCreditCards"))) return; XSqlQuery fillSales; fillSales.prepare( "SELECT expireCreditCard(:cust_id, setbytea(:key));"); fillSales.bindValue(":cust_id", _cust->id()); fillSales.bindValue(":key", omfgThis->_key); fillSales.exec(); MetaSQLQuery mql = mqlLoad("creditCards", "detail"); ParameterList params; params.append("cust_id", _cust->id()); params.append("masterCard", tr("MasterCard")); params.append("visa", tr("VISA")); params.append("americanExpress", tr("American Express")); params.append("discover", tr("Discover")); params.append("other", tr("Other")); params.append("key", omfgThis->_key); params.append("activeonly", true); XSqlQuery cl = mql.toQuery(params); _cc->populate(cl); if (cl.lastError().type() != QSqlError::NoError) { systemError(this, cl.lastError().databaseText(), __FILE__, __LINE__); return; } } void salesOrder::sAuthorizeCC() { if (!okToProcessCC()) return; CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (!cardproc) { QMessageBox::critical(this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); return; } if (!cardproc->errorMsg().isEmpty()) { QMessageBox::warning( this, tr("Credit Card Error"), cardproc->errorMsg() ); return; } _authorize->setEnabled(false); _charge->setEnabled(false); int ccpayid = -1; QString sonumber = _orderNumber->text(); QString ponumber = _custPONumber->text(); int returnVal = cardproc->authorize(_cc->id(), _CCCVV->text(), _CCAmount->localValue(), _tax->localValue(), (_tax->isZero() && _taxZone->id() == -1), _freight->localValue(), 0, _CCAmount->id(), sonumber, ponumber, ccpayid, QString("cohead"), _soheadid); if (returnVal < 0) QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); else if (returnVal > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (!cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); else _CCAmount->clear(); _authorize->setEnabled(true); _charge->setEnabled(true); populateCMInfo(); populateCCInfo(); sFillCcardList(); _CCCVV->clear(); } void salesOrder::sChargeCC() { if (!okToProcessCC()) return; CreditCardProcessor *cardproc = CreditCardProcessor::getProcessor(); if (!cardproc) { QMessageBox::critical(this, tr("Credit Card Processing Error"), CreditCardProcessor::errorMsg()); return; } if (!cardproc->errorMsg().isEmpty()) { QMessageBox::warning( this, tr("Credit Card Error"), cardproc->errorMsg() ); return; } _authorize->setEnabled(false); _charge->setEnabled(false); int ccpayid = -1; QString ordernum = _orderNumber->text(); QString refnum = _custPONumber->text(); int returnVal = cardproc->charge(_cc->id(), _CCCVV->text(), _CCAmount->localValue(), _tax->localValue(), (_tax->isZero() && _taxZone->id() == -1), _freight->localValue(), 0, _CCAmount->id(), ordernum, refnum, ccpayid, QString("cohead"), _soheadid); if (returnVal < 0) QMessageBox::critical(this, tr("Credit Card Processing Error"), cardproc->errorMsg()); else if (returnVal > 0) QMessageBox::warning(this, tr("Credit Card Processing Warning"), cardproc->errorMsg()); else if (!cardproc->errorMsg().isEmpty()) QMessageBox::information(this, tr("Credit Card Processing Note"), cardproc->errorMsg()); else _CCAmount->clear(); _authorize->setEnabled(true); _charge->setEnabled(true); populateCMInfo(); populateCCInfo(); sFillCcardList(); _CCCVV->clear(); } bool salesOrder::okToProcessCC() { XSqlQuery okSales; if (_usesPos) { if (_custPONumber->text().trimmed().length() == 0) { QMessageBox::warning( this, tr("Cannot Process Credit Card Transaction"), tr("

    You must enter a Customer P/O for this " "Sales Order before you may process a credit" "card transaction.") ); _custPONumber->setFocus(); return false; } if (!_blanketPos) { okSales.prepare( "SELECT cohead_id" " FROM cohead" " WHERE ((cohead_cust_id=:cohead_cust_id)" " AND (cohead_id<>:cohead_id)" " AND (UPPER(cohead_custponumber) = UPPER(:cohead_custponumber)) )" " UNION " "SELECT quhead_id" " FROM quhead" " WHERE ((quhead_cust_id=:cohead_cust_id)" " AND (quhead_id<>:cohead_id)" " AND (UPPER(quhead_custponumber) = UPPER(:cohead_custponumber)) );" ); okSales.bindValue(":cohead_cust_id", _cust->id()); okSales.bindValue(":cohead_id", _soheadid); okSales.bindValue(":cohead_custponumber", _custPONumber->text()); okSales.exec(); if (okSales.first()) { QMessageBox::warning( this, tr("Cannot Process Credit Card Transaction"), tr("

    This Customer does not use Blanket P/O " "Numbers and the P/O Number you entered has " "already been used for another Sales Order. " "Please verify the P/O Number and either " "enter a new P/O Number or add to the " "existing Sales Order." ) ); _custPONumber->setFocus(); return false; } } } return true; } void salesOrder::sReturnStock() { XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery returnSales; returnSales.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations returnSales.prepare("SELECT returnItemShipments(:soitem_id) AS result;"); QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { returnSales.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); returnSales.exec(); if (returnSales.first()) { int result = returnSales.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("returnItemShipments", result) + tr("
    Line Item %1").arg(selected[i]->text(0)), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(returnSales.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Return Stock"), tr("Transaction Canceled") ); return; } } else if (returnSales.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("Line Item %1\n").arg(selected[i]->text(0)) + returnSales.lastError().databaseText(), __FILE__, __LINE__); return; } } returnSales.exec("COMMIT;"); sFillItemList(); } void salesOrder::sIssueStock() { bool update = FALSE; QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem *soitem = (XTreeWidgetItem *)(selected[i]); if (soitem->altId() != 1 && soitem->altId() != 4) { ParameterList params; params.append("soitem_id", soitem->id()); if (_requireInventory->isChecked()) params.append("requireInventory"); issueLineToShipping newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) update = TRUE; } } if (update) sFillItemList(); } void salesOrder::sIssueLineBalance() { XSqlQuery issueSales; bool job = false; QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem *soitem = (XTreeWidgetItem *)(selected[i]); if (soitem->altId() != 1 && soitem->altId() != 4) { // sufficientInventoryToShipItem assumes line balance if qty not passed issueSales.prepare("SELECT itemsite_id, item_number, warehous_code, itemsite_costmethod, " " sufficientInventoryToShipItem('SO', coitem_id) AS isqtyavail " " FROM coitem JOIN itemsite ON (itemsite_id=coitem_itemsite_id)" " JOIN item ON (item_id=itemsite_item_id)" " JOIN whsinfo ON (warehous_id=itemsite_warehous_id) " " WHERE (coitem_id=:soitem_id); "); issueSales.bindValue(":soitem_id", soitem->id()); issueSales.exec(); if (issueSales.lastError().type() != QSqlError::NoError) { systemError(this, issueSales.lastError().databaseText(), __FILE__, __LINE__); return; } while (issueSales.next()) { if (issueSales.value("itemsite_costmethod").toString() == "J") job = true; if (_requireInventory->isChecked() && issueSales.value("isqtyavail").toInt() < 0 && issueSales.value("itemsite_costmethod").toString() != "J") { QMessageBox::critical(this, tr("Insufficient Inventory"), tr("

    There is not enough Inventory to issue the amount required" " of Item %1 in Site %2.") .arg(issueSales.value("item_number").toString()) .arg(issueSales.value("warehous_code").toString()) ); return; } } issueSales.prepare("SELECT itemsite_id, itemsite_costmethod, item_number, warehous_code, " " sufficientInventoryToShipItem('SO', coitem_id) AS isqtyavail " " FROM coitem JOIN itemsite ON (itemsite_id=coitem_itemsite_id)" " JOIN item ON (item_id=itemsite_item_id)" " JOIN whsinfo ON (warehous_id=itemsite_warehous_id) " " WHERE ((coitem_id=:soitem_id) " " AND (NOT ((item_type = 'R') OR (itemsite_controlmethod = 'N'))) " " AND ((itemsite_controlmethod IN ('L', 'S')) OR (itemsite_loccntrl)));"); issueSales.bindValue(":soitem_id", soitem->id()); issueSales.exec(); if (issueSales.lastError().type() != QSqlError::NoError) { systemError(this, issueSales.lastError().databaseText(), __FILE__, __LINE__); return; } while (issueSales.next()) { if (issueSales.value("isqtyavail").toInt() < 0 && issueSales.value("itemsite_costmethod").toString() != "J") { QMessageBox::critical(this, tr("Insufficient Inventory"), tr("

    Item Number %1 in Site %2 is a Multiple Location or " "Lot/Serial controlled Item which is short on Inventory. " "This transaction cannot be completed as is. Please make " "sure there is sufficient Quantity on Hand before proceeding.") .arg(issueSales.value("item_number").toString()) .arg(issueSales.value("warehous_code").toString())); return; } } int invhistid = 0; int itemlocSeries = 0; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); issueSales.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations // If this is a lot/serial controlled job item, we need to post production first if (job) { XSqlQuery prod; prod.prepare("SELECT postSoItemProduction(:soitem_id, now()) AS result;"); prod.bindValue(":soitem_id", _soitem->id()); prod.exec(); if (prod.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, prod.lastError().databaseText(), __FILE__, __LINE__); return; } if (prod.first()) { itemlocSeries = prod.value("result").toInt(); if (itemlocSeries < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postProduction", itemlocSeries), __FILE__, __LINE__); return; } else if (distributeInventory::SeriesAdjust(itemlocSeries, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Issue Canceled") ); return; } // Need to get the inventory history id so we can auto reverse the distribution when issuing prod.prepare("SELECT invhist_id " "FROM invhist " "WHERE ((invhist_series = :itemlocseries) " " AND (invhist_transtype = 'RM')); "); prod.bindValue(":itemlocseries", itemlocSeries); prod.exec(); if (prod.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, prod.lastError().databaseText(), __FILE__, __LINE__); return; } if (prod.first()) invhistid = prod.value("invhist_id").toInt(); else { rollback.exec(); systemError(this, tr("Inventory history not found"), __FILE__, __LINE__); return; } } } issueSales.prepare("SELECT issueLineBalanceToShipping('SO', :soitem_id, now(), :itemlocseries, :invhist_id) AS result;"); ; issueSales.bindValue(":soitem_id", soitem->id()); if (invhistid) issueSales.bindValue(":invhist_id", invhistid); if (itemlocSeries) issueSales.bindValue(":itemlocseries", itemlocSeries); issueSales.exec(); if (issueSales.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, issueSales.lastError().databaseText(), __FILE__, __LINE__); return; } if (issueSales.first()) { int result = issueSales.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("issueLineBalanceToShipping", result) + tr("
    Line Item %1").arg(selected[i]->text(0)), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(issueSales.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Transaction Canceled") ); return; } issueSales.exec("COMMIT;"); } else { rollback.exec(); systemError(this, tr("Line Item %1\n").arg(selected[i]->text(0)) + issueSales.lastError().databaseText(), __FILE__, __LINE__); return; } } } sFillItemList(); } void salesOrder::sFreightChanged() { if (_freight->localValue() == _freightCache) return; if (_freight->isEnabled()) { if (_calcfreight) { int answer; answer = QMessageBox::question(this, tr("Manual Freight?"), tr("

    Manually editing the freight will disable " "automatic Freight recalculations. Are you " "sure you want to do this?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::Yes) _calcfreight = false; else { disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(_freightCache); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } } else if ( (!_calcfreight) && (_freight->localValue() == 0) && (_metrics->boolean("CalculateFreight"))) { int answer; answer = QMessageBox::question(this, tr("Automatic Freight?"), tr("

    Manually clearing the freight will enable " "automatic Freight recalculations. Are you " "sure you want to do this?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (answer == QMessageBox::Yes) { _calcfreight = true; disconnect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); _freight->setLocalValue(_freightCache); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); } } else _freightCache = _freight->localValue(); } sCalculateTax(); } void salesOrder::sCalculateTax() { XSqlQuery taxq; taxq.prepare( "SELECT SUM(tax) AS tax " "FROM (" "SELECT ROUND(SUM(taxdetail_tax),2) AS tax " "FROM tax " " JOIN calculateTaxDetailSummary(:type, :cohead_id, 'T') ON (taxdetail_tax_id=tax_id)" "GROUP BY tax_id) AS data;" ); taxq.bindValue(":cohead_id", _soheadid); if (ISQUOTE(_mode)) taxq.bindValue(":type","Q"); else taxq.bindValue(":type","S"); taxq.exec(); if (taxq.first()) _tax->setLocalValue(taxq.value("tax").toDouble()); else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } sCalculateTotal(); } void salesOrder::sTaxZoneChanged() { if (_taxZone->id() != _taxzoneidCache && _saved) save(true); sCalculateTax(); _taxzoneidCache=_taxZone->id(); } void salesOrder::sReserveStock() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); reserveSalesOrderItem newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } sFillItemList(); } void salesOrder::sReserveLineBalance() { XSqlQuery reserveSales; reserveSales.prepare("SELECT reserveSoLineBalance(:soitem_id) AS result;"); QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { reserveSales.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); reserveSales.exec(); if (reserveSales.first()) { int result = reserveSales.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("reserveSoLineBalance", result) + tr("
    Line Item %1").arg(selected[i]->text(0)), __FILE__, __LINE__); return; } } else if (reserveSales.lastError().type() != QSqlError::NoError) { systemError(this, tr("Line Item %1\n").arg(selected[i]->text(0)) + reserveSales.lastError().databaseText(), __FILE__, __LINE__); return; } } sFillItemList(); } void salesOrder::sUnreserveStock() { XSqlQuery unreserveSales; unreserveSales.prepare("SELECT unreserveSoLineQty(:soitem_id) AS result;"); QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { unreserveSales.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); unreserveSales.exec(); if (unreserveSales.first()) { int result = unreserveSales.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("unreservedSoLineQty", result) + tr("
    Line Item %1").arg(selected[i]->text(0)), __FILE__, __LINE__); return; } } else if (unreserveSales.lastError().type() != QSqlError::NoError) { systemError(this, tr("Line Item %1\n").arg(selected[i]->text(0)) + unreserveSales.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrder::sShowReservations() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); params.append("run"); dspReservations *newdlg = new dspReservations(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void salesOrder::sEnterCashPayment() { XSqlQuery cashsave; if (_received->localValue() > _balance->localValue() && QMessageBox::question(this, tr("Overapplied?"), tr("The Cash Payment is more than the Balance. Do you want to continue?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; int _bankaccnt_curr_id = -1; QString _bankaccnt_currAbbr; cashsave.prepare( "SELECT bankaccnt_curr_id, " " currConcat(bankaccnt_curr_id) AS currAbbr " " FROM bankaccnt " " WHERE (bankaccnt_id=:bankaccnt_id);"); cashsave.bindValue(":bankaccnt_id", _bankaccnt->id()); cashsave.exec(); if (cashsave.first()) { _bankaccnt_curr_id = cashsave.value("bankaccnt_curr_id").toInt(); _bankaccnt_currAbbr = cashsave.value("currAbbr").toString(); } else if (cashsave.lastError().type() != QSqlError::NoError) { systemError(this, cashsave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_received->currencyEnabled() && _received->id() != _bankaccnt_curr_id && QMessageBox::question(this, tr("Bank Currency?"), tr("

    This Sales Order is specified in %1 while the " "Bank Account is specified in %2. Do you wish to " "convert at the current Exchange Rate?" "

    If not, click NO " "and change the Bank Account in the POST TO field.") .arg(_received->currAbbr()) .arg(_bankaccnt_currAbbr), QMessageBox::Yes|QMessageBox::Escape, QMessageBox::No |QMessageBox::Default) != QMessageBox::Yes) { _bankaccnt->setFocus(); return; } QString _cashrcptnumber; int _cashrcptid; cashsave.exec("SELECT fetchCashRcptNumber() AS number, NEXTVAL('cashrcpt_cashrcpt_id_seq') AS cashrcpt_id;"); if (cashsave.first()) { _cashrcptnumber = cashsave.value("number").toString(); _cashrcptid = cashsave.value("cashrcpt_id").toInt(); } else if (cashsave.lastError().type() != QSqlError::NoError) { systemError(this, cashsave.lastError().databaseText(), __FILE__, __LINE__); return; } cashsave.prepare( "INSERT INTO cashrcpt " "( cashrcpt_id, cashrcpt_cust_id, cashrcpt_distdate, cashrcpt_amount," " cashrcpt_fundstype, cashrcpt_bankaccnt_id, cashrcpt_curr_id, " " cashrcpt_usecustdeposit, cashrcpt_docnumber, cashrcpt_docdate, " " cashrcpt_notes, cashrcpt_salescat_id, cashrcpt_number, cashrcpt_applydate, cashrcpt_discount ) " "VALUES " "( :cashrcpt_id, :cashrcpt_cust_id, :cashrcpt_distdate, :cashrcpt_amount," " :cashrcpt_fundstype, :cashrcpt_bankaccnt_id, :cashrcpt_curr_id, " " :cashrcpt_usecustdeposit, :cashrcpt_docnumber, :cashrcpt_docdate, " " :cashrcpt_notes, :cashrcpt_salescat_id, :cashrcpt_number, :cashrcpt_applydate, :cashrcpt_discount );" ); cashsave.bindValue(":cashrcpt_id", _cashrcptid); cashsave.bindValue(":cashrcpt_number", _cashrcptnumber); cashsave.bindValue(":cashrcpt_cust_id", _cust->id()); cashsave.bindValue(":cashrcpt_amount", _received->localValue()); cashsave.bindValue(":cashrcpt_fundstype", _fundsType->code()); cashsave.bindValue(":cashrcpt_docnumber", _docNumber->text()); cashsave.bindValue(":cashrcpt_docdate", _docDate->date()); cashsave.bindValue(":cashrcpt_bankaccnt_id", _bankaccnt->id()); cashsave.bindValue(":cashrcpt_distdate", _distDate->date()); cashsave.bindValue(":cashrcpt_applydate", _applDate->date()); cashsave.bindValue(":cashrcpt_notes", "Sales Order Cash Payment"); cashsave.bindValue(":cashrcpt_usecustdeposit", true); cashsave.bindValue(":cashrcpt_discount", 0.0); cashsave.bindValue(":cashrcpt_curr_id", _received->id()); if(_altAccnt->isChecked()) cashsave.bindValue(":cashrcpt_salescat_id", _salescat->id()); else cashsave.bindValue(":cashrcpt_salescat_id", -1); cashsave.exec(); if (cashsave.lastError().type() != QSqlError::NoError) { systemError(this, cashsave.lastError().databaseText(), __FILE__, __LINE__); return; } // Post the Cash Receipt XSqlQuery cashPost; int journalNumber = -1; cashPost.exec("SELECT fetchJournalNumber('C/R') AS journalnumber;"); if (cashPost.first()) journalNumber = cashPost.value("journalnumber").toInt(); else if (cashPost.lastError().type() != QSqlError::NoError) { systemError(this, cashPost.lastError().databaseText(), __FILE__, __LINE__); return; } cashPost.prepare("SELECT postCashReceipt(:cashrcpt_id, :journalNumber) AS result;"); cashPost.bindValue(":cashrcpt_id", _cashrcptid); cashPost.bindValue(":journalNumber", journalNumber); cashPost.exec(); if (cashPost.first()) { int result = cashPost.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postCashReceipt", result), __FILE__, __LINE__); return; } } else if (cashPost.lastError().type() != QSqlError::NoError) { systemError(this, cashPost.lastError().databaseText(), __FILE__, __LINE__); return; } // Find the Customer Deposit C/M and Allocate cashPost.prepare("SELECT cashrcptitem_aropen_id FROM cashrcptitem WHERE cashrcptitem_cashrcpt_id=:cashrcpt_id;"); cashPost.bindValue(":cashrcpt_id", _cashrcptid); cashPost.exec(); if (cashPost.first()) { int aropenid = cashPost.value("cashrcptitem_aropen_id").toInt(); cashPost.prepare("INSERT INTO aropenalloc" " (aropenalloc_aropen_id, aropenalloc_doctype, aropenalloc_doc_id, " " aropenalloc_amount, aropenalloc_curr_id)" "VALUES(:aropen_id, 'S', :doc_id, :amount, :curr_id);"); cashPost.bindValue(":doc_id", _soheadid); cashPost.bindValue(":aropen_id", aropenid); if (_received->localValue() > _balance->localValue()) cashPost.bindValue(":amount", _balance->localValue()); else cashPost.bindValue(":amount", _received->localValue()); cashPost.bindValue(":curr_id", _received->id()); cashPost.exec(); if (cashPost.lastError().type() != QSqlError::NoError) { systemError(this, cashPost.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (cashPost.lastError().type() != QSqlError::NoError) { systemError(this, cashPost.lastError().databaseText(), __FILE__, __LINE__); return; } _received->clear(); populateCMInfo(); } void salesOrder::sCreditAllocate() { ParameterList params; params.append("doctype", "S"); params.append("cohead_id", _soheadid); params.append("cust_id", _cust->id()); params.append("total", _total->localValue()); params.append("balance", _balance->localValue()); params.append("curr_id", _balance->id()); params.append("effective", _balance->effective()); allocateARCreditMemo newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() == XDialog::Accepted) { populateCMInfo(); } } void salesOrder::sAllocateCreditMemos() { XSqlQuery allocateSales; // Determine the balance I need to select // This is the same as in sCalculateTotal except that the Unallocated amount is not included. double balance = (_subtotal->localValue() + _tax->localValue() + _miscCharge->localValue() + _freight->localValue())- _allocatedCM->localValue() - _authCC->localValue(); double initBalance = balance; if (balance > 0) { // Get the list of Unallocated CM's with amount allocateSales.prepare("SELECT aropen_id," " noNeg(aropen_amount - aropen_paid - SUM(COALESCE(aropenalloc_amount,0))) AS amount," " currToCurr(aropen_curr_id, :curr_id," " noNeg(aropen_amount - aropen_paid - SUM(COALESCE(aropenalloc_amount,0))), :effective) AS amount_cocurr" " FROM cohead, aropen LEFT OUTER JOIN aropenalloc ON (aropenalloc_aropen_id=aropen_id)" " WHERE ( (aropen_cust_id=cohead_cust_id)" " AND (aropen_doctype IN ('C', 'R'))" " AND (aropen_open)" " AND (cohead_id=:cohead_id) )" " GROUP BY aropen_id, aropen_duedate, aropen_amount, aropen_paid, aropen_curr_id " "HAVING (noNeg(aropen_amount - aropen_paid - SUM(COALESCE(aropenalloc_amount,0))) > 0)" " ORDER BY aropen_duedate; "); allocateSales.bindValue(":cohead_id", _soheadid); allocateSales.bindValue(":curr_id", _balance->id()); allocateSales.bindValue(":effective", _balance->effective()); allocateSales.exec(); if (allocateSales.lastError().type() != QSqlError::NoError) { systemError(this, allocateSales.lastError().databaseText(), __FILE__, __LINE__); return; } double amount = 0.0; double initAmount = 0.0; XSqlQuery allocCM; allocCM.prepare("INSERT INTO aropenalloc" " (aropenalloc_aropen_id, aropenalloc_doctype, aropenalloc_doc_id, " " aropenalloc_amount, aropenalloc_curr_id)" "VALUES(:aropen_id, 'S', :doc_id, :amount, :curr_id);"); while (balance > 0.0 && allocateSales.next()) { amount = allocateSales.value("amount").toDouble(); initAmount = _outstandingCM->localValue(); if (amount <= 0.0) // if this credit memo does not have a positive value just ignore it continue; if (amount > balance) // make sure we don't apply more to a credit memo than we have left. amount = balance; // apply credit memo's to this sales order until the balance is 0. allocCM.bindValue(":doc_id", _soheadid); allocCM.bindValue(":aropen_id", allocateSales.value("aropen_id").toInt()); allocCM.bindValue(":amount", amount); allocCM.bindValue(":curr_id", _balance->id()); allocCM.exec(); if (allocCM.lastError().type() == QSqlError::NoError) balance -= amount; else systemError(this, allocCM.lastError().databaseText(), __FILE__, __LINE__); } _outstandingCM->setLocalValue(initAmount-(initBalance-balance)); _balance->setLocalValue(initBalance-(initBalance-balance)); _allocatedCM->setLocalValue(initBalance-balance); } } void salesOrder::sCheckValidContacts() { if (_shipToCntct->isValid()) _shipToCntct->setEnabled(true); else _shipToCntct->setEnabled(false); if (_billToCntct->isValid()) _billToCntct->setEnabled(true); else _billToCntct->setEnabled(false); } void salesOrder::sHandleMore() { _warehouse->setVisible(_more->isChecked()); _shippingWhseLit->setVisible(_more->isChecked()); _commissionLit->setVisible(_more->isChecked()); _commission->setVisible(_more->isChecked()); _commissionPrcntLit->setVisible(_more->isChecked()); _taxZoneLit->setVisible(_more->isChecked()); _taxZone->setVisible(_more->isChecked()); _shipDateLit->setVisible(_more->isChecked()); _shipDate->setVisible(_more->isChecked()); _packDateLit->setVisible(_more->isChecked()); _packDate->setVisible(_more->isChecked()); _saleTypeLit->setVisible(_more->isChecked()); _saleType->setVisible(_more->isChecked()); if (ISORDER(_mode)) { _shippingCharges->setVisible(_more->isChecked()); _shippingChargesLit->setVisible(_more->isChecked()); _shippingForm->setVisible(_more->isChecked()); _shippingFormLit->setVisible(_more->isChecked()); } else { _expireLit->setVisible(_more->isChecked()); _expire->setVisible(_more->isChecked()); } } void salesOrder::sRecalculatePrice() { if (QMessageBox::question(this, tr("Update all prices?"), tr("Do you want to recalculate all prices for the order including:\n\t- Line items\n\t - Taxes\n\t - Freight ?"), QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { ParameterList params; QString sql; QString sqlchk; if (ISORDER(_mode)) { sql ="UPDATE coitem SET coitem_price=itemprice(item_id, " "cohead_cust_id, , coitem_qtyord, " "coitem_qty_uom_id, coitem_price_uom_id, " "cohead_curr_id,cohead_orderdate, " "" " coitem_scheddate " " " "" " " "), " "coitem_custprice=itemprice(item_id, cohead_cust_id, " ",coitem_qtyord, coitem_qty_uom_id, " "coitem_price_uom_id, cohead_curr_id, cohead_orderdate, " "" " coitem_scheddate " " " "" " " ") " "FROM cohead, item, itemsite " "WHERE ( (coitem_status NOT IN ('C','X')) " "AND (coitem_subnumber=0) " "AND (NOT coitem_firm) " "" "AND (coitem_price = coitem_custprice) " "" "AND (itemsite_id=coitem_itemsite_id) " "AND (itemsite_item_id=item_id) " "AND (coitem_cohead_id=cohead_id) " "AND (cohead_id=) );"; sqlchk ="SELECT MIN(itemprice(item_id, cohead_cust_id, " " , coitem_qtyord, " " coitem_qty_uom_id, coitem_price_uom_id, " " cohead_curr_id,cohead_orderdate, " " coitem_scheddate " " " " )) AS pricechk " "FROM cohead, coitem, item, itemsite " "WHERE ( (coitem_cohead_id=cohead_id) " " AND (coitem_status NOT IN ('C','X')) " " AND (coitem_subnumber=0) " " AND (NOT coitem_firm) " "" " AND (coitem_price = coitem_custprice) " "" " AND (itemsite_id=coitem_itemsite_id) " " AND (itemsite_item_id=item_id) " " AND (coitem_cohead_id=cohead_id) " " AND (cohead_id=) );"; } else { sql = "UPDATE quitem SET quitem_price=itemprice(item_id, " "quhead_cust_id, , quitem_qtyord, " "quitem_qty_uom_id, quitem_price_uom_id, " "quhead_curr_id,quhead_quotedate, " "" " quitem_scheddate " " " "" " " "), " "quitem_custprice=itemprice(item_id, quhead_cust_id, " ",quitem_qtyord, quitem_qty_uom_id, " "quitem_price_uom_id, quhead_curr_id, quhead_quotedate, " "" " quitem_scheddate " " " "" " " ") " "FROM quhead, item, itemsite " "WHERE ( (itemsite_id=quitem_itemsite_id) " "" "AND (quitem_price = quitem_custprice) " "" "AND (itemsite_item_id=item_id) " "AND (quitem_quhead_id=quhead_id) " "AND (quhead_id=) );"; sqlchk ="SELECT MIN(itemprice(item_id, quhead_cust_id, " " , quitem_qtyord, " " quitem_qty_uom_id, quitem_price_uom_id, " " quhead_curr_id,quhead_quotedate, " " quitem_scheddate " " " " )) AS pricechk " "FROM quhead, quitem, item, itemsite " "WHERE ( (quitem_quhead_id=quhead_id) " " AND (itemsite_id=quitem_itemsite_id) " "" " AND (quitem_price = quitem_custprice) " "" " AND (itemsite_item_id=item_id) " " AND (quitem_quhead_id=quhead_id) " " AND (quhead_id=) );"; } params.append("cohead_id", _soheadid); params.append("shipto_id", _shipTo->id()); if (_metrics->boolean("IgnoreCustDisc")) params.append("ignoreDiscounts", true); if (_metrics->value("soPriceEffective") == "ScheduleDate") params.append("UseSchedDate", true); MetaSQLQuery mql(sql); MetaSQLQuery mqlchk(sqlchk); if (_metrics->value("soPriceEffective") == "OrderDate") { if (!_orderDate->isValid()) { QMessageBox::critical(this,tr("Order Date Required"),tr("Prices can not be recalculated without a valid Order Date.")); _orderDate->setFocus(); return; } params.append("asOf", _orderDate->date()); } else if (_metrics->value("soPriceEffective") == "ScheduleDate") { if (!_orderDate->isValid()) { QMessageBox::critical(this,tr("Schedule Date Required"),tr("Prices can not be recalculated without a valid Schedule Date.")); _shipDate->setFocus(); return; } params.append("asOf", _shipDate->date()); } else params.append("asOf", omfgThis->dbDate()); XSqlQuery itempricechk = mqlchk.toQuery(params); if (itempricechk.first()) { if (itempricechk.value("pricechk").toDouble() == -9999.0) { // User expected an update, so let them know and reset QMessageBox::critical(this, tr("Customer Cannot Buy at Quantity"), tr("

    One or more items are marked as exclusive and " "no qualifying price schedule was found. " ) ); return; } } else if (itempricechk.lastError().type() != QSqlError::NoError) { systemError(this, itempricechk.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery setitemprice = mql.toQuery(params); if (setitemprice.lastError().type() != QSqlError::NoError) { systemError(this, setitemprice.lastError().databaseText(), __FILE__, __LINE__); return; } _calcfreight = _metrics->boolean("CalculateFreight"); sFillItemList(); } } void salesOrder::sOrderDateChanged() { if (_orderDate->date() == _orderDateCache || !_orderDate->isValid()) return; else if (!_soitem->topLevelItemCount() || !_orderDateCache.isValid() || _metrics->value("soPriceEffective") != "OrderDate") { _orderDateCache = _orderDate->date(); return; } sRecalculatePrice(); _orderDateCache = _orderDate->date(); sFillItemList(); omfgThis->sSalesOrdersUpdated(_soheadid); } void salesOrder::sShipDateChanged() { XSqlQuery salesShipDateChanged; if (_shipDate->date() == _shipDateCache || !_shipDate->isValid()) return; else if (!_soitem->topLevelItemCount()) { _shipDateCache = _shipDate->date(); return; } QString sql; XSqlQuery upd; ParameterList params; params.append("cohead_id", _soheadid); params.append("newDate", _shipDate->date()); params.append("ignoreCustDisc", _metrics->value("IgnoreCustDisc")); if (QMessageBox::question(this, tr("Update all schedule dates?"), tr("Changing this date will update the Schedule Date on all editable line items. " "Is this what you want to do?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { // Validate first if (ISORDER(_mode)) { sql = "SELECT DISTINCT valid FROM ( " " SELECT customerCanPurchase(itemsite_item_id, cohead_cust_id, " " cohead_shipto_id, ) AS valid " " FROM cohead " " JOIN coitem ON (cohead_id=coitem_cohead_id) " " JOIN itemsite ON (coitem_itemsite_id=itemsite_id) " " WHERE ( (cohead_id=) " " AND (coitem_status NOT IN ('C','X')) " " AND (coitem_subnumber = 0))" ") data " "ORDER BY valid; "; } else { sql = "SELECT DISTINCT valid FROM ( " " SELECT customerCanPurchase(itemsite_item_id, quhead_cust_id, " " quhead_shipto_id, ) AS valid " " FROM quhead " " JOIN quitem ON (quhead_id=quitem_quhead_id) " " JOIN itemsite ON (quitem_itemsite_id=itemsite_id) " " WHERE (quhead_id=) " ") data " "ORDER BY valid; "; } MetaSQLQuery vmql(sql); upd = vmql.toQuery(params); if (upd.first()) { if (upd.size() == 2) // Both valid and invalid records { if (QMessageBox::warning(this, tr("Can not reschedule all Items"), tr("Some exclusive items may not be rescheduled because there is no " "valid price schedule for the date entered. Proceed rescheduling " "only qualifying items?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::No) { _shipDate->setDate(_shipDateCache); return; } } else if (!upd.value("valid").toBool()) // No valid items { QMessageBox::warning(this, tr("Can not reschedule Items"), tr("No Items can be rescheduled because there are no " "valid price schedules for the date entered.")); _shipDate->setDate(_shipDateCache); return; } } else if (upd.lastError().type() != QSqlError::NoError) { systemError(this, salesShipDateChanged.lastError().databaseText(), __FILE__, __LINE__); _shipDate->setDate(_shipDateCache); return; } // Now execute if (ISORDER(_mode)) { sql = "UPDATE coitem SET coitem_scheddate = " "FROM cohead,item,itemsite " "WHERE ( (coitem_status NOT IN ('C','X'))" " AND (NOT coitem_firm)" " AND (itemsite_id=coitem_itemsite_id) " " AND (itemsite_item_id=item_id) " " AND (cohead_id=) " " AND (coitem_cohead_id=cohead_id) " " AND (customerCanPurchase(itemsite_item_id, cohead_cust_id, cohead_shipto_id, ) ) );"; // Ask about work orders if applicable XSqlQuery wo; QString woSql("SELECT wo_id " "FROM wo " " JOIN coitem ON (coitem_order_id=wo_id) AND (coitem_order_type='W') " " JOIN cohead ON (cohead_id=coitem_cohead_id) " " JOIN itemsite ON (coitem_itemsite_id=itemsite_id) " "WHERE ((cohead_id=) " " AND (coitem_status NOT IN ('C','X')) " " AND (NOT coitem_firm)" " AND (wo_status<>'C')" " AND (customerCanPurchase(itemsite_item_id, cohead_cust_id, cohead_shipto_id, ) ) );"); MetaSQLQuery woMql(woSql); wo = woMql.toQuery(params); if(wo.first()) { if (QMessageBox::question(this, tr("Reschedule Work Order?"), tr("

    Should any associated work orders " "be rescheduled to reflect this change?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { sql = sql + "SELECT changeWoDates(wo_id, " " wo_startdate + ( - wo_duedate)," " , TRUE) AS result " "FROM cohead JOIN coitem ON (coitem_cohead_id=cohead_id AND coitem_order_type='W') " " JOIN wo ON (wo_id=coitem_order_id) " " JOIN itemsite ON (itemsite_id=coitem_itemsite_id) " "WHERE ( (coitem_status NOT IN ('C','X'))" " AND (NOT coitem_firm)" " AND (wo_status <> 'C') " " AND (cohead_id=)" " AND (customerCanPurchase(itemsite_item_id, cohead_cust_id, cohead_shipto_id, ) ) )"; } } } else { sql = "UPDATE quitem SET quitem_scheddate = " "FROM quhead,item,itemsite " "WHERE ( (itemsite_id=quitem_itemsite_id) " " AND (itemsite_item_id=item_id) " " AND (quhead_id=) " " AND (quitem_quhead_id=quhead_id) " " AND (customerCanPurchase(itemsite_item_id, quhead_cust_id, quhead_shipto_id, ) ) );"; } MetaSQLQuery mql(sql); upd = mql.toQuery(params); if (upd.lastError().type() != QSqlError::NoError) { systemError(this, upd.lastError().databaseText(), __FILE__, __LINE__); _shipDate->setDate(_shipDateCache); return; } } else { _shipDate->setDate(_shipDateCache); return; } if (_metrics->value("soPriceEffective") == "ScheduleDate") sRecalculatePrice(); _shipDateCache = _shipDate->date(); sFillItemList(); omfgThis->sSalesOrdersUpdated(_soheadid); } void salesOrder::sViewWO() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XSqlQuery wo; wo.prepare("SELECT coitem_order_id FROM coitem WHERE (coitem_id=:soitem_id);"); wo.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); wo.exec(); if (wo.first()) { ParameterList params; params.append("wo_id", wo.value("coitem_order_id").toInt()); params.append("mode", "view"); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (wo.lastError().type() != QSqlError::NoError) { systemError(this, wo.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrder::sMaintainWO() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XSqlQuery wo; wo.prepare("SELECT coitem_order_id FROM coitem WHERE (coitem_id=:soitem_id);"); wo.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); wo.exec(); if (wo.first()) { ParameterList params; params.append("wo_id", wo.value("coitem_order_id").toInt()); params.append("mode", "edit"); workOrder *newdlg = new workOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (wo.lastError().type() != QSqlError::NoError) { systemError(this, wo.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrder::sViewPO() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XSqlQuery po; po.prepare("SELECT poitem_pohead_id " "FROM coitem JOIN poitem ON (coitem_order_id = poitem_id) " "WHERE (coitem_id=:soitem_id);"); po.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); po.exec(); if (po.first()) { ParameterList params; params.append("pohead_id", po.value("poitem_pohead_id").toInt()); params.append("mode", "view"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (po.lastError().type() != QSqlError::NoError) { systemError(this, po.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrder::sMaintainPO() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XSqlQuery po; po.prepare("SELECT poitem_pohead_id " "FROM coitem JOIN poitem ON (coitem_order_id = poitem_id) " "WHERE (coitem_id=:soitem_id);"); po.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); po.exec(); if (po.first()) { ParameterList params; params.append("pohead_id", po.value("poitem_pohead_id").toInt()); params.append("mode", "edit"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (po.lastError().type() != QSqlError::NoError) { systemError(this, po.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrder::sReleasePR() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XSqlQuery pr; pr.prepare("SELECT coitem_order_id FROM coitem WHERE (coitem_id=:soitem_id);"); pr.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); pr.exec(); if (pr.first()) { ParameterList params; params.append("mode", "releasePr"); params.append("pr_id", pr.value("coitem_order_id").toInt()); purchaseOrder *newdlg = new purchaseOrder(); if (newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else delete newdlg; } else if (pr.lastError().type() != QSqlError::NoError) { systemError(this, pr.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrder::sViewPR() { QList selected = _soitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XSqlQuery pr; pr.prepare("SELECT pr_itemsite_id, pr_qtyreq, pr_duedate, pr_order_id, coitem_order_id " "FROM pr JOIN coitem ON (pr_id = coitem_order_id) " "WHERE (coitem_id=:soitem_id);"); pr.bindValue(":soitem_id", ((XTreeWidgetItem *)(selected[i]))->id()); pr.exec(); if (pr.first()) { ParameterList params; params.append("mode", "view"); params.append("pr_id", pr.value("coitem_order_id").toInt()); purchaseRequest *newdlg = new purchaseRequest(); if (newdlg->set(params) == NoError) omfgThis->handleNewWindow(newdlg); else delete newdlg; } else if (pr.lastError().type() != QSqlError::NoError) { systemError(this, pr.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/salesOrder.h000066400000000000000000000117571217451700100176640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESORDER_H #define SALESORDER_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_salesOrder.h" class salesOrder : public XWidget, public Ui::salesOrder { Q_OBJECT public: salesOrder(QWidget *parent = 0, const char *name = 0, Qt::WFlags fl = Qt::Window); ~salesOrder(); Q_INVOKABLE virtual bool save( bool partial ); Q_INVOKABLE virtual void setViewMode(); Q_INVOKABLE static bool deleteSalesOrder(int pId, QWidget *parent = 0 ); Q_INVOKABLE static void newSalesOrder( int pCustid, QWidget *parent = 0 ); Q_INVOKABLE static void editSalesOrder( int pId, bool enableSaveAndAdd, QWidget *parent = 0 ); Q_INVOKABLE static void viewSalesOrder( int pId, QWidget *parent = 0 ); Q_INVOKABLE virtual int id() { return _soheadid; } Q_INVOKABLE virtual int modeType() const; Q_INVOKABLE virtual int modeState() const; public slots: virtual SetResponse set(const ParameterList &pParams ); virtual void sSave(); virtual void sSaveAndAdd(); virtual void sPopulateMenu(QMenu *pMenu); virtual void populateOrderNumber(); virtual void sSetUserEnteredOrderNumber(); virtual void sHandleOrderNumber(); virtual void sPopulateFOB( int pWarehousid ); virtual void sPopulateCustomerInfo( int pCustid ); virtual void sParseShipToNumber(); virtual void populateShipto( int pShiptoid ); virtual void sConvertShipTo(); virtual void sNew(); virtual void sCopyToShipto(); virtual void sEdit(); virtual void sHandleButtons(); virtual void sFirm(); virtual void sSoften(); virtual void sAction(); virtual void sDelete(); virtual void populate(); virtual void sFillItemList(); virtual void sCalculateTotal(); virtual void sClear(); virtual void clear(); virtual void closeEvent( QCloseEvent *pEvent ); virtual void sFreightChanged(); virtual void sHandleShipchrg( int pShipchrgid ); virtual void sHandleSalesOrderEvent( int pSoheadid, bool ); virtual void sTaxZoneChanged(); virtual void sTaxDetail(); virtual void sFreightDetail(); virtual void setFreeFormShipto( bool pFreeForm ); virtual void populateCMInfo(); virtual void populateCCInfo(); virtual void sNewCreditCard(); virtual void sEditCreditCard(); virtual void sViewCreditCard(); virtual void sMoveUp(); virtual void sMoveDown(); virtual void sFillCcardList(); virtual void sAuthorizeCC(); virtual void sChargeCC(); virtual void sReturnStock(); virtual void sIssueStock(); virtual void sIssueLineBalance(); virtual void sReserveStock(); virtual void sReserveLineBalance(); virtual void sUnreserveStock(); virtual void sShowReservations(); virtual void sEnterCashPayment(); virtual void sCreditAllocate(); virtual void sAllocateCreditMemos(); virtual void sCheckValidContacts(); virtual void sHandleMore(); virtual void sCalculateTax(); virtual void sRecalculatePrice(); virtual void sOrderDateChanged(); virtual void sShipDateChanged(); virtual void sViewWO(); virtual void sMaintainWO(); virtual void sViewPO(); virtual void sMaintainPO(); virtual void sReleasePR(); virtual void sViewPR(); protected slots: virtual void languageChange(); virtual bool okToProcessCC(); signals: void populated(); void newId(int); void newModeType(int); void newModeState(int); void saved(int); private: bool deleteForCancel(); bool _saved; bool _calcfreight; int _orderNumberGen; double _freightCache; double _amountOutstanding; double _amountAllocated; double _taxableSubtotal; bool _userEnteredOrderNumber; bool _ignoreSignals; bool _blanketPos; bool _usesPos; bool _ffShipto; bool _captive; int _soheadid; int _lineMode; int _mode; int _numSelected; int _originalPrjid; int _custtaxzoneid; int _taxzoneidCache; int _crmacctid; QDate _orderDateCache; QDate _shipDateCache; bool _locked; }; #endif // SALESORDER_H qt-client-4.1.0/guiclient/salesOrder.ui000066400000000000000000002757601217451700100200600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesOrder 0 0 1015 696 Sales Order 12 Clea&r true false Order #: ... Qt::Horizontal QSizePolicy::Expanding 0 20 Save and Add to Packing List &Batch true &Save true &Close true 0 &Header Information 2 32767 32767 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 2 0 0 Terms Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 _terms 0 0 200 16777215 true XComboBox::ARTerms Ship Complete Order &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderDate 0 0 Sales Rep.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 0 0 200 16777215 true XComboBox::SalesReps Print on Save Scheduled Da&te: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipDate Commission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 Qt::AlignRight % Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 200 16777215 WComboBox::Shipping Pack Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 0 0 200 16777215 true None XComboBox::TaxZones Qt::Horizontal 0 20 More true true Quote Status: true E&xpire: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 3 _expire 0 0 Sale Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::SaleTypes Bill-To 0 32 16777215 32 QFrame::NoFrame QFrame::Raised 0 false false Qt::Horizontal Qt::Horizontal 13 17 false Copy to Ship-to -> Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _billToName false false 16777215 16777215 Qt::StrongFocus true true 2 0 0 &F.O.B.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _fob 0 0 Shipping Chgs.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::ShipVias Hold Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Cust. &PO #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _custPONumber Shipping Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::ShippingCharges true XComboBox::ShippingForms XComboBox::None Ship &Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipVia None Credit Shipping Packing Return 0 0 Qt::Vertical 731 151 true XComboBox::ShippingZones Shipping Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ship-To 0 32 16777215 32 QFrame::NoFrame QFrame::Raised 0 0 32 false false Qt::Horizontal QSizePolicy::Expanding 197 29 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipToName 16777215 16777215 Qt::StrongFocus &Line Items Qt::StrongFocus true 5 0 false Qt::StrongFocus &New true false Qt::StrongFocus &Edit true false Qt::NoFocus Close true false Qt::NoFocus &Delete true 0 0 false Qt::NoFocus Reserve Stock false Qt::NoFocus Res. Line Bal. 0 false Qt::NoFocus Issue Stock false Qt::NoFocus Issue Line Bal. Qt::Vertical QSizePolicy::Expanding 20 20 0 Require sufficient Inventory 5 Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderCurrency XComboBox::Currencies Qt::Horizontal 0 20 Show Canceled Line Items 5 Margin: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Qt::Horizontal 16 20 Misc. Charge Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Misc. Charge Sales Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 0 Freight Weight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 Qt::AlignRight Qt::Horizontal 51 20 Outstanding Credit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 Authorized CC Payments: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 32767 At Shipping: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Subtotal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Misc. Charge: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 true false false false Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 false false false Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Allocated Credit: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Relat&ionships 5 5 Project #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Preferred 20 21 0 0 Qt::StrongFocus From Quote: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter No Qt::StrongFocus Opportunity: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Qt::Horizontal 40 20 &Order Notes Qt::StrongFocus Co&mments Qt::StrongFocus Shippin&g Notes Qt::StrongFocus Doc&uments Pa&yment 0 Credit Card 1 0 Qt::NoFocus 0 New false Edit false Qt::NoFocus View false Qt::NoFocus Move Up false Qt::NoFocus Move Down Qt::Vertical QSizePolicy::Expanding 20 20 false Qt::NoFocus Authorize false Qt::NoFocus Charge Qt::Vertical QSizePolicy::Expanding 20 41 Qt::Horizontal 40 20 5 Amount: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 false CVV Code: 0 0 Cash Amount Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Funds Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Check/Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docNumber Qt::AlignLeading Post to: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _distDate 0 Qt::Horizontal QSizePolicy::Expanding 25 16 Application Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _applDate 0 Qt::Horizontal QSizePolicy::Expanding 25 16 0 Qt::Horizontal QSizePolicy::Expanding 25 16 Check/Document Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docNumber true Qt::TabFocus Use Alternate A/R Account true false Sales Category: 0 0 Qt::Horizontal 40 20 Qt::Vertical 20 42 Post Cash Payment Qt::Vertical 20 40 Qt::Horizontal 441 20 AddressCluster QWidget

    addresscluster.h
    Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    CustCluster QWidget
    custcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    Documents QWidget
    documents.h
    GLCluster QWidget
    glcluster.h
    OpportunityCluster QWidget
    opportunitycluster.h
    ProjectCluster QWidget
    projectcluster.h
    ShiptoCluster QWidget
    shiptocluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _orderNumber _orderDate _shipDate _packDate _terms _salesRep _commission _taxZone _shipComplete _printSO _warehouse _more _cust _billToName _billToAddr _billToCntct _copyToShipto _shipTo _shipToName _shipToAddr _shipToCntct _fob _shipVia _shippingCharges _custPONumber _holdType _shippingForm _soitem _new _edit _requireInventory _showCanceled _orderCurrency _margin _miscChargeDescription _weight _miscCharge _freight _total _balance _project _opportunity _orderComments _shippingComments _newCC _editCC _CCAmount _CCCVV _received _fundsType _docNumber _docDate _bankaccnt _distDate _applDate _altAccnt _salescat _saveAndAdd _save _close _clear _salesOrderInformation _cc valid(bool) _viewCC setEnabled(bool) 403 387 403 387 _cc itemSelected(int) _viewCC animateClick() 403 387 403 387 _cc valid(bool) _editCC setEnabled(bool) 403 387 403 387 _cc valid(bool) _upCC setEnabled(bool) 403 387 403 387 _cc valid(bool) _downCC setEnabled(bool) 403 387 403 387 _cc valid(bool) _authorize setEnabled(bool) 403 387 403 387 _cc valid(bool) _charge setEnabled(bool) 403 387 403 387 _close clicked() salesOrder close() 1059 44 20 20 _orderNumber textChanged(QString) _orderNumberExtra setText(QString) 156 107 162 47 _soitem itemSelected(int) _edit animateClick() 387 358 486 358 _orderCurrency newID(int) _subtotal setId(int) 486 387 486 387 _orderCurrency newID(int) _tax setId(int) 486 387 486 387 _orderCurrency newID(int) _miscCharge setId(int) 486 387 546 387 _orderCurrency newID(int) _freight setId(int) 486 387 546 387 _orderCurrency newID(int) _total setId(int) 486 387 546 387 _orderCurrency newID(int) _balance setId(int) 486 387 546 387 _orderCurrency newID(int) _amountAtShipping setId(int) 486 387 486 387 _orderCurrency newID(int) _allocatedCM setId(int) 486 387 387 387 _orderCurrency newID(int) _outstandingCM setId(int) 486 387 387 387 _orderCurrency newID(int) _CCAmount setId(int) 486 387 403 387 _orderCurrency newID(int) _authCC setId(int) 486 387 387 387 _orderDate newDate(QDate) _subtotal setEffective(QDate) 156 143 486 387 _orderDate newDate(QDate) _tax setEffective(QDate) 156 143 486 387 _orderDate newDate(QDate) _miscCharge setEffective(QDate) 156 143 546 387 _orderDate newDate(QDate) _freight setEffective(QDate) 156 143 546 387 _orderDate newDate(QDate) _total setEffective(QDate) 156 143 546 387 _orderDate newDate(QDate) _balance setEffective(QDate) 156 143 546 387 _orderDate newDate(QDate) _CCAmount setEffective(QDate) 156 143 403 387 _orderDate newDate(QDate) _allocatedCM setEffective(QDate) 156 143 387 387 _orderDate newDate(QDate) _amountAtShipping setEffective(QDate) 156 143 486 387 _orderDate newDate(QDate) _outstandingCM setEffective(QDate) 156 143 387 387 _orderDate newDate(QDate) _authCC setEffective(QDate) 156 143 387 387 _orderCurrency newID(int) _margin setId(int) 486 387 504 387 _orderDate newDate(QDate) _margin setEffective(QDate) 156 165 504 387 _distDate newDate(QDate) _received setEffective(QDate) 104 112 134 112 _orderCurrency newID(int) _received setId(int) 84 112 134 112 qt-client-4.1.0/guiclient/salesOrderInformation.cpp000066400000000000000000000136421217451700100224200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesOrderInformation.h" #include #include salesOrderInformation::salesOrderInformation(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _soitemid = 0; } salesOrderInformation::~salesOrderInformation() { // no need to delete child widgets, Qt does it all for us } void salesOrderInformation::languageChange() { retranslateUi(this); } enum SetResponse salesOrderInformation::set(const ParameterList &pParams) { XSqlQuery saleset; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("soitem_id", &valid); if (valid) { _soitemid = param.toInt(); saleset.prepare( "SELECT coitem_cohead_id " "FROM coitem " "WHERE (coitem_id=:soitem_id);" ); saleset.bindValue(":soitem_id", _soitemid); saleset.exec(); if (saleset.first()) { _soheadid = saleset.value("coitem_cohead_id").toInt(); populate(); } else if (saleset.lastError().type() != QSqlError::NoError) { systemError(this, saleset.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("sohead_id", &valid); if (valid) { _soheadid = param.toInt(); populate(); } return NoError; } void salesOrderInformation::populate() { XSqlQuery salespopulate; salespopulate.prepare( "SELECT cohead_number, warehous_code," " formatDate(cohead_orderdate) AS f_orderdate," " formatDate(MIN(coitem_scheddate)) AS f_shipdate," " formatDate(cohead_packdate) AS f_packdate," " CASE WHEN (cohead_holdtype='N') THEN :none" " WHEN (cohead_holdtype='C') THEN :credit" " WHEN (cohead_holdtype='S') THEN :ship" " WHEN (cohead_holdtype='P') THEN :pack" " WHEN (cohead_holdtype='R') THEN :return" " ELSE :other" " END AS f_holdtype," " cohead_shipvia, cohead_billtoname," " cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3," " cohead_billtocity, cohead_billtostate, cohead_billtozipcode," " cohead_shiptoname," " cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3," " cohead_shiptocity, cohead_shiptostate, cohead_shiptozipcode " "FROM cohead, coitem, itemsite LEFT OUTER JOIN " " whsinfo ON (itemsite_warehous_id = warehous_id) " "WHERE ( (coitem_cohead_id=cohead_id)" " AND (coitem_itemsite_id=itemsite_id) " " AND (coitem_status <> 'X')" " AND (coitem_id=:soitem_id) " " AND (cohead_id=:sohead_id) ) " "GROUP BY cohead_number, warehous_code, cohead_orderdate, cohead_packdate," " cohead_holdtype, cohead_shipvia, cohead_billtoname," " cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3," " cohead_billtocity, cohead_billtostate, cohead_billtozipcode," " cohead_shiptoname," " cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3," " cohead_shiptocity, cohead_shiptostate, cohead_shiptozipcode;" ); salespopulate.bindValue(":none", tr("None")); salespopulate.bindValue(":credit", tr("Credit")); salespopulate.bindValue(":ship", tr("Ship")); salespopulate.bindValue(":pack", tr("Pack")); salespopulate.bindValue(":return", tr("Return")); salespopulate.bindValue(":other", tr("Other")); salespopulate.bindValue(":sohead_id", _soheadid); salespopulate.bindValue(":soitem_id", _soitemid); salespopulate.exec(); if (salespopulate.first()) { _orderNumber->setText(salespopulate.value("cohead_number").toString()); _warehouse->setText(salespopulate.value("warehous_code").toString()); _orderDate->setText(salespopulate.value("f_orderdate").toString()); _shipDate->setText(salespopulate.value("f_shipdate").toString()); _packDate->setText(salespopulate.value("f_packdate").toString()); _shipVia->setText(salespopulate.value("cohead_shipvia").toString()); _holdType->setText(salespopulate.value("f_holdtype").toString()); _billtoName->setText(salespopulate.value("cohead_billtoname").toString()); _billtoAddress1->setText(salespopulate.value("cohead_billtoaddress1").toString()); _billtoAddress2->setText(salespopulate.value("cohead_billtoaddress2").toString()); _billtoAddress3->setText(salespopulate.value("cohead_billtoaddress3").toString()); _billtoCity->setText(salespopulate.value("cohead_billtocity").toString()); _billtoState->setText(salespopulate.value("cohead_billtostate").toString()); _billtoZipCode->setText(salespopulate.value("cohead_billtozipcode").toString()); _shiptoName->setText(salespopulate.value("cohead_shiptoname").toString()); _shiptoAddress1->setText(salespopulate.value("cohead_shiptoaddress1").toString()); _shiptoAddress2->setText(salespopulate.value("cohead_shiptoaddress2").toString()); _shiptoAddress3->setText(salespopulate.value("cohead_shiptoaddress3").toString()); _shiptoCity->setText(salespopulate.value("cohead_shiptocity").toString()); _shiptoState->setText(salespopulate.value("cohead_shiptostate").toString()); _shiptoZipCode->setText(salespopulate.value("cohead_shiptozipcode").toString()); } } qt-client-4.1.0/guiclient/salesOrderInformation.h000066400000000000000000000021231217451700100220550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESORDERINFORMATION_H #define SALESORDERINFORMATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_salesOrderInformation.h" class salesOrderInformation : public XDialog, public Ui::salesOrderInformation { Q_OBJECT public: salesOrderInformation(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~salesOrderInformation(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); private: int _soheadid; int _soitemid; }; #endif // SALESORDERINFORMATION_H qt-client-4.1.0/guiclient/salesOrderInformation.ui000066400000000000000000000474011217451700100222530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesOrderInformation true 0 0 664 192 Sales Order Information 5 0 0 5 0 7 0 0 0 5 0 0 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Shipping Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Vertical QSizePolicy::Preferred 20 20 0 5 0 0 Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ship Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Pack Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 100 0 100 0 100 0 0 0 0 5 0 0 Ship &Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipVia Hold Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 7 5 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 7 5 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 20 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 40 0 5 Bill-To Address: 5 0 0 5 40 32767 Qt::AlignCenter 0 5 Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 5 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Ship-To Address: 5 0 0 5 40 32767 Qt::AlignCenter 0 5 Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 5 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 20 _close clicked() salesOrderInformation reject() 20 20 20 20 qt-client-4.1.0/guiclient/salesOrderItem.cpp000066400000000000000000004712071217451700100210360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesOrderItem.h" #include #include #include #include #include #include "mqlutil.h" #include "guiErrorCheck.h" #include "errorReporter.h" #include "itemCharacteristicDelegate.h" #include "priceList.h" #include "storedProcErrorLookup.h" #include "taxDetail.h" #include "xdoublevalidator.h" #include "itemSourceList.h" #include "maintainItemCosts.h" #define cNewQuote (0x20 | cNew) #define cEditQuote (0x20 | cEdit) #define cViewQuote (0x20 | cView) #define ISQUOTE(mode) (((mode) & 0x20) == 0x20) #define ISORDER(mode) (!ISQUOTE(mode)) #define iDontUpdate 1 #define iAskToUpdate 2 #define iJustUpdate 3 salesOrderItem::salesOrderItem(QWidget *parent, const char *name, Qt::WindowFlags fl) : XDialog(parent, name, fl) { setupUi(this); connect(_item, SIGNAL(privateIdChanged(int)), this, SLOT(sFindSellingWarehouseItemsites(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemSources(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemSubs(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateHistory())); connect(_listPrices, SIGNAL(clicked()), this, SLOT(sListPrices())); connect(_netUnitPrice, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup())); connect(_netUnitPrice, SIGNAL(valueChanged()), this, SLOT(sCalculateExtendedPrice())); connect(_qtyOrdered, SIGNAL(editingFinished()), this, SLOT(sPopulateOrderInfo())); connect(_qtyOrdered, SIGNAL(editingFinished()), this, SLOT(sDetermineAvailability())); connect(_qtyOrdered, SIGNAL(editingFinished()), this, SLOT(sDeterminePrice())); connect(_qtyOrdered, SIGNAL(textChanged(const QString &)), this, SLOT(sCalcWoUnitCost())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_scheduledDate, SIGNAL(newDate(const QDate &)), this, SLOT(sHandleScheduleDate())); connect(_showAvailability, SIGNAL(toggled(bool)), this, SLOT(sDetermineAvailability())); connect(_showIndented, SIGNAL(toggled(bool)), this, SLOT(sDetermineAvailability())); connect(_item, SIGNAL(privateIdChanged(int)), this, SLOT(sPopulateItemsiteInfo())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateItemsiteInfo())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sDetermineAvailability())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateItemSubs(int))); connect(_subs, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateSubMenu(QMenu*,QTreeWidgetItem*,int))); connect(_next, SIGNAL(clicked()), this, SLOT(sNext())); connect(_prev, SIGNAL(clicked()), this, SLOT(sPrev())); connect(_notes, SIGNAL(textChanged()), this, SLOT(sChanged())); connect(_createSupplyOrder, SIGNAL(toggled(bool)), this, SLOT(sChanged())); connect(_supplyOrderDueDate,SIGNAL(newDate(const QDate &)), this, SLOT(sChanged())); connect(_supplyWarehouse, SIGNAL(newID(int)), this, SLOT(sChanged())); connect(_promisedDate, SIGNAL(newDate(const QDate &)), this, SLOT(sChanged())); connect(_scheduledDate, SIGNAL(newDate(const QDate &)), this, SLOT(sChanged())); connect(_netUnitPrice, SIGNAL(valueChanged()), this, SLOT(sChanged())); connect(_qtyOrdered, SIGNAL(textChanged(const QString &)), this, SLOT(sChanged())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sChanged())); connect(_item, SIGNAL(newId(int)), this, SLOT(sChanged())); connect(_cancel, SIGNAL(clicked()), this, SLOT(sCancel())); connect(_extendedPrice, SIGNAL(valueChanged()), this, SLOT(sLookupTax())); connect(_taxLit, SIGNAL(leftClickedURL(QString)), this, SLOT(sTaxDetail())); connect(_taxtype, SIGNAL(newID(int)), this, SLOT(sLookupTax())); connect(_qtyUOM, SIGNAL(newID(int)), this, SLOT(sQtyUOMChanged())); connect(_priceUOM, SIGNAL(newID(int)), this, SLOT(sPriceUOMChanged())); connect(_inventoryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); connect(_itemSourcesButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); connect(_dependenciesButton,SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); connect(_substitutesButton,SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); connect(_historyCostsButton,SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); connect(_historyCostsButton,SIGNAL(toggled(bool)), this, SLOT(sPopulateHistory())); connect(_historyDates, SIGNAL(updated()), this, SLOT(sPopulateHistory())); #ifndef Q_WS_MAC _listPrices->setMaximumWidth(25); _subItemList->setMaximumWidth(25); #endif _leadTime = 999; _shiptoid = -1; _preferredWarehouseid = -1; _modified = false; _canceling = false; _error = false; _originalQtyOrd = 0.0; _updateItemsite = false; _updatePrice = true; _qtyinvuomratio = 1.0; _priceinvuomratio = 1.0; _priceRatio = 1.0; _invuomid = -1; _invIsFractional = false; _qtyreserved = 0.0; _priceType = "N"; // default to nominal _priceMode = "D"; // default to discount _authNumber->hide(); _authNumberLit->hide(); _authLineNumber->hide(); _authLineNumberLit->hide(); _availabilityLastItemid = -1; _availabilityLastWarehousid = -1; _availabilityLastSchedDate = QDate(); _availabilityLastShow = false; _availabilityQtyOrdered = 0.0; _charVars << -1 << -1 << -1 << 0 << -1 << omfgThis->dbDate(); // Configure some Widgets _item->setType(ItemLineEdit::cSold | ItemLineEdit::cActive); _item->addExtraClause( QString("(itemsite_active)") ); // ItemLineEdit::cActive doesn't compare against the itemsite record _item->addExtraClause( QString("(itemsite_sold)") ); // ItemLineEdit::cSold doesn't compare against the itemsite record _taxtype->setEnabled(_privileges->check("OverrideTax")); _availability->addColumn(tr("#"), _seqColumn, Qt::AlignCenter,true, "seqnumber"); _availability->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "item_number"); _availability->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); _availability->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); _availability->addColumn(tr("Pend. Alloc."),_qtyColumn, Qt::AlignRight, true, "pendalloc"); _availability->addColumn(tr("Total Alloc."),_qtyColumn, Qt::AlignRight, true, "totalalloc"); _availability->addColumn(tr("On Order"), _qtyColumn, Qt::AlignRight, true, "ordered"); _availability->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh"); _availability->addColumn(tr("Availability"),_qtyColumn, Qt::AlignRight, true, "totalavail"); _itemsrcp->addColumn(tr("Vendor #"), _itemColumn, Qt::AlignLeft, true, "vend_number"); _itemsrcp->addColumn(tr("Vendor Name"), -1, Qt::AlignLeft, true, "vend_name"); _itemsrcp->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemsrc_descrip"); _itemsrcp->addColumn(tr("Qty Break"), _qtyColumn, Qt::AlignRight,true, "itemsrcp_qtybreak"); _itemsrcp->addColumn(tr("Base Price"), _moneyColumn, Qt::AlignRight,true, "price_base"); _subs->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _subs->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _subs->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); _subs->addColumn(tr("LT"), _whsColumn, Qt::AlignCenter, true, "leadtime" ); _subs->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qtyonhand" ); _subs->addColumn(tr("Allocated"), _qtyColumn, Qt::AlignRight, true, "allocated" ); _subs->addColumn(tr("On Order"), _qtyColumn, Qt::AlignRight, true, "ordered" ); _subs->addColumn(tr("Reorder Lvl."), _qtyColumn, Qt::AlignRight, true, "reorderlevel" ); _subs->addColumn(tr("Available"), _qtyColumn, Qt::AlignRight, true, "available" ); _historyDates->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _historyDates->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); _historyCosts->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight, true, "ponumber"); _historyCosts->addColumn(tr("Vendor"), 120, Qt::AlignLeft, true, "vend_name"); _historyCosts->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter,true, "duedate"); _historyCosts->addColumn(tr("Recv. Date"), _dateColumn, Qt::AlignCenter,true, "recvdate"); _historyCosts->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "venditemnumber"); _historyCosts->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "venditemdescrip"); _historyCosts->addColumn(tr("Rcvd/Rtnd"), _qtyColumn, Qt::AlignRight, true, "sense"); _historyCosts->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qty"); if (_privileges->check("ViewCosts")) { _historyCosts->addColumn(tr("Purch. Cost"),_priceColumn, Qt::AlignRight,true, "purchcost"); _historyCosts->addColumn(tr("Recv. Cost"), _priceColumn, Qt::AlignRight,true, "recvcost"); _historyCosts->addColumn(tr("Value"), _priceColumn, Qt::AlignRight,true, "value"); } _historySales->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); _historySales->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignLeft, true, "cohist_ordernumber" ); _historySales->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignLeft, true, "invoicenumber" ); _historySales->addColumn(tr("Ord. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_orderdate" ); _historySales->addColumn(tr("Invc. Date"), _dateColumn, Qt::AlignCenter, true, "cohist_invcdate" ); _historySales->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _historySales->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescription" ); _historySales->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "cohist_qtyshipped" ); if (_privileges->check("ViewCustomerPrices")) { _historySales->addColumn(tr("Unit Price"), _priceColumn, Qt::AlignRight, true, "cohist_unitprice" ); _historySales->addColumn(tr("Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "extprice" ); _historySales->addColumn(tr("Currency"), _currencyColumn, Qt::AlignRight, true, "currAbbr" ); _historySales->addColumn(tr("Base Unit Price"), _bigMoneyColumn, Qt::AlignRight, true, "baseunitprice" ); _historySales->addColumn(tr("Base Ext. Price"), _bigMoneyColumn, Qt::AlignRight, true, "baseextprice" ); } if (_privileges->check("ViewCosts")) { _historySales->addColumn(tr("Unit Cost"), _costColumn, Qt::AlignRight, true, "cohist_unitcost" ); _historySales->addColumn(tr("Ext. Cost"), _bigMoneyColumn, Qt::AlignRight, true, "extcost" ); } _itemchar = new QStandardItemModel(0, 3, this); _itemchar->setHeaderData( CHAR_ID, Qt::Horizontal, tr("Name"), Qt::DisplayRole); _itemchar->setHeaderData( CHAR_VALUE, Qt::Horizontal, tr("Value"), Qt::DisplayRole); _itemchar->setHeaderData( CHAR_PRICE, Qt::Horizontal, tr("Price"), Qt::DisplayRole); _itemcharView->hideColumn(CHAR_PRICE); _baseUnitPriceLit->hide(); _baseUnitPrice->hide(); _supplyDropShip->hide(); _itemcharView->setModel(_itemchar); ItemCharacteristicDelegate *delegate = new ItemCharacteristicDelegate(this); _itemcharView->setItemDelegate(delegate); if (!_metrics->boolean("UsePromiseDate")) { _promisedDateLit->hide(); _promisedDate->hide(); } if (!_preferences->boolean("ClusterButtons")) _subItemList->hide(); _qtyOrdered->setValidator(omfgThis->qtyVal()); _supplyOrderQty->setValidator(omfgThis->qtyVal()); _discountFromCust->setValidator(omfgThis->negPercentVal()); _shippedToDate->setPrecision(omfgThis->qtyVal()); _discountFromListPrice->setValidator(omfgThis->percentVal()); _markupFromUnitCost->setValidator(omfgThis->percentVal()); _onHand->setPrecision(omfgThis->qtyVal()); _allocated->setPrecision(omfgThis->qtyVal()); _unallocated->setPrecision(omfgThis->qtyVal()); _onOrder->setPrecision(omfgThis->qtyVal()); _available->setPrecision(omfgThis->qtyVal()); // Disable the Discount Percent stuff if we don't allow them if ((!_metrics->boolean("AllowDiscounts")) && (!_privileges->check("OverridePrice"))) { _netUnitPrice->setEnabled(FALSE); _discountFromCust->setEnabled(FALSE); _unitCost->setEnabled(FALSE); _markupFromUnitCost->setEnabled(FALSE); } if (!_privileges->check("ViewCosts")) { _unitCost->hide(); _unitCostLit->hide(); _markupFromUnitCost->hide(); _markupFromUnitCostLit->hide(); } if ((_metrics->boolean("DisableSalesOrderPriceOverride")) || (!_privileges->check("OverridePrice"))) { _netUnitPrice->setEnabled(false); } _supplyOverridePrice->hide(); _supplyOverridePriceLit->hide(); _supplyOrderType = ""; _supplyOrderId = -1; _itemsrc = -1; _taxzoneid = -1; _initialMode = -1; sPriceGroup(); if (!_metrics->boolean("EnableReturnAuth")) _warranty->hide(); if (_metrics->value("soPriceEffective") == "ScheduleDate") { connect(_scheduledDate, SIGNAL(newDate(QDate)), this, SLOT(sHandleScheduleDate())); connect(_item, SIGNAL(newId(int)), this, SLOT(sHandleScheduleDate())); } adjustSize(); _inventoryButton->setEnabled(_showAvailability->isChecked()); _itemSourcesButton->setEnabled(_showAvailability->isChecked()); _dependenciesButton->setEnabled(_showAvailability->isChecked()); _substitutesButton->setEnabled(_showAvailability->isChecked()); _availability->setEnabled(_showAvailability->isChecked()); _showIndented->setEnabled(_showAvailability->isChecked()); _altCosAccnt->setType(GLCluster::cRevenue | GLCluster::cExpense); _altRevAccnt->setType(GLCluster::cRevenue); // TO DO **** Fix tab order issues and offer alternate means for "Express Tab Order" **** } salesOrderItem::~salesOrderItem() { // no need to delete child widgets, Qt does it all for us } void salesOrderItem::languageChange() { retranslateUi(this); } enum SetResponse salesOrderItem:: set(const ParameterList &pParams) { XSqlQuery setSales; XDialog::set(pParams); QVariant param; bool valid; _prev->setEnabled(true); _next->setEnabled(true); _next->setText(tr("Next")); param = pParams.value("sohead_id", &valid); if (valid) _soheadid = param.toInt(); else _soheadid = -1; param = pParams.value("taxzone_id", &valid); if (valid) _taxzoneid = param.toInt(); param = pParams.value("cust_id", &valid); if (valid) { _custid = param.toInt(); setSales.prepare("SELECT COALESCE(cust_preferred_warehous_id, -1) AS preferredwarehousid, " "(cust_number || '-' || cust_name) as f_name " " FROM custinfo" " WHERE (cust_id=:cust_id); "); setSales.bindValue(":cust_id", _custid); setSales.exec(); if (setSales.first()) { if (setSales.value("preferredwarehousid").toInt() != -1) _preferredWarehouseid = setSales.value("preferredwarehousid").toInt(); _custName = setSales.value("f_name").toString(); } else if (setSales.lastError().type() != QSqlError::NoError) { systemError(this, setSales.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _charVars.replace(CUST_ID, param.toInt()); } param = pParams.value("shipto_id", &valid); if (valid) { _shiptoid = param.toInt(); _charVars.replace(SHIPTO_ID, param.toInt()); } param = pParams.value("warehous_id", &valid); if (valid) { int _warehouseid = param.toInt(); _warehouse->setId(-1); _warehouse->setId(_warehouseid); _preferredWarehouseid = _warehouseid; } param = pParams.value("orderNumber", &valid); if (valid) _orderNumber->setText(param.toString()); param = pParams.value("curr_id", &valid); if (valid) { _netUnitPrice->setId(param.toInt()); _tax->setId(param.toInt()); _charVars.replace(CURR_ID, param.toInt()); } param = pParams.value("orderDate", &valid); if (valid) { _netUnitPrice->setEffective(param.toDate()); _charVars.replace(EFFECTIVE, param.toDate()); } param = pParams.value("shipDate", &valid); if (valid) _scheduledDate->setDate(param.toDate()); param = pParams.value("mode", &valid); if (valid) { QDate asOf; if (_metrics->value("soPriceEffective") == "ScheduleDate") asOf = _scheduledDate->date(); else if (_metrics->value("soPriceEffective") == "OrderDate") asOf = _netUnitPrice->effective(); else asOf = omfgThis->dbDate(); if (param.toString() == "new") { _mode = cNew; _save->setEnabled(false); _next->setText(tr("New")); _comments->setType(Comments::SalesOrderItem); _comments->setReadOnly(false); _supplyOrderStatusLit->hide(); _supplyOrderStatus->hide(); _item->setReadOnly(false); _warehouse->setEnabled(true); _cancel->setEnabled(false); _supplyOrderType = ""; _supplyOrderId = -1; _supplyOrderLit->hide(); _supplyOrderLineLit->hide(); _itemsrc = -1; _item->addExtraClause( QString("(item_id IN (SELECT custitem FROM custitem(%1, %2, '%3') ) )").arg(_custid).arg(_shiptoid).arg(asOf.toString(Qt::ISODate)) ); prepare(); connect(_netUnitPrice, SIGNAL(editingFinished()), this, SLOT(sCalculateDiscountPrcnt())); connect(_discountFromCust, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_unitCost, SIGNAL(editingFinished()), this, SLOT(sCalculateFromMarkup())); connect(_markupFromUnitCost,SIGNAL(editingFinished()), this, SLOT(sCalculateFromMarkup())); connect(_item, SIGNAL(valid(bool)), _listPrices, SLOT(setEnabled(bool))); connect(_createSupplyOrder, SIGNAL(toggled(bool)), this, SLOT(sHandleWo(bool))); setSales.prepare("SELECT count(*) AS cnt" " FROM coitem" " WHERE (coitem_cohead_id=:sohead_id);"); setSales.bindValue(":sohead_id", _soheadid); setSales.exec(); if (!setSales.first() || setSales.value("cnt").toInt() == 0) _prev->setEnabled(false); if (setSales.lastError().type() != QSqlError::NoError) { systemError(this, setSales.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "newQuote") { _mode = cNewQuote; // TODO - quotes different from sales orders? // _item->setType(ItemLineEdit::cSold | ItemLineEdit::cItemActive); // _item->clearExtraClauseList(); setWindowTitle(tr("Quote Item")); _save->setEnabled(FALSE); _next->setText(tr("New")); _comments->setType(Comments::QuoteItem); _comments->setReadOnly(true); _supplyOrderStatusLit->hide(); _supplyOrderStatus->hide(); // _createSupplyOrder->hide(); _supplyOrderQtyLit->hide(); _supplyOrderQty->hide(); _supplyOrderDueDateLit->hide(); _supplyOrderDueDate->hide(); _cancel->hide(); _sub->hide(); _subItem->hide(); _subItemList->hide(); _item->setReadOnly(false); _warehouse->setEnabled(true); _supplyOrderId = -1; _itemsrc = -1; _warranty->hide(); _tabs->removeTab(_tabs->indexOf(_costofsalesTab)); _item->addExtraClause( QString("(item_id IN (SELECT custitem FROM custitem(%1, %2, '%3') ) )").arg(_custid).arg(_shiptoid).arg(asOf.toString(Qt::ISODate)) ); prepare(); connect(_netUnitPrice, SIGNAL(editingFinished()), this, SLOT(sCalculateDiscountPrcnt())); connect(_discountFromCust, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_unitCost, SIGNAL(editingFinished()), this, SLOT(sCalculateFromMarkup())); connect(_markupFromUnitCost,SIGNAL(editingFinished()), this, SLOT(sCalculateFromMarkup())); connect(_item, SIGNAL(valid(bool)), _listPrices, SLOT(setEnabled(bool))); setSales.prepare("SELECT count(*) AS cnt" " FROM quitem" " WHERE (quitem_quhead_id=:sohead_id);"); setSales.bindValue(":sohead_id", _soheadid); setSales.exec(); if (!setSales.first() || setSales.value("cnt").toInt() == 0) _prev->setEnabled(false); if (setSales.lastError().type() != QSqlError::NoError) { systemError(this, setSales.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(TRUE); _listPrices->setEnabled(TRUE); _comments->setType(Comments::SalesOrderItem); connect(_qtyOrdered, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice())); connect(_netUnitPrice, SIGNAL(editingFinished()), this, SLOT(sCalculateDiscountPrcnt())); connect(_discountFromCust, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_unitCost, SIGNAL(editingFinished()), this, SLOT(sCalculateFrom())); connect(_markupFromUnitCost,SIGNAL(editingFinished()), this, SLOT(sCalculateFromMarkup())); connect(_createSupplyOrder, SIGNAL(toggled(bool)), this, SLOT(sHandleWo(bool))); } else if (param.toString() == "editQuote") { _mode = cEditQuote; _item->setType(ItemLineEdit::cSold | ItemLineEdit::cItemActive); _item->clearExtraClauseList(); setWindowTitle(tr("Quote Item")); _item->setReadOnly(TRUE); _listPrices->setEnabled(TRUE); _comments->setType(Comments::QuoteItem); // _createSupplyOrder->hide(); _supplyOrderQtyLit->hide(); _supplyOrderQty->hide(); _supplyOrderDueDateLit->hide(); _supplyOrderDueDate->hide(); _supplyOrderStatusLit->hide(); _supplyOrderStatus->hide(); _cancel->hide(); _sub->hide(); _subItem->hide(); _subItemList->hide(); _warranty->hide(); _tabs->removeTab(_tabs->indexOf(_costofsalesTab)); connect(_qtyOrdered, SIGNAL(editingFinished()), this, SLOT(sCalculateExtendedPrice())); connect(_netUnitPrice, SIGNAL(editingFinished()), this, SLOT(sCalculateDiscountPrcnt())); connect(_discountFromCust, SIGNAL(editingFinished()), this, SLOT(sCalculateFromDiscount())); connect(_unitCost, SIGNAL(editingFinished()), this, SLOT(sCalculateFromMarkup())); connect(_markupFromUnitCost,SIGNAL(editingFinished()), this, SLOT(sCalculateFromMarkup())); } else if (param.toString() == "view") { _mode = cView; _comments->setType(Comments::SalesOrderItem); _sub->setEnabled(false); _subItem->setEnabled(false); _supplyWarehouse->setEnabled(FALSE); _supplyOverridePrice->setEnabled(FALSE); } else if (param.toString() == "viewQuote") { _mode = cViewQuote; _item->setType(ItemLineEdit::cSold | ItemLineEdit::cItemActive); _item->clearExtraClauseList(); setWindowTitle(tr("Quote Item")); // _createSupplyOrder->hide(); _supplyOrderQtyLit->hide(); _supplyOrderQty->hide(); _supplyOrderDueDateLit->hide(); _supplyOrderDueDate->hide(); _supplyOrderStatusLit->hide(); _supplyOrderStatus->hide(); _cancel->hide(); _sub->hide(); _subItem->hide(); _comments->setType(Comments::QuoteItem); _warranty->hide(); _tabs->removeTab(_tabs->indexOf(_costofsalesTab)); } } if (_initialMode == -1) _initialMode = _mode; bool viewMode = (cView == _mode || cViewQuote == _mode); if (viewMode) { _item->setReadOnly(viewMode); _qtyOrdered->setEnabled(!viewMode); _netUnitPrice->setEnabled(!viewMode); _discountFromCust->setEnabled(!viewMode); _unitCost->setEnabled(!viewMode); _markupFromUnitCost->setEnabled(!viewMode); _scheduledDate->setEnabled(!viewMode); _createSupplyOrder->setEnabled(!viewMode); _notes->setEnabled(!viewMode); _comments->setReadOnly(viewMode); _taxtype->setEnabled(!viewMode); _itemcharView->setEnabled(!viewMode); _promisedDate->setEnabled(!viewMode); _qtyUOM->setEnabled(!viewMode); _priceUOM->setEnabled(!viewMode); _warranty->setEnabled(!viewMode); _listPrices->setEnabled(!viewMode); _altCosAccnt->setEnabled(!viewMode); _altRevAccnt->setEnabled(!viewMode); _subItemList->setVisible(!viewMode); _save->setVisible(!viewMode); } param = pParams.value("soitem_id", &valid); if (valid) { _soitemid = param.toInt(); populate(); if (ISQUOTE(_mode)) setSales.prepare("SELECT a.quitem_id AS id" " FROM quitem AS a, quitem as b" " WHERE ((a.quitem_quhead_id=b.quitem_quhead_id)" " AND (b.quitem_id=:id))" " ORDER BY a.quitem_linenumber " " LIMIT 1;"); else setSales.prepare("SELECT a.coitem_id AS id" " FROM coitem AS a, coitem AS b" " WHERE ((a.coitem_cohead_id=b.coitem_cohead_id)" " AND (b.coitem_id=:id))" " ORDER BY a.coitem_linenumber, a.coitem_subnumber" " LIMIT 1;"); setSales.bindValue(":id", _soitemid); setSales.exec(); if (!setSales.first() || setSales.value("id").toInt() == _soitemid) _prev->setEnabled(false); if (setSales.lastError().type() != QSqlError::NoError) { systemError(this, setSales.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } if (ISQUOTE(_mode)) setSales.prepare("SELECT a.quitem_id AS id" " FROM quitem AS a, quitem as b" " WHERE ((a.quitem_quhead_id=b.quitem_quhead_id)" " AND (b.quitem_id=:id))" " ORDER BY a.quitem_linenumber DESC" " LIMIT 1;"); else setSales.prepare("SELECT a.coitem_id AS id" " FROM coitem AS a, coitem AS b" " WHERE ((a.coitem_cohead_id=b.coitem_cohead_id)" " AND (b.coitem_id=:id))" " ORDER BY a.coitem_linenumber DESC, a.coitem_subnumber DESC" " LIMIT 1;"); setSales.bindValue(":id", _soitemid); setSales.exec(); if (setSales.first() && setSales.value("id").toInt() == _soitemid) { if (cView == _initialMode || cViewQuote == _initialMode) _next->setEnabled(false); else _next->setText(tr("New")); } if (setSales.lastError().type() != QSqlError::NoError) { systemError(this, setSales.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } // See if this is linked to a Return Authorization and handle if ((ISORDER(_mode)) && (_metrics->boolean("EnableReturnAuth"))) { setSales.prepare("SELECT rahead_number,raitem_linenumber " "FROM raitem,rahead " "WHERE ((raitem_new_coitem_id=:coitem_id) " "AND (rahead_id=raitem_rahead_id));"); setSales.bindValue(":coitem_id",_soitemid); setSales.exec(); if (setSales.first()) { _authNumber->show(); _authNumberLit->show(); _authLineNumber->show(); _authLineNumberLit->show(); _authNumber->setText(setSales.value("rahead_number").toString()); _authLineNumber->setText(setSales.value("raitem_linenumber").toString()); _qtyOrdered->setEnabled(FALSE); _qtyUOM->setEnabled(FALSE); _priceUOM->setEnabled(FALSE); } } } param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(TRUE); } // If not multi-warehouse and a sales order hide whs control // Leave the warehouse controls available on Quotes as it is // possible to create quote line items without an itemsite // and the user needs a means to come back and specify the // warehouse after an itemsite is created. if (ISORDER(_mode) && !_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); _supplyWarehouseLit->hide(); _supplyWarehouse->hide(); } _modified = false; sHandleButton(); return NoError; } void salesOrderItem::prepare() { XSqlQuery salesprepare; if (_mode == cNew) { // Grab the next coitem_id salesprepare.exec("SELECT NEXTVAL('coitem_coitem_id_seq') AS _coitem_id"); if (salesprepare.first()) { _soitemid = salesprepare.value("_coitem_id").toInt(); _comments->setId(_soitemid); } else if (salesprepare.lastError().type() != QSqlError::NoError) { systemError(this, salesprepare.lastError().databaseText(), __FILE__, __LINE__); return; } salesprepare.prepare( "SELECT (COALESCE(MAX(coitem_linenumber), 0) + 1) AS _linenumber " "FROM coitem " "WHERE (coitem_cohead_id=:coitem_id)" ); salesprepare.bindValue(":coitem_id", _soheadid); salesprepare.exec(); if (salesprepare.first()) _lineNumber->setText(salesprepare.value("_linenumber").toString()); else if (salesprepare.lastError().type() != QSqlError::NoError) { systemError(this, salesprepare.lastError().databaseText(), __FILE__, __LINE__); return; } if (!_scheduledDate->isValid()) { salesprepare.prepare( "SELECT MIN(coitem_scheddate) AS scheddate " "FROM coitem " "WHERE (coitem_cohead_id=:cohead_id);" ); salesprepare.bindValue(":cohead_id", _soheadid); salesprepare.exec(); if (salesprepare.first()) _scheduledDate->setDate(salesprepare.value("scheddate").toDate()); else if (salesprepare.lastError().type() != QSqlError::NoError) { systemError(this, salesprepare.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (_mode == cNewQuote) { // Grab the next quitem_id salesprepare.exec("SELECT NEXTVAL('quitem_quitem_id_seq') AS _quitem_id"); if (salesprepare.first()) _soitemid = salesprepare.value("_quitem_id").toInt(); else if (salesprepare.lastError().type() != QSqlError::NoError) { systemError(this, salesprepare.lastError().databaseText(), __FILE__, __LINE__); return; } salesprepare.prepare( "SELECT (COALESCE(MAX(quitem_linenumber), 0) + 1) AS n_linenumber " "FROM quitem " "WHERE (quitem_quhead_id=:quhead_id)" ); salesprepare.bindValue(":quhead_id", _soheadid); salesprepare.exec(); if (salesprepare.first()) _lineNumber->setText(salesprepare.value("n_linenumber").toString()); else if (salesprepare.lastError().type() != QSqlError::NoError) { systemError(this, salesprepare.lastError().databaseText(), __FILE__, __LINE__); return; } if (!_scheduledDate->isValid()) { salesprepare.prepare( "SELECT MIN(quitem_scheddate) AS scheddate " "FROM quitem " "WHERE (quitem_quhead_id=:quhead_id);" ); salesprepare.bindValue(":quhead_id", _soheadid); salesprepare.exec(); if (salesprepare.first()) _scheduledDate->setDate(salesprepare.value("scheddate").toDate()); else if (salesprepare.lastError().type() != QSqlError::NoError) { systemError(this, salesprepare.lastError().databaseText(), __FILE__, __LINE__); return; } } } _modified = false; } void salesOrderItem::clear() { _item->setId(-1); _customerPN->clear(); _qtyOrdered->clear(); _qtyUOM->clear(); _priceUOM->clear(); _netUnitPrice->clear(); _extendedPrice->clear(); // _scheduledDate->clear(); _promisedDate->clear(); _unitCost->clear(); _listPrice->clear(); _customerPrice->clear(); _discountFromListPrice->clear(); _markupFromUnitCost->clear(); _discountFromCust->clear(); _margin->clear(); _shippedToDate->clear(); _createSupplyOrder->setChecked(FALSE); _supplyOrderQty->clear(); _supplyOrderDueDate->clear(); _supplyOrderStatus->clear(); _onHand->clear(); _allocated->clear(); _unallocated->clear(); _onOrder->clear(); _available->clear(); _itemsrcp->clear(); _subs->clear(); _historyCosts->clear(); _historySales->clear(); _leadtime->clear(); _itemchar->removeRows(0, _itemchar->rowCount()); _notes->clear(); _sub->setChecked(false); _subItem->clear(); _subItem->setEnabled(false); _subItemList->setEnabled(false); _comments->setId(-1); _warehouse->clear(); // are these two _warehouse steps necessary? _warehouse->setType(WComboBox::Sold); _supplyOverridePrice->clear(); _originalQtyOrd = 0.0; _qtyOrderedCache = 0.0; _supplyOrderQtyCache = 0.0; _priceUOMCache = -1; _modified = false; _updateItemsite = false; _baseUnitPrice->clear(); _itemcharView->setEnabled(TRUE); _itemsrc = -1; _altRevAccnt->clear(); } void salesOrderItem::sSave() { XSqlQuery salesSave; _save->setFocus(); if (_metrics->boolean("AllowASAPShipSchedules") && !_scheduledDate->isValid()) _scheduledDate->setDate(QDate::currentDate()); _error = true; QList errors; errors << GuiErrorCheck(!_warehouse->isValid(), _warehouse, tr("

    You must select a valid Site before saving this Sales Order Item.")) << GuiErrorCheck(!(_qtyOrdered->toDouble() > 0), _qtyOrdered, tr("

    You must enter a valid Quantity Ordered before saving this Sales Order Item.")) << GuiErrorCheck((_qtyOrdered->toDouble() != (double)qRound(_qtyOrdered->toDouble()) && _qtyOrdered->validator()->inherits("QIntValidator")), _qtyOrdered, tr("This UOM for this Item does not allow fractional quantities. Please fix the quantity.")) << GuiErrorCheck(_netUnitPrice->isEmpty(), _netUnitPrice, tr("

    You must enter a Price before saving this Sales Order Item.")) << GuiErrorCheck(_sub->isChecked() && !_subItem->isValid(), _subItem, tr("

    You must enter a Substitute Item before saving this Sales Order Item.")) << GuiErrorCheck(!_scheduledDate->isValid(), _scheduledDate, tr("

    You must enter a valid Schedule Date before saving this Sales Order Item.")) << GuiErrorCheck(_createSupplyOrder->isChecked() && _item->itemType() == "M" && _supplyWarehouse->id() == -1, _supplyWarehouse, tr("

    Before an Order may be created, a valid Supplied at Site must be selected.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Sales Order Item"), errors)) return; // Make sure Qty Ordered/Qty UOM does not result in an invalid fractional Inv Qty if (!_invIsFractional) { if (qAbs((_qtyOrdered->toDouble() * _qtyinvuomratio) - (double)qRound(_qtyOrdered->toDouble() * _qtyinvuomratio)) > 0.01) { if (QMessageBox::question(this, tr("Change Qty Ordered?"), tr("This Qty Ordered/Qty UOM will result " "in a fractional Inventory Qty for " "this Item. This Item does not allow " "fractional quantities.\n" "Do you want to change the Qty Ordered?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { if (_qtyOrdered->validator()->inherits("QIntValidator")) _qtyOrdered->setDouble((double)qRound(_qtyOrdered->toDouble() * _qtyinvuomratio + 0.5) / _qtyinvuomratio, 0); else _qtyOrdered->setDouble((double)qRound(_qtyOrdered->toDouble() * _qtyinvuomratio + 0.5) / _qtyinvuomratio, 2); _qtyOrdered->setFocus(); return; } } } int itemsrcid = _itemsrc; if (_supplyOrderType == "P" && _createSupplyOrder->isChecked() && (_item->itemType() == "P") && ((_mode == cNew) || ((_mode == cEdit) && (_supplyOrderId == -1)))) { if ( _supplyDropShip->isChecked() && _shiptoid < 1) { QMessageBox::critical(this, tr("Cannot Save Sales Order Item"), tr("

    You must enter a valid Ship-To # before saving this Sales Order Item.")); return; } if (itemsrcid==-1) { XSqlQuery itemsrcdefault; itemsrcdefault.prepare("SELECT itemsrc_id FROM itemsrc " "WHERE ((itemsrc_item_id=:item_id) AND (itemsrc_default) AND (itemsrc_active)) "); itemsrcdefault.bindValue(":item_id", _item->id()); itemsrcdefault.exec(); if (itemsrcdefault.first()) { itemsrcid=(itemsrcdefault.value("itemsrc_id").toInt()); } else if (itemsrcdefault.lastError().type() != QSqlError::NoError) { systemError(this, itemsrcdefault.lastError().databaseText(), __FILE__, __LINE__); return; } else { ParameterList itemSourceParams; itemSourceParams.append("item_id", _item->id()); itemSourceParams.append("qty", _qtyOrdered->toDouble()); itemSourceList newdlg(omfgThis, "", TRUE); newdlg.set(itemSourceParams); itemsrcid = newdlg.exec(); } } } _error = false; QDate promiseDate; if (_metrics->boolean("UsePromiseDate")) { if (_promisedDate->isValid()) { if (_promisedDate->isNull()) promiseDate = omfgThis->endOfTime(); else promiseDate = _promisedDate->date(); } } else promiseDate = omfgThis->endOfTime(); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); // In case of failure along the way salesSave.exec("BEGIN;"); if (_mode == cNew) { salesSave.prepare( "INSERT INTO coitem " "( coitem_id, coitem_cohead_id, coitem_linenumber, coitem_itemsite_id," " coitem_status, coitem_scheddate, coitem_promdate," " coitem_qtyord, coitem_qty_uom_id, coitem_qty_invuomratio," " coitem_qtyshipped, coitem_qtyreturned," " coitem_unitcost, coitem_custprice, coitem_pricemode," " coitem_price, coitem_price_uom_id, coitem_price_invuomratio," " coitem_order_type, coitem_order_id," " coitem_custpn, coitem_memo, coitem_substitute_item_id," " coitem_prcost, coitem_taxtype_id, coitem_warranty," " coitem_cos_accnt_id, coitem_rev_accnt_id) " " SELECT :soitem_id, :soitem_sohead_id, :soitem_linenumber, itemsite_id," " 'O', :soitem_scheddate, :soitem_promdate," " :soitem_qtyord, :qty_uom_id, :qty_invuomratio, 0, 0," " :soitem_unitcost, :soitem_custprice, :soitem_pricemode," " :soitem_price, :price_uom_id, :price_invuomratio," " '', -1," " :soitem_custpn, :soitem_memo, :soitem_substitute_item_id," " :soitem_prcost, :soitem_taxtype_id, :soitem_warranty, " " :soitem_cos_accnt_id, :soitem_rev_accnt_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); salesSave.bindValue(":soitem_id", _soitemid); salesSave.bindValue(":soitem_sohead_id", _soheadid); salesSave.bindValue(":soitem_linenumber", _lineNumber->text().toInt()); salesSave.bindValue(":soitem_scheddate", _scheduledDate->date()); salesSave.bindValue(":soitem_promdate", promiseDate); salesSave.bindValue(":soitem_qtyord", _qtyOrdered->toDouble()); salesSave.bindValue(":qty_uom_id", _qtyUOM->id()); salesSave.bindValue(":qty_invuomratio", _qtyinvuomratio); salesSave.bindValue(":soitem_custprice", _customerPrice->localValue()); salesSave.bindValue(":soitem_unitcost", _unitCost->localValue()); salesSave.bindValue(":soitem_pricemode", _priceMode); salesSave.bindValue(":soitem_price", _netUnitPrice->localValue()); salesSave.bindValue(":price_uom_id", _priceUOM->id()); salesSave.bindValue(":price_invuomratio", _priceinvuomratio); salesSave.bindValue(":soitem_prcost", _supplyOverridePrice->localValue()); salesSave.bindValue(":soitem_custpn", _customerPN->text()); salesSave.bindValue(":soitem_memo", _notes->toPlainText()); salesSave.bindValue(":item_id", _item->id()); if (_sub->isChecked()) salesSave.bindValue(":soitem_substitute_item_id", _subItem->id()); salesSave.bindValue(":warehous_id", _warehouse->id()); if (_taxtype->isValid()) salesSave.bindValue(":soitem_taxtype_id", _taxtype->id()); if (_altCosAccnt->isValid()) salesSave.bindValue(":soitem_cos_accnt_id", _altCosAccnt->id()); if (_altRevAccnt->isValid()) salesSave.bindValue(":soitem_rev_accnt_id", _altRevAccnt->id()); salesSave.bindValue(":soitem_warranty",QVariant(_warranty->isChecked())); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (_mode == cEdit) { salesSave.prepare( "UPDATE coitem " "SET coitem_scheddate=:soitem_scheddate," " coitem_promdate=:soitem_promdate," " coitem_qtyord=:soitem_qtyord," " coitem_qty_uom_id=:qty_uom_id," " coitem_qty_invuomratio=:qty_invuomratio," " coitem_unitcost=:soitem_unitcost," " coitem_custprice=:soitem_custprice," " coitem_pricemode=:soitem_pricemode," " coitem_price=:soitem_price," " coitem_price_uom_id=:price_uom_id," " coitem_price_invuomratio=:price_invuomratio," " coitem_memo=:soitem_memo," " coitem_order_type=:soitem_order_type," " coitem_order_id=:soitem_order_id," " coitem_substitute_item_id=:soitem_substitute_item_id," " coitem_prcost=:soitem_prcost," " coitem_taxtype_id=:soitem_taxtype_id, " " coitem_cos_accnt_id=:soitem_cos_accnt_id, " " coitem_rev_accnt_id=:soitem_rev_accnt_id, " " coitem_warranty=:soitem_warranty " "WHERE (coitem_id=:soitem_id);" ); salesSave.bindValue(":soitem_scheddate", _scheduledDate->date()); salesSave.bindValue(":soitem_promdate", promiseDate); salesSave.bindValue(":soitem_qtyord", _qtyOrdered->toDouble()); salesSave.bindValue(":qty_uom_id", _qtyUOM->id()); salesSave.bindValue(":qty_invuomratio", _qtyinvuomratio); salesSave.bindValue(":soitem_unitcost", _unitCost->localValue()); salesSave.bindValue(":soitem_custprice", _customerPrice->localValue()); salesSave.bindValue(":soitem_price", _netUnitPrice->localValue()); salesSave.bindValue(":soitem_pricemode", _priceMode); salesSave.bindValue(":price_uom_id", _priceUOM->id()); salesSave.bindValue(":price_invuomratio", _priceinvuomratio); salesSave.bindValue(":soitem_prcost", _supplyOverridePrice->localValue()); salesSave.bindValue(":soitem_memo", _notes->toPlainText()); if (_supplyOrderId != -1) salesSave.bindValue(":soitem_order_type", _supplyOrderType); salesSave.bindValue(":soitem_order_id", _supplyOrderId); salesSave.bindValue(":soitem_id", _soitemid); if (_sub->isChecked()) salesSave.bindValue(":soitem_substitute_item_id", _subItem->id()); if (_taxtype->isValid()) salesSave.bindValue(":soitem_taxtype_id", _taxtype->id()); if (_altCosAccnt->isValid()) salesSave.bindValue(":soitem_cos_accnt_id", _altCosAccnt->id()); if (_altRevAccnt->isValid()) salesSave.bindValue(":soitem_rev_accnt_id", _altRevAccnt->id()); salesSave.bindValue(":soitem_warranty",QVariant(_warranty->isChecked())); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } // Check to see if a Reservations need changes if (_qtyOrdered->toDouble() < _qtyOrderedCache) { if (_qtyreserved > 0.0) { QMessageBox::warning( this, tr("Unreserve Sales Order Item"), tr("

    The quantity ordered for this Sales " "Order Line Item has been changed. " "Reservations have been removed.") ); salesSave.prepare("SELECT unreserveSoLineQty(:soitem_id) AS result;"); salesSave.bindValue(":soitem_id", _soitemid); salesSave.exec(); if (salesSave.first()) { int result = salesSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("unreservedSoLineQty", result) + tr("
    Line Item %1").arg(""), __FILE__, __LINE__); } } else if (salesSave.lastError().type() != QSqlError::NoError) { systemError(this, tr("Line Item %1\n").arg("") + salesSave.lastError().databaseText(), __FILE__, __LINE__); } } } // Check to see if a W/O needs changes if (_supplyOrderId != -1) { if (_supplyOrderDueDate->date() != _supplyOrderDueDateCache) { if (_supplyOrderType == "W") { if (QMessageBox::question(this, tr("Reschedule Work Order?"), tr("

    The Supply Order Due Date for this Line Item has changed." "

    Should the W/O for this Line Item be rescheduled?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { salesSave.prepare("SELECT changeWoDates(:wo_id, wo_startdate + (:dueDate-wo_duedate), :dueDate, TRUE) AS result " "FROM wo " "WHERE (wo_id=:wo_id);"); salesSave.bindValue(":wo_id", _supplyOrderId); salesSave.bindValue(":dueDate", _supplyOrderDueDate->date()); salesSave.exec(); if (salesSave.first()) { int result = salesSave.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("changeWoDates", result), __FILE__, __LINE__); return; } _cScheduledDate=_scheduledDate->date(); } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } if (_supplyOrderType == "R") { if (QMessageBox::question(this, tr("Reschedule P/R?"), tr("

    The Supply Order Due Date for this Line Item has changed." "

    Should the P/R for this Line Item be rescheduled?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { salesSave.prepare("SELECT changePrDate(:pr_id, :dueDate) AS result;"); salesSave.bindValue(":pr_id", _supplyOrderId); salesSave.bindValue(":dueDate", _supplyOrderDueDate->date()); salesSave.exec(); if (salesSave.first()) { int result = salesSave.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("changePrDate", result), __FILE__, __LINE__); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } if (_supplyOrderType == "P") { salesSave.prepare("SELECT * FROM poitem JOIN coitem ON (coitem_order_id = poitem_id) " "WHERE ((coitem_id = :soitem_id) " " AND (coitem_order_type='P'));" ); salesSave.bindValue(":soitem_id", _soitemid); salesSave.exec(); if (salesSave.first()) { if (salesSave.value("poitem_status").toString()== "C") { rollback.exec(); QMessageBox::critical(this, tr("Quantity Can Not be Updated"), tr(" The Purchase Order Item this Sales " " Order Item is linked to is closed. " " The quantity may not be updated. ")); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (QMessageBox::question(this, tr("Reschedule P/O?"), tr("

    The Supply Order Due Date for this Line Item has changed." "

    Should the P/O for this Line Item be rescheduled?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { salesSave.prepare("SELECT changePoitemDueDate(:poitem_id, :dueDate, true) AS result;"); salesSave.bindValue(":poitem_id", _supplyOrderId); salesSave.bindValue(":dueDate", _supplyOrderDueDate->date()); salesSave.exec(); if (salesSave.first()) { int result = salesSave.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("changePoDate", result), __FILE__, __LINE__); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } } if (_supplyOrderQty->toDouble() != _supplyOrderQtyCache) { if (_supplyOrderType == "W") { if (QMessageBox::question(this, tr("Change Work Order Quantity?"), tr("

    The Supply Order Quantity for this Line Item has changed " "from %1 to %2." "

    Should the W/O quantity for this Line Item be changed?") .arg(_supplyOrderQtyCache).arg(_supplyOrderQty->toDouble()), QMessageBox::No | QMessageBox::Escape, QMessageBox::Yes | QMessageBox::Default) == QMessageBox::Yes) { salesSave.prepare("SELECT changeWoQty(:wo_id, :qty, TRUE) AS result;"); salesSave.bindValue(":wo_id", _supplyOrderId); salesSave.bindValue(":qty", _supplyOrderQty->toDouble()); salesSave.exec(); if (salesSave.first()) { int result = salesSave.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("changeWoQty", result), __FILE__, __LINE__); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (_supplyOrderType == "R") { if (QMessageBox::question(this, tr("Change P/R Quantity?"), tr("

    The Supply Order Quantity for this Line Item has changed " "from %1 to %2." "

    Should the P/R quantity for this Line Item be changed?") .arg(_supplyOrderQtyCache).arg(_supplyOrderQty->toDouble()), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { salesSave.prepare("SELECT changePrQty(:pr_id, :qty) AS result;"); salesSave.bindValue(":pr_id", _supplyOrderId); salesSave.bindValue(":qty", _supplyOrderQty->toDouble()); salesSave.exec(); if (salesSave.first()) { bool result = salesSave.value("result").toBool(); if (!result) { rollback.exec(); systemError(this, tr("changePrQty failed"), __FILE__, __LINE__); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (_supplyOrderType == "P") { if (QMessageBox::question(this, tr("Change P/O Quantity?"), tr("

    The Supply Order Quantity for this Line Item has changed " "from %1 to %2." "

    Should the P/O quantity for this Line Item be changed?") .arg(_supplyOrderQtyCache).arg(_supplyOrderQty->toDouble()), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { salesSave.prepare("SELECT changePoitemQty(:poitem_id, :qty, true) AS result;"); salesSave.bindValue(":poitem_id", _supplyOrderId); salesSave.bindValue(":qty", _supplyOrderQty->toDouble()); salesSave.exec(); if (salesSave.first()) { bool result = salesSave.value("result").toBool(); if (!result) { rollback.exec(); systemError(this, tr("changePoQty failed"), __FILE__, __LINE__); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } } } // Update Supply Order Characteristics if (_itemchar->rowCount() > 0) { bool changed = false; XSqlQuery chgq; chgq.prepare("SELECT (charass_value=:value) AS same" " FROM charass" " WHERE ((charass_char_id=:id)" " AND (charass_target_id=:target)" " AND (charass_target_type='SI'));"); for (int i = 0; i < _itemchar->rowCount(); i++) { chgq.bindValue(":id", _itemchar->data(_itemchar->index(i, CHAR_ID), Qt::UserRole)); chgq.bindValue(":value", _itemchar->data(_itemchar->index(i, CHAR_VALUE))); chgq.bindValue(":target", _soitemid); if (chgq.exec() && chgq.first() && ! chgq.value("same").toBool()) { changed = true; break; } else if (chgq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Checking Characteristics"), chgq, __FILE__, __LINE__); return; } } if (changed && QMessageBox::question(this, tr("Change Characteristics?"), tr("

    Should the characteristics for the " "associated supply order be updated?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { QModelIndex idx1, idx2; salesSave.prepare("SELECT updateCharAssignment(:target_type, :target_id, :char_id, :char_value) AS result;"); for (int i = 0; i < _itemchar->rowCount(); i++) { idx1 = _itemchar->index(i, CHAR_ID); idx2 = _itemchar->index(i, CHAR_VALUE); if (_supplyOrderType == "P") salesSave.bindValue(":target_type", "PI"); else salesSave.bindValue(":target_type", "W"); salesSave.bindValue(":target_id", _supplyOrderId); salesSave.bindValue(":char_id", _itemchar->data(idx1, Qt::UserRole)); salesSave.bindValue(":char_value", _itemchar->data(idx2, Qt::DisplayRole)); salesSave.exec(); if (salesSave.first()) { int result = salesSave.value("result").toInt(); if (result < 0) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error with Characteristics"), storedProcErrorLookup("updateCharAssignment", result), __FILE__, __LINE__); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error with Characteristics"), salesSave, __FILE__, __LINE__); return; } } } } _qtyOrderedCache = _qtyOrdered->toDouble(); } else if (_mode == cNewQuote) { // Grab the next quitem_id salesSave.exec("SELECT NEXTVAL('quitem_quitem_id_seq') AS _quitem_id"); if (salesSave.first()) _soitemid = salesSave.value("_quitem_id").toInt(); else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } else { rollback.exec(); reject(); return; } salesSave.prepare( "INSERT INTO quitem " "( quitem_id, quitem_quhead_id, quitem_linenumber, quitem_itemsite_id," " quitem_item_id, quitem_scheddate, quitem_promdate, quitem_qtyord," " quitem_qty_uom_id, quitem_qty_invuomratio," " quitem_unitcost, quitem_custprice, quitem_price, quitem_pricemode," " quitem_price_uom_id, quitem_price_invuomratio," " quitem_custpn, quitem_memo, quitem_createorder, " " quitem_order_warehous_id, quitem_prcost, quitem_taxtype_id, " " quitem_dropship, quitem_itemsrc_id ) " "VALUES(:quitem_id, :quitem_quhead_id, :quitem_linenumber," " (SELECT itemsite_id FROM itemsite WHERE ((itemsite_item_id=:item_id) AND (itemsite_warehous_id=:warehous_id)))," " :item_id, :quitem_scheddate, :quitem_promdate, :quitem_qtyord," " :qty_uom_id, :qty_invuomratio," " :quitem_unitcost, :quitem_custprice, :quitem_price, :quitem_pricemode," " :price_uom_id, :price_invuomratio," " :quitem_custpn, :quitem_memo, :quitem_createorder, " " :quitem_order_warehous_id, :quitem_prcost, :quitem_taxtype_id, " " :quitem_dropship, :quitem_itemsrc_id);" ); salesSave.bindValue(":quitem_id", _soitemid); salesSave.bindValue(":quitem_quhead_id", _soheadid); salesSave.bindValue(":quitem_linenumber", _lineNumber->text().toInt()); salesSave.bindValue(":quitem_scheddate", _scheduledDate->date()); salesSave.bindValue(":quitem_promdate", promiseDate); salesSave.bindValue(":quitem_qtyord", _qtyOrdered->toDouble()); salesSave.bindValue(":qty_uom_id", _qtyUOM->id()); salesSave.bindValue(":qty_invuomratio", _qtyinvuomratio); salesSave.bindValue(":quitem_unitcost", _unitCost->localValue()); salesSave.bindValue(":quitem_custprice", _customerPrice->localValue()); salesSave.bindValue(":quitem_price", _netUnitPrice->localValue()); salesSave.bindValue(":quitem_pricemode", _priceMode); salesSave.bindValue(":price_uom_id", _priceUOM->id()); salesSave.bindValue(":price_invuomratio", _priceinvuomratio); salesSave.bindValue(":quitem_custpn", _customerPN->text()); salesSave.bindValue(":quitem_memo", _notes->toPlainText()); salesSave.bindValue(":quitem_createorder", QVariant(_createSupplyOrder->isChecked())); salesSave.bindValue(":quitem_order_warehous_id", _supplyWarehouse->id()); salesSave.bindValue(":quitem_prcost", _supplyOverridePrice->localValue()); salesSave.bindValue(":item_id", _item->id()); salesSave.bindValue(":warehous_id", _warehouse->id()); if (_taxtype->isValid()) salesSave.bindValue(":quitem_taxtype_id", _taxtype->id()); salesSave.bindValue(":quitem_dropship", QVariant(_supplyDropShip->isChecked())); if (itemsrcid > 0) salesSave.bindValue(":quitem_itemsrc_id", itemsrcid); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (_mode == cEditQuote) { salesSave.prepare( "UPDATE quitem " "SET quitem_scheddate=:quitem_scheddate," " quitem_promdate=:quitem_promdate," " quitem_qtyord=:quitem_qtyord," " quitem_qty_uom_id=:qty_uom_id," " quitem_qty_invuomratio=:qty_invuomratio," " quitem_unitcost=:quitem_unitcost," " quitem_custprice=:quitem_custprice," " quitem_price=:quitem_price," " quitem_pricemode=:quitem_pricemode," " quitem_price_uom_id=:price_uom_id," " quitem_price_invuomratio=:price_invuomratio," " quitem_memo=:quitem_memo," " quitem_createorder=:quitem_createorder," " quitem_order_warehous_id=:quitem_order_warehous_id," " quitem_prcost=:quitem_prcost," " quitem_taxtype_id=:quitem_taxtype_id," " quitem_dropship=:quitem_dropship," " quitem_itemsrc_id=:quitem_itemsrc_id " "WHERE (quitem_id=:quitem_id);" ); salesSave.bindValue(":quitem_scheddate", _scheduledDate->date()); salesSave.bindValue(":quitem_promdate", promiseDate); salesSave.bindValue(":quitem_qtyord", _qtyOrdered->toDouble()); salesSave.bindValue(":qty_uom_id", _qtyUOM->id()); salesSave.bindValue(":qty_invuomratio", _qtyinvuomratio); salesSave.bindValue(":quitem_unitcost", _unitCost->localValue()); salesSave.bindValue(":quitem_custprice", _customerPrice->localValue()); salesSave.bindValue(":quitem_price", _netUnitPrice->localValue()); salesSave.bindValue(":quitem_pricemode", _priceMode); salesSave.bindValue(":price_uom_id", _priceUOM->id()); salesSave.bindValue(":price_invuomratio", _priceinvuomratio); salesSave.bindValue(":quitem_memo", _notes->toPlainText()); salesSave.bindValue(":quitem_createorder", QVariant(_createSupplyOrder->isChecked())); salesSave.bindValue(":quitem_order_warehous_id", _supplyWarehouse->id()); salesSave.bindValue(":quitem_prcost", _supplyOverridePrice->localValue()); salesSave.bindValue(":quitem_id", _soitemid); if (_taxtype->isValid()) salesSave.bindValue(":quitem_taxtype_id", _taxtype->id()); salesSave.bindValue(":quitem_dropship", QVariant(_supplyDropShip->isChecked())); if (itemsrcid > 0) salesSave.bindValue(":quitem_itemsrc_id", itemsrcid); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_updateItemsite) { salesSave.prepare("UPDATE quitem " " SET quitem_itemsite_id=(SELECT itemsite_id FROM itemsite WHERE ((itemsite_item_id=quitem_item_id) AND (itemsite_warehous_id=:warehous_id)))" " WHERE (quitem_id=:quitem_id);" ); salesSave.bindValue(":warehous_id", _warehouse->id()); salesSave.bindValue(":quitem_id", _soitemid); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } if ( (_mode != cView) && (_mode != cViewQuote) ) { QString type = "SI"; if (_mode & 0x20) type = "QI"; QModelIndex idx1, idx2, idx3; if (_item->isConfigured()) salesSave.prepare("SELECT updateCharAssignment(:target_type, :target_id, :char_id, :char_value, CAST(:char_price AS NUMERIC)) AS result;"); else salesSave.prepare("SELECT updateCharAssignment(:target_type, :target_id, :char_id, :char_value) AS result;"); for (int i = 0; i < _itemchar->rowCount(); i++) { idx1 = _itemchar->index(i, CHAR_ID); idx2 = _itemchar->index(i, CHAR_VALUE); idx3 = _itemchar->index(i, CHAR_PRICE); salesSave.bindValue(":target_type", type); salesSave.bindValue(":target_id", _soitemid); salesSave.bindValue(":char_id", _itemchar->data(idx1, Qt::UserRole)); salesSave.bindValue(":char_value", _itemchar->data(idx2, Qt::DisplayRole)); salesSave.bindValue(":char_price", _itemchar->data(idx3, Qt::DisplayRole)); salesSave.exec(); if (salesSave.first()) { int result = salesSave.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("updateCharAssignment", result), __FILE__, __LINE__); return; } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } // If requested, create a new W/O or P/R for this coitem if ( ( (_mode == cNew) || (_mode == cEdit) ) && (_createSupplyOrder->isChecked()) && (_supplyOrderId == -1) ) { QString chartype; if (_item->itemType() == "M") { salesSave.prepare( "SELECT createWo(:orderNumber, itemsite_id, :qty, itemsite_leadtime, :dueDate, :comments, :parent_type, :parent_id ) AS result, itemsite_id " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); salesSave.bindValue(":orderNumber", _orderNumber->text().toInt()); salesSave.bindValue(":qty", _supplyOrderQty->toDouble()); salesSave.bindValue(":dueDate", _supplyOrderDueDate->date()); salesSave.bindValue(":comments", _custName + "\n" + _notes->toPlainText()); salesSave.bindValue(":item_id", _item->id()); salesSave.bindValue(":warehous_id", _supplyWarehouse->id()); salesSave.bindValue(":parent_type", QString("S")); salesSave.bindValue(":parent_id", _soitemid); salesSave.exec(); } else if ((_item->itemType() == "P") && _supplyOrderType == "P") { salesSave.prepare("SELECT createPurchaseToSale(:soitem_id, :itemsrc_id, :drop_ship," " :qty, :duedate, :price) AS result;"); salesSave.bindValue(":soitem_id", _soitemid); salesSave.bindValue(":itemsrc_id", itemsrcid); salesSave.bindValue(":drop_ship", _supplyDropShip->isChecked()); salesSave.bindValue(":qty", _supplyOrderQty->toDouble()); salesSave.bindValue(":duedate", _supplyOrderDueDate->date()); if (_supplyOverridePrice->localValue() > 0.00) salesSave.bindValue(":price", _supplyOverridePrice->localValue()); salesSave.exec(); } else if (_item->itemType() == "P") { salesSave.prepare("SELECT createPr(:orderNumber, 'S', :soitem_id) AS result;"); salesSave.bindValue(":orderNumber", _orderNumber->text().toInt()); salesSave.bindValue(":soitem_id", _soitemid); salesSave.exec(); } if (salesSave.first()) { _supplyOrderId = salesSave.value("result").toInt(); if (_supplyOrderId < 0) { rollback.exec(); QString procname; if (_item->itemType() == "M") procname = "createWo"; else if ((_item->itemType() == "P") && _supplyOrderType == "R") procname = "createPr"; else if ((_item->itemType() == "P") && _supplyOrderType == "P") procname = "createPurchaseToSale"; else procname = "unnamed stored procedure"; systemError(this, storedProcErrorLookup(procname, _supplyOrderId), __FILE__, __LINE__); return; } if (_item->itemType() == "M") { omfgThis->sWorkOrdersUpdated(_supplyOrderId, TRUE); // Update the newly created coitem with the newly create wo_id salesSave.prepare( "UPDATE coitem " "SET coitem_order_type='W', coitem_order_id=:orderid " "WHERE (coitem_id=:soitem_id);" ); salesSave.bindValue(":orderid", _supplyOrderId); salesSave.bindValue(":soitem_id", _soitemid); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } salesSave.prepare("INSERT INTO charass" " (charass_target_type, charass_target_id," " charass_char_id, charass_value) " "SELECT 'W', :orderid, charass_char_id, charass_value" " FROM charass" " WHERE ((charass_target_type='SI')" " AND (charass_target_id=:soitem_id));"); salesSave.bindValue(":orderid", _supplyOrderId); salesSave.bindValue(":soitem_id", _soitemid); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } else if ((_item->itemType() == "P") && _supplyOrderType == "R") { // Update the newly created coitem with the newly pr_id salesSave.prepare( "UPDATE coitem " "SET coitem_order_type='R', coitem_order_id=:orderid " "WHERE (coitem_id=:soitem_id);" ); salesSave.bindValue(":orderid", _supplyOrderId); salesSave.bindValue(":soitem_id", _soitemid); salesSave.exec(); if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } else if (salesSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, salesSave.lastError().databaseText(), __FILE__, __LINE__); return; } } salesSave.exec("COMMIT;"); if (_mode == cNew) omfgThis->sSalesOrdersUpdated(_soheadid); else if (_mode == cNewQuote) omfgThis->sQuotesUpdated(_soheadid); if ( (!_canceling) && (cNew == _mode || cNewQuote == _mode) ) { clear(); prepare(); _prev->setEnabled(true); _item->setFocus(); } _modified = false; } void salesOrderItem::sPopulateItemsiteInfo() { if (_item->isValid()) { XSqlQuery itemsite; itemsite.prepare( "SELECT itemsite_leadtime, itemsite_costmethod, itemsite_createsopo, " " itemsite_createwo, itemsite_createsopr, " " item_listcost, itemCost(itemsite_id) AS unitcost " "FROM itemsite JOIN item ON (item_id=itemsite_item_id) " "WHERE ( (itemsite_warehous_id=:warehous_id)" " AND (itemsite_item_id=:item_id) );" ); itemsite.bindValue(":warehous_id", _warehouse->id()); itemsite.bindValue(":item_id", _item->id()); itemsite.exec(); if (itemsite.first()) { _leadTime = itemsite.value("itemsite_leadtime").toInt(); _costmethod = itemsite.value("itemsite_costmethod").toString(); if (_metrics->boolean("WholesalePriceCosting")) _unitCost->setBaseValue(itemsite.value("item_listcost").toDouble() * (_priceinvuomratio / _priceRatio)); else _unitCost->setBaseValue(itemsite.value("unitcost").toDouble() * (_priceinvuomratio / _priceRatio)); if (cNew == _mode || cNewQuote == _mode) { if (_costmethod == "J") { _createSupplyOrder->setChecked(TRUE); _createSupplyOrder->setEnabled(FALSE); } else if (_item->itemType() == "M") _createSupplyOrder->setChecked(itemsite.value("itemsite_createwo").toBool()); else if (_item->itemType() == "P") { if (itemsite.value("itemsite_createsopo").toBool()) { _supplyOrderType = "P"; _createSupplyOrder->setChecked(true); _createSupplyOrder->setTitle(tr("Create Purchase Order")); _supplyOrderStatusLit->show(); _supplyOverridePrice->show(); _supplyOverridePriceLit->show(); if (_metrics->boolean("EnableDropShipments")) { _supplyDropShip->show(); _supplyDropShip->setChecked(itemsite.value("itemsite_dropship").toBool()); } } else if (itemsite.value("itemsite_createsopr").toBool()) { _supplyOrderType = "R"; _createSupplyOrder->setChecked(true); } } else { _createSupplyOrder->setChecked(FALSE); _createSupplyOrder->setEnabled(FALSE); } } } else if (itemsite.lastError().type() != QSqlError::NoError) { systemError(this, itemsite.lastError().databaseText(), __FILE__, __LINE__); return; } } } void salesOrderItem::sListPrices() { ParameterList params; params.append("cust_id", _custid); params.append("shipto_id", _shiptoid); params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); params.append("qty", _qtyOrdered->toDouble() * _qtyinvuomratio); params.append("curr_id", _netUnitPrice->id()); params.append("effective", _netUnitPrice->effective()); if (_metrics->value("soPriceEffective") == "OrderDate") params.append("asof", _netUnitPrice->effective()); else if (_metrics->value("soPriceEffective") == "ScheduleDate" && _scheduledDate->isValid()) params.append("asof", _scheduledDate->date()); else params.append("asof", omfgThis->dbDate()); priceList newdlg(this); newdlg.set(params); if ( (newdlg.exec() == XDialog::Accepted) && (_privileges->check("OverridePrice")) && (!_metrics->boolean("DisableSalesOrderPriceOverride")) ) { _netUnitPrice->setLocalValue(newdlg._selectedPrice * (_priceinvuomratio / _priceRatio)); sCalculateDiscountPrcnt(); } } void salesOrderItem::sRecalcPrice() { sDeterminePrice(true); } void salesOrderItem::sDeterminePrice() { XSqlQuery salesDeterminePrice; sDeterminePrice(false); } void salesOrderItem::sDeterminePrice(bool force) { XSqlQuery salesDeterminePrice; // Determine if we can or should update the price if ( _mode == cView || _mode == cViewQuote || !_item->isValid() || _qtyOrdered->text().isEmpty() || _qtyUOM->id() < 0 || _priceUOM->id() < 0 || ( !force && _qtyOrdered->toDouble() == _qtyOrderedCache && ( _metrics->value("soPriceEffective") != "ScheduleDate" || ( !_scheduledDate->isValid() || _scheduledDate->date() == _scheduledDateCache) ) ) ) return; double charTotal =0; bool dateChanged =(_scheduledDateCache != _scheduledDate->date()); bool qtyChanged =(_qtyOrderedCache != _qtyOrdered->toDouble()); bool priceUOMChanged =(_priceUOMCache != _priceUOM->id()); QDate asOf; if (_metrics->value("soPriceEffective") == "ScheduleDate") asOf = _scheduledDate->date(); else if (_metrics->value("soPriceEffective") == "OrderDate") asOf = _netUnitPrice->effective(); else asOf = omfgThis->dbDate(); // Okay, we'll update customer price for sure, but how about net unit price? if ( _mode == cEdit || _mode == cEditQuote) { if ( _customerPrice->localValue() != _netUnitPrice->localValue() && ( _metrics->boolean("IgnoreCustDisc") || ( _metrics->value("UpdatePriceLineEdit").toInt() == iDontUpdate && !force) ) ) _updatePrice = false; else if ( _metrics->value("UpdatePriceLineEdit").toInt() != iJustUpdate) { QString token(tr("Characteristic")); if (dateChanged) token=tr("Scheduled Date"); if (qtyChanged) token=tr("Item quantity"); if (priceUOMChanged) token=tr("Price UOM"); if (QMessageBox::question(this, tr("Update Price?"), tr("

    The %1 has changed. Do you want to update the Price?").arg(token), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::No) _updatePrice = false; } } // Go get the new price information // For configured items, update characteristic pricing if ( _item->isConfigured() ) { disconnect(_itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcPrice())); _charVars.replace(QTY, _qtyOrdered->toDouble() * _qtyinvuomratio); QModelIndex idx1, idx2, idx3; salesDeterminePrice.prepare("SELECT itemcharprice(:item_id,:char_id,:value,:cust_id,:shipto_id,:qty,:curr_id,:effective,:asof)::numeric(16,4) AS price;"); for (int i = 0; i < _itemchar->rowCount(); i++) { idx1 = _itemchar->index(i, CHAR_ID); idx2 = _itemchar->index(i, CHAR_VALUE); idx3 = _itemchar->index(i, CHAR_PRICE); salesDeterminePrice.bindValue(":item_id", _item->id()); salesDeterminePrice.bindValue(":char_id", _itemchar->data(idx1, Qt::UserRole)); salesDeterminePrice.bindValue(":value", _itemchar->data(idx2, Qt::DisplayRole)); salesDeterminePrice.bindValue(":cust_id", _custid); salesDeterminePrice.bindValue(":shipto_id", _shiptoid); salesDeterminePrice.bindValue(":qty", _qtyOrdered->toDouble() * _qtyinvuomratio); salesDeterminePrice.bindValue(":curr_id", _customerPrice->id()); salesDeterminePrice.bindValue(":effective", _customerPrice->effective()); salesDeterminePrice.bindValue(":asof", asOf); salesDeterminePrice.exec(); if (salesDeterminePrice.first()) { _itemchar->setData(idx3, salesDeterminePrice.value("price").toString(), Qt::DisplayRole); _itemchar->setData(idx3, QVariant(_charVars), Qt::UserRole); } else if (salesDeterminePrice.lastError().type() != QSqlError::NoError) { systemError(this, salesDeterminePrice.lastError().databaseText(), __FILE__, __LINE__); return; } } connect(_itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcPrice())); // Total up price for configured item characteristics QModelIndex idx; for (int i = 0; i < _itemchar->rowCount(); i++) { idx = _itemchar->index(i, CHAR_PRICE); charTotal += _itemchar->data(idx, Qt::DisplayRole).toDouble(); } } // Now get item price information XSqlQuery itemprice; itemprice.prepare( "SELECT * FROM " "itemIpsPrice(:item_id, :cust_id, :shipto_id, :qty, :qtyUOM, :priceUOM," " :curr_id, :effective, :asof, :warehouse);" ); itemprice.bindValue(":cust_id", _custid); itemprice.bindValue(":shipto_id", _shiptoid); itemprice.bindValue(":qty", _qtyOrdered->toDouble()); itemprice.bindValue(":qtyUOM", _qtyUOM->id()); itemprice.bindValue(":priceUOM", _priceUOM->id()); itemprice.bindValue(":item_id", _item->id()); itemprice.bindValue(":curr_id", _customerPrice->id()); itemprice.bindValue(":effective", _customerPrice->effective()); itemprice.bindValue(":asof", asOf); itemprice.bindValue(":warehouse", _warehouse->id()); itemprice.exec(); if (itemprice.first()) { if (itemprice.value("itemprice_price").toDouble() == -9999.0) { if (!_updatePrice) return; // User expected an update, so let them know and reset QMessageBox::critical(this, tr("Customer Cannot Buy at Quantity"), tr("

    This item is marked as exclusive and " "no qualifying price schedule was found. " "You may click on the price list button " "(...) next to the Unit Price to determine " "if there is a minimum quantity the selected " "Customer may purchase." ) ); _originalQtyOrd = 0.0; _customerPrice->clear(); _netUnitPrice->clear(); if (qtyChanged) { _qtyOrdered->clear(); _qtyOrdered->setFocus(); } else { _scheduledDate->clear(); _scheduledDate->setFocus(); } } else { double price = itemprice.value("itemprice_price").toDouble(); _priceType = itemprice.value("itemprice_type").toString(); if (_priceType == "N" || _priceType == "D" || _priceType == "P") // nominal, discount, or list price _priceMode = "D"; else // markup or list cost _priceMode = "M"; _baseUnitPrice->setLocalValue(price); _customerPrice->setLocalValue(price + charTotal); if (_updatePrice) // Configuration or user said they also want net unit price updated _netUnitPrice->setLocalValue(price + charTotal); sCalculateDiscountPrcnt(); _qtyOrderedCache = _qtyOrdered->toDouble(); _priceUOMCache = _priceUOM->id(); _scheduledDateCache = _scheduledDate->date(); } } else if (itemprice.lastError().type() != QSqlError::NoError) systemError(this, itemprice.lastError().databaseText(), __FILE__, __LINE__); } void salesOrderItem::sPopulateItemInfo(int pItemid) { XSqlQuery salesPopulateItemInfo; _itemchar->removeRows(0, _itemchar->rowCount()); if (pItemid != -1) { XSqlQuery uom; uom.prepare("SELECT uom_id, uom_name" " FROM item" " JOIN uom ON (item_inv_uom_id=uom_id)" " WHERE(item_id=:item_id)" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_to_uom_id=uom_id)" " WHERE((itemuomconv_from_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_from_uom_id=uom_id)" " WHERE((itemuomconv_to_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " ORDER BY uom_name;"); uom.bindValue(":item_id", _item->id()); uom.exec(); _qtyUOM->populate(uom); _priceUOM->populate(uom); // Grab the price for this item/customer/qty salesPopulateItemInfo.prepare( "SELECT item_type, item_config, uom_name," " item_inv_uom_id, item_price_uom_id," " iteminvpricerat(item_id) AS invpricerat," " item_listprice, item_fractional," " itemsite_createsopo, itemsite_dropship, itemsite_costmethod," " getItemTaxType(item_id, :taxzone) AS taxtype_id " "FROM item JOIN uom ON (item_inv_uom_id=uom_id)" "LEFT OUTER JOIN itemsite ON ((itemsite_item_id=item_id) AND (itemsite_warehous_id=:warehous_id)) " "WHERE (item_id=:item_id);" ); salesPopulateItemInfo.bindValue(":item_id", pItemid); salesPopulateItemInfo.bindValue(":warehous_id", _warehouse->id()); salesPopulateItemInfo.bindValue(":taxzone", _taxzoneid); salesPopulateItemInfo.exec(); if (salesPopulateItemInfo.first()) { if (salesPopulateItemInfo.value("itemsite_createsopo").toBool()) { _supplyOrderType = "P"; _createSupplyOrder->setTitle(tr("Create Purchase Order")); _supplyOrderStatusLit->show(); _supplyOverridePrice->show(); _supplyOverridePriceLit->show(); if (_metrics->boolean("EnableDropShipments")) { _supplyDropShip->show(); _supplyDropShip->setChecked(salesPopulateItemInfo.value("itemsite_dropship").toBool()); } if (_mode == cNew || (ISQUOTE(_mode))) { _supplyOrderLit->hide(); _supplyOrder->hide(); _supplyOrderLineLit->hide(); _supplyOrderLine->hide(); _supplyOrderStatus->hide(); _supplyOrderStatusLit->hide(); } XSqlQuery itemsrc; itemsrc.prepare("SELECT itemsrc_id, itemsrc_item_id " "FROM itemsrc " "WHERE (itemsrc_item_id = :item_id) " " AND (itemsrc_active) " "LIMIT 1;"); itemsrc.bindValue(":item_id", _item->id()); itemsrc.exec(); if (itemsrc.first()) ; // do nothing else if (itemsrc.lastError().type() != QSqlError::NoError) { systemError(this, itemsrc.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::warning( this, tr("Cannot Create P/O"), tr("

    Purchase Orders cannot be automatically " "created for this Item as there are no Item " "Sources for it. You must create one or " "more Item Sources for this Item before " "the application can automatically create " "Purchase Orders for it." ) ); _createSupplyOrder->setChecked(FALSE); _createSupplyOrder->setEnabled(FALSE); } if (_metrics->boolean("EnableDropShipments") && (_mode == cEdit)) { XSqlQuery dropship; dropship.prepare("SELECT pohead_dropship " "FROM pohead JOIN poitem ON (pohead_id = poitem_pohead_id) " " RIGHT OUTER JOIN coitem ON (poitem_id = coitem_order_id) " "WHERE ((coitem_id = :soitem_id) " " AND (coitem_order_type='P'));" ); dropship.bindValue(":soitem_id", _soitemid); dropship.exec(); if (dropship.first()) _supplyDropShip->setChecked(dropship.value("pohead_dropship").toBool()); else if (dropship.lastError().type() != QSqlError::NoError) { systemError(this, dropship.lastError().databaseText(), __FILE__, __LINE__); return; } } } if (_mode == cNew) sDeterminePrice(); _priceRatio = salesPopulateItemInfo.value("invpricerat").toDouble(); // Always ratio from default price uom _invuomid = salesPopulateItemInfo.value("item_inv_uom_id").toInt(); _invIsFractional = salesPopulateItemInfo.value("item_fractional").toBool(); _priceinvuomratio = _priceRatio; // the ration from the currently selected price uom _qtyinvuomratio = 1.0; _qtyUOM->setId(salesPopulateItemInfo.value("item_inv_uom_id").toInt()); _priceUOM->setId(salesPopulateItemInfo.value("item_price_uom_id").toInt()); _listPrice->setBaseValue(salesPopulateItemInfo.value("item_listprice").toDouble()); _taxtype->setId(salesPopulateItemInfo.value("taxtype_id").toInt()); sCalculateDiscountPrcnt(); if (!(salesPopulateItemInfo.value("itemsite_createsopo").toBool())) { if (_item->itemType() == "M") { if ( (_mode == cNew) || (_mode == cEdit) ) _createSupplyOrder->setEnabled((_item->itemType() == "M" && salesPopulateItemInfo.value("itemsite_costmethod") != "J")); _createSupplyOrder->setTitle(tr("C&reate Work Order")); if (_metrics->boolean("MultiWhs")) { _supplyWarehouseLit->show(); _supplyWarehouse->show(); } _supplyOverridePrice->hide(); _supplyOverridePriceLit->hide(); _supplyOrderLit->hide(); _supplyOrder->hide(); _supplyOrderLineLit->hide(); _supplyOrderLine->hide(); } else if (_item->itemType() == "P") { if ( (_mode == cNew) || (_mode == cEdit) ) _createSupplyOrder->setEnabled(TRUE); _createSupplyOrder->setTitle(tr("C&reate Purchase Request")); _supplyWarehouseLit->hide(); _supplyWarehouse->hide(); _supplyOverridePrice->show(); _supplyOverridePriceLit->show(); _supplyOrderLit->hide(); _supplyOrder->hide(); _supplyOrderLineLit->hide(); _supplyOrderLine->hide(); } else { if ( (_mode == cNew) || (_mode == cEdit) ) _createSupplyOrder->setEnabled(_item->itemType() != "K"); _createSupplyOrder->setTitle(tr("C&reate Supply Order")); if (_metrics->boolean("MultiWhs")) { _supplyWarehouseLit->show(); _supplyWarehouse->show(); } _supplyOverridePrice->hide(); _supplyOverridePriceLit->hide(); _supplyOrderLit->hide(); _supplyOrder->hide(); _supplyOrderLineLit->hide(); _supplyOrderLine->hide(); } } } else if (salesPopulateItemInfo.lastError().type() != QSqlError::NoError) { systemError(this, salesPopulateItemInfo.lastError().databaseText(), __FILE__, __LINE__); return; } _charVars.replace(ITEM_ID, _item->id()); disconnect( _itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcPrice())); disconnect( _itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcAvailability())); // Populate Characteristics salesPopulateItemInfo.prepare("SELECT char_id, char_name, " " CASE WHEN char_type < 2 THEN " " charass_value " " ELSE " " formatDate(charass_value::date) " "END AS f_charass_value, " " charass_value, charass_price " "FROM (" "SELECT " " char_id, " " char_type, " " char_name," " char_order, " " COALESCE(si.charass_value,i2.charass_value) AS charass_value," " COALESCE(si.charass_price,itemcharprice(:item_id,char_id,COALESCE(si.charass_value,i2.charass_value),:cust_id,:shipto_id,:qty,:curr_id,:effective),0)::numeric(16,4) AS charass_price " "FROM " " (SELECT DISTINCT " " char_id," " char_type, " " char_name, " " char_order " " FROM charass, char" " WHERE ((charass_char_id=char_id)" " AND (charass_target_type='I')" " AND (charass_target_id=:item_id) ) ) AS data" " LEFT OUTER JOIN charass si ON ((:coitem_id=si.charass_target_id)" " AND (:sotype=si.charass_target_type)" " AND (si.charass_char_id=char_id))" " LEFT OUTER JOIN item i1 ON (i1.item_id=:item_id)" " LEFT OUTER JOIN charass i2 ON ((i1.item_id=i2.charass_target_id)" " AND ('I'=i2.charass_target_type)" " AND (i2.charass_char_id=char_id)" " AND (i2.charass_default))) data2 " "ORDER BY char_order, char_name; "); salesPopulateItemInfo.bindValue(":coitem_id", _soitemid); salesPopulateItemInfo.bindValue(":cust_id", _custid); salesPopulateItemInfo.bindValue(":shipto_id", _shiptoid); salesPopulateItemInfo.bindValue(":qty", _qtyOrdered->toDouble() * _qtyinvuomratio); salesPopulateItemInfo.bindValue(":item_id", _item->id()); salesPopulateItemInfo.bindValue(":curr_id", _customerPrice->id()); salesPopulateItemInfo.bindValue(":effective", _customerPrice->effective()); if (_mode & 0x20) salesPopulateItemInfo.bindValue(":sotype", "QI"); else salesPopulateItemInfo.bindValue(":sotype", "SI"); salesPopulateItemInfo.bindValue(":soitem_id", _soitemid); salesPopulateItemInfo.exec(); int row = 0; QModelIndex idx; while (salesPopulateItemInfo.next()) { _itemchar->insertRow(_itemchar->rowCount()); idx = _itemchar->index(row, CHAR_ID); _itemchar->setData(idx, salesPopulateItemInfo.value("char_name"), Qt::DisplayRole); _itemchar->setData(idx, salesPopulateItemInfo.value("char_id"), Qt::UserRole); idx = _itemchar->index(row, CHAR_VALUE); _itemchar->setData(idx, salesPopulateItemInfo.value("f_charass_value"), Qt::DisplayRole); _itemchar->setData(idx, _item->id(), Xt::IdRole); _itemchar->setData(idx, salesPopulateItemInfo.value("f_charass_value"), Qt::UserRole); idx = _itemchar->index(row, CHAR_PRICE); _itemchar->setData(idx, salesPopulateItemInfo.value("charass_price"), Qt::DisplayRole); _itemchar->setData(idx, QVariant(_charVars), Qt::UserRole); row++; } if (salesPopulateItemInfo.lastError().type() != QSqlError::NoError) { systemError(this, salesPopulateItemInfo.lastError().databaseText(), __FILE__, __LINE__); return; } // Setup widgets and signals needed to handle configuration if (_item->isConfigured()) { connect(_itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcPrice())); connect(_itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcAvailability())); _itemcharView->showColumn(CHAR_PRICE); _baseUnitPriceLit->show(); _baseUnitPrice->setVisible(TRUE); } else { disconnect( _itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcPrice())); disconnect( _itemchar, SIGNAL(itemChanged(QStandardItem *)), this, SLOT(sRecalcAvailability())); _itemcharView->hideColumn(CHAR_PRICE); _baseUnitPriceLit->hide(); _baseUnitPrice->setVisible(FALSE); } } } void salesOrderItem::sRecalcAvailability() { sDetermineAvailability(TRUE); } void salesOrderItem::sDetermineAvailability() { sDetermineAvailability(FALSE); } void salesOrderItem::sDetermineAvailability( bool p ) { if ( (_item->id()==_availabilityLastItemid) && (_warehouse->id()==_availabilityLastWarehousid) && (_scheduledDate->date()==_availabilityLastSchedDate) && (_showAvailability->isChecked()==_availabilityLastShow) && (_showIndented->isChecked()==_availabilityLastShowIndent) && ((_qtyOrdered->toDouble() * _qtyinvuomratio)==_availabilityQtyOrdered) && (!p) ) return; _availabilityLastItemid = _item->id(); _availabilityLastWarehousid = _warehouse->id(); _availabilityLastSchedDate = _scheduledDate->date(); _availabilityLastShow = _showAvailability->isChecked(); _availabilityLastShowIndent = _showIndented->isChecked(); _availabilityQtyOrdered = (_qtyOrdered->toDouble() * _qtyinvuomratio); _availability->clear(); if ((_item->isValid()) && (_scheduledDate->isValid()) && (_showAvailability->isChecked()) ) { XSqlQuery availability; availability.prepare( "SELECT itemsite_id," " qoh," " allocated," " (noNeg(qoh - allocated)) AS unallocated," " ordered," " (qoh - allocated + ordered) AS available," " itemsite_leadtime " "FROM ( SELECT itemsite_id, itemsite_qtyonhand AS qoh," " qtyAllocated(itemsite_id, DATE(:date)) AS allocated," " qtyOrdered(itemsite_id, DATE(:date)) AS ordered, " " itemsite_leadtime " " FROM itemsite, item " " WHERE ((itemsite_item_id=item_id)" " AND (item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id)) ) AS data;" ); availability.bindValue(":date", _scheduledDate->date()); availability.bindValue(":item_id", _item->id()); availability.bindValue(":warehous_id", _warehouse->id()); availability.exec(); if (availability.first()) { _onHand->setDouble(availability.value("qoh").toDouble()); _allocated->setDouble(availability.value("allocated").toDouble()); _unallocated->setDouble(availability.value("unallocated").toDouble()); _onOrder->setDouble(availability.value("ordered").toDouble()); _available->setDouble(availability.value("available").toDouble()); _leadtime->setText(availability.value("itemsite_leadtime").toString()); QString stylesheet; if (availability.value("available").toDouble() < _availabilityQtyOrdered) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); _available->setStyleSheet(stylesheet); if ((_item->itemType() == "M") || (_item->itemType() == "K")) { if (_showIndented->isChecked()) { QString sql( "SELECT itemsite_id, reorderlevel," " bomdata_bomwork_level," " bomdata_bomwork_id," " bomdata_bomwork_parent_id," " bomdata_bomwork_seqnumber AS seqnumber," " bomdata_item_number AS item_number," " bomdata_itemdescription AS item_descrip," " bomdata_uom_name AS uom_name," " pendalloc," " ordered," " qoh, " " (totalalloc + pendalloc) AS totalalloc," " (qoh + ordered - (totalalloc + pendalloc)) AS totalavail," " 'qty' AS pendalloc_xtnumericrole," " 'qty' AS ordered_xtnumericrole," " 'qty' AS qoh_xtnumericrole," " 'qty' AS totalalloc_xtnumericrole," " 'qty' AS totalavail_xtnumericrole," " CASE WHEN qoh < pendalloc THEN 'error'" " WHEN (qoh + ordered - (totalalloc + pendalloc)) < 0 THEN 'error'" " WHEN (qoh + ordered - (totalalloc + pendalloc)) < reorderlevel THEN 'warning'" " END AS qtforegroundrole," " bomdata_bomwork_level - 1 AS xtindentrole " " FROM ( SELECT itemsite_id," " CASE WHEN(itemsite_useparams)" " THEN itemsite_reorderlevel" " ELSE 0.0" " END AS reorderlevel," " ib.*, " " ((bomdata_qtyfxd::NUMERIC + bomdata_qtyper::NUMERIC * :qty) * (1 + bomdata_scrap::NUMERIC))" " AS pendalloc," " (qtyAllocated(itemsite_id, DATE(:schedDate)) -" " ((bomdata_qtyfxd::NUMERIC + bomdata_qtyper::NUMERIC * :origQtyOrd) *" " (1 + bomdata_scrap::NUMERIC)))" " AS totalalloc," " itemsite_qtyonhand AS qoh," " qtyOrdered(itemsite_id, DATE(:schedDate))" " AS ordered" " FROM indentedBOM(:item_id, " " getActiveRevId('BOM', :item_id)," " 0,0) ib LEFT OUTER JOIN" " itemsite ON ((itemsite_item_id=bomdata_item_id)" " AND (itemsite_warehous_id=:warehous_id))" " WHERE (bomdata_item_id > 0)"); if (_item->isConfigured()) // For configured items limit to bomitems associated with selected characteristic values { QModelIndex charidx; QModelIndex valueidx; sql += " AND ((bomdata_char_id IS NULL) "; for (int i = 0; i < _itemchar->rowCount(); i++) { charidx = _itemchar->index(i, CHAR_ID); valueidx = _itemchar->index(i, CHAR_VALUE); sql += QString(" OR ((bomdata_char_id=%1) AND (bomdata_value='%2'))") .arg(_itemchar->data(charidx, Qt::UserRole).toString()) .arg(_itemchar->data(valueidx, Qt::DisplayRole).toString().replace("'", "''")); } sql += " ) "; } sql += " ) AS data " "ORDER BY bomworkSequence(bomdata_bomwork_id);"; availability.prepare(sql); availability.bindValue(":item_id", _item->id()); availability.bindValue(":warehous_id", _warehouse->id()); availability.bindValue(":qty", _availabilityQtyOrdered); availability.bindValue(":schedDate", _scheduledDate->date()); availability.bindValue(":origQtyOrd", _originalQtyOrd); availability.exec(); _availability->populate(availability); if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } _availability->expandAll(); } else { int itemsiteid = availability.value("itemsite_id").toInt(); QString sql("SELECT itemsiteid, reorderlevel," " bomitem_seqnumber AS seqnumber, item_number, " " item_descrip, uom_name," " pendalloc, " " ordered, " " qoh, " " (totalalloc + pendalloc) AS totalalloc," " (qoh + ordered - (totalalloc + pendalloc)) AS totalavail," " 'qty' AS pendalloc_xtnumericrole," " 'qty' AS ordered_xtnumericrole," " 'qty' AS qoh_xtnumericrole," " 'qty' AS totalalloc_xtnumericrole," " 'qty' AS totalavail_xtnumericrole," " CASE WHEN qoh < pendalloc THEN 'error'" " WHEN (qoh + ordered - (totalalloc + pendalloc)) < 0 THEN 'error'" " WHEN (qoh + ordered - (totalalloc + pendalloc)) < reorderlevel THEN 'warning'" " END AS qtforegroundrole " "FROM ( SELECT cs.itemsite_id AS itemsiteid," " CASE WHEN(cs.itemsite_useparams) THEN cs.itemsite_reorderlevel ELSE 0.0 END AS reorderlevel," " bomitem_seqnumber, item_number," " (item_descrip1 || ' ' || item_descrip2) AS item_descrip, uom_name," " itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, (bomitem_qtyfxd + bomitem_qtyper * :qty) * (1 + bomitem_scrap)) AS pendalloc," " (qtyAllocated(cs.itemsite_id, DATE(:schedDate)) - itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, (bomitem_qtyfxd + bomitem_qtyper * :origQtyOrd) * (1 + bomitem_scrap))) AS totalalloc," " cs.itemsite_qtyonhand AS qoh," " qtyOrdered(cs.itemsite_id, DATE(:schedDate)) AS ordered " " FROM item, bomitem LEFT OUTER JOIN" " itemsite AS cs ON ((cs.itemsite_warehous_id=:warehous_id)" " AND (cs.itemsite_item_id=bomitem_item_id))," " uom," " itemsite AS ps " " WHERE ( (bomitem_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (bomitem_parent_item_id=ps.itemsite_item_id)" " AND (bomitem_rev_id=getActiveRevId('BOM',bomitem_parent_item_id))" " AND (:schedDate BETWEEN bomitem_effective AND (bomitem_expires-1))"); if (_item->isConfigured()) // For configured items limit to bomitems associated with selected characteristic values { QModelIndex charidx; QModelIndex valueidx; sql += " AND ((bomitem_char_id IS NULL) "; for (int i = 0; i < _itemchar->rowCount(); i++) { charidx = _itemchar->index(i, CHAR_ID); valueidx = _itemchar->index(i, CHAR_VALUE); sql += QString(" OR ((bomitem_char_id=%1) AND (bomitem_value='%2'))").arg(_itemchar->data(charidx, Qt::UserRole).toString()).arg(_itemchar->data(valueidx, Qt::DisplayRole).toString().replace("'", "''")); } sql += " ) "; } sql += " AND (ps.itemsite_id=:itemsite_id) ) ) AS data " "ORDER BY bomitem_seqnumber;"; availability.prepare(sql); availability.bindValue(":itemsite_id", itemsiteid); availability.bindValue(":warehous_id", _warehouse->id()); availability.bindValue(":qty", _availabilityQtyOrdered); availability.bindValue(":schedDate", _scheduledDate->date()); availability.bindValue(":origQtyOrd", _originalQtyOrd); availability.exec(); _availability->populate(availability); if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } } } else _availability->setEnabled(FALSE); } else if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _onHand->clear(); _allocated->clear(); _unallocated->clear(); _onOrder->clear(); _available->clear(); _leadtime->clear(); } } void salesOrderItem::sPopulateItemSources(int pItemid) { XSqlQuery priceq; MetaSQLQuery mql = mqlLoad("itemSources", "prices"); ParameterList params; params.append("item_id", pItemid); params.append("nominal",tr("Nominal")); params.append("discount",tr("Discount")); params.append("price", tr("Price")); params.append("fixed", tr("Fixed")); params.append("percent", tr("Percent")); params.append("mixed", tr("Mixed")); priceq = mql.toQuery(params); _itemsrcp->populate(priceq); } void salesOrderItem::sPopulateItemSubs(int pItemid) { XSqlQuery subq; MetaSQLQuery mql = mqlLoad("substituteAvailability", "detail"); ParameterList params; params.append("item_id", pItemid); params.append("warehous_id", _warehouse->id()); params.append("byDate", true); if (_scheduledDate->isValid()) params.append("date", _scheduledDate->date()); else params.append("date", omfgThis->dbDate()); subq = mql.toQuery(params); _subs->populate(subq); } void salesOrderItem::sPopulateSubMenu(QMenu *menu, QTreeWidgetItem*, int) { menu->addAction(tr("Substitute..."), this, SLOT(sSubstitute())); } void salesOrderItem::sSubstitute() { int _itemsiteid = _subs->id(); _sub->setChecked(true); _subItem->setId(_item->id()); _item->setItemsiteid(_itemsiteid); } void salesOrderItem::sPopulateHistory() { if (_historyCostsButton->isChecked()) { XSqlQuery historyq; MetaSQLQuery historymql = mqlLoad("receivings", "detail"); ParameterList params; params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); params.append("startDate", _historyDates->startDate()); params.append("endDate", _historyDates->endDate()); params.append("received", tr("Received")); params.append("returned", tr("Returned")); params.append("unvouchered", tr("Not Vouchered")); params.append("nonInv", tr("NonInv - ")); params.append("na", tr("N/A")); historyq = historymql.toQuery(params); _historyCosts->populate(historyq); } else { XSqlQuery historyq; MetaSQLQuery historymql = mqlLoad("salesHistory", "detail"); ParameterList params; params.append("cust_id", _custid); params.append("item_id", _item->id()); params.append("warehous_id", _warehouse->id()); params.append("startDate", _historyDates->startDate()); params.append("endDate", _historyDates->endDate()); historyq = historymql.toQuery(params); _historySales->populate(historyq); } } void salesOrderItem::sCalculateDiscountPrcnt() { double netUnitPrice = _netUnitPrice->baseValue(); double charTotal = 0; // if (_priceMode == "M") // markup // { // _discountFromCustLit->setText(tr("Cust. Markup %:")); // if (netUnitPrice == 0.0) // { // _discountFromListPrice->setDouble(100.0); // _markupFromUnitCost->setDouble(100.0); // _discountFromCust->setDouble(100.0); // } // else // { // if (_listPrice->isZero()) // _discountFromListPrice->setText(tr("N/A")); // else // _discountFromListPrice->setDouble((1.0 - (netUnitPrice / _listPrice->baseValue())) * 100.0); // // if (_unitCost->isZero()) // _markupFromUnitCost->setText(tr("N/A")); // else // _markupFromUnitCost->setDouble(((netUnitPrice / _unitCost->baseValue()) - 1.0) * 100.0); // // if (_customerPrice->isZero()) // _discountFromCust->setText(tr("N/A")); // else // _discountFromCust->setDouble(((netUnitPrice / _customerPrice->baseValue()) - 1.0) * 100.0); // } // } // else // discount // { // _discountFromCustLit->setText(tr("Cust. Discount %:")); if (netUnitPrice == 0.0) { _discountFromListPrice->setDouble(100.0); _markupFromUnitCost->setDouble(100.0); _discountFromCust->setDouble(100.0); } else { if (_listPrice->isZero()) _discountFromListPrice->setText(tr("N/A")); else _discountFromListPrice->setDouble((1.0 - (netUnitPrice / _listPrice->baseValue())) * 100.0); if (_unitCost->isZero()) _markupFromUnitCost->setText(tr("N/A")); else if (_metrics->boolean("Long30Markups")) _markupFromUnitCost->setDouble((1.0 - (_unitCost->baseValue() / netUnitPrice)) * 100.0); else _markupFromUnitCost->setDouble(((netUnitPrice / _unitCost->baseValue()) - 1.0) * 100.0); if (_customerPrice->isZero()) _discountFromCust->setText(tr("N/A")); else _discountFromCust->setDouble((1.0 - (netUnitPrice / _customerPrice->baseValue())) * 100.0); } // } if (_item->isConfigured()) // Total up price for configured item characteristics { QModelIndex idx; for (int i = 0; i < _itemchar->rowCount(); i++) { idx = _itemchar->index(i, CHAR_PRICE); charTotal += _itemchar->data(idx, Qt::DisplayRole).toDouble(); } _baseUnitPrice->setLocalValue(_netUnitPrice->localValue() - charTotal); } _margin->setLocalValue((_netUnitPrice->localValue() - _unitCost->localValue()) * _qtyOrdered->toDouble() * _qtyinvuomratio / _priceinvuomratio); sCalculateExtendedPrice(); } void salesOrderItem::sCalculateExtendedPrice() { _extendedPrice->setLocalValue(((_qtyOrdered->toDouble() * _qtyinvuomratio) / _priceinvuomratio) * _netUnitPrice->localValue()); } void salesOrderItem::sHandleWo(bool pCreate) { XSqlQuery salesHandleWo; if (pCreate) { if (_supplyOrderId == -1) sPopulateOrderInfo(); } else { if (_supplyOrderId != -1) { XSqlQuery query; if (_item->itemType() == "M") { if (QMessageBox::question(this, tr("Delete Work Order"), tr("

    You are requesting to delete the Work " "Order created for this Sales Order Item." "Are you sure you want to do this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { query.prepare("SELECT deleteWo(:wo_id, TRUE) AS result;"); query.bindValue(":wo_id", _supplyOrderId); query.exec(); if (query.first()) { int result = query.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteWo", result), __FILE__, __LINE__); _createSupplyOrder->setChecked(true); // if (pCreate) => won't recurse return; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); _createSupplyOrder->setChecked(true); // if (pCreate) => won't recurse return; } omfgThis->sWorkOrdersUpdated(-1, TRUE); _supplyWarehouse->clear(); _supplyWarehouse->findItemsites(_item->id()); _supplyWarehouse->setId(_warehouse->id()); } } else if (_item->itemType() == "P") { salesHandleWo.prepare("SELECT poitem_id " "FROM poitem JOIN coitem ON (poitem_id = coitem_order_id) " "WHERE ( (coitem_order_type = 'P') " " AND (coitem_id = :coitemid) );"); salesHandleWo.bindValue(":coitemid", _soitemid); salesHandleWo.exec(); if (salesHandleWo.first()) { if (QMessageBox::question(this, tr("Delete Purchase Order Item"), tr("

    You are requesting to delete the " "Purchase Order Item created for this Sales " "Order Item. The associated Purchase Order " "will also be deleted if no other Purchase " "Order Item exists for that Purchase Order. " "Are you sure you want to do this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { query.prepare("SELECT deletepoitem(:coitemid) AS result;"); query.bindValue(":coitemid", _soitemid); query.exec(); if (query.first()) { bool result = query.value("result").toBool(); if (!result) { systemError(this, tr("deletepoitem failed"), __FILE__, __LINE__); return; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _createSupplyOrder->setChecked(TRUE); return; } } else { if (QMessageBox::question(this, tr("Delete Purchase Request"), tr("

    You are requesting to delete the " "Purchase Request created for this Sales " "Order Item. Are you sure you want to do " "this?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { query.prepare("SELECT deletePr(:pr_id) AS result;"); query.bindValue(":pr_id", _supplyOrderId); query.exec(); if (query.first()) { bool result = query.value("result").toBool(); if (!result) { systemError(this, tr("deletePr failed"), __FILE__, __LINE__); return; } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _createSupplyOrder->setChecked(TRUE); return; } } } } _supplyOrderId = -1; _supplyOrderQty->clear(); _supplyOrderDueDate->clear(); _supplyOrderStatus->clear(); _createSupplyOrder->setChecked(FALSE); } } void salesOrderItem::sPopulateOrderInfo() { if (_createSupplyOrder->isChecked() && ((_mode == cNew) || (_mode == cEdit))) { XSqlQuery checkpo; checkpo.prepare( "SELECT pohead_id, poitem_id, poitem_status " "FROM pohead JOIN poitem ON (pohead_id = poitem_pohead_id) " " JOIN coitem ON (coitem_order_id = poitem_id) " "WHERE ((coitem_id = :soitem_id) " " AND (coitem_order_type='P'));" ); checkpo.bindValue(":soitem_id", _soitemid); checkpo.exec(); if (checkpo.first()) { if (((checkpo.value("poitem_status").toString()) == "C") && (_qtyOrdered->toDouble() != _qtyOrderedCache)) { QMessageBox::critical(this, tr("Cannot Update Item"), tr("The Purchase Order Item this Sales Order Item is linked to is closed. The quantity may not be updated.")); _qtyOrdered->setDouble(_qtyOrderedCache); return; } } else if (checkpo.lastError().type() != QSqlError::NoError) { systemError(this, checkpo.lastError().databaseText(), __FILE__, __LINE__); return; } if (_scheduledDate->date() != _scheduledDateCache) _supplyOrderDueDate->setDate(_scheduledDate->date()); if (_qtyOrdered->toDouble() != _qtyOrderedCache) { XSqlQuery qty; qty.prepare( "SELECT validateOrderQty(itemsite_id, :qty, TRUE) AS qty " "FROM itemsite " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id));" ); qty.bindValue(":qty", _qtyOrdered->toDouble() * _qtyinvuomratio); qty.bindValue(":item_id", _item->id()); qty.bindValue(":warehous_id", (_item->itemType() == "M") ? _supplyWarehouse->id() : _warehouse->id()); qty.exec(); if (qty.first()) _supplyOrderQty->setDouble(qty.value("qty").toDouble()); else if (qty.lastError().type() != QSqlError::NoError) { systemError(this, qty.lastError().databaseText(), __FILE__, __LINE__); return; } } } } void salesOrderItem::sCalculateFromDiscount() { if (_customerPrice->isZero()) _discountFromCust->setText(tr("N/A")); else { if (_updatePrice) { // if (_priceMode == "M") // markup // _netUnitPrice->setLocalValue(_customerPrice->localValue() + // (_customerPrice->localValue() * _discountFromCust->toDouble() / 100.0)); // else // discount _netUnitPrice->setLocalValue(_customerPrice->localValue() - (_customerPrice->localValue() * _discountFromCust->toDouble() / 100.0)); } sCalculateDiscountPrcnt(); } } void salesOrderItem::sCalculateFromMarkup() { if (_unitCost->isZero()) _markupFromUnitCost->setText(tr("N/A")); else { if (_updatePrice) { if (_markupFromUnitCost->toDouble() <= 50.0 && _metrics->boolean("Long30Markups")) _netUnitPrice->setLocalValue(_unitCost->localValue() / (1.0 - (_markupFromUnitCost->toDouble() / 100.0))); else _netUnitPrice->setLocalValue(_unitCost->localValue() + (_unitCost->localValue() * _markupFromUnitCost->toDouble() / 100.0)); } sCalculateDiscountPrcnt(); } } void salesOrderItem::populate() { if (_mode == cNew || _mode == cNewQuote) return; XSqlQuery item; QString sql; sql = "" "SELECT itemsite_leadtime, warehous_id, warehous_code, " " item_id, uom_name, iteminvpricerat(item_id) AS invpricerat, item_listprice," " item_inv_uom_id, item_fractional," " coitem_status, coitem_cohead_id," " coitem_order_type, coitem_order_id, coitem_custpn," " coitem_memo, NULL AS quitem_createorder," " NULL AS quitem_order_warehous_id," " formatSoLineNumber(coitem_id) AS linenumber," " coitem_qtyord AS qtyord," " coitem_qty_uom_id AS qty_uom_id," " coitem_qty_invuomratio AS qty_invuomratio," " coitem_qtyshipped AS qtyshipped," " coitem_scheddate," " coitem_custprice, coitem_unitcost," " coitem_price, coitem_pricemode," " coitem_price_uom_id AS price_uom_id," " coitem_price_invuomratio AS price_invuomratio," " coitem_promdate AS promdate," " coitem_substitute_item_id, coitem_prcost," " qtyAtShipping(coitem_id) AS qtyatshipping," " coitem_taxtype_id," " coitem_cos_accnt_id, coitem_rev_accnt_id, " " coitem_warranty, coitem_qtyreserved, locale_qty_scale, " " cohead_number AS ordnumber " "FROM coitem, whsinfo, itemsite, item, uom, cohead, locale " "LEFT OUTER JOIN usr ON (usr_username = getEffectiveXtUser()) " "WHERE ( (coitem_itemsite_id=itemsite_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (cohead_id=coitem_cohead_id)" " AND (coitem_id=) " " AND (locale_id = usr_locale_id));" "" "SELECT itemsite_leadtime, COALESCE(warehous_id, -1) AS warehous_id, " " warehous_code," " item_id, uom_name, iteminvpricerat(item_id) AS invpricerat, item_listprice," " item_inv_uom_id, item_fractional," " 'O' AS coitem_status, quitem_quhead_id AS coitem_cohead_id," " '' AS coitem_order_type, -1 AS coitem_order_id," " quitem_custpn AS coitem_custpn," " quitem_memo AS coitem_memo, quitem_createorder," " quitem_order_warehous_id," " quitem_linenumber AS linenumber," " quitem_qtyord AS qtyord," " quitem_qty_uom_id AS qty_uom_id," " quitem_qty_invuomratio AS qty_invuomratio," " NULL AS qtyshipped," " quitem_scheddate AS coitem_scheddate," " quitem_custprice AS coitem_custprice, quitem_unitcost AS coitem_unitcost," " quitem_price AS coitem_price, quitem_pricemode AS coitem_pricemode," " quitem_price_uom_id AS price_uom_id," " quitem_price_invuomratio AS price_invuomratio," " quitem_promdate AS promdate," " -1 AS coitem_substitute_item_id, quitem_prcost AS coitem_prcost," " 0.0 AS qtyatshipping," " quitem_taxtype_id AS coitem_taxtype_id, quitem_dropship, quitem_itemsrc_id" " locale_qty_scale, quhead_number AS ordnumber " " FROM item, uom, quhead, locale " " LEFT OUTER JOIN usr ON (usr_username = getEffectiveXtUser()), quitem " " LEFT OUTER JOIN (itemsite " " JOIN whsinfo ON (itemsite_warehous_id=warehous_id)) " " ON (quitem_itemsite_id=itemsite_id) " " WHERE ( (quitem_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (quhead_id=quitem_quhead_id)" " AND (quitem_id=) " " AND (locale_id = usr_locale_id));" ""; ParameterList qparams; qparams.append("id", _soitemid); if (!ISQUOTE(_mode)) qparams.append("isSalesOrder"); MetaSQLQuery metaitem(sql); item = metaitem.toQuery(qparams); if (item.first()) { _soheadid = item.value("coitem_cohead_id").toInt(); _comments->setId(_soitemid); _lineNumber->setText(item.value("linenumber").toString()); _priceRatio = item.value("invpricerat").toDouble(); _shippedToDate->setDouble(item.value("qtyshipped").toDouble()); _item->setId(item.value("item_id").toInt()); // should precede _taxtype/code _invuomid = item.value("item_inv_uom_id").toInt(); _qtyUOM->setId(item.value("qty_uom_id").toInt()); _priceUOM->setId(item.value("price_uom_id").toInt()); _priceUOMCache = _priceUOM->id(); _qtyinvuomratio = item.value("qty_invuomratio").toDouble(); _priceinvuomratio = item.value("price_invuomratio").toDouble(); _unitCost->setLocalValue(item.value("coitem_unitcost").toDouble()); // do tax stuff before _qtyOrdered so signal cascade has data to work with _taxtype->setId(item.value("coitem_taxtype_id").toInt()); _orderNumber->setText(item.value("ordnumber").toString()); _qtyOrderedCache = item.value("qtyord").toDouble(); if(item.value("item_fractional") == true) { _qtyOrdered->setValidator(omfgThis->qtyVal()); _qtyOrdered->setText(_qtyOrderedCache); } else { _qtyOrdered->setValidator(new QIntValidator()); _qtyOrdered->setText(qRound(_qtyOrderedCache)); } _scheduledDateCache = item.value("coitem_scheddate").toDate(); _scheduledDate->setDate(_scheduledDateCache); _notes->setText(item.value("coitem_memo").toString()); if (!item.value("quitem_createorder").isNull()) _createSupplyOrder->setChecked(item.value("quitem_createorder").toBool()); if (!item.value("promdate").isNull() && _metrics->boolean("UsePromiseDate")) _promisedDate->setDate(item.value("promdate").toDate()); if (item.value("coitem_substitute_item_id").toInt() > 0) { _sub->setChecked(true); _subItem->setId(item.value("coitem_substitute_item_id").toInt()); } _customerPrice->setLocalValue(item.value("coitem_custprice").toDouble()); _listPrice->setBaseValue(item.value("item_listprice").toDouble() * (_priceinvuomratio / _priceRatio)); _netUnitPrice->setLocalValue(item.value("coitem_price").toDouble()); _priceMode = item.value("coitem_pricemode").toString(); _margin->setLocalValue((_netUnitPrice->localValue() - _unitCost->localValue()) * _qtyOrdered->toDouble()); _leadTime = item.value("itemsite_leadtime").toInt(); _qtyOrderedCache = _qtyOrdered->toDouble(); _originalQtyOrd = _qtyOrdered->toDouble() * _qtyinvuomratio; _cScheduledDate = _scheduledDate->date(); if (!item.value("quitem_order_warehous_id").isNull()) _supplyWarehouse->setId(item.value("quitem_order_warehous_id").toInt()); if (item.value("qtyshipped").toDouble() > 0) { _qtyUOM->setEnabled(false); _priceUOM->setEnabled(false); } _customerPN->setText(item.value("coitem_custpn").toString()); if (ISQUOTE(_mode)) { if (!item.value("quitem_dropship").isNull()) _supplyDropShip->setChecked(item.value("quitem_dropship").toBool()); if (!item.value("quitem_itemsrc_id").isNull()) _itemsrc = item.value("quitem_itemsrc_id").toInt(); else _itemsrc = -1; _supplyOverridePrice->setLocalValue(item.value("coitem_prcost").toDouble()); } _warranty->setChecked(item.value("coitem_warranty").toBool()); _altCosAccnt->setId(item.value("coitem_cos_accnt_id").toInt()); _altRevAccnt->setId(item.value("coitem_rev_accnt_id").toInt()); _qtyreserved = item.value("coitem_qtyreserved").toDouble(); sCalculateDiscountPrcnt(); sLookupTax(); sDetermineAvailability(); } else if (item.lastError().type() != QSqlError::NoError) { systemError(this, item.lastError().databaseText(), __FILE__, __LINE__); return; } _supplyOrderType = item.value("coitem_order_type").toString(); _supplyOrderId = item.value("coitem_order_id").toInt(); if (_supplyOrderId != -1) { XSqlQuery query; if (_supplyOrderType == "W") { if (_metrics->boolean("MultiWhs")) { _supplyWarehouseLit->show(); _supplyWarehouse->show(); } _supplyOverridePrice->hide(); _supplyOverridePriceLit->hide(); query.prepare( "SELECT wo.*," " CASE WHEN wo_status IN ('R', 'I', 'C') THEN true" " ELSE false END AS orderlocked," " warehous_id, warehous_code " "FROM wo, itemsite, whsinfo " "WHERE ((wo_itemsite_id=itemsite_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (wo_id=:wo_id));" ); query.bindValue(":wo_id", _supplyOrderId); query.exec(); if (query.first()) { _createSupplyOrder->setTitle(tr("Create Work Order")); _createSupplyOrder->setChecked(TRUE); _supplyOrderQtyCache = query.value("wo_qtyord").toDouble(); _supplyOrderQty->setDouble(query.value("wo_qtyord").toDouble()); _supplyOrderDueDateCache = query.value("wo_duedate").toDate(); _supplyOrderDueDate->setDate(query.value("wo_duedate").toDate()); _supplyOrderStatus->setText(query.value("wo_status").toString()); if (query.value("orderlocked").toBool()) _createSupplyOrder->setEnabled(FALSE); if (_item->isConfigured() && (query.value("wo_status").toString() != "O")) _itemcharView->setEnabled(FALSE); _supplyWarehouse->clear(); _supplyWarehouse->append(query.value("warehous_id").toInt(), query.value("warehous_code").toString()); _supplyWarehouse->setEnabled(FALSE); } else { _supplyOrderId = -1; _createSupplyOrder->setChecked(FALSE); } } else if (_supplyOrderType == "P") { _supplyWarehouseLit->hide(); _supplyWarehouse->hide(); _supplyOverridePrice->show(); _supplyOverridePriceLit->show(); XSqlQuery qry; qry.prepare("SELECT * " "FROM poitem JOIN pohead ON (pohead_id = poitem_pohead_id) " "WHERE (poitem_id = :poitem_id);"); qry.bindValue(":poitem_id", _supplyOrderId); qry.exec(); if (qry.first()) { _createSupplyOrder->setTitle(tr("Create Purchase Order")); _createSupplyOrder->setChecked(TRUE); _supplyOrder->setText(qry.value("pohead_number").toString()); _supplyOrderLine->setText(qry.value("poitem_linenumber").toString()); _supplyOrderStatus->setText(qry.value("poitem_status").toString()); _supplyOrderQtyCache = qry.value("poitem_qty_ordered").toDouble(); _supplyOrderQty->setDouble(qry.value("poitem_qty_ordered").toDouble()); _supplyOrderDueDateCache = qry.value("poitem_duedate").toDate(); _supplyOrderDueDate->setDate(qry.value("poitem_duedate").toDate()); _supplyDropShip->setChecked(qry.value("pohead_dropship").toBool()); _supplyOverridePrice->setLocalValue(qry.value("poitem_unitprice").toDouble()); _itemsrc = qry.value("poitem_itemsrc_id").toInt(); _supplyOrderLit->show(); _supplyOrderLineLit->show(); _supplyOrderQtyLit->show(); _supplyOrderDueDateLit->show(); _supplyOrderStatusLit->show(); _supplyOrder->show(); _supplyOrderLine->show(); _supplyOrderStatus->show(); _supplyOrderQty->show(); _supplyOrderDueDate->show(); _supplyOverridePrice->show(); _supplyDropShip->setVisible(_metrics->boolean("EnableDropShipments")); } else { _supplyOrderId = -1; _createSupplyOrder->setChecked(FALSE); } } else if (_supplyOrderType == "R") { _supplyWarehouseLit->hide(); _supplyWarehouse->hide(); _supplyOverridePrice->show(); _supplyOverridePriceLit->show(); query.prepare( "SELECT * " "FROM pr " "WHERE (pr_id=:pr_id);" ); query.bindValue(":pr_id", _supplyOrderId); query.exec(); if (query.first()) { _createSupplyOrder->setTitle(tr("Create Purchase Request")); _createSupplyOrder->setChecked(TRUE); _supplyOrderQtyCache = query.value("pr_qtyreq").toDouble(); _supplyOrderQty->setDouble(query.value("pr_qtyreq").toDouble()); _supplyOrderDueDateCache = query.value("pr_duedate").toDate(); _supplyOrderDueDate->setDate(query.value("pr_duedate").toDate()); _supplyOrderStatus->setText(query.value("pr_status").toString()); if ((query.value("pr_status").toString() == "R") || (query.value("pr_status").toString() == "C")) _createSupplyOrder->setEnabled(FALSE); } else { _supplyOrderId = -1; _createSupplyOrder->setChecked(FALSE); } } } else if (ISORDER(_mode)) _createSupplyOrder->setChecked(FALSE); // _warehouse is populated with active records. append if this one is inactive if (ISORDER(_mode)) { _warehouse->append(item.value("warehous_id").toInt(), item.value("warehous_code").toString()); _warehouse->setId(item.value("warehous_id").toInt()); _warehouse->setEnabled(FALSE); if ( (cView != _mode) && (item.value("coitem_status").toString() == "O") ) _cancel->setEnabled((item.value("qtyshipped").toDouble()==0.0) && (item.value("qtyatshipping").toDouble()==0.0)); else _cancel->setEnabled(false); } else // if (ISQUOTE(_mode)) { if (cEditQuote == _mode && item.value("warehous_id").toInt() == -1) { _updateItemsite = true; _warehouse->append(-1, item.value("warehous_code").toString()); _warehouse->setId(-1); } else { _warehouse->append(item.value("warehous_id").toInt(), item.value("warehous_code").toString()); _warehouse->setId(item.value("warehous_id").toInt()); _warehouse->setEnabled(FALSE); } } } void salesOrderItem::sFindSellingWarehouseItemsites( int id ) { _warehouse->findItemsites(id); _supplyWarehouse->findItemsites(id); if (_preferredWarehouseid > 0) { _warehouse->setId(_preferredWarehouseid); _supplyWarehouse->setId(_preferredWarehouseid); } } void salesOrderItem::sPriceGroup() { if (!omfgThis->singleCurrency()) _priceGroup->setTitle(tr("In %1:").arg(_netUnitPrice->currAbbr())); } void salesOrderItem::sNext() { XSqlQuery salesNext; if (_modified) { switch ( QMessageBox::question( this, tr("Unsaved Changed"), tr("

    You have made some changes which have not yet been saved!\n" "Would you like to save them now?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape ) ) { case QMessageBox::Yes: sSave(); if (_modified) // catch an error saving return; case QMessageBox::No: break; case QMessageBox::Cancel: default: return; } } clear(); prepare(); _item->setFocus(); if (cNew == _mode || cNewQuote == _mode) { _modified = false; return; } if (ISQUOTE(_mode)) salesNext.prepare("SELECT a.quitem_id AS id, 0 AS sub" " FROM quitem AS a, quitem as b" " WHERE ((a.quitem_quhead_id=b.quitem_quhead_id)" " AND (a.quitem_linenumber > b.quitem_linenumber)" " AND (b.quitem_id=:id))" " ORDER BY a.quitem_linenumber" " LIMIT 1;"); else salesNext.prepare("SELECT a.coitem_id AS id, a.coitem_subnumber AS sub" " FROM coitem AS a, coitem AS b" " WHERE ((a.coitem_cohead_id=b.coitem_cohead_id)" " AND ((a.coitem_linenumber > b.coitem_linenumber)" " OR ((a.coitem_linenumber = b.coitem_linenumber)" " AND (a.coitem_subnumber > b.coitem_subnumber)))" " AND (b.coitem_id=:id))" " ORDER BY a.coitem_linenumber, a.coitem_subnumber" " LIMIT 1;"); salesNext.bindValue(":id", _soitemid); salesNext.exec(); if (salesNext.first()) { ParameterList params; if (_custid != -1) params.append("cust_id", _custid); params.append("soitem_id", salesNext.value("id").toInt()); if (ISQUOTE(_mode)) { if (cNewQuote == _mode || cEditQuote == _mode) params.append("mode", "editQuote"); else params.append("mode", "viewQuote"); } else { if ((cNew == _initialMode || cEdit == _initialMode) && (salesNext.value("sub").toInt() == 0)) params.append("mode", "edit"); else params.append("mode", "view"); } set(params); } else if (salesNext.lastError().type() != QSqlError::NoError) { systemError(this, salesNext.lastError().databaseText(), __FILE__, __LINE__); return; } else if (cView != _initialMode && cViewQuote != _initialMode) { ParameterList params; if (_custid != -1) params.append("cust_id", _custid); if (_scheduledDate->isValid()) params.append("shipDate", _scheduledDate->date()); params.append("sohead_id", _soheadid); if (ISQUOTE(_mode)) params.append("mode", "newQuote"); else params.append("mode", "new"); set(params); setItemExtraClause(); } } void salesOrderItem::sPrev() { XSqlQuery salesPrev; if (_modified) { switch ( QMessageBox::question( this, tr("Unsaved Changed"), tr("

    You have made some changes which have not yet been saved!\n" "Would you like to save them now?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape ) ) { case QMessageBox::Yes: sSave(); if (_modified) // catch an error saving return; case QMessageBox::No: break; case QMessageBox::Cancel: default: return; } } clear(); prepare(); _item->setFocus(); if (ISQUOTE(_mode)) { if (cNewQuote == _mode) salesPrev.prepare("SELECT quitem_id AS id, 0 AS sub" " FROM quitem" " WHERE (quitem_quhead_id=:sohead_id)" " ORDER BY quitem_linenumber DESC" " LIMIT 1;"); else salesPrev.prepare("SELECT a.quitem_id AS id, 0 AS sub" " FROM quitem AS a, quitem as b" " WHERE ((a.quitem_quhead_id=b.quitem_quhead_id)" " AND (a.quitem_linenumber < b.quitem_linenumber)" " AND (b.quitem_id=:id))" " ORDER BY a.quitem_linenumber DESC" " LIMIT 1;"); } else { if (cNew == _mode) salesPrev.prepare("SELECT coitem_id AS id, coitem_subnumber AS sub" " FROM coitem" " WHERE (coitem_cohead_id=:sohead_id)" " ORDER BY coitem_linenumber DESC, coitem_subnumber DESC" " LIMIT 1;"); else salesPrev.prepare("SELECT a.coitem_id AS id, a.coitem_subnumber AS sub" " FROM coitem AS a, coitem AS b" " WHERE ((a.coitem_cohead_id=b.coitem_cohead_id)" " AND ((a.coitem_linenumber < b.coitem_linenumber)" " OR ((a.coitem_linenumber = b.coitem_linenumber)" " AND (a.coitem_subnumber < b.coitem_subnumber)))" " AND (b.coitem_id=:id))" " ORDER BY a.coitem_linenumber DESC, a.coitem_subnumber DESC" " LIMIT 1;"); } salesPrev.bindValue(":id", _soitemid); salesPrev.bindValue(":sohead_id", _soheadid); salesPrev.exec(); if (salesPrev.first()) { ParameterList params; if (_custid != -1) params.append("cust_id", _custid); params.append("soitem_id", salesPrev.value("id").toInt()); if (ISQUOTE(_mode)) { if (cNewQuote == _mode || cEditQuote == _mode) params.append("mode", "editQuote"); else params.append("mode", "viewQuote"); } else { if ((cNew == _initialMode || cEdit == _initialMode) && (salesPrev.value("sub").toInt() == 0)) params.append("mode", "edit"); else params.append("mode", "view"); } set(params); } else if (salesPrev.lastError().type() != QSqlError::NoError) { systemError(this, salesPrev.lastError().databaseText(), __FILE__, __LINE__); return; } } void salesOrderItem::sChanged() { _modified = true; } void salesOrderItem::reject() { XSqlQuery salesreject; bool saved = false; if (_modified) { switch ( QMessageBox::question( this, tr("Unsaved Changed"), tr("

    You have made some changes which have not yet been saved!\n" "Would you like to save them now?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape ) ) { case QMessageBox::Yes: sSave(); if (_modified) // catch an error saving return; saved = true; break; case QMessageBox::No: break; case QMessageBox::Cancel: default: return; } } if (!saved && (cNew == _mode || cNewQuote == _mode)) { // DELETE ANY COMMENTS if (ISQUOTE(_mode)) salesreject.prepare("DELETE FROM comment WHERE comment_source_id=:coitem_id AND comment_source = 'QI';"); else salesreject.prepare("DELETE FROM comment WHERE comment_source_id=:coitem_id AND comment_source = 'SI';"); salesreject.bindValue(":coitem_id", _soitemid); salesreject.exec(); if (salesreject.lastError().type() != QSqlError::NoError) { systemError(this, salesreject.lastError().databaseText(), __FILE__, __LINE__); return; } } XDialog::reject(); } void salesOrderItem::sCancel() { XSqlQuery salesCancel; _canceling = true; sSave(); if (_error) return; if ( (_mode == cEdit) || (_mode == cNew) ) { XSqlQuery existpo; existpo.prepare("SELECT * FROM poitem JOIN coitem ON (coitem_order_id = poitem_id) " "WHERE ((coitem_id = :soitem_id) " " AND (coitem_order_type='P'));" ); existpo.bindValue(":soitem_id", _soitemid); existpo.exec(); if (existpo.first()) { QMessageBox::warning(this, tr("Can not delete PO"), tr("Purchase Order linked to this Sales Order " "Item will not be affected. The Purchase Order " "should be closed or deleted manually if necessary.")); } else if (existpo.lastError().type() != QSqlError::NoError) { systemError(this, existpo.lastError().databaseText(), __FILE__, __LINE__); return; } } salesCancel.prepare("UPDATE coitem SET coitem_status='X' WHERE (coitem_id=:coitem_id);"); salesCancel.bindValue(":coitem_id", _soitemid); salesCancel.exec(); if (salesCancel.lastError().type() != QSqlError::NoError) { systemError(this, salesCancel.lastError().databaseText(), __FILE__, __LINE__); return; } clear(); prepare(); _prev->setEnabled(true); _item->setFocus(); _modified = false; _canceling = false; } void salesOrderItem::sLookupTax() { XSqlQuery calcq; calcq.prepare("SELECT calculateTax(:taxzone_id, :taxtype_id, :date, :curr_id, :ext ) AS val"); calcq.bindValue(":taxzone_id", _taxzoneid); calcq.bindValue(":taxtype_id", _taxtype->id()); calcq.bindValue(":date", _netUnitPrice->effective()); calcq.bindValue(":curr_id", _netUnitPrice->id()); calcq.bindValue(":ext", _extendedPrice->localValue()); calcq.exec(); if (calcq.first()) { _cachedRate= calcq.value("val").toDouble(); _tax->setLocalValue(_cachedRate ); } else if (calcq.lastError().type() != QSqlError::NoError) { systemError(this, calcq.lastError().databaseText(), __FILE__, __LINE__); return; } } void salesOrderItem::sTaxDetail() { taxDetail newdlg(this, "", true); ParameterList params; params.append("taxzone_id", _taxzoneid); params.append("taxtype_id", _taxtype->id()); params.append("date", _netUnitPrice->effective()); params.append("curr_id", _netUnitPrice->id()); params.append("subtotal", _extendedPrice->localValue()); if (_mode == cView) params.append("readOnly"); if (newdlg.set(params) == NoError && newdlg.exec()) { if (_taxtype->id() != newdlg.taxtype()) _taxtype->setId(newdlg.taxtype()); } } void salesOrderItem::sQtyUOMChanged() { if (_qtyUOM->id() == _invuomid) { _qtyinvuomratio = 1.0; if (_invIsFractional) _qtyOrdered->setValidator(new XDoubleValidator(this)); else _qtyOrdered->setValidator(new QIntValidator(this)); } else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio," " itemuomfractionalbyuom(item_id, :uom_id) AS frac " " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _qtyUOM->id()); invuom.exec(); if (invuom.first()) { _qtyinvuomratio = invuom.value("ratio").toDouble(); if (invuom.value("frac").toBool()) _qtyOrdered->setValidator(new XDoubleValidator(this)); else _qtyOrdered->setValidator(new QIntValidator(this)); } else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } if (_qtyUOM->id() != _invuomid || cView == _mode || cViewQuote == _mode) _priceUOM->setEnabled(false); else _priceUOM->setEnabled(true); _priceUOM->setId(_qtyUOM->id()); sCalculateExtendedPrice(); sPopulateOrderInfo(); if (_qtyOrdered->toDouble() != (double)qRound(_qtyOrdered->toDouble()) && _qtyOrdered->validator()->inherits("QIntValidator")) { QMessageBox::warning(this, tr("Invalid Quantity"), tr("This UOM for this Item does not allow fractional " "quantities. Please fix the quantity.")); _qtyOrdered->setFocus(); _qtyOrdered->setText(""); return; } } void salesOrderItem::sPriceUOMChanged() { if (_priceUOM->id() == -1 || _qtyUOM->id() == -1) return; if (_priceUOM->id() == _invuomid) _priceinvuomratio = 1.0; else { XSqlQuery invuom; invuom.prepare("SELECT itemuomtouomratio(item_id, :uom_id, item_inv_uom_id) AS ratio" " FROM item" " WHERE(item_id=:item_id);"); invuom.bindValue(":item_id", _item->id()); invuom.bindValue(":uom_id", _priceUOM->id()); invuom.exec(); if (invuom.first()) _priceinvuomratio = invuom.value("ratio").toDouble(); else systemError(this, invuom.lastError().databaseText(), __FILE__, __LINE__); } XSqlQuery item; item.prepare("SELECT item_listprice, item_listcost," " itemCost(itemsite_id) AS unitcost" " FROM item LEFT OUTER JOIN itemsite ON (itemsite_item_id=item_id AND itemsite_warehous_id=:warehous_id)" " WHERE(item_id=:item_id);"); item.bindValue(":item_id", _item->id()); item.bindValue(":warehous_id", _warehouse->id()); item.exec(); item.first(); _listPrice->setBaseValue(item.value("item_listprice").toDouble() * (_priceinvuomratio / _priceRatio)); if (_metrics->boolean("WholesalePriceCosting")) _unitCost->setBaseValue(item.value("item_listcost").toDouble() * (_priceinvuomratio / _priceRatio)); else _unitCost->setBaseValue(item.value("unitcost").toDouble() * (_priceinvuomratio / _priceRatio)); sDeterminePrice(true); } void salesOrderItem::sCalcWoUnitCost() { XSqlQuery salesCalcWoUnitCost; if (_costmethod == "J" && _supplyOrderId > -1 && _qtyOrdered->toDouble() != 0) { salesCalcWoUnitCost.prepare("SELECT COALESCE(SUM(wo_postedvalue),0) AS wo_value " "FROM wo " "WHERE ((wo_ordtype='S') " "AND (wo_ordid=:soitem_id));"); salesCalcWoUnitCost.bindValue(":soitem_id", _soitemid); salesCalcWoUnitCost.exec(); if (salesCalcWoUnitCost.first()) _unitCost->setBaseValue(salesCalcWoUnitCost.value("wo_value").toDouble() / _qtyOrdered->toDouble() * _qtyinvuomratio); } } void salesOrderItem::sHandleButton() { if (_inventoryButton->isChecked()) _availabilityStack->setCurrentWidget(_inventoryPage); else if (_itemSourcesButton->isChecked()) _availabilityStack->setCurrentWidget(_itemSourcesPage); else if (_dependenciesButton->isChecked()) _availabilityStack->setCurrentWidget(_dependenciesPage); else _availabilityStack->setCurrentWidget(_substitutesPage); if (_historyCostsButton->isChecked()) _historyStack->setCurrentWidget(_historyCostsPage); else if (_historySalesButton->isChecked()) _historyStack->setCurrentWidget(_historySalesPage); if ((_item->itemType() == "K")) { int lineNum, headId; XSqlQuery firstQry; firstQry.prepare("SELECT coitem_cohead_id, coitem_linenumber " "FROM coitem " "JOIN itemsite ON (itemsite_id=coitem_itemsite_id) " "JOIN item ON (itemsite_item_id=item_id) " "WHERE (coitem_id=:coitemid) AND (item_type='K');"); firstQry.bindValue(":coitemid", _soitemid); firstQry.exec(); if (firstQry.first()) { XSqlQuery secondQry; lineNum = firstQry.value("coitem_linenumber").toInt(); headId = firstQry.value("coitem_cohead_id").toInt(); secondQry.prepare("SELECT coitem_qtyshipped " "FROM coitem " "JOIN cohead ON (cohead_id=coitem_cohead_id) " "WHERE (coitem_linenumber=:line) " "AND (coitem_cohead_id=:head) " "AND (coitem_qtyshipped>0);"); secondQry.bindValue(":line", lineNum); secondQry.bindValue(":head", headId); secondQry.exec(); if(secondQry.first()) { QMessageBox::critical(this, tr("Kit"), tr("At least one child item from this kit has already shipped.")); _cancel->setEnabled(false); } else { XSqlQuery thirdQry; thirdQry.prepare("SELECT shipitem_qty, shiphead_shipped " "FROM shipitem " "JOIN shiphead ON (shiphead_id=shipitem_shiphead_id) " "WHERE (shipitem_orderitem_id=:soitemid) " "AND (shiphead_shipped='f') " "AND (shipitem_qty>0)"); thirdQry.bindValue(":soitemid", _soitemid); thirdQry.exec(); if(thirdQry.first()) { QMessageBox::critical(this, tr("Kit"), tr("At least one child item from this kit is at shipping.")); _cancel->setEnabled(false); } } } } } void salesOrderItem::setItemExtraClause() { if (_mode != cNew) return; _item->clearExtraClauseList(); _item->addExtraClause("(itemsite_active)" ); _item->addExtraClause("(itemsite_sold)"); _item->addExtraClause( QString("(item_id IN (SELECT custitem FROM custitem(%1, %2, '%3') ) )").arg(_custid).arg(_shiptoid).arg(_scheduledDate->date().toString(Qt::ISODate)) ); } void salesOrderItem::sHandleScheduleDate() { XSqlQuery salesHandleScheduleDate; if ((!_scheduledDate->isValid() || (_scheduledDate->date() == _scheduledDateCache))) { // sDetermineAvailability(); return; } if (_createSupplyOrder->isChecked()) { XSqlQuery checkpo; checkpo.prepare( "SELECT pohead_id, poitem_id, poitem_status " "FROM pohead JOIN poitem ON (pohead_id = poitem_pohead_id) " " JOIN coitem ON (coitem_order_id = poitem_id) " "WHERE ((coitem_id = :soitem_id) " " AND (coitem_order_type='P'));" ); checkpo.bindValue(":soitem_id", _soitemid); checkpo.exec(); if (checkpo.first()) { if ((checkpo.value("poitem_status").toString()) == "C") { QMessageBox::critical(this, tr("Cannot Update Item"), tr("The Purchase Order Item this Sales Order Item is linked to is closed. The date may not be updated.")); _scheduledDate->setDate(_scheduledDateCache); _scheduledDate->setFocus(); return; } } } // Check effectivity setItemExtraClause(); if (_item->isValid() && _metrics->value("soPriceEffective") == "ScheduleDate") { ParameterList params; params.append("item_id", _item->id()); params.append("cust_id", _custid); params.append("shipto_id", _shiptoid); params.append("shipDate", _scheduledDate->date()); QString sql("SELECT customerCanPurchase(, " ", " ", " ") AS canPurchase; "); MetaSQLQuery mql(sql); salesHandleScheduleDate = mql.toQuery(params); if (salesHandleScheduleDate.first()) { if (!salesHandleScheduleDate.value("canPurchase").toBool()) { QMessageBox::critical(this, tr("Invalid Item for Date"), tr("This item may not be purchased in this date. Please select another date or item.")); _scheduledDate->setDate(_scheduledDateCache); _scheduledDate->setFocus(); return; } } } sDeterminePrice(); sDetermineAvailability(); sPopulateOrderInfo(); } qt-client-4.1.0/guiclient/salesOrderItem.h000066400000000000000000000103601217451700100204700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESORDERITEM_H #define SALESORDERITEM_H #include "guiclient.h" #include #include "xdialog.h" #include #include "ui_salesOrderItem.h" class salesOrderItem : public XDialog, public Ui::salesOrderItem { Q_OBJECT public: salesOrderItem(QWidget *parent = 0, const char * = 0, Qt::WindowFlags fl = 0); ~salesOrderItem(); virtual void prepare(); virtual void clear(); virtual void setItemExtraClause(); Q_INVOKABLE virtual int id() { return _soitemid; } public slots: virtual SetResponse set( const ParameterList &pParams ); virtual void sSave(); virtual void sPopulateItemsiteInfo(); virtual void sListPrices(); virtual void sDeterminePrice(); virtual void sDeterminePrice( bool force ); virtual void sRecalcPrice(); virtual void sPopulateItemInfo( int pItemid ); virtual void sRecalcAvailability(); virtual void sDetermineAvailability(); virtual void sDetermineAvailability( bool p ); virtual void sPopulateItemSources( int pItemid ); virtual void sPopulateItemSubs( int pItemid ); virtual void sPopulateSubMenu(QMenu *, QTreeWidgetItem *, int); virtual void sSubstitute(); virtual void sPopulateHistory(); virtual void sCalculateDiscountPrcnt(); virtual void sCalculateExtendedPrice(); virtual void sHandleWo( bool pCreate ); virtual void sPopulateOrderInfo(); virtual void sCalculateFromDiscount(); virtual void sCalculateFromMarkup(); virtual void populate(); virtual void sFindSellingWarehouseItemsites( int id ); virtual void sPriceGroup(); virtual void sNext(); virtual void sPrev(); virtual void sChanged(); virtual void sCancel(); virtual void sLookupTax(); virtual void sTaxDetail(); virtual void sQtyUOMChanged(); virtual void sPriceUOMChanged(); virtual void sCalcWoUnitCost(); virtual void sHandleButton(); virtual void sHandleScheduleDate(); protected slots: virtual void languageChange(); virtual void reject(); private: QString _custName; double _priceRatio; QDate _cScheduledDate; int _preferredWarehouseid; int _shiptoid; int _supplyOrderId; int _leadTime; int _custid; int _soheadid; int _soitemid; int _mode; int _initialMode; int _itemsrc; bool _modified; bool _canceling; bool _error; int _availabilityLastItemid; int _availabilityLastWarehousid; QDate _availabilityLastSchedDate; bool _availabilityLastShow; bool _availabilityLastShowIndent; double _originalQtyOrd; double _availabilityQtyOrdered; bool _invIsFractional; bool _updateItemsite; bool _updatePrice; int _priceUOMCache; double _qtyOrderedCache; double _supplyOrderQtyCache; QDate _supplyOrderDueDateCache; double _cachedPct; double _cachedRate; int _taxzoneid; QStandardItemModel *_itemchar; int _invuomid; double _qtyinvuomratio; double _priceinvuomratio; double _qtyreserved; QDate _scheduledDateCache; QString _costmethod; QString _priceType; QString _priceMode; QString _supplyOrderType; // For holding variables for characteristic pricing QList _charVars; enum { CHAR_ID = 0, CHAR_VALUE = 1, CHAR_PRICE = 2 }; enum { ITEM_ID = 0, CUST_ID = 1, SHIPTO_ID = 2, QTY = 3, CURR_ID = 4, EFFECTIVE = 5 }; }; #endif // SALESORDERITEM_H qt-client-4.1.0/guiclient/salesOrderItem.ui000066400000000000000000002450501217451700100206640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesOrderItem 0 0 846 849 0 0 Sales Order Item 12 12 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Fixed 20 20 Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Fixed 20 20 Return Auth. #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Fixed 20 20 Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 61 20 0 &Close false &Save true 25 0 Qt::NoFocus Pre&vious Qt::NoFocus Ne&xt Qt::StrongFocus Cance&l Item Qt::Vertical QSizePolicy::Expanding 20 0 0 0 5 5 0 0 Qt::StrongFocus S&ite: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse Qt::ClickFocus true WComboBox::Sold Qt::Vertical 20 0 Qt::Horizontal 40 20 Customer P/N: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::NoFocus Su&bstitute for: false Qt::StrongFocus false Qt::NoFocus ... Qt::Horizontal 0 0 0 0 &Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyOrdered Qt::StrongFocus Qt::AlignRight Qty. &UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 _qtyUOM Qt::ClickFocus Qt::Horizontal 40 20 true Qty. Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true 0 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 80 32767 Qt::StrongFocus Qt::AlignRight Qt::Horizontal 0 20 &Net Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 _netUnitPrice CurrDisplay::SalesPrice false Qt::NoFocus ... Qt::Horizontal 0 20 Qt::Horizontal 40 20 Pric&e UOM: Qt::RichText Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 _priceUOM Qt::ClickFocus Qt::Horizontal 0 20 Extended Price: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 Qt::NoFocus CurrDisplay::ExtPrice false false false false Qt::Horizontal 0 20 Cust Discount %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 Sc&heduled Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _scheduledDate &Promised Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _promisedDate Qt::Horizontal 51 20 Warranty 0 1 0 Suppl&y 12 Show Availability false Inventory true false Item Sources false Dependencies false Substitutes Qt::Horizontal 40 20 0 true 16777215 16777215 Availability false On Hand: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Allocated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unallocated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter On Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Available: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Lead Time: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Horizontal 0 20 Create Supply Order true Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 32767 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 0 true Qt::Horizontal 0 20 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _supplyOrderDueDate Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter false Supplying Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _supplyWarehouse false WComboBox::Supply Drop Ship Qt::Horizontal 0 20 Override Price: _supplyOverridePrice CurrDisplay::Cost false false true Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical 259 16 Qt::Horizontal 0 121 false 0 false Qt::NoFocus Show dependencies as Indented BOM false Qt::NoFocus true false 0 0 0 100 History Costs History true Sales History Qt::Horizontal 40 20 0 Ch&aracteristics Base Price: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 140 0 CurrDisplay::Cost false false Qt::Horizontal 221 0 QAbstractItemView::AllEditTriggers false false De&tail Costs CurrDisplay::Cost false false 0 0 List Price Discount %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice Customer Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unit Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter List Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Margin: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Unit Cost Markup %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter CurrDisplay::SalesPrice Tax 0 24 Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false true None XComboBox::TaxTypes Qt::Horizontal 40 20 Tax: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 CurrDisplay::SalesPrice false Qt::Vertical 20 0 Qt::Horizontal 21 204 N&otes 0 5 Qt::StrongFocus Co&mments 5 5 0 0 Qt::StrongFocus Accountin&g Qt::Horizontal 111 20 Qt::Vertical 20 101 Alternate Cost of Sales Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Alternate Revenue Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::StrongFocus true Qt::StrongFocus Comments QWidget

    comments.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DateCluster QWidget
    datecluster.h
    DLineEdit QWidget
    datecluster.h
    1
    GLCluster QWidget
    glcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    ItemLineEdit XLineEdit
    itemlineedit.h
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _subItem _qtyOrdered _qtyUOM _discountFromCust _netUnitPrice _priceUOM _scheduledDate _promisedDate _warranty _tabs _showAvailability _inventoryButton _dependenciesButton _createSupplyOrder _supplyOrderQty _supplyOrderDueDate _supplyWarehouse _supplyDropShip _supplyOverridePrice _baseUnitPrice _itemcharView _taxtype _tax _notes _comments _save _close _cancel _close clicked() salesOrderItem reject() 821 55 20 20 _item valid(bool) _save setEnabled(bool) 39 67 821 79 _item warehouseIdChanged(int) _warehouse setId(int) 39 67 525 92 _item aliasChanged(QString) _customerPN setText(QString) 39 67 349 153 _netUnitPrice effectiveChanged(QDate) _extendedPrice setEffective(QDate) 589 316 589 397 _netUnitPrice idChanged(int) _extendedPrice setId(int) 589 316 589 397 _sub toggled(bool) _subItem setEnabled(bool) 73 183 289 184 _sub toggled(bool) _subItemList setEnabled(bool) 73 183 364 191 _subItemList clicked() _subItem sList() 364 191 289 184 _netUnitPrice effectiveChanged(QDate) _tax setEffective(QDate) 589 316 198 527 _netUnitPrice effectiveChanged(QDate) _customerPrice setEffective(QDate) 589 316 158 527 _netUnitPrice idChanged(int) _listPrice setId(int) 589 316 158 527 _netUnitPrice effectiveChanged(QDate) _listPrice setEffective(QDate) 589 316 158 527 _netUnitPrice idChanged(int) _customerPrice setId(int) 589 316 158 527 _netUnitPrice effectiveChanged(QDate) _supplyOverridePrice setEffective(QDate) 589 316 749 768 _netUnitPrice idChanged(int) _supplyOverridePrice setId(int) 589 316 749 768 _warehouse newID(int) _supplyWarehouse setId(int) 465 82 665 733 _showAvailability toggled(bool) _availabilityGroup setEnabled(bool) 157 533 107 797 _showAvailability toggled(bool) _inventoryButton setEnabled(bool) 138 533 267 534 _showAvailability toggled(bool) _dependenciesButton setEnabled(bool) 92 533 506 534 _showAvailability toggled(bool) _showIndented setEnabled(bool) 91 533 102 577 _showAvailability toggled(bool) _availability setEnabled(bool) 78 533 84 577 _showAvailability toggled(bool) _itemSourcesButton setEnabled(bool) 110 523 330 524 _showAvailability toggled(bool) _itemsrcp setEnabled(bool) 110 523 422 678 _showAvailability toggled(bool) _substitutesButton setEnabled(bool) 110 499 564 500 _showAvailability toggled(bool) _subs setEnabled(bool) 110 499 89 573 _netUnitPrice effectiveChanged(QDate) _unitCost setEffective(QDate) 492 279 277 519 _netUnitPrice idChanged(int) _unitCost setId(int) 492 279 277 519 _netUnitPrice effectiveChanged(QDate) _margin setEffective(QDate) 492 279 277 691 _netUnitPrice idChanged(int) _margin setId(int) 492 279 277 691 qt-client-4.1.0/guiclient/salesRep.cpp000066400000000000000000000301441217451700100176610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesRep.h" #include #include #include #include "crmaccount.h" #include "employee.h" #include "errorReporter.h" #include "guiErrorCheck.h" salesRep::salesRep(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_crmaccountButton, SIGNAL(clicked()), this, SLOT(sCrmaccount())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sCheck())); _commPrcnt->setValidator(omfgThis->percentVal()); _mode = cView; _crmacctid = -1; _empid = -1; _salesrepid = -1; _NumberGen = -1; } salesRep::~salesRep() { // no need to delete child widgets, Qt does it all for us } void salesRep::languageChange() { retranslateUi(this); } enum SetResponse salesRep::set(const ParameterList &pParams) { XSqlQuery saleset; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("crmacct_id", &valid); if (valid) _crmacctid = param.toInt(); param = pParams.value("salesrep_id", &valid); if (valid) _salesrepid = param.toInt(); if (_salesrepid > 0 || _crmacctid > 0) if (! sPopulate()) return UndefinedError; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; saleset.exec("SELECT NEXTVAL('salesrep_salesrep_id_seq') AS salesrep_id;"); if (saleset.first()) _salesrepid = saleset.value("salesrep_id").toInt(); else if (saleset.lastError().type() == QSqlError::NoError) { systemError(this, saleset.lastError().text(), __FILE__, __LINE__); return UndefinedError; } if(((_metrics->value("CRMAccountNumberGeneration") == "A") || (_metrics->value("CRMAccountNumberGeneration") == "O")) && _number->text().isEmpty() ) { XSqlQuery numq; numq.exec("SELECT fetchCRMAccountNumber() AS number;"); if (numq.first()) { _number->setText(numq.value("number")); _NumberGen = numq.value("number").toInt(); } } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } bool canEdit = (cNew == _mode || cEdit == _mode); _number->setEnabled(canEdit); _name->setEnabled(canEdit); _active->setEnabled(canEdit); _commPrcnt->setEnabled(canEdit); return NoError; } int salesRep::id() const { return _salesrepid; } /** \return one of cNew, cEdit, cView, ... \todo change possible modes to an enum in guiclient.h (and add cUnknown?) */ int salesRep::mode() const { return _mode; } void salesRep::sCheck() { _number->setText(_number->text().trimmed()); if ((_mode == cNew) && (_number->text().length())) { if (cNew == _mode && -1 != _NumberGen && _number->text().toInt() != _NumberGen) { XSqlQuery query; query.prepare("SELECT releaseCRMAccountNumber(:Number);"); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } XSqlQuery getq; getq.prepare( "SELECT salesrep_id " "FROM salesrep " "WHERE (UPPER(salesrep_number)=UPPER(:salesrep_number));" ); getq.bindValue(":salesrep_number", _number->text()); getq.exec(); if (getq.first()) { _salesrepid = getq.value("salesrep_id").toInt(); _mode = cEdit; sPopulate(); _number->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error checking for existing Sales Rep"), getq, __FILE__, __LINE__)) return; } } bool salesRep::save() { QList errors; errors << GuiErrorCheck(_number->text().isEmpty(), _number, tr("You must enter a Number for this Sales Rep.")) << GuiErrorCheck(! _commPrcnt->isValid() && _commPrcnt->text().isEmpty(), _commPrcnt, tr("You must enter a Commission Rate for this Sales Rep.")) ; XSqlQuery saveq; if((_mode == cEdit) && (!_active->isChecked())) { saveq.prepare("SELECT cust_id " "FROM custinfo " "WHERE ((cust_active) " "AND (cust_salesrep_id=:salesrep_id)) " "LIMIT 1; "); saveq.bindValue(":salesrep_id", _salesrepid); saveq.exec(); if (saveq.first()) { errors << GuiErrorCheck(true, _active, tr("This Sales Rep is used by an active Customer and must be marked as active.")); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), saveq, __FILE__, __LINE__)) return false; saveq.prepare("SELECT shipto_id " "FROM shiptoinfo JOIN custinfo ON (cust_id=shipto_cust_id) " "WHERE ((cust_active) AND (shipto_active) " "AND (shipto_salesrep_id=:salesrep_id)) " "LIMIT 1; "); saveq.bindValue(":salesrep_id", _salesrepid); saveq.exec(); if (saveq.first()) { errors << GuiErrorCheck(true, _active, tr("This Sales Rep is used by an active Ship To and must be marked as active.")); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), saveq, __FILE__, __LINE__)) return false; } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Sales Rep"), errors)) return false; if (_mode == cNew) saveq.prepare( "INSERT INTO salesrep ( salesrep_id," " salesrep_number, salesrep_active," " salesrep_name, salesrep_commission" ") VALUES ( :salesrep_id," " :salesrep_number, :salesrep_active," " :salesrep_name, :salesrep_commission );" ); else if (_mode == cEdit) { saveq.prepare( "UPDATE salesrep " "SET salesrep_active=:salesrep_active, " " salesrep_number=:salesrep_number," " salesrep_name=:salesrep_name, " " salesrep_commission=:salesrep_commission " "WHERE (salesrep_id=:salesrep_id);" ); } saveq.bindValue(":salesrep_id", _salesrepid); saveq.bindValue(":salesrep_number", _number->text()); saveq.bindValue(":salesrep_name", _name->text()); saveq.bindValue(":salesrep_commission", (_commPrcnt->toDouble() / 100)); saveq.bindValue(":salesrep_active", QVariant(_active->isChecked())); saveq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error saving Sales Rep"), saveq, __FILE__, __LINE__)) return false; XSqlQuery crmq; crmq.prepare("SELECT crmacct_id, crmacct_emp_id" " FROM crmacct" " WHERE crmacct_salesrep_id=:id;"); crmq.bindValue(":id", _salesrepid); crmq.exec(); if (crmq.first()) { _crmacctid = crmq.value("crmacct_id").toInt(); _empid = crmq.value("crmacct_emp_id").toInt(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), crmq, __FILE__, __LINE__)) return false; else if (ErrorReporter::error(QtCriticalMsg, this, tr("CRM Account Error"), tr("

    The Sales Rep should now have a CRM Account, " "but that CRM Account could not be found. Please " "check the database server log for errors."))) return false; omfgThis->sSalesRepUpdated(_salesrepid); emit saved(_salesrepid); return true; } void salesRep::sSave() { if (save()) done(_salesrepid); } void salesRep::sCrmaccount() { if (cNew == _mode || cEdit == _mode) if (! save()) return; ParameterList params; params.append("crmacct_id", _crmacctid); if ((cView == _mode && _privileges->check("ViewAllCRMAccounts")) || (cView == _mode && _privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner) || (cEdit == _mode && _privileges->check("ViewAllCRMAccounts") && ! _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("ViewPersonalCRMAccounts") && ! _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else if ((cEdit == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if ((cNew == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cNew == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else { qWarning("tried to open CRM Account window without privilege"); return; } params.append("modal"); crmaccount *newdlg = new crmaccount(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } bool salesRep::sPopulate() { XSqlQuery getq; if (_salesrepid > 0) { getq.prepare("SELECT salesrep_number AS number, salesrep_active AS active," " salesrep_name AS name, salesrep_commission AS comm," " crmacct_id, crmacct_emp_id," " crmacct_owner_username" " FROM salesrep" " JOIN crmacct ON (salesrep_id=crmacct_salesrep_id)" " WHERE (salesrep_id=:id);" ); getq.bindValue(":id", _salesrepid); } else if (_crmacctid > 0) { getq.prepare("SELECT crmacct_number AS number, crmacct_active AS active," " crmacct_name AS name, NULL AS comm," " crmacct_id, crmacct_emp_id," " crmacct_owner_username" " FROM crmacct" " WHERE (crmacct_id=:id);" ); getq.bindValue(":id", _crmacctid); } getq.exec(); if (getq.first()) { _number->setText(getq.value("number").toString()); _active->setChecked(getq.value("active").toBool()); _name->setText(getq.value("name").toString()); QVariant commission = getq.value("comm"); if (! commission.isNull()) _commPrcnt->setDouble(commission.toDouble() * 100); _crmacctid = getq.value("crmacct_id").toInt(); _empid = getq.value("crmacct_emp_id").toInt(); _crmowner = getq.value("crmacct_owner_username").toString(); _number->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), getq, __FILE__, __LINE__)) return false; _crmaccountButton->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); return true; } void salesRep::reject() { qDebug("close event"); if(cNew == _mode && -1 != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } QDialog::reject(); } qt-client-4.1.0/guiclient/salesRep.h000066400000000000000000000025711217451700100173310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESREP_H #define SALESREP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_salesRep.h" class salesRep : public XDialog, public Ui::salesRep { Q_OBJECT public: salesRep(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~salesRep(); Q_INVOKABLE virtual int id() const; Q_INVOKABLE virtual int mode() const; public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual bool sPopulate(); virtual void sSave(); virtual void reject(); protected slots: virtual void languageChange(); virtual bool save(); virtual void sCrmaccount(); signals: void populated(); void newId(int); void newMode(int); void saved(int); private: int _crmacctid; int _empid; int _mode; int _NumberGen; int _salesrepid; QString _crmowner; }; #endif // SALESREP_H qt-client-4.1.0/guiclient/salesRep.ui000066400000000000000000000103661217451700100175200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesRep 0 0 439 143 Sales Representative Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save &Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number N&ame: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Comm. &Prcnt.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _commPrcnt Qt::Vertical 20 40 0 0 Qt::AlignRight false CRM Account... &Active true XLineEdit QLineEdit

    xlineedit.h
    1 _buttonBox rejected() salesRep reject() 420 90 238 80 qt-client-4.1.0/guiclient/salesReps.cpp000066400000000000000000000105651217451700100200510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesReps.h" #include #include #include #include #include #include #include "errorReporter.h" #include "guiclient.h" #include "salesRep.h" #include "storedProcErrorLookup.h" salesReps::salesReps(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(omfgThis, SIGNAL(salesRepUpdated(int)), this, SLOT(sFillList())); connect(_salesrep, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainSalesReps")) { connect(_salesrep, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_salesrep, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_salesrep, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_salesrep, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _salesrep->addColumn(tr("Number"), 70, Qt::AlignLeft, true, "salesrep_number"); _salesrep->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "salesrep_name"); _salesrep->addColumn(tr("Active"), 50, Qt::AlignCenter,true, "salesrep_active"); sFillList(); } salesReps::~salesReps() { // no need to delete child widgets, Qt does it all for us } void salesReps::languageChange() { retranslateUi(this); } void salesReps::sDelete() { if (QMessageBox::question(this, tr("Delete Sales Rep?"), tr("

    Are you sure you want to delete the " "selected Sales Rep?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM salesrep WHERE (salesrep_id=:salesrep_id);"); delq.bindValue(":salesrep_id", _salesrep->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting"), delq, __FILE__, __LINE__)) return; omfgThis->sSalesRepUpdated(_salesrep->id()); } void salesReps::sNew() { ParameterList params; params.append("mode", "new"); salesRep newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void salesReps::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("salesrep_id", _salesrep->id()); salesRep newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void salesReps::sView() { ParameterList params; params.append("mode", "view"); params.append("salesrep_id", _salesrep->id()); salesRep newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void salesReps::sFillList() { XSqlQuery getq; getq.exec("SELECT * FROM salesrep ORDER BY salesrep_number;" ); _salesrep->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error getting Sales Reps"), getq, __FILE__, __LINE__)) return; } void salesReps::sPopulateMenu( QMenu * menu ) { QAction *menuItem; menuItem = menu->addAction(tr("Edit Sales Rep..."), this, SLOT(sEdit())); if (!_privileges->check("MaintainSalesReps")) menuItem->setEnabled(FALSE); menuItem = menu->addAction(tr("View Sales Rep..."), this, SLOT(sView())); if ((!_privileges->check("MaintainSalesReps")) && (!_privileges->check("ViewSalesReps"))) menuItem->setEnabled(FALSE); menuItem = menu->addAction(tr("Delete Sales Rep..."), this, SLOT(sDelete())); if (!_privileges->check("MaintainSalesReps")) menuItem->setEnabled(FALSE); } void salesReps::sPrint() { orReport report("SalesRepsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/salesReps.h000066400000000000000000000017751217451700100175210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SALESREPS_H #define SALESREPS_H #include "xwidget.h" #include "ui_salesReps.h" class salesReps : public XWidget, public Ui::salesReps { Q_OBJECT public: salesReps(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~salesReps(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * menu ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // SALESREPS_H qt-client-4.1.0/guiclient/salesReps.ui000066400000000000000000000115461217451700100177040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. salesReps 0 0 600 400 List Sales Representatives 0 Sales Representatives: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

    xtreewidget.h
    _salesrep _new _edit _view _delete _print _close _salesrep itemSelected(int) _edit animateClick() 20 20 20 20 _close clicked() salesReps close() 20 20 20 20 _salesrep valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/scrapTrans.cpp000066400000000000000000000171121217451700100202230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scrapTrans.h" #include #include #include #include #include "distributeInventory.h" #include "inputManager.h" #include "storedProcErrorLookup.h" scrapTrans::scrapTrans(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_qty,SIGNAL(textChanged(const QString&)), this, SLOT(sPopulateQty())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateQOH(int))); _captive = FALSE; _item->setType(ItemLineEdit::cGeneralInventory | ItemLineEdit::cActive); _warehouse->setType(WComboBox::AllActiveInventory); _qty->setValidator(omfgThis->transQtyVal()); _beforeQty->setPrecision(omfgThis->qtyVal()); _afterQty->setPrecision(omfgThis->qtyVal()); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } scrapTrans::~scrapTrans() { // no need to delete child widgets, Qt does it all for us } void scrapTrans::languageChange() { retranslateUi(this); } enum SetResponse scrapTrans::set(const ParameterList &pParams) { XSqlQuery scrapet; XWidget::set(pParams); QVariant param; bool valid; int invhistid = -1; param = pParams.value("invhist_id", &valid); if (valid) invhistid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _usernameLit->clear(); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); } else if (param.toString() == "view") { _mode = cView; _transDate->setEnabled(FALSE); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _qty->setEnabled(FALSE); _documentNum->setEnabled(FALSE); _notes->setEnabled(FALSE); _post->hide(); _close->setText(tr("&Close")); scrapet.prepare( "SELECT * " "FROM invhist " "WHERE (invhist_id=:invhist_id);" ); scrapet.bindValue(":invhist_id", invhistid); scrapet.exec(); if (scrapet.first()) { _transDate->setDate(scrapet.value("invhist_transdate").toDate()); _username->setText(scrapet.value("invhist_user").toString()); _qty->setDouble(scrapet.value("invhist_invqty").toDouble()); _beforeQty->setDouble(scrapet.value("invhist_qoh_before").toDouble()); _afterQty->setDouble(scrapet.value("invhist_qoh_after").toDouble()); _documentNum->setText(scrapet.value("invhist_ordnumber")); _notes->setText(scrapet.value("invhist_comments").toString()); _item->setItemsiteid(scrapet.value("invhist_itemsite_id").toInt()); } else if (scrapet.lastError().type() != QSqlError::NoError) { systemError(this, scrapet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } } return NoError; } void scrapTrans::sPost() { XSqlQuery scrapPost; struct { bool condition; QString msg; QWidget *widget; } error[] = { { ! _item->isValid(), tr("You must select an Item before posting this transaction."), _item }, { _qty->text().length() == 0, tr("

    You must enter a Quantity before posting this Transaction."), _qty }, { true, "", NULL } }; int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Post Transaction"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); scrapPost.exec("BEGIN;"); // because of possible distribution cancelations scrapPost.prepare( "SELECT invScrap(itemsite_id, :qty, :docNumber," " :comments, :date) AS result " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); scrapPost.bindValue(":qty", _qty->toDouble()); scrapPost.bindValue(":docNumber", _documentNum->text()); scrapPost.bindValue(":comments", _notes->toPlainText()); scrapPost.bindValue(":item_id", _item->id()); scrapPost.bindValue(":warehous_id", _warehouse->id()); scrapPost.bindValue(":date", _transDate->date()); scrapPost.exec(); if (scrapPost.first()) { int result = scrapPost.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("invScrap", result), __FILE__, __LINE__); return; } else if (scrapPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, scrapPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(scrapPost.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information(this, tr("Scrap Transaction"), tr("Transaction Canceled") ); return; } scrapPost.exec("COMMIT;"); if (_captive) close(); else { _close->setText(tr("&Close")); _item->setId(-1); _qty->clear(); _documentNum->clear(); _notes->clear(); _beforeQty->clear(); _afterQty->clear(); _transDate->setDate(omfgThis->dbDate()); _item->setFocus(); } } else if (scrapPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, scrapPost.lastError().databaseText(), __FILE__, __LINE__); return; } else { rollback.exec(); systemError( this, tr("

    No transaction was done because Item %1 " "was not found at Site %2.") .arg(_item->itemNumber()).arg(_warehouse->currentText())); } } void scrapTrans::sPopulateQOH(int pWarehousid) { XSqlQuery scrapPopulateQOH; if (_mode != cView) { scrapPopulateQOH.prepare( "SELECT itemsite_qtyonhand " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); scrapPopulateQOH.bindValue(":item_id", _item->id()); scrapPopulateQOH.bindValue(":warehous_id", pWarehousid); scrapPopulateQOH.exec(); if (scrapPopulateQOH.first()) { _cachedQOH = scrapPopulateQOH.value("itemsite_qtyonhand").toDouble(); _beforeQty->setDouble(scrapPopulateQOH.value("itemsite_qtyonhand").toDouble()); if (_item->isFractional()) _qty->setValidator(omfgThis->transQtyVal()); else _qty->setValidator(new QIntValidator(this)); sPopulateQty(); } else if (scrapPopulateQOH.lastError().type() != QSqlError::NoError) { systemError(this, scrapPopulateQOH.lastError().databaseText(), __FILE__, __LINE__); return; } } } void scrapTrans::sPopulateQty() { _afterQty->setDouble(_cachedQOH - _qty->toDouble()); } qt-client-4.1.0/guiclient/scrapTrans.h000066400000000000000000000021231217451700100176640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SCRAPTRANS_H #define SCRAPTRANS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_scrapTrans.h" class scrapTrans : public XWidget, public Ui::scrapTrans { Q_OBJECT public: scrapTrans(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~scrapTrans(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sPost(); virtual void sPopulateQOH( int pWarehousid ); virtual void sPopulateQty(); protected slots: virtual void languageChange(); private: int _mode; bool _captive; double _cachedQOH; }; #endif // SCRAPTRANS_H qt-client-4.1.0/guiclient/scrapTrans.ui000066400000000000000000000224711217451700100200620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. scrapTrans 0 0 529 410 Scrap Transaction Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 &Cancel false &Post true true Qt::Vertical QSizePolicy::Expanding 20 20 80 32767 Before Qt::AlignCenter After Qt::AlignCenter &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Scrap Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Notes: 0 1 true Qt::Horizontal QSizePolicy::Expanding 47 65 DLineEdit QWidget

    datecluster.h
    1 ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _transDate _item _warehouse _qty _documentNum _notes _post _close parameter.h _item valid(bool) _post setEnabled(bool) 20 20 20 20 _close clicked() scrapTrans close() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 qt-client-4.1.0/guiclient/scrapWoMaterialFromWIP.cpp000066400000000000000000000220361217451700100224050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scrapWoMaterialFromWIP.h" #include #include #include #include #include "inputManager.h" #include "distributeInventory.h" #include "postProduction.h" #include "returnWoMaterialItem.h" scrapWoMaterialFromWIP::scrapWoMaterialFromWIP(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_qty, SIGNAL(textChanged(const QString&)), this, SLOT(sHandleButtons())); connect(_scrap, SIGNAL(clicked()), this, SLOT(sScrap())); connect(_scrapComponent, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_scrapTopLevel, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_topLevelQty, SIGNAL(textChanged(const QString&)), this, SLOT(sHandleButtons())); connect(_topLevelQty, SIGNAL(textChanged(const QString&)), this, SLOT(sHandleButtons())); connect(_wo, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_womatl, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); _captive = FALSE; _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); _fromWOTC = FALSE; omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _wo->setType(cWoIssued); _qty->setValidator(omfgThis->qtyVal()); _topLevelQty->setValidator(omfgThis->qtyVal()); _qtyScrappedFromWIP->setPrecision(omfgThis->qtyVal()); adjustSize(); } scrapWoMaterialFromWIP::~scrapWoMaterialFromWIP() { // no need to delete child widgets, Qt does it all for us } void scrapWoMaterialFromWIP::languageChange() { retranslateUi(this); } enum SetResponse scrapWoMaterialFromWIP::set(const ParameterList &pParams) { XSqlQuery scrapet; XDialog::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("womatl_id", &valid); if (valid) { _captive = TRUE; scrapet.prepare("SELECT womatl_wo_id FROM womatl WHERE (womatl_id=:womatl_id); "); scrapet.bindValue(":womatl_id", param.toInt()); scrapet.exec(); if(scrapet.first()) { _wo->setId(scrapet.value("womatl_wo_id").toInt()); _wo->setEnabled(false); } _womatl->setId(param.toInt()); _womatl->setEnabled(false); } param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setEnabled(false); } param = pParams.value("allowTopLevel", &valid); if (valid) _scrapTopLevel->setEnabled(param.toBool()); param = pParams.value("fromWOTC", &valid); if (valid) _fromWOTC = TRUE; param = pParams.value("wooper_id", &valid); if (valid) _womatl->setWooperid(param.toInt()); param = pParams.value("transDate", &valid); if (valid) _transDate->setDate(param.toDate()); param = pParams.value("canPostProd", &valid); if (valid) { connect(_scrapTopLevel, SIGNAL(toggled(bool)), _prodPosted, SLOT(setEnabled(bool))); _prodPosted->setForgetful(false); } return NoError; } void scrapWoMaterialFromWIP::sScrap() { XSqlQuery scrapScrap; if (!_transDate->isValid()) { QMessageBox::critical(this, tr("Invalid date"), tr("You must enter a valid transaction date.") ); _transDate->setFocus(); return; } if (_scrapComponent->isChecked() && _qty->toDouble() <= 0) { QMessageBox::critical( this, tr("Cannot Scrap from WIP"), tr("You must enter a quantity of the selected W/O Material to Scrap." ) ); _qty->setFocus(); return; } else if (_scrapComponent->isChecked() && _qty->toDouble() > _womatl->qtyIssued()) { QMessageBox::critical( this, tr("Cannot Scrap from WIP"), tr("The component quantity to scrap must be less than or equal to quantity issued." ) ); _qty->setFocus(); return; } else if (_scrapTopLevel->isChecked() && _topLevelQty->toDouble() <= 0) { QMessageBox::critical( this, tr("Cannot Scrap from WIP"), tr("You must enter a quantity of the W/O Top Level Item to Scrap." ) ); _topLevelQty->setFocus(); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); int itemlocseries = 0; int invhistid = 0; if (_scrapComponent->isChecked()) { scrapScrap.prepare("SELECT scrapWoMaterial(:womatl_id, :qty, :date) AS result;"); scrapScrap.bindValue(":womatl_id", _womatl->id()); scrapScrap.bindValue(":qty", _qty->toDouble()); scrapScrap.bindValue(":date", _transDate->date()); } else if (_scrapTopLevel->isChecked()) { if (!_prodPosted->isChecked()) { // Post production first postProduction newdlg(this); ParameterList params; newdlg.set(params); newdlg._transDate->setDate(_transDate->date()); newdlg._transDate->setEnabled(false); newdlg._wo->setId(_wo->id()); newdlg._wo->setEnabled(false); newdlg._scrap->setForgetful(true); newdlg._scrap->setChecked(false); newdlg._scrap->hide(); newdlg._qty->setText(_topLevelQty->text()); newdlg._qty->setEnabled(false); newdlg._immediateTransfer->setForgetful(true); newdlg._immediateTransfer->setChecked(false); newdlg._immediateTransfer->setEnabled(false); itemlocseries = newdlg.exec(); if (itemlocseries) { XSqlQuery invhist; invhist.prepare("SELECT invhist_id FROM invhist " "WHERE ((invhist_series=:itemlocseries) " " AND (invhist_transtype='RM')); "); invhist.bindValue(":itemlocseries", itemlocseries); invhist.exec(); if (invhist.first()) invhistid = invhist.value("invhist_id").toInt(); else { systemError( this, tr("A System Error occurred scrapping material for " "Work Order ID #%1, Error #%2.") .arg(_wo->id()) .arg(scrapScrap.value("result").toInt()), __FILE__, __LINE__); return; } } } scrapScrap.prepare("SELECT invScrap(itemsite_id, :qty, formatWoNumber(wo_id), " " :descrip, :date, :invhist_id, wo_prj_id) AS result" " FROM wo, itemsite" " WHERE ((wo_id=:wo_id)" " AND (itemsite_id=wo_itemsite_id));"); scrapScrap.bindValue(":wo_id", _wo->id()); scrapScrap.bindValue(":qty", _topLevelQty->toDouble()); scrapScrap.bindValue(":descrip", tr("Top Level Item")); scrapScrap.bindValue(":date", _transDate->date()); if (invhistid) scrapScrap.bindValue(":invhist_id", invhistid); } XSqlQuery trans; trans.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations scrapScrap.exec(); if (scrapScrap.first()) { if (scrapScrap.value("result").toInt() < 0) { rollback.exec(); systemError( this, tr("A System Error occurred scrapping material for " "Work Order ID #%1, Error #%2.") .arg(_wo->id()) .arg(scrapScrap.value("result").toInt()), __FILE__, __LINE__); return; } else { // scrapWoMaterial() returns womatlid, not itemlocSeries if (_scrapTopLevel->isChecked() && !invhistid) { if (distributeInventory::SeriesAdjust(scrapScrap.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Scrap Work Order Material"), tr("Transaction Canceled") ); return; } } else if (invhistid) { XSqlQuery post; post.prepare("SELECT postitemlocseries(:itemlocseries) AS result;"); post.bindValue(":itemlocseries", itemlocseries); post.exec(); } scrapScrap.exec("COMMIT;"); if (_captive) accept(); else { _qty->clear(); _wo->setId(_wo->id()); _womatl->setFocus(); } } } else { rollback.exec(); systemError( this, tr("A System Error occurred scrapping material for " "Work Order ID #%1\n\n%2") .arg(_wo->id()) .arg(scrapScrap.lastError().databaseText()), __FILE__, __LINE__ ); return; } } void scrapWoMaterialFromWIP::sHandleButtons() { if (_wo->id() != -1 && _wo->method() == "D") { QMessageBox::critical( this, windowTitle(), tr("Posting of scrap against disassembly work orders is not supported.") ); _wo->setId(-1); _wo->setFocus(); return; } _scrap->setEnabled(_wo->isValid() && ( (_scrapTopLevel->isChecked() && _topLevelQty->toDouble()) || (_scrapComponent->isChecked() && _qty->toDouble() && _womatl->isValid()) )); } qt-client-4.1.0/guiclient/scrapWoMaterialFromWIP.h000066400000000000000000000021721217451700100220510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SCRAPWOMATERIALFROMWIP_H #define SCRAPWOMATERIALFROMWIP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_scrapWoMaterialFromWIP.h" class scrapWoMaterialFromWIP : public XDialog, public Ui::scrapWoMaterialFromWIP { Q_OBJECT public: scrapWoMaterialFromWIP(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~scrapWoMaterialFromWIP(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sHandleButtons(); protected slots: virtual void languageChange(); virtual void sScrap(); private: bool _captive; bool _fromWOTC; }; #endif // SCRAPWOMATERIALFROMWIP_H qt-client-4.1.0/guiclient/scrapWoMaterialFromWIP.ui000066400000000000000000000450311217451700100222400ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. scrapWoMaterialFromWIP 0 0 571 589 Scrap Work Order Material Transaction &Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 Qt::StrongFocus Qt::Horizontal QSizePolicy::Minimum 20 20 &Cancel false &Post true Qt::Vertical QSizePolicy::Expanding 20 0 0 1 Top-Level Finished Item false Qt::Horizontal QSizePolicy::Minimum 30 20 false Qty.: _scrapTopLevel false 80 32767 Qt::AlignRight false Production receipt already posted true true Qt::Horizontal QSizePolicy::Expanding 0 20 Scrap Component true 0 Qt::Horizontal QSizePolicy::Minimum 30 20 0 0 0 345 175 Qt::StrongFocus 5 Qty. Scrapped from WIP: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical 20 0 DLineEdit QWidget
    datecluster.h
    WoCluster QWidget
    wocluster.h
    WomatlCluster QWidget
    womatlcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    _transDate _wo _scrapTopLevel _topLevelQty _scrapComponent _womatl _qty _close _close clicked() scrapWoMaterialFromWIP reject() 383 45 20 20 _scrapComponent toggled(bool) _qtyScrappedFromWIP setEnabled(bool) 52 237 265 432 _scrapComponent toggled(bool) _qty setEnabled(bool) 52 237 246 469 _scrapComponent toggled(bool) _womatl setEnabled(bool) 52 237 86 266 _scrapComponent toggled(bool) _qtyScrappedFromWIPLit setEnabled(bool) 52 237 88 443 _scrapComponent toggled(bool) _qtyLit setEnabled(bool) 52 237 88 470 _scrapTopLevel toggled(bool) _topLevelQtyLit setEnabled(bool) 52 180 94 208 _scrapTopLevel toggled(bool) _topLevelQty setEnabled(bool) 52 180 187 208 _wo newId(int) _womatl setWoid(int) 46 46 86 266 _womatl valid(bool) _scrap setEnabled(bool) 86 266 383 70 _womatl newQtyScrappedFromWIP(double) _qtyScrappedFromWIP setDouble(double) 86 266 245 440
    qt-client-4.1.0/guiclient/scriptEditor.cpp000066400000000000000000000356241217451700100205660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scriptEditor.h" #include #include #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "jsHighlighter.h" #include "package.h" #include "storedProcErrorLookup.h" #define DEBUG false static QString lastSaveDir = QString(); scriptEditor::scriptEditor(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); setWindowModality(Qt::WindowModal); connect(_export, SIGNAL(clicked()), this, SLOT(sSaveFile())); connect(_find, SIGNAL(clicked()), this, SLOT(sFind())); connect(_findText,SIGNAL(editingFinished()), this, SLOT(sFindSignal())); connect(_import, SIGNAL(clicked()), this, SLOT(sImport())); connect(_line, SIGNAL(editingFinished()), this, SLOT(sGoto())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _highlighter = new JSHighlighter(_source->document()); _document = _source->document(); _document->setDefaultFont(QFont("Courier")); _package->populate("SELECT pkghead_id, pkghead_name, pkghead_name " "FROM pkghead " "ORDER BY pkghead_name;"); connect(_document, SIGNAL(blockCountChanged(int)), this, SLOT(sBlockCountChanged(int))); connect(_document, SIGNAL(modificationChanged(bool)), this, SLOT(setWindowModified(bool))); connect(_source, SIGNAL(cursorPositionChanged()), this, SLOT(sPositionChanged())); _package->setEnabled(package::userHasPriv(cEdit)); _scriptid = -1; _pkgheadidOrig = -1; _findCnt = 0; QSettings settings("xTuple.com", "scriptEditor"); lastSaveDir = settings.value("LastDirectory").toString(); } scriptEditor::~scriptEditor() { QSettings settings("xTuple.com", "scriptEditor"); settings.setValue("LastDirectory",lastSaveDir); // no need to delete child widgets, Qt does it all for us } void scriptEditor::languageChange() { retranslateUi(this); } void scriptEditor::closeEvent(QCloseEvent *event) { if (_document->isModified()) { switch (QMessageBox::question(this, tr("Save Changes?"), tr("Do you want to save your changes?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel)) { case QMessageBox::Yes: if (sSave()) event->accept(); else event->ignore(); break; case QMessageBox::No: event->accept(); break; case QMessageBox::Cancel: default: event->ignore(); break; } } else event->accept(); } enum SetResponse scriptEditor::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") setMode(cNew); else if (param.toString() == "edit") setMode(cEdit); else if (param.toString() == "view") setMode(cView); } // follow setMode because populate() might change it param = pParams.value("script_id", &valid); if (valid) { _scriptid = param.toInt(); populate(); } param = pParams.value("script_name", &valid); if (valid) { _name->setText(param.toString()); _name->setEnabled(false); } return NoError; } void scriptEditor::setMode(const int pmode) { if (DEBUG) qDebug("scriptEditor::setMode(%d)", pmode); switch (pmode) { case cNew: case cEdit: if (DEBUG) qDebug("scriptEditor::setMode(%d) case new/edit", pmode); _name->setEnabled(true); _order->setEnabled(true); _notes->setReadOnly(false); _source->setReadOnly(false); _enabled->setEnabled(true); _save->show(); if (pmode == cNew) _name->setFocus(); else _save->setFocus(); break; case cView: default: if (DEBUG) qDebug("scriptEditor::setMode(%d) case view/default", pmode); _name->setEnabled(FALSE); _order->setEnabled(FALSE); _notes->setReadOnly(TRUE); _source->setReadOnly(TRUE); _enabled->setEnabled(FALSE); _save->hide(); _import->setEnabled(false); _package->setEnabled(false); _close->setFocus(); }; _mode = pmode; } bool scriptEditor::sSave() { QList errors; errors << GuiErrorCheck(_name->text().trimmed().isEmpty(), _name, tr("

    You must enter a valid name for this Script.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save CRM Account"), errors)) return false; QScriptEngine engine; if (!engine.canEvaluate(_source->toPlainText()) || _source->toPlainText().length() == 0) { if (QMessageBox::question(this, windowTitle(), tr("

    The script appears incomplete are you sure you want to save?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) != QMessageBox::Yes) return false; } QMessageBox save; save.setText("How do you want to save your changes?"); QPushButton *cancel = save.addButton(QMessageBox::Cancel); QPushButton *db = save.addButton(tr("Database only"), QMessageBox::AcceptRole); QPushButton *file = save.addButton(tr("File only"), QMessageBox::AcceptRole); QPushButton *both = save.addButton(tr("Database and File"),QMessageBox::AcceptRole); QString _importFileName; // TODO: make this a private class member? save.setDefaultButton(_importFileName.isEmpty() ? db : both); save.setEscapeButton((QAbstractButton*)cancel); save.exec(); if (save.clickedButton() == (QAbstractButton*)db && sSaveToDB()) { close(); return true; } else if (save.clickedButton() == (QAbstractButton*)file && sSaveFile()) { close(); return true; } else if (save.clickedButton() == (QAbstractButton*)both && sSaveFile() && sSaveToDB()) { close(); return true; } else if (save.clickedButton() == (QAbstractButton*)cancel) return false; else { qWarning("scriptEditor::sSave() bug - unknown button clicked"); return false; } return false; } bool scriptEditor::sSaveToDB() { XSqlQuery saveq; if (_mode == cNew) saveq.prepare( "INSERT INTO script " "(script_id, script_name, script_notes, script_order, script_enabled, script_source) " "VALUES " "(DEFAULT, :script_name, :script_notes, :script_order, :script_enabled, E:script_source) " "RETURNING script_id;" ); else if (_mode == cEdit) saveq.prepare( "UPDATE script " "SET script_name=:script_name, script_notes=:script_notes," " script_order=:script_order, script_enabled=:script_enabled," " script_source=E:script_source " "WHERE (script_id=:script_id) " "RETURNING script_id;" ); saveq.bindValue(":script_id", _scriptid); saveq.bindValue(":script_name", _name->text()); saveq.bindValue(":script_order", _order->value()); saveq.bindValue(":script_enabled", QVariant(_enabled->isChecked())); saveq.bindValue(":script_source", _source->toPlainText()); saveq.bindValue(":script_notes", _notes->text()); saveq.exec(); if (saveq.first()) _scriptid = saveq.value("script_id").toInt(); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving"), saveq, __FILE__, __LINE__)) return false; else { ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving"), tr("The script was not saved properly"), __FILE__, __LINE__); return false; } _document->setModified(false); if (_package->id() != _pkgheadidOrig && QMessageBox::question(this, tr("Move to different package?"), tr("Do you want to move this script " "to the %1 package?").arg(_package->code()), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { XSqlQuery moveq; moveq.prepare("SELECT movescript(:scriptid, :oldpkgid," " :newpkgid) AS result;"); moveq.bindValue(":scriptid", _scriptid); moveq.bindValue(":oldpkgid", _pkgheadidOrig); moveq.bindValue(":newpkgid", _package->id()); moveq.exec(); if (moveq.first()) { int result = moveq.value("result").toInt(); if (result >= 0) _pkgheadidOrig = _package->id(); else ErrorReporter::error(QtCriticalMsg, this, tr("Saved but Not Moved"), tr("

    The script was saved to its original location but " "could not be moved."), storedProcErrorLookup("movescript", result), __FILE__, __LINE__); } else // don't return immediately after reporting this error ErrorReporter::error(QtCriticalMsg, this, tr("Saved but Not Moved"), tr("

    The script was saved to its original location but " "could not be moved."), moveq, __FILE__, __LINE__); } setMode(cEdit); return true; } void scriptEditor::populate() { XSqlQuery getq; getq.prepare( "SELECT script.*, COALESCE(pkghead_id, -1) AS pkghead_id, " " COALESCE(pkghead_indev,true) AS editable " " FROM script, pg_class, pg_namespace " " LEFT OUTER JOIN pkghead ON (nspname=pkghead_name) " " WHERE ((script.tableoid=pg_class.oid)" " AND (relnamespace=pg_namespace.oid) " " AND (script_id=:script_id));" ); getq.bindValue(":script_id", _scriptid); getq.exec(); if (getq.first()) { _name->setText(getq.value("script_name").toString()); _order->setValue(getq.value("script_order").toInt()); _enabled->setChecked(getq.value("script_enabled").toBool()); _source->setText(getq.value("script_source").toString()); _notes->setText(getq.value("script_notes").toString()); _pkgheadidOrig = getq.value("pkghead_id").toInt(); _package->setId(_pkgheadidOrig); setWindowTitle("[*]" + tr("Script Editor - %1").arg(_name->text())); if (DEBUG) qDebug("scriptEditor::populate() editable = %d", getq.value("editable").toBool()); if (!getq.value("editable").toBool()) setMode(cView); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Script"), getq, __FILE__, __LINE__)) return; } void scriptEditor::sImport() { QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), lastSaveDir, tr("Script (*.script *.js)")); if(filename.isNull()) return; QFile file(filename); if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { QMessageBox::critical(this, tr("Could not import file"), file.errorString()); return; } QTextStream ts(&file); _source->setText(ts.readAll()); file.close(); QFileInfo fi(filename); lastSaveDir = fi.absolutePath(); } bool scriptEditor::sSaveFile() { QString filename = QFileDialog::getSaveFileName(this, tr("Save Script File"), lastSaveDir + QDir::separator() + _name->text().trimmed() + ".js", tr("Script (*.script *.js)")); if(filename.isNull()) return false; return saveFile(_source->toPlainText(), filename); } bool scriptEditor::saveFile(const QString &source, QString &filename) // input/output { QFileInfo fi(filename); if(fi.suffix().isEmpty()) filename += ".js"; QFile file(filename); if(!file.open(QIODevice::WriteOnly)) { QMessageBox::critical(0, tr("Could not export file"), file.errorString()); return false; } QTextStream ts(&file); ts.setCodec("UTF-8"); ts << source; file.close(); lastSaveDir = fi.absolutePath(); return true; } void scriptEditor::sGoto() { QTextCursor cursor = QTextCursor(_document->findBlockByNumber(_line->value() - 1)); _source->setTextCursor(cursor); _source->ensureCursorVisible(); _source->setFocus(); } /** Called from a timer set in sFindSignal. This function checks the _findCnt and if it's greater than 0 it will call sFind. This is done to prevent the calling of sFind twice under some circumstances. */ void scriptEditor::sFindDo() { if(_findCnt > 0) sFind(); } /** Called when _findText emits editingFinished. Increments count and triggers 1ms singleshot timer to call sFindDo. This part of a solution to prevent double-finding when the user edits a text and then clicks the find button which was causing sFind to be called twice. */ void scriptEditor::sFindSignal() { _findCnt++; QTimer::singleShot(1, this, SLOT(sFindDo())); } /** Called by the find button and sFindDo function. It decrements a _findCnt value down to 0 so sFindDo can evaluate if it needs to call this function after an initial editingFinished signal from the _findText widget is emitted. */ void scriptEditor::sFind() { _findCnt --; if(_findCnt < 0) _findCnt = 0; if (_findText->text().isEmpty()) return; QTextCursor oldposition = _source->textCursor(); bool found = _source->find(_findText->text()); if (!found && ! oldposition.atStart()) { int answer = QMessageBox::question(this, tr("Continue Search?"), tr("

    '%1' was not found. " "Start search from the beginning?") .arg(_findText->text()), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (answer == QMessageBox::Yes) { QTextCursor newposition = oldposition; newposition.movePosition(QTextCursor::Start); _source->setTextCursor(newposition); found = _source->find(_findText->text()); } else found = true; // a lie to prevent a useless message } if (!found) { QMessageBox::information(this, tr("Not Found"), tr("

    '%1' was not found.") .arg(_findText->text())); _source->setTextCursor(oldposition); } _source->setFocus(); } void scriptEditor::sBlockCountChanged(const int p) { _line->setMaximum(p); } void scriptEditor::sPositionChanged() { _line->setValue(_source->textCursor().blockNumber() + 1); } qt-client-4.1.0/guiclient/scriptEditor.h000066400000000000000000000031071217451700100202220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SCRIPTEDITOR_H #define SCRIPTEDITOR_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_scriptEditor.h" class JSHighlighter; class scriptEditor : public XWidget, public Ui::scriptEditor { Q_OBJECT public: scriptEditor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); ~scriptEditor(); static bool saveFile(const QString &source, QString &filename); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void populate(); virtual bool sSaveFile(); virtual bool sSaveToDB(); virtual void sFind(); virtual void sGoto(); virtual void sImport(); virtual bool sSave(); protected slots: virtual void languageChange(); virtual void setMode(const int); virtual void sBlockCountChanged(const int); virtual void sPositionChanged(); virtual void sFindSignal(); virtual void sFindDo(); protected: virtual void closeEvent(QCloseEvent *); private: int _mode; int _pkgheadidOrig; int _scriptid; JSHighlighter *_highlighter; QTextDocument *_document; int _findCnt; }; #endif // SCRIPT_H qt-client-4.1.0/guiclient/scriptEditor.ui000066400000000000000000000166411217451700100204170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. scriptEditor 0 0 672 594 [*]Script Editor &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Package: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _package false true [ Not in a Package ] &Close &Save Qt::Vertical QSizePolicy::Expanding 20 20 No&tes: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _notes &Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _order 999 &Enabled 0 1 Monospace Qt::Horizontal QSizePolicy::MinimumExpanding 20 20 Find Qt::Horizontal QSizePolicy::MinimumExpanding 20 20 &Import Script &Export Script Qt::Horizontal 40 20 XComboBox QComboBox

    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _name _package _notes _order _enabled _source _line _findText _find _import _export _save _close _close clicked() scriptEditor close() 495 34 20 20 qt-client-4.1.0/guiclient/scriptablePrivate.cpp000066400000000000000000000101751217451700100215700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scriptablePrivate.h" #include #include #include #include #include "scripttoolbox.h" #include "../scriptapi/qeventproto.h" #include "../scriptapi/parameterlistsetup.h" ScriptablePrivate::ScriptablePrivate(bool dialog, QWidget* parent) : _engine(0), _debugger(0), _scriptLoaded(false), _dialog(dialog), _parent(parent) { ScriptToolbox::setLastWindow(parent); } ScriptablePrivate::~ScriptablePrivate() { if(_engine) delete _engine; } QScriptEngine *ScriptablePrivate::engine() { if(!_engine) { _engine = new QScriptEngine(_parent); if (_preferences->boolean("EnableScriptDebug")) { _debugger = new QScriptEngineDebugger(_parent); _debugger->attachTo(_engine); } omfgThis->loadScriptGlobals(_engine); QScriptValue mywindow = _engine->newQObject(_parent); _engine->globalObject().setProperty("mywindow", mywindow); if(_dialog) { QScriptValue mydialog = _engine->newQObject(_parent); _engine->globalObject().setProperty("mydialog", mydialog); } } return _engine; } void ScriptablePrivate::loadScript(const QString& oName) { qDebug() << "Looking for a script " << oName; XSqlQuery scriptq; scriptq.prepare("SELECT script_source, script_order" " FROM script" " WHERE((script_name=:script_name)" " AND (script_enabled))" " ORDER BY script_order;"); scriptq.bindValue(":script_name", oName); scriptq.exec(); while(scriptq.next()) { if(engine()) { QString script = scriptHandleIncludes(scriptq.value("script_source").toString()); QScriptValue result = _engine->evaluate(script, _parent->objectName()); if (_engine->hasUncaughtException()) { int line = _engine->uncaughtExceptionLineNumber(); qDebug() << "uncaught exception at line" << line << ":" << result.toString(); } } else qDebug() << "could not initialize engine"; } } void ScriptablePrivate::loadScriptEngine() { if(_scriptLoaded || !_parent) return; _scriptLoaded = true; QStringList scriptList; // load scripts by class heirarchy name const QMetaObject *m = _parent->metaObject(); while(m) { scriptList.prepend(m->className()); m = m->superClass(); } // load scripts by object name QStringList parts = _parent->objectName().split(" "); QStringList search_parts; QString oName; while(!parts.isEmpty()) { search_parts.append(parts.takeFirst()); oName = search_parts.join(" "); scriptList.append(oName); } scriptList.removeDuplicates(); for (int i = 0; i < scriptList.size(); ++i) loadScript(scriptList.at(i)); } enum SetResponse ScriptablePrivate::callSet(const ParameterList & params) { loadScriptEngine(); enum SetResponse returnValue = NoError; if(_engine && _engine->globalObject().property("set").isFunction()) { QScriptValueList args; args << ParameterListtoScriptValue(_engine, params); QScriptValue tmp = _engine->globalObject().property("set").call(QScriptValue(), args); SetResponsefromScriptValue(tmp, returnValue); } return returnValue; } void ScriptablePrivate::callShowEvent(QEvent *event) { if(_engine && (_engine->globalObject().property("showEvent").isFunction())) { QScriptValueList args; args << _engine->toScriptValue(event); _engine->globalObject().property("showEvent").call(QScriptValue(), args); } } void ScriptablePrivate::callCloseEvent(QEvent *event) { if(_engine && (_engine->globalObject().property("closeEvent").isFunction())) { QScriptValueList args; args << _engine->toScriptValue(event); _engine->globalObject().property("closeEvent").call(QScriptValue(), args); } } qt-client-4.1.0/guiclient/scriptablePrivate.h000066400000000000000000000021631217451700100212330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SCRIPTABLEPRIVATE_H__ #define __SCRIPTABLEPRIVATE_H__ class QWidget; class QScriptEngine; class QScriptEngineDebugger; class QEvent; #include #include "guiclient.h" #include "parameter.h" class ScriptablePrivate { public: ScriptablePrivate(bool, QWidget*); virtual ~ScriptablePrivate(); QScriptEngine *engine(); void loadScript(const QString&); void loadScriptEngine(); enum SetResponse callSet(const ParameterList &); void callShowEvent(QEvent*); void callCloseEvent(QEvent*); QScriptEngine * _engine; QScriptEngineDebugger * _debugger; bool _scriptLoaded; bool _dialog; private: QWidget *_parent; }; #endif qt-client-4.1.0/guiclient/scripts.cpp000066400000000000000000000072771217451700100176050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scripts.h" #include #include #include #include #include #include "errorReporter.h" #include "guiclient.h" #include "scriptEditor.h" scripts::scripts(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_byPackage, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_script, SIGNAL(newId(int)), this, SLOT(sHandleButtons())); _script->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "script_name"); _script->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "script_notes"); _script->addColumn(tr("Order"), _ynColumn, Qt::AlignCenter,true, "script_order"); _script->addColumn(tr("Enabled"), _ynColumn, Qt::AlignCenter,true, "script_enabled"); _script->addColumn(tr("Package"),_itemColumn, Qt::AlignLeft, true, "pkgname"); sFillList(); } scripts::~scripts() { // no need to delete child widgets, Qt does it all for us } void scripts::languageChange() { retranslateUi(this); } void scripts::sNew() { ParameterList params; params.append("mode", "new"); scriptEditor *newdlg = new scriptEditor(this, "", Qt::Window); newdlg->set(params); omfgThis->handleNewWindow(newdlg); connect(newdlg, SIGNAL(destroyed()), this, SLOT(sFillList())); } void scripts::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("script_id", _script->id()); scriptEditor *newdlg = new scriptEditor(this, "", Qt::Window); newdlg->set(params); omfgThis->handleNewWindow(newdlg); connect(newdlg, SIGNAL(destroyed()), this, SLOT(sFillList())); } void scripts::sDelete() { if (QMessageBox::question(this, tr("Delete Script?"), tr("

    Are you sure that you want to completely " "delete the selected script?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare( "DELETE FROM script WHERE (script_id=:script_id);" ); delq.bindValue(":script_id", _script->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Script"), delq, __FILE__, __LINE__)) return; sFillList(); } } bool scripts::setParams(ParameterList ¶ms) { if (_byPackage->isChecked()) params.append("byPackage"); return true; } void scripts::sFillList() { QString errmsg; bool ok; MetaSQLQuery getm = MQLUtil::mqlLoad("scripts", "detail", errmsg, &ok); if (! ok) { ErrorReporter::error(QtCriticalMsg, this, tr("Getting Scripts"), errmsg, __FILE__, __LINE__); return; } ParameterList getp; if (! setParams(getp)) return; XSqlQuery getq = getm.toQuery(getp); _script->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Scripts"), getq, __FILE__, __LINE__)) return; } void scripts::sHandleButtons() { if (_script->id() < 0) { _delete->setEnabled(false); _edit->setEnabled(false); } } qt-client-4.1.0/guiclient/scripts.h000066400000000000000000000017371217451700100172450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SCRIPTS_H #define SCRIPTS_H #include "xwidget.h" #include "ui_scripts.h" class scripts : public XWidget, public Ui::scripts { Q_OBJECT public: scripts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~scripts(); public slots: virtual bool setParams(ParameterList ¶ms); virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sNew(); protected slots: virtual void languageChange(); }; #endif // SCRIPTS_H qt-client-4.1.0/guiclient/scripts.ui000066400000000000000000000130021217451700100174170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. scripts 0 0 432 359 List Scripts Scripts: Qt::Horizontal 40 20 Organize By Package true 0 0 &Close &New false &Edit Qt::Vertical QSizePolicy::Fixed 20 10 false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XCheckBox QCheckBox

    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _script _close _script valid(bool) _delete setEnabled(bool) 20 20 20 20 _script itemSelected(int) _edit animateClick() 20 20 20 20 _script valid(bool) _edit setEnabled(bool) 20 20 20 20 _close clicked() scripts close() 20 20 20 20 qt-client-4.1.0/guiclient/scripttoolbox.cpp000066400000000000000000001446121217451700100210240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scripttoolbox.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "creditCard.h" #include "creditcardprocessor.h" #include "mqlutil.h" #include "storedProcErrorLookup.h" #include "xdialog.h" #include "xmainwindow.h" #include "xtreewidget.h" #include "display.h" #include "xuiloader.h" #include "getscreen.h" /** @ingroup scriptapi @class ScriptToolbox @brief The ScriptToolbox provides a collection of miscellaneous utility methods used when writing xTuple ERP extension %scripts. The ScriptToolbox class provides the C++ implementation of the global toolbox object. A toolbox object is created whenever xTuple ERP creates a QScriptEngine, such as starting the application and opening a new window. Scripts should use these methods by using the toolbox object in the %script's global namespace: @code var qry = toolbox.executeQuery("SELECT CURRENT_DATE AS result;"); @endcode The methods in the class are intended to be used from %scripts only. Use the appropriate classes and methods directly if you are writing in C++. The descriptions of individual methods below should point you to the proper C++ classes to use. Historical note: Many methods in the ScriptToolbox are deprecated. They were created while we were learning how best to integrate QtScript with xTuple ERP. Please do not use these, as they will eventually be removed from the toolbox. The documentation for these deprecated methods refers to better ways to handle relevant situations. @see initMenu @see toolbox @see XDialog @see XMainWindow @see XWidget */ QWidget *ScriptToolbox::_lastWindow = 0; /** @brief Create a new ScriptToolbox. This constructor should not be called directly except in a small number of places in the xTuple ERP core. It does not install the toolbox object in the engine's global namespace. @param engine The script engine in which to create the toolbox object */ ScriptToolbox::ScriptToolbox(QScriptEngine * engine) : QObject(engine) { _engine = engine; } ScriptToolbox::~ScriptToolbox() { } /** @brief Execute a simple database query. The passed-in string is sent to the database engine for execution. The resulting XSqlQuery object is returned. The calling script is responsible for navigating the results, including reading the query results and checking for errors. For example, let's say you want a warning every day when you log in about %currencies with missing exchange rates. The following lines %check the database for %currencies that do not have exchange rates defined for today: @dontinclude initMenu_executeQueryExample.js @skip var @until IS NULL Now the script must loop through the results to inform you of each row found: @skip next() @until curr_abbr Without this loop, the script would have asked the database for the missing exchange rates but nothing would have been done with the results. @param query The database query to execute @return The XSqlQuery object after calling XSqlQuery::exec() @see QSqlQuery @see XSqlQuery */ XSqlQuery ScriptToolbox::executeQuery(const QString & query) { ParameterList params; MetaSQLQuery mql(query); return mql.toQuery(params); } /** @example initMenu_executeQueryExample.js */ /** @brief Execute a MetaSQL query. The passed-in string is processed as a MetaSQL query and then sent to the database engine for execution. The given ParameterList controls parsing of the string to generate the actual query to execute. This method executes the query but the caller is responsible for navigating the results and checking for errors. The following scripted example creates a ParameterList @c params, sets the @c site parameter to the internal id of the currently selected @c _site widget, then queries the database for a list of %items associated with that itemsite. The results are then used to populate an XTreeWidget. @dontinclude itemSiteViewItem.js @skip sFillList @until } @param query The MetaSQL string from which to build the query @param params The ParameterList used by MetaSQL to formulate the final query @return The XSqlQuery object after calling XSqlQuery::exec() @see MetaSQLQuery @see XSqlQuery @see QSqlQuery */ XSqlQuery ScriptToolbox::executeQuery(const QString & query, const ParameterList & params) { MetaSQLQuery mql(query); return mql.toQuery(params); } /** @example itemSiteViewItem.js */ /** @brief Execute a simple query loaded from the @c metasql table. This loads a query string from the @c metasql table in the xTuple ERP database. This string is then executed as a database query. If the string has MetaSQL tags in it, they are all treated as undefined (the ParameterList is empty). It is the caller's responsibility to ensure that there is a record in the @c metasql table that matches the given %group and name, and that processing the query string with an empty parameter list will result in valid SQL. @param %group The metasql_group value to use when searching for this query @param name The metasql_name value to use when searching for this query @return The XSqlQuery object after calling XSqlQuery::exec() @see mqlLoad @see MetaSQLQuery @see XSqlQuery @see QSqlQuery */ XSqlQuery ScriptToolbox::executeDbQuery(const QString & group, const QString & name) { ParameterList params; MetaSQLQuery mql = mqlLoad(group, name); return mql.toQuery(params); } /** @brief Execute a MetaSQL query loaded from the @c metasql table. This loads a query string from the @c metasql table in the xTuple ERP database. The given ParameterList controls parsing of the string to generate the actual query to execute. This method executes the query but the caller is responsible for navigating the results and checking for errors. The following scripted example creates a ParameterList @c params, populates it with the number of days preauthorized credit card charges are configured to be valid (defaults to 7) and defines some standard text values to display instead of internal codes (e.g. @c Preauthorization), then queries the database for a list of credit card transactions. The query itself it taken from the @c metasql table where the @c metasql_group is @c ccpayments and the @c metasql_name is @c list. The results are then used to populate an XTreeWidget. @dontinclude ccvoid.js @skip sPopulateTransactions @until } @param %group The metasql_group value to use when searching for this query @param name The metasql_name value to use when searching for this query @param params The ParameterList used by MetaSQL to formulate the final query @return The XSqlQuery object after calling XSqlQuery::exec() @see MetaSQLQuery @see XSqlQuery @see QSqlQuery */ XSqlQuery ScriptToolbox::executeDbQuery(const QString & group, const QString & name, const ParameterList & params) { MetaSQLQuery mql = mqlLoad(group, name); return mql.toQuery(params); } /** @example ccvoid.js */ /** @brief This is a convenience function that simply begins a database transaction. */ XSqlQuery ScriptToolbox::executeBegin() { ParameterList params; MetaSQLQuery mql("BEGIN;"); return mql.toQuery(params); } /** @brief This is a convenience function that simply commits the currently open database transaction. */ XSqlQuery ScriptToolbox::executeCommit() { ParameterList params; MetaSQLQuery mql("COMMIT;"); return mql.toQuery(params); } /** @brief This is a convenience function that simply rolls back the currently open database transaction. */ XSqlQuery ScriptToolbox::executeRollback() { ParameterList params; MetaSQLQuery mql("ROLLBACK;"); return mql.toQuery(params); } /** @brief Get a standard Quantity QValidator. @deprecated Use mainwindow.qtyVal() instead. */ QObject * ScriptToolbox::qtyVal() { QValidator * val = omfgThis->qtyVal(); return val; } /** @brief Get a standard Transfer Quantity QValidator. @deprecated Use mainwindow.transQtyVal() instead. */ QObject * ScriptToolbox::TransQtyVal() { QValidator * val = omfgThis->transQtyVal(); return val; } /** @brief Get a standard Quantity Per QValidator. @deprecated Use mainwindow.qtyPerVal() instead. */ QObject * ScriptToolbox::qtyPerVal() { QValidator * val = omfgThis->qtyPerVal(); return val; } /** @brief Get a standard Percent QValidator. @deprecated Use mainwindow.percentVal() instead. */ QObject * ScriptToolbox::percentVal() { QValidator * val = omfgThis->percentVal(); return val; } /** @brief Get a standard Money QValidator. @deprecated Use mainwindow.moneyVal() instead. */ QObject * ScriptToolbox::moneyVal() { QValidator * val = omfgThis->moneyVal(); return val; } /** @brief Get a standard Negative Money QValidator. @deprecated Use mainwindow.negMoneyVal() instead. */ QObject * ScriptToolbox::negMoneyVal() { QValidator * val = omfgThis->negMoneyVal(); return val; } /** @brief Get a standard Price QValidator. @deprecated Use mainwindow.priceVal() instead. */ QObject * ScriptToolbox::priceVal() { QValidator * val = omfgThis->priceVal(); return val; } /** @brief Get a standard Cost QValidator. @deprecated Use mainwindow.costVal() instead. */ QObject * ScriptToolbox::costVal() { QValidator * val = omfgThis->costVal(); return val; } /** @brief Get a standard Ratio QValidator. @deprecated Use mainwindow.ratioVal() instead. */ QObject * ScriptToolbox::ratioVal() { QValidator * val = omfgThis->ratioVal(); return val; } /** @brief Get a standard Weight QValidator. @deprecated Use mainwindow.weightVal() instead. */ QObject * ScriptToolbox::weightVal() { QValidator * val = omfgThis->weightVal(); return val; } /** @brief Get a standard Run Time QValidator. @deprecated Use mainwindow.runTimeVal() instead. */ QObject * ScriptToolbox::runTimeVal() { QValidator * val = omfgThis->runTimeVal(); return val; } /** @brief Get a standard Order QValidator. @deprecated Use mainwindow.orderVal() instead. */ QObject * ScriptToolbox::orderVal() { QValidator * val = omfgThis->orderVal(); return val; } /** @brief Get a standard Day QValidator. @deprecated Use mainwindow.dayVal() instead. */ QObject * ScriptToolbox::dayVal() { QValidator * val = omfgThis->dayVal(); return val; } /** @brief Create a new QGridLayout. @deprecated Use QGridLayout instead. */ QObject * ScriptToolbox::createGridLayout() { QGridLayout * layout = new QGridLayout; return layout; } /** @brief Get the layout containing the given widget. Search the object hierarchy and find the smallest QLayout that contains the given widget. This lets a %script create a new QWidget and insert it into the %user interface near another widget. @dontinclude addButton.js @skip var @until widgetGetLayout @param w The widget whose layout you want to find @return A pointer to the layout or 0 if no such layout could be found */ QObject * ScriptToolbox::widgetGetLayout(QWidget * w) { QObject * p = w->parentWidget(); while(p) { QList list = p->findChildren(); for (int i = 0; i < list.size(); ++i) { if (list.at(i)->indexOf(w) != -1) return list.at(i); } } return NULL; } /** @example addButton.js */ /** @brief Insert a QGridLayout into an existing QGridLayout. @deprecated Use QGridLayout::addLayout instead */ void ScriptToolbox::layoutGridAddLayout(QObject * parent, QObject * child, int row, int column, int alignment) { QGridLayout * parentLayout = qobject_cast(parent); QGridLayout * childLayout = qobject_cast(child); if(parentLayout) parentLayout->addLayout(childLayout, row, column, (Qt::Alignment)alignment); } /** @brief Insert a QWidget into an existing QBoxLayout. @deprecated Use QBoxLayout::insertWidget directly */ void ScriptToolbox::layoutBoxInsertWidget(QObject * obj, int index, QWidget * widget, int stretch, int alignment) { QBoxLayout * layout = qobject_cast(obj); if(layout && widget) layout->insertWidget(index, widget, stretch, (Qt::Alignment)alignment); } /** @brief Insert a QWidget into an existing QGridLayout. @deprecated Use QGridLayout::addWidget instead. */ void ScriptToolbox::layoutGridAddWidget(QObject * obj, QWidget * widget, int row, int column, int alignment) { QGridLayout * layout = qobject_cast(obj); if(layout && widget) layout->addWidget(widget, row, column, (Qt::Alignment)alignment); } /** @brief Insert a QWidget into an existing QGridLayout. @deprecated Use QGridLayout::addWidget instead. */ void ScriptToolbox::layoutGridAddWidget(QObject * obj, QWidget * widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, int alignment) { QGridLayout * layout = qobject_cast(obj); if(layout && widget) layout->addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, (Qt::Alignment)alignment); } /** @brief Insert a QWidget into an existing QStackedLayout. @deprecated Use QStackedWidget::insertWidget instead. */ void ScriptToolbox::layoutStackedInsertWidget(QObject * obj, int index, QWidget * widget) { QStackedLayout * layout = qobject_cast(obj); if(layout && widget) layout->insertWidget(index, widget); } /** @brief Add an action to an existing QMenu. @deprecated Use QMenu::addAction instead. */ QObject * ScriptToolbox::menuAddAction(QObject * menu, const QString & text, const bool enabled) { QMenu * m = qobject_cast(menu); QAction * act = 0; if(m) { act = m->addAction(text); act->setEnabled(enabled); } return act; } /** @brief Add an action to an existing QMenu. @deprecated Use QMenu::addAction instead. */ QObject * ScriptToolbox::menuAddMenu(QObject * menu, const QString & text, const QString & name) { QMenu * m = qobject_cast(menu); QMenu * nm = 0; if(m) { nm = m->addMenu(text); if(!name.isEmpty()) nm->setObjectName(name); } return nm; } /** @brief Add a separator to an existing QMenu. @deprecated Use QMenu::addSeparator instead. */ QObject * ScriptToolbox::menuAddSeparator(QObject * menu) { QMenu * m = qobject_cast(menu); QAction * na = 0; if(m) na = m->addSeparator(); return na; } /** @brief Insert an action into an existing QMenu. @deprecated Use QMenu::insertAction instead. */ QObject * ScriptToolbox::menuInsertAction(QObject * menu, QObject * before, const QString & name, const bool enabled) { QMenu * m = qobject_cast(menu); QAction * ba = qobject_cast(before); QAction * na = new QAction(name,m); na->setEnabled(enabled); if(m && ba && na) { m->insertAction(ba, na); return na; } return 0; } /** @brief Insert a QMenu into an existing QMenu. @deprecated Use QMenu::insertMenu instead. */ QObject * ScriptToolbox::menuInsertMenu(QObject * menu, QObject * before, const QString & name) { QMenu * m = qobject_cast(menu); QAction * ba = qobject_cast(before); QMenu * nm = new QMenu(name); if (!ba && nm) { QMenu * bm = qobject_cast(before); if (bm) ba = bm->menuAction(); } if (ba && nm) m->insertMenu(ba, nm); return nm; } /** @brief Insert a separator into an existing QMenu. @deprecated Use QMenu::insertSeparator instead. */ QObject * ScriptToolbox::menuInsertSeparator(QObject * menu, QObject * before) { QMenu * m = qobject_cast(menu); QAction * ba = qobject_cast(before); if (!ba) { QMenu * bm = qobject_cast(before); ba = bm->menuAction(); } QAction * na = new QAction(m); if(m && ba && na) { na->setSeparator(true); m->insertAction(ba, na); return na; } return 0; } /** @brief Remove a QAction from a QMenu. @deprecated Use QMenu::removeAction instead. */ void ScriptToolbox::menuRemove(QObject * menu, QObject * action) { QMenu * m = qobject_cast(menu); QAction * act = qobject_cast(action); if (!act) { QMenu * ma = qobject_cast(action); act = ma->menuAction(); } if(m && act) m->removeAction(act); } /** @brief Find the number of QActions in a QMenu. @param menu The QMenu whose QAction children you want to count @return The number of QAction objects in the menu or 0 if @c menu isn't really a QMenu */ int ScriptToolbox::menuActionCount(QObject * menu) { QMenu * m = qobject_cast(menu); if (m) return m->actions().count(); return 0; } /** @brief Find the number of tabs in the QTabWidget @deprecated Use QTabWidget::count directly. */ int ScriptToolbox::tabCount(QWidget * tab) { QTabWidget *tw = qobject_cast(tab); if(tw) return tw->count(); return 0; } /** @brief Return the QWidget for a particular tab in a QTabWidget. @deprecated Use QTabWidget::widget directly. */ QWidget * ScriptToolbox::tabWidget(QWidget * tab, int idx) { QTabWidget *tw = qobject_cast(tab); QWidget * w = 0; if(tw) w = tw->widget(idx); return w; } /** @brief Insert a new tab into a QTabWidget. @deprecated Use QTabWidget::insertTab directly. */ int ScriptToolbox::tabInsertTab(QWidget * tab, int idx, QWidget * page, const QString & text) { QTabWidget *tw = qobject_cast(tab); int i = -1; if(tw) i = tw->insertTab(idx, page, text); return i; } /** @brief Get the index of a particular tab in a QTabWidget. @deprecated Use QTabWidget::indexOf directly. */ int ScriptToolbox::tabTabIndex(QWidget * tab, QWidget * page) { QTabWidget *tw = qobject_cast(tab); if(tw) return tw->indexOf(page); return 0; } /** @brief Remove a particular tab from a QTabWidget. @deprecated Use QTabWidget::removeTab directly. */ void ScriptToolbox::tabRemoveTab(QWidget * tab, int idx) { QTabWidget *tw = qobject_cast(tab); if(tw) tw->removeTab(idx); } /** @brief Enable or disable a particular tab on a QTabWidget. @deprecated Use QTabWidget::setTabEnabled directly. */ void ScriptToolbox::tabSetTabEnabled(QWidget * tab, int idx, bool enable) { QTabWidget *tw = qobject_cast(tab); if(tw) tw->setTabEnabled(idx, enable); } /** @brief Set the text for a particular tab on a QTabWidget. @deprecated Use QTabWidget::setTabText directly. */ void ScriptToolbox::tabSetTabText(QWidget * tab, int idx, const QString & text) { QTabWidget *tw = qobject_cast(tab); if(tw) tw->setTabText(idx, text); } /** @brief Get the text for a particular tab on a QTabWidget. @deprecated Use QTabWidget::tabText directly. */ QString ScriptToolbox::tabtabText(QWidget * tab, int idx) { QTabWidget *tw = qobject_cast(tab); QString str; if(tw) str = tw->tabText(idx); return str; } /** @brief Create a widget based on the name of the desired class. This is a wrapper around XUiLoader::createWidget. The following example creates a new QPushButton: @dontinclude addButton.js @skipline newbutton @param className The name of the class of the desired widget @param parent The widget that should be set as the parent of the new widget @param name The name to give the newly-created widget @return The newly-created widget */ QWidget * ScriptToolbox::createWidget(const QString & className, QWidget * parent, const QString & name) { XUiLoader ui; return ui.createWidget(className, parent, name); } /** @brief Create a new layout based on the name of the desired class. This is a wrapper around XUiLoader::createLayout. @param className The name of the class of the desired layout @param parent The widget that should be set as the parent of the new layout @param name The name to give the newly-created layout @return The newly-created layout @see qboxlayoutproto.cpp @see qgridlayoutproto.cpp @see QBoxLayout @see QGridLayout */ QObject * ScriptToolbox::createLayout(const QString & className, QWidget * parent, const QString & name) { XUiLoader ui; return ui.createLayout(className, parent, name); } /** @brief Load a .ui definition from the %uiform table. Instantiate a new %user interface using a .ui definition that has been stored in the %uiform table. If multiple rows in the %uiform match the given name, the enabled row with the highest @c uiform_order is used. @param screenName The name of the .ui to load (@c uiform_name) @param parent The widget to set as the parent of the loaded .ui @return A widget representing the %user interface; 0 if no record matches or if there was an error */ QWidget * ScriptToolbox::loadUi(const QString & screenName, QWidget * parent) { if(screenName.isEmpty()) return 0; XSqlQuery qui; qui.prepare("SELECT *" " FROM uiform" " WHERE((uiform_name=:uiform_name)" " AND (uiform_enabled))" " ORDER BY uiform_order DESC" " LIMIT 1;"); qui.bindValue(":uiform_name", screenName); qui.exec(); if(!qui.first()) { QMessageBox::critical(0, tr("Could Not Create Form"), tr("

    Could not create the '%1' form. Either an " "error occurred or the specified form does " "not exist.").arg(screenName) ); return 0; } XUiLoader loader; QByteArray ba = qui.value("uiform_source").toByteArray(); QBuffer uiFile(&ba); if(!uiFile.open(QIODevice::ReadOnly)) { QMessageBox::critical(0, tr("Could not load file"), tr("There was an error loading the UI Form from the database.")); return 0; } QWidget *ui = loader.load(&uiFile, parent); uiFile.close(); return ui; } /** @brief Return the last window opened by this instance of the ScriptToolbox. */ QWidget * ScriptToolbox::lastWindow() const { return _lastWindow; } /** @brief Use the embedded OpenRPT to print a named report. Print the report using the given parameters, optionally saving the output to a PDF %file. @param name The name of the report definition to use @param params The MetaSQL parameters used to control the report output @param pdfFilename The name of the PDF %file to create. If empty the function uses the standard print methodology @return True if the report printed successfully; false if there was an apparent error printing */ bool ScriptToolbox::printReport(const QString & name, const ParameterList & params, const QString & pdfFilename) { orReport report(name, params); if(report.isValid()) { if(!pdfFilename.isEmpty()) { report.exportToPDF(pdfFilename); } else { report.print(); } } else { report.reportError(NULL); return false; } return true; } /** @brief Use the embedded OpenRPT to print or preview a named report. Print or preview on-screen the report using the given parameters. @param name The name of the report definition to use @param params The MetaSQL parameters used to control the report output @param preview If @c preview is true, open a report preview window; otherwise print using the standard print methodology @param parent The parent widget to set for the preview window (optional) @return True if the report printed successfully; false if there was an apparent error printing or previewing */ bool ScriptToolbox::printReport(const QString & name, const ParameterList & params, const bool preview, QWidget *parent) { orReport report(name, params); if (report.isValid()) report.print(0, true, preview, parent); else { report.reportError(NULL); return false; } return true; } /** @brief Print multiple copies of a single report. Print the same report multiple times using the same set of parameters as part of the same print job. This serves as a scriptable replacement for multi-part %forms. Note that all copies of the report are identical as only one set of parameters is passed in. @param name The name of the report definition to use @param params The MetaSQL parameters used to control the report output @param copies The number of copies to print @return True if the report printed successfully; false if there was an error or the %user canceled printing */ bool ScriptToolbox::printReportCopies(const QString & name, const ParameterList & params, int copies) { QPrinter printer(QPrinter::HighResolution); orReport report(name, params); bool userCanceled = false; if (orReport::beginMultiPrint(&printer, userCanceled) == false) { if(!userCanceled) systemError(NULL, tr("Could not initialize printing system for multiple reports.")); return userCanceled; } userCanceled = false; if (report.isValid()) { userCanceled = true; for (int counter = 0; counter < copies; counter++) if (!report.print(&printer, (counter == 0))) { report.reportError(NULL); userCanceled = false; break; } } orReport::endMultiPrint(&printer); return userCanceled; } /** @brief Break a signal/slot or signal/signal connection established in the C++ core Much of the behavior in the core application is controlled by %Qt signal/slot connections. To modify certain behaviors, %scripts need to break the connection between signals emitted by core objects and the core slots. Note that a single object can emit several signals at different times and that each signal can have multiple recipients. Make sure the script disconnects all of the required signal/slot pairs and only those required. The caller is responsible for ensuring that the original behavior gets restored or appropriately modified. For example, if a script disconnects a Save button's @c clicked signal from a core method to save the data, that script developer takes responsibility to either save the data in the script or call the core's save method at an appropriate time. @param sender The QObject that has emits the signal @param signal The particular signal that the script needs to intercept @param receiver The core object coded to receive the signal @param method The slot (or signal) of the receiver to disconnect @return Returns true if the connection is successfully broken; otherwise false @see QObject::disconnect @todo Add an example to sample_scripts */ bool ScriptToolbox::coreDisconnect(QObject * sender, const QString & signal, QObject * receiver, const QString & method) { return QObject::disconnect(sender, QString("2%1").arg(signal).toUtf8().data(), receiver, QString("1%1").arg(method).toUtf8().data()); } /** @brief Open a QFileDialog window. This is a convenience wrapper around common uses for the QFileDialog class. It can be used to open files or directories or to save a %file. @param parent The QWidget to set as the parent of the QFileDialog @param caption The caption to use on the dialog @param dir Start at the given directory @param filter A semicolon-separated list of strings to filter the directory contents @param fileModeSel An integer limiting what the %user may select. Note that the values accepted here are not the same as the integer values of the named %Qt constants:
    1QFileDialog::ExistingFile
    2QFileDialog::Directory
    3QFileDialog::DirectoryOnly
    4QFileDialog::ExistingFiles
    anything elseQFileDialog::AnyFile
    @param acceptModeSel An integer controlling whether the dialog is to be opened to let the %user open a %file or save a %file
    1QFileDialog::AcceptSave
    anything elseQFileDialog::AcceptOpen
    @see QFileDialog */ QString ScriptToolbox::fileDialog(QWidget * parent, const QString & caption, const QString & dir, const QString & filter, int fileModeSel, int acceptModeSel) { QStringList filters; QString path; QFileDialog::FileMode _fileMode; QFileDialog::AcceptMode _acceptMode; switch (fileModeSel) { case 1: _fileMode = QFileDialog::ExistingFile; break; case 2: _fileMode = QFileDialog::Directory; break; case 3: _fileMode = QFileDialog::DirectoryOnly; break; case 4: _fileMode = QFileDialog::ExistingFiles; break; default: _fileMode = QFileDialog::AnyFile; } switch (acceptModeSel) { case 1: _acceptMode = QFileDialog::AcceptSave; break; default: _acceptMode = QFileDialog::AcceptOpen; } QFileDialog newdlg(parent, caption, dir); newdlg.setFileMode(_fileMode); newdlg.setAcceptMode(_acceptMode); if (! filter.isEmpty()) { filters << filter << tr("Any Files (*)"); newdlg.setFilters(filters); } if (newdlg.exec()) path = newdlg.selectedFiles().join(", "); else path = ""; return path; } /** @brief Open a web page or open a file with an appropriate application. This is a wrapper around QDesktopServices::openUrl. @param fileUrl The file or URL to open. */ void ScriptToolbox::openUrl(const QString & fileUrl) { //If url scheme is missing, we'll assume it is "file" for now. QUrl url(fileUrl); if (url.scheme().isEmpty()) url.setScheme("file"); QDesktopServices::openUrl(url); } /** @deprecated Use QFile.copyFile(oldName, newName) instead */ bool ScriptToolbox::copyFile(const QString & oldName, const QString & newName) { return QFile::copy(oldName, newName); } /** @deprecated Use var file = new QFileInfo(path).fileName() instead */ QString ScriptToolbox::getFileName(const QString & path) { QFileInfo fi(path); return fi.fileName(); } /** @deprecated Use QFile.rename(oldName, newName) instead */ bool ScriptToolbox::renameFile(const QString & oldName, const QString & newName) { return QFile::rename(oldName, newName); } /** @deprecated Use QFile.removeFile(oldName, newName) instead */ bool ScriptToolbox::removeFile(const QString & name) { return QFile::remove(name); } /** @deprecated Use QFile.exists(name) instead */ bool ScriptToolbox::fileExists(const QString & name) { return QFile::exists(name); } /** @brief Read the entire contents of a text %file. This method opens a text %file, reads its contents into a string, and closes the %file again. @param name The name of the %file to open @return The textual content of the %file, or "error" if the %file could not be opened @see QFile @see QTextStream */ QString ScriptToolbox::textStreamRead(const QString & name) { QFile file(name); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return "error"; QTextStream stream(&file); QString fileText = tr(file.readAll()); file.close(); return fileText; } /** @brief Write the given text to the named %file. Create or overwrite a %file with the given name, using the given contents. If the %file name passed does not contain a suffix, @c .txt is appended when the file is created. @param pName The name of the %file to create @param WriteText The string to write to the %file @return True if successful; false if any errors were detected @see QFile @see QTextStream */ bool ScriptToolbox::textStreamWrite(const QString & pName, const QString & WriteText) { QString name = pName; if(name.isEmpty() || WriteText.isEmpty()) return false; QFileInfo fi(name); if(fi.suffix().isEmpty()) name += ".txt"; QFile file(name); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) return false; QTextStream out(&file); out << WriteText; file.close(); return true; } /** @deprecated use QFile.exists(name) instead */ bool fileExists(const QString & name) { QFile file(name); return file.exists(); } /** @deprecated Use QDir.homePath() instead */ QString ScriptToolbox::getHomeDir() { return QDir::homePath(); } /** @deprecated Use QDir.currentPath() instead */ QString ScriptToolbox::getCurrentDir() { return QDir::currentPath(); } /** @deprecated Use QDir.tempPath() instead */ QString ScriptToolbox::getTempDir() { return QDir::tempPath(); } /** @deprecated Use QDir.rootPath() instead */ QString ScriptToolbox::rootPath() { return QDir::rootPath(); } /** @deprecated Use var dir = new QDir(rootPath) followed by dir.mkpath(mkPath) instead */ bool ScriptToolbox::makePath(const QString & mkPath, const QString & rootPath) { QDir dir(rootPath); return dir.mkpath(mkPath); } /** @deprecated Use var dir = new QDir(rootPath) followed by dir.rmpath(rmPath) instead */ bool ScriptToolbox::removePath(const QString & rmPath, const QString & rootPath) { QDir dir(rootPath); return dir.rmpath(rmPath); } /** @brief Show the properties of a QtScript object. This writes all of the properties of a QtScript object using qWarning. This is a debugging tool, most useful when not using the Qt script debugger. The property list is not sorted and is not generally recursive. This method does show prototype properties in a separately labeled list if the given object has a prototype. The output has the name of each property and the result of toString(), so properties which are functions show as something like "function()". The values which would be returned by these functions are not displayed. For example, @code toolbox.listProperties(_aWarehouseClusterWidget); @endcode will show a line similar to this: @code id = "function() returning int" @endcode rather than the usually-more-useful @code id = -1 @endcode @param obj The object whose properties should be listed */ void ScriptToolbox::listProperties(const QScriptValue &obj, const bool showPrototype) const { qWarning("Properties of %s:", qPrintable(obj.toString())); QScriptValue tmp = obj; while (tmp.isObject()) { QScriptValueIterator prop(tmp); while (prop.hasNext()) { prop.next(); qWarning(" %s\t= %s", qPrintable(prop.name()), qPrintable(prop.value().toString())); } if (showPrototype) { tmp = tmp.prototype(); if (! (tmp.isNull() || tmp.isUndefined())) qWarning(" Prototype %s of %s:", qPrintable(tmp.toString()), qPrintable(obj.toString())); } else tmp = QScriptValue(); } qWarning("End of %s", qPrintable(obj.toString())); } /** @brief A wrapper around the QMessageBox static methods for standard dialogs. @deprecated Use QMessageBox.critical, QMessageBox.information, QMessageBox.question, or QMessageBox.warning. */ int ScriptToolbox::messageBox(const QString & type, QWidget * parent, const QString & title, const QString & text, int buttons, int defaultButton) { int btn; if(type == "critical") btn = QMessageBox::critical(parent, title, text, (QMessageBox::StandardButton)buttons, (QMessageBox::StandardButton)defaultButton); else if(type == "information") btn = QMessageBox::information(parent, title, text, (QMessageBox::StandardButton)buttons, (QMessageBox::StandardButton)defaultButton); else if(type == "question") btn = QMessageBox::question(parent, title, text, (QMessageBox::StandardButton)buttons, (QMessageBox::StandardButton)defaultButton); else //if(type == "warning") btn = QMessageBox::warning(parent, title, text, (QMessageBox::StandardButton)buttons, (QMessageBox::StandardButton)defaultButton); return btn; } /** @brief Override the last window opened by this toolbox instance. @internal */ void ScriptToolbox::setLastWindow(QWidget * lw) { _lastWindow = lw; } /** @brief Open a new scripted or core application window. This method opens a new window on the display. It can be defined in its .ui as an XWidget, XDialog, or XMainWindow. If there is a record in the %uiform table, this .ui is instantiated; otherwise openWindow opens a core application window with the given name if one exists. Windows that inherit from QDialog are handled specially. If the modality passed is Qt::NonModal, the modality is changed to Qt::WindowModal. The flags parameter gets Qt::Dialog set even if the caller did not set it. Because of the way the new windows are created, a special @c mydialog object gets created to allow access to the QDialog properties and methods, such as QDialog::exec. @param pname The name of the %uiform or core application class of the window to open @param parent The widget to set as the parent of the newly-created window @param modality This can be any of the defined Qt::WindowModality values @param flags This can be any Qt::WindowFlags value @return The newly-opened window; 0 if there was an error */ QWidget *ScriptToolbox::openWindow(QString pname, QWidget *parent, Qt::WindowModality modality, Qt::WindowFlags flags) { QWidget *returnVal = xtGetScreen(pname, parent, flags, 0); if(returnVal) { if(!returnVal->inherits("QDialog")) { omfgThis->handleNewWindow(returnVal); returnVal->setWindowModality(modality); } _lastWindow = returnVal; return returnVal; } XSqlQuery screenq; screenq.prepare("SELECT * " " FROM uiform " " WHERE((uiform_name=:uiform_name)" " AND (uiform_enabled))" " ORDER BY uiform_order DESC" " LIMIT 1;"); screenq.bindValue(":uiform_name", pname); screenq.exec(); if (screenq.first()) { XUiLoader loader; QByteArray ba = screenq.value("uiform_source").toString().toUtf8(); QBuffer uiFile(&ba); if (!uiFile.open(QIODevice::ReadOnly)) { QMessageBox::critical(0, tr("Could not load UI"), tr("

    There was an error loading the UI Form " "from the database.")); return 0; } QWidget *ui = loader.load(&uiFile); if (! ui) { QMessageBox::critical(0, tr("Could not load UI"), tr("

    There was an error creating a window from " "the UI Form. It may be empty or invalid.")); return 0; } QSize size = ui->size(); uiFile.close(); if (ui->inherits("QDialog")) { flags |= Qt::Dialog; if (modality == Qt::NonModal) modality = Qt::WindowModal; } XMainWindow *window = new XMainWindow(parent, screenq.value("uiform_name").toString().toAscii().data(), flags); window->setCentralWidget(ui); window->setWindowTitle(ui->windowTitle()); window->setWindowModality(modality); window->resize(size); if (ui->inherits("QDialog")) { QDialog *innerdlg = qobject_cast(ui); connect(innerdlg, SIGNAL(finished(int)), window, SLOT(close())); // alternative to creating mydialog object: // for each property of mydialog (including functions) // add a property to _engine's mywindow property if (engine(window)) { QScriptValue mydialog = engine(window)->newQObject(innerdlg); engine(window)->globalObject().setProperty("mydialog", mydialog); } else qWarning("Could not find the script engine to embed a dialog inside " "a placeholder window"); omfgThis->handleNewWindow(window); returnVal = ui; } else { omfgThis->handleNewWindow(window); returnVal = window; } _lastWindow = window; } else if (screenq.lastError().type() != QSqlError::NoError) { systemError(0, screenq.lastError().databaseText(), __FILE__, __LINE__); return 0; } return returnVal; } QWidget *ScriptToolbox::newDisplay(QString pname, QWidget *parent, Qt::WindowModality modality, Qt::WindowFlags flags) { display *window = new display(parent, pname.toAscii().data(), flags); window->setWindowModality(modality); omfgThis->handleNewWindow(window); _lastWindow = window; return window; } /** @brief Add a column to an existing XTreeWidget @deprecated Use XTreeWidget::addColumn directly. */ void ScriptToolbox::addColumnXTreeWidget(QWidget * tree, const QString & pString, int pWidth, int pAlignment, bool pVisible, const QString pEditColumn, const QString pDisplayColumn) { XTreeWidget *xt = qobject_cast(tree); if(xt) xt->addColumn(pString, pWidth, pAlignment, pVisible, pEditColumn, pDisplayColumn); } /** @brief Populate an XTreeWidget with the results of the given query. @deprecated Use XTreeWidget::populate directly. */ void ScriptToolbox::populateXTreeWidget(QWidget * tree, XSqlQuery pSql, bool pUseAltId) { XTreeWidget *xt = qobject_cast(tree); if(xt) xt->populate(pSql, pUseAltId); } /** @brief Load the given QWebView with the given URL. */ void ScriptToolbox::loadQWebView(QWidget * webView, const QString & url) { QUrl p = QUrl(url); QWebView *wv = qobject_cast(webView); if(wv) wv->load(p); } /** @internal */ QScriptValue SetResponsetoScriptValue(QScriptEngine *engine, const enum SetResponse &sr) { return QScriptValue(engine, (int)sr); } /** @internal */ void SetResponsefromScriptValue(const QScriptValue &obj, enum SetResponse &sr) { sr = (enum SetResponse)obj.toInt32(); } /** @internal */ QScriptValue ParameterGroupStatestoScriptValue(QScriptEngine *engine, const enum ParameterGroup::ParameterGroupStates &en) { return QScriptValue(engine, (int)en); } /** @internal */ void ParameterGroupStatesfromScriptValue(const QScriptValue &obj, enum ParameterGroup::ParameterGroupStates &en) { en = (enum ParameterGroup::ParameterGroupStates)obj.toInt32(); } /** @internal */ QScriptValue ParameterGroupTypestoScriptValue(QScriptEngine *engine, const enum ParameterGroup::ParameterGroupTypes &en) { return QScriptValue(engine, (int)en); } /** @internal */ void ParameterGroupTypesfromScriptValue(const QScriptValue &obj, enum ParameterGroup::ParameterGroupTypes &en) { en = (enum ParameterGroup::ParameterGroupTypes)obj.toInt32(); } /** @internal */ QScriptValue QtWindowModalitytoScriptValue(QScriptEngine *engine, const enum Qt::WindowModality &en) { return QScriptValue(engine, (int)en); } /** @internal */ void QtWindowModalityfromScriptValue(const QScriptValue &obj, enum Qt::WindowModality &en) { en = (enum Qt::WindowModality)obj.toInt32(); } /** @internal */ QScriptValue WindowSystemtoScriptValue(QScriptEngine *engine, const enum GUIClient::WindowSystem &en) { return QScriptValue(engine, (int)en); } /** @internal */ void WindowSystemfromScriptValue(const QScriptValue &obj, enum GUIClient::WindowSystem &en) { en = (enum GUIClient::WindowSystem)obj.toInt32(); } /** @internal */ QScriptValue SaveFlagstoScriptValue(QScriptEngine *engine, const enum SaveFlags &en) { return QScriptValue(engine, (int)en); } /** @internal */ void SaveFlagsfromScriptValue(const QScriptValue &obj, enum SaveFlags &en) { if (obj.isNumber()) en = (enum SaveFlags)obj.toInt32(); else if (obj.isString()) { if (obj.toString() == "CHECK") en = CHECK; else if (obj.toString() == "CHANGEONE") en = CHANGEONE; else if (obj.toString() == "CHANGEALL") en = CHANGEALL; else qWarning("string %s could not be converted to SaveFlags", qPrintable(obj.toString())); } else qWarning("object %s could not be converted to SaveFlags", qPrintable(obj.toString())); } /** @brief Save a credit card definition from a script. This is a wrapper around creditCard::saveCreditCard(). @see creditCard::saveCreditCard */ int ScriptToolbox::saveCreditCard(QWidget *parent, int custId, QString ccName, QString ccAddress1, QString ccAddress2, QString ccCity, QString ccState, QString ccZip, QString ccCountry, QString ccNumber, QString ccType, QString ccExpireMonth, QString ccExpireYear, int ccId, bool ccActive ) { return creditCard::saveCreditCard(parent, custId, ccName, ccAddress1, ccAddress2, ccCity, ccState, ccZip, ccCountry, ccNumber, ccType, ccExpireMonth, ccExpireYear, ccId, ccActive); } /** @brief Get the CreditCardProcessor object for the default service. This is a wrapper around CreditCardProcessor::getProcessor. There is no scriptable way to get a CreditCardProcessor object for a named service provider. @return A CreditCardProcessor object for the current service provider @see CreditCardProcessor::getProcessor */ QObject *ScriptToolbox::getCreditCardProcessor() { return CreditCardProcessor::getProcessor(); } /** @brief C++ implementation of the original script include mechanism. This is the first implementation of script inclusion. It should never be called. @deprecated See include.cpp for the proper way to include scripts. This function will be removed, as will all examples of its use. @see include */ QString scriptHandleIncludes(QString source) { QString returnVal = source; if (returnVal.contains(QRegExp("#include"))) { QStringList line = returnVal.split(QRegExp("\n\r?|\r\n?")); for (int i = 0; i < line.size(); i++) { if (line.at(i).startsWith("#include")) { QStringList words = line.at(i).split(QRegExp("\\s+")); if (words.size() <= 1) qWarning("scriptByName(%s): found #include with no script name", qPrintable(line.at(i))); int order = -1; if (words.size() > 2) order = words.at(2).toInt(); QString name; if (words.size() > 1) name = words.at(1); line.replace(i, "// " + line.at(i)); XSqlQuery inclq; inclq.prepare("SELECT script_source " "FROM script " "WHERE ((script_name=:name)" " AND ((script_order=:order) OR (:order = -1))" " AND script_enabled) " "ORDER BY script_order;"); inclq.bindValue(":name", name); inclq.bindValue(":order", order); inclq.exec(); bool found = false; while (inclq.next()) { found = true; line.replace(i, line.at(i) + "\n" + scriptHandleIncludes(inclq.value("script_source").toString())); } if (found) line.replace(i, line.at(i) + "\n// end include of " + name); } } returnVal = line.join("\n"); } return returnVal; } /** @brief This is a wrapper around the core storedProcErrorLookup. */ QString ScriptToolbox::storedProcErrorLookup(const QString proc, const int result) { return ::storedProcErrorLookup(proc, result); } /** @brief This functions takes a regexp string and creates and returns a QRegExpValidator. */ QObject * ScriptToolbox::customVal(const QString & ReqExp) { QRegExp rx(ReqExp); QValidator * val = new QRegExpValidator(rx, omfgThis); return val; } /** @fn int ScriptToolbox::decimalPlaces(QString p) @brief This is a wrapper for the C++ core function decimalPlaces. */ /** @fn QString ScriptToolbox::formatNumber(double value, int decimals) @brief This is a wrapper for the C++ core function formatNumber. */ /** @fn QString ScriptToolbox::formatMoney(double val, int curr = -1, int extra = 0) @brief This is a wrapper for the C++ core function formatMoney. */ /** @fn QString ScriptToolbox::formatCost(double val, int curr= -1) @brief This is a wrapper for the C++ core function formatCost. */ /** @fn QString ScriptToolbox::formatExtPrice(double val, int curr=-1) @brief This is a wrapper for the C++ core function formatExtPrice. */ /** @fn QString ScriptToolbox::formatWeight(double val) @brief This is a wrapper for the C++ core function formatWeight. */ /** @fn QString ScriptToolbox::formatQty(double val) @brief This is a wrapper for the C++ core function formatQty. */ /** @fn QString ScriptToolbox::formatQtyPer(double val) @brief This is a wrapper for the C++ core function formatQtyPer. */ /** @fn QString ScriptToolbox::formatSalesPrice(double val, int curr = -1) @brief This is a wrapper for the C++ core function formatSalesPrice. */ /** @fn QString ScriptToolbox::formatPurchPrice(double val, int curr = -1) @brief This is a wrapper for the C++ core function formatPurchPrice. */ /** @fn QString ScriptToolbox::formatUOMRatio(double val) @brief This is a wrapper for the C++ core function formatUOMRatio. */ /** @fn QString ScriptToolbox::formatPercent(double val) @brief This is a wrapper for the C++ core function formatPercent. */ /** @fn QColor ScriptToolbox::namedColor(QString name) @brief This is a wrapper for the C++ core function namedColor. */ /** @fn QString ScriptToolbox::formatDate(const QDate &pDate) @brief This is a wrapper for the C++ core function formatDate. */ qt-client-4.1.0/guiclient/scripttoolbox.h000066400000000000000000000235661217451700100204750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SCRIPTTOOLBOX_H__ #define __SCRIPTTOOLBOX_H__ #include #include #include #include #include "parameter.h" #include "guiclient.h" #include "addresscluster.h" // for AddressCluster::SaveFlags class QWidget; class QLayout; class QGridLayout; class QBoxLayout; class QStackedLayout; class QScriptEngine; /* TODO: remove this enum and use AddressCluster::SaveFlags directly for some reason working with AddressCluster::SaveFlags failed but this works. */ enum SaveFlags { CHECK = AddressCluster::CHECK, CHANGEONE = AddressCluster::CHANGEONE, CHANGEALL = AddressCluster::CHANGEALL }; Q_DECLARE_METATYPE(enum SetResponse) Q_DECLARE_METATYPE(enum ParameterGroup::ParameterGroupStates); Q_DECLARE_METATYPE(enum ParameterGroup::ParameterGroupTypes); Q_DECLARE_METATYPE(enum Qt::WindowModality); Q_DECLARE_METATYPE(enum GUIClient::WindowSystem); Q_DECLARE_METATYPE(enum SaveFlags); QScriptValue SetResponsetoScriptValue(QScriptEngine *engine, const enum SetResponse &sr); void SetResponsefromScriptValue(const QScriptValue &obj, enum SetResponse &sr); QScriptValue ParameterGroupStatestoScriptValue(QScriptEngine *engine, const enum ParameterGroup::ParameterGroupStates &en); void ParameterGroupStatesfromScriptValue(const QScriptValue &obj, enum ParameterGroup::ParameterGroupStates &en); QScriptValue ParameterGroupTypestoScriptValue(QScriptEngine *engine, const enum ParameterGroup::ParameterGroupTypes &en); void ParameterGroupTypesfromScriptValue(const QScriptValue &obj, enum ParameterGroup::ParameterGroupTypes &en); QScriptValue QtWindowModalitytoScriptValue(QScriptEngine *engine, const enum Qt::WindowModality &en); void QtWindowModalityfromScriptValue(const QScriptValue &obj, enum Qt::WindowModality &en); QScriptValue WindowSystemtoScriptValue(QScriptEngine *engine, const enum GUIClient::WindowSystem &en); void WindowSystemfromScriptValue(const QScriptValue &obj, enum GUIClient::WindowSystem &en); QScriptValue SaveFlagstoScriptValue(QScriptEngine *engine, const enum SaveFlags &en); void SaveFlagsfromScriptValue(const QScriptValue &obj, enum SaveFlags &en); QString scriptHandleIncludes(QString source); class ScriptToolbox : public QObject { Q_OBJECT public: ScriptToolbox(QScriptEngine * engine); virtual ~ScriptToolbox(); static void setLastWindow(QWidget * lw); // expose format.h Q_INVOKABLE int decimalPlaces(QString p) { return ::decimalPlaces(p); }; Q_INVOKABLE QString formatNumber(double value, int decimals){ return ::formatNumber(value, decimals); }; Q_INVOKABLE QString formatMoney(double val, int curr = -1, int extra = 0) { return ::formatMoney(val, curr, extra); }; Q_INVOKABLE QString formatCost(double val, int curr= -1) { return ::formatCost(val, curr); }; Q_INVOKABLE QString formatExtPrice(double val, int curr=-1) { return ::formatExtPrice(val, curr); }; Q_INVOKABLE QString formatWeight(double val) { return ::formatWeight(val); }; Q_INVOKABLE QString formatQty(double val) { return ::formatQty(val); }; Q_INVOKABLE QString formatQtyPer(double val) { return ::formatQtyPer(val); }; Q_INVOKABLE QString formatSalesPrice(double val, int curr = -1) { return ::formatSalesPrice(val, curr); }; Q_INVOKABLE QString formatPurchPrice(double val, int curr = -1) { return ::formatPurchPrice(val, curr); }; Q_INVOKABLE QString formatUOMRatio(double val) { return ::formatUOMRatio(val); }; Q_INVOKABLE QString formatPercent(double val) { return ::formatPercent(val); }; Q_INVOKABLE QColor namedColor(QString name) { return ::namedColor(name); }; Q_INVOKABLE QString formatDate(const QDate &pDate) { return ::formatDate(pDate); }; public slots: XSqlQuery executeQuery(const QString & query); XSqlQuery executeQuery(const QString & query, const ParameterList & params); XSqlQuery executeDbQuery(const QString & group, const QString & name); XSqlQuery executeDbQuery(const QString & group, const QString & name, const ParameterList & params); XSqlQuery executeBegin(); XSqlQuery executeCommit(); XSqlQuery executeRollback(); QObject * qtyVal(); QObject * TransQtyVal(); QObject * qtyPerVal(); QObject * percentVal(); QObject * moneyVal(); QObject * negMoneyVal(); QObject * priceVal(); QObject * costVal(); QObject * ratioVal(); QObject * weightVal(); QObject * runTimeVal(); QObject * orderVal(); QObject * dayVal(); QObject * customVal(const QString & ReqExp); QObject * widgetGetLayout(QWidget * w); QObject * createGridLayout(); void layoutGridAddLayout(QObject *, QObject *, int row, int column, int alignment = 0); void layoutBoxInsertWidget(QObject *, int index, QWidget *, int stretch = 0, int alignment = 0); void layoutGridAddWidget(QObject *, QWidget *, int row, int column, int alignment = 0); void layoutGridAddWidget(QObject *, QWidget *, int fromRow, int fromColumn, int rowSpan, int columnSpan, int alignment = 0); void layoutStackedInsertWidget(QObject *, int index, QWidget *); QObject * menuAddAction(QObject * menu, const QString & text, const bool enabled = true); QObject * menuAddMenu(QObject * menu, const QString & text, const QString & name = QString()); QObject * menuAddSeparator(QObject * menu); QObject * menuInsertAction(QObject * menu, QObject * before, const QString & name = QString(), const bool enabled = true); QObject * menuInsertMenu(QObject * menu, QObject * before, const QString & name); QObject * menuInsertSeparator(QObject * menu, QObject * before); void menuRemove(QObject * menu, QObject * action); int menuActionCount(QObject * menu); int tabCount(QWidget * tab); QWidget * tabWidget(QWidget * tab, int idx); int tabInsertTab(QWidget * tab, int idx, QWidget * page, const QString & text); int tabTabIndex(QWidget * tab, QWidget * page); void tabRemoveTab(QWidget * tab, int idx); void tabSetTabEnabled(QWidget * tab, int idx, bool enable); void tabSetTabText(QWidget * tab, int idx, const QString & text); QString tabtabText(QWidget * tab, int idx); QWidget * createWidget(const QString & className, QWidget * parent = 0, const QString & name = QString()); QObject * createLayout(const QString & className, QWidget * parent, const QString & name = QString()); QWidget * loadUi(const QString & screenName, QWidget * parent = 0); QWidget * lastWindow() const; QWidget * openWindow(const QString pname, QWidget *parent = 0, Qt::WindowModality modality = Qt::NonModal, Qt::WindowFlags flags = 0); QWidget * newDisplay(const QString pname, QWidget *parent = 0, Qt::WindowModality modality = Qt::NonModal, Qt::WindowFlags flags = 0); void addColumnXTreeWidget(QWidget * tree, const QString &, int, int, bool = true, const QString = QString(), const QString = QString()); void populateXTreeWidget(QWidget * tree, XSqlQuery pSql, bool = FALSE); void loadQWebView(QWidget * webView, const QString & url); bool printReport(const QString & name, const ParameterList & params, const QString & pdfFilename = QString::null); bool printReport(const QString & name, const ParameterList & params, const bool preview, QWidget *parent = 0); bool printReportCopies(const QString & name, const ParameterList & params, int copies); bool coreDisconnect(QObject * sender, const QString & signal, QObject * receiver, const QString & method); QString fileDialog(QWidget * parent, const QString & caption, const QString & dir, const QString & filter, int fileModeSel, int acceptModeSel); void openUrl(const QString & fileUrl); bool copyFile(const QString & oldName, const QString & newName); QString getFileName(const QString & path); bool renameFile(const QString & oldName, const QString & newName); bool removeFile(const QString & name); bool fileExists(const QString & name); QString getCurrentDir(); QString getHomeDir(); QString getTempDir(); void listProperties(const QScriptValue &obj, const bool showPrototype = true) const; bool makePath(const QString & mkPath, const QString & rootPath); int messageBox(const QString & type, QWidget * parent, const QString & title, const QString & text, int buttons = 0x00000400, int defaultButton = 0x00000000); bool removePath(const QString & rmPath, const QString & rootPath); QString rootPath(); QString textStreamRead(const QString & name); bool textStreamWrite(const QString & name, const QString & WriteText); int saveCreditCard(QWidget *parent, int custId, QString ccName, QString ccAddress1, QString ccAddress2, QString ccCity, QString ccState, QString ccZip, QString ccCountry, QString ccNumber, QString ccType, QString ccExpireMonth, QString ccExpireYear, int ccId = 0, bool ccActive = true ); QObject *getCreditCardProcessor(); QString storedProcErrorLookup(const QString proc, const int result); private: QScriptEngine * _engine; static QWidget * _lastWindow; }; #endif // __SCRIPTTOOLBOX_H__ qt-client-4.1.0/guiclient/searchForEmp.cpp000066400000000000000000000221261217451700100204620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "searchForEmp.h" #include #include #include #include #include #include #include #include "employee.h" #define DEBUG false // TODO: XDialog should have a default implementation that returns FALSE bool searchForEmp::userHasPriv(const int pMode) { if (DEBUG) qDebug("searchForEmp::userHasPriv(%d)", pMode); bool retval = _privileges->check("ViewEmployees") || _privileges->check("MaintainEmployees"); if (DEBUG) qDebug("searchForEmp::userHasPriv(%d) returning %d", pMode, retval); return retval; } // TODO: this code really belongs in XDialog void searchForEmp::setVisible(bool visible) { if (DEBUG) qDebug("searchForEmp::setVisible(%d) called", visible); if (! visible) XWidget::setVisible(false); else if (! userHasPriv()) { systemError(this, tr("You do not have sufficient privilege to view this window"), __FILE__, __LINE__); close(); } else XWidget::setVisible(true); } searchForEmp::searchForEmp(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_emp, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu *, QTreeWidgetItem *))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_searchCode, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchDept, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchMgr, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchNumber, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchName, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchShift, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_search, SIGNAL(editingFinished()), this, SLOT(sFillList())); connect(_showInactive, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); _emp->addColumn(tr("Site"), _whsColumn, Qt::AlignLeft, true, "warehous_code"); _emp->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "emp_code"); _emp->addColumn(tr("Number"), -1, Qt::AlignLeft, true, "emp_number"); _emp->addColumn(tr("First"), _itemColumn, Qt::AlignLeft, true, "cntct_first_name"); _emp->addColumn(tr("Last"), _itemColumn, Qt::AlignLeft, true, "cntct_last_name"); _emp->addColumn(tr("Manager"),_itemColumn, Qt::AlignLeft, true, "mgr_code"); _emp->addColumn(tr("Dept."), _itemColumn, Qt::AlignLeft, true, "dept_number"); _emp->addColumn(tr("Shift"), _itemColumn, Qt::AlignLeft, true, "shift_number"); if (_privileges->check("MaintainEmployees")) { _new->setEnabled(true); connect(_emp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_emp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else connect(_emp, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); connect(omfgThis, SIGNAL(itemsUpdated(int, bool)), SLOT(sFillList())); if (_preferences->boolean("XCheckBox/forgetful")) { _searchCode->setChecked(true); _searchDept->setChecked(true); _searchMgr->setChecked(true); _searchNumber->setChecked(true); _searchShift->setChecked(true); } } searchForEmp::~searchForEmp() { // no need to delete child widgets, Qt does it all for us } void searchForEmp::languageChange() { retranslateUi(this); } void searchForEmp::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("EmployeeList", params); if (report.isValid()) report.print(); else report.reportError(this); } void searchForEmp::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { QAction *menuItem; menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainEmployees")); if (((XTreeWidgetItem *)pSelected)->altId() > 0) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Manager..."), this, SLOT(sViewMgr())); menuItem = pMenu->addAction(tr("Edit Manager..."), this, SLOT(sEditMgr())); menuItem->setEnabled(_privileges->check("MaintainEmployees")); } } void searchForEmp::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("emp_id", _emp->id()); employee newdlg(this); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void searchForEmp::sEditMgr() { ParameterList params; params.append("mode", "edit"); params.append("emp_id", _emp->altId()); employee newdlg(this); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void searchForEmp::sNew() { ParameterList params; params.append("mode", "new"); employee newdlg(this); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void searchForEmp::sView() { ParameterList params; params.append("mode", "view"); params.append("emp_id", _emp->id()); employee newdlg(this); newdlg.set(params); newdlg.exec(); } void searchForEmp::sViewMgr() { ParameterList params; params.append("mode", "view"); params.append("emp_id", _emp->altId()); employee newdlg(this); newdlg.set(params); newdlg.exec(); } bool searchForEmp::setParams(ParameterList &pParams) { pParams.append("searchString", _search->text().toUpper()); if (_searchCode->isChecked()) pParams.append("searchCode"); if (_searchDept->isChecked()) pParams.append("searchDept"); if (_searchMgr->isChecked()) pParams.append("searchMgr"); if (_searchNumber->isChecked()) pParams.append("searchNumber"); if (_searchName->isChecked()) pParams.append("searchName"); if (_searchShift->isChecked()) pParams.append("searchShift"); if (!_showInactive->isChecked()) pParams.append("activeOnly"); if (!_warehouse->isAll()) pParams.append("warehouse_id", _warehouse->id()); return true; } void searchForEmp::sFillList() { XSqlQuery searchFillList; QString sql("SELECT e.emp_id, m.emp_id, warehous_code, e.emp_code, e.emp_number," " cntct_first_name, cntct_last_name, " " m.emp_code AS mgr_code, dept_number, shift_number " "FROM emp e " " LEFT OUTER JOIN cntct ON (emp_cntct_id=cntct_id) " " LEFT OUTER JOIN whsinfo ON (emp_warehous_id=warehous_id) " " LEFT OUTER JOIN emp m ON (e.emp_mgr_emp_id=m.emp_id) " " LEFT OUTER JOIN shift ON (e.emp_shift_id=shift_id) " " LEFT OUTER JOIN dept ON (e.emp_dept_id=dept_id) " "WHERE ((LENGTH(TRIM()) = 0)" "" " OR (e.emp_code ~* )" "" "" " OR (dept_number ~* )" " OR (dept_name ~* )" "" "" " OR (m.emp_code ~* )" " OR (m.emp_number ~* )" "" "" " OR (e.emp_number ~* )" "" "" " OR (shift_number ~* )" " OR (shift_name ~* )" "" "" " OR (cntct_first_name ~* )" " OR (cntct_last_name ~* )" "" " )" // end searchString "" " AND e.emp_active " "" "" " AND (warehous_id=)" "" "ORDER BY emp_code"); MetaSQLQuery mql(sql); ParameterList params; if (! setParams(params)) return; searchFillList = mql.toQuery(params); _emp->populate(searchFillList, true); if (searchFillList.lastError().type() != QSqlError::NoError) { systemError(this, searchFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/searchForEmp.h000066400000000000000000000024011217451700100201210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SEARCHFOREMP_H #define SEARCHFOREMP_H #include #include "guiclient.h" #include "xwidget.h" #include "ui_searchForEmp.h" class searchForEmp : public XWidget, public Ui::searchForEmp { Q_OBJECT public: searchForEmp(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~searchForEmp(); static bool userHasPriv(const int = cView); virtual void setVisible(bool); public slots: virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem *pSelected ); virtual void sEdit(); virtual void sEditMgr(); virtual void sFillList(); virtual void sNew(); virtual void sPrint(); virtual void sView(); virtual void sViewMgr(); virtual bool setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // SEARCHFOREMP_H qt-client-4.1.0/guiclient/searchForEmp.ui000066400000000000000000000255071217451700100203230ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. searchForEmp 0 0 800 600 Search for Employees 12 12 5 S&earch for: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _search Show &Inactive Employees Search through Employee Codes Manager Codes and Numbers Employee Numbers Departments Employee Name Shifts false Qt::Horizontal 0 20 0 &Close Print Qt::Vertical QSizePolicy::Preferred 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Employees: _emp 7 0 0 0 false &New false &Edit false &View Qt::Vertical QSizePolicy::Expanding 20 20 WarehouseGroup QGroupBox

    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _search _searchCode _searchNumber _searchMgr _searchDept _searchShift _showInactive _emp _new _edit _view _print _close _emp valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() searchForEmp close() 653 21 348 198 qt-client-4.1.0/guiclient/selectBankAccount.cpp000066400000000000000000000037401217451700100214750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "selectBankAccount.h" #include selectBankAccount::selectBankAccount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); _bankaccnt->setAllowNull(TRUE); } selectBankAccount::~selectBankAccount() { // no need to delete child widgets, Qt does it all for us } void selectBankAccount::languageChange() { retranslateUi(this); } enum SetResponse selectBankAccount::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("type", &valid); if (valid) _type = param.toString(); else _type = "A"; param = pParams.value("bankaccnt_id", &valid); if (valid) _bankaccntid = param.toInt(); else _bankaccntid = -1; populate(); return NoError; } void selectBankAccount::sSelect() { done(_bankaccnt->id()); } void selectBankAccount::sClose() { done(-1); } void selectBankAccount::populate() { if (_type == "A") _bankaccnt->populate( "SELECT bankaccnt_id, (bankaccnt_name || '-' || bankaccnt_descrip) " "FROM bankaccnt " "ORDER BY bankaccnt_name;" ); else if (_type == "R") _bankaccnt->setType(XComboBox::ARBankAccounts); else if (_type == "P") _bankaccnt->setType(XComboBox::APBankAccounts); if (_bankaccntid != -1) _bankaccnt->setId(_bankaccntid); } qt-client-4.1.0/guiclient/selectBankAccount.h000066400000000000000000000021541217451700100211400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SELECTBANKACCOUNT_H #define SELECTBANKACCOUNT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_selectBankAccount.h" class selectBankAccount : public XDialog, public Ui::selectBankAccount { Q_OBJECT public: selectBankAccount(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~selectBankAccount(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sSelect(); virtual void sClose(); virtual void populate(); protected slots: virtual void languageChange(); private: int _bankaccntid; QString _type; }; #endif // SELECTBANKACCOUNT_H qt-client-4.1.0/guiclient/selectBankAccount.ui000066400000000000000000000122501217451700100213240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. selectBankAccount 0 0 410 88 Select Bank Account 5 7 0 0 5 0 Bank Account: Qt::AlignVCenter|Qt::AlignRight 7 0 0 0 16 16 Expanding Vertical 0 0 5 0 &Cancel &Select true true 10 21 Expanding Vertical XComboBox QComboBox
    xcombobox.h
    0
    _bankaccnt _select _close parameter.h
    qt-client-4.1.0/guiclient/selectBillingQty.cpp000066400000000000000000000164651217451700100213730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "selectBillingQty.h" #include #include #include #include "storedProcErrorLookup.h" selectBillingQty::selectBillingQty(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_item, SIGNAL(newId(int)), this, SLOT(sHandleItem())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_toBill, SIGNAL(textChanged(const QString&)), this, SLOT(sHandleBillingQty())); _taxType->setEnabled(_privileges->check("OverrideTax")); _taxzoneid = -1; _toBill->setValidator(omfgThis->qtyVal()); _ordered->setPrecision(omfgThis->qtyVal()); _shipped->setPrecision(omfgThis->qtyVal()); _balance->setPrecision(omfgThis->qtyVal()); _uninvoiced->setPrecision(omfgThis->qtyVal()); } selectBillingQty::~selectBillingQty() { // no need to delete child widgets, Qt does it all for us } void selectBillingQty::languageChange() { retranslateUi(this); } enum SetResponse selectBillingQty::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("taxzone_id", &valid); if (valid) _taxzoneid = param.toInt(); param = pParams.value("soitem_id", &valid); if (valid) { _soitemid = param.toInt(); _item->setReadOnly(TRUE); XSqlQuery soitem; soitem.prepare( "SELECT itemsite_item_id, cust_partialship," " cohead_number, coitem_linenumber," " uom_name," " coitem_qtyord," " coitem_qtyshipped," " (coitem_qtyord - coitem_qtyshipped) AS qtybalance," " COALESCE(coitem_taxtype_id, -1) AS taxtype_id " "FROM coitem, itemsite, cohead, custinfo, uom " "WHERE ( (coitem_itemsite_id=itemsite_id)" " AND (coitem_cohead_id=cohead_id)" " AND (coitem_status <> 'X')" " AND (coitem_qty_uom_id=uom_id)" " AND (cohead_cust_id=cust_id)" " AND (coitem_id=:soitem_id) )" ); soitem.bindValue(":soitem_id", _soitemid); soitem.exec(); if (soitem.first()) { _cachedBalanceDue = soitem.value("qtybalance").toDouble(); _item->setId(soitem.value("itemsite_item_id").toInt()); _salesOrderNumber->setText(soitem.value("cohead_number").toString()); _lineNumber->setText(soitem.value("coitem_linenumber").toString()); _qtyUOM->setText(soitem.value("uom_name").toString()); _ordered->setDouble(soitem.value("coitem_qtyord").toDouble()); _shipped->setDouble(soitem.value("coitem_qtyshipped").toDouble()); _balance->setDouble(soitem.value("qtybalance").toDouble()); _cachedPartialShip = soitem.value("cust_partialship").toBool(); _closeLine->setChecked(!_cachedPartialShip); _closeLine->setEnabled(_cachedPartialShip); double uninvoiced; XSqlQuery shipitem; shipitem.prepare( "SELECT SUM(shipitem_qty) AS uninvoiced " "FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) " "WHERE ( (shiphead_shipped)" " AND (shiphead_order_type='SO')" " AND (NOT shipitem_invoiced)" " AND (shipitem_orderitem_id=:soitem_id) );" ); shipitem.bindValue(":soitem_id", _soitemid); shipitem.exec(); if (shipitem.first()) { uninvoiced = shipitem.value("uninvoiced").toDouble(); _uninvoiced->setDouble(shipitem.value("uninvoiced").toDouble()); } else { uninvoiced = 0.0; _uninvoiced->setDouble(0.0); } // take uninvoiced into account _cachedBalanceDue += uninvoiced; XSqlQuery cobill; cobill.prepare( "SELECT cobill_qty, cobill_toclose," " cobill_taxtype_id " "FROM cobill, cobmisc " "WHERE ((cobill_cobmisc_id=cobmisc_id) " " AND (NOT cobmisc_posted)" " AND (cobill_coitem_id=:soitem_id));" ); cobill.bindValue(":soitem_id", _soitemid); cobill.exec(); if (cobill.first()) { _toBill->setDouble(cobill.value("cobill_qty").toDouble()); if (soitem.value("cust_partialship").toBool()) _closeLine->setChecked(cobill.value("cobill_toclose").toBool()); // overwrite automatically-found values if user previously set them _taxType->setId(cobill.value("cobill_taxtype_id").toInt()); } else if (cobill.lastError().type() != QSqlError::NoError) { systemError(this, cobill.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } else { _toBill->setDouble(uninvoiced); if (soitem.value("cust_partialship").toBool()) _closeLine->setChecked((uninvoiced == _cachedBalanceDue)); } _toBill->setSelection(0, _toBill->text().length()); } else if (soitem.lastError().type() != QSqlError::NoError) { systemError(this, soitem.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } return NoError; } void selectBillingQty::sHandleBillingQty() { if (_cachedPartialShip) _closeLine->setChecked((_toBill->toDouble() == _cachedBalanceDue)); } void selectBillingQty::sSave() { XSqlQuery select; select.prepare("SELECT selectForBilling(:soitem_id, :qty, :close, " " :taxtypeid ) AS result;"); select.bindValue(":soitem_id", _soitemid); select.bindValue(":qty", _toBill->toDouble()); select.bindValue(":close", QVariant(_closeLine->isChecked())); if(_taxType->isValid()) select.bindValue(":taxtypeid", _taxType->id()); select.exec(); if(select.first()) { int result = select.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("selectForBilling", result), __FILE__, __LINE__); return; } } else if (select.lastError().type() != QSqlError::NoError) { systemError(this, select.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sBillingSelectionUpdated(-1, _soitemid); accept(); } void selectBillingQty::sHandleItem() { XSqlQuery selectHandleItem; XSqlQuery itemq; itemq.prepare("SELECT getItemTaxType(:item_id, :taxzone) AS result;"); itemq.bindValue(":item_id", _item->id()); if (_taxzoneid != -1) itemq.bindValue(":taxzone", _taxzoneid); itemq.exec(); if (itemq.first()) { int result = itemq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("getItemTaxType", result), __FILE__, __LINE__); return; } _taxType->setId(result); } else if (itemq.lastError().type() != QSqlError::NoError) { systemError(this, selectHandleItem.lastError().databaseText(), __FILE__, __LINE__); return; } else _taxType->id(-1); } qt-client-4.1.0/guiclient/selectBillingQty.h000066400000000000000000000023101217451700100210200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SELECTBILLINGQTY_H #define SELECTBILLINGQTY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_selectBillingQty.h" class selectBillingQty : public XDialog, public Ui::selectBillingQty { Q_OBJECT public: selectBillingQty(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~selectBillingQty(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sHandleBillingQty(); virtual void sHandleItem(); virtual void sSave(); protected slots: virtual void languageChange(); private: double _cachedBalanceDue; bool _cachedPartialShip; int _soitemid; int _taxzoneid; // changed from _taxauthid; }; #endif // SELECTBILLINGQTY_H qt-client-4.1.0/guiclient/selectBillingQty.ui000066400000000000000000000423411217451700100212160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. selectBillingQty 0 0 470 295 Select Billing Quantity 7 5 0 0 5 0 5 0 0 0 Sales Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 0 Qt::StrongFocus Qt::Horizontal QSizePolicy::Preferred 20 20 0 6 0 0 Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Uninvoiced: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 0 0 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 6 0 6 0 Qty UOM: Qt::Vertical 20 40 Qt::Horizontal QSizePolicy::Expanding 20 20 7 0 80 32767 Qt::AlignRight 0 0 Close this &Line After Billing Qt::Horizontal QSizePolicy::Preferred 20 20 To &Bill: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _toBill false true None XComboBox::TaxTypes Qt::Vertical QSizePolicy::Expanding 20 20 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 0 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 20 ItemCluster QWidget
    itemcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _item _toBill _closeLine _taxType _save _close _close clicked() selectBillingQty reject() 20 20 20 20
    qt-client-4.1.0/guiclient/selectOrderForBilling.cpp000066400000000000000000000535361217451700100223400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "selectOrderForBilling.h" #include #include //#include #include #include #include "salesOrder.h" #include "salesOrderList.h" #include "selectBillingQty.h" #include "storedProcErrorLookup.h" #include "taxBreakdown.h" selectOrderForBilling::selectOrderForBilling(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); _so->setAllowedTypes(OrderLineEdit::Sales); _so->setAllowedStatuses(OrderLineEdit::Open); connect(_cancel, SIGNAL(clicked()), this, SLOT(sCancelSelection())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEditOrder())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sFreightChanged())); connect(_miscCharge, SIGNAL(valueChanged()), this, SLOT(sUpdateTotal())); connect(_salesTaxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_select, SIGNAL(clicked()), this, SLOT(sEditSelection())); connect(_selectBalance, SIGNAL(clicked()), this, SLOT(sSelectBalance())); connect(_showClosed, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_so, SIGNAL(newId(int,QString)), this, SLOT(sPopulate(int))); connect(_salesTax, SIGNAL(valueChanged()), this, SLOT(sUpdateTotal())); connect(_subtotal, SIGNAL(valueChanged()), this, SLOT(sUpdateTotal())); connect(_taxZone, SIGNAL(newID(int)), this, SLOT(sTaxZoneChanged())); _cobmiscid = -1; _taxzoneidCache = -1; _captive = FALSE; _updated = FALSE; _freightCache = 0; _custCurrency->setLabel(_custCurrencyLit); _freight->clear(); _payment->clear(); _soitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "linenumber" ); _soitem->addColumn(tr("Item"), -1, Qt::AlignLeft , true, "item_number" ); _soitem->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _soitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft , true, "uom_name" ); _soitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight , true, "coitem_qtyord" ); _soitem->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight , true, "coitem_qtyshipped" ); _soitem->addColumn(tr("Returned"), _qtyColumn, Qt::AlignRight , true, "coitem_qtyreturned" ); _soitem->addColumn(tr("Uninvoiced"), _qtyColumn, Qt::AlignRight , true, "qtyatship" ); _soitem->addColumn(tr("Selected"), _qtyColumn, Qt::AlignRight , true, "qtytobill" ); _soitem->addColumn(tr("Extended"), _moneyColumn, Qt::AlignRight , true, "extended" ); _soitem->addColumn(tr("Close"), _ynColumn, Qt::AlignCenter, true, "toclose"); if (_privileges->check("MaintainSalesOrders")) connect(_so, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); if(!_privileges->check("AllowSelectOrderEditing")) { _miscCharge->setEnabled(false); _miscChargeDescription->setEnabled(false); _miscChargeAccount->setEnabled(false); } else { connect(_soitem, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_soitem, SIGNAL(valid(bool)), _selectBalance, SLOT(setEnabled(bool))); connect(_soitem, SIGNAL(valid(bool)), _cancel, SLOT(setEnabled(bool))); } // some customers are creating scripts to show these widgets, probably shouldn't remove _paymentLit->hide(); _payment->hide(); // Issue 10254: if no objections over time, we should ultimately remove this. _miscChargeAccount->setType(GLCluster::cRevenue | GLCluster::cExpense); } selectOrderForBilling::~selectOrderForBilling() { // no need to delete child widgets, Qt does it all for us } void selectOrderForBilling::languageChange() { retranslateUi(this); } SetResponse selectOrderForBilling::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("sohead_id", &valid); if (valid) { _captive = TRUE; _so->setId(param.toInt()); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; _close->setText(tr("&Cancel")); } } return NoError; } void selectOrderForBilling::clear() { _so->setId(-1); _cobmiscid = -1; _orderDate->clear(); _shipDate->clear(); _invoiceDate->clear(); _custName->clear(); _poNumber->clear(); _shipToName->clear(); _custCurrency->setCurrentIndex(0); _taxZone->setId(-1); _soitem->clear(); _shipvia->clear(); _miscChargeAccount->setId(-1); _miscChargeDescription->clear(); _comments->clear(); _subtotal->clear(); _miscCharge->clear(); _freight->clear(); _salesTax->clear(); _payment->clear(); _total->clear(); } void selectOrderForBilling::sSave() { XSqlQuery selectSave; if (!_shipDate->isValid()) { QMessageBox::information(this, tr("No Ship Date Entered"), tr("

    You must enter a Ship Date before " "selecting this order for billing." ) ); _shipDate->setFocus(); return; } if ( (! _miscCharge->isZero()) && (!_miscChargeAccount->isValid()) ) { QMessageBox::warning( this, tr("No Misc. Charge Account Number"), tr("

    You may not enter a Misc. Charge without " "indicating the G/L Sales Account number for the " "charge. Please set the Misc. Charge amount to 0 " "or select a Misc. Charge Sales Account." ) ); _miscChargeAccount->setFocus(); return; } if (_cobmiscid != -1) { selectSave.prepare( "UPDATE cobmisc " "SET cobmisc_freight=:cobmisc_freight," " cobmisc_payment=:cobmisc_payment," " cobmisc_taxzone_id=:cobmisc_taxzone_id," " cobmisc_notes=:cobmisc_notes," " cobmisc_shipdate=:cobmisc_shipdate, cobmisc_invcdate=:cobmisc_invcdate," " cobmisc_shipvia=:cobmisc_shipvia, cobmisc_closeorder=:cobmisc_closeorder," " cobmisc_misc=:cobmisc_misc, cobmisc_misc_accnt_id=:cobmisc_misc_accnt_id," " cobmisc_misc_descrip=:cobmisc_misc_descrip, " " cobmisc_curr_id=:cobmisc_curr_id " "WHERE (cobmisc_id=:cobmisc_id);" ); selectSave.bindValue(":cobmisc_id", _cobmiscid); selectSave.bindValue(":cobmisc_freight", _freight->localValue()); selectSave.bindValue(":cobmisc_payment", _payment->localValue()); if (_taxZone->isValid()) selectSave.bindValue(":cobmisc_taxzone_id", _taxZone->id()); selectSave.bindValue(":cobmisc_notes", _comments->toPlainText()); selectSave.bindValue(":cobmisc_shipdate", _shipDate->date()); selectSave.bindValue(":cobmisc_invcdate", _invoiceDate->date()); selectSave.bindValue(":cobmisc_shipvia", _shipvia->text()); selectSave.bindValue(":cobmisc_closeorder", QVariant(_closeOpenItems->isChecked())); selectSave.bindValue(":cobmisc_misc", _miscCharge->localValue()); selectSave.bindValue(":cobmisc_misc_accnt_id", _miscChargeAccount->id()); selectSave.bindValue(":cobmisc_misc_descrip", _miscChargeDescription->text().trimmed()); selectSave.bindValue(":cobmisc_curr_id", _custCurrency->id()); selectSave.exec(); if (selectSave.lastError().type() != QSqlError::NoError) { systemError(this, selectSave.lastError().databaseText(), __FILE__, __LINE__); return; } } omfgThis->sBillingSelectionUpdated(_so->id(), TRUE); if (_captive) close(); else { clear(); _so->setFocus(); } } void selectOrderForBilling::sSoList() { ParameterList params; params.append("sohead_id", _so->id()); if (_showClosed->isChecked()) params.append("soType", (cSoOpen || cSoClosed)); else params.append("soType", cSoOpen); salesOrderList newdlg(this, "", TRUE); newdlg.set(params); int id = newdlg.exec(); if(id != QDialog::Rejected) _so->setId(id); } void selectOrderForBilling::sPopulate(int pSoheadid) { XSqlQuery selectPopulate; if (_so->isValid()) { selectPopulate.prepare("SELECT createBillingHeader(:sohead_id) AS cobmisc_id;"); selectPopulate.bindValue(":sohead_id", pSoheadid); selectPopulate.exec(); if (selectPopulate.first()) { _cobmiscid = selectPopulate.value("cobmisc_id").toInt(); if (_cobmiscid < 0) { systemError(this, storedProcErrorLookup("createBillingHeader", _cobmiscid), __FILE__, __LINE__); return; } } else if (selectPopulate.lastError().type() != QSqlError::NoError) { systemError(this, selectPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery cobmisc; cobmisc.prepare( "SELECT cobmisc_id, cobmisc_notes, cobmisc_shipvia," " cohead_orderdate, cobmisc_shipdate," " cobmisc_invcdate, cobmisc_taxzone_id," " cobmisc_freight AS freight," " cobmisc_misc, cobmisc_misc_accnt_id, cobmisc_misc_descrip," " cobmisc_payment AS payment," " cobmisc_closeorder," " cobmisc_curr_id," " cohead_number, cohead_shipto_id," " cohead_custponumber," " cohead_billtoname, cohead_shiptoname," " CASE WHEN (shipchrg_custfreight IS NULL) THEN TRUE" " ELSE shipchrg_custfreight" " END AS custfreight " "FROM cobmisc , cohead " " LEFT OUTER JOIN shipchrg ON (cohead_shipchrg_id=shipchrg_id) " "WHERE ( (cobmisc_id=:cobmisc_id)" " AND (cohead_id=:cohead_id) ) "); cobmisc.bindValue(":cobmisc_id", _cobmiscid); cobmisc.bindValue(":cohead_id", pSoheadid); cobmisc.exec(); if (cobmisc.first()) { _cobmiscid = cobmisc.value("cobmisc_id").toInt(); // do taxzone first so we can overwrite the result of the signal cascade _taxzoneidCache = cobmisc.value("cobmisc_taxzone_id").toInt(); _taxZone->setId(cobmisc.value("cobmisc_taxzone_id").toInt()); _orderDate->setDate(cobmisc.value("cohead_orderdate").toDate(), true); _shipDate->setDate(cobmisc.value("cobmisc_shipdate").toDate()); _invoiceDate->setDate(cobmisc.value("cobmisc_invcdate").toDate()); _poNumber->setText(cobmisc.value("cohead_custponumber").toString()); _custName->setText(cobmisc.value("cohead_billtoname").toString()); _shipToName->setText(cobmisc.value("cohead_shiptoname").toString()); _shipvia->setText(cobmisc.value("cobmisc_shipvia").toString()); _miscCharge->setLocalValue(cobmisc.value("cobmisc_misc").toDouble()); _miscChargeAccount->setId(cobmisc.value("cobmisc_misc_accnt_id").toInt()); _miscChargeDescription->setText(cobmisc.value("cobmisc_misc_descrip")); _payment->set(cobmisc.value("payment").toDouble(), cobmisc.value("cobmisc_curr_id").toInt(), cobmisc.value("cohead_orderdate").toDate(), false); _custCurrency->setId(cobmisc.value("cobmisc_curr_id").toInt()); _comments->setText(cobmisc.value("cobmisc_notes").toString()); _closeOpenItems->setChecked(cobmisc.value("cobmisc_closeorder").toBool()); _freightCache = cobmisc.value("freight").toDouble(); if (cobmisc.value("custfreight").toBool()) { _freight->setEnabled(TRUE); _freight->setLocalValue(cobmisc.value("freight").toDouble()); } else { _freight->setEnabled(FALSE); _freight->clear(); } } else if (selectPopulate.lastError().type() != QSqlError::NoError) { systemError(this, selectPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } else { clear(); } sFillList(); } void selectOrderForBilling::sEditOrder() { salesOrder::editSalesOrder(_so->id(), false); } void selectOrderForBilling::sEditSelection() { ParameterList params; params.append("soitem_id", _soitem->id()); params.append("taxzone_id", _taxZone->id()); selectBillingQty newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillList(); _updated = TRUE; } } void selectOrderForBilling::sCancelSelection() { XSqlQuery selectCancelSelection; selectCancelSelection.prepare( "DELETE FROM cobill " "WHERE ((cobill_coitem_id=:coitem_id)" " AND (SELECT NOT cobmisc_posted" " FROM cobmisc" " WHERE (cobill_cobmisc_id=cobmisc_id) ) ) "); selectCancelSelection.bindValue(":coitem_id", _soitem->id()); selectCancelSelection.exec(); sFillList(); } void selectOrderForBilling::sSelectBalance() { XSqlQuery selectSelectBalance; selectSelectBalance.prepare("SELECT selectBalanceForBilling(:sohead_id) AS result;"); selectSelectBalance.bindValue(":sohead_id", _so->id()); selectSelectBalance.exec(); if (selectSelectBalance.first()) { int result = selectSelectBalance.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("selectBalanceForBilling", result), __FILE__, __LINE__); return; } } else if (selectSelectBalance.lastError().type() != QSqlError::NoError) { systemError(this, selectSelectBalance.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void selectOrderForBilling::sCalculateTax() { XSqlQuery taxq; taxq.prepare( "SELECT SUM(tax) AS tax " "FROM (" "SELECT ROUND(SUM(taxdetail_tax),2) AS tax " "FROM tax " " JOIN calculateTaxDetailSummary('B', :cobmisc_id, 'T') ON (taxdetail_tax_id=tax_id)" "GROUP BY tax_id) AS data;" ); taxq.bindValue(":cobmisc_id", _cobmiscid); taxq.exec(); if (taxq.first()) _salesTax->setLocalValue(taxq.value("tax").toDouble()); else if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } // changing _tax fires sCalculateTotal() } void selectOrderForBilling::sUpdateTotal() { _total->setLocalValue( _subtotal->localValue() + _salesTax->localValue() + _miscCharge->localValue() + _freight->localValue() ); } void selectOrderForBilling::sFillList() { XSqlQuery selectFillList; _soitem->clear(); if (_so->isValid()) { QString sql( "SELECT coitem_id, formatSoLineNumber(coitem_id) AS linenumber," " item_number, iteminvpricerat(item_id) AS invpricerat," " warehous_code, coitem_price," " uom_name, coitem_qtyord, coitem_qtyshipped," " coitem_qtyreturned," " ( SELECT COALESCE(SUM(shipitem_qty), 0)" " FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) " " WHERE ( (shipitem_orderitem_id=coitem_id)" " AND (NOT shipitem_invoiced) " " AND (shiphead_order_type='SO') " " AND (shiphead_shipped) ) ) AS qtyatship," " ( SELECT COALESCE(SUM(cobill_qty), 0)" " FROM cobill, cobmisc " " WHERE ( (cobill_cobmisc_id=cobmisc_id)" " AND (cobill_coitem_id=coitem_id)" " AND (NOT cobmisc_posted) ) ) AS qtytobill," " round(( " " ( SELECT COALESCE(SUM(cobill_qty), 0)" " FROM cobill, cobmisc " " WHERE ( (cobill_cobmisc_id=cobmisc_id)" " AND (cobill_coitem_id=coitem_id)" " AND (NOT cobmisc_posted) ) ) * coitem_qty_invuomratio " " * ( coitem_price / coitem_price_invuomratio)), 2) AS extended, " " COALESCE((SELECT cobill_toclose" " FROM cobill, cobmisc " " WHERE ((cobill_cobmisc_id=cobmisc_id)" " AND (cobill_coitem_id=coitem_id)" " AND (NOT cobmisc_posted))" " ORDER BY cobill_toclose DESC" " LIMIT 1),FALSE) AS toclose, " " 'qty' AS coitem_qtyord_xtnumericrole, " " 'qty' AS coitem_qtyshipped_xtnumericrole, " " 'qty' AS coitem_qtyreturned_xtnumericrole, " " 'qty' AS qtyatship_xtnumericrole, " " 'qty' AS qtytobill_xtnumericrole, " " 'extprice' AS extended_xtnumericrole " "FROM coitem, itemsite, item, site(), uom " "WHERE ( (coitem_itemsite_id=itemsite_id)" " AND (coitem_status <> 'X')" " AND (coitem_qty_uom_id=uom_id)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=warehous_id)" " " " AND (coitem_status <> 'C')" " " " AND (coitem_cohead_id=) ) " "ORDER BY coitem_linenumber, coitem_subnumber;" ); ParameterList params; if (!_showClosed->isChecked()) params.append("showOpenOnly"); params.append("sohead_id", _so->id()); MetaSQLQuery mql(sql); selectFillList = mql.toQuery(params); _soitem->populate(selectFillList); if (selectFillList.first()) { double subtotal = 0.0; do subtotal += selectFillList.value("extended").toDouble(); while (selectFillList.next()); _subtotal->setLocalValue(subtotal); } else { if (selectFillList.lastError().type() != QSqlError::NoError) systemError(this, selectFillList.lastError().databaseText(), __FILE__, __LINE__); _subtotal->clear(); } sCalculateTax(); } } void selectOrderForBilling::sHandleShipchrg(int pShipchrgid) { XSqlQuery query; query.prepare( "SELECT shipchrg_custfreight " "FROM shipchrg " "WHERE (shipchrg_id=:shipchrg_id);" ); query.bindValue(":shipchrg_id", pShipchrgid); query.exec(); if (query.first()) { if (query.value("shipchrg_custfreight").toBool()) _freight->setEnabled(TRUE); else { _freight->setEnabled(FALSE); _freight->clear(); } } else if (query.lastError().type() != QSqlError::NoError) { systemError(this, query.lastError().databaseText(), __FILE__, __LINE__); return; } } void selectOrderForBilling::sTaxDetail() { XSqlQuery taxq; taxq.prepare("UPDATE cobmisc SET cobmisc_taxzone_id=:taxzone," " cobmisc_freight=:freight," " cobmisc_invcdate=:invcdate " "WHERE (cobmisc_id=:cobmisc_id);"); if(_taxZone->isValid()) taxq.bindValue(":taxzone", _taxZone->id()); taxq.bindValue(":freight", _freight->localValue()); taxq.bindValue(":cobmisc_id", _cobmiscid); taxq.bindValue(":invcdate", _invoiceDate->date()); taxq.exec(); if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } ParameterList params; params.append("order_id", _cobmiscid); params.append("order_type", "B"); params.append("mode", "edit"); taxBreakdown newdlg(this, "", TRUE); if (newdlg.set(params) == NoError) { newdlg.exec(); sPopulate(_so->id()); } } void selectOrderForBilling::closeEvent(QCloseEvent * pEvent) { XSqlQuery selectcloseEvent; selectcloseEvent.prepare("SELECT releaseUnusedBillingHeader(:cobmisc_id) AS result;"); selectcloseEvent.bindValue(":cobmisc_id", _cobmiscid); selectcloseEvent.exec(); if (selectcloseEvent.first()) { int result = selectcloseEvent.value("result").toInt(); if (result < -2) // don't bother the user with -1:posted or -2:has-lines systemError(this, storedProcErrorLookup("releaseUnusedBillingHeader", result), __FILE__, __LINE__); } else if (selectcloseEvent.lastError().type() != QSqlError::NoError) systemError(this, selectcloseEvent.lastError().databaseText(), __FILE__, __LINE__); XWidget::closeEvent(pEvent); } void selectOrderForBilling::sTaxZoneChanged() { if (_cobmiscid != -1 && _taxzoneidCache != _taxZone->id()) { XSqlQuery taxq; taxq.prepare("UPDATE cobmisc SET " " cobmisc_taxzone_id=:taxzone_id, " " cobmisc_freight=:freight " "WHERE (cobmisc_id=:cobmisc_id) "); if (_taxZone->id() != -1) taxq.bindValue(":taxzone_id", _taxZone->id()); taxq.bindValue(":cobmisc_id", _cobmiscid); taxq.bindValue(":freight", _freight->localValue()); taxq.exec(); if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } _taxzoneidCache = _taxZone->id(); sCalculateTax(); } } void selectOrderForBilling::sFreightChanged() { if (_cobmiscid != -1 && _freightCache != _freight->localValue()) { XSqlQuery taxq; taxq.prepare("UPDATE cobmisc SET " " cobmisc_freight=:freight " "WHERE (cobmisc_id=:cobmisc_id) "); taxq.bindValue(":cobmisc_id", _cobmiscid); taxq.bindValue(":freight", _freight->localValue()); taxq.exec(); if (taxq.lastError().type() != QSqlError::NoError) { systemError(this, taxq.lastError().databaseText(), __FILE__, __LINE__); return; } _freightCache = _freight->localValue(); sCalculateTax(); } } qt-client-4.1.0/guiclient/selectOrderForBilling.h000066400000000000000000000033001217451700100217650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SELECTORDERFORBILLING_H #define SELECTORDERFORBILLING_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_selectOrderForBilling.h" class selectOrderForBilling : public XWidget, public Ui::selectOrderForBilling { Q_OBJECT public: selectOrderForBilling(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~selectOrderForBilling(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void clear(); virtual void sCalculateTax(); virtual void sCancelSelection(); virtual void sEditOrder(); virtual void sEditSelection(); virtual void sFillList(); virtual void sHandleShipchrg( int pShipchrgid ); virtual void sPopulate( int pSoheadid ); virtual void sSave(); virtual void sSelectBalance(); virtual void sSoList(); virtual void sUpdateTotal(); virtual void sTaxZoneChanged(); virtual void sFreightChanged(); protected slots: virtual void languageChange(); virtual void sTaxDetail(); protected: virtual void closeEvent(QCloseEvent * event); private: int _cobmiscid; bool _captive; bool _updated; int _mode; int _taxzoneidCache; double _freightCache; }; #endif // SELECTORDERFORBILLING_H qt-client-4.1.0/guiclient/selectOrderForBilling.ui000066400000000000000000001055601217451700100221660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. selectOrderForBilling 0 0 844 572 0 0 Select Order for Billing 12 Sales Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal 40 20 Ship Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Invoice Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 false false Qt::Vertical 20 0 Cust. Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 P/O Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Ship-To Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true true None XComboBox::TaxZones Qt::Horizontal 40 20 Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical 20 0 Qt::Horizontal 40 20 0 false &Save true &Close false &Edit Order Qt::Vertical QSizePolicy::Expanding 20 0 0 1 0 Line Items Show Closed Line Items Qt::Horizontal QSizePolicy::Preferred 40 20 Close all Open Items Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 0 100 0 false &Edit false Ca&ncel false Select &Balance Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Horizontal 40 20 0 Subtotal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 120 0 Misc. Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 120 0 true false false false Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 false false false Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 120 0 Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false false Payment Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 280 32767 false false Misc. Charge Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Misc. Charge Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false XComboBox::Currencies Qt::Horizontal 40 20 Notes CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    GLCluster QWidget
    glcluster.h
    OrderCluster QWidget
    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _so _orderDate _shipDate _invoiceDate _taxZone _shipvia _tab _showClosed _soitem _closeOpenItems _custCurrency _miscChargeDescription _miscChargeAccount _miscCharge _freight _total _payment _select _cancel _selectBalance _save _close _edit _comments _close clicked() selectOrderForBilling close() 20 20 20 20 _custCurrency newID(int) _total setId(int) 20 20 20 20 _custCurrency newID(int) _subtotal setId(int) 20 20 20 20 _custCurrency newID(int) _miscCharge setId(int) 20 20 20 20 _custCurrency newID(int) _salesTax setId(int) 20 20 20 20 _custCurrency newID(int) _payment setId(int) 20 20 20 20 _custCurrency newID(int) _freight setId(int) 20 20 20 20 _invoiceDate newDate(QDate) _total setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _payment setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _salesTax setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _miscCharge setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _freight setEffective(QDate) 20 20 20 20 _invoiceDate newDate(QDate) _subtotal setEffective(QDate) 20 20 20 20 _soitem itemSelected(int) _select animateClick() 20 20 20 20 _so valid(bool) _save setEnabled(bool) 230 43 738 30 qt-client-4.1.0/guiclient/selectPayment.cpp000066400000000000000000000232631217451700100207240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "selectPayment.h" #include #include #include #include "applyDiscount.h" selectPayment::selectPayment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_discount, SIGNAL(clicked()), this, SLOT(sDiscount())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_selected, SIGNAL(idChanged(int)), this, SLOT(sPriceGroup())); _bankaccnt->setAllowNull(TRUE); _bankaccnt->setType(XComboBox::APBankAccounts); _vendor->setReadOnly(TRUE); sPriceGroup(); } selectPayment::~selectPayment() { // no need to delete child widgets, Qt does it all for us } void selectPayment::languageChange() { retranslateUi(this); } enum SetResponse selectPayment::set(const ParameterList &pParams) { XSqlQuery selectet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("bankaccnt_id", &valid); if (valid) _bankaccnt->setId(param.toInt()); param = pParams.value("apopen_id", &valid); if (valid) { _apopenid = param.toInt(); selectet.prepare( "SELECT apselect_id " "FROM apselect " "WHERE (apselect_apopen_id=:apopen_id);" ); selectet.bindValue(":apopen_id", _apopenid); selectet.exec(); if (selectet.first()) { _mode = cEdit; _apselectid = selectet.value("apselect_id").toInt(); } else if (selectet.lastError().type() != QSqlError::NoError) { systemError(this, selectet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } else { _mode = cNew; _apselectid = -1; _discountAmount->setLocalValue(0.0); } populate(); } return NoError; } void selectPayment::sSave() { XSqlQuery selectSave; if (_selected->isZero()) { QMessageBox::warning( this, tr("Cannot Select for Payment"), tr("

    You must specify an amount greater than zero. " "If you want to clear this selection you may do so " "from the screen you selected this payment from.") ); return; } else if ((_selected->localValue() + _discountAmount->localValue()) > (_amount->localValue() + 0.0000001)) { QMessageBox::warning( this, tr("Cannot Select for Payment"), tr("You must specify an amount smaller than or equal to the Balance.") ); _selected->setFocus(); return; } if (_bankaccnt->id() == -1) { QMessageBox::warning( this, tr("Cannot Select for Payment"), tr("

    You must select a Bank Account from which " "this Payment is to be paid.") ); _bankaccnt->setFocus(); return; } selectSave.prepare("SELECT bankaccnt_curr_id, currConcat(bankaccnt_curr_id) AS currAbbr " "FROM bankaccnt " "WHERE bankaccnt_id = :accntid;"); selectSave.bindValue(":accntid", _bankaccnt->id()); selectSave.exec(); if (selectSave.first()) { if (selectSave.value("bankaccnt_curr_id").toInt() != _selected->id()) { int response = QMessageBox::question(this, tr("Currencies Do Not Match"), tr("

    The currency selected for this payment " "(%1) is not the same as the currency for the " "Bank Account (%2). Would you like to use " "this Bank Account anyway?") .arg(_selected->currAbbr()) .arg(selectSave.value("currAbbr").toString()), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); if (response == QMessageBox::No) { _bankaccnt->setFocus(); return; } } } else { systemError(this, selectSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cNew) { selectSave.exec("SELECT NEXTVAL('apselect_apselect_id_seq') AS apselect_id;"); if (selectSave.first()) _apselectid = selectSave.value("apselect_id").toInt(); else if (selectSave.lastError().type() != QSqlError::NoError) { systemError(this, selectSave.lastError().databaseText(), __FILE__, __LINE__); return; } selectSave.prepare( "INSERT INTO apselect " "( apselect_id, apselect_apopen_id," " apselect_amount, apselect_bankaccnt_id, " " apselect_curr_id, apselect_date, apselect_discount ) " "VALUES " "( :apselect_id, :apselect_apopen_id," " :apselect_amount, :apselect_bankaccnt_id, " " :apselect_curr_id, :apselect_docdate, :apselect_discount );" ); selectSave.bindValue(":apselect_apopen_id", _apopenid); } else if (_mode == cEdit) selectSave.prepare( "UPDATE apselect " "SET apselect_amount=:apselect_amount, " " apselect_bankaccnt_id=:apselect_bankaccnt_id, " " apselect_curr_id=:apselect_curr_id, " " apselect_date=:apselect_docdate," " apselect_discount=:apselect_discount " "WHERE (apselect_id=:apselect_id);" ); selectSave.bindValue(":apselect_id", _apselectid); selectSave.bindValue(":apselect_amount", _selected->localValue()); selectSave.bindValue(":apselect_bankaccnt_id", _bankaccnt->id()); selectSave.bindValue(":apselect_curr_id", _selected->id()); selectSave.bindValue(":apselect_docdate", _docDate->date()); selectSave.bindValue(":apselect_discount", _discountAmount->localValue()); selectSave.exec(); if (selectSave.lastError().type() != QSqlError::NoError) { systemError(this, selectSave.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPaymentsUpdated(_bankaccnt->id(), _apselectid, TRUE); done (_apselectid); } void selectPayment::populate() { XSqlQuery selectpopulate; selectpopulate.prepare( "SELECT apopen_vend_id, apopen_docnumber, apopen_ponumber," " apopen_docdate, apopen_duedate," " apopen_amount, " " COALESCE(apselect_curr_id, apopen_curr_id) AS curr_id, " " (apopen_amount - apopen_paid" " - COALESCE((SELECT SUM(checkitem_amount + checkitem_discount) " " FROM checkitem, checkhead " " WHERE ((checkitem_checkhead_id=checkhead_id) " " AND (checkitem_apopen_id=apopen_id) " " AND (NOT checkhead_void) " " AND (NOT checkhead_posted)) " " ),0)) AS f_amount," " COALESCE(apselect_amount, (apopen_amount - apopen_paid" " - COALESCE((SELECT SUM(checkitem_amount + checkitem_discount) " " FROM checkitem, checkhead " " WHERE ((checkitem_checkhead_id=checkhead_id) " " AND (checkitem_apopen_id=apopen_id) " " AND (NOT checkhead_void) " " AND (NOT checkhead_posted)) " " ),0))) AS f_selected," " COALESCE(apselect_discount, 0.0) AS discount," " COALESCE(apselect_bankaccnt_id, -1) AS bankaccnt_id," " (terms_code || '-' || terms_descrip) AS f_terms " "FROM terms RIGHT OUTER JOIN apopen ON (apopen_terms_id=terms_id) " " LEFT OUTER JOIN apselect ON (apselect_apopen_id=apopen_id) " "WHERE apopen_id=:apopen_id;" ); selectpopulate.bindValue(":apopen_id", _apopenid); selectpopulate.exec(); if (selectpopulate.first()) { _selected->setId(selectpopulate.value("curr_id").toInt()); _selected->setLocalValue(selectpopulate.value("f_selected").toDouble()); _vendor->setId(selectpopulate.value("apopen_vend_id").toInt()); _docNumber->setText(selectpopulate.value("apopen_docnumber").toString()); _poNum->setText(selectpopulate.value("apopen_ponumber").toString()); _docDate->setDate(selectpopulate.value("apopen_docdate").toDate()); _dueDate->setDate(selectpopulate.value("apopen_duedate").toDate()); _terms->setText(selectpopulate.value("f_terms").toString()); _total->setLocalValue(selectpopulate.value("apopen_amount").toDouble()); _discountAmount->setLocalValue(selectpopulate.value("discount").toDouble()); _amount->setLocalValue(selectpopulate.value("f_amount").toDouble()); if(selectpopulate.value("bankaccnt_id").toInt() != -1) _bankaccnt->setId(selectpopulate.value("bankaccnt_id").toInt()); } else if (selectpopulate.lastError().type() != QSqlError::NoError) { systemError(this, selectpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void selectPayment::sDiscount() { ParameterList params; params.append("apopen_id", _apopenid); params.append("curr_id", _selected->id()); if(_discountAmount->localValue() != 0.0) params.append("amount", _discountAmount->localValue()); applyDiscount newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() != XDialog::Rejected) { _discountAmount->setLocalValue(newdlg._amount->localValue()); if(_discountAmount->localValue() + _selected->localValue() > _amount->localValue()) _selected->setLocalValue(_amount->localValue() - _discountAmount->localValue()); } } void selectPayment::sPriceGroup() { if (! omfgThis->singleCurrency()) _priceGroup->setTitle(tr("In %1:").arg(_selected->currAbbr())); } qt-client-4.1.0/guiclient/selectPayment.h000066400000000000000000000021701217451700100203630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SELECTPAYMENT_H #define SELECTPAYMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_selectPayment.h" class selectPayment : public XDialog, public Ui::selectPayment { Q_OBJECT public: selectPayment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~selectPayment(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); virtual void sDiscount(); virtual void sPriceGroup(); protected slots: virtual void languageChange(); private: int _mode; int _apopenid; int _apselectid; }; #endif // SELECTPAYMENT_H qt-client-4.1.0/guiclient/selectPayment.ui000066400000000000000000000445231217451700100205610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. selectPayment 0 0 434 353 Select Payment 12 12 0 0 0 5 0 0 Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter P/O #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Payment Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _selected 0 0 0 0 false false Qt::Horizontal QSizePolicy::Expanding 0 16 0 0 100 0 100 0 5 5 Total Owed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Discount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Balance Owed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Doc. Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _docDate Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _dueDate 0 0 false Qt::Horizontal QSizePolicy::Expanding 0 10 Vendor #: Qt::StrongFocus Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _bankaccnt 0 0 Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 0 0 Qt::Horizontal QSizePolicy::Preferred 0 16 0 0 0 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 16 20 Edit Discount true true CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    VendorCluster QWidget
    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    _docDate _dueDate _selected _bankaccnt _save _close _discount _close clicked() selectPayment reject() 349 32 20 20 _selected idChanged(int) _discountAmount setId(int) 122 324 122 281 _selected idChanged(int) _total setId(int) 204 328 204 217 _selected effectiveChanged(QDate) _discountAmount setEffective(QDate) 142 325 142 281 _selected effectiveChanged(QDate) _total setEffective(QDate) 224 321 224 217 _selected idChanged(int) _amount setId(int) 161 321 163 241 _selected effectiveChanged(QDate) _amount setEffective(QDate) 180 326 183 243 qt-client-4.1.0/guiclient/selectPayments.cpp000066400000000000000000000441321217451700100211050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "selectPayments.h" #include "mqlutil.h" #include #include #include #include #include #include "guiclient.h" #include "selectBankAccount.h" #include "selectPayment.h" #include "storedProcErrorLookup.h" selectPayments::selectPayments(QWidget* parent, const char* name, Qt::WFlags fl, bool pAutoFill) : XWidget(parent, name, fl) { setupUi(this); _ignoreUpdates = true; connect(_clear, SIGNAL(clicked()), this, SLOT(sClear())); connect(_clearAll, SIGNAL(clicked()), this, SLOT(sClearAll())); connect(_selectDate, SIGNAL(currentIndexChanged(int)), this, SLOT(sFillList())); connect(_startDate, SIGNAL(newDate(const QDate&)), this, SLOT(sFillList())); connect(_endDate, SIGNAL(newDate(const QDate&)), this, SLOT(sFillList())); connect(_onOrBeforeDate, SIGNAL(newDate(const QDate&)), this, SLOT(sFillList())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_selectDiscount, SIGNAL(clicked()), this, SLOT(sSelectDiscount())); connect(_selectDue, SIGNAL(clicked()), this, SLOT(sSelectDue())); connect(_selectLine, SIGNAL(clicked()), this, SLOT(sSelectLine())); connect(_applyallcredits, SIGNAL(clicked()), this, SLOT(sApplyAllCredits())); connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sFillList())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_apopen, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); _bankaccnt->setType(XComboBox::APBankAccounts); _apopen->addColumn(tr("Vendor"), -1, Qt::AlignLeft , true, "vendor" ); _apopen->addColumn(tr("Doc. Type"), _orderColumn, Qt::AlignCenter, true, "doctype" ); _apopen->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignRight , true, "apopen_docnumber" ); _apopen->addColumn(tr("Inv. #"), _orderColumn, Qt::AlignRight , true, "apopen_invcnumber" ); _apopen->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight , true, "apopen_ponumber" ); _apopen->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "apopen_duedate" ); _apopen->addColumn(tr("Doc. Date"), _dateColumn, Qt::AlignCenter, false, "apopen_docdate" ); _apopen->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight , true, "amount" ); _apopen->addColumn(tr("Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_amount" ); _apopen->addColumn(tr("Running Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "running_amount" ); _apopen->addColumn(tr("Selected"), _moneyColumn, Qt::AlignRight , true, "selected" ); _apopen->addColumn(tr("Selected (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_selected" ); _apopen->addColumn(tr("Running Selected (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, true, "running_selected" ); _apopen->addColumn(tr("Discount"), _moneyColumn, Qt::AlignRight , true, "discount" ); _apopen->addColumn(tr("Discount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_discount" ); _apopen->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "curr_concat" ); _apopen->addColumn(tr("Status"), _currencyColumn, Qt::AlignCenter, true, "apopen_status" ); // if (omfgThis->singleCurrency()) // { // _apopen->hideColumn("curr_concat"); // _apopen->headerItem()->setText(11, tr("Running")); // } if (_privileges->check("ApplyAPMemos")) connect(_apopen, SIGNAL(valid(bool)), _applyallcredits, SLOT(setEnabled(bool))); connect(omfgThis, SIGNAL(paymentsUpdated(int, int, bool)), this, SLOT(sFillList())); _ignoreUpdates = false; if(pAutoFill) sFillList(); } selectPayments::~selectPayments() { // no need to delete child widgets, Qt does it all for us } void selectPayments::languageChange() { retranslateUi(this); } bool selectPayments::setParams(ParameterList ¶ms) { _vendorgroup->appendValue(params); return true; } void selectPayments::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("SelectPaymentsList", params); if (report.isValid()) report.print(); else report.reportError(this); } void selectPayments::sSelectDue() { XSqlQuery selectSelectDue; ParameterList params; params.append("type", "P"); int bankaccntid = _bankaccnt->id(); if(bankaccntid == -1) { selectBankAccount newdlg(this, "", TRUE); newdlg.set(params); bankaccntid = newdlg.exec(); } if (bankaccntid >= 0) { MetaSQLQuery mql("SELECT selectDueItemsForPayment(" " " " vend_id ," " ) AS result " "" ";" "" "FROM vendinfo " "WHERE (vend_vendtype_id=);" "" "FROM vendinfo " "WHERE (vend_vendtype_id IN (SELECT vendtype_id" " FROM vendtype" " WHERE (vendtype_code ~ )));" "" "FROM vendinfo;" ""); ParameterList params; if (! setParams(params)) return; params.append("bankaccnt_id", bankaccntid); selectSelectDue = mql.toQuery(params); if (selectSelectDue.first()) { int result = selectSelectDue.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("selectDueItemsForPayment", result), __FILE__, __LINE__); return; } } else if (selectSelectDue.lastError().type() != QSqlError::NoError) { systemError(this, selectSelectDue.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPaymentsUpdated(-1, -1, TRUE); } } void selectPayments::sSelectDiscount() { XSqlQuery selectSelectDiscount; ParameterList params; params.append("type", "P"); int bankaccntid = _bankaccnt->id(); if(bankaccntid == -1) { selectBankAccount newdlg(this, "", TRUE); newdlg.set(params); bankaccntid = newdlg.exec(); } if (bankaccntid >= 0) { MetaSQLQuery mql("SELECT selectDiscountItemsForPayment(" " " " vend_id ," " ) AS result " "" ";" "" "FROM vendinfo " "WHERE (vend_vendtype_id=);" "" "FROM vendinfo " "WHERE (vend_vendtype_id IN (SELECT vendtype_id" " FROM vendtype" " WHERE (vendtype_code ~ )));" "" "FROM vendinfo;" ""); ParameterList params; if (! setParams(params)) return; params.append("bankaccnt_id", bankaccntid); selectSelectDiscount = mql.toQuery(params); if (selectSelectDiscount.first()) { int result = selectSelectDiscount.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("selectDiscountItemsForPayment", result), __FILE__, __LINE__); return; } } else if (selectSelectDiscount.lastError().type() != QSqlError::NoError) { systemError(this, selectSelectDiscount.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPaymentsUpdated(-1, -1, TRUE); } } void selectPayments::sClearAll() { XSqlQuery selectClearAll; switch (_vendorgroup->state()) { case VendorGroup::All: selectClearAll.prepare( "SELECT clearPayment(apselect_id) AS result " "FROM apselect;" ); break; case VendorGroup::Selected: selectClearAll.prepare( "SELECT clearPayment(apselect_id) AS result " "FROM apopen JOIN apselect ON (apselect_apopen_id=apopen_id) " "WHERE (apopen_vend_id=:vend_id);" ); break; case VendorGroup::SelectedType: selectClearAll.prepare( "SELECT clearPayment(apselect_id) AS result " "FROM vendinfo JOIN apopen ON (apopen_vend_id=vend_id) " " JOIN apselect ON (apselect_apopen_id=apopen_id) " "WHERE (vend_vendtype_id=:vendtype_id) ;" ); break; case VendorGroup::TypePattern: selectClearAll.prepare( "SELECT clearPayment(apselect_id) AS result " "FROM vendinfo JOIN apopen ON (apopen_vend_id=vend_id) " " JOIN apselect ON (apselect_apopen_id=apopen_id) " "WHERE (vend_vendtype_id IN (SELECT vendtype_id" " FROM vendtype" " WHERE (vendtype_code ~ :vendtype_pattern)));" ); break; } _vendorgroup->bindValue(selectClearAll); selectClearAll.exec(); if (selectClearAll.first()) { int result = selectClearAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("clearPayment", result), __FILE__, __LINE__); return; } } else if (selectClearAll.lastError().type() != QSqlError::NoError) { systemError(this, selectClearAll.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPaymentsUpdated(-1, -1, TRUE); } void selectPayments::sSelect() { _ignoreUpdates = true; bool update = false; QList list = _apopen->selectedItems(); XTreeWidgetItem * cursor = 0; XSqlQuery slct; slct.prepare("SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;"); for(int i = 0; i < list.size(); i++) { cursor = (XTreeWidgetItem*)list.at(i); slct.bindValue(":apopen_id", cursor->id()); slct.exec(); if (slct.first()) { if (slct.value("apopen_status").toString() == "H") { QMessageBox::critical( this, tr("Can not do Payment"), tr( "Item is On Hold" ) ); return; } else { ParameterList params; params.append("apopen_id", cursor->id()); if(_bankaccnt->id() != -1) params.append("bankaccnt_id", _bankaccnt->id()); selectPayment newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() != XDialog::Rejected) update = true; } } else { QMessageBox::critical( this, tr("Can not do Payment"), tr( "apopen not found" ) ); return; } } _ignoreUpdates = false; if(update) sFillList(); } void selectPayments::sSelectLine() { XSqlQuery selectSelectLine; ParameterList params; params.append("type", "P"); int bankaccntid = _bankaccnt->id(); if(bankaccntid == -1) { selectBankAccount newdlg(this, "", TRUE); newdlg.set(params); bankaccntid = newdlg.exec(); } if (bankaccntid != -1) { bool update = FALSE; QList list = _apopen->selectedItems(); XTreeWidgetItem * cursor = 0; selectSelectLine.prepare("SELECT selectPayment(:apopen_id, :bankaccnt_id) AS result;"); XSqlQuery slctln; slctln.prepare( "SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;"); for(int i = 0; i < list.size(); i++) { cursor = (XTreeWidgetItem*)list.at(i); selectSelectLine.bindValue(":apopen_id", cursor->id()); selectSelectLine.bindValue(":bankaccnt_id", bankaccntid); slctln.bindValue(":apopen_id", cursor->id()); slctln.exec(); if (slctln.first()) { if (slctln.value("apopen_status").toString() != "H") { selectSelectLine.exec(); if (selectSelectLine.first()) { int result = selectSelectLine.value("result").toInt(); if (result < 0) { systemError(this, cursor->text(0) + " " + cursor->text(2) + "\n" + storedProcErrorLookup("selectPayment", result), __FILE__, __LINE__); return; } } else if (selectSelectLine.lastError().type() != QSqlError::NoError) { systemError(this, selectSelectLine.lastError().databaseText(), __FILE__, __LINE__); return; } } update = TRUE; } } if(update) omfgThis->sPaymentsUpdated(-1, -1, TRUE); } } void selectPayments::sClear() { XSqlQuery selectClear; bool update = FALSE; QList list = _apopen->selectedItems(); XTreeWidgetItem * cursor = 0; selectClear.prepare("SELECT clearPayment(:apopen_id) AS result;"); for(int i = 0; i < list.size(); i++) { cursor = (XTreeWidgetItem*)list.at(i); selectClear.bindValue(":apopen_id", cursor->altId()); selectClear.exec(); if (selectClear.first()) { int result = selectClear.value("result").toInt(); if (result < 0) { systemError(this, cursor->text(0) + " " + cursor->text(2) + "\n" + storedProcErrorLookup("clearPayment", result), __FILE__, __LINE__); return; } } else if (selectClear.lastError().type() != QSqlError::NoError) { systemError(this, selectClear.lastError().databaseText(), __FILE__, __LINE__); return; } update = TRUE; } if(update) omfgThis->sPaymentsUpdated(-1, -1, TRUE); } void selectPayments::sApplyAllCredits() { XSqlQuery selectApplyAllCredits; MetaSQLQuery mql = mqlLoad("selectPayments", "applyallcredits"); ParameterList params; if (! setParams(params)) return; selectApplyAllCredits = mql.toQuery(params); if (selectApplyAllCredits.first()) sFillList(); else if (selectApplyAllCredits.lastError().type() != QSqlError::NoError) { systemError(this, selectApplyAllCredits.lastError().databaseText(), __FILE__, __LINE__); return; } } void selectPayments::sFillList() { XSqlQuery selectFillList; if(_ignoreUpdates) return; // if (_vendorgroup->isSelectedVend()) // _apopen->showColumn(9); // else // _apopen->hideColumn(9); if ( (_selectDate->currentIndex() == 1 && !_onOrBeforeDate->isValid()) || (_selectDate->currentIndex() == 2 && (!_startDate->isValid() || !_endDate->isValid())) ) return; int _currid = -1; if (_bankaccnt->isValid()) { selectFillList.prepare( "SELECT bankaccnt_curr_id " "FROM bankaccnt " "WHERE (bankaccnt_id=:bankaccnt_id);" ); selectFillList.bindValue(":bankaccnt_id", _bankaccnt->id()); selectFillList.exec(); if (selectFillList.first()) _currid = selectFillList.value("bankaccnt_curr_id").toInt(); } ParameterList params; if (! setParams(params)) return; params.append("voucher", tr("Voucher")); params.append("debitMemo", tr("Debit Memo")); if (_selectDate->currentIndex()==1) params.append("olderDate", _onOrBeforeDate->date()); else if (_selectDate->currentIndex()==2) { params.append("startDate", _startDate->date()); params.append("endDate", _endDate->date()); } if (_currid >= 0) params.append("curr_id", _currid); MetaSQLQuery mql = mqlLoad("apOpenItems", "selectpayments"); selectFillList = mql.toQuery(params); _apopen->populate(selectFillList,true); if (selectFillList.lastError().type() != QSqlError::NoError) { systemError(this, selectFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void selectPayments::sPopulateMenu(QMenu *pMenu,QTreeWidgetItem *selected) { QString status(selected->text(1)); QAction *menuItem; XSqlQuery menu; menu.prepare( "SELECT apopen_status FROM apopen WHERE apopen_id=:apopen_id;"); menu.bindValue(":apopen_id", _apopen->id()); menu.exec(); if (menu.first()) { if(menu.value("apopen_status").toString() == "O") { menuItem = pMenu->addAction(tr("On Hold"), this, SLOT(sOnHold())); menuItem->setEnabled(_privileges->check("EditAPOpenItem")); } if(menu.value("apopen_status").toString() == "H") { menuItem = pMenu->addAction(tr("Open"), this, SLOT(sOpen())); menuItem->setEnabled(_privileges->check("EditAPOpenItem")); } } } void selectPayments::sOpen() { XSqlQuery open; open.prepare("UPDATE apopen SET apopen_status = 'O' WHERE apopen_id=:apopen_id;"); open.bindValue(":apopen_id", _apopen->id()); open.exec(); sFillList(); } void selectPayments::sOnHold() { XSqlQuery selectpayment; selectpayment.prepare("SELECT * FROM apselect WHERE apselect_apopen_id = :apopen_id;"); selectpayment.bindValue(":apopen_id", _apopen->id()); selectpayment.exec(); if (selectpayment.first()) { QMessageBox::critical( this, tr("Can not change Status"), tr("

    You cannot set this item as On Hold. " "This Item is already selected for payment.")); return; } XSqlQuery onhold; onhold.prepare("UPDATE apopen SET apopen_status = 'H' WHERE apopen_id=:apopen_id;"); onhold.bindValue(":apopen_id", _apopen->id()); onhold.exec(); sFillList(); } qt-client-4.1.0/guiclient/selectPayments.h000066400000000000000000000025071217451700100205520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SELECTPAYMENTS_H #define SELECTPAYMENTS_H #include "xwidget.h" #include "ui_selectPayments.h" class selectPayments : public XWidget, public Ui::selectPayments { Q_OBJECT public: selectPayments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window, bool pAutoFill = true); ~selectPayments(); virtual bool setParams(ParameterList &); public slots: virtual void sPrint(); virtual void sSelectDue(); virtual void sSelectDiscount(); virtual void sClearAll(); virtual void sSelect(); virtual void sSelectLine(); virtual void sClear(); virtual void sApplyAllCredits(); virtual void sFillList(); virtual void sPopulateMenu(QMenu *pMenu,QTreeWidgetItem *selected); virtual void sOnHold(); virtual void sOpen(); protected: bool _ignoreUpdates; protected slots: virtual void languageChange(); }; #endif // SELECTPAYMENTS_H qt-client-4.1.0/guiclient/selectPayments.ui000066400000000000000000000376661217451700100207560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. selectPayments 0 0 800 600 Select Payments 12 12 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter All On or Before Between 0 true Qt::Horizontal 40 20 and Qt::Horizontal 40 20 0 &Close false false &Print false false Qt::Vertical QSizePolicy::Expanding 16 0 0 1 QFrame::NoFrame QFrame::Plain 0 0 Open Items: QAbstractItemView::ExtendedSelection 0 false Select... false false false Select Line false false false Clear Selection false false Qt::Vertical QSizePolicy::Preferred 20 10 Select all Due false false Select all Discounts false false Clear Selections false false false Apply all Credits Qt::Vertical QSizePolicy::Expanding 16 46 5 Use default Bank Account: 0 true Qt::Horizontal QSizePolicy::MinimumExpanding 40 20 DLineEdit QWidget

    datecluster.h
    1 VendorGroup QWidget
    vendorgroup.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _apopen _select _selectLine _clear _selectDue _selectDiscount _clearAll _bankaccnt _close _apopen valid(bool) _clear setEnabled(bool) 398 398 775 210 _close clicked() selectPayments close() 776 45 20 20 _apopen valid(bool) _selectLine setEnabled(bool) 534 469 775 187 _selectDate currentIndexChanged(int) _duedateStack setCurrentIndex(int) 119 89 279 93 _apopen valid(bool) _select setEnabled(bool) 637 148 701 148 qt-client-4.1.0/guiclient/selectShippedOrders.cpp000066400000000000000000000034011217451700100220520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "selectShippedOrders.h" selectShippedOrders::selectShippedOrders(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); _customerType->setType(ParameterGroup::CustomerType); } selectShippedOrders::~selectShippedOrders() { // no need to delete child widgets, Qt does it all for us } void selectShippedOrders::languageChange() { retranslateUi(this); } void selectShippedOrders::sSelect() { XSqlQuery selectSelect; if (_customerType->isAll()) selectSelect.prepare("SELECT selectUninvoicedShipments(:warehous_id) AS result;"); else if (_customerType->isSelected()) { selectSelect.prepare("SELECT selectUninvoicedShipments(:warehous_id, :custtype_id) AS result;"); selectSelect.bindValue(":custtype_id", _customerType->id()); } else if (_customerType->isPattern()) { selectSelect.prepare("SELECT selectUninvoicedShipments(:warehous_id, :custtype_pattern) AS result;"); selectSelect.bindValue(":custtype_pattern", _customerType->pattern()); } selectSelect.bindValue(":warehous_id", ((_warehouse->isSelected()) ? _warehouse->id() : -1)); selectSelect.exec(); accept(); } qt-client-4.1.0/guiclient/selectShippedOrders.h000066400000000000000000000016421217451700100215240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SELECTSHIPPEDORDERS_H #define SELECTSHIPPEDORDERS_H #include "xdialog.h" #include "ui_selectShippedOrders.h" class selectShippedOrders : public XDialog, public Ui::selectShippedOrders { Q_OBJECT public: selectShippedOrders(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~selectShippedOrders(); public slots: virtual void sSelect(); protected slots: virtual void languageChange(); }; #endif // SELECTSHIPPEDORDERS_H qt-client-4.1.0/guiclient/selectShippedOrders.ui000066400000000000000000000112641217451700100217130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. selectShippedOrders 0 0 697 158 Select Shipped Orders for Billing false false Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 0 0 &Cancel &Select true true Qt::Vertical QSizePolicy::Expanding 20 20 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _customerType _warehouse _select _close _close clicked() selectShippedOrders reject() 20 20 20 20
    qt-client-4.1.0/guiclient/selectedPayments.cpp000066400000000000000000000107761217451700100214250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "selectedPayments.h" #include "mqlutil.h" #include #include #include #include #include "selectPayment.h" #include "storedProcErrorLookup.h" selectedPayments::selectedPayments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_clear, SIGNAL(clicked()), this, SLOT(sClear())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_selectedBankAccount, SIGNAL(toggled(bool)), this, SLOT(sFillList())); _apselect->addColumn(tr("Bank Accnt."), _itemColumn, Qt::AlignLeft , true, "f_bank" ); _apselect->addColumn(tr("Vendor"), -1, Qt::AlignLeft , true, "f_vendor"); _apselect->addColumn(tr("Doc. Type"), _orderColumn, Qt::AlignLeft , true, "doctype"); _apselect->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignRight , true, "apopen_docnumber"); _apselect->addColumn(tr("Inv. #"), _orderColumn, Qt::AlignRight , true, "apopen_invcnumber"); _apselect->addColumn(tr("P/O #"), _orderColumn, Qt::AlignRight , true, "apopen_ponumber"); _apselect->addColumn(tr("Selected"), _moneyColumn, Qt::AlignRight , true, "apselect_amount"); _apselect->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft,true, "currAbbr" ); _apselect->addColumn(tr("Running (%1)").arg(CurrDisplay::baseCurrAbbr()), _bigMoneyColumn, Qt::AlignRight, true, "apselect_running_base" ); if (omfgThis->singleCurrency()) { _apselect->hideColumn("currAbbr"); _apselect->headerItem()->setText(8, tr("Running")); } connect(omfgThis, SIGNAL(paymentsUpdated(int, int, bool)), this, SLOT(sFillList(int))); connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sFillList())); sFillList(); } selectedPayments::~selectedPayments() { // no need to delete child widgets, Qt does it all for us } void selectedPayments::languageChange() { retranslateUi(this); } bool selectedPayments::setParams(ParameterList & params) { _vendorgroup->appendValue(params); if (_selectedBankAccount->isChecked()) params.append("bankaccntid", _bankaccnt->id()); params.append("voucher",tr("Voucher")); params.append("debitmemo",tr("Debit Memo")); return true; } void selectedPayments::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("SelectedPaymentsList", params); if (report.isValid()) report.print(); else report.reportError(this); } void selectedPayments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("apopen_id", _apselect->id()); selectPayment newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void selectedPayments::sClear() { XSqlQuery selectedClear; selectedClear.prepare("SELECT clearPayment(:apselect_id) AS result;"); selectedClear.bindValue(":apselect_id", _apselect->altId()); selectedClear.exec(); if (selectedClear.first()) { int result = selectedClear.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("clearPayment", result), __FILE__, __LINE__); return; } } else if (selectedClear.lastError().type() != QSqlError::NoError) { systemError(this, selectedClear.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPaymentsUpdated(_bankaccnt->id(), _apselect->altId(), TRUE); } void selectedPayments::sFillList(int pBankaccntid) { XSqlQuery selectedFillList; if ( (pBankaccntid == -1) || (pBankaccntid == _bankaccnt->id()) ) sFillList(); } void selectedPayments::sFillList() { XSqlQuery selectedFillList; ParameterList params; if (! setParams(params)) return; MetaSQLQuery mql = mqlLoad("apOpenItems", "selectedpayments"); selectedFillList = mql.toQuery(params); _apselect->populate(selectedFillList,true); if (selectedFillList.lastError().type() != QSqlError::NoError) { systemError(this, selectedFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/selectedPayments.h000066400000000000000000000020661217451700100210630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SELECTEDPAYMENTS_H #define SELECTEDPAYMENTS_H #include "xwidget.h" #include #include "ui_selectedPayments.h" class selectedPayments : public XWidget, public Ui::selectedPayments { Q_OBJECT public: selectedPayments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~selectedPayments(); virtual bool setParams(ParameterList&); public slots: virtual void sEdit(); virtual void sClear(); virtual void sFillList(int); virtual void sFillList(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // SELECTEDPAYMENTS_H qt-client-4.1.0/guiclient/selectedPayments.ui000066400000000000000000000265561217451700100212630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. selectedPayments 0 0 845 600 List Selected Payments 12 12 Qt::Vertical QSizePolicy::Expanding 0 0 0 Bank Account: All Bank Accounts true false 0 0 XComboBox::APBankAccounts Qt::Vertical QSizePolicy::Preferred 10 0 Qt::Horizontal QSizePolicy::Expanding 13 56 0 &Close &Print false false Qt::Vertical QSizePolicy::Expanding 74 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Payment Selections: 7 0 0 0 0 false &Edit false Clear Selection false false Qt::Vertical 20 248 VendorGroup QWidget
    vendorgroup.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _selectedBankAccount _apselect _edit _clear _print _close _close clicked() selectedPayments close() 20 20 20 20 _apselect valid(bool) _edit setEnabled(bool) 20 20 20 20 _apselect valid(bool) _clear setEnabled(bool) 20 20 20 20 _apselect itemSelected(int) _edit animateClick() 20 20 20 20 _selectedBankAccount toggled(bool) _bankaccnt setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/setup.cpp000066400000000000000000000533711217451700100172520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include "getscreen.h" #include "scripttoolbox.h" #include "setup.h" #include "xt.h" #include "xabstractconfigure.h" #include "xtreewidget.h" #include "xwidget.h" void setupSetupApi(QScriptEngine *engine) { QScriptValue obj = engine->newObject(); obj.setProperty("Configure", QScriptValue(engine, setup::Configure), QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("AccountMapping", QScriptValue(engine, setup::AccountMapping), QScriptValue::ReadOnly | QScriptValue::Undeletable); obj.setProperty("MasterInformation", QScriptValue(engine, setup::MasterInformation), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("setup", obj, QScriptValue::ReadOnly | QScriptValue::Undeletable); } setup::setup(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _modules->addItem(tr("All"), Xt::AllModules); _modules->addItem(tr("Accounting"), Xt::AccountingModule); _modules->addItem(tr("Sales"), Xt::SalesModule); _modules->addItem(tr("CRM"), Xt::CRMModule); _modules->addItem(tr("Manufacture"), Xt::ManufactureModule); _modules->addItem(tr("Purchase"), Xt::PurchaseModule); if (_metrics->value("Application") != "PostBooks") _modules->addItem(tr("Schedule"), Xt::ScheduleModule); _modules->addItem(tr("Inventory"), Xt::InventoryModule); _modules->addItem(tr("Products"), Xt::ProductsModule); _modules->addItem(tr("System"), Xt::SystemModule); QPushButton* apply = _buttonBox->button(QDialogButtonBox::Apply); connect(apply, SIGNAL(clicked()), this, SLOT(apply())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(save())); connect(_modules, SIGNAL(currentIndexChanged(int)), this, SLOT(populate())); connect(_tree, SIGNAL(currentItemChanged(XTreeWidgetItem*,XTreeWidgetItem*)), this, SLOT(setCurrentIndex(XTreeWidgetItem*))); _tree->addColumn(QString(), -1, Qt::AlignLeft, true); _tree->setHeaderHidden(true); // Configure insert(tr("Accounting"), "configureGL", Configure, Xt::AccountingModule, mode("ConfigureGL"), 0); insert(tr("Credit Card"), "configureCC", Configure, Xt::SystemModule, mode("ConfigureCC"), 0); insert(tr("CRM"), "configureCRM", Configure, Xt::CRMModule, mode("ConfigureCRM"), 0 ); insert(tr("Database"), "AdatabaseInformation", Configure, Xt::SystemModule, mode("ConfigDatabaseInfo"), 0); insert(tr("Encryption"), "configureEncryption", Configure, Xt::SystemModule, mode("ConfigureEncryption"), 0); insert(tr("Inventory"), "configureIM", Configure, Xt::InventoryModule, mode("ConfigureIM"), 0 ); insert(tr("Import/Export"), "configureIE", Configure, Xt::SystemModule, mode("ConfigureImportExport"), 0); insert(tr("Sales"), "configureSO", Configure, Xt::SalesModule, mode("ConfigureSO"), 0 ); insert(tr("Manufacture"), "configureWO", Configure, Xt::ManufactureModule, mode("ConfigureWO"), 0); insert(tr("Products"), "configurePD", Configure, Xt::ProductsModule, mode("ConfigurePD"), 0 ); insert(tr("Purchase"), "configurePO", Configure, Xt::PurchaseModule, mode("ConfigurePO"), 0 ); insert(tr("Registration"), "registrationKey", Configure, Xt::SystemModule, mode("MaintainRegistrationKey"), 0 ); insert(tr("Schedule"), "configureMS", Configure, Xt::ScheduleModule, mode("ConfigureMS"), 0 ); insert(tr("Search Path"), "configureSearchPath", Configure, Xt::SystemModule, _privileges->isDba() ? cEdit : 0, 0); // Account Mappings int modeVal; modeVal = mode("MaintainCostCategories", "ViewCostCategories"); insert(tr("Cost Categories"), "costCategories", AccountMapping, Xt::AccountingModule | Xt::InventoryModule, modeVal, modeVal); modeVal = mode("MaintainExpenseCategories", "ViewExpenseCategories"); insert(tr("Expense Categories"), "expenseCategories", AccountMapping, Xt::AccountingModule |Xt::InventoryModule | Xt::PurchaseModule, modeVal, modeVal); modeVal = mode("MaintainVendorAccounts", "ViewVendorAccounts"); insert(tr("Payables Assignments"), "apAccountAssignments", AccountMapping, Xt::AccountingModule | Xt::PurchaseModule, modeVal, modeVal); modeVal = mode("MaintainSalesAccount", "ViewSalesAccount"); insert(tr("Receivables Assignments"), "arAccountAssignments", AccountMapping, Xt::AccountingModule | Xt::SalesModule, modeVal, modeVal); insert(tr("Sales Assignments"), "salesAccounts", AccountMapping, Xt::AccountingModule | Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainSalesCategories", "ViewSalesCategories"); insert(tr("Sales Categories"), "salesCategories", AccountMapping, Xt::AccountingModule | Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainBankAccounts"); insert(tr("Bank Accounts"), "bankAccounts", AccountMapping, Xt::AccountingModule, modeVal, modeVal); modeVal = mode("MaintainAdjustmentTypes", "ViewAdjustmentTypes"); insert(tr("Bank Adjustment Types"), "bankAdjustmentTypes", AccountMapping, Xt::AccountingModule, modeVal, modeVal); // Master Information modeVal = mode("MaintainCalendars"); insert(tr("Calendars"), "calendars", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainCharacteristics", "ViewCharacteristics"); insert(tr("Characteristics"), "characteristics", MasterInformation, Xt::ProductsModule | Xt::InventoryModule | Xt::CRMModule | Xt::SalesModule | Xt::AccountingModule, modeVal, modeVal); modeVal = mode("MaintainCheckFormats", "ViewCheckFormats"); insert(tr("Check Formats"), "checkFormats", MasterInformation, Xt::AccountingModule, modeVal, modeVal); modeVal = mode("MaintainClassCodes", "ViewClassCodes"); insert( tr("Class Codes"), "classCodes", MasterInformation, Xt::ProductsModule, modeVal, modeVal); modeVal = mode("MaintainCommentTypes"); insert(tr("Comment Types"), "commentTypes", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainCountries"); insert(tr("Countries"), "countries", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("CreateNewCurrency"); insert(tr("Currencies"), "currencies", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainCustomerMasters"); insert(tr("Customer Form Assignments"), "customerFormAssignments", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainCustomerTypes", "ViewCustomerTypes"); insert(tr("Customer Types"), "customerTypes", MasterInformation, Xt::SalesModule | Xt::AccountingModule, modeVal, modeVal); modeVal = mode("MaintainDepartments", "ViewDepartments"); insert(tr("Departments"), "departments", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainCurrencyRates", "ViewCurrencyRates"); insert(tr("Exchange Rates"), "currencyConversions", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainForms"); insert( tr("Forms"), "forms", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainFreightClasses", "ViewFreightClasses"); insert(tr("Freight Classes"), "freightClasses", MasterInformation, Xt::ProductsModule, modeVal, modeVal); modeVal = mode("MaintainImages"); insert(tr("Images"), "images", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainIncidentCategories"); insert(tr("Incident Categories"), "incidentCategories", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainIncidentPriorities"); insert(tr("Incident Priorities"), "incidentPriorities", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainIncidentResolutions"); insert(tr("Incident Resolutions"), "incidentResolutions", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainIncidentSeverities"); insert(tr("Incident Severities"), "incidentSeverities", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainForms"); insert( tr("Label Forms"), "labelForms", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainLocales"); insert(tr("Locales"), "locales", MasterInformation, Xt::SystemModule, modeVal, modeVal); if ( _metrics->boolean("LotSerialControl")) { modeVal = mode("MaintainLotSerialSequences", "ViewLotSerialSequences"); insert(tr("Lot/Serial Sequences"), "lotSerialSequences", MasterInformation, Xt::ProductsModule, modeVal, modeVal); } modeVal = mode("MaintainOpportunitySources"); insert( tr("Opportunity Sources"), "opportunitySources", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainOpportunityStages"); insert(tr("Opportunity Stages"), "opportunityStages", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainOpportunityTypes"); insert(tr("Opportunity Types"), "opportunityTypes", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainPlannerCodes", "ViewPlannerCodes"); insert(tr("Planner Codes"), "plannerCodes", MasterInformation, Xt::InventoryModule | Xt::ScheduleModule | Xt::PurchaseModule, modeVal, modeVal); modeVal = mode("MaintainProductCategories", "ViewProductCategories"); insert(tr("Product Categories"), "productCategories", MasterInformation, Xt::ProductsModule, modeVal, modeVal); modeVal = mode("MaintainReasonCodes"); insert(tr("Reason Codes"), "reasonCodes", MasterInformation, Xt::InventoryModule | Xt::AccountingModule, modeVal, modeVal); modeVal = mode("MaintainRejectCodes", "ViewRejectCodes"); insert(tr("Reject Codes"), "rejectCodes", MasterInformation, Xt::PurchaseModule, modeVal, modeVal); modeVal = mode("MaintainSalesReps", "ViewSalesReps"); insert(tr("Sales Reps"), "salesReps", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainSaleTypes", "ViewSaleTypes"); insert( tr("Sale Types"), "saleTypes", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainStates"); insert(tr("States and Provinces"), "states", MasterInformation, Xt::SystemModule, modeVal, modeVal); modeVal = mode("MaintainShippingChargeTypes", "ViewShippingChargeTypes"); insert(tr("Shipping Charge Types"), "shippingChargeTypes", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainShippingForms", "ViewShippingForms"); insert( tr("Shipping Forms"), "shippingForms", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainShippingZones", "ViewShippingZones"); insert(tr("Shipping Zones"), "shippingZones", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainShipVias", "ViewShipVias"); insert(tr("Ship Vias"), "shipVias", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainSiteTypes", "ViewSiteTypes"); insert(tr("Site Types"), "siteTypes", MasterInformation, Xt::InventoryModule, modeVal, modeVal); modeVal = mode("MaintainTaxCodes", "ViewTaxCodes"); insert(tr("Tax Codes"), "taxCodes", MasterInformation, Xt::SalesModule, modeVal, modeVal); modeVal = mode("MaintainTerms", "ViewTerms"); insert(tr("Terms"), "termses", MasterInformation, Xt::PurchaseModule | Xt::SalesModule | Xt::AccountingModule, modeVal, modeVal); modeVal = mode("MaintainTitles", "ViewTitles"); insert(tr("Titles"), "honorifics", MasterInformation, Xt::CRMModule, modeVal, modeVal); modeVal = mode("MaintainUOMs", "ViewUOMs"); insert(tr("Units of Measure"), "uoms", MasterInformation, Xt::ProductsModule, modeVal, modeVal); modeVal = mode("MaintainVendorTypes", "ViewVendorTypes"); insert(tr("Vendor Types"), "vendorTypes", MasterInformation, Xt::PurchaseModule | Xt::AccountingModule, modeVal, modeVal); } setup::~setup() { } enum SetResponse setup::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("module", &valid); if (valid) { for (int i = 0; i < _modules->count(); i++) { if (_modules->itemData(i) == param.toInt()) _modules->setCurrentIndex(i); } } else populate(); param = pParams.value("uiName", &valid); if (valid) setCurrentIndex(param.toString()); return NoError; } /*! Insert setup item for \a title using the widget with object name \a uiName to the list of setup items. The item on the list will be indented under \a type and enabled according to the \a enabled value. The value of \a mode will determine whether parameters are passed to set the widget to "edit" or "view" mode. A save function on the widget triggered by the Apply and Save buttons can optionally be specified by \a saveMethod. */ void setup::insert(const QString &title, const QString &uiName, int type, int modules, bool enabled, int mode, const QString &saveMethod) { ItemProps ip; ip.title = title; ip.uiName = uiName; ip.type = type; ip.modules = modules; ip.enabled = enabled; ip.mode = mode; ip.saveMethod = saveMethod; ip.index = -1; ip.id = -1; ip.implementation = 0; _itemMap.insert(uiName, ip); } /*! Saves the current settings and repopulates the window. \sa save(bool); \sa populate(bool); */ void setup::apply() { int id = _tree->id(); save(false); populate(id == -1); if (id > -1) { _tree->setId(id); setCurrentIndex(_tree->currentItem()); } } void setup::languageChange() { retranslateUi(this); } /*! Returns the mode value based on the privileges granted by checking \a editPriv and \a viewPriv. If the user has edit privileges cEdit (2) will be returned, if only view privileges then cView (3) will be returned, otherwise 0; */ int setup::mode(const QString &editPriv, const QString &viewPriv) { if (_privileges->check(editPriv)) return cEdit; else if (_privileges->check(viewPriv)) return cView; return 0; } /*! Populates the list of setup widgets filtered by selectd module. Selects the first item when \a first is true. */ void setup::populate(bool first) { _tree->clear(); while (_stack->count()) { QWidget* w = _stack->widget(0); _stack->removeWidget(w); w = 0; } XTreeWidgetItem* _configItem = new XTreeWidgetItem(_tree, 0, -1, tr("Configure")); XTreeWidgetItem* _mapItem = new XTreeWidgetItem(_tree, 0, -1, tr("Accounting Mappings")); XTreeWidgetItem* _masterItem = new XTreeWidgetItem(_tree, 0, -1, tr("Master Information")); QBrush disabled(Qt::gray); XTreeWidgetItem* parent = 0; ItemProps ip; int id = 0; QMapIterator i(_itemMap); while (i.hasNext()) { id++; i.next(); ip = i.value(); _itemMap[i.key()].index = -1; _itemMap[i.key()].id = -1; if (_modules->currentIndex() == 0 || _modules->itemData(_modules->currentIndex()).toInt() & ip.modules) { if (ip.type == Configure) parent = _configItem; else if (ip.type == AccountMapping) parent = _mapItem; else parent = _masterItem; // Set the item on the list XTreeWidgetItem* item = new XTreeWidgetItem(parent, id); item->setData(0, Qt::DisplayRole, QVariant(ip.title)); item->setData(0, Xt::RawRole, QVariant(i.key())); if (!ip.enabled) { item->setFlags(Qt::NoItemFlags); item->setForeground(0,disabled); } parent->addChild(item); _itemMap[i.key()].id = id; } } if (!_configItem->childCount()) _tree->takeTopLevelItem(_tree->indexOfTopLevelItem(_configItem)); if (!_mapItem->childCount()) _tree->takeTopLevelItem(_tree->indexOfTopLevelItem(_mapItem)); if (!_masterItem->childCount()) _tree->takeTopLevelItem(_tree->indexOfTopLevelItem(_masterItem)); _tree->expandAll(); if (_tree->topLevelItemCount() && first) setCurrentIndex(_tree->topLevelItem(0)); } /*! Emits the \a saving() signal which triggers any widgets to save that have a mapped \a savedMethod() specified by \sa insert(). Also reloads metrics, privileges, preferences, and the menubar in the main application. The screen will close if \a close is true. \sa apply() */ void setup::save(bool close) { emit saving(); QMapIterator i(_itemMap); while (i.hasNext()) { bool ok = false; i.next(); XAbstractConfigure *cw = qobject_cast(i.value().implementation); QScriptEngine *engine = qobject_cast(i.value().implementation); QString method = QString(i.value().saveMethod).remove("(").remove(")"); if (! i.value().implementation) continue; else if (cw) ok = cw->sSave(); else if (engine && engine->globalObject().property(method).isFunction()) { QScriptValue saveresult = engine->globalObject().property(method).call(); if (saveresult.isBool()) ok = saveresult.toBool(); else qWarning("Problem executing %s method for script %s", qPrintable(i.value().saveMethod), qPrintable(i.key())); } else { qWarning("Could not call save method for %s; it's a(n) %s (%p)", qPrintable(i.key()), qobject_cast(i.value().implementation) ? qobject_cast(i.value().implementation)->metaObject()->className() : "unknown class", i.value().implementation); ok = true; } if (! ok) { setCurrentIndex(i.key()); return; } } _metrics->load(); _privileges->load(); _preferences->load(); omfgThis->initMenuBar(); if (close) accept(); } void setup::setCurrentIndex(const QString &uiName) { if (_itemMap.contains(uiName) && _itemMap.value(uiName).id >= 0) { _tree->setId(_itemMap.value(uiName).id); setCurrentIndex(_tree->currentItem()); } } void setup::setCurrentIndex(XTreeWidgetItem* item) { QString uiName = item->data(0, Xt::RawRole).toString(); QString label = "%1

    "; if (_itemMap.contains(uiName) && _itemMap.value(uiName).index >= 0) { _stack->setCurrentIndex(_itemMap.value(uiName).index); _stackLit->setText(label.arg(item->text(0))); return; } else if (_itemMap.contains(uiName) && !item->isDisabled()) { // First look for a class... QWidget *w = xtGetScreen(uiName, this); if (w) _itemMap[uiName].implementation = w; else { // No class, so look for an extension XSqlQuery screenq; screenq.prepare("SELECT * " " FROM uiform " " WHERE((uiform_name=:uiform_name)" " AND (uiform_enabled))" " ORDER BY uiform_order DESC" " LIMIT 1;"); screenq.bindValue(":uiform_name", uiName); screenq.exec(); if (screenq.first()) { QUiLoader loader; QByteArray ba = screenq.value("uiform_source").toByteArray(); QBuffer uiFile(&ba); if (!uiFile.open(QIODevice::ReadOnly)) QMessageBox::critical(0, tr("Could not load UI"), tr("

    There was an error loading the UI Form " "from the database.")); w = loader.load(&uiFile); w->setObjectName(uiName); uiFile.close(); // Load scripts if applicable XSqlQuery scriptq; scriptq.prepare("SELECT script_source, script_order" " FROM script" " WHERE((script_name=:script_name)" " AND (script_enabled))" " ORDER BY script_order;"); scriptq.bindValue(":script_name", uiName); scriptq.exec(); QScriptEngine* engine = new QScriptEngine(); if (_preferences->boolean("EnableScriptDebug")) { QScriptEngineDebugger* debugger = new QScriptEngineDebugger(this); debugger->attachTo(engine); } omfgThis->loadScriptGlobals(engine); QScriptValue mywindow = engine->newQObject(w); engine->globalObject().setProperty("mywindow", mywindow); while(scriptq.next()) { QString script = scriptHandleIncludes(scriptq.value("script_source").toString()); QScriptValue result = engine->evaluate(script, uiName); if (engine->hasUncaughtException()) { int line = engine->uncaughtExceptionLineNumber(); qDebug() << "uncaught exception at line" << line << ":" << result.toString(); } } _itemMap[uiName].implementation = engine; } } if (w) { // Hide buttons out of context here QWidget* close = w->findChild("_close"); if (close) close->hide(); QWidget* buttons = w->findChild(); if (buttons) buttons->hide(); //Set mode if applicable int mode = _itemMap.value(uiName).mode; if (mode && w->inherits("XDialog")) { XWidget* x = dynamic_cast(w); ParameterList params; if (mode == cEdit) params.append("mode", "edit"); else if (mode == cView) params.append("mode", "view"); if (x) x->set(params); } int idx = _stack->count(); _itemMap[uiName].index = idx; _stack->addWidget(w); _stack->setCurrentIndex(idx); _stackLit->setText(label.arg(item->text(0))); return; } } // Nothing here so try the next one XTreeWidgetItem* next = dynamic_cast(_tree->itemBelow(item)); if (next) setCurrentIndex(next); } qt-client-4.1.0/guiclient/setup.h000066400000000000000000000040671217451700100167150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SETUP_H #define SETUP_H #include "guiclient.h" #include "xdialog.h" #include "xt.h" #include #include "ui_setup.h" void setupSetupApi(QScriptEngine* engine); class setup : public XDialog, public Ui::setup { Q_OBJECT public: setup(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~setup(); enum SetupTypes { Configure, AccountMapping, MasterInformation }; public slots: enum SetResponse set(const ParameterList & pParams ); void insert(const QString &title, const QString &uiName, int type, int modules, bool enabled = true, int mode = 0, const QString &saveMethod = QString()); void apply(); void languageChange(); int mode(const QString &editPriv, const QString &viewPriv = QString()); void populate(bool first = true); void save(bool close = true); void setCurrentIndex(const QString &uiName); signals: void saving(); private slots: void setCurrentIndex(XTreeWidgetItem* item); private: struct ItemProps { QString title; QString uiName; int type; int modules; bool enabled; int mode; QString saveMethod; int index; // in the stack widget int id; // for the tree widget QObject *implementation; }; QMap _itemMap; XTreeWidgetItem* _configItem; XTreeWidgetItem* _mapItem; XTreeWidgetItem* _masterItem; }; Q_DECLARE_METATYPE(enum setup::SetupTypes); #endif // SETUP_H qt-client-4.1.0/guiclient/setup.ui000066400000000000000000000072351217451700100171030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. setup 0 0 600 400 Setup Module: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 0 0 false TextLabel 1 0 Qt::Horizontal QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Save XTreeWidget QTreeWidget

    xtreewidget.h
    1 _buttonBox rejected() setup reject() 316 260 286 274 qt-client-4.1.0/guiclient/shared_global_p.h000066400000000000000000000050001217451700100206460ustar00rootroot00000000000000/**************************************************************************** ** ** Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). ** Contact: Qt Software Information (qt-info@nokia.com) ** ** This file is part of the Qt Designer of the Qt Toolkit. ** ** Commercial Usage ** Licensees holding valid Qt Commercial licenses may use this file in ** accordance with the Qt Commercial License Agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Nokia. ** ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License versions 2.0 or 3.0 as published by the Free ** Software Foundation and appearing in the file LICENSE.GPL included in ** the packaging of this file. Please review the following information ** to ensure GNU General Public Licensing requirements will be met: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html and ** http://www.gnu.org/copyleft/gpl.html. In addition, as a special ** exception, Nokia gives you certain additional rights. These rights ** are described in the Nokia Qt GPL Exception version 1.3, included in ** the file GPL_EXCEPTION.txt in this package. ** ** Qt for Windows(R) Licensees ** As a special exception, Nokia, as the sole copyright holder for Qt ** Designer, grants users of the Qt/Eclipse Integration plug-in the ** right for the Qt/Eclipse Integration to link to functionality ** provided by Qt Designer and its related libraries. ** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** ****************************************************************************/ // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists for the convenience // of Qt Designer. This header // file may change from version to version without notice, or even be removed. // // We mean it. // #ifndef SHARED_GLOBAL_H #define SHARED_GLOBAL_H #include #ifdef QT_DESIGNER_STATIC #define QDESIGNER_SHARED_EXTERN #define QDESIGNER_SHARED_IMPORT #else #define QDESIGNER_SHARED_EXTERN Q_DECL_EXPORT #define QDESIGNER_SHARED_IMPORT Q_DECL_IMPORT #endif #ifndef QT_NO_SHARED_EXPORT # ifdef QDESIGNER_SHARED_LIBRARY # define QDESIGNER_SHARED_EXPORT QDESIGNER_SHARED_EXTERN # else # define QDESIGNER_SHARED_EXPORT QDESIGNER_SHARED_IMPORT # endif #else # define QDESIGNER_SHARED_EXPORT #endif #endif // SHARED_GLOBAL_H qt-client-4.1.0/guiclient/shipOrder.cpp000066400000000000000000000732351217451700100200520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shipOrder.h" #include #include #include #include #include "enterPoReceipt.h" #include "itemSite.h" #include "mqlutil.h" #include "printInvoice.h" #include "printPackingList.h" #include "storedProcErrorLookup.h" shipOrder::shipOrder(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_create, SIGNAL(toggled(bool)), this, SLOT(sCreateToggled(bool))); connect(_select, SIGNAL(toggled(bool)), this, SLOT(sSelectToggled(bool))); connect(_ship, SIGNAL(clicked()), this, SLOT(sShip())); connect(_shipment, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_shipment, SIGNAL(newId(int)), this, SLOT(sFillTracknum())); connect(_order, SIGNAL(newId(int,QString)), this, SLOT(sHandleOrder())); connect(_tracknum, SIGNAL(activated(const QString&)), this, SLOT(sFillFreight())); connect(_tracknum, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(sFillFreight())); connect(_tracknum, SIGNAL(highlighted(const QString&)), this, SLOT(sFillFreight())); _captive = FALSE; _coitem->addColumn( tr("#"), _whsColumn, Qt::AlignCenter , true, "linenumber"); _coitem->addColumn( tr("Item Number"), _itemColumn, Qt::AlignLeft , true, "item_number"); _coitem->addColumn( tr("Description"), -1, Qt::AlignLeft , true, "itemdescrip"); _coitem->addColumn( tr("UOM"), _uomColumn, Qt::AlignCenter , true, "uom_name"); _coitem->addColumn( tr("Qty."), _qtyColumn, Qt::AlignRight , true, "shipitem_qty"); sCreateToggled(_create->isChecked()); sHandleButtons(); _reject = false; _order->setAllowedStatuses(OrderLineEdit::Open); _order->setAllowedTypes(OrderLineEdit::Sales | OrderLineEdit::Transfer); _order->setFromSitePrivsEnforced(TRUE); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate(), true); _shipValue->setPrecision(omfgThis->moneyVal()); _shipValue->setDouble(0); } shipOrder::~shipOrder() { // no need to delete child widgets, Qt does it all for us } void shipOrder::languageChange() { retranslateUi(this); } enum SetResponse shipOrder::set(const ParameterList &pParams) { XSqlQuery shipet; XDialog::set(pParams); QString returnValue; QVariant param; bool valid; param = pParams.value("shiphead_id", &valid); if (valid) { shipet.prepare( "SELECT shiphead_order_id, shiphead_order_type " "FROM shiphead " "WHERE (shiphead_id=:shiphead_id);" ); shipet.bindValue(":shiphead_id", param.toInt()); shipet.exec(); if (shipet.first()) { _captive = true; // so order handling can reject if necessary if (shipet.value("shiphead_order_type").toString() == "SO") { _order->setId(param.toInt(), "SO"); } else if (shipet.value("shiphead_order_type").toString() == "TO") { _order->setId(param.toInt(), "TO"); } } else if (shipet.lastError().type() != QSqlError::NoError) { systemError(this, shipet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _shipment->setId(param.toInt()); // last because of signal cascade } if (_reject) return UndefinedError; return NoError; } void shipOrder::sShip() { XSqlQuery shipq; shipq.prepare( "UPDATE shiphead " " SET shiphead_shipvia=:shiphead_shipvia," " shiphead_freight=:shiphead_freight," " shiphead_freight_curr_id=:shiphead_freight_curr_id," " shiphead_tracknum=:shiphead_tracknum " " WHERE (shiphead_id=:shiphead_id);"); shipq.bindValue(":shiphead_shipvia", _shipVia->currentText()); shipq.bindValue(":shiphead_freight", _freight->localValue()); shipq.bindValue(":shiphead_freight_curr_id", _freight->id()); shipq.bindValue(":shiphead_tracknum", _tracknum->currentText()); shipq.bindValue(":shiphead_id", _shipment->id()); shipq.exec(); if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); // failed insertGLTransaction RETURNs -5 rather than RAISE EXCEPTION shipq.exec("BEGIN;"); shipq.prepare( "SELECT shipShipment(:shiphead_id, :ts) AS result;"); shipq.bindValue(":shiphead_id", _shipment->id()); shipq.bindValue(":ts", _transDate->date()); shipq.exec(); if (shipq.first()) { int result = shipq.value("result").toInt(); if (result == -6) { rollback.exec(); shipq.prepare("SELECT itemsite_id, tohead_trns_warehous_id," " tohead_dest_warehous_id " "FROM shiphead, shipitem, tohead, toitem, itemsite " "WHERE ((itemsite_item_id=toitem_item_id)" " AND (itemsite_warehous_id=tohead_src_warehous_id)" " AND (toitem_tohead_id=tohead_id)" " AND (shipitem_orderitem_id=toitem_id)" " AND (shiphead_id=shipitem_shiphead_id)" " AND (shiphead_order_type='TO')" " AND (NOT shiphead_shipped)" " AND (shiphead_id=:shiphead_id));"); shipq.bindValue(":shiphead_id", _shipment->id()); shipq.exec(); while (shipq.next()) { // missing transit itemsite is fatal here but not missing dest int transis = itemSite::createItemSite(this, shipq.value("itemsite_id").toInt(), shipq.value("tohead_trns_warehous_id").toInt(), false); int destis = itemSite::createItemSite(this, shipq.value("itemsite_id").toInt(), shipq.value("tohead_dest_warehous_id").toInt(), true); if (transis <= 0 || destis < 0) return; } if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } sShip(); // beware of endless loop if you change createItemSite err check return; // return because the recursive call cleans up for us } else if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("shipShipment", result), __FILE__, __LINE__); return; } } else if (shipq.lastError().type() != QSqlError::NoError) { rollback.exec(); QString errorStr = shipq.lastError().databaseText(); if(errorStr.startsWith("ERROR: null value in column \"gltrans_accnt_id\" violates not-null constraint")) errorStr = tr("One or more required accounts are not set or set incorrectly." " Please make sure that all your Cost Category and Sales Account Assignments" " are complete and correct."); systemError(this, errorStr, __FILE__, __LINE__); return; } shipq.exec("COMMIT;"); if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } // END the transaction if (_print->isChecked()) { ParameterList params; params.append("shiphead_id", _shipment->id()); params.append("print"); printPackingList newdlg(this, "", TRUE); newdlg.set(params); } if (_order->isSO() && _select->isChecked()) { shipq.prepare("SELECT selectUninvoicedShipment(:shiphead_id) AS result;"); shipq.bindValue(":shiphead_id", _shipment->id()); shipq.exec(); if (shipq.first()) { int cobmiscid = shipq.value("result").toInt(); if (cobmiscid < 0) { systemError(this, storedProcErrorLookup("selectUninvoicedShipment", cobmiscid), __FILE__, __LINE__); return; } else if (0 == cobmiscid) { QMessageBox::information(this, tr("Already Invoiced"), tr("

    This shipment appears to have been " "invoiced already. It will not be selected " "for billing again.")); } else if (_create->isChecked()) { shipq.prepare("SELECT createInvoice(:cobmisc_id) AS result;"); shipq.bindValue(":cobmisc_id", cobmiscid); shipq.exec(); if (shipq.first()) { int result = shipq.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postBillingSelection", result), __FILE__, __LINE__); return; } ParameterList params; params.append("invchead_id", result); printInvoice newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); omfgThis->sInvoicesUpdated(result, TRUE); omfgThis->sSalesOrdersUpdated(_order->id()); } else if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText() + tr("

    Although Sales Order %1 was successfully shipped " "and selected for billing, the Invoice was not " "created properly. You may need to create an Invoice " "manually from the Billing Selection.") .arg(_order->id()), __FILE__, __LINE__); return; } omfgThis->sBillingSelectionUpdated(_order->id(), TRUE); } } else if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText() + tr("

    Although Sales Order %1 was successfully shipped, " "it was not selected for billing. You must manually " "select this Sales Order for Billing.") .arg(_order->id()), __FILE__, __LINE__); return; } } if (_order->isTO() && _receive->isChecked()) { QString recverr = tr("

    Receiving inventory for this Transfer Order " "failed although Shipping the Order succeeded. " "Manually receive this order using the Enter Order " "Receipt window."); shipq.exec("BEGIN;"); ParameterList params; if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); params.append("tohead_id", _order->id()); params.append("orderid", _order->id()); params.append("ordertype", "TO"); params.append("shiphead_id", _shipment->id()); MetaSQLQuery recvm = mqlLoad("receipt", "receiveAll"); shipq = recvm.toQuery(params); while (shipq.next()) { int result = shipq.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, recverr + storedProcErrorLookup("enterReceipt", result), __FILE__, __LINE__); } omfgThis->sPurchaseOrderReceiptsUpdated(); } if (shipq.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, recverr + "
    " + shipq.lastError().databaseText(), __FILE__, __LINE__); } shipq.exec("COMMIT;"); if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, recverr + "
    " + shipq.lastError().databaseText(), __FILE__, __LINE__); } ParameterList recvParams; recvParams.append("tohead_id", _order->id()); enterPoReceipt *newdlg = new enterPoReceipt(); newdlg->set(recvParams); // to address bug 5680, replace // omfgThis->handleNewWindow(newdlg, Qt::ApplicationModal); // with newdlg->sPost(); // end of replacement } if (_captive) accept(); else { _order->setId(-1); _order->setEnabled(true); sHandleButtons(); _billToName->clear(); _shipToName->clear(); _shipToAddr1->clear(); _freight->setEnabled(TRUE); _freight->reset(); _shipVia->clear(); _shipment->clear(); _shipment->setEnabled(false); _close->setText(tr("&Close")); _order->setFocus(); } // Update the shipdatasum record to reflect shipped shipq.prepare("UPDATE shipdatasum " " SET shipdatasum_shipped=true " " WHERE ((shipdatasum_cosmisc_tracknum = :tracknum)" " AND ( (shipdatasum_shiphead_number=:shiphead_number)" " OR (:shiphead_number IS NULL)));"); shipq.bindValue(":tracknum", _tracknum->currentText()); if (! _shipment->number().isEmpty()) shipq.bindValue(":shiphead_number", _shipment->number()); shipq.exec(); if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } } void shipOrder::sHandleOrder() { if (_order->id() < 0) { _shipment->clear(); _billToName->setText(""); _shipToName->setText(""); _shipToAddr1->setText(""); _shipValue->setDouble(0); _coitem->clear(); _order->setFocus(); return; } else if (_order->isSO()) sHandleSo(); else if (_order->isTO()) sHandleTo(); } void shipOrder::sHandleSo() { XSqlQuery shipHandleSo; _coitem->clear(); _shipment->setEnabled(false); _shipment->removeOrderLimit(); sHandleButtons(); shipHandleSo.prepare( "SELECT cohead_holdtype, cust_name, cohead_shiptoname, " " cohead_shiptoaddress1, cohead_curr_id, cohead_freight " "FROM cohead, custinfo " "WHERE ((cohead_cust_id=cust_id) " " AND (cohead_id=:sohead_id));" ); shipHandleSo.bindValue(":sohead_id", _order->id()); shipHandleSo.exec(); if (shipHandleSo.first()) { QString msg; if ( (shipHandleSo.value("cohead_holdtype").toString() == "C")) msg = storedProcErrorLookup("shipShipment", -12); else if (shipHandleSo.value("cohead_holdtype").toString() == "P") msg = storedProcErrorLookup("shipShipment", -13); else if (shipHandleSo.value("cohead_holdtype").toString() == "R") msg = storedProcErrorLookup("shipShipment", -14); else if (shipHandleSo.value("cohead_holdtype").toString() == "S") msg = storedProcErrorLookup("shipShipment", -15); if (! msg.isEmpty()) { QMessageBox::warning(this, tr("Cannot Ship Order"), msg); if (_captive) { _reject = true; // so set() can return an error reject(); // this only works if shipOrder has been exec()'ed } else { _order->setId(-1); return; } } _freight->setId(shipHandleSo.value("cohead_curr_id").toInt()); _freight->setLocalValue(shipHandleSo.value("cohead_freight").toDouble()); _billToName->setText(shipHandleSo.value("cust_name").toString()); _shipToName->setText(shipHandleSo.value("cohead_shiptoname").toString()); _shipToAddr1->setText(shipHandleSo.value("cohead_shiptoaddress1").toString()); QString sql( "SELECT shiphead_id " "FROM shiphead " "WHERE ( (NOT shiphead_shipped)" "" " AND (shiphead_id=)" "" " AND (shiphead_order_id=)" " AND (shiphead_order_type='SO'));" ); ParameterList params; params.append("sohead_id", _order->id()); if (_shipment->isValid()) params.append("shiphead_id", _shipment->id()); MetaSQLQuery mql(sql); shipHandleSo = mql.toQuery(params); if (shipHandleSo.first()) { if (_shipment->id() != shipHandleSo.value("shiphead_id").toInt()) _shipment->setId(shipHandleSo.value("shiphead_id").toInt()); if (shipHandleSo.next()) { _shipment->setType("SO"); _shipment->limitToOrder(_order->id()); _shipment->setEnabled(true); } } else if (shipHandleSo.lastError().type() != QSqlError::NoError) { systemError(this, shipHandleSo.lastError().databaseText(), __FILE__, __LINE__); return; } else if (_shipment->isValid()) { params.clear(); params.append("sohead_id", _order->id()); MetaSQLQuery mql(sql); shipHandleSo = mql.toQuery(params); if (shipHandleSo.first()) { _shipment->setId(shipHandleSo.value("shiphead_id").toInt()); if (shipHandleSo.next()) { _shipment->setType("SO"); _shipment->limitToOrder(_order->id()); _shipment->setEnabled(true); } } else if (shipHandleSo.lastError().type() != QSqlError::NoError) { systemError(this, shipHandleSo.lastError().databaseText(), __FILE__, __LINE__); return; } else _shipment->clear(); } else { QMessageBox::warning(this, tr("Nothing to ship"), tr("

    You may not ship this Sales Order because " "no stock has been issued to shipping for it.")); _order->setFocus(); return; } } else if (shipHandleSo.lastError().type() != QSqlError::NoError) { systemError(this, shipHandleSo.lastError().databaseText(), __FILE__, __LINE__); return; } } void shipOrder::sHandleTo() { XSqlQuery shipHandleTo; _coitem->clear(); _shipment->setEnabled(false); _shipment->removeOrderLimit(); sHandleButtons(); shipHandleTo.prepare("SELECT tohead_freight_curr_id, tohead_destname," " tohead_destaddress1," " SUM(toitem_freight) + tohead_freight AS freight " "FROM tohead, toitem " "WHERE ((toitem_tohead_id=tohead_id)" " AND (toitem_status<>'X')" " AND (tohead_id=:tohead_id)) " "GROUP BY tohead_freight_curr_id, tohead_destname," " tohead_destaddress1, tohead_freight;"); shipHandleTo.bindValue(":tohead_id", _order->id()); shipHandleTo.exec(); if (shipHandleTo.first()) { _freight->setId(shipHandleTo.value("tohead_freight_curr_id").toInt()); _freight->setLocalValue(shipHandleTo.value("freight").toDouble()); _billToName->setText(tr("Transfer Order")); _shipToName->setText(shipHandleTo.value("tohead_destname").toString()); _shipToAddr1->setText(shipHandleTo.value("tohead_destaddress1").toString()); } else if (shipHandleTo.lastError().type() != QSqlError::NoError) { systemError(this, shipHandleTo.lastError().databaseText(), __FILE__, __LINE__); return; } QString sql( "SELECT shiphead_id " "FROM shiphead " "WHERE ( (NOT shiphead_shipped)" "" " AND (shiphead_id=)" "" " AND (shiphead_order_id=)" " AND (shiphead_order_type='TO'));" ); ParameterList params; params.append("tohead_id", _order->id()); if (_shipment->isValid()) params.append("shiphead_id", _shipment->id()); MetaSQLQuery mql(sql); shipHandleTo = mql.toQuery(params); if (shipHandleTo.first()) { if (_shipment->id() != shipHandleTo.value("shiphead_id").toInt()) _shipment->setId(shipHandleTo.value("shiphead_id").toInt()); if (shipHandleTo.next()) { _shipment->setType("TO"); _shipment->limitToOrder(_order->id()); _shipment->setEnabled(true); } } else if (shipHandleTo.lastError().type() != QSqlError::NoError) { systemError(this, shipHandleTo.lastError().databaseText(), __FILE__, __LINE__); return; } else if (_shipment->isValid()) { params.clear(); params.append("tohead_id", _order->id()); MetaSQLQuery mql(sql); shipHandleTo = mql.toQuery(params); if (shipHandleTo.first()) { _shipment->setId(shipHandleTo.value("shiphead_id").toInt()); if (shipHandleTo.next()) { _shipment->setType("TO"); _shipment->limitToOrder(_order->id()); _shipment->setEnabled(true); } } else if (shipHandleTo.lastError().type() != QSqlError::NoError) { systemError(this, shipHandleTo.lastError().databaseText(), __FILE__, __LINE__); return; } else _shipment->clear(); } else { QMessageBox::warning(this, tr("Nothing to ship"), tr("

    You may not ship this Transfer Order because " "no stock has been issued to shipping for it.")); _order->setFocus(); return; } } void shipOrder::sHandleButtons() { _select->setChecked(_order->isSO() && _privileges->check("SelectBilling") && _metrics->boolean("AutoSelectForBilling")); _select->setEnabled(_order->isSO() && _privileges->check("SelectBilling")); _create->setEnabled(_order->isSO() && _privileges->check("SelectBilling")); _print->setEnabled(_order->isSO() || _order->isTO()); _receive->setEnabled(_order->isTO() && _privileges->check("EnterReceipts")); _select->setVisible(! _order->isTO()); _create->setVisible(! _order->isTO()); _receive->setVisible(! _order->isSO()); } void shipOrder::sFillList() { if (_shipment->isValid()) { calcFreight(); QString ordertype; XSqlQuery shipq; shipq.prepare("SELECT shiphead_order_id, shiphead_shipvia, shiphead_order_type," " shiphead_tracknum, shiphead_freight, shiphead_freight_curr_id," " COALESCE(shipchrg_custfreight, TRUE) AS custfreight," " COALESCE(shiphead_shipdate,CURRENT_DATE) AS effective " "FROM shiphead LEFT OUTER JOIN " " shipchrg ON (shiphead_shipchrg_id=shipchrg_id) " "WHERE ( (NOT shiphead_shipped)" " AND (shiphead_id=:shiphead_id));" ); shipq.bindValue(":shiphead_id", _shipment->id()); shipq.exec(); if (shipq.first()) { _order->setId(shipq.value("shiphead_order_id").toInt(),shipq.value("shiphead_order_type").toString()); _shipVia->setText(shipq.value("shiphead_shipvia").toString()); ordertype = shipq.value("shiphead_order_type").toString(); _tracknum->addItem(shipq.value("shiphead_tracknum").toString(), shipq.value("shiphead_tracknum").toString()); if (shipq.value("custfreight").toBool()) { _freight->setEnabled(TRUE); _freight->set(shipq.value("shiphead_freight").toDouble(), shipq.value("shiphead_freight_curr_id").toInt(), shipq.value("effective").toDate(), false); } else { _freight->setEnabled(FALSE); _freight->set(0, shipq.value("shiphead_freight_curr_id").toInt(), shipq.value("effective").toDate()); } } else if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::warning(this, tr("Shipment/Order mismatch"), tr("

    Shipment #%1 either is not part of " "Order #%2 or has already shipped. Please change " "either the Order # or Shipment #.") .arg(_shipment->number()) .arg(_order->number())); _shipment->clear(); _shipment->setEnabled(false); return; } ParameterList itemp; itemp.append("shiphead_id", _shipment->id()); itemp.append("ordertype", ordertype); if (ordertype == "SO") itemp.append("sohead_id", _order->id()); else if (ordertype == "TO") itemp.append("tohead_id", _order->id()); QString items = "" "SELECT coitem_id," " formatSOlinenumber(coitem_id) AS linenumber, item_number," " (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " uom_name," " SUM(shipitem_qty) AS shipitem_qty, " " 'qty' AS shipitem_qty_xtnumericrole " "FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) " " JOIN coitem ON (coitem_id=shipitem_orderitem_id) " " JOIN itemsite ON (itemsite_id=coitem_itemsite_id) " " JOIN item ON (item_id=itemsite_item_id) " " JOIN uom ON (uom_id=coitem_qty_uom_id) " "WHERE ( (shiphead_id=)" " AND (NOT shiphead_shipped) ) " "GROUP BY coitem_id, coitem_linenumber, item_number," " uom_name, itemdescrip, coitem_subnumber " "ORDER BY coitem_linenumber, coitem_subnumber;" "" "SELECT toitem_id," " toitem_linenumber AS linenumber, item_number," " (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " uom_name," " SUM(shipitem_qty) AS shipitem_qty, " " 'qty' AS shipitem_qty_xtnumericrole " "FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) " " JOIN toitem ON (toitem_id=shipitem_orderitem_id) " " JOIN item ON (item_id=toitem_item_id) " " JOIN uom ON (uom_id=item_inv_uom_id) " "WHERE ( (shiphead_id=)" " AND (NOT shiphead_shipped) ) " "GROUP BY toitem_id, toitem_linenumber, item_number," " uom_name, itemdescrip " "ORDER BY toitem_linenumber;" "" ; MetaSQLQuery itemm(items); shipq = itemm.toQuery(itemp); _coitem->populate(shipq); if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } QString vals = "" "SELECT SUM(round((shipitem_qty * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio),2)) AS value " "FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) " " JOIN coitem ON (coitem_id=shipitem_orderitem_id) " "WHERE ( (shiphead_id=)" " AND (NOT shiphead_shipped) );" "" "SELECT SUM(toitem_stdcost * shipitem_qty) AS value " "FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) " " JOIN toitem ON (toitem_id=shipitem_orderitem_id) " "WHERE ( (shiphead_id=)" " AND (NOT shiphead_shipped) );" "" ; MetaSQLQuery valm(vals); shipq = valm.toQuery(itemp); // shared parameters if(shipq.first()) _shipValue->setDouble(shipq.value("value").toDouble()); else if (shipq.lastError().type() != QSqlError::NoError) { systemError(this, shipq.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _billToName->clear(); _shipToName->clear(); _shipToAddr1->clear(); _freight->setEnabled(TRUE); _freight->reset(); _shipVia->clear(); _tracknum->clear(); _shipment->clear(); _shipment->setEnabled(false); } } void shipOrder::sSelectToggled( bool yes ) { if(!yes && _create->isChecked()) _create->setChecked(false); } void shipOrder::sCreateToggled( bool yes ) { if(yes && !_select->isChecked() && _privileges->check("SelectBilling")) _select->setChecked(true); } // TODO: add cosmisc_id to shipdata and shipdatasum tables // TODO: integrate transfer orders with shipdatasum table void shipOrder::sFillFreight() { if (_order->isSO()) { XSqlQuery shipdataQ; shipdataQ.prepare( "SELECT shipdatasum_base_freight," " shipdatasum_shipper || ' - ' || shipdatasum_billing_option AS shipper_data " "FROM shipdatasum, cohead " "WHERE ( (shipdatasum_cohead_number=cohead_number)" " AND (cohead_id=:sohead_id) " " AND (shipdatasum_cosmisc_tracknum=:tracknum)" " AND ( (shipdatasum_shiphead_number=:shiphead_number)" " OR (:shiphead_number IS NULL))" ") ;"); shipdataQ.bindValue(":sohead_id", _order->id()); shipdataQ.bindValue(":tracknum", _tracknum->currentText()); if (! _shipment->number().isEmpty()) shipdataQ.bindValue(":shiphead_number", _shipment->number()); shipdataQ.exec(); if (shipdataQ.first()) { _freight->setEnabled(TRUE); _freight->setLocalValue(shipdataQ.value("shipdatasum_base_freight").toDouble()); _shipVia->setText(shipdataQ.value("shipper_data").toString()); } else if (shipdataQ.lastError().type() != QSqlError::NoError) { systemError(this, shipdataQ.lastError().databaseText(), __FILE__, __LINE__); return; } } } void shipOrder::sFillTracknum() { /* Let's not bother everybody all the time about this one possible problem if (_order->isTO()) { QMessageBox::warning(this, tr("Not Supported in Transfer Order"), tr("

    Automatic insertion of Tracking Numbers is " "not yet supported for Transfer Orders.")); return; } */ if (_order->isSO()) { XSqlQuery shipdataQ; // _tracknum->clear(); shipdataQ.prepare( "SELECT -2, shipdatasum_cosmisc_tracknum " "FROM shipdatasum, cohead " "WHERE ( (shipdatasum_cohead_number=cohead_number)" " AND (cohead_id=:sohead_id) " " AND ( (shipdatasum_shiphead_number=:shiphead_number)" " OR (:shiphead_number IS NULL))" " AND (NOT shipdatasum_shipped) ) " "ORDER BY shipdatasum_lastupdated;" ); shipdataQ.bindValue(":sohead_id", _order->id()); if (! _shipment->number().isEmpty()) shipdataQ.bindValue(":shiphead_number", _shipment->number()); shipdataQ.exec(); if (shipdataQ.first()) _tracknum->populate(shipdataQ); else if (shipdataQ.lastError().type() != QSqlError::NoError) { systemError(this, shipdataQ.lastError().databaseText(), __FILE__, __LINE__); return; } } } void shipOrder::calcFreight() { if (_shipment->isValid()) { XSqlQuery data; data.prepare("SELECT calcShipFreight(:shiphead_id) AS freight;"); data.bindValue(":shiphead_id",_shipment->id()); data.exec(); if(data.first()) { _freight->setLocalValue(data.value("freight").toDouble()); } else if (data.lastError().type() != QSqlError::NoError) { systemError(this, data.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/shipOrder.h000066400000000000000000000025511217451700100175100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPORDER_H #define SHIPORDER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_shipOrder.h" class shipOrder : public XDialog, public Ui::shipOrder { Q_OBJECT public: shipOrder(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~shipOrder(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sShip(); virtual void sFillList(); virtual void sFillFreight(); virtual void sFillTracknum(); virtual void sHandleOrder(); virtual void sHandleSo(); virtual void sHandleTo(); virtual void sHandleButtons(); virtual void calcFreight(); protected slots: virtual void languageChange(); virtual void sSelectToggled( bool yes ); virtual void sCreateToggled( bool yes ); private: bool _captive; bool _reject; // for handling errors during set() }; #endif // SHIPORDER_H qt-client-4.1.0/guiclient/shipOrder.ui000066400000000000000000000404771217451700100177070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shipOrder 0 0 800 600 Ship Order Date Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate 1 0 Select for Billing Create and Print Invoice Print Packing List true Receive Immediately Qt::Vertical 20 0 5 &Cancel &Ship true Qt::Vertical QSizePolicy::Expanding 20 20 false Qt::StrongFocus Shipment #: Bill To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 Ship To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 20 0 Qt::Vertical 20 0 Qt::StrongFocus Order #: 0 1 QFrame::NoFrame QFrame::Plain 0 0 5 1 0 Items to Ship: Shipment Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 5 5 0 Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Preferred 66 10 0 0 true XComboBox::ShipVias 0 Tracking Number: 0 0 200 0 true CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    OrderCluster QWidget
    ordercluster.h
    ShipmentCluster QWidget
    shipmentcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _transDate _order _shipment _select _create _print _receive _freight _shipVia _tracknum _ship _close _close clicked() shipOrder reject() 595 33 20 20 qt-client-4.1.0/guiclient/shipTo.cpp000066400000000000000000000354241217451700100173570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shipTo.h" #include #include #include #include #include #include "addresscluster.h" #include "errorReporter.h" #include "guiErrorCheck.h" #define DEBUG false shipTo::shipTo(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_shipToNumber, SIGNAL(editingFinished()), this, SLOT(sPopulateNumber())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_salesRep, SIGNAL(newID(int)), this, SLOT(sPopulateCommission(int))); connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _contact, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); _shipZone->populate( "SELECT shipzone_id, shipzone_name " "FROM shipzone " "ORDER BY shipzone_name;" ); _commission->setValidator(omfgThis->percentVal()); _shiptoid = -1; } shipTo::~shipTo() { // no need to delete child widgets, Qt does it all for us } void shipTo::languageChange() { retranslateUi(this); } enum SetResponse shipTo::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) _custid = param.toInt(); param = pParams.value("shipto_id", &valid); if (valid) { _shiptoid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _salesRep->setType(XComboBox::SalesRepsActive); XSqlQuery cust; cust.prepare( "SELECT cust_number, cust_name, cust_taxzone_id, " " cust_salesrep_id, cust_shipform_id, cust_shipvia, cust_shipchrg_id, " " crmacct_id " "FROM custinfo " " JOIN crmacct ON (cust_id=crmacct_cust_id) " "WHERE (cust_id=:cust_id);" ); cust.bindValue(":cust_id", _custid); cust.exec(); if (cust.first()) { _custNum->setText(cust.value("cust_number").toString()); _custName->setText(cust.value("cust_name").toString()); _salesRep->setId(cust.value("cust_salesrep_id").toInt()); _shipform->setId(cust.value("cust_shipform_id").toInt()); _taxzone->setId(cust.value("cust_taxzone_id").toInt()); _contact->setSearchAcct(cust.value("crmacct_id").toInt()); _address->setSearchAcct(cust.value("crmacct_id").toInt()); _shipchrg->setId(cust.value("cust_shipchrg_id").toInt()); // Handle the free-form Ship Via _shipVia->setId(-1); QString shipvia = cust.value("cust_shipvia").toString().trimmed(); if (shipvia.length()) { for (int counter = 0; counter < _shipVia->count(); counter++) if (_shipVia->itemText(counter) == shipvia) _shipVia->setCurrentIndex(counter); if (_shipVia->id() == -1) { _shipVia->addItem(shipvia); _shipVia->setCurrentIndex(_shipVia->count() - 1); } } } if (cust.lastError().type() != QSqlError::NoError) { systemError(this, cust.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } _save->setEnabled(false); } else if (param.toString() == "edit") { _mode = cEdit; _shipToNumber->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _shipToNumber->setEnabled(FALSE); _active->setEnabled(FALSE); _default->setEnabled(FALSE); _name->setEnabled(FALSE); _contact->setEnabled(FALSE); _address->setEnabled(FALSE); _salesRep->setEnabled(FALSE); _commission->setEnabled(FALSE); _shipZone->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _shipVia->setEnabled(FALSE); _shipform->setEnabled(FALSE); _shipchrg->setEnabled(FALSE); _comments->setEnabled(FALSE); _shippingComments->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } int shipTo::id() const { return _shiptoid; } void shipTo::sSave() { XSqlQuery shipSave; QList errors; errors << GuiErrorCheck(_name->text().length() == 0, _name, tr("You must enter a valid Name.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Ship To"), errors)) return; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); if (! shipSave.exec("BEGIN")) { systemError(this, shipSave.lastError().databaseText(), __FILE__, __LINE__); return; } int saveResult = _address->save(AddressCluster::CHECK); if (-2 == saveResult) { int answer = QMessageBox::question(this, tr("Question Saving Address"), tr("

    There are multiple uses of this Ship-To " "Address. What would you like to do?"), tr("Change This One"), tr("Change Address for All"), tr("Cancel"), 2, 2); if (0 == answer) saveResult = _address->save(AddressCluster::CHANGEONE); else if (1 == answer) saveResult = _address->save(AddressCluster::CHANGEALL); } if (saveResult < 0) // not else-if: this is error check for CHANGE{ONE,ALL} { systemError(this, tr("

    There was an error saving this address (%1). " "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); rollback.exec(); _address->setFocus(); return; } XSqlQuery saveq; saveq.prepare( "UPDATE shiptoinfo " "SET shipto_active=:shipto_active, shipto_default=:shipto_default," " shipto_name=:shipto_name, shipto_cntct_id=:shipto_cntct_id," " shipto_commission=:shipto_commission," " shipto_comments=:shipto_comments, shipto_shipcomments=:shipto_shipcomments," " shipto_taxzone_id=:shipto_taxzone_id, shipto_salesrep_id=:shipto_salesrep_id," " shipto_shipzone_id=:shipto_shipzone_id," " shipto_shipvia=:shipto_shipvia, shipto_shipform_id=:shipto_shipform_id," " shipto_shipchrg_id=:shipto_shipchrg_id," " shipto_addr_id=:shipto_addr_id " "WHERE (shipto_id=:shipto_id);" ); saveq.bindValue(":shipto_id", _shiptoid); saveq.bindValue(":shipto_active", QVariant(_active->isChecked())); saveq.bindValue(":shipto_default", QVariant(_default->isChecked())); saveq.bindValue(":shipto_cust_id", _custid); saveq.bindValue(":shipto_num", _shipToNumber->text().trimmed()); saveq.bindValue(":shipto_name", _name->text()); if (_contact->id() > 0) saveq.bindValue(":shipto_cntct_id", _contact->id()); if (_address->id() > 0) saveq.bindValue(":shipto_addr_id", _address->id()); saveq.bindValue(":shipto_commission", (_commission->toDouble() / 100)); saveq.bindValue(":shipto_comments", _comments->toPlainText()); saveq.bindValue(":shipto_shipcomments", _shippingComments->toPlainText()); saveq.bindValue(":shipto_shipvia", _shipVia->currentText()); if (_taxzone->isValid()) saveq.bindValue(":shipto_taxzone_id", _taxzone->id()); if (_salesRep->id() != -1) saveq.bindValue(":shipto_salesrep_id", _salesRep->id()); if (_shipZone->isValid()) saveq.bindValue(":shipto_shipzone_id", _shipZone->id()); if (_shipform->id() != -1) saveq.bindValue(":shipto_shipform_id", _shipform->id()); if (_shipchrg->id() != -1) saveq.bindValue(":shipto_shipchrg_id", _shipchrg->id()); saveq.exec(); if (saveq.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, saveq.lastError().databaseText(), __FILE__, __LINE__); return; } shipSave.exec("COMMIT;"); if (_mode == cNew) emit newId(_shiptoid); _mode = 0; done(_shiptoid); } void shipTo::populate() { XSqlQuery popq; popq.prepare( "SELECT cust_number, cust_name, shipto_active, shipto_default," " shipto_cust_id," " shipto_num, shipto_name, shipto_cntct_id," " shipto_shipvia, shipto_commission," " shipto_comments, shipto_shipcomments," " shipto_taxzone_id, shipto_shipchrg_id," " COALESCE(shipto_salesrep_id,-1) AS shipto_salesrep_id," " COALESCE(shipto_shipzone_id,-1) AS shipto_shipzone_id," " COALESCE(shipto_shipform_id,-1) AS shipto_shipform_id," " shipto_addr_id," " crmacct_id " "FROM shiptoinfo " " LEFT OUTER JOIN custinfo ON (shipto_cust_id=cust_id) " " LEFT OUTER JOIN crmacct ON (cust_id=crmacct_cust_id) " "WHERE (shipto_id=:shipto_id);" ); popq.bindValue(":shipto_id", _shiptoid); popq.exec(); if (popq.first()) { double commission = popq.value("shipto_commission").toDouble(); _custid = popq.value("shipto_cust_id").toInt(); _custNum->setText(popq.value("cust_number").toString()); _custName->setText(popq.value("cust_name").toString()); _active->setChecked(popq.value("shipto_active").toBool()); _default->setChecked(popq.value("shipto_default").toBool()); _shipToNumber->setText(popq.value("shipto_num")); _name->setText(popq.value("shipto_name")); _contact->setId(popq.value("shipto_cntct_id").toInt()); _contact->setSearchAcct(popq.value("crmacct_id").toInt()); _address->setSearchAcct(popq.value("crmacct_id").toInt()); _comments->setText(popq.value("shipto_comments").toString()); _shippingComments->setText(popq.value("shipto_shipcomments").toString()); _taxzone->setId(popq.value("shipto_taxzone_id").toInt()); _shipZone->setId(popq.value("shipto_shipzone_id").toInt()); _shipform->setId(popq.value("shipto_shipform_id").toInt()); _shipchrg->setId(popq.value("shipto_shipchrg_id").toInt()); _address->setId(popq.value("shipto_addr_id").toInt()); // Handle the free-form Ship Via _shipVia->setCurrentIndex(-1); QString shipvia = popq.value("shipto_shipvia").toString(); if (shipvia.trimmed().length() != 0) { for (int counter = 0; counter < _shipVia->count(); counter++) if (_shipVia->itemText(counter) == shipvia) _shipVia->setCurrentIndex(counter); if (_shipVia->id() == -1) { _shipVia->addItem(shipvia); _shipVia->setCurrentIndex(_shipVia->count() - 1); } } _salesRep->setId(popq.value("shipto_salesrep_id").toInt()); _commission->setDouble(commission * 100); emit newId(_shiptoid); emit populated(); } else if (popq.lastError().type() != QSqlError::NoError) { systemError(this, popq.lastError().databaseText(), __FILE__, __LINE__); return; } } void shipTo::sPopulateNumber() { if (_shipToNumber->text().length() == 0) { XSqlQuery nextnumq; nextnumq.prepare( "SELECT (COALESCE(MAX(CAST(shipto_num AS INTEGER)), 0) + 1) AS n_shipto_num " " FROM shiptoinfo " " WHERE ((shipto_cust_id=:cust_id)" " AND (shipto_num~'^[0-9]*$') )" ); nextnumq.bindValue(":cust_id", _custid); nextnumq.exec(); if (nextnumq.first()) _shipToNumber->setText(nextnumq.value("n_shipto_num")); else if (nextnumq.lastError().type() != QSqlError::NoError) { systemError(this, nextnumq.lastError().databaseText(), __FILE__, __LINE__); return; } } else { XSqlQuery dupnumq; dupnumq.prepare( "SELECT shipto_id " "FROM shiptoinfo " "WHERE ( (shipto_cust_id=:cust_id)" " AND (UPPER(shipto_num)=UPPER(:shipto_num))" " AND (shipto_id != :shipto_id));" ); dupnumq.bindValue(":cust_id", _custid); dupnumq.bindValue(":shipto_num", _shipToNumber->text()); dupnumq.bindValue(":shipto_id", _shiptoid); dupnumq.exec(); if (dupnumq.first()) { if (_mode == cNew && _shiptoid != -1) { XSqlQuery delnumq; delnumq.prepare( "DELETE FROM shiptoinfo " "WHERE (shipto_id=:shipto_id);" ); delnumq.bindValue(":shipto_id", _shiptoid); delnumq.exec(); } _mode = cEdit; _shiptoid = dupnumq.value("shipto_id").toInt(); populate(); _shipToNumber->setEnabled(FALSE); _name->setFocus(); } else if (dupnumq.lastError().type() != QSqlError::NoError) { systemError(this, dupnumq.lastError().databaseText(), __FILE__, __LINE__); return; } } if (_mode == cNew && _shiptoid == -1) { XSqlQuery newnumq; newnumq.prepare( "INSERT INTO shiptoinfo " "( shipto_cust_id, shipto_active, shipto_num, shipto_commission ) " "VALUES " "( :shipto_cust_id, :shipto_active, :shipto_num, :shipto_commission ) " "RETURNING shipto_id;"); newnumq.bindValue(":shipto_active", QVariant(_active->isChecked())); newnumq.bindValue(":shipto_cust_id", _custid); newnumq.bindValue(":shipto_num", _shipToNumber->text().trimmed()); newnumq.bindValue(":shipto_commission", (_commission->toDouble() / 100)); newnumq.exec(); if (newnumq.first()) _shiptoid = newnumq.value("shipto_id").toInt(); else if (newnumq.lastError().type() != QSqlError::NoError) { systemError(this, newnumq.lastError().databaseText(), __FILE__, __LINE__); return; } } _save->setEnabled(true); } void shipTo::sPopulateCommission(int pSalesrepid) { if (_mode != cView) { XSqlQuery commq; commq.prepare( "SELECT salesrep_commission " "FROM salesrep " "WHERE (salesrep_id=:salesrep_id);" ); commq.bindValue(":salesrep_id", pSalesrepid); commq.exec(); if (commq.first()) _commission->setDouble(commq.value("salesrep_commission").toDouble() * 100); else if (commq.lastError().type() != QSqlError::NoError) { systemError(this, commq.lastError().databaseText(), __FILE__, __LINE__); return; } } } void shipTo::closeEvent(QCloseEvent * /*pEvent*/) { if (DEBUG) qDebug("%s::closeEvent() _mode = %d", qPrintable(objectName()), _mode); if (_mode == cNew) { XSqlQuery delnumq; delnumq.prepare( "DELETE FROM shiptoinfo " "WHERE (shipto_id=:shipto_id);" ); delnumq.bindValue(":shipto_id", _shiptoid); delnumq.exec(); } } qt-client-4.1.0/guiclient/shipTo.h000066400000000000000000000024351217451700100170200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPTO_H #define SHIPTO_H #include "guiclient.h" #include "xdialog.h" #include #include "contactcluster.h" #include "ui_shipTo.h" class shipTo : public XDialog, public Ui::shipTo { Q_OBJECT public: shipTo(QWidget* = 0, const char* = 0, bool = false, Qt::WFlags = 0); ~shipTo(); Q_INVOKABLE virtual int id() const; public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); virtual void sPopulateNumber(); virtual void sPopulateCommission( int pSalesrepid ); virtual void closeEvent( QCloseEvent * pEvent ); signals: void newId(int); void populated(); protected slots: virtual void languageChange(); private: int _mode; int _custid; int _shiptoid; bool _inTransaction; }; #endif // SHIPTO_H qt-client-4.1.0/guiclient/shipTo.ui000066400000000000000000000406341217451700100172110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shipTo 0 0 800 600 0 0 Ship-To 12 Ship-&To #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipToNumber &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Qt::Horizontal 40 20 Active true Default Customer #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _custNum Qt::Vertical 20 0 5 &Cancel &Save true true Qt::Vertical 20 0 Address Defaults: Sales Rep.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::SalesReps Comm&ission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _commission 0 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 20 20 Ship Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true None Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true None XComboBox::TaxZones Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true true XComboBox::ShipVias Shipping Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true XComboBox::ShippingForms XComboBox::None Shipping Charges: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true XComboBox::ShippingCharges Qt::Vertical 20 0 Contact true 0 1 0 General Notes 0 2 Shipping Notes 0 2 AddressCluster QWidget

    addresscluster.h
    ContactCluster QWidget
    contactcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _shipToNumber _name _active _default _address _contact _salesRep _commission _shipZone _taxzone _shipVia _shipform _shipchrg _commentsTab _comments _shippingComments _save _close _close clicked() shipTo close() 20 20 20 20 qt-client-4.1.0/guiclient/shipVia.cpp000066400000000000000000000106141217451700100175060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shipVia.h" #include #include shipVia::shipVia(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _shipviaid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } shipVia::~shipVia() { // no need to delete child widgets, Qt does it all for us } void shipVia::languageChange() { retranslateUi(this); } enum SetResponse shipVia::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("shipvia_id", &valid); if (valid) { _shipviaid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void shipVia::sCheck() { XSqlQuery shipCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().trimmed().length())) { shipCheck.prepare( "SELECT shipvia_id " "FROM shipvia " "WHERE (UPPER(shipvia_code)=UPPER(:shipvia_code));" ); shipCheck.bindValue(":shipvia_code", _code->text()); shipCheck.exec(); if (shipCheck.first()) { _shipviaid = shipCheck.value("shipvia_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void shipVia::sSave() { XSqlQuery shipSave; if (_code->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Ship Via"), tr("You must enter a valid Code.") ); return; } shipSave.prepare( "SELECT shipvia_id" " FROM shipvia" " WHERE((shipvia_id<>:shipvia_id)" " AND (UPPER(shipvia_code)=UPPER(:shipvia_code)) );" ); shipSave.bindValue(":shipvia_id", _shipviaid); shipSave.bindValue(":shipvia_code", _code->text()); shipSave.exec(); if (shipSave.first()) { QMessageBox::critical( this, tr("Cannot Save Ship Via"), tr( "The new Ship Via information cannot be saved as the new Ship Via Code that you\n" "entered conflicts with an existing Ship Via. You must uniquely name this Ship Via\n" "before you may save it." ) ); return; } if (_mode == cNew) { shipSave.exec("SELECT NEXTVAL('shipvia_shipvia_id_seq') AS _shipvia_id;"); if (shipSave.first()) _shipviaid = shipSave.value("_shipvia_id").toInt(); shipSave.prepare( "INSERT INTO shipvia " "(shipvia_id, shipvia_code, shipvia_descrip) " "VALUES " "(:shipvia_id, :shipvia_code, :shipvia_descrip);" ); } else if (_mode == cEdit) { shipSave.prepare( "UPDATE shipvia " "SET shipvia_code=:shipvia_code, shipvia_descrip=:shipvia_descrip " "WHERE (shipvia_id=:shipvia_id);" ); } shipSave.bindValue(":shipvia_id", _shipviaid); shipSave.bindValue(":shipvia_code", _code->text().trimmed()); shipSave.bindValue(":shipvia_descrip", _description->text().trimmed()); shipSave.exec(); done(_shipviaid); } void shipVia::populate() { XSqlQuery shippopulate; shippopulate.prepare( "SELECT shipvia_code, shipvia_descrip " "FROM shipvia " "WHERE (shipvia_id=:shipvia_id);" ); shippopulate.bindValue(":shipvia_id", _shipviaid); shippopulate.exec(); if (shippopulate.first()) { _code->setText(shippopulate.value("shipvia_code").toString()); _description->setText(shippopulate.value("shipvia_descrip").toString()); } } qt-client-4.1.0/guiclient/shipVia.h000066400000000000000000000020261217451700100171510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPVIA_H #define SHIPVIA_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_shipVia.h" class shipVia : public XDialog, public Ui::shipVia { Q_OBJECT public: shipVia(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~shipVia(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _shipviaid; }; #endif // SHIPVIA_H qt-client-4.1.0/guiclient/shipVia.ui000066400000000000000000000101101217451700100173300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shipVia 0 0 481 81 Ship Via 0 5 5 Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    _code _description parameter.h
    qt-client-4.1.0/guiclient/shipVias.cpp000066400000000000000000000052711217451700100176740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shipVias.h" #include #include #include #include "shipVia.h" #include "guiclient.h" shipVias::shipVias(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); if (_privileges->check("MaintainShipVias")) { connect(_shipvia, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_shipvia, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_shipvia, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else _new->setEnabled(FALSE); _shipvia->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "shipvia_code" ); _shipvia->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "shipvia_descrip" ); sFillList(); } shipVias::~shipVias() { // no need to delete child widgets, Qt does it all for us } void shipVias::languageChange() { retranslateUi(this); } void shipVias::sNew() { ParameterList params; params.append("mode", "new"); shipVia newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shipVias::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("shipvia_id", _shipvia->id()); shipVia newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shipVias::sView() { ParameterList params; params.append("mode", "view"); params.append("shipvia_id", _shipvia->id()); shipVia newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void shipVias::sDelete() { XSqlQuery shipDelete; shipDelete.prepare( "DELETE FROM shipvia " "WHERE (shipvia_id=:shipvia_id);" ); shipDelete.bindValue(":shipvia_id", _shipvia->id()); shipDelete.exec(); sFillList(); } void shipVias::sFillList() { _shipvia->populate( "SELECT shipvia_id, shipvia_code, shipvia_descrip " "FROM shipvia " "ORDER BY shipvia_code;" ); } qt-client-4.1.0/guiclient/shipVias.h000066400000000000000000000016521217451700100173400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPVIAS_H #define SHIPVIAS_H #include "xwidget.h" #include "ui_shipVias.h" class shipVias : public XWidget, public Ui::shipVias { Q_OBJECT public: shipVias(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~shipVias(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SHIPVIAS_H qt-client-4.1.0/guiclient/shipVias.ui000066400000000000000000000104311217451700100175210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shipVias 0 0 600 400 List Ship Vias 0 0 0 0 20 Ship Vias: 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _shipvia _new _edit _delete _close _close clicked() shipVias close() 20 20 20 20
    qt-client-4.1.0/guiclient/shippingChargeType.cpp000066400000000000000000000120751217451700100217030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shippingChargeType.h" #include #include shippingChargeType::shippingChargeType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _shipchrgid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } shippingChargeType::~shippingChargeType() { // no need to delete child widgets, Qt does it all for us } void shippingChargeType::languageChange() { retranslateUi(this); } enum SetResponse shippingChargeType::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("shipchrg_id", &valid); if (valid) { _shipchrgid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _customerFreight->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void shippingChargeType::sCheck() { XSqlQuery shippingCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().trimmed().length())) { shippingCheck.prepare( "SELECT shipchrg_id " "FROM shipchrg " "WHERE (UPPER(shipchrg_name)=UPPER(:shipchrg_name));" ); shippingCheck.bindValue(":shipchrg_name", _name->text()); shippingCheck.exec(); if (shippingCheck.first()) { _shipchrgid = shippingCheck.value("shipchrg_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void shippingChargeType::sSave() { XSqlQuery shippingSave; if (_name->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Shipping Charge"), tr("You must enter a valid Name.") ); return; } shippingSave.prepare( "SELECT shipchrg_id " "FROM shipchrg " "WHERE ( (shipchrg_id<>:shipchrg_id)" " AND (UPPER(shipchrg_name)=UPPER(:shipchrg_name)) );" ); shippingSave.bindValue(":shipchrg_id", _shipchrgid); shippingSave.bindValue(":shipchrg_name", _name->text()); shippingSave.exec(); if (shippingSave.first()) { QMessageBox::critical( this, tr("Cannot Save Shipping Charge Type"), tr( "The new Shipping Charge Type information cannot be saved as the new Shipping Charge Type that you\n" "entered conflicts with an existing Shipping Charge Type. You must uniquely name this Shipping Charge Type\n" "before you may save it." ) ); return; } if (_mode == cNew) { shippingSave.exec("SELECT NEXTVAL('shipchrg_shipchrg_id_seq') AS shipchrg_id;"); if (shippingSave.first()) _shipchrgid = shippingSave.value("shipchrg_id").toInt(); shippingSave.prepare( "INSERT INTO shipchrg " "(shipchrg_id, shipchrg_name, shipchrg_descrip, shipchrg_custfreight) " "VALUES " "(:shipchrg_id, :shipchrg_name, :shipchrg_descrip, :shipchrg_custfreight);" ); } else if (_mode == cEdit) { shippingSave.prepare( "UPDATE shipchrg " "SET shipchrg_name=:shipchrg_name, shipchrg_descrip=:shipchrg_descrip," " shipchrg_custfreight=:shipchrg_custfreight " "WHERE (shipchrg_id=:shipchrg_id);" ); } shippingSave.bindValue(":shipchrg_id", _shipchrgid); shippingSave.bindValue(":shipchrg_name", _name->text().trimmed()); shippingSave.bindValue(":shipchrg_descrip", _description->text().trimmed()); shippingSave.bindValue(":shipchrg_custfreight", QVariant(_customerFreight->isChecked())); shippingSave.exec(); done(_shipchrgid); } void shippingChargeType::populate() { XSqlQuery shippingpopulate; shippingpopulate.prepare( "SELECT shipchrg_name, shipchrg_descrip, shipchrg_custfreight " "FROM shipchrg " "WHERE (shipchrg_id=:shipchrg_id);" ); shippingpopulate.bindValue(":shipchrg_id", _shipchrgid); shippingpopulate.exec(); if (shippingpopulate.first()) { _name->setText(shippingpopulate.value("shipchrg_name").toString()); _description->setText(shippingpopulate.value("shipchrg_descrip").toString()); _customerFreight->setChecked(shippingpopulate.value("shipchrg_custfreight").toBool()); } } qt-client-4.1.0/guiclient/shippingChargeType.h000066400000000000000000000021571217451700100213500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPPINGCHARGETYPE_H #define SHIPPINGCHARGETYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_shippingChargeType.h" class shippingChargeType : public XDialog, public Ui::shippingChargeType { Q_OBJECT public: shippingChargeType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~shippingChargeType(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _shipchrgid; int _mode; }; #endif // SHIPPINGCHARGETYPE_H qt-client-4.1.0/guiclient/shippingChargeType.ui000066400000000000000000000134031217451700100215320ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shippingChargeType 0 0 481 115 Shipping Charge Type 0 5 5 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 Qt::Horizontal QSizePolicy::Preferred 20 20 Customer may pay Freight Charges Qt::Horizontal QSizePolicy::Expanding 119 16 Qt::Vertical QSizePolicy::Expanding 20 21 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    _name _description _customerFreight parameter.h
    qt-client-4.1.0/guiclient/shippingChargeTypes.cpp000066400000000000000000000115211217451700100220610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shippingChargeTypes.h" #include #include #include #include "shippingChargeType.h" #include "guiclient.h" shippingChargeTypes::shippingChargeTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); if (_privileges->check("MaintainShippingChargeTypes")) { connect(_shipchrg, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_shipchrg, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_shipchrg, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else _new->setEnabled(FALSE); _shipchrg->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "shipchrg_name" ); _shipchrg->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "shipchrg_descrip" ); sFillList(); } shippingChargeTypes::~shippingChargeTypes() { // no need to delete child widgets, Qt does it all for us } void shippingChargeTypes::languageChange() { retranslateUi(this); } void shippingChargeTypes::sNew() { ParameterList params; params.append("mode", "new"); shippingChargeType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shippingChargeTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("shipchrg_id", _shipchrg->id()); shippingChargeType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shippingChargeTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("shipchrg_id", _shipchrg->id()); shippingChargeType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void shippingChargeTypes::sDelete() { XSqlQuery shippingDelete; shippingDelete.prepare("SELECT deleteShippingCharge(:shipchrg_id) AS result;"); shippingDelete.bindValue(":shipchrg_id", _shipchrg->id()); shippingDelete.exec(); if (shippingDelete.first()) { switch (shippingDelete.value("result").toInt()) { case -1: QMessageBox::critical( this, tr("Cannot Delete Shipping Charge Type"), tr( "The selected Shipping Charge Type cannot be delete as one or more Customers are assigned to it.\n" "You must reassigned these Customers before you may delete the selected Shipping Charge Type." ) ); return; case -2: QMessageBox::critical( this, tr("Cannot Delete Shipping Charge Type"), tr( "The selected Shipping Charge Type cannot be delete as one or more ShipTo's are assigned to it.\n" "You must reassigned these ShipTo's before you may delete the selected Shipping Charge Type." ) ); return; case -3: QMessageBox::critical( this, tr("Cannot Delete Shipping Charge Type"), tr( "The selected Shipping Charge Type cannot be delete as one or more Sales Orders are assigned to it.\n" "You must reassigned these Sales Orders before you may delete the selected Shipping Charge Type." ) ); return; case -4: QMessageBox::critical( this, tr("Cannot Delete Shipping Charge Type"), tr( "The selected Shipping Charge Type cannot be delete as one or more Shipments are assigned to it.\n" "You must reassigned these Shipments before you may delete the selected Shipping Charge Type." ) ); return; case -5: QMessageBox::critical( this, tr("Cannot Delete Shipping Charge Type"), tr( "The selected Shipping Charge Type cannot be delete as one or more Invoices are assigned to it.\n" "You must reassigned these Invoices before you may delete the selected Shipping Charge Type." ) ); return; } sFillList(); } } void shippingChargeTypes::sFillList() { _shipchrg->populate( "SELECT shipchrg_id, shipchrg_name, shipchrg_descrip " "FROM shipchrg " "ORDER BY shipchrg_name;" ); } qt-client-4.1.0/guiclient/shippingChargeTypes.h000066400000000000000000000020021217451700100215200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPPINGCHARGETYPES_H #define SHIPPINGCHARGETYPES_H #include "xwidget.h" #include "ui_shippingChargeTypes.h" class shippingChargeTypes : public XWidget, public Ui::shippingChargeTypes { Q_OBJECT public: shippingChargeTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~shippingChargeTypes(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SHIPPINGCHARGETYPES_H qt-client-4.1.0/guiclient/shippingChargeTypes.ui000066400000000000000000000074161217451700100217240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shippingChargeTypes 0 0 600 400 List Shipping Charge Types 0 Shipping Charge Types: &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _shipchrg _new _edit _delete _close _close clicked() shippingChargeTypes close() 20 20 20 20
    qt-client-4.1.0/guiclient/shippingForm.cpp000066400000000000000000000115431217451700100205520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shippingForm.h" #include #include #include shippingForm::shippingForm(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _shipformid = -1; connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); } shippingForm::~shippingForm() { // no need to delete child widgets, Qt does it all for us } void shippingForm::languageChange() { retranslateUi(this); } enum SetResponse shippingForm::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("shipform_id", &valid); if (valid) { _shipformid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _report->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void shippingForm::sCheck() { XSqlQuery shippingCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) || (_name->text().length())) { shippingCheck.prepare( "SELECT shipform_id" " FROM shipform" " WHERE((UPPER(shipform_name)=UPPER(:shipform_name))" " AND (shipform_id != :shipform_id));" ); shippingCheck.bindValue(":shipform_name", _name->text()); shippingCheck.bindValue(":shipform_id", _shipformid); shippingCheck.exec(); if (shippingCheck.first()) { _shipformid = shippingCheck.value("shipform_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } else if (shippingCheck.lastError().type() != QSqlError::NoError) { systemError(this, shippingCheck.lastError().databaseText(), __FILE__, __LINE__); return; } } } void shippingForm::sSave() { XSqlQuery shippingSave; if (_name->text().length() == 0) { QMessageBox::warning( this, tr("Format Name is Invalid"), tr("You must enter a valid name for this Bill of Lading Format.") ); _name->setFocus(); return; } sCheck(); if (_report->id() == -1) { QMessageBox::warning( this, tr("Report Name is Invalid"), tr("You must enter a select report for this Bill of Lading Format.") ); _report->setFocus(); return; } if (_mode == cNew) { shippingSave.exec("SELECT NEXTVAL('shipform_shipform_id_seq') AS shipform_id;"); if (shippingSave.first()) _shipformid = shippingSave.value("shipform_id").toInt(); else if (shippingSave.lastError().type() != QSqlError::NoError) { systemError(this, shippingSave.lastError().databaseText(), __FILE__, __LINE__); return; } shippingSave.prepare( "INSERT INTO shipform " "(shipform_id, shipform_name, shipform_report_name) " "VALUES " "(:shipform_id, :shipform_name, :shipform_report_name);" ); } if (_mode == cEdit) shippingSave.prepare( "UPDATE shipform " "SET shipform_name=:shipform_name, shipform_report_name=:shipform_report_name " "WHERE (shipform_id=:shipform_id);" ); shippingSave.bindValue(":shipform_id", _shipformid); shippingSave.bindValue(":shipform_name", _name->text()); shippingSave.bindValue(":shipform_report_name", _report->code()); shippingSave.exec(); if (shippingSave.lastError().type() != QSqlError::NoError) { systemError(this, shippingSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_shipformid); } void shippingForm::populate() { XSqlQuery shippingpopulate; shippingpopulate.prepare( "SELECT * " "FROM shipform " "WHERE (shipform_id=:shipform_id);" ); shippingpopulate.bindValue(":shipform_id", _shipformid); shippingpopulate.exec(); if (shippingpopulate.first()) { _name->setText(shippingpopulate.value("shipform_name").toString()); _report->setCode(shippingpopulate.value("shipform_report_name").toString()); } else if (shippingpopulate.lastError().type() != QSqlError::NoError) { systemError(this, shippingpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/shippingForm.h000066400000000000000000000020761217451700100202200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPPINGFORM_H #define SHIPPINGFORM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_shippingForm.h" class shippingForm : public XDialog, public Ui::shippingForm { Q_OBJECT public: shippingForm(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~shippingForm(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _shipformid; }; #endif // SHIPPINGFORM_H qt-client-4.1.0/guiclient/shippingForm.ui000066400000000000000000000105351217451700100204050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shippingForm 0 0 437 83 Shipping Form 0 5 5 5 &Form Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Report: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _report 5 XComboBox::Reports Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    _name _report _buttonBox rejected() shippingForm reject() 390 43 218 41
    qt-client-4.1.0/guiclient/shippingForms.cpp000066400000000000000000000100371217451700100207320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shippingForms.h" #include #include #include #include "shippingForm.h" shippingForms::shippingForms(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_bolformat, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); _bolformat->addColumn(tr("Form Name"), -1, Qt::AlignLeft, true, "shipform_name"); if (_privileges->check("MaintainShippingForms")) { connect(_bolformat, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_bolformat, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_bolformat, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_bolformat, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } shippingForms::~shippingForms() { // no need to delete child widgets, Qt does it all for us } void shippingForms::languageChange() { retranslateUi(this); } void shippingForms::sNew() { ParameterList params; params.append("mode", "new"); shippingForm newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shippingForms::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("shipform_id", _bolformat->id()); shippingForm newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shippingForms::sView() { ParameterList params; params.append("mode", "view"); params.append("shipform_id", _bolformat->id()); shippingForm newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void shippingForms::sDelete() { XSqlQuery shippingDelete; shippingDelete.prepare( "SELECT cust_id " "FROM custinfo " "WHERE (cust_shipform_id=:shipform_id);" ); shippingDelete.bindValue(":shipform_id", _bolformat->id()); shippingDelete.exec(); if (shippingDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Shipping Form"), tr( "The selected Shipping Form cannot be deleted as there are one or more Customers assigned to use it.\n" "You must reassign these Customers before you may delete the selected Shipping Form." ) ); return; } shippingDelete.prepare( "SELECT shipto_id " "FROM shiptoinfo " "WHERE (shipto_shipform_id=:shipform_id);" ); shippingDelete.bindValue(":shipform_id", _bolformat->id()); shippingDelete.exec(); if (shippingDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Shipping Form"), tr( "The selected Shipping Form cannot be deleted as there are one or more Ship-Tos assigned to use it.\n" "You must reassign these Ship-Tos before you may delete the selected Shipping Form." ) ); return; } shippingDelete.prepare( "DELETE FROM shipform " "WHERE (shipform_id=:shipform_id);" ); shippingDelete.bindValue(":shipform_id", _bolformat->id()); shippingDelete.exec(); sFillList(); } void shippingForms::sFillList() { _bolformat->populate( "SELECT shipform_id, shipform_name " "FROM shipform " "ORDER BY shipform_name" ); } qt-client-4.1.0/guiclient/shippingForms.h000066400000000000000000000017511217451700100204020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPPINGFORMS_H #define SHIPPINGFORMS_H #include "guiclient.h" #include "xwidget.h" #include "ui_shippingForms.h" class shippingForms : public XWidget, public Ui::shippingForms { Q_OBJECT public: shippingForms(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~shippingForms(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SHIPPINGFORMS_H qt-client-4.1.0/guiclient/shippingForms.ui000066400000000000000000000112101217451700100205570ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shippingForms 0 0 600 400 List Shipping Forms 0 true Shipping Forms: 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _bolformat _new _edit _view _delete _close _close clicked() shippingForms close() 20 20 20 20 _bolformat valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/shippingInformation.cpp000066400000000000000000000363161217451700100221410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shippingInformation.h" #include #include #include #include #include #include "issueToShipping.h" #include "salesOrderItem.h" #include "storedProcErrorLookup.h" #include "transferOrderItem.h" shippingInformation::shippingInformation(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_item, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_order, SIGNAL(newId(int, QString)), this, SLOT(sFillList())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); _captive = FALSE; _shippingForm->setCurrentIndex(-1); _item->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "linenumber" ); _item->addColumn(tr("Item"), -1, Qt::AlignLeft, true, "item_number" ); _item->addColumn(tr("At Shipping"), _qtyColumn, Qt::AlignRight, true, "qtyatshipping" ); _item->addColumn(tr("Net Wght."), _qtyColumn, Qt::AlignRight, true, "netweight" ); _item->addColumn(tr("Tare Wght."), _qtyColumn, Qt::AlignRight, true, "tareweight" ); _item->addColumn(tr("Gross Wght."), _qtyColumn, Qt::AlignRight, true, "grossweight" ); // Issue #11398 - Shipping charge data on shipment goes nowhere and logically can't because multiple // shipments converge on one billing selection. Hide shipping charges field for now until we can // understand how this should work. _shippingCharges->hide(); _shippingChargesLit->hide(); } shippingInformation::~shippingInformation() { // no need to delete child widgets, Qt does it all for us } void shippingInformation::languageChange() { retranslateUi(this); } enum SetResponse shippingInformation::set(const ParameterList &pParams) { XSqlQuery shippinget; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("shiphead_id", &valid); if (valid) _shipment->setId(param.toInt()); if (_shipment->isValid()) { shippinget.prepare( "SELECT shiphead_order_id, shiphead_order_type " "FROM shiphead " "WHERE (shiphead_id=:shiphead_id);" ); shippinget.bindValue(":shiphead_id", _shipment->id()); shippinget.exec(); if (shippinget.first()) { _captive = TRUE; _order->setId(shippinget.value("shiphead_order_id").toInt(), shippinget.value("shiphead_order_type").toString()); _order->setReadOnly(true); } else if (shippinget.lastError().type() != QSqlError::NoError) { systemError(this, shippinget.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } return NoError; } void shippingInformation::sSave() { XSqlQuery shippingSave; if (!_shipDate->isValid()) { QMessageBox::information( this, tr("No Ship Date Entered"), tr("

    You must enter a Ship Date before " "selecting this order for billing.") ); _shipDate->setFocus(); return; } if (_shipment->id() > 0) { shippingSave.prepare( "UPDATE shiphead " "SET shiphead_freight=:shiphead_freight," " shiphead_freight_curr_id=:shiphead_freight_curr_id," " shiphead_notes=:shiphead_notes," " shiphead_shipdate=:shiphead_shipdate, shiphead_shipvia=:shiphead_shipvia," " shiphead_shipchrg_id=:shiphead_shipchrg_id, shiphead_shipform_id=:shiphead_shipform_id " "WHERE (shiphead_id=:shiphead_id);" ); shippingSave.bindValue(":shiphead_id", _shipment->id()); } else shippingSave.prepare( "INSERT INTO shiphead " "( shiphead_order_id, shiphead_order_type, shiphead_freight," " shiphead_freight_curr_id, shiphead_notes," " shiphead_shipdate, shiphead_shipvia, shiphead_number," " shiphead_shipchrg_id, shiphead_shipform_id, shiphead_shipped ) " "VALUES " "( :shiphead_order_id, :shiphead_order_type, :shiphead_freight," " :shiphead_freight_curr_id, :shiphead_notes," " :shiphead_shipdate, :shiphead_shipvia, fetchShipmentNumber()," " :shiphead_shipchrg_id, :shiphead_shipform_id, FALSE );" ); shippingSave.bindValue(":shiphead_order_id", _order->id()); shippingSave.bindValue(":shiphead_order_type", _order->type()); shippingSave.bindValue(":shiphead_freight", _freight->localValue()); shippingSave.bindValue(":shiphead_freight_curr_id", _freight->id()); shippingSave.bindValue(":shiphead_notes", _notes->toPlainText()); shippingSave.bindValue(":shiphead_shipdate", _shipDate->date()); shippingSave.bindValue(":shiphead_shipvia", _shipVia->currentText()); shippingSave.bindValue(":shiphead_shipchrg_id", _shippingCharges->id()); shippingSave.bindValue(":shiphead_shipform_id", _shippingForm->id()); shippingSave.exec(); if (shippingSave.lastError().type() != QSqlError::NoError) { systemError(this, shippingSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_captive) accept(); else _order->setId(-1, QString::null); } void shippingInformation::sPopulateMenu(QMenu *menuThis) { QAction * act = menuThis->addAction(tr("Issue Additional Stock for this Order Line to Shipping..."), this, SLOT(sIssueStock())); if(_order->isClosed()) act->setEnabled(false); menuThis->addAction(tr("Return ALL Stock Issued for this Order Line to the Site..."), this, SLOT(sReturnAllLineStock())); menuThis->addAction(tr("View Order Line..."), this, SLOT(sViewLine())); } void shippingInformation::sIssueStock() { ParameterList params; if (_order->isValid() && _order->type() == "SO") params.append("sohead_id", _item->altId()); else if (_order->isValid() && _order->type() == "TO") params.append("tohead_id", _item->altId()); issueToShipping *newdlg = new issueToShipping(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void shippingInformation::sReturnAllLineStock() { XSqlQuery shippingReturnAllLineStock; shippingReturnAllLineStock.prepare("SELECT returnItemShipments(:ordertype, :lineitemid," " 0, CURRENT_TIMESTAMP) AS result;"); shippingReturnAllLineStock.bindValue(":ordertype", _order->type()); shippingReturnAllLineStock.bindValue(":lineitemid", _item->id()); shippingReturnAllLineStock.exec(); if (shippingReturnAllLineStock.first()) { int result = shippingReturnAllLineStock.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("returnItemShipments", result), __FILE__, __LINE__); return; } } else if (shippingReturnAllLineStock.lastError().type() != QSqlError::NoError) { systemError(this, shippingReturnAllLineStock.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void shippingInformation::sViewLine() { ParameterList params; params.append("mode", "view"); if (_order->isValid() && _order->type() == "SO") { params.append("soitem_id", _item->id()); salesOrderItem newdlg(this); newdlg.set(params); newdlg.exec(); } else if (_order->isValid() && _order->type() == "TO") { params.append("toitem_id", _item->id()); transferOrderItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void shippingInformation::sFillList() { XSqlQuery shippingFillList; QString shs( "SELECT shiphead_notes, shiphead_shipvia," " shiphead_shipchrg_id, shiphead_shipform_id," " shiphead_freight, shiphead_freight_curr_id," " shiphead_shipdate," " CASE WHEN (shiphead_shipdate IS NULL) THEN FALSE" " ELSE TRUE" " END AS validdata " "FROM shiphead " "WHERE ((NOT shiphead_shipped)" " AND (shiphead_order_type=)" " AND (shiphead_order_id=) );" ) ; ParameterList shp; if (_order->isValid()) { shp.append("ordertype", _order->type()); shp.append("orderid", _order->id()); } else { _order->setId(-1, ""); _orderDate->setNull(); _poNumber->clear(); _custName->clear(); _custPhone->clear(); _shipDate->setNull(); _shipVia->setNull(); _freight->reset(); return; } MetaSQLQuery shm(shs); shippingFillList = shm.toQuery(shp); bool fetchFromHead = TRUE; if (shippingFillList.first()) { if (shippingFillList.value("validdata").toBool()) { fetchFromHead = FALSE; _shipDate->setDate(shippingFillList.value("shiphead_shipdate").toDate()); _shipVia->setText(shippingFillList.value("shiphead_shipvia").toString()); _shippingCharges->setId(shippingFillList.value("shiphead_shipchrg_id").toInt()); _shippingForm->setId(shippingFillList.value("shiphead_shipform_id").toInt()); _freight->setId(shippingFillList.value("shiphead_freight_curr_id").toInt()); _freight->setLocalValue(shippingFillList.value("shiphead_freight").toDouble()); _notes->setText(shippingFillList.value("shiphead_notes").toString()); } } else if (shippingFillList.lastError().type() != QSqlError::NoError) { systemError(this, shippingFillList.lastError().databaseText(), __FILE__, __LINE__); return; } if (_order->isValid() && _order->type() == "SO") { shippingFillList.prepare( "SELECT cohead_orderdate AS orderdate," " cohead_holdtype AS holdtype," " cohead_custponumber AS ponumber," " cust_name AS name, cntct_phone AS phone," " cohead_shipcomments AS shipcomments," " cohead_shipvia AS shipvia," " cohead_shipchrg_id AS shipchrg_id," " cohead_shipform_id AS shipform_id, " " cohead_shiptoname AS shiptoname " "FROM cohead, custinfo " "LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" "WHERE ((cohead_cust_id=cust_id)" " AND (cohead_id=:cohead_id));" ); shippingFillList.bindValue(":cohead_id", _order->id()); } else if (_order->isValid() && _order->type() == "TO") { shippingFillList.prepare( "SELECT tohead_orderdate AS orderdate," " 'N' AS holdtype," " :to AS ponumber," " tohead_destname AS name, tohead_destphone AS phone," " tohead_shipcomments AS shipcomments," " tohead_shipvia AS shipvia," " tohead_shipchrg_id AS shipchrg_id," " tohead_shipform_id AS shipform_id, " " tohead_destname AS shiptoname " "FROM tohead " "WHERE (tohead_id=:tohead_id);" ); shippingFillList.bindValue(":tohead_id", _order->id()); } shippingFillList.exec(); if (shippingFillList.first()) { _orderDate->setDate(shippingFillList.value("orderdate").toDate()); _poNumber->setText(shippingFillList.value("ponumber").toString()); _custName->setText(shippingFillList.value("name").toString()); _custPhone->setText(shippingFillList.value("phone").toString()); _shipToName->setText(shippingFillList.value("shiptoname").toString()); QString msg; if (shippingFillList.value("head_holdtype").toString() == "C") msg = storedProcErrorLookup("issuetoshipping", -12); else if (shippingFillList.value("head_holdtype").toString() == "P") msg = storedProcErrorLookup("issuetoshipping", -13); else if (shippingFillList.value("head_holdtype").toString() == "R") msg = storedProcErrorLookup("issuetoshipping", -14); if (! msg.isEmpty()) { QMessageBox::warning(this, tr("Order on Hold"), msg); _order->setId(-1, ""); _order->setFocus(); return; } if (fetchFromHead) { _shipDate->setDate(omfgThis->dbDate()); _shippingCharges->setId(shippingFillList.value("shipchrg_id").toInt()); _shippingForm->setId(shippingFillList.value("shipform_id").toInt()); _notes->setText(shippingFillList.value("shipcomments").toString()); _shipVia->setText(shippingFillList.value("shipvia").toString()); } } else if (shippingFillList.lastError().type() != QSqlError::NoError) { systemError(this, shippingFillList.lastError().databaseText(), __FILE__, __LINE__); return; } ParameterList params; params.append("order_id", _order->id()); params.append(_order->type()); MetaSQLQuery mql("SELECT itemid, headid," " linenumber, item_number," " netweight, tareweight, (netweight + tareweight) AS grossweight," " qtyatshipping," " 'weight' AS netweight_xtnumericrole," " 'weight' AS tareweight_xtnumericrole," " 'weight' AS grossweight_xtnumericrole," " 0 AS netweight_xttotalrole," " 0 AS tareweight_xttotalrole," " 0 AS grossweight_xttotalrole," " 'qty' AS qtyatshipping_xtnumericrole " "FROM ( " "" "SELECT coitem_id AS itemid, coitem_cohead_id AS headid," " coitem_linenumber AS linenumber, item_number," " (item_prodweight * itemuomtouom(item_id, coitem_price_uom_id, NULL, qtyAtShipping('SO', coitem_id))) AS netweight," " (item_packweight * itemuomtouom(item_id, coitem_price_uom_id, NULL, qtyAtShipping('SO', coitem_id))) AS tareweight," " qtyAtShipping('SO', coitem_id) AS qtyatshipping " "FROM coitem, itemsite, item " "WHERE ((coitem_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (coitem_cohead_id=) ) " "" "SELECT toitem_id AS itemid, toitem_tohead_id AS headid," " toitem_linenumber AS linenumber, item_number," " (item_prodweight * qtyAtShipping('TO', toitem_id)) AS netweight," " (item_packweight * qtyAtShipping('TO', toitem_id)) AS tareweight," " qtyAtShipping('TO', toitem_id) AS qtyatshipping " "FROM toitem, item " "WHERE ((toitem_item_id=item_id)" " AND (toitem_tohead_id=) ) " "" " ) AS data " "ORDER BY linenumber;"); XSqlQuery qry = mql.toQuery(params); _item->populate(qry, true); if (shippingFillList.lastError().type() != QSqlError::NoError) { systemError(this, shippingFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/shippingInformation.h000066400000000000000000000023441217451700100216000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPPINGINFORMATION_H #define SHIPPINGINFORMATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_shippingInformation.h" class shippingInformation : public XDialog, public Ui::shippingInformation { Q_OBJECT public: shippingInformation(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~shippingInformation(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sPopulateMenu(QMenu * menuThis ); virtual void sIssueStock(); virtual void sReturnAllLineStock(); virtual void sViewLine(); virtual void sFillList(); protected slots: virtual void languageChange(); private: bool _captive; }; #endif // SHIPPINGINFORMATION_H qt-client-4.1.0/guiclient/shippingInformation.ui000066400000000000000000000423401217451700100217660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shippingInformation 0 0 800 600 Shipping Information 12 6 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipment Qt::Vertical 20 0 Cust. Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Cust. Phone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 P/O Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ship To Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Shipment #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipment false Qt::StrongFocus 0 1 0 Shipment Header Ship Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 100 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 Shipping Chgs.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipVia 0 0 XComboBox::ShippingCharges Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::ShipVias Shipping Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipVia 0 0 XComboBox::ShippingForms Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical 20 40 Qt::Horizontal 40 20 Items 0 0 0 100 Notes CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    OrderCluster QWidget
    ordercluster.h
    ShipmentCluster QWidget
    shipmentcluster.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    XTextEdit QTextEdit
    xtextedit.h
    _order _orderDate _shipment _item _notes _shipDate _shipVia _freight _shippingCharges _shippingForm _buttonBox rejected() shippingInformation reject() 746 88 399 299 qt-client-4.1.0/guiclient/shippingZone.cpp000066400000000000000000000112671217451700100205650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shippingZone.h" #include #include shippingZone::shippingZone(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _shipzoneid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } shippingZone::~shippingZone() { // no need to delete child widgets, Qt does it all for us } void shippingZone::languageChange() { retranslateUi(this); } enum SetResponse shippingZone::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("shipzone_id", &valid); if (valid) { _shipzoneid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void shippingZone::sSave() { XSqlQuery shippingSave; if (_name->text().length() == 0) { QMessageBox::information( this, tr("No Name Entered"), tr("You must enter a valid name before saving this Shipping Zone.") ); _name->setFocus(); return; } shippingSave.prepare("SELECT shipzone_id" " FROM shipzone" " WHERE((shipzone_id != :shipzone_id)" " AND (shipzone_name=:shipzone_name))"); shippingSave.bindValue(":shipzone_id", _shipzoneid); shippingSave.bindValue(":shipzone_name", _name->text().trimmed()); shippingSave.exec(); if(shippingSave.first()) { QMessageBox::critical(this, tr("Cannot Save Shipping Zone"), tr("You have entered a duplicate Name for this Shipping Zone. " "Please select a different name before saving.")); _name->setFocus(); return; } if (_mode == cNew) { shippingSave.exec("SELECT NEXTVAL('shipzone_shipzone_id_seq') AS shipzone_id"); if (shippingSave.first()) _shipzoneid = shippingSave.value("shipzone_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } shippingSave.prepare( "INSERT INTO shipzone " "(shipzone_id, shipzone_name, shipzone_descrip) " "VALUES " "(:shipzone_id, :shipzone_name, :shipzone_descrip);" ); } else if (_mode == cEdit) shippingSave.prepare( "UPDATE shipzone " "SET shipzone_name=:shipzone_name, shipzone_descrip=:shipzone_descrip " "WHERE (shipzone_id=:shipzone_id);" ); shippingSave.bindValue(":shipzone_id", _shipzoneid); shippingSave.bindValue(":shipzone_name", _name->text()); shippingSave.bindValue(":shipzone_descrip", _description->text()); shippingSave.exec(); done(_shipzoneid); } void shippingZone::sCheck() { XSqlQuery shippingCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { shippingCheck.prepare( "SELECT shipzone_id " "FROM shipzone " "WHERE (UPPER(shipzone_name)=UPPER(:shipzone_name));" ); shippingCheck.bindValue(":shipzone_name", _name->text()); shippingCheck.exec(); if (shippingCheck.first()) { _shipzoneid = shippingCheck.value("shipzone_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void shippingZone::populate() { XSqlQuery shippingpopulate; shippingpopulate.prepare( "SELECT shipzone_name, shipzone_descrip " "FROM shipzone " "WHERE (shipzone_id=:shipzone_id);" ); shippingpopulate.bindValue(":shipzone_id", _shipzoneid); shippingpopulate.exec(); if (shippingpopulate.first()) { _name->setText(shippingpopulate.value("shipzone_name").toString()); _description->setText(shippingpopulate.value("shipzone_descrip").toString()); } } qt-client-4.1.0/guiclient/shippingZone.h000066400000000000000000000021011217451700100202150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPPINGZONE_H #define SHIPPINGZONE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_shippingZone.h" class shippingZone : public XDialog, public Ui::shippingZone { Q_OBJECT public: shippingZone(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~shippingZone(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _mode; int _shipzoneid; }; #endif // SHIPPINGZONE_H qt-client-4.1.0/guiclient/shippingZone.ui000066400000000000000000000104461217451700100204160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shippingZone 0 0 430 81 Shipping Zone 0 5 5 &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    _name _description parameter.h
    qt-client-4.1.0/guiclient/shippingZones.cpp000066400000000000000000000100141217451700100207350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shippingZones.h" #include #include #include #include #include #include "shippingZone.h" #include "guiclient.h" shippingZones::shippingZones(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_shipzone, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_shipzone, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); _shipzone->addColumn(tr("Name"), 70, Qt::AlignLeft, true, "shipzone_name" ); _shipzone->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "shipzone_descrip" ); if (_privileges->check("MaintainShippingZones")) { connect(_shipzone, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_shipzone, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_shipzone, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_shipzone, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } shippingZones::~shippingZones() { // no need to delete child widgets, Qt does it all for us } void shippingZones::languageChange() { retranslateUi(this); } void shippingZones::sDelete() { XSqlQuery shippingDelete; shippingDelete.prepare( "SELECT shipto_id " "FROM shiptoinfo " "WHERE (shipto_shipzone_id=:shipzone_id);" ); shippingDelete.bindValue(":shipzone_id", _shipzone->id()); shippingDelete.exec(); if (shippingDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Shipping Zone"), tr( "The selected Shipping Zone cannot be deleted as there are one or more Ship-Tos assigned to it.\n" "You must reassign these Ship-Tos to a different Shipping Zone before you may delete the selected Shipping Zone." ) ); return; } shippingDelete.prepare( "DELETE FROM shipzone " "WHERE (shipzone_id=:shipzone_id);" ); shippingDelete.bindValue(":shipzone_id", _shipzone->id()); shippingDelete.exec(); sFillList(); } void shippingZones::sNew() { ParameterList params; params.append("mode", "new"); shippingZone newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shippingZones::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("shipzone_id", _shipzone->id()); shippingZone newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void shippingZones::sView() { ParameterList params; params.append("mode", "view"); params.append("shipzone_id", _shipzone->id()); shippingZone newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void shippingZones::sFillList() { _shipzone->populate( "SELECT shipzone_id, shipzone_name, shipzone_descrip " "FROM shipzone " "ORDER BY shipzone_name" ); } void shippingZones::sPopulateMenu( QMenu * ) { } void shippingZones::sPrint() { orReport report("ShippingZonesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/shippingZones.h000066400000000000000000000020301217451700100204010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SHIPPINGZONES_H #define SHIPPINGZONES_H #include "xwidget.h" #include "ui_shippingZones.h" class shippingZones : public XWidget, public Ui::shippingZones { Q_OBJECT public: shippingZones(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~shippingZones(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // SHIPPINGZONES_H qt-client-4.1.0/guiclient/shippingZones.ui000066400000000000000000000110351217451700100205740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. shippingZones 0 0 600 400 List Shipping Zones 0 Shipping Zones: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _shipzone _new _edit _view _delete _print _close _close clicked() shippingZones close() 20 20 20 20 _shipzone valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/siteType.cpp000066400000000000000000000112621217451700100177110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "siteType.h" #include #include siteType::siteType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _sitetypeid = -1; connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } siteType::~siteType() { // no need to delete child widgets, Qt does it all for us } void siteType::languageChange() { retranslateUi(this); } enum SetResponse siteType::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("sitetype_id", &valid); if (valid) { _sitetypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void siteType::sCheck() { XSqlQuery siteCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().trimmed().length())) { siteCheck.prepare( "SELECT sitetype_id" " FROM sitetype" " WHERE((UPPER(sitetype_name)=UPPER(:sitetype_name))" " AND (sitetype_id != :sitetype_id));" ); siteCheck.bindValue(":sitetype_name", _code->text()); siteCheck.bindValue(":sitetype_id", _sitetypeid); siteCheck.exec(); if (siteCheck.first()) { _sitetypeid = siteCheck.value("sitetype_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void siteType::sSave() { XSqlQuery siteSave; if (_code->text().length() == 0) { QMessageBox::critical( this, tr("Cannot Save Site Type"), tr( "You must uniquely name this Site Type\n" "before you may save it." ) ); _code->setFocus(); return; } siteSave.prepare( "SELECT sitetype_id" " FROM sitetype" " WHERE((UPPER(sitetype_name)=UPPER(:sitetype_name))" " AND (sitetype_id != :sitetype_id));" ); siteSave.bindValue(":sitetype_name", _code->text()); siteSave.bindValue(":sitetype_id", _sitetypeid); siteSave.exec(); if (siteSave.first()) { QMessageBox::critical( this, tr("Cannot Save Site Type"), tr( "The new Site Type information cannot be saved as the new Site Type Name that you\n" "entered conflicts with an existing Site Type. You must uniquely name this Site Type\n" "before you may save it." ) ); _code->setFocus(); return; } if (_mode == cNew) { siteSave.exec("SELECT NEXTVAL('sitetype_sitetype_id_seq') AS _sitetype_id;"); if (siteSave.first()) _sitetypeid = siteSave.value("_sitetype_id").toInt(); siteSave.prepare( "INSERT INTO sitetype " "(sitetype_id, sitetype_name, sitetype_descrip) " "VALUES " "(:sitetype_id, :sitetype_name, :sitetype_descrip);" ); } else if (_mode == cEdit) { siteSave.prepare( "UPDATE sitetype " "SET sitetype_name=:sitetype_name, sitetype_descrip=:sitetype_descrip " "WHERE (sitetype_id=:sitetype_id);" ); } siteSave.bindValue(":sitetype_id", _sitetypeid); siteSave.bindValue(":sitetype_name", _code->text().trimmed()); siteSave.bindValue(":sitetype_descrip", _description->text().trimmed()); siteSave.exec(); done(_sitetypeid); } void siteType::populate() { XSqlQuery sitepopulate; sitepopulate.prepare( "SELECT sitetype_name, sitetype_descrip " "FROM sitetype " "WHERE (sitetype_id=:sitetype_id);" ); sitepopulate.bindValue(":sitetype_id", _sitetypeid); sitepopulate.exec(); if (sitepopulate.first()) { _code->setText(sitepopulate.value("sitetype_name").toString()); _description->setText(sitepopulate.value("sitetype_descrip").toString()); } } qt-client-4.1.0/guiclient/siteType.h000066400000000000000000000020371217451700100173560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SITETYPE_H #define SITETYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_siteType.h" class siteType : public XDialog, public Ui::siteType { Q_OBJECT public: siteType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~siteType(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _sitetypeid; }; #endif // SITETYPE_H qt-client-4.1.0/guiclient/siteType.ui000066400000000000000000000072211217451700100175440ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. siteType 0 0 400 100 Site Type Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _code _description parameter.h
    qt-client-4.1.0/guiclient/siteTypes.cpp000066400000000000000000000112071217451700100200730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "siteTypes.h" #include #include #include #include #include #include "siteType.h" siteTypes::siteTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_sitetype, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_sitetype, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); _sitetype->addColumn(tr("Code"), _itemColumn, Qt::AlignCenter, true, "sitetype_name" ); _sitetype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "sitetype_descrip" ); if (_privileges->check("MaintainSiteTypes")) { connect(_sitetype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_sitetype, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_sitetype, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_sitetype, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } siteTypes::~siteTypes() { // no need to delete child widgets, Qt does it all for us } void siteTypes::languageChange() { retranslateUi(this); } void siteTypes::sPrint() { orReport report("SiteTypesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void siteTypes::sNew() { ParameterList params; params.append("mode", "new"); siteType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void siteTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("sitetype_id", _sitetype->id()); siteType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void siteTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("sitetype_id", _sitetype->id()); siteType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void siteTypes::sDelete() { XSqlQuery siteDelete; if ( QMessageBox::information( this, tr("Delete Site Type"), tr("Are you sure that you want to delete the selected Site Type?"), tr("&Delete"), tr("&Cancel"), 0, 0, 1 ) == 0 ) { siteDelete.prepare( "SELECT warehous_id " "FROM whsinfo " "WHERE (warehous_sitetype_id=:sitetype_id) " "LIMIT 1;" ); siteDelete.bindValue(":sitetype_id", _sitetype->id()); siteDelete.exec(); if (siteDelete.first()) QMessageBox::information( this, tr("Site Type in Use"), tr( "The selected Site Type cannot be deleted as it still contains Sites.\n" "You must reassign these Sites before deleting this Site Type.") ); else { siteDelete.prepare( "DELETE FROM sitetype " "WHERE (sitetype_id=:sitetype_id);" ); siteDelete.bindValue(":sitetype_id", _sitetype->id()); siteDelete.exec(); sFillList(); } } } void siteTypes::sPopulateMenu(QMenu *menu) { QAction *menuItem; menuItem = menu->addAction(tr("Edit Site Type..."), this, SLOT(sEdit())); if (!_privileges->check("MaintainSiteTypes")) menuItem->setEnabled(FALSE); menuItem = menu->addAction(tr("View Site Type..."), this, SLOT(sView())); if ((!_privileges->check("MaintainSiteTypes")) && (!_privileges->check("ViewSiteTypes"))) menuItem->setEnabled(FALSE); menuItem = menu->addAction(tr("Delete Site Type..."), this, SLOT(sDelete())); if (!_privileges->check("MaintainSiteTypes")) menuItem->setEnabled(FALSE); } void siteTypes::sFillList() { _sitetype->populate( "SELECT sitetype_id, sitetype_name, sitetype_descrip " "FROM sitetype " "ORDER BY sitetype_name" ); } qt-client-4.1.0/guiclient/siteTypes.h000066400000000000000000000020541217451700100175400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SITETYPES_H #define SITETYPES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_siteTypes.h" class siteTypes : public XWidget, public Ui::siteTypes { Q_OBJECT public: siteTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~siteTypes(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * menu ); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SITETYPES_H qt-client-4.1.0/guiclient/siteTypes.ui000066400000000000000000000112731217451700100177310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. siteTypes 0 0 600 400 List Site Types 0 Site Types: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 true &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _sitetype _new _edit _view _delete _print _close parameter.h _close clicked() siteTypes close() 20 20 20 20 _sitetype valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/splitReceipt.cpp000066400000000000000000000057651217451700100205650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "splitReceipt.h" #include #include #include #include #include #include "mqlutil.h" #include "storedProcErrorLookup.h" splitReceipt::splitReceipt(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_split, SIGNAL(clicked()), this, SLOT(sSplit())); _toSplit->setValidator(omfgThis->qtyVal()); _receiptDate->setDate(QDate::currentDate()); _recvid = -1; } splitReceipt::~splitReceipt() { // no need to delete child widgets, Qt does it all for us } void splitReceipt::languageChange() { retranslateUi(this); } enum SetResponse splitReceipt::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("recv_id", &valid); if (valid) { _recvid = param.toInt(); populate(); } return NoError; } void splitReceipt::populate() { XSqlQuery splitpopulate; ParameterList params; MetaSQLQuery popm = mqlLoad("itemReceipt", "populateEdit"); params.append("recv_id", _recvid); splitpopulate = popm.toQuery(params); if (splitpopulate.first()) { _orderNumber->setText(splitpopulate.value("order_number").toString()); _lineNumber->setText(splitpopulate.value("orderitem_linenumber").toString()); _received->setText(formatQty(splitpopulate.value("qtyreceived").toDouble())); _receiptDate->setDate(splitpopulate.value("effective").toDate()); _freight->setId(splitpopulate.value("curr_id").toInt()); _freight->setLocalValue(splitpopulate.value("recv_freight").toDouble()); } else if (splitpopulate.lastError().type() != QSqlError::NoError) { systemError(this, splitpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void splitReceipt::sSplit() { XSqlQuery splitSplit; int result = 0; splitSplit.prepare("SELECT splitReceipt(:recvid, :qty, :freight) AS result;"); splitSplit.bindValue(":recvid", _recvid); splitSplit.bindValue(":qty", _toSplit->toDouble()); splitSplit.bindValue(":freight", _freight->localValue()); splitSplit.exec(); if (splitSplit.first()) { result = splitSplit.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup(QString("splitReceipt"), result), __FILE__, __LINE__); return; } } else if (splitSplit.lastError().type() != QSqlError::NoError) { systemError(this, splitSplit.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sPurchaseOrderReceiptsUpdated(); accept(); } qt-client-4.1.0/guiclient/splitReceipt.h000066400000000000000000000020171217451700100202150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SPLITRECEIPT_H #define SPLITRECEIPT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_splitReceipt.h" class splitReceipt : public XDialog, public Ui::splitReceipt { Q_OBJECT public: splitReceipt(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~splitReceipt(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sSplit(); protected slots: virtual void languageChange(); private: int _recvid; }; #endif // SPLITRECEIPT_H qt-client-4.1.0/guiclient/splitReceipt.ui000066400000000000000000000177571217451700100204240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. splitReceipt 0 0 567 178 Split Receipt Order Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _orderNumber 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 5 &Cancel &Split true true Qt::Vertical QSizePolicy::Expanding 20 20 Date Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::NoFocus Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::NoFocus false Qty. Split: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 100 32767 Qt::AlignHCenter|Qt::AlignRight|Qt::AlignTrailing Freight Split: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false CurrCluster CurrDisplay
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    XLineEdit QLineEdit
    xlineedit.h
    _toSplit _freightSplit _split _close _close clicked() splitReceipt reject() 20 20 20 20 _receiptDate newDate(QDate) _freight setEffective(QDate) 155 289 177 392
    qt-client-4.1.0/guiclient/stable.h000066400000000000000000000007161217451700100170240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/guiclient/standardJournal.cpp000066400000000000000000000241441217451700100212410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "standardJournal.h" #include #include #include "standardJournalItem.h" standardJournal::standardJournal(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _stdjrnlid = -1; connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_stdjrnlitem, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(this, SIGNAL(rejected()), this, SLOT(sReject())); _stdjrnlitem->addColumn(tr("Account"), 200, Qt::AlignLeft, true, "account" ); _stdjrnlitem->addColumn(tr("Notes"), -1, Qt::AlignLeft, true, "note" ); _stdjrnlitem->addColumn(tr("Debit"), _priceColumn, Qt::AlignRight, true, "debit" ); _stdjrnlitem->addColumn(tr("Credit"), _priceColumn, Qt::AlignRight, true, "credit" ); _debits->setValidator(omfgThis->moneyVal()); _credits->setValidator(omfgThis->moneyVal()); } standardJournal::~standardJournal() { destroy(); // no need to delete child widgets, Qt does it all for us } void standardJournal::languageChange() { retranslateUi(this); } void standardJournal::sReject() { XSqlQuery standardReject; if (_mode == cNew) { standardReject.prepare( "DELETE FROM stdjrnlitem " "WHERE (stdjrnlitem_stdjrnl_id=:stdjrnl_id);" ); standardReject.bindValue(":stdjrnl_id", _stdjrnlid); standardReject.exec(); } } enum SetResponse standardJournal::set(const ParameterList &pParams) { XSqlQuery standardet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("stdjrnl_id", &valid); if (valid) { _stdjrnlid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; standardet.exec("SELECT NEXTVAL('stdjrnl_stdjrnl_id_seq') AS _stdjrnl_id"); if (standardet.first()) _stdjrnlid = standardet.value("_stdjrnl_id").toInt(); connect(_stdjrnlitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_stdjrnlitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_stdjrnlitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else if (param.toString() == "edit") { _mode = cEdit; connect(_stdjrnlitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_stdjrnlitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_stdjrnlitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else if (param.toString() == "view") { _mode = cView; connect(_stdjrnlitem, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _notes->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void standardJournal::sSave() { XSqlQuery standardSave; if (_name->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Standard Journal"), tr("You must enter a valid Name.") ); return; } standardSave.prepare( "SELECT stdjrnl_id" " FROM stdjrnl " " WHERE((UPPER(stdjrnl_name)=UPPER(:stdjrnl_name))" " AND (stdjrnl_id != :stdjrnl_id));" ); standardSave.bindValue(":stdjrnl_name", _name->text()); standardSave.bindValue(":stdjrnl_id", _stdjrnlid); standardSave.exec(); if (standardSave.first()) { QMessageBox::warning( this, tr("Cannot Save Standard Journal"), tr("The Name you have entered for this Standard Journal already exists. " "Please enter in a different Name for this Standard Journal.")); _name->setFocus(); return; } if (_mode == cNew) standardSave.prepare( "INSERT INTO stdjrnl " "(stdjrnl_id, stdjrnl_name, stdjrnl_descrip, stdjrnl_notes) " "VALUES " "(:stdjrnl_id, :stdjrnl_name, :stdjrnl_descrip, :stdjrnl_notes);" ); else if (_mode == cEdit) standardSave.prepare( "UPDATE stdjrnl " " SET stdjrnl_name=:stdjrnl_name, stdjrnl_descrip=:stdjrnl_descrip, stdjrnl_notes=:stdjrnl_notes " " WHERE (stdjrnl_id=:stdjrnl_id);" ); standardSave.bindValue(":stdjrnl_id", _stdjrnlid); standardSave.bindValue(":stdjrnl_name", _name->text()); standardSave.bindValue(":stdjrnl_descrip", _descrip->text()); standardSave.bindValue(":stdjrnl_notes", _notes->toPlainText()); standardSave.exec(); done(_stdjrnlid); } void standardJournal::sCheck() { XSqlQuery standardCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length())) { standardCheck.prepare( "SELECT stdjrnl_id" " FROM stdjrnl" " WHERE((UPPER(stdjrnl_name)=UPPER(:stdjrnl_name))" " AND (stdjrnl_id != :stdjrnl_id));" ); standardCheck.bindValue(":stdjrnl_name", _name->text()); standardCheck.bindValue(":stdjrnl_id", _stdjrnlid); standardCheck.exec(); if (standardCheck.first()) { _stdjrnlid = standardCheck.value("stdjrnl_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void standardJournal::sNew() { ParameterList params; params.append("mode", "new"); params.append("stdjrnl_id", _stdjrnlid); standardJournalItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournal::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("stdjrnlitem_id", _stdjrnlitem->id()); standardJournalItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournal::sView() { ParameterList params; params.append("mode", "view"); params.append("stdjrnlitem_id", _stdjrnlitem->id()); standardJournalItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void standardJournal::sDelete() { XSqlQuery standardDelete; standardDelete.prepare( "DELETE FROM stdjrnlitem " "WHERE (stdjrnlitem_id=:stdjrnlitem_id);" ); standardDelete.bindValue(":stdjrnlitem_id", _stdjrnlitem->id()); standardDelete.exec(); sFillList(); } void standardJournal::sFillList() { XSqlQuery standardFillList; standardFillList.prepare( "SELECT stdjrnlitem_id," " CASE WHEN(accnt_id IS NOT NULL) THEN (formatGLAccount(accnt_id) || '-' || accnt_descrip)" " ELSE 'ERROR - NO ACCOUNT SPECIFIED'" " END AS account," " firstLine(stdjrnlitem_notes) AS note," " CASE WHEN (stdjrnlitem_amount < 0) THEN (stdjrnlitem_amount * -1)" " ELSE NULL" " END AS debit," " CASE WHEN (stdjrnlitem_amount > 0) THEN (stdjrnlitem_amount)" " ELSE NULL" " END AS credit," " 'curr' AS debit_xtnumericrole," " 'curr' AS credit_xtnumericrole," " '' AS debit_xtnullrole," " '' AS credit_xtnullrole " " FROM stdjrnlitem LEFT OUTER JOIN accnt ON (stdjrnlitem_accnt_id=accnt_id)" " WHERE (stdjrnlitem_stdjrnl_id=:stdjrnl_id) " " ORDER BY accnt_number, accnt_profit, accnt_sub;" ); standardFillList.bindValue(":stdjrnl_id", _stdjrnlid); standardFillList.exec(); _stdjrnlitem->populate(standardFillList); standardFillList.prepare( "SELECT SUM( CASE WHEN (stdjrnlitem_amount < 0) THEN (stdjrnlitem_amount * -1)" " ELSE 0" " END ) AS debit," " SUM( CASE WHEN (stdjrnlitem_amount > 0) THEN stdjrnlitem_amount" " ELSE 0" " END ) AS credit," " (SUM(stdjrnlitem_amount) <> 0) AS oob " "FROM stdjrnlitem " "WHERE (stdjrnlitem_stdjrnl_id=:stdjrnl_id);" ); standardFillList.bindValue(":stdjrnl_id", _stdjrnlid); standardFillList.exec(); if (standardFillList.first()) { _debits->setDouble(standardFillList.value("debit").toDouble()); _credits->setDouble(standardFillList.value("credit").toDouble()); QString stylesheet; if (standardFillList.value("oob").toBool()) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); _debits->setStyleSheet(stylesheet); _credits->setStyleSheet(stylesheet); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } void standardJournal::populate() { XSqlQuery standardpopulate; standardpopulate.prepare( "SELECT stdjrnl_name, stdjrnl_descrip, stdjrnl_notes " "FROM stdjrnl " "WHERE (stdjrnl_id=:stdjrnl_id);" ); standardpopulate.bindValue(":stdjrnl_id", _stdjrnlid); standardpopulate.exec(); if (standardpopulate.first()) { _name->setText(standardpopulate.value("stdjrnl_name").toString()); _descrip->setText(standardpopulate.value("stdjrnl_descrip").toString()); _notes->setText(standardpopulate.value("stdjrnl_notes").toString()); sFillList(); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } qt-client-4.1.0/guiclient/standardJournal.h000066400000000000000000000023711217451700100207040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STANDARDJOURNAL_H #define STANDARDJOURNAL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_standardJournal.h" class standardJournal : public XDialog, public Ui::standardJournal { Q_OBJECT public: standardJournal(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~standardJournal(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sCheck(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sReject(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _stdjrnlid; }; #endif // STANDARDJOURNAL_H qt-client-4.1.0/guiclient/standardJournal.ui000066400000000000000000000414641217451700100211000ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. standardJournal 0 0 618 455 Standard Journal 5 5 0 7 0 0 0 5 0 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 16 10 Qt::Vertical QSizePolicy::Preferred 10 0 0 5 &Cancel &Save true 0 0 Transactions: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 7 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 27 16 0 5 0 0 Qt::Vertical QSizePolicy::Preferred 10 21 Totals: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 5 Debits Qt::AlignCenter Credits Qt::AlignCenter 0 5 false 5 0 0 0 80 32767 Qt::NoFocus Qt::AlignRight false 5 0 0 0 80 32767 Qt::NoFocus Qt::AlignRight Qt::Horizontal QSizePolicy::Preferred 20 16 0 0 0 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 10 21 0 0 Notes: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter XTreeWidget QTreeWidget
    xtreewidget.h
    0
    XLineEdit QLineEdit
    xlineedit.h
    0
    XTextEdit QTextEdit
    xtextedit.h
    _name _descrip _stdjrnlitem _new _edit _view _delete _notes _save _close _stdjrnlitem valid(bool) _view setEnabled(bool) 20 20 20 20 _close clicked() standardJournal reject() 20 20 20 20
    qt-client-4.1.0/guiclient/standardJournalGroup.cpp000066400000000000000000000232211217451700100222510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "standardJournalGroup.h" #include #include #include "standardJournalGroupItem.h" standardJournalGroup::standardJournalGroup(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _stdjrnlgrpid = -1; connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_showExpired, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_showFuture, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_stdjrnlgrpitem, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); setAcceptDrops(TRUE); _stdjrnlgrpitem->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "stdjrnl_name" ); _stdjrnlgrpitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "stdjrnl_descrip" ); _stdjrnlgrpitem->addColumn(tr("To Apply"), _dateColumn, Qt::AlignRight, true, "toapply" ); _stdjrnlgrpitem->addColumn(tr("Applied"), _dateColumn, Qt::AlignRight, true, "stdjrnlgrpitem_applied" ); _stdjrnlgrpitem->addColumn(tr("Effective"), _dateColumn, Qt::AlignCenter, true, "stdjrnlgrpitem_effective" ); _stdjrnlgrpitem->addColumn(tr("Expires"), _dateColumn, Qt::AlignCenter, true, "stdjrnlgrpitem_expires" ); } standardJournalGroup::~standardJournalGroup() { // no need to delete child widgets, Qt does it all for us } void standardJournalGroup::languageChange() { retranslateUi(this); } enum SetResponse standardJournalGroup::set(const ParameterList &pParams) { XSqlQuery standardet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("stdjrnlgrp_id", &valid); if (valid) { _stdjrnlgrpid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; standardet.exec("SELECT NEXTVAL('stdjrnlgrp_stdjrnlgrp_id_seq') AS _stdjrnlgrp_id;"); if (standardet.first()) _stdjrnlgrpid = standardet.value("_stdjrnlgrp_id").toInt(); // ToDo connect(_stdjrnlgrpitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_stdjrnlgrpitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_stdjrnlgrpitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else if (param.toString() == "edit") { _mode = cEdit; connect(_stdjrnlgrpitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_stdjrnlgrpitem, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_stdjrnlgrpitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); _new->setEnabled(FALSE); connect(_stdjrnlgrpitem, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } } return NoError; } void standardJournalGroup::sCheck() { XSqlQuery standardCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length() != 0)) { standardCheck.prepare( "SELECT stdjrnlgrp_id" " FROM stdjrnlgrp" " WHERE((UPPER(stdjrnlgrp_name)=UPPER(:stdjrnlgrp_name))" " AND (stdjrnlgrp_id != :stdjrnlgrp_id));" ); standardCheck.bindValue(":stdjrnlgrp_name", _name->text()); standardCheck.bindValue(":stdjrnlgrp_id", _stdjrnlgrpid); standardCheck.exec(); if (standardCheck.first()) { _stdjrnlgrpid = standardCheck.value("stdjrnlgrp_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void standardJournalGroup::sClose() { XSqlQuery standardClose; if (_mode == cNew) { standardClose.prepare( "DELETE FROM stdjrnlgrpitem " "WHERE (stdjrnlgrpitem_stdjrnlgrp_id=:stdjrnlgrp_id);" "DELETE FROM stdjrnlgrp " "WHERE (stdjrnlgrp_id=:stdjrnlgrp_id);" ); standardClose.bindValue(":stdjrnlgrp_id", _stdjrnlgrpid); standardClose.exec(); } reject(); } void standardJournalGroup::sSave() { XSqlQuery standardSave; if (_name->text().trimmed().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Standard Journal Group"), tr("You must enter a Name for this Standard Journal Group before you may save it.") ); _name->setFocus(); return; } standardSave.prepare( "SELECT stdjrnlgrp_id" " FROM stdjrnlgrp" " WHERE((UPPER(stdjrnlgrp_name)=UPPER(:stdjrnlgrp_name))" " AND (stdjrnlgrp_id != :stdjrnlgrp_id));" ); standardSave.bindValue(":stdjrnlgrp_name", _name->text()); standardSave.bindValue(":stdjrnlgrp_id", _stdjrnlgrpid); standardSave.exec(); if (standardSave.first()) { QMessageBox::warning(this, tr("Cannot Save Standard Journal Group"), tr("The Name you have entered for this Standard Journal Group is already in use. " "Please enter in a different Name for this Standard Journal Group.")); _name->setFocus(); return; } if (_mode == cNew) standardSave.prepare( "INSERT INTO stdjrnlgrp " "(stdjrnlgrp_id, stdjrnlgrp_name, stdjrnlgrp_descrip) " "VALUES " "(:stdjrnlgrp_id, :stdjrnlgrp_name, :stdjrnlgrp_descrip);" ); else standardSave.prepare( "UPDATE stdjrnlgrp " "SET stdjrnlgrp_name=:stdjrnlgrp_name, stdjrnlgrp_descrip=:stdjrnlgrp_descrip " "WHERE (stdjrnlgrp_id=:stdjrnlgrp_id);" ); standardSave.bindValue(":stdjrnlgrp_id", _stdjrnlgrpid); standardSave.bindValue(":stdjrnlgrp_name", _name->text()); standardSave.bindValue(":stdjrnlgrp_descrip", _descrip->text().trimmed()); standardSave.exec(); done(_stdjrnlgrpid); } void standardJournalGroup::sDelete() { XSqlQuery standardDelete; standardDelete.prepare( "DELETE FROM stdjrnlgrpitem " "WHERE (stdjrnlgrpitem_id=:stdjrnlgrpitem_id);" ); standardDelete.bindValue(":stdjrnlgrpitem_id", _stdjrnlgrpitem->id()); standardDelete.exec(); sFillList(); } void standardJournalGroup::sNew() { ParameterList params; params.append("mode", "new"); params.append("stdjrnlgrp_id", _stdjrnlgrpid); standardJournalGroupItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournalGroup::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("stdjrnlgrpitem_id", _stdjrnlgrpitem->id()); standardJournalGroupItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournalGroup::sView() { ParameterList params; params.append("mode", "view"); params.append("stdjrnlgrpitem_id", _stdjrnlgrpitem->id()); standardJournalGroupItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void standardJournalGroup::sFillList() { XSqlQuery standardFillList; QString sql( "SELECT stdjrnlgrpitem_id, stdjrnl_name, stdjrnl_descrip," " CASE WHEN (stdjrnlgrpitem_toapply=-1) THEN :always" " ELSE TEXT(stdjrnlgrpitem_toapply)" " END AS toapply," " stdjrnlgrpitem_applied," " stdjrnlgrpitem_effective, stdjrnlgrpitem_expires," " CASE WHEN (COALESCE(stdjrnlgrpitem_effective, startOfTime())=startOfTime()) THEN 'Always' END AS stdjrnlgrpitem_effective_qtdisplayrole," " CASE WHEN (COALESCE(stdjrnlgrpitem_expires, endOfTime())=endOfTime()) THEN 'Never' END AS stdjrnlgrpitem_expires_qtdisplayrole " "FROM stdjrnlgrpitem, stdjrnl " "WHERE ((stdjrnlgrpitem_stdjrnl_id=stdjrnl_id)" ); if (!_showExpired->isChecked()) sql += " AND (stdjrnlgrpitem_expires > CURRENT_DATE)" " AND ( (stdjrnlgrpitem_applied < stdjrnlgrpitem_toapply) OR (stdjrnlgrpitem_toapply = -1) )"; if (!_showFuture->isChecked()) sql += " AND (stdjrnlgrpitem_effective <= CURRENT_DATE)"; sql += " AND (stdjrnlgrpitem_stdjrnlgrp_id=:stdjrnlgrp_id) ) " "ORDER BY stdjrnl_name;"; standardFillList.prepare(sql); standardFillList.bindValue(":always", tr("Always")); standardFillList.bindValue(":stdjrnlgrp_id", _stdjrnlgrpid); standardFillList.exec(); _stdjrnlgrpitem->populate(standardFillList); } void standardJournalGroup::populate() { XSqlQuery standardpopulate; standardpopulate.prepare( "SELECT stdjrnlgrp_name, stdjrnlgrp_descrip " "FROM stdjrnlgrp " "WHERE (stdjrnlgrp_id=:stdjrnlgrp_id);" ); standardpopulate.bindValue(":stdjrnlgrp_id", _stdjrnlgrpid); standardpopulate.exec(); if (standardpopulate.first()) { _name->setText(standardpopulate.value("stdjrnlgrp_name").toString()); _descrip->setText(standardpopulate.value("stdjrnlgrp_descrip").toString()); sFillList(); } } qt-client-4.1.0/guiclient/standardJournalGroup.h000066400000000000000000000024431217451700100217210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STANDARDJOURNALGROUP_H #define STANDARDJOURNALGROUP_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_standardJournalGroup.h" class standardJournalGroup : public XDialog, public Ui::standardJournalGroup { Q_OBJECT public: standardJournalGroup(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~standardJournalGroup(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sClose(); virtual void sSave(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _stdjrnlgrpid; }; #endif // STANDARDJOURNALGROUP_H qt-client-4.1.0/guiclient/standardJournalGroup.ui000066400000000000000000000326061217451700100221130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. standardJournalGroup 0 0 638 300 Standard Journal Group 5 5 0 7 0 5 5 7 0 5 0 5 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Save true true Qt::Vertical QSizePolicy::Preferred 20 20 0 0 0 0 1 0 0 0 Show Expi&red Standard Journal Members Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 1 0 0 0 Show &Future Standard Journal Members Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 100 0 0 Member Items: 0 7 7 7 0 0 0 100 0 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 82 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    XLineEdit QLineEdit
    xlineedit.h
    0
    _name _descrip _showExpired _showFuture _stdjrnlgrpitem _new _edit _view _delete _save _close _stdjrnlgrpitem valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/standardJournalGroupItem.cpp000066400000000000000000000133231217451700100230720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "standardJournalGroupItem.h" #include #include standardJournalGroupItem::standardJournalGroupItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_limited, SIGNAL(toggled(bool)), _toApply, SLOT(setEnabled(bool))); connect(_stdjrnl, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _dates->setStartNull(tr("Always"), omfgThis->startOfTime(), TRUE); _dates->setStartCaption(tr("Effective")); _dates->setEndNull(tr("Never"), omfgThis->endOfTime(), TRUE); _dates->setEndCaption(tr("Expires")); _stdjrnl->populate( "SELECT stdjrnl_id, stdjrnl_name " "FROM stdjrnl " "ORDER BY stdjrnl_name;" ); } standardJournalGroupItem::~standardJournalGroupItem() { // no need to delete child widgets, Qt does it all for us } void standardJournalGroupItem::languageChange() { retranslateUi(this); } enum SetResponse standardJournalGroupItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("stdjrnlgrp_id", &valid); if (valid) _stdjrnlgrpid = param.toInt(); param = pParams.value("stdjrnlgrpitem_id", &valid); if (valid) { _stdjrnlgrpitemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _stdjrnl->setEnabled(FALSE); _dates->setEnabled(FALSE); _applyGroup->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void standardJournalGroupItem::sSave() { XSqlQuery standardSave; if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Effective Date"), tr("You must enter an effective date for this Standard Journal Group Item.") ); _dates->setFocus(); return; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter Expiration Date"), tr("You must enter an expiration date for this Standard Journal Group Item.") ); _dates->setFocus(); return; } if (_dates->endDate() < _dates->startDate()) { QMessageBox::critical( this, tr("Invalid Expiration Date"), tr("The expiration date cannot be earlier than the effective date.") ); _dates->setFocus(); return; } if (_mode == cNew) { standardSave.exec("SELECT NEXTVAL('stdjrnlgrpitem_stdjrnlgrpitem_id_seq') AS stdjrnlgrpitem_id;"); if (standardSave.first()) _stdjrnlgrpitemid = standardSave.value("stdjrnlgrpitem_id").toInt(); // ToDo standardSave.prepare( "INSERT INTO stdjrnlgrpitem " "( stdjrnlgrpitem_id, stdjrnlgrpitem_stdjrnlgrp_id, stdjrnlgrpitem_stdjrnl_id," " stdjrnlgrpitem_toapply, stdjrnlgrpitem_applied," " stdjrnlgrpitem_effective, stdjrnlgrpitem_expires )" "VALUES " "( :stdjrnlgrpitem_id, :stdjrnlgrpitem_stdjrnlgrp_id, :stdjrnlgrpitem_stdjrnl_id," " :stdjrnlgrpitem_toapply, 0," " :stdjrnlgrpitem_effective, :stdjrnlgrpitem_expires );" ); } else if (_mode == cEdit) standardSave.prepare( "UPDATE stdjrnlgrpitem " "SET stdjrnlgrpitem_toapply=:stdjrnlgrpitem_toapply," " stdjrnlgrpitem_effective=:stdjrnlgrpitem_effective, stdjrnlgrpitem_expires=:stdjrnlgrpitem_expires " "WHERE (stdjrnlgrpitem_id=:stdjrnlgrpitem_id);" ); standardSave.bindValue(":stdjrnlgrpitem_id", _stdjrnlgrpitemid); standardSave.bindValue(":stdjrnlgrpitem_stdjrnlgrp_id", _stdjrnlgrpid); standardSave.bindValue(":stdjrnlgrpitem_stdjrnl_id", _stdjrnl->id()); standardSave.bindValue(":stdjrnlgrpitem_toapply", ((_limited->isChecked()) ? _toApply->value() : -1)); standardSave.bindValue(":stdjrnlgrpitem_effective", _dates->startDate()); standardSave.bindValue(":stdjrnlgrpitem_expires", _dates->endDate()); standardSave.exec(); done(_stdjrnlgrpitemid); } void standardJournalGroupItem::sCheck() { } void standardJournalGroupItem::populate() { XSqlQuery standardpopulate; standardpopulate.prepare( "SELECT stdjrnlgrpitem_stdjrnl_id, stdjrnlgrpitem_toapply," " stdjrnlgrpitem_effective, stdjrnlgrpitem_expires " "FROM stdjrnlgrpitem " "WHERE (stdjrnlgrpitem_id=:stdjrnlgrpitem_id);" ); standardpopulate.bindValue(":stdjrnlgrpitem_id", _stdjrnlgrpitemid); standardpopulate.exec(); if (standardpopulate.first()) { _stdjrnl->setId(standardpopulate.value("stdjrnlgrpitem_stdjrnl_id").toInt()); _dates->setStartDate(standardpopulate.value("stdjrnlgrpitem_effective").toDate()); _dates->setEndDate(standardpopulate.value("stdjrnlgrpitem_expires").toDate()); if (standardpopulate.value("stdjrnlgrpitem_toapply").toInt() == -1) _unlimited->setChecked(TRUE); else { _limited->setChecked(TRUE); _toApply->setValue(standardpopulate.value("stdjrnlgrpitem_toapply").toInt()); } } } qt-client-4.1.0/guiclient/standardJournalGroupItem.h000066400000000000000000000022741217451700100225420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STANDARDJOURNALGROUPITEM_H #define STANDARDJOURNALGROUPITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_standardJournalGroupItem.h" class standardJournalGroupItem : public XDialog, public Ui::standardJournalGroupItem { Q_OBJECT public: standardJournalGroupItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~standardJournalGroupItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sCheck(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _stdjrnlgrpitemid; int _stdjrnlgrpid; }; #endif // STANDARDJOURNALGROUPITEM_H qt-client-4.1.0/guiclient/standardJournalGroupItem.ui000066400000000000000000000246511217451700100227330ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. standardJournalGroupItem 0 0 445 158 Standard Journal Group Item 5 7 0 0 0 5 0 5 Standard Journal: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 0 0 0 true 0 0 Qt::Horizontal QSizePolicy::Expanding 200 16 0 0 5 0 May be Applied any Amount of Times true 0 0 0 2 May only be applied false 999 1 Times Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Preferred 0 10 Qt::Horizontal QSizePolicy::Expanding 61 10 Qt::Vertical QSizePolicy::Expanding 16 16 0 0 0 5 &Cancel false &Save true Qt::Vertical QSizePolicy::Expanding 20 20 DateCluster QWidget
    datecluster.h
    0
    XComboBox QComboBox
    xcombobox.h
    0
    _stdjrnl _dates _unlimited _limited _toApply _save _close _limited toggled(bool) _toApply setEnabled(bool) 20 20 20 20 _stdjrnl valid(bool) _save setEnabled(bool) 20 20 20 20 _close clicked() standardJournalGroupItem reject() 20 20 20 20
    qt-client-4.1.0/guiclient/standardJournalGroups.cpp000066400000000000000000000076451217451700100224500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "standardJournalGroups.h" #include #include #include #include #include #include "postStandardJournalGroup.h" #include "standardJournalGroup.h" standardJournalGroups::standardJournalGroups(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_stdjrnlgrp, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_stdjrnlgrp, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); if (_privileges->check("MaintainStandardJournalGroups")) { connect(_stdjrnlgrp, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_stdjrnlgrp, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_stdjrnlgrp, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else _new->setEnabled(FALSE); if (_privileges->check("PostStandardJournalGroups")) connect(_stdjrnlgrp, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); _stdjrnlgrp->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "stdjrnlgrp_name" ); _stdjrnlgrp->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "stdjrnlgrp_descrip" ); sFillList(); } standardJournalGroups::~standardJournalGroups() { // no need to delete child widgets, Qt does it all for us } void standardJournalGroups::languageChange() { retranslateUi(this); } void standardJournalGroups::sNew() { ParameterList params; params.append("mode", "new"); standardJournalGroup newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournalGroups::sPost() { ParameterList params; params.append("stdjrnlgrp_id", _stdjrnlgrp->id()); postStandardJournalGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void standardJournalGroups::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("stdjrnlgrp_id", _stdjrnlgrp->id()); standardJournalGroup newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournalGroups::sView() { ParameterList params; params.append("mode", "view"); params.append("stdjrnlgrp_id", _stdjrnlgrp->id()); standardJournalGroup newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void standardJournalGroups::sDelete() { XSqlQuery standardDelete; standardDelete.prepare("SELECT deleteStandardJournalGroup(:stdjrnlgrp_id);"); standardDelete.bindValue(":stdjrnlgrp_id", _stdjrnlgrp->id()); standardDelete.exec(); sFillList(); } void standardJournalGroups::sFillList() { _stdjrnlgrp->populate( "SELECT stdjrnlgrp_id, stdjrnlgrp_name, stdjrnlgrp_descrip " "FROM stdjrnlgrp " "ORDER BY stdjrnlgrp_name;" ); } void standardJournalGroups::sPopulateMenu(QMenu *) { } void standardJournalGroups::sPrint() { orReport report("StandardJournalGroupMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/standardJournalGroups.h000066400000000000000000000022111217451700100220750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STANDARDJOURNALGROUPS_H #define STANDARDJOURNALGROUPS_H #include "guiclient.h" #include "xwidget.h" #include "ui_standardJournalGroups.h" class standardJournalGroups : public XWidget, public Ui::standardJournalGroups { Q_OBJECT public: standardJournalGroups(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~standardJournalGroups(); public slots: virtual void sNew(); virtual void sPost(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // STANDARDJOURNALGROUPS_H qt-client-4.1.0/guiclient/standardJournalGroups.ui000066400000000000000000000133401217451700100222700ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. standardJournalGroups 0 0 566 389 List Standard Journal Groups 0 0 Standard Journal Groups: 7 7 0 0 0 0 0 5 &Close &Print 0 0 &New false &Edit false &View false &Delete false Post Qt::Vertical QSizePolicy::Expanding 20 159 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _stdjrnlgrp _new _edit _view _delete _post _print _close _close clicked() standardJournalGroups close() 20 20 20 20 _stdjrnlgrp valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/standardJournalItem.cpp000066400000000000000000000120571217451700100220600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "standardJournalItem.h" #include #include #include standardJournalItem::standardJournalItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); } standardJournalItem::~standardJournalItem() { // no need to delete child widgets, Qt does it all for us } void standardJournalItem::languageChange() { retranslateUi(this); } enum SetResponse standardJournalItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("stdjrnl_id", &valid); if (valid) _stdjrnlid = param.toInt(); param = pParams.value("stdjrnlitem_id", &valid); if (valid) { _stdjrnlitemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _account->setEnabled(FALSE); _amount->setEnabled(FALSE); _senseGroup->setEnabled(FALSE); _notes->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void standardJournalItem::sSave() { XSqlQuery standardSave; double amount = _amount->baseValue(); if (_debit->isChecked()) amount *= -1; if (_amount->isZero()) { QMessageBox::warning( this, tr("Incomplete Data"), tr("You must enter an amount value.") ); _amount->setFocus(); return; } if(!_account->isValid()) { QMessageBox::warning( this, tr("Incomplete Data"), tr("You must enter an account.") ); return; } if (! _amount->isBase() && QMessageBox::question(this, tr("G/L Transaction Not In Base Currency"), tr("G/L transactions are recorded in the base currency.\n" "Do you wish to convert %1 %2 at the current rate?") .arg(_amount->localValue()).arg(_amount->currAbbr()), QMessageBox::Yes|QMessageBox::Escape, QMessageBox::No |QMessageBox::Default) != QMessageBox::Yes) { _amount->setFocus(); return; } if (_mode == cNew) { standardSave.exec("SELECT NEXTVAL('stdjrnlitem_stdjrnlitem_id_seq') AS stdjrnlitem_id;"); if (standardSave.first()) _stdjrnlitemid = standardSave.value("stdjrnlitem_id").toInt(); else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); standardSave.prepare( "INSERT INTO stdjrnlitem " "( stdjrnlitem_id, stdjrnlitem_stdjrnl_id, stdjrnlitem_accnt_id," " stdjrnlitem_amount, stdjrnlitem_notes ) " "VALUES " "( :stdjrnlitem_id, :stdjrnlitem_stdjrnl_id, :stdjrnlitem_accnt_id," " :stdjrnlitem_amount, :stdjrnlitem_notes );" ); } else if (_mode == cEdit) standardSave.prepare( "UPDATE stdjrnlitem " "SET stdjrnlitem_accnt_id=:stdjrnlitem_accnt_id," " stdjrnlitem_amount=:stdjrnlitem_amount," " stdjrnlitem_notes=:stdjrnlitem_notes " "WHERE (stdjrnlitem_id=:stdjrnlitem_id);" ); standardSave.bindValue(":stdjrnlitem_id", _stdjrnlitemid); standardSave.bindValue(":stdjrnlitem_stdjrnl_id", _stdjrnlid); standardSave.bindValue(":stdjrnlitem_accnt_id", _account->id()); standardSave.bindValue(":stdjrnlitem_amount", amount); standardSave.bindValue(":stdjrnlitem_notes", _notes->toPlainText().trimmed()); standardSave.exec(); done(_stdjrnlitemid); } void standardJournalItem::populate() { XSqlQuery standardpopulate; standardpopulate.prepare( "SELECT stdjrnlitem_accnt_id, stdjrnlitem_notes," " ABS(stdjrnlitem_amount) AS amount," " (stdjrnlitem_amount < 0) AS debit " "FROM stdjrnlitem " "WHERE (stdjrnlitem_id=:stdjrnlitem_id);" ); standardpopulate.bindValue(":stdjrnlitem_id", _stdjrnlitemid); standardpopulate.exec(); if (standardpopulate.first()) { _amount->setBaseValue(standardpopulate.value("amount").toDouble()); if (standardpopulate.value("debit").toBool()) _debit->setChecked(TRUE); else _credit->setChecked(TRUE); _account->setId(standardpopulate.value("stdjrnlitem_accnt_id").toInt()); _notes->setText(standardpopulate.value("stdjrnlitem_notes").toString()); } } qt-client-4.1.0/guiclient/standardJournalItem.h000066400000000000000000000021561217451700100215240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STANDARDJOURNALITEM_H #define STANDARDJOURNALITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_standardJournalItem.h" class standardJournalItem : public XDialog, public Ui::standardJournalItem { Q_OBJECT public: standardJournalItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~standardJournalItem(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _stdjrnlid; int _stdjrnlitemid; }; #endif // STANDARDJOURNALITEM_H qt-client-4.1.0/guiclient/standardJournalItem.ui000066400000000000000000000160351217451700100217130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. standardJournalItem 0 0 560 237 Standard Journal Item 7 5 0 0 0 Amount: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing Sense 0 5 Debit true Credit Qt::Horizontal QSizePolicy::Expanding 150 20 5 0 Account #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Notes: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter true 0 0 5 0 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 10 21 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    GLCluster QWidget
    glcluster.h
    XTextEdit QTextEdit
    xtextedit.h
    _amount _senseGroup _debit _account _notes _save _close parameter.h _close clicked() standardJournalItem reject() 20 20 20 20
    qt-client-4.1.0/guiclient/standardJournals.cpp000066400000000000000000000073311217451700100214230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "standardJournals.h" #include #include #include #include #include #include "postStandardJournal.h" #include "standardJournal.h" standardJournals::standardJournals(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_stdjrnl, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_stdjrnl, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); if (_privileges->check("MaintainStandardJournals")) { connect(_stdjrnl, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_stdjrnl, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_stdjrnl, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else _new->setEnabled(FALSE); if (_privileges->check("PostStandardJournals")) connect(_stdjrnl, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); _stdjrnl->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "stdjrnl_name" ); _stdjrnl->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "stdjrnl_descrip" ); sFillList(); } standardJournals::~standardJournals() { // no need to delete child widgets, Qt does it all for us } void standardJournals::languageChange() { retranslateUi(this); } void standardJournals::sNew() { ParameterList params; params.append("mode", "new"); standardJournal newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournals::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("stdjrnl_id", _stdjrnl->id()); standardJournal newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void standardJournals::sView() { ParameterList params; params.append("mode", "view"); params.append("stdjrnl_id", _stdjrnl->id()); standardJournal newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void standardJournals::sPost() { ParameterList params; params.append("stdjrnl_id", _stdjrnl->id()); postStandardJournal newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void standardJournals::sDelete() { XSqlQuery standardDelete; standardDelete.prepare("SELECT deleteStandardJournal(:stdjrnl_id);"); standardDelete.bindValue(":stdjrnl_id", _stdjrnl->id()); standardDelete.exec(); sFillList(); } void standardJournals::sFillList() { _stdjrnl->populate( "SELECT stdjrnl_id, stdjrnl_name, stdjrnl_descrip " "FROM stdjrnl " "ORDER BY stdjrnl_name;" ); } void standardJournals::sPopulateMenu(QMenu *) { } void standardJournals::sPrint() { orReport report("StandardJournalMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/standardJournals.h000066400000000000000000000021411217451700100210620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STANDARDJOURNALS_H #define STANDARDJOURNALS_H #include "guiclient.h" #include "xwidget.h" #include "ui_standardJournals.h" class standardJournals : public XWidget, public Ui::standardJournals { Q_OBJECT public: standardJournals(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~standardJournals(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPost(); virtual void sDelete(); virtual void sFillList(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // STANDARDJOURNALS_H qt-client-4.1.0/guiclient/standardJournals.ui000066400000000000000000000132671217451700100212630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. standardJournals 0 0 566 389 List Standard Journals 0 0 Standard Journals: 7 7 0 0 0 0 0 5 &Close &Print 0 0 &New false &Edit false &View false &Delete false Post Qt::Vertical QSizePolicy::Expanding 20 159 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _stdjrnl _new _edit _view _delete _post _print _close _close clicked() standardJournals close() 20 20 20 20 _stdjrnl valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/state.cpp000066400000000000000000000140161217451700100172230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its state. */ #include "state.h" #include #include #include state::state(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); _mode = cNew; setWindowModified(false); } state::~state() { // no need to delete child widgets, Qt does it all for us } void state::languageChange() { retranslateUi(this); } enum SetResponse state::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("country_id", &valid); if (valid) { _country->setId(param.toInt()); if (_country->isValid()) _country->setEnabled(false); } param = pParams.value("state_id", &valid); if (valid) { _stateid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; enableWindowModifiedSetting(); } else if (param.toString() == "edit") { _mode = cEdit; enableWindowModifiedSetting(); } else if (param.toString() == "view") { _mode = cView; _country->setEnabled(FALSE); _abbr->setEnabled(FALSE); _name->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void state::sSave() { XSqlQuery stateSave; _abbr->setText(_abbr->text().trimmed()); _name->setText(_name->text().trimmed()); struct { bool condition; QString msg; QWidget* widget; } error[] = { { (! _country->isValid()), tr("

    You must select a country."), _country }, { _name->text().isEmpty(), tr("

    You must enter a name for the state/province."), _name }, { true, "", NULL } }; // error[] int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::warning(this, tr("Cannot Save State/Province"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery stateq; stateq.prepare("SELECT state_id " "FROM state " "WHERE ((state_country_id=:country_id)" " AND ((UPPER(state_abbr)=UPPER(:state_abbr) AND :state_abbr != '')" " OR (UPPER(state_name)=UPPER(:state_name) AND :state_name != ''))" " AND (state_id!=:state_id));"); stateq.bindValue(":country_id", _country->id()); stateq.bindValue(":state_abbr", _abbr->text()); stateq.bindValue(":state_name", _name->text()); stateq.bindValue(":state_id", _stateid); stateq.exec(); if (stateq.first()) { QMessageBox::warning(this, tr("Cannot Save State/Province"), tr("There is already another state/province for %1 " "with the same name or abbreviation.") .arg(_country->currentText())); _abbr->setFocus(); return; } else if (stateq.lastError().type() != QSqlError::NoError) { systemError(this, stateq.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode == cNew) stateSave.prepare("INSERT INTO state (" " state_id, state_abbr, state_name, state_country_id" ") VALUES (" " DEFAULT, :state_abbr, :state_name, :country_id" ") RETURNING state_id;"); else if (_mode == cEdit) { stateSave.prepare("UPDATE state " "SET state_abbr=:state_abbr, state_name=:state_name," " state_country_id=:country_id " "WHERE (state_id=:state_id) RETURNING state_id;" ); stateSave.bindValue(":state_id", _stateid); } stateSave.bindValue(":state_abbr", _abbr->text().trimmed()); stateSave.bindValue(":state_name", _name->text().trimmed()); stateSave.bindValue(":country_id", _country->id()); stateSave.exec(); if (stateSave.first()) _stateid = stateSave.value("state_id").toInt(); else if (stateSave.lastError().type() != QSqlError::NoError) { systemError(this, stateSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_stateid); } void state::reject() { if (isWindowModified() && (cNew == _mode || cEdit == _mode) && QMessageBox::question(this, tr("Save?"), tr("

    Do you want to try saving this State/Province?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) sSave(); XDialog::reject(); } void state::populate() { XSqlQuery statepopulate; statepopulate.prepare("SELECT state_abbr, state_name, state_country_id" " FROM state" " WHERE (state_id=:state_id);"); statepopulate.bindValue(":state_id", _stateid); statepopulate.exec(); if (statepopulate.first()) { _abbr->setText(statepopulate.value("state_abbr").toString()); _name->setText(statepopulate.value("state_name").toString()); _country->setId(statepopulate.value("state_country_id").toInt()); } else if (statepopulate.lastError().type() != QSqlError::NoError) { systemError(this, statepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void state::enableWindowModifiedSetting() { connect(_abbr,SIGNAL(textEdited(const QString&)), this, SLOT(sDataChanged())); connect(_country, SIGNAL(newID(int)), this, SLOT(sDataChanged())); connect(_name,SIGNAL(textEdited(const QString&)), this, SLOT(sDataChanged())); } void state::sDataChanged() { setWindowModified(true); } qt-client-4.1.0/guiclient/state.h000066400000000000000000000023551217451700100166730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STATE_H #define STATE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_state.h" class state : public XDialog, public Ui::state { Q_OBJECT public: state(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~state(); Q_INVOKABLE virtual void enableWindowModifiedSetting(); Q_INVOKABLE int id() const { return _stateid; } public slots: virtual void reject(); virtual enum SetResponse set(const ParameterList &pParams); virtual void sDataChanged(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _stateid; QString _abbrCache; int _countryCache; QString _nameCache; }; #endif // STATE_H qt-client-4.1.0/guiclient/state.ui000066400000000000000000000114671217451700100170650ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. state 0 0 434 125 [*]State or Province Country: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _country [ pick a country ] XComboBox::Countries Abbreviation: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _abbr Qt::Horizontal 40 20 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Qt::Vertical 124 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XComboBox QComboBox

    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _country _abbr _name _buttonBox rejected() state reject() 387 64 216 62 qt-client-4.1.0/guiclient/states.cpp000066400000000000000000000112511217451700100174040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "states.h" #include #include #include #include #include #include #include "state.h" states::states(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_country,SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _state->addColumn(tr("Abbreviation"),_itemColumn, Qt::AlignLeft, true, "state_abbr"); _state->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "state_name"); _state->addColumn(tr("Country"), -1, Qt::AlignLeft, true, "country_name"); if (_privileges->check("MaintainStates")) { connect(_state, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_state, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_state, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_state, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } states::~states() { // no need to delete child widgets, Qt does it all for us } void states::languageChange() { retranslateUi(this); } void states::sFillList() { XSqlQuery statesFillList; MetaSQLQuery mql("SELECT state_id, state_abbr, state_name," " country_name" " FROM state JOIN country ON (state_country_id=country_id) " "" " WHERE (state_country_id=) " "" "ORDER BY country_name, state_name;"); ParameterList params; if (_country->id() >= 0) params.append("country_id", _country->id()); statesFillList = mql.toQuery(params); _state->populate(statesFillList); } void states::sDelete() { XSqlQuery statesDelete; statesDelete.prepare("SELECT EXISTS(SELECT 1" " FROM addr JOIN state ON (addr_state=state_abbr)" " WHERE ((addr_country=:country_name)" " AND (state_id=:state_id))) AS isused;"); statesDelete.bindValue(":state_id", _state->id()); statesDelete.bindValue(":country_name", _state->currentItem()->text("country_name")); statesDelete.exec(); if (statesDelete.first() && statesDelete.value("isused").toBool() && QMessageBox::question(this, tr("Delete State?"), tr("

    The state %1 is used in addresses. " "Are you sure you want to delete it?") .arg(_state->currentItem()->text("state_name")), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) return; else if (statesDelete.lastError().type() != QSqlError::NoError) { systemError(this, statesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } else if (QMessageBox::question(this, tr("Delete State?"), tr("

    Are you sure you want to delete this state?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No) return; statesDelete.prepare( "DELETE FROM state " "WHERE (state_id=:state_id);" ); statesDelete.bindValue(":state_id", _state->id()); statesDelete.exec(); sFillList(); } void states::sNew() { ParameterList params; params.append("mode", "new"); if (_country->isValid()) params.append("country_id", _country->id()); state newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void states::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("state_id", _state->id()); if (_country->isValid()) params.append("country_id", _country->id()); state newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); } void states::sView() { ParameterList params; params.append("mode", "view"); params.append("state_id", _state->id()); state newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/states.h000066400000000000000000000017101217451700100170500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef STATES_H #define STATES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_states.h" class states : public XWidget, public Ui::states { Q_OBJECT public: states(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~states(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); protected slots: virtual void languageChange(); }; #endif // STATES_H qt-client-4.1.0/guiclient/states.ui000066400000000000000000000127711217451700100172470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. states 0 0 600 400 List States and Provinces States and Provinces in: _state true [ All Countries ] XComboBox::Countries Qt::Horizontal 40 20 &Close Qt::Vertical QSizePolicy::Fixed 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 0 0 XComboBox QComboBox

    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _country _state _new _edit _view _delete _close parameter.h _close clicked() states close() 494 32 20 20 _state valid(bool) _view setEnabled(bool) 32 65 494 197 qt-client-4.1.0/guiclient/subAccntType.cpp000066400000000000000000000160161217451700100205110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "subAccntType.h" #include #include subAccntType::subAccntType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } subAccntType::~subAccntType() { // no need to delete child widgets, Qt does it all for us } void subAccntType::languageChange() { retranslateUi(this); } enum SetResponse subAccntType::set( const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("subaccnttype_id", &valid); if (valid) { _subaccnttypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _type->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void subAccntType::sSave() { XSqlQuery subSave; if (_mode == cEdit) { subSave.prepare( "SELECT subaccnttype_id " "FROM subaccnttype " "WHERE ( (subaccnttype_id<>:subaccnttype_id)" " AND (subaccnttype_code=:subaccnttype_code) );"); subSave.bindValue(":subaccnttype_id", _subaccnttypeid); subSave.bindValue(":subaccnttype_code", _code->text()); subSave.exec(); if (subSave.first()) { QMessageBox::critical( this, tr("Cannot Create Subaccount Type"), tr( "A Subaccount Type with the entered code already exists." "You may not create a Subaccount Type with this code." ) ); _code->setFocus(); return; } subSave.prepare( "UPDATE subaccnttype " "SET subaccnttype_code=:subaccnttype_code," " subaccnttype_descrip=:subaccnttype_descrip," " subaccnttype_accnt_type=:subaccnttype_accnt_type " "WHERE (subaccnttype_id=:subaccnttype_id);" ); subSave.bindValue(":subaccnttype_id", _subaccnttypeid); subSave.bindValue(":subaccnttype_code", _code->text()); subSave.bindValue(":subaccnttype_descrip", _description->text()); if (_type->currentIndex() == 0) subSave.bindValue(":subaccnttype_accnt_type", "A"); else if (_type->currentIndex() == 1) subSave.bindValue(":subaccnttype_accnt_type", "L"); else if (_type->currentIndex() == 2) subSave.bindValue(":subaccnttype_accnt_type", "E"); else if (_type->currentIndex() == 3) subSave.bindValue(":subaccnttype_accnt_type", "R"); else if (_type->currentIndex() == 4) subSave.bindValue(":subaccnttype_accnt_type", "Q"); subSave.exec(); } else if (_mode == cNew) { subSave.prepare( "SELECT subaccnttype_id " "FROM subaccnttype " "WHERE (subaccnttype_code=:subaccnttype_code);"); subSave.bindValue(":subaccnttype_code", _code->text().trimmed()); subSave.exec(); if (subSave.first()) { QMessageBox::critical( this, tr("Cannot Create Subaccount Type"), tr( "A Subaccount Type with the entered code already exists.\n" "You may not create a Subaccount Type with this code." ) ); _code->setFocus(); return; } subSave.exec("SELECT NEXTVAL('subaccnttype_subaccnttype_id_seq') AS subaccnttype_id;"); if (subSave.first()) _subaccnttypeid = subSave.value("subaccnttype_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } subSave.prepare( "INSERT INTO subaccnttype " "( subaccnttype_id, subaccnttype_code," " subaccnttype_descrip, subaccnttype_accnt_type ) " "VALUES " "( :subaccnttype_id, :subaccnttype_code, :subaccnttype_descrip, :subaccnttype_accnt_type );" ); subSave.bindValue(":subaccnttype_id", _subaccnttypeid); subSave.bindValue(":subaccnttype_code", _code->text()); subSave.bindValue(":subaccnttype_descrip", _description->text()); if (_type->currentIndex() == 0) subSave.bindValue(":subaccnttype_accnt_type", "A"); else if (_type->currentIndex() == 1) subSave.bindValue(":subaccnttype_accnt_type", "L"); else if (_type->currentIndex() == 2) subSave.bindValue(":subaccnttype_accnt_type", "E"); else if (_type->currentIndex() == 3) subSave.bindValue(":subaccnttype_accnt_type", "R"); else if (_type->currentIndex() == 4) subSave.bindValue(":subaccnttype_accnt_type", "Q"); subSave.exec(); } done(_subaccnttypeid); } void subAccntType::sCheck() { XSqlQuery subCheck; _code->setText(_code->text().trimmed()); // if ( (_mode == cNew) && (_code->text().length()) ) if (_code->text().length()) { subCheck.prepare( "SELECT subaccnttype_id " "FROM subaccnttype " "WHERE (subaccnttype_code=:subaccnttype_code);" ); subCheck.bindValue(":subaccnttype_code", _code->text()); subCheck.exec(); if (subCheck.first()) { _subaccnttypeid = subCheck.value("subaccnttype_id").toInt(); _mode = cEdit; populate(); // _code->setEnabled(FALSE); } } } void subAccntType::populate() { XSqlQuery subpopulate; subpopulate.prepare( "SELECT subaccnttype_code, subaccnttype_accnt_type, subaccnttype_descrip " "FROM subaccnttype " "WHERE (subaccnttype_id=:subaccnttype_id);" ); subpopulate.bindValue(":subaccnttype_id", _subaccnttypeid); subpopulate.exec(); if (subpopulate.first()) { _code->setText(subpopulate.value("subaccnttype_code").toString()); _description->setText(subpopulate.value("subaccnttype_descrip").toString()); if (subpopulate.value("subaccnttype_accnt_type").toString() == "A") _type->setCurrentIndex(0); else if (subpopulate.value("subaccnttype_accnt_type").toString() == "L") _type->setCurrentIndex(1); else if (subpopulate.value("subaccnttype_accnt_type").toString() == "E") _type->setCurrentIndex(2); else if (subpopulate.value("subaccnttype_accnt_type").toString() == "R") _type->setCurrentIndex(3); else if (subpopulate.value("subaccnttype_accnt_type").toString() == "Q") _type->setCurrentIndex(4); } } qt-client-4.1.0/guiclient/subAccntType.h000066400000000000000000000020641217451700100201540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUBACCNTTYPE_H #define SUBACCNTTYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_subAccntType.h" class subAccntType : public XDialog, public Ui::subAccntType { Q_OBJECT public: subAccntType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~subAccntType(); virtual SetResponse set( const ParameterList & pParams ); protected: int _mode; int _subaccnttypeid; protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); virtual void populate(); }; #endif // SUBACCNTTYPE_H qt-client-4.1.0/guiclient/subAccntType.ui000066400000000000000000000167401217451700100203500ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. subAccntType 0 0 495 116 Subaccount Type 11 6 0 0 0 5 0 0 Asset Liability Expense Revenue Equity Qt::Horizontal QSizePolicy::Expanding 305 16 Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 40 0 0 0 5 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit
    xlineedit.h
    0
    XComboBox QComboBox
    xcombobox.h
    0
    _code _type _description _save _close _close clicked() subAccntType reject() 20 20 20 20
    qt-client-4.1.0/guiclient/subAccntTypes.cpp000066400000000000000000000077331217451700100207020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "subAccntTypes.h" #include #include #include "subAccntType.h" #include subAccntTypes::subAccntTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_subaccnttypes, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_subaccnttypes, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_subaccnttypes, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _subaccnttypes->addColumn(tr("Code"), 70, Qt::AlignLeft, true, "subaccnttype_code" ); _subaccnttypes->addColumn(tr("Type"), 50, Qt::AlignLeft, true, "type" ); _subaccnttypes->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "subaccnttype_descrip" ); sFillList(); } subAccntTypes::~subAccntTypes() { // no need to delete child widgets, Qt does it all for us } void subAccntTypes::languageChange() { retranslateUi(this); } void subAccntTypes::sNew() { ParameterList params; params.append("mode", "new"); subAccntType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void subAccntTypes::sPrint() { orReport report("SubAccountTypeMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void subAccntTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("subaccnttype_id", _subaccnttypes->id()); subAccntType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void subAccntTypes::sDelete() { XSqlQuery subDelete; subDelete.prepare("SELECT deleteSubAccountType(:subaccnttype_id) AS result;"); subDelete.bindValue(":subaccnttype_id", _subaccnttypes->id()); subDelete.exec(); if(subDelete.first()) { switch(subDelete.value("result").toInt()) { case -1: QMessageBox::critical( this, tr("Cannot Delete G/L Subaccount Type"), tr( "The selected G/L Subaccount Type cannot be deleted as it is currently used in one or more G/L Accounts.\n" "You must reassign these G/L Accounts before you may delete the selected G/L Subaccount Type." ) ); break; default: sFillList(); } } } void subAccntTypes::sFillList() { XSqlQuery subFillList; subFillList.prepare( "SELECT subaccnttype_id, subaccnttype_code," " CASE WHEN(subaccnttype_accnt_type='A') THEN :asset" " WHEN(subaccnttype_accnt_type='L') THEN :liability" " WHEN(subaccnttype_accnt_type='E') THEN :expense" " WHEN(subaccnttype_accnt_type='R') THEN :revenue" " WHEN(subaccnttype_accnt_type='Q') THEN :equity" " ELSE :error" " END AS type, subaccnttype_descrip " "FROM subaccnttype " "ORDER BY subaccnttype_code; " ); subFillList.bindValue(":asset", tr("Asset")); subFillList.bindValue(":liability", tr("Liability")); subFillList.bindValue(":expense", tr("Expense")); subFillList.bindValue(":revenue", tr("Revenue")); subFillList.bindValue(":equity", tr("Equity")); subFillList.bindValue(":error", tr("ERROR")); subFillList.exec(); _subaccnttypes->populate(subFillList); } qt-client-4.1.0/guiclient/subAccntTypes.h000066400000000000000000000017631217451700100203440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUBACCNTTYPES_H #define SUBACCNTTYPES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_subAccntTypes.h" class subAccntTypes : public XWidget, public Ui::subAccntTypes { Q_OBJECT public: subAccntTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~subAccntTypes(); protected slots: virtual void languageChange(); virtual void sNew(); virtual void sPrint(); virtual void sEdit(); virtual void sDelete(); virtual void sFillList(); }; #endif // SUBACCNTTYPES_H qt-client-4.1.0/guiclient/subAccntTypes.ui000066400000000000000000000134551217451700100205330ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. subAccntTypes 0 0 568 400 List G/L Subaccount Types 0 0 G/L Subaccount Types: 7 7 0 0 0 5 &Close &Print 0 0 &New false &Edit false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _subaccnttypes _new _edit _delete _print _close parameter.h _subaccnttypes valid(bool) _delete setEnabled(bool) _subaccnttypes valid(bool) _edit setEnabled(bool) _subaccnttypes itemSelected(int) _edit animateClick() _close clicked() subAccntTypes close()
    qt-client-4.1.0/guiclient/subaccount.cpp000066400000000000000000000117151217451700100202540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "subaccount.h" #include #include #include subaccount::subaccount(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _number->setMaxLength(_metrics->value("GLSubaccountSize").toInt()); _cachedNumber = ""; } subaccount::~subaccount() { // no need to delete child widgets, Qt does it all for us } void subaccount::languageChange() { retranslateUi(this); } enum SetResponse subaccount::set(const ParameterList &pParams ) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("subaccnt_id", &valid); if (valid) { _subaccntid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(FALSE); _descrip->setEnabled(FALSE); _close->setText(tr("&Close")); } } return NoError; } void subaccount::sSave() { XSqlQuery subaccountSave; if (_number->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Sub Account"), tr("You must enter a valid Number.") ); return; } subaccountSave.prepare("SELECT subaccnt_id" " FROM subaccnt" " WHERE((subaccnt_id != :subaccnt_id)" " AND (subaccnt_number=:subaccnt_number))"); subaccountSave.bindValue(":subaccnt_id", _subaccntid); subaccountSave.bindValue(":subaccnt_number", _number->text()); subaccountSave.exec(); if(subaccountSave.first()) { QMessageBox::critical(this, tr("Duplicate Sub Account Number"), tr("A Sub Account Number already exists for the one specified.") ); return; } if (_mode == cNew) { subaccountSave.exec("SELECT NEXTVAL('subaccnt_subaccnt_id_seq') AS subaccnt_id;"); if (subaccountSave.first()) _subaccntid = subaccountSave.value("subaccnt_id").toInt(); else if (subaccountSave.lastError().type() != QSqlError::NoError) { systemError(this, subaccountSave.lastError().databaseText(), __FILE__, __LINE__); return; } subaccountSave.prepare( "INSERT INTO subaccnt " "( subaccnt_id, subaccnt_number, subaccnt_descrip ) " "VALUES " "( :subaccnt_id, :subaccnt_number, :subaccnt_descrip );" ); } else if (_mode == cEdit) { if (_number->text() != _cachedNumber && QMessageBox::question(this, tr("Change All Accounts?"), tr("

    The old Subaccount Number %1 might be " "used by existing Accounts. Would you like to " "change all accounts that use it to Subaccount" " Number %2?

    If you answer 'No' then change " "the Number back to %3 and Save again.") .arg(_cachedNumber) .arg(_number->text()) .arg(_cachedNumber), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; subaccountSave.prepare( "UPDATE subaccnt " "SET subaccnt_number=:subaccnt_number," " subaccnt_descrip=:subaccnt_descrip " "WHERE (subaccnt_id=:subaccnt_id);" ); } subaccountSave.bindValue(":subaccnt_id", _subaccntid); subaccountSave.bindValue(":subaccnt_number", _number->text()); subaccountSave.bindValue(":subaccnt_descrip", _descrip->toPlainText()); subaccountSave.exec(); if (subaccountSave.lastError().type() != QSqlError::NoError) { systemError(this, subaccountSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_subaccntid); } void subaccount::populate() { XSqlQuery subaccountpopulate; subaccountpopulate.prepare( "SELECT * " "FROM subaccnt " "WHERE (subaccnt_id=:subaccnt_id);" ); subaccountpopulate.bindValue(":subaccnt_id", _subaccntid); subaccountpopulate.exec(); if (subaccountpopulate.first()) { _number->setText(subaccountpopulate.value("subaccnt_number").toString()); _descrip->setText(subaccountpopulate.value("subaccnt_descrip").toString()); _cachedNumber = subaccountpopulate.value("subaccnt_number").toString(); } } qt-client-4.1.0/guiclient/subaccount.h000066400000000000000000000020511217451700100177120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUBACCOUNT_H #define SUBACCOUNT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_subaccount.h" class subaccount : public XDialog, public Ui::subaccount { Q_OBJECT public: subaccount(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~subaccount(); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _subaccntid; QString _cachedNumber; }; #endif // SUBACCOUNT_H qt-client-4.1.0/guiclient/subaccount.ui000066400000000000000000000133441217451700100201070ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. subaccount 0 0 434 138 Subaccount Number 5 7 0 5 0 5 Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 51 10 0 5 0 0 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 26 69 0 5 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 20 XLineEdit QLineEdit

    xlineedit.h
    0 XTextEdit QTextEdit
    xtextedit.h
    _number _descrip _save _close _close clicked() subaccount reject() 20 20 20 20 qt-client-4.1.0/guiclient/subaccounts.cpp000066400000000000000000000101021217451700100204240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "subaccounts.h" #include #include #include #include #include #include #include "storedProcErrorLookup.h" #include "subaccount.h" subaccounts::subaccounts(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_subaccnt, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainChartOfAccounts")) { connect(_subaccnt, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_subaccnt, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_subaccnt, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_subaccnt, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _subaccnt->addColumn(tr("Number"),_itemColumn, Qt::AlignCenter,true, "subaccnt_number"); _subaccnt->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "subaccnt_descrip"); sFillList(); } subaccounts::~subaccounts() { // no need to delete child widgets, Qt does it all for us } void subaccounts::languageChange() { retranslateUi(this); } void subaccounts::sNew() { ParameterList params; params.append("mode", "new"); subaccount *newdlg = new subaccount(this, "", TRUE); newdlg->set(params); if (newdlg->exec() != XDialog::Rejected) sFillList(); } void subaccounts::sEdit() { ParameterList params; params.append("subaccnt_id", _subaccnt->id()); params.append("mode", "edit"); subaccount *newdlg = new subaccount(this, "", TRUE); newdlg->set(params); if (newdlg->exec() != XDialog::Rejected) sFillList(); } void subaccounts::sView() { ParameterList params; params.append("subaccnt_id", _subaccnt->id()); params.append("mode", "view"); subaccount *newdlg = new subaccount(this, "", TRUE); newdlg->set(params); newdlg->exec(); } void subaccounts::sDelete() { XSqlQuery subaccountsDelete; subaccountsDelete.prepare( "SELECT deleteSubaccount(:id) AS result;"); subaccountsDelete.bindValue(":id", _subaccnt->id()); subaccountsDelete.exec(); if (subaccountsDelete.first()) { int result = subaccountsDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteSubaccount", result), __FILE__, __LINE__); return; } } else if (subaccountsDelete.lastError().type() != QSqlError::NoError) { systemError(this, subaccountsDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void subaccounts::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; pMenu->addAction("View...", this, SLOT(sView())); menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainChartOfAccounts")); menuItem = pMenu->addAction("Delete...", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainChartOfAccounts")); } void subaccounts::sFillList() { XSqlQuery subaccountsFillList; subaccountsFillList.prepare( "SELECT * " "FROM subaccnt " "ORDER BY subaccnt_number;" ); subaccountsFillList.exec(); _subaccnt->populate(subaccountsFillList); if (subaccountsFillList.lastError().type() != QSqlError::NoError) { systemError(this, subaccountsFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/subaccounts.h000066400000000000000000000020121217451700100200720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUBACCOUNTS_H #define SUBACCOUNTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_subaccounts.h" class subaccounts : public XWidget, public Ui::subaccounts { Q_OBJECT public: subaccounts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~subaccounts(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // SUBACCOUNTS_H qt-client-4.1.0/guiclient/subaccounts.ui000066400000000000000000000122371217451700100202720ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. subaccounts 0 0 374 394 List Subaccounts 0 0 Subaccount Numbers: 0 5 &Close 0 0 &New false &Edit false &View false &Delete 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _subaccnt _new _edit _view _delete _close _close clicked() subaccounts close() _subaccnt valid(bool) _view setEnabled(bool)
    qt-client-4.1.0/guiclient/submitAction.cpp000066400000000000000000000073541217451700100205530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "submitAction.h" #include #include #include submitAction::submitAction(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit())); _action->setText("Unknown"); } submitAction::~submitAction() { // no need to delete child widgets, Qt does it all for us } void submitAction::languageChange() { retranslateUi(this); } enum SetResponse submitAction::set(const ParameterList &pParams) { XSqlQuery submitet; XDialog::set(pParams); _params = pParams; QVariant param; bool valid; param = pParams.value("action_name", &valid); if(valid) _action->setText(param.toString()); param = pParams.value("responseEmail", &valid); if (valid) _email->setText(param.toString()); else { submitet.prepare( "SELECT usr_email " "FROM report, usr " "WHERE (usr_username=getEffectiveXtUser());" ); submitet.exec(); if (submitet.first()) _email->setText(submitet.value("usr_email").toString()); } return NoError; } void submitAction::sSubmit() { XSqlQuery submitSubmit; if (_email->text().trimmed().length() == 0) { QMessageBox::critical( this, tr("Cannot Submit Action"), tr("You must indicate an Email address to which the completed Action response will be sent.") ); _email->setFocus(); return; } if(!_asap->isChecked() && !_date->isValid()) { QMessageBox::critical( this, tr("Invalid Date"), tr("You must enter a valid date.") ); return; } if (_asap->isChecked()) submitSubmit.prepare("SELECT xtbatch.submitActionToBatch(:action, :emailAddress, " "CURRENT_TIMESTAMP) AS batch_id;"); else { submitSubmit.prepare("SELECT xtbatch.submitActionToBatch(:action, :emailAddress, :scheduled) AS batch_id;"); QDateTime scheduled; scheduled.setDate(_date->date()); scheduled.setTime(_time->time()); submitSubmit.bindValue(":scheduled", scheduled); } submitSubmit.bindValue(":action", _action->text()); submitSubmit.bindValue(":emailAddress", _email->text()); submitSubmit.exec(); if (submitSubmit.first()) { int batchid = submitSubmit.value("batch_id").toInt(); submitSubmit.prepare( "INSERT INTO xtbatch.batchparam " "( batchparam_batch_id, batchparam_order," " batchparam_name, batchparam_type, batchparam_value ) " "VALUES " "( :batchparam_batch_id, :batchparam_order," " :batchparam_name, :batchparam_type, :batchparam_value );" ); for (int counter = 0; counter < _params.count(); counter++) { submitSubmit.bindValue(":batchparam_batch_id", batchid); submitSubmit.bindValue(":batchparam_order", (counter + 1)); submitSubmit.bindValue(":batchparam_name", _params.name(counter)); QVariant v = _params.value(counter); submitSubmit.bindValue(":batchparam_type", QVariant::typeToName(v.type())); submitSubmit.bindValue(":batchparam_value", _params.value(counter).toString()); submitSubmit.exec(); } } else if (submitSubmit.lastError().type() != QSqlError::NoError) systemError(this, submitSubmit.lastError().databaseText(), __FILE__, __LINE__); accept(); } qt-client-4.1.0/guiclient/submitAction.h000066400000000000000000000017731217451700100202170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUBMITACTION_H #define SUBMITACTION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_submitAction.h" class submitAction : public XDialog, public Ui::submitAction { Q_OBJECT public: submitAction(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~submitAction(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSubmit(); protected slots: virtual void languageChange(); private: ParameterList _params; }; #endif // SUBMITACTION_H qt-client-4.1.0/guiclient/submitAction.ui000066400000000000000000000217621217451700100204050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. submitAction 0 0 441 148 Schedule Action with xTuple Connect 7 5 0 0 6 0 6 0 5 0 Action: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Response Email: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 6 0 _action 0 0 Scheduled 0 5 ASAP true 5 0 Scheduled: false false Qt::Horizontal QSizePolicy::Expanding 36 10 Qt::Vertical QSizePolicy::Expanding 16 16 0 0 5 0 &Cancel &Schedule true true Qt::Vertical QSizePolicy::Expanding 10 61 DLineEdit QWidget
    datecluster.h
    1
    XLineEdit QLineEdit
    xlineedit.h
    1
    _email _asap _scheduled _date _time _submit _close _scheduled toggled(bool) _time setEnabled(bool) 20 20 20 20 _scheduled toggled(bool) _date setEnabled(bool) 20 20 20 20 _close clicked() submitAction reject() 20 20 20 20
    qt-client-4.1.0/guiclient/submitReport.cpp000066400000000000000000000123331217451700100206020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "submitReport.h" #include #include #include submitReport::submitReport(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery submitubmitReport; setupUi(this); connect(_scheduled, SIGNAL(toggled(bool)), _time, SLOT(setEnabled(bool))); connect(_submit, SIGNAL(clicked()), this, SLOT(sSubmit())); connect(_scheduled, SIGNAL(toggled(bool)), _date, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _error = 0; submitubmitReport.exec( "SELECT usr_email " "FROM usr " "WHERE (usr_username=getEffectiveXtUser());" ); if (submitubmitReport.first()) _fromEmail->setText(submitubmitReport.value("usr_email")); } submitReport::~submitReport() { // no need to delete child widgets, Qt does it all for us } void submitReport::languageChange() { retranslateUi(this); } enum SetResponse submitReport::set(const ParameterList &pParams) { XSqlQuery submitet; XDialog::set(pParams); _params = pParams; QVariant param; bool valid; param = pParams.value("report_name", &valid); if (valid) { submitet.prepare( "SELECT report_name " "FROM report " "WHERE (report_name=:report_name);" ); submitet.bindValue(":report_name", param.toString()); submitet.exec(); if (submitet.first()) { _documentName->setText(submitet.value("report_name").toString()); _cachedReportName = submitet.value("report_name").toString(); } else _error = cNoReportDefinition; } param = pParams.value("report_id", &valid); if (valid) { submitet.prepare( "SELECT report_name " "FROM report " "WHERE (report_id=:report_id);" ); submitet.bindValue(":report_id", param.toInt()); submitet.exec(); if (submitet.first()) { _documentName->setText(submitet.value("report_name").toString()); _cachedReportName = submitet.value("report_name").toString(); } else _error = cNoReportDefinition; } param = pParams.value("responseEmail", &valid); if (valid) _email->setText(param.toString()); else { submitet.prepare( "SELECT usr_email " "FROM report, usr " "WHERE (usr_username=getEffectiveXtUser());" ); submitet.exec(); if (submitet.first()) _email->setText(submitet.value("usr_email").toString()); } param = pParams.value("responseBody", &valid); if (valid) _responseBody->setPlainText(param.toString()); return NoError; } int submitReport::check() { return _error; } void submitReport::sSubmit() { XSqlQuery submitSubmit; if (_email->text().trimmed().length() == 0) { QMessageBox::critical( this, tr("Cannot Submit Report"), tr("

    You must indicate an Email address to which " "the completed Report will be sent.") ); _email->setFocus(); return; } if (_asap->isChecked()) submitSubmit.prepare("SELECT submitReportToBatch(:reportName, :fromEmail, :emailAddress, '', :responseBody, '', CURRENT_TIMESTAMP) AS batch_id;"); else { submitSubmit.prepare("SELECT submitReportToBatch(:reportName, :fromEmail, :emailAddress, '', :responseBody, '', :scheduled) AS batch_id;"); QDateTime scheduled; scheduled.setDate(_date->date()); scheduled.setTime(_time->time()); submitSubmit.bindValue(":scheduled", scheduled); } submitSubmit.bindValue(":reportName", _cachedReportName); submitSubmit.bindValue(":fromEmail", _fromEmail->text()); submitSubmit.bindValue(":emailAddress", _email->text()); submitSubmit.bindValue(":responseBody", _responseBody->toPlainText()); submitSubmit.exec(); if (submitSubmit.first()) { int batchid = submitSubmit.value("batch_id").toInt(); submitSubmit.prepare( "INSERT INTO batchparam " "( batchparam_batch_id, batchparam_order," " batchparam_name, batchparam_type, batchparam_value ) " "VALUES " "( :batchparam_batch_id, :batchparam_order," " :batchparam_name, :batchparam_type, :batchparam_value );" ); for (int counter = 0; counter < _params.count(); counter++) { submitSubmit.bindValue(":batchparam_batch_id", batchid); submitSubmit.bindValue(":batchparam_order", (counter + 1)); submitSubmit.bindValue(":batchparam_name", _params.name(counter)); QVariant v = _params.value(counter); submitSubmit.bindValue(":batchparam_type", QVariant::typeToName(v.type())); submitSubmit.bindValue(":batchparam_value", XVariant::encode(v)); submitSubmit.exec(); } } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); accept(); } qt-client-4.1.0/guiclient/submitReport.h000066400000000000000000000021251217451700100202450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUBMITREPORT_H #define SUBMITREPORT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_submitReport.h" class submitReport : public XDialog, public Ui::submitReport { Q_OBJECT public: submitReport(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~submitReport(); Q_INVOKABLE virtual int check(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSubmit(); protected slots: virtual void languageChange(); private: QString _cachedReportName; int _error; ParameterList _params; }; #endif // SUBMITREPORT_H qt-client-4.1.0/guiclient/submitReport.ui000066400000000000000000000245101217451700100204350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. submitReport 0 0 443 302 Schedule Report with xTuple Connect 5 5 7 0 0 0 Scheduled 0 5 ASAP true 5 0 Scheduled: false false Qt::Horizontal QSizePolicy::Expanding 36 10 0 0 5 0 &Cancel &Schedule true true Qt::Vertical QSizePolicy::Preferred 10 0 0 6 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Response Email To: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 76 10 Document Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Email From: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 76 10 0 0 Response Body: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter DLineEdit QWidget

    datecluster.h
    XLineEdit QLineEdit
    xlineedit.h
    _asap _scheduled _date _time _email _responseBody _submit _close _scheduled toggled(bool) _time setEnabled(bool) 20 20 20 20 _scheduled toggled(bool) _date setEnabled(bool) 20 20 20 20 _close clicked() submitReport reject() 20 20 20 20 qt-client-4.1.0/guiclient/substituteList.cpp000066400000000000000000000212341217451700100211520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "substituteList.h" #include #include substituteList::substituteList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); QButtonGroup * showByButtonGroup = new QButtonGroup(this); showByButtonGroup->addButton(_byLeadTime); showByButtonGroup->addButton(_byDays); showByButtonGroup->addButton(_byDate); // signals and slots connections connect(_byDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool))); connect(_byDate, SIGNAL(toggled(bool)), _date, SLOT(setEnabled(bool))); connect(_subs, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_subs, SIGNAL(itemSelected(int)), _select, SLOT(animateClick())); connect(showByButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(sFillList())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int))); connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int))); _subs->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _subs->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" ); _subs->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh" ); _subs->addColumn(tr("Norm. QOH"), _qtyColumn, Qt::AlignRight, true, "normqoh" ); _subs->addColumn(tr("Availability"), _qtyColumn, Qt::AlignRight, true, "available" ); _subs->addColumn(tr("Norm. Avail."), _qtyColumn, Qt::AlignRight, true, "normavailable" ); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } substituteList::~substituteList() { // no need to delete child widgets, Qt does it all for us } void substituteList::languageChange() { retranslateUi(this); } enum SetResponse substituteList::set(const ParameterList &pParams) { XSqlQuery substituteet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("womatl_id", &valid); if (valid) { substituteet.prepare( "SELECT womatl_itemsite_id," " bomitem_id, COALESCE(bomitem_subtype, 'I') AS subtype," " COALESCE(wo_id, 0) AS wo_id " "FROM womatl LEFT OUTER JOIN bomitem ON (bomitem_id=womatl_bomitem_id) " " LEFT OUTER JOIN wo ON ( (wo_ordtype='W') AND" " (wo_ordid=womatl_wo_id) AND" " (wo_itemsite_id=womatl_itemsite_id) ) " "WHERE (womatl_id=:womatl_id);" ); substituteet.bindValue(":womatl_id", param.toInt()); substituteet.exec(); if (substituteet.first()) { if (substituteet.value("wo_id").toInt() > 0) { QMessageBox::warning(this, tr("Child Work Order"), tr("A child Work Order exists for this Material \n" "Requirement. You should delete this \n" "child Work Order before substituting.") ); } _item->setItemsiteid(substituteet.value("womatl_itemsite_id").toInt()); _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _bomitemid = substituteet.value("bomitem_id").toInt(); _itemsiteid = substituteet.value("womatl_itemsite_id").toInt(); _source = substituteet.value("subtype").toString(); sFillList(); } } _byLeadTime->setChecked(pParams.inList("byLeadTime")); param = pParams.value("byDays", &valid); if (valid) { _byDays->setChecked(TRUE); _days->setValue(param.toInt()); } param = pParams.value("byDate", &valid); if (valid) { _byDate->setChecked(TRUE); _date->setDate(param.toDate()); } if (pParams.inList("run")) { sFillList(); return NoError_Run; } return NoError; } void substituteList::sSelect() { if (_sub.findFirst("item_id", _subs->id()) != -1) { _uomratio = _sub.value("uomratio").toDouble(); done(_subs->id()); } else reject(); } void substituteList::sFillList() { _subs->clear(); QString sql; if (_source == "I") { sql = "SELECT item_id, item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " (itemsite_qtyonhand) AS qoh," " (itemsite_qtyonhand * uomratio) AS normqoh," " (available) AS available," " (available * uomratio) AS normavailable," " uomratio," " 'qty' AS qoh_xtnumericrole," " 'qty' AS normqoh_xtnumericrole," " 'qty' AS available_xtnumericrole," " 'qty' AS normavailable_xtnumericrole " "FROM ( SELECT item_id, item_number, item_descrip1, item_descrip2," " itemsite_qtyonhand, itemsub_uomratio AS uomratio, itemsub_rank AS rank,"; if (_byLeadTime->isChecked()) sql += " qtyAvailable(itemsite_id, itemsite_leadtime) AS available "; else if (_byDays->isChecked()) sql += " qtyAvailable(itemsite_id, :days) AS available "; else if (_byDate->isChecked()) sql += " qtyAvailable(itemsite_id, (:date - CURRENT_DATE)) AS available "; sql += "FROM item, itemsite, itemsub " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_item_id=itemsub_sub_item_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (itemsub_parent_item_id=:item_id) ) ) AS data " "ORDER BY rank"; } else if (_source == "B") { sql = "SELECT item_id, item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " (itemsite_qtyonhand) AS qoh," " (itemsite_qtyonhand * uomratio) AS normqoh," " (available) AS available," " (available * uomratio) AS normavailable," " uomratio," " 'qty' AS qoh_xtnumericrole," " 'qty' AS normqoh_xtnumericrole," " 'qty' AS available_xtnumericrole," " 'qty' AS normavailable_xtnumericrole " "FROM ( SELECT item_id, item_number, item_descrip1, item_descrip2," " itemsite_qtyonhand, bomitemsub_uomratio AS uomratio, bomitemsub_rank AS rank,"; if (_byLeadTime->isChecked()) sql += " qtyAvailable(itemsite_id, itemsite_leadtime) AS available "; else if (_byDays->isChecked()) sql += " qtyAvailable(itemsite_id, :days) AS available "; else if (_byDate->isChecked()) sql += " qtyAvailable(itemsite_id, (:date - CURRENT_DATE)) AS available "; sql += "FROM item, itemsite, bomitemsub " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_item_id=bomitemsub_item_id)" " AND (bomitemsub_bomitem_id=:bomitem_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (itemsite_id<>:itemsite_id) ) " "UNION " "SELECT item_id, item_number, item_descrip1, item_descrip2," " si.itemsite_qtyonhand, 1/bomitemsub_uomratio AS uomratio, 0 AS rank,"; if (_byLeadTime->isChecked()) sql += " qtyAvailable(si.itemsite_id, si.itemsite_leadtime) AS available "; else if (_byDays->isChecked()) sql += " qtyAvailable(si.itemsite_id, :days) AS available "; else if (_byDate->isChecked()) sql += " qtyAvailable(si.itemsite_id, (:date - CURRENT_DATE)) AS available "; sql += "FROM item, itemsite bi, bomitem, itemsite si, bomitemsub " "WHERE ( (bi.itemsite_item_id=item_id)" " AND (bi.itemsite_item_id=bomitem_item_id)" " AND (bomitem_id=:bomitem_id)" " AND (bi.itemsite_warehous_id=:warehous_id)" " AND (si.itemsite_id=:itemsite_id)" " AND (si.itemsite_item_id=bomitemsub_item_id)" " AND (bomitemsub_bomitem_id=:bomitem_id) ) " " ) AS data " "ORDER BY rank"; } _sub.prepare(sql); _sub.bindValue(":warehous_id", _warehouse->id()); _sub.bindValue(":item_id", _item->id()); _sub.bindValue(":bomitem_id", _bomitemid); _sub.bindValue(":itemsite_id", _itemsiteid); if (_byDays->isChecked()) _sub.bindValue(":days", _days->value()); if (_byDate->isChecked()) _sub.bindValue(":date", _date->date()); _sub.exec(); _subs->populate(_sub); } qt-client-4.1.0/guiclient/substituteList.h000066400000000000000000000021721217451700100206170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUBSTITUTELIST_H #define SUBSTITUTELIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_substituteList.h" class substituteList : public XDialog, public Ui::substituteList { Q_OBJECT public: substituteList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~substituteList(); double _uomratio; public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sSelect(); virtual void sFillList(); protected slots: virtual void languageChange(); private: XSqlQuery _sub; QString _source; int _bomitemid; int _itemsiteid; }; #endif // SUBSTITUTELIST_H qt-client-4.1.0/guiclient/substituteList.ui000066400000000000000000000321421217451700100210050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. substituteList 0 0 654 316 Substitute List 5 5 0 7 0 5 0 0 0 6 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::MinimumExpanding 41 10 0 0 0 0 0 0 0 0 32767 32767 Show Availability as of: 5 0 Item Site Lead Time true 0 5 true Look Ahead Days: false 1000 0 0 5 Date: 0 0 false Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 Qt::Vertical QSizePolicy::Preferred 16 0 0 0 0 5 &Cancel false &Select true true Qt::Vertical QSizePolicy::Preferred 10 45 0 0 Substitutions: _item 7 7 0 0 0 100 ItemCluster QWidget
    itemcluster.h
    WComboBox XComboBox
    wcombobox.h
    DLineEdit XLineEdit
    datecluster.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _item _warehouse _byLeadTime _byDays _days _byDate _date _subs _select _close _byDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _byDate toggled(bool) _date setEnabled(bool) 20 20 20 20 _subs valid(bool) _select setEnabled(bool) 20 20 20 20 _subs itemSelected(int) _select animateClick() 20 20 20 20 _close clicked() substituteList reject() 20 20 20 20 _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20
    qt-client-4.1.0/guiclient/summarizeInvTransByClassCode.cpp000066400000000000000000000051371217451700100236640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "summarizeInvTransByClassCode.h" #include #include summarizeInvTransByClassCode::summarizeInvTransByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_summarize, SIGNAL(clicked()), this, SLOT(sSummarize())); _classCode->setType(ParameterGroup::ClassCode); } summarizeInvTransByClassCode::~summarizeInvTransByClassCode() { // no need to delete child widgets, Qt does it all for us } void summarizeInvTransByClassCode::languageChange() { retranslateUi(this); } void summarizeInvTransByClassCode::sSummarize() { XSqlQuery summarizeSummarize; if ( QMessageBox::warning( this, tr("Summarize Inventory Transactions?"), tr( "

    You are about to summarize Inventory Transactions for the selected Site and Class Code(s). " "Summarizing Inventory Transactions will delete any detailed Transaction information.
    " "Are you sure that you want to summarize the selected Transactions?

    " ), tr("&Yes"), tr("&No"), QString::null, 0, 1) == 1) { reject(); return; } QString sql( "SELECT summarizeTransactions(itemsite_id, :startDate, :endDate) AS result " "FROM itemsite, item " "WHERE ( (itemsite_item_id=item_id)" ); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += ");"; summarizeSummarize.prepare(sql); _warehouse->bindValue(summarizeSummarize); _classCode->bindValue(summarizeSummarize); _dates->bindValue(summarizeSummarize); summarizeSummarize.exec(); QMessageBox::information( this, tr("Summary Complete"), tr("The selected Inventory Transactions have been summarized.") ); } qt-client-4.1.0/guiclient/summarizeInvTransByClassCode.h000066400000000000000000000020041217451700100233170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SUMMARIZEINVTRANSBYCLASSCODE_H #define SUMMARIZEINVTRANSBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_summarizeInvTransByClassCode.h" class summarizeInvTransByClassCode : public XDialog, public Ui::summarizeInvTransByClassCode { Q_OBJECT public: summarizeInvTransByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~summarizeInvTransByClassCode(); public slots: virtual void sSummarize(); protected slots: virtual void languageChange(); }; #endif // SUMMARIZEINVTRANSBYCLASSCODE_H qt-client-4.1.0/guiclient/summarizeInvTransByClassCode.ui000066400000000000000000000132511217451700100235130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. summarizeInvTransByClassCode 0 0 776 286 Summarize Inventory Transactions by Class Code 12 12 false Qt::Horizontal QSizePolicy::Expanding 36 20 false Qt::Vertical 20 0 Qt::Horizontal 0 20 5 &Cancel Summari&ze true true Qt::Vertical QSizePolicy::Expanding 20 0 DateCluster QWidget
    datecluster.h
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _classCode _summarize _close _close clicked() summarizeInvTransByClassCode reject() 20 20 20 20
    qt-client-4.1.0/guiclient/syncCompanies.cpp000066400000000000000000001127411217451700100207220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "syncCompanies.h" #include #include #include #include #include #include #include #include #include #include #include "login2.h" #include "storedProcErrorLookup.h" #define DEBUG false // TODO: XDialog should have a default implementation that returns FALSE bool syncCompanies::userHasPriv(const int pMode) { if (DEBUG) qDebug("syncCompanies::userHasPriv(%d)", pMode); bool retval = _privileges->check("SynchronizeCompanies"); if (DEBUG) qDebug("syncCompanies::userHasPriv(%d) returning %d", pMode, retval); return retval; } // TODO: this code really belongs in XWidget void syncCompanies::setVisible(bool visible) { if (DEBUG) qDebug("syncCompanies::setVisible(%d) called", visible); if (! visible) XWidget::setVisible(false); else if (! userHasPriv()) { systemError(this, tr("You do not have sufficient privilege to view this window"), __FILE__, __LINE__); deleteLater(); } else XWidget::setVisible(true); } syncCompanies::syncCompanies(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_company, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_period, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_sync, SIGNAL(clicked()), this, SLOT(sSync())); _company->addColumn(tr("Number"), _itemColumn, Qt::AlignCenter,true, "company_number" ); _company->addColumn(tr("Currency"),_itemColumn, Qt::AlignLeft, true, "company_curr"); _company->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "company_descrip"); _company->addColumn(tr("Server"), _itemColumn, Qt::AlignLeft, false, "company_server"); _company->addColumn(tr("Port"), _itemColumn, Qt::AlignRight,false, "company_port"); _company->addColumn(tr("Database"),_itemColumn, Qt::AlignLeft, false, "company_database"); _period->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "period_name"); _period->addColumn(tr("Start"),_dateColumn, Qt::AlignCenter, true, "period_start"); _period->addColumn(tr("End"), _dateColumn, Qt::AlignCenter, true, "period_end"); _period->addColumn(tr("Closed"), _ynColumn, Qt::AlignCenter, true, "period_closed"); sFillList(); } syncCompanies::~syncCompanies() { // no need to delete child widgets, Qt does it all for us } void syncCompanies::languageChange() { retranslateUi(this); } void syncCompanies::sFillList() { XSqlQuery syncFillList; syncFillList.exec("SELECT * " "FROM period " "ORDER BY period_start, period_end;"); syncFillList.exec(); _period->populate(syncFillList); if (syncFillList.lastError().type() != QSqlError::NoError) { systemError(this, syncFillList.lastError().databaseText(), __FILE__, __LINE__); return; } syncFillList.prepare("SELECT *, company_id AS company_number_xtidrole, " " currconcat(company_curr_id) AS company_curr, " " company_curr_id AS company_curr_xtidrole " "FROM company " "WHERE company_external " "ORDER BY company_number;" ); syncFillList.exec(); _company->populate(syncFillList); if (syncFillList.lastError().type() != QSqlError::NoError) { systemError(this, syncFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void syncCompanies::sSync() { XSqlQuery syncSync; if (DEBUG) qDebug("syncCompanies::sSync()"); QProgressDialog progress; progress.setWindowModality(Qt::ApplicationModal); progress.setAutoClose(false); XSqlQuery lbaseq; lbaseq.exec("SELECT * FROM curr_symbol WHERE curr_base;"); if (lbaseq.first()) ; // keep the query results for later comparisons else if (lbaseq.lastError().type() != QSqlError::NoError) { systemError(this, lbaseq.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::warning(this, tr("No Base Currency"), tr("

    The parent database does not appear to have " "a base currency defined. The data cannot safely " "be synchronized.")); return; } int errorCount = 0; QList company = _company->selectedItems(); for (int i = 0; i < company.size(); i++) { XTreeWidgetItem *c = (XTreeWidgetItem*)(company[i]); if (DEBUG) qDebug("syncCompanies:sSync() i %d, c %p", i, c); XSqlQuery co; co.prepare("SELECT COALESCE(company_unrlzgainloss_accnt_id,-1) AS company_unrlzgainloss_accnt_id, " "COALESCE(company_curr_id,-1) AS company_curr_id, " "COALESCE(company_yearend_accnt_id,-1) AS company_yearend_accnt_id, " "COALESCE(company_gainloss_accnt_id,-1) AS company_gainloss_accnt_id, " "COALESCE(company_dscrp_accnt_id,-1) AS company_dscrp_accnt_id " "FROM company WHERE (company_id=:company_id);"); co.bindValue(":company_id", c->id()); co.exec(); if (co.first()) { if (co.value("company_yearend_accnt_id").toInt() == -1 || co.value("company_gainloss_accnt_id").toInt() == -1 || co.value("company_dscrp_accnt_id").toInt() == -1) { QMessageBox::warning(this, tr("No Discrepency Account"), tr("Company %1 does not appear to have " "all required Accounts defined. The " "data cannot safely be synchronized.") .arg(c->rawValue("company_number").toString())); errorCount++; continue; } else if (co.value("company_curr_id").toInt() != CurrCluster::baseId() && co.value("company_unrlzgainloss_accnt_id").toInt() == -1) { QMessageBox::warning(this, tr("No Gain/Loss Account"), tr("Company %1 does not appear to have " "an unrealized Gain/Loss Account defined. The " "data cannot safely be synchronized.") .arg(c->rawValue("company_number").toString())); errorCount++; continue; } } else if (co.lastError().type() != QSqlError::NoError) { systemError(this, co.lastError().databaseText(), __FILE__, __LINE__); errorCount++; continue; } QString dbURL; QString protocol = "psql"; QString host = c->rawValue("company_server").toString(); QString db = c->rawValue("company_database").toString(); QString port = c->rawValue("company_port").toString(); int currid = c->id("company_curr"); if(DEBUG) { qDebug() << ""; qDebug() << "syncCompanies: database information-------------------"; qDebug() << "syncCompanies: host [ " << host << " ]"; qDebug() << "syncCompanies: db [ " << db << " ]"; qDebug() << "syncCompanies: port [ " << port << " ]"; qDebug() << "syncCompanies: id [ " << currid << " ]"; qDebug() << "syncCompanies: protocol [ " << protocol << " ]"; qDebug() << "syncCompanies: ---------------------------------------"; qDebug() << ""; } if (progress.wasCanceled()) break; buildDatabaseURL(dbURL, protocol, host, db, port); if (DEBUG) qDebug("syncCompanies::sSync() dbURL before login2 = %s", qPrintable(dbURL)); progress.setLabelText(tr("Synchronizing Company %1 (%2)") .arg(c->rawValue("company_number").toString()) .arg(dbURL)); ParameterList params; params.append("databaseURL", dbURL); params.append("multipleConnections"); login2 newdlg(this, "testLogin", false); // disallow changing connection info newdlg._options->setEnabled(false); //newdlg._demoOption->setEnabled(false); //newdlg._otherOption->setEnabled(false); newdlg.set(params); if (newdlg.exec() == QDialog::Rejected) { QMessageBox::warning(this, tr("Skipping Database"), tr("

    Company %1 (database %2) will be " "skipped at the user's request.") .arg(c->rawValue("company_number").toString()) .arg(c->rawValue("company_database").toString())); errorCount++; continue; } dbURL = newdlg._databaseURL; if (DEBUG) qDebug("syncCompanies::sSync() dbURL after login2 = %s", qPrintable(dbURL)); parseDatabaseURL(dbURL, protocol, host, db, port); QSqlDatabase testDB = QSqlDatabase::addDatabase("QPSQL7", db); testDB.setHostName(host); testDB.setDatabaseName(db); testDB.setUserName(newdlg.username()); testDB.setPassword(newdlg.password()); testDB.setPort(port.toInt()); if (testDB.open()) { if (DEBUG) qDebug("syncCompanies::sSync() opened testDB!"); XSqlQuery rmq(testDB); rmq.prepare("SELECT usrpriv_id " "FROM usrpriv JOIN priv ON (usrpriv_priv_id=priv_id) " "WHERE ((usrpriv_username=:username)" " AND (priv_name='MaintainChartOfAccounts')) " "UNION " "SELECT priv_id" " FROM priv, grppriv, usrgrp" " WHERE((usrgrp_grp_id=grppriv_grp_id)" " AND (grppriv_priv_id=priv_id)" " AND (usrgrp_username=:username)" " AND (priv_name='MaintainChartOfAccounts')) ;"); rmq.bindValue(":username", newdlg.username()); rmq.exec(); if (rmq.first()) ; // good - keep going else if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); errorCount++; continue; } else { QMessageBox::warning(this, tr("No Privilege"), tr("You do not have permission to view or manage " "the Chart of Accounts on the child database.")); errorCount++; continue; } rmq.prepare("SELECT fetchMetricText('ServerVersion') AS result;"); rmq.exec(); if (rmq.first()) { if (rmq.value("result").toString() != _metrics->value("ServerVersion")) { QMessageBox::warning(this, tr("Versions Incompatible"), tr("

    The version of the child database is not " "the same as the version of the parent " "database (%1 vs. %2). The data cannot safely " "be synchronized.") .arg(rmq.value("result").toString()) .arg(_metrics->value("ServerVersion"))); errorCount++; continue; } } else if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); continue; } rmq.prepare("SELECT * FROM company WHERE (company_number=:number);"); rmq.bindValue(":number", c->rawValue("company_number")); rmq.exec(); if (rmq.first()) ; // nothing to do else if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); errorCount++; continue; } else { QMessageBox::warning(this, tr("No Corresponding Company"), tr("

    The child database does not appear to have " "a Company %1 defined. The data cannot safely " "be synchronized.") .arg(c->rawValue("company_number").toString())); errorCount++; continue; } // make sure that we don't fail because of missing supporting data rmq.prepare("SELECT DISTINCT accnt_profit, prftcntr_descrip " "FROM accnt JOIN prftcntr ON (accnt_profit=prftcntr_number) " "WHERE (accnt_company=:accnt_company);"); rmq.bindValue(":accnt_company", c->rawValue("company_number")); rmq.exec(); syncSync.prepare("SELECT * FROM prftcntr WHERE prftcntr_number=:prftcntr_number;"); while (rmq.next()) { syncSync.bindValue(":prftcntr_number", rmq.value("accnt_profit")); syncSync.exec(); if (syncSync.first()) ; // nothing to do else if (syncSync.lastError().type() != QSqlError::NoError) { systemError(this, syncSync.lastError().databaseText(), __FILE__, __LINE__); errorCount++; // don't break/continue - do as much as we can } else { syncSync.prepare("INSERT INTO prftcntr (prftcntr_number, prftcntr_descrip)" "VALUES (:prftcntr_number, :prftcntr_descrip);"); syncSync.bindValue(":prftcntr_number", rmq.value("accnt_profit")); syncSync.bindValue(":prftcntr_descrip", rmq.value("prftcntr_descrip")); syncSync.exec(); if (syncSync.lastError().type() != QSqlError::NoError) { systemError(this, syncSync.lastError().databaseText(), __FILE__, __LINE__); errorCount++; // don't break/continue - do as much as we can } } } // next profit center if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); errorCount++; return; } rmq.prepare("SELECT DISTINCT accnt_sub " "FROM accnt JOIN subaccnt ON (accnt_sub=subaccnt_number) " "WHERE (accnt_company=:accnt_company);"); rmq.bindValue(":accnt_company", c->rawValue("company_number")); rmq.exec(); syncSync.prepare("SELECT * FROM subaccnt WHERE subaccnt_number=:subaccnt_number;"); while (rmq.next()) { syncSync.bindValue(":subaccnt_number", rmq.value("accnt_sub")); syncSync.exec(); if (syncSync.first()) ; // nothing to do else if (syncSync.lastError().type() != QSqlError::NoError) { systemError(this, syncSync.lastError().databaseText(), __FILE__, __LINE__); errorCount++; // don't break/continue - do as much as we can } else { syncSync.prepare("INSERT INTO subaccnt (subaccnt_number, subaccnt_descrip)" "VALUES (:subaccnt_number, :subaccnt_descrip);"); syncSync.bindValue(":subaccnt_number", rmq.value("accnt_sub")); syncSync.bindValue(":subaccnt_descrip", rmq.value("subaccnt_descrip")); syncSync.exec(); if (syncSync.lastError().type() != QSqlError::NoError) { systemError(this, syncSync.lastError().databaseText(), __FILE__, __LINE__); errorCount++; // don't break/continue - do as much as we can } } } // next profit center if (rmq.lastError().type() != QSqlError::NoError) { systemError(this, rmq.lastError().databaseText(), __FILE__, __LINE__); errorCount++; return; } // Now for what we really want - if the periods match then upsert trialbal XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery conv; XSqlQuery ltxn; ltxn.exec("BEGIN;"); int sequence = -1; XSqlQuery seq; seq.exec("SELECT fetchGLSequence() AS sequence;"); if (seq.first()) sequence = seq.value("sequence").toInt(); else if (seq.lastError().type() != QSqlError::NoError) { systemError(this, seq.lastError().databaseText(), __FILE__, __LINE__); errorCount++; return; } // Loop and build manually to ensure proper order QList period; for (int i = 0; i < _period->topLevelItemCount(); i++) { if (_period->topLevelItem(i)->isSelected()) { bool inserted = false; QDate _periodStart = _period->topLevelItem(i)->rawValue("period_start").toDate(); for (int j = 0; j < period.size(); j++) { XTreeWidgetItem *p = (XTreeWidgetItem*)(period[j]); QDate periodStart = p->rawValue("period_start").toDate(); if (_periodStart < periodStart) { period.insert(j, _period->topLevelItem(i)); inserted = true; break; } } if (!inserted) period.append(_period->topLevelItem(i)); } } for (int j = 0; j < period.size(); j++) { XTreeWidgetItem *p = (XTreeWidgetItem*)(period[j]); if (progress.wasCanceled()) { rollback.exec(); break; } progress.setLabelText(tr("Synchronizing Company %1 (%2) \n" "Period %3") .arg(c->rawValue("company_number").toString()) .arg(dbURL) .arg(p->rawValue("period_name").toString())); if (p->rawValue("period_closed").toBool()) { rollback.exec(); QMessageBox::warning(this, tr("Period Closed"), tr("Period %1 to %2 is closed and may not " "be synchronized.") .arg(p->rawValue("period_start").toString()) .arg(p->rawValue("period_end").toString()) ); errorCount++; break; } XSqlQuery rperiod(testDB); rperiod.prepare("SELECT * " "FROM period " "WHERE ((period_start=:start)" " AND (period_end=:end));"); rperiod.bindValue(":start", p->rawValue("period_start")); rperiod.bindValue(":end", p->rawValue("period_end")); rperiod.exec(); if (rperiod.first()) { if (progress.wasCanceled()) { rollback.exec(); break; } progress.setLabelText(tr("Synchronizing Company %1 (%2) \n" "Period %3: Clearing old data...") .arg(c->rawValue("company_number").toString()) .arg(dbURL) .arg(p->rawValue("period_name").toString())); // Clear old data XSqlQuery tbsync; tbsync.prepare("DELETE FROM trialbal " "WHERE (trialbal_period_id IN (" " SELECT period_id " " FROM period " " WHERE (period_start >= :startdate))) " " AND (trialbal_accnt_id IN (" " SELECT accnt_id " " FROM accnt " " WHERE ((accnt_id=trialbal_accnt_id) " " AND (accnt_company=:company_number))));" "DELETE FROM gltranssync " "WHERE ((gltrans_date >= :startdate)" " AND (gltranssync_company_id=:company_id));"); tbsync.bindValue(":company_id", c->id("company_number")); tbsync.bindValue(":startdate", p->rawValue("period_start").toDate()); tbsync.bindValue(":company_number", c->rawValue("company_number")); tbsync.bindValue(":period_id", p->id()); tbsync.exec(); if (tbsync.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, rperiod.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } } else if (rperiod.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, rperiod.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } else { rollback.exec(); QMessageBox::warning(this, tr("No Corresponding Period"), tr("

    The child database for Company %1 (%2) " "does not appear to have an Accounting " "Period starting on %3 and ending on %4.") .arg(c->rawValue("company_number").toString()) .arg(c->rawValue("company_database").toString()) .arg(p->rawValue("period_start").toString()) .arg(p->rawValue("period_end").toString()) ); errorCount++; break; } if (progress.wasCanceled()) { rollback.exec(); break; } progress.setLabelText(tr("Synchronizing Company %1 (%2): \n" "Period: %3 \n" "Updating Chart of Accounts...") .arg(c->rawValue("company_number").toString()) .arg(dbURL) .arg(p->rawValue("period_name").toString())); int accntid = -1; XSqlQuery raccnt(testDB); raccnt.prepare("SELECT * " "FROM accnt " "WHERE (accnt_company=:accnt_company);"); raccnt.bindValue(":accnt_company", c->rawValue("company_number")); raccnt.exec(); progress.setMaximum(raccnt.size()); while (raccnt.next()) { XSqlQuery laccnt; laccnt.prepare("SELECT * " "FROM accnt " "WHERE ((accnt_company=:accnt_company)" " AND (accnt_profit=:accnt_profit)" " AND (accnt_number=:accnt_number)" " AND (accnt_sub=:accnt_sub));"); laccnt.bindValue(":accnt_company",raccnt.value("accnt_company")); laccnt.bindValue(":accnt_profit", raccnt.value("accnt_profit")); laccnt.bindValue(":accnt_number", raccnt.value("accnt_number")); laccnt.bindValue(":accnt_sub", raccnt.value("accnt_sub")); laccnt.exec(); XSqlQuery laccntups; // update/insert local account table if (laccnt.first()) { laccntups.prepare("UPDATE accnt SET " " accnt_descrip=:accnt_descrip," " accnt_comments=:accnt_comments," " accnt_type=:accnt_type," " accnt_extref=:accnt_extref," " accnt_forwardupdate=:accnt_forwardupdate," " accnt_subaccnttype_code=:accnt_subaccnttype_code," " accnt_curr_id=:accnt_curr_id " "WHERE (accnt_id=:accnt_id);"); laccntups.bindValue(":accnt_id", laccnt.value("accnt_id")); accntid = laccnt.value("accnt_id").toInt(); } else if (laccnt.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, laccnt.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } else { laccntups.prepare("INSERT INTO accnt (" " accnt_id, accnt_number, accnt_descrip," " accnt_comments, accnt_profit, accnt_sub," " accnt_type, accnt_extref, accnt_company, " " accnt_forwardupdate, " " accnt_subaccnttype_code, accnt_curr_id) " "VALUES (" " :accnt_id, :accnt_number,:accnt_descrip," " :accnt_comments,:accnt_profit,:accnt_sub," " :accnt_type,:accnt_extref,:accnt_company, " " :accnt_forwardupdate, " " :accnt_subaccnttype_code,:accnt_curr_id);"); syncSync.prepare("SELECT NEXTVAL('accnt_accnt_id_seq') AS accnt_id;"); syncSync.exec(); if (syncSync.first()) { laccntups.bindValue(":accnt_id", syncSync.value("accnt_id")); accntid = syncSync.value("accnt_id").toInt(); } else if (syncSync.lastError().type() != QSqlError::NoError) { systemError(this, syncSync.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } } laccntups.bindValue(":accnt_number", raccnt.value("accnt_number")); laccntups.bindValue(":accnt_descrip", raccnt.value("accnt_descrip")); laccntups.bindValue(":accnt_comments", raccnt.value("accnt_comments")); laccntups.bindValue(":accnt_profit", raccnt.value("accnt_profit")); laccntups.bindValue(":accnt_sub", raccnt.value("accnt_sub")); laccntups.bindValue(":accnt_type", raccnt.value("accnt_type")); laccntups.bindValue(":accnt_extref", raccnt.value("accnt_extref")); laccntups.bindValue(":accnt_company", raccnt.value("accnt_company")); laccntups.bindValue(":accnt_forwardupdate",raccnt.value("accnt_forwardupdate")); laccntups.bindValue(":accnt_subaccnttype_code",raccnt.value("accnt_subaccnttype_code")); laccntups.bindValue(":accnt_curr_id", raccnt.value("accnt_curr_id")); laccntups.exec(); if (laccntups.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, laccntups.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } // Import trans detail QDate prevDate = omfgThis->startOfTime(); XSqlQuery rgl(testDB); XSqlQuery lgl; rgl.prepare("SELECT *, formatGlAccountLong(gltrans_accnt_id) AS f_accnt " " FROM ( " "SELECT gltrans_accnt_id, gltrans_date, gltrans_source, " " SUM(gltrans_amount) AS amount " "FROM gltrans, period " "WHERE ((period_id=:period_id) " " AND (gltrans_accnt_id=:accnt_id) " " AND (gltrans_amount < 0) " " AND (gltrans_posted) " " AND (NOT gltrans_deleted) " " AND (gltrans_date " " BETWEEN period_start AND period_end)) " "GROUP BY gltrans_accnt_id, gltrans_source, gltrans_date " "UNION ALL " "SELECT gltrans_accnt_id, gltrans_date, gltrans_source, " " SUM(gltrans_amount) AS amount " " FROM gltrans, period " "WHERE ((period_id=:period_id) " " AND (gltrans_accnt_id=:accnt_id) " " AND (gltrans_amount > 0) " " AND (gltrans_posted) " " AND (NOT gltrans_deleted) " " AND (gltrans_date " " BETWEEN period_start AND period_end)) " "GROUP BY gltrans_accnt_id, gltrans_source, gltrans_date) data " "ORDER BY gltrans_date, gltrans_source, f_accnt; "); rgl.bindValue(":period_id", rperiod.value("period_id")); rgl.bindValue(":accnt_id", raccnt.value("accnt_id")); rgl.exec(); while (rgl.next()) { // Fetch conversion rate for the date if (rgl.value("gltrans_date").toDate() != prevDate) { if (progress.wasCanceled()) { rollback.exec(); break; } progress.setLabelText(tr("Synchronizing Company %1 (%2) \n" "Period: %3\n" "Account: %4") .arg(c->rawValue("company_number").toString()) .arg(dbURL) .arg(p->rawValue("period_name").toString()) .arg(rgl.value("f_accnt").toString())); conv.prepare("SELECT currRate(:curr_id, :date) AS curr_rate; "); conv.bindValue(":curr_id", currid); conv.bindValue(":date", rgl.value("gltrans_date")); conv.exec(); if (conv.first()) ; // Keep going else if (conv.lastError().type() != QSqlError::NoError) { rollback.exec(); QMessageBox::warning(this, tr("No Conversion Rate"), tr("The parent database for Company %1 (%2) " "does not appear to have a conversion rate " "for %3 on %4.") .arg(c->rawValue("company_number").toString()) .arg(c->rawValue("company_database").toString()) .arg(c->text("currency")) .arg(p->rawValue("period_end").toString()) ); errorCount++; break; } } prevDate = rgl.value("gltrans_date").toDate(); lgl.prepare("INSERT INTO gltranssync (" " gltrans_exported, gltrans_created, " " gltrans_date, gltrans_sequence, " " gltrans_accnt_id, gltrans_source, " " gltrans_docnumber, gltrans_misc_id, " " gltrans_amount, gltrans_notes, " " gltrans_journalnumber, gltrans_posted, " " gltrans_doctype, gltrans_rec, " " gltrans_username, gltrans_deleted, " " gltranssync_company_id, " " gltranssync_period_id, gltranssync_curr_amount, " " gltranssync_curr_id, gltranssync_curr_rate) " "VALUES ( " " false, now(),:date, :sequence, " " :accnt_id,:source, '', -1, " " currToBase(:curr_id, :amount, :date), " " :notes, -1, false, " " '', false, getEffectiveXtUser(), false, " " :company_id, :period_id, " " :amount, :curr_id, :curr_rate);"); lgl.bindValue(":sequence", sequence); lgl.bindValue(":accnt_id", accntid); lgl.bindValue(":company_id", c->id("company_number")); lgl.bindValue(":period_id", p->id()); lgl.bindValue(":source", rgl.value("gltrans_source")); lgl.bindValue(":notes", tr("Data imported from Company %1 (%2)") .arg(c->rawValue("company_number").toString()) .arg(c->rawValue("company_database").toString())); lgl.bindValue(":date", rgl.value("gltrans_date")); lgl.bindValue(":amount", rgl.value("amount")); lgl.bindValue(":curr_id", currid); lgl.bindValue(":curr_rate", conv.value("curr_rate")); lgl.exec(); if (lgl.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, lgl.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } } if (progress.wasCanceled()) { rollback.exec(); break; } progress.setValue(progress.value()+1); } // for each remote g/l account if (raccnt.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, raccnt.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } } // for each selected period if (progress.wasCanceled()) { rollback.exec(); break; } progress.setLabelText(tr("Synchronizing Company %1 (%2): Posting into trial balances...") .arg(c->rawValue("company_number").toString()) .arg(dbURL)); // Post into trial balance XSqlQuery post; post.prepare("SELECT postIntoTrialBalanceSync(:sequence, :notes); "); post.bindValue(":sequence", sequence); post.bindValue(":company_id", c->id("company_number")); post.bindValue(":notes", tr("Currency Rounding Discrepency Adjustment")); post.exec(); if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, post.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } XSqlQuery tbs; tbs.exec("SELECT trialbal_id FROM trialbalsync WHERE (trialbal_dirty); "); if (tbs.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tbs.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } progress.setLabelText(tr("Synchronizing Company %1 (%2)\n" "Forward updating trial balances...") .arg(c->rawValue("company_number").toString()) .arg(dbURL)); progress.setMaximum(tbs.size()); while(tbs.next()) { post.prepare("SELECT forwardUpdateTrialBalanceSync(:trialbal_id); "); post.bindValue(":trialbal_id", tbs.value("trialbal_id")); post.exec(); if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, post.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } if (progress.wasCanceled()) { rollback.exec(); break; } progress.setValue(progress.value()+1); } post.prepare("SELECT forwardUpdateTrialBalanceSync(trialbal_id) FROM trialbalsync WHERE (trialbal_dirty); "); post.exec(); if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, post.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } tbs.exec("SELECT trialbal_id " "FROM trialbalsync " " JOIN period ON (trialbal_period_id=period_id) " "WHERE ((NOT trialbalsync_curr_posted) " " AND (trialbalsync_curr_id != baseCurrId()))" "ORDER BY period_end;"); if (tbs.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tbs.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } progress.setLabelText(tr("Synchronizing Company %1 (%2)\n" "Posting currency revaluation adjustments...") .arg(c->rawValue("company_number").toString()) .arg(dbURL)); progress.setMaximum(tbs.size()); progress.setAutoReset(false); while(tbs.next()) { post.prepare("SELECT postCurrAdjustSync(:trialbal_id, :adj_notes); "); post.bindValue(":trialbal_id", tbs.value("trialbal_id")); post.bindValue(":adj_notes", tr("Unrealized Gain/Loss Adjustment")); post.exec(); if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, post.lastError().databaseText(), __FILE__, __LINE__); errorCount++; break; } if (progress.wasCanceled()) { rollback.exec(); break; } progress.setValue(progress.value()+1); } ltxn.exec("COMMIT;"); } else { QMessageBox::warning(this, tr("Could Not Connect"), tr("

    Could not connect to the child database " "with these connection parameters.")); errorCount++; continue; } } // for each selected company progress.accept(); if (progress.wasCanceled()) QMessageBox::critical(this, tr("Synchronizing Canceled"), tr("Synchronization Canceled.")); else QMessageBox::information(this, tr("Synchronizing Complete"), tr("%1 Companies attempted, %2 errors encountered") .arg(company.size()).arg(errorCount)); sFillList(); } void syncCompanies::sHandleButtons() { _sync->setEnabled(_company->selectedItems().size() > 0 && _period->selectedItems().size() > 0); } qt-client-4.1.0/guiclient/syncCompanies.h000066400000000000000000000020571217451700100203650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SYNCCOMPANIES_H #define SYNCCOMPANIES_H #include "guiclient.h" #include #include "xwidget.h" #include "ui_syncCompanies.h" class syncCompanies : public XWidget, public Ui::syncCompanies { Q_OBJECT public: syncCompanies(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~syncCompanies(); static bool userHasPriv(const int = cView); virtual void setVisible(bool); public slots: virtual void sHandleButtons(); protected slots: virtual void languageChange(); virtual void sFillList(); virtual void sSync(); }; #endif // SYNCCOMPANIES_H qt-client-4.1.0/guiclient/syncCompanies.ui000066400000000000000000000140541217451700100205530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. syncCompanies 0 0 668 400 Synchronize Companies 0 Periods: _period QAbstractItemView::MultiSelection 12 Select All Clear Selection 0 Companies: _company QAbstractItemView::MultiSelection 12 Select All Clear Selection 0 &Close &Synchronize Qt::Vertical 20 40 XTreeWidget QTreeWidget

    xtreewidget.h
    _period _selectPeriod _clearPeriod _company _selectCompany _clearCompany _sync _close _close clicked() syncCompanies close() 536 23 464 6 _clearPeriod clicked() _period clearSelection() 173 205 166 156 _clearCompany clicked() _company clearSelection() 470 214 460 169 _selectPeriod clicked() _period selectAll() 86 210 88 172 _selectCompany clicked() _company selectAll() 349 209 349 153 qt-client-4.1.0/guiclient/sysLocale.cpp000066400000000000000000000561131217451700100200450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "sysLocale.h" #include #include #include #include #define DEBUG true sysLocale::sysLocale(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_alternate, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_costScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_country, SIGNAL(newID(int)), this, SLOT(sUpdateSamples())); connect(_currencyScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_emphasis, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_error, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_expired, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_extPriceScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_future, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); connect(_language, SIGNAL(newID(int)), this, SLOT(sUpdateCountries())); connect(_purchPriceScale,SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_qtyScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_qtyPerScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_salesPriceScale,SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_percentScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(_weightScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_uomRatioScale, SIGNAL(valueChanged(int)), this, SLOT(sUpdateSamples())); connect(_warning, SIGNAL(editingFinished()), this, SLOT(sUpdateColors())); _localeid = -1; } sysLocale::~sysLocale() { // no need to delete child widgets, Qt does it all for us } void sysLocale::languageChange() { retranslateUi(this); } enum SetResponse sysLocale::set(const ParameterList &pParams) { XSqlQuery syset; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("locale_id", &valid); if (valid) { _localeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; syset.exec("SELECT NEXTVAL('locale_locale_id_seq') AS _locale_id"); if (syset.first()) _localeid = syset.value("_locale_id").toInt(); else { systemError(this, syset.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _language->setEnabled(FALSE); _country->setEnabled(FALSE); _currencyScale->setEnabled(FALSE); _salesPriceScale->setEnabled(FALSE); _purchPriceScale->setEnabled(FALSE); _extPriceScale->setEnabled(FALSE); _costScale->setEnabled(FALSE); _qtyScale->setEnabled(FALSE); _qtyPerScale->setEnabled(FALSE); _weightScale->setEnabled(FALSE); _uomRatioScale->setEnabled(FALSE); _comments->setReadOnly(TRUE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void sysLocale::sSave() { XSqlQuery sysSave; if (_code->text().trimmed().length() == 0) { QMessageBox::critical( this, tr("Cannot Save Locale"), tr("

    You must enter a Code for this Locale before " "you may save it.") ); _code->setFocus(); return; } sysSave.prepare( "SELECT locale_id " "FROM locale " "WHERE ( (locale_id<>:locale_id)" " AND (UPPER(locale_code)=UPPER(:locale_code)) );"); sysSave.bindValue(":locale_id", _localeid); sysSave.bindValue(":locale_code", _code->text().trimmed()); sysSave.exec(); if (sysSave.first()) { QMessageBox::critical( this, tr("Cannot Create Locale"), tr( "A Locale with the entered code already exists." "You may not create a Locale with this code." ) ); _code->setFocus(); return; } else if (sysSave.lastError().type() != QSqlError::NoError) { systemError(this, sysSave.lastError().databaseText(), __FILE__, __LINE__); return; } QLocale sampleLocale = generateLocale(); if (_mode == cNew) { sysSave.prepare( "INSERT INTO locale " "( locale_id, locale_code, locale_descrip," " locale_lang_id, locale_country_id, " " locale_dateformat, locale_timeformat, locale_timestampformat," " locale_intervalformat, locale_qtyformat," " locale_curr_scale," " locale_salesprice_scale, locale_purchprice_scale," " locale_extprice_scale, locale_cost_scale," " locale_qty_scale, locale_qtyper_scale," " locale_uomratio_scale, locale_percent_scale, " " locale_weight_scale, locale_comments, " " locale_error_color, locale_warning_color," " locale_emphasis_color, locale_altemphasis_color," " locale_expired_color, locale_future_color) " "VALUES " "( :locale_id, :locale_code, :locale_descrip," " :locale_lang_id, :locale_country_id," " :locale_dateformat, :locale_timeformat, :locale_timestampformat," " :locale_intervalformat, :locale_qtyformat," " :locale_curr_scale," " :locale_salesprice_scale, :locale_purchprice_scale," " :locale_extprice_scale, :locale_cost_scale," " :locale_qty_scale, :locale_qtyper_scale," " :locale_uomratio_scale, :local_percent_scale, " " :locale_weight_scale, :locale_comments," " :locale_error_color, :locale_warning_color," " :locale_emphasis_color, :locale_altemphasis_color," " :locale_expired_color, :locale_future_color);" ); } else if ( (_mode == cEdit) || (_mode == cCopy) ) sysSave.prepare( "UPDATE locale " "SET locale_code=:locale_code," " locale_descrip=:locale_descrip," " locale_lang_id=:locale_lang_id," " locale_country_id=:locale_country_id," " locale_dateformat=:locale_dateformat," " locale_timeformat=:locale_timeformat," " locale_timestampformat=:locale_timestampformat," " locale_intervalformat=:locale_intervalformat," " locale_qtyformat=:locale_qtyformat," " locale_curr_scale=:locale_curr_scale," " locale_salesprice_scale=:locale_salesprice_scale," " locale_purchprice_scale=:locale_purchprice_scale," " locale_extprice_scale=:locale_extprice_scale," " locale_cost_scale=:locale_cost_scale," " locale_qty_scale=:locale_qty_scale," " locale_qtyper_scale=:locale_qtyper_scale," " locale_weight_scale=:locale_weight_scale," " locale_uomratio_scale=:locale_uomratio_scale," " locale_percent_scale=:locale_percent_scale," " locale_comments=:locale_comments," " locale_error_color=:locale_error_color," " locale_warning_color=:locale_warning_color," " locale_emphasis_color=:locale_emphasis_color," " locale_altemphasis_color=:locale_altemphasis_color," " locale_expired_color=:locale_expired_color," " locale_future_color=:locale_future_color " "WHERE (locale_id=:locale_id);" ); sysSave.bindValue(":locale_id", _localeid); sysSave.bindValue(":locale_code", _code->text()); sysSave.bindValue(":locale_descrip", _description->text()); sysSave.bindValue(":locale_lang_id", _language->id()); sysSave.bindValue(":locale_country_id", _country->id()); sysSave.bindValue(":locale_curr_scale", _currencyScale->text()); sysSave.bindValue(":locale_salesprice_scale", _salesPriceScale->text()); sysSave.bindValue(":locale_purchprice_scale", _purchPriceScale->text()); sysSave.bindValue(":locale_extprice_scale", _extPriceScale->text()); sysSave.bindValue(":locale_cost_scale", _costScale->text()); sysSave.bindValue(":locale_qty_scale", _qtyScale->text()); sysSave.bindValue(":locale_qtyper_scale", _qtyPerScale->text()); sysSave.bindValue(":locale_weight_scale", _weightScale->text()); sysSave.bindValue(":locale_uomratio_scale", _uomRatioScale->text()); sysSave.bindValue(":locale_percent_scale", _percentScale->text()); sysSave.bindValue(":locale_comments", _comments->toPlainText()); sysSave.bindValue(":locale_error_color", _error->text()); sysSave.bindValue(":locale_warning_color", _warning->text()); sysSave.bindValue(":locale_emphasis_color", _emphasis->text()); sysSave.bindValue(":locale_altemphasis_color", _alternate->text()); sysSave.bindValue(":locale_expired_color", _expired->text()); sysSave.bindValue(":locale_future_color", _future->text()); sysSave.bindValue(":locale_dateformat", convert(sampleLocale.dateFormat(QLocale::ShortFormat))); sysSave.bindValue(":locale_timeformat", convert(sampleLocale.timeFormat(QLocale::ShortFormat))); sysSave.bindValue(":locale_timestampformat",convert(sampleLocale.dateFormat(QLocale::ShortFormat)) + " " + convert(sampleLocale.timeFormat(QLocale::ShortFormat))); { QString intervalfmt = convert(sampleLocale.timeFormat(QLocale::ShortFormat).remove("ap", Qt::CaseInsensitive)); intervalfmt.insert(intervalfmt.indexOf("HH") + 2, "24"); sysSave.bindValue(":locale_intervalformat", intervalfmt); } sysSave.bindValue(":locale_qtyformat", QString(sampleLocale.decimalPoint()) + QString(sampleLocale.negativeSign()) + QString(sampleLocale.groupSeparator())); sysSave.exec(); if (sysSave.lastError().type() != QSqlError::NoError) { systemError(this, sysSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_localeid); } void sysLocale::close() { XSqlQuery sysclose; qDebug("sysLocale::close()"); if (_mode == cCopy && _localeid > 0) { sysclose.prepare( "DELETE FROM locale " "WHERE (locale_id=:locale_id);" ); sysclose.bindValue(":locale_id", _localeid); sysclose.exec(); if (sysclose.lastError().type() != QSqlError::NoError) { systemError(this, sysclose.lastError().databaseText(), __FILE__, __LINE__); return; } } reject(); } void sysLocale::sUpdateCountries() { XSqlQuery sysUpdateCountries; QLocale::Language localeLang = QLocale::C; if (_language->id() > 0) { sysUpdateCountries.prepare("SELECT lang_qt_number FROM lang WHERE (lang_id=:langid);"); sysUpdateCountries.bindValue(":langid", _language->id()); sysUpdateCountries.exec(); if (sysUpdateCountries.first()) { localeLang = QLocale::Language(sysUpdateCountries.value("lang_qt_number").toInt()); } else if (sysUpdateCountries.lastError().type() != QSqlError::NoError) { systemError(this, sysUpdateCountries.lastError().databaseText(), __FILE__, __LINE__); return; } } int currentCountry = _country->id(); QList clist = QLocale::countriesForLanguage(localeLang); _country->clear(); if(!clist.isEmpty()) { QString sql = "SELECT country_id, country_name, country_name" " FROM country" " WHERE((country_qt_number IS NOT NULL)" " AND (country_qt_number IN (-1"; for (int i = 0; i < clist.size(); ++i) { sql.append(","); sql.append(QString::number((int)clist.at(i))); } sql += ")))" " ORDER BY country_name;"; _country->populate(sql, currentCountry); } sUpdateSamples(); } void sysLocale::sUpdateSamples() { XSqlQuery sysUpdateSamples; QLocale sampleLocale = generateLocale(); sysUpdateSamples.prepare("SELECT CURRENT_DATE AS dateSample, CURRENT_TIME AS timeSample," " CURRENT_TIMESTAMP AS timestampSample," " CURRENT_TIMESTAMP - CURRENT_DATE AS intervalSample," " 987654321.987654321 AS doubleSample;"); sysUpdateSamples.exec(); if (sysUpdateSamples.first()) { _dateSample->setText(sampleLocale.toString(sysUpdateSamples.value("dateSample").toDate(), QLocale::ShortFormat)); _timeSample->setText(sampleLocale.toString(sysUpdateSamples.value("timeSample").toTime(), QLocale::ShortFormat)); _timestampSample->setText(sampleLocale.toString(sysUpdateSamples.value("timestampSample").toDate(), QLocale::ShortFormat) + " " + sampleLocale.toString(sysUpdateSamples.value("timestampSample").toTime(), QLocale::ShortFormat)); _intervalSample->setText(sampleLocale.toString(sysUpdateSamples.value("intervalSample").toTime(), QLocale::ShortFormat)); _currencySample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _currencyScale->value())); _salesPriceSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _salesPriceScale->value())); _purchPriceSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _purchPriceScale->value())); _extPriceSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _extPriceScale->value())); _costSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _costScale->value())); _qtySample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _qtyScale->value())); _qtyPerSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _qtyPerScale->value())); _weightSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _weightScale->value())); _uomRatioSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _uomRatioScale->value())); _percentSample->setText(sampleLocale.toString(sysUpdateSamples.value("doubleSample").toDouble(), 'f', _percentScale->value())); } else if (sysUpdateSamples.lastError().type() != QSqlError::NoError) { systemError(this, sysUpdateSamples.lastError().databaseText(), __FILE__, __LINE__); return; } } void sysLocale::sUpdateColors() { QList colorwidgets; colorwidgets << _error << _warning << _emphasis << _alternate << _expired << _future; for (int i = 0; i < colorwidgets.size(); i++) { QLineEdit *widget = colorwidgets.at(i); QPalette colors = widget->palette(); colors.setBrush(QPalette::Text, QBrush(QColor(widget->text()))); widget->setPalette(colors); } } void sysLocale::populate() { XSqlQuery popq; popq.prepare( "SELECT * " "FROM locale " "WHERE (locale_id=:locale_id);" ); popq.bindValue(":locale_id", _localeid); popq.exec(); if (popq.first()) { _code->setText(popq.value("locale_code").toString()); _description->setText(popq.value("locale_descrip").toString()); _language->setId(popq.value("locale_lang_id").toInt()); _country->setId(popq.value("locale_country_id").toInt()); _currencyScale->setValue(popq.value("locale_curr_scale").toInt()); _salesPriceScale->setValue(popq.value("locale_salesprice_scale").toInt()); _purchPriceScale->setValue(popq.value("locale_purchprice_scale").toInt()); _extPriceScale->setValue(popq.value("locale_extprice_scale").toInt()); _costScale->setValue(popq.value("locale_cost_scale").toInt()); _qtyScale->setValue(popq.value("locale_qty_scale").toInt()); _qtyPerScale->setValue(popq.value("locale_qtyper_scale").toInt()); _weightScale->setValue(popq.value("locale_weight_scale").toInt()); _uomRatioScale->setValue(popq.value("locale_uomratio_scale").toInt()); _percentScale->setValue(popq.value("locale_percent_scale").toInt()); _comments->setText(popq.value("locale_comments").toString()); _error->setText(popq.value("locale_error_color").toString()); _warning->setText(popq.value("locale_warning_color").toString()); _emphasis->setText(popq.value("locale_emphasis_color").toString()); _alternate->setText(popq.value("locale_altemphasis_color").toString()); _expired->setText(popq.value("locale_expired_color").toString()); _future->setText(popq.value("locale_future_color").toString()); sUpdateSamples(); sUpdateColors(); } if (popq.lastError().type() != QSqlError::NoError) { systemError(this, popq.lastError().databaseText(), __FILE__, __LINE__); return; } } // convert between Qt's date/time formatting strings and PostgreSQL's QString sysLocale::convert(const QString &input) { // create an array with a certain preallocated size QByteArray output(input.size()+1, '\0'); // clear the array so we are starting at the beginning but still have the allocations output.clear(); QString errMsg = tr("

    .Could not translate Qt date/time formatting " "string %1 to PostgreSQL date/time formatting " "string. Error at or near character %2."); int i = 0; for (i = 0; i < input.size(); i++) { switch (input[i].toAscii()) { case '\'': if (input[++i] == '\'') output.append('\''); else for (; input[i] != '\''; i++) output.append(input[i].toAscii()); if (input[i] == '\'') i++; break; case 'd': if (input[i+1] != 'd') { output.append('D'); output.append('D'); } else if (input[i+2] != 'd') { output.append('D'); output.append('D'); i++; } else if (input[i+3] != 'd') { output.append('D'); output.append('y'); i += 2; } else if (input[i+3] == 'd') { output.append('D'); output.append('a'); output.append('y'); i += 3; } break; case 'M': if (input[i+1] != 'M') { output.append('M'); output.append('M'); } else if (input[i+2] != 'M') { output.append('M'); output.append('M'); i++; } else if (input[i+3] != 'M') { output.append('M'); output.append('o'); output.append('n'); i += 2; } else if (input[i+3] == 'M') { output.append('M'); output.append('o'); output.append('n'); output.append('t'); output.append('h'); i += 3; } break; case 'y': if (input[i+1] != 'y') { systemError(this, errMsg.arg(input).arg(i), __FILE__, __LINE__); return ""; } else if (input[i+2] != 'y') { output.append('Y'); output.append('Y'); i++; } else if (input[i+3] != 'y') { systemError(this, errMsg.arg(input).arg(i), __FILE__, __LINE__); return ""; } else if (input[i+3] == 'y') { output.append('Y'); output.append('Y'); output.append('Y'); output.append('Y'); i += 3; } break; case 'h': { bool ampm = false; int j; for (j = i; j < input.size() && !ampm; j++) { if (input[j] == '\'') while (input[++j] != '\'' && j < input.size()) ; ampm = ((input[j] == 'a' && input[j+1] == 'p') || (input[j] == 'A' && input[j+1] == 'P')); } output.append('H'); output.append('H'); if (ampm) { output.append('1'); output.append('2'); } else { output.append('2'); output.append('4'); } if (input[i+1] == 'h') i++; } break; case 'm': output.append('M'); output.append('I'); if (input[i+1] == 'm') i++; break; case 's': output.append('S'); output.append('S'); if (input[i+1] == 's') i++; break; case 'z': output.append('M'); output.append('S'); if (input[i+1] == 'z' && input[i+2] != 'z') { systemError(this, errMsg.arg(input).arg(i), __FILE__, __LINE__); return ""; } else if (input[i+1] == 'z' && input[i+2] == 'z') i += 2; break; case 'A': output.append('A'); if (input[i+1] == 'P') { output.append('M'); i++; } break; case 'a': output.append('a'); if (input[i+1] == 'p') { output.append('m'); i++; } break; default: output.append(input[i].toAscii()); break; } } //output.append('\0'); if (DEBUG) qDebug() << "sysLocale::convert() " << input << " to " << output; return QString(output); } QLocale sysLocale::generateLocale() { XSqlQuery sysgenerateLocale; QLocale::Language localeLang = QLocale::C; QLocale::Country localeCountry = QLocale::AnyCountry; if (_language->id() > 0) { sysgenerateLocale.prepare("SELECT lang_qt_number FROM lang WHERE (lang_id=:langid);"); sysgenerateLocale.bindValue(":langid", _language->id()); sysgenerateLocale.exec(); if (sysgenerateLocale.first()) { localeLang = QLocale::Language(sysgenerateLocale.value("lang_qt_number").toInt()); } else if (sysgenerateLocale.lastError().type() != QSqlError::NoError) { systemError(this, sysgenerateLocale.lastError().databaseText(), __FILE__, __LINE__); return QLocale("C"); } } if (_country->id() > 0) { sysgenerateLocale.prepare("SELECT country_qt_number " "FROM country " "WHERE (country_id=:countryid);"); sysgenerateLocale.bindValue(":countryid", _country->id()); sysgenerateLocale.exec(); if (sysgenerateLocale.first()) { localeCountry = QLocale::Country(sysgenerateLocale.value("country_qt_number").toInt()); } else if (sysgenerateLocale.lastError().type() != QSqlError::NoError) { systemError(this, sysgenerateLocale.lastError().databaseText(), __FILE__, __LINE__); return QLocale("C"); } } return QLocale(localeLang, localeCountry); } qt-client-4.1.0/guiclient/sysLocale.h000066400000000000000000000023301217451700100175020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SYSLOCALE_H #define SYSLOCALE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_sysLocale.h" class sysLocale : public XDialog, public Ui::sysLocale { Q_OBJECT public: sysLocale(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~sysLocale(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void close(); virtual void sSave(); virtual void sUpdateColors(); virtual void sUpdateSamples(); virtual void sUpdateCountries(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _localeid; QString convert(const QString &); QLocale generateLocale(); }; #endif // SYSLOCALE_H qt-client-4.1.0/guiclient/sysLocale.ui000066400000000000000000000651751217451700100177100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. sysLocale 0 0 606 686 Locale Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code 0 Qt::Horizontal 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Language: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _language true [ Default ] XComboBox::LocaleLanguages Qt::Horizontal 40 20 Country: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _country true [ Any ] XComboBox::LocaleCountries Qt::Horizontal 40 20 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 0 120 0 Sample Qt::AlignCenter 0 0 120 0 Sample Qt::AlignCenter Date Format: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 120 0 date Qt::AlignCenter Timestamp Format: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Time Format: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 120 0 time Qt::AlignCenter Interval Format: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 120 0 interval Qt::AlignCenter timestamp Qt::AlignCenter Qt::Horizontal Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _currencyScale Qt::AlignRight 4 2 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Sales Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _salesPriceScale Qt::AlignRight 4 4 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Purch. Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _purchPriceScale Qt::AlignRight 6 4 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ext. Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _extPriceScale Qt::AlignRight 4 2 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _costScale Qt::AlignRight 6 2 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyScale Qt::AlignRight 6 2 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Per: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyPerScale Qt::AlignRight 8 6 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter UOM Ratio: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _uomRatioScale Qt::AlignRight 8 6 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Display Values to # Decimal Places: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 4 2 Percent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Weight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 8 2 120 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal Error: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _error Warning: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warning Emphasis: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _emphasis Alternate: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _alternate Expired: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _expired Future: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _future 0 0 0 Co&mments: _comments XComboBox QComboBox

    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _code _description _currencyScale _salesPriceScale _purchPriceScale _extPriceScale _costScale _qtyScale _qtyPerScale _uomRatioScale _error _warning _emphasis _alternate _expired _future _comments parameter.h _buttonBox rejected() sysLocale reject() 559 78 302 342 qt-client-4.1.0/guiclient/systemMessage.cpp000066400000000000000000000117751217451700100207450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "systemMessage.h" #include #include #define cAcknowledge 0x80 systemMessage::systemMessage(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); _scheduledDate->setNullString(tr("ASAP")); _scheduledDate->setNullDate(omfgThis->startOfTime()); _scheduledDate->setAllowNullDate(TRUE); _expiresDate->setNullString(tr("Never")); _expiresDate->setNullDate(omfgThis->endOfTime()); _expiresDate->setAllowNullDate(TRUE); _expiresDate->setNull(); } systemMessage::~systemMessage() { // no need to delete child widgets, Qt does it all for us } void systemMessage::languageChange() { retranslateUi(this); } enum SetResponse systemMessage::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("msguser_id", &valid); if (valid) { _msguserid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "acknowledge") { _mode = cAcknowledge; _scheduledDate->setEnabled(FALSE); _scheduledTime->setEnabled(FALSE); _expiresDate->setEnabled(FALSE); _expiresTime->setEnabled(FALSE); _message->setReadOnly(TRUE); _close->setText("&Acknowlege"); _save->setText("&Snooze"); } } return NoError; } void systemMessage::sClose() { XSqlQuery systemClose; if (_mode == cNew) reject(); else if (_mode == cAcknowledge) { systemClose.prepare( "SELECT acknowledgeMessage(msguser_msg_id) " "FROM msguser " "WHERE (msguser_id=:msguser_id);" ); systemClose.bindValue(":msguser_id", _msguserid); systemClose.exec(); accept(); } } void systemMessage::sSave() { XSqlQuery systemSave; if (_mode == cNew) { if (!_scheduledDate->isValid()) { QMessageBox::warning( this, tr("Enter Valid Schedule Date"), tr("You must enter a valid Schedule Date before saving this Message.") ); _scheduledDate->setFocus(); } else { systemSave.prepare("SELECT postMessage(:scheduled, :expires, :message) AS msgid;"); QDateTime scheduled; QDateTime expires; scheduled.setDate(_scheduledDate->date()); scheduled.setTime(_scheduledTime->time()); expires.setDate(_expiresDate->date()); expires.setTime(_expiresTime->time()); systemSave.bindValue(":scheduled", scheduled); systemSave.bindValue(":expires", expires); systemSave.bindValue(":message", (_message->toPlainText())); systemSave.exec(); if (systemSave.first()) done(systemSave.value("msgid").toInt()); else reject(); } } else if (_mode == cAcknowledge) { systemSave.prepare( "SELECT snoozeMessage(msguser_msg_id) " "FROM msguser " "WHERE (msguser_id=:msguser_id);" ); systemSave.bindValue(":msguser_id", _msguserid); systemSave.exec(); accept(); } } void systemMessage::populate() { XSqlQuery systempopulate; QString sql = QString( "SELECT DATE(msg_posted) AS postdate," " msg_posted::TIME AS posttime," " DATE(msg_scheduled) AS scheduleddate," " msg_scheduled::TIME AS scheduledtime," " DATE(msg_expires) AS expiresdate," " msg_expires::TIME AS expirestime," " msg_username, msg_text " "FROM msg, msguser " "WHERE ( (msguser_msg_id=msg_id)" " AND (msguser_id=%1) );" ) .arg(_msguserid); systempopulate.exec(sql); if (systempopulate.first()) { _postedDate->setDate(systempopulate.value("postdate").toDate()); _postedTime->setTime(systempopulate.value("posttime").toTime()); _scheduledDate->setDate(systempopulate.value("scheduleddate").toDate()); _scheduledTime->setTime(systempopulate.value("scheduledtime").toTime()); _expiresDate->setDate(systempopulate.value("expiresdate").toDate()); if (systempopulate.value("expiresdate") != tr("Never")) _expiresTime->setTime(systempopulate.value("expirestime").toTime()); _user->setText(systempopulate.value("msg_username").toString()); _message->setText(systempopulate.value("msg_text").toString()); } } qt-client-4.1.0/guiclient/systemMessage.h000066400000000000000000000021061217451700100203760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SYSTEMMESSAGE_H #define SYSTEMMESSAGE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_systemMessage.h" class systemMessage : public XDialog, public Ui::systemMessage { Q_OBJECT public: systemMessage(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~systemMessage(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sClose(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _msguserid; }; #endif // SYSTEMMESSAGE_H qt-client-4.1.0/guiclient/systemMessage.ui000066400000000000000000000251271217451700100205740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. systemMessage 0 0 421 303 System Message 5 5 0 6 0 5 0 0 Scheduled: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Expires: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 0 2 false at false Qt::Horizontal QSizePolicy::Expanding 11 10 7 0 0 0 0 0 0 0 0 2 at Qt::AlignVCenter 0 2 at Qt::Horizontal QSizePolicy::Expanding 16 20 0 0 Posted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Posted by: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 &Cancel &Save true true Qt::Vertical QSizePolicy::Preferred 89 100 0 0 Message: DLineEdit XLineEdit
    datecluster.h
    0
    XTextEdit QTextEdit
    xtextedit.h
    _postedDate _postedTime _scheduledDate _scheduledTime _expiresDate _expiresTime _message _save _close
    qt-client-4.1.0/guiclient/task.cpp000066400000000000000000000320151217451700100170440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "task.h" #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "userList.h" const char *_taskStatuses[] = { "P", "O", "C" }; task::task(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_actualExp, SIGNAL(editingFinished()), this, SLOT(sExpensesAdjusted())); connect(_budgetExp, SIGNAL(editingFinished()), this, SLOT(sExpensesAdjusted())); connect(_actualHours, SIGNAL(editingFinished()), this, SLOT(sHoursAdjusted())); connect(_budgetHours, SIGNAL(editingFinished()), this, SLOT(sHoursAdjusted())); _budgetHours->setValidator(omfgThis->qtyVal()); _actualHours->setValidator(omfgThis->qtyVal()); _budgetExp->setValidator(omfgThis->costVal()); _actualExp->setValidator(omfgThis->costVal()); _balanceHours->setPrecision(omfgThis->qtyVal()); _balanceExp->setPrecision(omfgThis->costVal()); _prjid = -1; _prjtaskid = -1; _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); } task::~task() { // no need to delete child widgets, Qt does it all for us } void task::languageChange() { retranslateUi(this); } enum SetResponse task::set(const ParameterList &pParams) { XSqlQuery tasket; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("prj_id", &valid); if (valid) _prjid = param.toInt(); param = pParams.value("prj_owner_username", &valid); if (valid) _owner->setUsername(param.toString()); param = pParams.value("prj_username", &valid); if (valid) _assignedTo->setUsername(param.toString()); param = pParams.value("prj_start_date", &valid); if (valid) _started->setDate(param.toDate()); param = pParams.value("prj_assigned_date", &valid); if (valid) _assigned->setDate(param.toDate()); param = pParams.value("prj_due_date", &valid); if (valid) _due->setDate(param.toDate()); param = pParams.value("prj_completed_date", &valid); if (valid) _completed->setDate(param.toDate()); param = pParams.value("prjtask_id", &valid); if (valid) { _prjtaskid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; tasket.exec("SELECT NEXTVAL('prjtask_prjtask_id_seq') AS prjtask_id;"); if (tasket.first()) _prjtaskid = tasket.value("prjtask_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } connect(_assignedTo, SIGNAL(newId(int)), this, SLOT(sAssignedToChanged(int))); connect(_status, SIGNAL(currentIndexChanged(int)), this, SLOT(sStatusChanged(int))); _alarms->setId(_prjtaskid); _comments->setId(_prjtaskid); } if (param.toString() == "edit") { _mode = cEdit; connect(_assignedTo, SIGNAL(newId(int)), this, SLOT(sAssignedToChanged(int))); connect(_status, SIGNAL(currentIndexChanged(int)), this, SLOT(sStatusChanged(int))); } if (param.toString() == "view") { _mode = cView; _number->setEnabled(false); _name->setEnabled(false); _descrip->setEnabled(false); _status->setEnabled(false); _budgetHours->setEnabled(false); _actualHours->setEnabled(false); _budgetExp->setEnabled(false); _actualExp->setEnabled(false); _owner->setEnabled(false); _assignedTo->setEnabled(false); _due->setEnabled(false); _assigned->setEnabled(false); _started->setEnabled(false); _completed->setEnabled(false); _alarms->setEnabled(false); _comments->setReadOnly(true); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void task::populate() { XSqlQuery taskpopulate; taskpopulate.prepare( "SELECT prjtask.* " "FROM prjtask " "WHERE (prjtask_id=:prjtask_id);" ); taskpopulate.bindValue(":prjtask_id", _prjtaskid); taskpopulate.exec(); if (taskpopulate.first()) { _number->setText(taskpopulate.value("prjtask_number")); _name->setText(taskpopulate.value("prjtask_name")); _descrip->setText(taskpopulate.value("prjtask_descrip").toString()); _owner->setUsername(taskpopulate.value("prjtask_owner_username").toString()); _assignedTo->setUsername(taskpopulate.value("prjtask_username").toString()); _started->setDate(taskpopulate.value("prjtask_start_date").toDate()); _assigned->setDate(taskpopulate.value("prjtask_assigned_date").toDate()); _due->setDate(taskpopulate.value("prjtask_due_date").toDate()); _completed->setDate(taskpopulate.value("prjtask_completed_date").toDate()); for (int counter = 0; counter < _status->count(); counter++) { if (QString(taskpopulate.value("prjtask_status").toString()[0]) == _taskStatuses[counter]) _status->setCurrentIndex(counter); } _budgetHours->setText(formatQty(taskpopulate.value("prjtask_hours_budget").toDouble())); _actualHours->setText(formatQty(taskpopulate.value("prjtask_hours_actual").toDouble())); _budgetExp->setText(formatCost(taskpopulate.value("prjtask_exp_budget").toDouble())); _actualExp->setText(formatCost(taskpopulate.value("prjtask_exp_actual").toDouble())); _alarms->setId(_prjtaskid); _comments->setId(_prjtaskid); sHoursAdjusted(); sExpensesAdjusted(); //if (taskpopulate.value("prjtask_anyuser").toBool()) // _anyUser->setChecked(TRUE); //else // _userList->setChecked(TRUE); } else if (taskpopulate.lastError().type() != QSqlError::NoError) { systemError(this, taskpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } //sFillUserList(); } void task::sSave() { XSqlQuery taskSave; QList errors; errors<< GuiErrorCheck(_number->text().length() == 0, _number, tr("You must enter a valid Number.")) << GuiErrorCheck(_name->text().length() == 0, _name, tr("You must enter a valid Name.")) << GuiErrorCheck(!_due->isValid(), _due, tr("You must enter a valid due date.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Project Task"), errors)) return; if (_mode == cNew) { taskSave.prepare( "INSERT INTO prjtask " "( prjtask_id, prjtask_prj_id, prjtask_number," " prjtask_name, prjtask_descrip, prjtask_status," " prjtask_hours_budget, prjtask_hours_actual," " prjtask_exp_budget, prjtask_exp_actual," " prjtask_start_date, prjtask_due_date," " prjtask_assigned_date, prjtask_completed_date," " prjtask_owner_username, prjtask_username ) " "VALUES " "( :prjtask_id, :prjtask_prj_id, :prjtask_number," " :prjtask_name, :prjtask_descrip, :prjtask_status," " :prjtask_hours_budget, :prjtask_hours_actual," " :prjtask_exp_budget, :prjtask_exp_actual," " :prjtask_start_date, :prjtask_due_date," " :prjtask_assigned_date, :prjtask_completed_date," " :prjtask_owner_username, :username );" ); taskSave.bindValue(":prjtask_prj_id", _prjid); } else if (_mode == cEdit) taskSave.prepare( "UPDATE prjtask " "SET prjtask_number=:prjtask_number, prjtask_name=:prjtask_name," " prjtask_descrip=:prjtask_descrip, prjtask_status=:prjtask_status," " prjtask_hours_budget=:prjtask_hours_budget," " prjtask_hours_actual=:prjtask_hours_actual," " prjtask_exp_budget=:prjtask_exp_budget," " prjtask_exp_actual=:prjtask_exp_actual," " prjtask_owner_username=:prjtask_owner_username," " prjtask_username=:username," " prjtask_start_date=:prjtask_start_date," " prjtask_due_date=:prjtask_due_date," " prjtask_assigned_date=:prjtask_assigned_date," " prjtask_completed_date=:prjtask_completed_date " "WHERE (prjtask_id=:prjtask_id);" ); taskSave.bindValue(":prjtask_id", _prjtaskid); taskSave.bindValue(":prjtask_number", _number->text()); taskSave.bindValue(":prjtask_name", _name->text()); taskSave.bindValue(":prjtask_descrip", _descrip->toPlainText()); taskSave.bindValue(":prjtask_status", _taskStatuses[_status->currentIndex()]); taskSave.bindValue(":prjtask_owner_username", _owner->username()); taskSave.bindValue(":username", _assignedTo->username()); taskSave.bindValue(":prjtask_start_date", _started->date()); taskSave.bindValue(":prjtask_due_date", _due->date()); taskSave.bindValue(":prjtask_assigned_date", _assigned->date()); taskSave.bindValue(":prjtask_completed_date", _completed->date()); //taskSave.bindValue(":prjtask_anyuser", QVariant(_anyUser->isChecked())); taskSave.bindValue(":prjtask_hours_budget", _budgetHours->text().toDouble()); taskSave.bindValue(":prjtask_hours_actual", _actualHours->text().toDouble()); taskSave.bindValue(":prjtask_exp_budget", _budgetExp->text().toDouble()); taskSave.bindValue(":prjtask_exp_actual", _actualExp->text().toDouble()); taskSave.exec(); if (taskSave.lastError().type() != QSqlError::NoError) { systemError(this, taskSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_prjtaskid); } void task::sAssignedToChanged(const int newid) { if (newid == -1) _assigned->clear(); else _assigned->setDate(omfgThis->dbDate()); } void task::sStatusChanged(const int pStatus) { switch(pStatus) { case 0: // Concept default: _started->clear(); _completed->clear(); break; case 1: // In Process _started->setDate(omfgThis->dbDate()); _completed->clear(); break; case 2: // Completed _completed->setDate(omfgThis->dbDate()); break; } } void task::sHoursAdjusted() { _balanceHours->setText(formatQty(_budgetHours->text().toDouble() - _actualHours->text().toDouble())); } void task::sExpensesAdjusted() { _balanceExp->setText(formatCost(_budgetExp->text().toDouble() - _actualExp->text().toDouble())); } void task::sNewUser() { XSqlQuery taskNewUser; /* userList newdlg(this, "", TRUE); int result = newdlg.exec(); if (result != XDialog::Rejected) { QString username = newdlg.username(); taskNewUser.prepare( "SELECT prjtaskuser_id " "FROM prjtaskuser " "WHERE ( (prjtaskuser_username=:username)" " AND (prjtaskuser_prjtask_id=:prjtask_id) );" ); taskNewUser.bindValue(":username", username); taskNewUser.bindValue(":prjtask_id", _prjtaskid); taskNewUser.exec(); if (!taskNewUser.first()) { taskNewUser.prepare( "INSERT INTO prjtaskuser " "( prjtaskuser_prjtask_id, prjtaskuser_username ) " "VALUES " "( :prjtaskuser_prjtask_id, :prjtaskuser_username );" ); taskNewUser.bindValue(":prjtaskuser_username", username); taskNewUser.bindValue(":prjtaskuser_prjtask_id", _prjtaskid); taskNewUser.exec(); sFillUserList(); } if (taskNewUser.lastError().type() != QSqlError::NoError) { systemError(this, taskNewUser.lastError().databaseText(), __FILE__, __LINE__); return; } } */ } void task::sDeleteUser() { XSqlQuery taskDeleteUser; /* taskDeleteUser.prepare( "DELETE FROM prjtaskuser " "WHERE ( (prjtaskuser_username=:username)" " AND (prjtaskuser_prjtask_id=:prjtask_id) );" ); taskDeleteUser.bindValue(":username", _usr->username()); taskDeleteUser.bindValue(":prjtask_id", _prjtaskid); taskDeleteUser.exec(); if (taskDeleteUser.lastError().type() != QSqlError::NoError) { systemError(this, taskDeleteUser.lastError().databaseText(), __FILE__, __LINE__); return; } sFillUserList(); */ } void task::sFillUserList() { XSqlQuery taskFillUserList; /* taskFillUserList.prepare( "SELECT prjtaskuser_id, usr_username, usr_propername " "FROM prjtaskuser, usr " "WHERE ( (prjtaskuser_username=usr_username)" " AND (prjtaskuser_prjtask_id=:prjtask_id) );" ); taskFillUserList.bindValue(":prjtask_id", _prjtaskid); taskFillUserList.exec(); _usr->populate(taskFillUserList); if (taskFillUserList.lastError().type() != QSqlError::NoError) { systemError(this, taskFillUserList.lastError().databaseText(), __FILE__, __LINE__); return; } */ } qt-client-4.1.0/guiclient/task.h000066400000000000000000000023611217451700100165120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TASK_H #define TASK_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_task.h" class task : public XDialog, public Ui::task { Q_OBJECT public: task(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~task(); virtual SetResponse set(const ParameterList & pParams ); public slots: virtual void populate(); virtual void sSave(); virtual void sNewUser(); virtual void sDeleteUser(); virtual void sFillUserList(); virtual void sAssignedToChanged(const int); virtual void sStatusChanged(const int); virtual void sHoursAdjusted(); virtual void sExpensesAdjusted(); protected slots: virtual void languageChange(); private: int _mode; int _prjid; int _prjtaskid; }; #endif // TASK_H qt-client-4.1.0/guiclient/task.ui000066400000000000000000000462301217451700100167030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. task 0 0 500 400 Task 12 Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 7 0 Qt::Horizontal QSizePolicy::Expanding 46 16 5 Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Concept In-Process Complete Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 0 0 true 0 1 0 Schedule Qt::StrongFocus Owner: Qt::StrongFocus Assigned to: Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Started: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Assigned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Completed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Plan Hours Budgeted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Actual: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Expenses Budgeted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Actual: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Alarms Alarms::Project Comments Comments::Task Alarms QWidget
    alarms.h
    Comments QWidget
    comments.h
    DLineEdit QWidget
    datecluster.h
    1
    UsernameCluster QWidget
    usernamecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _owner newId(int) _alarms setUsrId1(int) 102 221 636 687 _assignedTo newId(int) _alarms setUsrId2(int) 306 221 636 687 _due newDate(QDate) _alarms setDate(QDate) 197 426 636 687 _buttonBox rejected() task reject() 500 93 273 219
    qt-client-4.1.0/guiclient/taxAdjustment.cpp000066400000000000000000000103341217451700100207350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxAdjustment.h" #include #include #include #include "storedProcErrorLookup.h" taxAdjustment::taxAdjustment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxcode, SIGNAL(newID(int)), this, SLOT(sCheck())); _taxhistid = -1; _sense = 1; } taxAdjustment::~taxAdjustment() { // no need to delete child widgets, Qt does it all for us } void taxAdjustment::languageChange() { retranslateUi(this); } enum SetResponse taxAdjustment::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("order_id", &valid); if (valid) _orderid = param.toInt(); param = pParams.value("order_type", &valid); if (valid) { if (param.toString() == "I") _table = "invcheadtax"; else if (param.toString() == "B") _table = "cobmisctax"; else if (param.toString() == "CM") _table = "cmheadtax"; else if (param.toString() == "AR") _table = "aropentax"; else if (param.toString() == "AP") _table = "apopentax"; else _table = param.toString(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } } param = pParams.value("date", &valid); if (valid) _amount->setEffective(param.toDate()); param = pParams.value("curr_id", &valid); if (valid) _amount->setId(param.toInt()); param = pParams.value("sense", &valid); if (valid) _sense = param.toInt(); return NoError; } void taxAdjustment::sSave() { XSqlQuery taxSave; if (_taxcode->id() == -1) { QMessageBox::critical( this, tr("Tax Code Required"), tr( "

    You must select a tax code " " before you may save." ) ); return; } QString sql; if (_mode == cNew) sql = QString( "INSERT into %1 (taxhist_basis,taxhist_percent,taxhist_amount,taxhist_docdate, taxhist_tax_id, taxhist_tax, taxhist_taxtype_id, taxhist_parent_id ) " "VALUES (0, 0, 0, :date, :taxcode_id, :amount, getadjustmenttaxtypeid(), :order_id) ").arg(_table); else if (_mode == cEdit) sql = QString( "UPDATE taxhist " "SET taxhist_tax=:amount, taxhist_docdate=:date " "WHERE (taxhist_id=:taxhist_id) "); taxSave.prepare(sql); taxSave.bindValue(":taxhist_id", _taxhistid); taxSave.bindValue(":taxcode_id", _taxcode->id()); taxSave.bindValue(":amount", _amount->localValue() * _sense); taxSave.bindValue(":order_id", _orderid); taxSave.bindValue(":date", _amount->effective()); taxSave.exec(); if (taxSave.lastError().type() != QSqlError::NoError) { systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_orderid); } void taxAdjustment::sCheck() { XSqlQuery taxCheck; QString table; taxCheck.prepare( "SELECT taxhist_id, taxhist_tax_id, taxhist_tax " "FROM taxhist " " JOIN pg_class ON (pg_class.oid=taxhist.tableoid) " "WHERE ((taxhist_parent_id=:order_id) " " AND (taxhist_taxtype_id=getadjustmenttaxtypeid()) " " AND (taxhist_tax_id=:tax_id) " " AND (relname=:table) );" ); taxCheck.bindValue(":order_id", _orderid); taxCheck.bindValue(":tax_id", _taxcode->id()); taxCheck.bindValue(":table", _table); taxCheck.exec(); if (taxCheck.first()) { _taxhistid=taxCheck.value("taxhist_id").toInt(); _amount->setLocalValue(taxCheck.value("taxhist_tax").toDouble() * _sense); _amount->setFocus(); _mode=cEdit; } else { _taxhistid=-1; _amount->clear(); _amount->setFocus(); _mode=cNew; } } qt-client-4.1.0/guiclient/taxAdjustment.h000066400000000000000000000022001217451700100203730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXADJUSTMENT_H #define TAXADJUSTMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxAdjustment.h" class taxAdjustment : public XDialog, public Ui::taxAdjustment { Q_OBJECT public: taxAdjustment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~taxAdjustment(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sCheck(); protected slots: virtual void languageChange(); private: int _sense; int _taxhistid; int _mode; int _orderid; QString _table; }; #endif // TAXADJUSTMENT qt-client-4.1.0/guiclient/taxAdjustment.ui000066400000000000000000000147011217451700100205720ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxAdjustment 0 0 418 84 Tax Adjustment Tax Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxcode true Select a Code XComboBox::TaxCodes Qt::Horizontal 0 20 Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true true Qt::Horizontal 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 40 0 0 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 77 0 CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    XComboBox QComboBox
    xcombobox.h
    _taxcode _save _close _close clicked() taxAdjustment reject() 370 30 20 20 qt-client-4.1.0/guiclient/taxAssignment.cpp000066400000000000000000000235611217451700100207350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxAssignment.h" #include #include #include #include "metasql.h" #include "parameter.h" taxAssignment::taxAssignment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _taxCodeOption->addColumn(tr("Tax Code"), -1, Qt::AlignLeft, true, "taxcode_option" ); _taxCodeSelected->addColumn(tr("Tax Code"), -1, Qt::AlignLeft, true, "taxcode_selected" ); connect(_taxCodeOption, SIGNAL(itemSelected(int)), this, SLOT(sAdd())); connect(_taxCodeSelected, SIGNAL(itemSelected(int)), this, SLOT(sRevoke())); connect(_taxCodeOption, SIGNAL(valid(bool)), _add, SLOT(setEnabled(bool))); connect(_taxCodeSelected, SIGNAL(valid(bool)), _revoke, SLOT(setEnabled(bool))); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_revoke, SIGNAL(clicked()), this, SLOT(sRevoke())); connect(_taxZone, SIGNAL(newID(int)), this, SLOT(sPopulateTaxCode())); connect(_taxType, SIGNAL(newID(int)), this, SLOT(sPopulateTaxCode())); _mode = cNew; _taxassId = -1; } taxAssignment::~taxAssignment() { // no need to delete child widgets, Qt does it all for us } void taxAssignment::languageChange() { retranslateUi(this); } enum SetResponse taxAssignment::set(const ParameterList& pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("taxzone_id", &valid); if (valid) _taxzoneId = param.toInt(); param = pParams.value("taxtype_id", &valid); if (valid) _taxtypeId = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; sPopulate(); sPopulateTaxCode(); } else if (param.toString() == "edit") { _mode = cEdit; sPopulate(); sPopulateTaxCode(); } else if (param.toString() == "view") { _mode = cView; sPopulate(); sPopulateTaxCode(); _taxZone->setEnabled(false); _taxType->setEnabled(false); _add->setEnabled(false); _revoke->setEnabled(false); _taxCodeOption->setEnabled(false); _taxCodeSelected->setEnabled(false); } } return NoError; } void taxAssignment::sPopulate() { _taxZone->setId(_taxzoneId); _taxType->setId(_taxtypeId); } void taxAssignment::sPopulateTaxCode() { XSqlQuery taxPopulateTaxCode; ParameterList params; params.append("taxzone_id", _taxZone->id()); params.append("taxtype_id", _taxType->id()); QString sqlTaxOption("SELECT tax_id, tax_code AS taxcode_option " "FROM tax " "WHERE tax_id NOT IN (" "SELECT taxass_tax_id FROM taxass " "" "WHERE (COALESCE(taxass_taxzone_id, -1) = ) " "" "WHERE (taxass_taxzone_id IS NULL) " "" "" "AND (COALESCE(taxass_taxtype_id, -1) = ) " "" "AND (taxass_taxtype_id IS NULL) " "" ") " "AND COALESCE(tax_basis_tax_id, -1) < 0;"); MetaSQLQuery mqlTaxOption(sqlTaxOption); taxPopulateTaxCode = mqlTaxOption.toQuery(params); _taxCodeOption->clear(); _taxCodeOption->populate(taxPopulateTaxCode); if (taxPopulateTaxCode.lastError().type() != QSqlError::NoError) { systemError(this, taxPopulateTaxCode.lastError().databaseText(), __FILE__, __LINE__); return; } QString sqlTaxSelected("SELECT tax_id, tax_code AS taxcode_selected " "FROM tax " "WHERE tax_id IN (" "SELECT taxass_tax_id FROM taxass " "" "WHERE (COALESCE(taxass_taxzone_id, -1) = ) " "" "WHERE (taxass_taxzone_id IS NULL) " "" "" "AND (COALESCE(taxass_taxtype_id, -1) = ) " "" "AND (taxass_taxtype_id IS NULL) " "" ") " "AND COALESCE(tax_basis_tax_id, -1) < 0;"); MetaSQLQuery mqlTaxSelected(sqlTaxSelected); taxPopulateTaxCode = mqlTaxSelected.toQuery(params); _taxCodeSelected->clear(); _taxCodeSelected->populate(taxPopulateTaxCode); if (taxPopulateTaxCode.lastError().type() != QSqlError::NoError) { systemError(this, taxPopulateTaxCode.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxAssignment::sAdd() { XSqlQuery taxAdd; taxAdd.prepare("SELECT * FROM getSubTax(:tax_id, 1);"); taxAdd.bindValue(":tax_id", _taxCodeOption->id()); taxAdd.exec(); if(taxAdd.first()) { taxAdd.prepare("SELECT DISTINCT tax_id " "FROM tax JOIN taxass ON (tax_id = taxass_tax_id) " "LEFT OUTER JOIN taxclass ON (tax_taxclass_id = taxclass_id) " "WHERE COALESCE(taxass_taxzone_id, -1) = :taxass_taxzone_id " "AND COALESCE(taxass_taxtype_id, -1) = :taxass_taxtype_id " "AND COALESCE(taxclass_sequence, 0) IN " "(SELECT COALESCE(taxclass_sequence, 0) " "FROM taxclass RIGHT OUTER JOIN tax " "ON (taxclass_id = tax_taxclass_id) " "AND tax_id = :tax_id);"); taxAdd.bindValue(":tax_id", _taxCodeOption->id()); if(_taxZone->isValid()) taxAdd.bindValue(":taxass_taxzone_id", _taxZone->id()); else taxAdd.bindValue(":taxass_taxzone_id", -1); if(_taxType->isValid()) taxAdd.bindValue(":taxass_taxtype_id", _taxType->id()); else taxAdd.bindValue(":taxass_taxtype_id", -1); taxAdd.exec(); if(taxAdd.first()) { QMessageBox::critical(this, tr("Incorrect Tax Code"), tr("Tax codes with same group sequence as this " "tax code are already assigned to this Tax Zone / Tax Type pair. \nYou first " "need to Revoke those Tax Codes.")); return; } } else { taxAdd.prepare("SELECT DISTINCT A.tax_id, A.tax_code, A.tax_taxclass_id " "FROM tax A JOIN taxass ON (A.tax_id = taxass_tax_id) " "LEFT OUTER JOIN taxclass ON (A.tax_taxclass_id = taxclass_id), tax B " "WHERE A.tax_id = B.tax_basis_tax_id " "AND COALESCE(A.tax_basis_tax_id, 0) = 0 " "AND COALESCE(taxass_taxzone_id, -1) = :taxass_taxzone_id " "AND COALESCE(taxass_taxtype_id, -1) = :taxass_taxtype_id " "AND COALESCE(taxclass_sequence, 0) IN " "(SELECT COALESCE(taxclass_sequence, 0) " "FROM taxclass RIGHT OUTER JOIN tax " "ON (taxclass_id = tax_taxclass_id) " "AND tax_id = :tax_id);"); taxAdd.bindValue(":tax_id", _taxCodeOption->id()); if(_taxZone->isValid()) taxAdd.bindValue(":taxass_taxzone_id", _taxZone->id()); else taxAdd.bindValue(":taxass_taxzone_id", -1); if(_taxType->isValid()) taxAdd.bindValue(":taxass_taxtype_id", _taxType->id()); else taxAdd.bindValue(":taxass_taxtype_id", -1); taxAdd.exec(); if(taxAdd.first()) { QMessageBox::critical(this, tr("Incorrect Tax Code"), tr("

    Tax codes with the same group sequence as this " "one and which have subordinate taxes are already " "assigned to this Tax Zone / Tax Type pair.

    " "

    You first need to Revoke those Tax Codes.

    ")); return; } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); taxAdd.exec("BEGIN;"); taxAdd.exec("SELECT NEXTVAL('taxass_taxass_id_seq') AS _taxass_id;"); if (taxAdd.first()) _taxassId = taxAdd.value("_taxass_id").toInt(); else if (taxAdd.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, taxAdd.lastError().databaseText(), __FILE__, __LINE__); return; } taxAdd.prepare("INSERT INTO taxass(taxass_id, taxass_taxzone_id, " "taxass_taxtype_id, taxass_tax_id) " "VALUES (:taxass_id, :taxass_taxzone_id, " ":taxass_taxtype_id, :taxass_tax_id);"); taxAdd.bindValue(":taxass_id", _taxassId); if(_taxZone->isValid()) taxAdd.bindValue(":taxass_taxzone_id", _taxZone->id()); if(_taxType->isValid()) taxAdd.bindValue(":taxass_taxtype_id", _taxType->id()); taxAdd.bindValue(":taxass_tax_id", _taxCodeOption->id()); taxAdd.exec(); if (taxAdd.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, taxAdd.lastError().databaseText(), __FILE__, __LINE__); return; } taxAdd.exec("COMMIT;"); sPopulateTaxCode(); } void taxAssignment::sRevoke() { XSqlQuery taxRevoke; taxRevoke.prepare("DELETE FROM taxass " "WHERE ((taxass_tax_id = :taxass_tax_id) " "AND (COALESCE(taxass_taxzone_id, -1) = :taxass_taxzone_id) " "AND (COALESCE(taxass_taxtype_id, -1) = :taxass_taxtype_id));"); taxRevoke.bindValue(":taxass_tax_id", _taxCodeSelected->id()); taxRevoke.bindValue(":taxass_taxzone_id", _taxZone->id()); taxRevoke.bindValue(":taxass_taxtype_id", _taxType->id()); taxRevoke.exec(); if (taxRevoke.lastError().type() != QSqlError::NoError) { systemError(this, taxRevoke.lastError().databaseText(), __FILE__, __LINE__); return; } sPopulateTaxCode(); } qt-client-4.1.0/guiclient/taxAssignment.h000066400000000000000000000021721217451700100203750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXASSIGNMENT_H #define TAXASSIGNMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxAssignment.h" class taxAssignment : public XDialog, public Ui::taxAssignment { Q_OBJECT public: taxAssignment(QWidget* = 0, const char* = 0, bool = false, Qt::WFlags = 0); ~taxAssignment(); public slots: virtual SetResponse set(const ParameterList &); virtual void sPopulate(); virtual void sPopulateTaxCode(); virtual void sAdd(); virtual void sRevoke(); protected slots: virtual void languageChange(); private: bool _modal; int _mode; int _taxassId; int _taxzoneId; int _taxtypeId; }; #endif // TAXASSIGNMENT_H qt-client-4.1.0/guiclient/taxAssignment.ui000066400000000000000000000216321217451700100205650ustar00rootroot00000000000000 taxAssignment This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. 0 0 425 310 Tax Assignment 12 12 Tax Type Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Any XComboBox::TaxZones Qt::Horizontal 40 20 true Any XComboBox::TaxTypes Qt::Horizontal 40 20 Qt::Vertical 20 0 Qt::Horizontal 0 20 0 &Close Qt::Vertical 20 0 0 1 QFrame::StyledPanel QFrame::Raised 0 0 0 0 0 false Add-> false <-Revoke Qt::Vertical 20 0 0 5 XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _close clicked() taxAssignment reject() 353 37 302 26
    qt-client-4.1.0/guiclient/taxAssignments.cpp000066400000000000000000000110241217451700100211070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxAssignments.h" #include "taxAssignment.h" #include #include "metasql.h" #include "parameter.h" taxAssignments::taxAssignments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_showAll, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_showAllTypes, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_taxass, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_taxZone, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_taxType, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainTaxAssignments")) { connect(_taxass, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_taxass, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_taxass, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(false); connect(_taxass, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _taxass->addColumn(tr("Tax Zone/Code"), -1, Qt::AlignLeft, true, "taxassign_zone_code"); _taxass->addColumn(tr("Tax Type/Description"), 100, Qt::AlignLeft, true, "taxassign_type_descrip"); _taxass->addColumn(tr("Tax Class"), 100, Qt::AlignLeft, true, "taxassign_taxclass_code"); _taxass->addColumn(tr("Group Sequence"), 100, Qt::AlignLeft, true, "taxassign_taxclass_sequence"); _taxass->setIndentation(10); sFillList(); } taxAssignments::~taxAssignments() { // no need to delete child widgets, Qt does it all for us } void taxAssignments::languageChange() { retranslateUi(this); } void taxAssignments::sNew() { ParameterList params; params.append("mode", "new"); taxAssignment newdlg(this, "", true); newdlg.set(params); newdlg.exec(); sFillList(); } void taxAssignments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("taxzone_id", _taxass->id()); params.append("taxtype_id", _taxass->altId()); taxAssignment newdlg(this, "", true); newdlg.set(params); newdlg.exec(); sFillList(); } void taxAssignments::sView() { ParameterList params; params.append("mode", "view"); params.append("taxzone_id", _taxass->id()); params.append("taxtype_id", _taxass->altId()); taxAssignment newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } void taxAssignments::sDelete() { XSqlQuery taxDelete; taxDelete.prepare("DELETE FROM taxass WHERE ((COALESCE(taxass_taxzone_id, -1) = :taxzone_id) " "AND (COALESCE(taxass_taxtype_id, -1) = :taxtype_id));"); taxDelete.bindValue(":taxzone_id", _taxass->id()); taxDelete.bindValue(":taxtype_id", _taxass->altId()); taxDelete.exec(); if (taxDelete.lastError().type() != QSqlError::NoError) { systemError(this, taxDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void taxAssignments::sFillList() { ParameterList params; if (! _showAll->isChecked()) params.append("taxzone_id", _taxZone->id()); if (! _showAllTypes->isChecked()) params.append("taxtype_id", _taxType->id()); QString sql("SELECT taxassign_taxzone_id, taxassign_taxtype_id, taxassign_level AS xtindentrole, " "COALESCE(taxassign_zone_code, '~Any~') AS taxassign_zone_code, " "COALESCE(taxassign_type_descrip, '~Any~') AS taxassign_type_descrip, " "taxassign_taxclass_code, taxassign_taxclass_sequence, COALESCE(taxassign_taxclass_sequence, -1) AS dummy_seq " "FROM taxassignments(, ) " "ORDER BY taxassign_taxzone_id, taxassign_taxtype_id, dummy_seq, xtindentrole;"); MetaSQLQuery mql(sql); XSqlQuery r = mql.toQuery(params); _taxass->populate(r, true); if (r.lastError().type() != QSqlError::NoError) { systemError(this, r.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/taxAssignments.h000066400000000000000000000020511217451700100205540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXASSIGNMENTS_H #define TAXASSIGNMENTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_taxAssignments.h" class taxAssignments : public XWidget, public Ui::taxAssignments { Q_OBJECT public: taxAssignments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~taxAssignments(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sNew(); virtual void sView(); protected slots: virtual void languageChange(); private: int _taxZoneid; int _taxTypeid; }; #endif // TAXASSIGNMENTS_H qt-client-4.1.0/guiclient/taxAssignments.ui000066400000000000000000000331611217451700100207500ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxAssignments 0 0 800 600 0 1 List Tax Assignments 12 12 Tax Zones 6 0 All true Qt::Horizontal 161 20 6 0 Specific Tax Zone: false true Any XComboBox::TaxZones Qt::Horizontal 40 20 Tax Types 6 0 All true Qt::Horizontal 161 20 6 0 Specific Tax Type: false true Any XComboBox::TaxTypes Qt::Horizontal 40 20 Qt::Horizontal 78 81 0 0 Close Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 Tax Assignments: 6 0 0 5 0 0 New false Edit false View false Delete Qt::Vertical 20 0 XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _close clicked() taxAssignments close() 737 26 399 299 _showOne toggled(bool) _taxZone setEnabled(bool) 115 51 293 51 _showOneType toggled(bool) _taxType setEnabled(bool) 350 85 446 85
    qt-client-4.1.0/guiclient/taxAuthorities.cpp000066400000000000000000000105231217451700100211170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxAuthorities.h" #include #include #include #include "errorReporter.h" #include "parameterwidget.h" #include "taxAuthority.h" taxAuthorities::taxAuthorities(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "taxAuthorities", fl) { setWindowTitle(tr("Tax Authorities")); setReportName("TaxAuthoritiesMasterList"); setMetaSQLOptions("taxAuthorities", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Tax Authority Code Pattern"), "taxauth_code_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Tax Authority Name Pattern"), "taxauth_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text); parameterWidget()->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text); parameterWidget()->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Postal Code Pattern"), "addr_postalcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text); connect(omfgThis, SIGNAL(taxAuthsUpdated(int)), this, SLOT(sFillList())); list()->addColumn(tr("Code"), 70, Qt::AlignLeft, true, "taxauth_code" ); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "taxauth_name" ); list()->addColumn(tr("Address"), -1, Qt::AlignLeft , true, "addr_line1" ); list()->addColumn(tr("City"), 75, Qt::AlignLeft , true, "addr_city" ); list()->addColumn(tr("State"), 50, Qt::AlignLeft , true, "addr_state" ); list()->addColumn(tr("Country"), 100, Qt::AlignLeft , true, "addr_country" ); list()->addColumn(tr("Postal Code"), 75, Qt::AlignLeft , false, "addr_postalcode" ); if (_privileges->check("MaintainTaxAuthorities")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } } void taxAuthorities::sDelete() { if (QMessageBox::question(this, tr("Delete Tax Authority?"), tr("

    Are you sure you want to delete the " "selected Tax Authority?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM taxauth WHERE (taxauth_id=:taxauth_id);"); delq.bindValue(":taxauth_id", list()->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting"), delq, __FILE__, __LINE__)) return; sFillList(); } void taxAuthorities::sNew() { ParameterList params; params.append("mode", "new"); taxAuthority newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(); } void taxAuthorities::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("taxauth_id", list()->id()); taxAuthority newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(); } void taxAuthorities::sView() { ParameterList params; params.append("mode", "view"); params.append("taxauth_id", list()->id()); taxAuthority newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void taxAuthorities::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction("View...", this, SLOT(sView())); menuItem = pMenu->addAction("Edit...", this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainTaxAuthorities")); menuItem = pMenu->addAction("Delete", this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainTaxAuthorities")); } qt-client-4.1.0/guiclient/taxAuthorities.h000066400000000000000000000015661217451700100205730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXAUTHORITIES_H #define TAXAUTHORITIES_H #include "display.h" class taxAuthorities : public display { Q_OBJECT public: taxAuthorities(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // TAXAUTHORITIES_H qt-client-4.1.0/guiclient/taxAuthority.cpp000066400000000000000000000276041217451700100206170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxAuthority.h" #include #include #include #include #include "storedProcErrorLookup.h" #include "crmaccount.h" #include "errorReporter.h" #include "guiErrorCheck.h" taxAuthority::taxAuthority(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_crmacct, SIGNAL(clicked()), this, SLOT(sCrmAccount())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _crmacctid = -1; _mode = cView; _taxauthid = -1; _NumberGen = -1; } taxAuthority::~taxAuthority() { // no need to delete child widgets, Qt does it all for us } void taxAuthority::languageChange() { retranslateUi(this); } enum SetResponse taxAuthority::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("crmacct_id", &valid); if (valid) _crmacctid = param.toInt(); param = pParams.value("taxauth_id", &valid); if (valid) _taxauthid = param.toInt(); if (_taxauthid > 0 || _crmacctid > 0) if (! sPopulate()) return UndefinedError; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; if(((_metrics->value("CRMAccountNumberGeneration") == "A") || (_metrics->value("CRMAccountNumberGeneration") == "O")) && _code->text().isEmpty() ) { XSqlQuery numq; numq.exec("SELECT fetchCRMAccountNumber() AS number;"); if (numq.first()) { _code->setText(numq.value("number")); _NumberGen = numq.value("number").toInt(); } } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _close->setText(tr("&Close")); _save->hide(); } } bool canEdit = (cNew == _mode || cEdit == _mode); _code->setEnabled(FALSE); _code->setEnabled(canEdit && _metrics->value("CRMAccountNumberGeneration") != "A"); _address->setEnabled(canEdit); _county->setEnabled(canEdit); // _crmacct is handled in sPopulate() _currency->setEnabled(canEdit); _extref->setEnabled(canEdit); _glaccnt->setReadOnly(! canEdit); _name->setEnabled(canEdit); return NoError; } void taxAuthority::sCheck() { _code->setText(_code->text().trimmed()); if ( (_mode == cNew) && (_code->text().length()) ) { if(cNew == _mode && -1 != _NumberGen && _code->text().toInt() != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } XSqlQuery getq; getq.prepare( "SELECT taxauth_id " "FROM taxauth " "WHERE (UPPER(taxauth_code)=UPPER(:taxauth_code));" ); getq.bindValue(":taxauth_code", _code->text()); getq.exec(); if (getq.first()) { _taxauthid = getq.value("taxauth_id").toInt(); _mode = cEdit; sPopulate(); _code->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error checking for existing Tax Authority"), getq, __FILE__, __LINE__)) return; } } bool taxAuthority::sSave() { QList errors; errors << GuiErrorCheck(_code->text().isEmpty(), _code, tr("You must enter a valid Code.")) ; XSqlQuery dupq; dupq.prepare("SELECT taxauth_id " "FROM taxauth " "WHERE ( (taxauth_id<>:taxauth_id)" " AND (UPPER(taxauth_code)=UPPER(:taxauth_code)) );"); dupq.bindValue(":taxauth_id", _taxauthid); dupq.bindValue(":taxauth_code", _code->text().trimmed()); dupq.exec(); if (dupq.first()) errors << GuiErrorCheck(true, _code, tr("A Tax Authority with the entered code already " "exists. You may not create a Tax Authority " "with this code.")); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Cannot Create Tax Authority"), dupq, __FILE__, __LINE__)) return false; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Tax Authority"), errors)) return false; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); int saveResult = _address->save(AddressCluster::CHECK); if (-2 == saveResult) { int answer = QMessageBox::question(this, tr("Question Saving Address"), tr("

    There are multiple uses of this " "Address. What would you like to do?"), tr("Change This One"), tr("Change Address for All"), tr("Cancel"), 2, 2); if (0 == answer) saveResult = _address->save(AddressCluster::CHANGEONE); else if (1 == answer) saveResult = _address->save(AddressCluster::CHANGEALL); } if (saveResult < 0) // not else-if: this is error check for CHANGE{ONE,ALL} { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error saving Address"), storedProcErrorLookup("saveAddr", saveResult), __FILE__, __LINE__); _address->setFocus(); return false; } XSqlQuery upsq; if (_mode == cEdit) { upsq.prepare( "UPDATE taxauth " " SET taxauth_code=:taxauth_code," " taxauth_name=:taxauth_name," " taxauth_extref=:taxauth_extref," " taxauth_curr_id=:taxauth_curr_id," " taxauth_addr_id=:taxauth_addr_id," " taxauth_county=:taxauth_county," " taxauth_accnt_id=:taxauth_accnt_id " "WHERE (taxauth_id=:taxauth_id) " "RETURNING taxauth_id;" ); upsq.bindValue(":taxauth_id", _taxauthid); } else if (_mode == cNew) upsq.prepare( "INSERT INTO taxauth " "( taxauth_id, taxauth_code, taxauth_name, taxauth_extref," " taxauth_curr_id, taxauth_addr_id, taxauth_county," " taxauth_accnt_id) " "VALUES " "( DEFAULT, :taxauth_code, :taxauth_name, :taxauth_extref," " :taxauth_curr_id, :taxauth_addr_id, :taxauth_county," " :taxauth_accnt_id) " "RETURNING taxauth_id;" ); upsq.bindValue(":taxauth_code", _code->text().trimmed()); upsq.bindValue(":taxauth_name", _name->text()); upsq.bindValue(":taxauth_extref", _extref->text()); if(_currency->isValid()) upsq.bindValue(":taxauth_curr_id", _currency->id()); if(_address->isValid()) upsq.bindValue(":taxauth_addr_id", _address->id()); upsq.bindValue(":taxauth_county", _county->text()); if(_glaccnt->isValid()) upsq.bindValue(":taxauth_accnt_id", _glaccnt->id()); upsq.exec(); if (upsq.first()) _taxauthid = upsq.value("taxauth_id").toInt(); else if (upsq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Cannot save Tax Authority"), upsq, __FILE__, __LINE__); return false; } XSqlQuery commit("COMMIT;"); _NumberGen = -1; omfgThis->sTaxAuthsUpdated(_taxauthid); done(_taxauthid); return true; } bool taxAuthority::sPopulate() { XSqlQuery getq; if (_taxauthid > 0) { getq.prepare("SELECT taxauth_code, taxauth_name," " COALESCE(taxauth_curr_id,-1) AS curr_id," " COALESCE(taxauth_addr_id,-1) AS addr_id," " taxauth_county, taxauth_accnt_id," " taxauth_extref, crmacct_id, crmacct_owner_username" " FROM taxauth" " JOIN crmacct ON (crmacct_taxauth_id=taxauth_id)" " WHERE (taxauth_id=:id);"); getq.bindValue(":id", _taxauthid); } else if (_crmacctid > 0) { getq.prepare("SELECT crmacct_number AS taxauth_code," " crmacct_name AS taxauth_name," " -1 AS curr_id, -1 AS addr_id," " NULL AS taxauth_county, NULL AS taxauth_accnt_id," " NULL AS taxauth_extref, crmacct_id, crmacct_owner_username" " FROM crmacct" " WHERE (crmacct_id=:id);"); getq.bindValue(":id", _crmacctid); } getq.exec(); if (getq.first()) { _code->setText(getq.value("taxauth_code").toString()); _name->setText(getq.value("taxauth_name").toString()); _extref->setText(getq.value("taxauth_extref").toString()); _currency->setId(getq.value("curr_id").toInt()); _address->setId(getq.value("addr_id").toInt()); _crmacctid = getq.value("crmacct_id").toInt(); _crmowner = getq.value("crmacct_owner_username").toString(); _county->setText(getq.value("taxauth_county").toString()); _glaccnt->setId(getq.value("taxauth_accnt_id").toInt()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), getq, __FILE__, __LINE__)) return false; _address->setSearchAcct(_crmacctid); _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); return true; } void taxAuthority::done( int r ) { XDialog::done( r ); close(); } void taxAuthority::closeEvent(QCloseEvent *pEvent) { if(cNew == _mode && -1 != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } XDialog::closeEvent(pEvent); } void taxAuthority::sCrmAccount() { ParameterList params; params.append("crmacct_id", _crmacctid); if ((cView == _mode && _privileges->check("ViewAllCRMAccounts")) || (cView == _mode && _privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner) || (cEdit == _mode && _privileges->check("ViewAllCRMAccounts") && ! _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("ViewPersonalCRMAccounts") && ! _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else if ((cEdit == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if ((cNew == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cNew == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else { qWarning("tried to open CRM Account window without privilege"); return; } crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } qt-client-4.1.0/guiclient/taxAuthority.h000066400000000000000000000023641217451700100202600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXAUTHORITY_H #define TAXAUTHORITY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxAuthority.h" class taxAuthority : public XDialog, public Ui::taxAuthority { Q_OBJECT public: taxAuthority(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~taxAuthority(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sCrmAccount(); virtual bool sSave(); virtual bool sPopulate(); virtual void done(int); protected slots: virtual void languageChange(); protected: virtual void closeEvent(QCloseEvent*); private: int _crmacctid; int _mode; int _taxauthid; int _NumberGen; QString _crmowner; }; #endif // PRODUCTCATEGORY_H qt-client-4.1.0/guiclient/taxAuthority.ui000066400000000000000000000221241217451700100204420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxAuthority 0 0 728 498 Tax Authority Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code Qt::Horizontal QSizePolicy::Expanding 0 20 false CRM Account... &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 20 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name Ext. Ref.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _extref Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _currency 0 true XComboBox::Currencies Qt::Horizontal QSizePolicy::Expanding 20 20 County: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Default G/L Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _glaccnt 3 0 Qt::Horizontal 0 20 Qt::Vertical 610 5 AddressCluster QWidget

    addresscluster.h
    GLCluster QWidget
    glcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _name _extref _currency _county _glaccnt _address _close clicked() taxAuthority reject() 20 20 20 20 qt-client-4.1.0/guiclient/taxBreakdown.cpp000066400000000000000000000222771217451700100205440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxBreakdown.h" #include #include #include #include "mqlutil.h" #include "taxCache.h" #include "taxDetail.h" taxBreakdown::taxBreakdown(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _currency->setLabel(_currencyLit); _taxcurrency->setLabel(_taxcurrencyLit); connect(_adjTaxLit, SIGNAL(leftClickedURL(QString)),this, SLOT(sAdjTaxDetail())); connect(_freightTaxLit,SIGNAL(leftClickedURL(QString)),this, SLOT(sFreightTaxDetail())); connect(_lineTaxLit, SIGNAL(leftClickedURL(QString)),this, SLOT(sLineTaxDetail())); connect(_totalTaxLit, SIGNAL(leftClickedURL(QString)),this, SLOT(sTotalTaxDetail())); _orderid = -1; _ordertype = ""; _sense = 1; } taxBreakdown::~taxBreakdown() { // no need to delete child widgets, Qt does it all for us } void taxBreakdown::languageChange() { retranslateUi(this); } SetResponse taxBreakdown::set(const ParameterList& pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("order_id", &valid); if (valid) _orderid = param.toInt(); param = pParams.value("order_type", &valid); if (valid) _ordertype = param.toString(); param = pParams.value("mode", &valid); if (valid) { if(param.toString() == "view") _mode = cView; else _mode = cEdit; } param = pParams.value("sense", &valid); if (valid) _sense = param.toInt(); sPopulate(); return NoError; } void taxBreakdown::sAdjTaxDetail() { XSqlQuery taxAdjTaxDetail; taxDetail newdlg(this, "", true); ParameterList params; params.append("curr_id", _taxcurrency->id()); params.append("date", _adjTax->effective()); if (cView == _mode) params.append("readOnly"); taxAdjTaxDetail.exec("SELECT getadjustmenttaxtypeid() as taxtype;"); if(taxAdjTaxDetail.first()) params.append("taxtype_id", taxAdjTaxDetail.value("taxtype").toInt()); params.append("order_type", _ordertype); params.append("order_id", _orderid); params.append("display_type", "A"); params.append("adjustment"); params.append("sense", _sense); if (newdlg.set(params) == NoError) { newdlg.exec(); sPopulate(); } } void taxBreakdown::sFreightTaxDetail() { XSqlQuery taxFreightTaxDetail; taxDetail newdlg(this, "", true); ParameterList params; params.append("curr_id", _taxcurrency->id()); params.append("date", _freight->effective()); params.append("subtotal",CurrDisplay::convert(_freight->id(), _taxcurrency->id(), _freight->localValue(), _freight->effective())); params.append("sense", _sense); if (_ordertype == "S" || _ordertype == "Q" || _ordertype == "RA") { params.append("taxzone_id", _taxzone->id()); taxFreightTaxDetail.exec("SELECT getfreighttaxtypeid() as taxtype;"); if(taxFreightTaxDetail.first()) params.append("taxtype_id", taxFreightTaxDetail.value("taxtype").toInt()); params.append("date", _freight->effective()); params.append("readOnly"); if (newdlg.set(params) == NoError) newdlg.exec(); } else if (_ordertype == "I" || _ordertype == "B" || _ordertype == "CM" || _ordertype == "TO") { taxFreightTaxDetail.exec("SELECT getfreighttaxtypeid() as taxtype;"); if(taxFreightTaxDetail.first()) params.append("taxtype_id", taxFreightTaxDetail.value("taxtype").toInt()); params.append("order_type", _ordertype); params.append("order_id", _orderid); params.append("display_type", "F"); params.append("readOnly"); if (newdlg.set(params) == NoError) newdlg.exec(); } } void taxBreakdown::sLineTaxDetail() { taxDetail newdlg(this, "", true); ParameterList params; params.append("order_type", _ordertype); params.append("order_id", _orderid); params.append("display_type", "L"); params.append("curr_id", _taxcurrency->id()); params.append("date", _line->effective()); params.append("subtotal",CurrDisplay::convert(_line->id(), _taxcurrency->id(), _line->localValue(), _line->effective())); params.append("readOnly"); params.append("sense", _sense); if (newdlg.set(params) == NoError) newdlg.exec(); } void taxBreakdown::sTotalTaxDetail() { taxDetail newdlg(this, "", true); ParameterList params; params.append("order_type", _ordertype); params.append("order_id", _orderid); params.append("display_type", "T"); params.append("curr_id", _taxcurrency->id()); params.append("date", _total->effective()); params.append("subtotal",CurrDisplay::convert(_pretax->id(), _taxcurrency->id(), _pretax->localValue(), _pretax->effective())); params.append("readOnly"); params.append("sense", _sense); if (newdlg.set(params) == NoError) newdlg.exec(); } void taxBreakdown::sPopulate() { XSqlQuery taxPopulate; ParameterList params; if (_ordertype == "I") { _currencyLit->setText(tr("Invoice Currency:")); _header->setText(tr("Tax Breakdown for Invoice:")); _totalLit->setText(tr("Invoice Total:")); params.append("invchead_id", _orderid); } else if (_ordertype == "S") { _currencyLit->setText(tr("Sales Order Currency:")); _header->setText(tr("Tax Breakdown for Sales Order:")); _totalLit->setText(tr("Sales Order Total:")); _adjTaxLit->setVisible(false); _adjTax->setVisible(false); params.append("cohead_id", _orderid); } else if (_ordertype == "Q") { _currencyLit->setText(tr("Quote Currency:")); _header->setText(tr("Tax Breakdown for Quote:")); _totalLit->setText(tr("Quote Total:")); _adjTaxLit->setVisible(false); _adjTax->setVisible(false); params.append("quhead_id", _orderid); } else if (_ordertype == "RA") { _currencyLit->setText(tr("Return Authorization Currency:")); _header->setText(tr("Tax Breakdown for Return:")); _totalLit->setText(tr("Return Total:")); _adjTaxLit->setVisible(false); _adjTax->setVisible(false); params.append("rahead_id", _orderid); } else if (_ordertype == "B") { _currencyLit->setText(tr("Billing Currency:")); _header->setText(tr("Tax Breakdown for Billing Order:")); _totalLit->setText(tr("Billing Total:")); params.append("cobmisc_id", _orderid); } else if (_ordertype == "CM") { _currencyLit->setText(tr("Credit Memo Currency:")); _header->setText(tr("Tax Breakdown for Credit Memo:")); _totalLit->setText(tr("Credit Memo Total:")); params.append("cmhead_id", _orderid); } else if (_ordertype == "TO") { _currencyLit->setText(tr("Transfer Order Currency:")); _header->setText(tr("Tax Breakdown for Transfer Order:")); _totalLit->setText(tr("Transfer Order Total:")); _adjTaxLit->setVisible(false); _adjTax->setVisible(false); _freightTaxLit->setVisible(false); _freightTax->setVisible(false); params.append("tohead_id", _orderid); } else if (_ordertype == "PO") { _currencyLit->setText(tr("Purchase Order Currency:")); _header->setText(tr("Tax Breakdown for Purchase Order:")); _totalLit->setText(tr("Purchase Order Total:")); _adjTaxLit->setVisible(false); _adjTax->setVisible(false); _freightTaxLit->setVisible(false); _freightTax->setVisible(false); params.append("pohead_id", _orderid); } else if (_ordertype == "VO") { _currencyLit->setText(tr("Voucher Currency:")); _header->setText(tr("Tax Breakdown for Voucher:")); _totalLit->setText(tr("Voucher Total:")); _freightTaxLit->setVisible(false); _freightTax->setVisible(false); params.append("vohead_id", _orderid); } MetaSQLQuery mql = mqlLoad("taxBreakdown", "detail"); taxPopulate = mql.toQuery(params); if (taxPopulate.first()) { // do dates and currencies first because of signal/slot cascades _total->setEffective(taxPopulate.value("date").toDate()); _currency->setId(taxPopulate.value("curr_id").toInt()); _taxcurrency->setId(taxPopulate.value("tax_curr_id").toInt()); // now the rest _document->setText(taxPopulate.value("number").toString()); _taxzone->setId(taxPopulate.value("taxzone_id").toInt()); _line->setLocalValue(taxPopulate.value("line").toDouble()); _lineTax->setLocalValue(taxPopulate.value("total_tax").toDouble()); _freight->setLocalValue(taxPopulate.value("freight").toDouble()); _freightTax->setLocalValue(taxPopulate.value("freighttaxamt").toDouble()); _adjTax->setLocalValue(taxPopulate.value("adjtaxamt").toDouble()); _pretax->setLocalValue(_line->localValue() + _freight->localValue()); _totalTax->setLocalValue(_lineTax->localValue() + _freightTax->localValue() + _adjTax->localValue()); _total->setLocalValue(_pretax->localValue() + _totalTax->localValue()); } else if (taxPopulate.lastError().type() != QSqlError::NoError) systemError(this, taxPopulate.lastError().databaseText(), __FILE__, __LINE__); } qt-client-4.1.0/guiclient/taxBreakdown.h000066400000000000000000000022531217451700100202010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXBREAKDOWN_H #define TAXBREAKDOWN_H #include "guiclient.h" #include "xdialog.h" #include #include "taxCache.h" #include "ui_taxBreakdown.h" class taxBreakdown : public XDialog, public Ui::taxBreakdown { Q_OBJECT public: taxBreakdown(QWidget* = 0, const char* = 0, bool = 0, Qt::WFlags = 0); ~taxBreakdown(); public slots: void languageChange(); virtual SetResponse set(const ParameterList&); virtual void sAdjTaxDetail(); virtual void sFreightTaxDetail(); virtual void sLineTaxDetail(); virtual void sTotalTaxDetail(); virtual void sPopulate(); private: int _mode; int _orderid; int _sense; QString _ordertype; }; #endif // TAXBREAKDOWN_H qt-client-4.1.0/guiclient/taxBreakdown.ui000066400000000000000000000460761217451700100204020ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxBreakdown 0 0 664 349 Tax Breakdown true 12 12 6 0 6 0 6 0 Tax Breakdown for Document: false Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 20 0 0 0 Close Qt::Vertical QSizePolicy::Expanding 20 0 Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false true None XComboBox::TaxZones Qt::Horizontal 0 20 Document Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false XComboBox::Currencies Qt::Horizontal 0 20 Tax Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false XComboBox::Currencies Qt::Horizontal 0 20 Taxable Line Item Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Line Item Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Freight Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Freight Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Misc. Tax Adjustment: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Horizontal Pre-Tax Total Value: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Total Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false true false Order Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Vertical 20 0 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XURLLabel QLabel
    xurllabel.h
    _close clicked() taxBreakdown reject() 369 22 213 123 _currency newID(int) _total setId(int) 165 77 261 283 _total idChanged(int) _line setId(int) 261 283 161 102 _total idChanged(int) _freight setId(int) 261 283 161 131 _totalTax idChanged(int) _lineTax setId(int) 544 235 468 102 _totalTax idChanged(int) _freightTax setId(int) 544 235 468 131 _totalTax idChanged(int) _adjTax setId(int) 544 235 468 160 _taxcurrency newID(int) _totalTax setId(int) 544 118 468 223 _total effectiveChanged(QDate) _line setEffective(QDate) 261 283 161 102 _total effectiveChanged(QDate) _freight setEffective(QDate) 261 283 161 131 _total effectiveChanged(QDate) _lineTax setEffective(QDate) 261 283 468 102 _total effectiveChanged(QDate) _freightTax setEffective(QDate) 261 283 468 131 _total effectiveChanged(QDate) _adjTax setEffective(QDate) 261 283 468 160 _total effectiveChanged(QDate) _totalTax setEffective(QDate) 261 283 468 223 _total effectiveChanged(QDate) _pretax setEffective(QDate) 261 283 261 239 _total idChanged(int) _pretax setId(int) 261 283 261 239
    qt-client-4.1.0/guiclient/taxCache.cpp000066400000000000000000000107131217451700100176230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxCache.h" #include void taxCache::clear() { for (unsigned h = Pct; h <= Amount; h++) for (unsigned i = A; i <= C; i++) for (unsigned j = Line; j <= Adj; j++) cache[h][i][j] = 0.0; for (unsigned i = Tax; i <= Type; i++) for (unsigned j = Line; j <= Adj; j++) ids[i][j] = 0; } taxCache::taxCache() { clear(); } taxCache::taxCache(taxCache& p) { for (unsigned h = Pct; h <= Amount; h++) for (unsigned i = A; i <= C; i++) for (unsigned j = Line; j <= Adj; j++) cache[h][i][j] = p.cache[h][i][j]; for (unsigned i = Tax; i <= Type; i++) for (unsigned j = Line; j <= Adj; j++) ids[i][j] = p.ids[i][j]; } taxCache::~taxCache() { } double taxCache::adj() const { return adj(0) + adj(1) + adj(2); } double taxCache::adj(unsigned p) const { return cache[Amount][p][Adj]; } int taxCache::adjId() const { return ids[Tax][Adj]; } int taxCache::adjType() const { return ids[Type][Adj]; } double taxCache::adjPct() const { return adjPct(0) + adjPct(1) + adjPct(2); } double taxCache::adjPct(unsigned p) const { return cache[Pct][p][Adj]; } double taxCache::freight() const { return freight(0) + freight(1) + freight(2); } double taxCache::freight(unsigned p) const { return cache[Amount][p][Freight]; } int taxCache::freightId() const { return ids[Tax][Freight]; } int taxCache::freightType() const { return ids[Type][Freight]; } double taxCache::freightPct() const { return freightPct(0) + freightPct(1) + freightPct(2); } double taxCache::freightPct(unsigned p) const { return cache[Pct][p][Freight]; } double taxCache::line() const { return line(0) + line(1) + line(2); } double taxCache::line(unsigned p) const { return cache[Amount][p][Line]; } double taxCache::linePct() const { return linePct(0) + linePct(1) + linePct(2); } double taxCache::linePct(unsigned p) const { return cache[Pct][p][Line]; } void taxCache::setAdj(const double a, const double b, const double c) { cache[Amount][A][Adj] = a; cache[Amount][B][Adj] = b; cache[Amount][C][Adj] = c; } void taxCache::setAdjPct(const double a, const double b, const double c) { cache[Pct][A][Adj] = a; cache[Pct][B][Adj] = b; cache[Pct][C][Adj] = c; } void taxCache::setAdjId(const int p) { ids[Tax][Adj] = p; } void taxCache::setAdjType(const int p) { ids[Type][Adj] = p; } void taxCache::setFreight(const double a, const double b, const double c) { cache[Amount][A][Freight] = a; cache[Amount][B][Freight] = b; cache[Amount][C][Freight] = c; } void taxCache::setFreightPct(const double a, const double b, const double c) { cache[Pct][A][Freight] = a; cache[Pct][B][Freight] = b; cache[Pct][C][Freight] = c; } void taxCache::setFreightId(const int p) { ids[Tax][Freight] = p; } void taxCache::setFreightType(const int p) { ids[Type][Freight] = p; } void taxCache::setLine(const double a, const double b, const double c) { cache[Amount][A][Line] = a; cache[Amount][B][Line] = b; cache[Amount][C][Line] = c; } void taxCache::setLinePct(const double a, const double b, const double c) { cache[Pct][A][Line] = a; cache[Pct][B][Line] = b; cache[Pct][C][Line] = c; } double taxCache::total() const { return line() + freight() + adj(); } double taxCache::total(unsigned p) const { return line(p) + freight(p) + adj(p); } QString taxCache::toString() const { QString result = ""; QString id[] = { "Tax", "Type" }; QString info[] = { "Pct", "Amount" }; QString rate[] = { "A", "B", "C" }; QString part[] = { "Line", "Freight", "Adj" }; for (unsigned h = Pct; h <= Amount; h++) { for (unsigned i = A; i <= C; i++) { result += info[h] + " " + rate[i] + ":"; for (unsigned j = Line; j <= Adj; j++) result += "\t" + part[j] + " = " + QString::number(cache[h][i][j]); result += "\n"; } result += "\n"; } for (unsigned i = Tax; i <= Type; i++) { result += id[i] + ":"; for (unsigned j = Line; j <= Adj; j++) result += "\t" + part[j] + " = " + QString::number(ids[i][j]); result += "\n"; } return result; } qt-client-4.1.0/guiclient/taxCache.h000066400000000000000000000042771217451700100173000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXCACHE_H #define TAXCACHE_H class QString; class taxCache { public: taxCache(); taxCache(taxCache&); virtual ~taxCache(); virtual void clear(); virtual double adj() const; virtual double adj(unsigned) const; virtual int adjId() const; virtual double adjPct() const; virtual double adjPct(unsigned) const; virtual int adjType() const; virtual double freight() const; virtual double freight(unsigned) const; virtual int freightId() const; virtual double freightPct() const; virtual double freightPct(unsigned) const; virtual int freightType() const; virtual double line() const; virtual double line(unsigned) const; virtual double linePct() const; virtual double linePct(unsigned) const; virtual double total() const; virtual double total(unsigned) const; virtual void setAdj(const double, const double = 0, const double = 0); virtual void setAdjId(const int); virtual void setAdjPct(const double, const double = 0, const double = 0); virtual void setAdjType(const int); virtual void setFreight(const double, const double = 0, const double = 0); virtual void setFreightId(const int); virtual void setFreightPct(const double, const double = 0, const double = 0); virtual void setFreightType(const int); virtual void setLine(const double, const double = 0, const double = 0); virtual void setLinePct(const double, const double = 0, const double = 0); virtual QString toString() const; protected: enum Id { Tax, Type }; enum Info { Pct, Amount }; enum Rate { A, B, C }; enum Part { Line, Freight, Adj }; double cache[2][3][4]; // [Info] x [Rate] x [Part] int ids[2][4]; // [Id] x [Part] }; #endif // TAXCACHE_H qt-client-4.1.0/guiclient/taxClass.cpp000066400000000000000000000131511217451700100176640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxClass.h" #include #include #include #include #include "storedProcErrorLookup.h" taxClass::taxClass(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxClass, SIGNAL(editingFinished()), this, SLOT(sCheck())); } taxClass::~taxClass() { // no need to delete child widgets, Qt does it all for us } void taxClass::languageChange() { retranslateUi(this); } enum SetResponse taxClass::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("taxclass_id", &valid); if (valid) { _taxclassid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _taxClass->setEnabled(FALSE); _description->setEnabled(FALSE); _seq->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void taxClass::sCheck() { XSqlQuery taxCheck; _taxClass->setText(_taxClass->text().trimmed()); if ( (_mode == cNew) && (_taxClass->text().length()) ) { taxCheck.prepare( "SELECT taxclass_id " "FROM taxclass " "WHERE (UPPER(taxclass_code) = UPPER(:taxclass_code));" ); taxCheck.bindValue(":taxclass_code", _taxClass->text()); taxCheck.exec(); if (taxCheck.first()) { _taxclassid = taxCheck.value("taxclass_id").toInt(); _mode = cEdit; populate(); _taxClass->setEnabled(FALSE); } } } void taxClass::sSave() { XSqlQuery taxSave; if (_taxClass->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Tax Class"), tr("You must enter a valid Code.") ); return; } if (_mode == cEdit) { taxSave.prepare( "SELECT taxclass_id " "FROM taxclass " "WHERE ( (taxclass_id <> :taxclass_id)" " AND (UPPER(taxclass_code) = UPPER(:taxclass_code)) );"); taxSave.bindValue(":taxclass_id", _taxclassid); } else { taxSave.prepare( "SELECT taxclass_id " "FROM taxclass " "WHERE (taxclass_code = :taxclass_code);"); } taxSave.bindValue(":taxclass_code", _taxClass->text().trimmed()); taxSave.exec(); if (taxSave.first()) { QMessageBox::critical( this, tr("Cannot Create Tax Class"), tr( "A Tax Class with the entered code already exists." "You may not create a Tax Class with this code." ) ); _taxClass->setFocus(); return; } else if (taxSave.lastError().type() != QSqlError::NoError) { systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); taxSave.exec("BEGIN;"); if (_mode == cEdit) { taxSave.prepare( "UPDATE taxclass " "SET taxclass_code=:taxclass_code," " taxclass_descrip=:taxclass_descrip, " " taxclass_sequence=:taxclass_sequence " "WHERE (taxclass_id=:taxclass_id);" ); } else if (_mode == cNew) { taxSave.exec("SELECT NEXTVAL('taxclass_taxclass_id_seq') AS taxclass_id;"); if (taxSave.first()) _taxclassid = taxSave.value("taxclass_id").toInt(); else if (taxSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } taxSave.prepare( "INSERT INTO taxclass " "(taxclass_id, taxclass_code, taxclass_descrip, taxclass_sequence)" "VALUES " "(:taxclass_id, :taxclass_code, :taxclass_descrip, :taxclass_sequence);" ); } taxSave.bindValue(":taxclass_id", _taxclassid); taxSave.bindValue(":taxclass_code", _taxClass->text().trimmed()); taxSave.bindValue(":taxclass_descrip", _description->text()); taxSave.bindValue(":taxclass_sequence", _seq->value()); taxSave.exec(); if (taxSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } taxSave.exec("COMMIT;"); done(_taxclassid); } void taxClass::populate() { XSqlQuery taxpopulate; taxpopulate.prepare( "SELECT taxclass_code, taxclass_descrip, taxclass_sequence " "FROM taxclass " "WHERE (taxclass_id=:taxclass_id);" ); taxpopulate.bindValue(":taxclass_id", _taxclassid); taxpopulate.exec(); if (taxpopulate.first()) { _taxClass->setText(taxpopulate.value("taxclass_code").toString()); _description->setText(taxpopulate.value("taxclass_descrip").toString()); _seq->setValue(taxpopulate.value("taxclass_sequence").toInt()); } else if (taxpopulate.lastError().type() != QSqlError::NoError) { systemError(this, taxpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxClass::done( int r ) { XDialog::done( r ); close(); } qt-client-4.1.0/guiclient/taxClass.h000066400000000000000000000020701217451700100173270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXCLASS_H #define TAXCLASS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxClass.h" class taxClass : public XDialog, public Ui::taxClass { Q_OBJECT public: taxClass(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~taxClass(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); virtual void done(int); protected slots: virtual void languageChange(); private: int _mode; int _taxclassid; }; #endif // TAXCLASS qt-client-4.1.0/guiclient/taxClass.ui000066400000000000000000000166121217451700100175240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxClass 0 0 500 140 Tax Class 12 12 Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxClass 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 0 Group Sequence: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxClass Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 188 9 0 0 0 0 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 0 XLineEdit QLineEdit
    xlineedit.h
    1
    XSpinBox QSpinBox
    xspinbox.h
    _taxClass _description _seq _save _close parameter.h _close clicked() taxClass reject() 20 20 20 20
    qt-client-4.1.0/guiclient/taxClasses.cpp000066400000000000000000000077771217451700100202350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxclasses.h" #include #include #include //#include #include #include #include "taxClass.h" #include "storedProcErrorLookup.h" /* * Constructs a taxClasses as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ taxClasses::taxClasses(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_taxclass, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); // statusBar()->hide(); _taxclass->addColumn(tr("Class"), 150, Qt::AlignLeft, true, "taxclass_code" ); _taxclass->addColumn(tr("Description"), 300, Qt::AlignLeft, true, "taxclass_descrip" ); _taxclass->addColumn(tr("Group Sequence"), -1, Qt::AlignLeft, true, "taxclass_sequence" ); if (_privileges->check("MaintainTaxClasses")) { connect(_taxclass, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_taxclass, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_taxclass, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_taxclass, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(-1); } /* * Destroys the object and frees any allocated resources */ taxClasses::~taxClasses() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void taxClasses::languageChange() { retranslateUi(this); } void taxClasses::sDelete() { XSqlQuery taxDelete; taxDelete.prepare("SELECT deletetaxclass(:tax_class_id) AS result;"); taxDelete.bindValue(":tax_class_id", _taxclass->id()); taxDelete.exec(); if (taxDelete.first()) { int returnVal = taxDelete.value("result").toInt(); if (returnVal < 0) { systemError(this, storedProcErrorLookup("deleteTaxClass", returnVal), __FILE__, __LINE__); return; } sFillList(-1); } else if (taxDelete.lastError().type() != QSqlError::NoError) { systemError(this, taxDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxClasses::sNew() { ParameterList params; params.append("mode", "new"); taxClass newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void taxClasses::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("taxclass_id", _taxclass->id()); taxClass newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void taxClasses::sView() { ParameterList params; params.append("mode", "view"); params.append("taxclass_id", _taxclass->id()); taxClass newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void taxClasses::sFillList(int pId) { _taxclass->populate( "SELECT taxclass_id, taxclass_code, taxclass_descrip, taxclass_sequence " "FROM taxclass " "ORDER BY taxclass_sequence;", pId ); } qt-client-4.1.0/guiclient/taxClasses.ui000066400000000000000000000136121217451700100200510ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxClasses 0 0 800 600 List Tax Classes 0 12 Tax Classes: 0 0 0 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 0 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 151 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _taxclass _new _edit _view _delete _close _close clicked() taxClasses close() 20 20 20 20 _taxclass valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/taxCode.cpp000066400000000000000000000327221217451700100174760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxCode.h" #include #include #include #include #include #include #include #include #include "errorReporter.h" #include "taxCodeRate.h" taxCode::taxCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl), _mode(0), _taxid(-1) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_taxClass, SIGNAL(newID(int)), this, SLOT(populateBasis())); connect(_taxitems, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_expire, SIGNAL(clicked()), this, SLOT(sExpire())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _taxitems->addColumn(tr("Effective"), _dateColumn, Qt::AlignLeft, true, "effective" ); _taxitems->addColumn(tr("Expires"), _dateColumn, Qt::AlignLeft, true, "expires" ); _taxitems->addColumn(tr("Percent"), _prcntColumn, Qt::AlignRight, true, "taxrate_percent" ); _taxitems->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "taxrate_amount" ); _taxitems->addColumn(tr("Currency"), -1, Qt::AlignLeft, true, "curr_name" ); sFillList(); _account->setType(GLCluster::cRevenue | GLCluster::cLiability | GLCluster::cExpense); } void taxCode::populateBasis() { _basis->clear(); MetaSQLQuery mql(" SELECT tax_id, tax_code || '-' || tax_descrip, tax_code" " FROM tax" " WHERE (COALESCE(tax_taxclass_id, -1) = COALESCE(, -1))" " AND (tax_id != );"); ParameterList params; params.append("taxclass_id", _taxClass->id()); params.append("tax_id", _taxid); XSqlQuery taxbasis = mql.toQuery(params); _basis->populate(taxbasis); } void taxCode::sPopulateMenu(QMenu *menuThis) { menuThis->addAction(tr("View"), this, SLOT(sView())); if ((_mode == cNew) || (_mode == cEdit)) { menuThis->addAction(tr("Edit"), this, SLOT(sEdit())); menuThis->addAction(tr("Expire"), this, SLOT(sExpire())); menuThis->addAction(tr("Delete"), this, SLOT(sDelete())); } } taxCode::~taxCode() { // no need to delete child widgets, Qt does it all for us } void taxCode::languageChange() { retranslateUi(this); } void taxCode::sNew() { ParameterList params; params.append("mode", "new"); params.append("tax_id", _taxid); taxCodeRate newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void taxCode::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("tax_id", _taxid); params.append("taxrate_id", _taxitems->id()); taxCodeRate newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void taxCode::sView() { ParameterList params; params.append("mode", "view"); params.append("taxrate_id", _taxitems->id()); taxCodeRate newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void taxCode::sDelete() { XSqlQuery taxDelete; if (QMessageBox::question(this, tr("Delete Tax Code Rate?"), tr("

    Are you sure you want to delete this " "Tax Code Rate ?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { taxDelete.prepare( " DELETE FROM taxrate " " WHERE (taxrate_id=:taxrate_id);"); taxDelete.bindValue(":taxrate_id", _taxitems->id()); taxDelete.exec(); if (taxDelete.lastError().type() != QSqlError::NoError) { systemError(this, taxDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void taxCode::sFillList() { XSqlQuery taxFillList; _taxitems->clear(); MetaSQLQuery mql( " SELECT taxrate.*, curr_name, " " CASE WHEN (taxrate_effective = startOfTime()) THEN NULL " " ELSE taxrate_effective END AS effective, " " CASE WHEN (taxrate_expires = endOfTime()) THEN NULL " " ELSE taxrate_expires END AS expires, " " AS effective_xtnullrole, " " AS expires_xtnullrole, " " CASE WHEN (taxrate_expires < CURRENT_DATE) THEN 'error'" " WHEN (taxrate_effective >= CURRENT_DATE) THEN 'emphasis'" " END AS qtforegroundrole, " " 'percent' AS taxrate_percent_xtnumericrole," " 'currency' AS taxrate_amount_xtnumericrole " " FROM taxrate" " LEFT OUTER JOIN curr_symbol ON (taxrate_curr_id = curr_id) " " WHERE taxrate_tax_id = " " ORDER BY taxrate_id, taxrate_effective, taxrate_expires, " " taxrate_percent, taxrate_amount; " ); ParameterList params; setParams(params); taxFillList = mql.toQuery(params); _taxitems->populate(taxFillList); if (taxFillList.lastError().type() != QSqlError::NoError) { systemError(this, taxFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxCode::sExpire() { XSqlQuery taxExpire; taxExpire.prepare( "select taxrate_id " "FROM taxrate " "WHERE (taxrate_id=:taxitems_id AND (taxrate_expires <= CURRENT_DATE " " OR taxrate_effective > CURRENT_DATE));" ); taxExpire.bindValue(":taxitems_id", _taxitems->id()); taxExpire.exec(); if(taxExpire.first()) { QMessageBox::information(this, tr("Expired Tax Rate"), tr("Cannot expire this Tax Code. It is already expired or is a Future Rate.") ); return; } else { taxExpire.prepare( "UPDATE taxrate " "SET taxrate_expires=CURRENT_DATE " "WHERE (taxrate_id=:taxitems_id);" ); taxExpire.bindValue(":taxitems_id", _taxitems->id()); taxExpire.exec(); sFillList(); } } enum SetResponse taxCode::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("tax_id", &valid); if (valid) { _taxid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { connect(_taxitems, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); if ( (param.toString() == "new") || (param.toString() == "edit") ) { connect(_taxitems, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_taxitems, SIGNAL(valid(bool)), _expire, SLOT(setEnabled(bool))); connect(_taxitems, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_taxitems, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } if (param.toString() == "new") { _mode = cNew; XSqlQuery newq; newq.prepare("INSERT INTO tax (tax_code)" " VALUES ('TEMPORARY' || CURRENT_TIMESTAMP)" " RETURNING tax_id;"); newq.exec(); if (newq.first()) _taxid = newq.value("tax_id").toInt(); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Creating Temporary Record"), newq, __FILE__, __LINE__)) return UndefinedError; populateBasis(); } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _account->setReadOnly(TRUE); _taxClass->setEnabled(FALSE); _taxauth->setEnabled(FALSE); _basis->setEnabled(FALSE); _new->setEnabled(FALSE); _edit->setEnabled(FALSE); _expire->setEnabled(FALSE); _delete->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void taxCode::sSave() { XSqlQuery taxSave; if(_code->text().trimmed().isEmpty()) { QMessageBox::warning( this, tr("No Tax Code"), tr("You must specify a Code for this Tax.") ); _code->setFocus(); return; } if (!_account->isValid()) { QMessageBox::warning( this, tr("Select G/L Accout"), tr("You must select a G/L Account for this Tax.") ); _account->setFocus(); return; } taxSave.prepare("SELECT tax_id" " FROM tax" " WHERE((tax_id!= :tax_id)" " AND (tax_code=:tax_code));"); taxSave.bindValue(":tax_id", _taxid); taxSave.bindValue(":tax_code", _code->text().trimmed()); taxSave.exec(); if(taxSave.first()) { QMessageBox::critical(this, tr("Duplicate Tax Code"), tr("A Tax Code already exists for the parameters specified.") ); _code->setFocus(); return; } taxSave.prepare( "UPDATE tax " "SET tax_code=:tax_code, tax_descrip=:tax_descrip," " tax_sales_accnt_id=:tax_sales_accnt_id," " tax_taxclass_id=:tax_taxclass_id," " tax_taxauth_id=:tax_taxauth_id," " tax_basis_tax_id=:tax_basis_tax_id " "WHERE (tax_id=:tax_id);" ); taxSave.bindValue(":tax_code", _code->text().trimmed()); taxSave.bindValue(":tax_descrip", _description->text()); if(_account->isValid()) taxSave.bindValue(":tax_sales_accnt_id", _account->id()); if(_taxauth->isValid()) taxSave.bindValue(":tax_taxauth_id", _taxauth->id()); if(_taxClass->isValid()) taxSave.bindValue(":tax_taxclass_id", _taxClass->id()); if(_basis->isValid()) taxSave.bindValue(":tax_basis_tax_id", _basis->id()); taxSave.bindValue(":tax_id", _taxid); taxSave.exec(); done (_taxid); } void taxCode::sCheck() { XSqlQuery taxCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().length())) { taxCheck.prepare( "SELECT tax_id " "FROM tax " "WHERE (UPPER(tax_code)=UPPER(:tax_code));" ); taxCheck.bindValue(":tax_code", _code->text()); taxCheck.exec(); if (taxCheck.first()) { // delete placeholder XSqlQuery ph; ph.prepare( " DELETE FROM taxrate " " WHERE (taxrate_tax_id=:tax_id);" " DELETE FROM tax " " WHERE (tax_id=:tax_id);"); ph.bindValue(":tax_id", _taxid); ph.exec(); if (ph.lastError().type() != QSqlError::NoError) systemError(this, ph.lastError().databaseText(), __FILE__, __LINE__); _taxid = taxCheck.value("tax_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void taxCode::populate() { XSqlQuery taxpopulate; taxpopulate.prepare( "SELECT tax_code, tax_descrip," " tax_sales_accnt_id," " tax_taxclass_id," " tax_taxauth_id," " tax_basis_tax_id " "FROM tax " "WHERE (tax_id=:tax_id);" ); taxpopulate.bindValue(":tax_id", _taxid); taxpopulate.exec(); if (taxpopulate.first()) { _code->setText(taxpopulate.value("tax_code").toString()); _description->setText(taxpopulate.value("tax_descrip").toString()); _account->setId(taxpopulate.value("tax_sales_accnt_id").toInt()); _taxClass->setId(taxpopulate.value("tax_taxclass_id").toInt()); _taxauth->setId(taxpopulate.value("tax_taxauth_id").toInt()); _basis->setId(taxpopulate.value("tax_basis_tax_id").toInt()); } sFillList(); } void taxCode::closeEvent(QCloseEvent *pEvent) { XSqlQuery taxcloseEvent; if ((_mode == cNew) && (_taxid != -1)) { if (_taxitems->topLevelItemCount() > 0 && QMessageBox::question(this, tr("Delete Tax Code?"), tr("

    Are you sure you want to delete this " "Tax Code and all of its associated " "Tax Rates?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { pEvent->ignore(); return; } taxcloseEvent.prepare( " DELETE FROM taxrate " " WHERE (taxrate_tax_id=:tax_id);" " DELETE FROM tax " " WHERE (tax_id=:tax_id);"); taxcloseEvent.bindValue(":tax_id", _taxid); taxcloseEvent.exec(); if (taxcloseEvent.lastError().type() != QSqlError::NoError) systemError(this, taxcloseEvent.lastError().databaseText(), __FILE__, __LINE__); } XDialog::closeEvent(pEvent); } bool taxCode::setParams(ParameterList &pParams) { pParams.append("tax_id", _taxid); pParams.append("always", tr("Always")); pParams.append("never", tr("Never")); return true; } void taxCode::sClose() { XDialog::close(); } qt-client-4.1.0/guiclient/taxCode.h000066400000000000000000000026231217451700100171400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXCODE_H #define TAXCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxCode.h" class taxCode : public XDialog, public Ui::taxCode { Q_OBJECT public: taxCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~taxCode(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual bool setParams(ParameterList &pParams); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sSave(); virtual void sCheck(); virtual void populate(); virtual void populateBasis(); virtual void sPopulateMenu( QMenu * menuThis ); virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sExpire(); virtual void sClose(); protected slots: virtual void languageChange(); private: int _mode; int _taxid; }; #endif //TAXCODE_H qt-client-4.1.0/guiclient/taxCode.ui000066400000000000000000000307201217451700100173250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxCode 0 0 640 421 Tax Code Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code 5 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 true None XComboBox::TaxClasses Calculation basis on: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Base Price XComboBox::TaxCodes Qt::Horizontal 40 20 Tax Class: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Tax Authority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true None XComboBox::TaxAuths Qt::Horizontal 40 20 Qt::Horizontal QSizePolicy::Preferred 0 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Vertical QSizePolicy::Expanding 77 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Rates New false Edit false View false Expire false Delete Qt::Vertical QSizePolicy::Expanding 77 0 GLCluster QWidget

    glcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _code _description qt-client-4.1.0/guiclient/taxCodeRate.cpp000066400000000000000000000146321217451700100203120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxCodeRate.h" #include #include taxCodeRate::taxCodeRate(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _dates->setStartNull(tr("Always"), omfgThis->startOfTime(), TRUE); _dates->setEndNull(tr("Never"), omfgThis->endOfTime(), TRUE); _percent->setValidator(omfgThis->negPercentVal()); } taxCodeRate::~taxCodeRate() { // no need to delete child widgets, Qt does it all for us } void taxCodeRate::languageChange() { retranslateUi(this); } enum SetResponse taxCodeRate::set( const ParameterList & pParams ) { XSqlQuery taxet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("taxrate_id", &valid); if (valid) _taxrateid = param.toInt(); param = pParams.value("tax_id", &valid); if (valid) _taxId = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; taxet.prepare(" (SELECT taxrate_id " " FROM taxrate " " WHERE taxrate_tax_id = :taxrate_tax_id); "); taxet.bindValue(":taxrate_tax_id", _taxId); taxet.exec(); if(taxet.first()) { XSqlQuery maxdate; maxdate.prepare(" (SELECT (MAX(taxrate_expires) + 1) AS max_expires" " FROM taxrate " " WHERE taxrate_tax_id = :taxrate_tax_id) "); maxdate.bindValue(":taxrate_tax_id", _taxId); maxdate.exec(); if(maxdate.first()) { _dates->setStartDate(maxdate.value("max_expires").toDate()); } else if (maxdate.lastError().type() != QSqlError::NoError) { systemError(this, maxdate.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } taxet.exec("SELECT NEXTVAL('taxrate_taxrate_id_seq') AS taxrate_id"); if (taxet.first()) _taxrateid = taxet.value("taxrate_id").toInt(); else if (taxet.lastError().type() != QSqlError::NoError) { systemError(this, taxet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; sPopulate(); } else if (param.toString() == "view") { _mode = cView; sPopulate(); _dates->setEnabled(FALSE); _percent->setEnabled(FALSE); _flat->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void taxCodeRate::sSave() { XSqlQuery taxSave; // Check if start date is greater than end date if( _dates->startDate() > _dates->endDate()) { QMessageBox::critical(this, tr("Incorrect Date Entry"), tr("The start date should be earlier than the end date.") ); _dates->setFocus(); return; } // Check for overlapping dates taxSave.prepare("SELECT taxrate_id,taxrate_tax_id,taxrate_effective,taxrate_expires " " FROM taxrate " " WHERE (taxrate_id != :taxrate_id) " " AND (taxrate_tax_id = :taxrate_tax_id) " " AND (taxrate_effective < :taxrate_expires) " " AND (taxrate_expires > :taxrate_effective ) "); taxSave.bindValue(":taxrate_id", _taxrateid); taxSave.bindValue(":taxrate_tax_id", _taxId); taxSave.bindValue(":taxrate_effective", _dates->startDate()); taxSave.bindValue(":taxrate_expires", _dates->endDate()); taxSave.exec(); if(taxSave.first()) { QMessageBox::critical(this, tr("Invalid Date Range"), tr("A Tax Rate already exists within the specified Date Range.") ); _dates->setFocus(); return; } // Save the values in the database if (cNew == _mode) { taxSave.prepare("INSERT INTO taxrate (taxrate_id, " " taxrate_tax_id, taxrate_percent, " " taxrate_curr_id, taxrate_amount, " " taxrate_effective, taxrate_expires) " " VALUES (:taxrate_id, :taxrate_tax_id, " " :taxrate_percent, :taxrate_curr_id, " " :taxrate_amount, :taxrate_effective, " " :taxrate_expires);"); } else { taxSave.prepare("UPDATE taxrate SET " " taxrate_tax_id=:taxrate_tax_id, " " taxrate_percent=:taxrate_percent, " " taxrate_curr_id=:taxrate_curr_id, " " taxrate_amount=:taxrate_amount, " " taxrate_effective=:taxrate_effective, " " taxrate_expires=:taxrate_expires " "WHERE (taxrate_id=:taxrate_id);"); } taxSave.bindValue(":taxrate_id", _taxrateid); taxSave.bindValue(":taxrate_tax_id", _taxId); if(_percent->isValid()) taxSave.bindValue(":taxrate_percent", (_percent->toDouble() / 100)); else taxSave.bindValue(":taxrate_percent", 0.0); taxSave.bindValue(":taxrate_curr_id", _flat->id()); if(_flat->isEmpty()) taxSave.bindValue(":taxrate_amount", 0.0); else taxSave.bindValue(":taxrate_amount", _flat->localValue()); taxSave.bindValue(":taxrate_effective", _dates->startDate()); taxSave.bindValue(":taxrate_expires", _dates->endDate()); taxSave.exec(); if (taxSave.lastError().type() != QSqlError::NoError) { systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } done (_taxrateid); } void taxCodeRate::sPopulate() { XSqlQuery taxPopulate; taxPopulate.prepare("SELECT * FROM taxrate WHERE (taxrate_id=:taxrate_id);"); taxPopulate.bindValue(":taxrate_id", _taxrateid); taxPopulate.exec(); if (taxPopulate.first()) { _taxrateid = taxPopulate.value("taxrate_id").toInt(); _dates->setStartDate(taxPopulate.value("taxrate_effective").toDate()); _dates->setEndDate(taxPopulate.value("taxrate_expires").toDate()); _percent->setText(taxPopulate.value("taxrate_percent").toDouble() * 100); _flat->setId(taxPopulate.value("taxrate_curr_id").toInt()); _flat->setLocalValue(taxPopulate.value("taxrate_amount").toDouble()); } else if (taxPopulate.lastError().type() != QSqlError::NoError) { systemError(this, taxPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/taxCodeRate.h000066400000000000000000000021401217451700100177460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXCODERATE_H #define TAXCODERATE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxCodeRate.h" class taxCodeRate : public XDialog, public Ui::taxCodeRate { Q_OBJECT public: taxCodeRate(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~taxCodeRate(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sPopulate(); protected slots: virtual void languageChange(); private: int _taxrateid; int _taxId; int _mode; }; #endif // TAXCODERATE_H qt-client-4.1.0/guiclient/taxCodeRate.ui000066400000000000000000000163571217451700100201530ustar00rootroot00000000000000 taxCodeRate This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. 0 0 463 217 Tax Code Rate 12 12 Effectivity Qt::StrongFocus Qt::Horizontal 40 20 80 16777215 Qt::Horizontal 40 20 Qt::Horizontal 0 20 Percentage: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 236 0 Qt::Horizontal 0 20 0 0 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 CurrCluster CurrDisplay
    currcluster.h
    DateCluster QWidget
    datecluster.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _close clicked() taxCodeRate reject() 414 34 335 37
    qt-client-4.1.0/guiclient/taxCodes.cpp000066400000000000000000000070301217451700100176530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxCodes.h" #include #include //#include #include #include #include "guiclient.h" #include "storedProcErrorLookup.h" #include "taxCode.h" taxCodes::taxCodes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); // statusBar()->hide(); _tax->addColumn(tr("Code"), _itemColumn, Qt::AlignLeft, true, "tax_code" ); _tax->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "tax_descrip" ); if (_privileges->check("MaintainTaxCodes")) { connect(_tax, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_tax, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_tax, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_tax, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } taxCodes::~taxCodes() { // no need to delete child widgets, Qt does it all for us } void taxCodes::languageChange() { retranslateUi(this); } void taxCodes::sNew() { ParameterList params; params.append("mode", "new"); taxCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void taxCodes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("tax_id", _tax->id()); taxCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void taxCodes::sView() { ParameterList params; params.append("mode", "view"); params.append("tax_id", _tax->id()); taxCode newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void taxCodes::sDelete() { XSqlQuery taxDelete; if(QMessageBox::question(this, tr("Delete Tax Code?"), tr("

    Are you sure you want to delete this Tax Code " "along with its associated Tax Code Rates?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { taxDelete.prepare("SELECT deleteTax(:tax_id) AS result;"); taxDelete.bindValue(":tax_id", _tax->id()); taxDelete.exec(); if (taxDelete.first()) { int result = taxDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteTax", result), __FILE__, __LINE__); return; } } else if (taxDelete.lastError().type() != QSqlError::NoError) { systemError(this, taxDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } } void taxCodes::sFillList() { _tax->clear(); _tax->populate( "SELECT tax_id, tax_code, tax_descrip " "FROM tax " "ORDER BY tax_code;" ); } qt-client-4.1.0/guiclient/taxCodes.h000066400000000000000000000016521217451700100173240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXCODES_H #define TAXCODES_H #include "xwidget.h" #include "ui_taxCodes.h" class taxCodes : public XWidget, public Ui::taxCodes { Q_OBJECT public: taxCodes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~taxCodes(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // TAXCODES_H qt-client-4.1.0/guiclient/taxCodes.ui000066400000000000000000000104441217451700100175110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxCodes 0 0 600 400 List Tax Codes 0 Tax Codes: &Close Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

    xtreewidget.h
    _tax _new _edit _view _delete _close _close clicked() taxCodes close() 20 20 20 20 _tax valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/taxDetail.cpp000066400000000000000000000204521217451700100200230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxDetail.h" #include #include #include #include "metasql.h" #include "taxAdjustment.h" taxDetail::taxDetail(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _sense = 1; _taxcodes->addColumn(tr("Code"), -1, Qt::AlignLeft, true, "taxdetail_tax_code"); _taxcodes->addColumn(tr("Description"), 100, Qt::AlignLeft, true, "taxdetail_tax_descrip"); _taxcodes->addColumn(tr("Amount"), 100, Qt::AlignRight, true, "taxdetail_tax"); _taxcodes->addColumn(tr("Sequence"), 100, Qt::AlignRight, true, "taxdetail_taxclass_sequence"); _taxcodes->setIndentation(10); connect(_taxcodes, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_cancel, SIGNAL(clicked()), this, SLOT(sCancel())); connect(_taxType, SIGNAL(newID(int)), this, SLOT(sCalculateTax())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); } taxDetail::~taxDetail() { // no need to delete child widgets, Qt does it all for us } void taxDetail::languageChange() { retranslateUi(this); } enum SetResponse taxDetail::set(const ParameterList & pParams ) { XDialog::set(pParams); QVariant param; bool valid; _readonly = pParams.inList("readOnly"); _new->hide(); _delete->hide(); param = pParams.value("taxzone_id", &valid); if (valid) _taxzoneId = param.toInt(); param = pParams.value("taxtype_id", &valid); if (valid) _taxType->setId(param.toInt()); else clear(); param = pParams.value("date", &valid); if (valid) _subtotal->setEffective(param.toDate()); param = pParams.value("subtotal", &valid); if (valid) _subtotal->setLocalValue(param.toDouble()); param = pParams.value("curr_id", &valid); if (valid) _subtotal->setId(param.toInt()); param = pParams.value("order_id", &valid); if (valid) _orderid = param.toInt(); param = pParams.value("order_type", &valid); if (valid) _ordertype = param.toString(); param = pParams.value("display_type", &valid); if (valid) _displayType = param.toString(); _adjustment = pParams.inList("adjustment"); param = pParams.value("sense", &valid); if (valid) _sense = param.toInt(); if (_readonly) { _taxType->setEnabled(FALSE); _cancel->setText(tr("&Close")); } if(_adjustment && !_readonly) { _taxType->setEnabled(FALSE); _new->show(); _delete->show(); } sPopulate(); return NoError; } void taxDetail::sCancel() { reject(); } int taxDetail::taxtype() const { return _taxType->id(); } void taxDetail::sCalculateTax() { XSqlQuery taxCalculateTax; ParameterList params; params.append("taxzone_id", _taxzoneId); params.append("taxtype_id", _taxType->id()); params.append("date", _subtotal->effective()); params.append("subtotal", _subtotal->localValue()); params.append("curr_id", _subtotal->id()); QString sql("SELECT taxdetail_tax_id, taxdetail_tax_code, taxdetail_tax_descrip, " " taxdetail_tax AS taxdetail_tax, " " taxdetail_taxclass_sequence, 0 AS xtindentrole, " " 0 AS taxdetail_tax_xttotalrole, 'salesprice' AS taxdetail_tax_xtnumericrole " "FROM calculateTaxDetail(, , " " , , " " ) "); MetaSQLQuery mql(sql); taxCalculateTax = mql.toQuery(params); _taxcodes->clear(); _taxcodes->populate(taxCalculateTax); if (taxCalculateTax.lastError().type() != QSqlError::NoError) { systemError(this, taxCalculateTax.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxDetail::clear() { _taxType->setNullStr(tr("Unspecified")); } void taxDetail::sPopulate() { XSqlQuery taxPopulate; XSqlQuery popq; popq.prepare("SELECT taxtype_descrip from taxtype where taxtype_id=:taxtype_id;"); popq.bindValue(":taxtype_id", _taxType->id()); popq.exec(); if(popq.first()) _descrip->setText(popq.value("taxtype_descrip").toString()); else _descrip->setText("Unspecified"); QString sql; ParameterList params; params.append("order_id", _orderid); params.append("order_type", _ordertype); params.append("sense", _sense); if(_ordertype == "S" || _ordertype == "Q" || _ordertype == "I" || _ordertype == "B" || _ordertype == "RA" || _ordertype == "CM" || _ordertype == "PO" || _ordertype == "VO" || _ordertype == "TO") { params.append("display_type", _displayType); sql = "SELECT taxdetail_tax_id, taxdetail_tax_code, taxdetail_tax_descrip, " " round(sum(taxdetail_tax),2) * as taxdetail_tax, taxdetail_taxclass_sequence, 0 AS xtindentrole, " " 0 AS taxdetail_tax_xttotalrole, 'salesprice' AS taxdetail_tax_xtnumericrole " "FROM calculateTaxDetailSummary(, , ) " "GROUP BY taxdetail_tax_id, taxdetail_tax_code, taxdetail_tax_descrip, taxdetail_level, taxdetail_taxclass_sequence;"; } else if( _ordertype == "II" || _ordertype == "BI" || _ordertype == "CI" || _ordertype == "TI" || _ordertype == "VI" || _ordertype == "AR" || _ordertype == "AP" ) sql = "SELECT taxdetail_tax_id, taxdetail_tax_code, taxdetail_tax_descrip, " " taxdetail_tax * AS taxdetail_tax, taxdetail_taxclass_sequence, taxdetail_level AS xtindentrole, " " 0 AS taxdetail_tax_xttotalrole, 'saleprice' AS taxdetail_tax_xtnumericrole " "FROM calculateTaxDetailLine(, ); "; else { sCalculateTax(); return; } MetaSQLQuery mql(sql); taxPopulate = mql.toQuery(params); _taxcodes->clear(); _taxcodes->populate(taxPopulate); if (taxPopulate.lastError().type() != QSqlError::NoError) { systemError(this, taxPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxDetail::sNew() { taxAdjustment newdlg(this, "", true); ParameterList params; params.append("order_id", _orderid); params.append("order_type", _ordertype); params.append("date", _subtotal->effective()); params.append("curr_id", _subtotal->id()); params.append("sense", _sense); params.append("mode", "new"); if (newdlg.set(params) == NoError) newdlg.exec(); sPopulate(); } void taxDetail::sDelete() { XSqlQuery taxDelete; QString table; if (_ordertype == "I") table = "invcheadtax"; else if (_ordertype == "B") table = "cobmisctax"; else if (_ordertype == "CM") table = "cmheadtax"; else if (_ordertype == "VO") table = "voheadtax"; else if (_ordertype == "AR") table = "aropentax"; else if (_ordertype == "AP") table = "apopentax"; else table = _ordertype; if (QMessageBox::question(this, tr("Delete Tax Adjustment?"), tr("

    Are you sure that you want to delete this tax adjustment?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { QString sql = QString("DELETE FROM %1 " "WHERE taxhist_parent_id=:parent_id " " AND taxhist_taxtype_id=getadjustmenttaxtypeid() " " AND taxhist_tax_id=:tax_id;").arg(table); taxDelete.prepare(sql); taxDelete.bindValue(":parent_id", _orderid); taxDelete.bindValue(":tax_id", _taxcodes->id()); taxDelete.exec(); if (taxDelete.lastError().type() != QSqlError::NoError) { systemError(this, taxDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } sPopulate(); return; } qt-client-4.1.0/guiclient/taxDetail.h000066400000000000000000000027321217451700100174710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXDETAIL_H #define TAXDETAIL_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxDetail.h" class taxDetail : public XDialog, public Ui::taxDetail { Q_OBJECT public: taxDetail(QWidget* = 0, const char* = 0, bool = false, Qt::WFlags = 0); ~taxDetail(); virtual int taxtype() const; public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void clear(); virtual void sCancel(); virtual void sCalculateTax(); virtual void sPopulate(); virtual void sNew(); virtual void sDelete(); protected: double _aCache; double _bCache; double _cCache; double _aPctCache; double _bPctCache; double _cPctCache; bool _blankDetailDescriptions; bool _readonly; double _taxCodeInitialized; int _taxzoneId; int _orderid; int _sense; QString _ordertype; QString _displayType; bool _adjustment; protected slots: virtual void languageChange(); }; #endif // TAXDETAIL_H qt-client-4.1.0/guiclient/taxDetail.ui000066400000000000000000000223721217451700100176610ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxDetail 0 0 444 400 Tax Detail 12 12 Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::TaxTypes Qt::Horizontal 40 20 Taxable Amount: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 305 0 Qt::Horizontal 13 57 0 0 &Close Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 Tax Codes 0 New false Delete Qt::Vertical 20 40 CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _cancel _taxcodes valid(bool) _delete setEnabled(bool) 158 360 341 294 qt-client-4.1.0/guiclient/taxRegistration.cpp000066400000000000000000000166441217451700100213030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxRegistration.h" #include #include #include taxRegistration::taxRegistration(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _save = _buttonBox->button(QDialogButtonBox::Save); _save->setEnabled(false); connect(_number, SIGNAL(textChanged(QString)), this, SLOT(sHandleButtons())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_taxauth, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); _taxregid = -1; _reltype = ""; _relid = -1; _mode = cNew; _dates->setStartNull(tr("Always"), omfgThis->startOfTime(), TRUE); _dates->setEndNull(tr("Never"), omfgThis->endOfTime(), TRUE); } taxRegistration::~taxRegistration() { // no need to delete child widget, Qt does it all for us } void taxRegistration::languageChange() { retranslateUi(this); } enum SetResponse taxRegistration::set(const ParameterList pParams) { XSqlQuery taxet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("taxreg_id", &valid); if (valid) { _taxregid = param.toInt(); sPopulate(); } param = pParams.value("taxreg_rel_type", &valid); if (valid) _reltype = param.toString(); param = pParams.value("taxreg_rel_id", &valid); if (valid) _relid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; taxet.exec("SELECT NEXTVAL('taxreg_taxreg_id_seq') AS _taxreg_id;"); if (taxet.first()) { _taxregid = taxet.value("_taxreg_id").toInt(); } else if (taxet.lastError().type() != QSqlError::NoError) { systemError(this, taxet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _cust->setEnabled(false); _vend->setEnabled(false); _taxauth->setEnabled(false); _number->setEnabled(false); _taxZone->setEnabled(false); _dates->setEnabled(false); _notes->setEnabled(false); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } if (handleReltype() < 0) return UndefinedError; sHandleButtons(); return NoError; } void taxRegistration::sSave() { XSqlQuery taxSave; if( _dates->startDate() > _dates->endDate()) { QMessageBox::critical(this, tr("Incorrect Date Entry"), tr("The start date should be earlier than the end date.") ); return; } taxSave.prepare("SELECT taxreg_id" " FROM taxreg" " WHERE((taxreg_id != :taxreg_id)" " AND (taxreg_rel_id = :taxreg_rel_id)" " AND (taxreg_rel_type = :taxreg_rel_type)" " AND (taxreg_taxauth_id = :taxreg_taxauth_id)" " AND (COALESCE(taxreg_taxzone_id, -1) = :taxreg_taxzone_id)" " AND (taxreg_number = :taxreg_number))"); taxSave.bindValue(":taxreg_id", _taxregid); taxSave.bindValue(":taxreg_taxauth_id", _taxauth->id()); taxSave.bindValue(":taxreg_number", _number->text()); if (_taxZone->isValid()) taxSave.bindValue(":taxreg_taxzone_id", _taxZone->id()); else taxSave.bindValue(":taxreg_taxzone_id", -1); taxSave.bindValue(":taxreg_rel_id", _relid); //_reltype == "C" ? _cust->id() : _vend->id()); if(!_reltype.isEmpty()) taxSave.bindValue(":taxreg_rel_type", _reltype); taxSave.exec(); if(taxSave.first()) { QMessageBox::critical(this, tr("Duplicate Tax Registration"), tr("A Tax Registration already exists for the parameters specified.") ); _taxZone->setFocus(); return; } if (cNew == _mode) { taxSave.prepare("INSERT INTO taxreg (taxreg_id, " " taxreg_rel_id, taxreg_rel_type, " " taxreg_taxauth_id, taxreg_number, taxreg_taxzone_id, taxreg_effective, taxreg_expires, taxreg_notes) " " VALUES (:taxreg_id," " :taxreg_rel_id, :taxreg_rel_type, " " :taxreg_taxauth_id, :taxreg_number, :taxreg_taxzone_id, :taxreg_taxreg_effective, :taxreg_taxreg_expires, :taxreg_notes " " );"); } else { taxSave.prepare("UPDATE taxreg SET " " taxreg_rel_id=:taxreg_rel_id, " " taxreg_rel_type=:taxreg_rel_type, " " taxreg_taxauth_id=:taxreg_taxauth_id, " " taxreg_number=:taxreg_number, " " taxreg_taxzone_id=:taxreg_taxzone_id, " " taxreg_effective=:taxreg_taxreg_effective, " " taxreg_expires=:taxreg_taxreg_expires, " " taxreg_notes=:taxreg_notes " "WHERE (taxreg_id=:taxreg_id);"); } taxSave.bindValue(":taxreg_id", _taxregid); taxSave.bindValue(":taxreg_rel_id", _relid); //_reltype == "C" ? _cust->id() : _vend->id()); if(!_reltype.isEmpty()) taxSave.bindValue(":taxreg_rel_type", _reltype); taxSave.bindValue(":taxreg_taxauth_id", _taxauth->id()); taxSave.bindValue(":taxreg_number", _number->text()); if (_taxZone->isValid()) taxSave.bindValue(":taxreg_taxzone_id", _taxZone->id()); taxSave.bindValue(":taxreg_taxreg_effective", _dates->startDate()); taxSave.bindValue(":taxreg_taxreg_expires", _dates->endDate()); taxSave.bindValue(":taxreg_notes", _notes->toPlainText()); taxSave.exec(); if (taxSave.lastError().type() != QSqlError::NoError) { systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void taxRegistration::sPopulate() { XSqlQuery taxPopulate; taxPopulate.prepare("SELECT * FROM taxreg WHERE (taxreg_id=:taxreg_id);"); taxPopulate.bindValue(":taxreg_id", _taxregid); taxPopulate.exec(); if (taxPopulate.first()) { _taxregid = taxPopulate.value("taxreg_id").toInt(); _reltype = taxPopulate.value("taxreg_rel_type").toString(); _relid = taxPopulate.value("taxreg_rel_id").toInt(); _number->setText(taxPopulate.value("taxreg_number").toString()); _taxauth->setId(taxPopulate.value("taxreg_taxauth_id").toInt()); _taxZone->setId(taxPopulate.value("taxreg_taxzone_id").toInt()); _dates->setStartDate(taxPopulate.value("taxreg_effective").toDate()); _dates->setEndDate(taxPopulate.value("taxreg_expires").toDate()); _notes->setText(taxPopulate.value("taxreg_notes").toString()); if (handleReltype() < 0) return; } else if (taxPopulate.lastError().type() != QSqlError::NoError) { systemError(this, taxPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxRegistration::sHandleButtons() { if (cView != _mode) _save->setEnabled( (! _number->text().isEmpty()) && _taxauth->isValid() ); } int taxRegistration::handleReltype() { if (_reltype == "C") { _cust->setId(_relid); _cust->setVisible(true); _vend->setVisible(false); } else if (_reltype == "V") { _vend->setId(_relid); _cust->setVisible(false); _vend->setVisible(true); } else { _cust->setVisible(false); _vend->setVisible(false); } return 0; } qt-client-4.1.0/guiclient/taxRegistration.h000066400000000000000000000022601217451700100207350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXREGISTRATION_H #define TAXREGISTRATION_H #include "guiclient.h" #include "xdialog.h" #include #include class taxRegistration : public XDialog, public Ui::taxRegistration { Q_OBJECT public: taxRegistration(QWidget* = 0, const char* = 0, bool = false, Qt::WFlags = 0); ~taxRegistration(); QPushButton* _save; public slots: virtual SetResponse set(const ParameterList pParams); protected slots: virtual void languageChange(); virtual void sHandleButtons(); virtual void sPopulate(); virtual void sSave(); protected: int _mode; int _relid; QString _reltype; int _taxregid; private: int handleReltype(); }; #endif // TAXREGISTRATION_H qt-client-4.1.0/guiclient/taxRegistration.ui000066400000000000000000000205351217451700100211300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxRegistration 0 0 494 473 Tax Registration Information true 0 false false false false Qt::StrongFocus Vendor #: Qt::Horizontal 40 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true ~Any~ XComboBox::TaxZones Qt::Horizontal 40 20 Tax Authority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::TaxAuths Qt::Horizontal 40 20 Registration Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Effectivity Qt::StrongFocus Qt::Horizontal 40 20 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 Notes: CustCluster QWidget
    custcluster.h
    DateCluster QWidget
    datecluster.h
    VendorCluster QWidget
    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    XTextEdit QTextEdit
    xtextedit.h
    _cust _vend _taxZone _taxauth _number _dates _notes _buttonBox _buttonBox rejected() taxRegistration reject() 447 170 246 236
    qt-client-4.1.0/guiclient/taxRegistrations.cpp000066400000000000000000000076501217451700100214630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxRegistrations.h" #include #include #include #include #include #include "taxRegistration.h" taxRegistrations::taxRegistrations(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); if (_privileges->check("MaintainTaxRegistrations")) { connect(_taxreg, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_taxreg, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_taxreg, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_taxreg, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _taxreg->addColumn(tr("Tax Zone"), 100, Qt::AlignCenter, true, "taxzone_code" ); _taxreg->addColumn(tr("Tax Authority"), 100, Qt::AlignCenter, true, "taxauth_code" ); _taxreg->addColumn(tr("Registration #"), 100, Qt::AlignLeft, true, "taxreg_number" ); _taxreg->addColumn(tr("Start Date"), 100, Qt::AlignLeft, true, "taxreg_effective" ); _taxreg->addColumn(tr("End Date"), -1, Qt::AlignLeft, true, "taxreg_expires" ); sFillList(); } taxRegistrations::~taxRegistrations() { // no need to delete child widgets, Qt does it all for us } void taxRegistrations::languageChange() { retranslateUi(this); } void taxRegistrations::sNew() { ParameterList params; params.append("mode", "new"); taxRegistration newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() != XDialog::Rejected) sFillList(); } void taxRegistrations::sEdit() { ParameterList params; params.append("taxreg_id", _taxreg->id()); params.append("mode", "edit"); taxRegistration newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() != XDialog::Rejected) sFillList(); } void taxRegistrations::sView() { ParameterList params; params.append("taxreg_id", _taxreg->id()); params.append("mode", "view"); taxRegistration newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void taxRegistrations::sDelete() { XSqlQuery taxDelete; taxDelete.prepare("DELETE FROM taxreg" " WHERE (taxreg_id=:taxreg_id);"); taxDelete.bindValue(":taxreg_id", _taxreg->id()); taxDelete.exec(); if (taxDelete.lastError().type() != QSqlError::NoError) { systemError(this, taxDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void taxRegistrations::sFillList() { XSqlQuery taxFillList; taxFillList.prepare("SELECT taxreg_id, taxreg_taxzone_id, taxreg_taxauth_id, " " CASE WHEN taxreg_taxzone_id ISNULL THEN '~Any~' " " ELSE taxzone_code " " END AS taxzone_code, " " taxauth_code, taxreg_number, " " taxreg_effective, taxreg_expires " " FROM taxreg LEFT OUTER JOIN taxauth ON (taxreg_taxauth_id = taxauth_id) " " LEFT OUTER JOIN taxzone ON (taxreg_taxzone_id = taxzone_id)" " WHERE (taxreg_rel_type IS NULL)" " ORDER BY taxzone_code, taxauth_code, taxreg_number;"); taxFillList.exec(); _taxreg->populate(taxFillList, true); if (taxFillList.lastError().type() != QSqlError::NoError) { systemError(this, taxFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/taxRegistrations.h000066400000000000000000000020021217451700100211120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXREGISTRATIONS_H #define TAXREGISTRATIONS_H #include "guiclient.h" #include "xwidget.h" #include "ui_taxRegistrations.h" class taxRegistrations : public XWidget, public Ui::taxRegistrations { Q_OBJECT public: taxRegistrations(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~taxRegistrations(); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // TAXREGISTRATIONS_H qt-client-4.1.0/guiclient/taxRegistrations.ui000066400000000000000000000113701217451700100213100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxRegistrations 0 0 800 600 List Tax Registrations 12 12 0 Tax Registrations: _taxreg 5 &Close 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _taxreg _new _edit _view _delete _close _close clicked() taxRegistrations close() 355 26 20 20 _taxreg valid(bool) _view setEnabled(bool) 26 43 356 113
    qt-client-4.1.0/guiclient/taxType.cpp000066400000000000000000000124111217451700100175360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxType.h" #include #include taxType::taxType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } taxType::~taxType() { // no need to delete child widgets, Qt does it all for us } void taxType::languageChange() { retranslateUi(this); } enum SetResponse taxType::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("taxtype_id", &valid); if (valid) { _taxtypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void taxType::sCheck() { XSqlQuery taxCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { taxCheck.prepare( "SELECT taxtype_id " "FROM taxtype " "WHERE (UPPER(taxtype_name)=UPPER(:taxtype_name));" ); taxCheck.bindValue(":taxtype_name", _name->text()); taxCheck.exec(); if (taxCheck.first()) { _taxtypeid = taxCheck.value("taxtype_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void taxType::sSave() { XSqlQuery taxSave; if (_name->text().trimmed().isEmpty()) { QMessageBox::critical(this, tr("Missing Name"), tr("

    You must name this Tax Type before saving it.")); _name->setFocus(); return; } if (_mode == cEdit) { taxSave.prepare( "SELECT taxtype_id " "FROM taxtype " "WHERE ( (taxtype_id<>:taxtype_id)" " AND (UPPER(taxtype_name)=UPPER(:taxtype_name)) );"); taxSave.bindValue(":taxtype_id", _taxtypeid); taxSave.bindValue(":taxtype_name", _name->text().trimmed()); taxSave.exec(); if (taxSave.first()) { QMessageBox::critical( this, tr("Cannot Create Tax Type"), tr( "A Tax Type with the entered name already exists." "You may not create a Tax Type with this name." ) ); _name->setFocus(); return; } taxSave.prepare( "UPDATE taxtype " "SET taxtype_name=:taxtype_name," " taxtype_descrip=:taxtype_descrip " "WHERE (taxtype_id=:taxtype_id);" ); taxSave.bindValue(":taxtype_id", _taxtypeid); taxSave.bindValue(":taxtype_name", _name->text().trimmed()); taxSave.bindValue(":taxtype_descrip", _description->text()); taxSave.exec(); } else if (_mode == cNew) { taxSave.prepare( "SELECT taxtype_id " "FROM taxtype " "WHERE (UPPER(taxtype_name)=UPPER(:taxtype_name));"); taxSave.bindValue(":taxtype_name", _name->text().trimmed()); taxSave.exec(); if (taxSave.first()) { QMessageBox::critical( this, tr("Cannot Create Tax Type"), tr( "A Tax Type with the entered name already exists.\n" "You may not create a Tax Type with this name." ) ); _name->setFocus(); return; } taxSave.exec("SELECT NEXTVAL('taxtype_taxtype_id_seq') AS taxtype_id;"); if (taxSave.first()) _taxtypeid = taxSave.value("taxtype_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } taxSave.prepare( "INSERT INTO taxtype " "( taxtype_id, taxtype_name, taxtype_descrip ) " "VALUES " "( :taxtype_id, :taxtype_name, :taxtype_descrip );" ); taxSave.bindValue(":taxtype_id", _taxtypeid); taxSave.bindValue(":taxtype_name", _name->text().trimmed()); taxSave.bindValue(":taxtype_descrip", _description->text()); taxSave.exec(); } done(_taxtypeid); } void taxType::populate() { XSqlQuery taxpopulate; taxpopulate.prepare( "SELECT taxtype_name, taxtype_descrip, taxtype_sys " "FROM taxtype " "WHERE (taxtype_id=:taxtype_id);" ); taxpopulate.bindValue(":taxtype_id", _taxtypeid); taxpopulate.exec(); if (taxpopulate.first()) { _name->setText(taxpopulate.value("taxtype_name").toString()); if(taxpopulate.value("taxtype_sys").toBool()) _name->setEnabled(false); _description->setText(taxpopulate.value("taxtype_descrip").toString()); } } qt-client-4.1.0/guiclient/taxType.h000066400000000000000000000020261217451700100172040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXTYPE_H #define TAXTYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxType.h" class taxType : public XDialog, public Ui::taxType { Q_OBJECT public: taxType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~taxType(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _taxtypeid; }; #endif // TAXTYPE_H qt-client-4.1.0/guiclient/taxType.ui000066400000000000000000000142621217451700100173770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxType 0 0 500 101 Tax Type 12 12 5 0 5 0 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 0 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical 20 0 0 0 0 0 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 0 XLineEdit QLineEdit

    xlineedit.h
    1 _name _description _save _close _close clicked() taxType reject() 20 20 20 20 qt-client-4.1.0/guiclient/taxTypes.cpp000066400000000000000000000100011217451700100177120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxTypes.h" #include #include //#include #include #include #include "taxType.h" /* * Constructs a taxTypes as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ taxTypes::taxTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_taxtype, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); // statusBar()->hide(); _taxtype->addColumn(tr("Name"), 70, Qt::AlignLeft, true, "taxtype_name" ); _taxtype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "taxtype_descrip" ); if (_privileges->check("MaintainTaxTypes")) { connect(_taxtype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_taxtype, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_taxtype, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_taxtype, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(-1); } /* * Destroys the object and frees any allocated resources */ taxTypes::~taxTypes() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void taxTypes::languageChange() { retranslateUi(this); } void taxTypes::sDelete() { XSqlQuery taxDelete; taxDelete.prepare("SELECT deleteTaxType(:taxtype_id) AS result;"); taxDelete.bindValue(":taxtype_id", _taxtype->id()); taxDelete.exec(); if (taxDelete.first()) { if (taxDelete.value("result").toInt() < 0) { QMessageBox::warning( this, tr("Cannot Delete Tax Type"), tr( "You cannot delete the selected Tax Type because there are currently items assigned to it.\n" "You must first re-assign these items before deleting the selected Tax Type." ) ); return; } sFillList(-1); } else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } void taxTypes::sNew() { ParameterList params; params.append("mode", "new"); taxType newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void taxTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("taxtype_id", _taxtype->id()); taxType newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void taxTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("taxtype_id", _taxtype->id()); taxType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void taxTypes::sPrint() { orReport report("TaxTypesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } void taxTypes::sFillList(int pId) { _taxtype->populate( "SELECT taxtype_id, taxtype_name, taxtype_descrip " "FROM taxtype " "ORDER BY taxtype_name;", pId ); } qt-client-4.1.0/guiclient/taxTypes.h000066400000000000000000000017421217451700100173730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXTYPES_H #define TAXTYPES_H #include "guiclient.h" #include "xwidget.h" #include "ui_taxTypes.h" class taxTypes : public XWidget, public Ui::taxTypes { Q_OBJECT public: taxTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~taxTypes(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(int pId); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // TAXTYPES_H qt-client-4.1.0/guiclient/taxTypes.ui000066400000000000000000000133401217451700100175560ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxTypes 0 0 380 406 List Tax Types 0 0 7 0 0 0 0 20 Tax Types: 7 7 0 0 0 0 0 5 &Close &Print 0 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 168 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _taxtype _new _edit _view _delete _print _close _close clicked() taxTypes close() 20 20 20 20 _taxtype valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/taxZone.cpp000066400000000000000000000124121217451700100175310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxZone.h" #include #include #include #include #include "storedProcErrorLookup.h" taxZone::taxZone(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxZone, SIGNAL(editingFinished()), this, SLOT(sCheck())); } taxZone::~taxZone() { // no need to delete child widgets, Qt does it all for us } void taxZone::languageChange() { retranslateUi(this); } enum SetResponse taxZone::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("taxzone_id", &valid); if (valid) { _taxzoneid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _taxZone->setEnabled(FALSE); _description->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void taxZone::sCheck() { XSqlQuery taxCheck; _taxZone->setText(_taxZone->text().trimmed()); if ( (_mode == cNew) && (_taxZone->text().length()) ) { taxCheck.prepare( "SELECT taxzone_id " "FROM taxzone " "WHERE (UPPER(taxzone_code)=UPPER(:taxzone_code));" ); taxCheck.bindValue(":taxzone_code", _taxZone->text()); taxCheck.exec(); if (taxCheck.first()) { _taxzoneid = taxCheck.value("taxzone_id").toInt(); _mode = cEdit; populate(); _taxZone->setEnabled(FALSE); } } } void taxZone::sSave() { XSqlQuery taxSave; if (_taxZone->text().length() == 0) { QMessageBox::warning( this, tr("Cannot Save Tax Zone"), tr("You must enter a valid Code.") ); return; } if (_mode == cEdit) { taxSave.prepare( "SELECT taxzone_id " "FROM taxzone " "WHERE ( (taxzone_id<>:taxzone_id)" " AND (UPPER(taxzone_code)=UPPER(:taxzone_code)) );"); taxSave.bindValue(":taxzone_id", _taxzoneid); } else { taxSave.prepare( "SELECT taxzone_id " "FROM taxzone " "WHERE (taxzone_code=:taxzone_code);"); } taxSave.bindValue(":taxzone_code", _taxZone->text().trimmed()); taxSave.exec(); if (taxSave.first()) { QMessageBox::critical( this, tr("Cannot Create Tax Zone"), tr( "A Tax Zone with the entered code already exists." "You may not create a Tax Zone with this code." ) ); _taxZone->setFocus(); return; } else if (taxSave.lastError().type() != QSqlError::NoError) { systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); taxSave.exec("BEGIN;"); if (_mode == cEdit) { taxSave.prepare( "UPDATE taxzone " "SET taxzone_code=:taxzone_code," " taxzone_descrip=:taxzone_descrip " "WHERE (taxzone_id=:taxzone_id);" ); } else if (_mode == cNew) { taxSave.exec("SELECT NEXTVAL('taxzone_taxzone_id_seq') AS taxzone_id;"); if (taxSave.first()) _taxzoneid = taxSave.value("taxzone_id").toInt(); else if (taxSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } taxSave.prepare( "INSERT INTO taxzone " "(taxzone_id, taxzone_code, taxzone_descrip)" "VALUES " "(:taxzone_id, :taxzone_code, :taxzone_descrip);" ); } taxSave.bindValue(":taxzone_id", _taxzoneid); taxSave.bindValue(":taxzone_code", _taxZone->text().trimmed()); taxSave.bindValue(":taxzone_descrip", _description->text()); taxSave.exec(); if (taxSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, taxSave.lastError().databaseText(), __FILE__, __LINE__); return; } taxSave.exec("COMMIT;"); done(_taxzoneid); } void taxZone::populate() { XSqlQuery taxpopulate; taxpopulate.prepare( "SELECT taxzone_code, taxzone_descrip " "FROM taxzone " "WHERE (taxzone_id=:taxzone_id);" ); taxpopulate.bindValue(":taxzone_id", _taxzoneid); taxpopulate.exec(); if (taxpopulate.first()) { _taxZone->setText(taxpopulate.value("taxzone_code").toString()); _description->setText(taxpopulate.value("taxzone_descrip").toString()); } else if (taxpopulate.lastError().type() != QSqlError::NoError) { systemError(this, taxpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxZone::done( int r ) { XDialog::done( r ); close(); } qt-client-4.1.0/guiclient/taxZone.h000066400000000000000000000020451217451700100171770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXZONE_H #define TAXZONE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_taxZone.h" class taxZone : public XDialog, public Ui::taxZone { Q_OBJECT public: taxZone(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~taxZone(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); virtual void done(int); protected slots: virtual void languageChange(); private: int _mode; int _taxzoneid; }; #endif qt-client-4.1.0/guiclient/taxZone.ui000066400000000000000000000157751217451700100174030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxZone 0 0 500 100 Tax Zone 12 12 0 0 5 0 5 0 Code: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxZone &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Qt::Vertical QSizePolicy::Expanding 20 0 0 0 0 0 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 0 XLineEdit QLineEdit
    xlineedit.h
    1
    _taxZone _description _save _close parameter.h _close clicked() taxZone reject() 20 20 20 20
    qt-client-4.1.0/guiclient/taxZones.cpp000066400000000000000000000075271217451700100177270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "taxZones.h" #include #include #include //#include #include #include #include "taxZone.h" #include "storedProcErrorLookup.h" /* * Constructs a taxZones as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ taxZones::taxZones(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_taxZone, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); // statusBar()->hide(); _taxZone->addColumn(tr("Area"), 70, Qt::AlignLeft, true, "taxzone_code" ); _taxZone->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "taxzone_descrip" ); if (_privileges->check("MaintainTaxZones")) { connect(_taxZone, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_taxZone, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_taxZone, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { connect(_taxZone, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _new->setEnabled(FALSE); } sFillList(-1); } /* * Destroys the object and frees any allocated resources */ taxZones::~taxZones() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void taxZones::languageChange() { retranslateUi(this); } void taxZones::sDelete() { XSqlQuery taxDelete; taxDelete.prepare("SELECT deletetaxzone(:tax_zone_id) AS result;"); taxDelete.bindValue(":tax_zone_id", _taxZone->id()); taxDelete.exec(); if (taxDelete.first()) { int returnVal = taxDelete.value("result").toInt(); if (returnVal < 0) { systemError(this, storedProcErrorLookup("deleteTaxZone", returnVal), __FILE__, __LINE__); return; } sFillList(-1); } else if (taxDelete.lastError().type() != QSqlError::NoError) { systemError(this, taxDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void taxZones::sNew() { ParameterList params; params.append("mode", "new"); taxZone newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void taxZones::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("taxzone_id", _taxZone->id()); taxZone newdlg(this, "", TRUE); newdlg.set(params); int result = newdlg.exec(); if (result != XDialog::Rejected) sFillList(result); } void taxZones::sView() { ParameterList params; params.append("mode", "view"); params.append("taxzone_id", _taxZone->id()); taxZone newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void taxZones::sFillList(int pId) { _taxZone->populate( "SELECT taxzone_id, taxzone_code, taxzone_descrip " "FROM taxzone " "ORDER BY taxzone_code;", pId ); } qt-client-4.1.0/guiclient/taxZones.h000066400000000000000000000017541217451700100173700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXZONES_H #define TAXZONES_H #include "guiclient.h" #include "xwidget.h" #include "ui_taxZones.h" class taxZones : public XWidget, public Ui::taxZones { Q_OBJECT public: taxZones(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~taxZones(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(int pId); protected slots: virtual void languageChange(); }; #endif // TAXZONES_H qt-client-4.1.0/guiclient/taxZones.ui000066400000000000000000000127421217451700100175550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. taxZones 0 0 800 600 List Tax Zones 0 12 Tax Zones: 0 0 &Close Qt::Vertical QSizePolicy::Preferred 20 5 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 151 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _taxZone _new _edit _view _delete _close _close clicked() taxZones close() 20 20 20 20 _taxZone valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/taxclasses.h000066400000000000000000000017751217451700100177320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TAXCLASSES_H #define TAXCLASSES_H #include "guiclient.h" #include "xwidget.h" #include "ui_taxClasses.h" class taxClasses : public XWidget, public Ui::taxClasses { Q_OBJECT public: taxClasses(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~taxClasses(); public slots: virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sFillList(int pId); protected slots: virtual void languageChange(); }; #endif // TAXCLASSES_H qt-client-4.1.0/guiclient/terms.cpp000066400000000000000000000167561217451700100172520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "terms.h" #include #include #include terms::terms(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_proximo, SIGNAL(toggled(bool)), _cutOffDay, SLOT(setEnabled(bool))); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_days, SIGNAL(toggled(bool)), this, SLOT(sTypeChanged())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); _discountPercent->setValidator(omfgThis->percentVal()); } terms::~terms() { // no need to delete child widgets, Qt does it all for us } void terms::languageChange() { retranslateUi(this); } enum SetResponse terms::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("terms_id", &valid); if (valid) { _termsid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _typeGroup->setEnabled(FALSE); _ap->setEnabled(FALSE); _ar->setEnabled(FALSE); _dueDays->setEnabled(FALSE); _discountDays->setEnabled(FALSE); _discountPercent->setEnabled(FALSE); _cutOffDay->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } bool terms::sCheck() { XSqlQuery termsCheck; _code->setText(_code->text().trimmed()); if ( (_mode == cNew) && (_code->text().length()) ) { termsCheck.prepare( "SELECT terms_id " "FROM terms " "WHERE (UPPER(terms_code)=UPPER(:terms_code));" ); termsCheck.bindValue(":terms_code", _code->text()); termsCheck.exec(); if (termsCheck.first()) { _termsid = termsCheck.value("terms_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); return TRUE; } } return FALSE; } void terms::sSave() { XSqlQuery termsSave; if(_code->text().trimmed().isEmpty()) { QMessageBox::warning(this, tr("Cannot Save Terms"), tr("You must specify a code for the Terms.")); _code->setFocus(); return; } if (_mode == cNew) { if (sCheck()) { QMessageBox::warning( this, tr("Cannot Save Terms Code"), tr("This Terms code already exists. You have been placed in edit mode.") ); return; } termsSave.exec("SELECT NEXTVAL('terms_terms_id_seq') AS _terms_id"); if (termsSave.first()) _termsid = termsSave.value("_terms_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } termsSave.prepare( "INSERT INTO terms " "( terms_id, terms_code, terms_descrip, terms_type," " terms_ap, terms_ar," " terms_duedays, terms_discdays, terms_discprcnt, terms_cutoffday ) " "VALUES " "( :terms_id, :terms_code, :terms_descrip, :terms_type," " :terms_ap, :terms_ar," " :terms_duedays, :terms_discdays, :terms_discprcnt, :terms_cutoffday );" ); } else if (_mode == cEdit) { termsSave.prepare( "SELECT terms_id " "FROM terms " "WHERE ( (UPPER(terms_code)=UPPER(:terms_code))" " AND (terms_id<>:terms_id) );" ); termsSave.bindValue(":terms_id", _termsid); termsSave.bindValue(":terms_code", _code->text().trimmed()); termsSave.exec(); if (termsSave.first()) { QMessageBox::warning( this, tr("Cannot Save Terms"), tr("You may not rename this Terms code with the entered name as it is in use by another Terms code.") ); return; } termsSave.prepare( "UPDATE terms " "SET terms_code=:terms_code, terms_descrip=:terms_descrip, terms_type=:terms_type," " terms_ap=:terms_ap, terms_ar=:terms_ar," " terms_duedays=:terms_duedays, terms_discdays=:terms_discdays," " terms_discprcnt=:terms_discprcnt, terms_cutoffday=:terms_cutoffday " "WHERE (terms_id=:terms_id);" ); } if (_days->isChecked()) termsSave.bindValue(":terms_type", "D"); else termsSave.bindValue(":terms_type", "P"); termsSave.bindValue(":terms_id", _termsid); termsSave.bindValue(":terms_code", _code->text().trimmed()); termsSave.bindValue(":terms_descrip", _description->text().trimmed()); termsSave.bindValue(":terms_ap", QVariant(_ap->isChecked())); termsSave.bindValue(":terms_ar", QVariant(_ar->isChecked())); termsSave.bindValue(":terms_duedays", _dueDays->value()); termsSave.bindValue(":terms_discdays", _discountDays->value()); termsSave.bindValue(":terms_discprcnt", (_discountPercent->toDouble() / 100.0)); termsSave.bindValue(":terms_cutoffday", _cutOffDay->value()); termsSave.exec(); done(_termsid); } void terms::sTypeChanged() { if (_days->isChecked()) { _dueDaysLit->setText(tr("Due Days:")); _discountDaysLit->setText(tr("Discnt. Days:")); _dueDays->setMinimum(0); _dueDays->setMaximum(999); _discountDays->setMinimum(0); _discountDays->setMaximum(999); } else { _dueDaysLit->setText(tr("Due Day:")); _discountDaysLit->setText(tr("Discnt. Day:")); _dueDays->setMinimum(1); _dueDays->setMaximum(31); _discountDays->setMinimum(1); _discountDays->setMaximum(31); _cutOffDay->setMaximum(31); } } void terms::populate() { XSqlQuery termspopulate; termspopulate.prepare( "SELECT terms_code, terms_descrip, terms_type," " terms_ap, terms_ar," " terms_duedays, terms_discdays, terms_cutoffday," " terms_discprcnt " "FROM terms " "WHERE (terms_id=:terms_id);" ); termspopulate.bindValue(":terms_id", _termsid); termspopulate.exec(); if (termspopulate.first()) { _code->setText(termspopulate.value("terms_code").toString()); _description->setText(termspopulate.value("terms_descrip").toString()); _ap->setChecked(termspopulate.value("terms_ap").toBool()); _ar->setChecked(termspopulate.value("terms_ar").toBool()); _dueDays->setValue(termspopulate.value("terms_duedays").toInt()); _discountPercent->setText(termspopulate.value("terms_discprcnt").toDouble() * 100); _discountDays->setValue(termspopulate.value("terms_discdays").toInt()); if (termspopulate.value("terms_type").toString() == "D") { _days->setChecked(TRUE); if (_mode == cEdit) _cutOffDay->setEnabled(FALSE); } else if (termspopulate.value("terms_type").toString() == "P") { _proximo->setChecked(TRUE); _cutOffDay->setValue(termspopulate.value("terms_cutoffday").toInt()); } } } qt-client-4.1.0/guiclient/terms.h000066400000000000000000000020451217451700100167010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TERMS_H #define TERMS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_terms.h" class terms : public XDialog, public Ui::terms { Q_OBJECT public: terms(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~terms(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual bool sCheck(); virtual void sSave(); virtual void sTypeChanged(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _termsid; }; #endif // TERMS_H qt-client-4.1.0/guiclient/terms.ui000066400000000000000000000417631217451700100171010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. terms 0 0 488 249 Terms 0 5 5 0 C&ode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 0 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 0 0 0 Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::MinimumExpanding 20 0 0 7 true 0 0 0 5 0 0 Da&ys true 0 0 &Proximo 0 Used in Payables Used in Receivables Qt::Vertical QSizePolicy::Preferred 10 0 Qt::Horizontal QSizePolicy::Expanding 0 20 5 0 D&ue Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _dueDays Disc&nt. Days: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _discountDays D&iscount %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _discountPercent Cut-o&ff Day: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _cutOffDay 0 0 0 0 999 0 999 Qt::Horizontal QSizePolicy::Expanding 56 10 0 0 0 60 32767 Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 214 20 0 false 0 999 Qt::Horizontal QSizePolicy::Expanding 51 10 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _code _description _days _ap _ar _dueDays _discountDays _discountPercent _cutOffDay _proximo toggled(bool) _cutOffDay setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/termses.cpp000066400000000000000000000123631217451700100175700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "termses.h" #include #include #include #include #include #include "terms.h" termses::termses(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_terms, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _terms->addColumn(tr("Code"),_itemColumn, Qt::AlignLeft, true, "terms_code"); _terms->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "terms_descrip"); _terms->addColumn(tr("Type"),_dateColumn, Qt::AlignCenter,true, "type"); _terms->addColumn(tr("A/P"), _ynColumn, Qt::AlignCenter,true, "terms_ap"); _terms->addColumn(tr("A/R"), _ynColumn, Qt::AlignCenter,true, "terms_ar"); if (_privileges->check("MaintainTerms")) { connect(_terms, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_terms, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_terms, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_terms, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } sFillList(); } termses::~termses() { // no need to delete child widgets, Qt does it all for us } void termses::languageChange() { retranslateUi(this); } void termses::sFillList() { XSqlQuery termsesFillList; termsesFillList.prepare( "SELECT terms_id, terms_code, terms_descrip," " CASE WHEN (terms_type = 'D') THEN :days" " WHEN (terms_type = 'P') THEN :proximo" " ELSE '?'" " END AS type," " terms_ap, terms_ar " "FROM terms " "ORDER BY terms_code;" ); termsesFillList.bindValue(":days", tr("Days")); termsesFillList.bindValue(":proximo", tr("Proximo")); termsesFillList.exec(); _terms->populate(termsesFillList); } void termses::sDelete() { XSqlQuery termsesDelete; termsesDelete.prepare( "SELECT cust_id " "FROM custinfo " "WHERE (cust_terms_id=:terms_id);" ); termsesDelete.bindValue(":terms_id", _terms->id()); termsesDelete.exec(); if (termsesDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Terms Code"), tr("

    You may not delete the selected Terms Code " "are there are one or more Customers assigned to " "it. You must reassign these Customers before " "you may delete the selected Terms Code." ) ); return; } else if (termsesDelete.lastError().type() != QSqlError::NoError) { systemError(this, termsesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } termsesDelete.prepare( "SELECT vend_id " "FROM vendinfo " "WHERE (vend_terms_id=:terms_id);" ); termsesDelete.bindValue(":terms_id", _terms->id()); termsesDelete.exec(); if (termsesDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Terms Code"), tr("

    You may not delete the selected Terms Code " "as there are one or more Vendors assigned to " "it. You must reassign these Vendors before you " "may delete the selected Terms Code." ) ); return; } else if (termsesDelete.lastError().type() != QSqlError::NoError) { systemError(this, termsesDelete.lastError().databaseText(), __FILE__, __LINE__); return; } termsesDelete.prepare( "DELETE FROM terms " "WHERE (terms_id=:terms_id);" ); termsesDelete.bindValue(":terms_id", _terms->id()); termsesDelete.exec(); sFillList(); } void termses::sNew() { ParameterList params; params.append("mode", "new"); terms newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void termses::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("terms_id", _terms->id()); terms newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void termses::sView() { ParameterList params; params.append("mode", "view"); params.append("terms_id", _terms->id()); terms newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void termses::sPopulateMenu( QMenu * ) { } void termses::sPrint() { orReport report("TermsMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/termses.h000066400000000000000000000020261217451700100172300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TERMSES_H #define TERMSES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_termses.h" class termses : public XWidget, public Ui::termses { Q_OBJECT public: termses(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~termses(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // TERMSES_H qt-client-4.1.0/guiclient/termses.ui000066400000000000000000000114651217451700100174250ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. termses 0 0 600 400 List Terms 0 Terms: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget

    xtreewidget.h
    1 _terms _new _edit _view _delete _print _close parameter.h _close clicked() termses close() 20 20 20 20 _terms valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/thawItemSitesByClassCode.cpp000066400000000000000000000035731217451700100227570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "thawItemSitesByClassCode.h" thawItemSitesByClassCode::thawItemSitesByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_thaw, SIGNAL(clicked()), this, SLOT(sThaw())); _classCode->setType(ParameterGroup::ClassCode); //If not multi-warehouse hide whs control if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } thawItemSitesByClassCode::~thawItemSitesByClassCode() { // no need to delete child widgets, Qt does it all for us } void thawItemSitesByClassCode::languageChange() { retranslateUi(this); } void thawItemSitesByClassCode::sThaw() { XSqlQuery thawThaw; QString sql( "SELECT thawItemsite(itemsite_id) " "FROM itemsite, item " "WHERE ( (itemsite_freeze)" " AND (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=:warehous_id)" ); if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += ");"; thawThaw.prepare(sql); thawThaw.bindValue(":warehous_id", _warehouse->id()); _classCode->bindValue(thawThaw); thawThaw.exec(); accept(); } qt-client-4.1.0/guiclient/thawItemSitesByClassCode.h000066400000000000000000000017371217451700100224240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef THAWITEMSITESBYCLASSCODE_H #define THAWITEMSITESBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_thawItemSitesByClassCode.h" class thawItemSitesByClassCode : public XDialog, public Ui::thawItemSitesByClassCode { Q_OBJECT public: thawItemSitesByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~thawItemSitesByClassCode(); public slots: virtual void sThaw(); protected slots: virtual void languageChange(); }; #endif // THAWITEMSITESBYCLASSCODE_H qt-client-4.1.0/guiclient/thawItemSitesByClassCode.ui000066400000000000000000000135611217451700100226100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. thawItemSitesByClassCode 0 0 501 215 Thaw Item Sites by Class Code/Site 12 12 5 7 false 0 0 &Cancel true &Thaw true true Qt::Vertical QSizePolicy::Preferred 20 16 0 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 16 ParameterGroup QGroupBox
    parametergroup.h
    WComboBox XComboBox
    wcombobox.h
    _warehouse _thaw _close _close clicked() thawItemSitesByClassCode reject() 20 20 20 20
    qt-client-4.1.0/guiclient/timeoutHandler.cpp000066400000000000000000000102461217451700100210700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* * This class attaches itself to the qApp event filter * and listens for events to come across. In addition it * listens for a timer that fires once a minute and no user * generated events have occured in an amount of time specified * by the user preferences value then a dialog will be popped up * notifing the user that they have 60 secs to cancel the shutdown * Sequence or their client will be terminated. */ #include "timeoutHandler.h" #include #include /* * This will initialize the TimeoutHandler which will be disabled * at first. You must connect the timeout signal to a slot in your * application then call setIdleMinutes() with a value greater than * zero to make the TimeoutHandler Active. */ TimeoutHandler::TimeoutHandler(QObject* parent, const char* name) : QObject(parent), _timer(this) { if(name) setObjectName(name); _timeoutValue = 0; // 0ms (disabled) // this will keep track of our elapsed time _lastEvent.start(); // connect the timer to ourselves connect(&_timer, SIGNAL(timeout()), this, SLOT(sCheckTimeout())); // install this object into the applications // event filter so that we can see everything // that happens qApp->installEventFilter(this); } /* * Virtual Deconstructor */ TimeoutHandler::~TimeoutHandler() { if(_timer.isActive()) _timer.stop(); } /* * Returns true if this TimeoutHandler object is currently * active; otherwise, false will be returned */ bool TimeoutHandler::isActive() { return _timer.isActive(); } /* * Returns the number of minutes a user can be idle * before the timeout() signal will be issued. */ int TimeoutHandler::idleMinutes() { if(_timeoutValue == 0) return 0; return ((_timeoutValue / 1000) / 60); } /* * Sets the number of minutes a user can idle before * the timeout() signal will be issued. If you pass * in a value of zero (0) or less it will disable the * TimeoutHandler class and no signals will be generated. */ void TimeoutHandler::setIdleMinutes(int minutes) { if(minutes < 1) { _timeoutValue = 0; if(_timer.isActive()) _timer.stop(); } else { _timeoutValue = minutes * 60000; // convert from minutes to milliseconds if(!_timer.isActive()) _timer.start(60000); } _lastEvent.restart(); } /* * This is the overrided method from QObject that receives the event * notifications that we setup to listen for (qApp) and on certain * events will reset the _lastEvent QTime object to the current time. */ bool TimeoutHandler::eventFilter(QObject* /*watched*/, QEvent* event) { QEvent::Type eType = event->type(); if( eType == QEvent::MouseButtonPress || eType == QEvent::KeyPress ) { _lastEvent.restart(); // reset our elapsed timer } // ALWAYS RETURN FALSE so that the event gets // passed on to the next widget for processing return false; } /* * This slot is called by the QTimer object _timer each minute * and compares the elapsed time of from now and the last event * to the _timeoutValue. If the elapsed time exceeds the _timeoutValue * the signal timeout() will be issued. * * NOTE: The elapsed time value is not reset here. If the TimeoutHandler * is not manually reset or if no Events are received before the next * time the QTimer object _timer calls this function then timeout() * will be issued again.. */ void TimeoutHandler::sCheckTimeout() { if(_lastEvent.elapsed() > _timeoutValue) { // the user is at or over the whatever idle time they // have been allowed so now we need to deal with it timeout(); } } /* * Resets the QTime object value _lastEvent. */ void TimeoutHandler::reset() { _lastEvent.restart(); } qt-client-4.1.0/guiclient/timeoutHandler.h000066400000000000000000000027171217451700100205410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* * This class attaches itself to the qApp event filter * and listens for events to come across. In addition it * listens for a timer that fires once a minute and no user * generated events have occured in an amount of time specified * by the user preferences value then a dialog will be popped up * notifing the user that they have 60 secs to cancel the shutdown * Sequence or their client will be terminated. */ #ifndef __TIMEOUT_H__ #define __TIMEOUT_H__ #include #include #include #include class TimeoutHandler : public QObject { Q_OBJECT public: TimeoutHandler(QObject* = 0, const char* = 0); virtual ~TimeoutHandler(); bool eventFilter(QObject*, QEvent*); bool isActive(); int idleMinutes(); void setIdleMinutes(int); void reset(); signals: void timeout(); protected: QTimer _timer; // 1-minute timer QTime _lastEvent; // last event time protected slots: void sCheckTimeout(); private: int _timeoutValue; }; #endif qt-client-4.1.0/guiclient/todoCalendarControl.cpp000066400000000000000000000040721217451700100220440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "todoCalendarControl.h" #include "guiclient.h" #include #include #include #include "todoListCalendar.h" todoCalendarControl::todoCalendarControl(todoListCalendar * parent) : CalendarControl(parent) { _list = parent; } QString todoCalendarControl::contents(const QDate & date) { QString sql = "SELECT count(*) AS result" " FROM todoitem LEFT OUTER JOIN incdt ON (incdt_id=todoitem_incdt_id) " " LEFT OUTER JOIN crmacct ON (crmacct_id=todoitem_crmacct_id) " " LEFT OUTER JOIN custinfo ON (cust_id=crmacct_cust_id) " " LEFT OUTER JOIN incdtpriority ON (incdtpriority_id=todoitem_priority_id) " " WHERE((todoitem_due_date = )" " " " AND (todoitem_status != 'C')" " " " " " AND (todoitem_username=) " " " " AND (todoitem_username ~ ) " " " " AND (todoitem_active) " " );"; ParameterList params; params.append("date", date); if(_list) _list->setParams(params); MetaSQLQuery mql(sql); XSqlQuery qry = mql.toQuery(params); if(qry.first()) { if(qry.value(0).toInt() != 0) return qry.value(0).toString(); } return QString::null; } qt-client-4.1.0/guiclient/todoCalendarControl.h000066400000000000000000000014501217451700100215060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TODOCALENDARCONTROL_H #define TODOCALENDARCONTROL_H #include class todoListCalendar; class todoCalendarControl : public CalendarControl { Q_OBJECT public: todoCalendarControl(todoListCalendar * parent = 0); QString contents(const QDate &); protected: todoListCalendar *_list; }; #endif // TODOCALENDARCONTROL_H qt-client-4.1.0/guiclient/todoItem.cpp000066400000000000000000000266201217451700100176730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "todoItem.h" #include #include #include #include #include "storedProcErrorLookup.h" todoItem::todoItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); if(!_privileges->check("EditOwner")) _owner->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_incident, SIGNAL(newId(int)), this, SLOT(sHandleIncident())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); _started->setAllowNullDate(true); _due->setAllowNullDate(true); _assigned->setAllowNullDate(true); _completed->setAllowNullDate(true); _priority->setType(XComboBox::IncidentPriority); _assignedTo->setUsername(omfgThis->username()); _owner->setUsername(omfgThis->username()); _owner->setType(UsernameLineEdit::UsersActive); _assignedTo->setType(UsernameLineEdit::UsersActive); _assignedTo->setEnabled(_privileges->check("MaintainAllToDoItems")); } void todoItem::languageChange() { retranslateUi(this); } enum SetResponse todoItem::set(const ParameterList &pParams) { XSqlQuery todoet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("username", &valid); if (valid) _assignedTo->setUsername(param.toString()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; todoet.exec("SELECT NEXTVAL('todoitem_todoitem_id_seq') AS todoitem_id"); if (todoet.first()) { _todoitemid = todoet.value("todoitem_id").toInt(); _alarms->setId(_todoitemid); _comments->setId(_todoitemid); _documents->setId(_todoitemid); _recurring->setParent(_todoitemid, "TODO"); } _assignedTo->setEnabled(_privileges->check("ReassignToDoItems")); _assignedTo->setEnabled(_privileges->check("MaintainAllToDoItems")); } else if (param.toString() == "edit") { _mode = cEdit; _name->setEnabled(FALSE); _incident->setEnabled(FALSE); _ophead->setEnabled(FALSE); _assigned->setEnabled(FALSE); _due->setEnabled(FALSE); _assignedTo->setEnabled(_privileges->check("ReassignToDoItems")); _description->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _owner->setEnabled(FALSE); _name->setEnabled(FALSE); _priority->setEnabled(FALSE); _incident->setEnabled(FALSE); _ophead->setEnabled(FALSE); _started->setEnabled(FALSE); _assigned->setEnabled(FALSE); _due->setEnabled(FALSE); _completed->setEnabled(FALSE); _pending->setEnabled(FALSE); _deferred->setEnabled(FALSE); _neither->setEnabled(FALSE); _assignedTo->setEnabled(FALSE); _description->setEnabled(FALSE); _notes->setEnabled(FALSE); _alarms->setReadOnly(TRUE); _comments->setReadOnly(true); _documents->setReadOnly(true); _crmacct->setReadOnly(true); _cntct->setReadOnly(true); _buttonBox->setStandardButtons(QDialogButtonBox::Close); } } param = pParams.value("incdt_id", &valid); if (valid) _incident->setId(param.toInt()); param = pParams.value("priority_id", &valid); if (valid) _priority->setId(param.toInt()); param = pParams.value("ophead_id", &valid); if (valid) _ophead->setId(param.toInt()); param = pParams.value("crmacct_id", &valid); if (valid) { _crmacct->setId(param.toInt()); _crmacct->setEnabled(false); _incident->setExtraClause(QString(" (incdt_crmacct_id=%1) ") .arg(_crmacct->id())); _ophead->setExtraClause(QString(" (ophead_crmacct_id=%1) ") .arg(_crmacct->id())); } param = pParams.value("todoitem_id", &valid); if (valid) { _todoitemid = param.toInt(); sPopulate(); } return NoError; } void todoItem::sSave() { XSqlQuery todoSave; RecurrenceWidget::RecurrenceChangePolicy cp = _recurring->getChangePolicy(); if (cp == RecurrenceWidget::NoPolicy) return; QString storedProc; XSqlQuery beginq("BEGIN;"); XSqlQuery rollbackq; rollbackq.prepare("ROLLBACK;"); if (_mode == cNew) { todoSave.prepare( "SELECT createTodoItem(:todoitem_id, :username, :name, :description, " " :incdt_id, :crmacct_id, :ophead_id, :started, :due, :status, " " :assigned, :completed, :priority, :notes, :owner, :cntct_id) AS result;"); storedProc = "createTodoItem"; } else if (_mode == cEdit) { todoSave.prepare( "SELECT updateTodoItem(:todoitem_id, " " :username, :name, :description, " " :incdt_id, :crmacct_id, :ophead_id, :started, :due, :status, " " :assigned, :completed, :priority, :notes, :active, :owner, :cntct_id) AS result;"); storedProc = "updateTodoItem"; } todoSave.bindValue(":todoitem_id", _todoitemid); todoSave.bindValue(":owner", _owner->username()); todoSave.bindValue(":username", _assignedTo->username()); if(_assigned->date().isValid()) todoSave.bindValue(":assigned", _assigned->date()); todoSave.bindValue(":name", _name->text()); todoSave.bindValue(":description", _description->text()); if (_incident->id() > 0) todoSave.bindValue(":incdt_id", _incident->id()); // else NULL if (_crmacct->id() > 0) todoSave.bindValue(":crmacct_id", _crmacct->id()); // else NULL todoSave.bindValue(":started", _started->date()); todoSave.bindValue(":due", _due->date()); todoSave.bindValue(":assigned", _assigned->date()); todoSave.bindValue(":completed", _completed->date()); if(_priority->isValid()) todoSave.bindValue(":priority", _priority->id()); todoSave.bindValue(":notes", _notes->toPlainText()); todoSave.bindValue(":active", QVariant(_active->isChecked())); if(_ophead->id() > 0) todoSave.bindValue(":ophead_id", _ophead->id()); QString status; if (_completed->date().isValid()) status = "C"; else if (_deferred->isChecked()) status = "D"; else if (_pending->isChecked()) status = "P"; else if (_started->date().isValid()) status = "I"; else status = "N"; todoSave.bindValue(":status", status); if (_cntct->isValid()) todoSave.bindValue(":cntct_id", _cntct->id()); todoSave.exec(); if (todoSave.first()) { int result = todoSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup(storedProc, result), __FILE__, __LINE__); rollbackq.exec(); return; } } else if (todoSave.lastError().type() != QSqlError::NoError) { rollbackq.exec(); systemError(this, todoSave.lastError().databaseText(), __FILE__, __LINE__); return; } // TODO: make this part of {create,update}TodoItem? if (_recurring->isRecurring()) { XSqlQuery recurq; recurq.prepare("UPDATE todoitem" " SET todoitem_recurring_todoitem_id=:parent_id" " WHERE todoitem_id=:id;"); recurq.bindValue(":parent_id", _recurring->parentId()); recurq.bindValue(":id", _todoitemid); if (! recurq.exec()) { rollbackq.exec(); systemError(this, recurq.lastError().text(), __FILE__, __LINE__); return; } } else { XSqlQuery recurq; recurq.prepare("UPDATE todoitem" " SET todoitem_recurring_todoitem_id=NULL" " WHERE todoitem_id=:id;"); recurq.bindValue(":id", _todoitemid); if (! recurq.exec()) { rollbackq.exec(); systemError(this, recurq.lastError().text(), __FILE__, __LINE__); return; } } QString errmsg; if (! _recurring->save(true, cp, &errmsg)) { rollbackq.exec(); systemError(this, errmsg, __FILE__, __LINE__); return; } XSqlQuery commitq("COMMIT;"); done(_todoitemid); } void todoItem::sPopulate() { XSqlQuery todoPopulate; todoPopulate.prepare( "SELECT * " "FROM todoitem " "WHERE (todoitem_id=:todoitem_id);" ); todoPopulate.bindValue(":todoitem_id", _todoitemid); todoPopulate.exec(); if (todoPopulate.first()) { _owner->setUsername(todoPopulate.value("todoitem_owner_username").toString()); _assignedTo->setUsername(todoPopulate.value("todoitem_username").toString()); _name->setText(todoPopulate.value("todoitem_name").toString()); _priority->setNull(); if(!todoPopulate.value("todoitem_priority_id").toString().isEmpty()) _priority->setId(todoPopulate.value("todoitem_priority_id").toInt()); _incident->setId(todoPopulate.value("todoitem_incdt_id").toInt()); _ophead->setId(todoPopulate.value("todoitem_ophead_id").toInt()); _started->setDate(todoPopulate.value("todoitem_start_date").toDate()); _assigned->setDate(todoPopulate.value("todoitem_assigned_date").toDate()); _due->setDate(todoPopulate.value("todoitem_due_date").toDate(), true); _completed->setDate(todoPopulate.value("todoitem_completed_date").toDate()); _description->setText(todoPopulate.value("todoitem_description").toString()); _notes->setText(todoPopulate.value("todoitem_notes").toString()); _crmacct->setId(todoPopulate.value("todoitem_crmacct_id").toInt()); _cntct->setId(todoPopulate.value("todoitem_cntct_id").toInt()); _active->setChecked(todoPopulate.value("todoitem_active").toBool()); if (todoPopulate.value("todoitem_status").toString() == "P") _pending->setChecked(true); else if (todoPopulate.value("todoitem_status").toString() == "D") _deferred->setChecked(true); else _neither->setChecked(true); if (cEdit == _mode && (omfgThis->username()==todoPopulate.value("todoitem_creator_username").toString() || _privileges->check("MaintainAllToDoItems"))) { _name->setEnabled(true); _incident->setEnabled(true); _ophead->setEnabled(true); _assigned->setEnabled(true); _due->setEnabled(true); _description->setEnabled(true); } _alarms->setId(_todoitemid); _comments->setId(_todoitemid); _documents->setId(_todoitemid); _recurring->setParent(todoPopulate.value("todoitem_recurring_todoitem_id").isNull() ? _todoitemid : todoPopulate.value("todoitem_recurring_todoitem_id").toInt(), "TODO"); _cntct->setId(todoPopulate.value("todoitem_cntct_id").toInt()); } else if (todoPopulate.lastError().type() != QSqlError::NoError) { systemError(this, todoPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void todoItem::sClose() { reject(); } void todoItem::sHandleIncident() { _crmacct->setEnabled(! _incident->isValid()); if (_incident->isValid()) { XSqlQuery incdtq; incdtq.prepare("SELECT incdt_crmacct_id " "FROM incdt " "WHERE (incdt_id=:incdt_id);"); incdtq.bindValue(":incdt_id", _incident->id()); incdtq.exec(); if (incdtq.first()) _crmacct->setId(incdtq.value("incdt_crmacct_id").toInt()); else if (incdtq.lastError().type() != QSqlError::NoError) { systemError(this, incdtq.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/todoItem.h000066400000000000000000000020371217451700100173340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TODOITEM_H #define TODOITEM_H #include "guiclient.h" #include "xdialog.h" #include "parameter.h" #include "ui_todoItem.h" class todoItem : public XDialog, public Ui::todoItem { Q_OBJECT public: todoItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); virtual SetResponse set(const ParameterList & pParams ); virtual void languageChange(); protected slots: virtual void sClose(); virtual void sHandleIncident(); virtual void sPopulate(); virtual void sSave(); private: int _mode; int _todoitemid; }; #endif // TODOITEM_H qt-client-4.1.0/guiclient/todoItem.ui000066400000000000000000000475301217451700100175310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. todoItem 0 0 600 400 To-Do List Item Task Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 0 0 Active true Qt::Horizontal 40 20 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Priority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::Horizontal 61 22 0 1 0 Status Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Assigned: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Started: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Completed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical 20 0 0 1 12 Pending Input Deferred Neither true Qt::Vertical 20 0 Contact Qt::Vertical 20 0 Qt::Horizontal 0 20 Notes 0 3 true Relationships Qt::StrongFocus Qt::Horizontal Qt::StrongFocus Qt::StrongFocus Opportunity #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Incident #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Account #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Alarms Alarms::TodoItem Comments Comments::TodoItem Documents Documents::Todo Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Horizontal 0 28 Qt::StrongFocus Assigned to: Qt::StrongFocus Owner: Alarms QWidget
    alarms.h
    Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    CRMAcctCluster QWidget
    crmacctcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    Documents QWidget
    documents.h
    IncidentCluster QWidget
    incidentcluster.h
    OpportunityCluster QWidget
    opportunitycluster.h
    RecurrenceWidget QWidget
    recurrencewidget.h
    UsernameCluster QWidget
    usernamecluster.h
    XComboBox QComboBox
    xcombobox.h
    XTextEdit QTextEdit
    xtextedit.h
    _name _active _description _priority _owner _assignedTo _tab _due _assigned _started _completed _pending _deferred _neither _cntct _notes _crmacct _ophead _incident _buttonBox _owner newId(int) _alarms setUsrId1(int) 124 163 637 647 _assignedTo newId(int) _alarms setUsrId2(int) 346 163 637 647 _due newDate(QDate) _alarms setDate(QDate) 199 270 637 647 _crmacct newId(int) _cntct setSearchAcct(int) 76 267 76 267
    qt-client-4.1.0/guiclient/todoList.cpp000066400000000000000000000606431217451700100177130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "todoList.h" #include "xdialog.h" #include "todoItem.h" #include "incident.h" #include "customer.h" #include "project.h" #include "opportunity.h" #include "storedProcErrorLookup.h" #include "task.h" #include "parameterwidget.h" #include #include #include todoList::todoList(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "todoList", fl) { _shown = false; _run = false; setupUi(optionsWidget()); setWindowTitle(tr("To-Do Items")); setReportName("TodoList"); setMetaSQLOptions("todolist", "detail"); setUseAltId(true); setParameterWidgetVisible(true); setNewVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("User"), "username", ParameterWidget::User, omfgThis->username()); parameterWidget()->append(tr("Owner"), "owner_username", ParameterWidget::User); parameterWidget()->append(tr("Assigned To"), "assigned_username", ParameterWidget::User); parameterWidget()->append(tr("CRM Account"), "crmacct_id", ParameterWidget::Crmacct); parameterWidget()->append(tr("Start Date on or Before"), "startStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Start Date on or After"), "startEndDate", ParameterWidget::Date); parameterWidget()->append(tr("Due Date on or Before"), "dueStartDate", ParameterWidget::Date); parameterWidget()->append(tr("Due Date on or After"), "dueEndDate", ParameterWidget::Date); parameterWidget()->append(tr("Show Completed"), "completed", ParameterWidget::Exists); parameterWidget()->append(tr("Show Completed Only"), "completedonly", ParameterWidget::Exists); parameterWidget()->applyDefaultFilterSet(); connect(_opportunities, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_todolist, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_incidents, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_projects, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sOpen())); list()->addColumn(tr("Type"), _userColumn, Qt::AlignCenter, true, "type"); list()->addColumn(tr("Priority"), _userColumn, Qt::AlignLeft, true, "priority"); list()->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false,"owner"); list()->addColumn(tr("Assigned To"),_userColumn, Qt::AlignLeft, true, "assigned"); list()->addColumn(tr("Name"), 100, Qt::AlignLeft, true, "name"); list()->addColumn(tr("Notes"), -1, Qt::AlignLeft, true, "notes"); list()->addColumn(tr("Stage"), _statusColumn, Qt::AlignLeft, true, "stage"); list()->addColumn(tr("Start Date"),_dateColumn, Qt::AlignLeft, false, "start"); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft, true, "due"); list()->addColumn(tr("Account#"), _orderColumn, Qt::AlignLeft, false, "crmacct_number"); list()->addColumn(tr("Account Name"), 100, Qt::AlignLeft, true, "crmacct_name"); list()->addColumn(tr("Parent"), 100, Qt::AlignLeft, false, "parent"); list()->addColumn(tr("Customer"), _ynColumn, Qt::AlignLeft, false, "cust"); QToolButton * newBtn = (QToolButton*)toolBar()->widgetForAction(newAction()); newBtn->setPopupMode(QToolButton::MenuButtonPopup); QAction *menuItem; QMenu * todoMenu = new QMenu; menuItem = todoMenu->addAction(tr("To-Do Item"), this, SLOT(sNew())); if(_privileges->check("MaintainAllToDoItems") || _privileges->check("MaintainPersonalToDoItems")) menuItem->setShortcut(QKeySequence::New); menuItem->setEnabled(_privileges->check("MaintainPersonalToDoItems") || _privileges->check("MaintainAllToDoItems")); menuItem = todoMenu->addAction(tr("Opportunity"), this, SLOT(sNewOpportunity())); menuItem->setEnabled(_privileges->check("MaintainPersonalOpportunities") || _privileges->check("MaintainAllOpportunities")); menuItem = todoMenu->addAction(tr("Incident"), this, SLOT(sNewIncdt())); menuItem->setEnabled(_privileges->check("MaintainPersonalIncidents") || _privileges->check("MaintainAllIncidents")); menuItem = todoMenu->addAction(tr("Project"), this, SLOT(sNewProject())); menuItem->setEnabled(_privileges->check("MaintainPersonalProjects") || _privileges->check("MaintainAllProjects")); newBtn->setMenu(todoMenu); } void todoList::showEvent(QShowEvent * event) { display::showEvent(event); if(!_shown) { _shown = true; if(_run) sFillList(); } } void todoList::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *, int) { QAction *menuItem; bool editPriv = false; bool viewPriv = false; if (list()->currentItem()->altId() == 1) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")); menuItem = pMenu->addAction(tr("Edit To-Do..."), this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View To-Do..."), this, SLOT(sView())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction(tr("Delete To-Do"), this, SLOT(sDelete())); menuItem->setEnabled(editPriv); } pMenu->addSeparator(); if (list()->altId() == 2 || (list()->currentItem()->altId() == 1 && list()->currentItem()->rawValue("parent") == "INCDT")) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalIncidents")) || (_privileges->check("MaintainAllIncidents")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalIncidents")) || (_privileges->check("ViewAllIncidents")); menuItem = pMenu->addAction(tr("Edit Incident"), this, SLOT(sEditIncident())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View Incident"), this, SLOT(sViewIncident())); menuItem->setEnabled(viewPriv); } pMenu->addSeparator(); if (list()->altId() == 3) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalProjects")) || (_privileges->check("MaintainAllProjects")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalProjects")) || (_privileges->check("ViewAllProjects")); menuItem = pMenu->addAction(tr("Edit Task"), this, SLOT(sEditTask())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View Task"), this, SLOT(sViewTask())); menuItem->setEnabled(viewPriv); pMenu->addSeparator(); } if (list()->altId() == 3 || list()->altId() == 4) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalProjects")) || (_privileges->check("MaintainAllProjects")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalProjects")) || (_privileges->check("ViewAllProjects")); menuItem = pMenu->addAction(tr("Edit Project"), this, SLOT(sEditProject())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View Project"), this, SLOT(sViewProject())); menuItem->setEnabled(viewPriv); } if (list()->altId() == 5 || (list()->currentItem()->altId() == 1 && list()->currentItem()->rawValue("parent") == "OPP")) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalOpportunities")) || (_privileges->check("MaintainAllOpportunities")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalOpportunities")) || (_privileges->check("ViewAllOpportunities")); menuItem = pMenu->addAction(tr("Edit Opportunity"), this, SLOT(sEditOpportunity())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View Opportunity"), this, SLOT(sViewOpportunity())); menuItem->setEnabled(viewPriv); } if (list()->currentItem()->rawValue("cust").toInt() > 0) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit Customer"), this, SLOT(sEditCustomer())); menuItem->setEnabled(_privileges->check("MaintainCustomerMasters") || _privileges->check("ViewCustomerMasters")); menuItem = pMenu->addAction(tr("View Customer"), this, SLOT(sViewCustomer())); menuItem->setEnabled(_privileges->check("ViewCustomerMasters")); } } enum SetResponse todoList::set(const ParameterList& pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("run", &valid); if (valid) sFillList(); return NoError; } void todoList::sNew() { //Need an extra priv check because of display trigger if (!_privileges->check("MaintainPersonalToDoItems") && !_privileges->check("MaintainAllToDoItems")) return; ParameterList params; parameterWidget()->appendValue(params); params.append("mode", "new"); todoItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sNewIncdt() { ParameterList params; parameterWidget()->appendValue(params); params.append("mode", "new"); incident newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sEdit() { if (list()->altId() ==2) sEditIncident(); else if (list()->altId() == 3) sEditTask(); else if (list()->altId() == 4) sEditProject(); else if (list()->altId() == 5) sEditOpportunity(); else { ParameterList params; params.append("mode", "edit"); params.append("todoitem_id", list()->id()); todoItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } } void todoList::sView() { if (list()->altId() ==2) sViewIncident(); else if (list()->altId() == 3) sViewTask(); else if (list()->altId() == 4) sViewProject(); else if (list()->altId() == 5) sViewOpportunity(); else { ParameterList params; params.append("mode", "view"); params.append("todoitem_id", list()->id()); todoItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void todoList::sDelete() { XSqlQuery todoDelete; QString recurstr; QString recurtype; if (list()->altId() == 1) { recurstr = "SELECT MAX(todoitem_due_date) AS max" " FROM todoitem" " WHERE todoitem_recurring_todoitem_id=:id" " AND todoitem_id!=:id;" ; recurtype = "TODO"; } bool deleteAll = false; bool createMore = false; if (! recurstr.isEmpty()) { XSqlQuery recurq; recurq.prepare(recurstr); recurq.bindValue(":id", list()->id()); recurq.exec(); if (recurq.first() && !recurq.value("max").isNull()) { QMessageBox askdelete(QMessageBox::Question, tr("Delete Recurring Item?"), tr("

    This is a recurring item. Do you want to " "delete just this one item or delete all open " "items in this recurrence?"), QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::Cancel, this); askdelete.setDefaultButton(QMessageBox::Cancel); int ret = askdelete.exec(); if (ret == QMessageBox::Cancel) return; else if (ret == QMessageBox::YesToAll) deleteAll = true; // user said delete one but the only one that exists is the base else if (ret == QMessageBox::Yes && recurq.value("max").isNull()) createMore = true; } else if (recurq.lastError().type() != QSqlError::NoError) { systemError(this, recurq.lastError().text(), __FILE__, __LINE__); return; } else if (QMessageBox::warning(this, tr("Delete List Item?"), tr("

    Are you sure that you want to " "completely delete the selected item?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; } else if (QMessageBox::warning(this, tr("Delete List Item?"), tr("

    Are you sure that you want to " "completely delete the selected item?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; QString procname; int procresult = 0; if (deleteAll) { procname = "deleteOpenRecurringItems"; todoDelete.prepare("SELECT deleteOpenRecurringItems(:id, :type, NULL, TRUE)" " AS result;"); todoDelete.bindValue(":id", list()->id()); todoDelete.bindValue(":type", recurtype); todoDelete.exec(); if (todoDelete.first()) procresult = todoDelete.value("result").toInt(); } if (procresult >= 0 && createMore) { procname = "createRecurringItems"; todoDelete.prepare("SELECT createRecurringItems(:id, :type) AS result;"); todoDelete.bindValue(":id", list()->id()); todoDelete.bindValue(":type", recurtype); todoDelete.exec(); if (todoDelete.first()) procresult = todoDelete.value("result").toInt(); } // not elseif - error handling for 1 or 2 queries if (procresult < 0) { systemError(this, storedProcErrorLookup(procname, procresult)); return; } else if (todoDelete.lastError().type() != QSqlError::NoError) { systemError(this, todoDelete.lastError().databaseText(), __FILE__, __LINE__); return; } if (list()->altId() == 1) todoDelete.prepare("SELECT deleteTodoItem(:todoitem_id) AS result;"); else if (list()->altId() == 3) todoDelete.prepare("DELETE FROM prjtask" " WHERE (prjtask_id=:todoitem_id); "); else if (list()->altId() == 4) todoDelete.prepare("SELECT deleteProject(:todoitem_id) AS result"); else return; todoDelete.bindValue(":todoitem_id", list()->id()); todoDelete.exec(); if (todoDelete.first()) { int result = todoDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteTodoItem", result)); return; } } else if (todoDelete.lastError().type() != QSqlError::NoError) { systemError(this, todoDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } bool todoList::setParams(ParameterList ¶ms) { if (!_todolist->isChecked() && !_opportunities->isChecked() && !_incidents->isChecked() && !_projects->isChecked()) { list()->clear(); return false; } if (_todolist->isChecked()) params.append("todoList"); if (_opportunities->isChecked()) params.append("opportunities"); if (_incidents->isChecked()) params.append("incidents"); if (_projects->isChecked()) params.append("projects"); params.append("todo", tr("To-do")); params.append("incident", tr("Incident")); params.append("task", tr("Task")); params.append("project", tr("Project")); params.append("opportunity", tr("Opportunity")); params.append("complete", tr("Completed")); params.append("deferred", tr("Deferred")); params.append("pending", tr("Pending")); params.append("inprocess", tr("InProcess")); params.append("feedback", tr("Feedback")); params.append("confirmed", tr("Confirmed")); params.append("assigned", tr("Assigned")); params.append("resolved", tr("Resolved")); params.append("closed", tr("Closed")); params.append("concept", tr("Concept")); params.append("new", tr("New")); if (!display::setParams(params)) return false; return true; } int todoList::getId(int pType) { if (list()->currentItem()->altId() == pType) return list()->id(); else return list()->currentItem()->id("parent"); } void todoList::sEditIncident() { ParameterList params; params.append("mode", "edit"); params.append("incdt_id", getId(2)); incident newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sViewIncident() { ParameterList params; params.append("mode", "view"); params.append("incdt_id", getId(2)); incident newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void todoList::sNewProject() { ParameterList params; parameterWidget()->appendValue(params); params.append("mode", "new"); project newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sEditProject() { ParameterList params; params.append("mode", "edit"); qDebug("project %d", getId(4)); params.append("prj_id", getId(4)); project newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sViewProject() { ParameterList params; params.append("mode", "view"); params.append("prj_id", getId(4)); project newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void todoList::sEditTask() { ParameterList params; params.append("mode", "edit"); params.append("prjtask_id", list()->id()); task newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sViewTask() { ParameterList params; params.append("mode", "view"); params.append("prjtask_id", list()->id()); task newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void todoList::sEditCustomer() { ParameterList params; params.append("cust_id", list()->rawValue("cust").toInt()); params.append("mode","edit"); customer *newdlg = new customer(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void todoList::sViewCustomer() { ParameterList params; params.append("cust_id", list()->rawValue("cust").toInt()); params.append("mode","view"); customer *newdlg = new customer(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void todoList::sNewOpportunity() { ParameterList params; parameterWidget()->appendValue(params); params.append("mode", "new"); opportunity newdlg(this, "", true); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sEditOpportunity() { ParameterList params; params.append("mode", "edit"); params.append("ophead_id", getId(5)); opportunity newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoList::sViewOpportunity() { ParameterList params; params.append("mode", "view"); params.append("ophead_id", getId(5)); opportunity newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void todoList::sOpen() { bool editPriv = false; bool viewPriv = false; if (list()->currentItem()->altId() == 1) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")); } if (list()->altId() == 2 || (list()->currentItem()->altId() == 1 && list()->currentItem()->rawValue("parent") == "INCDT")) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalIncidents")) || (_privileges->check("MaintainAllIncidents")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalIncidents")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalIncidents")) || (_privileges->check("ViewAllIncidents")); } if (list()->altId() == 3) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalProjects")) || (_privileges->check("MaintainAllProjects")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalProjects")) || (_privileges->check("ViewAllProjects")); } if (list()->altId() == 3 || list()->altId() == 4) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalProjects")) || (_privileges->check("MaintainAllProjects")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalProjects")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalProjects")) || (_privileges->check("ViewAllProjects")); } if (list()->altId() == 5 || (list()->currentItem()->altId() == 1 && list()->currentItem()->rawValue("parent") == "OPP")) { editPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalOpportunities")) || (_privileges->check("MaintainAllOpportunities")); viewPriv = (omfgThis->username() == list()->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalOpportunities")) || (omfgThis->username() == list()->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalOpportunities")) || (_privileges->check("ViewAllOpportunities")); } if(editPriv) sEdit(); else if(viewPriv) sView(); else QMessageBox::information(this, tr("Restricted Access"), tr("You have not been granted privileges to open this item.")); } void todoList::sFillList() { if(_shown) display::sFillList(); else _run = true; } qt-client-4.1.0/guiclient/todoList.h000066400000000000000000000031741217451700100173540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TODOLIST_H #define TODOLIST_H #include "guiclient.h" #include "display.h" #include "ui_todoList.h" class todoList : public display, public Ui::todoList { Q_OBJECT public: todoList(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual SetResponse set(const ParameterList&); virtual void sDelete(); virtual void sEdit(); virtual void sEditIncident(); virtual void sEditTask(); virtual void sEditProject(); virtual void sEditCustomer(); virtual void sEditOpportunity(); virtual void sNew(); virtual void sNewIncdt(); virtual void sNewProject(); virtual void sNewOpportunity(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sView(); virtual void sViewCustomer(); virtual void sViewIncident(); virtual void sViewTask(); virtual void sViewProject(); virtual void sViewOpportunity(); virtual void sOpen(); virtual bool setParams(ParameterList &); virtual void sFillList(); private: void showEvent(QShowEvent * event); int _mode; int getId(int pType); int _shown; int _run; }; #endif // TODOLIST_H qt-client-4.1.0/guiclient/todoList.ui000066400000000000000000000054251217451700100175430ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. todoList 0 0 460 87 To-Do List Show 12 To-Do List true Opportunities Incidents Projects Qt::Horizontal 40 20 XCheckBox QCheckBox

    xcheckbox.h
    _incidents qt-client-4.1.0/guiclient/todoListCalendar.cpp000066400000000000000000000277731217451700100213540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "todoListCalendar.h" #include "xdialog.h" #include #include #include #include #include #include #include #include "todoCalendarControl.h" #include "storedProcErrorLookup.h" #include "todoItem.h" #include "customer.h" todoListCalendar::todoListCalendar(QWidget* parent, const char * name, Qt::WindowFlags f) : XWidget(parent, name, f) { XSqlQuery todotodoListCalendar; setupUi(this); todoCalendarControl * cc = new todoCalendarControl(this); QGraphicsScene * scene = new QGraphicsScene(this); calendar = new CalendarGraphicsItem(cc); calendar->setSelectedDay(QDate::currentDate()); scene->addItem(calendar); _gview->setScene(scene); _gview->fitInView(scene->sceneRect(), Qt::KeepAspectRatio); _usr->setEnabled(_privileges->check("MaintainAllToDoItems") || _privileges->check("MaintainPersonalToDoItems")); _usr->setType(ParameterGroup::User); todotodoListCalendar.prepare("SELECT getUsrId(NULL) AS usr_id;"); todotodoListCalendar.exec(); if (todotodoListCalendar.first()) { _myUsrId = todotodoListCalendar.value("usr_id").toInt(); _usr->setId(_myUsrId); } else if (todotodoListCalendar.lastError().type() != QSqlError::NoError) { systemError(this, todotodoListCalendar.lastError().databaseText(), __FILE__, __LINE__); close(); } connect(_active, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_completed, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_list, SIGNAL(populateMenu(QMenu*, QTreeWidgetItem*, int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_list, SIGNAL(itemSelectionChanged()), this, SLOT(handlePrivs())); connect(_usr, SIGNAL(updated()), this, SLOT(sFillList())); connect(_usr, SIGNAL(updated()), this, SLOT(handlePrivs())); _list->addColumn(tr("Type"), _statusColumn, Qt::AlignCenter, true, "type"); _list->addColumn(tr("Seq"), _seqColumn, Qt::AlignRight, true, "seq"); _list->addColumn(tr("Priority"), _userColumn, Qt::AlignLeft, true, "priority"); _list->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false, "owner"); _list->addColumn(tr("Assigned"), _userColumn, Qt::AlignLeft, true, "assigned"); _list->addColumn(tr("Name"), 100, Qt::AlignLeft, true, "name"); _list->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "descrip"); _list->addColumn(tr("Status"), _statusColumn, Qt::AlignLeft, true, "status"); _list->addColumn(tr("Due Date"), _dateColumn, Qt::AlignLeft, true, "due"); _list->addColumn(tr("Incident"), _orderColumn, Qt::AlignLeft, true, "incdt"); _list->addColumn(tr("Customer"), _orderColumn, Qt::AlignLeft, true, "cust"); _list->addColumn(tr("Owner"), _userColumn, Qt::AlignLeft, false,"owner"); if (_preferences->boolean("XCheckBox/forgetful")) _active->setChecked(true); _usr->setEnabled(_privileges->check("MaintainAllToDoItems") || _privileges->check("ViewAllToDoItems")); sFillList(QDate::currentDate()); connect(_list, SIGNAL(itemSelected(int)), this, SLOT(sOpen())); connect(cc, SIGNAL(selectedDayChanged(QDate)), this, SLOT(sFillList(QDate))); } void todoListCalendar::languageChange() { retranslateUi(this); } enum SetResponse todoListCalendar::set(const ParameterList& pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("usr_id", &valid); if (valid) { _usr->setId(param.toInt()); sFillList(); } return NoError; } void todoListCalendar::sOpen() { bool editPriv = (omfgThis->username() == _list->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _list->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")); bool viewPriv = (omfgThis->username() == _list->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _list->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")); if (editPriv) sEdit(); else if (viewPriv) sView(); } void todoListCalendar::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; if (_list->currentItem()->text(0) == "T") { bool editPriv = (omfgThis->username() == _list->currentItem()->rawValue("owner") && _privileges->check("MaintainPersonalToDoItems")) || (omfgThis->username() == _list->currentItem()->rawValue("assigned") && _privileges->check("MaintainPersonalToDoItems")) || (_privileges->check("MaintainAllToDoItems")); bool viewPriv = (omfgThis->username() == _list->currentItem()->rawValue("owner") && _privileges->check("ViewPersonalToDoItems")) || (omfgThis->username() == _list->currentItem()->rawValue("assigned") && _privileges->check("ViewPersonalToDoItems")) || (_privileges->check("ViewAllToDoItems")); menuItem = pMenu->addAction(tr("New..."), this, SLOT(sNew())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(editPriv); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(viewPriv); menuItem = pMenu->addAction(tr("Delete"), this, SLOT(sDelete())); menuItem->setEnabled(editPriv); } if (! _list->currentItem()->text(9).isEmpty()) { menuItem = pMenu->addAction(tr("Edit Customer"), this, SLOT(sEditCustomer())); menuItem->setEnabled(_privileges->check("MaintainCustomerMasters")); menuItem = pMenu->addAction(tr("View Customer"), this, SLOT(sViewCustomer())); menuItem->setEnabled(_privileges->check("MaintainCustomerMasters")); } } void todoListCalendar::sNew() { ParameterList params; params.append("mode", "new"); if (_usr->isSelected()) _usr->appendValue(params); todoItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoListCalendar::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("todoitem_id", _list->id()); todoItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void todoListCalendar::sView() { ParameterList params; params.append("mode", "view"); params.append("todoitem_id", _list->id()); todoItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void todoListCalendar::sDelete() { XSqlQuery todoDelete; todoDelete.prepare("SELECT deleteTodoItem(:todoitem_id) AS result;"); todoDelete.bindValue(":todoitem_id", _list->id()); todoDelete.exec(); if (todoDelete.first()) { int result = todoDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteTodoItem", result)); return; } else sFillList(); } else if (todoDelete.lastError().type() != QSqlError::NoError) { systemError(this, todoDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void todoListCalendar::sEditCustomer() { XSqlQuery cust; cust.prepare("SELECT cust_id FROM custinfo WHERE (cust_number=:number);"); cust.bindValue(":number", _list->currentItem()->text(9)); if (cust.exec() && cust.first()) { ParameterList params; params.append("cust_id", cust.value("cust_id").toInt()); params.append("mode","edit"); customer *newdlg = new customer(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (cust.lastError().type() != QSqlError::NoError) systemError(this, cust.lastError().databaseText(), __FILE__, __LINE__); } void todoListCalendar::sViewCustomer() { XSqlQuery cust; cust.prepare("SELECT cust_id FROM custinfo WHERE (cust_number=:number);"); cust.bindValue(":number", _list->currentItem()->text(9)); if (cust.exec() && cust.first()) { ParameterList params; params.append("cust_id", cust.value("cust_id").toInt()); params.append("mode","view"); customer *newdlg = new customer(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (cust.lastError().type() != QSqlError::NoError) systemError(this, cust.lastError().databaseText(), __FILE__, __LINE__); } void todoListCalendar::setParams(ParameterList ¶ms) { if (_active->isChecked()) params.append("active"); if (_completed->isChecked()) params.append("completed"); _usr->appendValue(params); } void todoListCalendar::sFillList() { sFillList(_lastDate); } void todoListCalendar::sFillList(const QDate & date) { static bool dontBotherMe = false; if(dontBotherMe) return; dontBotherMe = true; _lastDate = date; calendar->setSelectedDay(_lastDate); QString sql = "SELECT todoitem_id AS id, todoitem_owner_username AS owner, " " 'T' AS type, incdtpriority_order AS seq, incdtpriority_name AS priority, " " todoitem_name AS name, " " firstLine(todoitem_description) AS descrip, " " todoitem_status AS status, todoitem_due_date AS due, " " todoitem_username AS assigned, todoitem_owner_username AS owner, " " incdt_number AS incdt, cust_number AS cust, " " CASE WHEN (todoitem_status != 'C'AND " " todoitem_due_date < CURRENT_DATE) THEN 'expired'" " WHEN (todoitem_status != 'C'AND " " todoitem_due_date > CURRENT_DATE) THEN 'future'" " END AS due_qtforegroundrole " " FROM todoitem() LEFT OUTER JOIN incdt ON (incdt_id=todoitem_incdt_id) " " LEFT OUTER JOIN crmacct ON (crmacct_id=todoitem_crmacct_id) " " LEFT OUTER JOIN custinfo ON (cust_id=crmacct_cust_id) " " LEFT OUTER JOIN incdtpriority ON (incdtpriority_id=todoitem_priority_id) " " WHERE( (todoitem_due_date = )" " " " AND (todoitem_status != 'C')" " " " " " AND (todoitem_username=) " " " " AND (todoitem_username ~ ) " " " " AND (todoitem_active) " " ) " "ORDER BY due, seq, todoitem_username;"; ParameterList params; params.append("date", date); setParams(params); MetaSQLQuery mql(sql); XSqlQuery itemQ = mql.toQuery(params); _list->populate(itemQ); if (itemQ.lastError().type() != QSqlError::NoError) { systemError(this, itemQ.lastError().databaseText(), __FILE__, __LINE__); dontBotherMe = false; return; } dontBotherMe = false; } void todoListCalendar::resizeEvent(QResizeEvent* event) { XWidget::resizeEvent(event); _gview->setMinimumWidth((int)(_gview->height() * (_gview->scene()->sceneRect().width() / _gview->scene()->sceneRect().height()))); _gview->fitInView(_gview->scene()->sceneRect(), Qt::KeepAspectRatio); } void todoListCalendar::showEvent(QShowEvent * event) { XWidget::showEvent(event); _gview->setMinimumWidth((int)(_gview->height() * (_gview->scene()->sceneRect().width() / _gview->scene()->sceneRect().height()))); _gview->fitInView(_gview->scene()->sceneRect(), Qt::KeepAspectRatio); } qt-client-4.1.0/guiclient/todoListCalendar.h000066400000000000000000000025431217451700100210050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TODOLISTCALENDAR_H #define TODOLISTCALENDAR_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_todoListCalendar.h" class CalendarGraphicsItem; class todoListCalendar : public XWidget, public Ui::todoListCalendar { Q_OBJECT public: todoListCalendar(QWidget* parent = 0, const char * = 0, Qt::WindowFlags f = 0); virtual SetResponse set(const ParameterList&); void setParams(ParameterList &); public slots: void languageChange(); void sFillList(); void sFillList(const QDate&); void sNew(); void sEdit(); void sView(); void sOpen(); void sDelete(); void sEditCustomer(); void sViewCustomer(); protected: void resizeEvent(QResizeEvent*); void showEvent(QShowEvent*); QDate _lastDate; int _myUsrId; CalendarGraphicsItem * calendar; protected slots: void sPopulateMenu(QMenu*); }; #endif // TODOLIST_H qt-client-4.1.0/guiclient/todoListCalendar.ui000066400000000000000000000111631217451700100211710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. todoListCalendar 0 0 800 329 To-Do List Calendar 0 0 Qt::ScrollBarAlwaysOff Qt::ScrollBarAlwaysOff Qt::StrongFocus false Active Only Completed Qt::Vertical 20 0 Close Qt::Vertical 20 0 0 1 ParameterGroup QGroupBox
    parametergroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _gview _usr _active _completed _list _close _close clicked() todoListCalendar close() 656 19 703 26
    qt-client-4.1.0/guiclient/toitemTableModel.cpp000066400000000000000000000240721217451700100213400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ // TODO: drag/drop support? // TODO: make a base class for the similarities of this and poitemTableModel #include "toitemTableModel.h" #include #include #include #include #include #include "guiclient.h" #include "currcluster.h" ToitemTableModel::ToitemTableModel(QObject * parent, QSqlDatabase db) : QSqlRelationalTableModel(parent, db) { setTable("toitem"); // select statement on which everything else is based _selectStatement = QString("SELECT tohead_number, " " item_number," " prj_number," " CURRENT_DATE AS earliestdate, " " toitem.* " "FROM tohead" " JOIN toitem ON (toitem_tohead_id=tohead_id)" " LEFT OUTER JOIN item ON (toitem_item_id=item_id)" " LEFT OUTER JOIN prj ON (toitem_prj_id=prj_id)" ); setEditStrategy(QSqlTableModel::OnManualSubmit); // OnRow? setSort(TOITEM_LINENUMBER_COL, Qt::AscendingOrder); // insert only those columns not directly part of the toitem table insertColumns(0, 4); setHeaderData(TOITEM_LINENUMBER_COL, Qt::Horizontal, tr("#")); setHeaderData(ITEM_NUMBER_COL, Qt::Horizontal, tr("Item")); setHeaderData(TOITEM_QTY_ORDERED_COL, Qt::Horizontal, tr("Qty.")); setHeaderData(TOITEM_STDCOST_COL, Qt::Horizontal, tr("Std. Cost")); setHeaderData(TOITEM_FREIGHT_COL, Qt::Horizontal, tr("Freight")); setHeaderData(TOITEM_DUEDATE_COL, Qt::Horizontal, tr("Due Date")); setHeaderData(PRJ_NUMBER_COL, Qt::Horizontal, tr("Project #")); _toheadid = -1; _toitemid = -1; findHeadData(); _dirty = false; select(); connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(markDirty(QModelIndex, QModelIndex))); } void ToitemTableModel::findHeadData() { _toheadcurrid = CurrDisplay::baseId(); _toheaddate = QDate(); _tostatus = "O"; // safest default _toheadsrcwhsid = -1; XSqlQuery toheadq; if (_toheadid > 0) { toheadq.prepare("SELECT * " "FROM tohead " "WHERE (tohead_id=:tohead_id);"); toheadq.bindValue(":tohead_id", _toheadid); } else if (_toitemid > 0) { toheadq.prepare("SELECT * " "FROM tohead " "WHERE tohead_id IN (SELECT toitem_tohead_id " " FROM toitem WHERE toitem_id=:toitem_id);"); toheadq.bindValue(":toitem_id", _toitemid); } else return; toheadq.exec(); if (toheadq.first()) { _toheadcurrid = toheadq.value("tohead_freight_curr_id").toInt(); _toheaddate = toheadq.value("tohead_orderdate").toDate(); _tostatus = toheadq.value("tohead_status").toString(); _toheadsrcwhsid=toheadq.value("tohead_src_warehous_id").toInt(); } else if (toheadq.lastError().type() != QSqlError::NoError) { systemError(0, toheadq.lastError().databaseText(), __FILE__, __LINE__); return; } } void ToitemTableModel::setHeadId(const int pId) { setFilter(QString("toitem_tohead_id=%1").arg(pId)); _toheadid = pId; _toitemid = -1; findHeadData(); } void ToitemTableModel::setItemId(const int pId) { setFilter(QString("toitem_id=%1").arg(pId)); _toheadid = -1; _toitemid = pId; findHeadData(); } void ToitemTableModel::setShipDate(const QDate pDate) { _toshipdate = pDate; } void ToitemTableModel::setSrcWhsId(const int pId) { _toheadsrcwhsid = pId; } void ToitemTableModel::setTransDate(const QDate pDate) { _toheaddate = pDate; } void ToitemTableModel::setCurrId(const int pId) { _toheadcurrid = pId; } QString ToitemTableModel::selectStatement() const { return _selectStatement + " WHERE " + QString((filter().isEmpty()) ? " (toitem_tohead_id=-1) " : filter()) + " ORDER BY toitem_linenumber" ; } bool ToitemTableModel::select() { bool returnVal = QSqlRelationalTableModel::select(); if (returnVal) { insertRow(rowCount()); _dirty = false; connect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(markDirty(QModelIndex, QModelIndex))); } return returnVal; } bool ToitemTableModel::submitAll() { XSqlQuery begin("BEGIN;"); bool returnVal = QSqlRelationalTableModel::submitAll(); if (returnVal) { _dirty = false; XSqlQuery commit("COMMIT;"); } else XSqlQuery rollback("ROLLBACK;"); return returnVal; } Qt::ItemFlags ToitemTableModel::flags(const QModelIndex& index) const { Qt::ItemFlags flags = QSqlRelationalTableModel::flags(index); if (index.column() == TOITEM_STDCOST_COL) flags &= ~(Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled); return flags; } bool ToitemTableModel::isDirty() const { return _dirty; } bool ToitemTableModel::removeRow(int row, const QModelIndex & parent) { return QSqlRelationalTableModel::removeRow(row, parent); } /* Make sure the row is internally consistent. If so then fix it so the parent class has a valid row to insert (some of the SELECTed columns shouldn't be directly modified in the db 'cause they're not part of the model's current table). */ bool ToitemTableModel::validRow(QSqlRecord& record) { QString errormsg; QString warningmsg; if (record.value("item_number").toString().isEmpty()) errormsg = tr("

    You must select an Item Number before you may save."); else if (record.value("toitem_qty_ordered").toDouble() <= 0) errormsg = tr("

    You must enter a quantity before you may save this " "Purchase Order Item."); else if (! record.value("toitem_duedate").toDate().isValid()) errormsg = tr("

    You must enter a due date."); else if (record.value("toitem_tohead_id").toInt() <= 0 && _toheadid <= 0) errormsg = tr("

    There is no Transfer Order header yet. " "Try entering ????."); int index = record.indexOf("toitem_tohead_id"); if (index < 0) { QSqlField field("toitem_tohead_id", QVariant::Int); field.setValue(_toheadid); record.append(field); } else record.setValue(index, _toheadid); XSqlQuery ln; ln.prepare("SELECT COUNT(*) + 1 AS newln " "FROM toitem " "WHERE (toitem_tohead_id=:tohead_id);"); ln.bindValue(":tohead_id", _toheadid); if (record.indexOf("toitem_linenumber") < 0) { ln.exec(); if (ln.first()) { QSqlField field("toitem_linenumber", QVariant::Int); field.setValue(ln.value("newln")); record.append(field); } else if (ln.lastError().type() != QSqlError::NoError) { errormsg = ln.lastError().databaseText(); } } else if (record.value("toitem_linenumber").toInt() <= 0) { ln.exec(); if (ln.first()) record.setValue("toitem_linenumber", ln.value("newln")); else if (ln.lastError().type() != QSqlError::NoError) { errormsg = ln.lastError().databaseText(); } } if (record.value("toitem_id").isNull()) { XSqlQuery idq("SELECT NEXTVAL('toitem_toitem_id_seq') AS toitem_id;"); if (idq.first()) record.setValue("toitem_id", idq.value("toitem_id")); else if (idq.lastError().type() != QSqlError::NoError) errormsg = idq.lastError().databaseText(); } if (_tostatus.isEmpty()) findHeadData(); index = record.indexOf("toitem_freight_curr_id"); if (index < 0) { QSqlField field("toitem_freight_curr_id", QVariant::String); field.setValue(_toheadcurrid); record.append(field); } else if (record.field(index).value().toString().isEmpty()) record.setValue(index, _toheadcurrid); index = record.indexOf("toitem_status"); if (index < 0) { QSqlField field("toitem_status", QVariant::String); field.setValue(_tostatus); record.append(field); } else if (record.field(index).value().toString().isEmpty()) record.setValue(index, _tostatus); index = record.indexOf("toitem_schedshipdate"); if (index < 0) { QSqlField field("toitem_schedshipdate", QVariant::Date); field.setValue(_toshipdate); record.append(field); } else if (record.field(index).value().isNull()) record.setValue(index, _toshipdate); if (! errormsg.isEmpty()) { setLastError(QSqlError(QString("ToitemTableModel::validRow() error"), errormsg, QSqlError::UnknownError)); return false; } else if (! warningmsg.isEmpty()) { if (QMessageBox::question(0, tr("Are you sure you want to continue?"), warningmsg + tr("

    Do you wish to Save this Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return false; } record.remove(record.indexOf("prj_number")); record.remove(record.indexOf("item_number")); record.remove(record.indexOf("tohead_number")); record.remove(record.indexOf("earliestdate")); return true; } bool ToitemTableModel::insertRowIntoTable(const QSqlRecord& record) { if (record.isEmpty()) return true; bool isNull = true; for (int i = 0; i < record.count(); i++) { if (i == record.indexOf("toitem_tohead_id") || (record.value(i).toString().isEmpty() && (i == record.indexOf("toitem_status") || i == record.indexOf("toitem_comments") ))) continue; isNull &= record.isNull(i); } if (isNull) return true; QSqlRecord newRecord(record); if (! validRow(newRecord)) return false; return QSqlRelationalTableModel::insertRowIntoTable(newRecord); } bool ToitemTableModel::updateRowInTable(int row, const QSqlRecord& record) { // touch everything so we can distinguish unchanged fields from NULL/0 as new val for (int i = 0; i < columnCount(); i++) setData(index(row, i), data(index(row, i))); QSqlRecord newRecord(record); if (! validRow(newRecord)) return false; return QSqlRelationalTableModel::updateRowInTable(row, newRecord); } void ToitemTableModel::markDirty(QModelIndex, QModelIndex) { _dirty = true; disconnect(this, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(markDirty(QModelIndex, QModelIndex))); } qt-client-4.1.0/guiclient/toitemTableModel.h000066400000000000000000000070471217451700100210100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TOITEMTABLEMODEL_H #define TOITEMTABLEMODEL_H #include #include #include #include #include #include #include /* Represent as a Table Model either the entire TOITEM table, the TOITEMS for a single POHEAD_ID, or a single TOITEM row. This should probably be written as a an XAbstractTableModel that includes xTuple-generic concepts and PoitemTableModel as a subclass of that abstract class but we don't yet know what all of those abstractions should be. */ // these #defines have to match the order of fields in the select statement #define TOHEAD_NUMBER 0 #define ITEM_NUMBER_COL 1 #define PRJ_NUMBER_COL 2 #define EARLIESTDATE_COL 3 #define TOITEM_ID_COL 4 #define TOITEM_TOHEAD_ID_COL 5 #define TOITEM_LINENUMBER_COL 6 #define TOITEM_ITEM_ID_COL 7 #define TOITEM_STATUS_COL 8 #define TOITEM_DUEDATE_COL 9 #define TOITEM_SCHEDSHIPDATE_COL 10 #define TOITEM_SCHEDRECVDATE_COL 11 #define TOITEM_QTY_ORDERED_COL 12 #define TOITEM_QTY_SHIPPED_COL 13 #define TOITEM_QTY_RECEIVED_COL 14 #define TOITEM_UOM_COL 15 #define TOITEM_STDCOST_COL 16 #define TOITEM_PRJ_ID_COL 17 #define TOITEM_FREIGHT_COL 18 #define TOITEM_FREIGHT_CURR_ID_COL 19 #define TOITEM_NOTES_COL 20 #define TOITEM_CLOSEDATE_COL 21 #define TOITEM_CLOSE_USERNAME_COL 22 #define TOITEM_LASTUPDATED_COL 23 #define TOITEM_CREATED_COL 24 #define TOITEM_CREATOR_COL 25 #define TOITEM_FREIGHT_RECEIVED_COL 26 class ToitemTableModel : public QSqlRelationalTableModel { Q_OBJECT public: ToitemTableModel(QObject * parent = 0, QSqlDatabase = QSqlDatabase()); virtual Qt::ItemFlags flags (const QModelIndex &) const; inline virtual int currId() const { return _toheadcurrid; }; inline virtual int headId() const { return _toheadid; }; inline virtual int itemId() const { return _toitemid; }; virtual bool isDirty() const; virtual bool removeRow(int, const QModelIndex & = QModelIndex()); inline virtual QDate shipDate() const { return _toshipdate; }; inline virtual int srcWhsId() const { return _toheadsrcwhsid; }; inline virtual QDate transDate() const { return _toheaddate; }; public slots: virtual bool select(); virtual void setCurrId(const int pId = -1); virtual void setHeadId(const int pId = -1); virtual void setItemId(const int pId = -1); virtual void setShipDate(const QDate); virtual void setSrcWhsId(const int pId = -1); virtual void setTransDate(const QDate); virtual bool submitAll(); protected: virtual bool insertRowIntoTable(const QSqlRecord&); virtual QString selectStatement() const; virtual bool updateRowInTable(int, const QSqlRecord&); virtual bool validRow(QSqlRecord&); QString _selectStatement; protected slots: virtual void markDirty(QModelIndex, QModelIndex); private: void findHeadData(); bool _dirty; int _toheadcurrid; QDate _toheaddate; int _toheadid; int _toitemid; QDate _toshipdate; int _toheadsrcwhsid; QString _tostatus; }; #endif // TOITEMTABLEMODEL_H qt-client-4.1.0/guiclient/toitemTableView.cpp000066400000000000000000000236731217451700100212200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* TODO: make deleted line items more obvious TODO: return to the editor if validation fails TODO: refactor: move some of the logic from ToitemTableDelegate::setModelData() into ToitemTableModel move ToitemTableDelegate into a separate file and split into ToitemDelegate and subclass it to ToitemTableDelegate write transferOrderItem to use ToitemDelegate move p/o and t/o commonalities to generic parent class */ #include "toitemTableView.h" #include #include #include #include #include #include "guiclient.h" #include "datecluster.h" #include "itemcluster.h" #include "toitemTableModel.h" #include "projectcluster.h" #include "xtreewidget.h" // for column widths // #define QE_PROJECT // define this if you want project support on qe #define QE_NONINVENTORY ToitemTableView::ToitemTableView(QWidget* parent) : QTableView(parent) { ToitemTableDelegate *delegate = new ToitemTableDelegate(this); setItemDelegate(delegate); setShowGrid(false); #ifdef Q_WS_MAC QFont f = font(); f.setPointSize(f.pointSize() - 2); setFont(f); #endif connect(delegate, SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), this, SLOT(sHandleCloseEditor(QWidget*))); } void ToitemTableView::sHandleCloseEditor(QWidget *editor) { #ifdef QE_PROJECT if ((_metrics->boolean("UseProjects") && editor->objectName() == "prj_number") || (!_metrics->boolean("UseProjects") && editor->objectName() == "toitem_duedate")) #else if (editor->objectName() == "toitem_duedate") #endif { setCurrentIndex(model()->index(model()->rowCount() - 1, ITEM_NUMBER_COL)); } } void ToitemTableView::setModel(QAbstractItemModel* model) { QTableView::setModel(model); setColumnWidth(ITEM_NUMBER_COL, _itemColumn); setColumnWidth(TOITEM_QTY_ORDERED_COL, _qtyColumn); setColumnWidth(TOITEM_STDCOST_COL, _priceColumn); setColumnWidth(TOITEM_FREIGHT_COL, _priceColumn); setColumnWidth(TOITEM_DUEDATE_COL, _dateColumn); #ifdef QE_PROJECT setColumnWidth(PRJ_NUMBER_COL, 100); #endif QHeaderView *header = horizontalHeader(); int dest = 0; header->moveSection(header->visualIndex(ITEM_NUMBER_COL), dest++); header->moveSection(header->visualIndex(TOITEM_QTY_ORDERED_COL), dest++); header->moveSection(header->visualIndex(TOITEM_STDCOST_COL), dest++); header->moveSection(header->visualIndex(TOITEM_FREIGHT_COL), dest++); header->moveSection(header->visualIndex(TOITEM_DUEDATE_COL), dest++); #ifdef QE_PROJECT header->moveSection(header->visualIndex(PRJ_NUMBER_COL), dest++); #endif // if we didn't explicitly place the logical section, hide it for (int i = dest; i < header->count(); i++) header->hideSection(header->logicalIndex(i)); #ifdef QE_PROJECT if (! _metrics->boolean("UseProjects")) header->hideSection(header->visualIndex(PRJ_NUMBER_COL)); #endif //header->setStretchLastSection(true); } void ToitemTableView::currentChanged(const QModelIndex ¤t, const QModelIndex &previous ) { if (current != QModelIndex() && current != previous) { setCurrentIndex(current); scrollTo(current); edit(current); } } /////////////////////////////////////////////////////////////////////////// ToitemTableDelegate::ToitemTableDelegate(QObject *parent) : QItemDelegate(parent) { } QWidget *ToitemTableDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*style*/, const QModelIndex &index) const { const ToitemTableModel *model = (ToitemTableModel*)(index.model()); QWidget *editor = 0; switch (index.column()) { case ITEM_NUMBER_COL: { ItemLineEdit *item = new ItemLineEdit(parent); item->setType(ItemLineEdit::cActive); item->addExtraClause(QString("(item_id IN (" " SELECT itemsite_item_id" " FROM itemsite" " WHERE itemsite_warehous_id=%1))") .arg(model->srcWhsId())); editor = item; break; } case TOITEM_QTY_ORDERED_COL: { QLineEdit *qty = new QLineEdit(parent); qty->setValidator(omfgThis->qtyVal()); editor = qty; break; } case TOITEM_FREIGHT_COL: { QLineEdit *price = new QLineEdit(parent); price->setValidator(omfgThis->priceVal()); editor = price; break; } case TOITEM_DUEDATE_COL: { DLineEdit *duedate = new DLineEdit(parent); editor = duedate; editor->setObjectName("toitem_duedate"); break; } #ifdef QE_PROJECT case PRJ_NUMBER_COL: { ProjectLineEdit *prj = new ProjectLineEdit(parent); prj->setType(ProjectLineEdit::PurchaseOrder); editor = prj; editor->setObjectName("prj_number"); break; } #endif default: { editor = 0; break; } } if (editor) { #ifdef Q_WS_MAC // compensate for many custom widgets making themselves smaller on OS X QFont f = editor->font(); f.setPointSize(f.pointSize() + 2); editor->setFont(f); #endif editor->installEventFilter(const_cast(this)); } return editor; } void ToitemTableDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { const QAbstractItemModel *model = index.model(); QLineEdit *lineedit = 0; switch (index.column()) { case ITEM_NUMBER_COL: { ItemLineEdit *item = static_cast(editor); item->setId(model->data(model->index(index.row(), TOITEM_ITEM_ID_COL)).toInt()); break; } case TOITEM_QTY_ORDERED_COL: case TOITEM_FREIGHT_COL: lineedit = static_cast(editor); lineedit->setText(model->data(index).toString()); break; case TOITEM_DUEDATE_COL: { DLineEdit *duedate = static_cast(editor); duedate->setDate(index.data().toDate()); break; } #ifdef QE_PROJECT case PRJ_NUMBER_COL: { ProjectLineEdit *prj = static_cast(editor); prj->setId(model->data(model->index(index.row(), TOITEM_PRJ_ID_COL)).toInt()); break; } #endif default: break; } } void ToitemTableDelegate::setModelData(QWidget *editor, QAbstractItemModel *pModel, const QModelIndex &index) const { bool hitError = false; QVariant oldval = pModel->data(index); ToitemTableModel *model = static_cast(pModel); switch (index.column()) { case ITEM_NUMBER_COL: { ItemLineEdit *item = static_cast(editor); if (oldval.isNull() || item->itemNumber() != oldval.toString()) { if (! item->itemNumber().isEmpty() && item->isValid()) { XSqlQuery itemq; itemq.prepare("SELECT *, stdCost(item_id) AS stdcost, uom_name " "FROM item JOIN uom ON (item_inv_uom_id=uom_id) " "WHERE (item_id=:item_id);"); itemq.bindValue(":item_id", item->id()); itemq.exec(); if (itemq.first()) { if (itemq.value("stdcost").toDouble() == 0.0) { QMessageBox::critical(0, tr("No Standard Cost"), tr("

    The selected item has no Standard " "Costing information. Please see your " "controller to correct this situation " "before continuing.")); hitError = true; break; } model->setData(index, item->itemNumber()); model->setData(model->index(index.row(), TOITEM_ITEM_ID_COL), itemq.value("item_id").toInt()); model->setData(model->index(index.row(), TOITEM_UOM_COL), itemq.value("uom_name")); model->setData(model->index(index.row(), TOITEM_STDCOST_COL), formatPurchPrice(itemq.value("stdcost").toDouble())); } else if (itemq.lastError().type() != QSqlError::NoError) { systemError(0, itemq.lastError().databaseText(), __FILE__, __LINE__); hitError = true; break; } } if (hitError) { model->setData(index, QVariant(QVariant::String)); model->setData(model->index(index.row(), TOITEM_ITEM_ID_COL), QVariant(QVariant::Int)); model->setData(model->index(index.row(), TOITEM_STDCOST_COL), QVariant(QVariant::Double)); } } break; } case TOITEM_FREIGHT_COL: { QLineEdit *lineedit = static_cast(editor); if (lineedit->text().toDouble() != oldval.toDouble()) model->setData(index, formatPurchPrice(lineedit->text().toDouble())); break; } case TOITEM_QTY_ORDERED_COL: { QLineEdit *lineedit = static_cast(editor); if (lineedit->text().isEmpty()) model->setData(index, QVariant()); else model->setData(index, lineedit->text().toDouble()); break; } case TOITEM_DUEDATE_COL: { DLineEdit *duedate = static_cast(editor); if (duedate->date() != oldval.toDate()) { model->setData(index, duedate->date()); } break; } #ifdef QE_PROJECT case PRJ_NUMBER_COL: { ProjectLineEdit *prj = static_cast(editor); if (prj->id() != oldval.toInt()) { model->setData(model->index(index.row(), TOITEM_PRJ_ID_COL), prj->id()); model->setData(index, prj->text()); } break; } #endif default: break; } QTableView *view = qobject_cast(parent()); if (view) { if (hitError) view->setCurrentIndex(index); else if (index.row() >= (model->rowCount() - 1)) { QHeaderView* header = view->horizontalHeader(); if (header->visualIndex(index.column()) >= (header->count() - header->hiddenSectionCount() - 1)) { model->insertRow(model->rowCount()); } } } return; } void ToitemTableDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &) const { editor->setGeometry(option.rect); } qt-client-4.1.0/guiclient/toitemTableView.h000066400000000000000000000027621217451700100206610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TOITEMTABLEVIEW_H #define TOITEMTABLEVIEW_H #include #include #include #include class ToitemTableView : public QTableView { Q_OBJECT public: ToitemTableView(QWidget* = 0); virtual void setModel(QAbstractItemModel* model); protected slots: virtual void currentChanged(const QModelIndex &, const QModelIndex &) ; virtual void sHandleCloseEditor(QWidget *); private: QList _hideList; }; // TODO: move the ToitemTableDelegate implemention into the declaration class ToitemTableDelegate : public QItemDelegate { Q_OBJECT public: ToitemTableDelegate(QObject *parent = 0); virtual QWidget *createEditor(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const; virtual void setEditorData(QWidget *, const QModelIndex &) const; virtual void setModelData(QWidget *, QAbstractItemModel *, const QModelIndex &) const; virtual void updateEditorGeometry(QWidget *, const QStyleOptionViewItem &, const QModelIndex &) const; }; #endif // TOITEMTABLEVIEW_H qt-client-4.1.0/guiclient/transactionInformation.cpp000066400000000000000000000074171217451700100226450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "transactionInformation.h" #include #include #include transactionInformation::transactionInformation(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _item->setReadOnly(TRUE); _transactionQty->setPrecision(omfgThis->qtyVal()); _qohBefore->setPrecision(omfgThis->qtyVal()); _qohAfter->setPrecision(omfgThis->qtyVal()); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } } transactionInformation::~transactionInformation() { // no need to delete child widgets, Qt does it all for us } void transactionInformation::languageChange() { retranslateUi(this); } enum SetResponse transactionInformation::set(const ParameterList &pParams) { XSqlQuery transactionet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("invhist_id", &valid); if (valid) { _invhistid = param.toInt(); transactionet.prepare( "SELECT *, " " CASE WHEN (invhist_transtype IN ('EX', 'IM', 'SH', 'SI')) THEN (invhist_invqty * -1.0)" " ELSE invhist_invqty" " END AS adjinvqty " "FROM invhist " "WHERE (invhist_id=:invhist_id);" ); transactionet.bindValue(":invhist_id", _invhistid); transactionet.exec(); if (transactionet.first()) { _analyze->setChecked(transactionet.value("invhist_analyze").toBool()); _transactionType->setText(transactionet.value("invhist_transtype").toString()); _transactionDate->setDate(transactionet.value("invhist_transdate").toDate()); _createdDate->setDate(transactionet.value("invhist_created").toDate()); _username->setText(transactionet.value("invhist_user").toString()); _item->setItemsiteid(transactionet.value("invhist_itemsite_id").toInt()); _transactionQty->setText(formatQty(transactionet.value("adjinvqty").toDouble())); _qohBefore->setText(formatQty(transactionet.value("invhist_qoh_before").toDouble())); _qohAfter->setText(formatQty(transactionet.value("invhist_qoh_after").toDouble())); _notes->setText(transactionet.value("invhist_comments").toString()); } else if (transactionet.lastError().type() != QSqlError::NoError) { systemError(this, transactionet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "edit") _mode = cEdit; else if (param.toString() == "view") { _mode = cView; _analyze->setEnabled(FALSE); _save->hide(); _close->setText(tr("&Close")); } } return NoError; } void transactionInformation::sSave() { XSqlQuery transactionSave; transactionSave.prepare( "UPDATE invhist " "SET invhist_analyze=:invhist_analyze " "WHERE (invhist_id=:invhist_id);" ); transactionSave.bindValue(":invhist_analyze", QVariant(_analyze->isChecked())); transactionSave.bindValue(":invhist_id", _invhistid); transactionSave.exec(); if (transactionSave.lastError().type() != QSqlError::NoError) { systemError(this, transactionSave.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/transactionInformation.h000066400000000000000000000021251217451700100223010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSACTIONINFORMATION_H #define TRANSACTIONINFORMATION_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_transactionInformation.h" class transactionInformation : public XDialog, public Ui::transactionInformation { Q_OBJECT public: transactionInformation(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~transactionInformation(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); protected slots: virtual void languageChange(); private: int _mode; int _invhistid; }; #endif // TRANSACTIONINFORMATION_H qt-client-4.1.0/guiclient/transactionInformation.ui000066400000000000000000000343501217451700100224740ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. transactionInformation 0 0 724 421 Transaction Information Transaction Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transactionDate false Created Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _createdDateLit false 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 Qt::Vertical QSizePolicy::Expanding 0 20 5 &Close true true &Save Qt::Vertical QSizePolicy::Expanding 20 0 0 5 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Vertical QSizePolicy::Expanding 20 20 7 5 0 Transaction Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QOH Before: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QOH After: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Include in Inventory Analysis Qt::Vertical QSizePolicy::Expanding 294 20 Qt::Vertical QSizePolicy::Expanding 10 0 0 Notes: true DLineEdit QWidget

    datecluster.h
    1 ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XLabel QLabel
    xlabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _analyze _notes _save _close parameter.h _item newId(int) _warehouse findItemsites(int) 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _close clicked() transactionInformation reject() 20 20 20 20 qt-client-4.1.0/guiclient/transferOrder.cpp000066400000000000000000002124031217451700100207230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "transferOrder.h" #include #include #include #include #include #include #include #include #include #include "distributeInventory.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "issueLineToShipping.h" #include "transferOrderItem.h" #include "storedProcErrorLookup.h" #include "taxBreakdown.h" const char *_statusTypes[] = { "U", "O", "C" }; #define cClosed 0x01 #define cActiveOpen 0x02 #define cInactiveOpen 0x04 #define cCanceled 0x08 #define cUnreleased 0x16 transferOrder::transferOrder(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl), _cachedTabIndex(0), _captive(false), _ignoreSignals(false), _lineMode(0), _locked(false), _mode(cView), _orderNumberGen(0), _qeitem(0), _saved(false), _taxzoneidCache(-1), _toheadid(-1), _userEnteredOrderNumber(false), _whstaxzoneid(-1) { setupUi(this); _qeitem = new ToitemTableModel(this); _qeitemView->setModel(_qeitem); connect(_action, SIGNAL(clicked()), this, SLOT(sAction())); connect(_clear, SIGNAL(pressed()), this, SLOT(sClear())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_dstWhs, SIGNAL(newID(int)), this, SLOT(sHandleDstWhs(int))); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_freightCurrency, SIGNAL(newID(int)), this, SLOT(sCurrencyChanged())); connect(_issueLineBalance, SIGNAL(clicked()), this, SLOT(sIssueLineBalance())); connect(_issueStock, SIGNAL(clicked()), this, SLOT(sIssueStock())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_orderDate, SIGNAL(newDate(QDate)), _qeitem, SLOT(setTransDate(QDate))); connect(_orderNumber, SIGNAL(editingFinished()), this, SLOT(sHandleOrderNumber())); connect(_orderNumber, SIGNAL(textChanged(const QString&)), this, SLOT(sSetUserEnteredOrderNumber())); connect(_packDate, SIGNAL(newDate(QDate)), _qeitem, SLOT(setShipDate(QDate))); connect(_qecurrency, SIGNAL(newID(int)), this, SLOT(sCurrencyChanged())); connect(_qedelete, SIGNAL(clicked()), this, SLOT(sQEDelete())); connect(_qesave, SIGNAL(clicked()), this, SLOT(sQESave())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_saveAndAdd, SIGNAL(clicked()), this, SLOT(sSaveAndAdd())); connect(_shipDate, SIGNAL(newDate(QDate)), _qeitem, SLOT(setShipDate(QDate))); connect(_showCanceled,SIGNAL(toggled(bool)), this, SLOT(sFillItemList())); connect(_srcWhs, SIGNAL(newID(int)), this, SLOT(sHandleSrcWhs(int))); connect(_tabs, SIGNAL(currentChanged(int)), this, SLOT(sTabChanged(int))); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); connect(_taxzone, SIGNAL(newID(int)), this, SLOT(sCalculateTax())); connect(_toitem, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); connect(_toitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_trnsWhs, SIGNAL(newID(int)), this, SLOT(sHandleTrnsWhs(int))); connect(omfgThis, SIGNAL(transferOrdersUpdated(int)), this, SLOT(sHandleTransferOrderEvent(int))); _toitem->addColumn(tr("#"), _seqColumn, Qt::AlignCenter, true, "toitem_linenumber" ); _toitem->addColumn(tr("Item"), _itemColumn, Qt::AlignLeft, true, "item_number" ); _toitem->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); _toitem->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter, true, "toitem_status" ); _toitem->addColumn(tr("Sched. Date"), _dateColumn, Qt::AlignCenter, true, "toitem_schedshipdate" ); _toitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "toitem_qty_ordered" ); _toitem->addColumn(tr("At Shipping"), _qtyColumn, Qt::AlignRight, true, "atshipping" ); _toitem->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "toitem_qty_shipped" ); _toitem->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balance" ); _toitem->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "toitem_qty_received" ); _orderNumber->setValidator(omfgThis->orderVal()); if(!_metrics->boolean("UseProjects")) _project->hide(); _mode = cView; setToheadid(-1); _srcWhs->setId(_preferences->value("PreferredWarehouse").toInt()); _trnsWhs->setId(_metrics->value("DefaultTransitWarehouse").toInt()); _dstWhs->setId(_preferences->value("PreferredWarehouse").toInt()); getWhsInfo(_trnsWhs->id(), _trnsWhs); _weight->setValidator(omfgThis->qtyVal()); // TODO: remove when 5695 is fixed _freight->hide(); _freightLit->hide(); // end 5695 } void transferOrder::setToheadid(const int pId) { _toheadid = pId; _qeitem->setHeadId(pId); _comments->setId(_toheadid); if(_mode == cEdit && !_locked) { XSqlQuery to; to.prepare("SELECT tryLock(oid::integer, :tohead_id) AS locked " "FROM pg_class " "WHERE relname='tohead';"); to.bindValue(":tohead_id", _toheadid); to.exec(); if(to.first()) { if(to.value("locked").toBool() != true) { QMessageBox::critical( this, tr("Record Currently Being Edited"), tr("

    The record you are trying to edit is currently being edited " "by another user. Continue in View Mode.") ); setViewMode(); } else _locked=true; } else { QMessageBox::critical( this, tr("Cannot Lock Record for Editing"), tr("

    There was an unexpected error while trying to lock the record " "for editing. Please report this to your administator.") ); setViewMode(); } } } transferOrder::~transferOrder() { // no need to delete child widgets, Qt does it all for us } void transferOrder::languageChange() { retranslateUi(this); } enum SetResponse transferOrder::set(const ParameterList &pParams) { XSqlQuery transferet; XWidget::set(pParams); QVariant param; bool valid; int itemid; int srcwarehousid = -1; int destwarehousid = -1; double qty; QDate dueDate; setToheadid(-1); int _planordid = -1; param = pParams.value("planord_id", &valid); if (valid) _planordid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { setObjectName("transferOrder new"); _mode = cNew; if ( (_metrics->value("TONumberGeneration") == "A") || (_metrics->value("TONumberGeneration") == "O") ) { if (! insertPlaceholder()) return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; if(_metrics->boolean("AlwaysShowSaveAndAdd")) _saveAndAdd->setEnabled(true); else _saveAndAdd->hide(); } else if (param.toString() == "view") setViewMode(); else if (param.toString() == "releaseTO") { _mode = cNew; transferet.prepare( "SELECT planord.*," " srcsite.itemsite_item_id AS itemid," " srcsite.itemsite_warehous_id AS srcwarehousid," " destsite.itemsite_warehous_id AS destwarehousid " "FROM planord JOIN itemsite srcsite ON (srcsite.itemsite_id=planord_supply_itemsite_id) " " JOIN itemsite destsite ON (destsite.itemsite_id=planord_itemsite_id) " "WHERE (planord_id=:planord_id);" ); transferet.bindValue(":planord_id", _planordid); transferet.exec(); if (transferet.first()) { itemid = transferet.value("itemid").toInt(); qty = transferet.value("planord_qty").toDouble(); dueDate = transferet.value("planord_duedate").toDate(); srcwarehousid = transferet.value("srcwarehousid").toInt(); destwarehousid = transferet.value("destwarehousid").toInt(); } else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return UndefinedError; } connect(_toitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_toitem, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_toitem, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); transferet.prepare( "SELECT tohead_id " "FROM tohead " "WHERE ( (tohead_status='U')" " AND (tohead_src_warehous_id=:tohead_src_warehous_id) " " AND (tohead_dest_warehous_id=:tohead_dest_warehous_id) ) " "ORDER BY tohead_number " "LIMIT 1;" ); transferet.bindValue(":tohead_src_warehous_id", srcwarehousid); transferet.bindValue(":tohead_dest_warehous_id", destwarehousid); transferet.exec(); if (transferet.first()) { // Transfer order found if(QMessageBox::question( this, tr("Unreleased Transfer Order Exists"), tr("An Unreleased Transfer Order\n" "already exists for this\n" "Source/Destination Warehouse.\n" "Would you like to use this Transfer Order?\n" "Click Yes to use the existing Transfer Order\n" "otherwise a new one will be created."), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::Yes) { // Use an existing order _mode = cEdit; setToheadid(transferet.value("tohead_id").toInt()); _orderNumber->setEnabled(FALSE); _orderDate->setEnabled(FALSE); populate(); } else { // Do not use an existing order, create new _srcWhs->setId(srcwarehousid); _dstWhs->setId(destwarehousid); insertPlaceholder(); } } else { // Transfer order not found, create new _srcWhs->setId(srcwarehousid); _dstWhs->setId(destwarehousid); insertPlaceholder(); } // Start to create the new toitem ParameterList newItemParams; newItemParams.append("mode", "new"); newItemParams.append("tohead_id", _toheadid); newItemParams.append("srcwarehouse_id", _srcWhs->id()); newItemParams.append("orderNumber", _orderNumber->text()); newItemParams.append("orderDate", _orderDate->date()); newItemParams.append("taxzone_id", _taxzone->id()); newItemParams.append("curr_id", _freightCurrency->id()); newItemParams.append("item_id", itemid); newItemParams.append("captive", TRUE); if (qty > 0.0) newItemParams.append("qty", qty); if (!dueDate.isNull()) newItemParams.append("dueDate", dueDate); transferOrderItem toItem(this, "", TRUE); toItem.set(newItemParams); // TODO // if (toItem.exec() != XDialog::Rejected) if (toItem.exec() == XDialog::Rejected) { transferet.prepare("SELECT deletePlannedOrder(:planord_id, FALSE) AS _result;"); transferet.bindValue(":planord_id", _planordid); transferet.exec(); // TODO // omfgThis->sPlannedOrdersUpdated(); if(_mode == cEdit) { // check for another open window QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if(QString::compare(w->metaObject()->className(), "transferOrder") && w != this) { transferOrder *other = (transferOrder*)w; if(_toheadid == other->_toheadid) { other->sFillItemList(); return UndefinedError; } } } } sFillItemList(); } else _planordid = -1; } } param = pParams.value("src_warehous_id", &valid); if (valid) _srcWhs->setId(param.toInt()); param = pParams.value("dst_warehous_id", &valid); if (valid) _dstWhs->setId(param.toInt()); if (cNew == _mode) { _status->setCurrentIndex(0); // TODO: Why don't the constructor or setId earlier in set() handle this? getWhsInfo(_srcWhs->id(), _srcWhs); getWhsInfo(_dstWhs->id(), _dstWhs); _captive = FALSE; _edit->setEnabled(FALSE); _action->setEnabled(FALSE); _delete->setEnabled(FALSE); _close->setText("&Cancel"); } else if (cEdit == _mode) { _captive = TRUE; _orderNumber->setEnabled(FALSE); } else if (cView == _mode) { _project->setReadOnly(true); } if( !_metrics->boolean("EnableTOShipping")) { _requireInventory->hide(); _issueStock->hide(); _issueLineBalance->hide(); _toitem->hideColumn(7); _toitem->hideColumn(8); } else _toitem->setSelectionMode(QAbstractItemView::ExtendedSelection); param = pParams.value("tohead_id", &valid); if (valid) { setToheadid(param.toInt()); if(cEdit == _mode) setObjectName(QString("transferOrder edit %1").arg(_toheadid)); else if(cView == _mode) setObjectName(QString("transferOrder view %1").arg(_toheadid)); populate(); } if ( pParams.inList("enableSaveAndAdd") && ((_mode == cNew) || (_mode == cEdit)) ) { _saveAndAdd->show(); _saveAndAdd->setEnabled(true); } if (cNew == _mode || cEdit == _mode) { _orderDate->setEnabled(_privileges->check("OverrideTODate")); _packDate->setEnabled(_privileges->check("AlterPackDate")); } else { _orderDate->setEnabled(FALSE); _packDate->setEnabled(FALSE); } param = pParams.value("captive", &valid); if (valid) _captive = true; return NoError; } bool transferOrder::insertPlaceholder() { XSqlQuery transferinsertPlaceholder; if(_trnsWhs->id() == -1) { QMessageBox::critical(this, tr("No Transit Site"), tr("There are no transit sites defined in the system." " You must define at least one transit site to use Transfer Orders.") ); return false; } _ignoreSignals = TRUE; populateOrderNumber(); _ignoreSignals = FALSE; transferinsertPlaceholder.prepare("INSERT INTO tohead (" " tohead_number, tohead_src_warehous_id," " tohead_trns_warehous_id, tohead_dest_warehous_id," " tohead_status, tohead_shipform_id" ") VALUES (" " :tohead_number, :tohead_src_warehous_id," " :tohead_trns_warehous_id, :tohead_dest_warehous_id," " :tohead_status, :tohead_shipform_id)" " RETURNING tohead_id;"); if (_orderNumber->text().isEmpty()) transferinsertPlaceholder.bindValue(":tohead_number", QString::number(_toheadid * -1)); else transferinsertPlaceholder.bindValue(":tohead_number", _orderNumber->text()); transferinsertPlaceholder.bindValue(":tohead_src_warehous_id", _srcWhs->id()); transferinsertPlaceholder.bindValue(":tohead_trns_warehous_id", _trnsWhs->id()); transferinsertPlaceholder.bindValue(":tohead_dest_warehous_id", _dstWhs->id()); transferinsertPlaceholder.bindValue(":tohead_status", "U"); if (_shippingForm->isValid()) transferinsertPlaceholder.bindValue(":tohead_shipform_id", _shippingForm->id()); transferinsertPlaceholder.exec(); if (transferinsertPlaceholder.first()) { setToheadid(transferinsertPlaceholder.value("tohead_id").toInt()); _orderDate->setDate(omfgThis->dbDate(), true); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Creating Header"), transferinsertPlaceholder, __FILE__, __LINE__)) { return false; } return true; } void transferOrder::sSaveAndAdd() { XSqlQuery transferSaveAndAdd; if (save(false)) { transferSaveAndAdd.prepare("SELECT addToPackingListBatch('TO', :tohead_id) AS result;"); transferSaveAndAdd.bindValue(":tohead_id", _toheadid); transferSaveAndAdd.exec(); if (transferSaveAndAdd.first()) ; // nothing to do else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Adding to Packing List Batch"), transferSaveAndAdd, __FILE__, __LINE__)) return; sReleaseTohead(); if (_captive) close(); else clear(); } } void transferOrder::sSave() { if (save(false)) { sReleaseTohead(); if (_captive) close(); else clear(); } } bool transferOrder::save(bool partial) { XSqlQuery transferave; QList errors; errors << GuiErrorCheck(_srcWhs->id() == -1, _srcWhs, tr("You must select a Source Site for this " "Transfer Order before you may save it.")) << GuiErrorCheck(_trnsWhs->id() == -1, // but see fr 5581 _dstWhs, tr("You must select a Transit Site for " "this Transfer Order before you may save it.")) << GuiErrorCheck(_dstWhs->id() == -1, _dstWhs, tr("You must select a Destination Site for " "this Transfer Order before you may save it.")) << GuiErrorCheck(_srcWhs->id() == _dstWhs->id(), _dstWhs, tr("The Source and Destination Sites " "must be different.")) << GuiErrorCheck((!partial && _toitem->topLevelItemCount() == 0), _new, tr("You must create at least one Line Item for " "this Transfer Order before you may save it.")) << GuiErrorCheck(_orderNumber->text().toInt() == 0, _orderNumber, tr("You must enter a valid T/O # for this Transfer" "Order before you may save it.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Transfer Order"), errors)) return false; if (_qeitem->isDirty() && ! sQESave()) return false; // place holder for automatic project creation // if(! partial && _metrics->boolean("AutoCreateProjectsForOrders") && // (_project->id() == -1) && (cNew == _mode)) // save contact and address info in case someone wants to use 'em again later // but don't make any global changes to the data and ignore errors // TODO: put in real checking - perhaps the address of the warehouse is wrong _ignoreSignals = TRUE; _srcAddr->save(AddressCluster::CHANGEONE); _dstAddr->save(AddressCluster::CHANGEONE); _ignoreSignals = FALSE; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); transferave.exec("BEGIN;"); transferave.prepare("UPDATE tohead " "SET tohead_number=:number," " tohead_status=:status," " tohead_orderdate=:orderdate," " tohead_src_warehous_id=:src_warehous_id," " tohead_srcname=:srcname," " tohead_srcaddress1=:srcaddress1," " tohead_srcaddress2=:srcaddress2," " tohead_srcaddress3=:srcaddress3," " tohead_srccity=:srccity," " tohead_srcstate=:srcstate," " tohead_srcpostalcode=:srcpostalcode," " tohead_srccountry=:srccountry," " tohead_srccntct_id=:srccntct_id," " tohead_srccntct_name=:srccntct_name," " tohead_srcphone=:srcphone," " tohead_trns_warehous_id=:trns_warehous_id," " tohead_trnsname=:trnsname," " tohead_dest_warehous_id=:dest_warehous_id," " tohead_destname=:destname," " tohead_destaddress1=:destaddress1," " tohead_destaddress2=:destaddress2," " tohead_destaddress3=:destaddress3," " tohead_destcity=:destcity," " tohead_deststate=:deststate," " tohead_destpostalcode=:destpostalcode," " tohead_destcountry=:destcountry," " tohead_destcntct_id=:destcntct_id," " tohead_destcntct_name=:destcntct_name," " tohead_destphone=:destphone," " tohead_agent_username=:agent_username," " tohead_shipvia=:shipvia," " tohead_shipform_id=:shipform_id," " tohead_taxzone_id=:taxzone_id," " tohead_freight=:freight," " tohead_freight_curr_id=:freight_curr_id," " tohead_shipcomplete=:shipcomplete," " tohead_ordercomments=:ordercomments," " tohead_shipcomments=:shipcomments," " tohead_packdate=:packdate," " tohead_prj_id=:prj_id," " tohead_lastupdated=CURRENT_TIMESTAMP " "WHERE (tohead_id=:id);" ); transferave.bindValue(":id", _toheadid ); transferave.bindValue(":number", _orderNumber->text().toInt()); transferave.bindValue(":status", _statusTypes[_status->currentIndex()]); transferave.bindValue(":orderdate", _orderDate->date()); transferave.bindValue(":src_warehous_id", _srcWhs->id()); transferave.bindValue(":srcname", _srcWhs->currentText()); transferave.bindValue(":srcaddress1", _srcAddr->line1()); transferave.bindValue(":srcaddress2", _srcAddr->line2()); transferave.bindValue(":srcaddress3", _srcAddr->line3()); transferave.bindValue(":srccity", _srcAddr->city()); transferave.bindValue(":srcstate", _srcAddr->state()); transferave.bindValue(":srcpostalcode", _srcAddr->postalCode()); transferave.bindValue(":srccountry", _srcAddr->country()); if (_srcContact->id() > 0) transferave.bindValue(":srccntct_id", _srcContact->id()); transferave.bindValue(":srccntct_name", _srcContact->name()); transferave.bindValue(":srcphone", _srcContact->phone()); transferave.bindValue(":trns_warehous_id", _trnsWhs->id()); transferave.bindValue(":trnsname", _trnsWhs->currentText()); transferave.bindValue(":dest_warehous_id", _dstWhs->id()); transferave.bindValue(":destname", _dstWhs->currentText()); transferave.bindValue(":destaddress1", _dstAddr->line1()); transferave.bindValue(":destaddress2", _dstAddr->line2()); transferave.bindValue(":destaddress3", _dstAddr->line3()); transferave.bindValue(":destcity", _dstAddr->city()); transferave.bindValue(":deststate", _dstAddr->state()); transferave.bindValue(":destpostalcode", _dstAddr->postalCode()); transferave.bindValue(":destcountry", _dstAddr->country()); if (_dstContact->id() > 0) transferave.bindValue(":destcntct_id", _dstContact->id()); transferave.bindValue(":destcntct_name", _dstContact->name()); transferave.bindValue(":destphone", _dstContact->phone()); transferave.bindValue(":agent_username", _agent->currentText()); transferave.bindValue(":shipvia", _shipVia->currentText()); if (_taxzone->isValid()) transferave.bindValue(":taxzone_id", _taxzone->id()); transferave.bindValue(":freight", _freight->localValue()); transferave.bindValue(":freight_curr_id", _freight->id()); transferave.bindValue(":shipcomplete", QVariant(_shipComplete->isChecked())); transferave.bindValue(":ordercomments", _orderComments->toPlainText()); transferave.bindValue(":shipcomments", _shippingComments->toPlainText()); if (_packDate->isValid()) transferave.bindValue(":packdate", _packDate->date()); else transferave.bindValue(":packdate", _orderDate->date()); if (_project->isValid()) transferave.bindValue(":prj_id", _project->id()); if (_shippingForm->isValid()) transferave.bindValue(":shipform_id", _shippingForm->id()); transferave.exec(); if (transferave.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Transfer Order"), transferave, __FILE__, __LINE__); return false; } // if this is a new to record and we haven't saved already // then we need to lock this record. if((cNew == _mode) && (!_saved)) { // should I bother to check because no one should have this but us? transferave.prepare("SELECT tryLock(oid::integer, :head_id) AS locked " "FROM pg_class " "WHERE relname='tohead';"); transferave.bindValue(":head_id", _toheadid); transferave.exec(); if (transferave.first()) _locked = transferave.value("locked").toBool(); else if (transferave.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Transfer Order"), transferave, __FILE__, __LINE__); return false; } } // keep the status of toitems in synch with tohead if (_statusTypes[_status->currentIndex()] == QString("U")) { transferave.prepare("SELECT unreleaseTransferOrder(:head_id) AS result;"); transferave.bindValue(":head_id", _toheadid); transferave.exec(); if (transferave.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Transfer Order"), transferave, __FILE__, __LINE__); return false; } } else if (_statusTypes[_status->currentIndex()] == QString("O")) { transferave.prepare("SELECT releaseTransferOrder(:head_id) AS result;"); transferave.bindValue(":head_id", _toheadid); transferave.exec(); if (transferave.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Transfer Order"), transferave, __FILE__, __LINE__); return false; } } else if (_statusTypes[_status->currentIndex()] == QString("C")) { transferave.prepare("SELECT closeTransferOrder(:head_id) AS result;"); transferave.bindValue(":head_id", _toheadid); transferave.exec(); if (transferave.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Transfer Order"), transferave, __FILE__, __LINE__); return false; } } transferave.exec("COMMIT;"); _saved = true; omfgThis->sTransferOrdersUpdated(_toheadid); emit saved(_toheadid); return TRUE; } void transferOrder::sPopulateMenu(QMenu *pMenu) { if ((_mode == cNew) || (_mode == cEdit)) { int _numSelected = _toitem->selectedItems().size(); if(_numSelected == 1) { if (_lineMode == cClosed) pMenu->addAction(tr("Open Line..."), this, SLOT(sAction())); else if (_lineMode == cActiveOpen) { pMenu->addAction(tr("Edit Line..."), this, SLOT(sEdit())); pMenu->addAction(tr("Close Line..."), this, SLOT(sAction())); } else if (_lineMode == cInactiveOpen) { pMenu->addAction(tr("Edit Line..."), this, SLOT(sEdit())); pMenu->addAction(tr("Close Line..."), this, SLOT(sAction())); pMenu->addAction(tr("Delete Line..."), this, SLOT(sDelete())); } else if (_lineMode == cUnreleased) { pMenu->addAction(tr("Edit Line..."), this, SLOT(sEdit())); pMenu->addAction(tr("Delete Line..."), this, SLOT(sDelete())); } } if(_metrics->boolean("EnableTOShipping")) { if(_numSelected == 1) pMenu->addSeparator(); pMenu->addAction(tr("Return Stock"), this, SLOT(sReturnStock())); pMenu->addAction(tr("Issue Stock..."), this, SLOT(sIssueStock())); pMenu->addAction(tr("Issue Line Balance"), this, SLOT(sIssueLineBalance())); } } } void transferOrder::populateOrderNumber() { XSqlQuery transferpopulateOrderNumber; if (_mode == cNew) { if ( (_metrics->value("TONumberGeneration") == "A") || (_metrics->value("TONumberGeneration") == "O") ) { transferpopulateOrderNumber.exec("SELECT fetchToNumber() AS tonumber;"); if (transferpopulateOrderNumber.first()) { _orderNumber->setText(transferpopulateOrderNumber.value("tonumber")); _orderNumberGen = transferpopulateOrderNumber.value("tonumber").toInt(); if (_metrics->value("TONumberGeneration") == "A") _orderNumber->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Number"), transferpopulateOrderNumber, __FILE__, __LINE__)) return; } _new->setEnabled(! _orderNumber->text().isEmpty()); } _userEnteredOrderNumber = FALSE; } void transferOrder::sSetUserEnteredOrderNumber() { _userEnteredOrderNumber = TRUE; } void transferOrder::sHandleOrderNumber() { if (_ignoreSignals || !isActiveWindow()) return; if (_orderNumber->text().length() == 0) { if (_mode == cNew) { if ( (_metrics->value("TONumberGeneration") == "A") || (_metrics->value("TONumberGeneration") == "O") ) populateOrderNumber(); else { if(!_close->hasFocus()) { QMessageBox::warning( this, tr("Enter T/O #"), tr("

    You must enter a T/O # for this Transfer " "Order before you may continue." ) ); _orderNumber->setFocus(); } return; } } } else { XSqlQuery query; if ( (_mode == cNew) && (_userEnteredOrderNumber) ) { query.prepare( "SELECT tohead_id " "FROM tohead " "WHERE (tohead_number=:tohead_number);" ); query.bindValue(":tohead_number", _orderNumber->text()); query.exec(); if (query.first()) { _mode = cEdit; setToheadid(query.value("tohead_id").toInt()); populate(); _orderNumber->setEnabled(FALSE); } else { if ((_metrics->value("TONumberGeneration") != "A") && (_metrics->value("TONumberGeneration") != "O") && ! insertPlaceholder()) { _orderNumber->clear(); return; } QString orderNumber = _orderNumber->text(); query.prepare( "SELECT releaseToNumber(:orderNumber) AS result;" ); query.bindValue(":orderNumber", _orderNumberGen); query.exec(); if (query.first()) ; // nothing to do else if (ErrorReporter::error(QtCriticalMsg, this, tr("Releasing Error"), query, __FILE__, __LINE__)) return; _orderNumber->setText(orderNumber); _userEnteredOrderNumber = FALSE; _orderNumber->setEnabled(FALSE); } } } if (cView != _mode) _new->setEnabled(! _orderNumber->text().isEmpty()); sHandleTrnsWhs(_trnsWhs->id()); sHandleSrcWhs(_srcWhs->id()); } void transferOrder::sNew() { if( !_saved && ((_mode == cNew) ) ) if(!save(true)) return; ParameterList params; params.append("tohead_id", _toheadid); params.append("srcwarehouse_id", _srcWhs->id()); params.append("orderNumber", _orderNumber->text()); params.append("orderDate", _orderDate->date()); params.append("taxzone_id", _taxzone->id()); params.append("curr_id", _freightCurrency->id()); if ((_mode == cNew) || (_mode == cEdit)) params.append("mode", "new"); transferOrderItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted) sFillItemList(); } void transferOrder::sEdit() { ParameterList params; params.append("toitem_id", _toitem->id()); if (_mode == cView) params.append("mode", "view"); else if ((_mode == cNew) || (_mode == cEdit)) params.append("mode", "edit"); transferOrderItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() == XDialog::Accepted && ((_mode == cNew) || (_mode == cEdit)) ) { sFillItemList(); sCalculateTax(); } } void transferOrder::sHandleButtons() { XTreeWidgetItem *selected = 0; QList selectedlist = _toitem->selectedItems(); int _numSelected = selectedlist.size(); if (_numSelected > 0) selected = (XTreeWidgetItem*)(selectedlist[0]); if (selected) { _issueStock->setEnabled(_privileges->check("IssueStockToShipping")); _issueLineBalance->setEnabled(_privileges->check("IssueStockToShipping")); if(_numSelected == 1) { _edit->setEnabled(TRUE); int lineMode = selected->altId(); if (lineMode == 1) { _lineMode = cClosed; _action->setText(tr("Open")); _action->setEnabled(TRUE); _delete->setEnabled(FALSE); } else if (lineMode == 2) { _lineMode = cActiveOpen; _action->setText(tr("Close")); _action->setEnabled(TRUE); _delete->setEnabled(FALSE); } else if (lineMode == 3) { _lineMode = cInactiveOpen; _action->setText(tr("Close")); _action->setEnabled(TRUE); _delete->setEnabled(TRUE); } else if (lineMode == 4) { _lineMode = cCanceled; _action->setEnabled(FALSE); _delete->setEnabled(FALSE); } else if (lineMode == 5) { _lineMode = cUnreleased; _action->setText(tr("Close")); _action->setEnabled(FALSE); _delete->setEnabled(TRUE); } else { _action->setEnabled(FALSE); _delete->setEnabled(FALSE); } if(1 == lineMode || 4 == lineMode || 5 == lineMode) { _issueStock->setEnabled(FALSE); _issueLineBalance->setEnabled(FALSE); } } else { _edit->setEnabled(FALSE); _action->setEnabled(FALSE); _delete->setEnabled(FALSE); } } else { _edit->setEnabled(FALSE); _action->setEnabled(FALSE); _delete->setEnabled(FALSE); _issueStock->setEnabled(FALSE); _issueLineBalance->setEnabled(FALSE); } } void transferOrder::sAction() { XSqlQuery transferAction; if (_lineMode == cCanceled) return; if ( (_mode == cNew) || (_mode == cEdit) ) { if (_lineMode == cClosed) { transferAction.prepare( "UPDATE toitem " "SET toitem_status=:toitem_status " "WHERE (toitem_id=:toitem_id);" ); transferAction.bindValue(":toitem_status", _statusTypes[_status->currentIndex()]); transferAction.bindValue(":toitem_id", _toitem->id()); transferAction.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Opening Line"), transferAction, __FILE__, __LINE__)) return; } else { transferAction.prepare( "SELECT closeToItem(:toitem_id) AS result;" ); transferAction.bindValue(":toitem_id", _toitem->id()); transferAction.exec(); if (transferAction.first()) { int result = transferAction.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("closeToItem", result), __FILE__, __LINE__); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Closing Line"), transferAction, __FILE__, __LINE__)) return; } sFillItemList(); transferAction.prepare("SELECT tohead_status FROM tohead WHERE (tohead_id=:tohead_id);"); transferAction.bindValue(":tohead_id", _toheadid); transferAction.exec(); if (transferAction.first()) { if (transferAction.value("tohead_status").toString() == "U") _status->setCurrentIndex(0); else if (transferAction.value("tohead_status").toString() == "O") _status->setCurrentIndex(1); else if (transferAction.value("tohead_status").toString() == "C") _status->setCurrentIndex(2); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Status"), transferAction, __FILE__, __LINE__)) return; } } void transferOrder::sDelete() { XSqlQuery transferDelete; if ( (_mode == cEdit) || (_mode == cNew) ) { if (QMessageBox::question(this, tr("Delete Selected Line Item?"), tr("

    Are you sure that you want to delete the " "selected Line Item?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { transferDelete.prepare( "DELETE FROM toitem " "WHERE (toitem_id=:toitem_id);" ); transferDelete.bindValue(":toitem_id", _toitem->id()); transferDelete.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting Line"), transferDelete, __FILE__, __LINE__)) return; sFillItemList(); if (_toitem->topLevelItemCount() == 0) { if (QMessageBox::question(this, tr("Cancel Transfer Order?"), tr("

    You have deleted all of the Line " "Items for this Transfer Order. Would you " "like to cancel this Transfer Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { transferDelete.prepare( "SELECT deleteTO(:tohead_id) AS result;"); transferDelete.bindValue(":tohead_id", _toheadid); transferDelete.exec(); if (transferDelete.first()) { int result = transferDelete.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("deleteTO", result), __FILE__, __LINE__); sReleaseNumber(); } ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting Order"), transferDelete, __FILE__, __LINE__); clear(); omfgThis->sTransferOrdersUpdated(_toheadid); } } } } } void transferOrder::populate() { if ( (_mode == cEdit) || (_mode == cView) ) { XSqlQuery to; to.prepare( "SELECT * " "FROM tohead " "WHERE (tohead_id=:tohead_id);" ); to.bindValue(":tohead_id", _toheadid); to.exec(); if (to.first()) { _orderNumber->setText(to.value("tohead_number")); _orderNumber->setEnabled(FALSE); _orderDate->setDate(to.value("tohead_orderdate").toDate(), true); if (to.value("tohead_status").toString() == "U") _status->setCurrentIndex(0); else if (to.value("tohead_status").toString() == "O") _status->setCurrentIndex(1); else if (to.value("tohead_status").toString() == "C") { _status->setCurrentIndex(2); _status->setEnabled(false); } _srcWhs->setId(to.value("tohead_src_warehous_id").toInt()); if (! _srcWhs->isValid()) _srcWhs->setCode(to.value("tohead_srcname").toString()); if (_srcAddr->line1() !=to.value("tohead_srcaddress1").toString() || _srcAddr->line2() !=to.value("tohead_srcaddress2").toString() || _srcAddr->line3() !=to.value("tohead_srcaddress3").toString() || _srcAddr->city() !=to.value("tohead_srccity").toString() || _srcAddr->state() !=to.value("tohead_srcstate").toString() || _srcAddr->postalCode()!=to.value("tohead_srcpostalcode").toString() || _srcAddr->country()!=to.value("tohead_srccountry").toString() ) { _srcAddr->setId(-1); _srcAddr->setLine1(to.value("tohead_srcaddress1").toString()); _srcAddr->setLine2(to.value("tohead_srcaddress2").toString()); _srcAddr->setLine3(to.value("tohead_srcaddress3").toString()); _srcAddr->setCity(to.value("tohead_srccity").toString()); _srcAddr->setState(to.value("tohead_srcstate").toString()); _srcAddr->setPostalCode(to.value("tohead_srcpostalcode").toString()); _srcAddr->setCountry(to.value("tohead_srccountry").toString()); } _srcContact->setId(to.value("tohead_srccntct_id").toInt()); if (_srcContact->name() != to.value("tohead_srccntct_name").toString() || _srcContact->phone() != to.value("tohead_srcphone").toString()) { _srcContact->setId(-1); _srcContact->setObjectName(to.value("tohead_srccntct_name").toString()); _srcContact->setPhone(to.value("tohead_srcphone").toString()); } _trnsWhs->setId(to.value("tohead_trns_warehous_id").toInt()); if (! _trnsWhs->isValid()) _trnsWhs->setCode(to.value("tohead_trnsname").toString()); _dstWhs->setId(to.value("tohead_dest_warehous_id").toInt()); if (! _dstWhs->isValid()) _dstWhs->setCode(to.value("tohead_destname").toString()); if (_dstAddr->line1() !=to.value("tohead_destaddress1").toString() || _dstAddr->line2() !=to.value("tohead_destaddress2").toString() || _dstAddr->line3() !=to.value("tohead_destaddress3").toString() || _dstAddr->city() !=to.value("tohead_destcity").toString() || _dstAddr->state() !=to.value("tohead_deststate").toString() || _dstAddr->postalCode()!=to.value("tohead_destpostalcode").toString() || _dstAddr->country()!=to.value("tohead_destcountry").toString() ) { _dstAddr->setId(-1); _dstAddr->setLine1(to.value("tohead_destaddress1").toString()); _dstAddr->setLine2(to.value("tohead_destaddress2").toString()); _dstAddr->setLine3(to.value("tohead_destaddress3").toString()); _dstAddr->setCity(to.value("tohead_destcity").toString()); _dstAddr->setState(to.value("tohead_deststate").toString()); _dstAddr->setPostalCode(to.value("tohead_destpostalcode").toString()); _dstAddr->setCountry(to.value("tohead_destcountry").toString()); } _dstContact->setId(to.value("tohead_destcntct_id").toInt()); if (_dstContact->name() != to.value("tohead_destcntct_name").toString() || _dstContact->phone() != to.value("tohead_destphone").toString()) { _dstContact->setId(-1); _dstContact->setObjectName(to.value("tohead_destcntct_name").toString()); _dstContact->setPhone(to.value("tohead_destphone").toString()); } _agent->setText(to.value("tohead_agent_username").toString()); _shipVia->setText(to.value("tohead_shipvia").toString()); _shippingForm->setId(to.value("tohead_shipform_id").toInt()); _taxzoneidCache = to.value("tohead_taxzone_id").toInt(); _taxzone->setId(to.value("tohead_taxzone_id").toInt()); _freight->setId(to.value("tohead_freight_curr_id").toInt()); _freight->setLocalValue(to.value("tohead_freight").toDouble()); _shipComplete->setChecked(to.value("tohead_shipcomplete").toBool()); _orderComments->setText(to.value("tohead_ordercomments").toString()); _shippingComments->setText(to.value("tohead_shipcomments").toString()); _packDate->setDate(to.value("tohead_packdate").toDate()); _project->setId(to.value("tohead_prj_id").toInt()); _comments->setId(_toheadid); sFillItemList(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Order"), to, __FILE__, __LINE__)) return; } } void transferOrder::sFillItemList() { XSqlQuery transferFillItemList; transferFillItemList.prepare( "SELECT MIN(toitem_schedshipdate) AS shipdate " "FROM toitem " "WHERE ((toitem_status <> 'X')" " AND (toitem_tohead_id=:head_id));" ); transferFillItemList.bindValue(":head_id", _toheadid); transferFillItemList.exec(); if (transferFillItemList.first()) { _shipDate->setDate(transferFillItemList.value("shipdate").toDate()); if (cNew == _mode) _packDate->setDate(transferFillItemList.value("shipdate").toDate()); } else { _shipDate->clear(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Number"), transferFillItemList, __FILE__, __LINE__)) return; } _toitem->clear(); if (_mode == cEdit || _mode == cNew) { _srcWhs->setEnabled(true); _trnsWhs->setEnabled(true); _dstWhs->setEnabled(true); } QString sql("SELECT toitem_id, closestatus," " toitem_status," " toitem_linenumber, item_number, description," " toitem_schedshipdate," " toitem_qty_ordered, toitem_qty_shipped, toitem_qty_received," " balance, atshipping, tagged, in_future, enabletoshipping, backorder," " CASE WHEN (backorder AND toitem_status NOT IN ('C', 'X')) THEN 'red' " " WHEN (enabletoshipping AND tagged AND in_future) THEN 'darkgreen' " " WHEN (enabletoshipping AND tagged) THEN 'red' " " END AS qtforegroundrole," " 'qty' AS toitem_qty_ordered_xtnumericrole," " 'qty' AS toitem_qty_shipped_xtnumericrole," " 'qty' AS toitem_qty_received_xtnumericrole," " 'qty' AS atshipping_xtnumericrole," " 'qty' AS balance_xtnumericrole " " FROM ( " "SELECT toitem_id," " toitem_status," " CASE WHEN (toitem_status='C') THEN 1" " WHEN (toitem_status='X') THEN 4" " WHEN (toitem_status='U') THEN 5" " WHEN ((toitem_status='O')" " AND ((qtyAtShipping('TO', toitem_id) > 0) OR" " (toitem_qty_shipped > 0) ) ) THEN 2" " ELSE 3" " END AS closestatus," " toitem_linenumber, item_number," " (item_descrip1 || ' ' || item_descrip2) AS description," " toitem_schedshipdate," " toitem_qty_ordered, toitem_qty_shipped, toitem_qty_received, " " noNeg(toitem_qty_ordered - toitem_qty_shipped) AS balance," " qtyAtShipping('TO', toitem_id) AS atshipping," " (noNeg(toitem_qty_ordered - toitem_qty_shipped) <> qtyAtShipping('TO', toitem_id)) AS tagged," " CASE WHEN toitem_schedshipdate > CURRENT_DATE THEN true" " ELSE false" " END AS in_future," " fetchMetricBool('EnableTOShipping') AS enabletoshipping," " ((SELECT COALESCE(toitem_id, -1) FROM toitem WHERE ((toitem_status='C') AND (toitem_tohead_id=tohead_id)) LIMIT 1) <> -1) AS backorder " "FROM item, toitem, tohead " "WHERE ((toitem_item_id=item_id)" " AND (tohead_id=toitem_tohead_id)" "" "" " AND (toitem_status != 'X')" "" " AND (toitem_tohead_id=) ) ) AS data " "ORDER BY toitem_linenumber;" ); ParameterList params; params.append("tohead_id", _toheadid); if (_showCanceled->isChecked()) params.append("showCanceled"); MetaSQLQuery mql(sql); transferFillItemList = mql.toQuery(params); _toitem->populate(transferFillItemList, true); if (transferFillItemList.first()) { do { if (transferFillItemList.value("toitem_qty_received").toDouble() > 0) { _dstWhs->setEnabled(false); _trnsWhs->setEnabled(false); _srcWhs->setEnabled(false); } else if (transferFillItemList.value("toitem_qty_shipped").toDouble() > 0) { _trnsWhs->setEnabled(false); _srcWhs->setEnabled(false); } else if (transferFillItemList.value("atshipping").toDouble() > 0) { _srcWhs->setEnabled(false); } } while (transferFillItemList.next()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Lines"), transferFillItemList, __FILE__, __LINE__)) return; transferFillItemList.prepare("SELECT formatQty(SUM(COALESCE(toitem_qty_ordered, 0.00) *" " (COALESCE(item_prodweight, 0.00) +" " COALESCE(item_packweight, 0.00)))) AS grossweight," " SUM(toitem_freight) AS linefreight " "FROM toitem, item " "WHERE ((toitem_item_id=item_id)" " AND (toitem_status<>'X')" " AND (toitem_tohead_id=:head_id));"); transferFillItemList.bindValue(":head_id", _toheadid); transferFillItemList.exec(); if (transferFillItemList.first()) { _weight->setText(transferFillItemList.value("grossweight").toDouble()); _itemFreight->setLocalValue(transferFillItemList.value("linefreight").toDouble()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Summary"), transferFillItemList, __FILE__, __LINE__)) return; sCalculateTax(); // triggers sCalculateTotal(); _srcWhs->setEnabled(_toitem->topLevelItemCount() == 0); _freightCurrency->setEnabled(_toitem->topLevelItemCount() == 0); _qecurrency->setEnabled(_toitem->topLevelItemCount() == 0); _qeitem->select(); } void transferOrder::sCalculateTotal() { _total->setLocalValue(_tax->localValue() + _freight->localValue() + _itemFreight->localValue()); } bool transferOrder::deleteForCancel() { XSqlQuery query; bool deleteTo = false; if (cNew == _mode && _toitem->topLevelItemCount()== 0) { deleteTo = true; } if (cNew == _mode && _toitem->topLevelItemCount() > 0) { if (QMessageBox::question(this, tr("Delete Transfer Order?"), tr("

    Are you sure you want to delete this " "Transfer Order and its associated Line Items?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return false; else deleteTo = true; } if (cNew != _mode && _toitem->topLevelItemCount() == 0) { if (QMessageBox::question(this, tr("Delete Transfer Order?"), tr("

    This Transfer Order does not have any line items. " "Are you sure you want to delete this Transfer Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return false; else deleteTo = true; } if (deleteTo) { query.prepare("SELECT deleteTO(:tohead_id) AS result;"); query.bindValue(":tohead_id", _toheadid); query.exec(); if (query.first()) { int result = query.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("deleteTO", result), __FILE__, __LINE__); sReleaseNumber(); } ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting Order"), query, __FILE__, __LINE__); } if(cNew == _mode) sReleaseTohead(); return true; } void transferOrder::sClear() { if (! deleteForCancel()) return; clear(); } void transferOrder::clear() { if (cView != _mode) sReleaseTohead(); _toheadid = -1; _tabs->setCurrentIndex(0); _orderNumber->setEnabled(TRUE); _orderNumberGen = 0; _orderNumber->clear(); _shipDate->clear(); _packDate->clear(); _srcWhs->setId(_preferences->value("PreferredWarehouse").toInt()); _trnsWhs->setId(_metrics->value("DefaultTransitWarehouse").toInt()); _dstWhs->setId(_preferences->value("PreferredWarehouse").toInt()); _status->setCurrentIndex(0); _agent->setCurrentIndex(-1); _taxzoneidCache = -1; _taxzone->setId(-1); _whstaxzoneid = -1; _shipVia->setId(-1); // cannot clear _shippingForm // _shippingForm->setId(-1); _freight->clear(); _orderComments->clear(); _shippingComments->clear(); _tax->clear(); _freight->clear(); _total->clear(); _weight->clear(); _project->setId(-1); _srcWhs->setEnabled(true); _freightCurrency->setEnabled(true); _qecurrency->setEnabled(true); _qeitem->removeRows(0, _qeitem->rowCount()); _shipComplete->setChecked(false); if ( (_mode == cEdit) || (_mode == cNew) ) { _mode = cNew; setObjectName("transferOrder new"); _orderDate->setDate(omfgThis->dbDate(), true); } if ( (_metrics->value("TONumberGeneration") == "A") || (_metrics->value("TONumberGeneration") == "O") ) { if (! insertPlaceholder()) return; } if (_orderNumber->text().isEmpty()) _orderNumber->setFocus(); else _srcWhs->setFocus(); _toitem->clear(); _saved = false; } void transferOrder::closeEvent(QCloseEvent *pEvent) { // TODO: if sQeSave == false then find a way to return control to the user if (_qeitem->isDirty()) { if (QMessageBox::question(this, tr("Save Quick Entry Data?"), tr("Do you want to save your Quick Entry changes?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) sQESave(); } if (! deleteForCancel()) { pEvent->ignore(); return; } disconnect(_orderNumber, SIGNAL(editingFinished()), this, SLOT(sHandleOrderNumber())); sReleaseTohead(); if (cView != _mode) omfgThis->sTransferOrdersUpdated(-1); XWidget::closeEvent(pEvent); } void transferOrder::sHandleShipchrg(int pShipchrgid) { if ( (_mode == cView) ) _freight->setEnabled(FALSE); else { XSqlQuery query; query.prepare( "SELECT shipchrg_custfreight " "FROM shipchrg " "WHERE (shipchrg_id=:shipchrg_id);" ); query.bindValue(":shipchrg_id", pShipchrgid); query.exec(); if (query.first()) { if (query.value("shipchrg_custfreight").toBool()) _freight->setEnabled(TRUE); else { _freight->setEnabled(FALSE); _freight->clear(); } } } } void transferOrder::sHandleTransferOrderEvent(int pToheadid) { if (pToheadid == _toheadid) sFillItemList(); } void transferOrder::sTaxDetail() { XSqlQuery taxq; if (cView != _mode) { taxq.prepare("UPDATE tohead SET tohead_taxzone_id=:taxzone, " " tohead_freight=:freight," " tohead_orderdate=:date " "WHERE (tohead_id=:head_id);"); if (_taxzone->isValid()) taxq.bindValue(":taxzone", _taxzone->id()); taxq.bindValue(":freight", _freight->localValue()); taxq.bindValue(":date", _orderDate->date()); taxq.bindValue(":head_id", _toheadid); taxq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Updating Details"), taxq, __FILE__, __LINE__)) return; } ParameterList params; params.append("order_id", _toheadid); params.append("order_type", "TO"); params.append("mode", "view"); // because tohead has no fields to hold changes taxBreakdown newdlg(this, "", TRUE); if (newdlg.set(params) == NoError) { newdlg.exec(); populate(); } } void transferOrder::setViewMode() { if(cEdit == _mode) { // Undo some changes set for the edit mode _captive = false; } _new->setEnabled(false); disconnect(omfgThis, SIGNAL(transferOrdersUpdated(int)), this, SLOT(sHandleTransferOrderEvent(int))); _mode = cView; setObjectName(QString("transferOrder view %1").arg(_toheadid)); _orderNumber->setEnabled(FALSE); _status->setEnabled(FALSE); _packDate->setEnabled(FALSE); _srcWhs->setEnabled(FALSE); _dstWhs->setEnabled(FALSE); _trnsWhs->setEnabled(FALSE); _agent->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _shipVia->setEnabled(FALSE); _shippingForm->setEnabled(FALSE); _freight->setEnabled(FALSE); _orderComments->setEnabled(FALSE); _shippingComments->setEnabled(FALSE); _qeitemView->setEnabled(FALSE); _qesave->setEnabled(FALSE); _qedelete->setEnabled(FALSE); _qecurrency->setEnabled(FALSE); _freightCurrency->setEnabled(FALSE); _srcContact->setEnabled(FALSE); _dstContact->setEnabled(FALSE); _edit->setText(tr("View")); _comments->setReadOnly(true); _shipComplete->setEnabled(false); _save->hide(); _clear->hide(); _issueStock->hide(); _issueLineBalance->hide(); _project->setReadOnly(true); if(_metrics->boolean("AlwaysShowSaveAndAdd")) _saveAndAdd->setEnabled(false); else _saveAndAdd->hide(); _action->hide(); _delete->hide(); } void transferOrder::keyPressEvent( QKeyEvent * e ) { #ifdef Q_WS_MAC if(e->key() == Qt::Key_N && (e->modifiers() & Qt::ControlModifier)) { _new->animateClick(); e->accept(); } else if(e->key() == Qt::Key_E && (e->modifiers() & Qt::ControlModifier)) { _edit->animateClick(); e->accept(); } if(e->isAccepted()) return; #endif e->ignore(); } void transferOrder::newTransferOrder(int pSrcWhsid, int pDstWhsid) { // Check for an Item window in new mode already. if(pSrcWhsid == -1 && pDstWhsid == -1) { QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), "transferOrder new")==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } } // If none found then create one. ParameterList params; params.append("mode", "new"); if(pSrcWhsid != -1) params.append("src_warehous_id", pSrcWhsid); if (pDstWhsid != -1) params.append("dst_warehous_id", pDstWhsid); transferOrder *newdlg = new transferOrder(); if(newdlg->set(params) != UndefinedError) omfgThis->handleNewWindow(newdlg); else delete newdlg; } void transferOrder::editTransferOrder( int pId , bool enableSaveAndAdd ) { // Check for an Item window in edit mode for the specified transferOrder already. QString n = QString("transferOrder edit %1").arg(pId); QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), n)==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "edit"); params.append("tohead_id", pId); if(enableSaveAndAdd) params.append("enableSaveAndAdd"); transferOrder *newdlg = new transferOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void transferOrder::viewTransferOrder( int pId ) { // Check for an Item window in view mode for the specified transferOrder already. QString n = QString("transferOrder view %1").arg(pId); QWidgetList list = omfgThis->windowList(); for(int i = 0; i < list.size(); i++) { QWidget * w = list.at(i); if(QString::compare(w->objectName(), n)==0) { w->setFocus(); if(omfgThis->showTopLevel()) { w->raise(); w->activateWindow(); } return; } } // If none found then create one. ParameterList params; params.append("mode", "view"); params.append("tohead_id", pId); transferOrder *newdlg = new transferOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void transferOrder::sReturnStock() { XSqlQuery transferReturnStock; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); transferReturnStock.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations transferReturnStock.prepare("SELECT returnItemShipments('TO', :toitem_id, 0, CURRENT_TIMESTAMP) AS result;"); QList selected = _toitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { transferReturnStock.bindValue(":toitem_id", ((XTreeWidgetItem*)(selected[i]))->id()); transferReturnStock.exec(); if (transferReturnStock.first()) { int result = transferReturnStock.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("returnItemShipments", result) + tr("
    Line Item %1").arg(selected[i]->text(0)), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(transferReturnStock.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Return Stock"), tr("Transaction Canceled") ); return; } } else if (transferReturnStock.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("Line Item %1\n").arg(selected[i]->text(0)) + transferReturnStock.lastError().databaseText(), __FILE__, __LINE__); return; } } transferReturnStock.exec("COMMIT;"); sFillItemList(); } void transferOrder::sIssueStock() { bool update = FALSE; QList selected = _toitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem* toitem = (XTreeWidgetItem*)(selected[i]); // skip if status = C or X or U if (toitem->altId() != 1 && toitem->altId() != 4 && toitem->altId() != 5) { ParameterList params; params.append("toitem_id", toitem->id()); if(_requireInventory->isChecked()) params.append("requireInventory"); issueLineToShipping newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) update = TRUE; } } if (update) sFillItemList(); } void transferOrder::sIssueLineBalance() { XSqlQuery transferIssueLineBalance; QList selected = _toitem->selectedItems(); for (int i = 0; i < selected.size(); i++) { XTreeWidgetItem* toitem = (XTreeWidgetItem*)(selected[i]); // skip if status = C or X or U if (toitem->altId() != 1 && toitem->altId() != 4 && toitem->altId() != 5) { if(_requireInventory->isChecked()) { transferIssueLineBalance.prepare("SELECT sufficientInventoryToShipItem('TO', :toitem_id) AS result;"); transferIssueLineBalance.bindValue(":toitem_id", toitem->id()); transferIssueLineBalance.exec(); if (transferIssueLineBalance.first()) { int result = transferIssueLineBalance.value("result").toInt(); if (result < 0) { transferIssueLineBalance.prepare("SELECT item_number, tohead_srcname " " FROM toitem, tohead, item " " WHERE ((toitem_item_id=item_id)" " AND (toitem_tohead_id=tohead_id)" " AND (toitem_id=:toitem_id)); "); transferIssueLineBalance.bindValue(":toitem_id", toitem->id()); transferIssueLineBalance.exec(); if (! transferIssueLineBalance.first() && transferIssueLineBalance.lastError().type() != QSqlError::NoError) { ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Item"), transferIssueLineBalance, __FILE__, __LINE__); systemError(this, storedProcErrorLookup("sufficientInventoryToShipItem", result) .arg(transferIssueLineBalance.value("item_number").toString()) .arg(transferIssueLineBalance.value("tohead_srcname").toString()), __FILE__, __LINE__); return; } } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Checking Inventory"), transferIssueLineBalance, __FILE__, __LINE__)) return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); transferIssueLineBalance.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations transferIssueLineBalance.prepare("SELECT issueLineBalanceToShipping('TO', :toitem_id, CURRENT_TIMESTAMP) AS result;"); transferIssueLineBalance.bindValue(":toitem_id", toitem->id()); transferIssueLineBalance.exec(); if (transferIssueLineBalance.first()) { int result = transferIssueLineBalance.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("issueLineBalance", result) + tr("
    Line Item %1").arg(selected[i]->text(0)), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(transferIssueLineBalance.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Issue to Shipping"), tr("Transaction Canceled") ); return; } transferIssueLineBalance.exec("COMMIT;"); } else { rollback.exec(); systemError(this, tr("Line Item %1\n").arg(selected[i]->text(0)) + transferIssueLineBalance.lastError().databaseText(), __FILE__, __LINE__); return; } } } sFillItemList(); } void transferOrder::sCalculateTax() { XSqlQuery taxq; taxq.prepare( "SELECT SUM(tax) AS tax " "FROM (" "SELECT ROUND(calculateTax(:taxzone_id,getFreightTaxTypeId(),:date,:curr_id,toitem_freight),2) AS tax " "FROM toitem " "WHERE (toitem_tohead_id=:tohead_id) " "UNION ALL " "SELECT ROUND(calculateTax(:taxzone_id,getFreightTaxTypeId(),:date,:curr_id,:freight),2) AS tax " ") AS data;" ); taxq.bindValue(":tohead_id", _toheadid); taxq.bindValue(":taxzone_id", _taxzone->id()); taxq.bindValue(":date", _orderDate->date()); taxq.bindValue(":freight", _freight->localValue()); taxq.exec(); if (taxq.first()) _tax->setLocalValue(taxq.value("tax").toDouble()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Calculating Tax"), taxq, __FILE__, __LINE__)) return; sCalculateTotal(); } bool transferOrder::sQESave() { _qesave->setFocus(); if (! _qeitem->submitAll()) { if (! _qeitem->lastError().databaseText().isEmpty()) systemError(this, _qeitem->lastError().databaseText(), __FILE__, __LINE__); return false; } sFillItemList(); return true; } void transferOrder::sQEDelete() { if (! _qeitem->removeRow(_qeitemView->currentIndex().row())) { systemError(this, tr("Removing row from view failed"), __FILE__, __LINE__); return; } } void transferOrder::sCurrencyChanged() { // The user can only set the QE currency from the QE tab if (_tabs->currentWidget()->isAncestorOf(_qecurrency) && _freightCurrency->id() != _qecurrency->id()) _freightCurrency->setId(_qecurrency->id()); else _qecurrency->setId(_freightCurrency->id()); static_cast(_qeitemView->model())->setCurrId(_freightCurrency->id()); } void transferOrder::sTabChanged(int pIndex) { if (pIndex != _cachedTabIndex) { if (pIndex == _tabs->indexOf(_qeTab) && ! _shipDate->isValid() && ! _packDate->isValid()) { QMessageBox::warning(this, tr("Quick Entry Requires a Date"), tr("

    You must enter either a Scheduled Date or a " "Pack Date before using the Quick Entry tab.")); _cachedTabIndex = 0; _tabs->setCurrentIndex(0); if (_shipDate->isEnabled()) _shipDate->setFocus(); else if (_packDate->isEnabled()) _packDate->setFocus(); } else if (_cachedTabIndex == _tabs->indexOf(_qeTab) && _qeitem->isDirty()) { if (QMessageBox::question(this, tr("Save Quick Entry Data?"), tr("Do you want to save your Quick Entry changes?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) if (! sQESave()) { _tabs->setCurrentIndex(_cachedTabIndex); return; } _cachedTabIndex = pIndex; } else _cachedTabIndex = pIndex; } } void transferOrder::getWhsInfo(const int pid, const QWidget* pwidget) { XSqlQuery whsq; whsq.prepare("SELECT * FROM whsinfo WHERE warehous_id=:id;"); whsq.bindValue(":id", pid); whsq.exec(); if (whsq.first()) { if (pwidget == _srcWhs) { _srcContact->setId(whsq.value("warehous_cntct_id").toInt()); _srcAddr->setId(whsq.value("warehous_addr_id").toInt()); _qeitem->setSrcWhsId(pid); } else if (pwidget == _dstWhs) { _dstContact->setId(whsq.value("warehous_cntct_id").toInt()); _dstAddr->setId(whsq.value("warehous_addr_id").toInt()); _taxzone->setId(whsq.value("warehous_taxzone_id").toInt()); } else if (pwidget == _trnsWhs) { _shippingForm->setId(whsq.value("warehous_shipform_id").toInt()); _shipVia->setId(whsq.value("warehous_shipvia_id").toInt()); _shippingComments->setText(whsq.value("warehous_shipcomments").toString()); } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Site"), whsq, __FILE__, __LINE__)) return; } void transferOrder::sHandleDstWhs(const int pid) { getWhsInfo(pid, _dstWhs); } void transferOrder::sHandleSrcWhs(const int pid) { getWhsInfo(pid, _srcWhs); } void transferOrder::sHandleTrnsWhs(const int pid) { getWhsInfo(pid, _trnsWhs); } void transferOrder::sReleaseTohead() { if (!_locked) return; XSqlQuery query; query.prepare("SELECT pg_advisory_unlock(oid::integer, :tohead_id) AS result " "FROM pg_class " "WHERE relname='tohead';"); query.bindValue(":tohead_id", _toheadid); query.exec(); if (query.first() && ! query.value("result").toBool()) systemError(this, tr("Could not release this Transfer Order record."), __FILE__, __LINE__); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting Line"), query, __FILE__, __LINE__)) return; else _locked = false; } void transferOrder::sReleaseNumber() { XSqlQuery transferReleaseNumber; if(-1 != _orderNumberGen) { transferReleaseNumber.prepare("SELECT releaseToNumber(:number);" ); transferReleaseNumber.bindValue(":number", _orderNumberGen); transferReleaseNumber.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Releasing Number"), transferReleaseNumber, __FILE__, __LINE__); _orderNumberGen = -1; } } qt-client-4.1.0/guiclient/transferOrder.h000066400000000000000000000056331217451700100203750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSFERORDER_H #define TRANSFERORDER_H #include "guiclient.h" #include "xwidget.h" #include #include "toitemTableModel.h" #include "ui_transferOrder.h" class transferOrder : public XWidget, public Ui::transferOrder { Q_OBJECT public: transferOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~transferOrder(); virtual bool save( bool partial ); virtual void setViewMode(); static void newTransferOrder( int , int ); static void editTransferOrder( int pId, bool enableSaveAndAdd ); static void viewTransferOrder( int pId ); public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void clear(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void populate(); virtual void populateOrderNumber(); virtual void sAction(); virtual void sCalculateTax(); virtual void sCalculateTotal(); virtual void sClear(); virtual void sDelete(); virtual void sEdit(); virtual void sFillItemList(); virtual void sHandleButtons(); virtual void sHandleDstWhs(const int); virtual void sHandleOrderNumber(); virtual void sHandleShipchrg( int pShipchrgid ); virtual void sHandleSrcWhs(const int); virtual void sHandleTransferOrderEvent(int); virtual void sHandleTrnsWhs(const int); virtual void sIssueLineBalance(); virtual void sIssueStock(); virtual void sNew(); virtual void sPopulateMenu(QMenu * pMenu); virtual void sReleaseTohead(); virtual void sReturnStock(); virtual void sSave(); virtual void sSaveAndAdd(); virtual void sSetUserEnteredOrderNumber(); virtual void sTaxDetail(); virtual void sReleaseNumber(); protected: virtual void keyPressEvent( QKeyEvent * e ); protected slots: virtual void languageChange(); virtual void sCurrencyChanged(); virtual void sQEDelete(); virtual bool sQESave(); virtual void sTabChanged(int); signals: void saved(int); private: bool deleteForCancel(); void getWhsInfo(const int, const QWidget*); bool insertPlaceholder(); void setToheadid(const int); int _cachedTabIndex; bool _captive; bool _ignoreSignals; int _lineMode; bool _locked; int _mode; int _orderNumberGen; ToitemTableModel* _qeitem; bool _saved; int _taxzoneidCache; int _toheadid; bool _userEnteredOrderNumber; int _whstaxzoneid; }; #endif // TRANSFERORDER_H qt-client-4.1.0/guiclient/transferOrder.ui000066400000000000000000001176711217451700100205710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. transferOrder 0 0 600 400 Transfer Order 5 Clear false Order #: ... Qt::Horizontal QSizePolicy::Expanding 170 20 Save and Add to Packing List Batch &Save true &Close 0 &Header Information 32767 32767 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Order Status: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unreleased Open Closed 6 Ship Complete Order Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Agent: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true XComboBox::Agent 4 Project #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 18 Scheduled Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxzone true XComboBox::TaxZones Pack Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ship From Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _srcWhs WComboBox::NonTransit Qt::Horizontal 31 20 Transit Site: false WComboBox::Transit Qt::Horizontal 40 20 false Qt::TabFocus Ship To false Qt::TabFocus Site: _dstWhs WComboBox::NonTransit Qt::Horizontal 40 20 true true Ship &Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipVia 0 0 200 32767 XComboBox::ShipVias Shipping Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shippingForm 0 0 200 32767 true XComboBox::ShippingForms XComboBox::None Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 20 0 &Line Items Show Canceled Line Items Require sufficient Inventory Freight Currency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Currencies Qt::Horizontal 0 20 Freight Weight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 100 22 Qt::AlignRight Line Item Freight Subtotal: Order-Level Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 false false Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Total: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false false Qt::Horizontal 40 20 5 0 &New true false &Edit true false Close true false &Delete true 0 false Issue Stock false Issue Line Bal. Qt::Vertical QSizePolicy::Expanding 20 0 Order Notes 5 5 Comments 5 5 Comments::TransferOrder Shipping Notes 5 5 Quick Entry 5 5 5 0 Currency for Freight Charges: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Currencies Qt::Horizontal 40 20 Save Quick Entries Delete Quick Entry Qt::Vertical 20 0 AddressCluster QWidget

    addresscluster.h
    Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ProjectCluster QWidget
    projectcluster.h
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    ToitemTableView QTableView
    toitemTableView.h
    _orderNumber _orderDate _shipDate _packDate _status _agent _taxzone _shipComplete _project _srcWhs _trnsWhs _srcAddr _dstWhs _dstAddr _srcContact _dstContact _shipVia _shippingForm _clear _saveAndAdd _save _close _tabs _toitem _new _edit _action _delete _issueStock _issueLineBalance _showCanceled _freightCurrency _requireInventory _weight _freight _total _orderComments _shippingComments _qeitemView _qesave _qedelete _qecurrency _close clicked() transferOrder close() 20 20 20 20 _toitem itemSelected(int) _edit animateClick() 20 20 20 20 _orderNumber textChanged(QString) _orderNumberExtra setText(QString) 20 20 20 20 _orderDate newDate(QDate) _itemFreight setEffective(QDate) 20 20 706 316 _orderDate newDate(QDate) _total setEffective(QDate) 467 84 706 406 _orderDate newDate(QDate) _tax setEffective(QDate) 20 20 706 382 _freightCurrency newID(int) _tax setId(int) 381 316 706 382 _freightCurrency newID(int) _itemFreight setId(int) 381 316 706 316 _freightCurrency newID(int) _total setId(int) 381 316 706 406 _freightCurrency newID(int) _freight setId(int) 381 316 706 349 _orderDate newDate(QDate) _freight setEffective(QDate) 20 20 20 20 qt-client-4.1.0/guiclient/transferOrderItem.cpp000066400000000000000000001213531217451700100215450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "transferOrderItem.h" #include #include #include #include "itemCharacteristicDelegate.h" #include "itemSite.h" #include "storedProcErrorLookup.h" #include "taxDetail.h" transferOrderItem::transferOrderItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_cancel, SIGNAL(clicked()), this, SLOT(sCancel())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sCalculateTax())); connect(_freight, SIGNAL(valueChanged()), this, SLOT(sChanged())); connect(_item, SIGNAL(newId(int)), this, SLOT(sChanged())); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemInfo(int))); connect(_next, SIGNAL(clicked()), this, SLOT(sNext())); connect(_notes, SIGNAL(textChanged()), this, SLOT(sChanged())); connect(_prev, SIGNAL(clicked()), this, SLOT(sPrev())); connect(_promisedDate,SIGNAL(newDate(const QDate&)), this, SLOT(sChanged())); connect(_qtyOrdered, SIGNAL(editingFinished()), this, SLOT(sDetermineAvailability())); connect(_qtyOrdered, SIGNAL(textChanged(const QString&)), this, SLOT(sChanged())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_scheduledDate, SIGNAL(newDate(const QDate&)), this, SLOT(sChanged())); connect(_scheduledDate, SIGNAL(newDate(const QDate&)), this, SLOT(sDetermineAvailability())); connect(_showAvailability, SIGNAL(toggled(bool)), this, SLOT(sDetermineAvailability())); connect(_showAvailability, SIGNAL(toggled(bool)), this, SLOT(sDetermineAvailability())); connect(_showIndented,SIGNAL(toggled(bool)), this, SLOT(sDetermineAvailability())); connect(_taxLit, SIGNAL(leftClickedURL(QString)), this, SLOT(sTaxDetail())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sChanged())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sDetermineAvailability())); connect(_inventoryButton, SIGNAL(toggled(bool)), this, SLOT(sHandleButton())); _modified = false; _canceling = false; _error = false; _originalQtyOrd = 0.0; _saved = false; _availabilityLastItemid = -1; _availabilityLastWarehousid = -1; _availabilityLastSchedDate = QDate(); _availabilityLastShow = false; _availabilityLastShowIndent = false; _availabilityQtyOrdered = 0.0; _item->setType(ItemLineEdit::cActive | (ItemLineEdit::cAllItemTypes_Mask ^ ItemLineEdit::cKit)); _item->addExtraClause( QString("(itemsite_active)") ); // ItemLineEdit::cActive doesn't compare against the itemsite record _availability->addColumn(tr("#"), _seqColumn, Qt::AlignCenter,true, "bomitem_seqnumber"); _availability->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "item_number"); _availability->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); _availability->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter,true, "uom_name"); _availability->addColumn(tr("Pend. Alloc."),_qtyColumn, Qt::AlignRight, true, "pendalloc"); _availability->addColumn(tr("Total Alloc."),_qtyColumn, Qt::AlignRight, true, "totalalloc"); _availability->addColumn(tr("On Order"), _qtyColumn, Qt::AlignRight, true, "ordered"); _availability->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh"); _availability->addColumn(tr("Availability"),_qtyColumn, Qt::AlignRight, true, "totalavail"); _itemchar = new QStandardItemModel(0, 2, this); _itemchar->setHeaderData( 0, Qt::Horizontal, tr("Name"), Qt::DisplayRole); _itemchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole); _itemcharView->setModel(_itemchar); ItemCharacteristicDelegate * delegate = new ItemCharacteristicDelegate(this); _itemcharView->setItemDelegate(delegate); _qtyOrdered->setValidator(omfgThis->qtyVal()); _shippedToDate->setPrecision(omfgThis->qtyVal()); _onHand->setPrecision(omfgThis->qtyVal()); _allocated->setPrecision(omfgThis->qtyVal()); _unallocated->setPrecision(omfgThis->qtyVal()); _onOrder->setPrecision(omfgThis->qtyVal()); _available->setPrecision(omfgThis->qtyVal()); if (!_metrics->boolean("UsePromiseDate")) { _promisedDateLit->hide(); _promisedDate->hide(); } _comments->setType(Comments::TransferOrderItem); _captive = FALSE; _dstwhsid = -1; _itemsiteid = -1; _transwhsid = -1; _toheadid = -1; _taxzoneid = -1; adjustSize(); _inventoryButton->setEnabled(_showAvailability->isChecked()); _dependencyButton->setEnabled(_showAvailability->isChecked()); _availability->setEnabled(_showAvailability->isChecked()); _showIndented->setEnabled(_showAvailability->isChecked()); } transferOrderItem::~transferOrderItem() { // no need to delete child widgets, Qt does it all for us } void transferOrderItem::languageChange() { retranslateUi(this); } enum SetResponse transferOrderItem::set(const ParameterList &pParams) { XSqlQuery transferet; XDialog::set(pParams); QVariant param; bool valid; _prev->setEnabled(true); _next->setEnabled(true); _next->setText(tr("Next")); param = pParams.value("tohead_id", &valid); if (valid) _toheadid = param.toInt(); param = pParams.value("srcwarehouse_id", &valid); if (valid) _warehouse->setId(param.toInt()); param = pParams.value("taxzone_id", &valid); if (valid) _taxzoneid = param.toInt(); param = pParams.value("orderNumber", &valid); if (valid) _orderNumber->setText(param.toString()); param = pParams.value("curr_id", &valid); if (valid) _freight->setId(param.toInt()); param = pParams.value("orderDate", &valid); if (valid) _freight->setEffective(param.toDate()); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _save->setEnabled(FALSE); _next->setText(tr("New")); _comments->setReadOnly(true); _item->setReadOnly(false); _item->addExtraClause(QString("(item_id IN (" " SELECT itemsite_item_id" " FROM itemsite" " WHERE itemsite_warehous_id=%1))") .arg(_warehouse->id()) ); prepare(); param = pParams.value("captive", &valid); if (valid) _captive = TRUE; param = pParams.value("item_id", &valid); if (valid) _item->setId(param.toInt()); param = pParams.value("dueDate", &valid); if (valid) _scheduledDate->setDate(param.toDate()); param = pParams.value("qty", &valid); if (valid) _qtyOrdered->setDouble(param.toDouble()); transferet.prepare("SELECT count(*) AS cnt" " FROM toitem" " WHERE (toitem_tohead_id=:tohead_id);"); transferet.bindValue(":tohead_id", _toheadid); transferet.exec(); if(!transferet.first() || transferet.value("cnt").toInt() == 0) _prev->setEnabled(false); if (transferet.lastError().type() != QSqlError::NoError) { systemError(this, transferet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; _item->setReadOnly(true); } else if (param.toString() == "view") { _mode = cView; } } if(cView == _mode) { _item->setReadOnly(true); _qtyOrdered->setEnabled(false); _freight->setEnabled(false); _scheduledDate->setEnabled(false); _notes->setEnabled(false); _comments->setReadOnly(true); _itemcharView->setEnabled(false); _promisedDate->setEnabled(false); _save->hide(); } param = pParams.value("toitem_id", &valid); if (valid) { _toitemid = param.toInt(); transferet.prepare("SELECT a.toitem_id AS id" " FROM toitem AS a, toitem AS b" " WHERE ((a.toitem_tohead_id=b.toitem_tohead_id)" " AND (b.toitem_id=:id))" " ORDER BY a.toitem_linenumber " " LIMIT 1;"); transferet.bindValue(":id", _toitemid); transferet.exec(); if(!transferet.first() || transferet.value("id").toInt() == _toitemid) _prev->setEnabled(false); if (transferet.lastError().type() != QSqlError::NoError) { systemError(this, transferet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } transferet.prepare("SELECT a.toitem_id AS id" " FROM toitem AS a, toitem AS b" " WHERE ((a.toitem_tohead_id=b.toitem_tohead_id)" " AND (b.toitem_id=:id))" " ORDER BY a.toitem_linenumber DESC" " LIMIT 1;"); transferet.bindValue(":id", _toitemid); transferet.exec(); if(transferet.first() && transferet.value("id").toInt() == _toitemid) { if(cView == _mode) _next->setEnabled(false); else _next->setText(tr("New")); } if (transferet.lastError().type() != QSqlError::NoError) { systemError(this, transferet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(TRUE); } populate(); // TODO: should this go BEFORE pParams.value("item_id")? _modified = false; return NoError; } void transferOrderItem::prepare() { XSqlQuery transferprepare; if (_mode == cNew) { transferprepare.prepare( "SELECT (COALESCE(MAX(toitem_linenumber), 0) + 1) AS _linenumber " "FROM toitem " "WHERE (toitem_tohead_id=:toitem_id)" ); transferprepare.bindValue(":toitem_id", _toheadid); transferprepare.exec(); if (transferprepare.first()) _lineNumber->setText(transferprepare.value("_linenumber").toString()); else if (transferprepare.lastError().type() != QSqlError::NoError) { systemError(this, transferprepare.lastError().databaseText(), __FILE__, __LINE__); return; } transferprepare.prepare( "SELECT MIN(toitem_schedshipdate) AS scheddate " "FROM toitem " "WHERE (toitem_tohead_id=:tohead_id);" ); transferprepare.bindValue(":tohead_id", _toheadid); transferprepare.exec(); if (transferprepare.first()) _scheduledDate->setDate(transferprepare.value("scheddate").toDate()); else if (transferprepare.lastError().type() != QSqlError::NoError) { systemError(this, transferprepare.lastError().databaseText(), __FILE__, __LINE__); return; } } _modified = false; } void transferOrderItem::clear() { _item->setId(-1); _qtyOrdered->clear(); _freight->reset(); _scheduledDate->clear(); _promisedDate->clear(); _stdcost->clear(); _shippedToDate->clear(); _onHand->clear(); _allocated->clear(); _unallocated->clear(); _onOrder->clear(); _available->clear(); _itemchar->removeRows(0, _itemchar->rowCount()); _notes->clear(); _comments->setId(-1); _warehouse->setId(_preferences->value("PreferredWarehouse").toInt()); _originalQtyOrd = 0.0; _modified = false; } void transferOrderItem::sSave() { XSqlQuery transferSave; _save->setFocus(); _error = true; if (!(_qtyOrdered->toDouble() > 0)) { QMessageBox::warning( this, tr("Cannot Save Transfer Order Item"), tr("

    You must enter a valid Quantity Ordered " "before saving this Transfer Order Item.") ); _qtyOrdered->setFocus(); return; } if (!(_scheduledDate->isValid())) { QMessageBox::warning( this, tr("Cannot Save Transfer Order Item"), tr("

    You must enter a valid Schedule Date before " "saving this Transfer Order Item.") ); _scheduledDate->setFocus(); return; } if (_qtyOrdered->toDouble() < _shippedToDate->toDouble()) { QMessageBox::warning(this, tr("Cannot Save Transfer Order Item"), tr("

    You cannot set the quantity of the order to " "a value less than the quantity that has already " "been shipped.")); _qtyOrdered->setFocus(); return; } _error = false; QDate promiseDate; if (_metrics->boolean("UsePromiseDate")) { if (_promisedDate->isValid()) { if (_promisedDate->isNull()) promiseDate = omfgThis->endOfTime(); else promiseDate = _promisedDate->date(); } } else promiseDate = omfgThis->endOfTime(); if (_mode == cNew || _mode == cEdit) { if (itemSite::createItemSite(this, _itemsiteid, _transwhsid, false) < 0 || itemSite::createItemSite(this, _itemsiteid, _dstwhsid, true) < 0) return; } if (_mode == cNew) { transferSave.exec("SELECT NEXTVAL('toitem_toitem_id_seq') AS toitem_id"); if (transferSave.first()) _toitemid = transferSave.value("toitem_id").toInt(); else if (transferSave.lastError().type() != QSqlError::NoError) { systemError(this, transferSave.lastError().databaseText(), __FILE__, __LINE__); return; } else { reject(); return; } transferSave.prepare( "INSERT INTO toitem " "( toitem_id, toitem_tohead_id, toitem_linenumber," " toitem_item_id, toitem_status, toitem_duedate," " toitem_schedshipdate, toitem_schedrecvdate," " toitem_qty_ordered, toitem_notes," " toitem_uom, toitem_stdcost, toitem_prj_id," " toitem_freight, toitem_freight_curr_id ) " "VALUES " "( :toitem_id, :toitem_tohead_id, :toitem_linenumber," " :toitem_item_id, 'U', :toitem_duedate," " :toitem_schedshipdate, :toitem_schedrecvdate," " :toitem_qty_ordered, :toitem_notes," " :toitem_uom, stdCost(:toitem_item_id), :toitem_prj_id," " :toitem_freight, :toitem_freight_curr_id );" ); } else if (_mode == cEdit) { transferSave.prepare( "UPDATE toitem SET" " toitem_duedate=:toitem_duedate," " toitem_schedshipdate=:toitem_schedshipdate," " toitem_schedrecvdate=:toitem_schedrecvdate," " toitem_qty_ordered=:toitem_qty_ordered," " toitem_notes=:toitem_notes," " toitem_prj_id=:toitem_prj_id," " toitem_freight=:toitem_freight," " toitem_freight_curr_id=:toitem_freight_curr_id," " toitem_lastupdated=CURRENT_TIMESTAMP " "WHERE (toitem_id=:toitem_id);" ); } transferSave.bindValue(":toitem_id", _toitemid); transferSave.bindValue(":toitem_tohead_id", _toheadid); transferSave.bindValue(":toitem_linenumber", _lineNumber->text().toInt()); transferSave.bindValue(":toitem_item_id", _item->id()); transferSave.bindValue(":toitem_duedate", _scheduledDate->date()); transferSave.bindValue(":toitem_schedshipdate", _scheduledDate->date()); // ?? transferSave.bindValue(":toitem_schedrecvdate", promiseDate); transferSave.bindValue(":toitem_qty_ordered", _qtyOrdered->toDouble()); transferSave.bindValue(":toitem_notes", _notes->toPlainText()); transferSave.bindValue(":toitem_uom", _item->uom()); // TODO: transferSave.bindValue(":toitem_prj_id", ); transferSave.bindValue(":toitem_freight", _freight->localValue()); transferSave.bindValue(":toitem_freight_curr_id", _freight->id()); transferSave.exec(); if (transferSave.lastError().type() != QSqlError::NoError) { systemError(this, transferSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_mode != cView) { QString type = "TI"; transferSave.prepare("SELECT updateCharAssignment(:target_type, :target_id, :char_id, :char_value) AS result;"); QModelIndex idx1, idx2; for(int i = 0; i < _itemchar->rowCount(); i++) { idx1 = _itemchar->index(i, 0); idx2 = _itemchar->index(i, 1); transferSave.bindValue(":target_type", type); transferSave.bindValue(":target_id", _toitemid); transferSave.bindValue(":char_id", _itemchar->data(idx1, Qt::UserRole)); transferSave.bindValue(":char_value", _itemchar->data(idx2, Qt::DisplayRole)); transferSave.exec(); if (transferSave.first()) { int result = transferSave.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("updateCharAssignment", result), __FILE__, __LINE__); return; } } else if (transferSave.lastError().type() != QSqlError::NoError) { systemError(this, transferSave.lastError().databaseText(), __FILE__, __LINE__); return; } } } _modified = false; omfgThis->sTransferOrdersUpdated(_toheadid); if ((!_captive) && (!_canceling) && (cNew == _mode)) { clear(); prepare(); _prev->setEnabled(true); _item->setFocus(); } else close(); } void transferOrderItem::sPopulateItemInfo(int pItemid) { XSqlQuery transferPopulateItemInfo; _itemchar->removeRows(0, _itemchar->rowCount()); if (pItemid != -1) { transferPopulateItemInfo.prepare("SELECT stdcost(:item_id) AS stdcost, itemsite_id " "FROM itemsite " "WHERE ((itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:whsid));"); transferPopulateItemInfo.bindValue(":item_id", pItemid); transferPopulateItemInfo.bindValue(":whsid", _warehouse->id()); transferPopulateItemInfo.exec(); if (transferPopulateItemInfo.first()) { _stdcost->setBaseValue(transferPopulateItemInfo.value("stdcost").toDouble()); _itemsiteid = transferPopulateItemInfo.value("itemsite_id").toInt(); } else if (transferPopulateItemInfo.lastError().type() != QSqlError::NoError) { systemError(this, transferPopulateItemInfo.lastError().databaseText(), __FILE__, __LINE__); return; } transferPopulateItemInfo.prepare( "SELECT DISTINCT char_id, char_name," " COALESCE(b.charass_value," " (SELECT c.charass_value" " FROM charass c" " WHERE ((c.charass_target_type='I')" " AND (c.charass_target_id=:item_id)" " AND (c.charass_default)" " AND (c.charass_char_id=char_id)) LIMIT 1)) AS charass_value" " FROM charass a, char " " LEFT OUTER JOIN charass b" " ON (b.charass_target_type=:totype" " AND b.charass_target_id=:toitem_id" " AND b.charass_char_id=char_id) " " WHERE ( (a.charass_char_id=char_id)" " AND (a.charass_target_type='I')" " AND (a.charass_target_id=:item_id) ) " " ORDER BY char_name;" ); transferPopulateItemInfo.bindValue(":item_id", pItemid); transferPopulateItemInfo.bindValue(":totype", "TI"); transferPopulateItemInfo.bindValue(":toitem_id", _toitemid); transferPopulateItemInfo.exec(); int row = 0; QModelIndex idx; while(transferPopulateItemInfo.next()) { _itemchar->insertRow(_itemchar->rowCount()); idx = _itemchar->index(row, 0); _itemchar->setData(idx, transferPopulateItemInfo.value("char_name"), Qt::DisplayRole); _itemchar->setData(idx, transferPopulateItemInfo.value("char_id"), Qt::UserRole); idx = _itemchar->index(row, 1); _itemchar->setData(idx, transferPopulateItemInfo.value("charass_value"), Qt::DisplayRole); _itemchar->setData(idx, pItemid, Xt::IdRole); _itemchar->setData(idx, pItemid, Qt::UserRole); row++; } if (transferPopulateItemInfo.lastError().type() != QSqlError::NoError) { systemError(this, transferPopulateItemInfo.lastError().databaseText(), __FILE__, __LINE__); return; } } } void transferOrderItem::sDetermineAvailability() { if( (_item->id()==_availabilityLastItemid) && (_warehouse->id()==_availabilityLastWarehousid) && (_scheduledDate->date()==_availabilityLastSchedDate) && (_showAvailability->isChecked()==_availabilityLastShow) && (_showIndented->isChecked()==_availabilityLastShowIndent) && (_qtyOrdered->toDouble()==_availabilityQtyOrdered) ) return; _availabilityLastItemid = _item->id(); _availabilityLastWarehousid = _warehouse->id(); _availabilityLastSchedDate = _scheduledDate->date(); _availabilityLastShow = _showAvailability->isChecked(); _availabilityLastShowIndent = _showIndented->isChecked(); _availabilityQtyOrdered = _qtyOrdered->toDouble(); _availability->clear(); if ((_item->isValid()) && (_scheduledDate->isValid()) && (_showAvailability->isChecked()) ) { XSqlQuery availability; availability.prepare( "SELECT itemsite_id," " qoh," " allocated," " noNeg(qoh - allocated) AS unallocated," " ordered," " (qoh - allocated + ordered) AS available " "FROM ( SELECT itemsite_id, itemsite_qtyonhand AS qoh," " qtyAllocated(itemsite_id, DATE(:date)) AS allocated," " qtyOrdered(itemsite_id, DATE(:date)) AS ordered " " FROM itemsite, item " " WHERE ((itemsite_item_id=item_id)" " AND (item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id)) ) AS data;" ); availability.bindValue(":date", _scheduledDate->date()); availability.bindValue(":item_id", _item->id()); availability.bindValue(":warehous_id", _warehouse->id()); availability.exec(); if (availability.first()) { _onHand->setText(availability.value("qoh").toString()); _allocated->setText(availability.value("allocated").toString()); _unallocated->setText(availability.value("unallocated").toString()); _onOrder->setText(availability.value("ordered").toString()); _available->setText(availability.value("available").toString()); QString stylesheet; if (availability.value("available").toDouble() < _qtyOrdered->toDouble()) stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); _available->setStyleSheet(stylesheet); if ( (_item->itemType() == "M") ) { if(_showIndented->isChecked()) { availability.prepare("SELECT indentedBOM(:item_id) AS bomwork_set_id;"); availability.bindValue(":item_id", _item->id()); availability.exec(); if(availability.first()) { int _worksetid = availability.value("bomwork_set_id").toInt(); if (_worksetid < 0) { systemError(this, storedProcErrorLookup("indentedBOM", _worksetid), __FILE__, __LINE__); return; } availability.prepare("SELECT bomwork_id, *, " " bomwork_seqnumber AS bomitem_seqnumber," " totalalloc + pendalloc AS totalalloc," " (qoh + ordered - (totalalloc + pendalloc)) AS totalavail," " bomwork_level - 1 AS xtindentrole," " 'qty' AS totalalloc_xtnumericrole," " 'qty' AS totalavail_xtnumericrole," " 'qty' AS pendalloc_xtnumericrole," " 'qty' AS ordered_xtnumericrole," " 'qty' AS qoh_xtnumericrole," " CASE WHEN (qoh < pendalloc) THEN 'error'" " END AS qoh_qtforegroundrole," " CASE WHEN (qoh + ordered - (totalalloc + pendalloc) < 0) THEN 'error'" " WHEN (qoh + ordered - (totalalloc + pendalloc) < reorderlevel) THEN 'warning'" " END AS totalavail_qtforegroundrole " " FROM ( SELECT itemsite_id AS itemsiteid," " CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel," " bomwork_id, bomwork_parent_id," " bomwork_level, bomwork_seqnumber," " item_number, uom_name," " (item_descrip1 || ' ' || item_descrip2) AS item_descrip," " ((bomwork_qtyfxd + bomwork_qtyper * :qty) * (1 + bomwork_scrap)) AS pendalloc," " (qtyAllocated(itemsite_id, DATE(:schedDate)) - ((bomwork_qtyfxd + bomwork_qtyper * :origOrdQty) * (1 + bomwork_scrap))) AS totalalloc," " noNeg(itemsite_qtyonhand) AS qoh," " qtyOrdered(itemsite_id, DATE(:schedDate)) AS ordered" " FROM bomwork, item, itemsite, uom" " WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_warehous_id=:warehous_id)" " AND (bomwork_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (bomwork_set_id=:bomwork_set_id)" " )" " ) AS data " "ORDER BY bomworksequence(bomwork_id);"); availability.bindValue(":bomwork_set_id", _worksetid); availability.bindValue(":warehous_id", _warehouse->id()); availability.bindValue(":qty", _qtyOrdered->toDouble()); availability.bindValue(":schedDate", _scheduledDate->date()); availability.bindValue(":origQtyOrd", _originalQtyOrd); availability.exec(); _availability->populate(availability); if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } // All done with the bomwork set, delete it availability.prepare("SELECT deleteBOMWorkset(:bomwork_set_id) AS result;"); availability.bindValue(":bomwork_set_id", _worksetid); availability.exec(); if (availability.first()) { int result = availability.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteBOMWorkset", result), __FILE__, __LINE__); return; } } else if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } } } else { int itemsiteid = availability.value("itemsite_id").toInt(); availability.prepare( "SELECT itemsiteid, *, " " (qoh + ordered - (totalalloc + pendalloc)) AS totalavail," " 'qty' AS totalalloc_xtnumericrole," " 'qty' AS totalavail_xtnumericrole," " 'qty' AS pendalloc_xtnumericrole," " 'qty' AS ordered_xtnumericrole," " 'qty' AS qoh_xtnumericrole," " CASE WHEN (qoh < pendalloc) THEN 'error'" " END AS qoh_qtforegroundrole," " CASE WHEN (qoh + ordered - (totalalloc + pendalloc) < 0) THEN 'error'" " WHEN (qoh + ordered - (totalalloc + pendalloc) < reorderlevel) THEN 'warning'" " END AS totalavail_qtforegroundrole " "FROM ( SELECT cs.itemsite_id AS itemsiteid," " CASE WHEN(cs.itemsite_useparams) THEN cs.itemsite_reorderlevel ELSE 0.0 END AS reorderlevel," " bomitem_seqnumber, item_number," " (item_descrip1 || ' ' || item_descrip2) AS item_descrip, uom_name," " itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, (bomitem_qtyfxd + bomitem_qtyper * :qty) * (1 + bomitem_scrap)) AS pendalloc," " (qtyAllocated(cs.itemsite_id, DATE(:schedDate)) - itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, (bomitem_qtyfxd + bomitem_qtyper * :origQtyOrd) * (1 + bomitem_scrap))) AS totalalloc," " noNeg(cs.itemsite_qtyonhand) AS qoh," " qtyOrdered(cs.itemsite_id, DATE(:schedDate)) AS ordered " " FROM itemsite AS cs, itemsite AS ps, item, bomitem, uom " " WHERE ( (bomitem_item_id=item_id)" " AND (item_inv_uom_id=uom_id)" " AND (cs.itemsite_item_id=item_id)" " AND (cs.itemsite_warehous_id=ps.itemsite_warehous_id)" " AND (bomitem_parent_item_id=ps.itemsite_item_id)" " AND (bomitem_rev_id=getActiveRevId('BOM',bomitem_parent_item_id))" " AND (:schedDate BETWEEN bomitem_effective AND (bomitem_expires-1))" " AND (ps.itemsite_id=:itemsite_id) ) ) AS data " "ORDER BY bomitem_seqnumber;" ); availability.bindValue(":itemsite_id", itemsiteid); availability.bindValue(":qty", _qtyOrdered->toDouble()); availability.bindValue(":schedDate", _scheduledDate->date()); availability.bindValue(":origQtyOrd", _originalQtyOrd); availability.exec(); _availability->populate(availability); if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } } } else _availability->setEnabled(FALSE); } else if (availability.lastError().type() != QSqlError::NoError) { systemError(this, availability.lastError().databaseText(), __FILE__, __LINE__); return; } } else { _onHand->clear(); _allocated->clear(); _unallocated->clear(); _onOrder->clear(); _available->clear(); } } void transferOrderItem::populate() { XSqlQuery item; if (_mode == cNew) { item.prepare("SELECT tohead.*, warehous_id, warehous_code " "FROM whsinfo, tohead " "WHERE ((tohead_src_warehous_id=warehous_id)" " AND (tohead_id=:id));") ; item.bindValue(":id", _toheadid); } else { item.prepare("SELECT toitem_linenumber,toitem_status,toitem_qty_ordered, " " toitem_schedshipdate,toitem_notes,toitem_schedrecvdate," " toitem_freight,toitem_item_id, toitem_status," " tohead_id,tohead_taxzone_id,tohead_trns_warehous_id," " tohead_dest_warehous_id,tohead_number, " " warehous_id, warehous_code," " stdCost(toitem_item_id) AS stdcost," " itemsite_id," " (SELECT COALESCE(SUM(shipitem_qty), 0)" " FROM shipitem, shiphead" " WHERE ((shipitem_shiphead_id=shiphead_id)" " AND (shiphead_order_type='TO')" " AND (shipitem_orderitem_id=toitem_id))) AS shipitem_qty, " " SUM(taxhist_tax) AS tax " "FROM whsinfo, tohead, itemsite, toitem " " LEFT OUTER JOIN toitemtax ON (toitem_id=taxhist_parent_id) " "WHERE ((toitem_tohead_id=tohead_id)" " AND (tohead_src_warehous_id=warehous_id)" " AND (itemsite_item_id=toitem_item_id)" " AND (itemsite_warehous_id=tohead_src_warehous_id)" " AND (toitem_id=:id)) " "GROUP BY toitem_linenumber,toitem_status,toitem_qty_ordered, " " toitem_schedshipdate,toitem_notes,toitem_schedrecvdate," " tohead_id,tohead_taxzone_id,tohead_trns_warehous_id," " tohead_dest_warehous_id,tohead_number,toitem_freight, " " warehous_id, warehous_code,toitem_item_id," " toitem_status, stdcost, shipitem_qty, itemsite_id;"); item.bindValue(":id", _toitemid); } item.exec(); if (item.first()) { _toheadid = item.value("tohead_id").toInt(); _taxzoneid = item.value("tohead_taxzone_id").toInt(); _transwhsid = item.value("tohead_trns_warehous_id").toInt(); _dstwhsid = item.value("tohead_dest_warehous_id").toInt(); _orderNumber->setText(item.value("tohead_number").toString()); _warehouse->clear(); _warehouse->append(item.value("warehous_id").toInt(), item.value("warehous_code").toString()); if (_mode == cEdit || _mode == cView) { _itemsiteid = item.value("itemsite_id").toInt(); _comments->setId(_toitemid); _lineNumber->setText(item.value("toitem_linenumber").toString()); _stdcost->setBaseValue(item.value("stdcost").toDouble()); _shippedToDate->setDouble(item.value("shipitem_qty").toDouble()); // do tax stuff before _qtyOrdered so signal cascade has data to work with _qtyOrdered->setDouble(item.value("toitem_qty_ordered").toDouble()); _scheduledDate->setDate(item.value("toitem_schedshipdate").toDate()); _notes->setText(item.value("toitem_notes").toString()); if (!item.value("toitem_schedrecvdate").isNull() && _metrics->boolean("UsePromiseDate")) _promisedDate->setDate(item.value("toitem_schedrecvdate").toDate()); _originalQtyOrd = _qtyOrdered->toDouble(); // Set the _item here to tickle signal cascade _item->setId(item.value("toitem_item_id").toInt()); _freight->setLocalValue(item.value("toitem_freight").toDouble()); _tax->setLocalValue(item.value("tax").toDouble()); sDetermineAvailability(); } } else if (item.lastError().type() != QSqlError::NoError) { systemError(this, item.lastError().databaseText(), __FILE__, __LINE__); return; } if( (cNew == _mode) || ((cEdit == _mode) && (item.value("toitem_status").toString() == "O")) ) _cancel->setEnabled(_shippedToDate->toDouble()==0.0); else _cancel->setEnabled(false); } void transferOrderItem::sNext() { XSqlQuery transferNext; if(_modified) { switch( QMessageBox::question( this, tr("Unsaved Changed"), tr("

    You have made some changes which have not yet been saved! " "Would you like to save them now?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape ) ) { case QMessageBox::Yes: sSave(); if(_modified) // catch an error saving return; case QMessageBox::No: break; case QMessageBox::Cancel: default: return; } } clear(); prepare(); _item->setFocus(); if(cNew == _mode) { _modified = false; return; } transferNext.prepare("SELECT a.toitem_id AS id" " FROM toitem AS a, toitem AS b" " WHERE ((a.toitem_tohead_id=b.toitem_tohead_id)" " AND (a.toitem_linenumber > b.toitem_linenumber)" " AND (b.toitem_id=:id))" " ORDER BY a.toitem_linenumber" " LIMIT 1;"); transferNext.bindValue(":id", _toitemid); transferNext.exec(); if(transferNext.first()) { ParameterList params; params.append("toitem_id", transferNext.value("id").toInt()); if(cNew == _mode || cEdit == _mode) params.append("mode", "edit"); else params.append("mode", "view"); set(params); } else if (transferNext.lastError().type() != QSqlError::NoError) { systemError(this, transferNext.lastError().databaseText(), __FILE__, __LINE__); return; } else if (cView != _mode) { ParameterList params; params.append("tohead_id", _toheadid); params.append("mode", "new"); set(params); } } void transferOrderItem::sPrev() { XSqlQuery transferPrev; if(_modified) { switch( QMessageBox::question( this, tr("Unsaved Changed"), tr("

    You have made some changes which have not yet been saved! " "Would you like to save them now?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape ) ) { case QMessageBox::Yes: sSave(); if(_modified) // catch an error saving return; case QMessageBox::No: break; case QMessageBox::Cancel: default: return; } } clear(); prepare(); _item->setFocus(); if(cNew == _mode) transferPrev.prepare("SELECT toitem_id AS id" " FROM toitem" " WHERE (toitem_tohead_id=:tohead_id)" " ORDER BY toitem_linenumber DESC" " LIMIT 1;"); else transferPrev.prepare("SELECT a.toitem_id AS id" " FROM toitem AS a, toitem AS b" " WHERE ((a.toitem_tohead_id=b.toitem_tohead_id)" " AND (a.toitem_linenumber < b.toitem_linenumber)" " AND (b.toitem_id=:id))" " ORDER BY a.toitem_linenumber DESC" " LIMIT 1;"); transferPrev.bindValue(":id", _toitemid); transferPrev.bindValue(":tohead_id", _toheadid); transferPrev.exec(); if(transferPrev.first()) { ParameterList params; params.append("toitem_id", transferPrev.value("id").toInt()); if(cNew == _mode || cEdit == _mode) params.append("mode", "edit"); else params.append("mode", "view"); set(params); } else if (transferPrev.lastError().type() != QSqlError::NoError) { systemError(this, transferPrev.lastError().databaseText(), __FILE__, __LINE__); return; } } void transferOrderItem::sChanged() { _modified = true; } void transferOrderItem::reject() { if(_modified) { switch( QMessageBox::question( this, tr("Unsaved Changed"), tr("

    You have made some changes which have not yet been saved! " "Would you like to save them now?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape ) ) { case QMessageBox::Yes: sSave(); if(_modified) // catch an error saving return; case QMessageBox::No: break; case QMessageBox::Cancel: default: return; } } XDialog::reject(); } void transferOrderItem::sCancel() { XSqlQuery transferCancel; _canceling = true; sSave(); if(_error) return; transferCancel.prepare("UPDATE toitem SET toitem_status='X' WHERE (toitem_id=:toitem_id);"); transferCancel.bindValue(":toitem_id", _toitemid); transferCancel.exec(); if (transferCancel.lastError().type() != QSqlError::NoError) { systemError(this, transferCancel.lastError().databaseText(), __FILE__, __LINE__); return; } _modified = false; _canceling = false; omfgThis->sTransferOrdersUpdated(_toheadid); if (cNew == _mode) { clear(); prepare(); _prev->setEnabled(true); _item->setFocus(); } else close(); } void transferOrderItem::sCalculateTax() { XSqlQuery calcq; calcq.prepare("SELECT ROUND(calculateTax(tohead_taxzone_id,getFreightTaxTypeId(),tohead_orderdate,tohead_freight_curr_id,:freight),2) AS tax " "FROM tohead " "WHERE (tohead_id=:tohead_id); " ); calcq.bindValue(":tohead_id", _toheadid); calcq.bindValue(":freight", _freight->localValue()); calcq.exec(); if (calcq.first()) _tax->setLocalValue(calcq.value("tax").toDouble()); else if (calcq.lastError().type() != QSqlError::NoError) { systemError(this, calcq.lastError().databaseText(), __FILE__, __LINE__); return; } } void transferOrderItem::sTaxDetail() { XSqlQuery fid; fid.exec("SELECT getFreightTaxTypeId() AS taxtype_id;"); fid.first(); taxDetail newdlg(this, "", true); ParameterList params; params.append("taxzone_id", _taxzoneid); params.append("taxtype_id", fid.value("taxtype_id").toInt()); params.append("date", _tax->effective()); params.append("curr_id", _tax->id()); params.append("subtotal", _freight->localValue()); params.append("readOnly"); if (newdlg.set(params) == NoError) newdlg.exec(); } void transferOrderItem::sHandleButton() { if (_inventoryButton->isChecked()) _availabilityStack->setCurrentIndex(0); else _availabilityStack->setCurrentIndex(1); } qt-client-4.1.0/guiclient/transferOrderItem.h000066400000000000000000000037301217451700100212100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSFERORDERITEM_H #define TRANSFERORDERITEM_H #include "guiclient.h" #include #include "xdialog.h" #include #include "ui_transferOrderItem.h" class transferOrderItem : public XDialog, public Ui::transferOrderItem { Q_OBJECT public: transferOrderItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~transferOrderItem(); virtual void prepare(); virtual void clear(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sPopulateItemInfo( int pItemid ); virtual void sDetermineAvailability(); virtual void populate(); virtual void sNext(); virtual void sPrev(); virtual void sChanged(); virtual void sCancel(); virtual void sCalculateTax(); virtual void sTaxDetail(); virtual void sHandleButton(); protected slots: virtual void languageChange(); virtual void reject(); private: int _availabilityLastItemid; QDate _availabilityLastSchedDate; bool _availabilityLastShow; bool _availabilityLastShowIndent; int _availabilityLastWarehousid; double _availabilityQtyOrdered; bool _canceling; bool _captive; int _dstwhsid; bool _error; QStandardItemModel *_itemchar; int _itemsiteid; int _mode; bool _modified; double _originalQtyOrd; int _taxzoneid; int _toheadid; int _toitemid; int _transwhsid; bool _saved; }; #endif // TRANSFERORDERITEM_H qt-client-4.1.0/guiclient/transferOrderItem.ui000066400000000000000000001022531217451700100213760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. transferOrderItem 0 0 600 400 Transfer Order Item 12 12 12 12 12 12 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal 40 20 0 5 &Close false &Save true 0 25 0 Previous Next Cancel Item Qt::Vertical QSizePolicy::Expanding 20 0 From &Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _warehouse false Qt::Vertical QSizePolicy::Expanding 171 20 &Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qtyOrdered Qt::AlignRight true Qty. Shipped: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 40 Standard Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _stdcost CurrDisplay::Cost false false Line Item Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Tax: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Sc&heduled Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _scheduledDate &Promised Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _promisedDate Qt::Horizontal 40 20 0 1 0 Supply 0 12 Show Availability false Inventory true false Dependencies Qt::Horizontal QSizePolicy::Expanding 20 20 0 false Availability On Hand: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Allocated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Unallocated: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter On Order: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Available: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Qt::Horizontal QSizePolicy::Expanding 41 153 Qt::Vertical 421 31 0 false Show dependencies as Indented BOM false true Characteristics QAbstractItemView::AllEditTriggers false false Notes Comments Comments QWidget

    comments.h
    CurrCluster CurrDisplay
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _warehouse _qtyOrdered _scheduledDate _promisedDate _freight _tabs _itemcharView _notes _comments _showIndented _availability _showAvailability _save _prev _next _cancel _close _close clicked() transferOrderItem reject() 544 43 20 20 _item valid(bool) _save setEnabled(bool) 51 85 544 73 _item warehouseIdChanged(int) _warehouse setId(int) 51 85 437 86 _freight effectiveChanged(QDate) _stdcost setEffective(QDate) 353 206 353 174 _freight idChanged(int) _stdcost setId(int) 353 206 353 174 _freight effectiveChanged(QDate) _tax setEffective(QDate) 499 211 499 243 _freight idChanged(int) _tax setId(int) 499 211 499 243 _showAvailability toggled(bool) _availabilityGroup setEnabled(bool) 34 357 44 388 _showAvailability toggled(bool) _availability setEnabled(bool) 99 369 33 406 _showAvailability toggled(bool) _showIndented setEnabled(bool) 132 360 132 387 _showAvailability toggled(bool) _inventoryButton setEnabled(bool) 95 360 198 369 _showAvailability toggled(bool) _dependencyButton setEnabled(bool) 70 370 282 370 qt-client-4.1.0/guiclient/transferOrders.cpp000066400000000000000000000270361217451700100211140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "transferOrders.h" #include #include #include #include #include #include #include "mqlutil.h" #include "copyTransferOrder.h" #include "issueToShipping.h" #include "storedProcErrorLookup.h" #include "transferOrder.h" #include "printPackingList.h" transferOrders::transferOrders(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_release, SIGNAL(clicked()), this, SLOT(sRelease())); connect(_copy, SIGNAL(clicked()), this, SLOT(sCopy())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_destWarehouse, SIGNAL(updated()), this, SLOT(sFillList())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_issue, SIGNAL(clicked()), this, SLOT(sIssue())); connect(_srcWarehouse, SIGNAL(updated()), this, SLOT(sFillList())); connect(_allStatuses, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_selectedStatus, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_statuses, SIGNAL(activated(int)), this, SLOT(sFillList())); connect(_to, SIGNAL(itemSelectionChanged()), this, SLOT(sHandleButtons())); connect(_to, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*, int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(omfgThis, SIGNAL(transferOrdersUpdated(int)), this, SLOT(sFillList())); _to->addColumn(tr("Order #"), -1, Qt::AlignLeft, true, "tohead_number" ); _to->addColumn(tr("Status"), _statusColumn*2, Qt::AlignCenter, true, "f_status" ); _to->addColumn(tr("Source Site"), _whsColumn*3, Qt::AlignLeft, true, "srcWhs" ); _to->addColumn(tr("Dest. Site"), _whsColumn*3, Qt::AlignLeft, true, "destWhs" ); _to->addColumn(tr("Ordered"), _dateColumn, Qt::AlignCenter, true, "tohead_orderdate" ); _to->addColumn(tr("Scheduled"), _dateColumn, Qt::AlignCenter, true, "scheduled" ); if (_privileges->check("MaintainTransferOrders")) { connect(_to, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_to, SIGNAL(valid(bool)), _copy, SLOT(setEnabled(bool))); connect(_to, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_to, SIGNAL(valid(bool)), _issue, SLOT(setEnabled(bool))); connect(_to, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_to, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _numSelected = 0; _destWarehouse->setAll(); sFillList(); } transferOrders::~transferOrders() { // no need to delete child widgets, Qt does it all for us } void transferOrders::languageChange() { retranslateUi(this); } void transferOrders::setParams(ParameterList& params) { if (_srcWarehouse->isSelected()) params.append("src_warehous_id", _srcWarehouse->id()); if (_destWarehouse->isSelected()) params.append("dest_warehous_id", _destWarehouse->id()); if (_selectedStatus->isChecked()) { const char *statusTypes[] = { "U", "O", "C" }; QString status = QString(statusTypes[_statuses->currentIndex()]); params.append("tohead_status", status); } else params.append("excludeClosed"); params.append("unreleased", tr("Unreleased")); params.append("open", tr("Open")); params.append("closed", tr("Closed")); } void transferOrders::sPrint() { ParameterList params; setParams(params); orReport report("ListTransferOrders", params); if (report.isValid()) report.print(); else report.reportError(this); } void transferOrders::sNew() { transferOrder::newTransferOrder( (_srcWarehouse->isSelected() ? _srcWarehouse->id() : -1), (_destWarehouse->isSelected() ? _destWarehouse->id() : -1)); } void transferOrders::sEdit() { transferOrder::editTransferOrder(_to->id(), false); } void transferOrders::sView() { transferOrder::viewTransferOrder(_to->id()); } void transferOrders::sCopy() { ParameterList params; params.append("tohead_id", _to->id()); copyTransferOrder newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void transferOrders::sRelease() { XSqlQuery transferRelease; transferRelease.prepare( "SELECT releaseTransferOrder(:tohead_id) AS result;"); transferRelease.bindValue(":tohead_id", _to->id()); transferRelease.exec(); if (transferRelease.first()) { int result = transferRelease.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("releaseTransferOrder", result), __FILE__, __LINE__); return; } } else if (transferRelease.lastError().type() != QSqlError::NoError) { systemError(this, transferRelease.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void transferOrders::sIssue() { ParameterList params; params.append("tohead_id", _to->id()); issueToShipping *newdlg = new issueToShipping(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); sFillList(); } void transferOrders::sDelete() { XSqlQuery transferDelete; if ( QMessageBox::question(this, tr("Delete Transfer Order?"), tr("

    Are you sure that you want to completely " "delete the selected Transfer Order?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { transferDelete.prepare("SELECT deleteTo(:tohead_id) AS result;"); transferDelete.bindValue(":tohead_id", _to->id()); transferDelete.exec(); if (transferDelete.first()) { int result = transferDelete.value("result").toInt(); if (result == -1) { if (QMessageBox::question(this, tr("Cannot Delete Transfer Order"), tr("

    The selected Transfer Order cannot be " "deleted as there have been shipments " "posted against it. Would you like to " "Close it instead?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; transferDelete.prepare( "SELECT closeTransferOrder(:tohead_id) AS result;"); transferDelete.bindValue(":tohead_id", _to->id()); transferDelete.exec(); if (transferDelete.first()) { int result = transferDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("closeTransferOrder", result), __FILE__, __LINE__); return; } } else if (transferDelete.lastError().type() != QSqlError::NoError) { systemError(this, transferDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } else if (result < 0) { systemError(this, storedProcErrorLookup("deleteTo", result), __FILE__, __LINE__); return; } omfgThis->sTransferOrdersUpdated(-1); omfgThis->sProjectsUpdated(-1); } else if (transferDelete.lastError().type() != QSqlError::NoError) { systemError(this, transferDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } } void transferOrders::sPrintPackingList() { ParameterList params; params.append("tohead_id", _to->id()); params.append("print"); printPackingList newdlg(this, "", TRUE); if (newdlg.set(params) != NoError_Print) newdlg.exec(); } void transferOrders::sAddToPackingListBatch() { XSqlQuery transferAddToPackingListBatch; transferAddToPackingListBatch.prepare("SELECT addToPackingListBatch('TO', :tohead_id) AS result;"); transferAddToPackingListBatch.bindValue(":tohead_id", _to->id()); transferAddToPackingListBatch.exec(); if (transferAddToPackingListBatch.first()) { int result = transferAddToPackingListBatch.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("addToPackingListBatch", result), __FILE__, __LINE__); return; } } else if (transferAddToPackingListBatch.lastError().type() != QSqlError::NoError) { systemError(this, transferAddToPackingListBatch.lastError().databaseText(), __FILE__, __LINE__); return; } } void transferOrders::sHandleButtons() { XTreeWidgetItem *selected = 0; _numSelected = 0; QList selectedlist = _to->selectedItems(); _numSelected = selectedlist.size(); if (_numSelected > 0) selected = (XTreeWidgetItem*)(selectedlist[0]); if (selected) { if (selected->altId() == 1 || selected->altId() == 2) { if (!_privileges->check("MaintainTransferOrders")) { _edit->setEnabled(FALSE); _delete->setEnabled(FALSE); } else { _edit->setEnabled(TRUE); _delete->setEnabled(TRUE); } } else { _edit->setEnabled(FALSE); _delete->setEnabled(FALSE); } if (selected->altId() == 1) { if (!_privileges->check("ReleaseTransferOrders")) _release->setEnabled(FALSE); else _release->setEnabled(TRUE); } else _release->setEnabled(FALSE); if (!_privileges->check("MaintainTransferOrders")) _copy->setEnabled(FALSE); else _copy->setEnabled(TRUE); if (selected->altId() == 2) { if (!_privileges->check("IssueStockToShipping")) _issue->setEnabled(FALSE); else _issue->setEnabled(TRUE); } else _issue->setEnabled(FALSE); } } void transferOrders::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pSelected) { QAction *menuItem; XTreeWidgetItem * item = (XTreeWidgetItem*)pSelected; menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); if (item->altId() == 1 || item->altId() == 2) { menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainTransferOrders")); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainTransferOrders")); } if (item->altId() == 1) { menuItem = pMenu->addAction(tr("Release..."), this, SLOT(sRelease())); menuItem->setEnabled(_privileges->check("ReleaseTransferOrders")); } menuItem = pMenu->addAction(tr("Copy..."), this, SLOT(sCopy())); menuItem->setEnabled(_privileges->check("MaintainTransferOrders")); if (item->altId() == 2) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Issue To Shipping..."), this, SLOT(sIssue())); menuItem->setEnabled(_privileges->check("IssueStockToShipping")); menuItem = pMenu->addAction(tr("Print Packing List..."), this, SLOT(sPrintPackingList())); menuItem->setEnabled(_privileges->check("PrintPackingLists")); menuItem = pMenu->addAction(tr("Add to Packing List Batch..."), this, SLOT(sAddToPackingListBatch())); menuItem->setEnabled(_privileges->check("MaintainPackingListBatch")); } } void transferOrders::sFillList() { ParameterList params; setParams(params); MetaSQLQuery mql = mqlLoad("transferOrders", "detail"); XSqlQuery r = mql.toQuery(params); _to->populate(r, true); if (r.lastError().type() != QSqlError::NoError) { systemError(this, r.lastError().databaseText(), __FILE__, __LINE__); return; } _to->setDragString("toheadid="); sHandleButtons(); } qt-client-4.1.0/guiclient/transferOrders.h000066400000000000000000000026051217451700100205540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSFERORDERS_H #define TRANSFERORDERS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_transferOrders.h" class transferOrders : public XWidget, public Ui::transferOrders { Q_OBJECT public: transferOrders(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~transferOrders(); public slots: virtual void sAddToPackingListBatch(); virtual void sCopy(); virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sIssue(); virtual void sNew(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sPrint(); virtual void sPrintPackingList(); virtual void sRelease(); virtual void sView(); virtual void setParams(ParameterList &); protected slots: virtual void languageChange(); private: int _numSelected; }; #endif // TRANSFERORDERS_H qt-client-4.1.0/guiclient/transferOrders.ui000066400000000000000000000314101217451700100207360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. transferOrders 0 0 805 600 List Open Transfer Orders 12 12 Source Site: false Destination Site: false Status All Statuses true Selected: false Unreleased Open Qt::Horizontal 40 20 Qt::Horizontal 13 69 0 &Close &Print Qt::Vertical QSizePolicy::Expanding 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 0 0 0 20 Transfer Orders: 0 2 5 0 true &New false &Edit false &View false &Delete 0 false Release false Issue Stock false Co&py Qt::Vertical 20 0 WarehouseGroup QGroupBox

    warehousegroup.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _srcWarehouse _destWarehouse _to _new _edit _view _delete _issue _copy _print _close _to valid(bool) _view setEnabled(bool) 43 149 720 197 _close clicked() transferOrders close() 775 46 289 193 _selectedStatus toggled(bool) _statuses setEnabled(bool) 526 81 632 81 qt-client-4.1.0/guiclient/transferTrans.cpp000066400000000000000000000263231217451700100207430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "transferTrans.h" #include #include #include #include #include "distributeInventory.h" #include "inputManager.h" #include "storedProcErrorLookup.h" #include "warehouseCluster.h" transferTrans::transferTrans(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); connect(_item, SIGNAL(newId(int)), this, SLOT(sHandleItem())); connect(_fromWarehouse, SIGNAL(newID(int)), this, SLOT(sPopulateFromQty(int))); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_qty, SIGNAL(textChanged(const QString&)), this, SLOT(sUpdateQty(const QString&))); connect(_toWarehouse, SIGNAL(newID(int)), this, SLOT(sPopulateToQty(int))); _captive = FALSE; _item->setType(ItemLineEdit::cGeneralInventory | ItemLineEdit::cActive); _fromWarehouse->setType(WComboBox::AllActiveInventory); _toWarehouse->setType(WComboBox::AllActiveInventory); _qty->setValidator(omfgThis->qtyVal()); _fromBeforeQty->setPrecision(omfgThis->qtyVal()); _toBeforeQty->setPrecision(omfgThis->qtyVal()); _fromAfterQty->setPrecision(omfgThis->qtyVal()); _toAfterQty->setPrecision(omfgThis->qtyVal()); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); } transferTrans::~transferTrans() { // no need to delete child widgets, Qt does it all for us } void transferTrans::languageChange() { retranslateUi(this); } enum SetResponse transferTrans::set(const ParameterList &pParams) { XSqlQuery transferet; XWidget::set(pParams); QVariant param; bool valid; int invhistid = -1; param = pParams.value("itemsite_id", &valid); if (valid) { _captive = TRUE; _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _fromWarehouse->setEnabled(FALSE); } param = pParams.value("qty", &valid); if (valid) { _captive = TRUE; _qty->setText(formatQty(param.toDouble())); _qty->setEnabled(FALSE); } param = pParams.value("invhist_id", &valid); if (valid) invhistid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _usernameLit->clear(); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); } else if (param.toString() == "view") { _mode = cView; _transDate->setEnabled(FALSE); _item->setEnabled(FALSE); _toWarehouse->setEnabled(FALSE); _fromWarehouse->setEnabled(FALSE); _qty->setEnabled(FALSE); _documentNum->setEnabled(FALSE); _notes->setReadOnly(TRUE); _close->setText(tr("&Close")); _post->hide(); transferet.prepare( "SELECT invhist.*, " " ABS(invhist_invqty) AS transqty," " CASE WHEN (invhist_invqty > 0) THEN invhist_qoh_before" " ELSE NULL" " END AS qohbefore," " CASE WHEN (invhist_invqty > 0) THEN invhist_qoh_after" " ELSE NULL" " END AS qohafter," " CASE WHEN (invhist_invqty > 0) THEN NULL" " ELSE invhist_qoh_before" " END AS fromqohbefore," " CASE WHEN (invhist_invqty > 0) THEN NULL" " ELSE invhist_qoh_after" " END AS fromqohafter," " CASE WHEN (invhist_invqty > 0) THEN itemsite_warehous_id" " ELSE invhist_xfer_warehous_id" " END AS toWarehouse," " CASE WHEN (invhist_invqty > 0) THEN invhist_xfer_warehous_id" " ELSE itemsite_warehous_id" " END AS fromWarehouse " " FROM invhist, itemsite" " WHERE ((invhist_itemsite_id=itemsite_id)" " AND (invhist_id=:invhist_id)); " ); transferet.bindValue(":invhist_id", invhistid); transferet.exec(); if (transferet.first()) { _transDate->setDate(transferet.value("invhist_transdate").toDate()); _username->setText(transferet.value("invhist_user").toString()); _qty->setText(formatQty(transferet.value("transqty").toDouble())); _fromBeforeQty->setText(formatQty(transferet.value("fromqohbefore").toDouble())); _fromAfterQty->setText(formatQty(transferet.value("fromqohafter").toDouble())); _toBeforeQty->setText(formatQty(transferet.value("qohbefore").toDouble())); _toAfterQty->setText(formatQty(transferet.value("qohafter").toDouble())); _documentNum->setText(transferet.value("invhist_docnumber")); _notes->setText(transferet.value("invhist_comments").toString()); _item->setItemsiteid(transferet.value("invhist_itemsite_id").toInt()); _toWarehouse->setId(transferet.value("toWarehouse").toInt()); _fromWarehouse->setId(transferet.value("fromWarehouse").toInt()); } } } return NoError; } void transferTrans::sHandleItem() { if (_item->isFractional()) _qty->setValidator(omfgThis->transQtyVal()); else _qty->setValidator(new QIntValidator(this)); } void transferTrans::sPost() { XSqlQuery transferPost; struct { bool condition; QString msg; QWidget *widget; } error[] = { { ! _item->isValid(), tr("You must select an Item before posting this transaction."), _item }, { _qty->text().length() == 0 || _qty->toDouble() <= 0, tr("

    You must enter a positive Quantity before posting this Transaction."), _qty }, { _fromWarehouse->id() == _toWarehouse->id(), tr("

    The Target Site is the same as the Source Site. " "You must select a different Site for each before " "posting this Transaction"), _fromWarehouse }, { true, "", NULL } }; int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Post Transaction"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); transferPost.exec("BEGIN;"); // because of possible distribution cancelations transferPost.prepare( "SELECT interWarehouseTransfer(:item_id, :from_warehous_id," " :to_warehous_id, :qty, 'Misc', " " :docNumber, :comments, 0, :date ) AS result;"); transferPost.bindValue(":item_id", _item->id()); transferPost.bindValue(":from_warehous_id", _fromWarehouse->id()); transferPost.bindValue(":to_warehous_id", _toWarehouse->id()); transferPost.bindValue(":qty", _qty->toDouble()); transferPost.bindValue(":docNumber", _documentNum->text()); transferPost.bindValue(":comments", _notes->toPlainText()); transferPost.bindValue(":date", _transDate->date()); transferPost.exec(); if (transferPost.first()) { int result = transferPost.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("interWarehouseTransfer", result), __FILE__, __LINE__); return; } else if (transferPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, transferPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(transferPost.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information(this, tr("Transfer Transaction"), tr("Transaction Canceled") ); return; } transferPost.exec("COMMIT;"); if (_captive) close(); else { _close->setText(tr("&Close")); _item->setId(-1); _qty->clear(); _documentNum->clear(); _notes->clear(); _fromBeforeQty->clear(); _fromAfterQty->clear(); _toBeforeQty->clear(); _toAfterQty->clear(); _item->setFocus(); } } else { rollback.exec(); systemError( this, tr("A System Error occurred at transferTrans::%1, Item Site ID #%2, To Site ID #%3, From Site #%4.") .arg(__LINE__) .arg(_item->id()) .arg(_toWarehouse->id()) .arg(_fromWarehouse->id()) ); return; } } void transferTrans::sPopulateFromQty(int pWarehousid) { XSqlQuery transferPopulateFromQty; if (_mode != cView) { transferPopulateFromQty.prepare( "SELECT itemsite_qtyonhand " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); transferPopulateFromQty.bindValue(":item_id", _item->id()); transferPopulateFromQty.bindValue(":warehous_id", pWarehousid); transferPopulateFromQty.exec(); if (transferPopulateFromQty.first()) { _cachedFromBeforeQty = transferPopulateFromQty.value("itemsite_qtyonhand").toDouble(); _fromBeforeQty->setText(formatQty(transferPopulateFromQty.value("itemsite_qtyonhand").toDouble())); if (_qty->text().length()) _fromAfterQty->setText(formatQty(transferPopulateFromQty.value("itemsite_qtyonhand").toDouble() - _qty->toDouble())); } else if (transferPopulateFromQty.lastError().type() != QSqlError::NoError) { systemError(this, transferPopulateFromQty.lastError().databaseText(), __FILE__, __LINE__); return; } } } void transferTrans::sPopulateToQty(int pWarehousid) { XSqlQuery transferPopulateToQty; if (_mode != cView) { transferPopulateToQty.prepare( "SELECT itemsite_qtyonhand " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); transferPopulateToQty.bindValue(":item_id", _item->id()); transferPopulateToQty.bindValue(":warehous_id", pWarehousid); transferPopulateToQty.exec(); if (transferPopulateToQty.first()) { _cachedToBeforeQty = transferPopulateToQty.value("itemsite_qtyonhand").toDouble(); _toBeforeQty->setText(formatQty(transferPopulateToQty.value("itemsite_qtyonhand").toDouble())); if (_qty->text().length()) _toAfterQty->setText(formatQty(transferPopulateToQty.value("itemsite_qtyonhand").toDouble() + _qty->toDouble())); } } } void transferTrans::sUpdateQty(const QString &pQty) { if (_mode != cView) { _fromAfterQty->setText(formatQty(_cachedFromBeforeQty - pQty.toDouble())); _toAfterQty->setText(formatQty(_cachedToBeforeQty + pQty.toDouble())); } } qt-client-4.1.0/guiclient/transferTrans.h000066400000000000000000000024021217451700100204000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSFERTRANS_H #define TRANSFERTRANS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_transferTrans.h" class transferTrans : public XWidget, public Ui::transferTrans { Q_OBJECT public: transferTrans(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~transferTrans(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); protected slots: virtual void languageChange(); virtual void sHandleItem(); virtual void sPost(); virtual void sPopulateFromQty( int pWarehousid ); virtual void sPopulateToQty( int pWarehousid ); virtual void sUpdateQty( const QString & pQty ); private: bool _captive; int _mode; double _cachedFromBeforeQty; double _cachedToBeforeQty; }; #endif // TRANSFERTRANS_H qt-client-4.1.0/guiclient/transferTrans.ui000066400000000000000000000300301217451700100205640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. transferTrans 0 0 492 411 Inter-Site Transaction 5 5 Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 Qt::Vertical QSizePolicy::Expanding 0 20 5 &Cancel false &Post Qt::Vertical QSizePolicy::Expanding 20 20 From Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter To Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Before Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 After Qt::AlignCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Transferred Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignRight Document #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 0 0 20 Notes: DLineEdit QWidget

    datecluster.h
    1 ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _transDate _item _fromWarehouse _toWarehouse _qty _documentNum _notes _post _close _item valid(bool) _post setEnabled(bool) 20 20 20 20 _item newId(int) _toWarehouse findItemsites(int) 20 20 20 20 _close clicked() transferTrans close() 20 20 20 20 _item warehouseIdChanged(int) _fromWarehouse setId(int) 20 20 20 20 _item newId(int) _fromWarehouse findItemsites(int) 20 20 20 20 qt-client-4.1.0/guiclient/transformTrans.cpp000066400000000000000000000376551217451700100211440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "transformTrans.h" #include #include #include #include #include "distributeInventory.h" #include "inputManager.h" #include "storedProcErrorLookup.h" transformTrans::transformTrans(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateQOH())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_qty, SIGNAL(editingFinished()), this, SLOT(sRecalculateAfter())); connect(_source, SIGNAL(newId(int)), this, SLOT(sPopulateQOH())); connect(_source, SIGNAL(valid(bool)), this, SLOT(sHandleButtons())); connect(_target, SIGNAL(newID(int)), this, SLOT(sPopulateTarget(int))); connect(_target, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateQOH())); _captive = FALSE; _item->setType(ItemLineEdit::cGeneralInventory | ItemLineEdit::cActive); _warehouse->setType(WComboBox::AllActiveInventory); _qty->setValidator(omfgThis->qtyVal()); _fromBeforeQty->setPrecision(omfgThis->qtyVal()); _toBeforeQty->setPrecision(omfgThis->qtyVal()); _fromAfterQty->setPrecision(omfgThis->qtyVal()); _toAfterQty->setPrecision(omfgThis->qtyVal()); omfgThis->inputManager()->notify(cBCItem, this, _item, SLOT(setItemid(int))); omfgThis->inputManager()->notify(cBCItemSite, this, _item, SLOT(setItemsiteid(int))); _source->addColumn( tr("Location"),_itemColumn, Qt::AlignLeft, true, "locationname"); _source->addColumn( tr("Lot/Serial #"), -1, Qt::AlignLeft, true, "lotserial"); _source->addColumn( tr("Qty."), _qtyColumn, Qt::AlignRight,true, "qty"); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } _controlled = true; // safest assumption _targetIsValid = false; } transformTrans::~transformTrans() { // no need to delete child widgets, Qt does it all for us } void transformTrans::languageChange() { retranslateUi(this); } enum SetResponse transformTrans::set(const ParameterList &pParams) { XSqlQuery transformet; XWidget::set(pParams); _captive = TRUE; QVariant param; bool valid; int invhistid = -1; param = pParams.value("invhist_id", &valid); if (valid) invhistid = param.toInt(); param = pParams.value("itemsite_id", &valid); if (valid) { _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _usernameLit->clear(); _transDate->setEnabled(_privileges->check("AlterTransactionDates")); _transDate->setDate(omfgThis->dbDate()); } else if (param.toString() == "view") { _mode = cView; _transDate->setEnabled(FALSE); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); _target->setEnabled(FALSE); _qty->setEnabled(FALSE); _documentNum->setEnabled(FALSE); _notes->setReadOnly(TRUE); _close->setText(tr("&Close")); _post->hide(); transformet.prepare( "SELECT invhist.*, " " abs(invhist_invqty) AS transqty," " CASE WHEN (invhist_invqty > 0) THEN invhist_qoh_before" " ELSE NULL" " END AS qohbefore," " CASE WHEN (invhist_invqty > 0) THEN invhist_qoh_after" " ELSE NULL" " END AS qohafter," " CASE WHEN (invhist_invqty > 0) THEN NULL" " ELSE invhist_qoh_before" " END AS fromqohbefore," " CASE WHEN (invhist_invqty > 0) THEN NULL" " ELSE invhist_qoh_after" " END AS fromqohafter," " CASE WHEN (invhist_invqty > 0) THEN invhist_xfer_warehous_id" " ELSE itemsite_warehous_id" " END AS warehous_id " " FROM invhist, itemsite" " WHERE ((invhist_itemsite_id=itemsite_id)" " AND (invhist_id=:invhist_id)); " ); transformet.bindValue(":invhist_id", invhistid); transformet.exec(); if (transformet.first()) { _transDate->setDate(transformet.value("invhist_transdate").toDate()); _username->setText(transformet.value("invhist_user").toString()); _qty->setDouble(transformet.value("transqty").toDouble()); _fromBeforeQty->setDouble(transformet.value("fromqohbefore").toDouble()); _fromAfterQty->setDouble(transformet.value("fromqohafter").toDouble()); _toBeforeQty->setDouble(transformet.value("qohbefore").toDouble()); _toAfterQty->setDouble(transformet.value("qohafter").toDouble()); _documentNum->setText(transformet.value("invhist_docnumber").toString()); _notes->setText(transformet.value("invhist_comments").toString()); _item->setItemsiteid(transformet.value("invhist_itemsite_id").toInt()); _warehouse->setId(transformet.value("warehous_id").toInt()); } } } return NoError; } void transformTrans::sPost() { XSqlQuery transformPost; struct { bool condition; QString msg; QWidget *widget; } error[] = { { ! _item->isValid(), tr("You must select an Item before posting this transaction."), _item }, { _qty->toDouble() == 0 || _qty->toDouble() <= 0, tr("

    You must enter a positive Quantity before posting this Transaction."), _qty }, { _qty->toDouble() > _fromBeforeQty->toDouble(), tr("

    You may not transform a quantity that is greater than the " "quantity of the Transform Source."), _qty }, { _target->id() < 0, tr("

    >You must select a Target Item before posting this transaction."), _target }, { true, "", NULL } }; int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, tr("Cannot Post Transaction"), error[errIndex].msg); error[errIndex].widget->setFocus(); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); transformPost.exec("BEGIN;"); // because of possible distribution cancelations transformPost.prepare( "SELECT postTransformTrans(s.itemsite_id, t.itemsite_id," " :itemloc_id, :qty, :docnumber," " :comments, :date) AS result " "FROM itemsite AS s, itemsite AS t " "WHERE ( (s.itemsite_warehous_id=t.itemsite_warehous_id)" " AND (s.itemsite_warehous_id=:warehous_id)" " AND (s.itemsite_item_id=:sourceItemid)" " AND (t.itemsite_item_id=:targetItemid) );" ); transformPost.bindValue(":warehous_id", _warehouse->id()); transformPost.bindValue(":sourceItemid", _item->id()); transformPost.bindValue(":targetItemid", _target->id()); transformPost.bindValue(":itemloc_id", _source->altId()); transformPost.bindValue(":qty", _qty->toDouble()); transformPost.bindValue(":comments", _notes->toPlainText()); transformPost.bindValue(":docnumber", _documentNum->text()); transformPost.bindValue(":date", _transDate->date()); transformPost.exec(); if (transformPost.first()) { int result = transformPost.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postTransformTrans", result), __FILE__, __LINE__); return; } else if (transformPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, transformPost.lastError().databaseText(), __FILE__, __LINE__); return; } if (distributeInventory::SeriesAdjust(transformPost.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information(this, tr("Transform Transaction"), tr("Transaction Canceled") ); return; } transformPost.exec("COMMIT;"); } else if (transformPost.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, transformPost.lastError().databaseText(), __FILE__, __LINE__); return; } else { rollback.exec(); systemError( this, tr("

    No transaction was done because either Item %1 or Item " "%2 was not found at Site %3.") .arg(_item->itemNumber(), _target->currentText(), _warehouse->currentText())); } if (_captive) close(); else { _close->setText(tr("&Close")); _item->setId(-1); _qty->clear(); _documentNum->clear(); _notes->clear(); _fromBeforeQty->clear(); _fromAfterQty->clear(); _toBeforeQty->clear(); _toAfterQty->clear(); _controlled = true; _transDate->setDate(omfgThis->dbDate()); _item->setFocus(); } } void transformTrans::sPopulateTarget(int /*pItemid*/) { XSqlQuery transformPopulateTarget; if (!_item->isValid()) return; transformPopulateTarget.prepare( "SELECT item_descrip1, item_descrip2, itemsite_qtyonhand " "FROM itemsite JOIN item ON (item_id=itemsite_item_id) " "WHERE ( (itemsite_item_id=:item_id) " " AND (itemsite_warehous_id=:warehous_id) " " AND (itemsite_active) " " AND (itemsite_controlmethod <> 'N') );" ); transformPopulateTarget.bindValue(":item_id", _target->id()); transformPopulateTarget.bindValue(":warehous_id", _warehouse->id()); transformPopulateTarget.exec(); if (transformPopulateTarget.first()) { _descrip1->setText(transformPopulateTarget.value("item_descrip1").toString()); _descrip2->setText(transformPopulateTarget.value("item_descrip2").toString()); _toBeforeQty->setDouble(transformPopulateTarget.value("itemsite_qtyonhand").toDouble()); sRecalculateAfter(); _targetIsValid = true; } else if (transformPopulateTarget.lastError().type() != QSqlError::NoError) { _targetIsValid = false; systemError(this, transformPopulateTarget.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::warning(this, tr("No Transform Targets"), tr("This Target Item cannot be Transformed because " "it has no Item Site or the Item Site is either " "Inactive or has a Control Method of None.")); _targetIsValid = false; _target->setFocus(); return; } } void transformTrans::sFillList() { XSqlQuery transformFillList; if (!_item->isValid()) return; _source->clear(); _target->clear(); transformFillList.prepare( "SELECT item_id, item_number " "FROM itemtrans JOIN item ON (item_id=itemtrans_target_item_id) " "WHERE (itemtrans_source_item_id=:item_id) " "ORDER BY item_number;" ); transformFillList.bindValue(":item_id", _item->id()); transformFillList.exec(); if (transformFillList.first()) _target->populate(transformFillList); else if (transformFillList.lastError().type() != QSqlError::NoError) { systemError(this, transformFillList.lastError().databaseText(), __FILE__, __LINE__); return; } else { QMessageBox::warning(this, tr("No Transform Targets"), tr("This Source Item cannot be Transformed because " "it has no Transformations. Either select another " "Source Item or use the Transformations tab on the " "Item window to define a target Item.")); _item->setFocus(); return; } transformFillList.prepare( "SELECT itemsite_id," " ( (itemsite_loccntrl) OR (itemsite_controlmethod IN ('L', 'S')) ) AS detail " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); transformFillList.bindValue(":item_id", _item->id()); transformFillList.bindValue(":warehous_id", _warehouse->id()); transformFillList.exec(); if (transformFillList.first()) { int itemsiteid = transformFillList.value("itemsite_id").toInt(); _controlled = transformFillList.value("detail").toBool(); if (_controlled) transformFillList.prepare( "SELECT itemloc_itemsite_id AS itemsiteid, itemloc_id AS itemlocid," " CASE WHEN (location_id IS NULL) THEN :na" " ELSE formatLocationName(location_id)" " END AS locationname," " ls_number AS lotserial," " itemloc_qty AS qty, 'qty' AS qty_xtnumericrole " "FROM itemloc " " LEFT OUTER JOIN location ON (itemloc_location_id=location_id) " " LEFT OUTER JOIN ls ON (itemloc_ls_id=ls_id)" "WHERE ( (itemloc_qty > 0)" " AND (itemloc_itemsite_id=:itemsite_id) );" ); else transformFillList.prepare( "SELECT itemsite_id AS itemsiteid, -1 AS itemlocid," " TEXT(:na) AS locationname," " TEXT(:na) AS lotserial," " itemsite_qtyonhand AS qty, 'qty' AS qty_xtnumericrole " "FROM itemsite " "WHERE ( (itemsite_qtyonhand > 0)" " AND (itemsite_id=:itemsite_id) );" ); transformFillList.bindValue(":na", tr("N/A")); transformFillList.bindValue(":itemsite_id", itemsiteid); transformFillList.exec(); _source->populate(transformFillList, true); if (transformFillList.lastError().type() != QSqlError::NoError) { systemError(this, transformFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } else if (transformFillList.lastError().type() != QSqlError::NoError) { systemError(this, transformFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void transformTrans::sPopulateQOH() { XSqlQuery transformPopulateQOH; if (_source->id() > -1) { _fromBeforeQty->setDouble(_source->currentItem()->rawValue("qty").toDouble()); sRecalculateAfter(); } else { transformPopulateQOH.prepare( "SELECT itemsite_qtyonhand " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id));" ); transformPopulateQOH.bindValue(":item_id", _item->id()); transformPopulateQOH.bindValue(":warehous_id", _warehouse->id()); transformPopulateQOH.exec(); if (transformPopulateQOH.first()) { _fromBeforeQty->setDouble(transformPopulateQOH.value("itemsite_qtyonhand").toDouble()); if (_item->isFractional()) _qty->setValidator(omfgThis->transQtyVal()); else _qty->setValidator(new QIntValidator(this)); sRecalculateAfter(); } else if (transformPopulateQOH.lastError().type() != QSqlError::NoError) { systemError(this, transformPopulateQOH.lastError().databaseText(), __FILE__, __LINE__); return; } } } void transformTrans::sRecalculateAfter() { _fromAfterQty->setDouble(_fromBeforeQty->toDouble() - _qty->toDouble()); _toAfterQty->setDouble(_toBeforeQty->toDouble() + _qty->toDouble()); } void transformTrans::sHandleButtons() { _post->setEnabled((! _controlled || _source->id() > -1) && _target->id() > -1 && _targetIsValid); } qt-client-4.1.0/guiclient/transformTrans.h000066400000000000000000000023601217451700100205720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSFORMTRANS_H #define TRANSFORMTRANS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_transformTrans.h" class transformTrans : public XWidget, public Ui::transformTrans { Q_OBJECT public: transformTrans(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~transformTrans(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sFillList(); virtual void sHandleButtons(); virtual void sPopulateQOH(); virtual void sPopulateTarget(int pItemid); virtual void sPost(); virtual void sRecalculateAfter(); protected slots: virtual void languageChange(); private: int _mode; bool _captive; bool _controlled; bool _targetIsValid; }; #endif // TRANSFORMTRANS_H qt-client-4.1.0/guiclient/transformTrans.ui000066400000000000000000000310031217451700100207540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. transformTrans 0 0 475 610 Transform Transaction Transaction Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _transDate Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _username Qt::Horizontal QSizePolicy::Expanding 20 40 0 5 &Close false &Post true true Qt::Vertical QSizePolicy::Expanding 10 0 Qt::Vertical 20 40 Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Before Qt::AlignCenter After Qt::AlignCenter Target Item Number: 0 0 Qty. to Transform: Document #: _documentNum Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Source: 0 0 300 100 Notes: DLineEdit QWidget

    datecluster.h
    1 ItemCluster QWidget
    itemcluster.h
    1
    WComboBox XComboBox
    wcombobox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    XTextEdit QTextEdit
    xtextedit.h
    _transDate _item _warehouse _target _qty _documentNum _source _notes _post _close parameter.h QStatusBar QMessageBox _close clicked() transformTrans close() 20 20 20 20 _item warehouseIdChanged(int) _warehouse setId(int) 20 20 20 20 _item privateIdChanged(int) _warehouse findItemsites(int) 20 20 20 20 qt-client-4.1.0/guiclient/translations.cpp000066400000000000000000000163331217451700100206300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "translations.h" #include #include #include #include #include #include #include #include #include translations::translations(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); nwam = new QNetworkAccessManager(this); connect(_check, SIGNAL(clicked()), this, SLOT(sDownload())); connect(_locale, SIGNAL(newID(int)), this, SLOT(sLocaleChanged())); connect(_translations,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(sLanguageSelected(QTreeWidgetItem*, int))); connect(_translations,SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*, int))); connect(nwam, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*))); _translations->addColumn(tr("Package"), _itemColumn, Qt::AlignLeft, true, "package" ); _translations->addColumn(tr("Found"), _ynColumn, Qt::AlignCenter, true, "found" ); _translations->addColumn(tr("Location"), -1, Qt::AlignLeft, true, "location" ); _locale->setId(_preferences->value("locale_id").toInt()); _locale->setEnabled(false); sLocaleChanged(); } translations::~translations() { // no need to delete child widgets, Qt does it all for us } void translations::languageChange() { retranslateUi(this); } void translations::sLocaleChanged() { XSqlQuery langq; langq.prepare("SELECT * " " FROM locale LEFT OUTER JOIN" " lang ON (locale_lang_id=lang_id) LEFT OUTER JOIN" " country ON (locale_country_id=country_id) " " WHERE(locale_id=:localeid);"); langq.bindValue(":localeid", _locale->id()); langq.exec(); if(langq.first()) { if (!langq.value("lang_abbr2").toString().isEmpty() && !langq.value("country_abbr").toString().isEmpty()) { langext = langq.value("lang_abbr2").toString() + "_" + langq.value("country_abbr").toString().toLower(); } else if (!langq.value("lang_abbr2").toString().isEmpty()) { langext = langq.value("lang_abbr2").toString(); } _language->setText(langq.value("lang_name").toString()); _country->setText(langq.value("country_name").toString()); } else { langext = QLocale::system().name().toLower(); _language->setText("Default"); _country->setText("Default"); } _translations->clear(); QStringList files; files << "qt"; files << "xTuple"; files << "openrpt"; files << "reports"; XSqlQuery pkglist("SELECT pkghead_name" " FROM pkghead" " WHERE packageIsEnabled(pkghead_name);"); while(pkglist.next()) files << pkglist.value("pkghead_name").toString(); if(files.size() < 1) return; XTreeWidgetItem * item = 0; int i = 1; for (QStringList::Iterator fit = files.begin(); fit != files.end(); ++fit) { QString loc = translationFile(langext, *fit); item = new XTreeWidgetItem(_translations, item, i++, *fit, (loc.isEmpty() ? tr("No") : tr("Yes")), loc); } } void translations::sLanguageSelected(QTreeWidgetItem * item, int /*column*/) { if(!item) return; QNetworkReply * nwrep = nwam->get(QNetworkRequest(QUrl("http://www.xtuple.org/xttranslate/guiexport/" + item->text(0) + "/" + langext + "/current"))); nwrep->setProperty("package_name", item->text(0)); connect(nwrep, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); item->setText(2, tr("Connecting...")); } void translations::finished(QNetworkReply * nwrep) { QList ilist = _translations->findItems(nwrep->property("package_name").toString(), Qt::MatchFixedString, 0); if(ilist.isEmpty()) { qDebug() << "No items found matching replies package name"; return; } QTreeWidgetItem * item = ilist.at(0); if(!item) { qDebug() << "Found item is not valid"; return; } if(nwrep->header(QNetworkRequest::LocationHeader).isValid()) { QNetworkReply * newrep = nwam->get(QNetworkRequest(QUrl(nwrep->header(QNetworkRequest::LocationHeader).toString()))); newrep->setProperty("package_name", nwrep->property("package_name")); connect(newrep, SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(downloadProgress(qint64, qint64))); } else { if(nwrep->error() == QNetworkReply::NoError) { QByteArray ba = nwrep->readAll(); if(!ba.isEmpty()) { QDir dir(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); if(!dir.exists()) dir.mkpath(QDesktopServices::storageLocation(QDesktopServices::DataLocation)); QFile file(QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/" + item->text(0) + "." + langext + ".qm"); if(file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { file.write(ba); file.close(); QTranslator * translator = new QTranslator(qApp); if (translator->load(translationFile(langext, item->text(0)))) { qApp->installTranslator(translator); qDebug("updated/installed %s", (item->text(0)).toAscii().data()); } item->setText(1, tr("Yes")); item->setText(2, translationFile(langext, item->text(0))); } else { item->setText(2, tr("Could not save file.")); } } else { item->setText(2, tr("No translation is currently available.")); } } else { item->setText(2, tr("Could not retrieve translation at this time.")); } } nwrep->deleteLater(); } void translations::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) { if(bytesReceived == bytesTotal) return; // Don't do anything since the download is done and the finished function will do the rest. QNetworkReply * nwrep = qobject_cast(sender()); if(!nwrep) return; QList ilist = _translations->findItems(nwrep->property("package_name").toString(), Qt::MatchFixedString, 0); if(ilist.isEmpty()) { qDebug() << "No items found matching replies package name"; return; } QTreeWidgetItem * item = ilist.at(0); if(!item) { qDebug() << "Found item is not valid"; return; } item->setText(2, tr("%1 bytes downloaded").arg(bytesReceived)); } void translations::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int /*pColumn*/) { QAction *menuItem; menuItem = pMenu->addAction(tr("Check for translation"), this, SLOT(sDownload())); } void translations::sDownload() { foreach (XTreeWidgetItem *item, _translations->selectedItems()) sLanguageSelected(item, 0); _translations->clearSelection(); } qt-client-4.1.0/guiclient/translations.h000066400000000000000000000024041217451700100202670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSLATIONS_H #define TRANSLATIONS_H #include "guiclient.h" #include "xwidget.h" #include "ui_translations.h" class QNetworkAccessManager; class QNetworkReply; class translations : public XWidget, public Ui::translations { Q_OBJECT public: translations(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~translations(); public slots: virtual void sLocaleChanged(); virtual void sLanguageSelected(QTreeWidgetItem * item, int column); virtual void sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int pColumn); virtual void sDownload(); protected slots: virtual void languageChange(); virtual void finished(QNetworkReply*); virtual void downloadProgress(qint64, qint64); private: QNetworkAccessManager * nwam; QString langext; }; #endif // TRANSLATIONS_H qt-client-4.1.0/guiclient/translations.ui000066400000000000000000000111101217451700100204470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. translations 0 0 464 367 Translations Locale: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox::Locales Qt::Horizontal 0 20 Language: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Default Country: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Default Close false Check for Translations QAbstractItemView::ExtendedSelection XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _locale _translations _check _close _close clicked() translations close() 413 27 231 183 _translations valid(bool) _check setEnabled(bool) 231 236 359 92
    qt-client-4.1.0/guiclient/uiform.cpp000066400000000000000000000410751217451700100174110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "uiform.h" #include #include #include #include #include #include #include #include #include #include #include "customCommand.h" #include "package.h" #include "scriptEditor.h" #include "storedProcErrorLookup.h" #include "xTupleDesigner.h" #include "xuiloader.h" uiform::uiform(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_cmdDelete, SIGNAL(clicked()), this, SLOT(sCmdDelete())); connect(_cmdEdit, SIGNAL(clicked()), this, SLOT(sCmdEdit())); connect(_cmdNew, SIGNAL(clicked()), this, SLOT(sCmdNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_export, SIGNAL(clicked()), this, SLOT(sExport())); connect(_import, SIGNAL(clicked()), this, SLOT(sImport())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sFillList())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_scriptDelete, SIGNAL(clicked()), this, SLOT(sScriptDelete())); connect(_scriptEdit, SIGNAL(clicked()), this, SLOT(sScriptEdit())); connect(_scriptNew, SIGNAL(clicked()), this, SLOT(sScriptNew())); _script->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "script_name"); _script->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "script_notes"); _script->addColumn(tr("Order"), _ynColumn, Qt::AlignCenter,true, "script_order"); _script->addColumn(tr("Enabled"),_ynColumn, Qt::AlignCenter,true, "script_enabled"); _script->addColumn(tr("Package"),_ynColumn, Qt::AlignCenter,false,"nspname"); _commands->addColumn(tr("Module"),_itemColumn, Qt::AlignCenter,true, "cmd_module"); _commands->addColumn(tr("Menu Label"), -1, Qt::AlignLeft, true, "cmd_title"); _commands->addColumn(tr("Package"), _ynColumn, Qt::AlignCenter,false,"nspname"); _package->populate("SELECT pkghead_id, pkghead_name, pkghead_name " "FROM pkghead " "ORDER BY pkghead_name;"); _package->setEnabled(package::userHasPriv(cEdit)); _uiformid = -1; _changed = false; _pkgheadidOrig = -1; _source = QString::null; } uiform::~uiform() { // no need to delete child widgets, Qt does it all for us } void uiform::languageChange() { retranslateUi(this); } enum SetResponse uiform::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") setMode(cNew); else if (param.toString() == "edit") setMode(cEdit); else if (param.toString() == "view") setMode(cView); } // follow setMode because populate() might change it param = pParams.value("uiform_id", &valid); if (valid) { _uiformid = param.toInt(); populate(); } return NoError; } void uiform::setMode(const int pmode) { switch (pmode) { case cNew: case cEdit: _name->setEnabled(true); _grade->setEnabled(true); _notes->setReadOnly(false); _import->setEnabled(true); _enabled->setEnabled(true); _close->setText(tr("&Cancel")); _save->show(); break; case cView: default: _name->setEnabled(false); _grade->setEnabled(false); _notes->setReadOnly(true); _import->setEnabled(false); _enabled->setEnabled(false); _close->setText(tr("&Close")); _save->hide(); break; } _mode = pmode; } void uiform::close() { if (cView != _mode && changed()) { switch (QMessageBox::question(this, tr("Save first?"), tr("The screen appears to have changed. Do you " "want to save your changes?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes)) { case QMessageBox::Cancel: return; case QMessageBox::No: break; case QMessageBox::Yes: default: sSave(); return; } } XWidget::close(); } void uiform::sSave() { XSqlQuery uiformSave; if (_name->text().isEmpty()) { QMessageBox::warning( this, tr("UI Form Name is Invalid"), tr("

    You must enter a valid name for this UI Form.") ); _name->setFocus(); return; } if (_source.length() == 0) { QMessageBox::warning( this, tr("UI Form Source is Empty"), tr("

    You must enter some source for this UI Form.") ); return; } if (_mode == cNew && _uiformid == -1) { uiformSave.exec("SELECT NEXTVAL('uiform_uiform_id_seq') AS _uiform_id"); if (uiformSave.first()) _uiformid = uiformSave.value("_uiform_id").toInt(); else if (uiformSave.lastError().type() != QSqlError::NoError) { systemError(this, uiformSave.lastError().databaseText(), __FILE__, __LINE__); return; } uiformSave.prepare( "INSERT INTO uiform " "(uiform_id, uiform_name, uiform_notes, uiform_order, uiform_enabled, uiform_source) " "VALUES " "(:uiform_id, :uiform_name, :uiform_notes, :uiform_order, :uiform_enabled, :uiform_source);" ); } else if (_mode != cView) uiformSave.prepare( "UPDATE uiform " "SET uiform_name=:uiform_name, uiform_notes=:uiform_notes," " uiform_order=:uiform_order, uiform_enabled=:uiform_enabled," " uiform_source=:uiform_source " "WHERE (uiform_id=:uiform_id);" ); uiformSave.bindValue(":uiform_id", _uiformid); uiformSave.bindValue(":uiform_name", _name->text()); uiformSave.bindValue(":uiform_order", _grade->value()); uiformSave.bindValue(":uiform_enabled", QVariant(_enabled->isChecked())); uiformSave.bindValue(":uiform_source", _source); uiformSave.bindValue(":uiform_notes", _notes->text()); uiformSave.exec(); if (uiformSave.lastError().type() != QSqlError::NoError) { systemError(this, uiformSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (_package->id() != _pkgheadidOrig && QMessageBox::question(this, tr("Move to different package?"), tr("Do you want to move this screen " "to the %1 package?").arg(_package->code()), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { uiformSave.prepare("SELECT moveuiform(:formid, :oldpkgid," " :newpkgid) AS result;"); uiformSave.bindValue(":formid", _uiformid); uiformSave.bindValue(":oldpkgid", _pkgheadidOrig); uiformSave.bindValue(":newpkgid", _package->id()); uiformSave.exec(); if (uiformSave.first()) { int result = uiformSave.value("result").toInt(); if (result >= 0) _pkgheadidOrig = _package->id(); else { systemError(this, tr("

    The screen was saved to its original location but " "could not be moved: %1") .arg(storedProcErrorLookup("moveuiform", result)), __FILE__, __LINE__); } } else if (uiformSave.lastError().type() != QSqlError::NoError) { systemError(this, tr("

    The screen was saved to its original location but " "could not be moved:

    %1
    ") .arg(uiformSave.lastError().databaseText()), __FILE__, __LINE__); } } _changed = false; close(); } void uiform::populate() { XSqlQuery uiformpopulate; uiformpopulate.prepare( "SELECT uiform.*, COALESCE(pkghead_id, -1) AS pkghead_id," " COALESCE(pkghead_indev,true) AS editable " " FROM uiform, pg_class, pg_namespace " " LEFT OUTER JOIN pkghead ON (nspname=pkghead_name) " " WHERE ((uiform.tableoid=pg_class.oid)" " AND (relnamespace=pg_namespace.oid) " " AND (uiform_id=:uiform_id));" ); uiformpopulate.bindValue(":uiform_id", _uiformid); uiformpopulate.exec(); if (uiformpopulate.first()) { _name->setText(uiformpopulate.value("uiform_name").toString()); _grade->setValue(uiformpopulate.value("uiform_order").toInt()); _enabled->setChecked(uiformpopulate.value("uiform_enabled").toBool()); _source = uiformpopulate.value("uiform_source").toString(); _notes->setText(uiformpopulate.value("uiform_notes").toString()); _pkgheadidOrig = uiformpopulate.value("pkghead_id").toInt(); _package->setId(_pkgheadidOrig); if (!uiformpopulate.value("editable").toBool()) setMode(cView); sFillList(); } else if (uiformpopulate.lastError().type() != QSqlError::NoError) { systemError(this, uiformpopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void uiform::sImport() { QSettings settings("xTuple.com", "xTupleDesigner"); QString path = settings.value("LastDirectory").toString(); QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), path, tr("UI (*.ui)")); if(filename.isNull()) return; QFile file(filename); if(!file.open(QIODevice::ReadOnly | QIODevice::Text)) { QMessageBox::critical(this, tr("Could not import file"), file.errorString()); return; } QTextStream ts(&file); _source=ts.readAll(); file.close(); _changed = true; QFileInfo fi(filename); settings.setValue("LastDirectory", fi.path()); } void uiform::sEdit() { static bool xdinit = false; QWidget *ui; QSize size; if(!xdinit) { QDesignerComponents::initializeResources(); xdinit = true; } xTupleDesigner *designer = new xTupleDesigner(this, "xTupleDesigner", Qt::Window); designer->setFormEnabled(_enabled->isChecked()); designer->setFormId(_uiformid); designer->setOrder(_grade->value()); if (_source.isEmpty()) designer->setSource(new QFile(":newForm.ui")); else { designer->setSource(new QBuffer(new QByteArray(_source.toUtf8()), this)); // Create the form independently, get size, then apply size to widget in designer QByteArray ba; ba.append(_source.toUtf8()); QBuffer uiFile(&ba); XUiLoader loader; ui = loader.load(&uiFile); if (ui) size = ui->size(); else { systemError(this, tr("Could not load .ui (%1)").arg(uiFile.errorString())); return; } } connect(designer, SIGNAL(formEnabledChanged(bool)),_enabled,SLOT(setChecked(bool))); connect(designer, SIGNAL(formIdChanged(int)), this, SLOT(setFormId(int))); connect(designer, SIGNAL(notesChanged(QString)), _notes, SLOT(setText(QString))); connect(designer, SIGNAL(sourceChanged(QString)), this, SLOT(setSource(QString))); omfgThis->handleNewWindow(designer); // Set to default UI size ui = designer->findChild(_name->text()); if (ui) { designer->resize(size); // Make adjustments for margins size.setHeight(size.height()+(designer->height()-ui->height())); size.setWidth(size.width()+(designer->width()-ui->width())); designer->resize(size); } } void uiform::sExport() { QSettings settings("xTuple.com", "xTupleDesigner"); QString path = settings.value("LastDirectory").toString(); QString filename = QFileDialog::getSaveFileName( this, tr("Save File"), path, tr("UI (*.ui)")); if(filename.isNull()) return; (void)saveFile(_source, filename); QFileInfo fi(filename); settings.setValue("LastDirectory", fi.path()); } bool uiform::saveFile(const QString &source, QString &filename) { QFileInfo fi(filename); if(fi.suffix().isEmpty()) filename += ".ui"; QFile file(filename); if(!file.open(QIODevice::WriteOnly)) { QMessageBox::critical(0, tr("Could not export file"), file.errorString()); return false; } QTextStream ts(&file); ts.setCodec("UTF-8"); ts << source; file.close(); return true; } void uiform::sScriptNew() { ParameterList params; params.append("mode", "new"); params.append("script_name", _name->text()); scriptEditor *newdlg = new scriptEditor(this, "", Qt::Window); newdlg->set(params); omfgThis->handleNewWindow(newdlg); connect(newdlg, SIGNAL(destroyed()), this, SLOT(sFillList())); } void uiform::sScriptEdit() { ParameterList params; params.append("mode", "edit"); params.append("script_id", _script->id()); scriptEditor *newdlg = new scriptEditor(this, "", Qt::Window); newdlg->set(params); omfgThis->handleNewWindow(newdlg); connect(newdlg, SIGNAL(destroyed()), this, SLOT(sFillList())); } void uiform::sScriptDelete() { XSqlQuery uiformScriptDelete; if ( QMessageBox::warning(this, tr("Delete Script?"), tr("

    Are you sure that you want to completely " "delete the selected script?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { uiformScriptDelete.prepare( "DELETE FROM script " "WHERE (script_id=:script_id);" ); uiformScriptDelete.bindValue(":script_id", _script->id()); uiformScriptDelete.exec(); } sFillList(); } void uiform::sCmdNew() { ParameterList params; params.append("mode", "new"); customCommand newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void uiform::sCmdEdit() { ParameterList params; params.append("mode", "edit"); params.append("cmd_id", _commands->id()); customCommand newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void uiform::sCmdDelete() { XSqlQuery uiformCmdDelete; if ( QMessageBox::warning(this, tr("Delete Command?"), tr("

    Are you sure that you want to completely " "delete the selected command?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { uiformCmdDelete.prepare("BEGIN; " "DELETE FROM cmdarg WHERE (cmdarg_cmd_id=:cmd_id); " "DELETE FROM cmd WHERE (cmd_id=:cmd_id); " "SELECT updateCustomPrivs(); " "COMMIT; "); uiformCmdDelete.bindValue(":cmd_id", _commands->id()); if(uiformCmdDelete.exec()) sFillList(); else systemError( this, tr("A System Error occurred at customCommands::%1") .arg(__LINE__) ); } } void uiform::sFillList() { XSqlQuery uiformFillList; uiformFillList.prepare( "SELECT script_id, script_name, script_notes," " script_order, script_enabled," " CASE WHEN nspname = 'public' THEN ''" " ELSE nspname END AS nspname" " FROM script, pg_class, pg_namespace" " WHERE ((script.tableoid=pg_class.oid)" " AND (relnamespace=pg_namespace.oid)" " AND (script_name=:name))" " ORDER BY script_name, script_order, script_id;" ); uiformFillList.bindValue(":name", _name->text()); uiformFillList.exec(); _script->populate(uiformFillList); if (uiformFillList.lastError().type() != QSqlError::NoError) { systemError(this, uiformFillList.lastError().databaseText(), __FILE__, __LINE__); return; } uiformFillList.prepare("SELECT DISTINCT cmd_id, cmd_module, cmd_title," " CASE WHEN nspname = 'public' THEN ''" " ELSE nspname END AS nspname" " FROM cmd JOIN cmdarg ON (cmdarg_cmd_id=cmd_id), pg_class, pg_namespace" " WHERE((cmd.tableoid=pg_class.oid)" " AND (relnamespace=pg_namespace.oid)" " AND (cmd_module IN ('Products','Inventory','Schedule','Purchase', " " 'Manufacture','CRM','Sales','Accounting','System'))" " AND (cmdarg_arg='uiform='||:name)) " " ORDER BY cmd_module, cmd_title;"); uiformFillList.bindValue(":name", _name->text()); uiformFillList.exec(); _commands->populate(uiformFillList); if (uiformFillList.lastError().type() != QSqlError::NoError) { systemError(this, uiformFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void uiform::setFormId(int p) { _uiformid = p; _changed = true; } void uiform::setSource(QString p) { _source = p; _changed = true; } bool uiform::changed() { return _changed; } qt-client-4.1.0/guiclient/uiform.h000066400000000000000000000045201217451700100170500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UIFORM_H #define UIFORM_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_uiform.h" class QDesignerFormWindowManagerInterface; class QDesignerFormWindowInterface; class QDesignerObjectInspectorInterface; class QDesignerPropertyEditorInterface; class QDesignerWidgetBoxInterface; class XWidget; class uiform : public XWidget, public Ui::uiform { Q_OBJECT public: uiform(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~uiform(); virtual bool changed(); static bool saveFile(const QString &source, QString &filename); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void populate(); virtual void close(); virtual void sCmdDelete(); virtual void sCmdEdit(); virtual void sCmdNew(); virtual void sEdit(); virtual void sExport(); virtual void sFillList(); virtual void sImport(); virtual void sSave(); virtual void sScriptDelete(); virtual void sScriptEdit(); virtual void sScriptNew(); virtual void setFormId(int); virtual void setSource(QString); protected slots: virtual void languageChange(); virtual void setMode(const int); private: bool _changed; QWidget *_designer; QDesignerFormWindowManagerInterface *_designerwm; XWidget *_editor; QDesignerFormWindowInterface *_formwindow; int _mode; QDesignerObjectInspectorInterface *_objinsp; int _pkgheadidOrig; QDesignerPropertyEditorInterface *_propeditor; QWidget *_sloteditor; QString _source; int _uiformid; QDesignerWidgetBoxInterface *_widgetbox; }; #endif // UIFORM_H qt-client-4.1.0/guiclient/uiform.ui000066400000000000000000000343041217451700100172410ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. uiform 0 0 490 391 Screen Na&me: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name No&tes: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _notes &Grade: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _grade 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Package: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _package true [ Not in a Package ] 999 Qt::Horizontal 40 20 &Enabled 0 5 &Save &Cancel Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Horizontal 40 20 Edit &Import &Export 0 1 0 Scripts 0 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 77 92 Commands 0 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XComboBox QComboBox

    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _name _package _notes _grade _enabled _edit _import _export tabWidget _script _scriptNew _scriptEdit _scriptDelete _commands _cmdEdit _cmdNew _cmdDelete _close _close clicked() uiform close() 423 32 20 20 _script valid(bool) _scriptEdit setEnabled(bool) 383 229 443 233 _script valid(bool) _scriptDelete setEnabled(bool) 382 254 413 256 _script itemSelected(int) _scriptEdit animateClick() 376 216 416 218 _commands valid(bool) _cmdEdit setEnabled(bool) 312 228 445 226 _commands valid(bool) _cmdDelete setEnabled(bool) 331 267 439 253 _commands itemSelected(int) _cmdEdit animateClick() 379 202 435 220 qt-client-4.1.0/guiclient/uiforms.cpp000066400000000000000000000121161217451700100175660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "uiforms.h" #include #include #include #include #include #include "errorReporter.h" #include "guiclient.h" #include "uiform.h" #include "xmainwindow.h" #include "xuiloader.h" #define DEBUG false uiforms::uiforms(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_byPackage, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_test, SIGNAL(clicked()), this, SLOT(sTest())); connect(_uiform, SIGNAL(newId(int)), this, SLOT(sHandleButtons())); _uiform->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "uiform_name"); _uiform->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "uiform_notes"); _uiform->addColumn(tr("Grade"), _ynColumn, Qt::AlignCenter,true, "uiform_order"); _uiform->addColumn(tr("Enabled"), _ynColumn, Qt::AlignCenter,true, "uiform_enabled"); _uiform->addColumn(tr("Package"),_itemColumn, Qt::AlignLeft, true, "pkgname"); sFillList(); } uiforms::~uiforms() { // no need to delete child widgets, Qt does it all for us } void uiforms::languageChange() { retranslateUi(this); } void uiforms::sNew() { ParameterList params; params.append("mode", "new"); uiform *newdlg = new uiform(this, ""); newdlg->set(params); omfgThis->handleNewWindow(newdlg); connect(newdlg, SIGNAL(destroyed(QObject*)), this, SLOT(sFillList())); } void uiforms::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("uiform_id", _uiform->id()); uiform *newdlg = new uiform(this, ""); newdlg->set(params); omfgThis->handleNewWindow(newdlg); connect(newdlg, SIGNAL(destroyed(QObject*)), this, SLOT(sFillList())); } void uiforms::sDelete() { if (QMessageBox::question(this, tr("Really delete?"), tr("Are you sure you want to delete this screen?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM uiform WHERE (uiform_id=:uiform_id);" ); delq.bindValue(":uiform_id", _uiform->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Screen"), delq, __FILE__, __LINE__)) return; sFillList(); } bool uiforms::setParams(ParameterList ¶ms) { if (_byPackage->isChecked()) params.append("byPackage"); return true; } void uiforms::sFillList() { QString errmsg; bool ok; MetaSQLQuery getm = MQLUtil::mqlLoad("uiforms", "detail", errmsg, &ok); if (! ok) { ErrorReporter::error(QtCriticalMsg, this, tr("Getting Screens"), errmsg, __FILE__, __LINE__); return; } ParameterList getp; if (! setParams(getp)) return; XSqlQuery getq = getm.toQuery(getp); _uiform->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Screens"), getq, __FILE__, __LINE__)) return; } void uiforms::sTest() { XSqlQuery getq; getq.prepare("SELECT *" " FROM uiform " " WHERE(uiform_id=:uiform_id);"); getq.bindValue(":uiform_id", _uiform->id()); getq.exec(); if (getq.first()) ; // everything's OK else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Form"), getq, __FILE__, __LINE__)) return; else return; XMainWindow * wnd = new XMainWindow(); wnd->setObjectName(getq.value("uiform_name").toString()); XUiLoader loader; QByteArray ba = getq.value("uiform_source").toString().toUtf8(); if (DEBUG) qDebug("about to load a uiFile with %s", ba.constData()); QBuffer uiFile(&ba); if(!uiFile.open(QIODevice::ReadOnly)) { QMessageBox::critical(this, tr("Could not load file"), tr("There was an error loading the UI Form from the database.")); return; } QWidget *ui = loader.load(&uiFile); if (ui) { QSize size = ui->size(); wnd->setWindowTitle(ui->windowTitle()); wnd->setCentralWidget(ui); omfgThis->handleNewWindow(wnd); wnd->resize(size); } else QMessageBox::critical(this, tr("Could not load file"), tr("

    Could not interpret the UI Form data " "as a UI definition.")); uiFile.close(); } void uiforms::sHandleButtons() { if (_uiform->id() < 0) { _delete->setEnabled(false); _edit->setEnabled(false); _test->setEnabled(false); } } qt-client-4.1.0/guiclient/uiforms.h000066400000000000000000000017711217451700100172400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UIFORMS_H #define UIFORMS_H #include "xwidget.h" #include "ui_uiforms.h" class uiforms : public XWidget, public Ui::uiforms { Q_OBJECT public: uiforms(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~uiforms(); public slots: virtual bool setParams(ParameterList ¶ms); virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sNew(); virtual void sTest(); protected slots: virtual void languageChange(); }; #endif // UIFORMS_H qt-client-4.1.0/guiclient/uiforms.ui000066400000000000000000000147341217451700100174310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. uiforms 0 0 432 359 List Screens Screens: Qt::Horizontal 40 20 Organize By Package true 0 0 &Close &New false &Edit Qt::Vertical QSizePolicy::Fixed 20 10 false &Delete Qt::Vertical QSizePolicy::Fixed 20 10 false &Test Qt::Vertical QSizePolicy::Expanding 20 20 XCheckBox QCheckBox

    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _uiform _close _uiform valid(bool) _delete setEnabled(bool) 26 44 370 113 _uiform itemSelected(int) _edit animateClick() 26 44 370 86 _uiform valid(bool) _edit setEnabled(bool) 26 44 370 86 _close clicked() uiforms close() 369 26 20 20 _uiform valid(bool) _test setEnabled(bool) 269 131 415 137 qt-client-4.1.0/guiclient/unappliedAPCreditMemos.cpp000066400000000000000000000135361217451700100224470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "unappliedAPCreditMemos.h" #include #include #include #include #include #include "applyAPCreditMemo.h" #include "apOpenItem.h" unappliedAPCreditMemos::unappliedAPCreditMemos(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_apply, SIGNAL(clicked()), this, SLOT(sApply())); _new->setEnabled(_privileges->check("MaintainAPMemos")); connect(_apopen, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _apopen->addColumn( tr("Doc. #"), _itemColumn, Qt::AlignLeft, true, "apopen_docnumber" ); _apopen->addColumn( tr("Vendor"), -1, Qt::AlignLeft, true, "vendor" ); _apopen->addColumn( tr("Amount"), _moneyColumn, Qt::AlignRight, true, "apopen_amount" ); _apopen->addColumn( tr("Amount (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_amount" ); _apopen->addColumn( tr("Applied"), _moneyColumn, Qt::AlignRight, true, "apopen_paid" ); _apopen->addColumn( tr("Applied (%1)").arg(CurrDisplay::baseCurrAbbr()), _moneyColumn, Qt::AlignRight, false, "base_applied" ); _apopen->addColumn( tr("Balance"), _moneyColumn, Qt::AlignRight, true, "balance" ); _apopen->addColumn( tr("Currency"), _currencyColumn, Qt::AlignCenter, true, "currAbbr" ); _apopen->addColumn( tr("Balance (%1)").arg(CurrDisplay::baseCurrAbbr()), _bigMoneyColumn, Qt::AlignRight, true, "basebalance"); if (omfgThis->singleCurrency()) _apopen->hideColumn("currAbbr"); if (_privileges->check("ApplyAPMemos")) connect(_apopen, SIGNAL(valid(bool)), _apply, SLOT(setEnabled(bool))); connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sFillList())); sFillList(); } unappliedAPCreditMemos::~unappliedAPCreditMemos() { // no need to delete child widgets, Qt does it all for us } void unappliedAPCreditMemos::languageChange() { retranslateUi(this); } bool unappliedAPCreditMemos::setParams(ParameterList ¶ms) { _vendorgroup->appendValue(params); return true; } void unappliedAPCreditMemos::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("UnappliedAPCreditMemos", params); if (report.isValid()) report.print(); else report.reportError(this); } void unappliedAPCreditMemos::sNew() { ParameterList params; params.append("mode", "new"); params.append("docType", "creditMemo"); if (_vendorgroup->isSelectedVend()) params.append("vend_id", _vendorgroup->vendId()); apOpenItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void unappliedAPCreditMemos::sView() { ParameterList params; params.append("mode", "view"); params.append("apopen_id", _apopen->id()); apOpenItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void unappliedAPCreditMemos::sFillList() { XSqlQuery unappliedFillList; MetaSQLQuery mql( "SELECT apopen_id, apopen_docnumber," " (vend_number || '-' || vend_name) AS vendor," " apopen_amount, (apopen_amount / apopen_curr_rate) AS base_amount, " " apopen_paid, (apopen_paid / apopen_curr_rate) AS base_applied, " " (apopen_amount - apopen_paid) AS balance," " (apopen_amount - apopen_paid) / apopen_curr_rate AS basebalance," " currConcat(apopen_curr_id) AS currAbbr," " 'curr' AS apopen_amount_xtnumericrole," " 'curr' AS apopen_paid_xtnumericrole," " 'curr' AS balance_xtnumericrole," " 'curr' AS basebalance_xtnumericrole," " 'curr' AS base_amount_xtnumericrole," " 'curr' AS base_applied_xtnumericrole," " 0 AS basebalance_xttotalrole, " " 0 AS base_amount_xttotalrole, " " 0 AS base_applied_xttotalrole " "FROM apopen, vendinfo " "WHERE ( (apopen_doctype='C')" " AND (apopen_open)" " AND (apopen_vend_id=vend_id)" "" " AND (vend_id=)" "" " AND (vend_vendtype_id=)" "" " AND (vend_vendtype_id IN (SELECT vendtype_id" " FROM vendtype" " WHERE (vendtype_code ~ )))" "" ") " "ORDER BY apopen_docnumber;" ); ParameterList params; if (! setParams(params)) return; unappliedFillList = mql.toQuery(params); _apopen->populate(unappliedFillList); if (unappliedFillList.lastError().type() != QSqlError::NoError) { systemError(this, unappliedFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void unappliedAPCreditMemos::sApply() { ParameterList params; params.append("apopen_id", _apopen->id()); applyAPCreditMemo newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } qt-client-4.1.0/guiclient/unappliedAPCreditMemos.h000066400000000000000000000021731217451700100221070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNAPPLIEDAPCREDITMEMOS_H #define UNAPPLIEDAPCREDITMEMOS_H #include "guiclient.h" #include "xwidget.h" #include "ui_unappliedAPCreditMemos.h" class ParameterList; class unappliedAPCreditMemos : public XWidget, public Ui::unappliedAPCreditMemos { Q_OBJECT public: unappliedAPCreditMemos(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~unappliedAPCreditMemos(); virtual bool setParams(ParameterList ¶ms); public slots: virtual void sPrint(); virtual void sNew(); virtual void sView(); virtual void sFillList(); virtual void sApply(); protected slots: virtual void languageChange(); }; #endif // UNAPPLIEDAPCREDITMEMOS_H qt-client-4.1.0/guiclient/unappliedAPCreditMemos.ui000066400000000000000000000172631217451700100223030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unappliedAPCreditMemos 0 0 800 600 List Unapplied A/P Credit Memos 12 12 Qt::Vertical 20 0 Qt::Horizontal 40 20 0 &Close &Print Qt::Vertical 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 0 Unapplied Accounts Payable Credit Memos: 0 0 0 true &New false &View false &Apply Qt::Vertical QSizePolicy::Expanding 20 174 VendorGroup QWidget
    vendorgroup.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _apopen _new _view _apply _print _close _close clicked() unappliedAPCreditMemos close() 20 20 20 20 _apopen valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/unappliedARCreditMemos.cpp000066400000000000000000000135701217451700100224470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "unappliedARCreditMemos.h" #include #include #include #include #include "applyARCreditMemo.h" #include "arOpenItem.h" #include "errorReporter.h" unappliedARCreditMemos::unappliedARCreditMemos(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_aropen, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_aropen, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_apply, SIGNAL(clicked()), this, SLOT(sApply())); _new->setEnabled(_privileges->check("MaintainARMemos")); connect(_aropen, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); _aropen->addColumn( tr("Doc. #"), _itemColumn, Qt::AlignCenter, true, "aropen_docnumber" ); _aropen->addColumn( tr("Cust. #"), _orderColumn, Qt::AlignLeft, true, "cust_number" ); _aropen->addColumn( tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); _aropen->addColumn( tr("Amount"), _moneyColumn, Qt::AlignRight, true, "aropen_amount" ); _aropen->addColumn( tr("Applied"), _moneyColumn, Qt::AlignRight, true, "applied" ); _aropen->addColumn( tr("Balance"), _moneyColumn, Qt::AlignRight, true, "balance" ); _aropen->addColumn( tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currAbbr" ); if (omfgThis->singleCurrency()) _aropen->hideColumn(5); if (_privileges->check("ApplyARMemos")) connect(_aropen, SIGNAL(valid(bool)), _apply, SLOT(setEnabled(bool))); sFillList(); } /* * Destroys the object and frees any allocated resources */ unappliedARCreditMemos::~unappliedARCreditMemos() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void unappliedARCreditMemos::languageChange() { retranslateUi(this); } void unappliedARCreditMemos::sPrint() { ParameterList params; orReport report("UnappliedARCreditMemos", params); if (report.isValid()) report.print(); else report.reportError(this); } void unappliedARCreditMemos::sNew() { ParameterList params; params.append("mode", "new"); params.append("docType", "creditMemo"); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void unappliedARCreditMemos::sView() { ParameterList params; params.append("mode", "view"); params.append("aropen_id", _aropen->id()); arOpenItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void unappliedARCreditMemos::sPopulateMenu( QMenu * ) { } void unappliedARCreditMemos::sFillList() { XSqlQuery aq; aq.prepare("SELECT aropen_id, aropen_docnumber," " cust_number, cust_name," " aropen_amount," " (aropen_paid + COALESCE(prepared,0.0) + COALESCE(cashapplied,0.0)) AS applied," " (aropen_amount - aropen_paid - COALESCE(prepared,0.0) - COALESCE(cashapplied,0.0)) AS balance, " " currConcat(aropen_curr_id) AS currAbbr," " 'curr' AS aropen_amount_xtnumericrole," " 'curr' AS applied_xtnumericrole," " 'curr' AS balance_xtnumericrole " "FROM aropen " " LEFT OUTER JOIN (SELECT aropen_id AS prepared_aropen_id," " SUM(checkitem_amount + checkitem_discount) AS prepared" " FROM checkhead JOIN checkitem ON (checkitem_checkhead_id=checkhead_id)" " JOIN aropen ON (checkitem_aropen_id=aropen_id)" " WHERE ((NOT checkhead_posted)" " AND (NOT checkhead_void))" " GROUP BY aropen_id ) AS sub1" " ON (prepared_aropen_id=aropen_id)" " LEFT OUTER JOIN (SELECT aropen_id AS cash_aropen_id," " SUM(cashrcptitem_amount + cashrcptitem_discount) * -1.0 AS cashapplied" " FROM cashrcpt JOIN cashrcptitem ON (cashrcptitem_cashrcpt_id=cashrcpt_id)" " JOIN aropen ON (cashrcptitem_aropen_id=aropen_id)" " WHERE (NOT cashrcpt_posted)" " GROUP BY aropen_id ) AS sub2" " ON (cash_aropen_id=aropen_id)" " JOIN custinfo ON (aropen_cust_id=cust_id)" "WHERE ( (aropen_doctype IN ('C', 'R'))" " AND (aropen_open)" " AND ((aropen_amount - aropen_paid - COALESCE(prepared,0.0) - COALESCE(cashapplied,0.0)) > 0.0)" " ) " "ORDER BY aropen_docnumber;" ); aq.exec(); _aropen->populate(aq); ErrorReporter::error(QtCriticalMsg, this, tr("Getting Credit Memos"), aq, __FILE__, __LINE__); } void unappliedARCreditMemos::sApply() { ParameterList params; params.append("aropen_id", _aropen->id()); applyARCreditMemo newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } qt-client-4.1.0/guiclient/unappliedARCreditMemos.h000066400000000000000000000021341217451700100221060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNAPPLIEDARCREDITMEMOS_H #define UNAPPLIEDARCREDITMEMOS_H #include "guiclient.h" #include "xwidget.h" #include "ui_unappliedARCreditMemos.h" class unappliedARCreditMemos : public XWidget, public Ui::unappliedARCreditMemos { Q_OBJECT public: unappliedARCreditMemos(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~unappliedARCreditMemos(); public slots: virtual void sPrint(); virtual void sNew(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sFillList(); virtual void sApply(); protected slots: virtual void languageChange(); }; #endif // UNAPPLIEDARCREDITMEMOS_H qt-client-4.1.0/guiclient/unappliedARCreditMemos.ui000066400000000000000000000136751217451700100223100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unappliedARCreditMemos 0 0 484 397 List Unapplied A/R Credit Memos 0 0 Unapplied A/R Credit Memos: 7 7 0 0 0 0 5 0 &Close &Print 0 0 true &New false &View false &Apply 20 174 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _aropen _new _view _apply _print _close _close clicked() unappliedARCreditMemos close() _aropen valid(bool) _view setEnabled(bool)
    qt-client-4.1.0/guiclient/uninvoicedShipments.cpp000066400000000000000000000066631217451700100221520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "uninvoicedShipments.h" #include #include #include #include #include #include #include #include #include "mqlutil.h" #include "selectOrderForBilling.h" uninvoicedShipments::uninvoicedShipments(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_showUnselected, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_shipitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); _shipitem->setRootIsDecorated(TRUE); _shipitem->addColumn(tr("Order/Line #"), _itemColumn, Qt::AlignRight, true, "orderline" ); _shipitem->addColumn(tr("Cust./Item Number"), _itemColumn, Qt::AlignLeft, true, "custitem" ); _shipitem->addColumn(tr("Cust. Name/Description"), -1, Qt::AlignLeft, true, "custdescrip" ); _shipitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name" ); _shipitem->addColumn(tr("Shipped"), _qtyColumn, Qt::AlignRight, true, "shipped" ); _shipitem->addColumn(tr("Selected"), _qtyColumn, Qt::AlignRight, true, "selected" ); connect(omfgThis, SIGNAL(billingSelectionUpdated(int, int)), this, SLOT(sFillList())); sFillList(); } uninvoicedShipments::~uninvoicedShipments() { // no need to delete child widgets, Qt does it all for us } void uninvoicedShipments::languageChange() { retranslateUi(this); } void uninvoicedShipments::sPrint() { ParameterList params; _warehouse->appendValue(params); if (_showUnselected->isChecked()) params.append("showUnselected"); orReport report("UninvoicedShipments", params); if (report.isValid()) report.print(); else report.reportError(this); } void uninvoicedShipments::sPopulateMenu(QMenu *menu) { QAction *menuItem; menuItem = menu->addAction(tr("Select This Order for Billing..."), this, SLOT(sSelectForBilling())); menuItem->setEnabled(_privileges->check("SelectBilling")); } void uninvoicedShipments::sSelectForBilling() { ParameterList params; params.append("mode", "edit"); params.append("sohead_id", _shipitem->id()); selectOrderForBilling *newdlg = new selectOrderForBilling(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void uninvoicedShipments::sFillList() { MetaSQLQuery mql = mqlLoad("uninvoicedShipments", "detail"); ParameterList params; if (_warehouse->isSelected()) _warehouse->appendValue(params); if (_showUnselected->isChecked()) params.append("showUnselected", true); XSqlQuery qry = mql.toQuery(params); _shipitem->populate(qry, true); if (qry.lastError().type() != QSqlError::NoError) { systemError(this, qry.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/uninvoicedShipments.h000066400000000000000000000020421217451700100216020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNINVOICEDSHIPMENTS_H #define UNINVOICEDSHIPMENTS_H #include "guiclient.h" #include "xwidget.h" #include "ui_uninvoicedShipments.h" class uninvoicedShipments : public XWidget, public Ui::uninvoicedShipments { Q_OBJECT public: uninvoicedShipments(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~uninvoicedShipments(); public slots: virtual void sPrint(); virtual void sPopulateMenu( QMenu * menu ); virtual void sSelectForBilling(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // UNINVOICEDSHIPMENTS_H qt-client-4.1.0/guiclient/uninvoicedShipments.ui000066400000000000000000000127401217451700100217760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. uninvoicedShipments 0 0 800 600 Uninvoiced Shipments 12 12 false Only Show Unselected Shipments Qt::Horizontal QSizePolicy::Expanding 106 20 5 &Close &Print Qt::Vertical 20 40 0 1 QFrame::NoFrame QFrame::Raised 0 0 Uninvoiced Shipments: Qt::AlignVCenter WarehouseGroup QGroupBox
    warehousegroup.h
    XCheckBox QCheckBox
    xcheckbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _warehouse _showUnselected _shipitem _print _close _close clicked() uninvoicedShipments close() 20 20 20 20
    qt-client-4.1.0/guiclient/unpostedCreditMemos.cpp000066400000000000000000000262361217451700100221070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "unpostedCreditMemos.h" #include #include #include #include #include #include #include #include "creditMemo.h" #include "distributeInventory.h" #include "failedPostList.h" #include "getGLDistDate.h" #include "printCreditMemo.h" #include "storedProcErrorLookup.h" unpostedCreditMemos::unpostedCreditMemos(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_cmhead, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); _cmhead->addColumn(tr("C/M #"), _orderColumn, Qt::AlignLeft, true, "cmhead_number" ); _cmhead->addColumn(tr("Prnt'd"), _orderColumn, Qt::AlignCenter, true, "printed" ); _cmhead->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cmhead_billtoname" ); _cmhead->addColumn(tr("Memo Date"), _dateColumn, Qt::AlignCenter, true, "cmhead_docdate" ); _cmhead->addColumn(tr("Hold"), _whsColumn, Qt::AlignCenter, true, "cmhead_hold" ); _cmhead->addColumn(tr("G/L Dist Date"), _dateColumn, Qt::AlignCenter, true, "distdate" ); if (! _privileges->check("ChangeSOMemoPostDate")) _cmhead->hideColumn(5); if (_privileges->check("MaintainCreditMemos")) { connect(_cmhead, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_cmhead, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_cmhead, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_cmhead, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } if (_privileges->check("PrintCreditMemos")) connect(_cmhead, SIGNAL(valid(bool)), _print, SLOT(setEnabled(bool))); if (_privileges->check("PostARDocuments")) connect(_cmhead, SIGNAL(valid(bool)), _post, SLOT(setEnabled(bool))); connect(omfgThis, SIGNAL(creditMemosUpdated()), this, SLOT(sFillList())); sFillList(); } unpostedCreditMemos::~unpostedCreditMemos() { // no need to delete child widgets, Qt does it all for us } void unpostedCreditMemos::languageChange() { retranslateUi(this); } void unpostedCreditMemos::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainCreditMemos")); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainCreditMemos") || _privileges->check("ViewCreditMemos")); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost())); menuItem->setEnabled(_privileges->check("PostARDocuments")); } void unpostedCreditMemos::sNew() { ParameterList params; params.append("mode", "new"); creditMemo *newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void unpostedCreditMemos::sEdit() { if (!checkSitePrivs(_cmhead->id())) return; ParameterList params; params.append("mode", "edit"); params.append("cmhead_id", _cmhead->id()); creditMemo *newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void unpostedCreditMemos::sView() { if (!checkSitePrivs(_cmhead->id())) return; ParameterList params; params.append("mode", "view"); params.append("cmhead_id", _cmhead->id()); creditMemo *newdlg = new creditMemo(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void unpostedCreditMemos::sPrint() { QList selected = _cmhead->selectedItems(); QList triedToClosed; for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { ParameterList params; params.append("cmhead_id", ((XTreeWidgetItem*)(selected[i]))->id()); params.append("persistentPrint"); printCreditMemo newdlg(this, "", TRUE); newdlg.set(params); if (!newdlg.isSetup()) { newdlg.exec(); newdlg.setSetup(TRUE); } } } omfgThis->sCreditMemosUpdated(); } void unpostedCreditMemos::sPost() { XSqlQuery unpostedPost; bool changeDate = false; QDate newDate = QDate::currentDate(); if (_privileges->check("ChangeSOMemoPostDate")) { getGLDistDate newdlg(this, "", TRUE); newdlg.sSetDefaultLit(tr("Credit Memo Date")); if (newdlg.exec() == XDialog::Accepted) { newDate = newdlg.date(); changeDate = (newDate.isValid()); } else return; } XSqlQuery setDate; setDate.prepare("UPDATE cmhead SET cmhead_gldistdate=:distdate " "WHERE cmhead_id=:cmhead_id;"); QList selected = _cmhead->selectedItems(); QList triedToClosed; for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); if (changeDate) { setDate.bindValue(":distdate", newDate); setDate.bindValue(":cmhead_id", id); setDate.exec(); if (setDate.lastError().type() != QSqlError::NoError) { systemError(this, setDate.lastError().databaseText(), __FILE__, __LINE__); } } } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery postq; postq.prepare("SELECT postCreditMemo(:cmhead_id, 0) AS result;"); bool tryagain = false; do { for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); XSqlQuery tx; tx.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations postq.bindValue(":cmhead_id", id); postq.exec(); if (postq.first()) { int result = postq.value("result").toInt(); if (result < 0) { rollback.exec(); systemError( this, storedProcErrorLookup("postCreditMemo", result), __FILE__, __LINE__); return; } else { if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Post Credit Memo"), tr("Transaction Canceled") ); return; } unpostedPost.exec("COMMIT;"); } } // contains() string is hard-coded in stored procedure else if (postq.lastError().databaseText().contains("post to closed period")) { rollback.exec(); if (changeDate) { triedToClosed = selected; break; } else triedToClosed.append(selected[i]); } else if (postq.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("A System Error occurred posting Credit Memo#%1.\n%2") .arg(selected[i]->text(0)) .arg(postq.lastError().databaseText()), __FILE__, __LINE__); } } if (triedToClosed.size() > 0) { failedPostList newdlg(this, "", true); newdlg.sSetList(triedToClosed, _cmhead->headerItem(), _cmhead->header()); tryagain = (newdlg.exec() == XDialog::Accepted); selected = triedToClosed; triedToClosed.clear(); } } } while (tryagain); omfgThis->sCreditMemosUpdated(); } void unpostedCreditMemos::sDelete() { if (QMessageBox::question(this, tr("Delete Selected Credit Memos?"), tr("

    Are you sure that you want to delete the " "selected Credit Memos?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("SELECT deleteCreditMemo(:cmhead_id) AS result;"); QList selected = _cmhead->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { delq.bindValue(":cmhead_id", ((XTreeWidgetItem*)(selected[i]))->id()); delq.exec(); if (delq.first()) { if (! delq.value("result").toBool()) systemError(this, tr("Could not delete Credit Memo."), __FILE__, __LINE__); } else if (delq.lastError().type() != QSqlError::NoError) systemError(this, tr("Error deleting Credit Memo %1\n").arg(selected[i]->text(0)) + delq.lastError().databaseText(), __FILE__, __LINE__); } } omfgThis->sCreditMemosUpdated(); } } void unpostedCreditMemos::sFillList() { _cmhead->clear(); _cmhead->populate( "SELECT cmhead_id, cmhead_number," " COALESCE(cmhead_printed, FALSE) AS printed," " cmhead_billtoname, cmhead_docdate, cmhead_hold," " COALESCE(cmhead_gldistdate, cmhead_docdate) AS distdate " "FROM cmhead " "WHERE ( (NOT cmhead_posted) " " AND ( ((SELECT COUNT(*)" " FROM cmitem, itemsite, site()" " WHERE ( (cmitem_cmhead_id=cmhead_id)" " AND (itemsite_id=cmitem_itemsite_id)" " AND (warehous_id=itemsite_warehous_id) )) > 0) OR" " ((SELECT COUNT(*)" " FROM cmitem" " WHERE (cmitem_cmhead_id=cmhead_id)) = 0) ) ) " "ORDER BY cmhead_number;" ); } bool unpostedCreditMemos::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkCreditMemoSitePrivs(:cmheadid) AS result;"); check.bindValue(":cmheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Credit Memo as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/unpostedCreditMemos.h000066400000000000000000000022561217451700100215500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNPOSTEDCREDITMEMOS_H #define UNPOSTEDCREDITMEMOS_H #include "guiclient.h" #include "xwidget.h" #include "ui_unpostedCreditMemos.h" class unpostedCreditMemos : public XWidget, public Ui::unpostedCreditMemos { Q_OBJECT public: unpostedCreditMemos(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~unpostedCreditMemos(); virtual bool checkSitePrivs(int orderid); public slots: virtual void sPopulateMenu(QMenu * menuThis); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPrint(); virtual void sPost(); virtual void sDelete(); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // UNPOSTEDCREDITMEMOS_H qt-client-4.1.0/guiclient/unpostedCreditMemos.ui000066400000000000000000000131131217451700100217300ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unpostedCreditMemos 0 0 540 415 List Unposted Credit Memos 0 0 Unposted Credit Memos: 7 7 0 0 QAbstractItemView::ExtendedSelection 0 5 &Close 0 0 true &New false &Edit false &View false &Print false &Post false &Delete Qt::Vertical QSizePolicy::Expanding 20 186 XTreeWidget QTreeWidget

    xtreewidget.h
    _cmhead _new _edit _view _print _delete _close _close clicked() unpostedCreditMemos close() 20 20 20 20 _cmhead valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/unpostedGLTransactions.cpp000066400000000000000000000174761217451700100225750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "unpostedGLTransactions.h" #include #include #include #include #include #include "voucher.h" #include "miscVoucher.h" #include "invoice.h" #include "purchaseOrder.h" #include "glTransactionDetail.h" unpostedGLTransactions::unpostedGLTransactions(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_gltrans, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); _gltrans->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "gltrans_date" ); _gltrans->addColumn(tr("Source"), _orderColumn, Qt::AlignCenter, true, "gltrans_source" ); _gltrans->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter, true, "gltrans_doctype" ); _gltrans->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "docnumber" ); _gltrans->addColumn(tr("Reference"), -1, Qt::AlignLeft, true, "reference" ); _gltrans->addColumn(tr("Account"), _itemColumn, Qt::AlignLeft, true, "account" ); _gltrans->addColumn(tr("Debit"), _moneyColumn, Qt::AlignRight, true, "debit" ); _gltrans->addColumn(tr("Credit"), _moneyColumn, Qt::AlignRight, true, "credit" ); _gltrans->addColumn(tr("Posted"), _ynColumn, Qt::AlignCenter, true, "gltrans_posted" ); _periodid = -1; } unpostedGLTransactions::~unpostedGLTransactions() { // no need to delete child widgets, Qt does it all for us } void unpostedGLTransactions::languageChange() { retranslateUi(this); } enum SetResponse unpostedGLTransactions::set(const ParameterList &pParams) { XSqlQuery unpostedet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("period_id", &valid); if (valid) { _periodid = param.toInt(); unpostedet.prepare( "SELECT period_name, period_start, period_end " "FROM period " "WHERE (period_id=:period_id);" ); unpostedet.bindValue(":period_id", _periodid); unpostedet.exec(); if (unpostedet.first()) { _period->setText(unpostedet.value("period_name").toString()); _dates->setStartDate(unpostedet.value("period_start").toDate()); _dates->setEndDate(unpostedet.value("period_end").toDate()); } } sFillList(); return NoError; } void unpostedGLTransactions::sPopulateMenu(QMenu * menuThis, QTreeWidgetItem* pItem) { menuThis->addAction(tr("View..."), this, SLOT(sViewTrans())); XTreeWidgetItem * item = (XTreeWidgetItem*)pItem; if(0 == item) return; if(item->text(2) == "VO") menuThis->addAction(tr("View Voucher..."), this, SLOT(sViewDocument())); else if(item->text(2) == "IN") menuThis->addAction(tr("View Invoice..."), this, SLOT(sViewDocument())); else if(item->text(2) == "PO") menuThis->addAction(tr("View Purchase Order..."), this, SLOT(sViewDocument())); } void unpostedGLTransactions::sPrint() { ParameterList params; params.append("period_id", _periodid); orReport report("UnpostedGLTransactions", params); if (report.isValid()) report.print(); else report.reportError(this); } void unpostedGLTransactions::sFillList() { XSqlQuery unpostedFillList; QString sql( "SELECT gltrans_id, formatDate(gltrans_date), gltrans_source, gltrans_doctype," " CASE WHEN(gltrans_docnumber='Misc.' AND invhist_docnumber IS NOT NULL) THEN" " (gltrans_docnumber || ' - ' || invhist_docnumber)" " ELSE gltrans_docnumber" " END AS docnumber," " firstLine(gltrans_notes) AS reference," " (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account," " CASE WHEN (gltrans_amount < 0) THEN ABS(gltrans_amount)" " ELSE 0" " END AS debit," " CASE WHEN (gltrans_amount > 0) THEN (gltrans_amount)" " ELSE 0" " END AS credit," " gltrans_posted, gltrans_username," " 'curr' AS debit_xtnumericrole," " 'curr' AS credit_xtnumericrole," " CASE WHEN (gltrans_amount < 0) THEN '' END AS credit_qtdisplayrole," " CASE WHEN (gltrans_amount >= 0) THEN '' END AS debit_qtdisplayrole " "FROM period, gltrans JOIN accnt ON (gltrans_accnt_id=accnt_id) " " LEFT OUTER JOIN invhist ON (gltrans_misc_id=invhist_id AND" " gltrans_docnumber='Misc.') " "WHERE ((NOT gltrans_posted) " " AND (NOT gltrans_deleted) " " AND (gltrans_date BETWEEN period_start AND period_end)" " AND (period_id=:period_id)) " "ORDER BY gltrans_created, gltrans_sequence, gltrans_amount;"); unpostedFillList.prepare(sql); unpostedFillList.bindValue(":period_id", _periodid); unpostedFillList.exec(); _gltrans->populate(unpostedFillList); if (unpostedFillList.lastError().type() != QSqlError::NoError) { systemError(this, unpostedFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void unpostedGLTransactions::sViewTrans() { ParameterList params; params.append("gltrans_id", _gltrans->id()); glTransactionDetail newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void unpostedGLTransactions::sViewDocument() { XSqlQuery unpostedViewDocument; QTreeWidgetItem * item = (XTreeWidgetItem*)_gltrans->currentItem(); if(0 == item) return; ParameterList params; if(item->text(2) == "VO") { unpostedViewDocument.prepare("SELECT vohead_id, vohead_misc" " FROM vohead" " WHERE (vohead_number=:vohead_number)"); unpostedViewDocument.bindValue(":vohead_number", item->text(3)); unpostedViewDocument.exec(); if(!unpostedViewDocument.first()) return; params.append("vohead_id", unpostedViewDocument.value("vohead_id").toInt()); params.append("mode", "view"); if(unpostedViewDocument.value("vohead_misc").toBool()) { miscVoucher *newdlg = new miscVoucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else { voucher *newdlg = new voucher(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } else if(item->text(2) == "IN") { unpostedViewDocument.prepare("SELECT invchead_id" " FROM invchead" " WHERE (invchead_invcnumber=:invchead_invcnumber)"); unpostedViewDocument.bindValue(":invchead_invcnumber", item->text(3)); unpostedViewDocument.exec(); if(!unpostedViewDocument.first()) return; invoice::viewInvoice(unpostedViewDocument.value("invchead_id").toInt()); } else if(item->text(2) == "PO") { unpostedViewDocument.prepare("SELECT pohead_id" " FROM pohead" " WHERE (pohead_number=:pohead_number)"); unpostedViewDocument.bindValue(":pohead_number", item->text(3)); unpostedViewDocument.exec(); if(!unpostedViewDocument.first()) return; params.append("pohead_id", unpostedViewDocument.value("pohead_id").toInt()); params.append("mode", "view"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } qt-client-4.1.0/guiclient/unpostedGLTransactions.h000066400000000000000000000023421217451700100222240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNPOSTEDGLTRANSACTIONS_H #define UNPOSTEDGLTRANSACTIONS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_unpostedGLTransactions.h" class unpostedGLTransactions : public XDialog, public Ui::unpostedGLTransactions { Q_OBJECT public: unpostedGLTransactions(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~unpostedGLTransactions(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*); virtual void sPrint(); virtual void sFillList(); virtual void sViewTrans(); virtual void sViewDocument(); protected slots: virtual void languageChange(); private: int _periodid; }; #endif // UNPOSTEDGLTRANSACTIONS_H qt-client-4.1.0/guiclient/unpostedGLTransactions.ui000066400000000000000000000145471217451700100224240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unpostedGLTransactions 0 0 679 275 Unposted G/L Transactions 5 5 0 6 0 5 0 5 Period Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Vertical 20 0 0 5 false Qt::StrongFocus Qt::Vertical 20 0 Qt::Horizontal 40 20 0 0 &Cancel Open Period true true &Print Qt::Vertical 20 0 The following G/L Transactions will be posted to the Trial Balance if you open this period: DateCluster QWidget
    datecluster.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _period _dates _gltrans _cancel _ok _print _cancel clicked() unpostedGLTransactions reject() 614 22 339 137 _ok clicked() unpostedGLTransactions accept() 614 54 339 137
    qt-client-4.1.0/guiclient/unpostedGlSeries.cpp000066400000000000000000000172641217451700100214120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "unpostedGlSeries.h" #include #include #include #include #include #include #include "failedPostList.h" #include "getGLDistDate.h" #include "glSeries.h" #include "storedProcErrorLookup.h" unpostedGlSeries::unpostedGlSeries(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_glseries, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(omfgThis, SIGNAL(glSeriesUpdated()), this, SLOT(sFillList())); _glseries->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "glseries_distdate" ); _glseries->addColumn(tr("Source"), _orderColumn, Qt::AlignCenter, true, "glseries_source" ); _glseries->addColumn(tr("Doc. Type"), _docTypeColumn, Qt::AlignCenter, true, "glseries_doctype" ); _glseries->addColumn(tr("Doc. #"), _orderColumn, Qt::AlignCenter, true, "glseries_docnumber" ); _glseries->addColumn(tr("Reference"), -1, Qt::AlignLeft, true, "glseries_notes" ); _glseries->addColumn(tr("Account"), -1, Qt::AlignLeft, true, "account" ); _glseries->addColumn(tr("Debit"), _moneyColumn, Qt::AlignRight, true, "debit" ); _glseries->addColumn(tr("Credit"), _moneyColumn, Qt::AlignRight, true, "credit" ); sFillList(); } unpostedGlSeries::~unpostedGlSeries() { // no need to delete child widgets, Qt does it all for us } void unpostedGlSeries::languageChange() { retranslateUi(this); } void unpostedGlSeries::sPrint() { orReport report("UnpostedGlSeries"); if (report.isValid()) report.print(); else report.reportError(this); } void unpostedGlSeries::sNew() { ParameterList params; params.append("mode", "new"); glSeries *newdlg = new glSeries(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void unpostedGlSeries::sEdit() { QListselected = _glseries->selectedItems(); removeDupAltIds(selected); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("mode", "edit"); params.append("glSequence", ((XTreeWidgetItem*)(selected[i]))->altId() ); glSeries *newdlg = new glSeries(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void unpostedGlSeries::sDelete() { XSqlQuery unpostedDelete; if (QMessageBox::question(this, tr("Cancel G/L Transactions?"), tr("

    Are you sure you want to delete these " "unposted G/L Transactions?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { unpostedDelete.prepare( "DELETE FROM glseries " "WHERE (glseries_sequence=:id);"); QListselected = _glseries->selectedItems(); removeDupAltIds(selected); for (int i = 0; i < selected.size(); i++) { unpostedDelete.bindValue(":id", ((XTreeWidgetItem*)(selected[i]))->altId() ); unpostedDelete.exec(); if (unpostedDelete.lastError().type() != QSqlError::NoError) { systemError(this, unpostedDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } omfgThis->sGlSeriesUpdated(); } } void unpostedGlSeries::sView() { QListselected = _glseries->selectedItems(); removeDupAltIds(selected); for (int i = 0; i < selected.size(); i++) { ParameterList params; params.append("mode", "view"); params.append("glSequence", ((XTreeWidgetItem*)(selected[i]))->altId() ); glSeries *newdlg = new glSeries(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } } void unpostedGlSeries::sPost() { QDate newDate = QDate::currentDate(); QListselected = _glseries->selectedItems(); removeDupAltIds(selected); QListtriedToClosed; XSqlQuery post; post.prepare("SELECT postGLSeriesNoSumm(:sequence) AS result;"); bool tryagain = false; do { for (int i = 0; i < selected.size(); i++) { int id = ((XTreeWidgetItem*)(selected[i]))->altId(); post.bindValue(":sequence", id); post.exec(); if (post.first()) { int result = post.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postGLSeriesNoSumm", result), __FILE__, __LINE__); continue; } } // contains() string is hard-coded in stored procedure else if (post.lastError().databaseText().contains("post to closed period")) { triedToClosed.append(selected[i]); } else if (post.lastError().type() != QSqlError::NoError) { systemError(this, post.lastError().databaseText(), __FILE__, __LINE__); } } // for each selected line if (triedToClosed.size() > 0) { failedPostList newdlg(this, "", true); newdlg.sSetList(triedToClosed, _glseries->headerItem(), _glseries->header()); tryagain = (newdlg.exec() == XDialog::Accepted); selected = triedToClosed; triedToClosed.clear(); } } while (tryagain); omfgThis->sGlSeriesUpdated(); } void unpostedGlSeries::sPopulateMenu(QMenu *pMenu) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit G/L Series..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("View G/L Series..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete G/L Series..."),this, SLOT(sDelete())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post G/L Series..."), this, SLOT(sPost())); pMenu->addSeparator(); } void unpostedGlSeries::sFillList() { XSqlQuery fillq; fillq.prepare("SELECT *, " " (formatGLAccount(glseries_accnt_id) || ' - ' || accnt_descrip) AS account," " CASE WHEN (glseries_amount < 0) THEN (glseries_amount * -1)" " ELSE 0 END AS debit," " CASE WHEN (glseries_amount >= 0) THEN (glseries_amount)" " ELSE 0 END AS credit," " 'curr' AS debit_xtnumericrole," " 'curr' AS credit_xtnumericrole," " CASE WHEN (glseries_amount < 0) THEN '' END AS credit_qtdisplayrole," " CASE WHEN (glseries_amount >= 0) THEN '' END AS debit_qtdisplayrole " "FROM glseries, accnt " "WHERE (glseries_accnt_id=accnt_id) " "ORDER BY glseries_distdate, glseries_sequence, glseries_amount;"); fillq.exec(); _glseries->populate(fillq, true); if (fillq.lastError().type() != QSqlError::NoError) { systemError(this, fillq.lastError().databaseText(), __FILE__, __LINE__); return; } } void unpostedGlSeries::removeDupAltIds(QList & list) { for (int i = 0; i < list.size(); i++) { for (int j = i + 1; j < list.size(); j++) { if (((XTreeWidgetItem*)(list[i]))->altId() == ((XTreeWidgetItem*)(list[j]))->altId()) list.removeAt(j); } } } qt-client-4.1.0/guiclient/unpostedGlSeries.h000066400000000000000000000022461217451700100210510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNPOSTEDGLSERIES_H #define UNPOSTEDGLSERIES_H #include "guiclient.h" #include "xwidget.h" #include "ui_unpostedGlSeries.h" class unpostedGlSeries : public XWidget, public Ui::unpostedGlSeries { Q_OBJECT public: unpostedGlSeries(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~unpostedGlSeries(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sNew(); virtual void sPopulateMenu(QMenu * pMenu); virtual void sPost(); virtual void sPrint(); virtual void sView(); protected slots: virtual void languageChange(); protected: void removeDupAltIds(QList&); }; #endif // UNPOSTEDGLSERIES_H qt-client-4.1.0/guiclient/unpostedGlSeries.ui000066400000000000000000000172461217451700100212450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unpostedGlSeries 0 0 687 381 Unposted G/L Series Entries 0 0 7 0 0 0 0 20 Unposted G/L Series Entries: _glseries 7 7 0 0 QAbstractItemView::ExtendedSelection 0 5 0 0 &Close &Print Qt::Vertical QSizePolicy::Maximum 20 10 true &New false &Edit false Post false &Delete false View Qt::Vertical QSizePolicy::Expanding 20 50 XTreeWidget QTreeWidget

    xtreewidget.h
    _glseries _new _edit _post _delete _close _print _close clicked() unpostedGlSeries close() 20 20 20 20 _glseries valid(bool) _delete setEnabled(bool) 281 200 622 194 _glseries valid(bool) _edit setEnabled(bool) 281 200 622 124 _glseries itemSelected(int) _edit animateClick() 281 200 622 124 _glseries valid(bool) _post setEnabled(bool) 287 200 628 160 _glseries valid(bool) _view setEnabled(bool) 287 200 628 224 qt-client-4.1.0/guiclient/unpostedInvoices.cpp000066400000000000000000000324511217451700100214470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "unpostedInvoices.h" #include #include #include #include #include #include #include #include "failedPostList.h" #include "getGLDistDate.h" #include "invoice.h" #include "mqlutil.h" #include "printInvoice.h" #include "storedProcErrorLookup.h" #include "distributeInventory.h" unpostedInvoices::unpostedInvoices(QWidget* parent, const char* name, Qt::WFlags fl) : display(parent, "unpostedInvoices", fl) { if (name) setObjectName(name); setupUi(optionsWidget()); setWindowTitle(tr("Unposted Invoices")); setListLabel(tr("Unposted Invoices")); setMetaSQLOptions("invoices", "detail"); setNewVisible(true); list()->addColumn(tr("Invoice #"), _orderColumn, Qt::AlignLeft, true, "invchead_invcnumber" ); list()->addColumn(tr("Prnt'd"), _orderColumn, Qt::AlignCenter, true, "invchead_printed" ); list()->addColumn(tr("S/O #"), _orderColumn, Qt::AlignLeft, true, "invchead_ordernumber" ); list()->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name" ); list()->addColumn(tr("Ship-to"), 100, Qt::AlignLeft, false, "invchead_shipto_name" ); list()->addColumn(tr("Invc. Date"), _dateColumn, Qt::AlignCenter, true, "invchead_invcdate" ); list()->addColumn(tr("Ship Date"), _dateColumn, Qt::AlignCenter, true, "invchead_shipdate" ); list()->addColumn(tr("G/L Dist Date"),_dateColumn,Qt::AlignCenter, true, "gldistdate" ); list()->addColumn(tr("Recurring"), _ynColumn, Qt::AlignCenter, false, "isRecurring" ); list()->addColumn(tr("Ship Date"), _dateColumn, Qt::AlignCenter, false, "invchead_shipdate" ); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignCenter, false, "invchead_ponumber" ); list()->addColumn(tr("Total Amount"), _bigMoneyColumn, Qt::AlignRight, true, "extprice" ); list()->setSelectionMode(QAbstractItemView::ExtendedSelection); if (! _privileges->check("ChangeARInvcDistDate")) list()->hideColumn(7); if (_privileges->check("MaintainMiscInvoices")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } if (_preferences->boolean("XCheckBox/forgetful")) _printJournal->setChecked(true); connect(omfgThis, SIGNAL(invoicesUpdated(int, bool)), this, SLOT(sFillList())); sFillList(); } void unpostedInvoices::sNew() { invoice::newInvoice(-1); } void unpostedInvoices::sEdit() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) invoice::editInvoice(((XTreeWidgetItem*)(selected[i]))->id()); } void unpostedInvoices::sView() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) invoice::viewInvoice(((XTreeWidgetItem*)(selected[i]))->id()); } void unpostedInvoices::sDelete() { XSqlQuery unpostedDelete; if ( QMessageBox::warning( this, tr("Delete Selected Invoices"), tr("

    Are you sure that you want to delete the " "selected Invoices?"), tr("Delete"), tr("Cancel"), QString::null, 1, 1 ) == 0) { unpostedDelete.prepare("SELECT deleteInvoice(:invchead_id) AS result;"); QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { unpostedDelete.bindValue(":invchead_id", ((XTreeWidgetItem*)(selected[i]))->id()); unpostedDelete.exec(); if (unpostedDelete.first()) { int result = unpostedDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteInvoice", result), __FILE__, __LINE__); } } else if (unpostedDelete.lastError().type() != QSqlError::NoError) systemError(this, tr("Error deleting Invoice %1\n").arg(selected[i]->text(0)) + unpostedDelete.lastError().databaseText(), __FILE__, __LINE__); } } omfgThis->sInvoicesUpdated(-1, TRUE); omfgThis->sBillingSelectionUpdated(-1, -1); } } void unpostedInvoices::sPrint() { QList selected = list()->selectedItems(); printInvoice newdlg(this, "", TRUE); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { ParameterList params; params.append("invchead_id", ((XTreeWidgetItem*)(selected[i]))->id()); params.append("persistentPrint"); newdlg.set(params); if (!newdlg.isSetup()) { if(newdlg.exec() == QDialog::Rejected) break; newdlg.setSetup(TRUE); } } } omfgThis->sInvoicesUpdated(-1, TRUE); } void unpostedInvoices::sPost() { XSqlQuery unpostedPost; bool changeDate = false; QDate newDate = QDate(); if (_privileges->check("ChangeARInvcDistDate")) { getGLDistDate newdlg(this, "", TRUE); newdlg.sSetDefaultLit(tr("Invoice Date")); if (newdlg.exec() == XDialog::Accepted) { newDate = newdlg.date(); changeDate = (newDate.isValid()); } else return; } int journal = -1; unpostedPost.exec("SELECT fetchJournalNumber('AR-IN') AS result;"); if (unpostedPost.first()) { journal = unpostedPost.value("result").toInt(); if (journal < 0) { systemError(this, storedProcErrorLookup("fetchJournalNumber", journal), __FILE__, __LINE__); return; } } else if (unpostedPost.lastError().type() != QSqlError::NoError) { systemError(this, unpostedPost.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery xrate; xrate.prepare("SELECT curr_rate " "FROM curr_rate, invchead " "WHERE ((curr_id=invchead_curr_id)" " AND (invchead_id=:invchead_id)" " AND (invchead_invcdate BETWEEN curr_effective AND curr_expires));"); // if SUM becomes dependent on curr_id then move XRATE before it in the loop XSqlQuery sum; sum.prepare("SELECT invoicetotal(:invchead_id) AS subtotal;"); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery post; post.prepare("SELECT postInvoice(:invchead_id, :journal) AS result;"); XSqlQuery setDate; setDate.prepare("UPDATE invchead SET invchead_gldistdate=:distdate " "WHERE invchead_id=:invchead_id;"); QList selected = list()->selectedItems(); QList triedToClosed; for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); // always change gldistdate. if using invoice date then will set to null //if (changeDate) //{ setDate.bindValue(":distdate", newDate); setDate.bindValue(":invchead_id", id); setDate.exec(); if (setDate.lastError().type() != QSqlError::NoError) { systemError(this, setDate.lastError().databaseText(), __FILE__, __LINE__); } //} } } bool tryagain = false; do { for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); sum.bindValue(":invchead_id", id); if (sum.exec() && sum.first() && sum.value("subtotal").toDouble() == 0) { if (QMessageBox::question(this, tr("Invoice Has Value 0"), tr("Invoice #%1 has a total value of 0.\n" "Would you like to post it anyway?") .arg(selected[i]->text(0)), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) continue; } else if (sum.lastError().type() != QSqlError::NoError) { systemError(this, sum.lastError().databaseText(), __FILE__, __LINE__); continue; } else if (sum.value("subtotal").toDouble() != 0) { xrate.bindValue(":invchead_id", id); xrate.exec(); if (xrate.lastError().type() != QSqlError::NoError) { systemError(this, tr("System Error posting Invoice #%1\n%2") .arg(selected[i]->text(0)) .arg(xrate.lastError().databaseText()), __FILE__, __LINE__); continue; } else if (!xrate.first() || xrate.value("curr_rate").isNull()) { systemError(this, tr("Could not post Invoice #%1 because of a missing exchange rate.") .arg(selected[i]->text(0))); continue; } } unpostedPost.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations post.bindValue(":invchead_id", id); post.bindValue(":journal", journal); post.exec(); if (post.first()) { int result = post.value("result").toInt(); if (result < 0) { rollback.exec(); systemError(this, storedProcErrorLookup("postInvoice", result), __FILE__, __LINE__); } else if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Post Invoices"), tr("Transaction Canceled") ); return; } unpostedPost.exec("COMMIT;"); } // contains() string is hard-coded in stored procedure else if (post.lastError().databaseText().contains("post to closed period")) { rollback.exec(); if (changeDate) triedToClosed = selected; else triedToClosed.append(selected[i]); } else if (post.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, tr("A System Error occurred posting Invoice #%1.\n%2") .arg(selected[i]->text(0)) .arg(post.lastError().databaseText()), __FILE__, __LINE__); } } if (triedToClosed.size() > 0) { failedPostList newdlg(this, "", true); newdlg.sSetList(triedToClosed, list()->headerItem(), list()->header()); tryagain = (newdlg.exec() == XDialog::Accepted); selected = triedToClosed; triedToClosed.clear(); } } } while (tryagain); if (_printJournal->isChecked()) { ParameterList params; params.append("source", "A/R"); params.append("sourceLit", tr("A/R")); params.append("startJrnlnum", journal); params.append("endJrnlnum", journal); if (_metrics->boolean("UseJournals")) { params.append("title",tr("Journal Series")); params.append("table", "sltrans"); } else { params.append("title",tr("General Ledger Series")); params.append("gltrans", true); params.append("table", "gltrans"); } orReport report("GLSeries", params); if (report.isValid()) report.print(); else report.reportError(this); } omfgThis->sInvoicesUpdated(-1, TRUE); } void unpostedInvoices::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); if (!_privileges->check("MaintainMiscInvoices")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); if ((!_privileges->check("MaintainMiscInvoices")) && (!_privileges->check("ViewMiscInvoices"))) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); if (!_privileges->check("MaintainMiscInvoices")) menuItem->setEnabled(false); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Print..."), this, SLOT(sPrint())); if (!_privileges->check("PrintInvoices")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Post..."), this, SLOT(sPost())); if (!_privileges->check("PostMiscInvoices")) menuItem->setEnabled(false); } bool unpostedInvoices::checkSitePrivs(int invcid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkInvoiceSitePrivs(:invcheadid) AS result;"); check.bindValue(":invcheadid", invcid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Invoice as it references " "a Site for which you have not been granted privileges.")) ; return false; } } } return true; } void unpostedInvoices::sFillList() { ParameterList params; params.append("unpostedOnly"); display::sFillList(params, true); } qt-client-4.1.0/guiclient/unpostedInvoices.h000066400000000000000000000021001217451700100211000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNPOSTEDINVOICES_H #define UNPOSTEDINVOICES_H #include "display.h" #include "ui_unpostedInvoices.h" class unpostedInvoices : public display, public Ui::unpostedInvoices { Q_OBJECT public: unpostedInvoices(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int invcid); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPrint(); virtual void sPost(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); virtual void sFillList(); }; #endif // UNPOSTEDINVOICES_H qt-client-4.1.0/guiclient/unpostedInvoices.ui000066400000000000000000000032771217451700100213060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2011 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unpostedInvoices 0 0 268 60 List Unposted Invoices true P&rint Journal Qt::Horizontal QSizePolicy::Fixed 108 17 XCheckBox QCheckBox

    xcheckbox.h
    qt-client-4.1.0/guiclient/unpostedPoReceipts.cpp000066400000000000000000000352171217451700100217500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ // TODO: rename unpostedReceipts #include "unpostedPoReceipts.h" #include #include #include #include #include #include #include #include "distributeInventory.h" #include "enterPoReceipt.h" #include "enterPoitemReceipt.h" #include "failedPostList.h" #include "getGLDistDate.h" #include "mqlutil.h" #include "purchaseOrderItem.h" #include "storedProcErrorLookup.h" #include "transferOrderItem.h" #include "returnAuthorizationItem.h" unpostedPoReceipts::unpostedPoReceipts(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_recv, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_viewOrderItem, SIGNAL(clicked()), this, SLOT(sViewOrderItem())); connect(omfgThis, SIGNAL(purchaseOrderReceiptsUpdated()), this, SLOT(sFillList())); _recv->addColumn(tr("Order #"), _orderColumn, Qt::AlignRight, true, "recv_order_number" ); _recv->addColumn(tr("Type"), 50, Qt::AlignCenter, true, "recv_order_type" ); _recv->addColumn(tr("From"), -1, Qt::AlignLeft, true, "orderhead_from" ); _recv->addColumn(tr("Line #"), 50, Qt::AlignRight, true, "orderitem_linenumber"); _recv->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "recv_duedate"); _recv->addColumn(tr("Site"), _whsColumn, Qt::AlignRight, true, "warehous_code" ); _recv->addColumn(tr("Item Number"), _itemColumn, Qt::AlignRight, true, "item_number"); _recv->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom_name"); _recv->addColumn(tr("Vend. Item #"), _itemColumn, Qt::AlignLeft, true, "recv_vend_item_number"); _recv->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "recv_vend_uom"); _recv->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "orderitem_qty_ordered"); _recv->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight, true, "orderitem_qty_received"); _recv->addColumn(tr("To Receive"), _qtyColumn, Qt::AlignRight, true, "recv_qty"); _recv->addColumn(tr("Receipt Date"), _dateColumn, Qt::AlignCenter, true, "recv_date"); _recv->addColumn(tr("G/L Post Date"), _dateColumn, Qt::AlignCenter, true, "recv_gldistdate"); if (! _privileges->check("ChangePORecvPostDate")) _recv->hideColumn(_recv->column("recv_gldistdate")); if(!_privileges->check("ViewPurchaseOrders")) disconnect(_recv, SIGNAL(valid(bool)), _viewOrderItem, SLOT(setEnabled(bool))); sFillList(); } unpostedPoReceipts::~unpostedPoReceipts() { // no need to delete child widgets, Qt does it all for us } void unpostedPoReceipts::languageChange() { retranslateUi(this); } void unpostedPoReceipts::setParams(ParameterList & params) { params.append("nonInventory", tr("Non-Inventory")); params.append("na", tr("N/A")); if (_metrics->boolean("MultiWhs")) params.append("MultiWhs"); if (_metrics->boolean("EnableReturnAuth")) params.append("EnableReturnAuth"); } void unpostedPoReceipts::sPrint() { ParameterList params; setParams(params); orReport report("UnpostedPoReceipts", params); if (report.isValid()) report.print(); else report.reportError(this); } void unpostedPoReceipts::sNew() { ParameterList params; enterPoReceipt *newdlg = new enterPoReceipt(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void unpostedPoReceipts::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("recv_id", _recv->id()); enterPoitemReceipt *newdlg = new enterPoitemReceipt(); newdlg->set(params); newdlg->exec(); } void unpostedPoReceipts::sDelete() { XSqlQuery unpostedDelete; if (QMessageBox::question(this, tr("Cancel Receipts?"), tr("

    Are you sure you want to delete these " "unposted Receipts?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { unpostedDelete.prepare( "DELETE FROM recv " "WHERE (recv_id IN (:id));" ); QListselected = _recv->selectedItems(); for (int i = 0; i < selected.size(); i++) { unpostedDelete.bindValue(":id", ((XTreeWidgetItem*)(selected[i]))->id() ); unpostedDelete.exec(); if (unpostedDelete.lastError().type() != QSqlError::NoError) { systemError(this, unpostedDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } omfgThis->sPurchaseOrderReceiptsUpdated(); } } void unpostedPoReceipts::sViewOrderItem() { ParameterList params; params.append("mode", "view"); QString ordertype = _recv->currentItem()->text(_recv->column("recv_order_type")); if (ordertype == "PO") { params.append("poitem_id", _recv->altId()); purchaseOrderItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else if (ordertype == "TO") { params.append("toitem_id", _recv->altId()); transferOrderItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } else if (ordertype == "RA") { params.append("raitem_id", _recv->altId()); returnAuthorizationItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } } void unpostedPoReceipts::sPost() { XSqlQuery unpostedPost; bool changeDate = false; QDate newDate = QDate::currentDate(); if (_privileges->check("ChangePORecvPostDate")) { getGLDistDate newdlg(this, "", TRUE); newdlg.sSetDefaultLit(tr("Receipt Date")); if (newdlg.exec() == XDialog::Accepted) { newDate = newdlg.date(); changeDate = (newDate.isValid()); } else return; } XSqlQuery setDate; setDate.prepare("UPDATE recv SET recv_gldistdate=:distdate " "WHERE recv_id=:recv_id;"); QListselected = _recv->selectedItems(); QListtriedToClosed; for (int i = 0; i < selected.size(); i++) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); if (changeDate) { setDate.bindValue(":distdate", newDate); setDate.bindValue(":recv_id", id); setDate.exec(); if (setDate.lastError().type() != QSqlError::NoError) { systemError(this, setDate.lastError().databaseText(), __FILE__, __LINE__); } } } XSqlQuery postLine; postLine.prepare("SELECT postReceipt(:id, NULL::integer) AS result, " " (recv_order_type = 'RA' AND COALESCE(itemsite_costmethod, '') = 'J') AS issuewo, " " COALESCE(pohead_dropship, false) AS dropship " "FROM recv " " LEFT OUTER JOIN itemsite ON (itemsite_id=recv_itemsite_id) " " LEFT OUTER JOIN poitem ON ((recv_order_type='PO') " " AND (recv_orderitem_id=poitem_id)) " " LEFT OUTER JOIN pohead ON (poitem_pohead_id=pohead_id) " "WHERE (recv_id=:id);"); XSqlQuery rollback; rollback.prepare("ROLLBACK;"); bool tryagain = false; do { unpostedPost.exec("BEGIN;"); for (int i = 0; i < selected.size(); i++) { int id = ((XTreeWidgetItem*)(selected[i]))->id(); postLine.bindValue(":id", id); postLine.exec(); if (postLine.first()) { int result = postLine.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("postReceipt", result), __FILE__, __LINE__); rollback.exec(); continue; } if (distributeInventory::SeriesAdjust(result, this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Unposted Receipts"), tr("Post Canceled") ); return; } // Job item for Return Service; issue this to work order if (postLine.value("issuewo").toBool()) { XSqlQuery issuewo; issuewo.prepare("SELECT issueWoRtnReceipt(coitem_order_id, invhist_id) AS result " "FROM invhist, recv " " JOIN raitem ON (raitem_id=recv_orderitem_id) " " JOIN coitem ON (coitem_id=raitem_new_coitem_id) " "WHERE ((invhist_series=:itemlocseries) " " AND (recv_id=:id));"); issuewo.bindValue(":itemlocseries", postLine.value("result").toInt()); issuewo.bindValue(":id", id); issuewo.exec(); if (issuewo.lastError().type() != QSqlError::NoError) { systemError(this, issuewo.lastError().databaseText(), __FILE__, __LINE__); rollback.exec(); return; } } // Issue drop ship orders to shipping else if (postLine.value("dropship").toBool()) { XSqlQuery issue; issue.prepare("SELECT issueToShipping('SO', coitem_id, " " (recv_qty * poitem_invvenduomratio / coitem_qty_invuomratio), " " :itemlocseries, now(), invhist_id ) AS result, " " coitem_cohead_id, cohead_holdtype, pohead_number " "FROM invhist, recv " " JOIN poitem ON (poitem_id=recv_orderitem_id) " " JOIN pohead ON (poitem_pohead_id=pohead_id) " " JOIN coitem ON (coitem_id=poitem_order_id AND poitem_order_type='S') " " JOIN cohead ON (coitem_cohead_id=cohead_id) " "WHERE ((invhist_series=:itemlocseries) " " AND (recv_id=:id));"); issue.bindValue(":itemlocseries", postLine.value("result").toInt()); issue.bindValue(":id", id); issue.exec(); if (issue.first()) { if (issue.value("cohead_holdtype").toString() != "N") { QString msg = tr("Purchase Order %1 is being drop shipped against " "a Sales Order that is on Hold. The Sales Order must " "be taken off Hold before the Receipt may be Posted.") .arg(issue.value("pohead_number").toString()); rollback.exec(); QMessageBox::warning(this, tr("Cannot Ship Order"), msg); sFillList(); return; } if (!_soheadid.contains(issue.value("coitem_cohead_id").toInt())) _soheadid.append(issue.value("coitem_cohead_id").toInt()); issue.prepare("SELECT postItemLocSeries(:itemlocseries);"); issue.bindValue(":itemlocseries", postLine.value("result").toInt()); issue.exec(); } if (issue.lastError().type() != QSqlError::NoError) { systemError(this, issue.lastError().databaseText(), __FILE__, __LINE__); rollback.exec(); return; } } } // contains() string is hard-coded in stored procedure else if (postLine.lastError().databaseText().contains("posted to closed period")) { if (changeDate) { triedToClosed = selected; break; } else triedToClosed.append(selected[i]); } else if (postLine.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, postLine.lastError().databaseText(), __FILE__, __LINE__); } } // for each selected line // Ship any drop shipped orders while (_soheadid.count()) { XSqlQuery ship; ship.prepare("SELECT shipShipment(shiphead_id) AS result, " " shiphead_id " "FROM shiphead " "WHERE ( (shiphead_order_type='SO') " " AND (shiphead_order_id=:cohead_id) " " AND (NOT shiphead_shipped) );"); ship.bindValue(":cohead_id", _soheadid.at(0)); ship.exec(); if (_metrics->boolean("BillDropShip") && ship.first()) { int shipheadid = ship.value("shiphead_id").toInt(); ship.prepare("SELECT selectUninvoicedShipment(:shiphead_id);"); ship.bindValue(":shiphead_id", shipheadid); ship.exec(); if (ship.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, ship.lastError().databaseText(), __FILE__, __LINE__); return; } } if (ship.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, ship.lastError().databaseText(), __FILE__, __LINE__); return; } _soheadid.takeFirst(); } unpostedPost.exec("COMMIT;"); if (triedToClosed.size() > 0) { failedPostList newdlg(this, "", true); newdlg.sSetList(triedToClosed, _recv->headerItem(), _recv->header()); tryagain = (newdlg.exec() == XDialog::Accepted); selected = triedToClosed; triedToClosed.clear(); } } while (tryagain); omfgThis->sPurchaseOrderReceiptsUpdated(); } void unpostedPoReceipts::sPopulateMenu(QMenu *pMenu,QTreeWidgetItem *pItem) { QAction *menuItem; QString ordertype = pItem->text(_recv->column("recv_order_type")); menuItem = pMenu->addAction(tr("Edit Receipt..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("Delete Receipt..."), this, SLOT(sDelete())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Post Receipt..."), this, SLOT(sPost())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Order Item..."),this, SLOT(sViewOrderItem())); menuItem->setEnabled( (ordertype == "PO" && _privileges->check("ViewPurchaseOrders")) || (ordertype == "TO" && _privileges->check("ViewTransferOrders")) || (ordertype == "RA" && _privileges->check("ViewReturns")) ); } void unpostedPoReceipts::sFillList() { ParameterList fillp; setParams(fillp); MetaSQLQuery fillm = mqlLoad("unpostedReceipts", "detail"); XSqlQuery fillq = fillm.toQuery(fillp); _recv->clear(); _recv->populate(fillq,true); } qt-client-4.1.0/guiclient/unpostedPoReceipts.h000066400000000000000000000023651217451700100214130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNPOSTEDPORECEIPTS_H #define UNPOSTEDPORECEIPTS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_unpostedPoReceipts.h" class unpostedPoReceipts : public XWidget, public Ui::unpostedPoReceipts { Q_OBJECT public: unpostedPoReceipts(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~unpostedPoReceipts(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sNew(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *); virtual void sPost(); virtual void sPrint(); virtual void sViewOrderItem(); virtual void setParams(ParameterList &); protected slots: virtual void languageChange(); private: QList _soheadid; }; #endif // UNPOSTEDPORECEIPTS_H qt-client-4.1.0/guiclient/unpostedPoReceipts.ui000066400000000000000000000175251217451700100216050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unpostedPoReceipts 0 0 800 600 List Unposted Receipts 12 12 0 0 0 0 20 Unposted Receipts: _recv 0 0 QAbstractItemView::ExtendedSelection 5 0 &Close &Print Qt::Vertical QSizePolicy::Maximum 20 10 true &New false &Edit false Post false &Delete false View Order Item Qt::Vertical QSizePolicy::Expanding 20 50 XTreeWidget QTreeWidget

    xtreewidget.h
    _recv _new _edit _post _delete _close _print _close clicked() unpostedPoReceipts close() 20 20 20 20 _recv valid(bool) _delete setEnabled(bool) 281 200 622 194 _recv valid(bool) _edit setEnabled(bool) 281 200 622 124 _recv itemSelected(int) _edit animateClick() 281 200 622 124 _recv valid(bool) _post setEnabled(bool) 287 200 628 160 _recv valid(bool) _viewOrderItem setEnabled(bool) 274 200 615 224 qt-client-4.1.0/guiclient/unpostedPurchaseOrders.cpp000066400000000000000000000264361217451700100226270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "unpostedPurchaseOrders.h" #include #include #include #include #include #include #include #include "purchaseOrder.h" #include "printPurchaseOrder.h" #include "guiclient.h" #include "storedProcErrorLookup.h" #include "parameterwidget.h" unpostedPurchaseOrders::unpostedPurchaseOrders(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "unpostedPurchaseOrders", fl) { setupUi(optionsWidget()); setUseAltId(true); setWindowTitle(tr("Open Purchase Orders")); setMetaSQLOptions("openpurchaseorders", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setQueryOnStartEnabled(true); setAutoUpdateEnabled(true); setSearchVisible(true); if (_metrics->boolean("MultiWhs")) parameterWidget()->append(tr("Site"), "warehous_id", ParameterWidget::Site); parameterWidget()->append(tr("Vendor"), "vend_id", ParameterWidget::Vendor); parameterWidget()->appendComboBox(tr("Vendor Type"), "vendtype_id", XComboBox::VendorTypes); parameterWidget()->append(tr("Vendor Type Pattern"), "vendtype_pattern", ParameterWidget::Text); parameterWidget()->appendComboBox(tr("Purchase Agent"), "pohead_agent_usr_id", XComboBox::Agent); connect(omfgThis, SIGNAL(purchaseOrdersUpdated(int, bool)), this, SLOT(sFillList())); list()->addColumn(tr("P/O #"), _orderColumn, Qt::AlignLeft, true, "pohead_number" ); list()->addColumn(tr("Vendor #"), _orderColumn, Qt::AlignLeft, true, "vend_number" ); list()->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name" ); list()->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "min_duedate" ); list()->addColumn(tr("Status"), _ynColumn, Qt::AlignCenter, true, "pohead_status" ); list()->addColumn(tr("Printed"), _ynColumn, Qt::AlignCenter, true, "pohead_printed"); list()->addColumn(tr("Vend. Type"), -1, Qt::AlignLeft, false,"vendtype_code" ); list()->addColumn(tr("Agent"), -1, Qt::AlignLeft, true, "pohead_agent_username"); list()->setSelectionMode(QAbstractItemView::ExtendedSelection); _showUnreleased->setChecked(false); if (_privileges->check("MaintainPurchaseOrders")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(false); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } } void unpostedPurchaseOrders::sNew() { ParameterList params; params.append("mode", "new"); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void unpostedPurchaseOrders::sEdit() { QList selected = list()->selectedItems(); bool done = false; for (int i = 0; i < selected.size(); i++) { if (((selected[i]->rawValue("pohead_status").toString() == "U" && _privileges->check("MaintainPurchaseOrders")) || (selected[i]->rawValue("pohead_status").toString() == "O" && _privileges->check("MaintainPostedPurchaseOrders"))) && (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id()))) { ParameterList params; params.append("mode", "edit"); params.append("pohead_id", ((XTreeWidgetItem*)(selected[i]))->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); done = true; break; } } if (done) omfgThis->sPurchaseOrdersUpdated(-1, TRUE); else QMessageBox::information(this, tr("Nothing To Edit"), tr("

    There were no selected Purchase Orders " "that you could edit."), QMessageBox::Ok|QMessageBox::Default); } void unpostedPurchaseOrders::sView() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { ParameterList params; params.append("mode", "view"); params.append("pohead_id", ((XTreeWidgetItem*)(selected[i]))->id()); purchaseOrder *newdlg = new purchaseOrder(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); break; } } } void unpostedPurchaseOrders::sDelete() { XSqlQuery unpostedDelete; if ( QMessageBox::question(this, tr("Delete Selected Purchase Orders"), tr("

    Are you sure that you want to delete the " "selected Purchase Orders?" ), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { unpostedDelete.prepare("SELECT deletePo(:pohead_id) AS result;"); QList selected = list()->selectedItems(); bool done = false; for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { if (selected[i]->rawValue("pohead_status").toString() == "U") { if (selected[i]->altId() != -1) { QString question = tr("

    The Purchase Order that you selected to delete was created " "to satisfy Sales Order demand. If you delete the selected " "Purchase Order then the Sales Order demand will remain but " "the Purchase Order to relieve that demand will not. Are you " "sure that you want to delete the selected Purchase Order?" ); if (QMessageBox::question(this, tr("Delete Purchase Order?"), question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) continue; } unpostedDelete.bindValue(":pohead_id", ((XTreeWidgetItem*)(selected[i]))->id()); unpostedDelete.exec(); if (unpostedDelete.first() && ! unpostedDelete.value("result").toBool()) systemError(this, tr("

    Only Unposted Purchase Orders may be " "deleted. Check the status of Purchase Order " "%1. If it is 'U' then contact your system " "Administrator.").arg(selected[i]->text(0)), __FILE__, __LINE__); else if (unpostedDelete.lastError().type() != QSqlError::NoError) systemError(this, unpostedDelete.lastError().databaseText(), __FILE__, __LINE__); else done = true; } } } if (done) omfgThis->sPurchaseOrdersUpdated(-1, TRUE); else QMessageBox::information(this, tr("Nothing To Delete"), tr("

    There were no selected Purchase Orders " "that could be deleted."), QMessageBox::Ok|QMessageBox::Default); } } void unpostedPurchaseOrders::sPrint() { QList selected = list()->selectedItems(); for (int i = 0; i < selected.size(); i++) { if (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id())) { ParameterList params; params.append("pohead_id", ((XTreeWidgetItem*)(selected[i]))->id()); printPurchaseOrder newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); break; } } sFillList(); } void unpostedPurchaseOrders::sRelease() { XSqlQuery unpostedRelease; unpostedRelease.prepare("SELECT releasePurchaseOrder(:pohead_id) AS result;"); QList selected = list()->selectedItems(); bool done = false; for (int i = 0; i < selected.size(); i++) { if ((selected[i]->rawValue("pohead_status").toString() == "U") && (_privileges->check("ReleasePurchaseOrders")) && (checkSitePrivs(((XTreeWidgetItem*)(selected[i]))->id()))) { unpostedRelease.bindValue(":pohead_id", ((XTreeWidgetItem*)(selected[i]))->id()); unpostedRelease.exec(); if (unpostedRelease.first()) { int result = unpostedRelease.value("result").toInt(); if (result < 0) systemError(this, storedProcErrorLookup("releasePurchaseOrder", result), __FILE__, __LINE__); else done = true; } else if (unpostedRelease.lastError().type() != QSqlError::NoError) systemError(this, unpostedRelease.lastError().databaseText(), __FILE__, __LINE__); } } if (done) omfgThis->sPurchaseOrdersUpdated(-1, TRUE); else QMessageBox::information(this, tr("Nothing To Post"), tr("

    There were no selected Purchase Orders " "to be posted."), QMessageBox::Ok|QMessageBox::Default); } void unpostedPurchaseOrders::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *pItem, int) { QAction *menuItem; XTreeWidgetItem* item = (XTreeWidgetItem*)pItem; bool canMaintain = (item->rawValue("pohead_status").toString() == "U" && _privileges->check("MaintainPurchaseOrders")) || (item->rawValue("pohead_status").toString() == "O" && _privileges->check("MaintainPurchaseOrders") && _privileges->check("MaintainPostedPurchaseOrders")); menuItem = pMenu->addAction(tr("Print..."), this, SLOT(sPrint())); menuItem->setEnabled(canMaintain); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(canMaintain); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem->setEnabled(canMaintain || _privileges->check("ViewPurchaseOrders")); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); menuItem->setEnabled((item->rawValue("pohead_status").toString() == "U" && _privileges->check("MaintainPurchaseOrders"))); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Release..."), this, SLOT(sRelease())); menuItem->setEnabled(_privileges->check("ReleasePurchaseOrders") && item->rawValue("pohead_status").toString() == "U"); } bool unpostedPurchaseOrders::setParams(ParameterList ¶ms) { if (!display::setParams(params)) return false; if (_showUnreleased->isChecked() && _showOpen->isChecked() ) params.append("showBoth"); else if (_showUnreleased->isChecked()) params.append("showUnreleased"); else if (_showOpen->isChecked()) params.append("showOpen"); else params.append("shownothing"); return true; } bool unpostedPurchaseOrders::checkSitePrivs(int orderid) { if (_preferences->boolean("selectedSites")) { XSqlQuery check; check.prepare("SELECT checkPOSitePrivs(:poheadid) AS result;"); check.bindValue(":poheadid", orderid); check.exec(); if (check.first()) { if (!check.value("result").toBool()) { QMessageBox::critical(this, tr("Access Denied"), tr("

    You may not view or edit this Purchase " "Order as it references a Site for which you " "have not been granted privileges.")) ; return false; } } } return true; } qt-client-4.1.0/guiclient/unpostedPurchaseOrders.h000066400000000000000000000021731217451700100222640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UNPOSTEDPURCHASEORDERS_H #define UNPOSTEDPURCHASEORDERS_H #include "display.h" #include "ui_unpostedPurchaseOrders.h" class unpostedPurchaseOrders : public display, public Ui::unpostedPurchaseOrders { Q_OBJECT public: unpostedPurchaseOrders(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); virtual bool checkSitePrivs(int orderid); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sNew(); virtual void sPopulateMenu(QMenu*, QTreeWidgetItem*, int); virtual void sRelease(); virtual void sPrint(); virtual void sView(); virtual bool setParams(ParameterList &); }; #endif // UNPOSTEDPURCHASEORDERS_H qt-client-4.1.0/guiclient/unpostedPurchaseOrders.ui000066400000000000000000000037041217451700100224530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. unpostedPurchaseOrders 0 0 228 51 List Open Purchase Orders 12 Open Unreleased Qt::Horizontal 40 20 XCheckBox QCheckBox

    xcheckbox.h
    qt-client-4.1.0/guiclient/uom.cpp000066400000000000000000000176501217451700100167120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "uom.h" #include #include #include #include #include "storedProcErrorLookup.h" #include "uomConv.h" uom::uom(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_uomconv, SIGNAL(itemSelectionChanged()), this, SLOT(sSelected())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _uomconv->addColumn(tr("UOM/UOM"), -1, Qt::AlignLeft, true, "uomuom"); _uomconv->addColumn(tr("From Value"), -1, Qt::AlignRight, true, "uomconv_from_value"); _uomconv->addColumn(tr("To Value"), -1, Qt::AlignRight, true, "uomconv_to_value"); _uomconv->addColumn(tr("Fractional"), _ynColumn, Qt::AlignCenter, true, "uomconv_fractional"); } uom::~uom() { // no need to delete child widgets, Qt does it all for us } void uom::languageChange() { retranslateUi(this); } enum SetResponse uom::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("uom_id", &valid); if (valid) { _uomid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; _new->setEnabled(true); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _weightUom->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); _edit->setText(tr("&View")); } } return NoError; } void uom::sSave() { XSqlQuery uomSave; if (_name->text().length() == 0) { QMessageBox::information( this, tr("No UOM Name Entered"), tr("You must enter a valid UOM name before saving this UOM.") ); _name->setFocus(); return; } if (_weightUom->isChecked()) { if (_mode == cNew) uomSave.exec("SELECT uom_id FROM uom WHERE (uom_item_weight);"); else { uomSave.prepare("SELECT uom_id FROM uom WHERE ((uom_item_weight) AND (uom_id<>:uom_id));"); uomSave.bindValue(":uom_id", _uomid); uomSave.exec(); } if (uomSave.first()) { int response = QMessageBox::warning (this, tr("Set Item Weight?"), tr("The Item Weight UOM has already been set. " "Are you sure you want to clear the existing entry and set " "%1 to be the Item Weight UOM?") .arg(_name->text()), QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default); if (response == QMessageBox::Yes) uomSave.exec("UPDATE uom SET uom_item_weight=FALSE;"); else return; } } if (_mode == cNew) { uomSave.exec("SELECT NEXTVAL('uom_uom_id_seq') AS uom_id;"); if (uomSave.first()) _uomid = uomSave.value("uom_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } uomSave.prepare( "INSERT INTO uom " "( uom_id, uom_name, uom_descrip, uom_item_weight ) " "VALUES " "( :uom_id, :uom_name, :uom_descrip, :uom_item_weight );" ); } else if (_mode == cEdit) uomSave.prepare( "UPDATE uom " "SET uom_name=:uom_name, uom_descrip=:uom_descrip," " uom_item_weight=:uom_item_weight " "WHERE (uom_id=:uom_id);" ); uomSave.bindValue(":uom_id", _uomid); uomSave.bindValue(":uom_name", _name->text()); uomSave.bindValue(":uom_descrip", _description->text()); uomSave.bindValue(":uom_item_weight", QVariant(_weightUom->isChecked())); uomSave.exec(); done(_uomid); } void uom::sCheck() { XSqlQuery uomCheck; _name->setText(_name->text().trimmed().toUpper()); if ( (_mode == cNew) && (_name->text().length()) ) { uomCheck.prepare( "SELECT uom_id " "FROM uom " "WHERE (UPPER(uom_name)=UPPER(:uom_name));" ); uomCheck.bindValue(":uom_name", _name->text()); uomCheck.exec(); if (uomCheck.first()) { _uomid = uomCheck.value("uom_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } } } void uom::populate() { XSqlQuery uompopulate; uompopulate.prepare( "SELECT uom_name, uom_descrip, uom_item_weight " " FROM uom " " WHERE(uom_id=:uom_id);" ); uompopulate.bindValue(":uom_id", _uomid); uompopulate.exec(); if (uompopulate.first()) { _name->setText(uompopulate.value("uom_name").toString()); _description->setText(uompopulate.value("uom_descrip").toString()); _weightUom->setChecked(uompopulate.value("uom_item_weight").toBool()); sFillList(); } } void uom::sFillList() { XSqlQuery uomFillList; uomFillList.prepare("SELECT uomconv_id," " (nuom.uom_name||'/'||duom.uom_name) AS uomuom," " uomconv_from_value, uomconv_to_value," " uomconv_fractional," " 'uomratio' AS uomconv_from_value_xtnumericrole," " 'uomratio' AS uomconv_to_value_xtnumericrole " " FROM uomconv" " JOIN uom AS nuom ON (uomconv_from_uom_id=nuom.uom_id)" " JOIN uom AS duom ON (uomconv_to_uom_id=duom.uom_id)" " WHERE((uomconv_from_uom_id=:uom_id)" " OR (uomconv_to_uom_id=:uom_id));"); uomFillList.bindValue(":uom_id", _uomid); uomFillList.exec(); _uomconv->populate(uomFillList); } void uom::sSelected() { if(_uomconv->id() != -1) { _edit->setEnabled(true); _edit->setText((_mode==cView?tr("&View"):tr("&Edit"))); _delete->setEnabled(!(_mode==cView)); } else { _edit->setEnabled(false); _delete->setEnabled(false); } } void uom::sNew() { ParameterList params; params.append("mode", "new"); params.append("from_uom_id", _uomid); uomConv newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void uom::sEdit() { ParameterList params; if(_mode == cView) params.append("mode", "view"); else params.append("mode", "edit"); params.append("uomconv_id", _uomconv->id()); uomConv newdlg(this, "", TRUE); newdlg.set(params); if(newdlg.exec() == XDialog::Accepted) sFillList(); } void uom::sDelete() { XSqlQuery uomDelete; uomDelete.prepare( "SELECT deleteUOMConv(:uomconv_id) AS result;" ); uomDelete.bindValue(":uomconv_id", _uomconv->id()); uomDelete.exec(); if (uomDelete.first()) { int result = uomDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteUOMConv", result), __FILE__, __LINE__); return; } } else if (uomDelete.lastError().type() != QSqlError::NoError) { systemError(this, uomDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } qt-client-4.1.0/guiclient/uom.h000066400000000000000000000021771217451700100163550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UOM_H #define UOM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_uom.h" class uom : public XDialog, public Ui::uom { Q_OBJECT public: uom(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~uom(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sSelected(); virtual void sFillList(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _mode; int _uomid; }; #endif // UOM_H qt-client-4.1.0/guiclient/uom.ui000066400000000000000000000134151217451700100165400ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. uom 0 0 600 400 Unit of Measure &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 0 Qt::Horizontal QSizePolicy::Expanding 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Item weight unit of measure Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 1 Global Conversion Ratios: false &New false &Edit false &Delete Qt::Vertical 20 40 XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _name _description _uomconv _new _edit _delete _uomconv doubleClicked(QModelIndex) _edit animateClick() 259 143 370 147
    qt-client-4.1.0/guiclient/uomConv.cpp000066400000000000000000000145621217451700100175370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "uomConv.h" #include #include #include "errorReporter.h" #include "guiErrorCheck.h" uomConv::uomConv(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _uomidFrom = -1; _uomconvid = -1; _ignoreSignals = false; connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_uomFrom, SIGNAL(currentIndexChanged(int)), this, SLOT(sFromChanged())); connect(_uomTo, SIGNAL(currentIndexChanged(int)), this, SLOT(sToChanged())); connect(_cancel, SIGNAL(clicked()), this, SLOT(reject())); _fromValue->setValidator(omfgThis->ratioVal()); _toValue->setValidator(omfgThis->ratioVal()); } uomConv::~uomConv() { // no need to delete child widgets, Qt does it all for us } void uomConv::languageChange() { retranslateUi(this); } enum SetResponse uomConv::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("from_uom_id", &valid); if (valid) { _uomidFrom = param.toInt(); _ignoreSignals = true; _uomFrom->setId(_uomidFrom); _uomTo->setId(_uomidFrom); _ignoreSignals = false; } param = pParams.value("uomconv_id", &valid); if (valid) { _uomconvid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") _mode = cNew; else if (param.toString() == "edit") { _mode = cEdit; _uomTo->setEnabled(false); _uomFrom->setEnabled(false); } else if (param.toString() == "view") { _mode = cView; _fromValue->setEnabled(false); _toValue->setEnabled(false); _uomTo->setEnabled(false); _uomFrom->setEnabled(false); _fractional->setEnabled(false); _cancel->setText(tr("&Close")); _save->hide(); } } return NoError; } void uomConv::sSave() { XSqlQuery uomSave; bool valid; QList errors; errors << GuiErrorCheck(!_uomFrom->isValid(), _uomFrom, tr("You must select a From UOM.")) << GuiErrorCheck(!_uomTo->isValid(), _uomTo, tr("You must select a To UOM.")) << GuiErrorCheck(_fromValue->toDouble(&valid) == 0, _fromValue, tr("You must enter a valid Ratio before saving this UOM Conversion.")) << GuiErrorCheck(_toValue->toDouble(&valid) == 0, _toValue, tr("You must enter a valid Ratio before saving this UOM Conversion.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save UOM Conversion"), errors)) return; if (_mode == cEdit) uomSave.prepare( "UPDATE uomconv " " SET uomconv_from_value=:uomconv_from_value," " uomconv_to_value=:uomconv_to_value," " uomconv_fractional=:uomconv_fractional " " WHERE(uomconv_id=:uomconv_id);" ); else if (_mode == cNew) { uomSave.exec("SELECT NEXTVAL('uomconv_uomconv_id_seq') AS uomconv_id"); if (uomSave.first()) _uomconvid = uomSave.value("uomconv_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } uomSave.prepare( "INSERT INTO uomconv " "( uomconv_id, uomconv_from_uom_id, uomconv_from_value, uomconv_to_uom_id, uomconv_to_value, uomconv_fractional ) " "VALUES " "( :uomconv_id, :uomconv_from_uom_id, :uomconv_from_value, :uomconv_to_uom_id, :uomconv_to_value, :uomconv_fractional );" ); } uomSave.bindValue(":uomconv_id", _uomconvid); uomSave.bindValue(":uomconv_from_uom_id", _uomFrom->id()); uomSave.bindValue(":uomconv_to_uom_id", _uomTo->id()); uomSave.bindValue(":uomconv_from_value", _fromValue->toDouble()); uomSave.bindValue(":uomconv_to_value", _toValue->toDouble()); uomSave.bindValue(":uomconv_fractional", QVariant(_fractional->isChecked())); uomSave.exec(); accept(); } void uomConv::sFromChanged() { if(cNew != _mode || _ignoreSignals) return; if(_uomFrom->id() != _uomidFrom && _uomTo->id() != _uomidFrom) { _ignoreSignals = true; _uomTo->setId(_uomidFrom); _ignoreSignals = false; } sCheck(); } void uomConv::sToChanged() { if(cNew != _mode || _ignoreSignals) return; if(_uomFrom->id() != _uomidFrom && _uomTo->id() != _uomidFrom) { _ignoreSignals = true; _uomFrom->setId(_uomidFrom); _ignoreSignals = false; } sCheck(); } void uomConv::sCheck() { XSqlQuery uomCheck; if ( (_mode == cNew) ) { uomCheck.prepare( "SELECT uomconv_id" " FROM uomconv" " WHERE((uomconv_from_uom_id=:from AND uomconv_to_uom_id=:to)" " OR (uomconv_from_uom_id=:to AND uomconv_to_uom_id=:from));" ); uomCheck.bindValue(":from", _uomFrom->id()); uomCheck.bindValue(":to", _uomTo->id()); uomCheck.exec(); if (uomCheck.first()) { _uomconvid = uomCheck.value("uomconv_id").toInt(); _mode = cEdit; _uomTo->setEnabled(false); _uomFrom->setEnabled(false); populate(); } } } void uomConv::populate() { XSqlQuery uompopulate; uompopulate.prepare( "SELECT uomconv_from_uom_id," " uomconv_from_value," " uomconv_to_uom_id," " uomconv_to_value," " uomconv_fractional " " FROM uomconv" " WHERE(uomconv_id=:uomconv_id);" ); uompopulate.bindValue(":uomconv_id", _uomconvid); uompopulate.exec(); if (uompopulate.first()) { _uomFrom->setId(uompopulate.value("uomconv_from_uom_id").toInt()); _uomTo->setId(uompopulate.value("uomconv_to_uom_id").toInt()); _fromValue->setText(uompopulate.value("uomconv_from_value").toDouble()); _toValue->setText(uompopulate.value("uomconv_to_value").toDouble()); _fractional->setChecked(uompopulate.value("uomconv_fractional").toBool()); } } qt-client-4.1.0/guiclient/uomConv.h000066400000000000000000000022051217451700100171730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UOMCONV_H #define UOMCONV_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_uomConv.h" class uomConv : public XDialog, public Ui::uomConv { Q_OBJECT public: uomConv(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~uomConv(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); virtual void sFromChanged(); virtual void sToChanged(); private: int _uomidFrom; int _uomconvid; int _mode; bool _ignoreSignals; }; #endif // UOMCONV_H qt-client-4.1.0/guiclient/uomConv.ui000066400000000000000000000104501217451700100173620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. uomConv 0 0 443 109 Conversion 0 -1 XComboBox::UOMs Per Qt::AlignCenter 1.0 1.0 XComboBox::UOMs Fractional Qt::Vertical 324 16 0 &Cancel &Save Qt::Vertical 20 40 XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _uomFrom _fromValue _uomTo _toValue _fractional _save _cancel
    qt-client-4.1.0/guiclient/uoms.cpp000066400000000000000000000075151217451700100170740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "uoms.h" #include //#include #include #include #include #include #include "storedProcErrorLookup.h" #include "uom.h" /* * Constructs a uoms as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ uoms::uoms(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_uoms, SIGNAL(valid(bool)), _view, SLOT(setEnabled(bool))); if (_privileges->check("MaintainUOMs")) { connect(_uoms, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_uoms, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_uoms, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_uoms, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } _uoms->addColumn(tr("UOM"), _itemColumn, Qt::AlignCenter, true, "uom_name" ); _uoms->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "uom_descrip" ); _uoms->addColumn(tr("Item Weight"), _itemColumn, Qt::AlignLeft, true, "uom_item_weight" ); sFillList(); } /* * Destroys the object and frees any allocated resources */ uoms::~uoms() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void uoms::languageChange() { retranslateUi(this); } void uoms::sFillList() { _uoms->populate( "SELECT uom.*," " CASE WHEN (NOT uom_item_weight) THEN '' END AS uom_item_weight_qtdisplayrole " " FROM uom " " ORDER BY uom_name;" ); } void uoms::sNew() { ParameterList params; params.append("mode", "new"); uom newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void uoms::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("uom_id", _uoms->id()); uom newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void uoms::sView() { ParameterList params; params.append("mode", "view"); params.append("uom_id", _uoms->id()); uom newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void uoms::sDelete() { XSqlQuery uomsDelete; uomsDelete.prepare( "SELECT deleteUOM(:uom_id) AS result;" ); uomsDelete.bindValue(":uom_id", _uoms->id()); uomsDelete.exec(); if (uomsDelete.first()) { int result = uomsDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteUOM", result), __FILE__, __LINE__); return; } } else if (uomsDelete.lastError().type() != QSqlError::NoError) { systemError(this, uomsDelete.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void uoms::sPrint() { orReport report("UOMs"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/uoms.h000066400000000000000000000016741217451700100165410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UOMS_H #define UOMS_H #include "guiclient.h" #include "xwidget.h" #include "ui_uoms.h" class uoms : public XWidget, public Ui::uoms { Q_OBJECT public: uoms(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~uoms(); public slots: virtual void sFillList(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // UOMS_H qt-client-4.1.0/guiclient/uoms.ui000066400000000000000000000113611217451700100167210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. uoms 0 0 600 400 List Units of Measure 0 Units of Measure: 0 0 &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _uoms _new _edit _view _delete _print _close _close clicked() uoms close() 20 20 20 20 _uoms valid(bool) _view setEnabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/updateABCClass.cpp000066400000000000000000000104251217451700100206610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateABCClass.h" #include #include #include "guiclient.h" updateABCClass::updateABCClass(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); _classCode->setType(ParameterGroup::ClassCode); _dates->setStartCaption(tr("Start Evaluation Date")); _dates->setEndCaption(tr("End Evaluation Date")); } updateABCClass::~updateABCClass() { // no need to delete child widgets, Qt does it all for us } void updateABCClass::languageChange() { retranslateUi(this); } void updateABCClass::sUpdate() { XSqlQuery updateUpdate; if ( (_classCode->isPattern()) && (_classCode->pattern().length() == 0) ) { QMessageBox::critical( this, tr("Enter Class Code Pattern"), tr( "You must enter the Class Code pattern to be used when updating Item Site\n" "Class Codes or select a Class Code from the Class Code list." ) ); _classCode->setFocus(); return; } if (!_dates->startDate().isValid()) { QMessageBox::critical( this, tr("Enter Evaluation Start Date"), tr("You must enter the Start Date of the evaluation period." ) ); _dates->setFocus(); return; } if (!_dates->endDate().isValid()) { QMessageBox::critical( this, tr("Enter Evaluation End Date"), tr("You must enter the End Date of the evaluation period." ) ); _dates->setFocus(); return; } if (_classACutoff->toDouble() == 0.0) { QMessageBox::critical( this, tr("Enter Class A Cutoff %"), tr("You must enter the cutoff point for Class A Items.") ); _classACutoff->setFocus(); return; } if (_classBCutoff->toDouble() == 0.0) { QMessageBox::critical( this, tr("Enter Class B Cutoff %"), tr("You must enter the cutoff point for Class B Items.") ); _classACutoff->setFocus(); return; } if (_warehouse->isAll()) { if (_classCode->isPattern()) updateUpdate.prepare("SELECT updateABCClass(:classcode_pattern, :aCutOff, :bCutOff, :startDate, :endDate) AS result;"); else if (_classCode->isSelected()) updateUpdate.prepare("SELECT updateABCClass(:classcode_id, :aCutOff, :bCutOff, :startDate, :endDate) AS result;"); else if (_classCode->isAll()) updateUpdate.prepare("SELECT updateABCClass(-1, :aCutOff, :bCutOff, :startDate, :endDate) AS result;"); } else if (_warehouse->isSelected()) { if (_classCode->isSelected()) updateUpdate.prepare("SELECT updateABCClass(:classcode_pattern, :warehous_id, :aCutOff, :bCutOff, :startDate, :endDate) AS result;"); else if (_classCode->isSelected()) updateUpdate.prepare("SELECT updateABCClass(:classcode_id, :warehous_id, :aCutOff, :bCutOff, :startDate, :endDate) AS result;"); else if (_classCode->isAll()) updateUpdate.prepare("SELECT updateABCClass(-1, :warehous_id, :aCutOff, :bCutOff, :startDate, :endDate) AS result;"); } _warehouse->bindValue(updateUpdate); _classCode->bindValue(updateUpdate); _dates->bindValue(updateUpdate); updateUpdate.bindValue(":aCutOff", (_classACutoff->toDouble() / 100.0)); updateUpdate.bindValue(":bCutOff", (_classBCutoff->toDouble() / 100.0)); updateUpdate.exec(); if (updateUpdate.first()) QMessageBox::information( this, tr("ABC Class Code Updated"), tr("The ABC Class Code was updated for %1 Item Sites.") .arg(updateUpdate.value("result").toInt()) ); else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); _close->setText(tr("&Close")); } qt-client-4.1.0/guiclient/updateABCClass.h000066400000000000000000000015721217451700100203310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEABCCLASS_H #define UPDATEABCCLASS_H #include "xdialog.h" #include "ui_updateABCClass.h" class updateABCClass : public XDialog, public Ui::updateABCClass { Q_OBJECT public: updateABCClass(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateABCClass(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); }; #endif // UPDATEABCCLASS_H qt-client-4.1.0/guiclient/updateABCClass.ui000066400000000000000000000214701217451700100205160ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateABCClass 0 0 752 280 Update ABC Class 12 12 false false Class &A Cutoff: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _classACutoff 0 0 80 32767 Qt::AlignRight % Class &B Cutoff: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _classBCutoff 0 0 80 32767 Qt::AlignRight % Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 0 &Cancel &Update true Qt::Vertical 20 0 DateCluster QWidget
    datecluster.h
    1
    ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    XLineEdit QLineEdit
    xlineedit.h
    _warehouse _classCode _classACutoff _classBCutoff _dates _update _close _close clicked() updateABCClass reject() 20 20 20 20
    qt-client-4.1.0/guiclient/updateActualCostsByClassCode.cpp000066400000000000000000000121541217451700100236100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateActualCostsByClassCode.h" #include #include updateActualCostsByClassCode::updateActualCostsByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_selectAll, SIGNAL(clicked()), this, SLOT(sSelectAll())); _classCode->setType(ParameterGroup::ClassCode); if (!_metrics->boolean("Routings")) { _directLabor->hide(); _lowerDirectLabor->hide(); _overhead->hide(); _lowerOverhead->hide(); _machOverhead->hide(); _lowerMachOverhead->hide(); } else if (_metrics->value("TrackMachineOverhead") != "M") { _machOverhead->setEnabled(FALSE); _machOverhead->setChecked(TRUE); _lowerMachOverhead->setEnabled(FALSE); _lowerMachOverhead->setChecked(TRUE); } _updateActual = true; } updateActualCostsByClassCode::~updateActualCostsByClassCode() { // no need to delete child widgets, Qt does it all for us } void updateActualCostsByClassCode::languageChange() { retranslateUi(this); } enum SetResponse updateActualCostsByClassCode::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; // default cost type is "actual" param = pParams.value("costtype", &valid); if (valid) { if (param.toString() == "standard") { _updateActual = false; setWindowTitle(tr("Update Standard Costs By Class Code")); _rollUp->setText(tr("&Roll Up Standard Costs")); } else if (param.toString() != "actual") { systemError(this, tr("A System Error occurred at %1::%2.\n" "Illegal parameter value '%3' for 'costtype'") .arg(__FILE__) .arg(__LINE__) .arg(param.toString())); return UndefinedError; } } return NoError; } void updateActualCostsByClassCode::sSelectAll() { _lowerMaterial->setChecked(TRUE); _user->setChecked(TRUE); _lowerUser->setChecked(TRUE); if (_metrics->boolean("Routings")) { _directLabor->setChecked(TRUE); _lowerDirectLabor->setChecked(TRUE); _overhead->setChecked(TRUE); _lowerOverhead->setChecked(TRUE); if (_metrics->value("TrackMachineOverhead") == "M") { _machOverhead->setChecked(TRUE); _lowerMachOverhead->setChecked(TRUE); } } } void updateActualCostsByClassCode::sUpdate() { XSqlQuery updateUpdate; QString sql = "SELECT doUpdateCosts(item_id, TRUE, :lowMaterial, :directLabor, " " :lowDirectLabor, :overhead, :lowOverhead, " " :machOverhead, :lowMachOverhead, :lowUser, :rollUp, " " :updateActual ) " " FROM item, classcode " " WHERE(item_classcode_id = classcode_id) "; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id);"; else if (_classCode->isPattern()) sql += " AND (classcode_code ~ :classcode_pattern);"; else sql = "SELECT doUpdateCosts(:lowMaterial, :directLabor, " " :lowDirectLabor, :overhead, :lowOverhead, " " :machOverhead, :lowMachOverhead, :lowUser, :rollUp, " " :updateActual);"; updateUpdate.prepare(sql); updateUpdate.bindValue(":lowMaterial", _lowerMaterial->isChecked() ? "t" : "f" ); updateUpdate.bindValue(":directLabor", _directLabor->isChecked() ? "t" : "f" ); updateUpdate.bindValue(":lowDirectLabor", _lowerDirectLabor->isChecked() ? "t" : "f" ); updateUpdate.bindValue(":overhead", _overhead->isChecked() ? "t" : "f" ); updateUpdate.bindValue(":lowOverhead", _lowerOverhead->isChecked() ? "t" : "f" ); updateUpdate.bindValue(":machOverhead", (_machOverhead->isChecked() || ((_metrics->value("TrackMachineOverhead") != "M") && _metrics->boolean("Routings"))) ? "t" : "f"); updateUpdate.bindValue(":lowMachOverhead", (_lowerMachOverhead->isChecked() || ((_metrics->value("TrackMachineOverhead") != "M") && _metrics->boolean("Routings"))) ? "t" : "f"); updateUpdate.bindValue(":lowUser", _lowerUser->isChecked() ? "t" : "f" ); updateUpdate.bindValue(":rollUp", _rollUp->isChecked() ? "t" : "f" ); updateUpdate.bindValue(":updateActual", _updateActual ? "t" : "f" ); _classCode->bindValue(updateUpdate); updateUpdate.exec(); if (updateUpdate.lastError().type() != QSqlError::NoError) { systemError(this, updateUpdate.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/updateActualCostsByClassCode.h000066400000000000000000000022341217451700100232530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEACTUALCOSTSBYCLASSCODE_H #define UPDATEACTUALCOSTSBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_updateActualCostsByClassCode.h" class updateActualCostsByClassCode : public XDialog, public Ui::updateActualCostsByClassCode { Q_OBJECT public: updateActualCostsByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateActualCostsByClassCode(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSelectAll(); virtual void sUpdate(); protected slots: virtual void languageChange(); private: bool _updateActual; }; #endif // UPDATEACTUALCOSTSBYCLASSCODE_H qt-client-4.1.0/guiclient/updateActualCostsByClassCode.ui000066400000000000000000000355411217451700100234500ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateActualCostsByClassCode 0 0 504 442 Update Actual Costs by Class Code 12 12 0 5 false 0 &Roll Up Actual Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Update Lower Level Material Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 Update Direct Labor Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 Update Lower Level Direct Labor Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Update Overhead Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 Update Lower Level Overhead Cost Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Update Machine Overhead Qt::Horizontal QSizePolicy::Expanding 20 0 0 Update Lower Machine Overhead Qt::Horizontal QSizePolicy::Expanding 20 0 0 0 Update User Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Update Lower Level User Costs Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 0 0 5 &Cancel &Update true true true &Select all Costs Qt::Vertical 20 0 ParameterGroup QGroupBox
    parametergroup.h
    1
    _rollUp _lowerMaterial _directLabor _lowerDirectLabor _overhead _lowerOverhead _machOverhead _lowerMachOverhead _user _lowerUser _update _selectAll _close _close clicked() updateActualCostsByClassCode reject() 20 20 20 20
    qt-client-4.1.0/guiclient/updateActualCostsByItem.cpp000066400000000000000000000105461217451700100226510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateActualCostsByItem.h" #include #include updateActualCostsByItem::updateActualCostsByItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_item, SIGNAL(valid(bool)), _update, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_selectAll, SIGNAL(clicked()), this, SLOT(sSelectAll())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); if (!_metrics->boolean("Routings")) { _directLabor->hide(); _lowerDirectLabor->hide(); _overhead->hide(); _lowerOverhead->hide(); _machOverhead->hide(); _lowerMachOverhead->hide(); } else if (_metrics->value("TrackMachineOverhead") != "M") { _machOverhead->setEnabled(FALSE); _machOverhead->setChecked(TRUE); _lowerMachOverhead->setEnabled(FALSE); _lowerMachOverhead->setChecked(TRUE); } _captive = FALSE; _updateActual = TRUE; } updateActualCostsByItem::~updateActualCostsByItem() { // no need to delete child widgets, Qt does it all for us } void updateActualCostsByItem::languageChange() { retranslateUi(this); } enum SetResponse updateActualCostsByItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) { _item->setId(param.toInt()); _item->setReadOnly(TRUE); _captive = TRUE; } // default cost type is "actual" param = pParams.value("costtype", &valid); if (valid && param.toString() == "standard") { _updateActual = false; setWindowTitle(tr("Update Standard Costs By Item")); _rollUp->setText(tr("&Roll Up Standard Costs")); } return NoError; } void updateActualCostsByItem::sSelectAll() { _lowerMaterial->setChecked(TRUE); _user->setChecked(TRUE); _lowerUser->setChecked(TRUE); if (_metrics->boolean("Routings")) { _directLabor->setChecked(TRUE); _lowerDirectLabor->setChecked(TRUE); _overhead->setChecked(TRUE); _lowerOverhead->setChecked(TRUE); if (_metrics->value("TrackMachineOverhead") == "M") { _machOverhead->setChecked(TRUE); _lowerMachOverhead->setChecked(TRUE); } } } void updateActualCostsByItem::sUpdate() { XSqlQuery sql; sql.prepare("SELECT doUpdateCosts(:item_id, TRUE, :lowMaterial, :dirLabor, " " :lowDirLabor, :overhead, :lowOverhead, :machOverhead, " " :lowMachOverhead, :lowUser, :rollUp, :updateActual)"); sql.bindValue(":item_id", _item->id()); sql.bindValue(":lowMaterial", _lowerMaterial->isChecked() ? "t" : "f"); sql.bindValue(":dirLabor", _directLabor->isChecked() ? "t" : "f"); sql.bindValue(":lowDirLabor", _lowerDirectLabor->isChecked() ? "t" : "f"); sql.bindValue(":overhead", _overhead->isChecked() ? "t" : "f"); sql.bindValue(":lowOverhead", _lowerOverhead->isChecked() ? "t" : "f"); sql.bindValue(":machOverhead", (_machOverhead->isChecked() || ((_metrics->value("TrackMachineOverhead") != "M") && _metrics->boolean("Routings"))) ? "t" : "f"); sql.bindValue(":lowMachOverhead", (_lowerMachOverhead->isChecked() || ((_metrics->value("TrackMachineOverhead") != "M") && _metrics->boolean("Routings"))) ? "t" : "f"); sql.bindValue(":lowUser", _lowerUser->isChecked() ? "t" : "f"); sql.bindValue(":rollUp", _rollUp->isChecked() ? "t" : "f"); sql.bindValue(":updateActual", _updateActual ? "t" : "f" ); sql.exec(); if (sql.lastError().type() != QSqlError::NoError) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__)); return; } if (_captive) accept(); else { _close->setText(tr("&Close")); _item->setId(-1); _item->setFocus(); } } qt-client-4.1.0/guiclient/updateActualCostsByItem.h000066400000000000000000000022071217451700100223110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEACTUALCOSTSBYITEM_H #define UPDATEACTUALCOSTSBYITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_updateActualCostsByItem.h" class updateActualCostsByItem : public XDialog, public Ui::updateActualCostsByItem { Q_OBJECT public: updateActualCostsByItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateActualCostsByItem(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSelectAll(); virtual void sUpdate(); protected slots: virtual void languageChange(); private: bool _captive; bool _updateActual; }; #endif // UPDATEACTUALCOSTSBYITEM_H qt-client-4.1.0/guiclient/updateActualCostsByItem.ui000066400000000000000000000345731217451700100225120ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateActualCostsByItem 0 0 502 358 Update Actual Costs by Item 0 6 7 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 &Roll Up Actual Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Update Lower Level Material Costs Qt::Horizontal QSizePolicy::Preferred 20 20 0 0 Update Direct Labor Cost Qt::Horizontal QSizePolicy::Preferred 20 0 0 Update Lower Level Direct Labor Cost Qt::Horizontal QSizePolicy::Preferred 20 0 0 0 Update Overhead Cost Qt::Horizontal QSizePolicy::Preferred 20 0 0 Update Lower Level Overhead Cost Qt::Horizontal QSizePolicy::Preferred 20 0 0 0 Update Machine Overhead Qt::Horizontal QSizePolicy::Preferred 20 0 0 Update Lower Machine Overhead Qt::Horizontal QSizePolicy::Preferred 20 0 0 0 Update User Costs Qt::Horizontal QSizePolicy::Expanding 20 20 0 Update Lower Level User Costs Qt::Horizontal QSizePolicy::Preferred 20 20 5 &Cancel false &Update true &Select all Costs Qt::Vertical 20 20 Qt::Vertical QSizePolicy::Expanding 20 20 ItemCluster QWidget
    itemcluster.h
    1
    _item _rollUp _lowerMaterial _directLabor _lowerDirectLabor _overhead _lowerOverhead _machOverhead _lowerMachOverhead _user _lowerUser _update _selectAll _close _item valid(bool) _update setEnabled(bool) 20 20 20 20 _close clicked() updateActualCostsByItem reject() 20 20 20 20
    qt-client-4.1.0/guiclient/updateCreditStatusByCustomer.cpp000066400000000000000000000053431217451700100237440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateCreditStatusByCustomer.h" #include updateCreditStatusByCustomer::updateCreditStatusByCustomer(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_cust, SIGNAL(newId(int)), this, SLOT(sPopulate(int))); } updateCreditStatusByCustomer::~updateCreditStatusByCustomer() { // no need to delete child widgets, Qt does it all for us } void updateCreditStatusByCustomer::languageChange() { retranslateUi(this); } void updateCreditStatusByCustomer::sUpdate() { XSqlQuery updateUpdate; updateUpdate.prepare( "UPDATE custinfo " "SET cust_creditstatus=:cust_creditstatus " "WHERE (cust_id=:cust_id);" ); updateUpdate.bindValue(":cust_id", _cust->id()); if (_inGoodStanding->isChecked()) updateUpdate.bindValue(":cust_creditstatus", "G"); else if (_onCreditWarning->isChecked()) updateUpdate.bindValue(":cust_creditstatus", "W"); if (_onCreditHold->isChecked()) updateUpdate.bindValue(":cust_creditstatus", "H"); updateUpdate.exec(); accept(); } void updateCreditStatusByCustomer::sPopulate( int /*pCustid*/ ) { XSqlQuery updatePopulate; updatePopulate.prepare( "SELECT cust_creditstatus " "FROM custinfo " "WHERE (cust_id=:cust_id);" ); updatePopulate.bindValue(":cust_id", _cust->id()); updatePopulate.exec(); if (updatePopulate.first()) { QString stylesheet; if (updatePopulate.value("cust_creditstatus").toString() == "G") { _inGoodStanding->setChecked(TRUE); _currentStatus->setText(tr("In Good Standing")); } else if (updatePopulate.value("cust_creditstatus").toString() == "W") { _onCreditWarning->setChecked(TRUE); _currentStatus->setText(tr("On Credit Warning")); stylesheet = QString("* { color: %1; }").arg(namedColor("warning").name()); } else if (updatePopulate.value("cust_creditstatus").toString() == "H") { _onCreditHold->setChecked(TRUE); _currentStatus->setText(tr("On Credit Hold")); stylesheet = QString("* { color: %1; }").arg(namedColor("error").name()); } _currentStatus->setStyleSheet(stylesheet); } } qt-client-4.1.0/guiclient/updateCreditStatusByCustomer.h000066400000000000000000000020541217451700100234050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATECREDITSTATUSBYCUSTOMER_H #define UPDATECREDITSTATUSBYCUSTOMER_H #include "guiclient.h" #include "xdialog.h" #include "ui_updateCreditStatusByCustomer.h" class updateCreditStatusByCustomer : public XDialog, public Ui::updateCreditStatusByCustomer { Q_OBJECT public: updateCreditStatusByCustomer(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateCreditStatusByCustomer(); public slots: virtual void sUpdate(); virtual void sPopulate( int pCustid ); protected slots: virtual void languageChange(); }; #endif // UPDATECREDITSTATUSBYCUSTOMER_H qt-client-4.1.0/guiclient/updateCreditStatusByCustomer.ui000066400000000000000000000202051217451700100235710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateCreditStatusByCustomer 0 0 465 181 Update Credit Status by Customer 5 7 0 0 0 5 0 0 Qt::Horizontal QSizePolicy::Expanding 16 10 0 5 Current Credit Status: 0 0 Qt::Horizontal QSizePolicy::Expanding 31 10 0 5 New Credit Status 5 0 In Good Standing true On Credit Warning On Credit Hold Qt::Horizontal QSizePolicy::Expanding 31 10 Qt::Vertical QSizePolicy::Expanding 10 91 0 0 0 5 &Cancel &Update true true Qt::Vertical QSizePolicy::Expanding 10 41 CustCluster QWidget
    custcluster.h
    0
    _cust _inGoodStanding _update _close _close clicked() updateCreditStatusByCustomer reject() 20 20 20 20
    qt-client-4.1.0/guiclient/updateCycleCountFrequency.cpp000066400000000000000000000100361217451700100232360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateCycleCountFrequency.h" #include updateCycleCountFrequency::updateCycleCountFrequency(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); _classCode->setType(ParameterGroup::ClassCode); } updateCycleCountFrequency::~updateCycleCountFrequency() { // no need to delete child widgets, Qt does it all for us } void updateCycleCountFrequency::languageChange() { retranslateUi(this); } enum SetResponse updateCycleCountFrequency::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("aFrequency", &valid); if (valid) _classAFrequency->setValue(param.toInt()); else _classAFrequency->setValue(0); param = pParams.value("bFrequency", &valid); if (valid) _classBFrequency->setValue(param.toInt()); else _classBFrequency->setValue(0); param = pParams.value("cFrequency", &valid); if (valid) _classCFrequency->setValue(param.toInt()); else _classCFrequency->setValue(0); param = pParams.value("warehous_id", &valid); if (valid) _warehouse->setId(param.toInt()); param = pParams.value("classcode_id", &valid); if (valid) _classCode->setId(param.toInt()); param = pParams.value("classcode_code", &valid); if (valid) _classCode->setPattern(param.toString()); if (pParams.inList("run")) { sUpdate(); return NoError_Run; } return NoError; } void updateCycleCountFrequency::sUpdate() { XSqlQuery updateUpdate; QString sql( "UPDATE itemsite " "SET itemsite_cyclecountfreq=:afreq " "FROM item " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_abcclass='A')" ); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += "); " "UPDATE itemsite " "SET itemsite_cyclecountfreq=:bfreq " "FROM item " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_abcclass='B')" ; if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += "); " "UPDATE itemsite " "SET itemsite_cyclecountfreq=:cfreq " "FROM item " "WHERE ( (itemsite_item_id=item_id)" " AND (itemsite_abcclass='C')" ; if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += ");"; updateUpdate.prepare(sql); updateUpdate.bindValue(":afreq", _classAFrequency->value()); updateUpdate.bindValue(":bfreq", _classBFrequency->value()); updateUpdate.bindValue(":cfreq", _classCFrequency->value()); _warehouse->bindValue(updateUpdate); _classCode->bindValue(updateUpdate); updateUpdate.exec(); accept(); } qt-client-4.1.0/guiclient/updateCycleCountFrequency.h000066400000000000000000000021011217451700100226750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATECYCLECOUNTFREQUENCY_H #define UPDATECYCLECOUNTFREQUENCY_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_updateCycleCountFrequency.h" class updateCycleCountFrequency : public XDialog, public Ui::updateCycleCountFrequency { Q_OBJECT public: updateCycleCountFrequency(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateCycleCountFrequency(); public slots: virtual enum SetResponse set(const ParameterList & pParams); virtual void sUpdate(); protected slots: virtual void languageChange(); }; #endif // UPDATECYCLECOUNTFREQUENCY_H qt-client-4.1.0/guiclient/updateCycleCountFrequency.ui000066400000000000000000000255211217451700100230760ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateCycleCountFrequency 0 0 749 270 Update Cycle Count Frequency 12 12 0 5 7 0 false Qt::Vertical QSizePolicy::Preferred 20 0 false 0 5 0 Class &A Frequency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _classAFrequency Class &B Frequency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _classBFrequency Class &C Frequency: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _classBFrequency 0 5 999 Days 5 999 Days 5 999 Days Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 0 5 &Cancel &Update true Qt::Vertical 20 20 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _classCode _classAFrequency _classBFrequency _classCFrequency _update _close _close clicked() updateCycleCountFrequency reject() 20 20 20 20
    qt-client-4.1.0/guiclient/updateItemSiteLeadTimes.cpp000066400000000000000000000035021217451700100226170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateItemSiteLeadTimes.h" updateItemSiteLeadTimes::updateItemSiteLeadTimes(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); _classCode->setType(ParameterGroup::ClassCode); } updateItemSiteLeadTimes::~updateItemSiteLeadTimes() { // no need to delete child widgets, Qt does it all for us } void updateItemSiteLeadTimes::languageChange() { retranslateUi(this); } void updateItemSiteLeadTimes::sUpdate() { XSqlQuery updateUpdate; QString sql( "SELECT updateItemSiteLeadTime(itemsite_id, :leadTimePad) AS result " "FROM itemsite, item " "WHERE ((itemsite_item_id=item_id)" ); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_classCode->isSelected()) sql += " AND (item_classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ :classcode_pattern)))"; sql += ");"; updateUpdate.prepare(sql); updateUpdate.bindValue(":leadTimePad", _leadTimePad->value()); _warehouse->bindValue(updateUpdate); _classCode->bindValue(updateUpdate); updateUpdate.exec(); accept(); } qt-client-4.1.0/guiclient/updateItemSiteLeadTimes.h000066400000000000000000000017311217451700100222660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEITEMSITELEADTIMES_H #define UPDATEITEMSITELEADTIMES_H #include "guiclient.h" #include "xdialog.h" #include "ui_updateItemSiteLeadTimes.h" class updateItemSiteLeadTimes : public XDialog, public Ui::updateItemSiteLeadTimes { Q_OBJECT public: updateItemSiteLeadTimes(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateItemSiteLeadTimes(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); }; #endif // UPDATEITEMSITELEADTIMES_H qt-client-4.1.0/guiclient/updateItemSiteLeadTimes.ui000066400000000000000000000153631217451700100224620ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateItemSiteLeadTimes 0 0 747 208 Update Item Site Lead Time Days 12 12 0 5 7 0 false false 0 5 Pad Lead Time by: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Days Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 5 &Cancel &Update true Qt::Vertical 20 20 ParameterGroup QGroupBox
    parametergroup.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    _warehouse _classCode _leadTimePad _update _close _close clicked() updateItemSiteLeadTimes reject() 20 20 20 20
    qt-client-4.1.0/guiclient/updateLateCustCreditStatus.cpp000066400000000000000000000042031217451700100233660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateLateCustCreditStatus.h" #include #include /* * Constructs a updateLateCustCreditStatus as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ updateLateCustCreditStatus::updateLateCustCreditStatus(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); } /* * Destroys the object and frees any allocated resources */ updateLateCustCreditStatus::~updateLateCustCreditStatus() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void updateLateCustCreditStatus::languageChange() { retranslateUi(this); } void updateLateCustCreditStatus::sUpdate() { XSqlQuery updateUpdate; updateUpdate.exec("UPDATE custinfo" " SET cust_creditstatus = 'W'" " WHERE(((SELECT count(aropen_id)" " FROM aropen" " WHERE aropen_cust_id = cust_id" " AND aropen_open" " AND aropen_doctype IN ('I', 'D')" " AND aropen_duedate < CURRENT_DATE" " - COALESCE(cust_gracedays," " COALESCE((SELECT CAST(metric_value AS INTEGER)" " FROM metric" " WHERE(metric_name='DefaultAutoCreditWarnGraceDays')),30))) > 0)" " AND (cust_autoupdatestatus)" " AND (cust_creditstatus = 'G'));"); accept(); } qt-client-4.1.0/guiclient/updateLateCustCreditStatus.h000066400000000000000000000017611217451700100230410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATELATECUSTCREDITSTATUS_H #define UPDATELATECUSTCREDITSTATUS_H #include "guiclient.h" #include "xdialog.h" #include "ui_updateLateCustCreditStatus.h" class updateLateCustCreditStatus : public XDialog, public Ui::updateLateCustCreditStatus { Q_OBJECT public: updateLateCustCreditStatus(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateLateCustCreditStatus(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); }; #endif // UPDATELATECUSTCREDITSTATUS_H qt-client-4.1.0/guiclient/updateLateCustCreditStatus.ui000066400000000000000000000072601217451700100232270ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateLateCustCreditStatus 0 0 591 115 0 0 Update Late Customer Credit Status Check and Update Customers Credit Status if they have Late Open Items Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 0 Qt::Horizontal 16 63 0 0 5 0 &Cancel &Update true Qt::Vertical QSizePolicy::Expanding 20 16 _update _close _close clicked() updateLateCustCreditStatus reject() 525 23 20 20 qt-client-4.1.0/guiclient/updateListPricesByProductCategory.cpp000066400000000000000000000042051217451700100247200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateListPricesByProductCategory.h" #include #include #include #include #include "xdoublevalidator.h" #include #include #include "mqlutil.h" updateListPricesByProductCategory::updateListPricesByProductCategory(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); _productCategory->setType(ParameterGroup::ProductCategory); _updateBy->setValidator(new XDoubleValidator(-100, 9999, 2, _updateBy)); } updateListPricesByProductCategory::~updateListPricesByProductCategory() { // no need to delete child widgets, Qt does it all for us } void updateListPricesByProductCategory::languageChange() { retranslateUi(this); } void updateListPricesByProductCategory::sUpdate() { XSqlQuery updateUpdate; if (_updateBy->toDouble() == 0.0) { QMessageBox::critical( this, tr("Enter a Update Percentage"), tr("You must indicate the percentage to update the selected Pricing Schedule.") ); _updateBy->setFocus(); return; } MetaSQLQuery mql = mqlLoad("updateListPrices", "update"); ParameterList params; if (_value->isChecked()) params.append("byValue", true); params.append("updateBy", _updateBy->toDouble()); _productCategory->appendValue(params); updateUpdate = mql.toQuery(params); if (updateUpdate.lastError().type() != QSqlError::NoError) { systemError(this, updateUpdate.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } qt-client-4.1.0/guiclient/updateListPricesByProductCategory.h000066400000000000000000000020511217451700100243620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATELISTPRICESBYPRODUCTCATEGORY_H #define UPDATELISTPRICESBYPRODUCTCATEGORY_H #include "guiclient.h" #include "xdialog.h" #include "ui_updateListPricesByProductCategory.h" class updateListPricesByProductCategory : public XDialog, public Ui::updateListPricesByProductCategory { Q_OBJECT public: updateListPricesByProductCategory(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateListPricesByProductCategory(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); }; #endif // UPDATELISTPRICESBYPRODUCTCATEGORY_H qt-client-4.1.0/guiclient/updateListPricesByProductCategory.ui000066400000000000000000000152231217451700100245550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateListPricesByProductCategory 0 0 577 205 Update List Prices by Product Category 12 12 0 5 false 12 5 Update Prices by: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 60 32767 Qt::AlignRight Percent true Fixed Amount Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 0 5 &Cancel &Update true true Qt::Vertical QSizePolicy::Expanding 20 20 ParameterGroup QGroupBox
    parametergroup.h
    XLineEdit QLineEdit
    xlineedit.h
    _productCategory _updateBy _update _close _close clicked() updateListPricesByProductCategory reject() 20 20 20 20
    qt-client-4.1.0/guiclient/updateOUTLevelByItem.cpp000066400000000000000000000052701217451700100220610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateOUTLevelByItem.h" #include #include updateOUTLevelByItem::updateOUTLevelByItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _daysGroupInt = new QButtonGroup(this); _daysGroupInt->addButton(_leadTime); _daysGroupInt->addButton(_fixedDays); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); connect(_calendar, SIGNAL(newCalendarId(int)), _periods, SLOT(populate(int))); connect(_fixedDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool))); connect(_leadTime, SIGNAL(toggled(bool)), _leadTimePad, SLOT(setEnabled(bool))); connect(_item, SIGNAL(valid(bool)), _update, SLOT(setEnabled(bool))); } updateOUTLevelByItem::~updateOUTLevelByItem() { // no need to delete child widgets, Qt does it all for us } void updateOUTLevelByItem::languageChange() { retranslateUi(this); } void updateOUTLevelByItem::sUpdate() { XSqlQuery updateUpdate; if (_periods->topLevelItemCount() > 0) { QString sql; if (_leadTime->isChecked()) sql = QString( "SELECT updateOUTLevel(itemsite_id, (itemsite_leadtime + :leadTimePad), '{%1}') AS result " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" ) .arg(_periods->periodString()); else if (_fixedDays->isChecked()) sql = QString( "SELECT updateOUTLevel(itemsite_id, :days, '{%1}') AS result " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" ) .arg(_periods->periodString()); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ");"; updateUpdate.prepare(sql); _warehouse->bindValue(updateUpdate); updateUpdate.bindValue(":leadTimePad", _leadTimePad->value()); updateUpdate.bindValue(":days", _days->value()); updateUpdate.bindValue(":item_id", _item->id()); updateUpdate.exec(); accept(); } else { QMessageBox::critical( this, tr("Incomplete Data"), tr("You must select at least one Period to continue.") ); _periods->setFocus(); return; } } qt-client-4.1.0/guiclient/updateOUTLevelByItem.h000066400000000000000000000017541217451700100215310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEOUTLEVELBYITEM_H #define UPDATEOUTLEVELBYITEM_H #include "guiclient.h" #include "xdialog.h" #include "ui_updateOUTLevelByItem.h" class updateOUTLevelByItem : public XDialog, public Ui::updateOUTLevelByItem { Q_OBJECT public: updateOUTLevelByItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateOUTLevelByItem(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); private: QButtonGroup* _daysGroupInt; }; #endif // UPDATEOUTLEVELBYITEM_H qt-client-4.1.0/guiclient/updateOUTLevelByItem.ui000066400000000000000000000311771217451700100217210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateOUTLevelByItem 0 0 744 381 Update Order Up To Level by Item 12 12 false 0 Qt::Horizontal QSizePolicy::Expanding 16 20 0 0 &Cancel false &Update true Qt::Vertical 20 16 0 Days of Stock at Reorder Level 0 5 2 Item Site Lead Time + true Days 5 Fixed Days: 0 false 1 999 1 Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Horizontal QSizePolicy::Expanding 20 20 Periods to Include in Analysis 7 5 0 5 Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::MinimumExpanding 20 20 CalendarComboBox XComboBox
    calendarTools.h
    ItemCluster QWidget
    itemcluster.h
    1
    PeriodsListView XTreeWidget
    calendarTools.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    1
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _item _warehouse _leadTime _leadTimePad _fixedDays _days _periods _update _close _close clicked() updateOUTLevelByItem reject() 20 20 20 20 _fixedDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _leadTime toggled(bool) _leadTimePad setEnabled(bool) 20 20 20 20 _item valid(bool) _update setEnabled(bool) 20 20 20 20 _calendar newCalendarId(int) _periods populate(int) 150 227 540 284 _calendar select(ParameterList&) _periods load(ParameterList&) 150 227 540 284
    qt-client-4.1.0/guiclient/updateOUTLevels.cpp000066400000000000000000000054741217451700100211400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateOUTLevels.h" #include updateOUTLevels::updateOUTLevels(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _daysGroupInt = new QButtonGroup(this); _daysGroupInt->addButton(_leadTime); _daysGroupInt->addButton(_fixedDays); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); connect(_calendar, SIGNAL(newCalendarId(int)), _periods, SLOT(populate(int))); connect(_fixedDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool))); connect(_leadTime, SIGNAL(toggled(bool)), _leadTimePad, SLOT(setEnabled(bool))); _plannerCode->setType(ParameterGroup::PlannerCode); } updateOUTLevels::~updateOUTLevels() { // no need to delete child widgets, Qt does it all for us } void updateOUTLevels::languageChange() { retranslateUi(this); } void updateOUTLevels::sUpdate() { XSqlQuery updateUpdate; if (_periods->topLevelItemCount() > 0) { QString sql; if (_leadTime->isChecked()) sql = QString( "SELECT updateOUTLevel(itemsite_id, (itemsite_leadtime + :leadTimePad), '{%1}') AS result " "FROM itemsite, plancode " "WHERE ( (itemsite_plancode_id=plancode_id)" ) .arg(_periods->periodString()); else if (_fixedDays->isChecked()) sql = QString( "SELECT updateOUTLevel(itemsite_id, :days, '{%1}') AS result " "FROM itemsite, plancode " "WHERE ( (itemsite_plancode_id=plancode_id)" ) .arg(_periods->periodString()); if (_warehouse->isChecked()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_plannerCode->isSelected()) sql += " AND (plancode_id=:plancode_id)"; else if (_plannerCode->isPattern()) sql += " AND (plancode_code ~ :plancode_pattern)"; sql += ");"; updateUpdate.prepare(sql); updateUpdate.bindValue(":leadTimePad", _leadTimePad->value()); updateUpdate.bindValue(":days", _days->value()); _warehouse->bindValue(updateUpdate); _plannerCode->bindValue(updateUpdate); updateUpdate.exec(); accept(); } else { QMessageBox::critical( this, tr("Incomplete Data"), tr("You must select at least one Period to continue.") ); _periods->setFocus(); return; } } qt-client-4.1.0/guiclient/updateOUTLevels.h000066400000000000000000000017321217451700100205760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEOUTLEVELS_H #define UPDATEOUTLEVELS_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_updateOUTLevels.h" class updateOUTLevels : public XDialog, public Ui::updateOUTLevels { Q_OBJECT public: updateOUTLevels(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateOUTLevels(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); private: QButtonGroup* _daysGroupInt; }; #endif // UPDATEOUTLEVELS_H qt-client-4.1.0/guiclient/updateOUTLevels.ui000066400000000000000000000316031217451700100207640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateOUTLevels 0 0 732 508 Update Order Up To Levels by Planner Code 12 12 7 5 7 0 false false 0 Days of Stock at Reorder Level 0 5 5 Item Site Lead Time + true 0 Days Qt::Horizontal QSizePolicy::Expanding 20 20 5 Fixed Days: 0 false 1 999 1 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 0 0 &Cancel &Update true Qt::Vertical 20 16 Periods to Include in Analysis 7 5 0 5 Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::MinimumExpanding 20 20 CalendarComboBox XComboBox
    calendarTools.h
    ParameterGroup QGroupBox
    parametergroup.h
    1
    PeriodsListView XTreeWidget
    calendarTools.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    1
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _leadTime _leadTimePad _fixedDays _days _periods _update _close _close clicked() updateOUTLevels reject() 20 20 20 20 _fixedDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _leadTime toggled(bool) _leadTimePad setEnabled(bool) 20 20 20 20 _calendar newCalendarId(int) _periods populate(int) 149 291 537 380 _calendar select(ParameterList&) _periods load(ParameterList&) 149 291 537 380
    qt-client-4.1.0/guiclient/updateOUTLevelsByClassCode.cpp000066400000000000000000000060251217451700100232050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updateOUTLevelsByClassCode.h" #include #include updateOUTLevelsByClassCode::updateOUTLevelsByClassCode(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _daysGroupInt = new QButtonGroup(this); _daysGroupInt->addButton(_leadTime); _daysGroupInt->addButton(_fixedDays); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); connect(_calendar, SIGNAL(newCalendarId(int)), _periods, SLOT(populate(int))); connect(_fixedDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool))); connect(_leadTime, SIGNAL(toggled(bool)), _leadTimePad, SLOT(setEnabled(bool))); _classCode->setType(ParameterGroup::ClassCode); } updateOUTLevelsByClassCode::~updateOUTLevelsByClassCode() { // no need to delete child widgets, Qt does it all for us } void updateOUTLevelsByClassCode::languageChange() { retranslateUi(this); } void updateOUTLevelsByClassCode::sUpdate() { XSqlQuery updateUpdate; if (_periods->topLevelItemCount() > 0) { QString sql; if (_leadTime->isChecked()) sql = QString( "SELECT updateOUTLevel(itemsite_id, (itemsite_leadtime + :leadTimePad), '{%1}') AS result " "FROM itemsite, item, classcode " "WHERE ( (itemsite_item_id=item_id)" " AND (item_classcode_id=classcode_id)" ) .arg(_periods->periodString()); else if (_fixedDays->isChecked()) sql = QString( "SELECT updateOUTLevel(itemsite_id, :days, '{%1}') AS result " "FROM itemsite, item, classcode " "WHERE ( (itemsite_item_id=item_id)" " AND (item_classcode_id=classcode_id)" ) .arg(_periods->periodString()); if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_classCode->isSelected()) sql += " AND (classcode_id=:classcode_id)"; else if (_classCode->isPattern()) sql += " AND (classcode_code ~ :classcode_pattern)"; sql += ");"; updateUpdate.prepare(sql); updateUpdate.bindValue(":leadTimePad", _leadTimePad->value()); updateUpdate.bindValue(":days", _days->value()); _warehouse->bindValue(updateUpdate); _classCode->bindValue(updateUpdate); updateUpdate.exec(); accept(); } else { QMessageBox::critical( this, tr("Incomplete Data"), tr("You must select at least one Period to continue.") ); _periods->setFocus(); return; } } qt-client-4.1.0/guiclient/updateOUTLevelsByClassCode.h000066400000000000000000000020331217451700100226450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEOUTLEVELSBYCLASSCODE_H #define UPDATEOUTLEVELSBYCLASSCODE_H #include "guiclient.h" #include "xdialog.h" #include "ui_updateOUTLevelsByClassCode.h" class updateOUTLevelsByClassCode : public XDialog, public Ui::updateOUTLevelsByClassCode { Q_OBJECT public: updateOUTLevelsByClassCode(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateOUTLevelsByClassCode(); public slots: virtual void sUpdate(); protected slots: virtual void languageChange(); private: QButtonGroup* _daysGroupInt; }; #endif // UPDATEOUTLEVELSBYCLASSCODE_H qt-client-4.1.0/guiclient/updateOUTLevelsByClassCode.ui000066400000000000000000000330751217451700100230450ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateOUTLevelsByClassCode 0 0 732 508 Update Order Up To Levels by Class Code 12 12 7 5 7 0 false false 0 Days of Stock at Reorder Level 0 5 5 Item Site Lead Time + true 0 Days Qt::Horizontal QSizePolicy::Preferred 0 5 Qt::Horizontal 40 20 5 Fixed Days: 0 false 1 999 1 Qt::Horizontal QSizePolicy::MinimumExpanding 0 5 0 0 &Cancel &Update true Qt::Vertical 20 16 Periods to Include in Analysis 7 5 0 5 Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::MinimumExpanding 20 20 CalendarComboBox XComboBox
    calendarTools.h
    ParameterGroup QGroupBox
    parametergroup.h
    1
    PeriodsListView XTreeWidget
    calendarTools.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    1
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _leadTime _leadTimePad _fixedDays _days _periods _update _close _close clicked() updateOUTLevelsByClassCode reject() 20 20 20 20 _fixedDays toggled(bool) _days setEnabled(bool) 20 20 20 20 _leadTime toggled(bool) _leadTimePad setEnabled(bool) 20 20 20 20 _calendar newCalendarId(int) _periods populate(int) 149 291 537 380 _calendar select(ParameterList&) _periods load(ParameterList&) 149 291 537 380
    qt-client-4.1.0/guiclient/updatePrices.cpp000066400000000000000000000211361217451700100205340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "updatePrices.h" #include #include #include #include #include #include #include #include "mqlutil.h" #include "guiclient.h" #include "xdoublevalidator.h" updatePrices::updatePrices(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery updateupdatePrices; setupUi(this); // signals and slots connections connect(_byItem, SIGNAL(toggled(bool)), this, SLOT(sHandleBy(bool))); connect(_byItemGroup, SIGNAL(toggled(bool)), this, SLOT(sHandleBy(bool))); connect(_byProductCategory, SIGNAL(toggled(bool)), this, SLOT(sHandleBy(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_addAll, SIGNAL(clicked()), this, SLOT(sAddAll())); connect(_remove, SIGNAL(clicked()), this, SLOT(sRemove())); connect(_removeAll, SIGNAL(clicked()), this, SLOT(sRemoveAll())); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); connect(_showEffective, SIGNAL(clicked()), this, SLOT(populate())); connect(_showExpired, SIGNAL(clicked()), this, SLOT(populate())); connect(_showCurrent, SIGNAL(clicked()), this, SLOT(populate())); connect(_value, SIGNAL(clicked()), this, SLOT(sHandleCharPrice())); connect(_percent, SIGNAL(clicked()), this, SLOT(sHandleCharPrice())); connect(_avail, SIGNAL(itemSelected(int)), _add, SLOT(animateClick())); connect(_sel, SIGNAL(itemSelected(int)), _remove, SLOT(animateClick())); _updateBy->setValidator(new XDoubleValidator(-100, 9999, decimalPlaces("curr"), _updateBy)); MetaSQLQuery mql = mqlLoad("updateprices", "createselsched"); ParameterList params; updateupdatePrices = mql.toQuery(params); if (updateupdatePrices.lastError().type() != QSqlError::NoError) systemError(this, updateupdatePrices.lastError().databaseText(), __FILE__, __LINE__); _avail->addColumn(tr("Schedule"), -1, Qt::AlignLeft, true, "ipshead_name"); _avail->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "ipshead_descrip"); _avail->addColumn(tr("Effective"), -1, Qt::AlignLeft, true, "ipshead_effective"); _avail->addColumn(tr("Expires"), -1, Qt::AlignLeft, true, "ipshead_expires"); _avail->setSelectionMode(QAbstractItemView::ExtendedSelection); _sel->addColumn(tr("Schedule"), -1, Qt::AlignLeft, true, "ipshead_name"); _sel->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "ipshead_descrip"); _group->hide(); // _value->setChecked(true); populate(); } updatePrices::~updatePrices() { // no need to delete child widgets, Qt does it all for us } void updatePrices::languageChange() { retranslateUi(this); } void updatePrices::closeEvent(QCloseEvent * /*pEvent*/) { XSqlQuery updatecloseEvent; MetaSQLQuery mql = mqlLoad("updateprices", "dropselsched"); ParameterList params; updatecloseEvent = mql.toQuery(params); if (updatecloseEvent.lastError().type() != QSqlError::NoError) systemError(this, updatecloseEvent.lastError().databaseText(), __FILE__, __LINE__); } void updatePrices::sUpdate() { XSqlQuery updateUpdate; if (_byItem->isChecked() && !_item->isValid()) { QMessageBox::critical( this, tr("Incomplete Data"), tr("You must select an Item to continue.") ); _item->setFocus(); return; } if (!_sel->topLevelItemCount()) { QMessageBox::critical( this, tr("Incomplete Data"), tr("You must select a Pricing Schedule to continue.") ); return; } if (_updateBy->toDouble() == 0.0) { QMessageBox::critical( this, tr("Incomplete Data"), tr("You must provide a Value to continue.") ); _updateBy->setFocus(); return; } ParameterList params; if (_byItem->isChecked()) params.append("item_id", _item->id()); else _paramGroup->appendValue(params); params.append("updateBy", _updateBy->toDouble()); if (_value->isChecked()) params.append("updateByValue", true); else params.append("updateByPercent", true); MetaSQLQuery mql = mqlLoad("updateprices", "update"); updateUpdate = mql.toQuery(params); if (updateUpdate.lastError().type() != QSqlError::NoError) { systemError(this, updateUpdate.lastError().databaseText(), __FILE__, __LINE__); return; } if (_updateCharPrices->isChecked()) { MetaSQLQuery mql2 = mqlLoad("updateprices", "updatechar"); updateUpdate = mql2.toQuery(params); if (updateUpdate.lastError().type() != QSqlError::NoError) { systemError(this, updateUpdate.lastError().databaseText(), __FILE__, __LINE__); return; } } QMessageBox::information( this, tr("Success"), tr("Update Completed.") ); _updateBy->clear(); } void updatePrices::populate() { XSqlQuery updatepopulate; ParameterList params; if (_showEffective->isChecked()) params.append("showEffective", true); if (_showExpired->isChecked()) params.append("showExpired", true); if (_showCurrent->isChecked()) params.append("showCurrent", true); MetaSQLQuery mql = mqlLoad("updateprices", "availsched"); updatepopulate = mql.toQuery(params); if (updatepopulate.lastError().type() != QSqlError::NoError) systemError(this, updatepopulate.lastError().databaseText(), __FILE__, __LINE__); _avail->populate(updatepopulate); MetaSQLQuery mql2 = mqlLoad("updateprices", "selsched"); updatepopulate = mql2.toQuery(params); if (updatepopulate.lastError().type() != QSqlError::NoError) systemError(this, updatepopulate.lastError().databaseText(), __FILE__, __LINE__); _sel->populate(updatepopulate); } void updatePrices::sAdd() { XSqlQuery updateAdd; QList selected = _avail->selectedItems(); for (int i = 0; i < selected.size(); i++) { MetaSQLQuery mql = mqlLoad("updateprices", "add"); ParameterList params; params.append("ipshead_id", ((XTreeWidgetItem*)(selected[i]))->id()); updateAdd = mql.toQuery(params); if (updateAdd.lastError().type() != QSqlError::NoError) systemError(this, updateAdd.lastError().databaseText(), __FILE__, __LINE__); } populate(); } void updatePrices::sAddAll() { XSqlQuery updateAddAll; ParameterList params; if (_showEffective->isChecked()) params.append("showEffective", true); if (_showExpired->isChecked()) params.append("showExpired", true); if (_showCurrent->isChecked()) params.append("showCurrent", true); MetaSQLQuery mql = mqlLoad("updateprices", "add"); updateAddAll = mql.toQuery(params); if (updateAddAll.lastError().type() != QSqlError::NoError) systemError(this, updateAddAll.lastError().databaseText(), __FILE__, __LINE__); populate(); } void updatePrices::sRemove() { XSqlQuery updateRemove; MetaSQLQuery mql = mqlLoad("updateprices", "remove"); ParameterList params; params.append("ipshead_id", _sel->id()); updateRemove = mql.toQuery(params); if (updateRemove.lastError().type() != QSqlError::NoError) systemError(this, updateRemove.lastError().databaseText(), __FILE__, __LINE__); populate(); } void updatePrices::sRemoveAll() { XSqlQuery updateRemoveAll; MetaSQLQuery mql = mqlLoad("updateprices", "remove"); ParameterList params; updateRemoveAll = mql.toQuery(params); if (updateRemoveAll.lastError().type() != QSqlError::NoError) systemError(this, updateRemoveAll.lastError().databaseText(), __FILE__, __LINE__); populate(); } void updatePrices::sHandleBy(bool toggled) { if (!toggled) return; if (_byItem->isChecked()) { _paramGroup->hide(); _group->show(); } else { _group->hide(); _paramGroup->show(); if (_byItemGroup->isChecked()) _paramGroup->setType(ParameterGroup::ItemGroup); else _paramGroup->setType(ParameterGroup::ProductCategory); } } void updatePrices::sHandleCharPrice() { // Only enable update char prices for percentage updates. _updateCharPrices->setEnabled( _percent->isChecked() ); } qt-client-4.1.0/guiclient/updatePrices.h000066400000000000000000000021411217451700100201740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEPRICES_H #define UPDATEPRICES_H #include "xdialog.h" #include "ui_updatePrices.h" class updatePrices : public XDialog, public Ui::updatePrices { Q_OBJECT public: updatePrices(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updatePrices(); public slots: virtual void sUpdate(); virtual void populate(); virtual void sAdd(); virtual void sAddAll(); virtual void sRemove(); virtual void sRemoveAll(); virtual void sHandleBy(bool toggled); virtual void sHandleCharPrice(); virtual void closeEvent( QCloseEvent * pEvent ); protected slots: virtual void languageChange(); }; #endif // UPDATEPRICES_H qt-client-4.1.0/guiclient/updatePrices.ui000066400000000000000000000340731217451700100203730ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updatePrices 0 0 800 600 Update Pricing Schedules Update By false 12 Product Category true Item Group Item false Qt::Horizontal 40 20 0 &Cancel &Update true true Qt::Vertical QSizePolicy::Expanding 20 20 Qt::Horizontal 0 20 ParameterGroup::ProductCategory 12 Show Current true Show Expired Show Future Qt::Horizontal 40 20 0 1 QFrame::NoFrame QFrame::Raised 0 0 Available 0 Qt::Vertical 20 13 false > false < Qt::Vertical 20 13 >> << Qt::Vertical 20 18 0 Selected Update Prices by: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 60 32767 Qt::AlignRight QFrame::NoFrame QFrame::Raised 0 Percent true Fixed Amount Also Update Characteristic Prices Qt::Horizontal QSizePolicy::Expanding 13 19 ItemCluster QWidget
    itemcluster.h
    1
    ParameterGroup QGroupBox
    parametergroup.h
    1
    XCheckBox QCheckBox
    xcheckbox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _updateBy _update _close _avail valid(bool) _add setEnabled(bool) 150 317 326 268 _sel valid(bool) _remove setEnabled(bool) 502 317 326 292
    qt-client-4.1.0/guiclient/updateReorderLevels.cpp000066400000000000000000000144441217451700100220700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include "updateReorderLevels.h" #include "mqlutil.h" updateReorderLevels::updateReorderLevels(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _daysGroupInt = new QButtonGroup(this); _daysGroupInt->addButton(_leadTime); _daysGroupInt->addButton(_fixedDays); connect(_post, SIGNAL(clicked()), this, SLOT(sPost())); connect(_preview, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_results, SIGNAL(currentItemChanged(XTreeWidgetItem*, XTreeWidgetItem*)), this, SLOT(sCloseEdit(XTreeWidgetItem*,XTreeWidgetItem*))); connect(_results, SIGNAL(itemClicked(XTreeWidgetItem*, int)), this, SLOT(sOpenEdit(XTreeWidgetItem*, int))); connect(_update, SIGNAL(clicked()), this, SLOT(sUpdate())); _results->addColumn(tr("Site"), _whsColumn, Qt::AlignLeft, true, "reordlvl_warehous_code"); _results->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "reordlvl_item_number"); _results->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "reordlvl_item_descrip"); _results->addColumn(tr("Leadtime"), _qtyColumn, Qt::AlignRight,true, "reordlvl_leadtime"); _results->addColumn(tr("Curr. Level"), _qtyColumn, Qt::AlignRight,true, "reordlvl_curr_level"); _results->addColumn(tr("Days Stock"), _qtyColumn, Qt::AlignRight,true, "reordlvl_daysofstock"); _results->addColumn(tr("Total Usage"), _qtyColumn, Qt::AlignRight,true, "reordlvl_total_usage"); _results->addColumn(tr("New Level"), _qtyColumn, Qt::AlignRight,true, "reordlvl_calc_level"); } updateReorderLevels::~updateReorderLevels() { // no need to delete child widgets, Qt does it all for us } void updateReorderLevels::languageChange() { retranslateUi(this); } enum SetResponse updateReorderLevels::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("classcode", &valid); if (valid) { _parameter->setType(ParameterGroup::ClassCode); setWindowTitle("Update Reorder Levels by Class Code"); } param = pParams.value("plancode", &valid); if (valid) { setWindowTitle("Update Reorder Levels by Planner Code"); _parameter->setType(ParameterGroup::PlannerCode); } param = pParams.value("item", &valid); if (valid) { setWindowTitle("Update Reorder Level by Item"); _stack->setCurrentIndex(1); } return NoError; } bool updateReorderLevels::setParams(ParameterList ¶ms) { if (_item->id() != -1) params.append("item_id", _item->id()); else _parameter->appendValue(params); _warehouse->appendValue(params); if (_leadTime->isChecked()) { params.append("addLeadtime"), params.append("daysOfStock", _leadTimePad->value()); } else if (_fixedDays->isChecked()) params.append("daysOfStock", _days->value()); params.append("period_id_list",_periods->periodList()); return true; } void updateReorderLevels::sUpdate() { XSqlQuery updateUpdate; _results->clear(); _totalDays->setText(""); QString method; if (_periods->selectedItems().count() > 0) { QString sql; if (_preview->isChecked()) method = "query"; else method = "update"; ParameterList params; if (! setParams(params)) return; MetaSQLQuery mql = mqlLoad("updateReorderLevels", method); updateUpdate = mql.toQuery(params); if (updateUpdate.lastError().type() != QSqlError::NoError) { systemError(this, updateUpdate.lastError().databaseText(), __FILE__, __LINE__); return; } if (_preview->isChecked()) { _results->populate(updateUpdate, true); if (updateUpdate.first()) { _totalDays->setText(updateUpdate.value("reordlvl_total_days").toString()); disconnect(_results, SIGNAL(itemChanged(XTreeWidgetItem*, int)), this, SLOT(sItemChanged(XTreeWidgetItem*, int))); connect(_results, SIGNAL(itemChanged(XTreeWidgetItem*, int)), this, SLOT(sItemChanged(XTreeWidgetItem*, int))); _tab->setCurrentIndex(1); } else QMessageBox::information(this, windowTitle(), tr("No item sites records found.")); } else accept(); } else QMessageBox::information(this, windowTitle(), tr("No Calendar Periods selected.")); } void updateReorderLevels::sHandleButtons() { if (_preview->isChecked()) _update->setText("Q&uery"); else _update->setText("&Update"); } void updateReorderLevels::sPost() { XSqlQuery updatePost; MetaSQLQuery mql = mqlLoad("updateReorderLevels", "post"); ParameterList params; QList selected = _results->selectedItems(); for (int i = 0; i < selected.size(); i++) { // Make sure editor is closed sCloseEdit(selected[i], selected[i]); params.clear(); params.append("itemsite_id", selected[i]->id()); params.append("itemsite_reorderlevel", selected[i]->data(7,Qt::EditRole).toDouble()); updatePost = mql.toQuery(params); if (updatePost.lastError().type() != QSqlError::NoError) { systemError(this, updatePost.lastError().databaseText(), __FILE__, __LINE__); return; } delete selected[i]; } } void updateReorderLevels::sOpenEdit(XTreeWidgetItem *item, const int col) { if (col==7) { _results->openPersistentEditor(item,col); _results->editItem(item,col); } } void updateReorderLevels::sCloseEdit(XTreeWidgetItem * /*current*/, XTreeWidgetItem *previous) { _results->closePersistentEditor(previous,7); } void updateReorderLevels::sItemChanged(XTreeWidgetItem *item, const int col) { // Only positive numbers allowed if (col==7) { if (item->data(col,Qt::EditRole).toDouble() < 0) item->setData(col,Qt::EditRole,0); else item->setData(col,Qt::EditRole,item->data(col,Qt::EditRole).toDouble()); } } qt-client-4.1.0/guiclient/updateReorderLevels.h000066400000000000000000000025511217451700100215310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef UPDATEREORDERLEVELS_H #define UPDATEREORDERLEVELS_H #include "guiclient.h" #include "xdialog.h" #include "ui_updateReorderLevels.h" class updateReorderLevels : public XDialog, public Ui::updateReorderLevels { Q_OBJECT public: updateReorderLevels(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~updateReorderLevels(); virtual bool setParams(ParameterList &); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sUpdate(); virtual void sPost(); virtual void sOpenEdit(XTreeWidgetItem *item, const int col); virtual void sCloseEdit(XTreeWidgetItem *current, XTreeWidgetItem *previous); virtual void sItemChanged(XTreeWidgetItem *item, const int col); virtual void sHandleButtons(); protected slots: virtual void languageChange(); private: QButtonGroup* _daysGroupInt; }; #endif // UPDATEREORDERLEVELS_H qt-client-4.1.0/guiclient/updateReorderLevels.ui000066400000000000000000000437571217451700100217340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. updateReorderLevels 0 0 800 427 Update Reorder Levels 0 Criteria 0 0 false 0 true Qt::Horizontal 0 20 0 &Cancel Q&uery Qt::Vertical 20 0 0 1 QFrame::NoFrame QFrame::Raised 0 Site Selection false Options 0 0 Preview Results true Update Immediately Periods to Include in Analysis Calendar: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Days of Stock at Reorder Level 0 5 2 Item Site Lead Time + true 2 Days 5 Fixed Days: 0 false 1 999 1 Qt::Horizontal QSizePolicy::MinimumExpanding 0 20 Qt::Vertical 20 40 Results Total Days Analyzed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false 0 0 ot Qt::Horizontal 221 20 QAbstractItemView::AllEditTriggers QAbstractItemView::ExtendedSelection false &Post Qt::Vertical 20 40 CalendarComboBox XComboBox
    calendarTools.h
    ItemCluster QWidget
    itemcluster.h
    1
    ParameterGroup QGroupBox
    parametergroup.h
    1
    PeriodsListView XTreeWidget
    calendarTools.h
    WarehouseGroup QGroupBox
    warehousegroup.h
    1
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _warehouse _parameter _leadTime _leadTimePad _fixedDays _days _periods _update _close _close clicked() updateReorderLevels reject() 464 45 20 20 _fixedDays toggled(bool) _days setEnabled(bool) 56 286 150 289 _leadTime toggled(bool) _leadTimePad setEnabled(bool) 56 244 234 238 _results valid(bool) _post setEnabled(bool) 425 95 519 91 _calendar newCalendarId(int) _periods populate(int) 592 198 622 387 _calendar select(ParameterList&) _periods load(ParameterList&) 592 198 622 387
    qt-client-4.1.0/guiclient/user.cpp000066400000000000000000000703231217451700100170640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "user.h" #include #include #include #include #include #include "crmaccount.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "storedProcErrorLookup.h" user::user(QWidget* parent, const char * name, Qt::WindowFlags fl) : XDialog(parent, name, fl) { setupUi(this); _authCache = false; _cUsername = ""; _crmacctid = -1; _inTransaction = false; _mode = cView; connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_crmacct, SIGNAL(clicked()), this, SLOT(sCrmAccount())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_add, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_addAll, SIGNAL(clicked()), this, SLOT(sAddAll())); connect(_revoke, SIGNAL(clicked()), this, SLOT(sRevoke())); connect(_revokeAll, SIGNAL(clicked()), this, SLOT(sRevokeAll())); connect(_module, SIGNAL(activated(const QString&)), this, SLOT(sModuleSelected(const QString&))); connect(_granted, SIGNAL(itemSelected(int)), this, SLOT(sRevoke())); connect(_available, SIGNAL(itemSelected(int)), this, SLOT(sAdd())); connect(_username, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_enhancedAuth, SIGNAL(toggled(bool)), this, SLOT(sEnhancedAuthUpdate())); connect(_grantedGroup, SIGNAL(itemSelected(int)), this, SLOT(sRevokeGroup())); connect(_availableGroup, SIGNAL(itemSelected(int)), this, SLOT(sAddGroup())); connect(_addGroup, SIGNAL(clicked()), this, SLOT(sAddGroup())); connect(_revokeGroup, SIGNAL(clicked()), this, SLOT(sRevokeGroup())); connect(_grantedSite, SIGNAL(itemSelected(int)), this, SLOT(sRevokeSite())); connect(_availableSite, SIGNAL(itemSelected(int)), this, SLOT(sAddSite())); connect(_addSite, SIGNAL(clicked()), this, SLOT(sAddSite())); connect(_revokeSite, SIGNAL(clicked()), this, SLOT(sRevokeSite())); _available->addColumn("Available Privileges", -1, Qt::AlignLeft); _granted->addColumn("Granted Privileges", -1, Qt::AlignLeft); _availableGroup->addColumn("Available Roles", -1, Qt::AlignLeft); _grantedGroup->addColumn("Granted Roles", -1, Qt::AlignLeft); _availableSite->addColumn("Available Sites", -1, Qt::AlignLeft); _grantedSite->addColumn("Granted Sites", -1, Qt::AlignLeft); _locale->setType(XComboBox::Locales); XSqlQuery modq; modq.exec( "SELECT DISTINCT priv_module FROM priv ORDER BY priv_module;" ); for (int i = 0; modq.next(); i++) _module->append(i, modq.value("priv_module").toString()); if(_evaluation == true) { _enhancedAuth->setEnabled(false); _passwd->setEnabled(false); _verify->setEnabled(false); } if (!_metrics->boolean("MultiWhs")) _tab->removeTab(_tab->indexOf(_siteTab)); } user::~user() { // no need to delete child widgets, Qt does it all for us if(_inTransaction) XSqlQuery rollback("ROLLBACK;"); } void user::languageChange() { retranslateUi(this); } enum SetResponse user::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("crmacct_id", &valid); if (valid) _crmacctid = param.toInt(); param = pParams.value("username", &valid); if (valid) _cUsername = param.toString(); if (! _cUsername.isEmpty() || _crmacctid > 0) if (! sPopulate()) return UndefinedError; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _module->setCurrentIndex(0); sModuleSelected(_module->itemText(0)); if (! _cUsername.isEmpty()) { _username->setEnabled(false); _username->setText(_cUsername); sCheck(); } if (_metrics->boolean("MultiWhs")) populateSite(); } else if (param.toString() == "edit") { _mode = cEdit; _username->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _close->setText(tr("&Close")); _save->hide(); } } bool canEdit = (cNew == _mode || cEdit == _mode); _active->setEnabled(canEdit); _add->setEnabled(canEdit); _addAll->setEnabled(canEdit); _addGroup->setEnabled(canEdit); // _addSite->setEnabled(canEdit); _agent->setEnabled(canEdit); _allSites->setEnabled(canEdit); _email->setEnabled(canEdit); _employee->setReadOnly(! canEdit); _enhancedAuth->setEnabled(canEdit); _exportContents->setEnabled(canEdit); _initials->setEnabled(canEdit); _locale->setEnabled(canEdit); _passwd->setEnabled(canEdit); _properName->setEnabled(canEdit); _revoke->setEnabled(canEdit); _revokeAll->setEnabled(canEdit); _revokeGroup->setEnabled(canEdit); // _revokeSite->setEnabled(canEdit); _save->setEnabled(canEdit); _selectedSites->setEnabled(canEdit); _verify->setEnabled(canEdit); if (! canEdit) { _available->setSelectionMode(QAbstractItemView::NoSelection); _availableGroup->setSelectionMode(QAbstractItemView::NoSelection); _availableSite->setSelectionMode(QAbstractItemView::NoSelection); _granted->setSelectionMode(QAbstractItemView::NoSelection); _grantedGroup->setSelectionMode(QAbstractItemView::NoSelection); _grantedSite->setSelectionMode(QAbstractItemView::NoSelection); } if(canEdit) { XSqlQuery begin; _inTransaction = begin.exec("BEGIN;"); } return NoError; } void user::sClose() { if (_mode == cNew) { XSqlQuery delq; delq.prepare( "DELETE FROM usrpriv WHERE (usrpriv_username=:username);" ); delq.bindValue(":username", _cUsername); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Privileges"), delq, __FILE__, __LINE__); } reject(); } void user::sSave() { if(save()) accept(); } bool user::save() { QString username = _username->text().trimmed().toLower(); QList errors; errors << GuiErrorCheck(! username.contains(QRegExp("[A-Za-z]")), _username, tr("You must enter a valid Username before you can save this User.")) << GuiErrorCheck(_username->text().contains(QRegExp("\\s")), _username, tr("The Username cannot include any spaces.")) << GuiErrorCheck(_passwd->text().isEmpty(), _passwd, tr("You must enter a valid Password before you can save this User.")) << GuiErrorCheck(_passwd->text() != _verify->text(), _passwd, tr("The entered password and verify do not match. " "Please enter both again carefully.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot save User"), errors)) { if (_passwd->text() != _verify->text()) { _passwd->clear(); _verify->clear(); } return false; } QString passwd = _passwd->text(); if(_enhancedAuth->isChecked()) { QRegExp xtuplecloud(".*\\.xtuplecloud\\.com.*"); QRegExp xtuple(".*\\.xtuple\\.com.*"); bool isCloud = xtuplecloud.exactMatch(omfgThis->databaseURL()); bool isXtuple = xtuple.exactMatch(omfgThis->databaseURL()); QString salt; if(isCloud || isXtuple) { salt = "private"; } else { salt = "xTuple"; } passwd = passwd + salt + username; passwd = QMd5(passwd); } XSqlQuery usrq; if (_mode == cNew) { usrq.prepare("SELECT usesysid" " FROM pg_user" " WHERE (usename=:username);" ); usrq.bindValue(":username", username); usrq.exec(); if (!usrq.first()) { usrq.prepare("SELECT createUser(:username, :createUsers);"); usrq.bindValue(":username", username); usrq.bindValue(":createUsers", QVariant(_createUsers->isChecked())); usrq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Creating User"), usrq, __FILE__, __LINE__)) return false; } } else if (_mode == cEdit) { if(_createUsers->isEnabled()) { usrq.prepare("SELECT setUserCanCreateUsers(:username, :createUsers);"); usrq.bindValue(":username", username); usrq.bindValue(":createUsers", QVariant(_createUsers->isChecked())); usrq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Saving User"), usrq, __FILE__, __LINE__)) return false; } } if(_createUsers->isEnabled()) { usrq.prepare("SELECT pg_has_role(:username,'xtrole','member') AS result;"); usrq.bindValue(":username", username); usrq.exec(); if(usrq.first() && !usrq.value("result").toBool()) { usrq.exec( QString("ALTER GROUP xtrole ADD USER %1;") .arg(username) ); } if (ErrorReporter::error(QtCriticalMsg, this, tr("Saving User"), usrq, __FILE__, __LINE__)) return false; } if (_passwd->text() != " ") { usrq.prepare( QString( "ALTER USER \"%1\" WITH PASSWORD :password;") .arg(username) ); usrq.bindValue(":password", passwd); usrq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Setting Password"), usrq, __FILE__, __LINE__)) return false; } usrq.prepare("SELECT setUserPreference(:username, 'DisableExportContents', :export)," " setUserPreference(:username, 'UseEnhancedAuthentication', :enhanced)," " setUserPreference(:username, 'selectedSites', :sites)," " setUserPreference(:username, 'propername', :propername)," " setUserPreference(:username, 'email', :email)," " setUserPreference(:username, 'initials', :initials)," " setUserPreference(:username, 'locale_id', text(:locale_id))," " setUserPreference(:username, 'agent', :agent)," " setUserPreference(:username, 'active', :active);"); usrq.bindValue(":username", username); usrq.bindValue(":export", (_exportContents->isChecked() ? "t" : "f")); usrq.bindValue(":enhanced", (_enhancedAuth->isChecked() ? "t" : "f")); usrq.bindValue(":sites", (_selectedSites->isChecked() ? "t" : "f")); usrq.bindValue(":propername", _properName->text()); usrq.bindValue(":email", _email->text()); usrq.bindValue(":initials", _initials->text()); usrq.bindValue(":locale_id", _locale->id()); usrq.bindValue(":agent", (_agent->isChecked() ? "t" : "f")); usrq.bindValue(":active", (_active->isChecked() ? "t" : "f")); usrq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Saving User"), usrq, __FILE__, __LINE__)) return false; omfgThis->sUserUpdated(username); return true; } void user::sModuleSelected(const QString &pModule) { XTreeWidgetItem *granted = NULL; XTreeWidgetItem *available = NULL; _availableGroup->clear(); _grantedGroup->clear(); XSqlQuery groups; groups.prepare("SELECT grp_id, grp_name, usrgrp_id" " FROM grp LEFT OUTER JOIN usrgrp" " ON (usrgrp_grp_id=grp_id AND usrgrp_username=:username);"); groups.bindValue(":username", _cUsername); groups.exec(); while(groups.next()) { if (groups.value("usrgrp_id").toInt() == 0) available = new XTreeWidgetItem(_availableGroup, available, groups.value("grp_id").toInt(), groups.value("grp_name")); else granted = new XTreeWidgetItem(_grantedGroup, granted, groups.value("grp_id").toInt(), groups.value("grp_name")); } if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Groups"), groups, __FILE__, __LINE__)) return; _available->clear(); _granted->clear(); XSqlQuery privs; privs.prepare( "SELECT priv_id, priv_name " "FROM priv " "WHERE (priv_module=:priv_module) " "ORDER BY priv_name;" ); privs.bindValue(":priv_module", pModule); privs.exec(); if (privs.first()) { granted = NULL; available = NULL; // Insert each priv into either the available or granted list XSqlQuery usrpriv; usrpriv.prepare( "SELECT priv_id " "FROM priv, usrpriv " "WHERE ( (usrpriv_priv_id=priv_id)" " AND (usrpriv_username=:username)" " AND (priv_module=:priv_module) );" ); usrpriv.bindValue(":username", _cUsername); usrpriv.bindValue(":priv_module", _module->currentText()); usrpriv.exec(); XSqlQuery grppriv; grppriv.prepare("SELECT priv_id" " FROM priv, grppriv, usrgrp" " WHERE((usrgrp_grp_id=grppriv_grp_id)" " AND (grppriv_priv_id=priv_id)" " AND (usrgrp_username=:username)" " AND (priv_module=:priv_module));"); grppriv.bindValue(":username", _cUsername); grppriv.bindValue(":priv_module", _module->currentText()); grppriv.exec(); do { if (usrpriv.findFirst("priv_id", privs.value("priv_id").toInt()) == -1 && grppriv.findFirst("priv_id", privs.value("priv_id").toInt()) == -1) available = new XTreeWidgetItem(_available, available, privs.value("priv_id").toInt(), privs.value("priv_name")); else { granted = new XTreeWidgetItem(_granted, granted, privs.value("priv_id").toInt(), privs.value("priv_name")); if(usrpriv.findFirst("priv_id", privs.value("priv_id").toInt()) == -1) granted->setTextColor(Qt::gray); } } while (privs.next()); } } void user::sAdd() { if (_available->id() == -1) { QMessageBox::critical(this, tr("Error"), tr("Please select an Available Privilege.")); return; } XSqlQuery privq; privq.prepare("SELECT grantPriv(:username, :priv_id) AS result;"); privq.bindValue(":username", _cUsername); privq.bindValue(":priv_id", _available->id()); privq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Granting Privilege"), privq, __FILE__, __LINE__)) return; sModuleSelected(_module->currentText()); } void user::sAddAll() { XSqlQuery privq; privq.prepare("SELECT grantAllModulePriv(:username, :module) AS result;"); privq.bindValue(":username", _cUsername); privq.bindValue(":module", _module->currentText()); privq.exec(); if (privq.first()) { int result = privq.value("result").toInt(); if (result < 0) { ErrorReporter::error(QtCriticalMsg, this, tr("Granting Privileges"), storedProcErrorLookup("grantAllModulePriv", result), __FILE__, __LINE__); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Granting Privileges"), privq, __FILE__, __LINE__)) return; sModuleSelected(_module->currentText()); } void user::sRevoke() { if (_granted->id() == -1) { QMessageBox::critical(this, tr("Error"), tr("Please select a Granted Privilege.")); return; } XSqlQuery privq; privq.prepare("SELECT revokePriv(:username, :priv_id) AS result;"); privq.bindValue(":username", _cUsername); privq.bindValue(":priv_id", _granted->id()); privq.exec(); // no storedProcErrorLookup because the function returns bool, not int if (ErrorReporter::error(QtCriticalMsg, this, tr("Revoking Privileges"), privq, __FILE__, __LINE__)) return; sModuleSelected(_module->currentText()); } void user::sRevokeAll() { XSqlQuery privq; privq.prepare("SELECT revokeAllModulePriv(:username, :module) AS result;"); privq.bindValue(":username", _cUsername); privq.bindValue(":module", _module->currentText()); privq.exec(); if (privq.first()) { int result = privq.value("result").toInt(); if (result < 0) { ErrorReporter::error(QtCriticalMsg, this, tr("Revoking Privileges"), storedProcErrorLookup("revokeAllModulePriv", result), __FILE__, __LINE__); return; } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Revoking Privileges"), privq, __FILE__, __LINE__)) return; sModuleSelected(_module->currentText()); } void user::sAddGroup() { XSqlQuery grpq; grpq.prepare("SELECT grantGroup(:username, :grp_id) AS result;"); grpq.bindValue(":username", _cUsername); grpq.bindValue(":grp_id", _availableGroup->id()); grpq.exec(); // no storedProcErrorLookup because the function returns bool, not int if (ErrorReporter::error(QtCriticalMsg, this, tr("Granting Group Privileges"), grpq, __FILE__, __LINE__)) return; sModuleSelected(_module->currentText()); } void user::sRevokeGroup() { XSqlQuery grpq; grpq.prepare("SELECT revokeGroup(:username, :grp_id) AS result;"); grpq.bindValue(":username", _cUsername); grpq.bindValue(":grp_id", _grantedGroup->id()); grpq.exec(); // no storedProcErrorLookup because the function returns bool, not int if (ErrorReporter::error(QtCriticalMsg, this, tr("Revoking Group Privileges"), grpq, __FILE__, __LINE__)) return; sModuleSelected(_module->currentText()); } void user::sCheck() { //This regexp checks to make sure the user name starts with a letter. QRegExp re("^\\d"); // just digits QRegExp re2("^\\w"); // this includes all letters & numbers of all alphabets _cUsername = _username->text().trimmed(); if (((re.indexIn(_cUsername) != -1) || (re2.indexIn(_cUsername) == -1)) && _username->text() != "") { QMessageBox::critical(this, tr("Error"), tr("User names must begin with a letter.")); _username->clear(); _username->setFocus(); return; } if (_cUsername.length() > 0) { XSqlQuery usrq; usrq.prepare("SELECT * FROM usr WHERE (usr_username=:username);"); usrq.bindValue(":username", _cUsername); usrq.exec(); if (usrq.first()) { sPopulate(); _mode = cEdit; _username->setEnabled(FALSE); _properName->setFocus(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting User"), usrq, __FILE__, __LINE__)) return; } } bool user::sPopulate() { XSqlQuery usrq; if (! _cUsername.isEmpty()) { usrq.prepare("SELECT *, userCanCreateUsers(usr_username) AS createusers," " userCanCreateUsers(getEffectiveXtUser()) AS enablecreateusers," " crmacct_id, crmacct_emp_id, crmacct_owner_username" " FROM usr" " LEFT OUTER JOIN crmacct ON (usr_username=crmacct_usr_username) " "WHERE (usr_username=:usr_username);" ); usrq.bindValue(":usr_username", _cUsername); } else if (_crmacctid > 0) { usrq.prepare("SELECT LOWER(crmacct_number) AS usr_username," " crmacct_name AS usr_propername," " (SELECT locale_id" " FROM locale" " WHERE locale_code='Default') AS usr_locale_id," " NULL AS usr_passwd, cntct_initials AS usr_initials," " FALSE AS usr_agent, crmacct_active AS usr_active," " NULL AS usr_window, cntct_email AS usr_email," " FALSE AS createusers," " userCanCreateUsers(getEffectiveXtUser()) AS enablecreateusers," " crmacct_id, crmacct_emp_id, crmacct_owner_username" " FROM crmacct" " LEFT OUTER JOIN cntct ON (crmacct_cntct_id_1=cntct_id)" " WHERE (crmacct_id=:id);"); usrq.bindValue(":id", _crmacctid); } usrq.exec(); if (usrq.first()) { _username->setText(usrq.value("usr_username")); if (_crmacctid > 0) { if (_username->text().contains(QRegExp("\\s"))) { QMessageBox::warning(this, tr("No Spaces Allowed"), tr("

    Usernames cannot include space characters " "but must also match the associated CRM Account " "numbers. Please Cancel the User window and " "remove the spaces from the CRM Account number " "before trying to create this User.")); return false; } _username->setEnabled(false); } _active->setChecked(usrq.value("usr_active").toBool()); _properName->setText(usrq.value("usr_propername")); _initials->setText(usrq.value("usr_initials")); _email->setText(usrq.value("usr_email")); _locale->setId(usrq.value("usr_locale_id").toInt()); _agent->setChecked(usrq.value("usr_agent").toBool()); _createUsers->setChecked(usrq.value("createusers").toBool()); _createUsers->setEnabled(usrq.value("enablecreateusers").toBool()); _employee->setId(usrq.value("crmacct_emp_id").toInt()); _crmacctid = usrq.value("crmacct_id").toInt(); _crmowner = usrq.value("crmacct_owner_username").toString(); _passwd->setText(" "); _verify->setText(" "); usrq.prepare( "SELECT usrpref_value " " FROM usrpref " " WHERE ( (usrpref_name = 'DisableExportContents') " " AND (usrpref_username=:username) ); "); usrq.bindValue(":username", _cUsername); usrq.exec(); if(usrq.first()) _exportContents->setChecked(usrq.value("usrpref_value").toString()=="t"); else _exportContents->setChecked(FALSE); usrq.prepare( "SELECT usrpref_value " " FROM usrpref " " WHERE ( (usrpref_name = 'UseEnhancedAuthentication') " " AND (usrpref_username=:username) ); "); usrq.bindValue(":username", _cUsername); usrq.exec(); _authCache = false; if(usrq.first()) _authCache = (usrq.value("usrpref_value").toString()=="t"); _enhancedAuth->setChecked(_authCache); usrq.prepare( "SELECT priv_module " "FROM usrpriv, priv " "WHERE ( (usrpriv_priv_id=priv_id)" " AND (usrpriv_username=:username) ) " "ORDER BY priv_module " "LIMIT 1;" ); usrq.bindValue(":username", _cUsername); usrq.exec(); if (usrq.first()) { _module->setCode(usrq.value("priv_module").toString()); sModuleSelected(_module->currentText()); } else { _module->setCurrentIndex(0); sModuleSelected(_module->itemText(0)); } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting User"), usrq, __FILE__, __LINE__)) return false; usrq.prepare( "SELECT usrpref_value " " FROM usrpref " " WHERE ( (usrpref_name = 'selectedSites') " " AND (usrpref_username=:username) " " AND (usrpref_value='t') ); "); usrq.bindValue(":username", _cUsername); usrq.exec(); if(usrq.first()) _selectedSites->setChecked(TRUE); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting User Sites"), usrq, __FILE__, __LINE__)) return false; if (_metrics->boolean("MultiWhs")) populateSite(); _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); return true; } void user::sEnhancedAuthUpdate() { if((_mode == cEdit) && (_authCache != _enhancedAuth->isChecked()) && (_passwd->text() == " ")) QMessageBox::information( this, tr("Enhanced Authentication"), tr("

    You have changed this user's Enhanced Authentication option. " "The password must be updated in order for this change to take " "full effect.") ); } void user::sAddSite() { if(_mode == cNew) { if(!save()) return; else { _mode = cEdit; _username->setEnabled(false); } } XSqlQuery siteq; siteq.prepare("SELECT grantSite(:username, :warehous_id) AS result;"); siteq.bindValue(":username", _cUsername); siteq.bindValue(":warehous_id", _availableSite->id()); siteq.exec(); // no storedProcErrorLookup because the function returns bool, not int if (ErrorReporter::error(QtCriticalMsg, this, tr("Granting Site Privilege"), siteq, __FILE__, __LINE__)) return; populateSite(); } void user::sRevokeSite() { XSqlQuery siteq; siteq.prepare("SELECT revokeSite(:username, :warehous_id) AS result;"); siteq.bindValue(":username", _cUsername); siteq.bindValue(":warehous_id", _grantedSite->id()); siteq.exec(); // no storedProcErrorLookup because the function returns bool, not int if (ErrorReporter::error(QtCriticalMsg, this, tr("Revoking Site Privilege"), siteq, __FILE__, __LINE__)) return; populateSite(); } void user::populateSite() { XSqlQuery siteq; if (_mode == cNew) { siteq.prepare("SELECT warehous_id, warehous_code" " FROM whsinfo" " ORDER BY warehous_code;"); siteq.exec(); _availableSite->populate(siteq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Sites"), siteq, __FILE__, __LINE__)) return; } else { QString sql; MetaSQLQuery mql; ParameterList params; params.append("username", _username->text().trimmed().toLower()); sql = "SELECT warehous_id, warehous_code " " FROM whsinfo " " WHERE warehous_id NOT IN ( " " SELECT warehous_id " " FROM whsinfo, usrsite " " WHERE ( (usrsite_warehous_id=warehous_id) " " AND (usrsite_username=))) "; mql.setQuery(sql); siteq = mql.toQuery(params); _availableSite->populate(siteq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Ungranted Sites"), siteq, __FILE__, __LINE__)) return; sql = "SELECT warehous_id,warehous_code,0 AS warehous_level " "FROM whsinfo, usrsite " "WHERE ( (usrsite_warehous_id=warehous_id) " " AND (usrsite_username=)) "; mql.setQuery(sql); siteq = mql.toQuery(params); _grantedSite->populate(siteq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Granted Sites"), siteq, __FILE__, __LINE__)) return; } } void user::done(int result) { if(_inTransaction) { if(result == QDialog::Accepted) XSqlQuery commit("COMMIT;"); else XSqlQuery rollback("ROLLBACK;"); _inTransaction = false; } XDialog::done(result); } void user::sCrmAccount() { ParameterList params; params.append("crmacct_id", _crmacctid); if ((cView == _mode && _privileges->check("ViewAllCRMAccounts")) || (cView == _mode && _privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner) || (cEdit == _mode && _privileges->check("ViewAllCRMAccounts") && ! _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("ViewPersonalCRMAccounts") && ! _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else if ((cEdit == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if ((cNew == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cNew == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else { qWarning("tried to open CRM Account window without privilege"); return; } crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } qt-client-4.1.0/guiclient/user.h000066400000000000000000000030461217451700100165270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef USER_H #define USER_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_user.h" class user : public XDialog, public Ui::user { Q_OBJECT public: user(QWidget* parent = 0, const char * = 0, Qt::WindowFlags fl = 0); ~user(); bool save(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual bool sPopulate(); virtual void populateSite(); virtual void done(int); protected slots: virtual void languageChange(); virtual void sClose(); virtual void sCrmAccount(); virtual void sSave(); virtual void sModuleSelected( const QString & pModule ); virtual void sAdd(); virtual void sAddAll(); virtual void sRevoke(); virtual void sRevokeAll(); virtual void sEnhancedAuthUpdate(); virtual void sAddGroup(); virtual void sRevokeGroup(); virtual void sAddSite(); virtual void sRevokeSite(); private: QString _cUsername; bool _authCache; int _crmacctid; QString _crmowner; bool _inTransaction; int _mode; }; #endif // USER_H qt-client-4.1.0/guiclient/user.ui000066400000000000000000000617101217451700100167170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. user 0 0 614 519 User Information 12 &Username: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _username 0 80 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 false CRM Account... Proper &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _properName &Initials: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _initials 60 32767 Qt::Horizontal QSizePolicy::Expanding 20 20 &Active true &Email Address: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _email &Password: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _passwd QLineEdit::Password Purchasing Agent Can Create System Users Disable Export Display Contents Use Enhanced Authentication &Verify: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _verify QLineEdit::Password 5 L&ocale: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _locale true false Employee: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter &Save true &Cancel Qt::Vertical QSizePolicy::Expanding 20 0 0 1 0 Privileges &Module: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _module Qt::Horizontal QSizePolicy::Expanding 20 20 5 5 Qt::Vertical QSizePolicy::Expanding 20 20 0 Add-> Add All->> 0 <-Revoke <<-Revoke All Qt::Vertical QSizePolicy::Expanding 20 20 Roles 5 Qt::Vertical QSizePolicy::Expanding 20 0 0 Add-> 0 <-Revoke Qt::Vertical QSizePolicy::Expanding 20 0 Sites Grant Access to all Sites true Grant access only to selected Sites Qt::Horizontal 131 20 5 false 5 Qt::Vertical QSizePolicy::Expanding 20 20 0 false Add-> 0 false <-Revoke Qt::Vertical QSizePolicy::Expanding 20 20 false EmpCluster QWidget

    empcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _username _properName _initials _email _passwd _verify _agent _createUsers _exportContents _enhancedAuth _locale _employee _module _available _add _addAll _revoke _revokeAll _granted _tab _availableGroup _addGroup _revokeGroup _grantedGroup _close _save _available valid(bool) _add setEnabled(bool) 27 404 338 314 _granted valid(bool) _revoke setEnabled(bool) 576 404 338 371 _availableGroup valid(bool) _addGroup setEnabled(bool) 180 391 180 391 _grantedGroup valid(bool) _revokeGroup setEnabled(bool) 180 391 180 391 _selectedSites toggled(bool) _availableSite setEnabled(bool) 187 259 177 302 _availableSite valid(bool) _addSite setEnabled(bool) 136 342 270 322 _grantedSite valid(bool) _revokeSite setEnabled(bool) 460 342 274 358 _selectedSites toggled(bool) _grantedSite setEnabled(bool) 254 262 384 298 qt-client-4.1.0/guiclient/userCostingElement.cpp000066400000000000000000000145531217451700100217300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "userCostingElement.h" #include #include userCostingElement::userCostingElement(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_acceptPO, SIGNAL(toggled(bool)), _useCostItem, SLOT(setDisabled(bool))); connect(_acceptPO, SIGNAL(toggled(bool)), _expense, SLOT(setDisabled(bool))); _item->setType(ItemLineEdit::cCosting); _expense->setType(GLCluster::cExpense); } userCostingElement::~userCostingElement() { // no need to delete child widgets, Qt does it all for us } void userCostingElement::languageChange() { retranslateUi(this); } enum SetResponse userCostingElement::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("costelem_id", &valid); if (valid) { _costelemid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _active->setEnabled(FALSE); _acceptPO->setEnabled(FALSE); _expense->setEnabled((FALSE)); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void userCostingElement::sSave() { XSqlQuery userSave; if (_name->text().trimmed().length() == 0) { QMessageBox::critical( this, tr("Cannot Save Costing Element"), tr( "You must enter a Name for this Costing Element." ) ); _name->setFocus(); return; } if (_mode == cNew) { if (sCheck()) { QMessageBox::warning( this, tr("Cannot Save Costing Element"), tr("This Costing Element already exists. You have been placed in edit mode.") ); _name->setFocus(); return; } userSave.exec("SELECT NEXTVAL('costelem_costelem_id_seq') AS _costelem_id"); if (userSave.first()) _costelemid = userSave.value("_costelem_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } userSave.prepare( "INSERT INTO costelem " "( costelem_id, costelem_type, costelem_active," " costelem_sys, costelem_po, costelem_cost_item_id, costelem_exp_accnt_id ) " "VALUES " "( :costelem_id, :costelem_type, :costelem_active," " FALSE, :costelem_po, :costelem_cost_item_id, :costelem_exp_accnt_id );" ); } else if (_mode == cEdit) { userSave.prepare( "SELECT costelem_id " "FROM costelem " "WHERE ( (costelem_id <> :costelem_id)" "AND (costelem_type=:costelem_type) );" ); userSave.bindValue(":costelem_id", _costelemid); userSave.bindValue(":costelem_type", _name->text().trimmed()); userSave.exec(); if (userSave.first()) { QMessageBox::critical( this, tr("Cannot Save Costing Element"), tr( "A Costing Elements with the entered code already exists.\n" "You may not create a Costing Element with this code." ) ); _name->setFocus(); return; } userSave.prepare( "UPDATE costelem " "SET costelem_type=:costelem_type," " costelem_active=:costelem_active, costelem_po=:costelem_po," " costelem_cost_item_id=:costelem_cost_item_id," " costelem_exp_accnt_id=:costelem_exp_accnt_id " "WHERE (costelem_id=:costelem_id);" ); } userSave.bindValue(":costelem_id", _costelemid); userSave.bindValue(":costelem_type", _name->text().trimmed()); userSave.bindValue(":costelem_active", QVariant(_active->isChecked())); userSave.bindValue(":costelem_po", QVariant(_acceptPO->isChecked())); if (_expense->isEnabled() && _expense->isValid()) userSave.bindValue(":costelem_exp_accnt_id",_expense->id()); if (_useCostItem->isChecked()) userSave.bindValue(":costelem_cost_item_id", _item->id()); else userSave.bindValue(":costelem_cost_item_id", -1); userSave.exec(); done(_costelemid); } void userCostingElement::populate() { XSqlQuery userpopulate; userpopulate.prepare( "SELECT costelem_type, costelem_active," " costelem_po, costelem_cost_item_id, costelem_exp_accnt_id " "FROM costelem " "WHERE (costelem_id=:costelem_id);" ); userpopulate.bindValue(":costelem_id", _costelemid); userpopulate.exec(); if (userpopulate.first()) { _name->setText(userpopulate.value("costelem_type").toString()); _expense->setId(userpopulate.value("costelem_exp_accnt_id").toInt()); _active->setChecked(userpopulate.value("costelem_active").toBool()); if (userpopulate.value("costelem_po").toBool()) _acceptPO->setChecked(TRUE); else { if (userpopulate.value("costelem_cost_item_id").toInt() != -1) { _useCostItem->setChecked(TRUE); _item->setId(userpopulate.value("costelem_cost_item_id").toInt()); } } } } bool userCostingElement::sCheck() { XSqlQuery userCheck; _name->setText(_name->text().trimmed()); if ((_mode == cNew) && (_name->text().length())) { userCheck.prepare( "SELECT costelem_id " "FROM costelem " "WHERE (UPPER(costelem_type)= UPPER(:costelem_type));" ); userCheck.bindValue(":costelem_type", _name->text()); userCheck.exec(); if (userCheck.first()) { _costelemid = userCheck.value("costelem_id").toInt(); _mode = cEdit; populate(); return TRUE; } } return FALSE; } qt-client-4.1.0/guiclient/userCostingElement.h000066400000000000000000000021571217451700100213720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef USERCOSTINGELEMENT_H #define USERCOSTINGELEMENT_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_userCostingElement.h" class userCostingElement : public XDialog, public Ui::userCostingElement { Q_OBJECT public: userCostingElement(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~userCostingElement(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void populate(); virtual bool sCheck(); protected slots: virtual void languageChange(); private: int _mode; int _costelemid; }; #endif // USERCOSTINGELEMENT_H qt-client-4.1.0/guiclient/userCostingElement.ui000066400000000000000000000165431217451700100215640ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. userCostingElement 0 0 466 255 User Costing Element 7 5 5 Element &Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 5 &Active true 0 Accept P/&O Distributions Qt::Horizontal QSizePolicy::Expanding 20 20 Use Costing Item for Cost Source true false true Expense Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Qt::Vertical QSizePolicy::Preferred 20 16 0 5 &Cancel &Save false true Qt::Vertical QSizePolicy::Expanding 20 20 GLCluster QWidget
    glcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    XLineEdit QLineEdit
    xlineedit.h
    1
    _name _acceptPO _useCostItem _expense _active _save _close parameter.h _close clicked() userCostingElement reject() 20 20 20 20 _acceptPO toggled(bool) _useCostItem setDisabled(bool) 20 20 20 20
    qt-client-4.1.0/guiclient/userList.cpp000066400000000000000000000040221217451700100177110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "userList.h" #include /* * Constructs a userList as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ userList::userList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_usr, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_usr, SIGNAL(itemSelected(int)), _select, SLOT(animateClick())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); _usr->addColumn( tr("Username"), _itemColumn, Qt::AlignLeft, true, "usr_username" ); _usr->addColumn( tr("Proper Name"), -1, Qt::AlignLeft, true, "usr_propername" ); _usr->populate( "SELECT usr_id, usr_username, usr_propername " "FROM usr " "ORDER BY usr_username;" ); } /* * Destroys the object and frees any allocated resources */ userList::~userList() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void userList::languageChange() { retranslateUi(this); } enum SetResponse userList::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("usr_id", &valid); if (valid) _usr->setId(param.toInt()); return NoError; } void userList::sSelect() { done(_usr->id()); } qt-client-4.1.0/guiclient/userList.h000066400000000000000000000016661217451700100173710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef USERLIST_H #define USERLIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_userList.h" class userList : public XDialog, public Ui::userList { Q_OBJECT public: userList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~userList(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSelect(); protected slots: virtual void languageChange(); }; #endif // USERLIST_H qt-client-4.1.0/guiclient/userList.ui000066400000000000000000000100501217451700100175420ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. userList 0 0 401 362 User List 5 7 0 0 Users: 0 0 0 5 &Cancel &Select true true Qt::Vertical QSizePolicy::Expanding 10 51 XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _usr valid(bool) _select setEnabled(bool) 20 20 20 20 _usr itemSelected(int) _select animateClick() 20 20 20 20 _close clicked() userList reject() 20 20 20 20
    qt-client-4.1.0/guiclient/userPreferences.cpp000066400000000000000000000536261217451700100212550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "userPreferences.h" #include #include #include #include #include #include #include "storedProcErrorLookup.h" #include #include "hotkey.h" #include "imageList.h" #include "timeoutHandler.h" #include "translations.h" #include "dictionaries.h" extern QString __password; userPreferences::userPreferences(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _pref = _preferences; _altPref = 0; if(!_privileges->check("MaintainPreferencesOthers")) _selectedUser->setEnabled(false); QPushButton* apply = _buttonBox->button(QDialogButtonBox::Apply); connect(apply, SIGNAL(clicked()), this, SLOT(sApply())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_backgroundList,SIGNAL(clicked()), this, SLOT(sBackgroundList())); connect(_selectedUser, SIGNAL(toggled(bool)), this, SLOT(sPopulate())); connect(_user, SIGNAL(newID(int)), this, SLOT(sPopulate())); //hot key signals and slots connections connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_hotkey, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_hotkey, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_hotkey, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); _hotkey->addColumn(tr("Keystroke"), _itemColumn, Qt::AlignLeft ); _hotkey->addColumn(tr("Action"), -1, Qt::AlignLeft ); _hotkey->addColumn("key", 0, Qt::AlignLeft ); connect(_warehouses, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(sWarehouseToggled(QTreeWidgetItem*))); connect(_event, SIGNAL(itemSelected(int)), this, SLOT(sAllWarehousesToggled(int))); connect(_event, SIGNAL(itemSelectionChanged()), this, SLOT(sFillWarehouseList())); connect(_translations, SIGNAL(clicked()), this, SLOT(sTranslations())); connect(_dictionaries, SIGNAL(clicked()), this, SLOT(sDictionaries())); _event->addColumn(tr("Module"), 50, Qt::AlignCenter, true, "evnttype_module" ); _event->addColumn(tr("Name"), 150, Qt::AlignLeft, true, "evnttype_name" ); _event->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "evnttype_descrip" ); _event->populate( "SELECT evnttype_id, evnttype_module, evnttype_name, evnttype_descrip " "FROM evnttype " "ORDER BY evnttype_module, evnttype_name" ); _warehouses->addColumn(tr("Notify"), 50, Qt::AlignCenter, true, "notify" ); _warehouses->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _warehouses->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "warehous_descrip" ); _warehouses->populate( "SELECT warehous_id, TEXT('-') AS notify, warehous_code, warehous_descrip " "FROM whsinfo " "ORDER BY warehous_code" ); _dirty = FALSE; #ifndef Q_WS_MAC _backgroundList->setMaximumWidth(25); #endif _user->setType(XComboBox::Users); _ellipsesAction->append(1, tr("List")); _ellipsesAction->append(2, tr("Search")); if (!_metrics->boolean("EnableBatchManager")) { _alarmEmail->setVisible(false); _emailEvents->setVisible(false); } _translations->setEnabled(_privileges->check("MaintainTranslations")); _dictionaries->setEnabled(_privileges->check("MaintainDictionaries")); sPopulate(); adjustSize(); } userPreferences::~userPreferences() { // no need to delete child widgets, Qt does it all for us if(_altPref) delete _altPref; } void userPreferences::languageChange() { retranslateUi(this); } void userPreferences::setBackgroundImage(int pImageid) { XSqlQuery useretBackgroundImage; useretBackgroundImage.prepare( "SELECT image_id, (image_name || ' - ' || image_descrip) AS description " "FROM image " "WHERE (image_id=:image_id);" ); useretBackgroundImage.bindValue(":image_id", pImageid); useretBackgroundImage.exec(); if (useretBackgroundImage.first()) { _backgroundImageid = useretBackgroundImage.value("image_id").toInt(); _background->setText(useretBackgroundImage.value("description").toString()); } else if (useretBackgroundImage.lastError().type() != QSqlError::NoError) { systemError(this, useretBackgroundImage.lastError().databaseText(), __FILE__, __LINE__); return; } } void userPreferences::sBackgroundList() { ParameterList params; params.append("image_id", _backgroundImageid); imageList newdlg(this, "", TRUE); newdlg.set(params); int imageid; if ((imageid = newdlg.exec()) != 0) setBackgroundImage(imageid); } void userPreferences::sPopulate() { if (_currentUser->isChecked()) { _pref = _preferences; _username->setText(omfgThis->username()); } else { if(_altPref) delete _altPref; _altPref = new Preferences(_user->currentText()); _pref = _altPref; _username->setText(_user->currentText()); } _username->setEnabled(FALSE); _currentpassword->setEnabled(_currentUser->isChecked()); _newpassword->setEnabled(_currentUser->isChecked()); _retypepassword->setEnabled(_currentUser->isChecked()); if (_pref->value("BackgroundImageid").toInt() > 0) { _backgroundImage->setChecked(TRUE); setBackgroundImage(_pref->value("BackgroundImageid").toInt()); } else { _noBackgroundImage->setChecked(TRUE); _background->clear(); _backgroundImageid = -1; } if (_pref->value("PreferredWarehouse").toInt() == -1) _noWarehouse->setChecked(TRUE); else { _selectedWarehouse->setChecked(TRUE); _warehouse->setId(_pref->value("PreferredWarehouse").toInt()); } if (_pref->value("InterfaceWindowOption") == "Workspace") _interfaceWorkspace->setChecked(true); else _interfaceTopLevel->setChecked(true); if (_pref->boolean("CopyListsPlainText")) _plainText->setChecked(true); else _richText->setChecked(true); _enableSpell->setChecked(_pref->boolean("SpellCheck")); //_rememberCheckBoxes->setChecked(! _pref->boolean("XCheckBox/forgetful")); _inventoryMenu->setChecked(_pref->boolean("ShowIMMenu")); _productsMenu->setChecked(_pref->boolean("ShowPDMenu")); _scheduleMenu->setChecked(_pref->boolean("ShowMSMenu")); _manufactureMenu->setChecked(_pref->boolean("ShowWOMenu")); _crmMenu2->setChecked(_pref->boolean("ShowCRMMenu")); _purchaseMenu->setChecked(_pref->boolean("ShowPOMenu")); _salesMenu->setChecked(_pref->boolean("ShowSOMenu")); _accountingMenu->setChecked(_pref->boolean("ShowGLMenu")); _inventoryToolbar->setChecked(_pref->boolean("ShowIMToolbar")); _productsToolbar->setChecked(_pref->boolean("ShowPDToolbar")); _scheduleToolbar->setChecked(_pref->boolean("ShowMSToolbar")); _manufactureToolbar->setChecked(_pref->boolean("ShowWOToolbar")); _crmToolbar2->setChecked(_pref->boolean("ShowCRMToolbar")); _purchaseToolbar->setChecked(_pref->boolean("ShowPOToolbar")); _salesToolbar->setChecked(_pref->boolean("ShowSOToolbar")); _accountingToolbar->setChecked(_pref->boolean("ShowGLToolbar")); _listNumericItemsFirst->setChecked(_pref->boolean("ListNumericItemNumbersFirst")); _ignoreTranslation->setChecked(_pref->boolean("IngoreMissingTranslationFiles")); _idleTimeout->setValue(_pref->value("IdleTimeout").toInt()); _emailEvents->setChecked(_pref->boolean("EmailEvents")); _alarmEvent->setChecked(_pref->boolean("AlarmEventDefault")); _alarmEmail->setChecked(_pref->boolean("AlarmEmailDefault")); _alarmSysmsg->setChecked(_pref->boolean("AlarmSysmsgDefault")); if(_pref->value("DefaultEllipsesAction") == "search") _ellipsesAction->setId(2); else _ellipsesAction->setId(1); _alternating->setChecked(!_pref->boolean("NoAlternatingRowColors")); //Hide for PostBooks if (_metrics->value("Application") == "PostBooks") { _scheduleMenu->hide(); _scheduleToolbar->hide(); } if (!_metrics->boolean("MultiWhs")) _warehouseGroup->hide(); _debug->setChecked(_pref->boolean("EnableScriptDebug")); sFillList(); sFillWarehouseList(); } void userPreferences::sApply() { sSave(false); sPopulate(); } void userPreferences::sSave(bool close) { if (_backgroundImage->isChecked()) _pref->set("BackgroundImageid", _backgroundImageid); else _pref->set("BackgroundImageid", -1); _pref->set("SpellCheck", _enableSpell->isChecked()); if(_enableSpell->isChecked()) { QString langName = QLocale::languageToString(QLocale().language()); QString appPath = QApplication::applicationDirPath(); QString fullPathWithoutExt = appPath + "/" + langName; QFile affFile(fullPathWithoutExt + ".aff"); QFile dicFile(fullPathWithoutExt + ".dic"); // If we don't have files for the first name lets try a more common naming convention if(!(affFile.exists() && dicFile.exists())) { langName = QLocale().name().toLower(); // retruns lang_cntry format en_us for example fullPathWithoutExt = appPath + "/" + langName; affFile.setFileName(fullPathWithoutExt + tr(".aff")); dicFile.setFileName(fullPathWithoutExt + tr(".dic")); } if(!affFile.exists() || !dicFile.exists()) { QMessageBox::warning( this, tr("Spell Dictionary Missing"), tr("The following Hunspell files are required for spell checking:

    ") + fullPathWithoutExt + tr(".aff

    ") + fullPathWithoutExt + tr(".dic")); } } _pref->set("ShowIMMenu", _inventoryMenu->isChecked()); _pref->set("ShowPDMenu", _productsMenu->isChecked()); _pref->set("ShowMSMenu", _scheduleMenu->isChecked()); _pref->set("ShowWOMenu", _manufactureMenu->isChecked()); _pref->set("ShowCRMMenu", _crmMenu2->isChecked()); _pref->set("ShowPOMenu", _purchaseMenu->isChecked()); _pref->set("ShowSOMenu", _salesMenu->isChecked()); _pref->set("ShowGLMenu", _accountingMenu->isChecked()); _pref->set("ShowIMToolbar", _inventoryToolbar->isChecked()); _pref->set("ShowPDToolbar", _productsToolbar->isChecked()); _pref->set("ShowMSToolbar", _scheduleToolbar->isChecked()); _pref->set("ShowWOToolbar", _manufactureToolbar->isChecked()); _pref->set("ShowCRMToolbar", _crmToolbar2->isChecked()); _pref->set("ShowPOToolbar", _purchaseToolbar->isChecked()); _pref->set("ShowSOToolbar", _salesToolbar->isChecked()); _pref->set("ShowGLToolbar", _accountingToolbar->isChecked()); _pref->set("PreferredWarehouse", ((_noWarehouse->isChecked()) ? -1 : _warehouse->id()) ); _pref->set("ListNumericItemNumbersFirst", _listNumericItemsFirst->isChecked()); _pref->set("IngoreMissingTranslationFiles", _ignoreTranslation->isChecked()); _pref->set("IdleTimeout", _idleTimeout->value()); omfgThis->_timeoutHandler->setIdleMinutes(_idleTimeout->value()); if(_ellipsesAction->id() == 2) _pref->set("DefaultEllipsesAction", QString("search")); else _pref->set("DefaultEllipsesAction", QString("list")); _pref->set("NoAlternatingRowColors", !_alternating->isChecked()); if(_interfaceWorkspace->isChecked()) _pref->set("InterfaceWindowOption", QString("Workspace")); else _pref->set("InterfaceWindowOption", QString("TopLevel")); _pref->set("CopyListsPlainText", _plainText->isChecked()); _pref->set("EmailEvents", _emailEvents->isChecked()); _pref->set("AlarmEventDefault", _alarmEvent->isChecked()); _pref->set("AlarmEmailDefault", _alarmEmail->isChecked()); _pref->set("AlarmSysmsgDefault", _alarmSysmsg->isChecked()); _pref->set("EnableScriptDebug", _debug->isChecked()); if (_currentUser->isChecked()) { _preferences->load(); omfgThis->initMenuBar(); } if (_currentUser->isChecked() && !_currentpassword->text().isEmpty()) { if (save() && close) accept(); } else if (close) accept(); } bool userPreferences::save() { XSqlQuery userave; if (_currentpassword->text().length() == 0) { QMessageBox::warning( this, tr("Cannot save User"), tr( "You must enter a valid Current Password before you can save this User." )); _currentpassword->setFocus(); return false; } if (_newpassword->text().length() == 0) { QMessageBox::warning( this, tr("Cannot save User"), tr( "You must enter a valid Password before you can save this User." )); _newpassword->setFocus(); return false; } QString passwd = _newpassword->text(); QString currentpasswd = _currentpassword->text(); // TODO: have to compare this against something usefull if(currentpasswd != __password) { QMessageBox::warning( this, tr("Cannot save User"), tr( "Please Verify Current Password." )); _currentpassword->setFocus(); return false; } if (_newpassword->text() != _retypepassword->text()) { QMessageBox::warning( this, tr("Password do not Match"), tr( "The entered password and verify do not match\n" "Please enter both again carefully." )); _newpassword->clear(); _retypepassword->clear(); _newpassword->setFocus(); return false; } if (_newpassword->text() != " ") { userave.prepare( "SELECT usrpref_value " " FROM usrpref " " WHERE ( (usrpref_name = 'UseEnhancedAuthentication') " " AND (usrpref_username=:username) ); "); userave.bindValue(":username", _username->text().trimmed().toLower()); userave.exec(); if(userave.first()) { if (userave.value("usrpref_value").toString()=="t") { QRegExp xtuplecloud(".*\\.xtuplecloud\\.com.*"); QRegExp xtuple(".*\\.xtuple\\.com.*"); bool isCloud = xtuplecloud.exactMatch(omfgThis->databaseURL()); bool isXtuple = xtuple.exactMatch(omfgThis->databaseURL()); QString salt; if(isCloud || isXtuple) { salt = "private"; } else { salt = "xTuple"; } passwd = passwd + salt + _username->text(); passwd = QMd5(passwd); } } userave.prepare( QString( "ALTER USER \"%1\" WITH PASSWORD :password;") .arg(_username->text()) ); userave.bindValue(":password", passwd); userave.exec(); if (userave.lastError().type() != QSqlError::NoError) { systemError(this, userave.lastError().databaseText(), __FILE__, __LINE__); return false; } } return true; } void userPreferences::sClose() { if (_dirty) omfgThis->initMenuBar(); reject(); } void userPreferences::sFillList() { _hotkey->clear(); QString hotkey; QString action; char key; XTreeWidgetItem *last = 0; if (_currentUser->isChecked()) { for (key = '1'; key <= '9'; key++) { hotkey = QString("F%1").arg(key); action = _preferences->value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(tr("F%1").arg(key)), action, hotkey); } for (key = 'A'; key <= 'Z'; key++) { hotkey = QString("C%1").arg(key); action = _preferences->value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(QString("Ctrl+%1").arg(key)), action, hotkey); } for (key = '0'; key <= '9'; key++) { hotkey = QString("C%1").arg(key); action = _preferences->value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(QString("Ctrl+%1").arg(key)), action, hotkey); } } else { Preferences pref(_user->currentText()); for (key = '1'; key <= '9'; key++) { hotkey = QString("F%1").arg(key); action = pref.value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(tr("F%1").arg(key)), action, hotkey); } for (key = 'A'; key <= 'Z'; key++) { hotkey = QString("C%1").arg(key); action = pref.value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1,QVariant( QString("Ctrl+%1").arg(key)), action, hotkey); } for (key = '0'; key <= '9'; key++) { hotkey = QString("C%1").arg(key); action = pref.value(hotkey); if (!action.isNull()) last = new XTreeWidgetItem(_hotkey, last, -1, QVariant(QString("Ctrl+%1").arg(key)), action, hotkey); } } } void userPreferences::sNew() { ParameterList params; params.append("mode", "new"); if (_currentUser->isChecked()) params.append("currentUser"); else params.append("username", _user->currentText()); hotkey newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { _dirty = TRUE; sFillList(); } } void userPreferences::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("hotkey", _hotkey->currentItem()->text(2)); if (_currentUser->isChecked()) params.append("currentUser"); else params.append("username", _user->currentText()); hotkey newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { _dirty = TRUE; sFillList(); } } void userPreferences::sDelete() { XSqlQuery userDelete; if (_currentUser->isChecked()) { _preferences->remove(_hotkey->currentItem()->text(2)); _preferences->load(); } else { userDelete.prepare("SELECT deleteUserPreference(:username, :name) AS _result;"); if (_currentUser->isChecked()) userDelete.bindValue(":username", omfgThis->username()); else userDelete.bindValue(":username", _user->currentText()); userDelete.bindValue(":name", _hotkey->currentItem()->text(2)); userDelete.exec(); } _dirty = TRUE; sFillList(); } void userPreferences::sAllWarehousesToggled(int pEvnttypeid) { XSqlQuery userAllWarehousesToggled; if(!(_warehouses->topLevelItemCount() > 0)) return; if (_warehouses->topLevelItem(0)->text(0) == tr("Yes")) userAllWarehousesToggled.prepare( "DELETE FROM evntnot " "WHERE ( (evntnot_username=:username)" " AND (evntnot_evnttype_id=:evnttype_id) );" ); else userAllWarehousesToggled.prepare( "DELETE FROM evntnot " "WHERE ( (evntnot_username=:username)" " AND (evntnot_evnttype_id=:evnttype_id) ); " "INSERT INTO evntnot " "(evntnot_username, evntnot_evnttype_id, evntnot_warehous_id) " "SELECT :username, :evnttype_id, warehous_id " "FROM whsinfo;" ); if (_currentUser->isChecked()) userAllWarehousesToggled.bindValue(":username", omfgThis->username()); else userAllWarehousesToggled.bindValue(":username", _user->currentText()); userAllWarehousesToggled.bindValue(":evnttype_id", pEvnttypeid); userAllWarehousesToggled.exec(); if (userAllWarehousesToggled.lastError().type() != QSqlError::NoError) { systemError(this, userAllWarehousesToggled.lastError().databaseText(), __FILE__, __LINE__); return; } sFillWarehouseList(); } void userPreferences::sWarehouseToggled(QTreeWidgetItem *selected) { XSqlQuery userWarehouseToggled; if(!selected) return; if (selected->text(0) == tr("Yes")) userWarehouseToggled.prepare( "DELETE FROM evntnot " "WHERE ( (evntnot_username=:username)" " AND (evntnot_evnttype_id=:evnttype_id)" " AND (evntnot_warehous_id=:warehous_id) );" ); else userWarehouseToggled.prepare( "INSERT INTO evntnot " "(evntnot_username, evntnot_evnttype_id, evntnot_warehous_id) " "VALUES " "(:username, :evnttype_id, :warehous_id);" ); if (_currentUser->isChecked()) userWarehouseToggled.bindValue(":username", omfgThis->username()); else userWarehouseToggled.bindValue(":username", _user->currentText()); userWarehouseToggled.bindValue(":evnttype_id", _event->id()); userWarehouseToggled.bindValue(":warehous_id", ((XTreeWidgetItem *)selected)->id()); userWarehouseToggled.exec(); if (userWarehouseToggled.lastError().type() != QSqlError::NoError) { systemError(this, userWarehouseToggled.lastError().databaseText(), __FILE__, __LINE__); return; } sFillWarehouseList(); } void userPreferences::sFillWarehouseList() { XSqlQuery userFillWarehouseList; for (int i = 0; i < _warehouses->topLevelItemCount(); i++) { userFillWarehouseList.prepare( "SELECT evntnot_id " "FROM evntnot " "WHERE ( (evntnot_username=:username)" " AND (evntnot_warehous_id=:warehous_id)" " AND (evntnot_evnttype_id=:evnttype_id) );" ); if (_currentUser->isChecked()) userFillWarehouseList.bindValue(":username", omfgThis->username()); else userFillWarehouseList.bindValue(":username", _user->currentText()); userFillWarehouseList.bindValue(":warehous_id", ((XTreeWidgetItem *)(_warehouses->topLevelItem(i)))->id()); userFillWarehouseList.bindValue(":evnttype_id", _event->id()); userFillWarehouseList.exec(); if (userFillWarehouseList.first()) _warehouses->topLevelItem(i)->setText(0, tr("Yes")); else _warehouses->topLevelItem(i)->setText(0, tr("No")); if (userFillWarehouseList.lastError().type() != QSqlError::NoError) { systemError(this, userFillWarehouseList.lastError().databaseText(), __FILE__, __LINE__); return; } } } void userPreferences::sTranslations() { omfgThis->handleNewWindow(new translations(this)); } void userPreferences::sDictionaries() { omfgThis->handleNewWindow(new dictionaries(this)); } qt-client-4.1.0/guiclient/userPreferences.h000066400000000000000000000030521217451700100207060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef USERPREFERENCES_H #define USERPREFERENCES_H #include "guiclient.h" #include "xdialog.h" #include "ui_userPreferences.h" class userPreferences : public XDialog, public Ui::userPreferences { Q_OBJECT public: userPreferences(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~userPreferences(); bool save(); virtual void setBackgroundImage( int pImageid ); public slots: virtual void sBackgroundList(); virtual void sPopulate(); virtual void sApply(); virtual void sSave(bool close = true); virtual void sClose(); virtual void sFillList(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sAllWarehousesToggled( int pEvnttypeid ); virtual void sWarehouseToggled( QTreeWidgetItem * selected ); virtual void sFillWarehouseList(); virtual void sTranslations(); virtual void sDictionaries(); protected slots: virtual void languageChange(); private: int _backgroundImageid; Preferences * _pref; Preferences * _altPref; bool _dirty; }; #endif // USERPREFERENCES_H qt-client-4.1.0/guiclient/userPreferences.ui000066400000000000000000001306441217451700100211040ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. userPreferences 0 0 800 523 User Preferences 12 0 0 Current &User true &Selected User: false 0 0 Qt::Horizontal 191 69 Qt::Vertical QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Save 0 1 0 Application 0 0 Background Image None true Image: false false ... Qt::Horizontal 40 20 0 0 Preferred Site: None true Site: false Qt::Horizontal 40 20 0 0 Copy Lists to Rich Text true Plain Text 0 0 Defaults List Numeric Item Numbers First 5 0 0 Default Ellipses Action: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _ellipsesAction 0 0 0 0 Interface Options Show windows inside workspace false Free Floating Windows true Alternating Row Colors Qt::Horizontal 0 0 Ignore Missing Translations Get Translations... 0 0 Enable Spell Check on Text Edit Fields Get Dictionaries... Qt::Horizontal Idle Timeout: _idleTimeout Qt::Horizontal 40 20 Menu 0 Show Inventory Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 20 false Show Inventory Toolbar 0 Show Manufacture Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 20 false Show Manufacture Toolbar Qt::Horizontal QSizePolicy::Expanding 50 20 0 Show Products Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 20 false Show Products Toolbar 0 Show CRM Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 20 false Show CRM Toolbar 0 Show Schedule Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 0 false Show Schedule Toolbar 0 Show Sales Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 20 false Show Sales Toolbar 0 Show Purchase Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 20 false Show Purchase Toolbar 0 Show Accounting Menu 5 Qt::Horizontal QSizePolicy::Fixed 20 20 false Show Accounting Toolbar Qt::Vertical 381 0 Hot Keys 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 184 Events Event: Site: 0 0 200 0 0 0 200 0 Send Email notification of selected Events Alarms Default Actions Event true Email true System Message true Qt::Horizontal 261 20 Qt::Vertical 20 40 Password Username Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Current Password Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password New Password Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password Retype Password Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter QLineEdit::Password Qt::Horizontal 40 108 Qt::Vertical 198 165 Advanced Enable Script Debugging Qt::Vertical 20 262 WComboBox XComboBox

    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    _currentUser _selectedUser _user _noBackgroundImage _backgroundImage _background _backgroundList _interfaceWorkspace _interfaceTopLevel _alternating _ignoreTranslation _translations _enableSpell _dictionaries _idleTimeout _noWarehouse _selectedWarehouse _warehouse _richText _plainText _listNumericItemsFirst _ellipsesAction _tab _inventoryMenu _inventoryToolbar _productsMenu _productsToolbar _scheduleMenu _scheduleToolbar _purchaseMenu _purchaseToolbar _manufactureMenu _manufactureToolbar _crmMenu2 _crmToolbar2 _salesMenu _salesToolbar _accountingMenu _accountingToolbar _hotkey _new _edit _delete _event _warehouses _emailEvents _alarmEvent _alarmEmail _alarmSysmsg _username _currentpassword _newpassword _retypepassword _debug _buttonBox _selectedUser toggled(bool) _user setEnabled(bool) 39 63 148 62 _backgroundImage toggled(bool) _backgroundList setEnabled(bool) 557 80 640 79 _productsMenu toggled(bool) _productsToolbar setEnabled(bool) 114 219 121 241 _inventoryMenu toggled(bool) _inventoryToolbar setEnabled(bool) 114 167 116 189 _scheduleMenu toggled(bool) _scheduleToolbar setEnabled(bool) 304 167 307 189 _manufactureMenu toggled(bool) _manufactureToolbar setEnabled(bool) 494 167 496 189 _purchaseMenu toggled(bool) _purchaseToolbar setEnabled(bool) 304 219 306 241 _crmMenu2 toggled(bool) _crmToolbar2 setEnabled(bool) 494 219 511 241 _salesMenu toggled(bool) _salesToolbar setEnabled(bool) 684 167 699 189 _accountingMenu toggled(bool) _accountingToolbar setEnabled(bool) 684 219 686 241 _selectedWarehouse toggled(bool) _warehouse setEnabled(bool) 37 392 132 391 _hotkey valid(bool) _edit setEnabled(bool) 203 248 586 171 _hotkey valid(bool) _delete setEnabled(bool) 203 248 586 202 _hotkey itemSelected(int) _edit animateClick() 203 248 586 171 qt-client-4.1.0/guiclient/users.cpp000066400000000000000000000067221217451700100172510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "users.h" #include #include #include #include "errorReporter.h" #include "user.h" users::users(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { XSqlQuery usersusers; setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(close())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_showInactive, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_usr, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); connect(_usr, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(omfgThis,SIGNAL(userUpdated(QString)), this, SLOT(sFillList())); _usr->addColumn(tr("Username"), 80, Qt::AlignLeft, true, "usr_username"); _usr->addColumn(tr("Proper Name"), -1, Qt::AlignLeft, true, "usr_propername"); _usr->addColumn(tr("Status"), 50, Qt::AlignCenter, true, "status"); usersusers.exec("SELECT userCanCreateUsers(getEffectiveXtUser()) AS cancreate;"); if (usersusers.first()) _new->setEnabled(usersusers.value("cancreate").toBool()); else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); sFillList(); } users::~users() { // no need to delete child widgets, Qt does it all for us } void users::languageChange() { retranslateUi(this); } void users::sFillList() { MetaSQLQuery mql("SELECT usr_id, usr_username, usr_propername," " CASE WHEN (usr_active) THEN " " ELSE " " END AS status" " FROM usr" "" " WHERE usr_active" "" " ORDER BY usr_username;"); ParameterList params; params.append("active", tr("Active")); params.append("inactive", tr("Inactive")); if (!_showInactive->isChecked()) params.append("activeOnly"); XSqlQuery getq = mql.toQuery(params); _usr->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error getting Users"), getq, __FILE__, __LINE__)) return; } void users::sNew() { ParameterList params; params.append("mode", "new"); user newdlg(this); newdlg.set(params); newdlg.exec(); sFillList(); } void users::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("username", _usr->selectedItems().first()->text(0)); user newdlg(this); newdlg.set(params); newdlg.exec(); sFillList(); } void users::sPrint() { ParameterList params; if(_showInactive->isChecked()) params.append("showInactive"); orReport report("UsersMasterList", params); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/users.h000066400000000000000000000016001217451700100167040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef USERS_H #define USERS_H #include "guiclient.h" #include "xwidget.h" #include "ui_users.h" class users : public XWidget, public Ui::users { Q_OBJECT public: users(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~users(); protected slots: virtual void languageChange(); virtual void sFillList(); virtual void sNew(); virtual void sEdit(); virtual void sPrint(); }; #endif // USERS_H qt-client-4.1.0/guiclient/users.ui000066400000000000000000000143441217451700100171030ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. users 0 0 412 429 List Users 0 5 0 0 20 20 Expanding Horizontal &Show Inactive Users 0 0 Users: 0 5 &Close &Print 0 0 &New false &Edit 20 20 Expanding Vertical XTreeWidget QTreeWidget
    xtreewidget.h
    0
    _showInactive _usr _new _edit _print _close _usr itemSelected(int) _edit animateClick() _usr valid(bool) _edit setEnabled(bool) _close clicked() users close()
    qt-client-4.1.0/guiclient/vendor.cpp000066400000000000000000001222271217451700100174040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendor.h" #include #include #include #include #include #include #include "addresscluster.h" #include "comment.h" #include "crmaccount.h" #include "errorReporter.h" #include "guiErrorCheck.h" #include "storedProcErrorLookup.h" #include "taxRegistration.h" #include "vendorAddress.h" #include "xcombobox.h" #define DEBUG false vendor::vendor(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_crmacct, SIGNAL(clicked()), this, SLOT(sCrmAccount())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_printAddresses, SIGNAL(clicked()), this, SLOT(sPrintAddresses())); connect(_newAddress, SIGNAL(clicked()), this, SLOT(sNewAddress())); connect(_editAddress, SIGNAL(clicked()), this, SLOT(sEditAddress())); connect(_viewAddress, SIGNAL(clicked()), this, SLOT(sViewAddress())); connect(_deleteAddress, SIGNAL(clicked()), this, SLOT(sDeleteAddress())); connect(_deleteTaxreg, SIGNAL(clicked()), this, SLOT(sDeleteTaxreg())); connect(_editTaxreg, SIGNAL(clicked()), this, SLOT(sEditTaxreg())); connect(_newTaxreg, SIGNAL(clicked()), this, SLOT(sNewTaxreg())); connect(_viewTaxreg, SIGNAL(clicked()), this, SLOT(sViewTaxreg())); connect(_next, SIGNAL(clicked()), this, SLOT(sNext())); connect(_previous, SIGNAL(clicked()), this, SLOT(sPrevious())); connect(_mainButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_altButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_checksButton, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_number, SIGNAL(textEdited(const QString&)), this, SLOT(sNumberEdited())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _contact2, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _contact1, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); _defaultCurr->setLabel(_defaultCurrLit); QRegExp tmpregex = QRegExp(_metrics->value("EFTAccountRegex")); _accountValidator = new QRegExpValidator (tmpregex, this); tmpregex = QRegExp(_metrics->value("EFTRoutingRegex")); _routingValidator = new QRegExpValidator(tmpregex, this); _routingNumber->setValidator(_routingValidator); _achAccountNumber->setValidator(_accountValidator); _vendaddr->addColumn(tr("Number"), 70, Qt::AlignLeft, true, "vendaddr_code"); _vendaddr->addColumn(tr("Name"), 50, Qt::AlignLeft, true, "vendaddr_name"); _vendaddr->addColumn(tr("City"), -1, Qt::AlignLeft, true, "addr_city"); _vendaddr->addColumn(tr("State"), -1, Qt::AlignLeft, true, "addr_state"); _vendaddr->addColumn(tr("Country"),-1, Qt::AlignLeft, true, "addr_country"); _vendaddr->addColumn(tr("Postal Code"),-1, Qt::AlignLeft, true, "addr_postalcode"); _taxreg->addColumn(tr("Tax Authority"), 100, Qt::AlignLeft, true, "taxauth_code"); _taxreg->addColumn(tr("Tax Zone"), 100, Qt::AlignLeft, true, "taxzone_code"); _taxreg->addColumn(tr("Registration #"), -1, Qt::AlignLeft, true, "taxreg_number"); _accountType->append(0, "Checking", "K"); _accountType->append(1, "Savings", "C"); _transmitStack->setCurrentIndex(0); if (_metrics->boolean("EnableBatchManager") && ! (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled"))) { _checksButton->hide(); } else if (! _metrics->boolean("EnableBatchManager") && (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled"))) { _checksButton->hide(); _transmitStack->setCurrentIndex(1); } else if (! _metrics->boolean("EnableBatchManager") && ! (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled"))) ediTab->setVisible(false); // else defaults are OK if (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled") && omfgThis->_key.isEmpty()) _checksButton->setEnabled(false); _account->setType(GLCluster::cRevenue | GLCluster::cExpense | GLCluster::cAsset | GLCluster::cLiability); _vendid = -1; _crmacctid = -1; _ignoreClose = false; _NumberGen = -1; } vendor::~vendor() { // no need to delete child widgets, Qt does it all for us } void vendor::languageChange() { retranslateUi(this); } SetResponse vendor::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("crmacct_id", &valid); if (valid) _crmacctid = param.toInt(); param = pParams.value("vend_id", &valid); if (valid) _vendid = param.toInt(); if (_vendid > 0 || _crmacctid > 0) if (! sPopulate()) return UndefinedError; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; XSqlQuery idq; idq.exec("SELECT NEXTVAL('vend_vend_id_seq') AS vend_id;"); if (idq.first()) _vendid = idq.value("vend_id").toInt(); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Id"), idq, __FILE__, __LINE__)) return UndefinedError; if(((_metrics->value("CRMAccountNumberGeneration") == "A") || (_metrics->value("CRMAccountNumberGeneration") == "O")) && _number->text().isEmpty() ) { XSqlQuery numq; numq.exec("SELECT fetchCRMAccountNumber() AS number;"); if (numq.first()) { _number->setText(numq.value("number")); _NumberGen = numq.value("number").toInt(); } } if (_privileges->check("MaintainVendorAddresses")) { connect(_vendaddr, SIGNAL(valid(bool)), _editAddress, SLOT(setEnabled(bool))); connect(_vendaddr, SIGNAL(valid(bool)), _deleteAddress, SLOT(setEnabled(bool))); connect(_vendaddr, SIGNAL(itemSelected(int)), _editAddress, SLOT(animateClick())); } else { _newAddress->setEnabled(FALSE); connect(_vendaddr, SIGNAL(itemSelected(int)), _viewAddress, SLOT(animateClick())); } emit newId(_vendid); } else if (param.toString() == "edit") { _mode = cEdit; if (_privileges->check("MaintainVendorAddresses")) { connect(_vendaddr, SIGNAL(valid(bool)), _editAddress, SLOT(setEnabled(bool))); connect(_vendaddr, SIGNAL(valid(bool)), _deleteAddress, SLOT(setEnabled(bool))); connect(_vendaddr, SIGNAL(itemSelected(int)), _editAddress, SLOT(animateClick())); } else { _newAddress->setEnabled(FALSE); connect(_vendaddr, SIGNAL(itemSelected(int)), _viewAddress, SLOT(animateClick())); } } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(FALSE); _vendtype->setEnabled(FALSE); _active->setEnabled(FALSE); _name->setEnabled(FALSE); _accountNumber->setEnabled(FALSE); _defaultTerms->setEnabled(FALSE); _defaultShipVia->setEnabled(FALSE); _defaultCurr->setEnabled(FALSE); _contact1->setEnabled(FALSE); _contact2->setEnabled(FALSE); _address->setEnabled(FALSE); _notes->setReadOnly(TRUE); _poComments->setReadOnly(TRUE); _poItems->setEnabled(FALSE); _restrictToItemSource->setEnabled(FALSE); _receives1099->setEnabled(FALSE); _qualified->setEnabled(FALSE); _newAddress->setEnabled(FALSE); _defaultFOBGroup->setEnabled(false); _taxzone->setEnabled(false); _match->setEnabled(false); _newTaxreg->setEnabled(false); _comments->setReadOnly(TRUE); _achGroup->setEnabled(false); _routingNumber->setEnabled(false); _achAccountNumber->setEnabled(false); _individualId->setEnabled(false); _individualName->setEnabled(false); _accountType->setEnabled(false); _distribGroup->setEnabled(false); _save->hide(); _close->setText(tr("&Close")); disconnect(_taxreg, SIGNAL(valid(bool)), _deleteTaxreg, SLOT(setEnabled(bool))); disconnect(_taxreg, SIGNAL(valid(bool)), _editTaxreg, SLOT(setEnabled(bool))); disconnect(_taxreg, SIGNAL(itemSelected(int)), _editTaxreg, SLOT(animateClick())); connect(_taxreg, SIGNAL(itemSelected(int)), _viewTaxreg, SLOT(animateClick())); } } if(_metrics->value("CRMAccountNumberGeneration") == "A") _number->setEnabled(FALSE); if(cNew == _mode || !pParams.inList("showNextPrev")) { _next->hide(); _previous->hide(); } return NoError; } int vendor::id() const { return _vendid; } void vendor::sSave() { XSqlQuery vendorSave; QList errors; errors << GuiErrorCheck(_number->text().trimmed().isEmpty(), _number, tr("Please enter a Number for this new Vendor.")) << GuiErrorCheck(_name->text().trimmed().isEmpty(), _name, tr("Please enter a Name for this new Vendor.")) << GuiErrorCheck(_defaultTerms->id() == -1, _defaultTerms, tr("You must select a Terms code for this Vendor.")) << GuiErrorCheck(_vendtype->id() == -1, _vendtype, tr("You must select a Vendor Type for this Vendor.")) // << GuiErrorCheck(_accountSelected->isChecked() && // !_account->isValid(), // _account // tr("You must select a Default Distribution Account for this Vendor.")) // << GuiErrorCheck(_expcatSelected->isChecked() && // !_expcat->isValid(), // _expcat // tr("You must select a Default Distribution Expense Category for this Vendor.")) // << GuiErrorCheck(_taxSelected->isChecked() && // !_taxCode->isValid(), // _taxCode // tr("You must select a Default Distribution Tax Code for this Vendor.")) << GuiErrorCheck(_achGroup->isChecked() && ! _routingNumber->hasAcceptableInput() && !omfgThis->_key.isEmpty(), _routingNumber, tr("The Routing Number is not valid.")) << GuiErrorCheck(_achGroup->isChecked() && ! _achAccountNumber->hasAcceptableInput() && !omfgThis->_key.isEmpty(), _achAccountNumber, tr("The Account Number is not valid.")) << GuiErrorCheck(_achGroup->isChecked() && _useACHSpecial->isChecked() && _individualName->text().trimmed().isEmpty() && !omfgThis->_key.isEmpty(), _individualName, tr("Please enter an Individual Name if EFT Check " "Printing is enabled and '%1' is checked.") .arg(_useACHSpecial->title())) ; if (_number->text().trimmed().toUpper() != _cachedNumber.toUpper()) { XSqlQuery dupq; dupq.prepare("SELECT vend_name " "FROM vendinfo " "WHERE (UPPER(vend_number)=UPPER(:vend_number)) " " AND (vend_id<>:vend_id);" ); dupq.bindValue(":vend_number", _number->text().trimmed()); dupq.bindValue(":vend_id", _vendid); dupq.exec(); if (dupq.first()) GuiErrorCheck(true, _number, tr("

    The newly entered Vendor Number cannot be " "used as it is already used by the Vendor '%1'. " "Please correct or enter a new Vendor Number." ) .arg(vendorSave.value("vend_name").toString()) ); } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Vendor"), errors)) return; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN;"); if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), begin, __FILE__, __LINE__)) return; int saveResult = _address->save(AddressCluster::CHECK); if (-2 == saveResult) { int answer = QMessageBox::question(this, tr("Question Saving Address"), tr("

    There are multiple uses of this Vendor's " "Address. What would you like to do?"), tr("Change This One"), tr("Change Address for All"), tr("Cancel"), 2, 2); if (0 == answer) saveResult = _address->save(AddressCluster::CHANGEONE); else if (1 == answer) saveResult = _address->save(AddressCluster::CHANGEALL); } if (saveResult < 0) // not else-if: this is error check for CHANGE{ONE,ALL} { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Address"), tr("

    There was an error saving this address (%1). " "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); _address->setFocus(); return; } QString sql; if (_mode == cEdit) { sql = "UPDATE vendinfo " "SET vend_number=," " vend_accntnum=," " vend_active=," " vend_vendtype_id=," " vend_name=," " vend_cntct1_id=," " vend_cntct2_id=," " vend_addr_id=," " vend_po=," " vend_restrictpurch=," " vend_1099=," " vend_qualified=," " vend_comments=," " vend_pocomments=," " vend_fobsource=," " vend_fob=," " vend_terms_id=," " vend_shipvia=," " vend_curr_id=," " vend_taxzone_id=," " vend_match=," " vend_ach_enabled=," "" " vend_ach_routingnumber=encrypt(setbytea()," " setbytea(), 'bf')," " vend_ach_accntnumber=encrypt(setbytea()," " setbytea(), 'bf')," "" " vend_ach_use_vendinfo=," " vend_ach_accnttype=," " vend_ach_indiv_number=," " vend_ach_indiv_name=," " vend_accnt_id=," " vend_expcat_id=," " vend_tax_id= " "WHERE (vend_id=);" ; } else if (_mode == cNew) sql = "INSERT INTO vendinfo " "( vend_id, vend_number, vend_accntnum," " vend_active, vend_vendtype_id, vend_name," " vend_cntct1_id, vend_cntct2_id, vend_addr_id," " vend_po, vend_restrictpurch," " vend_1099, vend_qualified," " vend_comments, vend_pocomments," " vend_fobsource, vend_fob," " vend_terms_id, vend_shipvia, vend_curr_id," " vend_taxzone_id, vend_match, vend_ach_enabled," " vend_ach_routingnumber, vend_ach_accntnumber," " vend_ach_use_vendinfo," " vend_ach_accnttype, vend_ach_indiv_number," " vend_ach_indiv_name," " vend_accnt_id, vend_expcat_id, vend_tax_id) " "VALUES " "( ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " ," " , " " ," " ," " ," "" " encrypt(setbytea()," " setbytea(), 'bf')," " encrypt(setbytea()," " setbytea(), 'bf')," "" " ''," " ''," "" " ," " ," " ," " ," " ," " ," " " " );" ; ParameterList params; params.append("vend_id", _vendid); params.append("vend_vendtype_id", _vendtype->id()); params.append("vend_terms_id", _defaultTerms->id()); params.append("vend_curr_id", _defaultCurr->id()); params.append("vend_number", _number->text().trimmed().toUpper()); params.append("vend_accntnum", _accountNumber->text().trimmed()); params.append("vend_name", _name->text().trimmed()); if (_contact1->id() > 0) params.append("vend_cntct1_id", _contact1->id()); // else NULL if (_contact2->id() > 0) params.append("vend_cntct2_id", _contact2->id()); // else NULL if (_address->id() > 0) params.append("vend_addr_id", _address->id()); // else NULL params.append("vend_comments", _notes->toPlainText()); params.append("vend_pocomments", _poComments->toPlainText()); params.append("vend_shipvia", _defaultShipVia->text()); params.append("vend_active", QVariant(_active->isChecked())); params.append("vend_po", QVariant(_poItems->isChecked())); params.append("vend_restrictpurch", QVariant(_restrictToItemSource->isChecked())); params.append("vend_1099", QVariant(_receives1099->isChecked())); params.append("vend_qualified", QVariant(_qualified->isChecked())); params.append("vend_match", QVariant(_match->isChecked())); if (!omfgThis->_key.isEmpty()) params.append("key", omfgThis->_key); params.append("vend_ach_enabled", QVariant(_achGroup->isChecked())); params.append("vend_ach_routingnumber",_routingNumber->text().trimmed()); params.append("vend_ach_accntnumber", _achAccountNumber->text().trimmed()); params.append("vend_ach_use_vendinfo", QVariant(! _useACHSpecial->isChecked())); params.append("vend_ach_indiv_number", _individualId->text().trimmed()); params.append("vend_ach_indiv_name", _individualName->text().trimmed()); params.append("vend_ach_accnttype", _accountType->code()); if(_taxzone->isValid()) params.append("vend_taxzone_id", _taxzone->id()); if (_useWarehouseFOB->isChecked()) { params.append("vend_fobsource", "W"); params.append("vend_fob", ""); } else if (_useVendorFOB) { params.append("vend_fobsource", "V"); params.append("vend_fob", _vendorFOB->text().trimmed()); } if(_accountSelected->isChecked() && _account->isValid()) { params.append("vend_accnt_id", _account->id()); params.append("vend_expcat_id", -1); params.append("vend_tax_id", -1); } else if (_expcatSelected->isChecked() && _expcat->isValid()) { params.append("vend_accnt_id", -1); params.append("vend_expcat_id", _expcat->id()); params.append("vend_tax_id", -1); } else if (_taxSelected->isChecked() && _taxCode->isValid()) { params.append("vend_accnt_id", -1); params.append("vend_expcat_id", -1); params.append("vend_tax_id", _taxCode->id()); } else { params.append("vend_accnt_id", -1); params.append("vend_expcat_id", -1); params.append("vend_tax_id", -1); } MetaSQLQuery mql(sql); XSqlQuery upsq = mql.toQuery(params); if (upsq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Vendor"), vendorSave, __FILE__, __LINE__); return; } XSqlQuery commit("COMMIT;"); _NumberGen = -1; omfgThis->sVendorsUpdated(); emit saved(_vendid); if (_mode == cNew) emit newId(_vendid); if(!_ignoreClose) close(); } void vendor::sCheck() { _number->setText(_number->text().trimmed().toUpper()); if (_number->text().length() && _cachedNumber != _number->text()) { if(cNew == _mode && -1 != _NumberGen && _number->text().toInt() != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Releasing Number"), query, __FILE__, __LINE__); _NumberGen = -1; } XSqlQuery dupq; dupq.prepare("SELECT vend_id, 1 AS type" " FROM vendinfo " " WHERE (vend_number=:vend_number)" " UNION " "SELECT crmacct_id, 2 AS type " " FROM crmacct " " WHERE (crmacct_number=:vend_number)" " ORDER BY type;"); dupq.bindValue(":vend_number", _number->text()); dupq.exec(); if (dupq.first()) { if ((dupq.value("type").toInt() == 1) && (_notice)) { if (QMessageBox::question(this, tr("Vendor Exists"), tr("

    This number is currently " "used by an existing Vendor. " "Do you want to edit " "that Vendor?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { _number->setText(_cachedNumber); _number->setFocus(); return; } _vendid = dupq.value("vend_id").toInt(); _mode = cEdit; sPopulate(); _name->setFocus(); } else if ( (_mode == cEdit) && ((dupq.value("type").toInt() == 2) ) && (_notice)) { QMessageBox::critical(this, tr("Invalid Number"), tr("

    This number is currently " "assigned to another CRM account.")); _number->setText(_cachedNumber); _number->setFocus(); _notice = false; return; } else if ((dupq.value("type").toInt() == 2) && (_notice)) { if (QMessageBox::question(this, tr("Convert"), tr("

    This number is currently assigned to CRM Account. " "Do you want to convert the CRM Account to a Vendor?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { _number->clear(); _number->setFocus(); return; } sLoadCrmAcct(dupq.value("vend_id").toInt()); } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Vendor"), dupq, __FILE__, __LINE__)) return; } } void vendor::sLoadCrmAcct(int crmacctId) { _notice = FALSE; _crmacctid = crmacctId; XSqlQuery getq; getq.prepare("SELECT * FROM crmacct WHERE (crmacct_id=:crmacct_id);"); getq.bindValue(":crmacct_id", crmacctId); getq.exec(); if (getq.first()) { _crmowner = getq.value("crmacct_owner_username").toString(); _number->setText(getq.value("crmacct_number").toString()); _cachedNumber=_number->text().trimmed().toUpper(); _name->setText(getq.value("crmacct_name").toString()); _active->setChecked(getq.value("crmacct_active").toBool()); _contact1->setId(getq.value("crmacct_cntct_id_1").toInt()); _contact1->setSearchAcct(_crmacctid); _contact2->setId(getq.value("crmacct_cntct_id_2").toInt()); _contact2->setSearchAcct(_crmacctid); if (getq.value("crmacct_cntct_id_1").toInt() != 0) { XSqlQuery contactQry; contactQry.prepare("SELECT cntct_addr_id FROM cntct WHERE (cntct_id=:cntct_id);"); contactQry.bindValue(":cntct_id", _contact1->id()); contactQry.exec(); if (contactQry.first()) { _address->setId(contactQry.value("cntct_addr_id").toInt()); _address->setSearchAcct(_crmacctid); } } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting CRM Account"), getq, __FILE__, __LINE__)) return; _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); _name->setFocus(); } bool vendor::sPopulate() { if (DEBUG) qDebug("vendor::sPopulate() entered with _vendid %d and _crmacctid %d", _vendid, _crmacctid); MetaSQLQuery mql( "" "SELECT vendinfo.*, crmacct_id, crmacct_owner_username, " "" " CASE WHEN LENGTH(vend_ach_routingnumber) > 0 THEN" " formatbytea(decrypt(setbytea(vend_ach_routingnumber)," " setbytea(), 'bf'))" " ELSE '' END AS routingnum," " CASE WHEN LENGTH(vend_ach_accntnumber) > 0 THEN" " formatbytea(decrypt(setbytea(vend_ach_accntnumber)," " setbytea(), 'bf'))" " ELSE '' END AS accntnum " "" " AS routingnum," " AS accntnum " "" "FROM vendinfo " " JOIN crmacct ON (vend_id=crmacct_vend_id) " "WHERE (vend_id=);" "" "SELECT crmacct_number AS vend_number, crmacct_name AS vend_name," " crmacct_active AS vend_active," " crmacct_cntct_id_1 AS vend_cntct1_id," " crmacct_cntct_id_2 AS vend_cntct2_id," " fetchMetricText('DefaultPOShipVia') AS vend_shipvia," " NULL AS vend_accntnum, NULL AS vend_vendtype_id," " NULL AS vend_name, NULL AS vend_addr_id," " fetchMetricValue('DefaultTerms') AS vend_terms_id," " NULL AS vend_curr_id," " FALSE AS vend_po, FALSE AS vend_restrictpurch," " FALSE AS vend_1099, NULL AS vend_match," " FALSE AS vend_qualified, NULL AS vend_comments," " NULL AS vend_pocomments, NULL AS vend_taxzone_id," " 'W' AS vend_fobsource, NULL AS vend_fob," " NULL AS vend_ach_enabled, NULL AS routingnum," " NULL AS accntnum, NULL AS vend_ach_use_vendinfo," " NULL AS vend_ach_indiv_number, NULL AS vend_ach_indiv_name," " NULL AS vend_ach_accnttype," " crmacct_id, crmacct_owner_username" " FROM crmacct" " WHERE crmacct_id=;" ""); ParameterList params; if (_vendid > 0) params.append("vend_id", _vendid); else if (_crmacctid > 0) params.append("crmacct_id", _crmacctid); params.append("key", omfgThis->_key); params.append("na", tr("N/A")); XSqlQuery getq = mql.toQuery(params); if (getq.first()) { _notice = FALSE; _cachedNumber = getq.value("vend_number").toString(); _crmacctid = getq.value("crmacct_id").toInt(); _crmowner = getq.value("crmacct_owner_username").toString(); _number->setText(getq.value("vend_number")); _accountNumber->setText(getq.value("vend_accntnum")); _vendtype->setId(getq.value("vend_vendtype_id").toInt()); _active->setChecked(getq.value("vend_active").toBool()); _name->setText(getq.value("vend_name")); _contact1->setId(getq.value("vend_cntct1_id").toInt()); _contact1->setSearchAcct(_crmacctid); _contact2->setId(getq.value("vend_cntct2_id").toInt()); _contact2->setSearchAcct(_crmacctid); _address->setId(getq.value("vend_addr_id").toInt()); _defaultTerms->setId(getq.value("vend_terms_id").toInt()); _defaultShipVia->setText(getq.value("vend_shipvia").toString()); _defaultCurr->setId(getq.value("vend_curr_id").toInt()); _poItems->setChecked(getq.value("vend_po").toBool()); _restrictToItemSource->setChecked(getq.value("vend_restrictpurch").toBool()); _receives1099->setChecked(getq.value("vend_1099").toBool()); _match->setChecked(getq.value("vend_match").toBool()); _qualified->setChecked(getq.value("vend_qualified").toBool()); _notes->setText(getq.value("vend_comments").toString()); _poComments->setText(getq.value("vend_pocomments").toString()); _taxzone->setId(getq.value("vend_taxzone_id").toInt()); if (getq.value("vend_fobsource").toString() == "V") { _useVendorFOB->setChecked(TRUE); _vendorFOB->setText(getq.value("vend_fob")); } else _useWarehouseFOB->setChecked(TRUE); _achGroup->setChecked(getq.value("vend_ach_enabled").toBool()); _routingNumber->setText(getq.value("routingnum").toString()); _achAccountNumber->setText(getq.value("accntnum").toString()); _useACHSpecial->setChecked(! getq.value("vend_ach_use_vendinfo").toBool()); _individualId->setText(getq.value("vend_ach_indiv_number").toString()); _individualName->setText(getq.value("vend_ach_indiv_name").toString()); _accountType->setCode(getq.value("vend_ach_accnttype").toString()); _account->setId(getq.value("vend_accnt_id").toInt()); if(getq.value("vend_expcat_id").toInt() != -1) { _expcatSelected->setChecked(TRUE); _expcat->setId(getq.value("vend_expcat_id").toInt()); } if(getq.value("vend_tax_id").toInt() != -1) { _taxSelected->setChecked(TRUE); _taxCode->setId(getq.value("vend_tax_id").toInt()); } sFillAddressList(); sFillTaxregList(); _comments->setId(_crmacctid); _address->setSearchAcct(_crmacctid); emit newId(_vendid); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Vendor"), getq, __FILE__, __LINE__)) return false; else { ErrorReporter::error(QtCriticalMsg, this, tr("Getting Vendor"), tr("Could not find the Vendor information. Perhaps " "the Vendor and CRM Account have been disconnected."), __FILE__, __LINE__); return false; } _crmacct->setEnabled(_crmacctid > 0 && (_privileges->check("MaintainAllCRMAccounts") || _privileges->check("ViewAllCRMAccounts") || (omfgThis->username() == _crmowner && _privileges->check("MaintainPersonalCRMAccounts")) || (omfgThis->username() == _crmowner && _privileges->check("ViewPersonalCRMAccounts")))); emit populated(); return true; } void vendor::sPrintAddresses() { ParameterList params; params.append("vend_id", _vendid); orReport report("VendorAddressList", params); if (report.isValid()) report.print(); else report.reportError(this); } void vendor::sNewAddress() { ParameterList params; params.append("mode", "new"); params.append("vend_id", _vendid); vendorAddress newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillAddressList(); } void vendor::sEditAddress() { ParameterList params; params.append("mode", "edit"); params.append("vendaddr_id", _vendaddr->id()); vendorAddress newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillAddressList(); } void vendor::sViewAddress() { ParameterList params; params.append("mode", "view"); params.append("vendaddr_id", _vendaddr->id()); vendorAddress newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void vendor::sDeleteAddress() { XSqlQuery delq; delq.prepare( "DELETE FROM vendaddrinfo " "WHERE (vendaddr_id=:vendaddr_id);" ); delq.bindValue(":vendaddr_id", _vendaddr->id()); delq.exec(); sFillAddressList(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Vendor Addresses"), delq, __FILE__, __LINE__)) return; } void vendor::sFillAddressList() { XSqlQuery addrq; addrq.prepare("SELECT vendaddr_id, vendaddr_code, vendaddr_name," " addr_city, addr_state, addr_country," " addr_postalcode" " FROM vendaddrinfo" " LEFT OUTER JOIN addr ON (vendaddr_addr_id=addr_id)" " WHERE (vendaddr_vend_id=:vend_id)" " ORDER BY vendaddr_code;" ); addrq.bindValue(":vend_id", _vendid); addrq.exec(); _vendaddr->populate(addrq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Vendor Addresses"), addrq, __FILE__, __LINE__)) return; } void vendor::sFillTaxregList() { XSqlQuery taxreg; taxreg.prepare("SELECT taxreg_id, taxreg_taxauth_id," " taxauth_code, taxzone_code, taxreg_number" " FROM taxreg" " JOIN taxauth ON (taxreg_taxauth_id=taxauth_id)" " LEFT OUTER JOIN taxzone ON (taxreg_taxzone_id=taxzone_id)" " WHERE ((taxreg_rel_type='V') " " AND (taxreg_rel_id=:vend_id));"); taxreg.bindValue(":vend_id", _vendid); taxreg.exec(); _taxreg->clear(); _taxreg->populate(taxreg, true); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Tax Registrations"), taxreg, __FILE__, __LINE__)) return; } void vendor::sNewTaxreg() { ParameterList params; params.append("mode", "new"); params.append("taxreg_rel_id", _vendid); params.append("taxreg_rel_type", "V"); taxRegistration newdlg(this, "", TRUE); if (newdlg.set(params) == NoError && newdlg.exec() != XDialog::Rejected) sFillTaxregList(); } void vendor::sEditTaxreg() { ParameterList params; params.append("mode", "edit"); params.append("taxreg_id", _taxreg->id()); taxRegistration newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.set(params) == NoError && newdlg.exec() != XDialog::Rejected) sFillTaxregList(); } void vendor::sViewTaxreg() { ParameterList params; params.append("mode", "view"); params.append("taxreg_id", _taxreg->id()); taxRegistration newdlg(this, "", TRUE); if (newdlg.set(params) == NoError) newdlg.exec(); } void vendor::sDeleteTaxreg() { XSqlQuery delq; delq.prepare("DELETE FROM taxreg WHERE (taxreg_id=:taxreg_id);"); delq.bindValue(":taxreg_id", _taxreg->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Tax Registration"), delq, __FILE__, __LINE__)) return; sFillTaxregList(); } void vendor::sNext() { XSqlQuery vendorNext; // Find Next vendorNext.prepare("SELECT vend_id " " FROM vendinfo" " WHERE (:number < vend_number)" " ORDER BY vend_number" " LIMIT 1;"); vendorNext.bindValue(":number", _number->text()); vendorNext.exec(); if(!vendorNext.first()) { QMessageBox::information(this, tr("At Last Record"), tr("You are already on the last record.") ); return; } int newid = vendorNext.value("vend_id").toInt(); if(!sCheckSave()) return; clear(); _vendid = newid; sPopulate(); } void vendor::sPrevious() { XSqlQuery nextq; nextq.prepare("SELECT vend_id " " FROM vendinfo" " WHERE (:number > vend_number)" " ORDER BY vend_number DESC" " LIMIT 1;"); nextq.bindValue(":number", _number->text()); nextq.exec(); if (!nextq.first() && nextq.lastError().type() == QSqlError::NoError) { QMessageBox::information(this, tr("At First Record"), tr("You are already on the first record.") ); return; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Vendor"), nextq, __FILE__, __LINE__)) return; int newid = nextq.value("vend_id").toInt(); if(!sCheckSave()) return; clear(); _vendid = newid; sPopulate(); } bool vendor::sCheckSave() { if(cEdit == _mode) { switch(QMessageBox::question(this, tr("Save Changes?"), tr("Would you like to save any changes before continuing?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel)) { case QMessageBox::Yes: _ignoreClose = true; sSave(); _ignoreClose = false; break; case QMessageBox::No: break; case QMessageBox::Cancel: default: return false; }; } return true; } void vendor::clear() { _cachedNumber = QString::null; _crmacctid = -1; _vendid = -1; _active->setChecked(true); _poItems->setChecked(false); _restrictToItemSource->setChecked(false); _qualified->setChecked(false); _match->setChecked(false); _receives1099->setChecked(false); _vendtype->setId(-1); _defaultTerms->setId(-1); _defaultCurr->setCurrentIndex(0); _taxzone->setId(-1); _useWarehouseFOB->setChecked(true); _number->clear(); _name->clear(); _accountNumber->clear(); _defaultShipVia->clear(); _vendorFOB->clear(); _notes->clear(); _poComments->clear(); _address->clear(); _contact1->clear(); _contact2->clear(); _vendaddr->clear(); _taxreg->clear(); _achGroup->setChecked(false); _routingNumber->clear(); _achAccountNumber->clear(); _individualId->clear(); _individualName->clear(); _accountType->setCurrentIndex(0); _comments->setId(-1); _tabs->setCurrentIndex(0); } void vendor::closeEvent(QCloseEvent *pEvent) { if(cNew == _mode && -1 != _NumberGen) { XSqlQuery query; query.prepare( "SELECT releaseCRMAccountNumber(:Number);" ); query.bindValue(":Number", _NumberGen); query.exec(); _NumberGen = -1; } XWidget::closeEvent(pEvent); } void vendor::sHandleButtons() { if (_mainButton->isChecked()) _addressStack->setCurrentIndex(0); else _addressStack->setCurrentIndex(1); if (_checksButton->isChecked()) _transmitStack->setCurrentIndex(1); else _transmitStack->setCurrentIndex(1); } void vendor::sNumberEdited() { _notice = TRUE; _number->setText(_number->text().toUpper()); } void vendor::sCrmAccount() { ParameterList params; params.append("crmacct_id", _crmacctid); if ((cView == _mode && _privileges->check("ViewAllCRMAccounts")) || (cView == _mode && _privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner) || (cEdit == _mode && _privileges->check("ViewAllCRMAccounts") && ! _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("ViewPersonalCRMAccounts") && ! _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else if ((cEdit == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cEdit == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if ((cNew == _mode && _privileges->check("MaintainAllCRMAccounts")) || (cNew == _mode && _privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else { qWarning("tried to open CRM Account window without privilege"); return; } crmaccount *newdlg = new crmaccount(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } qt-client-4.1.0/guiclient/vendor.h000066400000000000000000000037711217451700100170530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDOR_H #define VENDOR_H #include "guiclient.h" #include "xwidget.h" #include #include "contactcluster.h" #include "ui_vendor.h" class vendor : public XWidget, public Ui::vendor { Q_OBJECT public: vendor(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~vendor(); Q_INVOKABLE virtual int id() const; public slots: virtual SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sCheck(); virtual bool sPopulate(); virtual void sPrintAddresses(); virtual void sNewAddress(); virtual void sEditAddress(); virtual void sViewAddress(); virtual void sDeleteAddress(); virtual void sFillAddressList(); virtual void sFillTaxregList(); virtual void sNewTaxreg(); virtual void sEditTaxreg(); virtual void sViewTaxreg(); virtual void sDeleteTaxreg(); virtual void sHandleButtons(); virtual void sNumberEdited(); virtual void sNext(); virtual void sPrevious(); virtual void clear(); signals: void populated(); void newId(int); void saved(int); protected slots: virtual void languageChange(); virtual bool sCheckSave(); virtual void sCrmAccount(); virtual void sLoadCrmAcct(int); protected: virtual void closeEvent(QCloseEvent*); QValidator *_accountValidator; QValidator *_routingValidator; private: int _mode; int _vendid; int _crmacctid; int _NumberGen; QString _cachedNumber; bool _ignoreClose; bool _notice; QString _crmowner; }; #endif // VENDOR_H qt-client-4.1.0/guiclient/vendor.ui000066400000000000000000001414301217451700100172340ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. vendor 0 0 600 400 Vendor Vendor #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number Vendor Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _vendtype true XComboBox::VendorTypes Qt::Horizontal 0 20 false CRM Account... Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name &Active true Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _accountNumber Qt::Horizontal QSizePolicy::Expanding 26 10 Qt::Vertical 20 16 &Save &Cancel Next Previous Qt::Vertical QSizePolicy::Expanding 20 0 0 1 0 General Default Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::APTerms Qt::Horizontal QSizePolicy::Expanding 61 20 Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Currency: XComboBox::Currencies Qt::Horizontal QSizePolicy::Expanding 141 20 Default FOB Receiving Site true Vendor Specific: false Qt::Vertical 20 40 Default Miscellaneous Distribution false false Account true Tax 0 24 Tax Code Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false true None XComboBox::TaxCodes Qt::Horizontal 0 20 false Qt::StrongFocus Qt::Horizontal true true Qt::Horizontal 0 20 Expense Category Sells &Purchase Order Items &Qualified May only Sell Items defined by an Item Source Check for matching Voucher and Purchase Order amounts Qt::Vertical 20 40 Qt::Vertical 20 0 Tax Receives a &1099 5 Default Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _taxzone true None XComboBox::TaxZones Qt::Horizontal 40 20 0 Tax Registration Numbers: _taxreg 0 New false Edit false View false Delete Qt::Vertical 20 40 Qt::Horizontal 40 20 Contacts Contact 1 0 2 true false Contact 2 0 2 true Qt::Vertical QSizePolicy::Expanding 20 0 Addresses 12 Main true Alternates Qt::Horizontal 40 20 0 Qt::Horizontal 40 20 Qt::Vertical 20 40 0 0 5 Print 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Notes Comments Qt::StrongFocus Comments::CRMAccount Order Notes Transmission 12 Checks Qt::Horizontal 40 20 0 Enable EFT Check Printing true false Routing Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _accountNumber Qt::Horizontal 261 16 Account Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Account Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Use Instead of Vendor Number and Name: true Identification Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _accountNumber 15 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _accountNumber 22 Qt::Vertical 20 40 Qt::Vertical QSizePolicy::Fixed 20 10 AddressCluster QWidget

    addresscluster.h
    Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    ExpenseCluster QWidget
    expensecluster.h
    GLCluster QWidget
    glcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _vendtype _name _active _accountNumber _tabs _defaultTerms _defaultShipVia _defaultCurr _useWarehouseFOB _useVendorFOB _vendorFOB _accountSelected _account _expcatSelected _expcat _taxSelected _taxCode _poItems _qualified _match _restrictToItemSource _crmacct _save _close _next _previous _receives1099 _taxzone _taxreg _newTaxreg _editTaxreg _viewTaxreg _deleteTaxreg _contact1 _contact2 _mainButton _altButton _address _notes _comments _poComments _checksButton _achGroup _viewAddress _achAccountNumber _deleteAddress _editAddress _individualId _newAddress _printAddresses _routingNumber _vendaddr _individualName _accountType _useACHSpecial _close clicked() vendor close() 774 56 20 20 _useVendorFOB toggled(bool) _vendorFOB setEnabled(bool) 561 283 741 283 _taxreg valid(bool) _viewTaxreg setEnabled(bool) 219 438 311 358 _vendaddr valid(bool) _viewAddress setEnabled(bool) 39 235 138 264 _taxreg valid(bool) _editTaxreg setEnabled(bool) 255 397 311 321 _taxreg valid(bool) _deleteTaxreg setEnabled(bool) 252 467 311 382 _taxreg itemSelected(int) _editTaxreg animateClick() 275 416 311 334 _accountSelected toggled(bool) _account setEnabled(bool) 121 516 335 515 _expcatSelected toggled(bool) _expcat setEnabled(bool) 121 596 453 595 _taxSelected toggled(bool) _taxCode setEnabled(bool) 121 679 333 678 qt-client-4.1.0/guiclient/vendorAddress.cpp000066400000000000000000000157551217451700100207210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorAddress.h" #include #include #include #include vendorAddress::vendorAddress(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_number, SIGNAL(editingFinished()), this, SLOT(sCheck())); } vendorAddress::~vendorAddress() { // no need to delete child widgets, Qt does it all for us } void vendorAddress::languageChange() { retranslateUi(this); } enum SetResponse vendorAddress::set(const ParameterList &pParams) { XDialog::set(pParams); XSqlQuery setVendor; QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) _vendid = param.toInt(); param = pParams.value("vendaddr_id", &valid); if (valid) { _vendaddrid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; setVendor.prepare("SELECT crmacct_id " "FROM vendinfo " " JOIN crmacct ON (crmacct_vend_id=vend_id) " "WHERE (vend_id=:vend_id);"); setVendor.bindValue(":vend_id", _vendid); setVendor.exec(); if(setVendor.first()) { _address->setSearchAcct(setVendor.value("crmacct_id").toInt()); _contact->setSearchAcct(setVendor.value("crmacct_id").toInt()); } else if (setVendor.lastError().type() != QSqlError::NoError) { systemError(this, setVendor.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _number->setEnabled(FALSE); _name->setEnabled(FALSE); _contact->setEnabled(FALSE); _address->setEnabled(FALSE); _notes->setReadOnly(TRUE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void vendorAddress::sSave() { XSqlQuery vendorSave; if (! vendorSave.exec("BEGIN")) { systemError(this, vendorSave.lastError().databaseText(), __FILE__, __LINE__); return; } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); int saveResult = _address->save(AddressCluster::CHECK); if (-2 == saveResult) { int answer = QMessageBox::question(this, tr("Question Saving Address"), tr("There are multiple uses of this Vendor " "Address.\nWhat would you like to do?"), tr("Change This One"), tr("Change Address for All"), tr("Cancel"), 2, 2); if (0 == answer) saveResult = _address->save(AddressCluster::CHANGEONE); else if (1 == answer) saveResult = _address->save(AddressCluster::CHANGEALL); } if (saveResult < 0) // not else-if: this is error check for CHANGE{ONE,ALL} { systemError(this, tr("There was an error saving this address (%1).\n" "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); rollback.exec(); _address->setFocus(); return; } if (_mode == cNew) { vendorSave.exec("SELECT NEXTVAL('vendaddr_vendaddr_id_seq') AS vendaddr_id;"); if (vendorSave.first()) _vendaddrid = vendorSave.value("vendaddr_id").toInt(); else { rollback.exec(); systemError(this, vendorSave.lastError().databaseText(), __FILE__, __LINE__); return; } vendorSave.prepare( "INSERT INTO vendaddrinfo " "( vendaddr_id, vendaddr_vend_id," " vendaddr_code, vendaddr_name," " vendaddr_cntct_id, vendaddr_comments, vendaddr_addr_id ) " "VALUES " "( :vendaddr_id, :vendaddr_vend_id," " :vendaddr_code, :vendaddr_name," " :vendaddr_cntct_id, :vendaddr_comments, :vendaddr_addr_id );"); } else if (_mode == cEdit) vendorSave.prepare( "UPDATE vendaddrinfo " "SET vendaddr_code=:vendaddr_code, vendaddr_name=:vendaddr_name," " vendaddr_cntct_id=:vendaddr_cntct_id," " vendaddr_comments=:vendaddr_comments, " " vendaddr_addr_id=:vendaddr_addr_id " "WHERE (vendaddr_id=:vendaddr_id);" ); vendorSave.bindValue(":vendaddr_id", _vendaddrid); vendorSave.bindValue(":vendaddr_vend_id", _vendid); vendorSave.bindValue(":vendaddr_code", _number->text().trimmed()); vendorSave.bindValue(":vendaddr_name", _name->text().trimmed()); if (_contact->id() > 0) vendorSave.bindValue(":vendaddr_cntct_id", _contact->id()); if (_address->id() > 0) vendorSave.bindValue(":vendaddr_addr_id", _address->id()); vendorSave.bindValue(":vendaddr_comments", _notes->toPlainText().trimmed()); vendorSave.exec(); if (vendorSave.lastError().type() != QSqlError::NoError) { rollback.exec(); systemError(this, vendorSave.lastError().databaseText(), __FILE__, __LINE__); return; } vendorSave.exec("COMMIT;"); done(_vendaddrid); } void vendorAddress::sCheck() { XSqlQuery vendorCheck; if ((_mode == cNew) && (_number->text().length())) { vendorCheck.prepare( "SELECT vendaddr_id " "FROM vendaddrinfo " "WHERE ( (vendaddr_vend_id=:vend_id)" " AND (UPPER(vendaddr_code)=UPPER(:vendaddr_code)) );" ); vendorCheck.bindValue(":vend_id", _vendid); vendorCheck.bindValue(":vendaddr_code", _number->text().trimmed()); vendorCheck.exec(); if (vendorCheck.first()) { _vendaddrid = vendorCheck.value("vendaddr_id").toInt(); _mode = cEdit; populate(); _number->setEnabled(FALSE); } } } void vendorAddress::populate() { XSqlQuery vendorpopulate; vendorpopulate.prepare( "SELECT vendaddrinfo.*, crmacct_id " "FROM vendaddrinfo " " JOIN crmacct ON (vendaddr_vend_id=crmacct_vend_id) " "WHERE (vendaddr_id=:vendaddr_id);" ); vendorpopulate.bindValue(":vendaddr_id", _vendaddrid); vendorpopulate.exec(); if (vendorpopulate.first()) { _vendid = vendorpopulate.value("vendaddr_vend_id").toInt(); _number->setText(vendorpopulate.value("vendaddr_code")); _name->setText(vendorpopulate.value("vendaddr_name")); _contact->setId(vendorpopulate.value("vendaddr_cntct_id").toInt()); _address->setId(vendorpopulate.value("vendaddr_addr_id").toInt()); _notes->setText(vendorpopulate.value("vendaddr_comments").toString()); _address->setSearchAcct(vendorpopulate.value("crmacct_id").toInt()); _contact->setSearchAcct(vendorpopulate.value("crmacct_id").toInt()); } } qt-client-4.1.0/guiclient/vendorAddress.h000066400000000000000000000021631217451700100203530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORADDRESS_H #define VENDORADDRESS_H #include "guiclient.h" #include "xdialog.h" #include #include "contactcluster.h" #include "ui_vendorAddress.h" class vendorAddress : public XDialog, public Ui::vendorAddress { Q_OBJECT public: vendorAddress(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~vendorAddress(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void sSave(); virtual void sCheck(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _vendid; int _vendaddrid; }; #endif // VENDORADDRESS_H qt-client-4.1.0/guiclient/vendorAddress.ui000066400000000000000000000157771217451700100205600ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. vendorAddress 0 0 475 570 0 1 Vendor Address Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _number 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _name 5 &Cancel &Save true false Qt::Vertical 20 40 Contact true 0 1 QFrame::NoFrame QFrame::Raised 0 0 Notes: _notes 0 1 AddressCluster QWidget
    addresscluster.h
    ContactCluster QWidget
    contactcluster.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _number _name _address _contact _notes _save _close _close clicked() vendorAddress reject() 507 31 20 20
    qt-client-4.1.0/guiclient/vendorAddressList.cpp000066400000000000000000000057151217451700100215500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorAddressList.h" #include vendorAddressList::vendorAddressList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_vendaddr, SIGNAL(itemSelected(int)), _select, SLOT(animateClick())); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); _vendaddr->addColumn(tr("Code"), _orderColumn, Qt::AlignLeft, true, "code" ); _vendaddr->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "name" ); _vendaddr->addColumn(tr("Address"), 100, Qt::AlignLeft, true, "address" ); } vendorAddressList::~vendorAddressList() { // no need to delete child widgets, Qt does it all for us } void vendorAddressList::languageChange() { retranslateUi(this); } enum SetResponse vendorAddressList::set(const ParameterList &pParams) { XDialog::set(pParams); XSqlQuery setVendor; QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) { _vendid = param.toInt(); setVendor.prepare("SELECT (vend_number||' - '||vend_name) AS f_name," " addr_line1" " FROM vendinfo" " LEFT OUTER JOIN addr ON (vend_addr_id=addr_id)" " WHERE(vend_id=:vend_id);"); setVendor.bindValue(":vend_id", _vendid); setVendor.exec(); if(setVendor.first()) { _vendName->setText(setVendor.value("f_name").toString()); _vendAddr1->setText(setVendor.value("addr_line1").toString()); } } sFillList(); return NoError; } void vendorAddressList::sSelect() { done(_vendaddr->id()); } void vendorAddressList::sClose() { done(_vendaddrid); } void vendorAddressList::sFillList() { XSqlQuery vendorFillList; vendorFillList.prepare( "SELECT -1 AS id, 'Main' AS code, vend_name AS name, addr_line1 AS address," " 0 AS orderby " "FROM vendinfo " "LEFT OUTER JOIN addr ON (vend_addr_id=addr_id) " "WHERE (vend_id=:vend_id) " "UNION " "SELECT vendaddr_id AS id, vendaddr_code AS code, vendaddr_name AS name, addr_line1 AS address," " 1 AS orderby " "FROM vendaddrinfo " "LEFT OUTER JOIN addr ON (vendaddr_addr_id=addr_id) " "WHERE (vendaddr_vend_id=:vend_id) " "ORDER BY orderby, code;" ); vendorFillList.bindValue(":vend_id", _vendid); vendorFillList.exec(); _vendaddr->populate(vendorFillList, _vendid); } qt-client-4.1.0/guiclient/vendorAddressList.h000066400000000000000000000021561217451700100212110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORADDRESSLIST_H #define VENDORADDRESSLIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_vendorAddressList.h" class vendorAddressList : public XDialog, public Ui::vendorAddressList { Q_OBJECT public: vendorAddressList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~vendorAddressList(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sClose(); virtual void sFillList(); protected slots: virtual void languageChange(); virtual void sSelect(); private: int _vendid; int _vendaddrid; }; #endif // VENDORADDRESSLIST_H qt-client-4.1.0/guiclient/vendorAddressList.ui000066400000000000000000000154731217451700100214050ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. vendorAddressList 0 0 555 271 Vendor Address List 5 5 0 7 0 0 0 5 0 0 Vendor: Qt::Vertical QSizePolicy::Preferred 20 20 0 0 7 5 0 0 7 5 0 0 Qt::Vertical QSizePolicy::Preferred 20 20 0 5 &Cancel false &Select true true 0 0 Vendor Addresses: 7 7 0 0 0 100 XTreeWidget QTreeWidget
    xtreewidget.h
    _vendaddr _select _close _vendaddr itemSelected(int) _select animateClick() 26 111 493 59 _vendaddr valid(bool) _select setEnabled(bool) 243 96 481 46
    qt-client-4.1.0/guiclient/vendorPriceList.cpp000066400000000000000000000137621217451700100212260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorPriceList.h" #include #include #include #include #include "mqlutil.h" vendorPriceList::vendorPriceList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); XSqlQuery vendorPrice; // signals and slots connections connect(_price, SIGNAL(clicked(QModelIndex)), this, SLOT(sQtyUpdate())); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_price, SIGNAL(itemSelected(int)), _select, SLOT(animateClick())); connect(_price, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_qty, SIGNAL(textChanged(const QString&)), this, SLOT(sQtyEntered())); QString base; vendorPrice.exec("SELECT currConcat(baseCurrID()) AS base;"); if (vendorPrice.first()) base = vendorPrice.value("base").toString(); else base = tr("Base"); if (_metrics->boolean("MultiWhs")) { _price->addColumn(tr("Site"), _qtyColumn, Qt::AlignCenter,true, "warehous_code"); _price->addColumn(tr("Order Type"), -1, Qt::AlignCenter,true, "itemsrcp_dropship"); } _price->addColumn(tr("Qty Break"), _qtyColumn, Qt::AlignRight,true, "itemsrcp_qtybreak"); _price->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currabbr"); _price->addColumn(tr("Unit Price"), -1, Qt::AlignRight,true, "itemsrcp_price"); _price->addColumn(tr("Discount Percent"), -1, Qt::AlignRight,true, "itemsrcp_discntprcnt" ); _price->addColumn(tr("Discount Fixed Amt."), -1, Qt::AlignRight,true, "itemsrcp_fixedamtdiscount" ); _price->addColumn(tr("Unit Price\n(%1)").arg(base),_moneyColumn, Qt::AlignRight,true, "price_base"); _price->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "type"); } vendorPriceList::~vendorPriceList() { // no need to delete child widgets, Qt does it all for us } void vendorPriceList::languageChange() { retranslateUi(this); } enum SetResponse vendorPriceList::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("itemsrc_id", &valid); if (valid) { _itemsrcid = param.toInt(); } param = pParams.value("qty", &valid); if (valid) { if(param.toDouble() <= 0) _qty->setDouble(1); else _qty->setDouble(param.toDouble()); } sFillList(); return NoError; } void vendorPriceList::sQtyUpdate() { XSqlQuery vendorQtyUpdate; vendorQtyUpdate.prepare( "SELECT itemsrcp_qtybreak " "FROM itemsrcp " "WHERE (itemsrcp_id=:itemsrcp_id) " "ORDER BY itemsrcp_qtybreak;" ); vendorQtyUpdate.bindValue(":itemsrcp_id", _price->id()); vendorQtyUpdate.exec(); if (vendorQtyUpdate.first()) _qty->setDouble(vendorQtyUpdate.value("itemsrcp_qtybreak").toDouble()); else { _qty->setDouble(0); } sPopulatePricing(); } void vendorPriceList::sQtyEntered() { for (int i = 0; i < _price->topLevelItemCount(); i++) { _price->setCurrentItem(_price->topLevelItem(i)); _price->scrollToItem(_price->topLevelItem(i)); if ( _qty->toDouble() >= _price->currentItem()->rawValue("itemsrcp_qtybreak").toDouble() ) break; } sPopulatePricing(); } void vendorPriceList::sPopulatePricing() { XSqlQuery vendorPopulatePricing; vendorPopulatePricing.prepare( "SELECT currToCurr(itemsrcp_curr_id, :curr_id, itemsrcp_price, :effective) " "AS new_itemsrcp_price " "FROM itemsrcp " "WHERE ( (itemsrcp_itemsrc_id=:itemsrc_id)" " AND (itemsrcp_qtybreak <= :qty) ) " "ORDER BY itemsrcp_qtybreak DESC " "LIMIT 1;" ); vendorPopulatePricing.bindValue(":itemsrc_id", _itemsrcid); vendorPopulatePricing.bindValue(":qty", _qty->toDouble()); vendorPopulatePricing.bindValue(":curr_id", _unitPrice->id()); vendorPopulatePricing.bindValue(":effective", _unitPrice->effective()); vendorPopulatePricing.exec(); if (vendorPopulatePricing.first()) _unitPrice->setLocalValue(vendorPopulatePricing.value("new_itemsrcp_price").toDouble()); else _unitPrice->clear(); _extendedPrice->setLocalValue(_qty->toDouble() * _unitPrice->localValue()); } void vendorPriceList::sSelect() { if ( _qty->toDouble() > 0 ) _selectedQty = _qty->toDouble(); else _selectedQty = 1; accept(); } void vendorPriceList::sFillList() { XSqlQuery priceq; MetaSQLQuery mql = mqlLoad("itemSources", "prices"); ParameterList params; params.append("itemsrc_id", _itemsrcid); params.append("nominal",tr("Nominal")); params.append("discount",tr("Discount")); params.append("price", tr("Price")); params.append("fixed", tr("Fixed")); params.append("percent", tr("Percent")); params.append("mixed", tr("Mixed")); params.append("all", tr("All")); params.append("stock", tr("Into Stock")); params.append("dropship", tr("Drop Ship")); priceq = mql.toQuery(params); _price->populate(priceq, TRUE); priceq = mql.toQuery(params); if (priceq.first()) _unitPrice->setId(priceq.value("itemsrcp_curr_id").toInt()); _extendedPrice->setId(priceq.value("itemsrcp_curr_id").toInt()); _price->clearSelection(); for (int i = 0; i < _price->topLevelItemCount(); i++) { if ( _qty->toDouble() >= _price->topLevelItem(i)->text(0).toDouble() ) { _price->setCurrentItem(_price->topLevelItem(i)); _price->scrollToItem(_price->topLevelItem(i)); break; } } } qt-client-4.1.0/guiclient/vendorPriceList.h000066400000000000000000000022511217451700100206620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORPRICELIST_H #define VENDORPRICELIST_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_vendorPriceList.h" class vendorPriceList : public XDialog, public Ui::vendorPriceList { Q_OBJECT public: vendorPriceList(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~vendorPriceList(); double _selectedQty; public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sQtyUpdate(); virtual void sQtyEntered(); virtual void sPopulatePricing(); virtual void sSelect(); virtual void sFillList(); protected slots: virtual void languageChange(); private: int _itemsrcid; }; #endif // VENDORPRICELIST_H qt-client-4.1.0/guiclient/vendorPriceList.ui000066400000000000000000000246111217451700100210540ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. vendorPriceList 0 0 531 339 0 0 Price List 0 0 0 Quantity: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _qty 0 0 200 0 300 16777215 Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _unitPrice 300 32767 CurrDisplay::Cost true false false 0 Extended Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 300 32767 CurrDisplay::ExtPrice false true false Qt::Vertical QSizePolicy::MinimumExpanding 207 16 Qt::Horizontal QSizePolicy::Expanding 207 16 6 0 &Cancel false &Select true true Qt::Vertical QSizePolicy::MinimumExpanding 0 0 0 1 QFrame::NoFrame QFrame::Plain 0 0 0 0 0 0 &Items: _price 0 0 0 100 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _qty _price _select _close _price itemSelected(int) _select animateClick() 29 212 479 66 _price valid(bool) _select setEnabled(bool) 29 212 479 66
    qt-client-4.1.0/guiclient/vendorType.cpp000066400000000000000000000110111217451700100202320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorType.h" #include #include vendorType::vendorType(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); } vendorType::~vendorType() { // no need to delete child widgets, Qt does it all for us } void vendorType::languageChange() { retranslateUi(this); } enum SetResponse vendorType::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("vendtype_id", &valid); if (valid) { _vendtypeid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _description->setEnabled(FALSE); _buttonBox->clear(); _buttonBox->addButton(QDialogButtonBox::Close); } } return NoError; } void vendorType::sCheck() { XSqlQuery vendorCheck; _code->setText(_code->text().trimmed()); if ((_mode == cNew) && (_code->text().length())) { vendorCheck.prepare( "SELECT vendtype_id " "FROM vendtype " "WHERE (UPPER(vendtype_code)=UPPER(:venttype_code));" ); vendorCheck.bindValue(":vendtype_code", _code->text()); vendorCheck.exec(); if (vendorCheck.first()) { _vendtypeid = vendorCheck.value("vendtype_id").toInt(); _mode = cEdit; populate(); _code->setEnabled(FALSE); } } } void vendorType::sSave() { XSqlQuery vendorSave; if (_code->text().length() == 0) { QMessageBox::information( this, tr("Invalid Vendor Type Code"), tr("You must enter a valid Code for this Vendor Type before creating it.") ); _code->setFocus(); return; } vendorSave.prepare("SELECT vendtype_id" " FROM vendtype" " WHERE((vendtype_id != :vendtype_id)" " AND (vendtype_code=:vendtype_code))"); vendorSave.bindValue(":vendtype_id", _vendtypeid); vendorSave.bindValue(":vendtype_code", _code->text().trimmed()); vendorSave.exec(); if(vendorSave.first()) { QMessageBox::critical( this, tr("Duplicate Entry"), tr("The Code you have entered for this Vendor Type is already in the system.") ); return; } if (_mode == cNew) { vendorSave.exec("SELECT NEXTVAL('vendtype_vendtype_id_seq') AS _vendtype_id;"); if (vendorSave.first()) _vendtypeid = vendorSave.value("_vendtype_id").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } vendorSave.prepare( "INSERT INTO vendtype " "(vendtype_id, vendtype_code, vendtype_descrip) " "VALUES " "(:vendtype_id, :vendtype_code, :vendtype_descrip);" ); } else if (_mode == cEdit) vendorSave.prepare( "UPDATE vendtype " "SET vendtype_code=:vendtype_code," " vendtype_descrip=:vendtype_descrip " "WHERE (vendtype_id=:vendtype_id);" ); vendorSave.bindValue(":vendtype_id", _vendtypeid); vendorSave.bindValue(":vendtype_code", _code->text().trimmed()); vendorSave.bindValue(":vendtype_descrip", _description->text().trimmed()); vendorSave.exec(); done(_vendtypeid); } void vendorType::populate() { XSqlQuery vendorpopulate; vendorpopulate.prepare( "SELECT vendtype_code, vendtype_descrip " "FROM vendtype " "WHERE (vendtype_id=:vendtype_id);" ); vendorpopulate.bindValue(":vendtype_id", _vendtypeid); vendorpopulate.exec(); if (vendorpopulate.first()) { _code->setText(vendorpopulate.value("vendtype_code")); _description->setText(vendorpopulate.value("vendtype_descrip")); } } qt-client-4.1.0/guiclient/vendorType.h000066400000000000000000000020571217451700100177110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORTYPE_H #define VENDORTYPE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_vendorType.h" class vendorType : public XDialog, public Ui::vendorType { Q_OBJECT public: vendorType(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~vendorType(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sCheck(); virtual void sSave(); virtual void populate(); protected slots: virtual void languageChange(); private: int _mode; int _vendtypeid; }; #endif // VENDORTYPE_H qt-client-4.1.0/guiclient/vendorType.ui000066400000000000000000000104741217451700100201010ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. vendorType 0 0 459 81 Vendor Type 0 7 5 C&ode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description 5 0 Qt::Horizontal QSizePolicy::Expanding 20 20 Qt::Vertical QSizePolicy::Expanding 20 16 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save XLineEdit QLineEdit
    xlineedit.h
    1
    _code _description parameter.h
    qt-client-4.1.0/guiclient/vendorTypes.cpp000066400000000000000000000102341217451700100204230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorTypes.h" #include #include //#include #include #include #include #include "vendorType.h" #include "guiclient.h" /* * Constructs a vendorTypes as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * */ vendorTypes::vendorTypes(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); // (void)statusBar(); // signals and slots connections connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_vendtype, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *)), this, SLOT(sPopulateMenu(QMenu*))); connect(_close, SIGNAL(clicked()), this, SLOT(close())); // statusBar()->hide(); if (_privileges->check("MaintainVendorTypes")) { connect(_vendtype, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_vendtype, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_vendtype, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); } _vendtype->addColumn(tr("Code"), 70, Qt::AlignLeft, true, "vendtype_code" ); _vendtype->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "vendtype_descrip" ); sFillList(); } /* * Destroys the object and frees any allocated resources */ vendorTypes::~vendorTypes() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void vendorTypes::languageChange() { retranslateUi(this); } void vendorTypes::sFillList() { _vendtype->populate( "SELECT vendtype_id, vendtype_code, vendtype_descrip " "FROM vendtype " "ORDER BY vendtype_code;" ); } void vendorTypes::sDelete() { XSqlQuery vendorDelete; vendorDelete.prepare( "SELECT vend_id " "FROM vendinfo " "WHERE (vend_vendtype_id=:vendtype_id) " "LIMIT 1;" ); vendorDelete.bindValue(":vendtype_id", _vendtype->id()); vendorDelete.exec(); if (vendorDelete.first()) { QMessageBox::critical( this, tr("Cannot Delete Vendor Type"), tr( "The selected Vendor Type cannot be deleted as there are one or more Vendors assigned to it.\n" "You must reassign these Vendors before you may delete the selected Vendor Type." ) ); return; } vendorDelete.prepare( "DELETE FROM vendtype " "WHERE (vendtype_id=:vendtype_id);" "DELETE FROM apaccnt " "WHERE (apaccnt_vendtype_id=:vendtype_id);" ); vendorDelete.bindValue(":vendtype_id", _vendtype->id()); vendorDelete.exec(); sFillList(); } void vendorTypes::sNew() { ParameterList params; params.append("mode", "new"); vendorType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void vendorTypes::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("vendtype_id", _vendtype->id()); vendorType newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void vendorTypes::sView() { ParameterList params; params.append("mode", "view"); params.append("vendtype_id", _vendtype->id()); vendorType newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void vendorTypes::sPopulateMenu(QMenu *) { } void vendorTypes::sPrint() { orReport report("VendorTypesMasterList"); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/vendorTypes.h000066400000000000000000000020101217451700100200610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORTYPES_H #define VENDORTYPES_H #include "xwidget.h" #include "ui_vendorTypes.h" class vendorTypes : public XWidget, public Ui::vendorTypes { Q_OBJECT public: vendorTypes(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~vendorTypes(); public slots: virtual void sFillList(); virtual void sDelete(); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sPopulateMenu( QMenu * ); virtual void sPrint(); protected slots: virtual void languageChange(); }; #endif // VENDORTYPES_H qt-client-4.1.0/guiclient/vendorTypes.ui000066400000000000000000000076571217451700100202750ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. vendorTypes 0 0 600 400 List Vendor Types 0 Vendor Types: &Close &Print Qt::Vertical QSizePolicy::Preferred 20 5 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 XTreeWidget QTreeWidget
    xtreewidget.h
    _vendtype _new _edit _delete _print _close _close clicked() vendorTypes close() 20 20 20 20
    qt-client-4.1.0/guiclient/vendorWorkBench.cpp000066400000000000000000000324701217451700100212070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorWorkBench.h" #include #include #include #include #include #include #include "crmaccount.h" #include "dspAPApplications.h" #include "dspCheckRegister.h" #include "dspPOsByVendor.h" #include "dspPoItemReceivingsByVendor.h" #include "dspVendorAPHistory.h" #include "selectPayments.h" #include "unappliedAPCreditMemos.h" #include "vendor.h" vendorWorkBench::vendorWorkBench(QWidget* parent, const char *name, Qt::WFlags fl) : XWidget (parent, name, fl) { setupUi(this); _vend->setShowInactive(true); QWidget *hideme = 0; if (_privileges->check("ViewPurchaseOrders")) { _po = new dspPOsByVendor(this, "dspPOsByVendor", Qt::Widget); _poTab->layout()->addWidget(_po); _po->setCloseVisible(false); hideme = _po->findChild("_vendGroup"); hideme->hide(); VendorGroup *povend = _po->findChild("_vend"); if (povend) { povend->setState(VendorGroup::Selected); connect(povend, SIGNAL(newVendId(int)), _po, SLOT(sFillList())); connect(_vend, SIGNAL(newId(int)), povend, SLOT(setVendId(int))); } _po->show(); } else _tabWidget->setTabEnabled(_tabWidget->indexOf(_poTab), false); if (_privileges->check("ViewPurchaseOrders")) { _receipts = new dspPoItemReceivingsByVendor(this, "dspPoItemReceivingsByVendor", Qt::Widget); _receiptsTab->layout()->addWidget(_receipts); _receipts->setCloseVisible(false); hideme = _receipts->findChild("_vendorGroup"); hideme->hide(); QWidget *rcptvend = _receipts->findChild("_vendor"); rcptvend->hide(); connect(rcptvend, SIGNAL(newId(int)), _receipts, SLOT(sFillList())); connect(_vend, SIGNAL(newId(int)), rcptvend, SLOT(setId(int))); } else _tabWidget->setTabEnabled(_tabWidget->indexOf(_receiptsTab), false); if (_privileges->check("MaintainPayments")) { _payables = new selectPayments(this, "selectPayments", Qt::Widget, false); _payablesTab->layout()->addWidget(_payables); hideme = _payables->findChild("_close"); hideme->hide(); VendorGroup *payvend = _payables->findChild("_vendorgroup"); payvend->setState(VendorGroup::Selected); payvend->hide(); connect(payvend, SIGNAL(newVendId(int)), _payables, SLOT(sFillList())); connect(_vend, SIGNAL(newId(int)), payvend, SLOT(setVendId(int))); } else _tabWidget->setTabEnabled(_tabWidget->indexOf(_payablesTab), false); if (_privileges->check("MaintainAPMemos") || _privileges->check("ViewAPMemos")) { _credits = new unappliedAPCreditMemos(this, "unappliedAPCreditMemos", Qt::Widget); _cmTab->layout()->addWidget(_credits); hideme = _credits->findChild("_close"); hideme->hide(); VendorGroup *cmvend = _credits->findChild("_vendorgroup"); cmvend->setState(VendorGroup::Selected); cmvend->hide(); connect(cmvend, SIGNAL(newVendId(int)), _credits, SLOT(sFillList())); connect(_vend, SIGNAL(newId(int)), cmvend, SLOT(setVendId(int))); } else _tabWidget->setTabEnabled(_tabWidget->indexOf(_cmTab), false); if (_privileges->check("MaintainPayments")) { _checks = new dspCheckRegister(this, "dspCheckRegister", Qt::Widget); _checksTab->layout()->addWidget(_checks); _checks->findChild("_close")->hide(); _checks->findChild("_recipGroup")->setChecked(true); _checks->findChild("_recipGroup")->hide(); _checks->findChild("_dates")->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _checks->findChild("_dates")->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); VendorCluster *checkvend = _checks->findChild("_vend"); connect(checkvend, SIGNAL(newId(int)), _checks, SLOT(sFillList())); connect(_vend, SIGNAL(newId(int)), checkvend, SLOT(setId(int))); } else _tabWidget->setTabEnabled(_tabWidget->indexOf(_checksTab), false); if (_privileges->check("ViewAPOpenItems")) { _history = new dspVendorAPHistory(this, "dspVendorAPHistory", Qt::Widget); _historyTab->layout()->addWidget(_history); _history->setCloseVisible(false); _history->findChild("_vendGroup")->hide(); _history->findChild("_dates")->setStartNull(tr("Earliest"), omfgThis->startOfTime(), TRUE); _history->findChild("_dates")->setEndNull(tr("Latest"), omfgThis->endOfTime(), TRUE); VendorCluster *histvend = _history->findChild("_vend"); connect(histvend, SIGNAL(newId(int)), _history, SLOT(sFillList())); connect(_vend, SIGNAL(newId(int)), histvend, SLOT(setId(int))); } else _tabWidget->setTabEnabled(_tabWidget->indexOf(_historyTab), false); connect(_crmacct, SIGNAL(clicked()), this, SLOT(sCRMAccount())); connect(_edit, SIGNAL(clicked()), this, SLOT(sVendor())); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_vend, SIGNAL(newId(int)), this, SLOT(sPopulate())); connect(_contact1Button, SIGNAL(clicked()), this, SLOT(sHandleButtons())); connect(_contact2Button, SIGNAL(clicked()), this, SLOT(sHandleButtons())); _edit->setText(_privileges->check("MaintainVendors") ? tr("Edit") : tr("View")); _backlog->setPrecision(omfgThis->moneyVal()); _lastYearsPurchases->setPrecision(omfgThis->moneyVal()); _ytdPurchases->setPrecision(omfgThis->moneyVal()); _openBalance->setPrecision(omfgThis->moneyVal()); clear(); } vendorWorkBench::~vendorWorkBench() { // no need to delete child widgets, Qt does it all for us } void vendorWorkBench::languageChange() { retranslateUi(this); } enum SetResponse vendorWorkBench::set(const ParameterList & pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("vend_id", &valid); if (valid) { _vend->setId(param.toInt()); _vend->setReadOnly(TRUE); } return NoError; } bool vendorWorkBench::setParams(ParameterList ¶ms) { if(!_vend->isValid()) { QMessageBox::warning(this, tr("No Vendor Selected"), tr("You must select a valid Vendor.") ); _vend->setFocus(); return false; } params.append("vend_id", _vend->id()); return true; } void vendorWorkBench::sPrint() { ParameterList params; if (! setParams(params)) return; orReport report("VendorInformation", params); if (report.isValid()) report.print(); else report.reportError(this); } void vendorWorkBench::clear() { _name->setText(""); _vendType->setId(-1); _terms->setId(-1); _shipvia->setId(-1); _active->setChecked(true); _primaryContact->setId(-1); _secondaryContact->setId(-1); _crmacctId = -1; _backlog->clear(); _lastYearsPurchases->clear(); _ytdPurchases->clear(); _backlog->clear(); } void vendorWorkBench::sCRMAccount() { ParameterList params; if (_privileges->check("MaintainAllCRMAccounts") || (_privileges->check("MaintainPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "edit"); else if (_privileges->check("ViewAllCRMAccounts") || (_privileges->check("ViewPersonalCRMAccounts") && omfgThis->username() == _crmowner)) params.append("mode", "view"); else { qWarning("tried to open CRM Account window without privilege"); return; } params.append("crmacct_id", _crmacctId); crmaccount *newdlg = new crmaccount(this, "crmaccount"); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void vendorWorkBench::sPopulate() { XSqlQuery vendorPopulate; ParameterList params; if (! setParams(params)) { clear(); return; } MetaSQLQuery mql("SELECT vend_name, vend_vendtype_id, vend_terms_id," " vend_shipvia, vend_active, vend_cntct1_id," " vend_cntct2_id, crmacct_id, crmacct_owner_username," " MIN(pohead_orderdate) AS minpodate, " " MAX(pohead_orderdate) AS maxpodate, " " SUM(currToBase(pohead_curr_id," " (poitem_qty_ordered - poitem_qty_received) * poitem_unitprice," " CURRENT_DATE)) AS backlog " "FROM vendinfo JOIN crmacct ON (crmacct_vend_id=vend_id)" " LEFT OUTER JOIN pohead ON (pohead_vend_id=vend_id)" " LEFT OUTER JOIN poitem ON (poitem_pohead_id=pohead_id" " AND poitem_status='O')" "WHERE (vend_id=) " "GROUP BY vend_name, vend_vendtype_id, vend_terms_id," " vend_shipvia, vend_active, vend_cntct1_id," " vend_cntct2_id, crmacct_id, crmacct_owner_username;"); vendorPopulate = mql.toQuery(params); if (vendorPopulate.first()) { _name->setText(vendorPopulate.value("vend_name").toString()); _vendType->setId(vendorPopulate.value("vend_vendtype_id").toInt()); _terms->setId(vendorPopulate.value("vend_terms_id").toInt()); _shipvia->setText(vendorPopulate.value("vend_shipvia").toString()); _active->setChecked(vendorPopulate.value("vend_active").toBool()); _primaryContact->setId(vendorPopulate.value("vend_cntct1_id").toInt()); _secondaryContact->setId(vendorPopulate.value("vend_cntct2_id").toInt()); _crmacctId = vendorPopulate.value("crmacct_id").toInt(); _crmowner = vendorPopulate.value("crmacct_owner_username").toString(); _firstPurchase->setDate(vendorPopulate.value("minpodate").toDate()); _lastPurchase->setDate(vendorPopulate.value("maxpodate").toDate()); _backlog->setDouble(vendorPopulate.value("backlog").toDouble()); } else if (vendorPopulate.lastError().type() != QSqlError::NoError) { systemError(this, vendorPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } MetaSQLQuery purchbydate("SELECT SUM(currToBase(vohead_curr_id," " vohead_amount," " vohead_gldistdate)) AS purchases " "FROM vohead JOIN apopen ON (apopen_doctype='V' AND" " apopen_docnumber=vohead_number AND" " NOT apopen_void) " "WHERE (vohead_posted" " AND (vohead_gldistdate " " BETWEEN ()" " AND ())" " AND (vohead_vend_id=));"); params.append("older", "DATE_TRUNC('year', CURRENT_DATE) - INTERVAL '1 year'"); params.append("younger", "DATE_TRUNC('year', CURRENT_DATE) - INTERVAL '1 day'"); vendorPopulate = purchbydate.toQuery(params); if (vendorPopulate.first()) _lastYearsPurchases->setDouble(vendorPopulate.value("purchases").toDouble()); else if (vendorPopulate.lastError().type() != QSqlError::NoError) { systemError(this, vendorPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } ParameterList ytdparams; ytdparams.append("vend_id", _vend->id()); ytdparams.append("older", "DATE_TRUNC('year', CURRENT_DATE)"); ytdparams.append("younger", "CURRENT_DATE"); vendorPopulate = purchbydate.toQuery(ytdparams); if (vendorPopulate.first()) _ytdPurchases->setDouble(vendorPopulate.value("purchases").toDouble()); else if (vendorPopulate.lastError().type() != QSqlError::NoError) { systemError(this, vendorPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } MetaSQLQuery balm("SELECT COALESCE(SUM((apopen_amount-apopen_paid) / apopen_curr_rate * " " CASE WHEN (apopen_doctype IN ('D','V')) THEN 1 ELSE -1 END), 0.0) AS balance " "FROM apopen " "WHERE ((apopen_open)" " AND (apopen_vend_id=));"); vendorPopulate = balm.toQuery(params); if (vendorPopulate.first()) _openBalance->setDouble(vendorPopulate.value("balance").toDouble()); else if (vendorPopulate.lastError().type() != QSqlError::NoError) { systemError(this, vendorPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } void vendorWorkBench::sVendor() { ParameterList params; if (! setParams(params)) return; params.append("mode", _privileges->check("MaintainVendors") ? "edit" : "view"); vendor *newdlg = new vendor(this, "vendor"); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void vendorWorkBench::sHandleButtons() { if (_contact1Button->isChecked()) _stackedWidget->setCurrentIndex(_stackedWidget->indexOf(_contact1Page)); else _stackedWidget->setCurrentIndex(_stackedWidget->indexOf(_contact2Page)); } qt-client-4.1.0/guiclient/vendorWorkBench.h000066400000000000000000000033201217451700100206440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORWORKBENCH_H #define VENDORWORKBENCH_H #include "guiclient.h" #include "xwidget.h" #include "ui_vendorWorkBench.h" class ParameterList; //class dspAPApplications; class dspCheckRegister; class dspPOsByVendor; class dspPoItemReceivingsByVendor; class dspVendorAPHistory; class unappliedAPCreditMemos; class selectPayments; class vendorWorkBench : public XWidget, public Ui::vendorWorkBench { Q_OBJECT public: vendorWorkBench(QWidget* parent = 0, const char *name = 0, Qt::WFlags f = 0); ~vendorWorkBench(); virtual SetResponse set(const ParameterList &); virtual bool setParams(ParameterList &); public slots: virtual void clear(); virtual void sCRMAccount(); virtual void sPopulate(); virtual void sPrint(); virtual void sVendor(); virtual void sHandleButtons(); protected slots: virtual void languageChange(); protected: //dspAPApplications *_applications; unappliedAPCreditMemos *_credits; selectPayments *_payables; dspPOsByVendor *_po; dspPoItemReceivingsByVendor *_receipts; dspVendorAPHistory *_history; dspCheckRegister *_checks; private: int _crmacctId; QString _crmowner; }; #endif // VENDORWORKBENCH_H qt-client-4.1.0/guiclient/vendorWorkBench.ui000066400000000000000000000473251217451700100210470ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. vendorWorkBench 0 0 800 600 Vendor Workbench Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Name Default Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _terms false true XComboBox::Terms Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _vendType false true XComboBox::VendorTypes false true XComboBox::ShipVias Default Ship Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipvia Vendor #: false false Account... Qt::Horizontal 40 20 false Active Qt::Horizontal 40 20 Close false Print false Edit Qt::Vertical QSizePolicy::Expanding 20 0 First Purchase: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _firstPurchase false Last Year's Purchases: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 50 0 Most Recent Purchase: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _lastPurchase false YTD Purchases: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 50 0 Qt::Horizontal 0 20 Backlog: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 24 Open Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 50 0 0 1 0 Contacts 12 Contact 1 true Contact 2 Qt::Horizontal 40 20 0 false false false false Qt::Vertical 662 103 Qt::Horizontal 40 20 false false false false Qt::Vertical 639 40 Qt::Horizontal 40 20 Purchase Orders Receipts and Returns Payables Credit Memos A/P History Checks ContactCluster QWidget
    contactcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    VendorCluster QWidget
    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    _vend _crmacct _active _terms _vendType _shipvia _firstPurchase _lastPurchase _tabWidget _contact1Button _contact2Button _primaryContact _close _print _edit _secondaryContact _close clicked() vendorWorkBench close() 760 25 809 10 _vend valid(bool) _crmacct setEnabled(bool) 128 34 304 37 _vend valid(bool) _print setEnabled(bool) 137 38 729 63 _vend valid(bool) _edit setEnabled(bool) 103 36 768 94
    qt-client-4.1.0/guiclient/vendors.cpp000066400000000000000000000123661217451700100175710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendors.h" #include #include #include #include #include #include "errorReporter.h" #include "parameterwidget.h" #include "storedProcErrorLookup.h" #include "vendor.h" vendors::vendors(QWidget* parent, const char*, Qt::WFlags fl) : display(parent, "vendors", fl) { setWindowTitle(tr("Vendors")); setReportName("VendorMasterList"); setMetaSQLOptions("vendors", "detail"); setParameterWidgetVisible(true); setNewVisible(true); setSearchVisible(true); setQueryOnStartEnabled(true); parameterWidget()->append(tr("Show Inactive"), "showInactive", ParameterWidget::Exists); parameterWidget()->append(tr("Vendor Number Pattern"), "vend_number_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Vendor Name Pattern"), "vend_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Vendor Type Pattern"), "vendtype_code_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Contact Name Pattern"), "cntct_name_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Phone Pattern"), "cntct_phone_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Email Pattern"), "cntct_email_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Street Pattern"), "addr_street_pattern", ParameterWidget::Text); parameterWidget()->append(tr("City Pattern"), "addr_city_pattern", ParameterWidget::Text); parameterWidget()->append(tr("State Pattern"), "addr_state_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Postal Code Pattern"), "addr_postalcode_pattern", ParameterWidget::Text); parameterWidget()->append(tr("Country Pattern"), "addr_country_pattern", ParameterWidget::Text); list()->addColumn(tr("Type"), _itemColumn, Qt::AlignCenter, true, "vendtype_code"); list()->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft, true, "vend_number"); list()->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "vend_name"); list()->addColumn(tr("First"), 50, Qt::AlignLeft , true, "cntct_first_name" ); list()->addColumn(tr("Last"), -1, Qt::AlignLeft , true, "cntct_last_name" ); list()->addColumn(tr("Phone"), 100, Qt::AlignLeft , true, "cntct_phone" ); list()->addColumn(tr("Email"), 100, Qt::AlignLeft , true, "cntct_email" ); list()->addColumn(tr("Address"), -1, Qt::AlignLeft , false, "addr_line1" ); list()->addColumn(tr("City"), 75, Qt::AlignLeft , false, "addr_city" ); list()->addColumn(tr("State"), 50, Qt::AlignLeft , false, "addr_state" ); list()->addColumn(tr("Country"), 100, Qt::AlignLeft , false, "addr_country" ); list()->addColumn(tr("Postal Code"), 75, Qt::AlignLeft , false, "addr_postalcode" ); connect(omfgThis, SIGNAL(vendorsUpdated()), SLOT(sFillList())); if (_privileges->check("MaintainVendors")) connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sEdit())); else { newAction()->setEnabled(FALSE); connect(list(), SIGNAL(itemSelected(int)), this, SLOT(sView())); } } void vendors::sNew() { ParameterList params; params.append("mode", "new"); vendor *newdlg = new vendor(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void vendors::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("vend_id", list()->id()); params.append("showNextPrev"); vendor *newdlg = new vendor(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void vendors::sView() { ParameterList params; params.append("mode", "view"); params.append("vend_id", list()->id()); params.append("showNextPrev"); vendor *newdlg = new vendor(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void vendors::sDelete() { if (QMessageBox::question(this, tr("Delete Vendor?"), tr("Are you sure that you want to delete this vendor?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery delq; delq.prepare("DELETE FROM vendinfo WHERE (vend_id=:vend_id);"); delq.bindValue(":vend_id", list()->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Deleting"), delq, __FILE__, __LINE__)) return; omfgThis->sVendorsUpdated(); sFillList(); } void vendors::sPopulateMenu(QMenu * pMenu, QTreeWidgetItem *, int) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit Vendor..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainVendors")); menuItem = pMenu->addAction(tr("View Vendor..."), this, SLOT(sView())); menuItem->setEnabled(_privileges->check("MaintainVendors") || _privileges->check("ViewVendors")); menuItem = pMenu->addAction(tr("Delete Vendor..."), this, SLOT(sDelete())); menuItem->setEnabled(_privileges->check("MaintainVendors")); } qt-client-4.1.0/guiclient/vendors.h000066400000000000000000000015521217451700100172310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORS_H #define VENDORS_H #include "display.h" #include class vendors : public display { Q_OBJECT public: vendors(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); public slots: virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sPopulateMenu(QMenu *, QTreeWidgetItem *, int); }; #endif // VENDORS_H qt-client-4.1.0/guiclient/verisignprocessor.cpp000066400000000000000000000020111217451700100216610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "guiclient.h" #include "verisignprocessor.h" #define DEBUG false /** @ingroup creditcards @class VerisignProcessor @todo Finish implementing this */ VerisignProcessor::VerisignProcessor() : CreditCardProcessor() { _company = "Verisign"; _defaultLivePort = 443; _defaultLiveServer = "payflow.verisign.com"; _defaultTestPort = 443; _defaultTestServer = "test-payflow.verisign.com"; } int VerisignProcessor::doTestConfiguration() { _errorMsg = errorMsg(-19).arg("Verisign"); return -19; } qt-client-4.1.0/guiclient/verisignprocessor.h000066400000000000000000000014401217451700100213330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VERISIGNPROCESSOR_H #define VERISIGNPROCESSOR_H #include #include #include #include "creditcardprocessor.h" class VerisignProcessor : public CreditCardProcessor { Q_OBJECT public: VerisignProcessor(); protected: virtual int doTestConfiguration(); private: }; #endif // VERISIGNPROCESSOR_H qt-client-4.1.0/guiclient/version.cpp000066400000000000000000000021371217451700100175710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "version.h" QString _Name = "xTuple ERP: %1 Edition"; QString _Version = "4.1.0"; QString _dbVersion = "4.1.0"; QString _Copyright = "Copyright (c) 1999-2012, OpenMFG, LLC."; #ifdef __USEALTVERSION__ #include "altVersion.cpp" #else QString _Build = "%1 %2"; #endif /*: Please translate this Version string to the base version of the application you are translating. This is a hack to embed the application version number into the translation file so the Update Manager can find the best translation file for a given version of the application. */ static QString _translationFileVersionPlaceholder = QT_TRANSLATE_NOOP("xTuple", "Version"); qt-client-4.1.0/guiclient/version.h000066400000000000000000000012471217451700100172370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTUPLE_VERSION_H__ #define __XTUPLE_VERSION_H__ #include extern QString _Name; extern QString _Version; extern QString _dbVersion; extern QString _Copyright; extern QString _Build; #endif // __XTUPLE_VERSION_H__ qt-client-4.1.0/guiclient/viewCheckRun.cpp000066400000000000000000000257211217451700100205050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "viewCheckRun.h" #include #include #include #include "miscCheck.h" #include "mqlutil.h" #include "postCheck.h" #include "postChecks.h" #include "prepareCheckRun.h" #include "printCheck.h" #include "printChecks.h" #include "storedProcErrorLookup.h" viewCheckRun::viewCheckRun(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_check, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)), this, SLOT(sHandleItemSelection())); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sFillList())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_newMiscCheck, SIGNAL(clicked()), this, SLOT(sNewMiscCheck())); connect(_prepareCheckRun,SIGNAL(clicked()), this, SLOT(sPrepareCheckRun())); connect(_replace, SIGNAL(clicked()), this, SLOT(sReplace())); connect(_replaceAll, SIGNAL(clicked()), this, SLOT(sReplaceAll())); connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sFillList())); connect(_vendorgroup, SIGNAL(updated()), this, SLOT(sHandleVendorGroup())); connect(_void, SIGNAL(clicked()), this, SLOT(sVoid())); _check->addColumn(tr("Void"), _ynColumn, Qt::AlignCenter,true, "checkhead_void"); _check->addColumn(tr("Misc."), _ynColumn, Qt::AlignCenter,true, "checkhead_misc" ); _check->addColumn(tr("Prt'd"), _ynColumn, Qt::AlignCenter,true, "checkhead_printed" ); _check->addColumn(tr("Chk./Voucher/RA #"),_itemColumn, Qt::AlignCenter,true, "number" ); _check->addColumn(tr("Recipient/Invc./CM #"), -1, Qt::AlignLeft, true, "description" ); _check->addColumn(tr("Check Date") , _dateColumn, Qt::AlignCenter,true, "checkdate" ); _check->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "amount" ); _check->addColumn(tr("Currency"), _currencyColumn, Qt::AlignLeft, true, "currAbbr" ); if (_metrics->boolean("ACHSupported") && _metrics->boolean("ACHEnabled")) _check->addColumn(tr("EFT Batch"), _orderColumn, Qt::AlignLeft, true, "checkhead_ach_batch" ); if (omfgThis->singleCurrency()) _check->hideColumn("curr_concat"); connect(omfgThis, SIGNAL(checksUpdated(int, int, bool)), this, SLOT(sFillList(int))); sFillList(); } viewCheckRun::~viewCheckRun() { // no need to delete child widgets, Qt does it all for us } void viewCheckRun::languageChange() { retranslateUi(this); } void viewCheckRun::sVoid() { XSqlQuery viewVoid; viewVoid.prepare( "SELECT checkhead_bankaccnt_id, voidCheck(checkhead_id) AS result " "FROM checkhead " "WHERE (checkhead_id=:checkhead_id);" ); viewVoid.bindValue(":checkhead_id", _check->id()); viewVoid.exec(); if (viewVoid.first()) { int result = viewVoid.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("voidCheck", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(viewVoid.value("checkhead_bankaccnt_id").toInt(), _check->id(), TRUE); } else if (viewVoid.lastError().type() != QSqlError::NoError) { systemError(this, viewVoid.lastError().databaseText(), __FILE__, __LINE__); return; } } void viewCheckRun::sDelete() { XSqlQuery viewDelete; viewDelete.prepare( "SELECT checkhead_bankaccnt_id, deleteCheck(checkhead_id) AS result " "FROM checkhead " "WHERE (checkhead_id=:checkhead_id);" ); viewDelete.bindValue(":checkhead_id", _check->id()); viewDelete.exec(); if (viewDelete.first()) { int result = viewDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteCheck", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(viewDelete.value("checkhead_bankaccnt_id").toInt(), _check->id(), TRUE); } else if (viewDelete.lastError().type() != QSqlError::NoError) { systemError(this, viewDelete.lastError().databaseText(), __FILE__, __LINE__); return; } } void viewCheckRun::sNewMiscCheck() { ParameterList params; params.append("new"); params.append("bankaccnt_id", _bankaccnt->id()); if (_vendorgroup->isSelectedVend()) params.append("vend_id", _vendorgroup->vendId()); miscCheck *newdlg = new miscCheck(this, "_miscCheck", Qt::Dialog); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void viewCheckRun::sEdit() { ParameterList params; params.append("edit"); params.append("check_id", _check->id()); miscCheck *newdlg = new miscCheck(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void viewCheckRun::sReplace() { XSqlQuery viewReplace; viewReplace.prepare( "SELECT checkhead_bankaccnt_id, replaceVoidedCheck(:check_id) AS result " "FROM checkhead " "WHERE (checkhead_id=:check_id);" ); viewReplace.bindValue(":check_id", _check->id()); viewReplace.exec(); if (viewReplace.first()) { int result = viewReplace.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("replaceVoidedCheck", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated( viewReplace.value("checkhead_bankaccnt_id").toInt(), viewReplace.value("result").toInt(), TRUE); } else if (viewReplace.lastError().type() != QSqlError::NoError) { systemError(this, viewReplace.lastError().databaseText(), __FILE__, __LINE__); return; } } void viewCheckRun::sReplaceAll() { XSqlQuery viewReplaceAll; viewReplaceAll.prepare("SELECT replaceAllVoidedChecks(:bankaccnt_id) AS result;"); viewReplaceAll.bindValue(":bankaccnt_id", _bankaccnt->id()); viewReplaceAll.exec(); if (viewReplaceAll.first()) { int result = viewReplaceAll.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("replaceAllVoidedChecks", result), __FILE__, __LINE__); return; } omfgThis->sChecksUpdated(_bankaccnt->id(), -1, TRUE); } else if (viewReplaceAll.lastError().type() != QSqlError::NoError) { systemError(this, viewReplaceAll.lastError().databaseText(), __FILE__, __LINE__); return; } } void viewCheckRun::sPrint() { ParameterList params; params.append("check_id", _check->id()); printCheck *newdlg = new printCheck(); newdlg->set(params); omfgThis->handleNewWindow(newdlg, Qt::WindowModal); } void viewCheckRun::sPost() { ParameterList params; params.append("check_id", _check->id()); postCheck newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void viewCheckRun::sHandleItemSelection() { XTreeWidgetItem *selected = _check->currentItem(); bool select = false; if (! selected) { _void->setEnabled(FALSE); _delete->setEnabled(FALSE); _replace->setEnabled(FALSE); select = true; _edit->setEnabled(FALSE); return; } if (selected->rawValue("checkhead_void").toBool()) { _void->setEnabled(FALSE); _delete->setEnabled(TRUE); _replace->setEnabled(TRUE); _edit->setEnabled(FALSE); } else if (! selected->rawValue("checkhead_void").isNull() && ! selected->rawValue("checkhead_void").toBool()) { // This was not allowing voiding of ACH checks. No strong case could be // made to disallow this since ACH is manuall at this time. Should that // requirement change this is the original line //_void->setEnabled(selected->rawValue("checkhead_ach_batch").isNull()); _void->setEnabled(true); _delete->setEnabled(FALSE); _replace->setEnabled(FALSE); select = selected->rawValue("checkhead_ach_batch").isNull(); _edit->setEnabled(selected->rawValue("checkhead_misc").toBool() && ! selected->rawValue("checkhead_printed").toBool()); } QMenu * printMenu = new QMenu; if (select) printMenu->addAction(tr("Selected Check..."), this, SLOT(sPrint())); if (_vendorgroup->isAll()) printMenu->addAction(tr("Check Run..."), this, SLOT(sPrintCheckRun())); printMenu->addAction(tr("Edit List"), this, SLOT(sPrintEditList())); _print->setMenu(printMenu); QMenu * postMenu = new QMenu; if (selected->rawValue("checkhead_printed").toBool() && _privileges->check("PostPayments")) postMenu->addAction(tr("Selected Check..."), this, SLOT(sPost())); if (_vendorgroup->isAll()) postMenu->addAction(tr("All Checks..."), this, SLOT(sPostChecks())); _postCheck->setMenu(postMenu); } void viewCheckRun::sFillList(int pBankaccntid) { XSqlQuery viewFillList; if (pBankaccntid == _bankaccnt->id()) sFillList(); } void viewCheckRun::sFillList() { XSqlQuery viewFillList; QMenu * printMenu = new QMenu; if (_vendorgroup->isAll()) printMenu->addAction(tr("Check Run..."), this, SLOT(sPrintCheckRun())); printMenu->addAction(tr("Edit List"), this, SLOT(sPrintEditList())); _print->setMenu(printMenu); QMenu * postMenu = new QMenu; if (_vendorgroup->isAll()) postMenu->addAction(tr("Post All..."), this, SLOT(sPostChecks())); _postCheck->setMenu(postMenu); MetaSQLQuery mql = mqlLoad("checkRegister", "detail"); ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); params.append("showTotal"); params.append("newOnly"); params.append("showDetail"); _vendorgroup->appendValue(params); viewFillList = mql.toQuery(params); _check->populate(viewFillList); if (viewFillList.lastError().type() != QSqlError::NoError) { systemError(this, viewFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void viewCheckRun::sPrintEditList() { ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); _vendorgroup->appendValue(params); orReport report("ViewAPCheckRunEditList", params); if (report.isValid()) report.print(); else report.reportError(this); } void viewCheckRun::sPrintCheckRun() { ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); printChecks newdlg(this, "", TRUE); newdlg.set(params); newdlg.setWindowModality(Qt::WindowModal); newdlg.exec(); } void viewCheckRun::sPostChecks() { ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); postChecks newdlg(this, "", TRUE); newdlg.set(params); newdlg.setWindowModality(Qt::WindowModal); newdlg.exec(); } void viewCheckRun::sHandleVendorGroup() { _replaceAll->setEnabled(_vendorgroup->isAll()); } void viewCheckRun::sPrepareCheckRun() { ParameterList params; params.append("bankaccnt_id", _bankaccnt->id()); prepareCheckRun newdlg(this, "", true); newdlg.set(params); newdlg.exec(); } qt-client-4.1.0/guiclient/viewCheckRun.h000066400000000000000000000025571217451700100201540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VIEWCHECKRUN_H #define VIEWCHECKRUN_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_viewCheckRun.h" class viewCheckRun : public XWidget, public Ui::viewCheckRun { Q_OBJECT public: viewCheckRun(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~viewCheckRun(); public slots: virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sFillList(int); virtual void sHandleItemSelection(); virtual void sNewMiscCheck(); virtual void sPost(); virtual void sPostChecks(); virtual void sPrepareCheckRun(); virtual void sPrint(); virtual void sPrintCheckRun(); virtual void sPrintEditList(); virtual void sReplace(); virtual void sReplaceAll(); virtual void sVoid(); protected slots: virtual void languageChange(); virtual void sHandleVendorGroup(); }; #endif // VIEWCHECKRUN_H qt-client-4.1.0/guiclient/viewCheckRun.ui000066400000000000000000000306141217451700100203350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. viewCheckRun 0 0 800 600 View Check Run 12 12 Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 XComboBox::APBankAccounts Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Expanding 10 0 Qt::Horizontal QSizePolicy::Expanding 13 20 0 &Close Qt::Vertical QSizePolicy::Expanding 20 0 Prepare... 0 1 QFrame::NoFrame QFrame::Raised 0 0 Checks: 0 0 1 true Pri&nt true Po&st Qt::Vertical QSizePolicy::Fixed 20 10 New false &Void false Edit false Delete false Replace Qt::Vertical QSizePolicy::Fixed 20 10 true Replace All Qt::Vertical QSizePolicy::Expanding 20 10 VendorGroup QWidget
    vendorgroup.h
    XComboBox QComboBox
    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _check _print _postCheck _newMiscCheck _void _edit _delete _replace _replaceAll _close _close clicked() viewCheckRun close() 673 34 20 20 _check itemSelected(int) _edit animateClick() 33 182 689 332
    qt-client-4.1.0/guiclient/voidChecks.cpp000066400000000000000000000071211217451700100201640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "voidChecks.h" #include #include #include #include #include #include "guiclient.h" #include "storedProcErrorLookup.h" voidChecks::voidChecks(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_bankaccnt, SIGNAL(newID(int)), this, SLOT(sHandleBankAccount(int))); connect(_void, SIGNAL(clicked()), this, SLOT(sVoid())); _bankaccnt->setType(XComboBox::APBankAccounts); _numberOfChecks->setPrecision(0); } voidChecks::~voidChecks() { // no need to delete child widgets, Qt does it all for us } void voidChecks::languageChange() { retranslateUi(this); } void voidChecks::sVoid() { XSqlQuery voidVoid; voidVoid.prepare("SELECT checkhead_id, checkhead_number," " voidCheck(checkhead_id) AS result" " FROM checkhead" " WHERE ((NOT checkhead_posted)" " AND (NOT checkhead_replaced)" " AND (NOT checkhead_deleted)" " AND (NOT checkhead_void)" " AND (checkhead_bankaccnt_id=:bankaccnt_id))"); voidVoid.bindValue(":bankaccnt_id", _bankaccnt->id()); voidVoid.exec(); while (voidVoid.next()) { int result = voidVoid.value("result").toInt(); if (result < 0) systemError(this, tr("Check %1").arg(voidVoid.value("checkhead_number").toString()) + "\n" + storedProcErrorLookup("voidCheck", result), __FILE__, __LINE__); else if(_issueReplacements->isChecked()) { XSqlQuery rplc; rplc.prepare("SELECT replaceVoidedCheck(:checkhead_id) AS result;"); while(voidVoid.next()) { rplc.bindValue(":checkhead_id", voidVoid.value("checkhead_id").toInt()); rplc.exec(); } } omfgThis->sChecksUpdated(_bankaccnt->id(), -1, TRUE); } if (voidVoid.lastError().type() != QSqlError::NoError) { systemError(this, voidVoid.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void voidChecks::sHandleBankAccount(int pBankaccntid) { XSqlQuery voidHandleBankAccount; if (pBankaccntid == -1) { _checkNumber->clear(); _numberOfChecks->clear(); } else { voidHandleBankAccount.prepare( "SELECT TEXT(MIN(checkhead_number)) as checknumber," " TEXT(COUNT(*)) AS numofchecks " " FROM checkhead " " WHERE ( (NOT checkhead_void)" " AND (NOT checkhead_posted)" " AND (NOT checkhead_replaced)" " AND (NOT checkhead_deleted)" " AND (checkhead_bankaccnt_id=:bankaccnt_id) );" ); voidHandleBankAccount.bindValue(":bankaccnt_id", pBankaccntid); voidHandleBankAccount.exec(); if (voidHandleBankAccount.first()) { _checkNumber->setText(voidHandleBankAccount.value("checknumber").toString()); _numberOfChecks->setText(voidHandleBankAccount.value("numofchecks").toString()); } else if (voidHandleBankAccount.lastError().type() != QSqlError::NoError) { systemError(this, voidHandleBankAccount.lastError().databaseText(), __FILE__, __LINE__); return; } } } qt-client-4.1.0/guiclient/voidChecks.h000066400000000000000000000016211217451700100176300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VOIDCHECKS_H #define VOIDCHECKS_H #include "xdialog.h" #include "ui_voidChecks.h" class voidChecks : public XDialog, public Ui::voidChecks { Q_OBJECT public: voidChecks(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~voidChecks(); public slots: virtual void sVoid(); virtual void sHandleBankAccount( int pBankaccntid ); protected slots: virtual void languageChange(); }; #endif // VOIDCHECKS_H qt-client-4.1.0/guiclient/voidChecks.ui000066400000000000000000000221071217451700100200200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. voidChecks 0 0 512 111 Void Checks 7 5 5 5 5 0 5 5 Bank Account: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 true 5 0 First Check #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter # of Checks to Void: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 188 16 0 Qt::Vertical QSizePolicy::Expanding 20 16 Issue Replacement Checks Qt::Vertical QSizePolicy::Expanding 117 16 Qt::Vertical QSizePolicy::Expanding 16 16 0 5 &Cancel &Void true true Qt::Vertical QSizePolicy::Expanding 10 31 XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    _bankaccnt _issueReplacements _void _close _close clicked() voidChecks reject() 20 20 20 20
    qt-client-4.1.0/guiclient/voucher.cpp000066400000000000000000001076401217451700100175640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ // TODO: create parent class that's inherited by both voucher and miscvoucher #include "voucher.h" #include #include #include #include #include #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "purchaseOrderList.h" #include "purchaseOrderItem.h" #include "storedProcErrorLookup.h" #include "voucherItem.h" #include "voucherMiscDistrib.h" voucher::voucher(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_distributions, SIGNAL(clicked()), this, SLOT(sDistributions())); connect(_distributeline, SIGNAL(clicked()), this, SLOT(sDistributeLine())); connect(_clear, SIGNAL(clicked()), this, SLOT(sClear())); connect(_distributeall, SIGNAL(clicked()), this, SLOT(sDistributeAll())); connect(_voucherNumber, SIGNAL(editingFinished()), this, SLOT(sHandleVoucherNumber())); connect(_poNumber, SIGNAL(newId(int, const QString&)), this, SLOT(sFillList())); connect(_poNumber, SIGNAL(newId(int, const QString&)), this, SLOT(sPopulatePoInfo())); connect(_amountToDistribute, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue())); connect(_new, SIGNAL(clicked()), this, SLOT(sNewMiscDistribution())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEditMiscDistribution())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDeleteMiscDistribution())); connect(_invoiceDate, SIGNAL(newDate(const QDate&)), this, SLOT(sPopulateDistDate())); connect(_terms, SIGNAL(newID(int)), this, SLOT(sPopulateDueDate())); connect(_poitem, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_amountToDistribute, SIGNAL(idChanged(int)), this, SLOT(sFillList())); connect(_amountDistributed, SIGNAL(valueChanged()), this, SLOT(sPopulateBalanceDue())); _terms->setType(XComboBox::APTerms); _poNumber->setAllowedStatuses(OrderLineEdit::Open); _poNumber->setAllowedTypes(OrderLineEdit::Purchase); _poNumber->setLabel(""); _poNumber->findChild("_name")->hide(); _poNumber->findChild("_description")->hide(); _poNumber->findChild("_fromLit")->hide(); _poNumber->findChild("_from")->hide(); _poNumber->findChild("_toLit")->hide(); _poNumber->findChild("_to")->hide(); _poNumber->setMinimumHeight(32); _poitem->addColumn(tr("#"), _whsColumn, Qt::AlignCenter, true, "poitem_linenumber" ); _poitem->addColumn(tr("Status"), _uomColumn, Qt::AlignCenter, true, "poitemstatus" ); _poitem->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "itemnumber" ); _poitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "uom" ); _poitem->addColumn(tr("Vend. Item #"), -1, Qt::AlignLeft, true, "poitem_vend_item_number" ); _poitem->addColumn(tr("UOM"), _uomColumn, Qt::AlignCenter, true, "poitem_vend_uom" ); _poitem->addColumn(tr("Ordered"), _qtyColumn, Qt::AlignRight, true, "poitem_qty_ordered" ); _poitem->addColumn(tr("Invoiced"), _qtyColumn, Qt::AlignRight, false, "qtyinvoiced" ); _poitem->addColumn(tr("Uninvoiced"), _qtyColumn, Qt::AlignRight, true, "qtyreceived" ); _poitem->addColumn(tr("Rejected"), _qtyColumn, Qt::AlignRight, true, "qtyrejected" ); _poitem->addColumn(tr("Quantity"), _qtyColumn, Qt::AlignRight, false, "invoiceqty" ); _poitem->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "invoiceamount" ); _poitem->addColumn(tr("PO Unit Price"), _moneyColumn, Qt::AlignRight, true, "poitem_unitprice" ); _poitem->addColumn(tr("PO Ext Price"), _moneyColumn, Qt::AlignRight, true, "extprice" ); _poitem->addColumn(tr("PO Line Freight"), _moneyColumn, Qt::AlignRight, true, "poitem_freight" ); _miscDistrib->addColumn(tr("Account"), -1, Qt::AlignLeft, true, "account" ); _miscDistrib->addColumn(tr("Amount"), _moneyColumn, Qt::AlignRight, true, "vodist_amount" ); _vendid = -1; setWindowModified(false); } voucher::~voucher() { // no need to delete child widgets, Qt does it all for us } void voucher::languageChange() { retranslateUi(this); } enum SetResponse voucher::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; if (_metrics->value("VoucherNumberGeneration") == "A") populateNumber(); XSqlQuery insq; insq.prepare("INSERT INTO vohead (vohead_number, vohead_posted)" " VALUES (:vohead_number, false)" " RETURNING vohead_id;" ); insq.bindValue(":vohead_number", _voucherNumber->text()); insq.exec(); if (insq.first()) _voheadid = insq.value("vohead_id").toInt(); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Inserting Voucher"), insq, __FILE__, __LINE__)) return UndefinedError; enableWindowModifiedSetting(); } else if (param.toString() == "edit") { _mode = cEdit; _voucherNumber->setEnabled(FALSE); _poNumber->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _poNumber->setAllowedStatuses(OrderLineEdit::AnyStatus); _voucherNumber->setEnabled(FALSE); _poNumber->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _amountToDistribute->setEnabled(FALSE); _distributionDate->setEnabled(FALSE); _invoiceDate->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _invoiceNum->setEnabled(FALSE); _reference->setEnabled(FALSE); _distributions->setEnabled(FALSE); _miscDistrib->setEnabled(FALSE); _new->setEnabled(FALSE); _terms->setEnabled(FALSE); _terms->setType(XComboBox::Terms); _flagFor1099->setEnabled(FALSE); _distributeall->setEnabled(FALSE); _notes->setEnabled(false); _close->setText(tr("&Close")); _save->hide(); disconnect(_poitem, SIGNAL(valid(bool)), _distributions, SLOT(setEnabled(bool))); disconnect(_poitem, SIGNAL(valid(bool)), _distributeline, SLOT(setEnabled(bool))); disconnect(_poitem, SIGNAL(valid(bool)), _clear, SLOT(setEnabled(bool))); disconnect(_poNumber, SIGNAL(valid(bool)), _distributeall, SLOT(setEnabled(bool))); } } param = pParams.value("pohead_id", &valid); if (valid) _poNumber->setId(param.toInt(), "PO"); param = pParams.value("vohead_id", &valid); if (valid) { _voheadid = param.toInt(); populate(); enableWindowModifiedSetting(); } return NoError; } bool voucher::sSave() { QList errors; errors << GuiErrorCheck(! _poNumber->isValid(), _poNumber, tr("

    You must enter an PO Number before you may " "save this Voucher.")) << GuiErrorCheck(!_invoiceDate->isValid(), _invoiceDate, tr("

    You must enter an Invoice Date before you " "may save this Voucher.")) << GuiErrorCheck(!_dueDate->isValid(), _dueDate, tr("

    You must enter a Due Date before you may " "save this Voucher.")) << GuiErrorCheck(!_distributionDate->isValid(), _distributionDate, tr("

    You must enter a Distribution Date before " "you may save this Voucher.")) << GuiErrorCheck(_metrics->boolean("ReqInvRegVoucher") && _invoiceNum->text().trimmed().isEmpty(), _invoiceNum, tr("

    You must enter a Vendor Invoice Number " "before you may save this Voucher.")) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Voucher"), errors)) return false; if (_invoiceNum->text().trimmed().length() > 0) { XSqlQuery dupq; dupq.prepare( "SELECT vohead_id " "FROM vohead, pohead " "WHERE ( (vohead_pohead_id=pohead_id)" " AND (vohead_invcnumber=:vohead_invcnumber)" " AND (pohead_vend_id=:vend_id)" " AND (vohead_id<>:vohead_id) );" ); dupq.bindValue(":vohead_invcnumber", _invoiceNum->text().trimmed()); dupq.bindValue(":vend_id", _vendid); dupq.bindValue(":vohead_id", _voheadid); dupq.exec(); if (dupq.first()) { if (QMessageBox::question( this, windowTitle(), tr("

    A Voucher for this Vendor has already been " "entered with the same Vendor Invoice Number. " "Are you sure you want to use this number again?" ), QMessageBox::No | QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) return false; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Reused Invoice Check"), dupq, __FILE__, __LINE__)) return false; } XSqlQuery updq; updq.prepare( "UPDATE vohead " "SET vohead_pohead_id=:vohead_pohead_id," " vohead_taxzone_id=:vohead_taxzone_id, " " vohead_vend_id=:vohead_vend_id," " vohead_terms_id=:vohead_terms_id," " vohead_distdate=:vohead_distdate," " vohead_docdate=:vohead_docdate," " vohead_duedate=:vohead_duedate," " vohead_invcnumber=:vohead_invcnumber," " vohead_reference=:vohead_reference," " vohead_amount=:vohead_amount," " vohead_1099=:vohead_1099, " " vohead_curr_id=:vohead_curr_id, " " vohead_notes=:vohead_notes " "WHERE (vohead_id=:vohead_id);" ); updq.bindValue(":vohead_id", _voheadid); updq.bindValue(":vohead_pohead_id", _poNumber->id()); if (_taxzone->isValid()) updq.bindValue(":vohead_taxzone_id", _taxzone->id()); updq.bindValue(":vohead_vend_id", _vendid); updq.bindValue(":vohead_terms_id", _terms->id()); updq.bindValue(":vohead_distdate", _distributionDate->date()); updq.bindValue(":vohead_docdate", _invoiceDate->date()); updq.bindValue(":vohead_duedate", _dueDate->date()); updq.bindValue(":vohead_invcnumber", _invoiceNum->text().trimmed()); updq.bindValue(":vohead_reference", _reference->text().trimmed()); updq.bindValue(":vohead_amount", _amountToDistribute->localValue()); updq.bindValue(":vohead_1099", QVariant(_flagFor1099->isChecked())); updq.bindValue(":vohead_curr_id", _amountToDistribute->id()); updq.bindValue(":vohead_notes", _notes->toPlainText()); updq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Saving Voucher"), updq, __FILE__, __LINE__)) return false; omfgThis->sVouchersUpdated(); _voheadid = -1; if (cNew != _mode) { setWindowModified(false); close(); return true; } _poNumber->setEnabled(true); _poNumber->setId(-1); _amountToDistribute->clear(); _amountDistributed->clear(); _balance->clear(); _flagFor1099->setChecked(false); _invoiceDate->setNull(); _distributionDate->setNull(); _dueDate->setNull(); _invoiceNum->clear(); _reference->clear(); _poitem->clear(); _miscDistrib->clear(); _notes->setText(""); setWindowModified(false); ParameterList params; params.append("mode", "new"); set(params); return true; } void voucher::sHandleVoucherNumber() { if (_voucherNumber->text().length() == 0) { if ((_metrics->value("VoucherNumberGeneration") == "A") || (_metrics->value("VoucherNumberGeneration") == "O")) populateNumber(); else { QMessageBox::critical( this, tr("Enter Voucher Number"), tr("

    You must enter a valid Voucher Number " "before continuing") ); _voucherNumber->setFocus(); return; } } else { XSqlQuery editq; editq.prepare( "SELECT vohead_id " "FROM vohead " "WHERE (vohead_number=:vohead_number);" ); editq.bindValue(":vohead_number", _voucherNumber->text()); editq.exec(); if (editq.first()) { _voheadid = editq.value("vohead_id").toInt(); _voucherNumber->setEnabled(FALSE); _poNumber->setEnabled(FALSE); _mode = cEdit; populate(); return; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Looking for Existing Voucher"), editq, __FILE__, __LINE__)) return; } } void voucher::sPopulate() { setWindowTitle(tr("Voucher for P/O # %1").arg(_poNumber->number())); } void voucher::sDistributions() { saveDetail(); foreach (XTreeWidgetItem *item, _poitem->selectedItems()) { ParameterList params; params.append("mode", "new"); params.append("vohead_id", _voheadid); params.append("poitem_id", item->id()); params.append("curr_id", _amountToDistribute->id()); params.append("effective", _amountToDistribute->effective()); voucherItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() == XDialog::Rejected) { // nothing to do: // voucherItem wraps itself in a transaction and rolls back on reject } else _poNumber->setEnabled(FALSE); } sFillList(); sPopulateDistributed(); } void voucher::sDistributeLine() { saveDetail(); foreach (XTreeWidgetItem *item, _poitem->selectedItems()) { XSqlQuery distq; distq.prepare("SELECT distributeVoucherLine(:vohead_id,:poitem_id,:curr_id) " "AS result;"); distq.bindValue(":vohead_id", _voheadid); distq.bindValue(":poitem_id", item->id()); distq.bindValue(":curr_id", _amountToDistribute->id()); distq.exec(); if (distq.first()) { int result = distq.value("result").toInt(); if (result < 0) ErrorReporter::error(QtCriticalMsg, this, tr("Error Distributing"), storedProcErrorLookup("distributeVoucherLine", result), __FILE__, __LINE__); else { _poNumber->setEnabled(FALSE); } } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Distributing Line"), distq, __FILE__, __LINE__)) return; } sFillList(); sPopulateDistributed(); } void voucher::sClear() { XSqlQuery clearq; // TODO: split these or write a function clearq.prepare("DELETE FROM vodist " " WHERE ((vodist_poitem_id=:poitem_id) " " AND (vodist_vohead_id=:vohead_id)); " " UPDATE recv SET recv_vohead_id=NULL, recv_voitem_id=NULL " " WHERE ((recv_vohead_id=:vohead_id) " " AND (recv_order_type='PO') " " AND (recv_orderitem_id=:poitem_id)); " " DELETE FROM voitem " " WHERE ((voitem_poitem_id=:poitem_id) " " AND (voitem_vohead_id=:vohead_id)); " " UPDATE poreject SET poreject_vohead_id=NULL, poreject_voitem_id=NULL " " WHERE ((poreject_vohead_id=:vohead_id) " " AND (poreject_poitem_id=:poitem_id)); "); foreach (XTreeWidgetItem *item, _poitem->selectedItems()) { clearq.bindValue(":vohead_id", _voheadid); clearq.bindValue(":poitem_id", item->id()); clearq.exec(); // no return - do what we can ErrorReporter::error(QtCriticalMsg, this, tr("Clearing Distributions"), clearq, __FILE__, __LINE__); } _poNumber->setEnabled(true); sFillList(); sPopulateDistributed(); } void voucher::sDistributeAll() { saveDetail(); _poitem->selectAll(); XSqlQuery distq; distq.prepare("SELECT distributeVoucherLine(:vohead_id,:poitem_id,:curr_id) " "AS result;"); foreach (XTreeWidgetItem *item, _poitem->selectedItems()) { distq.bindValue(":vohead_id", _voheadid); distq.bindValue(":poitem_id", item->id()); distq.bindValue(":curr_id", _amountToDistribute->id()); distq.exec(); if (distq.first()) { int result = distq.value("result").toInt(); if (result < 0) ErrorReporter::error(QtCriticalMsg, this, tr("Error Distributing"), storedProcErrorLookup("distributeVoucherLine", result), __FILE__, __LINE__); else _poNumber->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Distributing"), distq, __FILE__, __LINE__)) return; } sFillList(); sPopulateDistributed(); } void voucher::sNewMiscDistribution() { saveDetail(); ParameterList params; params.append("mode", "new"); params.append("vohead_id", _voheadid); params.append("curr_id", _amountToDistribute->id()); params.append("curr_effective", _amountToDistribute->effective()); params.append("amount", _balance->localValue()); if (_taxzone->isValid()) params.append("taxzone_id", _taxzone->id()); voucherMiscDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillMiscList(); sPopulateDistributed(); } } void voucher::sEditMiscDistribution() { saveDetail(); ParameterList params; params.append("mode", "edit"); params.append("vohead_id", _voheadid); params.append("vodist_id", _miscDistrib->id()); params.append("curr_id", _amountToDistribute->id()); params.append("curr_effective", _amountToDistribute->effective()); if (_taxzone->isValid()) params.append("taxzone_id", _taxzone->id()); voucherMiscDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { sFillMiscList(); sPopulateDistributed(); } } void voucher::sDeleteMiscDistribution() { saveDetail(); XSqlQuery delq; // TODO: split or write a function delq.prepare("DELETE FROM voheadtax" " WHERE (taxhist_parent_id=:vohead_id)" " AND (taxhist_taxtype_id=getadjustmenttaxtypeid())" " AND (taxhist_tax_id = (SELECT vodist_tax_id" " FROM vodist" " WHERE (vodist_id=:vodist_id)));" "DELETE FROM vodist" " WHERE (vodist_id=:vodist_id);"); delq.bindValue(":vohead_id", _voheadid); delq.bindValue(":vodist_id", _miscDistrib->id()); delq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Distributions"), delq, __FILE__, __LINE__)) return; sFillMiscList(); sPopulateDistributed(); } void voucher::sFillList() { if (_poNumber->isValid()) { XSqlQuery getq; getq.prepare( "SELECT poitem_id, poitem_linenumber," " CASE WHEN(poitem_status='C') THEN :closed" " WHEN(poitem_status='U') THEN :unposted" " WHEN(poitem_status='O' AND ((poitem_qty_received-poitem_qty_returned) > 0) AND (poitem_qty_ordered>(poitem_qty_received-poitem_qty_returned))) THEN :partial" " WHEN(poitem_status='O' AND ((poitem_qty_received-poitem_qty_returned) > 0) AND (poitem_qty_ordered<=(poitem_qty_received-poitem_qty_returned))) THEN :received" " WHEN(poitem_status='O') THEN :open" " ELSE poitem_status" " END AS poitemstatus," " COALESCE(item_number, poitem_vend_item_number) AS itemnumber," " COALESCE(uom_name, poitem_vend_uom) AS uom," " poitem_vend_item_number, poitem_vend_uom," " poitem_qty_ordered," " ( SELECT COALESCE(SUM(recv_qty), 0)" " FROM recv" " WHERE ( (recv_posted)" " AND (recv_invoiced)" " AND (recv_orderitem_id=poitem_id) ) ) AS qtyinvoiced," " ( SELECT COALESCE(SUM(recv_qty), 0)" " FROM recv" " WHERE ( (recv_posted)" " AND (NOT recv_invoiced)" " AND (recv_vohead_id IS NULL)" " AND (recv_orderitem_id=poitem_id) ) ) AS qtyreceived," " ( SELECT COALESCE(SUM(poreject_qty), 0)" " FROM poreject" " WHERE ( (poreject_posted)" " AND (NOT poreject_invoiced)" " AND (poreject_vohead_id IS NULL)" " AND (poreject_poitem_id=poitem_id) ) ) AS qtyrejected," " ( SELECT COALESCE(SUM(vodist_qty), 0)" " FROM vodist" " WHERE vodist_poitem_id=poitem_id" " AND vodist_vohead_id=:vohead_id ) AS invoiceqty, " " ( SELECT COALESCE(SUM(vodist_amount), 0)" " FROM vodist" " WHERE vodist_poitem_id=poitem_id" " AND vodist_vohead_id=:vohead_id ) " " + ( SELECT COALESCE(SUM(COALESCE(voitem_freight,0)), 0)" " FROM voitem" " WHERE voitem_poitem_id=poitem_id" " AND voitem_vohead_id=:vohead_id ) AS invoiceamount," " poitem_unitprice," " (poitem_unitprice * poitem_qty_ordered) AS extprice," " poitem_freight," " 'qty' AS poitem_qty_ordered_xtnumericrole," " 'qty' AS qtyinvoiced_xtnumericrole," " 'qty' AS qtyreceived_xtnumericrole," " 'qty' AS qtyrejected_xtnumericrole," " 'qty' AS invoiceqty_xtnumericrole," " 'curr' AS invoiceamount_xtnumericrole," " 'curr' AS poitem_unitprice_xtnumericrole," " 'curr' AS extprice_xtnumericrole," " 'curr' AS poitem_freight_xtnumericrole " "FROM poitem JOIN pohead ON (pohead_id=poitem_pohead_id)" " LEFT OUTER JOIN ( itemsite JOIN item ON (itemsite_item_id=item_id)" " JOIN uom ON (item_inv_uom_id=uom_id) )" " ON (poitem_itemsite_id=itemsite_id) " "WHERE (poitem_pohead_id=:pohead_id) " "GROUP BY poitem_id, poitem_linenumber, poitem_status," " item_number, uom_name," " poitem_vend_item_number, poitem_vend_uom," " poitem_unitprice, poitem_freight," " poitem_qty_ordered, poitem_qty_received, poitem_qty_returned," " itemsite_id, pohead_curr_id " "ORDER BY poitem_linenumber;" ); getq.bindValue(":vohead_id", _voheadid); getq.bindValue(":pohead_id", _poNumber->id()); getq.bindValue(":closed", tr("Closed")); getq.bindValue(":unposted", tr("Unposted")); getq.bindValue(":partial", tr("Partial")); getq.bindValue(":received", tr("Received")); getq.bindValue(":open", tr("Open")); getq.exec(); _poitem->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting P/O Information"), getq, __FILE__, __LINE__)) return; } else _poitem->clear(); } void voucher::sFillMiscList() { if (_poNumber->isValid()) { XSqlQuery getq; getq.prepare( "SELECT vodist_id, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account," " vodist_amount, 'curr' AS vodist_amount_xtnumericrole " "FROM vodist, accnt " "WHERE ( (vodist_poitem_id=-1)" " AND (vodist_accnt_id=accnt_id)" " AND (vodist_vohead_id=:vohead_id) ) " "UNION ALL " "SELECT vodist_id, (expcat_code || ' - ' || expcat_descrip) AS account," " vodist_amount, 'curr' AS vodist_amount_xtnumericrole " " FROM vodist, expcat " " WHERE ( (vodist_poitem_id=-1)" " AND (vodist_expcat_id=expcat_id)" " AND (vodist_vohead_id=:vohead_id) ) " "UNION ALL " "SELECT vodist_id, (tax_code || ' - ' || tax_descrip) AS account," " vodist_amount, 'curr' AS vodist_amount_xtnumericrole " " FROM vodist, tax " " WHERE ( (vodist_poitem_id=-1)" " AND (vodist_tax_id=tax_id)" " AND (vodist_vohead_id=:vohead_id) ) " "ORDER BY account;" ); getq.bindValue(":vohead_id", _voheadid); getq.exec(); _miscDistrib->populate(getq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Misc. Distributions"), getq, __FILE__, __LINE__)) return; } } void voucher::sPopulatePoInfo() { XSqlQuery po; po.prepare("SELECT pohead_terms_id, pohead_taxzone_id, vend_1099, " " pohead_curr_id, vend_id, vend_number, vend_name," " addr_line1, addr_line2" " FROM pohead" " JOIN vendinfo ON (pohead_vend_id=vend_id)" " LEFT OUTER JOIN addr ON (vend_addr_id=addr_id)" " WHERE (pohead_id=:pohead_id);" ); po.bindValue(":pohead_id", _poNumber->id()); po.exec(); if (po.first()) { bool gets1099 = po.value("vend_1099").toBool(); _flagFor1099->setChecked(gets1099); _terms->setId(po.value("pohead_terms_id").toInt()); _taxzone->setId(po.value("pohead_taxzone_id").toInt()); _amountToDistribute->setId(po.value("pohead_curr_id").toInt()); _vendid = po.value("vend_id").toInt(); _vendor->setText(po.value("vend_number").toString()); _vendName->setText(po.value("vend_name").toString()); // TODO: replace with a compact AddressCluster when such exists _vendAddress1->setText(po.value("addr_line1").toString()); _vendAddress2->setText(po.value("addr_line2").toString()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting P/O Information"), po, __FILE__, __LINE__)) return; } void voucher::sPopulateDistributed() { if (_poNumber->isValid()) { XSqlQuery getq; getq.prepare( "SELECT (COALESCE(dist,0) + COALESCE(freight,0) + COALESCE(tax,0)) AS distrib" " FROM (SELECT SUM(COALESCE(voitem_freight,0)) AS freight" " FROM voitem" " WHERE (voitem_vohead_id=:vohead_id)) AS data1, " " (SELECT SUM(COALESCE(vodist_amount, 0)) AS dist" " FROM vodist" " WHERE ( (vodist_vohead_id=:vohead_id)" " AND (vodist_tax_id=-1) )) AS data2, " " (SELECT SUM(tax * -1.0) AS tax " " FROM (" " SELECT ROUND(SUM(taxdetail_tax),2) AS tax " " FROM tax " " JOIN calculateTaxDetailSummary('VO', :vohead_id, 'T') ON (taxdetail_tax_id=tax_id)" " GROUP BY tax_id) AS taxdata) AS data3;" ); getq.bindValue(":vohead_id", _voheadid); getq.exec(); if (getq.first()) { _amountDistributed->setLocalValue(getq.value("distrib").toDouble()); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Distributions"), getq, __FILE__, __LINE__)) return; } } void voucher::sPopulateBalanceDue() { _balance->setLocalValue(_amountToDistribute->localValue() - _amountDistributed->localValue()); if (_balance->isZero()) _balance->setPaletteForegroundColor(QColor("black")); else _balance->setPaletteForegroundColor(namedColor("error")); } void voucher::populateNumber() { XSqlQuery getq; getq.exec("SELECT fetchVoNumber() AS vouchernumber;"); if (getq.first()) { _voucherNumber->setText(getq.value("vouchernumber").toString()); _voucherNumber->setEnabled(FALSE); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting ID"), getq, __FILE__, __LINE__)) return; } void voucher::populate() { XSqlQuery vohead; vohead.prepare( "SELECT vohead_number, vohead_pohead_id, vohead_taxzone_id, vohead_terms_id," " vohead_distdate, vohead_docdate, vohead_duedate," " vohead_invcnumber, vohead_reference," " vohead_1099, vohead_amount, vohead_curr_id, vohead_notes " "FROM vohead " "WHERE (vohead_id=:vohead_id);" ); vohead.bindValue(":vohead_id", _voheadid); vohead.exec(); if (vohead.first()) { _voucherNumber->setText(vohead.value("vohead_number").toString()); _poNumber->setId(vohead.value("vohead_pohead_id").toInt(), "PO"); _taxzone->setId(vohead.value("vohead_taxzone_id").toInt()); _terms->setId(vohead.value("vohead_terms_id").toInt()); _amountToDistribute->set(vohead.value("vohead_amount").toDouble(), vohead.value("vohead_curr_id").toInt(), vohead.value("vohead_docdate").toDate(), false); _distributionDate->setDate(vohead.value("vohead_distdate").toDate(), true); _invoiceDate->setDate(vohead.value("vohead_docdate").toDate()); _dueDate->setDate(vohead.value("vohead_duedate").toDate()); _invoiceNum->setText(vohead.value("vohead_invcnumber").toString()); _reference->setText(vohead.value("vohead_reference").toString()); _flagFor1099->setChecked(vohead.value("vohead_1099").toBool()); _notes->setText(vohead.value("vohead_notes").toString()); sFillList(); sFillMiscList(); sPopulateDistributed(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Voucher"), vohead, __FILE__, __LINE__)) return; } void voucher::clear() { } void voucher::closeEvent(QCloseEvent *pEvent) { if (isWindowModified()) { QMessageBox::StandardButtons buttons = omfgThis->shuttingDown() ? QMessageBox::Yes | QMessageBox::No : QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel; switch (QMessageBox::question(this, tr("Save Voucher?"), tr("Do you want to save this voucher?"), buttons, QMessageBox::Yes)) { case QMessageBox::Yes: if (! sSave() && ! omfgThis->shuttingDown()) pEvent->ignore(); else if (_mode == cNew) break; // so we can clean up return; case QMessageBox::Cancel: pEvent->ignore(); return; default: break; } } if (_mode == cNew) { XSqlQuery delq; delq.prepare("DELETE FROM vohead WHERE (vohead_id=:vohead_id);" "SELECT releaseVoNumber(:number);"); delq.bindValue(":vohead_id", _voheadid); delq.bindValue(":number", _voucherNumber->text().toInt()); delq.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Deleting Placeholder"), delq, __FILE__, __LINE__); } pEvent->accept(); } void voucher::sPopulateDistDate() { if ( (_invoiceDate->isValid()) && (!_distributionDate->isValid()) ) { _distributionDate->setDate(_invoiceDate->date(), true); } sPopulateDueDate(); } void voucher::sPopulateDueDate() { if ( (_invoiceDate->isValid()) && (!_dueDate->isValid()) ) { XSqlQuery dateq; dateq.prepare("SELECT determineDueDate(:terms_id, :invoiceDate) AS duedate;"); dateq.bindValue(":terms_id", _terms->id()); dateq.bindValue(":invoiceDate", _invoiceDate->date()); dateq.exec(); if (dateq.first()) _dueDate->setDate(dateq.value("duedate").toDate()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Getting Due Date"), dateq, __FILE__, __LINE__)) return; } } void voucher::sPopulateMenu( QMenu * pMenu ) { pMenu->addAction(tr("View P/O Item..."), this, SLOT(sView())); } void voucher::sView() { if(_poitem->id() == -1) return; ParameterList params; params.append("poitem_id", _poitem->id()); params.append("mode", "view"); purchaseOrderItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void voucher::keyPressEvent( QKeyEvent * e ) { if(e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { _save->animateClick(); e->accept(); } else e->ignore(); } void voucher::saveDetail() { if (_mode != cView) { XSqlQuery updq; updq.prepare( "UPDATE vohead " "SET vohead_pohead_id=:vohead_pohead_id," " vohead_taxzone_id=:vohead_taxzone_id, " " vohead_vend_id=:vohead_vend_id," " vohead_terms_id=:vohead_terms_id," " vohead_distdate=COALESCE(:vohead_distdate, CURRENT_DATE)," " vohead_docdate=COALESCE(:vohead_docdate, CURRENT_DATE)," " vohead_duedate=COALESCE(:vohead_duedate, CURRENT_DATE)," " vohead_invcnumber=:vohead_invcnumber," " vohead_reference=:vohead_reference," " vohead_amount=:vohead_amount," " vohead_1099=:vohead_1099, " " vohead_curr_id=:vohead_curr_id, " " vohead_notes=:vohead_notes " "WHERE (vohead_id=:vohead_id);" ); updq.bindValue(":vohead_id", _voheadid); updq.bindValue(":vohead_pohead_id", _poNumber->id()); if (_taxzone->isValid()) updq.bindValue(":vohead_taxzone_id", _taxzone->id()); updq.bindValue(":vohead_vend_id", _vendid); updq.bindValue(":vohead_terms_id", _terms->id()); updq.bindValue(":vohead_distdate", _distributionDate->date()); updq.bindValue(":vohead_docdate", _invoiceDate->date()); updq.bindValue(":vohead_duedate", _dueDate->date()); updq.bindValue(":vohead_invcnumber", _invoiceNum->text().trimmed()); updq.bindValue(":vohead_reference", _reference->text().trimmed()); updq.bindValue(":vohead_amount", _amountToDistribute->localValue()); updq.bindValue(":vohead_1099", QVariant(_flagFor1099->isChecked())); updq.bindValue(":vohead_curr_id", _amountToDistribute->id()); updq.bindValue(":vohead_notes", _notes->toPlainText()); updq.exec(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Updating Voucher"), updq, __FILE__, __LINE__)) return; } } void voucher::enableWindowModifiedSetting() { connect(_amountToDistribute, SIGNAL(valueChanged()), this, SLOT(sDataChanged())); connect(_distributionDate,SIGNAL(newDate(const QDate&)), this, SLOT(sDataChanged())); connect(_dueDate, SIGNAL(newDate(const QDate&)), this, SLOT(sDataChanged())); connect(_flagFor1099, SIGNAL(toggled(bool)), this, SLOT(sDataChanged())); connect(_invoiceDate, SIGNAL(newDate(const QDate&)), this, SLOT(sDataChanged())); connect(_invoiceNum,SIGNAL(textChanged(const QString&)), this, SLOT(sDataChanged())); connect(_notes, SIGNAL(textChanged()), this, SLOT(sDataChanged())); connect(_poNumber, SIGNAL(newId(int)), this, SLOT(sDataChanged())); connect(_reference, SIGNAL(textChanged(const QString&)), this, SLOT(sDataChanged())); connect(_taxzone, SIGNAL(newID(int)), this, SLOT(sDataChanged())); connect(_terms, SIGNAL(newID(int)), this, SLOT(sDataChanged())); } void voucher::sDataChanged() { setWindowModified(true); } qt-client-4.1.0/guiclient/voucher.h000066400000000000000000000036671217451700100172350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VOUCHER_H #define VOUCHER_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_voucher.h" class voucher : public XWidget, public Ui::voucher { Q_OBJECT public: voucher(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~voucher(); Q_INVOKABLE void enableWindowModifiedSetting(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual bool sSave(); virtual void sHandleVoucherNumber(); virtual void sPopulate(); virtual void sDataChanged(); virtual void sDistributions(); virtual void sDistributeLine(); virtual void sClear(); virtual void sDistributeAll(); virtual void sNewMiscDistribution(); virtual void sEditMiscDistribution(); virtual void sDeleteMiscDistribution(); virtual void sFillList(); virtual void sFillMiscList(); virtual void sPopulatePoInfo(); virtual void sPopulateDistributed(); virtual void sPopulateBalanceDue(); virtual void populateNumber(); virtual void populate(); virtual void clear(); virtual void closeEvent( QCloseEvent * pEvent ); virtual void sPopulateDistDate(); virtual void sPopulateDueDate(); virtual void sView(); virtual void saveDetail(); protected: virtual void keyPressEvent( QKeyEvent * e ); protected slots: virtual void languageChange(); virtual void sPopulateMenu( QMenu * pMenu ); private: int _vendid; int _voheadid; int _mode; }; #endif // VOUCHER_H qt-client-4.1.0/guiclient/voucher.ui000066400000000000000000000765551217451700100174310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. voucher 0 0 600 400 [*]Voucher 12 Qt::Horizontal QSizePolicy::Expanding 491 31 &Save &Cancel true Voucher #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _voucherNumber Qt::NoFocus Qt::Horizontal 0 20 0 0 0 0 false Qt::Horizontal 0 20 Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _voucherNumber 0 0 Vendor: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Invoice Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _invoiceDate Qt::Horizontal QSizePolicy::Expanding 101 20 Distribution Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _distributionDate Qt::Horizontal 40 20 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _dueDate Qt::Horizontal 40 20 Terms: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _terms Qt::Horizontal 0 20 Qt::Vertical 20 0 Amount to Distribute: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _amountToDistribute 150 0 300 32767 Qt::Horizontal 40 20 Amount Distributed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _amountDistributed 80 0 Qt::NoFocus Balance: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _balance 80 0 Qt::NoFocus Qt::Horizontal 40 20 Vendor Invoice #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _invoiceNum Reference: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _reference Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 true None XComboBox::TaxZones Flag for &1099 0 1 0 Line Items 0 0 0 100 QAbstractItemView::ExtendedSelection 0 false &Distributions... true false Distribute &Line true false &Clear true false Distribute &All true Qt::Vertical QSizePolicy::Expanding 20 16 Misc. Distributions 7 0 0 0 100 0 &New true false &Edit true false &Delete true Qt::Vertical QSizePolicy::Expanding 20 20 Notes true CurrCluster CurrDisplay

    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    OrderCluster QWidget
    ordercluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _voucherNumber _poNumber _invoiceDate _distributionDate _dueDate _terms _amountToDistribute _invoiceNum _reference _taxzone _flagFor1099 _tabs _poitem _distributions _distributeline _clear _distributeall _miscDistrib _new _edit _delete _notes _save _close _close clicked() voucher close() 776 49 20 20 _poitem itemSelected(int) _distributions animateClick() 50 584 766 485 _poitem valid(bool) _distributions setEnabled(bool) 50 584 766 485 _miscDistrib valid(bool) _delete setEnabled(bool) 50 558 131 488 _miscDistrib itemSelected(int) _edit animateClick() 50 558 131 488 _miscDistrib valid(bool) _edit setEnabled(bool) 50 558 131 488 _amountToDistribute idChanged(int) _amountDistributed setId(int) 307 338 309 370 _amountToDistribute idChanged(int) _balance setId(int) 307 338 309 402 _distributionDate newDate(QDate) _amountToDistribute setEffective(QDate) 688 135 307 338 _amountToDistribute effectiveChanged(QDate) _amountDistributed setEffective(QDate) 307 338 309 370 _amountToDistribute effectiveChanged(QDate) _balance setEffective(QDate) 307 338 309 402 _poitem valid(bool) _distributeline setEnabled(bool) 341 584 766 511 _poitem valid(bool) _clear setEnabled(bool) 341 584 766 537 _poNumber valid(bool) _distributeall setEnabled(bool) 269 177 767 573 qt-client-4.1.0/guiclient/voucherItem.cpp000066400000000000000000000662151217451700100204050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "voucherItem.h" // #include #include #include #include #include #include "mqlutil.h" #include "voucherItemDistrib.h" #include "enterPoitemReceipt.h" #include "splitReceipt.h" #include "taxDetail.h" voucherItem::voucherItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { XSqlQuery voucherItem; setupUi(this); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_uninvoiced, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(sToggleReceiving(QTreeWidgetItem*))); connect(_uninvoiced, SIGNAL(populateMenu(QMenu*,XTreeWidgetItem*)), this, SLOT(sPopulateMenu(QMenu*, XTreeWidgetItem*))); connect(_freightToVoucher, SIGNAL(editingFinished()), this, SLOT(sFillList())); connect(_vodist, SIGNAL(populated()), this, SLOT(sCalculateTax())); connect(_taxtype, SIGNAL(newID(int)), this, SLOT(sCalculateTax())); connect(_taxLit, SIGNAL(leftClickedURL(const QString&)), this, SLOT(sTaxDetail())); _item->setReadOnly(TRUE); _unitPrice->setPrecision(omfgThis->priceVal()); _extPrice->setPrecision(omfgThis->moneyVal()); _lineFreight->setPrecision(omfgThis->moneyVal()); _ordered->setValidator(omfgThis->qtyVal()); _received->setValidator(omfgThis->qtyVal()); _rejected->setValidator(omfgThis->qtyVal()); _uninvoicedReceived->setValidator(omfgThis->qtyVal()); _uninvoicedRejected->setValidator(omfgThis->qtyVal()); _qtyToVoucher->setValidator(omfgThis->qtyVal()); _amtToVoucher->setValidator(omfgThis->moneyVal()); _vodist->addColumn(tr("Cost Element"), -1, Qt::AlignLeft, true, "costelem_type"); _vodist->addColumn(tr("Amount"), _priceColumn, Qt::AlignRight,true, "vodist_amount"); _uninvoiced->addColumn(tr("Receipt/Reject"), -1, Qt::AlignCenter, true, "action"); _uninvoiced->addColumn(tr("Date"), _dateColumn, Qt::AlignCenter, true, "item_date"); _uninvoiced->addColumn(tr("Qty."), _qtyColumn, Qt::AlignRight, true, "qty"); _uninvoiced->addColumn(tr("Unit Price"), _moneyColumn,Qt::AlignRight, true, "unitprice"); _uninvoiced->addColumn(tr("Tagged"), _ynColumn, Qt::AlignCenter, true, "f_tagged"); _rejectedMsg = tr("The application has encountered an error and must " "stop editing this Voucher Item.\n%1"); _inTransaction = TRUE; voucherItem.exec("BEGIN;"); //Lot's of things can happen in here that can cause problems if cancelled out. Let's make it easy to roll it back. } voucherItem::~voucherItem() { // no need to delete child widgets, Qt does it all for us } void voucherItem::languageChange() { retranslateUi(this); } enum SetResponse voucherItem::set(const ParameterList &pParams) { XSqlQuery setVoucher; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("curr_id", &valid); if (valid) { _freightToVoucher->setId(param.toInt()); _tax->setId(param.toInt()); } param = pParams.value("effective", &valid); if (valid) { _freightToVoucher->setEffective(param.toDate()); _tax->setEffective(param.toDate()); } param = pParams.value("vohead_id", &valid); if (valid) { _voheadid = param.toInt(); setVoucher.prepare("SELECT vohead_taxzone_id " "FROM vohead " "WHERE (vohead_id = :vohead_id);"); setVoucher.bindValue(":vohead_id", _voheadid); setVoucher.exec(); if (setVoucher.first()) _taxzoneid = setVoucher.value("vohead_taxzone_id").toInt(); else if (setVoucher.lastError().type() != QSqlError::NoError) { systemError(this, setVoucher.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } else _taxzoneid = -1; } else _voheadid = -1; param = pParams.value("poitem_id", &valid); if (valid) { _poitemid = param.toInt(); setVoucher.prepare( "SELECT pohead_number, poitem_linenumber, poitem_taxtype_id, " " COALESCE(itemsite_id, -1) AS itemsiteid," " poitem_vend_item_number, poitem_vend_uom, poitem_vend_item_descrip," " poitem_duedate," " poitem_qty_ordered," " poitem_qty_received," " poitem_qty_returned," " ( SELECT COALESCE(SUM(recv_qty), 0)" " FROM recv" " WHERE ( (recv_posted)" " AND (NOT recv_invoiced)" " AND (recv_vohead_id IS NULL)" " AND (recv_orderitem_id=poitem_id) ) ) AS f_received," " ( SELECT COALESCE(SUM(poreject_qty), 0)" " FROM poreject" " WHERE ( (poreject_posted)" " AND (NOT poreject_invoiced)" " ANd (poreject_vohead_id IS NULL)" " AND (poreject_poitem_id=poitem_id) ) ) AS f_rejected," " poitem_unitprice," " poitem_unitprice * poitem_qty_ordered AS f_extprice," " poitem_freight " "FROM pohead, " " poitem LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id) " "WHERE ( (poitem_pohead_id=pohead_id)" " AND (poitem_id=:poitem_id) );" ); setVoucher.bindValue(":poitem_id", _poitemid); setVoucher.exec(); if (setVoucher.first()) { _poNumber->setText(setVoucher.value("pohead_number").toString()); _lineNumber->setText(setVoucher.value("poitem_linenumber").toString()); _vendItemNumber->setText(setVoucher.value("poitem_vend_item_number").toString()); _vendUOM->setText(setVoucher.value("poitem_vend_uom").toString()); _vendDescription->setText(setVoucher.value("poitem_vend_item_descrip").toString()); _dueDate->setDate(setVoucher.value("poitem_duedate").toDate()); _ordered->setText(setVoucher.value("poitem_qty_ordered").toDouble()); _received->setText(setVoucher.value("poitem_qty_received").toDouble()); _rejected->setText(setVoucher.value("poitem_qty_returned").toDouble()); _uninvoicedReceived->setText(setVoucher.value("f_received").toDouble()); _uninvoicedRejected->setText(setVoucher.value("f_rejected").toDouble()); _unitPrice->setText(setVoucher.value("poitem_unitprice").toDouble()); _extPrice->setText(setVoucher.value("f_extprice").toDouble()); _lineFreight->setText(setVoucher.value("poitem_freight").toDouble()); _taxtype->setId(setVoucher.value("poitem_taxtype_id").toInt()); if (setVoucher.value("itemsiteid") != -1) _item->setItemsiteid(setVoucher.value("itemsiteid").toInt()); } else if (setVoucher.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(setVoucher.lastError().databaseText()), __FILE__, __LINE__); reject(); return UndefinedError; } } else _poitemid = -1; if ( (_voheadid != -1) && (_poitemid != -1) ) { setVoucher.prepare( "SELECT voitem_id, voitem_close, voitem_taxtype_id, " " voitem_qty," " voitem_freight," " ( SELECT SUM(vodist_amount) " " FROM vodist " " WHERE ((vodist_vohead_id=:vohead_id) " " AND (vodist_poitem_id=:poitem_id)) ) AS voitem_amt " "FROM voitem " "WHERE ( (voitem_vohead_id=:vohead_id)" " AND (voitem_poitem_id=:poitem_id) );" ); setVoucher.bindValue(":vohead_id", _voheadid); setVoucher.bindValue(":poitem_id", _poitemid); setVoucher.exec(); if (setVoucher.first()) { _voitemid = setVoucher.value("voitem_id").toInt(); _closePoitem->setChecked(setVoucher.value("voitem_close").toBool()); _qtyToVoucher->setText(setVoucher.value("voitem_qty").toDouble()); _amtToVoucher->setText(setVoucher.value("voitem_amt").toDouble()); _freightToVoucher->setLocalValue(setVoucher.value("voitem_freight").toDouble()); _taxtype->setId(setVoucher.value("voitem_taxtype_id").toInt()); } else if (setVoucher.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(setVoucher.lastError().databaseText()), __FILE__, __LINE__); reject(); return UndefinedError; } else { _voitemid = -1; _closePoitem->setChecked(FALSE); _qtyToVoucher->clear(); _amtToVoucher->clear(); _freightToVoucher->clear(); } setVoucher.prepare( "SELECT SUM(COALESCE(taxhist_tax, 0.00)) AS taxamt " "FROM voitem LEFT OUTER JOIN voitemtax " " ON (voitem_id = taxhist_parent_id) " "WHERE ( (voitem_vohead_id=:vohead_id)" " AND (voitem_poitem_id=:poitem_id) );" ); setVoucher.bindValue(":vohead_id", _voheadid); setVoucher.bindValue(":poitem_id", _poitemid); setVoucher.exec(); if (setVoucher.first()) _tax->setLocalValue(setVoucher.value("taxamt").toDouble()); else if (setVoucher.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(setVoucher.lastError().databaseText()), __FILE__, __LINE__); reject(); return UndefinedError; } else _tax->clear(); } sFillList(); _saved = TRUE; return NoError; } void voucherItem::sSave() { XSqlQuery voucherSave; if (_qtyToVoucher->toDouble() <= 0.0) { QMessageBox::critical( this, tr("Cannot Save Voucher Item"), tr("You must enter a postive Quantity to Voucher before saving this Voucher Item") ); _qtyToVoucher->setFocus(); return; } // Check to make sure there is at least distribution for this Voucher Item voucherSave.prepare( "SELECT vodist_id " "FROM vodist " "WHERE ( (vodist_vohead_id=:vohead_id)" " AND (vodist_poitem_id=:poitem_id) ) " "LIMIT 1;" ); voucherSave.bindValue(":vohead_id", _voheadid); voucherSave.bindValue(":poitem_id", _poitemid); voucherSave.exec(); if (!voucherSave.first()) { QMessageBox::critical( this, tr("Cannot Save Voucher Item"), tr("You must make at least one distribution for this Voucher Item before you may save it.") ); return; } if (voucherSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherSave.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Check for vendor matching requirement voucherSave.prepare( "SELECT vend_id " " FROM vendinfo,pohead,poitem " " WHERE ( (vend_id=pohead_vend_id) " " AND (pohead_id=poitem_pohead_id) " " AND (poitem_id=:poitem_id) " " AND (vend_match) ); " ); voucherSave.bindValue(":poitem_id", _poitemid); voucherSave.exec(); if (voucherSave.first()) { voucherSave.prepare( "SELECT formatMoney(poitem_unitprice * :voitem_qty) AS f_povalue FROM poitem " " WHERE ((poitem_unitprice * :voitem_qty) <> " " (SELECT SUM(vodist_amount) " " FROM vodist " " WHERE ( (vodist_vohead_id=:vohead_id) " " AND (vodist_poitem_id=:poitem_id) ) )" " AND (poitem_id=:poitem_id) ); " ); voucherSave.bindValue(":vohead_id", _voheadid); voucherSave.bindValue(":poitem_id", _poitemid); voucherSave.bindValue(":voitem_qty", _qtyToVoucher->toDouble()); voucherSave.exec(); if (voucherSave.first()) { QString msg; msg = "The P/O value of "; msg.append( voucherSave.value("f_povalue").toString() ); msg.append( " does not match the total distributed value.\nInvoice matching is required for this vendor.\nStop and correct?" ); if ( QMessageBox::warning( this, tr("Invoice Value Mismatch"), msg, tr("Yes"), tr("No"), QString::null ) != 1 ) return; } } else if (voucherSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherSave.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Update the qty vouchered voucherSave.prepare( "UPDATE voitem " "SET voitem_close=:voitem_close," " voitem_freight=:voitem_freight, " " voitem_taxtype_id=:voitem_taxtype_id " "WHERE (voitem_id=:voitem_id);" "UPDATE vodist " "SET vodist_qty=:qty " "WHERE ((vodist_vohead_id=:vohead_id)" " AND (vodist_poitem_id=:poitem_id) );" ); voucherSave.bindValue(":qty", _qtyToVoucher->toDouble()); voucherSave.bindValue(":poitem_id", _poitemid); voucherSave.bindValue(":voitem_id", _voitemid); voucherSave.bindValue(":vohead_id", _voheadid); voucherSave.bindValue(":voitem_close", QVariant(_closePoitem->isChecked())); voucherSave.bindValue(":voitem_freight", _freightToVoucher->localValue()); if (_taxtype->id() != -1) voucherSave.bindValue(":voitem_taxtype_id", _taxtype->id()); voucherSave.exec(); if (voucherSave.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherSave.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } voucherSave.exec("COMMIT;"); _inTransaction = FALSE; accept(); } void voucherItem::sNew() { XSqlQuery voucherNew; voucherNew.prepare( "SELECT COALESCE(SUM(vodist_amount),0) AS f_amount " " FROM vodist " " WHERE ( (vodist_vohead_id=:vohead_id) " " AND (vodist_poitem_id=:poitem_id) );" ); voucherNew.bindValue(":vohead_id", _voheadid); voucherNew.bindValue(":poitem_id", _poitemid); voucherNew.exec(); if (voucherNew.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherNew.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } ParameterList params; params.append("vohead_id", _voheadid); params.append("poitem_id", _poitemid); params.append("mode", "new"); params.append("curr_id", _freightToVoucher->id()); params.append("effective", _freightToVoucher->effective()); if (voucherNew.first()) params.append("amount", (_amtToVoucher->toDouble() - voucherNew.value("f_amount").toDouble()) ); else params.append("amount", _amtToVoucher->toDouble()); voucherItemDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void voucherItem::sEdit() { ParameterList params; params.append("vodist_id", _vodist->id()); params.append("mode", "edit"); params.append("curr_id", _freightToVoucher->id()); params.append("effective", _freightToVoucher->effective()); voucherItemDistrib newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void voucherItem::sDelete() { XSqlQuery voucherDelete; voucherDelete.prepare( "DELETE FROM vodist " "WHERE (vodist_id=:vodist_id);" ); voucherDelete.bindValue(":vodist_id", _vodist->id()); voucherDelete.exec(); if (voucherDelete.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherDelete.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } sFillList(); } void voucherItem::sToggleReceiving(QTreeWidgetItem *pItem) { XSqlQuery voucherToggleReceiving; double n; double a; QString s; XTreeWidgetItem* item = (XTreeWidgetItem*)pItem; if(item->id() == -1) return; if (item->text(4) == "Yes") { item->setText(4, "No"); if (item->text(0) == "Receiving") { n = _qtyToVoucher->toDouble(); a = _amtToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); _amtToVoucher->setText(item->text(3)); n = n - _qtyToVoucher->toDouble(); a = a - (_qtyToVoucher->toDouble() * _amtToVoucher->toDouble()); _qtyToVoucher->setText(s.setNum(n)); _amtToVoucher->setText(s.setNum(a)); n = _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(item->text(2)); n = n + _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(s.setNum(n)); } else { n = _qtyToVoucher->toDouble(); a = _amtToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); _amtToVoucher->setText(item->text(3)); n = n - _qtyToVoucher->toDouble(); a = a - (_qtyToVoucher->toDouble() * _amtToVoucher->toDouble()); _qtyToVoucher->setText(s.setNum(n)); _amtToVoucher->setText(s.setNum(a)); n = _uninvoicedRejected->toDouble(); _uninvoicedRejected->setText(item->text(2)); n = n + _rejected->toDouble(); _uninvoicedRejected->setText(s.setNum(n)); } } else { item->setText(4, "Yes"); if (item->text(0) == "Receiving") { n = _qtyToVoucher->toDouble(); a = _amtToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); _amtToVoucher->setText(item->text(3)); n = n + _qtyToVoucher->toDouble(); a = a + (_qtyToVoucher->toDouble() * _amtToVoucher->toDouble()); _qtyToVoucher->setText(s.setNum(n)); _amtToVoucher->setText(s.setNum(a)); n = _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(item->text(2)); n = n - _uninvoicedReceived->toDouble(); _uninvoicedReceived->setText(s.setNum(n)); } else { n = _qtyToVoucher->toDouble(); a = _amtToVoucher->toDouble(); _qtyToVoucher->setText(item->text(2)); _amtToVoucher->setText(item->text(3)); n = n + _qtyToVoucher->toDouble(); a = a + (_qtyToVoucher->toDouble() * _amtToVoucher->toDouble()); _qtyToVoucher->setText(s.setNum(n)); _amtToVoucher->setText(s.setNum(a)); n = _uninvoicedRejected->toDouble(); _uninvoicedRejected->setText(item->text(2)); n = n + _uninvoicedRejected->toDouble(); _uninvoicedRejected->setText(s.setNum(n)); } } // Check PO Close flag if ( ((_ordered->toDouble() <= (_received->toDouble() - _rejected->toDouble()))) && (_uninvoicedReceived->toDouble() == 0) && (_uninvoicedRejected->toDouble() == 0) ) _closePoitem->setChecked(true); else _closePoitem->setChecked(false); // Save the voitem information if (_voitemid != -1) { voucherToggleReceiving.prepare( "UPDATE voitem " "SET voitem_qty=:voitem_qty " "WHERE (voitem_id=:voitem_id);" ); voucherToggleReceiving.bindValue(":voitem_id", _voitemid); } else { // Get next voitem id voucherToggleReceiving.prepare("SELECT NEXTVAL('voitem_voitem_id_seq') AS voitemid"); voucherToggleReceiving.exec(); if (voucherToggleReceiving.first()) _voitemid = (voucherToggleReceiving.value("voitemid").toInt()); else if (voucherToggleReceiving.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherToggleReceiving.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } voucherToggleReceiving.prepare( "INSERT INTO voitem " "(voitem_id, voitem_vohead_id, voitem_poitem_id, voitem_close, voitem_qty, voitem_freight) " "VALUES " "(:voitem_id, :vohead_id, :poitem_id, :voitem_close, :voitem_qty, :voitem_freight);" ); } voucherToggleReceiving.bindValue(":voitem_id", _voitemid); voucherToggleReceiving.bindValue(":vohead_id", _voheadid); voucherToggleReceiving.bindValue(":poitem_id", _poitemid); voucherToggleReceiving.bindValue(":voitem_close", QVariant(_closePoitem->isChecked())); voucherToggleReceiving.bindValue(":voitem_qty", _qtyToVoucher->toDouble()); voucherToggleReceiving.bindValue(":voitem_freight", _freightToVoucher->localValue()); voucherToggleReceiving.exec(); if (voucherToggleReceiving.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherToggleReceiving.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Update the receipt record if (item->text(4) == "Yes") { if (item->altId() == 1) voucherToggleReceiving.prepare( "UPDATE recv " "SET recv_vohead_id=:vohead_id,recv_voitem_id=:voitem_id " "WHERE (recv_id=:target_id);" ); else if (item->altId() == 2) voucherToggleReceiving.prepare( "UPDATE poreject " "SET poreject_vohead_id=:vohead_id,poreject_voitem_id=:voitem_id " "WHERE (poreject_id=:target_id);" ); } else { if (item->altId() == 1) voucherToggleReceiving.prepare( "UPDATE recv " "SET recv_vohead_id=NULL,recv_voitem_id=NULL " "WHERE ((recv_id=:target_id)" " AND (recv_vohead_id=:vohead_id));" ); else if (item->altId() == 2) voucherToggleReceiving.prepare( "UPDATE poreject " "SET poreject_vohead_id=NULL,poreject_voitem_id=NULL " "WHERE ((poreject_id=:target_id)" " AND (poreject_vohead_id=:vohead_id));" ); } voucherToggleReceiving.bindValue(":vohead_id", _voheadid); voucherToggleReceiving.bindValue(":voitem_id", _voitemid); voucherToggleReceiving.bindValue(":target_id", item->id()); voucherToggleReceiving.exec(); if (voucherToggleReceiving.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherToggleReceiving.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } } void voucherItem::sFillList() { MetaSQLQuery distmql = mqlLoad("voucherItem", "distributions"); ParameterList params; params.append("none", tr("None")); params.append("poitem_id", _poitemid); params.append("vohead_id", _voheadid); XSqlQuery distq = distmql.toQuery(params); _vodist->populate(distq); if (distq.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(distq.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Fill univoiced receipts list MetaSQLQuery recmql = mqlLoad("voucherItem", "receipts"); params.append("receiving", tr("Receiving")); params.append("reject", tr("Reject")); XSqlQuery recq = recmql.toQuery(params); _uninvoiced->populate(recq, true); if (recq.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(recq.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } // Display the total distributed amount XSqlQuery totalDist; totalDist.prepare( "SELECT SUM(vodist_amount) AS totalamount " "FROM vodist " "WHERE ( (vodist_vohead_id=:vohead_id)" " AND (vodist_poitem_id=:poitem_id) );" ); totalDist.bindValue(":vohead_id", _voheadid); totalDist.bindValue(":poitem_id", _poitemid); totalDist.exec(); if (totalDist.first()) _totalDistributed->setLocalValue(totalDist.value("totalamount").toDouble() + _tax->localValue() + _freightToVoucher->localValue()); else if (totalDist.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(totalDist.lastError().databaseText()), __FILE__, __LINE__); reject(); return; } } void voucherItem::sCorrectReceiving() { XSqlQuery voucherFillList; if (enterPoitemReceipt::correctReceipt(_uninvoiced->id(), this) != XDialog::Rejected) sFillList(); } void voucherItem::sSplitReceipt() { ParameterList params; params.append("recv_id", _uninvoiced->id()); splitReceipt newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void voucherItem::sPopulateMenu(QMenu *pMenu, XTreeWidgetItem *selected) { QAction *menuItem; if ( (selected->rawValue("action") == "REC") && (selected->text(4) == "No") ) { menuItem = pMenu->addAction(tr("Correct Receipt..."), this, SLOT(sCorrectReceiving())); menuItem->setEnabled(_privileges->check("EnterReceipts")); menuItem = pMenu->addAction(tr("Split Receipt..."), this, SLOT(sSplitReceipt())); menuItem->setEnabled(_privileges->check("EnterReceipts")); } } void voucherItem::reject() { XSqlQuery voucherreject; if(_inTransaction) { voucherreject.exec("ROLLBACK;"); _inTransaction = false; } XDialog::reject(); } void voucherItem::closeEvent(QCloseEvent * event) { XSqlQuery vouchercloseEvent; if(_inTransaction) { vouchercloseEvent.exec("ROLLBACK;"); _inTransaction = false; } XDialog::closeEvent(event); } void voucherItem::sCalculateTax() { _saved = FALSE; XSqlQuery calcq; calcq.prepare( "SELECT SUM(COALESCE(tax, 0.00)) AS totaltax " "FROM (SELECT calculateTax(vohead_taxzone_id, :taxtype_id, " " vohead_docdate, vohead_curr_id, vodist_amount) AS tax " " FROM vohead JOIN vodist ON(vohead_id=vodist_vohead_id) " " WHERE (vohead_id=:vohead_id) " " AND (vodist_poitem_id=:poitem_id) " ") data;"); calcq.bindValue(":vohead_id", _voheadid); calcq.bindValue(":taxtype_id", _taxtype->id()); calcq.bindValue(":poitem_id", _poitemid); calcq.exec(); if (calcq.first()) _tax->setLocalValue(calcq.value("totaltax").toDouble()); else if (calcq.lastError().type() != QSqlError::NoError) { systemError(this, calcq.lastError().databaseText(), __FILE__, __LINE__); return; } } void voucherItem::sTaxDetail() { XSqlQuery voucherTaxDetail; voucherTaxDetail.prepare( "SELECT SUM(vodist_amount) AS distamount " "FROM vodist " "WHERE ( (vodist_vohead_id=:vohead_id)" " AND (vodist_poitem_id=:poitem_id) );" ); voucherTaxDetail.bindValue(":vohead_id", _voheadid); voucherTaxDetail.bindValue(":poitem_id", _poitemid); voucherTaxDetail.exec(); if (voucherTaxDetail.first()) _distamount = voucherTaxDetail.value("distamount").toDouble(); else if (voucherTaxDetail.lastError().type() != QSqlError::NoError) { systemError(this, _rejectedMsg.arg(voucherTaxDetail.lastError().databaseText()), __FILE__, __LINE__); return; } taxDetail newdlg(this, "", true); ParameterList params; params.append("taxzone_id", _taxzoneid); params.append("taxtype_id", _taxtype->id()); params.append("date", _tax->effective()); params.append("subtotal", _distamount); params.append("curr_id", _tax->id()); params.append("sense", -1); if(cView == _mode) params.append("readOnly"); if(_saved == TRUE) { params.append("order_id", _voitemid); params.append("order_type", "VI"); } newdlg.set(params); if (newdlg.set(params) == NoError && newdlg.exec()) { if (_taxtype->id() != newdlg.taxtype()) _taxtype->setId(newdlg.taxtype()); } } qt-client-4.1.0/guiclient/voucherItem.h000066400000000000000000000031051217451700100200370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VOUCHERITEM_H #define VOUCHERITEM_H #include "guiclient.h" #include "xdialog.h" #include "ui_voucherItem.h" class voucherItem : public XDialog, public Ui::voucherItem { Q_OBJECT public: voucherItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~voucherItem(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sSave(); virtual void sNew(); virtual void sEdit(); virtual void sDelete(); virtual void sToggleReceiving( QTreeWidgetItem * pItem ); virtual void sFillList(); virtual void sPopulateMenu( QMenu * pMenu, XTreeWidgetItem* ); virtual void sCorrectReceiving(); virtual void sSplitReceipt(); virtual void reject(); virtual void sCalculateTax(); virtual void sTaxDetail(); protected: virtual void closeEvent(QCloseEvent * event); protected slots: virtual void languageChange(); private: int _mode; int _voheadid; int _voitemid; int _poitemid; int _taxzoneid; bool _inTransaction; bool _saved; double _distamount; QString _rejectedMsg; }; #endif // VOUCHERITEM_H qt-client-4.1.0/guiclient/voucherItem.ui000066400000000000000000001221131217451700100202260ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. voucherItem 0 0 723 794 Voucher Item 12 12 Order Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Line #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Horizontal 40 20 0 0 &Cancel &Save true true Qt::Vertical QSizePolicy::Expanding 20 0 Qt::StrongFocus Qt::Horizontal 0 20 Unit Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.00 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Ext. Price: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.00 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 0 20 Line Item Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0.00 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Quantity 0 Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Rejected: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 2 false 80 0 true Qt::AlignRight false 80 0 true Qt::AlignRight false 80 0 true Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 0 62 0 Uninvoiced Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Uninvoiced Rejected: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 false 80 0 true Qt::AlignRight false 80 0 true Qt::AlignRight Qt::Horizontal QSizePolicy::Expanding 0 42 0 0 false 0 0 0 Qt::AlignRight true false 0 0 0 Qt::AlignRight true Qt::Horizontal QSizePolicy::Expanding 0 10 Qty. To Voucher: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Amt. To Voucher: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Uninvoiced Recepts and Returns 16777215 100 0 Close Qt::Horizontal QSizePolicy::Expanding 0 16 0 1 0 Distributions 0 1 16777215 150 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 0 20 CurrDisplay::Money 0 24 Tax Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true true None XComboBox::TaxTypes Qt::Horizontal 88 14 Tax: Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing 5 CurrDisplay::SalesPrice false Qt::Horizontal 258 21 0 0 Total Distributed: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::StrongFocus Freight: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Detail Vend. Item Number: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 5 0 0 UOM: 40 0 Qt::Horizontal QSizePolicy::Expanding 20 20 0 0 0 Vend. Item Descrip.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 59 0 0 true true Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 false Qt::Horizontal QSizePolicy::Expanding 0 10 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    ItemCluster QWidget
    itemcluster.h
    1
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XURLLabel QLabel
    xurllabel.h
    XTextEdit QTextEdit
    xtextedit.h
    _item _vendDescription _dueDate _ordered _received _rejected _uninvoicedReceived _uninvoicedRejected _freightToVoucher _uninvoiced _closePoitem _vodist _new _edit _delete _totalDistributed _save _close _vodist valid(bool) _delete setEnabled(bool) 20 20 20 20 _vodist valid(bool) _edit setEnabled(bool) 20 20 20 20 _vodist itemSelected(int) _edit animateClick() 20 20 20 20 _freightToVoucher idChanged(int) _totalDistributed setId(int) 20 20 20 20 _freightToVoucher effectiveChanged(QDate) _totalDistributed setEffective(QDate) 20 20 20 20 _close clicked() voucherItem reject() 20 20 20 20
    qt-client-4.1.0/guiclient/voucherItemDistrib.cpp000066400000000000000000000130701217451700100217150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "voucherItemDistrib.h" #include voucherItemDistrib::voucherItemDistrib(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_costelem, SIGNAL(newID(int)), this, SLOT(sCheck())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); _costelem->populate( QString( "SELECT costelem_id, costelem_type, 1 AS orderby " "FROM costelem " "WHERE (costelem_type='Material') " "UNION SELECT 0, '%1' AS costelem_type, 2 AS orderby " "UNION SELECT costelem_id, costelem_type, 3 AS orderby " "FROM costelem " "WHERE ( (costelem_active)" " AND (NOT costelem_sys)" " AND (costelem_po) ) " "ORDER BY orderby, costelem_type;" ) .arg(tr("None")) ); } voucherItemDistrib::~voucherItemDistrib() { // no need to delete child widgets, Qt does it all for us } void voucherItemDistrib::languageChange() { retranslateUi(this); } enum SetResponse voucherItemDistrib::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("poitem_id", &valid); if (valid) _poitemid = param.toInt(); param = pParams.value("vohead_id", &valid); if (valid) _voheadid = param.toInt(); param = pParams.value("curr_id", &valid); if (valid) _amount->setId(param.toInt()); param = pParams.value("effective", &valid); if (valid) _amount->setEffective(param.toDate()); param = pParams.value("vodist_id", &valid); if (valid) { _vodistid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; param = pParams.value("amount", &valid); if (valid) _amount->setLocalValue(param.toDouble()); } else if (param.toString() == "edit") { _mode = cEdit; _costelem->setEnabled(false); } } return NoError; } void voucherItemDistrib::populate() { XSqlQuery voucherpopulate; voucherpopulate.prepare( "SELECT * " "FROM vodist " "WHERE (vodist_id=:vodist_id);" ) ; voucherpopulate.bindValue(":vodist_id", _vodistid); voucherpopulate.exec(); if (voucherpopulate.first()) { _costelem->setId(voucherpopulate.value("vodist_costelem_id").toInt()); _amount->setLocalValue(voucherpopulate.value("vodist_amount").toDouble()); _discountable->setChecked(voucherpopulate.value("vodist_discountable").toBool()); _notes->setText(voucherpopulate.value("vodist_notes").toString()); } } bool voucherItemDistrib::sCheck() { XSqlQuery voucherCheck; if (_mode == cNew) { voucherCheck.prepare( "SELECT vodist_id " "FROM vodist " "WHERE ( (vodist_vohead_id=:vodist_vohead_id)" " AND (vodist_poitem_id=:vodist_poitem_id)" " AND (vodist_costelem_id=:vodist_costelem_id) );" ); voucherCheck.bindValue(":vodist_vohead_id", _voheadid); voucherCheck.bindValue(":vodist_poitem_id", _poitemid); voucherCheck.bindValue(":vodist_costelem_id", _costelem->id()); voucherCheck.exec(); if (voucherCheck.first()) { _vodistid = voucherCheck.value("vodist_id").toInt(); _mode = cEdit; populate(); _costelem->setEnabled(FALSE); return false; } } return true; } void voucherItemDistrib::sSave() { XSqlQuery voucherSave; if (_mode == cNew) { if (!sCheck()) return; voucherSave.exec("SELECT NEXTVAL('vodist_vodist_id_seq') AS _vodistid;"); if (voucherSave.first()) _vodistid = voucherSave.value("_vodistid").toInt(); voucherSave.prepare( "INSERT INTO vodist " "( vodist_id, vodist_vohead_id, vodist_poitem_id," " vodist_costelem_id, vodist_amount, vodist_discountable," " vodist_notes ) " "VALUES " "( :vodist_id, :vodist_vohead_id, :vodist_poitem_id," " :vodist_costelem_id, :vodist_amount, :vodist_discountable," " :vodist_notes );" ); } if (_mode == cEdit) voucherSave.prepare( "UPDATE vodist " "SET vodist_costelem_id=:vodist_costelem_id," " vodist_amount=:vodist_amount," " vodist_discountable=:vodist_discountable," " vodist_notes=:vodist_notes " "WHERE (vodist_id=:vodist_id);" ); voucherSave.bindValue(":vodist_id", _vodistid); voucherSave.bindValue(":vodist_vohead_id", _voheadid); voucherSave.bindValue(":vodist_poitem_id", _poitemid); voucherSave.bindValue(":vodist_costelem_id", _costelem->id()); voucherSave.bindValue(":vodist_amount", _amount->localValue()); voucherSave.bindValue(":vodist_discountable", QVariant(_discountable->isChecked())); voucherSave.bindValue(":vodist_notes", _notes->toPlainText().trimmed()); voucherSave.exec(); done(_vodistid); } qt-client-4.1.0/guiclient/voucherItemDistrib.h000066400000000000000000000022141217451700100213600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VOUCHERITEMDISTRIB_H #define VOUCHERITEMDISTRIB_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_voucherItemDistrib.h" class voucherItemDistrib : public XDialog, public Ui::voucherItemDistrib { Q_OBJECT public: voucherItemDistrib(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~voucherItemDistrib(); public slots: virtual SetResponse set(const ParameterList & pParams); virtual void populate(); virtual void sSave(); virtual bool sCheck(); protected slots: virtual void languageChange(); private: int _mode; int _poitemid; int _voheadid; int _vodistid; }; #endif // VOUCHERITEMDISTRIB_H qt-client-4.1.0/guiclient/voucherItemDistrib.ui000066400000000000000000000157121217451700100215550ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. voucherItemDistrib 0 0 582 242 Voucher Item Distribution 12 12 Costing Element: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Amount to Distribute: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Discountable true true Notes: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 0 Qt::Horizontal 40 20 0 0 &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTextEdit QTextEdit
    xtextedit.h
    _costelem _amount _save _close parameter.h _close clicked() voucherItemDistrib reject() 20 20 20 20
    qt-client-4.1.0/guiclient/voucherMiscDistrib.cpp000066400000000000000000000212141217451700100217110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "voucherMiscDistrib.h" #include #include #include voucherMiscDistrib::voucherMiscDistrib(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_taxCode, SIGNAL(newID(int)), this, SLOT(sCheck())); _account->setType(GLCluster::cRevenue | GLCluster::cExpense | GLCluster::cAsset | GLCluster::cLiability); adjustSize(); } voucherMiscDistrib::~voucherMiscDistrib() { // no need to delete child widgets, Qt does it all for us } void voucherMiscDistrib::languageChange() { retranslateUi(this); } enum SetResponse voucherMiscDistrib::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("vohead_id", &valid); if (valid) _voheadid = param.toInt(); _miscvoucher = pParams.inList("voucher_type"); param = pParams.value("curr_id", &valid); if (valid) _amount->setId(param.toInt()); param = pParams.value("curr_effective", &valid); if (valid) _amount->setEffective(param.toDate()); param = pParams.value("vodist_id", &valid); if (valid) { _vodistid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; param = pParams.value("vend_id", &valid); if (valid) sPopulateVendorInfo(param.toInt()); param = pParams.value("amount", &valid); if (valid) _amount->setLocalValue(param.toDouble()); } else if (param.toString() == "edit") { _mode = cEdit; sCheck(); } } return NoError; } void voucherMiscDistrib::populate() { XSqlQuery vpopulateVoucher; vpopulateVoucher.prepare( "SELECT * " "FROM vodist " "WHERE (vodist_id=:vodist_id);" ) ; vpopulateVoucher.bindValue(":vodist_id", _vodistid); vpopulateVoucher.exec(); if (vpopulateVoucher.first()) { _account->setId(vpopulateVoucher.value("vodist_accnt_id").toInt()); _amount->setLocalValue(vpopulateVoucher.value("vodist_amount").toDouble()); _discountable->setChecked(vpopulateVoucher.value("vodist_discountable").toBool()); _notes->setText(vpopulateVoucher.value("vodist_notes").toString()); if(vpopulateVoucher.value("vodist_expcat_id").toInt() != -1) { _expcatSelected->setChecked(TRUE); _expcat->setId(vpopulateVoucher.value("vodist_expcat_id").toInt()); } if(vpopulateVoucher.value("vodist_tax_id").toInt() != -1) { _taxSelected->setChecked(TRUE); _taxCode->setId(vpopulateVoucher.value("vodist_tax_id").toInt()); } } } void voucherMiscDistrib::sSave() { XSqlQuery saveVoucher; if (_accountSelected->isChecked() && !_account->isValid()) { QMessageBox::warning( this, tr("Select Account"), tr("You must select an Account to post this Miscellaneous Distribution to.") ); _account->setFocus(); return; } if (_expcatSelected->isChecked() && !_expcat->isValid()) { QMessageBox::warning( this, tr("Select Expense Category"), tr("You must select an Expense Category to post this Miscellaneous Distribution to.") ); _account->setFocus(); return; } if (_taxSelected->isChecked() && !_taxCode->isValid()) { QMessageBox::warning( this, tr("Select Tax Code"), tr("You must select a Tax Code to post this Miscellaneous Distribution to.") ); _account->setFocus(); return; } if (_mode == cNew) { saveVoucher.exec("SELECT NEXTVAL('vodist_vodist_id_seq') AS _vodistid;"); if (saveVoucher.first()) _vodistid = saveVoucher.value("_vodistid").toInt(); else { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } saveVoucher.prepare( "INSERT INTO vodist " "( vodist_id, vodist_vohead_id, vodist_poitem_id," " vodist_costelem_id, vodist_accnt_id, vodist_amount, vodist_discountable," " vodist_expcat_id, vodist_tax_id, vodist_notes ) " "VALUES " "( :vodist_id, :vodist_vohead_id, -1," " -1, :vodist_accnt_id, :vodist_amount, :vodist_discountable," " :vodist_expcat_id, :vodist_tax_id, :vodist_notes );" ); } else if (_mode == cEdit) saveVoucher.prepare( "UPDATE vodist " "SET vodist_accnt_id=:vodist_accnt_id," " vodist_amount=:vodist_amount," " vodist_discountable=:vodist_discountable," " vodist_expcat_id=:vodist_expcat_id, " " vodist_tax_id = :vodist_tax_id, " " vodist_notes=:vodist_notes " "WHERE (vodist_id=:vodist_id);" ); saveVoucher.bindValue(":vodist_id", _vodistid); saveVoucher.bindValue(":vodist_vohead_id", _voheadid); saveVoucher.bindValue(":vodist_amount", _amount->localValue()); saveVoucher.bindValue(":vodist_discountable", QVariant(_discountable->isChecked())); saveVoucher.bindValue(":vodist_notes", _notes->toPlainText().trimmed()); if(_accountSelected->isChecked()) { saveVoucher.bindValue(":vodist_accnt_id", _account->id()); saveVoucher.bindValue(":vodist_expcat_id", -1); saveVoucher.bindValue(":vodist_tax_id", -1); } else if (_expcatSelected->isChecked()) { saveVoucher.bindValue(":vodist_accnt_id", -1); saveVoucher.bindValue(":vodist_expcat_id", _expcat->id()); saveVoucher.bindValue(":vodist_tax_id", -1); } else { saveVoucher.bindValue(":vodist_accnt_id", -1); saveVoucher.bindValue(":vodist_expcat_id", -1); saveVoucher.bindValue(":vodist_tax_id", _taxCode->id()); } saveVoucher.exec(); done(_vodistid); } void voucherMiscDistrib::sCheck() { XSqlQuery checkVoucher; if(_taxSelected->isChecked() && _mode == cEdit) { checkVoucher.prepare( "SELECT vodist_id, vodist_vohead_id, vodist_amount " "FROM vodist " "WHERE (vodist_id=:vodist_id) " " AND (vodist_poitem_id=-1)" " AND (vodist_tax_id=:tax_id);" ); checkVoucher.bindValue(":vodist_id", _vodistid); checkVoucher.bindValue(":tax_id", _taxCode->id()); checkVoucher.exec(); if (checkVoucher.first()) { _amount->setFocus(); _taxSelected->setEnabled(false); _taxCode->setEnabled(false); _expcatSelected->setEnabled(false); _accountSelected->setEnabled(false); } } else if(_taxSelected->isChecked() && _mode == cNew) { checkVoucher.prepare( "SELECT vodist_id, vodist_amount " "FROM vodist " "WHERE (vodist_vohead_id=:vodist_vohead_id) " " AND (vodist_poitem_id=-1)" " AND (vodist_tax_id=:tax_id);" ); checkVoucher.bindValue(":vodist_vohead_id", _voheadid); checkVoucher.bindValue(":tax_id", _taxCode->id()); checkVoucher.exec(); if (checkVoucher.first()) { _vodistid=checkVoucher.value("vodist_id").toInt(); _amount->setLocalValue(checkVoucher.value("vodist_amount").toDouble()); _amount->setFocus(); _mode=cEdit; _taxSelected->setEnabled(false); _taxCode->setEnabled(false); _expcatSelected->setEnabled(false); _accountSelected->setEnabled(false); } } } void voucherMiscDistrib::sPopulateVendorInfo(int pVendid) { XSqlQuery populateVoucher; populateVoucher.prepare( "SELECT vend_accnt_id, vend_expcat_id, vend_tax_id " "FROM vendinfo " "WHERE (vend_id=:vend_id);" ); populateVoucher.bindValue(":vend_id", pVendid); populateVoucher.exec(); if (populateVoucher.first()) { if(populateVoucher.value("vend_accnt_id").toInt() != -1) { _accountSelected->setChecked(TRUE); _account->setId(populateVoucher.value("vend_accnt_id").toInt()); _amount->setFocus(); } if(populateVoucher.value("vend_expcat_id").toInt() != -1) { _expcatSelected->setChecked(TRUE); _expcat->setId(populateVoucher.value("vend_expcat_id").toInt()); _amount->setFocus(); } if(populateVoucher.value("vend_tax_id").toInt() != -1) { _taxSelected->setChecked(TRUE); _taxCode->setId(populateVoucher.value("vend_tax_id").toInt()); _amount->setFocus(); } } } qt-client-4.1.0/guiclient/voucherMiscDistrib.h000066400000000000000000000022721217451700100213610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VOUCHERMISCDISTRIB_H #define VOUCHERMISCDISTRIB_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_voucherMiscDistrib.h" class voucherMiscDistrib : public XDialog, public Ui::voucherMiscDistrib { Q_OBJECT public: voucherMiscDistrib(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~voucherMiscDistrib(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); virtual void sSave(); virtual void sCheck(); virtual void sPopulateVendorInfo(int); protected slots: virtual void languageChange(); private: int _mode; int _voheadid; int _vodistid; bool _miscvoucher; }; #endif // VOUCHERMISCDISTRIB_H qt-client-4.1.0/guiclient/voucherMiscDistrib.ui000066400000000000000000000236511217451700100215530ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. voucherMiscDistrib 0 0 553 444 Miscellaneous Voucher Distribution Account true Tax Code Expense Category true false Qt::StrongFocus true false true None XComboBox::TaxCodes Qt::Horizontal 0 20 Qt::Vertical QSizePolicy::Preferred 0 0 Amount to Distribute: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true false Discountable true true Qt::Horizontal QSizePolicy::Expanding 0 20 Qt::Vertical QSizePolicy::Preferred 0 0 Notes: &Cancel &Save true Qt::Vertical QSizePolicy::Expanding 20 0 CurrCluster CurrDisplay
    currcluster.h
    CurrDisplay QWidget
    currcluster.h
    ExpenseCluster QWidget
    expensecluster.h
    GLCluster QWidget
    glcluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XTextEdit QTextEdit
    xtextedit.h
    _accountSelected _account _expcatSelected _expcat _taxSelected _taxCode _amount _discountable _notes _save _close _close clicked() voucherMiscDistrib reject() 519 31 20 20 _accountSelected toggled(bool) _account setEnabled(bool) 75 64 283 68 _expcatSelected toggled(bool) _expcat setEnabled(bool) 130 126 448 140 _taxSelected toggled(bool) _taxCode setEnabled(bool) 91 179 246 179
    qt-client-4.1.0/guiclient/warehouse.cpp000066400000000000000000000544511217451700100201140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "warehouse.h" #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" #include "warehouseZone.h" warehouse::warehouse(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl), _mode(cView), _warehousid(-1) { setupUi(this); connect(_code, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDeleteZone())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEditZone())); connect(_new, SIGNAL(clicked()), this, SLOT(sNewZone())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_standard, SIGNAL(toggled(bool)), this, SLOT(sHandleWhsType())); connect(_transit, SIGNAL(toggled(bool)), this, SLOT(sHandleWhsType())); connect(_address, SIGNAL(addressChanged(QString,QString,QString,QString,QString,QString, QString)), _contact, SLOT(setNewAddr(QString,QString,QString,QString,QString,QString, QString))); _whsezone->addColumn(tr("Name"), _itemColumn, Qt::AlignCenter, true, "whsezone_name"); _whsezone->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "whsezone_descrip"); if (!_metrics->boolean("MultiWhs")) { _active->setChecked(TRUE); _active->hide(); } _standard->setVisible(_metrics->boolean("MultiWhs")); _transit->setVisible(_metrics->boolean("MultiWhs")); } warehouse::~warehouse() { // no need to delete child widgets, Qt does it all for us } void warehouse::languageChange() { retranslateUi(this); } enum SetResponse warehouse::set(const ParameterList &pParams) { XSqlQuery warehouseet; XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("warehous_id", &valid); if (valid) { _warehousid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; warehouseet.exec("SELECT NEXTVAL('warehous_warehous_id_seq') AS warehous_id"); if (warehouseet.first()) _warehousid = warehouseet.value("warehous_id").toInt(); else if (warehouseet.lastError().type() != QSqlError::NoError) { systemError(this, warehouseet.lastError().databaseText(), __FILE__, __LINE__); return UndefinedError; } connect(_whsezone, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_whsezone, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_whsezone, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); emit newId(_warehousid); } else if (param.toString() == "edit") { _mode = cEdit; connect(_whsezone, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_whsezone, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_whsezone, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else if (param.toString() == "view") { _mode = cView; _code->setEnabled(FALSE); _sitetype->setEnabled(FALSE); _active->setEnabled(FALSE); _description->setEnabled(FALSE); _contact->setEnabled(FALSE); _address->setEnabled(FALSE); _defaultFOB->setEnabled(FALSE); _bolPrefix->setEnabled(FALSE); _bolNumber->setEnabled(FALSE); _shipping->setEnabled(FALSE); _countTagPrefix->setEnabled(FALSE); _countTagNumber->setEnabled(FALSE); _sequence->setEnabled(FALSE); _useSlips->setEnabled(FALSE); _arblGroup->setEnabled(FALSE); _useZones->setEnabled(FALSE); _new->setEnabled(FALSE); _account->setEnabled(FALSE); _shipcomm->setEnabled(FALSE); _taxzone->setEnabled(FALSE); _comments->setReadOnly(TRUE); _transit->setEnabled(FALSE); _shipform->setEnabled(FALSE); _shipvia->setEnabled(FALSE); _shipcomments->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } emit newMode(_mode); } return NoError; } int warehouse::id() const { return _warehousid; } int warehouse::mode() const { return _mode; } void warehouse::sSave() { QList errors; errors << GuiErrorCheck(_code->text().trimmed().isEmpty(), _code, tr("

    You must enter a code for this Site " "before saving it.")) << GuiErrorCheck(!_sitetype->isValid(), _sitetype, tr("

    You must enter a Type for this " "Site before saving it.")) << GuiErrorCheck(_account->id() == -1, _account, tr("

    You must enter a default Account for this " "Site before saving it.")) << GuiErrorCheck(_transit->isChecked() && ! _costcat->isValid(), _costcat, tr("

    You must select a Cost Category for this " "Transit Site before saving it.")) ; XSqlQuery ctq; if (_mode != cNew) { ctq.prepare( "SELECT warehous_id " "FROM whsinfo " "WHERE ( (warehous_counttag_prefix=:prefix)" " AND (warehous_id<>:warehous_id) );" ); ctq.bindValue(":warehous_id", _warehousid); } else ctq.prepare( "SELECT warehous_id " "FROM whsinfo " "WHERE (warehous_counttag_prefix=:prefix)" ); ctq.bindValue(":prefix", _countTagPrefix->text()); ctq.exec(); if (ctq.first()) { errors << GuiErrorCheck(true, _countTagPrefix, tr("

    The Count Tag prefix entered has been used " "in another Site. To enable Count Tag " "audits, the application requires a unique Count " "Tag prefix for each Site. Please enter a " "different Count Tag prefix." ) ); _countTagPrefix->clear(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Count Tag"), ctq, __FILE__, __LINE__)) return; XSqlQuery uniq; uniq.prepare("SELECT warehous_id " "FROM whsinfo " "WHERE ( (warehous_id<>:warehous_id)" " AND (UPPER(warehous_code)=UPPER(:warehous_code)) );" ); uniq.bindValue(":warehous_id", _warehousid); uniq.bindValue(":warehous_code", _code->text()); uniq.exec(); if (uniq.first()) { errors << GuiErrorCheck(true, _code, tr("

    The new Site information cannot be " "saved as the new Site Code that you " "entered conflicts with an existing Site. " "You must uniquely name this Site before " "you may save it." )); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Site Code"), uniq, __FILE__, __LINE__)) return; XSqlQuery activeq; if (!_active->isChecked()) { activeq.prepare( "SELECT itemsite_id " "FROM itemsite " "WHERE ( (itemsite_active)" " AND (itemsite_warehous_id=:warehous_id) );" ); activeq.bindValue(":warehous_id", _warehousid); activeq.exec(); if (activeq.first()) { errors << GuiErrorCheck(true, _active, tr("This Site is used in an active Item Site and must be marked as active. " "Deactivate the Item Sites to allow this Site to not be active.") ); _active->setFocus(); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Active Itemsites"), activeq, __FILE__, __LINE__)) return; } if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Site"), errors)) return; XSqlQuery rollback; rollback.prepare("ROLLBACK;"); XSqlQuery begin("BEGIN"); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving"), begin, __FILE__, __LINE__)) return; int saveResult = _address->save(AddressCluster::CHECK); if (-2 == saveResult) { int answer = QMessageBox::question(this, tr("Question Saving Address"), tr("

    There are multiple uses of this Site Address.

    " "

    What would you like to do?

    "), tr("Change This One"), tr("Change Address for All"), tr("Cancel"), 2, 2); if (0 == answer) saveResult = _address->save(AddressCluster::CHANGEONE); else if (1 == answer) saveResult = _address->save(AddressCluster::CHANGEALL); } if (saveResult < 0) // not else-if: this is error check for CHANGE{ONE,ALL} { rollback.exec(); systemError(this, tr("There was an error saving this address (%1).\n" "Check the database server log for errors.") .arg(saveResult), __FILE__, __LINE__); _address->setFocus(); return; } XSqlQuery upsq; if (_mode == cNew) upsq.prepare( "INSERT INTO whsinfo " "( warehous_id, warehous_code, warehous_descrip," " warehous_cntct_id, warehous_fob, warehous_active," " warehous_bol_prefix, warehous_bol_number, warehous_shipping," " warehous_counttag_prefix, warehous_counttag_number, warehous_useslips," " warehous_aislesize, warehous_aislealpha," " warehous_racksize, warehous_rackalpha," " warehous_binsize, warehous_binalpha," " warehous_locationsize, warehous_locationalpha," " warehous_enforcearbl, warehous_usezones, " " warehous_default_accnt_id, warehous_shipping_commission, " " warehous_addr_id, warehous_taxzone_id, warehous_transit," " warehous_shipform_id, warehous_shipvia_id," " warehous_shipcomments, warehous_costcat_id, warehous_sitetype_id," " warehous_sequence ) " "VALUES " "( :warehous_id, :warehous_code, :warehous_descrip," " :warehous_cntct_id, :warehous_fob, :warehous_active," " :warehous_bol_prefix, :warehous_bol_number, :warehous_shipping," " :warehous_counttag_prefix, :warehous_counttag_number, :warehous_useslips," " :warehous_aislesize, :warehous_aislealpha," " :warehous_racksize, :warehous_rackalpha," " :warehous_binsize, :warehous_binalpha," " :warehous_locationsize, :warehous_locationalpha," " :warehous_enforcearbl, :warehous_usezones, " " :warehous_default_accnt_id, :warehous_shipping_commission, " " :warehous_addr_id, :warehous_taxzone_id, :warehous_transit," " :warehous_shipform_id, :warehous_shipvia_id," " :warehous_shipcomments, :warehous_costcat_id, :warehous_sitetype_id," " :warehous_sequence );" ); else if (_mode == cEdit) upsq.prepare( "UPDATE whsinfo " "SET warehous_code=:warehous_code," " warehous_descrip=:warehous_descrip," " warehous_cntct_id=:warehous_cntct_id, " " warehous_fob=:warehous_fob," " warehous_active=:warehous_active," " warehous_bol_prefix=:warehous_bol_prefix," " warehous_bol_number=:warehous_bol_number," " warehous_shipping=:warehous_shipping," " warehous_counttag_prefix=:warehous_counttag_prefix," " warehous_counttag_number=:warehous_counttag_number," " warehous_useslips=:warehous_useslips," " warehous_aislesize=:warehous_aislesize," " warehous_aislealpha=:warehous_aislealpha," " warehous_racksize=:warehous_racksize," " warehous_rackalpha=:warehous_rackalpha," " warehous_binsize=:warehous_binsize," " warehous_binalpha=:warehous_binalpha," " warehous_locationsize=:warehous_locationsize," " warehous_locationalpha=:warehous_locationalpha," " warehous_enforcearbl=:warehous_enforcearbl," " warehous_usezones=:warehous_usezones," " warehous_default_accnt_id=:warehous_default_accnt_id, " " warehous_shipping_commission=:warehous_shipping_commission," " warehous_addr_id=:warehous_addr_id," " warehous_taxzone_id=:warehous_taxzone_id," " warehous_transit=:warehous_transit," " warehous_shipform_id=:warehous_shipform_id," " warehous_shipvia_id=:warehous_shipvia_id," " warehous_shipcomments=:warehous_shipcomments," " warehous_costcat_id=:warehous_costcat_id, " " warehous_sitetype_id=:warehous_sitetype_id," " warehous_sequence=:warehous_sequence " "WHERE (warehous_id=:warehous_id);" ); upsq.bindValue(":warehous_id", _warehousid); upsq.bindValue(":warehous_code", _code->text().trimmed().toUpper()); upsq.bindValue(":warehous_descrip", _description->text()); if (_contact->id() > 0) upsq.bindValue(":warehous_cntct_id", _contact->id()); // else NULL if (_address->id() > 0) upsq.bindValue(":warehous_addr_id", _address->id()); // else NULL upsq.bindValue(":warehous_active", QVariant(_active->isChecked())); upsq.bindValue(":warehous_default_accnt_id", _account->id()); if(_sitetype->isValid()) upsq.bindValue(":warehous_sitetype_id", _sitetype->id()); upsq.bindValue(":warehous_sequence", _sequence->value()); if (_standard->isChecked()) { upsq.bindValue(":warehous_fob", _defaultFOB->text()); upsq.bindValue(":warehous_bol_prefix", _bolPrefix->text()); upsq.bindValue(":warehous_bol_number", _bolNumber->text().toInt()); upsq.bindValue(":warehous_counttag_prefix", _countTagPrefix->text()); upsq.bindValue(":warehous_counttag_number", _countTagNumber->text().toInt()); upsq.bindValue(":warehous_shipping", QVariant(_shipping->isChecked())); upsq.bindValue(":warehous_useslips", QVariant(_useSlips->isChecked())); upsq.bindValue(":warehous_enforcearbl",QVariant(_arblGroup->isChecked())); upsq.bindValue(":warehous_aislesize", _aisleSize->value()); upsq.bindValue(":warehous_aislealpha", QVariant(_aisleAlpha->isChecked())); upsq.bindValue(":warehous_racksize", _rackSize->value()); upsq.bindValue(":warehous_rackalpha", QVariant(_rackAlpha->isChecked())); upsq.bindValue(":warehous_binsize", _binSize->value()); upsq.bindValue(":warehous_binalpha", QVariant(_binAlpha->isChecked())); upsq.bindValue(":warehous_locationsize", _locationSize->value()); upsq.bindValue(":warehous_locationalpha", QVariant(_locationAlpha->isChecked())); upsq.bindValue(":warehous_usezones", QVariant(_useZones->isChecked())); upsq.bindValue(":warehous_shipping_commission", (_shipcomm->toDouble() / 100)); if(_taxzone->isValid()) upsq.bindValue(":warehous_taxzone_id", _taxzone->id()); } upsq.bindValue(":warehous_transit", QVariant(_transit->isChecked())); if (_transit->isChecked()) { if (_shipform->isValid()) upsq.bindValue(":warehous_shipform_id", _shipform->id()); if (_shipvia->isValid()) upsq.bindValue(":warehous_shipvia_id", _shipvia->id()); upsq.bindValue(":warehous_shipcomments", _shipcomments->toPlainText()); if (_costcat->isValid()) upsq.bindValue(":warehous_costcat_id", _costcat->id()); } upsq.exec(); if (upsq.lastError().type() != QSqlError::NoError) { rollback.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving"), upsq, __FILE__, __LINE__); return; } XSqlQuery commit("COMMIT;"); omfgThis->sWarehousesUpdated(); emit saved(_warehousid); done(_warehousid); } void warehouse::populate() { XSqlQuery getq; getq.prepare( "SELECT *, formatScrap(warehous_shipping_commission) AS f_commission " "FROM whsinfo " "WHERE (warehous_id=:warehous_id);" ); getq.bindValue(":warehous_id", _warehousid); getq.exec(); if (getq.first()) { _code->setText(getq.value("warehous_code")); _sitetype->setId(getq.value("warehous_sitetype_id").toInt()); _active->setChecked(getq.value("warehous_active").toBool()); _description->setText(getq.value("warehous_descrip")); _contact->setId(getq.value("warehous_cntct_id").toInt()); _address->setId(getq.value("warehous_addr_id").toInt()); _defaultFOB->setText(getq.value("warehous_fob")); _bolPrefix->setText(getq.value("warehous_bol_prefix")); _bolNumber->setText(getq.value("warehous_bol_number")); _shipping->setChecked(getq.value("warehous_shipping").toBool()); _countTagPrefix->setText(getq.value("warehous_counttag_prefix")); _countTagNumber->setText(getq.value("warehous_counttag_number")); _useSlips->setChecked(getq.value("warehous_useslips").toBool()); _arblGroup->setChecked(getq.value("warehous_enforceARBL").toBool()); _aisleSize->setValue(getq.value("warehous_aislesize").toInt()); _aisleAlpha->setChecked(getq.value("warehous_aislealpha").toBool()); _rackSize->setValue(getq.value("warehous_racksize").toInt()); _rackAlpha->setChecked(getq.value("warehous_rackalpha").toBool()); _binSize->setValue(getq.value("warehous_binsize").toInt()); _binAlpha->setChecked(getq.value("warehous_binalpha").toBool()); _locationSize->setValue(getq.value("warehous_locationsize").toInt()); _locationAlpha->setChecked(getq.value("warehous_locationalpha").toBool()); _useZones->setChecked(getq.value("warehous_usezones").toBool()); _account->setId(getq.value("warehous_default_accnt_id").toInt()); _shipcomm->setText(getq.value("f_commission").toString()); _taxzone->setId(getq.value("warehous_taxzone_id").toInt()); _transit->setChecked(getq.value("warehous_transit").toBool()); _shipform->setId(getq.value("warehous_shipform_id").toInt()); _shipvia->setId(getq.value("warehous_shipvia_id").toInt()); _shipcomments->setText(getq.value("warehous_shipcomments").toString()); _costcat->setId(getq.value("warehous_costcat_id").toInt()); _sequence->setValue(getq.value("warehous_sequence").toInt()); sFillList(); _comments->setId(_warehousid); emit populated(); emit newId(_warehousid); } } void warehouse::sCheck() { XSqlQuery warehouseCheck; _code->setText(_code->text().trimmed().toUpper()); if (_mode == cNew) { warehouseCheck.prepare( "SELECT warehous_id " "FROM whsinfo " "WHERE (UPPER(warehous_code)=UPPER(:warehous_code));" ); warehouseCheck.bindValue(":warehous_code", _code->text()); warehouseCheck.exec(); if (warehouseCheck.first()) { _warehousid = warehouseCheck.value("warehous_id").toInt(); _mode = cEdit; populate(); emit newMode(_mode); _code->setEnabled(FALSE); } else { if (_countTagPrefix->text().trimmed().length() == 0) _countTagPrefix->setText(_code->text()); if (_bolPrefix->text().trimmed().length() == 0) _bolPrefix->setText(_code->text()); } } } void warehouse::sNewZone() { ParameterList params; params.append("warehous_id", _warehousid); params.append("mode", "new"); warehouseZone newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void warehouse::sEditZone() { ParameterList params; params.append("whsezone_id", _whsezone->id()); params.append("mode", "edit"); warehouseZone newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) sFillList(); } void warehouse::sDeleteZone() { XSqlQuery warehouseDeleteZone; warehouseDeleteZone.prepare( "SELECT location_id " "FROM location " "WHERE (location_whsezone_id=:whsezone_id);" ); warehouseDeleteZone.bindValue(":whsezone_id", _whsezone->id()); warehouseDeleteZone.exec(); if (warehouseDeleteZone.first()) { QMessageBox::warning( this, tr("Cannot Delete Site Zone"), tr( "

    The selected Site Zone cannot be " "deleted as one or more Site Locations have " "been assigned to it. You must delete or reassign " "these Site Location before you may delete " "the selected Site Zone." ) ); return; } else if (warehouseDeleteZone.lastError().type() != QSqlError::NoError) { systemError(this, warehouseDeleteZone.lastError().databaseText(), __FILE__, __LINE__); return; } warehouseDeleteZone.prepare( "DELETE FROM whsezone " "WHERE (whsezone_id=:whsezone_id);" ); warehouseDeleteZone.bindValue(":whsezone_id", _whsezone->id()); warehouseDeleteZone.exec(); if (warehouseDeleteZone.lastError().type() != QSqlError::NoError) { systemError(this, warehouseDeleteZone.lastError().databaseText(), __FILE__, __LINE__); return; } sFillList(); } void warehouse::sFillList() { XSqlQuery warehouseFillList; warehouseFillList.prepare( "SELECT whsezone_id, whsezone_name, whsezone_descrip " "FROM whsezone " "WHERE (whsezone_warehous_id=:warehous_id) " "ORDER BY whsezone_name;" ); warehouseFillList.bindValue(":warehous_id", _warehousid); warehouseFillList.exec(); _whsezone->populate(warehouseFillList); if (warehouseFillList.lastError().type() != QSqlError::NoError) { systemError(this, warehouseFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void warehouse::sHandleWhsType() { if (_standard->isChecked()) { _whsTypeStack->setCurrentIndex(0); _locationsTab->setEnabled(true); } else if (_transit->isChecked()) { _whsTypeStack->setCurrentIndex(1); _locationsTab->setEnabled(false); } } qt-client-4.1.0/guiclient/warehouse.h000066400000000000000000000025761217451700100175620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef WAREHOUSE_H #define WAREHOUSE_H #include "guiclient.h" #include "xdialog.h" #include "contactcluster.h" #include "ui_warehouse.h" class warehouse : public XDialog, public Ui::warehouse { Q_OBJECT public: warehouse(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~warehouse(); Q_INVOKABLE virtual int id() const; Q_INVOKABLE virtual int mode() const; public slots: virtual enum SetResponse set(const ParameterList & pParams ); virtual void populate(); virtual void sCheck(); virtual void sDeleteZone(); virtual void sEditZone(); virtual void sFillList(); virtual void sHandleWhsType(); virtual void sNewZone(); signals: void newId(int); void newMode(int); void populated(); void saved(int); protected slots: virtual void languageChange(); virtual void sSave(); private: int _mode; int _warehousid; }; #endif // WAREHOUSE_H qt-client-4.1.0/guiclient/warehouse.ui000066400000000000000000001260761217451700100177520ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. warehouse 0 0 841 651 Site 12 C&ode: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _code 0 0 Type: _sitetype false XComboBox::SiteTypes &Active true Qt::Horizontal QSizePolicy::Expanding 78 19 0 0 true &Cancel &Save true false Qt::Vertical 20 20 &Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _description Qt::Horizontal 40 20 Post Unassigned Transactions to: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _save Qt::Horizontal 78 22 _accountLit _account horizontalSpacer_5 0 General 0 Shipping Commission: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Tax Zone: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true None XComboBox::TaxZones Qt::Horizontal QSizePolicy::MinimumExpanding 0 17 Default &F.O.B.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _defaultFOB Qt::Horizontal 40 20 Qt::Horizontal 40 20 _shipcommlit _taxzoneLit _defaultFOBLit Shipping &Site true Force the use of Count Slips Enforce the use of Zones Next &Bill of Lading #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _bolPrefix 0 0 60 32767 true 0 0 100 32767 Qt::Horizontal 40 20 Next Count &Tag #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _countTagPrefix 0 0 60 32767 true 0 0 100 32767 Qt::Horizontal 40 20 Qt::Vertical 17 64 Scheduling Sequence: _sitetype Qt::Horizontal 40 20 Qt::Vertical 20 40 Default Ship-Via: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::ShipVias Qt::Horizontal 40 20 Default Shipping Form: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _shipform true XComboBox::ShippingForms XComboBox::None Qt::Horizontal 40 20 Default Cost Category: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _costcat true XComboBox::CostCategories Qt::Horizontal 40 20 0 Shipping Comments: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Inventory Site true Transit Site Qt::Vertical 20 0 _whsTypeStack Contact true Qt::Horizontal 40 20 Qt::Vertical 20 133 Site Locations Enforce ARBL Naming Convention true Aisle Size: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 0 0 Allow Alpha Characters Rack Size: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 0 0 Allow Alpha Characters Bin Size: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 0 0 Allow Alpha Characters Location Size: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 40 0 0 0 Allow Alpha Characters Qt::Horizontal 248 20 Qt::Vertical 20 40 Site Zones 8 0 0 0 100 0 0 &New false &Edit false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 Comments Comments::Warehouse AddressCluster QWidget

    addresscluster.h
    Comments QWidget
    comments.h
    ContactCluster QWidget
    contactcluster.h
    GLCluster QWidget
    glcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XSpinBox QSpinBox
    xspinbox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _code _sitetype _active _description _account _bolPrefix _bolNumber _countTagPrefix _countTagNumber _shipping _useSlips _useZones _taxzone _defaultFOB _tab _shipform _shipcomments _arblGroup _aisleSize _aisleAlpha _rackSize _rackAlpha _binSize _binAlpha _locationSize _locationAlpha _whsezone _new _edit _delete _save _close _close clicked() warehouse reject() 20 20 20 20 qt-client-4.1.0/guiclient/warehouseZone.cpp000066400000000000000000000142121217451700100207370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "warehouseZone.h" #include #include #include #include "errorReporter.h" #include "guiErrorCheck.h" warehouseZone::warehouseZone(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_name, SIGNAL(editingFinished()), this, SLOT(sCheck())); } warehouseZone::~warehouseZone() { // no need to delete child widgets, Qt does it all for us } void warehouseZone::languageChange() { retranslateUi(this); } enum SetResponse warehouseZone::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("warehous_id", &valid); if (valid) _warehousid = param.toInt(); param = pParams.value("whsezone_id", &valid); if (valid) { _whsezoneid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _description->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void warehouseZone::sSave() { QList errors; errors << GuiErrorCheck(_name->text().trimmed().isEmpty(), _name, tr("

    You must enter a valid name before saving " "this Site Zone.")) ; XSqlQuery uniq; uniq.prepare("SELECT whsezone_id " "FROM whsezone " "WHERE ( (whsezone_id<>:whsezone_id)" " AND (UPPER(whsezone_name)=UPPER(:whsezone_name)) " " AND (whsezone_warehous_id=(:warehouse_id)));" ); uniq.bindValue(":whsezone_id", _whsezoneid); uniq.bindValue(":whsezone_name", _name->text()); uniq.bindValue(":warehouse_id", _warehousid); uniq.exec(); if (uniq.first()) { errors << GuiErrorCheck(true, _name, tr("

    The Site Zone information cannot be " "saved as the Site Zone Name that you " "entered conflicts with an existing Site Zone. " "You must uniquely name this Site Zone before " "you may save it." )); } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Checking Site Zone Name"), uniq, __FILE__, __LINE__)) return; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Site Zone"), errors)) return; XSqlQuery warehouseSave; if (_mode == cNew) { warehouseSave.prepare("SELECT NEXTVAL('whsezone_whsezone_id_seq') AS whsezone_id"); warehouseSave.exec(); if (warehouseSave.first()) _whsezoneid = warehouseSave.value("whsezone_id").toInt(); else if (warehouseSave.lastError().type() != QSqlError::NoError) { systemError(this, warehouseSave.lastError().databaseText(), __FILE__, __LINE__); return; } warehouseSave.prepare( "INSERT INTO whsezone " "(whsezone_id, whsezone_warehous_id, whsezone_name, whsezone_descrip) " "VALUES " "(:whsezone_id, :warehous_id, :whsezone_name, :whsezone_descrip);" ); } else if (_mode == cEdit) warehouseSave.prepare( "UPDATE whsezone " "SET whsezone_warehous_id=:warehous_id," " whsezone_name=:whsezone_name, whsezone_descrip=:whsezone_descrip " "WHERE (whsezone_id=:whsezone_id);" ); warehouseSave.bindValue(":whsezone_id", _whsezoneid); warehouseSave.bindValue(":warehous_id", _warehousid); warehouseSave.bindValue(":whsezone_name", _name->text()); warehouseSave.bindValue(":whsezone_descrip", _description->text()); warehouseSave.exec(); if (warehouseSave.lastError().type() != QSqlError::NoError) { systemError(this, warehouseSave.lastError().databaseText(), __FILE__, __LINE__); return; } done(_whsezoneid); } void warehouseZone::sCheck() { XSqlQuery warehouseCheck; _name->setText(_name->text().trimmed()); if ( (_mode == cNew) && (_name->text().length()) ) { warehouseCheck.prepare( "SELECT whsezone_id " "FROM whsezone " "WHERE ( (whsezone_warehous_id=:warehous_id)" " AND (UPPER(whsezone_name)=UPPER(:whsezone_name)) );" ); warehouseCheck.bindValue(":warehous_id", _warehousid); warehouseCheck.bindValue(":whsezone_name", _name->text()); warehouseCheck.exec(); if (warehouseCheck.first()) { _whsezoneid = warehouseCheck.value("whsezone_id").toInt(); _mode = cEdit; populate(); _name->setEnabled(FALSE); } else if (warehouseCheck.lastError().type() != QSqlError::NoError) { systemError(this, warehouseCheck.lastError().databaseText(), __FILE__, __LINE__); return; } } } void warehouseZone::populate() { XSqlQuery warehousepopulate; warehousepopulate.prepare( "SELECT whsezone_warehous_id, whsezone_name, whsezone_descrip " "FROM whsezone " "WHERE (whsezone_id=:whsezone_id);" ); warehousepopulate.bindValue(":whsezone_id", _whsezoneid); warehousepopulate.exec(); if (warehousepopulate.first()) { _warehousid = warehousepopulate.value("whsezone_warehous_id").toInt(); _name->setText(warehousepopulate.value("whsezone_name").toString()); _description->setText(warehousepopulate.value("whsezone_descrip").toString()); } else if (warehousepopulate.lastError().type() != QSqlError::NoError) { systemError(this, warehousepopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } qt-client-4.1.0/guiclient/warehouseZone.h000066400000000000000000000021271217451700100204060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef WAREHOUSEZONE_H #define WAREHOUSEZONE_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_warehouseZone.h" class warehouseZone : public XDialog, public Ui::warehouseZone { Q_OBJECT public: warehouseZone(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~warehouseZone(); public slots: virtual SetResponse set(const ParameterList & pParams); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sCheck(); private: int _mode; int _whsezoneid; int _warehousid; }; #endif // WAREHOUSEZONE_H qt-client-4.1.0/guiclient/warehouseZone.ui000066400000000000000000000176551217451700100206100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. warehouseZone 0 0 430 90 Site Zone 5 7 0 0 0 5 0 5 &Name: Qt::AlignVCenter|Qt::AlignRight _name &Description: Qt::AlignVCenter|Qt::AlignRight _description 0 5 0 0 5 0 0 0 20 20 Expanding Horizontal 20 20 Expanding Vertical 0 0 0 5 &Cancel true &Save true true 20 0 Expanding Vertical _name _description _save _close parameter.h _close clicked() warehouseZone reject() qt-client-4.1.0/guiclient/warehouses.cpp000066400000000000000000000107471217451700100202770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "warehouses.h" #include #include #include #include #include #include #include "itemSites.h" #include "warehouse.h" warehouses::warehouses(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_print, SIGNAL(clicked()), this, SLOT(sPrint())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_warehouse, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*))); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_showInactive, SIGNAL(toggled(bool)), this, SLOT(sFillList())); _warehouse->addColumn(tr("Site"), _whsColumn, Qt::AlignCenter, true, "warehous_code" ); _warehouse->addColumn(tr("Active"), _ynColumn, Qt::AlignCenter, true, "warehous_active" ); _warehouse->addColumn(tr("Type"), _whsColumn, Qt::AlignCenter, true, "sitetype_name" ); _warehouse->addColumn(tr("Description"), 130, Qt::AlignLeft, true, "warehous_descrip" ); _warehouse->addColumn(tr("Address"), -1, Qt::AlignLeft, true, "addr_line1" ); if (_privileges->check("MaintainWarehouses")) { connect(_warehouse, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_warehouse, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_warehouse, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } connect(omfgThis, SIGNAL(warehousesUpdated()), SLOT(sFillList()) ); sFillList(); } warehouses::~warehouses() { // no need to delete child widgets, Qt does it all for us } void warehouses::languageChange() { retranslateUi(this); } void warehouses::sNew() { ParameterList params; params.append("mode", "new"); warehouse newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void warehouses::sView() { ParameterList params; params.append("mode", "view"); params.append("warehous_id", _warehouse->id()); warehouse newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void warehouses::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("warehous_id", _warehouse->id()); warehouse newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void warehouses::setParams(ParameterList & params) { if (_showInactive->isChecked()) params.append("showInactive"); } void warehouses::sFillList() { QString whss = "SELECT warehous_id, warehous_code," " warehous_active, sitetype_name," " warehous_descrip, addr_line1 " "FROM site() LEFT OUTER JOIN addr ON (addr_id=warehous_addr_id) " " LEFT OUTER JOIN sitetype ON (sitetype_id=warehous_sitetype_id) " "WHERE ((TRUE) " "" " AND (warehous_active) " "" ") ORDER BY warehous_code;" ; ParameterList whsp; setParams(whsp); MetaSQLQuery whsm(whss); XSqlQuery whsq = whsm.toQuery(whsp); _warehouse->populate(whsq); } void warehouses::sListItemSites() { ParameterList params; params.append("run"); params.append("warehous_id", _warehouse->id()); itemSites *newdlg = new itemSites(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void warehouses::sPopulateMenu( QMenu * pMenu ) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem->setEnabled(_privileges->check("MaintainWarehouses")); pMenu->addAction(tr("View..."), this, SLOT(sView())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("List Item Sites..."), this, SLOT(sListItemSites())); menuItem->setEnabled(_privileges->check("ViewItemSites")); } void warehouses::sPrint() { ParameterList params; setParams(params); orReport report("WarehouseMasterList", params); if (report.isValid()) report.print(); else report.reportError(this); } qt-client-4.1.0/guiclient/warehouses.h000066400000000000000000000021501217451700100177310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef WAREHOUSES_H #define WAREHOUSES_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_warehouses.h" class warehouses : public XWidget, public Ui::warehouses { Q_OBJECT public: warehouses(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~warehouses(); public slots: virtual void sNew(); virtual void sView(); virtual void sEdit(); virtual void sFillList(); virtual void sListItemSites(); virtual void sPopulateMenu( QMenu * pMenu ); virtual void sPrint(); virtual void setParams(ParameterList &); protected slots: virtual void languageChange(); }; #endif // WAREHOUSES_H qt-client-4.1.0/guiclient/warehouses.ui000066400000000000000000000167361217451700100201360ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. warehouses 0 0 458 297 List Sites 5 0 0 0 46 11 Expanding Horizontal Show &Inactive Sites 0 0 Sites: 0 0 0 5 0 5 &Close &Print 0 0 &New false &Edit false &View 20 20 Expanding Vertical XTreeWidget QTreeWidget

    xtreewidget.h
    0 _showInactive _warehouse _new _edit _view _print _close parameter.h _close clicked() warehouses close() _warehouse valid(bool) _view setEnabled(bool) qt-client-4.1.0/guiclient/welcomeStub.cpp000066400000000000000000000025101217451700100203700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "welcomeStub.h" #include #include #include welcomeStub::welcomeStub(QWidget* parent, Qt::WindowFlags f) : QDialog(parent, f) { setupUi(this); QString url = "http://www.xtuple.org/translate"; int iconSize = style()->pixelMetric(QStyle::PM_MessageBoxIconSize); iconLabel->setPixmap(style()->standardIcon(QStyle::SP_MessageBoxInformation).pixmap(iconSize, iconSize)); label->setText(tr("

    It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:

    %1

    ").arg(url)); adjustSize(); } welcomeStub::~welcomeStub() { // no need to delete child widgets, Qt does it all for us } void welcomeStub::languageChange() { retranslateUi(this); } qt-client-4.1.0/guiclient/welcomeStub.h000066400000000000000000000014301217451700100200350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WELCOMESTUB_H__ #define __WELCOMESTUB_H__ #include #include "ui_welcomeStub.h" class welcomeStub : public QDialog, public Ui::welcomeStub { Q_OBJECT public: welcomeStub(QWidget* parent = 0, Qt::WindowFlags f = 0); ~welcomeStub(); protected slots: virtual void languageChange(); }; #endif // IDLESHUTDOWN_H qt-client-4.1.0/guiclient/welcomeStub.ui000066400000000000000000000057151217451700100202350ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. welcomeStub 0 0 209 96 Welcome InfoIcon Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop 1 0 Set In Class Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop true true Do not show again. Qt::Horizontal QDialogButtonBox::Ok buttonBox accepted() welcomeStub accept() 227 279 157 274 buttonBox rejected() welcomeStub reject() 295 285 286 274 qt-client-4.1.0/guiclient/woMaterialItem.cpp000066400000000000000000000304701217451700100210300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "woMaterialItem.h" #include #include #include #include #include "inputManager.h" #include "errorReporter.h" woMaterialItem::woMaterialItem(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _bomitemid=-1; _wooperid=-1; connect(_qtyFxd, SIGNAL(textChanged(const QString&)), this, SLOT(sUpdateQtyRequired())); connect(_qtyPer, SIGNAL(textChanged(const QString&)), this, SLOT(sUpdateQtyRequired())); connect(_scrap, SIGNAL(textChanged(const QString&)), this, SLOT(sUpdateQtyRequired())); connect(_item, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_item, SIGNAL(newId(int)), this, SLOT(sItemIdChanged())); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); _captive = FALSE; _wo->setType(cWoOpen | cWoExploded | cWoIssued | cWoReleased); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _qtyFxd->setValidator(omfgThis->qtyVal()); _qtyPer->setValidator(omfgThis->qtyPerVal()); _scrap->setValidator(omfgThis->scrapVal()); _qtyRequired->setPrecision(omfgThis->qtyVal()); QString issueMethod = _metrics->value("DefaultWomatlIssueMethod"); if (issueMethod == "S") _issueMethod->setCurrentIndex(0); else if (issueMethod == "L") _issueMethod->setCurrentIndex(1); else if (issueMethod == "M") _issueMethod->setCurrentIndex(2); } woMaterialItem::~woMaterialItem() { // no need to delete child widgets, Qt does it all for us } void woMaterialItem::languageChange() { retranslateUi(this); } enum SetResponse woMaterialItem::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setReadOnly(TRUE); } param = pParams.value("bomitem_id", &valid); if (valid) _bomitemid=param.toInt(); param = pParams.value("item_id", &valid); if (valid) { _captive = TRUE; _item->setId(param.toInt()); _item->setReadOnly(TRUE); } param = pParams.value("wooper_id", &valid); if (valid) _wooperid=param.toInt(); param = pParams.value("qtyFxd", &valid); if (valid) _qtyFxd->setText(param.toDouble()); param = pParams.value("qtyPer", &valid); if (valid) _qtyPer->setText(param.toDouble()); param = pParams.value("uom_id", &valid); if (valid) _uom->setId(param.toInt()); param = pParams.value("scrap", &valid); if (valid) _scrap->setText(param.toDouble()); param = pParams.value("issueMethod", &valid); if (valid) { if (param.toString() == "push") _issueMethod->setCurrentIndex(0); else if (param.toString() == "pull") _issueMethod->setCurrentIndex(1); else if (param.toString() == "mixed") _issueMethod->setCurrentIndex(2); } param = pParams.value("notes", &valid); if (valid) _notes->setText(param.toString()); param = pParams.value("reference", &valid); if (valid) _ref->setText(param.toString()); param = pParams.value("picklist", &valid); if (valid) _pickList->setChecked(param.toBool()); param = pParams.value("womatl_id", &valid); if (valid) { _captive = TRUE; _wo->setEnabled(FALSE); _item->setEnabled(FALSE); _womatlid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; if (_wo->id() >= 0) _wo->setEnabled(false); _item->setType(ItemLineEdit::cActive); _item->addExtraClause( QString("(itemsite_active)") ); // ItemLineEdit::cActive doesn't compare against the itemsite record } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _wo->setEnabled(FALSE); _item->setEnabled(FALSE); _qtyFxd->setEnabled(FALSE); _qtyPer->setEnabled(FALSE); _uom->setEnabled(FALSE); _scrap->setEnabled(FALSE); _issueMethod->setEnabled(FALSE); _notes->setEnabled(FALSE); _ref->setEnabled(FALSE); _close->setText(tr("&Close")); _save->hide(); } } return NoError; } void woMaterialItem::sSave() { XSqlQuery woSave; QString issueMethod; switch (_issueMethod->currentIndex()) { case 0: issueMethod = 'S'; break; case 1: issueMethod = 'L'; break; case 2: issueMethod = 'M'; break; } if (_mode == cNew) { woSave.prepare( "SELECT component.itemsite_id AS itemsiteid " "FROM wo, itemsite AS parent, itemsite AS component " "WHERE ( (parent.itemsite_warehous_id=component.itemsite_warehous_id)" " AND (parent.itemsite_id=wo_itemsite_id)" " AND (component.itemsite_item_id=:item_id)" " AND (wo_id=:wo_id) );" ); woSave.bindValue(":item_id", _item->id()); woSave.bindValue(":wo_id", _wo->id()); woSave.exec(); if (!woSave.first()) { QMessageBox::warning( this, tr("Cannot Create W/O Material Requirement"), tr( "A W/O Material Requirement cannot be created for the selected\n" "Work Order/Item as the selected Item does not exist in the warehouse\n" "that the selected Work Order does." )); _item->setId(-1); _item->setFocus(); return; } int itemsiteid = woSave.value("itemsiteid").toInt(); woSave.prepare("SELECT createWoMaterial(:wo_id, :itemsite_id, :issueMethod," " :uom_id, :qtyFxd, :qtyPer," " :scrap, :bomitem_id, :notes," " :ref, :wooper_id, :picklist) AS womatlid;"); woSave.bindValue(":wo_id", _wo->id()); woSave.bindValue(":itemsite_id", itemsiteid); woSave.bindValue(":issueMethod", issueMethod); woSave.bindValue(":qtyFxd", _qtyFxd->toDouble()); woSave.bindValue(":qtyPer", _qtyPer->toDouble()); woSave.bindValue(":uom_id", _uom->id()); woSave.bindValue(":scrap", (_scrap->toDouble() / 100)); woSave.bindValue(":bomitem_id", _bomitemid); woSave.bindValue(":notes", _notes->toPlainText()); woSave.bindValue(":ref", _ref->toPlainText()); woSave.bindValue(":wooper_id", _wooperid); woSave.bindValue(":picklist", QVariant(_pickList->isChecked())); woSave.exec(); if (woSave.first()) { _womatlid = woSave.value("womatlid").toInt(); } else if (woSave.lastError().type() != QSqlError::NoError) { ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving"), woSave, __FILE__, __LINE__); return; } } else if (_mode == cEdit) { woSave.prepare( "UPDATE womatl " "SET womatl_qtyfxd=:qtyFxd," " womatl_qtyper=:qtyPer," " womatl_scrap=:scrap," " womatl_issuemethod=:issueMethod," " womatl_uom_id=:uom_id," " womatl_qtyreq=:qtyReq," " womatl_notes=:notes," " womatl_ref=:ref," " womatl_picklist=:picklist " "WHERE (womatl_id=:womatl_id);" ); woSave.bindValue(":womatl_id", _womatlid); woSave.bindValue(":issueMethod", issueMethod); woSave.bindValue(":qtyFxd", _qtyFxd->toDouble()); woSave.bindValue(":qtyPer", _qtyPer->toDouble()); woSave.bindValue(":qtyReq", _qtyRequired->toDouble()); woSave.bindValue(":uom_id", _uom->id()); woSave.bindValue(":scrap", (_scrap->toDouble() / 100)); woSave.bindValue(":notes", _notes->toPlainText()); woSave.bindValue(":ref", _ref->toPlainText()); woSave.bindValue(":picklist", QVariant(_pickList->isChecked())); woSave.exec(); if (woSave.lastError().type() != QSqlError::NoError) { ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving"), woSave, __FILE__, __LINE__); return; } } omfgThis->sWorkOrderMaterialsUpdated(_wo->id(), _womatlid, TRUE); if (_captive) done(_womatlid); else { _item->setId(-1); _qtyFxd->clear(); _qtyPer->clear(); _qtyRequired->clear(); _scrap->clear(); _item->setFocus(); _notes->clear(); _ref->clear(); _pickList->setChecked(false); } } void woMaterialItem::sUpdateQtyRequired() { XSqlQuery qtyreq; qtyreq.prepare("SELECT roundQty(itemuomfractionalbyuom(:item_id, :uom_id)," " (:qtyfxd + :qtyper * :qtyord) * (1 + :scrap)) AS qtyreq;"); qtyreq.bindValue(":item_id", _item->id()); qtyreq.bindValue(":uom_id", _uom->id()); qtyreq.bindValue(":qtyord", _wo->qtyOrdered()); qtyreq.bindValue(":qtyfxd", _qtyFxd->toDouble()); qtyreq.bindValue(":qtyper", _qtyPer->toDouble()); qtyreq.bindValue(":scrap", (_scrap->toDouble() / 100.0)); qtyreq.exec(); if(qtyreq.first()) _qtyRequired->setDouble(qtyreq.value("qtyreq").toDouble()); } void woMaterialItem::populate() { XSqlQuery wopopulate; wopopulate.prepare( "SELECT womatl.*, itemsite_item_id," " womatl_scrap * 100 AS scrap " "FROM womatl JOIN itemsite ON (womatl_itemsite_id=itemsite_id) " "WHERE (womatl_id=:womatl_id);" ); wopopulate.bindValue(":womatl_id", _womatlid); wopopulate.exec(); if (wopopulate.first()) { _wo->setId(wopopulate.value("womatl_wo_id").toInt()); _item->setId(wopopulate.value("itemsite_item_id").toInt()); _qtyFxd->setDouble(wopopulate.value("womatl_qtyfxd").toDouble()); _qtyPer->setDouble(wopopulate.value("womatl_qtyper").toDouble()); _uom->setId(wopopulate.value("womatl_uom_id").toInt()); _scrap->setDouble(wopopulate.value("scrap").toDouble()); _notes->setText(wopopulate.value("womatl_notes").toString()); _ref->setText(wopopulate.value("womatl_ref").toString()); _pickList->setChecked(wopopulate.value("womatl_picklist").toBool()); if (wopopulate.value("womatl_issuemethod").toString() == "S") _issueMethod->setCurrentIndex(0); else if (wopopulate.value("womatl_issuemethod").toString() == "L") _issueMethod->setCurrentIndex(1); else if (wopopulate.value("womatl_issuemethod").toString() == "M") _issueMethod->setCurrentIndex(2); } } void woMaterialItem::sItemIdChanged() { XSqlQuery uom; uom.prepare("SELECT uom_id, uom_name" " FROM item" " JOIN uom ON (item_inv_uom_id=uom_id)" " WHERE(item_id=:item_id)" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_to_uom_id=uom_id)" " WHERE((itemuomconv_from_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " UNION " "SELECT uom_id, uom_name" " FROM item" " JOIN itemuomconv ON (itemuomconv_item_id=item_id)" " JOIN uom ON (itemuomconv_from_uom_id=uom_id)" " WHERE((itemuomconv_to_uom_id=item_inv_uom_id)" " AND (item_id=:item_id))" " ORDER BY uom_name;"); uom.bindValue(":item_id", _item->id()); uom.exec(); _uom->populate(uom); uom.prepare("SELECT item_inv_uom_id, item_type " " FROM item" " WHERE(item_id=:item_id);"); uom.bindValue(":item_id", _item->id()); uom.exec(); if(uom.first()) { _uom->setId(uom.value("item_inv_uom_id").toInt()); if (uom.value("item_type").toString() != "T" && uom.value("item_type").toString() != "R") { if (_qtyPer->text().length() == 0) { _qtyFxd->setDouble(0.0); _qtyPer->setDouble(1.0); } } else { if (_qtyPer->text().length() == 0) { _qtyFxd->setDouble(1.0); _qtyPer->setDouble(0.0); } } if (_scrap->text().length() == 0) _scrap->setDouble(0.0); } } qt-client-4.1.0/guiclient/woMaterialItem.h000066400000000000000000000022631217451700100204740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef WOMATERIALITEM_H #define WOMATERIALITEM_H #include "guiclient.h" #include "xdialog.h" #include #include "ui_woMaterialItem.h" class woMaterialItem : public XDialog, public Ui::woMaterialItem { Q_OBJECT public: woMaterialItem(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~woMaterialItem(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void populate(); protected slots: virtual void languageChange(); virtual void sSave(); virtual void sUpdateQtyRequired(); virtual void sItemIdChanged(); private: int _bomitemid; int _mode; int _womatlid; int _wooperid; bool _captive; }; #endif // WOMATERIALITEM_H qt-client-4.1.0/guiclient/woMaterialItem.ui000066400000000000000000000416031217451700100206630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. woMaterialItem 0 0 488 588 Work Order Material Requirement 12 12 0 Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 0 20 5 &Cancel false &Save true Qt::Vertical QSizePolicy::Expanding 20 20 Component Qt::StrongFocus Qt::Horizontal QSizePolicy::Expanding 16 72 0 Details Qty. Per: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight Qt::Horizontal 40 20 Issue UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 20 20 Scrap %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 80 32767 Qt::AlignRight Qt::Horizontal 191 20 Qty. Required: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Horizontal 40 20 Issue Method: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Push Pull Mixed Qt::Horizontal 40 20 Pick List true Qt::Horizontal QSizePolicy::Expanding 0 16 Fixed Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight Qt::Horizontal 40 20 Qt::Vertical 20 0 Notes true Reference ItemCluster QWidget

    itemcluster.h
    1 WoCluster QWidget
    wocluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _wo _item _tab _qtyFxd _qtyPer _uom _scrap _issueMethod _close _save _notes _ref _item valid(bool) _save setEnabled(bool) 20 20 20 20 _close clicked() woMaterialItem reject() 20 20 20 20 qt-client-4.1.0/guiclient/workOrder.cpp000066400000000000000000002157241217451700100200720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "workOrder.h" #include #include #include #include #include "changeWoQty.h" #include "closeWo.h" #include "correctProductionPosting.h" #include "dspInventoryAvailabilityByWorkOrder.h" #include "dspRunningAvailability.h" #include "dspInventoryAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "distributeInventory.h" #include "explodeWo.h" #include "itemCharacteristicDelegate.h" #include "implodeWo.h" #include "inputManager.h" #include "issueWoMaterialItem.h" #include "postProduction.h" #include "printWoTraveler.h" #include "printWoTraveler.h" #include "returnWoMaterialBatch.h" #include "returnWoMaterialItem.h" #include "reprioritizeWo.h" #include "rescheduleWo.h" #include "returnWoMaterialItem.h" #include "storedProcErrorLookup.h" #include "substituteList.h" #include "scrapWoMaterialFromWIP.h" #include "woMaterialItem.h" #include "errorReporter.h" #include "guiErrorCheck.h" #define DEBUG false workOrder::workOrder(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { XSqlQuery workOrder; setupUi(this); connect(_close, SIGNAL(clicked()), this, SLOT(sClose())); connect(_save, SIGNAL(clicked()), this, SLOT(sSaveClicked())); connect(_warehouse, SIGNAL(newID(int)), this, SLOT(sPopulateLeadTime(int))); connect(_item, SIGNAL(newId(int)), this, SLOT(sPopulateItemChar(int))); connect(_dueDate, SIGNAL(newDate(const QDate&)), this, SLOT(sUpdateStartDate())); connect(_leadTime, SIGNAL(valueChanged(int)), this, SLOT(sUpdateStartDate())); connect(_assembly, SIGNAL(toggled(bool)), this, SLOT(sHandleButtons())); connect(_showMaterials, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_showOperations, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_indented, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_woIndentedList, SIGNAL(populateMenu(QMenu*,QTreeWidgetItem*,int)), this, SLOT(sPopulateMenu(QMenu*, QTreeWidgetItem*))); connect(_woNumber, SIGNAL(textEdited(QString)), this, SLOT(sNumberChanged())); _bomRevision->setMode(RevisionLineEdit::Use); _bomRevision->setType("BOM"); _booRevision->setMode(RevisionLineEdit::Use); _booRevision->setType("BOO"); _captive = FALSE; _planordid = -1; _woid = -1; _sense = 1; _wonumber = -1; _oldPriority = _priority->value(); _lastWarehousid = _warehouse->id(); _lastItemid = -1; _comments->setReadOnly(TRUE); _documents->setReadOnly(TRUE); _woNumber->setValidator(omfgThis->orderVal()); _qty->setValidator(omfgThis->qtyVal()); _qtyReceived->setPrecision(omfgThis->qtyVal()); _postedValue->setPrecision(omfgThis->costVal()); _wipValue->setPrecision(omfgThis->costVal()); _rcvdValue->setPrecision(omfgThis->costVal()); _printTraveler->setEnabled(_privileges->check("PrintWorkOrderPaperWork")); if (_metrics->value("WONumberGeneration") == "A") _woNumber->setFocusPolicy(Qt::NoFocus); _project->setType(ProjectLineEdit::WorkOrder); if(!_metrics->boolean("UseProjects")) _project->hide(); _itemchar = new QStandardItemModel(0, 2, this); _itemchar->setHeaderData( 0, Qt::Horizontal, tr("Name"), Qt::DisplayRole); _itemchar->setHeaderData( 1, Qt::Horizontal, tr("Value"), Qt::DisplayRole); _itemcharView->setModel(_itemchar); ItemCharacteristicDelegate * delegate = new ItemCharacteristicDelegate(this); _itemcharView->setItemDelegate(delegate); if (!_metrics->boolean("MultiWhs")) { _warehouseLit->hide(); _warehouse->hide(); } if (!_metrics->boolean("Routings")) { _booGroup->hide(); _showOperations->setChecked(false); _showOperations->hide(); } if (!_metrics->boolean("RevControl")) _tabs->removeTab(_tabs->indexOf(_revision)); if (!_privileges->boolean("ViewCosts")) { //_tabs->removeTab(_tabs->indexOf(_costing)); _costGroup->hide(); } if (_metrics->value("JobItemCosDefault") == "P") _proportional->setChecked(TRUE); _woIndentedList->addColumn(tr("Order#"), _orderColumn, Qt::AlignLeft , true, "wonumber"); _woIndentedList->addColumn(tr("Item#"), _itemColumn, Qt::AlignLeft , true, "wodata_itemnumber" ); _woIndentedList->addColumn(tr("Description"), -1, Qt::AlignLeft , true, "wodata_descrip"); _woIndentedList->addColumn(tr("Status"), _statusColumn, Qt::AlignCenter , true, "wodata_status"); _woIndentedList->addColumn(tr("Qty Per."), _qtyColumn, Qt::AlignRight , false, "qtyper"); _woIndentedList->addColumn(tr("Ord/Req."), _qtyColumn, Qt::AlignRight , true, "qtyordreq"); _woIndentedList->addColumn(tr("UOM"), _uomColumn, Qt::AlignLeft , true, "wodata_qtyuom"); _woIndentedList->addColumn(tr("Issued"), _qtyColumn, Qt::AlignRight , true, "qtyiss"); _woIndentedList->addColumn(tr("Scrap"), _prcntColumn, Qt::AlignRight , false, "scrap"); _woIndentedList->addColumn(tr("Received"), _qtyColumn, Qt::AlignRight , true, "qtyrcv"); _woIndentedList->addColumn(tr("On hand"), _qtyColumn, Qt::AlignRight , false, "qoh"); _woIndentedList->addColumn(tr("Short"), _qtyColumn, Qt::AlignRight , false, "short"); if (_metrics->boolean("Routings")) { _woIndentedList->addColumn(tr("Setup Remain."), _qtyColumn, Qt::AlignRight , false, "wodata_setup"); _woIndentedList->addColumn(tr("Run Remain."), _qtyColumn, Qt::AlignRight , false, "wodata_run"); } _woIndentedList->addColumn(tr("Start Date"), _dateColumn, Qt::AlignCenter , false, "wodata_startdate"); _woIndentedList->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter , true, "wodata_duedate"); _woIndentedList->addColumn(tr("Reference"), 100, Qt::AlignLeft , false, "wodata_ref"); _woIndentedList->addColumn(tr("Notes"), 100, Qt::AlignLeft , false, "wodata_notes"); } workOrder::~workOrder() { // no need to delete child widgets, Qt does it all for us } void workOrder::languageChange() { retranslateUi(this); } enum SetResponse workOrder::set(const ParameterList &pParams) { XSqlQuery setWork; XWidget::set(pParams); _captive = TRUE; QVariant param; bool valid; param = pParams.value("itemsite_id", &valid); if (valid) { _item->setItemsiteid(param.toInt()); _item->setEnabled(FALSE); _warehouse->setEnabled(FALSE); } param = pParams.value("qty", &valid); if (valid) _qty->setText(formatQty(param.toDouble())); param = pParams.value("dueDate", &valid); if (valid) { _dueDate->setDate(param.toDate()); } param = pParams.value("wo_id", &valid); if (valid) _woid = param.toInt(); param = pParams.value("planord_id", &valid); if (valid) _planordid = param.toInt(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured | ItemLineEdit::cActive); _item->setDefaultType(ItemLineEdit::cGeneralManufactured | ItemLineEdit::cActive); _qtyReceivedLit->clear(); _assembly->setEnabled(true); _disassembly->setEnabled(true); populateWoNumber(); connect(_woNumber, SIGNAL(editingFinished()), this, SLOT(sCreate())); connect(_item, SIGNAL(privateIdChanged(int)), this, SLOT(sCreate())); connect(_qty, SIGNAL(editingFinished()), this, SLOT(sCreate())); connect(_dueDate, SIGNAL(newDate(const QDate&)), this, SLOT(sCreate())); } else if (param.toString() == "edit") { _mode = cEdit; _item->setType(ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured | ItemLineEdit::cActive); connect(_priority, SIGNAL(editingFinished ()), this, SLOT(sReprioritizeParent())); connect(_qty, SIGNAL(editingFinished()), this, SLOT(sChangeParentQty())); connect(_startDate, SIGNAL(newDate(const QDate&)), this, SLOT(sRescheduleParent())); connect(_dueDate, SIGNAL(newDate(const QDate&)), this, SLOT(sRescheduleParent())); populate(); } else if (param.toString() == "view") { _mode = cView; _item->setQuery("SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2," " (item_descrip1 || ' ' || item_descrip2) AS itemdescrip," " item_active, item_config, item_type, uom_name " "FROM item JOIN uom ON (item_inv_uom_id=uom_id) "); populate(); _woNumber->setEnabled(FALSE); _item->setReadOnly(TRUE); _bomRevision->setEnabled(FALSE); _booRevision->setEnabled(FALSE); _warehouse->setEnabled(FALSE); _priority->setEnabled(FALSE); _qty->setEnabled(FALSE); _startDate->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _productionNotes->setReadOnly(TRUE); _save->hide(); _leadTimeLit->hide(); _leadTime->hide(); _daysLit->hide(); _printTraveler->hide(); _bottomSpacer->hide(); _close->setText(tr("&Close")); _project->setEnabled(FALSE); _itemcharView->setEnabled(false); _jobCosGroup->setEnabled(FALSE); } else if (param.toString() == "release") { _mode = cRelease; //_tabs->removePage(_tabs->page(3)); setWork.prepare( "SELECT planord_itemsite_id, planord_duedate," " CASE WHEN(planord_mps) THEN 'P'" " ELSE 'M'" " END AS sourcetype," " CASE WHEN(planord_mps) THEN planord_pschitem_id" " ELSE planord_id" " END AS sourceid," " formatQty(planord_qty) AS qty " "FROM planord " "WHERE (planord_id=:planord_id);" ); setWork.bindValue(":planord_id", _planordid); setWork.exec(); if (setWork.first()) { _item->setReadOnly(TRUE); _warehouse->setEnabled(FALSE); _planordtype=setWork.value("sourcetype").toString(); _sourceid=setWork.value("sourceid").toInt(); _qty->setText(setWork.value("qty").toString()); _dueDate->blockSignals(true); _dueDate->setDate(setWork.value("planord_duedate").toDate()); _dueDate->blockSignals(false); _item->setItemsiteid(setWork.value("planord_itemsite_id").toInt()); sUpdateStartDate(); populateWoNumber(); _qty->setEnabled(FALSE); _qtyReceivedLit->clear(); _startDate->setEnabled(FALSE); _dueDate->setEnabled(FALSE); _wipValueLit->hide(); _wipValue->hide(); _leadTimeLit->hide(); _leadTime->hide(); _daysLit->hide(); sCreate(); } else { systemError(this, tr("A System Error occurred at %1::%2, Planned Order ID %3.") .arg(__FILE__) .arg(__LINE__) .arg(_planordid) ); close(); } } } return NoError; } void workOrder::sCreate() { XSqlQuery workCreate; if (_woNumber->text().length() && _item->isValid() && _warehouse->id() != -1 && _qty->text().length() && _dueDate->isValid()) { workCreate.prepare( "SELECT itemsite_id, itemsite_costmethod " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); workCreate.bindValue(":item_id", _item->id()); workCreate.bindValue(":warehous_id", _warehouse->id()); workCreate.exec(); if (!workCreate.first()) { QMessageBox::warning(this, tr("Invalid Site"), tr("

    The selected Site for this Work Order is not " "a \"Supplied At\" Site. You must select a different " "Site before creating the Work Order.") ); return; } else { if (DEBUG) qDebug("cost %s", qPrintable(workCreate.value("itemsite_costmethod").toString())); if (workCreate.value("itemsite_costmethod").toString() == "J") { QMessageBox::critical(this,tr("Invalid Item"), tr("Item %1 is set to Job Costing on Item Site %2. " "Work Orders for Job Cost Item Sites may only be created " "by Sales Orders.") .arg(_item->number()) .arg(_warehouse->currentText())); _item->setId(-1); _item->setFocus(); return; } if (workCreate.value("itemsite_costmethod").toString() != "J" && workCreate.value("itemsite_costmethod").toString() != "A") _jobCosGroup->setEnabled(false); } int itemsiteid = workCreate.value("itemsite_id").toInt(); double orderQty = _qty->toDouble(); if (_assembly->isChecked()) { workCreate.prepare("SELECT validateOrderQty(:itemsite_id, :qty, TRUE) AS qty;"); workCreate.bindValue(":itemsite_id", itemsiteid); workCreate.bindValue(":qty", _qty->toDouble()); workCreate.exec(); if (!workCreate.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } orderQty = workCreate.value("qty").toDouble(); if (orderQty != _qty->toDouble()) { if ( QMessageBox::warning( this, tr("Invalid Order Quantitiy"), tr( "Order Parameters for this Item do not allow a quantitiy of %1 to be created.\n" "You must create an order for at least %2 of this item.\n" "Do you want to update the order quantity and create the order?" ) .arg(formatQty(_qty->toDouble())) .arg(formatQty(orderQty)), tr("&Yes"), tr("&No"), 0, 1 ) == 1) { _qty->clear(); _qty->setFocus(); return; } } } workCreate.prepare( "SELECT createWo( :woNumber, :itemsite_id, :priority, :orderQty * :sense," " COALESCE(:startDate, date(:dueDate) - :leadTime), :dueDate, " " :productionNotes, :ordtype, :ordid, :prj_id," " :bom_rev_id, :boo_rev_id, :wo_cosmethod) AS result;" ); workCreate.bindValue(":woNumber", _woNumber->text().toInt()); workCreate.bindValue(":itemsite_id", itemsiteid); workCreate.bindValue(":priority", _priority->value()); workCreate.bindValue(":orderQty", orderQty); workCreate.bindValue(":sense", _sense); workCreate.bindValue(":leadTime", _leadTime->value()); workCreate.bindValue(":dueDate", _dueDate->date()); if (_startDate->isValid()) workCreate.bindValue(":startDate", _startDate->date()); workCreate.bindValue(":productionNotes", _productionNotes->toPlainText()); workCreate.bindValue(":prj_id", _project->id()); workCreate.bindValue(":bom_rev_id", _bomRevision->id()); workCreate.bindValue(":boo_rev_id", _booRevision->id()); if (_todate->isChecked() && _jobCosGroup->isEnabled()) workCreate.bindValue(":wo_cosmethod",QString("D")); else if (_proportional->isChecked() && _jobCosGroup->isEnabled()) workCreate.bindValue(":wo_cosmethod",QString("P")); if(cRelease == _mode) { workCreate.bindValue(":ordtype", _planordtype); workCreate.bindValue(":ordid", _sourceid); } else { workCreate.bindValue(":ordtype", QString("")); workCreate.bindValue(":ordid", -1); } workCreate.exec(); if (workCreate.lastError().type() != QSqlError::NoError) { systemError(this, workCreate.lastError().databaseText(), __FILE__, __LINE__); return; } if (!workCreate.first()) { systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } _woid = workCreate.value("result").toInt(); workCreate.prepare("SELECT updateCharAssignment('W', :target_id, :char_id, :char_value);"); QModelIndex idx1, idx2; for(int i = 0; i < _itemchar->rowCount(); i++) { idx1 = _itemchar->index(i, 0); idx2 = _itemchar->index(i, 1); workCreate.bindValue(":target_id", _woid); workCreate.bindValue(":char_id", _itemchar->data(idx1, Qt::UserRole)); workCreate.bindValue(":char_value", _itemchar->data(idx2, Qt::DisplayRole)); workCreate.exec(); } if (_woid == -1) { QMessageBox::critical( this, tr("Work Order not Created"), tr( "There was an error creating the work order.\n" "Make sure the itemsite you are creating the work order in is set to allow manufacturing of the item." )); return; } else if (_woid == -2 || _woid == -3) QMessageBox::critical( this, tr("Work Order not Exploded"), tr( "The Work Order was created but not Exploded as Component Items defined in the Bill of Materials for\n" "the selected Work Order Item are not valid in the selected Work Order Site.\n" "You must create valid Item Sites for these Component Items before you may explode this Work Order." )); else if (_woid == -4) QMessageBox::critical( this, tr("Work Order not Exploded"), tr( "The Work Order was created but not Exploded as the Work Order status is not Open\n")); // if explosion failed then we don't have a valid wo_id. retrieve using wo_number if (_woid < 0) { workCreate.prepare("SELECT wo_id FROM wo WHERE (wo_number=:woNumber);"); workCreate.bindValue(":woNumber", _woNumber->text().toInt()); workCreate.exec(); if (workCreate.first()) _woid = workCreate.value("wo_id").toInt(); else // give up close(); } if (_woid > 0) { if (_mode == cNew) { disconnect(_woNumber, SIGNAL(editingFinished()), this, SLOT(sCreate())); disconnect(_item, SIGNAL(privateIdChanged(int)), this, SLOT(sCreate())); disconnect(_qty, SIGNAL(editingFinished()), this, SLOT(sCreate())); disconnect(_dueDate, SIGNAL(newDate(const QDate&)), this, SLOT(sCreate())); connect(_priority, SIGNAL(editingFinished ()), this, SLOT(sReprioritizeParent())); connect(_qty, SIGNAL(editingFinished()), this, SLOT(sChangeParentQty())); connect(_startDate, SIGNAL(newDate(const QDate&)), this, SLOT(sRescheduleParent())); connect(_dueDate, SIGNAL(newDate(const QDate&)), this, SLOT(sRescheduleParent())); } populate(); omfgThis->sWorkOrdersUpdated(_woid, TRUE); } } } void workOrder::sSaveClicked() { if (!sSave()) return; XSqlQuery workSave; if (_mode == cRelease) { workSave.prepare("SELECT releasePlannedOrder(:planord_id, FALSE) AS result;"); workSave.bindValue(":planord_id", _planordid); workSave.exec(); } omfgThis->sWorkOrdersUpdated(_woid, TRUE); if (_printTraveler->isChecked() && _printTraveler->isVisible()) { ParameterList params; params.append("wo_id", _woid); printWoTraveler newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } emit saved(_woid); if (_captive) close(); else if (cNew == _mode) { populateWoNumber(); _item->setId(-1); _qty->clear(); _dueDate->setNull(); _leadTime->setValue(0); _startDate->clear(); _productionNotes->clear(); _itemchar->removeRows(0, _itemchar->rowCount()); _close->setText(tr("&Close")); _item->setFocus(); } } bool workOrder::sSave() { XSqlQuery workSave; QList errors; errors << GuiErrorCheck((!_qty->text().length()) || (_qty->toDouble() == 0.0), _qty, tr( "You have entered an invalid Qty. Ordered.\n" "Please correct before creating this Work Order" ) ) << GuiErrorCheck(!_dueDate->isValid(), _dueDate, tr( "You have entered an invalid Due Date.\n" "Please correct before updating this Work Order" ) ) << GuiErrorCheck(!_startDate->isValid(), _startDate, tr( "You have entered an invalid Start Date.\n" "Please correct before updating this Work Order" ) ) ; if (GuiErrorCheck::reportErrors(this, tr("Cannot Save Work Order"), errors)) return false; workSave.prepare("UPDATE wo" " SET wo_prodnotes=:productionNotes," " wo_prj_id=:prj_id," " wo_bom_rev_id=:bom_rev_id," " wo_boo_rev_id=:boo_rev_id," " wo_cosmethod=:wo_cosmethod" " WHERE (wo_id=:wo_id); "); workSave.bindValue(":wo_id", _woid); workSave.bindValue(":productionNotes", _productionNotes->toPlainText()); workSave.bindValue(":prj_id", _project->id()); workSave.bindValue(":bom_rev_id", _bomRevision->id()); workSave.bindValue(":boo_rev_id", _booRevision->id()); if (_todate->isChecked() && _jobCosGroup->isEnabled()) workSave.bindValue(":wo_cosmethod",QString("D")); else if (_proportional->isChecked() && _jobCosGroup->isEnabled()) workSave.bindValue(":wo_cosmethod",QString("P")); workSave.exec(); if (workSave.lastError().type() != QSqlError::NoError) { systemError(this, workSave.lastError().databaseText(), __FILE__, __LINE__); return false; } workSave.prepare("SELECT updateCharAssignment('W', :target_id, :char_id, :char_value);"); QModelIndex idx1, idx2; for(int i = 0; i < _itemchar->rowCount(); i++) { idx1 = _itemchar->index(i, 0); idx2 = _itemchar->index(i, 1); workSave.bindValue(":target_id", _woid); workSave.bindValue(":char_id", _itemchar->data(idx1, Qt::UserRole)); workSave.bindValue(":char_value", _itemchar->data(idx2, Qt::DisplayRole)); workSave.exec(); if (workSave.lastError().type() != QSqlError::NoError) { systemError(this, workSave.lastError().databaseText(), __FILE__, __LINE__); return false; } } return true; } void workOrder::sUpdateStartDate() { if (!_warehouse->isValid() || !_dueDate->isValid()) return; if (_leadTime == 0) { _startDate->setDate(_dueDate->date()); return; } XSqlQuery startDate; if (_metrics->boolean("UseSiteCalendar")) startDate.prepare("SELECT calculateNextWorkingDate(:warehous_id, :dueDate, (:leadTime * -1)) AS startdate;"); else startDate.prepare("SELECT (DATE(:dueDate) - :leadTime) AS startdate;"); startDate.bindValue(":dueDate", _dueDate->date()); startDate.bindValue(":leadTime", _leadTime->value()); startDate.bindValue(":warehous_id", _warehouse->id()); startDate.exec(); if (startDate.first()) _startDate->setDate(startDate.value("startdate").toDate()); else systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); } void workOrder::sPopulateItemChar( int pItemid ) { XSqlQuery workPopulateItemChar; _itemchar->removeRows(0, _itemchar->rowCount()); if (pItemid != -1) { workPopulateItemChar.prepare( "SELECT DISTINCT char_id, char_name," " COALESCE(b.charass_value, (SELECT c.charass_value FROM charass c WHERE ((c.charass_target_type='I') AND (c.charass_target_id=:item_id) AND (c.charass_default) AND (c.charass_char_id=char_id)) LIMIT 1)) AS charass_value" " FROM charass a, char " " LEFT OUTER JOIN charass b" " ON (b.charass_target_type='W'" " AND b.charass_target_id=:wo_id" " AND b.charass_char_id=char_id) " " WHERE ( (a.charass_char_id=char_id)" " AND (a.charass_target_type='I')" " AND (a.charass_target_id=:item_id) ) " " ORDER BY char_name;" ); workPopulateItemChar.bindValue(":item_id", pItemid); workPopulateItemChar.bindValue(":wo_id", _woid); workPopulateItemChar.exec(); int row = 0; QModelIndex idx; while(workPopulateItemChar.next()) { _itemchar->insertRow(_itemchar->rowCount()); idx = _itemchar->index(row, 0); _itemchar->setData(idx, workPopulateItemChar.value("char_name"), Qt::DisplayRole); _itemchar->setData(idx, workPopulateItemChar.value("char_id"), Qt::UserRole); idx = _itemchar->index(row, 1); _itemchar->setData(idx, workPopulateItemChar.value("charass_value"), Qt::DisplayRole); _itemchar->setData(idx, pItemid, Xt::IdRole); _itemchar->setData(idx, pItemid, Qt::UserRole); row++; } } } void workOrder::sPopulateLeadTime(int pWarehousid) { XSqlQuery workPopulateLeadTime; if (pWarehousid < 0 || ! _item->isValid() || (_lastWarehousid==pWarehousid && _lastItemid==_item->id())) return; _lastItemid = _item->id(); _lastWarehousid = pWarehousid; workPopulateLeadTime.prepare( "SELECT itemsite_leadtime, itemsite_cosdefault " "FROM itemsite " "WHERE ( (itemsite_item_id=:item_id)" " AND (itemsite_warehous_id=:warehous_id) );" ); workPopulateLeadTime.bindValue(":item_id", _item->id()); workPopulateLeadTime.bindValue(":warehous_id", pWarehousid); workPopulateLeadTime.exec(); if (workPopulateLeadTime.first()) { _leadTime->setValue(workPopulateLeadTime.value("itemsite_leadtime").toInt()); if (workPopulateLeadTime.value("itemsite_cosdefault").toString() == "D") _todate->setChecked(TRUE); if (workPopulateLeadTime.value("itemsite_cosdefault").toString() == "P") _proportional->setChecked(TRUE); } else { QMessageBox::warning(this, tr("Invalid Site"), tr("

    The selected Site for this Work Order is not " "a \"Supplied At\" Site. You must select a different " "Site before creating the Work Order.") ); _warehouse->setEnabled(TRUE); } } void workOrder::populateWoNumber() { XSqlQuery workpopulateWoNumber; QString generationMethod = _metrics->value("WONumberGeneration"); if ((generationMethod == "A") || (generationMethod == "O")) { workpopulateWoNumber.exec("SELECT fetchWoNumber() AS woNumber;"); if (workpopulateWoNumber.first()) { _woNumber->setText(workpopulateWoNumber.value("woNumber").toString()); _wonumber = workpopulateWoNumber.value("woNumber").toInt(); } else { _woNumber->setText("Error"); systemError(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__) ); return; } } if (generationMethod == "M") { _woNumber->setEnabled(TRUE); } else if (generationMethod == "O") { _woNumber->setEnabled(TRUE); } else if (generationMethod == "A") { _woNumber->setEnabled(FALSE); } } void workOrder::sClose() { XSqlQuery workClose; if (_woid > 0) { if ((_mode == cNew) || (_mode == cRelease)) { workClose.prepare("SELECT deleteWo(:wo_id,true);"); workClose.bindValue(":wo_id", _woid); workClose.exec(); omfgThis->sWorkOrdersUpdated(_woid, TRUE); } } if (_wonumber > 0) { if ( ( (_mode == cNew) || (_mode == cRelease)) && ((_metrics->value("WONumberGeneration") == "A") || (_metrics->value("WONumberGeneration") == "O")) ) { workClose.prepare("SELECT releaseWoNumber(:woNumber);"); workClose.bindValue(":woNumber", _wonumber); workClose.exec(); } } close(); } void workOrder::sNumberChanged() { XSqlQuery workNumberChanged; if(_wonumber != -1 && _wonumber != _woNumber->text().toInt()) { workNumberChanged.prepare("SELECT releaseWoNumber(:woNumber);"); workNumberChanged.bindValue(":woNumber", _wonumber); workNumberChanged.exec(); } } void workOrder::sHandleButtons() { if (_assembly->isChecked()) _sense = 1; else _sense = -1; } void workOrder::sFillList() { XSqlQuery workFillList; //The wodata_id_type column is used to indicate the source of the wodata_id //there are three different tables used wo, womatl and womatlvar //wodata_id_type = 1 = wo_id //wodata_id_type = 2 = womatl_id //wodata_id_type = 3 = womatlvar_id QString sql( " SELECT wodata_id, " " wodata_id_type, " " CASE WHEN wodata_id_type = 1 THEN " " wodata_number || '-' || wodata_subnumber " " WHEN wodata_id_type = 3 THEN " " wodata_subnumber::text " " END AS wonumber, " " wodata_itemnumber, " " wodata_descrip, " " wodata_status, " " wodata_startdate, " " wodata_duedate, " " wodata_adhoc, " " wodata_itemsite_id, " " wodata_qoh AS qoh, " " wodata_short AS short, " " wodata_qtyper AS qtyper, " " wodata_qtyiss AS qtyiss, " " wodata_qtyrcv AS qtyrcv, " " wodata_qtyordreq AS qtyordreq, " " wodata_qtyuom, " " wodata_scrap AS scrap, " " wodata_setup, " " wodata_run, " " wodata_notes, " " wodata_ref, " " CASE WHEN (wodata_status = 'C') THEN 'gray' " " WHEN (wodata_qoh = 0) THEN 'warning' " " WHEN (wodata_qoh < 0) THEN 'error' " " END AS qoh_qtforegroundrole, " " CASE WHEN (wodata_status = 'C') THEN 'gray' " " WHEN (wodata_qtyiss = 0) THEN 'warning' " " END AS qtyiss_qtforegroundrole, " " CASE WHEN (wodata_status = 'C') THEN 'gray' " " WHEN (wodata_short > 0) THEN 'error' " " END AS short_qtforegroundrole, " " CASE WHEN (wodata_status = 'C') THEN 'gray' " " WHEN (wodata_startdate <= current_date) THEN 'error' " " END AS wodata_startdate_qtforegroundrole, " " CASE WHEN (wodata_status = 'C') THEN 'gray' " " WHEN (wodata_duedate <= current_date) THEN 'error' " " END AS wodata_duedate_qtforegroundrole, " " CASE WHEN (wodata_status = 'C') THEN 'gray' " " WHEN (wodata_id_type = 3) THEN 'emphasis' " " WHEN (wodata_id_type = 1) THEN 'altemphasis' " " ELSE null END AS qtforegroundrole, " " 'qty' AS qoh_xtnumericrole, " " 'qtyper' AS qty_per_xtnumericrole, " " 'qty' AS qtyiss_xtnumericrole, " " 'qty' AS qtyrcv_xtnumericrole, " " 'qty' AS qtyordreq_xtnumericrole, " " 'qty' AS short_xtnumericrole, " " 'qty' AS setup_xtnumericrole," " 'qty' AS run_xtnumericrole," " 'scrap' AS scrap_xtnumericrole, " " wodata_level AS xtindentrole " " FROM indentedwo(:wo_id, :showops, :showmatl, :showindent) "); workFillList.prepare(sql); workFillList.bindValue(":wo_id", _woid); workFillList.bindValue(":showops", QVariant(_showOperations->isVisible() && _showOperations->isChecked())); workFillList.bindValue(":showmatl", QVariant(_showMaterials->isChecked())); workFillList.bindValue(":showindent", QVariant(_indented->isChecked())); workFillList.exec(); _woIndentedList->populate(workFillList, true); _woIndentedList->expandAll(); if (workFillList.lastError().type() != QSqlError::NoError) { systemError(this, workFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } void workOrder::sPostProduction() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); postProduction newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sCorrectProductionPosting() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); correctProductionPosting newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId);} void workOrder::sReleaseWO() { if (!sSave()) return; XSqlQuery workReleaseWO; workReleaseWO.prepare("SELECT releaseWo(:wo_id, FALSE);"); workReleaseWO.bindValue(":wo_id", _woIndentedList->id()); workReleaseWO.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sRecallWO() { if (!sSave()) return; XSqlQuery workRecallWO; workRecallWO.prepare("SELECT recallWo(:wo_id, FALSE);"); workRecallWO.bindValue(":wo_id", _woIndentedList->id()); workRecallWO.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sExplodeWO() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); explodeWo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sImplodeWO() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); implodeWo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sDeleteWO() { XSqlQuery workDeleteWO; workDeleteWO.prepare( "SELECT wo_ordtype " "FROM wo " "WHERE (wo_id=:wo_id);" ); workDeleteWO.bindValue(":wo_id", _woIndentedList->id()); workDeleteWO.exec(); if (workDeleteWO.first()) { QString question; if (workDeleteWO.value("wo_ordtype") == "W") question = tr("

    The Work Order that you selected to delete is a child " "of another Work Order. If you delete the selected Work " "Order then the Work Order Materials Requirements for the " "Component Item will remain but the Work Order to relieve " "that demand will not. Are you sure that you want to " "delete the selected Work Order?" ); else if (workDeleteWO.value("wo_ordtype") == "S") question = tr("

    The Work Order that you selected to delete was created " "to satisfy Sales Order demand. If you delete the selected " "Work Order then the Sales Order demand will remain but " "the Work Order to relieve that demand will not. Are you " "sure that you want to delete the selected Work Order?" ); else question = tr("

    Are you sure that you want to delete the selected " "Work Order?"); if (QMessageBox::question(this, tr("Delete Work Order?"), question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::No) { return; } workDeleteWO.prepare("SELECT deleteWo(:wo_id, TRUE) AS returnVal;"); workDeleteWO.bindValue(":wo_id", _woIndentedList->id()); workDeleteWO.exec(); if (workDeleteWO.first()) { int result = workDeleteWO.value("returnVal").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteWo", result)); return; } omfgThis->sWorkOrdersUpdated(-1, TRUE); } else if (workDeleteWO.lastError().type() != QSqlError::NoError) systemError(this, workDeleteWO.lastError().databaseText(), __FILE__, __LINE__); } else if (workDeleteWO.lastError().type() != QSqlError::NoError) { systemError(this, workDeleteWO.lastError().databaseText(), __FILE__, __LINE__); return; } populate(); } void workOrder::sCloseWO() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); closeWo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sPrintTraveler() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); printWoTraveler newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sInventoryAvailabilityByWorkOrder() { ParameterList params; params.append("wo_id", _woIndentedList->id()); params.append("run"); dspInventoryAvailabilityByWorkOrder *newdlg = new dspInventoryAvailabilityByWorkOrder(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } void workOrder::sReprioritizeParent() { if (!sSave()) return; XSqlQuery workReprioritizeParent; if(_priority->value() != _oldPriority) { if ( QMessageBox::warning( this, tr("Change Priority"), tr( "A priority change from %1 to %2 will update all work order requirements. " "Are you sure you want to change the work order priority?" ) .arg(QString().setNum(_oldPriority)) .arg(QString().setNum(_priority->value())), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 1 ) { _priority->setValue(_oldPriority); return; } workReprioritizeParent.prepare("SELECT reprioritizeWo(:wo_id, :newPriority, :reprioritizeChildren);"); workReprioritizeParent.bindValue(":wo_id", _woid); workReprioritizeParent.bindValue(":newPriority", _priority->value()); workReprioritizeParent.bindValue(":reprioritizeChildren", true); workReprioritizeParent.exec(); if (workReprioritizeParent.lastError().type() != QSqlError::NoError) { systemError(this, workReprioritizeParent.lastError().databaseText(), __FILE__, __LINE__); return; } else _oldPriority=_priority->value(); populate(); omfgThis->sWorkOrdersUpdated(_woid, TRUE); } } void workOrder::sRescheduleParent() { if (!sSave()) return; XSqlQuery workRescheduleParent; if(_startDate->date() != _oldStartDate || _dueDate->date() != _oldDueDate) { if ( QMessageBox::warning( this, tr("Change Date"), tr( "Changing the start or due date will update all work order requirements. " "Are you sure you want to reschedule all dates?" ), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 1 ) { _startDate->setDate(_oldStartDate); _dueDate->setDate(_oldDueDate); QMessageBox::warning( this, tr("Change Date"), tr( "Changing the due date may change the Bill of Material components that are effective.\n" "You may want to consider imploding and exploding the Work Order.\n" ) ); return; } workRescheduleParent.prepare("SELECT changeWoDates(:wo_id, :startDate, :dueDate, :rescheduleChildren);"); workRescheduleParent.bindValue(":wo_id", _woid); workRescheduleParent.bindValue(":startDate", _startDate->date()); workRescheduleParent.bindValue(":dueDate", _dueDate->date()); workRescheduleParent.bindValue(":rescheduleChildren", true); workRescheduleParent.exec(); if (workRescheduleParent.lastError().type() != QSqlError::NoError) { systemError(this, workRescheduleParent.lastError().databaseText(), __FILE__, __LINE__); return; } else { _oldStartDate=_startDate->date(); _oldDueDate=_dueDate->date(); } } populate(); omfgThis->sWorkOrdersUpdated(_woid, TRUE); } void workOrder::sChangeParentQty() { if (!sSave()) return; XSqlQuery workChangeParentQty; if(_qty->text().toDouble() != _oldQty) { double newQty = _qty->toDouble(); workChangeParentQty.prepare( "SELECT validateOrderQty(wo_itemsite_id, :qty, TRUE) AS qty " "FROM wo " "WHERE (wo_id=:wo_id);" ); workChangeParentQty.bindValue(":wo_id", _woid); workChangeParentQty.bindValue(":qty", newQty); workChangeParentQty.exec(); if (workChangeParentQty.lastError().type() != QSqlError::NoError) { systemError(this, workChangeParentQty.lastError().databaseText(), __FILE__, __LINE__); return; } else if (workChangeParentQty.first()) { if (workChangeParentQty.value("qty").toDouble() != newQty) { if ( QMessageBox::warning( this, tr("Invalid Order Qty"), tr( "The new Order Quantity that you have entered does not meet the Order Parameters set " "for the parent Item Site for this Work Order. In order to meet the Item Site Order " "Parameters the new Order Quantity must be increased to %1. " "Do you want to change the Order Quantity for this Work Order to %2?" ) .arg(formatQty(workChangeParentQty.value("qty").toDouble())) .arg(formatQty(workChangeParentQty.value("qty").toDouble())), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 1 ) { _qty->setText(_oldQty); _qty->setFocus(); return; } else newQty = workChangeParentQty.value("qty").toDouble(); } else if ( QMessageBox::warning( this, tr("Change Qty"), tr( "A quantity change from %1 to %2 will update all work order requirements. " "Are you sure you want to change the work order quantity?" ) .arg(formatQty(_oldQty)) .arg(formatQty(_qty->text().toDouble())), tr("&Yes"), tr("&No"), QString::null, 0, 1 ) == 1 ) { _qty->setText(_oldQty); return; } workChangeParentQty.prepare("SELECT changeWoQty(:wo_id, :qty * :sense, TRUE);"); workChangeParentQty.bindValue(":wo_id", _woid); workChangeParentQty.bindValue(":qty", newQty); workChangeParentQty.bindValue(":sense", _sense); workChangeParentQty.exec(); if (workChangeParentQty.lastError().type() != QSqlError::NoError) { systemError(this, workChangeParentQty.lastError().databaseText(), __FILE__, __LINE__); return; } else _oldQty=(_qty->text().toDouble() * _sense); } populate(); omfgThis->sWorkOrdersUpdated(_woid, TRUE); } } void workOrder::sReprioritizeWo() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); reprioritizeWo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); populate(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); } void workOrder::sRescheduleWO() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); rescheduleWo newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); populate(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); } void workOrder::sChangeWOQty() { if (!sSave()) return; ParameterList params; params.append("wo_id", _woIndentedList->id()); changeWoQty newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); populate(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); } void workOrder::sDspRunningAvailability() { XSqlQuery workDspRunningAvailability; workDspRunningAvailability.prepare("SELECT wo_itemsite_id FROM wo WHERE (wo_id=:id);"); workDspRunningAvailability.bindValue(":id", _woIndentedList->id()); workDspRunningAvailability.exec(); if (workDspRunningAvailability.first()) { ParameterList params; params.append("itemsite_id", workDspRunningAvailability.value("wo_itemsite_id")); params.append("run"); dspRunningAvailability *newdlg = new dspRunningAvailability(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (workDspRunningAvailability.lastError().type() != QSqlError::NoError) { systemError(this, workDspRunningAvailability.lastError().databaseText(), __FILE__, __LINE__); return; } } void workOrder::sReturnMatlBatch() { if (!sSave()) return; XSqlQuery workReturnMatlBatch; workReturnMatlBatch.prepare( "SELECT wo_qtyrcv " "FROM wo " "WHERE (wo_id=:wo_id);" ); workReturnMatlBatch.bindValue(":wo_id", _woIndentedList->id()); workReturnMatlBatch.exec(); if (workReturnMatlBatch.first()) { if (workReturnMatlBatch.value("wo_qtyrcv").toDouble() != 0) { QMessageBox::warning( this, tr("Cannot return Work Order Material"), tr( "This Work Order has had material received against it\n" "and thus the material issued against it cannot be returned.\n" "You must instead return each Work Order Material item individually.\n" ) ); } else { XSqlQuery rollback; rollback.prepare("ROLLBACK;"); workReturnMatlBatch.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations workReturnMatlBatch.prepare("SELECT returnWoMaterialBatch(:wo_id) AS result;"); workReturnMatlBatch.bindValue(":wo_id", _woIndentedList->id()); workReturnMatlBatch.exec(); if (workReturnMatlBatch.first()) { if (workReturnMatlBatch.value("result").toInt() < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2, Error #%3.") .arg(__LINE__) .arg(_woIndentedList->id()) .arg(workReturnMatlBatch.value("result").toInt()) ); return; } else if (distributeInventory::SeriesAdjust(workReturnMatlBatch.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Material Return"), tr("Transaction Canceled") ); return; } workReturnMatlBatch.exec("COMMIT;"); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); } else { rollback.exec(); systemError( this, tr("A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2.") .arg(__LINE__) .arg(_woIndentedList->id()) ); return; } } } populate(); } void workOrder::sIssueMatlBatch() { if (!sSave()) return; XSqlQuery issue; issue.prepare("SELECT itemsite_id, " " item_number, " " warehous_code, " " (COALESCE((SELECT SUM(itemloc_qty) " " FROM itemloc " " WHERE (itemloc_itemsite_id=itemsite_id)), 0.0) " " >= roundQty(item_fractional, noNeg(itemuomtouom(itemsite_item_id, womatl_uom_id, NULL, womatl_qtyreq - womatl_qtyiss)))) AS isqtyavail " " FROM womatl, itemsite, item, whsinfo " " WHERE ( (womatl_itemsite_id=itemsite_id) " " AND (itemsite_item_id=item_id) " " AND (itemsite_warehous_id=warehous_id) " " AND (NOT ((item_type = 'R') OR (itemsite_controlmethod = 'N'))) " " AND ((itemsite_controlmethod IN ('L', 'S')) OR (itemsite_loccntrl)) " " AND (womatl_issuemethod IN ('S', 'M')) " " AND (womatl_wo_id=:wo_id)); "); issue.bindValue(":wo_id", _woIndentedList->id()); issue.exec(); while(issue.next()) { if(!(issue.value("isqtyavail").toBool())) { QMessageBox::critical(this, tr("Insufficient Inventory"), tr("Item Number %1 in Site %2 is a Multiple Location or\n" "Lot/Serial controlled Item which is short on Inventory.\n" "This transaction cannot be completed as is. Please make\n" "sure there is sufficient Quantity on Hand before proceeding.") .arg(issue.value("item_number").toString()) .arg(issue.value("warehous_code").toString())); return; } } XSqlQuery rollback; rollback.prepare("ROLLBACK;"); issue.exec("BEGIN;"); // because of possible lot, serial, or location distribution cancelations issue.prepare("SELECT issueWoMaterialBatch(:wo_id) AS result;"); issue.bindValue(":wo_id", _woIndentedList->id()); issue.exec(); if (issue.first()) { if (issue.value("result").toInt() < 0) { rollback.exec(); systemError( this, tr("A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2, Error #%3.") .arg(__LINE__) .arg(_woIndentedList->id()) .arg(issue.value("result").toInt()) ); return; } else { if (distributeInventory::SeriesAdjust(issue.value("result").toInt(), this) == XDialog::Rejected) { rollback.exec(); QMessageBox::information( this, tr("Material Issue"), tr("Transaction Canceled") ); return; } issue.exec("COMMIT;"); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); } } else { rollback.exec(); systemError( this, tr("A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2.") .arg(__LINE__) .arg(_woIndentedList->id()) ); return; } populate(); } void workOrder::sIssueMatl() { if (!sSave()) return; XSqlQuery workIssueMatl; issueWoMaterialItem newdlg(this); ParameterList params; workIssueMatl.prepare("SELECT womatl_wo_id AS wo_id FROM womatl " " WHERE (womatl_id=:womatl_id) "); workIssueMatl.bindValue(":womatl_id", _woIndentedList->id()); workIssueMatl.exec(); if (workIssueMatl.first()) params.append("wo_id", workIssueMatl.value("wo_id").toInt()); params.append("womatl_id", _woIndentedList->id()); if (newdlg.set(params) == NoError) newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sReturnMatl() { if (!sSave()) return; returnWoMaterialItem newdlg(this); ParameterList params; params.append("womatl_id", _woIndentedList->id()); if (newdlg.set(params) == NoError) newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sScrapMatl() { if (!sSave()) return; scrapWoMaterialFromWIP newdlg(this); ParameterList params; params.append("womatl_id", _woIndentedList->id()); if (newdlg.set(params) == NoError) newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sNewMatl() { if (!sSave()) return; ParameterList params; params.append("mode", "new"); params.append("wo_id", _woIndentedList->id()); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sEditMatl() { if (!sSave()) return; ParameterList params; params.append("mode", "edit"); params.append("womatl_id", _woIndentedList->id()); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); int currentId = _woIndentedList->id(); int currentAltId = _woIndentedList->altId(); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); _woIndentedList->setId(currentId,currentAltId); } void workOrder::sViewMatl() { ParameterList params; params.append("mode", "view"); params.append("womatl_id", _woIndentedList->id()); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void workOrder::sDeleteMatl() { if (!sSave()) return; XSqlQuery workDeleteMatl; int womatlid = _woIndentedList->id(); if (_woIndentedList->currentItem()->data(7, Qt::UserRole).toMap().value("raw").toDouble() > 0) { if(_privileges->check("ReturnWoMaterials")) { if (QMessageBox::question(this, tr("W/O Material Requirement cannot be Deleted"), tr("

    This W/O Material Requirement cannot " "be deleted as it has has material issued " "to it. You must return this material to " "stock before you can delete this Material " "Requirement. Would you like to return this " "material to stock now?" ), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { ParameterList params; params.append("womatl_id", womatlid); returnWoMaterialItem newdlg(omfgThis, "", TRUE); newdlg.set(params); newdlg.exec(); populate(); workDeleteMatl.prepare("SELECT womatl_qtyiss AS qtyissued " "FROM womatl " "WHERE (womatl_id=:womatl_id) "); workDeleteMatl.bindValue(":womatl_id", womatlid); workDeleteMatl.exec(); if (!workDeleteMatl.first() || workDeleteMatl.value("qtyissued").toInt() != 0) return; } else return; } else { QMessageBox::critical( this, tr("W/O Material Requirement cannot be Deleted"), tr("

    This W/O Material Requirement cannot be " "deleted as it has material issued to it. " "You must return this material to stock before " "you can delete this Material Requirement." ) ); return; } } workDeleteMatl.prepare("SELECT deleteWoMaterial(:womatl_id);"); workDeleteMatl.bindValue(":womatl_id", womatlid); workDeleteMatl.exec(); if (workDeleteMatl.first()) { int result = workDeleteMatl.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteWoMaterial", result), __FILE__, __LINE__); return; } } else if (workDeleteMatl.lastError().type() != QSqlError::NoError) { systemError(this, workDeleteMatl.lastError().databaseText(), __FILE__, __LINE__); return; } workDeleteMatl.prepare("SELECT womatl_wo_id AS woid " "FROM womatl " "WHERE (womatl_id=:womatl_id) "); workDeleteMatl.bindValue(":womatl_id", womatlid); workDeleteMatl.exec(); if (workDeleteMatl.first()) omfgThis->sWorkOrderMaterialsUpdated(workDeleteMatl.value("woid").toInt(), womatlid, TRUE); omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); } void workOrder::sViewMatlAvailability() { XSqlQuery workViewMatlAvailability; workViewMatlAvailability.prepare( "SELECT womatl_itemsite_id, womatl_duedate " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); workViewMatlAvailability.bindValue(":womatl_id", _woIndentedList->id()); workViewMatlAvailability.exec(); if (workViewMatlAvailability.first()) { ParameterList params; params.append("itemsite_id", workViewMatlAvailability.value("womatl_itemsite_id")); params.append("byDate", workViewMatlAvailability.value("womatl_duedate")); params.append("run"); dspInventoryAvailability *newdlg = new dspInventoryAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (workViewMatlAvailability.lastError().type() != QSqlError::NoError) { systemError(this, workViewMatlAvailability.lastError().databaseText(), __FILE__, __LINE__); return; } } void workOrder::sViewMatlSubstituteAvailability() { XSqlQuery workViewMatlSubstituteAvailability; workViewMatlSubstituteAvailability.prepare( "SELECT womatl_itemsite_id, womatl_duedate " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); workViewMatlSubstituteAvailability.bindValue(":womatl_id", _woIndentedList->id()); workViewMatlSubstituteAvailability.exec(); if (workViewMatlSubstituteAvailability.first()) { ParameterList params; params.append("itemsite_id", workViewMatlSubstituteAvailability.value("womatl_itemsite_id")); params.append("byDate", workViewMatlSubstituteAvailability.value("womatl_duedate")); params.append("run"); dspSubstituteAvailabilityByItem *newdlg = new dspSubstituteAvailabilityByItem(this); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (workViewMatlSubstituteAvailability.lastError().type() != QSqlError::NoError) { systemError(this, workViewMatlSubstituteAvailability.lastError().databaseText(), __FILE__, __LINE__); return; } } void workOrder::sSubstituteMatl() { if (!sSave()) return; XSqlQuery workSubstituteMatl; int womatlid = _woIndentedList->id(); XSqlQuery sub; sub.prepare( "SELECT itemuomtouom(itemsite_item_id, womatl_uom_id, NULL, womatl_qtyper) AS qtyper, womatl_wo_id," " womatl_scrap, womatl_issuemethod," " womatl_duedate, womatl_bomitem_id, " " womatl_notes, womatl_ref, womatl_wooper_id " "FROM womatl JOIN itemsite ON (womatl_itemsite_id=itemsite_id) " "WHERE (womatl_id=:womatl_id);" ); sub.bindValue(":womatl_id", womatlid); sub.exec(); if (sub.first()) { ParameterList params; params.append("womatl_id", womatlid); params.append("byDate", sub.value("womatl_duedate")); params.append("run"); substituteList substitute(this, "", TRUE); substitute.set(params); int result = substitute.exec(); if (result != XDialog::Rejected) { ParameterList params; params.append("mode", "new"); params.append("wo_id", sub.value("womatl_wo_id")); params.append("bomitem_id", sub.value("womatl_bomitem_id")); params.append("item_id", result); params.append("qtyPer", (sub.value("qtyper").toDouble() * substitute._uomratio)); params.append("scrap", sub.value("womatl_scrap")); params.append("notes", sub.value("womatl_notes")); params.append("reference", sub.value("womatl_ref")); params.append("wooper_id", sub.value("womatl_wooper_id")); if (sub.value("womatl_issuemethod").toString() == "S") params.append("issueMethod", "push"); else if (sub.value("womatl_issuemethod").toString() == "L") params.append("issueMethod", "pull"); else if (sub.value("womatl_issuemethod").toString() == "M") params.append("issueMethod", "mixed"); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { workSubstituteMatl.prepare( "DELETE FROM womatl " "WHERE (womatl_id=:womatl_id);" ); workSubstituteMatl.bindValue(":womatl_id", womatlid); workSubstituteMatl.exec(); workSubstituteMatl.prepare("SELECT womatl_wo_id AS woid " "FROM womatl " "WHERE (womatl_id=:womatl_id) "); workSubstituteMatl.bindValue(":womatl_id", womatlid); workSubstituteMatl.exec(); if (workSubstituteMatl.first()) omfgThis->sWorkOrderMaterialsUpdated(workSubstituteMatl.value("woid").toInt(), womatlid, TRUE); } } } else if (workSubstituteMatl.lastError().type() != QSqlError::NoError) { systemError(this, workSubstituteMatl.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sWorkOrdersUpdated(_woIndentedList->id(), TRUE); populate(); } void workOrder::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *selected) { QString status(selected->text(3)); QAction *menuItem; //Check if row is a work order and id is vaild if(_woIndentedList->altId() == 1 && _woIndentedList->id() > -1) { if (_mode != cView) { if (status == "O") { menuItem = pMenu->addAction(tr("Explode..."), this, SLOT(sExplodeWO())); if (!_privileges->check("ExplodeWorkOrders")) menuItem->setEnabled(false); } else if (status == "E") { menuItem = pMenu->addAction(tr("Implode..."), this, SLOT(sImplodeWO())); if (!_privileges->check("ImplodeWorkOrders")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Release"), this, SLOT(sReleaseWO())); if (!_privileges->check("ReleaseWorkOrders")) menuItem->setEnabled(false); } else if (status == "R") { menuItem = pMenu->addAction(tr("Recall"), this, SLOT(sRecallWO())); if (!_privileges->check("RecallWorkOrders")) menuItem->setEnabled(false); } if (((XTreeWidgetItem *)selected)->QTreeWidgetItem::parent() && ((status == "O") || (status == "E"))) { menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteWO())); if (!_privileges->check("DeleteWorkOrders")) menuItem->setEnabled(false); } else { if ((status != "C")) { menuItem = pMenu->addAction(tr("Close..."), this, SLOT(sCloseWO())); if (!_privileges->check("CloseWorkOrders")) menuItem->setEnabled(false); } pMenu->addSeparator(); } if ((status == "E") || (status == "R") || (status == "I")) { menuItem = pMenu->addAction(tr("Print Traveler..."), this, SLOT(sPrintTraveler())); if (!_privileges->check("PrintWorkOrderPaperWork")) menuItem->setEnabled(false); pMenu->addSeparator(); if (status == "O" ||status == "E" || status == "R" || status == "I") { menuItem = pMenu->addAction(tr("New Material..."), this, SLOT(sNewMatl())); if (!_privileges->check("MaintainWoMaterials")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Issue Batch..."), this, SLOT(sIssueMatlBatch())); if (!_privileges->check("IssueWoMaterials")) menuItem->setEnabled(false); if (status == "I") { menuItem = pMenu->addAction(tr("Return Batch..."), this, SLOT(sReturnMatlBatch())); if (!_privileges->check("ReturnWoMaterials")) menuItem->setEnabled(false); } pMenu->addSeparator(); } } } if (_mode != cView) { menuItem = pMenu->addAction(tr("Post Production..."), this, SLOT(sPostProduction())); if (!_privileges->check("PostProduction")) menuItem->setEnabled(false); if (status == "I") { menuItem = pMenu->addAction(tr("Correct Production Posting..."), this, SLOT(sCorrectProductionPosting())); if (!_privileges->check("PostProduction")) menuItem->setEnabled(false); } pMenu->addSeparator(); } pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Running Availability..."), this, SLOT(sDspRunningAvailability())); if ((status == "E") || (status == "R") || (status == "I")) { menuItem = pMenu->addAction(tr("Inventory Availability..."), this, SLOT(sInventoryAvailabilityByWorkOrder())); if (!_privileges->check("ViewInventoryAvailability")) menuItem->setEnabled(false); } if (_mode != cView) { if ((status == "O") || (status == "E")) { pMenu->addSeparator(); menuItem = pMenu->addAction(tr("Reprioritize..."), this, SLOT(sReprioritizeWo())); if (!_privileges->check("ReprioritizeWorkOrders")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Reschedule..."), this, SLOT(sRescheduleWO())); if (!_privileges->check("RescheduleWorkOrders")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Change Quantity..."), this, SLOT(sChangeWOQty())); if (!_privileges->check("ChangeWorkOrderQty")) menuItem->setEnabled(false); } } } //Check a womatl row is selected and the id is vaild if(_woIndentedList->altId() == 2 && _woIndentedList->id() > -1) { if (_mode != cView) { if (status == "O" || status == "E" || status == "R" || status == "I") { menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEditMatl())); if (!_privileges->check("MaintainWoMaterials")) menuItem->setEnabled(false); } } menuItem = pMenu->addAction(tr("View..."), this, SLOT(sViewMatl())); if (_mode != cView) { if (status == "O" || status == "E") { menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDeleteMatl())); if (!_privileges->check("MaintainWoMaterials")) menuItem->setEnabled(false); } pMenu->addSeparator(); if (status == "O" || status == "E" || status == "R" || status == "I") { menuItem = pMenu->addAction(tr("Issue..."), this, SLOT(sIssueMatl())); if (!_privileges->check("IssueWoMaterials")) menuItem->setEnabled(false); } if (status == "I") { menuItem = pMenu->addAction(tr("Return..."), this, SLOT(sReturnMatl())); if (!_privileges->check("ReturnWoMaterials")) menuItem->setEnabled(false); menuItem = pMenu->addAction(tr("Scrap..."), this, SLOT(sScrapMatl())); if (!_privileges->check("ScrapWoMaterials")) menuItem->setEnabled(false); } if (status == "O" || status == "E") { menuItem = pMenu->addAction(tr("Substitute..."), this, SLOT(sSubstituteMatl())); if (!_privileges->check("MaintainWoMaterials")) menuItem->setEnabled(false); } pMenu->addSeparator(); } menuItem = pMenu->addAction(tr("Availability..."), this, SLOT(sViewMatlAvailability())); menuItem = pMenu->addAction(tr("Substitute Availability..."), this, SLOT(sViewMatlSubstituteAvailability())); } } void workOrder::populate() { XSqlQuery workpopulate; XSqlQuery wo; wo.prepare( "SELECT wo_itemsite_id, wo_priority, wo_status," " formatWoNumber(wo_id) AS f_wonumber," " wo_qtyord," " wo_qtyrcv," " wo_startdate, wo_duedate," " wo_wipvalue," " wo_postedvalue," " wo_postedvalue-wo_wipvalue AS rcvdvalue," " wo_prodnotes, wo_prj_id, " " wo_bom_rev_id, wo_boo_rev_id, " " wo_cosmethod " "FROM wo " "WHERE (wo_id=:wo_id);" ); wo.bindValue(":wo_id", _woid); wo.exec(); if (wo.first()) { _oldPriority = wo.value("wo_priority").toInt(); _oldStartDate = wo.value("wo_startdate").toDate(); _oldDueDate = wo.value("wo_duedate").toDate(); _woNumber->setText(wo.value("f_wonumber").toString()); _item->setItemsiteid(wo.value("wo_itemsite_id").toInt()); _priority->setValue(_oldPriority); _postedValue->setText(wo.value("wo_postedvalue").toDouble()); _rcvdValue->setText(wo.value("rcvdvalue").toDouble()); _wipValue->setText(wo.value("wo_wipvalue").toDouble()); if (wo.value("wo_qtyord").toDouble() < 0) _disassembly->setChecked(true); _oldQty = (wo.value("wo_qtyord").toDouble() * _sense); _qty->setDouble(wo.value("wo_qtyord").toDouble() * _sense); _qtyReceived->setDouble(wo.value("wo_qtyrcv").toDouble()); _startDate->blockSignals(true); _dueDate->blockSignals(true); _startDate->setDate(wo.value("wo_startdate").toDate()); _dueDate->setDate(wo.value("wo_duedate").toDate()); _startDate->blockSignals(false); _dueDate->blockSignals(false); _productionNotes->setText(wo.value("wo_prodnotes").toString()); _comments->setId(_woid); _documents->setId(_woid); _project->setId(wo.value("wo_prj_id").toInt()); _bomRevision->setId(wo.value("wo_bom_rev_id").toInt()); _booRevision->setId(wo.value("wo_boo_rev_id").toInt()); if (wo.value("wo_cosmethod").toString() == "D") _todate->setChecked(TRUE); else if (wo.value("wo_cosmethod").toString() == "P") _proportional->setChecked(TRUE); else _jobCosGroup->hide(); sFillList(); // If the W/O is closed or Released don't allow changing some items. if(wo.value("wo_status").toString() == "C" || wo.value("wo_status") == "R") { _priority->setEnabled(false); _qty->setEnabled(false); _dueDate->setEnabled(false); _startDate->setEnabled(false); } _startDate->setEnabled(true); _woNumber->setEnabled(false); _item->setReadOnly(true); _bomRevision->setEnabled(wo.value("wo_status").toString() == "O" && _privileges->boolean("UseInactiveRevisions")); _booRevision->setEnabled(wo.value("wo_status").toString() == "O" && _privileges->boolean("UseInactiveRevisions")); if ((_mode == cNew || _mode == cRelease) && (wo.value("wo_status").toString() == "I" || wo.value("wo_status").toString() == "C")) { if (_mode == cRelease) { workpopulate.prepare("SELECT releasePlannedOrder(:planord_id, FALSE) AS result;"); workpopulate.bindValue(":planord_id", _planordid); workpopulate.exec(); } _mode = cEdit; } _assembly->setEnabled(false); _disassembly->setEnabled(false); _warehouse->setEnabled(false); _comments->setReadOnly(false); _documents->setReadOnly(false); _leadTimeLit->hide(); _leadTime->hide(); _daysLit->hide(); if (_mode != cNew) _printTraveler->hide(); _bottomSpacer->hide(); _save->setEnabled(true); } else if (wo.lastError().type() != QSqlError::NoError) { systemError(this, tr("A System Error occurred at %1::%2, W/O ID %3.") .arg(__FILE__) .arg(__LINE__) .arg(_woid) ); if(_captive) close(); } } qt-client-4.1.0/guiclient/workOrder.h000066400000000000000000000054351217451700100175330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef WORKORDER_H #define WORKORDER_H #include "guiclient.h" #include "xwidget.h" #include #include #include "ui_workOrder.h" class workOrder : public XWidget, public Ui::workOrder { Q_OBJECT public: workOrder(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~workOrder(); public slots: virtual SetResponse set( const ParameterList & pParams ); virtual void sCreate(); virtual void sUpdateStartDate(); virtual void sPopulateLeadTime( int pWarehousid ); virtual void sPopulateItemChar( int pItemid ); virtual void populate(); virtual void populateWoNumber(); virtual void sClose(); virtual void sHandleButtons(); virtual void sFillList(); virtual void sPostProduction(); virtual void sCorrectProductionPosting(); virtual void sRecallWO(); virtual void sReleaseWO(); virtual void sExplodeWO(); virtual void sImplodeWO(); virtual void sDeleteWO(); virtual void sCloseWO(); virtual void sChangeWOQty(); virtual void sChangeParentQty(); virtual void sInventoryAvailabilityByWorkOrder(); virtual void sPrintTraveler(); virtual void sReprioritizeWo(); virtual void sReprioritizeParent(); virtual void sRescheduleWO(); virtual void sRescheduleParent(); virtual void sDspRunningAvailability(); virtual void sIssueMatlBatch(); virtual void sReturnMatlBatch(); virtual void sIssueMatl(); virtual void sReturnMatl(); virtual void sScrapMatl(); virtual void sNewMatl(); virtual void sEditMatl(); virtual void sViewMatl(); virtual void sDeleteMatl(); virtual void sViewMatlAvailability(); virtual void sViewMatlSubstituteAvailability(); virtual void sSubstituteMatl(); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * selected ); virtual void sSaveClicked(); virtual bool sSave(); virtual void sNumberChanged(); protected slots: virtual void languageChange(); signals: void saved(int); private: bool _captive; int _planordid; int _sense; int _sourceid; QString _planordtype; int _mode; int _lastWarehousid; int _lastItemid; QStandardItemModel * _itemchar; int _woid; int _wonumber; int _oldPriority; QDate _oldStartDate; QDate _oldDueDate; double _oldQty; }; #endif // WORKORDER_H qt-client-4.1.0/guiclient/workOrder.ui000066400000000000000000001035711217451700100177210ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. workOrder true 0 0 718 615 0 0 Work Order 12 Work Order #: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Qt::Horizontal QSizePolicy::Expanding 272 22 false &Save &Cancel 0 0 Qt::StrongFocus Site: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter WComboBox::Supply Qt::Horizontal 71 20 12 false Assembly true false Disassembly Qt::Horizontal 40 20 0 27 Qty. Ordered: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight 0 27 Qty. Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Lead Time: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 16777215 16777215 999 Days Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter 0 27 Due Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 0 27 Start Date: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter false Qt::Vertical 20 0 5 Project #: Qt::Vertical 20 0 200 0 Qt::StrongFocus 16777215 15777215 1 99 Qt::Horizontal QSizePolicy::Expanding 16 10 Priority: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 0 &Print Traveler 0 0 0 1 Qt::StrongFocus 0 Detail Show 12 Operations Materials Indented Qt::Horizontal 40 20 Notes 5 5 Qt::ClickFocus true Characteristics Qt::ClickFocus QAbstractItemView::AllEditTriggers false false Comments 5 5 Qt::ClickFocus Comments::WorkOrder Costing Accumulated Costs Posted: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 60 20 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Received: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 20 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter WIP: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 20 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Cost Recognition Qt::ClickFocus To Date true Qt::ClickFocus Proportional Qt::Vertical QSizePolicy::Fixed 20 20 Qt::Horizontal 40 20 Qt::Vertical 20 0 Revision 0 0 Bill of Materials Qt::ClickFocus false RevisionLineEdit::Use RevisionLineEdit::BOM Bill of Operations Qt::ClickFocus false RevisionLineEdit::Use RevisionLineEdit::BOO Qt::Horizontal 40 20 Qt::Vertical 241 16 Documents Documents::WorkOrder Comments QWidget

    comments.h
    DLineEdit QWidget
    datecluster.h
    1
    Documents QWidget
    documents.h
    ItemCluster QWidget
    itemcluster.h
    1
    ProjectCluster QWidget
    projectcluster.h
    RevisionCluster QWidget
    revisioncluster.h
    WComboBox XComboBox
    wcombobox.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    XTreeWidget QTreeWidget
    xtreewidget.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _woNumber _item _warehouse _assembly _disassembly _qty _leadTime _dueDate _startDate _priority _project _tabs _showOperations _showMaterials _indented _woIndentedList _productionNotes _itemcharView _comments _todate _proportional _bomRevision _booRevision _printTraveler _save _close _item newId(int) _warehouse findItemsites(int) 51 90 458 91 _item warehouseIdChanged(int) _warehouse setId(int) 51 90 458 91 _item newId(int) _bomRevision setTargetId(int) 237 85 156 397 _item newId(int) _booRevision setTargetId(int) 237 85 381 397 qt-client-4.1.0/guiclient/workOrderMaterials.cpp000066400000000000000000000434401217451700100217260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "workOrderMaterials.h" #include #include #include #include #include #include "dspInventoryAvailability.h" #include "dspSubstituteAvailabilityByItem.h" #include "inputManager.h" #include "returnWoMaterialItem.h" #include "storedProcErrorLookup.h" #include "substituteList.h" #include "woMaterialItem.h" workOrderMaterials::workOrderMaterials(QWidget* parent, const char* name, Qt::WFlags fl) : XWidget(parent, name, fl) { setupUi(this); connect(_wo, SIGNAL(newId(int)), this, SLOT(sFillList())); connect(_womatl, SIGNAL(populateMenu(QMenu *, QTreeWidgetItem *, int)), this, SLOT(sPopulateMenu(QMenu*,QTreeWidgetItem*))); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); _wo->setType(cWoExploded | cWoIssued | cWoReleased); _pickNumber->setPrecision(omfgThis->qtyVal()); _nonPickNumber->setPrecision(omfgThis->qtyVal()); _totalNumber->setPrecision(omfgThis->qtyVal()); _pickQtyPer->setPrecision(omfgThis->qtyPerVal()); _nonPickQtyPer->setPrecision(omfgThis->qtyPerVal()); _totalQtyPer->setPrecision(omfgThis->qtyPerVal()); _currentActCost->setPrecision(omfgThis->costVal()); _currentStdCost->setPrecision(omfgThis->costVal()); _maxCost->setPrecision(omfgThis->costVal()); omfgThis->inputManager()->notify(cBCWorkOrder, this, _wo, SLOT(setId(int))); _womatl->addColumn(tr("Component Item"), _itemColumn, Qt::AlignLeft, true, "item_number"); _womatl->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); _womatl->addColumn(tr("Iss. Meth."), _orderColumn, Qt::AlignCenter, true, "issuemethod"); _womatl->addColumn(tr("Iss. UOM"), _uomColumn, Qt::AlignLeft, true, "uom_name"); _womatl->addColumn(tr("Fxd. Qty."), _qtyColumn, Qt::AlignRight, true, "womatl_qtyfxd"); _womatl->addColumn(tr("Qty. Per"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyper"); _womatl->addColumn(tr("Scrap %"), _prcntColumn, Qt::AlignRight, true, "womatl_scrap"); _womatl->addColumn(tr("Required"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyreq"); _womatl->addColumn(tr("Issued"), _qtyColumn, Qt::AlignRight, true, "womatl_qtyiss"); _womatl->addColumn(tr("Scrapped"), _qtyColumn, Qt::AlignRight, true, "womatl_qtywipscrap"); _womatl->addColumn(tr("Balance"), _qtyColumn, Qt::AlignRight, true, "balance"); _womatl->addColumn(tr("Due Date"), _dateColumn, Qt::AlignCenter, true, "womatl_duedate"); _womatl->addColumn(tr("Notes"), _itemColumn, Qt::AlignLeft, false, "womatl_notes"); _womatl->addColumn(tr("Reference"), _itemColumn, Qt::AlignLeft, false, "womatl_ref"); if (_privileges->check("MaintainWoMaterials")) { connect(_womatl, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_womatl, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_womatl, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_womatl, SIGNAL(itemSelected(int)), _edit, SLOT(animateClick())); } else { _new->setEnabled(FALSE); connect(_womatl, SIGNAL(itemSelected(int)), _view, SLOT(animateClick())); } if (!_privileges->check("ViewCosts")) { _currentStdCostLit->hide(); _currentActCostLit->hide(); _maxCostLit->hide(); _currentStdCost->hide(); _currentActCost->hide(); _maxCost->hide(); } connect(omfgThis, SIGNAL(workOrderMaterialsUpdated(int, int, bool)), this, SLOT(sCatchMaterialsUpdated(int, int, bool))); } workOrderMaterials::~workOrderMaterials() { // no need to delete child widgets, Qt does it all for us } void workOrderMaterials::languageChange() { retranslateUi(this); } enum SetResponse workOrderMaterials::set(const ParameterList &pParams) { XWidget::set(pParams); QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) { _wo->setId(param.toInt()); _wo->setEnabled(false); } return NoError; } void workOrderMaterials::sPopulateMenu(QMenu *pMenu, QTreeWidgetItem *) { QAction *menuItem; menuItem = pMenu->addAction(tr("Edit..."), this, SLOT(sEdit())); menuItem = pMenu->addAction(tr("View..."), this, SLOT(sView())); menuItem = pMenu->addAction(tr("Delete..."), this, SLOT(sDelete())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Availability..."), this, SLOT(sViewAvailability())); pMenu->addSeparator(); menuItem = pMenu->addAction(tr("View Item-Defined Subsitute Availability..."), this, SLOT(sViewSubstituteAvailability())); menuItem = pMenu->addAction(tr("Substitute..."), this, SLOT(sSubstitute())); } void workOrderMaterials::sNew() { ParameterList params; params.append("mode", "new"); params.append("wo_id", _wo->id()); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void workOrderMaterials::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("womatl_id", _womatl->id()); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void workOrderMaterials::sView() { ParameterList params; params.append("mode", "view"); params.append("womatl_id", _womatl->id()); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void workOrderMaterials::sDelete() { XSqlQuery workDelete; int womatlid = _womatl->id(); if (_womatl->currentItem()->rawValue("womatl_qtyiss").toDouble() > 0) { if(_privileges->check("ReturnWoMaterials")) { if (QMessageBox::question(this, tr("W/O Material Requirement cannot be Deleted"), tr("

    This W/O Material Requirement cannot " "be deleted as it has has material issued " "to it. You must return this material to " "stock before you can delete this Material " "Requirement. Would you like to return this " "material to stock now?" ), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) { ParameterList params; params.append("womatl_id", womatlid); returnWoMaterialItem newdlg(omfgThis, "", TRUE); newdlg.set(params); newdlg.exec(); sFillList(); workDelete.prepare("SELECT womatl_qtyiss AS qtyissued " "FROM womatl " "WHERE (womatl_id=:womatl_id) "); workDelete.bindValue(":womatl_id", womatlid); workDelete.exec(); if (!workDelete.first() || workDelete.value("qtyissued").toInt() != 0) return; } else return; } else { QMessageBox::critical( this, tr("W/O Material Requirement cannot be Deleted"), tr("

    This W/O Material Requirement cannot be " "deleted as it has material issued to it. " "You must return this material to stock before " "you can delete this Material Requirement." ) ); return; } } workDelete.prepare("SELECT deleteWoMaterial(:womatl_id);"); workDelete.bindValue(":womatl_id", womatlid); workDelete.exec(); if (workDelete.first()) { int result = workDelete.value("result").toInt(); if (result < 0) { systemError(this, storedProcErrorLookup("deleteWoMaterial", result), __FILE__, __LINE__); return; } } else if (workDelete.lastError().type() != QSqlError::NoError) { systemError(this, workDelete.lastError().databaseText(), __FILE__, __LINE__); return; } omfgThis->sWorkOrderMaterialsUpdated(_wo->id(), _womatl->id(), TRUE); } void workOrderMaterials::sViewAvailability() { XSqlQuery workViewAvailability; workViewAvailability.prepare( "SELECT womatl_itemsite_id, womatl_duedate " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); workViewAvailability.bindValue(":womatl_id", _womatl->id()); workViewAvailability.exec(); if (workViewAvailability.first()) { ParameterList params; params.append("itemsite_id", workViewAvailability.value("womatl_itemsite_id")); params.append("byDate", workViewAvailability.value("womatl_duedate")); params.append("run"); dspInventoryAvailability *newdlg = new dspInventoryAvailability(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (workViewAvailability.lastError().type() != QSqlError::NoError) { systemError(this, workViewAvailability.lastError().databaseText(), __FILE__, __LINE__); return; } } void workOrderMaterials::sViewSubstituteAvailability() { XSqlQuery workViewSubstituteAvailability; workViewSubstituteAvailability.prepare( "SELECT womatl_itemsite_id, womatl_duedate " "FROM womatl " "WHERE (womatl_id=:womatl_id);" ); workViewSubstituteAvailability.bindValue(":womatl_id", _womatl->id()); workViewSubstituteAvailability.exec(); if (workViewSubstituteAvailability.first()) { ParameterList params; params.append("itemsite_id", workViewSubstituteAvailability.value("womatl_itemsite_id")); params.append("byDate", workViewSubstituteAvailability.value("womatl_duedate")); params.append("run"); dspSubstituteAvailabilityByItem *newdlg = new dspSubstituteAvailabilityByItem(); newdlg->set(params); omfgThis->handleNewWindow(newdlg); } else if (workViewSubstituteAvailability.lastError().type() != QSqlError::NoError) { systemError(this, workViewSubstituteAvailability.lastError().databaseText(), __FILE__, __LINE__); return; } } void workOrderMaterials::sSubstitute() { XSqlQuery workSubstitute; int womatlid = _womatl->id(); XSqlQuery sub; sub.prepare( "SELECT womatl.*," " itemuomtouom(itemsite_item_id, womatl_uom_id, NULL, womatl_qtyper) AS qtyper," " itemuomtouom(itemsite_item_id, womatl_uom_id, NULL, womatl_qtyfxd) AS qtyfxd " "FROM womatl JOIN itemsite ON (womatl_itemsite_id=itemsite_id) " "WHERE (womatl_id=:womatl_id);" ); sub.bindValue(":womatl_id", womatlid); sub.exec(); if (sub.first()) { ParameterList params; params.append("womatl_id", womatlid); params.append("byDate", sub.value("womatl_duedate")); params.append("run"); substituteList substitute(this, "", TRUE); substitute.set(params); int result = substitute.exec(); if (result != XDialog::Rejected) { ParameterList params; params.append("mode", "new"); params.append("wo_id", sub.value("womatl_wo_id")); params.append("bomitem_id", sub.value("womatl_bomitem_id")); params.append("item_id", result); params.append("qtyFxd", (sub.value("qtyfxd").toDouble() * substitute._uomratio)); params.append("qtyPer", (sub.value("qtyper").toDouble() * substitute._uomratio)); params.append("scrap", (sub.value("womatl_scrap").toDouble() * 100.0)); params.append("notes", sub.value("womatl_notes")); params.append("reference", sub.value("womatl_ref")); params.append("picklist", sub.value("womatl_picklist")); if (sub.value("womatl_issuemethod").toString() == "S") params.append("issueMethod", "push"); else if (sub.value("womatl_issuemethod").toString() == "L") params.append("issueMethod", "pull"); else if (sub.value("womatl_issuemethod").toString() == "M") params.append("issueMethod", "mixed"); woMaterialItem newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != XDialog::Rejected) { workSubstitute.prepare( "DELETE FROM womatl " "WHERE (womatl_id=:womatl_id);" ); workSubstitute.bindValue(":womatl_id", womatlid); workSubstitute.exec(); omfgThis->sWorkOrderMaterialsUpdated(_wo->id(), _womatl->id(), TRUE); } } } else if (workSubstitute.lastError().type() != QSqlError::NoError) { systemError(this, workSubstitute.lastError().databaseText(), __FILE__, __LINE__); return; } } void workOrderMaterials::sCatchMaterialsUpdated(int pWoid, int, bool) { if (pWoid == _wo->id()) sFillList(); } void workOrderMaterials::sFillList() { XSqlQuery workFillList; if (_wo->isValid()) { workFillList.prepare( "SELECT womatl_id, *," " (item_descrip1 || ' ' || item_descrip2) AS description," " CASE WHEN (womatl_issuemethod = 'S') THEN :push" " WHEN (womatl_issuemethod = 'L') THEN :pull" " WHEN (womatl_issuemethod = 'M') THEN :mixed" " ELSE :error" " END AS issuemethod," " 'qty' AS womatl_qtyfxd_xtnumericrole," " 'qtyper' AS womatl_qtyper_xtnumericrole," " 'percent' AS womatl_scrap_xtnumericrole," " 'qty' AS womatl_qtyreq_xtnumericrole," " 'qty' AS womatl_qtyiss_xtnumericrole," " 'qty' AS womatl_qtywipscrap_xtnumericrole," " noNeg(womatl_qtyreq - womatl_qtyiss) AS balance," " 'qty' AS balance_xtnumericrole," " CASE WHEN (womatl_duedate <= CURRENT_DATE) THEN 'expired'" " END AS womatl_duedate_qtforegroundrole " "FROM wo, womatl, itemsite, item, uom " "WHERE ( (womatl_wo_id=wo_id)" " AND (womatl_uom_id=uom_id)" " AND (womatl_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (wo_id=:wo_id) ) " "ORDER BY item_number;" ); workFillList.bindValue(":wo_id", _wo->id()); workFillList.bindValue(":push", tr("Push")); workFillList.bindValue(":pull", tr("Pull")); workFillList.bindValue(":mixed", tr("Mixed")); workFillList.bindValue(":error", tr("Error")); workFillList.exec(); _womatl->populate(workFillList); if (workFillList.lastError().type() != QSqlError::NoError) { systemError(this, workFillList.lastError().databaseText(), __FILE__, __LINE__); return; } workFillList.prepare( "SELECT item_picklist," " COUNT(*) AS total," " COALESCE(SUM(womatl_qtyper * (1 + womatl_scrap))) AS qtyper " "FROM womatl, itemsite, item " "WHERE ( (womatl_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (womatl_wo_id=:wo_id) ) " "GROUP BY item_picklist;" ); workFillList.bindValue(":wo_id", _wo->id()); workFillList.exec(); bool foundPick = FALSE; bool foundNonPick = FALSE; int totalNumber = 0; double totalQtyPer = 0.0; while (workFillList.next()) { totalNumber += workFillList.value("total").toInt(); totalQtyPer += workFillList.value("qtyper").toDouble(); if (workFillList.value("item_picklist").toBool()) { foundPick = TRUE; _pickNumber->setText(workFillList.value("total").toDouble()); _pickQtyPer->setText(formatQtyPer(workFillList.value("qtyper").toDouble())); } else { foundNonPick = TRUE; _nonPickNumber->setText(workFillList.value("total").toDouble()); _nonPickQtyPer->setText(formatQtyPer(workFillList.value("qtyper").toDouble())); } } if (workFillList.lastError().type() != QSqlError::NoError) { systemError(this, workFillList.lastError().databaseText(), __FILE__, __LINE__); return; } if (!foundPick) { _pickNumber->setText(QString("0").toDouble()); _pickQtyPer->setText(formatQtyPer(0.0)); } if (!foundNonPick) { _nonPickNumber->setText(QString("0").toDouble()); _nonPickQtyPer->setText(formatQtyPer(0.0)); } _totalNumber->setText(QString("%1").arg(totalNumber).toDouble()); _totalQtyPer->setText(totalQtyPer); if (_privileges->check("ViewCosts")) { workFillList.prepare( "SELECT p.item_maxcost AS f_maxcost," " COALESCE(SUM(itemuomtouom(ci.itemsite_item_id, womatl_uom_id, NULL, (womatl_qtyfxd + womatl_qtyper) * (1 + womatl_scrap)) * stdCost(c.item_id))) AS f_stdcost," " COALESCE(SUM(itemuomtouom(ci.itemsite_item_id, womatl_uom_id, NULL, (womatl_qtyfxd + womatl_qtyper) * (1 + womatl_scrap)) * actCost(c.item_id))) AS f_actcost " "FROM wo, womatl, itemsite AS ci, itemsite AS pi, item AS c, item AS p " "WHERE ( (womatl_wo_id=wo_id)" " AND (womatl_itemsite_id=ci.itemsite_id)" " AND (ci.itemsite_item_id=c.item_id)" " AND (wo_itemsite_id=pi.itemsite_id)" " AND (pi.itemsite_item_id=p.item_id)" " AND (wo_id=:wo_id) ) " "GROUP BY p.item_maxcost;" ); workFillList.bindValue(":wo_id", _wo->id()); workFillList.exec(); if (workFillList.first()) { _currentStdCost->setText(workFillList.value("f_stdcost").toDouble()); _currentActCost->setText(workFillList.value("f_actcost").toDouble()); _maxCost->setText(workFillList.value("f_maxcost").toDouble()); } else if (workFillList.lastError().type() != QSqlError::NoError) { systemError(this, workFillList.lastError().databaseText(), __FILE__, __LINE__); return; } } } else { _pickNumber->clear(); _pickQtyPer->clear(); _nonPickNumber->clear(); _nonPickQtyPer->clear(); _totalNumber->clear(); _totalQtyPer->clear(); } } qt-client-4.1.0/guiclient/workOrderMaterials.h000066400000000000000000000025601217451700100213710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef WORKORDERMATERIALS_H #define WORKORDERMATERIALS_H #include "guiclient.h" #include "xwidget.h" #include #include "ui_workOrderMaterials.h" class workOrderMaterials : public XWidget, public Ui::workOrderMaterials { Q_OBJECT public: workOrderMaterials(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = Qt::Window); ~workOrderMaterials(); public slots: virtual enum SetResponse set( const ParameterList & pParams ); virtual void sPopulateMenu( QMenu * pMenu, QTreeWidgetItem * pSelected ); virtual void sNew(); virtual void sEdit(); virtual void sView(); virtual void sDelete(); virtual void sViewAvailability(); virtual void sViewSubstituteAvailability(); virtual void sSubstitute(); virtual void sCatchMaterialsUpdated( int pWoid, int, bool ); virtual void sFillList(); protected slots: virtual void languageChange(); }; #endif // WORKORDERMATERIALS_H qt-client-4.1.0/guiclient/workOrderMaterials.ui000066400000000000000000000416631217451700100215660ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. workOrderMaterials 0 0 800 600 Maintain Work Order Materials 12 12 12 12 12 12 0 0 0 290 130 Qt::Horizontal QSizePolicy::Expanding 20 20 0 &Close Qt::Vertical QSizePolicy::Preferred 20 100 0 0 0 Material Requirements: Qt::AlignVCenter 0 0 0 100 80 0 Number Of Items Qt::AlignCenter 80 0 Total Qty. Per Qt::AlignCenter Pick List Items: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Non-Pick List Items: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Totals: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Current Std. Material Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Current Act. Material Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Maximum Desired Cost: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 80 0 80 0 80 0 Qt::Horizontal 40 20 0 5 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 20 WoCluster QWidget

    wocluster.h
    XLabel QLabel
    xlabel.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _wo _womatl _new _edit _view _delete _close _close clicked() workOrderMaterials close() 20 20 20 20 _womatl valid(bool) _view setEnabled(bool) 20 20 20 20 qt-client-4.1.0/guiclient/xTuple.ico000066400000000000000000000226761217451700100173670ustar00rootroot0000000000000000 ¨%(0`        !$&'&''(((('&%#   %8>=:<>?@@ABB=81--.011/--/5;BCBAA@?>== B>/ E[Œ ŸÏ •Ü •â ”ß •ß ”ß •ß ”ß ”ß ˜á †à2±sXI?93/0:BKXg§=áEàEàEáEáFáEáFàGãDÞJÕ0™Q2  §GÛ§ØÕ×Ù×ÖØÕØÕØÕØÖÛÕ ÐÙ •Ý/‹^kh^SKAGS^Z €BØbÝgÖg×f×f×f×e×eÚeØf¬UX  ) . ·HÒªÑÖÐ×ÑÓÑÔÑÔÑÔÑÕÔÒÏÛ ’×$mDSUWXTKF4RAÊ`ÞfÒdÓdÓdÓdÓdÓcÖcØc­[U  (6z€ÐAÓ¦ÓÕÒÕÓÓÒÓÓÓÑÓÒÓ×ÒÍàÑ2V.951/0:GÂbálÓhÔhÔhÔhÔiÔiÕiÖi±hMã•+MGDÁLÒ±ÒÖÒÔÒÒÑÓÑÓÒÓÒÓ×ÒÉÝ‹Ì97N  +&I #FÃe æo Óm Ôn Ôn Õm Õl Ôm Øn Øm ¸h _ÿ«ÿ& ÏUÓ¶ÒÖÓÕÒÓÑÓÑÓÒÒÒÓÖÐÄáŽÀ -;„¬  J ¬gëtÕr×q×r×s×s×sÙrÝt½qa " > (FL˜ÓSÔ±Ó×ÒÔÒÓÒÓÒÓÓÓÒÓÚÒÂꋺSg U­jï|Øw×xØxØxÙyÙyÙxÜwÃw`ÿÿHxÿÿËÿ}ÿ!ÒZ Ô»!ÔØ ÔÒ ÓÒ ÔÒ!ÔÒ!ÔÒ!ÔÒ"Ùҿ䉳àî5 v– Å}!ß~ Û~!Ú~!Ú~!Û~ Ü} Þ~"É~!nyn(½ÿÿ¬¤è.T²#Ôh$Ô¾$ÕÙ#ÕÔ$ÔÓ$ÔÓ$ÔÓ$ÔÓ#ÔÒ$ÙÏ!¼æ…­€%z„'Ñ„(ã„'Ü„(Ü…'܃(ä„(˃'tƒ2Ò3:ÿÀÿÿVa±KÎ&Ôg)Ô¹)ÔÙ(ÕÒ(ÕÓ(ÕÓ(ÔÒ)ÔÓ(ÕÓ)ÛÓ#»ìƒ¢ÿGˆ/ƒŠ0Њ/àŠ0ÞŠ0äŠ/Ћ0vˆ? N®ºvƒÍÿÿÿ‰K¯?Ò ,Õn,ÔÂ+ÔØ,ÔÒ+ÔÒ+ÔÑ*ÕÑ*ÕÑ+ÕÑ-ÚÓ%·æ•ÿW‘7‹7Ö7é7Í6€‹B ja?¥™‘çJµ¬ FÁ0Õ 0Ö|0ÖÅ0ÕØ/ÕÒ/ÖÑ/ÖÒ.ÖÑ0ÕÒ0ÖÑ1ÛÐ(²å}ˆÁL”>—•>Í•>zŒE ¦_9p‰­A½ÿ†ÿÿ?»Á@Ò4×|5ÖÀ3ÕÕ4ÕÓ4ÕÓ4ÕÒ4ÖÒ4ÕÒ4×Ñ6ÛÕ+°ì|{¤I!œFL˜NR¾imŒÿÿñÚ<Û:Ü‚9ØÎ8×Õ8×Ò8ÖÒ8ÖÒ8×Ñ8×Ñ8ØÑ9Ú×-«æ ~tdh^š+x±½ÿÿx"ÿ,œk9ÎØ<ØÓ<ÕÑ<ÖÑ<ÖÑ<ÖÒ;ÖÒ;×Ñ=ØÕ;ÖÏ4»³3¿ÿÿöÿãÿ"tO1 Õ?ÕØ@ÚÐ?ØÐ?ØÑ@ØÑ?ØÑ?×Ï@×ÔA×ÌAÙ‹Iù$]1-]H<Œ#ÿÿ¢´%qD2žÙBÔ×EÛÏDØÑCØÑDØÑEØÑDÙÐE×ÕE×ÎC×™G×'p>x|Dûg8LYº;ÿÃc3¦"c44œÖGÒÛIÛÎIØÑIÙÑIØÒIØÒHÙÑIÙÖHØÎIØ Kí2h<d•Uù´güŠOíc:KCÝÝbþœ9ÿ{Lÿ&g06˜ÑJÑáNÝÏLØÐLØÏLØÑLØÑLØÐMØÓMØÑKÚžNØ6qB[”Wþ½q÷ÃtîºnþUúg<E„F††YÿÿËÿpÿÿ$b&7•ËKÎÜRßÎOØÏOÙÏPÚÏPÙÏPÙÏOÚÑPØÒQتQÓ?k>I–[úÀuûÄwòÁvóÅxó¾tÿWïg>;ÿÿ*ÿÿ¡¯€V¡A8“ÅNÍÞTÝÌSÚÐSÙÏSÚÐSÙÐSÚÏTÚÒSÚÒSÚ°SÝHpED•]ðÄyþÉ}óÆ{ôÆ|ôÇ{ôÊ}óÀxü’Zêa@2ÿÿÿÿÿ¶ÿRt*Y:¾QËæZàÎXÚÑXÙÐXÚÐXÙÐXÚÐXÙÑWÙÔYÚ¬WÙK³j¢gßÄ|ÿÏ„öÌöÌöÌ‚öÌöË‚÷ЄõÃ|ÿ”^ìc=)lR ÿÿ Ìÿë&U;ޏSÇß^âÏ[ÚÏ[ÙÐ[ÙÏZÚÏZÚÏ[ÚÐ[ÛÕ[ÛµZÛP˃ Õ‹hÒˆÇφþφúφ÷χøÐ‡øÐ†øÐ†øÔ‰øÅ€ÿ“`ÝX: ^Ы´aÌÌ<“<Œ°UÅáaàÍ^ÛÐ_ÛÐ_ÚÐ^ÚÏ^ÛÐ^ÛÑ^ÛÔ^Ü·^Ü^AóõulVЋ`ÔŠÕÔ‹ÿÓ‹ûÓŠøÔ‹ùÔŒùÔŒúÓ‹ú׎ùŃÿ“b×R;u]8Uªÿÿþÿð!v ;ˆ§UÂçdãÎaÛÏaÛÏaÛÏ`ÛÎ`ÛÎ`ÜÎaÛÕ`Ú³_Ü^*‚ºM«’Å“×i×Ô×ý×ý×ûØû×û×û×ûÜ’úÇ…ÿ–dÕ?,|Oÿ@ÿÿÿÿ"™½'#<ˆ VÀåfãÓcÞÑbÜÑcÜÒbÜÑbÜÐbÜÐcÜÕcÛ»cÚe^î€%ìŒÿºyf”£¤Ø“sÚ“ÚÚ“ÿÚ“ÿÚ“ÿÚ“ÿÚ“ÿÚ“ÿÚ“ÿÞ–ÿLJÿ”dÇI+™yy€•ÔtÿPlAžW½æhâÑfÝÔfÝÔfÜÔfÝÔfÝÔfÝÕfÝÖeÜ¿fÜqlÎ SãÒ››‹ÿ¼³±nnê—Û–zÝ–æÜ–ÿÜ–ÿÜ–ÿÜ–ÿÜ–ÿÜ–ÿÜ–ÿâšÿLjÿ™iÊcÍÿ#‰R­`X½}léNgÝNeÚMiÝNiÝNiÝNgÜNgÜMhÞLhàMlÜzÎa—ÃAØkX׮ߚ\Þ™`Þ™`Þ™`Þ™`Þ™`Þ™`Ü™_ßš^í¢`Ɖ´|{ïÿðUªþZ×wÿQÛé$Øumæ#ÿýÿÿÿÿÿÿÿ´ Û‘ÿ[ׄÐ-ì(Οt–œl*ñ•æ~ÿFÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿðüü?øþ?øÿÿðÿÿ€àÿÿÀÀÿÿà€ÿÿð€ÿÿøà?ÿÿü`ÿÿþ0ÿÿÿÿÿÿÿ€ÿÿÿÿ€ÿÿÿÿÀÿÿÿÿ€ÿÿÿÿÿÿÿþ8ÿÿÿüpÿÿøà?ÿÿðÀÿÿà€ÿÿÀÀÿÿ€àÿÿðÿþ?øÿüüÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿqt-client-4.1.0/guiclient/xTupleDesigner.cpp000066400000000000000000000247231217451700100210530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xTupleDesigner.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include // TODO: can we live without this? // copied from .../qt-mac-commercial-src-4.4.3/tools/designer/src/lib/shared/qdesigner_integration_p.h #include "qdesigner_integration_p.h" // TODO: (re)move the following when the UI gets sorted out #include #include "xTupleDesignerActions.h" #include "xmainwindow.h" QDesignerFormEditorInterface *xTupleDesigner::_formeditor = 0; class WidgetBoxWindow : public XMainWindow { public: WidgetBoxWindow(xTupleDesigner *); protected: virtual void closeEvent(QCloseEvent *); private: QDesignerWidgetBoxInterface *_widgetbox; xTupleDesigner * _designer; }; WidgetBoxWindow::WidgetBoxWindow(xTupleDesigner *parent) : XMainWindow(parent, "_widgetBoxWindow", Qt::Tool) { _designer = parent; _widgetbox = QDesignerComponents::createWidgetBox(parent->formeditor(), this); parent->formeditor()->setWidgetBox(_widgetbox); setCentralWidget(_widgetbox); setWindowTitle(xTupleDesigner::tr("Widget Box")); } void WidgetBoxWindow::closeEvent(QCloseEvent * event) { if(_designer->_actions->sClose()) XMainWindow::closeEvent(event); else event->ignore(); } class ObjectInspectorWindow : public XMainWindow { public: ObjectInspectorWindow(xTupleDesigner *); private: QDesignerObjectInspectorInterface *_objinsp; }; ObjectInspectorWindow::ObjectInspectorWindow(xTupleDesigner *parent) :XMainWindow(parent, "_objectInspectorWindow", Qt::Tool) { _objinsp = QDesignerComponents::createObjectInspector(parent->formeditor(), this); parent->formeditor()->setObjectInspector(_objinsp); setCentralWidget(_objinsp); setWindowTitle(xTupleDesigner::tr("Object Inspector")); } class PropertyEditorWindow : public XMainWindow { public: PropertyEditorWindow(xTupleDesigner *); private: QDesignerPropertyEditorInterface *_propeditor; }; PropertyEditorWindow::PropertyEditorWindow(xTupleDesigner *parent) : XMainWindow(parent, "_propertyEditorWindow", Qt::Tool) { _propeditor = QDesignerComponents::createPropertyEditor(parent->formeditor(), this); parent->formeditor()->setPropertyEditor(_propeditor); setCentralWidget(_propeditor); setWindowTitle(xTupleDesigner::tr("Property Editor")); } class SignalSlotEditorWindow : public XMainWindow { public: SignalSlotEditorWindow(xTupleDesigner *); private: QWidget *_sloteditor; }; SignalSlotEditorWindow::SignalSlotEditorWindow(xTupleDesigner *parent) : XMainWindow(parent, "_signalSlotEditorWindow", Qt::Tool) { _sloteditor = QDesignerComponents::createSignalSlotEditor(parent->formeditor(), this); setCentralWidget(_sloteditor); setWindowTitle(xTupleDesigner::tr("Signal/Slot Editor")); } xTupleDesigner::xTupleDesigner(QWidget* parent, const char* name, Qt::WFlags fl) : XMainWindow(parent, name, fl) { _formEnabled = true; _formId = -1; _notes = QString(); _order = 0; _source = 0; _formwindow = 0; _widgetwindow = 0; _objinspwindow = 0; _propinspwindow = 0; _slotedwindow = 0; setForceFloat(true); if(!_formeditor) { _formeditor = QDesignerComponents::createFormEditor(omfgThis); if (! _formeditor) { QMessageBox::information(this, QString("Cannot edit the UI"), QString("

    The application could not open the " "form editor.")); return; } } QDesignerComponents::createTaskMenu(_formeditor, this); QList builtinPlugins = QPluginLoader::staticInstances(); for (int i = 0; i < builtinPlugins.size(); i++) { QDesignerFormEditorPluginInterface *plugin = qobject_cast(builtinPlugins.at(i)); if (plugin && ! plugin->isInitialized()) plugin->initialize(_formeditor); } QDesignerComponents::initializePlugins(_formeditor); //QDesignerComponents::initializeResources(); // done elsewhere _actions = new xTupleDesignerActions(this); _menubar = new QMenuBar(this); _menubar->setObjectName("_xTupleDesignerMenuBar"); _filemenu = _menubar->addMenu(tr("&File")); foreach (QAction *a, _actions->fileActions()->actions()) _filemenu->addAction(a); _editmenu = _menubar->addMenu(tr("&Edit")); foreach (QAction *a, _actions->editActions()->actions()) _editmenu->addAction(a); _editmenu->addSeparator(); foreach (QAction *action, _actions->toolActions()->actions()) _editmenu->addAction(action); _formmenu = _menubar->addMenu(tr("&Form")); foreach (QAction *a, _actions->formActions()->actions()) _formmenu->addAction(a); _toolmenu = _menubar->addMenu(tr("&Tool")); _widgetwindow = new WidgetBoxWindow(this); _objinspwindow = new ObjectInspectorWindow(this); _propinspwindow = new PropertyEditorWindow(this); _slotedwindow = new SignalSlotEditorWindow(this); _toolmenu->addAction(_widgetwindow->action()); _toolmenu->addAction(_objinspwindow->action()); _toolmenu->addAction(_propinspwindow->action()); _toolmenu->addAction(_slotedwindow->action()); _formeditor->setTopLevel(_widgetwindow); #ifndef Q_WS_MAC _widgetwindow->setMenuBar(_menubar); _widgetwindow->action()->setVisible(false); #endif _widgetwindow->setForceFloat(true); _objinspwindow->setForceFloat(true); _propinspwindow->setForceFloat(true); _slotedwindow->setForceFloat(true); //_widgetwindow->addToolBar(m_fileToolBar); //_widgetwindow->addToolBar(m_editToolBar); //_widgetwindow->addToolBar(m_toolToolBar); //_widgetwindow->addToolBar(m_formToolBar); //_widgetwindow->insertToolBarBreak(m_formToolBar); omfgThis->handleNewWindow(_widgetwindow); _widgetwindow->setAttribute(Qt::WA_DeleteOnClose, false); omfgThis->handleNewWindow(_objinspwindow); _objinspwindow->setAttribute(Qt::WA_DeleteOnClose, false); omfgThis->handleNewWindow(_propinspwindow); _propinspwindow->setAttribute(Qt::WA_DeleteOnClose, false); omfgThis->handleNewWindow(_slotedwindow); _slotedwindow->setAttribute(Qt::WA_DeleteOnClose, false); // resource editor; // action editor; _integration = new qdesigner_internal::QDesignerIntegration(_formeditor, this); _formeditor->setIntegration(_integration); // toolbar creation _formwindow = _formeditor->formWindowManager()->createFormWindow(this, Qt::Window); //qDebug() << "_formwindow->hasFeature(EditFeature) = " << _formwindow->hasFeature(QDesignerFormWindowInterface::EditFeature); _formeditor->formWindowManager()->setActiveFormWindow(_formwindow); _formeditor->objectInspector()->setFormWindow(_formwindow); _formwindow->editWidgets(); QWidget *placeholder = new QWidget(this); setCentralWidget(placeholder); QHBoxLayout *editorLayout = new QHBoxLayout(placeholder); editorLayout->addWidget(_formwindow); _designer = _formeditor->topLevel(); if (_designer) { _designer->setObjectName("_designer"); omfgThis->handleNewWindow(_designer, Qt::NonModal, true); } } xTupleDesigner::~xTupleDesigner() { //if (_objinspwindow) _objinspwindow->deleteLater(); //if (_propinspwindow) _propinspwindow->deleteLater(); //if (_slotedwindow) _slotedwindow->deleteLater(); //if (_widgetwindow) _widgetwindow->deleteLater(); ////if (_designer) _designer->deleteLater(); //if (_formeditor) _formeditor->deleteLater(); //if (_formwindow) _formwindow->deleteLater(); } QString xTupleDesigner::name() { QDomDocument xmldoc("UIFile"); _source->reset(); xmldoc.setContent(_source); QDomNode classnode = xmldoc.documentElement().firstChildElement("class"); if (classnode.isNull()) { qWarning("xTupleDesigner::name() classnode is null"); return QString(); } if (classnode.toElement().tagName() != "class") { qWarning("xTupleDesigner::name() first child %s, not a class element", qPrintable(classnode.toElement().tagName() )); return QString(); } return classnode.toElement().text(); } void xTupleDesigner::setFormEnabled(bool p) { _formEnabled = p; emit formEnabledChanged(p); } void xTupleDesigner::setFormId(int p) { _formId = p; emit formIdChanged(p); } void xTupleDesigner::setNotes(QString p) { _notes = p; emit notesChanged(p); } void xTupleDesigner::setOrder(int p) { _order = p; emit orderChanged(p); } void xTupleDesigner::setSource(QIODevice *psrc, QString pfilename) { if (! psrc || ! _formwindow) return; if (! psrc->open(QIODevice::ReadOnly | QIODevice::Text)) { qWarning("could not open .UI"); return; } _source = psrc; _formwindow->setContents(_source); _source->reset(); _formwindow->setFileName(pfilename); emit nameChanged(name()); emit sourceChanged(_formwindow->contents()); } void xTupleDesigner::setSource(QString psrc) { _source->close(); // TODO: memory leak? _source = new QBuffer(new QByteArray(psrc.toUtf8()), this); _source->open(QIODevice::ReadOnly | QIODevice::Text); _formwindow->setContents(_source); // crashes HERE in QMetaObject::changeGuard () _source->reset(); _formwindow->setFileName(""); emit nameChanged(name()); emit sourceChanged(_formwindow->contents()); } QString xTupleDesigner::source() { return _formwindow->contents(); } void xTupleDesigner::closeEvent(QCloseEvent * event) { if(_actions->sClose()) { if (_objinspwindow) _objinspwindow->hide(); if (_propinspwindow) _propinspwindow->hide(); if (_slotedwindow) _slotedwindow->hide(); if (_widgetwindow) _widgetwindow->hide(); if (_formwindow) _formwindow->hide(); XMainWindow::closeEvent(event); } else event->ignore(); } qt-client-4.1.0/guiclient/xTupleDesigner.h000066400000000000000000000070141217451700100205120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XTUPLEDESIGNER_H #define XTUPLEDESIGNER_H #include "guiclient.h" #include "xmainwindow.h" class QDesignerFormEditorInterface; class QDesignerFormWindowInterface; class QDesignerFormWindowManagerInterface; class QDesignerIntegrationInterface; class QDesignerObjectInspectorInterface; class QDesignerPropertyEditorInterface; class QDesignerWidgetBoxInterface; class QIODevice; class QMenu; class WidgetBoxWindow; class xTupleDesignerActions; class xTupleDesigner : public XMainWindow { Q_OBJECT public: xTupleDesigner(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); ~xTupleDesigner(); QDesignerFormEditorInterface *formeditor() { return _formeditor; } virtual bool formEnabled() { return _formEnabled; } virtual int formId() { return _formId; } QDesignerFormWindowInterface *formwindow() { return _formwindow; } virtual QString name(); virtual QString notes() const { return _notes; } virtual int order() { return _order; } virtual XMainWindow *objinspwindow() { return _objinspwindow; } virtual XMainWindow *propinspwindow() { return _propinspwindow; } virtual XMainWindow *slotedwindow() { return _slotedwindow; } virtual QString source(); virtual XMainWindow *widgetwindow() { return _widgetwindow; } public slots: virtual void setFormEnabled(bool p); virtual void setFormId(int p); virtual void setNotes(QString p); virtual void setOrder(int p); virtual void setSource(QIODevice *, QString = QString()); virtual void setSource(QString); virtual void sRevert() { setSource(_source); } signals: void formEnabledChanged(bool); void formIdChanged(int); void nameChanged(QString); void notesChanged(QString); void orderChanged(int); void sourceChanged(QString); protected: virtual void closeEvent(QCloseEvent *); private: friend class WidgetBoxWindow; QWidget *_designer; static QDesignerFormEditorInterface *_formeditor; bool _formEnabled; int _formId; QDesignerFormWindowInterface *_formwindow; QDesignerIntegrationInterface *_integration; QString _notes; XMainWindow *_objinspwindow; int _order; XMainWindow *_propinspwindow; XMainWindow *_slotedwindow; QIODevice *_source; XMainWindow *_widgetwindow; QMenuBar *_menubar; QMenu *_editmenu; QMenu *_filemenu; QMenu *_formmenu; QMenu *_toolmenu; xTupleDesignerActions *_actions; }; #endif // XTUPLEDESIGNER_H qt-client-4.1.0/guiclient/xTupleDesignerActions.cpp000066400000000000000000000312451217451700100223710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xTupleDesignerActions.h" #include #include #include #include #include #include // TODO: can we live without this? // copied from .../qt-mac-commercial-src-4.4.3/tools/designer/src/lib/shared/pluginmanager_p.h #include "pluginmanager_p.h" #include "xTupleDesigner.h" #define DEBUG false static QAction *separator(QObject *parent) { QAction *sep = new QAction(parent); sep->setSeparator(true); return sep; } xTupleDesignerActions::xTupleDesignerActions(xTupleDesigner *parent) : QObject(parent) { _designer = parent; _fileActions = new QActionGroup(parent); _fileActions->setObjectName("_fileActions"); _fileActions->setExclusive(false); QAction *closeAct = new QAction(tr("&Close"), this); QAction *openAct = new QAction(tr("&Open..."), this); QAction *revertAct = new QAction(tr("&Revert"), this); QAction *saveAct = new QAction(tr("&Save..."), this); closeAct->setShortcut(tr("CTRL+W")); openAct->setShortcut(tr("CTRL+O")); revertAct->setShortcut(tr("CTRL+R")); saveAct->setShortcut(tr("CTRL+S")); connect(closeAct, SIGNAL(triggered()), this, SLOT(sClose())); connect(openAct, SIGNAL(triggered()), this, SLOT(sOpen())); connect(revertAct, SIGNAL(triggered()), this, SLOT(sRevert())); connect(saveAct, SIGNAL(triggered()), this, SLOT(sSave())); _fileActions->addAction(revertAct); _fileActions->addAction(separator(this)); _fileActions->addAction(openAct); _fileActions->addAction(saveAct); _fileActions->addAction(separator(this)); _fileActions->addAction(closeAct); _editActions = new QActionGroup(parent); _editActions->setObjectName("_editActions"); _editActions->setExclusive(false); QDesignerFormWindowManagerInterface *formwm = parent->formeditor()->formWindowManager(); //QAction *editBuddiesAct = new QAction(tr("Edit Buddies"), this); //QAction *editSignalSlotAct = new QAction(tr("Edit Signal/Slot Connections"), this); //QAction *editTabOrderAct = new QAction(tr("Edit Tab Order"), this); //QAction *editWidgetsAct = new QAction(tr("Edit Widgets"), this); QAction *redoAct = formwm->actionRedo(); QAction *undoAct = formwm->actionUndo(); undoAct->setShortcut(tr("CTRL+Z")); redoAct->setShortcut(tr("CTRL+SHIFT+Z")); _editActions->addAction(undoAct); _editActions->addAction(redoAct); _editActions->addAction(separator(this)); _editActions->addAction(formwm->actionCut()); _editActions->addAction(formwm->actionCopy()); _editActions->addAction(formwm->actionPaste()); _editActions->addAction(formwm->actionDelete()); _editActions->addAction(formwm->actionSelectAll()); _editActions->addAction(separator(this)); _editActions->addAction(formwm->actionLower()); _editActions->addAction(formwm->actionRaise()); _toolActions = new QActionGroup(parent); _toolActions->setObjectName("_toolActions"); _toolActions->setExclusive(true); QAction *m_editWidgetsAction = new QAction(tr("Edit Widgets"), this); m_editWidgetsAction->setCheckable(true); QList shortcuts; shortcuts.append(QKeySequence(Qt::Key_F3)); #if QT_VERSION >= 0x040900 // "ESC" switching to edit mode: Activate once item delegates handle shortcut overrides for ESC. shortcuts.append(QKeySequence(Qt::Key_Escape)); #endif m_editWidgetsAction->setShortcuts(shortcuts); m_editWidgetsAction->setIcon(QIcon(_designer->formeditor()->resourceLocation() + QLatin1String("/widgettool.png"))); connect(m_editWidgetsAction, SIGNAL(triggered()), this, SLOT(sEditWidgets())); m_editWidgetsAction->setChecked(true); m_editWidgetsAction->setEnabled(false); _toolActions->addAction(m_editWidgetsAction); QList builtinPlugins = QPluginLoader::staticInstances(); builtinPlugins += _designer->formeditor()->pluginManager()->instances(); foreach (QObject *plugin, builtinPlugins) { if (QDesignerFormEditorPluginInterface *formEditorPlugin = qobject_cast(plugin)) { if (QAction *action = formEditorPlugin->action()) { _toolActions->addAction(action); action->setCheckable(true); } } } _formActions = new QActionGroup(parent); _formActions->setObjectName("_formActions"); _formActions->setExclusive(false); _formActions->addAction(formwm->actionHorizontalLayout()); _formActions->addAction(formwm->actionVerticalLayout()); _formActions->addAction(formwm->actionSplitHorizontal()); _formActions->addAction(formwm->actionSplitVertical()); _formActions->addAction(formwm->actionGridLayout()); _formActions->addAction(formwm->actionFormLayout()); _formActions->addAction(formwm->actionBreakLayout()); _formActions->addAction(formwm->actionAdjustSize()); _formActions->addAction(formwm->actionSimplifyLayout()); connect(formwm, SIGNAL(activeFormWindowChanged(QDesignerFormWindowInterface*)), this, SLOT(sActiveFormWindowChanged(QDesignerFormWindowInterface*))); sActiveFormWindowChanged(formwm->activeFormWindow()); } void xTupleDesignerActions::sActiveFormWindowChanged(QDesignerFormWindowInterface *pwindow) { if (DEBUG) qDebug("xTupleDesignerActions::sActiveFormWindowChanged(%p)", pwindow); QList actionGroupList; actionGroupList.append(_fileActions); actionGroupList.append(_editActions); actionGroupList.append(_formActions); actionGroupList.append(_toolActions); for (int i = 0; i < actionGroupList.size(); i++) for (int j = 0; j < actionGroupList.at(i)->actions().size(); j++) actionGroupList.at(i)->actions().at(j)->setEnabled(pwindow != 0); } bool xTupleDesignerActions::sClose() { if (! _designer->formwindow()->isDirty()) { _designer->close(); return true; } switch (QMessageBox::question(_designer, tr("Save changes?"), tr("Do you want to save your changes before " "closing the window?"), QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel, QMessageBox::Save)) { case QMessageBox::Save: if (sSave()) _designer->close(); break; case QMessageBox::Discard: _designer->formwindow()->setDirty(false); _designer->close(); break; case QMessageBox::Cancel: default: return false; } return true; } void xTupleDesignerActions::sOpen() { QSettings settings("xTuple.com", "xTupleDesigner"); QString path = settings.value("LastDirectory").toString(); QString filename = QFileDialog::getOpenFileName(_designer, tr("Open File"), path, tr("UI (*.ui)")); if (! filename.isNull()) { _designer->setSource(new QFile(filename), filename); _designer->formwindow()->setDirty(false); } QFileInfo fi(filename); settings.setValue("LastDirectory", fi.path()); } void xTupleDesignerActions::sRevert() { if (_designer->formwindow()->isDirty() && QMessageBox::question(_designer, tr("Really revert?"), tr("Are you sure you want to throw away " "your changes since the last save?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Default) == QMessageBox::Yes) _designer->sRevert(); return; } bool xTupleDesignerActions::sSave() { QMessageBox save; save.setText("How do you want to save your changes?"); QPushButton *cancel= save.addButton(QMessageBox::Cancel); QPushButton *db = save.addButton(tr("Database only"), QMessageBox::AcceptRole); QPushButton *file = save.addButton(tr("File only"), QMessageBox::AcceptRole); QPushButton *both = save.addButton(tr("Database and File"),QMessageBox::AcceptRole); save.setDefaultButton(_designer->formwindow()->fileName().isEmpty() ? db : both); save.setEscapeButton((QAbstractButton*)cancel); save.exec(); if (save.clickedButton() == (QAbstractButton*)db) return sSaveToDB(); else if (save.clickedButton() == (QAbstractButton*)file) return sSaveFile(); else if (save.clickedButton() == (QAbstractButton*)both) return sSaveFile() && sSaveToDB(); else if (save.clickedButton() == (QAbstractButton*)cancel) return false; else { qWarning("xTupleDesignerActions::sSave() bug - unknown button clicked"); return false; } } bool xTupleDesignerActions::sSaveAs() { bool returnValue = false; QString oldfilename = _designer->formwindow()->fileName(); if (! oldfilename.isEmpty()) _designer->formwindow()->setFileName(QString()); returnValue = sSaveFile(); if (! returnValue) _designer->formwindow()->setFileName(oldfilename); return returnValue; } bool xTupleDesignerActions::sSaveToDB() { XSqlQuery xSaveToDB; if (_designer->formId() == -1) { xSaveToDB.exec("SELECT NEXTVAL('uiform_uiform_id_seq') AS _uiform_id"); if (xSaveToDB.first()) _designer->setFormId(xSaveToDB.value("_uiform_id").toInt()); else if (xSaveToDB.lastError().type() != QSqlError::NoError) { systemError(_designer, xSaveToDB.lastError().databaseText(), __FILE__, __LINE__); return false; } xSaveToDB.prepare( "INSERT INTO uiform " "(uiform_id, uiform_name, uiform_notes, uiform_order, uiform_enabled, uiform_source) " "VALUES " "(:uiform_id, :uiform_name, :uiform_notes, :uiform_order, :uiform_enabled, :uiform_source);" ); } else xSaveToDB.prepare( "UPDATE uiform " "SET uiform_name=:uiform_name, uiform_notes=:uiform_notes," " uiform_order=:uiform_order, uiform_enabled=:uiform_enabled," " uiform_source=:uiform_source " "WHERE (uiform_id=:uiform_id);" ); QString source = _designer->source(); xSaveToDB.bindValue(":uiform_id", _designer->formId()); xSaveToDB.bindValue(":uiform_name", _designer->name()); xSaveToDB.bindValue(":uiform_order", _designer->order()); xSaveToDB.bindValue(":uiform_enabled", _designer->formEnabled()); xSaveToDB.bindValue(":uiform_source", source); xSaveToDB.bindValue(":uiform_notes", _designer->notes()); xSaveToDB.exec(); if (xSaveToDB.lastError().type() != QSqlError::NoError) { systemError(_designer, xSaveToDB.lastError().databaseText(), __FILE__, __LINE__); return false; } _designer->setSource(source); // otherwise the uiform window has the old source _designer->formwindow()->setDirty(false); return true; } bool xTupleDesignerActions::sSaveFile() { QSettings settings("xTuple.com", "xTupleDesigner"); QString path = settings.value("LastDirectory").toString(); QString filename = _designer->formwindow()->fileName(); if (_designer->formwindow()->fileName().isEmpty()) { filename = QFileDialog::getSaveFileName(_designer, tr("Save File"), path + QDir::separator() + _designer->name() + ".ui", tr("UI (*.ui)")); if (filename.isNull()) return false; _designer->formwindow()->setFileName(filename); } QFileInfo fi(filename); if (fi.suffix().isEmpty()) filename += ".ui"; QFile file(filename); if (!file.open(QIODevice::WriteOnly)) { QMessageBox::critical(_designer, tr("Could not export file"), file.errorString()); return false; } QString source = _designer->source(); QTextStream ts(&file); ts.setCodec("UTF-8"); ts << source; file.close(); _designer->setSource(source); _designer->formwindow()->setDirty(false); settings.setValue("LastDirectory", fi.path()); return true; } void xTupleDesignerActions::sEditBuddies() { QMessageBox::information(_designer, tr("Not implemented yet."), tr("Buddy editing is not implemented yet.")); } void xTupleDesignerActions::sEditSignalSlot() { QMessageBox::information(_designer, tr("Not implemented yet."), tr("Visual Signal/Slot editing is not implemented yet.")); } void xTupleDesignerActions::sEditTabOrder() { QMessageBox::information(_designer, tr("Not implemented yet."), tr("Tab Order editing is not implemented yet.")); } void xTupleDesignerActions::sEditWidgets() { _designer->formwindow()->editWidgets(); } qt-client-4.1.0/guiclient/xTupleDesignerActions.h000066400000000000000000000031251217451700100220320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XTUPLEDESIGNERACTIONS_H #define XTUPLEDESIGNERACTIONS_H #include class QAction; class QActionGroup; class QDesignerFormWindowInterface; class xTupleDesigner; class xTupleDesignerActions : QObject { Q_OBJECT public: xTupleDesignerActions(xTupleDesigner *parent); virtual QActionGroup *editActions() { return _editActions; } virtual QActionGroup *fileActions() { return _fileActions; } virtual QActionGroup *formActions() { return _formActions; } virtual QActionGroup *toolActions() { return _toolActions; } public slots: virtual void sActiveFormWindowChanged(QDesignerFormWindowInterface*); virtual bool sClose(); virtual void sEditBuddies(); virtual void sEditSignalSlot(); virtual void sEditTabOrder(); virtual void sEditWidgets(); virtual void sOpen(); virtual void sRevert(); virtual bool sSave(); virtual bool sSaveAs(); virtual bool sSaveFile(); virtual bool sSaveToDB(); protected: xTupleDesigner *_designer; QActionGroup *_editActions; QActionGroup *_fileActions; QActionGroup *_formActions; QActionGroup *_toolActions; }; #endif qt-client-4.1.0/guiclient/xabstractconfigure.cpp000066400000000000000000000035511217451700100220020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xabstractconfigure.h" /** \brief Abstract interface definition for xTuple ERP Configure widgets. XAbstractConfigure is an abstract class defining a simple programming interface that all configuration windows must implement. This is used by the Setup window to ensure that all data get saved properly. Every configuration UI intended to be included in the Setup window should inherit from XAbstractConfigure. It must implement a languageChange() method and an sSave() method. The languageChange() method is usually empty; it is required to ensure that the configuration window can be translated. The sSave method returns a boolean. It should return true if the save attempt was successful and false if the save attempt failed. If the save attempt failed, sSave() should set the focus on the failed widget and give the user a QMessageBox explaining the failure. It is the Setup window's responsibility to handle the failure and focus widget gracefully. Child classes of XAbstractConfigure should define a saving() signal and emit it at the beginning of sSave(). This will allow scripts on these child classes to save their own data. \todo Find a way for scripts to return failures so they also can handle errors during saving. \see setup */ XAbstractConfigure::XAbstractConfigure(QWidget* parent, Qt::WindowFlags f) : XWidget(parent, f) { } XAbstractConfigure::~XAbstractConfigure() { } qt-client-4.1.0/guiclient/xabstractconfigure.h000066400000000000000000000015021217451700100214410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XABSTRACTCONFIGURE_H #define XABSTRACTCONFIGURE_H #include #include "xwidget.h" class XAbstractConfigure : public XWidget { Q_OBJECT public slots: virtual bool sSave() = 0; protected: XAbstractConfigure(QWidget *parent = 0, Qt::WindowFlags f = 0); virtual ~XAbstractConfigure(); protected slots: virtual void languageChange() = 0; }; #endif qt-client-4.1.0/guiclient/xdateinputdialog.cpp000066400000000000000000000024541217451700100214530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xdateinputdialog.h" #include #include #include XDateInputDialog::XDateInputDialog(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); _date->setDate(QDate::currentDate()); } XDateInputDialog::~XDateInputDialog() { // no need to delete child widgets, Qt does it all for us } void XDateInputDialog::languageChange() { retranslateUi(this); } enum SetResponse XDateInputDialog::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("label", &valid); if (valid) _label->setText(param.toString()); param = pParams.value("default", &valid); if (valid) _date->setDate(param.toDate()); return NoError; } QDate XDateInputDialog::getDate() { return _date->date(); } qt-client-4.1.0/guiclient/xdateinputdialog.h000066400000000000000000000020051217451700100211100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XDATEINPUTDIALOG_H #define XDATEINPUTDIALOG_H #include "guiclient.h" #include #include "xdialog.h" #include #include "ui_xdateinputdialog.h" class XDateInputDialog : public XDialog, public Ui::XDateInputDialog { Q_OBJECT public: XDateInputDialog(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~XDateInputDialog(); QDate getDate(); public slots: virtual enum SetResponse set(const ParameterList & pParams ); protected slots: virtual void languageChange(); }; #endif // XDATEINPUTDIALOG_H qt-client-4.1.0/guiclient/xdateinputdialog.ui000066400000000000000000000077301217451700100213100ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. XDateInputDialog 0 0 444 78 Enter a Date 5 0 0 7 Enter a date: Qt::Horizontal 40 20 0 0 Qt::StrongFocus &Cancel Qt::StrongFocus OK Qt::Vertical QSizePolicy::Preferred 10 0 DLineEdit XLineEdit

    datecluster.h
    0 _date _ok _close _close clicked() XDateInputDialog reject() 20 20 20 20 _ok clicked() XDateInputDialog accept() 481 148 264 133 qt-client-4.1.0/guiclient/xdialog.cpp000066400000000000000000000104151217451700100175310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xdialog.h" #include #include #include #include #include #include #include "xcheckbox.h" #include "xtsettings.h" #include "guiclient.h" #include "scriptablePrivate.h" #include "shortcuts.h" // // XDialogPrivate // class XDialogPrivate : public ScriptablePrivate { friend class XDialog; public: XDialogPrivate(XDialog*); ~XDialogPrivate(); XDialog * _parent; bool _shown; QAction *_rememberPos; QAction *_rememberSize; ParameterList lastSetParams; }; XDialogPrivate::XDialogPrivate(XDialog *parent) : ScriptablePrivate(true, parent), _parent(parent) { _shown = false; _rememberPos = 0; _rememberSize = 0; } XDialogPrivate::~XDialogPrivate() { if(_rememberPos) delete _rememberPos; if(_rememberSize) delete _rememberSize; } XDialog::XDialog(QWidget * parent, Qt::WindowFlags flags) : QDialog(parent, flags) { connect(this, SIGNAL(destroyed(QObject*)), omfgThis, SLOT(windowDestroyed(QObject*))); connect(this, SIGNAL(finished(int)), this, SLOT(saveSize())); _private = new XDialogPrivate(this); } XDialog::XDialog(QWidget * parent, const char * name, bool modal, Qt::WindowFlags flags) : QDialog(parent, flags) { if(name) setObjectName(name); if(modal) setModal(modal); connect(this, SIGNAL(destroyed(QObject*)), omfgThis, SLOT(windowDestroyed(QObject*))); connect(this, SIGNAL(finished(int)), this, SLOT(saveSize())); _private = new XDialogPrivate(this); } XDialog::~XDialog() { if(_private) delete _private; } // TODO: why isn't closeEvent sufficient? void XDialog::saveSize() { omfgThis->saveWidgetSizePos(this); } void XDialog::closeEvent(QCloseEvent * event) { event->accept(); // we have no reason not to accept and let the script change it if needed _private->callCloseEvent(event); if(event->isAccepted()) { saveSize(); QDialog::closeEvent(event); } } void XDialog::showEvent(QShowEvent *event) { if(!_private->_shown) { _private->_shown = true; omfgThis->restoreWidgetSizePos(this); _private->_rememberPos = new QAction(tr("Remember Position"), this); _private->_rememberPos->setCheckable(true); _private->_rememberPos->setChecked(xtsettingsValue(objectName() + "/geometry/rememberPos", true).toBool()); connect(_private->_rememberPos, SIGNAL(triggered(bool)), this, SLOT(setRememberPos(bool))); _private->_rememberSize = new QAction(tr("Remember Size"), this); _private->_rememberSize->setCheckable(true); _private->_rememberSize->setChecked(xtsettingsValue(objectName() + "/geometry/rememberSize", true).toBool()); connect(_private->_rememberSize, SIGNAL(triggered(bool)), this, SLOT(setRememberSize(bool))); addAction(_private->_rememberPos); addAction(_private->_rememberSize); setContextMenuPolicy(Qt::ActionsContextMenu); _private->loadScriptEngine(); QList allxcb = findChildren(); for (int i = 0; i < allxcb.size(); ++i) allxcb.at(i)->init(); shortcuts::setStandardKeys(this); } _private->callShowEvent(event); QDialog::showEvent(event); } void XDialog::setRememberPos(bool b) { xtsettingsSetValue(objectName() + "/geometry/rememberPos", b); if(_private && _private->_rememberPos) _private->_rememberPos->setChecked(b); } void XDialog::setRememberSize(bool b) { xtsettingsSetValue(objectName() + "/geometry/rememberSize", b); if(_private && _private->_rememberSize) _private->_rememberSize->setChecked(b); } enum SetResponse XDialog::set(const ParameterList & pParams) { _lastSetParams = pParams; _private->loadScriptEngine(); QTimer::singleShot(0, this, SLOT(postSet())); return NoError; } enum SetResponse XDialog::postSet() { return _private->callSet(_lastSetParams); } ParameterList XDialog::get() const { return _lastSetParams; } qt-client-4.1.0/guiclient/xdialog.h000066400000000000000000000025561217451700100172050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XDIALOG_H__ #define __XDIALOG_H__ #include #include #include class XDialogPrivate; class XDialog : public QDialog { Q_OBJECT public: XDialog(QWidget * parent = 0, Qt::WindowFlags flags = 0); XDialog(QWidget * parent, const char * name, bool modal = false, Qt::WindowFlags flags = 0); virtual ~XDialog(); Q_INVOKABLE virtual ParameterList get() const; public slots: virtual enum SetResponse set(const ParameterList &); virtual void setRememberPos(bool); virtual void setRememberSize(bool); protected: virtual void closeEvent(QCloseEvent * event); virtual void showEvent(QShowEvent * event); protected slots: virtual enum SetResponse postSet(); virtual void saveSize(); private: friend class XDialogPrivate; XDialogPrivate *_private; ParameterList _lastSetParams; void loadScriptEngine(); }; #endif // __XDIALOG_H__ qt-client-4.1.0/guiclient/xerrormessage.cpp000066400000000000000000000047701217451700100207770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xerrormessage.h" #include "guiclient.h" #include #include #include #include #include #include #include XErrorMessage::XErrorMessage(QWidget * parent) : QDialog(parent) { QGridLayout * grid = new QGridLayout(this); _icon = new QLabel(this); _icon->setPixmap(QMessageBox::standardIcon(QMessageBox::Information)); _icon->setAlignment(Qt::AlignHCenter | Qt::AlignTop); grid->addWidget(_icon, 0, 0, Qt::AlignTop); _errors = new QTextEdit(this); grid->addWidget(_errors, 0, 1); _again = new QCheckBox(this); _again->setChecked(true); grid->addWidget(_again, 1, 1, Qt::AlignTop); _ok = new QPushButton(this); connect(_ok, SIGNAL(clicked()), this, SLOT(accept())); _ok->setFocus(); grid->addWidget(_ok, 2, 0, 1, 2, Qt::AlignCenter); grid->setColumnStretch(1, 42); grid->setRowStretch(0, 42); retranslateStrings(); } XErrorMessage::~XErrorMessage() { } void XErrorMessage::done(int a) { if (!_again->isChecked() && !_currentMessage.isEmpty()) _preferences->set("doNotShow/" + _currentMessage, true); _currentMessage.clear(); if (!nextPending()) QDialog::done(a); } bool XErrorMessage::nextPending() { while (!_pending.isEmpty()) { QString p = _pending.takeFirst(); if (!p.isEmpty() && !_preferences->boolean("doNotShow/" + p)) { _errors->setHtml(p); _currentMessage = p; return true; } } return false; } void XErrorMessage::showMessage(const QString &message) { if (_preferences->boolean("doNotShow/" + message)) return; _pending.append(message); if (!isVisible() && nextPending()) show(); } void XErrorMessage::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) retranslateStrings(); QDialog::changeEvent(e); } void XErrorMessage::retranslateStrings() { _again->setText(XErrorMessage::tr("&Show this message again")); _ok->setText(XErrorMessage::tr("&OK")); } qt-client-4.1.0/guiclient/xerrormessage.h000066400000000000000000000021671217451700100204420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XERRORMESSAGE_H #define XERRORMESSAGE_H #include #include class QCheckBox; class QLabel; class QPushButton; class QTextEdit; class XErrorMessage: public QDialog { Q_OBJECT public: explicit XErrorMessage(QWidget* parent = 0); ~XErrorMessage(); public Q_SLOTS: void showMessage(const QString &message); protected: void done(int); void changeEvent(QEvent *e); void retranslateStrings(); bool nextPending(); private: QPushButton * _ok; QCheckBox * _again; QTextEdit * _errors; QLabel * _icon; QStringList _pending; QString _currentMessage; QString _settingsName; }; #endif // XERRORMESSAGE_H qt-client-4.1.0/guiclient/xmainwindow.cpp000066400000000000000000000104161217451700100204470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xmainwindow.h" #include #include #include #include #include #include #include #include "xcheckbox.h" #include "xtsettings.h" #include "guiclient.h" #include "scriptablePrivate.h" #include "shortcuts.h" // // XMainWindowPrivate // class XMainWindowPrivate : public ScriptablePrivate { friend class XMainWindow; public: XMainWindowPrivate(XMainWindow*); ~XMainWindowPrivate(); XMainWindow * _parent; bool _shown; QAction *_action; }; XMainWindowPrivate::XMainWindowPrivate(XMainWindow * parent) : ScriptablePrivate(false, parent), _parent(parent) { _shown = false; _action = 0; } XMainWindowPrivate::~XMainWindowPrivate() { if(_action) delete _action; } XMainWindow::XMainWindow(QWidget * parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) { _private = new XMainWindowPrivate(this); _private->_action = new QAction(this); _private->_action->setShortcutContext(Qt::ApplicationShortcut); _private->_action->setText(windowTitle()); _private->_action->setCheckable(true); connect(_private->_action, SIGNAL(triggered(bool)), this, SLOT(showMe(bool))); _forceFloat=false; } XMainWindow::XMainWindow(QWidget * parent, const char * name, Qt::WindowFlags flags) : QMainWindow(parent, flags) { if(name) setObjectName(name); _private = new XMainWindowPrivate(this); _private->_action = new QAction(this); _private->_action->setShortcutContext(Qt::ApplicationShortcut); _private->_action->setText(windowTitle()); _private->_action->setCheckable(true); connect(_private->_action, SIGNAL(triggered(bool)), this, SLOT(showMe(bool))); _forceFloat = false; } XMainWindow::~XMainWindow() { if(_private) delete _private; } enum SetResponse XMainWindow::set(const ParameterList &pParams) { _lastSetParams = pParams; _private->loadScriptEngine(); QTimer::singleShot(0, this, SLOT(postSet())); return NoError; } enum SetResponse XMainWindow::postSet() { return _private->callSet(_lastSetParams); } ParameterList XMainWindow::get() const { return _lastSetParams; } void XMainWindow::closeEvent(QCloseEvent *event) { event->accept(); // we have no reason not to accept and let the script change it if needed _private->callCloseEvent(event); omfgThis->saveWidgetSizePos(this); } void XMainWindow::showEvent(QShowEvent *event) { if(!_private->_shown) { _private->_shown = true; omfgThis->restoreWidgetSizePos(this); _private->loadScriptEngine(); QList allxcb = findChildren(); for (int i = 0; i < allxcb.size(); ++i) allxcb.at(i)->init(); shortcuts::setStandardKeys(this); } bool blocked = _private->_action->blockSignals(true); _private->_action->setChecked(true); _private->_action->blockSignals(blocked); _private->callShowEvent(event); QMainWindow::showEvent(event); } void XMainWindow::hideEvent(QHideEvent * event) { bool blocked = _private->_action->blockSignals(true); _private->_action->setChecked(false); _private->_action->blockSignals(blocked); QMainWindow::hideEvent(event); } QAction *XMainWindow::action() const { return _private->_action; } void XMainWindow::changeEvent(QEvent *e) { switch (e->type()) { case QEvent::WindowTitleChange: _private->_action->setText(windowTitle()); break; case QEvent::WindowIconChange: _private->_action->setIcon(windowIcon()); break; default: break; } QMainWindow::changeEvent(e); } void XMainWindow::showMe(bool v) { QWidget *target = parentWidget() == 0 ? this : parentWidget(); if (v) target->setWindowState(target->windowState() & ~Qt::WindowMinimized); target->setVisible(v); } QScriptEngine *engine(XMainWindow *win) { if(win && win->_private) return win->_private->engine(); return 0; } qt-client-4.1.0/guiclient/xmainwindow.h000066400000000000000000000034111217451700100201110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XMAINWINDOW_H__ #define __XMAINWINDOW_H__ #include #include #include "guiclient.h" class QScriptEngine; class XMainWindowPrivate; class XMainWindow : public QMainWindow { Q_OBJECT Q_PROPERTY(ParameterList params READ get WRITE set DESIGNABLE false); public: XMainWindow(QWidget * parent = 0, Qt::WindowFlags flags = 0); XMainWindow(QWidget * parent, const char * name, Qt::WindowFlags flags = 0); virtual ~XMainWindow(); Q_INVOKABLE virtual ParameterList get() const; Q_INVOKABLE QAction *action() const; Q_INVOKABLE bool forceFloat() { return _forceFloat; } Q_INVOKABLE void setForceFloat(bool forceFloat) { _forceFloat = forceFloat; } public slots: virtual enum SetResponse set(const ParameterList &); protected: virtual void closeEvent(QCloseEvent *); virtual void showEvent(QShowEvent *); virtual void hideEvent(QHideEvent *); virtual void changeEvent(QEvent *); protected slots: virtual enum SetResponse postSet(); private: friend class XMainWindowPrivate; friend class ScriptToolbox; XMainWindowPrivate *_private; friend QScriptEngine *engine(XMainWindow*); ParameterList _lastSetParams; void loadScriptEngine(); bool _forceFloat; private slots: void showMe(bool); }; #endif // __XMAINWINDOW_H__ qt-client-4.1.0/guiclient/xmessagebox.cpp000066400000000000000000000055301217451700100204310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xmessagebox.h" #include #include /** \brief XMessageBox should be used for cases where the user might be in a loop that has a lot of dialogs and the application needs to get the user's attention. For example, if there is a loop where the user needs to enter a series of values into individual dialogs and an error occurs, the XMessageBox might make sense to display the error. That's because the default button causes the XMessageBox to repeat the error dialog. Other good uses are places where the user is scanning a series of barcodes. */ int XMessageBox::message( QWidget * parent, QMessageBox::Icon severity, const QString & caption, const QString & text, const QString & button0Text, const QString & button1Text, bool snooze, int defaultButtonNumber, int escapeButtonNumber ) { QPushButton *button0 = 0; QPushButton *button1 = 0; QPushButton *buttonsnooze = 0; QMessageBox *mb = new QMessageBox(severity, caption, text, QMessageBox::NoButton, parent); mb->setObjectName("xtuple_msgbox_snooze"); Q_CHECK_PTR( mb ); if (button0Text.isEmpty()) { button0 = mb->addButton(QMessageBox::Ok); defaultButtonNumber = snooze ? -1 : 0; } else button0 = mb->addButton(button0Text, defaultButtonNumber == 0 ? QMessageBox::AcceptRole : QMessageBox::RejectRole); if (!button1Text.isEmpty()) button1 = mb->addButton(button1Text, defaultButtonNumber == 1 ? QMessageBox::AcceptRole : QMessageBox::RejectRole); if ( snooze ) buttonsnooze = mb->addButton(QObject::tr("Snooze"), QMessageBox::RejectRole); if (defaultButtonNumber == 0) mb->setDefaultButton(button0); else if (defaultButtonNumber == 1) mb->setDefaultButton(button1); else if (snooze) mb->setDefaultButton(buttonsnooze); if (escapeButtonNumber == 0) mb->setEscapeButton(button0); else if (escapeButtonNumber == 1) mb->setEscapeButton(button1); else if (snooze) mb->setEscapeButton(buttonsnooze); #ifndef QT_NO_CURSOR mb->setCursor(QCursor(Qt::ArrowCursor)); #endif int result = -1; do { QApplication::beep(); result = mb->exec(); } while (snooze && mb->clickedButton() == buttonsnooze); delete mb; return result; } qt-client-4.1.0/guiclient/xmessagebox.h000066400000000000000000000017511217451700100200770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XMESSAGEBOX_H__ #define __XMESSAGEBOX_H__ #include class XMessageBox { public: static int message( QWidget * parent, QMessageBox::Icon severity, const QString & caption, const QString & text, const QString & button0Text = QString::null, const QString & button1Text = QString::null, bool snooze = true, int defaultButtonNumber = 0, int escapeButtonNumber = -1 ); private: XMessageBox(); }; #endif qt-client-4.1.0/guiclient/xmessageboxmessagehandler.cpp000066400000000000000000000034411217451700100233330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xmessageboxmessagehandler.h" #include XMessageBoxMessageHandler::XMessageBoxMessageHandler(QObject *p) : QAbstractMessageHandler(p) { _message = ""; _title = tr("Error"); _prefix = tr("

    There was a problem reading the file, " "line %1 column %2: %3
    (%4)"); } QString XMessageBoxMessageHandler::lastMessage() const { return _message; } void XMessageBoxMessageHandler::setTitle(const QString &title) { _title = title; } QString XMessageBoxMessageHandler::title() const { return _title; } void XMessageBoxMessageHandler::setPrefix(const QString &prefix) { _prefix = prefix; } void XMessageBoxMessageHandler::handleMessage(QtMsgType type, const QString &description, const QUrl &identifier, const QSourceLocation &sourceLocation) { if (description.isEmpty()) { _message = description; return; } _message = _prefix.arg(sourceLocation.line()) .arg(sourceLocation.column()) .arg(description) .arg(identifier.toString()); switch (type) { case QtDebugMsg: QMessageBox::information(0, _title, _message); break; case QtWarningMsg: QMessageBox::warning(0, _title, _message); break; case QtCriticalMsg: case QtFatalMsg: default: QMessageBox::critical(0, _title, _message); break; } } qt-client-4.1.0/guiclient/xmessageboxmessagehandler.h000066400000000000000000000017671217451700100230110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include class XMessageBoxMessageHandler : public QAbstractMessageHandler { Q_OBJECT public: XMessageBoxMessageHandler(QObject *p = 0); QString lastMessage() const; virtual void setPrefix(const QString &prefix); virtual void setTitle(const QString &title); virtual QString title() const; protected: virtual void handleMessage(QtMsgType type, const QString &description, const QUrl &identifier, const QSourceLocation &sourceLocation); private: QString _message; QString _prefix; QString _title; }; qt-client-4.1.0/guiclient/xsltMap.cpp000066400000000000000000000170261217451700100175370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xsltMap.h" #include #include #include #include "storedProcErrorLookup.h" bool xsltMap::userHasPriv() { return _privileges->check("ConfigureImportExport"); } int xsltMap::exec() { if (userHasPriv()) return XDialog::exec(); else { systemError(this, tr("You do not have sufficient privilege to view this window"), __FILE__, __LINE__); return XDialog::Rejected; } } xsltMap::xsltMap(QWidget* parent, const char * name, Qt::WFlags fl) : XDialog(parent, name, fl) { setupUi(this); connect(_export, SIGNAL(textChanged(const QString &)), this, SLOT(sHandleExport())); connect(_import, SIGNAL(textChanged(const QString &)), this, SLOT(sHandleImport())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); QString filter = tr("XSLT Files (*.xsl *.xslt)"); _import->setFilter(filter); _export->setFilter(filter); _mode = cNew; _xsltmapId = -1; } xsltMap::~xsltMap() { // no need to delete child widgets, Qt does it all for us } void xsltMap::languageChange() { retranslateUi(this); } enum SetResponse xsltMap::set(const ParameterList &pParams) { XDialog::set(pParams); QVariant param; bool valid; param = pParams.value("xsltmap_id", &valid); if (valid) { _xsltmapId = param.toInt(); sPopulate(); } param = pParams.value("defaultLinuxDir", &valid); if (valid) _xsltLinuxDir = param.toString(); param = pParams.value("defaultMacDir", &valid); if (valid) _xsltMacDir = param.toString(); param = pParams.value("defaultWindowsDir", &valid); if (valid) _xsltWindowsDir = param.toString(); param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; } else if (param.toString() == "edit") { _mode = cEdit; } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(false); _doctype->setEnabled(false); _system->setEnabled(false); _import->setEnabled(false); _export->setEnabled(false); _save->hide(); } } return NoError; } void xsltMap::sSave() { XSqlQuery xsltSave; QString errorCaption = tr("Cannot Save XSLT Map"); struct { bool condition; QString msg; QWidget* widget; } error[] = { { _name->text().trimmed().isEmpty(), tr("

    You must enter a name for this XSLT Map before saving it."), _name }, { _doctype->text().trimmed().isEmpty() && _system->text().trimmed().isEmpty(), tr("

    You must enter a Document Type, a System Identifier, or both " "before saving this XSLT Map."), _doctype->text().trimmed().isEmpty() ? _doctype : _system }, { _import->text().trimmed().isEmpty() && _export->text().trimmed().isEmpty(), tr("

    You must enter either an Import or Export XSLT File Name before saving this XSLT Map."), (_import->text().trimmed().isEmpty() ? _import : _export) }, { true, "", NULL } }; // error[] int errIndex; for (errIndex = 0; ! error[errIndex].condition; errIndex++) ; if (! error[errIndex].msg.isEmpty()) { QMessageBox::critical(this, errorCaption, error[errIndex].msg); error[errIndex].widget->setFocus(); return; } xsltSave.prepare( "SELECT xsltmap_name " "FROM xsltmap " "WHERE ((xsltmap_name=:name)" " AND (xsltmap_id<>:xsltmap_id) );" ); xsltSave.bindValue(":xsltmap_id", _xsltmapId); xsltSave.bindValue(":name", _name->text()); xsltSave.exec(); if (xsltSave.first()) { QMessageBox::critical(this, errorCaption, tr("

    This Name is already in use by another " "XSLT Map.")); _name->setFocus(); return; } else if (xsltSave.lastError().type() != QSqlError::NoError) { systemError(this, xsltSave.lastError().databaseText(), __FILE__, __LINE__); return; } if (cNew == _mode) { xsltSave.exec("SELECT NEXTVAL('xsltmap_xsltmap_id_seq') AS result;"); if (xsltSave.first()) _xsltmapId = xsltSave.value("result").toInt(); else if (xsltSave.lastError().type() != QSqlError::NoError) { systemError(this, xsltSave.lastError().databaseText(), __FILE__, __LINE__); return; } xsltSave.prepare("INSERT INTO xsltmap (" " xsltmap_id, xsltmap_name, xsltmap_doctype," " xsltmap_system, xsltmap_import, xsltmap_export" ") VALUES (" " :id, :name, :doctype," " :system, :import, :export" ");"); } else if (cEdit == _mode) xsltSave.prepare("UPDATE xsltmap SET" " xsltmap_name=:name," " xsltmap_doctype=:doctype," " xsltmap_system=:system," " xsltmap_import=:import," " xsltmap_export=:export " "WHERE (xsltmap_id=:id);"); xsltSave.bindValue(":id", _xsltmapId); xsltSave.bindValue(":name", _name->text()); xsltSave.bindValue(":doctype", _doctype->text()); xsltSave.bindValue(":system", _system->text()); xsltSave.bindValue(":import", _import->text()); xsltSave.bindValue(":export", _export->text()); xsltSave.exec(); if (xsltSave.lastError().type() != QSqlError::NoError) { systemError(this, xsltSave.lastError().databaseText(), __FILE__, __LINE__); return; } accept(); } void xsltMap::sPopulate() { XSqlQuery xsltPopulate; if (_xsltmapId <= 0) { _name->clear(); _doctype->clear(); _system->clear(); _import->clear(); _export->clear(); } else { xsltPopulate.prepare("SELECT * FROM xsltmap WHERE (xsltmap_id=:id);"); xsltPopulate.bindValue(":id", _xsltmapId); xsltPopulate.exec(); if (xsltPopulate.first()) { _name->setText(xsltPopulate.value("xsltmap_name").toString()); _doctype->setText(xsltPopulate.value("xsltmap_doctype").toString()); _system->setText(xsltPopulate.value("xsltmap_system").toString()); _import->setText(xsltPopulate.value("xsltmap_import").toString()); _export->setText(xsltPopulate.value("xsltmap_export").toString()); } else if (xsltPopulate.lastError().type() != QSqlError::NoError) { systemError(this, xsltPopulate.lastError().databaseText(), __FILE__, __LINE__); return; } } } void xsltMap::sHandleExport() { if (!_xsltLinuxDir.isEmpty() && _export->text().startsWith(_xsltLinuxDir)) _export->setText(_export->text().remove(0, _xsltLinuxDir.length() + 1)); else if (!_xsltMacDir.isEmpty() && _export->text().startsWith(_xsltMacDir)) _export->setText(_export->text().remove(0, _xsltMacDir.length() + 1)); else if (!_xsltWindowsDir.isEmpty() && _export->text().startsWith(_xsltWindowsDir)) _export->setText(_export->text().remove(0, _xsltWindowsDir.length() + 1)); } void xsltMap::sHandleImport() { if (!_xsltLinuxDir.isEmpty() && _import->text().startsWith(_xsltLinuxDir)) _import->setText(_import->text().remove(0, _xsltLinuxDir.length() + 1)); else if (!_xsltMacDir.isEmpty() && _import->text().startsWith(_xsltMacDir)) _import->setText(_import->text().remove(0, _xsltMacDir.length() + 1)); else if (!_xsltWindowsDir.isEmpty() && _import->text().startsWith(_xsltWindowsDir)) _import->setText(_import->text().remove(0, _xsltWindowsDir.length() + 1)); } qt-client-4.1.0/guiclient/xsltMap.h000066400000000000000000000023131217451700100171750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XSLTMAP_H #define XSLTMAP_H #include "guiclient.h" #include "xdialog.h" #include "ui_xsltMap.h" #include class xsltMap : public XDialog, public Ui::xsltMap { Q_OBJECT public: xsltMap(QWidget* parent = 0, const char * = 0, Qt::WFlags fl = 0); ~xsltMap(); static bool userHasPriv(); public slots: virtual int exec(); virtual enum SetResponse set(const ParameterList&); virtual void sPopulate(); protected slots: virtual void languageChange(); virtual void sHandleExport(); virtual void sHandleImport(); virtual void sSave(); private: int _mode; int _xsltmapId; QString _xsltLinuxDir; QString _xsltMacDir; QString _xsltWindowsDir; }; #endif // XSLTMAP_H qt-client-4.1.0/guiclient/xsltMap.ui000066400000000000000000000106711217451700100173710ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. xsltMap 0 0 524 206 XSLT Map Map Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Document Type: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter System Identifier: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Import XSLT File Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Export XSLT File Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical 20 0 Cancel Save Qt::Vertical 20 40 FileCluster QWidget

    filecluster.h
    _cancel clicked() xsltMap reject() 471 27 261 102 qt-client-4.1.0/guiclient/xtHelp.cpp000066400000000000000000000074601217451700100173540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include "guiclient.h" #include "xtHelp.h" #include "helpView.h" static QString QHC_PATH; static const QString WEBHOMEPAGE = "http://www.xtuple.org/sites/default/files/refguide/RefGuide-%1/index.html"; static const QString QHCHOMEPAGE = "qthelp://xtuple.org/postbooks/index.html"; #define DEBUG false static xtHelp *xtHelpSingleton = 0; xtHelp* xtHelp::getInstance(QWidget *parent) { if(QHC_PATH.isEmpty()) { QFile hf(QDesktopServices::storageLocation(QDesktopServices::DataLocation)+"/XTupleGUIClient.qhc"); if(hf.exists()) QHC_PATH = hf.fileName(); else QHC_PATH = QCoreApplication::instance()->applicationDirPath() + QDir::separator() + #ifdef Q_OS_MAC "../Resources/" + #endif "XTupleGUIClient.qhc"; } if(!xtHelpSingleton) xtHelpSingleton = new xtHelp(parent); return xtHelpSingleton; } void xtHelp::reload() { helpView::reset(); QHC_PATH = ""; xtHelpSingleton = 0; } xtHelp::xtHelp(QWidget *parent) : QHelpEngine(QHC_PATH, parent), _nam(new QNetworkAccessManager), _online(false) { connect(_nam, SIGNAL(finished(QNetworkReply *)), this, SLOT(sError(QNetworkReply *))); if(!setupData()) qWarning("Error setting up the help data"); /* TODO: remove the #ifdef and the empty help file & its corresponding qhc from xtuple/share once we fix the remote image loading bug in fileData */ #ifdef XTHELPONLINE _online = fileData(QUrl(QHCHOMEPAGE)) == QByteArray(""); #endif // XTHELPONLINE if (DEBUG) qDebug() << "xtHelp collection file" << collectionFile() << "exists?" << QFile::exists(collectionFile()) << "online?" << _online; } xtHelp::~xtHelp() { } QUrl xtHelp::homePage() const { if (_online) return QUrl(WEBHOMEPAGE.arg(qApp->applicationVersion().left(3))); else return QUrl(QHCHOMEPAGE); } bool xtHelp::isOnline() const { return _online; } QByteArray xtHelp::fileData(const QUrl &url) const { QByteArray returnVal; if (isOnline() || url.scheme() == "http") { QNetworkRequest req(url); QNetworkReply *rep = _nam->get(req); while(! rep->isFinished()) QCoreApplication::instance()->processEvents(); returnVal = rep->readAll(); } else returnVal = QHelpEngine::fileData(url); if (DEBUG) qDebug() << "xtHelp::fileData(" << url << " [ online?" << isOnline() << "]) returning" << returnVal.size() << "bytes:" << returnVal; return returnVal; } void xtHelp::sError(QNetworkReply *rep) { QVariant statCode = rep->attribute(QNetworkRequest::HttpStatusCodeAttribute); QVariant url = rep->url(); if (DEBUG) qDebug() << "xtHelp Network Response Information-----------------------------"; if (DEBUG) qDebug() << "xtHelp: http request url [" << url.toString() << "]"; if (DEBUG) qDebug() << "xtHelp: status code received [" << statCode.toString() << "]"; if(rep->error() == QNetworkReply::NoError) { if (DEBUG) qDebug() << "xtHelp: no error"; } else { if (DEBUG) qDebug() << "xtHelp: error received"; if (DEBUG) qDebug() << "xtHelp: " << rep->errorString(); } if (DEBUG) qDebug() << "----------------------------------------------------------------"; } qt-client-4.1.0/guiclient/xtHelp.h000066400000000000000000000022401217451700100170100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTHELP_H__ #define __XTHELP_H__ #include #include class QByteArray; class QNetworkAccessManager; class QNetworkReply; class xtHelp : public QHelpEngine { Q_OBJECT public: Q_INVOKABLE static xtHelp *getInstance(QWidget *parent = 0); ~xtHelp(); Q_INVOKABLE QByteArray fileData(const QUrl &url) const; Q_INVOKABLE QUrl homePage() const; Q_INVOKABLE bool isOnline() const; Q_INVOKABLE static void reload(); public slots: void sError(QNetworkReply *); protected: QNetworkAccessManager *_nam; bool _online; private: xtHelp(QWidget *parent = 0); }; #endif //__XTHELP_H__ qt-client-4.1.0/guiclient/xuiloader.cpp000066400000000000000000000036621217451700100201040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xuiloader.h" #include #include #include #include #include XUiLoader::XUiLoader(QObject* parent) : QUiLoader(parent) { QObjectList instances = QPluginLoader::staticInstances(); for (int i = 0; i < instances.count(); ++i) { // step 1) try with a normal plugin QDesignerCustomWidgetInterface *iface = qobject_cast(instances.at(i)); if (iface != 0) { m_customWidgets.insert(iface->name(), iface); continue; } // step 2) try with a collection of plugins QDesignerCustomWidgetCollectionInterface *c = qobject_cast(instances.at(i)); if (c != 0) { foreach (QDesignerCustomWidgetInterface *iface, c->customWidgets()) { m_customWidgets.insert(iface->name(), iface); } } } } XUiLoader::~XUiLoader() { } QWidget * XUiLoader::createWidget ( const QString & className, QWidget * parent, const QString & name ) { QWidget *w = 0; if (qobject_cast(parent) || qobject_cast(parent) || qobject_cast(parent)) parent = 0; QDesignerCustomWidgetInterface *factory = m_customWidgets.value(className); if (factory != 0) w = factory->createWidget(parent); if(w) { w->setObjectName(name); if (qobject_cast(w)) w->setParent(parent); return w; } return QUiLoader::createWidget(className, parent, name); } qt-client-4.1.0/guiclient/xuiloader.h000066400000000000000000000016371217451700100175510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XUILOADER_H #define XUILOADER_H #include #include #include #include class XUiLoader : public QUiLoader { Q_OBJECT public: XUiLoader(QObject* parent = 0); ~XUiLoader(); virtual QWidget * createWidget ( const QString & className, QWidget * parent = 0, const QString & name = QString() ); protected: QMap m_customWidgets; }; #endif // XUILOADER_H qt-client-4.1.0/guiclient/xwidget.cpp000066400000000000000000000057651217451700100175710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xwidget.h" #include #include #include "xcheckbox.h" #include "xtsettings.h" #include "guiclient.h" #include "scriptablePrivate.h" #include "shortcuts.h" // // XWidgetPrivate // class XWidgetPrivate : public ScriptablePrivate { friend class XWidget; public: XWidgetPrivate(XWidget *parent); virtual ~XWidgetPrivate(); XWidget * _parent; bool _shown; }; XWidgetPrivate::XWidgetPrivate(XWidget *parent) : ScriptablePrivate(false, parent), _parent(parent) { _shown = false; } XWidgetPrivate::~XWidgetPrivate() { } XWidget::XWidget(QWidget * parent, Qt::WindowFlags flags) : QWidget(parent, ((flags & (Qt::Dialog | Qt::Window)) && parent && parent->isModal()) ? (flags | Qt::Dialog) : flags ) { if(parent && parent->isModal() && (flags & (Qt::Dialog | Qt::Window))) { setWindowModality(Qt::ApplicationModal); } _private = new XWidgetPrivate(this); } XWidget::XWidget(QWidget * parent, const char * name, Qt::WindowFlags flags) : QWidget(parent, ((flags & (Qt::Dialog | Qt::Window)) && parent && parent->isModal()) ? (flags | Qt::Dialog) : flags ) { if(parent && parent->isModal() && (flags & (Qt::Dialog | Qt::Window))) { setWindowModality(Qt::ApplicationModal); //setWindowFlags(windowFlags() | Qt::Dialog); } if(name) setObjectName(name); _private = new XWidgetPrivate(this); } XWidget::~XWidget() { if(_private) delete _private; } void XWidget::closeEvent(QCloseEvent *event) { event->accept(); // we have no reason not to accept and let the script change it if needed _private->callCloseEvent(event); if (event->isAccepted()) omfgThis->saveWidgetSizePos(this); } void XWidget::showEvent(QShowEvent *event) { if(!_private->_shown) { _private->_shown = true; omfgThis->restoreWidgetSizePos(this); _private->loadScriptEngine(); QList allxcb = findChildren(); for (int i = 0; i < allxcb.size(); ++i) allxcb.at(i)->init(); shortcuts::setStandardKeys(this); } _private->callShowEvent(event); QWidget::showEvent(event); } enum SetResponse XWidget::set( const ParameterList & pParams ) { _lastSetParams = pParams; _private->loadScriptEngine(); QTimer::singleShot(0, this, SLOT(postSet())); return NoError; } enum SetResponse XWidget::postSet() { return _private->callSet(_lastSetParams); } ParameterList XWidget::get() const { return _lastSetParams; } QScriptEngine *XWidget::engine() { _private->loadScriptEngine(); return _private->_engine; } qt-client-4.1.0/guiclient/xwidget.h000066400000000000000000000024101217451700100172160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XWIDGET_H__ #define __XWIDGET_H__ #include #include #include class QScriptEngine; class XWidgetPrivate; class XWidget : public QWidget { Q_OBJECT public: XWidget(QWidget * parent = 0, Qt::WindowFlags flags = 0); XWidget(QWidget * parent, const char * name, Qt::WindowFlags flags = 0); ~XWidget(); Q_INVOKABLE virtual ParameterList get() const; public slots: virtual enum SetResponse set(const ParameterList &); protected: void closeEvent(QCloseEvent * event); void showEvent(QShowEvent * event); QScriptEngine *engine(); protected slots: virtual enum SetResponse postSet(); private: friend class XWidgetPrivate; XWidgetPrivate *_private; ParameterList _lastSetParams; void loadScriptEngine(); }; #endif // __XWIDGET_H__ qt-client-4.1.0/guiclient/yourpayprocessor.cpp000066400000000000000000000603611217451700100215570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "guiclient.h" #include "yourpayprocessor.h" #define DEBUG false /** @ingroup creditcards @class YourPayProcessor */ // convenience macro to add Content to the Parent node #define CREATECHILDTEXTNODE(Parent, ChildName, Content) \ { \ QDomElement Child = Parent.ownerDocument().createElement(ChildName); \ Child.appendChild(Parent.ownerDocument().createTextNode(Content)); \ Parent.appendChild(Child); \ } YourPayProcessor::YourPayProcessor() : CreditCardProcessor() { XSqlQuery currq; currq.exec("SELECT * FROM curr_symbol WHERE (curr_abbr='USD');"); if (currq.first()) _ypcurrid = currq.value("curr_id").toInt(); else if (currq.lastError().type() != QSqlError::NoError) _errorMsg = currq.lastError().databaseText(); else if (currq.exec("SELECT * " "FROM curr_symbol " "WHERE ((curr_abbr ~* 'US')" " AND (curr_symbol ~ '\\$')" " AND (curr_name ~* 'dollar'));") && currq.first()) _ypcurrid = currq.value("curr_id").toInt(); else if (currq.lastError().type() != QSqlError::NoError) _errorMsg = currq.lastError().databaseText(); if (_ypcurrid <= 0) { _errorMsg = tr("Could not find US $ in the curr_symbol table; " "defaulting to base currency.") + "\n\n" + _errorMsg; _ypcurrid = CurrDisplay::baseId(); } _company = "YourPay"; _defaultLivePort = 1129; _defaultLiveServer = "https://secure.linkpt.net"; _defaultTestPort = 1129; _defaultTestServer = "https://staging.linkpt.net"; _msgHash.insert(-100, tr("No Approval Code\n%1\n%2\n%3")); _msgHash.insert(-102, tr("If LinkShield is enabled then the cutoff score " "should be set between 1 and 100 but it is currently" " set to %1. Higher Numbers indicate higher risk.")); _msgHash.insert(-103, tr("The YourPay Store Number is not set.")); _msgHash.insert(-106, tr("Transaction failed LinkShield check. Either the " "score was greater than the maximum configured " "allowed score or the score was empty (this may " "happen if the application is configured to " "check the LinkShield score but you have not " "subscribed to this service).")); _msgHash.insert( 100, tr("Received unexpected approval code %1. This " "transaction has been treated as approved by " "YourPay.")); } int YourPayProcessor::buildCommon(const int pccardid, const QString &pcvv, const double pamount, QDomDocument &prequest, QString pordertype) { QDomElement order = prequest.createElement("order"); prequest.appendChild(order); // TODO: if check and not credit card transaction, do a different select XSqlQuery ypq; ypq.prepare( "SELECT ccard_active," " formatbytea(decrypt(setbytea(ccard_number), setbytea(:key),'bf')) AS ccard_number," " formatccnumber(decrypt(setbytea(ccard_number),setbytea(:key),'bf')) AS ccard_number_x," " formatbytea(decrypt(setbytea(ccard_name), setbytea(:key),'bf')) AS ccard_name," " formatbytea(decrypt(setbytea(ccard_address1), setbytea(:key),'bf')) AS ccard_address1," " formatbytea(decrypt(setbytea(ccard_address2), setbytea(:key),'bf')) AS ccard_address2," " formatbytea(decrypt(setbytea(ccard_city), setbytea(:key),'bf')) AS ccard_city," " formatbytea(decrypt(setbytea(ccard_state), setbytea(:key),'bf')) AS ccard_state," " formatbytea(decrypt(setbytea(ccard_zip), setbytea(:key),'bf')) AS ccard_zip," " formatbytea(decrypt(setbytea(ccard_country), setbytea(:key),'bf')) AS ccard_country," " formatbytea(decrypt(setbytea(ccard_month_expired),setbytea(:key),'bf')) AS ccard_month_expired," " formatbytea(decrypt(setbytea(ccard_year_expired),setbytea(:key), 'bf')) AS ccard_year_expired" " FROM ccard " "WHERE (ccard_id=:ccardid);"); ypq.bindValue(":ccardid", pccardid); ypq.bindValue(":key", omfgThis->_key); ypq.exec(); if (ypq.first()) { if (!ypq.value("ccard_active").toBool()) { _errorMsg = errorMsg(-10); return -10; } } else if (ypq.lastError().type() != QSqlError::NoError) { _errorMsg = ypq.lastError().databaseText(); return -1; } else { _errorMsg = errorMsg(-17).arg(pccardid); return -17; } QDomElement elem; elem = prequest.createElement("merchantinfo"); order.appendChild(elem); CREATECHILDTEXTNODE(elem, "configfile", _metricsenc->value("CCYPStoreNum").toLatin1()); elem = prequest.createElement("orderoptions"); order.appendChild(elem); CREATECHILDTEXTNODE(elem, "ordertype", pordertype); QString resultText; if (isLive()) resultText = "LIVE"; else if (isTest()) { if (_metrics->value("CCTestResult") == "F") resultText = (qrand() % 2) ? "DECLINE" : "DUPLICATE"; else if (_metrics->value("CCTestResult") == "S") switch (qrand() % 10) { case 0: resultText = "DECLINE"; break; case 1: resultText = "DUPLICATE"; break; default: resultText = "GOOD"; break; } else // if (_metrics->value("CCTestResult") == "P") resultText = "GOOD"; } else { _errorMsg = errorMsg(-13).arg(pccardid); return -13; } CREATECHILDTEXTNODE(elem, "result", resultText); elem = prequest.createElement("payment"); order.appendChild(elem); CREATECHILDTEXTNODE(elem, "chargetotal", QString::number(pamount, 'f', 2)); // TODO: if check and not credit card transaction do something else elem = prequest.createElement("creditcard"); order.appendChild(elem); CREATECHILDTEXTNODE(elem, "cardnumber", ypq.value("ccard_number").toString()); QString work_month; work_month.setNum(ypq.value("ccard_month_expired").toDouble()); if (work_month.length() == 1) work_month = "0" + work_month; CREATECHILDTEXTNODE(elem, "cardexpmonth", work_month); CREATECHILDTEXTNODE(elem, "cardexpyear", ypq.value("ccard_year_expired").toString().right(2)); if (! pcvv.isEmpty()) { CREATECHILDTEXTNODE(elem, "cvmvalue", pcvv); CREATECHILDTEXTNODE(elem, "cvmindicator", "provided"); } elem = prequest.createElement("billing"); order.appendChild(elem); CREATECHILDTEXTNODE(elem, "name", ypq.value("ccard_name").toString()); // TODO: company CREATECHILDTEXTNODE(elem, "address1", ypq.value("ccard_address1").toString()); CREATECHILDTEXTNODE(elem, "address2", ypq.value("ccard_address2").toString()); CREATECHILDTEXTNODE(elem, "city", ypq.value("ccard_city").toString()); CREATECHILDTEXTNODE(elem, "state", ypq.value("ccard_state").toString()); CREATECHILDTEXTNODE(elem, "zip", ypq.value("ccard_zip").toString()); // TODO: country // should be 2-char country code abbr // TODO: phone, fax, email CREATECHILDTEXTNODE(elem, "addrnum", ypq.value("ccard_address1").toString().section(" ", 0, 0)); if (DEBUG) qDebug("YP:buildCommon built %s", prequest.toString().toAscii().data()); return 0; } int YourPayProcessor::doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("YP:doAuthorize(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); int returnValue = 0; double amount = currToCurr(pcurrid, _ypcurrid, pamount, &returnValue); if (returnValue < 0) return returnValue; QDomDocument request; returnValue = buildCommon(pccardid, pcvv, amount, request, "PREAUTH"); if (returnValue != 0) return returnValue; QDomElement elem; elem = request.createElement("transactiondetails"); request.documentElement().appendChild(elem); // in case we're reusing an order number QString oidstr = pneworder; XSqlQuery ypq; ypq.prepare("SELECT MAX(COALESCE(ccpay_order_number_seq, -1)) + 1" " AS next_seq " " FROM ccpay " " WHERE (ccpay_order_number=:ccpay_order_number);"); ypq.bindValue(":ccpay_order_number", pneworder); ypq.exec(); if (ypq.first() && ! ypq.value("next_seq").isNull()) oidstr = oidstr + "-" + ypq.value("next_seq").toString(); else if (ypq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(-24); return -24; } CREATECHILDTEXTNODE(elem, "oid", oidstr); CREATECHILDTEXTNODE(elem, "terminaltype", "UNSPECIFIED"); CREATECHILDTEXTNODE(elem, "taxexempt", ptaxexempt ? "Y" : "N"); if (! preforder.isEmpty()) CREATECHILDTEXTNODE(elem, "ponumber", preforder); /* TODO: salesOrder.cpp set the shipping elem. YP only seems to use it for CALCSHIPPING transactions; we don't do these yet so don't bother elem = request.createElement("shipping"); request.documentElement().appendChild(elem); CREATECHILDTEXTNODE(elem, "address1", _shipto_address1); CREATECHILDTEXTNODE(elem, "address2", _shipto_address2); CREATECHILDTEXTNODE(elem, "city", _shipto_city); CREATECHILDTEXTNODE(elem, "name", _shipto_name); CREATECHILDTEXTNODE(elem, "state", _shipto_state); CREATECHILDTEXTNODE(elem, "zip", _shipto_zip); */ CREATECHILDTEXTNODE(request.elementsByTagName("payment").at(0), "tax", QString::number(ptax, 'f', 2)); QString response; returnValue = sendViaHTTP(request.toString(), response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "A", pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int YourPayProcessor::doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("YP:doCharge(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, pneworder.toAscii().data(), preforder.toAscii().data(), pccpayid); int returnValue = 0; double amount = currToCurr(pcurrid, _ypcurrid, pamount, &returnValue); if (returnValue < 0) return returnValue; QDomDocument request; returnValue = buildCommon(pccardid, pcvv, amount, request, "SALE"); if (returnValue != 0) return returnValue; QDomElement elem; elem = request.createElement("transactiondetails"); request.documentElement().appendChild(elem); // in case we're reusing an order number QString oidstr = pneworder; XSqlQuery ypq; ypq.prepare("SELECT MAX(COALESCE(ccpay_order_number_seq, -1)) + 1" " AS next_seq " " FROM ccpay " " WHERE (ccpay_order_number=:ccpay_order_number);"); ypq.bindValue(":ccpay_order_number", pneworder); ypq.exec(); if (ypq.first() && ! ypq.value("next_seq").isNull()) oidstr = oidstr + "-" + ypq.value("next_seq").toString(); else if (ypq.lastError().type() != QSqlError::NoError) { _errorMsg = errorMsg(-44); return -44; } CREATECHILDTEXTNODE(elem, "oid", oidstr); CREATECHILDTEXTNODE(elem, "terminaltype", "UNSPECIFIED"); CREATECHILDTEXTNODE(elem, "taxexempt", ptaxexempt ? "Y" : "N"); if (! preforder.isEmpty()) CREATECHILDTEXTNODE(elem, "ponumber", preforder); /* TODO: salesOrder.cpp had the following, but it doesn't appear to be useful except for having YP calculate shipping charges. since we don't use YP to calculate shipping and this is a SALE and not a CALCSHIPPING transaction, we won't bother for now. elem = request.createElement("shipping"); request.documentElement().appendChild(elem); CREATECHILDTEXTNODE(elem, "address1", _shipto_address1); CREATECHILDTEXTNODE(elem, "address2", _shipto_address2); CREATECHILDTEXTNODE(elem, "city", _shipto_city); CREATECHILDTEXTNODE(elem, "name", _shipto_name); CREATECHILDTEXTNODE(elem, "state", _shipto_state); CREATECHILDTEXTNODE(elem, "zip", _shipto_zip); */ CREATECHILDTEXTNODE(request.elementsByTagName("payment").at(0), "tax", QString::number(ptax, 'f', 2)); QString response; returnValue = sendViaHTTP(request.toString(), response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "C", pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int YourPayProcessor::doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("YP:doChargePreauthorized(%d, pcvv, %f, %d, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = 0; double amount = currToCurr(pcurrid, _ypcurrid, pamount, &returnValue); if (returnValue < 0) return returnValue; QDomDocument request; returnValue = buildCommon(pccardid, pcvv, amount, request, "POSTAUTH"); if (returnValue != 0) return returnValue; QDomElement elem = request.createElement("transactiondetails"); request.documentElement().appendChild(elem); CREATECHILDTEXTNODE(elem, "oid", preforder); CREATECHILDTEXTNODE(elem, "terminaltype", "UNSPECIFIED"); QString response; returnValue = sendViaHTTP(request.toString(), response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "CP", pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int YourPayProcessor::doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("YP:doCredit(%d, pcvv, %f, %f, %d, %f, %f, %d, %s, %s, %d)", pccardid, pamount, ptax, ptaxexempt, pfreight, pduty, pcurrid, qPrintable(pneworder), qPrintable(preforder), pccpayid); int returnValue = 0; double amount = currToCurr(pcurrid, _ypcurrid, pamount, &returnValue); if (returnValue < 0) return returnValue; QDomDocument request; returnValue = buildCommon(pccardid, pcvv, amount, request, "CREDIT"); if (returnValue != 0) return returnValue; QDomElement elem = request.createElement("transactiondetails"); request.documentElement().appendChild(elem); CREATECHILDTEXTNODE(elem, "oid", preforder); CREATECHILDTEXTNODE(elem, "reference_number", pneworder); CREATECHILDTEXTNODE(elem, "terminaltype", "UNSPECIFIED"); CREATECHILDTEXTNODE(elem, "taxexempt", ptaxexempt ? "Y" : "N"); CREATECHILDTEXTNODE(request.elementsByTagName("payment").at(0), "tax", QString::number(ptax, 'f', 2)); QString response; returnValue = sendViaHTTP(request.toString(), response); if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "R", pamount, pcurrid, pneworder, preforder, pccpayid, pparams); return returnValue; } int YourPayProcessor::doVoidPrevious(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("YP:doVoidPrevious(%d, pcvv, %f, %d, %s, %s, %s, %d)", pccardid, pamount, pcurrid, qPrintable(pneworder), qPrintable(preforder), qPrintable(papproval), pccpayid); int returnValue = 0; double amount = currToCurr(pcurrid, _ypcurrid, pamount, &returnValue); if (returnValue < 0) return returnValue; // distinguish void errors from errors from problems that cause us to void QString tmpErrorMsg = _errorMsg; QDomDocument request; returnValue = buildCommon(pccardid, pcvv, amount, request, "VOID"); if (returnValue != 0) return returnValue; QDomElement elem = request.createElement("transactiondetails"); request.documentElement().appendChild(elem); CREATECHILDTEXTNODE(elem, "oid", preforder); CREATECHILDTEXTNODE(elem, "terminaltype", "UNSPECIFIED"); QString response; returnValue = sendViaHTTP(request.toString(), response); _errorMsg = tmpErrorMsg; if (returnValue < 0) return returnValue; returnValue = handleResponse(response, pccardid, "V", pamount, pcurrid, pneworder, preforder, pccpayid, pparams); _errorMsg = tmpErrorMsg; return returnValue; } int YourPayProcessor::handleResponse(const QString &presponse, const int pccardid, const QString &ptype, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams) { if (DEBUG) qDebug("YP::handleResponse(%s, %d, %s, %f, %d, %s, %d, pparams)", presponse.toAscii().data(), pccardid, ptype.toAscii().data(), pamount, pcurrid, preforder.toAscii().data(), pccpayid); QDomDocument response; // YP doesn't even send back a valid XML doc! response.setContent("" + presponse + ""); QDomNode node; QDomElement root = response.documentElement(); QString r_approved; QString r_avs; QString r_code; QString r_error; QString r_message; QString r_ordernum; QString r_ref; QString r_score; QString r_shipping; QString r_tax; QString r_tdate; QString r_time; QString status; node = root.firstChild(); while ( !node.isNull() ) { if (node.isElement()) { if (node.nodeName() == "r_approved" ) r_approved = node.toElement().text(); else if (node.nodeName() == "r_avs" ) r_avs = node.toElement().text(); else if (node.nodeName() == "r_code" ) r_code = node.toElement().text(); else if (node.nodeName() == "r_error" ) r_error = node.toElement().text(); else if (node.nodeName() == "r_message" ) r_message = node.toElement().text(); else if (node.nodeName() == "r_ordernum" ) r_ordernum = node.toElement().text(); else if (node.nodeName() == "r_ref" ) r_ref = node.toElement().text(); else if (node.nodeName() == "r_score" ) r_score = node.toElement().text(); else if (node.nodeName() == "r_shipping" ) r_shipping = node.toElement().text(); else if (node.nodeName() == "r_tax" ) r_tax = node.toElement().text(); else if (node.nodeName() == "r_tdate" ) r_tdate = node.toElement().text(); else if (node.nodeName() == "r_time" ) r_time = node.toElement().text(); } node = node.nextSibling(); } if (isTest()) { // in test mode YP doesn't send an approval code if (r_approved == "APPROVED" && r_code.isEmpty()) r_code = "12345"; // inject failures to test AVS and CVV checking but ONLY IN TEST MODE if (r_avs.isEmpty() && _metrics->value("CCTestResult") == "S") { switch (qrand() % 50) { case 0: r_avs = "NN"; break; case 1: r_avs = "XN"; break; case 2: r_avs = "YN"; break; case 3: r_avs = "NX"; break; case 4: r_avs = "XX"; break; case 5: r_avs = "YX"; break; default: r_avs = "YY"; break; } switch (qrand() % 50) { case 0: r_avs += "N"; break; case 1: r_avs += "P"; break; case 2: r_avs += "S"; break; case 3: r_avs += "U"; break; default: r_avs += "M"; break; } } } int returnValue = 0; if (r_approved == "APPROVED" || r_approved == "SUBMITTED") { _errorMsg = errorMsg(0).arg(r_ref); if (r_approved == "SUBMITTED") { _errorMsg = errorMsg(100).arg(r_approved); returnValue = 100; } if (ptype == "A") status = "A"; // Authorized else if (ptype == "V") status = "V"; // Voided else status = "C"; // Completed/Charged } else if (r_approved == "DENIED") { _errorMsg = errorMsg(-90).arg(r_message); returnValue = -90; status = "D"; } else if (r_approved == "DUPLICATE") { _errorMsg = errorMsg(-91).arg(r_message); returnValue = -91; status = "D"; } else if (r_approved == "DECLINED") { _errorMsg = errorMsg(-92).arg(r_error); returnValue = -92; status = "D"; } else if (r_approved == "FRAUD") { _errorMsg = errorMsg(-93).arg(r_error); returnValue = -93; status = "D"; } else if (r_approved.isEmpty()) { _errorMsg = errorMsg(-100) .arg(r_error).arg(r_message).arg(presponse); returnValue = -100; status = "X"; } /* TODO: rewrite CreditCardProcessor::fraudChecks() as recommended in cybersourceprocessor.cpp, then rewrite this */ // YP encodes AVS and CVV checking in the r_avs response field QRegExp avsRegExp("^[" + _metrics->value("CCAvsAddr") + "][" + _metrics->value("CCAvsZIP") + "]"); _passedAvs = _metrics->value("CCAvsCheck") == "X" || ! r_avs.contains(avsRegExp); // avsregexp matches failures _passedCvv = _metrics->value("CCCVVCheck") == "X" || ! r_avs.contains(QRegExp("[" + _metrics->value("CCCVVErrors") + "]$")); // end TODO _passedLinkShield = (! _metrics->boolean("CCYPLinkShield")) || (! r_score.isEmpty() && r_score.toInt() <= _metrics->value("CCYPLinkShieldMax").toInt()); if (DEBUG) qDebug("YP:%s\t_passedAvs %d\t_passedCvv %d\t_passedLinkShield %d", r_avs.toAscii().data(), _passedAvs, _passedCvv, _passedLinkShield); pparams.append("ccard_id", pccardid); pparams.append("auth_charge", ptype); pparams.append("type", ptype); pparams.append("reforder", preforder.isEmpty() ? pneworder : preforder); pparams.append("status", status); pparams.append("avs", r_avs); pparams.append("ordernum", pneworder); pparams.append("xactionid", r_ordernum.isEmpty() ? pneworder : r_ordernum); pparams.append("error", r_error); pparams.append("approved", r_approved); pparams.append("code", r_code); pparams.append("score", r_score.toInt()); pparams.append("shipping", r_shipping); pparams.append("tax", r_tax); pparams.append("tdate", r_tdate); pparams.append("ref", r_ref); pparams.append("message", r_message); if (pcurrid != _ypcurrid) { pparams.append("fromcurr", pcurrid); pparams.append("tocurr", _ypcurrid); } else pparams.append("currid", pcurrid); pparams.append("auth", QVariant(ptype == "A")); if (! r_time.isEmpty()) pparams.append("time", r_time); if (DEBUG) qDebug("YP:r_error.isEmpty() = %d", r_error.isEmpty()); if (! r_error.isEmpty()) { _errorMsg = errorMsg(-12).arg(r_error).arg(_company); returnValue = -12; } if (returnValue == 0) pparams.append("amount", pamount); else pparams.append("amount", 0); // no money changed hands this attempt return returnValue; } int YourPayProcessor::doTestConfiguration() { if (DEBUG) qDebug("YP:doTestConfiguration()"); #ifdef Q_WS_WIN QString pemfile = _metrics->value("CCYPWinPathPEM"); #elif defined Q_WS_MACX QString pemfile = _metrics->value("CCYPMacPathPEM"); #elif defined Q_WS_X11 QString pemfile = _metrics->value("CCYPLinPathPEM"); #endif if (pemfile.isEmpty()) { _errorMsg = errorMsg(-15); return -15; } QFileInfo fileinfo(pemfile.toLatin1()); if (!fileinfo.isFile()) { _errorMsg = errorMsg(-16).arg(fileinfo.fileName()); return -16; } if (_metricsenc->value("CCYPStoreNum").isEmpty()) { _errorMsg = errorMsg(-103); return -103; } if (_metrics->boolean("CCYPLinkShield") && _metrics->value("CCYPLinkShieldMax").toInt() <= 0) { _errorMsg = errorMsg(-102).arg(_metrics->value("CCYPLinkShieldMax")); return -102; } return 0; } void YourPayProcessor::reset() { CreditCardProcessor::reset(); _passedLinkShield = true; } int YourPayProcessor::fraudChecks() { if (DEBUG) qDebug("YP:fraudChecks()"); int returnValue = CreditCardProcessor::fraudChecks(); if (returnValue < 0) return returnValue; else if (!_passedLinkShield) { _errorMsg = errorMsg(-106); returnValue = -106; } return returnValue; } bool YourPayProcessor::handlesCreditCards() { return true; } qt-client-4.1.0/guiclient/yourpayprocessor.h000066400000000000000000000046161217451700100212250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef YOURPAYPROCESSOR_H #define YOURPAYPROCESSOR_H #include #include #include #include "creditcardprocessor.h" class YourPayProcessor : public CreditCardProcessor { Q_OBJECT public: YourPayProcessor(); protected: virtual int buildCommon(const int pccardid, const QString &pcvv, const double pamount, QDomDocument &prequest, QString pordertype); virtual int doTestConfiguration(); virtual int doAuthorize(const int pccardid, const QString &pcvv, double &pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pParams); virtual int doCharge(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString& pneworder, QString& preforder, int &pccpayid, ParameterList &pparams); virtual int doChargePreauthorized(const int pccardid, const QString &pcvv, const double pamount, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doCredit(const int pccardid, const QString &pcvv, const double pamount, const double ptax, const bool ptaxexempt, const double pfreight, const double pduty, const int pcurrid, QString &pneworder, QString &preforder, int &pccpayid, ParameterList &pparams); virtual int doVoidPrevious(const int pccardid, const QString &pcvv, double pamount, const int pcurrid, QString &pneworder, QString &preforder, QString &papproval, int &pccpayid, ParameterList &pparams); virtual int fraudChecks(); virtual int handleResponse(const QString&, const int, const QString&, const double, const int, QString&, QString&, int&, ParameterList&); virtual bool handlesCreditCards(); virtual void reset(); private: bool _passedLinkShield; int _ypcurrid; }; #endif // YOURPAYPROCESSOR_H qt-client-4.1.0/guiclient/zeroUncountedCountTagsByWarehouse.cpp000066400000000000000000000033431217451700100247560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "zeroUncountedCountTagsByWarehouse.h" zeroUncountedCountTagsByWarehouse::zeroUncountedCountTagsByWarehouse(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : XDialog(parent, name, modal, fl) { setupUi(this); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_zero, SIGNAL(clicked()), this, SLOT(sZero())); } zeroUncountedCountTagsByWarehouse::~zeroUncountedCountTagsByWarehouse() { // no need to delete child widgets, Qt does it all for us } void zeroUncountedCountTagsByWarehouse::languageChange() { retranslateUi(this); } void zeroUncountedCountTagsByWarehouse::sZero() { XSqlQuery zeroZero; if (_warehouse->isSelected()) { zeroZero.prepare( "SELECT enterCount(invcnt_id, 0, :comments) " "FROM invcnt, itemsite " "WHERE ( (invcnt_itemsite_id=itemsite_id)" " AND (invcnt_qoh_after IS NULL)" " AND (itemsite_warehous_id=:warehous_id) );" ); zeroZero.bindValue(":warehous_id", _warehouse->id()); } else zeroZero.prepare( "SELECT enterCount(invcnt_id, 0, :comments) " "FROM invcnt " "WHERE (invcnt_qoh_after IS NULL);" ); zeroZero.bindValue(":comments", _comments->toPlainText()); zeroZero.exec(); accept(); } qt-client-4.1.0/guiclient/zeroUncountedCountTagsByWarehouse.h000066400000000000000000000020031217451700100244130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ZEROUNCOUNTEDCOUNTTAGSBYWAREHOUSE_H #define ZEROUNCOUNTEDCOUNTTAGSBYWAREHOUSE_H #include "xdialog.h" #include "ui_zeroUncountedCountTagsByWarehouse.h" class zeroUncountedCountTagsByWarehouse : public XDialog, public Ui::zeroUncountedCountTagsByWarehouse { Q_OBJECT public: zeroUncountedCountTagsByWarehouse(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~zeroUncountedCountTagsByWarehouse(); protected slots: virtual void languageChange(); virtual void sZero(); }; #endif // ZEROUNCOUNTEDCOUNTTAGSBYWAREHOUSE_H qt-client-4.1.0/guiclient/zeroUncountedCountTagsByWarehouse.ui000066400000000000000000000116071217451700100246130ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. zeroUncountedCountTagsByWarehouse 0 0 418 261 Zero Uncounted Count Tags by Warehouse 12 12 false Qt::Horizontal QSizePolicy::Expanding 0 20 5 &Close &Zero true Qt::Vertical 20 0 0 0 0 0 0 Co&mments: Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter _comments WarehouseGroup QGroupBox
    warehousegroup.h
    1
    XTextEdit QTextEdit
    xtextedit.h
    _warehouse _comments _zero _close _close clicked() zeroUncountedCountTagsByWarehouse reject() 20 20 20 20
    qt-client-4.1.0/hunspell/000077500000000000000000000000001217451700100152445ustar00rootroot00000000000000qt-client-4.1.0/hunspell/English.aff000066400000000000000000000057451217451700100173260ustar00rootroot00000000000000SET ISO8859-1 TRY esianrtolcdugmphbyfvkwzESIANRTOLCDUGMPHBYFVKWZ' NOSUGGEST ! # ordinal numbers COMPOUNDMIN 1 # only in compounds: 1th, 2th, 3th ONLYINCOMPOUND c # compound rules: # 1. [0-9]*1[0-9]th (10th, 11th, 12th, 56714th, etc.) # 2. [0-9]*[02-9](1st|2nd|3rd|[4-9]th) (21st, 22nd, 123rd, 1234th, etc.) COMPOUNDRULE 2 COMPOUNDRULE n*1t COMPOUNDRULE n*mp WORDCHARS 0123456789 PFX A Y 1 PFX A 0 re . PFX I Y 1 PFX I 0 in . PFX U Y 1 PFX U 0 un . PFX C Y 1 PFX C 0 de . PFX E Y 1 PFX E 0 dis . PFX F Y 1 PFX F 0 con . PFX K Y 1 PFX K 0 pro . SFX V N 2 SFX V e ive e SFX V 0 ive [^e] SFX N Y 3 SFX N e ion e SFX N y ication y SFX N 0 en [^ey] SFX X Y 3 SFX X e ions e SFX X y ications y SFX X 0 ens [^ey] SFX H N 2 SFX H y ieth y SFX H 0 th [^y] SFX Y Y 1 SFX Y 0 ly . SFX G Y 2 SFX G e ing e SFX G 0 ing [^e] SFX J Y 2 SFX J e ings e SFX J 0 ings [^e] SFX D Y 4 SFX D 0 d e SFX D y ied [^aeiou]y SFX D 0 ed [^ey] SFX D 0 ed [aeiou]y SFX T N 4 SFX T 0 st e SFX T y iest [^aeiou]y SFX T 0 est [aeiou]y SFX T 0 est [^ey] SFX R Y 4 SFX R 0 r e SFX R y ier [^aeiou]y SFX R 0 er [aeiou]y SFX R 0 er [^ey] SFX Z Y 4 SFX Z 0 rs e SFX Z y iers [^aeiou]y SFX Z 0 ers [aeiou]y SFX Z 0 ers [^ey] SFX S Y 4 SFX S y ies [^aeiou]y SFX S 0 s [aeiou]y SFX S 0 es [sxzh] SFX S 0 s [^sxzhy] SFX P Y 3 SFX P y iness [^aeiou]y SFX P 0 ness [aeiou]y SFX P 0 ness [^y] SFX M Y 1 SFX M 0 's . SFX B Y 3 SFX B 0 able [^aeiou] SFX B 0 able ee SFX B e able [^aeiou]e SFX L Y 1 SFX L 0 ment . REP 88 REP a ei REP ei a REP a ey REP ey a REP ai ie REP ie ai REP are air REP are ear REP are eir REP air are REP air ere REP ere air REP ere ear REP ere eir REP ear are REP ear air REP ear ere REP eir are REP eir ere REP ch te REP te ch REP ch ti REP ti ch REP ch tu REP tu ch REP ch s REP s ch REP ch k REP k ch REP f ph REP ph f REP gh f REP f gh REP i igh REP igh i REP i uy REP uy i REP i ee REP ee i REP j di REP di j REP j gg REP gg j REP j ge REP ge j REP s ti REP ti s REP s ci REP ci s REP k cc REP cc k REP k qu REP qu k REP kw qu REP o eau REP eau o REP o ew REP ew o REP oo ew REP ew oo REP ew ui REP ui ew REP oo ui REP ui oo REP ew u REP u ew REP oo u REP u oo REP u oe REP oe u REP u ieu REP ieu u REP ue ew REP ew ue REP uff ough REP oo ieu REP ieu oo REP ier ear REP ear ier REP ear air REP air ear REP w qu REP qu w REP z ss REP ss z REP shun tion REP shun sion REP shun cion qt-client-4.1.0/hunspell/English.dic000066400000000000000000025175031217451700100173330ustar00rootroot0000000000000062118 0/nm 1/n1 2/nm 3/nm 4/nm 5/nm 6/nm 7/nm 8/nm 9/nm 0th/pt 1st/p 1th/tc 2nd/p 2th/tc 3rd/p 3th/tc 4th/pt 5th/pt 6th/pt 7th/pt 8th/pt 9th/pt a A AA AAA Aachen/M aardvark/SM Aaren/M Aarhus/M Aarika/M Aaron/M AB aback abacus/SM abaft Abagael/M Abagail/M abalone/SM abandoner/M abandon/LGDRS abandonment/SM abase/LGDSR abasement/S abaser/M abashed/UY abashment/MS abash/SDLG abate/DSRLG abated/U abatement/MS abater/M abattoir/SM Abba/M Abbe/M abbé/S abbess/SM Abbey/M abbey/MS Abbie/M Abbi/M Abbot/M abbot/MS Abbott/M abbr abbrev abbreviated/UA abbreviates/A abbreviate/XDSNG abbreviating/A abbreviation/M Abbye/M Abby/M ABC/M Abdel/M abdicate/NGDSX abdication/M abdomen/SM abdominal/YS abduct/DGS abduction/SM abductor/SM Abdul/M ab/DY abeam Abelard/M Abel/M Abelson/M Abe/M Aberdeen/M Abernathy/M aberrant/YS aberrational aberration/SM abet/S abetted abetting abettor/SM Abeu/M abeyance/MS abeyant Abey/M abhorred abhorrence/MS abhorrent/Y abhorrer/M abhorring abhor/S abidance/MS abide/JGSR abider/M abiding/Y Abidjan/M Abie/M Abigael/M Abigail/M Abigale/M Abilene/M ability/IMES abjection/MS abjectness/SM abject/SGPDY abjuration/SM abjuratory abjurer/M abjure/ZGSRD ablate/VGNSDX ablation/M ablative/SY ablaze abler/E ables/E ablest able/U abloom ablution/MS Ab/M ABM/S abnegate/NGSDX abnegation/M Abner/M abnormality/SM abnormal/SY aboard abode/GMDS abolisher/M abolish/LZRSDG abolishment/MS abolitionism/SM abolitionist/SM abolition/SM abominable abominably abominate/XSDGN abomination/M aboriginal/YS aborigine/SM Aborigine/SM aborning abortionist/MS abortion/MS abortiveness/M abortive/PY abort/SRDVG Abo/SM! abound/GDS about/S aboveboard aboveground above/S abracadabra/S abrader/M abrade/SRDG Abraham/M Abrahan/M Abra/M Abramo/M Abram/SM Abramson/M Abran/M abrasion/MS abrasiveness/S abrasive/SYMP abreaction/MS abreast abridge/DSRG abridged/U abridger/M abridgment/SM abroad abrogate/XDSNG abrogation/M abrogator/SM abruptness/SM abrupt/TRYP ABS abscess/GDSM abscissa/SM abscission/SM absconder/M abscond/SDRZG abseil/SGDR absence/SM absenteeism/SM absentee/MS absentia/M absentmindedness/S absentminded/PY absent/SGDRY absinthe/SM abs/M absoluteness/SM absolute/NPRSYTX absolution/M absolutism/MS absolutist/SM absolve/GDSR absolver/M absorb/ASGD absorbed/U absorbency/MS absorbent/MS absorber/SM absorbing/Y absorption/MS absorptive absorptivity/M abstainer/M abstain/GSDRZ abstemiousness/MS abstemious/YP abstention/SM abstinence/MS abstinent/Y abstractedness/SM abstracted/YP abstracter/M abstractionism/M abstractionist/SM abstraction/SM abstractness/SM abstractor/MS abstract/PTVGRDYS abstruseness/SM abstruse/PRYT absurdity/SM absurdness/SM absurd/PRYST Abuja abundance/SM abundant/Y abused/E abuse/GVZDSRB abuser/M abuses/E abusing/E abusiveness/SM abusive/YP abut/LS abutment/SM abutted abutter/MS abutting abuzz abysmal/Y abyssal Abyssinia/M Abyssinian abyss/SM AC acacia/SM academe/MS academia/SM academical/Y academicianship academician/SM academic/S academy/SM Acadia/M acanthus/MS Acapulco/M accede/SDG accelerated/U accelerate/NGSDXV accelerating/Y acceleration/M accelerator/SM accelerometer/SM accented/U accent/SGMD accentual/Y accentuate/XNGSD accentuation/M acceptability/SM acceptability's/U acceptableness/SM acceptable/P acceptably/U acceptance/SM acceptant acceptation/SM accepted/Y accepter/M accepting/PY acceptor/MS accept/RDBSZVG accessed/A accessibility/IMS accessible/IU accessibly/I accession/SMDG accessors accessory/SM access/SDMG accidence/M accidentalness/M accidental/SPY accident/MS acclaimer/M acclaim/SDRG acclamation/MS acclimate/XSDGN acclimation/M acclimatisation acclimatise/DG acclimatization/AMS acclimatized/U acclimatize/RSDGZ acclimatizes/A acclivity/SM accolade/GDSM accommodated/U accommodate/XVNGSD accommodating/Y accommodation/M accommodativeness/M accommodative/P accompanied/U accompanier/M accompaniment/MS accompanist/SM accompany/DRSG accomplice/MS accomplished/U accomplisher/M accomplishment/SM accomplish/SRDLZG accordance/SM accordant/Y accorder/M according/Y accordionist/SM accordion/MS accord/SZGMRD accost/SGD accountability/MS accountability's/U accountableness/M accountable/U accountably/U accountancy/SM accountant/MS account/BMDSGJ accounted/U accounting/M accouter/GSD accouterments accouterment's accoutrement/M Accra/M accreditation/SM accredited/U accredit/SGD accretion/SM accrual/MS accrue/SDG acct acculturate/XSDVNG acculturation/M accumulate/VNGSDX accumulation/M accumulativeness/M accumulative/YP accumulator/MS accuracy/IMS accurate/IY accurateness/SM accursedness/SM accursed/YP accusal/M accusation/SM accusative/S accusatory accused/M accuser/M accuse/SRDZG accusing/Y accustomedness/M accustomed/P accustom/SGD ac/DRG aced/M acerbate/DSG acerbic acerbically acerbity/MS ace/SM acetaminophen/S acetate/MS acetic acetone/SM acetonic acetylene/MS Acevedo/M Achaean/M Achebe/M ached/A ache/DSG achene/SM Achernar/M aches/A Acheson/M achievable/U achieved/UA achieve/LZGRSDB achievement/SM achiever/M Achilles aching/Y achoo achromatic achy/TR acidic acidification/M acidify/NSDG acidity/SM acidness/M acidoses acidosis/M acid/SMYP acidulous acing/M Ackerman/M acknowledgeable acknowledgedly acknowledged/U acknowledge/GZDRS acknowledger/M acknowledgment/SAM ACLU Ac/M ACM acme/SM acne/MDS acolyte/MS Aconcagua/M aconite/MS acorn/SM Acosta/M acoustical/Y acoustician/M acoustic/S acoustics/M acquaintance/MS acquaintanceship/S acquainted/U acquaint/GASD acquiesce/GSD acquiescence/SM acquiescent/Y acquirable acquire/ASDG acquirement/SM acquisition's/A acquisition/SM acquisitiveness/MS acquisitive/PY acquit/S acquittal/MS acquittance/M acquitted acquitter/M acquitting acreage/MS acre/MS acridity/MS acridness/SM acrid/TPRY acrimoniousness/MS acrimonious/YP acrimony/MS acrobatically acrobatic/S acrobatics/M acrobat/SM acronym/SM acrophobia/SM Acropolis/M acropolis/SM across acrostic/SM Acrux/M acrylate/M acrylic/S ACT Actaeon/M Acta/M ACTH acting/S actinic actinide/SM actinium/MS actinometer/MS action/DMSGB actions/AI action's/IA activate/AXCDSNGI activated/U activation/AMCI activator/SM active/APY actively/I activeness/MS actives activism/MS activist/MS activities/A activity/MSI Acton/M actor/MAS actress/SM act's Acts act/SADVG actuality/SM actualization/MAS actualize/GSD actualizes/A actual/SY actuarial/Y actuary/MS actuate/GNXSD actuation/M actuator/SM acuity/MS acumen/SM acupressure/S acupuncture/SM acupuncturist/S acuteness/MS acute/YTSRP acyclic acyclically acyclovir/S AD adage/MS adagio/S Adah/M Adair/M Adaline/M Ada/M adamant/SY Adamo/M Adam/SM Adamson/M Adana/M Adan/M adaptability/MS adaptable/U adaptation/MS adaptedness/M adapted/P adapter/M adapting/A adaption adaptively adaptiveness/M adaptive/U adaptivity adapt/SRDBZVG Adara/M ad/AS ADC Adda/M Addams addenda addend/SM addendum/M adder/M Addia/M addiction/MS addictive/P addict/SGVD Addie/M Addi/M Addison/M additional/Y addition/MS additive/YMS additivity addle/GDS addressability addressable/U addressed/A addressee/SM addresser/M addresses/A address/MDRSZGB Addressograph/M adduce/GRSD adducer/M adduct/DGVS adduction/M adductor/M Addy/M add/ZGBSDR Adelaida/M Adelaide/M Adela/M Adelbert/M Adele/M Adelheid/M Adelice/M Adelina/M Adelind/M Adeline/M Adella/M Adelle/M Adel/M Ade/M Adena/M Adenauer/M adenine/SM Aden/M adenoidal adenoid/S adeptness/MS adept/RYPTS adequacy/IMS adequate/IPY adequateness's/I adequateness/SM Adey/M Adham/M Adhara/M adherence/SM adherent/YMS adherer/M adhere/ZGRSD adhesion/MS adhesiveness/MS adhesive/PYMS adiabatic adiabatically Adiana/M Adidas/M adieu/S Adi/M Adina/M adiós adipose/S Adirondack/SM adj adjacency/MS adjacent/Y adjectival/Y adjective/MYS adjoin/SDG adjoint/M adjourn/DGLS adjournment/SM adjudge/DSG adjudicate/VNGXSD adjudication/M adjudicator/SM adjudicatory adjunct/VSYM adjuration/SM adjure/GSD adjustable/U adjustably adjust/DRALGSB adjusted/U adjuster's/A adjuster/SM adjustive adjustment/MAS adjustor's adjutant/SM Adkins/M Adlai/M Adler/M adman/M admen administer/GDJS administrable administrate/XSDVNG administration/M administrative/Y administrator/MS administratrix/M admirableness/M admirable/P admirably admiral/SM admiralty/MS Admiralty/S admiration/MS admirer/M admire/RSDZBG admiring/Y admissibility/ISM admissible/I admissibly admission/AMS admit/AS admittance/MS admitted/A admittedly admitting/A admix/SDG admixture/SM Adm/M Ad/MN admonisher/M admonish/GLSRD admonishing/Y admonishment/SM admonition/MS admonitory adobe/MS adolescence/MS adolescent/SYM Adolf/M Adolfo/M Adolphe/M Adolph/M Adolpho/M Adolphus/M Ado/M ado/MS Adonis/SM adopted/AU adopter/M adoption/MS adoptive/Y adopt/RDSBZVG adopts/A adorableness/SM adorable/P adorably Adora/M adoration/SM adore/DSRGZB Adoree/M Adore/M adorer/M adoring/Y adorned/U Adorne/M adornment/SM adorn/SGLD ADP Adrea/M adrenalin adrenaline/MS Adrenalin/MS adrenal/YS Adria/MX Adriana/M Adriane/M Adrian/M Adrianna/M Adrianne/M Adriano/M Adriatic Adriena/M Adrien/M Adrienne/M adrift adroitness/MS adroit/RTYP ads ad's adsorbate/M adsorbent/S adsorb/GSD adsorption/MS adsorptive/Y adulate/GNDSX adulation/M adulator/SM adulatory adulterant/SM adulterated/U adulterate/NGSDX adulteration/M adulterer/SM adulteress/MS adulterous/Y adultery/SM adulthood/MS adult/MYPS adultness/M adumbrate/XSDVGN adumbration/M adumbrative/Y adv advance/DSRLZG advancement/MS advancer/M advantage/GMEDS advantageous/EY advantageousness/M Adventist/M adventist/S adventitiousness/M adventitious/PY adventive/Y Advent/SM advent/SVM adventurer/M adventuresome adventure/SRDGMZ adventuress/SM adventurousness/SM adventurous/YP adverbial/MYS adverb/SM adversarial adversary/SM adverse/DSRPYTG adverseness/MS adversity/SM advert/GSD advertised/U advertise/JGZSRDL advertisement/SM advertiser/M advertising/M advertorial/S advice/SM Advil/M advisability/SIM advisable/I advisableness/M advisably advisedly/I advised/YU advisee/MS advisement/MS adviser/M advise/ZRSDGLB advisor/S advisor's advisory/S advocacy/SM advocate/NGVDS advocation/M advt adze's adz/MDSG Aegean aegis/SM Aelfric/M Aeneas Aeneid/M aeolian Aeolus/M aeon's aerate/XNGSD aeration/M aerator/MS aerialist/MS aerial/SMY Aeriela/M Aeriell/M Aeriel/M aerie/SRMT aeroacoustic aerobatic/S aerobically aerobic/S aerodrome/SM aerodynamically aerodynamic/S aerodynamics/M aeronautical/Y aeronautic/S aeronautics/M aerosolize/D aerosol/MS aerospace/SM Aeschylus/M Aesculapius/M Aesop/M aesthete/S aesthetically aestheticism/MS aesthetics/M aesthetic/U aether/M aetiology/M AF AFAIK afar/S AFB AFC AFDC affability/MS affable/TR affably affair/SM affectation/MS affectedness/EM affected/UEYP affect/EGSD affecter/M affecting/Y affectionate/UY affectioned affection/EMS affectioning affective/MY afferent/YS affiance/GDS affidavit/SM affiliated/U affiliate/EXSDNG affiliation/EM affine affinity/SM affirm/ASDG affirmation/SAM affirmative/SY affix/SDG afflatus/MS afflict/GVDS affliction/SM afflictive/Y affluence/SM affluent/YS afford/DSBG afforest/A afforestation/SM afforested afforesting afforests affray/MDSG affricate/VNMS affrication/M affricative/M affright affront/GSDM Afghani/SM Afghanistan/M afghan/MS Afghan/SM aficionado/MS afield afire aflame afloat aflutter afoot afore aforementioned aforesaid aforethought/S afoul Afr afraid/U afresh Africa/M African/MS Afrikaans/M Afrikaner/SM afro Afrocentric Afrocentrism/S Afro/MS afterbirth/M afterbirths afterburner/MS aftercare/SM aftereffect/MS afterglow/MS afterimage/MS afterlife/M afterlives aftermath/M aftermaths aftermost afternoon/SM aftershave/S aftershock/SM afters/M aftertaste/SM afterthought/MS afterward/S afterworld/MS Afton/M aft/ZR Agace/M again against Agamemnon/M agapae agape/S agar/MS Agassiz/M Agata/M agate/SM Agatha/M Agathe/M agave/SM agedness/M aged/PY age/GJDRSMZ ageism/S ageist/S agelessness/MS ageless/YP agency/SM agenda/MS agent/AMS agented agenting agentive ageratum/M Aggie/M Aggi/M agglomerate/XNGVDS agglomeration/M agglutinate/VNGXSD agglutination/M agglutinin/MS aggrandize/LDSG aggrandizement/SM aggravate/SDNGX aggravating/Y aggravation/M aggregated/U aggregate/EGNVD aggregately aggregateness/M aggregates aggregation/SM aggregative/Y aggression/SM aggressively aggressiveness/S aggressive/U aggressor/MS aggrieved/Y aggrieve/GDS Aggy/SM aghast agile/YTR agility/MS agitated/Y agitate/XVNGSD agitation/M agitator/SM agitprop/MS Aglaia/M agleam aglitter aglow Ag/M Agna/M Agnella/M Agnese/M Agnes/M Agnesse/M Agneta/M Agnew/M Agni/M Agnola/M agnosticism/MS agnostic/SM ago agog agonizedly/S agonized/Y agonize/ZGRSD agonizing/Y agony/SM agoraphobia/MS agoraphobic/S Agosto/M Agra/M agrarianism/MS agrarian/S agreeable/EP agreeableness/SME agreeably/E agreeing/E agree/LEBDS agreement/ESM agreer/S Agretha/M agribusiness/SM Agricola/M agriculturalist/S agricultural/Y agriculture/MS agriculturist/SM Agrippa/M Agrippina/M agrochemicals agronomic/S agronomist/SM agronomy/MS aground Aguascalientes/M ague/MS Aguie/M Aguilar/M Aguinaldo/M Aguirre/M Aguistin/M Aguste/M Agustin/M ah Ahab/M Aharon/M aha/S ahead ahem/S Ahmadabad Ahmad/M Ahmed/M ahoy/S Ahriman/M AI Aida/M Aidan/M aided/U aide/MS aider/M AIDS aid/ZGDRS Aigneis/M aigrette/SM Aiken/M Aila/M Ailbert/M Ailee/M Aileen/M Aile/M Ailene/M aileron/MS Ailey/M Ailina/M Aili/SM ail/LSDG ailment/SM Ailsun/M Ailyn/M Aimee/M Aime/M aimer/M Aimil/M aimlessness/MS aimless/YP aim/ZSGDR Aindrea/M Ainslee/M Ainsley/M Ainslie/M ain't Ainu/M airbag/MS airbase/S airborne airbrush/SDMG Airbus/M airbus/SM aircraft/MS aircrew/M airdrop/MS airdropped airdropping Airedale/SM Aires airfare/S airfield/MS airflow/SM airfoil/MS airframe/MS airfreight/SGD airhead/MS airily airiness/MS airing/M airlessness/S airless/P airlift/MDSG airliner/M airline/SRMZ airlock/MS airmail/DSG airman/M airmass air/MDRTZGJS airmen airpark airplane/SM airplay/S airport/MS airship/MS airsickness/SM airsick/P airspace/SM airspeed/SM airstrip/MS airtightness/M airtight/P airtime airwaves airway/SM airworthiness/SM airworthy/PTR airy/PRT Aisha/M aisle/DSGM aitch/MS ajar Ajax/M Ajay/M AK aka Akbar/M Akihito/M akimbo Akim/M akin Akita/M Akkad/M Akron/M Aksel/M AL Alabama/M Alabaman/S Alabamian/MS alabaster/MS alack/S alacrity/SM Aladdin/M Alaine/M Alain/M Alair/M Alameda/M Alamogordo/M Alamo/SM ala/MS Ala/MS Alanah/M Alana/M Aland/M Alane/M alanine/M Alan/M Alanna/M Alano/M Alanson/M Alard/M Alaric/M Alar/M alarming/Y alarmist/MS alarm/SDG Alasdair/M Alaska/M Alaskan/S alas/S Alastair/M Alasteir/M Alaster/M Alayne/M albacore/SM alba/M Alba/M Albania/M Albanian/SM Albany/M albatross/SM albedo/M Albee/M albeit Alberich/M Alberik/M Alberio/M Alberta/M Albertan/S Albertina/M Albertine/M Albert/M Alberto/M Albie/M Albigensian Albina/M albinism/SM albino/MS Albion/M Albireo/M alb/MS Albrecht/M albumen/M albumin/MS albuminous album/MNXS Albuquerque/M Alcatraz/M Alcestis/M alchemical alchemist/SM alchemy/MS Alcibiades/M Alcmena/M Alcoa/M alcoholically alcoholic/MS alcoholism/SM alcohol/MS Alcott/M alcove/MSD Alcuin/M Alcyone/M Aldan/M Aldebaran/M aldehyde/M Alden/M Alderamin/M alderman/M aldermen alder/SM alderwoman alderwomen Aldin/M Aldis/M Aldo/M Aldon/M Aldous/M Aldrich/M Aldric/M Aldridge/M Aldrin/M Aldus/M Aldwin/M aleatory Alecia/M Aleck/M Alec/M Aleda/M alee Aleece/M Aleen/M alehouse/MS Aleichem/M Alejandra/M Alejandrina/M Alejandro/M Alejoa/M Aleksandr/M Alembert/M alembic/SM ale/MVS Alena/M Alene/M aleph/M Aleppo/M Aler/M alerted/Y alertness/MS alert/STZGPRDY Alessandra/M Alessandro/M Aleta/M Alethea/M Aleutian/S Aleut/SM alewife/M alewives Alexa/M Alexander/SM Alexandra/M Alexandre/M Alexandria/M Alexandrian/S Alexandrina/M Alexandr/M Alexandro/MS Alexei/M Alexia/M Alexina/M Alexine/M Alexio/M Alexi/SM Alex/M alfalfa/MS Alfa/M Alfie/M Alfi/M Alf/M Alfonse/M Alfons/M Alfonso/M Alfonzo/M Alford/M Alfreda/M Alfred/M Alfredo/M alfresco Alfy/M algae algaecide algal alga/M algebraic algebraical/Y algebraist/M algebra/MS Algenib/M Algeria/M Algerian/MS Alger/M Algernon/M Algieba/M Algiers/M alginate/SM ALGOL Algol/M Algonquian/SM Algonquin/SM algorithmic algorithmically algorithm/MS Alhambra/M Alhena/M Alia/M alias/GSD alibi/MDSG Alica/M Alicea/M Alice/M Alicia/M Alick/M Alic/M Alida/M Alidia/M Alie/M alienable/IU alienate/SDNGX alienation/M alienist/MS alien/RDGMBS Alighieri/M alight/DSG aligned/U aligner/SM align/LASDG alignment/SAM Alika/M Alikee/M alikeness/M alike/U alimentary aliment/SDMG alimony/MS Ali/MS Alina/M Aline/M alinement's Alioth/M aliquot/S Alisa/M Alisander/M Alisha/M Alison/M Alissa/M Alistair/M Alister/M Alisun/M aliveness/MS alive/P Alix/M aliyah/M aliyahs Aliza/M Alkaid/M alkalies alkali/M alkaline alkalinity/MS alkalize/SDG alkaloid/MS alkyd/S alkyl/M Allahabad/M Allah/M Alla/M Allan/M Allard/M allay/GDS Allayne/M Alleen/M allegation/SM alleged/Y allege/SDG Allegheny/MS allegiance/SM allegiant allegoric allegoricalness/M allegorical/YP allegorist/MS allegory/SM Allegra/M allegretto/MS allegri allegro/MS allele/SM alleluia/S allemande/M Allendale/M Allende/M Allene/M Allen/M Allentown/M allergenic allergen/MS allergic allergically allergist/MS allergy/MS alleviate/SDVGNX alleviation/M alleviator/MS Alley/M alley/MS Alleyn/M alleyway/MS Allhallows alliance/MS Allianora/M Allie/M allier allies/M alligator/DMGS Alli/MS Allina/M Allin/M Allison/M Allissa/M Allister/M Allistir/M alliterate/XVNGSD alliteration/M alliterative/Y Allix/M allocable/U allocatable allocate/ACSDNGX allocated/U allocation/AMC allocative allocator/AMS allophone/MS allophonic allotment/MS allotments/A allotrope/M allotropic allots/A allot/SDL allotted/A allotter/M allotting/A allover/S allowableness/M allowable/P allowably allowance/GSDM allowed/Y allowing/E allow/SBGD allows/E alloyed/U alloy/SGMD all/S allspice/MS Allstate/M Allsun/M allude/GSD allure/GLSD allurement/SM alluring/Y allusion/MS allusiveness/MS allusive/PY alluvial/S alluvions alluvium/MS Allx/M ally/ASDG Allyce/M Ally/MS Allyn/M Allys Allyson/M alma Almach/M Almaden/M almagest Alma/M almanac/MS Almaty/M Almeda/M Almeria/M Almeta/M almightiness/M Almighty/M almighty/P Almira/M Almire/M almond/SM almoner/MS almost Al/MRY alms/A almshouse/SM almsman/M alnico Alnilam/M Alnitak/M aloe/MS aloft aloha/SM Aloin/M Aloise/M Aloisia/M aloneness/M alone/P along alongshore alongside Alon/M Alonso/M Alonzo/M aloofness/MS aloof/YP aloud Aloysia/M Aloysius/M alpaca/SM Alpert/M alphabetical/Y alphabetic/S alphabetization/SM alphabetizer/M alphabetize/SRDGZ alphabet/SGDM alpha/MS alphanumerical/Y alphanumeric/S Alphard/M Alphecca/M Alpheratz/M Alphonse/M Alphonso/M Alpine alpine/S alp/MS Alps already Alric/M alright Alsace/M Alsatian/MS also Alsop/M Alston/M Altaic/M Altai/M Altair/M Alta/M altar/MS altarpiece/SM alterable/UI alteration/MS altercate/NX altercation/M altered/U alternate/SDVGNYX alternation/M alternativeness/M alternative/YMSP alternator/MS alter/RDZBG Althea/M although altimeter/SM Altiplano/M altitude/SM altogether/S Alton/M alto/SM Altos/M altruism/SM altruistic altruistically altruist/SM alt/RZS ALU Aludra/M Aluin/M Aluino/M alumina/SM aluminum/MS alumnae alumna/M alumni alumnus/MS alum/SM alundum Alva/M Alvan/M Alvarado/M Alvarez/M Alvaro/M alveolar/Y alveoli alveolus/M Alvera/M Alverta/M Alvie/M Alvina/M Alvinia/M Alvin/M Alvira/M Alvis/M Alvy/M alway/S Alwin/M Alwyn/M Alyce/M Alyda/M Alyosha/M Alysa/M Alyse/M Alysia/M Alys/M Alyson/M Alyss Alyssa/M Alzheimer/M AM AMA Amabelle/M Amabel/M Amadeus/M Amado/M amain Amalea/M Amalee/M Amaleta/M amalgamate/VNGXSD amalgamation/M amalgam/MS Amalia/M Amalie/M Amalita/M Amalle/M Amanda/M Amandie/M Amandi/M Amandy/M amanuenses amanuensis/M Amara/M amaranth/M amaranths amaretto/S Amargo/M Amarillo/M amaryllis/MS am/AS amasser/M amass/GRSD Amata/M amateurishness/MS amateurish/YP amateurism/MS amateur/SM Amati/M amatory amazed/Y amaze/LDSRGZ amazement/MS amazing/Y amazonian Amazonian amazon/MS Amazon/SM ambassadorial ambassador/MS ambassadorship/MS ambassadress/SM ambergris/SM Amberly/M amber/MS Amber/YM ambiance/MS ambidexterity/MS ambidextrous/Y ambience's ambient/S ambiguity/MS ambiguously/U ambiguousness/M ambiguous/YP ambition/GMDS ambitiousness/MS ambitious/PY ambit/M ambivalence/SM ambivalent/Y amble/GZDSR Amble/M ambler/M ambrose Ambrose/M ambrosial/Y ambrosia/SM Ambrosi/M Ambrosio/M Ambrosius/M Ambros/M ambulance/MS ambulant/S ambulate/DSNGX ambulation/M ambulatory/S Ambur/M ambuscade/MGSRD ambuscader/M ambusher/M ambush/MZRSDG Amby/M Amdahl/M ameba's Amelia/M Amelie/M Amelina/M Ameline/M ameliorate/XVGNSD amelioration/M Amelita/M amenability/SM amenably amended/U amender/M amendment/SM amen/DRGTSB amend/SBRDGL amends/M Amenhotep/M amenity/MS amenorrhea/M Amerada/M Amerasian/S amercement/MS amerce/SDLG Americana/M Americanism/SM Americanization/SM americanized Americanize/SDG American/MS America/SM americium/MS Amerigo/M Amerindian/MS Amerind/MS Amer/M Amery/M Ameslan/M Ame/SM amethystine amethyst/MS Amharic/M Amherst/M amiability/MS amiableness/M amiable/RPT amiably amicability/SM amicableness/M amicable/P amicably amide/SM amid/S amidships amidst Amie/M Amiga/M amigo/MS Amii/M Amil/M Ami/M amines aminobenzoic amino/M amir's Amish amiss Amitie/M Amity/M amity/SM Ammamaria/M Amman/M Ammerman/M ammeter/MS ammo/MS ammoniac ammonia/MS ammonium/M Am/MR ammunition/MS amnesiac/MS amnesia/SM amnesic/S amnesty/GMSD amniocenteses amniocentesis/M amnion/SM amniotic Amoco/M amoeba/SM amoebic amoeboid amok/MS among amongst Amontillado/M amontillado/MS amorality/MS amoral/Y amorousness/SM amorous/PY amorphousness/MS amorphous/PY amortization/SUM amortized/U amortize/SDG Amory/M Amos amount/SMRDZG amour/MS Amparo/M amperage/SM Ampere/M ampere/MS ampersand/MS Ampex/M amphetamine/MS amphibian/SM amphibiousness/M amphibious/PY amphibology/M amphitheater/SM amphorae amphora/M ampleness/M ample/PTR amplification/M amplifier/M amplify/DRSXGNZ amplitude/MS ampoule's amp/SGMDY ampule/SM amputate/DSNGX amputation/M amputee/SM Amritsar/M ams Amsterdam/M amt Amtrak/M amuck's amulet/SM Amundsen/M Amur/M amused/Y amuse/LDSRGVZ amusement/SM amuser/M amusingness/M amusing/YP Amway/M Amye/M amylase/MS amyl/M Amy/M Anabal/M Anabaptist/SM Anabella/M Anabelle/M Anabel/M anabolic anabolism/MS anachronism/SM anachronistic anachronistically Anacin/M anaconda/MS Anacreon/M anaerobe/SM anaerobic anaerobically anaglyph/M anagrammatic anagrammatically anagrammed anagramming anagram/MS Anaheim/M Analects/M analgesia/MS analgesic/S Analiese/M Analise/M Anallese/M Anallise/M analogical/Y analogize/SDG analogousness/MS analogous/YP analog/SM analogue/SM analogy/MS anal/Y analysand/MS analyses analysis/AM analyst/SM analytical/Y analyticity/S analytic/S analytics/M analyzable/U analyze/DRSZGA analyzed/U analyzer/M Ana/M anamorphic Ananias/M anapaest's anapestic/S anapest/SM anaphora/M anaphoric anaphorically anaplasmosis/M anarchic anarchical/Y anarchism/MS anarchistic anarchist/MS anarchy/MS Anastasia/M Anastasie/M Anastassia/M anastigmatic anastomoses anastomosis/M anastomotic anathema/MS anathematize/GSD Anatola/M Anatole/M Anatolia/M Anatolian Anatollo/M Anatol/M anatomic anatomical/YS anatomist/MS anatomize/GSD anatomy/MS Anaxagoras/M Ancell/M ancestor/SMDG ancestral/Y ancestress/SM ancestry/SM Anchorage/M anchorage/SM anchored/U anchorite/MS anchoritism/M anchorman/M anchormen anchorpeople anchorperson/S anchor/SGDM anchorwoman anchorwomen anchovy/MS ancientness/MS ancient/SRYTP ancillary/S an/CS Andalusia/M Andalusian Andaman andante/S and/DZGS Andean/M Andeee/M Andee/M Anderea/M Andersen/M Anders/N Anderson/M Andes Andie/M Andi/M andiron/MS Andonis/M Andorra/M Andover/M Andra/SM Andrea/MS Andreana/M Andree/M Andrei/M Andrej/M Andre/SM Andrew/MS Andrey/M Andria/M Andriana/M Andriette/M Andris androgenic androgen/SM androgynous androgyny/SM android/MS Andromache/M Andromeda/M Andropov/M Andros/M Andrus/M Andy/M anecdotal/Y anecdote/SM anechoic anemia/SM anemically anemic/S anemometer/MS anemometry/M anemone/SM anent aneroid Anestassia/M anesthesia/MS anesthesiologist/MS anesthesiology/SM anesthetically anesthetic/SM anesthetist/MS anesthetization/SM anesthetizer/M anesthetize/ZSRDG Anet/M Anetta/M Anette/M Anett/M aneurysm/MS anew Angara/M Angela/M Angeleno/SM Angele/SM angelfish/SM Angelia/M angelic angelical/Y Angelica/M angelica/MS Angelico/M Angelika/M Angeli/M Angelina/M Angeline/M Angelique/M Angelita/M Angelle/M Angel/M angel/MDSG Angelo/M Angelou/M Ange/M anger/GDMS Angevin/M Angie/M Angil/M angina/MS angiography angioplasty/S angiosperm/MS Angkor/M angle/GMZDSRJ angler/M Angles angleworm/MS Anglia/M Anglicanism/MS Anglican/MS Anglicism/SM Anglicization/MS anglicize/SDG Anglicize/SDG angling/M Anglo/MS Anglophile/SM Anglophilia/M Anglophobe/MS Anglophobia/M Angola/M Angolan/S angora/MS Angora/MS angrily angriness/M angry/RTP angst/MS Ångström/M angstrom/MS Anguilla/M anguish/DSMG angularity/MS angular/Y Angus/M Angy/M Anheuser/M anhydride/M anhydrite/M anhydrous/Y Aniakchak/M Ania/M Anibal/M Anica/M aniline/SM animadversion/SM animadvert/DSG animalcule/MS animal/MYPS animated/A animatedly animately/I animateness/MI animates/A animate/YNGXDSP animating/A animation/AMS animator/SM animism/SM animistic animist/S animized animosity/MS animus/SM anionic/S anion/MS aniseed/MS aniseikonic anise/MS anisette/SM anisotropic anisotropy/MS Anissa/M Anita/M Anitra/M Anjanette/M Anjela/M Ankara/M ankh/M ankhs anklebone/SM ankle/GMDS anklet/MS Annabal/M Annabela/M Annabella/M Annabelle/M Annabell/M Annabel/M Annadiana/M Annadiane/M Annalee/M Annaliese/M Annalise/M annalist/MS annal/MNS Anna/M Annamaria/M Annamarie/M Annapolis/M Annapurna/M anneal/DRSZG annealer/M Annecorinne/M annelid/MS Anneliese/M Annelise/M Anne/M Annemarie/M Annetta/M Annette/M annexation/SM annexe/M annex/GSD Annice/M Annie/M annihilate/XSDVGN annihilation/M annihilator/MS Anni/MS Annissa/M anniversary/MS Ann/M Annmaria/M Annmarie/M Annnora/M Annora/M annotated/U annotate/VNGXSD annotation/M annotator/MS announced/U announcement/SM announcer/M announce/ZGLRSD annoyance/MS annoyer/M annoying/Y annoy/ZGSRD annualized annual/YS annuitant/MS annuity/MS annular/YS annuli annulled annulling annulment/MS annul/SL annulus/M annum annunciate/XNGSD annunciation/M Annunciation/S annunciator/SM Anny/M anode/SM anodic anodize/GDS anodyne/SM anoint/DRLGS anointer/M anointment/SM anomalousness/M anomalous/YP anomaly/MS anomic anomie/M anon/S anonymity/MS anonymousness/M anonymous/YP anopheles/M anorak/SM anorectic/S anorexia/SM anorexic/S another/M Anouilh/M Ansell/M Ansel/M Anselma/M Anselm/M Anselmo/M Anshan/M ANSI/M Ansley/M ans/M Anson/M Anstice/M answerable/U answered/U answerer/M answer/MZGBSDR antacid/MS Antaeus/M antagonism/MS antagonistic antagonistically antagonist/MS antagonized/U antagonize/GZRSD antagonizing/U Antananarivo/M antarctic Antarctica/M Antarctic/M Antares anteater/MS antebellum antecedence/MS antecedent/SMY antechamber/SM antedate/GDS antediluvian/S anteing antelope/MS ante/MS antenatal antennae antenna/MS anterior/SY anteroom/SM ant/GSMD Anthea/M Anthe/M anthem/MGDS anther/MS Anthia/M Anthiathia/M anthill/S anthologist/MS anthologize/GDS anthology/SM Anthony/M anthraces anthracite/MS anthrax/M anthropic anthropocentric anthropogenic anthropoid/S anthropological/Y anthropologist/MS anthropology/SM anthropometric/S anthropometry/M anthropomorphic anthropomorphically anthropomorphism/SM anthropomorphizing anthropomorphous antiabortion antiabortionist/S antiaircraft antibacterial/S antibiotic/SM antibody/MS anticancer Antichrist/MS anticipated/U anticipate/XVGNSD anticipation/M anticipative/Y anticipatory anticked anticking anticlerical/S anticlimactic anticlimactically anticlimax/SM anticline/SM anticlockwise antic/MS anticoagulant/S anticoagulation/M anticommunism/SM anticommunist/SM anticompetitive anticyclone/MS anticyclonic antidemocratic antidepressant/SM antidisestablishmentarianism/M antidote/DSMG Antietam/M antifascist/SM antiformant antifreeze/SM antifundamentalist/M antigenic antigenicity/SM antigen/MS antigone Antigone/M Antigua/M antiheroes antihero/M antihistamine/MS antihistorical antiknock/MS antilabor Antillean Antilles antilogarithm/SM antilogs antimacassar/SM antimalarial/S antimatter/SM antimicrobial/S antimissile/S antimony/SM anting/M Antin/M antinomian antinomy/M antinuclear Antioch/M antioxidant/MS antiparticle/SM Antipas/M antipasti antipasto/MS antipathetic antipathy/SM antipersonnel antiperspirant/MS antiphonal/SY antiphon/SM antipodal/S antipodean/S antipode/MS Antipodes antipollution/S antipoverty antiquarianism/MS antiquarian/MS antiquary/SM antiquate/NGSD antiquation/M antique/MGDS antiquity/SM antiredeposition antiresonance/M antiresonator anti/S antisemitic antisemitism/M antisepses antisepsis/M antiseptically antiseptic/S antiserum/SM antislavery/S antisocial/Y antispasmodic/S antisubmarine antisymmetric antisymmetry antitank antitheses antithesis/M antithetic antithetical/Y antithyroid antitoxin/MS antitrust/MR antivenin/MS antiviral/S antivivisectionist/S antiwar antler/SDM Antofagasta/M Antoine/M Antoinette/M Antonella/M Antone/M Antonetta/M Antonia/M Antonie/M Antonietta/M Antoni/M Antonina/M Antonin/M Antonino/M Antoninus/M Antonio/M Antonius/M Anton/MS Antonovics/M Antony/M antonymous antonym/SM antral antsy/RT Antwan/M Antwerp/M Anubis/M anus/SM anvil/MDSG anxiety/MS anxiousness/SM anxious/PY any Anya/M anybody/S anyhow Any/M anymore anyone/MS anyplace anything/S anytime anyway/S anywhere/S anywise AOL/M aorta/MS aortic AP apace apache/MS Apache/MS Apalachicola/M apartheid/SM apart/LP apartment/MS apartness/M apathetic apathetically apathy/SM apatite/MS APB aped/A apelike ape/MDRSG Apennines aper/A aperiodic aperiodically aperiodicity/M aperitif/S aperture/MDS apex/MS aphasia/SM aphasic/S aphelia aphelion/SM aphid/MS aphonic aphorism/MS aphoristic aphoristically aphrodisiac/SM Aphrodite/M Apia/M apiarist/SM apiary/SM apical/YS apices's apiece apishness/M apish/YP aplenty aplomb/SM APO Apocalypse/M apocalypse/MS apocalyptic apocryphalness/M apocryphal/YP apocrypha/M Apocrypha/M apogee/MS apolar apolitical/Y Apollinaire/M Apollonian Apollo/SM apologetically/U apologetic/S apologetics/M apologia/SM apologist/MS apologize/GZSRD apologizer/M apologizes/A apologizing/U apology/MS apoplectic apoplexy/SM apostasy/SM apostate/SM apostatize/DSG apostleship/SM apostle/SM apostolic apostrophe/SM apostrophized apothecary/MS apothegm/MS apotheoses apotheosis/M apotheosized apotheosizes apotheosizing Appalachia/M Appalachian/MS appalling/Y appall/SDG Appaloosa/MS appaloosa/S appanage/M apparatus/SM apparel/SGMD apparency apparently/I apparentness/M apparent/U apparition/SM appealer/M appealing/UY appeal/SGMDRZ appear/AEGDS appearance/AMES appearer/S appease/DSRGZL appeased/U appeasement/MS appeaser/M appellant/MS appellate/VNX appellation/M appellative/MY appendage/MS appendectomy/SM appendices appendicitis/SM appendix/SM append/SGZDR appertain/DSG appetite/MVS appetizer/SM appetizing/YU Appia/M Appian/M applauder/M applaud/ZGSDR applause/MS applecart/M applejack/MS Apple/M apple/MS applesauce/SM Appleseed/M Appleton/M applet/S appliance/SM applicabilities applicability/IM applicable/I applicably applicant/MS applicate/V application/MA applicative/Y applicator/MS applier/SM appliquéd appliqué/MSG apply/AGSDXN appointee/SM appoint/ELSADG appointer/MS appointive appointment/ASEM Appolonia/M Appomattox/M apportion/GADLS apportionment/SAM appose/SDG appositeness/MS apposite/XYNVP apposition/M appositive/SY appraisal/SAM appraised/A appraisees appraiser/M appraises/A appraise/ZGDRS appraising/Y appreciable/I appreciably/I appreciated/U appreciate/XDSNGV appreciation/M appreciativeness/MI appreciative/PIY appreciator/MS appreciatory apprehend/DRSG apprehender/M apprehensible apprehension/SM apprehensiveness/SM apprehensive/YP apprentice/DSGM apprenticeship/SM apprise/DSG apprizer/SM apprizingly apprizings approachability/UM approachable/UI approach/BRSDZG approacher/M approbate/NX approbation/EMS appropriable appropriated/U appropriately/I appropriateness/SMI appropriate/XDSGNVYTP appropriation/M appropriator/SM approval/ESM approve/DSREG approved/U approver's/E approver/SM approving/YE approx approximate/XGNVYDS approximation/M approximative/Y appurtenance/MS appurtenant/S APR apricot/MS Aprilette/M April/MS Apr/M apron/SDMG apropos apse/MS apsis/M apter aptest aptitude/SM aptness/SMI aptness's/U apt/UPYI Apuleius/M aquaculture/MS aqualung/SM aquamarine/SM aquanaut/SM aquaplane/GSDM aquarium/MS Aquarius/MS aqua/SM aquatically aquatic/S aquavit/SM aqueduct/MS aqueous/Y aquiculture's aquifer/SM Aquila/M aquiline Aquinas/M Aquino/M Aquitaine/M AR Arabela/M Arabele/M Arabella/M Arabelle/M Arabel/M arabesque/SM Arabia/M Arabian/MS Arabic/M arability/MS Arabist/MS arable/S Arab/MS Araby/M Araceli/M arachnid/MS arachnoid/M arachnophobia Arafat/M Araguaya/M Araldo/M Aral/M Ara/M Aramaic/M Aramco/M Arapahoes Arapahoe's Arapaho/MS Ararat/M Araucanian/M Arawakan/M Arawak/M arbiter/MS arbitrage/GMZRSD arbitrager/M arbitrageur/S arbitrament/MS arbitrarily arbitrariness/MS arbitrary/P arbitrate/SDXVNG arbitration/M arbitrator/SM arbor/DMS arboreal/Y arbores arboretum/MS arborvitae/MS arbutus/SM ARC arcade/SDMG Arcadia/M Arcadian arcana/M arcane/P arc/DSGM archaeological/Y archaeologist/SM archaically archaic/P Archaimbaud/M archaism/SM archaist/MS archaize/GDRSZ archaizer/M Archambault/M archangel/SM archbishopric/SM archbishop/SM archdeacon/MS archdiocesan archdiocese/SM archduchess/MS archduke/MS Archean archenemy/SM archeologist's archeology/MS archer/M Archer/M archery/MS archetypal archetype/SM archfiend/SM archfool Archibald/M Archibaldo/M Archibold/M Archie/M archiepiscopal Archimedes/M arching/M archipelago/SM architect/MS architectonic/S architectonics/M architectural/Y architecture/SM architrave/MS archival archive/DRSGMZ archived/U archivist/MS Arch/MR archness/MS arch/PGVZTMYDSR archway/SM Archy/M arclike ARCO/M arcsine arctangent Arctic/M arctic/S Arcturus/M Ardabil Arda/MH Ardath/M Ardeen/M Ardelia/M Ardelis/M Ardella/M Ardelle/M ardency/M Ardene/M Ardenia/M Arden/M ardent/Y Ardine/M Ardisj/M Ardis/M Ardith/M ardor/SM Ardra/M arduousness/SM arduous/YP Ardyce/M Ardys Ardyth/M areal area/SM areawide are/BS Arel/M arenaceous arena/SM aren't Arequipa/M Ares Aretha/M Argentina/M Argentinean/S Argentine/SM Argentinian/S argent/MS arginine/MS Argonaut/MS argonaut/S argon/MS Argonne/M Argo/SM argosy/SM argot/SM arguable/IU arguably/IU argue/DSRGZ arguer/M argumentation/SM argumentativeness/MS argumentative/YP argument/SM Argus/M argyle/S Ariadne/M Ariana/M Arianism/M Arianist/SM aria/SM Aridatha/M aridity/SM aridness/M arid/TYRP Ariela/M Ariella/M Arielle/M Ariel/M Arie/SM Aries/S aright Ari/M Arin/M Ario/M Ariosto/M arise/GJSR arisen Aristarchus/M Aristides aristocracy/SM aristocratic aristocratically aristocrat/MS Aristophanes/M Aristotelean Aristotelian/M Aristotle/M arithmetical/Y arithmetician/SM arithmetic/MS arithmetize/SD Arius/M Ariz/M Arizona/M Arizonan/S Arizonian/S Arjuna/M Arkansan/MS Arkansas/M Arkhangelsk/M Ark/M ark/MS Arkwright/M Arlana/M Arlan/M Arlee/M Arleen/M Arlena/M Arlene/M Arlen/M Arleta/M Arlette/M Arley/M Arleyne/M Arlie/M Arliene/M Arlina/M Arlinda/M Arline/M Arlington/M Arlin/M Arluene/M Arly/M Arlyne/M Arlyn/M Armada/M armada/SM armadillo/MS Armageddon/SM Armagnac/M armament/EAS armament's/E Armand/M Armando/M Arman/M arm/ASEDG Armata/M armature/MGSD armband/SM armchair/MS Armco/M armed/U Armenia/M Armenian/MS armer/MES armful/SM armhole/MS arming/M Arminius/M Armin/M armistice/MS armless armlet/SM armload/M Armonk/M armored/U armorer/M armorial/S armory/DSM armor/ZRDMGS Armour/M armpit/MS armrest/MS arm's Armstrong/M Ar/MY army/SM Arnaldo/M Arneb/M Arne/M Arney/M Arnhem/M Arnie/M Arni/M Arnold/M Arnoldo/M Arno/M Arnuad/M Arnulfo/M Arny/M aroma/SM aromatherapist/S aromatherapy/S aromatically aromaticity/M aromaticness/M aromatic/SP Aron/M arose around arousal/MS aroused/U arouse/GSD ARPA/M Arpanet/M ARPANET/M arpeggio/SM arrack/M Arragon/M arraignment/MS arraign/SDGL arrangeable/A arranged/EA arrangement/AMSE arranger/M arranges/EA arrange/ZDSRLG arranging/EA arrant/Y arras/SM arrayer array/ESGMD arrear/SM arrest/ADSG arrestee/MS arrester/MS arresting/Y arrestor/MS Arrhenius/M arrhythmia/SM arrhythmic arrhythmical Arri/M arrival/MS arriver/M arrive/SRDG arrogance/MS arrogant/Y arrogate/XNGDS arrogation/M Arron/M arrowhead/SM arrowroot/MS arrow/SDMG arroyo/MS arr/TV arsenal/MS arsenate/M arsenic/MS arsenide/M arsine/MS arsonist/MS arson/SM Artair/M Artaxerxes/M artefact's Arte/M Artemas Artemis/M Artemus/M arterial/SY arteriolar arteriole/SM arterioscleroses arteriosclerosis/M artery/SM artesian artfulness/SM artful/YP Arther/M arthritic/S arthritides arthritis/M arthrogram/MS arthropod/SM arthroscope/S arthroscopic Arthurian Arthur/M artichoke/SM article/GMDS articulable/I articular articulated/EU articulately/I articulateness/IMS articulates/I articulate/VGNYXPSD articulation/M articulator/SM articulatory Artie/M artifact/MS artificer/M artifice/ZRSM artificiality/MS artificialness/M artificial/PY artillerist artilleryman/M artillerymen artillery/SM artiness/MS artisan/SM artiste/SM artistically/I artistic/I artist/MS artistry/SM artlessness/MS artless/YP Art/M art/SM artsy/RT Artur/M Arturo/M Artus/M artwork/MS Arty/M arty/TPR Aruba/M arum/MS Arvie/M Arvin/M Arv/M Arvy/M Aryan/MS Aryn/M as As A's Asa/M Asama/M asap ASAP asbestos/MS Ascella/M ascend/ADGS ascendancy/MS ascendant/SY ascender/SM Ascension/M ascension/SM ascent/SM ascertain/DSBLG ascertainment/MS ascetically asceticism/MS ascetic/SM ASCII ascot/MS ascribe/GSDB ascription/MS ascriptive Ase/M aseptically aseptic/S asexuality/MS asexual/Y Asgard/M ashame/D ashamed/UY Ashanti/M Ashbey/M Ashby/M ashcan/SM Ashely/M Asher/M Asheville/M Ashia/M Ashien/M Ashil/M Ashkenazim Ashkhabad/M Ashla/M Ashland/M Ashlan/M ashlar/GSDM Ashlee/M Ashleigh/M Ashlen/M Ashley/M Ashlie/M Ashli/M Ashlin/M Ashly/M ashman/M ash/MNDRSG Ashmolean/M Ash/MRY ashore ashram/SM Ashton/M ashtray/MS Ashurbanipal/M ashy/RT Asia/M Asian/MS Asiatic/SM aside/S Asilomar/M Asimov asinine/Y asininity/MS askance ask/DRZGS asked/U asker/M askew/P ASL aslant asleep Asmara/M asocial/S Asoka/M asparagus/MS aspartame/S ASPCA aspect/SM Aspell/M aspen/M Aspen/M asperity/SM asper/M aspersion/SM asphalt/MDRSG asphodel/MS asphyxia/MS asphyxiate/GNXSD asphyxiation/M aspic/MS Aspidiske/M aspidistra/MS aspirant/MS aspirate/NGDSX aspirational aspiration/M aspirator/SM aspire/GSRD aspirer/M aspirin/SM asplenium asp/MNRXS Asquith/M Assad/M assailable/U assailant/SM assail/BGDS Assamese/M Assam/M assassinate/DSGNX assassination/M assassin/MS assaulter/M assaultive/YP assault/SGVMDR assayer/M assay/SZGRD assemblage/MS assemble/ADSREG assembled/U assembler/EMS assemblies/A assembly/EAM assemblyman/M assemblymen Assembly/MS assemblywoman assemblywomen assent/SGMRD assert/ADGS asserter/MS assertional assertion/AMS assertiveness/SM assertive/PY assess/BLSDG assessed/A assesses/A assessment/SAM assessor/MS asset/SM asseverate/XSDNG asseveration/M asshole/MS! assiduity/SM assiduousness/SM assiduous/PY assign/ALBSGD assignation/MS assigned/U assignee/MS assigner/MS assignment/MAS assignor/MS assigns/CU assimilate/VNGXSD assimilationist/M assimilation/M Assisi/M assistance/SM assistantship/SM assistant/SM assisted/U assister/M assist/RDGS assize/MGSD ass/MNS assn assoc associable associated/U associate/SDEXNG associateship associational association/ME associative/Y associativity/S associator/MS assonance/SM assonant/S assorter/M assort/LRDSG assortment/SM asst assuaged/U assuage/SDG assumability assumer/M assume/SRDBJG assuming/UA assumption/SM assumptive assurance/AMS assure/AGSD assuredness/M assured/PYS assurer/SM assuring/YA Assyria/M Assyrian/SM Assyriology/M Astaire/SM Astarte/M astatine/MS aster/ESM asteria asterisked/U asterisk/SGMD astern asteroidal asteroid/SM asthma/MS asthmatic/S astigmatic/S astigmatism/SM astir astonish/GSDL astonishing/Y astonishment/SM Aston/M Astoria/M Astor/M astounding/Y astound/SDG astraddle Astrakhan/M astrakhan/SM astral/SY Astra/M astray astride Astrid/M astringency/SM astringent/YS Astrix/M astrolabe/MS astrologer/MS astrological/Y astrologist/M astrology/SM astronautical astronautic/S astronautics/M astronaut/SM astronomer/MS astronomic astronomical/Y astronomy/SM astrophysical astrophysicist/SM astrophysics/M Astroturf/M AstroTurf/S Asturias/M astuteness/MS astute/RTYP Asunción/M asunder Aswan/M asylum/MS asymmetric asymmetrical/Y asymmetry/MS asymptomatic asymptomatically asymptote/MS asymptotically asymptotic/Y asynchronism/M asynchronous/Y asynchrony at Atacama/M Atahualpa/M Atalanta/M Atari/M Atatürk/M atavism/MS atavistic atavist/MS ataxia/MS ataxic/S atelier/SM atemporal ate/S Athabasca/M Athabascan's Athabaskan/MS Athabaska's atheism/SM atheistic atheist/SM Athena/M Athene/M Athenian/SM Athens/M atheroscleroses atherosclerosis/M athirst athlete/MS athletically athleticism/M athletic/S athletics/M athwart atilt Atkins/M Atkinson/M Atlanta/M Atlante/MS atlantes Atlantic/M Atlantis/M atlas/SM Atlas/SM At/M Atman ATM/M atmosphere/DSM atmospherically atmospheric/S atoll/MS atomically atomicity/M atomic/S atomics/M atomistic atomization/SM atomize/GZDRS atomizer/M atom/SM atonality/MS atonal/Y atone/LDSG atonement/SM atop ATP Atreus/M atria atrial Atria/M atrium/M atrociousness/SM atrocious/YP atrocity/SM atrophic atrophy/DSGM atropine/SM Atropos/M Ats attach/BLGZMDRS attached/UA attacher/M attaché/S attachment/ASM attacker/M attack/GBZSDR attainabilities attainability/UM attainableness/M attainable/U attainably/U attain/AGSD attainder/MS attained/U attainer/MS attainment/MS attar/MS attempt/ADSG attempter/MS attendance/MS attendant/SM attended/U attendee/SM attender/M attend/SGZDR attentional attentionality attention/IMS attentiveness/IMS attentive/YIP attenuated/U attenuate/SDXGN attenuation/M attenuator/MS attestation/SM attested/U attester/M attest/GSDR Attic Attica/M attic/MS Attila/M attire/SDG attitude/MS attitudinal/Y attitudinize/SDG Attlee/M attn Attn attorney/SM attractant/SM attract/BSDGV attraction/MS attractivenesses attractiveness/UM attractive/UYP attractor/MS attributable/U attribute/BVNGRSDX attributed/U attributer/M attributional attribution/M attributive/SY attrition/MS Attucks attune/SDG atty ATV/S atwitter Atwood/M atypical/Y Aube/M Auberge/M aubergine/MS Auberon/M Auberta/M Aubert/M Aubine/M Aubree/M Aubrette/M Aubrey/M Aubrie/M Aubry/M auburn/SM Auckland/M auctioneer/SDMG auction/MDSG audaciousness/SM audacious/PY audacity/MS Auden/M audibility/MSI audible/I audibles audibly/I Audie/M audience/MS Audi/M audiogram/SM audiological audiologist/MS audiology/SM audiometer/MS audiometric audiometry/M audiophile/SM audio/SM audiotape/S audiovisual/S audited/U audition/MDSG auditorium/MS auditor/MS auditory/S audit/SMDVG Audra/M Audre/M Audrey/M Audrie/M Audrye/M Audry/M Audubon/M Audy/M Auerbach/M Augean auger/SM aught/S Augie/M Aug/M augmentation/SM augmentative/S augment/DRZGS augmenter/M augur/GDMS augury/SM Augusta/M Augustan/S Auguste/M Augustina/M Augustine/M Augustinian/S Augustin/M augustness/SM Augusto/M August/SM august/STPYR Augustus/M Augy/M auk/MS Au/M Aundrea/M auntie/MS aunt/MYS aunty's aural/Y Aura/M aura/SM Aurea/M Aurelea/M Aurelia/M Aurelie/M Aurelio/M Aurelius/M Aurel/M aureole/GMSD aureomycin Aureomycin/M Auria/M auric auricle/SM auricular Aurie/M Auriga/M Aurilia/M Aurlie/M Auroora/M auroral Aurora/M aurora/SM Aurore/M Aurthur/M Auschwitz/M auscultate/XDSNG auscultation/M auspice/SM auspicious/IPY auspiciousnesses auspiciousness/IM Aussie/MS Austen/M austereness/M austere/TYRP austerity/SM Austina/M Austine/M Austin/SM austral Australasia/M Australasian/S australes Australia/M Australian/MS Australis/M australites Australoid Australopithecus/M Austria/M Austrian/SM Austronesian authentically authenticated/U authenticate/GNDSX authentication/M authenticator/MS authenticity/MS authentic/UI author/DMGS authoress/S authorial authoritarianism/MS authoritarian/S authoritativeness/SM authoritative/PY authority/SM authorization/MAS authorize/AGDS authorized/U authorizer/SM authorizes/U authorship/MS autism/MS autistic/S autobahn/MS autobiographer/MS autobiographic autobiographical/Y autobiography/MS autoclave/SDGM autocollimator/M autocorrelate/GNSDX autocorrelation/M autocracy/SM autocratic autocratically autocrat/SM autodial/R autodidact/MS autofluorescence autograph/MDG autographs autoignition/M autoimmune autoimmunity/S autoloader automaker/S automata's automate/NGDSX automatically automatic/S automation/M automatism/SM automatize/DSG automaton/SM automobile/GDSM automorphism/SM automotive autonavigator/SM autonomic/S autonomous/Y autonomy/MS autopilot/SM autopsy/MDSG autoregressive autorepeat/GS auto/SDMG autostart autosuggestibility/M autotransformer/M autoworker/S autumnal/Y Autumn/M autumn/MS aux auxiliary/S auxin/MS AV availability/USM availableness/M available/U availably avail/BSZGRD availing/U avalanche/MGSD Avalon/M Ava/M avant avarice/SM avariciousness/M avaricious/PY avast/S avatar/MS avaunt/S avdp Aveline/M Ave/MS avenged/U avenger/M avenge/ZGSRD Aventine/M Aventino/M avenue/MS average/DSPGYM Averell/M Averill/M Averil/M Avernus/M averred averrer averring Averroes/M averseness/M averse/YNXP aversion/M avers/V avert/GSD Averyl/M Avery/M ave/S aves/C Avesta/M avg avian/S aviary/SM aviate/NX aviation/M aviator/SM aviatrices aviatrix/SM Avicenna/M Avictor/M avidity/MS avid/TPYR Avie/M Avigdor/M Avignon/M Avila/M avionic/S avionics/M Avior/M Avis avitaminoses avitaminosis/M Avivah/M Aviva/M Aviv/M avocado/MS avocational avocation/SM Avogadro/M avoidable/U avoidably/U avoidance/SM avoider/M avoid/ZRDBGS avoirdupois/MS Avon/M avouch/GDS avowal/EMS avowed/Y avower/M avow/GEDS Avram/M Avril/M Avrit/M Avrom/M avuncular av/ZR AWACS await/SDG awake/GS awakened/U awakener/M awakening/S awaken/SADG awarder/M award/RDSZG awareness/MSU aware/TRP awash away/PS aweigh awe/SM awesomeness/SM awesome/PY awestruck awfuller awfullest awfulness/SM awful/YP aw/GD awhile/S awkwardness/MS awkward/PRYT awl/MS awning/DM awn/MDJGS awoke awoken AWOL awry/RT ax/DRSZGM axehead/S Axel/M Axe/M axeman axial/Y axillary axiological/Y axiology/M axiomatically axiomatic/S axiomatization/MS axiomatize/GDS axiom/SM axion/SM axis/SM axle/MS axletree/MS Ax/M axolotl/SM axon/SM ayah/M ayahs Ayala/M ayatollah ayatollahs aye/MZRS Ayers Aylmar/M Aylmer/M Aymara/M Aymer/M Ayn/M AZ azalea/SM Azania/M Azazel/M Azerbaijan/M azimuthal/Y azimuth/M azimuths Azores Azov/M AZT Aztecan Aztec/MS azure/MS BA Baal/SM baa/SDG Babara/M Babar's Babbage/M Babbette/M Babbie/M babbitt/GDS Babbitt/M babbler/M babble/RSDGZ Babb/M Babcock/M Babel/MS babel/S babe/SM Babette/M Babita/M Babka/M baboon/MS Bab/SM babushka/MS babyhood/MS babyish Babylonia/M Babylonian/SM Babylon/MS babysat babysit/S babysitter/S babysitting baby/TDSRMG Bacall/M Bacardi/M baccalaureate/MS baccarat/SM bacchanalia Bacchanalia/M bacchanalian/S bacchanal/SM Bacchic Bacchus/M bachelorhood/SM bachelor/SM Bach/M bacillary bacilli bacillus/MS backache/SM backarrow backbencher/M backbench/ZR backbiter/M backbite/S backbitten backbit/ZGJR backboard/SM backbone/SM backbreaking backchaining backcloth/M backdate/GDS backdrop/MS backdropped backdropping backed/U backer/M backfield/SM backfill/SDG backfire/GDS backgammon/MS background/SDRMZG back/GZDRMSJ backhanded/Y backhander/M backhand/RDMSZG backhoe/S backing/M backlash/GRSDM backless backlogged backlogging backlog/MS backorder backpacker/M backpack/ZGSMRD backpedal/DGS backplane/MS backplate/SM backrest/MS backscatter/SMDG backseat/S backside/SM backslapper/MS backslapping/M backslash/DSG backslider/M backslide/S backslid/RZG backspace/GSD backspin/SM backstabber/M backstabbing backstage backstair/S backstitch/GDSM backstop/MS backstopped backstopping backstreet/M backstretch/SM backstroke/GMDS backtalk/S backtrack/SDRGZ backup/SM Backus/M backwardness/MS backward/YSP backwash/SDMG backwater/SM backwood/S backwoodsman/M backwoodsmen backyard/MS baconer/M Bacon/M bacon/SRM bacterial/Y bacteria/MS bactericidal bactericide/SM bacteriologic bacteriological bacteriologist/MS bacteriology/SM bacterium/M Bactria/M badder baddest baddie/MS bade Baden/M badge/DSRGMZ badger/DMG badinage/DSMG badland/S Badlands/M badman/M badmen badminton/MS badmouth/DG badmouths badness/SM bad/PSNY Baedeker/SM Baez/M Baffin/M bafflement/MS baffler/M baffle/RSDGZL baffling/Y bagatelle/MS bagel/SM bagful/MS baggageman baggagemen baggage/SM bagged/M bagger/SM baggily bagginess/MS bagging/M baggy/PRST Baghdad/M bagpiper/M bagpipe/RSMZ Bagrodia/MS bag/SM baguette/SM Baguio/M bah Baha'i Bahama/MS Bahamanian/S Bahamian/MS Baha'ullah Bahia/M Bahrain/M bahs Baikal/M Bailey/SM bail/GSMYDRB Bailie/M bailiff/SM bailiwick/MS Baillie/M Bail/M bailout/MS bailsman/M bailsmen Baily/M Baird/M bairn/SM baiter/M bait/GSMDR baize/GMDS Baja/M baked/U bakehouse/M Bakelite/M baker/M Baker/M Bakersfield/M bakery/SM bakeshop/S bake/ZGJDRS baking/M baklava/M baksheesh/SM Baku/M Bakunin/M balaclava/MS balalaika/MS balanced/A balancedness balancer/MS balance's balance/USDG Balanchine/M Balboa/M balboa/SM balcony/MSD balderdash/MS Balder/M baldfaced Bald/MR baldness/MS bald/PYDRGST baldric/SM Balduin/M Baldwin/M baldy Balearic/M baleen/MS balefuller balefullest balefulness/MS baleful/YP Bale/M bale/MZGDRS baler/M Balfour/M Bali/M Balinese balkanization balkanize/DG Balkan/SM balker/M balk/GDRS Balkhash/M balkiness/M balky/PRT balladeer/MS ballade/MS balladry/MS ballad/SM Ballard/SM ballast/SGMD ballcock/S ballerina/MS baller/M balletic ballet/MS ballfields ballgame/S ball/GZMSDR ballistic/S ballistics/M Ball/M balloonist/S balloon/RDMZGS balloter/M ballot/MRDGS ballpark/SM ballplayer/SM ballpoint/SM ballroom/SM ballsy/TR ballyhoo/SGMD balminess/SM balm/MS balmy/PRT baloney/SM balsam/GMDS balsamic balsa/MS Balthazar/M Baltic/M Baltimore/M Baluchistan/M baluster/MS balustrade/SM Balzac/M Ba/M Bamako/M Bamberger/M Bambie/M Bambi/M bamboo/SM bamboozle/GSD Bamby/M Banach/M banality/MS banal/TYR banana/SM Bancroft/M bandager/M bandage/RSDMG bandanna/SM bandbox/MS bandeau/M bandeaux band/EDGS bander/M banding/M bandit/MS banditry/MS bandmaster/MS bandoleer/SM bandpass band's bandsman/M bandsmen bandstand/SM bandstop Bandung/M bandwagon/MS bandwidth/M bandwidths bandy/TGRSD banefuller banefullest baneful/Y bane/MS Bangalore/M banger/M bang/GDRZMS bangkok Bangkok/M Bangladeshi/S Bangladesh/M bangle/MS Bangor/M Bangui/M bani banisher/M banishment/MS banish/RSDGL banister/MS Banjarmasin/M banjoist/SM banjo/MS Banjul/M bankbook/SM bankcard/S banker/M bank/GZJDRMBS banking/M Bank/MS banknote/S bankroll/DMSG bankruptcy/MS bankrupt/DMGS Banky/M Ban/M banned/U Banneker/M banner/SDMG banning/U Bannister/M bannister's bannock/SM banns banqueter/M banquet/SZGJMRD banquette/MS ban/SGMD banshee/MS bans/U bantam/MS bantamweight/MS banterer/M bantering/Y banter/RDSG Banting/M Bantu/SM banyan/MS banzai/S baobab/SM Baotou/M baptismal/Y baptism/SM Baptiste/M baptistery/MS baptist/MS Baptist/MS baptistry's baptized/U baptizer/M baptize/SRDZG baptizes/U Barabbas/M Barbabas/M Barbabra/M Barbadian/S Barbados/M Barbaraanne/M Barbara/M Barbarella/M barbarianism/MS barbarian/MS barbaric barbarically barbarism/MS barbarity/SM barbarize/SDG Barbarossa/M barbarousness/M barbarous/PY Barbary/M barb/DRMSGZ barbecue/DRSMG barbed/P Barbee/M barbell/SM barbel/MS Barbe/M barbeque's barber/DMG barbered/U Barber/M barberry/MS barbershop/MS Barbette/M Barbey/M Barbie/M Barbi/M barbital/M barbiturate/MS Barbour/M Barbra/M Barb/RM Barbuda/M barbwire/SM Barby/M barcarole/SM Barcelona/M Barclay/M Bardeen/M Barde/M bardic Bard/M bard/MDSG bareback/D barefacedness/M barefaced/YP barefoot/D barehanded bareheaded barelegged bareness/MS Barents/M bare/YSP barfly/SM barf/YDSG bargainer/M bargain/ZGSDRM barge/DSGM bargeman/M bargemen bargepole/M barhopped barhopping barhop/S Bari/M baritone/MS barium/MS barked/C barkeeper/M barkeep/SRZ barker/M Barker/M bark/GZDRMS Barkley/M barks/C barleycorn/MS barley/MS Barlow/M barmaid/SM barman/M barmen Bar/MH Barnabas Barnabe/M Barnaby/M barnacle/MDS Barnard/M Barnaul/M Barnebas/M Barnes Barnett/M Barney/M barnful barn/GDSM Barnhard/M Barnie/M Barn/M barnsful barnstorm/DRGZS barnstormer/M Barnum/M barnyard/MS Barny/M Baroda/M barometer/MS barometric barometrically baronage/MS baroness/MS baronetcy/SM baronet/MS baronial Baron/M baron/SM barony/SM baroque/SPMY barque's Barquisimeto/M barracker/M barrack/SDRG barracuda/MS barrage/MGSD Barranquilla/M barred/ECU barre/GMDSJ barrel/SGMD barrenness/SM barren/SPRT Barrera/M Barret/M barrette/SM Barrett/M barricade/SDMG Barrie/M barrier/MS barring/R barrio/SM Barri/SM barrister/MS Barr/M Barron/M barroom/SM barrow/MS Barry/M Barrymore/MS bars/ECU barstool/SM Barstow/M Bartel/M bartender/M bartend/ZR barterer/M barter/SRDZG bar/TGMDRS Barthel/M Barth/M Bartholdi/M Bartholemy/M Bartholomeo/M Bartholomeus/M Bartholomew/M Bartie/M Bartlet/M Bartlett/M Bart/M Bartók/M Bartolemo/M Bartolomeo/M Barton/M Bartram/M Barty/M barycenter barycentre's barycentric Bary/M baryon/SM Baryram/M Baryshnikov/M basaltic basalt/SM basal/Y Bascom/M bas/DRSTG baseball/MS baseband baseboard/MS base/CGRSDL baseless baseline/SM Basel/M basely Base/M baseman/M basemen basement/CSM baseness/MS baseplate/M base's basetting bashfulness/MS bashful/PY bash/JGDSR Basho/M Basia/M BASIC basically basic/S Basie/M basilar Basile/M basilica/SM Basilio/M basilisk/SM Basilius/M Basil/M basil/MS basin/DMS basinful/S basis/M basketball/MS basketry/MS basket/SM basketwork/SM bask/GSD basophilic Basque/SM Basra/M Basseterre/M basset/GMDS Bassett/M bassinet/SM bassist/MS Bass/M basso/MS bassoonist/MS bassoon/MS bass/SM basswood/SM bastardization/MS bastardized/U bastardize/SDG bastard/MYS bastardy/MS baste/NXS baster/M Bastian/M Bastien/M Bastille/M basting/M bastion/DM bast/SGZMDR Basutoland/M Bataan/M Batavia/M batch/MRSDG bated/U bate/KGSADC bater/AC Bates bathe bather/M bathetic bathhouse/SM bath/JMDSRGZ bathmat/S Batholomew/M bathos/SM bathrobe/MS bathroom/SDM baths Bathsheba/M bathtub/MS bathwater bathyscaphe's bathysphere/MS batik/DMSG Batista/M batiste/SM Bat/M batman/M Batman/M batmen baton/SM Batsheva/M batsman/M bat/SMDRG batsmen battalion/MS batted batten/SDMG batter/SRDZG battery/MS batting/MS battledore/MS battledress battlefield/SM battlefront/SM battle/GMZRSDL battleground/SM Battle/M battlement/SMD battler/M battleship/MS batty/RT Batu/M batwings bauble/SM Baudelaire/M baud/M Baudoin/M Baudouin/M Bauer/M Bauhaus/M baulk/GSDM Bausch/M bauxite/SM Bavaria/M Bavarian/S bawdily bawdiness/MS bawd/SM bawdy/PRST bawler/M bawl/SGDR Baxie/M Bax/M Baxter/M Baxy/M Bayamon Bayard/M bayberry/MS Bayda/M Bayer/M Bayes Bayesian bay/GSMDY Baylor/M Bay/MR bayonet/SGMD Bayonne/M bayou/MS Bayreuth/M bazaar/MS bazillion/S bazooka/MS BB BBB BBC bbl BBQ BBS BC BCD bdrm beachcomber/SM beachhead/SM Beach/M beach/MSDG beachwear/M beacon/DMSG beading/M Beadle/M beadle/SM bead/SJGMD beadsman/M beadworker beady/TR beagle/SDGM beaker/M beak/ZSDRM Beale/M Bealle/M Bea/M beam/MDRSGZ beanbag/SM bean/DRMGZS beanie/SM Bean/M beanpole/MS beanstalk/SM bearable/U bearably/U beard/DSGM bearded/P beardless Beard/M Beardmore/M Beardsley/M bearer/M bearing/M bearishness/SM bearish/PY bearlike Bear/M Bearnaise/M Bearnard/M bearskin/MS bear/ZBRSJG Beasley/M beasties beastings/M beastliness/MS beastly/PTR beast/SJMY beatable/U beatably/U beaten/U beater/M beatific beatifically beatification/M beatify/GNXDS beating/M beatitude/MS Beatlemania/M Beatles/M beatnik/SM beat/NRGSBZJ Beatrice/M Beatrisa/M Beatrix/M Beatriz/M Beauchamps Beaufort/M Beaujolais/M Beau/M Beaumarchais/M Beaumont/M beau/MS Beauregard/M beauteousness/M beauteous/YP beautician/MS beautification/M beautifier/M beautifully/U beautifulness/M beautiful/PTYR beautify/SRDNGXZ beaut/SM beauty/SM Beauvoir/M beaux's beaver/DMSG Beaverton/M Bebe/M bebop/MS becalm/GDS became because Becca/M Bechtel/M Becka/M Becker/M Becket/M Beckett/M beck/GSDM Beckie/M Becki/M beckon/SDG Beck/RM Becky/M becloud/SGD become/GJS becoming/UY Becquerel/M bedaub/GDS bedazzle/GLDS bedazzlement/SM bedbug/SM bedchamber/M bedclothes bedded bedder/MS bedding/MS bedeck/DGS Bede/M bedevil/DGLS bedevilment/SM bedfast bedfellow/MS Bedford/M bedimmed bedimming bedim/S bedizen/DGS bedlam/MS bedlinen bedmaker/SM bedmate/MS bed/MS Bedouin/SM bedpan/SM bedpost/SM bedraggle/GSD bedridden bedrock/SM bedroll/SM bedroom/DMS bedsheets bedside/MS bedsit bedsitter/M bedsore/MS bedspread/SM bedspring/SM bedstead/SM bedstraw/M bedtime/SM Beebe/M beebread/MS Beecher/M beech/MRSN beechnut/MS beechwood beefburger/SM beefcake/MS beef/GZSDRM beefiness/MS beefsteak/MS beefy/TRP beehive/MS beekeeper/MS beekeeping/SM beeline/MGSD Beelzebub/M Bee/M bee/MZGJRS been/S beeper/M beep/GZSMDR Beerbohm/M beer/M beermat/S beery/TR beeswax/DSMG Beethoven/M beetle/GMRSD Beeton/M beetroot/M beet/SM beeves/M befall/SGN befell befit/SM befitted befitting/Y befogged befogging befog/S before beforehand befoul/GSD befriend/DGS befuddle/GLDS befuddlement/SM began beget/S begetting beggar/DYMSG beggarliness/M beggarly/P beggary/MS begged begging Begin/M beginner/MS beginning/MS begin/S begone/S begonia/SM begot begotten begrime/SDG begrudge/GDRS begrudging/Y beg/S beguilement/SM beguiler/M beguile/RSDLZG beguiling/Y beguine/SM begum/MS begun behalf/M behalves Behan/M behave/GRSD behavioral/Y behaviorism/MS behavioristic/S behaviorist/S behavior/SMD behead/GSD beheld behemoth/M behemoths behest/SM behindhand behind/S beholder/M behold/ZGRNS behoofs behoove/SDJMG behooving/YM Behring/M Beiderbecke/M beige/MS Beijing Beilul/M being/M Beirut/M Beitris/M bejewel/SDG Bekesy/M Bekki/M be/KS belabor/MDSG Bela/M Belarus belate/D belatedness/M belated/PY Belau/M belay/GSD belch/GSD beleaguer/GDS Belem/M Belfast/M belfry/SM Belgian/MS Belgium/M Belg/M Belgrade/M Belia/M Belicia/M belie belief/ESUM belier/M believability's believability/U believable/U believably/U believed/U believe/EZGDRS believer/MUSE believing/U Belinda/M Belita/M belittlement/MS belittler/M belittle/RSDGL Belize/M belladonna/MS Bella/M Bellamy/M Bellanca/M Bellatrix/M bellboy/MS belled/A Belle/M belle/MS belletristic belletrist/SM Belleville/M bellflower/M bell/GSMD bellhop/MS bellicoseness/M bellicose/YP bellicosity/MS belligerence/SM belligerency/MS belligerent/SMY Bellina/M belling/A Bellini/M Bell/M bellman/M bellmen Bellovin/M bellow/DGS Bellow/M bellows/M bells/A bellwether/MS Bellwood/M bellyacher/M bellyache/SRDGM bellybutton/MS bellyfull bellyful/MS belly/SDGM Bel/M Belmont/M Belmopan/M Beloit/M belong/DGJS belonging/MP Belorussian/S Belorussia's belove/D beloved/S below/S Belshazzar/M belted/U belt/GSMD belting/M Belton/M Beltran/M Beltsville/M beltway/SM beluga/SM Belushi/M Belva/M belvedere/M Belvia/M bely/DSRG beman Be/MH bemire/SDG bemoan/GDS bemused/Y bemuse/GSDL bemusement/SM Benacerraf/M Benares's bencher/M benchmark/GDMS bench/MRSDG bend/BUSG bended Bender/M bender/MS Bendick/M Bendicty/M Bendite/M Bendix/M beneath Benedetta/M Benedetto/M Benedick/M Benedicta/M Benedictine/MS benediction/MS Benedict/M Benedicto/M benedictory Benedikta/M Benedikt/M benefaction/MS benefactor/MS benefactress/S benefice/MGSD beneficence/SM beneficent/Y beneficialness/M beneficial/PY beneficiary/MS benefiter/M benefit/SRDMZG Benelux/M Benet/M Benetta/M Benetton/M benevolence/SM benevolentness/M benevolent/YP Bengali/M Bengal/SM Benghazi/M Bengt/M Beniamino/M benightedness/M benighted/YP benignant benignity/MS benign/Y Beninese Benin/M Benita/M Benito/M Benjamen/M Benjamin/M Benjie/M Benji/M Benjy/M Ben/M Bennett/M Bennie/M Benni/M Bennington/M Benn/M Benny/M Benoite/M Benoit/M Benson/M Bentham/M Bentlee/M Bentley/MS Bent/M Benton/M bents bent/U bentwood/SM benumb/SGD Benyamin/M Benzedrine/M benzene/MS benzine/SM Benz/M Beograd's Beowulf/M bequeath/GSD bequeaths bequest/MS berate/GSD Berber/MS bereave/GLSD bereavement/MS bereft Berenice/M Beret/M beret/SM Bergen/M Bergerac/M Berger/M Berget/M Berglund/M Bergman/M Berg/NRM berg/NRSM Bergson/M Bergsten/M Bergstrom/M beribbon/D beriberi/SM Beringer/M Bering/RM Berkeley/M berkelium/SM Berke/M Berkie/M Berkley/M Berkly/M Berkowitz/M Berkshire/SM Berky/M Berk/YM Berle/M Berliner/M Berlin/SZRM Berlioz/M Berlitz/M Berman/M Ber/MG berm/SM Bermuda/MS Bermudan/S Bermudian/S Bernadene/M Bernadette/M Bernadina/M Bernadine/M Berna/M Bernardina/M Bernardine/M Bernardino/M Bernard/M Bernardo/M Bernarr/M Bernays/M Bernbach/M Bernelle/M Berne's Bernese Bernete/M Bernetta/M Bernette/M Bernhard/M Bernhardt/M Bernice/M Berniece/M Bernie/M Berni/M Bernini/M Bernita/M Bern/M Bernoulli/M Bernstein/M Berny/M Berra/M Berrie/M Berri/M berrylike Berry/M berry/SDMG berserker/M berserk/SR Berta/M Berte/M Bertha/M Berthe/M berth/MDGJ berths Bertie/M Bertillon/M Berti/M Bertina/M Bertine/M Bert/M Berton/M Bertram/M Bertrand/M Bertrando/M Berty/M Beryle/M beryllium/MS Beryl/M beryl/SM Berzelius/M bes beseecher/M beseeching/Y beseech/RSJZG beseem/GDS beset/S besetting beside/S besieger/M besiege/SRDZG besmear/GSD besmirch/GSD besom/GMDS besot/S besotted besotting besought bespangle/GSD bespatter/SGD bespeak/SG bespectacled bespoke bespoken Bess Bessel/M Bessemer/M Bessie/M Bessy/M best/DRSG bestiality/MS bestial/Y bestiary/MS bestirred bestirring bestir/S Best/M bestowal/SM bestow/SGD bestrew/DGS bestrewn bestridden bestride/SG bestrode bestseller/MS bestselling bestubble/D betaken betake/SG beta/SM betatron/M betcha Betelgeuse/M betel/MS Bethanne/M Bethany/M bethel/M Bethe/M Bethena/M Bethesda/M Bethina/M bethink/GS Bethlehem/M beth/M Beth/M bethought Bethune betide/GSD betimes bet/MS betoken/GSD betook betrayal/SM betrayer/M betray/SRDZG betrothal/SM betrothed/U betroth/GD betroths Betsey/M Betsy/M Betta/M Betteanne/M Betteann/M Bette/M betterment/MS better/SDLG Bettie/M Betti/M Bettina/M Bettine/M betting bettor/SM Bettye/M Betty/SM betweenness/M between/SP betwixt Beulah/M Bevan/M bevel/SJGMRD beverage/MS Beverie/M Beverlee/M Beverley/M Beverlie/M Beverly/M Bevin/M Bevon/M Bev's Bevvy/M bevy/SM bewail/GDS beware/GSD bewhisker/D bewigged bewildered/PY bewildering/Y bewilder/LDSG bewilderment/SM bewitching/Y bewitch/LGDS bewitchment/SM bey/MS beyond/S bezel/MS bf B/GT Bhopal/M Bhutanese Bhutan/M Bhutto/M Bialystok/M Bianca/M Bianco/M Bianka/M biannual/Y bias/DSMPG biased/U biathlon/MS biaxial/Y bibbed Bibbie/M bibbing Bibbye/M Bibby/M Bibi/M bible/MS Bible/MS biblical/Y biblicists bibliographer/MS bibliographical/Y bibliographic/S bibliography/MS bibliophile/MS Bib/M bib/MS bibulous bicameral bicameralism/MS bicarb/MS bicarbonate/MS bicentenary/S bicentennial/S bicep/S biceps/M bichromate/DM bickerer/M bickering/M bicker/SRDZG biconcave biconnected biconvex bicuspid/S bicycler/M bicycle/RSDMZG bicyclist/SM biddable bidden/U bidder/MS Biddie/M bidding/MS Biddle/M Biddy/M biddy/SM bider/M bide/S bidet/SM Bidget/M bid/GMRS bidiagonal bidirectional/Y bids/A biennial/SY biennium/SM Bienville/M Bierce/M bier/M bifocal/S bifurcate/SDXGNY bifurcation/M bigamist/SM bigamous bigamy/SM Bigelow/M Bigfoot bigged bigger biggest biggie/SM bigging biggish bighead/MS bigheartedness/S bighearted/P bighorn/MS bight/SMDG bigmouth/M bigmouths bigness/SM bigoted/Y bigot/MDSG bigotry/MS big/PYS bigwig/MS biharmonic bijection/MS bijective/Y bijou/M bijoux bike/MZGDRS biker/M bikini/SMD Biko/M bilabial/S bilateralness/M bilateral/PY bilayer/S Bilbao/M bilberry/MS Bilbo/M bile/SM bilge/GMDS biliary Bili/M bilinear bilingualism/SM bilingual/SY biliousness/SM bilious/P bilker/M bilk/GZSDR billboard/MDGS biller/M billet/MDGS billfold/MS billiard/SM Billie/M Billi/M billing/M billingsgate/SM Billings/M billionaire/MS billion/SHM billionths bill/JGZSBMDR Bill/JM billow/DMGS billowy/RT billposters Billye/M Billy/M billy/SM Bil/MY bi/M Bi/M bimbo/MS bimetallic/S bimetallism/MS Bimini/M bimodal bimolecular/Y bimonthly/S binary/S binaural/Y binder/M bindery/MS binding/MPY bindingness/M bind/JDRGZS bindle/M binds/AU bindweed/MS binge/MS bing/GNDM Bingham/M Binghamton/M Bing/M bingo/MS Bini/M Bink/M Binky/M binnacle/MS binned Binnie/M Binni/M binning Binny/M binocular/SY binodal binomial/SYM bin/SM binuclear biochemical/SY biochemist/MS biochemistry/MS biodegradability/S biodegradable biodiversity/S bioengineering/M bioethics biofeedback/SM biographer/M biographic biographical/Y biograph/RZ biography/MS biog/S Bioko/M biol biological/SY biologic/S biologist/SM biology/MS biomass/SM biomedical biomedicine/M biometric/S biometrics/M biometry/M biomolecule/S biomorph bionically bionic/S bionics/M biophysical/Y biophysicist/SM biophysic/S biophysics/M biopic/S biopsy/SDGM biorhythm/S BIOS bioscience/S biosphere/MS biostatistic/S biosynthesized biotechnological biotechnologist biotechnology/SM biotic biotin/SM bipartisan bipartisanship/MS bipartite/YN bipartition/M bipedal biped/MS biplane/MS bipolar bipolarity/MS biracial Birch/M birch/MRSDNG birdbath/M birdbaths birdbrain/SDM birdcage/SM birder/M birdhouse/MS birdieing Birdie/M birdie/MSD birdlike birdlime/MGDS Bird/M birdseed/MS Birdseye/M bird/SMDRGZ birdsong birdtables birdwatch/GZR birefringence/M birefringent biretta/SM Birgit/M Birgitta/M Birkenstock/M Birk/M Birmingham/M Biro/M Biron/M birthday/SM birthmark/MS birth/MDG birthplace/SM birthrate/MS birthright/MS birth's/A births/A birthstone/SM bis Biscay/M Biscayne/M biscuit/MS bisect/DSG bisection/MS bisector/MS biserial bisexuality/MS bisexual/YMS Bishkek bishop/DGSM Bishop/M bishopric/SM Bismarck/M Bismark/M bismuth/M bismuths bison/M bisque/SM Bissau/M bistable bistate bistro/SM bisyllabic bitblt/S bitchily bitchiness/MS bitch/MSDG bitchy/PTR biter/M bite/S biting/Y bitmap/SM bit/MRJSZG BITNET/M bit's/C bits/C bitser/M bitted bitten bitterness/SM bittern/SM bitternut/M bitter/PSRDYTG bitterroot/M bittersweet/YMSP bitting bitty/PRT bitumen/MS bituminous bitwise bivalent/S bivalve/MSD bivariate bivouacked bivouacking bivouac/MS biweekly/S biyearly bizarreness/M bizarre/YSP Bizet/M biz/M bizzes Bjorn/M bk b/KGD Bk/M blabbed blabber/GMDS blabbermouth/M blabbermouths blabbing blab/S blackamoor/SM blackball/SDMG blackberry/GMS blackbirder/M blackbird/SGDRM blackboard/SM blackbody/S Blackburn/M blackcurrant/M blackener/M blacken/GDR Blackfeet Blackfoot/M blackguard/MDSG blackhead/SM blacking/M blackish blackjack/SGMD blackleg/M blacklist/DRMSG blackmail/DRMGZS blackmailer/M Blackman/M Blackmer/M blackness/MS blackout/SM Blackpool/M Black's black/SJTXPYRDNG blacksmith/MG blacksmiths blacksnake/MS blackspot Blackstone/M blackthorn/MS blacktop/MS blacktopped blacktopping Blackwell/MS bladder/MS bladdernut/M bladderwort/M blade/DSGM blah/MDG blahs Blaine/M Blaire/M Blair/M Blakelee/M Blakeley/M Blake/M Blakey/M blame/DSRBGMZ blamelessness/SM blameless/YP blamer/M blameworthiness/SM blameworthy/P Blanca/M Blancha/M Blanchard/M blanch/DRSG Blanche/M blancher/M Blanch/M blanc/M blancmange/SM blandishment/MS blandish/SDGL blandness/MS bland/PYRT Blane/M Blankenship/M blanketing/M blanket/SDRMZG blankness/MS blank/SPGTYRD Blanton/M Blantyre/M blare/DSG blarney/DMGS blasé blasphemer/M blaspheme/RSDZG blasphemousness/M blasphemous/PY blasphemy/SM blaster/M blasting/M blastoff/SM blast/SMRDGZ blatancy/SM blatant/YP blather/DRGS blatting Blatz/M Blavatsky/M Blayne/M blaze/DSRGMZ blazer/M blazing/Y blazoner/M blazon/SGDR bl/D bldg bleach/DRSZG bleached/U bleacher/M bleakness/MS bleak/TPYRS blear/GDS blearily bleariness/SM bleary/PRT bleater/M bleat/RDGS bleeder/M bleed/ZRJSG Bleeker/M bleep/GMRDZS blemish/DSMG blemished/U blench/DSG blender/M blend/GZRDS Blenheim/M blessedness/MS blessed/PRYT blessing/M bless/JGSD Blevins/M blew Bligh/M blighter/M blight/GSMDR blimey/S blimp/MS blinded/U blinder/M blindfold/SDG blinding/MY blind/JGTZPYRDS blindness/MS blindside/SDG blinker/MDG blinking/U blink/RDGSZ blinks/M Blinnie/M Blinni/M Blinny/M blintze/M blintz/SM blip/MS blipped blipping Blisse/M blissfulness/MS blissful/PY Bliss/M bliss/SDMG blistering/Y blister/SMDG blistery Blithe/M blitheness/SM blither/G blithesome blithe/TYPR blitz/GSDM blitzkrieg/SM blizzard/MS bloater/M bloat/SRDGZ blobbed blobbing blob/MS Bloch/M blockader/M blockade/ZMGRSD blockage/MS blockbuster/SM blockbusting/MS blocker/MS blockhead/MS blockhouse/SM block's block/USDG blocky/R bloc/MS Bloemfontein/M bloke/SM Blomberg/M Blomquist/M Blondelle/M Blondell/M blonde's Blondie/M blondish blondness/MS blond/SPMRT Blondy/M bloodbath bloodbaths bloodcurdling bloodhound/SM bloodied/U bloodiness/MS bloodlessness/SM bloodless/PY bloodletting/MS bloodline/SM bloodmobile/MS bloodroot/M bloodshed/SM bloodshot blood/SMDG bloodsport/S bloodstain/MDS bloodstock/SM bloodstone/M bloodstream/SM bloodsucker/SM bloodsucking/S bloodthirstily bloodthirstiness/MS bloodthirsty/RTP bloodworm/M bloodymindedness bloody/TPGDRS bloomer/M Bloomer/M Bloomfield/M Bloomington/M Bloom/MR bloom/SMRDGZ blooper/M bloop/GSZRD blossom/DMGS blossomy blotch/GMDS blotchy/RT blot/MS blotted blotter/MS blotting blotto blouse/GMSD blower/M blowfish/M blowfly/MS blowgun/SM blow/GZRS blowing/M blown/U blowout/MS blowpipe/SM blowtorch/SM blowup/MS blowy/RST blowzy/RT BLT blubber/GSDR blubbery Blucher/M bludgeon/GSMD blueback Bluebeard/M bluebell/MS blueberry/SM bluebill/M bluebird/MS bluebonnet/SM bluebook/M bluebottle/MS bluebush bluefish/SM bluegill/SM bluegrass/MS blueing's blueish bluejacket/MS bluejeans blue/JMYTGDRSP blueness/MS bluenose/MS bluepoint/SM blueprint/GDMS bluer/M bluest/M bluestocking/SM bluesy/TR bluet/MS bluffer/M bluffness/MS bluff/SPGTZYRD bluing/M bluishness/M bluish/P Blumenthal/M Blum/M blunderbuss/MS blunderer/M blunder/GSMDRJZ blundering/Y bluntness/MS blunt/PSGTYRD blurb/GSDM blur/MS blurred/Y blurriness/S blurring/Y blurry/RPT blurt/GSRD blusher/M blushing/UY blush/RSDGZ blusterer/M blustering/Y blusterous bluster/SDRZG blustery blvd Blvd Blythe/M BM BMW/M BO boarded boarder/SM boardgames boardinghouse/SM boarding/SM board/IS boardroom/MS board's boardwalk/SM boar/MS boa/SM boaster/M boastfulness/MS boastful/YP boast/SJRDGZ boatclubs boater/M boathouse/SM boating/M boatload/SM boatman/M boat/MDRGZJS boatmen boatswain/SM boatyard/SM bobbed Bobbee/M Bobbe/M Bobbette/M Bobbie/M Bobbi/M bobbing/M bobbin/MS Bobbitt/M bobble/SDGM Bobbsey/M Bobbye/M Bobby/M bobby/SM bobbysoxer's bobcat/MS Bobette/M Bobina/M Bobine/M Bobinette/M Bob/M bobolink/SM Bobrow/M bobsledded bobsledder/MS bobsledding/M bobsled/MS bobsleigh/M bobsleighs bobs/M bob/SM bobtail/SGDM bobwhite/SM Boca/M Boccaccio/M boccie/SM bock/GDS bockwurst bodega/MS Bodenheim/M bode/S Bodhidharma/M bodhisattva Bodhisattva/M bodice/SM bodied/M bodiless bodily boding/M bodkin/SM bod/SGMD bodybuilder/SM bodybuilding/S body/DSMG bodyguard/MS bodying/M bodysuit/S bodyweight bodywork/SM Boeing/M Boeotia/M Boeotian Boer/M Bogartian/M Bogart/M Bogey/M bogeyman/M bogeymen bogey/SGMD bogged bogging boggle/SDG boggling/Y boggy/RT bogie's bog/MS Bogotá/M bogus bogyman bogymen bogy's Boheme/M bohemianism/S bohemian/S Bohemian/SM Bohemia/SM Bohr/M Boigie/M boiled/AU boiler/M boilermaker/MS boilerplate/SM boil/JSGZDR boils/A Boise/M Bois/M boisterousness/MS boisterous/YP bola/SM boldface/SDMG boldness/MS bold/YRPST bole/MS bolero/MS Boleyn/M bolivares Bolivar/M bolivar/MS Bolivia/M Bolivian/S bollard/SM bollix/GSD boll/MDSG Bologna/M bologna/MS bolometer/MS bolo/MS boloney's Bolshevik/MS Bolshevism/MS Bolshevistic/M Bolshevist/MS Bolshoi/M bolsterer/M bolster/SRDG bolted/U bolter/M bolt/MDRGS Bolton/M bolts/U Boltzmann/M bolus/SM bombardier/MS bombard/LDSG bombardment/SM bombastic bombastically bombast/RMS Bombay/M bomber/M bombproof bomb/SGZDRJ bombshell/SM Bo/MRZ bona bonanza/MS Bonaparte/M Bonaventure/M bonbon/SM bondage/SM bonder/M bondholder/SM Bondie/M bond/JMDRSGZ Bond/M bondman/M bondmen Bondon/M bonds/A bondsman/M bondsmen bondwoman/M bondwomen Bondy/M boned/U bonehead/SDM boneless Bone/M bone/MZDRSG boner/M bonfire/MS bong/GDMS bongo/MS Bonham/M bonhomie/MS Boniface/M boniness/MS Bonita/M bonito/MS bonjour bonkers Bonnee/M Bonner/M bonneted/U bonnet/SGMD Bonneville/M Bonnibelle/M bonnie Bonnie/M Bonni/M Bonn/RM Bonny/M bonny/RT bonsai/SM Bontempo/M bonus/SM bony/RTP bonzes boob/DMSG booby/SM boodle/GMSD boogeyman's boogieing boogie/SD boo/GSDH boohoo/GDS bookbinder/M bookbindery/SM bookbinding/M bookbind/JRGZ bookcase/MS booked/U bookend/SGD Booker/M book/GZDRMJSB bookie/SM booking/M bookishness/M bookish/PY bookkeeper/M bookkeep/GZJR bookkeeping/M booklet/MS bookmaker/MS bookmaking/MS bookmark/MDGS bookmobile/MS bookplate/SM bookseller/SM bookshelf/M bookshelves bookshop/MS bookstall/MS bookstore/SM bookwork/M bookworm/MS Boolean boolean/S Boole/M boom/DRGJS boomerang/MDSG boomer/M boomtown/S boondocks boondoggle/DRSGZ boondoggler/M Boone/M Boonie/M boonies boon/MS Boony/M boorishness/SM boorish/PY boor/MS boosterism booster/M boost/SGZMRD boot/AGDS bootblack/MS bootee/MS Boote/M Boötes Boothe/M booth/M Booth/M booths bootie's bootlaces bootlegged/M bootlegger/SM bootlegging/M bootleg/S Bootle/M bootless Boot/M bootprints boot's bootstrapped bootstrapping bootstrap/SM booty/SM booze/DSRGMZ boozer/M boozy/TR bopped bopping bop/S borate/MSD borax/MS Bordeaux/M bordello/MS Borden/M borderer/M border/JRDMGS borderland/SM borderline/MS Bordie/M Bord/MN Bordon/M Bordy/M Borealis/M Boreas/M boredom/MS boreholes borer/M bore/ZGJDRS Borges Borgia/M Borg/M boric boring/YMP Boris Bork/M born/AIU Borneo/M borne/U Born/M Borodin/M boron/SM borosilicate/M borough/M boroughs Borroughs/M borrower/M borrowing/M borrow/JZRDGBS borscht/SM borstal/MS Boru/M borzoi/MS Bosch/M Bose/M bosh/MS Bosnia/M Bosnian/S bosom's bosom/SGUD bosomy/RT boson/SM Bosporus/M boss/DSRMG bossily bossiness/MS bossism/MS bossy/PTSR Bostitch/M Bostonian/SM Boston/MS bosun's Boswell/MS botanical/SY botanic/S botanist/SM botany/SM botcher/M botch/SRDGZ botfly/M bother/DG bothersome bothy/M both/ZR bot/S Botswana/M Botticelli/M bottle/GMZSRD bottleneck/GSDM bottler/M bottomlessness/M bottomless/YP bottommost bottom/SMRDG botulin/M botulinus/M botulism/SM Boucher/M boudoir/MS bouffant/S bougainvillea/SM bough/MD boughs bought/N bouillabaisse/MS bouillon/MS boulder/GMDS Boulder/M boulevard/MS bouncer/M bounce/SRDGZ bouncily bouncing/Y bouncy/TRP boundary/MS bound/AUDI boundedness/MU bounded/UP bounden bounder/AM bounders bounding boundlessness/SM boundless/YP bounds/IA bounteousness/MS bounteous/PY bountifulness/SM bountiful/PY bounty/SDM bouquet/SM Bourbaki/M bourbon/SM Bourbon/SM bourgeoisie/SM bourgeois/M Bourke/M Bourne/M Bournemouth/M boutique/MS bout/MS boutonnière/MS Bouvier Bovary/M bovine/YS Bowditch/M bowdlerization/MS bowdlerize/GRSD bowed/U bowel/GMDS Bowell/M Bowen/M bower/DMG Bowers Bowery/M Bowes bowie Bowie/M bowing/M bowlder's bowlegged bowleg/SM bowler/M bowlful/S bowl/GZSMDR bowline/MS bowling/M bowman/M Bowman/M bowmen bowser/M bowsprit/SM bows/R bowstring/GSMD bow/SZGNDR bowwow/DMGS boxcar/SM box/DRSJZGM boxer/M boxful/M boxing/M boxlike boxtops boxwood/SM boxy/TPR Boyce/M Boycey/M Boycie/M boycotter/M boycott/RDGS Boyd/M Boyer/M boyfriend/MS boyhood/SM boyishness/MS boyish/PY Boyle/M Boy/MR boy/MRS boyscout boysenberry/SM bozo/SM bpi bps BR brace/DSRJGM braced/U bracelet/MS bracer/M brachia brachium/M bracken/SM bracketed/U bracketing/M bracket/SGMD brackishness/SM brackish/P bract/SM Bradan/M bradawl/M Bradbury/M Bradburys bradded bradding Braddock/M Brade/M Braden/M Bradford/M Bradley/M Bradly/M Brad/MYN Bradney/M Bradshaw/M brad/SM Bradstreet/M Brady/M brae/SM braggadocio/SM braggart/SM bragged bragger/MS braggest bragging Bragg/M brag/S Brahe/M Brahma/MS Brahmanism/MS Brahman/SM Brahmaputra/M Brahmin's Brahms braider/M braiding/M braid/RDSJG braille/DSG Braille/GDSM Brainard/SM braincell/S brainchild/M brainchildren brain/GSDM braininess/MS brainlessness/M brainless/YP Brain/M brainpower/M brainstorm/DRMGJS brainstorming/M brainteaser/S brainteasing brainwasher/M brainwashing/M brainwash/JGRSD brainwave/S brainy/RPT braise/SDG brake/DSGM brakeman/M brakemen/M bramble/DSGM brambling/M brambly/RT Bram/M Brampton/M bra/MS Brana/M branched/U branching/M branchlike Branch/M branch/MDSJG Branchville/M Brandais/M Brandea/M branded/U Brandeis/M Brandel/M Brande/M Brandenburg/M Branden/M brander/GDM Brander/M Brandice/M Brandie/M Brandi/M Brandise/M brandish/GSD Brand/MRN Brando/M Brandon/M brand/SMRDGZ Brandt/M Brandtr/M brandy/GDSM Brandy/M Brandyn/M brandywine Braniff/M Bran/M branned branning Brannon/M bran/SM Brantley/M Brant/M Braque/M brashness/MS brash/PYSRT Brasilia brasserie/SM brass/GSDM brassiere/MS brassily brassiness/SM brassy/RSPT Bratislava/M brat/SM Brattain/M bratty/RT bratwurst/MS Braun/M bravadoes bravado/M brave/DSRGYTP braveness/MS bravery/MS bravest/M bravo/SDG bravura/SM brawler/M brawl/MRDSGZ brawniness/SM brawn/MS brawny/TRP brayer/M Bray/M bray/SDRG braze/GZDSR brazenness/MS brazen/PYDSG brazer/M brazier/SM Brazilian/MS Brazil/M Brazos/M Brazzaville/M breacher/M breach/MDRSGZ breadbasket/SM breadboard/SMDG breadbox/S breadcrumb/S breadfruit/MS breadline/MS bread/SMDHG breadth/M breadths breadwinner/MS breakables breakable/U breakage/MS breakaway/MS breakdown/MS breaker/M breakfaster/M breakfast/RDMGZS breakfront/S breaking/M breakneck breakout/MS breakpoint/SMDG break/SZRBG breakthroughs breakthrough/SM breakup/SM breakwater/SM bream/SDG Breanne/M Brear/M breastbone/MS breastfed breastfeed/G breasting/M breast/MDSG breastplate/SM breaststroke/SM breastwork/MS breathable/U breathalyser/S Breathalyzer/SM breathe breather/M breathing/M breathlessness/SM breathless/PY breaths breathtaking/Y breathy/TR breath/ZBJMDRSG Brecht/M Breckenridge/M bred/DG bredes breeching/M breech/MDSG breeder/I breeder's breeding/IM breeds/I breed/SZJRG Bree/M Breena/M breeze/GMSD breezeway/SM breezily breeziness/SM breezy/RPT Bremen/M bremsstrahlung/M Brena/M Brenda/M Brendan/M Brenden/M Brendin/M Brendis/M Brendon/M Bren/M Brenna/M Brennan/M Brennen/M Brenner/M Brenn/RNM Brent/M Brenton/M Bresenham/M Brest/M brethren Bret/M Breton Brett/M breve/SM brevet/MS brevetted brevetting breviary/SM brevity/MS brew/DRGZS brewer/M Brewer/M brewery/MS brewing/M brewpub/S Brew/RM Brewster/M Brezhnev/M Bria/M Briana/M Brian/M Brianna/M Brianne/M Briano/M Briant/M briar's bribe/GZDSR briber/M bribery/MS Brice/M brickbat/SM brick/GRDSM bricklayer/MS bricklaying/SM brickmason/S brickwork/SM brickyard/M bridal/S Bridalveil/M bridegroom/MS Bride/M bride/MS bridesmaid/MS Bridewell/M bridgeable/U bridged/U bridgehead/MS Bridgeport/M Bridger/M Bridges bridge/SDGM Bridget/M Bridgetown/M Bridgette/M Bridgett/M Bridgewater/M bridgework/MS bridging/M Bridgman/M Bridie/M bridled/U bridle/SDGM bridleway/S briefcase/SM briefed/C briefing/M briefness/MS briefs/C brief/YRDJPGTS Brien/M Brier/M brier/MS Brie/RSM Brietta/M brigade/GDSM brigadier/MS Brigadoon brigandage/MS brigand/MS brigantine/MS Brigg/MS Brigham/M brightener/M brighten/RDZG bright/GXTPSYNR Bright/M brightness/SM Brighton/M Brigida/M Brigid/M Brigit/M Brigitta/M Brigitte/M Brig/M brig/SM brilliance/MS brilliancy/MS brilliantine/MS brilliantness/M brilliant/PSY Brillo Brillouin/M brimful brimless brimmed brimming brim/SM brimstone/MS Brina/M Brindisi/M brindle/DSM brine/GMDSR briner/M Briney/M bringer/M bring/RGZS brininess/MS Brinkley/M brinkmanship/SM brink/MS Brinna/M Brinn/M Briny/M briny/PTSR brioche/SM Brion/M briquet's briquette/MGSD Brisbane/M brisket/SM briskness/MS brisk/YRDPGTS bristle/DSGM bristly/TR Bristol/M bristol/S Britain/M Brita/M Britannia/M Britannic Britannica/M britches Briticism/MS Britisher/M Britishly/M British/RYZ Brit/MS Britney/M Britni/M Briton/MS Britta/M Brittaney/M Brittani/M Brittan/M Brittany/MS Britte/M Britten/M Britteny/M brittleness/MS brittle/YTPDRSG Britt/MN Brittne/M Brittney/M Brittni/M Brnaba/M Brnaby/M Brno/M broach/DRSG broacher/M broadband broadcaster/M broadcast/RSGZJ broadcasts/A broadcloth/M broadcloths broaden/JGRDZ broadleaved broadloom/SM broadminded/P broadness/S broadsheet/MS broadside/SDGM broadsword/MS broad/TXSYRNP Broadway/SM Brobdingnagian Brobdingnag/M brocade/DSGM broccoli/MS brochette/SM brochure/SM Brockie/M Brock/M Brocky/M Broddie/M Broddy/M Broderick/M Broderic/M Brodie/M Brod/M Brody/M brogan/MS Broglie/M brogue/MS broiler/M broil/RDSGZ brokenhearted/Y brokenness/MS broken/YP brokerage/MS broker/DMG broke/RGZ Brok/M bromide/MS bromidic bromine/MS bronchial bronchi/M bronchiolar bronchiole/MS bronchiolitis bronchitic/S bronchitis/MS broncho's bronchus/M broncobuster/SM bronco/SM bronc/S Bron/M Bronnie/M Bronny/M Bronson/M Bronte brontosaur/SM brontosaurus/SM Bronx/M bronzed/M bronze/SRDGM bronzing/M brooch/MS brooder/M broodiness/M brooding/Y broodmare/SM brood/SMRDGZ broody/PTR Brookdale/M Brooke/M Brookfield/M Brookhaven/M brooklet/MS Brooklyn/M Brookmont/M brook/SGDM brookside Brook/SM broom/SMDG broomstick/MS Bros Brose/M bro/SH bros/S brothel/MS brother/DYMG brotherhood/SM brotherliness/MS brotherly/P broths broth/ZMR brougham/MS brought brouhaha/MS browbeat/NSG brow/MS Brownell/M Browne/M Brownian/M Brownie/MS brownie/MTRS browning/M Browning/M brownish Brown/MG brownness/MS brownout/MS brownstone/MS Brownsville/M brown/YRDMSJGTP browse browser/M brows/SRDGZ brr Br/TMN Brubeck/M brucellosis/M Bruce/M Brucie/M Bruckner/M Bruegel/M Brueghel's bruin/MS bruised/U bruise/JGSRDZ bruiser/M Bruis/M bruit/DSG Brumidi/M Brummel/M brunch/MDSG Brunei/M Brunelleschi/M brunet/S brunette/SM Brunhilda/M Brunhilde/M Bruno/M Brunswick/M brunt/GSMD brusher/M brushfire/MS brushlike brush/MSRDG brushoff/S brushwood/SM brushwork/MS brushy/R brusqueness/MS brusque/PYTR Brussels brutality/SM brutalization/SM brutalized/U brutalizes/AU brutalize/SDG brutal/Y brute/DSRGM brutishness/SM brutish/YP Brutus/M Bruxelles/M Bryana/M Bryan/M Bryant/M Bryanty/M Bryce/M Bryna/M Bryn/M Brynna/M Brynne/M Brynner/M Brynn/RM Bryon/M Brzezinski/M B's BS BSA BSD Btu BTU BTW bu bubblegum/S bubbler/M bubble/RSDGM bubbly/TRS Buber/M bub/MS buboes bubo/M bubonic buccaneer/GMDS Buchanan/M Bucharest/M Buchenwald/M Buchwald/M buckaroo/SM buckboard/SM bucker/M bucketful/MS bucket/SGMD buckeye/SM buck/GSDRM buckhorn/M Buckie/M Buckingham/M buckled/U buckler/MDG buckle/RSDGMZ buckles/U Buckley/M buckling's buckling/U Buck/M Buckner/M buckram/GSDM bucksaw/SM buckshot/MS buckskin/SM buckteeth bucktooth/DM buckwheat/SM Bucky/M bucolically bucolic/S Budapest/M budded Buddha/MS Buddhism/SM Buddhist/SM Buddie/M budding/S Budd/M buddy/GSDM Buddy/M budge/GDS budgerigar/MS budgetary budgeter/M budget/GMRDZS budgie/MS budging/U Bud/M bud/MS Budweiser/MS Buehring/M Buena/M buffaloes Buffalo/M buffalo/MDG buff/ASGD buffered/U bufferer/M buffer/RDMSGZ buffet/GMDJS bufflehead/M buffoonery/MS buffoonish buffoon/SM buff's Buffy/M Buford/M bugaboo/SM Bugatti/M bugbear/SM bug/CS bugeyed bugged/C buggered buggering bugger/SCM! buggery/M bugging/C buggy/RSMT bugle/GMDSRZ bugler/M bug's Buick/M builder/SM building/SM build/SAG buildup/MS built/AUI Buiron/M Bujumbura/M Bukhara/M Bukharin/M Bulawayo/M Bulba/M bulb/DMGS bulblet bulbous Bulfinch/M Bulganin/M Bulgaria/M Bulgarian/S bulge/DSGM bulgy/RT bulimarexia/S bulimia/MS bulimic/S bulk/GDRMS bulkhead/SDM bulkiness/SM bulky/RPT bulldogged bulldogger bulldogging bulldog/SM bulldoze/GRSDZ bulldozer/M bullet/GMDS bulletin/SGMD bulletproof/SGD bullfighter/M bullfighting/M bullfight/SJGZMR bullfinch/MS bullfrog/SM bullhead/DMS bullheadedness/SM bullheaded/YP bullhide bullhorn/SM bullied/M bullion/SM bullishness/SM bullish/PY bull/MDGS Bullock/M bullock/MS bullpen/MS bullring/SM bullseye bullshit/MS! bullshitted/! bullshitter/S! bullshitting/! bullwhackers Bullwinkle/M bullyboy/MS bullying/M bully/TRSDGM bulrush/SM Bultmann/M bulwark/GMDS bumblebee/MS bumble/JGZRSD bumbler/M bumbling/Y Bumbry/M bummed/M bummer/MS bummest bumming/M bumper/DMG bump/GZDRS bumpiness/MS bumpkin/MS Bumppo/M bumptiousness/SM bumptious/PY bumpy/PRT bum/SM Bunche/M bunch/MSDG bunchy/RT buncombe's bunco's Bundestag/M bundled/U bundle/GMRSD bundler/M Bundy/M bungalow/MS bungee/SM bung/GDMS bunghole/MS bungle/GZRSD bungler/M bungling/Y Bunin/M bunion/SM bunk/CSGDR Bunker/M bunker's/C bunker/SDMG bunkhouse/SM bunkmate/MS bunko's bunk's bunkum/SM Bunnie/M Bunni/M Bunny/M bunny/SM Bunsen/SM bun/SM bunt/GJZDRS bunting/M Buñuel/M Bunyan/M buoyancy/MS buoyant/Y buoy/SMDG Burbank/M burbler/M burble/RSDG burbs Burch/M burden's burdensomeness/M burdensome/PY burden/UGDS burdock/SM bureaucracy/MS bureaucratically bureaucratic/U bureaucratization/MS bureaucratize/SDG bureaucrat/MS bureau/MS burgeon/GDS burger/M Burger/M Burgess/M burgess/MS burgher/M burgh/MRZ burghs burglarize/GDS burglarproof/DGS burglar/SM burglary/MS burgle/SDG burgomaster/SM Burgoyne/M Burg/RM burg/SZRM Burgundian/S Burgundy/MS burgundy/S burial/ASM buried/U burier/M Burke/M Burk/SM burlap/MS burler/M burlesquer/M burlesque/SRDMYG burley/M Burlie/M burliness/SM Burlingame/M Burlington/M Burl/M burl/SMDRG burly/PRT Burma/M Burmese bur/MYS burnable/S Burnaby/M Burnard/M burned/U Burne/MS burner/M Burnett/M burn/GZSDRBJ burning/Y burnisher/M burnish/GDRSZ burnoose/MS burnout/MS Burns Burnside/MS burnt/YP burp/SGMD burr/GSDRM Burris/M burrito/S Burr/M burro/SM Burroughs/M burrower/M burrow/GRDMZS bursae bursa/M Bursa/M bursar/MS bursary/MS bursitis/MS burster/M burst/SRG Burtie/M Burt/M Burton/M Burty/M Burundian/S Burundi/M bury/ASDG busboy/MS busby/SM Busch/M buses/A busgirl/S bus/GMDSJ bushel/MDJSG Bushido/M bushiness/MS bushing/M bush/JMDSRG bushland Bush/M bushman/M bushmaster/SM bushmen Bushnell/M bushwhacker/M bushwhacking/M bushwhack/RDGSZ bushy/PTR busily businesslike businessman/M businessmen business/MS businesspeople businessperson/S businesswoman/M businesswomen busker/M busk/GRM buskin/SM bus's/A buss/D bustard/MS buster/M bustle/GSD bustling/Y bust/MSDRGZ busty/RT busybody/MS busy/DSRPTG busyness/MS busywork/SM but/ACS butane/MS butcherer/M butcher/MDRYG butchery/MS Butch/M butch/RSZ butene/M Butler/M butler/SDMG butted/A butte/MS butterball/MS buttercup/SM buttered/U butterfat/MS Butterfield/M butterfingered butterfingers/M butterfly/MGSD buttermilk/MS butternut/MS butter/RDMGZ butterscotch/SM buttery/TRS butting/M buttock/SGMD buttoner/M buttonhole/GMRSD buttonholer/M button's button/SUDG buttonweed buttonwood/SM buttress/MSDG butt/SGZMDR butyl/M butyrate/M buxomness/M buxom/TPYR Buxtehude/M buyback/S buyer/M buyout/S buy/ZGRS buzzard/MS buzz/DSRMGZ buzzer/M buzzword/SM buzzy bx bxs byelaw's Byelorussia's bye/MZS Byers/M bygone/S bylaw/SM byliner/M byline/RSDGM BYOB bypass/GSDM bypath/M bypaths byplay/S byproduct/SM Byram/M Byran/M Byrann/M Byrd/M byre/SM Byrle/M Byrne/M byroad/MS Byrom/M Byronic Byronism/M Byron/M bystander/SM byte/SM byway/SM byword/SM byzantine Byzantine/S Byzantium/M by/ZR C ca CA cabala/MS caballed caballero/SM caballing cabal/SM cabana/MS cabaret/SM cabbage/MGSD cabbed cabbing cabby's cabdriver/SM caber/M Cabernet/M cabinetmaker/SM cabinetmaking/MS cabinet/MS cabinetry/SM cabinetwork/MS cabin/GDMS cablecast/SG cable/GMDS cablegram/SM cabochon/MS caboodle/SM caboose/MS Cabot/M Cabrera/M Cabrini/M cabriolet/MS cab/SMR cabstand/MS cacao/SM cacciatore cache/DSRGM cachepot/MS cachet/MDGS Cacilia/M Cacilie/M cackler/M cackle/RSDGZ cackly CACM cacophonist cacophonous cacophony/SM cacti cactus/M CAD cadaverous/Y cadaver/SM caddishness/SM caddish/PY Caddric/M caddy/GSDM cadence/CSM cadenced cadencing cadent/C cadenza/MS cadet/SM Cadette/S cadge/DSRGZ cadger/M Cadillac/MS Cadiz/M Cad/M cadmium/MS cadre/SM cad/SM caducei caduceus/M Caedmon/M Caesar/MS caesura/SM café/MS cafeteria/SM caffeine/SM caftan/SM caged/U Cage/M cage/MZGDRS cager/M cagey/P cagier cagiest cagily caginess/MS Cagney/M Cahokia/M cahoot/MS Cahra/M CAI Caiaphas/M caiman's Caine/M Cain/MS Cairistiona/M cairn/SDM Cairo/M caisson/SM caitiff/MS Caitlin/M Caitrin/M cajole/LGZRSD cajolement/MS cajoler/M cajolery/SM Cajun/MS cake/MGDS cakewalk/SMDG calabash/SM calaboose/MS Calais/M calamari/S calamine/GSDM calamitousness/M calamitous/YP calamity/MS cal/C calcareousness/M calcareous/PY calciferous calcification/M calcify/XGNSD calcimine/GMSD calcine/SDG calcite/SM calcium/SM Calcomp/M CalComp/M CALCOMP/M calculability/IM calculable/IP calculate/AXNGDS calculated/PY calculatingly calculating/U calculation/AM calculative calculator/SM calculi calculus/M Calcutta/M caldera/SM Calder/M Calderon/M caldron's Caldwell/M Caleb/M Caledonia/M Cale/M calendar/MDGS calender/MDGS calf/M calfskin/SM Calgary/M Calhoun/M Caliban/M caliber/SM calibrated/U calibrater's calibrate/XNGSD calibrating/A calibration/M calibrator/MS calicoes calico/M Calida/M Calif/M California/M Californian/MS californium/SM calif's Caligula/M Cali/M caliper/SDMG caliphate/SM caliph/M caliphs calisthenic/S calisthenics/M Callaghan/M call/AGRDBS Callahan/M calla/MS Calla/MS Callao/M callback/S Callean/M called/U callee/M caller/MS Calley/M Callida/M Callie/M calligrapher/M calligraphic calligraphist/MS calligraph/RZ calligraphy/MS Calli/M calling/SM Calliope/M calliope/SM callisthenics's Callisto/M callosity/MS callousness/SM callous/PGSDY callowness/MS callow/RTSP callus/SDMG Cally/M calming/Y calmness/MS calm/PGTYDRS Cal/MY Caloocan/M caloric/S calorie/SM calorific calorimeter/MS calorimetric calorimetry/M Caltech/M Calumet/M calumet/MS calumniate/NGSDX calumniation/M calumniator/SM calumnious calumny/MS calvary/M Calvary/M calve/GDS Calvert/M calves/M Calvinism/MS Calvinistic Calvinist/MS Calvin/M Calv/M calyces's Calypso/M calypso/SM calyx/MS Ca/M CAM Camacho/M Camala/M camaraderie/SM camber/DMSG cambial cambium/SM Cambodia/M Cambodian/S Cambrian/S cambric/MS Cambridge/M camcorder/S Camden/M camelhair's Camella/M Camellia/M camellia/MS Camel/M Camelopardalis/M Camelot/M camel/SM Camembert/MS cameo/GSDM camerae cameraman/M cameramen camera/MS camerawoman camerawomen Cameron/M Cameroonian/S Cameroon/SM came/N Camey/M Camila/M Camile/M Camilla/M Camille/M Cami/M Camino/M camion/M camisole/MS Cam/M cammed Cammie/M Cammi/M cam/MS Cammy/M Camoens/M camomile's camouflage/DRSGZM camouflager/M campaigner/M campaign/ZMRDSG campanile/SM campanological campanologist/SM campanology/MS Campbell/M Campbellsport/M camper/SM campesinos campest campfire/SM campground/MS camphor/MS Campinas/M camping/S Campos camp's camp/SCGD campsite/MS campus/GSDM campy/RT Camry/M camshaft/SM Camus/M Canaanite/SM Canaan/M Canada/M Canadianism/SM Canadian/S Canad/M Canaletto/M canalization/MS canalize/GSD canal/SGMD canapé/S canard/MS Canaries canary/SM canasta/SM Canaveral/M Canberra/M cancan/SM cancelate/D canceled/U canceler/M cancellation/MS cancel/RDZGS cancer/MS Cancer/MS cancerous/Y Cancun/M Candace/M candelabra/S candelabrum/M Candice/M candidacy/MS Candida/M candidate/SM candidature/S Candide/M candidly/U candidness/SM candid/TRYPS Candie/M Candi/SM candle/GMZRSD candlelight/SMR candlelit candlepower/SM candler/M candlestick/SM Candlewick/M candlewick/MS candor/MS Candra/M candy/GSDM Candy/M canebrake/SM caner/M cane/SM canine/S caning/M Canis/M canister/SGMD cankerous canker/SDMG Can/M can/MDRSZGJ cannabis/MS canned cannelloni canner/SM cannery/MS Cannes cannibalism/MS cannibalistic cannibalization/SM cannibalize/GSD cannibal/SM cannily/U canninesses canniness/UM canning/M cannister/SM cannonade/SDGM cannonball/SGDM Cannon/M cannon/SDMG cannot canny/RPUT canoe/DSGM canoeist/SM Canoga/M canonic canonicalization canonicalize/GSD canonical/SY canonist/M canonization/MS canonized/U canonize/SDG canon/SM Canopus/M canopy/GSDM canst can't cantabile/S Cantabrigian cantaloupe/MS cantankerousness/SM cantankerous/PY cantata/SM cant/CZGSRD canted/IA canteen/MS Canterbury/M canter/CM cantered cantering canticle/SM cantilever/SDMG canto/MS cantonal Cantonese/M Canton/M cantonment/SM canton/MGSLD Cantor/M cantor/MS Cantrell/M cant's cants/A Cantu/M Canute/M canvasback/MS canvas/RSDMG canvasser/M canvass/RSDZG canyon/MS CAP capability/ISM capableness/IM capable/PI capabler capablest capably/I capaciousness/MS capacious/PY capacitance/SM capacitate/V capacitive/Y capacitor/MS capacity/IMS caparison/SDMG Capek/M Capella/M caper/GDM capeskin/SM cape/SM Capet/M Capetown/M Caph/M capillarity/MS capillary/S Capistrano/M capitalism/SM capitalistic capitalistically capitalist/SM capitalization/SMA capitalized/AU capitalizer/M capitalize/RSDGZ capitalizes/A capital/SMY capita/M Capitan/M capitation/CSM Capitoline/M Capitol/MS capitol/SM capitulate/AXNGSD capitulation/MA caplet/S cap/MDRSZB Capone/M capon/SM capo/SM Capote/M capped/UA capping/M cappuccino/MS Cappy/M Capra/M Caprice/M caprice/MS capriciousness/MS capricious/PY Capricorn/MS Capri/M caps/AU capsicum/MS capsize/SDG capstan/MS capstone/MS capsular capsule/MGSD capsulize/GSD captaincy/MS captain/SGDM caption/GSDRM captiousness/SM captious/PY captivate/XGNSD captivation/M captivator/SM captive/MS captivity/SM Capt/M captor/SM capture/AGSD capturer/MS capt/V Capulet/M Caputo/M Caracalla/M Caracas/M caracul's carafe/SM Caralie/M Cara/M caramelize/SDG caramel/MS carapace/SM carapaxes carat/SM Caravaggio/M caravan/DRMGS caravaner/M caravansary/MS caravanserai's caravel/MS caraway/MS carbide/MS carbine/MS carbohydrate/MS carbolic Carboloy/M carbonaceous carbonate/SDXMNG carbonation/M Carbondale/M Carbone/MS carbonic carboniferous Carboniferous carbonization/SAM carbonizer/AS carbonizer's carbonizes/A carbonize/ZGRSD carbon/MS carbonyl/M carborundum Carborundum/MS carboy/MS carbuncle/SDM carbuncular carburetor/MS carburetter/S carburettor/SM carcase/MS carcass/SM Carce/M carcinogenic carcinogenicity/MS carcinogen/SM carcinoma/SM cardamom/MS cardboard/MS card/EDRSG Cardenas/M carder/MS carder's/E cardholders cardiac/S Cardiff/M cardigan/SM cardinality/SM cardinal/SYM carding/M Cardin/M Cardiod/M cardiogram/MS cardiograph/M cardiographs cardioid/M cardiologist/SM cardiology/MS cardiomegaly/M cardiopulmonary cardiovascular card's cardsharp/ZSMR CARE cared/U careen/DSG careerism/M careerist/MS career/SGRDM carefree carefuller carefullest carefulness/MS careful/PY caregiver/S carelessness/MS careless/YP Care/M Carena/M Caren/M carer/M care/S Caresa/M Caressa/M Caresse/M caresser/M caressing/Y caressive/Y caress/SRDMVG caretaker/SM caret/SM careworn Carey/M carfare/MS cargoes cargo/M carhopped carhopping carhop/SM Caria/M Caribbean/S Carib/M caribou/MS caricature/GMSD caricaturisation caricaturist/MS caricaturization Carie/M caries/M carillonned carillonning carillon/SM Caril/M Carilyn/M Cari/M Carina/M Carine/M caring/U Carin/M Cariotta/M carious Carissa/M Carita/M Caritta/M carjack/GSJDRZ Carla/M Carlee/M Carleen/M Carlene/M Carlen/M Carletonian/M Carleton/M Carley/M Carlie/M Carlina/M Carline/M Carling/M Carlin/M Carlita/M Carl/MNG carload/MSG Carlo/SM Carlota/M Carlotta/M Carlsbad/M Carlson/M Carlton/M Carlye/M Carlyle/M Carly/M Carlyn/M Carlynne/M Carlynn/M Carma/M Carmela/M Carmelia/M Carmelina/M Carmelita/M Carmella/M Carmelle/M Carmel/M Carmelo/M Carmencita/M Carmen/M Carmichael/M Carmina/M Carmine/M carmine/MS Carmita/M Car/MNY Carmon/M carnage/MS carnality/SM carnal/Y Carnap/M carnation/IMS Carnegie/M carnelian/SM Carney/M carney's carnival/MS carnivore/SM carnivorousness/MS carnivorous/YP Carnot/M Carny/M carny/SDG carob/SM Carola/M Carolan/M Carolann/M Carolee/M Carole/M caroler/M Carolina/MS Caroline/M Carolingian Carolinian/S Carolin/M Caroljean/M Carol/M carol/SGZMRD Carolus/M Carolyne/M Carolyn/M Carolynn/M Caro/M carom/GSMD Caron/M carotene/MS carotid/MS carousal/MS carousel/MS carouser/M carouse/SRDZG carpal/SM Carpathian/MS carpel/SM carpenter/DSMG carpentering/M Carpenter/M carpentry/MS carper/M carpetbagged carpetbagger/MS carpetbagging carpetbag/MS carpeting/M carpet/MDJGS carpi/M carping/Y carp/MDRSGZ carpool/DGS carport/MS carpus/M carrageen/M Carree/M carrel/SM carriage/SM carriageway/SM Carrie/M carrier/M Carrier/M Carrillo/M Carri/M carrion/SM Carrissa/M Carr/M Carroll/M Carrol/M carrot/MS carroty/RT carrousel's carryall/MS Carry/MR carryout/S carryover/S carry/RSDZG carsickness/SM carsick/P Carson/M cartage/MS cartel/SM carte/M carter/M Carter/M Cartesian Carthage/M Carthaginian/S carthorse/MS Cartier/M cartilage/MS cartilaginous cartload/MS cart/MDRGSZ Cart/MR cartographer/MS cartographic cartography/MS carton/GSDM cartoon/GSDM cartoonist/MS cartridge/SM cartwheel/MRDGS Cartwright/M Carty/RM Caruso/M carve/DSRJGZ carven carver/M Carver/M carving/M caryatid/MS Caryl/M Cary/M Caryn/M car/ZGSMDR casaba/SM Casablanca/M Casals/M Casandra/M Casanova/SM Casar/M casbah/M cascade/MSDG Cascades/M cascara/MS casebook/SM case/DSJMGL cased/U caseharden/SGD casein/SM caseload/MS Case/M casement/SM caseworker/M casework/ZMRS Casey/M cashbook/SM cashew/MS cash/GZMDSR cashier/SDMG cashless Cash/M cashmere/MS Casie/M Casi/M casing/M casino/MS casket/SGMD cask/GSDM Caspar/M Casper/M Caspian Cass Cassandra/SM Cassandre/M Cassandry/M Cassatt/M Cassaundra/M cassava/MS casserole/MGSD cassette/SM Cassey/M cassia/MS Cassie/M Cassi/M cassino's Cassiopeia/M Cassite/M Cassius/M cassock/SDM Cassondra/M cassowary/SM Cassy/M Castaneda/M castanet/SM castaway/SM castellated caste/MHS caster/M cast/GZSJMDR castigate/XGNSD castigation/M castigator/SM Castile's Castillo/M casting/M castle/GMSD castoff/S Castor/M castor's castrate/DSNGX castration/M Castries/M Castro/M casts/A casualness/SM casual/SYP casualty/SM casuistic casuist/MS casuistry/SM cataclysmal cataclysmic cataclysm/MS catacomb/MS catafalque/SM Catalan/MS catalepsy/MS cataleptic/S Catalina/M cataloger/M catalog/SDRMZG Catalonia/M catalpa/SM catalysis/M catalyst/SM catalytic catalytically catalyze/DSG catamaran/MS catapult/MGSD cataract/MS Catarina/M catarrh/M catarrhs catastrophe/SM catastrophic catastrophically catatonia/MS catatonic/S Catawba/M catbird/MS catboat/SM catcall/SMDG catchable/U catchall/MS catch/BRSJLGZ catcher/M catchment/SM catchpenny/S catchphrase/S catchup/MS catchword/MS catchy/TR catechism/MS catechist/SM catechize/SDG catecholamine/MS categoric categorical/Y categorization/MS categorized/AU categorize/RSDGZ category/MS Cate/M catenate/NF catenation/MF catercorner caterer/M cater/GRDZ Caterina/M catering/M Caterpillar caterpillar/SM caterwaul/DSG catfish/MS catgut/SM Catha/M Catharina/M Catharine/M catharses catharsis/M cathartic/S Cathay/M cathedral/SM Cathee/M Catherina/M Catherine/M Catherin/M Cather/M Cathe/RM catheterize/GSD catheter/SM Cathie/M Cathi/M Cathleen/M Cathlene/M cathode/MS cathodic catholicism Catholicism/SM catholicity/MS catholic/MS Catholic/S Cathrine/M Cathrin/M Cathryn/M Cathyleen/M Cathy/M Catie/M Catiline/M Cati/M Catina/M cationic cation/MS catkin/SM Catlaina/M Catlee/M catlike Catlin/M catnapped catnapping catnap/SM catnip/MS Cato/M Catrina/M Catriona/M Catskill/SM cat/SMRZ catsup's cattail/SM catted cattery/M cattily cattiness/SM catting cattle/M cattleman/M cattlemen Catt/M catty/PRST Catullus/M CATV catwalk/MS Caty/M Caucasian/S Caucasoid/S Caucasus/M Cauchy/M caucus/SDMG caudal/Y caught/U cauldron/MS cauliflower/MS caulker/M caulk/JSGZRD causality/SM causal/YS causate/XVN causation/M causative/SY cause/DSRGMZ caused/U causeless causerie/MS causer/M causeway/SGDM caustically causticity/MS caustic/YS cauterization/SM cauterized/U cauterize/GSD cautionary cautioner/M caution/GJDRMSZ cautiousness's/I cautiousness/SM cautious/PIY cavalcade/MS cavalierness/M cavalier/SGYDP cavalryman/M cavalrymen cavalry/MS caveat/SM caveatted caveatting cave/GFRSD caveman/M cavemen Cavendish/M caver/M cavern/GSDM cavernous/Y cave's caviar/MS caviler/M cavil/SJRDGZ caving/MS cavity/MFS cavort/SDG Cavour/M caw/SMDG Caxton/M Caye/M Cayenne/M cayenne/SM Cayla/M Cayman/M cayman/SM cay's cay/SC Cayuga/M cayuse/SM Caz/M Cazzie/M c/B CB CBC Cb/M CBS cc Cchaddie/M CCTV CCU CD CDC/M Cd/M CDT Ce cease/DSCG ceasefire/S ceaselessness/SM ceaseless/YP ceasing/U Ceausescu/M Cebuano/M Cebu/M ceca cecal Cecelia/M Cece/M Cecile/M Ceciley/M Cecilia/M Cecilio/M Cecilius/M Cecilla/M Cecil/M Cecily/M cecum/M cedar/SM ceded/A cede/FRSDG ceder's/F ceder/SM cedes/A cedilla/SM ceding/A Ced/M Cedric/M ceilidh/M ceiling/MDS Ceil/M celandine/MS Celanese/M Celebes's celebrant/MS celebratedness/M celebrated/P celebrate/XSDGN celebration/M celebrator/MS celebratory celebrity/MS Cele/M Celene/M celerity/SM celery/SM Celesta/M celesta/SM Celeste/M celestial/YS Celestia/M Celestina/M Celestine/M Celestyna/M Celestyn/M Celia/M celibacy/MS celibate/SM Celie/M Celina/M Celinda/M Celine/M Celinka/M Celisse/M Celka/M cellarer/M cellar/RDMGS Celle/M cell/GMDS Cellini/M cellist/SM Cello/M cello/MS cellophane/SM cellphone/S cellular/SY cellulite/S celluloid/SM cellulose/SM Celsius/S Celtic/SM Celt/MS cementa cementer/M cementum/SM cement/ZGMRDS cemetery/MS cenobite/MS cenobitic cenotaph/M cenotaphs Cenozoic censer/MS censored/U censor/GDMS censorial censoriousness/MS censorious/YP censorship/MS censure/BRSDZMG censurer/M census/SDMG centaur/SM Centaurus/M centavo/SM centenarian/MS centenary/S centennial/YS center/AC centerboard/SM centered centerer/S centerfold/S centering/SM centerline/SM centerpiece/SM center's Centigrade centigrade/S centigram/SM centiliter/MS centime/SM centimeter/SM centipede/MS Centralia/M centralism/M centralist/M centrality/MS centralization/CAMS centralize/CGSD centralizer/SM centralizes/A central/STRY centrefold's Centrex CENTREX/M centric/F centrifugal/SY centrifugate/NM centrifugation/M centrifuge/GMSD centripetal/Y centrist/MS centroid/MS cent/SZMR centurion/MS century/MS CEO cephalic/S Cepheid Cepheus/M ceramicist/S ceramic/MS ceramist/MS cerate/MD Cerberus/M cereal/MS cerebellar cerebellum/MS cerebra cerebral/SY cerebrate/XSDGN cerebration/M cerebrum/MS cerement/SM ceremonial/YSP ceremoniousness/MS ceremoniousness's/U ceremonious/YUP ceremony/MS Cerenkov/M Ceres/M Cerf/M cerise/SM cerium/MS cermet/SM CERN/M certainer certainest certainty/UMS certain/UY cert/FS certifiable certifiably certificate/SDGM certification/AMC certified/U certifier/M certify/DRSZGNX certiorari/M certitude/ISM cerulean/MS Cervantes/M cervical cervices/M cervix/M Cesarean cesarean/S Cesare/M Cesar/M Cesaro/M cesium/MS cessation/SM cession/FAMSK Cessna/M cesspit/M cesspool/SM Cesya/M cetacean/S cetera/S Cetus/M Ceylonese Ceylon/M Cezanne/S cf CF CFC Cf/M CFO cg Chablis/SM Chaddie/M Chadd/M Chaddy/M Chadian/S Chad/M Chadwick/M chafe/GDSR chafer/M chaffer/DRG chafferer/M Chaffey/M chaff/GRDMS chaffinch/SM Chagall/M chagrin/DGMS Chaim/M chainlike chain's chainsaw/SGD chain/SGUD chairlady/M chairlift/MS chairman/MDGS chairmanship/MS chairmen chairperson/MS chair/SGDM chairwoman/M chairwomen chaise/SM chalcedony/MS Chaldea/M Chaldean/M chalet/SM chalice/DSM chalkboard/SM chalk/DSMG chalkiness/S chalkline chalky/RPT challenged/U challenger/M challenge/ZGSRD challenging/Y challis/SM Chalmers chamberer/M Chamberlain/M chamberlain/MS chambermaid/MS chamberpot/S Chambers/M chamber/SZGDRM chambray/MS chameleon/SM chamfer/DMGS chammy's chamois/DSMG chamomile/MS champagne/MS champaign/M champ/DGSZ champion/MDGS championship/MS Champlain/M chanced/M chance/GMRSD chancellery/SM chancellorship/SM chancellor/SM Chancellorsville/M chancel/SM Chance/M chancery/SM Chancey/M chanciness/S chancing/M chancre/SM chancy/RPT Chandal/M Chanda/M chandelier/SM Chandigarh/M Chandler/M chandler/MS Chandragupta/M Chandra/M Chandrasekhar/M Chandy/M Chanel/M Chane/M Chaney/M Changchun/M changeabilities changeability/UM changeableness/SM changeable/U changeably/U changed/U change/GZRSD changeless changeling/M changeover/SM changer/M changing/U Chang/M Changsha/M Chan/M Channa/M channeler/M channeling/M channelization/SM channelize/GDS channellings channel/MDRZSG Channing/M chanson/SM Chantalle/M Chantal/M chanter/M chanteuse/MS chantey/SM chanticleer/SM Chantilly/M chantry/MS chant/SJGZMRD chanty's Chanukah's Chao/M chaos/SM chaotic chaotically chaparral/MS chapbook/SM chapeau/MS chapel/MS chaperonage/MS chaperoned/U chaperone's chaperon/GMDS chaplaincy/MS chaplain/MS chaplet/SM Chaplin/M Chapman/M chap/MS Chappaquiddick/M chapped chapping chapter/SGDM Chara charabanc/MS characterful characteristically/U characteristic/SM characterizable/MS characterization/MS characterize/DRSBZG characterized/U characterizer/M characterless character/MDSG charade/SM charbroil/SDG charcoal/MGSD Chardonnay chardonnay/S chard/SM chargeableness/M chargeable/P charged/U charge/EGRSDA charger/AME chargers char/GS Charil/M charily chariness/MS Charin/M charioteer/GSDM Chariot/M chariot/SMDG Charis charisma/M charismata charismatically charismatic/S Charissa/M Charisse/M charitablenesses charitableness/UM charitable/UP charitably/U Charita/M Charity/M charity/MS charlady/M Charla/M charlatanism/MS charlatanry/SM charlatan/SM Charlean/M Charleen/M Charlemagne/M Charlena/M Charlene/M Charles/M Charleston/SM Charley/M Charlie/M Charline/M Charlot/M Charlotta/M Charlotte/M Charlottesville/M Charlottetown/M Charlton/M Charmaine/M Charmain/M Charmane/M charmer/M Charmian/M Charmine/M charming/RYT Charmin/M Charmion/M charmless charm/SGMZRD Charolais Charo/M Charon/M charred charring charted/U charter/AGDS chartered/U charterer/SM charter's chartist/SM Chartres/M chartreuse/MS chartroom/S chart/SJMRDGBZ charwoman/M charwomen Charybdis/M Charyl/M chary/PTR Chas chase/DSRGZ Chase/M chaser/M chasing/M Chasity/M chasm/SM chassis/M chastely chasteness/SM chasten/GSD chaste/UTR chastisement/SM chastiser/M chastise/ZGLDRS Chastity/M chastity/SM chastity's/U chasuble/SM Chateaubriand château/M chateaus châteaux châtelaine/SM chat/MS Chattahoochee/M Chattanooga/M chatted chattel/MS chatterbox/MS chatterer/M Chatterley/M chatter/SZGDRY Chatterton/M chattily chattiness/SM chatting chatty/RTP Chaucer/M chauffeur/GSMD Chaunce/M Chauncey/M Chautauqua/M chauvinism/MS chauvinistic chauvinistically chauvinist/MS Chavez/M chaw Chayefsky/M cheapen/DG cheapish cheapness/MS cheapskate/MS cheap/YRNTXSP cheater/M cheat/RDSGZ Chechen/M Chechnya/M checkable/U checkbook/MS checked/UA checkerboard/MS checker/DMG check/GZBSRDM checklist/S checkmate/MSDG checkoff/SM checkout/S checkpoint/MS checkroom/MS check's/A checks/A checksummed checksumming checksum/SM checkup/MS Cheddar/MS cheddar/S cheekbone/SM cheek/DMGS cheekily cheekiness/SM cheeky/PRT cheep/GMDS cheerer/M cheerfuller cheerfullest cheerfulness/MS cheerful/YP cheerily cheeriness/SM cheerio/S Cheerios/M cheerleader/SM cheerlessness/SM cheerless/PY cheers/S cheery/PTR cheer/YRDGZS cheeseburger/SM cheesecake/SM cheesecloth/M cheesecloths cheeseparing/S cheese/SDGM cheesiness/SM cheesy/PRT cheetah/M cheetahs Cheeto/M Cheever/M cheffed cheffing chef/SM Chekhov/M chelate/XDMNG chelation/M Chelsae/M Chelsea/M Chelsey/M Chelsie/M Chelsy/M Chelyabinsk/M chem Che/M chemic chemical/SYM chemiluminescence/M chemiluminescent chemise/SM chemistry/SM chemist/SM chemotherapeutic/S chemotherapy/SM chemurgy/SM Chengdu Cheng/M chenille/SM Chen/M Cheops/M Chere/M Cherey/M Cherianne/M Cherice/M Cherida/M Cherie/M Cherilyn/M Cherilynn/M Cheri/M Cherin/M Cherise/M cherisher/M cherish/GDRS Cherish/M Cheriton/M Cherlyn/M Cher/M Chernenko/M Chernobyl/M Cherokee/MS cheroot/MS Cherri/M Cherrita/M Cherry/M cherry/SM chert/MS cherubic cherubim/S cherub/SM chervil/MS Cherye/M Cheryl/M Chery/M Chesapeake/M Cheshire/M Cheslie/M chessboard/SM chessman/M chessmen chess/SM Chesterfield/M chesterfield/MS Chester/M Chesterton/M chestful/S chest/MRDS chestnut/SM Cheston/M chesty/TR Chet/M Chevalier/M chevalier/SM Cheviot/M cheviot/S Chev/M Chevrolet/M chevron/DMS Chevy/M chewer/M chew/GZSDR chewiness/S chewy/RTP Cheyenne/SM chg chge Chiang/M chianti/M Chianti/S chiaroscuro/SM Chiarra/M Chiba/M Chicagoan/SM Chicago/M Chicana/MS chicane/MGDS chicanery/MS Chicano/MS chichi/RTS chickadee/SM Chickasaw/SM chickenfeed chicken/GDM chickenhearted chickenpox/MS Chickie/M Chick/M chickpea/MS chickweed/MS chick/XSNM Chicky/M chicle/MS Chic/M chicness/S Chico/M chicory/MS chic/SYRPT chide/GDS chiding/Y chiefdom/MS chieftain/SM chief/YRMST chiffonier/MS chiffon/MS chigger/MS chignon/MS Chihuahua/MS chihuahua/S chilblain/MS childbearing/MS childbirth/M childbirths childcare/S childes child/GMYD childhood/MS childishness/SM childish/YP childlessness/SM childless/P childlikeness/M childlike/P childminders childproof/GSD childrearing children/M Chilean/S Chile/MS chile's chilies chili/M chiller/M chilliness/MS chilling/Y chilli's chill/MRDJGTZPS chillness/MS chilly/TPRS Chilton/M Chi/M chimaera's chimaerical Chimborazo/M chime/DSRGMZ Chimera/S chimera/SM chimeric chimerical chimer/M Chimiques chimney/SMD chimpanzee/SM chimp/MS chi/MS Chimu/M Ch'in China/M Chinaman/M Chinamen china/MS Chinatown/SM chinchilla/SM chine/MS Chinese/M Ching/M chink/DMSG chinless Chin/M chinned chinner/S chinning chino/MS Chinook/MS chin/SGDM chinstrap/S chintz/SM chintzy/TR chipboard/M Chipewyan/M Chip/M chipmunk/SM chipped Chippendale/M chipper/DGS Chippewa/MS chipping/MS chip/SM Chiquia/M Chiquita/M chiral Chirico/M chirography/SM chiropodist/SM chiropody/MS chiropractic/MS chiropractor/SM chirp/GDS chirpy/RT chirrup/DGS chiseler/M chisel/ZGSJMDR Chisholm/M Chisinau/M chitchat/SM chitchatted chitchatting chitinous chitin/SM chit/SM Chittagong/M chitterlings chivalric chivalrously/U chivalrousness/MS chivalrous/YP chivalry/SM chive/GMDS chivvy/D chivying chlamydiae chlamydia/S Chloe/M Chloette/M Chlo/M chloral/MS chlorate/M chlordane/MS chloride/MS chlorinated/C chlorinates/C chlorinate/XDSGN chlorination/M chlorine/MS Chloris chlorofluorocarbon/S chloroform/DMSG chlorophyll/SM chloroplast/MS chloroquine/M chm Ch/MGNRS chockablock chock/SGRDM chocoholic/S chocolate/MS chocolaty Choctaw/MS choiceness/M choice/RSMTYP choirboy/MS choirmaster/SM choir/SDMG chokeberry/M chokecherry/SM choke/DSRGZ choker/M chokes/M choking/Y cholera/SM choleric choler/SM cholesterol/SM choline/M cholinesterase/M chomp/DSG Chomsky/M Chongqing choose/GZRS chooser/M choosiness/S choosy/RPT chophouse/SM Chopin/M chopped chopper/SDMG choppily choppiness/MS chopping choppy/RPT chop/S chopstick/SM chorale/MS choral/SY chordal chordata chordate/MS chording/M chord/SGMD chorea/MS chore/DSGNM choreographer/M choreographic choreographically choreographs choreography/MS choreograph/ZGDR chorines chorion/M chorister/SM choroid/S chortler/M chortle/ZGDRS chorus/GDSM chosen/U chose/S Chou/M chowder/SGDM chow/DGMS Chretien/M Chris/M chrism/SM chrissake Chrisse/M Chrissie/M Chrissy/M Christabella/M Christabel/M Christalle/M Christal/M Christa/M Christan/M Christchurch/M Christean/M Christel/M Christendom/MS christened/U christening/SM Christen/M christen/SAGD Christensen/M Christenson/M Christiana/M Christiane/M Christianity/SM Christianize/GSD Christian/MS Christiano/M Christiansen/M Christians/N Christie/SM Christi/M Christina/M Christine/M Christin/M Christlike Christmas/SM Christmastide/SM Christmastime/S Christoffel/M Christoffer/M Christoforo/M Christoper/M Christophe/M Christopher/M Christoph/MR Christophorus/M Christos/M Christ/SMN Christye/M Christyna/M Christy's Chrisy/M chroma/M chromate/M chromatically chromaticism/M chromaticness/M chromatic/PS chromatics/M chromatin/MS chromatogram/MS chromatograph chromatographic chromatography/M chrome/GMSD chromic chromite/M chromium/SM chromosomal chromosome/MS chromosphere/M chronically chronicled/U chronicler/M chronicle/SRDMZG chronic/S chronograph/M chronographs chronography chronological/Y chronologist/MS chronology/MS chronometer/MS chronometric Chrotoem/M chrysalids chrysalis/SM Chrysa/M chrysanthemum/MS Chrysler/M Chrysostom/M Chrystal/M Chrystel/M Chryste/M chubbiness/SM chubby/RTP chub/MS Chucho/M chuck/GSDM chuckhole/SM chuckle/DSG chuckling/Y Chuck/M chuff/DM chugged chugging chug/MS Chukchi/M chukka/S Chumash/M chummed chummily chumminess/MS chumming chum/MS chummy/SRTP chumping/M chump/MDGS Chungking's Chung/M chunkiness/MS chunk/SGDM chunky/RPT chuntering churchgoer/SM churchgoing/SM Churchillian Churchill/M churchliness/M churchly/P churchman/M church/MDSYG churchmen Church/MS churchwarden/SM churchwoman/M churchwomen churchyard/SM churlishness/SM churlish/YP churl/SM churner/M churning/M churn/SGZRDM chute/DSGM chutney/MS chutzpah/M chutzpahs chutzpa/SM Chuvash/M ch/VT chyme/SM Ci CIA ciao/S cicada/MS cicatrice/S cicatrix's Cicely/M Cicero/M cicerone/MS ciceroni Ciceronian Cicily/M CID cider's/C cider/SM Cid/M Ciel/M cigarette/MS cigarillo/MS cigar/SM cilantro/S cilia/M ciliate/FDS ciliately cilium/M Cilka/M cinch/MSDG cinchona/SM Cincinnati/M cincture/MGSD Cinda/M Cindee/M Cindelyn/M cinder/DMGS Cinderella/MS Cindie/M Cindi/M Cindra/M Cindy/M cine/M cinema/SM cinematic cinematographer/MS cinematographic cinematography/MS Cinerama/M cinnabar/MS Cinnamon/M cinnamon/MS ciphered/C cipher/MSGD ciphers/C cir circa circadian Circe/M circler/M circle/RSDGM circlet/MS circuital circuit/GSMD circuitousness/MS circuitous/YP circuitry/SM circuity/MS circulant circularity/SM circularize/GSD circularness/M circular/PSMY circulate/ASDNG circulation/MA circulations circulative circulatory circumcise/DRSXNG circumcised/U circumciser/M circumcision/M circumference/SM circumferential/Y circumflex/MSDG circumlocution/MS circumlocutory circumnavigate/DSNGX circumnavigational circumnavigation/M circumpolar circumscribe/GSD circumscription/SM circumspection/SM circumspect/Y circumsphere circumstance/SDMG circumstantial/YS circumvention/MS circumvent/SBGD circus/SM Cirillo/M Cirilo/M Ciro/M cirque/SM cirrhoses cirrhosis/M cirrhotic/S cirri/M cirrus/M Cissiee/M Cissy/M cistern/SM citadel/SM citations/I citation/SMA cit/DSG cite/ISDAG Citibank/M citified citizenry/SM citizenship/MS citizen/SYM citrate/DM citric Citroen/M citronella/MS citron/MS citrus/SM city/DSM cityscape/MS citywide civet/SM civic/S civics/M civilian/SM civility/IMS civilizational/MS civilization/AMS civilizedness/M civilized/PU civilize/DRSZG civilizer/M civilizes/AU civil/UY civvies ck/C clack/SDG cladding/SM clads clad/U Claiborne/M Claiborn/M claimable claimant/MS claim/CDRSKAEGZ claimed/U claimer/KMACE Claire/M Clair/M Clairol/M clairvoyance/MS clairvoyant/YS clambake/MS clamberer/M clamber/SDRZG clammed clammily clamminess/MS clamming clam/MS clammy/TPR clamorer/M clamor/GDRMSZ clamorousness/UM clamorous/PUY clampdown/SM clamper/M clamp/MRDGS clamshell/MS Clancy/M clandestineness/M clandestine/YP clanger/M clangor/MDSG clangorous/Y clang/SGZRD clanking/Y clank/SGDM clan/MS clannishness/SM clannish/PY clansman/M clansmen clapboard/SDGM Clapeyron/M clapped clapper/GMDS clapping clap/S Clapton/M claptrap/SM claque/MS Clarabelle/M Clara/M Clarance/M Clare/M Claremont/M Clarence/M Clarendon/M Claresta/M Clareta/M claret/MDGS Claretta/M Clarette/M Clarey/M Claribel/M Clarice/M Clarie/M clarification/M clarifier/M clarify/NGXDRS Clari/M Clarinda/M Clarine/M clarinetist/SM clarinet/SM clarinettist's clarion/GSMD Clarissa/M Clarisse/M Clarita/M clarities clarity/UM Clarke/M Clark/M Clarridge/M Clary/M clasher/M clash/RSDG clasped/M clasper/M clasp's clasp/UGSD classer/M class/GRSDM classical/Y classicism/SM classicist/SM classic/S classics/M classifiable/U classification/AMC classificatory classified/S classifier/SM classify/CNXASDG classiness/SM classless/P classmate/MS classroom/MS classwork/M classy/PRT clatterer/M clattering/Y clatter/SGDR clattery Claudelle/M Claudell/M Claude/M Claudetta/M Claudette/M Claudia/M Claudian/M Claudianus/M Claudie/M Claudina/M Claudine/M Claudio/M Claudius/M clausal clause/MS Clausen/M Clausewitz/M Clausius/M Claus/NM claustrophobia/SM claustrophobic clave/RM clave's/F clavichord/SM clavicle/MS clavier/MS clawer/M claw/GDRMS Clayborne/M Clayborn/M Claybourne/M clayey clayier clayiest Clay/M clay/MDGS claymore/MS Clayson/M Clayton/M Clea/M cleanable cleaner/MS cleaning/SM cleanliness/UMS cleanly/PRTU cleanness/MSU cleanse cleanser/M cleans/GDRSZ cleanup/MS clean/UYRDPT clearance/MS clearcut clearer/M clearheadedness/M clearheaded/PY clearinghouse/S clearing/MS clearly clearness/MS clears clear/UTRD Clearwater/M clearway/M cleat/MDSG cleavage/MS cleaver/M cleave/RSDGZ Cleavland/M clef/SM cleft/MDGS clematis/MS clemence Clemenceau/M Clemence/M clemency/ISM Clemente/M Clementia/M Clementina/M Clementine/M Clementius/M clement/IY Clement/MS clements Clemmie/M Clemmy/M Clemons Clemson/M Clem/XM clenches clenching clench/UD Cleo/M Cleon/M Cleopatra/M Clerc/M clerestory/MS clergyman/M clergymen clergy/MS clergywoman clergywomen clericalism/SM clerical/YS cleric/SM Clerissa/M clerk/SGYDM clerkship/MS Cletis Cletus/M Cleveland/M Cleve/M cleverness/SM clever/RYPT Clevey/M Clevie/M clevis/SM clew/DMGS cl/GJ Cliburn/M clichéd cliché/SM clicker/M click/GZSRDM clientèle/SM client/SM cliffhanger/MS cliffhanging Cliff/M Clifford/M cliff/SM Clifton/M climacteric/SM climactic climate/MS climatic climatically climatological/Y climatologist/SM climatology/MS climax/MDSG climbable/U climb/BGZSJRD climbdown climbed/U climber/M clime/SM Clim/M clinch/DRSZG clincher/M clinching/Y Cline/M clinger/MS clinging cling/U clingy/TR clinical/Y clinician/MS clinic/MS clinker/GMD clink/RDGSZ clinometer/MIS Clint/M Clinton/M Clio/M cliometrician/S cliometric/S clipboard/SM clipped/U clipper/MS clipping/SM clip/SM clique/SDGM cliquey cliquier cliquiest cliquishness/SM cliquish/YP clitoral clitorides clitoris/MS Clive/M cloacae cloaca/M cloakroom/MS cloak's cloak/USDG clobber/DGS cloche/MS clocker/M clockmaker/M clock/SGZRDMJ clockwatcher clockwise clockwork/MS clodded clodding cloddishness/M cloddish/P clodhopper/SM clod/MS Cloe/M clogged/U clogging/U clog's clog/US cloisonné cloisonnes cloister/MDGS cloistral Clo/M clomp/MDSG clonal clone/DSRGMZ clonk/SGD clopped clopping clop/S Cloris/M closed/U close/EDSRG closefisted closely closemouthed closeness/MS closeout/MS closer/EM closers closest closet/MDSG closeup/S closing/S closured closure/EMS closure's/I closuring clothbound clothesbrush clotheshorse/MS clothesline/SDGM clothesman clothesmen clothespin/MS clothe/UDSG cloth/GJMSD clothier/MS clothing/M Clotho/M cloths Clotilda/M clot/MS clotted clotting cloture/MDSG cloudburst/MS clouded/U cloudiness/SM cloudlessness/M cloudless/YP cloudscape/SM cloud/SGMD cloudy/TPR clout/GSMD cloven cloverleaf/MS clover/M clove/SRMZ Clovis/M clown/DMSG clownishness/SM clownish/PY cloy/DSG cloying/Y clubbed/M clubbing/M clubfeet clubfoot/DM clubhouse/SM club/MS clubroom/SM cluck/GSDM clueless clue/MGDS Cluj/M clump/MDGS clumpy/RT clumsily clumsiness/MS clumsy/PRT clung clunk/SGZRDM clunky/PRYT clustered/AU clusters/A cluster/SGJMD clutch/DSG cluttered/U clutter/GSD Cl/VM Clyde/M Clydesdale/M Cly/M Clytemnestra/M Clyve/M Clywd/M cm Cm/M CMOS cnidarian/MS CNN CNS CO coacher/M coachman/M coachmen coach/MSRDG coachwork/M coadjutor/MS coagulable coagulant/SM coagulate/GNXSD coagulation/M coagulator/S coaler/M coalesce/GDS coalescence/SM coalescent coalface/SM coalfield/MS coalitionist/SM coalition/MS coal/MDRGS coalminers coarseness/SM coarsen/SGD coarse/TYRP coastal coaster/M coastguard/MS coastline/SM coast/SMRDGZ coated/U Coates/M coating/M coat/MDRGZJS coattail/S coattest coauthor/MDGS coaxer/M coax/GZDSR coaxial/Y coaxing/Y Cobain/M cobalt/MS cobbed Cobbie/M cobbing cobbler/M cobble/SRDGMZ cobblestone/MSD Cobb/M Cobby/M coble/M Cob/M COBOL Cobol/M cobra/MS cob/SM cobwebbed cobwebbing cobwebby/RT cobweb/SM cocaine/MS coca/MS cocci/MS coccus/M coccyges coccyx/M Cochabamba/M cochineal/SM Cochin/M Cochise/M cochleae cochlear cochlea/SM Cochran/M cockade/SM cockamamie cockatoo/SM cockatrice/MS cockcrow/MS cockerel/MS cocker/M cockeye/DM cockeyed/PY cockfighting/M cockfight/MJSG cock/GDRMS cockily cockiness/MS cocklebur/M cockle/SDGM cockleshell/SM Cockney cockney/MS cockpit/MS cockroach/SM cockscomb/SM cockshies cocksucker/S! cocksure cocktail/GDMS cocky/RPT cocoa/SM coco/MS coconut/SM cocoon/GDMS Cocteau/M COD coda/SM codded codding coddle/GSRD coddler/M codebook/S codebreak/R coded/UA Codee/M codeine/MS codename/D codependency/S codependent/S coder/CM code's co/DES codes/A code/SCZGJRD codetermine/S codeword/SM codex/M codfish/SM codger/MS codices/M codicil/SM Codie/M codification/M codifier/M codify/NZXGRSD Codi/M coding/M codling/M Cod/M cod/MDRSZGJ codpiece/MS Cody/M coedited coediting coeditor/MS coedits coed/SM coeducational coeducation/SM coefficient/SYM coelenterate/MS coequal/SY coercer/M coerce/SRDXVGNZ coercible/I coercion/M coerciveness/M coercive/PY coeval/YS coexistence/MS coexistent coexist/GDS coextensive/Y cofactor/MS coffeecake/SM coffeecup coffeehouse/SM coffeemaker/S coffeepot/MS coffee/SM cofferdam/SM coffer/DMSG Coffey/M coffin/DMGS Coffman/M cogency/MS cogent/Y cogged cogging cogitate/DSXNGV cogitation/M cogitator/MS cog/MS Cognac/M cognac/SM cognate/SXYN cognation/M cognitional cognition/SAM cognitive/SY cognizable cognizance/MAI cognizances/A cognizant/I cognomen/SM cognoscente cognoscenti cogwheel/SM cohabitant/MS cohabitational cohabitation/SM cohabit/SDG Cohan/M coheir/MS Cohen/M cohere/GSRD coherence/SIM coherencies coherency/I coherent/IY coherer/M cohesion/MS cohesiveness/SM cohesive/PY Cohn/M cohoes coho/MS cohort/SM coiffed coiffing coiffure/MGSD coif/SM coil/UGSAD Coimbatore/M coinage's/A coinage/SM coincide/GSD coincidence/MS coincidental/Y coincident/Y coined/U coiner/M coin/GZSDRM coinsurance/SM Cointon/M cointreau coital/Y coitus/SM coke/MGDS Coke/MS COL COLA colander/SM Colan/M Colas cola/SM colatitude/MS Colbert/M Colby/M coldblooded coldish coldness/MS cold/YRPST Coleen/M Cole/M Coleman/M Colene/M Coleridge/M coleslaw/SM Colet/M Coletta/M Colette/M coleus/SM Colfax/M Colgate/M colicky colic/SM coliform Colin/M coliseum/SM colitis/MS collaborate/VGNXSD collaboration/M collaborative/SY collaborator/SM collage/MGSD collagen/M collapse/SDG collapsibility/M collapsible collarbone/MS collar/DMGS collard/SM collarless collated/U collateral/SYM collate/SDVNGX collation/M collator/MS colleague/SDGM collectedness/M collected/PY collectible/S collection/AMS collective/SY collectivism/SM collectivist/MS collectivity/MS collectivization/MS collectivize/DSG collector/MS collect/SAGD Colleen/M colleen/SM college/SM collegiality/S collegian/SM collegiate/Y Collen/M Collete/M Collette/M coll/G collide/SDG Collie/M collie/MZSRD collier/M Collier/M colliery/MS collimate/C collimated/U collimates collimating collimation/M collimator/M collinear collinearity/M Colline/M Collin/MS collisional collision/SM collocate/XSDGN collocation/M colloidal/Y colloid/MS colloq colloquialism/MS colloquial/SY colloquies colloquium/SM colloquy/M collude/SDG collusion/SM collusive collying Colly/RM Colman/M Col/MY Cologne/M cologne/MSD Colo/M Colombia/M Colombian/S Colombo/M colonelcy/MS colonel/MS colonialism/MS colonialist/MS colonial/SPY colonist/SM colonization/ACSM colonize/ACSDG colonized/U colonizer/MS colonizes/U Colon/M colonnade/MSD colon/SM colony/SM colophon/SM Coloradan/S Coloradoan/S Colorado/M colorant/SM coloration/EMS coloratura/SM colorblindness/S colorblind/P colored/USE colorer/M colorfastness/SM colorfast/P colorfulness/MS colorful/PY colorimeter/SM colorimetry coloring/M colorization/S colorize/GSD colorizing/C colorlessness/SM colorless/PY colors/EA color/SRDMGZJ colossal/Y Colosseum/M colossi colossus/M colostomy/SM colostrum/SM col/SD colter/M coltishness/M coltish/PY Colt/M colt/MRS Coltrane/M Columbia/M Columbian Columbine/M columbine/SM Columbus/M columnar columnist/MS columnize/GSD column/SDM Colver/M Co/M comae comaker/SM Comanche/MS coma/SM comatose combatant/SM combativeness/MS combative/PY combat/SVGMD combed/U comber/M combinational/A combination/ASM combinatorial/Y combinatoric/S combinator/SM combined/AU combiner/M combines/A combine/ZGBRSD combining/A combo/MS comb/SGZDRMJ Combs/M combusted combustibility/SM combustible/SI combustion/MS combustive Comdex/M Comdr/M comeback/SM comedian/SM comedic comedienne/SM comedown/MS comedy/SM come/IZSRGJ comeliness/SM comely/TPR comer/IM comes/M comestible/MS cometary cometh comet/SM comeuppance/SM comfit's comfit/SE comfortability/S comfortableness/MS comfortable/U comfortably/U comforted/U comforter/MS comfort/ESMDG comforting/YE comfy/RT comicality/MS comical/Y comic/MS Cominform/M comity/SM com/LJRTZG comm Com/M comma/MS commandant/MS commandeer/SDG commander/M commanding/Y commandment/SM commando/SM command/SZRDMGL commemorate/SDVNGX commemoration/M commemorative/YS commemorator/S commence/ALDSG commencement/AMS commencer/M commendably commendation/ASM commendatory/A commender/AM commend/GSADRB commensurable/I commensurate/IY commensurates commensuration/SM commentary/MS commentate/GSD commentator/SM commenter/M comment's comment/SUGD commerce/MGSD commercialism/MS commercialization/SM commercialize/GSD commercial/PYS Commie commie/SM commingle/GSD commiserate/VGNXSD commiseration/M commissariat/MS commissar/MS commissary/MS commission/ASCGD commissioner/SM commission's/A commitment/SM commit/SA committable committal/MA committals committed/UA committeeman/M committeemen committee/MS committeewoman/M committeewomen committing/A commode/MS commodes/IE commodiousness/MI commodious/YIP commodity/MS commodore/SM commonality/MS commonalty/MS commoner/MS commonness/MSU commonplaceness/M commonplace/SP common/RYUPT commonsense commons/M Commons/M commonweal/SHM commonwealth/M Commonwealth/M commonwealths Commonwealths commotion/MS communality/M communal/Y commune/XSDNG communicability/MS communicable/IU communicably communicant/MS communicate/VNGXSD communicational communication/M communicativeness/M communicative/PY communicator/SM communion/M Communion/SM communique/S communism/MS Communism/S communistic communist/MS Communist/S communitarian/M community/MS communize/SDG commutable/I commutate/XVGNSD commutation/M commutative/Y commutativity commutator/MS commute/BZGRSD commuter/M Comoros compaction/M compactness/MS compactor/MS compact/TZGSPRDY companionableness/M companionable/P companionably companion/GBSMD companionship/MS companionway/MS company/MSDG Compaq/M comparabilities comparability/IM comparableness/M comparable/P comparably/I comparativeness/M comparative/PYS comparator/SM compare/GRSDB comparer/M comparison/MS compartmental compartmentalization/SM compartmentalize/DSG compartment/SDMG compassionateness/M compassionate/PSDGY compassion/MS compass/MSDG compatibility/IMS compatibleness/M compatible/SI compatibly/I compatriot/SM compeer/DSGM compellable compelled compelling/YM compel/S compendious compendium/MS compensable compensated/U compensate/XVNGSD compensation/M compensator/M compensatory compete/GSD competence/ISM competency/IS competency's competent/IY competition/SM competitiveness/SM competitive/YP competitor/MS comp/GSYD compilable/U compilation/SAM compile/ASDCG compiler/CS compiler's complacence/S complacency/SM complacent/Y complainant/MS complainer/M complain/GZRDS complaining/YU complaint/MS complaisance/SM complaisant/Y complected complementariness/M complementarity complementary/SP complementation/M complementer/M complement/ZSMRDG complete/BTYVNGPRSDX completed/U completely/I completeness/ISM completer/M completion/MI complexional complexion/DMS complexity/MS complexness/M complex/TGPRSDY compliance/SM compliant/Y complicatedness/M complicated/YP complicate/SDG complication/M complicator/SM complicit complicity/MS complier/M complimentary/U complimenter/M compliment/ZSMRDG comply/ZXRSDNG component/SM comport/GLSD comportment/SM compose/CGASDE composedness/M composed/PY composer/CM composers composite/YSDXNG compositional/Y composition/CMA compositions/C compositor/MS compost/DMGS composure/ESM compote/MS compounded/U compounder/M compound/RDMBGS comprehend/DGS comprehending/U comprehensibility/SIM comprehensibleness/IM comprehensible/PI comprehensibly/I comprehension/IMS comprehensiveness/SM comprehensive/YPS compressed/Y compressibility/IM compressible/I compressional compression/CSM compressive/Y compressor/MS compress/SDUGC comprise/GSD compromiser/M compromise/SRDGMZ compromising/UY Compton/M comptroller/SM compulsion/SM compulsiveness/MS compulsive/PYS compulsivity compulsorily compulsory/S compunction/MS Compuserve/M CompuServe/M computability/M computable/UI computably computational/Y computation/SM computed/A computerese computerization/MS computerize/SDG computer/M compute/RSDZBG computes/A computing/A comradely/P comradeship/MS comrade/YMS Comte/M Conakry/M Conan/M Conant/M concatenate/XSDG concaveness/MS concave/YP conceal/BSZGRDL concealed/U concealer/M concealing/Y concealment/MS conceded/Y conceitedness/SM conceited/YP conceit/SGDM conceivable/IU conceivably/I conceive/BGRSD conceiver/M concentrate/VNGSDX concentration/M concentrator/MS concentrically Concepción/M conceptional conception/MS concept/SVM conceptuality/M conceptualization/A conceptualizations conceptualization's conceptualize/DRSG conceptualizing/A conceptual/Y concerned/YU concern/USGD concerted/PY concert/EDSG concertina/MDGS concertize/GDS concertmaster/MS concerto/SM concert's concessionaire/SM concessional concessionary concession/R Concetta/M Concettina/M Conchita/M conch/MDG conchs concierge/SM conciliar conciliate/GNVX conciliation/ASM conciliator/MS conciliatory/A conciseness/SM concise/TYRNPX concision/M conclave/S concluder/M conclude/RSDG conclusion/SM conclusive/IPY conclusiveness/ISM concocter/M concoction/SM concoct/RDVGS concomitant/YS concordance/MS concordant/Y concordat/SM Concorde/M Concordia/M Concord/MS concourse concreteness/MS concrete/NGXRSDPYM concretion/M concubinage/SM concubine/SM concupiscence/SM concupiscent concurrence/MS concur/S concussion/MS concuss/VD condemnate/XN condemnation/M condemnatory condemner/M condemn/ZSGRDB condensate/NMXS condensation/M condenser/M condense/ZGSD condensible condescend condescending/Y condescension/MS condign condiment/SM condition/AGSJD conditionals conditional/UY conditioned/U conditioner/MS conditioning/M condition's condole condolence/MS condominium/MS condom/SM condone/GRSD condoner/M Condorcet/M condor/MS condo/SM conduce/VGSD conduciveness/M conducive/P conductance/SM conductibility/SM conductible conduction/MS conductive/Y conductivity/MS conductor/MS conductress/MS conduct/V conduit/MS coneflower/M Conestoga coney's confabbed confabbing confab/MS confabulate/XSDGN confabulation/M confectioner/M confectionery/SM confectionist confection/RDMGZS confect/S Confederacy/M confederacy/MS confederate/M Confederate/S conferee/MS conference/DSGM conferrable conferral/SM conferred conferrer/SM conferring confer/SB confessed/Y confessional/SY confession/MS confessor/SM confetti/M confidante/SM confidant/SM confidence/SM confidentiality/MS confidentialness/M confidential/PY confident/Y confider/M confide/ZGRSD confiding/PY configuration/ASM configure/AGSDB confined/U confine/L confinement/MS confiner/M confirm/AGDS confirmation/ASM confirmatory confirmedness/M confirmed/YP confiscate/DSGNX confiscation/M confiscator/MS confiscatory conflagration/MS conflate/NGSDX conflation/M conflicting/Y conflict/SVGDM confluence/MS conformable/U conformal conformance/SM conformational/Y conform/B conformer/M conformism/SM conformist/SM conformities conformity/MUI confounded/Y confound/R confrère/MS confrontational confrontation/SM confronter/M confront/Z Confucianism/SM Confucian/S Confucius/M confusedness/M confused/PY confuse/RBZ confusing/Y confutation/MS confute/GRSD confuter/M conga/MDG congeal/GSDL congealment/MS congeniality/UM congenial/U congeries/M conger/SM congestion/MS congest/VGSD conglomerate/XDSNGVM conglomeration/M Cong/M Congolese Congo/M congrats congratulate/NGXSD congratulation/M congratulatory congregate/DSXGN congregational Congregational congregationalism/MS congregationalist/MS Congregationalist/S congregation/M congressional/Y congressman/M congressmen Congress/MS congress/MSDG congresspeople congressperson/S congresswoman/M congresswomen Congreve/M congruence/IM congruences congruency/M congruential congruent/YI congruity/MSI congruousness/IM congruous/YIP conicalness/M conical/PSY conic/S conics/M conifer/MS coniferous conjectural/Y conjecture/GMDRS conjecturer/M conjoint conjugacy conjugal/Y conjugate/XVNGYSDP conjugation/M conjunct/DSV conjunctiva/MS conjunctive/YS conjunctivitis/SM conjuration/MS conjurer/M conjure/RSDZG conjuring/M conker/M conk/ZDR Conley/M Con/M conman connect/ADGES connectedly/E connectedness/ME connected/U connectible Connecticut/M connection/AME connectionless connections/E connective/SYM connectivity/MS connector/MS Connelly/M Conner/M Connery/M connexion/MS Conney/M conn/GVDR Connie/M Conni/M conniption/MS connivance/MS conniver/M connive/ZGRSD connoisseur/MS Connor/SM connotative/Y Conn/RM connubial/Y Conny/M conquerable/U conquered/AU conqueror/MS conquer/RDSBZG conquers/A conquest/ASM conquistador/MS Conrade/M Conrad/M Conrado/M Conrail/M Conroy/M Consalve/M consanguineous/Y consanguinity/SM conscienceless conscientiousness/MS conscientious/YP conscionable/U consciousness/MUS conscious/UYSP conscription/SM consecrated/AU consecrates/A consecrate/XDSNGV consecrating/A consecration/AMS consecutiveness/M consecutive/YP consensus/SM consenter/M consenting/Y consent/SZGRD consequence consequentiality/S consequential/IY consequentialness/M consequently/I consequent/PSY conservancy/SM conservationism conservationist/SM conservation/SM conservatism/SM conservativeness/M Conservative/S conservative/SYP conservator/MS conservatory/MS con/SGM considerable/I considerables considerably/I considerateness/MSI considerate/XIPNY consideration/ASMI considered/U considerer/M consider/GASD considering/S consign/ASGD consignee/SM consignment/SM consist/DSG consistence/S consistency/IMS consistent/IY consistory/MS consolable/I Consolata/M consolation/MS consolation's/E consolatory consoled/U consoler/M console/ZBG consolidated/AU consolidate/NGDSX consolidates/A consolidation/M consolidator/SM consoling/Y consommé/S consonance/IM consonances consonantal consonant/MYS consortia consortium/M conspectus/MS conspicuousness/IMS conspicuous/YIP conspiracy/MS conspiratorial/Y conspirator/SM constable Constable/M constabulary/MS constance Constance/M Constancia/M constancy/IMS Constancy/M Constanta/M Constantia/M Constantina/M Constantine/M Constantin/M Constantino/M Constantinople/M constant/IY constants constellation/SM consternate/XNGSD consternation/M constipate/XDSNG constipation/M constituency/MS constituent/SYM constituted/A constitute/NGVXDS constitutes/A constituting/A Constitution constitutionality's constitutionality/US constitutionally/U constitutional/SY constitution/AMS constitutive/Y constrain constrainedly constrained/U constraint/MS constriction/MS constrictor/MS constrict/SDGV construable construct/ASDGV constructibility constructible/A constructional/Y constructionist/MS construction/MAS constructions/C constructiveness/SM constructive/YP constructor/MS construe/GSD Consuela/M Consuelo/M consular/S consulate/MS consul/KMS consulship/MS consultancy/S consultant/MS consultation/SM consultative consulted/A consulter/M consult/RDVGS consumable/S consumed/Y consume/JZGSDB consumerism/MS consumerist/S consumer/M consuming/Y consummate/DSGVY consummated/U consumption/SM consumptive/YS cont contact/BGD contacted/A contact's/A contacts/A contagion/SM contagiousness/MS contagious/YP containerization/SM containerize/GSD container/M containment/SM contain/SLZGBRD contaminant/SM contaminated/AU contaminates/A contaminate/SDCXNG contaminating/A contamination/CM contaminative contaminator/MS contd cont'd contemn/SGD contemplate/DVNGX contemplation/M contemplativeness/M contemplative/PSY contemporaneity/MS contemporaneousness/M contemporaneous/PY contemptibleness/M contemptible/P contemptibly contempt/M contemptuousness/SM contemptuous/PY contentedly/E contentedness/SM contented/YP content/EMDLSG contention/MS contentiousness/SM contentious/PY contently contentment/ES contentment's conterminous/Y contestable/I contestant/SM contested/U contextualize/GDS contiguity/MS contiguousness/M contiguous/YP continence/ISM Continental/S continental/SY continent/IY Continent/M continents continent's contingency/SM contingent/SMY continua continuable continual/Y continuance/ESM continuant/M continuation/ESM continue/ESDG continuer/M continuity/SEM continuousness/M continuous/YE continuum/M contortionist/SM contortion/MS contort/VGD contour contraband/SM contrabass/M contraception/SM contraceptive/S contract/DG contractible contractile contractual/Y contradict/GDS contradiction/MS contradictorily contradictoriness/M contradictory/PS contradistinction/MS contraflow/S contrail/M contraindicate/SDVNGX contraindication/M contralto/SM contrapositive/S contraption/MS contrapuntal/Y contrariety/MS contrarily contrariness/MS contrariwise contrary/PS contra/S contrasting/Y contrastive/Y contrast/SRDVGZ contravene/GSRD contravener/M contravention/MS Contreras/M contretemps/M contribute/XVNZRD contribution/M contributive/Y contributorily contributor/SM contributory/S contriteness/M contrite/NXP contrition/M contrivance/SM contriver/M contrive/ZGRSD control/CS controllability/M controllable/IU controllably/U controlled/CU controller/SM controlling/C control's controversialists controversial/UY controversy/MS controvert/DGS controvertible/I contumacious/Y contumacy/MS contumelious contumely/MS contuse/NGXSD contusion/M conundrum/SM conurbation/MS convalesce/GDS convalescence/SM convalescent/S convect/DSVG convectional convection/MS convector convene/ASDG convener/MS convenience/ISM convenient/IY conventicle/SM conventionalism/M conventionalist/M conventionality/SUM conventionalize/GDS conventional/UY convention/MA conventions convergence/MS convergent conversant/Y conversationalist/SM conversational/Y conversation/SM conversazione/M converse/Y conversion/AM conversioning converted/U converter/MS convert/GADS convertibility's/I convertibility/SM convertibleness/M convertible/PS convexity/MS convex/Y conveyance/DRSGMZ conveyancer/M conveyancing/M convey/BDGS conveyor/MS conviction/MS convict/SVGD convinced/U convincer/M convince/RSDZG convincingness/M convincing/PUY conviviality/MS convivial/Y convoke/GSD convolute/XDNY convolution/M convolve/C convolved convolves convolving convoy/GMDS convulse/SDXVNG convulsion/M convulsiveness/M convulsive/YP Conway/M cony/SM coo/GSD cookbook/SM cooked/AU Cooke/M cooker/M cookery/MS cook/GZDRMJS Cookie/M cookie/SM cooking/M Cook/M cookout/SM cooks/A cookware/SM cooky's coolant/SM cooled/U cooler/M Cooley/M coolheaded Coolidge/M coolie/MS coolness/MS cool/YDRPJGZTS coon/MS! coonskin/MS cooperage/MS cooperate/VNGXSD cooperation/M cooperativeness/SM cooperative/PSY cooperator/MS cooper/GDM Cooper/M coop/MDRGZS Coop/MR coordinated/U coordinateness/M coordinate/XNGVYPDS coordination/M coordinator/MS Coors/M cootie/SM coot/MS copay/S Copeland/M Copenhagen/M coper/M Copernican Copernicus/M cope/S copied/A copier/M copies/A copilot/SM coping/M copiousness/SM copious/YP coplanar Copland/M Copley/M copolymer/MS copora copped Copperfield/M copperhead/MS copper/MSGD copperplate/MS coppersmith/M coppersmiths coppery coppice's copping Coppola/M copra/MS coprolite/M coprophagous copse/M cops/GDS cop/SJMDRG copter/SM Coptic/M copula/MS copulate/XDSNGV copulation/M copulative/S copybook/MS copycat/SM copycatted copycatting copyist/SM copy/MZBDSRG copyrighter/M copyright/MSRDGZ copywriter/MS coquetry/MS coquette/DSMG coquettish/Y Corabella/M Corabelle/M Corabel/M coracle/SM Coralie/M Coraline/M coralline Coral/M coral/SM Coralyn/M Cora/M corbel/GMDJS Corbet/M Corbett/M Corbie/M Corbin/M Corby/M cordage/MS corded/AE Cordelia/M Cordelie/M Cordell/M corder/AM Cordey/M cord/FSAEM cordiality/MS cordialness/M cordial/PYS Cordie/M cordillera/MS Cordilleras Cordi/M cording/MA cordite/MS cordless Cord/M Cordoba cordon/DMSG cordovan/SM Cordula/M corduroy/GDMS Cordy/M cored/A Coreen/M Corella/M core/MZGDRS Corenda/M Corene/M corer/M corespondent/MS Coretta/M Corette/M Corey/M Corfu/M corgi/MS coriander/SM Corie/M Corilla/M Cori/M Corina/M Corine/M coring/M Corinna/M Corinne/M Corinthian/S Corinthians/M Corinth/M Coriolanus/M Coriolis/M Corissa/M Coriss/M corked/U corker/M cork/GZDRMS Cork/M corkscrew/DMGS corks/U Corliss/M Corly/M Cormack/M corm/MS cormorant/MS Cornall/M cornball/SM cornbread/S corncob/SM corncrake/M corneal cornea/SM Corneille/M Cornela/M Cornelia/M Cornelius/M Cornelle/M Cornell/M corner/GDM cornerstone/MS cornet/SM Corney/M cornfield/SM cornflake/S cornflour/M cornflower/SM corn/GZDRMS cornice/GSDM Cornie/M cornily corniness/S Cornish/S cornmeal/S cornrow/GDS cornstalk/MS cornstarch/SM cornucopia/MS Cornwallis/M Cornwall/M Corny/M corny/RPT corolla/MS corollary/SM Coronado/M coronal/MS coronary/S corona/SM coronate/NX coronation/M coroner/MS coronet/DMS Corot/M coroutine/SM Corp corporal/SYM corpora/MS corporate/INVXS corporately corporation/MI corporatism/M corporatist corporeality/MS corporeal/IY corporealness/M corp/S corpse/M corpsman/M corpsmen corps/SM corpulence/MS corpulentness/S corpulent/YP corpuscle/SM corpuscular corpus/M corr corralled corralling corral/MS correctable/U correct/BPSDRYTGV corrected/U correctional correction/MS corrective/YPS correctly/I correctness/MSI corrector/MS Correggio/M correlated/U correlate/SDXVNG correlation/M correlative/YS Correna/M correspond/DSG correspondence/MS correspondent/SM corresponding/Y Correy/M Corrianne/M corridor/SM Corrie/M corrigenda corrigendum/M corrigible/I Corri/M Corrina/M Corrine/M Corrinne/M corroborated/U corroborate/GNVXDS corroboration/M corroborative/Y corroborator/MS corroboratory corrode/SDG corrodible corrosion/SM corrosiveness/M corrosive/YPS corrugate/NGXSD corrugation/M corrupt/DRYPTSGV corrupted/U corrupter/M corruptibility/SMI corruptible/I corruption/IM corruptions corruptive/Y corruptness/MS Corry/M corsage/MS corsair/SM corset/GMDS Corsica/M Corsican/S cortège/MS Cortes/S cortex/M Cortez's cortical/Y cortices corticosteroid/SM Cortie/M cortisone/SM Cortland/M Cort/M Cortney/M Corty/M corundum/MS coruscate/XSDGN coruscation/M Corvallis/M corvette/MS Corvus/M Cory/M Cos Cosby/M Cosetta/M Cosette/M cos/GDS cosignatory/MS cosign/SRDZG cosily Cosimo/M cosine/MS cosiness/MS Cosme/M cosmetically cosmetician/MS cosmetic/SM cosmetologist/MS cosmetology/MS cosmic cosmical/Y cosmogonist/MS cosmogony/SM cosmological/Y cosmologist/MS cosmology/SM Cosmo/M cosmonaut/MS cosmopolitanism/MS cosmopolitan/SM cosmos/SM cosponsor/DSG cossack/S Cossack/SM cosset/GDS Costa/M Costanza/M costarred costarring costar/S Costello/M costiveness/M costive/PY costless costliness/SM costly/RTP cost/MYGVJS Costner/M costumer/M costume/ZMGSRD cotangent/SM Cote/M cote/MS coterie/MS coterminous/Y cotillion/SM Cotonou/M Cotopaxi/M cot/SGMD cottager/M cottage/ZMGSRD cottar's cotted cotter/SDM cotton/GSDM Cotton/M cottonmouth/M cottonmouths cottonseed/MS cottontail/SM cottonwood/SM cottony cotyledon/MS couching/M couch/MSDG cougar/MS cougher/M cough/RDG coughs couldn't could/T could've coulée/MS Coulomb/M coulomb/SM councilman/M councilmen councilor/MS councilperson/S council/SM councilwoman/M councilwomen counsel/GSDM counsellings counselor/MS countability/E countable/U countably/U countdown/SM counted/U count/EGARDS countenance/EGDS countenancer/M countenance's counteract/DSVG counteraction/SM counterargument/SM counterattack/DRMGS counterbalance/MSDG counterclaim/GSDM counterclockwise counterculture/MS countercyclical counterespionage/MS counterexample/S counterfeiter/M counterfeit/ZSGRD counterflow counterfoil/MS counterforce/M counter/GSMD counterinsurgency/MS counterintelligence/MS counterintuitive countermand/DSG counterman/M countermeasure/SM countermen counteroffensive/SM counteroffer/SM counterpane/SM counterpart/SM counterpoint/GSDM counterpoise/GMSD counterproductive counterproposal/M counterrevolutionary/MS counterrevolution/MS counter's/E counters/E countersignature/MS countersign/SDG countersink/SG counterspy/MS counterstrike countersunk countertenor/SM countervail/DSG counterweight/GMDS countess/MS countless/Y countrify/D countryman/M countrymen country/MS countryside/MS countrywide countrywoman/M countrywomen county/SM coup/ASDG coupe/MS Couperin/M couple/ACU coupled/CU coupler/C couplers coupler's couple's couples/CU couplet/SM coupling's/C coupling/SM coupon/SM coup's courage/MS courageously courageousness/MS courageous/U courages/E Courbet/M courgette/MS courier/GMDS course/EGSRDM courser's/E courser/SM course's/AF courses/FA coursework coursing/M Courtenay/M courteousness/EM courteousnesses courteous/PEY courtesan/MS courtesied courtesy/ESM courtesying court/GZMYRDS courthouse/MS courtier/SM courtliness/MS courtly/RTP Court/M Courtnay/M Courtney/M courtroom/MS courtship/SM courtyard/SM couscous/MS cousinly/U cousin/YMS Cousteau/M couture/SM couturier/SM covalent/Y covariance/SM covariant/S covariate/SN covary cove/DRSMZG covenanted/U covenanter/M covenant/SGRDM coven/SM Covent/M Coventry/MS coverable/E cover/AEGUDS coverage/MS coverall/DMS coverer/AME covering/MS coverlet/MS coversheet covers/M covertness/SM covert/YPS coveter/M coveting/Y covetousness/SM covetous/PY covet/SGRD covey/SM covington cowardice/MS cowardliness/MS cowardly/P Coward/M coward/MYS cowbell/MS cowbird/MS cowboy/MS cowcatcher/SM cowed/Y cowering/Y cower/RDGZ cowgirl/MS cowhand/S cowherd/SM cowhide/MGSD Cowley/M cowlick/MS cowling/M cowl/SGMD cowman/M cow/MDRSZG cowmen coworker/MS Cowper/M cowpoke/MS cowpony cowpox/MS cowpuncher/M cowpunch/RZ cowrie/SM cowshed/SM cowslip/MS coxcomb/MS Cox/M cox/MDSG coxswain/GSMD coy/CDSG coyer coyest coyly Coy/M coyness/MS coyote/SM coypu/SM cozenage/MS cozen/SGD cozily coziness/MS Cozmo/M Cozumel/M cozy/DSRTPG CPA cpd CPI cpl Cpl CPO CPR cps CPU/SM crabapple crabbedness/M crabbed/YP Crabbe/M crabber/MS crabbily crabbiness/S crabbing/M crabby/PRT crabgrass/S crablike crab/MS crackable/U crackdown/MS crackerjack/S cracker/M crackle/GJDS crackling/M crackly/RT crackpot/SM crackup/S crack/ZSBYRDG cradler/M cradle/SRDGM cradling/M craftily craftiness/SM Craft/M craft/MRDSG craftsman/M craftsmanship/SM craftsmen craftspeople craftspersons craftswoman craftswomen crafty/TRP Craggie/M cragginess/SM Craggy/M craggy/RTP crag/SM Craig/M Cramer/M crammed crammer/M cramming cramper/M cramp/MRDGS crampon/SM cram/S Cranach/M cranberry/SM Crandall/M crane/DSGM cranelike Crane/M Cranford/M cranial cranium/MS crankcase/MS crankily crankiness/MS crank/SGTRDM crankshaft/MS cranky/TRP Cranmer/M cranny/DSGM Cranston/M crape/SM crapped crappie/M crapping crappy/RST crapshooter/SM crap/SMDG! crasher/M crashing/Y crash/SRDGZ crassness/MS crass/TYRP crate/DSRGMZ crater/DMG Crater/M cravat/SM cravatted cravatting crave/DSRGJ cravenness/SM craven/SPYDG craver/M craving/M crawdad/S crawfish's Crawford/M crawler/M crawl/RDSGZ crawlspace/S crawlway crawly/TRS craw/SYM crayfish/GSDM Crayola/M crayon/GSDM Cray/SM craze/GMDS crazily craziness/MS crazy/SRTP creakily creakiness/SM creak/SDG creaky/PTR creamer/M creamery/MS creamily creaminess/SM cream/SMRDGZ creamy/TRP creased/CU crease/IDRSG crease's creases/C creasing/C created/U create/XKVNGADS creationism/MS creationist/MS Creation/M creation/MAK creativeness/SM creative/YP creativities creativity/K creativity's Creator/M creator/MS creatureliness/M creaturely/P creature/YMS crèche/SM credence/MS credent credential/SGMD credenza/SM credibility/IMS credible/I credibly/I creditability/M creditableness/M creditable/P creditably/E credited/U credit/EGBSD creditor/MS credit's creditworthiness credo/SM credulity/ISM credulous/IY credulousness/SM creedal creed/C creeds creed's creekside creek/SM Creek/SM creel/SMDG Cree/MDS creeper/M creepily creepiness/SM creep/SGZR creepy/PRST Creigh/M Creight/M Creighton/M cremate/XDSNG cremation/M crematoria crematorium/MS crematory/S creme/S crenelate/XGNSD crenelation/M Creole/MS creole/SM Creon/M creosote/MGDS crepe/DSGM crept crescendoed crescendoing crescendo/SCM crescent/MS cress/S crestfallenness/M crestfallen/PY cresting/M crestless crest/SGMD Crestview/M cretaceous Cretaceously/M Cretaceous/Y Cretan/S Crete/M cretinism/MS cretin/MS cretinous cretonne/SM crevasse/DSMG crevice/SM crew/DMGS crewel/SM crewelwork/SM crewman/M crewmen cribbage/SM cribbed cribber/SM cribbing/M crib/SM Crichton/M cricketer/M cricket/SMZRDG crick/GDSM Crick/M cried/C crier/CM cries/C Crimea/M Crimean crime/GMDS criminality/MS criminalization/C criminalize/GC criminal/SYM criminologist/SM criminology/MS crimper/M crimp/RDGS crimson/DMSG cringer/M cringe/SRDG crinkle/DSG crinkly/TRS Crin/M crinoline/SM cripple/GMZDRS crippler/M crippling/Y Crisco/M crises crisis/M Cris/M crisper/M crispiness/SM crispness/MS crisp/PGTYRDS crispy/RPT criss crisscross/GDS Crissie/M Crissy/M Cristabel/M Cristal/M Crista/M Cristen/M Cristian/M Cristiano/M Cristie/M Cristi/M Cristina/M Cristine/M Cristin/M Cristionna/M Cristobal/M Cristy/M criteria criterion/M criticality critically/U criticalness/M critical/YP criticism/MS criticized/U criticize/GSRDZ criticizer/M criticizes/A criticizingly/S criticizing/UY critic/MS critique/MGSD critter/SM Cr/M croaker/M croak/SRDGZ croaky/RT Croatia/M Croatian/S Croat/SM Croce/M crocheter/M crochet/RDSZJG crockery/SM Crockett/M Crockpot/M crock/SGRDM crocodile/MS crocus/SM Croesus/SM crofter/M croft/MRGZS croissant/MS Croix/M Cromwellian Cromwell/M crone/SM Cronin/M Cronkite/M Cronus/M crony/SM crookedness/SM crooked/TPRY Crookes/M crookneck/MS crook/SGDM crooner/M croon/SRDGZ cropland/MS crop/MS cropped cropper/SM cropping croquet/MDSG croquette/SM Crosby/M crosier/SM crossarm crossbarred crossbarring crossbar/SM crossbeam/MS crossbones crossbowman/M crossbowmen crossbow/SM crossbred/S crossbreed/SG crosscheck/SGD crosscurrent/SM crosscut/SM crosscutting crossed/UA crosses/UA crossfire/SM crosshatch/GDS crossing/M Cross/M crossness/MS crossover/MS crosspatch/MS crosspiece/SM crosspoint crossproduct/S crossroad/GSM crossroads/M crosstalk/M crosstown crosswalk/MS crossway/M crosswind/SM crosswise crossword/MS cross/ZTYSRDMPBJG crotchetiness/M crotchet/MS crotchety/P crotchless crotch/MDS crouch/DSG croupier/M croup/SMDG croupy/TZR croûton/MS crowbait crowbarred crowbarring crowbar/SM crowdedness/M crowded/P crowd/MRDSG crowfeet crowfoot/M crow/GDMS Crowley/M crowned/U crowner/M crown/RDMSJG crozier's CRT/S crucial/Y crucible/MS crucifiable crucifixion/MS Crucifixion/MS crucifix/SM cruciform/S crucify/NGDS crudded crudding cruddy/TR crudeness/MS crude/YSP crudités crudity/MS crud/STMR cruelness/MS cruelty/SM cruel/YRTSP cruet/MS cruft crufty Cruikshank/M cruise/GZSRD cruiser/M cruller/SM crumb/GSYDM crumble/DSJG crumbliness/MS crumbly/PTRS crumby/RT crumminess/S crummy/SRTP crump crumpet/SM crumple/DSG crunch/DSRGZ crunchiness/MS crunchy/TRP crupper/MS crusade/GDSRMZ crusader/M cruse/MS crushable/U crusher/M crushing/Y crushproof crush/SRDBGZ Crusoe/M crustacean/MS crustal crust/GMDS crustily crustiness/SM crusty/SRTP crutch/MDSG Crux/M crux/MS Cruz/M crybaby/MS cry/JGDRSZ cryogenic/S cryogenics/M cryostat/M cryosurgery/SM cryptanalysis/M cryptanalyst/M cryptanalytic crypt/CS cryptic cryptically cryptogram/MS cryptographer/MS cryptographic cryptographically cryptography/MS cryptologic cryptological cryptologist/M cryptology/M Cryptozoic/M crypt's crystalline/S crystallite/SM crystallization/AMS crystallized/UA crystallizes/A crystallize/SRDZG crystallizing/A crystallographer/MS crystallographic crystallography/M Crystal/M crystal/SM Crysta/M Crystie/M Cs C's cs/EA cs's CST ct CT Cthrine/M Ct/M ctn ctr Cuba/M Cuban/S cubbed cubbing cubbyhole/MS cuber/M cube/SM cubical/Y cubicle/SM cubic/YS cubism/SM cubist/MS cubit/MS cub/MDRSZG cuboid Cuchulain/M cuckold/GSDM cuckoldry/MS cuckoo/SGDM cucumber/MS cuddle/GSD cuddly/TRP cu/DG cudgel/GSJMD cud/MS cue/MS cuff/GSDM Cuisinart/M cuisine/MS Culbertson/M culinary Cullan/M cull/DRGS cullender's Cullen/M culler/M Culley/M Cullie/M Cullin/M Cull/MN Cully/M culminate/XSDGN culmination/M culotte/S culpability/MS culpable/I culpableness/M culpably culpa/SM culprit/SM cultism/SM cultist/SM cultivable cultivated/U cultivate/XBSDGN cultivation/M cultivator/SM cult/MS cultural/Y cultured/U culture/SDGM Culver/MS culvert/SM Cu/M cumber/DSG Cumberland/M cumbersomeness/MS cumbersome/YP cumbrous cumin/MS cummerbund/MS Cummings cumquat's cum/S cumulate/XVNGSD cumulation/M cumulative/Y cumuli cumulonimbi cumulonimbus/M cumulus/M Cunard/M cuneiform/S cunnilingus/SM Cunningham/M cunningness/M cunning/RYSPT cunt/SM! cupboard/SM cupcake/SM Cupertino/M cupful/SM cupidinously cupidity/MS Cupid/M cupid/S cup/MS cupola/MDGS cupped cupping/M cupric cuprous curability/MS curable/IP curableness/MI curably/I Curacao/M curacy/SM curare/MS curate/VGMSD curative/YS curatorial curator/KMS curbing/M curbside curb/SJDMG curbstone/MS Curcio/M curdle/SDG curd/SMDG cured/U cure/KBDRSGZ curer/MK curettage/SM curfew/SM curfs curiae curia/M cur/IBS Curie/M curie/SM curiosity/SM curio/SM curiousness/SM curious/TPRY Curitiba/M curium/MS curler/SM curlew/MS curlicue/MGDS curliness/SM curling/M curl/UDSG curlycue's curly/PRT curmudgeon/MYS Curran/M currant/SM curred/AFI currency's currency/SF current/FSY currently/A currentness/M Currey/M curricle/M curricula curricular curriculum/M Currie/M currier/M Currier/M curring/FAI Curr/M currycomb/DMGS Curry/MR curry/RSDMG cur's curs/ASDVG curse/A cursedness/M cursed/YRPT curse's cursive/EPYA cursiveness/EM cursives cursor/DMSG cursorily cursoriness/SM cursory/P curtailer/M curtail/LSGDR curtailment/SM curtain/GSMD Curtice/M Curtis/M Curt/M curtness/MS curtsey's curtsy/SDMG curt/TYRP curvaceousness/S curvaceous/YP curvature/MS curved/A curved's curve/DSGM curvilinearity/M curvilinear/Y curving/M curvy/RT cushion/SMDG Cushman/M cushy/TR cuspid/MS cuspidor/MS cusp/MS cussedness/M cussed/YP cuss/EGDSR cusses/F cussing/F cuss's custard/MS Custer/M custodial custodianship/MS custodian/SM custody/MS customarily customariness/M customary/PS customer/M customhouse/S customization/SM customize/ZGBSRD custom/SMRZ cutaneous/Y cutaway/SM cutback/SM cuteness/MS cute/SPY cutesy/RT cuticle/SM cutlass/MS cutler/SM cutlery/MS cutlet/SM cut/MRST cutoff/MS cutout/SM cutter/SM cutthroat/SM cutting/MYS cuttlebone/SM cuttlefish/MS cuttle/M cutup/MS cutworm/MS Cuvier/M Cuzco/M CV cw cwt Cyanamid/M cyanate/M cyanic cyanide/GMSD cyan/MS cyanogen/M Cybele/M cybernetic/S cybernetics/M cyberpunk/S cyberspace/S Cybill/M Cybil/M Cyb/M cyborg/S Cyclades cyclamen/MS cycle/ASDG cycler cycle's cycleway/S cyclic cyclical/SY cycling/M cyclist/MS cyclohexanol cycloidal cycloid/SM cyclometer/MS cyclone/SM cyclonic cyclopean cyclopedia/MS cyclopes Cyclopes cyclops Cyclops/M cyclotron/MS cyder/SM cygnet/MS Cygnus/M cylinder/GMDS cylindric cylindrical/Y Cy/M cymbalist/MS cymbal/SM Cymbre/M Cynde/M Cyndia/M Cyndie/M Cyndi/M Cyndy/M cynical/UY cynicism/MS cynic/MS cynosure/SM Cynthea/M Cynthia/M Cynthie/M Cynthy/M cypher/MGSD cypreses cypress/SM Cyprian Cypriot/SM Cyprus/M Cyrano/M Cyrille/M Cyrillic Cyrill/M Cyrillus/M Cyril/M Cyrus/M cystic cyst/MS cytochemistry/M cytochrome/M cytologist/MS cytology/MS cytolysis/M cytoplasmic cytoplasm/SM cytosine/MS cytotoxic CZ czarevitch/M czarina/SM czarism/M czarist/S czarship czar/SM Czech Czechoslovakia/M Czechoslovakian/S Czechoslovak/S Czechs Czerniak/M Czerny/M D DA dabbed dabber/MS dabbing dabbler/M dabble/RSDZG dab/S Dacca's dace/MS Dacey/M dacha/SM Dachau/M dachshund/SM Dacia/M Dacie/M Dacron/MS dactylic/S dactyl/MS Dacy/M Dadaism/M dadaism/S Dadaist/M dadaist/S Dada/M daddy/SM Dade/M dado/DMG dadoes dad/SM Daedalus/M Dael/M daemonic daemon/SM Daffie/M Daffi/M daffiness/S daffodil/MS Daffy/M daffy/PTR daftness/MS daft/TYRP DAG dagger/DMSG Dag/M Dagmar/M Dagny/M Daguerre/M daguerreotype/MGDS Dagwood/M Dahlia/M dahlia/MS Dahl/M Dahomey/M Daile/M dailiness/MS daily/PS Daimler/M daintily daintiness/MS dainty/TPRS daiquiri/SM dairying/M dairyland dairymaid/SM dairyman/M dairymen dairy/MJGS dairywoman/M dairywomen Daisey/M Daisie/M Daisi/M dais/SM Daisy/M daisy/SM Dakar/M Dakotan Dakota/SM Dale/M Dalenna/M dale/SMH daleth/M Daley/M Dalhousie/M Dalia/M Dalian/M Dalila/M Dali/SM Dallas/M dalliance/SM dallier/M Dalli/MS Dall/M Dallon/M dally/ZRSDG Dal/M Dalmatia/M dalmatian/S Dalmatian/SM Daloris/M Dalston/M Dalt/M Dalton/M Daly/M damageable damaged/U damage/MZGRSD damager/M damaging/Y Damara/M Damaris/M Damascus/M damask/DMGS dame/SM Dame/SMN Damian/M Damiano/M Damien/M Damion/M Damita/M dam/MDS dammed damming dammit/S damnably damnation/MS damnedest/MS damned/TR damn/GSBRD damning/Y Damocles/M Damon/M damped/U dampener/M dampen/RDZG damper/M dampness/MS damp/SGZTXYRDNP damselfly/MS damsel/MS damson/MS Danaë Dana/M Danbury/M dancelike dancer/M dance/SRDJGZ dandelion/MS dander/DMGS dandify/SDG dandily dandle/GSD dandruff/MS dandy/TRSM Danelaw/M Danella/M Danell/M Dane/SM Danette/M danger/DMG Dangerfield/M dangerousness/M dangerous/YP dangler/M dangle/ZGRSD dangling/Y dang/SGZRD Danial/M Dania/M Danica/M Danice/M Daniela/M Daniele/M Daniella/M Danielle/M Daniel/SM Danielson/M Danie/M Danika/M Danila/M Dani/M Danish danish/S Danita/M Danit/M dankness/MS dank/TPYR Danna/M Dannel/M Dannie/M Danni/M Dannye/M Danny/M danseuse/SM Dan/SM Dante/M Danton/M Danube/M Danubian Danville/M Danya/M Danyelle/M Danyette/M Danzig/M Daphene/M Daphna/M Daphne/M dapperness/M dapper/PSTRY dapple/SDG Dara/M Darbee/M Darbie/M Darb/M Darby/M Darcee/M Darcey/M Darcie/M Darci/M D'Arcy Darcy/M Darda/M Dardanelles daredevil/MS daredevilry/S Dareen/M Darelle/M Darell/M Dare/M Daren/M darer/M daresay dare/ZGDRSJ d'Arezzo Daria/M Darice/M Darill/M Dari/M daringness/M daring/PY Darin/M Dario/M Darius/M Darjeeling/M darkener/M darken/RDZG dark/GTXYRDNSP darkish darkly/TR darkness/MS darkroom/SM Darla/M Darleen/M Darlene/M Darline/M Darling/M darlingness/M Darlington/M darling/YMSP Darlleen/M Dar/MNH Darnall/M darned/TR Darnell/M darner/M darn/GRDZS darning/M Darn/M Daron/M DARPA/M Darrelle/M Darrell/M Darrel/M Darren/M Darrick/M Darrin/M Darrow/M Darryl/M Darsey/M Darsie/M d'art dartboard/SM darter/M Darth/M Dartmouth/M dart/MRDGZS Darvon/M Darwinian/S Darwinism/MS Darwinist/MS Darwin/M Darya/M Daryle/M Daryl/M Daryn/M Dasha/M dashboard/SM dasher/M dash/GZSRD dashiki/SM dashing/Y Dasie/M Dasi/M dastardliness/SM dastardly/P dastard/MYS Dasya/M DAT database/DSMG datafile datagram/MS data/M Datamation/M Datamedia/M dataset/S datedly datedness date/DRSMZGV dated/U dateless dateline/DSMG dater/M Datha/M dative/S Datsun/M datum/MS dauber/M daub/RDSGZ Daugherty/M daughter/MYS Daumier/M Daune/M daunt/DSG daunted/U daunting/Y dauntlessness/SM dauntless/PY dauphin/SM Davao/M Daveen/M Dave/M Daven/M Davenport/M davenport/MS Daveta/M Davey/M Davida/M Davidde/M Davide/M David/SM Davidson/M Davie/M Davina/M Davine/M Davinich/M Davin/M Davis/M Davita/M davit/SM Dav/MN Davon/M Davy/SM dawdler/M dawdle/ZGRSD Dawes/M Dawna/M dawn/GSDM Dawn/M Dawson/M daybed/S daybreak/SM daycare/S daydreamer/M daydream/RDMSZG Dayle/M daylight/GSDM Day/M Dayna/M daysack day/SM daytime/SM Dayton/M dazed/PY daze/DSG dazzler/M dazzle/ZGJRSD dazzling/Y db DB dbl dB/M DBMS DC DD Ddene/M DDS DDT DE deacon/DSMG deaconess/MS deadbeat/SM deadbolt/S deadener/M deadening/MY deaden/RDG deadhead/MS deadline/MGDS deadliness/SM deadlock/MGDS deadly/RPT deadness/M deadpanned deadpanner deadpanning deadpan/S dead/PTXYRN deadwood/SM deafening/MY deafen/JGD deafness/MS deaf/TXPYRN dealer/M dealership/MS dealing/M deallocator deal/RSGZJ dealt Deana/M dean/DMG Deandre/M Deane/M deanery/MS Dean/M Deanna/M Deanne/M Deann/M deanship/SM Dearborn/M dearness/MS dearth/M dearths dear/TYRHPS deary/MS deassign deathbed/MS deathblow/SM deathless/Y deathlike deathly/TR death/MY deaths deathtrap/SM deathward deathwatch/MS debacle/SM debarkation/SM debark/G debar/L debarment/SM debarring debaser/M debatable/U debate/BMZ debater/M debauchedness/M debauched/PY debauchee/SM debaucher/M debauchery/SM debauch/GDRS Debbie/M Debbi/M Debby/M Debee/M debenture/MS Debera/M debilitate/NGXSD debilitation/M debility/MS Debi/M debit/DG deb/MS Deb/MS debonairness/SM debonair/PY Deborah/M Debora/M Debor/M debouch/DSG Debra/M debrief/GJ debris/M debtor/SM debt/SM Debussy/M débutante/SM debut/MDG decade/MS decadency/S decadent/YS decaffeinate/DSG decaf/S decagon/MS Decalogue/M decal/SM decamp/L decampment/MS decapitate/GSD decapitator/SM decathlon/SM Decatur/M decay/GRD Decca/M Deccan/M decease/M decedent/MS deceitfulness/SM deceitful/PY deceit/SM deceived/U deceiver/M deceives/U deceive/ZGRSD deceivingly deceiving/U decelerate/XNGSD deceleration/M decelerator/SM December/SM decency/ISM decennial/SY decent/TIYR deception/SM deceptiveness/SM deceptive/YP decertify/N dechlorinate/N decibel/MS decidability/U decidable/U decidedness/M decided/PY decide/GRSDB deciduousness/M deciduous/YP decile/SM deciliter/SM decimal/SYM decimate/XNGDS decimation/M decimeter/MS decipherable/IU decipher/BRZG decipherer/M decisional decisioned decisioning decision/ISM decisive/IPY decisiveness/MSI deckchair decker/M Decker/M deck/GRDMSJ deckhand/S decking/M Deck/RM declamation/SM declamatory declarable declaration/MS declaration's/A declarative/SY declarator/MS declaratory declare/AGSD declared/U declarer/MS declension/SM declination/MS decliner/M decline/ZGRSD declivity/SM Dec/M DEC/M DECNET DECnet/M deco décolletage/S décolleté decolletes decolorising decomposability/M decomposable/IU decompose/B decompress/R decongestant/S deconstruction deconvolution decorated/AU decorate/NGVDSX decorates/A decorating/A decoration/ASM decorativeness/M decorative/YP decorator/SM decorousness/MS decorousness's/I decorous/PIY decor/S decorticate/GNDS decortication/M decorum/MS decoupage/MGSD decouple/G decoy/M decrease decreasing/Y decreeing decree/RSM decremental decrement/DMGS decrepit decrepitude/SM decriminalization/S decriminalize/DS decry/G decrypt/GD decryption DECstation/M DECsystem/M DECtape/M decustomised Dedekind/M Dede/M dedicate/AGDS dedicated/Y dedication/MS dedicative dedicator/MS dedicatory Dedie/M Dedra/M deduce/RSDG deducible deductibility/M deductible/S deduction/SM deductive/Y deduct/VG Deeanne/M Deeann/M deeded Deedee/M deeding deed/IS deed's deejay/MDSG Dee/M deem/ADGS deemphasis Deena/M deepen/DG deepish deepness/MS deep/PTXSYRN Deerdre/M Deere/M deerskin/MS deer/SM deerstalker/SM deerstalking/M Deeyn/M deface/LZ defacement/SM defaecate defalcate/NGXSD defalcation/M defamation/SM defamatory defamer/M defame/ZR defaulter/M default/ZR defeated/U defeater/M defeatism/SM defeatist/SM defeat/ZGD defecate/DSNGX defecation/M defection/SM defectiveness/MS defective/PYS defect/MDSVG defector/MS defendant/SM defended/U defenestrate/GSD defenselessness/MS defenseless/PY defenses/U defense/VGSDM defensibility/M defensible/I defensibly/I defensiveness/MS defensive/PSY deference/MS deferential/Y deferent/S deferrable deferral/SM deferred deferrer/MS deferring deffer defiance/MS defiant/Y defibrillator/M deficiency/MS deficient/SY deficit/MS defier/M defile/L defilement/MS definable/UI definably/I define/AGDRS defined/U definer/SM definite/IPY definiteness/IMS definitional definition/ASM definitiveness/M definitive/SYP defis deflate/XNGRSDB deflationary deflation/M deflect/DSGV deflected/U deflection/MS deflector/MS defocus defocussing Defoe/M defog defogger/S defoliant/SM defoliator/SM deformational deform/B deformed/U deformity/SM defrauder/M defraud/ZGDR defrayal/SM defroster/M defrost/RZ deftness/MS deft/TYRP defunct/S defying/Y defy/RDG def/Z deg Degas/M degassing degauss/GD degeneracy/MS degenerateness/M degenerate/PY degrade/B degradedness/M degraded/YP degrading/Y degrease degree/SM degum Dehlia/M dehumanize dehydrator/MS deicer/M deice/ZR deictic Deidre/M deification/M deify/SDXGN deign/DGS Deimos/M Deina/M Deirdre/MS deistic deist/SM Deity/M deity/SM deja deject/DSG dejectedness/M dejected/PY dejection/SM Dejesus/M DeKalb/M DeKastere/M Delacroix/M Delacruz/M Delainey/M Dela/M Delaney/M Delano/M Delawarean/SM Delaware/MS delay/D delayer/G Delbert/M Delcina/M Delcine/M delectableness/M delectable/SP delectably delectation/MS delegable Deleon/M deleted/U deleteriousness/M deleterious/PY delete/XBRSDNG deletion/M delfs Delft/M delft/MS delftware/S Delgado/M Delhi/M Delia/M deliberateness/SM deliberate/PVY deliberativeness/M deliberative/PY Delibes/M delicacy/IMS delicate/IYP delicatenesses delicateness/IM delicates delicatessen/MS deliciousness/MS delicious/YSP delicti delightedness/M delighted/YP delightfulness/M delightful/YP Delilah/M Delilahs Delila/M Delinda/M delineate/SDXVNG delineation/M delinquency/MS delinquent/SYM deliquesce/GSD deliquescent deliriousness/MS delirious/PY delirium/SM deli/SM Delius/M deliverables deliverable/U deliver/AGSD deliverance/SM delivered/U deliverer/SM delivery/AM deliverymen/M Della/M Dell/M dell/SM Dellwood/M Delly/M Delmar/M Delmarva/M Delmer/M Delmonico Delmore/M Delmor/M Del/MY Delora/M Delores/M Deloria/M Deloris/M Delphic Delphi/M Delphine/M Delphinia/M delphinium/SM Delphinus/M Delta/M delta/MS deltoid/SM deluder/M delude/RSDG deluding/Y deluge/SDG delusional delusion/SM delusiveness/M delusive/PY deluxe delve/GZSRD delver/M demagnify/N demagogic demagogue/GSDM demagoguery/SM demagogy/MS demander/M demand/GSRD demandingly demanding/U demarcate/SDNGX demarcation/M Demavend/M demean/GDS demeanor/SM dementedness/M demented/YP dementia/MS Demerol/M demesne/SM Demeter/M Demetra/M Demetre/M Demetria/M Demetri/MS Demetrius/M demigod/MS demijohn/MS demimondaine/SM demimonde/SM demineralization/SM Deming/M demise/DMG demit demitasse/MS demitted demitting Dem/MG democracy/MS Democratic democratically/U democratic/U democratization/MS democratize/DRSG democratizes/U Democrat/MS democrat/SM Democritus/M démodé demo/DMPG demographer/MS demographical/Y demographic/S demography/MS demolisher/M demolish/GSRD demolition/MS demonetization/S demoniacal/Y demoniac/S demonic demonology/M demon/SM demonstrable/I demonstrableness/M demonstrably/I demonstrate/XDSNGV demonstration/M demonstrativenesses demonstrativeness/UM demonstratives demonstrative/YUP demonstrator/MS demoralization/M demoralizer/M demoralizing/Y DeMorgan/M Demosthenes/M demote/DGX demotic/S Demott/M demount/B Dempsey/M demulcent/S demultiplex demureness/SM demure/YP demurral/MS demurred demurrer/MS demurring demur/RTS demythologization/M demythologize/R den Dena/M dendrite/MS Deneb/M Denebola/M Deneen/M Dene/M Deng/M dengue/MS deniable/U denial/SM Denice/M denier/M denigrate/VNGXSD denigration/M denim/SM Denise/M Deni/SM denizen/SMDG Den/M De/NM Denmark/M Denna/M denned Dennet/M Denney/M Dennie/M Denni/MS denning Dennison/M Denny/M denominate/V denominational/Y denote/B denouement/MS denounce/LZRSDG denouncement/SM denouncer/M dense/FR densely denseness/SM densitometer/MS densitometric densitometry/M density/MS dens/RT dental/YS dentifrice/SM dentine's dentin/SM dent/ISGD dentistry/MS dentist/SM dentition/MS dent's denture/IMS denuclearize/GSD denudation/SM denude/DG denuder/M denunciate/VNGSDX denunciation/M Denver/M denying/Y Deny/M Denys Denyse/M deny/SRDZG deodorant/SM deodorization/SM deodorize/GZSRD deodorizer/M Deon/M Deonne/M deoxyribonucleic depart/L departmentalization/SM departmentalize/DSG departmental/Y department/MS departure/MS dependability/MS dependableness/M dependable/P dependably Dependant/MS depend/B dependence/ISM dependency/MS dependent/IYS dependent's depicted/U depicter/M depiction/SM depict/RDSG depilatory/S deplete/VGNSDX depletion/M deplorableness/M deplorable/P deplorably deplorer/M deplore/SRDBG deploring/Y deployable deploy/AGDLS deployment/SAM depolarize deponent/S deportation/MS deportee/SM deport/LG deportment/MS depose deposit/ADGS depositary/M deposition/A depositor/SAM depository/MS depravedness/M depraved/PY deprave/GSRD depraver/M depravity/SM deprecate/XSDNG deprecating/Y deprecation/M deprecatory depreciable depreciate/XDSNGV depreciating/Y depreciation/M depreciative/Y depressant/S depressible depression/MS depressive/YS depressor/MS depress/V deprive/GSD depth/M depths Dept/M deputation/SM depute/SDG deputize/DSG deputy/MS dequeue derail/L dérailleur/MS derailment/MS derange/L derangement/MS Derbyshire/M derby/SM Derby/SM dereference/Z Derek/M dereliction/SM derelict/S Derick/M deride/D deriding/Y derision/SM derisiveness/MS derisive/PY derisory derivable/U derivate/XNV derivation/M derivativeness/M derivative/SPYM derive/B derived/U Derk/M Der/M dermal dermatitides dermatitis/MS dermatological dermatologist/MS dermatology/MS dermis/SM Dermot/M derogate/XDSNGV derogation/M derogatorily derogatory Derrek/M Derrick/M derrick/SMDG Derrida/M derrière/S Derrik/M Derril/M derringer/SM Derron/M Derry/M dervish/SM Derward/M Derwin/M Des desalinate/NGSDX desalination/M desalinization/MS desalinize/GSD desalt/G descant/M Descartes/M descendant/SM descended/FU descendent's descender/M descending/F descends/F descend/ZGSDR descent describable/I describe/ZB description/MS descriptiveness/MS descriptive/SYP descriptor/SM descry/SDG Desdemona/M desecrater/M desecrate/SRDGNX desecration/M deserter/M desertification desertion/MS desert/ZGMRDS deservedness/M deserved/YU deserve/J deserving/Y déshabillé's desiccant/S desiccate/XNGSD desiccation/M desiccator/SM desiderata desideratum/M designable design/ADGS designate/VNGSDX designational designation/M designator/SM designed/Y designer/M designing/U Desi/M desirabilia desirability's desirability/US desirableness/SM desirableness's/U desirable/UPS desirably/U Desirae/M desire/BR desired/U Desiree/M desirer/M Desiri/M desirousness/M desirous/PY desist/DSG desk/SM desktop/S Desmond/M Desmund/M desolateness/SM desolate/PXDRSYNG desolater/M desolating/Y desolation/M desorption/M despairer/M despairing/Y despair/SGDR desperadoes desperado/M desperateness/SM desperate/YNXP desperation/M despicable despicably despiser/M despise/SRDG despoil/L despoilment/MS despond despondence/S despondency/MS despondent/Y despotic despotically despotism/SM dessert/SM dessicate/DN d'Estaing destinate/NX destination/M destine/GSD destiny/MS destituteness/M destitute/NXP destitution/M destroy/BZGDRS destroyer/M destructibility/SMI destructible/I destruction/SM destructiveness/MS destructive/YP destructor/M destruct/VGSD desuetude/MS desultorily desultoriness/M desultory/P detachedness/M detached/YP detacher/M detach/LSRDBG detachment/SM detailedness/M detailed/YP detainee/S detainer/M detain/LGRDS detainment/MS d'etat detectability/U detectable/U detectably/U detect/DBSVG detected/U detection/SM detective/MS detector/MS détente detentes detention/SM detergency/M detergent/SM deteriorate/XDSNGV deterioration/M determent/SM determinability/M determinable/IP determinableness/IM determinacy/I determinant/MS determinateness/IM determinate/PYIN determination/IM determinativeness/M determinative/P determinedly determinedness/M determined/U determine/GASD determiner/SM determinism/MS determinism's/I deterministically deterministic/I deterred/U deterrence/SM deterrent/SMY deterring detersive/S deter/SL deters/V detestableness/M detestable/P detestably detestation/SM dethrone/L dethronement/SM detonable detonated/U detonate/XDSNGV detonation/M detonator/MS detour/G detoxification/M detoxify/NXGSD detox/SDG detract/GVD detractive/Y d'etre detribalize/GSD detrimental/SY detriment/SM detritus/M Detroit/M deuced/Y deuce/SDGM deus deuterium/MS deuteron/M Deuteronomy/M Deutsch/M Deva/M Devanagari/M Devan/M devastate/XVNGSD devastating/Y devastation/M devastator/SM develop/ALZSGDR developed/U developer/MA developmental/Y development/ASM deviance/MS deviancy/S deviant/YMS deviated/U deviate/XSDGN deviating/U deviation/M devilishness/MS devilish/PY devilment/SM devilry/MS devil/SLMDG deviltry/MS Devi/M Devina/M Devin/M Devinne/M deviousness/SM devious/YP devise/JR deviser/M Devland/M Devlen/M Devlin/M Dev/M devoice devolution/MS devolve/GSD Devondra/M Devonian Devon/M Devonna/M Devonne/M Devonshire/M Devora/M devoted/Y devotee/MS devote/XN devotional/YS devotion/M devourer/M devour/SRDZG devoutness/MS devout/PRYT Devy/M Dewain/M dewar Dewar/M Dewayne/M dewberry/MS dewclaw/SM dewdrop/MS Dewey/M Dewie/M dewiness/MS Dewitt/M dewlap/MS Dew/M dew/MDGS dewy/TPR Dexedrine/M dexes/I Dex/M dexter dexterity/MS Dexter/M dexterousness/MS dexterous/PY dextrose/SM DH Dhaka Dhaulagiri/M dhoti/SM dhow/MS DI diabase/M diabetes/M diabetic/S diabolic diabolicalness/M diabolical/YP diabolism/M diachronic/P diacritical/YS diacritic/MS diadem/GMDS diaereses diaeresis/M Diaghilev/M diagnometer/SM diagnosable/U diagnose/BGDS diagnosed/U diagnosis/M diagnostically diagnostician/SM diagnostic/MS diagnostics/M diagonalize/GDSB diagonal/YS diagrammable diagrammatic diagrammaticality diagrammatically diagrammed diagrammer/SM diagramming diagram/MS Diahann/M dialectal/Y dialectical/Y dialectic/MS dialect/MS dialed/A dialer/M dialing/M dial/MRDSGZJ dialogged dialogging dialog/MS dials/A dialysis/M dialyzed/U dialyzes diam diamagnetic diameter/MS diametric diametrical/Y diamondback/SM diamond/GSMD Diana/M Diandra/M Diane/M Dianemarie/M Dian/M Dianna/M Dianne/M Diann/M Diannne/M diapason/MS diaper/SGDM diaphanousness/M diaphanous/YP diaphragmatic diaphragm/SM diarist/SM Diarmid/M diarrheal diarrhea/MS diary/MS diaspora Diaspora/SM diastase/SM diastole/MS diastolic diathermy/SM diathesis/M diatomic diatom/SM diatonic diatribe/MS Diaz's dibble/SDMG dibs DiCaprio/M dice/GDRS dicer/M dicey dichloride/M dichotomization/M dichotomize/DSG dichotomous/PY dichotomy/SM dicier diciest dicing/M Dickensian/S dickens/M Dickens/M dicker/DG Dickerson/M dickey/SM dick/GZXRDMS! Dickie/M dickier dickiest Dickinson/M Dickson/M Dick/XM Dicky/M dicky's dicotyledonous dicotyledon/SM dicta/M Dictaphone/SM dictate/SDNGX dictation/M dictatorialness/M dictatorial/YP dictator/MS dictatorship/SM dictionary/SM diction/MS dictum/M didactically didactic/S didactics/M did/AU diddler/M diddle/ZGRSD Diderot/M Didi/M didn't didoes dido/M Dido/M didst die/DS Diefenbaker/M Diego/M dieing dielectric/MS diem Diem/M Diena/M Dierdre/M diereses dieresis/M diesel/GMDS Diesel's dies's dies/U dietary/S dieter/M Dieter/M dietetic/S dietetics/M diethylaminoethyl diethylstilbestrol/M dietitian/MS diet/RDGZSM Dietrich/M Dietz/M difference/DSGM difference's/I differences/I differentiability differentiable differential/SMY differentiated/U differentiate/XSDNG differentiation/M differentiator/SM differentness different/YI differ/SZGRD difficile difficult/Y difficulty/SM diffidence/MS diffident/Y diffract/GSD diffraction/SM diffractometer/SM diffuseness/MS diffuse/PRSDZYVXNG diffuser/M diffusible diffusional diffusion/M diffusiveness/M diffusive/YP diffusivity/M digerati digested/IU digester/M digestibility/MS digestible/I digestifs digestion/ISM digestive/YSP digest/RDVGS digger/MS digging/S digitalis/M digitalization/MS digitalized digitalizes digitalizing digital/SY digitization/M digitizer/M digitize/ZGDRS digit/SM dignified/U dignify/DSG dignitary/SM dignity/ISM digram digraph/M digraphs digress/GVDS digression/SM digressiveness/M digressive/PY dig/TS dihedral Dijkstra/M Dijon/M dike/DRSMG diker/M diktat/SM Dilan/M dilapidate/XGNSD dilapidation/M dilatation/SM dilated/YP dilate/XVNGSD dilation/M dilatoriness/M dilator/SM dilatory/P Dilbert/M dilemma/MS dilettante/MS dilettantish dilettantism/MS diligence/SM diligentness/M diligent/YP dilithium Dillard/M Dillie/M Dillinger/M dilling/R dillis Dill/M Dillon/M dill/SGMD dillydally/GSD Dilly/M dilly/SM dilogarithm diluent diluted/U diluteness/M dilute/RSDPXYVNG dilution/M Di/M DiMaggio/M dimensionality/M dimensional/Y dimensionless dimension/MDGS dimer/M dime/SM dimethylglyoxime dimethyl/M diminished/U diminish/SDGBJ diminuendo/SM diminution/SM diminutiveness/M diminutive/SYP Dimitri/M Dimitry/M dimity/MS dimmed/U dimmer/MS dimmest dimming dimness/SM dimorphism/M dimple/MGSD dimply/RT dim/RYPZS dimwit/MS dimwitted Dinah/M Dina/M dinar/SM diner/M dine/S dinette/MS dingbat/MS ding/GD dinghy/SM dingily dinginess/SM dingle/MS dingoes dingo/MS dingus/SM dingy/PRST dinky/RST din/MDRZGS dinned dinner/SM dinnertime/S dinnerware/MS Dinnie/M dinning Dinny/M Dino/M dinosaur/MS dint/SGMD diocesan/S diocese/SM Diocletian/M diode/SM Diogenes/M Dione/M Dionisio/M Dionis/M Dion/M Dionne/M Dionysian Dionysus/M Diophantine/M diopter/MS diorama/SM Dior/M dioxalate dioxide/MS dioxin/S diphtheria/SM diphthong/SM diplexers diploid/S diplomacy/SM diploma/SMDG diplomata diplomatically diplomatic/S diplomatics/M diplomatist/SM diplomat/MS dipodic dipody/M dipole/MS dipped Dipper/M dipper/SM dipping/S dippy/TR dip/S dipsomaniac/MS dipsomania/SM dipstick/MS dipterous diptych/M diptychs Dir Dirac/M directed/IUA directionality directional/SY direction/MIS directions/A directive/SM directivity/M directly/I directness/ISM director/AMS directorate/SM directorial directorship/SM directory/SM direct/RDYPTSVG directrix/MS directs/IA direful/Y direness/M dire/YTRP dirge/GSDM Dirichlet/M dirigible/S dirk/GDMS Dirk/M dirndl/MS dirtily dirtiness/SM dirt/MS dirty/GPRSDT Dis disable/LZGD disablement/MS disabler/M disabuse disadvantaged/P disagreeable/S disallow/D disambiguate/DSGNX disappointed/Y disappointing/Y disarming/Y disarrange/L disastrous/Y disband/L disbandment/SM disbar/L disbarment/MS disbarring disbelieving/Y disbursal/S disburse/GDRSL disbursement/MS disburser/M discerner/M discernibility discernible/I discernibly discerning/Y discernment/MS discern/SDRGL disc/GDM discharged/U disciple/DSMG discipleship/SM disciplinarian/SM disciplinary disciplined/U discipline/IDM discipliner/M disciplines disciplining disclosed/U discography/MS discolored/MP discoloreds/U discolor/G discombobulate/SDGNX discomfit/DG discomfiture/MS disco/MG discommode/DG disconcerting/Y disconnectedness/S disconnected/P disconnecter/M disconnect/R disconsolate/YN discordance/SM discordant/Y discord/G discorporate/D discotheque/MS discount/B discourage/LGDR discouragement/MS discouraging/Y discoverable/I discover/ADGS discovered/U discoverer/S discovery/SAM discreetly/I discreetness's/I discreetness/SM discreet/TRYP discrepancy/SM discrepant/Y discreteness/SM discrete/YPNX discretionary discretion/IMS discretization discretized discriminable discriminant/MS discriminated/U discriminate/SDVNGX discriminating/YI discrimination/MI discriminator/MS discriminatory discursiveness/S discussant/MS discussed/UA discusser/M discussion/SM discus/SM disdainfulness/M disdainful/YP disdain/MGSD disease/G disembowelment/SM disembowel/SLGD disengage/L disfigure/L disfigurement/MS disfranchise/L disfranchisement/MS disgorge disgrace/R disgracer/M disgruntle/DSLG disgruntlement/MS disguised/UY disguise/R disguiser/M disgust disgusted/Y disgustful/Y disgusting/Y dishabille/SM disharmonious dishcloth/M dishcloths dishevel/LDGS dishevelment/MS dish/GD dishonest dishonored/U dishpan/MS dishrag/SM dishtowel/SM dishwasher/MS dishwater/SM disillusion/LGD disillusionment/SM disinfectant/MS disinherit disinterestedness/SM disinterested/P disinvest/L disjoin disjointedness/S disjunctive/YS disjunct/VS disk/D diskette/S dislike/G dislodge/LG dislodgement/M dismalness/M dismal/PSTRY dismantle/L dismantlement/SM dismay/D dismayed/U dismaying/Y dis/MB dismember/LG dismemberment/MS dismissive/Y dismiss/RZ Disneyland/M Disney/M disoblige/G disorderedness/M disordered/YP disorderliness/M disorderly/P disorder/Y disorganize disorganized/U disparagement/MS disparager/M disparage/RSDLG disparaging/Y disparateness/M disparate/PSY dispatch/Z dispelled dispelling dispel/S dispensable/I dispensary/MS dispensate/NX dispensation/M dispenser/M dispense/ZGDRSB dispersal/MS dispersant/M dispersed/Y disperser/M disperse/XDRSZLNGV dispersible dispersion/M dispersiveness/M dispersive/PY dispirit/DSG displace/L display/AGDS displayed/U displeased/Y displease/G displeasure disport disposable/S disposal/SM dispose/IGSD dispositional disposition/ISM disproportional disproportionate/N disproportionation/M disprove/B disputable/I disputably/I disputant/SM disputation/SM disputatious/Y disputed/U disputer/M dispute/ZBGSRD disquieting/Y disquiet/M disquisition/SM Disraeli/M disregardful disrepair/M disreputableness/M disreputable/P disrepute/M disrespect disrupted/U disrupter/M disrupt/GVDRS disruption/MS disruptive/YP disruptor/M dissatisfy dissect/DG dissed dissembler/M dissemble/ZGRSD disseminate/XGNSD dissemination/M dissension/SM dissenter/M dissent/ZGSDR dissertation/SM disservice disses dissever dissidence/SM dissident/MS dissimilar/S dissing dissipatedly dissipatedness/M dissipated/U dissipater/M dissipate/XRSDVNG dissipation/M dissociable/I dissociate/DSXNGV dissociated/U dissociation/M dissociative/Y dissoluble/I dissoluteness/SM dissolute/PY dissolve/ASDG dissolved/U dissonance/SM dissonant/Y dissuade/GDRS dissuader/M dissuasive dist distaff/SM distal/Y distance/DSMG distantness/M distant/YP distaste distemper distend distension distention/SM distillate/XNMS distillation/M distillery/MS distincter distinctest distinction/MS distinctiveness/MS distinctive/YP distinct/IYVP distinctness/MSI distinguishable/I distinguishably/I distinguish/BDRSG distinguished/U distinguisher/M distort/BGDR distorted/U distorter/M distortion/MS distract/DG distractedness/M distracted/YP distracting/Y distrait distraught/Y distress distressful distressing/Y distribute/ADXSVNGB distributed/U distributer distributional distribution/AM distributiveness/M distributive/SPY distributivity distributorship/M distributor/SM district/GSAD district's distrust/G disturbance/SM disturbed/U disturber/M disturbing/Y disturb/ZGDRS disulfide/M disuse/M disyllable/M Dita/M ditcher/M ditch/MRSDG dither/RDZSG ditsy/TR ditto/DMGS ditty/SDGM Ditzel/M ditz/S diuresis/M diuretic/S diurnal/SY divalent/S diva/MS divan/SM dived/M divergence/SM divergent/Y diverge/SDG diver/M diverseness/MS diverse/XYNP diversification/M diversifier/M diversify/GSRDNX diversionary diversion/M diversity/SM divert/GSD diverticulitis/SM divertimento/M dive/S divestiture/MS divest/LDGS divestment/S dividable divide/AGDS divided/U dividend/MS divider/MS divination/SM diviner/M divine/RSDTZYG divinity/MS divisibility/IMS divisible/I divisional division/SM divisiveness/MS divisive/PY divisor/SM divorcée/MS divorce/GSDLM divorcement/MS divot/MS div/TZGJDRS divulge/GSD divvy/GSDM Dixiecrat/MS dixieland Dixieland/MS Dixie/M Dix/M Dixon/M dizzily dizziness/SM dizzying/Y dizzy/PGRSDT DJ Djakarta's djellabah's djellaba/S d/JGVX Djibouti/M DMD Dmitri/M DMZ DNA Dnepropetrovsk/M Dnepr's Dnieper's Dniester/M Dniren/M DOA doable DOB Dobbin/M dobbin/MS Doberman Dobro/M docent/SM docile/Y docility/MS docker/M docket/GSMD dock/GZSRDM dockland/MS dockside/M dockworker/S dockyard/SM doc/MS Doctor doctoral doctorate/SM doctor/GSDM Doctorow/M doctrinaire/S doctrinal/Y doctrine/SM docudrama/S documentary/MS documentation/MS documented/U document/RDMZGS DOD dodder/DGS dodecahedra dodecahedral dodecahedron/M Dode/M dodge/GZSRD Dodge/M dodgem/S dodger/M Dodgson/M Dodie/M Dodi/M Dodington/M Dodoma/M dodo/SM Dodson/M Dody/M DOE Doe/M doe/MS doer/MU does/AU doeskin/MS doesn't d'oeuvre doff/SGD dogcart/SM dogcatcher/MS dogeared Doge/M doge/SM dogfight/GMS dogfish/SM dogfought doggedness/SM dogged/PY doggerel/SM dogging doggone/RSDTG doggy/SRMT doghouse/SM dogie/SM doglegged doglegging dogleg/SM dogma/MS dogmatically/U dogmatic/S dogmatics/M dogmatism/SM dogmatist/SM dogsbody/M dog/SM dogtooth/M Dogtown/M dogtrot/MS dogtrotted dogtrotting dogwood/SM dogy's Doha/M doh's doily/SM doing/MU Dolby/SM doldrum/S doldrums/M doled/F dolefuller dolefullest dolefulness/MS doleful/PY Dole/M dole/MGDS doles/F Dolf/M doling/F dollar/SM Dolley/M Dollie/M Dolli/M Doll/M doll/MDGS dollop/GSMD Dolly/M dolly/SDMG dolmen/MS dolomite/SM dolomitic Dolores/M Dolorita/SM dolorous/Y dolor/SM dolphin/SM Dolph/M doltishness/SM doltish/YP dolt/MS domain/MS dome/DSMG Domenic/M Domenico/M Domeniga/M Domesday/M domestically domesticate/DSXGN domesticated/U domestication/M domesticity/MS domestic/S domicile/SDMG domiciliary dominance/MS dominant/YS dominate/VNGXSD domination/M dominator/M dominatrices dominatrix domineer/DSG domineeringness/M domineering/YP Dominga/M Domingo/M Dominguez/M Dominica/M Dominican/MS Dominick/M Dominic/M Dominik/M Domini/M dominion/MS Dominique/M dominoes domino/M Domitian/M Dom/M Donahue/M Donald/M Donaldson/M Donall/M Donal/M Donalt/M Dona/M dona/MS Donatello/M donate/XVGNSD donation/M donative/M Donaugh/M Donavon/M done/AUF Donella/M Donelle/M Donetsk/M Donetta/M dong/GDMS dongle/S Donia/M Donica/M Donielle/M Donizetti/M donkey/MS Donna/M Donnamarie/M donned Donnell/M Donnelly/M Donne/M Donner/M Donnie/M Donni/M donning donnishness/M donnish/YP Donn/RM donnybrook/MS Donny/M donor/MS Donovan/M don/S Don/SM don't donut/MS donutted donutting doodad/MS doodlebug/MS doodler/M doodle/SRDZG doohickey/MS Dooley/M Doolittle/M doom/MDGS doomsday/SM Doonesbury/M doorbell/SM door/GDMS doorhandles doorkeeper/M doorkeep/RZ doorknob/SM doorman/M doormat/SM doormen doornail/M doorplate/SM doors/I doorstep/MS doorstepped doorstepping doorstop/MS doorway/MS dooryard/SM dopamine dopant/M dopa/SM dope/DRSMZG doper/M dopey dopier dopiest dopiness/S Doppler/M Dorado/M Doralia/M Doralin/M Doralyn/M Doralynne/M Doralynn/M Dora/M Dorcas Dorchester/M Doreen/M Dorelia/M Dorella/M Dorelle/M Doré/M Dorena/M Dorene/M Doretta/M Dorette/M Dorey/M Doria/M Dorian/M Doric Dorice/M Dorie/M Dori/MS Dorine/M Dorisa/M Dorise/M Dorita/M dork/S dorky/RT dormancy/MS dormant/S dormer/M dormice dormitory/SM dorm/MRZS dormouse/M Dorolice/M Dorolisa/M Doro/M Dorotea/M Doroteya/M Dorothea/M Dorothee/M Dorothy/M Dorree/M Dorrie/M Dorri/SM Dorry/M dorsal/YS Dorsey/M Dorthea/M Dorthy/M Dortmund/M Dory/M dory/SM DOS dosage/SM dose/M dos/GDS Dosi/M dosimeter/MS dosimetry/M dossier/MS dost Dostoevsky/M DOT dotage/SM dotard/MS doter/M dote/S Doti/M doting/Y Dot/M dot/MDRSJZG Dotson/M dotted Dottie/M Dotti/M dottiness/M dotting Dotty/M dotty/PRT do/TZRHGJ Douala/M Douay/M Doubleday/M doubled/UA double/GPSRDZ doubleheader/MS doubleness/M doubler/M doubles/M doublespeak/S doublethink/M doublet/MS doubleton/M doubling/A doubloon/MS doubly doubt/AGSDMB doubted/U doubter/SM doubtfulness/SM doubtful/YP doubting/Y doubtlessness/M doubtless/YP douche/GSDM Dougherty/M dough/M doughs doughty/RT doughy/RT Dougie/M Douglas/M Douglass Doug/M Dougy/M dourness/MS Douro/M dour/TYRP douser/M douse/SRDG dovecote/MS Dover/M dove/RSM dovetail/GSDM dovish Dov/MR dowager/SM dowdily dowdiness/MS dowdy/TPSR dowel/GMDS dower/GDMS Dow/M downbeat/SM downcast/S downdraft/M downer/M Downey/M downfall/NMS downgrade/GSD down/GZSRD downheartedness/MS downhearted/PY downhill/RS downland download/DGS downpipes downplay/GDS downpour/MS downrange downrightness/M downright/YP downriver Downs downscale/GSD downside/S downsize/DSG downslope downspout/SM downstage/S downstairs downstate/SR downstream downswing/MS downtime/SM downtowner/M downtown/MRS downtrend/M downtrodden downturn/MS downwardness/M downward/YPS downwind downy/RT dowry/SM dowse/GZSRD dowser/M doxology/MS doyenne/SM doyen/SM Doyle/M Doy/M doze dozen/GHD dozenths dozer/M doz/XGNDRS dozy DP DPs dpt DPT drabbed drabber drabbest drabbing drabness/MS drab/YSP drachma/MS Draco/M draconian Draconian Dracula/M draft/AMDGS draftee/SM drafter/MS draftily draftiness/SM drafting/S draftsman/M draftsmanship/SM draftsmen draftsperson draftswoman draftswomen drafty/PTR dragged dragger/M dragging/Y draggy/RT drag/MS dragnet/MS dragonfly/SM dragonhead/M dragon/SM dragoon/DMGS drainage/MS drainboard/SM drained/U drainer/M drainpipe/MS drain/SZGRDM Drake/M drake/SM Dramamine/MS drama/SM dramatically/U dramatical/Y dramatic/S dramatics/M dramatist/MS dramatization/MS dramatized/U dramatizer/M dramatize/SRDZG dramaturgy/M Drambuie/M drammed dramming dram/MS drank Drano/M draper/M drapery/MS drape/SRDGZ drastic drastically drat/S dratted dratting Dravidian/M drawable draw/ASG drawback/MS drawbridge/SM drawer/SM drawing/SM drawler/M drawling/Y drawl/RDSG drawly drawn/AI drawnly drawnness drawstring/MS dray/SMDG dreadfulness/SM dreadful/YPS dreadlocks dreadnought/SM dread/SRDG dreamboat/SM dreamed/U dreamer/M dreamily dreaminess/SM dreaming/Y dreamland/SM dreamlessness/M dreamless/PY dreamlike dream/SMRDZG dreamworld/S dreamy/PTR drearily dreariness/SM drear/S dreary/TRSP Dreddy/M dredge/MZGSRD dredger/M Dredi/M dreg/MS Dreiser/M Dre/M drencher/M drench/GDRS Dresden/M dress/ADRSG dressage/MS dressed/U dresser/MS dresser's/A dresses/U dressiness/SM dressing/MS dressmaker/MS dressmaking/SM dressy/PTR drew/A Drew/M Drexel/M Dreyfus/M Dreyfuss dribble/DRSGZ dribbler/M driblet/SM drib/SM dried/U drier/M drifter/M drifting/Y drift/RDZSG driftwood/SM driller/M drilling/M drillmaster/SM drill/MRDZGS drinkable/S drink/BRSZG drinker/M dripped dripping/MS drippy/RT drip/SM driveler/M drivel/GZDRS driven/P driver/M drive/SRBGZJ driveway/MS drizzle/DSGM drizzling/Y drizzly/TR Dr/M drogue/MS drollery/SM drollness/MS droll/RDSPTG drolly dromedary/MS Drona/M drone/SRDGM droning/Y drool/GSRD droopiness/MS drooping/Y droop/SGD droopy/PRT drophead dropkick/S droplet/SM dropout/MS dropped dropper/SM dropping/MS dropsical drop/SM dropsy/MS drosophila/M dross/SM drought/SM drover/M drove/SRDGZ drowner/M drown/RDSJG drowse/SDG drowsily drowsiness/SM drowsy/PTR drubbed drubber/MS drubbing/SM drub/S Drucie/M Drucill/M Druci/M Drucy/M drudge/MGSRD drudger/M drudgery/SM drudging/Y Drud/M drugged druggie/SRT drugging druggist/SM Drugi/M drugless drug/SM drugstore/SM druidism/MS druid/MS Druid's Dru/M drumbeat/SGM drumhead/M drumlin/MS drummed drummer/SM drumming Drummond/M drum/SM drumstick/SM drunkard/SM drunkenness/SM drunken/YP drunk/SRNYMT drupe/SM Drury/M Drusie/M Drusilla/M Drusi/M Drusy/M druthers dryad/MS Dryden/M dryer/MS dry/GYDRSTZ dryish dryness/SM drys drystone drywall/GSD D's d's/A Dshubba/M DST DTP dualism/MS dualistic dualist/M duality/MS dual/YS Duane/M Dubai/M dubbed dubber/S dubbing/M dubbin/MS Dubcek/M Dubhe/M dubiety/MS dubiousness/SM dubious/YP Dublin/M Dubrovnik/M dub/S Dubuque/M ducal ducat/SM duce/CAIKF duce's Duchamp/M duchess/MS duchy/SM duckbill/SM ducker/M duck/GSRDM duckling/SM duckpins duckpond duckweed/MS ducky/RSMT ducted/CFI ductile/I ductility/SM ducting/F duct/KMSF ductless duct's/A ducts/CI ductwork/M dudder dude/MS dudgeon/SM dud/GMDS Dudley/M Dud/M duelist/MS duel/MRDGZSJ dueness/M duenna/MS due/PMS duet/MS duetted duetting duffel/M duffer/M duff/GZSRDM Duffie/M Duff/M Duffy/M Dugald/M dugout/SM dug/S duh DUI Duisburg/M dukedom/SM duke/DSMG Duke/M Dukey/M Dukie/M Duky/M Dulcea/M Dulce/M dulcet/SY Dulcia/M Dulciana/M Dulcie/M dulcify Dulci/M dulcimer/MS Dulcinea/M Dulcine/M Dulcy/M dullard/MS Dulles/M dullness/MS dull/SRDPGT dully dulness's Dulsea/M Duluth/M duly/U Du/M Dumas dumbbell/MS dumbfound/GSDR dumbness/MS Dumbo/M dumb/PSGTYRD dumbstruck dumbwaiter/SM dumdum/MS dummy/SDMG Dumont/M dumper/UM dumpiness/MS dumpling/MS dump/SGZRD dumpster/S Dumpster/S Dumpty/M dumpy/PRST Dunant/M Dunbar/M Duncan/M dunce/MS Dunc/M Dundee/M dunderhead/MS Dunedin/M dune/SM dungaree/SM dungeon/GSMD dunghill/MS dung/SGDM Dunham/M dunker/M dunk/GSRD Dunkirk/M Dunlap/M Dun/M dunned Dunne/M dunner dunnest dunning Dunn/M dunno/M dun/S Dunstan/M duodecimal/S duodena duodenal duodenum/M duologue/M duo/MS duopolist duopoly/M dupe/NGDRSMZ duper/M dupion/M duple duplexer/M duplex/MSRDG duplicability/M duplicable duplicate/ADSGNX duplication/AM duplicative duplicator/MS duplicitous duplicity/SM Dupont/MS DuPont/MS durability/MS durableness/M durable/PS durably Duracell/M durance/SM Durand/M Duran/M Durante/M Durant/M durational duration/MS Durban/M Dürer/M duress/SM Durex/M Durham/MS during Durkee/M Durkheim/M Dur/M Durocher/M durst durum/MS Durward/M Duse/M Dusenberg/M Dusenbury/M Dushanbe/M dusk/GDMS duskiness/MS dusky/RPT Düsseldorf dustbin/MS dustcart/M dustcover duster/M dustily dustiness/MS dusting/M Dustin/M dustless dustman/M dustmen dust/MRDGZS dustpan/SM Dusty/M dusty/RPT Dutch/M Dutchman/M Dutchmen dutch/MS Dutchwoman Dutchwomen duteous/Y dutiable dutifulness/S dutiful/UPY duty/SM Duvalier/M duvet/SM duxes Dvina/M Dvorák/M Dwain/M dwarfish dwarfism/MS dwarf/MTGSPRD Dwayne/M dweeb/S dweller/SM dwell/IGS dwelling/MS dwelt/I DWI Dwight/M dwindle/GSD dyadic dyad/MS Dyana/M Dyane/M Dyan/M Dyanna/M Dyanne/M Dyann/M dybbukim dybbuk/SM dyed/A dyeing/M dye/JDRSMZG dyer/M Dyer/M dyes/A dyestuff/SM dying/UA Dyke/M dyke's Dylan/M Dy/M Dynah/M Dyna/M dynamical/Y dynamic/S dynamics/M dynamism/SM dynamiter/M dynamite/RSDZMG dynamized dynamo/MS dynastic dynasty/MS dyne/M dysentery/SM dysfunctional dysfunction/MS dyslectic/S dyslexia/MS dyslexically dyslexic/S dyspepsia/MS dyspeptic/S dysprosium/MS dystopia/M dystrophy/M dz Dzerzhinsky/M E ea each Eachelle/M Eada/M Eadie/M Eadith/M Eadmund/M eagerness/MS eager/TSPRYM eagle/SDGM eaglet/SM Eakins/M Ealasaid/M Eal/M Eamon/M earache/SM eardrum/SM earful/MS ear/GSMDYH Earhart/M earing/M earldom/MS Earle/M Earlene/M Earlie/M Earline/M earliness/SM Earl/M earl/MS earlobe/S Early/M early/PRST earmark/DGSJ earmuff/SM earned/U earner/M Earnestine/M Earnest/M earnestness/MS earnest/PYS earn/GRDZTSJ earning/M earphone/MS earpieces earplug/MS Earp/M earring/MS earshot/MS earsplitting Eartha/M earthbound earthed/U earthenware/MS earthiness/SM earthliness/M earthling/MS earthly/TPR earth/MDNYG earthmen earthmover/M earthmoving earthquake/SDGM earthshaking earths/U earthward/S earthwork/MS earthworm/MS earthy/PTR Earvin/M earwax/MS earwigged earwigging earwig/MS eased/E ease/LDRSMG easel/MS easement/MS easer/M ease's/EU eases/UE easies easily/U easiness/MSU easing/M eastbound easterly/S Easter/M easterner/M Easterner/M easternmost Eastern/RZ eastern/ZR easter/Y east/GSMR Easthampton/M easting/M Eastland/M Eastman/M eastward/S Eastwick/M Eastwood/M East/ZSMR easygoingness/M easygoing/P easy/PUTR eatables eatable/U eaten/U eater/M eatery/MS eating/M Eaton/M eat/SJZGNRB eavesdropped eavesdropper/MS eavesdropping eavesdrop/S eave/SM Eba/M Ebba/M ebb/DSG EBCDIC Ebeneezer/M Ebeneser/M Ebenezer/M Eben/M Eberhard/M Eberto/M Eb/MN Ebola Ebonee/M Ebonics Ebony/M ebony/SM Ebro/M ebullience/SM ebullient/Y ebullition/SM EC eccentrically eccentricity/SM eccentric/MS eccl Eccles Ecclesiastes/M ecclesiastical/Y ecclesiastic/MS ECG echelon/SGDM echinoderm/SM echo/DMG echoed/A echoes/A echoic echolocation/SM éclair/MS éclat/MS eclectically eclecticism/MS eclectic/S eclipse/MGSD ecliptic/MS eclogue/MS ecocide/SM ecol Ecole/M ecologic ecological/Y ecologist/MS ecology/MS Eco/M econ Econometrica/M econometricians econometric/S econometrics/M economical/YU economic/S economics/M economist/MS economization economize/GZSRD economizer/M economizing/U economy/MS ecosystem/MS ecru/SM ecstasy/MS Ecstasy/S ecstatically ecstatic/S ectoplasm/M Ecuadoran/S Ecuadorean/S Ecuadorian/S Ecuador/M ecumenical/Y ecumenicism/SM ecumenicist/MS ecumenic/MS ecumenics/M ecumenism/SM ecumenist/MS eczema/MS Eda/M Edam/SM Edan/M ed/ASC Edda/M Eddie/M Eddi/M Edd/M Eddy/M eddy/SDMG Edee/M Edeline/M edelweiss/MS Ede/M edema/SM edematous eden Eden/M Edgard/M Edgardo/M Edgar/M edge/DRSMZGJ edgeless edger/M Edgerton/M Edgewater/M edgewise Edgewood/M edgily edginess/MS edging/M edgy/TRP edibility/MS edibleness/SM edible/SP edict/SM Edie/M edification/M edifice/SM edifier/M edifying/U edify/ZNXGRSD Edik/M Edi/MH Edinburgh/M Edin/M Edison/M editable Edita/M edited/IU Editha/M Edithe/M Edith/M edition/SM editorialist/M editorialize/DRSG editorializer/M editorial/YS editor/MS editorship/MS edit/SADG Ediva/M Edlin/M Edmond/M Edmon/M Edmonton/M Edmund/M Edna/M Edouard/M EDP eds Edsel/M Edsger/M EDT Eduard/M Eduardo/M educability/SM educable/S educated/YP educate/XASDGN educationalists educational/Y education/AM educationists educative educator/MS educ/DBG educe/S eduction/M Eduino/M edutainment/S Edvard/M Edwardian Edwardo/M Edward/SM Edwina/M Edwin/M Ed/XMN Edy/M Edythe/M Edyth/M EEC EEG eek/S eelgrass/M eel/MS e'en EEO EEOC e'er eerie/RT eerily eeriness/MS Eeyore/M effaceable/I effacement/MS effacer/M efface/SRDLG effectiveness/ISM effectives effective/YIP effector/MS effect/SMDGV effectual/IYP effectualness/MI effectuate/SDGN effectuation/M effeminacy/MS effeminate/SY effendi/MS efferent/SY effervesce/GSD effervescence/SM effervescent/Y effeteness/SM effete/YP efficacious/IPY efficaciousness/MI efficacy/IMS efficiency/MIS efficient/ISY Effie/M effigy/SM effloresce efflorescence/SM efflorescent effluence/SM effluent/MS effluvia effluvium/M effluxion efflux/M effortlessness/SM effortless/PY effort/MS effrontery/MS effulgence/SM effulgent effuse/XSDVGN effusion/M effusiveness/MS effusive/YP EFL e/FMDS Efrain/M Efrem/M Efren/M EFT egad egalitarian/I egalitarianism/MS egalitarians EGA/M Egan/M Egbert/M Egerton/M eggbeater/SM eggcup/MS egger/M egg/GMDRS eggheaded/P egghead/SDM eggnog/SM eggplant/MS eggshell/SM egis's eglantine/MS egocentrically egocentricity/SM egocentric/S egoism/SM egoistic egoistical/Y egoist/SM egomaniac/MS egomania/MS Egon/M Egor/M ego/SM egotism/SM egotistic egotistical/Y egotist/MS egregiousness/MS egregious/PY egress/SDMG egret/SM Egyptian/S Egypt/M Egyptology/M eh Ehrlich/M Eichmann/M eiderdown/SM eider/SM eidetic Eiffel/M eigenfunction/MS eigenstate/S eigenvalue/SM eigenvector/MS eighteen/MHS eighteenths eightfold eighth/MS eighths eightieths eightpence eight/SM eighty/SHM Eileen/M Eilis/M Eimile/M Einsteinian einsteinium/MS Einstein/SM Eire/M Eirena/M Eisenhower/M Eisenstein/M Eisner/M eisteddfod/M either ejaculate/SDXNG ejaculation/M ejaculatory ejecta ejection/SM ejector/SM eject/VGSD Ekaterina/M Ekberg/M eked/A eke/DSG EKG Ekstrom/M Ektachrome/M elaborateness/SM elaborate/SDYPVNGX elaboration/M elaborators Elaina/M Elaine/M Elana/M eland/SM Elane/M élan/M Elanor/M elans elapse/SDG el/AS elastically/I elasticated elasticity/SM elasticize/GDS elastic/S elastodynamics elastomer/M elatedness/M elated/PY elater/M elate/SRDXGN elation/M Elayne/M Elba/MS Elbe/M Elberta/M Elbertina/M Elbertine/M Elbert/M elbow/GDMS elbowroom/SM Elbrus/M Elden/M elderberry/MS elderflower elderliness/M elderly/PS elder/SY eldest Eldin/M Eldon/M Eldorado's Eldredge/M Eldridge/M Eleanora/M Eleanore/M Eleanor/M Eleazar/M electable/U elect/ASGD elected/U electioneer/GSD election/SAM electiveness/M elective/SPY electoral/Y electorate/SM elector/SM Electra/M electress/M electricalness/M electrical/PY electrician/SM electricity/SM electric/S electrification/M electrifier/M electrify/ZXGNDRS electrocardiogram/MS electrocardiograph/M electrocardiographs electrocardiography/MS electrochemical/Y electrocute/GNXSD electrocution/M electrode/SM electrodynamics/M electrodynamic/YS electroencephalogram/SM electroencephalographic electroencephalograph/M electroencephalographs electroencephalography/MS electrologist/MS electroluminescent electrolysis/M electrolyte/SM electrolytic electrolytically electrolyze/SDG electro/M electromagnetic electromagnetically electromagnetism/SM electromagnet/SM electromechanical electromechanics electromotive electromyograph electromyographic electromyographically electromyography/M electronegative electronically electronic/S electronics/M electron/MS electrophoresis/M electrophorus/M electroplate/DSG electroscope/MS electroscopic electroshock/GDMS electrostatic/S electrostatics/M electrotherapist/M electrotype/GSDZM electroweak eleemosynary Eleen/M elegance/ISM elegant/YI elegiacal elegiac/S elegy/SM elem elemental/YS elementarily elementariness/M elementary/P element/MS Elena/M Elene/M Eleni/M Elenore/M Eleonora/M Eleonore/M elephantiases elephantiasis/M elephantine elephant/SM elevated/S elevate/XDSNG elevation/M elevator/SM eleven/HM elevens/S elevenths elev/NX Elfie/M elfin/S elfish elf/M Elfreda/M Elfrida/M Elfrieda/M Elga/M Elgar/M Elianora/M Elianore/M Elia/SM Elicia/M elicitation/MS elicit/GSD elide/GSD Elie/M eligibility/ISM eligible/SI Elihu/M Elijah/M Eli/M eliminate/XSDYVGN elimination/M eliminator/SM Elinore/M Elinor/M Eliot/M Elisabeth/M Elisabet/M Elisabetta/M Elisa/M Elise/M Eliseo/M Elisha/M elision/SM Elissa/M Elita/M elite/MPS elitism/SM elitist/SM elixir/MS Elizabethan/S Elizabeth/M Elizabet/M Eliza/M Elka/M Elke/M Elkhart/M elk/MS Elladine/M Ella/M Ellary/M Elle/M Ellene/M Ellen/M Ellerey/M Ellery/M Ellesmere/M Ellette/M Ellie/M Ellington/M Elliot/M Elliott/M ellipse/MS ellipsis/M ellipsoidal ellipsoid/MS ellipsometer/MS ellipsometry elliptic elliptical/YS ellipticity/M Elli/SM Ellison/M Ellissa/M ell/MS Ellswerth/M Ellsworth/M Ellwood/M Elly/M Ellyn/M Ellynn/M Elma/M Elmer/M Elmhurst/M Elmira/M elm/MRS Elmo/M Elmore/M Elmsford/M El/MY Elna/MH Elnar/M Elnath/M Elnora/M Elnore/M elocutionary elocutionist/MS elocution/SM elodea/S Elohim/M Eloisa/M Eloise/M elongate/NGXSD elongation/M Elonore/M elopement/MS eloper/M elope/SRDLG eloquence/SM eloquent/IY Elora/M Eloy/M Elroy/M els Elsa/M Elsbeth/M else/M Else/M Elset/M elsewhere Elsey/M Elsie/M Elsi/M Elsinore/M Elspeth/M Elston/M Elsworth/M Elsy/M Eltanin/M Elton/M eluate/SM elucidate/SDVNGX elucidation/M elude/GSD elusiveness/SM elusive/YP elute/DGN elution/M Elva/M elven Elvera/M elver/SM elves/M Elvia/M Elvina/M Elvin/M Elvira/M elvish Elvis/M Elvyn/M Elwin/M Elwira/M Elwood/M Elwyn/M Ely/M Elyn/M Elysée/M Elysees Elyse/M Elysha/M Elysia/M elysian Elysian Elysium/SM Elyssa/M EM emaciate/NGXDS emaciation/M emacs/M Emacs/M email/SMDG Emalee/M Emalia/M Ema/M emanate/XSDVNG emanation/M emancipate/DSXGN emancipation/M emancipator/MS Emanuele/M Emanuel/M emasculate/GNDSX emasculation/M embalmer/M embalm/ZGRDS embank/GLDS embankment/MS embarcadero embargoes embargo/GMD embark/ADESG embarkation/EMS embarrassedly embarrassed/U embarrassing/Y embarrassment/MS embarrass/SDLG embassy/MS embattle/DSG embeddable embedded embedder embedding/MS embed/S embellished/U embellisher/M embellish/LGRSD embellishment/MS ember/MS embezzle/LZGDRS embezzlement/MS embezzler/M embitter/LGDS embitterment/SM emblazon/DLGS emblazonment/SM emblematic emblem/GSMD embodier/M embodiment/ESM embody/ESDGA embolden/DSG embolism/SM embosom embosser/M emboss/ZGRSD embouchure/SM embower/GSD embraceable embracer/M embrace/RSDVG embracing/Y embrasure/MS embrittle embrocation/SM embroiderer/M embroider/SGZDR embroidery/MS embroilment/MS embroil/SLDG embryologist/SM embryology/MS embryonic embryo/SM emceeing emcee/SDM Emelda/M Emelen/M Emelia/M Emelina/M Emeline/M Emelita/M Emelyne/M emendation/MS emend/SRDGB emerald/SM Emera/M emerge/ADSG emergence/MAS emergency/SM emergent/S emerita emeritae emeriti emeritus Emerson/M Emery/M emery/MGSD emetic/S emf/S emigrant/MS emigrate/SDXNG emigration/M émigré/S Emilee/M Emile/M Emilia/M Emilie/M Emili/M Emiline/M Emilio/M Emil/M Emily/M eminence/MS Eminence/MS eminent/Y emirate/SM emir/SM emissary/SM emission/AMS emissivity/MS emit/S emittance/M emitted emitter/SM emitting Emlen/M Emlyn/M Emlynne/M Emlynn/M em/M Em/M Emmalee/M Emmaline/M Emmalyn/M Emmalynne/M Emmalynn/M Emma/M Emmanuel/M Emmeline/M Emmerich/M Emmery/M Emmet/M Emmett/M Emmey/M Emmie/M Emmi/M Emmit/M Emmott/M Emmye/M Emmy/SM Emogene/M emollient/S emolument/SM Emory/M emote/SDVGNX emotionalism/MS emotionality/M emotionalize/GDS emotional/UY emotionless emotion/M emotive/Y empaneled empaneling empath empathetic empathetical/Y empathic empathize/SDG empathy/MS emperor/MS emphases emphasis/M emphasize/ZGCRSDA emphatically/U emphatic/U emphysema/SM emphysematous empire/MS empirical/Y empiricism/SM empiricist/SM empiric/SM emplace/L emplacement/MS employability/UM employable/US employed/U employee/SM employer/SM employ/LAGDS employment/UMAS emporium/MS empower/GLSD empowerment/MS empress/MS emptier/M emptily emptiness/SM empty/GRSDPT empyrean/SM ems/C EMT emulate/SDVGNX emulation/M emulative/Y emulator/MS emulsification/M emulsifier/M emulsify/NZSRDXG emulsion/SM emu/SM Emylee/M Emyle/M enabler/M enable/SRDZG enactment/ASM enact/SGALD enameler/M enamelware/SM enamel/ZGJMDRS enamor/DSG en/BM enc encamp/LSDG encampment/MS encapsulate/SDGNX encapsulation/M encase/GSDL encasement/SM encephalitic encephalitides encephalitis/M encephalographic encephalopathy/M enchain/SGD enchanter/MS enchant/ESLDG enchanting/Y enchantment/MSE enchantress/MS enchilada/SM encipherer/M encipher/SRDG encircle/GLDS encirclement/SM encl enclave/MGDS enclosed/U enclose/GDS enclosure/SM encoder/M encode/ZJGSRD encomium/SM encompass/GDS encore/GSD encounter/GSD encouragement/SM encourager/M encourage/SRDGL encouraging/Y encroacher/M encroach/LGRSD encroachment/MS encrustation/MS encrust/DSG encrypt/DGS encrypted/U encryption/SM encumbered/U encumber/SEDG encumbrancer/M encumbrance/SRM ency encyclical/SM encyclopaedia's encyclopedia/SM encyclopedic encyst/GSLD encystment/MS endanger/DGSL endangerment/SM endear/GSLD endearing/Y endearment/MS endeavored/U endeavorer/M endeavor/GZSMRD endemically endemicity endemic/S ender/M endgame/M Endicott/M ending/M endive/SM endlessness/MS endless/PY endmost endnote/MS endocrine/S endocrinologist/SM endocrinology/SM endogamous endogamy/M endogenous/Y endomorphism/SM endorse/DRSZGL endorsement/MS endorser/M endoscope/MS endoscopic endoscopy/SM endosperm/M endothelial endothermic endow/GSDL endowment/SM endpoint/MS endue/SDG endungeoned endurable/U endurably/U endurance/SM endure/BSDG enduringness/M enduring/YP endways Endymion/M end/ZGVMDRSJ ENE enema/SM enemy/SM energetically energetic/S energetics/M energized/U energizer/M energize/ZGDRS energy/MS enervate/XNGVDS enervation/M enfeeble/GLDS enfeeblement/SM enfilade/MGDS enfold/SGD enforceability/M enforceable/U enforced/Y enforce/LDRSZG enforcement/SM enforcer/M enforcible/U enfranchise/ELDRSG enfranchisement/EMS enfranchiser/M engage/ADSGE engagement/SEM engaging/Y Engelbert/M Engel/MS engender/DGS engineer/GSMDJ engineering/MY engine/MGSD England/M england/ZR Englebert/M Englewood/M English/GDRSM Englishman/M Englishmen Englishwoman/M Englishwomen Eng/M engorge/LGDS engorgement/MS Engracia/M engram/MS engraver/M engrave/ZGDRSJ engraving/M engrossed/Y engrosser/M engross/GLDRS engrossing/Y engrossment/SM engulf/GDSL engulfment/SM enhanceable enhance/LZGDRS enhancement/MS enhancer/M enharmonic Enid/M Enif/M enigma/MS enigmatic enigmatically Eniwetok/M enjambement's enjambment/MS enjoinder enjoin/GSD enjoyability enjoyableness/M enjoyable/P enjoyably enjoy/GBDSL enjoyment/SM Enkidu/M enlargeable enlarge/LDRSZG enlargement/MS enlarger/M enlightened/U enlighten/GDSL enlightening/U enlightenment/SM enlistee/MS enlister/M enlistment/SAM enlist/SAGDL enliven/LDGS enlivenment/SM enmesh/DSLG enmeshment/SM enmity/MS Ennis/M ennoble/LDRSG ennoblement/SM ennobler/M ennui/SM Enoch/M enormity/SM enormousness/MS enormous/YP Enos enough enoughs enplane/DSG enqueue/DS enquirer/S enquiringly enrage/SDG enrapture/GSD Enrica/M enricher/M Enrichetta/M enrich/LDSRG enrichment/SM Enrico/M Enrika/M Enrique/M Enriqueta/M enrobed enrollee/SM enroll/LGSD enrollment/SM ens ensconce/DSG ensemble/MS enshrine/DSLG enshrinement/SM enshroud/DGS ensign/SM ensilage/DSMG enslavement/MS enslaver/M enslave/ZGLDSR ensnare/GLDS ensnarement/SM Ensolite/M ensue/SDG ensurer/M ensure/SRDZG entailer/M entailment/MS entail/SDRLG entangle/EGDRSL entanglement/ESM entangler/EM entente/MS enter/ASDG entered/U enterer/M enteritides enteritis/SM enterprise/GMSR Enterprise/M enterpriser/M enterprising/Y entertainer/M entertaining/Y entertainment/SM entertain/SGZRDL enthalpy/SM enthrall/GDSL enthrallment/SM enthrone/GDSL enthronement/MS enthuse/DSG enthusiasm/SM enthusiastically/U enthusiastic/U enthusiast/MS enticement/SM entice/SRDJLZG enticing/Y entire/SY entirety/SM entitle/GLDS entitlement/MS entity/SM entomb/GDSL entombment/MS entomological entomologist/S entomology/MS entourage/SM entr'acte/S entrails entrainer/M entrain/GSLDR entrancement/MS entrance/MGDSL entranceway/M entrancing/Y entrant/MS entrapment/SM entrapped entrapping entrap/SL entreating/Y entreat/SGD entreaty/SM entrée/S entrench/LSDG entrenchment/MS entrepreneurial entrepreneur/MS entrepreneurship/M entropic entropy/MS entrust/DSG entry/ASM entryway/SM entwine/DSG enumerable enumerate/AN enumerated/U enumerates enumerating enumeration's/A enumeration/SM enumerative enumerator/SM enunciable enunciated/U enunciate/XGNSD enunciation/M enureses enuresis/M envelope/MS enveloper/M envelopment/MS envelop/ZGLSDR envenom/SDG enviableness/M enviable/U enviably envied/U envier/M enviousness/SM envious/PY environ/LGSD environmentalism/SM environmentalist/SM environmental/Y environment/MS envisage/DSG envision/GSD envoy/SM envying/Y envy/SRDMG enzymatic enzymatically enzyme/SM enzymology/M Eocene EOE eohippus/M Eolanda/M Eolande/M eolian eon/SM EPA epaulet/SM épée/S ephedrine/MS ephemeral/SY ephemera/MS ephemerids ephemeris/M Ephesian/S Ephesians/M Ephesus/M Ephraim/M Ephrayim/M Ephrem/M epically epicenter/SM epic/SM Epictetus/M Epicurean epicurean/S epicure/SM Epicurus/M epicycle/MS epicyclic epicyclical/Y epicycloid/M epidemically epidemic/MS epidemiological/Y epidemiologist/MS epidemiology/MS epidermal epidermic epidermis/MS epidural epigenetic epiglottis/SM epigrammatic epigram/MS epigrapher/M epigraph/RM epigraphs epigraphy/MS epilepsy/SM epileptic/S epilogue/SDMG Epimethius/M epinephrine/SM epiphany/SM Epiphany/SM epiphenomena episcopacy/MS episcopalian Episcopalian/S Episcopal/S episcopal/Y episcopate/MS episode/SM episodic episodically epistemic epistemological/Y epistemology/M epistle/MRS Epistle/SM epistolary/S epistolatory epitaph/GMD epitaphs epitaxial/Y epitaxy/M epithelial epithelium/MS epithet/MS epitome/MS epitomized/U epitomizer/M epitomize/SRDZG epochal/Y epoch/M epochs eponymous epoxy/GSD epsilon/SM Epsom/M Epstein/M equability/MS equableness/M equable/P equably equaling equality/ISM equalization/MS equalize/DRSGJZ equalized/U equalizer/M equalizes/U equal/USDY equanimity/MS equate/NGXBSD equation/M equatorial/S equator/SM equerry/MS equestrianism/SM equestrian/S equestrienne/SM equiangular equidistant/Y equilateral/S equilibrate/GNSD equilibration/M equilibrium/MSE equine/S equinoctial/S equinox/MS equipage/SM equipartition/M equip/AS equipment/SM equipoise/GMSD equipotent equipped/AU equipping/A equiproportional equiproportionality equiproportionate equitable/I equitableness/M equitably/I equitation/SM equity/IMS equiv equivalence/DSMG equivalent/SY equivocalness/MS equivocal/UY equivocate/NGSDX equivocation/M equivocator/SM Equuleus/M ER ERA eradicable/I eradicate/SDXVGN eradication/M eradicator/SM era/MS Eran/M erase/N eraser/M erasion/M Erasmus/M eras/SRDBGZ Erastus/M erasure/MS Erato/M Eratosthenes/M erbium/SM Erda/M ere Erebus/M erect/GPSRDY erectile erection/SM erectness/MS erector/SM Erek/M erelong eremite/MS Erena/M ergo ergodic ergodicity/M ergonomically ergonomics/M ergonomic/U ergophobia ergosterol/SM ergot/SM erg/SM Erhard/M Erhart/M Erica/M Ericha/M Erich/M Ericka/M Erick/M Erickson/M Eric/M Ericson's Ericsson's Eridanus/M Erie/SM Erika/M Erik/M Erikson/M Erina/M Erin/M Erinna/M Erinn/M eris Eris Eritrea/M Erlang/M Erlenmeyer/M Erl/M Er/M Erma/M Ermanno/M Ermengarde/M Ermentrude/M Ermina/M ermine/MSD Erminia/M Erminie/M Ermin/M Ernaline/M Erna/M Ernesta/M Ernestine/M Ernest/M Ernesto/M Ernestus/M Ernie/M Ernst/M Erny/M erode/SDG erodible erogenous erosible erosional erosion/SM erosiveness/M erosive/P Eros/SM erotically erotica/M eroticism/MS erotic/S errancy/MS errand/MS errantry/M errant/YS errata/SM erratically erratic/S erratum/MS err/DGS Errick/M erring/UY Erroll/M Errol/M erroneousness/M erroneous/YP error/SM ersatz/S Erse/M Erskine/M erst erstwhile Ertha/M eructation/MS eruct/DGS erudite/NYX erudition/M erupt/DSVG eruption/SM eruptive/SY Ervin/M ErvIn/M Erv/M Erwin/M Eryn/M erysipelas/SM erythrocyte/SM es e's Es E's Esau/M escadrille/M escalate/CDSXGN escalation/MC escalator/SM escallop/SGDM escapable/I escapade/SM escapee/MS escape/LGSRDB escapement/MS escaper/M escapism/SM escapist/S escapology escarole/MS escarpment/MS eschatology/M Escherichia/M Escher/M eschew/SGD Escondido/M escort/SGMD escritoire/SM escrow/DMGS escudo/MS escutcheon/SM Esdras/M ESE Eskimo/SM ESL Esma/M Esmaria/M Esmark/M Esme/M Esmeralda/M esophageal esophagi esophagus/M esoteric esoterica esoterically esp ESP espadrille/MS Espagnol/M espalier/SMDG especial/Y Esperanto/M Esperanza/M Espinoza/M espionage/SM esplanade/SM Esp/M Esposito/M espousal/MS espouser/M espouse/SRDG espresso/SM esprit/SM espy/GSD Esq/M esquire/GMSD Esquire/S Esra/M Essa/M essayer/M essayist/SM essay/SZMGRD essence/MS Essene/SM Essen/M essentialist/M essentially essentialness/M essential/USI Essequibo/M Essex/M Essie/M Essy/M EST established/U establisher/M establish/LAEGSD establishment/EMAS Establishment/MS Esta/M estate/GSDM Esteban/M esteem/EGDS Estela/M Estele/M Estella/M Estelle/M Estell/M Estel/M Esterházy/M ester/M Ester/M Estes Estevan/M Esther/M esthete's esthetically esthetic's esthetics's estimable/I estimableness/M estimate/XDSNGV estimating/A estimation/M estimator/SM Estonia/M Estonian/S estoppal Estrada/M estrange/DRSLG estrangement/SM estranger/M Estrella/M Estrellita/M estrogen/SM estrous estrus/SM est/RZ estuarine estuary/SM et ET ETA Etan/M eta/SM etc etcetera/SM etcher/M etch/GZJSRD etching/M ETD eternalness/SM eternal/PSY eternity/SM ethane/SM Ethan/M ethanol/MS Ethelbert/M Ethelda/M Ethelind/M Etheline/M Ethelin/M Ethel/M Ethelred/M Ethelyn/M Ethe/M etherealness/M ethereal/PY etherized Ethernet/MS ether/SM ethically/U ethicalness/M ethical/PYS ethicist/S ethic/MS Ethiopia/M Ethiopian/S ethnically ethnicity/MS ethnic/S ethnocentric ethnocentrism/MS ethnographers ethnographic ethnography/M ethnological ethnologist/SM ethnology/SM ethnomethodology ethological ethologist/MS ethology/SM ethos/SM ethylene/MS Ethyl/M ethyl/SM Etienne/M etiologic etiological etiology/SM etiquette/SM Etna/M Etruria/M Etruscan/MS Etta/M Ettie/M Etti/M Ettore/M Etty/M étude/MS etymological/Y etymologist/SM etymology/MS EU eucalypti eucalyptus/SM Eucharistic Eucharist/SM euchre/MGSD euclidean Euclid/M Eudora/M Euell/M Eugene/M Eugenia/M eugenically eugenicist/SM eugenic/S eugenics/M Eugenie/M Eugenio/M Eugenius/M Eugen/M Eugine/M Eulalie/M Eula/M Eulerian/M Euler/M eulogistic eulogist/MS eulogized/U eulogize/GRSDZ eulogizer/M eulogy/MS Eu/M Eumenides Eunice/M eunuch/M eunuchs Euphemia/M euphemism/MS euphemistic euphemistically euphemist/M euphonious/Y euphonium/M euphony/SM euphoria/SM euphoric euphorically Euphrates/M Eurasia/M Eurasian/S eureka/S Euripides/M Eur/M Eurodollar/SM Europa/M Europeanization/SM Europeanized European/MS Europe/M europium/MS Eurydice/M Eustace/M Eustachian/M Eustacia/M eutectic Euterpe/M euthanasia/SM euthenics/M evacuate/DSXNGV evacuation/M evacuee/MS evader/M evade/SRDBGZ Evaleen/M evaluable evaluate/ADSGNX evaluated/U evaluational evaluation/MA evaluative evaluator/MS Eva/M evanescence/MS evanescent Evangelia/M evangelic evangelicalism/SM Evangelical/S evangelical/YS Evangelina/M Evangeline/M Evangelin/M evangelism/SM evangelistic evangelist/MS Evangelist/MS evangelize/GDS Evania/M Evan/MS Evanne/M Evanston/M Evansville/M evaporate/VNGSDX evaporation/M evaporative/Y evaporator/MS evasion/SM evasiveness/SM evasive/PY Eveleen/M Evelina/M Eveline/M Evelin/M Evelyn/M Eve/M evened evener/M evenhanded/YP evening/SM Evenki/M Even/M evenness/MSU even/PUYRT evens evensong/MS eventfulness/SM eventful/YU eventide/SM event/SGM eventuality/MS eventual/Y eventuate/GSD Everard/M Eveready/M Evered/M Everest/M Everette/M Everett/M everglade/MS Everglades evergreen/S Everhart/M everlastingness/M everlasting/PYS everliving evermore EverReady/M eve/RSM ever/T every everybody/M everydayness/M everyday/P everyman everyone/MS everyplace everything everywhere eve's/A eves/A Evey/M evict/DGS eviction/SM evidence/MGSD evidential/Y evident/YS Evie/M evildoer/SM evildoing/MS evilness/MS evil/YRPTS evince/SDG Evin/M eviscerate/GNXDS evisceration/M Evita/M Ev/MN evocable evocate/NVX evocation/M evocativeness/M evocative/YP evoke/SDG evolute/NMXS evolutionarily evolutionary evolutionist/MS evolution/M evolve/SDG Evonne/M Evvie/M Evvy/M Evy/M Evyn/M Ewan/M Eward/M Ewart/M Ewell/M ewe/MZRS Ewen/M ewer/M Ewing/M exacerbate/NGXDS exacerbation/M exacter/M exactingness/M exacting/YP exaction/SM exactitude/ISM exactly/I exactness/MSI exact/TGSPRDY exaggerate/DSXNGV exaggerated/YP exaggeration/M exaggerative/Y exaggerator/MS exaltation/SM exalted/Y exalter/M exalt/ZRDGS examen/M examination/AS examination's examine/BGZDRS examined/AU examinees examiner/M examines/A examining/A exam/MNS example/DSGM exampled/U exasperate/DSXGN exasperated/Y exasperating/Y exasperation/M Excalibur/M excavate/NGDSX excavation/M excavator/SM Excedrin/M exceeder/M exceeding/Y exceed/SGDR excelled excellence/SM excellency/MS Excellency/MS excellent/Y excelling excel/S excelsior/S except/DSGV exceptionable/U exceptionalness/M exceptional/YU exception/BMS excerpter/M excerpt/GMDRS excess/GVDSM excessiveness/M excessive/PY exchangeable exchange/GDRSZ exchanger/M exchequer/SM Exchequer/SM excise/XMSDNGB excision/M excitability/MS excitableness/M excitable/P excitably excitation/SM excitatory excited/Y excitement/MS exciter/M excite/RSDLBZG excitingly exciting/U exciton/M exclaimer/M exclaim/SZDRG exclamation/MS exclamatory exclude/DRSG excluder/M exclusionary exclusioner/M exclusion/SZMR exclusiveness/SM exclusive/SPY exclusivity/MS excommunicate/XVNGSD excommunication/M excoriate/GNXSD excoriation/M excremental excrement/SM excrescence/MS excrescent excreta excrete/NGDRSX excreter/M excretion/M excretory/S excruciate/NGDS excruciating/Y excruciation/M exculpate/XSDGN exculpation/M exculpatory excursionist/SM excursion/MS excursiveness/SM excursive/PY excursus/MS excusable/IP excusableness/IM excusably/I excuse/BGRSD excused/U excuser/M exec/MS execrableness/M execrable/P execrably execrate/DSXNGV execration/M executable/MS execute/NGVZBXDRS executer/M executional executioner/M execution/ZMR executive/SM executor/SM executrices executrix/M exegeses exegesis/M exegete/M exegetical exegetic/S exemplariness/M exemplar/MS exemplary/P exemplification/M exemplifier/M exemplify/ZXNSRDG exemption/MS exempt/SDG exerciser/M exercise/ZDRSGB exertion/MS exert/SGD Exeter/M exeunt exhalation/SM exhale/GSD exhausted/Y exhauster/M exhaustible/I exhausting/Y exhaustion/SM exhaustiveness/MS exhaustive/YP exhaust/VGRDS exhibitioner/M exhibitionism/MS exhibitionist/MS exhibition/ZMRS exhibitor/SM exhibit/VGSD exhilarate/XSDVNG exhilarating/Y exhilaration/M exhortation/SM exhort/DRSG exhorter/M exhumation/SM exhume/GRSD exhumer/M exigence/S exigency/SM exigent/SY exiguity/SM exiguous exile/SDGM existence/MS existent/I existentialism/MS existentialistic existentialist/MS existential/Y existents exist/SDG exit/MDSG exobiology/MS exocrine Exodus/M exodus/SM exogamous exogamy/M exogenous/Y exonerate/SDVGNX exoneration/M exorbitance/MS exorbitant/Y exorcise/SDG exorcism/SM exorcist/SM exorcizer/M exoskeleton/MS exosphere/SM exothermic exothermically exotica exotically exoticism/SM exoticness/M exotic/PS exp expandability/M expand/DRSGZB expanded/U expander/M expanse/DSXGNVM expansible expansionary expansionism/MS expansionist/MS expansion/M expansiveness/S expansive/YP expatiate/XSDNG expatiation/M expatriate/SDNGX expatriation/M expectancy/MS expectant/YS expectational expectation/MS expected/UPY expecting/Y expectorant/S expectorate/NGXDS expectoration/M expect/SBGD expedience/IS expediency/IMS expedients expedient/YI expediter/M expedite/ZDRSNGX expeditionary expedition/M expeditiousness/MS expeditious/YP expeditor's expellable expelled expelling expel/S expendable/S expended/U expender/M expenditure/SM expend/SDRGB expense/DSGVM expensive/IYP expensiveness/SMI experienced/U experience/ISDM experiencing experiential/Y experimentalism/M experimentalist/SM experimental/Y experimentation/SM experimenter/M experiment/GSMDRZ experted experting expertise/SM expertize/GD expertnesses expertness/IM expert/PISY expert's expiable/I expiate/XGNDS expiation/M expiatory expiration/MS expired/U expire/SDG expiry/MS explainable/UI explain/ADSG explained/U explainer/SM explanation/MS explanatory expletive/SM explicable/I explicate/VGNSDX explication/M explicative/Y explicitness/SM explicit/PSY explode/DSRGZ exploded/U exploder/M exploitation/MS exploitative exploited/U exploiter/M exploit/ZGVSMDRB exploration/MS exploratory explore/DSRBGZ explored/U explorer/M explosion/MS explosiveness/SM explosive/YPS expo/MS exponential/SY exponentiate/XSDNG exponentiation/M exponent/MS exportability exportable export/AGSD exportation/SM exporter/MS export's expose exposed/U exposer/M exposit/D exposition/SM expositor/MS expository expos/RSDZG expostulate/DSXNG expostulation/M exposure/SM expounder/M expound/ZGSDR expressed/U expresser/M express/GVDRSY expressibility/I expressible/I expressibly/I expressionism/SM expressionistic expressionist/S expressionless/YP expression/MS expressive/IYP expressiveness/MS expressiveness's/I expressway/SM expropriate/XDSGN expropriation/M expropriator/SM expulsion/MS expunge/GDSR expunger/M expurgated/U expurgate/SDGNX expurgation/M exquisiteness/SM exquisite/YPS ex/S ext extant extemporaneousness/MS extemporaneous/YP extempore/S extemporization/SM extemporizer/M extemporize/ZGSRD extendability/M extendedly extendedness/M extended/U extender/M extendibility/M extendibles extend/SGZDR extensibility/M extensible/I extensional/Y extension/SM extensiveness/SM extensive/PY extensor/MS extent/SM extenuate/XSDGN extenuation/M exterior/MYS exterminate/XNGDS extermination/M exterminator/SM externalities externalization/SM externalize/GDS external/YS extern/M extinct/DGVS extinction/MS extinguishable/I extinguish/BZGDRS extinguisher/M extirpate/XSDVNG extirpation/M extolled extoller/M extolling extol/S extort/DRSGV extorter/M extortionate/Y extortioner/M extortionist/SM extortion/ZSRM extracellular/Y extract/GVSBD extraction/SM extractive/Y extractor/SM extracurricular/S extradite/XNGSDB extradition/M extragalactic extralegal/Y extramarital extramural extraneousness/M extraneous/YP extraordinarily extraordinariness/M extraordinary/PS extrapolate/XVGNSD extrapolation/M extra/S extrasensory extraterrestrial/S extraterritorial extraterritoriality/MS extravagance/MS extravagant/Y extravaganza/SM extravehicular extravert's extrema extremal extreme/DSRYTP extremeness/MS extremism/SM extremist/MS extremity/SM extricable/I extricate/XSDNG extrication/M extrinsic extrinsically extroversion/SM extrovert/GMDS extrude/GDSR extruder/M extrusion/MS extrusive exuberance/MS exuberant/Y exudate/XNM exudation/M exude/GSD exultant/Y exultation/SM exult/DGS exulting/Y exurban exurbanite/SM exurbia/MS exurb/MS Exxon/M Eyck/M Eyde/M Eydie/M eyeball/GSMD eyebrow/MS eyed/P eyedropper/MS eyeful/MS eye/GDRSMZ eyeglass/MS eyelash/MS eyeless eyelet/GSMD eyelid/SM eyeliner/MS eyeopener/MS eyeopening eyepiece/SM eyer/M eyeshadow eyesight/MS eyesore/SM eyestrain/MS eyeteeth eyetooth/M eyewash/MS eyewitness/SM Eyre/M eyrie's Eysenck/M Ezechiel/M Ezekiel/M Ezequiel/M Eziechiele/M Ezmeralda/M Ezra/M Ezri/M F FAA Fabe/MR Fabergé/M Faber/M Fabiano/M Fabian/S Fabien/M Fabio/M fable/GMSRD fabler/M fabricate/SDXNG fabrication/M fabricator/MS fabric/MS fabulists fabulousness/M fabulous/YP facade/GMSD face/AGCSD facecloth facecloths faceless/P faceplate/M facer/CM face's facetiousness/MS facetious/YP facet/SGMD facial/YS facileness/M facile/YP facilitate/VNGXSD facilitation/M facilitator/SM facilitatory facility/MS facing/MS facsimileing facsimile/MSD factional factionalism/SM faction/SM factiousness/M factious/PY factitious fact/MS facto factoid/S factorial/MS factoring/A factoring's factorisable factorization/SM factorize/GSD factor/SDMJG factory/MS factotum/MS factuality/M factualness/M factual/PY faculty/MS faddish faddist/SM fadedly faded/U fadeout fader/M fade/S fading's fading/U fad/ZGSMDR Fae/M faerie/MS Faeroe/M faery's Fafnir/M fagged fagging faggoting's Fagin/M fag/MS fagoting/M fagot/MDSJG Fahd/M Fahrenheit/S faïence/S failing's failing/UY fail/JSGD faille/MS failsafe failure/SM Faina/M fain/GTSRD fainter/M fainthearted faintness/MS faint/YRDSGPT Fairbanks Fairchild/M faired Fairfax/M Fairfield/M fairgoer/S fairground/MS fairing/MS fairish Fairleigh/M fairless Fairlie/M Fair/M Fairmont/M fairness's fairness/US Fairport/M fairs fair/TURYP Fairview/M fairway/MS fairyland/MS fairy/MS fairytale Faisalabad Faisal/M faithed faithfulness/MSU faithfuls faithful/UYP faithing faithlessness/SM faithless/YP Faith/M faiths faith's faith/U fajitas faker/M fake/ZGDRS fakir/SM falafel falconer/M falconry/MS falcon/ZSRM Falito/M Falkland/MS Falk/M Falkner/M fallaciousness/M fallacious/PY fallacy/MS faller/M fallibility/MSI fallible/I fallibleness/MS fallibly/I falloff/S Fallon/M fallopian Fallopian/M fallout/MS fallowness/M fallow/PSGD fall/SGZMRN falsehood/SM falseness/SM false/PTYR falsetto/SM falsie/MS falsifiability/M falsifiable/U falsification/M falsifier/M falsify/ZRSDNXG falsity/MS Falstaff/M falterer/M faltering/UY falter/RDSGJ Falwell/M fa/M famed/C fame/DSMG fames/C familial familiarity/MUS familiarization/MS familiarized/U familiarizer/M familiarize/ZGRSD familiarizing/Y familiarly/U familiarness/M familiar/YPS family/MS famine/SM faming/C famish/GSD famously/I famousness/M famous/PY fanaticalness/M fanatical/YP fanaticism/MS fanatic/SM Fanchette/M Fanchon/M fancied Fancie/M fancier/SM fanciest fancifulness/MS fanciful/YP fancily fanciness/SM fancying fancy/IS Fancy/M fancywork/SM fandango/SM Fanechka/M fanfare/SM fanfold/M fang/DMS fangled Fania/M fanlight/SM Fan/M fanned Fannie/M Fanni/M fanning fanny/SM Fanny/SM fanout fan/SM fantail/SM fantasia/SM fantasist/M fantasize/SRDG fantastical/Y fantastic/S fantasy/GMSD Fanya/M fanzine/S FAQ/SM Faraday/M farad/SM Farah/M Fara/M Farand/M faraway Farber/M farce/SDGM farcical/Y fare/MS farer/M farewell/DGMS farfetchedness/M far/GDR Fargo/M Farica/M farinaceous farina/MS Farkas/M Farlay/M Farlee/M Farleigh/M Farley/M Farlie/M Farly/M farmer/M Farmer/M farmhand/S farmhouse/SM farming/M Farmington/M farmland/SM farm/MRDGZSJ farmstead/SM farmworker/S Far/MY farmyard/MS faro/MS farragoes farrago/M Farragut/M Farrah/M Farrakhan/M Farra/M Farrand/M Farrell/M Farrel/M farrier/SM Farris/M Farr/M farrow/DMGS farseeing farsightedness/SM farsighted/YP farther farthermost farthest farthing/SM fart/MDGS! fas fascia/SM fascicle/DSM fasciculate/DNX fasciculation/M fascinate/SDNGX fascinating/Y fascination/M fascism/MS Fascism's fascistic Fascist's fascist/SM fashionableness/M fashionable/PS fashionably/U fashion/ADSG fashioner/SM fashion's Fassbinder/M fastback/MS fastball/S fasten/AGUDS fastener/MS fastening/SM fast/GTXSPRND fastidiousness/MS fastidious/PY fastness/MS fatalism/MS fatalistic fatalistically fatalist/MS fatality/MS fatal/SY fatback/SM fatefulness/MS fateful/YP fate/MS Fates fatheaded/P fathead/SMD father/DYMGS fathered/U fatherhood/MS fatherland/SM fatherless fatherliness/M fatherly/P Father/SM fathomable/U fathomless fathom/MDSBG fatigued/U fatigue/MGSD fatiguing/Y Fatima/M fatness/SM fat/PSGMDY fatso/M fatted fattener/M fatten/JZGSRD fatter fattest/M fattiness/SM fatting fatty/RSPT fatuity/MS fatuousness/SM fatuous/YP fatwa/SM faucet/SM Faulknerian Faulkner/M fault/CGSMD faultfinder/MS faultfinding/MS faultily faultiness/MS faultlessness/SM faultless/PY faulty/RTP fauna/MS Faunie/M Faun/M faun/MS Fauntleroy/M Faustian Faustina/M Faustine/M Faustino/M Faust/M Faustus/M fauvism/S favorableness/MU favorable/UMPS favorably/U favoredness/M favored's/U favored/YPSM favorer/EM favor/ESMRDGZ favoring/MYS favorings/U favorite/SMU favoritism/MS favors/A Fawkes/M Fawne/M fawner/M fawn/GZRDMS Fawnia/M fawning/Y Fawn/M fax/GMDS Fax/M Faydra/M Faye/M Fayette/M Fayetteville/M Fayina/M Fay/M fay/MDRGS Fayre/M Faythe/M Fayth/M faze/DSG FBI FCC FD FDA FDIC FDR/M fealty/MS fearfuller fearfullest fearfulness/MS fearful/YP fearlessness/MS fearless/PY fear/RDMSG fearsomeness/M fearsome/PY feasibility/SM feasibleness/M feasible/UI feasibly/U feaster/M feast/GSMRD feater/C featherbed featherbedding/SM featherbrain/MD feathered/U feathering/M featherless featherlight Featherman/M feathertop featherweight/SM feathery/TR feather/ZMDRGS feat/MYRGTS feats/C featureless feature/MGSD Feb/M febrile February/MS fecal feces fecklessness/M feckless/PY fecundability fecundate/XSDGN fecundation/M fecund/I fecundity/SM federalism/SM Federalist federalist/MS federalization/MS federalize/GSD Federal/S federal/YS federated/U federate/FSDXVNG federation/FM federative/Y Federica/M Federico/M FedEx/M Fedora/M fedora/SM feds Fed/SM fed/U feebleness/SM feeble/TPR feebly feedback/SM feedbag/MS feeder/M feed/GRZJS feeding/M feedlot/SM feedstock feedstuffs feeing feeler/M feel/GZJRS feelingly/U feeling/MYP feelingness/M Fee/M fee/MDS feet/M feigned/U feigner/M feign/RDGS feint/MDSG feisty/RT Felder/M Feldman/M feldspar/MS Felecia/M Felicdad/M Felice/M Felicia/M Felicio/M felicitate/XGNSD felicitation/M felicitous/IY felicitousness/M felicity/IMS Felicity/M Felicle/M Felic/M Felike/M Feliks/M feline/SY Felipa/M Felipe/M Felisha/M Felita/M Felix/M Feliza/M Felizio/M fella/S fellatio/SM felled/A feller/M felling/A Fellini/M fellness/M fellowman fellowmen fellow/SGDYM fellowshipped fellowshipping fellowship/SM fell/PSGZTRD feloniousness/M felonious/PY felon/MS felony/MS felt/GSD felting/M Fe/M female/MPS femaleness/SM feminineness/M feminine/PYS femininity/MS feminism/MS feminist/MS femme/MS femoral fem/S femur/MS fenced/U fencepost/M fencer/M fence/SRDJGMZ fencing/M fender/CM fend/RDSCZG Fenelia/M fenestration/CSM Fenian/M fenland/M fen/MS fennel/SM Fenwick/M Feodora/M Feodor/M feral Ferber/M Ferdie/M Ferdinanda/M Ferdinande/M Ferdinand/M Ferdinando/M Ferd/M Ferdy/M fer/FLC Fergus/M Ferguson/M Ferlinghetti/M Fermat/M fermentation/MS fermented fermenter ferment/FSCM fermenting Fermi/M fermion/MS fermium/MS Fernanda/M Fernande/M Fernandez/M Fernandina/M Fernando/M Ferne/M fernery/M Fern/M fern/MS ferny/TR ferociousness/MS ferocious/YP ferocity/MS Ferrari/M Ferraro/M Ferreira/M Ferrell/M Ferrel/M Ferrer/M ferreter/M ferret/SMRDG ferric ferris Ferris ferrite/M ferro ferroelectric ferromagnetic ferromagnet/M ferrous ferrule/MGSD ferryboat/MS ferryman/M ferrymen ferry/SDMG fertileness/M fertile/YP fertility/IMS fertilization/ASM fertilized/U fertilizer/M fertilizes/A fertilize/SRDZG ferule/SDGM fervency/MS fervent/Y fervidness/M fervid/YP fervor/MS fess/KGFSD Fess/M fess's festal/S fester/GD festival/SM festiveness/SM festive/PY festivity/SM festoon/SMDG fest/RVZ fetal feta/MS fetcher/M fetching/Y fetch/RSDGZ feted fête/MS fetich's fetidness/SM fetid/YP feting fetishism/SM fetishistic fetishist/SM fetish/MS fetlock/MS fetter's fetter/UGSD fettle/GSD fettling/M fettuccine/S fetus/SM feudalism/MS feudalistic feudal/Y feudatory/M feud/MDSG feverishness/SM feverish/PY fever/SDMG fewness/MS few/PTRS Fey/M Feynman/M fey/RT fez/M Fez/M fezzes ff FHA fiancée/S fiancé/MS Fianna/M Fiann/M fiascoes fiasco/M Fiat/M fiat/MS fibbed fibber/MS fibbing fiberboard/MS fiber/DM fiberfill/S Fiberglas/M fiberglass/DSMG Fibonacci/M fibrillate/XGNDS fibrillation/M fibril/MS fibrin/MS fibroblast/MS fibroid/S fibroses fibrosis/M fibrousness/M fibrous/YP fib/SZMR fibulae fibula/M fibular FICA fices fiche/SM Fichte/M fichu/SM fickleness/MS fickle/RTP ficos fictionalization/MS fictionalize/DSG fictional/Y fiction/SM fictitiousness/M fictitious/PY fictive/Y ficus fiddle/GMZJRSD fiddler/M fiddlestick/SM fiddly fide/F Fidela/M Fidelia/M Fidelio/M fidelity/IMS Fidelity/M Fidel/M fidget/DSG fidgety Fidole/M Fido/M fiducial/Y fiduciary/MS fiefdom/S fief/MS fielded fielder/IM fielding Fielding/M Field/MGS fieldstone/M fieldworker/M fieldwork/ZMRS field/ZISMR fiendishness/M fiendish/YP fiend/MS fierceness/SM fierce/RPTY fierily fieriness/MS fiery/PTR fie/S fies/C fiesta/MS fife/DRSMZG fifer/M Fifi/M Fifine/M FIFO fifteen/HRMS fifteenths fifths fifth/Y fiftieths fifty/HSM Figaro/M figged figging fightback fighter/MIS fighting/IS fight/ZSJRG figment/MS fig/MLS Figueroa/M figural figuration/FSM figurativeness/M figurative/YP figure/GFESD figurehead/SM figurer/SM figure's figurine/SM figuring/S Fijian/SM Fiji/M filamentary filament/MS filamentous Filberte/M Filbert/M filbert/MS Filberto/M filch/SDG filed/AC file/KDRSGMZ filename/SM filer/KMCS files/AC filet's filial/UY Filia/M filibusterer/M filibuster/MDRSZG Filide/M filigreeing filigree/MSD filing/AC filings Filipino/SM Filip/M Filippa/M Filippo/M fill/BAJGSD filled/U filler/MS filleting/M fillet/MDSG filling/M fillip/MDGS Fillmore/M filly/SM filmdom/M Filmer/M filminess/SM filming/M filmmaker/S Filmore/M film/SGMD filmstrip/SM filmy/RTP Filofax/S filtered/U filterer/M filter/RDMSZGB filthily filthiness/SM filth/M filths filthy/TRSDGP filtrated/I filtrate/SDXMNG filtrates/I filtrating/I filtration/IMS finagler/M finagle/RSDZG finale/MS finalist/MS finality/MS finalization/SM finalize/GSD final/SY Fina/M financed/A finance/MGSDJ finances/A financial/Y financier/DMGS financing/A Finch/M finch/MS findable/U find/BRJSGZ finder/M finding/M Findlay/M Findley/M fine/FGSCRDA finely fineness/MS finery/MAS fine's finespun finesse/SDMG fingerboard/SM fingerer/M fingering/M fingerless fingerling/M fingernail/MS fingerprint/SGDM finger/SGRDMJ fingertip/MS finial/SM finical finickiness/S finicky/RPT fining/M finished/UA finisher/M finishes/A finish/JZGRSD finis/SM finite/ISPY finitely/C finiteness/MIC fink/GDMS Finland/M Finlay/M Finley/M Fin/M Finnbogadottir/M finned Finnegan/M finner finning Finnish Finn/MS finny/RT fin/TGMDRS Fiona/M Fionna/M Fionnula/M fiord's Fiorello/M Fiorenze/M Fiori/M f/IRAC firearm/SM fireball/SM fireboat/M firebomb/MDSG firebox/MS firebrand/MS firebreak/SM firebrick/SM firebug/SM firecracker/SM firedamp/SM fired/U firefight/JRGZS firefly/MS Firefox/M fireguard/M firehouse/MS firelight/GZSM fireman/M firemen fire/MS fireplace/MS fireplug/MS firepower/SM fireproof/SGD firer/M firesafe fireside/SM Firestone/M firestorm/SM firetrap/SM firetruck/S firewall/S firewater/SM firewood/MS firework/MS firing/M firkin/M firmament/MS firmer firmest firm/ISFDG firmly/I firmness/MS firm's firmware/MS firring firstborn/S firsthand first/SY firth/M firths fir/ZGJMDRHS fiscal/YS Fischbein/M Fischer/M fishbowl/MS fishcake/S fisher/M Fisher/M fisherman/M fishermen/M fishery/MS fishhook/MS fishily fishiness/MS fishing/M fish/JGZMSRD Fishkill/M fishmeal fishmonger/MS fishnet/SM fishpond/SM fishtail/DMGS fishtanks fishwife/M fishwives fishy/TPR Fiske/M Fisk/M fissile fissionable/S fission/BSDMG fissure/MGSD fistfight/SM fistful/MS fisticuff/SM fist/MDGS fistula/SM fistulous Fitchburg/M Fitch/M fitfulness/SM fitful/PY fitments fitness/USM fits/AK fit's/K fitted/UA fitter/SM fittest fitting/AU fittingly fittingness/M fittings fit/UYPS Fitzgerald/M Fitz/M Fitzpatrick/M Fitzroy/M fivefold five/MRS fiver/M fixable fixate/VNGXSD fixatifs fixation/M fixative/S fixedness/M fixed/YP fixer/SM fixes/I fixing/SM fixity/MS fixture/SM fix/USDG Fizeau/M fizzer/M fizzle/GSD fizz/SRDG fizzy/RT fjord/SM FL flabbergast/GSD flabbergasting/Y flabbily flabbiness/SM flabby/TPR flab/MS flaccidity/MS flaccid/Y flack/SGDM flagella/M flagellate/DSNGX flagellation/M flagellum/M flagged flaggingly/U flagging/SMY flagman/M flagmen flag/MS flagon/SM flagpole/SM flagrance/MS flagrancy/SM flagrant/Y flagship/MS flagstaff/MS flagstone/SM flail/SGMD flair/SM flaker/M flake/SM flakiness/MS flak/RDMGS flaky/PRT Fla/M flambé/D flambeing flambes flamboyance/MS flamboyancy/MS flamboyant/YS flamenco/SM flamen/M flameproof/DGS flamer/IM flame's flame/SIGDR flamethrower/SM flamingo/SM flaming/Y flammability/ISM flammable/SI flam/MRNDJGZ Flanagan/M Flanders/M flange/GMSD flanker/M flank/SGZRDM flan/MS flannel/DMGS flannelet/MS flannelette's flapjack/SM flap/MS flapped flapper/SM flapping flaps/M flare/SDG flareup/S flaring/Y flashback/SM flashbulb/SM flashcard/S flashcube/MS flasher/M flashgun/S flashily flashiness/SM flashing/M flash/JMRSDGZ flashlight/MS flashy/TPR flask/SM flatbed/S flatboat/MS flatcar/MS flatfeet flatfish/SM flatfoot/SGDM flathead/M flatiron/SM flatland/RS flatmate/M flat/MYPS flatness/MS flatted flattener/M flatten/SDRG flatter/DRSZG flatterer/M flattering/YU flattery/SM flattest/M flatting flattish Flatt/M flattop/MS flatulence/SM flatulent/Y flatus/SM flatware/MS flatworm/SM Flaubert/M flaunting/Y flaunt/SDG flautist/SM flavored/U flavorer/M flavorful flavoring/M flavorless flavor/SJDRMZG flavorsome flaw/GDMS flawlessness/MS flawless/PY flax/MSN flaxseed/M flayer/M flay/RDGZS fleabag/MS fleabites flea/SM fleawort/M fleck/GRDMS Fledermaus/M fledged/U fledge/GSD fledgling/SM fleecer/M fleece/RSDGMZ fleeciness/SM fleecy/RTP fleeing flee/RS fleetingly/M fleetingness/SM fleeting/YP fleet/MYRDGTPS fleetness/MS Fleischer/M Fleischman/M Fleisher/M Fleming/M Flemished/M Flemish/GDSM Flemishing/M Flem/JGM Flemming/M flesher/M fleshiness/M flesh/JMYRSDG fleshless fleshly/TR fleshpot/SM fleshy/TPR fletch/DRSGJ fletcher/M Fletcher/M fletching/M Fletch/MR Fleurette/M Fleur/M flew/S flews/M flexed/I flexibility/MSI flexible/I flexibly/I flexitime's flex/MSDAG flextime/S flexural flexure/M fl/GJD flibbertigibbet/MS flicker/GD flickering/Y flickery flick/GZSRD flier/M flight/GMDS flightiness/SM flightless flightpath flighty/RTP flimflammed flimflamming flimflam/MS flimsily flimsiness/MS flimsy/PTRS flincher/M flinch/GDRS flinching/U flinger/M fling/RMG Flin/M Flinn/M flintiness/M flintless flintlock/MS Flint/M flint/MDSG Flintstones flinty/TRP flipflop flippable flippancy/MS flippant/Y flipped flipper/SM flippest flipping flip/S flirtation/SM flirtatiousness/MS flirtatious/PY flirt/GRDS flit/S flitted flitting floater/M float/SRDGJZ floaty flocculate/GNDS flocculation/M flock/SJDMG floe/MS flogged flogger/SM flogging/SM flog/S Flo/M floodgate/MS floodlight/DGMS floodlit floodplain/S flood/SMRDG floodwater/SM floorboard/MS floorer/M flooring/M floor/SJRDMG floorspace floorwalker/SM floozy/SM flophouse/SM flop/MS flopped flopper/M floppily floppiness/SM flopping floppy/TMRSP floral/SY Flora/M Florance/M flora/SM Florella/M Florence/M Florencia/M Florentia/M Florentine/S Florenza/M florescence/MIS florescent/I Flore/SM floret/MS Florette/M Floria/M Florian/M Florida/M Floridan/S Floridian/S floridness/SM florid/YP Florie/M Florina/M Florinda/M Florine/M florin/MS Flori/SM florist/MS Flor/M Florrie/M Florri/M Florry/M Flory/M floss/GSDM Flossie/M Flossi/M Flossy/M flossy/RST flotation/SM flotilla/SM flotsam/SM flounce/GDS flouncing/M flouncy/RT flounder/SDG flourisher/M flourish/GSRD flourishing/Y flour/SGDM floury/TR flouter/M flout/GZSRD flowchart/SG flowed flowerbed/SM flower/CSGD flowerer/M floweriness/SM flowerless flowerpot/MS flower's Flowers flowery/TRP flowing/Y flow/ISG flown flowstone Floyd/M Flss/M flt flubbed flubbing flub/S fluctuate/XSDNG fluctuation/M fluency/MS fluently fluent/SF flue/SM fluffiness/SM fluff/SGDM fluffy/PRT fluidity/SM fluidized fluid/MYSP fluidness/M fluke/SDGM fluky/RT flume/SDGM flummox/DSG flu/MS flung flunkey's flunk/SRDG flunky/MS fluoresce/GSRD fluorescence/MS fluorescent/S fluoridate/XDSGN fluoridation/M fluoride/SM fluorimetric fluorinated fluorine/SM fluorite/MS fluorocarbon/MS fluoroscope/MGDS fluoroscopic flurry/GMDS flushness/M flush/TRSDPBG fluster/DSG fluter/M flute/SRDGMJ fluting/M flutist/MS flutter/DRSG flutterer/M fluttery fluxed/A fluxes/A flux/IMS fluxing flyaway flyblown flyby/M flybys flycatcher/MS flyer's fly/JGBDRSTZ flyleaf/M flyleaves Flynn/M flyover/MS flypaper/MS flysheet/S flyspeck/MDGS flyswatter/S flyway/MS flyweight/MS flywheel/MS FM Fm/M FNMA/M foal/MDSG foaminess/MS foam/MRDSG foamy/RPT fobbed fobbing fob/SM focal/F focally Foch/M foci's focused/AU focuser/M focuses/A focus/SRDMBG fodder/GDMS foe/SM foetid FOFL fogbound fogged/C foggily fogginess/MS fogging/C foggy/RPT foghorn/SM fogs/C fog/SM fogyish fogy/SM foible/MS foil/GSD foist/GDS Fokker/M foldaway/S folded/AU folder/M foldout/MS fold/RDJSGZ folds/UA Foley/M foliage/MSD foliate/CSDXGN foliation/CM folio/SDMG folklike folklore/MS folkloric folklorist/SM folk/MS folksiness/MS folksinger/S folksinging/S folksong/S folksy/TPR folktale/S folkway/S foll follicle/SM follicular follower/M follow/JSZBGRD followup's folly/SM Folsom fol/Y Fomalhaut/M fomentation/SM fomenter/M foment/RDSG Fonda/M fondant/SM fondle/GSRD fondler/M fondness/MS fond/PMYRDGTS fondue/MS Fons Fonsie/M Fontainebleau/M Fontaine/M Fontana/M fontanelle's fontanel/MS font/MS Fonzie/M Fonz/M foodie/S food/MS foodstuff/MS foolery/MS foolhardily foolhardiness/SM foolhardy/PTR foolishness/SM foolish/PRYT fool/MDGS foolproof foolscap/MS footage/SM football/SRDMGZ footbridge/SM Foote/M footer/M footfall/SM foothill/SM foothold/MS footing/M footless footlights footling footlocker/SM footloose footman/M footmarks footmen footnote/MSDG footpad/SM footpath/M footpaths footplate/M footprint/MS footrace/S footrest/MS footsie/SM foot/SMRDGZJ footsore footstep/SM footstool/SM footwear/M footwork/SM fop/MS fopped foppery/MS fopping foppishness/SM foppish/YP forage/GSRDMZ forager/M forayer/M foray/SGMRD forbade forbearance/SM forbearer/M forbear/MRSG Forbes/M forbidden forbiddingness/M forbidding/YPS forbid/S forbore forborne forced/Y forcefield/MS forcefulness/MS forceful/PY forceps/M forcer/M force/SRDGM forcibleness/M forcible/P forcibly fordable/U Fordham/M Ford/M ford/SMDBG forearm/GSDM forebear/MS forebode/GJDS forebodingness/M foreboding/PYM forecaster/M forecastle/MS forecast/SZGR foreclose/GSD foreclosure/MS forecourt/SM foredoom/SDG forefather/SM forefeet forefinger/MS forefoot/M forefront/SM foregoer/M foregoing/S foregone foregos foreground/MGDS forehand/S forehead/MS foreigner/M foreignness/SM foreign/PRYZS foreknew foreknow/GS foreknowledge/MS foreknown foreleg/MS forelimb/MS forelock/MDSG foreman/M Foreman/M foremast/SM foremen foremost forename/DSM forenoon/SM forensically forensic/S forensics/M foreordain/DSG forepart/MS forepaws forepeople foreperson/S foreplay/MS forequarter/SM forerunner/MS fore/S foresail/SM foresaw foreseeable/U foreseeing foreseen/U foreseer/M foresee/ZSRB foreshadow/SGD foreshore/M foreshorten/DSG foresightedness/SM foresighted/PY foresight/SMD foreskin/SM forestaller/M forestall/LGSRD forestallment/M forestation/MCS forestations/A forest/CSAGD Forester/M forester/SM forestland/S Forest/MR forestry/MS forest's foretaste/MGSD foreteller/M foretell/RGS forethought/MS foretold forevermore forever/PS forewarner/M forewarn/GSJRD forewent forewoman/M forewomen foreword/SM forfeiter/M forfeiture/MS forfeit/ZGDRMS forfend/GSD forgather/GSD forgave forged/A forge/JVGMZSRD forger/M forgery/MS forges/A forgetfulness/SM forgetful/PY forget/SV forgettable/U forgettably/U forgetting forging/M forgivable/U forgivably/U forgiven forgiveness/SM forgiver/M forgive/SRPBZG forgivingly forgivingness/M forgiving/UP forgoer/M forgoes forgone forgo/RSGZ forgot forgotten/U for/HT forkful/S fork/GSRDM forklift/DMSG forlornness/M forlorn/PTRY formability/AM formaldehyde/SM formalin/M formalism/SM formalistic formalist/SM formality/SMI formal/IY formalization/SM formalized/U formalizer/M formalizes/I formalize/ZGSRD formalness/M formals formant/MIS format/AVS formate/MXGNSD formation/AFSCIM formatively/I formativeness/IM formative/SYP format's formatted/UA formatter/A formatters formatter's formatting/A form/CGSAFDI formed/U former/FSAI formerly formfitting formic Formica/MS formidableness/M formidable/P formidably formlessness/MS formless/PY Formosa/M Formosan form's formulaic formula/SM formulate/AGNSDX formulated/U formulation/AM formulator/SM fornicate/GNXSD fornication/M fornicator/SM Forrester/M Forrest/RM forsaken forsake/SG forsook forsooth Forster/M forswear/SG forswore forsworn forsythia/MS Fortaleza/M forte/MS forthcome/JG forthcoming/U FORTH/M forthrightness/SM forthright/PYS forthwith fortieths fortification/MS fortified/U fortifier/SM fortify/ADSG fortiori fortissimo/S fortitude/SM fortnightly/S fortnight/MYS FORTRAN Fortran/M fortress/GMSD fort/SM fortuitousness/SM fortuitous/YP fortuity/MS fortunateness/M fortunate/YUS fortune/MGSD fortuneteller/SM fortunetelling/SM forty/SRMH forum/MS forwarder/M forwarding/M forwardness/MS forward/PTZSGDRY forwent fossiliferous fossilization/MS fossilized/U fossilize/GSD fossil/MS Foss/M fosterer/M Foster/M foster/SRDG Foucault/M fought foulard/SM foulmouth/D foulness/MS fouls/M foul/SYRDGTP foundational foundation/SM founded/UF founder/MDG founder's/F founding/F foundling/MS found/RDGZS foundry/MS founds/KF fountainhead/SM fountain/SMDG fount/MS fourfold Fourier/M fourpence/M fourpenny fourposter/SM fourscore/S four/SHM foursome/SM foursquare fourteener/M fourteen/SMRH fourteenths Fourth fourths Fourths fourth/Y fovea/M fowler/M Fowler/M fowling/M fowl/SGMRD foxfire/SM foxglove/SM Foxhall/M foxhole/SM foxhound/SM foxily foxiness/MS foxing/M fox/MDSG Fox/MS foxtail/M foxtrot/MS foxtrotted foxtrotting foxy/TRP foyer/SM FPO fps fr fracas/SM fractal/SM fractional/Y fractionate/DNG fractionation/M fractioned fractioning fraction/ISMA fractiousness/SM fractious/PY fracture/MGDS fragile/Y fragility/MS fragmentarily fragmentariness/M fragmentary/P fragmentation/MS fragment/SDMG Fragonard/M fragrance/SM fragrant/Y frailness/MS frail/STPYR frailty/MS framed/U framer/M frame/SRDJGMZ framework/SM framing/M Francaise/M France/MS Francene/M Francesca/M Francesco/M franchisee/S franchise/ESDG franchiser/SM franchise's Franchot/M Francie/M Francine/M Francis Francisca/M Franciscan/MS Francisco/M Franciska/M Franciskus/M francium/MS Francklin/M Francklyn/M Franck/M Francoise/M Francois/M Franco/M francophone/M franc/SM Francyne/M frangibility/SM frangible Frankel/M Frankenstein/MS franker/M Frankford/M Frankfort/M Frankfurter/M frankfurter/MS Frankfurt/RM Frankie/M frankincense/MS Frankish/M franklin/M Franklin/M Franklyn/M frankness/MS frank/SGTYRDP Frank/SM Franky/M Fran/MS Frannie/M Franni/M Franny/M Fransisco/M frantically franticness/M frantic/PY Frants/M Franzen/M Franz/NM frappé frappeed frappeing frappes Frasco/M Fraser/M Frasier/M Frasquito/M fraternal/Y fraternity/MSF fraternization/SM fraternize/GZRSD fraternizer/M fraternizing/U frat/MS fratricidal fratricide/MS fraud/CS fraud's fraudsters fraudulence/S fraudulent/YP fraught/SGD Fraulein/S Frau/MN fray/CSDG Frayda/M Frayne/M fray's Fraze/MR Frazer/M Frazier/M frazzle/GDS freakishness/SM freakish/YP freak/SGDM freaky/RT freckle/GMDS freckly/RT Freda/M Freddie/M Freddi/M Freddy/M Fredek/M Fredelia/M Frederica/M Frederich/M Fredericka/M Frederick/MS Frederic/M Frederico/M Fredericton/M Frederigo/M Frederik/M Frederique/M Fredholm/M Fredia/M Fredi/M Fred/M Fredra/M Fredrick/M Fredrickson/M Fredric/M Fredrika/M freebase/GDS freebie/MS freebooter/M freeboot/ZR freeborn freedman/M Freedman/M freedmen freedom/MS freehand/D freehanded/Y freeholder/M freehold/ZSRM freeing/S freelance/SRDGZM Freeland/M freeloader/M freeload/SRDGZ Free/M freeman/M Freeman/M freemasonry/M Freemasonry/MS Freemason/SM freemen Freemon/M freeness/M Freeport/M freestanding freestone/SM freestyle/SM freethinker/MS freethinking/S Freetown/M freeway/MS freewheeler/M freewheeling/P freewheel/SRDMGZ freewill free/YTDRSP freezable freezer/SM freeze/UGSA freezing/S Freida/M freighter/M freight/ZGMDRS Fremont/M Frenchman/M French/MDSG Frenchmen Frenchwoman/M Frenchwomen frenetically frenetic/S frenzied/Y frenzy/MDSG freon/S Freon/SM freq frequency/ISM frequented/U frequenter/MS frequentest frequenting frequent/IY frequentness/M frequents fresco/DMG frescoes fresh/AZSRNDG freshener/M freshen/SZGDR fresher/MA freshest freshet/SM freshly freshman/M freshmen freshness/MS freshwater/SM Fresnel/M Fresno/M fretboard fretfulness/MS fretful/PY fret/S fretsaw/S fretted fretting fretwork/MS Freudian/S Freud/M Freya/M Frey/M friableness/M friable/P friary/MS friar/YMS fricasseeing fricassee/MSD frication/M fricative/MS Frick/M frictional/Y frictionless/Y friction/MS Friday/SM fridge/SM fried/A Frieda/M Friedan/M friedcake/SM Friederike/M Friedman/M Friedrich/M Friedrick/M friendlessness/M friendless/P friendlies friendlily friendliness/USM friendly/PUTR friend/SGMYD friendship/MS frier's fries/M frieze/SDGM frigate/SM Frigga/M frigged frigging/S frighten/DG frightening/Y frightfulness/MS frightful/PY fright/GXMDNS Frigidaire/M frigidity/MS frigidness/SM frigid/YP frig/S frill/MDGS frilly/RST Fri/M fringe/IGSD fringe's frippery/SM Frisbee/MS Frisco/M Frisian/SM frisker/M friskily friskiness/SM frisk/RDGS frisky/RTP frisson/M Frito/M fritterer/M fritter/RDSG Fritz/M fritz/SM frivolity/MS frivolousness/SM frivolous/PY frizz/GYSD frizzle/DSG frizzly/RT frizzy/RT Fr/MD Frobisher/M frocking/M frock's frock/SUDGC frogged frogging frogman/M frogmarched frogmen frog/MS fro/HS Froissart/M frolicked frolicker/SM frolicking frolic/SM frolicsome from Fromm/M frond/SM frontage/MS frontal/SY Frontenac/M front/GSFRD frontier/SM frontiersman/M frontiersmen frontispiece/SM frontrunner's front's frontward/S frosh/M Frostbelt/M frostbite/MS frostbit/G frostbiting/M frostbitten frost/CDSG frosteds frosted/U frostily frostiness/SM frosting/MS Frost/M frost's frosty/PTR froth/GMD frothiness/SM froths frothy/TRP froufrou/MS frowardness/MS froward/P frowner/M frowning/Y frown/RDSG frowzily frowziness/SM frowzy/RPT frozenness/M frozen/YP froze/UA fructify/GSD fructose/MS Fruehauf/M frugality/SM frugal/Y fruitcake/SM fruiterer/M fruiter/RM fruitfuller fruitfullest fruitfulness/MS fruitful/UYP fruit/GMRDS fruitiness/MS fruition/SM fruitlessness/MS fruitless/YP fruity/RPT frumpish frump/MS frumpy/TR Frunze/M frustrater/M frustrate/RSDXNG frustrating/Y frustration/M frustum/SM Frye/M fryer/MS Fry/M fry/NGDS F's f's/KA FSLIC ft/C FTC FTP fuchsia/MS Fuchs/M fucker/M! fuck/GZJRDMS! FUD fuddle/GSD fudge/GMSD fuel/ASDG fueler/SM fuel's Fuentes/M fugal Fugger/M fugitiveness/M fugitive/SYMP fugue/GMSD fuhrer/S Fuji/M Fujitsu/M Fujiyama Fukuoka/M Fulani/M Fulbright/M fulcrum/SM fulfilled/U fulfiller/M fulfill/GLSRD fulfillment/MS fullback/SMG fuller/DMG Fuller/M Fullerton/M fullish fullness/MS full/RDPSGZT fullstops fullword/SM fully fulminate/XSDGN fulmination/M fulness's fulsomeness/SM fulsome/PY Fulton/M Fulvia/M fumble/GZRSD fumbler/M fumbling/Y fume/DSG fumigant/MS fumigate/NGSDX fumigation/M fumigator/SM fuming/Y fumy/TR Funafuti functionalism/M functionalist/SM functionality/S functional/YS functionary/MS function/GSMD functor/SM fundamentalism/SM fundamentalist/SM fundamental/SY fund/ASMRDZG funded/U fundholders fundholding funding/S Fundy/M funeral/MS funerary funereal/Y funfair/M fungal/S fungible/M fungicidal fungicide/SM fungi/M fungoid/S fungous fungus/M funicular/SM funk/GSDM funkiness/S funky/RTP fun/MS funned funnel/SGMD funner funnest funnily/U funniness/SM funning funny/RSPT furbelow/MDSG furbisher/M furbish/GDRSA furiousness/M furious/RYP furlong/MS furlough/DGM furloughs furl/UDGS furn furnace/GMSD furnished/U furnisher/MS furnish/GASD furnishing/SM furniture/SM furore/MS furor/MS fur/PMS furred furrier/M furriness/SM furring/SM furrow/DMGS furry/RTZP furtherance/MS furtherer/M furthermore furthermost further/TGDRS furthest furtiveness/SM furtive/PY fury/SM furze/SM fusebox/S fusee/SM fuse/FSDAGCI fuselage/SM fuse's/A Fushun/M fusibility/SM fusible/I fusiform fusilier/MS fusillade/SDMG fusion/KMFSI fussbudget/MS fusser/M fussily fussiness/MS fusspot/SM fuss/SRDMG fussy/PTR fustian/MS fustiness/MS fusty/RPT fut futileness/M futile/PY futility/MS futon/S future/SM futurism/SM futuristic/S futurist/S futurity/MS futurologist/S futurology/MS futz/GSD fuze's Fuzhou/M Fuzzbuster/M fuzzily fuzziness/SM fuzz/SDMG fuzzy/PRT fwd FWD fwy FY FYI GA gabardine/SM gabbed Gabbey/M Gabbie/M Gabbi/M gabbiness/S gabbing gabble/SDG Gabby/M gabby/TRP Gabe/M gaberdine's Gabey/M gabfest/MS Gabie/M Gabi/M gable/GMSRD Gable/M Gabonese Gabon/M Gaborone/M Gabriela/M Gabriele/M Gabriella/M Gabrielle/M Gabriellia/M Gabriell/M Gabriello/M Gabriel/M Gabrila/M gab/S Gaby/M Gacrux/M gadabout/MS gadded gadder/MS gadding gadfly/MS gadgetry/MS gadget/SM gadolinium/MS gad/S Gadsden/M Gaea/M Gaelan/M Gaelic/M Gael/SM Gae/M gaffe/MS gaffer/M gaff/SGZRDM gaga Gagarin/M gag/DRSG Gage/M gager/M gage/SM gagged gagging gaggle/SDG gagwriter/S gaiety/MS Gaile/M Gail/M gaily gain/ADGS gainer/SM Gaines/M Gainesville/M gainfulness/M gainful/YP gaining/S gainly/U gainsaid gainsayer/M gainsay/RSZG Gainsborough/M gaiter/M gait/GSZMRD Gaithersburg/M galactic Galahad/MS Galapagos/M gal/AS gala/SM Galatea/M Galatia/M Galatians/M Galaxy/M galaxy/MS Galbraith/M Galbreath/M gale/AS Gale/M galen galena/MS galenite/M Galen/M gale's Galibi/M Galilean/MS Galilee/M Galileo/M Galina/M Gallagher/M gallanted gallanting gallantry/MS gallants gallant/UY Gallard/M gallbladder/MS Gallegos/M galleon/SM galleria/S gallery/MSDG galley/MS Gallic Gallicism/SM gallimaufry/MS galling/Y gallium/SM gallivant/GDS Gall/M gallonage/M gallon/SM galloper/M gallop/GSRDZ Galloway/M gallows/M gall/SGMD gallstone/MS Gallup/M Gal/MN Galois/M galoot/MS galore/S galosh/GMSD gal's Galsworthy/M galumph/GD galumphs galvanic Galvani/M galvanism/MS galvanization/SM galvanize/SDG Galvan/M galvanometer/SM galvanometric Galven/M Galveston/M Galvin/M Ga/M Gamaliel/M Gama/M Gambia/M Gambian/S gambit/MS gamble/GZRSD Gamble/M gambler/M gambol/SGD gamecock/SM gamekeeper/MS gameness/MS game/PJDRSMYTZG gamesmanship/SM gamesmen gamester/M gamest/RZ gamete/MS gametic gamine/SM gaminess/MS gaming/M gamin/MS gamma/MS gammon/DMSG Gamow/M gamut/MS gamy/TRP gander/DMGS Gandhian Gandhi/M gangbusters ganger/M Ganges/M gang/GRDMS gangland/SM ganglia/M gangling ganglionic ganglion/M gangplank/SM gangrene/SDMG gangrenous gangster/SM Gangtok/M gangway/MS Gan/M gannet/SM Gannie/M Gannon/M Ganny/M gantlet/GMDS Gantry/M gantry/MS Ganymede/M GAO gaoler/M gaol/MRDGZS gaper/M gape/S gaping/Y gapped gapping gap/SJMDRG garage/GMSD Garald/M garbageman/M garbage/SDMG garbanzo/MS garb/DMGS garbler/M garble/RSDG Garbo/M Garcia/M garçon/SM gardener/M Gardener/M gardenia/SM gardening/M garden/ZGRDMS Gardie/M Gardiner/M Gard/M Gardner/M Gardy/M Garek/M Gare/MH Gareth/M Garey/M Garfield/M garfish/MS Garfunkel/M Gargantua/M gargantuan gargle/SDG gargoyle/DSM Garibaldi/M Garik/M garishness/MS garish/YP Garland/M garland/SMDG garlicked garlicking garlicky garlic/SM garment/MDGS Gar/MH Garner/M garner/SGD Garnet/M garnet/SM Garnette/M Garnett/M garnish/DSLG garnisheeing garnishee/SDM garnishment/MS Garold/M garote's garotte's Garrard/M garred Garrek/M Garreth/M Garret/M garret/SM Garrett/M Garrick/M Garrik/M garring Garrison/M garrison/SGMD garroter/M garrote/SRDMZG Garrot/M garrotte's Garrott/M garrulity/SM garrulousness/MS garrulous/PY Garry/M gar/SLM garter/SGDM Garth/M Garvey/M Garvin/M Garv/M Garvy/M Garwin/M Garwood/M Gary/M Garza/M gasbag/MS Gascony/M gaseousness/M gaseous/YP gases/C gas/FC gash/GTMSRD gasification/M gasifier/M gasify/SRDGXZN gasket/SM gaslight/DMS gasohol/S gasoline/MS gasometer/M Gaspard/M Gaspar/M Gasparo/M gasper/M Gasper/M gasp/GZSRD gasping/Y gas's gassed/C Gasser/M gasser/MS Gasset/M gassiness/M gassing/SM gassy/PTR Gaston/M gastric gastritides gastritis/MS gastroenteritides gastroenteritis/M gastrointestinal gastronome/SM gastronomic gastronomical/Y gastronomy/MS gastropod/SM gasworks/M gateau/MS gateaux gatecrash/GZSRD gatehouse/MS gatekeeper/SM gate/MGDS gatepost/SM Gates gateway/MS gathered/IA gatherer/M gathering/M gather/JRDZGS gathers/A Gatlinburg/M Gatling/M Gatorade/M gator/MS Gatsby/M Gatun/M gaucheness/SM gaucherie/SM gauche/TYPR gaucho/SM gaudily gaudiness/MS gaudy/PRST gaugeable gauger/M Gauguin/M Gaulish/M Gaulle/M Gaul/MS Gaultiero/M gauntlet/GSDM Gauntley/M gauntness/MS gaunt/PYRDSGT gauss/C gausses Gaussian Gauss/M gauss's Gautama/M Gauthier/M Gautier/M gauze/SDGM gauziness/MS gauzy/TRP Gavan/M gave gavel/GMDS Gaven/M Gavin/M Gav/MN gavotte/MSDG Gavra/M Gavrielle/M Gawain/M Gawen/M gawkily gawkiness/MS gawk/SGRDM gawky/RSPT Gayel/M Gayelord/M Gaye/M gayety's Gayla/M Gayleen/M Gaylene/M Gayler/M Gayle/RM Gaylord/M Gaylor/M Gay/M gayness/SM Gaynor/M gay/RTPS Gaza/M gazebo/SM gaze/DRSZG gazelle/MS gazer/M gazetteer/SGDM gazette/MGSD Gaziantep/M gazillion/S gazpacho/MS GB G/B Gdansk/M Gd/M GDP Gearalt/M Gearard/M gearbox/SM gear/DMJSG gearing/M gearshift/MS gearstick gearwheel/SM Geary/M gecko/MS GED geegaw's geeing geek/SM geeky/RT geese/M geest/M gee/TDS geezer/MS Gehenna/M Gehrig/M Geiger/M Geigy/M geisha/M gelatinousness/M gelatinous/PY gelatin/SM gelcap gelding/M geld/JSGD gelid gelignite/MS gelled gelling gel/MBS Gelya/M Ge/M GE/M Gemini/SM gemlike Gemma/M gemmed gemming gem/MS gemological gemologist/MS gemology/MS gemstone/SM gen Gena/M Genaro/M gendarme/MS gender/DMGS genderless genealogical/Y genealogist/SM genealogy/MS Gene/M gene/MS generalissimo/SM generalist/MS generality/MS generalizable/SM generalization/MS generalized/U generalize/GZBSRD generalizer/M general/MSPY generalness/M generalship/SM genera/M generate/CXAVNGSD generational generation/MCA generative/AY generators/A generator/SM generically generic/PS generosity/MS generously/U generousness/SM generous/PY Genesco/M genesis/M Genesis/M genes/S genetically geneticist/MS genetic/S genetics/M Genet/M Geneva/M Genevieve/M Genevra/M Genghis/M geniality/FMS genially/F genialness/M genial/PY Genia/M genies/K genie/SM genii/M genitalia genitals genital/YF genitive/SM genitourinary genius/SM Gen/M Genna/M Gennie/M Gennifer/M Genni/M Genny/M Genoa/SM genocidal genocide/SM Geno/M genome/SM genotype/MS Genovera/M genre/MS gent/AMS genteelness/MS genteel/PRYT gentian/SM gentile/S Gentile's gentility/MS gentlefolk/S gentlemanliness/M gentlemanly/U gentleman/YM gentlemen gentleness/SM gentle/PRSDGT gentlewoman/M gentlewomen/M gently gentrification/M gentrify/NSDGX Gentry/M gentry/MS genuflect/GDS genuflection/MS genuineness/SM genuine/PY genus Genvieve/M geocentric geocentrically geocentricism geochemical/Y geochemistry/MS geochronology/M geodesic/S geode/SM geodesy/MS geodetic/S Geoff/M Geoffrey/M Geoffry/M geog geographer/MS geographic geographical/Y geography/MS geologic geological/Y geologist/MS geology/MS geom Geo/M geomagnetic geomagnetically geomagnetism/SM geometer/MS geometrical/Y geometrician/M geometric/S geometry/MS geomorphological geomorphology/M geophysical/Y geophysicist/MS geophysics/M geopolitical/Y geopolitic/S geopolitics/M Georas/M Geordie/M Georgeanna/M Georgeanne/M Georgena/M George/SM Georgeta/M Georgetown/M Georgetta/M Georgette/M Georgia/M Georgiana/M Georgianna/M Georgianne/M Georgian/S Georgie/M Georgi/M Georgina/M Georgine/M Georg/M Georgy/M geostationary geosynchronous geosyncline/SM geothermal geothermic Geralda/M Geraldine/M Gerald/M geranium/SM Gerard/M Gerardo/M Gerber/M gerbil/MS Gerda/M Gerek/M Gerhardine/M Gerhard/M Gerhardt/M Gerianna/M Gerianne/M geriatric/S geriatrics/M Gerick/M Gerik/M Geri/M Geritol/M Gerladina/M Ger/M Germaine/M Germain/M Germana/M germane Germania/M Germanic/M germanium/SM germanized German/SM Germantown/M Germany/M Germayne/M germen/M germicidal germicide/MS germinal/Y germinated/U germinate/XVGNSD germination/M germinative/Y germ/MNS Gerome/M Geronimo/M gerontocracy/M gerontological gerontologist/SM gerontology/SM Gerrard/M Gerrie/M Gerrilee/M Gerri/M Gerry/M gerrymander/SGD Gershwin/MS Gerta/M Gertie/M Gerti/M Gert/M Gertruda/M Gertrude/M Gertrudis/M Gertrud/M Gerty/M gerundive/M gerund/SVM Gery/M gestalt/M gestapo/S Gestapo/SM gestate/SDGNX gestational gestation/M gesticulate/XSDVGN gesticulation/M gesticulative/Y gestural gesture/SDMG gesundheit getaway/SM Gethsemane/M get/S getter/SDM getting Getty/M Gettysburg/M getup/MS gewgaw/MS Gewürztraminer geyser/GDMS Ghanaian/MS Ghana/M Ghanian's ghastliness/MS ghastly/TPR ghat/MS Ghats/M Ghent/M Gherardo/M gherkin/SM ghetto/DGMS ghettoize/SDG Ghibelline/M ghostlike ghostliness/MS ghostly/TRP ghost/SMYDG ghostwrite/RSGZ ghostwritten ghostwrote ghoulishness/SM ghoulish/PY ghoul/SM GHQ GI Giacinta/M Giacobo/M Giacometti/M Giacomo/M Giacopo/M Giana/M Gianina/M Gian/M Gianna/M Gianni/M Giannini/M giantess/MS giantkiller giant/SM Giauque/M Giavani/M gibber/DGS gibberish/MS gibbet/MDSG Gibbie/M Gibb/MS Gibbon/M gibbon/MS gibbousness/M gibbous/YP Gibby/M gibe/GDRS giber/M giblet/MS Gib/M Gibraltar/MS Gibson/M giddap giddily giddiness/SM Giddings/M giddy/GPRSDT Gide/M Gideon/MS Gielgud/M Gienah/M Giffard/M Giffer/M Giffie/M Gifford/M Giff/RM Giffy/M giftedness/M gifted/PY gift/SGMD gigabyte/S gigacycle/MS gigahertz/M gigantically giganticness/M gigantic/P gigavolt gigawatt/M gigged gigging giggler/M giggle/RSDGZ giggling/Y giggly/TR Gigi/M gig/MS GIGO gigolo/MS gila Gila/M Gilberta/M Gilberte/M Gilbertina/M Gilbertine/M gilbert/M Gilbert/M Gilberto/M Gilbertson/M Gilburt/M Gilchrist/M Gilda/M gilder/M gilding/M gild/JSGZRD Gilead/M Gilemette/M Giles Gilgamesh/M Gilkson/M Gillan/M Gilles Gillespie/M Gillette/M Gilliam/M Gillian/M Gillie/M Gilligan/M Gilli/M Gill/M gill/SGMRD Gilly/M Gilmore/M Gil/MY gilt/S gimbaled gimbals Gimbel/M gimcrackery/SM gimcrack/S gimlet/MDSG gimme/S gimmick/GDMS gimmickry/MS gimmicky gimp/GSMD gimpy/RT Gina/M Ginelle/M Ginevra/M gingerbread/SM gingerliness/M gingerly/P Ginger/M ginger/SGDYM gingersnap/SM gingery gingham/SM gingivitis/SM Gingrich/M ginkgoes ginkgo/M ginmill gin/MS ginned Ginnie/M Ginnifer/M Ginni/M ginning Ginny/M Gino/M Ginsberg/M Ginsburg/M ginseng/SM Gioconda/M Giordano/M Giorgia/M Giorgi/M Giorgio/M Giorgione/M Giotto/M Giovanna/M Giovanni/M Gipsy's giraffe/MS Giralda/M Giraldo/M Giraud/M Giraudoux/M girded/U girder/M girdle/GMRSD girdler/M gird/RDSGZ girlfriend/MS girlhood/SM girlie/M girlishness/SM girlish/YP girl/MS giro/M girt/GDS girth/MDG girths Gisela/M Giselbert/M Gisele/M Gisella/M Giselle/M Gish/M gist/MS git/M Giuditta/M Giulia/M Giuliano/M Giulietta/M Giulio/M Giuseppe/M Giustina/M Giustino/M Giusto/M giveaway/SM giveback/S give/HZGRS given/SP giver/M giving/Y Giza/M Gizela/M gizmo's gizzard/SM Gk/M glacé/DGS glacial/Y glaciate/XNGDS glaciation/M glacier/SM glaciological glaciologist/M glaciology/M gladded gladden/GDS gladder gladdest gladding gladdy glade/SM gladiatorial gladiator/SM Gladi/M gladiola/MS gladioli gladiolus/M gladly/RT Glad/M gladness/MS gladsome/RT Gladstone/MS Gladys glad/YSP glamor/DMGS glamorization/MS glamorizer/M glamorize/SRDZG glamorousness/M glamorous/PY glance/GJSD glancing/Y glanders/M glandes glandular/Y gland/ZSM glans/M glare/SDG glaringness/M glaring/YP Glaser/M Glasgow/M glasnost/S glassblower/S glassblowing/MS glassful/MS glass/GSDM glasshouse/SM glassily glassiness/SM glassless Glass/M glassware/SM glasswort/M glassy/PRST Glastonbury/M Glaswegian/S glaucoma/SM glaucous glazed/U glazer/M glaze/SRDGZJ glazier/SM glazing/M gleam/MDGS gleaner/M gleaning/M glean/RDGZJS Gleason/M Gleda/M gleed/M glee/DSM gleefulness/MS gleeful/YP gleeing Glendale/M Glenda/M Glenden/M Glendon/M Glenine/M Glen/M Glenna/M Glennie/M Glennis/M Glenn/M glen/SM glibber glibbest glibness/MS glib/YP glide/JGZSRD glider/M glim/M glimmer/DSJG glimmering/M glimpse/DRSZMG glimpser/M glint/DSG glissandi glissando/M glisten/DSG glister/DGS glitch/MS glitter/GDSJ glittering/Y glittery glitz/GSD glitzy/TR gloaming/MS gloater/M gloating/Y gloat/SRDG globalism/S globalist/S global/SY globe/SM globetrotter/MS glob/GDMS globularity/M globularness/M globular/PY globule/MS globulin/MS glockenspiel/SM glommed gloom/GSMD gloomily gloominess/MS gloomy/RTP glop/MS glopped glopping gloppy/TR Gloria/M Gloriana/M Gloriane/M glorification/M glorifier/M glorify/XZRSDNG Glori/M glorious/IYP gloriousness/IM Glory/M glory/SDMG glossary/MS gloss/GSDM glossily glossiness/SM glossolalia/SM glossy/RSPT glottal glottalization/M glottis/MS Gloucester/M gloveless glover/M Glover/M glove/SRDGMZ glower/GD glow/GZRDMS glowing/Y glowworm/SM glucose/SM glue/DRSMZG glued/U gluer/M gluey gluier gluiest glummer glummest glumness/MS glum/SYP gluon/M glutamate/M gluten/M glutenous glutinousness/M glutinous/PY glut/SMNX glutted glutting glutton/MS gluttonous/Y gluttony/SM glyceride/M glycerinate/MD glycerine's glycerin/SM glycerolized/C glycerol/SM glycine/M glycogen/SM glycol/MS Glynda/M Glynis/M Glyn/M Glynnis/M Glynn/M glyph/M glyphs gm GM GMT gnarl/SMDG gnash/SDG gnat/MS gnawer/M gnaw/GRDSJ gnawing/M gneiss/SM Gnni/M gnomelike GNOME/M gnome/SM gnomic gnomish gnomonic gnosticism Gnosticism/M gnostic/K Gnostic/M GNP gnu/MS goad/MDSG goalie/SM goalkeeper/MS goalkeeping/M goalless goal/MDSG goalmouth/M goalpost/S goalscorer goalscoring goaltender/SM Goa/M goatee/SM goatherd/MS goat/MS goatskin/SM gobbed gobbet/MS gobbing gobbledegook's gobbledygook/S gobbler/M gobble/SRDGZ Gobi/M goblet/MS goblin/SM gob/SM Godard/M Godart/M godchild/M godchildren goddammit goddamn/GS Goddard/M Goddart/M goddaughter/SM godded goddess/MS godding Gödel/M godfather/GSDM godforsaken Godfree/M Godfrey/M Godfry/M godhead/S godhood/SM Godiva/M godlessness/MS godless/P godlikeness/M godlike/P godliness/UMS godly/UTPR God/M godmother/MS Godot/M godparent/SM godsend/MS god/SMY godson/MS Godspeed/S Godthaab/M Godunov/M Godwin/M Godzilla/M Goebbels/M Goering/M goer/MG goes Goethals/M Goethe/M gofer/SM Goff/M goggler/M goggle/SRDGZ Gogh/M Gog/M Gogol/M Goiania/M going/M goiter/SM Golan/M Golconda/M Golda/M Goldarina/M Goldberg/M goldbricker/M goldbrick/GZRDMS Golden/M goldenness/M goldenrod/SM goldenseal/M golden/TRYP goldfinch/MS goldfish/SM Goldia/M Goldie/M Goldilocks/M Goldi/M Goldina/M Golding/M Goldman/M goldmine/S gold/MRNGTS goldsmith/M Goldsmith/M goldsmiths Goldstein/M Goldwater/M Goldwyn/M Goldy/M Goleta/M golfer/M golf/RDMGZS Golgotha/M Goliath/M Goliaths golly/S Gomez/M Gomorrah/M Gompers/M go/MRHZGJ gonadal gonad/SM gondola/SM gondolier/MS Gondwanaland/M goner/M gone/RZN gong/SGDM gonion/M gonna gonorrheal gonorrhea/MS Gonzales/M Gonzalez/M Gonzalo/M Goober/M goober/MS goodbye/MS goodhearted goodie's goodish goodly/TR Good/M Goodman/M goodness/MS goodnight Goodrich/M good/SYP goodwill/MS Goodwin/M Goodyear/M goody/SM gooey goofiness/MS goof/SDMG goofy/RPT Google/M gooier gooiest gook/SM goo/MS goon/SM goop/SM gooseberry/MS goosebumps goose/M goos/SDG GOP Gopher gopher/SM Goran/M Goraud/M Gorbachev Gordan/M Gorden/M Gordian/M Gordie/M Gordimer/M Gordon/M Gordy/M gore/DSMG Gore/M Goren/M Gorey/M Gorgas gorged/E gorge/GMSRD gorgeousness/SM gorgeous/YP gorger/EM gorges/E gorging/E Gorgon/M gorgon/S Gorgonzola/M Gorham/M gorilla/MS gorily goriness/MS goring/M Gorky/M gormandizer/M gormandize/SRDGZ gormless gorp/S gorse/SM gory/PRT gos goshawk/MS gosh/S gosling/M gospeler/M gospel/MRSZ Gospel/SM gossamer/SM gossipy gossip/ZGMRDS gotcha/SM Göteborg/M Gotham/M Gothart/M Gothicism/M Gothic/S Goth/M Goths got/IU goto GOTO/MS gotta gotten/U Gottfried/M Goucher/M Gouda/SM gouge/GZSRD gouger/M goulash/SM Gould/M Gounod/M gourde/SM gourd/MS gourmand/MS gourmet/MS gout/SM gouty/RT governable/U governance/SM governed/U governess/SM govern/LBGSD governmental/Y government/MS Governor governor/MS governorship/SM gov/S govt gown/GSDM Goya/M GP GPA GPO GPSS gr grabbed grabber/SM grabbing/S grab/S Gracchus/M grace/ESDMG graceful/EYPU gracefuller gracefullest gracefulness/ESM Graceland/M gracelessness/MS graceless/PY Grace/M Gracia/M Graciela/M Gracie/M graciousness/SM gracious/UY grackle/SM gradate/DSNGX gradation/MCS grade/ACSDG graded/U Gradeigh/M gradely grader/MC grade's Gradey/M gradient/RMS grad/MRDGZJS gradualism/MS gradualist/MS gradualness/MS gradual/SYP graduand/SM graduate/MNGDSX graduation/M Grady/M Graehme/M Graeme/M Graffias/M graffiti graffito/M Graff/M grafter/M grafting/M graft/MRDSGZ Grafton/M Grahame/M Graham/M graham/SM Graig/M grail/S Grail/SM grainer/M grain/IGSD graininess/MS graining/M grain's grainy/RTP gram/KSM Gram/M grammarian/SM grammar/MS grammaticality/M grammaticalness/M grammatical/UY grammatic/K gramme/SM Grammy/S gramophone/SM Grampians grampus/SM Granada/M granary/MS grandam/SM grandaunt/MS grandchild/M grandchildren granddaddy/MS granddad/SM granddaughter/MS grandee/SM grandeur/MS grandfather/MYDSG grandiloquence/SM grandiloquent/Y grandiose/YP grandiosity/MS grandkid/SM grandma/MS grandmaster/MS grandmother/MYS grandnephew/MS grandness/MS grandniece/SM grandpa/MS grandparent/MS grandson/MS grandstander/M grandstand/SRDMG grand/TPSYR granduncle/MS Grange/MR grange/MSR Granger/M granite/MS granitic Gran/M Grannie/M Granny/M granny/MS granola/S grantee/MS granter/M Grantham/M Granthem/M Grantley/M Grant/M grantor's grant/SGZMRD grantsmanship/S granularity/SM granular/Y granulate/SDXVGN granulation/M granule/SM granulocytic Granville/M grapefruit/SM grape/SDGM grapeshot/M grapevine/MS grapheme/M graph/GMD graphical/Y graphicness/M graphic/PS graphics/M graphite/SM graphologist/SM graphology/MS graphs grapnel/SM grapple/DRSG grappler/M grappling/M grasper/M graspingness/M grasping/PY grasp/SRDBG grass/GZSDM grasshopper/SM grassland/MS Grass/M grassroots grassy/RT Grata/M gratefuller gratefullest gratefulness/USM grateful/YPU grater/M grates/I grate/SRDJGZ Gratia/M Gratiana/M graticule/M gratification/M gratified/U gratifying/Y gratify/NDSXG grating/YM gratis gratitude/IMS gratuitousness/MS gratuitous/PY gratuity/SM gravamen/SM gravedigger/SM gravel/SGMYD graven graveness/MS graver/M graveside/S Graves/M grave/SRDPGMZTY gravestone/SM graveyard/MS gravidness/M gravid/PY gravimeter/SM gravimetric gravitas gravitate/XVGNSD gravitational/Y gravitation/M graviton/SM gravity/MS gravy/SM graybeard/MS Grayce/M grayish Gray/M grayness/S gray/PYRDGTS Grayson/M graze/GZSRD grazer/M Grazia/M grazing/M grease/GMZSRD greasepaint/MS greaseproof greaser/M greasily greasiness/SM greasy/PRT greatcoat/DMS greaten/DG greathearted greatness/MS great/SPTYRN grebe/MS Grecian/S Greece/M greed/C greedily greediness/SM greeds greed's greedy/RTP Greek/SM Greeley/M greenback/MS greenbelt/S Greenberg/M Greenblatt/M Greenbriar/M Greene/M greenery/MS Greenfeld/M greenfield Greenfield/M greenfly/M greengage/SM greengrocer/SM greengrocery/M greenhorn/SM greenhouse/SM greening/M greenish/P Greenland/M Green/M greenmail/GDS greenness/MS Greenpeace/M greenroom/SM Greensboro/M Greensleeves/M Greensville/M greensward/SM green/SYRDMPGT Greentree/M Greenville/M Greenwich/M greenwood/MS Greer/M greeter/M greeting/M greets/A greet/SRDJGZ gregariousness/MS gregarious/PY Gregg/M Greggory/M Greg/M Gregoire/M Gregoor/M Gregorian Gregorio/M Gregorius/M Gregor/M Gregory/M gremlin/SM Grenada/M grenade/MS Grenadian/S grenadier/SM Grenadines grenadine/SM Grendel/M Grenier/M Grenoble/M Grenville/M Gresham/M Gretal/M Greta/M Gretchen/M Gretel/M Grete/M Grethel/M Gretna/M Gretta/M Gretzky/M grew/A greybeard/M greyhound/MS Grey/M greyness/M gridded griddlecake/SM griddle/DSGM gridiron/GSMD gridlock/DSG grids/A grid/SGM grief/MS Grieg/M Grier/M grievance/SM griever/M grieve/SRDGZ grieving/Y grievousness/SM grievous/PY Griffie/M Griffin/M griffin/SM Griffith/M Griff/M griffon's Griffy/M griller/M grille/SM grill/RDGS grillwork/M grimace/DRSGM grimacer/M Grimaldi/M grime/MS Grimes griminess/MS grimmer grimmest Grimm/M grimness/MS grim/PGYD grimy/TPR Grinch/M grind/ASG grinder/MS grinding/SY grindstone/SM gringo/SM grinned grinner/M grinning/Y grin/S griper/M gripe/S grippe/GMZSRD gripper/M gripping/Y grip/SGZMRD Griselda/M grisliness/SM grisly/RPT Gris/M Grissel/M gristle/SM gristliness/M gristly/TRP gristmill/MS grist/MYS Griswold/M grit/MS gritted gritter/MS grittiness/SM gritting gritty/PRT Griz/M grizzle/DSG grizzling/M grizzly/TRS Gr/M groaner/M groan/GZSRDM groat/SM grocer/MS grocery/MS groggily grogginess/SM groggy/RPT grog/MS groin/MGSD grokked grokking grok/S grommet/GMDS Gromyko/M groofs groomer/M groom/GZSMRD groomsman/M groomsmen Groot/M groover/M groove/SRDGM groovy/TR groper/M grope/SRDJGZ Gropius/M grosbeak/SM grosgrain/MS Gross Grosset/M gross/GTYSRDP Grossman/M grossness/MS Grosvenor/M Grosz/M grotesqueness/MS grotesque/PSY Grotius/M Groton/M grottoes grotto/M grouch/GDS grouchily grouchiness/MS grouchy/RPT groundbreaking/S grounded/U grounder/M groundhog/SM ground/JGZMDRS groundlessness/M groundless/YP groundnut/MS groundsheet/M groundskeepers groundsman/M groundswell/S groundwater/S groundwork/SM grouped/A grouper/M groupie/MS grouping/M groups/A group/ZJSMRDG grouse/GMZSRD grouser/M grouter/M grout/GSMRD groveler/M grovelike groveling/Y grovel/SDRGZ Grover/M Grove/RM grove/SRMZ grower/M grow/GZYRHS growing/I growingly growler/M growling/Y growl/RDGZS growly/RP grown/IA grownup/MS grows/A growth/IMA growths/IA grubbed grubber/SM grubbily grubbiness/SM grubbing grubby/RTP grub/MS grubstake/MSDG grudge/GMSRDJ grudger/M grudging/Y grueling/Y gruel/MDGJS gruesomeness/SM gruesome/RYTP gruffness/MS gruff/PSGTYRD grumble/GZJDSR grumbler/M grumbling/Y Grumman/M grumpily grumpiness/MS grump/MDGS grumpy/TPR Grundy/M Grünewald/M grunge/S grungy/RT grunion/SM grunter/M grunt/SGRD Grusky/M Grus/M Gruyère Gruyeres gryphon's g's G's gs/A GSA gt GU guacamole/MS Guadalajara/M Guadalcanal/M Guadalquivir/M Guadalupe/M Guadeloupe/M Guallatiri/M Gualterio/M Guamanian/SM Guam/M Guangzhou guanine/MS guano/MS Guantanamo/M Guarani/M guarani/SM guaranteeing guarantee/RSDZM guarantor/SM guaranty/MSDG guardedness/UM guarded/UYP guarder/M guardhouse/SM Guardia/M guardianship/MS guardian/SM guardrail/SM guard/RDSGZ guardroom/SM guardsman/M guardsmen Guarnieri/M Guatemala/M Guatemalan/S guava/SM Guayaquil/M gubernatorial Gucci/M gudgeon/M Guelph/M Guendolen/M Guenevere/M Guenna/M Guenther/M guernsey/S Guernsey/SM Guerra/M Guerrero/M guerrilla/MS guessable/U guess/BGZRSD guessed/U guesser/M guesstimate/DSMG guesswork/MS guest/SGMD Guevara/M guffaw/GSDM guff/SM Guggenheim/M Guglielma/M Guglielmo/M Guhleman/M GUI Guiana/M guidance/MS guidebook/SM guided/U guide/GZSRD guideline/SM guidepost/MS guider/M Guido/M Guilbert/M guilder/M guildhall/SM guild/SZMR guileful guilelessness/MS guileless/YP guile/SDGM Guillaume/M Guillema/M Guillemette/M guillemot/MS Guillermo/M guillotine/SDGM guiltily guiltiness/MS guiltlessness/M guiltless/YP guilt/SM guilty/PTR Gui/M Guinea/M Guinean/S guinea/SM Guinevere/M Guinna/M Guinness/M guise's guise/SDEG guitarist/SM guitar/SM Guiyang Guizot/M Gujarati/M Gujarat/M Gujranwala/M gulag/S gulch/MS gulden/MS gulf/DMGS Gullah/M gullet/MS gulley's gullibility/MS gullible Gulliver/M gull/MDSG gully/SDMG gulp/RDGZS gumboil/MS gumbo/MS gumboots gumdrop/SM gummed gumminess/M gumming/C gum/MS gummy/RTP gumption/SM gumshoeing gumshoe/SDM gumtree/MS Gunar/M gunboat/MS Gunderson/M gunfighter/M gunfight/SRMGZ gunfire/SM gunflint/M gunfought Gunilla/M gunk/SM gunky/RT Gun/M gunman/M gunmen gunmetal/MS gun/MS Gunnar/M gunned gunnel's Gunner/M gunner/SM gunnery/MS gunning/M gunnysack/SM gunny/SM gunpoint/MS gunpowder/SM gunrunner/MS gunrunning/MS gunship/S gunshot/SM gunslinger/M gunsling/GZR gunsmith/M gunsmiths Guntar/M Gunter/M Gunther/M gunwale/MS Guofeng/M guppy/SM Gupta/M gurgle/SDG Gurkha/M gurney/S guru/MS Gusella/M gusher/M gush/SRDGZ gushy/TR Gus/M Guss gusset/MDSG Gussie/M Gussi/M gussy/GSD Gussy/M Gustaf/M Gustafson/M Gusta/M gustatory Gustave/M Gustav/M Gustavo/M Gustavus/M gusted/E Gustie/M gustily Gusti/M gustiness/M gusting/E gust/MDGS gustoes gusto/M gusts/E Gusty/M gusty/RPT Gutenberg/M Guthrey/M Guthrie/M Guthry/M Gutierrez/M gutlessness/S gutless/P gutser/M gutsiness/M gut/SM guts/R gutsy/PTR gutted gutter/GSDM guttering/M guttersnipe/M gutting gutturalness/M guttural/SPY gutty/RSMT Guyana/M Guyanese Guy/M guy/MDRZGS Guzman/M guzzle/GZRSD guzzler/M g/VBX Gwalior/M Gwendolen/M Gwendoline/M Gwendolin/M Gwendolyn/M Gweneth/M Gwenette/M Gwen/M Gwenneth/M Gwennie/M Gwenni/M Gwenny/M Gwenora/M Gwenore/M Gwyneth/M Gwyn/M Gwynne/M gymkhana/SM gym/MS gymnasia's gymnasium/SM gymnastically gymnastic/S gymnastics/M gymnast/SM gymnosperm/SM gynecologic gynecological/MS gynecologist/SM gynecology/MS gypped gypper/S gypping gyp/S gypsite gypster/S gypsum/MS gypsy/SDMG Gypsy/SM gyrate/XNGSD gyration/M gyrator/MS gyrfalcon/SM gyrocompass/M gyro/MS gyroscope/SM gyroscopic gyve/GDS H Haag/M Haas/M Habakkuk/M habeas haberdasher/SM haberdashery/SM Haber/M Haberman/M Habib/M habiliment/SM habitability/MS habitableness/M habitable/P habitant/ISM habitation/MI habitations habitat/MS habit/IBDGS habit's habitualness/SM habitual/SYP habituate/SDNGX habituation/M habitué/MS hacienda/MS hacker/M Hackett/M hack/GZSDRBJ hackler/M hackle/RSDMG hackney/SMDG hacksaw/SDMG hackwork/S Hadamard/M Hadar/M Haddad/M haddock/MS hades Hades had/GD hadji's hadj's Hadlee/M Hadleigh/M Hadley/M Had/M hadn't Hadria/M Hadrian/M hadron/MS hadst haemoglobin's haemophilia's haemorrhage's Hafiz/M hafnium/MS haft/GSMD Hagan/M Hagar/M Hagen/M Hager/M Haggai/M haggardness/MS haggard/SYP hagged hagging haggish haggis/SM haggler/M haggle/RSDZG Hagiographa/M hagiographer/SM hagiography/MS hag/SMN Hagstrom/M Hague/M ha/H hahnium/S Hahn/M Haifa/M haiku/M Hailee/M hailer/M Hailey/M hail/SGMDR hailstone/SM hailstorm/SM Haily/M Haiphong/M hairball/SM hairbreadth/M hairbreadths hairbrush/SM haircare haircloth/M haircloths haircut/MS haircutting hairdo/SM hairdresser/SM hairdressing/SM hairdryer/S hairiness/MS hairlessness/M hairless/P hairlike hairline/SM hairnet/MS hairpiece/MS hairpin/MS hairsbreadth hairsbreadths hair/SDM hairsplitter/SM hairsplitting/MS hairspray hairspring/SM hairstyle/SMG hairstylist/S hairy/PTR Haitian/S Haiti/M hajjes hajji/MS hajj/M Hakeem/M hake/MS Hakim/M Hakka/M Hakluyt/M halalled halalling halal/S halberd/SM halcyon/S Haldane/M Haleakala/M Haleigh/M hale/ISRDG Hale/M haler/IM halest Halette/M Haley/M halfback/SM halfbreed halfheartedness/MS halfhearted/PY halfpence/S halfpenny/MS halfpennyworth half/PM halftime/S halftone/MS halfway halfword/MS halibut/SM halide/SM Halie/M Halifax/M Hali/M Halimeda/M halite/MS halitoses halitosis/M hallelujah hallelujahs Halley/M halliard's Hallie/M Halli/M Hallinan/M Hall/M Hallmark/M hallmark/SGMD hallo/GDS halloo's Halloween/MS hallowing hallows hallow/UD hall/SMR Hallsy/M hallucinate/VNGSDX hallucination/M hallucinatory hallucinogenic/S hallucinogen/SM hallway/SM Hally/M halocarbon halogenated halogen/SM halon halo/SDMG Halpern/M Halsey/M Hal/SMY Halsy/M halter/GDM halt/GZJSMDR halting/Y halve/GZDS halves/M halyard/MS Ha/M Hamal/M Haman/M hamburger/M Hamburg/MS hamburg/SZRM Hamel/M Hamey/M Hamhung/M Hamid/M Hamilcar/M Hamil/M Hamiltonian/MS Hamilton/M Hamish/M Hamitic/M Hamlen/M Hamlet/M hamlet/MS Hamlin/M Ham/M Hammad/M Hammarskjold/M hammed hammerer/M hammerhead/SM hammering/M hammerless hammerlock/MS Hammerstein/M hammertoe/SM hammer/ZGSRDM Hammett/M hamming hammock/MS Hammond/M Hammurabi/M hammy/RT Hamnet/M hampered/U hamper/GSD Hampshire/M Hampton/M ham/SM hamster/MS hamstring/MGS hamstrung Hamsun/M Hana/M Hanan/M Hancock/M handbagged handbagging handbag/MS handball/SM handbarrow/MS handbasin handbill/MS handbook/SM handbrake/M handcar/SM handcart/MS handclasp/MS handcraft/GMDS handcuff/GSD handcuffs/M handedness/M handed/PY Handel/M hander/S handful/SM handgun/SM handhold/M handicapped handicapper/SM handicapping handicap/SM handicraftsman/M handicraftsmen handicraft/SMR handily/U handiness/SM handiwork/MS handkerchief/MS handleable handlebar/SM handle/MZGRSD handler/M handless handling/M handmade handmaiden/M handmaid/NMSX handout/SM handover handpick/GDS handrail/SM hand's handsaw/SM handset/SM handshake/GMSR handshaker/M handshaking/M handsomely/U handsomeness/MS handsome/RPTY handspike/SM handspring/SM handstand/MS hand/UDSG handwork/SM handwoven handwrite/GSJ handwriting/M handwritten Handy/M handyman/M handymen handy/URT Haney/M hangar/SGDM hangdog/S hanged/A hanger/M hang/GDRZBSJ hanging/M hangman/M hangmen hangnail/MS hangout/MS hangover/SM hangs/A Hangul/M hangup/S Hangzhou Hankel/M hankerer/M hanker/GRDJ hankering/M hank/GZDRMS hankie/SM Hank/M hanky's Hannah/M Hanna/M Hannibal/M Hannie/M Hanni/MS Hanny/M Hanoi/M Hanoverian Hanover/M Hansel/M Hansen/M Hansiain/M Han/SM Hans/N hansom/MS Hanson/M Hanuka/S Hanukkah/M Hanukkahs Hapgood/M haphazardness/SM haphazard/SPY haplessness/MS hapless/YP haploid/S happed happening/M happen/JDGS happenstance/SM happily/U happiness/UMS happing Happy/M happy/UTPR Hapsburg/M hap/SMY Harald/M harangue/GDRS haranguer/M Harare harasser/M harass/LSRDZG harassment/SM Harbert/M harbinger/DMSG Harbin/M harborer/M harbor/ZGRDMS Harcourt/M hardback/SM hardball/SM hardboard/SM hardboiled hardbound hardcore/MS hardcover/SM hardened/U hardener/M hardening/M harden/ZGRD hardhat/S hardheadedness/SM hardheaded/YP hardheartedness/SM hardhearted/YP hardihood/MS hardily hardiness/SM Harding/M Hardin/M hardliner/S hardness/MS hardscrabble hardshell hardship/MS hardstand/S hardtack/MS hardtop/MS hardware/SM hardwire/DSG hardwood/MS hardworking Hardy/M hard/YNRPJGXTS hardy/PTRS harebell/MS harebrained harelip/MS harelipped hare/MGDS harem/SM Hargreaves/M hark/GDS Harland/M Harlan/M Harlem/M Harlene/M Harlen/M Harlequin harlequin/MS Harley/M Harlie/M Harli/M Harlin/M harlotry/MS harlot/SM Harlow/M Harman/M harmed/U harmer/M harmfulness/MS harmful/PY harmlessness/SM harmless/YP harm/MDRGS Harmonia/M harmonically harmonica/MS harmonic/S harmonics/M Harmonie/M harmonious/IPY harmoniousness/MS harmoniousness's/I harmonium/MS harmonization/A harmonizations harmonization's harmonized/U harmonizer/M harmonizes/UA harmonize/ZGSRD Harmon/M harmony/EMS Harmony/M harness/DRSMG harnessed/U harnesser/M harnesses/U Harold/M Haroun/M harper/M Harper/M harping/M harpist/SM harp/MDRJGZS Harp/MR harpooner/M harpoon/SZGDRM harpsichordist/MS harpsichord/SM harpy/SM Harpy/SM Harrell/M harridan/SM Harrie/M harrier/M Harriet/M Harrietta/M Harriette/M Harriett/M Harrington/M Harriot/M Harriott/M Harrisburg/M Harri/SM Harrisonburg/M Harrison/M harrower/M harrow/RDMGS harrumph/SDG Harry/M harry/RSDGZ harshen/GD harshness/SM harsh/TRNYP Harte/M Hartford/M Hartley/M Hartline/M Hart/M Hartman/M hart/MS Hartwell/M Harvard/M harvested/U harvester/M harvestman/M harvest/MDRZGS Harvey/MS Harv/M Harwell/M Harwilll/M has Hasbro/M hash/AGSD Hasheem/M hasher/M Hashim/M hashing/M hashish/MS hash's Hasidim Haskell/M Haskel/M Haskins/M Haslett/M hasn't hasp/GMDS hassle/MGRSD hassock/MS haste/MS hastener/M hasten/GRD hast/GXJDN Hastie/M hastily hastiness/MS Hastings/M Hasty/M hasty/RPT hatchback/SM hatcheck/S hatched/U hatcher/M hatchery/MS hatchet/MDSG hatching/M hatch/RSDJG Hatchure/M hatchway/MS hatefulness/MS hateful/YP hater/M hate/S Hatfield/M Hathaway/M hatless hat/MDRSZG hatred/SM hatstands hatted Hatteras/M hatter/SM Hattie/M Hatti/M hatting Hatty/M hauberk/SM Haugen/M haughtily haughtiness/SM haughty/TPR haulage/MS hauler/M haul/SDRGZ haunch/GMSD haunter/M haunting/Y haunt/JRDSZG Hauptmann/M Hausa/M Hausdorff/M Hauser/M hauteur/MS Havana/SM Havarti Havel/M haven/DMGS Haven/M haven't haver/G haversack/SM have/ZGSR havocked havocking havoc/SM Haw Hawaiian/S Hawaii/M hawker/M hawk/GZSDRM Hawking hawking/M Hawkins/M hawkishness/S hawkish/P Hawley/M haw/MDSG hawser/M haws/RZ Hawthorne/M hawthorn/MS haycock/SM Hayden/M Haydn/M Haydon/M Hayes hayfield/MS hay/GSMDR Hayley/M hayloft/MS haymow/MS Haynes hayrick/MS hayride/MS hayseed/MS Hay/SM haystack/SM haywain Hayward/M haywire/MS Haywood/M Hayyim/M hazard/MDGS hazardousness/M hazardous/PY haze/DSRJMZG Hazel/M hazel/MS hazelnut/SM Haze/M hazer/M hazily haziness/MS hazing/M Hazlett/M Hazlitt/M hazy/PTR HBO/M hdqrs HDTV headache/MS headband/SM headboard/MS headcount headdress/MS header/M headfirst headgear/SM headhunter/M headhunting/M headhunt/ZGSRDMJ headily headiness/S heading/M headlamp/S headland/MS headlessness/M headless/P headlight/MS headline/DRSZMG headliner/M headlock/MS headlong Head/M headman/M headmaster/MS headmastership/M headmen headmistress/MS headphone/SM headpiece/SM headpin/MS headquarter/GDS headrest/MS headroom/SM headscarf/M headset/SM headship/SM headshrinker/MS head/SJGZMDR headsman/M headsmen headstall/SM headstand/MS headstock/M headstone/MS headstrong headwaiter/SM headwall/S headwater/S headway/MS headwind/SM headword/MS heady/PTR heal/DRHSGZ healed/U healer/M Heall/M healthfully healthfulness/SM healthful/U healthily/U healthiness/MSU health/M healths healthy/URPT heap/SMDG heard/UA hearer/M hearing/AM hearken/SGD hearsay/SM hearse/M hears/SDAG Hearst/M heartache/SM heartbeat/MS heartbreak/GMS heartbreaking/Y heartbroke heartbroken heartburning/M heartburn/SGM hearted/Y hearten/EGDS heartening/EY heartfelt hearth/M hearthrug hearths hearthstone/MS heartily heartiness/SM heartland/SM heartlessness/SM heartless/YP heartrending/Y heartsickness/MS heartsick/P heart/SMDNXG heartstrings heartthrob/MS heartwarming Heartwood/M heartwood/SM hearty/TRSP hear/ZTSRHJG heatedly heated/UA heater/M heathendom/SM heathenish/Y heathenism/MS heathen/M heather/M Heather/M heathery Heathkit/M heathland Heathman/M Heath/MR heath/MRNZX heaths heatproof heats/A heat/SMDRGZBJ heatstroke/MS heatwave heave/DSRGZ heavenliness/M heavenly/PTR heaven/SYM heavenward/S heaver/M heaves/M heavily heaviness/MS Heaviside/M heavyhearted heavyset heavy/TPRS heavyweight/SM Hebe/M hebephrenic Hebert/M Heb/M Hebraic Hebraism/MS Hebrew/SM Hebrides/M Hecate/M hecatomb/M heckler/M heckle/RSDZG heck/S hectare/MS hectically hectic/S hectogram/MS hectometer/SM Hector/M hector/SGD Hecuba/M he'd Heda/M Hedda/M Heddie/M Heddi/M hedge/DSRGMZ hedgehog/MS hedgehopped hedgehopping hedgehop/S hedger/M hedgerow/SM hedging/Y Hedi/M hedonism/SM hedonistic hedonist/MS Hedvige/M Hedvig/M Hedwiga/M Hedwig/M Hedy/M heeded/U heedfulness/M heedful/PY heeding/U heedlessness/SM heedless/YP heed/SMGD heehaw/DGS heeler/M heeling/M heelless heel/SGZMDR Heep/M Hefner/M heft/GSD heftily heftiness/SM hefty/TRP Hegelian Hegel/M hegemonic hegemony/MS Hegira/M hegira/S Heida/M Heidegger/M Heidelberg/M Heidie/M Heidi/M heifer/MS Heifetz/M heighten/GD height/SMNX Heimlich/M Heindrick/M Heineken/M Heine/M Heinlein/M heinousness/SM heinous/PY Heinrich/M Heinrick/M Heinrik/M Heinze/M Heinz/M heiress/MS heirloom/MS heir/SDMG Heisenberg/M Heiser/M heister/M heist/GSMRD Hejira's Helaina/M Helaine/M held Helena/M Helene/M Helenka/M Helen/M Helga/M Helge/M helical/Y helices/M helicon/M Helicon/M helicopter/GSMD heliocentric heliography/M Heliopolis/M Helios/M heliosphere heliotrope/SM heliport/MS helium/MS helix/M he'll hellbender/M hellbent hellcat/SM hellebore/SM Hellene/SM Hellenic Hellenism/MS Hellenistic Hellenist/MS Hellenization/M Hellenize heller/M Heller/M Hellespont/M hellfire/M hell/GSMDR hellhole/SM Helli/M hellion/SM hellishness/SM hellish/PY Hellman/M hello/GMS Hell's helluva helmed helmet/GSMD Helmholtz/M helming helms helm's helmsman/M helmsmen helm/U Helmut/M Héloise/M helot/S helper/M helpfulness/MS helpful/UY help/GZSJDR helping/M helplessness/SM helpless/YP helpline/S helpmate/SM helpmeet's Helsa/M Helsinki/M helve/GMDS Helvetian/S Helvetius/M Helyn/M He/M hematite/MS hematologic hematological hematologist/SM hematology/MS heme/MS Hemingway/M hemisphere/MSD hemispheric hemispherical hemline/SM hemlock/MS hemmed hemmer/SM hemming hem/MS hemoglobin/MS hemolytic hemophiliac/SM hemophilia/SM hemorrhage/GMDS hemorrhagic hemorrhoid/MS hemostat/SM hemp/MNS h/EMS hemstitch/DSMG henceforth henceforward hence/S Hench/M henchman/M henchmen Henderson/M Hendrick/SM Hendrickson/M Hendrika/M Hendrik/M Hendrix/M henge/M Henka/M Henley/M hen/MS henna/MDSG Hennessey/M henning henpeck/GSD Henrie/M Henrieta/M Henrietta/M Henriette/M Henrik/M Henri/M Henryetta/M henry/M Henry/M Hensley/M Henson/M heparin/MS hepatic/S hepatitides hepatitis/M Hepburn/M Hephaestus/M Hephzibah/M hepper heppest Hepplewhite hep/S heptagonal heptagon/SM heptane/M heptathlon/S her Heracles/M Heraclitus/M heralded/U heraldic herald/MDSG heraldry/MS Hera/M herbaceous herbage/MS herbalism herbalist/MS herbal/S Herbart/M Herbert/M herbicidal herbicide/MS Herbie/M herbivore/SM herbivorous/Y Herb/M herb/MS Herby/M Herc/M Herculaneum/M herculean Herculean Hercule/MS Herculie/M herder/M Herder/M herd/MDRGZS herdsman/M herdsmen hereabout/S hereafter/S hereby hereditary heredity/MS Hereford/SM herein hereinafter here/IS hereof hereon here's heres/M heresy/SM heretical heretic/SM hereto heretofore hereunder hereunto hereupon herewith Heriberto/M heritable heritage/MS heritor/IM Herkimer/M Herman/M Hermann/M hermaphrodite/SM hermaphroditic Hermaphroditus/M hermeneutic/S hermeneutics/M Hermes hermetical/Y hermetic/S Hermia/M Hermie/M Hermina/M Hermine/M Herminia/M Hermione/M hermitage/SM Hermite/M hermitian hermit/MS Hermon/M Hermosa/M Hermosillo/M Hermy/M Hernandez/M Hernando/M hernial hernia/MS herniate/NGXDS Herod/M Herodotus/M heroes heroically heroics heroic/U heroine/SM heroin/MS heroism/SM Herold/M hero/M heron/SM herpes/M herpetologist/SM herpetology/MS Herrera/M Herrick/M herringbone/SDGM Herring/M herring/SM Herrington/M Herr/MG Herschel/M Hersch/M herself Hersey/M Hershel/M Hershey/M Hersh/M Herta/M Hertha/M hertz/M Hertz/M Hertzog/M Hertzsprung/M Herve/M Hervey/M Herzegovina/M Herzl/M hes Hesiod/M hesitance/S hesitancy/SM hesitantly hesitant/U hesitater/M hesitate/XDRSNG hesitating/UY hesitation/M Hesperus/M Hesse/M Hessian/MS Hess/M Hester/M Hesther/M Hestia/M Heston/M heterodox heterodoxy/MS heterodyne heterogamous heterogamy/M heterogeneity/SM heterogeneousness/M heterogeneous/PY heterosexuality/SM heterosexual/YMS heterostructure heterozygous Hettie/M Hetti/M Hetty/M Heublein/M heuristically heuristic/SM Heusen/M Heuser/M he/VMZ hew/DRZGS Hewe/M hewer/M Hewet/M Hewett/M Hewie/M Hewitt/M Hewlett/M Hew/M hexachloride/M hexadecimal/YS hexafluoride/M hexagonal/Y hexagon/SM hexagram/SM hexameter/SM hex/DSRG hexer/M hey heyday/MS Heyerdahl/M Heywood/M Hezekiah/M hf HF Hf/M Hg/M hgt hgwy HHS HI Hialeah/M hiatus/SM Hiawatha/M hibachi/MS hibernate/XGNSD hibernation/M hibernator/SM Hibernia/M Hibernian/S hibiscus/MS hiccup/MDGS hickey/SM Hickey/SM Hickman/M Hickok/M hickory/MS hick/SM Hicks/M hi/D hidden/U hideaway/SM hidebound hideousness/SM hideous/YP hideout/MS hider/M hide/S hiding/M hid/ZDRGJ hieing hierarchal hierarchic hierarchical/Y hierarchy/SM hieratic hieroglyph hieroglyphic/S hieroglyphics/M hieroglyphs Hieronymus/M hie/S hifalutin Higashiosaka Higgins/M highball/GSDM highborn highboy/MS highbrow/SM highchair/SM highfalutin Highfield/M highhandedness/SM highhanded/PY highish Highlander/SM Highlands highland/ZSRM highlight/GZRDMS Highness/M highness/MS highpoint high/PYRT highroad/MS highs hight hightail/DGS highwayman/M highwaymen highway/MS hijacker/M hijack/JZRDGS hiker/M hike/ZGDSR Hilario/M hilariousness/MS hilarious/YP hilarity/MS Hilarius/M Hilary/M Hilbert/M Hildagarde/M Hildagard/M Hilda/M Hildebrand/M Hildegaard/M Hildegarde/M Hilde/M Hildy/M Hillard/M Hillary/M hillbilly/MS Hillcrest/M Hillel/M hiller/M Hillery/M hill/GSMDR Hilliard/M Hilliary/M Hillie/M Hillier/M hilliness/SM Hill/M hillman hillmen hillock/SM Hillsboro/M Hillsdale/M hillside/SM hilltop/MS hillwalking Hillyer/M Hilly/RM hilly/TRP hilt/MDGS Hilton/M Hi/M Himalaya/MS Himalayan/S Himmler/M him/S himself Hinayana/M Hinda/M Hindemith/M Hindenburg/M hindered/U hinderer/M hinder/GRD Hindi/M hindmost hindquarter/SM hindrance/SM hind/RSZ hindsight/SM Hinduism/SM Hindu/MS Hindustani/MS Hindustan/M Hines/M hinger hinge's hinge/UDSG Hinkle/M Hinsdale/M hinterland/MS hinter/M hint/GZMDRS Hinton/M Hinze/M hipbone/SM hipness/S Hipparchus/M hipped hipper hippest hippie/MTRS hipping/M Hippocrates/M Hippocratic hippodrome/MS hippo/MS hippopotamus/SM hip/PSM hippy's hipster/MS hiragana Hiram/M hire/AGSD hireling/SM hirer/SM Hirey/M hiring/S Hirohito/M Hiroshi/M Hiroshima/M Hirsch/M hirsuteness/MS hirsute/P his Hispanic/SM Hispaniola/M hiss/DSRMJG hisser/M hissing/M Hiss/M histamine/SM histidine/SM histochemic histochemical histochemistry/M histogram/MS histological histologist/MS histology/SM historian/MS historic historicalness/M historical/PY historicism/M historicist/M historicity/MS historiographer/SM historiography/MS history/MS histrionically histrionic/S histrionics/M hist/SDG Hitachi/M Hitchcock/M hitcher/MS hitchhike/RSDGZ hitch/UGSD hither hitherto Hitler/SM hitless hit/MS hittable hitter/SM hitting Hittite/SM HIV hive/MGDS h'm HM HMO Hmong HMS hoarder/M hoarding/M hoard/RDJZSGM hoarfrost/SM hoariness/MS hoar/M hoarseness/SM hoarse/RTYP hoary/TPR hoaxer/M hoax/GZMDSR Hobard/M Hobart/M hobbed Hobbes/M hobbing hobbit hobbler/M hobble/ZSRDG Hobbs/M hobbyhorse/SM hobbyist/SM hobby/SM Hobday/M Hobey/M hobgoblin/MS Hobie/M hobnail/GDMS hobnobbed hobnobbing hobnob/S Hoboken/M hobo/SDMG hob/SM hoc hocker/M hockey/SM hock/GDRMS Hockney/M hockshop/SM hodge/MS Hodge/MS hodgepodge/SM Hodgkin/M ho/DRYZ hod/SM Hoebart/M hoecake/SM hoedown/MS hoeing hoer/M hoe/SM Hoffa/M Hoff/M Hoffman/M Hofstadter/M Hogan/M hogan/SM Hogarth/M hogback/MS hogged hogger hogging hoggish/Y hogshead/SM hog/SM hogtie/SD hogtying hogwash/SM Hohenlohe/M Hohenstaufen/M Hohenzollern/M Hohhot/M hoister/M hoist/GRDS hoke/DSG hokey/PRT hokier hokiest Hokkaido/M hokum/MS Hokusai/M Holbein/M Holbrook/M Holcomb/M holdall/MS Holden/M holder/M Holder/M holding/IS holding's hold/NRBSJGZ holdout/SM holdover/SM holdup/MS hole/MGDS holey holiday/GRDMS Holiday/M holidaymaker/S holier/U Holiness/MS holiness/MSU holistic holistically hollandaise Hollandaise/M Hollander/M Holland/RMSZ holler/GDS Hollerith/M Holley/M Hollie/M Holli/SM Hollister/M Holloway/M hollowness/MS hollow/RDYTGSP hollowware/M Hollyanne/M hollyhock/MS Holly/M holly/SM Hollywood/M Holman/M Holmes holmium/MS Holm/M Holocaust holocaust/MS Holocene hologram/SM holograph/GMD holographic holographs holography/MS Holstein/MS holster/MDSG Holst/M Holt/M Holyoke/M holy/SRTP holystone/MS Holzman/M Ho/M homage/MGSRD homager/M hombre/SM homburg/SM homebody/MS homebound homeboy/S homebuilder/S homebuilding homebuilt homecoming/MS home/DSRMYZG homegrown homeland/SM homelessness/SM homeless/P homelike homeliness/SM homely/RPT homemade homemake/JRZG homemaker/M homemaking/M homeomorphic homeomorphism/MS homeomorph/M homeopath homeopathic homeopaths homeopathy/MS homeostases homeostasis/M homeostatic homeowner/S homeownership homepage Homere/M homer/GDM Homeric homerists Homer/M homeroom/MS Homerus/M homeschooling/S homesickness/MS homesick/P homespun/S homesteader/M homestead/GZSRDM homestretch/SM hometown/SM homeward homeworker/M homework/ZSMR homeyness/MS homey/PS homicidal/Y homicide/SM homier homiest homiletic/S homily/SM hominess's homing/M hominid/MS hominy/SM Hom/MR homogamy/M homogenate/MS homogeneity/ISM homogeneous/PY homogenization/MS homogenize/DRSGZ homogenizer/M homograph/M homographs homological homologous homologue/M homology/MS homomorphic homomorphism/SM homonym/SM homophobia/S homophobic homophone/MS homopolymers homosexuality/SM homosexual/YMS homo/SM homotopy homozygous/Y honcho/DSG Honda/M Hondo/M Honduran/S Honduras/M Honecker/M hone/SM honestly/E honest/RYT honesty/ESM honeybee/SM honeycomb/SDMG honeydew/SM honey/GSMD honeylocust Honey/M honeymooner/M honeymoon/RDMGZS honeysuckle/MS Honeywell/M hong/M Honiara/M honker/M honk/GZSDRM honky/SM Hon/M hon/MDRSZTG Honolulu/M honorableness/SM honorable/PSM honorables/U honorablies/U honorably/UE honorarily honorarium/SM honorary/S honored/U honoree/S honor/ERDBZGS honorer/EM Honoria/M honorific/S Honor/M honor's honors/A Honshu/M hooch/MS hoodedness/M hooded/P hoodlum/SM Hood/M hood/MDSG hoodoo/DMGS hoodwinker/M hoodwink/SRDG hooey/SM hoof/DRMSG hoofer/M hoofmark/S hookah/M hookahs hookedness/M hooked/P Hooke/MR hooker/M Hooker/M hookey's hook/GZDRMS hooks/U hookup/SM hookworm/MS hooky/SRMT hooliganism/SM hooligan/SM hooper/M Hooper/M hoopla/SM hoop/MDRSG hooray/SMDG hoosegow/MS Hoosier/SM hootch's hootenanny/SM hooter/M hoot/MDRSGZ Hoover/MS hooves/M hoped/U hopefulness/MS hopeful/SPY hopelessness/SM hopeless/YP Hope/M hoper/M hope/SM Hopewell/M Hopi/SM Hopkinsian/M Hopkins/M hopped Hopper/M hopper/MS hopping/M hoppled hopples hopscotch/MDSG hop/SMDRG Horace/M Horacio/M Horatia/M Horatio/M Horatius/M horde/DSGM horehound/MS horizon/MS horizontal/YS Hormel/M hormonal/Y hormone/MS Hormuz/M hornbeam/M hornblende/MS Hornblower/M hornedness/M horned/P Horne/M hornet/MS horn/GDRMS horniness/M hornless hornlike Horn/M hornpipe/MS horny/TRP horologic horological horologist/MS horology/MS horoscope/MS Horowitz/M horrendous/Y horribleness/SM horrible/SP horribly horridness/M horrid/PY horrific horrifically horrify/DSG horrifying/Y horror/MS hors/DSGX horseback/MS horsedom horseflesh/M horsefly/MS horsehair/SM horsehide/SM horselaugh/M horselaughs horseless horselike horsely horseman/M horsemanship/MS horsemen horseplayer/M horseplay/SMR horsepower/SM horseradish/SM horse's horseshoeing horseshoe/MRSD horseshoer/M horsetail/SM horse/UGDS horsewhipped horsewhipping horsewhip/SM horsewoman/M horsewomen horsey horsier horsiest horsing/M Horst/M hortatory Horten/M Hortense/M Hortensia/M horticultural horticulture/SM horticulturist/SM Hort/MN Horton/M Horus/M hosanna/SDG Hosea/M hose/M hosepipe hos/GDS hosier/MS hosiery/SM hosp hospice/MS hospitable/I hospitably/I hospitality/MS hospitality's/I hospitalization/MS hospitalize/GSD hospital/MS hostage/MS hosteler/M hostelry/MS hostel/SZGMRD hostess/MDSG hostile/YS hostility/SM hostler/MS Host/MS host/MYDGS hotbed/MS hotblooded hotbox/MS hotcake/S hotchpotch/M hotelier/MS hotelman/M hotel/MS hotfoot/DGS hothead/DMS hotheadedness/SM hotheaded/PY hothouse/MGDS hotness/MS hotplate/SM hotpot/M hot/PSY hotrod hotshot/S hotted Hottentot/SM hotter hottest hotting Houdaille/M Houdini/M hough/M hounder/M hounding/M hound/MRDSG hourglass/MS houri/MS hourly/S hour/YMS house/ASDG houseboat/SM housebound houseboy/SM housebreaker/M housebreaking/M housebreak/JSRZG housebroke housebroken housebuilding housecleaning/M houseclean/JDSG housecoat/MS housefly/MS houseful/SM householder/M household/ZRMS househusband/S housekeeper/M housekeeping/M housekeep/JRGZ houselights House/M housemaid/MS houseman/M housemen housemother/MS housemoving houseparent/SM houseplant/S houser house's housetop/MS housewares housewarming/MS housewifeliness/M housewifely/P housewife/YM housewives houseworker/M housework/ZSMR housing/MS Housman/M Houston/M Houyhnhnm/M HOV hovel/GSMD hovercraft/M hoverer/M hover/GRD hove/ZR Howard/M howbeit howdah/M howdahs howdy/GSD Howell/MS Howe/M however Howey/M Howie/M howitzer/MS howler/M howl/GZSMDR Howrah/M how/SM howsoever hoyden/DMGS hoydenish Hoyle/SM hoy/M Hoyt/M hp HP HQ hr HR HRH Hrothgar/M hrs h's H's HS HST ht HTML Hts/M HTTP Huang/M huarache/SM hubba Hubbard/M Hubble/M hubbub/SM hubby/SM hubcap/SM Huber/M Hube/RM Hubert/M Huberto/M Hubey/M Hubie/M hub/MS hubris/SM huckleberry/SM Huck/M huckster/SGMD HUD Huddersfield/M huddler/M huddle/RSDMG Hudson/M hue/MDS Huerta/M Huey/M huffily huffiness/SM Huff/M Huffman/M huff/SGDM huffy/TRP hugeness/MS huge/YP hugged hugger hugging/S Huggins Hughie/M Hugh/MS Hugibert/M Hugo/M hug/RTS Huguenot/SM Hugues/M huh huhs Hui/M Huitzilopitchli/M hula/MDSG Hulda/M hulk/GDMS hullabaloo/SM huller/M hulling/M Hull/M hull/MDRGZS hullo/GSDM humane/IY humaneness/SM humaner humanest human/IPY humanism/SM humanistic humanist/SM humanitarianism/SM humanitarian/S humanity/ISM humanization/CSM humanized/C humanizer/M humanize/RSDZG humanizes/IAC humanizing/C humankind/M humannesses humanness/IM humanoid/S humans Humbert/M Humberto/M humbleness/SM humble/TZGPRSDJ humbly Humboldt/M humbugged humbugging humbug/MS humdinger/MS humdrum/S Hume/M humeral/S humeri humerus/M Humfrey/M Humfrid/M Humfried/M humidification/MC humidifier/CM humidify/RSDCXGNZ humidistat/M humidity/MS humidor/MS humid/Y humiliate/SDXNG humiliating/Y humiliation/M humility/MS hummed Hummel/M hummer/SM humming hummingbird/SM hummock/MDSG hummocky hummus/S humongous humored/U humorist/MS humorlessness/MS humorless/PY humorousness/MS humorous/YP humor/RDMZGS humpback/SMD hump/GSMD humph/DG Humphrey/SM humphs Humpty/M hum/S humus/SM Humvee hunchback/DSM hunch/GMSD hundredfold/S hundred/SHRM hundredths hundredweight/SM Hunfredo/M hung/A Hungarian/MS Hungary/M hunger/SDMG Hung/M hungover hungrily hungriness/SM hungry/RTP hunker/DG hunky/RST hunk/ZRMS Hun/MS hunter/M Hunter/M hunt/GZJDRS hunting/M Huntington/M Huntlee/M Huntley/M Hunt/MR huntress/MS huntsman/M huntsmen Huntsville/M hurdle/JMZGRSD hurdler/M hurl/DRGZJS Hurlee/M Hurleigh/M hurler/M Hurley/M hurling/M Huron/SM hurray/SDG hurricane/MS hurriedness/M hurried/UY hurry/RSDG Hurst/M hurter/M hurtfulness/MS hurtful/PY hurting/Y hurtle/SDG hurts hurt/U Hurwitz/M Hus Husain's husbander/M husband/GSDRYM husbandman/M husbandmen husbandry/SM Husein/M hush/DSG husker/M huskily huskiness/MS husking/M husk/SGZDRM husky/RSPT hussar/MS Hussein/M Husserl/M hussy/SM hustings/M hustler/M hustle/RSDZG Huston/M Hutchins/M Hutchinson/M Hutchison/M hutch/MSDG hut/MS hutted hutting Hutton/M Hutu/M Huxley/M Huygens/M huzzah/GD huzzahs hwy Hyacintha/M Hyacinthe/M Hyacinthia/M Hyacinthie/M hyacinth/M Hyacinth/M hyacinths Hyades hyaena's Hyannis/M Hyatt/M hybridism/SM hybridization/S hybridize/GSD hybrid/MS Hyde/M Hyderabad/M Hydra/M hydra/MS hydrangea/SM hydrant/SM hydrate/CSDNGX hydrate's hydration/MC hydraulically hydraulicked hydraulicking hydraulic/S hydraulics/M hydrazine/M hydride/MS hydrocarbon/SM hydrocephali hydrocephalus/MS hydrochemistry hydrochloric hydrochloride/M hydrodynamical hydrodynamic/S hydrodynamics/M hydroelectric hydroelectrically hydroelectricity/SM hydrofluoric hydrofoil/MS hydrogenate/CDSGN hydrogenate's hydrogenation/MC hydrogenations hydrogen/MS hydrogenous hydrological/Y hydrologist/MS hydrology/SM hydrolysis/M hydrolyzed/U hydrolyze/GSD hydromagnetic hydromechanics/M hydrometer/SM hydrometry/MS hydrophilic hydrophobia/SM hydrophobic hydrophone/SM hydroplane/DSGM hydroponic/S hydroponics/M hydro/SM hydrosphere/MS hydrostatic/S hydrostatics/M hydrotherapy/SM hydrothermal/Y hydrous hydroxide/MS hydroxy hydroxylate/N hydroxyl/SM hydroxyzine/M hyena/MS hygiene/MS hygienically hygienic/S hygienics/M hygienist/MS hygrometer/SM hygroscopic hying Hy/M Hyman/M hymeneal/S Hymen/M hymen/MS Hymie/M hymnal/SM hymnbook/S hymn/GSDM Hynda/M hype/MZGDSR hyperactive/S hyperactivity/SM hyperbola/MS hyperbole/MS hyperbolic hyperbolically hyperboloidal hyperboloid/SM hypercellularity hypercritical/Y hypercube/MS hyperemia/M hyperemic hyperfine hypergamous/Y hypergamy/M hyperglycemia/MS hyperinflation Hyperion/M hypermarket/SM hypermedia/S hyperplane/SM hyperplasia/M hypersensitiveness/MS hypersensitive/P hypersensitivity/MS hypersonic hyperspace/M hypersphere/M hypertension/MS hypertensive/S hypertext/SM hyperthyroid hyperthyroidism/MS hypertrophy/MSDG hypervelocity hyperventilate/XSDGN hyperventilation/M hyphenated/U hyphenate/NGXSD hyphenation/M hyphen/DMGS hypnoses hypnosis/M hypnotherapy/SM hypnotically hypnotic/S hypnotism/MS hypnotist/SM hypnotize/SDG hypoactive hypoallergenic hypocellularity hypochondriac/SM hypochondria/MS hypocrisy/SM hypocrite/MS hypocritical/Y hypodermic/S hypo/DMSG hypoglycemia/SM hypoglycemic/S hypophyseal hypophysectomized hypotenuse/MS hypothalami hypothalamic hypothalamically hypothalamus/M hypothermia/SM hypotheses hypothesis/M hypothesizer/M hypothesize/ZGRSD hypothetic hypothetical/Y hypothyroid hypothyroidism/SM hypoxia/M hyssop/MS hysterectomy/MS hysteresis/M hysteria/SM hysterical/YU hysteric/SM Hyundai/M Hz i I IA Iaccoca/M Iago/M Iain/M Ia/M iambi iambic/S iamb/MS iambus/SM Ian/M Ianthe/M Ibadan/M Ibbie/M Ibby/M Iberia/M Iberian/MS Ibero/M ibex/MS ibid ibidem ibis/SM IBM/M Ibo/M Ibrahim/M Ibsen/M ibuprofen/S Icarus/M ICBM/S ICC iceberg/SM iceboat/MS icebound icebox/MS icebreaker/SM icecap/SM ice/GDSC Icelander/M Icelandic Iceland/MRZ Ice/M iceman/M icemen icepack icepick/S ice's Ichabod/M ichneumon/M ichthyologist/MS ichthyology/MS icicle/SM icily iciness/SM icing/MS icky/RT iconic icon/MS iconoclasm/MS iconoclastic iconoclast/MS iconography/MS icosahedra icosahedral icosahedron/M ictus/SM ICU icy/RPT I'd ID Idahoan/S Idahoes Idaho/MS Idalia/M Idalina/M Idaline/M Ida/M idealism/MS idealistic idealistically idealist/MS idealization/MS idealized/U idealize/GDRSZ idealizer/M ideal/MYS idealogical idea/SM ideate/SN ideation/M Idelle/M Idell/M idem idempotent/S identicalness/M identical/YP identifiability identifiable/U identifiably identification/M identified/U identifier/M identify/XZNSRDG identity/SM ideogram/MS ideographic ideograph/M ideographs ideological/Y ideologist/SM ideologue/S ideology/SM ides Idette/M idiocy/MS idiolect/M idiomatically idiomatic/P idiom/MS idiopathic idiosyncrasy/SM idiosyncratic idiosyncratically idiotic idiotically idiot/MS idleness/MS idle/PZTGDSR idler/M id/MY idolater/MS idolatress/S idolatrous idolatry/SM idolization/SM idolized/U idolizer/M idolize/ZGDRS idol/MS ids IDs idyllic idyllically idyll/MS IE IEEE Ieyasu/M if iffiness/S iffy/TPR Ifni/M ifs Iggie/M Iggy/M igloo/MS Ignace/M Ignacio/M Ignacius/M Ignatius/M Ignazio/M Ignaz/M igneous ignitable ignite/ASDG igniter/M ignition/MS ignobleness/M ignoble/P ignobly ignominious/Y ignominy/MS ignoramus/SM ignorance/MS ignorantness/M ignorant/SPY ignorer/M ignore/SRDGB Igor/M iguana/MS Iguassu/M ii iii Ijsselmeer/M Ike/M Ikey/M Ikhnaton/M ikon's IL Ilaire/M Ila/M Ilario/M ilea Ileana/M Ileane/M ileitides ileitis/M Ilene/M ileum/M ilia iliac Iliad/MS Ilise/M ilium/M Ilka/M ilk/MS I'll Illa/M illegality/MS illegal/YS illegibility/MS illegible illegibly illegitimacy/SM illegitimate/SDGY illiberality/SM illiberal/Y illicitness/MS illicit/YP illimitableness/M illimitable/P Illinoisan/MS Illinois/M illiquid illiteracy/MS illiterateness/M illiterate/PSY Ill/M illness/MS illogicality/SM illogicalness/M illogical/PY illogic/M ill/PS illume/DG illuminate/XSDVNG Illuminati illuminatingly illuminating/U illumination/M illumine/BGSD illusionary illusion/ES illusionist/MS illusion's illusiveness/M illusive/PY illusoriness/M illusory/P illustrated/U illustrate/VGNSDX illustration/M illustrative/Y illustrator/SM illustriousness/SM illustrious/PY illus/V illy Ilona/M Ilsa/M Ilse/M Ilysa/M Ilyse/M Ilyssa/M Ilyushin/M I'm image/DSGM Imagen/M imagery/MS imaginableness imaginable/U imaginably/U imaginariness/M imaginary/PS imagination/MS imaginativeness/M imaginative/UY imagined/U imaginer/M imagine/RSDJBG imagoes imago/M imam/MS imbalance/SDM imbecile/YMS imbecilic imbecility/MS imbiber/M imbibe/ZRSDG imbrication/SM Imbrium/M imbroglio/MS imbruing imbue/GDS Imelda/M IMF IMHO imitable/I imitate/SDVNGX imitation/M imitativeness/MS imitative/YP imitator/SM immaculateness/SM immaculate/YP immanence/S immanency/MS immanent/Y Immanuel/M immateriality/MS immaterialness/MS immaterial/PY immatureness/M immature/SPY immaturity/MS immeasurableness/M immeasurable/P immeasurably immediacy/MS immediateness/SM immediate/YP immemorial/Y immenseness/M immense/PRTY immensity/MS immerse/RSDXNG immersible immersion/M immigrant/SM immigrate/NGSDX immigration/M imminence/SM imminentness/M imminent/YP immobile immobility/MS immobilization/MS immobilize/DSRG immoderateness/M immoderate/NYP immoderation/M immodest/Y immodesty/SM immolate/SDNGX immolation/M immorality/MS immoral/Y immortality/SM immortalized/U immortalize/GDS immortal/SY immovability/SM immovableness/M immovable/PS immovably immune/S immunity/SM immunization/MS immunize/GSD immunoassay/M immunodeficiency/S immunodeficient immunologic immunological/Y immunologist/SM immunology/MS immure/GSD immutability/MS immutableness/M immutable/P immutably IMNSHO IMO Imogene/M Imogen/M Imojean/M impaction/SM impactor/SM impact/VGMRDS impaired/U impairer/M impair/LGRDS impairment/SM impala/MS impale/GLRSD impalement/SM impaler/M impalpable impalpably impanel/DGS impartation/M impart/GDS impartiality/SM impartial/Y impassableness/M impassable/P impassably impasse/SXBMVN impassibility/SM impassible impassibly impassion/DG impassioned/U impassiveness/MS impassive/YP impassivity/MS impasto/SM impatience/SM impatiens/M impatient/Y impeachable/U impeach/DRSZGLB impeacher/M impeachment/MS impeccability/SM impeccable/S impeccably impecuniousness/MS impecunious/PY impedance/MS impeded/U impeder/M impede/S imped/GRD impedimenta impediment/SM impelled impeller/MS impelling impel/S impend/DGS impenetrability/MS impenetrableness/M impenetrable/P impenetrably impenitence/MS impenitent/YS imperativeness/M imperative/PSY imperceivable imperceptibility/MS imperceptible imperceptibly imperceptive imperf imperfectability imperfection/MS imperfectness/SM imperfect/YSVP imperialism/MS imperialistic imperialistically imperialist/SM imperial/YS imperil/GSLD imperilment/SM imperiousness/MS imperious/YP imperishableness/M imperishable/SP imperishably impermanence/MS impermanent/Y impermeability/SM impermeableness/M impermeable/P impermeably impermissible impersonality/M impersonalized impersonal/Y impersonate/XGNDS impersonation/M impersonator/SM impertinence/SM impertinent/YS imperturbability/SM imperturbable imperturbably imperviousness/M impervious/PY impetigo/MS impetuosity/MS impetuousness/MS impetuous/YP impetus/MS impiety/MS impinge/LS impingement/MS imping/GD impiousness/SM impious/PY impishness/MS impish/YP implacability/SM implacableness/M implacable/P implacably implantation/SM implant/BGSDR implanter/M implausibility/MS implausible implausibly implementability implementable/U implementation/A implementations implementation's implemented/AU implementer/M implementing/A implementor/MS implement/SMRDGZB implicant/SM implicate/VGSD implication/M implicative/PY implicitness/SM implicit/YP implied/Y implode/GSD implore/GSD imploring/Y implosion/SM implosive/S imply/GNSDX impoliteness/MS impolite/YP impoliticness/M impolitic/PY imponderableness/M imponderable/PS importance/SM important/Y importation/MS importer/M importing/A import/SZGBRD importunateness/M importunate/PYGDS importuner/M importune/SRDZYG importunity/SM imposable impose/ASDG imposer/SM imposingly imposing/U imposition/SM impossibility/SM impossibleness/M impossible/PS impossibly imposter's impostor/SM impost/SGMD imposture/SM impotence/MS impotency/S impotent/SY impound/GDS impoundments impoverisher/M impoverish/LGDRS impoverishment/SM impracticableness/M impracticable/P impracticably impracticality/SM impracticalness/M impractical/PY imprecate/NGXSD imprecation/M impreciseness/MS imprecise/PYXN imprecision/M impregnability/MS impregnableness/M impregnable/P impregnably impregnate/DSXNG impregnation/M impresario/SM impress/DRSGVL impressed/U impresser/M impressibility/MS impressible impressionability/SM impressionableness/M impressionable/P impression/BMS impressionism/SM impressionistic impressionist/MS impressiveness/MS impressive/YP impressment/M imprimatur/SM imprinter/M imprinting/M imprint/SZDRGM imprison/GLDS imprisonment/MS improbability/MS improbableness/M improbable/P improbably impromptu/S improperness/M improper/PY impropitious impropriety/SM improved/U improvement/MS improver/M improve/SRDGBL improvidence/SM improvident/Y improvisational improvisation/MS improvisatory improviser/M improvise/RSDZG imprudence/SM imprudent/Y imp/SGMDRY impudence/MS impudent/Y impugner/M impugn/SRDZGB impulse/XMVGNSD impulsion/M impulsiveness/MS impulsive/YP impunity/SM impureness/M impure/RPTY impurity/MS imputation/SM impute/SDBG Imus/M IN inaction inactive inadequate/S inadvertence/MS inadvertent/Y inalienability/MS inalienably inalterableness/M inalterable/P Ina/M inamorata/MS inane/SRPYT inanimateness/S inanimate/P inanity/MS inappeasable inappropriate/P inarticulate/P in/AS inasmuch inaugural/S inaugurate/XSDNG inauguration/M inauthenticity inbound/G inbred/S inbreed/JG incalculableness/M incalculably incandescence/SM incandescent/YS incant incantation/SM incantatory incapable/S incapacitate/GNSD incapacitation/M incarcerate/XGNDS incarceration/M incarnadine/GDS incarnate/AGSDNX incarnation/AM Inca/SM incendiary/S incense/MGDS incentive/ESM incentively incept/DGVS inception/MS inceptive/Y inceptor/M incessant/Y incest/SM incestuousness/MS incestuous/PY inch/GMDS inchoate/DSG Inchon/M inchworm/MS incidence/MS incidental/YS incident/SM incinerate/XNGSD incineration/M incinerator/SM incipience/SM incipiency/M incipient/Y incise/SDVGNX incision/M incisiveness/MS incisive/YP incisor/MS incitement/MS inciter/M incite/RZL incl inclination/ESM incline/EGSD incliner/M inclining/M include/GDS inclusion/MS inclusiveness/MS inclusive/PY Inc/M incognito/S incoherency/M income/M incommode/DG incommunicado incomparable incompetent/MS incomplete/P inconceivability/MS inconceivableness/M inconceivable/P incondensable incongruousness/S inconsiderableness/M inconsiderable/P inconsistence inconsolableness/M inconsolable/P inconsolably incontestability/SM incontestably incontrovertibly inconvenience/DG inconvertibility inconvertible incorporable incorporated/UE incorporate/GASDXN incorrect/P incorrigibility/MS incorrigibleness/M incorrigible/SP incorrigibly incorruptible/S incorruptibly increase/JB increaser/M increasing/Y incredibleness/M incredible/P incremental/Y incrementation increment/DMGS incriminate/XNGSD incrimination/M incriminatory incrustation/SM inc/T incubate/XNGVDS incubation/M incubator/MS incubus/MS inculcate/SDGNX inculcation/M inculpate/SDG incumbency/MS incumbent/S incunabula incunabulum incurable/S incurious incursion/SM ind indebtedness/SM indebted/P indefatigableness/M indefatigable/P indefatigably indefeasible indefeasibly indefinableness/M indefinable/PS indefinite/S indelible indelibly indemnification/M indemnify/NXSDG indemnity/SM indentation/SM indented/U indenter/M indention/SM indent/R indenture/DG Independence/M indescribableness/M indescribable/PS indescribably indestructibleness/M indestructible/P indestructibly indeterminably indeterminacy/MS indeterminism indexation/S indexer/M index/MRDZGB India/M Indiana/M Indianan/S Indianapolis/M Indianian/S Indian/SM indicant/MS indicate/DSNGVX indication/M indicative/SY indicator/MS indices's indicter/M indictment/SM indict/SGLBDR indifference indigence/MS indigenousness/M indigenous/YP indigent/SY indigestible/S indignant/Y indignation/MS indigo/SM Indira/M indirect/PG indiscreet/P indiscriminateness/M indiscriminate/PY indispensability/MS indispensableness/M indispensable/SP indispensably indisputableness/M indisputable/P indissolubleness/M indissoluble/P indissolubly indistinguishableness/M indistinguishable/P indite/SDG indium/SM individualism/MS individualistic individualistically individualist/MS individuality/MS individualization/SM individualize/DRSGZ individualized/U individualizer/M individualizes/U individualizing/Y individual/YMS individuate/DSXGN individuation/M indivisibleness/M indivisible/SP indivisibly Ind/M Indochina/M Indochinese indoctrinate/GNXSD indoctrination/M indoctrinator/SM indolence/SM indolent/Y indomitableness/M indomitable/P indomitably Indonesia/M Indonesian/S indoor Indore/M Indra/M indubitableness/M indubitable/P indubitably inducement/MS inducer/M induce/ZGLSRD inducible inductance/MS inductee/SM induct/GV induction/SM inductiveness/M inductive/PY inductor/MS indulge/GDRS indulgence/SDGM indulgent/Y indulger/M Indus/M industrialism/MS industrialist/MS industrialization/MS industrialized/U industrialize/SDG industrial/SY industriousness/SM industrious/YP industry/SM Indy/SM inebriate/NGSDX inebriation/M inedible ineducable ineffability/MS ineffableness/M ineffable/P ineffably inelastic ineligibly ineluctable ineluctably ineptitude/SM ineptness/MS inept/YP inequivalent inerrant inertial/Y inertia/SM inertness/MS inert/SPY Ines inescapably Inesita/M Inessa/M inestimably inevitability/MS inevitableness/M inevitable/P inevitably inexact/P inexhaustibleness/M inexhaustible/P inexhaustibly inexorability/M inexorableness/M inexorable/P inexorably inexpedience/M inexplicableness/M inexplicable/P inexplicably inexplicit inexpressibility/M inexpressibleness/M inexpressible/PS inextricably Inez/M infamous infamy/SM infancy/M infanticide/MS infantile infant/MS infantryman/M infantrymen infantry/SM infarction/SM infarct/SM infatuate/XNGSD infatuation/M infauna infected/U infecter infect/ESGDA infection/EASM infectiousness/MS infectious/PY infective infer/B inference/GMSR inferential/Y inferiority/MS inferior/SMY infernal/Y inferno/MS inferred inferring infertile infestation/MS infester/M infest/GSDR infidel/SM infighting/M infill/MG infiltrate/V infiltrator/MS infinitesimal/SY infinite/V infinitival infinitive/YMS infinitude/MS infinitum infinity/SM infirmary/SM infirmity/SM infix/M inflammableness/M inflammable/P inflammation/MS inflammatory inflatable/MS inflate/NGBDRSX inflater/M inflationary inflation/ESM inflect/GVDS inflectional/Y inflection/SM inflexibleness/M inflexible/P inflexion/SM inflict/DRSGV inflicter/M infliction/SM inflow/M influenced/U influencer/M influence/SRDGM influent influential/SY influenza/MS infomercial/S Informatica/M informatics informational information/ES informativeness/S informative/UY informatory informed/U informer/M info/SM infotainment/S infra infrared/SM infrasonic infrastructural infrastructure/MS infrequence/S infringe/LR infringement/SM infringer/M infuriate/GNYSD infuriating/Y infuriation/M infuser/M infuse/RZ infusibleness/M infusible/P inf/ZT Ingaberg/M Ingaborg/M Inga/M Ingamar/M Ingar/M Ingeberg/M Ingeborg/M Ingelbert/M Ingemar/M ingeniousness/MS ingenious/YP ingénue/S ingenuity/SM ingenuous/EY ingenuousness/MS Inger/M Inge/RM Ingersoll/M ingest/DGVS ingestible ingestion/SM Inglebert/M inglenook/MS Inglewood/M Inglis/M Ingmar/M ingoing ingot/SMDG ingrained/Y Ingra/M Ingram/M ingrate/M ingratiate/DSGNX ingratiating/Y ingratiation/M ingredient/SM Ingres/M ingression/M ingress/MS Ingrid/M Ingrim/M ingrown/P inguinal Ingunna/M inhabitable/U inhabitance inhabited/U inhabiter/M inhabit/R inhalant/S inhalation/SM inhalator/SM inhale/Z inhere/DG inherent/Y inheritableness/M inheritable/P inheritance/EMS inherit/BDSG inherited/E inheriting/E inheritor/S inheritress/MS inheritrix/MS inherits/E inhibit/DVGS inhibited/U inhibiter's inhibition/MS inhibitor/MS inhibitory inhomogeneous inhospitableness/M inhospitable/P inhospitality Inigo/M inimical/Y inimitableness/M inimitable/P inimitably inion iniquitousness/M iniquitous/PY iniquity/MS initialer/M initial/GSPRDY initialization/A initializations initialization's initialize/ASDG initialized/U initializer/S initiates initiate/UD initiating initiation/SM initiative/SM initiator/MS initiatory injectable/U inject/GVSDB injection/MS injector/SM injunctive injured/U injurer/M injure/SRDZG injuriousness/M injurious/YP inkblot/SM inker/M inkiness/MS inkling/SM inkstand/SM inkwell/SM inky/TP ink/ZDRJ inland inlander/M inlay/RG inletting inly/G inmost Inna/M innards innateness/SM innate/YP innermost/S innersole/S innerspring innervate/GNSDX innervation/M inner/Y inning/M Innis/M innkeeper/MS innocence/SM Innocent/M innocent/SYRT innocuousness/MS innocuous/PY innovate/SDVNGX innovation/M innovative/P innovator/MS innovatory Innsbruck/M innuendo/MDGS innumerability/M innumerableness/M innumerable/P innumerably innumerate inn/ZGDRSJ inoculate/ASDG inoculation/MS inoculative inoffensive/P Inonu/M inopportuneness/M inopportune/P inordinateness/M inordinate/PY inorganic inpatient In/PM input/MRDG inquirer/M inquire/ZR inquiring/Y inquiry/MS inquisitional inquisition/MS Inquisition/MS inquisitiveness/MS inquisitive/YP inquisitorial/Y inquisitor/MS INRI inrush/M ins INS insalubrious insanitary insatiability/MS insatiableness/M insatiable/P insatiably inscribe/Z inscription/SM inscrutability/SM inscrutableness/SM inscrutable/P inscrutably inseam insecticidal insecticide/MS insectivore/SM insectivorous insecureness/M insecure/P inseminate/NGXSD insemination/M insensateness/M insensate/P insensible/P insentient inseparable/S insert/ADSG inserter/M insertion/AMS insetting inshore insider/M inside/Z insidiousness/MS insidious/YP insightful/Y insigne's insignia/SM insignificant insinuate/VNGXSD insinuating/Y insinuation/M insinuator/SM insipidity/MS insipid/Y insistence/SM insistent/Y insisting/Y insist/SGD insociable insofar insole/M insolence/SM insolent/YS insolubleness/M insoluble/P insolubly insomniac/S insomnia/MS insomuch insouciance/SM insouciant/Y inspect/AGSD inspection/SM inspective inspectorate/MS inspector/SM inspirational/Y inspiration/MS inspired/U inspire/R inspirer/M inspiring/U inspirit/DG Inst installable install/ADRSG installation/SM installer/MS installment/MS instance/GD instantaneousness/M instantaneous/PY instantiated/U instantiate/SDXNG instantiation/M instant/SRYMP instate/AGSD inst/B instead instigate/XSDVGN instigation/M instigator/SM instillation/SM instinctive/Y instinctual instinct/VMS instituter/M institutes/M institute/ZXVGNSRD institutionalism/M institutionalist/M institutionalization/SM institutionalize/GDS institutional/Y institution/AM institutor's instr instruct/DSVG instructed/U instructional instruction/MS instructiveness/M instructive/PY instructor/MS instrumentalist/MS instrumentality/SM instrumental/SY instrumentation/SM instrument/GMDS insubordinate insubstantial insufferable insufferably insularity/MS insular/YS insulate/DSXNG insulated/U insulation/M insulator/MS insulin/MS insult/DRSG insulter/M insulting/Y insuperable insuperably insupportableness/M insupportable/P insurance/MS insurance's/A insure/BZGS insured/S insurer/M insurgence/SM insurgency/MS insurgent/MS insurmountably insurrectionist/SM insurrection/SM intactness/M intact/P intaglio/GMDS intake/M intangible/M integer/MS integrability/M integrable integral/SYM integrand/MS integrate/AGNXEDS integration/EMA integrative/E integrator/MS integrity/SM integument/SM intellective/Y intellect/MVS intellectualism/MS intellectuality/M intellectualize/GSD intellectualness/M intellectual/YPS intelligence/MSR intelligencer/M intelligentsia/MS intelligent/UY intelligibilities intelligibility/UM intelligibleness/MU intelligible/PU intelligibly/U Intel/M Intelsat/M intemperate/P intendant/MS intendedness/M intended/SYP intender/M intensification/M intensifier/M intensify/GXNZRSD intensional/Y intensiveness/MS intensive/PSY intentionality/M intentional/UY intention/SDM intentness/SM intent/YP interaction/MS interactive/PY interactivity interact/VGDS interaxial interbank interbred interbreed/GS intercalate/GNVDS intercalation/M intercase intercaste interceder/M intercede/SRDG intercensal intercept/DGS interception/MS interceptor/MS intercession/MS intercessor/SM intercessory interchangeability/M interchangeableness/M interchangeable/P interchangeably interchange/DSRGJ interchanger/M intercity interclass intercohort intercollegiate intercommunicate/SDXNG intercommunication/M intercom/SM interconnectedness/M interconnected/P interconnect/GDS interconnection/SM interconnectivity intercontinental interconversion/M intercorrelated intercourse/SM Interdata/M interdenominational interdepartmental/Y interdependence/MS interdependency/SM interdependent/Y interdiction/MS interdict/MDVGS interdisciplinary interested/UYE interest/GEMDS interestingly/U interestingness/M interesting/YP inter/ESTL interface/SRDGM interfacing/M interfaith interference/MS interferer/M interfere/SRDG interfering/Y interferometer/SM interferometric interferometry/M interferon/MS interfile/GSD intergalactic intergenerational intergeneration/M interglacial intergovernmental intergroup interim/S interindex interindustry interior/SMY interj interject/GDS interjectional interjection/MS interlace/GSD interlard/SGD interlayer/G interleave/SDG interleukin/S interlibrary interlinear/S interline/JGSD interlingual interlingua/M interlining/M interlink/GDS interlisp/M interlobular interlocker/M interlock/RDSG interlocutor/MS interlocutory interlope/GZSRD interloper/M interlude/MSDG intermarriage/MS intermarry/GDS intermediary/MS intermediateness/M intermediate/YMNGSDP intermediation/M interment/SME intermeshed intermetrics intermezzi intermezzo/SM interminably intermingle/DSG intermission/MS intermittent/Y intermix/GSRD intermodule intermolecular/Y internalization/SM internalize/GDS internal/SY Internationale/M internationalism/SM internationalist/SM internationality/M internationalization/MS internationalize/DSG international/YS internecine internee/SM interne's Internet/M INTERNET/M internetwork internist/SM intern/L internment/SM internship/MS internuclear interocular interoffice interoperability interpenetrates interpersonal/Y interplanetary interplay/GSMD interpol interpolate/XGNVBDS interpolation/M Interpol/M interpose/GSRD interposer/M interposition/MS interpretable/U interpret/AGSD interpretation/MSA interpretative/Y interpreted/U interpreter/SM interpretive/Y interpretor/S interprocess interprocessor interquartile interracial interred/E interregional interregnum/MS interrelatedness/M interrelated/PY interrelate/GNDSX interrelation/M interrelationship/SM interring/E interrogate/DSXGNV interrogation/M interrogative/SY interrogator/SM interrogatory/S interrupted/U interrupter/M interruptibility interruptible interruption/MS interrupt/VGZRDS interscholastic intersect/GDS intersection/MS intersession/MS interspecies intersperse/GNDSX interspersion/M interstage interstate/S interstellar interstice/SM interstitial/SY intersurvey intertask intertwine/GSD interurban/S interval/MS intervene/GSRD intervener/M intervenor/M interventionism/MS interventionist/S intervention/MS interview/AMD interviewed/U interviewee/SM interviewer/SM interviewing interviews intervocalic interweave/GS interwove interwoven intestacy/SM intestinal/Y intestine/SM inti intifada intimacy/SM intimal intimateness/M intimater/M intimate/XYNGPDRS intimation/M intimidate/SDXNG intimidating/Y intimidation/M into intolerableness/M intolerable/P intolerant/PS intonate/NX intonation/M intoxicant/MS intoxicate/DSGNX intoxicated/Y intoxication/M intra intracellular intracity intraclass intracohort intractability/M intractableness/M intractable/P intradepartmental intrafamily intragenerational intraindustry intraline intrametropolitan intramural/Y intramuscular/Y intranasal intransigence/MS intransigent/YS intransitive/S intraoffice intraprocess intrapulmonary intraregional intrasectoral intrastate intratissue intrauterine intravenous/YS intrepidity/SM intrepidness/M intrepid/YP intricacy/SM intricateness/M intricate/PY intrigue/DRSZG intriguer/M intriguing/Y intrinsically intrinsic/S introduce/ADSG introducer/M introduction/ASM introductory introit/SM introject/SD intro/S introspection/MS introspectiveness/M introspective/YP introspect/SGVD introversion/SM introvert/SMDG intruder/M intrude/ZGDSR intrusion/SM intrusiveness/MS intrusive/SYP intubate/NGDS intubation/M intuit/GVDSB intuitionist/M intuitiveness/MS intuitive/YP int/ZR Inuit/MS inundate/SXNG inundation/M inure/GDS invader/M invade/ZSRDG invalid/GSDM invalidism/MS invariable/P invariant/M invasion/SM invasive/P invectiveness/M invective/PSMY inveigh/DRG inveigher/M inveighs inveigle/DRSZG inveigler/M invent/ADGS invented/U invention/ASM inventiveness/MS inventive/YP inventor/MS inventory/SDMG Inverness/M inverse/YV inverter/M invertible invert/ZSGDR invest/ADSLG investigate/XDSNGV investigation/MA investigator/MS investigatory investiture/SM investment/ESA investment's/A investor/SM inveteracy/MS inveterate/Y inviability invidiousness/MS invidious/YP invigilate/GD invigilator/SM invigorate/ANGSD invigorating/Y invigoration/AM invigorations invincibility/SM invincibleness/M invincible/P invincibly inviolability/MS inviolably inviolateness/M inviolate/YP inviscid invisibleness/M invisible/S invitational/S invitation/MS invited/U invitee/S inviter/M invite/SRDG inviting/Y invocable invocate invoked/A invoke/GSRDBZ invoker/M invokes/A involuntariness/S involuntary/P involute/XYN involution/M involutorial involvedly involved/U involve/GDSRL involvement/SM involver/M invulnerability/M invulnerableness/M inwardness/M inward/PY ioctl iodate/MGND iodation/M iodide/MS iodinate/DNG iodine/MS iodize/GSD Iolande/M Iolanthe/M Io/M Iona/M Ionesco/M Ionian/M ionic/S Ionic/S ionization's ionization/SU ionized/UC ionize/GNSRDJXZ ionizer's ionizer/US ionizes/U ionizing/U ionosphere/SM ionospheric ion's/I ion/SMU Iorgo/MS Iormina/M Iosep/M iota/SM IOU Iowan/S Iowa/SM IPA ipecac/MS Iphigenia/M ipso Ipswich/M IQ Iqbal/M Iquitos/M Ira/M Iranian/MS Iran/M Iraqi/SM Iraq/M IRA/S irascibility/SM irascible irascibly irateness/S irate/RPYT ireful Ireland/M ire/MGDS Irena/M Irene/M irenic/S iridescence/SM iridescent/Y irides/M iridium/MS irids Irina/M Iris iris/GDSM Irishman/M Irishmen Irish/R Irishwoman/M Irishwomen Irita/M irk/GDS irksomeness/SM irksome/YP Irkutsk/M Ir/M Irma/M ironclad/S iron/DRMPSGJ ironer/M ironic ironicalness/M ironical/YP ironing/M ironmonger/M ironmongery/M ironside/MS ironstone/MS ironware/SM ironwood/SM ironworker/M ironwork/MRS irony/SM Iroquoian/MS Iroquois/M irradiate/XSDVNG irradiation/M irrationality/MS irrationalness/M irrational/YSP Irrawaddy/M irreclaimable irreconcilability/MS irreconcilableness/M irreconcilable/PS irreconcilably irrecoverableness/M irrecoverable/P irrecoverably irredeemable/S irredeemably irredentism/M irredentist/M irreducibility/M irreducible irreducibly irreflexive irrefutable irrefutably irregardless irregularity/SM irregular/YS irrelevance/SM irrelevancy/MS irrelevant/Y irreligious irremediableness/M irremediable/P irremediably irremovable irreparableness/M irreparable/P irreparably irreplaceable/P irrepressible irrepressibly irreproachableness/M irreproachable/P irreproachably irreproducibility irreproducible irresistibility/M irresistibleness/M irresistible/P irresistibly irresoluteness/SM irresolute/PNXY irresolution/M irresolvable irrespective/Y irresponsibility/SM irresponsibleness/M irresponsible/PS irresponsibly irretrievable irretrievably irreverence/MS irreverent/Y irreversible irreversibly irrevocableness/M irrevocable/P irrevocably irrigable irrigate/DSXNG irrigation/M irritability/MS irritableness/M irritable/P irritably irritant/S irritate/DSXNGV irritated/Y irritating/Y irritation/M irrupt/GVSD irruption/SM IRS Irtish/M Irvine/M Irving/M Irvin/M Irv/MG Irwin/M Irwinn/M is i's Isaac/SM Isaak/M Isabelita/M Isabella/M Isabelle/M Isabel/M Isacco/M Isac/M Isadora/M Isadore/M Isador/M Isahella/M Isaiah/M Isak/M Isa/M ISBN Iscariot/M Iseabal/M Isfahan/M Isherwood/M Ishim/M Ishmael/M Ishtar/M Isiahi/M Isiah/M Isidora/M Isidore/M Isidor/M Isidoro/M Isidro/M isinglass/MS Isis/M Islamabad/M Islamic/S Islam/SM islander/M island/GZMRDS Islandia/M isle/MS islet/SM isl/GD Ismael/M ism/MCS isn't ISO isobaric isobar/MS Isobel/M isochronal/Y isochronous/Y isocline/M isocyanate/M isodine isolate/SDXNG isolationism/SM isolationistic isolationist/SM isolation/M isolator/MS Isolde/M isomeric isomerism/SM isomer/SM isometrically isometric/S isometrics/M isomorphic isomorphically isomorphism/MS isomorph/M isoperimetrical isopleth/M isopleths isosceles isostatic isothermal/Y isotherm/MS isotonic isotope/SM isotopic isotropic isotropically isotropy/M Ispahan's ispell/M Ispell/M Israeli/MS Israelite/SM Israel/MS Issac/M Issiah/M Issie/M Issi/M issuable issuance/MS issuant issued/A issue/GMZDSR issuer/AMS issues/A issuing/A Issy/M Istanbul/M isthmian/S isthmus/SM Istvan/M Isuzu/M It IT Itaipu/M ital Italianate/GSD Italian/MS italicization/MS italicized/U italicize/GSD italic/S Ital/M Italy/M Itasca/M itch/GMDS itchiness/MS Itch/M itchy/RTP ITcorp/M ITCorp/M it'd Itel/M itemization/SM itemized/U itemize/GZDRS itemizer/M itemizes/A item/MDSG iterate/ASDXVGN iteration/M iterative/YA iterator/MS Ithaca/M Ithacan itinerant/SY itinerary/MS it'll it/MUS Ito/M its itself ITT IUD/S IV Iva/M Ivanhoe/M Ivan/M Ivar/M I've Ive/MRS Iver/M Ivette/M Ivett/M Ivie/M iv/M Ivonne/M Ivor/M Ivory/M ivory/SM IVs Ivy/M ivy/MDS ix Izaak/M Izabel/M Izak/M Izanagi/M Izanami/M Izhevsk/M Izmir/M Izvestia/M Izzy/M jabbed jabberer/M jabber/JRDSZG jabbing Jabez/M Jablonsky/M jabot/MS jab/SM jacaranda/MS Jacenta/M Jacinda/M Jacinta/M Jacintha/M Jacinthe/M jackal/SM jackass/SM jackboot/DMS jackdaw/SM Jackelyn/M jacketed/U jacket/GSMD jack/GDRMS jackhammer/MDGS Jackie/M Jacki/M jackknife/MGSD jackknives Jacklin/M Jacklyn/M Jack/M Jackman/M jackpot/MS Jackqueline/M Jackquelin/M jackrabbit/DGS Jacksonian Jackson/SM Jacksonville/M jackstraw/MS Jacky/M Jaclin/M Jaclyn/M Jacobean Jacobian/M Jacobi/M Jacobin/M Jacobite/M Jacobo/M Jacobsen/M Jacob/SM Jacobs/N Jacobson/M Jacobus Jacoby/M jacquard/MS Jacquard/SM Jacqueline/M Jacquelin/M Jacquelyn/M Jacquelynn/M Jacquenetta/M Jacquenette/M Jacques/M Jacquetta/M Jacquette/M Jacquie/M Jacqui/M jacuzzi Jacuzzi/S Jacynth/M Jada/M jadedness/SM jaded/PY jadeite/SM Jade/M jade/MGDS Jaeger/M Jae/M jaggedness/SM jagged/RYTP Jagger/M jaggers jagging jag/S jaguar/MS jailbird/MS jailbreak/SM jailer/M jail/GZSMDR Jaime/M Jaimie/M Jaine/M Jainism/M Jain/M Jaipur/M Jakarta/M Jake/MS Jakie/M Jakob/M jalapeño/S jalopy/SM jalousie/MS Jamaal/M Jamaica/M Jamaican/S Jamal/M Jamar/M jambalaya/MS jamb/DMGS jamboree/MS Jamel/M Jame/MS Jameson/M Jamestown/M Jamesy/M Jamey/M Jamie/M Jamill/M Jamil/M Jami/M Jamima/M Jamison/M Jammal/M jammed/U Jammie/M jamming/U jam/SM Janacek/M Jana/M Janaya/M Janaye/M Jandy/M Janean/M Janeczka/M Janeen/M Janeiro/M Janek/M Janela/M Janella/M Janelle/M Janell/M Janel/M Jane/M Janene/M Janenna/M Janessa/M Janesville/M Janeta/M Janet/M Janetta/M Janette/M Janeva/M Janey/M jangler/M jangle/RSDGZ jangly Jania/M Janice/M Janie/M Janifer/M Janina/M Janine/M Janis/M janissary/MS Janith/M janitorial janitor/SM Janka/M Jan/M Janna/M Jannelle/M Jannel/M Jannie/M Janos/M Janot/M Jansenist/M Jansen/M January/MS Janus/M Jany/M Japanese/SM Japan/M japanned japanner japanning japan/SM jape/DSMG Japura/M Jaquelin/M Jaquelyn/M Jaquenetta/M Jaquenette/M Jaquith/M Jarad/M jardinière/MS Jard/M Jareb/M Jared/M jarful/S jargon/SGDM Jarib/M Jarid/M Jarlsberg jar/MS Jarrad/M jarred Jarred/M Jarret/M Jarrett/M Jarrid/M jarring/SY Jarrod/M Jarvis/M Jase/M Jasen/M Jasmina/M Jasmine/M jasmine/MS Jasmin/M Jason/M Jasper/M jasper/MS Jastrow/M Jasun/M jato/SM jaundice/DSMG jaundiced/U jauntily jauntiness/MS jaunt/MDGS jaunty/SRTP Javanese Java/SM javelin/SDMG Javier/M jawbone/SDMG jawbreaker/SM jawline jaw/SMDG Jaxartes/M Jayapura/M jaybird/SM Jaycee/SM Jaye/M Jay/M Jaymee/M Jayme/M Jaymie/M Jaynell/M Jayne/M jay/SM Jayson/M jaywalker/M jaywalk/JSRDZG Jazmin/M jazziness/M jazzmen jazz/MGDS jazzy/PTR JCS jct JD Jdavie/M jealousness/M jealous/PY jealousy/MS Jeana/M Jeanelle/M Jeane/M Jeanette/M Jeanie/M Jeanine/M Jean/M jean/MS Jeanna/M Jeanne/M Jeannette/M Jeannie/M Jeannine/M Jecho/M Jedd/M Jeddy/M Jedediah/M Jedidiah/M Jedi/M Jed/M jeep/GZSMD Jeep/S jeerer/M jeering/Y jeer/SJDRMG Jeeves/M jeez Jefferey/M Jeffersonian/S Jefferson/M Jeffery/M Jeffie/M Jeff/M Jeffrey/SM Jeffry/M Jeffy/M jehad's Jehanna/M Jehoshaphat/M Jehovah/M Jehu/M jejuna jejuneness/M jejune/PY jejunum/M Jekyll/M Jelene/M jell/GSD Jello/M jello's jellybean/SM jellyfish/MS jellying/M jellylike jellyroll/S jelly/SDMG Jemie/M Jemimah/M Jemima/M Jemmie/M jemmy/M Jemmy/M Jena/M Jenda/M Jenelle/M Jenica/M Jeniece/M Jenifer/M Jeniffer/M Jenilee/M Jeni/M Jenine/M Jenkins/M Jen/M Jenna/M Jennee/M Jenner/M jennet/SM Jennette/M Jennica/M Jennie/M Jennifer/M Jennilee/M Jenni/M Jennine/M Jennings/M Jenn/RMJ Jenny/M jenny/SM Jeno/M Jensen/M Jens/N jeopard jeopardize/GSD jeopardy/MS Jephthah/M Jerad/M Jerald/M Jeralee/M Jeramey/M Jeramie/M Jere/M Jereme/M jeremiad/SM Jeremiah/M Jeremiahs Jeremias/M Jeremie/M Jeremy/M Jericho/M Jeri/M jerker/M jerk/GSDRJ jerkily jerkiness/SM jerkin/SM jerkwater/S jerky/RSTP Jermaine/M Jermain/M Jermayne/M Jeroboam/M Jerold/M Jerome/M Jeromy/M Jerrie/M Jerrilee/M Jerrilyn/M Jerri/M Jerrine/M Jerrod/M Jerrold/M Jerrome/M jerrybuilt Jerrylee/M jerry/M Jerry/M jersey/MS Jersey/MS Jerusalem/M Jervis/M Jes Jessalin/M Jessalyn/M Jessa/M Jessamine/M jessamine's Jessamyn/M Jessee/M Jesselyn/M Jesse/M Jessey/M Jessica/M Jessie/M Jessika/M Jessi/M jess/M Jess/M Jessy/M jest/DRSGZM jester/M jesting/Y Jesuit/SM Jesus Jeth/M Jethro/M jetliner/MS jet/MS jetport/SM jetsam/MS jetted/M jetting/M jettison/DSG jetty/RSDGMT jeweler/M jewelery/S jewel/GZMRDS Jewelled/M Jewelle/M jewellery's Jewell/MD Jewel/M jewelry/MS Jewess/SM Jewishness/MS Jewish/P Jew/MS Jewry/MS Jezebel/MS j/F JFK/M jg/M jibbed jibbing jibe/S jib/MDSG Jidda/M jiff/S jiffy/SM jigged jigger/SDMG jigging/M jiggle/SDG jiggly/TR jig/MS jigsaw/GSDM jihad/SM Jilin Jillana/M Jillane/M Jillayne/M Jilleen/M Jillene/M Jillian/M Jillie/M Jilli/M Jill/M Jilly/M jilt/DRGS jilter/M Jimenez/M Jim/M Jimmie/M jimmy/GSDM Jimmy/M jimsonweed/S Jinan jingler/M jingle/RSDG jingly/TR jingoism/SM jingoistic jingoist/SM jingo/M Jinnah/M jinni's jinn/MS Jinny/M jinrikisha/SM jinx/GMDS jitney/MS jitterbugged jitterbugger jitterbugging jitterbug/SM jitter/S jittery/TR jiujitsu's Jivaro/M jive/MGDS Joachim/M Joana/M Joane/M Joanie/M Joan/M Joanna/M Joanne/SM Joann/M Joaquin/M jobbed jobber/MS jobbery/M jobbing/M Jobey/M jobholder/SM Jobie/M Jobi/M Jobina/M joblessness/MS jobless/P Jobrel/M job/SM Job/SM Jobye/M Joby/M Jobyna/M Jocasta/M Joceline/M Jocelin/M Jocelyne/M Jocelyn/M jockey/SGMD jock/GDMS Jock/M Jocko/M jockstrap/MS jocoseness/MS jocose/YP jocosity/SM jocularity/SM jocular/Y jocundity/SM jocund/Y Jodee/M jodhpurs Jodie/M Jodi/M Jody/M Joeann/M Joela/M Joelie/M Joella/M Joelle/M Joellen/M Joell/MN Joelly/M Joellyn/M Joel/MY Joelynn/M Joe/M Joesph/M Joete/M joey/M Joey/M jogged jogger/SM jogging/S joggler/M joggle/SRDG Jogjakarta/M jog/S Johan/M Johannah/M Johanna/M Johannes Johannesburg/M Johann/M Johansen/M Johanson/M Johna/MH Johnathan/M Johnath/M Johnathon/M Johnette/M Johnie/M Johnna/M Johnnie/M johnnycake/SM Johnny/M johnny/SM Johnsen/M john/SM John/SM Johns/N Johnson/M Johnston/M Johnstown/M Johny/M Joice/M join/ADGFS joined/U joiner/FSM joinery/MS jointed/EYP jointedness/ME joint/EGDYPS jointer/M jointly/F joint's jointures joist/GMDS Jojo/M joke/MZDSRG joker/M jokey jokier jokiest jokily joking/Y Jolee/M Joleen/M Jolene/M Joletta/M Jolie/M Joliet's Joli/M Joline/M Jolla/M jollification/MS jollily jolliness/SM jollity/MS jolly/TSRDGP Jolson/M jolt/DRGZS jolter/M Joly/M Jolyn/M Jolynn/M Jo/MY Jonah/M Jonahs Jonas Jonathan/M Jonathon/M Jonell/M Jone/MS Jones/S Jonie/M Joni/MS Jon/M jonquil/MS Jonson/M Joplin/M Jordain/M Jordana/M Jordanian/S Jordan/M Jordanna/M Jordon/M Jorey/M Jorgan/M Jorge/M Jorgensen/M Jorgenson/M Jorie/M Jori/M Jorrie/M Jorry/M Jory/M Joscelin/M Josee/M Josefa/M Josefina/M Josef/M Joseito/M Jose/M Josepha/M Josephina/M Josephine/M Joseph/M Josephs Josephson/M Josephus/M Josey/M josh/DSRGZ josher/M Joshia/M Josh/M Joshuah/M Joshua/M Josiah/M Josias/M Josie/M Josi/M Josselyn/M joss/M jostle/SDG Josue/M Josy/M jot/S jotted jotter/SM jotting/SM Joule/M joule/SM jounce/SDG jouncy/RT Jourdain/M Jourdan/M journalese/MS journal/GSDM journalism/SM journalistic journalist/SM journalize/DRSGZ journalized/U journalizer/M journey/DRMZSGJ journeyer/M journeyman/M journeymen jouster/M joust/ZSMRDG Jovanovich/M Jove/M joviality/SM jovial/Y Jovian jowl/SMD jowly/TR Joya/M Joyan/M Joyann/M Joycean Joycelin/M Joyce/M Joye/M joyfuller joyfullest joyfulness/SM joyful/PY joylessness/MS joyless/PY Joy/M joy/MDSG Joyner/M joyousness/MS joyous/YP joyridden joyride/SRZMGJ joyrode joystick/S Jozef/M JP Jpn Jr/M j's J's Jsandye/M Juana/M Juanita/M Juan/M Juarez Jubal/M jubilant/Y jubilate/XNGDS jubilation/M jubilee/SM Judah/M Judaic Judaical Judaism/SM Judas/S juddered juddering Judd/M Judea/M Jude/M judge/AGDS judger/M judge's judgeship/SM judgmental/Y judgment/MS judicable judicatory/S judicature/MS judicial/Y judiciary/S judicious/IYP judiciousness/SMI Judie/M Judi/MH Juditha/M Judith/M Jud/M judo/MS Judon/M Judson/M Judye/M Judy/M jugate/F jugful/SM jugged Juggernaut/M juggernaut/SM jugging juggler/M juggle/RSDGZ jugglery/MS jug/MS jugular/S juice/GMZDSR juicer/M juicily juiciness/MS juicy/TRP Juieta/M jujitsu/MS jujube/SM juju/M jujutsu's jukebox/SM juke/GS Julee/M Jule/MS julep/SM Julia/M Juliana/M Juliane/M Julian/M Julianna/M Julianne/M Juliann/M Julie/M julienne/GSD Julienne/M Julieta/M Juliet/M Julietta/M Juliette/M Juli/M Julina/M Juline/M Julio/M Julissa/M Julita/M Julius/M Jul/M Julys July/SM jumble/GSD jumbo/MS jumper/M jump/GZDRS jumpily jumpiness/MS jumpsuit/S jumpy/PTR jun junco/MS junction/IMESF juncture/SFM Juneau/M June/MS Junette/M Jungfrau/M Jungian jungle/SDM Jung/M Junia/M Junie/M Junina/M juniority/M junior/MS Junior/S juniper/SM junkerdom Junker/SM junketeer/SGDM junket/SMDG junk/GZDRMS junkie/RSMT junkyard/MS Jun/M Juno/M junta/MS Jupiter/M Jurassic juridic juridical/Y juried jurisdictional/Y jurisdiction/SM jurisprudence/SM jurisprudent jurisprudential/Y juristic jurist/MS juror/MS Jurua/M jury/IMS jurying juryman/M jurymen jurywoman/M jurywomen justed Justen/M juster/M justest Justice/M justice/MIS justiciable justifiability/M justifiable/U justifiably/U justification/M justified/UA justifier/M justify/GDRSXZN Justina/M Justine/M justing Justinian/M Justin/M Justinn/M Justino/M Justis/M justness/MS justness's/U justs just/UPY Justus/M jute/SM Jutish Jutland/M jut/S jutted jutting Juvenal/M juvenile/SM juxtapose/SDG juxtaposition/SM JV J/X Jyoti/M Kaaba/M kabob/SM kaboom Kabuki kabuki/SM Kabul/M Kacey/M Kacie/M Kacy/M Kaddish/M kaddish/S Kaela/M kaffeeklatch kaffeeklatsch/S Kafkaesque Kafka/M kaftan's Kagoshima/M Kahaleel/M Kahlil/M Kahlua/M Kahn/M Kaia/M Kaifeng/M Kaila/M Kaile/M Kailey/M Kai/M Kaine/M Kain/M kaiser/MS Kaiser/SM Kaitlin/M Kaitlyn/M Kaitlynn/M Kaja/M Kajar/M Kakalina/M Kalahari/M Kala/M Kalamazoo/M Kalashnikov/M Kalb/M Kaleb/M Kaleena/M kaleidescope kaleidoscope/SM kaleidoscopic kaleidoscopically Kale/M kale/MS Kalgoorlie/M Kalie/M Kalila/M Kalil/M Kali/M Kalina/M Kalinda/M Kalindi/M Kalle/M Kalli/M Kally/M Kalmyk Kalvin/M Kama/M Kamchatka/M Kamehameha/M Kameko/M Kamikaze/MS kamikaze/SM Kamilah/M Kamila/M Kamillah/M Kampala/M Kampuchea/M Kanchenjunga/M Kandace/M Kandahar/M Kandinsky/M Kandy/M Kane/M kangaroo/SGMD Kania/M Kankakee/M Kan/MS Kannada/M Kano/M Kanpur/M Kansan/S Kansas Kantian Kant/M Kanya/M Kaohsiung/M kaolinite/M kaolin/MS Kaplan/M kapok/SM Kaposi/M kappa/MS kaput/M Karachi/M Karaganda/M Karakorum/M karakul/MS Karalee/M Karalynn/M Kara/M Karamazov/M karaoke/S karate/MS karat/SM Karee/M Kareem/M Karel/M Kare/M Karena/M Karenina/M Karen/M Karia/M Karie/M Karil/M Karilynn/M Kari/M Karim/M Karina/M Karine/M Karin/M Kariotta/M Karisa/M Karissa/M Karita/M Karla/M Karlan/M Karlee/M Karleen/M Karlene/M Karlen/M Karlie/M Karlik/M Karlis Karl/MNX Karloff/M Karlotta/M Karlotte/M Karly/M Karlyn/M karma/SM Karmen/M karmic Karna/M Karney/M Karola/M Karole/M Karolina/M Karoline/M Karol/M Karoly/M Karon/M Karo/YM Karp/M Karrah/M Karrie/M Karroo/M Karry/M kart/MS Karylin/M Karyl/M Kary/M Karyn/M Kasai/M Kasey/M Kashmir/SM Kaspar/M Kasparov/M Kasper/M Kass Kassandra/M Kassey/M Kassia/M Kassie/M Kassi/M katakana Katalin/M Kata/M Katee/M Katelyn/M Kate/M Katerina/M Katerine/M Katey/M Katha/M Katharina/M Katharine/M Katharyn/M Kathe/M Katherina/M Katherine/M Katheryn/M Kathiawar/M Kathie/M Kathi/M Kathleen/M Kathlin/M Kath/M Kathmandu Kathrine/M Kathryne/M Kathryn/M Kathye/M Kathy/M Katie/M Kati/M Katina/M Katine/M Katinka/M Katleen/M Katlin/M Kat/M Katmai/M Katmandu's Katowice/M Katrina/M Katrine/M Katrinka/M Kattie/M Katti/M Katuscha/M Katusha/M Katya/M katydid/SM Katy/M Katz/M Kauai/M Kauffman/M Kaufman/M Kaunas/M Kaunda/M Kawabata/M Kawasaki/M kayak/SGDM Kaycee/M Kaye/M Kayla/M Kaylee/M Kayle/M Kayley/M Kaylil/M Kaylyn/M Kay/M Kayne/M kayo/DMSG Kazakh/M Kazakhstan Kazan/M Kazantzakis/M kazoo/SM Kb KB KC kcal/M kc/M KDE/M Keane/M Kean/M Kearney/M Keary/M Keaton/M Keats/M kebab/SM Keck/M Keefe/MR Keefer/M Keegan/M Keelby/M Keeley/M keel/GSMDR keelhaul/SGD Keelia/M Keely/M Keenan/M Keene/M keener/M keen/GTSPYDR keening/M Keen/M keenness/MS keeper/M keep/GZJSR keeping/M keepsake/SM Keewatin/M kegged kegging keg/MS Keillor/M Keir/M Keisha/M Keith/M Kelbee/M Kelby/M Kelcey/M Kelcie/M Kelci/M Kelcy/M Kele/M Kelila/M Kellby/M Kellen/M Keller/M Kelley/M Kellia/M Kellie/M Kelli/M Kellina/M Kellogg/M Kellsie/M Kellyann/M Kelly/M kelp/GZMDS Kelsey/M Kelsi/M Kelsy/M Kelt's Kelvin/M kelvin/MS Kelwin/M Kemerovo/M Kempis/M Kemp/M Kendall/M Kendal/M Kendell/M Kendra/M Kendre/M Kendrick/MS Kenilworth/M Ken/M Kenmore/M ken/MS Kenna/M Kennan/M Kennecott/M kenned Kennedy/M kennel/GSMD Kenneth/M Kennett/M Kennie/M kenning Kennith/M Kenn/M Kenny/M keno/M Kenon/M Kenosha/M Kensington/M Kent/M Kenton/M Kentuckian/S Kentucky/M Kenya/M Kenyan/S Kenyatta/M Kenyon/M Keogh/M Keokuk/M kepi/SM Kepler/M kept keratin/MS kerbside Kerby/M kerchief/MDSG Kerensky/M Kerianne/M Keriann/M Keri/M Kerk/M Ker/M Kermie/M Kermit/M Kermy/M kerned kernel/GSMD kerning Kern/M kerosene/MS Kerouac/M Kerrie/M Kerrill/M Kerri/M Kerrin/M Kerr/M Kerry/M Kerstin/M Kerwin/M Kerwinn/M Kesley/M Keslie/M Kessiah/M Kessia/M Kessler/M kestrel/SM ketch/MS ketchup/SM ketone/M ketosis/M Kettering/M Kettie/M Ketti/M kettledrum/SM kettleful kettle/SM Ketty/M Kevan/M Keven/M Kevina/M Kevin/M Kevlar Kev/MN Kevon/M Kevorkian/M Kevyn/M Kewaskum/M Kewaunee/M Kewpie/M keyboardist/S keyboard/RDMZGS keyclick/SM keyhole/MS Key/M Keynesian/M Keynes/M keynoter/M keynote/SRDZMG keypad/MS keypuncher/M keypunch/ZGRSD keyring key/SGMD keystone/SM keystroke/SDMG keyword/SM k/FGEIS kg K/G KGB Khabarovsk/M Khachaturian/M khaki/SM Khalid/M Khalil/M Khan/M khan/MS Kharkov/M Khartoum/M Khayyam/M Khmer/M Khoisan/M Khomeini/M Khorana/M Khrushchev/SM Khufu/M Khulna/M Khwarizmi/M Khyber/M kHz/M KIA Kiah/M Kial/M kibble/GMSD kibbutzim kibbutz/M kibitzer/M kibitz/GRSDZ kibosh/GMSD Kickapoo/M kickback/SM kickball/MS kicker/M kick/GZDRS kickoff/SM kickstand/MS kicky/RT kidded kidder/SM kiddie/SD kidding/YM kiddish Kidd/M kiddo/SM kiddying kiddy's kidless kid/MS kidnaper's kidnaping's kidnap/MSJ kidnapped kidnapper/SM kidnapping/S kidney/MS kidskin/SM Kieffer/M kielbasa/SM kielbasi Kiele/M Kiel/M Kienan/M kier/I Kierkegaard/M Kiersten/M Kieth/M Kiev/M Kigali/M Kikelia/M Kikuyu/M Kilauea/M Kile/M Kiley/M Kilian/M Kilimanjaro/M kill/BJGZSDR killdeer/SM Killebrew/M killer/M Killian/M Killie/M killing/Y killjoy/S Killy/M kiln/GDSM kilobaud/M kilobit/S kilobuck kilobyte/S kilocycle/MS kilogauss/M kilogram/MS kilohertz/M kilohm/M kilojoule/MS kiloliter/MS kilometer/SM kilo/SM kiloton/SM kilovolt/SM kilowatt/SM kiloword kilter/M kilt/MDRGZS Ki/M Kimball/M Kimbell/M Kimberlee/M Kimberley/M Kimberli/M Kimberly/M Kimberlyn/M Kimble/M Kimbra/M Kim/M Kimmie/M Kimmi/M Kimmy/M kimono/MS Kincaid/M kinda kindergarten/MS kindergärtner/SM kinder/U kindheartedness/MS kindhearted/YP kindle/AGRSD kindler/M kindliness/SM kindliness's/U kindling/M kindly/TUPR kindness's kindness/US kind/PSYRT kindred/S kinematic/S kinematics/M kinesics/M kine/SM kinesthesis kinesthetically kinesthetic/S kinetically kinetic/S kinetics/M kinfolk/S kingbird/M kingdom/SM kingfisher/MS kinglet/M kingliness/M kingly/TPR King/M kingpin/MS Kingsbury/M king/SGYDM kingship/SM Kingsley/M Kingsly/M Kingston/M Kingstown/M Kingwood/M kink/GSDM kinkily kinkiness/SM kinky/PRT Kin/M kin/MS Kinna/M Kinney/M Kinnickinnic/M Kinnie/M Kinny/M Kinsey/M kinsfolk/S Kinshasa/M Kinshasha/M kinship/SM Kinsley/M kinsman/M kinsmen/M kinswoman/M kinswomen kiosk/SM Kiowa/SM Kipling/M Kip/M kip/MS Kippar/M kipped kipper/DMSG Kipper/M Kippie/M kipping Kipp/MR Kippy/M Kira/M Kirbee/M Kirbie/M Kirby/M Kirchhoff/M Kirchner/M Kirchoff/M Kirghistan/M Kirghizia/M Kirghiz/M Kiribati Kiri/M Kirinyaga/M kirk/GDMS Kirkland/M Kirk/M Kirkpatrick/M Kirkwood/M Kirov/M kirsch/S Kirsteni/M Kirsten/M Kirsti/M Kirstin/M Kirstyn/M Kisangani/M Kishinev/M kismet/SM kiss/DSRBJGZ Kissee/M kisser/M Kissiah/M Kissie/M Kissinger/M Kitakyushu/M kitbag's kitchener/M Kitchener/M kitchenette/SM kitchen/GDRMS kitchenware/SM kiter/M kite/SM kith/MDG kiths Kit/M kit/MDRGS kitsch/MS kitschy kitted kittenishness/M kittenish/YP kitten/SGDM Kittie/M Kitti/M kitting kittiwakes Kitty/M kitty/SM Kiwanis/M kiwifruit/S kiwi/SM Kizzee/M Kizzie/M KKK kl Klan/M Klansman/M Klara/M Klarika/M Klarrisa/M Klaus/M klaxon/M Klee/M Kleenex/SM Klein/M Kleinrock/M Klemens/M Klement/M Kleon/M kleptomaniac/SM kleptomania/MS Kliment/M Kline/M Klingon/M Klondike/SDMG kludger/M kludge/RSDGMZ kludgey klutziness/S klutz/SM klutzy/TRP Klux/M klystron/MS km kn knacker/M knack/SGZRDM knackwurst/MS Knapp/M knapsack/MS Knauer/M knavery/MS knave/SM knavish/Y kneader/M knead/GZRDS kneecap/MS kneecapped kneecapping knee/DSM kneeing kneeler/M kneel/GRS kneepad/SM knell/SMDG knelt Knesset/M knew Kngwarreye/M Knickerbocker/MS knickerbocker/S knickknack/SM knick/ZR Knievel/M knife/DSGM knighthood/MS knightliness/MS knightly/P Knight/M knight/MDYSG knish/MS knit/AU knits knitted knitter/MS knitting/SM knitwear/M knives/M knobbly knobby/RT Knobeloch/M knob/MS knockabout/M knockdown/S knocker/M knock/GZSJRD knockoff/S knockout/MS knockwurst's knoll/MDSG Knopf/M Knossos/M knothole/SM knot/MS knotted knottiness/M knotting/M knotty/TPR knowable/U knower/M know/GRBSJ knowhow knowingly/U knowing/RYT knowings/U knowledgeableness/M knowledgeable/P knowledgeably knowledge/SM Knowles known/SU Knox/M Knoxville/M knuckleball/R knuckle/DSMG knuckleduster knucklehead/MS Knudsen/M Knudson/M knurl/DSG Knuth/M Knutsen/M Knutson/M KO koala/SM Kobayashi/M Kobe/M Kochab/M Koch/M Kodachrome/M Kodak/SM Kodaly/M Kodiak/M Koenig/M Koenigsberg/M Koenraad/M Koestler/M Kohinoor/M Kohler/M Kohl/MR kohlrabies kohlrabi/M kola/SM Kolyma/M Kommunizma/M Kong/M Kongo/M Konrad/M Konstance/M Konstantine/M Konstantin/M Konstanze/M kookaburra/SM kook/GDMS kookiness/S kooky/PRT Koo/M Koontz/M kopeck/MS Koppers/M Koralle/M Koral/M Kora/M Koranic Koran/SM Kordula/M Korea/M Korean/S Korella/M Kore/M Koren/M Koressa/M Korey/M Korie/M Kori/M Kornberg/M Korney/M Korrie/M Korry/M Kort/M Kory/M Korzybski/M Kosciusko/M kosher/DGS Kossuth/M Kosygin/M Kovacs/M Kowalewski/M Kowalski/M Kowloon/M kowtow/SGD KP kph kraal/SMDG Kraemer/M kraft/M Kraft/M Krakatau's Krakatoa/M Krakow/M Kramer/M Krasnodar/M Krasnoyarsk/M Krause/M kraut/S! Krebs/M Kremlin/M Kremlinologist/MS Kremlinology/MS Kresge/M Krieger/M kriegspiel/M krill/MS Kringle/M Krisha/M Krishnah/M Krishna/M Kris/M Krispin/M Krissie/M Krissy/M Kristal/M Krista/M Kristan/M Kristel/M Kriste/M Kristen/M Kristian/M Kristie/M Kristien/M Kristi/MN Kristina/M Kristine/M Kristin/M Kristofer/M Kristoffer/M Kristofor/M Kristoforo/M Kristo/MS Kristopher/M Kristy/M Kristyn/M Kr/M Kroc/M Kroger/M króna/M Kronecker/M krone/RM kronor krónur Kropotkin/M Krueger/M Kruger/M Krugerrand/S Krupp/M Kruse/M krypton/SM Krystalle/M Krystal/M Krysta/M Krystle/M Krystyna/M ks K's KS k's/IE kt Kublai/M Kubrick/M kuchen/MS kudos/M kudzu/SM Kuenning/M Kuhn/M Kuibyshev/M Ku/M Kumar/M kumquat/SM Kunming/M Kuomintang/M Kurdish/M Kurdistan/SM Kurd/SM Kurosawa/M Kurtis/M Kurt/M kurtosis/M Kusch/M Kuwaiti/SM Kuwait/M Kuznetsk/M Kuznets/M kvetch/DSG kw kW Kwakiutl/M Kwangchow's Kwangju/M Kwanzaa/S kWh KY Kyla/M kyle/M Kyle/M Kylen/M Kylie/M Kylila/M Kylynn/M Ky/MH Kym/M Kynthia/M Kyoto/M Kyrgyzstan Kyrstin/M Kyushu/M L LA Laban/M labeled/U labeler/M label/GAZRDS labellings/A label's labial/YS labia/M labile labiodental labium/M laboratory/MS laboredness/M labored/PMY labored's/U laborer/M laboring/MY laborings/U laboriousness/MS laborious/PY labor/RDMJSZG laborsaving Labradorean/S Labrador/SM lab/SM Lab/SM laburnum/SM labyrinthine labyrinth/M labyrinths laced/U Lacee/M lace/MS lacerate/NGVXDS laceration/M lacer/M laces/U lacewing/MS Lacey/M Lachesis/M lachrymal/S lachrymose Lacie/M lacing/M lackadaisic lackadaisical/Y Lackawanna/M lacker/M lackey/SMDG lack/GRDMS lackluster/S Lac/M laconic laconically lacquerer/M lacquer/ZGDRMS lacrosse/MS lac/SGMDR lactate/MNGSDX lactational/Y lactation/M lacteal lactic lactose/MS lacunae lacuna/M Lacy/M lacy/RT ladder/GDMS laddie/MS laded/U ladened ladening laden/U lade/S lading/M ladle/SDGM Ladoga/M Ladonna/M lad/XGSJMND ladybird/SM ladybug/MS ladyfinger/SM ladylike/U ladylove/MS Ladyship/MS ladyship/SM lady/SM Lady/SM Laetitia/M laetrile/S Lafayette/M Lafitte/M lager/DMG laggard/MYSP laggardness/M lagged lagging/MS lagniappe/SM lagoon/MS Lagos/M Lagrange/M Lagrangian/M Laguerre/M Laguna/M lag/ZSR Lahore/M laid/AI Laidlaw/M lain Laina/M Lainey/M Laird/M laird/MS lair/GDMS laissez laity/SM Laius/M lake/DSRMG Lakehurst/M Lakeisha/M laker/M lakeside Lakewood/M Lakisha/M Lakshmi/M lallygagged lallygagging lallygag/S Lalo/M La/M Lamaism/SM Lamarck/M Lamar/M lamasery/MS lama/SM Lamaze lambada/S lambaste/SDG lambda/SM lambency/MS lambent/Y Lambert/M lambkin/MS Lamb/M Lamborghini/M lambskin/MS lamb/SRDMG lambswool lamebrain/SM lamed/M lameness/MS lamentableness/M lamentable/P lamentably lamentation/SM lament/DGSB lamented/U lame/SPY la/MHLG laminae lamina/M laminar laminate/XNGSD lamination/M lam/MDRSTG lammed lammer lamming Lammond/M Lamond/M Lamont/M L'Amour lampblack/SM lamplighter/M lamplight/ZRMS lampooner/M lampoon/RDMGS Lamport/M lamppost/SM lamprey/MS lamp/SGMRD lampshade/MS LAN Lanae/M Lanai/M lanai/SM Lana/M Lancashire/M Lancaster/M Lancelot/M Lance/M lancer/M lance/SRDGMZ lancet/MS landau/MS lander/I landfall/SM landfill/DSG landforms landholder/M landhold/JGZR landing/M Landis/M landlady/MS landless landlines landlocked landlord/MS landlubber/SM Land/M landmark/GSMD landmass/MS Landon/M landowner/MS landownership/M landowning/SM Landry/M Landsat landscape/GMZSRD landscaper/M lands/I landslide/MS landslid/G landslip landsman/M landsmen land/SMRDJGZ Landsteiner/M landward/S Landwehr/M Lane/M lane/SM Lanette/M Laney/M Langeland/M Lange/M Langerhans/M Langford/M Langland/M Langley/M Lang/M Langmuir/M Langsdon/M Langston/M language/MS languidness/MS languid/PY languisher/M languishing/Y languish/SRDG languorous/Y languor/SM Lanie/M Lani/M Lanita/M lankiness/SM lankness/MS lank/PTYR lanky/PRT Lanna/M Lannie/M Lanni/M Lanny/M lanolin/MS Lansing/M lantern/GSDM lanthanide/M lanthanum/MS lanyard/MS Lanzhou Laocoon/M Lao/SM Laotian/MS lapboard/MS lapdog/S lapel/MS lapidary/MS lapin/MS Laplace/M Lapland/ZMR lapped lappet/MS lapping Lapp/SM lapsed/A lapse/KSDMG lapser/MA lapses/A lapsing/A lap/SM laps/SRDG laptop/SM lapwing/MS Laraine/M Lara/M Laramie/M larboard/MS larcenist/S larcenous larceny/MS larch/MS larder/M lard/MRDSGZ Lardner/M lardy/RT Laredo/M largehearted largemouth largeness/SM large/SRTYP largess/SM largish largo/S lariat/MDGS Lari/M Larina/M Larine/M Larisa/M Larissa/M larker/M lark/GRDMS Lark/M larkspur/MS Larousse/M Larry/M Larsen/M Lars/NM Larson/M larvae larval larva/M laryngeal/YS larynges laryngitides laryngitis/M larynx/M Laryssa/M lasagna/S lasagne's Lascaux/M lasciviousness/MS lascivious/YP lase laser/M lashed/U lasher/M lashing/M lash/JGMSRD Lassa/M Lassen/M Lassie/M lassie/SM lassitude/MS lassoer/M lasso/GRDMS las/SRZG lass/SM laster/M lastingness/M lasting/PY last/JGSYRD Laszlo/M Latasha/M Latashia/M latching/M latchkey/SM latch's latch/UGSD latecomer/SM lated/A late/KA lately latency/MS lateness/MS latent/YS later/A lateral/GDYS lateralization Lateran/M latest/S LaTeX/M latex/MS lathe/M latherer/M lather/RDMG lathery lathing/M lath/MSRDGZ Lathrop/M laths Latia/M latices/M Latina/SM Latinate Latino/S Latin/RMS latish Latisha/M latitude/SM latitudinal/Y latitudinarian/S latitudinary Lat/M Latonya/M Latoya/M Latrena/M Latrina/M latrine/MS Latrobe/M lat/SDRT latter/YM latte/SR lattice/SDMG latticework/MS latticing/M Lattimer/M Latvia/M Latvian/S laudably laudanum/MS laudatory Lauderdale/M lauder/M Lauder/M Laud/MR laud/RDSBG lauds/M Laue/M laughableness/M laughable/P laughably laugh/BRDZGJ laugher/M laughing/MY laughingstock/SM laughs laughter/MS Laughton/M Launce/M launch/AGSD launcher/MS launching/S launchpad/S laundered/U launderer/M launderette/MS launder/SDRZJG laundress/MS laundrette/S laundromat/S Laundromat/SM laundryman/M laundrymen laundry/MS laundrywoman/M laundrywomen Lauraine/M Lauralee/M Laural/M laura/M Laura/M Laurasia/M laureate/DSNG laureateship/SM Lauree/M Laureen/M Laurella/M Laurel/M laurel/SGMD Laure/M Laurena/M Laurence/M Laurene/M Lauren/SM Laurentian Laurent/M Lauretta/M Laurette/M Laurianne/M Laurice/M Laurie/M Lauri/M Lauritz/M Lauryn/M Lausanne/M lavage/MS lavaliere/MS Laval/M lava/SM lavatory/MS lave/GDS Lavena/M lavender/MDSG Laverna/M Laverne/M Lavern/M Lavina/M Lavinia/M Lavinie/M lavishness/MS lavish/SRDYPTG Lavoisier/M Lavonne/M Lawanda/M lawbreaker/SM lawbreaking/MS Lawford/M lawfulness/SMU lawful/PUY lawgiver/MS lawgiving/M lawlessness/MS lawless/PY Law/M lawmaker/MS lawmaking/SM lawman/M lawmen lawnmower/S lawn/SM Lawrence/M Lawrenceville/M lawrencium/SM Lawry/M law/SMDG Lawson/M lawsuit/MS Lawton/M lawyer/DYMGS laxativeness/M laxative/PSYM laxer/A laxes/A laxity/SM laxness/SM lax/PTSRY layabout/MS Layamon/M layaway/S lay/CZGSR layered/C layer/GJDM layering/M layer's/IC layette/SM Layla/M Lay/M layman/M laymen Layne/M Layney/M layoff/MS layout/SM layover/SM laypeople layperson/S lays/AI Layton/M layup/MS laywoman/M laywomen Lazare/M Lazar/M Lazaro/M Lazarus/M laze/DSG lazily laziness/MS lazuli/M lazybones/M lazy/PTSRDG lb LBJ/M lbs LC LCD LCM LDC leachate Leach/M leach/SDG Leadbelly/M leaded/U leadenness/M leaden/PGDY leaderless leader/M leadership/MS lead/SGZXJRDN leadsman/M leadsmen leafage/MS leaf/GSDM leafhopper/M leafiness/M leafless leaflet/SDMG leafstalk/SM leafy/PTR leaguer/M league/RSDMZG Leah/M leakage/SM leaker/M Leakey/M leak/GSRDM leakiness/MS leaky/PRT Lea/M lea/MS Leander/M Leandra/M leaner/M leaning/M Lean/M Leanna/M Leanne/M leanness/MS Leann/M Leanora/M Leanor/M lean/YRDGTJSP leaper/M leapfrogged leapfrogging leapfrog/SM leap/RDGZS Lear/M learnedly learnedness/M learned/UA learner/M learning/M learns/UA learn/SZGJRD Leary/M lease/ARSDG leaseback/MS leaseholder/M leasehold/SRMZ leaser/MA lease's leash's leash/UGSD leasing/M leas/SRDGZ least/S leastwise leatherette/S leather/MDSG leathern leatherneck/SM leathery leaven/DMJGS leavened/U leavening/M Leavenworth/M leaver/M leaves/M leave/SRDJGZ leaving/M Lebanese Lebanon/M Lebbie/M lebensraum Lebesgue/M Leblanc/M lecher/DMGS lecherousness/MS lecherous/YP lechery/MS lecithin/SM lectern/SM lecturer/M lecture/RSDZMG lectureship/SM led Leda/M Lederberg/M ledger/DMG ledge/SRMZ LED/SM Leeanne/M Leeann/M leech/MSDG Leeds/M leek/SM Leelah/M Leela/M Leeland/M Lee/M lee/MZRS Leena/M leer/DG leeriness/MS leering/Y leery/PTR Leesa/M Leese/M Leeuwenhoek/M Leeward/M leeward/S leeway/MS leftism/SM leftist/SM leftmost leftover/MS Left/S left/TRS leftward/S Lefty/M lefty/SM legacy/MS legalese/MS legalism/SM legalistic legality/MS legalization/MS legalize/DSG legalized/U legal/SY legate/AXCNGSD legatee/MS legate's/C legation/AMC legato/SM legendarily legendary/S Legendre/M legend/SM legerdemain/SM Leger/SM legged legginess/MS legging/MS leggy/PRT leghorn/SM Leghorn/SM legibility/MS legible legibly legionary/S legionnaire/SM legion/SM legislate/SDXVNG legislation/M legislative/SY legislator/SM legislature/MS legitimacy/MS legitimate/SDNGY legitimation/M legitimatize/SDG legitimization/MS legitimize/RSDG legit/S legless legman/M legmen leg/MS Lego/M Legra/M Legree/M legroom/MS legstraps legume/SM leguminous legwork/SM Lehigh/M Lehman/M Leia/M Leibniz/M Leicester/SM Leiden/M Leif/M Leigha/M Leigh/M Leighton/M Leilah/M Leila/M lei/MS Leipzig/M Leisha/M leisureliness/MS leisurely/P leisure/SDYM leisurewear leitmotif/SM leitmotiv/MS Lek/M Lelah/M Lela/M Leland/M Lelia/M Lemaitre/M Lemar/M Lemke/M Lem/M lemma/MS lemme/GJ Lemmie/M lemming/M Lemmy/M lemonade/SM lemon/GSDM lemony Lemuel/M Lemuria/M lemur/MS Lena/M Lenard/M Lenci/M lender/M lend/SRGZ Lenee/M Lenette/M lengthener/M lengthen/GRD lengthily lengthiness/MS length/MNYX lengths lengthwise lengthy/TRP lenience/S leniency/MS lenient/SY Leningrad/M Leninism/M Leninist Lenin/M lenitive/S Lenka/M Len/M Le/NM Lenna/M Lennard/M Lennie/M Lennon/M Lenny/M Lenoir/M Leno/M Lenora/M Lenore/M lens/SRDMJGZ lent/A lenticular lentil/SM lento/S Lent/SMN Leodora/M Leoine/M Leola/M Leoline/M Leo/MS Leona/M Leonanie/M Leonard/M Leonardo/M Leoncavallo/M Leonelle/M Leonel/M Leone/M Leonerd/M Leonhard/M Leonidas/M Leonid/M Leonie/M leonine Leon/M Leonora/M Leonore/M Leonor/M Leontine/M Leontyne/M leopardess/SM leopard/MS leopardskin Leopold/M Leopoldo/M Leopoldville/M Leora/M leotard/MS leper/SM Lepidus/M Lepke/M leprechaun/SM leprosy/MS leprous lepta lepton/SM Lepus/M Lerner/M Leroi/M Leroy/M Lesa/M lesbianism/MS lesbian/MS Leshia/M lesion/DMSG Lesley/M Leslie/M Lesli/M Lesly/M Lesotho/M lessee/MS lessen/GDS Lesseps/M lesser lesses Lessie/M lessing lesson/DMSG lessor/MS less/U Lester/M lest/R Les/Y Lesya/M Leta/M letdown/SM lethality/M lethal/YS Letha/M lethargic lethargically lethargy/MS Lethe/M Lethia/M Leticia/M Letisha/M let/ISM Letitia/M Letizia/M Letta/M letterbox/S lettered/U letterer/M letterhead/SM lettering/M letter/JSZGRDM letterman/M Letterman/M lettermen letterpress/MS Lettie/M Letti/M letting/S lettuce/SM Letty/M letup/MS leukemia/SM leukemic/S leukocyte/MS Leupold/M Levant/M leveeing levee/SDM leveled/U leveler/M levelheadedness/S levelheaded/P leveling/U levelness/SM level/STZGRDYP leverage/MGDS lever/SDMG Levesque/M Levey/M Leviathan leviathan/MS levier/M Levi/MS Levine/M Levin/M levitate/XNGDS levitation/M Leviticus/M Levitt/M levity/MS Lev/M Levon/M Levy/M levy/SRDZG lewdness/MS lewd/PYRT Lewellyn/M Lewes Lewie/M Lewinsky/M lewis/M Lewis/M Lewiss Lew/M lex lexeme/MS lexical/Y lexicographer/MS lexicographic lexicographical/Y lexicography/SM lexicon/SM Lexie/M Lexi/MS Lexine/M Lexington/M Lexus/M Lexy/M Leyden/M Leyla/M Lezley/M Lezlie/M lg Lhasa/SM Lhotse/M liability/SAM liable/AP liaise/GSD liaison/SM Lia/M Liam/M Liana/M Liane/M Lian/M Lianna/M Lianne/M liar/MS libation/SM libbed Libbey/M Libbie/M Libbi/M libbing Libby/M libeler/M libel/GMRDSZ libelous/Y Liberace/M liberalism/MS liberality/MS liberalization/SM liberalized/U liberalize/GZSRD liberalizer/M liberalness/MS liberal/YSP liberate/NGDSCX liberationists liberation/MC liberator/SCM Liberia/M Liberian/S libertarianism/M libertarian/MS libertine/MS liberty/MS libidinal libidinousness/M libidinous/PY libido/MS Lib/M lib/MS librarian/MS library/MS Libra/SM libretoes libretos librettist/MS libretto/MS Libreville/M Librium/M Libya/M Libyan/S lice/M licensed/AU licensee/SM license/MGBRSD licenser/M licenses/A licensing/A licensor/M licentiate/MS licentiousness/MS licentious/PY Licha/M lichee's lichen/DMGS Lichtenstein/M Lichter/M licit/Y licked/U lickerish licker/M lick/GRDSJ licking/M licorice/SM Lida/M lidded lidding Lidia/M lidless lid/MS lido/MS Lieberman/M Liebfraumilch/M Liechtenstein/RMZ lied/MR lie/DRS Lief/M liefs/A lief/TSR Liege/M liege/SR Lie/M lien/SM lier/IMA lies/A Liesa/M lieu/SM lieut lieutenancy/MS lieutenant/SM Lieut/M lifeblood/SM lifeboat/SM lifebuoy/S lifeforms lifeguard/MDSG lifelessness/SM lifeless/PY lifelikeness/M lifelike/P lifeline/SM lifelong life/MZR lifer/M lifesaver/SM lifesaving/S lifespan/S lifestyle/S lifetaking lifetime/MS lifework/MS LIFO lifter/M lift/GZMRDS liftoff/MS ligament/MS ligand/MS ligate/XSDNG ligation/M ligature/DSGM light/ADSCG lighted/U lightener/M lightening/M lighten/ZGDRS lighter/CM lightered lightering lighters lightest lightface/SDM lightheaded lightheartedness/MS lighthearted/PY lighthouse/MS lighting/MS lightly lightness/MS lightning/SMD lightproof light's lightship/SM lightweight/S ligneous lignite/MS lignum likability/MS likableness/MS likable/P likeability's liked/E likelihood/MSU likely/UPRT likeness/MSU liken/GSD liker/E liker's likes/E likest like/USPBY likewise liking/SM lilac/MS Lilah/M Lila/SM Lilia/MS Liliana/M Liliane/M Lilian/M Lilith/M Liliuokalani/M Lilla/M Lille/M Lillian/M Lillie/M Lilli/MS lilliputian/S Lilliputian/SM Lilliput/M Lilllie/M Lilly/M Lil/MY Lilongwe/M lilting/YP lilt/MDSG Lilyan/M Lily/M lily/MSD Lima/M Limbaugh/M limbered/U limberness/SM limber/RDYTGP limbers/U limbic limbless Limbo limbo/GDMS limb/SGZRDM Limburger/SM limeade/SM lime/DSMG limekiln/M limelight/DMGS limerick/SM limestone/SM limitability limitably limitation/MCS limit/CSZGRD limitedly/U limitedness/M limited/PSY limiter/M limiting/S limitlessness/SM limitless/PY limit's limn/GSD Limoges/M limo/S limousine/SM limper/M limpet/SM limpidity/MS limpidness/SM limpid/YP limpness/MS Limpopo/M limp/SGTPYRD Li/MY limy/TR linage/MS Lina/M linchpin/MS Linc/M Lincoln/SM Linda/M Lindbergh/M Lindberg/M linden/MS Lindholm/M Lindie/M Lindi/M Lind/M Lindon/M Lindquist/M Lindsay/M Lindsey/M Lindstrom/M Lindsy/M Lindy/M line/AGDS lineage/SM lineal/Y Linea/M lineament/MS linearity/MS linearize/SDGNB linear/Y linebacker/SM lined/U linefeed Linell/M lineman/M linemen linen/SM liner/SM line's linesman/M linesmen Linet/M Linette/M lineup/S lingerer/M lingerie/SM lingering/Y linger/ZGJRD lingoes lingo/M lingual/SY lingua/M linguine linguini's linguistically linguistic/S linguistics/M linguist/SM ling/ZR liniment/MS lining/SM linkable linkage/SM linked/A linker/S linking/S Link/M link's linkup/S link/USGD Lin/M Linnaeus/M Linnea/M Linnell/M Linnet/M linnet/SM Linnie/M Linn/M Linoel/M linoleum/SM lino/M Linotype/M linseed/SM lintel/SM linter/M Linton/M lint/SMR linty/RST Linus/M Linux/M Linwood/M Linzy/M Lionello/M Lionel/M lioness/SM lionhearted lionization/SM lionizer/M lionize/ZRSDG Lion/M lion/MS lipase/M lipid/MS lip/MS liposuction/S lipped lipper Lippi/M lipping Lippmann/M lippy/TR lipread/GSRJ Lipschitz/M Lipscomb/M lipstick/MDSG Lipton/M liq liquefaction/SM liquefier/M liquefy/DRSGZ liqueur/DMSG liquidate/GNXSD liquidation/M liquidator/SM liquidity/SM liquidizer/M liquidize/ZGSRD liquidness/M liquid/SPMY liquorice/SM liquorish liquor/SDMG lira/M Lira/M lire Lisabeth/M Lisa/M Lisbeth/M Lisbon/M Lise/M Lisetta/M Lisette/M Lisha/M Lishe/M Lisle/M lisle/SM lisper/M lisp/MRDGZS Lissajous/M Lissa/M Lissie/M Lissi/M Liss/M lissomeness/M lissome/P lissomness/M Lissy/M listed/U listener/M listen/ZGRD Listerine/M lister/M Lister/M listing/M list/JMRDNGZXS listlessness/SM listless/PY Liston/M Liszt/M Lita/M litany/MS litchi/SM literacy/MS literalism/M literalistic literalness/MS literal/PYS literariness/SM literary/P literate/YNSP literati literation/M literature/SM liter/M lite/S litheness/SM lithe/PRTY lithesome lithium/SM lithograph/DRMGZ lithographer/M lithographic lithographically lithographs lithography/MS lithology/M lithosphere/MS lithospheric Lithuania/M Lithuanian/S litigant/MS litigate/NGXDS litigation/M litigator/SM litigiousness/MS litigious/PY litmus/SM litotes/M lit/RZS littérateur/S litterbug/SM litter/SZGRDM Little/M littleneck/M littleness/SM little/RSPT Littleton/M Litton/M littoral/S liturgical/Y liturgic/S liturgics/M liturgist/MS liturgy/SM Liuka/M livability/MS livableness/M livable/U livably Liva/M lived/A livelihood/SM liveliness/SM livelong/S lively/RTP liveness/M liven/SDG liver/CSGD liveried liverish Livermore/M Liverpool/M Liverpudlian/MS liver's liverwort/SM liverwurst/SM livery/CMS liveryman/MC liverymen/C lives/A lives's livestock/SM live/YHZTGJDSRPB Livia/M lividness/M livid/YP livingness/M Livingstone/M Livingston/M living/YP Liv/M Livonia/M Livvie/M Livvy/M Livvyy/M Livy/M Lizabeth/M Liza/M lizard/MS Lizbeth/M Lizette/M Liz/M Lizzie/M Lizzy/M l/JGVXT Ljubljana/M LL llama/SM llano/SM LLB ll/C LLD Llewellyn/M Lloyd/M Llywellyn/M LNG lo loadable loaded/A loader/MU loading/MS load's/A loads/A loadstar's loadstone's load/SURDZG loafer/M Loafer/S loaf/SRDMGZ loam/SMDG loamy/RT loaner/M loaning/M loan/SGZRDMB loansharking/S loanword/S loathe loather/M loathing/M loath/JPSRDYZG loathness/M loathsomeness/MS loathsome/PY loaves/M Lobachevsky/M lobar lobbed lobber/MS lobbing lobby/GSDM lobbyist/MS lobe/SM lob/MDSG lobotomist lobotomize/GDS lobotomy/MS lobster/MDGS lobularity lobular/Y lobule/SM locale/MS localisms locality/MS localization/MS localized/U localizer/M localizes/U localize/ZGDRS local/SGDY locatable locate/AXESDGN locater/M locational/Y location/EMA locative/S locator's Lochinvar/M loch/M lochs loci/M lockable Lockean/M locked/A Locke/M locker/SM locket/SM Lockhart/M Lockheed/M Lockian/M locking/S lockjaw/SM Lock/M locknut/M lockout/MS lock's locksmithing/M locksmith/MG locksmiths lockstep/S lock/UGSD lockup/MS Lockwood/M locomotion/SM locomotive/YMS locomotor locomotory loco/SDMG locoweed/MS locus/M locust/SM locution/MS lode/SM lodestar/MS lodestone/MS lodged/E lodge/GMZSRDJ Lodge/M lodgepole lodger/M lodges/E lodging/M lodgment/M Lodovico/M Lodowick/M Lodz Loeb/M Loella/M Loewe/M Loewi/M lofter/M loftily loftiness/SM loft/SGMRD lofty/PTR loganberry/SM Logan/M logarithmic logarithmically logarithm/MS logbook/MS loge/SMNX logged/U loggerhead/SM logger/SM loggia/SM logging/MS logicality/MS logicalness/M logical/SPY logician/SM logic/SM login/S logion/M logistical/Y logistic/MS logjam/SM LOGO logo/SM logotype/MS logout logrolling/SM log's/K log/SM logy/RT Lohengrin/M loincloth/M loincloths loin/SM Loire/M Loise/M Lois/M loiterer/M loiter/RDJSZG Loki/M Lola/M Loleta/M Lolita/M loller/M lollipop/MS loll/RDGS Lolly/M lolly/SM Lombardi/M Lombard/M Lombardy/M Lomb/M Lome Lona/M Londonderry/M Londoner/M London/RMZ Lonee/M loneliness/SM lonely/TRP loneness/M lone/PYZR loner/M lonesomeness/MS lonesome/PSY longboat/MS longbow/SM longed/K longeing longer/K longevity/MS Longfellow/M longhair/SM longhand/SM longhorn/SM longing/MY longish longitude/MS longitudinal/Y long/JGTYRDPS Long/M longness/M longshoreman/M longshoremen longsighted longs/K longstanding Longstreet/M longsword longterm longtime Longueuil/M longueur/SM longways longword/SM Loni/M Lon/M Lonna/M Lonnard/M Lonnie/M Lonni/M Lonny/M loofah/M loofahs lookahead lookalike/S looker/M look/GZRDS lookout/MS lookup/SM looming/M Loomis/M loom/MDGS loon/MS loony/SRT looper/M loophole/MGSD loop/MRDGS loopy/TR loosed/U looseleaf loosener/M looseness/MS loosen/UDGS loose/SRDPGTY looses/U loosing/M looter/M loot/MRDGZS loper/M lope/S Lopez/M lopped lopper/MS lopping lop/SDRG lopsidedness/SM lopsided/YP loquaciousness/MS loquacious/YP loquacity/SM Loraine/M Lorain/M Loralee/M Loralie/M Loralyn/M Lora/M Lorant/M lording/M lordliness/SM lordly/PTR Lord/MS lord/MYDGS lordship/SM Lordship/SM Loree/M Loreen/M Lorelei/M Lorelle/M lore/MS Lorena/M Lorene/M Loren/SM Lorentzian/M Lorentz/M Lorenza/M Lorenz/M Lorenzo/M Loretta/M Lorette/M lorgnette/SM Loria/M Lorianna/M Lorianne/M Lorie/M Lorilee/M Lorilyn/M Lori/M Lorinda/M Lorine/M Lorin/M loris/SM Lorita/M lorn Lorna/M Lorne/M Lorraine/M Lorrayne/M Lorre/M Lorrie/M Lorri/M Lorrin/M lorryload/S Lorry/M lorry/SM Lory/M Los loser/M lose/ZGJBSR lossage lossless loss/SM lossy/RT lost/P Lothaire/M Lothario/MS lotion/MS Lot/M lot/MS Lotta/M lotted Lotte/M lotter lottery/MS Lottie/M Lotti/M lotting Lott/M lotto/MS Lotty/M lotus/SM louden/DG loudhailer/S loudly/RT loudmouth/DM loudmouths loudness/MS loudspeaker/SM loudspeaking loud/YRNPT Louella/M Louie/M Louisa/M Louise/M Louisette/M Louisiana/M Louisianan/S Louisianian/S Louis/M Louisville/M Lou/M lounger/M lounge/SRDZG Lourdes/M lour/GSD louse/CSDG louse's lousewort/M lousily lousiness/MS lousy/PRT loutishness/M loutish/YP Loutitia/M lout/SGMD louver/DMS L'Ouverture Louvre/M lovableness/MS lovable/U lovably lovebird/SM lovechild Lovecraft/M love/DSRMYZGJB loved/U Lovejoy/M Lovelace/M Loveland/M lovelessness/M loveless/YP lovelies lovelinesses loveliness/UM Lovell/M lovelornness/M lovelorn/P lovely/URPT Love/M lovemaking/SM lover/YMG lovesick lovestruck lovingly lovingness/M loving/U lowborn lowboy/SM lowbrow/MS lowdown/S Lowell/M Lowe/M lowercase/GSD lower/DG lowermost Lowery/M lowish lowland/RMZS Lowlands/M lowlife/SM lowlight/MS lowliness/MS lowly/PTR lowness/MS low/PDRYSZTG Lowrance/M lox/MDSG loyaler loyalest loyal/EY loyalism/SM loyalist/SM loyalty/EMS Loyang/M Loydie/M Loyd/M Loy/M Loyola/M lozenge/SDM LP LPG LPN/S Lr ls l's L's LSD ltd Ltd/M Lt/M Luanda/M Luann/M luau/MS lubber/YMS Lubbock/M lube/DSMG lubricant/SM lubricate/VNGSDX lubrication/M lubricator/MS lubricious/Y lubricity/SM Lubumbashi/M Lucais/M Luca/MS Luce/M lucent/Y Lucerne/M Lucho/M Lucia/MS Luciana/M Lucian/M Luciano/M lucidity/MS lucidness/MS lucid/YP Lucie/M Lucien/M Lucienne/M Lucifer/M Lucila/M Lucile/M Lucilia/M Lucille/M Luci/MN Lucina/M Lucinda/M Lucine/M Lucio/M Lucita/M Lucite/MS Lucius/M luck/GSDM luckier/U luckily/U luckiness/UMS luckless Lucknow/M Lucky/M lucky/RSPT lucrativeness/SM lucrative/YP lucre/MS Lucretia/M Lucretius/M lucubrate/GNSDX lucubration/M Lucy/M Luddite/SM Ludhiana/M ludicrousness/SM ludicrous/PY Ludlow/M Ludmilla/M ludo/M Ludovico/M Ludovika/M Ludvig/M Ludwig/M Luella/M Luelle/M luff/GSDM Lufthansa/M Luftwaffe/M luge/MC Luger/M luggage/SM lugged lugger/SM lugging Lugosi/M lug/RS lugsail/SM lugubriousness/MS lugubrious/YP Luigi/M Luisa/M Luise/M Luis/M Lukas/M Luke/M lukewarmness/SM lukewarm/PY Lula/M Lulita/M lullaby/GMSD lull/SDG lulu/M Lulu/M Lu/M lumbago/SM lumbar/S lumberer/M lumbering/M lumberjack/MS lumberman/M lumbermen lumber/RDMGZSJ lumberyard/MS lumen/M Lumière/M luminance/M luminary/MS luminescence/SM luminescent luminosity/MS luminousness/M luminous/YP lummox/MS lumper/M lumpiness/MS lumpishness/M lumpish/YP lump/SGMRDN lumpy/TPR lunacy/MS Luna/M lunar/S lunary lunate/YND lunatic/S lunation/M luncheonette/SM luncheon/SMDG luncher/M lunch/GMRSD lunchpack lunchroom/MS lunchtime/MS Lundberg/M Lund/M Lundquist/M lune/M lunge/MS lunger/M lungfish/SM lungful lung/SGRDM lunkhead/SM Lupe/M lupine/SM Lupus/M lupus/SM Lura/M lurcher/M lurch/RSDG lure/DSRG lurer/M Lurette/M lurex Luria/M luridness/SM lurid/YP lurker/M lurk/GZSRD Lurleen/M Lurlene/M Lurline/M Lusaka/M Lusa/M lusciousness/MS luscious/PY lushness/MS lush/YSRDGTP Lusitania/M luster/GDM lustering/M lusterless lustfulness/M lustful/PY lustily lustiness/MS lust/MRDGZS lustrousness/M lustrous/PY lusty/PRT lutanist/MS lute/DSMG lutenist/MS Lutero/M lutetium/MS Lutheranism/MS Lutheran/SM Luther/M luting/M Lutz Luxembourgian Luxembourg/RMZ Luxemburg's luxe/MS luxuriance/MS luxuriant/Y luxuriate/GNSDX luxuriation/M luxuriousness/SM luxurious/PY luxury/MS Luz/M Luzon/M L'vov Lyallpur/M lyceum/MS lychee's lycopodium/M Lycra/S Lycurgus/M Lyda/M Lydia/M Lydian/S Lydie/M Lydon/M lye/JSMG Lyell/M lying/Y Lyle/M Lyly/M Lyman/M Lyme/M lymphatic/S lymph/M lymphocyte/SM lymphoid lymphoma/MS lymphs Ly/MY Lynchburg/M lyncher/M lynching/M Lynch/M lynch/ZGRSDJ Lynda/M Lyndell/M Lyndel/M Lynde/M Lyndon/M Lyndsay/M Lyndsey/M Lyndsie/M Lyndy/M Lynea/M Lynelle/M Lynette/M Lynett/M Lyn/M Lynna/M Lynnea/M Lynnelle/M Lynnell/M Lynne/M Lynnet/M Lynnette/M Lynnett/M Lynn/M Lynsey/M lynx/MS Lyon/SM Lyra/M lyrebird/MS lyre/SM lyricalness/M lyrical/YP lyricism/SM lyricist/SM lyric/S Lysenko/M lysine/M Lysistrata/M Lysol/M Lyssa/M LyX/M MA Maalox/M ma'am Mabelle/M Mabel/M Mable/M Mab/M macabre/Y macadamize/SDG macadam/SM Macao/M macaque/SM macaroni/SM macaroon/MS Macarthur/M MacArthur/M Macaulay/M macaw/SM Macbeth/M Maccabees/M Maccabeus/M Macdonald/M MacDonald/M MacDraw/M Macedonia/M Macedonian/S Macedon/M mace/MS Mace/MS macerate/DSXNG maceration/M macer/M Macgregor/M MacGregor/M machete/SM Machiavellian/S Machiavelli/M machinate/SDXNG machination/M machinelike machine/MGSDB machinery/SM machinist/MS machismo/SM Mach/M macho/S Machs Macias/M Macintosh/M MacIntosh/M macintosh's Mackenzie/M MacKenzie/M mackerel/SM Mackinac/M Mackinaw mackinaw/SM mackintosh/SM mack/M Mack/M MacLeish/M Macmillan/M MacMillan/M Macon/SM MacPaint/M macramé/S macrobiotic/S macrobiotics/M macrocosm/MS macrodynamic macroeconomic/S macroeconomics/M macromolecular macromolecule/SM macron/MS macrophage/SM macroscopic macroscopically macrosimulation macro/SM macrosocioeconomic Mac/SGMD mac/SGMDR Macy/M Madagascan/SM Madagascar/M Madalena/M Madalyn/M Mada/M madame/M Madame/MS madam/SM madcap/S Maddalena/M madded madden/GSD maddening/Y Madden/M madder/MS maddest Maddie/M Maddi/M madding Maddox/M Maddy/M made/AU Madeira/SM Madelaine/M Madeleine/M Madelena/M Madelene/M Madelina/M Madeline/M Madelin/M Madella/M Madelle/M Madel/M Madelon/M Madelyn/M mademoiselle/MS Madge/M madhouse/SM Madhya/M Madison/M Madlen/M Madlin/M madman/M madmen madness/SM Madonna/MS mad/PSY Madras madras/SM Madrid/M madrigal/MSG Madsen/M Madurai/M madwoman/M madwomen Mady/M Maegan/M Maelstrom/M maelstrom/SM Mae/M maestro/MS Maeterlinck/M Mafia/MS mafia/S mafiosi mafioso/M Mafioso/S MAG magazine/DSMG Magdaia/M Magdalena/M Magdalene/M Magdalen/M Magda/M Magellanic Magellan/M magenta/MS magged Maggee/M Maggie/M Maggi/M magging maggot/MS maggoty/RT Maggy/M magi magical/Y magician/MS magicked magicking magic/SM Magill/M Magi/M Maginot/M magisterial/Y magistracy/MS magistrate/MS Mag/M magma/SM magnanimity/SM magnanimosity magnanimous/PY magnate/SM magnesia/MS magnesite/M magnesium/SM magnetically magnetic/S magnetics/M magnetism/SM magnetite/SM magnetizable magnetization/ASCM magnetize/CGDS magnetized/U magnetodynamics magnetohydrodynamical magnetohydrodynamics/M magnetometer/MS magneto/MS magnetosphere/M magnetron/M magnet/SM magnification/M magnificence/SM magnificent/Y magnified/U magnify/DRSGNXZ magniloquence/MS magniloquent Magnitogorsk/M magnitude/SM magnolia/SM Magnum magnum/SM Magnuson/M Magog/M Magoo/M magpie/SM Magritte/M Magruder/M mag/S Magsaysay/M Maguire/SM Magus/M Magyar/MS Mahabharata Mahala/M Mahalia/M maharajah/M maharajahs maharanee's maharani/MS Maharashtra/M maharishi/SM mahatma/SM Mahavira/M Mahayana/M Mahayanist Mahdi/M Mahfouz/M Mahican/SM mahjong's Mahler/M Mahmoud/M Mahmud/M mahogany/MS Mahomet's mahout/SM Maia/M Maible/M maidenhair/MS maidenhead/SM maidenhood/SM maidenly/P maiden/YM maidservant/MS maid/SMNX maier Maier/M Maiga/M Maighdiln/M Maigret/M mailbag/MS mailbox/MS mail/BSJGZMRD mailer/M Mailer/M Maillol/M maillot/SM mailman/M mailmen Maiman/M maimedness/M maimed/P maimer/M Maimonides/M Mai/MR maim/SGZRD mainbrace/M Maine/MZR Mainer/M mainframe/MS mainlander/M mainland/SRMZ mainliner/M mainline/RSDZG mainly mainmast/SM main/SA mainsail/SM mains/M mainspring/SM mainstay/MS mainstream/DRMSG maintainability maintainable/U maintain/BRDZGS maintained/U maintainer/M maintenance/SM maintop/SM maiolica's Maire/M Mair/M Maisey/M Maisie/M maisonette/MS Maison/M Maitilde/M maize/MS Maj Maje/M majestic majestically majesty/MS Majesty/MS majolica/SM Majorca/M major/DMGS majordomo/S majorette/SM majority/SM Major/M Majuro/M makable Makarios/M makefile/S makeover/S Maker/M maker/SM makeshift/S make/UGSA makeup/MS making/SM Malabar/M Malabo/M Malacca/M Malachi/M malachite/SM maladapt/DV maladjust/DLV maladjustment/MS maladministration maladroitness/MS maladroit/YP malady/MS Malagasy/M malaise/SM Mala/M Malamud/M malamute/SM Malanie/M malaprop malapropism/SM Malaprop/M malarial malaria/MS malarious malarkey/SM malathion/S Malawian/S Malawi/M Malayalam/M Malaya/M Malayan/MS Malaysia/M Malaysian/S Malay/SM Malchy/M Malcolm/M malcontentedness/M malcontented/PY malcontent/SMD Maldive/SM Maldivian/S Maldonado/M maledict malediction/MS malefaction/MS malefactor/MS malefic maleficence/MS maleficent Male/M Malena/M maleness/MS male/PSM malevolence/S malevolencies malevolent/Y malfeasance/SM malfeasant malformation/MS malformed malfunction/SDG Malia/M Malian/S Malibu/M malice/MGSD maliciousness/MS malicious/YU malignancy/SM malignant/YS malign/GSRDYZ malignity/MS Mali/M Malina/M Malinda/M Malinde/M malingerer/M malinger/GZRDS Malinowski/M Malissa/M Malissia/M mallard/SM Mallarmé/M malleability/SM malleableness/M malleable/P mallet/MS Mallissa/M Mallorie/M Mallory/M mallow/MS mall/SGMD Mal/M malnourished malnutrition/SM malocclusion/MS malodorous Malone/M Malorie/M Malory/M malposed malpractice/SM Malraux/M Malta/M malted/S Maltese Malthusian/S Malthus/M malting/M maltose/SM maltreat/GDSL maltreatment/S malt/SGMD malty/RT Malva/M Malvina/M Malvin/M Malynda/M mama/SM mamba/SM mambo/GSDM Mame/M Mamet/M ma/MH Mamie/M mammalian/SM mammal/SM mammary mamma's mammogram/S mammography/S Mammon's mammon/SM mammoth/M mammoths mammy/SM Mamore/M manacle/SDMG manageability/S manageableness manageable/U managed/U management/SM manageress/M managerial/Y manager/M managership/M manage/ZLGRSD Managua/M Manama/M mañana/M mananas Manasseh/M manatee/SM Manaus's Manchester/M Manchu/MS Manchuria/M Manchurian/S Mancini/M manciple/M Mancunian/MS mandala/SM Mandalay/M Manda/M mandamus/GMSD Mandarin mandarin/MS mandate/SDMG mandatory/S Mandela Mandelbrot/M Mandel/M mandible/MS mandibular Mandie/M Mandi/M Mandingo/M mandolin/MS mandrake/MS mandrel/SM mandrill/SM Mandy/M manège/GSD mane/MDS Manet/M maneuverability/MS maneuverer/M maneuver/MRDSGB Manfred/M manful/Y manganese/MS mange/GMSRDZ manger/M manginess/S mangler/M mangle/RSDG mangoes mango/M mangrove/MS mangy/PRT manhandle/GSD Manhattan/SM manhole/MS manhood/MS manhunt/SM maniacal/Y maniac/SM mania/SM manically Manichean/M manic/S manicure/MGSD manicurist/SM manifestation/SM manifesto/GSDM manifest/YDPGS manifolder/M manifold/GPYRDMS manifoldness/M manikin/MS Manila/MS manila/S manilla's Mani/M manioc/SM manipulability manipulable manipulate/SDXBVGN manipulative/PM manipulator/MS manipulatory Manitoba/M Manitoulin/M Manitowoc/M mankind/M Mankowski/M Manley/M manlike manliness/SM manliness's/U manly/URPT manna/MS manned/U mannequin/MS mannered/U mannerism/SM mannerist/M mannerliness/MU mannerly/UP manner/SDYM Mann/GM Mannheim/M Mannie/M mannikin's Manning/M manning/U mannishness/SM mannish/YP Manny/M Manolo/M Mano/M manometer/SM Manon/M manorial manor/MS manpower/SM manqué/M man's mansard/SM manservant/M manse/XNM Mansfield/M mansion/M manslaughter/SM Man/SM Manson/M mans/S manta/MS Mantegna/M mantelpiece/MS mantel/SM mantes mantilla/MS mantissa/SM mantis/SM mantle/ESDG Mantle/M mantle's mantling/M mantra/MS mantrap/SM manual/SMY Manuela/M Manuel/M manufacture/JZGDSR manufacturer/M manumission/MS manumit/S manumitted manumitting manure/RSDMZG manuscript/MS man/USY Manville/M Manx many Manya/M Maoism/MS Maoist/S Mao/M Maori/SM Maplecrest/M maple/MS mapmaker/S mappable mapped/UA mapper/S mapping/MS Mapplethorpe/M maps/AU map/SM Maputo/M Marabel/M marabou/MS marabout's Maracaibo/M maraca/MS Mara/M maraschino/SM Marathi marathoner/M Marathon/M marathon/MRSZ Marat/M marauder/M maraud/ZGRDS marbleize/GSD marble/JRSDMG marbler/M marbling/M Marceau/M Marcela/M Marcelia/M Marcelino/M Marcella/M Marcelle/M Marcellina/M Marcelline/M Marcello/M Marcellus/M Marcel/M Marcelo/M Marchall/M Marchelle/M marcher/M marchioness/SM March/MS march/RSDZG Marcia/M Marciano/M Marcie/M Marcile/M Marcille/M Marci/M Marc/M Marconi/M Marco/SM Marcotte/M Marcus/M Marcy/M Mardi/SM Marduk/M Mareah/M mare/MS Marena/M Maren/M Maressa/M Margalit/M Margalo/M Marga/M Margareta/M Margarete/M Margaretha/M Margarethe/M Margaret/M Margaretta/M Margarette/M margarine/MS Margarita/M margarita/SM Margarito/M Margaux/M Margeaux/M Marge/M Margery/M Marget/M Margette/M Margie/M Margi/M marginalia marginality marginalization marginalize/SDG marginal/YS margin/GSDM Margit/M Margo/M Margot/M Margrethe/M Margret/M Marguerite/M Margy/M mariachi/SM maria/M Maria/M Mariam/M Mariana/SM Marian/MS Marianna/M Marianne/M Mariann/M Mariano/M Maribelle/M Maribel/M Maribeth/M Maricela/M Marice/M Maridel/M Marieann/M Mariejeanne/M Mariele/M Marielle/M Mariellen/M Mariel/M Marie/M Marietta/M Mariette/M Marigold/M marigold/MS Marijn/M Marijo/M marijuana/SM Marika/M Marilee/M Marilin/M Marillin/M Marilyn/M marimba/SM Mari/MS marinade/MGDS Marina/M marina/MS marinara/SM marinate/NGXDS marination/M mariner/M Marine/S marine/ZRS Marin/M Marinna/M Marino/M Mario/M marionette/MS Marion/M Mariquilla/M Marisa/M Mariska/M Marisol/M Marissa/M Maritain/M marital/Y Marita/M maritime/R Maritsa/M Maritza/M Mariupol/M Marius/M Mariya/M Marja/M Marje/M Marjie/M Marji/M Marj/M marjoram/SM Marjorie/M Marjory/M Marjy/M Markab/M markdown/SM marked/AU markedly marker/M marketability/SM marketable/U Marketa/M marketeer/S marketer/M market/GSMRDJBZ marketing/M marketplace/MS mark/GZRDMBSJ Markham/M marking/M Markism/M markkaa markka/M Mark/MS Markos Markov Markovian Markovitz/M marks/A marksman/M marksmanship/S marksmen markup/SM Markus/M Marla/M Marlane/M Marlboro/M Marlborough/M Marleah/M Marlee/M Marleen/M Marlena/M Marlene/M Marley/M Marlie/M Marline/M marlinespike/SM Marlin/M marlin/SM marl/MDSG Marlo/M Marlon/M Marlowe/M Marlow/M Marlyn/M Marmaduke/M marmalade/MS Marmara/M marmoreal marmoset/MS marmot/SM Marna/M Marne/M Marney/M Marnia/M Marnie/M Marni/M maroon/GRDS marquee/MS Marquesas/M marque/SM marquess/MS marquetry/SM Marquette/M Marquez/M marquise/M marquisette/MS Marquis/M marquis/SM Marquita/M Marrakesh/M marred/U marriageability/SM marriageable marriage/ASM married/US Marrilee/M marring Marriott/M Marris/M Marrissa/M marrowbone/MS marrow/GDMS marry/SDGA mar/S Marseillaise/SM Marseilles Marseille's marshal/GMDRSZ Marshalled/M marshaller Marshall/GDM Marshalling/M marshallings Marshal/M Marsha/M marshiness/M marshland/MS Marsh/M marshmallow/SM marsh/MS marshy/PRT Marsiella/M Mar/SMN marsupial/MS Martainn/M Marta/M Martelle/M Martel/M marten/M Marten/M Martguerita/M Martha/M Marthe/M Marthena/M Martial martial/Y Martian/S Martica/M Martie/M Marti/M Martina/M martinet/SM Martinez/M martingale/MS martini/MS Martinique/M Martin/M Martino/M martin/SM Martinson/M Martita/M mart/MDNGXS Mart/MN Marty/M Martyn/M Martynne/M martyrdom/SM martyr/GDMS Marva/M marvel/DGS Marvell/M marvelous/PY Marve/M Marven/M Marvin/M Marv/NM Marwin/M Marxian/S Marxism/SM Marxist/SM Marx/M Marya/M Maryanna/M Maryanne/M Maryann/M Marybelle/M Marybeth/M Maryellen/M Maryjane/M Maryjo/M Maryland/MZR Marylee/M Marylinda/M Marylin/M Maryl/M Marylou/M Marylynne/M Mary/M Maryrose/M Marys Marysa/M marzipan/SM Masada/M Masai/M Masaryk/M masc Mascagni/M mascara/SGMD mascot/SM masculineness/M masculine/PYS masculinity/SM Masefield/M maser/M Maseru/M MASH Masha/M Mashhad/M mash/JGZMSRD m/ASK masked/U masker/M mask/GZSRDMJ masks/U masochism/MS masochistic masochistically masochist/MS masonic Masonic Masonite/M masonry/MS mason/SDMG Mason/SM masquerader/M masquerade/RSDGMZ masquer/M masque/RSMZ Massachusetts/M massacre/DRSMG massager/M massage/SRDMG Massasoit/M Massenet/M masseur/MS masseuse/SM Massey/M massif/SM Massimiliano/M Massimo/M massing/R massiveness/SM massive/YP massless mas/SRZ Mass/S mass/VGSD mastectomy/MS masterclass mastered/A masterfulness/M masterful/YP master/JGDYM masterliness/M masterly/P mastermind/GDS masterpiece/MS mastership/M Master/SM masterstroke/MS masterwork/S mastery/MS mast/GZSMRD masthead/SDMG masticate/SDXGN mastication/M mastic/SM mastiff/MS mastodon/MS mastoid/S masturbate/SDNGX masturbation/M masturbatory matador/SM Mata/M matchable/U match/BMRSDZGJ matchbook/SM matchbox/SM matched/UA matcher/M matches/A matchless/Y matchlock/MS matchmake/GZJR matchmaker/M matchmaking/M matchplay match's/A matchstick/MS matchwood/SM mated/U mate/IMS Matelda/M Mateo/M materialism/SM materialistic materialistically materialist/SM materiality/M materialization/SM materialize/CDS materialized/A materializer/SM materializes/A materializing materialness/M material/SPYM matériel/MS mater/M maternal/Y maternity/MS mates/U mathematical/Y Mathematica/M mathematician/SM mathematic/S mathematics/M Mathematik/M Mather/M Mathe/RM Mathew/MS Mathewson/M Mathian/M Mathias Mathieu/M Mathilda/M Mathilde/M Mathis math/M maths Matias/M Matilda/M Matilde/M matinée/S mating/M matins/M Matisse/SM matriarchal matriarch/M matriarchs matriarchy/MS matrices matricidal matricide/MS matriculate/XSDGN matriculation/M matrimonial/Y matrimony/SM matrix/M matron/YMS mat/SJGMDR Matsumoto/M matte/JGMZSRD Mattel/M Matteo/M matter/GDM Matterhorn/M Matthaeus/M Mattheus/M Matthew/MS Matthias Matthieu/M Matthiew/M Matthus/M Mattias/M Mattie/M Matti/M matting/M mattins's Matt/M mattock/MS mattress/MS matt's Matty/M maturate/DSNGVX maturational maturation/M matureness/M maturer/M mature/RSDTPYG maturity/MS matzo/SHM matzot Maude/M Maudie/M maudlin/Y Maud/M Maugham/M Maui/M mauler/M maul/RDGZS maunder/GDS Maupassant/M Maura/M Maureene/M Maureen/M Maure/M Maurene/M Mauriac/M Maurice/M Mauricio/M Maurie/M Maurine/M Maurise/M Maurita/M Mauritania/M Mauritanian/S Mauritian/S Mauritius/M Maurits/M Maurizia/M Maurizio/M Maurois/M Mauro/M Maury/M Mauser/M mausoleum/SM mauve/SM maven/S maverick/SMDG mavin's Mavis/M Mavra/M mawkishness/SM mawkish/PY Mawr/M maw/SGMD max/GDS Maxie/M maxillae maxilla/M maxillary/S Maxi/M maximality maximal/SY maxima's Maximilian/M Maximilianus/M Maximilien/M maximization/SM maximizer/M maximize/RSDZG Maxim/M Maximo/M maxim/SM maximum/MYS Maxine/M maxi/S Max/M Maxtor/M Maxwellian maxwell/M Maxwell/M Maxy/M Maya/MS Mayan/S Maybelle/M maybe/S mayday/S may/EGS Maye/M mayer Mayer/M mayest Mayfair/M Mayflower/M mayflower/SM mayfly/MS mayhap mayhem/MS Maynard/M Mayne/M Maynord/M mayn't Mayo/M mayonnaise/MS mayoral mayoralty/MS mayoress/MS Mayor/M mayor/MS mayorship/M mayo/S maypole/MS Maypole/SM Mayra/M May/SMR mayst Mazama/M Mazarin/M Mazatlan/M Mazda/M mazedness/SM mazed/YP maze/MGDSR mazurka/SM Mazzini/M Mb MB MBA Mbabane/M Mbini/M MC McAdam/MS McAllister/M McBride/M McCabe/M McCain/M McCall/M McCarthyism/M McCarthy/M McCartney/M McCarty/M McCauley/M McClain/M McClellan/M McClure/M McCluskey/M McConnell/M McCormick/M McCoy/SM McCracken/M McCray/M McCullough/M McDaniel/M McDermott/M McDonald/M McDonnell/M McDougall/M McDowell/M McElhaney/M McEnroe/M McFadden/M McFarland/M McGee/M McGill/M McGovern/M McGowan/M McGrath/M McGraw/M McGregor/M McGuffey/M McGuire/M MCI/M McIntosh/M McIntyre/M McKay/M McKee/M McKenzie/M McKesson/M McKinley/M McKinney/M McKnight/M McLanahan/M McLaughlin/M McLean/M McLeod/M McLuhan/M McMahon/M McMartin/M McMillan/M McNamara/M McNaughton/M McNeil/M McPherson/M MD Md/M mdse MDT ME Meade/M Mead/M meadowland meadowlark/SM meadow/MS Meadows meadowsweet/M mead/SM Meagan/M meagerness/SM meager/PY Meaghan/M meagres mealiness/MS meal/MDGS mealtime/MS mealybug/S mealymouthed mealy/PRST meander/JDSG meaneing meanie/MS meaningfulness/SM meaningful/YP meaninglessness/SM meaningless/PY meaning/M meanness/S means/M meantime/SM meant/U meanwhile/S Meany/M mean/YRGJTPS meany's Meara/M measle/SD measles/M measly/TR measurable/U measurably measure/BLMGRSD measured/Y measureless measurement/SM measurer/M measures/A measuring/A meas/Y meataxe meatball/MS meatiness/MS meatless meatloaf meatloaves meat/MS meatpacking/S meaty/RPT Mecca/MS mecca/S mechanical/YS mechanic/MS mechanism/SM mechanistic mechanistically mechanist/M mechanization/SM mechanized/U mechanizer/M mechanize/RSDZGB mechanizes/U mechanochemically Mechelle/M med medalist/MS medallion/MS medal/SGMD Medan/M meddle/GRSDZ meddlesome Medea/M Medellin Medfield/M mediaeval's medial/AY medials median/YMS media/SM mediateness/M mediate/PSDYVNGX mediation/ASM mediator/SM Medicaid/SM medical/YS medicament/MS Medicare/MS medicate/DSXNGV medication/M Medici/MS medicinal/SY medicine/DSMG medico/SM medic/SM medievalist/MS medieval/YMS Medina/M mediocre mediocrity/MS meditate/NGVXDS meditation/M meditativeness/M meditative/PY Mediterranean/MS mediumistic medium/SM medley/SM medulla/SM Medusa/M meed/MS meekness/MS meek/TPYR meerschaum/MS meeter/M meetinghouse/S meeting/M meet/JGSYR me/G mega megabit/MS megabuck/S megabyte/S megacycle/MS megadeath/M megadeaths megahertz/M megalithic megalith/M megaliths megalomaniac/SM megalomania/SM megalopolis/SM Megan/M megaphone/SDGM megaton/MS megavolt/M megawatt/SM megaword/S Megen/M Meggie/M Meggi/M Meggy/M Meghan/M Meghann/M Meg/MN megohm/MS Mehetabel/M Meier/M Meighen/M Meiji/M Mei/MR meioses meiosis/M meiotic Meir/M Meister/M Meistersinger/M Mejia/M Mekong/M Mela/M Melamie/M melamine/SM melancholia/SM melancholic/S melancholy/MS Melanesia/M Melanesian/S melange/S Melania/M Melanie/M melanin/MS melanoma/SM Melantha/M Melany/M Melba/M Melbourne/M Melcher/M Melchior/M meld/SGD mêlée/MS Melendez/M Melesa/M Melessa/M Melicent/M Melina/M Melinda/M Melinde/M meliorate/XSDVNG melioration/M Melisa/M Melisande/M Melisandra/M Melisenda/M Melisent/M Melissa/M Melisse/M Melita/M Melitta/M Mella/M Mellicent/M Mellie/M mellifluousness/SM mellifluous/YP Melli/M Mellisa/M Mellisent/M Melloney/M Mellon/M mellowness/MS mellow/TGRDYPS Melly/M Mel/MY Melodee/M melodically melodic/S Melodie/M melodiousness/S melodious/YP melodrama/SM melodramatically melodramatic/S Melody/M melody/MS Melonie/M melon/MS Melony/M Melosa/M Melpomene/M meltdown/S melter/M melting/Y Melton/M melt/SAGD Melva/M Melville/M Melvin/M Melvyn/M Me/M member/DMS membered/AE members/EA membership/SM membrane/MSD membranous memento/SM Memling/M memoir/MS memorabilia memorability/SM memorableness/M memorable/P memorably memorandum/SM memorialize/DSG memorialized/U memorial/SY memoriam memorization/MS memorized/U memorizer/M memorize/RSDZG memorizes/A memoryless memory/MS memo/SM Memphis/M menace/GSD menacing/Y menagerie/SM menage/S Menander/M menarche/MS Menard/M Mencius/M Mencken/M mendaciousness/M mendacious/PY mendacity/MS Mendeleev/M mendelevium/SM Mendelian Mendel/M Mendelssohn/M mender/M Mendez/M mendicancy/MS mendicant/S Mendie/M mending/M Mendocino/M Mendoza/M mend/RDSJGZ Mendy/M Menelaus/M Menes/M menfolk/S menhaden/M menial/YS meningeal meninges meningitides meningitis/M meninx menisci meniscus/M Menkalinan/M Menkar/M Menkent/M Menlo/M men/MS Mennonite/SM Menominee menopausal menopause/SM menorah/M menorahs Menotti/M Mensa/M Mensch/M mensch/S menservants/M mens/SDG menstrual menstruate/NGDSX menstruation/M mensurable/P mensuration/MS menswear/M mentalist/MS mentality/MS mental/Y mentholated menthol/SM mentionable/U mentioned/U mentioner/M mention/ZGBRDS mentor/DMSG Menuhin/M menu/SM Menzies/M meow/DSG Mephistopheles/M Merak/M Mercado/M mercantile Mercator/M Mercedes mercenariness/M mercenary/SMP mercerize/SDG Mercer/M mercer/SM merchandiser/M merchandise/SRDJMZG merchantability merchantman/M merchantmen merchant/SBDMG Mercie/M mercifully/U mercifulness/M merciful/YP mercilessness/SM merciless/YP Merci/M Merck/M mercurial/SPY mercuric Mercurochrome/M mercury/MS Mercury/MS Mercy/M mercy/SM Meredeth/M Meredithe/M Meredith/M Merell/M meretriciousness/SM meretricious/YP mere/YS merganser/MS merger/M merge/SRDGZ Meridel/M meridian/MS meridional Meridith/M Meriel/M Merilee/M Merill/M Merilyn/M meringue/MS merino/MS Meris Merissa/M merited/U meritocracy/MS meritocratic meritocrats meritoriousness/MS meritorious/PY merit/SCGMD Meriwether/M Merla/M Merle/M Merlina/M Merline/M merlin/M Merlin/M Merl/M mermaid/MS merman/M mermen Merna/M Merola/M meromorphic Merralee/M Merrel/M Merriam/M Merrick/M Merridie/M Merrielle/M Merrie/M Merrilee/M Merrile/M Merrili/M Merrill/M merrily Merrily/M Merrimack/M Merrimac/M merriment/MS merriness/S Merritt/M Merry/M merrymaker/MS merrymaking/SM merry/RPT Mersey/M mer/TGDR Merton/M Mervin/M Merv/M Merwin/M Merwyn/M Meryl/M Mesa Mesabi/M mesa/SM mescaline/SM mescal/SM mesdames/M mesdemoiselles/M Meshed's meshed/U mesh/GMSD mesmeric mesmerism/SM mesmerized/U mesmerizer/M mesmerize/SRDZG Mesolithic/M mesomorph/M mesomorphs meson/MS Mesopotamia/M Mesopotamian/S mesosphere/MS mesozoic Mesozoic mesquite/MS mes/S message/SDMG messeigneurs messenger/GSMD Messerschmidt/M mess/GSDM Messiaen/M messiah Messiah/M messiahs Messiahs messianic Messianic messieurs/M messily messiness/MS messmate/MS Messrs/M messy/PRT mestizo/MS meta metabolic metabolically metabolism/MS metabolite/SM metabolize/GSD metacarpal/S metacarpi metacarpus/M metacircular metacircularity metalanguage/MS metalization/SM metalized metallic/S metalliferous metallings metallography/M metalloid/M metallurgic metallurgical/Y metallurgist/S metallurgy/MS metal/SGMD metalsmith/MS metalworking/M metalwork/RMJGSZ Meta/M metamathematical metamorphic metamorphism/SM metamorphose/GDS metamorphosis/M metaphoric metaphorical/Y metaphor/MS metaphosphate/M metaphysical/Y metaphysic/SM metastability/M metastable metastases metastasis/M metastasize/DSG metastatic metatarsal/S metatarsi metatarsus/M metatheses metathesis/M metathesized metathesizes metathesizing metavariable metempsychoses metempsychosis/M meteoric meteorically meteorite/SM meteoritic/S meteoritics/M meteoroid/SM meteorologic meteorological meteorologist/S meteorology/MS meteor/SM meter/GDM mete/ZDGSR methadone/SM methane/MS methanol/SM methinks methionine/M methodicalness/SM methodical/YP methodism Methodism/SM methodist/MS Methodist/MS method/MS methodological/Y methodologists methodology/MS methought Methuen/M Methuselah/M Methuselahs methylated methylene/M methyl/SM meticulousness/MS meticulous/YP métier/S metonymy/M Metrecal/M metrical/Y metricate/SDNGX metricize/GSD metrics/M metric/SM metronome/MS metropolis/SM metropolitanization metropolitan/S metro/SM mets Metternich/M mettle/SDM mettlesome met/U Metzler/M Meuse/M mewl/GSD mew/SGD mews/SM Mex Mexicali/M Mexican/S Mexico/M Meyerbeer/M Meyer/SM mezzanine/MS mezzo/S MFA mfg mfr/S mg M/GB Mg/M MGM/M mgr Mgr MHz MI MIA Mia/M Miami/SM Miaplacidus/M miasmal miasma/SM Micaela/M Micah/M mica/MS micelles mice/M Michaela/M Michaelangelo/M Michaelina/M Michaeline/M Michaella/M Michaelmas/MS Michael/SM Michaelson/M Michail/M Michale/M Michal/M Micheal/M Micheil/M Michelangelo/M Michele/M Michelina/M Micheline/M Michelin/M Michelle/M Michell/M Michel/M Michelson/M Michigander/S Michiganite/S Michigan/M Mich/M Mickelson/M Mickey/M mickey/SM Mickie/M Micki/M Mick/M Micky/M Mic/M Micmac/M micra's microamp microanalysis/M microanalytic microbe/MS microbial microbicidal microbicide/M microbiological microbiologist/MS microbiology/SM microbrewery/S microchemistry/M microchip/S microcircuit/MS microcode/GSD microcomputer/MS microcosmic microcosm/MS microdensitometer microdot/MS microeconomic/S microeconomics/M microelectronic/S microelectronics/M microfiber/S microfiche/M microfilm/DRMSG microfossils micrography/M microgroove/MS microhydrodynamics microinstruction/SM microjoule microlevel microlight/S micromanage/GDSL micromanagement/S micrometeorite/MS micrometeoritic micrometer/SM Micronesia/M Micronesian/S micron/MS microorganism/SM microphone/SGM Microport/M microprocessing microprocessor/SM microprogrammed microprogramming microprogram/SM micro/S microscope/SM microscopic microscopical/Y microscopy/MS microsecond/MS microsimulation/S Microsystems micros/M Microsoft/M microsomal microstore microsurgery/SM MicroVAXes MicroVAX/M microvolt/SM microwaveable microwave/BMGSD microword/S midair/MS midas Midas/M midband/M midday/MS midden/SM middest middlebrow/SM Middlebury/M middle/GJRSD middleman/M middlemen middlemost Middlesex/M Middleton/M Middletown/M middleweight/SM middling/Y middy/SM Mideastern Mideast/M midfield/RM Midge/M midge/SM midget/MS midi/S midland/MRS Midland/MS midlife midlives midmorn/G midmost/S midnight/SYM midpoint/MS midrange midrib/MS midriff/MS mid/S midscale midsection/M midshipman/M midshipmen midship/S midspan midstream/MS midst/SM midsummer/MS midterm/MS midtown/MS Midway/M midway/S midweek/SYM Midwesterner/M Midwestern/ZR Midwest/M midwicket midwifery/SM midwife/SDMG midwinter/YMS midwives midyear/MS mien/M miff/GDS mightily mightiness/MS mightn't might/S mighty/TPR mignon mignonette/SM Mignon/M Mignonne/M migraine/SM migrant/MS migrate/ASDG migration/MS migrative migratory/S MIG/S Miguela/M Miguelita/M Miguel/M mikado/MS Mikaela/M Mikael/M mike/DSMG Mikel/M Mike/M Mikey/M Mikhail/M Mikkel/M Mikol/M Mikoyan/M milady/MS Milagros/M Milanese Milan/M milch/M mildew/DMGS mildness/MS Mildred/M Mildrid/M mild/STYRNP mileage/SM Milena/M milepost/SM miler/M mile/SM Mile/SM milestone/MS Milford/M Milicent/M milieu/SM Milissent/M militancy/MS militantness/M militant/YPS militarily militarism/SM militaristic militarist/MS militarization/SCM militarize/SDCG military militate/SDG militiaman/M militiamen militia/SM Milka/M Milken/M milker/M milk/GZSRDM milkiness/MS milkmaid/SM milkman/M milkmen milkshake/S milksop/SM milkweed/MS milky/RPT millage/S Millard/M Millay/M millenarian millenarianism/M millennial millennialism millennium/MS millepede's miller/M Miller/M Millet/M millet/MS milliamp milliampere/S milliard/MS millibar/MS Millicent/M millidegree/S Millie/M milligram/MS millijoule/S Millikan/M milliliter/MS Milli/M millimeter/SM milliner/SM millinery/MS milling/M millionaire/MS million/HDMS millionth/M millionths millipede/SM millisecond/MS Millisent/M millivoltmeter/SM millivolt/SM milliwatt/S millpond/MS millrace/SM mill/SGZMRD Mill/SMR millstone/SM millstream/SM millwright/MS Milly/M mil/MRSZ Mil/MY Milne/M Milo/M Milquetoast/S milquetoast/SM Miltiades/M Miltie/M Milt/M milt/MDSG Miltonic Milton/M Miltown/M Milty/M Milwaukee/M Milzie/M MIMD mime/DSRMG mimeograph/GMDS mimeographs mimer/M mimesis/M mimetic mimetically mimicked mimicker/SM mimicking mimicry/MS mimic/S Mimi/M mi/MNX Mimosa/M mimosa/SM Mina/M minaret/MS minatory mincemeat/MS mincer/M mince/SRDGZJ mincing/Y Minda/M Mindanao/M mind/ARDSZG mindbogglingly minded/P minder/M mindfully mindfulness/MS mindful/U mindlessness/SM mindless/YP Mindoro/M min/DRZGJ mind's mindset/S Mindy/M minefield/MS mineralization/C mineralized/U mineralogical mineralogist/SM mineralogy/MS mineral/SM miner/M Miner/M Minerva/M mineshaft mine/SNX minestrone/MS minesweeper/MS Minetta/M Minette/M mineworkers mingle/SDG Ming/M Mingus/M miniature/GMSD miniaturist/SM miniaturization/MS miniaturize/SDG minibike/S minibus/SM minicab/M minicam/MS minicomputer/SM minidress/SM minify/GSD minimalism/S minimalistic minimalist/MS minimality minimal/SY minima's minimax/M minimization/MS minimized/U minimizer/M minimize/RSDZG minim/SM minimum/MS mining/M minion/M mini/S miniseries miniskirt/MS ministerial/Y minister/MDGS ministrant/S ministration/SM ministry/MS minivan/S miniver/M minke mink/SM Min/MR Minna/M Minnaminnie/M Minneapolis/M Minne/M minnesinger/MS Minnesota/M Minnesotan/S Minnie/M Minni/M Minn/M Minnnie/M minnow/SM Minny/M Minoan/S Minolta/M minor/DMSG minority/MS Minor/M Minos Minotaur/M minotaur/S Minot/M minoxidil/S Minsk/M Minsky/M minster/SM minstrel/SM minstrelsy/MS mintage/SM Mintaka/M Minta/M minter/M mint/GZSMRD minty/RT minuend/SM minuet/SM Minuit/M minuscule/SM minus/S minuteman Minuteman/M minutemen minuteness/SM minute/RSDPMTYG minutiae minutia/M minx/MS Miocene MIPS Miquela/M Mirabeau/M Mirabella/M Mirabelle/M Mirabel/M Mirach/M miracle/MS miraculousness/M miraculous/PY mirage/GSDM Mira/M Miranda/M Miran/M Mireielle/M Mireille/M Mirella/M Mirelle/M mire/MGDS Mirfak/M Miriam/M Mirilla/M Mir/M Mirna/M Miro mirror/DMGS mirthfulness/SM mirthful/PY mirthlessness/M mirthless/YP mirth/M mirths MIRV/DSG miry/RT Mirzam/M misaddress/SDG misadventure/SM misalign/DSGL misalignment/MS misalliance/MS misanalysed misanthrope/MS misanthropic misanthropically misanthropist/S misanthropy/SM misapplier/M misapply/GNXRSD misapprehend/GDS misapprehension/MS misappropriate/GNXSD misbegotten misbehaver/M misbehave/RSDG misbehavior/SM misbrand/DSG misc miscalculate/XGNSD miscalculation/M miscall/SDG miscarriage/MS miscarry/SDG miscast/GS miscegenation/SM miscellanea miscellaneous/PY miscellany/MS Mischa/M mischance/MGSD mischief/MDGS mischievousness/MS mischievous/PY miscibility/S miscible/C misclassification/M misclassified misclassifying miscode/SDG miscommunicate/NDS miscomprehended misconceive/GDS misconception/MS misconduct/GSMD misconfiguration misconstruction/MS misconstrue/DSG miscopying miscount/DGS miscreant/MS miscue/MGSD misdeal/SG misdealt misdeed/MS misdemeanant/SM misdemeanor/SM misdiagnose/GSD misdid misdirect/GSD misdirection/MS misdirector/S misdoes misdo/JG misdone miserableness/SM miserable/SP miserably miser/KM miserliness/MS miserly/P misery/MS mises/KC misfeasance/MS misfeature/M misfield misfile/SDG misfire/SDG misfit/MS misfitted misfitting misfortune/SM misgauge/GDS misgiving/MYS misgovern/LDGS misgovernment/S misguidance/SM misguidedness/M misguided/PY misguide/DRSG misguider/M Misha/M mishandle/SDG mishap/MS mishapped mishapping misheard mishear/GS mishitting mishmash/SM misidentification/M misidentify/GNSD misinformation/SM misinform/GDS misinterpretation/MS misinterpreter/M misinterpret/RDSZG misjudge/DSG misjudging/Y misjudgment/MS Miskito mislabel/DSG mislaid mislay/GS misleader/M mislead/GRJS misleading/Y misled mismanage/LGSD mismanagement/MS mismatch/GSD misname/GSD misnomer/GSMD misogamist/MS misogamy/MS misogynistic misogynist/MS misogynous misogyny/MS misperceive/SD misplace/GLDS misplacement/MS misplay/GSD mispositioned misprint/SGDM misprision/SM mispronounce/DSG mispronunciation/MS misquotation/MS misquote/GDS misreader/M misread/RSGJ misrelated misremember/DG misreport/DGS misrepresentation/MS misrepresenter/M misrepresent/SDRG misroute/DS misrule/SDG missal/ESM misshape/DSG misshapenness/SM misshapen/PY Missie/M missile/MS missilery/SM mission/AMS missionary/MS missioned missioner/SM missioning missis's Mississauga/M Mississippian/S Mississippi/M missive/MS Missoula/M Missourian/S Missouri/M misspeak/SG misspecification misspecified misspelling/M misspell/SGJD misspend/GS misspent misspoke misspoken mis/SRZ miss/SDEGV Miss/SM misstate/GLDRS misstatement/MS misstater/M misstep/MS misstepped misstepping missus/SM Missy/M mistakable/U mistake/BMGSR mistaken/Y mistaker/M mistaking/Y Mistassini/M mister/GDM Mister/SM mistily Misti/M mistime/GSD mistiness/S mistletoe/MS mist/MRDGZS mistook mistral/MS mistranslated mistranslates mistranslating mistranslation/SM mistreat/DGSL mistreatment/SM Mistress/MS mistress/MSY mistrial/SM mistruster/M mistrustful/Y mistrust/SRDG Misty/M mistype/SDGJ misty/PRT misunderstander/M misunderstanding/M misunderstand/JSRZG misunderstood misuser/M misuse/RSDMG miswritten Mitchael/M Mitchell/M Mitchel/M Mitch/M miterer/M miter/GRDM mite/SRMZ Mitford/M Mithra/M Mithridates/M mitigated/U mitigate/XNGVDS mitigation/M MIT/M mitoses mitosis/M mitotic MITRE/SM Mitsubishi/M mitten/M Mitterrand/M mitt/XSMN Mitty/M Mitzi/M mitzvahs mixable mix/AGSD mixed/U mixer/SM mixture/SM Mizar/M mizzenmast/SM mizzen/MS Mk mks ml Mlle/M mm MM MMe Mme/SM MN mnemonically mnemonics/M mnemonic/SM Mnemosyne/M Mn/M MO moan/GSZRDM moat/SMDG mobbed mobber mobbing mobcap/SM Mobile/M mobile/S mobility/MS mobilizable mobilization/AMCS mobilize/CGDS mobilized/U mobilizer/MS mobilizes/A Mobil/M mob/MS mobster/MS Mobutu/M moccasin/SM mocha/SM mockers/M mockery/MS mock/GZSRD mockingbird/MS mocking/Y mo/CSK modality/MS modal/Y modeled/A modeler/M modeling/M models/A model/ZGSJMRD mode/MS modem/SM moderated/U moderateness/SM moderate/PNGDSXY moderation/M moderator/MS modernism/MS modernistic modernist/S modernity/SM modernization/MS modernized/U modernizer/M modernize/SRDGZ modernizes/U modernness/SM modern/PTRYS Modesta/M Modestia/M Modestine/M Modesto/M modest/TRY Modesty/M modesty/MS modicum/SM modifiability/M modifiableness/M modifiable/U modification/M modified/U modifier/M modify/NGZXRSD Modigliani/M modishness/MS modish/YP mod/TSR Modula/M modularity/SM modularization modularize/SDG modular/SY modulate/ADSNCG modulation/CMS modulator/ACSM module/SM moduli modulo modulus/M modus Moe/M Moen/M Mogadiscio's Mogadishu mogul/MS Mogul/MS mohair/SM Mohamed/M Mohammad/M Mohammedanism/MS Mohammedan/SM Mohammed's Mohandas/M Mohandis/M Mohawk/MS Mohegan/S Mohican's Moho/M Mohorovicic/M Mohr/M moiety/MS moil/SGD Moina/M Moines/M Moira/M moire/MS Moise/MS Moiseyev/M Moishe/M moistener/M moisten/ZGRD moistness/MS moist/TXPRNY moisture/MS moisturize/GZDRS Mojave/M molal molarity/SM molar/MS molasses/MS Moldavia/M Moldavian/S moldboard/SM molder/DG moldiness/SM molding/M mold/MRDJSGZ Moldova moldy/PTR molecularity/SM molecular/Y molecule/MS molehill/SM mole/MTS moleskin/MS molestation/SM molested/U molester/M molest/RDZGS Moliere Molina/M Moline/M Mollee/M Mollie/M mollification/M mollify/XSDGN Molli/M Moll/M moll/MS mollusc's mollusk/S mollycoddler/M mollycoddle/SRDG Molly/M molly/SM Molnar/M Moloch/M Molokai/M Molotov/M molter/M molt/RDNGZS Moluccas molybdenite/M molybdenum/MS Mombasa/M momenta momentarily momentariness/SM momentary/P moment/MYS momentousness/MS momentous/YP momentum/SM momma/S Mommy/M mommy/SM Mo/MN mom/SM Monaco/M monadic monad/SM Monah/M Mona/M monarchic monarchical monarchism/MS monarchistic monarchist/MS monarch/M monarchs monarchy/MS Monash/M monastery/MS monastical/Y monasticism/MS monastic/S monaural/Y Mondale/M Monday/MS Mondrian/M Monegasque/SM Monera/M monetarily monetarism/S monetarist/MS monetary monetization/CMA monetize/CGADS Monet/M moneybag/SM moneychangers moneyer/M moneylender/SM moneymaker/MS moneymaking/MS money/SMRD Monfort/M monger/SGDM Mongolia/M Mongolian/S Mongolic/M mongolism/SM mongoloid/S Mongoloid/S Mongol/SM mongoose/SM mongrel/SM Monica/M monies/M Monika/M moniker/MS Monique/M monism/MS monist/SM monition/SM monitored/U monitor/GSMD monitory/S monkeyshine/S monkey/SMDG monkish Monk/M monk/MS monkshood/SM Monmouth/M monochromatic monochromator monochrome/MS monocle/SDM monoclinic monoclonal/S monocotyledonous monocotyledon/SM monocular/SY monodic monodist/S monody/MS monogamist/MS monogamous/PY monogamy/MS monogrammed monogramming monogram/MS monograph/GMDS monographs monolingualism monolingual/S monolithic monolithically monolith/M monoliths monologist/S monologue/GMSD monomaniacal monomaniac/MS monomania/MS monomeric monomer/SM monomial/SM mono/MS Monongahela/M mononuclear mononucleoses mononucleosis/M monophonic monoplane/MS monopole/S monopolistic monopolist/MS monopolization/MS monopolized/U monopolize/GZDSR monopolizes/U monopoly/MS monorail/SM monostable monosyllabic monosyllable/MS monotheism/SM monotheistic monotheist/S monotone/SDMG monotonic monotonically monotonicity monotonousness/MS monotonous/YP monotony/MS monovalent monoxide/SM Monroe/M Monro/M Monrovia/M Monsanto/M monseigneur monsieur/M Monsignori Monsignor/MS monsignor/S Mon/SM monsoonal monsoon/MS monster/SM monstrance/ASM monstrosity/SM monstrousness/M monstrous/YP montage/SDMG Montague/M Montaigne/M Montana/M Montanan/MS Montcalm/M Montclair/M Monte/M Montenegrin Montenegro/M Monterey/M Monterrey/M Montesquieu/M Montessori/M Monteverdi/M Montevideo/M Montezuma Montgomery/M monthly/S month/MY months Monticello/M Monti/M Mont/M Montmartre/M Montoya/M Montpelier/M Montrachet/M Montreal/M Montserrat/M Monty/M monumentality/M monumental/Y monument/DMSG mooch/ZSRDG moodily moodiness/MS mood/MS Moody/M moody/PTR Moog moo/GSD moonbeam/SM Mooney/M moon/GDMS moonless moonlight/GZDRMS moonlighting/M moonlit Moon/M moonscape/MS moonshiner/M moonshine/SRZM moonshot/MS moonstone/SM moonstruck moonwalk/SDG Moore/M moor/GDMJS mooring/M Moorish moorland/MS Moor/MS moose/M moot/RDGS moped/MS moper/M mope/S mopey mopier mopiest mopish mopped moppet/MS mopping mop/SZGMDR moraine/MS morale/MS Morales/M moralistic moralistically moralist/MS morality/UMS moralization/CS moralize/CGDRSZ moralled moraller moralling moral/SMY Mora/M Moran/M morass/SM moratorium/SM Moravia/M Moravian moray/SM morbidity/SM morbidness/S morbid/YP mordancy/MS mordant/GDYS Mordecai/M Mord/M Mordred/M Mordy/M more/DSN Moreen/M Morehouse/M Moreland/M morel/SM More/M Morena/M Moreno/M moreover Morey/M Morgana/M Morganica/M Morgan/MS Morganne/M morgen/M Morgen/M morgue/SM Morgun/M Moria/M Moriarty/M moribundity/M moribund/Y Morie/M Morin/M morion/M Morison/M Morissa/M Morita/M Moritz/M Morlee/M Morley/M Morly/M Mormonism/MS Mormon/SM Morna/M morning/MY morn/SGJDM Moroccan/S Morocco/M morocco/SM Moro/M moronic moronically Moroni/M moron/SM moroseness/MS morose/YP morpheme/DSMG morphemic/S Morpheus/M morph/GDJ morphia/S morphine/MS morphism/MS morphologic morphological/Y morphology/MS morphophonemic/S morphophonemics/M morphs Morrie/M morris Morris/M Morrison/M Morristown/M Morrow/M morrow/MS Morry/M morsel/GMDS Morse/M mortality/SM mortal/SY mortarboard/SM mortar/GSDM Morten/M mortgageable mortgagee/SM mortgage/MGDS mortgagor/SM mortice's mortician/SM Mortie/M mortification/M mortified/Y mortifier/M mortify/DRSXGN Mortimer/M mortise/MGSD Mort/MN Morton/M mortuary/MS Morty/M Mosaic mosaicked mosaicking mosaic/MS Moscone/M Moscow/M Moseley/M Moselle/M Mose/MSR Moser/M mosey/SGD Moshe/M Moslem's Mosley/M mosque/SM mosquitoes mosquito/M mos/S mossback/MS Mossberg/M Moss/M moss/SDMG mossy/SRT most/SY Mosul/M mote/ASCNK motel/MS mote's motet/SM mothball/DMGS motherboard/MS motherfucker/MS! motherfucking/! motherhood/SM mothering/M motherland/SM motherless motherliness/MS motherly/P mother/RDYMZG moths moth/ZMR motif/MS motile/S motility/MS motional/K motioner/M motion/GRDMS motionlessness/S motionless/YP motion's/ACK motions/K motivated/U motivate/XDSNGV motivational/Y motivation/M motivator/S motiveless motive/MGSD motley/S motlier motliest mot/MSV motocross/SM motorbike/SDGM motorboat/MS motorcade/MSDG motorcar/MS motorcycle/GMDS motorcyclist/SM motor/DMSG motoring/M motorist/SM motorization/SM motorize/DSG motorized/U motorman/M motormen motormouth motormouths Motorola/M motorway/SM Motown/M mottle/GSRD mottler/M Mott/M mottoes motto/M moue/DSMG moulder/DSG moult/GSD mound/GMDS mountable mountaineering/M mountaineer/JMDSG mountainousness/M mountainous/PY mountainside/MS mountain/SM mountaintop/SM Mountbatten/M mountebank/SGMD mounted/U mount/EGACD mounter/SM mounties Mountie/SM mounting/MS Mount/M mounts/AE mourner/M mournfuller mournfullest mournfulness/S mournful/YP mourning/M mourn/ZGSJRD mouser/M mouse/SRDGMZ mousetrapped mousetrapping mousetrap/SM mousiness/MS mousing/M mousse/MGSD Moussorgsky/M mousy/PRT Mouthe/M mouthful/MS mouthiness/SM mouth/MSRDG mouthorgan mouthpiece/SM mouths mouthwash/SM mouthwatering mouthy/PTR Mouton/M mouton/SM movable/ASP movableness/AM move/ARSDGZB moved/U movement/SM mover/AM moviegoer/S movie/SM moving/YS mower/M Mowgli/M mowing/M mow/SDRZG moxie/MS Moyer/M Moyna/M Moyra/M Mozambican/S Mozambique/M Mozart/M Mozelle/M Mozes/M Mozilla/M mozzarella/MS mp MP mpg mph MPH MRI Mr/M Mrs ms M's MS MSG Msgr/M m's/K Ms/S MST MSW mt MT mtg mtge Mt/M MTS MTV Muawiya/M Mubarak/M muchness/M much/SP mucilage/MS mucilaginous mucker/M muck/GRDMS muckraker/M muckrake/ZMDRSG mucky/RT mucosa/M mucous mucus/SM mudded muddily muddiness/SM mudding muddle/GRSDZ muddleheaded/P muddlehead/SMD muddler/M muddy/TPGRSD mudflat/S mudguard/SM mudlarks mud/MS mudroom/S mudslide/S mudslinger/M mudslinging/M mudsling/JRGZ Mueller/M Muenster muenster/MS muesli/M muezzin/MS muff/GDMS Muffin/M muffin/SM muffler/M muffle/ZRSDG Mufi/M Mufinella/M mufti/MS Mugabe/M mugged mugger/SM mugginess/S mugging/S muggy/RPT mugshot/S mug/SM mugwump/MS Muhammadanism/S Muhammadan/SM Muhammad/M Muire/M Muir/M Mukden/M mukluk/SM mulattoes mulatto/M mulberry/MS mulch/GMSD mulct/SDG Mulder/M mule/MGDS muleskinner/S muleteer/MS mulishness/MS mulish/YP mullah/M mullahs mullein/MS Mullen/M muller/M Muller/M mullet/MS Mulligan/M mulligan/SM mulligatawny/SM Mullikan/M Mullins mullion/MDSG mull/RDSG Multan/M multi Multibus/M multicellular multichannel/M multicollinearity/M multicolor/SDM multicolumn multicomponent multicomputer/MS Multics/M MULTICS/M multicultural multiculturalism/S multidimensional multidimensionality multidisciplinary multifaceted multifamily multifariousness/SM multifarious/YP multifigure multiform multifunction/D multilateral/Y multilayer multilevel/D multilingual multilingualism/S multimedia/S multimegaton/M multimeter/M multimillionaire/SM multinational/S multinomial/M multiphase multiple/SM multiplet/SM multiplex/GZMSRD multiplexor's multipliable multiplicand/SM multiplication/M multiplicative/YS multiplicity/MS multiplier/M multiply/ZNSRDXG multiprocess/G multiprocessor/MS multiprogram multiprogrammed multiprogramming/MS multipurpose multiracial multistage multistory/S multisyllabic multitasking/S multitude/MS multitudinousness/M multitudinous/YP multiuser multivalent multivalued multivariate multiversity/M multivitamin/S mu/M mumbler/M mumbletypeg/S mumble/ZJGRSD Mumford/M mummed mummer/SM mummery/MS mummification/M mummify/XSDGN mumming mum/MS mummy/GSDM mumps/M muncher/M Münchhausen/M munchies Munch/M munch/ZRSDG Muncie/M mundane/YSP Mundt/M munge/JGZSRD Munich/M municipality/SM municipal/YS munificence/MS munificent/Y munition/SDG Munmro/M Munoz/M Munroe/M Munro/M mun/S Munsey/M Munson/M Munster/MS Muong/M muon/M Muppet/M muralist/SM mural/SM Murasaki/M Murat/M Murchison/M Murcia/M murderer/M murderess/S murder/GZRDMS murderousness/M murderous/YP Murdoch/M Murdock/M Mureil/M Murial/M muriatic Murielle/M Muriel/M Murillo/M murkily murkiness/S murk/TRMS murky/RPT Murmansk/M murmurer/M murmuring/U murmurous murmur/RDMGZSJ Murphy/M murrain/SM Murray/M Murrow/M Murrumbidgee/M Murry/M Murvyn/M muscatel/MS Muscat/M muscat/SM musclebound muscle/SDMG Muscovite/M muscovite/MS Muscovy/M muscularity/SM muscular/Y musculature/SM muse Muse/M muser/M musette/SM museum/MS mus/GJDSR musher/M mushiness/MS mush/MSRDG mushroom/DMSG mushy/PTR Musial/M musicale/SM musicality/SM musicals musical/YU musician/MYS musicianship/MS musicked musicking musicological musicologist/MS musicology/MS music/SM musing/Y Muskegon/M muskeg/SM muskellunge/SM musketeer/MS musketry/MS musket/SM musk/GDMS muskie/M muskiness/MS muskmelon/MS muskox/N muskrat/MS musky/RSPT Muslim/MS muslin/MS mussel/MS Mussolini/MS Mussorgsky/M muss/SDG mussy/RT mustache/DSM mustachio/MDS mustang/MS mustard/MS muster/GD mustily mustiness/MS mustn't must/RDGZS must've musty/RPT mutability/SM mutableness/M mutable/P mutably mutagen/SM mutant/MS mutate/XVNGSD mutational/Y mutation/M mutator/S muted/Y muteness/S mute/PDSRBYTG mutilate/XDSNG mutilation/M mutilator/MS mutineer/SMDG mutinous/Y mutiny/MGSD Mutsuhito/M mutterer/M mutter/GZRDJ muttonchops mutton/SM mutt/ZSMR mutuality/S mutual/SY muumuu/MS muzak Muzak/SM Muzo/M muzzled/U muzzle/MGRSD muzzler/M MVP MW Myanmar Mycah/M Myca/M Mycenaean Mycenae/M Mychal/M mycologist/MS mycology/MS myelitides myelitis/M Myer/MS myers mylar Mylar/S Myles/M Mylo/M My/M myna/SM Mynheer/M myocardial myocardium/M myopia/MS myopically myopic/S Myrah/M Myra/M Myranda/M Myrdal/M myriad/S Myriam/M Myrilla/M Myrle/M Myrlene/M myrmidon/S Myrna/M Myron/M myrrh/M myrrhs Myrta/M Myrtia/M Myrtice/M Myrtie/M Myrtle/M myrtle/SM Myrvyn/M Myrwyn/M mys my/S myself Mysore/M mysteriousness/MS mysterious/YP mystery/MDSG mystical/Y mysticism/MS mystic/SM mystification/M mystifier/M mystify/CSDGNX mystifying/Y mystique/MS Myst/M mythic mythical/Y myth/MS mythographer/SM mythography/M mythological/Y mythologist/MS mythologize/CSDG mythology/SM myths N NAACP nabbed nabbing Nabisco/M nabob/SM Nabokov/M nab/S nacelle/SM nacho/S NaCl/M nacre/MS nacreous Nada/M Nadean/M Nadeen/M Nader/M Nadia/M Nadine/M nadir/SM Nadiya/M Nadya/M Nady/M nae/VM Nagasaki/M nagged nagger/S nagging/Y nag/MS Nagoya/M Nagpur/M Nagy/M Nahuatl/SM Nahum/M naiad/SM naifs nailbrush/SM nailer/M nail/SGMRD Naipaul/M Nair/M Nairobi/M Naismith/M naive/SRTYP naiveté/SM naivety/MS Nakamura/M Nakayama/M nakedness/MS naked/TYRP Nakoma/M Nalani/M Na/M Namath/M nameable/U name/ADSG namedrop namedropping named's named/U nameless/PY namely nameplate/MS namer/SM name's namesake/SM Namibia/M Namibian/S naming/M Nam/M Nanak/M Nana/M Nananne/M Nancee/M Nance/M Nancey/M Nanchang/M Nancie/M Nanci/M Nancy/M Nanete/M Nanette/M Nanice/M Nani/M Nanine/M Nanjing Nanking's Nan/M Nannette/M Nannie/M Nanni/M Nanny/M nanny/SDMG nanometer/MS Nanon/M Nanook/M nanosecond/SM Nansen/M Nantes/M Nantucket/M Naoma/M Naomi/M napalm/MDGS nape/SM Naphtali/M naphthalene/MS naphtha/SM Napier/M napkin/SM Naples/M napless Nap/M Napoleonic napoleon/MS Napoleon/MS napped napper/MS Nappie/M napping Nappy/M nappy/TRSM nap/SM Nara/M Narbonne/M narc/DGS narcissism/MS narcissistic narcissist/MS narcissus/M Narcissus/M narcoleptic narcoses narcosis/M narcotic/SM narcotization/S narcotize/GSD Nariko/M Nari/M nark's Narmada/M Narragansett/M narrate/VGNSDX narration/M narrative/MYS narratology narrator/SM narrowing/P narrowness/SM narrow/RDYTGPS narwhal/MS nary nasality/MS nasalization/MS nasalize/GDS nasal/YS NASA/MS nascence/ASM nascent/A NASDAQ Nash/M Nashua/M Nashville/M Nassau/M Nasser/M nastily nastiness/MS nasturtium/SM nasty/TRSP natal Natala/M Natalee/M Natale/M Natalia/M Natalie/M Natalina/M Nataline/M natalist natality/M Natal/M Natalya/M Nata/M Nataniel/M Natasha/M Natassia/M Natchez natch/S Nate/XMN Nathalia/M Nathalie/M Nathanael/M Nathanial/M Nathaniel/M Nathanil/M Nathan/MS nationalism/SM nationalistic nationalistically nationalist/MS nationality/MS nationalization/MS nationalize/CSDG nationalized/AU nationalizer/SM national/YS nationhood/SM nation/MS nationwide nativeness/M native/PYS Natividad/M Nativity/M nativity/MS Natka/M natl Nat/M NATO/SM natter/SGD nattily nattiness/SM Natty/M natty/TRP naturalism/MS naturalistic naturalist/MS naturalization/SM naturalized/U naturalize/GSD naturalness/US natural/PUY naturals nature/ASDCG nature's naturist Naugahyde/S naughtily naughtiness/SM naught/MS naughty/TPRS Naur/M Nauru/M nausea/SM nauseate/DSG nauseating/Y nauseousness/SM nauseous/P nautical/Y nautilus/MS Navaho's Navajoes Navajo/S naval/Y Navarro/M navel/MS nave/SM navigability/SM navigableness/M navigable/P navigate/DSXNG navigational navigation/M navigator/MS Navona/M Navratilova/M navvy/M Navy/S navy/SM nay/MS naysayer/S Nazarene/MS Nazareth/M Nazi/SM Nazism/S NB NBA NBC Nb/M NBS NC NCAA NCC NCO NCR ND N'Djamena Ndjamena/M Nd/M Ne NE Neala/M Neale/M Neall/M Neal/M Nealon/M Nealson/M Nealy/M Neanderthal/S neap/DGS Neapolitan/SM nearby nearly/RT nearness/MS nearside/M nearsightedness/S nearsighted/YP near/TYRDPSG neaten/DG neath neatness/MS neat/YRNTXPS Neb/M Nebraska/M Nebraskan/MS Nebr/M Nebuchadnezzar/MS nebulae nebula/M nebular nebulousness/SM nebulous/PY necessaries necessarily/U necessary/U necessitate/DSNGX necessitation/M necessitous necessity/SM neckband/M neckerchief/MS neck/GRDMJS necking/M necklace/DSMG neckline/MS necktie/MS necrology/SM necromancer/MS necromancy/MS necromantic necrophiliac/S necrophilia/M necropolis/SM necropsy/M necroses necrosis/M necrotic nectarine/SM nectarous nectar/SM nectary/MS Neda/M Nedda/M Neddie/M Neddy/M Nedi/M Ned/M née needed/U needer/M needful/YSP Needham/M neediness/MS needlecraft/M needle/GMZRSD needlepoint/SM needlessness/S needless/YP needlewoman/M needlewomen needlework/RMS needn't need/YRDGS needy/TPR Neel/M Neely/M ne'er nefariousness/MS nefarious/YP Nefen/M Nefertiti/M negated/U negater/M negate/XRSDVNG negation/M negativeness/SM negative/PDSYG negativism/MS negativity/MS negator/MS Negev/M neglecter/M neglectfulness/SM neglectful/YP neglect/SDRG negligee/SM negligence/MS negligent/Y negligibility/M negligible negligibly negotiability/MS negotiable/A negotiant/M negotiate/ASDXGN negotiation/MA negotiator/MS Negress/MS negritude/MS Negritude/S Negroes negroid Negroid/S Negro/M neg/S Nehemiah/M Nehru/M neighbored/U neighborer/M neighborhood/SM neighborlinesses neighborliness/UM neighborly/UP neighbor/SMRDYZGJ neigh/MDG neighs Neila/M Neile/M Neilla/M Neille/M Neill/M Neil/SM neither Nelda/M Nelia/M Nelie/M Nelle/M Nellie/M Nelli/M Nell/M Nelly/M Nelsen/M Nels/N Nelson/M nelson/MS nematic nematode/SM Nembutal/M nemeses nemesis Nemesis/M neoclassical neoclassicism/MS neoclassic/M neocolonialism/MS neocortex/M neodymium/MS Neogene neolithic Neolithic/M neologism/SM neomycin/M neonatal/Y neonate/MS neon/DMS neophyte/MS neoplasm/SM neoplastic neoprene/SM Nepalese Nepali/MS Nepal/M nepenthe/MS nephew/MS nephrite/SM nephritic nephritides nephritis/M nepotism/MS nepotist/S Neptune/M neptunium/MS nerd/S nerdy/RT Nereid/M Nerf/M Nerissa/M Nerita/M Nero/M Neron/M Nerta/M Nerte/M Nertie/M Nerti/M Nert/M Nerty/M Neruda/M nervelessness/SM nerveless/YP nerve's nerve/UGSD nerviness/SM nerving/M nervousness/SM nervous/PY nervy/TPR Nessa/M Nessie/M Nessi/M Nessy/M Nesta/M nester/M Nester/M Nestle/M nestler/M nestle/RSDG nestling/M Nestorius/M Nestor/M nest/RDGSBM netball/M nether Netherlander/SM Netherlands/M nethermost netherworld/S Netscape/M net/SM Netta/M Nettie/M Netti/M netting/M nett/JGRDS Nettle/M nettle/MSDG nettlesome Netty/M network/SJMDG Netzahualcoyotl/M Neumann/M neuralgia/MS neuralgic neural/Y neurasthenia/MS neurasthenic/S neuritic/S neuritides neuritis/M neuroanatomy neurobiology/M neurological/Y neurologist/MS neurology/SM neuromuscular neuronal neurone/S neuron/MS neuropathology/M neurophysiology/M neuropsychiatric neuroses neurosis/M neurosurgeon/MS neurosurgery/SM neurotically neurotic/S neurotransmitter/S neuter/JZGRD neutralise's neutralism/MS neutralist/S neutrality/MS neutralization/MS neutralized/U neutralize/GZSRD neutral/PYS neutrino/MS neutron/MS neut/ZR Nevada/M Nevadan/S Nevadian/S Neva/M never nevermore nevertheless nevi Nevile/M Neville/M Nevil/M Nevin/SM Nevis/M Nev/M Nevsa/M Nevsky/M nevus/M Newark/M newbie/S newborn/S Newbury/M Newburyport/M Newcastle/M newcomer/MS newed/A Newell/M newel/MS newer/A newfangled newfound newfoundland Newfoundlander/M Newfoundland/SRMZ newish newline/SM newlywed/MS Newman/M newness/MS Newport/M news/A newsagent/MS newsboy/SM newscaster/M newscasting/M newscast/SRMGZ newsdealer/MS newsed newses newsflash/S newsgirl/S newsgroup/SM newsing newsletter/SM NeWS/M newsman/M newsmen newspaperman/M newspapermen newspaper/SMGD newspaperwoman/M newspaperwomen newsprint/MS new/SPTGDRY newsreader/MS newsreel/SM newsroom/S news's newsstand/MS Newsweekly/M newsweekly/S Newsweek/MY newswire newswoman/M newswomen newsworthiness/SM newsworthy/RPT newsy/TRS newt/MS Newtonian Newton/M newton/SM Nexis/M next nexus/SM Neysa/M NF NFC NFL NFS Ngaliema/M Nguyen/M NH NHL niacin/SM Niagara/M Niall/M Nial/M Niamey/M nibbed nibbing nibbler/M nibble/RSDGZ Nibelung/M nib/SM Nicaean Nicaragua/M Nicaraguan/S Niccolo/M Nice/M Nicene niceness/MS nicety/MS nice/YTPR niche/SDGM Nicholas Nichole/M Nicholle/M Nichol/MS Nicholson/M nichrome nickelodeon/SM nickel/SGMD nicker/GD Nickey/M nick/GZRDMS Nickie/M Nicki/M Nicklaus/M Nick/M nicknack's nickname/MGDRS nicknamer/M Nickolai/M Nickola/MS Nickolaus/M Nicko/M Nicky/M Nicobar/M Nicodemus/M Nicolai/MS Nicola/MS Nicolea/M Nicole/M Nicolette/M Nicoli/MS Nicolina/M Nicoline/M Nicolle/M Nicol/M Nico/M Nicosia/M nicotine/MS Niebuhr/M niece/MS Niel/MS Nielsen/M Niels/N Nielson/M Nietzsche/M Nieves/M nifty/TRS Nigel/M Nigeria/M Nigerian/S Nigerien Niger/M niggardliness/SM niggardly/P niggard/SGMDY nigger/SGDM! niggler/M niggle/RSDGZJ niggling/Y nigh/RDGT nighs nightcap/SM nightclothes nightclubbed nightclubbing nightclub/MS nightdress/MS nightfall/SM nightgown/MS nighthawk/MS nightie/MS Nightingale/M nightingale/SM nightlife/MS nightlong nightmare/MS nightmarish/Y nightshade/SM nightshirt/MS night/SMYDZ nightspot/MS nightstand/SM nightstick/S nighttime/S nightwear/M nighty's NIH nihilism/MS nihilistic nihilist/MS Nijinsky/M Nikaniki/M Nike/M Niki/M Nikita/M Nikkie/M Nikki/M Nikko/M Nikolai/M Nikola/MS Nikolaos/M Nikolaus/M Nikolayev's Nikoletta/M Nikolia/M Nikolos/M Niko/MS Nikon/M Nile/SM nilled nilling Nil/MS nil/MYS nilpotent Nilsen/M Nils/N Nilson/M Nilsson/M Ni/M nimbi nimbleness/SM nimble/TRP nimbly nimbus/DM NIMBY Nimitz/M Nimrod/MS Nina/M nincompoop/MS ninefold nine/MS ninepence/M ninepin/S ninepins/M nineteen/SMH nineteenths ninetieths Ninetta/M Ninette/M ninety/MHS Nineveh/M ninja/S Ninnetta/M Ninnette/M ninny/SM Ninon/M Nintendo/M ninth ninths Niobe/M niobium/MS nipped nipper/DMGS nippiness/S nipping/Y nipple/GMSD Nipponese Nippon/M nippy/TPR nip/S Nirenberg/M nirvana/MS Nirvana/S nisei Nisei/MS Nissa/M Nissan/M Nisse/M Nissie/M Nissy/M Nita/M niter/M nitpick/DRSJZG nitrate/MGNXSD nitration/M nitric nitride/MGS nitriding/M nitrification/SM nitrite/MS nitrocellulose/MS nitrogenous nitrogen/SM nitroglycerin/MS nitrous nitwit/MS nit/ZSMR Niven/M nixer/M nix/GDSR Nixie/M Nixon/M NJ Nkrumah/M NLRB nm NM no/A NOAA Noach/M Noah/M Noak/M Noami/M Noam/M Nobelist/SM nobelium/MS Nobel/M Nobe/M Nobie/M nobility/MS Noble/M nobleman/M noblemen nobleness/SM noblesse/M noble/TPSR noblewoman noblewomen nob/MY nobody/MS Noby/M nocturnal/SY nocturne/SM nodal/Y nodded nodding noddle/MSDG noddy/M node/MS NoDoz/M nod/SM nodular nodule/SM Noelani/M Noella/M Noelle/M Noell/M Noellyn/M Noel/MS noel/S Noelyn/M Noe/M Noemi/M noes/S noggin/SM nohow noise/GMSD noiselessness/SM noiseless/YP noisemaker/M noisemake/ZGR noisily noisiness/MS noisome noisy/TPR Nola/M Nolana/M Noland/M Nolan/M Nolie/M Nollie/M Noll/M Nolly/M No/M nomadic nomad/SM Nome/M nomenclature/MS Nomi/M nominalized nominal/K nominally nominals nominate/CDSAXNG nomination/MAC nominative/SY nominator/CSM nominee/MS non nonabrasive nonabsorbent/S nonacademic/S nonacceptance/MS nonacid/MS nonactive nonadaptive nonaddictive nonadhesive nonadjacent nonadjustable nonadministrative nonage/MS nonagenarian/MS nonaggression/SM nonagricultural Nonah/M nonalcoholic/S nonaligned nonalignment/SM nonallergic Nona/M nonappearance/MS nonassignable nonathletic nonattendance/SM nonautomotive nonavailability/SM nonbasic nonbeliever/SM nonbelligerent/S nonblocking nonbreakable nonburnable nonbusiness noncaloric noncancerous noncarbohydrate/M nonce/MS nonchalance/SM nonchalant/YP nonchargeable nonclerical/S nonclinical noncollectable noncombatant/MS noncombustible/S noncommercial/S noncommissioned noncommittal/Y noncom/MS noncommunicable noncompeting noncompetitive noncompliance/MS noncomplying/S noncomprehending nonconducting nonconductor/MS nonconforming nonconformist/SM nonconformity/SM nonconsecutive nonconservative nonconstructive noncontagious noncontiguous noncontinuous noncontributing noncontributory noncontroversial nonconvertible noncooperation/SM noncorroding/S noncorrosive noncredit noncriminal/S noncritical noncrystalline noncumulative noncustodial noncyclic nondairy nondecreasing nondeductible nondelivery/MS nondemocratic nondenominational nondepartmental nondepreciating nondescript/YS nondestructive/Y nondetachable nondeterminacy nondeterminate/Y nondeterminism nondeterministic nondeterministically nondisciplinary nondisclosure/SM nondiscrimination/SM nondiscriminatory nondramatic nondrinker/SM nondrying nondurable noneconomic noneducational noneffective/S nonelastic nonelectrical nonelectric/S nonemergency nonempty nonenforceable nonentity/MS nonequivalence/M nonequivalent/S none/S nones/M nonessential/S nonesuch/SM nonetheless nonevent/MS nonexchangeable nonexclusive nonexempt nonexistence/MS nonexistent nonexplosive/S nonextensible nonfactual nonfading nonfat nonfatal nonfattening nonferrous nonfictional nonfiction/SM nonflammable nonflowering nonfluctuating nonflying nonfood/M nonfreezing nonfunctional nongovernmental nongranular nonhazardous nonhereditary nonhuman nonidentical Nonie/M Noni/M noninclusive nonindependent nonindustrial noninfectious noninflammatory noninflationary noninflected nonintellectual/S noninteracting noninterchangeable noninterference/MS nonintervention/SM nonintoxicating nonintuitive noninvasive nonionic nonirritating nonjudgmental nonjudicial nonlegal nonlethal nonlinearity/MS nonlinear/Y nonlinguistic nonliterary nonliving nonlocal nonmagical nonmagnetic nonmalignant nonmember/SM nonmetallic nonmetal/MS nonmigratory nonmilitant/S nonmilitary Nonnah/M Nonna/M nonnarcotic/S nonnative/S nonnegative nonnegotiable nonnuclear nonnumerical/S nonobjective nonobligatory nonobservance/MS nonobservant nonoccupational nonoccurence nonofficial nonogenarian nonoperational nonoperative nonorthogonal nonorthogonality nonparallel/S nonparametric nonpareil/SM nonparticipant/SM nonparticipating nonpartisan/S nonpaying nonpayment/SM nonperformance/SM nonperforming nonperishable/S nonperson/S nonperturbing nonphysical/Y nonplus/S nonplussed nonplussing nonpoisonous nonpolitical nonpolluting nonporous nonpracticing nonprejudicial nonprescription nonprocedural/Y nonproductive nonprofessional/S nonprofit/SB nonprogrammable nonprogrammer nonproliferation/SM nonpublic nonpunishable nonracial nonradioactive nonrandom nonreactive nonreciprocal/S nonreciprocating nonrecognition/SM nonrecoverable nonrecurring nonredeemable nonreducing nonrefillable nonrefundable nonreligious nonrenewable nonrepresentational nonresidential nonresident/SM nonresidual nonresistance/SM nonresistant/S nonrespondent/S nonresponse nonrestrictive nonreturnable/S nonrhythmic nonrigid nonsalaried nonscheduled nonscientific nonscoring nonseasonal nonsectarian nonsecular nonsegregated nonsense/MS nonsensicalness/M nonsensical/PY nonsensitive nonsexist nonsexual nonsingular nonskid nonslip nonsmoker/SM nonsmoking nonsocial nonspeaking nonspecialist/MS nonspecializing nonspecific nonspiritual/S nonstaining nonstandard nonstarter/SM nonstick nonstop nonstrategic nonstriking nonstructural nonsuccessive nonsupervisory nonsupport/GS nonsurgical nonsustaining nonsympathizer/M nontarnishable nontaxable/S nontechnical/Y nontenured nonterminal/MS nonterminating nontermination/M nontheatrical nonthinking/S nonthreatening nontoxic nontraditional nontransferable nontransparent nontrivial nontropical nonuniform nonunion/S nonuser/SM nonvenomous nonverbal/Y nonveteran/MS nonviable nonviolence/SM nonviolent/Y nonvirulent nonvocal nonvocational nonvolatile nonvolunteer/S nonvoter/MS nonvoting nonwhite/SM nonworking nonyielding nonzero noodle/GMSD nook/MS noonday/MS noon/GDMS nooning/M noontide/MS noontime/MS noose/SDGM nope/S NORAD/M noradrenalin noradrenaline/M Norah/M Nora/M Norbert/M Norberto/M Norbie/M Norby/M Nordhoff/M Nordic/S Nordstrom/M Norean/M Noreen/M Norene/M Norfolk/M nor/H Norina/M Norine/M normalcy/MS normality/SM normalization/A normalizations normalization's normalized/AU normalizes/AU normalize/SRDZGB normal/SY Norma/M Normand/M Normandy/M Norman/SM normativeness/M normative/YP Normie/M norm/SMGD Normy/M Norplant Norrie/M Norri/SM Norristown/M Norry/M Norse Norseman/M Norsemen Northampton/M northbound northeastern northeaster/YM Northeast/SM northeastward/S northeast/ZSMR northerly/S norther/MY Northerner/M northernmost northern/RYZS Northfield/M northing/M northland North/M northmen north/MRGZ Northrop/M Northrup/M norths Norths Northumberland/M northward/S northwestern northwester/YM northwest/MRZS Northwest/MS northwestward/S Norton/M Norwalk/M Norway/M Norwegian/S Norwich/M Norw/M nosebag/M nosebleed/SM nosecone/S nosedive/DSG nosed/V nosegay/MS nose/M Nosferatu/M nos/GDS nosh/MSDG nosily nosiness/MS nosing/M nostalgia/SM nostalgically nostalgic/S Nostradamus/M Nostrand/M nostril/SM nostrum/SM nosy/SRPMT notability/SM notableness/M notable/PS notably notarial notarization/S notarize/DSG notary/MS notate/VGNXSD notational/CY notation/CMSF notative/CF notch/MSDG not/DRGB notebook/MS note/CSDFG notedness/M noted/YP notepad/S notepaper/MS note's noteworthiness/SM noteworthy/P nothingness/SM nothing/PS noticeable/U noticeably noticeboard/S noticed/U notice/MSDG notifiable notification/M notifier/M notify/NGXSRDZ notional/Y notion/MS notoriety/S notoriousness/M notorious/YP Notre/M Nottingham/M notwithstanding Nouakchott/M nougat/MS Noumea/M noun/SMK nourish/DRSGL nourished/U nourisher/M nourishment/SM nous/M nouveau nouvelle novae Novak/M Nova/M nova/MS novelette/SM Novelia/M novelist/SM novelization/S novelize/GDS Novell/SM novella/SM novel/SM novelty/MS November/SM novena/SM novene Novgorod/M novice/MS novitiate/MS Nov/M Novocaine/M Novocain/S Novokuznetsk/M Novosibirsk/M NOW nowadays noway/S Nowell/M nowhere/S nowise now/S noxiousness/M noxious/PY Noyce/M Noyes/M nozzle/MS Np NP NRA nroff/M N's NS n's/CI NSF n/T NT nth nuance/SDM nubbin/SM nubby/RT Nubia/M Nubian/M nubile nub/MS nuclear/K nuclease/M nucleated/A nucleate/DSXNG nucleation/M nucleic nuclei/M nucleoli nucleolus/M nucleon/MS nucleotide/MS nucleus/M nuclide/M nude/CRS nudely nudeness/M nudest nudge/GSRD nudger/M nudism/MS nudist/MS nudity/MS nugatory Nugent/M nugget/SM nuisance/MS nuke/DSMG Nukualofa null/DSG nullification/M nullifier/M nullify/RSDXGNZ nullity/SM nu/M numbered/UA numberer/M numberless numberplate/M number/RDMGJ numbers/A Numbers/M numbing/Y numbness/MS numb/SGZTYRDP numbskull's numerable/IC numeracy/SI numeral/YMS numerate/SDNGX numerates/I numeration/M numerator/MS numerical/Y numeric/S numerological numerologist/S numerology/MS numerousness/M numerous/YP numinous/S numismatic/S numismatics/M numismatist/MS numskull/SM Nunavut/M nuncio/SM Nunez/M Nunki/M nun/MS nunnery/MS nuptial/S Nuremberg/M Nureyev/M nursemaid/MS nurser/M nurseryman/M nurserymen nursery/MS nurse/SRDJGMZ nursling/M nurturer/M nurture/SRDGZM nus nutate/NGSD nutation/M nutcracker/M nutcrack/RZ nuthatch/SM nutmeat/SM nutmegged nutmegging nutmeg/MS nut/MS nutpick/MS Nutrasweet/M nutria/SM nutrient/MS nutriment/MS nutritional/Y nutritionist/MS nutrition/SM nutritiousness/MS nutritious/PY nutritive/Y nutshell/MS nutted nuttiness/SM nutting nutty/TRP nuzzle/GZRSD NV NW NWT NY Nyasa/M NYC Nydia/M Nye/M Nyerere/M nylon/SM nymphet/MS nymph/M nympholepsy/M nymphomaniac/S nymphomania/MS nymphs Nyquist/M NYSE Nyssa/M NZ o O oafishness/S oafish/PY oaf/MS Oahu/M Oakland/M Oakley/M Oakmont/M oak/SMN oakum/MS oakwood oar/GSMD oarlock/MS oarsman/M oarsmen oarswoman oarswomen OAS oases oasis/M oatcake/MS oater/M Oates/M oath/M oaths oatmeal/SM oat/SMNR Oaxaca/M ob OB Obadiah/M Obadias/M obbligato/S obduracy/S obdurateness/S obdurate/PDSYG Obediah/M obedience/EMS obedient/EY Obed/M obeisance/MS obeisant/Y obelisk/SM Oberlin/M Oberon/M obese obesity/MS obey/EDRGS obeyer/EM obfuscate/SRDXGN obfuscation/M obfuscatory Obidiah/M Obie/M obi/MDGS obit/SMR obituary/SM obj objectify/GSDXN objectionableness/M objectionable/U objectionably objection/SMB objectiveness/MS objective/PYS objectivity/MS objector/SM object/SGVMD objurgate/GNSDX objurgation/M oblate/NYPSX oblation/M obligate/NGSDXY obligational obligation/M obligatorily obligatory obliged/E obliger/M obliges/E oblige/SRDG obligingness/M obliging/PY oblique/DSYGP obliqueness/S obliquity/MS obliterate/VNGSDX obliteration/M obliterative/Y oblivion/MS obliviousness/MS oblivious/YP oblongness/M oblong/SYP obloquies obloquy/M Ob/MD obnoxiousness/MS obnoxious/YP oboe/SM oboist/S obos O'Brien/M obs obscene/RYT obscenity/MS obscurantism/MS obscurantist/MS obscuration obscureness/M obscure/YTPDSRGL obscurity/MS obsequies obsequiousness/S obsequious/YP obsequy observability/M observable/SU observably observance/MS observantly observants observant/U observational/Y observation/MS observatory/MS observed/U observer/M observe/ZGDSRB observing/Y obsess/GVDS obsessional obsession/MS obsessiveness/S obsessive/PYS obsidian/SM obsolesce/GSD obsolescence/S obsolescent/Y obsolete/GPDSY obsoleteness/M obstacle/SM obstetrical obstetrician/SM obstetric/S obstetrics/M obstinacy/SM obstinateness/M obstinate/PY obstreperousness/SM obstreperous/PY obstructed/U obstructer/M obstructionism/SM obstructionist/MS obstruction/SM obstructiveness/MS obstructive/PSY obstruct/RDVGS obtainable/U obtainably obtain/LSGDRB obtainment/S obtrude/DSRG obtruder/M obtrusion/S obtrusiveness/MSU obtrusive/UPY obtuseness/S obtuse/PRTY obverse/YS obviate/XGNDS obviousness/SM obvious/YP Oby/M ocarina/MS O'Casey Occam/M occasional/Y occasion/MDSJG Occidental/S occidental/SY occident/M Occident/SM occipital/Y occlude/GSD occlusion/MS occlusive/S occulter/M occultism/SM occult/SRDYG occupancy/SM occupant/MS occupational/Y occupation/SAM occupied/AU occupier/M occupies/A occupy/RSDZG occur/AS occurred/A occurrence/SM occurring/A oceanfront/MS oceangoing Oceania/M oceanic ocean/MS oceanographer/SM oceanographic oceanography/SM oceanology/MS oceanside Oceanside/M Oceanus/M ocelot/SM ocher/DMGS Ochoa/M o'clock O'Clock O'Connell/M O'Connor/M Oconomowoc/M OCR octagonal/Y octagon/SM octahedral octahedron/M octal/S octane/MS octant/M octave/MS Octavia/M Octavian/M Octavio/M Octavius/M octavo/MS octennial octet/SM octile octillion/M Oct/M October/MS octogenarian/MS octopus/SM octoroon/M ocular/S oculist/SM OD odalisque/SM oddball/SM oddity/MS oddment/MS oddness/MS odd/TRYSPL Odele/M Odelia/M Odelinda/M Odella/M Odelle/M Odell/M O'Dell/M ode/MDRS Ode/MR Oderberg/MS Oder/M Odessa/M Odets/M Odetta/M Odette/M Odey/M Odie/M Odilia/M Odille/M Odin/M odiousness/MS odious/PY Odis/M odium/MS Odo/M odometer/SM Odom/M O'Donnell/M odor/DMS odoriferous odorless odorous/YP ODs O'Dwyer/M Ody/M Odysseus/M Odyssey/M odyssey/S OE OED oedipal Oedipal/Y Oedipus/M OEM/M OEMS oenology/MS oenophile/S o'er O'Er Oersted/M oesophagi oeuvre/SM Ofelia/M Ofella/M offal/MS offbeat/MS offcuts Offenbach/M offender/M offend/SZGDR offense/MSV offensively/I offensiveness/MSI offensive/YSP offerer/M offering/M offer/RDJGZ offertory/SM offhand/D offhandedness/S offhanded/YP officeholder/SM officemate/S officer/GMD officership/S office/SRMZ officialdom/SM officialism/SM officially/U official/PSYM officiant/SM officiate/XSDNG officiation/M officiator/MS officio officiousness/MS officious/YP offing/M offish offload/GDS offprint/GSDM offramp offset/SM offsetting offshoot/MS offshore offside/RS offspring/M offstage/S off/SZGDRJ offtrack Ofilia/M of/K often/RT oftentimes oft/NRT ofttimes Ogbomosho/M Ogdan/M Ogden/M Ogdon/M Ogilvy/M ogive/M Oglethorpe/M ogle/ZGDSR ogreish ogre/MS ogress/S oh OH O'Hara O'Hare/M O'Higgins Ohioan/S Ohio/M ohmic ohmmeter/MS ohm/SM oho/S ohs OHSA/M oilcloth/M oilcloths oiler/M oilfield/MS oiliness/SM oilman/M oil/MDRSZG oilmen oilseed/SM oilskin/MS oily/TPR oink/GDS ointment/SM Oise/M OJ Ojibwa/SM Okamoto/M okapi/SM Okayama/M okay/M Okeechobee/M O'Keeffe Okefenokee Okhotsk/M Okinawa/M Okinawan/S Oklahoma/M Oklahoman/SM Okla/M OK/MDG okra/MS OKs Oktoberfest Olaf/M Olag/M Ola/M Olav/M Oldenburg/M olden/DG Oldfield/M oldie/MS oldish oldness/S Oldsmobile/M oldster/SM Olduvai/M old/XTNRPS olé oleaginous oleander/SM O'Leary/M olefin/M Oleg/M Ole/MV Olenek/M Olenka/M Olen/M Olenolin/M oleomargarine/SM oleo/S oles olfactory Olga/M Olia/M oligarchic oligarchical oligarch/M oligarchs oligarchy/SM Oligocene oligopolistic oligopoly/MS Olimpia/M Olin/M olive/MSR Olive/MZR Oliver/M Olivero/M Olivette/M Olivetti/M Olivia/M Olivier/M Olivie/RM Oliviero/M Oliy/M Ollie/M Olly/M Olmec Olmsted/M Olsen/M Olson/M Olva/M Olvan/M Olwen/M Olympe/M Olympiad/MS Olympian/S Olympia/SM Olympic/S Olympie/M Olympus/M Omaha/SM Oman/M Omar/M ombudsman/M ombudsmen Omdurman/M omega/MS omelet/SM omelette's omen/DMG Omero/M omicron/MS ominousness/SM ominous/YP omission/MS omit/S omitted omitting omnibus/MS omni/M omnipotence/SM Omnipotent omnipotent/SY omnipresence/MS omnipresent/Y omniscience/SM omniscient/YS omnivore/MS omnivorousness/MS omnivorous/PY oms Omsk/M om/XN ON onanism/M Onassis/M oncer/M once/SR oncogene/S oncologist/S oncology/SM oncoming/S Ondrea/M Oneal/M Onega/M Onegin/M Oneida/SM O'Neil O'Neill oneness/MS one/NPMSX oner/M onerousness/SM onerous/YP oneself onetime oneupmanship Onfre/M Onfroi/M ongoing/S Onida/M onion/GDM onionskin/MS onlooker/MS onlooking only/TP Onofredo/M Ono/M onomatopoeia/SM onomatopoeic onomatopoetic Onondaga/MS onrush/GMS on/RY ons Onsager/M onset/SM onsetting onshore onside onslaught/MS Ontarian/S Ontario/M Ont/M onto ontogeny/SM ontological/Y ontology/SM onus/SM onward/S onyx/MS oodles ooh/GD oohs oolitic Oona/M OOo/M oops/S Oort/M ooze/GDS oozy/RT opacity/SM opalescence/S opalescent/Y Opalina/M Opaline/M Opal/M opal/SM opaque/GTPYRSD opaqueness/SM opcode/MS OPEC Opel/M opencast opened/AU opener/M openhandedness/SM openhanded/P openhearted opening/M openness/S OpenOffice.org/M opens/A openwork/MS open/YRDJGZTP operable/I operandi operand/SM operant/YS opera/SM operate/XNGVDS operatically operatic/S operationalization/S operationalize/D operational/Y operation/M operative/IP operatively operativeness/MI operatives operator/SM operetta/MS ope/S Ophelia/M Ophelie/M Ophiuchus/M ophthalmic/S ophthalmologist/SM ophthalmology/MS opiate/GMSD opine/XGNSD opinionatedness/M opinionated/PY opinion/M opioid opium/MS opossum/SM opp Oppenheimer/M opponent/MS opportune/IY opportunism/SM opportunistic opportunistically opportunist/SM opportunity/MS oppose/BRSDG opposed/U opposer/M oppositeness/M opposite/SXYNP oppositional opposition/M oppress/DSGV oppression/MS oppressiveness/MS oppressive/YP oppressor/MS opprobrious/Y opprobrium/SM Oprah/M ops opt/DSG opthalmic opthalmologic opthalmology optical/Y optician/SM optic/S optics/M optima optimality optimal/Y optimise's optimism/SM optimistic optimistically optimist/SM optimization/SM optimize/DRSZG optimized/U optimizer/M optimizes/U optimum/SM optionality/M optional/YS option/GDMS optoelectronic optometric optometrist/MS optometry/SM opulence/SM opulent/Y opus/SM op/XGDN OR oracle/GMSD oracular Oralee/M Oralia/M Oralie/M Oralla/M Oralle/M oral/YS Ora/M orangeade/MS Orange/M orange/MS orangery/SM orangutan/MS Oranjestad/M Oran/M orate/SDGNX oration/M oratorical/Y oratorio/MS orator/MS oratory/MS Orazio/M Orbadiah/M orbicular orbiculares orbital/MYS orbit/MRDGZS orb/SMDG orchard/SM orchestral/Y orchestra/MS orchestrate/GNSDX orchestrater's orchestration/M orchestrator/M orchid/SM ordainer/M ordainment/MS ordain/SGLDR ordeal/SM order/AESGD ordered/U orderer ordering/S orderless orderliness/SE orderly/PS order's/E ordinal/S ordinance/MS ordinarily ordinariness/S ordinary/RSPT ordinated ordinate/I ordinates ordinate's ordinating ordination/SM ordnance/SM Ordovician ordure/MS oregano/SM Oreg/M Oregonian/S Oregon/M Orelee/M Orelia/M Orelie/M Orella/M Orelle/M Orel/M Oren/M Ore/NM ore/NSM Oreo Orestes organdie's organdy/MS organelle/MS organically/I organic/S organismic organism/MS organist/MS organizable/UMS organizational/MYS organization/MEAS organize/AGZDRS organized/UE organizer/MA organizes/E organizing/E organ/MS organometallic organza/SM orgasm/GSMD orgasmic orgiastic orgy/SM Oriana/M oriel/MS orientable Oriental/S oriental/SY orientated/A orientate/ESDXGN orientates/A orientation/AMES orienteering/M orienter orient/GADES orient's Orient/SM orifice/MS orig origami/MS originality/SM originally original/US originate/VGNXSD origination/M originative/Y originator/SM origin/MS Orin/M Orinoco/M oriole/SM Orion/M orison/SM Oriya/M Orizaba/M Orkney/M Orland/M Orlando/M Orlan/M Orleans Orlick/M Orlon/SM Orly/M ormolu/SM or/MY ornamental/SY ornamentation/SM ornament/GSDM ornateness/SM ornate/YP orneriness/SM ornery/PRT ornithological ornithologist/SM ornithology/MS orographic/M orography/M Orono/M orotund orotundity/MS orphanage/MS orphanhood/M orphan/SGDM Orpheus/M Orphic Orran/M Orren/M Orrin/M orris/SM Orr/MN ors Orsa/M Orsola/M Orson/M Ortega/M Ortensia/M orthodontia/S orthodontic/S orthodontics/M orthodontist/MS orthodoxies orthodoxly/U Orthodox/S orthodoxy's orthodox/YS orthodoxy/U orthogonality/M orthogonalization/M orthogonalized orthogonal/Y orthographic orthographically orthography/MS orthonormal orthopedic/S orthopedics/M orthopedist/SM orthophosphate/MS orthorhombic Ortiz/M Orton/M Orval/M Orville/M Orv/M Orwellian Orwell/M o's Osage/SM Osaka/M Osbert/M Osborne/M Osborn/M Osbourne/M Osbourn/M Oscar/SM Osceola/M oscillate/SDXNG oscillation/M oscillator/SM oscillatory oscilloscope/SM osculate/XDSNG osculation/M Osgood/M OSHA Oshawa/M O'Shea/M Oshkosh/M osier/MS Osiris/M Oslo/M Os/M OS/M Osman/M osmium/MS Osmond/M osmoses osmosis/M osmotic Osmund/M osprey/SM osseous/Y Ossie/M ossification/M ossify/NGSDX ostensible ostensibly ostentation/MS ostentatiousness/M ostentatious/PY osteoarthritides osteoarthritis/M osteology/M osteopathic osteopath/M osteopaths osteopathy/MS osteoporoses osteoporosis/M ostracise's ostracism/MS ostracize/GSD Ostrander/M ostrich/MS Ostrogoth/M Ostwald/M O'Sullivan/M Osvaldo/M Oswald/M Oswell/M OT OTB OTC Otes Otha/M Othelia/M Othella/M Othello/M otherness/M other/SMP otherwise otherworldly/P otherworld/Y Othilia/M Othilie/M Otho/M otiose Otis/M OTOH Ottawa/MS otter/DMGS Ottilie/M Otto/M Ottoman ottoman/MS Ouagadougou/M oubliette/SM ouch/SDG oughtn't ought/SGD Ouija/MS ounce/MS our/S ourself ourselves ouster/M oust/RDGZS outage/MS outargue/GDS outback/MRS outbalance/GDS outbidding outbid/S outboard/S outboast/GSD outbound/S outbreak/SMG outbroke outbroken outbuilding/SM outburst/MGS outcast/GSM outclass/SDG outcome/SM outcropped outcropping/S outcrop/SM outcry/MSDG outdated/P outdid outdistance/GSD outdoes outdo/G outdone outdoor/S outdoorsy outdraw/GS outdrawn outdrew outermost outerwear/M outface/SDG outfall/MS outfielder/M outfield/RMSZ outfight/SG outfit/MS outfitted outfitter/MS outfitting outflank/SGD outflow/SMDG outfought outfox/GSD outgeneraled outgoes outgo/GJ outgoing/P outgrew outgrip outgrow/GSH outgrown outgrowth/M outgrowths outguess/SDG outhit/S outhitting outhouse/SM outing/M outlaid outlander/M outlandishness/MS outlandish/PY outland/ZR outlast/GSD outlawry/M outlaw/SDMG outlay/GSM outlet/SM outliers outline/SDGM outlive/GSD outlook/MDGS outlying outmaneuver/GSD outmatch/SDG outmigration outmoded outness/M outnumber/GDS outpaced outpatient/SM outperform/DGS out/PJZGSDR outplacement/S outplay/GDS outpoint/GDS outpost/SM outpouring/M outpour/MJG outproduce/GSD output/SM outputted outputting outrace/GSD outrage/GSDM outrageousness/M outrageous/YP outran outrank/GSD outré outreach/SDG outrider/MS outrigger/SM outright/Y outrunning outrun/S outscore/GDS outsell/GS outset/MS outsetting outshine/SG outshone outshout/GDS outsider/PM outside/ZSR outsize/S outskirt/SM outsmart/SDG outsold outsource/SDJG outspend/SG outspent outspoke outspokenness/SM outspoken/YP outspread/SG outstanding/Y outstate/NX outstation/M outstay/SDG outstretch/GSD outstripped outstripping outstrip/S outtake/S outvote/GSD outwardness/M outward/SYP outwear/SG outweigh/GD outweighs outwit/S outwitted outwitting outwore outwork/SMDG outworn ouzo/SM oval/MYPS ovalness/M ova/M ovarian ovary/SM ovate/SDGNX ovation/GMD ovenbird/SM oven/MS overabundance/MS overabundant overachieve/SRDGZ overact/DGVS overage/S overaggressive overallocation overall/SM overambitious overanxious overarching overarm/GSD overate overattentive overawe/GDS overbalance/DSG overbear/GS overbearingness/M overbearing/YP overbidding overbid/S overbite/MS overblown overboard overbold overbook/SDG overbore overborne overbought overbuild/GS overbuilt overburdening/Y overburden/SDG overbuy/GS overcame overcapacity/M overcapitalize/DSG overcareful overcast/GS overcasting/M overcautious overcerebral overcharge/DSG overcloud/DSG overcoating/M overcoat/SMG overcomer/M overcome/RSG overcommitment/S overcompensate/XGNDS overcompensation/M overcomplexity/M overcomplicated overconfidence/MS overconfident/Y overconscientious overconsumption/M overcook/SDG overcooled overcorrection overcritical overcrowd/DGS overcurious overdecorate/SDG overdependent overdetermined overdevelop/SDG overdid overdoes overdo/G overdone overdose/DSMG overdraft/SM overdraw/GS overdrawn overdress/GDS overdrew overdrive/GSM overdriven overdrove overdubbed overdubbing overdub/S overdue overeagerness/M overeager/PY overeater/M overeat/GNRS overeducated overemotional overemphases overemphasis/M overemphasize/GZDSR overenthusiastic overestimate/DSXGN overestimation/M overexcite/DSG overexercise/SDG overexert/GDS overexertion/SM overexploitation overexploited overexpose/GDS overexposure/SM overextend/DSG overextension overfall/M overfed overfeed/GS overfill/GDS overfishing overflew overflight/SM overflow/DGS overflown overfly/GS overfond overfull overgeneralize/GDS overgenerous overgraze/SDG overgrew overground overgrow/GSH overgrown overgrowth/M overgrowths overhand/DGS overhang/GS overhasty overhaul/GRDJS overhead/S overheard overhearer/M overhear/SRG overheat/SGD overhung overincredulous overindulgence/SM overindulgent overindulge/SDG overinflated overjoy/SGD overkill/SDMG overladed overladen overlaid overlain overland/S overlap/MS overlapped overlapping overlarge overlay/GS overleaf overlie overload/SDG overlong overlook/DSG overlord/DMSG overloud overly/GRS overmanning overmaster/GSD overmatching overmodest overmuch/S overnice overnight/SDRGZ overoptimism/SM overoptimistic overpaid overparticular overpass/GMSD overpay/LSG overpayment/M overplay/SGD overpopulate/DSNGX overpopulation/M overpopulous overpower/GSD overpowering/Y overpraise/DSG overprecise overpressure overprice/SDG overprint/DGS overproduce/SDG overproduction/S overprotect/GVDS overprotection/M overqualified overran overrate/DSG overreach/DSRG overreaction/SM overreact/SGD overred overrefined overrepresented overridden overrider/M override/RSG overripe overrode overrule/GDS overrunning overrun/S oversample/DG oversaturate oversaw oversea/S overseeing overseen overseer/M oversee/ZRS oversell/SG oversensitiveness/S oversensitive/P oversensitivity oversexed overshadow/GSD overshoe/SM overshoot/SG overshot/S oversight/SM oversimple oversimplification/M oversimplify/GXNDS oversize/GS oversleep/GS overslept oversoftness/M oversoft/P oversold overspecialization/MS overspecialize/GSD overspend/SG overspent overspill/DMSG overspread/SG overstaffed overstatement/SM overstate/SDLG overstay/GSD overstepped overstepping overstep/S overstimulate/DSG overstock/SGD overstraining overstressed overstretch/D overstrict overstrike/GS overstrung overstuffed oversubscribe/SDG oversubtle oversupply/MDSG oversuspicious overtaken overtake/RSZG overtax/DSG overthrew overthrow/GS overthrown overtightened overtime/MGDS overtire/DSG overtone/MS overtook overt/PY overture/DSMG overturn/SDG overuse/DSG overvalue/GSD overview/MS overweening overweight/GSD overwhelm/GDS overwhelming/Y overwinter/SDG overwork/GSD overwrap overwrite/SG overwritten overwrote overwrought over/YGS overzealousness/M overzealous/P Ovid/M oviduct/SM oviform oviparous ovoid/S ovular ovulate/GNXDS ovulatory ovule/MS ovum/MS ow/DYG Owen/MS owe/S owlet/SM owl/GSMDR owlishness/M owlish/PY owned/U own/EGDS ownership/MS owner/SM oxalate/M oxalic oxaloacetic oxblood/S oxbow/SM oxcart/MS oxen/M oxford/MS Oxford/MS oxidant/SM oxidate/NVX oxidation/M oxidative/Y oxide/SM oxidization/MS oxidized/U oxidize/JDRSGZ oxidizer/M oxidizes/A ox/MNS Oxnard Oxonian oxtail/M Oxus/M oxyacetylene/MS oxygenate/XSDMGN oxygenation/M oxygen/MS oxyhydroxides oxymora oxymoron/M oyster/GSDM oystering/M oz Ozark/SM Oz/M ozone/SM Ozymandias/M Ozzie/M Ozzy/M P PA Pablo/M Pablum/M pablum/S Pabst/M pabulum/SM PAC pace/DRSMZG Pace/M pacemaker/SM pacer/M pacesetter/MS pacesetting Pacheco/M pachyderm/MS pachysandra/MS pacific pacifically pacification/M Pacific/M pacifier/M pacifism/MS pacifistic pacifist/MS pacify/NRSDGXZ package/ARSDG packaged/U packager/S package's packages/U packaging/SM Packard/SM packed/AU packer/MUS packet/MSDG pack/GZSJDRMB packhorse/M packinghouse/S packing/M packsaddle/SM Packston/M packs/UA Packwood/M Paco/M Pacorro/M pact/SM Padang/M padded/U Paddie/M padding/SM paddle/MZGRSD paddler/M paddock/SDMG Paddy/M paddy/SM Padget/M Padgett/M Padilla/M padlock/SGDM pad/MS Padraic/M Padraig/M padre/MS Padrewski/M Padriac/M paean/MS paediatrician/MS paediatrics/M paedophilia's paella/SM paeony/M Paganini/M paganism/MS pagan/SM pageantry/SM pageant/SM pageboy/SM paged/U pageful Page/M page/MZGDRS pager/M paginate/DSNGX Paglia/M pagoda/MS Pahlavi/M paid/AU Paige/M pailful/SM Pail/M pail/SM Paine/M painfuller painfullest painfulness/MS painful/YP pain/GSDM painkiller/MS painkilling painlessness/S painless/YP painstaking/SY paint/ADRZGS paintbox/M paintbrush/SM painted/U painterly/P painter/YM painting/SM paint's paintwork paired/UA pair/JSDMG pairs/A pairwise paisley/MS pajama/MDS Pakistani/S Pakistan/M palace/MS paladin/MS palaeolithic palaeontologists palaeontology/M palanquin/MS palatability/M palatableness/M palatable/P palatalization/MS palatalize/SDG palatal/YS palate/BMS palatial/Y palatinate/SM Palatine palatine/S palaver/GSDM paleface/SM Palembang/M paleness/S Paleocene Paleogene paleographer/SM paleography/SM paleolithic Paleolithic paleontologist/S paleontology/MS Paleozoic Palermo/M pale/SPY Palestine/M Palestinian/S Palestrina/M palette/MS Paley/M palfrey/MS palimony/S palimpsest/MS palindrome/MS palindromic paling/M palisade/MGSD Palisades/M palish Palladio/M palladium/SM pallbearer/SM palletized pallet/SMGD pall/GSMD palliate/SDVNGX palliation/M palliative/SY pallidness/MS pallid/PY Pall/M pallor/MS palmate palmer/M Palmer/M Palmerston/M palmetto/MS palm/GSMDR palmist/MS palmistry/MS Palm/MR Palmolive/M palmtop/S Palmyra/M palmy/RT Palo/M Paloma/M Palomar/M palomino/MS palpable palpably palpate/SDNGX palpation/M palpitate/NGXSD palpitation/M pal/SJMDRYTG palsy/GSDM paltriness/SM paltry/TRP paludal Pa/M Pamela/M Pamelina/M Pamella/M pa/MH Pamirs Pam/M Pammie/M Pammi/M Pammy/M pampas/M pamperer/M pamper/RDSG Pampers pamphleteer/DMSG pamphlet/SM panacea/MS panache/MS Panama/MS Panamanian/S panama/S pancake/MGSD Panchito/M Pancho/M panchromatic pancreas/MS pancreatic panda/SM pandemic/S pandemonium/SM pander/ZGRDS Pandora/M panegyric/SM pane/KMS paneling/M panelist/MS panelization panelized panel/JSGDM Pangaea/M pang/GDMS pangolin/M panhandle/RSDGMZ panicked panicking panicky/RT panic/SM panier's panjandrum/M Pankhurst/M Pan/M Panmunjom/M panned pannier/SM panning panoply/MSD panorama/MS panoramic panpipes Pansie/M pan/SMD Pansy/M pansy/SM Pantagruel/M Pantaloon/M pantaloons pant/GDS pantheism/MS pantheistic pantheist/S pantheon/MS panther/SM pantie/SM pantiled pantograph/M pantomime/SDGM pantomimic pantomimist/SM pantry/SM pantsuit/SM pantyhose pantyliner pantywaist/SM Panza/M Paola/M Paoli/M Paolina/M Paolo/M papacy/SM Papagena/M Papageno/M papal/Y papa/MS paparazzi papaw/SM papaya/MS paperback/GDMS paperboard/MS paperboy/SM paperer/M papergirl/SM paper/GJMRDZ paperhanger/SM paperhanging/SM paperiness/M paperless paperweight/MS paperwork/SM papery/P papillae papilla/M papillary papist/MS papoose/SM Pappas/M papped papping pappy/RST paprika/MS pap/SZMNR papyri papyrus/M Paquito/M parable/MGSD parabola/MS parabolic paraboloidal/M paraboloid/MS Paracelsus/M paracetamol/M parachuter/M parachute/RSDMG parachutist/MS Paraclete/M parader/M parade/RSDMZG paradigmatic paradigm/SM paradisaic paradisaical Paradise/M paradise/MS paradoxic paradoxicalness/M paradoxical/YP paradox/MS paraffin/GSMD paragon/SGDM paragrapher/M paragraph/MRDG paragraphs Paraguayan/S Paraguay/M parakeet/MS paralegal/S paralinguistic parallax/SM parallel/DSG paralleled/U parallelepiped/MS parallelism/SM parallelization/MS parallelize/ZGDSR parallelogram/MS paralysis/M paralytically paralytic/S paralyzedly/S paralyzed/Y paralyzer/M paralyze/ZGDRS paralyzingly/S paralyzing/Y paramagnetic paramagnet/M Paramaribo/M paramecia paramecium/M paramedical/S paramedic/MS parameterization/SM parameterize/BSDG parameterized/U parameterless parameter/SM parametric parametrically parametrization parametrize/DS paramilitary/S paramount/S paramour/MS para/MS Paramus/M Paraná paranoiac/S paranoia/SM paranoid/S paranormal/SY parapet/SMD paraphernalia paraphrase/GMSRD paraphraser/M paraplegia/MS paraplegic/S paraprofessional/SM parapsychologist/S parapsychology/MS paraquat/S parasite/SM parasitically parasitic/S parasitism/SM parasitologist/M parasitology/M parasol/SM parasympathetic/S parathion/SM parathyroid/S paratrooper/M paratroop/RSZ paratyphoid/S parboil/DSG parceled/U parceling/M parcel/SGMD Parcheesi/M parch/GSDL parchment/SM PARC/M pardonableness/M pardonable/U pardonably/U pardoner/M pardon/ZBGRDS paregoric/SM parentage/MS parental/Y parenteral parentheses parenthesis/M parenthesize/GSD parenthetic parenthetical/Y parenthood/MS parent/MDGJS pare/S paresis/M pares/S Pareto/M parfait/SM pariah/M pariahs parietal/S parimutuel/S paring/M parishioner/SM parish/MS Parisian/SM Paris/M parity/ESM parka/MS Parke/M Parker/M Parkersburg/M park/GJZDRMS Parkhouse/M parking/M Parkinson/M parkish parkland/M parklike Parkman Park/RMS parkway/MS parlance/SM parlay/DGS parley/MDSG parliamentarian/SM parliamentary/U parliament/MS Parliament/MS parlor/SM parlous Parmesan/S parmigiana Parnassus/SM Parnell/M parochialism/SM parochiality parochial/Y parodied/U parodist/SM parody/SDGM parolee/MS parole/MSDG paroxysmal paroxysm/MS parquetry/SM parquet/SMDG parrakeet's parred parricidal parricide/MS parring Parrish/M Parr/M Parrnell/M parrot/GMDS parrotlike parry/GSD Parry/M parse parsec/SM parsed/U Parsee's parser/M Parsifal/M parsimonious/Y parsimony/SM pars/JDSRGZ parsley/MS parsnip/MS parsonage/MS parson/MS Parsons/M partaken partaker/M partake/ZGSR part/CDGS parterre/MS parter/S parthenogeneses parthenogenesis/M Parthenon/M Parthia/M partiality/MS partial/SY participant/MS participate/NGVDSX participation/M participator/S participatory participial/Y participle/MS particleboard/S particle/MS particolored particularistic particularity/SM particularization/MS particularize/GSD particular/SY particulate/S parting/MS partisanship/SM partisan/SM partition/AMRDGS partitioned/U partitioner/M partitive/S partizan's partly partner/DMGS partnership/SM partook partridge/MS part's parturition/SM partway party/RSDMG parvenu/SM par/ZGSJBMDR Pasadena/M PASCAL Pascale/M Pascal/M pascal/SM paschal/S pasha/MS Paso/M Pasquale/M pas/S passably passage/MGSD passageway/MS Passaic/M passband passbook/MS passel/MS passé/M passenger/MYS passerby passer/M passersby passim passing/Y passionated passionate/EYP passionateness/EM passionates passionating passioned passionflower/MS passioning passionless passion/SEM Passion/SM passivated passiveness/S passive/SYP passivity/S pass/JGVBZDSR passkey/SM passmark passover Passover/MS passport/SM password/SDM pasta/MS pasteboard/SM pasted/UA pastel/MS paste/MS Pasternak/M pastern/SM pasteup pasteurization/MS pasteurized/U pasteurizer/M pasteurize/RSDGZ Pasteur/M pastiche/MS pastille/SM pastime/SM pastiness/SM pastoralization/M pastoral/SPY pastorate/MS pastor/GSDM past/PGMDRS pastrami/MS pastry/SM past's/A pasts/A pasturage/SM pasture/MGSRD pasturer/M pasty/PTRS Patagonia/M Patagonian/S patch/EGRSD patcher/EM patchily patchiness/S patch's patchwork/RMSZ patchy/PRT patellae patella/MS Patel/M Pate/M paten/M Paten/M patentee/SM patent/ZGMRDYSB paterfamilias/SM pater/M paternalism/MS paternalist paternalistic paternal/Y paternity/SM paternoster/SM Paterson/M pate/SM pathetic pathetically pathfinder/MS pathless/P path/M pathname/SM pathogenesis/M pathogenic pathogen/SM pathologic pathological/Y pathologist/MS pathology/SM pathos/SM paths pathway/MS Patience/M patience/SM patient/MRYTS patient's/I patients/I patina/SM patine Patin/M patio/MS Pat/MN pat/MNDRS Patna/M patois/M Paton/M patresfamilias patriarchal patriarchate/MS patriarch/M patriarchs patriarchy/MS Patrica/M Patrice/M Patricia/M patrician/MS patricide/MS Patricio/M Patrick/M Patric/M patrimonial patrimony/SM patriotically patriotic/U patriotism/SM patriot/SM patristic/S Patrizia/M Patrizio/M Patrizius/M patrolled patrolling patrolman/M patrolmen patrol/MS patrolwoman patrolwomen patronage/MS patroness/S patronization patronized/U patronize/GZRSDJ patronizer/M patronizes/A patronizing's/U patronizing/YM patronymically patronymic/S patron/YMS patroon/MS patsy/SM Patsy/SM patted Patten/M patten/MS patterer/M pattern/GSDM patternless patter/RDSGJ Patterson/M Pattie/M Patti/M patting Pattin/M Patton/M Patty/M patty/SM paucity/SM Paula/M Paule/M Pauletta/M Paulette/M Paulie/M Pauli/M Paulina/M Pauline Pauling/M Paulita/M Paul/MG Paulo/M Paulsen/M Paulson/M Paulus/M Pauly/M paunch/GMSD paunchiness/M paunchy/RTP pauperism/SM pauperize/SDG pauper/SGDM pause/DSG Pavarotti paved/UA pave/GDRSJL Pavel/M pavement/SGDM paver/M paves/A Pavia/M pavilion/SMDG paving/A paving's Pavla/M Pavlova/MS Pavlovian Pavlov/M pawl/SM paw/MDSG pawnbroker/SM pawnbroking/S Pawnee/SM pawner/M pawn/GSDRM pawnshop/MS pawpaw's Pawtucket/M paxes Paxon/M Paxton/M payable/S pay/AGSLB payback/S paycheck/SM payday/MS payed payee/SM payer/SM payload/SM paymaster/SM payment/ASM Payne/SM payoff/MS payola/MS payout/S payroll/MS payslip/S Payson/M Payton/M Paz/M Pb/M PBS PBX PCB PC/M PCP PCs pct pd PD Pd/M PDP PDQ PDT PE Peabody/M peaceableness/M peaceable/P peaceably peacefuller peacefullest peacefulness/S peaceful/PY peace/GMDS peacekeeping/S Peace/M peacemaker/MS peacemaking/MS peacetime/MS peach/GSDM Peachtree/M peachy/RT peacock/SGMD Peadar/M peafowl/SM peahen/MS peaked/P peakiness/M peak/SGDM peaky/P pealed/A Peale/M peal/MDSG peals/A pea/MS peanut/SM Pearce/M Pearla/M Pearle/M pearler/M Pearlie/M Pearline/M Pearl/M pearl/SGRDM pearly/TRS Pearson/M pear/SYM peartrees Peary/M peasanthood peasantry/SM peasant/SM peashooter/MS peats/A peat/SM peaty/TR pebble/MGSD pebbling/M pebbly/TR Pebrook/M pecan/SM peccadilloes peccadillo/M peccary/MS Pechora/M pecker/M peck/GZSDRM Peckinpah/M Peck/M Pecos/M pectic pectin/SM pectoral/S peculate/NGDSX peculator/S peculiarity/MS peculiar/SY pecuniary pedagogical/Y pedagogic/S pedagogics/M pedagogue/SDGM pedagogy/MS pedal/SGRDM pedantic pedantically pedantry/MS pedant/SM peddler/M peddle/ZGRSD pederast/SM pederasty/SM Peder/M pedestal/GDMS pedestrianization pedestrianize/GSD pedestrian/MS pediatrician/SM pediatric/S pedicab/SM pedicure/DSMG pedicurist/SM pedigree/DSM pediment/DMS pedlar's pedometer/MS pedophile/S pedophilia Pedro/M peduncle/MS peeing peekaboo/SM peek/GSD peeler/M peeling/M Peel/M peel/SJGZDR peen/GSDM peeper/M peephole/SM peep/SGZDR peepshow/MS peepy peerage/MS peer/DMG peeress/MS peerlessness/M peerless/PY peeve/GZMDS peevers/M peevishness/SM peevish/YP peewee/S pee/ZDRS Pegasus/MS pegboard/SM Pegeen/M pegged Peggie/M Peggi/M pegging Peggy/M Peg/M peg/MS peignoir/SM Pei/M Peiping/M Peirce/M pejoration/SM pejorative/SY peke/MS Pekinese's pekingese Pekingese/SM Peking/SM pekoe/SM pelagic Pelee/M Pele/M pelf/SM Pelham/M pelican/SM pellagra/SM pellet/SGMD pellucid Peloponnese/M pelter/M pelt/GSDR pelvic/S pelvis/SM Pembroke/M pemmican/SM penalization/SM penalized/U penalize/SDG penalty/MS penal/Y Pena/M penance/SDMG pence/M penchant/MS pencil/SGJMD pendant/SM pend/DCGS pendent/CS Penderecki/M Pendleton/M pendulous pendulum/MS Penelopa/M Penelope/M penetrability/SM penetrable penetrate/SDVGNX penetrating/Y penetration/M penetrativeness/M penetrative/PY penetrator/MS penguin/MS penicillin/SM penile peninsular peninsula/SM penis/MS penitence/MS penitential/YS penitentiary/MS penitent/SY penknife/M penknives penlight/MS pen/M Pen/M penman/M penmanship/MS penmen Penna pennant/SM penned Penney/M Pennie/M penniless Penni/M penning Pennington/M pennis Penn/M pennon/SM Pennsylvania/M Pennsylvanian/S Penny/M penny/SM pennyweight/SM pennyworth/M penologist/MS penology/MS Penrod/M Pensacola/M pensioner/M pension/ZGMRDBS pensiveness/S pensive/PY pens/V pentacle/MS pentagonal/SY Pentagon/M pentagon/SM pentagram/MS pentameter/SM pent/AS Pentateuch/M pentathlete/S pentathlon/MS pentatonic pentecostal Pentecostalism/S Pentecostal/S Pentecost/SM penthouse/SDGM Pentium/M penuche/SM penultimate/SY penumbrae penumbra/MS penuriousness/MS penurious/YP penury/SM peonage/MS peon/MS peony/SM people/SDMG Peoria/M Pepe/M Pepillo/M Pepi/M Pepin/M Pepita/M Pepito/M pepped peppercorn/MS pepperer/M peppergrass/M peppermint/MS pepperoni/S pepper/SGRDM peppery peppiness/SM pepping peppy/PRT Pepsico/M PepsiCo/M Pepsi/M pepsin/SM pep/SM peptic/S peptidase/SM peptide/SM peptizing Pepys/M Pequot/M peradventure/S perambulate/DSNGX perambulation/M perambulator/MS percale/MS perceivably perceive/DRSZGB perceived/U perceiver/M percentage/MS percentile/SM percent/MS perceptible perceptibly perceptional perception/MS perceptiveness/MS perceptive/YP perceptual/Y percept/VMS Perceval/M perchance perch/GSDM perchlorate/M perchlorination percipience/MS percipient/S Percival/M percolate/NGSDX percolation/M percolator/MS percuss/DSGV percussionist/MS percussion/SAM percussiveness/M percussive/PY percutaneous/Y Percy/M perdition/MS perdurable peregrinate/XSDNG peregrination/M peregrine/S Perelman/M peremptorily peremptory/P perennial/SY pères perestroika/S Perez/M perfecta/S perfect/DRYSTGVP perfecter/M perfectibility/MS perfectible perfectionism/MS perfectionist/MS perfection/MS perfectiveness/M perfective/PY perfectness/MS perfidiousness/M perfidious/YP perfidy/MS perforated/U perforate/XSDGN perforation/M perforce performance/MS performed/U performer/M perform/SDRZGB perfumer/M perfumery/SM perfume/ZMGSRD perfunctorily perfunctoriness/M perfunctory/P perfused perfusion/M Pergamon/M pergola/SM perhaps/S Peria/M pericardia pericardium/M Perice/M Periclean Pericles/M perigee/SM perihelia perihelion/M peril/GSDM Perilla/M perilousness/M perilous/PY Peri/M perimeter/MS perinatal perinea perineum/M periodic periodical/YMS periodicity/MS period/MS periodontal/Y periodontics/M periodontist/S peripatetic/S peripheral/SY periphery/SM periphrases periphrasis/M periphrastic periscope/SDMG perishable/SM perish/BZGSRD perishing/Y peristalses peristalsis/M peristaltic peristyle/MS peritoneal peritoneum/SM peritonitis/MS periwigged periwigging periwig/MS periwinkle/SM perjurer/M perjure/SRDZG perjury/MS per/K perk/GDS perkily perkiness/S Perkin/SM perky/TRP Perla/M Perle/M Perl/M permafrost/MS permalloy/M Permalloy/M permanence/SM permanency/MS permanentness/M permanent/YSP permeability/SM permeableness/M permeable/P permeate/NGVDSX Permian permissibility/M permissibleness/M permissible/P permissibly permission/SM permissiveness/MS permissive/YP permit/SM permitted permitting Perm/M perm/MDGS permutation/MS permute/SDG Pernell/M perniciousness/MS pernicious/PY Pernod/M Peron/M peroration/SM Perot/M peroxidase/M peroxide/MGDS perpend/DG perpendicularity/SM perpendicular/SY perpetrate/NGXSD perpetration/M perpetrator/SM perpetual/SY perpetuate/NGSDX perpetuation/M perpetuity/MS perplex/DSG perplexed/Y perplexity/MS perquisite/SM Perren/M Perri/M Perrine/M Perry/MR persecute/XVNGSD persecution/M persecutor/MS persecutory Perseid/M Persephone/M Perseus/M perseverance/MS persevere/GSD persevering/Y Pershing/M Persia/M Persian/S persiflage/MS persimmon/SM Persis/M persist/DRSG persistence/SM persistent/Y persnickety personableness/M personable/P personae personage/SM personality/SM personalization/CMS personalize/CSDG personalized/U personalty/MS personal/YS persona/M person/BMS personification/M personifier/M personify/XNGDRS personnel/SM person's/U persons/U perspective/YMS perspex perspicaciousness/M perspicacious/PY perspicacity/S perspicuity/SM perspicuousness/M perspicuous/YP perspiration/MS perspire/DSG persuaded/U persuader/M persuade/ZGDRSB persuasion/SM persuasively persuasiveness/MS persuasive/U pertain/GSD Perth/M pertinaciousness/M pertinacious/YP pertinacity/MS pertinence/S pertinent/YS pertness/MS perturbation/MS perturbed/U perturb/GDS pertussis/SM pert/YRTSP peruke/SM Peru/M perusal/SM peruser/M peruse/RSDZG Peruvian/S pervade/SDG pervasion/M pervasiveness/MS pervasive/PY perverseness/SM perverse/PXYNV perversion/M perversity/MS pervert/DRSG perverted/YP perverter/M perviousness peseta/SM Peshawar/M peskily peskiness/S pesky/RTP peso/MS pessimal/Y pessimism/SM pessimistic pessimistically pessimist/SM pester/DG pesticide/MS pestiferous pestilence/SM pestilential/Y pestilent/Y pestle/SDMG pesto/S pest/RZSM PET Pétain/M petal/SDM Peta/M petard/MS petcock/SM Pete/M peter/GD Peter/M Petersburg/M Petersen/M Peters/N Peterson/M Peterus/M Petey/M pethidine/M petiole/SM petiteness/M petite/XNPS petitioner/M petition/GZMRD petition's/A petitions/A petits Petkiewicz/M Pet/MRZ Petra/M Petrarch/M petrel/SM petri petrifaction/SM petrify/NDSG Petrina/M Petr/M petrochemical/SM petrodollar/MS petroglyph/M petrolatum/MS petroleum/MS petrolled petrolling petrol/MS petrologist/MS petrology/MS Petronella/M Petronia/M Petronilla/M Petronille/M pet/SMRZ petted petter/MS Pettibone/M petticoat/SMD pettifogged pettifogger/SM pettifogging pettifog/S pettily pettiness/S petting pettis pettishness/M pettish/YP Petty/M petty/PRST petulance/MS petulant/Y Petunia/M petunia/SM Peugeot/M Pewaukee/M pewee/MS pewit/MS pew/SM pewter/SRM peyote/SM Peyter/M Peyton/M pf Pfc PFC pfennig/SM Pfizer/M pg PG Phaedra/M Phaethon/M phaeton/MS phage/M phagocyte/SM Phaidra/M phalanger/MS phalanges phalanx/SM phalli phallic phallus/M Phanerozoic phantasmagoria/SM phantasmal phantasm/SM phantasy's phantom/MS pharaoh Pharaoh/M pharaohs Pharaohs pharisaic Pharisaic Pharisaical pharisee/S Pharisee/SM pharmaceutical/SY pharmaceutic/S pharmaceutics/M pharmacist/SM pharmacological/Y pharmacologist/SM pharmacology/SM pharmacopoeia/SM pharmacy/SM pharyngeal/S pharynges pharyngitides pharyngitis/M pharynx/M phase/DSRGZM phaseout/S PhD pheasant/SM Phebe/M Phedra/M Phekda/M Phelia/M Phelps/M phenacetin/MS phenobarbital/SM phenolic phenol/MS phenolphthalein/M phenomenal/Y phenomena/SM phenomenological/Y phenomenology/MS phenomenon/SM phenotype/MS phenylalanine/M phenyl/M pheromone/MS phew/S phialled phialling phial/MS Phidias/M Philadelphia/M philanderer/M philander/SRDGZ philanthropic philanthropically philanthropist/MS philanthropy/SM philatelic philatelist/MS philately/SM Philbert/M Philco/M philharmonic/S Philipa/M Philip/M Philippa/M Philippe/M Philippians/M philippic/SM Philippine/SM Philis/M philistine/S Philistine/SM philistinism/S Phillida/M Phillie/M Phillipa/M Phillipe/M Phillip/MS Phillipp/M Phillis/M Philly/SM Phil/MY philodendron/MS philological/Y philologist/MS philology/MS Philomena/M philosopher/MS philosophic philosophical/Y philosophized/U philosophizer/M philosophizes/U philosophize/ZDRSG philosophy/MS philter/SGDM philtre/DSMG Phineas/M Phip/M Phipps/M phi/SM phlebitides phlebitis/M phlegmatic phlegmatically phlegm/SM phloem/MS phlox/M pH/M Ph/M phobia/SM phobic/S Phobos/M Phoebe/M phoebe/SM Phoenicia/M Phoenician/SM Phoenix/M phoenix/MS phone/DSGM phoneme/SM phonemically phonemic/S phonemics/M phonetically phonetician/SM phonetic/S phonetics/M phonically phonic/S phonics/M phoniness/MS phonographer/M phonographic phonograph/RM phonographs phonologic phonological/Y phonologist/MS phonology/MS phonon/M phony/PTRSDG phooey/S phosphatase/M phosphate/MS phosphide/M phosphine/MS phosphoresce phosphorescence/SM phosphorescent/Y phosphoric phosphor/MS phosphorous phosphorus/SM photocell/MS photochemical/Y photochemistry/M photocopier/M photocopy/MRSDZG photoelectric photoelectrically photoelectronic photoelectrons photoengraver/M photoengrave/RSDJZG photoengraving/M photofinishing/MS photogenic photogenically photograph/AGD photographer/SM photographic photographically photograph's photographs/A photography/MS photojournalism/SM photojournalist/SM photoluminescence/M photolysis/M photolytic photometer/SM photometric photometrically photometry/M photomicrograph/M photomicrography/M photomultiplier/M photon/MS photorealism photosensitive photo/SGMD photosphere/M photostatic Photostat/MS Photostatted Photostatting photosyntheses photosynthesis/M photosynthesize/DSG photosynthetic phototypesetter phototypesetting/M phrasal phrase/AGDS phrasebook phrasemaking phraseology/MS phrase's phrasing/SM phrenological/Y phrenologist/MS phrenology/MS phylactery/MS phylae phyla/M Phylis/M Phyllida/M Phyllis/M Phyllys/M phylogeny/MS phylum/M Phylys/M phys physicality/M physical/PYS physician/SM physicist/MS physicked physicking physic/SM physiochemical physiognomy/SM physiography/MS physiologic physiological/Y physiologist/SM physiology/MS physiotherapist/MS physiotherapy/SM physique/MSD phytoplankton/M Piaf/M Piaget/M Pia/M pianism/M pianissimo/S pianistic pianist/SM pianoforte/MS pianola Pianola/M piano/SM piaster/MS piazza/SM pibroch/M pibrochs picador/MS picaresque/S pica/SM Picasso/M picayune/S Piccadilly/M piccalilli/MS piccolo/MS pickaback's pickaxe's pickax/GMSD pickerel/MS Pickering/M picker/MG picketer/M picket/MSRDZG Pickett/M Pickford/M pick/GZSJDR pickle/SDMG Pickman/M pickoff/S pickpocket/GSM pickup/SM Pickwick/M picky/RT picnicked picnicker/MS picnicking picnic/SM picofarad/MS picojoule picoseconds picot/DMGS Pict/M pictograph/M pictographs pictorialness/M pictorial/PYS picture/MGSD picturesqueness/SM picturesque/PY piddle/GSD piddly pidgin/SM piebald/S piece/GMDSR piecemeal piecer/M piecewise pieceworker/M piecework/ZSMR piedmont Piedmont/M pieing pie/MS Pierce/M piercer/M pierce/RSDZGJ piercing/Y Pierette/M pier/M Pier/M Pierre/M Pierrette/M Pierrot/M Pierson/M Pieter/M Pietra/M Pietrek/M Pietro/M piety/SM piezoelectric piezoelectricity/M piffle/MGSD pigeon/DMGS pigeonhole/SDGM pigged piggery/M pigging piggishness/SM piggish/YP piggyback/MSDG Piggy/M piggy/RSMT pigheadedness/S pigheaded/YP piglet/MS pigmentation/MS pigment/MDSG pig/MLS Pigmy's pigpen/SM pigroot pigskin/MS pigsty/SM pigswill/M pigtail/SMD Pike/M pike/MZGDRS piker/M pikestaff/MS pilaf/MS pilaster/SM Pilate/M pilau's pilchard/SM Pilcomayo/M pile/JDSMZG pileup/MS pilferage/SM pilferer/M pilfer/ZGSRD Pilgrim pilgrimage/DSGM pilgrim/MS piling/M pillage/RSDZG pillar/DMSG pillbox/MS pill/GSMD pillion/DMGS pillory/MSDG pillowcase/SM pillow/GDMS pillowslip/S Pillsbury/M pilot/DMGS pilothouse/SM piloting/M pimento/MS pimiento/SM pimpernel/SM pimp/GSMYD pimple/SDM pimplike pimply/TRM PIN pinafore/MS piñata/S Pinatubo/M pinball/MS Pincas/M pincer/GSD Pinchas/M pincher/M pinch/GRSD pincushion/SM Pincus/M Pindar/M pineapple/MS pined/A Pinehurst/M pine/MNGXDS pines/A pinfeather/SM ping/GDRM pinheaded/P pinhead/SMD pinhole/SM pining/A pinion/DMG Pinkerton/M pinkeye/MS pink/GTYDRMPS pinkie/SM pinkish/P pinkness/S pinko/MS pinky's pinnacle/MGSD pinnate pinned/U pinning/S Pinocchio/M Pinochet/M pinochle/SM piñon/S pinpoint/SDG pinprick/MDSG pin's pinsetter/SM Pinsky/M pinstripe/SDM pintail/SM Pinter/M pint/MRS pinto/S pinup/MS pin/US pinwheel/DMGS pinyin Pinyin piny/RT pioneer/SDMG pion/M Piotr/M piousness/MS pious/YP pipeline/DSMG pipe/MS piper/M Piper/M Pipestone/M pipet's pipette/MGSD pipework piping/YM pipit/MS pip/JSZMGDR Pip/MR Pippa/M pipped pipping pippin/SM Pippo/M Pippy/M pipsqueak/SM piquancy/MS piquantness/M piquant/PY pique/GMDS piracy/MS Piraeus/M Pirandello/M piranha/SM pirate/MGSD piratical/Y pirogi pirogies pirouette/MGSD pis Pisa/M piscatorial Pisces/M Pisistratus/M pismire/SM Pissaro/M piss/DSRG! pistachio/MS piste/SM pistillate pistil/MS pistoleers pistole/M pistol/SMGD piston/SM pitapat/S pitapatted pitapatting pita/SM Pitcairn/M pitchblende/SM pitcher/M pitchfork/GDMS pitching/M pitchman/M pitchmen pitch/RSDZG pitchstone/M piteousness/SM piteous/YP pitfall/SM pithily pithiness/SM pith/MGDS piths pithy/RTP pitiableness/M pitiable/P pitiably pitier/M pitifuller pitifullest pitifulness/M pitiful/PY pitilessness/SM pitiless/PY pitman/M pit/MS Pitney/M piton/SM pittance/SM pitted pitting Pittman/M Pittsburgh/ZM Pittsfield/M Pitt/SM Pittston/M pituitary/SM pitying/Y pity/ZDSRMG Pius/M pivotal/Y pivot/DMSG pivoting/M pix/DSG pixel/SM pixie/MS pixiness pixmap/SM Pizarro/M pizazz/S pi/ZGDRH pizza/SM pizzeria/SM pizzicati pizzicato pj's PJ's pk pkg pkt pkwy Pkwy pl placard/DSMG placate/NGVXDRS placatory placeable/A placebo/SM placed/EAU place/DSRJLGZM placeholder/S placekick/DGS placeless/Y placement/AMES placental/S placenta/SM placer/EM places/EA placidity/SM placidness/M placid/PY placing/AE placket/SM plagiarism/MS plagiarist/MS plagiarize/GZDSR plagiary/SM plagued/U plague/MGRSD plaguer/M plaice/M plaid/DMSG plainclothes plainclothesman plainclothesmen Plainfield/M plainness/MS plainsman/M plainsmen plainsong/SM plainspoken plain/SPTGRDY plaintiff/MS plaintiveness/M plaintive/YP plaint/VMS Plainview/M plaiting/M plait/SRDMG planar planarity Planck/M plan/DRMSGZ planeload planer/M plane's plane/SCGD planetarium/MS planetary planetesimal/M planet/MS planetoid/SM plangency/S plangent planking/M plank/SJMDG plankton/MS planned/U planner/SM planning Plano planoconcave planoconvex Plantagenet/M plantain/MS plantar plantation/MS planter/MS planting/S plantlike plant's plant/SADG plaque/MS plash/GSDM plasma/MS plasmid/S plasm/M plasterboard/MS plasterer/M plastering/M plaster/MDRSZG plasterwork/M plastically plasticine Plasticine/M plasticity/SM plasticize/GDS plastic/MYS plateau/GDMS plateful/S platelet/SM platen/M plater/M plate/SM platform/SGDM Plath/M plating/M platinize/GSD platinum/MS platitude/SM platitudinous/Y plat/JDNRSGXZ Plato/M platonic Platonic Platonism/M Platonist platoon/MDSG platted Platte/M platter/MS Platteville/M platting platypus/MS platys platy/TR plaudit/MS plausibility/S plausible/P plausibly Plautus/M playability/U playable/U playacting/M playact/SJDG playback/MS playbill/SM Playboy/M playboy/SM play/DRSEBG played/A player's/E player/SM playfellow/S playfulness/MS playful/PY playgirl/SM playgoer/MS playground/MS playgroup/S playhouse/SM playing/S playmate/MS playoff/S playpen/SM playroom/SM plays/A Playtex/M plaything/MS playtime/SM playwright/SM playwriting/M plaza/SM pleader/MA pleading/MY plead/ZGJRDS pleasanter pleasantest pleasantness/SMU pleasantry/MS pleasant/UYP pleased/EU pleaser/M pleases/E please/Y pleasingness/M pleasing/YP plea/SM pleas/RSDJG pleasurableness/M pleasurable/P pleasurably pleasureful pleasure/MGBDS pleasure's/E pleasures/E pleater/M pleat/RDMGS plebeian/SY plebe/MS plebiscite/SM plectra plectrum/SM pledger/M pledge/RSDMG Pleiads Pleistocene plenary/S plenipotentiary/S plenitude/MS plenteousness/M plenteous/PY plentifulness/M plentiful/YP plenty/SM plenum/M pleonasm/MS plethora/SM pleurae pleural pleura/M pleurisy/SM Plexiglas/MS plexus/SM pliability/MS pliableness/M pliable/P pliancy/MS pliantness/M pliant/YP plication/MA plier/MA plight/GMDRS plimsolls plinker/M plink/GRDS plinth/M plinths Pliny/M Pliocene/S PLO plodded plodder/SM plodding/SY plod/S plopped plopping plop/SM plosive plot/SM plotted/A plotter/MDSG plotting plover/MS plowed/U plower/M plowman/M plowmen plow/SGZDRM plowshare/MS ploy's ploy/SCDG plucker/M pluckily pluckiness/SM pluck/SGRD plucky/TPR pluggable plugged/UA plugging/AU plughole plug's plug/US plumage/DSM plumbago/M plumbed/U plumber/M plumbing/M plumb/JSZGMRD plume/SM plummer plummest plummet/DSG plummy plumper/M plumpness/S plump/RDNYSTGP plum/SMDG plumy/TR plunder/GDRSZ plunger/M plunge/RSDZG plunker/M plunk/ZGSRD pluperfect/S pluralism/MS pluralistic pluralist/S plurality/SM pluralization/MS pluralize/GZRSD pluralizer/M plural/SY plushness/MS plush/RSYMTP plushy/RPT plus/S plussed plussing Plutarch/M plutocracy/MS plutocratic plutocrat/SM Pluto/M plutonium/SM pluvial/S ply/AZNGRSD Plymouth/M plywood/MS pm PM Pm/M PMS pneumatically pneumatic/S pneumatics/M pneumonia/MS PO poacher/M poach/ZGSRD Pocahontas/M pocketbook/SM pocketful/SM pocketing/M pocketknife/M pocketknives pocket/MSRDG pock/GDMS pockmark/MDSG Pocono/MS podded podding podge/ZR Podgorica/M podiatrist/MS podiatry/MS podium/MS pod/SM Podunk/M Poe/M poem/MS poesy/GSDM poetaster/MS poetess/MS poetically poeticalness poetical/U poetic/S poetics/M poet/MS poetry/SM pogo Pogo/M pogrom/GMDS poignancy/MS poignant/Y Poincaré/M poinciana/SM Poindexter/M poinsettia/SM pointblank pointedness/M pointed/PY pointer/M pointillism/SM pointillist/SM pointing/M pointlessness/SM pointless/YP point/RDMZGS pointy/TR poise/M pois/GDS poi/SM poisoner/M poisoning/M poisonous/PY poison/RDMZGSJ Poisson/M poke/DRSZG Pokemon/M pokerface/D poker/M poky/SRT Poland/M Polanski/M polarimeter/SM polarimetry polariscope/M Polaris/M polarity/MS polarization/CMS polarized/UC polarize/RSDZG polarizes/C polarizing/C polarogram/SM polarograph polarography/M Polaroid/SM polar/S polecat/SM polemical/Y polemicist/S polemic/S polemics/M pole/MS Pole/MS poler/M polestar/S poleward/S pol/GMDRS policeman/M policemen/M police/MSDG policewoman/M policewomen policyholder/MS policymaker/S policymaking policy/SM poliomyelitides poliomyelitis/M polio/SM Polish polished/U polisher/M polish/RSDZGJ polis/M Politburo/M politburo/S politeness/MS polite/PRTY politesse/SM politically political/U politician/MS politicization/S politicize/CSDG politicked politicking/SM politico/SM politic/S politics/M polity/MS polka/SDMG Polk/M pollack/SM Pollard/M polled/U pollen/GDM pollinate/XSDGN pollination/M pollinator/MS polliwog/SM poll/MDNRSGX pollock's Pollock/SM pollster/MS pollutant/MS polluted/U polluter/M pollute/RSDXZVNG pollution/M Pollux/M Pollyanna/M Polly/M pollywog's Pol/MY Polo/M polo/MS polonaise/MS polonium/MS poltergeist/SM poltroon/MS polyandrous polyandry/MS polyatomic polybutene/MS polycarbonate polychemicals polychrome polyclinic/MS polycrystalline polyelectrolytes polyester/SM polyether/S polyethylene/SM polygamist/MS polygamous/Y polygamy/MS polyglot/S polygonal/Y polygon/MS polygraph/MDG polygraphs polygynous polyhedral polyhedron/MS Polyhymnia/M polyisobutylene polyisocyanates polymath/M polymaths polymerase/S polymeric polymerization/SM polymerize/SDG polymer/MS polymorphic polymorphism/MS polymorph/M polymyositis Polynesia/M Polynesian/S polynomial/YMS Polyphemus/M polyphonic polyphony/MS polyphosphate/S polyp/MS polypropylene/MS polystyrene/SM polysyllabic polysyllable/SM polytechnic/MS polytheism/SM polytheistic polytheist/SM polythene/M polytonal/Y polytopes polyunsaturated polyurethane/SM polyvinyl/MS Po/M pomade/MGSD pomander/MS pomegranate/SM Pomerania/M Pomeranian pommel/GSMD Pomona/M Pompadour/M pompadour/MDS pompano/SM Pompeian/S Pompeii/M Pompey/M pompom/SM pompon's pomposity/MS pompousness/S pompous/YP pomp/SM ponce/M Ponce/M Ponchartrain/M poncho/MS ponderer/M ponderousness/MS ponderous/PY ponder/ZGRD pond/SMDRGZ pone/SM pongee/MS poniard/GSDM pons/M Pontchartrain/M Pontiac/M Pontianak/M pontiff/MS pontifical/YS pontificate/XGNDS pontoon/SMDG pony/DSMG ponytail/SM pooch/GSDM poodle/MS poof/MS pooh/DG Pooh/M poohs Poole/M pool/MDSG poolroom/MS poolside Poona/M poop/MDSG poorboy poorhouse/MS poorness/MS poor/TYRP popcorn/MS Popek/MS pope/SM Pope/SM Popeye/M popgun/SM popinjay/MS poplar/SM poplin/MS Popocatepetl/M popover/SM poppa/MS popped Popper/M popper/SM poppet/M popping Poppins/M poppycock/MS Poppy/M poppy/SDM poppyseed Popsicle/MS pop/SM populace/MS popularism popularity/UMS popularization/SM popularize/A popularized popularizer/MS popularizes/U popularizing popular/YS populate/CXNGDS populated/UA populates/A populating/A population/MC populism/S populist/SM populousness/MS populous/YP porcelain/SM porch/SM porcine porcupine/MS pore/ZGDRS Porfirio/M porgy/SM poring/Y porker/M porky/TSR pork/ZRMS pornographer/SM pornographic pornographically pornography/SM porno/S porn/S porosity/SM porousness/MS porous/PY porphyritic porphyry/MS porpoise/DSGM porridge/MS Porrima/M porringer/MS Porsche/M portability/S portables portable/U portably port/ABSGZMRD portage/ASM portaged portaging portal/SM portamento/M portcullis/MS ported/CE Porte/M portend/SDG portentousness/M portentous/PY portent/SM porterage/M porter/DMG porterhouse/SM Porter/M porter's/A portfolio/MS porthole/SM Portia/M porticoes portico/M Portie/M portière/SM porting/E portion/KGSMD Portland/M portliness/SM portly/PTR portmanteau/SM Port/MR Pôrto/M portraitist/SM portrait/MS portraiture/MS portrayal/SM portrayer/M portray/GDRS ports/CE Portsmouth/M Portugal/M Portuguese/M portulaca/MS Porty/M posed/CA Poseidon/M poser/KME poses/CA poseur/MS pose/ZGKDRSE posh/DSRGT posing/CA positifs positionable positional/KY position/KGASMD position's/EC positions/EC positiveness/S positive/RSPYT positivism/M positivist/S positivity positron/SM posit/SCGD Posner/M posse/M possess/AGEDS possessed/PY possession/AEMS possessional possessiveness/MS possessive/PSMY possessor/MS possibility/SM possible/TRS possibly poss/S possum/MS postage/MS postal/S post/ASDRJG postbag/M postbox/SM postcard/SM postcode/SM postcondition/S postconsonantal postdate/DSG postdoctoral posteriori posterior/SY posterity/SM poster/MS postfix/GDS postgraduate/SM posthaste/S posthumousness/M posthumous/YP posthypnotic postilion/MS postindustrial posting/M postlude/MS Post/M postman/M postmarital postmark/GSMD postmaster/SM postmen postmeridian postmistress/MS postmodern postmodernist postmortem/S postnasal postnatal postoperative/Y postorder postpaid postpartum postpone/GLDRS postponement/S postpositions postprandial post's postscript/SM postsecondary postulate/XGNSD postulation/M postural posture/MGSRD posturer/M postvocalic postwar posy/SM potability/SM potableness/M potable/SP potage/M potash/MS potassium/MS potatoes potato/M potbelly/MSD potboiler/M potboil/ZR pot/CMS Potemkin/M potency/MS potentate/SM potentiality/MS potential/SY potentiating potentiometer/SM potent/YS potful/SM pothead/MS potherb/MS pother/GDMS potholder/MS pothole/SDMG potholing/M pothook/SM potion/SM potlatch/SM potluck/MS Potomac/M potpie/SM potpourri/SM Potsdam/M potsherd/MS potshot/S pottage/SM Pottawatomie/M potted Potter/M potter/RDMSG pottery/MS potting Potts/M potty/SRT pouch/SDMG Poughkeepsie/M Poul/M poulterer/MS poultice/DSMG poultry/MS pounce/SDG poundage/MS pounder/MS pound/KRDGS Pound/M pour/DSG pourer's Poussin/MS pouter/M pout/GZDRS poverty/MS POW powderpuff powder/RDGMS powdery Powell/M powerboat/MS powerfulness/M powerful/YP power/GMD powerhouse/MS powerlessness/SM powerless/YP Powers Powhatan/M pow/RZ powwow/GDMS pox/GMDS Poznan/M pp PP ppm ppr PPS pr PR practicability/S practicable/P practicably practicality/SM practicalness/M practical/YPS practice/BDRSMG practiced/U practicer/M practicum/SM practitioner/SM Pradesh/M Prado/M Praetorian praetorian/S praetor/MS pragmatical/Y pragmatic/S pragmatics/M pragmatism/MS pragmatist/MS Prague/M Praia prairie/MS praise/ESDG praiser/S praise's praiseworthiness/MS praiseworthy/P praising/Y Prakrit/M praline/MS pram/MS prancer/M prance/ZGSRD prancing/Y prank/SMDG prankster/SM praseodymium/SM Pratchett/M prate/DSRGZ prater/M pratfall/MS prating/Y prattle/DRSGZ prattler/M prattling/Y Pratt/M Prattville/M Pravda/M prawn/MDSG praxes praxis/M Praxiteles/M pray/DRGZS prayerbook prayerfulness/M prayerful/YP prayer/M PRC preach/DRSGLZJ preacher/M preaching/Y preachment/MS preachy/RT preadolescence/S Preakness/M preallocate/XGNDS preallocation/M preallocator/S preamble/MGDS preamp preamplifier/M prearrange/LSDG prearrangement/SM preassign/SDG preauthorize prebendary/M Precambrian precancel/DGS precancerous precariousness/MS precarious/PY precautionary precaution/SGDM precede/DSG precedence/SM precedented/U precedent/SDM preceptive/Y preceptor/MS precept/SMV precess/DSG precession/M precinct/MS preciosity/MS preciousness/S precious/PYS precipice/MS precipitable precipitant/S precipitateness/M precipitate/YNGVPDSX precipitation/M precipitousness/M precipitous/YP preciseness/SM precise/XYTRSPN precision/M précis/MDG preclude/GDS preclusion/S precociousness/MS precocious/YP precocity/SM precode/D precognition/SM precognitive precollege/M precolonial precomputed preconceive/GSD preconception/SM precondition/GMDS preconscious precook/GDS precursor/SM precursory precut predate/NGDSX predation/CMS predator/SM predatory predecease/SDG predecessor/MS predeclared predecline predefine/GSD predefinition/SM predesignate/GDS predestination/SM predestine/SDG predetermination/MS predeterminer/M predetermine/ZGSRD predicable/S predicament/SM predicate/VGNXSD predication/M predicator predictability/UMS predictable/U predictably/U predict/BSDGV predicted/U prediction/MS predictive/Y predictor/MS predigest/GDS predilect predilection/SM predispose/SDG predisposition/MS predoctoral predominance/SM predominant/Y predominate/YSDGN predomination/M preemie/MS preeminence/SM preeminent/Y preemployment/M preempt/GVSD preemption/SM preemptive/Y preemptor/M preener/M preen/SRDG preexist/DSG preexistence/SM preexistent prefabbed prefabbing prefab/MS prefabricate/XNGDS prefabrication/M preface/DRSGM prefacer/M prefatory prefect/MS prefecture/MS preferableness/M preferable/P preferably prefer/BL preference/MS preferential/Y preferment/SM preferred preferring prefiguration/M prefigure/SDG prefix/MDSG preflight/SGDM preform/DSG pref/RZ pregnancy/SM pregnant/Y preheat/GDS prehensile prehistoric prehistorical/Y prehistory/SM preindustrial preinitialize/SDG preinterview/M preisolated prejudge/DRSG prejudger/M prejudgment/SM prejudiced/U prejudice/MSDG prejudicial/PY prekindergarten/MS prelacy/MS prelate/SM preliminarily preliminary/S preliterate/S preloaded prelude/GMDRS preluder/M premarital/Y premarket prematureness/M premature/SPY prematurity/M premedical premeditated/Y premeditate/XDSGNV premeditation/M premed/S premenstrual premiere/MS premier/GSDM premiership/SM Preminger/M premise/GMDS premiss's premium/MS premix/GDS premolar/S premonition/SM premonitory prenatal/Y Pren/M Prenticed/M Prentice/MGD Prenticing/M Prentiss/M Prent/M prenuptial preoccupation/MS preoccupy/DSG preoperative preordain/DSLG prepackage/GSD prepaid preparation/SM preparative/SYM preparatory preparedly preparedness/USM prepared/UP prepare/ZDRSG prepay/GLS prepayment/SM prepender/S prepends preplanned preponderance/SM preponderant/Y preponderate/DSYGN prepositional/Y preposition/SDMG prepossess/GSD prepossessing/U prepossession/MS preposterousness/M preposterous/PY prepped prepping preppy/RST preprepared preprint/SGDM preprocessed preprocessing preprocessor/S preproduction preprogrammed prep/SM prepubescence/S prepubescent/S prepublication/M prepuce/SM prequel/S preradiation prerecord/DGS preregister/DSG preregistration/MS prerequisite/SM prerogative/SDM Pres presage/GMDRS presager/M presbyopia/MS presbyterian Presbyterianism/S Presbyterian/S presbyter/MS presbytery/MS preschool/RSZ prescience/SM prescient/Y Prescott/M prescribed/U prescriber/M prescribe/RSDG prescription/SM prescriptive/Y prescript/SVM preselect/SGD presence/SM presentableness/M presentable/P presentably/A presentational/A presentation/AMS presented/A presenter/A presentiment/MS presentment/SM presents/A present/SLBDRYZGP preservationist/S preservation/SM preservative/SM preserve/DRSBZG preserved/U preserver/M preset/S presetting preshrank preshrink/SG preshrunk preside/DRSG presidency/MS presidential/Y president/SM presider/M presidia presidium/M Presley/M presoaks presort/GDS pres/S press/ACDSG pressed/U presser/MS pressingly/C pressing/YS pressman/M pressmen pressure/DSMG pressurization/MS pressurize/DSRGZ pressurized/U prestidigitate/NX prestidigitation/M prestidigitatorial prestidigitator/M prestige/MS prestigious/PY Preston/M presto/S presumably presume/BGDRS presumer/M presuming/Y presumption/MS presumptive/Y presumptuousness/SM presumptuous/YP presuppose/GDS presupposition/S pretax preteen/S pretended/Y pretender/M pretending/U pretend/SDRZG pretense/MNVSX pretension/GDM pretentiousness/S pretentious/UYP preterite's preterit/SM preternatural/Y pretest/SDG pretext/SMDG Pretoria/M pretreated pretreatment/S pretrial prettify/SDG prettily prettiness/SM pretty/TGPDRS pretzel/SM prevailing/Y prevail/SGD prevalence/MS prevalent/SY prevaricate/DSXNG prevaricator/MS preventable/U preventably preventative/S prevent/BSDRGV preventer/M prevention/MS preventiveness/M preventive/SPY preview/ZGSDRM previous/Y prevision/SGMD prewar prexes preyer's prey/SMDG Priam/M priapic Pribilof/M price/AGSD priced/U priceless Price/M pricer/MS price's pricey pricier priciest pricker/M pricking/M prickle/GMDS prickliness/S prickly/RTP prick/RDSYZG prideful/Y pride/GMDS prier/M priestess/MS priesthood/SM Priestley/M priestliness/SM priestly/PTR priest/SMYDG prigged prigging priggishness/S priggish/PYM prig/SM primacy/MS primal primarily primary/MS primate/MS primed/U primely/M primeness/M prime/PYS primer/M Prime's primeval/Y priming/M primitiveness/SM primitive/YPS primitivism/M primmed primmer primmest primming primness/MS primogenitor/MS primogeniture/MS primordial/YS primp/DGS primrose/MGSD prim/SPJGZYDR princedom/MS princeliness/SM princely/PRT Prince/M prince/SMY princess/MS Princeton/M principality/MS principal/SY Principe/M Principia/M principled/U principle/SDMG printable/U printably print/AGDRS printed/U printer/AM printers printing/SM printmaker/M printmake/ZGR printmaking/M printout/S Prinz/M prioress/MS priori prioritize/DSRGZJ priority/MS prior/YS priory/SM Pris Prisca/M Priscella/M Priscilla/M prised prise/GMAS prismatic prism/MS prison/DRMSGZ prisoner/M Prissie/M prissily prissiness/SM prissy/RSPT pristine/Y prithee/S privacy/MS privateer/SMDG privateness/M private/NVYTRSXP privation/MCS privative/Y privatization/S privatize/GSD privet/SM privileged/U privilege/SDMG privily privy/SRMT prized/A prize/DSRGZM prizefighter/M prizefighting/M prizefight/SRMGJZ prizewinner/S prizewinning Pr/MN PRO proactive probabilist probabilistic probabilistically probability/SM probable/S probably probated/A probate/NVMX probates/A probating/A probational probationary/S probationer/M probation/MRZ probation's/A probative/A prober/M probity/SM problematical/UY problematic/S problem/SM proboscis/MS prob/RBJ procaine/MS procedural/SY procedure/MS proceeder/M proceeding/M proceed/JRDSG process/BSDMG processed/UA processes/A processional/YS procession/GD processor/MS proclamation/MS proclivity/MS proconsular procrastinate/XNGDS procrastination/M procrastinator/MS procreational procreatory procrustean Procrustean Procrustes/M proctor/GSDM proctorial procurable/U procure/L procurement/MS Procyon/M prodded prodding prodigality/S prodigal/SY prodigiousness/M prodigious/PY prodigy/MS prod/S produce/AZGDRS producer/AM producible/A production/ASM productively/UA productiveness/MS productive/PY productivities productivity/A productivity's productize/GZRSD product/V Prof profanation/S profaneness/MS profane/YPDRSG profanity/MS professed/Y professionalism/SM professionalize/GSD professional/USY profession/SM professorial/Y professorship/SM professor/SM proffer/GSD proficiency/SM proficient/YS profitability/MS profitableness/MU profitable/UP profitably/U profiteer/GSMD profiterole/MS profit/GZDRB profitless profligacy/S profligate/YS proforma/S profoundity profoundness/SM profound/PTYR prof/S profundity/MS profuseness/MS profuse/YP progenitor/SM progeny/M progesterone/SM prognathous prognoses prognosis/M prognosticate/NGVXDS prognostication/M prognosticator/S prognostic/S program/CSA programed programing programmability programmable/S programmed/CA programmer/ASM programming/CA programmings progression/SM progressiveness/SM progressive/SPY progressivism progress/MSDVG prohibiter/M prohibitionist/MS prohibition/MS Prohibition/MS prohibitiveness/M prohibitive/PY prohibitory prohibit/VGSRD projected/AU projectile/MS projectionist/MS projection/MS projective/Y project/MDVGS projector/SM Prokofieff/M Prokofiev/M prolegomena proletarianization/M proletarianized proletarian/S proletariat/SM proliferate/GNVDSX proliferation/M prolifically prolific/P prolixity/MS prolix/Y prologize prologue/MGSD prologuize prolongate/NGSDX prolongation/M prolonger/M prolong/G promenade/GZMSRD promenader/M Promethean Prometheus/M promethium/SM prominence/MS prominent/Y promiscuity/MS promiscuousness/M promiscuous/PY promise/GD promising/UY promissory promontory/MS promote/GVZBDR promoter/M promotiveness/M promotive/P prompted/U prompter/M promptitude/SM promptness/MS prompt/SGJTZPYDR pro/MS promulgate/NGSDX promulgation/M promulgator/MS pron proneness/MS prone/PY pronghorn/SM prong/SGMD pronominalization pronominalize pronounceable/U pronouncedly pronounced/U pronounce/GLSRD pronouncement/SM pronouncer/M pronto pronunciation/SM proofed/A proofer proofing/M proofreader/M proofread/GZSR proof/SEAM propaganda/SM propagandistic propagandist/SM propagandize/DSG propagated/U propagate/SDVNGX propagation/M propagator/MS propellant/MS propelled propeller/MS propelling propel/S propensity/MS properness/M proper/PYRT propertied/U property/SDM prophecy/SM prophesier/M prophesy/GRSDZ prophetess/S prophetic prophetical/Y prophet/SM prophylactic/S prophylaxes prophylaxis/M propinquity/MS propionate/M propitiate/GNXSD propitiatory propitiousness/M propitious/YP proponent/MS proportionality/M proportional/SY proportionate/YGESD proportioner/M proportion/ESGDM proportionment/M proposal/SM propped propping proprietary/S proprietorial proprietorship/SM proprietor/SM proprietress/MS propriety/MS proprioception proprioceptive prop/SZ propulsion/MS propulsive propylene/M prorogation/SM prorogue prosaic prosaically proscenium/MS prosciutti prosciutto/SM proscription/SM proscriptive pros/DSRG prosecute/SDBXNG prosecution/M prosecutor/MS proselyte/SDGM proselytism/MS proselytize/ZGDSR prose/M proser/M Proserpine/M prosodic/S prosody/MS prospect/DMSVG prospection/SM prospectiveness/M prospective/SYP prospector/MS prospectus/SM prosper/GSD prosperity/MS prosperousness/M prosperous/PY prostate prostheses prosthesis/M prosthetic/S prosthetics/M prostitute/DSXNGM prostitution/M prostrate/SDXNG prostration/M prosy/RT protactinium/MS protagonist/SM Protagoras/M protean/S protease/M protect/DVGS protected/UY protectionism/MS protectionist/MS protection/MS protectiveness/S protective/YPS protectorate/SM protector/MS protégées protégé/SM protein/MS proteolysis/M proteolytic Proterozoic/M protestantism Protestantism/MS protestant/S Protestant/SM protestation/MS protest/G protesting/Y Proteus/M protocol/DMGS protoplasmic protoplasm/MS prototype/SDGM prototypic prototypical/Y protozoa protozoan/MS protozoic protozoon's protract/DG protrude/SDG protrusile protrusion/MS protrusive/PY protuberance/S protuberant Proudhon/M proud/TRY Proust/M provabilities provability's provability/U provableness/M provable/P provably prov/DRGZB proved/U proven/U prove/ESDAG provenance/SM Provençal Provencals Provence/M provender/SDG provenience/SM provenly proverb/DG proverbial/Y Proverbs/M prover/M provide/DRSBGZ provided/U providence/SM Providence/SM providential/Y provident/Y provider/M province/SM provincialism/SM provincial/SY provisional/YS provisioner/M provision/R proviso/MS provocateur/S provocativeness/SM provocative/P provoked/U provoke/GZDRS provoking/Y provolone/SM Provo/M provost/MS prowess/SM prowler/M prowl/RDSZG prow/TRMS proximal/Y proximateness/M proximate/PY proximity/MS Proxmire/M proxy/SM Prozac prude/MS Prudence/M prudence/SM Prudential/M prudential/SY prudent/Y prudery/MS Prudi/M prudishness/SM prudish/YP Prudy/M Prue/M Pruitt/M Pru/M prune/DSRGZM pruner/M prurience/MS prurient/Y Prussia/M Prussian/S prussic Prut/M Pryce/M pry/DRSGTZ pryer's prying/Y P's PS p's/A psalmist/SM psalm/SGDM Psalms/M psalter Psalter/SM psaltery/MS psephologist/M pseudonymous pseudonym/SM pseudopod pseudo/S pseudoscience/S pshaw/SDG psi/S psittacoses psittacosis/M psoriases psoriasis/M psst/S PST psychedelically psychedelic/S psyche/M Psyche/M psychiatric psychiatrist/SM psychiatry/MS psychical/Y psychic/MS psychoacoustic/S psychoacoustics/M psychoactive psychoanalysis/M psychoanalyst/S psychoanalytic psychoanalytical psychoanalyze/SDG psychobabble/S psychobiology/M psychocultural psychodrama/MS psychogenic psychokinesis/M psycholinguistic/S psycholinguistics/M psycholinguists psychological/Y psychologist/MS psychology/MS psychometric/S psychometrics/M psychometry/M psychoneuroses psychoneurosis/M psychopathic/S psychopath/M psychopathology/M psychopaths psychopathy/SM psychophysical/Y psychophysic/S psychophysics/M psychophysiology/M psychosis/M psycho/SM psychosocial/Y psychosomatic/S psychosomatics/M psychos/S psychotherapeutic/S psychotherapist/MS psychotherapy/SM psychotically psychotic/S psychotropic/S psychs psych/SDG PT PTA Ptah/M ptarmigan/MS pt/C pterodactyl/SM Pt/M PTO Ptolemaic Ptolemaists Ptolemy/MS ptomaine/MS Pu pubbed pubbing pubertal puberty/MS pubes pubescence/S pubescent pubic pubis/M publican/AMS publication/AMS publicist/SM publicity/SM publicized/U publicize/SDG publicness/M publics/A public/YSP publishable/U published/UA publisher/ASM publishes/A publishing/M publish/JDRSBZG pub/MS Puccini/M puce/SM pucker/DG Puckett/M puck/GZSDRM puckishness/S puckish/YP Puck/M pudding/MS puddle/JMGRSD puddler/M puddling/M puddly pudenda pudendum/M pudginess/SM pudgy/PRT Puebla/M Pueblo/MS pueblo/SM puerile/Y puerility/SM puerperal puers Puerto/M puffball/SM puffer/M puffery/M puffiness/S puffin/SM Puff/M puff/SGZDRM puffy/PRT Puget/M pugged pugging Pugh/M pugilism/SM pugilistic pugilist/S pug/MS pugnaciousness/MS pugnacious/YP pugnacity/SM puissant/Y puke/GDS pukka Pulaski/SM pulchritude/SM pulchritudinous/M pule/GDS Pulitzer/SM pullback/S pull/DRGZSJ pullet/SM pulley/SM Pullman/MS pullout/S pullover/SM pulmonary pulpiness/S pulpit/MS pulp/MDRGS pulpwood/MS pulpy/PTR pulsar/MS pulsate/NGSDX pulsation/M pulse/ADSG pulser pulse's pulverable pulverization/MS pulverized/U pulverize/GZSRD pulverizer/M pulverizes/UA puma/SM pumice/SDMG pummel/SDG pumpernickel/SM pump/GZSMDR pumping/M pumpkin/MS punchbowl/M punched/U puncheon/MS puncher/M punch/GRSDJBZ punchline/S Punch/M punchy/RT punctilio/SM punctiliousness/SM punctilious/PY punctualities punctuality/UM punctualness/M punctual/PY punctuate/SDXNG punctuational punctuation/M puncture/SDMG punditry/S pundit/SM pungency/MS pungent/Y Punic puniness/MS punished/U punisher/M punishment/MS punish/RSDGBL punitiveness/M punitive/YP Punjabi/M Punjab/M punk/TRMS punky/PRS pun/MS punned punning punster/SM punter/M punt/GZMDRS puny/PTR pupae pupal pupa/M pupate/NGSD pupillage/M pupil/SM pup/MS pupped puppeteer/SM puppetry/MS puppet/SM pupping puppy/GSDM puppyish purblind Purcell/M purchasable purchase/GASD purchaser/MS purdah/M purdahs Purdue/M purebred/S puree/DSM pureeing pureness/MS pure/PYTGDR purgation/M purgative/MS purgatorial purgatory/SM purge/GZDSR purger/M purify/GSRDNXZ Purim/SM Purina/M purine/SM purism/MS puristic purist/MS puritanic puritanical/Y Puritanism/MS puritanism/S puritan/SM Puritan/SM purity/SM purlieu/SM purl/MDGS purloin/DRGS purloiner/M purple/MTGRSD purplish purport/DRSZG purported/Y purposefulness/S purposeful/YP purposelessness/M purposeless/PY purpose/SDVGYM purposiveness/M purposive/YP purr/DSG purring/Y purse/DSRGZM purser/M pursuance/MS pursuant pursuer/M pursue/ZGRSD pursuit/MS purulence/MS purulent Purus purveyance/MS purvey/DGS purveyor/MS purview/SM Pusan/M Pusey/M pushbutton/S pushcart/SM pushchair/SM pushdown push/DSRBGZ pusher/M pushily pushiness/MS Pushkin/M pushover/SM Pushtu/M pushy/PRT pusillanimity/MS pusillanimous/Y pus/SM puss/S pussycat/S pussyfoot/DSG pussy/TRSM pustular pustule/MS putative/Y Putin/M put/IS Putnam/M Putnem/M putout/S putrefaction/SM putrefactive putrefy/DSG putrescence/MS putrescent putridity/M putridness/M putrid/YP putsch/S putted/I puttee/MS putter/RDMGZ putting/I putt/SGZMDR puttying/M putty/SDMG puzzle/JRSDZLG puzzlement/MS puzzler/M PVC pvt Pvt/M PW PX p/XTGJ Pygmalion/M pygmy/SM Pygmy/SM Pyhrric/M pyknotic Pyle/M pylon/SM pylori pyloric pylorus/M Pym/M Pynchon/M Pyongyang/M pyorrhea/SM Pyotr/M pyramidal/Y pyramid/GMDS pyre/MS Pyrenees Pyrex/SM pyridine/M pyrimidine/SM pyrite/MS pyroelectric pyroelectricity/SM pyrolysis/M pyrolyze/RSM pyromaniac/SM pyromania/MS pyrometer/MS pyrometry/M pyrophosphate/M pyrotechnical pyrotechnic/S pyrotechnics/M pyroxene/M pyroxenite/M Pyrrhic Pythagoras/M Pythagorean/S Pythias Python/M python/MS pyx/MDSG q Q QA Qaddafi/M Qantas/M Qatar/M QB QC QED Qingdao Qiqihar/M QM Qom/M qr q's Q's qt qty qua Quaalude/M quackery/MS quackish quack/SDG quadded quadding quadrangle/MS quadrangular/M quadrant/MS quadraphonic/S quadrapole quadratical/Y quadratic/SM quadrature/MS quadrennial/SY quadrennium/MS quadric quadriceps/SM quadrilateral/S quadrille/XMGNSD quadrillion/MH quadripartite/NY quadriplegia/SM quadriplegic/SM quadrivia quadrivium/M quadrupedal quadruped/MS quadruple/GSD quadruplet/SM quadruplicate/GDS quadruply/NX quadrupole quad/SM quadword/MS quaffer/M quaff/SRDG quagmire/DSMG quahog/MS quail/GSDM quaintness/MS quaint/PTYR quake/GZDSR Quakeress/M Quakerism/S Quaker/SM quaky/RT qualification/ME qualified/UY qualifier/SM qualify/EGXSDN qualitative/Y quality/MS qualmish qualm/SM quandary/MS quangos quanta/M Quantico/M quantifiable/U quantified/U quantifier/M quantify/GNSRDZX quantile/S quantitativeness/M quantitative/PY quantity/MS quantization/MS quantizer/M quantize/ZGDRS quantum/M quarantine/DSGM quark/SM quarreler/M quarrellings quarrelsomeness/MS quarrelsome/PY quarrel/SZDRMG quarrier/M quarryman/M quarrymen quarry/RSDGM quarterback/SGMD quarterdeck/MS quarterer/M quarterfinal/MS quartering/M quarterly/S quartermaster/MS quarter/MDRYG quarterstaff/M quarterstaves quartet/SM quartic/S quartile/SM quarto/SM quart/RMSZ quartzite/M quartz/SM quasar/SM quash/GSD quasi quasilinear Quasimodo/M Quaternary quaternary/S quaternion/SM quatrain/SM quaver/GDS quavering/Y quavery Quayle/M quayside/M quay/SM queasily queasiness/SM queasy/TRP Quebec/M Quechua/M Queenie/M queenly/RT queen/SGMDY Queensland/M Queen/SM queerness/S queer/STGRDYP queller/M quell/SRDG Que/M quenchable/U quenched/U quencher/M quench/GZRSDB quenchless Quentin/M Quent/M Querida/M quern/M querulousness/S querulous/YP query/MGRSD quested/A quester/AS quester's quest/FSIM questing questionableness/M questionable/P questionably/U questioned/UA questioner/M questioning/UY questionnaire/MS question/SMRDGBZJ quests/A Quetzalcoatl/M queued/C queue/GZMDSR queuer/M queues/C queuing/C Quezon/M quibble/GZRSD quibbler/M quiche/SM quicken/RDG quickie/MS quicklime/SM quickness/MS quick/RNYTXPS quicksand/MS quicksilver/GDMS quickstep/SM quid/SM quiesce/D quiescence/MS quiescent/YP quieted/E quieten/SGD quieter/E quieter's quieting/E quietly/E quietness/MS quiets/E quietude/IEMS quietus/MS quiet/UTGPSDRY Quillan/M quill/GSDM Quill/M quilter/M quilting/M quilt/SZJGRDM quincentenary/M quince/SM Quincey/M quincy/M Quincy/M quinine/MS Quinlan/M Quinn/M quinquennial/Y quinsy/SM Quinta/M Quintana/M quintessence/SM quintessential/Y quintet/SM quintic quintile/SM Quintilian/M Quintilla/M quintillion/MH quintillionth/M Quintina/M Quintin/M Quint/M quint/MS Quinton/M quintuple/SDG quintuplet/MS Quintus/M quip/MS quipped quipper quipping quipster/SM quired/AI quire/MDSG quires/AI Quirinal/M quiring/IA quirkiness/SM quirk/SGMD quirky/PTR quirt/SDMG Quisling/M quisling/SM quitclaim/GDMS quit/DGS quite/SADG Quito/M quittance/SM quitter/SM quitting quiver/GDS quivering/Y quivery Quixote/M quixotic quixotically Quixotism/M quiz/M quizzed quizzer/SM quizzes quizzical/Y quizzing quo/H quoin/SGMD quoit/GSDM quondam quonset Quonset quorate/I quorum/MS quotability/S quota/MS quotation/SM quoter/M quote/UGSD quot/GDRB quotidian/S quotient/SM qwerty qwertys Rabat/M rabbet/GSMD Rabbi/M rabbi/MS rabbinate/MS rabbinic rabbinical/Y rabbiter/M rabbit/MRDSG rabble/GMRSD rabbler/M Rabelaisian Rabelais/M rabidness/SM rabid/YP rabies Rabi/M Rabin/M rabis Rab/M raccoon/SM racecourse/MS racegoers racehorse/SM raceme/MS race/MZGDRSJ racer/M racetrack/SMR raceway/SM Rachael/M Rachele/M Rachelle/M Rachel/M Rachmaninoff/M racialism/MS racialist/MS racial/Y racily Racine/M raciness/MS racism/S racist/MS racketeer/MDSJG racket/SMDG rackety rack/GDRMS raconteur/SM racoon's racquetball/S racquet's racy/RTP radarscope/MS radar/SM Radcliffe/M radded radder raddest Raddie/M radding Raddy/M radial/SY radiance/SM radian/SM radiant/YS radiate/XSDYVNG radiation/M radiative/Y radiator/MS radicalism/MS radicalization/S radicalize/GSD radicalness/M radical/SPY radices's radii/M radioactive/Y radioactivity/MS radioastronomical radioastronomy radiocarbon/MS radiochemical/Y radiochemistry/M radiogalaxy/S radiogram/SM radiographer/MS radiographic radiography/MS radioisotope/SM radiologic radiological/Y radiologist/MS radiology/MS radioman/M radiomen radiometer/SM radiometric radiometry/MS radionics radionuclide/M radiopasteurization radiophone/MS radiophysics radioscopy/SM radio/SMDG radiosonde/SM radiosterilization radiosterilized radiotelegraph radiotelegraphs radiotelegraphy/MS radiotelephone/SM radiotherapist/SM radiotherapy/SM radish/MS radium/MS radius/M radix/SM Rad/M radon/SM rad/S Raeann/M Rae/M RAF Rafaela/M Rafaelia/M Rafaelita/M Rafaellle/M Rafaello/M Rafael/M Rafa/M Rafe/M Raffaello/M Raffarty/M Rafferty/M raffia/SM raffishness/SM raffish/PY raffle/MSDG Raff/M Rafi/M Raf/M rafter/DM raft/GZSMDR raga/MS ragamuffin/MS ragbag/SM rage/MS raggedness/SM ragged/PRYT raggedy/TR ragging rag/GSMD raging/Y raglan/MS Ragnar/M Ragnarök ragout/SMDG ragtag/MS ragtime/MS ragweed/MS ragwort/M Rahal/M rah/DG Rahel/M rahs raider/M raid/MDRSGZ railbird/S rail/CDGS railer/SM railhead/SM railing/MS raillery/MS railroader/M railroading/M railroad/SZRDMGJ rail's railwaymen railway/MS raiment/SM Raimondo/M Raimund/M Raimundo/M Raina/M rainbow/MS raincloud/S raincoat/SM raindrop/SM Raine/MR Rainer/M rainfall/SM rainforest's rain/GSDM Rainier/M rainless rainmaker/SM rainmaking/MS rainproof/GSD rainstorm/SM rainwater/MS rainy/RT raise/DSRGZ raiser/M raising/M raisin/MS rajah/M rajahs Rajive/M raj/M Rakel/M rake/MGDRS raker/M rakishness/MS rakish/PY Raleigh/M Ralf/M Ralina/M rally/GSD Ralph/M Ralston/M Ra/M Ramada/M Ramadan/SM Ramakrishna/M Rama/M Raman/M Ramayana/M ramble/JRSDGZ rambler/M rambling/Y Rambo/M rambunctiousness/S rambunctious/PY ramekin/SM ramie/MS ramification/M ramify/XNGSD Ramirez/M Ramiro/M ramjet/SM Ram/M rammed ramming Ramo/MS Ramona/M Ramonda/M Ramon/M rampage/SDG rampancy/S rampant/Y rampart/SGMD ramp/GMDS ramrodded ramrodding ramrod/MS RAM/S Ramsay/M Ramses/M Ramsey/M ramshackle ram/SM rams/S ran/A Rana/M Rancell/M Rance/M rancher/M rancho/SM ranch/ZRSDMJG rancidity/MS rancidness/SM rancid/P rancorous/Y rancor/SM Randall/M Randal/M Randa/M Randee/M Randell/M Randene/M Randie/M Randi/M randiness/S Rand/M rand/MDGS Randolf/M Randolph/M randomization/SM randomize/SRDG randomness/SM random/PYS Randy/M randy/PRST Ranee/M ranee/SM ranged/C rangeland/S ranger/M ranges/C range/SM rang/GZDR ranginess/S ranging/C Rangoon/M rangy/RPT Rania/M Ranice/M Ranier/M Rani/MR Ranique/M rani's ranked/U ranker/M rank/GZTYDRMPJS Rankine/M ranking/M Rankin/M rankle/SDG rankness/MS Ranna/M ransacker/M ransack/GRDS Ransell/M ransomer/M Ransom/M ransom/ZGMRDS ranter/M rant/GZDRJS ranting/Y Raoul/M rapaciousness/MS rapacious/YP rapacity/MS rapeseed/M rape/SM Raphaela/M Raphael/M rapidity/MS rapidness/S rapid/YRPST rapier/SM rapine/SM rapist/MS rap/MDRSZG rapped rappelled rappelling rappel/S rapper/SM rapping/M rapporteur/SM rapport/SM rapprochement/SM rapscallion/MS raptness/S rapture/MGSD rapturousness/M rapturous/YP rapt/YP Rapunzel/M Raquela/M Raquel/M rarebit/MS rarefaction/MS rarefy/GSD rareness/MS rare/YTPGDRS rarity/SM Rasalgethi/M Rasalhague/M rascal/SMY rasher/M rashness/S rash/PZTYSR Rasia/M Rasla/M Rasmussen/M raspberry/SM rasper/M rasping/Y rasp/SGJMDR Rasputin/M raspy/RT Rastaban/M Rastafarian/M raster/MS Rastus/M ratchet/MDSG rateable rated/U rate/KNGSD ratepayer/SM rater/M rate's Ratfor/M rather Rather/M rathskeller/SM ratifier/M ratify/ZSRDGXN rating/M ratiocinate/VNGSDX ratiocination/M ratio/MS rationale/SM rationalism/SM rationalistic rationalist/S rationality/MS rationalization/SM rationalizer/M rationalize/ZGSRD rationalness/M rational/YPS ration/DSMG Ratliff/M ratlike ratline/SM rat/MDRSJZGB rattail rattan/MS ratted ratter/MS ratting rattlebrain/DMS rattle/RSDJGZ rattlesnake/MS rattletrap/MS rattling/Y rattly/TR rattrap/SM ratty/RT raucousness/SM raucous/YP Raul/M raunchily raunchiness/S raunchy/RTP ravage/GZRSD ravager/M raveling/S Ravel/M ravel/UGDS raven/JGMRDS Raven/M ravenous/YP raver/M rave/ZGDRSJ Ravid/M Ravi/M ravine/SDGM ravioli/SM ravisher/M ravishing/Y ravish/LSRDZG ravishment/SM Raviv/M Rawalpindi/M rawboned rawhide/SDMG Rawley/M Rawlings/M Rawlins/M Rawlinson/M rawness/SM raw/PSRYT Rawson/M Rayburn/M Raychel/M Raye/M ray/GSMD Rayleigh/M Ray/M Raymond/M Raymondville/M Raymund/M Raymundo/M Rayna/M Raynard/M Raynell/M Rayner/M Raynor/M rayon/SM Rayshell/M Raytheon/M raze/DRSG razer/M razorback/SM razorblades razor/MDGS razz/GDS razzmatazz/S Rb RBI/S RC RCA rcpt RCS rd RD RDA Rd/M reabbreviate reachability reachable/U reachably reached/U reacher/M reach/GRB reacquisition reactant/SM reacted/U reaction reactionary/SM reactivity readability/MS readable/P readably readdress/G Reade/M reader/M readership/MS Read/GM readied readies readily readinesses readiness/UM reading/M Reading/M read/JGZBR readopt/G readout/MS reads/A readying ready/TUPR Reagan/M Reagen/M realisms realism's realism/U realistically/U realistic/U realist/SM reality/USM realizability/MS realizableness/M realizable/SMP realizably/S realization/MS realized/U realize/JRSDBZG realizer/M realizes/U realizing/MY realm/M realness/S realpolitik/SM real/RSTP realtor's Realtor/S realty/SM Rea/M reamer/M ream/MDRGZ Reamonn/M reanimate reaper/M reappraise/G reap/SGZ rear/DRMSG rearguard/MS rearmost rearrange/L rearward/S reasonableness/SMU reasonable/UP reasonably/U Reasoner/M reasoner/SM reasoning/MS reasonless reasons reason/UBDMG reassess/GL reassuringly/U reattach/GSL reawakening/M Reba/M rebate/M Rebbecca/M Rebeca/M Rebecca's Rebecka/M Rebekah/M Rebeka/M Rebekkah/M rebeller rebellion/SM rebelliousness/MS rebellious/YP rebel/MS Rebe/M rebid rebidding rebind/G rebirth reboil/G rebook reboot/ZR rebound/G rebroadcast/MG rebuke/RSDG rebuking/Y rebus rebuttal/SM rebutting rec recalcitrance/SM recalcitrant/S recalibrate/N recantation/S recant/G recap recappable recapping recast/G recd rec'd recede receipt/SGDM receivable/S received/U receiver/M receivership/SM receive/ZGRSDB recency/M recension/M recentness/SM recent/YPT receptacle/SM receptionist/MS reception/MS receptiveness/S receptive/YP receptivity/S receptor/MS recessional/S recessionary recessiveness/M recessive/YPS recess/SDMVG rechargeable recheck/G recherché recherches recidivism/MS recidivist/MS Recife/M recipe/MS recipiency recipient/MS reciprocal/SY reciprocate/NGXVDS reciprocation/M reciprocity/MS recitalist/S recital/MS recitative/MS reciter/M recite/ZR recked recking recklessness/S reckless/PY reckoner/M reckoning/M reckon/SGRDJ reclaim/B reclamation/SM recliner/M recline/RSDZG recluse/MVNS reclusion/M recode/G recognizability recognizable/U recognizably recognize/BZGSRD recognizedly/S recognized/U recognizer/M recognizingly/S recognizing/UY recoilless recoinage recolor/GD recombinant recombine recommended/U recompense/GDS recompute/B reconciled/U reconciler/M reconcile/SRDGB reconditeness/M recondite/YP reconfigurability reconfigure/R reconnaissance/MS reconnect/R reconnoiter/GSD reconquer/G reconsecrate reconstitute reconstructed/U Reconstruction/M reconsult/G recontact/G recontaminate/N recontribute recook/G recopy/G recorded/AU records/A record/ZGJ recourse recoverability recoverable/U recover/B recovery/MS recreant/S recreational recriminate/GNVXDS recrimination/M recriminatory recross/G recrudesce/GDS recrudescence/MS recrudescent recruiter/M recruitment/MS recruit/ZSGDRML recrystallize rectal/Y rectangle/SM rectangular/Y recta's rectifiable rectification/M rectifier/M rectify/DRSGXZN rectilinear/Y rectitude/MS recto/MS rector/SM rectory/MS rectum/SM recumbent/Y recuperate/VGNSDX recuperation/M recur recurrence/MS recurrent recurse/NX recursion/M recusant/M recuse recyclable/S recycle/BZ redact/DGS redaction/SM redactor/MS redbird/SM redbreast/SM redbrick/M redbud/M redcap/MS redcoat/SM redcurrant/M redden/DGS redder reddest redding reddish/P Redd/M redeclaration redecorate redeemable/U redeem/BRZ redeemed/U redeemer/M Redeemer/M redemptioner/M redemption/RMS redemptive redeposit/M redetermination Redford/M Redgrave/M redhead/DRMS Redhook/M redial/G redirect/G redirection redlining/S Redmond/M redneck/SMD redness/MS redo/G redolence/MS redolent Redondo/M redouble/S redoubtably redound/GDS red/PYS redshift/S redskin/SM Redstone/M reduced/U reducer/M reduce/RSDGZ reducibility/M reducible reducibly reductionism/M reductionist/S reduction/SM reduct/V redundancy/SM redundant/Y redwood/SM redye redyeing Reeba/M Reebok/M Reece/M reecho/G reed/GMDR reediness/SM reeding/M Reed/M Reedville/M reedy/PTR reefer/M reef/GZSDRM reeker/M reek/GSR reeler/M reel's reel/USDG Ree/MDS Reena/M reenforcement reentrant Reese/M reestimate/M Reeta/M Reeva/M reeve/G Reeves reexamine refection/SM refectory/SM refer/B refereed/U refereeing referee/MSD reference/CGSRD referenced/U reference's referencing/U referendum/MS referentiality referential/YM referent/SM referral/SM referred referrer/S referring reffed reffing refile refinance refined/U refine/LZ refinement/MS refinish/G refit reflectance/M reflected/U reflectional reflection/SM reflectiveness/M reflective/YP reflectivity/M reflector/MS reflect/SDGV reflexion/MS reflexiveness/M reflexive/PSY reflexivity/M reflex/YV reflooring refluent reflux/G refocus/G refold/G reforestation reforge/G reformatory/SM reform/B reformed/U reformer/M reformism/M reformist/S refract/DGVS refractiveness/M refractive/PY refractometer/MS refractoriness/M refractory/PS refrain/DGS refreshed/U refreshing/Y refresh/LB refreshment/MS refrigerant/MS refrigerated/U refrigerate/XDSGN refrigeration/M refrigerator/MS refrozen refry/GS refugee/MS refuge/SDGM Refugio/M refulgence/SM refulgent refund/B refunder/M refurbish/L refurbishment/S refusal/SM refuse/R refuser/M refutation/MS refute/GZRSDB refuter/M ref/ZS reg regale/L regalement/S regal/GYRD regalia/M Regan/M regard/EGDS regardless/PY regather/G regatta/MS regency/MS regeneracy/MS regenerately regenerateness/M regenerate/U Regen/M reggae/SM Reggie/M Reggi/MS Reggy/M regicide/SM regime/MS regimen/MS regimental/S regimentation/MS regiment/SDMG Reginae Reginald/M Regina/M Reginauld/M Regine/M regionalism/MS regional/SY region/SM Regis/M register's register/UDSG registrable registrant/SM registrar/SM registration/AM registrations registry/MS Reg/MN regnant Regor/M regress/DSGV regression/MS regressiveness/M regressive/PY regressors regretfulness/M regretful/PY regret/S regrettable regrettably regretted regretting reground regroup/G regrow/G regularity/MS regularization/MS regularize/SDG regular/YS regulate/CSDXNG regulated/U regulation/M regulative regulator/SM regulatory Regulus/M regurgitate/XGNSD regurgitation/M rehabbed rehabbing rehabilitate/SDXVGN rehabilitation/M rehab/S rehang/G rehear/GJ rehearsal/SM rehearse rehearsed/U rehearser/M rehears/R reheat/G reheating/M Rehnquist rehydrate Reichenberg/M Reich/M Reichstags Reichstag's Reidar/M Reider/M Reid/MR reign/MDSG Reiko/M Reilly/M reimburse/GSDBL reimbursement/MS Reinald/M Reinaldo/MS Reina/M reindeer/M Reine/M reinforced/U reinforce/GSRDL reinforcement/MS reinforcer/M rein/GDM Reinhard/M Reinhardt/M Reinhold/M Reinold/M reinstate/L reinstatement/MS reinsurance Reinwald/M reissue REIT reiterative/SP rejecter/M rejecting/Y rejection/SM rejector/MS reject/RDVGS rejigger rejoice/RSDJG rejoicing/Y rejoinder/SM rejuvenate/NGSDX rejuvenatory relapse relatedly relatedness/MS related/U relater/M relate/XVNGSZ relational/Y relation/M relationship/MS relativeness/M relative/SPY relativism/M relativistic relativistically relativist/MS relativity/MS relator's relaxant/SM relaxation/MS relaxedness/M relaxed/YP relax/GZD relaxing/Y relay/GDM relearn/G releasable/U release/B released/U relenting/U relentlessness/SM relentless/PY relent/SDG relevance/SM relevancy/MS relevant/Y reliability/UMS reliables reliable/U reliably/U reliance/MS reliant/Y relicense/R relic/MS relict/C relict's relief/M relievedly relieved/U reliever/M relieve/RSDZG religionists religion/SM religiosity/M religiousness/MS religious/PY relink/G relinquish/GSDL relinquishment/SM reliquary/MS relish/GSD relive/GB reload/GR relocate/B reluctance/MS reluctant/Y rel/V rely/DG rem Re/M remade/S remainder/SGMD remain/GD remake/M remand/DGS remap remapping remarkableness/S remarkable/U remarkably remark/BG remarked/U Remarque/M rematch/G Rembrandt/M remeasure/D remediableness/M remediable/P remedy/SDMG remembered/U rememberer/M remember/GR remembrance/MRS remembrancer/M Remington/M reminisce/GSD reminiscence/SM reminiscent/Y remissness/MS remiss/YP remit/S remittance/MS remitted remitting/U Rem/M remnant/MS remodel/G remolding remonstrant/MS remonstrate/SDXVNG remonstration/M remonstrative/Y remorsefulness/M remorseful/PY remorselessness/MS remorseless/YP remorse/SM remoteness/MS remote/RPTY remoulds removal/MS REM/S remunerated/U remunerate/VNGXSD remuneration/M remunerativeness/M remunerative/YP Remus/M Remy/M Renado/M Renae/M renaissance/S Renaissance/SM renal Renaldo/M Rena/M Renard/M Renascence/SM Renata/M Renate/M Renato/M renaturation Renaud/M Renault/MS rend renderer/M render/GJRD rendering/M rendezvous/DSMG rendition/GSDM rend/RGZS Renee/M renegade/SDMG renege/GZRSD reneger/M Renelle/M Renell/M Rene/M renewal/MS renew/BG renewer/M Renie/M rennet/MS Rennie/M rennin/SM Renoir/M Reno/M renounce/LGRSD renouncement/MS renouncer/M renovate/NGXSD renovation/M renovator/SM renown/SGDM Rensselaer/M rentaller rental/SM renter/M rent/GZMDRS renumber/G renumeration renunciate/VNX renunciation/M Renville/M reoccupy/G reopen/G reorganized/U repack/G repairable/U repair/BZGR repairer/M repairman/M repairmen repairs/E repaper reparable reparation/SM reparteeing repartee/MDS repartition/Z repast/G repatriate/SDXNG repave repealer/M repeal/GR repeatability/M repeatable/U repeatably repeated/Y repeater/M repeat/RDJBZG repelled repellent/SY repelling/Y repel/S repentance/SM repentant/SY repent/RDG repertoire/SM repertory/SM repetition repetitiousness/S repetitious/YP repetitiveness/MS repetitive/PY repine/R repiner/M replace/RL replay/GM replenish/LRSDG replenishment/S repleteness/MS replete/SDPXGN repletion/M replica/SM replicate/SDVG replicator/S replug reply/X Rep/M repopulate reported/Y reportorial/Y reposeful repose/M repository/MS reprehend/GDS reprehensibility/MS reprehensibleness/M reprehensible/P reprehensibly reprehension/MS representable/U representational/Y representativeness/M Representative/S representative/SYMP representativity represented/U represent/GB repression/SM repressiveness/M repressive/YP repress/V reprieve/GDS reprimand/SGMD reprint/M reprisal/MS reproacher/M reproachfulness/M reproachful/YP reproach/GRSDB reproaching/Y reprobate/N reprocess/G reproducibility/MS reproducible/S reproducibly reproductive/S reproof/G reprove/R reproving/Y rep/S reptile/SM reptilian/S Republicanism/S republicanism/SM Republican/S republic/M republish/G repudiate/XGNSD repudiation/M repudiator/S repugnance/MS repugnant/Y repulse/VNX repulsion/M repulsiveness/MS repulsive/PY reputability/SM reputably/E reputation/SM reputed/Y repute/ESB reputing requested/U request/G Requiem/MS requiem/SM require/LR requirement/MS requisiteness/M requisite/PNXS requisitioner/M requisition/GDRM requital/MS requited/U requiter/M requite/RZ reread/G rerecord/G rerouteing rerunning res/C rescale rescind/SDRG rescission/SM rescue/GZRSD reseal/BG research/MB reselect/G resemblant resemble/DSG resend/G resent/DSLG resentfulness/SM resentful/PY resentment/MS reserpine/MS reservation/MS reservednesses reservedness/UM reserved/UYP reservist/SM reservoir/MS reset/RDG resettle/L reshipping reshow/G reshuffle/M reside/G residence/MS residency/SM residential/Y resident/SM resider/M residua residual/YS residuary residue/SM residuum/M resignation/MS resigned/YP resilience/MS resiliency/S resilient/Y resin/D resinlike resinous resiny resistance/SM Resistance/SM resistantly resistants resistant/U resisted/U resistible resistibly resisting/U resistiveness/M resistive/PY resistivity/M resistless resistor/MS resist/RDZVGS resize/G resold resole/G resoluble resoluteness/MS resolute/PYTRV resolvability/M resolvable/U resolved/U resolvent resonance/SM resonant/YS resonate/DSG resonator/MS resorption/MS resort/R resound/G resourcefulness/SM resourceful/PY resp respectability/SM respectable/SP respectably respect/BSDRMZGV respected/E respectful/EY respectfulness/SM respecting/E respectiveness/M respective/PY respect's/E respects/E respell/G respiration/MS respirator/SM respiratory/M resplendence/MS resplendent/Y respondent/MS respond/SDRZG responser/M response/RSXMV responsibility/MS responsibleness/M responsible/P responsibly responsiveness/MSU responsive/YPU respray/G restart/B restate/L restaurant/SM restaurateur/SM rest/DRSGVM rested/U rester/M restfuller restfullest restfulness/MS restful/YP restitution/SM restiveness/SM restive/PY restlessness/MS restless/YP restorability Restoration/M restoration/MS restorative/PYS restorer/M restore/Z restrained/UY restraint/MS restrict/DVGS restricted/YU restriction/SM restrictively restrictiveness/MS restrictives restrictive/U restroom/SM restructurability restructure rest's/U rests/U restudy/M restyle resubstitute resultant/YS result/SGMD resume/SDBG resumption/MS resurface resurgence/MS resurgent resurrect/GSD resurrection/SM resurvey/G resuscitate/XSDVNG resuscitation/M resuscitator/MS retail/Z retainer/M retain/LZGSRD retake retaliate/VNGXSD retaliation/M retaliatory Reta/M retardant/SM retardation/SM retarder/M retard/ZGRDS retch/SDG retention/SM retentiveness/S retentive/YP retentivity/M retest/G Retha/M rethought reticence/S reticent/Y reticle/SM reticular reticulate/GNYXSD reticulation/M reticule/MS reticulum/M retinal/S retina/SM retinue/MS retiredness/M retiree/MS retire/L retirement/SM retiring/YP retort/GD retract/DG retractile retrench/L retrenchment/MS retributed retribution/MS retributive retrieval/SM retriever/M retrieve/ZGDRSB retroactive/Y retrofire/GMSD retrofit/S retrofitted retrofitting retroflection retroflex/D retroflexion/M retrogradations retrograde/GYDS retrogression/MS retrogressive/Y retrogress/SDVG retrorocket/MS retro/SM retrospection/MS retrospective/SY retrospect/SVGMD retrovirus/S retrovision retry/G retsina/SM returnable/S returned/U returnee/SM retype Reube/M Reuben/M Reub/NM Reunion/M reuse/B Reuters Reuther/M reutilization Reuven/M Reva/M revanchist revealed/U revealingly revealing/U reveal/JBG reveille/MS revelation/MS Revelation/MS revelatory revelry/MS revel/SJRDGZ revenge/MGSRD revenger/M revenuer/M revenue/ZR reverberant reverberate/XVNGSD reverberation/M revere/GSD Revere/M reverencer/M reverence/SRDGM Reverend reverend/SM reverential/Y reverent/Y reverie/SM reversal/MS reverser/M reverse/Y reversibility/M reversible/S reversibly reversioner/M reversion/R revers/M reverter/M revertible revert/RDVGS revet/L revetment/SM review/G revile/GZSDL revilement/MS reviler/M revise/BRZ revised/U revisionary revisionism/SM revisionist/SM revitalize/ZR revivalism/MS revivalist/MS revival/SM reviver/M revive/RSDG revivification/M revivify/X Revkah/M Revlon/M Rev/M revocable revoke/GZRSD revolter/M revolt/GRD revolting/Y revolutionariness/M revolutionary/MSP revolutionist/MS revolutionize/GDSRZ revolutionizer/M revolution/SM revolve/BSRDZJG revolver/M revue/MS revulsion/MS revved revving rev/ZM rewarded/U rewarding/Y rewarm/G reweave rewedding reweigh/G rewind/BGR rewire/G rework/G rexes Rex/M Reyes Reykjavik/M re/YM Rey/M Reynaldo/M Reyna/M Reynard/M Reynold/SM rezone Rf RF RFC RFD R/G rhapsodic rhapsodical rhapsodize/GSD rhapsody/SM Rhea/M rhea/SM Rheba/M Rhee/M Rheims/M Rheinholdt/M Rhenish rhenium/MS rheology/M rheostat/MS rhesus/S Rheta/M rhetorical/YP rhetorician/MS rhetoric/MS Rhetta/M Rhett/M rheumatically rheumatic/S rheumatics/M rheumatism/SM rheumatoid rheum/MS rheumy/RT Rhiamon/M Rhianna/M Rhiannon/M Rhianon/M Rhinelander/M Rhineland/RM Rhine/M rhinestone/SM rhinitides rhinitis/M rhinoceros/MS rhino/MS rhinotracheitis rhizome/MS Rh/M Rhoda/M Rhodes Rhodesia/M Rhodesian/S Rhodia/M Rhodie/M rhodium/MS rhododendron/SM rhodolite/M rhodonite/M Rhody/M rhombic rhomboidal rhomboid/SM rhombus/SM rho/MS Rhona/M Rhonda/M Rhone rhubarb/MS rhyme/DSRGZM rhymester/MS Rhys/M rhythmical/Y rhythmic/S rhythmics/M rhythm/MS RI rial/MS Riane/M Riannon/M Rianon/M ribaldry/MS ribald/S ribbed Ribbentrop/M ribber/S ribbing/M ribbon/DMSG ribcage rib/MS riboflavin/MS ribonucleic ribosomal ribosome/MS Rica/M Rican/SM Ricard/M Ricardo/M Ricca/M Riccardo/M rice/DRSMZG Rice/M ricer/M Richard/MS Richardo/M Richardson/M Richart/M Richelieu/M richen/DG Richey/M Richfield/M Richie/M Richland/M Rich/M Richmond/M Richmound/M richness/MS Richter/M Richthofen/M Richy/M rich/YNSRPT Rici/M Rickard/M Rickenbacker/M Rickenbaugh/M Rickert/M rickets/M rickety/RT Rickey/M rick/GSDM Rickie/M Ricki/M Rick/M Rickover/M rickrack/MS rickshaw/SM Ricky/M Ric/M ricochet/GSD Rico/M Ricoriki/M ricotta/MS riddance/SM ridden ridding riddle/GMRSD Riddle/M ride/CZSGR Ride/M rider/CM riderless ridership/S ridge/DSGM Ridgefield/M ridgepole/SM Ridgway/M ridgy/RT ridicule/MGDRS ridiculer/M ridiculousness/MS ridiculous/PY riding/M rid/ZGRJSB Riemann/M Riesling/SM rife/RT riff/GSDM riffle/SDG riffraff/SM rifled/U rifle/GZMDSR rifleman/M riflemen rifler/M rifling/M rift/GSMD Riga/M rigamarole's rigatoni/M Rigel/M rigged rigger/SM rigging/MS Riggs/M righteousnesses/U righteousness/MS righteous/PYU rightfulness/MS rightful/PY rightism/SM rightist/S rightmost rightness/MS Right/S right/SGTPYRDN rightsize/SDG rights/M rightward/S rigidify/S rigidity/S rigidness/S rigid/YP rigmarole/MS rig/MS Rigoberto/M Rigoletto/M rigor/MS rigorousness/S rigorous/YP Riki/M Rikki/M Rik/M rile/DSG Riley/M Rilke/M rill/GSMD Rimbaud/M rime/MS rimer/M rim/GSMDR rimless rimmed rimming Rinaldo/M Rina/M rind/MDGS Rinehart/M ringer/M ring/GZJDRM ringing/Y ringleader/MS ringlet/SM ringlike Ringling/M Ring/M ringmaster/MS Ringo/M ringside/ZMRS ringworm/SM rink/GDRMS rinse/DSRG Riobard/M Rio/MS Riordan/M rioter/M riotousness/M riotous/PY riot/SMDRGZJ RIP riparian/S ripcord/SM ripened/U ripenesses ripeness/UM ripen/RDG ripe/PSY riper/U ripest/U Ripley/M Rip/M rip/NDRSXTG ripoff/S riposte/SDMG ripped ripper/SM ripping rippler/M ripple/RSDGM ripply/TR ripsaw/GDMS riptide/SM Risa/M RISC risen riser/M rise/RSJZG risibility/SM risible/S rising/M risker/M risk/GSDRM riskily riskiness/MS risky/RTP risotto/SM risqué rissole/M Ritalin Rita/M Ritchie/M rite/DSM Ritter/M ritualism/SM ritualistic ritualistically ritualized ritual/MSY Ritz/M ritzy/TR rivaled/U Rivalee/M rivalry/MS rival/SGDM Riva/MS rive/CSGRD Rivera/M riverbank/SM riverbed/S riverboat/S river/CM riverfront riverine Rivers Riverside/M riverside/S Riverview/M riveter/M rivet/GZSRDM riveting/Y Riviera/MS Rivi/M Rivkah/M rivulet/SM Rivy/M riv/ZGNDR Riyadh/M riyal/SM rm RMS RN RNA Rn/M roach/GSDM Roach/M roadbed/MS roadblock/SMDG roadhouse/SM roadie/S roadkill/S road/MIS roadrunner/MS roadshow/S roadside/S roadsigns roadster/SM roadsweepers roadway/SM roadwork/SM roadworthy roam/DRGZS Roana/M Roanna/M Roanne/M Roanoke/M roan/S roar/DRSJGZ roarer/M roaring/T Roarke/M roaster/M roast/SGJZRD robbed robber/SM Robbert/M robbery/SM Robbie/M Robbi/M robbing Robbin/MS Robb/M Robby/M Robbyn/M robe/ESDG Robena/M Robenia/M Robers/M Roberson/M Roberta/M Robert/MS Roberto/M Robertson/SM robe's Robeson/M Robespierre/M Robina/M Robinet/M Robinetta/M Robinette/M Robinett/M Robinia/M Robin/M robin/MS Robinson/M Robinsonville/M Robles/M Rob/MZ robotic/S robotism robotize/GDS robot/MS rob/SDG Robson/M Robt/M robustness/SM robust/RYPT Roby/M Robyn/M Rocco/M Rocha/M Rochambeau/M Rochella/M Rochelle/M Rochell/M Roche/M Rochester/M Rochette/M Roch/M rockabilly/MS rockabye Rockaway/MS rockbound Rockefeller/M rocker/M rocketry/MS rocket/SMDG Rockey/M rockfall/S Rockford/M rock/GZDRMS Rockie/M rockiness/MS Rockland/M Rock/M Rockne/M Rockville/M Rockwell/M Rocky/SM rocky/SRTP rococo/MS Roda/M rodded Roddenberry/M rodder Roddie/M rodding Rodd/M Roddy/M rodent/MS rodeo/SMDG Roderich/M Roderick/M Roderic/M Roderigo/M rode/S Rodger/M Rodge/ZMR Rodie/M Rodi/M Rodina/M Rodin/M Rod/M Rodney/M Rodolfo/M Rodolphe/M Rodolph/M Rodrick/M Rodrigo/M Rodriguez/M Rodrique/M Rodriquez/M rod/SGMD roebuck/SM Roentgen's roentgen/SM roe/SM ROFL Rogelio/M roger/GSD Rogerio/M Roger/M Roget/M Rog/MRZ rogued/K rogue/GMDS roguery/MS rogues/K roguing/K roguishness/SM roguish/PY roil/SGD Roi/SM roisterer/M roister/SZGRD Rojas/M Roland/M Rolando/M Roldan/M role/MS Roley/M Rolfe/M Rolf/M Rolland/M rollback/SM rolled/A Rollerblade/S rollerskating roller/SM rollick/DGS rollicking/Y Rollie/M rolling/S Rollin/SM Rollo/M rollover/S roll/UDSG Rolodex Rolph/M Rolvaag/M ROM romaine/MS Romain/M Roma/M romancer/M romance/RSDZMG Romanesque/S Romania/M Romanian/SM Romano/MS Romanov/M roman/S Romansh/M Romans/M Roman/SM romantically/U romanticism/MS Romanticism/S romanticist/S romanticize/SDG romantic/MS Romany/SM Romeo/MS romeo/S Romero/M Rome/SM Rommel/M Romney/M Romola/M Romona/M Romonda/M romper/M romp/GSZDR Rom/SM Romulus/M Romy/M Ronalda/M Ronald/M Rona/M Ronda/M rondo/SM Ronica/M Ron/M Ronna/M Ronnica/M Ronnie/M Ronni/M Ronny/M Ronstadt/M Rontgen Roobbie/M rood/MS roof/DRMJGZS roofer/M roofgarden roofing/M roofless rooftop/S rookery/MS rook/GDMS rookie/SRMT roomer/M roomette/SM roomful/MS roominess/MS roommate/SM room/MDRGZS roomy/TPSR Rooney/M Rooseveltian Roosevelt/M rooster/M roost/SGZRDM rooted/P rooter/M rootlessness/M rootless/P rootlet/SM Root/M root/MGDRZS rootstock/M rope/DRSMZG roper/M roping/M Roquefort/MS Roquemore/M Rora/M Rorie/M Rori/M Rorke/M Rorschach Rory/M Rosabella/M Rosabelle/M Rosabel/M Rosaleen/M Rosales/M Rosalia/M Rosalie/M Rosalinda/M Rosalinde/M Rosalind/M Rosaline/M Rosalynd/M Rosalyn/M Rosa/M Rosamond/M Rosamund/M Rosana/M Rosanna/M Rosanne/M Rosario/M rosary/SM Roscoe/M Rosco/M Roseanna/M Roseanne/M Roseann/M roseate/Y Roseau rosebud/MS rosebush/SM Rosecrans/M Roseland/M Roselia/M Roseline/M Roselin/M Rosella/M Roselle/M Rose/M Rosemaria/M Rosemarie/M Rosemary/M rosemary/MS rose/MGDS Rosemonde/M Rosenberg/M Rosenblum/M Rosendo/M Rosene/M Rosen/M Rosenthal/M Rosenzweig/M Rosetta/M Rosette/M rosette/SDMG rosewater rosewood/SM Roshelle/M Rosicrucian/M Rosie/M rosily Rosina/M rosiness/MS rosin/SMDG Rosita/M Roslyn/M Rosmunda/M Ros/N Ross Rossetti/M Rossie/M Rossi/M Rossini/M Rossy/M Rostand/M roster/DMGS Rostov/M rostra's rostrum/SM Roswell/M Rosy/M rosy/RTP rota/MS Rotarian/SM rotary/S rotated/U rotate/VGNXSD rotational/Y rotation/M rotative/Y rotator/SM rotatory ROTC rote/MS rotgut/MS Roth/M Rothschild/M rotisserie/MS rotogravure/SM rotor/MS rototill/RZ rot/SDG rotted rottenness/S rotten/RYSTP Rotterdam/M rotter/M rotting rotunda/SM rotundity/S rotundness/S rotund/SDYPG Rouault/M roué/MS rouge/GMDS roughage/SM roughen/DG rougher/M roughhouse/GDSM roughish roughneck/MDSG roughness/MS roughs roughshod rough/XPYRDNGT roulette/MGDS roundabout/PSM roundedness/M rounded/P roundelay/SM roundels rounder/M roundhead/D roundheadedness/M roundheaded/P roundhouse/SM roundish roundness/MS roundoff roundup/MS roundworm/MS round/YRDSGPZT Rourke/M rouse/DSRG rouser/M Rousseau/M roustabout/SM roust/SGD route/ASRDZGJ router/M route's rout/GZJMDRS routine/SYM routing/M routinize/GSD Rouvin/M rover/M Rover/M rove/ZGJDRS roving/M Rowan/M rowboat/SM rowdily rowdiness/MS rowdyism/MS rowdy/PTSR rowel/DMSG Rowe/M Rowena/M rowen/M Rowen/M rower/M Rowland/M Rowley/M Row/MN Rowney/M row/SJZMGNDR Roxana/M Roxane/M Roxanna/M Roxanne/M Roxie/M Roxi/M Roxine/M Roxy/M royalist/SM Royall/M Royal/M royal/SY royalty/MS Royce/M Roy/M Rozalie/M Rozalin/M Rozamond/M Rozanna/M Rozanne/M Rozele/M Rozella/M Rozelle/M Roze/M Rozina/M Roz/M RP rpm RPM rps RR Rriocard/M rs r's R's RSFSR RSI RSV RSVP RSX rt rte Rte RTFM r/TGVJ Rubaiyat/M rubato/MS rubbed rubberize/GSD rubberneck/DRMGSZ rubber/SDMG rubbery/TR rubbing/M rubbish/DSMG rubbishy rubble/GMSD rubdown/MS rubella/MS Rube/M Ruben/MS rube/SM Rubetta/M Rubia/M Rubicon/SM rubicund rubidium/SM Rubie/M Rubik/M Rubi/M Rubina/M Rubin/M Rubinstein/M ruble/MS rubout rubric/MS rub/S Ruby/M ruby/MTGDSR Ruchbah/M ruck/M rucksack/SM ruckus/SM ruction/SM rudderless rudder/MS Ruddie/M ruddiness/MS Rudd/M Ruddy/M ruddy/PTGRSD rudeness/MS rude/PYTR Rudie/M Rudiger/M rudimentariness/M rudimentary/P rudiment/SM Rudolf/M Rudolfo/M Rudolph/M Rudyard/M Rudy/M ruefulness/S rueful/PY rue/GDS Rufe/M ruff/GSYDM ruffian/GSMDY ruffled/U ruffler/M ruffle/RSDG ruffly/TR Rufus/M Rugby's rugby/SM ruggedness/S rugged/PYRT Ruggiero/M rugging rug/MS Ruhr/M ruination/MS ruiner/M ruin/MGSDR ruinousness/M ruinous/YP Ruiz/M rulebook/S ruled/U rule/MZGJDRS ruler/GMD ruling/M Rumanian's Rumania's rumba/GDMS rumble/JRSDG rumbler/M rumbustious rumen/M Rumford/M Ru/MH ruminant/YMS ruminate/VNGXSD ruminative/Y rummage/GRSD rummager/M Rummel/M rummer rummest rummy/TRSM rumored/U rumorer/M rumormonger/SGMD rumor/ZMRDSG Rumpelstiltskin/M rump/GMYDS rumple/SDG rumply/TR rumpus/SM rum/XSMN runabout/SM runaround/S run/AS runaway/S rundown/SM rune/MS Runge/M rung/MS runic runlet/SM runnable runnel/SM runner/MS running/S Runnymede/M runny/RT runoff/MS runtime runtiness/M runt/MS runty/RPT runway/MS Runyon/M rupee/MS Ruperta/M Rupert/M Ruperto/M rupiah/M rupiahs Ruppert/M Ruprecht/M rupture/GMSD rurality/M rural/Y Rurik/M ruse/MS Rushdie/M rush/DSRGZ rusher/M rushes/I rushing/M Rush/M Rushmore/M rushy/RT Ruskin/M rusk/MS Russell/M Russel/M russet/MDS russetting Russia/M Russian/SM Russo/M Russ/S Rustbelt/M rustically rusticate/GSD rustication/M rusticity/S rustic/S Rustie/M rustiness/MS Rustin/M rustler/M rustle/RSDGZ rust/MSDG rustproof/DGS Rusty/M rusty/XNRTP rutabaga/SM Rutger/SM Ruthanne/M Ruthann/M Ruthe/M ruthenium/MS rutherfordium/SM Rutherford/M Ruthie/M Ruthi/M ruthlessness/MS ruthless/YP Ruth/M Ruthy/M Rutland/M Rutledge/M rut/MS rutted Rutter/M Ruttger/M rutting rutty/RT Ruy/M RV RVs Rwandan/S Rwanda/SM Rwy/M Rx/M Ryan/M Ryann/M Rycca/M Rydberg/M Ryder/M rye/MS Ryley/M Ry/M Ryon/M Ryukyu/M Ryun/M S SA Saab/M Saar/M Saba/M sabbath Sabbath/M Sabbaths sabbatical/S sabered/U saber/GSMD Sabik/M Sabina/M Sabine/M Sabin/M sable/GMDS sabotage/DSMG saboteur/SM sabot/MS Sabra/M sabra/MS Sabrina/M SAC Sacajawea/M saccharides saccharine saccharin/MS Sacco/M sacerdotal Sacha/M sachem/MS sachet/SM Sachs/M sackcloth/M sackcloths sacker/M sackful/MS sack/GJDRMS sacking/M sacral sacra/L sacramental/S sacrament/DMGS Sacramento/M sacredness/S sacred/PY sacrificer/M sacrifice/RSDZMG sacrificial/Y sacrilege/MS sacrilegious/Y sacristan/SM sacristy/MS sacroiliac/S sacrosanctness/MS sacrosanct/P sacrum/M sac/SM Sada/M Sadat/M Saddam/M sadden/DSG sadder saddest saddlebag/SM saddler/M saddle's saddle/UGDS Sadducee/M Sadella/M Sade/M sades Sadie/M sadism/MS sadistic sadistically sadist/MS sadness/SM sadomasochism/MS sadomasochistic sadomasochist/S sad/PY Sadr/M Sadye/M safari/GMDS safeguard/MDSG safekeeping/MS safeness/MS safeness's/U safes safety/SDMG safe/URPTY safflower/SM saffron/MS sagaciousness/M sagacious/YP sagacity/MS saga/MS Sagan/M sagebrush/SM sage/MYPS sagged sagger sagging saggy/RT Saginaw/M Sagittarius/MS sago/MS sag/TSR saguaro/SM Sahara/M Saharan/M Sahel sahib/MS Saidee/M saids said/U Saigon/M sailboard/DGS sailboat/SRMZG sailcloth/M sailcloths sailer/M sailfish/SM sail/GJMDRS sailing/M sailor/YMS sailplane/SDMG sainthood/MS saintlike saintliness/MS saintly/RTP saint/YDMGS Saiph/M saith saiths Sakai/M sake/MRS saker/M Sakhalin/M Sakharov/M Saki/M saki's salaam/GMDS salable/U salaciousness/MS salacious/YP salacity/MS Saladin/M Salado/M salad/SM Salaidh/M salamander/MS salami/MS salary/SDMG Salas/M Salazar/M saleability/M sale/ABMS Saleem/M Salem/M Salerno/M salesclerk/SM salesgirl/SM saleslady/S salesman/M salesmanship/SM salesmen salespeople/M salesperson/MS salesroom/M saleswoman saleswomen salience/MS saliency salient/SY Salim/M Salina/MS saline/S salinger Salinger/M salinity/MS Salisbury/M Salish/M saliva/MS salivary salivate/XNGSD salivation/M Salk/M Sallee/M Salle/M Sallie/M Salli/M sallowness/MS sallow/TGRDSP Sallust/M Sallyanne/M Sallyann/M sally/GSDM Sally/M salmonellae salmonella/M Salmon/M salmon/SM Sal/MY Saloma/M Salome/M Salomi/M Salomo/M Salomone/M Salomon/M Salonika/M salon/SM saloonkeeper saloon/MS salsa/MS salsify/M SALT saltcellar/SM salted/UC salter/M salt/GZTPMDRS saltine/MS saltiness/SM saltness/M Salton/M saltpeter/SM salts/C saltshaker/S saltwater salty/RSPT salubriousness/M salubrious/YP salubrity/M salutariness/M salutary/P salutation/SM salutatory/S saluter/M salute/RSDG Salvadoran/S Salvadorian/S Salvador/M salvageable salvage/MGRSD salvager/M salvation/MS Salvatore/M salve/GZMDSR salver/M Salvidor/M salvo/GMDS Salween/M Salyut/M Salz/M SAM Samantha/M Samara/M Samaria/M Samaritan/MS samarium/MS Samarkand/M samba/GSDM sameness/MS same/SP Sam/M Sammie/M Sammy/M Samoa Samoan/S Samoset/M samovar/SM Samoyed/M sampan/MS sampler/M sample/RSDJGMZ sampling/M Sampson/M Samsonite/M Samson/M Samuele/M Samuel/SM Samuelson/M samurai/M San'a Sana/M sanatorium/MS Sanborn/M Sanchez/M Sancho/M sanctification/M sanctifier/M sanctify/RSDGNX sanctimoniousness/MS sanctimonious/PY sanctimony/MS sanctioned/U sanction/SMDG sanctity/SM sanctuary/MS sanctum/SM sandal/MDGS sandalwood/SM sandbagged sandbagging sandbag/MS sandbank/SM sandbar/S sandblaster/M sandblast/GZSMRD sandbox/MS Sandburg/M sandcastle/S Sande/M Sanderling/M sander/M Sander/M Sanderson/M sandhill sandhog/SM Sandia/M Sandie/M Sandi/M sandiness/S Sandinista sandlot/SM sandlotter/S sandman/M sandmen Sand/MRZ Sandor/M Sandoval/M sandpaper/DMGS sandpile sandpiper/MS sandpit/M Sandra/M Sandro/M sand/SMDRGZ sandstone/MS sandstorm/SM Sandusky/M sandwich/SDMG Sandye/M Sandy/M sandy/PRT saned sane/IRYTP saneness/MS saneness's/I sanes Sanford/M Sanforized Sanger/M sangfroid/S sangria/SM Sang/RM sang/S sanguinary sanguined sanguine/F sanguinely sanguineness/M sanguineous/F sanguines sanguining Sanhedrin/M saning sanitarian/S sanitarium/SM sanitary/S sanitate/NX sanitation/M sanitizer/M sanitize/RSDZG sanity/SIM sank Sankara/M San/M sans sanserif Sanskritic Sanskritize/M Sanskrit/M Sansone/M Sanson/M Santa/M Santana/M Santayana/M Santeria Santiago/M Santo/MS sapience/MS sapient sapless sapling/SM sap/MS sapped sapper/SM Sapphira/M Sapphire/M sapphire/MS Sappho/M sappiness/SM sapping Sapporo/M sappy/RPT saprophyte/MS saprophytic sapsucker/SM sapwood/SM Saraann/M Saracen/MS Saragossa/M Sarah/M Sarajane/M Sarajevo/M Sara/M Saran/M saran/SM sarape's Sarasota/M Saratoga/M Saratov/M Sarawak/M sarcasm/MS sarcastic sarcastically sarcoma/MS sarcophagi sarcophagus/M sardine/SDMG Sardinia/M sardonic sardonically Saree/M Sarena/M Sarene/M Sarette/M Sargasso/M Sarge/M Sargent/M sarge/SM Sargon/M Sari/M sari/MS Sarina/M Sarine/M Sarita/M Sarnoff/M sarong/MS Saroyan/M sarsaparilla/MS Sarto/M sartorial/Y sartorius/M Sartre/M Sascha/M SASE Sasha/M sashay/GDS Sashenka/M sash/GMDS Saskatchewan/M Saskatoon/M Sask/M sassafras/MS sass/GDSM Sassoon/M sassy/TRS SAT satanic satanical/Y Satanism/M satanism/S Satanist/M satanist/S Satan/M satchel/SM sat/DG sateen/MS satellite/GMSD sate/S satiable/I satiate/GNXSD satiation/M satiety/MS satin/MDSG satinwood/MS satiny satire/SM satiric satirical/Y satirist/SM satirize/DSG satirizes/U satisfaction/ESM satisfactorily/U satisfactoriness/MU satisfactory/UP satisfiability/U satisfiable/U satisfied/UE satisfier/M satisfies/E satisfy/GZDRS satisfying/EU satisfyingly Sat/M satori/SM satrap/SM saturated/CUA saturater/M saturates/A saturate/XDRSNG saturation/M Saturday/MS saturnalia Saturnalia/M saturnine/Y Saturn/M Satyanarayanan/M satyriases satyriasis/M satyric satyr/MS sauce/DSRGZM saucepan/SM saucer/M saucily sauciness/S saucy/TRP Saudi/S Saud/M Saudra/M sauerkraut/SM Saukville/M Saul/M Sault/M sauna/DMSG Sauncho/M Saunder/SM Saunderson/M Saundra/M saunter/DRSG saurian/S sauropod/SM sausage/MS Saussure/M sauté/DGS Sauternes/M Sauveur/M savage/GTZYPRSD Savage/M savageness/SM savagery/MS Savannah/M savanna/MS savant/SM saved/U saveloy/M saver/M save/ZGJDRSB Savina/M Savior/M savior/SM Saviour/M Savonarola/M savored/U savorer/M savorier savoriest savoriness/S savoringly/S savoring/Y savor/SMRDGZ savory/UMPS Savoyard/M Savoy/M savoy/SM savvy/GTRSD sawbones/M sawbuck/SM sawdust/MDSG sawer/M sawfly/SM sawhorse/MS Saw/M sawmill/SM saw/SMDRG sawtooth Sawyere/M Sawyer/M sawyer/MS Saxe/M saxifrage/SM Sax/M sax/MS Saxon/SM Saxony/M saxophone/MS saxophonist/SM Saxton/M Sayer/M sayer/SM sayest saying/MS Sayre/MS says/M say/USG Say/ZMR SBA Sb/M SC scabbard/SGDM scabbed scabbiness/SM scabbing scabby/RTP scabies/M scabrousness/M scabrous/YP scab/SM scad/SM scaffolding/M scaffold/JGDMS scalability Scala/M scalar/SM scalawag/SM scald/GJRDS scaled/AU scale/JGZMBDSR scaleless scalene scaler/M scales/A scaliness/MS scaling/A scallion/MS scalloper/M scallop/GSMDR scalloping/M scalpel/SM scalper/M scalp/GZRDMS scalping/M scaly/TPR scammed scamming scamper/GD scampi/M scamp/RDMGZS scam/SM Scan scan/AS scandal/GMDS scandalized/U scandalize/GDS scandalmonger/SM scandalousness/M scandalous/YP Scandinavia/M Scandinavian/S scandium/MS scanned/A scanner/SM scanning/A scansion/SM scant/CDRSG scantest scantily scantiness/MS scantly scantness/MS scanty/TPRS scapegoat/SGDM scapegrace/MS scape/M scapulae scapula/M scapular/S scarab/SM Scaramouch/M Scarborough/M scarceness/SM scarce/RTYP scarcity/MS scar/DRMSG scarecrow/MS scaremongering/M scaremonger/SGM scarer/M scare/S scarface Scarface/M scarf/SDGM scarification/M scarify/DRSNGX scarily scariness/S scarlatina/MS Scarlatti/M Scarlet/M scarlet/MDSG Scarlett/M scarp/SDMG scarred scarring scarves/M scary/PTR scathe/DG scathed/U scathing/Y scatological scatology/SM scat/S scatted scatterbrain/MDS scatter/DRJZSG scatterer/M scattergun scattering/YM scatting scavenge/GDRSZ scavenger/M SCCS scenario/SM scenarist/MS scene/GMDS scenery/SM scenically scenic/S scented/U scent/GDMS scentless scent's/C scents/C scepter/DMSG scepters/U sceptically sch Schaefer/M Schaeffer/M Schafer/M Schaffner/M Schantz/M Schapiro/M Scheat/M Schedar/M schedule/ADSRG scheduled/U scheduler/MS schedule's Scheherazade/M Scheherezade/M Schelling/M schema/M schemata schematically schematic/S scheme/JSRDGMZ schemer/M schemta Schenectady/M scherzo/MS Schick/M Schiller/M schilling/SM schismatic/S schism/SM schist/SM schizoid/S schizomycetes schizophrenia/SM schizophrenically schizophrenic/S schizo/S schlemiel/MS schlepped schlepping schlep/S Schlesinger/M Schliemann/M Schlitz/M schlock/SM schlocky/TR Schloss/M schmaltz/MS schmaltzy/TR Schmidt/M Schmitt/M schmoes schmo/M schmooze/GSD schmuck/MS Schnabel/M schnapps/M schnauzer/MS Schneider/M schnitzel/MS schnook/SM schnoz/S schnozzle/MS Schoenberg/M Schofield/M scholarship/MS scholar/SYM scholastically scholastic/S schoolbag/SM schoolbook/SM schoolboy/MS schoolchild/M schoolchildren schooldays schooled/U schoolfellow/S schoolfriend schoolgirlish schoolgirl/MS schoolhouse/MS schooling/M schoolmarmish schoolmarm/MS schoolmaster/SGDM schoolmate/MS schoolmistress/MS schoolroom/SM schoolteacher/MS schoolwork/SM schoolyard/SM school/ZGMRDJS schooner/SM Schopenhauer/M Schottky/M Schrieffer/M Schrödinger/M Schroeder/M Schroedinger/M Schubert/M Schultz/M Schulz/M Schumacher/M Schuman/M Schumann/M schussboomer/S schuss/SDMG Schuster/M Schuyler/M Schuylkill/M Schwab/M Schwartzkopf/M Schwartz/M Schwarzenegger/M schwa/SM Schweitzer/M Schweppes/M Schwinger/M Schwinn/M sci sciatica/SM sciatic/S science/FMS scientifically/U scientific/U scientist/SM Scientology/M scimitar/SM scintilla/MS scintillate/GNDSX scintillation/M scintillator/SM scion/SM Scipio/M scissor/SGD scleroses sclerosis/M sclerotic/S Sc/M scoffer/M scofflaw/MS scoff/RDGZS scolder/M scold/GSJRD scolioses scoliosis/M scollop's sconce/SDGM scone/SM scooper/M scoop/SRDMG scooter/M scoot/SRDGZ scope/DSGM Scopes/M scops scorbutic scorcher/M scorching/Y scorch/ZGRSD scoreboard/MS scorecard/MS scored/M scorekeeper/SM scoreless scoreline score/ZMDSRJG scorner/M scornfulness/M scornful/PY scorn/SGZMRD scorpion/SM Scorpio/SM Scorpius/M Scorsese/M Scotchgard/M Scotchman/M Scotchmen scotch/MSDG scotchs Scotch/S Scotchwoman Scotchwomen Scotia/M Scotian/M Scotland/M Scot/MS Scotsman/M Scotsmen Scotswoman Scotswomen Scottie/SM Scotti/M Scottish Scott/M Scottsdale/M Scotty's scoundrel/YMS scourer/M scourge/MGRSD scourger/M scouring/M scour/SRDGZ scouter/M scouting/M scoutmaster/SM Scout's scout/SRDMJG scow/DMGS scowler/M scowl/SRDG scrabble/DRSZG scrabbler/M Scrabble/SM scragged scragging scraggly/TR scraggy/TR scrag/SM scrambler/MS scrambler's/U scramble/UDSRG scrammed scramming scram/S Scranton/M scrapbook/SM scraper/M scrape/S scrapheap/SM scrapped scrapper/SM scrapping scrappy/RT scrap/SGZJRDM scrapyard/S scratched/U scratcher/M scratches/M scratchily scratchiness/S scratch/JDRSZG scratchy/TRP scrawler/M scrawl/GRDS scrawly/RT scrawniness/MS scrawny/TRP screamer/M screaming/Y scream/ZGSRD screecher/M screech/GMDRS screechy/TR screed/MS scree/DSM screened/U screening/M screenplay/MS screen/RDMJSG screenwriter/MS screwball/SM screwdriver/SM screwer/M screw/GUSD screwiness/S screw's screwup screwworm/MS screwy/RTP Scriabin/M scribal scribble/JZDRSG scribbler/M scribe/CDRSGIK scriber/MKIC scribe's Scribner/MS scrimmager/M scrimmage/RSDMG scrimp/DGS scrimshaw/GSDM scrim/SM Scripps/M scrip/SM scripted/U script/FGMDS scriptural/Y scripture/MS Scripture/MS scriptwriter/SM scriptwriting/M scrivener/M scriven/ZR scrod/M scrofula/MS scrofulous scrollbar/SM scroll/GMDSB Scrooge/MS scrooge/SDMG scrota scrotal scrotum/M scrounge/ZGDRS scroungy/TR scrubbed scrubber/MS scrubbing scrubby/TR scrub/S scruffily scruffiness/S scruff/SM scruffy/PRT Scruggs/M scrummage/MG scrum/MS scrumptious/Y scrunch/DSG scrunchy/S scruple/SDMG scrupulosity/SM scrupulousness's scrupulousness/US scrupulous/UPY scrutable/I scrutinized/U scrutinizer/M scrutinize/RSDGZ scrutinizingly/S scrutinizing/UY scrutiny/MS SCSI scuba/SDMG scudded scudding Scud/M scud/S scuff/GSD scuffle/SDG sculler/M scullery/MS Sculley/M scullion/MS scull/SRDMGZ sculptor/MS sculptress/MS sculpt/SDG sculptural/Y sculpture/SDGM scumbag/S scummed scumming scum/MS scummy/TR scupper/SDMG scurf/MS scurfy/TR scurrility/MS scurrilousness/MS scurrilous/PY scurry/GJSD scurvily scurviness/M scurvy/SRTP scutcheon/SM scuttlebutt/MS scuttle/MGSD scuzzy/RT Scylla/M scythe/SDGM Scythia/M SD SDI SE seabed/S seabird/S seaboard/MS Seaborg/M seaborne Seabrook/M seacoast/MS seafare/JRZG seafarer/M seafood/MS seafront/MS Seagate/M seagoing Seagram/M seagull/S seahorse/S sealant/MS sealed/AU sealer/M seal/MDRSGZ sealskin/SM seals/UA seamail seamanship/SM seaman/YM seamer/M seaminess/M seamlessness/M seamless/PY seam/MNDRGS seams/I seamstress/MS Seamus/M sea/MYS seamy/TRP Seana/M séance/SM Sean/M seaplane/SM seaport/SM seaquake/M Seaquarium/M searcher/AM searching/YS searchlight/SM search/RSDAGZ sear/DRSJGT searing/Y Sears/M seascape/SM seashell/MS seashore/SM seasickness/SM seasick/P seaside/SM seasonableness/M seasonable/UP seasonably/U seasonality seasonal/Y seasoned/U seasoner/M seasoning/M season/JRDYMBZSG seatbelt seated/A seater/M seating/SM SEATO seat's Seattle/M seat/UDSG seawall/S seaward/S seawater/S seaway/MS seaweed/SM seaworthinesses seaworthiness/MU seaworthy/TRP sebaceous Sebastian/M Sebastiano/M Sebastien/M seborrhea/SM SEC secant/SM secede/GRSD secessionist/MS secession/MS secludedness/M secluded/YP seclude/GSD seclusion/SM seclusive Seconal secondarily secondary/PS seconder/M secondhand second/RDYZGSL secrecy/MS secretarial secretariat/MS secretaryship/MS secretary/SM secrete/XNS secretion/M secretiveness/S secretive/PY secretory secret/TVGRDYS sec/S sectarianism/MS sectarian/S sectary/MS sectionalism/MS sectionalized sectional/SY section/ASEM sectioned sectioning sect/ISM sectoral sectored sector/EMS sectoring sects/E secularism/MS secularist/MS secularity/M secularization/MS secularized/U secularize/GSD secular/SY secured/U securely/I secure/PGTYRSDJ security/MSI secy sec'y sedan/SM sedateness/SM sedate/PXVNGTYRSD sedation/M sedative/S sedentary Seder/SM sedge/SM Sedgwick/M sedgy/RT sedimentary sedimentation/SM sediment/SGDM sedition/SM seditiousness/M seditious/PY seducer/M seduce/RSDGZ seduction/MS seductiveness/MS seductive/YP seductress/SM sedulous/Y Seebeck/M seed/ADSG seedbed/MS seedcase/SM seeded/U seeder/MS seediness/MS seeding/S seedless seedling/SM seedpod/S seed's seedy/TPR seeings seeing's seeing/U seeker/M seek/GZSR seeking/Y Seeley/M See/M seem/GJSYD seeming/Y seemliness's seemliness/US seemly/UTPR seen/U seepage/MS seep/GSD seer/SM seersucker/MS sees seesaw/DMSG seethe/SDGJ see/U segmental/Y segmentation/SM segmented/U segment/SGDM Segovia/M segregant segregated/U segregate/XCNGSD segregation/CM segregationist/SM segregative Segre/M segue/DS segueing Segundo/M Se/H Seidel/M seigneur/MS seignior/SM Seiko/M seine/GZMDSR Seine/M seiner/M Seinfeld/M seismic seismically seismographer/M seismographic seismographs seismography/SM seismograph/ZMR seismologic seismological seismologist/MS seismology/SM seismometer/S seize/BJGZDSR seizer/M seizing/M seizin/MS seizor/MS seizure/MS Seka/M Sela/M Selassie/M Selby/M seldom selected/UAC selectional selection/MS selectiveness/M selective/YP selectivity/MS selectman/M selectmen selectness/SM selector/SM select/PDSVGB Selectric/M selects/A Selena/M selenate/M Selene/M selenite/M selenium/MS selenographer/SM selenography/MS Selestina/M Seleucid/M Seleucus/M self/GPDMS selfishness/SU selfish/PUY selflessness/MS selfless/YP selfness/M Selfridge/M selfsameness/M selfsame/P Selia/M Selie/M Selig/M Selim/M Selina/M Selinda/M Seline/M Seljuk/M Selkirk/M Sella/M sell/AZGSR seller/AM Sellers/M Selle/ZM sellout/MS Selma/M seltzer/S selvage/MGSD selves/M Selznick/M semantical/Y semanticist/SM semantic/S semantics/M semaphore/GMSD Semarang/M semblance/ASME semen/SM semester/SM semiannual/Y semiarid semiautomated semiautomatic/S semicircle/SM semicircular semicolon/MS semiconductor/SM semiconscious semidefinite semidetached semidrying/M semifinalist/MS semifinal/MS semilogarithmic semimonthly/S seminal/Y seminarian/MS seminar/SM seminary/MS Seminole/SM semiofficial semioticians semiotic/S semiotics/M semipermanent/Y semipermeable semiprecious semiprivate semiprofessional/YS semipublic semiquantitative/Y Semiramis/M semiretired semisecret semiskilled semi/SM semisolid/S semistructured semisweet Semite/SM Semitic/MS semitic/S semitone/SM semitrailer/SM semitrance semitransparent semitropical semivowel/MS semiweekly/S semiyearly semolina/SM sempiternal sempstress/SM Semtex sen Sen Sena/M senate/MS Senate/MS senatorial senator/MS Sendai/M sender/M sends/A send/SRGZ Seneca/MS Senegalese Senegal/M senescence/SM senescent senile/SY senility/MS seniority/SM senior/MS Senior/S Sennacherib/M senna/MS Sennett/M Señora/M senora/S senorita/S senor/MS sensately/I sensate/YNX sensationalism/MS sensationalist/S sensationalize/GSD sensational/Y sensation/M sens/DSG senselessness/SM senseless/PY sense/M sensibility/ISM sensibleness/MS sensible/PRST sensibly/I sensitiveness/MS sensitiveness's/I sensitives sensitive/YIP sensitivity/ISM sensitization/CSM sensitized/U sensitizers sensitize/SDCG sensor/MS sensory sensualist/MS sensuality/MS sensual/YF sensuousness/S sensuous/PY Sensurround/M sentence/SDMG sentential/Y sententious/Y sentience/ISM sentient/YS sentimentalism/SM sentimentalist/SM sentimentality/SM sentimentalization/SM sentimentalize/RSDZG sentimentalizes/U sentimental/Y sentiment/MS sentinel/GDMS sentry/SM sent/UFEA Seoul/M sepal/SM separability/MSI separableness/MI separable/PI separably/I separateness/MS separates/M separate/YNGVDSXP separation/M separatism/SM separatist/SM separator/SM Sephardi/M Sephira/M sepia/MS Sepoy/M sepses sepsis/M septa/M septate/N September/MS septennial/Y septet/MS septicemia/SM septicemic septic/S septillion/M sept/M Sept/M septuagenarian/MS Septuagint/MS septum/M sepulcher/MGSD sepulchers/UA sepulchral/Y seq sequel/MS sequenced/A sequence/DRSJZMG sequencer/M sequence's/F sequences/F sequent/F sequentiality/FM sequentialize/DSG sequential/YF sequester/SDG sequestrate/XGNDS sequestration/M sequin/SDMG sequitur Sequoia/M sequoia/MS Sequoya/M Serafin/M seraglio/SM serape/S seraphic seraphically seraphim's seraph/M seraphs sera's Serbia/M Serbian/S Serb/MS Serbo/M serenade/MGDRS serenader/M Serena/M serendipitous/Y serendipity/MS serene/GTYRSDP Serene/M sereneness/SM Serengeti/M serenity/MS sere/TGDRS serfdom/MS serf/MS Sergeant/M sergeant/SM serge/DSGM Sergei/M Serge/M Sergent/M Sergio/M serialization/MS serialize/GSD serial/MYS series/M serif/SMD serigraph/M serigraphs seriousness/SM serious/PY sermonize/GSD sermon/SGDM serological/Y serology/MS serons serous Serpens/M serpent/GSDM serpentine/GYS Serra/M Serrano/M serrate/GNXSD serration/M serried serum/MS servant/SDMG serve/AGCFDSR served/U server/MCF servers serviceability/SM serviceableness/M serviceable/P serviced/U serviceman/M servicemen service/MGSRD service's/E services/E servicewoman servicewomen serviette/MS servilely servileness/M serviles servile/U servility/SM serving/SM servitor/SM servitude/MS servomechanism/MS servomotor/MS servo/S sesame/MS sesquicentennial/S sessile session/SM setback/S Seth/M Set/M Seton/M set's setscrew/SM set/SIA settable/A sett/BJGZSMR settee/MS setter/M setting/AS setting's settle/AUDSG settlement/ASM settler/MS settling/S setup/MS Seumas/M Seurat/M Seuss/M Sevastopol/M sevenfold sevenpence seven/SMH seventeen/HMS seventeenths sevenths seventieths seventy/MSH severalfold severalty/M several/YS severance/SM severed/E severeness/SM severe/PY severing/E severity/MS Severn/M severs/E sever/SGTRD Severus/M Seville/M sewage/MS Seward/M sewerage/SM sewer/GSMD sewing/SM sewn sew/SAGD sexagenarian/MS sex/GMDS sexily sexiness/MS sexism/SM sexist/SM sexless sexologist/SM sexology/MS sexpot/SM Sextans/M sextant/SM sextet/SM sextillion/M Sexton/M sexton/MS sextuple/MDG sextuplet/MS sexuality/MS sexualized sexual/Y sexy/RTP Seychelles Seyfert Seymour/M sf SF Sgt shabbily shabbiness/SM shabby/RTP shack/GMDS shackler/M shackle's Shackleton/M shackle/UGDS shad/DRJGSM shaded/U shadeless shade/SM shadily shadiness/MS shading/M shadowbox/SDG shadower/M shadow/GSDRM shadowiness/M Shadow/M shadowy/TRP shady/TRP Shae/M Shafer/M Shaffer/M shafting/M shaft/SDMG shagged shagginess/SM shagging shaggy/TPR shag/MS shah/M shahs Shaina/M Shaine/M shakable/U shakably/U shakeable shakedown/S shaken/U shakeout/SM shaker/M Shaker/S Shakespearean/S Shakespeare/M Shakespearian shake/SRGZB shakeup/S shakily shakiness/S shaking/M shaky/TPR shale/SM shall shallot/SM shallowness/SM shallow/STPGDRY Shalna/M Shalne/M shalom Shalom/M shalt shamanic shaman/SM shamble/DSG shambles/M shamefaced/Y shamefulness/S shameful/YP shamelessness/SM shameless/PY shame/SM sham/MDSG shammed shammer shamming shammy's shampoo/DRSMZG shampooer/M shamrock/SM Shamus/M Shana/M Shanan/M Shanda/M Shandee/M Shandeigh/M Shandie/M Shandra/M shandy/M Shandy/M Shane/M Shanghai/GM Shanghaiing/M shanghai/SDG Shanie/M Shani/M shank/SMDG Shannah/M Shanna/M Shannan/M Shannen/M Shannon/M Shanon/M shan't Shanta/M Shantee/M shantis Shantung/M shantung/MS shanty/SM shantytown/SM shape/AGDSR shaped/U shapelessness/SM shapeless/PY shapeliness/S shapely/RPT shaper/S shape's Shapiro/M sharable/U Sharai/M Shara/M shard/SM shareable sharecropped sharecropper/MS sharecropping sharecrop/S share/DSRGZMB shared/U shareholder/MS shareholding/S sharer/M shareware/S Shari'a Sharia/M sharia/SM Shari/M Sharity/M shark/SGMD sharkskin/SM Sharla/M Sharleen/M Sharlene/M Sharline/M Sharl/M Sharona/M Sharon/M Sharpe/M sharpen/ASGD sharpened/U sharpener/S sharper/M sharpie/SM Sharp/M sharpness/MS sharp/SGTZXPYRDN sharpshooter/M sharpshooting/M sharpshoot/JRGZ sharpy's Sharron/M Sharyl/M Shasta/M shat shatter/DSG shattering/Y shatterproof Shaughn/M Shaula/M Shauna/M Shaun/M shave/DSRJGZ shaved/U shaver/M Shavian shaving/M Shavuot/M Shawano/M shawl/SDMG shaw/M Shaw/M Shawna/M Shawnee/SM Shawn/M Shaylah/M Shayla/M Shaylyn/M Shaylynn/M Shay/M shay/MS Shayna/M Shayne/M Shcharansky/M sh/DRS sheaf/MDGS Shea/M shearer/M shear/RDGZS sheather/M sheathe/UGSD sheath/GJMDRS sheathing/M sheaths sheave/SDG sheaves/M Sheba/M shebang/MS Shebeli/M Sheboygan/M she'd shedding Shedir/M sheds shed's shed/U Sheelagh/M Sheelah/M Sheela/M Sheena/M sheen/MDGS sheeny/TRSM sheepdog/SM sheepfold/MS sheepherder/MS sheepishness/SM sheepish/YP sheep/M sheepskin/SM Sheeree/M sheerness/S sheer/PGTYRDS sheeting/M sheetlike sheet/RDMJSG Sheetrock Sheffielder/M Sheffield/RMZ Sheffie/M Sheff/M Sheffy/M sheikdom/SM sheikh's sheik/SM Sheilah/M Sheila/M shekel/MS Shelagh/M Shela/M Shelba/M Shelbi/M Shelby/M Shelden/M Sheldon/M shelf/MDGS Shelia/M she'll shellacked shellacking/MS shellac/S shelled/U Shelley/M shellfire/SM shellfish/SM Shellie/M Shelli/M Shell/M shell/RDMGS Shelly/M Shel/MY shelter/DRMGS sheltered/U shelterer/M Shelton/M shelve/JRSDG shelver/M shelves/M shelving/M she/M Shem/M Shena/M Shenandoah/M shenanigan/SM Shenyang/M Sheol/M Shepard/M shepherd/DMSG shepherdess/S Shepherd/M Shep/M Sheppard/M Shepperd/M Sheratan/M Sheraton/M sherbet/MS sherd's Sheree/M Sheridan/M Sherie/M sheriff/SM Sherill/M Sherilyn/M Sheri/M Sherline/M Sherlocke/M sherlock/M Sherlock/M Sher/M Sherman/M Shermie/M Sherm/M Shermy/M Sherpa/SM Sherrie/M Sherri/M Sherry/M sherry/MS Sherwin/M Sherwood/M Sherwynd/M Sherye/M Sheryl/M Shetland/S Shevardnadze/M shew/GSD shewn shh shiatsu/S shibboleth/M shibboleths shielded/U shielder/M shield/MDRSG Shields/M shiftily shiftiness/SM shiftlessness/S shiftless/PY shift/RDGZS shifty/TRP Shi'ite Shiite/SM Shijiazhuang Shikoku/M shill/DJSG shillelagh/M shillelaghs shilling/M Shillong/M Shiloh/M shimmed shimmer/DGS shimmery shimming shimmy/DSMG shim/SM Shina/M shinbone/SM shindig/MS shiner/M shine/S shingle/MDRSG shingler/M shinguard shininess/MS shining/Y shinned shinning shinny/GDSM shin/SGZDRM shinsplints Shintoism/S Shintoist/MS Shinto/MS shiny/PRT shipboard/MS shipborne shipbuilder/M shipbuild/RGZJ shipload/SM shipman/M shipmate/SM shipmen shipment/AMS shipowner/MS shippable shipped/A shipper/SM shipping/MS ship's shipshape ship/SLA shipwreck/GSMD shipwright/MS shipyard/MS Shiraz/M shire/MS shirker/M shirk/RDGZS Shirlee/M Shirleen/M Shirlene/M Shirley/M Shirline/M Shirl/M Shir/M shirr/GJDS shirtfront/S shirting/M shirt/JDMSG shirtless shirtmake/R shirtmaker/M shirtsleeve/MS shirttail/S shirtwaist/SM shit/S! shitting/! shitty/RT! Shiva/M shiverer/M shiver/GDR shivery shiv/SZRM shivved shivving shlemiel's Shmuel/M shoal/SRDMGT shoat/SM shocker/M shocking/Y Shockley/M shockproof shock/SGZRD shoddily shoddiness/SM shoddy/RSTP shod/U shoehorn/GSMD shoeing shoelace/MS shoemaker/M shoemake/RZ shoe/MS shoer's shoeshine/MS shoestring/MS shoetree/MS shogunate/SM shogun/MS Shoji/M Sholom/M shone shoo/DSG shoofly shook/SM shooter/M shootout/MS shoot/SJRGZ shopkeeper/M shopkeep/RGZ shoplifter/M shoplifting/M shoplift/SRDGZ shop/MS shopped/M shopper/M shoppe/RSDGZJ shopping/M shoptalk/SM shopworn shorebird/S shore/DSRGMJ shoreline/SM Shorewood/M shoring/M shortage/MS shortbread/MS shortcake/SM shortchange/DSG shortcoming/MS shortcrust shortcut/MS shortcutting shortener/M shortening/M shorten/RDGJ shortfall/SM shorthand/DMS Shorthorn/M shorthorn/MS shortie's shortish shortlist/GD Short/M shortness/MS short/SGTXYRDNP shortsightedness/S shortsighted/YP shortstop/MS shortwave/SM shorty/SM Shoshana/M Shoshanna/M Shoshone/SM Shostakovitch/M shotgunned shotgunner shotgunning shotgun/SM shot/MS shotted shotting shoulder/GMD shouldn't should/TZR shout/SGZRDM shove/DSRG shoveler/M shovelful/MS shovel/MDRSZG shover/M showbiz showbizzes showboat/SGDM showcase/MGSD showdown/MS shower/GDM showery/TR show/GDRZJS showgirl/SM showily showiness/MS showing/M showman/M showmanship/SM showmen shown showoff/S showpiece/SM showplace/SM showroom/MS showy/RTP shpt shrank shrapnel/SM shredded shredder/MS shredding shred/MS Shreveport/M shrewdness/SM shrewd/RYTP shrew/GSMD shrewishness/M shrewish/PY shrieker/M shriek/SGDRMZ shrift/SM shrike/SM shrill/DRTGPS shrillness/MS shrilly shrimp/MDGS shrine/SDGM shrinkage/SM shrinker/M shrinking/U shrink/SRBG shrivel/GSD shriven shrive/RSDG Shropshire/M shroud/GSMD shrubbed shrubbery/SM shrubbing shrubby/TR shrub/SM shrugged shrugging shrug/S shrunk/N shtick/S shucker/M shuck/SGMRD shucks/S shudder/DSG shuddery shuffleboard/MS shuffled/A shuffle/GDSRZ shuffles/A shuffling/A Shulman/M Shu/M shunned shunning shun/S shunter/M shunt/GSRD Shurlocke/M Shurlock/M Shurwood/M shush/SDG shutdown/MS shuteye/SM shutoff/M shutout/SM shut/S shutterbug/S shutter/DMGS shuttering/M shutting shuttlecock/MDSG shuttle/MGDS shy/DRSGTZY shyer shyest Shylockian/M Shylock/M shyness/SM shyster/SM Siamese/M Siam/M Siana/M Sianna/M Sian's Sibbie/M Sibby/M Sibeal/M Sibelius/M Sibella/M Sibelle/M Sibel/M Siberia/M Siberian/S sibilance/M sibilancy/M sibilant/SY Sibilla/M Sibley/M sibling/SM Sib/M Sibylla/M Sibylle/M sibylline Sibyl/M sibyl/SM Siciliana/M Sicilian/S Sicily/M sickbay/M sickbed/S sickener/M sickening/Y sicken/JRDG sicker/Y sick/GXTYNDRSP sickie/SM sickish/PY sickle/SDGM sickliness/M sickly/TRSDPG sickness/MS sicko/S sickout/S sickroom/SM sic/S sidearm/S sideband/MS sidebar/MS sideboard/SM sideburns sidecar/MS sided/A sidedness side/ISRM sidekick/MS sidelight/SM sideline/MGDRS sidelong sideman/M sidemen sidepiece/S sidereal sider/FA sides/A sidesaddle/MS sideshow/MS sidesplitting sidestepped sidestepping sidestep/S sidestroke/GMSD sideswipe/GSDM sidetrack/SDG sidewalk/MS sidewall/MS sidewards sideway/SM sidewinder/SM siding/SM sidle/DSG Sid/M Sidnee/M Sidney/M Sidoney/M Sidonia/M Sidonnie/M SIDS siege/GMDS Siegel/M Siegfried/M Sieglinda/M Siegmund/M Siemens/M Siena/M sienna/SM Sierpinski/M sierra/SM siesta/MS sieve/GZMDS Siffre/M sifted/UA sifter/M sift/GZJSDR Sigfrid/M Sigfried/M SIGGRAPH/M sigh/DRG sigher/M sighs sighted/P sighter/M sighting/S sight/ISM sightless/Y sightliness/UM sightly/TURP sightread sightseeing/S sightsee/RZ Sigismond/M Sigismondo/M Sigismund/M Sigismundo/M Sig/M sigma/SM sigmoid Sigmund/M signal/A signaled signaler/S signaling signalization/S signalize/GSD signally signalman/M signalmen signals signal's signatory/SM signature/MS signboard/MS signed/FU signer/SC signet/SGMD sign/GARDCS significance/IMS significantly/I significant/YS signification/M signify/DRSGNX signing/S Signora/M signora/SM signore/M signori signories signorina/SM signorine Signor/M signor/SFM signpost/DMSG sign's signs/F Sigrid/M Sigurd/M Sigvard/M Sihanouk/M Sikhism/MS Sikh/MS Sikhs Sikkimese Sikkim/M Sikorsky/M silage/GMSD Silas/M Sileas/M siled Sile/M silence/MZGRSD silencer/M silentness/M silent/TSPRY Silesia/M silhouette/GMSD silica/SM silicate/SM siliceous silicide/M silicone/SM silicon/MS silicoses silicosis/M silken/DG silk/GXNDMS silkily silkiness/SM silkscreen/SM silkworm/MS silky/RSPT silliness/SM sill/MS silly/PRST silo/GSM siltation/M silt/MDGS siltstone/M silty/RT Silurian/S Silvain/M Silva/M Silvana/M Silvan/M Silvano/M Silvanus/M silverer/M silverfish/MS Silverman/M silver/RDYMGS silversmith/M silversmiths Silverstein/M silverware/SM silvery/RTP Silvester/M Silvia/M Silvie/M Silvio/M Si/M SIMD Simenon/M Simeon/M simian/S similar/EY similarity/EMS simile/SM similitude/SME Simla/M simmer/GSD Simmonds/M Simmons/M Simmonsville/M Sim/MS Simms/M Simona/M Simone/M Simonette/M simonize/SDG Simon/M Simonne/M simony/MS simpatico simper/GDS simpleminded/YP simpleness/S simple/RSDGTP simpleton/SM simplex/S simplicity/MS simplified/U simplify/ZXRSDNG simplistic simplistically simply Simpson/M simulacrum/M Simula/M SIMULA/M simulate/XENGSD simulation/ME simulative simulator/SEM simulcast/GSD simultaneity/SM simultaneousness/M simultaneous/YP Sinai/M Sinatra/M since sincere/IY sincereness/M sincerer sincerest sincerity/MIS Sinclair/M Sinclare/M Sindbad/M Sindee/M Sindhi/M sinecure/MS sinecurist/M sine/SM sinew/SGMD sinewy sinfulness/SM sinful/YP Singaporean/S Singapore/M sing/BGJZYDR Singborg/M singeing singer/M Singer/M singe/S singing/Y singlehanded/Y singleness/SM single/PSDG Singleton/M singleton/SM singletree/SM singlet/SM singsong/GSMD singularity/SM singularization/M singular/SY Sinhalese/M sinisterness/M sinister/YP sinistral/Y sinkable/U sinker/M sink/GZSDRB sinkhole/SM Sinkiang/M sinking/M sinlessness/M sinless/YP sin/MAGS sinned sinner/MS sinning sinter/DM sinuosity/MS sinuousities sinuousness/M sinuous/PY sinusitis/SM sinus/MS sinusoidal/Y sinusoid/MS Siobhan/M Siouxie/M Sioux/M siphon/DMSG siphons/U sipped sipper/SM sipping sip/S sired/C sire/MS siren/M sires/C siring/C Sirius/M sirloin/MS Sir/MS sirocco/MS sirred sirring sirup's sir/XGMNDS sisal/MS Sisely/M Sisile/M sis/S Sissie/M sissified Sissy/M sissy/TRSM sister/GDYMS sisterhood/MS sisterliness/MS sisterly/P sister's/A Sistine Sisyphean Sisyphus/M sit/AG sitarist/SM sitar/SM sitcom/SM site/DSJM sits sitter/MS sitting/SM situate/GNSDX situational/Y situationist situation/M situ/S situs/M Siusan/M Siva/M Siward/M sixfold sixgun six/MRSH sixpence/MS sixpenny sixshooter sixteen/HRSM sixteenths sixths sixth/Y sixtieths sixty/SMH sizableness/M sizable/P sized/UA size/GJDRSBMZ sizer/M sizes/A sizing/M sizzler/M sizzle/RSDG SJ Sjaelland/M SK ska/S skateboard/SJGZMDR skater/M skate/SM skat/JMDRGZ skedaddle/GSD skeet/RMS skein/MDGS skeletal/Y skeleton/MS Skell/M Skelly/M skeptical/Y skepticism/MS skeptic/SM sketchbook/SM sketcher/M sketchily sketchiness/MS sketch/MRSDZG sketchpad sketchy/PRT skew/DRSPGZ skewer/GDM skewing/M skewness/M skidded skidding skid/S skiff/GMDS skiing/M skilfully skill/DMSG skilled/U skillet/MS skillfulnesses skillfulness/MU skillful/YUP skilling/M skimmed skimmer/MS skimming/SM ski/MNJSG skimp/GDS skimpily skimpiness/MS skimpy/PRT skim/SM skincare skindive/G skinflint/MS skinhead/SM skinless skinned Skinner/M skinner/SM skinniness/MS skinning skinny/TRSP skin/SM skintight Skip/M skipped Skipper/M skipper/SGDM Skippie/M skipping Skipp/RM Skippy/M skip/S Skipton/M skirmisher/M skirmish/RSDMZG skirter/M skirting/M skirt/RDMGS skit/GSMD skitter/SDG skittishness/SM skittish/YP skittle/SM skivvy/GSDM skoal/SDG Skopje/M skulduggery/MS skulker/M skulk/SRDGZ skullcap/MS skullduggery's skull/SDM skunk/GMDS skycap/MS skydiver/SM skydiving/MS Skye/M skyhook skyjacker/M skyjack/ZSGRDJ Skylab/M skylarker/M skylark/SRDMG Skylar/M Skyler/M skylight/MS skyline/MS Sky/M sky/MDRSGZ skyrocket/GDMS skyscraper/M skyscrape/RZ skyward/S skywave skyway/M skywriter/MS skywriting/MS slabbed slabbing slab/MS slacken/DG slacker/M slackness/MS slack/SPGTZXYRDN Slade/M slagged slagging slag/MS slain slake/DSG slaked/U slalom/SGMD slammed slammer/S slamming slam/S slander/MDRZSG slanderousness/M slanderous/PY slang/SMGD slangy/TR slanting/Y slant/SDG slantwise slapdash/S slaphappy/TR slap/MS slapped slapper slapping slapstick/MS slash/GZRSD slashing/Y slater/M Slater/M slate/SM slather/SMDG slating/M slat/MDRSGZ slatted slattern/MYS slatting slaughterer/M slaughterhouse/SM slaughter/SJMRDGZ slave/DSRGZM slaveholder/SM slaver/GDM slavery/SM Slavic/M slavishness/SM slavish/YP Slav/MS Slavonic/M slaw/MS slay/RGZS sleaze/S sleazily sleaziness/SM sleazy/RTP sledded sledder/S sledding sledgehammer/MDGS sledge/SDGM sled/SM sleekness/S sleek/PYRDGTS sleeper/M sleepily sleepiness/SM sleeping/M sleeplessness/SM sleepless/YP sleepover/S sleep/RMGZS sleepwalker/M sleepwalk/JGRDZS sleepwear/M sleepyhead/MS sleepy/PTR sleet/DMSG sleety/TR sleeveless sleeve/SDGM sleeving/M sleigh/GMD sleighs sleight/SM sleken/DG slenderize/DSG slenderness/MS slender/RYTP slept Slesinger/M sleuth/GMD sleuths slew/DGS slice/DSRGZM sliced/U slicer/M slicker/M slickness/MS slick/PSYRDGTZ slider/M slide/S slid/GZDR slight/DRYPSTG slighter/M slighting/Y slightness/S slime/SM sliminess/S slimline slimmed slimmer/S slimmest slimming/S slimness/S slim/SPGYD slimy/PTR sling/GMRS slingshot/MS slings/U slink/GS slinky/RT slipcase/MS slipcover/GMDS slipknot/SM slippage/SM slipped slipper/GSMD slipperiness/S slippery/PRT slipping slipshod slip/SM slipstream/MDGS slipway/SM slither/DSG slithery slit/SM slitted slitter/S slitting sliver/GSDM slivery Sloane/M Sloan/M slobber/SDG slobbery slob/MS Slocum/M sloe/MS sloganeer/MG slogan/MS slogged slogging slog/S sloop/SM slop/DRSGZ sloped/U slope/S slopped sloppily sloppiness/SM slopping sloppy/RTP slosh/GSDM slothfulness/MS slothful/PY sloth/GDM sloths slot/MS slotted slotting slouch/DRSZG sloucher/M slouchy/RT slough/GMD sloughs Slovakia/M Slovakian/S Slovak/S Slovene/S Slovenia/M Slovenian/S slovenliness/SM slovenly/TRP sloven/YMS slowcoaches slowdown/MS slowish slowness/MS slow/PGTYDRS slowpoke/MS SLR sludge/SDGM sludgy/TR slue/MGDS sluggard/MS slugged slugger/SM slugging sluggishness/SM sluggish/YP slug/MS sluice/SDGM slumberer/M slumber/MDRGS slumberous slumlord/MS slummed slummer slumming slum/MS slummy/TR slump/DSG slung/U slunk slur/MS slurp/GSD slurred slurried/M slurring slurrying/M slurry/MGDS slushiness/SM slush/SDMG slushy/RTP slut/MS sluttish slutty/TR Sly/M slyness/MS sly/RTY smacker/M smack/SMRDGZ smallholders smallholding/MS smallish Small/M smallness/S smallpox/SM small/SGTRDP smalltalk smalltime Smallwood/M smarmy/RT smarten/GD smartness/S smartypants smart/YRDNSGTXP smasher/M smash/GZRSD smashing/Y smashup/S smattering/SM smearer/M smear/GRDS smeary/TR smeller/M smelliness/MS smell/SBRDG smelly/TRP smelter/M smelt/SRDGZ Smetana/M smidgen/MS smilax/MS smile/GMDSR smiley/M smilies smiling/UY smirch/SDG smirk/GSMD Smirnoff/M smite/GSR smiter/M smith/DMG smithereens Smithfield/M Smith/M smiths Smithsonian/M Smithson/M Smithtown/M smithy/SM smitten Smitty/M Sm/M smocking/M smock/SGMDJ smoggy/TR smog/SM smoke/GZMDSRBJ smokehouse/MS smokeless smoker/M smokescreen/S smokestack/MS Smokey/M smokiness/S smoking/M smoky/RSPT smoldering/Y smolder/SGD Smolensk/M Smollett/M smooch/SDG smoothen/DG smoother/M smoothie/SM smoothness/MS smooths smooth/TZGPRDNY smörgåsbord/SM smote smother/GSD SMSA/MS SMTP Smucker/M smudge/GSD smudginess/M smudgy/TRP smugged smugger smuggest smugging smuggle/JZGSRD smuggler/M smugness/MS smug/YSP smut/SM Smuts/M smutted smuttiness/SM smutting smutty/TRP Smyrna/M snack/SGMD snaffle/GDSM snafu/DMSG snagged snagging snag/MS snail/GSDM Snake snakebird/M snakebite/MS snake/DSGM snakelike snakeroot/M snaky/TR snapback/M snapdragon/MS snapped/U snapper/SM snappily snappiness/SM snapping/U snappishness/SM snappish/PY snappy/PTR snapshot/MS snapshotted snapshotting snap/US snare/DSRGM snarer/M snarf/JSGD snarler/M snarling/Y snarl/UGSD snarly/RT snatch/DRSZG snatcher/M snazzily snazzy/TR Snead/M sneaker/MD sneakily sneakiness/SM sneaking/Y sneak/RDGZS sneaky/PRT Sneed/M sneerer/M sneer/GMRDJS sneering/Y sneeze/SRDG Snell/M snicker/GMRD snick/MRZ snideness/M Snider/M snide/YTSRP sniffer/M sniff/GZSRD sniffle/GDRS sniffler/M sniffles/M snifter/MDSG snigger's sniper/M snipe/SM snipped snipper/SM snippet/SM snipping snippy/RT snip/SGDRZ snitch/GDS snit/SM sniveler/M snivel/JSZGDR Sn/M snobbery/SM snobbishness/S snobbish/YP snobby/RT snob/MS Snodgrass/M snood/SGDM snooker/GMD snook/SMRZ snooper/M snoop/SRDGZ Snoopy/M snoopy/RT snootily snootiness/MS snoot/SDMG snooty/TRP snooze/GSD snore/DSRGZ snorkel/ZGSRDM snorter/M snort/GSZRD snot/MS snotted snottily snottiness/SM snotting snotty/TRP snout/SGDM snowball/SDMG snowbank/SM Snowbelt/SM snowbird/SM snowblower/S snowboard/GZDRJS snowbound snowcapped snowdrift/MS snowdrop/MS snowfall/MS snowfield/MS snowflake/MS snow/GDMS snowily snowiness/MS Snow/M snowman/M snowmen snowmobile/GMDRS snowplough/M snowploughs snowplow/SMGD snowshed snowshoeing snowshoe/MRS snowshoer/M snowstorm/MS snowsuit/S snowy/RTP snubbed snubber snubbing snub/SP snuffbox/SM snuffer/M snuff/GZSYRD snuffle/GDSR snuffler/M snuffly/RT snugged snugger snuggest snugging snuggle/GDS snuggly snugness/MS snug/SYP Snyder/M so SO soaker/M soak/GDRSJ soapbox/DSMG soapiness/S soap/MDRGS soapstone/MS soapsud/S soapy/RPT soar/DRJSG soarer/M soaring/Y sobbed sobbing/Y soberer/M soberness/SM sober/PGTYRD sobriety/SIM sobriquet/MS sob/SZR Soc soccer/MS sociabilities sociability/IM sociable/S sociably/IU socialism/SM socialistic socialist/SM socialite/SM sociality/M socialization/SM socialized/U socializer/M socialize/RSDG socially/U social/SY societal/Y society/MS socio sociobiology/M sociocultural/Y sociodemographic socioeconomically socioeconomic/S sociolinguistics/M sociological/MY sociologist/SM sociology/SM sociometric sociometry/M sociopath/M sociopaths socket/SMDG sock/GDMS Socorro/M Socrates/M Socratic/S soc/S soda/SM sodded sodden/DYPSG soddenness/M sodding Soddy/M sodium/MS sod/MS sodomite/MS sodomize/GDS Sodom/M sodomy/SM soever sofa/SM Sofia/M Sofie/M softball/MS softbound softener/M soften/ZGRD softhearted softie's softness/MS soft/SPXTYNR software/MS softwood/SM softy/SM soggily sogginess/S soggy/RPT Soho/M soigné soiled/U soil/SGMD soirée/SM sojourn/RDZGSM solace/GMSRD solacer/M solaria solarium/M solar/S solder/RDMSZG soldier/MDYSG soldiery/MS sold/RU solecism/MS soled/FA solemness solemnify/GSD solemnity/MS solemnization/SM solemnize/GSD solemnness/SM solemn/PTRY solenoid/MS soler/F soles/IFA sole/YSP sol/GSMDR solicitation/S solicited/U solicitor/MS solicitousness/S solicitous/YP solicit/SDG solicitude/MS solidarity/MS solidi solidification/M solidify/NXSDG solidity/S solidness/SM solid/STYRP solidus/M soliloquies soliloquize/DSG soliloquy/M soling/NM solipsism/MS solipsist/S Solis/M solitaire/SM solitary/SP solitude/SM Sollie/M Solly/M Sol/MY solo/DMSG soloist/SM Solomon/SM Solon/M Soloviev/M solstice/SM solubility/IMS soluble/SI solute/ENAXS solute's solution/AME solvable/UI solvating solve/ABSRDZG solved/EU solvency/IMS solvent/IS solvently solvent's solver/MEA solves/E solving/E Solzhenitsyn/M Somalia/M Somalian/S Somali/MS soma/M somatic somberness/SM somber/PY sombre sombrero/SM somebody'll somebody/SM someday somehow someone'll someone/SM someplace/M somersault/DSGM Somerset/M somerset/S somersetted somersetting Somerville/M something/S sometime/S someway/S somewhat/S somewhere/S some/Z sommelier/SM Somme/M somnambulism/SM somnambulist/SM somnolence/MS somnolent/Y Somoza/M sonar/SM sonata/MS sonatina/SM Sondheim/M Sondra/M Sonenberg/M songbag songbird/SM songbook/S songfest/MS songfulness/M songful/YP Songhai/M Songhua/M song/MS songster/MS songstress/SM songwriter/SM songwriting Sonia/M sonic/S Sonja/M Son/M sonnet/MDSG Sonnie/M Sonni/M Sonnnie/M Sonny/M sonny/SM Sonoma/M Sonora/M sonority/S sonorousness/SM sonorous/PY son/SMY Sontag/M sonuvabitch Sonya/M Sony/M soonish soon/TR soothe soother/M sooth/GZTYSRDMJ soothingness/M soothing/YP sooths soothsayer/M soothsay/JGZR soot/MGDS sooty/RT SOP Sophey/M Sophia/SM Sophie/M Sophi/M sophism/SM sophister/M sophistical sophisticatedly sophisticated/U sophisticate/XNGDS sophistication/MU sophistic/S sophist/RMS sophistry/SM Sophoclean Sophocles/M sophomore/SM sophomoric Sophronia/M soporifically soporific/SM sopped sopping/S soppy/RT soprano/SM sop/SM Sopwith/M sorbet/SM Sorbonne/M sorcerer/MS sorceress/S sorcery/MS Sorcha/M sordidness/SM sordid/PY sorehead/SM soreness/S Sorensen/M Sorenson/M sore/PYTGDRS sorghum/MS sorority/MS sorrel/SM Sorrentine/M sorrily sorriness/SM sorrower/M sorrowfulness/SM sorrowful/YP sorrow/GRDMS sorry/PTSR sorta sortable sorted/U sorter/MS sort/FSAGD sortieing sortie/MSD sort's sos SOS Sosa/M Sosanna/M Soto/M sot/SM sottish soubriquet's soufflé/MS sough/DG soughs sought/U soulfulness/MS soulful/YP soulless/Y soul/MDS sound/AUD soundboard/MS sounders sounder's sounder/U soundest sounding/AY soundings sounding's soundless/Y soundly/U soundness/UMS soundproof/GSD soundproofing/M sound's sounds/A soundtrack/MS soupçon/SM soup/GMDS Souphanouvong/M soupy/RT source/ASDMG sourceless sourdough sourdoughs sourish sourness/MS sourpuss/MS sour/TYDRPSG Sousa/M sousaphone/SM sous/DSG souse sou/SMH Southampton/M southbound southeastern southeaster/YM Southeast/MS southeast/RZMS southeastward/S southerly/S souther/MY southerner/M Southerner/MS southernisms southernmost southern/PZSYR Southey/M Southfield/M southing/M southland/M South/M southpaw/MS south/RDMG souths Souths southward/S southwestern southwester/YM Southwest/MS southwest/RMSZ southwestward/S souvenir/SM sou'wester sovereignty/MS sovereign/YMS soviet/MS Soviet/S sow/ADGS sowbelly/M sowens/M sower/DS Soweto/M sown/A sox's soybean/MS Soyinka/M soy/MS Soyuz/M Spaatz/M spacecraft/MS space/DSRGZMJ spaceflight/S spaceman/M spacemen spaceport/SM spacer/M spaceship/MS spacesuit/MS spacewalk/GSMD Spacewar/M spacewoman spacewomen spacey spacial spacier spaciest spaciness spacing/M spaciousness/SM spacious/PY Spackle spade/DSRGM spadeful/SM spader/M spadework/SM spadices spadix/M Spafford/M spaghetti/SM Spahn/M Spain/M spake Spalding/M Spam/M spa/MS Span spandex/MS spandrels spangle/GMDS Spanglish/S Spaniard/SM spanielled spanielling spaniel/SM Spanish/M spanker/M spanking/M spank/SRDJG span/MS spanned/U spanner/SM spanning SPARC/M SPARCstation/M spar/DRMGTS spareness/MS spare/PSY spareribs sparer/M sparing/UY sparker/M sparkle/DRSGZ sparkler/M Sparkman/M Sparks spark/SGMRD sparky/RT sparling/SM sparred sparrer sparring/U sparrow/MS sparseness/S sparse/YP sparsity/S spars/TR Spartacus/M Sparta/M spartan Spartan/S spasm/GSDM spasmodic spasmodically spastic/S spate/SM spathe/MS spatiality/M spatial/Y spat/MS spatted spatter/DGS spatterdock/M spatting spatula/SM spavin/DMS spawner/M spawn/MRDSG spay/DGS SPCA speakable/U speakeasy/SM speaker/M Speaker's speakership/M speaking/U speak/RBGZJS spearer/M spearfish/SDMG spearhead/GSDM spearmint/MS spear/MRDGS Spears spec'd specialism/MS specialist/MS specialization/SM specialized/U specialize/GZDSR specializing/U special/SRYP specialty/MS specie/MS specif specifiability specifiable specifiably specifically specification/SM specificity/S specific/SP specified/U specifier/SM specifies specify/AD specifying specimen/SM spec'ing speciousness/SM specious/YP speck/GMDS speckle/GMDS spec/SM spectacle/MSD spectacular/SY spectator/SM specter/DMS specter's/A spectralness/M spectral/YP spectra/M spectrogram/MS spectrographically spectrograph/M spectrography/M spectrometer/MS spectrometric spectrometry/M spectrophotometer/SM spectrophotometric spectrophotometry/M spectroscope/SM spectroscopic spectroscopically spectroscopy/SM spectrum/M specularity specular/Y speculate/VNGSDX speculation/M speculative/Y speculator/SM sped speech/GMDS speechlessness/SM speechless/YP speedboat/GSRM speedboating/M speeder/M speedily speediness/SM speedometer/MS speed/RMJGZS speedster/SM speedup/MS speedway/SM speedwell/MS speedy/PTR speer/M speleological speleologist/S speleology/MS spellbinder/M spellbind/SRGZ spellbound spelldown/MS spelled/A speller/M spelling/M spell/RDSJGZ spells/A spelunker/MS spelunking/S Spencerian Spencer/M Spence/RM spender/M spend/SBJRGZ spendthrift/MS Spenglerian Spengler/M Spense/MR Spenserian Spenser/M spent/U spermatophyte/M spermatozoa spermatozoon/M spermicidal spermicide/MS sperm/SM Sperry/M spew/DRGZJS spewer/M SPF sphagnum/SM sphere/SDGM spherical/Y spheric/S spherics/M spheroidal/Y spheroid/SM spherule/MS sphincter/SM Sphinx/M sphinx/MS Spica/M spic/DGM spicebush/M spice/SM spicily spiciness/SM spicule/MS spicy/PTR spider/SM spiderweb/S spiderwort/M spidery/TR Spiegel/M Spielberg/M spiel/GDMS spier/M spiffy/TDRSG spigot/MS spike/GMDSR Spike/M spiker/M spikiness/SM spiky/PTR spillage/SM Spillane/M spillover/SM spill/RDSG spillway/SM spinach/MS spinal/YS spindle/JGMDRS spindly/RT spinelessness/M spineless/YP spine/MS spinet/SM spininess/M spinnability/M spinnaker/SM spinneret/MS spinner/SM spinning/SM Spinoza/M spin/S spinsterhood/SM spinsterish spinster/MS spiny/PRT spiracle/SM spiraea's spiral/YDSG spire/AIDSGF spirea/MS spire's spiritedness/M spirited/PY spirit/GMDS spiritless spirits/I spiritualism/SM spiritualistic spiritualist/SM spirituality/SM spiritual/SYP spirituous spirochete/SM Spiro/M spiry/TR spitball/SM spite/CSDAG spitefuller spitefullest spitefulness/MS spiteful/PY spite's/A spitfire/SM spit/SGD spitted spitting spittle/SM spittoon/SM Spitz/M splashdown/MS splasher/M splash/GZDRS splashily splashiness/MS splashy/RTP splat/SM splatted splatter/DSG splatting splayfeet splayfoot/MD splay/SDG spleen/SM splendidness/M splendid/YRPT splendorous splendor/SM splenetic/S splicer/M splice/RSDGZJ spline/MSD splinter/GMD splintery splint/SGZMDR splits/M split/SM splittable splitter/MS splitting/S splodge/SM splotch/MSDG splotchy/RT splurge/GMDS splutterer/M splutter/RDSG Sp/M Spock/M spoilables spoilage/SM spoil/CSZGDR spoiled/U spoiler/MC spoilsport/SM Spokane/M spoke/DSG spoken/U spokeshave/MS spokesman/M spokesmen spokespeople spokesperson/S spokeswoman/M spokeswomen spoliation/MCS spongecake sponge/GMZRSD sponger/M sponginess/S spongy/TRP sponsor/DGMS sponsorship/S spontaneity/SM spontaneousness/M spontaneous/PY spoof/SMDG spookiness/MS spook/SMDG spooky/PRT spool/SRDMGZ spoonbill/SM spoonerism/SM spoonful/MS spoon/GSMD spoor/GSMD sporadically sporadic/Y spore/DSGM sporran/MS sportiness/SM sporting/Y sportiveness/M sportive/PY sportscast/RSGZM sportsmanlike/U sportsman/MY sportsmanship/MS sportsmen sportswear/M sportswoman/M sportswomen sportswriter/S sport/VGSRDM sporty/PRT Sposato/M spotlessness/MS spotless/YP spotlight/GDMS spotlit spot/MSC spotted/U spotter/MS spottily spottiness/SM spotting/M spotty/RTP spousal/MS spouse/GMSD spouter/M spout/SGRD sprain/SGD sprang/S sprat/SM sprawl/GSD sprayed/UA sprayer/M spray/GZSRDM sprays/A spreadeagled spreader/M spread/RSJGZB spreadsheet/S spreeing spree/MDS sprigged sprigging sprightliness/MS sprightly/PRT sprig/MS springboard/MS springbok/MS springeing springer/M Springfield/M springily springiness/SM springing/M springlike spring/SGZR Springsteen/M springtime/MS springy/TRP sprinkle/DRSJZG sprinkler/DM sprinkling/M Sprint/M sprint/SGZMDR sprite/SM spritz/GZDSR sprocket/DMGS sprocketed/U Sproul/M sprout/GSD spruce/GMTYRSDP spruceness/SM sprue/M sprung/U spryness/S spry/TRY SPSS spudded spudding spud/MS Spuds/M spume/DSGM spumone's spumoni/S spumy/TR spun spunk/GSMD spunky/SRT spurge/MS spuriousness/SM spurious/PY spur/MS spurn/RDSG spurred spurring spurt/SGD sputa Sputnik sputnik/MS sputter/DRGS sputum/M spy/DRSGM spyglass/MS sq sqq sqrt squabbed squabber squabbest squabbing squabbler/M squabble/ZGDRS squab/SM squadded squadding squadron/MDGS squad/SM squalidness/SM squalid/PRYT squaller/M squall/GMRDS squally/RT squalor/SM squamous/Y squander/GSRD Squanto square/GMTYRSDP squareness/SM squarer/M Squaresville/M squarish squash/GSRD squashiness/M squashy/RTP squatness/MS squat/SPY squatted squatter/SMDG squattest squatting squawker/M squawk/GRDMZS squaw/SM squeaker/M squeakily squeakiness/S squeak/RDMGZS squeaky/RPT squealer/M squeal/MRDSGZ squeamishness/SM squeamish/YP squeegee/DSM squeegeeing squeeze/GZSRDB squeezer/M squelcher/M squelch/GDRS squelchy/RT squibbed Squibb/GM squibbing Squibbing/M squib/SM squidded squidding squid/SM squiggle/MGDS squiggly/RT squinter/M squint/GTSRD squinting/Y squirehood squire/SDGM squirm/SGD squirmy/TR squirrel/SGYDM squirter/M squirt/GSRD squish/GSD squishy/RTP Sr Srinagar/M SRO S's SS SSA SSE ssh s's/KI SSS SST SSW ST stabbed stabber/S stabbing/S stability/ISM stabilizability stabilization/CS stabilization's stabilize/CGSD stabilizer/MS stableman/M stablemate stablemen stableness/UM stable/RSDGMTP stabler/U stable's/F stables/F stablest/U stabling/M stably/U stab/YS staccato/S Stacee/M Stace/M Stacey/M Stacia/M Stacie/M Staci/M stackable stacker/M stack's stack/USDG Stacy/M stadias stadia's stadium/MS Stael/M Stafani/M staff/ADSG Staffard/M staffer/MS Stafford/M Staffordshire/M staffroom staff's Staford/M stag/DRMJSGZ stagecoach/MS stagecraft/MS stagehand/MS stager/M stage/SM stagestruck stagflation/SM stagged staggerer/M stagger/GSJDR staggering/Y staggers/M stagging staginess/M staging/M stagnancy/SM stagnant/Y stagnate/NGDSX stagnation/M stagy/PTR Stahl/M staidness/MS staid/YRTP stained/U stainer/M stainless/YS stain/SGRD staircase/SM stair/MS stairway/SM stairwell/MS stake/DSGM stakeholder/S stakeout/SM stalactite/SM stalag/M stalagmite/SM stalemate/SDMG staleness/MS stale/PGYTDSR Staley/M Stalingrad/M Stalinist Stalin/SM stalker/M stalk/MRDSGZJ stall/DMSJG stalled/I stallholders stallion/SM Stallone/M stalls/I stalwartness/M stalwart/PYS Sta/M stamen/MS Stamford/M stamina/SM staminate stammer/DRSZG stammerer/M stammering/Y stampede/MGDRS stampeder/M stamped/U stamper/M stamp/RDSGZJ stance/MIS stancher/M stanch/GDRST stanchion/SGMD standalone standardization/AMS standardized/U standardize/GZDSR standardizer/M standardizes/A standard/YMS standby standbys standee/MS Standford/M standing/M Standish/M standoffish standoff/SM standout/MS standpipe/MS standpoint/SM stand/SJGZR standstill/SM Stanfield/M Stanford/M Stanislas/M Stanislaus/M Stanislavsky/M Stanislaw/M stank/S Stanleigh/M Stanley/M Stanly/M stannic stannous Stanton/M Stanwood/M Stan/YMS stanza/MS staph/M staphs staphylococcal staphylococci staphylococcus/M stapled/U stapler/M Stapleton/M staple/ZRSDGM starboard/SDMG starchily starchiness/MS starch/MDSG starchy/TRP stardom/MS star/DRMGZS stardust/MS stare/S starfish/SM Stargate/M stargaze/ZGDRS staring/U Starkey/M Stark/M starkness/MS stark/SPGTYRD Starla/M Starlene/M starless starlet/MS starlight/MS starling/MS Starlin/M starlit Star/M starred starring Starr/M starry/TR starship starstruck start/ASGDR starter/MS startle/GDS startling/PY startup/SM starvation/MS starveling/M starver/M starve/RSDG stash/GSD stasis/M stat/DRSGV statecraft/MS stated/U statehood/MS statehouse/S Statehouse's state/IGASD statelessness/MS stateless/P stateliness/MS stately/PRT statement/MSA Staten/M stater/M stateroom/SM stateside state's/K states/K statesmanlike statesman/MY statesmanship/SM statesmen stateswoman stateswomen statewide statical/Y static/S statics/M stationarity stationary/S stationer/M stationery/MS stationmaster/M station/SZGMDR statistical/Y statistician/MS statistic/MS Statler/M stator/SM statuary/SM statue/MSD statuesque/YP statuette/MS stature/MS status/SM statute/SM statutorily statutory/P Stauffer/M staunchness/S staunch/PDRSYTG stave/DGM Stavro/MS stay/DRGZS stayer/M std STD stdio steadfastness/MS steadfast/PY steadily/U steadiness's steadiness/US steading/M stead/SGDM steady/DRSUTGP steakhouse/SM steak/SM stealer/M stealing/M steal/SRHG stealthily stealthiness/MS stealth/M stealths stealthy/PTR steamboat/MS steamer/MDG steamfitter/S steamfitting/S steamily steaminess/SM steamroller/DMG steamroll/GZRDS steam/SGZRDMJ steamship/SM steamy/RSTP Stearne/M Stearn/SM steed/SM Steele/M steeliness/SM steelmaker/M steel/SDMGZ steelworker/M steelwork/ZSMR steelyard/MS steely/TPRS Steen/M steepen/GD steeper/M steeplebush/M steeplechase/GMSD steeplejack/MS steeple/MS steepness/S steep/SYRNDPGTX steerage/MS steerer/M steer/SGBRDJ steersman/M steersmen steeves Stefa/M Stefania/M Stefanie/M Stefan/M Stefano/M Steffane/M Steffen/M Steffie/M Steffi/M stegosauri stegosaurus/S Steinbeck/SM Steinberg/M Steinem/M Steiner/M Steinmetz/M Stein/RM stein/SGZMRD Steinway/M Stella/M stellar stellated Ste/M stemless stemmed/U stemming stem/MS stemware/MS stench/GMDS stenciler/M stencil/GDRMSZ stencillings Stendhal/M Stendler/M Stengel/M stenographer/SM stenographic stenography/SM steno/SM stenotype/M stentorian stepbrother/MS stepchild/M stepchildren stepdaughter/MS stepfather/SM Stepha/M Stephana/M Stephanie/M Stephani/M Stephan/M Stephannie/M Stephanus/M Stephenie/M Stephen/MS Stephenson/M Stephie/M Stephi/M Stephine/M stepladder/SM step/MIS stepmother/SM stepparent/SM stepper/M steppe/RSDGMZ steppingstone/S stepsister/SM stepson/SM stepwise stereographic stereography/M stereo/GSDM stereophonic stereoscope/MS stereoscopic stereoscopically stereoscopy/M stereotype/GMZDRS stereotypic stereotypical/Y sterile sterility/SM sterilization/SM sterilized/U sterilize/RSDGZ sterilizes/A Sterling/M sterling/MPYS sterlingness/M sternal Sternberg/M Sterne/M Stern/M sternness/S Sterno stern/SYRDPGT sternum/SM steroidal steroid/MS stertorous Stesha/M stethoscope/SM stet/MS stetson/MS Stetson/SM stetted stetting Steuben/M Stevana/M stevedore/GMSD Steve/M Stevena/M Steven/MS Stevenson/M Stevie/M Stevy/M steward/DMSG stewardess/SM Steward/M stewardship/MS Stewart/M stew/GDMS st/GBJ sticker/M stickily stickiness/SM stickleback/MS stickle/GZDR stickler/M stick/MRDSGZ stickpin/SM stickup/SM sticky/GPTDRS Stieglitz/M stiffen/JZRDG stiff/GTXPSYRND stiffness/MS stifle/GJRSD stifler/M stifling/Y stigma/MS stigmata stigmatic/S stigmatization/C stigmatizations stigmatization's stigmatize/DSG stigmatized/U stile/GMDS stiletto/MDSG stillbirth/M stillbirths stillborn/S stiller/MI stillest Stillman/M Stillmann/M stillness/MS still/RDIGS Stillwell/M stilted/PY stilt/GDMS Stilton/MS Stimson/M stimulant/MS stimulated/U stimulate/SDVGNX stimulation/M stimulative/S stimulator/M stimulatory stimuli/M stimulus/MS Stine/M stinger/M sting/GZR stingily stinginess/MS stinging/Y stingray/MS stingy/RTP stinkbug/S stinker/M stink/GZRJS stinking/Y stinkpot/M Stinky/M stinky/RT stinter/M stinting/U stint/JGRDMS stipendiary stipend/MS stipple/JDRSG stippler/M stipulate/XNGSD stipulation/M Stirling/M stirred/U stirrer/SM stirring/YS stirrup/SM stir/S stitch/ASDG stitcher/M stitchery/S stitching/MS stitch's St/M stoat/SM stochastic stochastically stochasticity stockade/SDMG stockbreeder/SM stockbroker/MS stockbroking/S stocker/SM Stockhausen/M stockholder/SM Stockholm/M stockily stockiness/SM stockinet's stockinette/S stocking/MDS stockist/MS stockpile/GRSD stockpiler/M stockpot/MS stockroom/MS stock's stock/SGAD stocktaking/MS Stockton/M stockyard/SM stocky/PRT Stoddard/M stodge/M stodgily stodginess/S stodgy/TRP stogy/SM stoical/Y stoichiometric stoichiometry/M stoicism/SM Stoicism/SM stoic/MS Stoic/MS stoke/DSRGZ stoker/M stokes/M Stokes/M STOL stole/MDS stolen stolidity/S stolidness/S stolid/PTYR stolon/SM stomachache/MS stomacher/M stomach/RSDMZG stomachs stomp/DSG stonecutter/SM stone/DSRGM Stonehenge/M stoneless Stone/M stonemason/MS stoner/M stonewall/GDS stoneware/MS stonewashed stonework/SM stonewort/M stonily stoniness/MS stony/TPR stood stooge/SDGM stool/SDMG stoop/SDG stopcock/MS stopgap/SM stoplight/SM stopover/MS stoppable/U stoppage/MS Stoppard/M stopped/U stopper/GMDS stopping/M stopple/GDSM stop's stops/M stop/US stopwatch/SM storage/SM store/ADSRG storefront/SM storehouse/MS storekeeper/M storekeep/ZR storeroom/SM store's stork/SM stormbound stormer/M Stormie/M stormily Stormi/M storminess/S Storm/M storm/SRDMGZ stormtroopers Stormy/M stormy/PTR storyboard/MDSG storybook/MS story/GSDM storyline storyteller/SM storytelling/MS Stouffer/M stoup/SM stouten/DG stouthearted Stout/M stoutness/MS stout/STYRNP stove/DSRGM stovepipe/SM stover/M stowage/SM stowaway/MS Stowe/M stow/GDS Strabo/M straddler/M straddle/ZDRSG Stradivari/SM Stradivarius/M strafe/GRSD strafer/M straggle/GDRSZ straggly/RT straightaway/S straightedge/MS straightener/M straighten/ZGDR straightforwardness/MS straightforward/SYP straightjacket's straightness/MS straight/RNDYSTXGP straightway/S strain/ASGZDR strained/UF strainer/MA straining/F strains/F straiten/DG straitjacket/GDMS straitlaced straitness/M strait/XTPSMGYDNR stranded/P strand/SDRG strangeness/SM strange/PYZTR stranger/GMD stranglehold/MS strangle/JDRSZG strangles/M strangulate/NGSDX strangulation/M strapless/S strapped/U strapping/S strap's strap/US Strasbourg/M stratagem/SM strata/MS strategical/Y strategic/S strategics/M strategist/SM strategy/SM Stratford/M strati stratification/M stratified/U stratify/NSDGX stratigraphic stratigraphical stratigraphy/M stratosphere/SM stratospheric stratospherically stratum/M stratus/M Strauss Stravinsky/M strawberry/SM strawflower/SM straw/SMDG strayer/M stray/GSRDM streak/DRMSGZ streaker/M streaky/TR streamed/U streamer/M stream/GZSMDR streaming/M streamline/SRDGM streetcar/MS streetlight/SM street/SMZ streetwalker/MS streetwise Streisand/M strengthen/AGDS strengthener/MS strength/NMX strengths strenuousness/SM strenuous/PY strep/MS streptococcal streptococci streptococcus/M streptomycin/SM stress/DSMG stressed/U stressful/YP stretchability/M stretchable/U stretch/BDRSZG stretcher/DMG stretchy/TRP strew/GDHS strewn striae stria/M striate/DSXGN striated/U striation/M stricken Strickland/M strict/AF stricter strictest strictly strictness/S stricture/SM stridden stridency/S strident/Y strider/M stride/RSGM strife/SM strikebreaker/M strikebreaking/M strikebreak/ZGR strikeout/S striker/M strike/RSGZJ striking/Y Strindberg/M stringed stringency/S stringent/Y stringer/MS stringiness/SM stringing/M string's string/SAG stringy/RTP striper/M stripe/SM strip/GRDMS stripling/M stripped/U stripper/MS stripping stripteaser/M striptease/SRDGZM stripy/RT strive/JRSG striven striver/M strobe/SDGM stroboscope/SM stroboscopic strode stroke/ZRSDGM stroking/M stroller/M stroll/GZSDR Stromberg/M Stromboli/M Strom/M strongbow strongbox/MS Strongheart/M stronghold/SM strongish Strong/M strongman/M strongmen strongroom/MS strong/YRT strontium/SM strophe/MS strophic stropped stropping strop/SM strove struck structuralism/M structuralist/SM structural/Y structured/AU structureless structures/A structure/SRDMG structuring/A strudel/MS struggle/GDRS struggler/M strummed strumming strumpet/GSDM strum/S strung/UA strut/S strutted strutter/M strutting strychnine/MS Stuart/MS stubbed/M stubbing Stubblefield/MS stubble/SM stubbly/RT stubbornness/SM stubborn/SGTYRDP stubby/SRT stub/MS stuccoes stucco/GDM stuck/U studbook/SM studded studding/SM Studebaker/M studentship/MS student/SM studiedness/M studied/PY studier/SM studio/MS studiousness/SM studious/PY stud/MS study/AGDS stuffily stuffiness/SM stuffing/M stuff/JGSRD stuffy/TRP stultify/NXGSD Stu/M stumble/GZDSR stumbling/Y stumpage/M stumper/M stump/RDMSG stumpy/RT stung stunk stunned stunner/M stunning/Y stun/S stunted/P stunt/GSDM stupefaction/SM stupefy/DSG stupendousness/M stupendous/PY stupidity/SM stupidness/M stupid/PTYRS stupor/MS sturdily sturdiness/SM sturdy/SRPT sturgeon/SM Sturm/M stutter/DRSZG Stuttgart/M Stuyvesant/M sty/DSGM Stygian styled/A style/GZMDSR styles/A styli styling/A stylishness/S stylish/PY stylistically stylistic/S stylist/MS stylites stylization/MS stylize/DSG stylos stylus/SM stymieing stymie/SD stymy's styptic/S styrene/MS Styrofoam/S Styx/M suable Suarez/M suasion/EMS suaveness/S suave/PRYT suavity/SM subaltern/SM subarctic/S subareas Subaru/M subassembly/M subatomic/S subbasement/SM subbed subbing subbranch/S subcaste/M subcategorizing subcategory/SM subchain subclassifications subclass/MS subclauses subcommand/S subcommittee/SM subcompact/S subcomponent/MS subcomputation/MS subconcept subconsciousness/SM subconscious/PSY subconstituent subcontinental subcontinent/MS subcontractor/SM subcontract/SMDG subcultural subculture/GMDS subcutaneous/Y subdirectory/S subdistrict/M subdivide/SRDG subdivision/SM subdued/Y subdue/GRSD subduer/M subexpression/MS subfamily/SM subfield/MS subfile/SM subfreezing subgoal/SM subgraph subgraphs subgroup/SGM subharmonic/S subheading/M subhead/MGJS subhuman/S subindex/M subinterval/MS subj subject/GVDMS subjection/SM subjectiveness/M subjective/PSY subjectivist/S subjectivity/SM subjoin/DSG subjugate/NGXSD subjugation/M subjunctive/S sublayer sublease/DSMG sublet/S subletting sublimate/GNSDX sublimation/M sublime/GRSDTYP sublimeness/M sublimer/M subliminal/Y sublimity/SM sublist/SM subliterary sublunary submachine submarginal submarine/MZGSRD submariner/M submerge/DSG submergence/SM submerse/XNGDS submersible/S submersion/M submicroscopic submission/SAM submissiveness/MS submissive/PY submit/SA submittable submittal submitted/A submitter/S submitting/A submode/S submodule/MS sub/MS subnational subnet/SM subnetwork/SM subnormal/SY suboptimal suborbital suborder/MS subordinately/I subordinates/I subordinate/YVNGXPSD subordination/IMS subordinator subornation/SM suborn/GSD subpage subparagraph/M subpart/MS subplot/MS subpoena/GSDM subpopulation/MS subproblem/SM subprocess/SM subprofessional/S subprogram/SM subproject subproof/SM subquestion/MS subrange/SM subregional/Y subregion/MS subrogation/M subroutine/SM subsample/MS subschema/MS subscribe/ASDG subscriber/SM subscripted/U subscription/MS subscript/SGD subsection/SM subsegment/SM subsentence subsequence/MS subsequent/SYP subservience/SM subservient/SY subset/MS subsidence/MS subside/SDG subsidiarity subsidiary/MS subsidization/MS subsidized/U subsidizer/M subsidize/ZRSDG subsidy/MS subsistence/MS subsistent subsist/SGD subsocietal subsoil/DRMSG subsonic subspace/MS subspecies/M substance/MS substandard substantially/IU substantialness/M substantial/PYS substantiated/U substantiate/VGNSDX substantiation/MFS substantiveness/M substantive/PSYM substantivity substation/MS substerilization substitutability substituted/U substitute/NGVBXDRS substitutionary substitution/M substitutive/Y substrata substrate/MS substratum/M substring/S substructure/SM subsume/SDG subsurface/S subsystem/MS subtable/S subtask/SM subteen/SM subtenancy/MS subtenant/SM subtend/DS subterfuge/SM subterranean/SY subtest subtext/SM subtitle/DSMG subtleness/M subtle/RPT subtlety/MS subtly/U subtopic/SM subtotal/GSDM subtracter/M subtraction/MS subtract/SRDZVG subtrahend/SM subtree/SM subtropical subtropic/S subtype/MS subunit/SM suburbanite/MS suburbanization/MS suburbanized suburbanizing suburban/S suburbia/SM suburb/MS subvention/MS subversion/SM subversiveness/MS subversive/SPY subverter/M subvert/SGDR subway/MDGS subzero succeeder/M succeed/GDRS successfulness/M successful/UY succession/SM successiveness/M successive/YP success/MSV successor/MS successorship succinctness/SM succinct/RYPT succored/U succorer/M succor/SGZRDM succotash/SM succubus/M succulence/SM succulency/MS succulent/S succumb/SDG such suchlike sucker/DMG suck/GZSDRB suckle/SDJG suckling/M Sucre/M sucrose/MS suction/SMGD Sudanese/M Sudanic/M Sudan/M suddenness/SM sudden/YPS Sudetenland/M sud/S suds/DSRG sudsy/TR sued/DG suede/SM Suellen/M Sue/M suer/M suet/MS Suetonius/M suety sue/ZGDRS Suez/M sufferance/SM sufferer/M suffering/M suffer/SJRDGZ suffice/GRSD sufficiency/SIM sufficient/IY suffixation/S suffixed/U suffix/GMRSD suffocate/XSDVGN suffocating/Y Suffolk/M suffragan/S suffrage/MS suffragette/MS suffragist/SM suffuse/VNGSDX suffusion/M Sufi/M Sufism/M sugarcane/S sugarcoat/GDS sugarless sugarplum/MS sugar/SJGMD sugary/TR suggest/DRZGVS suggester/M suggestibility/SM suggestible suggestion/MS suggestiveness/MS suggestive/PY sugillate Suharto/M suicidal/Y suicide/GSDM Sui/M suitability/SU suitableness/S suitable/P suitably/U suitcase/MS suited/U suite/SM suiting/M suit/MDGZBJS suitor/SM Sukarno/M Sukey/M Suki/M sukiyaki/SM Sukkoth's Sukkot/S Sula/M Sulawesi/M Suleiman/M sulfaquinoxaline sulfa/S sulfate/MSDG sulfide/S sulfite/M sulfonamide/SM sulfur/DMSG sulfuric sulfurousness/M sulfurous/YP sulk/GDS sulkily sulkiness/S sulky/RSPT Sulla/M sullenness/MS sullen/TYRP sullied/U Sullivan/M sully/GSD Sully/M sulphate/SM sulphide/MS sulphuric sultana/SM sultanate/MS sultan/SM sultrily sultriness/SM sultry/PRT Sulzberger/M sumach's sumac/SM Sumatra/M Sumatran/S sumer/F Sumeria/M Sumerian/M summability/M summable summand/MS summarily summarization/MS summarized/U summarize/GSRDZ summarizer/M summary/MS summation/FMS summed Summerdale/M summerhouse/MS summer/SGDM Summer/SM summertime/MS summery/TR summing summit/GMDS summitry/MS summoner/M summon/JSRDGZ summons/MSDG sum/MRS Sumner/M sumo/SM sump/SM sumptuousness/SM sumptuous/PY Sumter/M Sun sunbaked sunbathe sunbather/M sunbathing/M sunbaths sunbath/ZRSDG sunbeam/MS Sunbelt/M sunblock/S sunbonnet/MS sunburn/GSMD sunburst/MS suncream sundae/MS Sundanese/M Sundas Sunday/MS sunder/SDG sundial/MS sundowner/M sundown/MRDSZG sundris sundry/S sunfish/SM sunflower/MS sunglass/MS Sung/M sung/U sunk/SN sunlamp/S sunless sunlight/MS sunlit sun/MS sunned Sunni/MS sunniness/SM sunning Sunnite/SM Sunny/M sunny/RSTP Sunnyvale/M sunrise/GMS sunroof/S sunscreen/S sunset/MS sunsetting sunshade/MS Sunshine/M sunshine/MS sunshiny sunspot/SM sunstroke/MS suntanned suntanning suntan/SM sunup/MS superabundance/MS superabundant superannuate/GNXSD superannuation/M superbness/M superb/YRPT supercargoes supercargo/M supercharger/M supercharge/SRDZG superciliousness/SM supercilious/PY supercity/S superclass/M supercomputer/MS supercomputing superconcept superconducting superconductivity/SM superconductor/SM supercooled supercooling supercritical superdense super/DG superego/SM supererogation/MS supererogatory superficiality/S superficial/SPY superfine superfix/M superfluity/MS superfluousness/S superfluous/YP superheat/D superheroes superhero/SM superhighway/MS superhumanness/M superhuman/YP superimpose/SDG superimposition/MS superintendence/S superintendency/SM superintendent/SM superintend/GSD superiority/MS Superior/M superior/SMY superlativeness/M superlative/PYS superlunary supermachine superman/M Superman/M supermarket/SM supermen supermodel supermom/S supernal supernatant supernaturalism/M supernaturalness/M supernatural/SPY supernormal/Y supernovae supernova/MS supernumerary/S superordinate superpose/BSDG superposition/MS superpower/MS superpredicate supersaturate/XNGDS supersaturation/M superscribe/GSD superscript/DGS superscription/SM superseder/M supersede/SRDG supersensitiveness/M supersensitive/P superset/MS supersonically supersonic/S supersonics/M superstar/SM superstition/SM superstitious/YP superstore/S superstructural superstructure/SM supertanker/SM supertitle/MSDG superuser/MS supervene/GSD supervention/S supervised/U supervise/SDGNX supervision/M supervisor/SM supervisory superwoman/M superwomen supineness/M supine/PSY supper/DMG supplanter/M supplant/SGRD supplemental/S supplementary/S supplementation/S supplementer/M supplement/SMDRG suppleness/SM supple/SPLY suppliant/S supplicant/MS supplicate/NGXSD supplication/M supplier/AM suppl/RDGT supply/MAZGSRD supportability/M supportable/UI supported/U supporter/M supporting/Y supportive/Y support/ZGVSBDR supposed/Y suppose/SRDBJG supposition/MS suppository/MS suppressant/S suppressed/U suppressible/I suppression/SM suppressive/P suppressor/S suppress/VGSD suppurate/NGXSD suppuration/M supp/YDRGZ supra supranational supranationalism/M suprasegmental supremacist/SM supremacy/SM supremal supremeness/M supreme/PSRTY supremo/M sup/RSZ supt Supt/M Surabaya/M Surat/M surcease/DSMG surcharge/MGSD surcingle/MGSD surd/M sured/I surefire surefooted surely sureness/MS sureness's/U sure/PU surer/I surest surety/SM surfaced/UA surface/GSRDPZM surfacer/AMS surfaces/A surfacing/A surfactant/SM surfboard/MDSG surfeit/SDRMG surfer/M surfing/M surf/SJDRGMZ surged/A surge/GYMDS surgeon/MS surgery/MS surges/A surgical/Y Suriname Surinamese Surinam's surliness/SM surly/TPR surmiser/M surmise/SRDG surmountable/IU surmount/DBSG surname/GSDM surpassed/U surpass/GDS surpassing/Y surplice/SM surplus/MS surplussed surplussing surprised/U surprise/MGDRSJ surpriser/M surprising/YU surrealism/MS surrealistic surrealistically surrealist/S surreality surreal/S surrender/DRSG surrenderer/M surreptitiousness/S surreptitious/PY surrey/SM surrogacy/S surrogate/SDMNG surrogation/M surrounding/M surround/JGSD surtax/SDGM surveillance/SM surveillant surveyed/A surveying/M survey/JDSG surveyor/MS surveys/A survivability/M survivable/U survivalist/S survival/MS survive/SRDBG survivor/MS survivorship/M Surya/M Sus Susana/M Susanetta/M Susan/M Susannah/M Susanna/M Susanne/M Susann/M susceptibilities susceptibility/IM susceptible/I Susette/M sushi/SM Susie/M Susi/M suspected/U suspecter/M suspect/GSDR suspecting/U suspend/DRZGS suspended/UA suspender/M suspenseful suspense/MXNVS suspension/AM suspensive/Y suspensor/M suspicion/GSMD suspiciousness/M suspicious/YP Susquehanna/M Sussex/M sustainability sustainable/U sustain/DRGLBS sustainer/M sustainment/M sustenance/MS Susy/M Sutherland/M Sutherlan/M sutler/MS Sutton/M suture/GMSD SUV Suva/M Suwanee/M Suzanna/M Suzanne/M Suzann/M suzerain/SM suzerainty/MS Suzette/M Suzhou/M Suzie/M Suzi/M Suzuki/M Suzy/M Svalbard/M svelte/RPTY Svend/M Svengali Sven/M Sverdlovsk/M Svetlana/M SW swabbed swabbing swabby/S Swabian/SM swab/MS swaddle/SDG swagged swagger/GSDR swagging swag/GMS Swahili/MS swain/SM SWAK swallower/M swallow/GDRS swallowtail/SM swam swami/SM swamper/M swampland/MS swamp/SRDMG swampy/RPT Swanee/M swankily swankiness/MS swank/RDSGT swanky/PTRS swanlike swan/MS swanned swanning Swansea/M Swanson/M swappable/U swapped swapper/SM swapping swap/S sward/MSGD swarmer/M swarm/GSRDM swarthiness/M Swarthmore/M swarthy/RTP swart/P Swartz/M swashbuckler/SM swashbuckling/S swash/GSRD swastika/SM SWAT swatch/MS swathe swather/M swaths swath/SRDMGJ swat/S swatted swatter/MDSG swatting swayback/SD sway/DRGS swayer/M Swaziland/M Swazi/SM swearer/M swear/SGZR swearword/SM sweatband/MS sweater/M sweatily sweatiness/M sweatpants sweat/SGZRM sweatshirt/S sweatshop/MS sweaty/TRP Swedenborg/M Sweden/M swede/SM Swede/SM Swedish Swed/MN Sweeney/SM sweeper/M sweepingness/M sweeping/PY sweep/SBRJGZ sweeps/M sweepstakes sweepstake's sweetbread/SM sweetbrier/SM sweetcorn sweetened/U sweetener/M sweetening/M sweeten/ZDRGJ sweetheart/MS sweetie/MS sweeting/M sweetish/Y Sweet/M sweetmeat/MS sweetness/MS sweetshop sweet/TXSYRNPG swellhead/DS swelling/M swell/SJRDGT swelter/DJGS sweltering/Y Swen/M Swenson/M swept sweptback swerve/GSD swerving/U swifter/M swift/GTYRDPS Swift/M swiftness/MS swigged swigging swig/SM swill/SDG swimmer/MS swimming/MYS swim/S swimsuit/MS Swinburne/M swindle/GZRSD swindler/M swineherd/MS swine/SM swingeing swinger/M swinging/Y swing/SGRZJB swingy/R swinishness/M swinish/PY Swink/M swipe/DSG swirling/Y swirl/SGRD swirly/TR swish/GSRD swishy/R swiss Swiss/S switchback/GDMS switchblade/SM switchboard/MS switcher/M switch/GBZMRSDJ switchgear switchman/M switchmen/M switchover/M Switzerland/M Switzer/M Switz/MR swivel/GMDS swizzle/RDGM swob's swollen swoon/GSRD swooning/Y swoop/RDSG swoosh/GSD swop's sword/DMSG swordfish/SM swordplayer/M swordplay/RMS swordsman/M swordsmanship/SM swordsmen swordtail/M swore sworn swot/S swum swung s/XJBG sybarite/MS sybaritic Sybila/M Sybilla/M Sybille/M Sybil/M Sybyl/M sycamore/SM sycophancy/S sycophantic sycophantically sycophant/SYM Sydelle/M Sydel/M Syd/M Sydney/M Sykes/M Sylas/M syllabicate/GNDSX syllabication/M syllabicity syllabic/S syllabification/M syllabify/GSDXN syllabi's syllable/SDMG syllabub/M syllabus/MS syllabusss syllogism/MS syllogistic Sylow/M sylphic sylphlike sylph/M sylphs Sylvania/M Sylvan/M sylvan/S Sylvester/M Sylvia/M Sylvie/M Syman/M symbiont/M symbioses symbiosis/M symbiotic symbol/GMDS symbolical/Y symbolics/M symbolic/SM symbolism/MS symbolist/MS symbolization/MAS symbolized/U symbolize/GZRSD symbolizes/A Symington/M symmetric symmetrically/U symmetricalness/M symmetrical/PY symmetrization/M symmetrizing symmetry/MS Symon/M sympathetically/U sympathetic/S sympathized/U sympathizer/M sympathize/SRDJGZ sympathizing/MYUS sympathy/MS symphonic symphonists symphony/MS symposium/MS symptomatic symptomatically symptomatology/M symptom/MS syn synagogal synagogue/SM synapse/SDGM synaptic synchronism/M synchronization's synchronization/SA synchronize/AGCDS synchronized/U synchronizer/MS synchronousness/M synchronous/YP synchrony synchrotron/M syncopate/VNGXSD syncopation/M syncope/MS sync/SGD syndicalist syndicate/XSDGNM syndic/SM syndrome/SM synergism/SM synergistic synergy/MS synfuel/S Synge/M synod/SM synonymic synonymous/Y synonym/SM synonymy/MS synopses synopsis/M synopsized synopsizes synopsizing synoptic/S syntactical/Y syntactics/M syntactic/SY syntax/MS syntheses synthesis/M synthesized/U synthesize/GZSRD synthesizer/M synthesizes/A synthetically synthetic/S syphilis/MS syphilitic/S syphilized syphilizing Syracuse/M Syriac/M Syria/M Syrian/SM syringe/GMSD syrup/DMSG syrupy sys systematical/Y systematics/M systematic/SP systematization/SM systematized/U systematizer/M systematize/ZDRSG systematizing/U systemically systemic/S systemization/SM system/MS systole/MS systolic Szilard/M Szymborska/M TA Tabasco/MS Tabatha/M Tabbatha/M tabbed Tabbie/M Tabbi/M tabbing Tabbitha/M Tabb/M tabbouleh tabboulehs tabby/GSD Tabby/M Taber/M Tabernacle/S tabernacle/SDGM Tabina/M Tabitha/M tabla/MS tableau/M tableaux tablecloth/M tablecloths table/GMSD tableland/SM tablespoonful/MS tablespoon/SM tablet/MDGS tabletop/MS tableware/SM tabling/M tabloid/MS Tab/MR taboo/GSMD Tabor/M tabor/MDGS Tabriz/SM tab/SM tabula tabular/Y tabulate/XNGDS tabulation/M tabulator/MS tachometer/SM tachometry tachycardia/MS tachyon/SM tacitness/MS taciturnity/MS taciturn/Y Tacitus/M tacit/YP tacker/M tack/GZRDMS tackiness/MS tackler/M tackle/RSDMZG tackling/M tacky/RSTP Tacoma/M taco/MS tact/FSM tactfulness/S tactful/YP tactical/Y tactician/MS tactic/SM tactile/Y tactility/S tactlessness/SM tactless/PY tactual/Y Taddeo/M Taddeusz/M Tadd/M Tadeas/M Tadeo/M Tades Tadio/M Tad/M tadpole/MS tad/SM Tadzhikistan's Tadzhikstan/M Taegu/M Taejon/M taffeta/MS taffrail/SM Taffy/M taffy/SM Taft/M Tagalog/SM tagged/U tagger/S tagging Tagore/M tag/SM Tagus/M Tahitian/S Tahiti/M Tahoe/M Taichung/M taiga/MS tailback/MS tail/CMRDGAS tailcoat/S tailer/AM tailgate/MGRSD tailgater/M tailing/MS taillessness/M tailless/P taillight/MS tailor/DMJSGB Tailor/M tailpipe/SM tailspin/MS tailwind/SM Tainan/M Taine/M taint/DGS tainted/U Taipei/M Taite/M Tait/M Taiwanese Taiwan/M Taiyuan/M Tajikistan takeaway/S taken/A takeoff/SM takeout/S takeover/SM taker/M take/RSHZGJ takes/IA taking/IA Taklamakan/M Talbert/M Talbot/M talcked talcking talc/SM talcum/S talebearer/SM talented/M talentless talent/SMD taler/M tale/RSMN tali Talia/M Taliesin/M talion/M talismanic talisman/SM talkativeness/MS talkative/YP talker/M talk/GZSRD talkie/M talky/RST Talladega/M Tallahassee/M Tallahatchie/M Tallahoosa/M tallboy/MS Tallchief/M Talley/M Talleyrand/M Tallia/M Tallie/M Tallinn/M tallish tallness/MS Tallou/M tallow/DMSG tallowy tall/TPR Tallulah/M tally/GRSDZ tallyho/DMSG Tally/M Talmudic Talmudist/MS Talmud/MS talon/SMD talus/MS Talyah/M Talya/M Ta/M tamable/M tamale/SM tamarack/SM Tamarah/M Tamara/M tamarind/MS Tamar/M Tamarra/M Tamas tambourine/MS tamed/U Tameka/M tameness/S Tamera/M Tamerlane/M tame/SYP Tamika/M Tamiko/M Tamil/MS Tami/M Tam/M Tamma/M Tammany/M Tammara/M tam/MDRSTZGB Tammie/M Tammi/M Tammy/M Tampa/M Tampax/M tampered/U tamperer/M tamper/ZGRD tampon/DMSG tamp/SGZRD Tamqrah/M Tamra/M tanager/MS Tanaka/M Tana/M Tananarive/M tanbark/SM Tancred/M tandem/SM Tandie/M Tandi/M tandoori/S Tandy/M Taney/M T'ang Tanganyika/M tangelo/SM tangency/M tangential/Y tangent/SM tangerine/MS tang/GSYDM tangibility/MIS tangible/IPS tangibleness's/I tangibleness/SM tangibly/I Tangier/M tangle's tangle/UDSG tango/MDSG Tangshan/M tangy/RST Tanhya/M Tania/M Tani/M Tanisha/M Tanitansy/M tankard/MS tanker/M tankful/MS tank/GZSRDM Tan/M tan/MS tanned/U Tannenbaum/M Tanner/M tanner/SM tannery/MS tannest Tanney/M Tannhäuser/M Tannie/M tanning/SM tannin/SM Tann/RM Tanny/M Tansy/M tansy/SM tantalization/SM tantalized/U tantalize/GZSRD tantalizingly/S tantalizingness/S tantalizing/YP tantalum/MS Tantalus/M tantamount tantra/S tantrum/SM Tanya/M Tanzania/M Tanzanian/S taoism Taoism/MS Taoist/MS taoist/S Tao/M tao/S Tapdance/M taped/U tapeline/S taperer/M taper/GRD tape/SM tapestry/GMSD tapeworm/MS tapioca/MS tapir/MS tap/MSDRJZG tapped/U tapper/MS tappet/MS tapping/M taproom/MS taproot/SM taps/M Tarah/M Tara/M tarantella/MS tarantula/MS Tarawa/M Tarazed/M Tarbell/M tardily tardiness/S tardy/TPRS tare/MS target/GSMD tar/GSMD tariff/DMSG Tarim/M Tarkington/M tarmacked tarmacking tarmac/S tarnished/U tarnish/GDS tarn/MS taro/MS tarot/MS tarpapered tarpaulin/MS tarp/MS tarpon/MS tarragon/SM Tarrah/M Tarra/M Tarrance/M tarred/M tarring/M tarry/TGRSD Tarrytown/M tarsal/S tarsi tarsus/M tartan/MS tartaric Tartar's tartar/SM Tartary/M tartness/MS tart/PMYRDGTS Tartuffe/M Taryn/M Tarzan/M Tasha/M Tashkent/M Tasia/M task/GSDM taskmaster/SM taskmistress/MS Tasmania/M Tasmanian/S tassellings tassel/MDGS Tass/M tasted/EU tastefulness/SME tasteful/PEY taste/GZMJSRD tastelessness/SM tasteless/YP taster/M taste's/E tastes/E tastily tastiness/MS tasting/E tasty/RTP tatami/MS Tatar/SM Tate/M tater/M Tatiana/M Tatiania/M tat/SRZ tatted tatterdemalion/SM tattered/M tatter/GDS tatting/SM tattler/M tattle/RSDZG tattletale/SM tattooer/M tattooist/MS tattoo/ZRDMGS tatty/R Tatum/M taught/AU taunter/M taunting/Y taunt/ZGRDS taupe/SM Taurus/SM tau/SM tauten/GD tautness/S tautological/Y tautologous tautology/SM taut/PGTXYRDNS taverner/M tavern/RMS tawdrily tawdriness/SM tawdry/SRTP Tawney/M Tawnya/M tawny/RSMPT Tawsha/M taxable/S taxably taxation/MS taxed/U taxicab/MS taxidermist/SM taxidermy/MS taxi/MDGS taximeter/SM taxing/Y taxiway/MS taxonomic taxonomically taxonomist/SM taxonomy/SM taxpayer/MS taxpaying/M tax/ZGJMDRSB Taylor/SM Tb TB TBA Tbilisi/M tbs tbsp Tchaikovsky/M Tc/M TCP TD TDD Te teabag/S teacake/MS teacart/M teachable/P teach/AGS teacher/MS teaching/SM teacloth teacupful/MS teacup/MS Teador/M teahouse/SM teakettle/SM teak/SM teakwood/M tealeaves teal/MS tea/MDGS teammate/MS team/MRDGS teamster/MS teamwork/SM teapot/MS tearaway teardrop/MS tearer/M tearfulness/M tearful/YP teargas/S teargassed teargassing tearjerker/S tearoom/MS tear/RDMSG teary/RT Teasdale/M tease/KS teasel/DGSM teaser/M teashop/SM teasing/Y teaspoonful/MS teaspoon/MS teas/SRDGZ teatime/MS teat/MDS tech/D technetium/SM technicality/MS technicalness/M technical/YSP technician/MS Technicolor/MS Technion/M technique/SM technocracy/MS technocratic technocrat/S technological/Y technologist/MS technology/MS technophobia technophobic techs tectonically tectonic/S tectonics/M Tecumseh/M Tedda/M Teddie/M Teddi/M Tedd/M Teddy/M teddy/SM Tedie/M Tedi/M tediousness/SM tedious/YP tedium/MS Ted/M Tedman/M Tedmund/M Tedra/M tee/DRSMH teeing teem/GSD teemingness/M teeming/PY teenager/M teenage/RZ Teena/M teen/SR teenybopper/SM teeny/RT teepee's teeshirt/S teeter/GDS teethe teether/M teething/M teethmarks teeth/RSDJMG teetotaler/M teetotalism/MS teetotal/SRDGZ TEFL Teflon/MS Tegucigalpa/M Teheran's Tehran TEirtza/M tektite/SM Tektronix/M telecast/SRGZ telecommunicate/NX telecommunication/M telecommute/SRDZGJ telecoms teleconference/GMJSD Teledyne/M Telefunken/M telegenic telegrammed telegramming telegram/MS telegraphic telegraphically telegraphist/MS telegraph/MRDGZ telegraphs telegraphy/MS telekineses telekinesis/M telekinetic Telemachus/M Telemann/M telemarketer/S telemarketing/S telemeter/DMSG telemetric telemetry/MS teleological/Y teleology/M telepathic telepathically telepathy/SM telephone/SRDGMZ telephonic telephonist/SM telephony/MS telephotography/MS telephoto/S teleprinter/MS teleprocessing/S teleprompter TelePrompter/M TelePrompTer/S telescope/GSDM telescopic telescopically teletext/S telethon/MS teletype/SM Teletype/SM teletypewriter/SM televangelism/S televangelist/S televise/SDXNG television/M televisor/MS televisual telex/GSDM Telex/M tell/AGS Teller/M teller/SDMG telling/YS Tell/MR telltale/MS tellurium/SM telly/SM Telnet/M TELNET/M telnet/S telomeric tel/SY Telugu/M temblor/SM temerity/MS Tempe/M temperamental/Y temperament/SM temperance/IMS tempera/SLM temperately/I temperateness's/I temperateness/SM temperate/SDGPY temperature/MS tempered/UE temper/GRDM tempering/E temper's/E tempers/E tempest/DMSG tempestuousness/SM tempestuous/PY template/FS template's Temple/M Templeman/M temple/SDM Templeton/M Temp/M tempoes tempo/MS temporal/YS temporarily temporarinesses temporariness/FM temporary/SFP temporize/GJZRSD temporizer/M temporizings/U temporizing/YM temp/SGZTMRD temptation/MS tempted tempter/S tempt/FS tempting/YS temptress/MS tempura/SM tenabilities tenability/UM tenableness/M tenable/P tenably tenaciousness/S tenacious/YP tenacity/S tenancy/MS tenanted/U tenant/MDSG tenantry/MS tench/M tended/UE tendency/MS tendentiousness/SM tendentious/PY tendered tenderer tenderest tenderfoot/MS tender/FS tenderheartedness/MS tenderhearted/YP tendering tenderizer/M tenderize/SRDGZ tenderloin/SM tenderly tenderness/SM tending/E tendinitis/S tend/ISFRDG tendon/MS tendril/SM tends/E tenebrous tenement/MS tenet/SM Tenex/M TENEX/M tenfold/S ten/MHB Tenneco/M tenner Tennessean/S Tennessee/M Tenney/M tennis/SM Tenn/M Tennyson/M Tenochtitlan/M tenon/GSMD tenor/MS tenpin/SM tense/IPYTNVR tenseness's/I tenseness/SM tensile tensional/I tension/GMRDS tensionless tensions/E tension's/I tensity/IMS tensorial tensor/MS tenspot tens/SRDVGT tentacle/MSD tentativeness/S tentative/SPY tented/UF tenterhook/MS tenter/M tent/FSIM tenths tenth/SY tenting/F tenuity/S tenuousness/SM tenuous/YP tenure/SDM Teodoor/M Teodora/M Teodorico/M Teodor/M Teodoro/M tepee/MS tepidity/S tepidness/S tepid/YP tequila/SM Tera/M teratogenic teratology/MS terbium/SM tercel/M tercentenary/S tercentennial/S Terence/M Terencio/M Teresa/M Terese/M Tereshkova/M Teresina/M Teresita/M Teressa/M Teriann/M Teri/M Terkel/M termagant/SM termcap termer/M terminable/CPI terminableness/IMC terminal/SYM terminate/CXNV terminated/U terminates terminating termination/MC terminative/YC terminator/SM termini terminological/Y terminology/MS terminus/M termite/SM term/MYRDGS ternary/S tern/GIDS tern's terpsichorean Terpsichore/M terrace/MGSD terracing/M terracotta terrain/MS Terra/M terramycin Terrance/M Terran/M terrapin/MS terrarium/MS terrazzo/SM Terrell/M Terrel/M Terre/M Terrence/M terrestrial/YMS terribleness/SM terrible/P terribly Terrie/M terrier/M terrifically terrific/Y terrify/GDS terrifying/Y Terrijo/M Terrill/M Terri/M terrine/M territoriality/M Territorial/SM territorial/SY Territory's territory/SM terrorism/MS terroristic terrorist/MS terrorized/U terrorizer/M terrorize/RSDZG terror/MS terr/S terrycloth Terrye/M Terry/M terry/ZMRS terseness/SM terse/RTYP Tersina/M tertian Tertiary tertiary/S Terza/M TESL Tesla/M TESOL Tessa/M tessellate/XDSNG tessellation/M tesseral Tessie/M Tessi/M Tess/M Tessy/M testability/M testable/U testamentary testament/SM testate/IS testator/MS testatrices testatrix testbed/S testcard tested/AKU tester/MFCKS testes/M testicle/SM testicular testifier/M testify/GZDRS testily testimonial/SM testimony/SM testiness/S testing/S testis/M testosterone/SM test/RDBFZGSC tests/AK test's/AKF testy/RTP tetanus/MS tetchy/TR tether/DMSG tethered/U Tethys/M Tetons tetrachloride/M tetracycline/SM tetrafluoride tetragonal/Y tetrahalides tetrahedral/Y tetrahedron/SM tetrameron tetrameter/SM tetra/MS tetrasodium tetravalent Teutonic Teuton/SM Texaco/M Texan/S Texas/MS Tex/M TeX/M textbook/SM text/FSM textile/SM Textron/M textual/FY textural/Y textured/U texture/MGSD T/G Thacher/M Thackeray/M Thaddeus/M Thaddus/M Thadeus/M Thad/M Thailand/M Thaine/M Thain/M Thai/S thalami thalamus/M Thales/M Thalia/M thalidomide/MS thallium/SM thallophyte/M Thames than Thane/M thane/SM Thanh/M thanker/M thankfuller thankfullest thankfulness/SM thankful/YP thanklessness/SM thankless/PY thanksgiving/MS Thanksgiving/S thank/SRDG Thant/M Thar/M Thatcher/M thatching/M thatch/JMDRSZG Thatch/MR that'd that'll that/MS thaumaturge/M thaw/DGS Thaxter/M Thayer/M Thayne/M THC the Theadora/M Thea/M theatergoer/MS theatergoing/MS theater/SM theatricality/SM theatrical/YS theatric/S theatrics/M Thebault/M Thebes Theda/M Thedrick/M Thedric/M thee/DS theeing theft/MS Theiler/M their/MS theism/SM theistic theist/SM Thekla/M Thelma/M themas thematically thematics thematic/U theme/MS them/GD Themistocles/M themselves thence thenceforth thenceforward/S Theobald/M theocracy/SM theocratic Theocritus/M theodolite/MS Theodora/M Theodore/M Theodoric/M Theodor/M Theodosia/M Theodosian Theodosius/M theologian/SM theological/Y theologists theology/MS Theo/M theorem/MS theoretical/Y theoretician/MS theoretic/S theoretics/M theorist/SM theorization/SM theorize/ZGDRS theory/MS theosophic theosophical theosophist/MS Theosophy theosophy/SM therapeutically therapeutic/S therapeutics/M therapist/MS therapy/MS Theravada/M thereabout/S thereafter thereat thereby there'd therefor therefore therefrom therein there'll there/MS thereof thereon Theresa/M Therese/M Theresina/M Theresita/M Theressa/M thereto theretofore thereunder thereunto thereupon therewith Therine/M thermal/YS thermionic/S thermionics/M thermistor/MS therm/MS thermocouple/MS thermodynamical/Y thermodynamic/S thermodynamics/M thermoelastic thermoelectric thermoformed thermoforming thermogravimetric thermoluminescence/M thermometer/MS thermometric thermometry/M thermonuclear thermopile/M thermoplastic/S thermopower thermo/S thermosetting thermos/S Thermos/SM thermostable thermostatically thermostatic/S thermostatics/M thermostat/SM thermostatted thermostatting Theron/M thesauri thesaurus/MS these/S Theseus/M thesis/M thespian/S Thespian/S Thespis/M Thessalonian Thessaloníki/M Thessaly/M theta/MS thew/SM they they'd they'll they're they've th/GNJX Thia/M thiamine/MS Thibaud/M Thibaut/M thickener/M thickening/M thicken/RDJZG thicket/SMD thickheaded/M thickish thickness/MS thickset/S thick/TXPSRNY thief/M Thiensville/M Thieu/M thievery/MS thieve/SDJG thievishness/M thievish/P thighbone/SM thigh/DM thighs thimble/DSMG thimbleful/MS Thimbu/M Thimphu thine thingamabob/MS thingamajig/SM thing/MP thinkableness/M thinkable/U thinkably/U think/AGRS thinker/MS thinkingly/U thinking/SMYP thinned thinner/MS thinness/MS thinnest thinning thinnish thin/STPYR thiocyanate/M thiouracil/M third/DYGS thirster/M thirst/GSMDR thirstily thirstiness/S thirsty/TPR thirteen/MHS thirteenths thirtieths thirty/HMS this this'll thistledown/MS thistle/SM thither Th/M tho thole/GMSD Thomasa/M Thomasina/M Thomasine/M Thomasin/M Thoma/SM Thomism/M Thomistic Thom/M Thompson/M Thomson/M thong/SMD thoracic thorax/MS Thorazine Thoreau/M thoriate/D Thorin/M thorium/MS Thor/M Thornburg/M Thorndike/M Thornie/M thorniness/S Thorn/M thorn/SMDG Thornton/M Thorny/M thorny/PTR thoroughbred/S thoroughfare/MS thoroughgoing thoroughness/SM thorough/PTYR Thorpe/M Thorstein/M Thorsten/M Thorvald/M those Thoth/M thou/DSG though thoughtfully thoughtfulness/S thoughtful/U thoughtlessness/MS thoughtless/YP thought/MS thousandfold thousand/SHM thousandths Thrace/M Thracian/M thralldom/S thrall/GSMD thrash/DSRZGJ thrasher/M thrashing/M threadbare/P threader/M threading/A threadlike thread/MZDRGS thready/RT threatener/M threaten/GJRD threatening/Y threat/MDNSXG threefold three/MS threepence/M threepenny threescore/S threesome/SM threnody/SM thresh/DSRZG thresher/M threshold/MDGS threw thrice thriftily thriftiness/S thriftless thrift/SM thrifty/PTR thriller/M thrilling/Y thrill/ZMGDRS thriver/M thrive/RSDJG thriving/Y throatily throatiness/MS throat/MDSG throaty/PRT throbbed throbbing throb/S throeing throe/SDM thrombi thromboses thrombosis/M thrombotic thrombus/M Throneberry/M throne/CGSD throne's throng/GDSM throttle/DRSZMG throttler/M throughout throughput/SM throughway's through/Y throwaway/SM throwback/MS thrower/M thrown throwout throw/SZGR thrummed thrumming thrum/S thrush/MS thruster/M thrust/ZGSR Thruway/MS thruway/SM Thunderbird/M Thu Thucydides/M thudded thudding thud/MS thuggee/M thuggery/SM thuggish thug/MS Thule/M thulium/SM thumbnail/MS thumbscrew/SM thumb/SMDG thumbtack/GMDS thump/RDMSG thunderbolt/MS thunderclap/SM thundercloud/SM thunderer/M thunderhead/SM thundering/Y thunderous/Y thundershower/MS thunderstorm/MS thunderstruck thundery thunder/ZGJDRMS thunk Thurber/M Thurman/M Thur/MS Thursday/SM Thurstan/M Thurston/M thus/Y thwack/DRSZG thwacker/M thwarter/M thwart/GSDRY thy thyme/SM thymine/MS thymus/SM thyratron/M thyristor/MS thyroglobulin thyroidal thyroid/S thyronine thyrotoxic thyrotrophic thyrotrophin thyrotropic thyrotropin/M thyroxine/M thyself Tia/M Tianjin tiara/MS Tiberius/M Tiber/M Tibetan/S Tibet/M tibiae tibial tibia/M Tibold/M Tiburon/M ticker/M ticket/SGMD tick/GZJRDMS ticking/M tickler/M tickle/RSDZG ticklishness/MS ticklish/PY ticktacktoe/S ticktock/SMDG tic/MS Ticonderoga/M tidal/Y tidbit/MS tiddlywinks/M tide/GJDS tideland/MS tidewater/SM tideway/SM tidily/U tidiness/USM tidying/M tidy/UGDSRPT tie/AUDS tieback/MS Tiebold/M Tiebout/M tiebreaker/SM Tieck/M Tiena/M Tienanmen/M Tientsin's tier/DGM Tierney/M Tiertza/M Tiffanie/M Tiffani/M tiffany/M Tiffany/M tiff/GDMS Tiffie/M Tiffi/M Tiff/M Tiffy/M tigerish tiger/SM tightener/M tighten/JZGDR tightfisted tightness/MS tightrope/SM tight/STXPRNY tightwad/MS tigress/SM Tigris/M Tijuana/M tike's Tilda/M tilde/MS Tildie/M Tildi/M Tildy/M tile/DRSJMZG tiled/UE Tiler/M tiles/U tiling/M tillable tillage/SM till/EGSZDR tiller/GDM tiller's/E Tillich/M Tillie/M Tillman/M Tilly/M tilth/M tilt/RDSGZ Ti/M timber/DMSG timbering/M timberland/SM timberline/S timbrel/SM timbre/MS Timbuktu/M ti/MDRZ timebase time/DRSJMYZG timekeeper/MS timekeeping/SM timelessness/S timeless/PY timeliness/SMU timely/UTRP timeout/S timepiece/MS timer/M timescale/S timeserver/MS timeserving/S timeshare/SDG timespan timestamped timestamps timetable/GMSD timeworn Timex/M timezone/S timidity/SM timidness/MS timid/RYTP Timi/M timing/M Timmie/M Timmi/M Tim/MS Timmy/M Timofei/M Timon/M timorousness/MS timorous/YP Timoteo/M Timothea/M Timothee/M Timotheus/M Timothy/M timothy/MS timpani timpanist/S Timur/M Tina/M tincture/SDMG tinderbox/MS tinder/MS Tine/M tine/SM tinfoil/MS tingeing tinge/S ting/GYDM tingle/SDG tingling/Y tingly/TR Ting/M tinily tininess/MS tinker/SRDMZG Tinkertoy tinkle/SDG tinkling/M tinkly tin/MDGS tinned tinner/M tinnily tinniness/SM tinning/M tinnitus/MS tinny/RSTP tinplate/S tinsel/GMDYS Tinseltown/M tinsmith/M tinsmiths tinter/M tintinnabulation/MS Tintoretto/M tint/SGMRDB tintype/SM tinware/MS tiny/RPT Tioga/M Tiphanie/M Tiphani/M Tiphany/M tipi's tip/MS tipoff Tippecanoe/M tipped Tipperary/M tipper/MS tippet/MS tipping tippler/M tipple/ZGRSD tippy/R tipsily tipsiness/SM tipster/SM tipsy/TPR tiptoeing tiptoe/SD tiptop/S tirade/SM Tirana's Tirane tired/AYP tireder tiredest tiredness/S tirelessness/SM tireless/PY tire/MGDSJ tires/A Tiresias/M tiresomeness/S tiresome/PY tiring/AU Tirolean/S Tirol/M tiro's Tirrell/M tis Tisha/M Tish/M tissue/MGSD titanate/M Titania/M titanic titanically Titanic/M titanium/SM titan/SM Titan/SM titbit's titer/M tither/M tithe/SRDGZM tithing/M Titian/M titian/S Titicaca/M titillate/XSDVNG titillating/Y titillation/M titivate/NGDSX titivation/M titled/AU title/GMSRD titleholder/SM titling/A titmice titmouse/M tit/MRZS Tito/SM titrate/SDGN titration/M titted titter/GDS titting tittle/SDMG titular/SY Titus/M tizzy/SM TKO Tlaloc/M TLC Tlingit/M Tl/M TM Tm/M tn TN tnpk TNT toad/SM toadstool/SM toady/GSDM toadyism/M toaster/M toastmaster/MS toastmistress/S toast/SZGRDM toasty/TRS tobacconist/SM tobacco/SM tobaggon/SM Tobago/M Tobe/M Tobey/M Tobiah/M Tobias/M Tobie/M Tobi/M Tobin/M Tobit/M toboggan/MRDSZG Tobye/M Toby/M Tocantins/M toccata/M Tocqueville tocsin/MS to/D today'll today/SM Toddie/M toddler/M toddle/ZGSRD Todd/M Toddy/M toddy/SM Tod/M toecap/SM toeclip/S TOEFL toehold/MS toeing toe/MS toenail/DMGS toffee/SM tofu/S toga/SMD toge togetherness/MS together/P togged togging toggle/SDMG Togolese/M Togo/M tog/SMG Toiboid/M toilet/GMDS toiletry/MS toilette/SM toil/SGZMRD toilsomeness/M toilsome/PY Toinette/M Tojo/M tokamak Tokay/M toke/GDS tokenism/SM tokenized token/SMDG Tokugawa/M Tokyoite/MS Tokyo/M Toland/M told/AU Toledo/SM tole/MGDS tolerability/IM tolerable/I tolerably/I tolerance/SIM tolerant/IY tolerate/XVNGSD toleration/M Tolkien tollbooth/M tollbooths toll/DGS Tolley/M tollgate/MS tollhouse/M tollway/S Tolstoy/M toluene/MS Tolyatti/M tomahawk/SGMD Tomasina/M Tomasine/M Toma/SM Tomaso/M tomatoes tomato/M Tombaugh/M tomb/GSDM Tombigbee/M tomblike tombola/M tomboyish tomboy/MS tombstone/MS tomcat/SM tomcatted tomcatting Tome/M tome/SM tomfoolery/MS tomfool/M Tomi/M Tomkin/M Tomlin/M Tom/M tommed Tommie/M Tommi/M tomming tommy/M Tommy/M tomographic tomography/MS tomorrow/MS Tompkins/M Tomsk/M tom/SM tomtit/SM tonality/MS tonal/Y tonearm/S tone/ISRDZG tonelessness/M toneless/YP toner/IM tone's Tonga/M Tongan/SM tong/GRDS tongueless tongue/SDMG tonguing/M Tonia/M tonic/SM Tonie/M tonight/MS Toni/M Tonio/M tonk/MS tonnage/SM tonne/MS Tonnie/M tonsillectomy/MS tonsillitis/SM tonsil/SM ton/SKM tonsorial tonsure/SDGM Tonto/M Tonya/M Tonye/M Tony/M tony/RT toodle too/H took/A tool/AGDS toolbox/SM tooler/SM tooling/M toolkit/SM toolmaker/M toolmake/ZRG toolmaking/M tool's toolsmith Toomey/M tooter/M toot/GRDZS toothache/SM toothbrush/MSG tooth/DMG toothily toothless toothmarks toothpaste/SM toothpick/MS tooths toothsome toothy/TR tootle/SRDG tootsie Tootsie/M toots/M tootsy/MS topaz/MS topcoat/MS topdressing/S Topeka/M toper/M topflight topgallant/M topiary/S topicality/MS topical/Y topic/MS topknot/MS topless topmast/MS topmost topnotch/R topocentric topographer/SM topographic topographical/Y topography/MS topological/Y topologist/MS topology/MS topped topper/MS topping/MS topple/GSD topsail/MS topside/SRM top/SMDRG topsoil/GDMS topspin/MS Topsy/M toque/MS Torah/M Torahs torchbearer/SM torchlight/S torch/SDMG toreador/SM Tore/M tore/S Torey/M Torie/M tori/M Tori/M Torin/M torment/GSD tormenting/Y tormentor/MS torn tornadoes tornado/M toroidal/Y toroid/MS Toronto/M torpedoes torpedo/GMD torpidity/S torpid/SY torpor/MS Torquemada/M torque/MZGSRD Torrance/M Torre/MS torrence Torrence/M Torrens/M torrential torrent/MS Torrey/M Torricelli/M torridity/SM torridness/SM torrid/RYTP Torrie/M Torrin/M Torr/XM Torry/M torsional/Y torsion/IAM torsions torsi's tor/SLM torso/SM tors/S tort/ASFE tortellini/MS torte/MS torten tortilla/MS tortoiseshell/SM tortoise/SM Tortola/M tortoni/MS tort's Tortuga/M tortuousness/MS tortuous/PY torture/ZGSRD torturous torus/MS Tory/SM Tosca/M Toscanini/M Toshiba/M toss/SRDGZ tossup/MS totaler/M totalistic totalitarianism/SM totalitarian/S totality/MS totalizator/S totalizing total/ZGSRDYM totemic totem/MS toter/M tote/S toting/M tot/MDRSG Toto/M totted totterer/M tottering/Y totter/ZGRDS totting toucan/MS touchable/U touch/ASDG touchdown/SM touché touched/U toucher/M touchily touchiness/SM touching/SY touchline/M touchscreen touchstone/SM touchy/TPR toughen/DRZG toughener/M toughness/SM toughs tough/TXGRDNYP Toulouse/M toupee/SM toured/CF tourer/M tour/GZSRDM touring/F tourism/SM touristic tourist/SM touristy tourmaline/SM tournament/MS tourney/GDMS tourniquet/MS tour's/CF tours/CF tousle/GSD touter/M tout/SGRD Tova/M Tove/M towardliness/M towardly/P towards toward/YU towboat/MS tow/DRSZG towelette/S towel/GJDMS toweling/M tower/GMD towering/Y towhead/MSD towhee/SM towline/MS towner/M Townes Towney/M townhouse/S Townie/M townie/S Townley/M Town/M Townsend/M townsfolk township/MS townsman/M townsmen townspeople/M town/SRM townswoman/M townswomen Towny/M towpath/M towpaths towrope/MS Towsley/M toxemia/MS toxicity/MS toxicological toxicologist/SM toxicology/MS toxic/S toxin/MS toyer/M toymaker toy/MDRSG Toynbee/M Toyoda/M Toyota/M toyshop tr traceability/M traceableness/M traceable/P trace/ASDG traceback/MS traced/U Tracee/M traceless/Y Trace/M tracepoint/SM tracer/MS tracery/MDS trace's Tracey/M tracheae tracheal/M trachea/M tracheotomy/SM Tracie/M Traci/M tracing/SM trackage trackball/S trackbed tracked/U tracker/M trackless tracksuit/SM track/SZGMRD tractability/SI tractable/I tractably/I tract/ABS Tractarians traction/KSCEMAF tractive/KFE tractor/FKMASC tract's tracts/CEFK Tracy/M trademark/GSMD trader/M tradesman/M tradesmen tradespeople tradespersons trade/SRDGZM tradeswoman/M tradeswomen traditionalism/MS traditionalistic traditionalist/MS traditionalized traditionally traditional/U tradition/SM traduce/DRSGZ Trafalgar/M trafficked trafficker/MS trafficking/S traffic/SM tragedian/SM tragedienne/MS tragedy/MS tragically tragicomedy/SM tragicomic tragic/S trailblazer/MS trailblazing/S trailer/GDM trails/F trailside trail/SZGJRD trainable train/ASDG trained/U trainee/MS traineeships trainer/MS training/SM trainman/M trainmen trainspotter/S traipse/DSG trait/MS traitorous/Y traitor/SM Trajan/M trajectory/MS trammed trammeled/U trammel/GSD tramming tram/MS trample/DGRSZ trampler/M trampoline/GMSD tramp/RDSZG tramway/M trance/MGSD tranche/SM Tran/M tranquility/S tranquilized/U tranquilize/JGZDSR tranquilizer/M tranquilizes/A tranquilizing/YM tranquillize/GRSDZ tranquillizer/M tranquilness/M tranquil/PTRY transact/GSD transactional transaction/MS transactor/SM transalpine transaminase transatlantic Transcaucasia/M transceiver/SM transcendence/MS transcendentalism/SM transcendentalist/SM transcendental/YS transcendent/Y transcend/SDG transconductance transcontinental transcribe/DSRGZ transcriber/M transcription/SM transcript/SM transcultural transducer/SM transduction/M transect/DSG transept/SM transferability/M transferal/MS transfer/BSMD transferee/M transference/SM transferor/MS transferral/SM transferred transferrer/SM transferring transfiguration/SM transfigure/SDG transfinite/Y transfix/SDG transformational transformation/MS transform/DRZBSG transformed/U transformer/M transfuse/XSDGNB transfusion/M transgression/SM transgressor/S transgress/VGSD trans/I transience/SM transiency/S transient/YS transistorize/GDS transistor/SM Transite/M transitional/Y transition/MDGS transitivenesses transitiveness/IM transitive/PIY transitivity/MS transitoriness/M transitory/P transit/SGVMD transl translatability/M translatable/U translated/AU translate/VGNXSDB translational translation/M translator/SM transliterate/XNGSD translucence/SM translucency/MS translucent/Y transmigrate/XNGSD transmissible transmission/MSA transmissive transmit/AS transmittable transmittal/SM transmittance/MS transmitted/A transmitter/SM transmitting/A transmogrification/M transmogrify/GXDSN transmutation/SM transmute/GBSD transnational/S transoceanic transom/SM transonic transpacific transparency/MS transparentness/M transparent/YP transpiration/SM transpire/GSD transplantation/S transplant/GRDBS transpolar transponder/MS transportability transportable/U transportation/SM transport/BGZSDR transpose/BGSD transposed/U transposition/SM Transputer/M transsexualism/MS transsexual/SM transship/LS transshipment/SM transshipped transshipping transubstantiation/MS Transvaal/M transversal/YM transverse/GYDS transvestism/SM transvestite/SM transvestitism Transylvania/M trapdoor/S trapeze/DSGM trapezium/MS trapezoidal trapezoid/MS trap/MS trappable/U trapped trapper/SM trapping/S Trappist/MS trapshooting/SM trashcan/SM trashiness/SM trash/SRDMG trashy/TRP Trastevere/M trauma/MS traumatic traumatically traumatize/SDG travail/SMDG traveled/U traveler/M travelog's travelogue/S travel/SDRGZJ Traver/MS traversal/SM traverse/GBDRS traverser/M travertine/M travesty/SDGM Travis/M Travus/M trawler/M trawl/RDMSZG tray/SM treacherousness/SM treacherous/PY treachery/SM treacle/DSGM treacly treader/M treadle/GDSM treadmill/MS tread/SAGD Treadwell/M treas treason/BMS treasonous treasure/DRSZMG treasurer/M treasurership treasury/SM Treasury/SM treatable treated/U treater/S treatise/MS treatment/MS treat's treat/SAGDR treaty/MS treble/SDG Treblinka/M treeing treeless treelike tree/MDS treetop/SM trefoil/SM Trefor/M trekked trekker/MS Trekkie/M trekking trek/MS trellis/GDSM Tremaine/M Tremain/M trematode/SM Tremayne/M tremble/JDRSG trembler/M trembles/M trembly tremendousness/M tremendous/YP tremolo/MS tremor/MS tremulousness/SM tremulous/YP trenchancy/MS trenchant/Y trencherman/M trenchermen trencher/SM trench/GASD trench's trendily trendiness/S trend/SDMG trendy/PTRS Trenna/M Trent/M Trenton/M trepanned trepidation/MS Tresa/M Trescha/M trespasser/M trespass/ZRSDG Tressa/M tressed/E tresses/E tressing/E tress/MSDG trestle/MS Trevar/M Trevelyan/M Trever/M Trevino/M Trevor/M Trev/RM Trey/M trey/MS triableness/M triable/P triadic triad/MS triage/SDMG trial/ASM trialization trialled trialling triamcinolone triangle/SM triangulable triangularization/S triangular/Y triangulate/YGNXSD triangulation/M Triangulum/M Trianon/M Triassic triathlon/S triatomic tribalism/MS tribal/Y tribe/MS tribesman/M tribesmen tribeswoman tribeswomen tribulate/NX tribulation/M tribunal/MS tribune/SM tributary/MS tribute/EGSF tribute's trice/GSDM tricentennial/S triceps/SM triceratops/M trichinae trichina/M trichinoses trichinosis/M trichloroacetic trichloroethane trichotomy/M trichromatic Tricia/M trickery/MS trick/GMSRD trickily trickiness/SM trickle/DSG trickster/MS tricky/RPT tricolor/SMD tricycle/SDMG trident/SM tridiagonal tried/UA triennial/SY trier/AS trier's tries/A Trieste/M triffid/S trifle/MZGJSRD trifler/M trifluoride/M trifocals trigged trigger/GSDM triggest trigging triglyceride/MS trigonal/Y trigonometric trigonometrical trigonometry/MS trigram/S trig/S trihedral trike/GMSD trilateral/S trilby/SM trilingual trillion/SMH trillionth/M trillionths trillium/SM trill/RDMGS trilobite/MS trilogy/MS trimaran/MS Trimble/M trimer/M trimester/MS trimmed/U trimmer/MS trimmest trimming/MS trimness/S trimodal trimonthly trim/PSYR Trimurti/M Trina/M Trinidad/M trinitarian/S trinitrotoluene/SM trinity/MS Trinity/MS trinketer/M trinket/MRDSG triode/MS trio/SM trioxide/M tripartite/N tripartition/M tripe/MS triphenylarsine triphenylphosphine triphenylstibine triphosphopyridine triple/GSD triplet/SM triplex/S triplicate/SDG triplication/M triply/GDSN Trip/M tripodal tripod/MS tripoli/M Tripoli/M tripolyphosphate tripos/SM tripped Trippe/M tripper/MS tripping/Y Tripp/M trip/SMY triptych/M triptychs tripwire/MS trireme/SM Tris trisect/GSD trisection/S trisector Trisha/M Trish/M trisodium Trista/M Tristam/M Tristan/M tristate trisyllable/M tritely/F triteness/SF trite/SRPTY tritium/MS triton/M Triton/M triumphal triumphalism triumphant/Y triumph/GMD triumphs triumvirate/MS triumvir/MS triune trivalent trivet/SM trivia triviality/MS trivialization/MS trivialize/DSG trivial/Y trivium/M Trixie/M Trixi/M Trix/M Trixy/M Trobriand/M trochaic/S trochee/SM trod/AU trodden/UA trodes troff/MR troglodyte/MS troika/SM Trojan/MS troll/DMSG trolled/F trolleybus/S trolley/SGMD trolling/F trollish Trollope/M trollop/GSMD trolly's trombone/MS trombonist/SM tromp/DSG Trondheim/M trooper/M troopship/SM troop/SRDMZG trope/SM Tropez/M trophic trophy/MGDS tropical/SY tropic/MS tropism/SM tropocollagen troposphere/MS tropospheric troth/GDM troths trot/S Trotsky/M trotted trotter/SM trotting troubadour/SM troubled/U trouble/GDRSM troublemaker/MS troubler/M troubleshooter/M troubleshoot/SRDZG troubleshot troublesomeness/M troublesome/YP trough/M troughs trounce/GZDRS trouncer/M troupe/MZGSRD trouper/M trouser/DMGS trousseau/M trousseaux Troutman/M trout/SM trove/SM troweler/M trowel/SMDRGZ trow/SGD Troyes Troy/M troy/S Trstram/M truancy/MS truant/SMDG truce/SDGM Truckee/M trucker/M trucking/M truckle/GDS truckload/MS truck/SZGMRDJ truculence/SM truculent/Y Truda/M Trudeau/M Trude/M Trudey/M trudge/SRDG Trudie/M Trudi/M Trudy/M true/DRSPTG truelove/MS Trueman/M trueness/M truer/U truest/U truffle/MS truism/SM Trujillo/M Trula/M truly/U Trumaine/M Truman/M Trumann/M Trumbull/M trump/DMSG trumpery/SM trumpeter/M trumpet/MDRZGS Trump/M truncate/NGDSX truncation/M truncheon/MDSG trundle/GZDSR trundler/M trunk/GSMD trunnion/SM trusser/M trussing/M truss/SRDG trusted/EU trusteeing trustee/MDS trusteeship/SM truster/M trustful/EY trustfulness/SM trustiness/M trusting/Y trust/RDMSG trusts/E trustworthier trustworthiest trustworthiness/MS trustworthy/UP trusty/PTMSR Truth truthfulness/US truthful/UYP truths/U truth/UM TRW trying/Y try/JGDRSZ tryout/MS trypsin/M tryst/GDMS ts T's tsarevich tsarina's tsarism/M tsarist tsetse/S Tsimshian/M Tsiolkovsky/M Tsitsihar/M tsp tsunami/MS Tsunematsu/M Tswana/M TTL tty/M ttys Tuamotu/M Tuareg/M tubae tubal tuba/SM tubbed tubbing tubby/TR tubeless tubercle/MS tubercular/S tuberculin/MS tuberculoses tuberculosis/M tuberculous tuber/M tuberose/SM tuberous tube/SM tubing/M tub/JMDRSZG Tubman/M tubular/Y tubule/SM tucker/GDM Tucker/M tuck/GZSRD Tuckie/M Tuck/RM Tucky/M Tucson/M Tucuman/M Tudor/MS Tue/S Tuesday/SM tufter/M tuft/GZSMRD tufting/M tugboat/MS tugged tugging tug/S tuition/ISM Tulane/M tularemia/S tulip/SM tulle/SM Tulley/M Tull/M Tully/M Tulsa/M tum tumbledown tumbler/M tumbleweed/MS tumble/ZGRSDJ tumbrel/SM tumescence/S tumescent tumidity/MS tumid/Y tummy/SM tumor/MDS tumorous Tums/M tumult/SGMD tumultuousness/M tumultuous/PY tumulus/M tunableness/M tunable/P tuna/SM tundra/SM tun/DRJZGBS tune/CSDG tunefulness/MS tuneful/YP tuneless/Y tuner/M tune's tuneup/S tung tungstate/M tungsten/SM Tunguska/M Tungus/M tunic/MS tuning/A tuning's Tunisia/M Tunisian/S Tunis/M tunned tunneler/M tunnel/MRDSJGZ tunning tunny/SM tupelo/M Tupi/M tuple/SM tuppence/M Tupperware Tupungato/M turban/SDM turbid turbidity/SM turbinate/SD turbine/SM turbocharged turbocharger/SM turbofan/MS turbojet/MS turboprop/MS turbo/SM turbot/MS turbulence/SM turbulent/Y turd/MS tureen/MS turf/DGSM turfy/RT Turgenev/M turgidity/SM turgidness/M turgid/PY Turing/M Turin/M Turkestan/M Turkey/M turkey/SM Turkic/SM Turkish Turkmenistan/M turk/S Turk/SM turmeric/MS turmoil/SDMG turnabout/SM turnaround/MS turn/AZGRDBS turnbuckle/SM turncoat/SM turned/U turner/M Turner/M turning/MS turnip/SMDG turnkey/MS turnoff/MS turnout/MS turnover/SM turnpike/MS turnround/MS turnstile/SM turnstone/M turntable/SM turpentine/GMSD Turpin/M turpitude/SM turquoise/SM turret/SMD turtleback/MS turtledove/MS turtleneck/SDM turtle/SDMG turves's turvy Tuscaloosa/M Tuscan Tuscany/M Tuscarora/M Tuscon/M tush/SDG Tuskegee/M tusker/M tusk/GZRDMS tussle/GSD tussock/MS tussocky Tussuad/M Tutankhamen/M tutelage/MS tutelary/S Tut/M tutored/U tutorial/MS tutor/MDGS tutorship/S tut/S Tutsi tutted tutting tutti/S Tuttle/M tutu/SM Tuvalu tuxedo/SDM tux/S TVA TV/M TVs twaddle/GZMRSD twaddler/M Twain/M twain/S TWA/M twang/MDSG twangy/TR twas tweak/SGRD tweediness/M Tweedledee/M Tweedledum/M Tweed/M twee/DP tweed/SM tweedy/PTR tween tweeter/M tweet/ZSGRD tweezer/M tweeze/ZGRD twelfth twelfths twelvemonth/M twelvemonths twelve/MS twentieths twenty/MSH twerp/MS twice/R twiddle/GRSD twiddler/M twiddly/RT twigged twigging twiggy/RT twig/SM Twila/M twilight/MS twilit twill/SGD twiner/M twine/SM twinge/SDMG Twinkie twinkler/M twinkle/RSDG twinkling/M twinkly twinned twinning twin/RDMGZS twirler/M twirling/Y twirl/SZGRD twirly/TR twisted/U twister/M twists/U twist/SZGRD twisty twitch/GRSD twitchy/TR twit/S twitted twitterer/M twitter/SGRD twittery twitting twixt twofer/MS twofold/S two/MS twopence/SM twopenny/S twosome/MS twp Twp TWX Twyla/M TX t/XTJBG Tybalt/M Tybie/M Tybi/M tycoon/MS tyeing Tye/M tying/UA tyke/SM Tylenol/M Tyler/M Ty/M Tymon/M Tymothy/M tympani tympanist/SM tympanum/SM Tynan/M Tyndale/M Tyndall/M Tyne/M typeahead typecast/SG typed/AU typedef/S typeface/MS typeless type/MGDRSJ types/A typescript/SM typeset/S typesetter/MS typesetting/SM typewriter/M typewrite/SRJZG typewriting/M typewritten typewrote typhoid/SM Typhon/M typhoon/SM typhus/SM typicality/MS typically typicalness/M typical/U typification/M typify/SDNXG typing/A typist/MS typographer/SM typographic typographical/Y typography/MS typological/Y typology/MS typo/MS tyrannic tyrannicalness/M tyrannical/PY tyrannicide/M tyrannizer/M tyrannize/ZGJRSD tyrannizing/YM tyrannosaur/MS tyrannosaurus/S tyrannous tyranny/MS tyrant/MS Tyree/M tyreo Tyrolean/S Tyrol's Tyrone/M tyrosine/M tyro/SM Tyrus/M Tyson/M tzarina's tzar's Tzeltal/M u U UAR UART UAW Ubangi/M ubiquitous/YP ubiquity/S Ucayali/M Uccello/M UCLA/M Udale/M Udall/M udder/SM Udell/M Ufa/M ufologist/S ufology/MS UFO/S Uganda/M Ugandan/S ugh ughs uglification ugliness/MS uglis ugly/PTGSRD Ugo/M uh UHF Uighur Ujungpandang/M UK ukase/SM Ukraine/M Ukrainian/S ukulele/SM UL Ula/M Ulberto/M ulcerate/NGVXDS ulceration/M ulcer/MDGS ulcerous Ulick/M Ulises/M Ulla/M Ullman/M ulnae ulna/M ulnar Ulrica/M Ulrich/M Ulrick/M Ulric/M Ulrika/M Ulrikaumeko/M Ulrike/M Ulster/M ulster/MS ult ulterior/Y ultimas ultimate/DSYPG ultimateness/M ultimatum/MS ultimo ultracentrifugally ultracentrifugation ultracentrifuge/M ultraconservative/S ultrafast ultrahigh ultralight/S ultramarine/SM ultramodern ultramontane ultra/S ultrashort ultrasonically ultrasonic/S ultrasonics/M ultrasound/SM ultrastructure/M Ultrasuede ultraviolet/SM Ultrix/M ULTRIX/M ululate/DSXGN ululation/M Ulyanovsk/M Ulysses/M um umbel/MS umber/GMDS Umberto/M umbilical/S umbilici umbilicus/M umbrage/MGSD umbrageous umbra/MS umbrella/GDMS Umbriel/M Umeko/M umiak/MS umlaut/GMDS umpire/MGSD ump/MDSG umpteen/H UN unabated/Y unabridged/S unacceptability unacceptable unaccepted unaccommodating unaccountability unaccustomed/Y unadapted unadulterated/Y unadventurous unalienability unalterableness/M unalterable/P unalterably Una/M unambiguity unambiguous unambitious unamused unanimity/SM unanimous/Y unanticipated/Y unapologetic unapologizing/M unappeasable unappeasably unappreciative unary unassailableness/M unassailable/P unassertive unassumingness/M unassuming/PY unauthorized/PY unavailing/PY unaware/SPY unbalanced/P unbar unbarring unbecoming/P unbeknown unbelieving/Y unbiased/P unbid unbind/G unblessed unblinking/Y unbodied unbolt/G unbreakability unbred unbroken unbuckle unbudging/Y unburnt uncap uncapping uncatalogued uncauterized/MS unceasing/Y uncelebrated uncertain/P unchallengeable unchangingness/M unchanging/PY uncharacteristic uncharismatic unchastity unchristian uncial/S uncivilized/Y unclassified uncle/MSD unclouded/Y uncodable uncollected uncoloredness/M uncolored/PY uncombable uncommunicative uncompetitive uncomplicated uncomprehending/Y uncompromisable unconcerned/P unconcern/M unconfirmed unconfused unconscionableness/M unconscionable/P unconscionably unconstitutional unconsumed uncontentious uncontrollability unconvertible uncool uncooperative uncork/G uncouple/G uncouthness/M uncouth/YP uncreate/V uncritical uncross/GB uncrowded unction/IM unctions unctuousness/MS unctuous/PY uncustomary uncut undated/I undaunted/Y undeceive undecided/S undedicated undefinability undefinedness/M undefined/P undelete undeliverability undeniableness/M undeniable/P undeniably undependable underachiever/M underachieve/SRDGZ underact/GDS underadjusting underage/S underarm/DGS underbedding underbelly/MS underbidding underbid/S underbracing underbrush/MSDG undercarriage/MS undercharge/GSD underclassman underclassmen underclass/S underclothes underclothing/MS undercoating/M undercoat/JMDGS underconsumption/M undercooked undercount/S undercover undercurrent/SM undercut/S undercutting underdeveloped underdevelopment/MS underdog/MS underdone undereducated underemphasis underemployed underemployment/SM underenumerated underenumeration underestimate/NGXSD underexploited underexpose/SDG underexposure/SM underfed underfeed/SG underfloor underflow/GDMS underfoot underfund/DG underfur/MS undergarment/SM undergirding undergoes undergo/G undergone undergrad/MS undergraduate/MS underground/RMS undergrowth/M undergrowths underhand/D underhandedness/MS underhanded/YP underheat underinvestment underlaid underlain/S underlay/GS underlie underline/GSDJ underling/MS underlip/SM underloaded underly/GS undermanned undermentioned undermine/SDG undermost underneath underneaths undernourished undernourishment/SM underpaid underpants underpart/MS underpass/SM underpay/GSL underpayment/SM underperformed underpinned underpinning/MS underpin/S underplay/SGD underpopulated underpopulation/M underpowered underpricing underprivileged underproduction/MS underrate/GSD underregistration/M underreported underreporting underrepresentation/M underrepresented underscore/SDG undersealed undersea/S undersecretary/SM undersell/SG undersexed undershirt/SM undershoot/SG undershorts undershot underside/SM undersigned/M undersign/SGD undersized undersizes undersizing underskirt/MS undersold underspecification underspecified underspend/G understaffed understandability/M understandably understanding/YM understand/RGSJB understate/GSDL understatement/MS understocked understood understrength understructure/SM understudy/GMSD undertaken undertaker/M undertake/SRGZJ undertaking/M underthings undertone/SM undertook undertow/MS underused underusing underutilization/M underutilized undervaluation/S undervalue/SDG underwater/S underway underwear/M underweight/S underwent underwhelm/DGS underwood/M Underwood/M underworld/MS underwrite/GZSR underwriter/M underwritten underwrote under/Y undeserving undesigned undeviating/Y undialyzed/SM undiplomatic undiscerning undiscriminating undo/GJ undoubted/Y undramatic undramatized/SM undress/G undrinkability undrinkable undroppable undue undulant undulate/XDSNG undulation/M unearthliness/S unearthly/P unearth/YG unease uneconomic uneducated unemployed/S unencroachable unending/Y unendurable/P unenergized/MS unenforced unenterprising UNESCO unethical uneulogized/SM unexacting unexceptionably unexcited unexpectedness/MS unfading/Y unfailingness/M unfailing/P unfamiliar unfashionable unfathomably unfavored unfeeling unfeigned/Y unfelt unfeminine unfertile unfetchable unflagging unflappability/S unflappable unflappably unflinching/Y unfold/LG unfoldment/M unforced unforgeable unfossilized/MS unfraternizing/SM unfrozen unfulfillable unfunny unfussy ungainliness/MS ungainly/PRT Ungava/M ungenerous ungentle unglamorous ungrammaticality ungrudging unguent/MS ungulate/MS unharmonious unharness/G unhistorical unholy/TP unhook/DG unhydrolyzed/SM unhygienic Unibus/M unicameral UNICEF unicellular Unicode/M unicorn/SM unicycle/MGSD unicyclist/MS unideal unidimensional unidiomatic unidirectionality unidirectional/Y unidolized/MS unifiable unification/MA unifier/MS unifilar uniformity/MS uniformness/M uniform/TGSRDYMP unify/AXDSNG unilateralism/M unilateralist unilateral/Y unimodal unimpeachably unimportance unimportant unimpressive unindustrialized/MS uninhibited/YP uninominal uninsured unintellectual unintended uninteresting uninterruptedness/M uninterrupted/YP unintuitive uninviting union/AEMS unionism/SM unionist/SM Unionist/SM unionize Union/MS UniPlus/M unipolar uniprocessor/SM uniqueness/S unique/TYSRP Uniroyal/M unisex/S UniSoft/M unison/MS Unisys/M unitarianism/M Unitarianism/SM unitarian/MS Unitarian/MS unitary unite/AEDSG united/Y uniter/M unitize/GDS unit/VGRD unity/SEM univ Univac/M univalent/S univalve/MS univariate universalism/M universalistic universality/SM universalize/DSRZG universalizer/M universal/YSP universe/MS university/MS Unix/M UNIX/M unjam unkempt unkind/TP unkink unknightly unknowable/S unknowing unlabored unlace/G unlearn/G unlikeable unlikeliness/S unlimber/G unlimited unlit unliterary unloose/G unlucky/TP unmagnetized/MS unmanageably unmannered/Y unmask/G unmeaning unmeasured unmeetable unmelodious unmemorable unmemorialized/MS unmentionable/S unmerciful unmeritorious unmethodical unmineralized/MS unmissable unmistakably unmitigated/YP unmnemonic unmobilized/SM unmoral unmount/B unmovable unmoving unnaturalness/M unnavigable unnerving/Y unobliging unoffensive unofficial unorganized/YP unorthodox unpack/G unpaintable unpalatability unpalatable unpartizan unpatronizing unpeople unperceptive unperson unperturbed/Y unphysical unpick/G unpicturesque unpinning unpleasing unploughed unpolarized/SM unpopular unpractical unprecedented/Y unpredictable/S unpreemphasized unpremeditated unpretentiousness/M unprincipled/P unproblematic unproductive unpropitious unprovable unproven unprovocative unpunctual unquestionable unraisable unravellings unreadability unread/B unreal unrealizable unreasoning/Y unreceptive unrecordable unreflective unrelenting/Y unremitting/Y unrepeatability unrepeated unrepentant unreported unrepresentative unreproducible unrest/G unrestrained/P unrewarding unriddle unripe/P unromantic unruliness/SM unruly/PTR unsaleable unsanitary unsavored/YP unsavoriness/M unseal/GB unsearchable unseasonal unseeing/Y unseen/S unselfconsciousness/M unselfconscious/P unselfishness/M unsellable unsentimental unset unsettledness/M unsettled/P unsettling/Y unshapely unshaven unshorn unsighted unsightliness/S unskilful unsociability unsociable/P unsocial unsound/PT unspeakably unspecific unspectacular unspoilt unspoke unsporting unstable/P unstigmatized/SM unstilted unstinting/Y unstopping unstrapping unstudied unstuffy unsubdued unsubstantial unsubtle unsuitable unsuspecting/Y unswerving/Y unsymmetrical unsympathetic unsystematic unsystematized/Y untactful untalented untaxing unteach/B untellable untenable unthinking until/G untiring/Y unto untouchable/MS untowardness/M untoward/P untraceable untrue untruthfulness/M untwist/G Unukalhai/M unusualness/M unutterable unutterably unvocalized/MS unvulcanized/SM unwaivering unwarrantable unwarrantably unwashed/PS unwearable unwearied/Y unwed unwedge unwelcome unwell/M unwieldiness/MS unwieldy/TPR unwind/B unwomanly unworkable/S unworried unwrap unwrapping unyielding/Y unyoke unzip up Upanishads uparrow upbeat/SM upbraid/GDRS upbringing/M upbring/JG UPC upchuck/SDG upcome/G upcountry/S updatability updater/M update/RSDG Updike/M updraft/SM upend/SDG upfield upfront upgradeable upgrade/DSJG upheaval/MS upheld uphill/S upholder/M uphold/RSGZ upholster/ADGS upholsterer/SM upholstery/MS UPI upkeep/SM uplander/M upland/MRS uplifter/M uplift/SJDRG upload/GSD upmarket upon upped uppercase/GSD upperclassman/M upperclassmen uppercut/S uppercutting uppermost upper/S upping uppish uppity upraise/GDS uprated uprating uprear/DSG upright/DYGSP uprightness/S uprise/RGJ uprising/M upriver/S uproariousness/M uproarious/PY uproar/MS uproot/DRGS uprooter/M ups UPS upscale/GDS upset/S upsetting/MS upshot/SM upside/MS upsilon/MS upslope upstage/DSRG upstairs upstandingness/M upstanding/P upstart/MDGS upstate/SR upstream/DSG upstroke/MS upsurge/DSG upswing/GMS upswung uptake/SM upthrust/GMS uptight uptime Upton/M uptown/RS uptrend/M upturn/GDS upwardness/M upward/SYP upwelling upwind/S uracil/MS Ural/MS Urania/M uranium/MS Uranus/M uranyl/M Urbain/M Urbana/M urbane/Y urbanism/M urbanite/SM urbanity/SM urbanization/MS urbanize/DSG Urban/M urbanologist/S urbanology/S Urbano/M urban/RT Urbanus/M urchin/SM Urdu/M urea/SM uremia/MS uremic ureter/MS urethane/MS urethrae urethral urethra/M urethritis/M Urey/M urge/GDRSJ urgency/SM urgent/Y urger/M Uriah/M uric Uriel/M urinal/MS urinalyses urinalysis/M urinary/MS urinate/XDSNG urination/M urine/MS Uri/SM URL Ur/M urning/M urn/MDGS urogenital urological urologist/S urology/MS Urquhart/M Ursala/M Ursa/M ursine Ursola/M Urson/M Ursula/M Ursulina/M Ursuline/M urticaria/MS Uruguayan/S Uruguay/M Urumqi US USA usability/S usable/U usably/U USAF usage/SM USART USCG USC/M USDA us/DRSBZG used/U use/ESDAG usefulness/SM useful/YP uselessness/MS useless/PY Usenet/M Usenix/M user/M USG/M usherette/SM usher/SGMD USIA USMC USN USO USP USPS USS USSR Ustinov/M usu usuals usual/UPY usurer/SM usuriousness/M usurious/PY usurpation/MS usurper/M usurp/RDZSG usury/SM UT Utahan/SM Utah/M Uta/M Ute/M utensil/SM uteri uterine uterus/M Utica/M utile/I utilitarianism/MS utilitarian/S utility/MS utilization/MS utilization's/A utilize/GZDRS utilizer/M utilizes/A utmost/S Utopia/MS utopianism/M utopian's Utopian/S utopia/S Utrecht/M Utrillo/M utterance/MS uttered/U utterer/M uttermost/S utter/TRDYGS uucp/M UV uvula/MS uvular/S uxorious Uzbekistan Uzbek/M Uzi/M V VA vacancy/MS vacantness/M vacant/PY vacate/NGXSD vacationist/SM vacationland vacation/MRDZG vaccinate/NGSDX vaccination/M vaccine/SM vaccinial vaccinia/M Vachel/M vacillate/XNGSD vacillating/Y vacillation/M vacillator/SM Vaclav/M vacua's vacuity/MS vacuo vacuolated/U vacuolate/SDGN vacuole/SM vacuolization/SM vacuousness/MS vacuous/PY vacuum/GSMD Vader/M Vaduz/M vagabondage/MS vagabond/DMSG vagarious vagary/MS vaginae vaginal/Y vagina/M vagrancy/MS vagrant/SMY vagueing vagueness/MS vague/TYSRDP Vail/M vaingloriousness/M vainglorious/YP vainglory/MS vain/TYRP val valance/SDMG Valaree/M Valaria/M Valarie/M Valdemar/M Valdez/M Valeda/M valediction/MS valedictorian/MS valedictory/MS Vale/M valence/SM Valencia/MS valency/MS Valene/M Valenka/M Valentia/M Valentijn/M Valentina/M Valentine/M valentine/SM Valentin/M Valentino/M Valenzuela/M Valera/M Valeria/M Valerian/M Valerie/M Valerye/M Valéry/M vale/SM valet/GDMS valetudinarianism/MS valetudinarian/MS Valhalla/M valiance/S valiantness/M valiant/SPY Valida/M validated/AU validate/INGSDX validates/A validation/AMI validity/IMS validnesses validness/MI valid/PIY Valina/M valise/MS Valium/S Valkyrie/SM Vallejo Valle/M Valletta/M valley/SM Vallie/M Valli/M Vally/M Valma/M Val/MY Valois/M valor/MS valorous/Y Valparaiso/M Valry/M valuable/IP valuableness/IM valuables valuably/I valuate/NGXSD valuation/CSAM valuator/SM value/CGASD valued/U valuelessness/M valueless/P valuer/SM value's values/E valve/GMSD valveless valvular Va/M vamoose/GSD vamp/ADSG vamper vampire/MGSD vamp's vanadium/MS Vance/M Vancouver/M vandalism/MS vandalize/GSD vandal/MS Vandal/MS Vanda/M Vandenberg/M Vanderbilt/M Vanderburgh/M Vanderpoel/M Vandyke/SM vane/MS Vanessa/M Vang/M vanguard/MS Vania/M vanilla/MS vanisher/M vanish/GRSDJ vanishing/Y vanity/SM Van/M Vanna/M vanned Vannie/M Vanni/M vanning Vanny/M vanquisher/M vanquish/RSDGZ van/SMD vantage/MS Vanuatu Vanya/M Vanzetti/M vapidity/MS vapidness/SM vapid/PY vaporer/M vaporing/MY vaporisation vaporise/DSG vaporization/AMS vaporize/DRSZG vaporizer/M vapor/MRDJGZS vaporous vapory vaquero/SM VAR Varanasi/M Varese/M Vargas/M variability/IMS variableness/IM variable/PMS variables/I variably/I variance/I variances variance's Varian/M variant/ISY variate/MGNSDX variational variation/M varicolored/MS varicose/S variedly varied/U variegate/NGXSD variegation/M varier/M varietal/S variety/MS various/PY varistor/M Varityping/M varlet/MS varmint/SM varnished/U varnisher/M varnish/ZGMDRS var/S varsity/MS varying/UY vary/SRDJG vascular vasectomy/SM Vaseline/DSMG vase/SM Vasili/MS Vasily/M vasomotor Vasquez/M vassalage/MS vassal/GSMD Vassar/M Vassili/M Vassily/M vastness/MS vast/PTSYR v/ASV VAT Vatican/M vat/SM vatted vatting vaudeville/SM vaudevillian/SM Vaudois Vaughan/M Vaughn/M vaulter/M vaulting/M vault/ZSRDMGJ vaunter/M vaunt/GRDS VAXes Vax/M VAX/M Vazquez/M vb VCR VD VDT VDU vealed/A vealer/MA veal/MRDGS veals/A Veblen/M vectorial vectorization vectorized vectorizing vector's/F vector/SGDM Veda/MS Vedanta/M veejay/S veep/S veer/DSG veering/Y vegan/SM Vega/SM Vegemite/M veges vegetable/MS vegetarianism/MS vegetarian/SM vegetate/DSNGVX vegetation/M vegetative/PY vegged veggie/S vegging veg/M vehemence/MS vehemency/S vehement/Y vehicle/SM vehicular veiling/MU veil's veil/UGSD vein/GSRDM veining/M vela/M Vela/M velarize/SDG velar/S Velásquez/M Velázquez Velcro/SM veld/SM veldt's Velez/M Vella/M vellum/MS Velma/M velocipede/SM velocity/SM velor/S velour's velum/M Velveeta/M velveteen/MS velvet/GSMD Velvet/M velvety/RT venality/MS venal/Y venation/SM vend/DSG vender's/K vendetta/MS vendible/S vendor/MS veneerer/M veneer/GSRDM veneering/M venerability/S venerable/P venerate/XNGSD veneration/M venereal venetian Venetian/SM Venezuela/M Venezuelan/S vengeance/MS vengeful/APY vengefulness/AM venialness/M venial/YP Venice/M venireman/M veniremen venison/SM Venita/M Venn/M venomousness/M venomous/YP venom/SGDM venous/Y venter/M ventilated/U ventilate/XSDVGN ventilation/M ventilator/MS vent/ISGFD ventral/YS ventricle/MS ventricular ventriloquies ventriloquism/MS ventriloquist/MS ventriloquy vent's/F Ventura/M venture/RSDJZG venturesomeness/SM venturesome/YP venturi/S venturousness/MS venturous/YP venue/MAS Venusian/S Venus/S veraciousness/M veracious/YP veracities veracity/IM Veracruz/M Veradis Vera/M verandahed veranda/SDM verbalization/MS verbalized/U verbalizer/M verbalize/ZGRSD verballed verballing verbal/SY verbatim verbena/MS verbiage/SM verb/KSM verbose/YP verbosity/SM verboten verdant/Y Verde/M Verderer/M verdict/SM verdigris/GSDM Verdi/M verdure/SDM Vere/M Verena/M Verene/M verge/FGSD Verge/M verger/SM verge's Vergil's veridical/Y Veriee/M verifiability/M verifiableness/M verifiable/U verification/S verified/U verifier/MS verify/GASD Verile/M verily Verina/M Verine/M verisimilitude/SM veritableness/M veritable/P veritably verity/MS Verlag/M Verlaine/M Verla/M Vermeer/M vermicelli/MS vermiculite/MS vermiform vermilion/MS vermin/M verminous Vermonter/M Vermont/ZRM vermouth/M vermouths vernacular/YS vernal/Y Verna/M Verne/M Vernen/M Verney/M Vernice/M vernier/SM Vern/NM Vernon/M Vernor/M Verona/M Veronese/M Veronica/M veronica/SM Veronika/M Veronike/M Veronique/M verrucae verruca/MS versa Versailles/M Versatec/M versatileness/M versatile/YP versatility/SM versed/UI verse's verses/I verse/XSRDAGNF versicle/M versification/M versifier/M versify/GDRSZXN versing/I version/MFISA verso/SM versus vertebrae vertebral/Y vertebra/M vertebrate/IMS vertebration/M vertex/SM vertical/YPS vertices's vertiginous vertigoes vertigo/M verve/SM very/RT Vesalius/M vesicle/SM vesicular/Y vesiculate/GSD Vespasian/M vesper/SM Vespucci/M vessel/MS vestal/YS Vesta/M vest/DIGSL vestibular vestibule/SDM vestige/SM vestigial/Y vesting/SM vestment/ISM vestryman/M vestrymen vestry/MS vest's vesture/SDMG Vesuvius/M vetch/SM veteran/SM veterinarian/MS veterinary/S veter/M veto/DMG vetoes vet/SMR vetted vetting/A Vevay/M vexation/SM vexatiousness/M vexatious/PY vexed/Y vex/GFSD VF VFW VG VGA vhf VHF VHS VI via viability/SM viable/I viably viaduct/MS Viagra/M vial/MDGS viand/SM vibe/S vibraharp/MS vibrancy/MS vibrant/YS vibraphone/MS vibraphonist/SM vibrate/XNGSD vibrational/Y vibration/M vibrato/MS vibrator/SM vibratory vibrio/M vibrionic viburnum/SM vicarage/SM vicariousness/MS vicarious/YP vicar/SM vice/CMS viced vicegerent/MS vicennial Vicente/M viceregal viceroy/SM Vichy/M vichyssoise/MS vicing vicinity/MS viciousness/S vicious/YP vicissitude/MS Vickers/M Vickie/M Vicki/M Vicksburg/M Vicky/M Vick/ZM Vic/M victimization/SM victimized/U victimizer/M victimize/SRDZG victim/SM Victoir/M Victoria/M Victorianism/S Victorian/S victoriousness/M victorious/YP Victor/M victor/SM victory/MS Victrola/SM victualer/M victual/ZGSDR vicuña/S Vidal/M Vida/M videlicet videocassette/S videoconferencing videodisc/S videodisk/SM video/GSMD videophone/SM videotape/SDGM Vidovic/M Vidovik/M Vienna/M Viennese/M Vientiane/M vier/M vie/S Vietcong/M Viet/M Vietminh/M Vietnamese/M Vietnam/M viewed/A viewer/AS viewer's viewfinder/MS viewgraph/SM viewing/M viewless/Y view/MBGZJSRD viewpoint/SM views/A vigesimal vigilance/MS vigilante/SM vigilantism/MS vigilantist vigilant/Y vigil/SM vignette/MGDRS vignetter/M vignetting/M vignettist/MS vigor/MS vigorousness/M vigorous/YP vii viii Vijayawada/M Viki/M Viking/MS viking/S Vikki/M Vikky/M Vikram/M Vila vile/AR vilely vileness/MS vilest Vilhelmina/M vilification/M vilifier/M vilify/GNXRSD villager/M village/RSMZ villainousness/M villainous/YP villain/SM villainy/MS Villa/M villa/MS Villarreal/M ville villeinage/SM villein/MS villi Villon/M villus/M Vilma/M Vilnius/M Vilyui/M Vi/M vi/MDR vim/MS vinaigrette/MS Vina/M Vince/M Vincent/MS Vincenty/M Vincenz/M vincible/I Vinci/M Vindemiatrix/M vindicate/XSDVGN vindication/M vindicator/SM vindictiveness/MS vindictive/PY vinegar/DMSG vinegary vine/MGDS vineyard/SM Vinita/M Vin/M Vinnie/M Vinni/M Vinny/M vino/MS vinous Vinson/M vintage/MRSDG vintager/M vintner/MS vinyl/SM violable/I Viola/M Violante/M viola/SM violate/VNGXSD violator/MS Viole/M violence/SM violent/Y Violet/M violet/SM Violetta/M Violette/M violinist/SM violin/MS violist/MS viol/MSB violoncellist/S violoncello/MS viper/MS viperous VIP/S viragoes virago/M viral/Y vireo/SM Virge/M Virgie/M Virgilio/M Virgil/M virginal/YS Virgina/M Virginia/M Virginian/S Virginie/M virginity/SM virgin/SM Virgo/MS virgule/MS virile virility/MS virologist/S virology/SM virtual/Y virtue/SM virtuosity/MS virtuosoes virtuoso/MS virtuousness/SM virtuous/PY virulence/SM virulent/Y virus/MS visage/MSD Visakhapatnam's Visa/M visa/SGMD Visayans viscera visceral/Y viscid/Y viscoelastic viscoelasticity viscometer/SM viscose/MS viscosity/MS viscountcy/MS viscountess/SM viscount/MS viscousness/M viscous/PY viscus/M vise/CAXNGSD viselike vise's Vishnu/M visibility/ISM visible/PI visibly/I Visigoth/M Visigoths visionariness/M visionary/PS vision/KMDGS vision's/A visitable/U visitant/SM visitation/SM visited/U visit/GASD visitor/MS vis/MDSGV visor/SMDG VISTA vista/GSDM Vistula/M visualization/AMS visualized/U visualizer/M visualizes/A visualize/SRDZG visual/SY vitae vitality/MS vitalization/AMS vitalize/ASDGC vital/SY vita/M Vita/M vitamin/SM Vite/M Vitia/M vitiate/XGNSD vitiation/M viticulture/SM viticulturist/S Vitim/M Vito/M Vitoria/M vitreous/YSP vitrifaction/S vitrification/M vitrify/XDSNG vitrine/SM vitriolic vitriol/MDSG vitro vittles Vittoria/M Vittorio/M vituperate/SDXVGN vituperation/M vituperative/Y Vitus/M vivace/S vivaciousness/MS vivacious/YP vivacity/SM viva/DGS Vivaldi Viva/M vivaria vivarium/MS vivaxes Vivekananda/M vive/Z Vivia/M Viviana/M Vivian/M Vivianna/M Vivianne/M vividness/SM vivid/PTYR Vivie/M Viviene/M Vivien/M Vivienne/M vivifier vivify/NGASD Vivi/MN viviparous vivisect/DGS vivisectional vivisectionist/SM vivisection/MS Viviyan/M Viv/M vivo Vivyan/M Vivyanne/M vixenish/Y vixen/SM viz vizier/MS vizor's VJ Vladamir/M Vladimir/M Vladivostok/M Vlad/M VLF VLSI VMS/M VOA vocable/SM vocab/S vocabularian vocabularianism vocabulary/MS vocalic/S vocalise's vocalism/M vocalist/MS vocalization/SM vocalized/U vocalizer/M vocalize/ZGDRS vocal/SY vocation/AKMISF vocational/Y vocative/KYS vociferate/NGXSD vociferation/M vociferousness/MS vociferous/YP vocoded vocoder vodka/MS voe/S Vogel/M vogue/GMSRD vogueing voguish voiceband voiced/CU voice/IMGDS voicelessness/SM voiceless/YP voicer/S voices/C voicing/C voidable void/C voided voider/M voiding voidness/M voids voilà voile/MS volar volatileness/M volatile/PS volatility/MS volatilization/MS volatilize/SDG volcanically volcanic/S volcanism/M volcanoes volcano/M vole/MS Volga/M Volgograd/M vol/GSD volitionality volitional/Y volition/MS Volkswagen/SM volleyball/MS volleyer/M volley/SMRDG Vol/M Volstead/M voltage/SM voltaic Voltaire/M Volta/M volt/AMS Volterra/M voltmeter/MS volubility/S voluble/P volubly volume/SDGM volumetric volumetrically voluminousness/MS voluminous/PY voluntarily/I voluntariness/MI voluntarism/MS voluntary/PS volunteer/DMSG voluptuary/SM voluptuousness/S voluptuous/YP volute/S Volvo/M vomit/GRDS Vonda/M Von/M Vonnegut/M Vonnie/M Vonni/M Vonny/M voodoo/GDMS voodooism/S voraciousness/MS voracious/YP voracity/MS Voronezh/M Vorster/M vortex/SM vortices's vorticity/M votary/MS vote/CSDG voter/SM vote's votive/YP voucher/GMD vouchsafe/SDG vouch/SRDGZ vowelled vowelling vowel/MS vower/M vow/SMDRG voyage/GMZJSRD voyager/M voyageur/SM voyeurism/MS voyeuristic voyeur/MS VP vs V's VT Vt/M VTOL vulcanization/SM vulcanized/U vulcanize/SDG Vulcan/M vulgarian/MS vulgarism/MS vulgarity/MS vulgarization/S vulgarize/GZSRD vulgar/TSYR Vulgate/SM Vulg/M vulnerability/SI vulnerable/IP vulnerably/I vulpine vulturelike vulture/SM vulturous vulvae vulva/M vying Vyky/M WA Waals Wabash/M WAC Wacke/M wackes wackiness/MS wacko/MS wacky/RTP Waco/M Wac/S wadded wadding/SM waddle/GRSD Wade/M wader/M wade/S wadi/SM wad/MDRZGS Wadsworth/M wafer/GSMD waffle/GMZRSD Wafs wafter/M waft/SGRD wag/DRZGS waged/U wager/GZMRD wage/SM wagged waggery/MS wagging waggishness/SM waggish/YP waggle/SDG waggly Wagnerian Wagner/M wagoner/M wagon/SGZMRD wagtail/SM Wahl/M waif/SGDM Waikiki/M wailer/M wail/SGZRD wain/GSDM Wain/M wainscot/SGJD Wainwright/M wainwright/SM waistband/MS waistcoat/GDMS waister/M waist/GSRDM waistline/MS Waite/M waiter/DMG Waiter/M wait/GSZJRD Wait/MR waitpeople waitperson/S waitress/GMSD waiver/MB waive/SRDGZ Wakefield/M wakefulness/MS wakeful/PY Wake/M wake/MGDRSJ waken/SMRDG waker/M wakeup Waksman/M Walbridge/M Walcott/M Waldemar/M Walden/M Waldensian Waldheim/M Wald/MN Waldo/M Waldon/M Waldorf/M wale/DRSMG Wales Walesa/M Walford/M Walgreen/M waling/M walkabout/M walkaway/SM walker/M Walker/M walk/GZSBJRD walkie Walkman/S walkout/SM walkover/SM walkway/MS wallaby/MS Wallace/M Wallache/M wallah/M Wallas/M wallboard/MS Wallenstein/M Waller/M wallet/SM walleye/MSD wallflower/MS Wallie/M Wallis Walliw/M Walloon/SM walloper/M walloping/M wallop/RDSJG wallower/M wallow/RDSG wallpaper/DMGS wall/SGMRD Wall/SMR Wally/M wally/S walnut/SM Walpole/M Walpurgisnacht walrus/SM Walsh/M Walter/M Walther/M Walton/M waltzer/M Walt/ZMR waltz/MRSDGZ Walworth/M Waly/M wampum/SM Wanamaker/M Wanda/M wanderer/M wander/JZGRD wanderlust/SM Wandie/M Wandis/M wand/MRSZ wane/S Waneta/M wangler/M wangle/RSDGZ Wang/M Wanids/M Wankel/M wanna wannabe/S wanned wanner wanness/S wannest wanning wan/PGSDY Wansee/M Wansley/M wanted/U wanter/M want/GRDSJ wantonness/S wanton/PGSRDY wapiti/MS warble/GZRSD warbler/M warbonnet/S ward/AGMRDS Warde/M warden/DMGS Warden/M warder/DMGS Ward/MN wardrobe/MDSG wardroom/MS wardship/M wards/I warehouseman/M warehouse/MGSRD Ware/MG ware/MS warfare/SM Warfield/M war/GSMD warhead/MS Warhol/M warhorse/SM warily/U warinesses/U wariness/MS Waring/M warless warlike warlock/SM warlord/MS warmblooded warmed/A warmer/M warmheartedness/SM warmhearted/PY warmish warmness/MS warmongering/M warmonger/JGSM warms/A warmth/M warmths warm/YRDHPGZTS warned/U warner/M Warner/M warn/GRDJS warning/YM Warnock/M warpaint warpath/M warpaths warper/M warplane/MS warp/MRDGS warranted/U warranter/M warrant/GSMDR warranty/SDGM warred/M warrener/M Warren/M warren/SZRM warring/M warrior/MS Warsaw/M wars/C warship/MS warthog/S wartime/SM wart/MDS warty/RT Warwick/M wary/URPT Wasatch/M washable/S wash/AGSD washbasin/SM washboard/SM washbowl/SM Washburn/M washcloth/M washcloths washday/M washed/U washer/GDMS washerwoman/M washerwomen washing/SM Washingtonian/S Washington/M Wash/M Washoe/M washout/SM washrag/SM washroom/MS washstand/SM washtub/MS washy/RT wasn't WASP waspishness/SM waspish/PY Wasp's wasp/SM was/S wassail/GMDS Wasserman/M Wassermann/M wastage/SM wastebasket/SM wastefulness/S wasteful/YP wasteland/MS wastepaper/MS waster/DG waste/S wastewater wast/GZSRD wasting/Y wastrel/MS Watanabe/M watchable/U watchband/SM watchdogged watchdogging watchdog/SM watched/U watcher/M watchfulness/MS watchful/PY watch/JRSDGZB watchmake/JRGZ watchmaker/M watchman/M watchmen watchpoints watchtower/MS watchword/MS waterbird/S waterborne Waterbury/M watercolor/DMGS watercolorist/SM watercourse/SM watercraft/M watercress/SM waterer/M waterfall/SM waterfowl/M waterfront/SM Watergate/M waterhole/S Waterhouse/M wateriness/SM watering/M water/JGSMRD waterless waterlily/S waterline/S waterlogged waterloo Waterloo/SM waterman/M watermark/GSDM watermelon/SM watermill/S waterproof/PGRDSJ watershed/SM waterside/MSR watersider/M Waters/M waterspout/MS watertightness/M watertight/P Watertown/M waterway/MS waterwheel/S waterworks/M watery/PRT Watkins WATS Watson/M wattage/SM Watteau/M Wattenberg/M Watterson/M wattle/SDGM Watt/MS watt/TMRS Watusi/M Wat/ZM Waugh/M Waukesha/M Waunona/M Waupaca/M Waupun/M Wausau/M Wauwatosa/M waveband/MS waveform/SM wavefront/MS waveguide/MS Waveland/M wavelength/M wavelengths wavelet/SM wavelike wavenumber waver/GZRD wavering/YU Waverley/M Waverly/M Wave/S wave/ZGDRS wavily waviness/MS wavy/SRTP waxer/M waxiness/MS wax/MNDRSZG waxwing/MS waxwork/MS waxy/PRT wayfarer/MS wayfaring/S waylaid Wayland/M Waylan/M waylayer/M waylay/GRSZ wayleave/MS Waylen/M Waylin/M Waylon/M Way/M waymarked way/MS Wayne/M Waynesboro/M wayside/MS waywardness/S wayward/YP WC we weakener/M weaken/ZGRD weakfish/SM weakish weakliness/M weakling/SM weakly/RTP weakness/MS weak/TXPYRN weal/MHS wealthiness/MS wealth/M wealths wealthy/PTR weaner/M weanling/M wean/RDGS weapon/GDMS weaponless weaponry/MS wearable/S wearer/M wearied/U wearily weariness/MS wearing/Y wearisomeness/M wearisome/YP wear/RBSJGZ wearying/Y weary/TGPRSD weasel/SGMDY weatherbeaten weathercock/SDMG weatherer/M Weatherford/M weathering/M weatherize/GSD weatherman/M weather/MDRYJGS weathermen weatherperson/S weatherproof/SGPD weatherstripped weatherstripping/S weatherstrip/S weaver/M Weaver/M weaves/A weave/SRDGZ weaving/A webbed Webber/M webbing/MS Webb/RM weber/M Weber/M Webern/M webfeet webfoot/M Web/MR website/S web/SMR Webster/MS Websterville/M we'd wedded/A Weddell/M wedder wedding/SM wedge/SDGM wedgie/RST Wedgwood/M wedlock/SM Wed/M Wednesday/SM wed/SA weeder/M weediness/M weedkiller/M weedless wee/DRST weed/SGMRDZ weedy/TRP weeing weekday/MS weekender/M weekend/SDRMG weekly/S weeknight/SM Weeks/M week/SYM weenie/M ween/SGD weeny/RSMT weeper/M weep/SGZJRD weepy/RST weevil/MS weft/SGMD Wehr/M Weibull/M Weidar/M Weider/M Weidman/M Weierstrass/M weighed/UA weigher/M weigh/RDJG weighs/A weighted/U weighter/M weightily weightiness/SM weighting/M weight/JMSRDG weightlessness/SM weightless/YP weightlifter/S weightlifting/MS weighty/TPR Weill/M Wei/M Weinberg/M Weiner/M Weinstein/M weirdie/SM weirdness/MS weirdo/SM weird/YRDPGTS weir/SDMG Weisenheimer/M Weiss/M Weissman/M Weissmuller/M Weizmann/M Welbie/M Welby/M Welcher/M Welches welcomeness/M welcome/PRSDYG welcoming/U welder/M Weldon/M weld/SBJGZRD Weldwood/M welfare/SM welkin/SM we'll Welland/M wellbeing/M Weller/M Wellesley/M Welles/M wellhead/SM Wellington/MS wellington/S Wellman/M wellness/MS well/SGPD Wells/M wellspring/SM Wellsville/M Welmers/M Welsh welsher/M Welshman/M Welshmen welsh/RSDGZ Welshwoman/M Welshwomen welter/GD welterweight/MS welt/GZSMRD wencher/M wench/GRSDM Wendall/M Wenda/M wend/DSG Wendeline/M Wendell/M Wendel/M Wendie/M Wendi/M Wendye/M Wendy/M wen/M Wenonah/M Wenona/M went Wentworth/M wept/U were we're weren't werewolf/M werewolves Werner/M Wernher/M Werther/M werwolf's Wes Wesleyan Wesley/M Wessex/M Wesson/M westbound Westbrooke/M Westbrook/M Westchester/M wester/DYG westerly/S westerner/M westernization/MS westernize/GSD westernmost Western/ZRS western/ZSR Westfield/M Westhampton/M Westinghouse/M westing/M Westleigh/M Westley/M Westminster/M Westmore/M West/MS Weston/M Westphalia/M Westport/M west/RDGSM westward/S Westwood/M wetback/MS wetland/S wetness/MS wet/SPY wettable wetter/S wettest wetting we've Weyden/M Weyerhauser/M Weylin/M Wezen/M WFF whacker/M whack/GZRDS whaleboat/MS whalebone/SM whale/GSRDZM Whalen/M whaler/M whaling/M whammed whamming/M wham/MS whammy/S wharf/SGMD Wharton/M wharves whatchamacallit/MS what'd whatever what/MS whatnot/MS what're whatsoever wheal/MS wheatgerm Wheaties/M Wheatland/M wheat/NMXS Wheaton/M Wheatstone/M wheedle/ZDRSG wheelbarrow/GSDM wheelbase/MS wheelchair/MS wheeler/M Wheeler/M wheelhouse/SM wheelie/MS wheeling/M Wheeling/M Wheelock/M wheel/RDMJSGZ wheelwright/MS whee/S wheeze/SDG wheezily wheeziness/SM wheezy/PRT Whelan/M whelk/MDS Wheller/M whelm/DGS whelp/DMGS whence/S whenever when/S whensoever whereabout/S whereas/S whereat whereby where'd wherefore/MS wherein where/MS whereof whereon where're wheresoever whereto whereupon wherever wherewith wherewithal/SM wherry/DSGM whether whet/S whetstone/MS whetted whetting whew/GSD whey/MS which whichever whiff/GSMD whiffle/DRSG whiffler/M whiffletree/SM whig/S Whig/SM while/GSD whilom whilst whimmed whimming whimper/DSG whimsey's whimsicality/MS whimsical/YP whim/SM whimsy/TMDRS whine/GZMSRD whining/Y whinny/GTDRS whiny/RT whipcord/SM whiplash/SDMG Whippany/M whipped whipper/MS whippersnapper/MS whippet/MS whipping/SM Whipple/M whippletree/SM whippoorwill/SM whipsaw/GDMS whips/M whip/SM whirligig/MS whirlpool/MS whirl/RDGS whirlwind/MS whirlybird/MS whirly/MS whirred whirring whir/SY whisker/DM whiskery whiskey/SM whisk/GZRDS whisperer/M whisper/GRDJZS whispering/YM whist/GDMS whistleable whistle/DRSZG whistler/M Whistler/M whistling/M Whitaker/M Whitby/M Whitcomb/M whitebait/M whitecap/MS whiteface/M Whitefield/M whitefish/SM Whitehall/M Whitehead/M whitehead/S Whitehorse/M Whiteleaf/M Whiteley/M White/MS whitener/M whiteness/MS whitening/M whiten/JZDRG whiteout/S white/PYS whitespace whitetail/S whitewall/SM whitewash/GRSDM whitewater Whitewater/M whitey/MS Whitfield/M whither/DGS whitier whitiest whiting/M whitish Whitley/M Whitlock/M Whit/M Whitman/M Whitney/M whit/SJGTXMRND Whitsunday/MS Whittaker/M whitter Whittier whittle/JDRSZG whittler/M whiz whizkid whizzbang/S whizzed whizzes whizzing WHO whoa/S who'd whodunit/SM whoever wholegrain wholeheartedness/MS wholehearted/PY wholemeal wholeness/S wholesale/GZMSRD wholesaler/M wholesomeness/USM wholesome/UYP whole/SP wholewheat who'll wholly whom who/M whomever whomsoever whoopee/S whooper/M whoop/SRDGZ whoosh/DSGM whop whopper/MS whopping/S who're whorehouse/SM whoreish whore/SDGM whorish whorl/SDM whose whoso whosoever who've why whys WI Wiatt/M Wichita/M wickedness/MS wicked/RYPT wicker/M wickerwork/MS wicketkeeper/SM wicket/SM wick/GZRDMS wicking/M widemouthed widener/M wideness/S widen/SGZRD wide/RSYTP widespread widgeon's widget/SM widower/M widowhood/S widow/MRDSGZ width/M widths widthwise Wieland/M wielder/M wield/GZRDS Wiemar/M wiener/SM wienie/SM Wier/M Wiesel/M wife/DSMYG wifeless wifely/RPT wigeon/MS wigged wigging/M Wiggins wiggler/M wiggle/RSDGZ wiggly/RT wight/SGDM wiglet/S wigmaker wig/MS Wigner/M wigwagged wigwagging wigwag/S wigwam/MS Wilberforce/M Wilbert/M Wilbur/M Wilburn/M Wilburt/M Wilcox/M Wilda/M wildcat/SM wildcatted wildcatter/MS wildcatting wildebeest/SM Wilde/MR Wilden/M Wilder/M wilderness/SM wilder/P wildfire/MS wildflower/S wildfowl/M wilding/M wildlife/M wildness/MS Wildon/M wild/SPGTYRD wile/DSMG Wileen/M Wilek/M Wiley/M Wilford/M Wilfred/M Wilfredo/M Wilfrid/M wilfulness's Wilhelmina/M Wilhelmine/M Wilhelm/M Wilie/M wilily wiliness/MS Wilkerson/M Wilkes/M Wilkins/M Wilkinson/M Willabella/M Willa/M Willamette/M Willamina/M Willard/M Willcox/M Willdon/M willed/U Willem/M Willemstad/M willer/M Willetta/M Willette/M Willey/M willfulness/S willful/YP Williamsburg/M William/SM Williamson/M Willied/M Willie/M willies Willi/MS willinger willingest willingness's willingness/US willing/UYP Willisson/M williwaw/MS Will/M Willoughby/M willower/M Willow/M willow/RDMSG willowy/TR willpower/MS will/SGJRD Willy/SDM Willyt/M Wilma/M Wilmar/M Wilmer/M Wilmette/M Wilmington/M Wilona/M Wilone/M Wilow/M Wilshire/M Wilsonian Wilson/M wilt/DGS Wilt/M Wilton/M wily/PTR Wimbledon/M wimp/GSMD wimpish wimple/SDGM wimpy/RT wince/SDG Winchell/M wincher/M winchester/M Winchester/MS winch/GRSDM windbag/SM windblown windbreak/MZSR windburn/GSMD winded winder/UM windfall/SM windflower/MS Windham/M Windhoek/M windily windiness/SM winding/MS windjammer/SM windlass/GMSD windless/YP windmill/GDMS window/DMGS windowless windowpane/SM Windows windowsill/SM windpipe/SM windproof windrow/GDMS wind's winds/A windscreen/MS windshield/SM windsock/MS Windsor/MS windstorm/MS windsurf/GZJSRD windswept windup/MS wind/USRZG Windward/M windward/SY Windy/M windy/TPR wineglass/SM winegrower/SM Winehead/M winemake winemaster wine/MS winery/MS Winesap/M wineskin/M Winfield/M Winfred/M Winfrey/M wingback/M wingding/MS wingeing winger/M wing/GZRDM wingless winglike wingman wingmen wingspan/SM wingspread/MS wingtip/S Winifield/M Winifred/M Wini/M winker/M wink/GZRDS winking/U Winkle/M winkle/SDGM winless Win/M winnable Winnah/M Winna/M Winnebago/M Winne/M winner/MS Winnetka/M Winnie/M Winnifred/M Winni/M winning/SY Winnipeg/M Winn/M winnow/SZGRD Winny/M Winograd/M wino/MS Winonah/M Winona/M Winooski/M Winsborough/M Winsett/M Winslow/M winsomeness/SM winsome/PRTY Winston/M winterer/M wintergreen/SM winterize/GSD Winters winter/SGRDYM wintertime/MS Winthrop/M wintriness/M wintry/TPR winy/RT win/ZGDRS wipe/DRSZG wiper/M wirehair/MS wireless/MSDG wireman/M wiremen wirer/M wire's wires/A wiretap/MS wiretapped wiretapper/SM wiretapping wire/UDA wiriness/S wiring/SM wiry/RTP Wisc Wisconsinite/SM Wisconsin/M wisdoms wisdom/UM wiseacre/MS wisecrack/GMRDS wised wisely/TR Wise/M wiseness wisenheimer/M Wisenheimer/M wises wise/URTY wishbone/MS wishfulness/M wishful/PY wish/GZSRD wishy wising Wis/M wisp/MDGS wispy/RT wist/DGS wisteria/SM wistfulness/MS wistful/PY witchcraft/SM witchdoctor/S witchery/MS witch/SDMG withal withdrawal/MS withdrawer/M withdrawnness/M withdrawn/P withdraw/RGS withdrew withe/M wither/GDJ withering/Y Witherspoon/M with/GSRDZ withheld withholder/M withhold/SJGZR within/S without/S withs withstand/SG withstood witlessness/MS witless/PY Wit/M witness/DSMG witnessed/U wit/PSM witted witter/G Wittgenstein/M witticism/MS Wittie/M wittily wittiness/SM wittings witting/UY Witt/M Witty/M witty/RTP Witwatersrand/M wive/GDS wives/M wizard/MYS wizardry/MS wizen/D wiz's wk/Y Wm/M WNW woad/MS wobble/GSRD wobbler/M wobbliness/S wobbly/PRST Wodehouse/M woebegone/P woefuller woefullest woefulness/SM woeful/PY woe/PSM woke wok/SMN Wolcott/M wold/MS Wolfe/M wolfer/M Wolff/M Wolfgang/M wolfhound/MS Wolfie/M wolfishness/M wolfish/YP Wolf/M wolfram/MS wolf/RDMGS Wolfy/M Wollongong/M Wollstonecraft/M Wolsey/M Wolverhampton/M wolverine/SM Wolverton/M wolves/M woman/GSMYD womanhood/MS womanish womanized/U womanizer/M womanize/RSDZG womanizes/U womankind/M womanlike womanliness/SM womanly/PRT wombat/MS womb/SDM womenfolk/MS women/MS wonderer/M wonderfulness/SM wonderful/PY wonder/GLRDMS wondering/Y wonderland/SM wonderment/SM wondrousness/M wondrous/YP Wong/M wonk/S wonky/RT wonned wonning won/SG won't wontedness/MU wonted/PUY wont/SGMD Woodard/M Woodberry/M woodbine/SM woodblock/S Woodbury/M woodcarver/S woodcarving/MS woodchopper/SM woodchuck/MS woodcock/MS woodcraft/MS woodcut/SM woodcutter/MS woodcutting/MS woodenness/SM wooden/TPRY woodgrain/G woodhen Woodhull/M Woodie/M woodiness/MS woodland/SRM Woodlawn/M woodlice woodlot/S woodlouse/M woodman/M Woodman/M woodmen woodpecker/SM woodpile/SM Woodrow/M woodruff/M woo/DRZGS woodshedded woodshedding woodshed/SM woodside Wood/SM woodsman/M woodsmen wood/SMNDG woodsmoke woods/R Woodstock/M woodsy/TRP Woodward/MS woodwind/S woodworker/M woodworking/M woodwork/SMRGZJ woodworm/M woodyard Woody/M woody/TPSR woofer/M woof/SRDMGZ Woolf/M woolgatherer/M woolgathering/M woolgather/RGJ woolliness/MS woolly/RSPT Woolongong/M wool/SMYNDX Woolworth/M Woonsocket/M Wooster/M Wooten/M woozily wooziness/MS woozy/RTP wop/MS! Worcestershire/M Worcester/SM wordage/SM word/AGSJD wordbook/MS Worden/M wordily wordiness/SM wording/AM wordless/Y wordplay/SM word's Wordsworth/M wordy/TPR wore workability's workability/U workableness/M workable/U workably workaday workaholic/S workaround/SM workbench/MS workbook/SM workday/SM worked/A worker/M workfare/S workforce/S work/GZJSRDMB workhorse/MS workhouse/SM working/M workingman/M workingmen workingwoman/M workingwomen workload/SM workmanlike Workman/M workman/MY workmanship/MS workmate/S workmen/M workout/SM workpiece/SM workplace/SM workroom/MS works/A worksheet/S workshop/MS workspace/S workstation/MS worktable/SM worktop/S workup/S workweek/SM worldlier worldliest worldliness/USM worldly/UP worldwide world/ZSYM wormer/M wormhole/SM worm/SGMRD Worms/M wormwood/SM wormy/RT worn/U worried/Y worrier/M worriment/MS worrisome/YP worrying/Y worrywart/SM worry/ZGSRD worsen/GSD worse/SR worshiper/M worshipfulness/M worshipful/YP worship/ZDRGS worsted/MS worst/SGD worth/DG worthily/U worthinesses/U worthiness/SM Worthington/M worthlessness/SM worthless/PY Worth/M worths worthwhile/P Worthy/M worthy/UTSRP wort/SM wost wot Wotan/M wouldn't would/S wouldst would've wound/AU wounded/U wounder wounding wounds wound's wove/A woven/AU wovens wow/SDG Wozniak/M WP wpm wrack/SGMD wraith/M wraiths Wrangell/M wrangle/GZDRS wrangler/M wraparound/S wrap/MS wrapped/U wrapper/MS wrapping/SM wraps/U wrasse/SM wrathful/YP wrath/GDM wraths wreak/SDG wreathe wreath/GMDS wreaths wreckage/MS wrecker/M wreck/GZRDS wrenching/Y wrench/MDSG wren/MS Wren/MS Wrennie/M wrester/M wrestle/JGZDRS wrestler/M wrestling/M wrest/SRDG wretchedness/SM wretched/TPYR wretch/MDS wriggle/DRSGZ wriggler/M wriggly/RT Wright/M wright/MS Wrigley/M wringer/M wring/GZRS wrinkled/U wrinkle/GMDS wrinkly/RST wristband/SM wrist/MS wristwatch/MS writable/U write/ASBRJG writer/MA writeup writhe/SDG writing/M writ/MRSBJGZ written/UA Wroclaw wrongdoer/MS wrongdoing/MS wronger/M wrongfulness/MS wrongful/PY wrongheadedness/MS wrongheaded/PY wrongness/MS wrong/PSGTYRD Wronskian/M wrote/A wroth wrought/I wrung wry/DSGY wryer wryest wryness/SM W's WSW wt W/T Wuhan/M Wu/M Wurlitzer/M wurst/SM wuss/S wussy/TRS WV WW WWI WWII WWW w/XTJGV WY Wyatan/M Wyatt/M Wycherley/M Wycliffe/M Wye/MH Wyeth/M Wylie/M Wylma/M Wyman/M Wyndham/M Wyn/M Wynne/M Wynnie/M Wynn/M Wynny/M Wyo/M Wyomingite/SM Wyoming/M WYSIWYG x X Xanadu Xanthippe/M Xanthus/M Xaviera/M Xavier/M Xebec/M Xe/M XEmacs/M Xenakis/M Xena/M Xenia/M Xenix/M xenon/SM xenophobe/MS xenophobia/SM xenophobic Xenophon/M Xenos xerographic xerography/MS xerox/GSD Xerox/MGSD Xerxes/M Xever/M Xhosa/M Xi'an Xian/S Xiaoping/M xii xiii xi/M Ximenes/M Ximenez/M Ximian/SM Xingu/M xis xiv xix XL Xmas/SM XML Xochipilli/M XOR X's XS xterm/M Xuzhou/M xv xvi xvii xviii xx XXL xylem/SM xylene/M Xylia/M Xylina/M xylophone/MS xylophonist/S Xymenes/M Y ya yacc/M Yacc/M yachting/M yachtsman yachtsmen yachtswoman/M yachtswomen yacht/ZGJSDM yack's Yagi/M yahoo/MS Yahweh/M Yakima/M yakked yakking yak/SM Yakut/M Yakutsk/M Yale/M Yalies/M y'all Yalonda/M Yalow/M Yalta/M Yalu/M Yamaha/M yammer/RDZGS Yamoussoukro yam/SM Yanaton/M Yance/M Yancey/M Yancy/M Yang/M Yangon yang/S Yangtze/M Yankee/SM yank/GDS Yank/MS Yaounde/M yapped yapping yap/S Yaqui/M yardage/SM yardarm/SM Yardley/M Yard/M yardman/M yardmaster/S yardmen yard/SMDG yardstick/SM yarmulke/SM yarn/SGDM Yaroslavl/M yarrow/MS Yasmeen/M Yasmin/M Yates yaw/DSG yawl/SGMD yawner/M yawn/GZSDR yawning/Y Yb/M yd Yeager/M yeah yeahs yearbook/SM yearling/M yearlong yearly/S yearner/M yearning/MY yearn/JSGRD year/YMS yea/S yeastiness/M yeast/SGDM yeasty/PTR Yeats/M yecch yegg/MS Yehudi/M Yehudit/M Yekaterinburg/M Yelena/M yell/GSDR yellowhammers yellowish Yellowknife/M yellowness/MS Yellowstone/M yellow/TGPSRDM yellowy yelper/M yelp/GSDR Yeltsin Yemeni/S Yemenite/SM Yemen/M Yenisei/M yenned yenning yen/SM Yentl/M yeomanry/MS yeoman/YM yeomen yep/S Yerevan/M Yerkes/M Yesenia/M yeshiva/SM yes/S yessed yessing yesterday/MS yesteryear/SM yet ye/T yeti/SM Yetta/M Yettie/M Yetty/M Yevette/M Yevtushenko/M yew/SM y/F Yggdrasil/M Yiddish/M yielded/U yielding/U yield/JGRDS yikes yin/S yipe/S yipped yippee/S yipping yip/S YMCA YMHA Ymir/M YMMV Ynes/M Ynez/M yo Yoda/M yodeler/M yodel/SZRDG Yoder/M yoga/MS yoghurt's yogi/MS yogurt/SM yoke/DSMG yoked/U yokel/SM yokes/U yoking/U Yoknapatawpha/M Yokohama/M Yoko/M Yolanda/M Yolande/M Yolane/M Yolanthe/M yolk/DMS yon yonder Yong/M Yonkers/M yore/MS Yorgo/MS Yorick/M Yorke/M Yorker/M yorker/SM Yorkshire/MS Yorktown/M York/ZRMS Yoruba/M Yosemite/M Yoshiko/M Yoshi/M Yost/M you'd you'll youngish Young/M youngster/MS Youngstown/M young/TRYP you're your/MS yourself yourselves you/SH youthfulness/SM youthful/YP youths youth/SM you've Yovonnda/M yow yowl/GSD Ypres/M Ypsilanti/M yr yrs Y's Ysabel/M YT ytterbium/MS yttrium/SM yuan/M Yuba/M Yucatan yucca/MS yuck/GSD yucky/RT Yugo/M Yugoslavia/M Yugoslavian/S Yugoslav/M Yuh/M Yuki/M yukked yukking Yukon/M yuk/S yule/MS Yule/MS yuletide/MS Yuletide/S Yul/M Yulma/M yum Yuma/M yummy/TRS Yunnan/M yuppie/SM yup/S Yurik/M Yuri/M yurt/SM Yves/M Yvette/M Yvon/M Yvonne/M Yvor/M YWCA YWHA Zabrina/M Zaccaria/M Zachariah/M Zacharia/SM Zacharie/M Zachary/M Zacherie/M Zachery/M Zach/M Zackariah/M Zack/M zagging Zagreb/M zag/S Zahara/M Zaire/M Zairian/S Zak/M Zambezi/M Zambia/M Zambian/S Zamboni Zamenhof/M Zamora/M Zandra/M Zane/M Zaneta/M zaniness/MS Zan/M Zanuck/M zany/PDSRTG Zanzibar/M Zapata/M Zaporozhye/M Zappa/M zapped zapper/S zapping zap/S Zarah/M Zara/M Zared/M Zaria/M Zarla/M Zealand/M zeal/MS zealot/MS zealotry/MS zealousness/SM zealous/YP Zea/M Zebadiah/M Zebedee/M Zeb/M zebra/MS Zebulen/M Zebulon/M zebu/SM Zechariah/M Zedekiah/M Zed/M Zedong/M zed/SM Zeffirelli/M Zeiss/M zeitgeist/S Zeke/M Zelda/M Zelig/M Zellerbach/M Zelma/M Zena/M Zenger/M Zenia/M zenith/M zeniths Zen/M Zennist/M Zeno/M Zephaniah/M zephyr/MS Zephyrus/M Zeppelin's zeppelin/SM Zerk/M zeroed/M zeroing/M zero/SDHMG zestfulness/MS zestful/YP zest/MDSG zesty/RT zeta/SM zeugma/M Zeus/M Zhdanov/M Zhengzhou Zhivago/M Zhukov/M Zia/M Zibo/M Ziegfeld/MS Ziegler/M zig zigged zigging Ziggy/M zigzagged zigzagger zigzagging zigzag/MS zilch/S zillion/MS Zilvia/M Zimbabwean/S Zimbabwe/M Zimmerman/M zincked zincking zinc/MS zing/GZDRM zingy/RT zinnia/SM Zionism/MS Zionist/MS Zion/SM zip/MS zipped/U zipper/GSDM zipping/U zippy/RT zips/U zirconium/MS zircon/SM Zita/M Zitella/M zither/SM zit/S zloty/SM Zn/M zodiacal zodiac/SM Zoe/M Zola/M Zollie/M Zolly/M Zomba/M zombie/SM zombi's zonal/Y Zonda/M Zondra/M zoned/A zone/MYDSRJG zones/A zoning/A zonked Zonnya/M zookeepers zoological/Y zoologist/SM zoology/MS zoom/DGS zoophyte/SM zoophytic zoo/SM Zorah/M Zora/M Zorana/M Zorina/M Zorine/M Zorn/M Zoroaster/M Zoroastrianism/MS Zoroastrian/S Zorro/M Zosma/M zounds/S Zr/M Zs Zsazsa/M Zsigmondy/M z/TGJ Zubenelgenubi/M Zubeneschamali/M zucchini/SM Zukor/M Zulema/M Zululand/M Zulu/MS Zuni/S Zürich/M Zuzana/M zwieback/MS Zwingli/M Zworykin/M Z/X zydeco/S zygote/SM zygotic zymurgy/S qt-client-4.1.0/hunspell/Makefile.am000066400000000000000000000014361217451700100173040ustar00rootroot00000000000000lib_LTLIBRARIES = libhunspell-1.2.la libhunspell_1_2_includedir = $(includedir)/hunspell libhunspell_1_2_la_SOURCES=affentry.cxx affixmgr.cxx csutil.cxx \ dictmgr.cxx hashmgr.cxx hunspell.cxx \ suggestmgr.cxx license.myspell license.hunspell \ phonet.cxx filemgr.cxx hunzip.cxx replist.cxx libhunspell_1_2_include_HEADERS=affentry.hxx htypes.hxx affixmgr.hxx \ csutil.hxx hunspell.hxx atypes.hxx dictmgr.hxx hunspell.h \ suggestmgr.hxx baseaffix.hxx hashmgr.hxx langnum.hxx \ phonet.hxx filemgr.hxx hunzip.hxx w_char.hxx replist.hxx \ hunvisapi.h libhunspell_1_2_la_DEPENDENCIES=utf_info.cxx libhunspell_1_2_la_LDFLAGS=-no-undefined AM_CXXFLAGS=$(CFLAG_VISIBILITY) -DBUILDING_LIBHUNSPELL EXTRA_DIST=hunspell.dsp makefile.mk README utf_info.cxx qt-client-4.1.0/hunspell/Makefile.in000066400000000000000000000533741217451700100173250ustar00rootroot00000000000000# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/hunspell DIST_COMMON = README $(libhunspell_1_2_include_HEADERS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/hunvisapi.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/codeset.m4 \ $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc2.m4 \ $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \ $(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/intl.m4 \ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax.m4 \ $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lcmessage.m4 \ $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/visibility.m4 \ $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = hunvisapi.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(libdir)" \ "$(DESTDIR)$(libhunspell_1_2_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libhunspell_1_2_la_LIBADD = am_libhunspell_1_2_la_OBJECTS = affentry.lo affixmgr.lo csutil.lo \ dictmgr.lo hashmgr.lo hunspell.lo suggestmgr.lo phonet.lo \ filemgr.lo hunzip.lo replist.lo libhunspell_1_2_la_OBJECTS = $(am_libhunspell_1_2_la_OBJECTS) libhunspell_1_2_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libhunspell_1_2_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libhunspell_1_2_la_SOURCES) DIST_SOURCES = $(libhunspell_1_2_la_SOURCES) HEADERS = $(libhunspell_1_2_include_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALLOCA = @ALLOCA@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAG_VISIBILITY = @CFLAG_VISIBILITY@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSESLIB = @CURSESLIB@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GENCAT = @GENCAT@ GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ GLIBC2 = @GLIBC2@ GLIBC21 = @GLIBC21@ GMSGFMT = @GMSGFMT@ GMSGFMT_015 = @GMSGFMT_015@ GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ HAVE_SNPRINTF = @HAVE_SNPRINTF@ HAVE_VISIBILITY = @HAVE_VISIBILITY@ HAVE_WPRINTF = @HAVE_WPRINTF@ HUNSPELL_VERSION_MAJOR = @HUNSPELL_VERSION_MAJOR@ HUNSPELL_VERSION_MINOR = @HUNSPELL_VERSION_MINOR@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBMULTITHREAD = @LIBMULTITHREAD@ LIBOBJS = @LIBOBJS@ LIBPTH = @LIBPTH@ LIBPTH_PREFIX = @LIBPTH_PREFIX@ LIBS = @LIBS@ LIBTHREAD = @LIBTHREAD@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBC = @LTLIBC@ LTLIBICONV = @LTLIBICONV@ LTLIBINTL = @LTLIBINTL@ LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ LTLIBOBJS = @LTLIBOBJS@ LTLIBPTH = @LTLIBPTH@ LTLIBTHREAD = @LTLIBTHREAD@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MSGFMT = @MSGFMT@ MSGFMT_015 = @MSGFMT_015@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ POSUB = @POSUB@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@ RANLIB = @RANLIB@ READLINELIB = @READLINELIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WINDRES = @WINDRES@ WOE32 = @WOE32@ WOE32DLL = @WOE32DLL@ XFAILED = @XFAILED@ XGETTEXT = @XGETTEXT@ XGETTEXT_015 = @XGETTEXT_015@ XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libhunspell-1.2.la libhunspell_1_2_includedir = $(includedir)/hunspell libhunspell_1_2_la_SOURCES = affentry.cxx affixmgr.cxx csutil.cxx \ dictmgr.cxx hashmgr.cxx hunspell.cxx \ suggestmgr.cxx license.myspell license.hunspell \ phonet.cxx filemgr.cxx hunzip.cxx replist.cxx libhunspell_1_2_include_HEADERS = affentry.hxx htypes.hxx affixmgr.hxx \ csutil.hxx hunspell.hxx atypes.hxx dictmgr.hxx hunspell.h \ suggestmgr.hxx baseaffix.hxx hashmgr.hxx langnum.hxx \ phonet.hxx filemgr.hxx hunzip.hxx w_char.hxx replist.hxx \ hunvisapi.h libhunspell_1_2_la_DEPENDENCIES = utf_info.cxx libhunspell_1_2_la_LDFLAGS = -no-undefined AM_CXXFLAGS = $(CFLAG_VISIBILITY) -DBUILDING_LIBHUNSPELL EXTRA_DIST = hunspell.dsp makefile.mk README utf_info.cxx all: all-am .SUFFIXES: .SUFFIXES: .cxx .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/hunspell/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/hunspell/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): hunvisapi.h: $(top_builddir)/config.status $(srcdir)/hunvisapi.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libhunspell-1.2.la: $(libhunspell_1_2_la_OBJECTS) $(libhunspell_1_2_la_DEPENDENCIES) $(libhunspell_1_2_la_LINK) -rpath $(libdir) $(libhunspell_1_2_la_OBJECTS) $(libhunspell_1_2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/affentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/affixmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/csutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dictmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashmgr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hunspell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hunzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/phonet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/replist.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/suggestmgr.Plo@am__quote@ .cxx.o: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cxx.obj: @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cxx.lo: @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-libhunspell_1_2_includeHEADERS: $(libhunspell_1_2_include_HEADERS) @$(NORMAL_INSTALL) test -z "$(libhunspell_1_2_includedir)" || $(MKDIR_P) "$(DESTDIR)$(libhunspell_1_2_includedir)" @list='$(libhunspell_1_2_include_HEADERS)'; test -n "$(libhunspell_1_2_includedir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libhunspell_1_2_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(libhunspell_1_2_includedir)" || exit $$?; \ done uninstall-libhunspell_1_2_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(libhunspell_1_2_include_HEADERS)'; test -n "$(libhunspell_1_2_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(libhunspell_1_2_includedir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(libhunspell_1_2_includedir)" && rm -f $$files ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libhunspell_1_2_includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-libhunspell_1_2_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES \ uninstall-libhunspell_1_2_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool ctags distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-libhunspell_1_2_includeHEADERS \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-libLTLIBRARIES \ uninstall-libhunspell_1_2_includeHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: qt-client-4.1.0/hunspell/affentry.cxx000066400000000000000000001077521217451700100176220ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include #include "affentry.hxx" #include "csutil.hxx" PfxEntry::PfxEntry(AffixMgr* pmgr, affentry* dp) { // register affix manager pmyMgr = pmgr; // set up its initial values aflag = dp->aflag; // flag strip = dp->strip; // string to strip appnd = dp->appnd; // string to append stripl = dp->stripl; // length of strip string appndl = dp->appndl; // length of append string numconds = dp->numconds; // length of the condition opts = dp->opts; // cross product flag // then copy over all of the conditions if (opts & aeLONGCOND) { memcpy(c.conds, dp->c.l.conds1, MAXCONDLEN_1); c.l.conds2 = dp->c.l.conds2; } else memcpy(c.conds, dp->c.conds, MAXCONDLEN); next = NULL; nextne = NULL; nexteq = NULL; morphcode = dp->morphcode; contclass = dp->contclass; contclasslen = dp->contclasslen; } PfxEntry::~PfxEntry() { aflag = 0; if (appnd) free(appnd); if (strip) free(strip); pmyMgr = NULL; appnd = NULL; strip = NULL; if (opts & aeLONGCOND) free(c.l.conds2); if (morphcode && !(opts & aeALIASM)) free(morphcode); if (contclass && !(opts & aeALIASF)) free(contclass); } // add prefix to this word assuming conditions hold char * PfxEntry::add(const char * word, int len) { char tword[MAXWORDUTF8LEN + 4]; if ((len > stripl || (len == 0 && pmyMgr->get_fullstrip())) && (len >= numconds) && test_condition(word) && (!stripl || (strncmp(word, strip, stripl) == 0)) && ((MAXWORDUTF8LEN + 4) > (len + appndl - stripl))) { /* we have a match so add prefix */ char * pp = tword; if (appndl) { strcpy(tword,appnd); pp += appndl; } strcpy(pp, (word + stripl)); return mystrdup(tword); } return NULL; } inline char * PfxEntry::nextchar(char * p) { if (p) { p++; if (opts & aeLONGCOND) { // jump to the 2nd part of the condition if (p == c.conds + MAXCONDLEN_1) return c.l.conds2; // end of the MAXCONDLEN length condition } else if (p == c.conds + MAXCONDLEN) return NULL; return *p ? p : NULL; } return NULL; } inline int PfxEntry::test_condition(const char * st) { const char * pos = NULL; // group with pos input position bool neg = false; // complementer bool ingroup = false; // character in the group if (numconds == 0) return 1; char * p = c.conds; while (1) { switch (*p) { case '\0': return 1; case '[': { neg = false; ingroup = false; p = nextchar(p); pos = st; break; } case '^': { p = nextchar(p); neg = true; break; } case ']': { if ((neg && ingroup) || (!neg && !ingroup)) return 0; pos = NULL; p = nextchar(p); // skip the next character if (!ingroup) for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++); if (*st == '\0' && p) return 0; // word <= condition break; } case '.': if (!pos) { // dots are not metacharacters in groups: [.] p = nextchar(p); // skip the next character for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++); if (*st == '\0' && p) return 0; // word <= condition break; } default: { if (*st == *p) { st++; p = nextchar(p); if ((opts & aeUTF8) && (*(st - 1) & 0x80)) { // multibyte while (p && (*p & 0xc0) == 0x80) { // character if (*p != *st) { if (!pos) return 0; st = pos; break; } p = nextchar(p); st++; } if (pos && st != pos) { ingroup = true; while (p && *p != ']' && (p = nextchar(p))); } } else if (pos) { ingroup = true; while (p && *p != ']' && (p = nextchar(p))); } } else if (pos) { // group p = nextchar(p); } else return 0; } } if (!p) return 1; } } // check if this prefix entry matches struct hentry * PfxEntry::checkword(const char * word, int len, char in_compound, const FLAG needflag) { int tmpl; // length of tmpword struct hentry * he; // hash entry of root word or NULL char tmpword[MAXWORDUTF8LEN + 4]; // on entry prefix is 0 length or already matches the beginning of the word. // So if the remaining root word has positive length // and if there are enough chars in root word and added back strip chars // to meet the number of characters conditions, then test it tmpl = len - appndl; if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) { // generate new root word by removing prefix and adding // back any characters that would have been stripped if (stripl) strcpy (tmpword, strip); strcpy ((tmpword + stripl), (word + appndl)); // now make sure all of the conditions on characters // are met. Please see the appendix at the end of // this file for more info on exactly what is being // tested // if all conditions are met then check if resulting // root word in the dictionary if (test_condition(tmpword)) { tmpl += stripl; if ((he = pmyMgr->lookup(tmpword)) != NULL) { do { if (TESTAFF(he->astr, aflag, he->alen) && // forbid single prefixes with needaffix flag ! TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) && // needflag ((!needflag) || TESTAFF(he->astr, needflag, he->alen) || (contclass && TESTAFF(contclass, needflag, contclasslen)))) return he; he = he->next_homonym; // check homonyms } while (he); } // prefix matched but no root word was found // if aeXPRODUCT is allowed, try again but now // ross checked combined with a suffix //if ((opts & aeXPRODUCT) && in_compound) { if ((opts & aeXPRODUCT)) { he = pmyMgr->suffix_check(tmpword, tmpl, aeXPRODUCT, this, NULL, 0, NULL, FLAG_NULL, needflag, in_compound); if (he) return he; } } } return NULL; } // check if this prefix entry matches struct hentry * PfxEntry::check_twosfx(const char * word, int len, char in_compound, const FLAG needflag) { int tmpl; // length of tmpword struct hentry * he; // hash entry of root word or NULL char tmpword[MAXWORDUTF8LEN + 4]; // on entry prefix is 0 length or already matches the beginning of the word. // So if the remaining root word has positive length // and if there are enough chars in root word and added back strip chars // to meet the number of characters conditions, then test it tmpl = len - appndl; if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && (tmpl + stripl >= numconds)) { // generate new root word by removing prefix and adding // back any characters that would have been stripped if (stripl) strcpy (tmpword, strip); strcpy ((tmpword + stripl), (word + appndl)); // now make sure all of the conditions on characters // are met. Please see the appendix at the end of // this file for more info on exactly what is being // tested // if all conditions are met then check if resulting // root word in the dictionary if (test_condition(tmpword)) { tmpl += stripl; // prefix matched but no root word was found // if aeXPRODUCT is allowed, try again but now // cross checked combined with a suffix if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { he = pmyMgr->suffix_check_twosfx(tmpword, tmpl, aeXPRODUCT, this, needflag); if (he) return he; } } } return NULL; } // check if this prefix entry matches char * PfxEntry::check_twosfx_morph(const char * word, int len, char in_compound, const FLAG needflag) { int tmpl; // length of tmpword char tmpword[MAXWORDUTF8LEN + 4]; // on entry prefix is 0 length or already matches the beginning of the word. // So if the remaining root word has positive length // and if there are enough chars in root word and added back strip chars // to meet the number of characters conditions, then test it tmpl = len - appndl; if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && (tmpl + stripl >= numconds)) { // generate new root word by removing prefix and adding // back any characters that would have been stripped if (stripl) strcpy (tmpword, strip); strcpy ((tmpword + stripl), (word + appndl)); // now make sure all of the conditions on characters // are met. Please see the appendix at the end of // this file for more info on exactly what is being // tested // if all conditions are met then check if resulting // root word in the dictionary if (test_condition(tmpword)) { tmpl += stripl; // prefix matched but no root word was found // if aeXPRODUCT is allowed, try again but now // ross checked combined with a suffix if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { return pmyMgr->suffix_check_twosfx_morph(tmpword, tmpl, aeXPRODUCT, this, needflag); } } } return NULL; } // check if this prefix entry matches char * PfxEntry::check_morph(const char * word, int len, char in_compound, const FLAG needflag) { int tmpl; // length of tmpword struct hentry * he; // hash entry of root word or NULL char tmpword[MAXWORDUTF8LEN + 4]; char result[MAXLNLEN]; char * st; *result = '\0'; // on entry prefix is 0 length or already matches the beginning of the word. // So if the remaining root word has positive length // and if there are enough chars in root word and added back strip chars // to meet the number of characters conditions, then test it tmpl = len - appndl; if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && (tmpl + stripl >= numconds)) { // generate new root word by removing prefix and adding // back any characters that would have been stripped if (stripl) strcpy (tmpword, strip); strcpy ((tmpword + stripl), (word + appndl)); // now make sure all of the conditions on characters // are met. Please see the appendix at the end of // this file for more info on exactly what is being // tested // if all conditions are met then check if resulting // root word in the dictionary if (test_condition(tmpword)) { tmpl += stripl; if ((he = pmyMgr->lookup(tmpword)) != NULL) { do { if (TESTAFF(he->astr, aflag, he->alen) && // forbid single prefixes with needaffix flag ! TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) && // needflag ((!needflag) || TESTAFF(he->astr, needflag, he->alen) || (contclass && TESTAFF(contclass, needflag, contclasslen)))) { if (morphcode) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, morphcode, MAXLNLEN); } else mystrcat(result,getKey(), MAXLNLEN); if (!HENTRY_FIND(he, MORPH_STEM)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, MORPH_STEM, MAXLNLEN); mystrcat(result, HENTRY_WORD(he), MAXLNLEN); } // store the pointer of the hash entry if (HENTRY_DATA(he)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, HENTRY_DATA2(he), MAXLNLEN); } else { // return with debug information char * flag = pmyMgr->encode_flag(getFlag()); mystrcat(result, " ", MAXLNLEN); mystrcat(result, MORPH_FLAG, MAXLNLEN); mystrcat(result, flag, MAXLNLEN); free(flag); } mystrcat(result, "\n", MAXLNLEN); } he = he->next_homonym; } while (he); } // prefix matched but no root word was found // if aeXPRODUCT is allowed, try again but now // ross checked combined with a suffix if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { st = pmyMgr->suffix_check_morph(tmpword, tmpl, aeXPRODUCT, this, FLAG_NULL, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } } } } if (*result) return mystrdup(result); return NULL; } SfxEntry::SfxEntry(AffixMgr * pmgr, affentry* dp) { // register affix manager pmyMgr = pmgr; // set up its initial values aflag = dp->aflag; // char flag strip = dp->strip; // string to strip appnd = dp->appnd; // string to append stripl = dp->stripl; // length of strip string appndl = dp->appndl; // length of append string numconds = dp->numconds; // length of the condition opts = dp->opts; // cross product flag // then copy over all of the conditions if (opts & aeLONGCOND) { memcpy(c.l.conds1, dp->c.l.conds1, MAXCONDLEN_1); c.l.conds2 = dp->c.l.conds2; } else memcpy(c.conds, dp->c.conds, MAXCONDLEN); rappnd = myrevstrdup(appnd); morphcode = dp->morphcode; contclass = dp->contclass; contclasslen = dp->contclasslen; } SfxEntry::~SfxEntry() { aflag = 0; if (appnd) free(appnd); if (rappnd) free(rappnd); if (strip) free(strip); pmyMgr = NULL; appnd = NULL; strip = NULL; if (opts & aeLONGCOND) free(c.l.conds2); if (morphcode && !(opts & aeALIASM)) free(morphcode); if (contclass && !(opts & aeALIASF)) free(contclass); } // add suffix to this word assuming conditions hold char * SfxEntry::add(const char * word, int len) { char tword[MAXWORDUTF8LEN + 4]; /* make sure all conditions match */ if ((len > stripl || (len == 0 && pmyMgr->get_fullstrip())) && (len >= numconds) && test_condition(word + len, word) && (!stripl || (strcmp(word + len - stripl, strip) == 0)) && ((MAXWORDUTF8LEN + 4) > (len + appndl - stripl))) { /* we have a match so add suffix */ strcpy(tword,word); if (appndl) { strcpy(tword + len - stripl, appnd); } else { *(tword + len - stripl) = '\0'; } return mystrdup(tword); } return NULL; } inline char * SfxEntry::nextchar(char * p) { if (p) { p++; if (opts & aeLONGCOND) { // jump to the 2nd part of the condition if (p == c.l.conds1 + MAXCONDLEN_1) return c.l.conds2; // end of the MAXCONDLEN length condition } else if (p == c.conds + MAXCONDLEN) return NULL; return *p ? p : NULL; } return NULL; } inline int SfxEntry::test_condition(const char * st, const char * beg) { const char * pos = NULL; // group with pos input position bool neg = false; // complementer bool ingroup = false; // character in the group if (numconds == 0) return 1; char * p = c.conds; st--; int i = 1; while (1) { switch (*p) { case '\0': return 1; case '[': { p = nextchar(p); pos = st; break; } case '^': { p = nextchar(p); neg = true; break; } case ']': { if (!neg && !ingroup) return 0; i++; // skip the next character if (!ingroup) { for (; (opts & aeUTF8) && (st >= beg) && (*st & 0xc0) == 0x80; st--); st--; } pos = NULL; neg = false; ingroup = false; p = nextchar(p); if (st < beg && p) return 0; // word <= condition break; } case '.': if (!pos) { // dots are not metacharacters in groups: [.] p = nextchar(p); // skip the next character for (st--; (opts & aeUTF8) && (st >= beg) && (*st & 0xc0) == 0x80; st--); if (st < beg) { // word <= condition if (p) return 0; else return 1; } if ((opts & aeUTF8) && (*st & 0x80)) { // head of the UTF-8 character st--; if (st < beg) { // word <= condition if (p) return 0; else return 1; } } break; } default: { if (*st == *p) { p = nextchar(p); if ((opts & aeUTF8) && (*st & 0x80)) { st--; while (p && (st >= beg)) { if (*p != *st) { if (!pos) return 0; st = pos; break; } // first byte of the UTF-8 multibyte character if ((*p & 0xc0) != 0x80) break; p = nextchar(p); st--; } if (pos && st != pos) { if (neg) return 0; else if (i == numconds) return 1; ingroup = true; while (p && *p != ']' && (p = nextchar(p))); st--; } if (p && *p != ']') p = nextchar(p); } else if (pos) { if (neg) return 0; else if (i == numconds) return 1; ingroup = true; while (p && *p != ']' && (p = nextchar(p))); // if (p && *p != ']') p = nextchar(p); st--; } if (!pos) { i++; st--; } if (st < beg && p && *p != ']') return 0; // word <= condition } else if (pos) { // group p = nextchar(p); } else return 0; } } if (!p) return 1; } } // see if this suffix is present in the word struct hentry * SfxEntry::checkword(const char * word, int len, int optflags, PfxEntry* ppfx, char ** wlst, int maxSug, int * ns, const FLAG cclass, const FLAG needflag, const FLAG badflag) { int tmpl; // length of tmpword struct hentry * he; // hash entry pointer unsigned char * cp; char tmpword[MAXWORDUTF8LEN + 4]; PfxEntry* ep = ppfx; // if this suffix is being cross checked with a prefix // but it does not support cross products skip it if (((optflags & aeXPRODUCT) != 0) && ((opts & aeXPRODUCT) == 0)) return NULL; // upon entry suffix is 0 length or already matches the end of the word. // So if the remaining root word has positive length // and if there are enough chars in root word and added back strip chars // to meet the number of characters conditions, then test it tmpl = len - appndl; // the second condition is not enough for UTF-8 strings // it checked in test_condition() if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && (tmpl + stripl >= numconds)) { // generate new root word by removing suffix and adding // back any characters that would have been stripped or // or null terminating the shorter string strcpy (tmpword, word); cp = (unsigned char *)(tmpword + tmpl); if (stripl) { strcpy ((char *)cp, strip); tmpl += stripl; cp = (unsigned char *)(tmpword + tmpl); } else *cp = '\0'; // now make sure all of the conditions on characters // are met. Please see the appendix at the end of // this file for more info on exactly what is being // tested // if all conditions are met then check if resulting // root word in the dictionary if (test_condition((char *) cp, (char *) tmpword)) { #ifdef SZOSZABLYA_POSSIBLE_ROOTS fprintf(stdout,"%s %s %c\n", word, tmpword, aflag); #endif if ((he = pmyMgr->lookup(tmpword)) != NULL) { do { // check conditional suffix (enabled by prefix) if ((TESTAFF(he->astr, aflag, he->alen) || (ep && ep->getCont() && TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && (((optflags & aeXPRODUCT) == 0) || (ep && TESTAFF(he->astr, ep->getFlag(), he->alen)) || // enabled by prefix ((contclass) && (ep && TESTAFF(contclass, ep->getFlag(), contclasslen))) ) && // handle cont. class ((!cclass) || ((contclass) && TESTAFF(contclass, cclass, contclasslen)) ) && // check only in compound homonyms (bad flags) (!badflag || !TESTAFF(he->astr, badflag, he->alen) ) && // handle required flag ((!needflag) || (TESTAFF(he->astr, needflag, he->alen) || ((contclass) && TESTAFF(contclass, needflag, contclasslen))) ) ) return he; he = he->next_homonym; // check homonyms } while (he); // obsolote stemming code (used only by the // experimental SuffixMgr:suggest_pos_stems) // store resulting root in wlst } else if (wlst && (*ns < maxSug)) { int cwrd = 1; for (int k=0; k < *ns; k++) if (strcmp(tmpword, wlst[k]) == 0) cwrd = 0; if (cwrd) { wlst[*ns] = mystrdup(tmpword); if (wlst[*ns] == NULL) { for (int j=0; j<*ns; j++) free(wlst[j]); *ns = -1; return NULL; } (*ns)++; } } } } return NULL; } // see if two-level suffix is present in the word struct hentry * SfxEntry::check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag) { int tmpl; // length of tmpword struct hentry * he; // hash entry pointer unsigned char * cp; char tmpword[MAXWORDUTF8LEN + 4]; PfxEntry* ep = ppfx; // if this suffix is being cross checked with a prefix // but it does not support cross products skip it if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0) return NULL; // upon entry suffix is 0 length or already matches the end of the word. // So if the remaining root word has positive length // and if there are enough chars in root word and added back strip chars // to meet the number of characters conditions, then test it tmpl = len - appndl; if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && (tmpl + stripl >= numconds)) { // generate new root word by removing suffix and adding // back any characters that would have been stripped or // or null terminating the shorter string strcpy (tmpword, word); cp = (unsigned char *)(tmpword + tmpl); if (stripl) { strcpy ((char *)cp, strip); tmpl += stripl; cp = (unsigned char *)(tmpword + tmpl); } else *cp = '\0'; // now make sure all of the conditions on characters // are met. Please see the appendix at the end of // this file for more info on exactly what is being // tested // if all conditions are met then recall suffix_check if (test_condition((char *) cp, (char *) tmpword)) { if (ppfx) { // handle conditional suffix if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen)) he = pmyMgr->suffix_check(tmpword, tmpl, 0, NULL, NULL, 0, NULL, (FLAG) aflag, needflag); else he = pmyMgr->suffix_check(tmpword, tmpl, optflags, ppfx, NULL, 0, NULL, (FLAG) aflag, needflag); } else { he = pmyMgr->suffix_check(tmpword, tmpl, 0, NULL, NULL, 0, NULL, (FLAG) aflag, needflag); } if (he) return he; } } return NULL; } // see if two-level suffix is present in the word char * SfxEntry::check_twosfx_morph(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag) { int tmpl; // length of tmpword unsigned char * cp; char tmpword[MAXWORDUTF8LEN + 4]; PfxEntry* ep = ppfx; char * st; char result[MAXLNLEN]; *result = '\0'; // if this suffix is being cross checked with a prefix // but it does not support cross products skip it if ((optflags & aeXPRODUCT) != 0 && (opts & aeXPRODUCT) == 0) return NULL; // upon entry suffix is 0 length or already matches the end of the word. // So if the remaining root word has positive length // and if there are enough chars in root word and added back strip chars // to meet the number of characters conditions, then test it tmpl = len - appndl; if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && (tmpl + stripl >= numconds)) { // generate new root word by removing suffix and adding // back any characters that would have been stripped or // or null terminating the shorter string strcpy (tmpword, word); cp = (unsigned char *)(tmpword + tmpl); if (stripl) { strcpy ((char *)cp, strip); tmpl += stripl; cp = (unsigned char *)(tmpword + tmpl); } else *cp = '\0'; // now make sure all of the conditions on characters // are met. Please see the appendix at the end of // this file for more info on exactly what is being // tested // if all conditions are met then recall suffix_check if (test_condition((char *) cp, (char *) tmpword)) { if (ppfx) { // handle conditional suffix if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen)) { st = pmyMgr->suffix_check_morph(tmpword, tmpl, 0, NULL, aflag, needflag); if (st) { if (ppfx->getMorph()) { mystrcat(result, ppfx->getMorph(), MAXLNLEN); mystrcat(result, " ", MAXLNLEN); } mystrcat(result,st, MAXLNLEN); free(st); mychomp(result); } } else { st = pmyMgr->suffix_check_morph(tmpword, tmpl, optflags, ppfx, aflag, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); mychomp(result); } } } else { st = pmyMgr->suffix_check_morph(tmpword, tmpl, 0, NULL, aflag, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); mychomp(result); } } if (*result) return mystrdup(result); } } return NULL; } // get next homonym with same affix struct hentry * SfxEntry::get_next_homonym(struct hentry * he, int optflags, PfxEntry* ppfx, const FLAG cclass, const FLAG needflag) { PfxEntry* ep = ppfx; FLAG eFlag = ep ? ep->getFlag() : FLAG_NULL; while (he->next_homonym) { he = he->next_homonym; if ((TESTAFF(he->astr, aflag, he->alen) || (ep && ep->getCont() && TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && ((optflags & aeXPRODUCT) == 0 || TESTAFF(he->astr, eFlag, he->alen) || // handle conditional suffix ((contclass) && TESTAFF(contclass, eFlag, contclasslen)) ) && // handle cont. class ((!cclass) || ((contclass) && TESTAFF(contclass, cclass, contclasslen)) ) && // handle required flag ((!needflag) || (TESTAFF(he->astr, needflag, he->alen) || ((contclass) && TESTAFF(contclass, needflag, contclasslen))) ) ) return he; } return NULL; } #if 0 /* Appendix: Understanding Affix Code An affix is either a prefix or a suffix attached to root words to make other words. Basically a Prefix or a Suffix is set of AffEntry objects which store information about the prefix or suffix along with supporting routines to check if a word has a particular prefix or suffix or a combination. The structure affentry is defined as follows: struct affentry { unsigned short aflag; // ID used to represent the affix char * strip; // string to strip before adding affix char * appnd; // the affix string to add unsigned char stripl; // length of the strip string unsigned char appndl; // length of the affix string char numconds; // the number of conditions that must be met char opts; // flag: aeXPRODUCT- combine both prefix and suffix char conds[SETSIZE]; // array which encodes the conditions to be met }; Here is a suffix borrowed from the en_US.aff file. This file is whitespace delimited. SFX D Y 4 SFX D 0 e d SFX D y ied [^aeiou]y SFX D 0 ed [^ey] SFX D 0 ed [aeiou]y This information can be interpreted as follows: In the first line has 4 fields Field ----- 1 SFX - indicates this is a suffix 2 D - is the name of the character flag which represents this suffix 3 Y - indicates it can be combined with prefixes (cross product) 4 4 - indicates that sequence of 4 affentry structures are needed to properly store the affix information The remaining lines describe the unique information for the 4 SfxEntry objects that make up this affix. Each line can be interpreted as follows: (note fields 1 and 2 are as a check against line 1 info) Field ----- 1 SFX - indicates this is a suffix 2 D - is the name of the character flag for this affix 3 y - the string of chars to strip off before adding affix (a 0 here indicates the NULL string) 4 ied - the string of affix characters to add 5 [^aeiou]y - the conditions which must be met before the affix can be applied Field 5 is interesting. Since this is a suffix, field 5 tells us that there are 2 conditions that must be met. The first condition is that the next to the last character in the word must *NOT* be any of the following "a", "e", "i", "o" or "u". The second condition is that the last character of the word must end in "y". So how can we encode this information concisely and be able to test for both conditions in a fast manner? The answer is found but studying the wonderful ispell code of Geoff Kuenning, et.al. (now available under a normal BSD license). If we set up a conds array of 256 bytes indexed (0 to 255) and access it using a character (cast to an unsigned char) of a string, we have 8 bits of information we can store about that character. Specifically we could use each bit to say if that character is allowed in any of the last (or first for prefixes) 8 characters of the word. Basically, each character at one end of the word (up to the number of conditions) is used to index into the conds array and the resulting value found there says whether the that character is valid for a specific character position in the word. For prefixes, it does this by setting bit 0 if that char is valid in the first position, bit 1 if valid in the second position, and so on. If a bit is not set, then that char is not valid for that postion in the word. If working with suffixes bit 0 is used for the character closest to the front, bit 1 for the next character towards the end, ..., with bit numconds-1 representing the last char at the end of the string. Note: since entries in the conds[] are 8 bits, only 8 conditions (read that only 8 character positions) can be examined at one end of a word (the beginning for prefixes and the end for suffixes. So to make this clearer, lets encode the conds array values for the first two affentries for the suffix D described earlier. For the first affentry: numconds = 1 (only examine the last character) conds['e'] = (1 << 0) (the word must end in an E) all others are all 0 For the second affentry: numconds = 2 (only examine the last two characters) conds[X] = conds[X] | (1 << 0) (aeiou are not allowed) where X is all characters *but* a, e, i, o, or u conds['y'] = (1 << 1) (the last char must be a y) all other bits for all other entries in the conds array are zero */ #endif qt-client-4.1.0/hunspell/affentry.hxx000066400000000000000000000106171217451700100176200ustar00rootroot00000000000000#ifndef _AFFIX_HXX_ #define _AFFIX_HXX_ #include "hunvisapi.h" #include "atypes.hxx" #include "baseaffix.hxx" #include "affixmgr.hxx" /* A Prefix Entry */ class LIBHUNSPELL_DLL_EXPORTED PfxEntry : protected AffEntry { AffixMgr* pmyMgr; PfxEntry * next; PfxEntry * nexteq; PfxEntry * nextne; PfxEntry * flgnxt; public: PfxEntry(AffixMgr* pmgr, affentry* dp ); ~PfxEntry(); inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); } struct hentry * checkword(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL); char * check_morph(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); char * check_twosfx_morph(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); inline FLAG getFlag() { return aflag; } inline const char * getKey() { return appnd; } char * add(const char * word, int len); inline short getKeyLen() { return appndl; } inline const char * getMorph() { return morphcode; } inline const unsigned short * getCont() { return contclass; } inline short getContLen() { return contclasslen; } inline PfxEntry * getNext() { return next; } inline PfxEntry * getNextNE() { return nextne; } inline PfxEntry * getNextEQ() { return nexteq; } inline PfxEntry * getFlgNxt() { return flgnxt; } inline void setNext(PfxEntry * ptr) { next = ptr; } inline void setNextNE(PfxEntry * ptr) { nextne = ptr; } inline void setNextEQ(PfxEntry * ptr) { nexteq = ptr; } inline void setFlgNxt(PfxEntry * ptr) { flgnxt = ptr; } inline char * nextchar(char * p); inline int test_condition(const char * st); }; /* A Suffix Entry */ class LIBHUNSPELL_DLL_EXPORTED SfxEntry : protected AffEntry { AffixMgr* pmyMgr; char * rappnd; SfxEntry * next; SfxEntry * nexteq; SfxEntry * nextne; SfxEntry * flgnxt; SfxEntry * l_morph; SfxEntry * r_morph; SfxEntry * eq_morph; public: SfxEntry(AffixMgr* pmgr, affentry* dp ); ~SfxEntry(); inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); } struct hentry * checkword(const char * word, int len, int optflags, PfxEntry* ppfx, char ** wlst, int maxSug, int * ns, // const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT); const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0); struct hentry * check_twosfx(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = NULL); char * check_twosfx_morph(const char * word, int len, int optflags, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL); struct hentry * get_next_homonym(struct hentry * he); struct hentry * get_next_homonym(struct hentry * word, int optflags, PfxEntry* ppfx, const FLAG cclass, const FLAG needflag); inline FLAG getFlag() { return aflag; } inline const char * getKey() { return rappnd; } char * add(const char * word, int len); inline const char * getMorph() { return morphcode; } inline const unsigned short * getCont() { return contclass; } inline short getContLen() { return contclasslen; } inline const char * getAffix() { return appnd; } inline short getKeyLen() { return appndl; } inline SfxEntry * getNext() { return next; } inline SfxEntry * getNextNE() { return nextne; } inline SfxEntry * getNextEQ() { return nexteq; } inline SfxEntry * getLM() { return l_morph; } inline SfxEntry * getRM() { return r_morph; } inline SfxEntry * getEQM() { return eq_morph; } inline SfxEntry * getFlgNxt() { return flgnxt; } inline void setNext(SfxEntry * ptr) { next = ptr; } inline void setNextNE(SfxEntry * ptr) { nextne = ptr; } inline void setNextEQ(SfxEntry * ptr) { nexteq = ptr; } inline void setFlgNxt(SfxEntry * ptr) { flgnxt = ptr; } inline char * nextchar(char * p); inline int test_condition(const char * st, const char * begin); }; #endif qt-client-4.1.0/hunspell/affixmgr.cxx000066400000000000000000004404241217451700100176030ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include #include #include "affixmgr.hxx" #include "affentry.hxx" #include "langnum.hxx" #include "csutil.hxx" AffixMgr::AffixMgr(const char * affpath, HashMgr** ptr, int * md, const char * key) { // register hash manager and load affix data from aff file pHMgr = ptr[0]; alldic = ptr; maxdic = md; keystring = NULL; trystring = NULL; encoding=NULL; csconv=NULL; utf8 = 0; complexprefixes = 0; maptable = NULL; nummap = 0; breaktable = NULL; numbreak = 0; reptable = NULL; numrep = 0; iconvtable = NULL; oconvtable = NULL; checkcpdtable = NULL; // allow simplified compound forms (see 3rd field of CHECKCOMPOUNDPATTERN) simplifiedcpd = 0; numcheckcpd = 0; defcpdtable = NULL; numdefcpd = 0; phone = NULL; compoundflag = FLAG_NULL; // permits word in compound forms compoundbegin = FLAG_NULL; // may be first word in compound forms compoundmiddle = FLAG_NULL; // may be middle word in compound forms compoundend = FLAG_NULL; // may be last word in compound forms compoundroot = FLAG_NULL; // compound word signing flag compoundpermitflag = FLAG_NULL; // compound permitting flag for suffixed word compoundforbidflag = FLAG_NULL; // compound fordidden flag for suffixed word checkcompounddup = 0; // forbid double words in compounds checkcompoundrep = 0; // forbid bad compounds (may be non compound word with a REP substitution) checkcompoundcase = 0; // forbid upper and lowercase combinations at word bounds checkcompoundtriple = 0; // forbid compounds with triple letters simplifiedtriple = 0; // allow simplified triple letters in compounds (Schiff+fahrt -> Schiffahrt) forbiddenword = FORBIDDENWORD; // forbidden word signing flag nosuggest = FLAG_NULL; // don't suggest words signed with NOSUGGEST flag lang = NULL; // language langnum = 0; // language code (see http://l10n.openoffice.org/languages.html) needaffix = FLAG_NULL; // forbidden root, allowed only with suffixes cpdwordmax = -1; // default: unlimited wordcount in compound words cpdmin = -1; // undefined cpdmaxsyllable = 0; // default: unlimited syllablecount in compound words cpdvowels=NULL; // vowels (for calculating of Hungarian compounding limit, O(n) search! XXX) cpdvowels_utf16=NULL; // vowels for UTF-8 encoding (bsearch instead of O(n) search) cpdvowels_utf16_len=0; // vowels pfxappnd=NULL; // previous prefix for counting the syllables of prefix BUG sfxappnd=NULL; // previous suffix for counting a special syllables BUG cpdsyllablenum=NULL; // syllable count incrementing flag checknum=0; // checking numbers, and word with numbers wordchars=NULL; // letters + spec. word characters wordchars_utf16=NULL; // letters + spec. word characters wordchars_utf16_len=0; // letters + spec. word characters ignorechars=NULL; // letters + spec. word characters ignorechars_utf16=NULL; // letters + spec. word characters ignorechars_utf16_len=0; // letters + spec. word characters version=NULL; // affix and dictionary file version string havecontclass=0; // flags of possible continuing classes (double affix) // LEMMA_PRESENT: not put root into the morphological output. Lemma presents // in morhological description in dictionary file. It's often combined with PSEUDOROOT. lemma_present = FLAG_NULL; circumfix = FLAG_NULL; onlyincompound = FLAG_NULL; maxngramsugs = -1; // undefined nosplitsugs = 0; sugswithdots = 0; keepcase = 0; checksharps = 0; substandard = FLAG_NULL; fullstrip = 0; sfx = NULL; pfx = NULL; for (int i=0; i < SETSIZE; i++) { pStart[i] = NULL; sStart[i] = NULL; pFlag[i] = NULL; sFlag[i] = NULL; } for (int j=0; j < CONTSIZE; j++) { contclasses[j] = 0; } if (parse_file(affpath, key)) { HUNSPELL_WARNING(stderr, "Failure loading aff file %s\n",affpath); } if (cpdmin == -1) cpdmin = MINCPDLEN; } AffixMgr::~AffixMgr() { // pass through linked prefix entries and clean up for (int i=0; i < SETSIZE ;i++) { pFlag[i] = NULL; PfxEntry * ptr = pStart[i]; PfxEntry * nptr = NULL; while (ptr) { nptr = ptr->getNext(); delete(ptr); ptr = nptr; nptr = NULL; } } // pass through linked suffix entries and clean up for (int j=0; j < SETSIZE ; j++) { sFlag[j] = NULL; SfxEntry * ptr = sStart[j]; SfxEntry * nptr = NULL; while (ptr) { nptr = ptr->getNext(); delete(ptr); ptr = nptr; nptr = NULL; } sStart[j] = NULL; } if (keystring) free(keystring); keystring=NULL; if (trystring) free(trystring); trystring=NULL; if (encoding) free(encoding); encoding=NULL; if (maptable) { for (int j=0; j < nummap; j++) { for (int k=0; k < maptable[j].len; k++) { if (maptable[j].set[k]) free(maptable[j].set[k]); } free(maptable[j].set); maptable[j].set = NULL; maptable[j].len = 0; } free(maptable); maptable = NULL; } nummap = 0; if (breaktable) { for (int j=0; j < numbreak; j++) { if (breaktable[j]) free(breaktable[j]); breaktable[j] = NULL; } free(breaktable); breaktable = NULL; } numbreak = 0; if (reptable) { for (int j=0; j < numrep; j++) { free(reptable[j].pattern); free(reptable[j].pattern2); } free(reptable); reptable = NULL; } if (iconvtable) delete iconvtable; if (oconvtable) delete oconvtable; if (phone && phone->rules) { for (int j=0; j < phone->num + 1; j++) { free(phone->rules[j * 2]); free(phone->rules[j * 2 + 1]); } free(phone->rules); free(phone); phone = NULL; } if (defcpdtable) { for (int j=0; j < numdefcpd; j++) { free(defcpdtable[j].def); defcpdtable[j].def = NULL; } free(defcpdtable); defcpdtable = NULL; } numrep = 0; if (checkcpdtable) { for (int j=0; j < numcheckcpd; j++) { free(checkcpdtable[j].pattern); free(checkcpdtable[j].pattern2); free(checkcpdtable[j].pattern3); checkcpdtable[j].pattern = NULL; checkcpdtable[j].pattern2 = NULL; checkcpdtable[j].pattern3 = NULL; } free(checkcpdtable); checkcpdtable = NULL; } numcheckcpd = 0; FREE_FLAG(compoundflag); FREE_FLAG(compoundbegin); FREE_FLAG(compoundmiddle); FREE_FLAG(compoundend); FREE_FLAG(compoundpermitflag); FREE_FLAG(compoundforbidflag); FREE_FLAG(compoundroot); FREE_FLAG(forbiddenword); FREE_FLAG(nosuggest); FREE_FLAG(needaffix); FREE_FLAG(lemma_present); FREE_FLAG(circumfix); FREE_FLAG(onlyincompound); cpdwordmax = 0; pHMgr = NULL; cpdmin = 0; cpdmaxsyllable = 0; if (cpdvowels) free(cpdvowels); if (cpdvowels_utf16) free(cpdvowels_utf16); if (cpdsyllablenum) free(cpdsyllablenum); free_utf_tbl(); if (lang) free(lang); if (wordchars) free(wordchars); if (wordchars_utf16) free(wordchars_utf16); if (ignorechars) free(ignorechars); if (ignorechars_utf16) free(ignorechars_utf16); if (version) free(version); checknum=0; #ifdef MOZILLA_CLIENT delete [] csconv; #endif } // read in aff file and build up prefix and suffix entry objects int AffixMgr::parse_file(const char * affpath, const char * key) { char * line; // io buffers char ft; // affix type // checking flag duplication char dupflags[CONTSIZE]; char dupflags_ini = 1; // first line indicator for removing byte order mark int firstline = 1; // open the affix file FileMgr * afflst = new FileMgr(affpath, key); if (!afflst) { HUNSPELL_WARNING(stderr, "error: could not open affix description file %s\n",affpath); return 1; } // step one is to parse the affix file building up the internal // affix data structures // read in each line ignoring any that do not // start with a known line type indicator while ((line = afflst->getline())) { mychomp(line); /* remove byte order mark */ if (firstline) { firstline = 0; // Affix file begins with byte order mark: possible incompatibility with old Hunspell versions if (strncmp(line,"\xEF\xBB\xBF",3) == 0) { memmove(line, line+3, strlen(line+3)+1); } } /* parse in the keyboard string */ if (strncmp(line,"KEY",3) == 0) { if (parse_string(line, &keystring, afflst->getlinenum())) { delete afflst; return 1; } } /* parse in the try string */ if (strncmp(line,"TRY",3) == 0) { if (parse_string(line, &trystring, afflst->getlinenum())) { delete afflst; return 1; } } /* parse in the name of the character set used by the .dict and .aff */ if (strncmp(line,"SET",3) == 0) { if (parse_string(line, &encoding, afflst->getlinenum())) { delete afflst; return 1; } if (strcmp(encoding, "UTF-8") == 0) { utf8 = 1; #ifndef OPENOFFICEORG #ifndef MOZILLA_CLIENT if (initialize_utf_tbl()) return 1; #endif #endif } } /* parse COMPLEXPREFIXES for agglutinative languages with right-to-left writing system */ if (strncmp(line,"COMPLEXPREFIXES",15) == 0) complexprefixes = 1; /* parse in the flag used by the controlled compound words */ if (strncmp(line,"COMPOUNDFLAG",12) == 0) { if (parse_flag(line, &compoundflag, afflst)) { delete afflst; return 1; } } /* parse in the flag used by compound words */ if (strncmp(line,"COMPOUNDBEGIN",13) == 0) { if (complexprefixes) { if (parse_flag(line, &compoundend, afflst)) { delete afflst; return 1; } } else { if (parse_flag(line, &compoundbegin, afflst)) { delete afflst; return 1; } } } /* parse in the flag used by compound words */ if (strncmp(line,"COMPOUNDMIDDLE",14) == 0) { if (parse_flag(line, &compoundmiddle, afflst)) { delete afflst; return 1; } } /* parse in the flag used by compound words */ if (strncmp(line,"COMPOUNDEND",11) == 0) { if (complexprefixes) { if (parse_flag(line, &compoundbegin, afflst)) { delete afflst; return 1; } } else { if (parse_flag(line, &compoundend, afflst)) { delete afflst; return 1; } } } /* parse in the data used by compound_check() method */ if (strncmp(line,"COMPOUNDWORDMAX",15) == 0) { if (parse_num(line, &cpdwordmax, afflst)) { delete afflst; return 1; } } /* parse in the flag sign compounds in dictionary */ if (strncmp(line,"COMPOUNDROOT",12) == 0) { if (parse_flag(line, &compoundroot, afflst)) { delete afflst; return 1; } } /* parse in the flag used by compound_check() method */ if (strncmp(line,"COMPOUNDPERMITFLAG",18) == 0) { if (parse_flag(line, &compoundpermitflag, afflst)) { delete afflst; return 1; } } /* parse in the flag used by compound_check() method */ if (strncmp(line,"COMPOUNDFORBIDFLAG",18) == 0) { if (parse_flag(line, &compoundforbidflag, afflst)) { delete afflst; return 1; } } if (strncmp(line,"CHECKCOMPOUNDDUP",16) == 0) { checkcompounddup = 1; } if (strncmp(line,"CHECKCOMPOUNDREP",16) == 0) { checkcompoundrep = 1; } if (strncmp(line,"CHECKCOMPOUNDTRIPLE",19) == 0) { checkcompoundtriple = 1; } if (strncmp(line,"SIMPLIFIEDTRIPLE",16) == 0) { simplifiedtriple = 1; } if (strncmp(line,"CHECKCOMPOUNDCASE",17) == 0) { checkcompoundcase = 1; } if (strncmp(line,"NOSUGGEST",9) == 0) { if (parse_flag(line, &nosuggest, afflst)) { delete afflst; return 1; } } /* parse in the flag used by forbidden words */ if (strncmp(line,"FORBIDDENWORD",13) == 0) { if (parse_flag(line, &forbiddenword, afflst)) { delete afflst; return 1; } } /* parse in the flag used by forbidden words */ if (strncmp(line,"LEMMA_PRESENT",13) == 0) { if (parse_flag(line, &lemma_present, afflst)) { delete afflst; return 1; } } /* parse in the flag used by circumfixes */ if (strncmp(line,"CIRCUMFIX",9) == 0) { if (parse_flag(line, &circumfix, afflst)) { delete afflst; return 1; } } /* parse in the flag used by fogemorphemes */ if (strncmp(line,"ONLYINCOMPOUND",14) == 0) { if (parse_flag(line, &onlyincompound, afflst)) { delete afflst; return 1; } } /* parse in the flag used by `needaffixs' */ if (strncmp(line,"PSEUDOROOT",10) == 0) { if (parse_flag(line, &needaffix, afflst)) { delete afflst; return 1; } } /* parse in the flag used by `needaffixs' */ if (strncmp(line,"NEEDAFFIX",9) == 0) { if (parse_flag(line, &needaffix, afflst)) { delete afflst; return 1; } } /* parse in the minimal length for words in compounds */ if (strncmp(line,"COMPOUNDMIN",11) == 0) { if (parse_num(line, &cpdmin, afflst)) { delete afflst; return 1; } if (cpdmin < 1) cpdmin = 1; } /* parse in the max. words and syllables in compounds */ if (strncmp(line,"COMPOUNDSYLLABLE",16) == 0) { if (parse_cpdsyllable(line, afflst)) { delete afflst; return 1; } } /* parse in the flag used by compound_check() method */ if (strncmp(line,"SYLLABLENUM",11) == 0) { if (parse_string(line, &cpdsyllablenum, afflst->getlinenum())) { delete afflst; return 1; } } /* parse in the flag used by the controlled compound words */ if (strncmp(line,"CHECKNUM",8) == 0) { checknum=1; } /* parse in the extra word characters */ if (strncmp(line,"WORDCHARS",9) == 0) { if (parse_array(line, &wordchars, &wordchars_utf16, &wordchars_utf16_len, utf8, afflst->getlinenum())) { delete afflst; return 1; } } /* parse in the ignored characters (for example, Arabic optional diacretics charachters */ if (strncmp(line,"IGNORE",6) == 0) { if (parse_array(line, &ignorechars, &ignorechars_utf16, &ignorechars_utf16_len, utf8, afflst->getlinenum())) { delete afflst; return 1; } } /* parse in the typical fault correcting table */ if (strncmp(line,"REP",3) == 0) { if (parse_reptable(line, afflst)) { delete afflst; return 1; } } /* parse in the input conversion table */ if (strncmp(line,"ICONV",5) == 0) { if (parse_convtable(line, afflst, &iconvtable, "ICONV")) { delete afflst; return 1; } } /* parse in the input conversion table */ if (strncmp(line,"OCONV",5) == 0) { if (parse_convtable(line, afflst, &oconvtable, "OCONV")) { delete afflst; return 1; } } /* parse in the phonetic translation table */ if (strncmp(line,"PHONE",5) == 0) { if (parse_phonetable(line, afflst)) { delete afflst; return 1; } } /* parse in the checkcompoundpattern table */ if (strncmp(line,"CHECKCOMPOUNDPATTERN",20) == 0) { if (parse_checkcpdtable(line, afflst)) { delete afflst; return 1; } } /* parse in the defcompound table */ if (strncmp(line,"COMPOUNDRULE",12) == 0) { if (parse_defcpdtable(line, afflst)) { delete afflst; return 1; } } /* parse in the related character map table */ if (strncmp(line,"MAP",3) == 0) { if (parse_maptable(line, afflst)) { delete afflst; return 1; } } /* parse in the word breakpoints table */ if (strncmp(line,"BREAK",5) == 0) { if (parse_breaktable(line, afflst)) { delete afflst; return 1; } } /* parse in the language for language specific codes */ if (strncmp(line,"LANG",4) == 0) { if (parse_string(line, &lang, afflst->getlinenum())) { delete afflst; return 1; } langnum = get_lang_num(lang); } if (strncmp(line,"VERSION",7) == 0) { for(line = line + 7; *line == ' ' || *line == '\t'; line++); version = mystrdup(line); } if (strncmp(line,"MAXNGRAMSUGS",12) == 0) { if (parse_num(line, &maxngramsugs, afflst)) { delete afflst; return 1; } } if (strncmp(line,"NOSPLITSUGS",11) == 0) { nosplitsugs=1; } if (strncmp(line,"FULLSTRIP",9) == 0) { fullstrip=1; } if (strncmp(line,"SUGSWITHDOTS",12) == 0) { sugswithdots=1; } /* parse in the flag used by forbidden words */ if (strncmp(line,"KEEPCASE",8) == 0) { if (parse_flag(line, &keepcase, afflst)) { delete afflst; return 1; } } /* parse in the flag used by the affix generator */ if (strncmp(line,"SUBSTANDARD",11) == 0) { if (parse_flag(line, &substandard, afflst)) { delete afflst; return 1; } } if (strncmp(line,"CHECKSHARPS",11) == 0) { checksharps=1; } /* parse this affix: P - prefix, S - suffix */ ft = ' '; if (strncmp(line,"PFX",3) == 0) ft = complexprefixes ? 'S' : 'P'; if (strncmp(line,"SFX",3) == 0) ft = complexprefixes ? 'P' : 'S'; if (ft != ' ') { if (dupflags_ini) { memset(dupflags, 0, sizeof(dupflags)); dupflags_ini = 0; } if (parse_affix(line, ft, afflst, dupflags)) { delete afflst; process_pfx_tree_to_list(); process_sfx_tree_to_list(); return 1; } } } delete afflst; // convert affix trees to sorted list process_pfx_tree_to_list(); process_sfx_tree_to_list(); // now we can speed up performance greatly taking advantage of the // relationship between the affixes and the idea of "subsets". // View each prefix as a potential leading subset of another and view // each suffix (reversed) as a potential trailing subset of another. // To illustrate this relationship if we know the prefix "ab" is found in the // word to examine, only prefixes that "ab" is a leading subset of need be examined. // Furthermore is "ab" is not present then none of the prefixes that "ab" is // is a subset need be examined. // The same argument goes for suffix string that are reversed. // Then to top this off why not examine the first char of the word to quickly // limit the set of prefixes to examine (i.e. the prefixes to examine must // be leading supersets of the first character of the word (if they exist) // To take advantage of this "subset" relationship, we need to add two links // from entry. One to take next if the current prefix is found (call it nexteq) // and one to take next if the current prefix is not found (call it nextne). // Since we have built ordered lists, all that remains is to properly initialize // the nextne and nexteq pointers that relate them process_pfx_order(); process_sfx_order(); /* get encoding for CHECKCOMPOUNDCASE */ if (!utf8) { char * enc = get_encoding(); csconv = get_current_cs(enc); free(enc); enc = NULL; char expw[MAXLNLEN]; if (wordchars) { strcpy(expw, wordchars); free(wordchars); } else *expw = '\0'; for (int i = 0; i <= 255; i++) { if ( (csconv[i].cupper != csconv[i].clower) && (! strchr(expw, (char) i))) { *(expw + strlen(expw) + 1) = '\0'; *(expw + strlen(expw)) = (char) i; } } wordchars = mystrdup(expw); } // default BREAK definition if (!breaktable) { breaktable = (char **) malloc(sizeof(char *) * 3); if (!breaktable) return 1; breaktable[0] = mystrdup("-"); breaktable[1] = mystrdup("^-"); breaktable[2] = mystrdup("-$"); if (breaktable[0] && breaktable[1] && breaktable[2]) numbreak = 3; } return 0; } // we want to be able to quickly access prefix information // both by prefix flag, and sorted by prefix string itself // so we need to set up two indexes int AffixMgr::build_pfxtree(PfxEntry* pfxptr) { PfxEntry * ptr; PfxEntry * pptr; PfxEntry * ep = pfxptr; // get the right starting points const char * key = ep->getKey(); const unsigned char flg = (unsigned char) (ep->getFlag() & 0x00FF); // first index by flag which must exist ptr = pFlag[flg]; ep->setFlgNxt(ptr); pFlag[flg] = ep; // handle the special case of null affix string if (strlen(key) == 0) { // always inset them at head of list at element 0 ptr = pStart[0]; ep->setNext(ptr); pStart[0] = ep; return 0; } // now handle the normal case ep->setNextEQ(NULL); ep->setNextNE(NULL); unsigned char sp = *((const unsigned char *)key); ptr = pStart[sp]; // handle the first insert if (!ptr) { pStart[sp] = ep; return 0; } // otherwise use binary tree insertion so that a sorted // list can easily be generated later pptr = NULL; for (;;) { pptr = ptr; if (strcmp(ep->getKey(), ptr->getKey() ) <= 0) { ptr = ptr->getNextEQ(); if (!ptr) { pptr->setNextEQ(ep); break; } } else { ptr = ptr->getNextNE(); if (!ptr) { pptr->setNextNE(ep); break; } } } return 0; } // we want to be able to quickly access suffix information // both by suffix flag, and sorted by the reverse of the // suffix string itself; so we need to set up two indexes int AffixMgr::build_sfxtree(SfxEntry* sfxptr) { SfxEntry * ptr; SfxEntry * pptr; SfxEntry * ep = sfxptr; /* get the right starting point */ const char * key = ep->getKey(); const unsigned char flg = (unsigned char) (ep->getFlag() & 0x00FF); // first index by flag which must exist ptr = sFlag[flg]; ep->setFlgNxt(ptr); sFlag[flg] = ep; // next index by affix string // handle the special case of null affix string if (strlen(key) == 0) { // always inset them at head of list at element 0 ptr = sStart[0]; ep->setNext(ptr); sStart[0] = ep; return 0; } // now handle the normal case ep->setNextEQ(NULL); ep->setNextNE(NULL); unsigned char sp = *((const unsigned char *)key); ptr = sStart[sp]; // handle the first insert if (!ptr) { sStart[sp] = ep; return 0; } // otherwise use binary tree insertion so that a sorted // list can easily be generated later pptr = NULL; for (;;) { pptr = ptr; if (strcmp(ep->getKey(), ptr->getKey() ) <= 0) { ptr = ptr->getNextEQ(); if (!ptr) { pptr->setNextEQ(ep); break; } } else { ptr = ptr->getNextNE(); if (!ptr) { pptr->setNextNE(ep); break; } } } return 0; } // convert from binary tree to sorted list int AffixMgr::process_pfx_tree_to_list() { for (int i=1; i< SETSIZE; i++) { pStart[i] = process_pfx_in_order(pStart[i],NULL); } return 0; } PfxEntry* AffixMgr::process_pfx_in_order(PfxEntry* ptr, PfxEntry* nptr) { if (ptr) { nptr = process_pfx_in_order(ptr->getNextNE(), nptr); ptr->setNext(nptr); nptr = process_pfx_in_order(ptr->getNextEQ(), ptr); } return nptr; } // convert from binary tree to sorted list int AffixMgr:: process_sfx_tree_to_list() { for (int i=1; i< SETSIZE; i++) { sStart[i] = process_sfx_in_order(sStart[i],NULL); } return 0; } SfxEntry* AffixMgr::process_sfx_in_order(SfxEntry* ptr, SfxEntry* nptr) { if (ptr) { nptr = process_sfx_in_order(ptr->getNextNE(), nptr); ptr->setNext(nptr); nptr = process_sfx_in_order(ptr->getNextEQ(), ptr); } return nptr; } // reinitialize the PfxEntry links NextEQ and NextNE to speed searching // using the idea of leading subsets this time int AffixMgr::process_pfx_order() { PfxEntry* ptr; // loop through each prefix list starting point for (int i=1; i < SETSIZE; i++) { ptr = pStart[i]; // look through the remainder of the list // and find next entry with affix that // the current one is not a subset of // mark that as destination for NextNE // use next in list that you are a subset // of as NextEQ for (; ptr != NULL; ptr = ptr->getNext()) { PfxEntry * nptr = ptr->getNext(); for (; nptr != NULL; nptr = nptr->getNext()) { if (! isSubset( ptr->getKey() , nptr->getKey() )) break; } ptr->setNextNE(nptr); ptr->setNextEQ(NULL); if ((ptr->getNext()) && isSubset(ptr->getKey() , (ptr->getNext())->getKey())) ptr->setNextEQ(ptr->getNext()); } // now clean up by adding smart search termination strings: // if you are already a superset of the previous prefix // but not a subset of the next, search can end here // so set NextNE properly ptr = pStart[i]; for (; ptr != NULL; ptr = ptr->getNext()) { PfxEntry * nptr = ptr->getNext(); PfxEntry * mptr = NULL; for (; nptr != NULL; nptr = nptr->getNext()) { if (! isSubset(ptr->getKey(),nptr->getKey())) break; mptr = nptr; } if (mptr) mptr->setNextNE(NULL); } } return 0; } // initialize the SfxEntry links NextEQ and NextNE to speed searching // using the idea of leading subsets this time int AffixMgr::process_sfx_order() { SfxEntry* ptr; // loop through each prefix list starting point for (int i=1; i < SETSIZE; i++) { ptr = sStart[i]; // look through the remainder of the list // and find next entry with affix that // the current one is not a subset of // mark that as destination for NextNE // use next in list that you are a subset // of as NextEQ for (; ptr != NULL; ptr = ptr->getNext()) { SfxEntry * nptr = ptr->getNext(); for (; nptr != NULL; nptr = nptr->getNext()) { if (! isSubset(ptr->getKey(),nptr->getKey())) break; } ptr->setNextNE(nptr); ptr->setNextEQ(NULL); if ((ptr->getNext()) && isSubset(ptr->getKey(),(ptr->getNext())->getKey())) ptr->setNextEQ(ptr->getNext()); } // now clean up by adding smart search termination strings: // if you are already a superset of the previous suffix // but not a subset of the next, search can end here // so set NextNE properly ptr = sStart[i]; for (; ptr != NULL; ptr = ptr->getNext()) { SfxEntry * nptr = ptr->getNext(); SfxEntry * mptr = NULL; for (; nptr != NULL; nptr = nptr->getNext()) { if (! isSubset(ptr->getKey(),nptr->getKey())) break; mptr = nptr; } if (mptr) mptr->setNextNE(NULL); } } return 0; } // add flags to the result for dictionary debugging void AffixMgr::debugflag(char * result, unsigned short flag) { char * st = encode_flag(flag); mystrcat(result, " ", MAXLNLEN); mystrcat(result, MORPH_FLAG, MAXLNLEN); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } } // calculate the character length of the condition int AffixMgr::condlen(char * st) { int l = 0; bool group = false; for(; *st; st++) { if (*st == '[') { group = true; l++; } else if (*st == ']') group = false; else if (!group && (!utf8 || (!(*st & 0x80) || ((*st & 0xc0) == 0x80)))) l++; } return l; } int AffixMgr::encodeit(affentry &entry, char * cs) { if (strcmp(cs,".") != 0) { entry.numconds = (char) condlen(cs); strncpy(entry.c.conds, cs, MAXCONDLEN); // long condition (end of conds padded by strncpy) if (entry.c.conds[MAXCONDLEN - 1] && cs[MAXCONDLEN]) { entry.opts += aeLONGCOND; entry.c.l.conds2 = mystrdup(cs + MAXCONDLEN_1); if (!entry.c.l.conds2) return 1; } } else { entry.numconds = 0; entry.c.conds[0] = '\0'; } return 0; } // return 1 if s1 is a leading subset of s2 (dots are for infixes) inline int AffixMgr::isSubset(const char * s1, const char * s2) { while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0')) { s1++; s2++; } return (*s1 == '\0'); } // check word for prefixes struct hentry * AffixMgr::prefix_check(const char * word, int len, char in_compound, const FLAG needflag) { struct hentry * rv= NULL; pfx = NULL; pfxappnd = NULL; sfxappnd = NULL; // first handle the special case of 0 length prefixes PfxEntry * pe = pStart[0]; while (pe) { if ( // fogemorpheme ((in_compound != IN_CPD_NOT) || !(pe->getCont() && (TESTAFF(pe->getCont(), onlyincompound, pe->getContLen())))) && // permit prefixes in compounds ((in_compound != IN_CPD_END) || (pe->getCont() && (TESTAFF(pe->getCont(), compoundpermitflag, pe->getContLen())))) ) { // check prefix rv = pe->checkword(word, len, in_compound, needflag); if (rv) { pfx=pe; // BUG: pfx not stateless return rv; } } pe = pe->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)word); PfxEntry * pptr = pStart[sp]; while (pptr) { if (isSubset(pptr->getKey(),word)) { if ( // fogemorpheme ((in_compound != IN_CPD_NOT) || !(pptr->getCont() && (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen())))) && // permit prefixes in compounds ((in_compound != IN_CPD_END) || (pptr->getCont() && (TESTAFF(pptr->getCont(), compoundpermitflag, pptr->getContLen())))) ) { // check prefix rv = pptr->checkword(word, len, in_compound, needflag); if (rv) { pfx=pptr; // BUG: pfx not stateless return rv; } } pptr = pptr->getNextEQ(); } else { pptr = pptr->getNextNE(); } } return NULL; } // check word for prefixes struct hentry * AffixMgr::prefix_check_twosfx(const char * word, int len, char in_compound, const FLAG needflag) { struct hentry * rv= NULL; pfx = NULL; sfxappnd = NULL; // first handle the special case of 0 length prefixes PfxEntry * pe = pStart[0]; while (pe) { rv = pe->check_twosfx(word, len, in_compound, needflag); if (rv) return rv; pe = pe->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)word); PfxEntry * pptr = pStart[sp]; while (pptr) { if (isSubset(pptr->getKey(),word)) { rv = pptr->check_twosfx(word, len, in_compound, needflag); if (rv) { pfx = pptr; return rv; } pptr = pptr->getNextEQ(); } else { pptr = pptr->getNextNE(); } } return NULL; } // check word for prefixes char * AffixMgr::prefix_check_morph(const char * word, int len, char in_compound, const FLAG needflag) { char * st; char result[MAXLNLEN]; result[0] = '\0'; pfx = NULL; sfxappnd = NULL; // first handle the special case of 0 length prefixes PfxEntry * pe = pStart[0]; while (pe) { st = pe->check_morph(word,len,in_compound, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } // if (rv) return rv; pe = pe->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)word); PfxEntry * pptr = pStart[sp]; while (pptr) { if (isSubset(pptr->getKey(),word)) { st = pptr->check_morph(word,len,in_compound, needflag); if (st) { // fogemorpheme if ((in_compound != IN_CPD_NOT) || !((pptr->getCont() && (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen()))))) { mystrcat(result, st, MAXLNLEN); pfx = pptr; } free(st); } pptr = pptr->getNextEQ(); } else { pptr = pptr->getNextNE(); } } if (*result) return mystrdup(result); return NULL; } // check word for prefixes char * AffixMgr::prefix_check_twosfx_morph(const char * word, int len, char in_compound, const FLAG needflag) { char * st; char result[MAXLNLEN]; result[0] = '\0'; pfx = NULL; sfxappnd = NULL; // first handle the special case of 0 length prefixes PfxEntry * pe = pStart[0]; while (pe) { st = pe->check_twosfx_morph(word,len,in_compound, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } pe = pe->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)word); PfxEntry * pptr = pStart[sp]; while (pptr) { if (isSubset(pptr->getKey(),word)) { st = pptr->check_twosfx_morph(word, len, in_compound, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); pfx = pptr; } pptr = pptr->getNextEQ(); } else { pptr = pptr->getNextNE(); } } if (*result) return mystrdup(result); return NULL; } // Is word a non compound with a REP substitution (see checkcompoundrep)? int AffixMgr::cpdrep_check(const char * word, int wl) { char candidate[MAXLNLEN]; const char * r; int lenr, lenp; if ((wl < 2) || !numrep) return 0; for (int i=0; i < numrep; i++ ) { r = word; lenr = strlen(reptable[i].pattern2); lenp = strlen(reptable[i].pattern); // search every occurence of the pattern in the word while ((r=strstr(r, reptable[i].pattern)) != NULL) { strcpy(candidate, word); if (r-word + lenr + strlen(r+lenp) >= MAXLNLEN) break; strcpy(candidate+(r-word),reptable[i].pattern2); strcpy(candidate+(r-word)+lenr, r+lenp); if (candidate_check(candidate,strlen(candidate))) return 1; r++; // search for the next letter } } return 0; } // forbid compoundings when there are special patterns at word bound int AffixMgr::cpdpat_check(const char * word, int pos, hentry * r1, hentry * r2) { int len; for (int i = 0; i < numcheckcpd; i++) { if (isSubset(checkcpdtable[i].pattern2, word + pos) && (!r1 || !checkcpdtable[i].cond || (r1->astr && TESTAFF(r1->astr, checkcpdtable[i].cond, r1->alen))) && (!r2 || !checkcpdtable[i].cond2 || (r2->astr && TESTAFF(r2->astr, checkcpdtable[i].cond2, r2->alen))) && (len = strlen(checkcpdtable[i].pattern)) && (pos > len) && (strncmp(word + pos - len, checkcpdtable[i].pattern, len) == 0)) return 1; } return 0; } // forbid compounding with neighbouring upper and lower case characters at word bounds int AffixMgr::cpdcase_check(const char * word, int pos) { if (utf8) { w_char u, w; const char * p; u8_u16(&u, 1, word + pos); for (p = word + pos - 1; (*p & 0xc0) == 0x80; p--); u8_u16(&w, 1, p); unsigned short a = (u.h << 8) + u.l; unsigned short b = (w.h << 8) + w.l; if (((unicodetoupper(a, langnum) == a) || (unicodetoupper(b, langnum) == b)) && (a != '-') && (b != '-')) return 1; } else { unsigned char a = *(word + pos - 1); unsigned char b = *(word + pos); if ((csconv[a].ccase || csconv[b].ccase) && (a != '-') && (b != '-')) return 1; } return 0; } // check compound patterns int AffixMgr::defcpd_check(hentry *** words, short wnum, hentry * rv, hentry ** def, char all) { signed short btpp[MAXWORDLEN]; // metacharacter (*, ?) positions for backtracking signed short btwp[MAXWORDLEN]; // word positions for metacharacters int btnum[MAXWORDLEN]; // number of matched characters in metacharacter positions short bt = 0; int i, j; int ok; int w = 0; if (!*words) { w = 1; *words = def; } if (!*words) { return 0; } (*words)[wnum] = rv; // has the last word COMPOUNDRULE flag? if (rv->alen == 0) { (*words)[wnum] = NULL; if (w) *words = NULL; return 0; } ok = 0; for (i = 0; i < numdefcpd; i++) { for (j = 0; j < defcpdtable[i].len; j++) { if (defcpdtable[i].def[j] != '*' && defcpdtable[i].def[j] != '?' && TESTAFF(rv->astr, defcpdtable[i].def[j], rv->alen)) ok = 1; } } if (ok == 0) { (*words)[wnum] = NULL; if (w) *words = NULL; return 0; } for (i = 0; i < numdefcpd; i++) { signed short pp = 0; // pattern position signed short wp = 0; // "words" position int ok2; ok = 1; ok2 = 1; do { while ((pp < defcpdtable[i].len) && (wp <= wnum)) { if (((pp+1) < defcpdtable[i].len) && ((defcpdtable[i].def[pp+1] == '*') || (defcpdtable[i].def[pp+1] == '?'))) { int wend = (defcpdtable[i].def[pp+1] == '?') ? wp : wnum; ok2 = 1; pp+=2; btpp[bt] = pp; btwp[bt] = wp; while (wp <= wend) { if (!(*words)[wp]->alen || !TESTAFF((*words)[wp]->astr, defcpdtable[i].def[pp-2], (*words)[wp]->alen)) { ok2 = 0; break; } wp++; } if (wp <= wnum) ok2 = 0; btnum[bt] = wp - btwp[bt]; if (btnum[bt] > 0) bt++; if (ok2) break; } else { ok2 = 1; if (!(*words)[wp] || !(*words)[wp]->alen || !TESTAFF((*words)[wp]->astr, defcpdtable[i].def[pp], (*words)[wp]->alen)) { ok = 0; break; } pp++; wp++; if ((defcpdtable[i].len == pp) && !(wp > wnum)) ok = 0; } } if (ok && ok2) { int r = pp; while ((defcpdtable[i].len > r) && ((r+1) < defcpdtable[i].len) && ((defcpdtable[i].def[r+1] == '*') || (defcpdtable[i].def[r+1] == '?'))) r+=2; if (defcpdtable[i].len <= r) return 1; } // backtrack if (bt) do { ok = 1; btnum[bt - 1]--; pp = btpp[bt - 1]; wp = btwp[bt - 1] + (signed short) btnum[bt - 1]; } while ((btnum[bt - 1] < 0) && --bt); } while (bt); if (ok && ok2 && (!all || (defcpdtable[i].len <= pp))) return 1; // check zero ending while (ok && ok2 && (defcpdtable[i].len > pp) && ((pp+1) < defcpdtable[i].len) && ((defcpdtable[i].def[pp+1] == '*') || (defcpdtable[i].def[pp+1] == '?'))) pp+=2; if (ok && ok2 && (defcpdtable[i].len <= pp)) return 1; } (*words)[wnum] = NULL; if (w) *words = NULL; return 0; } inline int AffixMgr::candidate_check(const char * word, int len) { struct hentry * rv=NULL; rv = lookup(word); if (rv) return 1; // rv = prefix_check(word,len,1); // if (rv) return 1; rv = affix_check(word,len); if (rv) return 1; return 0; } // calculate number of syllable for compound-checking short AffixMgr::get_syllable(const char * word, int wlen) { if (cpdmaxsyllable==0) return 0; short num=0; if (!utf8) { for (int i=0; i 0; i--) { if (flag_bsearch((unsigned short *) cpdvowels_utf16, ((unsigned short *) w)[i - 1], cpdvowels_utf16_len)) num++; } } return num; } void AffixMgr::setcminmax(int * cmin, int * cmax, const char * word, int len) { if (utf8) { int i; for (*cmin = 0, i = 0; (i < cpdmin) && word[*cmin]; i++) { for ((*cmin)++; (word[*cmin] & 0xc0) == 0x80; (*cmin)++); } for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax; i++) { for ((*cmax)--; (word[*cmax] & 0xc0) == 0x80; (*cmax)--); } } else { *cmin = cpdmin; *cmax = len - cpdmin + 1; } } // check if compound word is correctly spelled // hu_mov_rule = spec. Hungarian rule (XXX) struct hentry * AffixMgr::compound_check(const char * word, int len, short wordnum, short numsyllable, short maxwordnum, short wnum, hentry ** words = NULL, char hu_mov_rule = 0, char is_sug = 0) { int i; short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2; struct hentry * rv = NULL; struct hentry * rv_first; struct hentry * rwords[MAXWORDLEN]; // buffer for COMPOUND pattern checking char st [MAXWORDUTF8LEN + 4]; char ch; int cmin; int cmax; int striple = 0; int scpd = 0; int soldi = 0; int oldcmin = 0; int oldcmax = 0; int oldlen = 0; int checkedstriple = 0; int checked_prefix; setcminmax(&cmin, &cmax, word, len); strcpy(st, word); for (i = cmin; i < cmax; i++) { oldnumsyllable = numsyllable; oldwordnum = wordnum; checked_prefix = 0; // go to end of the UTF-8 character if (utf8) { for (; (st[i] & 0xc0) == 0x80; i++); if (i >= cmax) return NULL; } do { // simplified checkcompoundpattern loop if (scpd > 0) { for (; scpd <= numcheckcpd && (!checkcpdtable[scpd-1].pattern3 || strncmp(word + i, checkcpdtable[scpd-1].pattern3, strlen(checkcpdtable[scpd-1].pattern3)) != 0); scpd++); if (scpd > numcheckcpd) break; // break simplified checkcompoundpattern loop strcpy(st + i, checkcpdtable[scpd-1].pattern); soldi = i; i += strlen(checkcpdtable[scpd-1].pattern); strcpy(st + i, checkcpdtable[scpd-1].pattern2); strcpy(st + i + strlen(checkcpdtable[scpd-1].pattern2), word + soldi + strlen(checkcpdtable[scpd-1].pattern3)); oldlen = len; len += strlen(checkcpdtable[scpd-1].pattern) + strlen(checkcpdtable[scpd-1].pattern2) - strlen(checkcpdtable[scpd-1].pattern3); oldcmin = cmin; oldcmax = cmax; setcminmax(&cmin, &cmax, st, len); cmax = len - cpdmin + 1; } ch = st[i]; st[i] = '\0'; sfx = NULL; pfx = NULL; // FIRST WORD rv = lookup(st); // perhaps without prefix // search homonym with compound flag while ((rv) && !hu_mov_rule && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || (compoundbegin && !wordnum && TESTAFF(rv->astr, compoundbegin, rv->alen)) || (compoundmiddle && wordnum && !words && TESTAFF(rv->astr, compoundmiddle, rv->alen)) || (numdefcpd && ((!words && !wordnum && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)) || (words && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0))))) || (scpd != 0 && checkcpdtable[scpd-1].cond != FLAG_NULL && !TESTAFF(rv->astr, checkcpdtable[scpd-1].cond, rv->alen))) ) { rv = rv->next_homonym; } if (!rv) { if (compoundflag && !(rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundflag))) { if ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) && !hu_mov_rule && sfx->getCont() && ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())) || (compoundend && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) { rv = NULL; } } if (rv || (((wordnum == 0) && compoundbegin && ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundbegin)))) || ((wordnum > 0) && compoundmiddle && ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle))))) ) checked_prefix = 1; // else check forbiddenwords and needaffix } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) || TESTAFF(rv->astr, needaffix, rv->alen) || (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)) )) { st[i] = ch; continue; } // check non_compound flag in suffix and prefix if ((rv) && !hu_mov_rule && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())))) { rv = NULL; } // check compoundend flag in suffix and prefix if ((rv) && !checked_prefix && compoundend && !hu_mov_rule && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundend, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) { rv = NULL; } // check compoundmiddle flag in suffix and prefix if ((rv) && !checked_prefix && (wordnum==0) && compoundmiddle && !hu_mov_rule && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundmiddle, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundmiddle, sfx->getContLen())))) { rv = NULL; } // check forbiddenwords if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) { return NULL; } // increment word number, if the second root has a compoundroot flag if ((rv) && compoundroot && (TESTAFF(rv->astr, compoundroot, rv->alen))) { wordnum++; } // first word is acceptable in compound words? if (((rv) && ( checked_prefix || (words && words[wnum]) || (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || ((oldwordnum == 0) && compoundbegin && TESTAFF(rv->astr, compoundbegin, rv->alen)) || ((oldwordnum > 0) && compoundmiddle && TESTAFF(rv->astr, compoundmiddle, rv->alen))// || // (numdefcpd && ) // LANG_hu section: spec. Hungarian rule || ((langnum == LANG_hu) && hu_mov_rule && ( TESTAFF(rv->astr, 'F', rv->alen) || // XXX hardwired Hungarian dictionary codes TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen) ) ) // END of LANG_hu section ) && ( // test CHECKCOMPOUNDPATTERN conditions scpd == 0 || checkcpdtable[scpd-1].cond == FLAG_NULL || TESTAFF(rv->astr, checkcpdtable[scpd-1].cond, rv->alen) ) && ! (( checkcompoundtriple && scpd == 0 && !words && // test triple letters (word[i-1]==word[i]) && ( ((i>1) && (word[i-1]==word[i-2])) || ((word[i-1]==word[i+1])) // may be word[i+1] == '\0' ) ) || ( checkcompoundcase && scpd == 0 && !words && cpdcase_check(word, i) )) ) // LANG_hu section: spec. Hungarian rule || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st,i)) && (sfx && sfx->getCont() && ( // XXX hardwired Hungarian dic. codes TESTAFF(sfx->getCont(), (unsigned short) 'x', sfx->getContLen()) || TESTAFF(sfx->getCont(), (unsigned short) '%', sfx->getContLen()) ) ) ) ) { // first word is ok condition // LANG_hu section: spec. Hungarian rule if (langnum == LANG_hu) { // calculate syllable number of the word numsyllable += get_syllable(st, i); // + 1 word, if syllable number of the prefix > 1 (hungarian convention) if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; } // END of LANG_hu section // NEXT WORD(S) rv_first = rv; st[i] = ch; do { // striple loop // check simplifiedtriple if (simplifiedtriple) { if (striple) { checkedstriple = 1; i--; // check "fahrt" instead of "ahrt" in "Schiffahrt" } else if (i > 2 && *(word+i - 1) == *(word + i - 2)) striple = 1; } rv = lookup((st+i)); // perhaps without prefix // search homonym with compound flag while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) || (numdefcpd && words && defcpd_check(&words, wnum + 1, rv, NULL,1))) || (scpd != 0 && checkcpdtable[scpd-1].cond2 != FLAG_NULL && !TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen)) )) { rv = rv->next_homonym; } if (rv && words && words[wnum + 1]) return rv_first; oldnumsyllable2 = numsyllable; oldwordnum2 = wordnum; // LANG_hu section: spec. Hungarian rule, XXX hardwired dictionary code if ((rv) && (langnum == LANG_hu) && (TESTAFF(rv->astr, 'I', rv->alen)) && !(TESTAFF(rv->astr, 'J', rv->alen))) { numsyllable--; } // END of LANG_hu section // increment word number, if the second root has a compoundroot flag if ((rv) && (compoundroot) && (TESTAFF(rv->astr, compoundroot, rv->alen))) { wordnum++; } // check forbiddenwords if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) return NULL; // second word is acceptable, as a root? // hungarian conventions: compounding is acceptable, // when compound forms consist of 2 words, or if more, // then the syllable number of root words must be 6, or lesser. if ((rv) && ( (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || (compoundend && TESTAFF(rv->astr, compoundend, rv->alen)) ) && ( ((cpdwordmax==-1) || (wordnum+1clen)<=cpdmaxsyllable)) ) && ( // test CHECKCOMPOUNDPATTERN !numcheckcpd || scpd != 0 || !cpdpat_check(word, i, rv_first, rv) ) && ( (!checkcompounddup || (rv != rv_first)) ) // test CHECKCOMPOUNDPATTERN conditions && (scpd == 0 || checkcpdtable[scpd-1].cond2 == FLAG_NULL || TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen)) ) { // forbid compound word, if it is a non compound word with typical fault if (checkcompoundrep && cpdrep_check(word,len)) return NULL; return rv_first; } numsyllable = oldnumsyllable2; wordnum = oldwordnum2; // perhaps second word has prefix or/and suffix sfx = NULL; sfxflag = FLAG_NULL; rv = (compoundflag) ? affix_check((word+i),strlen(word+i), compoundflag, IN_CPD_END) : NULL; if (!rv && compoundend) { sfx = NULL; pfx = NULL; rv = affix_check((word+i),strlen(word+i), compoundend, IN_CPD_END); } if (!rv && numdefcpd && words) { rv = affix_check((word+i),strlen(word+i), 0, IN_CPD_END); if (rv && defcpd_check(&words, wnum + 1, rv, NULL, 1)) return rv_first; rv = NULL; } // test CHECKCOMPOUNDPATTERN conditions (allowed forms) if (rv && !(scpd == 0 || checkcpdtable[scpd-1].cond2 == FLAG_NULL || TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen))) rv = NULL; // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds) if (rv && numcheckcpd && scpd == 0 && cpdpat_check(word, i, rv_first, rv)) rv = NULL; // check non_compound flag in suffix and prefix if ((rv) && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())))) { rv = NULL; } // check forbiddenwords if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)))) return NULL; // pfxappnd = prefix of word+i, or NULL // calculate syllable number of prefix. // hungarian convention: when syllable number of prefix is more, // than 1, the prefix+word counts as two words. if (langnum == LANG_hu) { // calculate syllable number of the word numsyllable += get_syllable(word + i, strlen(word + i)); // - affix syllable num. // XXX only second suffix (inflections, not derivations) if (sfxappnd) { char * tmp = myrevstrdup(sfxappnd); numsyllable -= get_syllable(tmp, strlen(tmp)); free(tmp); } // + 1 word, if syllable number of the prefix > 1 (hungarian convention) if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; // increment syllable num, if last word has a SYLLABLENUM flag // and the suffix is beginning `s' if (cpdsyllablenum) { switch (sfxflag) { case 'c': { numsyllable+=2; break; } case 'J': { numsyllable += 1; break; } case 'I': { if (TESTAFF(rv->astr, 'J', rv->alen)) numsyllable += 1; break; } } } } // increment word number, if the second word has a compoundroot flag if ((rv) && (compoundroot) && (TESTAFF(rv->astr, compoundroot, rv->alen))) { wordnum++; } // second word is acceptable, as a word with prefix or/and suffix? // hungarian conventions: compounding is acceptable, // when compound forms consist 2 word, otherwise // the syllable number of root words is 6, or lesser. if ((rv) && ( ((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) || ((cpdmaxsyllable != 0) && (numsyllable <= cpdmaxsyllable)) ) && ( (!checkcompounddup || (rv != rv_first)) )) { // forbid compound word, if it is a non compound word with typical fault if (checkcompoundrep && cpdrep_check(word, len)) return NULL; return rv_first; } numsyllable = oldnumsyllable2; wordnum = oldwordnum2; // perhaps second word is a compound word (recursive call) if (wordnum < maxwordnum) { rv = compound_check((st+i),strlen(st+i), wordnum+1, numsyllable, maxwordnum, wnum + 1, words, 0, is_sug); if (rv && numcheckcpd && ((scpd == 0 && cpdpat_check(word, i, rv_first, rv)) || (scpd != 0 && !cpdpat_check(word, i, rv_first, rv)))) rv = NULL; } else { rv=NULL; } if (rv) { // forbid compound word, if it is a non compound word with typical fault if (checkcompoundrep && cpdrep_check(word, len)) return NULL; return rv_first; } } while (striple && !checkedstriple); // end of striple loop if (checkedstriple) { i++; checkedstriple = 0; striple = 0; } } // first word is ok condition if (soldi != 0) { i = soldi; soldi = 0; len = oldlen; cmin = oldcmin; cmax = oldcmax; } scpd++; } while (simplifiedcpd && scpd <= numcheckcpd); // end of simplifiedcpd loop if (soldi != 0) { i = soldi; strcpy(st, word); // XXX add more optim. soldi = 0; } else st[i] = ch; scpd = 0; wordnum = oldwordnum; numsyllable = oldnumsyllable; } return NULL; } // check if compound word is correctly spelled // hu_mov_rule = spec. Hungarian rule (XXX) int AffixMgr::compound_check_morph(const char * word, int len, short wordnum, short numsyllable, short maxwordnum, short wnum, hentry ** words, char hu_mov_rule = 0, char ** result = NULL, char * partresult = NULL) { int i; short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2; int ok = 0; struct hentry * rv = NULL; struct hentry * rv_first; struct hentry * rwords[MAXWORDLEN]; // buffer for COMPOUND pattern checking char st [MAXWORDUTF8LEN + 4]; char ch; int checked_prefix; char presult[MAXLNLEN]; int cmin; int cmax; setcminmax(&cmin, &cmax, word, len); strcpy(st, word); for (i = cmin; i < cmax; i++) { oldnumsyllable = numsyllable; oldwordnum = wordnum; checked_prefix = 0; // go to end of the UTF-8 character if (utf8) { for (; (st[i] & 0xc0) == 0x80; i++); if (i >= cmax) return 0; } ch = st[i]; st[i] = '\0'; sfx = NULL; // FIRST WORD *presult = '\0'; if (partresult) mystrcat(presult, partresult, MAXLNLEN); rv = lookup(st); // perhaps without prefix // search homonym with compound flag while ((rv) && !hu_mov_rule && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || (compoundbegin && !wordnum && TESTAFF(rv->astr, compoundbegin, rv->alen)) || (compoundmiddle && wordnum && !words && TESTAFF(rv->astr, compoundmiddle, rv->alen)) || (numdefcpd && ((!words && !wordnum && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)) || (words && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)))) ))) { rv = rv->next_homonym; } if (rv) { sprintf(presult + strlen(presult), "%c%s%s", MSEP_FLD, MORPH_PART, st); if (!HENTRY_FIND(rv, MORPH_STEM)) { sprintf(presult + strlen(presult), "%c%s%s", MSEP_FLD, MORPH_STEM, st); } // store the pointer of the hash entry // sprintf(presult + strlen(presult), "%c%s%p", MSEP_FLD, MORPH_HENTRY, rv); if (HENTRY_DATA(rv)) { sprintf(presult + strlen(presult), "%c%s", MSEP_FLD, HENTRY_DATA2(rv)); } } if (!rv) { if (compoundflag && !(rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundflag))) { if ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundflag, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) && !hu_mov_rule && sfx->getCont() && ((compoundforbidflag && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())) || (compoundend && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) { rv = NULL; } } if (rv || (((wordnum == 0) && compoundbegin && ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundbegin)))) || ((wordnum > 0) && compoundmiddle && ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle))))) ) { // char * p = prefix_check_morph(st, i, 0, compound); char * p = NULL; if (compoundflag) p = affix_check_morph(st, i, compoundflag); if (!p || (*p == '\0')) { if (p) free(p); p = NULL; if ((wordnum == 0) && compoundbegin) { p = affix_check_morph(st, i, compoundbegin); } else if ((wordnum > 0) && compoundmiddle) { p = affix_check_morph(st, i, compoundmiddle); } } if (p && (*p != '\0')) { sprintf(presult + strlen(presult), "%c%s%s%s", MSEP_FLD, MORPH_PART, st, line_uniq_app(&p, MSEP_REC)); } if (p) free(p); checked_prefix = 1; } // else check forbiddenwords } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) || TESTAFF(rv->astr, needaffix, rv->alen))) { st[i] = ch; continue; } // check non_compound flag in suffix and prefix if ((rv) && !hu_mov_rule && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())))) { continue; } // check compoundend flag in suffix and prefix if ((rv) && !checked_prefix && compoundend && !hu_mov_rule && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundend, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundend, sfx->getContLen())))) { continue; } // check compoundmiddle flag in suffix and prefix if ((rv) && !checked_prefix && (wordnum==0) && compoundmiddle && !hu_mov_rule && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundmiddle, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundmiddle, sfx->getContLen())))) { rv = NULL; } // check forbiddenwords if ((rv) && (rv->astr) && TESTAFF(rv->astr, forbiddenword, rv->alen)) continue; // increment word number, if the second root has a compoundroot flag if ((rv) && (compoundroot) && (TESTAFF(rv->astr, compoundroot, rv->alen))) { wordnum++; } // first word is acceptable in compound words? if (((rv) && ( checked_prefix || (words && words[wnum]) || (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || ((oldwordnum == 0) && compoundbegin && TESTAFF(rv->astr, compoundbegin, rv->alen)) || ((oldwordnum > 0) && compoundmiddle && TESTAFF(rv->astr, compoundmiddle, rv->alen)) // LANG_hu section: spec. Hungarian rule || ((langnum == LANG_hu) && // hu_mov_rule hu_mov_rule && ( TESTAFF(rv->astr, 'F', rv->alen) || TESTAFF(rv->astr, 'G', rv->alen) || TESTAFF(rv->astr, 'H', rv->alen) ) ) // END of LANG_hu section ) && ! (( checkcompoundtriple && !words && // test triple letters (word[i-1]==word[i]) && ( ((i>1) && (word[i-1]==word[i-2])) || ((word[i-1]==word[i+1])) // may be word[i+1] == '\0' ) ) || ( // test CHECKCOMPOUNDPATTERN numcheckcpd && !words && cpdpat_check(word, i, rv, NULL) ) || ( checkcompoundcase && !words && cpdcase_check(word, i) )) ) // LANG_hu section: spec. Hungarian rule || ((!rv) && (langnum == LANG_hu) && hu_mov_rule && (rv = affix_check(st,i)) && (sfx && sfx->getCont() && ( TESTAFF(sfx->getCont(), (unsigned short) 'x', sfx->getContLen()) || TESTAFF(sfx->getCont(), (unsigned short) '%', sfx->getContLen()) ) ) ) // END of LANG_hu section ) { // LANG_hu section: spec. Hungarian rule if (langnum == LANG_hu) { // calculate syllable number of the word numsyllable += get_syllable(st, i); // + 1 word, if syllable number of the prefix > 1 (hungarian convention) if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; } // END of LANG_hu section // NEXT WORD(S) rv_first = rv; rv = lookup((word+i)); // perhaps without prefix // search homonym with compound flag while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) || (numdefcpd && words && defcpd_check(&words, wnum + 1, rv, NULL,1))))) { rv = rv->next_homonym; } if (rv && words && words[wnum + 1]) { mystrcat(*result, presult, MAXLNLEN); mystrcat(*result, " ", MAXLNLEN); mystrcat(*result, MORPH_PART, MAXLNLEN); mystrcat(*result, word+i, MAXLNLEN); if (complexprefixes && HENTRY_DATA(rv)) mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); if (!HENTRY_FIND(rv, MORPH_STEM)) { mystrcat(*result, " ", MAXLNLEN); mystrcat(*result, MORPH_STEM, MAXLNLEN); mystrcat(*result, HENTRY_WORD(rv), MAXLNLEN); } // store the pointer of the hash entry // sprintf(*result + strlen(*result), " %s%p", MORPH_HENTRY, rv); if (!complexprefixes && HENTRY_DATA(rv)) { mystrcat(*result, " ", MAXLNLEN); mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); } mystrcat(*result, "\n", MAXLNLEN); ok = 1; return 0; } oldnumsyllable2 = numsyllable; oldwordnum2 = wordnum; // LANG_hu section: spec. Hungarian rule if ((rv) && (langnum == LANG_hu) && (TESTAFF(rv->astr, 'I', rv->alen)) && !(TESTAFF(rv->astr, 'J', rv->alen))) { numsyllable--; } // END of LANG_hu section // increment word number, if the second root has a compoundroot flag if ((rv) && (compoundroot) && (TESTAFF(rv->astr, compoundroot, rv->alen))) { wordnum++; } // check forbiddenwords if ((rv) && (rv->astr) && TESTAFF(rv->astr, forbiddenword, rv->alen)) { st[i] = ch; continue; } // second word is acceptable, as a root? // hungarian conventions: compounding is acceptable, // when compound forms consist of 2 words, or if more, // then the syllable number of root words must be 6, or lesser. if ((rv) && ( (compoundflag && TESTAFF(rv->astr, compoundflag, rv->alen)) || (compoundend && TESTAFF(rv->astr, compoundend, rv->alen)) ) && ( ((cpdwordmax==-1) || (wordnum+1blen)<=cpdmaxsyllable)) ) && ( (!checkcompounddup || (rv != rv_first)) ) ) { // bad compound word mystrcat(*result, presult, MAXLNLEN); mystrcat(*result, " ", MAXLNLEN); mystrcat(*result, MORPH_PART, MAXLNLEN); mystrcat(*result, word+i, MAXLNLEN); if (HENTRY_DATA(rv)) { if (complexprefixes) mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); if (! HENTRY_FIND(rv, MORPH_STEM)) { mystrcat(*result, " ", MAXLNLEN); mystrcat(*result, MORPH_STEM, MAXLNLEN); mystrcat(*result, HENTRY_WORD(rv), MAXLNLEN); } // store the pointer of the hash entry // sprintf(*result + strlen(*result), " %s%p", MORPH_HENTRY, rv); if (!complexprefixes) { mystrcat(*result, " ", MAXLNLEN); mystrcat(*result, HENTRY_DATA2(rv), MAXLNLEN); } } mystrcat(*result, "\n", MAXLNLEN); ok = 1; } numsyllable = oldnumsyllable2 ; wordnum = oldwordnum2; // perhaps second word has prefix or/and suffix sfx = NULL; sfxflag = FLAG_NULL; if (compoundflag) rv = affix_check((word+i),strlen(word+i), compoundflag); else rv = NULL; if (!rv && compoundend) { sfx = NULL; pfx = NULL; rv = affix_check((word+i),strlen(word+i), compoundend); } if (!rv && numdefcpd && words) { rv = affix_check((word+i),strlen(word+i), 0, IN_CPD_END); if (rv && words && defcpd_check(&words, wnum + 1, rv, NULL, 1)) { char * m = NULL; if (compoundflag) m = affix_check_morph((word+i),strlen(word+i), compoundflag); if ((!m || *m == '\0') && compoundend) { if (m) free(m); m = affix_check_morph((word+i),strlen(word+i), compoundend); } mystrcat(*result, presult, MAXLNLEN); if (m || (*m != '\0')) { sprintf(*result + strlen(*result), "%c%s%s%s", MSEP_FLD, MORPH_PART, word + i, line_uniq_app(&m, MSEP_REC)); } if (m) free(m); mystrcat(*result, "\n", MAXLNLEN); ok = 1; } } // check non_compound flag in suffix and prefix if ((rv) && ((pfx && pfx->getCont() && TESTAFF(pfx->getCont(), compoundforbidflag, pfx->getContLen())) || (sfx && sfx->getCont() && TESTAFF(sfx->getCont(), compoundforbidflag, sfx->getContLen())))) { rv = NULL; } // check forbiddenwords if ((rv) && (rv->astr) && (TESTAFF(rv->astr,forbiddenword,rv->alen)) && (! TESTAFF(rv->astr, needaffix, rv->alen))) { st[i] = ch; continue; } if (langnum == LANG_hu) { // calculate syllable number of the word numsyllable += get_syllable(word + i, strlen(word + i)); // - affix syllable num. // XXX only second suffix (inflections, not derivations) if (sfxappnd) { char * tmp = myrevstrdup(sfxappnd); numsyllable -= get_syllable(tmp, strlen(tmp)); free(tmp); } // + 1 word, if syllable number of the prefix > 1 (hungarian convention) if (pfx && (get_syllable(pfx->getKey(),strlen(pfx->getKey())) > 1)) wordnum++; // increment syllable num, if last word has a SYLLABLENUM flag // and the suffix is beginning `s' if (cpdsyllablenum) { switch (sfxflag) { case 'c': { numsyllable+=2; break; } case 'J': { numsyllable += 1; break; } case 'I': { if (rv && TESTAFF(rv->astr, 'J', rv->alen)) numsyllable += 1; break; } } } } // increment word number, if the second word has a compoundroot flag if ((rv) && (compoundroot) && (TESTAFF(rv->astr, compoundroot, rv->alen))) { wordnum++; } // second word is acceptable, as a word with prefix or/and suffix? // hungarian conventions: compounding is acceptable, // when compound forms consist 2 word, otherwise // the syllable number of root words is 6, or lesser. if ((rv) && ( ((cpdwordmax==-1) || (wordnum+1 0) && *s1 && (*s1 == *end_of_s2)) { s1++; end_of_s2--; len--; } return (*s1 == '\0'); } */ inline int AffixMgr::isRevSubset(const char * s1, const char * end_of_s2, int len) { while ((len > 0) && (*s1 != '\0') && ((*s1 == *end_of_s2) || (*s1 == '.'))) { s1++; end_of_s2--; len--; } return (*s1 == '\0'); } // check word for suffixes struct hentry * AffixMgr::suffix_check (const char * word, int len, int sfxopts, PfxEntry * ppfx, char ** wlst, int maxSug, int * ns, const FLAG cclass, const FLAG needflag, char in_compound) { struct hentry * rv = NULL; PfxEntry* ep = ppfx; // first handle the special case of 0 length suffixes SfxEntry * se = sStart[0]; while (se) { if (!cclass || se->getCont()) { // suffixes are not allowed in beginning of compounds if ((((in_compound != IN_CPD_BEGIN)) || // && !cclass // except when signed with compoundpermitflag flag (se->getCont() && compoundpermitflag && TESTAFF(se->getCont(),compoundpermitflag,se->getContLen()))) && (!circumfix || // no circumfix flag in prefix and suffix ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (!se->getCont() || !(TESTAFF(se->getCont(),circumfix,se->getContLen())))) || // circumfix flag in prefix AND suffix ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (se->getCont() && (TESTAFF(se->getCont(),circumfix,se->getContLen()))))) && // fogemorpheme (in_compound || !((se->getCont() && (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) && // needaffix on prefix or first suffix (cclass || !(se->getCont() && TESTAFF(se->getCont(), needaffix, se->getContLen())) || (ppfx && !((ep->getCont()) && TESTAFF(ep->getCont(), needaffix, ep->getContLen()))) ) ) { rv = se->checkword(word,len, sfxopts, ppfx, wlst, maxSug, ns, (FLAG) cclass, needflag, (in_compound ? 0 : onlyincompound)); if (rv) { sfx=se; // BUG: sfx not stateless return rv; } } } se = se->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)(word + len - 1)); SfxEntry * sptr = sStart[sp]; while (sptr) { if (isRevSubset(sptr->getKey(), word + len - 1, len) ) { // suffixes are not allowed in beginning of compounds if ((((in_compound != IN_CPD_BEGIN)) || // && !cclass // except when signed with compoundpermitflag flag (sptr->getCont() && compoundpermitflag && TESTAFF(sptr->getCont(),compoundpermitflag,sptr->getContLen()))) && (!circumfix || // no circumfix flag in prefix and suffix ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (!sptr->getCont() || !(TESTAFF(sptr->getCont(),circumfix,sptr->getContLen())))) || // circumfix flag in prefix AND suffix ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (sptr->getCont() && (TESTAFF(sptr->getCont(),circumfix,sptr->getContLen()))))) && // fogemorpheme (in_compound || !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) && // needaffix on prefix or first suffix (cclass || !(sptr->getCont() && TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) || (ppfx && !((ep->getCont()) && TESTAFF(ep->getCont(), needaffix, ep->getContLen()))) ) ) { rv = sptr->checkword(word,len, sfxopts, ppfx, wlst, maxSug, ns, cclass, needflag, (in_compound ? 0 : onlyincompound)); if (rv) { sfx=sptr; // BUG: sfx not stateless sfxflag = sptr->getFlag(); // BUG: sfxflag not stateless if (!sptr->getCont()) sfxappnd=sptr->getKey(); // BUG: sfxappnd not stateless return rv; } } sptr = sptr->getNextEQ(); } else { sptr = sptr->getNextNE(); } } return NULL; } // check word for two-level suffixes struct hentry * AffixMgr::suffix_check_twosfx(const char * word, int len, int sfxopts, PfxEntry * ppfx, const FLAG needflag) { struct hentry * rv = NULL; // first handle the special case of 0 length suffixes SfxEntry * se = sStart[0]; while (se) { if (contclasses[se->getFlag()]) { rv = se->check_twosfx(word,len, sfxopts, ppfx, needflag); if (rv) return rv; } se = se->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)(word + len - 1)); SfxEntry * sptr = sStart[sp]; while (sptr) { if (isRevSubset(sptr->getKey(), word + len - 1, len)) { if (contclasses[sptr->getFlag()]) { rv = sptr->check_twosfx(word,len, sfxopts, ppfx, needflag); if (rv) { sfxflag = sptr->getFlag(); // BUG: sfxflag not stateless if (!sptr->getCont()) sfxappnd=sptr->getKey(); // BUG: sfxappnd not stateless return rv; } } sptr = sptr->getNextEQ(); } else { sptr = sptr->getNextNE(); } } return NULL; } char * AffixMgr::suffix_check_twosfx_morph(const char * word, int len, int sfxopts, PfxEntry * ppfx, const FLAG needflag) { char result[MAXLNLEN]; char result2[MAXLNLEN]; char result3[MAXLNLEN]; char * st; result[0] = '\0'; result2[0] = '\0'; result3[0] = '\0'; // first handle the special case of 0 length suffixes SfxEntry * se = sStart[0]; while (se) { if (contclasses[se->getFlag()]) { st = se->check_twosfx_morph(word,len, sfxopts, ppfx, needflag); if (st) { if (ppfx) { if (ppfx->getMorph()) { mystrcat(result, ppfx->getMorph(), MAXLNLEN); mystrcat(result, " ", MAXLNLEN); } else debugflag(result, ppfx->getFlag()); } mystrcat(result, st, MAXLNLEN); free(st); if (se->getMorph()) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, se->getMorph(), MAXLNLEN); } else debugflag(result, se->getFlag()); mystrcat(result, "\n", MAXLNLEN); } } se = se->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)(word + len - 1)); SfxEntry * sptr = sStart[sp]; while (sptr) { if (isRevSubset(sptr->getKey(), word + len - 1, len)) { if (contclasses[sptr->getFlag()]) { st = sptr->check_twosfx_morph(word,len, sfxopts, ppfx, needflag); if (st) { sfxflag = sptr->getFlag(); // BUG: sfxflag not stateless if (!sptr->getCont()) sfxappnd=sptr->getKey(); // BUG: sfxappnd not stateless strcpy(result2, st); free(st); result3[0] = '\0'; if (sptr->getMorph()) { mystrcat(result3, " ", MAXLNLEN); mystrcat(result3, sptr->getMorph(), MAXLNLEN); } else debugflag(result3, sptr->getFlag()); strlinecat(result2, result3); mystrcat(result2, "\n", MAXLNLEN); mystrcat(result, result2, MAXLNLEN); } } sptr = sptr->getNextEQ(); } else { sptr = sptr->getNextNE(); } } if (*result) return mystrdup(result); return NULL; } char * AffixMgr::suffix_check_morph(const char * word, int len, int sfxopts, PfxEntry * ppfx, const FLAG cclass, const FLAG needflag, char in_compound) { char result[MAXLNLEN]; struct hentry * rv = NULL; result[0] = '\0'; PfxEntry* ep = ppfx; // first handle the special case of 0 length suffixes SfxEntry * se = sStart[0]; while (se) { if (!cclass || se->getCont()) { // suffixes are not allowed in beginning of compounds if (((((in_compound != IN_CPD_BEGIN)) || // && !cclass // except when signed with compoundpermitflag flag (se->getCont() && compoundpermitflag && TESTAFF(se->getCont(),compoundpermitflag,se->getContLen()))) && (!circumfix || // no circumfix flag in prefix and suffix ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (!se->getCont() || !(TESTAFF(se->getCont(),circumfix,se->getContLen())))) || // circumfix flag in prefix AND suffix ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (se->getCont() && (TESTAFF(se->getCont(),circumfix,se->getContLen()))))) && // fogemorpheme (in_compound || !((se->getCont() && (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) && // needaffix on prefix or first suffix (cclass || !(se->getCont() && TESTAFF(se->getCont(), needaffix, se->getContLen())) || (ppfx && !((ep->getCont()) && TESTAFF(ep->getCont(), needaffix, ep->getContLen()))) ) )) rv = se->checkword(word, len, sfxopts, ppfx, NULL, 0, 0, cclass, needflag); while (rv) { if (ppfx) { if (ppfx->getMorph()) { mystrcat(result, ppfx->getMorph(), MAXLNLEN); mystrcat(result, " ", MAXLNLEN); } else debugflag(result, ppfx->getFlag()); } if (complexprefixes && HENTRY_DATA(rv)) mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); if (! HENTRY_FIND(rv, MORPH_STEM)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, MORPH_STEM, MAXLNLEN); mystrcat(result, HENTRY_WORD(rv), MAXLNLEN); } // store the pointer of the hash entry // sprintf(result + strlen(result), " %s%p", MORPH_HENTRY, rv); if (!complexprefixes && HENTRY_DATA(rv)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); } if (se->getMorph()) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, se->getMorph(), MAXLNLEN); } else debugflag(result, se->getFlag()); mystrcat(result, "\n", MAXLNLEN); rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag); } } se = se->getNext(); } // now handle the general case unsigned char sp = *((const unsigned char *)(word + len - 1)); SfxEntry * sptr = sStart[sp]; while (sptr) { if (isRevSubset(sptr->getKey(), word + len - 1, len) ) { // suffixes are not allowed in beginning of compounds if (((((in_compound != IN_CPD_BEGIN)) || // && !cclass // except when signed with compoundpermitflag flag (sptr->getCont() && compoundpermitflag && TESTAFF(sptr->getCont(),compoundpermitflag,sptr->getContLen()))) && (!circumfix || // no circumfix flag in prefix and suffix ((!ppfx || !(ep->getCont()) || !TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (!sptr->getCont() || !(TESTAFF(sptr->getCont(),circumfix,sptr->getContLen())))) || // circumfix flag in prefix AND suffix ((ppfx && (ep->getCont()) && TESTAFF(ep->getCont(), circumfix, ep->getContLen())) && (sptr->getCont() && (TESTAFF(sptr->getCont(),circumfix,sptr->getContLen()))))) && // fogemorpheme (in_compound || !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) && // needaffix on first suffix (cclass || !(sptr->getCont() && TESTAFF(sptr->getCont(), needaffix, sptr->getContLen()))) )) rv = sptr->checkword(word,len, sfxopts, ppfx, NULL, 0, 0, cclass, needflag); while (rv) { if (ppfx) { if (ppfx->getMorph()) { mystrcat(result, ppfx->getMorph(), MAXLNLEN); mystrcat(result, " ", MAXLNLEN); } else debugflag(result, ppfx->getFlag()); } if (complexprefixes && HENTRY_DATA(rv)) mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); if (! HENTRY_FIND(rv, MORPH_STEM)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, MORPH_STEM, MAXLNLEN); mystrcat(result, HENTRY_WORD(rv), MAXLNLEN); } // store the pointer of the hash entry // sprintf(result + strlen(result), " %s%p", MORPH_HENTRY, rv); if (!complexprefixes && HENTRY_DATA(rv)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); } if (sptr->getMorph()) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, sptr->getMorph(), MAXLNLEN); } else debugflag(result, sptr->getFlag()); mystrcat(result, "\n", MAXLNLEN); rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag); } sptr = sptr->getNextEQ(); } else { sptr = sptr->getNextNE(); } } if (*result) return mystrdup(result); return NULL; } // check if word with affixes is correctly spelled struct hentry * AffixMgr::affix_check (const char * word, int len, const FLAG needflag, char in_compound) { struct hentry * rv= NULL; // check all prefixes (also crossed with suffixes if allowed) rv = prefix_check(word, len, in_compound, needflag); if (rv) return rv; // if still not found check all suffixes rv = suffix_check(word, len, 0, NULL, NULL, 0, NULL, FLAG_NULL, needflag, in_compound); if (havecontclass) { sfx = NULL; pfx = NULL; if (rv) return rv; // if still not found check all two-level suffixes rv = suffix_check_twosfx(word, len, 0, NULL, needflag); if (rv) return rv; // if still not found check all two-level suffixes rv = prefix_check_twosfx(word, len, IN_CPD_NOT, needflag); } return rv; } // check if word with affixes is correctly spelled char * AffixMgr::affix_check_morph(const char * word, int len, const FLAG needflag, char in_compound) { char result[MAXLNLEN]; char * st = NULL; *result = '\0'; // check all prefixes (also crossed with suffixes if allowed) st = prefix_check_morph(word, len, in_compound); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } // if still not found check all suffixes st = suffix_check_morph(word, len, 0, NULL, '\0', needflag, in_compound); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } if (havecontclass) { sfx = NULL; pfx = NULL; // if still not found check all two-level suffixes st = suffix_check_twosfx_morph(word, len, 0, NULL, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } // if still not found check all two-level suffixes st = prefix_check_twosfx_morph(word, len, IN_CPD_NOT, needflag); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } } return mystrdup(result); } char * AffixMgr::morphgen(char * ts, int wl, const unsigned short * ap, unsigned short al, char * morph, char * targetmorph, int level) { // handle suffixes char * stemmorph; char * stemmorphcatpos; char mymorph[MAXLNLEN]; if (!morph) return NULL; // check substandard flag if (TESTAFF(ap, substandard, al)) return NULL; if (morphcmp(morph, targetmorph) == 0) return mystrdup(ts); // int targetcount = get_sfxcount(targetmorph); // use input suffix fields, if exist if (strstr(morph, MORPH_INFL_SFX) || strstr(morph, MORPH_DERI_SFX)) { stemmorph = mymorph; strcpy(stemmorph, morph); mystrcat(stemmorph, " ", MAXLNLEN); stemmorphcatpos = stemmorph + strlen(stemmorph); } else { stemmorph = morph; stemmorphcatpos = NULL; } for (int i = 0; i < al; i++) { const unsigned char c = (unsigned char) (ap[i] & 0x00FF); SfxEntry * sptr = sFlag[c]; while (sptr) { if (sptr->getFlag() == ap[i] && sptr->getMorph() && ((sptr->getContLen() == 0) || // don't generate forms with substandard affixes !TESTAFF(sptr->getCont(), substandard, sptr->getContLen()))) { if (stemmorphcatpos) strcpy(stemmorphcatpos, sptr->getMorph()); else stemmorph = (char *) sptr->getMorph(); int cmp = morphcmp(stemmorph, targetmorph); if (cmp == 0) { char * newword = sptr->add(ts, wl); if (newword) { hentry * check = pHMgr->lookup(newword); // XXX extra dic if (!check || !check->astr || !TESTAFF(check->astr, forbiddenword, check->alen)) { return newword; } free(newword); } } // recursive call for secondary suffixes if ((level == 0) && (cmp == 1) && (sptr->getContLen() > 0) && // (get_sfxcount(stemmorph) < targetcount) && !TESTAFF(sptr->getCont(), substandard, sptr->getContLen())) { char * newword = sptr->add(ts, wl); if (newword) { char * newword2 = morphgen(newword, strlen(newword), sptr->getCont(), sptr->getContLen(), stemmorph, targetmorph, 1); if (newword2) { free(newword); return newword2; } free(newword); newword = NULL; } } } sptr = sptr->getFlgNxt(); } } return NULL; } int AffixMgr::expand_rootword(struct guessword * wlst, int maxn, const char * ts, int wl, const unsigned short * ap, unsigned short al, char * bad, int badl, char * phon) { int nh=0; // first add root word to list if ((nh < maxn) && !(al && ((needaffix && TESTAFF(ap, needaffix, al)) || (onlyincompound && TESTAFF(ap, onlyincompound, al))))) { wlst[nh].word = mystrdup(ts); if (!wlst[nh].word) return 0; wlst[nh].allow = (1 == 0); wlst[nh].orig = NULL; nh++; // add special phonetic version if (phon && (nh < maxn)) { wlst[nh].word = mystrdup(phon); if (!wlst[nh].word) return nh - 1; wlst[nh].allow = (1 == 0); wlst[nh].orig = mystrdup(ts); if (!wlst[nh].orig) return nh - 1; nh++; } } // handle suffixes for (int i = 0; i < al; i++) { const unsigned char c = (unsigned char) (ap[i] & 0x00FF); SfxEntry * sptr = sFlag[c]; while (sptr) { if ((sptr->getFlag() == ap[i]) && (!sptr->getKeyLen() || ((badl > sptr->getKeyLen()) && (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) && // check needaffix flag !(sptr->getCont() && ((needaffix && TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) || (circumfix && TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())) || (onlyincompound && TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen())))) ) { char * newword = sptr->add(ts, wl); if (newword) { if (nh < maxn) { wlst[nh].word = newword; wlst[nh].allow = sptr->allowCross(); wlst[nh].orig = NULL; nh++; // add special phonetic version if (phon && (nh < maxn)) { char st[MAXWORDUTF8LEN]; strcpy(st, phon); strcat(st, sptr->getKey()); reverseword(st + strlen(phon)); wlst[nh].word = mystrdup(st); if (!wlst[nh].word) return nh - 1; wlst[nh].allow = (1 == 0); wlst[nh].orig = mystrdup(newword); if (!wlst[nh].orig) return nh - 1; nh++; } } else { free(newword); } } } sptr = sptr->getFlgNxt(); } } int n = nh; // handle cross products of prefixes and suffixes for (int j=1;jgetFlag() == ap[k]) && cptr->allowCross() && (!cptr->getKeyLen() || ((badl > cptr->getKeyLen()) && (strncmp(cptr->getKey(), bad, cptr->getKeyLen()) == 0)))) { int l1 = strlen(wlst[j].word); char * newword = cptr->add(wlst[j].word, l1); if (newword) { if (nh < maxn) { wlst[nh].word = newword; wlst[nh].allow = cptr->allowCross(); wlst[nh].orig = NULL; nh++; } else { free(newword); } } } cptr = cptr->getFlgNxt(); } } } // now handle pure prefixes for (int m = 0; m < al; m ++) { const unsigned char c = (unsigned char) (ap[m] & 0x00FF); PfxEntry * ptr = pFlag[c]; while (ptr) { if ((ptr->getFlag() == ap[m]) && (!ptr->getKeyLen() || ((badl > ptr->getKeyLen()) && (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) && // check needaffix flag !(ptr->getCont() && ((needaffix && TESTAFF(ptr->getCont(), needaffix, ptr->getContLen())) || (circumfix && TESTAFF(ptr->getCont(), circumfix, ptr->getContLen())) || (onlyincompound && TESTAFF(ptr->getCont(), onlyincompound, ptr->getContLen())))) ) { char * newword = ptr->add(ts, wl); if (newword) { if (nh < maxn) { wlst[nh].word = newword; wlst[nh].allow = ptr->allowCross(); wlst[nh].orig = NULL; nh++; } else { free(newword); } } } ptr = ptr->getFlgNxt(); } } return nh; } // return length of replacing table int AffixMgr::get_numrep() const { return numrep; } // return replacing table struct replentry * AffixMgr::get_reptable() const { if (! reptable ) return NULL; return reptable; } // return iconv table RepList * AffixMgr::get_iconvtable() const { if (! iconvtable ) return NULL; return iconvtable; } // return oconv table RepList * AffixMgr::get_oconvtable() const { if (! oconvtable ) return NULL; return oconvtable; } // return replacing table struct phonetable * AffixMgr::get_phonetable() const { if (! phone ) return NULL; return phone; } // return length of character map table int AffixMgr::get_nummap() const { return nummap; } // return character map table struct mapentry * AffixMgr::get_maptable() const { if (! maptable ) return NULL; return maptable; } // return length of word break table int AffixMgr::get_numbreak() const { return numbreak; } // return character map table char ** AffixMgr::get_breaktable() const { if (! breaktable ) return NULL; return breaktable; } // return text encoding of dictionary char * AffixMgr::get_encoding() { if (! encoding ) encoding = mystrdup(SPELL_ENCODING); return mystrdup(encoding); } // return text encoding of dictionary int AffixMgr::get_langnum() const { return langnum; } // return double prefix option int AffixMgr::get_complexprefixes() const { return complexprefixes; } // return FULLSTRIP option int AffixMgr::get_fullstrip() const { return fullstrip; } FLAG AffixMgr::get_keepcase() const { return keepcase; } int AffixMgr::get_checksharps() const { return checksharps; } char * AffixMgr::encode_flag(unsigned short aflag) const { return pHMgr->encode_flag(aflag); } // return the preferred ignore string for suggestions char * AffixMgr::get_ignore() const { if (!ignorechars) return NULL; return ignorechars; } // return the preferred ignore string for suggestions unsigned short * AffixMgr::get_ignore_utf16(int * len) const { *len = ignorechars_utf16_len; return ignorechars_utf16; } // return the keyboard string for suggestions char * AffixMgr::get_key_string() { if (! keystring ) keystring = mystrdup(SPELL_KEYSTRING); return mystrdup(keystring); } // return the preferred try string for suggestions char * AffixMgr::get_try_string() const { if (! trystring ) return NULL; return mystrdup(trystring); } // return the preferred try string for suggestions const char * AffixMgr::get_wordchars() const { return wordchars; } unsigned short * AffixMgr::get_wordchars_utf16(int * len) const { *len = wordchars_utf16_len; return wordchars_utf16; } // is there compounding? int AffixMgr::get_compound() const { return compoundflag || compoundbegin || numdefcpd; } // return the compound words control flag FLAG AffixMgr::get_compoundflag() const { return compoundflag; } // return the forbidden words control flag FLAG AffixMgr::get_forbiddenword() const { return forbiddenword; } // return the forbidden words control flag FLAG AffixMgr::get_nosuggest() const { return nosuggest; } // return the forbidden words flag modify flag FLAG AffixMgr::get_needaffix() const { return needaffix; } // return the onlyincompound flag FLAG AffixMgr::get_onlyincompound() const { return onlyincompound; } // return the compound word signal flag FLAG AffixMgr::get_compoundroot() const { return compoundroot; } // return the compound begin signal flag FLAG AffixMgr::get_compoundbegin() const { return compoundbegin; } // return the value of checknum int AffixMgr::get_checknum() const { return checknum; } // return the value of prefix const char * AffixMgr::get_prefix() const { if (pfx) return pfx->getKey(); return NULL; } // return the value of suffix const char * AffixMgr::get_suffix() const { return sfxappnd; } // return the value of suffix const char * AffixMgr::get_version() const { return version; } // return lemma_present flag FLAG AffixMgr::get_lemma_present() const { return lemma_present; } // utility method to look up root words in hash table struct hentry * AffixMgr::lookup(const char * word) { int i; struct hentry * he = NULL; for (i = 0; i < *maxdic && !he; i++) { he = (alldic[i])->lookup(word); } return he; } // return the value of suffix int AffixMgr::have_contclass() const { return havecontclass; } // return utf8 int AffixMgr::get_utf8() const { return utf8; } // return nosplitsugs int AffixMgr::get_maxngramsugs(void) const { return maxngramsugs; } // return nosplitsugs int AffixMgr::get_nosplitsugs(void) const { return nosplitsugs; } // return sugswithdots int AffixMgr::get_sugswithdots(void) const { return sugswithdots; } /* parse flag */ int AffixMgr::parse_flag(char * line, unsigned short * out, FileMgr * af) { char * s = NULL; if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) { HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix file parameter\n", af->getlinenum()); return 1; } if (parse_string(line, &s, af->getlinenum())) return 1; *out = pHMgr->decode_flag(s); free(s); return 0; } /* parse num */ int AffixMgr::parse_num(char * line, int * out, FileMgr * af) { char * s = NULL; if (*out != -1) { HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix file parameter\n", af->getlinenum()); return 1; } if (parse_string(line, &s, af->getlinenum())) return 1; *out = atoi(s); free(s); return 0; } /* parse in the max syllablecount of compound words and */ int AffixMgr::parse_cpdsyllable(char * line, FileMgr * af) { char * tp = line; char * piece; int i = 0; int np = 0; w_char w[MAXWORDLEN]; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { cpdmaxsyllable = atoi(piece); np++; break; } case 2: { if (!utf8) { cpdvowels = mystrdup(piece); } else { int n = u8_u16(w, MAXWORDLEN, piece); if (n > 0) { flag_qsort((unsigned short *) w, 0, n); cpdvowels_utf16 = (w_char *) malloc(n * sizeof(w_char)); if (!cpdvowels_utf16) return 1; memcpy(cpdvowels_utf16, w, n * sizeof(w_char)); } cpdvowels_utf16_len = n; } np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np < 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing compoundsyllable information\n", af->getlinenum()); return 1; } if (np == 2) cpdvowels = mystrdup("aeiouAEIOU"); return 0; } /* parse in the typical fault correcting table */ int AffixMgr::parse_reptable(char * line, FileMgr * af) { if (numrep != 0) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { numrep = atoi(piece); if (numrep < 1) { HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n", af->getlinenum()); return 1; } reptable = (replentry *) malloc(numrep * sizeof(struct replentry)); if (!reptable) return 1; np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the numrep lines to read in the remainder of the table */ char * nl; for (int j=0; j < numrep; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; reptable[j].pattern = NULL; reptable[j].pattern2 = NULL; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece,"REP",3) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numrep = 0; return 1; } break; } case 1: { reptable[j].pattern = mystrrep(mystrdup(piece),"_"," "); break; } case 2: { reptable[j].pattern2 = mystrrep(mystrdup(piece),"_"," "); break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if ((!(reptable[j].pattern)) || (!(reptable[j].pattern2))) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numrep = 0; return 1; } } return 0; } /* parse in the typical fault correcting table */ int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const char * keyword) { if (*rl) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; int numrl = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { numrl = atoi(piece); if (numrl < 1) { HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n", af->getlinenum()); return 1; } *rl = new RepList(numrl); if (!*rl) return 1; np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the num lines to read in the remainder of the table */ char * nl; for (int j=0; j < numrl; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; char * pattern = NULL; char * pattern2 = NULL; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece, keyword, sizeof(keyword)) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); delete *rl; *rl = NULL; return 1; } break; } case 1: { pattern = mystrrep(mystrdup(piece),"_"," "); break; } case 2: { pattern2 = mystrrep(mystrdup(piece),"_"," "); break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (!pattern || !pattern2) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); return 1; } (*rl)->add(pattern, pattern2); } return 0; } /* parse in the typical fault correcting table */ int AffixMgr::parse_phonetable(char * line, FileMgr * af) { if (phone) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { phone = (phonetable *) malloc(sizeof(struct phonetable)); if (!phone) return 1; phone->num = atoi(piece); phone->rules = NULL; phone->utf8 = (char) utf8; if (phone->num < 1) { HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); return 1; } phone->rules = (char * *) malloc(2 * (phone->num + 1) * sizeof(char *)); if (!phone->rules) { free(phone); phone = NULL; return 1; } np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the phone->num lines to read in the remainder of the table */ char * nl; for (int j=0; j < phone->num; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; phone->rules[j * 2] = NULL; phone->rules[j * 2 + 1] = NULL; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece,"PHONE",5) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); phone->num = 0; return 1; } break; } case 1: { phone->rules[j * 2] = mystrrep(mystrdup(piece),"_",""); break; } case 2: { phone->rules[j * 2 + 1] = mystrrep(mystrdup(piece),"_",""); break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if ((!(phone->rules[j * 2])) || (!(phone->rules[j * 2 + 1]))) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); phone->num = 0; return 1; } } phone->rules[phone->num * 2] = mystrdup(""); phone->rules[phone->num * 2 + 1] = mystrdup(""); init_phonet_hash(*phone); return 0; } /* parse in the checkcompoundpattern table */ int AffixMgr::parse_checkcpdtable(char * line, FileMgr * af) { if (numcheckcpd != 0) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { numcheckcpd = atoi(piece); if (numcheckcpd < 1) { HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); return 1; } checkcpdtable = (patentry *) malloc(numcheckcpd * sizeof(struct patentry)); if (!checkcpdtable) return 1; np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the numcheckcpd lines to read in the remainder of the table */ char * nl; for (int j=0; j < numcheckcpd; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; checkcpdtable[j].pattern = NULL; checkcpdtable[j].pattern2 = NULL; checkcpdtable[j].pattern3 = NULL; checkcpdtable[j].cond = FLAG_NULL; checkcpdtable[j].cond2 = FLAG_NULL; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece,"CHECKCOMPOUNDPATTERN",20) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numcheckcpd = 0; return 1; } break; } case 1: { checkcpdtable[j].pattern = mystrdup(piece); char * p = strchr(checkcpdtable[j].pattern, '/'); if (p) { *p = '\0'; checkcpdtable[j].cond = pHMgr->decode_flag(p + 1); } break; } case 2: { checkcpdtable[j].pattern2 = mystrdup(piece); char * p = strchr(checkcpdtable[j].pattern2, '/'); if (p) { *p = '\0'; checkcpdtable[j].cond2 = pHMgr->decode_flag(p + 1); } break; } case 3: { checkcpdtable[j].pattern3 = mystrdup(piece); simplifiedcpd = 1; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if ((!(checkcpdtable[j].pattern)) || (!(checkcpdtable[j].pattern2))) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numcheckcpd = 0; return 1; } } return 0; } /* parse in the compound rule table */ int AffixMgr::parse_defcpdtable(char * line, FileMgr * af) { if (numdefcpd != 0) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { numdefcpd = atoi(piece); if (numdefcpd < 1) { HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); return 1; } defcpdtable = (flagentry *) malloc(numdefcpd * sizeof(flagentry)); if (!defcpdtable) return 1; np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the numdefcpd lines to read in the remainder of the table */ char * nl; for (int j=0; j < numdefcpd; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; defcpdtable[j].def = NULL; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece, "COMPOUNDRULE", 12) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numdefcpd = 0; return 1; } break; } case 1: { // handle parenthesized flags if (strchr(piece, '(')) { defcpdtable[j].def = (FLAG *) malloc(sizeof(piece) * sizeof(FLAG)); defcpdtable[j].len = 0; int end = 0; FLAG * conv; while (!end) { char * par = piece + 1; while (*par != '(' && *par != ')' && *par != '\0') par++; if (*par == '\0') end = 1; else *par = '\0'; if (*piece == '(') piece++; if (*piece == '*' || *piece == '?') { defcpdtable[j].def[defcpdtable[j].len++] = (FLAG) *piece; } else if (*piece != '\0') { int l = pHMgr->decode_flags(&conv, piece, af); for (int k = 0; k < l; k++) defcpdtable[j].def[defcpdtable[j].len++] = conv[k]; free(conv); } piece = par + 1; } } else { defcpdtable[j].len = pHMgr->decode_flags(&(defcpdtable[j].def), piece, af); } break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (!defcpdtable[j].len) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numdefcpd = 0; return 1; } } return 0; } /* parse in the character map table */ int AffixMgr::parse_maptable(char * line, FileMgr * af) { if (nummap != 0) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { nummap = atoi(piece); if (nummap < 1) { HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); return 1; } maptable = (mapentry *) malloc(nummap * sizeof(struct mapentry)); if (!maptable) return 1; np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the nummap lines to read in the remainder of the table */ char * nl; for (int j=0; j < nummap; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; maptable[j].set = NULL; maptable[j].len = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece,"MAP",3) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); nummap = 0; return 1; } break; } case 1: { int setn = 0; maptable[j].len = strlen(piece); maptable[j].set = (char **) malloc(maptable[j].len * sizeof(char*)); if (!maptable[j].set) return 1; for (int k = 0; k < maptable[j].len; k++) { int chl = 1; int chb = k; if (piece[k] == '(') { char * parpos = strchr(piece + k, ')'); if (parpos != NULL) { chb = k + 1; chl = (int)(parpos - piece) - k - 1; k = k + chl + 1; } } else { if (utf8 && (piece[k] & 0xc0) == 0xc0) { for (k++; utf8 && (piece[k] & 0xc0) == 0x80; k++); chl = k - chb; k--; } } maptable[j].set[setn] = (char *) malloc(chl + 1); if (!maptable[j].set[setn]) return 1; strncpy(maptable[j].set[setn], piece + chb, chl); maptable[j].set[setn][chl] = '\0'; setn++; } maptable[j].len = setn; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (!maptable[j].set || !maptable[j].len) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); nummap = 0; return 1; } } return 0; } /* parse in the word breakpoint table */ int AffixMgr::parse_breaktable(char * line, FileMgr * af) { if (numbreak != 0) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { numbreak = atoi(piece); if (numbreak < 1) { HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); return 1; } breaktable = (char **) malloc(numbreak * sizeof(char *)); if (!breaktable) return 1; np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the numbreak lines to read in the remainder of the table */ char * nl; for (int j=0; j < numbreak; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece,"BREAK",5) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numbreak = 0; return 1; } break; } case 1: { breaktable[j] = mystrdup(piece); break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (!breaktable) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numbreak = 0; return 1; } } return 0; } void AffixMgr::reverse_condition(char * piece) { int neg = 0; for (char * k = piece + strlen(piece) - 1; k >= piece; k--) { switch(*k) { case '[': { if (neg) *(k+1) = '['; else *k = ']'; break; } case ']': { *k = '['; if (neg) *(k+1) = '^'; neg = 0; break; } case '^': { if (*(k+1) == ']') neg = 1; else *(k+1) = *k; break; } default: { if (neg) *(k+1) = *k; } } } } int AffixMgr::parse_affix(char * line, const char at, FileMgr * af, char * dupflags) { int numents = 0; // number of affentry structures to parse unsigned short aflag = 0; // affix char identifier char ff=0; std::vector affentries; char * tp = line; char * nl = line; char * piece; int i = 0; // checking lines with bad syntax #ifdef DEBUG int basefieldnum = 0; #endif // split affix header line into pieces int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { // piece 1 - is type of affix case 0: { np++; break; } // piece 2 - is affix char case 1: { np++; aflag = pHMgr->decode_flag(piece); if (((at == 'S') && (dupflags[aflag] & dupSFX)) || ((at == 'P') && (dupflags[aflag] & dupPFX))) { HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix flag\n", af->getlinenum()); // return 1; XXX permissive mode for bad dictionaries } dupflags[aflag] += (char) ((at == 'S') ? dupSFX : dupPFX); break; } // piece 3 - is cross product indicator case 2: { np++; if (*piece == 'Y') ff = aeXPRODUCT; break; } // piece 4 - is number of affentries case 3: { np++; numents = atoi(piece); if (numents == 0) { char * err = pHMgr->encode_flag(aflag); if (err) { HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); free(err); } return 1; } affentries.resize(numents); affentries[0].opts = ff; if (utf8) affentries[0].opts += aeUTF8; if (pHMgr->is_aliasf()) affentries[0].opts += aeALIASF; if (pHMgr->is_aliasm()) affentries[0].opts += aeALIASM; affentries[0].aflag = aflag; } default: break; } i++; } piece = mystrsep(&tp, 0); } // check to make sure we parsed enough pieces if (np != 4) { char * err = pHMgr->encode_flag(aflag); if (err) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); free(err); } return 1; } // now parse numents affentries for this affix std::vector::iterator start = affentries.begin(); std::vector::iterator end = affentries.end(); for (std::vector::iterator entry = start; entry != end; ++entry) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; np = 0; // split line into pieces piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { // piece 1 - is type case 0: { np++; if (entry != start) entry->opts = start->opts & (char) (aeXPRODUCT + aeUTF8 + aeALIASF + aeALIASM); break; } // piece 2 - is affix char case 1: { np++; if (pHMgr->decode_flag(piece) != aflag) { char * err = pHMgr->encode_flag(aflag); if (err) { HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n", af->getlinenum(), err); free(err); } return 1; } if (entry != start) entry->aflag = start->aflag; break; } // piece 3 - is string to strip or 0 for null case 2: { np++; if (complexprefixes) { if (utf8) reverseword_utf(piece); else reverseword(piece); } entry->strip = mystrdup(piece); entry->stripl = (unsigned char) strlen(entry->strip); if (strcmp(entry->strip,"0") == 0) { free(entry->strip); entry->strip=mystrdup(""); entry->stripl = 0; } break; } // piece 4 - is affix string or 0 for null case 3: { char * dash; entry->morphcode = NULL; entry->contclass = NULL; entry->contclasslen = 0; np++; dash = strchr(piece, '/'); if (dash) { *dash = '\0'; if (ignorechars) { if (utf8) { remove_ignored_chars_utf(piece, ignorechars_utf16, ignorechars_utf16_len); } else { remove_ignored_chars(piece,ignorechars); } } if (complexprefixes) { if (utf8) reverseword_utf(piece); else reverseword(piece); } entry->appnd = mystrdup(piece); if (pHMgr->is_aliasf()) { int index = atoi(dash + 1); entry->contclasslen = (unsigned short) pHMgr->get_aliasf(index, &(entry->contclass), af); if (!entry->contclasslen) HUNSPELL_WARNING(stderr, "error: bad affix flag alias: \"%s\"\n", dash+1); } else { entry->contclasslen = (unsigned short) pHMgr->decode_flags(&(entry->contclass), dash + 1, af); flag_qsort(entry->contclass, 0, entry->contclasslen); } *dash = '/'; havecontclass = 1; for (unsigned short _i = 0; _i < entry->contclasslen; _i++) { contclasses[(entry->contclass)[_i]] = 1; } } else { if (ignorechars) { if (utf8) { remove_ignored_chars_utf(piece, ignorechars_utf16, ignorechars_utf16_len); } else { remove_ignored_chars(piece,ignorechars); } } if (complexprefixes) { if (utf8) reverseword_utf(piece); else reverseword(piece); } entry->appnd = mystrdup(piece); } entry->appndl = (unsigned char) strlen(entry->appnd); if (strcmp(entry->appnd,"0") == 0) { free(entry->appnd); entry->appnd=mystrdup(""); entry->appndl = 0; } break; } // piece 5 - is the conditions descriptions case 4: { np++; if (complexprefixes) { if (utf8) reverseword_utf(piece); else reverseword(piece); reverse_condition(piece); } if (entry->stripl && (strcmp(piece, ".") != 0) && redundant_condition(at, entry->strip, entry->stripl, piece, af->getlinenum())) strcpy(piece, "."); if (at == 'S') { reverseword(piece); reverse_condition(piece); } if (encodeit(*entry, piece)) return 1; break; } case 5: { np++; if (pHMgr->is_aliasm()) { int index = atoi(piece); entry->morphcode = pHMgr->get_aliasm(index); } else { if (complexprefixes) { // XXX - fix me for morph. gen. if (utf8) reverseword_utf(piece); else reverseword(piece); } // add the remaining of the line if (*tp) { *(tp - 1) = ' '; tp = tp + strlen(tp); } entry->morphcode = mystrdup(piece); if (!entry->morphcode) return 1; } break; } default: break; } i++; } piece = mystrsep(&tp, 0); } // check to make sure we parsed enough pieces if (np < 4) { char * err = pHMgr->encode_flag(aflag); if (err) { HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n", af->getlinenum(), err); free(err); } return 1; } #ifdef DEBUG // detect unnecessary fields, excepting comments if (basefieldnum) { int fieldnum = !(entry->morphcode) ? 5 : ((*(entry->morphcode)=='#') ? 5 : 6); if (fieldnum != basefieldnum) HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n", af->getlinenum()); } else { basefieldnum = !(entry->morphcode) ? 5 : ((*(entry->morphcode)=='#') ? 5 : 6); } #endif } // now create SfxEntry or PfxEntry objects and use links to // build an ordered (sorted by affix string) list for (std::vector::iterator entry = start; entry != end; ++entry) { if (at == 'P') { PfxEntry * pfxptr = new PfxEntry(this,&(*entry)); build_pfxtree(pfxptr); } else { SfxEntry * sfxptr = new SfxEntry(this,&(*entry)); build_sfxtree(sfxptr); } } return 0; } int AffixMgr::redundant_condition(char ft, char * strip, int stripl, const char * cond, int linenum) { int condl = strlen(cond); int i; int j; int neg; int in; if (ft == 'P') { // prefix if (strncmp(strip, cond, condl) == 0) return 1; if (utf8) { } else { for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) { if (cond[j] != '[') { if (cond[j] != strip[i]) { HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); return 0; } } else { neg = (cond[j+1] == '^') ? 1 : 0; in = 0; do { j++; if (strip[i] == cond[j]) in = 1; } while ((j < (condl - 1)) && (cond[j] != ']')); if (j == (condl - 1) && (cond[j] != ']')) { HUNSPELL_WARNING(stderr, "error: line %d: missing ] in condition:\n%s\n", linenum, cond); return 0; } if ((!neg && !in) || (neg && in)) { HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); return 0; } } } if (j >= condl) return 1; } } else { // suffix if ((stripl >= condl) && strcmp(strip + stripl - condl, cond) == 0) return 1; if (utf8) { } else { for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) { if (cond[j] != ']') { if (cond[j] != strip[i]) { HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); return 0; } } else { in = 0; do { j--; if (strip[i] == cond[j]) in = 1; } while ((j > 0) && (cond[j] != '[')); if ((j == 0) && (cond[j] != '[')) { HUNSPELL_WARNING(stderr, "error: line: %d: missing ] in condition:\n%s\n", linenum, cond); return 0; } neg = (cond[j+1] == '^') ? 1 : 0; if ((!neg && !in) || (neg && in)) { HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); return 0; } } } if (j < 0) return 1; } } return 0; } qt-client-4.1.0/hunspell/affixmgr.hxx000066400000000000000000000227011217451700100176020ustar00rootroot00000000000000#ifndef _AFFIXMGR_HXX_ #define _AFFIXMGR_HXX_ #include "hunvisapi.h" #include #include "atypes.hxx" #include "baseaffix.hxx" #include "hashmgr.hxx" #include "phonet.hxx" #include "replist.hxx" // check flag duplication #define dupSFX (1 << 0) #define dupPFX (1 << 1) class PfxEntry; class SfxEntry; class LIBHUNSPELL_DLL_EXPORTED AffixMgr { PfxEntry * pStart[SETSIZE]; SfxEntry * sStart[SETSIZE]; PfxEntry * pFlag[SETSIZE]; SfxEntry * sFlag[SETSIZE]; HashMgr * pHMgr; HashMgr ** alldic; int * maxdic; char * keystring; char * trystring; char * encoding; struct cs_info * csconv; int utf8; int complexprefixes; FLAG compoundflag; FLAG compoundbegin; FLAG compoundmiddle; FLAG compoundend; FLAG compoundroot; FLAG compoundforbidflag; FLAG compoundpermitflag; int checkcompounddup; int checkcompoundrep; int checkcompoundcase; int checkcompoundtriple; int simplifiedtriple; FLAG forbiddenword; FLAG nosuggest; FLAG needaffix; int cpdmin; int numrep; replentry * reptable; RepList * iconvtable; RepList * oconvtable; int nummap; mapentry * maptable; int numbreak; char ** breaktable; int numcheckcpd; patentry * checkcpdtable; int simplifiedcpd; int numdefcpd; flagentry * defcpdtable; phonetable * phone; int maxngramsugs; int nosplitsugs; int sugswithdots; int cpdwordmax; int cpdmaxsyllable; char * cpdvowels; w_char * cpdvowels_utf16; int cpdvowels_utf16_len; char * cpdsyllablenum; const char * pfxappnd; // BUG: not stateless const char * sfxappnd; // BUG: not stateless FLAG sfxflag; // BUG: not stateless char * derived; // BUG: not stateless SfxEntry * sfx; // BUG: not stateless PfxEntry * pfx; // BUG: not stateless int checknum; char * wordchars; unsigned short * wordchars_utf16; int wordchars_utf16_len; char * ignorechars; unsigned short * ignorechars_utf16; int ignorechars_utf16_len; char * version; char * lang; int langnum; FLAG lemma_present; FLAG circumfix; FLAG onlyincompound; FLAG keepcase; FLAG substandard; int checksharps; int fullstrip; int havecontclass; // boolean variable char contclasses[CONTSIZE]; // flags of possible continuing classes (twofold affix) public: AffixMgr(const char * affpath, HashMgr** ptr, int * md, const char * key = NULL); ~AffixMgr(); struct hentry * affix_check(const char * word, int len, const unsigned short needflag = (unsigned short) 0, char in_compound = IN_CPD_NOT); struct hentry * prefix_check(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); inline int isSubset(const char * s1, const char * s2); struct hentry * prefix_check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); inline int isRevSubset(const char * s1, const char * end_of_s2, int len); struct hentry * suffix_check(const char * word, int len, int sfxopts, PfxEntry* ppfx, char ** wlst, int maxSug, int * ns, const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound = IN_CPD_NOT); struct hentry * suffix_check_twosfx(const char * word, int len, int sfxopts, PfxEntry* ppfx, const FLAG needflag = FLAG_NULL); char * affix_check_morph(const char * word, int len, const FLAG needflag = FLAG_NULL, char in_compound = IN_CPD_NOT); char * prefix_check_morph(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); char * suffix_check_morph (const char * word, int len, int sfxopts, PfxEntry * ppfx, const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound = IN_CPD_NOT); char * prefix_check_twosfx_morph(const char * word, int len, char in_compound, const FLAG needflag = FLAG_NULL); char * suffix_check_twosfx_morph(const char * word, int len, int sfxopts, PfxEntry * ppfx, const FLAG needflag = FLAG_NULL); char * morphgen(char * ts, int wl, const unsigned short * ap, unsigned short al, char * morph, char * targetmorph, int level); int expand_rootword(struct guessword * wlst, int maxn, const char * ts, int wl, const unsigned short * ap, unsigned short al, char * bad, int, char *); short get_syllable (const char * word, int wlen); int cpdrep_check(const char * word, int len); int cpdpat_check(const char * word, int len, hentry * r1, hentry * r2); int defcpd_check(hentry *** words, short wnum, hentry * rv, hentry ** rwords, char all); int cpdcase_check(const char * word, int len); inline int candidate_check(const char * word, int len); void setcminmax(int * cmin, int * cmax, const char * word, int len); struct hentry * compound_check(const char * word, int len, short wordnum, short numsyllable, short maxwordnum, short wnum, hentry ** words, char hu_mov_rule, char is_sug); int compound_check_morph(const char * word, int len, short wordnum, short numsyllable, short maxwordnum, short wnum, hentry ** words, char hu_mov_rule, char ** result, char * partresult); struct hentry * lookup(const char * word); int get_numrep() const; struct replentry * get_reptable() const; RepList * get_iconvtable() const; RepList * get_oconvtable() const; struct phonetable * get_phonetable() const; int get_nummap() const; struct mapentry * get_maptable() const; int get_numbreak() const; char ** get_breaktable() const; char * get_encoding(); int get_langnum() const; char * get_key_string(); char * get_try_string() const; const char * get_wordchars() const; unsigned short * get_wordchars_utf16(int * len) const; char * get_ignore() const; unsigned short * get_ignore_utf16(int * len) const; int get_compound() const; FLAG get_compoundflag() const; FLAG get_compoundbegin() const; FLAG get_forbiddenword() const; FLAG get_nosuggest() const; FLAG get_needaffix() const; FLAG get_onlyincompound() const; FLAG get_compoundroot() const; FLAG get_lemma_present() const; int get_checknum() const; const char * get_prefix() const; const char * get_suffix() const; const char * get_derived() const; const char * get_version() const; int have_contclass() const; int get_utf8() const; int get_complexprefixes() const; char * get_suffixed(char ) const; int get_maxngramsugs() const; int get_nosplitsugs() const; int get_sugswithdots(void) const; FLAG get_keepcase(void) const; int get_checksharps(void) const; char * encode_flag(unsigned short aflag) const; int get_fullstrip() const; private: int parse_file(const char * affpath, const char * key); int parse_flag(char * line, unsigned short * out, FileMgr * af); int parse_num(char * line, int * out, FileMgr * af); int parse_cpdsyllable(char * line, FileMgr * af); int parse_reptable(char * line, FileMgr * af); int parse_convtable(char * line, FileMgr * af, RepList ** rl, const char * keyword); int parse_phonetable(char * line, FileMgr * af); int parse_maptable(char * line, FileMgr * af); int parse_breaktable(char * line, FileMgr * af); int parse_checkcpdtable(char * line, FileMgr * af); int parse_defcpdtable(char * line, FileMgr * af); int parse_affix(char * line, const char at, FileMgr * af, char * dupflags); void reverse_condition(char *); void debugflag(char * result, unsigned short flag); int condlen(char *); int encodeit(affentry &entry, char * cs); int build_pfxtree(PfxEntry* pfxptr); int build_sfxtree(SfxEntry* sfxptr); int process_pfx_order(); int process_sfx_order(); PfxEntry * process_pfx_in_order(PfxEntry * ptr, PfxEntry * nptr); SfxEntry * process_sfx_in_order(SfxEntry * ptr, SfxEntry * nptr); int process_pfx_tree_to_list(); int process_sfx_tree_to_list(); int redundant_condition(char, char * strip, int stripl, const char * cond, int); }; #endif qt-client-4.1.0/hunspell/atypes.hxx000066400000000000000000000034561217451700100173120ustar00rootroot00000000000000#ifndef _ATYPES_HXX_ #define _ATYPES_HXX_ #ifndef HUNSPELL_WARNING #include #ifdef HUNSPELL_WARNING_ON #define HUNSPELL_WARNING fprintf #else // empty inline function to switch off warnings (instead of the C99 standard variadic macros) static inline void HUNSPELL_WARNING(FILE *, const char *, ...) {} #endif #endif // HUNSTEM def. #define HUNSTEM #include "hashmgr.hxx" #include "w_char.hxx" #define SETSIZE 256 #define CONTSIZE 65536 #define MAXWORDLEN 100 #define MAXWORDUTF8LEN 256 // affentry options #define aeXPRODUCT (1 << 0) #define aeUTF8 (1 << 1) #define aeALIASF (1 << 2) #define aeALIASM (1 << 3) #define aeLONGCOND (1 << 4) // compound options #define IN_CPD_NOT 0 #define IN_CPD_BEGIN 1 #define IN_CPD_END 2 #define IN_CPD_OTHER 3 #define MAXLNLEN 8192 #define MINCPDLEN 3 #define MAXCOMPOUND 10 #define MAXCONDLEN 20 #define MAXCONDLEN_1 (MAXCONDLEN - sizeof(char *)) #define MAXACC 1000 #define FLAG unsigned short #define FLAG_NULL 0x00 #define FREE_FLAG(a) a = 0 #define TESTAFF( a, b , c ) flag_bsearch((unsigned short *) a, (unsigned short) b, c) struct affentry { char * strip; char * appnd; unsigned char stripl; unsigned char appndl; char numconds; char opts; unsigned short aflag; unsigned short * contclass; short contclasslen; union { char conds[MAXCONDLEN]; struct { char conds1[MAXCONDLEN_1]; char * conds2; } l; } c; char * morphcode; }; struct guessword { char * word; bool allow; char * orig; }; struct mapentry { char ** set; int len; }; struct flagentry { FLAG * def; int len; }; struct patentry { char * pattern; char * pattern2; char * pattern3; FLAG cond; FLAG cond2; }; #endif qt-client-4.1.0/hunspell/baseaffix.hxx000066400000000000000000000010771217451700100177320ustar00rootroot00000000000000#ifndef _BASEAFF_HXX_ #define _BASEAFF_HXX_ #include "hunvisapi.h" class LIBHUNSPELL_DLL_EXPORTED AffEntry { protected: char * appnd; char * strip; unsigned char appndl; unsigned char stripl; char numconds; char opts; unsigned short aflag; union { char conds[MAXCONDLEN]; struct { char conds1[MAXCONDLEN_1]; char * conds2; } l; } c; char * morphcode; unsigned short * contclass; short contclasslen; }; #endif qt-client-4.1.0/hunspell/config.h000066400000000000000000000131731217451700100166670ustar00rootroot00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #define CRAY_STACKSEG_END 1 /* Define to 1 if using `alloca.c'. */ #define C_ALLOCA 1 /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define to 1 if you have `alloca', as a function or macro. */ #define HAVE_ALLOCA 1 /* Define to 1 if you have and it should be used (not on Ultrix). */ #define HAVE_ALLOCA_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ARGZ_H 1 /* "Define if you have the header" */ #undef HAVE_CURSES_H /* Define if the GNU dcgettext() function is already present or preinstalled. */ #define HAVE_DCGETTEXT 1 /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define to 1 if you have the header file. */ #define HAVE_ERROR_H 1 /* Define to 1 if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `feof_unlocked' function. */ #define HAVE_FEOF_UNLOCKED 1 /* Define to 1 if you have the `fgets_unlocked' function. */ #define HAVE_FGETS_UNLOCKED 1 /* Define to 1 if you have the `getcwd' function. */ #define HAVE_GETCWD 1 /* Define to 1 if you have the `getc_unlocked' function. */ #define HAVE_GETC_UNLOCKED 1 /* Define to 1 if you have the `getegid' function. */ #define HAVE_GETEGID 1 /* Define to 1 if you have the `geteuid' function. */ #define HAVE_GETEUID 1 /* Define to 1 if you have the `getgid' function. */ #define HAVE_GETGID 1 /* Define to 1 if you have the `getpagesize' function. */ #define HAVE_GETPAGESIZE 1 /* Define if the GNU gettext() function is already present or preinstalled. */ #define HAVE_GETTEXT 1 /* Define to 1 if you have the `getuid' function. */ #define HAVE_GETUID 1 /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define if you have and nl_langinfo(CODESET). */ #define HAVE_LANGINFO_CODESET 1 /* Define if your file defines LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 /* Define to 1 if you have the header file. */ #define HAVE_LIBINTL_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_LOCALE_H 1 /* Define to 1 if you have the `memchr' function. */ #define HAVE_MEMCHR 1 /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mempcpy' function. */ #define HAVE_MEMPCPY 1 /* Define to 1 if you have a working `mmap' system call. */ #define HAVE_MMAP 1 /* Define to 1 if you have the `munmap' function. */ #define HAVE_MUNMAP 1 /* "Define if you have the header" */ #define HAVE_NCURSESW_H 1 /* Define to 1 if you have the header file. */ #define HAVE_NL_TYPES_H 1 /* Define to 1 if you have the `putenv' function. */ #define HAVE_PUTENV 1 /* "Define if you have fancy command input editing with Readline" */ #undef HAVE_READLINE /* Define to 1 if you have the `setenv' function. */ #define HAVE_SETENV 1 /* Define to 1 if you have the `setlocale' function. */ #define HAVE_SETLOCALE 1 /* Define to 1 if you have the header file. */ #define HAVE_STDDEF_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the `stpcpy' function. */ #define HAVE_STPCPY 1 /* Define to 1 if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 /* Define to 1 if you have the `strchr' function. */ #define HAVE_STRCHR 1 /* Define to 1 if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define to 1 if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strstr' function. */ #define HAVE_STRSTR 1 /* Define to 1 if you have the `strtoul' function. */ #define HAVE_STRTOUL 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the `tsearch' function. */ #define HAVE_TSEARCH 1 /* Define to 1 if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if you have the `__argz_count' function. */ #define HAVE___ARGZ_COUNT 1 /* Define to 1 if you have the `__argz_next' function. */ #define HAVE___ARGZ_NEXT 1 /* Define to 1 if you have the `__argz_stringify' function. */ #define HAVE___ARGZ_STRINGIFY 1 /* "Define if you use exterimental functions" */ #undef HUNSPELL_EXPERIMENTAL /* "Define if you need warning messages" */ #define HUNSPELL_WARNING_ON /* Define as const if the declaration of iconv() needs const. */ #define ICONV_CONST 1 /* Name of package */ #define PACKAGE /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT /* Define to the full name of this package. */ #define PACKAGE_NAME /* Define to the full name and version of this package. */ #define PACKAGE_STRING /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME /* Define to the version of this package. */ #define PACKAGE_VERSION "1.2.11" #define VERSION "1.2.11" qt-client-4.1.0/hunspell/csutil.cxx000066400000000000000000003671641217451700100173140ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include #include "csutil.hxx" #include "atypes.hxx" #include "langnum.hxx" #ifdef OPENOFFICEORG # include #else # ifndef MOZILLA_CLIENT # include "utf_info.cxx" # define UTF_LST_LEN (sizeof(utf_lst) / (sizeof(unicode_info))) # endif #endif #ifdef MOZILLA_CLIENT #include "nsCOMPtr.h" #include "nsServiceManagerUtils.h" #include "nsIUnicodeEncoder.h" #include "nsIUnicodeDecoder.h" #include "nsICaseConversion.h" #include "nsICharsetConverterManager.h" #include "nsUnicharUtilCIID.h" #include "nsUnicharUtils.h" static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); static NS_DEFINE_CID(kUnicharUtilCID, NS_UNICHARUTIL_CID); #endif static struct unicode_info2 * utf_tbl = NULL; static int utf_tbl_count = 0; // utf_tbl can be used by multiple Hunspell instances /* only UTF-16 (BMP) implementation */ char * u16_u8(char * dest, int size, const w_char * src, int srclen) { signed char * u8 = (signed char *)dest; signed char * u8_max = (signed char *)(u8 + size); const w_char * u2 = src; const w_char * u2_max = src + srclen; while ((u2 < u2_max) && (u8 < u8_max)) { if (u2->h) { // > 0xFF // XXX 4-byte haven't implemented yet. if (u2->h >= 0x08) { // >= 0x800 (3-byte UTF-8 character) *u8 = 0xe0 + (u2->h >> 4); u8++; if (u8 < u8_max) { *u8 = 0x80 + ((u2->h & 0xf) << 2) + (u2->l >> 6); u8++; if (u8 < u8_max) { *u8 = 0x80 + (u2->l & 0x3f); u8++; } } } else { // < 0x800 (2-byte UTF-8 character) *u8 = 0xc0 + (u2->h << 2) + (u2->l >> 6); u8++; if (u8 < u8_max) { *u8 = 0x80 + (u2->l & 0x3f); u8++; } } } else { // <= 0xFF if (u2->l & 0x80) { // >0x80 (2-byte UTF-8 character) *u8 = 0xc0 + (u2->l >> 6); u8++; if (u8 < u8_max) { *u8 = 0x80 + (u2->l & 0x3f); u8++; } } else { // < 0x80 (1-byte UTF-8 character) *u8 = u2->l; u8++; } } u2++; } *u8 = '\0'; return dest; } /* only UTF-16 (BMP) implementation */ int u8_u16(w_char * dest, int size, const char * src) { const signed char * u8 = (const signed char *)src; w_char * u2 = dest; w_char * u2_max = u2 + size; while ((u2 < u2_max) && *u8) { switch ((*u8) & 0xf0) { case 0x00: case 0x10: case 0x20: case 0x30: case 0x40: case 0x50: case 0x60: case 0x70: { u2->h = 0; u2->l = *u8; break; } case 0x80: case 0x90: case 0xa0: case 0xb0: { HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Unexpected continuation bytes in %ld. character position\n%s\n", static_cast(u8 - (signed char *)src), src); u2->h = 0xff; u2->l = 0xfd; break; } case 0xc0: case 0xd0: { // 2-byte UTF-8 codes if ((*(u8+1) & 0xc0) == 0x80) { u2->h = (*u8 & 0x1f) >> 2; u2->l = (*u8 << 6) + (*(u8+1) & 0x3f); u8++; } else { HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast(u8 - (signed char *)src), src); u2->h = 0xff; u2->l = 0xfd; } break; } case 0xe0: { // 3-byte UTF-8 codes if ((*(u8+1) & 0xc0) == 0x80) { u2->h = ((*u8 & 0x0f) << 4) + ((*(u8+1) & 0x3f) >> 2); u8++; if ((*(u8+1) & 0xc0) == 0x80) { u2->l = (*u8 << 6) + (*(u8+1) & 0x3f); u8++; } else { HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast(u8 - (signed char *)src), src); u2->h = 0xff; u2->l = 0xfd; } } else { HUNSPELL_WARNING(stderr, "UTF-8 encoding error. Missing continuation byte in %ld. character position:\n%s\n", static_cast(u8 - (signed char *)src), src); u2->h = 0xff; u2->l = 0xfd; } break; } case 0xf0: { // 4 or more byte UTF-8 codes HUNSPELL_WARNING(stderr, "This UTF-8 encoding can't convert to UTF-16:\n%s\n", src); u2->h = 0xff; u2->l = 0xfd; return -1; } } u8++; u2++; } return (int)(u2 - dest); } void flag_qsort(unsigned short flags[], int begin, int end) { unsigned short reg; if (end > begin) { unsigned short pivot = flags[begin]; int l = begin + 1; int r = end; while(l < r) { if (flags[l] <= pivot) { l++; } else { r--; reg = flags[l]; flags[l] = flags[r]; flags[r] = reg; } } l--; reg = flags[begin]; flags[begin] = flags[l]; flags[l] = reg; flag_qsort(flags, begin, l); flag_qsort(flags, r, end); } } int flag_bsearch(unsigned short flags[], unsigned short flag, int length) { int mid; int left = 0; int right = length - 1; while (left <= right) { mid = (left + right) / 2; if (flags[mid] == flag) return 1; if (flag < flags[mid]) right = mid - 1; else left = mid + 1; } return 0; } // strip strings into token based on single char delimiter // acts like strsep() but only uses a delim char and not // a delim string // default delimiter: white space characters char * mystrsep(char ** stringp, const char delim) { char * mp = *stringp; if (*mp != '\0') { char * dp; if (delim) { dp = strchr(mp, delim); } else { // don't use isspace() here, the string can be in some random charset // that's way different than the locale's for (dp = mp; (*dp && *dp != ' ' && *dp != '\t'); dp++); if (!*dp) dp = NULL; } if (dp) { *stringp = dp+1; int nc = (int)((unsigned long)dp - (unsigned long)mp); *(mp+nc) = '\0'; } else { *stringp = mp + strlen(mp); } return mp; } return NULL; } // replaces strdup with ansi version char * mystrdup(const char * s) { char * d = NULL; if (s) { int sl = strlen(s)+1; d = (char *) malloc(sl); if (d) { memcpy(d,s,sl); } else { HUNSPELL_WARNING(stderr, "Can't allocate memory.\n"); } } return d; } // strcat for limited length destination string char * mystrcat(char * dest, const char * st, int max) { int len; int len2; if (dest == NULL || st == NULL) return dest; len = strlen(dest); len2 = strlen(st); if (len + len2 + 1 > max) return dest; strcpy(dest + len, st); return dest; } // remove cross-platform text line end characters void mychomp(char * s) { int k = strlen(s); if ((k > 0) && ((*(s+k-1)=='\r') || (*(s+k-1)=='\n'))) *(s+k-1) = '\0'; if ((k > 1) && (*(s+k-2) == '\r')) *(s+k-2) = '\0'; } // does an ansi strdup of the reverse of a string char * myrevstrdup(const char * s) { char * d = NULL; if (s) { int sl = strlen(s); d = (char *) malloc(sl+1); if (d) { const char * p = s + sl - 1; char * q = d; while (p >= s) *q++ = *p--; *q = '\0'; } else { HUNSPELL_WARNING(stderr, "Can't allocate memory.\n"); } } return d; } // break text to lines // return number of lines int line_tok(const char * text, char *** lines, char breakchar) { int linenum = 0; if (!text) { return linenum; } char * dup = mystrdup(text); char * p = strchr(dup, breakchar); while (p) { linenum++; *p = '\0'; p++; p = strchr(p, breakchar); } linenum++; // fprintf(stderr, "LINEN:%d %p %p\n", linenum, lines, *lines); *lines = (char **) malloc(linenum * sizeof(char *)); // fprintf(stderr, "hello\n"); if (!(*lines)) { free(dup); return 0; } p = dup; int l = 0; for (int i = 0; i < linenum; i++) { if (*p != '\0') { (*lines)[l] = mystrdup(p); if (!(*lines)[l]) { for (i = 0; i < l; i++) free((*lines)[i]); free(dup); return 0; } l++; } p += strlen(p) + 1; } free(dup); if (!l) free(*lines); return l; } // uniq line in place char * line_uniq(char * text, char breakchar) { char ** lines; int linenum = line_tok(text, &lines, breakchar); int i; strcpy(text, lines[0]); for ( i = 1; i < linenum; i++ ) { int dup = 0; for (int j = 0; j < i; j++) { if (strcmp(lines[i], lines[j]) == 0) dup = 1; } if (!dup) { if ((i > 1) || (*(lines[0]) != '\0')) { sprintf(text + strlen(text), "%c", breakchar); } strcat(text, lines[i]); } } for ( i = 0; i < linenum; i++ ) { if (lines[i]) free(lines[i]); } if (lines) free(lines); return text; } // uniq and boundary for compound analysis: "1\n\2\n\1" -> " ( \1 | \2 ) " char * line_uniq_app(char ** text, char breakchar) { if (!strchr(*text, breakchar)) { return *text; } char ** lines; int i; int linenum = line_tok(*text, &lines, breakchar); int dup = 0; for (i = 0; i < linenum; i++) { for (int j = 0; j < (i - 1); j++) { if (strcmp(lines[i], lines[j]) == 0) { *(lines[i]) = '\0'; dup++; break; } } } if ((linenum - dup) == 1) { strcpy(*text, lines[0]); freelist(&lines, linenum); return *text; } char * newtext = (char *) malloc(strlen(*text) + 2 * linenum + 3 + 1); if (newtext) { free(*text); *text = newtext; } else { freelist(&lines, linenum); return *text; } strcpy(*text," ( "); for (i = 0; i < linenum; i++) if (*(lines[i])) { sprintf(*text + strlen(*text), "%s%s", lines[i], " | "); } (*text)[strlen(*text) - 2] = ')'; // " ) " freelist(&lines, linenum); return *text; } // append s to ends of every lines in text void strlinecat(char * dest, const char * s) { char * dup = mystrdup(dest); char * source = dup; int len = strlen(s); if (dup) { while (*source) { if (*source == '\n') { strncpy(dest, s, len); dest += len; } *dest = *source; source++; dest++; } strcpy(dest, s); free(dup); } } // change \n to char c char * tr(char * text, char oldc, char newc) { char * p; for (p = text; *p; p++) if (*p == oldc) *p = newc; return text; } // morphcmp(): compare MORPH_DERI_SFX, MORPH_INFL_SFX and MORPH_TERM_SFX fields // in the first line of the inputs // return 0, if inputs equal // return 1, if inputs may equal with a secondary suffix // otherwise return -1 int morphcmp(const char * s, const char * t) { int se = 0; int te = 0; const char * sl; const char * tl; const char * olds; const char * oldt; if (!s || !t) return 1; olds = s; sl = strchr(s, '\n'); s = strstr(s, MORPH_DERI_SFX); if (!s || (sl && sl < s)) s = strstr(olds, MORPH_INFL_SFX); if (!s || (sl && sl < s)) { s= strstr(olds, MORPH_TERM_SFX); olds = NULL; } oldt = t; tl = strchr(t, '\n'); t = strstr(t, MORPH_DERI_SFX); if (!t || (tl && tl < t)) t = strstr(oldt, MORPH_INFL_SFX); if (!t || (tl && tl < t)) { t = strstr(oldt, MORPH_TERM_SFX); oldt = NULL; } while (s && t && (!sl || sl > s) && (!tl || tl > t)) { s += MORPH_TAG_LEN; t += MORPH_TAG_LEN; se = 0; te = 0; while ((*s == *t) && !se && !te) { s++; t++; switch(*s) { case ' ': case '\n': case '\t': case '\0': se = 1; } switch(*t) { case ' ': case '\n': case '\t': case '\0': te = 1; } } if (!se || !te) { // not terminal suffix difference if (olds) return -1; return 1; } olds = s; s = strstr(s, MORPH_DERI_SFX); if (!s || (sl && sl < s)) s = strstr(olds, MORPH_INFL_SFX); if (!s || (sl && sl < s)) { s = strstr(olds, MORPH_TERM_SFX); olds = NULL; } oldt = t; t = strstr(t, MORPH_DERI_SFX); if (!t || (tl && tl < t)) t = strstr(oldt, MORPH_INFL_SFX); if (!t || (tl && tl < t)) { t = strstr(oldt, MORPH_TERM_SFX); oldt = NULL; } } if (!s && !t && se && te) return 0; return 1; } int get_sfxcount(const char * morph) { if (!morph || !*morph) return 0; int n = 0; const char * old = morph; morph = strstr(morph, MORPH_DERI_SFX); if (!morph) morph = strstr(old, MORPH_INFL_SFX); if (!morph) morph = strstr(old, MORPH_TERM_SFX); while (morph) { n++; old = morph; morph = strstr(morph + 1, MORPH_DERI_SFX); if (!morph) morph = strstr(old + 1, MORPH_INFL_SFX); if (!morph) morph = strstr(old + 1, MORPH_TERM_SFX); } return n; } int fieldlen(const char * r) { int n = 0; while (r && *r != ' ' && *r != '\t' && *r != '\0' && *r != '\n') { r++; n++; } return n; } char * copy_field(char * dest, const char * morph, const char * var) { if (!morph) return NULL; const char * beg = strstr(morph, var); if (beg) { char * d = dest; for (beg += MORPH_TAG_LEN; *beg != ' ' && *beg != '\t' && *beg != '\n' && *beg != '\0'; d++, beg++) { *d = *beg; } *d = '\0'; return dest; } return NULL; } char * mystrrep(char * word, const char * pat, const char * rep) { char * pos = strstr(word, pat); if (pos) { int replen = strlen(rep); int patlen = strlen(pat); if (replen < patlen) { char * end = word + strlen(word); char * next = pos + replen; char * prev = pos + strlen(pat); for (; prev < end; *next = *prev, prev++, next++); *next = '\0'; } else if (replen > patlen) { char * end = pos + patlen; char * next = word + strlen(word) + replen - patlen; char * prev = next - replen + patlen; for (; prev >= end; *next = *prev, prev--, next--); } strncpy(pos, rep, replen); } return word; } // reverse word int reverseword(char * word) { char r; for (char * dest = word + strlen(word) - 1; word < dest; word++, dest--) { r=*word; *word = *dest; *dest = r; } return 0; } // reverse word (error: 1) int reverseword_utf(char * word) { w_char w[MAXWORDLEN]; w_char * p; w_char r; int l = u8_u16(w, MAXWORDLEN, word); if (l == -1) return 1; p = w; for (w_char * dest = w + l - 1; p < dest; p++, dest--) { r=*p; *p = *dest; *dest = r; } u16_u8(word, MAXWORDUTF8LEN, w, l); return 0; } int uniqlist(char ** list, int n) { int i; if (n < 2) return n; for (i = 0; i < n; i++) { for (int j = 0; j < i; j++) { if (list[j] && list[i] && (strcmp(list[j], list[i]) == 0)) { free(list[i]); list[i] = NULL; break; } } } int m = 1; for (i = 1; i < n; i++) if (list[i]) { list[m] = list[i]; m++; } return m; } void freelist(char *** list, int n) { if (list && *list && n > 0) { for (int i = 0; i < n; i++) if ((*list)[i]) free((*list)[i]); free(*list); *list = NULL; } } // convert null terminated string to all caps void mkallcap(char * p, const struct cs_info * csconv) { while (*p != '\0') { *p = csconv[((unsigned char) *p)].cupper; p++; } } // convert null terminated string to all little void mkallsmall(char * p, const struct cs_info * csconv) { while (*p != '\0') { *p = csconv[((unsigned char) *p)].clower; p++; } } void mkallsmall_utf(w_char * u, int nc, int langnum) { for (int i = 0; i < nc; i++) { unsigned short idx = (u[i].h << 8) + u[i].l; if (idx != unicodetolower(idx, langnum)) { u[i].h = (unsigned char) (unicodetolower(idx, langnum) >> 8); u[i].l = (unsigned char) (unicodetolower(idx, langnum) & 0x00FF); } } } void mkallcap_utf(w_char * u, int nc, int langnum) { for (int i = 0; i < nc; i++) { unsigned short idx = (u[i].h << 8) + u[i].l; if (idx != unicodetoupper(idx, langnum)) { u[i].h = (unsigned char) (unicodetoupper(idx, langnum) >> 8); u[i].l = (unsigned char) (unicodetoupper(idx, langnum) & 0x00FF); } } } // convert null terminated string to have initial capital void mkinitcap(char * p, const struct cs_info * csconv) { if (*p != '\0') *p = csconv[((unsigned char)*p)].cupper; } // conversion function for protected memory void store_pointer(char * dest, char * source) { memcpy(dest, &source, sizeof(char *)); } // conversion function for protected memory char * get_stored_pointer(const char * s) { char * p; memcpy(&p, s, sizeof(char *)); return p; } #ifndef MOZILLA_CLIENT // convert null terminated string to all caps using encoding void enmkallcap(char * d, const char * p, const char * encoding) { struct cs_info * csconv = get_current_cs(encoding); while (*p != '\0') { *d++ = csconv[((unsigned char) *p)].cupper; p++; } *d = '\0'; } // convert null terminated string to all little using encoding void enmkallsmall(char * d, const char * p, const char * encoding) { struct cs_info * csconv = get_current_cs(encoding); while (*p != '\0') { *d++ = csconv[((unsigned char) *p)].clower; p++; } *d = '\0'; } // convert null terminated string to have initial capital using encoding void enmkinitcap(char * d, const char * p, const char * encoding) { struct cs_info * csconv = get_current_cs(encoding); memcpy(d,p,(strlen(p)+1)); if (*p != '\0') *d= csconv[((unsigned char)*p)].cupper; } // these are simple character mappings for the // encodings supported // supplying isupper, tolower, and toupper static struct cs_info iso1_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0xfd, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0xdd }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xff } }; static struct cs_info iso2_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x01, 0xb1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x01, 0xb3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x01, 0xb5, 0xa5 }, { 0x01, 0xb6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x01, 0xb9, 0xa9 }, { 0x01, 0xba, 0xaa }, { 0x01, 0xbb, 0xab }, { 0x01, 0xbc, 0xac }, { 0x00, 0xad, 0xad }, { 0x01, 0xbe, 0xae }, { 0x01, 0xbf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xa1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xa3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xa5 }, { 0x00, 0xb6, 0xa6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xa9 }, { 0x00, 0xba, 0xaa }, { 0x00, 0xbb, 0xab }, { 0x00, 0xbc, 0xac }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xae }, { 0x00, 0xbf, 0xaf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0xfd, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0xdd }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xff } }; static struct cs_info iso3_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x01, 0xb1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x01, 0xb6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x01, 0x69, 0xa9 }, { 0x01, 0xba, 0xaa }, { 0x01, 0xbb, 0xab }, { 0x01, 0xbc, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x01, 0xbf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xa1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xa6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0x49 }, { 0x00, 0xba, 0xaa }, { 0x00, 0xbb, 0xab }, { 0x00, 0xbc, 0xac }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xaf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x00, 0xc3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x00, 0xd0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0xfd, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xe3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xf0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0xdd }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xff } }; static struct cs_info iso4_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x01, 0xb1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x01, 0xb3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x01, 0xb5, 0xa5 }, { 0x01, 0xb6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x01, 0xb9, 0xa9 }, { 0x01, 0xba, 0xaa }, { 0x01, 0xbb, 0xab }, { 0x01, 0xbc, 0xac }, { 0x00, 0xad, 0xad }, { 0x01, 0xbe, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xa1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xa3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xa5 }, { 0x00, 0xb6, 0xa6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xa9 }, { 0x00, 0xba, 0xaa }, { 0x00, 0xbb, 0xab }, { 0x00, 0xbc, 0xac }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xae }, { 0x00, 0xbf, 0xbf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0xfd, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0xdd }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xff } }; static struct cs_info iso5_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x01, 0xf1, 0xa1 }, { 0x01, 0xf2, 0xa2 }, { 0x01, 0xf3, 0xa3 }, { 0x01, 0xf4, 0xa4 }, { 0x01, 0xf5, 0xa5 }, { 0x01, 0xf6, 0xa6 }, { 0x01, 0xf7, 0xa7 }, { 0x01, 0xf8, 0xa8 }, { 0x01, 0xf9, 0xa9 }, { 0x01, 0xfa, 0xaa }, { 0x01, 0xfb, 0xab }, { 0x01, 0xfc, 0xac }, { 0x00, 0xad, 0xad }, { 0x01, 0xfe, 0xae }, { 0x01, 0xff, 0xaf }, { 0x01, 0xd0, 0xb0 }, { 0x01, 0xd1, 0xb1 }, { 0x01, 0xd2, 0xb2 }, { 0x01, 0xd3, 0xb3 }, { 0x01, 0xd4, 0xb4 }, { 0x01, 0xd5, 0xb5 }, { 0x01, 0xd6, 0xb6 }, { 0x01, 0xd7, 0xb7 }, { 0x01, 0xd8, 0xb8 }, { 0x01, 0xd9, 0xb9 }, { 0x01, 0xda, 0xba }, { 0x01, 0xdb, 0xbb }, { 0x01, 0xdc, 0xbc }, { 0x01, 0xdd, 0xbd }, { 0x01, 0xde, 0xbe }, { 0x01, 0xdf, 0xbf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x00, 0xd0, 0xb0 }, { 0x00, 0xd1, 0xb1 }, { 0x00, 0xd2, 0xb2 }, { 0x00, 0xd3, 0xb3 }, { 0x00, 0xd4, 0xb4 }, { 0x00, 0xd5, 0xb5 }, { 0x00, 0xd6, 0xb6 }, { 0x00, 0xd7, 0xb7 }, { 0x00, 0xd8, 0xb8 }, { 0x00, 0xd9, 0xb9 }, { 0x00, 0xda, 0xba }, { 0x00, 0xdb, 0xbb }, { 0x00, 0xdc, 0xbc }, { 0x00, 0xdd, 0xbd }, { 0x00, 0xde, 0xbe }, { 0x00, 0xdf, 0xbf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xf0 }, { 0x00, 0xf1, 0xa1 }, { 0x00, 0xf2, 0xa2 }, { 0x00, 0xf3, 0xa3 }, { 0x00, 0xf4, 0xa4 }, { 0x00, 0xf5, 0xa5 }, { 0x00, 0xf6, 0xa6 }, { 0x00, 0xf7, 0xa7 }, { 0x00, 0xf8, 0xa8 }, { 0x00, 0xf9, 0xa9 }, { 0x00, 0xfa, 0xaa }, { 0x00, 0xfb, 0xab }, { 0x00, 0xfc, 0xac }, { 0x00, 0xfd, 0xfd }, { 0x00, 0xfe, 0xae }, { 0x00, 0xff, 0xaf } }; static struct cs_info iso6_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x00, 0xc0, 0xc0 }, { 0x00, 0xc1, 0xc1 }, { 0x00, 0xc2, 0xc2 }, { 0x00, 0xc3, 0xc3 }, { 0x00, 0xc4, 0xc4 }, { 0x00, 0xc5, 0xc5 }, { 0x00, 0xc6, 0xc6 }, { 0x00, 0xc7, 0xc7 }, { 0x00, 0xc8, 0xc8 }, { 0x00, 0xc9, 0xc9 }, { 0x00, 0xca, 0xca }, { 0x00, 0xcb, 0xcb }, { 0x00, 0xcc, 0xcc }, { 0x00, 0xcd, 0xcd }, { 0x00, 0xce, 0xce }, { 0x00, 0xcf, 0xcf }, { 0x00, 0xd0, 0xd0 }, { 0x00, 0xd1, 0xd1 }, { 0x00, 0xd2, 0xd2 }, { 0x00, 0xd3, 0xd3 }, { 0x00, 0xd4, 0xd4 }, { 0x00, 0xd5, 0xd5 }, { 0x00, 0xd6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x00, 0xd8, 0xd8 }, { 0x00, 0xd9, 0xd9 }, { 0x00, 0xda, 0xda }, { 0x00, 0xdb, 0xdb }, { 0x00, 0xdc, 0xdc }, { 0x00, 0xdd, 0xdd }, { 0x00, 0xde, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xe0 }, { 0x00, 0xe1, 0xe1 }, { 0x00, 0xe2, 0xe2 }, { 0x00, 0xe3, 0xe3 }, { 0x00, 0xe4, 0xe4 }, { 0x00, 0xe5, 0xe5 }, { 0x00, 0xe6, 0xe6 }, { 0x00, 0xe7, 0xe7 }, { 0x00, 0xe8, 0xe8 }, { 0x00, 0xe9, 0xe9 }, { 0x00, 0xea, 0xea }, { 0x00, 0xeb, 0xeb }, { 0x00, 0xec, 0xec }, { 0x00, 0xed, 0xed }, { 0x00, 0xee, 0xee }, { 0x00, 0xef, 0xef }, { 0x00, 0xf0, 0xf0 }, { 0x00, 0xf1, 0xf1 }, { 0x00, 0xf2, 0xf2 }, { 0x00, 0xf3, 0xf3 }, { 0x00, 0xf4, 0xf4 }, { 0x00, 0xf5, 0xf5 }, { 0x00, 0xf6, 0xf6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xf8 }, { 0x00, 0xf9, 0xf9 }, { 0x00, 0xfa, 0xfa }, { 0x00, 0xfb, 0xfb }, { 0x00, 0xfc, 0xfc }, { 0x00, 0xfd, 0xfd }, { 0x00, 0xfe, 0xfe }, { 0x00, 0xff, 0xff } }; static struct cs_info iso7_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x01, 0xdc, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x01, 0xdd, 0xb8 }, { 0x01, 0xde, 0xb9 }, { 0x01, 0xdf, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x01, 0xfc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x01, 0xfd, 0xbe }, { 0x01, 0xfe, 0xbf }, { 0x00, 0xc0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x00, 0xd2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x01, 0xf7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x00, 0xdc, 0xb6 }, { 0x00, 0xdd, 0xb8 }, { 0x00, 0xde, 0xb9 }, { 0x00, 0xdf, 0xba }, { 0x00, 0xe0, 0xe0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd3 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xd7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xbc }, { 0x00, 0xfd, 0xbe }, { 0x00, 0xfe, 0xbf }, { 0x00, 0xff, 0xff } }; static struct cs_info iso8_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x00, 0xc0, 0xc0 }, { 0x00, 0xc1, 0xc1 }, { 0x00, 0xc2, 0xc2 }, { 0x00, 0xc3, 0xc3 }, { 0x00, 0xc4, 0xc4 }, { 0x00, 0xc5, 0xc5 }, { 0x00, 0xc6, 0xc6 }, { 0x00, 0xc7, 0xc7 }, { 0x00, 0xc8, 0xc8 }, { 0x00, 0xc9, 0xc9 }, { 0x00, 0xca, 0xca }, { 0x00, 0xcb, 0xcb }, { 0x00, 0xcc, 0xcc }, { 0x00, 0xcd, 0xcd }, { 0x00, 0xce, 0xce }, { 0x00, 0xcf, 0xcf }, { 0x00, 0xd0, 0xd0 }, { 0x00, 0xd1, 0xd1 }, { 0x00, 0xd2, 0xd2 }, { 0x00, 0xd3, 0xd3 }, { 0x00, 0xd4, 0xd4 }, { 0x00, 0xd5, 0xd5 }, { 0x00, 0xd6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x00, 0xd8, 0xd8 }, { 0x00, 0xd9, 0xd9 }, { 0x00, 0xda, 0xda }, { 0x00, 0xdb, 0xdb }, { 0x00, 0xdc, 0xdc }, { 0x00, 0xdd, 0xdd }, { 0x00, 0xde, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xe0 }, { 0x00, 0xe1, 0xe1 }, { 0x00, 0xe2, 0xe2 }, { 0x00, 0xe3, 0xe3 }, { 0x00, 0xe4, 0xe4 }, { 0x00, 0xe5, 0xe5 }, { 0x00, 0xe6, 0xe6 }, { 0x00, 0xe7, 0xe7 }, { 0x00, 0xe8, 0xe8 }, { 0x00, 0xe9, 0xe9 }, { 0x00, 0xea, 0xea }, { 0x00, 0xeb, 0xeb }, { 0x00, 0xec, 0xec }, { 0x00, 0xed, 0xed }, { 0x00, 0xee, 0xee }, { 0x00, 0xef, 0xef }, { 0x00, 0xf0, 0xf0 }, { 0x00, 0xf1, 0xf1 }, { 0x00, 0xf2, 0xf2 }, { 0x00, 0xf3, 0xf3 }, { 0x00, 0xf4, 0xf4 }, { 0x00, 0xf5, 0xf5 }, { 0x00, 0xf6, 0xf6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xf8 }, { 0x00, 0xf9, 0xf9 }, { 0x00, 0xfa, 0xfa }, { 0x00, 0xfb, 0xfb }, { 0x00, 0xfc, 0xfc }, { 0x00, 0xfd, 0xfd }, { 0x00, 0xfe, 0xfe }, { 0x00, 0xff, 0xff } }; static struct cs_info iso9_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0xfd, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0xdd }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0x69, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0x49 }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xff } }; static struct cs_info iso10_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x00, 0xc0, 0xc0 }, { 0x00, 0xc1, 0xc1 }, { 0x00, 0xc2, 0xc2 }, { 0x00, 0xc3, 0xc3 }, { 0x00, 0xc4, 0xc4 }, { 0x00, 0xc5, 0xc5 }, { 0x00, 0xc6, 0xc6 }, { 0x00, 0xc7, 0xc7 }, { 0x00, 0xc8, 0xc8 }, { 0x00, 0xc9, 0xc9 }, { 0x00, 0xca, 0xca }, { 0x00, 0xcb, 0xcb }, { 0x00, 0xcc, 0xcc }, { 0x00, 0xcd, 0xcd }, { 0x00, 0xce, 0xce }, { 0x00, 0xcf, 0xcf }, { 0x00, 0xd0, 0xd0 }, { 0x00, 0xd1, 0xd1 }, { 0x00, 0xd2, 0xd2 }, { 0x00, 0xd3, 0xd3 }, { 0x00, 0xd4, 0xd4 }, { 0x00, 0xd5, 0xd5 }, { 0x00, 0xd6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x00, 0xd8, 0xd8 }, { 0x00, 0xd9, 0xd9 }, { 0x00, 0xda, 0xda }, { 0x00, 0xdb, 0xdb }, { 0x00, 0xdc, 0xdc }, { 0x00, 0xdd, 0xdd }, { 0x00, 0xde, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xe0 }, { 0x00, 0xe1, 0xe1 }, { 0x00, 0xe2, 0xe2 }, { 0x00, 0xe3, 0xe3 }, { 0x00, 0xe4, 0xe4 }, { 0x00, 0xe5, 0xe5 }, { 0x00, 0xe6, 0xe6 }, { 0x00, 0xe7, 0xe7 }, { 0x00, 0xe8, 0xe8 }, { 0x00, 0xe9, 0xe9 }, { 0x00, 0xea, 0xea }, { 0x00, 0xeb, 0xeb }, { 0x00, 0xec, 0xec }, { 0x00, 0xed, 0xed }, { 0x00, 0xee, 0xee }, { 0x00, 0xef, 0xef }, { 0x00, 0xf0, 0xf0 }, { 0x00, 0xf1, 0xf1 }, { 0x00, 0xf2, 0xf2 }, { 0x00, 0xf3, 0xf3 }, { 0x00, 0xf4, 0xf4 }, { 0x00, 0xf5, 0xf5 }, { 0x00, 0xf6, 0xf6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xf8 }, { 0x00, 0xf9, 0xf9 }, { 0x00, 0xfa, 0xfa }, { 0x00, 0xfb, 0xfb }, { 0x00, 0xfc, 0xfc }, { 0x00, 0xfd, 0xfd }, { 0x00, 0xfe, 0xfe }, { 0x00, 0xff, 0xff } }; static struct cs_info koi8r_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xb3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x01, 0xa3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x00, 0xc0, 0xe0 }, { 0x00, 0xc1, 0xe1 }, { 0x00, 0xc2, 0xe2 }, { 0x00, 0xc3, 0xe3 }, { 0x00, 0xc4, 0xe4 }, { 0x00, 0xc5, 0xe5 }, { 0x00, 0xc6, 0xe6 }, { 0x00, 0xc7, 0xe7 }, { 0x00, 0xc8, 0xe8 }, { 0x00, 0xc9, 0xe9 }, { 0x00, 0xca, 0xea }, { 0x00, 0xcb, 0xeb }, { 0x00, 0xcc, 0xec }, { 0x00, 0xcd, 0xed }, { 0x00, 0xce, 0xee }, { 0x00, 0xcf, 0xef }, { 0x00, 0xd0, 0xf0 }, { 0x00, 0xd1, 0xf1 }, { 0x00, 0xd2, 0xf2 }, { 0x00, 0xd3, 0xf3 }, { 0x00, 0xd4, 0xf4 }, { 0x00, 0xd5, 0xf5 }, { 0x00, 0xd6, 0xf6 }, { 0x00, 0xd7, 0xf7 }, { 0x00, 0xd8, 0xf8 }, { 0x00, 0xd9, 0xf9 }, { 0x00, 0xda, 0xfa }, { 0x00, 0xdb, 0xfb }, { 0x00, 0xdc, 0xfc }, { 0x00, 0xdd, 0xfd }, { 0x00, 0xde, 0xfe }, { 0x00, 0xdf, 0xff }, { 0x01, 0xc0, 0xe0 }, { 0x01, 0xc1, 0xe1 }, { 0x01, 0xc2, 0xe2 }, { 0x01, 0xc3, 0xe3 }, { 0x01, 0xc4, 0xe4 }, { 0x01, 0xc5, 0xe5 }, { 0x01, 0xc6, 0xe6 }, { 0x01, 0xc7, 0xe7 }, { 0x01, 0xc8, 0xe8 }, { 0x01, 0xc9, 0xe9 }, { 0x01, 0xca, 0xea }, { 0x01, 0xcb, 0xeb }, { 0x01, 0xcc, 0xec }, { 0x01, 0xcd, 0xed }, { 0x01, 0xce, 0xee }, { 0x01, 0xcf, 0xef }, { 0x01, 0xd0, 0xf0 }, { 0x01, 0xd1, 0xf1 }, { 0x01, 0xd2, 0xf2 }, { 0x01, 0xd3, 0xf3 }, { 0x01, 0xd4, 0xf4 }, { 0x01, 0xd5, 0xf5 }, { 0x01, 0xd6, 0xf6 }, { 0x01, 0xd7, 0xf7 }, { 0x01, 0xd8, 0xf8 }, { 0x01, 0xd9, 0xf9 }, { 0x01, 0xda, 0xfa }, { 0x01, 0xdb, 0xfb }, { 0x01, 0xdc, 0xfc }, { 0x01, 0xdd, 0xfd }, { 0x01, 0xde, 0xfe }, { 0x01, 0xdf, 0xff } }; static struct cs_info koi8u_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xb3 }, { 0x00, 0xa4, 0xb4 }, /* ie */ { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xb6 }, /* i */ { 0x00, 0xa7, 0xb7 }, /* ii */ { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xbd }, /* g'' */ { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x01, 0xa3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, /* IE */ { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, /* I */ { 0x00, 0xb7, 0xb7 }, /* II */ { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x00, 0xc0, 0xe0 }, { 0x00, 0xc1, 0xe1 }, { 0x00, 0xc2, 0xe2 }, { 0x00, 0xc3, 0xe3 }, { 0x00, 0xc4, 0xe4 }, { 0x00, 0xc5, 0xe5 }, { 0x00, 0xc6, 0xe6 }, { 0x00, 0xc7, 0xe7 }, { 0x00, 0xc8, 0xe8 }, { 0x00, 0xc9, 0xe9 }, { 0x00, 0xca, 0xea }, { 0x00, 0xcb, 0xeb }, { 0x00, 0xcc, 0xec }, { 0x00, 0xcd, 0xed }, { 0x00, 0xce, 0xee }, { 0x00, 0xcf, 0xef }, { 0x00, 0xd0, 0xf0 }, { 0x00, 0xd1, 0xf1 }, { 0x00, 0xd2, 0xf2 }, { 0x00, 0xd3, 0xf3 }, { 0x00, 0xd4, 0xf4 }, { 0x00, 0xd5, 0xf5 }, { 0x00, 0xd6, 0xf6 }, { 0x00, 0xd7, 0xf7 }, { 0x00, 0xd8, 0xf8 }, { 0x00, 0xd9, 0xf9 }, { 0x00, 0xda, 0xfa }, { 0x00, 0xdb, 0xfb }, { 0x00, 0xdc, 0xfc }, { 0x00, 0xdd, 0xfd }, { 0x00, 0xde, 0xfe }, { 0x00, 0xdf, 0xff }, { 0x01, 0xc0, 0xe0 }, { 0x01, 0xc1, 0xe1 }, { 0x01, 0xc2, 0xe2 }, { 0x01, 0xc3, 0xe3 }, { 0x01, 0xc4, 0xe4 }, { 0x01, 0xc5, 0xe5 }, { 0x01, 0xc6, 0xe6 }, { 0x01, 0xc7, 0xe7 }, { 0x01, 0xc8, 0xe8 }, { 0x01, 0xc9, 0xe9 }, { 0x01, 0xca, 0xea }, { 0x01, 0xcb, 0xeb }, { 0x01, 0xcc, 0xec }, { 0x01, 0xcd, 0xed }, { 0x01, 0xce, 0xee }, { 0x01, 0xcf, 0xef }, { 0x01, 0xd0, 0xf0 }, { 0x01, 0xd1, 0xf1 }, { 0x01, 0xd2, 0xf2 }, { 0x01, 0xd3, 0xf3 }, { 0x01, 0xd4, 0xf4 }, { 0x01, 0xd5, 0xf5 }, { 0x01, 0xd6, 0xf6 }, { 0x01, 0xd7, 0xf7 }, { 0x01, 0xd8, 0xf8 }, { 0x01, 0xd9, 0xf9 }, { 0x01, 0xda, 0xfa }, { 0x01, 0xdb, 0xfb }, { 0x01, 0xdc, 0xfc }, { 0x01, 0xdd, 0xfd }, { 0x01, 0xde, 0xfe }, { 0x01, 0xdf, 0xff } }; static struct cs_info cp1251_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x01, 0x90, 0x80 }, { 0x01, 0x83, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x81 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x01, 0x9a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x01, 0x9c, 0x8c }, { 0x01, 0x9d, 0x8d }, { 0x01, 0x9e, 0x8e }, { 0x01, 0x9f, 0x8f }, { 0x00, 0x90, 0x80 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x8a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x8c }, { 0x00, 0x9d, 0x8d }, { 0x00, 0x9e, 0x8e }, { 0x00, 0x9f, 0x8f }, { 0x00, 0xa0, 0xa0 }, { 0x01, 0xa2, 0xa1 }, { 0x00, 0xa2, 0xa1 }, { 0x01, 0xbc, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x01, 0xb4, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x01, 0xb8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x01, 0xba, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x01, 0xbf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x01, 0xb3, 0xb2 }, { 0x00, 0xb3, 0xb2 }, { 0x00, 0xb4, 0xa5 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xa8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xaa }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xa3 }, { 0x01, 0xbe, 0xbd }, { 0x00, 0xbe, 0xbd }, { 0x00, 0xbf, 0xaf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x01, 0xf7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0xfd, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x01, 0xff, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xd7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0xdd }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xdf } }; static struct cs_info iso13_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0A, 0x0A }, { 0x00, 0x0B, 0x0B }, { 0x00, 0x0C, 0x0C }, { 0x00, 0x0D, 0x0D }, { 0x00, 0x0E, 0x0E }, { 0x00, 0x0F, 0x0F }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1A, 0x1A }, { 0x00, 0x1B, 0x1B }, { 0x00, 0x1C, 0x1C }, { 0x00, 0x1D, 0x1D }, { 0x00, 0x1E, 0x1E }, { 0x00, 0x1F, 0x1F }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2A, 0x2A }, { 0x00, 0x2B, 0x2B }, { 0x00, 0x2C, 0x2C }, { 0x00, 0x2D, 0x2D }, { 0x00, 0x2E, 0x2E }, { 0x00, 0x2F, 0x2F }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3A, 0x3A }, { 0x00, 0x3B, 0x3B }, { 0x00, 0x3C, 0x3C }, { 0x00, 0x3D, 0x3D }, { 0x00, 0x3E, 0x3E }, { 0x00, 0x3F, 0x3F }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6A, 0x4A }, { 0x01, 0x6B, 0x4B }, { 0x01, 0x6C, 0x4C }, { 0x01, 0x6D, 0x4D }, { 0x01, 0x6E, 0x4E }, { 0x01, 0x6F, 0x4F }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7A, 0x5A }, { 0x00, 0x5B, 0x5B }, { 0x00, 0x5C, 0x5C }, { 0x00, 0x5D, 0x5D }, { 0x00, 0x5E, 0x5E }, { 0x00, 0x5F, 0x5F }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6A, 0x4A }, { 0x00, 0x6B, 0x4B }, { 0x00, 0x6C, 0x4C }, { 0x00, 0x6D, 0x4D }, { 0x00, 0x6E, 0x4E }, { 0x00, 0x6F, 0x4F }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7A, 0x5A }, { 0x00, 0x7B, 0x7B }, { 0x00, 0x7C, 0x7C }, { 0x00, 0x7D, 0x7D }, { 0x00, 0x7E, 0x7E }, { 0x00, 0x7F, 0x7F }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8A, 0x8A }, { 0x00, 0x8B, 0x8B }, { 0x00, 0x8C, 0x8C }, { 0x00, 0x8D, 0x8D }, { 0x00, 0x8E, 0x8E }, { 0x00, 0x8F, 0x8F }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9A, 0x9A }, { 0x00, 0x9B, 0x9B }, { 0x00, 0x9C, 0x9C }, { 0x00, 0x9D, 0x9D }, { 0x00, 0x9E, 0x9E }, { 0x00, 0x9F, 0x9F }, { 0x00, 0xA0, 0xA0 }, { 0x00, 0xA1, 0xA1 }, { 0x00, 0xA2, 0xA2 }, { 0x00, 0xA3, 0xA3 }, { 0x00, 0xA4, 0xA4 }, { 0x00, 0xA5, 0xA5 }, { 0x00, 0xA6, 0xA6 }, { 0x00, 0xA7, 0xA7 }, { 0x01, 0xB8, 0xA8 }, { 0x00, 0xA9, 0xA9 }, { 0x01, 0xBA, 0xAA }, { 0x00, 0xAB, 0xAB }, { 0x00, 0xAC, 0xAC }, { 0x00, 0xAD, 0xAD }, { 0x00, 0xAE, 0xAE }, { 0x01, 0xBF, 0xAF }, { 0x00, 0xB0, 0xB0 }, { 0x00, 0xB1, 0xB1 }, { 0x00, 0xB2, 0xB2 }, { 0x00, 0xB3, 0xB3 }, { 0x00, 0xB4, 0xB4 }, { 0x00, 0xB5, 0xB5 }, { 0x00, 0xB6, 0xB6 }, { 0x00, 0xB7, 0xB7 }, { 0x00, 0xB8, 0xA8 }, { 0x00, 0xB9, 0xB9 }, { 0x00, 0xBA, 0xAA }, { 0x00, 0xBB, 0xBB }, { 0x00, 0xBC, 0xBC }, { 0x00, 0xBD, 0xBD }, { 0x00, 0xBE, 0xBE }, { 0x00, 0xBF, 0xAF }, { 0x01, 0xE0, 0xC0 }, { 0x01, 0xE1, 0xC1 }, { 0x01, 0xE2, 0xC2 }, { 0x01, 0xE3, 0xC3 }, { 0x01, 0xE4, 0xC4 }, { 0x01, 0xE5, 0xC5 }, { 0x01, 0xE6, 0xC6 }, { 0x01, 0xE7, 0xC7 }, { 0x01, 0xE8, 0xC8 }, { 0x01, 0xE9, 0xC9 }, { 0x01, 0xEA, 0xCA }, { 0x01, 0xEB, 0xCB }, { 0x01, 0xEC, 0xCC }, { 0x01, 0xED, 0xCD }, { 0x01, 0xEE, 0xCE }, { 0x01, 0xEF, 0xCF }, { 0x01, 0xF0, 0xD0 }, { 0x01, 0xF1, 0xD1 }, { 0x01, 0xF2, 0xD2 }, { 0x01, 0xF3, 0xD3 }, { 0x01, 0xF4, 0xD4 }, { 0x01, 0xF5, 0xD5 }, { 0x01, 0xF6, 0xD6 }, { 0x00, 0xD7, 0xD7 }, { 0x01, 0xF8, 0xD8 }, { 0x01, 0xF9, 0xD9 }, { 0x01, 0xFA, 0xDA }, { 0x01, 0xFB, 0xDB }, { 0x01, 0xFC, 0xDC }, { 0x01, 0xFD, 0xDD }, { 0x01, 0xFE, 0xDE }, { 0x00, 0xDF, 0xDF }, { 0x00, 0xE0, 0xC0 }, { 0x00, 0xE1, 0xC1 }, { 0x00, 0xE2, 0xC2 }, { 0x00, 0xE3, 0xC3 }, { 0x00, 0xE4, 0xC4 }, { 0x00, 0xE5, 0xC5 }, { 0x00, 0xE6, 0xC6 }, { 0x00, 0xE7, 0xC7 }, { 0x00, 0xE8, 0xC8 }, { 0x00, 0xE9, 0xC9 }, { 0x00, 0xEA, 0xCA }, { 0x00, 0xEB, 0xCB }, { 0x00, 0xEC, 0xCC }, { 0x00, 0xED, 0xCD }, { 0x00, 0xEE, 0xCE }, { 0x00, 0xEF, 0xCF }, { 0x00, 0xF0, 0xD0 }, { 0x00, 0xF1, 0xD1 }, { 0x00, 0xF2, 0xD2 }, { 0x00, 0xF3, 0xD3 }, { 0x00, 0xF4, 0xD4 }, { 0x00, 0xF5, 0xD5 }, { 0x00, 0xF6, 0xD6 }, { 0x00, 0xF7, 0xF7 }, { 0x00, 0xF8, 0xD8 }, { 0x00, 0xF9, 0xD9 }, { 0x00, 0xFA, 0xDA }, { 0x00, 0xFB, 0xDB }, { 0x00, 0xFC, 0xDC }, { 0x00, 0xFD, 0xDD }, { 0x00, 0xFE, 0xDE }, { 0x00, 0xFF, 0xFF } }; static struct cs_info iso14_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x01, 0xa2, 0xa1 }, { 0x00, 0xa2, 0xa1 }, { 0x00, 0xa3, 0xa3 }, { 0x01, 0xa5, 0xa4 }, { 0x00, 0xa5, 0xa4 }, { 0x01, 0xa6, 0xab }, { 0x00, 0xa7, 0xa7 }, { 0x01, 0xb8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x01, 0xba, 0xaa }, { 0x00, 0xab, 0xa6 }, { 0x01, 0xbc, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x01, 0xff, 0xaf }, { 0x01, 0xb1, 0xb0 }, { 0x00, 0xb1, 0xb0 }, { 0x01, 0xb3, 0xb2 }, { 0x00, 0xb3, 0xb2 }, { 0x01, 0xb5, 0xb4 }, { 0x00, 0xb5, 0xb4 }, { 0x00, 0xb6, 0xb6 }, { 0x01, 0xb9, 0xb7 }, { 0x00, 0xb8, 0xa8 }, { 0x00, 0xb9, 0xb6 }, { 0x00, 0xba, 0xaa }, { 0x01, 0xbf, 0xbb }, { 0x00, 0xbc, 0xac }, { 0x01, 0xbe, 0xbd }, { 0x00, 0xbe, 0xbd }, { 0x00, 0xbf, 0xbb }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x01, 0xf7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0xfd, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xd7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0xdd }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xff } }; static struct cs_info iso15_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x01, 0xa8, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa6 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x01, 0xb8, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb4 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x01, 0xbd, 0xbc }, { 0x00, 0xbd, 0xbc }, { 0x01, 0xff, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x01, 0xe0, 0xc0 }, { 0x01, 0xe1, 0xc1 }, { 0x01, 0xe2, 0xc2 }, { 0x01, 0xe3, 0xc3 }, { 0x01, 0xe4, 0xc4 }, { 0x01, 0xe5, 0xc5 }, { 0x01, 0xe6, 0xc6 }, { 0x01, 0xe7, 0xc7 }, { 0x01, 0xe8, 0xc8 }, { 0x01, 0xe9, 0xc9 }, { 0x01, 0xea, 0xca }, { 0x01, 0xeb, 0xcb }, { 0x01, 0xec, 0xcc }, { 0x01, 0xed, 0xcd }, { 0x01, 0xee, 0xce }, { 0x01, 0xef, 0xcf }, { 0x01, 0xf0, 0xd0 }, { 0x01, 0xf1, 0xd1 }, { 0x01, 0xf2, 0xd2 }, { 0x01, 0xf3, 0xd3 }, { 0x01, 0xf4, 0xd4 }, { 0x01, 0xf5, 0xd5 }, { 0x01, 0xf6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x01, 0xf8, 0xd8 }, { 0x01, 0xf9, 0xd9 }, { 0x01, 0xfa, 0xda }, { 0x01, 0xfb, 0xdb }, { 0x01, 0xfc, 0xdc }, { 0x01, 0xfd, 0xdd }, { 0x01, 0xfe, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe1, 0xc1 }, { 0x00, 0xe2, 0xc2 }, { 0x00, 0xe3, 0xc3 }, { 0x00, 0xe4, 0xc4 }, { 0x00, 0xe5, 0xc5 }, { 0x00, 0xe6, 0xc6 }, { 0x00, 0xe7, 0xc7 }, { 0x00, 0xe8, 0xc8 }, { 0x00, 0xe9, 0xc9 }, { 0x00, 0xea, 0xca }, { 0x00, 0xeb, 0xcb }, { 0x00, 0xec, 0xcc }, { 0x00, 0xed, 0xcd }, { 0x00, 0xee, 0xce }, { 0x00, 0xef, 0xcf }, { 0x00, 0xf0, 0xd0 }, { 0x00, 0xf1, 0xd1 }, { 0x00, 0xf2, 0xd2 }, { 0x00, 0xf3, 0xd3 }, { 0x00, 0xf4, 0xd4 }, { 0x00, 0xf5, 0xd5 }, { 0x00, 0xf6, 0xd6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xd8 }, { 0x00, 0xf9, 0xd9 }, { 0x00, 0xfa, 0xda }, { 0x00, 0xfb, 0xdb }, { 0x00, 0xfc, 0xdc }, { 0x00, 0xfd, 0xdd }, { 0x00, 0xfe, 0xde }, { 0x00, 0xff, 0xbe } }; static struct cs_info iscii_devanagari_tbl[] = { { 0x00, 0x00, 0x00 }, { 0x00, 0x01, 0x01 }, { 0x00, 0x02, 0x02 }, { 0x00, 0x03, 0x03 }, { 0x00, 0x04, 0x04 }, { 0x00, 0x05, 0x05 }, { 0x00, 0x06, 0x06 }, { 0x00, 0x07, 0x07 }, { 0x00, 0x08, 0x08 }, { 0x00, 0x09, 0x09 }, { 0x00, 0x0a, 0x0a }, { 0x00, 0x0b, 0x0b }, { 0x00, 0x0c, 0x0c }, { 0x00, 0x0d, 0x0d }, { 0x00, 0x0e, 0x0e }, { 0x00, 0x0f, 0x0f }, { 0x00, 0x10, 0x10 }, { 0x00, 0x11, 0x11 }, { 0x00, 0x12, 0x12 }, { 0x00, 0x13, 0x13 }, { 0x00, 0x14, 0x14 }, { 0x00, 0x15, 0x15 }, { 0x00, 0x16, 0x16 }, { 0x00, 0x17, 0x17 }, { 0x00, 0x18, 0x18 }, { 0x00, 0x19, 0x19 }, { 0x00, 0x1a, 0x1a }, { 0x00, 0x1b, 0x1b }, { 0x00, 0x1c, 0x1c }, { 0x00, 0x1d, 0x1d }, { 0x00, 0x1e, 0x1e }, { 0x00, 0x1f, 0x1f }, { 0x00, 0x20, 0x20 }, { 0x00, 0x21, 0x21 }, { 0x00, 0x22, 0x22 }, { 0x00, 0x23, 0x23 }, { 0x00, 0x24, 0x24 }, { 0x00, 0x25, 0x25 }, { 0x00, 0x26, 0x26 }, { 0x00, 0x27, 0x27 }, { 0x00, 0x28, 0x28 }, { 0x00, 0x29, 0x29 }, { 0x00, 0x2a, 0x2a }, { 0x00, 0x2b, 0x2b }, { 0x00, 0x2c, 0x2c }, { 0x00, 0x2d, 0x2d }, { 0x00, 0x2e, 0x2e }, { 0x00, 0x2f, 0x2f }, { 0x00, 0x30, 0x30 }, { 0x00, 0x31, 0x31 }, { 0x00, 0x32, 0x32 }, { 0x00, 0x33, 0x33 }, { 0x00, 0x34, 0x34 }, { 0x00, 0x35, 0x35 }, { 0x00, 0x36, 0x36 }, { 0x00, 0x37, 0x37 }, { 0x00, 0x38, 0x38 }, { 0x00, 0x39, 0x39 }, { 0x00, 0x3a, 0x3a }, { 0x00, 0x3b, 0x3b }, { 0x00, 0x3c, 0x3c }, { 0x00, 0x3d, 0x3d }, { 0x00, 0x3e, 0x3e }, { 0x00, 0x3f, 0x3f }, { 0x00, 0x40, 0x40 }, { 0x01, 0x61, 0x41 }, { 0x01, 0x62, 0x42 }, { 0x01, 0x63, 0x43 }, { 0x01, 0x64, 0x44 }, { 0x01, 0x65, 0x45 }, { 0x01, 0x66, 0x46 }, { 0x01, 0x67, 0x47 }, { 0x01, 0x68, 0x48 }, { 0x01, 0x69, 0x49 }, { 0x01, 0x6a, 0x4a }, { 0x01, 0x6b, 0x4b }, { 0x01, 0x6c, 0x4c }, { 0x01, 0x6d, 0x4d }, { 0x01, 0x6e, 0x4e }, { 0x01, 0x6f, 0x4f }, { 0x01, 0x70, 0x50 }, { 0x01, 0x71, 0x51 }, { 0x01, 0x72, 0x52 }, { 0x01, 0x73, 0x53 }, { 0x01, 0x74, 0x54 }, { 0x01, 0x75, 0x55 }, { 0x01, 0x76, 0x56 }, { 0x01, 0x77, 0x57 }, { 0x01, 0x78, 0x58 }, { 0x01, 0x79, 0x59 }, { 0x01, 0x7a, 0x5a }, { 0x00, 0x5b, 0x5b }, { 0x00, 0x5c, 0x5c }, { 0x00, 0x5d, 0x5d }, { 0x00, 0x5e, 0x5e }, { 0x00, 0x5f, 0x5f }, { 0x00, 0x60, 0x60 }, { 0x00, 0x61, 0x41 }, { 0x00, 0x62, 0x42 }, { 0x00, 0x63, 0x43 }, { 0x00, 0x64, 0x44 }, { 0x00, 0x65, 0x45 }, { 0x00, 0x66, 0x46 }, { 0x00, 0x67, 0x47 }, { 0x00, 0x68, 0x48 }, { 0x00, 0x69, 0x49 }, { 0x00, 0x6a, 0x4a }, { 0x00, 0x6b, 0x4b }, { 0x00, 0x6c, 0x4c }, { 0x00, 0x6d, 0x4d }, { 0x00, 0x6e, 0x4e }, { 0x00, 0x6f, 0x4f }, { 0x00, 0x70, 0x50 }, { 0x00, 0x71, 0x51 }, { 0x00, 0x72, 0x52 }, { 0x00, 0x73, 0x53 }, { 0x00, 0x74, 0x54 }, { 0x00, 0x75, 0x55 }, { 0x00, 0x76, 0x56 }, { 0x00, 0x77, 0x57 }, { 0x00, 0x78, 0x58 }, { 0x00, 0x79, 0x59 }, { 0x00, 0x7a, 0x5a }, { 0x00, 0x7b, 0x7b }, { 0x00, 0x7c, 0x7c }, { 0x00, 0x7d, 0x7d }, { 0x00, 0x7e, 0x7e }, { 0x00, 0x7f, 0x7f }, { 0x00, 0x80, 0x80 }, { 0x00, 0x81, 0x81 }, { 0x00, 0x82, 0x82 }, { 0x00, 0x83, 0x83 }, { 0x00, 0x84, 0x84 }, { 0x00, 0x85, 0x85 }, { 0x00, 0x86, 0x86 }, { 0x00, 0x87, 0x87 }, { 0x00, 0x88, 0x88 }, { 0x00, 0x89, 0x89 }, { 0x00, 0x8a, 0x8a }, { 0x00, 0x8b, 0x8b }, { 0x00, 0x8c, 0x8c }, { 0x00, 0x8d, 0x8d }, { 0x00, 0x8e, 0x8e }, { 0x00, 0x8f, 0x8f }, { 0x00, 0x90, 0x90 }, { 0x00, 0x91, 0x91 }, { 0x00, 0x92, 0x92 }, { 0x00, 0x93, 0x93 }, { 0x00, 0x94, 0x94 }, { 0x00, 0x95, 0x95 }, { 0x00, 0x96, 0x96 }, { 0x00, 0x97, 0x97 }, { 0x00, 0x98, 0x98 }, { 0x00, 0x99, 0x99 }, { 0x00, 0x9a, 0x9a }, { 0x00, 0x9b, 0x9b }, { 0x00, 0x9c, 0x9c }, { 0x00, 0x9d, 0x9d }, { 0x00, 0x9e, 0x9e }, { 0x00, 0x9f, 0x9f }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa1, 0xa1 }, { 0x00, 0xa2, 0xa2 }, { 0x00, 0xa3, 0xa3 }, { 0x00, 0xa4, 0xa4 }, { 0x00, 0xa5, 0xa5 }, { 0x00, 0xa6, 0xa6 }, { 0x00, 0xa7, 0xa7 }, { 0x00, 0xa8, 0xa8 }, { 0x00, 0xa9, 0xa9 }, { 0x00, 0xaa, 0xaa }, { 0x00, 0xab, 0xab }, { 0x00, 0xac, 0xac }, { 0x00, 0xad, 0xad }, { 0x00, 0xae, 0xae }, { 0x00, 0xaf, 0xaf }, { 0x00, 0xb0, 0xb0 }, { 0x00, 0xb1, 0xb1 }, { 0x00, 0xb2, 0xb2 }, { 0x00, 0xb3, 0xb3 }, { 0x00, 0xb4, 0xb4 }, { 0x00, 0xb5, 0xb5 }, { 0x00, 0xb6, 0xb6 }, { 0x00, 0xb7, 0xb7 }, { 0x00, 0xb8, 0xb8 }, { 0x00, 0xb9, 0xb9 }, { 0x00, 0xba, 0xba }, { 0x00, 0xbb, 0xbb }, { 0x00, 0xbc, 0xbc }, { 0x00, 0xbd, 0xbd }, { 0x00, 0xbe, 0xbe }, { 0x00, 0xbf, 0xbf }, { 0x00, 0xc0, 0xc0 }, { 0x00, 0xc1, 0xc1 }, { 0x00, 0xc2, 0xc2 }, { 0x00, 0xc3, 0xc3 }, { 0x00, 0xc4, 0xc4 }, { 0x00, 0xc5, 0xc5 }, { 0x00, 0xc6, 0xc6 }, { 0x00, 0xc7, 0xc7 }, { 0x00, 0xc8, 0xc8 }, { 0x00, 0xc9, 0xc9 }, { 0x00, 0xca, 0xca }, { 0x00, 0xcb, 0xcb }, { 0x00, 0xcc, 0xcc }, { 0x00, 0xcd, 0xcd }, { 0x00, 0xce, 0xce }, { 0x00, 0xcf, 0xcf }, { 0x00, 0xd0, 0xd0 }, { 0x00, 0xd1, 0xd1 }, { 0x00, 0xd2, 0xd2 }, { 0x00, 0xd3, 0xd3 }, { 0x00, 0xd4, 0xd4 }, { 0x00, 0xd5, 0xd5 }, { 0x00, 0xd6, 0xd6 }, { 0x00, 0xd7, 0xd7 }, { 0x00, 0xd8, 0xd8 }, { 0x00, 0xd9, 0xd9 }, { 0x00, 0xda, 0xda }, { 0x00, 0xdb, 0xdb }, { 0x00, 0xdc, 0xdc }, { 0x00, 0xdd, 0xdd }, { 0x00, 0xde, 0xde }, { 0x00, 0xdf, 0xdf }, { 0x00, 0xe0, 0xe0 }, { 0x00, 0xe1, 0xe1 }, { 0x00, 0xe2, 0xe2 }, { 0x00, 0xe3, 0xe3 }, { 0x00, 0xe4, 0xe4 }, { 0x00, 0xe5, 0xe5 }, { 0x00, 0xe6, 0xe6 }, { 0x00, 0xe7, 0xe7 }, { 0x00, 0xe8, 0xe8 }, { 0x00, 0xe9, 0xe9 }, { 0x00, 0xea, 0xea }, { 0x00, 0xeb, 0xeb }, { 0x00, 0xec, 0xec }, { 0x00, 0xed, 0xed }, { 0x00, 0xee, 0xee }, { 0x00, 0xef, 0xef }, { 0x00, 0xf0, 0xf0 }, { 0x00, 0xf1, 0xf1 }, { 0x00, 0xf2, 0xf2 }, { 0x00, 0xf3, 0xf3 }, { 0x00, 0xf4, 0xf4 }, { 0x00, 0xf5, 0xf5 }, { 0x00, 0xf6, 0xf6 }, { 0x00, 0xf7, 0xf7 }, { 0x00, 0xf8, 0xf8 }, { 0x00, 0xf9, 0xf9 }, { 0x00, 0xfa, 0xfa }, { 0x00, 0xfb, 0xfb }, { 0x00, 0xfc, 0xfc }, { 0x00, 0xfd, 0xfd }, { 0x00, 0xfe, 0xfe }, { 0x00, 0xff, 0xff } }; static struct enc_entry encds[] = { {"ISO8859-1",iso1_tbl}, {"ISO8859-2",iso2_tbl}, {"ISO8859-3",iso3_tbl}, {"ISO8859-4",iso4_tbl}, {"ISO8859-5",iso5_tbl}, {"ISO8859-6",iso6_tbl}, {"ISO8859-7",iso7_tbl}, {"ISO8859-8",iso8_tbl}, {"ISO8859-9",iso9_tbl}, {"ISO8859-10",iso10_tbl}, {"KOI8-R",koi8r_tbl}, {"KOI8-U",koi8u_tbl}, {"microsoft-cp1251",cp1251_tbl}, {"ISO8859-13", iso13_tbl}, {"ISO8859-14", iso14_tbl}, {"ISO8859-15", iso15_tbl}, {"ISCII-DEVANAGARI", iscii_devanagari_tbl} }; struct cs_info * get_current_cs(const char * es) { struct cs_info * ccs = encds[0].cs_table; int n = sizeof(encds) / sizeof(encds[0]); for (int i = 0; i < n; i++) { if (strcmp(es,encds[i].enc_name) == 0) { ccs = encds[i].cs_table; break; } } return ccs; } #else // XXX This function was rewritten for mozilla. Instead of storing the // conversion tables static in this file, create them when needed // with help the mozilla backend. struct cs_info * get_current_cs(const char * es) { struct cs_info *ccs; nsCOMPtr encoder; nsCOMPtr decoder; nsCOMPtr caseConv; nsresult rv; nsCOMPtr ccm = do_GetService(kCharsetConverterManagerCID, &rv); if (NS_FAILED(rv)) return nsnull; rv = ccm->GetUnicodeEncoder(es, getter_AddRefs(encoder)); if (encoder && NS_SUCCEEDED(rv)) encoder->SetOutputErrorBehavior(encoder->kOnError_Replace, nsnull, '?'); if (NS_FAILED(rv)) return nsnull; rv = ccm->GetUnicodeDecoder(es, getter_AddRefs(decoder)); caseConv = do_GetService(kUnicharUtilCID, &rv); if (NS_FAILED(rv)) return nsnull; ccs = new cs_info[256]; PRInt32 charLength = 256; PRInt32 uniLength = 512; char *source = (char *)malloc(charLength); PRUnichar *uni = (PRUnichar *)malloc(uniLength * sizeof(PRUnichar)); char *lower = (char *)malloc(charLength); char *upper = (char *)malloc(charLength); // Create a long string of all chars. unsigned int i; for (i = 0x00; i <= 0xff ; ++i) { source[i] = i; } // Convert this long string to unicode rv = decoder->Convert(source, &charLength, uni, &uniLength); // Do case conversion stuff, and convert back. caseConv->ToUpper(uni, uni, uniLength); encoder->Convert(uni, &uniLength, upper, &charLength); uniLength = 512; charLength = 256; rv = decoder->Convert(source, &charLength, uni, &uniLength); caseConv->ToLower(uni, uni, uniLength); encoder->Convert(uni, &uniLength, lower, &charLength); // Store for (i = 0x00; i <= 0xff ; ++i) { ccs[i].cupper = upper[i]; ccs[i].clower = lower[i]; if (ccs[i].clower != (unsigned char)i) ccs[i].ccase = true; else ccs[i].ccase = false; } free(source); free(uni); free(lower); free(upper); return ccs; } #endif // primitive isalpha() replacement for tokenization char * get_casechars(const char * enc) { struct cs_info * csconv = get_current_cs(enc); char expw[MAXLNLEN]; char * p = expw; for (int i = 0; i <= 255; i++) { if ((csconv[i].cupper != csconv[i].clower)) { *p = (char) i; p++; } } *p = '\0'; #ifdef MOZILLA_CLIENT delete [] csconv; #endif return mystrdup(expw); } static struct lang_map lang2enc[] = { {"ar", "UTF-8", LANG_ar}, {"az", "UTF-8", LANG_az}, {"bg", "microsoft-cp1251", LANG_bg}, {"ca", "ISO8859-1", LANG_ca}, {"cs", "ISO8859-2", LANG_cs}, {"da", "ISO8859-1", LANG_da}, {"de", "ISO8859-1", LANG_de}, {"el", "ISO8859-7", LANG_el}, {"en", "ISO8859-1", LANG_en}, {"es", "ISO8859-1", LANG_es}, {"eu", "ISO8859-1", LANG_eu}, {"gl", "ISO8859-1", LANG_gl}, {"fr", "ISO8859-15", LANG_fr}, {"hr", "ISO8859-2", LANG_hr}, {"hu", "ISO8859-2", LANG_hu}, {"it", "ISO8859-1", LANG_it}, {"la", "ISO8859-1", LANG_la}, {"lv", "ISO8859-13", LANG_lv}, {"nl", "ISO8859-1", LANG_nl}, {"pl", "ISO8859-2", LANG_pl}, {"pt", "ISO8859-1", LANG_pt}, {"sv", "ISO8859-1", LANG_sv}, {"tr", "UTF-8", LANG_tr}, {"ru", "KOI8-R", LANG_ru}, {"uk", "KOI8-U", LANG_uk} }; const char * get_default_enc(const char * lang) { int n = sizeof(lang2enc) / sizeof(lang2enc[0]); for (int i = 0; i < n; i++) { if (strcmp(lang,lang2enc[i].lang) == 0) { return lang2enc[i].def_enc; } } return NULL; } int get_lang_num(const char * lang) { int n = sizeof(lang2enc) / sizeof(lang2enc[0]); for (int i = 0; i < n; i++) { if (strncmp(lang,lang2enc[i].lang,2) == 0) { return lang2enc[i].num; } } return LANG_xx; } #ifndef OPENOFFICEORG #ifndef MOZILLA_CLIENT int initialize_utf_tbl() { utf_tbl_count++; if (utf_tbl) return 0; utf_tbl = (unicode_info2 *) malloc(CONTSIZE * sizeof(unicode_info2)); if (utf_tbl) { size_t j; for (j = 0; j < CONTSIZE; j++) { utf_tbl[j].cletter = 0; utf_tbl[j].clower = (unsigned short) j; utf_tbl[j].cupper = (unsigned short) j; } for (j = 0; j < UTF_LST_LEN; j++) { utf_tbl[utf_lst[j].c].cletter = 1; utf_tbl[utf_lst[j].c].clower = utf_lst[j].clower; utf_tbl[utf_lst[j].c].cupper = utf_lst[j].cupper; } } else return 1; return 0; } #endif #endif void free_utf_tbl() { if (utf_tbl_count > 0) utf_tbl_count--; if (utf_tbl && (utf_tbl_count == 0)) { free(utf_tbl); utf_tbl = NULL; } } #ifdef MOZILLA_CLIENT static nsCOMPtr& getcaseConv() { nsresult rv; static nsCOMPtr caseConv = do_GetService(kUnicharUtilCID, &rv); return caseConv; } #endif unsigned short unicodetoupper(unsigned short c, int langnum) { // In Azeri and Turkish, I and i dictinct letters: // There are a dotless lower case i pair of upper `I', // and an upper I with dot pair of lower `i'. if (c == 0x0069 && ((langnum == LANG_az) || (langnum == LANG_tr))) return 0x0130; #ifdef OPENOFFICEORG return u_toupper(c); #else #ifdef MOZILLA_CLIENT PRUnichar ch2; getcaseConv()->ToUpper((PRUnichar) c, &ch2); return ch2; #else return (utf_tbl) ? utf_tbl[c].cupper : c; #endif #endif } unsigned short unicodetolower(unsigned short c, int langnum) { // In Azeri and Turkish, I and i dictinct letters: // There are a dotless lower case i pair of upper `I', // and an upper I with dot pair of lower `i'. if (c == 0x0049 && ((langnum == LANG_az) || (langnum == LANG_tr))) return 0x0131; #ifdef OPENOFFICEORG return u_tolower(c); #else #ifdef MOZILLA_CLIENT PRUnichar ch2; getcaseConv()->ToLower((PRUnichar) c, &ch2); return ch2; #else return (utf_tbl) ? utf_tbl[c].clower : c; #endif #endif } int unicodeisalpha(unsigned short c) { #ifdef OPENOFFICEORG return u_isalpha(c); #else return (utf_tbl) ? utf_tbl[c].cletter : 0; #endif } /* get type of capitalization */ int get_captype(char * word, int nl, cs_info * csconv) { // now determine the capitalization type of the first nl letters int ncap = 0; int nneutral = 0; int firstcap = 0; if (csconv == NULL) return NOCAP; for (char * q = word; *q != '\0'; q++) { if (csconv[*((unsigned char *)q)].ccase) ncap++; if (csconv[*((unsigned char *)q)].cupper == csconv[*((unsigned char *)q)].clower) nneutral++; } if (ncap) { firstcap = csconv[*((unsigned char *) word)].ccase; } // now finally set the captype if (ncap == 0) { return NOCAP; } else if ((ncap == 1) && firstcap) { return INITCAP; } else if ((ncap == nl) || ((ncap + nneutral) == nl)) { return ALLCAP; } else if ((ncap > 1) && firstcap) { return HUHINITCAP; } return HUHCAP; } int get_captype_utf8(w_char * word, int nl, int langnum) { // now determine the capitalization type of the first nl letters int ncap = 0; int nneutral = 0; int firstcap = 0; unsigned short idx; // don't check too long words if (nl >= MAXWORDLEN) return 0; // big Unicode character (non BMP area) if (nl == -1) return NOCAP; for (int i = 0; i < nl; i++) { idx = (word[i].h << 8) + word[i].l; if (idx != unicodetolower(idx, langnum)) ncap++; if (unicodetoupper(idx, langnum) == unicodetolower(idx, langnum)) nneutral++; } if (ncap) { idx = (word[0].h << 8) + word[0].l; firstcap = (idx != unicodetolower(idx, langnum)); } // now finally set the captype if (ncap == 0) { return NOCAP; } else if ((ncap == 1) && firstcap) { return INITCAP; } else if ((ncap == nl) || ((ncap + nneutral) == nl)) { return ALLCAP; } else if ((ncap > 1) && firstcap) { return HUHINITCAP; } return HUHCAP; } // strip all ignored characters in the string void remove_ignored_chars_utf(char * word, unsigned short ignored_chars[], int ignored_len) { w_char w[MAXWORDLEN]; w_char w2[MAXWORDLEN]; int i; int j; int len = u8_u16(w, MAXWORDLEN, word); for (i = 0, j = 0; i < len; i++) { if (!flag_bsearch(ignored_chars, ((unsigned short *) w)[i], ignored_len)) { w2[j] = w[i]; j++; } } if (j < i) u16_u8(word, MAXWORDUTF8LEN, w2, j); } // strip all ignored characters in the string void remove_ignored_chars(char * word, char * ignored_chars) { for (char * p = word; *p != '\0'; p++) { if (!strchr(ignored_chars, *p)) { *word = *p; word++; } } *word = '\0'; } int parse_string(char * line, char ** out, int ln) { char * tp = line; char * piece; int i = 0; int np = 0; if (*out) { HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions\n", ln); return 1; } piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { *out = mystrdup(piece); if (!*out) return 1; np++; break; } default: break; } i++; } // free(piece); piece = mystrsep(&tp, 0); } if (np != 2) { HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", ln); return 1; } return 0; } int parse_array(char * line, char ** out, unsigned short ** out_utf16, int * out_utf16_len, int utf8, int ln) { if (parse_string(line, out, ln)) return 1; if (utf8) { w_char w[MAXWORDLEN]; int n = u8_u16(w, MAXWORDLEN, *out); if (n > 0) { flag_qsort((unsigned short *) w, 0, n); *out_utf16 = (unsigned short *) malloc(n * sizeof(unsigned short)); if (!*out_utf16) return 1; memcpy(*out_utf16, w, n * sizeof(unsigned short)); } *out_utf16_len = n; } return 0; } qt-client-4.1.0/hunspell/csutil.hxx000066400000000000000000000172621217451700100173100ustar00rootroot00000000000000#ifndef __CSUTILHXX__ #define __CSUTILHXX__ #include "hunvisapi.h" // First some base level utility routines #include #include "w_char.hxx" #include "htypes.hxx" // casing #define NOCAP 0 #define INITCAP 1 #define ALLCAP 2 #define HUHCAP 3 #define HUHINITCAP 4 // default encoding and keystring #define SPELL_ENCODING "ISO8859-1" #define SPELL_KEYSTRING "qwertyuiop|asdfghjkl|zxcvbnm" // default morphological fields #define MORPH_STEM "st:" #define MORPH_ALLOMORPH "al:" #define MORPH_POS "po:" #define MORPH_DERI_PFX "dp:" #define MORPH_INFL_PFX "ip:" #define MORPH_TERM_PFX "tp:" #define MORPH_DERI_SFX "ds:" #define MORPH_INFL_SFX "is:" #define MORPH_TERM_SFX "ts:" #define MORPH_SURF_PFX "sp:" #define MORPH_FREQ "fr:" #define MORPH_PHON "ph:" #define MORPH_HYPH "hy:" #define MORPH_PART "pa:" #define MORPH_FLAG "fl:" #define MORPH_HENTRY "_H:" #define MORPH_TAG_LEN strlen(MORPH_STEM) #define MSEP_FLD ' ' #define MSEP_REC '\n' #define MSEP_ALT '\v' // default flags #define DEFAULTFLAGS 65510 #define FORBIDDENWORD 65510 #define ONLYUPCASEFLAG 65511 // convert UTF-16 characters to UTF-8 LIBHUNSPELL_DLL_EXPORTED char * u16_u8(char * dest, int size, const w_char * src, int srclen); // convert UTF-8 characters to UTF-16 LIBHUNSPELL_DLL_EXPORTED int u8_u16(w_char * dest, int size, const char * src); // sort 2-byte vector LIBHUNSPELL_DLL_EXPORTED void flag_qsort(unsigned short flags[], int begin, int end); // binary search in 2-byte vector LIBHUNSPELL_DLL_EXPORTED int flag_bsearch(unsigned short flags[], unsigned short flag, int right); // remove end of line char(s) LIBHUNSPELL_DLL_EXPORTED void mychomp(char * s); // duplicate string LIBHUNSPELL_DLL_EXPORTED char * mystrdup(const char * s); // strcat for limited length destination string LIBHUNSPELL_DLL_EXPORTED char * mystrcat(char * dest, const char * st, int max); // duplicate reverse of string LIBHUNSPELL_DLL_EXPORTED char * myrevstrdup(const char * s); // parse into tokens with char delimiter LIBHUNSPELL_DLL_EXPORTED char * mystrsep(char ** sptr, const char delim); // parse into tokens with char delimiter LIBHUNSPELL_DLL_EXPORTED char * mystrsep2(char ** sptr, const char delim); // parse into tokens with char delimiter LIBHUNSPELL_DLL_EXPORTED char * mystrrep(char *, const char *, const char *); // append s to ends of every lines in text LIBHUNSPELL_DLL_EXPORTED void strlinecat(char * lines, const char * s); // tokenize into lines with new line LIBHUNSPELL_DLL_EXPORTED int line_tok(const char * text, char *** lines, char breakchar); // tokenize into lines with new line and uniq in place LIBHUNSPELL_DLL_EXPORTED char * line_uniq(char * text, char breakchar); LIBHUNSPELL_DLL_EXPORTED char * line_uniq_app(char ** text, char breakchar); // change oldchar to newchar in place LIBHUNSPELL_DLL_EXPORTED char * tr(char * text, char oldc, char newc); // reverse word LIBHUNSPELL_DLL_EXPORTED int reverseword(char *); // reverse word LIBHUNSPELL_DLL_EXPORTED int reverseword_utf(char *); // remove duplicates LIBHUNSPELL_DLL_EXPORTED int uniqlist(char ** list, int n); // free character array list LIBHUNSPELL_DLL_EXPORTED void freelist(char *** list, int n); // character encoding information struct cs_info { unsigned char ccase; unsigned char clower; unsigned char cupper; }; // Unicode character encoding information struct unicode_info { unsigned short c; unsigned short cupper; unsigned short clower; }; struct unicode_info2 { char cletter; unsigned short cupper; unsigned short clower; }; LIBHUNSPELL_DLL_EXPORTED int initialize_utf_tbl(); LIBHUNSPELL_DLL_EXPORTED void free_utf_tbl(); LIBHUNSPELL_DLL_EXPORTED unsigned short unicodetoupper(unsigned short c, int langnum); LIBHUNSPELL_DLL_EXPORTED unsigned short unicodetolower(unsigned short c, int langnum); LIBHUNSPELL_DLL_EXPORTED int unicodeisalpha(unsigned short c); struct enc_entry { const char * enc_name; struct cs_info * cs_table; }; // language to encoding default map struct lang_map { const char * lang; const char * def_enc; int num; }; LIBHUNSPELL_DLL_EXPORTED struct cs_info * get_current_cs(const char * es); LIBHUNSPELL_DLL_EXPORTED const char * get_default_enc(const char * lang); // get language identifiers of language codes LIBHUNSPELL_DLL_EXPORTED int get_lang_num(const char * lang); // get characters of the given 8bit encoding with lower- and uppercase forms LIBHUNSPELL_DLL_EXPORTED char * get_casechars(const char * enc); // convert null terminated string to all caps using encoding LIBHUNSPELL_DLL_EXPORTED void enmkallcap(char * d, const char * p, const char * encoding); // convert null terminated string to all little using encoding LIBHUNSPELL_DLL_EXPORTED void enmkallsmall(char * d, const char * p, const char * encoding); // convert null terminated string to have initial capital using encoding LIBHUNSPELL_DLL_EXPORTED void enmkinitcap(char * d, const char * p, const char * encoding); // convert null terminated string to all caps LIBHUNSPELL_DLL_EXPORTED void mkallcap(char * p, const struct cs_info * csconv); // convert null terminated string to all little LIBHUNSPELL_DLL_EXPORTED void mkallsmall(char * p, const struct cs_info * csconv); // convert null terminated string to have initial capital LIBHUNSPELL_DLL_EXPORTED void mkinitcap(char * p, const struct cs_info * csconv); // convert first nc characters of UTF-8 string to little LIBHUNSPELL_DLL_EXPORTED void mkallsmall_utf(w_char * u, int nc, int langnum); // convert first nc characters of UTF-8 string to capital LIBHUNSPELL_DLL_EXPORTED void mkallcap_utf(w_char * u, int nc, int langnum); // get type of capitalization LIBHUNSPELL_DLL_EXPORTED int get_captype(char * q, int nl, cs_info *); // get type of capitalization (UTF-8) LIBHUNSPELL_DLL_EXPORTED int get_captype_utf8(w_char * q, int nl, int langnum); // strip all ignored characters in the string LIBHUNSPELL_DLL_EXPORTED void remove_ignored_chars_utf(char * word, unsigned short ignored_chars[], int ignored_len); // strip all ignored characters in the string LIBHUNSPELL_DLL_EXPORTED void remove_ignored_chars(char * word, char * ignored_chars); LIBHUNSPELL_DLL_EXPORTED int parse_string(char * line, char ** out, int ln); LIBHUNSPELL_DLL_EXPORTED int parse_array(char * line, char ** out, unsigned short ** out_utf16, int * out_utf16_len, int utf8, int ln); LIBHUNSPELL_DLL_EXPORTED int fieldlen(const char * r); LIBHUNSPELL_DLL_EXPORTED char * copy_field(char * dest, const char * morph, const char * var); LIBHUNSPELL_DLL_EXPORTED int morphcmp(const char * s, const char * t); LIBHUNSPELL_DLL_EXPORTED int get_sfxcount(const char * morph); // conversion function for protected memory LIBHUNSPELL_DLL_EXPORTED void store_pointer(char * dest, char * source); // conversion function for protected memory LIBHUNSPELL_DLL_EXPORTED char * get_stored_pointer(const char * s); // hash entry macros LIBHUNSPELL_DLL_EXPORTED inline char* HENTRY_DATA(struct hentry *h) { char *ret; if (!h->var) ret = NULL; else if (h->var & H_OPT_ALIASM) ret = get_stored_pointer(&(h->word[0]) + h->blen + 1); else ret = &(h->word[0]) + h->blen + 1; return ret; } // NULL-free version for warning-free OOo build LIBHUNSPELL_DLL_EXPORTED inline const char* HENTRY_DATA2(const struct hentry *h) { const char *ret; if (!h->var) ret = ""; else if (h->var & H_OPT_ALIASM) ret = get_stored_pointer(&(h->word[0]) + h->blen + 1); else ret = &(h->word[0]) + h->blen + 1; return ret; } LIBHUNSPELL_DLL_EXPORTED inline char* HENTRY_FIND(struct hentry *h, const char *p) { return (HENTRY_DATA(h) ? strstr(HENTRY_DATA(h), p) : NULL); } #define w_char_eq(a,b) (((a).l == (b).l) && ((a).h == (b).h)) #endif qt-client-4.1.0/hunspell/dictmgr.cxx000066400000000000000000000105751217451700100174310ustar00rootroot00000000000000 #include #include #include #include #include "dictmgr.hxx" DictMgr::DictMgr(const char * dictpath, const char * etype) : numdict(0) { // load list of etype entries pdentry = (dictentry *)malloc(MAXDICTIONARIES*sizeof(struct dictentry)); if (pdentry) { if (parse_file(dictpath, etype)) { numdict = 0; // no dictionary.lst found is okay } } } DictMgr::~DictMgr() { dictentry * pdict = NULL; if (pdentry) { pdict = pdentry; for (int i=0;ilang) { free(pdict->lang); pdict->lang = NULL; } if (pdict->region) { free(pdict->region); pdict->region=NULL; } if (pdict->filename) { free(pdict->filename); pdict->filename = NULL; } pdict++; } free(pdentry); pdentry = NULL; pdict = NULL; } numdict = 0; } // read in list of etype entries and build up structure to describe them int DictMgr::parse_file(const char * dictpath, const char * etype) { int i; char line[MAXDICTENTRYLEN+1]; dictentry * pdict = pdentry; // open the dictionary list file FILE * dictlst; dictlst = fopen(dictpath,"r"); if (!dictlst) { return 1; } // step one is to parse the dictionary list building up the // descriptive structures // read in each line ignoring any that dont start with etype while (fgets(line,MAXDICTENTRYLEN,dictlst)) { mychomp(line); /* parse in a dictionary entry */ if (strncmp(line,etype,4) == 0) { if (numdict < MAXDICTIONARIES) { char * tp = line; char * piece; i = 0; while ((piece=mystrsep(&tp,' '))) { if (*piece != '\0') { switch(i) { case 0: break; case 1: pdict->lang = mystrdup(piece); break; case 2: if (strcmp (piece, "ANY") == 0) pdict->region = mystrdup(""); else pdict->region = mystrdup(piece); break; case 3: pdict->filename = mystrdup(piece); break; default: break; } i++; } free(piece); } if (i == 4) { numdict++; pdict++; } else { switch (i) { case 3: free(pdict->region); pdict->region=NULL; case 2: //deliberate fallthrough free(pdict->lang); pdict->lang=NULL; default: break; } fprintf(stderr,"dictionary list corruption in line \"%s\"\n",line); fflush(stderr); } } } } fclose(dictlst); return 0; } // return text encoding of dictionary int DictMgr::get_list(dictentry ** ppentry) { *ppentry = pdentry; return numdict; } // strip strings into token based on single char delimiter // acts like strsep() but only uses a delim char and not // a delim string char * DictMgr::mystrsep(char ** stringp, const char delim) { char * rv = NULL; char * mp = *stringp; int n = strlen(mp); if (n > 0) { char * dp = (char *)memchr(mp,(int)((unsigned char)delim),n); if (dp) { *stringp = dp+1; int nc = (int)((unsigned long)dp - (unsigned long)mp); rv = (char *) malloc(nc+1); if (rv) { memcpy(rv,mp,nc); *(rv+nc) = '\0'; } } else { rv = (char *) malloc(n+1); if (rv) { memcpy(rv, mp, n); *(rv+n) = '\0'; *stringp = mp + n; } } } return rv; } // replaces strdup with ansi version char * DictMgr::mystrdup(const char * s) { char * d = NULL; if (s) { int sl = strlen(s)+1; d = (char *) malloc(sl); if (d) memcpy(d,s,sl); } return d; } // remove cross-platform text line end characters void DictMgr:: mychomp(char * s) { int k = strlen(s); if ((k > 0) && ((*(s+k-1)=='\r') || (*(s+k-1)=='\n'))) *(s+k-1) = '\0'; if ((k > 1) && (*(s+k-2) == '\r')) *(s+k-2) = '\0'; } qt-client-4.1.0/hunspell/dictmgr.hxx000066400000000000000000000011711217451700100174260ustar00rootroot00000000000000#ifndef _DICTMGR_HXX_ #define _DICTMGR_HXX_ #include "hunvisapi.h" #define MAXDICTIONARIES 100 #define MAXDICTENTRYLEN 1024 struct dictentry { char * filename; char * lang; char * region; }; class LIBHUNSPELL_DLL_EXPORTED DictMgr { int numdict; dictentry * pdentry; public: DictMgr(const char * dictpath, const char * etype); ~DictMgr(); int get_list(dictentry** ppentry); private: int parse_file(const char * dictpath, const char * etype); char * mystrsep(char ** stringp, const char delim); char * mystrdup(const char * s); void mychomp(char * s); }; #endif qt-client-4.1.0/hunspell/filemgr.cxx000066400000000000000000000020141217451700100174120ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include "filemgr.hxx" int FileMgr::fail(const char * err, const char * par) { fprintf(stderr, err, par); return -1; } FileMgr::FileMgr(const char * file, const char * key) { linenum = 0; hin = NULL; fin = fopen(file, "r"); if (!fin) { // check hzipped file char * st = (char *) malloc(strlen(file) + strlen(HZIP_EXTENSION) + 1); if (st) { strcpy(st, file); strcat(st, HZIP_EXTENSION); hin = new Hunzip(st, key); free(st); } } if (!fin && !hin) fail(MSG_OPEN, file); } FileMgr::~FileMgr() { if (fin) fclose(fin); if (hin) delete hin; } char * FileMgr::getline() { const char * l; linenum++; if (fin) return fgets(in, BUFSIZE - 1, fin); if (hin && (l = hin->getline())) return strcpy(in, l); linenum--; return NULL; } int FileMgr::getlinenum() { return linenum; } qt-client-4.1.0/hunspell/filemgr.hxx000066400000000000000000000010121217451700100174140ustar00rootroot00000000000000/* file manager class - read lines of files [filename] OR [filename.hz] */ #ifndef _FILEMGR_HXX_ #define _FILEMGR_HXX_ #include "hunvisapi.h" #include "hunzip.hxx" #include class LIBHUNSPELL_DLL_EXPORTED FileMgr { protected: FILE * fin; Hunzip * hin; char in[BUFSIZE + 50]; // input buffer int fail(const char * err, const char * par); int linenum; public: FileMgr(const char * filename, const char * key = NULL); ~FileMgr(); char * getline(); int getlinenum(); }; #endif qt-client-4.1.0/hunspell/hashmgr.cxx000066400000000000000000000675671217451700100174460ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include #include "hashmgr.hxx" #include "csutil.hxx" #include "atypes.hxx" // build a hash table from a munched word list HashMgr::HashMgr(const char * tpath, const char * apath, const char * key) { tablesize = 0; tableptr = NULL; flag_mode = FLAG_CHAR; complexprefixes = 0; utf8 = 0; langnum = 0; lang = NULL; enc = NULL; csconv = 0; ignorechars = NULL; ignorechars_utf16 = NULL; ignorechars_utf16_len = 0; numaliasf = 0; aliasf = NULL; numaliasm = 0; aliasm = NULL; forbiddenword = FORBIDDENWORD; // forbidden word signing flag load_config(apath, key); int ec = load_tables(tpath, key); if (ec) { /* error condition - what should we do here */ HUNSPELL_WARNING(stderr, "Hash Manager Error : %d\n",ec); if (tableptr) { free(tableptr); tableptr = NULL; } tablesize = 0; } } HashMgr::~HashMgr() { if (tableptr) { // now pass through hash table freeing up everything // go through column by column of the table for (int i=0; i < tablesize; i++) { struct hentry * pt = tableptr[i]; struct hentry * nt = NULL; while(pt) { nt = pt->next; if (pt->astr && (!aliasf || TESTAFF(pt->astr, ONLYUPCASEFLAG, pt->alen))) free(pt->astr); free(pt); pt = nt; } } free(tableptr); } tablesize = 0; if (aliasf) { for (int j = 0; j < (numaliasf); j++) free(aliasf[j]); free(aliasf); aliasf = NULL; if (aliasflen) { free(aliasflen); aliasflen = NULL; } } if (aliasm) { for (int j = 0; j < (numaliasm); j++) free(aliasm[j]); free(aliasm); aliasm = NULL; } #ifndef OPENOFFICEORG #ifndef MOZILLA_CLIENT if (utf8) free_utf_tbl(); #endif #endif if (enc) free(enc); if (lang) free(lang); if (ignorechars) free(ignorechars); if (ignorechars_utf16) free(ignorechars_utf16); #ifdef MOZILLA_CLIENT delete [] csconv; #endif } // lookup a root word in the hashtable struct hentry * HashMgr::lookup(const char *word) const { struct hentry * dp; if (tableptr) { dp = tableptr[hash(word)]; if (!dp) return NULL; for ( ; dp != NULL; dp = dp->next) { if (strcmp(word, dp->word) == 0) return dp; } } return NULL; } // add a word to the hash table (private) int HashMgr::add_word(const char * word, int wbl, int wcl, unsigned short * aff, int al, const char * desc, bool onlyupcase) { bool upcasehomonym = false; int descl = desc ? (aliasm ? sizeof(short) : strlen(desc) + 1) : 0; // variable-length hash record with word and optional fields struct hentry* hp = (struct hentry *) malloc (sizeof(struct hentry) + wbl + descl); if (!hp) return 1; char * hpw = hp->word; strcpy(hpw, word); if (ignorechars != NULL) { if (utf8) { remove_ignored_chars_utf(hpw, ignorechars_utf16, ignorechars_utf16_len); } else { remove_ignored_chars(hpw, ignorechars); } } if (complexprefixes) { if (utf8) reverseword_utf(hpw); else reverseword(hpw); } int i = hash(hpw); hp->blen = (unsigned char) wbl; hp->clen = (unsigned char) wcl; hp->alen = (short) al; hp->astr = aff; hp->next = NULL; hp->next_homonym = NULL; // store the description string or its pointer if (desc) { hp->var = H_OPT; if (aliasm) { hp->var += H_OPT_ALIASM; store_pointer(hpw + wbl + 1, get_aliasm(atoi(desc))); } else { strcpy(hpw + wbl + 1, desc); if (complexprefixes) { if (utf8) reverseword_utf(HENTRY_DATA(hp)); else reverseword(HENTRY_DATA(hp)); } } if (strstr(HENTRY_DATA(hp), MORPH_PHON)) hp->var += H_OPT_PHON; } else hp->var = 0; struct hentry * dp = tableptr[i]; if (!dp) { tableptr[i] = hp; return 0; } while (dp->next != NULL) { if ((!dp->next_homonym) && (strcmp(hp->word, dp->word) == 0)) { // remove hidden onlyupcase homonym if (!onlyupcase) { if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) { free(dp->astr); dp->astr = hp->astr; dp->alen = hp->alen; free(hp); return 0; } else { dp->next_homonym = hp; } } else { upcasehomonym = true; } } dp=dp->next; } if (strcmp(hp->word, dp->word) == 0) { // remove hidden onlyupcase homonym if (!onlyupcase) { if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) { free(dp->astr); dp->astr = hp->astr; dp->alen = hp->alen; free(hp); return 0; } else { dp->next_homonym = hp; } } else { upcasehomonym = true; } } if (!upcasehomonym) { dp->next = hp; } else { // remove hidden onlyupcase homonym if (hp->astr) free(hp->astr); free(hp); } return 0; } int HashMgr::add_hidden_capitalized_word(char * word, int wbl, int wcl, unsigned short * flags, int al, char * dp, int captype) { // add inner capitalized forms to handle the following allcap forms: // Mixed caps: OpenOffice.org -> OPENOFFICE.ORG // Allcaps with suffixes: CIA's -> CIA'S if (((captype == HUHCAP) || (captype == HUHINITCAP) || ((captype == ALLCAP) && (flags != NULL))) && !((flags != NULL) && TESTAFF(flags, forbiddenword, al))) { unsigned short * flags2 = (unsigned short *) malloc (sizeof(unsigned short) * (al+1)); if (!flags2) return 1; if (al) memcpy(flags2, flags, al * sizeof(unsigned short)); flags2[al] = ONLYUPCASEFLAG; if (utf8) { char st[BUFSIZE]; w_char w[BUFSIZE]; int wlen = u8_u16(w, BUFSIZE, word); mkallsmall_utf(w, wlen, langnum); mkallcap_utf(w, 1, langnum); u16_u8(st, BUFSIZE, w, wlen); return add_word(st,wbl,wcl,flags2,al+1,dp, true); } else { mkallsmall(word, csconv); mkinitcap(word, csconv); return add_word(word,wbl,wcl,flags2,al+1,dp, true); } } return 0; } // detect captype and modify word length for UTF-8 encoding int HashMgr::get_clen_and_captype(const char * word, int wbl, int * captype) { int len; if (utf8) { w_char dest_utf[BUFSIZE]; len = u8_u16(dest_utf, BUFSIZE, word); *captype = get_captype_utf8(dest_utf, len, langnum); } else { len = wbl; *captype = get_captype((char *) word, len, csconv); } return len; } // remove word (personal dictionary function for standalone applications) int HashMgr::remove(const char * word) { struct hentry * dp = lookup(word); while (dp) { if (dp->alen == 0 || !TESTAFF(dp->astr, forbiddenword, dp->alen)) { unsigned short * flags = (unsigned short *) malloc(sizeof(short) * (dp->alen + 1)); if (!flags) return 1; for (int i = 0; i < dp->alen; i++) flags[i] = dp->astr[i]; flags[dp->alen] = forbiddenword; dp->astr = flags; dp->alen++; flag_qsort(flags, 0, dp->alen); } dp = dp->next_homonym; } return 0; } /* remove forbidden flag to add a personal word to the hash */ int HashMgr::remove_forbidden_flag(const char * word) { struct hentry * dp = lookup(word); if (!dp) return 1; while (dp) { if (dp->astr && TESTAFF(dp->astr, forbiddenword, dp->alen)) { if (dp->alen == 1) dp->alen = 0; // XXX forbidden words of personal dic. else { unsigned short * flags2 = (unsigned short *) malloc(sizeof(short) * (dp->alen - 1)); if (!flags2) return 1; int i, j = 0; for (i = 0; i < dp->alen; i++) { if (dp->astr[i] != forbiddenword) flags2[j++] = dp->astr[i]; } dp->alen--; dp->astr = flags2; // XXX allowed forbidden words } } dp = dp->next_homonym; } return 0; } // add a custom dic. word to the hash table (public) int HashMgr::add(const char * word) { unsigned short * flags = NULL; int al = 0; if (remove_forbidden_flag(word)) { int captype; int wbl = strlen(word); int wcl = get_clen_and_captype(word, wbl, &captype); add_word(word, wbl, wcl, flags, al, NULL, false); return add_hidden_capitalized_word((char *) word, wbl, wcl, flags, al, NULL, captype); } return 0; } int HashMgr::add_with_affix(const char * word, const char * example) { // detect captype and modify word length for UTF-8 encoding struct hentry * dp = lookup(example); remove_forbidden_flag(word); if (dp && dp->astr) { int captype; int wbl = strlen(word); int wcl = get_clen_and_captype(word, wbl, &captype); if (aliasf) { add_word(word, wbl, wcl, dp->astr, dp->alen, NULL, false); } else { unsigned short * flags = (unsigned short *) malloc (dp->alen * sizeof(short)); if (flags) { memcpy((void *) flags, (void *) dp->astr, dp->alen * sizeof(short)); add_word(word, wbl, wcl, flags, dp->alen, NULL, false); } else return 1; } return add_hidden_capitalized_word((char *) word, wbl, wcl, dp->astr, dp->alen, NULL, captype); } return 1; } // walk the hash table entry by entry - null at end // initialize: col=-1; hp = NULL; hp = walk_hashtable(&col, hp); struct hentry * HashMgr::walk_hashtable(int &col, struct hentry * hp) const { if (hp && hp->next != NULL) return hp->next; for (col++; col < tablesize; col++) { if (tableptr[col]) return tableptr[col]; } // null at end and reset to start col = -1; return NULL; } // load a munched word list and build a hash table on the fly int HashMgr::load_tables(const char * tpath, const char * key) { int al; char * ap; char * dp; char * dp2; unsigned short * flags; char * ts; // open dictionary file FileMgr * dict = new FileMgr(tpath, key); if (dict == NULL) return 1; // first read the first line of file to get hash table size */ if (!(ts = dict->getline())) { HUNSPELL_WARNING(stderr, "error: empty dic file\n"); delete dict; return 2; } mychomp(ts); /* remove byte order mark */ if (strncmp(ts,"\xEF\xBB\xBF",3) == 0) { memmove(ts, ts+3, strlen(ts+3)+1); // warning: dic file begins with byte order mark: possible incompatibility with old Hunspell versions } tablesize = atoi(ts); if (tablesize == 0) { HUNSPELL_WARNING(stderr, "error: line 1: missing or bad word count in the dic file\n"); delete dict; return 4; } tablesize = tablesize + 5 + USERWORD; if ((tablesize %2) == 0) tablesize++; // allocate the hash table tableptr = (struct hentry **) malloc(tablesize * sizeof(struct hentry *)); if (! tableptr) { delete dict; return 3; } for (int i=0; igetline())) { mychomp(ts); // split each line into word and morphological description dp = ts; while ((dp = strchr(dp, ':'))) { if ((dp > ts + 3) && (*(dp - 3) == ' ' || *(dp - 3) == '\t')) { for (dp -= 4; dp >= ts && (*dp == ' ' || *dp == '\t'); dp--); if (dp < ts) { // missing word dp = NULL; } else { *(dp + 1) = '\0'; dp = dp + 2; } break; } dp++; } // tabulator is the old morphological field separator dp2 = strchr(ts, '\t'); if (dp2 && (!dp || dp2 < dp)) { *dp2 = '\0'; dp = dp2 + 1; } // split each line into word and affix char strings // "\/" signs slash in words (not affix separator) // "/" at beginning of the line is word character (not affix separator) ap = strchr(ts,'/'); while (ap) { if (ap == ts) { ap++; continue; } else if (*(ap - 1) != '\\') break; // replace "\/" with "/" for (char * sp = ap - 1; *sp; *sp = *(sp + 1), sp++); ap = strchr(ap,'/'); } if (ap) { *ap = '\0'; if (aliasf) { int index = atoi(ap + 1); al = get_aliasf(index, &flags, dict); if (!al) { HUNSPELL_WARNING(stderr, "error: line %d: bad flag vector alias\n", dict->getlinenum()); *ap = '\0'; } } else { al = decode_flags(&flags, ap + 1, dict); if (al == -1) { HUNSPELL_WARNING(stderr, "Can't allocate memory.\n"); return 6; } flag_qsort(flags, 0, al); } } else { al = 0; ap = NULL; flags = NULL; } int captype; int wbl = strlen(ts); int wcl = get_clen_and_captype(ts, wbl, &captype); // add the word and its index plus its capitalized form optionally if (add_word(ts,wbl,wcl,flags,al,dp, false) || add_hidden_capitalized_word(ts, wbl, wcl, flags, al, dp, captype)) { delete dict; return 5; } } delete dict; return 0; } // the hash function is a simple load and rotate // algorithm borrowed int HashMgr::hash(const char * word) const { long hv = 0; for (int i=0; i < 4 && *word != 0; i++) hv = (hv << 8) | (*word++); while (*word != 0) { ROTATE(hv,ROTATE_LEN); hv ^= (*word++); } return (unsigned long) hv % tablesize; } int HashMgr::decode_flags(unsigned short ** result, char * flags, FileMgr * af) { int len; if (*flags == '\0') { HUNSPELL_WARNING(stderr, "error: line %d: bad flagvector\n", af->getlinenum()); *result = NULL; return 0; } switch (flag_mode) { case FLAG_LONG: { // two-character flags (1x2yZz -> 1x 2y Zz) len = strlen(flags); if (len%2 == 1) HUNSPELL_WARNING(stderr, "error: line %d: bad flagvector\n", af->getlinenum()); len /= 2; *result = (unsigned short *) malloc(len * sizeof(short)); if (!*result) return -1; for (int i = 0; i < len; i++) { (*result)[i] = (((unsigned short) flags[i * 2]) << 8) + (unsigned short) flags[i * 2 + 1]; } break; } case FLAG_NUM: { // decimal numbers separated by comma (4521,23,233 -> 4521 23 233) int i; len = 1; char * src = flags; unsigned short * dest; char * p; for (p = flags; *p; p++) { if (*p == ',') len++; } *result = (unsigned short *) malloc(len * sizeof(short)); if (!*result) return -1; dest = *result; for (p = flags; *p; p++) { if (*p == ',') { i = atoi(src); if (i >= DEFAULTFLAGS) HUNSPELL_WARNING(stderr, "error: line %d: flag id %d is too large (max: %d)\n", af->getlinenum(), i, DEFAULTFLAGS - 1); *dest = (unsigned short) i; if (*dest == 0) HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n", af->getlinenum()); src = p + 1; dest++; } } i = atoi(src); if (i >= DEFAULTFLAGS) HUNSPELL_WARNING(stderr, "error: line %d: flag id %d is too large (max: %d)\n", af->getlinenum(), i, DEFAULTFLAGS - 1); *dest = (unsigned short) i; if (*dest == 0) HUNSPELL_WARNING(stderr, "error: line %d: 0 is wrong flag id\n", af->getlinenum()); break; } case FLAG_UNI: { // UTF-8 characters w_char w[BUFSIZE/2]; len = u8_u16(w, BUFSIZE/2, flags); *result = (unsigned short *) malloc(len * sizeof(short)); if (!*result) return -1; memcpy(*result, w, len * sizeof(short)); break; } default: { // Ispell's one-character flags (erfg -> e r f g) unsigned short * dest; len = strlen(flags); *result = (unsigned short *) malloc(len * sizeof(short)); if (!*result) return -1; dest = *result; for (unsigned char * p = (unsigned char *) flags; *p; p++) { *dest = (unsigned short) *p; dest++; } } } return len; } unsigned short HashMgr::decode_flag(const char * f) { unsigned short s = 0; int i; switch (flag_mode) { case FLAG_LONG: s = ((unsigned short) f[0] << 8) + (unsigned short) f[1]; break; case FLAG_NUM: i = atoi(f); if (i >= DEFAULTFLAGS) HUNSPELL_WARNING(stderr, "error: flag id %d is too large (max: %d)\n", i, DEFAULTFLAGS - 1); s = (unsigned short) i; break; case FLAG_UNI: u8_u16((w_char *) &s, 1, f); break; default: s = (unsigned short) *((unsigned char *)f); } if (s == 0) HUNSPELL_WARNING(stderr, "error: 0 is wrong flag id\n"); return s; } char * HashMgr::encode_flag(unsigned short f) { unsigned char ch[10]; if (f==0) return mystrdup("(NULL)"); if (flag_mode == FLAG_LONG) { ch[0] = (unsigned char) (f >> 8); ch[1] = (unsigned char) (f - ((f >> 8) << 8)); ch[2] = '\0'; } else if (flag_mode == FLAG_NUM) { sprintf((char *) ch, "%d", f); } else if (flag_mode == FLAG_UNI) { u16_u8((char *) &ch, 10, (w_char *) &f, 1); } else { ch[0] = (unsigned char) (f); ch[1] = '\0'; } return mystrdup((char *) ch); } // read in aff file and set flag mode int HashMgr::load_config(const char * affpath, const char * key) { char * line; // io buffers int firstline = 1; // open the affix file FileMgr * afflst = new FileMgr(affpath, key); if (!afflst) { HUNSPELL_WARNING(stderr, "Error - could not open affix description file %s\n",affpath); return 1; } // read in each line ignoring any that do not // start with a known line type indicator while ((line = afflst->getline())) { mychomp(line); /* remove byte order mark */ if (firstline) { firstline = 0; if (strncmp(line,"\xEF\xBB\xBF",3) == 0) memmove(line, line+3, strlen(line+3)+1); } /* parse in the try string */ if ((strncmp(line,"FLAG",4) == 0) && isspace(line[4])) { if (flag_mode != FLAG_CHAR) { HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of the FLAG affix file parameter\n", afflst->getlinenum()); } if (strstr(line, "long")) flag_mode = FLAG_LONG; if (strstr(line, "num")) flag_mode = FLAG_NUM; if (strstr(line, "UTF-8")) flag_mode = FLAG_UNI; if (flag_mode == FLAG_CHAR) { HUNSPELL_WARNING(stderr, "error: line %d: FLAG needs `num', `long' or `UTF-8' parameter\n", afflst->getlinenum()); } } if (strncmp(line,"FORBIDDENWORD",13) == 0) { char * st = NULL; if (parse_string(line, &st, afflst->getlinenum())) { delete afflst; return 1; } forbiddenword = decode_flag(st); free(st); } if (strncmp(line, "SET", 3) == 0) { if (parse_string(line, &enc, afflst->getlinenum())) { delete afflst; return 1; } if (strcmp(enc, "UTF-8") == 0) { utf8 = 1; #ifndef OPENOFFICEORG #ifndef MOZILLA_CLIENT initialize_utf_tbl(); #endif #endif } else csconv = get_current_cs(enc); } if (strncmp(line, "LANG", 4) == 0) { if (parse_string(line, &lang, afflst->getlinenum())) { delete afflst; return 1; } langnum = get_lang_num(lang); } /* parse in the ignored characters (for example, Arabic optional diacritics characters */ if (strncmp(line,"IGNORE",6) == 0) { if (parse_array(line, &ignorechars, &ignorechars_utf16, &ignorechars_utf16_len, utf8, afflst->getlinenum())) { delete afflst; return 1; } } if ((strncmp(line,"AF",2) == 0) && isspace(line[2])) { if (parse_aliasf(line, afflst)) { delete afflst; return 1; } } if ((strncmp(line,"AM",2) == 0) && isspace(line[2])) { if (parse_aliasm(line, afflst)) { delete afflst; return 1; } } if (strncmp(line,"COMPLEXPREFIXES",15) == 0) complexprefixes = 1; if (((strncmp(line,"SFX",3) == 0) || (strncmp(line,"PFX",3) == 0)) && isspace(line[3])) break; } if (csconv == NULL) csconv = get_current_cs(SPELL_ENCODING); delete afflst; return 0; } /* parse in the ALIAS table */ int HashMgr::parse_aliasf(char * line, FileMgr * af) { if (numaliasf != 0) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { numaliasf = atoi(piece); if (numaliasf < 1) { numaliasf = 0; aliasf = NULL; aliasflen = NULL; HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); return 1; } aliasf = (unsigned short **) malloc(numaliasf * sizeof(unsigned short *)); aliasflen = (unsigned short *) malloc(numaliasf * sizeof(short)); if (!aliasf || !aliasflen) { numaliasf = 0; if (aliasf) free(aliasf); if (aliasflen) free(aliasflen); aliasf = NULL; aliasflen = NULL; return 1; } np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { numaliasf = 0; free(aliasf); free(aliasflen); aliasf = NULL; aliasflen = NULL; HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the numaliasf lines to read in the remainder of the table */ char * nl; for (int j=0; j < numaliasf; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; aliasf[j] = NULL; aliasflen[j] = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece,"AF",2) != 0) { numaliasf = 0; free(aliasf); free(aliasflen); aliasf = NULL; aliasflen = NULL; HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); return 1; } break; } case 1: { aliasflen[j] = (unsigned short) decode_flags(&(aliasf[j]), piece, af); flag_qsort(aliasf[j], 0, aliasflen[j]); break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (!aliasf[j]) { free(aliasf); free(aliasflen); aliasf = NULL; aliasflen = NULL; numaliasf = 0; HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); return 1; } } return 0; } int HashMgr::is_aliasf() { return (aliasf != NULL); } int HashMgr::get_aliasf(int index, unsigned short ** fvec, FileMgr * af) { if ((index > 0) && (index <= numaliasf)) { *fvec = aliasf[index - 1]; return aliasflen[index - 1]; } HUNSPELL_WARNING(stderr, "error: line %d: bad flag alias index: %d\n", af->getlinenum(), index); *fvec = NULL; return 0; } /* parse morph alias definitions */ int HashMgr::parse_aliasm(char * line, FileMgr * af) { if (numaliasm != 0) { HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); return 1; } char * tp = line; char * piece; int i = 0; int np = 0; piece = mystrsep(&tp, 0); while (piece) { if (*piece != '\0') { switch(i) { case 0: { np++; break; } case 1: { numaliasm = atoi(piece); if (numaliasm < 1) { HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); return 1; } aliasm = (char **) malloc(numaliasm * sizeof(char *)); if (!aliasm) { numaliasm = 0; return 1; } np++; break; } default: break; } i++; } piece = mystrsep(&tp, 0); } if (np != 2) { numaliasm = 0; free(aliasm); aliasm = NULL; HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); return 1; } /* now parse the numaliasm lines to read in the remainder of the table */ char * nl = line; for (int j=0; j < numaliasm; j++) { if (!(nl = af->getline())) return 1; mychomp(nl); tp = nl; i = 0; aliasm[j] = NULL; piece = mystrsep(&tp, ' '); while (piece) { if (*piece != '\0') { switch(i) { case 0: { if (strncmp(piece,"AM",2) != 0) { HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); numaliasm = 0; free(aliasm); aliasm = NULL; return 1; } break; } case 1: { // add the remaining of the line if (*tp) { *(tp - 1) = ' '; tp = tp + strlen(tp); } if (complexprefixes) { if (utf8) reverseword_utf(piece); else reverseword(piece); } aliasm[j] = mystrdup(piece); if (!aliasm[j]) { numaliasm = 0; free(aliasm); aliasm = NULL; return 1; } break; } default: break; } i++; } piece = mystrsep(&tp, ' '); } if (!aliasm[j]) { numaliasm = 0; free(aliasm); aliasm = NULL; HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); return 1; } } return 0; } int HashMgr::is_aliasm() { return (aliasm != NULL); } char * HashMgr::get_aliasm(int index) { if ((index > 0) && (index <= numaliasm)) return aliasm[index - 1]; HUNSPELL_WARNING(stderr, "error: bad morph. alias index: %d\n", index); return NULL; } qt-client-4.1.0/hunspell/hashmgr.hxx000066400000000000000000000042571217451700100174360ustar00rootroot00000000000000#ifndef _HASHMGR_HXX_ #define _HASHMGR_HXX_ #include "hunvisapi.h" #include #include "htypes.hxx" #include "filemgr.hxx" enum flag { FLAG_CHAR, FLAG_LONG, FLAG_NUM, FLAG_UNI }; class LIBHUNSPELL_DLL_EXPORTED HashMgr { int tablesize; struct hentry ** tableptr; int userword; flag flag_mode; int complexprefixes; int utf8; unsigned short forbiddenword; int langnum; char * enc; char * lang; struct cs_info * csconv; char * ignorechars; unsigned short * ignorechars_utf16; int ignorechars_utf16_len; int numaliasf; // flag vector `compression' with aliases unsigned short ** aliasf; unsigned short * aliasflen; int numaliasm; // morphological desciption `compression' with aliases char ** aliasm; public: HashMgr(const char * tpath, const char * apath, const char * key = NULL); ~HashMgr(); struct hentry * lookup(const char *) const; int hash(const char *) const; struct hentry * walk_hashtable(int & col, struct hentry * hp) const; int add(const char * word); int add_with_affix(const char * word, const char * pattern); int remove(const char * word); int decode_flags(unsigned short ** result, char * flags, FileMgr * af); unsigned short decode_flag(const char * flag); char * encode_flag(unsigned short flag); int is_aliasf(); int get_aliasf(int index, unsigned short ** fvec, FileMgr * af); int is_aliasm(); char * get_aliasm(int index); private: int get_clen_and_captype(const char * word, int wbl, int * captype); int load_tables(const char * tpath, const char * key); int add_word(const char * word, int wbl, int wcl, unsigned short * ap, int al, const char * desc, bool onlyupcase); int load_config(const char * affpath, const char * key); int parse_aliasf(char * line, FileMgr * af); int add_hidden_capitalized_word(char * word, int wbl, int wcl, unsigned short * flags, int al, char * dp, int captype); int parse_aliasm(char * line, FileMgr * af); int remove_forbidden_flag(const char * word); }; #endif qt-client-4.1.0/hunspell/htypes.hxx000066400000000000000000000016301217451700100173110ustar00rootroot00000000000000#ifndef _HTYPES_HXX_ #define _HTYPES_HXX_ #define ROTATE_LEN 5 #define ROTATE(v,q) \ (v) = ((v) << (q)) | (((v) >> (32 - q)) & ((1 << (q))-1)); // hentry options #define H_OPT (1 << 0) #define H_OPT_ALIASM (1 << 1) #define H_OPT_PHON (1 << 2) // see also csutil.hxx #define HENTRY_WORD(h) (h->word) // approx. number of user defined words #define USERWORD 1000 struct hentry { unsigned char blen; // word length in bytes unsigned char clen; // word length in characters (different for UTF-8 enc.) short alen; // length of affix flag vector unsigned short * astr; // affix flag vector struct hentry * next; // next word with same hash code struct hentry * next_homonym; // next homonym word (with same hash code) char var; // variable fields (only for special pronounciation yet) char word[1]; // variable-length word (8-bit or UTF-8 encoding) }; #endif qt-client-4.1.0/hunspell/hunspell.cxx000066400000000000000000001706571217451700100176420ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include "hunspell.hxx" #include "hunspell.h" #ifndef MOZILLA_CLIENT # include "config.h" #endif #include "csutil.hxx" Hunspell::Hunspell(const char * affpath, const char * dpath, const char * key) { encoding = NULL; csconv = NULL; utf8 = 0; complexprefixes = 0; affixpath = mystrdup(affpath); maxdic = 0; /* first set up the hash manager */ pHMgr[0] = new HashMgr(dpath, affpath, key); if (pHMgr[0]) maxdic = 1; /* next set up the affix manager */ /* it needs access to the hash manager lookup methods */ pAMgr = new AffixMgr(affpath, pHMgr, &maxdic, key); /* get the preferred try string and the dictionary */ /* encoding from the Affix Manager for that dictionary */ char * try_string = pAMgr->get_try_string(); encoding = pAMgr->get_encoding(); csconv = get_current_cs(encoding); langnum = pAMgr->get_langnum(); utf8 = pAMgr->get_utf8(); complexprefixes = pAMgr->get_complexprefixes(); wordbreak = pAMgr->get_breaktable(); /* and finally set up the suggestion manager */ pSMgr = new SuggestMgr(try_string, MAXSUGGESTION, pAMgr); if (try_string) free(try_string); } Hunspell::~Hunspell() { if (pSMgr) delete pSMgr; if (pAMgr) delete pAMgr; for (int i = 0; i < maxdic; i++) delete pHMgr[i]; maxdic = 0; pSMgr = NULL; pAMgr = NULL; #ifdef MOZILLA_CLIENT delete [] csconv; #endif csconv= NULL; if (encoding) free(encoding); encoding = NULL; if (affixpath) free(affixpath); affixpath = NULL; } // load extra dictionaries int Hunspell::add_dic(const char * dpath, const char * key) { if (maxdic == MAXDIC || !affixpath) return 1; pHMgr[maxdic] = new HashMgr(dpath, affixpath, key); if (pHMgr[maxdic]) maxdic++; else return 1; return 0; } // make a copy of src at destination while removing all leading // blanks and removing any trailing periods after recording // their presence with the abbreviation flag // also since already going through character by character, // set the capitalization type // return the length of the "cleaned" (and UTF-8 encoded) word int Hunspell::cleanword2(char * dest, const char * src, w_char * dest_utf, int * nc, int * pcaptype, int * pabbrev) { unsigned char * p = (unsigned char *) dest; const unsigned char * q = (const unsigned char * ) src; // first skip over any leading blanks while ((*q != '\0') && (*q == ' ')) q++; // now strip off any trailing periods (recording their presence) *pabbrev = 0; int nl = strlen((const char *)q); while ((nl > 0) && (*(q+nl-1)=='.')) { nl--; (*pabbrev)++; } // if no characters are left it can't be capitalized if (nl <= 0) { *pcaptype = NOCAP; *p = '\0'; return 0; } strncpy(dest, (char *) q, nl); *(dest + nl) = '\0'; nl = strlen(dest); if (utf8) { *nc = u8_u16(dest_utf, MAXWORDLEN, dest); // don't check too long words if (*nc >= MAXWORDLEN) return 0; if (*nc == -1) { // big Unicode character (non BMP area) *pcaptype = NOCAP; return nl; } *pcaptype = get_captype_utf8(dest_utf, *nc, langnum); } else { *pcaptype = get_captype(dest, nl, csconv); *nc = nl; } return nl; } int Hunspell::cleanword(char * dest, const char * src, int * pcaptype, int * pabbrev) { unsigned char * p = (unsigned char *) dest; const unsigned char * q = (const unsigned char * ) src; int firstcap = 0; // first skip over any leading blanks while ((*q != '\0') && (*q == ' ')) q++; // now strip off any trailing periods (recording their presence) *pabbrev = 0; int nl = strlen((const char *)q); while ((nl > 0) && (*(q+nl-1)=='.')) { nl--; (*pabbrev)++; } // if no characters are left it can't be capitalized if (nl <= 0) { *pcaptype = NOCAP; *p = '\0'; return 0; } // now determine the capitalization type of the first nl letters int ncap = 0; int nneutral = 0; int nc = 0; if (!utf8) { while (nl > 0) { nc++; if (csconv[(*q)].ccase) ncap++; if (csconv[(*q)].cupper == csconv[(*q)].clower) nneutral++; *p++ = *q++; nl--; } // remember to terminate the destination string *p = '\0'; firstcap = csconv[(unsigned char)(*dest)].ccase; } else { unsigned short idx; w_char t[MAXWORDLEN]; nc = u8_u16(t, MAXWORDLEN, src); for (int i = 0; i < nc; i++) { idx = (t[i].h << 8) + t[i].l; unsigned short low = unicodetolower(idx, langnum); if (idx != low) ncap++; if (unicodetoupper(idx, langnum) == low) nneutral++; } u16_u8(dest, MAXWORDUTF8LEN, t, nc); if (ncap) { idx = (t[0].h << 8) + t[0].l; firstcap = (idx != unicodetolower(idx, langnum)); } } // now finally set the captype if (ncap == 0) { *pcaptype = NOCAP; } else if ((ncap == 1) && firstcap) { *pcaptype = INITCAP; } else if ((ncap == nc) || ((ncap + nneutral) == nc)){ *pcaptype = ALLCAP; } else if ((ncap > 1) && firstcap) { *pcaptype = HUHINITCAP; } else { *pcaptype = HUHCAP; } return strlen(dest); } void Hunspell::mkallcap(char * p) { if (utf8) { w_char u[MAXWORDLEN]; int nc = u8_u16(u, MAXWORDLEN, p); unsigned short idx; for (int i = 0; i < nc; i++) { idx = (u[i].h << 8) + u[i].l; if (idx != unicodetoupper(idx, langnum)) { u[i].h = (unsigned char) (unicodetoupper(idx, langnum) >> 8); u[i].l = (unsigned char) (unicodetoupper(idx, langnum) & 0x00FF); } } u16_u8(p, MAXWORDUTF8LEN, u, nc); } else { while (*p != '\0') { *p = csconv[((unsigned char) *p)].cupper; p++; } } } int Hunspell::mkallcap2(char * p, w_char * u, int nc) { if (utf8) { unsigned short idx; for (int i = 0; i < nc; i++) { idx = (u[i].h << 8) + u[i].l; unsigned short up = unicodetoupper(idx, langnum); if (idx != up) { u[i].h = (unsigned char) (up >> 8); u[i].l = (unsigned char) (up & 0x00FF); } } u16_u8(p, MAXWORDUTF8LEN, u, nc); return strlen(p); } else { while (*p != '\0') { *p = csconv[((unsigned char) *p)].cupper; p++; } } return nc; } void Hunspell::mkallsmall(char * p) { while (*p != '\0') { *p = csconv[((unsigned char) *p)].clower; p++; } } int Hunspell::mkallsmall2(char * p, w_char * u, int nc) { if (utf8) { unsigned short idx; for (int i = 0; i < nc; i++) { idx = (u[i].h << 8) + u[i].l; unsigned short low = unicodetolower(idx, langnum); if (idx != low) { u[i].h = (unsigned char) (low >> 8); u[i].l = (unsigned char) (low & 0x00FF); } } u16_u8(p, MAXWORDUTF8LEN, u, nc); return strlen(p); } else { while (*p != '\0') { *p = csconv[((unsigned char) *p)].clower; p++; } } return nc; } // convert UTF-8 sharp S codes to latin 1 char * Hunspell::sharps_u8_l1(char * dest, char * source) { char * p = dest; *p = *source; for (p++, source++; *(source - 1); p++, source++) { *p = *source; if (*source == '\x9F') *--p = '\xDF'; } return dest; } // recursive search for right ss - sharp s permutations hentry * Hunspell::spellsharps(char * base, char * pos, int n, int repnum, char * tmp, int * info, char **root) { pos = strstr(pos, "ss"); if (pos && (n < MAXSHARPS)) { *pos = '\xC3'; *(pos + 1) = '\x9F'; hentry * h = spellsharps(base, pos + 2, n + 1, repnum + 1, tmp, info, root); if (h) return h; *pos = 's'; *(pos + 1) = 's'; h = spellsharps(base, pos + 2, n + 1, repnum, tmp, info, root); if (h) return h; } else if (repnum > 0) { if (utf8) return checkword(base, info, root); return checkword(sharps_u8_l1(tmp, base), info, root); } return NULL; } int Hunspell::is_keepcase(const hentry * rv) { return pAMgr && rv->astr && pAMgr->get_keepcase() && TESTAFF(rv->astr, pAMgr->get_keepcase(), rv->alen); } /* insert a word to the beginning of the suggestion array and return ns */ int Hunspell::insert_sug(char ***slst, char * word, int ns) { char * dup = mystrdup(word); if (!dup) return ns; if (ns == MAXSUGGESTION) { ns--; free((*slst)[ns]); } for (int k = ns; k > 0; k--) (*slst)[k] = (*slst)[k - 1]; (*slst)[0] = dup; return ns + 1; } int Hunspell::spell(const char * word, int * info, char ** root) { struct hentry * rv=NULL; // need larger vector. For example, Turkish capital letter I converted a // 2-byte UTF-8 character (dotless i) by mkallsmall. char cw[MAXWORDUTF8LEN]; char wspace[MAXWORDUTF8LEN]; w_char unicw[MAXWORDLEN]; // Hunspell supports XML input of the simplified API (see manual) if (strcmp(word, SPELL_XML) == 0) return 1; int nc = strlen(word); int wl2 = 0; if (utf8) { if (nc >= MAXWORDUTF8LEN) return 0; } else { if (nc >= MAXWORDLEN) return 0; } int captype = 0; int abbv = 0; int wl = 0; // input conversion RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL; if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv); else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv); int info2 = 0; if (wl == 0 || maxdic == 0) return 1; if (root) *root = NULL; // allow numbers with dots, dashes and commas (but forbid double separators: "..", "--" etc.) enum { NBEGIN, NNUM, NSEP }; int nstate = NBEGIN; int i; for (i = 0; (i < wl); i++) { if ((cw[i] <= '9') && (cw[i] >= '0')) { nstate = NNUM; } else if ((cw[i] == ',') || (cw[i] == '.') || (cw[i] == '-')) { if ((nstate == NSEP) || (i == 0)) break; nstate = NSEP; } else break; } if ((i == wl) && (nstate == NNUM)) return 1; if (!info) info = &info2; else *info = 0; switch(captype) { case HUHCAP: case HUHINITCAP: case NOCAP: { rv = checkword(cw, info, root); if ((abbv) && !(rv)) { memcpy(wspace,cw,wl); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; rv = checkword(wspace, info, root); } break; } case ALLCAP: { rv = checkword(cw, info, root); if (rv) break; if (abbv) { memcpy(wspace,cw,wl); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; rv = checkword(wspace, info, root); if (rv) break; } // Spec. prefix handling for Catalan, French, Italian: // prefixes separated by apostrophe (SANT'ELIA -> Sant'+Elia). if (pAMgr && strchr(cw, '\'')) { wl = mkallsmall2(cw, unicw, nc); //There are no really sane circumstances where this could fail, //but anyway... if (char * apostrophe = strchr(cw, '\'')) { if (utf8) { w_char tmpword[MAXWORDLEN]; *apostrophe = '\0'; wl2 = u8_u16(tmpword, MAXWORDLEN, cw); *apostrophe = '\''; if (wl2 < nc) { mkinitcap2(apostrophe + 1, unicw + wl2 + 1, nc - wl2 - 1); rv = checkword(cw, info, root); if (rv) break; } } else { mkinitcap2(apostrophe + 1, unicw, nc); rv = checkword(cw, info, root); if (rv) break; } } mkinitcap2(cw, unicw, nc); rv = checkword(cw, info, root); if (rv) break; } if (pAMgr && pAMgr->get_checksharps() && strstr(cw, "SS")) { char tmpword[MAXWORDUTF8LEN]; wl = mkallsmall2(cw, unicw, nc); memcpy(wspace,cw,(wl+1)); rv = spellsharps(wspace, wspace, 0, 0, tmpword, info, root); if (!rv) { wl2 = mkinitcap2(cw, unicw, nc); rv = spellsharps(cw, cw, 0, 0, tmpword, info, root); } if ((abbv) && !(rv)) { *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; rv = spellsharps(wspace, wspace, 0, 0, tmpword, info, root); if (!rv) { memcpy(wspace, cw, wl2); *(wspace+wl2) = '.'; *(wspace+wl2+1) = '\0'; rv = spellsharps(wspace, wspace, 0, 0, tmpword, info, root); } } if (rv) break; } } case INITCAP: { wl = mkallsmall2(cw, unicw, nc); memcpy(wspace,cw,(wl+1)); wl2 = mkinitcap2(cw, unicw, nc); if (captype == INITCAP) *info += SPELL_INITCAP; rv = checkword(cw, info, root); if (captype == INITCAP) *info -= SPELL_INITCAP; // forbid bad capitalization // (for example, ijs -> Ijs instead of IJs in Dutch) // use explicit forms in dic: Ijs/F (F = FORBIDDENWORD flag) if (*info & SPELL_FORBIDDEN) { rv = NULL; break; } if (rv && is_keepcase(rv) && (captype == ALLCAP)) rv = NULL; if (rv) break; rv = checkword(wspace, info, root); if (abbv && !rv) { *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; rv = checkword(wspace, info, root); if (!rv) { memcpy(wspace, cw, wl2); *(wspace+wl2) = '.'; *(wspace+wl2+1) = '\0'; if (captype == INITCAP) *info += SPELL_INITCAP; rv = checkword(wspace, info, root); if (captype == INITCAP) *info -= SPELL_INITCAP; if (rv && is_keepcase(rv) && (captype == ALLCAP)) rv = NULL; break; } } if (rv && is_keepcase(rv) && ((captype == ALLCAP) || // if CHECKSHARPS: KEEPCASE words with \xDF are allowed // in INITCAP form, too. !(pAMgr->get_checksharps() && ((utf8 && strstr(wspace, "\xC3\x9F")) || (!utf8 && strchr(wspace, '\xDF')))))) rv = NULL; break; } } if (rv) return 1; // recursive breaking at break points if (wordbreak) { char * s; char r; int nbr = 0; wl = strlen(cw); int numbreak = pAMgr ? pAMgr->get_numbreak() : 0; // calculate break points for recursion limit for (int j = 0; j < numbreak; j++) { s = cw; do { s = (char *) strstr(s, wordbreak[j]); if (s) { nbr++; s++; } } while (s); } if (nbr >= 10) return 0; // check boundary patterns (^begin and end$) for (int j = 0; j < numbreak; j++) { int plen = strlen(wordbreak[j]); if (plen == 1 || plen > wl) continue; if (wordbreak[j][0] == '^' && strncmp(cw, wordbreak[j] + 1, plen - 1) == 0 && spell(cw + plen - 1)) return 1; if (wordbreak[j][plen - 1] == '$' && strncmp(cw + wl - plen + 1, wordbreak[j], plen - 1) == 0) { r = cw[wl - plen + 1]; cw[wl - plen + 1] = '\0'; if (spell(cw)) return 1; cw[wl - plen + 1] = r; } } // other patterns for (int j = 0; j < numbreak; j++) { int plen = strlen(wordbreak[j]); s=(char *) strstr(cw, wordbreak[j]); if (s && (s > cw) && (s < cw + wl - plen)) { if (!spell(s + plen)) continue; r = *s; *s = '\0'; // examine 2 sides of the break point if (spell(cw)) return 1; *s = r; // LANG_hu: spec. dash rule if (langnum == LANG_hu && strcmp(wordbreak[j], "-") == 0) { r = s[1]; s[1] = '\0'; if (spell(cw)) return 1; // check the first part with dash s[1] = r; } // end of LANG speficic region } } } return 0; } struct hentry * Hunspell::checkword(const char * w, int * info, char ** root) { struct hentry * he = NULL; int len, i; char w2[MAXWORDUTF8LEN]; const char * word; char * ignoredchars = pAMgr->get_ignore(); if (ignoredchars != NULL) { strcpy(w2, w); if (utf8) { int ignoredchars_utf16_len; unsigned short * ignoredchars_utf16 = pAMgr->get_ignore_utf16(&ignoredchars_utf16_len); remove_ignored_chars_utf(w2, ignoredchars_utf16, ignoredchars_utf16_len); } else { remove_ignored_chars(w2,ignoredchars); } word = w2; } else word = w; // word reversing wrapper for complex prefixes if (complexprefixes) { if (word != w2) { strcpy(w2, word); word = w2; } if (utf8) reverseword_utf(w2); else reverseword(w2); } // look word in hash table for (i = 0; (i < maxdic) && !he; i ++) { he = (pHMgr[i])->lookup(word); // check forbidden and onlyincompound words if ((he) && (he->astr) && (pAMgr) && TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) { if (info) *info += SPELL_FORBIDDEN; // LANG_hu section: set dash information for suggestions if (langnum == LANG_hu) { if (pAMgr->get_compoundflag() && TESTAFF(he->astr, pAMgr->get_compoundflag(), he->alen)) { if (info) *info += SPELL_COMPOUND; } } return NULL; } // he = next not needaffix, onlyincompound homonym or onlyupcase word while (he && (he->astr) && ((pAMgr->get_needaffix() && TESTAFF(he->astr, pAMgr->get_needaffix(), he->alen)) || (pAMgr->get_onlyincompound() && TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) || (info && (*info & SPELL_INITCAP) && TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)) )) he = he->next_homonym; } // check with affixes if (!he && pAMgr) { // try stripping off affixes */ len = strlen(word); he = pAMgr->affix_check(word, len, 0); // check compound restriction and onlyupcase if (he && he->astr && ( (pAMgr->get_onlyincompound() && TESTAFF(he->astr, pAMgr->get_onlyincompound(), he->alen)) || (info && (*info & SPELL_INITCAP) && TESTAFF(he->astr, ONLYUPCASEFLAG, he->alen)))) { he = NULL; } if (he) { if ((he->astr) && (pAMgr) && TESTAFF(he->astr, pAMgr->get_forbiddenword(), he->alen)) { if (info) *info += SPELL_FORBIDDEN; return NULL; } if (root) { *root = mystrdup(he->word); if (*root && complexprefixes) { if (utf8) reverseword_utf(*root); else reverseword(*root); } } // try check compound word } else if (pAMgr->get_compound()) { he = pAMgr->compound_check(word, len, 0, 0, 100, 0, NULL, 0, 0); // LANG_hu section: `moving rule' with last dash if ((!he) && (langnum == LANG_hu) && (word[len-1] == '-')) { char * dup = mystrdup(word); if (!dup) return NULL; dup[len-1] = '\0'; he = pAMgr->compound_check(dup, len-1, -5, 0, 100, 0, NULL, 1, 0); free(dup); } // end of LANG speficic region if (he) { if (root) { *root = mystrdup(he->word); if (*root && complexprefixes) { if (utf8) reverseword_utf(*root); else reverseword(*root); } } if (info) *info += SPELL_COMPOUND; } } } return he; } int Hunspell::suggest(char*** slst, const char * word) { int onlycmpdsug = 0; char cw[MAXWORDUTF8LEN]; char wspace[MAXWORDUTF8LEN]; if (!pSMgr || maxdic == 0) return 0; w_char unicw[MAXWORDLEN]; *slst = NULL; // process XML input of the simplified API (see manual) if (strncmp(word, SPELL_XML, sizeof(SPELL_XML) - 3) == 0) { return spellml(slst, word); } int nc = strlen(word); if (utf8) { if (nc >= MAXWORDUTF8LEN) return 0; } else { if (nc >= MAXWORDLEN) return 0; } int captype = 0; int abbv = 0; int wl = 0; // input conversion RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL; if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv); else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv); if (wl == 0) return 0; int ns = 0; int capwords = 0; switch(captype) { case NOCAP: { ns = pSMgr->suggest(slst, cw, ns, &onlycmpdsug); break; } case INITCAP: { capwords = 1; ns = pSMgr->suggest(slst, cw, ns, &onlycmpdsug); if (ns == -1) break; memcpy(wspace,cw,(wl+1)); mkallsmall2(wspace, unicw, nc); ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); break; } case HUHINITCAP: capwords = 1; case HUHCAP: { ns = pSMgr->suggest(slst, cw, ns, &onlycmpdsug); if (ns != -1) { int prevns; // something.The -> something. The char * dot = strchr(cw, '.'); if (dot && (dot > cw)) { int captype_; if (utf8) { w_char w_[MAXWORDLEN]; int wl_ = u8_u16(w_, MAXWORDLEN, dot + 1); captype_ = get_captype_utf8(w_, wl_, langnum); } else captype_ = get_captype(dot+1, strlen(dot+1), csconv); if (captype_ == INITCAP) { char * st = mystrdup(cw); if (st) st = (char *) realloc(st, wl + 2); if (st) { st[(dot - cw) + 1] = ' '; strcpy(st + (dot - cw) + 2, dot + 1); ns = insert_sug(slst, st, ns); free(st); } } } if (captype == HUHINITCAP) { // TheOpenOffice.org -> The OpenOffice.org memcpy(wspace,cw,(wl+1)); mkinitsmall2(wspace, unicw, nc); ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); } memcpy(wspace,cw,(wl+1)); mkallsmall2(wspace, unicw, nc); if (spell(wspace)) ns = insert_sug(slst, wspace, ns); prevns = ns; ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); if (captype == HUHINITCAP) { mkinitcap2(wspace, unicw, nc); if (spell(wspace)) ns = insert_sug(slst, wspace, ns); ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); } // aNew -> "a New" (instead of "a new") for (int j = prevns; j < ns; j++) { char * space = strchr((*slst)[j],' '); if (space) { int slen = strlen(space + 1); // different case after space (need capitalisation) if ((slen < wl) && strcmp(cw + wl - slen, space + 1)) { w_char w[MAXWORDLEN]; int wc = 0; char * r = (*slst)[j]; if (utf8) wc = u8_u16(w, MAXWORDLEN, space + 1); mkinitcap2(space + 1, w, wc); // set as first suggestion for (int k = j; k > 0; k--) (*slst)[k] = (*slst)[k - 1]; (*slst)[0] = r; } } } } break; } case ALLCAP: { memcpy(wspace, cw, (wl+1)); mkallsmall2(wspace, unicw, nc); ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); if (ns == -1) break; if (pAMgr && pAMgr->get_keepcase() && spell(wspace)) ns = insert_sug(slst, wspace, ns); mkinitcap2(wspace, unicw, nc); ns = pSMgr->suggest(slst, wspace, ns, &onlycmpdsug); for (int j=0; j < ns; j++) { mkallcap((*slst)[j]); if (pAMgr && pAMgr->get_checksharps()) { char * pos; if (utf8) { pos = strstr((*slst)[j], "\xC3\x9F"); while (pos) { *pos = 'S'; *(pos+1) = 'S'; pos = strstr(pos+2, "\xC3\x9F"); } } else { pos = strchr((*slst)[j], '\xDF'); while (pos) { (*slst)[j] = (char *) realloc((*slst)[j], strlen((*slst)[j]) + 2); mystrrep((*slst)[j], "\xDF", "SS"); pos = strchr((*slst)[j], '\xDF'); } } } } break; } } // LANG_hu section: replace '-' with ' ' in Hungarian if (langnum == LANG_hu) { for (int j=0; j < ns; j++) { char * pos = strchr((*slst)[j],'-'); if (pos) { int info; char w[MAXWORDUTF8LEN]; *pos = '\0'; strcpy(w, (*slst)[j]); strcat(w, pos + 1); spell(w, &info, NULL); if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) { *pos = ' '; } else *pos = '-'; } } } // END OF LANG_hu section // try ngram approach since found nothing if ((ns == 0 || onlycmpdsug) && pAMgr && (pAMgr->get_maxngramsugs() != 0) && (*slst)) { switch(captype) { case NOCAP: { ns = pSMgr->ngsuggest(*slst, cw, ns, pHMgr, maxdic); break; } case HUHINITCAP: capwords = 1; case HUHCAP: { memcpy(wspace,cw,(wl+1)); mkallsmall2(wspace, unicw, nc); ns = pSMgr->ngsuggest(*slst, wspace, ns, pHMgr, maxdic); break; } case INITCAP: { capwords = 1; memcpy(wspace,cw,(wl+1)); mkallsmall2(wspace, unicw, nc); ns = pSMgr->ngsuggest(*slst, wspace, ns, pHMgr, maxdic); break; } case ALLCAP: { memcpy(wspace,cw,(wl+1)); mkallsmall2(wspace, unicw, nc); int oldns = ns; ns = pSMgr->ngsuggest(*slst, wspace, ns, pHMgr, maxdic); for (int j = oldns; j < ns; j++) mkallcap((*slst)[j]); break; } } } // try dash suggestion (Afo-American -> Afro-American) if (char * pos = strchr(cw, '-')) { char * ppos = cw; int nodashsug = 1; char ** nlst = NULL; int nn = 0; int last = 0; if (*slst) { for (int j = 0; j < ns && nodashsug == 1; j++) { if (strchr((*slst)[j], '-')) nodashsug = 0; } } while (nodashsug && !last) { if (*pos == '\0') last = 1; else *pos = '\0'; if (!spell(ppos)) { nn = suggest(&nlst, ppos); for (int j = nn - 1; j >= 0; j--) { strncpy(wspace, cw, ppos - cw); strcpy(wspace + (ppos - cw), nlst[j]); if (!last) { strcat(wspace, "-"); strcat(wspace, pos + 1); } ns = insert_sug(slst, wspace, ns); free(nlst[j]); } if (nlst != NULL) free(nlst); nodashsug = 0; } if (!last) { *pos = '-'; ppos = pos + 1; pos = strchr(ppos, '-'); } if (!pos) pos = cw + strlen(cw); } } // word reversing wrapper for complex prefixes if (complexprefixes) { for (int j = 0; j < ns; j++) { if (utf8) reverseword_utf((*slst)[j]); else reverseword((*slst)[j]); } } // capitalize if (capwords) for (int j=0; j < ns; j++) { mkinitcap((*slst)[j]); } // expand suggestions with dot(s) if (abbv && pAMgr && pAMgr->get_sugswithdots()) { for (int j = 0; j < ns; j++) { (*slst)[j] = (char *) realloc((*slst)[j], strlen((*slst)[j]) + 1 + abbv); strcat((*slst)[j], word + strlen(word) - abbv); } } // remove bad capitalized and forbidden forms if (pAMgr && (pAMgr->get_keepcase() || pAMgr->get_forbiddenword())) { switch (captype) { case INITCAP: case ALLCAP: { int l = 0; for (int j=0; j < ns; j++) { if (!strchr((*slst)[j],' ') && !spell((*slst)[j])) { char s[MAXSWUTF8L]; w_char w[MAXSWL]; int len; if (utf8) { len = u8_u16(w, MAXSWL, (*slst)[j]); } else { strcpy(s, (*slst)[j]); len = strlen(s); } mkallsmall2(s, w, len); free((*slst)[j]); if (spell(s)) { (*slst)[l] = mystrdup(s); if ((*slst)[l]) l++; } else { mkinitcap2(s, w, len); if (spell(s)) { (*slst)[l] = mystrdup(s); if ((*slst)[l]) l++; } } } else { (*slst)[l] = (*slst)[j]; l++; } } ns = l; } } } // remove duplications int l = 0; for (int j = 0; j < ns; j++) { (*slst)[l] = (*slst)[j]; for (int k = 0; k < l; k++) { if (strcmp((*slst)[k], (*slst)[j]) == 0) { free((*slst)[j]); l--; } } l++; } // output conversion rl = (pAMgr) ? pAMgr->get_oconvtable() : NULL; for (int j = 0; rl && j < ns; j++) { if (rl->conv((*slst)[j], wspace)) { free((*slst)[j]); (*slst)[j] = mystrdup(wspace); } } // if suggestions removed by nosuggest, onlyincompound parameters if (l == 0 && *slst) { free(*slst); *slst = NULL; } return l; } void Hunspell::free_list(char *** slst, int n) { freelist(slst, n); } char * Hunspell::get_dic_encoding() { return encoding; } #ifdef HUNSPELL_EXPERIMENTAL // XXX need UTF-8 support int Hunspell::suggest_auto(char*** slst, const char * word) { char cw[MAXWORDUTF8LEN]; char wspace[MAXWORDUTF8LEN]; if (!pSMgr || maxdic == 0) return 0; int wl = strlen(word); if (utf8) { if (wl >= MAXWORDUTF8LEN) return 0; } else { if (wl >= MAXWORDLEN) return 0; } int captype = 0; int abbv = 0; wl = cleanword(cw, word, &captype, &abbv); if (wl == 0) return 0; int ns = 0; *slst = NULL; // HU, nsug in pSMgr->suggest switch(captype) { case NOCAP: { ns = pSMgr->suggest_auto(slst, cw, ns); if (ns>0) break; break; } case INITCAP: { memcpy(wspace,cw,(wl+1)); mkallsmall(wspace); ns = pSMgr->suggest_auto(slst, wspace, ns); for (int j=0; j < ns; j++) mkinitcap((*slst)[j]); ns = pSMgr->suggest_auto(slst, cw, ns); break; } case HUHINITCAP: case HUHCAP: { ns = pSMgr->suggest_auto(slst, cw, ns); if (ns == 0) { memcpy(wspace,cw,(wl+1)); mkallsmall(wspace); ns = pSMgr->suggest_auto(slst, wspace, ns); } break; } case ALLCAP: { memcpy(wspace,cw,(wl+1)); mkallsmall(wspace); ns = pSMgr->suggest_auto(slst, wspace, ns); mkinitcap(wspace); ns = pSMgr->suggest_auto(slst, wspace, ns); for (int j=0; j < ns; j++) mkallcap((*slst)[j]); break; } } // word reversing wrapper for complex prefixes if (complexprefixes) { for (int j = 0; j < ns; j++) { if (utf8) reverseword_utf((*slst)[j]); else reverseword((*slst)[j]); } } // expand suggestions with dot(s) if (abbv && pAMgr && pAMgr->get_sugswithdots()) { for (int j = 0; j < ns; j++) { (*slst)[j] = (char *) realloc((*slst)[j], strlen((*slst)[j]) + 1 + abbv); strcat((*slst)[j], word + strlen(word) - abbv); } } // LANG_hu section: replace '-' with ' ' in Hungarian if (langnum == LANG_hu) { for (int j=0; j < ns; j++) { char * pos = strchr((*slst)[j],'-'); if (pos) { int info; char w[MAXWORDUTF8LEN]; *pos = '\0'; strcpy(w, (*slst)[j]); strcat(w, pos + 1); spell(w, &info, NULL); if ((info & SPELL_COMPOUND) && (info & SPELL_FORBIDDEN)) { *pos = ' '; } else *pos = '-'; } } } // END OF LANG_hu section return ns; } #endif int Hunspell::stem(char*** slst, char ** desc, int n) { char result[MAXLNLEN]; char result2[MAXLNLEN]; *slst = NULL; if (n == 0) return 0; *result2 = '\0'; for (int i = 0; i < n; i++) { *result = '\0'; // add compound word parts (except the last one) char * s = (char *) desc[i]; char * part = strstr(s, MORPH_PART); if (part) { char * nextpart = strstr(part + 1, MORPH_PART); while (nextpart) { copy_field(result + strlen(result), part, MORPH_PART); part = nextpart; nextpart = strstr(part + 1, MORPH_PART); } s = part; } char **pl; char tok[MAXLNLEN]; strcpy(tok, s); char * alt = strstr(tok, " | "); while (alt) { alt[1] = MSEP_ALT; alt = strstr(alt, " | "); } int pln = line_tok(tok, &pl, MSEP_ALT); for (int k = 0; k < pln; k++) { // add derivational suffixes if (strstr(pl[k], MORPH_DERI_SFX)) { // remove inflectional suffixes char * is = strstr(pl[k], MORPH_INFL_SFX); if (is) *is = '\0'; char * sg = pSMgr->suggest_gen(&(pl[k]), 1, pl[k]); if (sg) { char ** gen; int genl = line_tok(sg, &gen, MSEP_REC); free(sg); for (int j = 0; j < genl; j++) { sprintf(result2 + strlen(result2), "%c%s%s", MSEP_REC, result, gen[j]); } freelist(&gen, genl); } } else { sprintf(result2 + strlen(result2), "%c%s", MSEP_REC, result); if (strstr(pl[k], MORPH_SURF_PFX)) { copy_field(result2 + strlen(result2), pl[k], MORPH_SURF_PFX); } copy_field(result2 + strlen(result2), pl[k], MORPH_STEM); } } freelist(&pl, pln); } int sln = line_tok(result2, slst, MSEP_REC); return uniqlist(*slst, sln); } int Hunspell::stem(char*** slst, const char * word) { char ** pl; int pln = analyze(&pl, word); int pln2 = stem(slst, pl, pln); freelist(&pl, pln); return pln2; } #ifdef HUNSPELL_EXPERIMENTAL int Hunspell::suggest_pos_stems(char*** slst, const char * word) { char cw[MAXWORDUTF8LEN]; char wspace[MAXWORDUTF8LEN]; if (! pSMgr || maxdic == 0) return 0; int wl = strlen(word); if (utf8) { if (wl >= MAXWORDUTF8LEN) return 0; } else { if (wl >= MAXWORDLEN) return 0; } int captype = 0; int abbv = 0; wl = cleanword(cw, word, &captype, &abbv); if (wl == 0) return 0; int ns = 0; // ns=0 = normalized input *slst = NULL; // HU, nsug in pSMgr->suggest switch(captype) { case HUHCAP: case NOCAP: { ns = pSMgr->suggest_pos_stems(slst, cw, ns); if ((abbv) && (ns == 0)) { memcpy(wspace,cw,wl); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; ns = pSMgr->suggest_pos_stems(slst, wspace, ns); } break; } case INITCAP: { ns = pSMgr->suggest_pos_stems(slst, cw, ns); if (ns == 0 || ((*slst)[0][0] == '#')) { memcpy(wspace,cw,(wl+1)); mkallsmall(wspace); ns = pSMgr->suggest_pos_stems(slst, wspace, ns); } break; } case ALLCAP: { ns = pSMgr->suggest_pos_stems(slst, cw, ns); if (ns != 0) break; memcpy(wspace,cw,(wl+1)); mkallsmall(wspace); ns = pSMgr->suggest_pos_stems(slst, wspace, ns); if (ns == 0) { mkinitcap(wspace); ns = pSMgr->suggest_pos_stems(slst, wspace, ns); } break; } } return ns; } #endif // END OF HUNSPELL_EXPERIMENTAL CODE const char * Hunspell::get_wordchars() { return pAMgr->get_wordchars(); } unsigned short * Hunspell::get_wordchars_utf16(int * len) { return pAMgr->get_wordchars_utf16(len); } void Hunspell::mkinitcap(char * p) { if (!utf8) { if (*p != '\0') *p = csconv[((unsigned char)*p)].cupper; } else { int len; w_char u[MAXWORDLEN]; len = u8_u16(u, MAXWORDLEN, p); unsigned short i = unicodetoupper((u[0].h << 8) + u[0].l, langnum); u[0].h = (unsigned char) (i >> 8); u[0].l = (unsigned char) (i & 0x00FF); u16_u8(p, MAXWORDUTF8LEN, u, len); } } int Hunspell::mkinitcap2(char * p, w_char * u, int nc) { if (!utf8) { if (*p != '\0') *p = csconv[((unsigned char)*p)].cupper; } else if (nc > 0) { unsigned short i = unicodetoupper((u[0].h << 8) + u[0].l, langnum); u[0].h = (unsigned char) (i >> 8); u[0].l = (unsigned char) (i & 0x00FF); u16_u8(p, MAXWORDUTF8LEN, u, nc); return strlen(p); } return nc; } int Hunspell::mkinitsmall2(char * p, w_char * u, int nc) { if (!utf8) { if (*p != '\0') *p = csconv[((unsigned char)*p)].clower; } else if (nc > 0) { unsigned short i = unicodetolower((u[0].h << 8) + u[0].l, langnum); u[0].h = (unsigned char) (i >> 8); u[0].l = (unsigned char) (i & 0x00FF); u16_u8(p, MAXWORDUTF8LEN, u, nc); return strlen(p); } return nc; } int Hunspell::add(const char * word) { if (pHMgr[0]) return (pHMgr[0])->add(word); return 0; } int Hunspell::add_with_affix(const char * word, const char * example) { if (pHMgr[0]) return (pHMgr[0])->add_with_affix(word, example); return 0; } int Hunspell::remove(const char * word) { if (pHMgr[0]) return (pHMgr[0])->remove(word); return 0; } const char * Hunspell::get_version() { return pAMgr->get_version(); } struct cs_info * Hunspell::get_csconv() { return csconv; } void Hunspell::cat_result(char * result, char * st) { if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } } int Hunspell::analyze(char*** slst, const char * word) { char cw[MAXWORDUTF8LEN]; char wspace[MAXWORDUTF8LEN]; w_char unicw[MAXWORDLEN]; int wl2 = 0; *slst = NULL; if (! pSMgr || maxdic == 0) return 0; int nc = strlen(word); if (utf8) { if (nc >= MAXWORDUTF8LEN) return 0; } else { if (nc >= MAXWORDLEN) return 0; } int captype = 0; int abbv = 0; int wl = 0; // input conversion RepList * rl = (pAMgr) ? pAMgr->get_iconvtable() : NULL; if (rl && rl->conv(word, wspace)) wl = cleanword2(cw, wspace, unicw, &nc, &captype, &abbv); else wl = cleanword2(cw, word, unicw, &nc, &captype, &abbv); if (wl == 0) { if (abbv) { for (wl = 0; wl < abbv; wl++) cw[wl] = '.'; cw[wl] = '\0'; abbv = 0; } else return 0; } char result[MAXLNLEN]; char * st = NULL; *result = '\0'; int n = 0; int n2 = 0; int n3 = 0; // test numbers // LANG_hu section: set dash information for suggestions if (langnum == LANG_hu) { while ((n < wl) && (((cw[n] <= '9') && (cw[n] >= '0')) || (((cw[n] == '.') || (cw[n] == ',')) && (n > 0)))) { n++; if ((cw[n] == '.') || (cw[n] == ',')) { if (((n2 == 0) && (n > 3)) || ((n2 > 0) && ((cw[n-1] == '.') || (cw[n-1] == ',')))) break; n2++; n3 = n; } } if ((n == wl) && (n3 > 0) && (n - n3 > 3)) return 0; if ((n == wl) || ((n>0) && ((cw[n]=='%') || (cw[n]=='\xB0')) && checkword(cw+n, NULL, NULL))) { mystrcat(result, cw, MAXLNLEN); result[n - 1] = '\0'; if (n == wl) cat_result(result, pSMgr->suggest_morph(cw + n - 1)); else { char sign = cw[n]; cw[n] = '\0'; cat_result(result, pSMgr->suggest_morph(cw + n - 1)); mystrcat(result, "+", MAXLNLEN); // XXX SPEC. MORPHCODE cw[n] = sign; cat_result(result, pSMgr->suggest_morph(cw + n)); } return line_tok(result, slst, MSEP_REC); } } // END OF LANG_hu section switch(captype) { case HUHCAP: case HUHINITCAP: case NOCAP: { cat_result(result, pSMgr->suggest_morph(cw)); if (abbv) { memcpy(wspace,cw,wl); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; cat_result(result, pSMgr->suggest_morph(wspace)); } break; } case INITCAP: { wl = mkallsmall2(cw, unicw, nc); memcpy(wspace,cw,(wl+1)); wl2 = mkinitcap2(cw, unicw, nc); cat_result(result, pSMgr->suggest_morph(wspace)); cat_result(result, pSMgr->suggest_morph(cw)); if (abbv) { *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; cat_result(result, pSMgr->suggest_morph(wspace)); memcpy(wspace, cw, wl2); *(wspace+wl2) = '.'; *(wspace+wl2+1) = '\0'; cat_result(result, pSMgr->suggest_morph(wspace)); } break; } case ALLCAP: { cat_result(result, pSMgr->suggest_morph(cw)); if (abbv) { memcpy(wspace,cw,wl); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; cat_result(result, pSMgr->suggest_morph(cw)); } wl = mkallsmall2(cw, unicw, nc); memcpy(wspace,cw,(wl+1)); wl2 = mkinitcap2(cw, unicw, nc); cat_result(result, pSMgr->suggest_morph(wspace)); cat_result(result, pSMgr->suggest_morph(cw)); if (abbv) { *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; cat_result(result, pSMgr->suggest_morph(wspace)); memcpy(wspace, cw, wl2); *(wspace+wl2) = '.'; *(wspace+wl2+1) = '\0'; cat_result(result, pSMgr->suggest_morph(wspace)); } break; } } if (*result) { // word reversing wrapper for complex prefixes if (complexprefixes) { if (utf8) reverseword_utf(result); else reverseword(result); } return line_tok(result, slst, MSEP_REC); } // compound word with dash (HU) I18n char * dash = NULL; int nresult = 0; // LANG_hu section: set dash information for suggestions if (langnum == LANG_hu) dash = (char *) strchr(cw,'-'); if ((langnum == LANG_hu) && dash) { *dash='\0'; // examine 2 sides of the dash if (dash[1] == '\0') { // base word ending with dash if (spell(cw)) { char * p = pSMgr->suggest_morph(cw); if (p) return line_tok(pSMgr->suggest_morph(cw), slst, MSEP_REC); } } else if ((dash[1] == 'e') && (dash[2] == '\0')) { // XXX (HU) -e hat. if (spell(cw) && (spell("-e"))) { st = pSMgr->suggest_morph(cw); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } mystrcat(result,"+", MAXLNLEN); // XXX spec. separator in MORPHCODE st = pSMgr->suggest_morph("-e"); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } return line_tok(result, slst, MSEP_REC); } } else { // first word ending with dash: word- XXX ??? char r2 = *(dash + 1); dash[0]='-'; dash[1]='\0'; nresult = spell(cw); dash[1] = r2; dash[0]='\0'; if (nresult && spell(dash+1) && ((strlen(dash+1) > 1) || ((dash[1] > '0') && (dash[1] < '9')))) { st = pSMgr->suggest_morph(cw); if (st) { mystrcat(result, st, MAXLNLEN); free(st); mystrcat(result,"+", MAXLNLEN); // XXX spec. separator in MORPHCODE } st = pSMgr->suggest_morph(dash+1); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } return line_tok(result, slst, MSEP_REC); } } // affixed number in correct word if (nresult && (dash > cw) && (((*(dash-1)<='9') && (*(dash-1)>='0')) || (*(dash-1)=='.'))) { *dash='-'; n = 1; if (*(dash - n) == '.') n++; // search first not a number character to left from dash while (((dash - n)>=cw) && ((*(dash - n)=='0') || (n < 3)) && (n < 6)) { n++; } if ((dash - n) < cw) n--; // numbers: valami1000000-hoz // examine 100000-hoz, 10000-hoz 1000-hoz, 10-hoz, // 56-hoz, 6-hoz for(; n >= 1; n--) { if ((*(dash - n) >= '0') && (*(dash - n) <= '9') && checkword(dash - n, NULL, NULL)) { mystrcat(result, cw, MAXLNLEN); result[dash - cw - n] = '\0'; st = pSMgr->suggest_morph(dash - n); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } return line_tok(result, slst, MSEP_REC); } } } } return 0; } int Hunspell::generate(char*** slst, const char * word, char ** pl, int pln) { *slst = NULL; if (!pSMgr || !pln) return 0; char **pl2; int pl2n = analyze(&pl2, word); int captype = 0; int abbv = 0; char cw[MAXWORDUTF8LEN]; cleanword(cw, word, &captype, &abbv); char result[MAXLNLEN]; *result = '\0'; for (int i = 0; i < pln; i++) { cat_result(result, pSMgr->suggest_gen(pl2, pl2n, pl[i])); } freelist(&pl2, pl2n); if (*result) { // allcap if (captype == ALLCAP) mkallcap(result); // line split int linenum = line_tok(result, slst, MSEP_REC); // capitalize if (captype == INITCAP || captype == HUHINITCAP) { for (int j=0; j < linenum; j++) mkinitcap((*slst)[j]); } // temporary filtering of prefix related errors (eg. // generate("undrinkable", "eats") --> "undrinkables" and "*undrinks") int r = 0; for (int j=0; j < linenum; j++) { if (!spell((*slst)[j])) { free((*slst)[j]); (*slst)[j] = NULL; } else { if (r < j) (*slst)[r] = (*slst)[j]; r++; } } if (r > 0) return r; free(*slst); *slst = NULL; } return 0; } int Hunspell::generate(char*** slst, const char * word, const char * pattern) { char **pl; int pln = analyze(&pl, pattern); int n = generate(slst, word, pl, pln); freelist(&pl, pln); return uniqlist(*slst, n); } // minimal XML parser functions int Hunspell::get_xml_par(char * dest, const char * par, int max) { char * d = dest; if (!par) return 0; char end = *par; char * dmax = dest + max; if (end == '>') end = '<'; else if (end != '\'' && end != '"') return 0; // bad XML for (par++; d < dmax && *par != '\0' && *par != end; par++, d++) *d = *par; *d = '\0'; mystrrep(dest, "<", "<"); mystrrep(dest, "&", "&"); return (int)(d - dest); } int Hunspell::get_langnum() const { return langnum; } // return the beginning of the element (attr == NULL) or the attribute const char * Hunspell::get_xml_pos(const char * s, const char * attr) { const char * end = strchr(s, '>'); const char * p = s; if (attr == NULL) return end; do { p = strstr(p, attr); if (!p || p >= end) return 0; } while (*(p-1) != ' ' && *(p-1) != '\n'); return p + strlen(attr); } int Hunspell::check_xml_par(const char * q, const char * attr, const char * value) { char cw[MAXWORDUTF8LEN]; if (get_xml_par(cw, get_xml_pos(q, attr), MAXWORDUTF8LEN - 1) && strcmp(cw, value) == 0) return 1; return 0; } int Hunspell::get_xml_list(char ***slst, char * list, const char * tag) { int n = 0; char * p; if (!list) return 0; for (p = list; (p = strstr(p, tag)); p++) n++; if (n == 0) return 0; *slst = (char **) malloc(sizeof(char *) * n); if (!*slst) return 0; for (p = list, n = 0; (p = strstr(p, tag)); p++, n++) { int l = strlen(p); (*slst)[n] = (char *) malloc(l + 1); if (!(*slst)[n]) return (n > 0 ? n - 1 : 0); if (!get_xml_par((*slst)[n], p + strlen(tag) - 1, l)) { free((*slst)[n]); break; } } return n; } int Hunspell::spellml(char*** slst, const char * word) { char *q, *q2; char cw[MAXWORDUTF8LEN], cw2[MAXWORDUTF8LEN]; q = (char *) strstr(word, "'); if (!q2) return 0; // bad XML input q2 = strstr(q2, "'), MAXWORDUTF8LEN - 10)) n = analyze(slst, cw); if (n == 0) return 0; // convert the result to ana1ana2 format for (int i = 0; i < n; i++) s+= strlen((*slst)[i]); char * r = (char *) malloc(6 + 5 * s + 7 * n + 7 + 1); // XXX 5*s->&->& if (!r) return 0; strcpy(r, ""); for (int i = 0; i < n; i++) { int l = strlen(r); strcpy(r + l, ""); strcpy(r + l + 3, (*slst)[i]); mystrrep(r + l + 3, "\t", " "); mystrrep(r + l + 3, "<", "<"); mystrrep(r + l + 3, "&", "&"); strcat(r, ""); free((*slst)[i]); } strcat(r, ""); (*slst)[0] = r; return 1; } else if (check_xml_par(q, "type=", "stem")) { if (get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN - 1)) return stem(slst, cw); } else if (check_xml_par(q, "type=", "generate")) { int n = get_xml_par(cw, strchr(q2, '>'), MAXWORDUTF8LEN - 1); if (n == 0) return 0; char * q3 = strstr(q2 + 1, "'), MAXWORDUTF8LEN - 1)) { return generate(slst, cw, cw2); } } else { char ** slst2; if ((q2 = strstr(q2 + 1, "'), ""))) { int n2 = generate(slst, cw, slst2, n); freelist(&slst2, n); return uniqlist(*slst, n2); } } } return 0; } #ifdef HUNSPELL_EXPERIMENTAL // XXX need UTF-8 support char * Hunspell::morph_with_correction(const char * word) { char cw[MAXWORDUTF8LEN]; char wspace[MAXWORDUTF8LEN]; if (! pSMgr || maxdic == 0) return NULL; int wl = strlen(word); if (utf8) { if (wl >= MAXWORDUTF8LEN) return NULL; } else { if (wl >= MAXWORDLEN) return NULL; } int captype = 0; int abbv = 0; wl = cleanword(cw, word, &captype, &abbv); if (wl == 0) return NULL; char result[MAXLNLEN]; char * st = NULL; *result = '\0'; switch(captype) { case NOCAP: { st = pSMgr->suggest_morph_for_spelling_error(cw); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } if (abbv) { memcpy(wspace,cw,wl); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } } break; } case INITCAP: { memcpy(wspace,cw,(wl+1)); mkallsmall(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } st = pSMgr->suggest_morph_for_spelling_error(cw); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } if (abbv) { memcpy(wspace,cw,wl); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; mkallsmall(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } mkinitcap(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } } break; } case HUHCAP: { st = pSMgr->suggest_morph_for_spelling_error(cw); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } memcpy(wspace,cw,(wl+1)); mkallsmall(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } break; } case ALLCAP: { memcpy(wspace,cw,(wl+1)); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } mkallsmall(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } mkinitcap(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } if (abbv) { memcpy(wspace,cw,(wl+1)); *(wspace+wl) = '.'; *(wspace+wl+1) = '\0'; if (*result) mystrcat(result, "\n", MAXLNLEN); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } mkallsmall(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } mkinitcap(wspace); st = pSMgr->suggest_morph_for_spelling_error(wspace); if (st) { if (*result) mystrcat(result, "\n", MAXLNLEN); mystrcat(result, st, MAXLNLEN); free(st); } } break; } } if (*result) return mystrdup(result); return NULL; } #endif // END OF HUNSPELL_EXPERIMENTAL CODE Hunhandle *Hunspell_create(const char * affpath, const char * dpath) { return (Hunhandle*)(new Hunspell(affpath, dpath)); } Hunhandle *Hunspell_create_key(const char * affpath, const char * dpath, const char * key) { return (Hunhandle*)(new Hunspell(affpath, dpath, key)); } void Hunspell_destroy(Hunhandle *pHunspell) { delete (Hunspell*)(pHunspell); } int Hunspell_spell(Hunhandle *pHunspell, const char *word) { return ((Hunspell*)pHunspell)->spell(word); } char *Hunspell_get_dic_encoding(Hunhandle *pHunspell) { return ((Hunspell*)pHunspell)->get_dic_encoding(); } int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word) { return ((Hunspell*)pHunspell)->suggest(slst, word); } int Hunspell_analyze(Hunhandle *pHunspell, char*** slst, const char * word) { return ((Hunspell*)pHunspell)->analyze(slst, word); } int Hunspell_stem(Hunhandle *pHunspell, char*** slst, const char * word) { return ((Hunspell*)pHunspell)->stem(slst, word); } int Hunspell_stem2(Hunhandle *pHunspell, char*** slst, char** desc, int n) { return ((Hunspell*)pHunspell)->stem(slst, desc, n); } int Hunspell_generate(Hunhandle *pHunspell, char*** slst, const char * word, const char * word2) { return ((Hunspell*)pHunspell)->generate(slst, word, word2); } int Hunspell_generate2(Hunhandle *pHunspell, char*** slst, const char * word, char** desc, int n) { return ((Hunspell*)pHunspell)->generate(slst, word, desc, n); } /* functions for run-time modification of the dictionary */ /* add word to the run-time dictionary */ int Hunspell_add(Hunhandle *pHunspell, const char * word) { return ((Hunspell*)pHunspell)->add(word); } /* add word to the run-time dictionary with affix flags of * the example (a dictionary word): Hunspell will recognize * affixed forms of the new word, too. */ int Hunspell_add_with_affix(Hunhandle *pHunspell, const char * word, const char * example) { return ((Hunspell*)pHunspell)->add_with_affix(word, example); } /* remove word from the run-time dictionary */ int Hunspell_remove(Hunhandle *pHunspell, const char * word) { return ((Hunspell*)pHunspell)->remove(word); } void Hunspell_free_list(Hunhandle *, char *** slst, int n) { freelist(slst, n); } qt-client-4.1.0/hunspell/hunspell.dsp000066400000000000000000000075471217451700100176230ustar00rootroot00000000000000# Microsoft Developer Studio Project File - Name="hunspell" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Static Library" 0x0104 CFG=hunspell - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "hunspell.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "hunspell.mak" CFG="hunspell - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "hunspell - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "hunspell - Win32 Debug" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "hunspell - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "W32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c # ADD BASE RSC /l 0x40e /d "NDEBUG" # ADD RSC /l 0x40e /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ELSEIF "$(CFG)" == "hunspell - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "W32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c # ADD BASE RSC /l 0x40e /d "_DEBUG" # ADD RSC /l 0x40e /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LIB32=link.exe -lib # ADD BASE LIB32 /nologo # ADD LIB32 /nologo !ENDIF # Begin Target # Name "hunspell - Win32 Release" # Name "hunspell - Win32 Debug" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File SOURCE=.\affentry.cxx # End Source File # Begin Source File SOURCE=.\affixmgr.cxx # End Source File # Begin Source File SOURCE=.\csutil.cxx # End Source File # Begin Source File SOURCE=.\dictmgr.cxx # End Source File # Begin Source File SOURCE=.\hashmgr.cxx # End Source File # Begin Source File SOURCE=.\hunspell.cxx # End Source File # Begin Source File SOURCE=.\suggestmgr.cxx # End Source File # End Group # Begin Group "Header Files" # PROP Default_Filter "h;hpp;hxx;hm;inl" # Begin Source File SOURCE=.\affentry.hxx # End Source File # Begin Source File SOURCE=.\affixmgr.hxx # End Source File # Begin Source File SOURCE=.\atypes.hxx # End Source File # Begin Source File SOURCE=.\baseaffix.hxx # End Source File # Begin Source File SOURCE=.\csutil.hxx # End Source File # Begin Source File SOURCE=.\dictmgr.hxx # End Source File # Begin Source File SOURCE=.\hashmgr.hxx # End Source File # Begin Source File SOURCE=.\htypes.hxx # End Source File # Begin Source File SOURCE=.\langnum.hxx # End Source File # Begin Source File SOURCE=.\hunspell.hxx # End Source File # Begin Source File SOURCE=.\suggestmgr.hxx # End Source File # End Group # End Target # End Project qt-client-4.1.0/hunspell/hunspell.h000066400000000000000000000062461217451700100172570ustar00rootroot00000000000000#ifndef _MYSPELLMGR_H_ #define _MYSPELLMGR_H_ #include "hunvisapi.h" #ifdef __cplusplus extern "C" { #endif typedef struct Hunhandle Hunhandle; LIBHUNSPELL_DLL_EXPORTED Hunhandle *Hunspell_create(const char * affpath, const char * dpath); LIBHUNSPELL_DLL_EXPORTED Hunhandle *Hunspell_create_key(const char * affpath, const char * dpath, const char * key); LIBHUNSPELL_DLL_EXPORTED void Hunspell_destroy(Hunhandle *pHunspell); /* spell(word) - spellcheck word * output: 0 = bad word, not 0 = good word */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_spell(Hunhandle *pHunspell, const char *); LIBHUNSPELL_DLL_EXPORTED char *Hunspell_get_dic_encoding(Hunhandle *pHunspell); /* suggest(suggestions, word) - search suggestions * input: pointer to an array of strings pointer and the (bad) word * array of strings pointer (here *slst) may not be initialized * output: number of suggestions in string array, and suggestions in * a newly allocated array of strings (*slts will be NULL when number * of suggestion equals 0.) */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_suggest(Hunhandle *pHunspell, char*** slst, const char * word); /* morphological functions */ /* analyze(result, word) - morphological analysis of the word */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_analyze(Hunhandle *pHunspell, char*** slst, const char * word); /* stem(result, word) - stemmer function */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_stem(Hunhandle *pHunspell, char*** slst, const char * word); /* stem(result, analysis, n) - get stems from a morph. analysis * example: * char ** result, result2; * int n1 = Hunspell_analyze(result, "words"); * int n2 = Hunspell_stem2(result2, result, n1); */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_stem2(Hunhandle *pHunspell, char*** slst, char** desc, int n); /* generate(result, word, word2) - morphological generation by example(s) */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_generate(Hunhandle *pHunspell, char*** slst, const char * word, const char * word2); /* generate(result, word, desc, n) - generation by morph. description(s) * example: * char ** result; * char * affix = "is:plural"; // description depends from dictionaries, too * int n = Hunspell_generate2(result, "word", &affix, 1); * for (int i = 0; i < n; i++) printf("%s\n", result[i]); */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_generate2(Hunhandle *pHunspell, char*** slst, const char * word, char** desc, int n); /* functions for run-time modification of the dictionary */ /* add word to the run-time dictionary */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_add(Hunhandle *pHunspell, const char * word); /* add word to the run-time dictionary with affix flags of * the example (a dictionary word): Hunspell will recognize * affixed forms of the new word, too. */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_add_with_affix(Hunhandle *pHunspell, const char * word, const char * example); /* remove word from the run-time dictionary */ LIBHUNSPELL_DLL_EXPORTED int Hunspell_remove(Hunhandle *pHunspell, const char * word); /* free suggestion lists */ LIBHUNSPELL_DLL_EXPORTED void Hunspell_free_list(Hunhandle *pHunspell, char *** slst, int n); #ifdef __cplusplus } #endif #endif qt-client-4.1.0/hunspell/hunspell.hxx000066400000000000000000000124511217451700100176320ustar00rootroot00000000000000#include "hunvisapi.h" #include "hashmgr.hxx" #include "affixmgr.hxx" #include "suggestmgr.hxx" #include "langnum.hxx" #define SPELL_COMPOUND (1 << 0) #define SPELL_FORBIDDEN (1 << 1) #define SPELL_ALLCAP (1 << 2) #define SPELL_NOCAP (1 << 3) #define SPELL_INITCAP (1 << 4) #define SPELL_XML "" #define MAXDIC 20 #define MAXSUGGESTION 15 #define MAXSHARPS 5 #ifndef _MYSPELLMGR_HXX_ #define _MYSPELLMGR_HXX_ class LIBHUNSPELL_DLL_EXPORTED Hunspell { AffixMgr* pAMgr; HashMgr* pHMgr[MAXDIC]; int maxdic; SuggestMgr* pSMgr; char * affixpath; char * encoding; struct cs_info * csconv; int langnum; int utf8; int complexprefixes; char** wordbreak; public: /* Hunspell(aff, dic) - constructor of Hunspell class * input: path of affix file and dictionary file */ Hunspell(const char * affpath, const char * dpath, const char * key = NULL); ~Hunspell(); /* load extra dictionaries (only dic files) */ int add_dic(const char * dpath, const char * key = NULL); /* spell(word) - spellcheck word * output: 0 = bad word, not 0 = good word * * plus output: * info: information bit array, fields: * SPELL_COMPOUND = a compound word * SPELL_FORBIDDEN = an explicit forbidden word * root: root (stem), when input is a word with affix(es) */ int spell(const char * word, int * info = NULL, char ** root = NULL); /* suggest(suggestions, word) - search suggestions * input: pointer to an array of strings pointer and the (bad) word * array of strings pointer (here *slst) may not be initialized * output: number of suggestions in string array, and suggestions in * a newly allocated array of strings (*slts will be NULL when number * of suggestion equals 0.) */ int suggest(char*** slst, const char * word); /* deallocate suggestion lists */ void free_list(char *** slst, int n); char * get_dic_encoding(); /* morphological functions */ /* analyze(result, word) - morphological analysis of the word */ int analyze(char*** slst, const char * word); /* stem(result, word) - stemmer function */ int stem(char*** slst, const char * word); /* stem(result, analysis, n) - get stems from a morph. analysis * example: * char ** result, result2; * int n1 = analyze(&result, "words"); * int n2 = stem(&result2, result, n1); */ int stem(char*** slst, char ** morph, int n); /* generate(result, word, word2) - morphological generation by example(s) */ int generate(char*** slst, const char * word, const char * word2); /* generate(result, word, desc, n) - generation by morph. description(s) * example: * char ** result; * char * affix = "is:plural"; // description depends from dictionaries, too * int n = generate(&result, "word", &affix, 1); * for (int i = 0; i < n; i++) printf("%s\n", result[i]); */ int generate(char*** slst, const char * word, char ** desc, int n); /* functions for run-time modification of the dictionary */ /* add word to the run-time dictionary */ int add(const char * word); /* add word to the run-time dictionary with affix flags of * the example (a dictionary word): Hunspell will recognize * affixed forms of the new word, too. */ int add_with_affix(const char * word, const char * example); /* remove word from the run-time dictionary */ int remove(const char * word); /* other */ /* get extra word characters definied in affix file for tokenization */ const char * get_wordchars(); unsigned short * get_wordchars_utf16(int * len); struct cs_info * get_csconv(); const char * get_version(); int get_langnum() const; /* experimental and deprecated functions */ #ifdef HUNSPELL_EXPERIMENTAL /* suffix is an affix flag string, similarly in dictionary files */ int put_word_suffix(const char * word, const char * suffix); char * morph_with_correction(const char * word); /* spec. suggestions */ int suggest_auto(char*** slst, const char * word); int suggest_pos_stems(char*** slst, const char * word); #endif private: int cleanword(char *, const char *, int * pcaptype, int * pabbrev); int cleanword2(char *, const char *, w_char *, int * w_len, int * pcaptype, int * pabbrev); void mkinitcap(char *); int mkinitcap2(char * p, w_char * u, int nc); int mkinitsmall2(char * p, w_char * u, int nc); void mkallcap(char *); int mkallcap2(char * p, w_char * u, int nc); void mkallsmall(char *); int mkallsmall2(char * p, w_char * u, int nc); struct hentry * checkword(const char *, int * info, char **root); char * sharps_u8_l1(char * dest, char * source); hentry * spellsharps(char * base, char *, int, int, char * tmp, int * info, char **root); int is_keepcase(const hentry * rv); int insert_sug(char ***slst, char * word, int ns); void cat_result(char * result, char * st); char * stem_description(const char * desc); int spellml(char*** slst, const char * word); int get_xml_par(char * dest, const char * par, int maxl); const char * get_xml_pos(const char * s, const char * attr); int get_xml_list(char ***slst, char * list, const char * tag); int check_xml_par(const char * q, const char * attr, const char * value); }; #endif qt-client-4.1.0/hunspell/hunvisapi.h000066400000000000000000000007521217451700100174270ustar00rootroot00000000000000#ifndef _HUNSPELL_VISIBILITY_H_ #define _HUNSPELL_VISIBILITY_H_ #if defined(HUNSPELL_STATIC) # define LIBHUNSPELL_DLL_EXPORTED #elif defined(_MSC_VER) # if defined(BUILDING_LIBHUNSPELL) # define LIBHUNSPELL_DLL_EXPORTED __declspec(dllexport) # else # define LIBHUNSPELL_DLL_EXPORTED __declspec(dllimport) # endif #elif BUILDING_LIBHUNSPELL && 1 # define LIBHUNSPELL_DLL_EXPORTED __attribute__((__visibility__("default"))) #else # define LIBHUNSPELL_DLL_EXPORTED #endif #endif qt-client-4.1.0/hunspell/hunvisapi.h.in000066400000000000000000000007721217451700100200360ustar00rootroot00000000000000#ifndef _HUNSPELL_VISIBILITY_H_ #define _HUNSPELL_VISIBILITY_H_ #if defined(HUNSPELL_STATIC) # define LIBHUNSPELL_DLL_EXPORTED #elif defined(_MSC_VER) # if defined(BUILDING_LIBHUNSPELL) # define LIBHUNSPELL_DLL_EXPORTED __declspec(dllexport) # else # define LIBHUNSPELL_DLL_EXPORTED __declspec(dllimport) # endif #elif BUILDING_LIBHUNSPELL && @HAVE_VISIBILITY@ # define LIBHUNSPELL_DLL_EXPORTED __attribute__((__visibility__("default"))) #else # define LIBHUNSPELL_DLL_EXPORTED #endif #endif qt-client-4.1.0/hunspell/hunzip.cxx000066400000000000000000000126411217451700100173110ustar00rootroot00000000000000#include #include #include #include "hunzip.hxx" #define CODELEN 65536 #define BASEBITREC 5000 #define UNCOMPRESSED '\002' #define MAGIC "hz0" #define MAGIC_ENCRYPT "hz1" #define MAGICLEN (sizeof(MAGIC) - 1) int Hunzip::fail(const char * err, const char * par) { fprintf(stderr, err, par); return -1; } Hunzip::Hunzip(const char * file, const char * key) { bufsiz = 0; lastbit = 0; inc = 0; outc = 0; dec = NULL; fin = NULL; filename = (char *) malloc(strlen(file) + 1); if (filename) strcpy(filename, file); if (getcode(key) == -1) bufsiz = -1; else bufsiz = getbuf(); } int Hunzip::getcode(const char * key) { unsigned char c[2]; int i, j, n, p; int allocatedbit = BASEBITREC; const char * enc = key; if (!filename) return -1; fin = fopen(filename, "rb"); if (!fin) return -1; // read magic number if ((fread(in, 1, 3, fin) < MAGICLEN) || !(strncmp(MAGIC, in, MAGICLEN) == 0 || strncmp(MAGIC_ENCRYPT, in, MAGICLEN) == 0)) { return fail(MSG_FORMAT, filename); } // check encryption if (strncmp(MAGIC_ENCRYPT, in, MAGICLEN) == 0) { unsigned char cs; if (!key) return fail(MSG_KEY, filename); if (fread(&c, 1, 1, fin) < 1) return fail(MSG_FORMAT, filename); for (cs = 0; *enc; enc++) cs ^= *enc; if (cs != c[0]) return fail(MSG_KEY, filename); enc = key; } else key = NULL; // read record count if (fread(&c, 1, 2, fin) < 2) return fail(MSG_FORMAT, filename); if (key) { c[0] ^= *enc; if (*(++enc) == '\0') enc = key; c[1] ^= *enc; } n = ((int) c[0] << 8) + c[1]; dec = (struct bit *) malloc(BASEBITREC * sizeof(struct bit)); if (!dec) return fail(MSG_MEMORY, filename); dec[0].v[0] = 0; dec[0].v[1] = 0; // read codes for (i = 0; i < n; i++) { unsigned char l; if (fread(c, 1, 2, fin) < 2) return fail(MSG_FORMAT, filename); if (key) { if (*(++enc) == '\0') enc = key; c[0] ^= *enc; if (*(++enc) == '\0') enc = key; c[1] ^= *enc; } if (fread(&l, 1, 1, fin) < 1) return fail(MSG_FORMAT, filename); if (key) { if (*(++enc) == '\0') enc = key; l ^= *enc; } if (fread(in, 1, l/8+1, fin) < (size_t) l/8+1) return fail(MSG_FORMAT, filename); if (key) for (j = 0; j <= l/8; j++) { if (*(++enc) == '\0') enc = key; in[j] ^= *enc; } p = 0; for (j = 0; j < l; j++) { int b = (in[j/8] & (1 << (7 - (j % 8)))) ? 1 : 0; int oldp = p; p = dec[p].v[b]; if (p == 0) { lastbit++; if (lastbit == allocatedbit) { allocatedbit += BASEBITREC; dec = (struct bit *) realloc(dec, allocatedbit * sizeof(struct bit)); } dec[lastbit].v[0] = 0; dec[lastbit].v[1] = 0; dec[oldp].v[b] = lastbit; p = lastbit; } } dec[p].c[0] = c[0]; dec[p].c[1] = c[1]; } return 0; } Hunzip::~Hunzip() { if (dec) free(dec); if (fin) fclose(fin); if (filename) free(filename); } int Hunzip::getbuf() { int p = 0; int o = 0; do { if (inc == 0) inbits = fread(in, 1, BUFSIZE, fin) * 8; for (; inc < inbits; inc++) { int b = (in[inc / 8] & (1 << (7 - (inc % 8)))) ? 1 : 0; int oldp = p; p = dec[p].v[b]; if (p == 0) { if (oldp == lastbit) { fclose(fin); fin = NULL; // add last odd byte if (dec[lastbit].c[0]) out[o++] = dec[lastbit].c[1]; return o; } out[o++] = dec[oldp].c[0]; out[o++] = dec[oldp].c[1]; if (o == BUFSIZE) return o; p = dec[p].v[b]; } } inc = 0; } while (inbits == BUFSIZE * 8); return fail(MSG_FORMAT, filename); } const char * Hunzip::getline() { char linebuf[BUFSIZE]; int l = 0, eol = 0, left = 0, right = 0; if (bufsiz == -1) return NULL; while (l < bufsiz && !eol) { linebuf[l++] = out[outc]; switch (out[outc]) { case '\t': break; case 31: { // escape if (++outc == bufsiz) { bufsiz = getbuf(); outc = 0; } linebuf[l - 1] = out[outc]; break; } case ' ': break; default: if (((unsigned char) out[outc]) < 47) { if (out[outc] > 32) { right = out[outc] - 31; if (++outc == bufsiz) { bufsiz = getbuf(); outc = 0; } } if (out[outc] == 30) left = 9; else left = out[outc]; linebuf[l-1] = '\n'; eol = 1; } } if (++outc == bufsiz) { outc = 0; bufsiz = fin ? getbuf(): -1; } } if (right) strcpy(linebuf + l - 1, line + strlen(line) - right - 1); else linebuf[l] = '\0'; strcpy(line + left, linebuf); return line; } qt-client-4.1.0/hunspell/hunzip.hxx000066400000000000000000000021211217451700100173060ustar00rootroot00000000000000/* hunzip: file decompression for sorted dictionaries with optional encryption, * algorithm: prefix-suffix encoding and 16-bit Huffman encoding */ #ifndef _HUNZIP_HXX_ #define _HUNZIP_HXX_ #include "hunvisapi.h" #include #define BUFSIZE 65536 #define HZIP_EXTENSION ".hz" #define MSG_OPEN "error: %s: cannot open\n" #define MSG_FORMAT "error: %s: not in hzip format\n" #define MSG_MEMORY "error: %s: missing memory\n" #define MSG_KEY "error: %s: missing or bad password\n" struct bit { unsigned char c[2]; int v[2]; }; class LIBHUNSPELL_DLL_EXPORTED Hunzip { protected: char * filename; FILE * fin; int bufsiz, lastbit, inc, inbits, outc; struct bit * dec; // code table char in[BUFSIZE]; // input buffer char out[BUFSIZE + 1]; // Huffman-decoded buffer char line[BUFSIZE + 50]; // decoded line int getcode(const char * key); int getbuf(); int fail(const char * err, const char * par); public: Hunzip(const char * filename, const char * key = NULL); ~Hunzip(); const char * getline(); }; #endif qt-client-4.1.0/hunspell/langnum.hxx000066400000000000000000000010201217451700100174270ustar00rootroot00000000000000#ifndef _LANGNUM_HXX_ #define _LANGNUM_HXX_ /* language numbers for language specific codes see http://l10n.openoffice.org/languages.html */ enum { LANG_ar=96, LANG_az=100, // custom number LANG_bg=41, LANG_ca=37, LANG_cs=42, LANG_da=45, LANG_de=49, LANG_el=30, LANG_en=01, LANG_es=34, LANG_eu=10, LANG_fr=02, LANG_gl=38, LANG_hr=78, LANG_hu=36, LANG_it=39, LANG_la=99, // custom number LANG_lv=101, // custom number LANG_nl=31, LANG_pl=48, LANG_pt=03, LANG_ru=07, LANG_sv=50, LANG_tr=90, LANG_uk=80, LANG_xx=999 }; #endif qt-client-4.1.0/hunspell/license.hunspell000066400000000000000000000041341217451700100204440ustar00rootroot00000000000000/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Hunspell, based on MySpell. * * The Initial Developers of the Original Code are * Kevin Hendricks (MySpell) and Laszlo Nemeth (Hunspell). * Portions created by the Initial Developers are Copyright (C) 2002-2005 * the Initial Developers. All Rights Reserved. * * Contributor(s): * David Einstein * Davide Prina * Giuseppe Modugno * Gianluca Turconi * Simon Brouwer * Noll Janos * Biro Arpad * Goldman Eleonora * Sarlos Tamas * Bencsath Boldizsar * Halacsy Peter * Dvornik Laszlo * Gefferth Andras * Nagy Viktor * Varga Daniel * Chris Halls * Rene Engelhard * Bram Moolenaar * Dafydd Jones * Harri Pitkanen * Andras Timar * Tor Lillqvist * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #include "config.h" qt-client-4.1.0/hunspell/license.myspell000066400000000000000000000055401217451700100203010ustar00rootroot00000000000000/* * Copyright 2002 Kevin B. Hendricks, Stratford, Ontario, Canada * And Contributors. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 3. All modifications to the source code must be clearly marked as * such. Binary redistributions based on modified source code * must be clearly marked as modified versions in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY KEVIN B. HENDRICKS AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * KEVIN B. HENDRICKS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * NOTE: A special thanks and credit goes to Geoff Kuenning * the creator of ispell. MySpell's affix algorithms were * based on those of ispell which should be noted is * copyright Geoff Kuenning et.al. and now available * under a BSD style license. For more information on ispell * and affix compression in general, please see: * http://www.cs.ucla.edu/ficus-members/geoff/ispell.html * (the home page for ispell) * * An almost complete rewrite of MySpell for use by * the Mozilla project has been developed by David Einstein * (Deinst@world.std.com). David and I are now * working on parallel development tracks to help * our respective projects (Mozilla and OpenOffice.org * and we will maintain full affix file and dictionary * file compatibility and work on merging our versions * of MySpell back into a single tree. David has been * a significant help in improving MySpell. * * Special thanks also go to La'szlo' Ne'meth * who is the author of the * Hungarian dictionary and who developed and contributed * the code to support compound words in MySpell * and fixed numerous problems with the encoding * case conversion tables. * */ qt-client-4.1.0/hunspell/makefile.mk000066400000000000000000000064651217451700100173650ustar00rootroot00000000000000#************************************************************************* # # $RCSfile: makefile.mk,v $ # # $Revision: 1.3 $ # # last change: $Author: caolan $ $Date: 2010/02/25 14:42:08 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses # # - GNU Lesser General Public License Version 2.1 # - Sun Industry Standards Source License Version 1.1 # # Sun Microsystems Inc., October, 2000 # # GNU Lesser General Public License Version 2.1 # ============================================= # Copyright 2000 by Sun Microsystems, Inc. # 901 San Antonio Road, Palo Alto, CA 94303, USA # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License version 2.1, as published by the Free Software Foundation. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # # # Sun Industry Standards Source License Version 1.1 # ================================================= # The contents of this file are subject to the Sun Industry Standards # Source License Version 1.1 (the "License"); You may not use this file # except in compliance with the License. You may obtain a copy of the # License at http://www.openoffice.org/license.html. # # Software provided under this License is provided on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, # WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, # MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. # See the License for the specific provisions governing your rights and # obligations concerning the Software. # # The Initial Developer of the Original Code is: Sun Microsystems, Inc. # # Copyright: 2000 by Sun Microsystems, Inc. # # All Rights Reserved. # # Contributor(s): _______________________________________ # # # #************************************************************************* PRJ = ../../../../../.. PRJNAME = hunspell TARGET = hunspell LIBTARGET=YES EXTERNAL_WARNINGS_NOT_ERRORS := TRUE UWINAPILIB= #----- Settings --------------------------------------------------------- .INCLUDE : settings.mk # --- Files -------------------------------------------------------- CFLAGS+=-I..$/..$/ CDEFS+=-DOPENOFFICEORG SLOFILES= \ $(SLO)$/affentry.obj \ $(SLO)$/affixmgr.obj \ $(SLO)$/dictmgr.obj \ $(SLO)$/csutil.obj \ $(SLO)$/hashmgr.obj \ $(SLO)$/suggestmgr.obj \ $(SLO)$/phonet.obj \ $(SLO)$/hunzip.obj \ $(SLO)$/filemgr.obj \ $(SLO)$/replist.obj \ $(SLO)$/hunspell.obj LIB1TARGET= $(SLB)$/lib$(TARGET).lib LIB1ARCHIV= $(LB)/lib$(TARGET).a LIB1OBJFILES= $(SLOFILES) # DIC2BIN= \ # en_US.aff \ # en_US.dic # # de_DE.aff \ # de_DE.dic # DICTIONARY : # +$(COPY) $(foreach,i,$(DIC2BIN) $i) $(BIN) # --- Targets ------------------------------------------------------ .INCLUDE : target.mk qt-client-4.1.0/hunspell/phonet.cxx000066400000000000000000000215531217451700100172730ustar00rootroot00000000000000/* phonetic.c - generic replacement aglogithms for phonetic transformation Copyright (C) 2000 Bjoern Jacke This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation; This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; If not, see . Changelog: 2000-01-05 Bjoern Jacke Initial Release insprired by the article about phonetic transformations out of c't 25/1999 2007-07-26 Bjoern Jacke Released under MPL/GPL/LGPL tri-license for Hunspell 2007-08-23 Laszlo Nemeth Porting from Aspell to Hunspell using C-like structs */ #include #include #include #include #include "csutil.hxx" #include "phonet.hxx" void init_phonet_hash(phonetable & parms) { int i, k; for (i = 0; i < HASHSIZE; i++) { parms.hash[i] = -1; } for (i = 0; parms.rules[i][0] != '\0'; i += 2) { /** set hash value **/ k = (unsigned char) parms.rules[i][0]; if (parms.hash[k] < 0) { parms.hash[k] = i; } } } // like strcpy but safe if the strings overlap // but only if dest < src static inline void strmove(char * dest, char * src) { while (*src) *dest++ = *src++; *dest = '\0'; } static int myisalpha(char ch) { if ((unsigned char) ch < 128) return isalpha(ch); return 1; } /* phonetic transcription algorithm */ /* see: http://aspell.net/man-html/Phonetic-Code.html */ /* convert string to uppercase before this call */ int phonet (const char * inword, char * target, int len, phonetable & parms) { /** Do phonetic transformation. **/ /** "len" = length of "inword" incl. '\0'. **/ /** result: >= 0: length of "target" **/ /** otherwise: error **/ int i,j,k=0,n,p,z; int k0,n0,p0=-333,z0; char c, c0; const char * s; typedef unsigned char uchar; char word[MAXPHONETUTF8LEN + 1]; if (len == -1) len = strlen(inword); if (len > MAXPHONETUTF8LEN) return 0; strcpy(word, inword); /** check word **/ i = j = z = 0; while ((c = word[i]) != '\0') { n = parms.hash[(uchar) c]; z0 = 0; if (n >= 0) { /** check all rules for the same letter **/ while (parms.rules[n][0] == c) { /** check whole string **/ k = 1; /** number of found letters **/ p = 5; /** default priority **/ s = parms.rules[n]; s++; /** important for (see below) "*(s-1)" **/ while (*s != '\0' && word[i+k] == *s && !isdigit ((unsigned char) *s) && strchr ("(-<^$", *s) == NULL) { k++; s++; } if (*s == '(') { /** check letters in "(..)" **/ if (myisalpha(word[i+k]) // ...could be implied? && strchr(s+1, word[i+k]) != NULL) { k++; while (*s != ')') s++; s++; } } p0 = (int) *s; k0 = k; while (*s == '-' && k > 1) { k--; s++; } if (*s == '<') s++; if (isdigit ((unsigned char) *s)) { /** determine priority **/ p = *s - '0'; s++; } if (*s == '^' && *(s+1) == '^') s++; if (*s == '\0' || (*s == '^' && (i == 0 || ! myisalpha(word[i-1])) && (*(s+1) != '$' || (! myisalpha(word[i+k0]) ))) || (*s == '$' && i > 0 && myisalpha(word[i-1]) && (! myisalpha(word[i+k0]) ))) { /** search for followup rules, if: **/ /** parms.followup and k > 1 and NO '-' in searchstring **/ c0 = word[i+k-1]; n0 = parms.hash[(uchar) c0]; // if (parms.followup && k > 1 && n0 >= 0 if (k > 1 && n0 >= 0 && p0 != (int) '-' && word[i+k] != '\0') { /** test follow-up rule for "word[i+k]" **/ while (parms.rules[n0][0] == c0) { /** check whole string **/ k0 = k; p0 = 5; s = parms.rules[n0]; s++; while (*s != '\0' && word[i+k0] == *s && ! isdigit((unsigned char) *s) && strchr("(-<^$",*s) == NULL) { k0++; s++; } if (*s == '(') { /** check letters **/ if (myisalpha(word[i+k0]) && strchr (s+1, word[i+k0]) != NULL) { k0++; while (*s != ')' && *s != '\0') s++; if (*s == ')') s++; } } while (*s == '-') { /** "k0" gets NOT reduced **/ /** because "if (k0 == k)" **/ s++; } if (*s == '<') s++; if (isdigit ((unsigned char) *s)) { p0 = *s - '0'; s++; } if (*s == '\0' /** *s == '^' cuts **/ || (*s == '$' && ! myisalpha(word[i+k0]))) { if (k0 == k) { /** this is just a piece of the string **/ n0 += 2; continue; } if (p0 < p) { /** priority too low **/ n0 += 2; continue; } /** rule fits; stop search **/ break; } n0 += 2; } /** End of "while (parms.rules[n0][0] == c0)" **/ if (p0 >= p && parms.rules[n0][0] == c0) { n += 2; continue; } } /** end of follow-up stuff **/ /** replace string **/ s = parms.rules[n+1]; p0 = (parms.rules[n][0] != '\0' && strchr (parms.rules[n]+1,'<') != NULL) ? 1:0; if (p0 == 1 && z == 0) { /** rule with '<' is used **/ if (j > 0 && *s != '\0' && (target[j-1] == c || target[j-1] == *s)) { j--; } z0 = 1; z = 1; k0 = 0; while (*s != '\0' && word[i+k0] != '\0') { word[i+k0] = *s; k0++; s++; } if (k > k0) strmove (&word[0]+i+k0, &word[0]+i+k); /** new "actual letter" **/ c = word[i]; } else { /** no '<' rule used **/ i += k - 1; z = 0; while (*s != '\0' && *(s+1) != '\0' && j < len) { if (j == 0 || target[j-1] != *s) { target[j] = *s; j++; } s++; } /** new "actual letter" **/ c = *s; if (parms.rules[n][0] != '\0' && strstr (parms.rules[n]+1, "^^") != NULL) { if (c != '\0') { target[j] = c; j++; } strmove (&word[0], &word[0]+i+1); i = 0; z0 = 1; } } break; } /** end of follow-up stuff **/ n += 2; } /** end of while (parms.rules[n][0] == c) **/ } /** end of if (n >= 0) **/ if (z0 == 0) { // if (k && (assert(p0!=-333),!p0) && j < len && c != '\0' // && (!parms.collapse_result || j == 0 || target[j-1] != c)){ if (k && !p0 && j < len && c != '\0' && (1 || j == 0 || target[j-1] != c)){ /** condense only double letters **/ target[j] = c; ///printf("\n setting \n"); j++; } i++; z = 0; k=0; } } /** end of while ((c = word[i]) != '\0') **/ target[j] = '\0'; return (j); } /** end of function "phonet" **/ qt-client-4.1.0/hunspell/phonet.hxx000066400000000000000000000031201217451700100172660ustar00rootroot00000000000000/* phonetic.c - generic replacement aglogithms for phonetic transformation Copyright (C) 2000 Bjoern Jacke This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation; This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; If not, see . Changelog: 2000-01-05 Bjoern Jacke Initial Release insprired by the article about phonetic transformations out of c't 25/1999 2007-07-26 Bjoern Jacke Released under MPL/GPL/LGPL tri-license for Hunspell 2007-08-23 Laszlo Nemeth Porting from Aspell to Hunspell using C-like structs */ #ifndef __PHONETHXX__ #define __PHONETHXX__ #define HASHSIZE 256 #define MAXPHONETLEN 256 #define MAXPHONETUTF8LEN (MAXPHONETLEN * 4) #include "hunvisapi.h" struct phonetable { char utf8; cs_info * lang; int num; char * * rules; int hash[HASHSIZE]; }; LIBHUNSPELL_DLL_EXPORTED void init_phonet_hash(phonetable & parms); LIBHUNSPELL_DLL_EXPORTED int phonet (const char * inword, char * target, int len, phonetable & phone); #endif qt-client-4.1.0/hunspell/replist.cxx000066400000000000000000000044041217451700100174540ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include "replist.hxx" #include "csutil.hxx" RepList::RepList(int n) { dat = (replentry **) malloc(sizeof(replentry *) * n); if (dat == 0) size = 0; else size = n; pos = 0; } RepList::~RepList() { for (int i = 0; i < pos; i++) { free(dat[i]->pattern); free(dat[i]->pattern2); free(dat[i]); } free(dat); } int RepList::get_pos() { return pos; } replentry * RepList::item(int n) { return dat[n]; } int RepList::hsNear(const char * word) { int p1 = 0; int p2 = pos; while ((p2 - p1) > 1) { int m = (p1 + p2) / 2; // fprintf(stderr, "m: %d p1: %d p2: %d dat: %s\n", m, p1, p2, dat[m]->pattern); int c = strcmp(word, dat[m]->pattern); if (c <= 0) { if (c < 0) p2 = m; else p1 = p2 = m; } else p1 = m; } // fprintf(stderr, "hsNear: %s (word: %s)\n", dat[p1]->pattern, word); return p1; } int RepList::match(const char * word, int n) { if (strncmp(word, dat[n]->pattern, strlen(dat[n]->pattern)) == 0) return strlen(dat[n]->pattern); return 0; } int RepList::add(char * pat1, char * pat2) { if (pos >= size || pat1 == NULL || pat2 == NULL) return 1; replentry * r = (replentry *) malloc(sizeof(replentry)); if (r == NULL) return 1; r->pattern = mystrrep(pat1, "_", " "); r->pattern2 = mystrrep(pat2, "_", " "); dat[pos++] = r; for (int i = pos - 1; i > 0; i--) { r = dat[i]; if (strcmp(r->pattern, dat[i - 1]->pattern) < 0) { dat[i] = dat[i - 1]; dat[i - 1] = r; } else break; } return 0; } int RepList::conv(const char * word, char * dest) { int stl = 0; int change = 0; // for (int i = 0; i < pos; i++) fprintf(stderr, "%d. %s\n", i, dat[i]->pattern); for (size_t i = 0; i < strlen(word); i++) { int n = hsNear(word + i); int l = match(word + i, n); if (l) { strcpy(dest + stl, dat[n]->pattern2); stl += strlen(dat[n]->pattern2); i += l - 1; change = 1; } else dest[stl++] = word[i]; } dest[stl] = '\0'; // fprintf(stderr, "i: %s o: %s change: %d\n", word, dest, change); return change; } qt-client-4.1.0/hunspell/replist.hxx000066400000000000000000000007561217451700100174670ustar00rootroot00000000000000/* string replacement list class */ #ifndef _REPLIST_HXX_ #define _REPLIST_HXX_ #include "hunvisapi.h" #include "w_char.hxx" class LIBHUNSPELL_DLL_EXPORTED RepList { protected: replentry ** dat; int size; int pos; public: RepList(int n); ~RepList(); int get_pos(); int add(char * pat1, char * pat2); replentry * item(int n); int hsNear(const char * word); int match(const char * word, int n); int conv(const char * word, char * dest); }; #endif qt-client-4.1.0/hunspell/suggestmgr.cxx000066400000000000000000001626071217451700100201730ustar00rootroot00000000000000#include "license.hunspell" #include "license.myspell" #include #include #include #include #include "suggestmgr.hxx" #include "htypes.hxx" #include "csutil.hxx" const w_char W_VLINE = { '\0', '|' }; SuggestMgr::SuggestMgr(const char * tryme, int maxn, AffixMgr * aptr) { // register affix manager and check in string of chars to // try when building candidate suggestions pAMgr = aptr; csconv = NULL; ckeyl = 0; ckey = NULL; ckey_utf = NULL; ctryl = 0; ctry = NULL; ctry_utf = NULL; utf8 = 0; langnum = 0; complexprefixes = 0; maxSug = maxn; nosplitsugs = 0; maxngramsugs = MAXNGRAMSUGS; if (pAMgr) { char * enc = pAMgr->get_encoding(); csconv = get_current_cs(enc); free(enc); langnum = pAMgr->get_langnum(); ckey = pAMgr->get_key_string(); nosplitsugs = pAMgr->get_nosplitsugs(); if (pAMgr->get_maxngramsugs() >= 0) maxngramsugs = pAMgr->get_maxngramsugs(); utf8 = pAMgr->get_utf8(); complexprefixes = pAMgr->get_complexprefixes(); } if (ckey) { if (utf8) { w_char t[MAXSWL]; ckeyl = u8_u16(t, MAXSWL, ckey); ckey_utf = (w_char *) malloc(ckeyl * sizeof(w_char)); if (ckey_utf) memcpy(ckey_utf, t, ckeyl * sizeof(w_char)); else ckeyl = 0; } else { ckeyl = strlen(ckey); } } if (tryme) { ctry = mystrdup(tryme); if (ctry) ctryl = strlen(ctry); if (ctry && utf8) { w_char t[MAXSWL]; ctryl = u8_u16(t, MAXSWL, tryme); ctry_utf = (w_char *) malloc(ctryl * sizeof(w_char)); if (ctry_utf) memcpy(ctry_utf, t, ctryl * sizeof(w_char)); else ctryl = 0; } } } SuggestMgr::~SuggestMgr() { pAMgr = NULL; if (ckey) free(ckey); ckey = NULL; if (ckey_utf) free(ckey_utf); ckey_utf = NULL; ckeyl = 0; if (ctry) free(ctry); ctry = NULL; if (ctry_utf) free(ctry_utf); ctry_utf = NULL; ctryl = 0; maxSug = 0; #ifdef MOZILLA_CLIENT delete [] csconv; #endif } int SuggestMgr::testsug(char** wlst, const char * candidate, int wl, int ns, int cpdsuggest, int * timer, clock_t * timelimit) { int cwrd = 1; if (ns == maxSug) return maxSug; for (int k=0; k < ns; k++) { if (strcmp(candidate,wlst[k]) == 0) cwrd = 0; } if ((cwrd) && checkword(candidate, wl, cpdsuggest, timer, timelimit)) { wlst[ns] = mystrdup(candidate); if (wlst[ns] == NULL) { for (int j=0; j HTML) if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? capchars_utf(wlst, word_utf, wl, nsug, cpdsuggest) : capchars(wlst, word, nsug, cpdsuggest); } // perhaps we made a typical fault of spelling if ((nsug < maxSug) && (nsug > -1)) nsug = replchars(wlst, word, nsug, cpdsuggest); // perhaps we made chose the wrong char from a related set if ((nsug < maxSug) && (nsug > -1)) { nsug = mapchars(wlst, word, nsug, cpdsuggest); } // did we swap the order of chars by mistake if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? swapchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : swapchar(wlst, word, nsug, cpdsuggest); } // did we swap the order of non adjacent chars by mistake if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? longswapchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : longswapchar(wlst, word, nsug, cpdsuggest); } // did we just hit the wrong key in place of a good char (case and keyboard) if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? badcharkey_utf(wlst, word_utf, wl, nsug, cpdsuggest) : badcharkey(wlst, word, nsug, cpdsuggest); } // only suggest compound words when no other suggestion if ((cpdsuggest == 0) && (nsug > 0)) nocompoundtwowords=1; // did we add a char that should not be there if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? extrachar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : extrachar(wlst, word, nsug, cpdsuggest); } // did we forgot a char if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? forgotchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : forgotchar(wlst, word, nsug, cpdsuggest); } // did we move a char if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? movechar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : movechar(wlst, word, nsug, cpdsuggest); } // did we just hit the wrong key in place of a good char if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? badchar_utf(wlst, word_utf, wl, nsug, cpdsuggest) : badchar(wlst, word, nsug, cpdsuggest); } // did we double two characters if ((nsug < maxSug) && (nsug > -1)) { nsug = (utf8) ? doubletwochars_utf(wlst, word_utf, wl, nsug, cpdsuggest) : doubletwochars(wlst, word, nsug, cpdsuggest); } // perhaps we forgot to hit space and two words ran together if ((!nosplitsugs) && (nsug < maxSug) && (nsug > -1)) { nsug = twowords(wlst, word, nsug, cpdsuggest); } } // repeating ``for'' statement compounding support if (nsug < 0) { // we ran out of memory - we should free up as much as possible for (int i = 0; i < maxSug; i++) if (wlst[i] != NULL) free(wlst[i]); free(wlst); wlst = NULL; } if (!nocompoundtwowords && (nsug > 0) && onlycompoundsug) *onlycompoundsug = 1; *slst = wlst; return nsug; } // generate suggestions for a word with typical mistake // pass in address of array of char * pointers #ifdef HUNSPELL_EXPERIMENTAL int SuggestMgr::suggest_auto(char*** slst, const char * w, int nsug) { int nocompoundtwowords = 0; char ** wlst; char w2[MAXWORDUTF8LEN]; const char * word = w; // word reversing wrapper for complex prefixes if (complexprefixes) { strcpy(w2, w); if (utf8) reverseword_utf(w2); else reverseword(w2); word = w2; } if (*slst) { wlst = *slst; } else { wlst = (char **) malloc(maxSug * sizeof(char *)); if (wlst == NULL) return -1; } for (int cpdsuggest=0; (cpdsuggest<2) && (nocompoundtwowords==0); cpdsuggest++) { // perhaps we made a typical fault of spelling if ((nsug < maxSug) && (nsug > -1)) nsug = replchars(wlst, word, nsug, cpdsuggest); // perhaps we made chose the wrong char from a related set if ((nsug < maxSug) && (nsug > -1)) nsug = mapchars(wlst, word, nsug, cpdsuggest); if ((cpdsuggest==0) && (nsug>0)) nocompoundtwowords=1; // perhaps we forgot to hit space and two words ran together if ((nsug < maxSug) && (nsug > -1) && check_forbidden(word, strlen(word))) { nsug = twowords(wlst, word, nsug, cpdsuggest); } } // repeating ``for'' statement compounding support if (nsug < 0) { for (int i=0;i HTML) int SuggestMgr::capchars_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; w_char candidate_utf[MAXSWL]; memcpy(candidate_utf, word, wl * sizeof(w_char)); mkallcap_utf(candidate_utf, wl, langnum); u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); return testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); } // suggestions for an uppercase word (html -> HTML) int SuggestMgr::capchars(char** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; strcpy(candidate, word); mkallcap(candidate, csconv); return testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); } // suggestions for when chose the wrong char out of a related set int SuggestMgr::mapchars(char** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; clock_t timelimit; int timer; candidate[0] = '\0'; int wl = strlen(word); if (wl < 2 || ! pAMgr) return ns; int nummap = pAMgr->get_nummap(); struct mapentry* maptable = pAMgr->get_maptable(); if (maptable==NULL) return ns; timelimit = clock(); timer = MINTIMER; return map_related(word, (char *) &candidate, 0, 0, wlst, cpdsuggest, ns, maptable, nummap, &timer, &timelimit); } int SuggestMgr::map_related(const char * word, char * candidate, int wn, int cn, char** wlst, int cpdsuggest, int ns, const mapentry* maptable, int nummap, int * timer, clock_t * timelimit) { if (*(word + wn) == '\0') { int cwrd = 1; *(candidate + cn) = '\0'; int wl = strlen(candidate); for (int m=0; m < ns; m++) if (strcmp(candidate, wlst[m]) == 0) cwrd = 0; if ((cwrd) && checkword(candidate, wl, cpdsuggest, timer, timelimit)) { if (ns < maxSug) { wlst[ns] = mystrdup(candidate); if (wlst[ns] == NULL) return -1; ns++; } } return ns; } int in_map = 0; for (int j = 0; j < nummap; j++) { for (int k = 0; k < maptable[j].len; k++) { int len = strlen(maptable[j].set[k]); if (strncmp(maptable[j].set[k], word + wn, len) == 0) { in_map = 1; for (int l = 0; l < maptable[j].len; l++) { strcpy(candidate + cn, maptable[j].set[l]); ns = map_related(word, candidate, wn + len, strlen(candidate), wlst, cpdsuggest, ns, maptable, nummap, timer, timelimit); if (!(*timer)) return ns; } } } } if (!in_map) { *(candidate + cn) = *(word + wn); ns = map_related(word, candidate, wn + 1, cn + 1, wlst, cpdsuggest, ns, maptable, nummap, timer, timelimit); } return ns; } // suggestions for a typical fault of spelling, that // differs with more, than 1 letter from the right form. int SuggestMgr::replchars(char** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; const char * r; int lenr, lenp; int wl = strlen(word); if (wl < 2 || ! pAMgr) return ns; int numrep = pAMgr->get_numrep(); struct replentry* reptable = pAMgr->get_reptable(); if (reptable==NULL) return ns; for (int i=0; i < numrep; i++ ) { r = word; lenr = strlen(reptable[i].pattern2); lenp = strlen(reptable[i].pattern); // search every occurence of the pattern in the word while ((r=strstr(r, reptable[i].pattern)) != NULL) { strcpy(candidate, word); if (r-word + lenr + strlen(r+lenp) >= MAXSWUTF8L) break; strcpy(candidate+(r-word),reptable[i].pattern2); strcpy(candidate+(r-word)+lenr, r+lenp); ns = testsug(wlst, candidate, wl-lenp+lenr, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; // check REP suggestions with space char * sp = strchr(candidate, ' '); if (sp) { *sp = '\0'; if (checkword(candidate, strlen(candidate), 0, NULL, NULL)) { int oldns = ns; *sp = ' '; ns = testsug(wlst, sp + 1, strlen(sp + 1), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; if (oldns < ns) { free(wlst[ns - 1]); wlst[ns - 1] = mystrdup(candidate); if (!wlst[ns - 1]) return -1; } } *sp = ' '; } r++; // search for the next letter } } return ns; } // perhaps we doubled two characters (pattern aba -> ababa, for example vacation -> vacacation) int SuggestMgr::doubletwochars(char** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; int state=0; int wl = strlen(word); if (wl < 5 || ! pAMgr) return ns; for (int i=2; i < wl; i++ ) { if (word[i]==word[i-2]) { state++; if (state==3) { strcpy(candidate,word); strcpy(candidate+i-1,word+i+1); ns = testsug(wlst, candidate, wl-2, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; state=0; } } else { state=0; } } return ns; } // perhaps we doubled two characters (pattern aba -> ababa, for example vacation -> vacacation) int SuggestMgr::doubletwochars_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { w_char candidate_utf[MAXSWL]; char candidate[MAXSWUTF8L]; int state=0; if (wl < 5 || ! pAMgr) return ns; for (int i=2; i < wl; i++) { if (w_char_eq(word[i], word[i-2])) { state++; if (state==3) { memcpy(candidate_utf, word, (i - 1) * sizeof(w_char)); memcpy(candidate_utf+i-1, word+i+1, (wl-i-1) * sizeof(w_char)); u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl-2); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; state=0; } } else { state=0; } } return ns; } // error is wrong char in place of correct one (case and keyboard related version) int SuggestMgr::badcharkey(char ** wlst, const char * word, int ns, int cpdsuggest) { char tmpc; char candidate[MAXSWUTF8L]; int wl = strlen(word); strcpy(candidate, word); // swap out each char one by one and try uppercase and neighbor // keyboard chars in its place to see if that makes a good word for (int i=0; i < wl; i++) { tmpc = candidate[i]; // check with uppercase letters candidate[i] = csconv[((unsigned char)tmpc)].cupper; if (tmpc != candidate[i]) { ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; candidate[i] = tmpc; } // check neighbor characters in keyboard string if (!ckey) continue; char * loc = strchr(ckey, tmpc); while (loc) { if ((loc > ckey) && (*(loc - 1) != '|')) { candidate[i] = *(loc - 1); ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } if ((*(loc + 1) != '|') && (*(loc + 1) != '\0')) { candidate[i] = *(loc + 1); ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } loc = strchr(loc + 1, tmpc); } candidate[i] = tmpc; } return ns; } // error is wrong char in place of correct one (case and keyboard related version) int SuggestMgr::badcharkey_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { w_char tmpc; w_char candidate_utf[MAXSWL]; char candidate[MAXSWUTF8L]; memcpy(candidate_utf, word, wl * sizeof(w_char)); // swap out each char one by one and try all the tryme // chars in its place to see if that makes a good word for (int i=0; i < wl; i++) { tmpc = candidate_utf[i]; // check with uppercase letters mkallcap_utf(candidate_utf + i, 1, langnum); if (!w_char_eq(tmpc, candidate_utf[i])) { u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; candidate_utf[i] = tmpc; } // check neighbor characters in keyboard string if (!ckey) continue; w_char * loc = ckey_utf; while ((loc < (ckey_utf + ckeyl)) && !w_char_eq(*loc, tmpc)) loc++; while (loc < (ckey_utf + ckeyl)) { if ((loc > ckey_utf) && !w_char_eq(*(loc - 1), W_VLINE)) { candidate_utf[i] = *(loc - 1); u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } if (((loc + 1) < (ckey_utf + ckeyl)) && !w_char_eq(*(loc + 1), W_VLINE)) { candidate_utf[i] = *(loc + 1); u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } do { loc++; } while ((loc < (ckey_utf + ckeyl)) && !w_char_eq(*loc, tmpc)); } candidate_utf[i] = tmpc; } return ns; } // error is wrong char in place of correct one int SuggestMgr::badchar(char ** wlst, const char * word, int ns, int cpdsuggest) { char tmpc; char candidate[MAXSWUTF8L]; clock_t timelimit = clock(); int timer = MINTIMER; int wl = strlen(word); strcpy(candidate, word); // swap out each char one by one and try all the tryme // chars in its place to see if that makes a good word for (int j=0; j < ctryl; j++) { for (int i=wl-1; i >= 0; i--) { tmpc = candidate[i]; if (ctry[j] == tmpc) continue; candidate[i] = ctry[j]; ns = testsug(wlst, candidate, wl, ns, cpdsuggest, &timer, &timelimit); if (ns == -1) return -1; if (!timer) return ns; candidate[i] = tmpc; } } return ns; } // error is wrong char in place of correct one int SuggestMgr::badchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { w_char tmpc; w_char candidate_utf[MAXSWL]; char candidate[MAXSWUTF8L]; clock_t timelimit = clock(); int timer = MINTIMER; memcpy(candidate_utf, word, wl * sizeof(w_char)); // swap out each char one by one and try all the tryme // chars in its place to see if that makes a good word for (int j=0; j < ctryl; j++) { for (int i=wl-1; i >= 0; i--) { tmpc = candidate_utf[i]; if (w_char_eq(tmpc, ctry_utf[j])) continue; candidate_utf[i] = ctry_utf[j]; u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, &timer, &timelimit); if (ns == -1) return -1; if (!timer) return ns; candidate_utf[i] = tmpc; } } return ns; } // error is word has an extra letter it does not need int SuggestMgr::extrachar_utf(char** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; w_char candidate_utf[MAXSWL]; w_char * p; w_char tmpc = W_VLINE; // not used value, only for VCC warning message if (wl < 2) return ns; // try omitting one char of word at a time memcpy(candidate_utf, word, wl * sizeof(w_char)); for (p = candidate_utf + wl - 1; p >= candidate_utf; p--) { w_char tmpc2 = *p; if (p < candidate_utf + wl - 1) *p = tmpc; u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl - 1); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; tmpc = tmpc2; } return ns; } // error is word has an extra letter it does not need int SuggestMgr::extrachar(char** wlst, const char * word, int ns, int cpdsuggest) { char tmpc = '\0'; char candidate[MAXSWUTF8L]; char * p; int wl = strlen(word); if (wl < 2) return ns; // try omitting one char of word at a time strcpy (candidate, word); for (p = candidate + wl - 1; p >=candidate; p--) { char tmpc2 = *p; *p = tmpc; ns = testsug(wlst, candidate, wl-1, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; tmpc = tmpc2; } return ns; } // error is missing a letter it needs int SuggestMgr::forgotchar(char ** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; char * p; clock_t timelimit = clock(); int timer = MINTIMER; int wl = strlen(word); // try inserting a tryme character before every letter (and the null terminator) for (int i = 0; i < ctryl; i++) { strcpy(candidate, word); for (p = candidate + wl; p >= candidate; p--) { *(p+1) = *p; *p = ctry[i]; ns = testsug(wlst, candidate, wl+1, ns, cpdsuggest, &timer, &timelimit); if (ns == -1) return -1; if (!timer) return ns; } } return ns; } // error is missing a letter it needs int SuggestMgr::forgotchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { w_char candidate_utf[MAXSWL]; char candidate[MAXSWUTF8L]; w_char * p; clock_t timelimit = clock(); int timer = MINTIMER; // try inserting a tryme character at the end of the word and before every letter for (int i = 0; i < ctryl; i++) { memcpy (candidate_utf, word, wl * sizeof(w_char)); for (p = candidate_utf + wl; p >= candidate_utf; p--) { *(p + 1) = *p; *p = ctry_utf[i]; u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl + 1); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, &timer, &timelimit); if (ns == -1) return -1; if (!timer) return ns; } } return ns; } /* error is should have been two words */ int SuggestMgr::twowords(char ** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; char * p; int c1, c2; int forbidden = 0; int cwrd; int wl=strlen(word); if (wl < 3) return ns; if (langnum == LANG_hu) forbidden = check_forbidden(word, wl); strcpy(candidate + 1, word); // split the string into two pieces after every char // if both pieces are good words make them a suggestion for (p = candidate + 1; p[1] != '\0'; p++) { p[-1] = *p; // go to end of the UTF-8 character while (utf8 && ((p[1] & 0xc0) == 0x80)) { *p = p[1]; p++; } if (utf8 && p[1] == '\0') break; // last UTF-8 character *p = '\0'; c1 = checkword(candidate,strlen(candidate), cpdsuggest, NULL, NULL); if (c1) { c2 = checkword((p+1),strlen(p+1), cpdsuggest, NULL, NULL); if (c2) { *p = ' '; // spec. Hungarian code (need a better compound word support) if ((langnum == LANG_hu) && !forbidden && // if 3 repeating letter, use - instead of space (((p[-1] == p[1]) && (((p>candidate+1) && (p[-1] == p[-2])) || (p[-1] == p[2]))) || // or multiple compounding, with more, than 6 syllables ((c1 == 3) && (c2 >= 2)))) *p = '-'; cwrd = 1; for (int k=0; k < ns; k++) if (strcmp(candidate,wlst[k]) == 0) cwrd = 0; if (ns < maxSug) { if (cwrd) { wlst[ns] = mystrdup(candidate); if (wlst[ns] == NULL) return -1; ns++; } } else return ns; // add two word suggestion with dash, if TRY string contains // "a" or "-" // NOTE: cwrd doesn't modified for REP twoword sugg. if (ctry && (strchr(ctry, 'a') || strchr(ctry, '-')) && mystrlen(p + 1) > 1 && mystrlen(candidate) - mystrlen(p) > 1) { *p = '-'; for (int k=0; k < ns; k++) if (strcmp(candidate,wlst[k]) == 0) cwrd = 0; if (ns < maxSug) { if (cwrd) { wlst[ns] = mystrdup(candidate); if (wlst[ns] == NULL) return -1; ns++; } } else return ns; } } } } return ns; } // error is adjacent letter were swapped int SuggestMgr::swapchar(char ** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; char * p; char tmpc; int wl=strlen(word); // try swapping adjacent chars one by one strcpy(candidate, word); for (p = candidate; p[1] != 0; p++) { tmpc = *p; *p = p[1]; p[1] = tmpc; ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; p[1] = *p; *p = tmpc; } // try double swaps for short words // ahev -> have, owudl -> would if (wl == 4 || wl == 5) { candidate[0] = word[1]; candidate[1] = word[0]; candidate[2] = word[2]; candidate[wl - 2] = word[wl - 1]; candidate[wl - 1] = word[wl - 2]; ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; if (wl == 5) { candidate[0] = word[0]; candidate[1] = word[2]; candidate[2] = word[1]; ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } } return ns; } // error is adjacent letter were swapped int SuggestMgr::swapchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { w_char candidate_utf[MAXSWL]; char candidate[MAXSWUTF8L]; w_char * p; w_char tmpc; int len = 0; // try swapping adjacent chars one by one memcpy (candidate_utf, word, wl * sizeof(w_char)); for (p = candidate_utf; p < (candidate_utf + wl - 1); p++) { tmpc = *p; *p = p[1]; p[1] = tmpc; u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); if (len == 0) len = strlen(candidate); ns = testsug(wlst, candidate, len, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; p[1] = *p; *p = tmpc; } // try double swaps for short words // ahev -> have, owudl -> would, suodn -> sound if (wl == 4 || wl == 5) { candidate_utf[0] = word[1]; candidate_utf[1] = word[0]; candidate_utf[2] = word[2]; candidate_utf[wl - 2] = word[wl - 1]; candidate_utf[wl - 1] = word[wl - 2]; u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, len, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; if (wl == 5) { candidate_utf[0] = word[0]; candidate_utf[1] = word[2]; candidate_utf[2] = word[1]; u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, len, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } } return ns; } // error is not adjacent letter were swapped int SuggestMgr::longswapchar(char ** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; char * p; char * q; char tmpc; int wl=strlen(word); // try swapping not adjacent chars one by one strcpy(candidate, word); for (p = candidate; *p != 0; p++) { for (q = candidate; *q != 0; q++) { if (abs((int)(p-q)) > 1) { tmpc = *p; *p = *q; *q = tmpc; ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; *q = *p; *p = tmpc; } } } return ns; } // error is adjacent letter were swapped int SuggestMgr::longswapchar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { w_char candidate_utf[MAXSWL]; char candidate[MAXSWUTF8L]; w_char * p; w_char * q; w_char tmpc; // try swapping not adjacent chars memcpy (candidate_utf, word, wl * sizeof(w_char)); for (p = candidate_utf; p < (candidate_utf + wl); p++) { for (q = candidate_utf; q < (candidate_utf + wl); q++) { if (abs((int)(p-q)) > 1) { tmpc = *p; *p = *q; *q = tmpc; u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; *q = *p; *p = tmpc; } } } return ns; } // error is a letter was moved int SuggestMgr::movechar(char ** wlst, const char * word, int ns, int cpdsuggest) { char candidate[MAXSWUTF8L]; char * p; char * q; char tmpc; int wl=strlen(word); // try moving a char strcpy(candidate, word); for (p = candidate; *p != 0; p++) { for (q = p + 1; (*q != 0) && ((q - p) < 10); q++) { tmpc = *(q-1); *(q-1) = *q; *q = tmpc; if ((q-p) < 2) continue; // omit swap char ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } strcpy(candidate, word); } for (p = candidate + wl - 1; p > candidate; p--) { for (q = p - 1; (q >= candidate) && ((p - q) < 10); q--) { tmpc = *(q+1); *(q+1) = *q; *q = tmpc; if ((p-q) < 2) continue; // omit swap char ns = testsug(wlst, candidate, wl, ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } strcpy(candidate, word); } return ns; } // error is a letter was moved int SuggestMgr::movechar_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest) { w_char candidate_utf[MAXSWL]; char candidate[MAXSWUTF8L]; w_char * p; w_char * q; w_char tmpc; // try moving a char memcpy (candidate_utf, word, wl * sizeof(w_char)); for (p = candidate_utf; p < (candidate_utf + wl); p++) { for (q = p + 1; (q < (candidate_utf + wl)) && ((q - p) < 10); q++) { tmpc = *(q-1); *(q-1) = *q; *q = tmpc; if ((q-p) < 2) continue; // omit swap char u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } memcpy (candidate_utf, word, wl * sizeof(w_char)); } for (p = candidate_utf + wl - 1; p > candidate_utf; p--) { for (q = p - 1; (q >= candidate_utf) && ((p - q) < 10); q--) { tmpc = *(q+1); *(q+1) = *q; *q = tmpc; if ((p-q) < 2) continue; // omit swap char u16_u8(candidate, MAXSWUTF8L, candidate_utf, wl); ns = testsug(wlst, candidate, strlen(candidate), ns, cpdsuggest, NULL, NULL); if (ns == -1) return -1; } memcpy (candidate_utf, word, wl * sizeof(w_char)); } return ns; } // generate a set of suggestions for very poorly spelled words int SuggestMgr::ngsuggest(char** wlst, char * w, int ns, HashMgr** pHMgr, int md) { int i, j; int lval; int sc, scphon; int lp, lpphon; int nonbmp = 0; // exhaustively search through all root words // keeping track of the MAX_ROOTS most similar root words struct hentry * roots[MAX_ROOTS]; char * rootsphon[MAX_ROOTS]; int scores[MAX_ROOTS]; int scoresphon[MAX_ROOTS]; for (i = 0; i < MAX_ROOTS; i++) { roots[i] = NULL; scores[i] = -100 * i; rootsphon[i] = NULL; scoresphon[i] = -100 * i; } lp = MAX_ROOTS - 1; lpphon = MAX_ROOTS - 1; scphon = scoresphon[MAX_ROOTS-1]; char w2[MAXWORDUTF8LEN]; char f[MAXSWUTF8L]; char * word = w; // word reversing wrapper for complex prefixes if (complexprefixes) { strcpy(w2, w); if (utf8) reverseword_utf(w2); else reverseword(w2); word = w2; } char mw[MAXSWUTF8L]; w_char u8[MAXSWL]; int nc = strlen(word); int n = (utf8) ? u8_u16(u8, MAXSWL, word) : nc; // set character based ngram suggestion for words with non-BMP Unicode characters if (n == -1) { utf8 = 0; n = nc; nonbmp = 1; } struct hentry* hp = NULL; int col = -1; phonetable * ph = (pAMgr) ? pAMgr->get_phonetable() : NULL; char target[MAXSWUTF8L]; char candidate[MAXSWUTF8L]; if (ph) { strcpy(candidate, word); mkallcap(candidate, csconv); phonet(candidate, target, n, *ph); } for (i = 0; i < md; i++) { while (0 != (hp = (pHMgr[i])->walk_hashtable(col, hp))) { if ((hp->astr) && (pAMgr) && (TESTAFF(hp->astr, pAMgr->get_forbiddenword(), hp->alen) || TESTAFF(hp->astr, ONLYUPCASEFLAG, hp->alen) || TESTAFF(hp->astr, pAMgr->get_nosuggest(), hp->alen) || TESTAFF(hp->astr, pAMgr->get_onlyincompound(), hp->alen))) continue; sc = ngram(3, word, HENTRY_WORD(hp), NGRAM_LONGER_WORSE + NGRAM_LOWERING) + leftcommonsubstring(word, HENTRY_WORD(hp)); // check special pronounciation if ((hp->var & H_OPT_PHON) && copy_field(f, HENTRY_DATA(hp), MORPH_PHON)) { int sc2 = ngram(3, word, f, NGRAM_LONGER_WORSE + NGRAM_LOWERING) + leftcommonsubstring(word, f); if (sc2 > sc) sc = sc2; } if (ph && (sc > 2) && (abs(n - (int) hp->clen) <= 3)) { char target2[MAXSWUTF8L]; strcpy(candidate, HENTRY_WORD(hp)); mkallcap(candidate, csconv); phonet(candidate, target2, -1, *ph); scphon = 2 * ngram(3, target, target2, NGRAM_LONGER_WORSE); } if (sc > scores[lp]) { scores[lp] = sc; roots[lp] = hp; lval = sc; for (j=0; j < MAX_ROOTS; j++) if (scores[j] < lval) { lp = j; lval = scores[j]; } } if (scphon > scoresphon[lpphon]) { scoresphon[lpphon] = scphon; rootsphon[lpphon] = HENTRY_WORD(hp); lval = scphon; for (j=0; j < MAX_ROOTS; j++) if (scoresphon[j] < lval) { lpphon = j; lval = scoresphon[j]; } } }} // find minimum threshhold for a passable suggestion // mangle original word three differnt ways // and score them to generate a minimum acceptable score int thresh = 0; for (int sp = 1; sp < 4; sp++) { if (utf8) { for (int k=sp; k < n; k+=4) *((unsigned short *) u8 + k) = '*'; u16_u8(mw, MAXSWUTF8L, u8, n); thresh = thresh + ngram(n, word, mw, NGRAM_ANY_MISMATCH + NGRAM_LOWERING); } else { strcpy(mw, word); for (int k=sp; k < n; k+=4) *(mw + k) = '*'; thresh = thresh + ngram(n, word, mw, NGRAM_ANY_MISMATCH + NGRAM_LOWERING); } } thresh = thresh / 3; thresh--; // now expand affixes on each of these root words and // and use length adjusted ngram scores to select // possible suggestions char * guess[MAX_GUESS]; char * guessorig[MAX_GUESS]; int gscore[MAX_GUESS]; for(i=0;iexpand_rootword(glst, MAX_WORDS, HENTRY_WORD(rp), rp->blen, rp->astr, rp->alen, word, nc, ((rp->var & H_OPT_PHON) ? copy_field(f, HENTRY_DATA(rp), MORPH_PHON) : NULL)); for (int k = 0; k < nw ; k++) { sc = ngram(n, word, glst[k].word, NGRAM_ANY_MISMATCH + NGRAM_LOWERING) + leftcommonsubstring(word, glst[k].word); if ((sc > thresh)) { if (sc > gscore[lp]) { if (guess[lp]) { free (guess[lp]); if (guessorig[lp]) { free(guessorig[lp]); guessorig[lp] = NULL; } } gscore[lp] = sc; guess[lp] = glst[k].word; guessorig[lp] = glst[k].orig; lval = sc; for (j=0; j < MAX_GUESS; j++) if (gscore[j] < lval) { lp = j; lval = gscore[j]; } } else { free(glst[k].word); if (glst[k].orig) free(glst[k].orig); } } else { free(glst[k].word); if (glst[k].orig) free(glst[k].orig); } } } } free(glst); // now we are done generating guesses // sort in order of decreasing score bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS); if (ph) bubblesort(&rootsphon[0], NULL, &scoresphon[0], MAX_ROOTS); // weight suggestions with a similarity index, based on // the longest common subsequent algorithm and resort int is_swap; for (i=0; i < MAX_GUESS; i++) { if (guess[i]) { // lowering guess[i] char gl[MAXSWUTF8L]; int len; if (utf8) { w_char _w[MAXSWL]; len = u8_u16(_w, MAXSWL, guess[i]); mkallsmall_utf(_w, len, langnum); u16_u8(gl, MAXSWUTF8L, _w, len); } else { strcpy(gl, guess[i]); mkallsmall(gl, csconv); len = strlen(guess[i]); } int _lcs = lcslen(word, gl); // same characters with different casing if ((n == len) && (n == _lcs)) { gscore[i] += 2000; break; } // heuristic weigthing of ngram scores gscore[i] += // length of longest common subsequent minus length difference 2 * _lcs - abs((int) (n - len)) + // weight length of the left common substring leftcommonsubstring(word, gl) + // weight equal character positions ((_lcs == commoncharacterpositions(word, gl, &is_swap)) ? 1: 0) + // swap character (not neighboring) ((is_swap) ? 1000 : 0); } } bubblesort(&guess[0], &guessorig[0], &gscore[0], MAX_GUESS); // phonetic version if (ph) for (i=0; i < MAX_ROOTS; i++) { if (rootsphon[i]) { // lowering rootphon[i] char gl[MAXSWUTF8L]; int len; if (utf8) { w_char _w[MAXSWL]; len = u8_u16(_w, MAXSWL, rootsphon[i]); mkallsmall_utf(_w, len, langnum); u16_u8(gl, MAXSWUTF8L, _w, len); } else { strcpy(gl, rootsphon[i]); mkallsmall(gl, csconv); len = strlen(rootsphon[i]); } // heuristic weigthing of ngram scores scoresphon[i] += 2 * lcslen(word, gl) - abs((int) (n - len)) + // weight length of the left common substring leftcommonsubstring(word, gl); } } if (ph) bubblesort(&rootsphon[0], NULL, &scoresphon[0], MAX_ROOTS); // copy over int oldns = ns; int same = 0; for (i=0; i < MAX_GUESS; i++) { if (guess[i]) { if ((ns < oldns + maxngramsugs) && (ns < maxSug) && (!same || (gscore[i] > 1000))) { int unique = 1; // leave only excellent suggestions, if exists if (gscore[i] > 1000) same = 1; for (j = 0; j < ns; j++) { // don't suggest previous suggestions or a previous suggestion with prefixes or affixes if ((!guessorig[i] && strstr(guess[i], wlst[j])) || (guessorig[i] && strstr(guessorig[i], wlst[j])) || // check forbidden words !checkword(guess[i], strlen(guess[i]), 0, NULL, NULL)) unique = 0; } if (unique) { wlst[ns++] = guess[i]; if (guessorig[i]) { free(guess[i]); wlst[ns-1] = guessorig[i]; } } else { free(guess[i]); if (guessorig[i]) free(guessorig[i]); } } else { free(guess[i]); if (guessorig[i]) free(guessorig[i]); } } } oldns = ns; if (ph) for (i=0; i < MAX_ROOTS; i++) { if (rootsphon[i]) { if ((ns < oldns + MAXPHONSUGS) && (ns < maxSug)) { int unique = 1; for (j = 0; j < ns; j++) { // don't suggest previous suggestions or a previous suggestion with prefixes or affixes if (strstr(rootsphon[i], wlst[j]) || // check forbidden words !checkword(rootsphon[i], strlen(rootsphon[i]), 0, NULL, NULL)) unique = 0; } if (unique) { wlst[ns++] = mystrdup(rootsphon[i]); if (!wlst[ns - 1]) return ns - 1; } } } } if (nonbmp) utf8 = 1; return ns; } // see if a candidate suggestion is spelled correctly // needs to check both root words and words with affixes // obsolote MySpell-HU modifications: // return value 2 and 3 marks compounding with hyphen (-) // `3' marks roots without suffix int SuggestMgr::checkword(const char * word, int len, int cpdsuggest, int * timer, clock_t * timelimit) { struct hentry * rv=NULL; int nosuffix = 0; // check time limit if (timer) { (*timer)--; if (!(*timer) && timelimit) { if ((clock() - *timelimit) > TIMELIMIT) return 0; *timer = MAXPLUSTIMER; } } if (pAMgr) { if (cpdsuggest==1) { if (pAMgr->get_compound()) { rv = pAMgr->compound_check(word, len, 0, 0, 100, 0, NULL, 0, 1); //EXT if (rv) return 3; // XXX obsolote categorisation } return 0; } rv = pAMgr->lookup(word); if (rv) { if ((rv->astr) && (TESTAFF(rv->astr,pAMgr->get_forbiddenword(),rv->alen) || TESTAFF(rv->astr,pAMgr->get_nosuggest(),rv->alen))) return 0; while (rv) { if (rv->astr && (TESTAFF(rv->astr,pAMgr->get_needaffix(),rv->alen) || TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) { rv = rv->next_homonym; } else break; } } else rv = pAMgr->prefix_check(word, len, 0); // only prefix, and prefix + suffix XXX if (rv) { nosuffix=1; } else { rv = pAMgr->suffix_check(word, len, 0, NULL, NULL, 0, NULL); // only suffix } if (!rv && pAMgr->have_contclass()) { rv = pAMgr->suffix_check_twosfx(word, len, 0, NULL, FLAG_NULL); if (!rv) rv = pAMgr->prefix_check_twosfx(word, len, 1, FLAG_NULL); } // check forbidden words if ((rv) && (rv->astr) && (TESTAFF(rv->astr,pAMgr->get_forbiddenword(),rv->alen) || TESTAFF(rv->astr, ONLYUPCASEFLAG, rv->alen) || TESTAFF(rv->astr,pAMgr->get_nosuggest(),rv->alen) || TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) return 0; if (rv) { // XXX obsolote if ((pAMgr->get_compoundflag()) && TESTAFF(rv->astr, pAMgr->get_compoundflag(), rv->alen)) return 2 + nosuffix; return 1; } } return 0; } int SuggestMgr::check_forbidden(const char * word, int len) { struct hentry * rv = NULL; if (pAMgr) { rv = pAMgr->lookup(word); if (rv && rv->astr && (TESTAFF(rv->astr,pAMgr->get_needaffix(),rv->alen) || TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) rv = NULL; if (!(pAMgr->prefix_check(word,len,1))) rv = pAMgr->suffix_check(word,len, 0, NULL, NULL, 0, NULL); // prefix+suffix, suffix // check forbidden words if ((rv) && (rv->astr) && TESTAFF(rv->astr,pAMgr->get_forbiddenword(),rv->alen)) return 1; } return 0; } #ifdef HUNSPELL_EXPERIMENTAL // suggest possible stems int SuggestMgr::suggest_pos_stems(char*** slst, const char * w, int nsug) { char ** wlst; struct hentry * rv = NULL; char w2[MAXSWUTF8L]; const char * word = w; // word reversing wrapper for complex prefixes if (complexprefixes) { strcpy(w2, w); if (utf8) reverseword_utf(w2); else reverseword(w2); word = w2; } int wl = strlen(word); if (*slst) { wlst = *slst; } else { wlst = (char **) calloc(maxSug, sizeof(char *)); if (wlst == NULL) return -1; } rv = pAMgr->suffix_check(word, wl, 0, NULL, wlst, maxSug, &nsug); // delete dash from end of word if (nsug > 0) { for (int j=0; j < nsug; j++) { if (wlst[j][strlen(wlst[j]) - 1] == '-') wlst[j][strlen(wlst[j]) - 1] = '\0'; } } *slst = wlst; return nsug; } #endif // END OF HUNSPELL_EXPERIMENTAL CODE char * SuggestMgr::suggest_morph(const char * w) { char result[MAXLNLEN]; char * r = (char *) result; char * st; struct hentry * rv = NULL; *result = '\0'; if (! pAMgr) return NULL; char w2[MAXSWUTF8L]; const char * word = w; // word reversing wrapper for complex prefixes if (complexprefixes) { strcpy(w2, w); if (utf8) reverseword_utf(w2); else reverseword(w2); word = w2; } rv = pAMgr->lookup(word); while (rv) { if ((!rv->astr) || !(TESTAFF(rv->astr, pAMgr->get_forbiddenword(), rv->alen) || TESTAFF(rv->astr, pAMgr->get_needaffix(), rv->alen) || TESTAFF(rv->astr,pAMgr->get_onlyincompound(),rv->alen))) { if (!HENTRY_FIND(rv, MORPH_STEM)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, MORPH_STEM, MAXLNLEN); mystrcat(result, word, MAXLNLEN); } if (HENTRY_DATA(rv)) { mystrcat(result, " ", MAXLNLEN); mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); } mystrcat(result, "\n", MAXLNLEN); } rv = rv->next_homonym; } st = pAMgr->affix_check_morph(word,strlen(word)); if (st) { mystrcat(result, st, MAXLNLEN); free(st); } if (pAMgr->get_compound() && (*result == '\0')) pAMgr->compound_check_morph(word, strlen(word), 0, 0, 100, 0,NULL, 0, &r, NULL); return (*result) ? mystrdup(line_uniq(result, MSEP_REC)) : NULL; } #ifdef HUNSPELL_EXPERIMENTAL char * SuggestMgr::suggest_morph_for_spelling_error(const char * word) { char * p = NULL; char ** wlst = (char **) calloc(maxSug, sizeof(char *)); if (!**wlst) return NULL; // we will use only the first suggestion for (int i = 0; i < maxSug - 1; i++) wlst[i] = ""; int ns = suggest(&wlst, word, maxSug - 1, NULL); if (ns == maxSug) { p = suggest_morph(wlst[maxSug - 1]); free(wlst[maxSug - 1]); } if (wlst) free(wlst); return p; } #endif // END OF HUNSPELL_EXPERIMENTAL CODE /* affixation */ char * SuggestMgr::suggest_hentry_gen(hentry * rv, char * pattern) { char result[MAXLNLEN]; *result = '\0'; int sfxcount = get_sfxcount(pattern); if (get_sfxcount(HENTRY_DATA(rv)) > sfxcount) return NULL; if (HENTRY_DATA(rv)) { char * aff = pAMgr->morphgen(HENTRY_WORD(rv), rv->blen, rv->astr, rv->alen, HENTRY_DATA(rv), pattern, 0); if (aff) { mystrcat(result, aff, MAXLNLEN); mystrcat(result, "\n", MAXLNLEN); free(aff); } } // check all allomorphs char allomorph[MAXLNLEN]; char * p = NULL; if (HENTRY_DATA(rv)) p = (char *) strstr(HENTRY_DATA2(rv), MORPH_ALLOMORPH); while (p) { struct hentry * rv2 = NULL; p += MORPH_TAG_LEN; int plen = fieldlen(p); strncpy(allomorph, p, plen); allomorph[plen] = '\0'; rv2 = pAMgr->lookup(allomorph); while (rv2) { // if (HENTRY_DATA(rv2) && get_sfxcount(HENTRY_DATA(rv2)) <= sfxcount) { if (HENTRY_DATA(rv2)) { char * st = (char *) strstr(HENTRY_DATA2(rv2), MORPH_STEM); if (st && (strncmp(st + MORPH_TAG_LEN, HENTRY_WORD(rv), fieldlen(st + MORPH_TAG_LEN)) == 0)) { char * aff = pAMgr->morphgen(HENTRY_WORD(rv2), rv2->blen, rv2->astr, rv2->alen, HENTRY_DATA(rv2), pattern, 0); if (aff) { mystrcat(result, aff, MAXLNLEN); mystrcat(result, "\n", MAXLNLEN); free(aff); } } } rv2 = rv2->next_homonym; } p = strstr(p + plen, MORPH_ALLOMORPH); } return (*result) ? mystrdup(result) : NULL; } char * SuggestMgr::suggest_gen(char ** desc, int n, char * pattern) { char result[MAXLNLEN]; char result2[MAXLNLEN]; char newpattern[MAXLNLEN]; *newpattern = '\0'; if (n == 0) return 0; *result2 = '\0'; struct hentry * rv = NULL; if (!pAMgr) return NULL; // search affixed forms with and without derivational suffixes while(1) { for (int k = 0; k < n; k++) { *result = '\0'; // add compound word parts (except the last one) char * s = (char *) desc[k]; char * part = strstr(s, MORPH_PART); if (part) { char * nextpart = strstr(part + 1, MORPH_PART); while (nextpart) { copy_field(result + strlen(result), part, MORPH_PART); part = nextpart; nextpart = strstr(part + 1, MORPH_PART); } s = part; } char **pl; char tok[MAXLNLEN]; strcpy(tok, s); char * alt = strstr(tok, " | "); while (alt) { alt[1] = MSEP_ALT; alt = strstr(alt, " | "); } int pln = line_tok(tok, &pl, MSEP_ALT); for (int i = 0; i < pln; i++) { // remove inflectional and terminal suffixes char * is = strstr(pl[i], MORPH_INFL_SFX); if (is) *is = '\0'; char * ts = strstr(pl[i], MORPH_TERM_SFX); while (ts) { *ts = '_'; ts = strstr(pl[i], MORPH_TERM_SFX); } char * st = strstr(s, MORPH_STEM); if (st) { copy_field(tok, st, MORPH_STEM); rv = pAMgr->lookup(tok); while (rv) { char newpat[MAXLNLEN]; strcpy(newpat, pl[i]); strcat(newpat, pattern); char * sg = suggest_hentry_gen(rv, newpat); if (!sg) sg = suggest_hentry_gen(rv, pattern); if (sg) { char ** gen; int genl = line_tok(sg, &gen, MSEP_REC); free(sg); sg = NULL; for (int j = 0; j < genl; j++) { if (strstr(pl[i], MORPH_SURF_PFX)) { int r2l = strlen(result2); result2[r2l] = MSEP_REC; strcpy(result2 + r2l + 1, result); copy_field(result2 + strlen(result2), pl[i], MORPH_SURF_PFX); mystrcat(result2, gen[j], MAXLNLEN); } else { sprintf(result2 + strlen(result2), "%c%s%s", MSEP_REC, result, gen[j]); } } freelist(&gen, genl); } rv = rv->next_homonym; } } } freelist(&pl, pln); } if (*result2 || !strstr(pattern, MORPH_DERI_SFX)) break; strcpy(newpattern, pattern); pattern = newpattern; char * ds = strstr(pattern, MORPH_DERI_SFX); while (ds) { strncpy(ds, MORPH_TERM_SFX, MORPH_TAG_LEN); ds = strstr(pattern, MORPH_DERI_SFX); } } return (*result2 ? mystrdup(result2) : NULL); } // generate an n-gram score comparing s1 and s2 int SuggestMgr::ngram(int n, char * s1, const char * s2, int opt) { int nscore = 0; int ns; int l1; int l2; if (utf8) { w_char su1[MAXSWL]; w_char su2[MAXSWL]; l1 = u8_u16(su1, MAXSWL, s1); l2 = u8_u16(su2, MAXSWL, s2); if ((l2 <= 0) || (l1 == -1)) return 0; // lowering dictionary word if (opt & NGRAM_LOWERING) mkallsmall_utf(su2, l2, langnum); for (int j = 1; j <= n; j++) { ns = 0; for (int i = 0; i <= (l1-j); i++) { for (int l = 0; l <= (l2-j); l++) { int k; for (k = 0; (k < j); k++) { w_char * c1 = su1 + i + k; w_char * c2 = su2 + l + k; if ((c1->l != c2->l) || (c1->h != c2->h)) break; } if (k == j) { ns++; break; } } } nscore = nscore + ns; if (ns < 2) break; } } else { l2 = strlen(s2); if (l2 == 0) return 0; l1 = strlen(s1); char *t = mystrdup(s2); if (opt & NGRAM_LOWERING) mkallsmall(t, csconv); for (int j = 1; j <= n; j++) { ns = 0; for (int i = 0; i <= (l1-j); i++) { char c = *(s1 + i + j); *(s1 + i + j) = '\0'; if (strstr(t,(s1+i))) ns++; *(s1 + i + j ) = c; } nscore = nscore + ns; if (ns < 2) break; } free(t); } ns = 0; if (opt & NGRAM_LONGER_WORSE) ns = (l2-l1)-2; if (opt & NGRAM_ANY_MISMATCH) ns = abs(l2-l1)-2; ns = (nscore - ((ns > 0) ? ns : 0)); return ns; } // length of the left common substring of s1 and (decapitalised) s2 int SuggestMgr::leftcommonsubstring(char * s1, const char * s2) { if (utf8) { w_char su1[MAXSWL]; w_char su2[MAXSWL]; // decapitalize dictionary word if (complexprefixes) { int l1 = u8_u16(su1, MAXSWL, s1); int l2 = u8_u16(su2, MAXSWL, s2); if (*((short *)su1+l1-1) == *((short *)su2+l2-1)) return 1; } else { int i; u8_u16(su1, 1, s1); u8_u16(su2, 1, s2); unsigned short idx = (su2->h << 8) + su2->l; unsigned short otheridx = (su1->h << 8) + su1->l; if (otheridx != idx && (otheridx != unicodetolower(idx, langnum))) return 0; int l1 = u8_u16(su1, MAXSWL, s1); int l2 = u8_u16(su2, MAXSWL, s2); for(i = 1; (i < l1) && (i < l2) && (su1[i].l == su2[i].l) && (su1[i].h == su2[i].h); i++); return i; } } else { if (complexprefixes) { int l1 = strlen(s1); int l2 = strlen(s2); if (*(s2+l1-1) == *(s2+l2-1)) return 1; } else { char * olds = s1; // decapitalise dictionary word if ((*s1 != *s2) && (*s1 != csconv[((unsigned char)*s2)].clower)) return 0; do { s1++; s2++; } while ((*s1 == *s2) && (*s1 != '\0')); return (int)(s1 - olds); } } return 0; } int SuggestMgr::commoncharacterpositions(char * s1, const char * s2, int * is_swap) { int num = 0; int diff = 0; int diffpos[2]; *is_swap = 0; if (utf8) { w_char su1[MAXSWL]; w_char su2[MAXSWL]; int l1 = u8_u16(su1, MAXSWL, s1); int l2 = u8_u16(su2, MAXSWL, s2); // decapitalize dictionary word if (complexprefixes) { mkallsmall_utf(su2+l2-1, 1, langnum); } else { mkallsmall_utf(su2, 1, langnum); } for (int i = 0; (i < l1) && (i < l2); i++) { if (((short *) su1)[i] == ((short *) su2)[i]) { num++; } else { if (diff < 2) diffpos[diff] = i; diff++; } } if ((diff == 2) && (l1 == l2) && (((short *) su1)[diffpos[0]] == ((short *) su2)[diffpos[1]]) && (((short *) su1)[diffpos[1]] == ((short *) su2)[diffpos[0]])) *is_swap = 1; } else { int i; char t[MAXSWUTF8L]; strcpy(t, s2); // decapitalize dictionary word if (complexprefixes) { int l2 = strlen(t); *(t+l2-1) = csconv[((unsigned char)*(t+l2-1))].clower; } else { mkallsmall(t, csconv); } for (i = 0; (*(s1+i) != 0) && (*(t+i) != 0); i++) { if (*(s1+i) == *(t+i)) { num++; } else { if (diff < 2) diffpos[diff] = i; diff++; } } if ((diff == 2) && (*(s1+i) == 0) && (*(t+i) == 0) && (*(s1+diffpos[0]) == *(t+diffpos[1])) && (*(s1+diffpos[1]) == *(t+diffpos[0]))) *is_swap = 1; } return num; } int SuggestMgr::mystrlen(const char * word) { if (utf8) { w_char w[MAXSWL]; return u8_u16(w, MAXSWL, word); } else return strlen(word); } // sort in decreasing order of score void SuggestMgr::bubblesort(char** rword, char** rword2, int* rsc, int n ) { int m = 1; while (m < n) { int j = m; while (j > 0) { if (rsc[j-1] < rsc[j]) { int sctmp = rsc[j-1]; char * wdtmp = rword[j-1]; rsc[j-1] = rsc[j]; rword[j-1] = rword[j]; rsc[j] = sctmp; rword[j] = wdtmp; if (rword2) { wdtmp = rword2[j-1]; rword2[j-1] = rword2[j]; rword2[j] = wdtmp; } j--; } else break; } m++; } return; } // longest common subsequence void SuggestMgr::lcs(const char * s, const char * s2, int * l1, int * l2, char ** result) { int n, m; w_char su[MAXSWL]; w_char su2[MAXSWL]; char * b; char * c; int i; int j; if (utf8) { m = u8_u16(su, MAXSWL, s); n = u8_u16(su2, MAXSWL, s2); } else { m = strlen(s); n = strlen(s2); } c = (char *) malloc((m + 1) * (n + 1)); b = (char *) malloc((m + 1) * (n + 1)); if (!c || !b) { if (c) free(c); if (b) free(b); *result = NULL; return; } for (i = 1; i <= m; i++) c[i*(n+1)] = 0; for (j = 0; j <= n; j++) c[j] = 0; for (i = 1; i <= m; i++) { for (j = 1; j <= n; j++) { if ( ((utf8) && (*((short *) su+i-1) == *((short *)su2+j-1))) || ((!utf8) && ((*(s+i-1)) == (*(s2+j-1))))) { c[i*(n+1) + j] = c[(i-1)*(n+1) + j-1]+1; b[i*(n+1) + j] = LCS_UPLEFT; } else if (c[(i-1)*(n+1) + j] >= c[i*(n+1) + j-1]) { c[i*(n+1) + j] = c[(i-1)*(n+1) + j]; b[i*(n+1) + j] = LCS_UP; } else { c[i*(n+1) + j] = c[i*(n+1) + j-1]; b[i*(n+1) + j] = LCS_LEFT; } } } *result = b; free(c); *l1 = m; *l2 = n; } int SuggestMgr::lcslen(const char * s, const char* s2) { int m; int n; int i; int j; char * result; int len = 0; lcs(s, s2, &m, &n, &result); if (!result) return 0; i = m; j = n; while ((i != 0) && (j != 0)) { if (result[i*(n+1) + j] == LCS_UPLEFT) { len++; i--; j--; } else if (result[i*(n+1) + j] == LCS_UP) { i--; } else j--; } free(result); return len; } qt-client-4.1.0/hunspell/suggestmgr.hxx000066400000000000000000000073111217451700100201660ustar00rootroot00000000000000#ifndef _SUGGESTMGR_HXX_ #define _SUGGESTMGR_HXX_ #define MAXSWL 100 #define MAXSWUTF8L (MAXSWL * 4) #define MAX_ROOTS 100 #define MAX_WORDS 100 #define MAX_GUESS 200 #define MAXNGRAMSUGS 4 #define MAXPHONSUGS 2 // timelimit: max ~1/4 sec (process time on Linux) for a time consuming function #define TIMELIMIT (CLOCKS_PER_SEC >> 2) #define MINTIMER 100 #define MAXPLUSTIMER 100 #define NGRAM_LONGER_WORSE (1 << 0) #define NGRAM_ANY_MISMATCH (1 << 1) #define NGRAM_LOWERING (1 << 2) #include "hunvisapi.h" #include "atypes.hxx" #include "affixmgr.hxx" #include "hashmgr.hxx" #include "langnum.hxx" #include enum { LCS_UP, LCS_LEFT, LCS_UPLEFT }; class LIBHUNSPELL_DLL_EXPORTED SuggestMgr { char * ckey; int ckeyl; w_char * ckey_utf; char * ctry; int ctryl; w_char * ctry_utf; AffixMgr* pAMgr; int maxSug; struct cs_info * csconv; int utf8; int langnum; int nosplitsugs; int maxngramsugs; int complexprefixes; public: SuggestMgr(const char * tryme, int maxn, AffixMgr *aptr); ~SuggestMgr(); int suggest(char*** slst, const char * word, int nsug, int * onlycmpdsug); int ngsuggest(char ** wlst, char * word, int ns, HashMgr** pHMgr, int md); int suggest_auto(char*** slst, const char * word, int nsug); int suggest_stems(char*** slst, const char * word, int nsug); int suggest_pos_stems(char*** slst, const char * word, int nsug); char * suggest_morph(const char * word); char * suggest_gen(char ** pl, int pln, char * pattern); char * suggest_morph_for_spelling_error(const char * word); private: int testsug(char** wlst, const char * candidate, int wl, int ns, int cpdsuggest, int * timer, clock_t * timelimit); int checkword(const char *, int, int, int *, clock_t *); int check_forbidden(const char *, int); int capchars(char **, const char *, int, int); int replchars(char**, const char *, int, int); int doubletwochars(char**, const char *, int, int); int forgotchar(char **, const char *, int, int); int swapchar(char **, const char *, int, int); int longswapchar(char **, const char *, int, int); int movechar(char **, const char *, int, int); int extrachar(char **, const char *, int, int); int badcharkey(char **, const char *, int, int); int badchar(char **, const char *, int, int); int twowords(char **, const char *, int, int); int fixstems(char **, const char *, int); int capchars_utf(char **, const w_char *, int wl, int, int); int doubletwochars_utf(char**, const w_char *, int wl, int, int); int forgotchar_utf(char**, const w_char *, int wl, int, int); int extrachar_utf(char**, const w_char *, int wl, int, int); int badcharkey_utf(char **, const w_char *, int wl, int, int); int badchar_utf(char **, const w_char *, int wl, int, int); int swapchar_utf(char **, const w_char *, int wl, int, int); int longswapchar_utf(char **, const w_char *, int, int, int); int movechar_utf(char **, const w_char *, int, int, int); int mapchars(char**, const char *, int, int); int map_related(const char *, char *, int, int, char ** wlst, int, int, const mapentry*, int, int *, clock_t *); int ngram(int n, char * s1, const char * s2, int opt); int mystrlen(const char * word); int leftcommonsubstring(char * s1, const char * s2); int commoncharacterpositions(char * s1, const char * s2, int * is_swap); void bubblesort( char ** rwd, char ** rwd2, int * rsc, int n); void lcs(const char * s, const char * s2, int * l1, int * l2, char ** result); int lcslen(const char * s, const char* s2); char * suggest_hentry_gen(hentry * rv, char * pattern); }; #endif qt-client-4.1.0/hunspell/utf_info.cxx000066400000000000000000007211301217451700100176050ustar00rootroot00000000000000#include "csutil.hxx" /* fields: Unicode letter, toupper, tolower */ static struct unicode_info utf_lst[] = { { 0x0041, 0x0041, 0x0061 }, { 0x0042, 0x0042, 0x0062 }, { 0x0043, 0x0043, 0x0063 }, { 0x0044, 0x0044, 0x0064 }, { 0x0045, 0x0045, 0x0065 }, { 0x0046, 0x0046, 0x0066 }, { 0x0047, 0x0047, 0x0067 }, { 0x0048, 0x0048, 0x0068 }, { 0x0049, 0x0049, 0x0069 }, { 0x004A, 0x004A, 0x006A }, { 0x004B, 0x004B, 0x006B }, { 0x004C, 0x004C, 0x006C }, { 0x004D, 0x004D, 0x006D }, { 0x004E, 0x004E, 0x006E }, { 0x004F, 0x004F, 0x006F }, { 0x0050, 0x0050, 0x0070 }, { 0x0051, 0x0051, 0x0071 }, { 0x0052, 0x0052, 0x0072 }, { 0x0053, 0x0053, 0x0073 }, { 0x0054, 0x0054, 0x0074 }, { 0x0055, 0x0055, 0x0075 }, { 0x0056, 0x0056, 0x0076 }, { 0x0057, 0x0057, 0x0077 }, { 0x0058, 0x0058, 0x0078 }, { 0x0059, 0x0059, 0x0079 }, { 0x005A, 0x005A, 0x007A }, { 0x0061, 0x0041, 0x0061 }, { 0x0062, 0x0042, 0x0062 }, { 0x0063, 0x0043, 0x0063 }, { 0x0064, 0x0044, 0x0064 }, { 0x0065, 0x0045, 0x0065 }, { 0x0066, 0x0046, 0x0066 }, { 0x0067, 0x0047, 0x0067 }, { 0x0068, 0x0048, 0x0068 }, { 0x0069, 0x0049, 0x0069 }, { 0x006A, 0x004A, 0x006A }, { 0x006B, 0x004B, 0x006B }, { 0x006C, 0x004C, 0x006C }, { 0x006D, 0x004D, 0x006D }, { 0x006E, 0x004E, 0x006E }, { 0x006F, 0x004F, 0x006F }, { 0x0070, 0x0050, 0x0070 }, { 0x0071, 0x0051, 0x0071 }, { 0x0072, 0x0052, 0x0072 }, { 0x0073, 0x0053, 0x0073 }, { 0x0074, 0x0054, 0x0074 }, { 0x0075, 0x0055, 0x0075 }, { 0x0076, 0x0056, 0x0076 }, { 0x0077, 0x0057, 0x0077 }, { 0x0078, 0x0058, 0x0078 }, { 0x0079, 0x0059, 0x0079 }, { 0x007A, 0x005A, 0x007A }, { 0x00AA, 0x00AA, 0x00AA }, { 0x00B5, 0x039C, 0x00B5 }, { 0x00BA, 0x00BA, 0x00BA }, { 0x00C0, 0x00C0, 0x00E0 }, { 0x00C1, 0x00C1, 0x00E1 }, { 0x00C2, 0x00C2, 0x00E2 }, { 0x00C3, 0x00C3, 0x00E3 }, { 0x00C4, 0x00C4, 0x00E4 }, { 0x00C5, 0x00C5, 0x00E5 }, { 0x00C6, 0x00C6, 0x00E6 }, { 0x00C7, 0x00C7, 0x00E7 }, { 0x00C8, 0x00C8, 0x00E8 }, { 0x00C9, 0x00C9, 0x00E9 }, { 0x00CA, 0x00CA, 0x00EA }, { 0x00CB, 0x00CB, 0x00EB }, { 0x00CC, 0x00CC, 0x00EC }, { 0x00CD, 0x00CD, 0x00ED }, { 0x00CE, 0x00CE, 0x00EE }, { 0x00CF, 0x00CF, 0x00EF }, { 0x00D0, 0x00D0, 0x00F0 }, { 0x00D1, 0x00D1, 0x00F1 }, { 0x00D2, 0x00D2, 0x00F2 }, { 0x00D3, 0x00D3, 0x00F3 }, { 0x00D4, 0x00D4, 0x00F4 }, { 0x00D5, 0x00D5, 0x00F5 }, { 0x00D6, 0x00D6, 0x00F6 }, { 0x00D8, 0x00D8, 0x00F8 }, { 0x00D9, 0x00D9, 0x00F9 }, { 0x00DA, 0x00DA, 0x00FA }, { 0x00DB, 0x00DB, 0x00FB }, { 0x00DC, 0x00DC, 0x00FC }, { 0x00DD, 0x00DD, 0x00FD }, { 0x00DE, 0x00DE, 0x00FE }, { 0x00DF, 0x00DF, 0x00DF }, { 0x00E0, 0x00C0, 0x00E0 }, { 0x00E1, 0x00C1, 0x00E1 }, { 0x00E2, 0x00C2, 0x00E2 }, { 0x00E3, 0x00C3, 0x00E3 }, { 0x00E4, 0x00C4, 0x00E4 }, { 0x00E5, 0x00C5, 0x00E5 }, { 0x00E6, 0x00C6, 0x00E6 }, { 0x00E7, 0x00C7, 0x00E7 }, { 0x00E8, 0x00C8, 0x00E8 }, { 0x00E9, 0x00C9, 0x00E9 }, { 0x00EA, 0x00CA, 0x00EA }, { 0x00EB, 0x00CB, 0x00EB }, { 0x00EC, 0x00CC, 0x00EC }, { 0x00ED, 0x00CD, 0x00ED }, { 0x00EE, 0x00CE, 0x00EE }, { 0x00EF, 0x00CF, 0x00EF }, { 0x00F0, 0x00D0, 0x00F0 }, { 0x00F1, 0x00D1, 0x00F1 }, { 0x00F2, 0x00D2, 0x00F2 }, { 0x00F3, 0x00D3, 0x00F3 }, { 0x00F4, 0x00D4, 0x00F4 }, { 0x00F5, 0x00D5, 0x00F5 }, { 0x00F6, 0x00D6, 0x00F6 }, { 0x00F8, 0x00D8, 0x00F8 }, { 0x00F9, 0x00D9, 0x00F9 }, { 0x00FA, 0x00DA, 0x00FA }, { 0x00FB, 0x00DB, 0x00FB }, { 0x00FC, 0x00DC, 0x00FC }, { 0x00FD, 0x00DD, 0x00FD }, { 0x00FE, 0x00DE, 0x00FE }, { 0x00FF, 0x0178, 0x00FF }, { 0x0100, 0x0100, 0x0101 }, { 0x0101, 0x0100, 0x0101 }, { 0x0102, 0x0102, 0x0103 }, { 0x0103, 0x0102, 0x0103 }, { 0x0104, 0x0104, 0x0105 }, { 0x0105, 0x0104, 0x0105 }, { 0x0106, 0x0106, 0x0107 }, { 0x0107, 0x0106, 0x0107 }, { 0x0108, 0x0108, 0x0109 }, { 0x0109, 0x0108, 0x0109 }, { 0x010A, 0x010A, 0x010B }, { 0x010B, 0x010A, 0x010B }, { 0x010C, 0x010C, 0x010D }, { 0x010D, 0x010C, 0x010D }, { 0x010E, 0x010E, 0x010F }, { 0x010F, 0x010E, 0x010F }, { 0x0110, 0x0110, 0x0111 }, { 0x0111, 0x0110, 0x0111 }, { 0x0112, 0x0112, 0x0113 }, { 0x0113, 0x0112, 0x0113 }, { 0x0114, 0x0114, 0x0115 }, { 0x0115, 0x0114, 0x0115 }, { 0x0116, 0x0116, 0x0117 }, { 0x0117, 0x0116, 0x0117 }, { 0x0118, 0x0118, 0x0119 }, { 0x0119, 0x0118, 0x0119 }, { 0x011A, 0x011A, 0x011B }, { 0x011B, 0x011A, 0x011B }, { 0x011C, 0x011C, 0x011D }, { 0x011D, 0x011C, 0x011D }, { 0x011E, 0x011E, 0x011F }, { 0x011F, 0x011E, 0x011F }, { 0x0120, 0x0120, 0x0121 }, { 0x0121, 0x0120, 0x0121 }, { 0x0122, 0x0122, 0x0123 }, { 0x0123, 0x0122, 0x0123 }, { 0x0124, 0x0124, 0x0125 }, { 0x0125, 0x0124, 0x0125 }, { 0x0126, 0x0126, 0x0127 }, { 0x0127, 0x0126, 0x0127 }, { 0x0128, 0x0128, 0x0129 }, { 0x0129, 0x0128, 0x0129 }, { 0x012A, 0x012A, 0x012B }, { 0x012B, 0x012A, 0x012B }, { 0x012C, 0x012C, 0x012D }, { 0x012D, 0x012C, 0x012D }, { 0x012E, 0x012E, 0x012F }, { 0x012F, 0x012E, 0x012F }, { 0x0130, 0x0130, 0x0069 }, { 0x0131, 0x0049, 0x0131 }, { 0x0132, 0x0132, 0x0133 }, { 0x0133, 0x0132, 0x0133 }, { 0x0134, 0x0134, 0x0135 }, { 0x0135, 0x0134, 0x0135 }, { 0x0136, 0x0136, 0x0137 }, { 0x0137, 0x0136, 0x0137 }, { 0x0138, 0x0138, 0x0138 }, { 0x0139, 0x0139, 0x013A }, { 0x013A, 0x0139, 0x013A }, { 0x013B, 0x013B, 0x013C }, { 0x013C, 0x013B, 0x013C }, { 0x013D, 0x013D, 0x013E }, { 0x013E, 0x013D, 0x013E }, { 0x013F, 0x013F, 0x0140 }, { 0x0140, 0x013F, 0x0140 }, { 0x0141, 0x0141, 0x0142 }, { 0x0142, 0x0141, 0x0142 }, { 0x0143, 0x0143, 0x0144 }, { 0x0144, 0x0143, 0x0144 }, { 0x0145, 0x0145, 0x0146 }, { 0x0146, 0x0145, 0x0146 }, { 0x0147, 0x0147, 0x0148 }, { 0x0148, 0x0147, 0x0148 }, { 0x0149, 0x0149, 0x0149 }, { 0x014A, 0x014A, 0x014B }, { 0x014B, 0x014A, 0x014B }, { 0x014C, 0x014C, 0x014D }, { 0x014D, 0x014C, 0x014D }, { 0x014E, 0x014E, 0x014F }, { 0x014F, 0x014E, 0x014F }, { 0x0150, 0x0150, 0x0151 }, { 0x0151, 0x0150, 0x0151 }, { 0x0152, 0x0152, 0x0153 }, { 0x0153, 0x0152, 0x0153 }, { 0x0154, 0x0154, 0x0155 }, { 0x0155, 0x0154, 0x0155 }, { 0x0156, 0x0156, 0x0157 }, { 0x0157, 0x0156, 0x0157 }, { 0x0158, 0x0158, 0x0159 }, { 0x0159, 0x0158, 0x0159 }, { 0x015A, 0x015A, 0x015B }, { 0x015B, 0x015A, 0x015B }, { 0x015C, 0x015C, 0x015D }, { 0x015D, 0x015C, 0x015D }, { 0x015E, 0x015E, 0x015F }, { 0x015F, 0x015E, 0x015F }, { 0x0160, 0x0160, 0x0161 }, { 0x0161, 0x0160, 0x0161 }, { 0x0162, 0x0162, 0x0163 }, { 0x0163, 0x0162, 0x0163 }, { 0x0164, 0x0164, 0x0165 }, { 0x0165, 0x0164, 0x0165 }, { 0x0166, 0x0166, 0x0167 }, { 0x0167, 0x0166, 0x0167 }, { 0x0168, 0x0168, 0x0169 }, { 0x0169, 0x0168, 0x0169 }, { 0x016A, 0x016A, 0x016B }, { 0x016B, 0x016A, 0x016B }, { 0x016C, 0x016C, 0x016D }, { 0x016D, 0x016C, 0x016D }, { 0x016E, 0x016E, 0x016F }, { 0x016F, 0x016E, 0x016F }, { 0x0170, 0x0170, 0x0171 }, { 0x0171, 0x0170, 0x0171 }, { 0x0172, 0x0172, 0x0173 }, { 0x0173, 0x0172, 0x0173 }, { 0x0174, 0x0174, 0x0175 }, { 0x0175, 0x0174, 0x0175 }, { 0x0176, 0x0176, 0x0177 }, { 0x0177, 0x0176, 0x0177 }, { 0x0178, 0x0178, 0x00FF }, { 0x0179, 0x0179, 0x017A }, { 0x017A, 0x0179, 0x017A }, { 0x017B, 0x017B, 0x017C }, { 0x017C, 0x017B, 0x017C }, { 0x017D, 0x017D, 0x017E }, { 0x017E, 0x017D, 0x017E }, { 0x017F, 0x0053, 0x017F }, { 0x0180, 0x0180, 0x0180 }, { 0x0181, 0x0181, 0x0253 }, { 0x0182, 0x0182, 0x0183 }, { 0x0183, 0x0182, 0x0183 }, { 0x0184, 0x0184, 0x0185 }, { 0x0185, 0x0184, 0x0185 }, { 0x0186, 0x0186, 0x0254 }, { 0x0187, 0x0187, 0x0188 }, { 0x0188, 0x0187, 0x0188 }, { 0x0189, 0x0189, 0x0256 }, { 0x018A, 0x018A, 0x0257 }, { 0x018B, 0x018B, 0x018C }, { 0x018C, 0x018B, 0x018C }, { 0x018D, 0x018D, 0x018D }, { 0x018E, 0x018E, 0x01DD }, { 0x018F, 0x018F, 0x0259 }, { 0x0190, 0x0190, 0x025B }, { 0x0191, 0x0191, 0x0192 }, { 0x0192, 0x0191, 0x0192 }, { 0x0193, 0x0193, 0x0260 }, { 0x0194, 0x0194, 0x0263 }, { 0x0195, 0x01F6, 0x0195 }, { 0x0196, 0x0196, 0x0269 }, { 0x0197, 0x0197, 0x0268 }, { 0x0198, 0x0198, 0x0199 }, { 0x0199, 0x0198, 0x0199 }, { 0x019A, 0x023D, 0x019A }, { 0x019B, 0x019B, 0x019B }, { 0x019C, 0x019C, 0x026F }, { 0x019D, 0x019D, 0x0272 }, { 0x019E, 0x0220, 0x019E }, { 0x019F, 0x019F, 0x0275 }, { 0x01A0, 0x01A0, 0x01A1 }, { 0x01A1, 0x01A0, 0x01A1 }, { 0x01A2, 0x01A2, 0x01A3 }, { 0x01A3, 0x01A2, 0x01A3 }, { 0x01A4, 0x01A4, 0x01A5 }, { 0x01A5, 0x01A4, 0x01A5 }, { 0x01A6, 0x01A6, 0x0280 }, { 0x01A7, 0x01A7, 0x01A8 }, { 0x01A8, 0x01A7, 0x01A8 }, { 0x01A9, 0x01A9, 0x0283 }, { 0x01AA, 0x01AA, 0x01AA }, { 0x01AB, 0x01AB, 0x01AB }, { 0x01AC, 0x01AC, 0x01AD }, { 0x01AD, 0x01AC, 0x01AD }, { 0x01AE, 0x01AE, 0x0288 }, { 0x01AF, 0x01AF, 0x01B0 }, { 0x01B0, 0x01AF, 0x01B0 }, { 0x01B1, 0x01B1, 0x028A }, { 0x01B2, 0x01B2, 0x028B }, { 0x01B3, 0x01B3, 0x01B4 }, { 0x01B4, 0x01B3, 0x01B4 }, { 0x01B5, 0x01B5, 0x01B6 }, { 0x01B6, 0x01B5, 0x01B6 }, { 0x01B7, 0x01B7, 0x0292 }, { 0x01B8, 0x01B8, 0x01B9 }, { 0x01B9, 0x01B8, 0x01B9 }, { 0x01BA, 0x01BA, 0x01BA }, { 0x01BB, 0x01BB, 0x01BB }, { 0x01BC, 0x01BC, 0x01BD }, { 0x01BD, 0x01BC, 0x01BD }, { 0x01BE, 0x01BE, 0x01BE }, { 0x01BF, 0x01F7, 0x01BF }, { 0x01C0, 0x01C0, 0x01C0 }, { 0x01C1, 0x01C1, 0x01C1 }, { 0x01C2, 0x01C2, 0x01C2 }, { 0x01C3, 0x01C3, 0x01C3 }, { 0x01C4, 0x01C4, 0x01C6 }, { 0x01C5, 0x01C4, 0x01C6 }, { 0x01C6, 0x01C4, 0x01C6 }, { 0x01C7, 0x01C7, 0x01C9 }, { 0x01C8, 0x01C7, 0x01C9 }, { 0x01C9, 0x01C7, 0x01C9 }, { 0x01CA, 0x01CA, 0x01CC }, { 0x01CB, 0x01CA, 0x01CC }, { 0x01CC, 0x01CA, 0x01CC }, { 0x01CD, 0x01CD, 0x01CE }, { 0x01CE, 0x01CD, 0x01CE }, { 0x01CF, 0x01CF, 0x01D0 }, { 0x01D0, 0x01CF, 0x01D0 }, { 0x01D1, 0x01D1, 0x01D2 }, { 0x01D2, 0x01D1, 0x01D2 }, { 0x01D3, 0x01D3, 0x01D4 }, { 0x01D4, 0x01D3, 0x01D4 }, { 0x01D5, 0x01D5, 0x01D6 }, { 0x01D6, 0x01D5, 0x01D6 }, { 0x01D7, 0x01D7, 0x01D8 }, { 0x01D8, 0x01D7, 0x01D8 }, { 0x01D9, 0x01D9, 0x01DA }, { 0x01DA, 0x01D9, 0x01DA }, { 0x01DB, 0x01DB, 0x01DC }, { 0x01DC, 0x01DB, 0x01DC }, { 0x01DD, 0x018E, 0x01DD }, { 0x01DE, 0x01DE, 0x01DF }, { 0x01DF, 0x01DE, 0x01DF }, { 0x01E0, 0x01E0, 0x01E1 }, { 0x01E1, 0x01E0, 0x01E1 }, { 0x01E2, 0x01E2, 0x01E3 }, { 0x01E3, 0x01E2, 0x01E3 }, { 0x01E4, 0x01E4, 0x01E5 }, { 0x01E5, 0x01E4, 0x01E5 }, { 0x01E6, 0x01E6, 0x01E7 }, { 0x01E7, 0x01E6, 0x01E7 }, { 0x01E8, 0x01E8, 0x01E9 }, { 0x01E9, 0x01E8, 0x01E9 }, { 0x01EA, 0x01EA, 0x01EB }, { 0x01EB, 0x01EA, 0x01EB }, { 0x01EC, 0x01EC, 0x01ED }, { 0x01ED, 0x01EC, 0x01ED }, { 0x01EE, 0x01EE, 0x01EF }, { 0x01EF, 0x01EE, 0x01EF }, { 0x01F0, 0x01F0, 0x01F0 }, { 0x01F1, 0x01F1, 0x01F3 }, { 0x01F2, 0x01F1, 0x01F3 }, { 0x01F3, 0x01F1, 0x01F3 }, { 0x01F4, 0x01F4, 0x01F5 }, { 0x01F5, 0x01F4, 0x01F5 }, { 0x01F6, 0x01F6, 0x0195 }, { 0x01F7, 0x01F7, 0x01BF }, { 0x01F8, 0x01F8, 0x01F9 }, { 0x01F9, 0x01F8, 0x01F9 }, { 0x01FA, 0x01FA, 0x01FB }, { 0x01FB, 0x01FA, 0x01FB }, { 0x01FC, 0x01FC, 0x01FD }, { 0x01FD, 0x01FC, 0x01FD }, { 0x01FE, 0x01FE, 0x01FF }, { 0x01FF, 0x01FE, 0x01FF }, { 0x0200, 0x0200, 0x0201 }, { 0x0201, 0x0200, 0x0201 }, { 0x0202, 0x0202, 0x0203 }, { 0x0203, 0x0202, 0x0203 }, { 0x0204, 0x0204, 0x0205 }, { 0x0205, 0x0204, 0x0205 }, { 0x0206, 0x0206, 0x0207 }, { 0x0207, 0x0206, 0x0207 }, { 0x0208, 0x0208, 0x0209 }, { 0x0209, 0x0208, 0x0209 }, { 0x020A, 0x020A, 0x020B }, { 0x020B, 0x020A, 0x020B }, { 0x020C, 0x020C, 0x020D }, { 0x020D, 0x020C, 0x020D }, { 0x020E, 0x020E, 0x020F }, { 0x020F, 0x020E, 0x020F }, { 0x0210, 0x0210, 0x0211 }, { 0x0211, 0x0210, 0x0211 }, { 0x0212, 0x0212, 0x0213 }, { 0x0213, 0x0212, 0x0213 }, { 0x0214, 0x0214, 0x0215 }, { 0x0215, 0x0214, 0x0215 }, { 0x0216, 0x0216, 0x0217 }, { 0x0217, 0x0216, 0x0217 }, { 0x0218, 0x0218, 0x0219 }, { 0x0219, 0x0218, 0x0219 }, { 0x021A, 0x021A, 0x021B }, { 0x021B, 0x021A, 0x021B }, { 0x021C, 0x021C, 0x021D }, { 0x021D, 0x021C, 0x021D }, { 0x021E, 0x021E, 0x021F }, { 0x021F, 0x021E, 0x021F }, { 0x0220, 0x0220, 0x019E }, { 0x0221, 0x0221, 0x0221 }, { 0x0222, 0x0222, 0x0223 }, { 0x0223, 0x0222, 0x0223 }, { 0x0224, 0x0224, 0x0225 }, { 0x0225, 0x0224, 0x0225 }, { 0x0226, 0x0226, 0x0227 }, { 0x0227, 0x0226, 0x0227 }, { 0x0228, 0x0228, 0x0229 }, { 0x0229, 0x0228, 0x0229 }, { 0x022A, 0x022A, 0x022B }, { 0x022B, 0x022A, 0x022B }, { 0x022C, 0x022C, 0x022D }, { 0x022D, 0x022C, 0x022D }, { 0x022E, 0x022E, 0x022F }, { 0x022F, 0x022E, 0x022F }, { 0x0230, 0x0230, 0x0231 }, { 0x0231, 0x0230, 0x0231 }, { 0x0232, 0x0232, 0x0233 }, { 0x0233, 0x0232, 0x0233 }, { 0x0234, 0x0234, 0x0234 }, { 0x0235, 0x0235, 0x0235 }, { 0x0236, 0x0236, 0x0236 }, { 0x0237, 0x0237, 0x0237 }, { 0x0238, 0x0238, 0x0238 }, { 0x0239, 0x0239, 0x0239 }, { 0x023A, 0x023A, 0x023A }, { 0x023B, 0x023B, 0x023C }, { 0x023C, 0x023B, 0x023C }, { 0x023D, 0x023D, 0x019A }, { 0x023E, 0x023E, 0x023E }, { 0x023F, 0x023F, 0x023F }, { 0x0240, 0x0240, 0x0240 }, { 0x0241, 0x0241, 0x0294 }, { 0x0250, 0x0250, 0x0250 }, { 0x0251, 0x0251, 0x0251 }, { 0x0252, 0x0252, 0x0252 }, { 0x0253, 0x0181, 0x0253 }, { 0x0254, 0x0186, 0x0254 }, { 0x0255, 0x0255, 0x0255 }, { 0x0256, 0x0189, 0x0256 }, { 0x0257, 0x018A, 0x0257 }, { 0x0258, 0x0258, 0x0258 }, { 0x0259, 0x018F, 0x0259 }, { 0x025A, 0x025A, 0x025A }, { 0x025B, 0x0190, 0x025B }, { 0x025C, 0x025C, 0x025C }, { 0x025D, 0x025D, 0x025D }, { 0x025E, 0x025E, 0x025E }, { 0x025F, 0x025F, 0x025F }, { 0x0260, 0x0193, 0x0260 }, { 0x0261, 0x0261, 0x0261 }, { 0x0262, 0x0262, 0x0262 }, { 0x0263, 0x0194, 0x0263 }, { 0x0264, 0x0264, 0x0264 }, { 0x0265, 0x0265, 0x0265 }, { 0x0266, 0x0266, 0x0266 }, { 0x0267, 0x0267, 0x0267 }, { 0x0268, 0x0197, 0x0268 }, { 0x0269, 0x0196, 0x0269 }, { 0x026A, 0x026A, 0x026A }, { 0x026B, 0x026B, 0x026B }, { 0x026C, 0x026C, 0x026C }, { 0x026D, 0x026D, 0x026D }, { 0x026E, 0x026E, 0x026E }, { 0x026F, 0x019C, 0x026F }, { 0x0270, 0x0270, 0x0270 }, { 0x0271, 0x0271, 0x0271 }, { 0x0272, 0x019D, 0x0272 }, { 0x0273, 0x0273, 0x0273 }, { 0x0274, 0x0274, 0x0274 }, { 0x0275, 0x019F, 0x0275 }, { 0x0276, 0x0276, 0x0276 }, { 0x0277, 0x0277, 0x0277 }, { 0x0278, 0x0278, 0x0278 }, { 0x0279, 0x0279, 0x0279 }, { 0x027A, 0x027A, 0x027A }, { 0x027B, 0x027B, 0x027B }, { 0x027C, 0x027C, 0x027C }, { 0x027D, 0x027D, 0x027D }, { 0x027E, 0x027E, 0x027E }, { 0x027F, 0x027F, 0x027F }, { 0x0280, 0x01A6, 0x0280 }, { 0x0281, 0x0281, 0x0281 }, { 0x0282, 0x0282, 0x0282 }, { 0x0283, 0x01A9, 0x0283 }, { 0x0284, 0x0284, 0x0284 }, { 0x0285, 0x0285, 0x0285 }, { 0x0286, 0x0286, 0x0286 }, { 0x0287, 0x0287, 0x0287 }, { 0x0288, 0x01AE, 0x0288 }, { 0x0289, 0x0289, 0x0289 }, { 0x028A, 0x01B1, 0x028A }, { 0x028B, 0x01B2, 0x028B }, { 0x028C, 0x028C, 0x028C }, { 0x028D, 0x028D, 0x028D }, { 0x028E, 0x028E, 0x028E }, { 0x028F, 0x028F, 0x028F }, { 0x0290, 0x0290, 0x0290 }, { 0x0291, 0x0291, 0x0291 }, { 0x0292, 0x01B7, 0x0292 }, { 0x0293, 0x0293, 0x0293 }, { 0x0294, 0x0241, 0x0294 }, { 0x0295, 0x0295, 0x0295 }, { 0x0296, 0x0296, 0x0296 }, { 0x0297, 0x0297, 0x0297 }, { 0x0298, 0x0298, 0x0298 }, { 0x0299, 0x0299, 0x0299 }, { 0x029A, 0x029A, 0x029A }, { 0x029B, 0x029B, 0x029B }, { 0x029C, 0x029C, 0x029C }, { 0x029D, 0x029D, 0x029D }, { 0x029E, 0x029E, 0x029E }, { 0x029F, 0x029F, 0x029F }, { 0x02A0, 0x02A0, 0x02A0 }, { 0x02A1, 0x02A1, 0x02A1 }, { 0x02A2, 0x02A2, 0x02A2 }, { 0x02A3, 0x02A3, 0x02A3 }, { 0x02A4, 0x02A4, 0x02A4 }, { 0x02A5, 0x02A5, 0x02A5 }, { 0x02A6, 0x02A6, 0x02A6 }, { 0x02A7, 0x02A7, 0x02A7 }, { 0x02A8, 0x02A8, 0x02A8 }, { 0x02A9, 0x02A9, 0x02A9 }, { 0x02AA, 0x02AA, 0x02AA }, { 0x02AB, 0x02AB, 0x02AB }, { 0x02AC, 0x02AC, 0x02AC }, { 0x02AD, 0x02AD, 0x02AD }, { 0x02AE, 0x02AE, 0x02AE }, { 0x02AF, 0x02AF, 0x02AF }, { 0x02B0, 0x02B0, 0x02B0 }, { 0x02B1, 0x02B1, 0x02B1 }, { 0x02B2, 0x02B2, 0x02B2 }, { 0x02B3, 0x02B3, 0x02B3 }, { 0x02B4, 0x02B4, 0x02B4 }, { 0x02B5, 0x02B5, 0x02B5 }, { 0x02B6, 0x02B6, 0x02B6 }, { 0x02B7, 0x02B7, 0x02B7 }, { 0x02B8, 0x02B8, 0x02B8 }, { 0x02B9, 0x02B9, 0x02B9 }, { 0x02BA, 0x02BA, 0x02BA }, { 0x02BB, 0x02BB, 0x02BB }, { 0x02BC, 0x02BC, 0x02BC }, { 0x02BD, 0x02BD, 0x02BD }, { 0x02BE, 0x02BE, 0x02BE }, { 0x02BF, 0x02BF, 0x02BF }, { 0x02C0, 0x02C0, 0x02C0 }, { 0x02C1, 0x02C1, 0x02C1 }, { 0x02C6, 0x02C6, 0x02C6 }, { 0x02C7, 0x02C7, 0x02C7 }, { 0x02C8, 0x02C8, 0x02C8 }, { 0x02C9, 0x02C9, 0x02C9 }, { 0x02CA, 0x02CA, 0x02CA }, { 0x02CB, 0x02CB, 0x02CB }, { 0x02CC, 0x02CC, 0x02CC }, { 0x02CD, 0x02CD, 0x02CD }, { 0x02CE, 0x02CE, 0x02CE }, { 0x02CF, 0x02CF, 0x02CF }, { 0x02D0, 0x02D0, 0x02D0 }, { 0x02D1, 0x02D1, 0x02D1 }, { 0x02E0, 0x02E0, 0x02E0 }, { 0x02E1, 0x02E1, 0x02E1 }, { 0x02E2, 0x02E2, 0x02E2 }, { 0x02E3, 0x02E3, 0x02E3 }, { 0x02E4, 0x02E4, 0x02E4 }, { 0x02EE, 0x02EE, 0x02EE }, { 0x0300, 0x0300, 0x0300 }, { 0x0301, 0x0301, 0x0301 }, { 0x0302, 0x0302, 0x0302 }, { 0x0303, 0x0303, 0x0303 }, { 0x0304, 0x0304, 0x0304 }, { 0x0305, 0x0305, 0x0305 }, { 0x0306, 0x0306, 0x0306 }, { 0x0307, 0x0307, 0x0307 }, { 0x0308, 0x0308, 0x0308 }, { 0x0309, 0x0309, 0x0309 }, { 0x030A, 0x030A, 0x030A }, { 0x030B, 0x030B, 0x030B }, { 0x030C, 0x030C, 0x030C }, { 0x030D, 0x030D, 0x030D }, { 0x030E, 0x030E, 0x030E }, { 0x030F, 0x030F, 0x030F }, { 0x0310, 0x0310, 0x0310 }, { 0x0311, 0x0311, 0x0311 }, { 0x0312, 0x0312, 0x0312 }, { 0x0313, 0x0313, 0x0313 }, { 0x0314, 0x0314, 0x0314 }, { 0x0315, 0x0315, 0x0315 }, { 0x0316, 0x0316, 0x0316 }, { 0x0317, 0x0317, 0x0317 }, { 0x0318, 0x0318, 0x0318 }, { 0x0319, 0x0319, 0x0319 }, { 0x031A, 0x031A, 0x031A }, { 0x031B, 0x031B, 0x031B }, { 0x031C, 0x031C, 0x031C }, { 0x031D, 0x031D, 0x031D }, { 0x031E, 0x031E, 0x031E }, { 0x031F, 0x031F, 0x031F }, { 0x0320, 0x0320, 0x0320 }, { 0x0321, 0x0321, 0x0321 }, { 0x0322, 0x0322, 0x0322 }, { 0x0323, 0x0323, 0x0323 }, { 0x0324, 0x0324, 0x0324 }, { 0x0325, 0x0325, 0x0325 }, { 0x0326, 0x0326, 0x0326 }, { 0x0327, 0x0327, 0x0327 }, { 0x0328, 0x0328, 0x0328 }, { 0x0329, 0x0329, 0x0329 }, { 0x032A, 0x032A, 0x032A }, { 0x032B, 0x032B, 0x032B }, { 0x032C, 0x032C, 0x032C }, { 0x032D, 0x032D, 0x032D }, { 0x032E, 0x032E, 0x032E }, { 0x032F, 0x032F, 0x032F }, { 0x0330, 0x0330, 0x0330 }, { 0x0331, 0x0331, 0x0331 }, { 0x0332, 0x0332, 0x0332 }, { 0x0333, 0x0333, 0x0333 }, { 0x0334, 0x0334, 0x0334 }, { 0x0335, 0x0335, 0x0335 }, { 0x0336, 0x0336, 0x0336 }, { 0x0337, 0x0337, 0x0337 }, { 0x0338, 0x0338, 0x0338 }, { 0x0339, 0x0339, 0x0339 }, { 0x033A, 0x033A, 0x033A }, { 0x033B, 0x033B, 0x033B }, { 0x033C, 0x033C, 0x033C }, { 0x033D, 0x033D, 0x033D }, { 0x033E, 0x033E, 0x033E }, { 0x033F, 0x033F, 0x033F }, { 0x0340, 0x0340, 0x0340 }, { 0x0341, 0x0341, 0x0341 }, { 0x0342, 0x0342, 0x0342 }, { 0x0343, 0x0343, 0x0343 }, { 0x0344, 0x0344, 0x0344 }, { 0x0345, 0x0399, 0x0345 }, { 0x0346, 0x0346, 0x0346 }, { 0x0347, 0x0347, 0x0347 }, { 0x0348, 0x0348, 0x0348 }, { 0x0349, 0x0349, 0x0349 }, { 0x034A, 0x034A, 0x034A }, { 0x034B, 0x034B, 0x034B }, { 0x034C, 0x034C, 0x034C }, { 0x034D, 0x034D, 0x034D }, { 0x034E, 0x034E, 0x034E }, { 0x034F, 0x034F, 0x034F }, { 0x0350, 0x0350, 0x0350 }, { 0x0351, 0x0351, 0x0351 }, { 0x0352, 0x0352, 0x0352 }, { 0x0353, 0x0353, 0x0353 }, { 0x0354, 0x0354, 0x0354 }, { 0x0355, 0x0355, 0x0355 }, { 0x0356, 0x0356, 0x0356 }, { 0x0357, 0x0357, 0x0357 }, { 0x0358, 0x0358, 0x0358 }, { 0x0359, 0x0359, 0x0359 }, { 0x035A, 0x035A, 0x035A }, { 0x035B, 0x035B, 0x035B }, { 0x035C, 0x035C, 0x035C }, { 0x035D, 0x035D, 0x035D }, { 0x035E, 0x035E, 0x035E }, { 0x035F, 0x035F, 0x035F }, { 0x0360, 0x0360, 0x0360 }, { 0x0361, 0x0361, 0x0361 }, { 0x0362, 0x0362, 0x0362 }, { 0x0363, 0x0363, 0x0363 }, { 0x0364, 0x0364, 0x0364 }, { 0x0365, 0x0365, 0x0365 }, { 0x0366, 0x0366, 0x0366 }, { 0x0367, 0x0367, 0x0367 }, { 0x0368, 0x0368, 0x0368 }, { 0x0369, 0x0369, 0x0369 }, { 0x036A, 0x036A, 0x036A }, { 0x036B, 0x036B, 0x036B }, { 0x036C, 0x036C, 0x036C }, { 0x036D, 0x036D, 0x036D }, { 0x036E, 0x036E, 0x036E }, { 0x036F, 0x036F, 0x036F }, { 0x037A, 0x037A, 0x037A }, { 0x0386, 0x0386, 0x03AC }, { 0x0388, 0x0388, 0x03AD }, { 0x0389, 0x0389, 0x03AE }, { 0x038A, 0x038A, 0x03AF }, { 0x038C, 0x038C, 0x03CC }, { 0x038E, 0x038E, 0x03CD }, { 0x038F, 0x038F, 0x03CE }, { 0x0390, 0x0390, 0x0390 }, { 0x0391, 0x0391, 0x03B1 }, { 0x0392, 0x0392, 0x03B2 }, { 0x0393, 0x0393, 0x03B3 }, { 0x0394, 0x0394, 0x03B4 }, { 0x0395, 0x0395, 0x03B5 }, { 0x0396, 0x0396, 0x03B6 }, { 0x0397, 0x0397, 0x03B7 }, { 0x0398, 0x0398, 0x03B8 }, { 0x0399, 0x0399, 0x03B9 }, { 0x039A, 0x039A, 0x03BA }, { 0x039B, 0x039B, 0x03BB }, { 0x039C, 0x039C, 0x03BC }, { 0x039D, 0x039D, 0x03BD }, { 0x039E, 0x039E, 0x03BE }, { 0x039F, 0x039F, 0x03BF }, { 0x03A0, 0x03A0, 0x03C0 }, { 0x03A1, 0x03A1, 0x03C1 }, { 0x03A3, 0x03A3, 0x03C3 }, { 0x03A4, 0x03A4, 0x03C4 }, { 0x03A5, 0x03A5, 0x03C5 }, { 0x03A6, 0x03A6, 0x03C6 }, { 0x03A7, 0x03A7, 0x03C7 }, { 0x03A8, 0x03A8, 0x03C8 }, { 0x03A9, 0x03A9, 0x03C9 }, { 0x03AA, 0x03AA, 0x03CA }, { 0x03AB, 0x03AB, 0x03CB }, { 0x03AC, 0x0386, 0x03AC }, { 0x03AD, 0x0388, 0x03AD }, { 0x03AE, 0x0389, 0x03AE }, { 0x03AF, 0x038A, 0x03AF }, { 0x03B0, 0x03B0, 0x03B0 }, { 0x03B1, 0x0391, 0x03B1 }, { 0x03B2, 0x0392, 0x03B2 }, { 0x03B3, 0x0393, 0x03B3 }, { 0x03B4, 0x0394, 0x03B4 }, { 0x03B5, 0x0395, 0x03B5 }, { 0x03B6, 0x0396, 0x03B6 }, { 0x03B7, 0x0397, 0x03B7 }, { 0x03B8, 0x0398, 0x03B8 }, { 0x03B9, 0x0399, 0x03B9 }, { 0x03BA, 0x039A, 0x03BA }, { 0x03BB, 0x039B, 0x03BB }, { 0x03BC, 0x039C, 0x03BC }, { 0x03BD, 0x039D, 0x03BD }, { 0x03BE, 0x039E, 0x03BE }, { 0x03BF, 0x039F, 0x03BF }, { 0x03C0, 0x03A0, 0x03C0 }, { 0x03C1, 0x03A1, 0x03C1 }, { 0x03C2, 0x03A3, 0x03C2 }, { 0x03C3, 0x03A3, 0x03C3 }, { 0x03C4, 0x03A4, 0x03C4 }, { 0x03C5, 0x03A5, 0x03C5 }, { 0x03C6, 0x03A6, 0x03C6 }, { 0x03C7, 0x03A7, 0x03C7 }, { 0x03C8, 0x03A8, 0x03C8 }, { 0x03C9, 0x03A9, 0x03C9 }, { 0x03CA, 0x03AA, 0x03CA }, { 0x03CB, 0x03AB, 0x03CB }, { 0x03CC, 0x038C, 0x03CC }, { 0x03CD, 0x038E, 0x03CD }, { 0x03CE, 0x038F, 0x03CE }, { 0x03D0, 0x0392, 0x03D0 }, { 0x03D1, 0x0398, 0x03D1 }, { 0x03D2, 0x03D2, 0x03D2 }, { 0x03D3, 0x03D3, 0x03D3 }, { 0x03D4, 0x03D4, 0x03D4 }, { 0x03D5, 0x03A6, 0x03D5 }, { 0x03D6, 0x03A0, 0x03D6 }, { 0x03D7, 0x03D7, 0x03D7 }, { 0x03D8, 0x03D8, 0x03D9 }, { 0x03D9, 0x03D8, 0x03D9 }, { 0x03DA, 0x03DA, 0x03DB }, { 0x03DB, 0x03DA, 0x03DB }, { 0x03DC, 0x03DC, 0x03DD }, { 0x03DD, 0x03DC, 0x03DD }, { 0x03DE, 0x03DE, 0x03DF }, { 0x03DF, 0x03DE, 0x03DF }, { 0x03E0, 0x03E0, 0x03E1 }, { 0x03E1, 0x03E0, 0x03E1 }, { 0x03E2, 0x03E2, 0x03E3 }, { 0x03E3, 0x03E2, 0x03E3 }, { 0x03E4, 0x03E4, 0x03E5 }, { 0x03E5, 0x03E4, 0x03E5 }, { 0x03E6, 0x03E6, 0x03E7 }, { 0x03E7, 0x03E6, 0x03E7 }, { 0x03E8, 0x03E8, 0x03E9 }, { 0x03E9, 0x03E8, 0x03E9 }, { 0x03EA, 0x03EA, 0x03EB }, { 0x03EB, 0x03EA, 0x03EB }, { 0x03EC, 0x03EC, 0x03ED }, { 0x03ED, 0x03EC, 0x03ED }, { 0x03EE, 0x03EE, 0x03EF }, { 0x03EF, 0x03EE, 0x03EF }, { 0x03F0, 0x039A, 0x03F0 }, { 0x03F1, 0x03A1, 0x03F1 }, { 0x03F2, 0x03F9, 0x03F2 }, { 0x03F3, 0x03F3, 0x03F3 }, { 0x03F4, 0x03F4, 0x03B8 }, { 0x03F5, 0x0395, 0x03F5 }, { 0x03F7, 0x03F7, 0x03F8 }, { 0x03F8, 0x03F7, 0x03F8 }, { 0x03F9, 0x03F9, 0x03F2 }, { 0x03FA, 0x03FA, 0x03FB }, { 0x03FB, 0x03FA, 0x03FB }, { 0x03FC, 0x03FC, 0x03FC }, { 0x03FD, 0x03FD, 0x03FD }, { 0x03FE, 0x03FE, 0x03FE }, { 0x03FF, 0x03FF, 0x03FF }, { 0x0400, 0x0400, 0x0450 }, { 0x0401, 0x0401, 0x0451 }, { 0x0402, 0x0402, 0x0452 }, { 0x0403, 0x0403, 0x0453 }, { 0x0404, 0x0404, 0x0454 }, { 0x0405, 0x0405, 0x0455 }, { 0x0406, 0x0406, 0x0456 }, { 0x0407, 0x0407, 0x0457 }, { 0x0408, 0x0408, 0x0458 }, { 0x0409, 0x0409, 0x0459 }, { 0x040A, 0x040A, 0x045A }, { 0x040B, 0x040B, 0x045B }, { 0x040C, 0x040C, 0x045C }, { 0x040D, 0x040D, 0x045D }, { 0x040E, 0x040E, 0x045E }, { 0x040F, 0x040F, 0x045F }, { 0x0410, 0x0410, 0x0430 }, { 0x0411, 0x0411, 0x0431 }, { 0x0412, 0x0412, 0x0432 }, { 0x0413, 0x0413, 0x0433 }, { 0x0414, 0x0414, 0x0434 }, { 0x0415, 0x0415, 0x0435 }, { 0x0416, 0x0416, 0x0436 }, { 0x0417, 0x0417, 0x0437 }, { 0x0418, 0x0418, 0x0438 }, { 0x0419, 0x0419, 0x0439 }, { 0x041A, 0x041A, 0x043A }, { 0x041B, 0x041B, 0x043B }, { 0x041C, 0x041C, 0x043C }, { 0x041D, 0x041D, 0x043D }, { 0x041E, 0x041E, 0x043E }, { 0x041F, 0x041F, 0x043F }, { 0x0420, 0x0420, 0x0440 }, { 0x0421, 0x0421, 0x0441 }, { 0x0422, 0x0422, 0x0442 }, { 0x0423, 0x0423, 0x0443 }, { 0x0424, 0x0424, 0x0444 }, { 0x0425, 0x0425, 0x0445 }, { 0x0426, 0x0426, 0x0446 }, { 0x0427, 0x0427, 0x0447 }, { 0x0428, 0x0428, 0x0448 }, { 0x0429, 0x0429, 0x0449 }, { 0x042A, 0x042A, 0x044A }, { 0x042B, 0x042B, 0x044B }, { 0x042C, 0x042C, 0x044C }, { 0x042D, 0x042D, 0x044D }, { 0x042E, 0x042E, 0x044E }, { 0x042F, 0x042F, 0x044F }, { 0x0430, 0x0410, 0x0430 }, { 0x0431, 0x0411, 0x0431 }, { 0x0432, 0x0412, 0x0432 }, { 0x0433, 0x0413, 0x0433 }, { 0x0434, 0x0414, 0x0434 }, { 0x0435, 0x0415, 0x0435 }, { 0x0436, 0x0416, 0x0436 }, { 0x0437, 0x0417, 0x0437 }, { 0x0438, 0x0418, 0x0438 }, { 0x0439, 0x0419, 0x0439 }, { 0x043A, 0x041A, 0x043A }, { 0x043B, 0x041B, 0x043B }, { 0x043C, 0x041C, 0x043C }, { 0x043D, 0x041D, 0x043D }, { 0x043E, 0x041E, 0x043E }, { 0x043F, 0x041F, 0x043F }, { 0x0440, 0x0420, 0x0440 }, { 0x0441, 0x0421, 0x0441 }, { 0x0442, 0x0422, 0x0442 }, { 0x0443, 0x0423, 0x0443 }, { 0x0444, 0x0424, 0x0444 }, { 0x0445, 0x0425, 0x0445 }, { 0x0446, 0x0426, 0x0446 }, { 0x0447, 0x0427, 0x0447 }, { 0x0448, 0x0428, 0x0448 }, { 0x0449, 0x0429, 0x0449 }, { 0x044A, 0x042A, 0x044A }, { 0x044B, 0x042B, 0x044B }, { 0x044C, 0x042C, 0x044C }, { 0x044D, 0x042D, 0x044D }, { 0x044E, 0x042E, 0x044E }, { 0x044F, 0x042F, 0x044F }, { 0x0450, 0x0400, 0x0450 }, { 0x0451, 0x0401, 0x0451 }, { 0x0452, 0x0402, 0x0452 }, { 0x0453, 0x0403, 0x0453 }, { 0x0454, 0x0404, 0x0454 }, { 0x0455, 0x0405, 0x0455 }, { 0x0456, 0x0406, 0x0456 }, { 0x0457, 0x0407, 0x0457 }, { 0x0458, 0x0408, 0x0458 }, { 0x0459, 0x0409, 0x0459 }, { 0x045A, 0x040A, 0x045A }, { 0x045B, 0x040B, 0x045B }, { 0x045C, 0x040C, 0x045C }, { 0x045D, 0x040D, 0x045D }, { 0x045E, 0x040E, 0x045E }, { 0x045F, 0x040F, 0x045F }, { 0x0460, 0x0460, 0x0461 }, { 0x0461, 0x0460, 0x0461 }, { 0x0462, 0x0462, 0x0463 }, { 0x0463, 0x0462, 0x0463 }, { 0x0464, 0x0464, 0x0465 }, { 0x0465, 0x0464, 0x0465 }, { 0x0466, 0x0466, 0x0467 }, { 0x0467, 0x0466, 0x0467 }, { 0x0468, 0x0468, 0x0469 }, { 0x0469, 0x0468, 0x0469 }, { 0x046A, 0x046A, 0x046B }, { 0x046B, 0x046A, 0x046B }, { 0x046C, 0x046C, 0x046D }, { 0x046D, 0x046C, 0x046D }, { 0x046E, 0x046E, 0x046F }, { 0x046F, 0x046E, 0x046F }, { 0x0470, 0x0470, 0x0471 }, { 0x0471, 0x0470, 0x0471 }, { 0x0472, 0x0472, 0x0473 }, { 0x0473, 0x0472, 0x0473 }, { 0x0474, 0x0474, 0x0475 }, { 0x0475, 0x0474, 0x0475 }, { 0x0476, 0x0476, 0x0477 }, { 0x0477, 0x0476, 0x0477 }, { 0x0478, 0x0478, 0x0479 }, { 0x0479, 0x0478, 0x0479 }, { 0x047A, 0x047A, 0x047B }, { 0x047B, 0x047A, 0x047B }, { 0x047C, 0x047C, 0x047D }, { 0x047D, 0x047C, 0x047D }, { 0x047E, 0x047E, 0x047F }, { 0x047F, 0x047E, 0x047F }, { 0x0480, 0x0480, 0x0481 }, { 0x0481, 0x0480, 0x0481 }, { 0x0483, 0x0483, 0x0483 }, { 0x0484, 0x0484, 0x0484 }, { 0x0485, 0x0485, 0x0485 }, { 0x0486, 0x0486, 0x0486 }, { 0x048A, 0x048A, 0x048B }, { 0x048B, 0x048A, 0x048B }, { 0x048C, 0x048C, 0x048D }, { 0x048D, 0x048C, 0x048D }, { 0x048E, 0x048E, 0x048F }, { 0x048F, 0x048E, 0x048F }, { 0x0490, 0x0490, 0x0491 }, { 0x0491, 0x0490, 0x0491 }, { 0x0492, 0x0492, 0x0493 }, { 0x0493, 0x0492, 0x0493 }, { 0x0494, 0x0494, 0x0495 }, { 0x0495, 0x0494, 0x0495 }, { 0x0496, 0x0496, 0x0497 }, { 0x0497, 0x0496, 0x0497 }, { 0x0498, 0x0498, 0x0499 }, { 0x0499, 0x0498, 0x0499 }, { 0x049A, 0x049A, 0x049B }, { 0x049B, 0x049A, 0x049B }, { 0x049C, 0x049C, 0x049D }, { 0x049D, 0x049C, 0x049D }, { 0x049E, 0x049E, 0x049F }, { 0x049F, 0x049E, 0x049F }, { 0x04A0, 0x04A0, 0x04A1 }, { 0x04A1, 0x04A0, 0x04A1 }, { 0x04A2, 0x04A2, 0x04A3 }, { 0x04A3, 0x04A2, 0x04A3 }, { 0x04A4, 0x04A4, 0x04A5 }, { 0x04A5, 0x04A4, 0x04A5 }, { 0x04A6, 0x04A6, 0x04A7 }, { 0x04A7, 0x04A6, 0x04A7 }, { 0x04A8, 0x04A8, 0x04A9 }, { 0x04A9, 0x04A8, 0x04A9 }, { 0x04AA, 0x04AA, 0x04AB }, { 0x04AB, 0x04AA, 0x04AB }, { 0x04AC, 0x04AC, 0x04AD }, { 0x04AD, 0x04AC, 0x04AD }, { 0x04AE, 0x04AE, 0x04AF }, { 0x04AF, 0x04AE, 0x04AF }, { 0x04B0, 0x04B0, 0x04B1 }, { 0x04B1, 0x04B0, 0x04B1 }, { 0x04B2, 0x04B2, 0x04B3 }, { 0x04B3, 0x04B2, 0x04B3 }, { 0x04B4, 0x04B4, 0x04B5 }, { 0x04B5, 0x04B4, 0x04B5 }, { 0x04B6, 0x04B6, 0x04B7 }, { 0x04B7, 0x04B6, 0x04B7 }, { 0x04B8, 0x04B8, 0x04B9 }, { 0x04B9, 0x04B8, 0x04B9 }, { 0x04BA, 0x04BA, 0x04BB }, { 0x04BB, 0x04BA, 0x04BB }, { 0x04BC, 0x04BC, 0x04BD }, { 0x04BD, 0x04BC, 0x04BD }, { 0x04BE, 0x04BE, 0x04BF }, { 0x04BF, 0x04BE, 0x04BF }, { 0x04C0, 0x04C0, 0x04C0 }, { 0x04C1, 0x04C1, 0x04C2 }, { 0x04C2, 0x04C1, 0x04C2 }, { 0x04C3, 0x04C3, 0x04C4 }, { 0x04C4, 0x04C3, 0x04C4 }, { 0x04C5, 0x04C5, 0x04C6 }, { 0x04C6, 0x04C5, 0x04C6 }, { 0x04C7, 0x04C7, 0x04C8 }, { 0x04C8, 0x04C7, 0x04C8 }, { 0x04C9, 0x04C9, 0x04CA }, { 0x04CA, 0x04C9, 0x04CA }, { 0x04CB, 0x04CB, 0x04CC }, { 0x04CC, 0x04CB, 0x04CC }, { 0x04CD, 0x04CD, 0x04CE }, { 0x04CE, 0x04CD, 0x04CE }, { 0x04D0, 0x04D0, 0x04D1 }, { 0x04D1, 0x04D0, 0x04D1 }, { 0x04D2, 0x04D2, 0x04D3 }, { 0x04D3, 0x04D2, 0x04D3 }, { 0x04D4, 0x04D4, 0x04D5 }, { 0x04D5, 0x04D4, 0x04D5 }, { 0x04D6, 0x04D6, 0x04D7 }, { 0x04D7, 0x04D6, 0x04D7 }, { 0x04D8, 0x04D8, 0x04D9 }, { 0x04D9, 0x04D8, 0x04D9 }, { 0x04DA, 0x04DA, 0x04DB }, { 0x04DB, 0x04DA, 0x04DB }, { 0x04DC, 0x04DC, 0x04DD }, { 0x04DD, 0x04DC, 0x04DD }, { 0x04DE, 0x04DE, 0x04DF }, { 0x04DF, 0x04DE, 0x04DF }, { 0x04E0, 0x04E0, 0x04E1 }, { 0x04E1, 0x04E0, 0x04E1 }, { 0x04E2, 0x04E2, 0x04E3 }, { 0x04E3, 0x04E2, 0x04E3 }, { 0x04E4, 0x04E4, 0x04E5 }, { 0x04E5, 0x04E4, 0x04E5 }, { 0x04E6, 0x04E6, 0x04E7 }, { 0x04E7, 0x04E6, 0x04E7 }, { 0x04E8, 0x04E8, 0x04E9 }, { 0x04E9, 0x04E8, 0x04E9 }, { 0x04EA, 0x04EA, 0x04EB }, { 0x04EB, 0x04EA, 0x04EB }, { 0x04EC, 0x04EC, 0x04ED }, { 0x04ED, 0x04EC, 0x04ED }, { 0x04EE, 0x04EE, 0x04EF }, { 0x04EF, 0x04EE, 0x04EF }, { 0x04F0, 0x04F0, 0x04F1 }, { 0x04F1, 0x04F0, 0x04F1 }, { 0x04F2, 0x04F2, 0x04F3 }, { 0x04F3, 0x04F2, 0x04F3 }, { 0x04F4, 0x04F4, 0x04F5 }, { 0x04F5, 0x04F4, 0x04F5 }, { 0x04F6, 0x04F6, 0x04F7 }, { 0x04F7, 0x04F6, 0x04F7 }, { 0x04F8, 0x04F8, 0x04F9 }, { 0x04F9, 0x04F8, 0x04F9 }, { 0x0500, 0x0500, 0x0501 }, { 0x0501, 0x0500, 0x0501 }, { 0x0502, 0x0502, 0x0503 }, { 0x0503, 0x0502, 0x0503 }, { 0x0504, 0x0504, 0x0505 }, { 0x0505, 0x0504, 0x0505 }, { 0x0506, 0x0506, 0x0507 }, { 0x0507, 0x0506, 0x0507 }, { 0x0508, 0x0508, 0x0509 }, { 0x0509, 0x0508, 0x0509 }, { 0x050A, 0x050A, 0x050B }, { 0x050B, 0x050A, 0x050B }, { 0x050C, 0x050C, 0x050D }, { 0x050D, 0x050C, 0x050D }, { 0x050E, 0x050E, 0x050F }, { 0x050F, 0x050E, 0x050F }, { 0x0531, 0x0531, 0x0561 }, { 0x0532, 0x0532, 0x0562 }, { 0x0533, 0x0533, 0x0563 }, { 0x0534, 0x0534, 0x0564 }, { 0x0535, 0x0535, 0x0565 }, { 0x0536, 0x0536, 0x0566 }, { 0x0537, 0x0537, 0x0567 }, { 0x0538, 0x0538, 0x0568 }, { 0x0539, 0x0539, 0x0569 }, { 0x053A, 0x053A, 0x056A }, { 0x053B, 0x053B, 0x056B }, { 0x053C, 0x053C, 0x056C }, { 0x053D, 0x053D, 0x056D }, { 0x053E, 0x053E, 0x056E }, { 0x053F, 0x053F, 0x056F }, { 0x0540, 0x0540, 0x0570 }, { 0x0541, 0x0541, 0x0571 }, { 0x0542, 0x0542, 0x0572 }, { 0x0543, 0x0543, 0x0573 }, { 0x0544, 0x0544, 0x0574 }, { 0x0545, 0x0545, 0x0575 }, { 0x0546, 0x0546, 0x0576 }, { 0x0547, 0x0547, 0x0577 }, { 0x0548, 0x0548, 0x0578 }, { 0x0549, 0x0549, 0x0579 }, { 0x054A, 0x054A, 0x057A }, { 0x054B, 0x054B, 0x057B }, { 0x054C, 0x054C, 0x057C }, { 0x054D, 0x054D, 0x057D }, { 0x054E, 0x054E, 0x057E }, { 0x054F, 0x054F, 0x057F }, { 0x0550, 0x0550, 0x0580 }, { 0x0551, 0x0551, 0x0581 }, { 0x0552, 0x0552, 0x0582 }, { 0x0553, 0x0553, 0x0583 }, { 0x0554, 0x0554, 0x0584 }, { 0x0555, 0x0555, 0x0585 }, { 0x0556, 0x0556, 0x0586 }, { 0x0559, 0x0559, 0x0559 }, { 0x0561, 0x0531, 0x0561 }, { 0x0562, 0x0532, 0x0562 }, { 0x0563, 0x0533, 0x0563 }, { 0x0564, 0x0534, 0x0564 }, { 0x0565, 0x0535, 0x0565 }, { 0x0566, 0x0536, 0x0566 }, { 0x0567, 0x0537, 0x0567 }, { 0x0568, 0x0538, 0x0568 }, { 0x0569, 0x0539, 0x0569 }, { 0x056A, 0x053A, 0x056A }, { 0x056B, 0x053B, 0x056B }, { 0x056C, 0x053C, 0x056C }, { 0x056D, 0x053D, 0x056D }, { 0x056E, 0x053E, 0x056E }, { 0x056F, 0x053F, 0x056F }, { 0x0570, 0x0540, 0x0570 }, { 0x0571, 0x0541, 0x0571 }, { 0x0572, 0x0542, 0x0572 }, { 0x0573, 0x0543, 0x0573 }, { 0x0574, 0x0544, 0x0574 }, { 0x0575, 0x0545, 0x0575 }, { 0x0576, 0x0546, 0x0576 }, { 0x0577, 0x0547, 0x0577 }, { 0x0578, 0x0548, 0x0578 }, { 0x0579, 0x0549, 0x0579 }, { 0x057A, 0x054A, 0x057A }, { 0x057B, 0x054B, 0x057B }, { 0x057C, 0x054C, 0x057C }, { 0x057D, 0x054D, 0x057D }, { 0x057E, 0x054E, 0x057E }, { 0x057F, 0x054F, 0x057F }, { 0x0580, 0x0550, 0x0580 }, { 0x0581, 0x0551, 0x0581 }, { 0x0582, 0x0552, 0x0582 }, { 0x0583, 0x0553, 0x0583 }, { 0x0584, 0x0554, 0x0584 }, { 0x0585, 0x0555, 0x0585 }, { 0x0586, 0x0556, 0x0586 }, { 0x0587, 0x0587, 0x0587 }, { 0x0591, 0x0591, 0x0591 }, { 0x0592, 0x0592, 0x0592 }, { 0x0593, 0x0593, 0x0593 }, { 0x0594, 0x0594, 0x0594 }, { 0x0595, 0x0595, 0x0595 }, { 0x0596, 0x0596, 0x0596 }, { 0x0597, 0x0597, 0x0597 }, { 0x0598, 0x0598, 0x0598 }, { 0x0599, 0x0599, 0x0599 }, { 0x059A, 0x059A, 0x059A }, { 0x059B, 0x059B, 0x059B }, { 0x059C, 0x059C, 0x059C }, { 0x059D, 0x059D, 0x059D }, { 0x059E, 0x059E, 0x059E }, { 0x059F, 0x059F, 0x059F }, { 0x05A0, 0x05A0, 0x05A0 }, { 0x05A1, 0x05A1, 0x05A1 }, { 0x05A2, 0x05A2, 0x05A2 }, { 0x05A3, 0x05A3, 0x05A3 }, { 0x05A4, 0x05A4, 0x05A4 }, { 0x05A5, 0x05A5, 0x05A5 }, { 0x05A6, 0x05A6, 0x05A6 }, { 0x05A7, 0x05A7, 0x05A7 }, { 0x05A8, 0x05A8, 0x05A8 }, { 0x05A9, 0x05A9, 0x05A9 }, { 0x05AA, 0x05AA, 0x05AA }, { 0x05AB, 0x05AB, 0x05AB }, { 0x05AC, 0x05AC, 0x05AC }, { 0x05AD, 0x05AD, 0x05AD }, { 0x05AE, 0x05AE, 0x05AE }, { 0x05AF, 0x05AF, 0x05AF }, { 0x05B0, 0x05B0, 0x05B0 }, { 0x05B1, 0x05B1, 0x05B1 }, { 0x05B2, 0x05B2, 0x05B2 }, { 0x05B3, 0x05B3, 0x05B3 }, { 0x05B4, 0x05B4, 0x05B4 }, { 0x05B5, 0x05B5, 0x05B5 }, { 0x05B6, 0x05B6, 0x05B6 }, { 0x05B7, 0x05B7, 0x05B7 }, { 0x05B8, 0x05B8, 0x05B8 }, { 0x05B9, 0x05B9, 0x05B9 }, { 0x05BB, 0x05BB, 0x05BB }, { 0x05BC, 0x05BC, 0x05BC }, { 0x05BD, 0x05BD, 0x05BD }, { 0x05BF, 0x05BF, 0x05BF }, { 0x05C1, 0x05C1, 0x05C1 }, { 0x05C2, 0x05C2, 0x05C2 }, { 0x05C4, 0x05C4, 0x05C4 }, { 0x05C5, 0x05C5, 0x05C5 }, { 0x05C7, 0x05C7, 0x05C7 }, { 0x05D0, 0x05D0, 0x05D0 }, { 0x05D1, 0x05D1, 0x05D1 }, { 0x05D2, 0x05D2, 0x05D2 }, { 0x05D3, 0x05D3, 0x05D3 }, { 0x05D4, 0x05D4, 0x05D4 }, { 0x05D5, 0x05D5, 0x05D5 }, { 0x05D6, 0x05D6, 0x05D6 }, { 0x05D7, 0x05D7, 0x05D7 }, { 0x05D8, 0x05D8, 0x05D8 }, { 0x05D9, 0x05D9, 0x05D9 }, { 0x05DA, 0x05DA, 0x05DA }, { 0x05DB, 0x05DB, 0x05DB }, { 0x05DC, 0x05DC, 0x05DC }, { 0x05DD, 0x05DD, 0x05DD }, { 0x05DE, 0x05DE, 0x05DE }, { 0x05DF, 0x05DF, 0x05DF }, { 0x05E0, 0x05E0, 0x05E0 }, { 0x05E1, 0x05E1, 0x05E1 }, { 0x05E2, 0x05E2, 0x05E2 }, { 0x05E3, 0x05E3, 0x05E3 }, { 0x05E4, 0x05E4, 0x05E4 }, { 0x05E5, 0x05E5, 0x05E5 }, { 0x05E6, 0x05E6, 0x05E6 }, { 0x05E7, 0x05E7, 0x05E7 }, { 0x05E8, 0x05E8, 0x05E8 }, { 0x05E9, 0x05E9, 0x05E9 }, { 0x05EA, 0x05EA, 0x05EA }, { 0x05F0, 0x05F0, 0x05F0 }, { 0x05F1, 0x05F1, 0x05F1 }, { 0x05F2, 0x05F2, 0x05F2 }, { 0x0610, 0x0610, 0x0610 }, { 0x0611, 0x0611, 0x0611 }, { 0x0612, 0x0612, 0x0612 }, { 0x0613, 0x0613, 0x0613 }, { 0x0614, 0x0614, 0x0614 }, { 0x0615, 0x0615, 0x0615 }, { 0x0621, 0x0621, 0x0621 }, { 0x0622, 0x0622, 0x0622 }, { 0x0623, 0x0623, 0x0623 }, { 0x0624, 0x0624, 0x0624 }, { 0x0625, 0x0625, 0x0625 }, { 0x0626, 0x0626, 0x0626 }, { 0x0627, 0x0627, 0x0627 }, { 0x0628, 0x0628, 0x0628 }, { 0x0629, 0x0629, 0x0629 }, { 0x062A, 0x062A, 0x062A }, { 0x062B, 0x062B, 0x062B }, { 0x062C, 0x062C, 0x062C }, { 0x062D, 0x062D, 0x062D }, { 0x062E, 0x062E, 0x062E }, { 0x062F, 0x062F, 0x062F }, { 0x0630, 0x0630, 0x0630 }, { 0x0631, 0x0631, 0x0631 }, { 0x0632, 0x0632, 0x0632 }, { 0x0633, 0x0633, 0x0633 }, { 0x0634, 0x0634, 0x0634 }, { 0x0635, 0x0635, 0x0635 }, { 0x0636, 0x0636, 0x0636 }, { 0x0637, 0x0637, 0x0637 }, { 0x0638, 0x0638, 0x0638 }, { 0x0639, 0x0639, 0x0639 }, { 0x063A, 0x063A, 0x063A }, { 0x0640, 0x0640, 0x0640 }, { 0x0641, 0x0641, 0x0641 }, { 0x0642, 0x0642, 0x0642 }, { 0x0643, 0x0643, 0x0643 }, { 0x0644, 0x0644, 0x0644 }, { 0x0645, 0x0645, 0x0645 }, { 0x0646, 0x0646, 0x0646 }, { 0x0647, 0x0647, 0x0647 }, { 0x0648, 0x0648, 0x0648 }, { 0x0649, 0x0649, 0x0649 }, { 0x064A, 0x064A, 0x064A }, { 0x064B, 0x064B, 0x064B }, { 0x064C, 0x064C, 0x064C }, { 0x064D, 0x064D, 0x064D }, { 0x064E, 0x064E, 0x064E }, { 0x064F, 0x064F, 0x064F }, { 0x0650, 0x0650, 0x0650 }, { 0x0651, 0x0651, 0x0651 }, { 0x0652, 0x0652, 0x0652 }, { 0x0653, 0x0653, 0x0653 }, { 0x0654, 0x0654, 0x0654 }, { 0x0655, 0x0655, 0x0655 }, { 0x0656, 0x0656, 0x0656 }, { 0x0657, 0x0657, 0x0657 }, { 0x0658, 0x0658, 0x0658 }, { 0x0659, 0x0659, 0x0659 }, { 0x065A, 0x065A, 0x065A }, { 0x065B, 0x065B, 0x065B }, { 0x065C, 0x065C, 0x065C }, { 0x065D, 0x065D, 0x065D }, { 0x065E, 0x065E, 0x065E }, { 0x066E, 0x066E, 0x066E }, { 0x066F, 0x066F, 0x066F }, { 0x0670, 0x0670, 0x0670 }, { 0x0671, 0x0671, 0x0671 }, { 0x0672, 0x0672, 0x0672 }, { 0x0673, 0x0673, 0x0673 }, { 0x0674, 0x0674, 0x0674 }, { 0x0675, 0x0675, 0x0675 }, { 0x0676, 0x0676, 0x0676 }, { 0x0677, 0x0677, 0x0677 }, { 0x0678, 0x0678, 0x0678 }, { 0x0679, 0x0679, 0x0679 }, { 0x067A, 0x067A, 0x067A }, { 0x067B, 0x067B, 0x067B }, { 0x067C, 0x067C, 0x067C }, { 0x067D, 0x067D, 0x067D }, { 0x067E, 0x067E, 0x067E }, { 0x067F, 0x067F, 0x067F }, { 0x0680, 0x0680, 0x0680 }, { 0x0681, 0x0681, 0x0681 }, { 0x0682, 0x0682, 0x0682 }, { 0x0683, 0x0683, 0x0683 }, { 0x0684, 0x0684, 0x0684 }, { 0x0685, 0x0685, 0x0685 }, { 0x0686, 0x0686, 0x0686 }, { 0x0687, 0x0687, 0x0687 }, { 0x0688, 0x0688, 0x0688 }, { 0x0689, 0x0689, 0x0689 }, { 0x068A, 0x068A, 0x068A }, { 0x068B, 0x068B, 0x068B }, { 0x068C, 0x068C, 0x068C }, { 0x068D, 0x068D, 0x068D }, { 0x068E, 0x068E, 0x068E }, { 0x068F, 0x068F, 0x068F }, { 0x0690, 0x0690, 0x0690 }, { 0x0691, 0x0691, 0x0691 }, { 0x0692, 0x0692, 0x0692 }, { 0x0693, 0x0693, 0x0693 }, { 0x0694, 0x0694, 0x0694 }, { 0x0695, 0x0695, 0x0695 }, { 0x0696, 0x0696, 0x0696 }, { 0x0697, 0x0697, 0x0697 }, { 0x0698, 0x0698, 0x0698 }, { 0x0699, 0x0699, 0x0699 }, { 0x069A, 0x069A, 0x069A }, { 0x069B, 0x069B, 0x069B }, { 0x069C, 0x069C, 0x069C }, { 0x069D, 0x069D, 0x069D }, { 0x069E, 0x069E, 0x069E }, { 0x069F, 0x069F, 0x069F }, { 0x06A0, 0x06A0, 0x06A0 }, { 0x06A1, 0x06A1, 0x06A1 }, { 0x06A2, 0x06A2, 0x06A2 }, { 0x06A3, 0x06A3, 0x06A3 }, { 0x06A4, 0x06A4, 0x06A4 }, { 0x06A5, 0x06A5, 0x06A5 }, { 0x06A6, 0x06A6, 0x06A6 }, { 0x06A7, 0x06A7, 0x06A7 }, { 0x06A8, 0x06A8, 0x06A8 }, { 0x06A9, 0x06A9, 0x06A9 }, { 0x06AA, 0x06AA, 0x06AA }, { 0x06AB, 0x06AB, 0x06AB }, { 0x06AC, 0x06AC, 0x06AC }, { 0x06AD, 0x06AD, 0x06AD }, { 0x06AE, 0x06AE, 0x06AE }, { 0x06AF, 0x06AF, 0x06AF }, { 0x06B0, 0x06B0, 0x06B0 }, { 0x06B1, 0x06B1, 0x06B1 }, { 0x06B2, 0x06B2, 0x06B2 }, { 0x06B3, 0x06B3, 0x06B3 }, { 0x06B4, 0x06B4, 0x06B4 }, { 0x06B5, 0x06B5, 0x06B5 }, { 0x06B6, 0x06B6, 0x06B6 }, { 0x06B7, 0x06B7, 0x06B7 }, { 0x06B8, 0x06B8, 0x06B8 }, { 0x06B9, 0x06B9, 0x06B9 }, { 0x06BA, 0x06BA, 0x06BA }, { 0x06BB, 0x06BB, 0x06BB }, { 0x06BC, 0x06BC, 0x06BC }, { 0x06BD, 0x06BD, 0x06BD }, { 0x06BE, 0x06BE, 0x06BE }, { 0x06BF, 0x06BF, 0x06BF }, { 0x06C0, 0x06C0, 0x06C0 }, { 0x06C1, 0x06C1, 0x06C1 }, { 0x06C2, 0x06C2, 0x06C2 }, { 0x06C3, 0x06C3, 0x06C3 }, { 0x06C4, 0x06C4, 0x06C4 }, { 0x06C5, 0x06C5, 0x06C5 }, { 0x06C6, 0x06C6, 0x06C6 }, { 0x06C7, 0x06C7, 0x06C7 }, { 0x06C8, 0x06C8, 0x06C8 }, { 0x06C9, 0x06C9, 0x06C9 }, { 0x06CA, 0x06CA, 0x06CA }, { 0x06CB, 0x06CB, 0x06CB }, { 0x06CC, 0x06CC, 0x06CC }, { 0x06CD, 0x06CD, 0x06CD }, { 0x06CE, 0x06CE, 0x06CE }, { 0x06CF, 0x06CF, 0x06CF }, { 0x06D0, 0x06D0, 0x06D0 }, { 0x06D1, 0x06D1, 0x06D1 }, { 0x06D2, 0x06D2, 0x06D2 }, { 0x06D3, 0x06D3, 0x06D3 }, { 0x06D5, 0x06D5, 0x06D5 }, { 0x06D6, 0x06D6, 0x06D6 }, { 0x06D7, 0x06D7, 0x06D7 }, { 0x06D8, 0x06D8, 0x06D8 }, { 0x06D9, 0x06D9, 0x06D9 }, { 0x06DA, 0x06DA, 0x06DA }, { 0x06DB, 0x06DB, 0x06DB }, { 0x06DC, 0x06DC, 0x06DC }, { 0x06DF, 0x06DF, 0x06DF }, { 0x06E0, 0x06E0, 0x06E0 }, { 0x06E1, 0x06E1, 0x06E1 }, { 0x06E2, 0x06E2, 0x06E2 }, { 0x06E3, 0x06E3, 0x06E3 }, { 0x06E4, 0x06E4, 0x06E4 }, { 0x06E5, 0x06E5, 0x06E5 }, { 0x06E6, 0x06E6, 0x06E6 }, { 0x06E7, 0x06E7, 0x06E7 }, { 0x06E8, 0x06E8, 0x06E8 }, { 0x06EA, 0x06EA, 0x06EA }, { 0x06EB, 0x06EB, 0x06EB }, { 0x06EC, 0x06EC, 0x06EC }, { 0x06ED, 0x06ED, 0x06ED }, { 0x06EE, 0x06EE, 0x06EE }, { 0x06EF, 0x06EF, 0x06EF }, { 0x06FA, 0x06FA, 0x06FA }, { 0x06FB, 0x06FB, 0x06FB }, { 0x06FC, 0x06FC, 0x06FC }, { 0x06FF, 0x06FF, 0x06FF }, { 0x0710, 0x0710, 0x0710 }, { 0x0711, 0x0711, 0x0711 }, { 0x0712, 0x0712, 0x0712 }, { 0x0713, 0x0713, 0x0713 }, { 0x0714, 0x0714, 0x0714 }, { 0x0715, 0x0715, 0x0715 }, { 0x0716, 0x0716, 0x0716 }, { 0x0717, 0x0717, 0x0717 }, { 0x0718, 0x0718, 0x0718 }, { 0x0719, 0x0719, 0x0719 }, { 0x071A, 0x071A, 0x071A }, { 0x071B, 0x071B, 0x071B }, { 0x071C, 0x071C, 0x071C }, { 0x071D, 0x071D, 0x071D }, { 0x071E, 0x071E, 0x071E }, { 0x071F, 0x071F, 0x071F }, { 0x0720, 0x0720, 0x0720 }, { 0x0721, 0x0721, 0x0721 }, { 0x0722, 0x0722, 0x0722 }, { 0x0723, 0x0723, 0x0723 }, { 0x0724, 0x0724, 0x0724 }, { 0x0725, 0x0725, 0x0725 }, { 0x0726, 0x0726, 0x0726 }, { 0x0727, 0x0727, 0x0727 }, { 0x0728, 0x0728, 0x0728 }, { 0x0729, 0x0729, 0x0729 }, { 0x072A, 0x072A, 0x072A }, { 0x072B, 0x072B, 0x072B }, { 0x072C, 0x072C, 0x072C }, { 0x072D, 0x072D, 0x072D }, { 0x072E, 0x072E, 0x072E }, { 0x072F, 0x072F, 0x072F }, { 0x0730, 0x0730, 0x0730 }, { 0x0731, 0x0731, 0x0731 }, { 0x0732, 0x0732, 0x0732 }, { 0x0733, 0x0733, 0x0733 }, { 0x0734, 0x0734, 0x0734 }, { 0x0735, 0x0735, 0x0735 }, { 0x0736, 0x0736, 0x0736 }, { 0x0737, 0x0737, 0x0737 }, { 0x0738, 0x0738, 0x0738 }, { 0x0739, 0x0739, 0x0739 }, { 0x073A, 0x073A, 0x073A }, { 0x073B, 0x073B, 0x073B }, { 0x073C, 0x073C, 0x073C }, { 0x073D, 0x073D, 0x073D }, { 0x073E, 0x073E, 0x073E }, { 0x073F, 0x073F, 0x073F }, { 0x0740, 0x0740, 0x0740 }, { 0x0741, 0x0741, 0x0741 }, { 0x0742, 0x0742, 0x0742 }, { 0x0743, 0x0743, 0x0743 }, { 0x0744, 0x0744, 0x0744 }, { 0x0745, 0x0745, 0x0745 }, { 0x0746, 0x0746, 0x0746 }, { 0x0747, 0x0747, 0x0747 }, { 0x0748, 0x0748, 0x0748 }, { 0x0749, 0x0749, 0x0749 }, { 0x074A, 0x074A, 0x074A }, { 0x074D, 0x074D, 0x074D }, { 0x074E, 0x074E, 0x074E }, { 0x074F, 0x074F, 0x074F }, { 0x0750, 0x0750, 0x0750 }, { 0x0751, 0x0751, 0x0751 }, { 0x0752, 0x0752, 0x0752 }, { 0x0753, 0x0753, 0x0753 }, { 0x0754, 0x0754, 0x0754 }, { 0x0755, 0x0755, 0x0755 }, { 0x0756, 0x0756, 0x0756 }, { 0x0757, 0x0757, 0x0757 }, { 0x0758, 0x0758, 0x0758 }, { 0x0759, 0x0759, 0x0759 }, { 0x075A, 0x075A, 0x075A }, { 0x075B, 0x075B, 0x075B }, { 0x075C, 0x075C, 0x075C }, { 0x075D, 0x075D, 0x075D }, { 0x075E, 0x075E, 0x075E }, { 0x075F, 0x075F, 0x075F }, { 0x0760, 0x0760, 0x0760 }, { 0x0761, 0x0761, 0x0761 }, { 0x0762, 0x0762, 0x0762 }, { 0x0763, 0x0763, 0x0763 }, { 0x0764, 0x0764, 0x0764 }, { 0x0765, 0x0765, 0x0765 }, { 0x0766, 0x0766, 0x0766 }, { 0x0767, 0x0767, 0x0767 }, { 0x0768, 0x0768, 0x0768 }, { 0x0769, 0x0769, 0x0769 }, { 0x076A, 0x076A, 0x076A }, { 0x076B, 0x076B, 0x076B }, { 0x076C, 0x076C, 0x076C }, { 0x076D, 0x076D, 0x076D }, { 0x0780, 0x0780, 0x0780 }, { 0x0781, 0x0781, 0x0781 }, { 0x0782, 0x0782, 0x0782 }, { 0x0783, 0x0783, 0x0783 }, { 0x0784, 0x0784, 0x0784 }, { 0x0785, 0x0785, 0x0785 }, { 0x0786, 0x0786, 0x0786 }, { 0x0787, 0x0787, 0x0787 }, { 0x0788, 0x0788, 0x0788 }, { 0x0789, 0x0789, 0x0789 }, { 0x078A, 0x078A, 0x078A }, { 0x078B, 0x078B, 0x078B }, { 0x078C, 0x078C, 0x078C }, { 0x078D, 0x078D, 0x078D }, { 0x078E, 0x078E, 0x078E }, { 0x078F, 0x078F, 0x078F }, { 0x0790, 0x0790, 0x0790 }, { 0x0791, 0x0791, 0x0791 }, { 0x0792, 0x0792, 0x0792 }, { 0x0793, 0x0793, 0x0793 }, { 0x0794, 0x0794, 0x0794 }, { 0x0795, 0x0795, 0x0795 }, { 0x0796, 0x0796, 0x0796 }, { 0x0797, 0x0797, 0x0797 }, { 0x0798, 0x0798, 0x0798 }, { 0x0799, 0x0799, 0x0799 }, { 0x079A, 0x079A, 0x079A }, { 0x079B, 0x079B, 0x079B }, { 0x079C, 0x079C, 0x079C }, { 0x079D, 0x079D, 0x079D }, { 0x079E, 0x079E, 0x079E }, { 0x079F, 0x079F, 0x079F }, { 0x07A0, 0x07A0, 0x07A0 }, { 0x07A1, 0x07A1, 0x07A1 }, { 0x07A2, 0x07A2, 0x07A2 }, { 0x07A3, 0x07A3, 0x07A3 }, { 0x07A4, 0x07A4, 0x07A4 }, { 0x07A5, 0x07A5, 0x07A5 }, { 0x07A6, 0x07A6, 0x07A6 }, { 0x07A7, 0x07A7, 0x07A7 }, { 0x07A8, 0x07A8, 0x07A8 }, { 0x07A9, 0x07A9, 0x07A9 }, { 0x07AA, 0x07AA, 0x07AA }, { 0x07AB, 0x07AB, 0x07AB }, { 0x07AC, 0x07AC, 0x07AC }, { 0x07AD, 0x07AD, 0x07AD }, { 0x07AE, 0x07AE, 0x07AE }, { 0x07AF, 0x07AF, 0x07AF }, { 0x07B0, 0x07B0, 0x07B0 }, { 0x07B1, 0x07B1, 0x07B1 }, { 0x0901, 0x0901, 0x0901 }, { 0x0902, 0x0902, 0x0902 }, { 0x0904, 0x0904, 0x0904 }, { 0x0905, 0x0905, 0x0905 }, { 0x0906, 0x0906, 0x0906 }, { 0x0907, 0x0907, 0x0907 }, { 0x0908, 0x0908, 0x0908 }, { 0x0909, 0x0909, 0x0909 }, { 0x090A, 0x090A, 0x090A }, { 0x090B, 0x090B, 0x090B }, { 0x090C, 0x090C, 0x090C }, { 0x090D, 0x090D, 0x090D }, { 0x090E, 0x090E, 0x090E }, { 0x090F, 0x090F, 0x090F }, { 0x0910, 0x0910, 0x0910 }, { 0x0911, 0x0911, 0x0911 }, { 0x0912, 0x0912, 0x0912 }, { 0x0913, 0x0913, 0x0913 }, { 0x0914, 0x0914, 0x0914 }, { 0x0915, 0x0915, 0x0915 }, { 0x0916, 0x0916, 0x0916 }, { 0x0917, 0x0917, 0x0917 }, { 0x0918, 0x0918, 0x0918 }, { 0x0919, 0x0919, 0x0919 }, { 0x091A, 0x091A, 0x091A }, { 0x091B, 0x091B, 0x091B }, { 0x091C, 0x091C, 0x091C }, { 0x091D, 0x091D, 0x091D }, { 0x091E, 0x091E, 0x091E }, { 0x091F, 0x091F, 0x091F }, { 0x0920, 0x0920, 0x0920 }, { 0x0921, 0x0921, 0x0921 }, { 0x0922, 0x0922, 0x0922 }, { 0x0923, 0x0923, 0x0923 }, { 0x0924, 0x0924, 0x0924 }, { 0x0925, 0x0925, 0x0925 }, { 0x0926, 0x0926, 0x0926 }, { 0x0927, 0x0927, 0x0927 }, { 0x0928, 0x0928, 0x0928 }, { 0x0929, 0x0929, 0x0929 }, { 0x092A, 0x092A, 0x092A }, { 0x092B, 0x092B, 0x092B }, { 0x092C, 0x092C, 0x092C }, { 0x092D, 0x092D, 0x092D }, { 0x092E, 0x092E, 0x092E }, { 0x092F, 0x092F, 0x092F }, { 0x0930, 0x0930, 0x0930 }, { 0x0931, 0x0931, 0x0931 }, { 0x0932, 0x0932, 0x0932 }, { 0x0933, 0x0933, 0x0933 }, { 0x0934, 0x0934, 0x0934 }, { 0x0935, 0x0935, 0x0935 }, { 0x0936, 0x0936, 0x0936 }, { 0x0937, 0x0937, 0x0937 }, { 0x0938, 0x0938, 0x0938 }, { 0x0939, 0x0939, 0x0939 }, { 0x093C, 0x093C, 0x093C }, { 0x093D, 0x093D, 0x093D }, { 0x0941, 0x0941, 0x0941 }, { 0x0942, 0x0942, 0x0942 }, { 0x0943, 0x0943, 0x0943 }, { 0x0944, 0x0944, 0x0944 }, { 0x0945, 0x0945, 0x0945 }, { 0x0946, 0x0946, 0x0946 }, { 0x0947, 0x0947, 0x0947 }, { 0x0948, 0x0948, 0x0948 }, { 0x094D, 0x094D, 0x094D }, { 0x0950, 0x0950, 0x0950 }, { 0x0951, 0x0951, 0x0951 }, { 0x0952, 0x0952, 0x0952 }, { 0x0953, 0x0953, 0x0953 }, { 0x0954, 0x0954, 0x0954 }, { 0x0958, 0x0958, 0x0958 }, { 0x0959, 0x0959, 0x0959 }, { 0x095A, 0x095A, 0x095A }, { 0x095B, 0x095B, 0x095B }, { 0x095C, 0x095C, 0x095C }, { 0x095D, 0x095D, 0x095D }, { 0x095E, 0x095E, 0x095E }, { 0x095F, 0x095F, 0x095F }, { 0x0960, 0x0960, 0x0960 }, { 0x0961, 0x0961, 0x0961 }, { 0x0962, 0x0962, 0x0962 }, { 0x0963, 0x0963, 0x0963 }, { 0x097D, 0x097D, 0x097D }, { 0x0981, 0x0981, 0x0981 }, { 0x0985, 0x0985, 0x0985 }, { 0x0986, 0x0986, 0x0986 }, { 0x0987, 0x0987, 0x0987 }, { 0x0988, 0x0988, 0x0988 }, { 0x0989, 0x0989, 0x0989 }, { 0x098A, 0x098A, 0x098A }, { 0x098B, 0x098B, 0x098B }, { 0x098C, 0x098C, 0x098C }, { 0x098F, 0x098F, 0x098F }, { 0x0990, 0x0990, 0x0990 }, { 0x0993, 0x0993, 0x0993 }, { 0x0994, 0x0994, 0x0994 }, { 0x0995, 0x0995, 0x0995 }, { 0x0996, 0x0996, 0x0996 }, { 0x0997, 0x0997, 0x0997 }, { 0x0998, 0x0998, 0x0998 }, { 0x0999, 0x0999, 0x0999 }, { 0x099A, 0x099A, 0x099A }, { 0x099B, 0x099B, 0x099B }, { 0x099C, 0x099C, 0x099C }, { 0x099D, 0x099D, 0x099D }, { 0x099E, 0x099E, 0x099E }, { 0x099F, 0x099F, 0x099F }, { 0x09A0, 0x09A0, 0x09A0 }, { 0x09A1, 0x09A1, 0x09A1 }, { 0x09A2, 0x09A2, 0x09A2 }, { 0x09A3, 0x09A3, 0x09A3 }, { 0x09A4, 0x09A4, 0x09A4 }, { 0x09A5, 0x09A5, 0x09A5 }, { 0x09A6, 0x09A6, 0x09A6 }, { 0x09A7, 0x09A7, 0x09A7 }, { 0x09A8, 0x09A8, 0x09A8 }, { 0x09AA, 0x09AA, 0x09AA }, { 0x09AB, 0x09AB, 0x09AB }, { 0x09AC, 0x09AC, 0x09AC }, { 0x09AD, 0x09AD, 0x09AD }, { 0x09AE, 0x09AE, 0x09AE }, { 0x09AF, 0x09AF, 0x09AF }, { 0x09B0, 0x09B0, 0x09B0 }, { 0x09B2, 0x09B2, 0x09B2 }, { 0x09B6, 0x09B6, 0x09B6 }, { 0x09B7, 0x09B7, 0x09B7 }, { 0x09B8, 0x09B8, 0x09B8 }, { 0x09B9, 0x09B9, 0x09B9 }, { 0x09BC, 0x09BC, 0x09BC }, { 0x09BD, 0x09BD, 0x09BD }, { 0x09C1, 0x09C1, 0x09C1 }, { 0x09C2, 0x09C2, 0x09C2 }, { 0x09C3, 0x09C3, 0x09C3 }, { 0x09C4, 0x09C4, 0x09C4 }, { 0x09CD, 0x09CD, 0x09CD }, { 0x09CE, 0x09CE, 0x09CE }, { 0x09DC, 0x09DC, 0x09DC }, { 0x09DD, 0x09DD, 0x09DD }, { 0x09DF, 0x09DF, 0x09DF }, { 0x09E0, 0x09E0, 0x09E0 }, { 0x09E1, 0x09E1, 0x09E1 }, { 0x09E2, 0x09E2, 0x09E2 }, { 0x09E3, 0x09E3, 0x09E3 }, { 0x09F0, 0x09F0, 0x09F0 }, { 0x09F1, 0x09F1, 0x09F1 }, { 0x0A01, 0x0A01, 0x0A01 }, { 0x0A02, 0x0A02, 0x0A02 }, { 0x0A05, 0x0A05, 0x0A05 }, { 0x0A06, 0x0A06, 0x0A06 }, { 0x0A07, 0x0A07, 0x0A07 }, { 0x0A08, 0x0A08, 0x0A08 }, { 0x0A09, 0x0A09, 0x0A09 }, { 0x0A0A, 0x0A0A, 0x0A0A }, { 0x0A0F, 0x0A0F, 0x0A0F }, { 0x0A10, 0x0A10, 0x0A10 }, { 0x0A13, 0x0A13, 0x0A13 }, { 0x0A14, 0x0A14, 0x0A14 }, { 0x0A15, 0x0A15, 0x0A15 }, { 0x0A16, 0x0A16, 0x0A16 }, { 0x0A17, 0x0A17, 0x0A17 }, { 0x0A18, 0x0A18, 0x0A18 }, { 0x0A19, 0x0A19, 0x0A19 }, { 0x0A1A, 0x0A1A, 0x0A1A }, { 0x0A1B, 0x0A1B, 0x0A1B }, { 0x0A1C, 0x0A1C, 0x0A1C }, { 0x0A1D, 0x0A1D, 0x0A1D }, { 0x0A1E, 0x0A1E, 0x0A1E }, { 0x0A1F, 0x0A1F, 0x0A1F }, { 0x0A20, 0x0A20, 0x0A20 }, { 0x0A21, 0x0A21, 0x0A21 }, { 0x0A22, 0x0A22, 0x0A22 }, { 0x0A23, 0x0A23, 0x0A23 }, { 0x0A24, 0x0A24, 0x0A24 }, { 0x0A25, 0x0A25, 0x0A25 }, { 0x0A26, 0x0A26, 0x0A26 }, { 0x0A27, 0x0A27, 0x0A27 }, { 0x0A28, 0x0A28, 0x0A28 }, { 0x0A2A, 0x0A2A, 0x0A2A }, { 0x0A2B, 0x0A2B, 0x0A2B }, { 0x0A2C, 0x0A2C, 0x0A2C }, { 0x0A2D, 0x0A2D, 0x0A2D }, { 0x0A2E, 0x0A2E, 0x0A2E }, { 0x0A2F, 0x0A2F, 0x0A2F }, { 0x0A30, 0x0A30, 0x0A30 }, { 0x0A32, 0x0A32, 0x0A32 }, { 0x0A33, 0x0A33, 0x0A33 }, { 0x0A35, 0x0A35, 0x0A35 }, { 0x0A36, 0x0A36, 0x0A36 }, { 0x0A38, 0x0A38, 0x0A38 }, { 0x0A39, 0x0A39, 0x0A39 }, { 0x0A3C, 0x0A3C, 0x0A3C }, { 0x0A41, 0x0A41, 0x0A41 }, { 0x0A42, 0x0A42, 0x0A42 }, { 0x0A47, 0x0A47, 0x0A47 }, { 0x0A48, 0x0A48, 0x0A48 }, { 0x0A4B, 0x0A4B, 0x0A4B }, { 0x0A4C, 0x0A4C, 0x0A4C }, { 0x0A4D, 0x0A4D, 0x0A4D }, { 0x0A59, 0x0A59, 0x0A59 }, { 0x0A5A, 0x0A5A, 0x0A5A }, { 0x0A5B, 0x0A5B, 0x0A5B }, { 0x0A5C, 0x0A5C, 0x0A5C }, { 0x0A5E, 0x0A5E, 0x0A5E }, { 0x0A70, 0x0A70, 0x0A70 }, { 0x0A71, 0x0A71, 0x0A71 }, { 0x0A72, 0x0A72, 0x0A72 }, { 0x0A73, 0x0A73, 0x0A73 }, { 0x0A74, 0x0A74, 0x0A74 }, { 0x0A81, 0x0A81, 0x0A81 }, { 0x0A82, 0x0A82, 0x0A82 }, { 0x0A85, 0x0A85, 0x0A85 }, { 0x0A86, 0x0A86, 0x0A86 }, { 0x0A87, 0x0A87, 0x0A87 }, { 0x0A88, 0x0A88, 0x0A88 }, { 0x0A89, 0x0A89, 0x0A89 }, { 0x0A8A, 0x0A8A, 0x0A8A }, { 0x0A8B, 0x0A8B, 0x0A8B }, { 0x0A8C, 0x0A8C, 0x0A8C }, { 0x0A8D, 0x0A8D, 0x0A8D }, { 0x0A8F, 0x0A8F, 0x0A8F }, { 0x0A90, 0x0A90, 0x0A90 }, { 0x0A91, 0x0A91, 0x0A91 }, { 0x0A93, 0x0A93, 0x0A93 }, { 0x0A94, 0x0A94, 0x0A94 }, { 0x0A95, 0x0A95, 0x0A95 }, { 0x0A96, 0x0A96, 0x0A96 }, { 0x0A97, 0x0A97, 0x0A97 }, { 0x0A98, 0x0A98, 0x0A98 }, { 0x0A99, 0x0A99, 0x0A99 }, { 0x0A9A, 0x0A9A, 0x0A9A }, { 0x0A9B, 0x0A9B, 0x0A9B }, { 0x0A9C, 0x0A9C, 0x0A9C }, { 0x0A9D, 0x0A9D, 0x0A9D }, { 0x0A9E, 0x0A9E, 0x0A9E }, { 0x0A9F, 0x0A9F, 0x0A9F }, { 0x0AA0, 0x0AA0, 0x0AA0 }, { 0x0AA1, 0x0AA1, 0x0AA1 }, { 0x0AA2, 0x0AA2, 0x0AA2 }, { 0x0AA3, 0x0AA3, 0x0AA3 }, { 0x0AA4, 0x0AA4, 0x0AA4 }, { 0x0AA5, 0x0AA5, 0x0AA5 }, { 0x0AA6, 0x0AA6, 0x0AA6 }, { 0x0AA7, 0x0AA7, 0x0AA7 }, { 0x0AA8, 0x0AA8, 0x0AA8 }, { 0x0AAA, 0x0AAA, 0x0AAA }, { 0x0AAB, 0x0AAB, 0x0AAB }, { 0x0AAC, 0x0AAC, 0x0AAC }, { 0x0AAD, 0x0AAD, 0x0AAD }, { 0x0AAE, 0x0AAE, 0x0AAE }, { 0x0AAF, 0x0AAF, 0x0AAF }, { 0x0AB0, 0x0AB0, 0x0AB0 }, { 0x0AB2, 0x0AB2, 0x0AB2 }, { 0x0AB3, 0x0AB3, 0x0AB3 }, { 0x0AB5, 0x0AB5, 0x0AB5 }, { 0x0AB6, 0x0AB6, 0x0AB6 }, { 0x0AB7, 0x0AB7, 0x0AB7 }, { 0x0AB8, 0x0AB8, 0x0AB8 }, { 0x0AB9, 0x0AB9, 0x0AB9 }, { 0x0ABC, 0x0ABC, 0x0ABC }, { 0x0ABD, 0x0ABD, 0x0ABD }, { 0x0AC1, 0x0AC1, 0x0AC1 }, { 0x0AC2, 0x0AC2, 0x0AC2 }, { 0x0AC3, 0x0AC3, 0x0AC3 }, { 0x0AC4, 0x0AC4, 0x0AC4 }, { 0x0AC5, 0x0AC5, 0x0AC5 }, { 0x0AC7, 0x0AC7, 0x0AC7 }, { 0x0AC8, 0x0AC8, 0x0AC8 }, { 0x0ACD, 0x0ACD, 0x0ACD }, { 0x0AD0, 0x0AD0, 0x0AD0 }, { 0x0AE0, 0x0AE0, 0x0AE0 }, { 0x0AE1, 0x0AE1, 0x0AE1 }, { 0x0AE2, 0x0AE2, 0x0AE2 }, { 0x0AE3, 0x0AE3, 0x0AE3 }, { 0x0B01, 0x0B01, 0x0B01 }, { 0x0B05, 0x0B05, 0x0B05 }, { 0x0B06, 0x0B06, 0x0B06 }, { 0x0B07, 0x0B07, 0x0B07 }, { 0x0B08, 0x0B08, 0x0B08 }, { 0x0B09, 0x0B09, 0x0B09 }, { 0x0B0A, 0x0B0A, 0x0B0A }, { 0x0B0B, 0x0B0B, 0x0B0B }, { 0x0B0C, 0x0B0C, 0x0B0C }, { 0x0B0F, 0x0B0F, 0x0B0F }, { 0x0B10, 0x0B10, 0x0B10 }, { 0x0B13, 0x0B13, 0x0B13 }, { 0x0B14, 0x0B14, 0x0B14 }, { 0x0B15, 0x0B15, 0x0B15 }, { 0x0B16, 0x0B16, 0x0B16 }, { 0x0B17, 0x0B17, 0x0B17 }, { 0x0B18, 0x0B18, 0x0B18 }, { 0x0B19, 0x0B19, 0x0B19 }, { 0x0B1A, 0x0B1A, 0x0B1A }, { 0x0B1B, 0x0B1B, 0x0B1B }, { 0x0B1C, 0x0B1C, 0x0B1C }, { 0x0B1D, 0x0B1D, 0x0B1D }, { 0x0B1E, 0x0B1E, 0x0B1E }, { 0x0B1F, 0x0B1F, 0x0B1F }, { 0x0B20, 0x0B20, 0x0B20 }, { 0x0B21, 0x0B21, 0x0B21 }, { 0x0B22, 0x0B22, 0x0B22 }, { 0x0B23, 0x0B23, 0x0B23 }, { 0x0B24, 0x0B24, 0x0B24 }, { 0x0B25, 0x0B25, 0x0B25 }, { 0x0B26, 0x0B26, 0x0B26 }, { 0x0B27, 0x0B27, 0x0B27 }, { 0x0B28, 0x0B28, 0x0B28 }, { 0x0B2A, 0x0B2A, 0x0B2A }, { 0x0B2B, 0x0B2B, 0x0B2B }, { 0x0B2C, 0x0B2C, 0x0B2C }, { 0x0B2D, 0x0B2D, 0x0B2D }, { 0x0B2E, 0x0B2E, 0x0B2E }, { 0x0B2F, 0x0B2F, 0x0B2F }, { 0x0B30, 0x0B30, 0x0B30 }, { 0x0B32, 0x0B32, 0x0B32 }, { 0x0B33, 0x0B33, 0x0B33 }, { 0x0B35, 0x0B35, 0x0B35 }, { 0x0B36, 0x0B36, 0x0B36 }, { 0x0B37, 0x0B37, 0x0B37 }, { 0x0B38, 0x0B38, 0x0B38 }, { 0x0B39, 0x0B39, 0x0B39 }, { 0x0B3C, 0x0B3C, 0x0B3C }, { 0x0B3D, 0x0B3D, 0x0B3D }, { 0x0B3F, 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B41, 0x0B41 }, { 0x0B42, 0x0B42, 0x0B42 }, { 0x0B43, 0x0B43, 0x0B43 }, { 0x0B4D, 0x0B4D, 0x0B4D }, { 0x0B56, 0x0B56, 0x0B56 }, { 0x0B5C, 0x0B5C, 0x0B5C }, { 0x0B5D, 0x0B5D, 0x0B5D }, { 0x0B5F, 0x0B5F, 0x0B5F }, { 0x0B60, 0x0B60, 0x0B60 }, { 0x0B61, 0x0B61, 0x0B61 }, { 0x0B71, 0x0B71, 0x0B71 }, { 0x0B82, 0x0B82, 0x0B82 }, { 0x0B83, 0x0B83, 0x0B83 }, { 0x0B85, 0x0B85, 0x0B85 }, { 0x0B86, 0x0B86, 0x0B86 }, { 0x0B87, 0x0B87, 0x0B87 }, { 0x0B88, 0x0B88, 0x0B88 }, { 0x0B89, 0x0B89, 0x0B89 }, { 0x0B8A, 0x0B8A, 0x0B8A }, { 0x0B8E, 0x0B8E, 0x0B8E }, { 0x0B8F, 0x0B8F, 0x0B8F }, { 0x0B90, 0x0B90, 0x0B90 }, { 0x0B92, 0x0B92, 0x0B92 }, { 0x0B93, 0x0B93, 0x0B93 }, { 0x0B94, 0x0B94, 0x0B94 }, { 0x0B95, 0x0B95, 0x0B95 }, { 0x0B99, 0x0B99, 0x0B99 }, { 0x0B9A, 0x0B9A, 0x0B9A }, { 0x0B9C, 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9E, 0x0B9E }, { 0x0B9F, 0x0B9F, 0x0B9F }, { 0x0BA3, 0x0BA3, 0x0BA3 }, { 0x0BA4, 0x0BA4, 0x0BA4 }, { 0x0BA8, 0x0BA8, 0x0BA8 }, { 0x0BA9, 0x0BA9, 0x0BA9 }, { 0x0BAA, 0x0BAA, 0x0BAA }, { 0x0BAE, 0x0BAE, 0x0BAE }, { 0x0BAF, 0x0BAF, 0x0BAF }, { 0x0BB0, 0x0BB0, 0x0BB0 }, { 0x0BB1, 0x0BB1, 0x0BB1 }, { 0x0BB2, 0x0BB2, 0x0BB2 }, { 0x0BB3, 0x0BB3, 0x0BB3 }, { 0x0BB4, 0x0BB4, 0x0BB4 }, { 0x0BB5, 0x0BB5, 0x0BB5 }, { 0x0BB6, 0x0BB6, 0x0BB6 }, { 0x0BB7, 0x0BB7, 0x0BB7 }, { 0x0BB8, 0x0BB8, 0x0BB8 }, { 0x0BB9, 0x0BB9, 0x0BB9 }, { 0x0BC0, 0x0BC0, 0x0BC0 }, { 0x0BCD, 0x0BCD, 0x0BCD }, { 0x0C05, 0x0C05, 0x0C05 }, { 0x0C06, 0x0C06, 0x0C06 }, { 0x0C07, 0x0C07, 0x0C07 }, { 0x0C08, 0x0C08, 0x0C08 }, { 0x0C09, 0x0C09, 0x0C09 }, { 0x0C0A, 0x0C0A, 0x0C0A }, { 0x0C0B, 0x0C0B, 0x0C0B }, { 0x0C0C, 0x0C0C, 0x0C0C }, { 0x0C0E, 0x0C0E, 0x0C0E }, { 0x0C0F, 0x0C0F, 0x0C0F }, { 0x0C10, 0x0C10, 0x0C10 }, { 0x0C12, 0x0C12, 0x0C12 }, { 0x0C13, 0x0C13, 0x0C13 }, { 0x0C14, 0x0C14, 0x0C14 }, { 0x0C15, 0x0C15, 0x0C15 }, { 0x0C16, 0x0C16, 0x0C16 }, { 0x0C17, 0x0C17, 0x0C17 }, { 0x0C18, 0x0C18, 0x0C18 }, { 0x0C19, 0x0C19, 0x0C19 }, { 0x0C1A, 0x0C1A, 0x0C1A }, { 0x0C1B, 0x0C1B, 0x0C1B }, { 0x0C1C, 0x0C1C, 0x0C1C }, { 0x0C1D, 0x0C1D, 0x0C1D }, { 0x0C1E, 0x0C1E, 0x0C1E }, { 0x0C1F, 0x0C1F, 0x0C1F }, { 0x0C20, 0x0C20, 0x0C20 }, { 0x0C21, 0x0C21, 0x0C21 }, { 0x0C22, 0x0C22, 0x0C22 }, { 0x0C23, 0x0C23, 0x0C23 }, { 0x0C24, 0x0C24, 0x0C24 }, { 0x0C25, 0x0C25, 0x0C25 }, { 0x0C26, 0x0C26, 0x0C26 }, { 0x0C27, 0x0C27, 0x0C27 }, { 0x0C28, 0x0C28, 0x0C28 }, { 0x0C2A, 0x0C2A, 0x0C2A }, { 0x0C2B, 0x0C2B, 0x0C2B }, { 0x0C2C, 0x0C2C, 0x0C2C }, { 0x0C2D, 0x0C2D, 0x0C2D }, { 0x0C2E, 0x0C2E, 0x0C2E }, { 0x0C2F, 0x0C2F, 0x0C2F }, { 0x0C30, 0x0C30, 0x0C30 }, { 0x0C31, 0x0C31, 0x0C31 }, { 0x0C32, 0x0C32, 0x0C32 }, { 0x0C33, 0x0C33, 0x0C33 }, { 0x0C35, 0x0C35, 0x0C35 }, { 0x0C36, 0x0C36, 0x0C36 }, { 0x0C37, 0x0C37, 0x0C37 }, { 0x0C38, 0x0C38, 0x0C38 }, { 0x0C39, 0x0C39, 0x0C39 }, { 0x0C3E, 0x0C3E, 0x0C3E }, { 0x0C3F, 0x0C3F, 0x0C3F }, { 0x0C40, 0x0C40, 0x0C40 }, { 0x0C46, 0x0C46, 0x0C46 }, { 0x0C47, 0x0C47, 0x0C47 }, { 0x0C48, 0x0C48, 0x0C48 }, { 0x0C4A, 0x0C4A, 0x0C4A }, { 0x0C4B, 0x0C4B, 0x0C4B }, { 0x0C4C, 0x0C4C, 0x0C4C }, { 0x0C4D, 0x0C4D, 0x0C4D }, { 0x0C55, 0x0C55, 0x0C55 }, { 0x0C56, 0x0C56, 0x0C56 }, { 0x0C60, 0x0C60, 0x0C60 }, { 0x0C61, 0x0C61, 0x0C61 }, { 0x0C85, 0x0C85, 0x0C85 }, { 0x0C86, 0x0C86, 0x0C86 }, { 0x0C87, 0x0C87, 0x0C87 }, { 0x0C88, 0x0C88, 0x0C88 }, { 0x0C89, 0x0C89, 0x0C89 }, { 0x0C8A, 0x0C8A, 0x0C8A }, { 0x0C8B, 0x0C8B, 0x0C8B }, { 0x0C8C, 0x0C8C, 0x0C8C }, { 0x0C8E, 0x0C8E, 0x0C8E }, { 0x0C8F, 0x0C8F, 0x0C8F }, { 0x0C90, 0x0C90, 0x0C90 }, { 0x0C92, 0x0C92, 0x0C92 }, { 0x0C93, 0x0C93, 0x0C93 }, { 0x0C94, 0x0C94, 0x0C94 }, { 0x0C95, 0x0C95, 0x0C95 }, { 0x0C96, 0x0C96, 0x0C96 }, { 0x0C97, 0x0C97, 0x0C97 }, { 0x0C98, 0x0C98, 0x0C98 }, { 0x0C99, 0x0C99, 0x0C99 }, { 0x0C9A, 0x0C9A, 0x0C9A }, { 0x0C9B, 0x0C9B, 0x0C9B }, { 0x0C9C, 0x0C9C, 0x0C9C }, { 0x0C9D, 0x0C9D, 0x0C9D }, { 0x0C9E, 0x0C9E, 0x0C9E }, { 0x0C9F, 0x0C9F, 0x0C9F }, { 0x0CA0, 0x0CA0, 0x0CA0 }, { 0x0CA1, 0x0CA1, 0x0CA1 }, { 0x0CA2, 0x0CA2, 0x0CA2 }, { 0x0CA3, 0x0CA3, 0x0CA3 }, { 0x0CA4, 0x0CA4, 0x0CA4 }, { 0x0CA5, 0x0CA5, 0x0CA5 }, { 0x0CA6, 0x0CA6, 0x0CA6 }, { 0x0CA7, 0x0CA7, 0x0CA7 }, { 0x0CA8, 0x0CA8, 0x0CA8 }, { 0x0CAA, 0x0CAA, 0x0CAA }, { 0x0CAB, 0x0CAB, 0x0CAB }, { 0x0CAC, 0x0CAC, 0x0CAC }, { 0x0CAD, 0x0CAD, 0x0CAD }, { 0x0CAE, 0x0CAE, 0x0CAE }, { 0x0CAF, 0x0CAF, 0x0CAF }, { 0x0CB0, 0x0CB0, 0x0CB0 }, { 0x0CB1, 0x0CB1, 0x0CB1 }, { 0x0CB2, 0x0CB2, 0x0CB2 }, { 0x0CB3, 0x0CB3, 0x0CB3 }, { 0x0CB5, 0x0CB5, 0x0CB5 }, { 0x0CB6, 0x0CB6, 0x0CB6 }, { 0x0CB7, 0x0CB7, 0x0CB7 }, { 0x0CB8, 0x0CB8, 0x0CB8 }, { 0x0CB9, 0x0CB9, 0x0CB9 }, { 0x0CBC, 0x0CBC, 0x0CBC }, { 0x0CBD, 0x0CBD, 0x0CBD }, { 0x0CBF, 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCC, 0x0CCC }, { 0x0CCD, 0x0CCD, 0x0CCD }, { 0x0CDE, 0x0CDE, 0x0CDE }, { 0x0CE0, 0x0CE0, 0x0CE0 }, { 0x0CE1, 0x0CE1, 0x0CE1 }, { 0x0D05, 0x0D05, 0x0D05 }, { 0x0D06, 0x0D06, 0x0D06 }, { 0x0D07, 0x0D07, 0x0D07 }, { 0x0D08, 0x0D08, 0x0D08 }, { 0x0D09, 0x0D09, 0x0D09 }, { 0x0D0A, 0x0D0A, 0x0D0A }, { 0x0D0B, 0x0D0B, 0x0D0B }, { 0x0D0C, 0x0D0C, 0x0D0C }, { 0x0D0E, 0x0D0E, 0x0D0E }, { 0x0D0F, 0x0D0F, 0x0D0F }, { 0x0D10, 0x0D10, 0x0D10 }, { 0x0D12, 0x0D12, 0x0D12 }, { 0x0D13, 0x0D13, 0x0D13 }, { 0x0D14, 0x0D14, 0x0D14 }, { 0x0D15, 0x0D15, 0x0D15 }, { 0x0D16, 0x0D16, 0x0D16 }, { 0x0D17, 0x0D17, 0x0D17 }, { 0x0D18, 0x0D18, 0x0D18 }, { 0x0D19, 0x0D19, 0x0D19 }, { 0x0D1A, 0x0D1A, 0x0D1A }, { 0x0D1B, 0x0D1B, 0x0D1B }, { 0x0D1C, 0x0D1C, 0x0D1C }, { 0x0D1D, 0x0D1D, 0x0D1D }, { 0x0D1E, 0x0D1E, 0x0D1E }, { 0x0D1F, 0x0D1F, 0x0D1F }, { 0x0D20, 0x0D20, 0x0D20 }, { 0x0D21, 0x0D21, 0x0D21 }, { 0x0D22, 0x0D22, 0x0D22 }, { 0x0D23, 0x0D23, 0x0D23 }, { 0x0D24, 0x0D24, 0x0D24 }, { 0x0D25, 0x0D25, 0x0D25 }, { 0x0D26, 0x0D26, 0x0D26 }, { 0x0D27, 0x0D27, 0x0D27 }, { 0x0D28, 0x0D28, 0x0D28 }, { 0x0D2A, 0x0D2A, 0x0D2A }, { 0x0D2B, 0x0D2B, 0x0D2B }, { 0x0D2C, 0x0D2C, 0x0D2C }, { 0x0D2D, 0x0D2D, 0x0D2D }, { 0x0D2E, 0x0D2E, 0x0D2E }, { 0x0D2F, 0x0D2F, 0x0D2F }, { 0x0D30, 0x0D30, 0x0D30 }, { 0x0D31, 0x0D31, 0x0D31 }, { 0x0D32, 0x0D32, 0x0D32 }, { 0x0D33, 0x0D33, 0x0D33 }, { 0x0D34, 0x0D34, 0x0D34 }, { 0x0D35, 0x0D35, 0x0D35 }, { 0x0D36, 0x0D36, 0x0D36 }, { 0x0D37, 0x0D37, 0x0D37 }, { 0x0D38, 0x0D38, 0x0D38 }, { 0x0D39, 0x0D39, 0x0D39 }, { 0x0D41, 0x0D41, 0x0D41 }, { 0x0D42, 0x0D42, 0x0D42 }, { 0x0D43, 0x0D43, 0x0D43 }, { 0x0D4D, 0x0D4D, 0x0D4D }, { 0x0D60, 0x0D60, 0x0D60 }, { 0x0D61, 0x0D61, 0x0D61 }, { 0x0D85, 0x0D85, 0x0D85 }, { 0x0D86, 0x0D86, 0x0D86 }, { 0x0D87, 0x0D87, 0x0D87 }, { 0x0D88, 0x0D88, 0x0D88 }, { 0x0D89, 0x0D89, 0x0D89 }, { 0x0D8A, 0x0D8A, 0x0D8A }, { 0x0D8B, 0x0D8B, 0x0D8B }, { 0x0D8C, 0x0D8C, 0x0D8C }, { 0x0D8D, 0x0D8D, 0x0D8D }, { 0x0D8E, 0x0D8E, 0x0D8E }, { 0x0D8F, 0x0D8F, 0x0D8F }, { 0x0D90, 0x0D90, 0x0D90 }, { 0x0D91, 0x0D91, 0x0D91 }, { 0x0D92, 0x0D92, 0x0D92 }, { 0x0D93, 0x0D93, 0x0D93 }, { 0x0D94, 0x0D94, 0x0D94 }, { 0x0D95, 0x0D95, 0x0D95 }, { 0x0D96, 0x0D96, 0x0D96 }, { 0x0D9A, 0x0D9A, 0x0D9A }, { 0x0D9B, 0x0D9B, 0x0D9B }, { 0x0D9C, 0x0D9C, 0x0D9C }, { 0x0D9D, 0x0D9D, 0x0D9D }, { 0x0D9E, 0x0D9E, 0x0D9E }, { 0x0D9F, 0x0D9F, 0x0D9F }, { 0x0DA0, 0x0DA0, 0x0DA0 }, { 0x0DA1, 0x0DA1, 0x0DA1 }, { 0x0DA2, 0x0DA2, 0x0DA2 }, { 0x0DA3, 0x0DA3, 0x0DA3 }, { 0x0DA4, 0x0DA4, 0x0DA4 }, { 0x0DA5, 0x0DA5, 0x0DA5 }, { 0x0DA6, 0x0DA6, 0x0DA6 }, { 0x0DA7, 0x0DA7, 0x0DA7 }, { 0x0DA8, 0x0DA8, 0x0DA8 }, { 0x0DA9, 0x0DA9, 0x0DA9 }, { 0x0DAA, 0x0DAA, 0x0DAA }, { 0x0DAB, 0x0DAB, 0x0DAB }, { 0x0DAC, 0x0DAC, 0x0DAC }, { 0x0DAD, 0x0DAD, 0x0DAD }, { 0x0DAE, 0x0DAE, 0x0DAE }, { 0x0DAF, 0x0DAF, 0x0DAF }, { 0x0DB0, 0x0DB0, 0x0DB0 }, { 0x0DB1, 0x0DB1, 0x0DB1 }, { 0x0DB3, 0x0DB3, 0x0DB3 }, { 0x0DB4, 0x0DB4, 0x0DB4 }, { 0x0DB5, 0x0DB5, 0x0DB5 }, { 0x0DB6, 0x0DB6, 0x0DB6 }, { 0x0DB7, 0x0DB7, 0x0DB7 }, { 0x0DB8, 0x0DB8, 0x0DB8 }, { 0x0DB9, 0x0DB9, 0x0DB9 }, { 0x0DBA, 0x0DBA, 0x0DBA }, { 0x0DBB, 0x0DBB, 0x0DBB }, { 0x0DBD, 0x0DBD, 0x0DBD }, { 0x0DC0, 0x0DC0, 0x0DC0 }, { 0x0DC1, 0x0DC1, 0x0DC1 }, { 0x0DC2, 0x0DC2, 0x0DC2 }, { 0x0DC3, 0x0DC3, 0x0DC3 }, { 0x0DC4, 0x0DC4, 0x0DC4 }, { 0x0DC5, 0x0DC5, 0x0DC5 }, { 0x0DC6, 0x0DC6, 0x0DC6 }, { 0x0DCA, 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD2, 0x0DD2 }, { 0x0DD3, 0x0DD3, 0x0DD3 }, { 0x0DD4, 0x0DD4, 0x0DD4 }, { 0x0DD6, 0x0DD6, 0x0DD6 }, { 0x0E01, 0x0E01, 0x0E01 }, { 0x0E02, 0x0E02, 0x0E02 }, { 0x0E03, 0x0E03, 0x0E03 }, { 0x0E04, 0x0E04, 0x0E04 }, { 0x0E05, 0x0E05, 0x0E05 }, { 0x0E06, 0x0E06, 0x0E06 }, { 0x0E07, 0x0E07, 0x0E07 }, { 0x0E08, 0x0E08, 0x0E08 }, { 0x0E09, 0x0E09, 0x0E09 }, { 0x0E0A, 0x0E0A, 0x0E0A }, { 0x0E0B, 0x0E0B, 0x0E0B }, { 0x0E0C, 0x0E0C, 0x0E0C }, { 0x0E0D, 0x0E0D, 0x0E0D }, { 0x0E0E, 0x0E0E, 0x0E0E }, { 0x0E0F, 0x0E0F, 0x0E0F }, { 0x0E10, 0x0E10, 0x0E10 }, { 0x0E11, 0x0E11, 0x0E11 }, { 0x0E12, 0x0E12, 0x0E12 }, { 0x0E13, 0x0E13, 0x0E13 }, { 0x0E14, 0x0E14, 0x0E14 }, { 0x0E15, 0x0E15, 0x0E15 }, { 0x0E16, 0x0E16, 0x0E16 }, { 0x0E17, 0x0E17, 0x0E17 }, { 0x0E18, 0x0E18, 0x0E18 }, { 0x0E19, 0x0E19, 0x0E19 }, { 0x0E1A, 0x0E1A, 0x0E1A }, { 0x0E1B, 0x0E1B, 0x0E1B }, { 0x0E1C, 0x0E1C, 0x0E1C }, { 0x0E1D, 0x0E1D, 0x0E1D }, { 0x0E1E, 0x0E1E, 0x0E1E }, { 0x0E1F, 0x0E1F, 0x0E1F }, { 0x0E20, 0x0E20, 0x0E20 }, { 0x0E21, 0x0E21, 0x0E21 }, { 0x0E22, 0x0E22, 0x0E22 }, { 0x0E23, 0x0E23, 0x0E23 }, { 0x0E24, 0x0E24, 0x0E24 }, { 0x0E25, 0x0E25, 0x0E25 }, { 0x0E26, 0x0E26, 0x0E26 }, { 0x0E27, 0x0E27, 0x0E27 }, { 0x0E28, 0x0E28, 0x0E28 }, { 0x0E29, 0x0E29, 0x0E29 }, { 0x0E2A, 0x0E2A, 0x0E2A }, { 0x0E2B, 0x0E2B, 0x0E2B }, { 0x0E2C, 0x0E2C, 0x0E2C }, { 0x0E2D, 0x0E2D, 0x0E2D }, { 0x0E2E, 0x0E2E, 0x0E2E }, { 0x0E2F, 0x0E2F, 0x0E2F }, { 0x0E30, 0x0E30, 0x0E30 }, { 0x0E31, 0x0E31, 0x0E31 }, { 0x0E32, 0x0E32, 0x0E32 }, { 0x0E33, 0x0E33, 0x0E33 }, { 0x0E34, 0x0E34, 0x0E34 }, { 0x0E35, 0x0E35, 0x0E35 }, { 0x0E36, 0x0E36, 0x0E36 }, { 0x0E37, 0x0E37, 0x0E37 }, { 0x0E38, 0x0E38, 0x0E38 }, { 0x0E39, 0x0E39, 0x0E39 }, { 0x0E3A, 0x0E3A, 0x0E3A }, { 0x0E40, 0x0E40, 0x0E40 }, { 0x0E41, 0x0E41, 0x0E41 }, { 0x0E42, 0x0E42, 0x0E42 }, { 0x0E43, 0x0E43, 0x0E43 }, { 0x0E44, 0x0E44, 0x0E44 }, { 0x0E45, 0x0E45, 0x0E45 }, { 0x0E46, 0x0E46, 0x0E46 }, { 0x0E47, 0x0E47, 0x0E47 }, { 0x0E48, 0x0E48, 0x0E48 }, { 0x0E49, 0x0E49, 0x0E49 }, { 0x0E4A, 0x0E4A, 0x0E4A }, { 0x0E4B, 0x0E4B, 0x0E4B }, { 0x0E4C, 0x0E4C, 0x0E4C }, { 0x0E4D, 0x0E4D, 0x0E4D }, { 0x0E4E, 0x0E4E, 0x0E4E }, { 0x0E81, 0x0E81, 0x0E81 }, { 0x0E82, 0x0E82, 0x0E82 }, { 0x0E84, 0x0E84, 0x0E84 }, { 0x0E87, 0x0E87, 0x0E87 }, { 0x0E88, 0x0E88, 0x0E88 }, { 0x0E8A, 0x0E8A, 0x0E8A }, { 0x0E8D, 0x0E8D, 0x0E8D }, { 0x0E94, 0x0E94, 0x0E94 }, { 0x0E95, 0x0E95, 0x0E95 }, { 0x0E96, 0x0E96, 0x0E96 }, { 0x0E97, 0x0E97, 0x0E97 }, { 0x0E99, 0x0E99, 0x0E99 }, { 0x0E9A, 0x0E9A, 0x0E9A }, { 0x0E9B, 0x0E9B, 0x0E9B }, { 0x0E9C, 0x0E9C, 0x0E9C }, { 0x0E9D, 0x0E9D, 0x0E9D }, { 0x0E9E, 0x0E9E, 0x0E9E }, { 0x0E9F, 0x0E9F, 0x0E9F }, { 0x0EA1, 0x0EA1, 0x0EA1 }, { 0x0EA2, 0x0EA2, 0x0EA2 }, { 0x0EA3, 0x0EA3, 0x0EA3 }, { 0x0EA5, 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EA7, 0x0EA7 }, { 0x0EAA, 0x0EAA, 0x0EAA }, { 0x0EAB, 0x0EAB, 0x0EAB }, { 0x0EAD, 0x0EAD, 0x0EAD }, { 0x0EAE, 0x0EAE, 0x0EAE }, { 0x0EAF, 0x0EAF, 0x0EAF }, { 0x0EB0, 0x0EB0, 0x0EB0 }, { 0x0EB1, 0x0EB1, 0x0EB1 }, { 0x0EB2, 0x0EB2, 0x0EB2 }, { 0x0EB3, 0x0EB3, 0x0EB3 }, { 0x0EB4, 0x0EB4, 0x0EB4 }, { 0x0EB5, 0x0EB5, 0x0EB5 }, { 0x0EB6, 0x0EB6, 0x0EB6 }, { 0x0EB7, 0x0EB7, 0x0EB7 }, { 0x0EB8, 0x0EB8, 0x0EB8 }, { 0x0EB9, 0x0EB9, 0x0EB9 }, { 0x0EBB, 0x0EBB, 0x0EBB }, { 0x0EBC, 0x0EBC, 0x0EBC }, { 0x0EBD, 0x0EBD, 0x0EBD }, { 0x0EC0, 0x0EC0, 0x0EC0 }, { 0x0EC1, 0x0EC1, 0x0EC1 }, { 0x0EC2, 0x0EC2, 0x0EC2 }, { 0x0EC3, 0x0EC3, 0x0EC3 }, { 0x0EC4, 0x0EC4, 0x0EC4 }, { 0x0EC6, 0x0EC6, 0x0EC6 }, { 0x0EC8, 0x0EC8, 0x0EC8 }, { 0x0EC9, 0x0EC9, 0x0EC9 }, { 0x0ECA, 0x0ECA, 0x0ECA }, { 0x0ECB, 0x0ECB, 0x0ECB }, { 0x0ECC, 0x0ECC, 0x0ECC }, { 0x0ECD, 0x0ECD, 0x0ECD }, { 0x0EDC, 0x0EDC, 0x0EDC }, { 0x0EDD, 0x0EDD, 0x0EDD }, { 0x0F00, 0x0F00, 0x0F00 }, { 0x0F18, 0x0F18, 0x0F18 }, { 0x0F19, 0x0F19, 0x0F19 }, { 0x0F35, 0x0F35, 0x0F35 }, { 0x0F37, 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39, 0x0F39 }, { 0x0F40, 0x0F40, 0x0F40 }, { 0x0F41, 0x0F41, 0x0F41 }, { 0x0F42, 0x0F42, 0x0F42 }, { 0x0F43, 0x0F43, 0x0F43 }, { 0x0F44, 0x0F44, 0x0F44 }, { 0x0F45, 0x0F45, 0x0F45 }, { 0x0F46, 0x0F46, 0x0F46 }, { 0x0F47, 0x0F47, 0x0F47 }, { 0x0F49, 0x0F49, 0x0F49 }, { 0x0F4A, 0x0F4A, 0x0F4A }, { 0x0F4B, 0x0F4B, 0x0F4B }, { 0x0F4C, 0x0F4C, 0x0F4C }, { 0x0F4D, 0x0F4D, 0x0F4D }, { 0x0F4E, 0x0F4E, 0x0F4E }, { 0x0F4F, 0x0F4F, 0x0F4F }, { 0x0F50, 0x0F50, 0x0F50 }, { 0x0F51, 0x0F51, 0x0F51 }, { 0x0F52, 0x0F52, 0x0F52 }, { 0x0F53, 0x0F53, 0x0F53 }, { 0x0F54, 0x0F54, 0x0F54 }, { 0x0F55, 0x0F55, 0x0F55 }, { 0x0F56, 0x0F56, 0x0F56 }, { 0x0F57, 0x0F57, 0x0F57 }, { 0x0F58, 0x0F58, 0x0F58 }, { 0x0F59, 0x0F59, 0x0F59 }, { 0x0F5A, 0x0F5A, 0x0F5A }, { 0x0F5B, 0x0F5B, 0x0F5B }, { 0x0F5C, 0x0F5C, 0x0F5C }, { 0x0F5D, 0x0F5D, 0x0F5D }, { 0x0F5E, 0x0F5E, 0x0F5E }, { 0x0F5F, 0x0F5F, 0x0F5F }, { 0x0F60, 0x0F60, 0x0F60 }, { 0x0F61, 0x0F61, 0x0F61 }, { 0x0F62, 0x0F62, 0x0F62 }, { 0x0F63, 0x0F63, 0x0F63 }, { 0x0F64, 0x0F64, 0x0F64 }, { 0x0F65, 0x0F65, 0x0F65 }, { 0x0F66, 0x0F66, 0x0F66 }, { 0x0F67, 0x0F67, 0x0F67 }, { 0x0F68, 0x0F68, 0x0F68 }, { 0x0F69, 0x0F69, 0x0F69 }, { 0x0F6A, 0x0F6A, 0x0F6A }, { 0x0F71, 0x0F71, 0x0F71 }, { 0x0F72, 0x0F72, 0x0F72 }, { 0x0F73, 0x0F73, 0x0F73 }, { 0x0F74, 0x0F74, 0x0F74 }, { 0x0F75, 0x0F75, 0x0F75 }, { 0x0F76, 0x0F76, 0x0F76 }, { 0x0F77, 0x0F77, 0x0F77 }, { 0x0F78, 0x0F78, 0x0F78 }, { 0x0F79, 0x0F79, 0x0F79 }, { 0x0F7A, 0x0F7A, 0x0F7A }, { 0x0F7B, 0x0F7B, 0x0F7B }, { 0x0F7C, 0x0F7C, 0x0F7C }, { 0x0F7D, 0x0F7D, 0x0F7D }, { 0x0F7E, 0x0F7E, 0x0F7E }, { 0x0F80, 0x0F80, 0x0F80 }, { 0x0F81, 0x0F81, 0x0F81 }, { 0x0F82, 0x0F82, 0x0F82 }, { 0x0F83, 0x0F83, 0x0F83 }, { 0x0F84, 0x0F84, 0x0F84 }, { 0x0F86, 0x0F86, 0x0F86 }, { 0x0F87, 0x0F87, 0x0F87 }, { 0x0F88, 0x0F88, 0x0F88 }, { 0x0F89, 0x0F89, 0x0F89 }, { 0x0F8A, 0x0F8A, 0x0F8A }, { 0x0F8B, 0x0F8B, 0x0F8B }, { 0x0F90, 0x0F90, 0x0F90 }, { 0x0F91, 0x0F91, 0x0F91 }, { 0x0F92, 0x0F92, 0x0F92 }, { 0x0F93, 0x0F93, 0x0F93 }, { 0x0F94, 0x0F94, 0x0F94 }, { 0x0F95, 0x0F95, 0x0F95 }, { 0x0F96, 0x0F96, 0x0F96 }, { 0x0F97, 0x0F97, 0x0F97 }, { 0x0F99, 0x0F99, 0x0F99 }, { 0x0F9A, 0x0F9A, 0x0F9A }, { 0x0F9B, 0x0F9B, 0x0F9B }, { 0x0F9C, 0x0F9C, 0x0F9C }, { 0x0F9D, 0x0F9D, 0x0F9D }, { 0x0F9E, 0x0F9E, 0x0F9E }, { 0x0F9F, 0x0F9F, 0x0F9F }, { 0x0FA0, 0x0FA0, 0x0FA0 }, { 0x0FA1, 0x0FA1, 0x0FA1 }, { 0x0FA2, 0x0FA2, 0x0FA2 }, { 0x0FA3, 0x0FA3, 0x0FA3 }, { 0x0FA4, 0x0FA4, 0x0FA4 }, { 0x0FA5, 0x0FA5, 0x0FA5 }, { 0x0FA6, 0x0FA6, 0x0FA6 }, { 0x0FA7, 0x0FA7, 0x0FA7 }, { 0x0FA8, 0x0FA8, 0x0FA8 }, { 0x0FA9, 0x0FA9, 0x0FA9 }, { 0x0FAA, 0x0FAA, 0x0FAA }, { 0x0FAB, 0x0FAB, 0x0FAB }, { 0x0FAC, 0x0FAC, 0x0FAC }, { 0x0FAD, 0x0FAD, 0x0FAD }, { 0x0FAE, 0x0FAE, 0x0FAE }, { 0x0FAF, 0x0FAF, 0x0FAF }, { 0x0FB0, 0x0FB0, 0x0FB0 }, { 0x0FB1, 0x0FB1, 0x0FB1 }, { 0x0FB2, 0x0FB2, 0x0FB2 }, { 0x0FB3, 0x0FB3, 0x0FB3 }, { 0x0FB4, 0x0FB4, 0x0FB4 }, { 0x0FB5, 0x0FB5, 0x0FB5 }, { 0x0FB6, 0x0FB6, 0x0FB6 }, { 0x0FB7, 0x0FB7, 0x0FB7 }, { 0x0FB8, 0x0FB8, 0x0FB8 }, { 0x0FB9, 0x0FB9, 0x0FB9 }, { 0x0FBA, 0x0FBA, 0x0FBA }, { 0x0FBB, 0x0FBB, 0x0FBB }, { 0x0FBC, 0x0FBC, 0x0FBC }, { 0x0FC6, 0x0FC6, 0x0FC6 }, { 0x1000, 0x1000, 0x1000 }, { 0x1001, 0x1001, 0x1001 }, { 0x1002, 0x1002, 0x1002 }, { 0x1003, 0x1003, 0x1003 }, { 0x1004, 0x1004, 0x1004 }, { 0x1005, 0x1005, 0x1005 }, { 0x1006, 0x1006, 0x1006 }, { 0x1007, 0x1007, 0x1007 }, { 0x1008, 0x1008, 0x1008 }, { 0x1009, 0x1009, 0x1009 }, { 0x100A, 0x100A, 0x100A }, { 0x100B, 0x100B, 0x100B }, { 0x100C, 0x100C, 0x100C }, { 0x100D, 0x100D, 0x100D }, { 0x100E, 0x100E, 0x100E }, { 0x100F, 0x100F, 0x100F }, { 0x1010, 0x1010, 0x1010 }, { 0x1011, 0x1011, 0x1011 }, { 0x1012, 0x1012, 0x1012 }, { 0x1013, 0x1013, 0x1013 }, { 0x1014, 0x1014, 0x1014 }, { 0x1015, 0x1015, 0x1015 }, { 0x1016, 0x1016, 0x1016 }, { 0x1017, 0x1017, 0x1017 }, { 0x1018, 0x1018, 0x1018 }, { 0x1019, 0x1019, 0x1019 }, { 0x101A, 0x101A, 0x101A }, { 0x101B, 0x101B, 0x101B }, { 0x101C, 0x101C, 0x101C }, { 0x101D, 0x101D, 0x101D }, { 0x101E, 0x101E, 0x101E }, { 0x101F, 0x101F, 0x101F }, { 0x1020, 0x1020, 0x1020 }, { 0x1021, 0x1021, 0x1021 }, { 0x1023, 0x1023, 0x1023 }, { 0x1024, 0x1024, 0x1024 }, { 0x1025, 0x1025, 0x1025 }, { 0x1026, 0x1026, 0x1026 }, { 0x1027, 0x1027, 0x1027 }, { 0x1029, 0x1029, 0x1029 }, { 0x102A, 0x102A, 0x102A }, { 0x102D, 0x102D, 0x102D }, { 0x102E, 0x102E, 0x102E }, { 0x102F, 0x102F, 0x102F }, { 0x1030, 0x1030, 0x1030 }, { 0x1032, 0x1032, 0x1032 }, { 0x1036, 0x1036, 0x1036 }, { 0x1037, 0x1037, 0x1037 }, { 0x1039, 0x1039, 0x1039 }, { 0x1050, 0x1050, 0x1050 }, { 0x1051, 0x1051, 0x1051 }, { 0x1052, 0x1052, 0x1052 }, { 0x1053, 0x1053, 0x1053 }, { 0x1054, 0x1054, 0x1054 }, { 0x1055, 0x1055, 0x1055 }, { 0x1058, 0x1058, 0x1058 }, { 0x1059, 0x1059, 0x1059 }, { 0x10A0, 0x10A0, 0x2D00 }, { 0x10A1, 0x10A1, 0x2D01 }, { 0x10A2, 0x10A2, 0x2D02 }, { 0x10A3, 0x10A3, 0x2D03 }, { 0x10A4, 0x10A4, 0x2D04 }, { 0x10A5, 0x10A5, 0x2D05 }, { 0x10A6, 0x10A6, 0x2D06 }, { 0x10A7, 0x10A7, 0x2D07 }, { 0x10A8, 0x10A8, 0x2D08 }, { 0x10A9, 0x10A9, 0x2D09 }, { 0x10AA, 0x10AA, 0x2D0A }, { 0x10AB, 0x10AB, 0x2D0B }, { 0x10AC, 0x10AC, 0x2D0C }, { 0x10AD, 0x10AD, 0x2D0D }, { 0x10AE, 0x10AE, 0x2D0E }, { 0x10AF, 0x10AF, 0x2D0F }, { 0x10B0, 0x10B0, 0x2D10 }, { 0x10B1, 0x10B1, 0x2D11 }, { 0x10B2, 0x10B2, 0x2D12 }, { 0x10B3, 0x10B3, 0x2D13 }, { 0x10B4, 0x10B4, 0x2D14 }, { 0x10B5, 0x10B5, 0x2D15 }, { 0x10B6, 0x10B6, 0x2D16 }, { 0x10B7, 0x10B7, 0x2D17 }, { 0x10B8, 0x10B8, 0x2D18 }, { 0x10B9, 0x10B9, 0x2D19 }, { 0x10BA, 0x10BA, 0x2D1A }, { 0x10BB, 0x10BB, 0x2D1B }, { 0x10BC, 0x10BC, 0x2D1C }, { 0x10BD, 0x10BD, 0x2D1D }, { 0x10BE, 0x10BE, 0x2D1E }, { 0x10BF, 0x10BF, 0x2D1F }, { 0x10C0, 0x10C0, 0x2D20 }, { 0x10C1, 0x10C1, 0x2D21 }, { 0x10C2, 0x10C2, 0x2D22 }, { 0x10C3, 0x10C3, 0x2D23 }, { 0x10C4, 0x10C4, 0x2D24 }, { 0x10C5, 0x10C5, 0x2D25 }, { 0x10D0, 0x10D0, 0x10D0 }, { 0x10D1, 0x10D1, 0x10D1 }, { 0x10D2, 0x10D2, 0x10D2 }, { 0x10D3, 0x10D3, 0x10D3 }, { 0x10D4, 0x10D4, 0x10D4 }, { 0x10D5, 0x10D5, 0x10D5 }, { 0x10D6, 0x10D6, 0x10D6 }, { 0x10D7, 0x10D7, 0x10D7 }, { 0x10D8, 0x10D8, 0x10D8 }, { 0x10D9, 0x10D9, 0x10D9 }, { 0x10DA, 0x10DA, 0x10DA }, { 0x10DB, 0x10DB, 0x10DB }, { 0x10DC, 0x10DC, 0x10DC }, { 0x10DD, 0x10DD, 0x10DD }, { 0x10DE, 0x10DE, 0x10DE }, { 0x10DF, 0x10DF, 0x10DF }, { 0x10E0, 0x10E0, 0x10E0 }, { 0x10E1, 0x10E1, 0x10E1 }, { 0x10E2, 0x10E2, 0x10E2 }, { 0x10E3, 0x10E3, 0x10E3 }, { 0x10E4, 0x10E4, 0x10E4 }, { 0x10E5, 0x10E5, 0x10E5 }, { 0x10E6, 0x10E6, 0x10E6 }, { 0x10E7, 0x10E7, 0x10E7 }, { 0x10E8, 0x10E8, 0x10E8 }, { 0x10E9, 0x10E9, 0x10E9 }, { 0x10EA, 0x10EA, 0x10EA }, { 0x10EB, 0x10EB, 0x10EB }, { 0x10EC, 0x10EC, 0x10EC }, { 0x10ED, 0x10ED, 0x10ED }, { 0x10EE, 0x10EE, 0x10EE }, { 0x10EF, 0x10EF, 0x10EF }, { 0x10F0, 0x10F0, 0x10F0 }, { 0x10F1, 0x10F1, 0x10F1 }, { 0x10F2, 0x10F2, 0x10F2 }, { 0x10F3, 0x10F3, 0x10F3 }, { 0x10F4, 0x10F4, 0x10F4 }, { 0x10F5, 0x10F5, 0x10F5 }, { 0x10F6, 0x10F6, 0x10F6 }, { 0x10F7, 0x10F7, 0x10F7 }, { 0x10F8, 0x10F8, 0x10F8 }, { 0x10F9, 0x10F9, 0x10F9 }, { 0x10FA, 0x10FA, 0x10FA }, { 0x10FC, 0x10FC, 0x10FC }, { 0x1100, 0x1100, 0x1100 }, { 0x1101, 0x1101, 0x1101 }, { 0x1102, 0x1102, 0x1102 }, { 0x1103, 0x1103, 0x1103 }, { 0x1104, 0x1104, 0x1104 }, { 0x1105, 0x1105, 0x1105 }, { 0x1106, 0x1106, 0x1106 }, { 0x1107, 0x1107, 0x1107 }, { 0x1108, 0x1108, 0x1108 }, { 0x1109, 0x1109, 0x1109 }, { 0x110A, 0x110A, 0x110A }, { 0x110B, 0x110B, 0x110B }, { 0x110C, 0x110C, 0x110C }, { 0x110D, 0x110D, 0x110D }, { 0x110E, 0x110E, 0x110E }, { 0x110F, 0x110F, 0x110F }, { 0x1110, 0x1110, 0x1110 }, { 0x1111, 0x1111, 0x1111 }, { 0x1112, 0x1112, 0x1112 }, { 0x1113, 0x1113, 0x1113 }, { 0x1114, 0x1114, 0x1114 }, { 0x1115, 0x1115, 0x1115 }, { 0x1116, 0x1116, 0x1116 }, { 0x1117, 0x1117, 0x1117 }, { 0x1118, 0x1118, 0x1118 }, { 0x1119, 0x1119, 0x1119 }, { 0x111A, 0x111A, 0x111A }, { 0x111B, 0x111B, 0x111B }, { 0x111C, 0x111C, 0x111C }, { 0x111D, 0x111D, 0x111D }, { 0x111E, 0x111E, 0x111E }, { 0x111F, 0x111F, 0x111F }, { 0x1120, 0x1120, 0x1120 }, { 0x1121, 0x1121, 0x1121 }, { 0x1122, 0x1122, 0x1122 }, { 0x1123, 0x1123, 0x1123 }, { 0x1124, 0x1124, 0x1124 }, { 0x1125, 0x1125, 0x1125 }, { 0x1126, 0x1126, 0x1126 }, { 0x1127, 0x1127, 0x1127 }, { 0x1128, 0x1128, 0x1128 }, { 0x1129, 0x1129, 0x1129 }, { 0x112A, 0x112A, 0x112A }, { 0x112B, 0x112B, 0x112B }, { 0x112C, 0x112C, 0x112C }, { 0x112D, 0x112D, 0x112D }, { 0x112E, 0x112E, 0x112E }, { 0x112F, 0x112F, 0x112F }, { 0x1130, 0x1130, 0x1130 }, { 0x1131, 0x1131, 0x1131 }, { 0x1132, 0x1132, 0x1132 }, { 0x1133, 0x1133, 0x1133 }, { 0x1134, 0x1134, 0x1134 }, { 0x1135, 0x1135, 0x1135 }, { 0x1136, 0x1136, 0x1136 }, { 0x1137, 0x1137, 0x1137 }, { 0x1138, 0x1138, 0x1138 }, { 0x1139, 0x1139, 0x1139 }, { 0x113A, 0x113A, 0x113A }, { 0x113B, 0x113B, 0x113B }, { 0x113C, 0x113C, 0x113C }, { 0x113D, 0x113D, 0x113D }, { 0x113E, 0x113E, 0x113E }, { 0x113F, 0x113F, 0x113F }, { 0x1140, 0x1140, 0x1140 }, { 0x1141, 0x1141, 0x1141 }, { 0x1142, 0x1142, 0x1142 }, { 0x1143, 0x1143, 0x1143 }, { 0x1144, 0x1144, 0x1144 }, { 0x1145, 0x1145, 0x1145 }, { 0x1146, 0x1146, 0x1146 }, { 0x1147, 0x1147, 0x1147 }, { 0x1148, 0x1148, 0x1148 }, { 0x1149, 0x1149, 0x1149 }, { 0x114A, 0x114A, 0x114A }, { 0x114B, 0x114B, 0x114B }, { 0x114C, 0x114C, 0x114C }, { 0x114D, 0x114D, 0x114D }, { 0x114E, 0x114E, 0x114E }, { 0x114F, 0x114F, 0x114F }, { 0x1150, 0x1150, 0x1150 }, { 0x1151, 0x1151, 0x1151 }, { 0x1152, 0x1152, 0x1152 }, { 0x1153, 0x1153, 0x1153 }, { 0x1154, 0x1154, 0x1154 }, { 0x1155, 0x1155, 0x1155 }, { 0x1156, 0x1156, 0x1156 }, { 0x1157, 0x1157, 0x1157 }, { 0x1158, 0x1158, 0x1158 }, { 0x1159, 0x1159, 0x1159 }, { 0x115F, 0x115F, 0x115F }, { 0x1160, 0x1160, 0x1160 }, { 0x1161, 0x1161, 0x1161 }, { 0x1162, 0x1162, 0x1162 }, { 0x1163, 0x1163, 0x1163 }, { 0x1164, 0x1164, 0x1164 }, { 0x1165, 0x1165, 0x1165 }, { 0x1166, 0x1166, 0x1166 }, { 0x1167, 0x1167, 0x1167 }, { 0x1168, 0x1168, 0x1168 }, { 0x1169, 0x1169, 0x1169 }, { 0x116A, 0x116A, 0x116A }, { 0x116B, 0x116B, 0x116B }, { 0x116C, 0x116C, 0x116C }, { 0x116D, 0x116D, 0x116D }, { 0x116E, 0x116E, 0x116E }, { 0x116F, 0x116F, 0x116F }, { 0x1170, 0x1170, 0x1170 }, { 0x1171, 0x1171, 0x1171 }, { 0x1172, 0x1172, 0x1172 }, { 0x1173, 0x1173, 0x1173 }, { 0x1174, 0x1174, 0x1174 }, { 0x1175, 0x1175, 0x1175 }, { 0x1176, 0x1176, 0x1176 }, { 0x1177, 0x1177, 0x1177 }, { 0x1178, 0x1178, 0x1178 }, { 0x1179, 0x1179, 0x1179 }, { 0x117A, 0x117A, 0x117A }, { 0x117B, 0x117B, 0x117B }, { 0x117C, 0x117C, 0x117C }, { 0x117D, 0x117D, 0x117D }, { 0x117E, 0x117E, 0x117E }, { 0x117F, 0x117F, 0x117F }, { 0x1180, 0x1180, 0x1180 }, { 0x1181, 0x1181, 0x1181 }, { 0x1182, 0x1182, 0x1182 }, { 0x1183, 0x1183, 0x1183 }, { 0x1184, 0x1184, 0x1184 }, { 0x1185, 0x1185, 0x1185 }, { 0x1186, 0x1186, 0x1186 }, { 0x1187, 0x1187, 0x1187 }, { 0x1188, 0x1188, 0x1188 }, { 0x1189, 0x1189, 0x1189 }, { 0x118A, 0x118A, 0x118A }, { 0x118B, 0x118B, 0x118B }, { 0x118C, 0x118C, 0x118C }, { 0x118D, 0x118D, 0x118D }, { 0x118E, 0x118E, 0x118E }, { 0x118F, 0x118F, 0x118F }, { 0x1190, 0x1190, 0x1190 }, { 0x1191, 0x1191, 0x1191 }, { 0x1192, 0x1192, 0x1192 }, { 0x1193, 0x1193, 0x1193 }, { 0x1194, 0x1194, 0x1194 }, { 0x1195, 0x1195, 0x1195 }, { 0x1196, 0x1196, 0x1196 }, { 0x1197, 0x1197, 0x1197 }, { 0x1198, 0x1198, 0x1198 }, { 0x1199, 0x1199, 0x1199 }, { 0x119A, 0x119A, 0x119A }, { 0x119B, 0x119B, 0x119B }, { 0x119C, 0x119C, 0x119C }, { 0x119D, 0x119D, 0x119D }, { 0x119E, 0x119E, 0x119E }, { 0x119F, 0x119F, 0x119F }, { 0x11A0, 0x11A0, 0x11A0 }, { 0x11A1, 0x11A1, 0x11A1 }, { 0x11A2, 0x11A2, 0x11A2 }, { 0x11A8, 0x11A8, 0x11A8 }, { 0x11A9, 0x11A9, 0x11A9 }, { 0x11AA, 0x11AA, 0x11AA }, { 0x11AB, 0x11AB, 0x11AB }, { 0x11AC, 0x11AC, 0x11AC }, { 0x11AD, 0x11AD, 0x11AD }, { 0x11AE, 0x11AE, 0x11AE }, { 0x11AF, 0x11AF, 0x11AF }, { 0x11B0, 0x11B0, 0x11B0 }, { 0x11B1, 0x11B1, 0x11B1 }, { 0x11B2, 0x11B2, 0x11B2 }, { 0x11B3, 0x11B3, 0x11B3 }, { 0x11B4, 0x11B4, 0x11B4 }, { 0x11B5, 0x11B5, 0x11B5 }, { 0x11B6, 0x11B6, 0x11B6 }, { 0x11B7, 0x11B7, 0x11B7 }, { 0x11B8, 0x11B8, 0x11B8 }, { 0x11B9, 0x11B9, 0x11B9 }, { 0x11BA, 0x11BA, 0x11BA }, { 0x11BB, 0x11BB, 0x11BB }, { 0x11BC, 0x11BC, 0x11BC }, { 0x11BD, 0x11BD, 0x11BD }, { 0x11BE, 0x11BE, 0x11BE }, { 0x11BF, 0x11BF, 0x11BF }, { 0x11C0, 0x11C0, 0x11C0 }, { 0x11C1, 0x11C1, 0x11C1 }, { 0x11C2, 0x11C2, 0x11C2 }, { 0x11C3, 0x11C3, 0x11C3 }, { 0x11C4, 0x11C4, 0x11C4 }, { 0x11C5, 0x11C5, 0x11C5 }, { 0x11C6, 0x11C6, 0x11C6 }, { 0x11C7, 0x11C7, 0x11C7 }, { 0x11C8, 0x11C8, 0x11C8 }, { 0x11C9, 0x11C9, 0x11C9 }, { 0x11CA, 0x11CA, 0x11CA }, { 0x11CB, 0x11CB, 0x11CB }, { 0x11CC, 0x11CC, 0x11CC }, { 0x11CD, 0x11CD, 0x11CD }, { 0x11CE, 0x11CE, 0x11CE }, { 0x11CF, 0x11CF, 0x11CF }, { 0x11D0, 0x11D0, 0x11D0 }, { 0x11D1, 0x11D1, 0x11D1 }, { 0x11D2, 0x11D2, 0x11D2 }, { 0x11D3, 0x11D3, 0x11D3 }, { 0x11D4, 0x11D4, 0x11D4 }, { 0x11D5, 0x11D5, 0x11D5 }, { 0x11D6, 0x11D6, 0x11D6 }, { 0x11D7, 0x11D7, 0x11D7 }, { 0x11D8, 0x11D8, 0x11D8 }, { 0x11D9, 0x11D9, 0x11D9 }, { 0x11DA, 0x11DA, 0x11DA }, { 0x11DB, 0x11DB, 0x11DB }, { 0x11DC, 0x11DC, 0x11DC }, { 0x11DD, 0x11DD, 0x11DD }, { 0x11DE, 0x11DE, 0x11DE }, { 0x11DF, 0x11DF, 0x11DF }, { 0x11E0, 0x11E0, 0x11E0 }, { 0x11E1, 0x11E1, 0x11E1 }, { 0x11E2, 0x11E2, 0x11E2 }, { 0x11E3, 0x11E3, 0x11E3 }, { 0x11E4, 0x11E4, 0x11E4 }, { 0x11E5, 0x11E5, 0x11E5 }, { 0x11E6, 0x11E6, 0x11E6 }, { 0x11E7, 0x11E7, 0x11E7 }, { 0x11E8, 0x11E8, 0x11E8 }, { 0x11E9, 0x11E9, 0x11E9 }, { 0x11EA, 0x11EA, 0x11EA }, { 0x11EB, 0x11EB, 0x11EB }, { 0x11EC, 0x11EC, 0x11EC }, { 0x11ED, 0x11ED, 0x11ED }, { 0x11EE, 0x11EE, 0x11EE }, { 0x11EF, 0x11EF, 0x11EF }, { 0x11F0, 0x11F0, 0x11F0 }, { 0x11F1, 0x11F1, 0x11F1 }, { 0x11F2, 0x11F2, 0x11F2 }, { 0x11F3, 0x11F3, 0x11F3 }, { 0x11F4, 0x11F4, 0x11F4 }, { 0x11F5, 0x11F5, 0x11F5 }, { 0x11F6, 0x11F6, 0x11F6 }, { 0x11F7, 0x11F7, 0x11F7 }, { 0x11F8, 0x11F8, 0x11F8 }, { 0x11F9, 0x11F9, 0x11F9 }, { 0x1200, 0x1200, 0x1200 }, { 0x1201, 0x1201, 0x1201 }, { 0x1202, 0x1202, 0x1202 }, { 0x1203, 0x1203, 0x1203 }, { 0x1204, 0x1204, 0x1204 }, { 0x1205, 0x1205, 0x1205 }, { 0x1206, 0x1206, 0x1206 }, { 0x1207, 0x1207, 0x1207 }, { 0x1208, 0x1208, 0x1208 }, { 0x1209, 0x1209, 0x1209 }, { 0x120A, 0x120A, 0x120A }, { 0x120B, 0x120B, 0x120B }, { 0x120C, 0x120C, 0x120C }, { 0x120D, 0x120D, 0x120D }, { 0x120E, 0x120E, 0x120E }, { 0x120F, 0x120F, 0x120F }, { 0x1210, 0x1210, 0x1210 }, { 0x1211, 0x1211, 0x1211 }, { 0x1212, 0x1212, 0x1212 }, { 0x1213, 0x1213, 0x1213 }, { 0x1214, 0x1214, 0x1214 }, { 0x1215, 0x1215, 0x1215 }, { 0x1216, 0x1216, 0x1216 }, { 0x1217, 0x1217, 0x1217 }, { 0x1218, 0x1218, 0x1218 }, { 0x1219, 0x1219, 0x1219 }, { 0x121A, 0x121A, 0x121A }, { 0x121B, 0x121B, 0x121B }, { 0x121C, 0x121C, 0x121C }, { 0x121D, 0x121D, 0x121D }, { 0x121E, 0x121E, 0x121E }, { 0x121F, 0x121F, 0x121F }, { 0x1220, 0x1220, 0x1220 }, { 0x1221, 0x1221, 0x1221 }, { 0x1222, 0x1222, 0x1222 }, { 0x1223, 0x1223, 0x1223 }, { 0x1224, 0x1224, 0x1224 }, { 0x1225, 0x1225, 0x1225 }, { 0x1226, 0x1226, 0x1226 }, { 0x1227, 0x1227, 0x1227 }, { 0x1228, 0x1228, 0x1228 }, { 0x1229, 0x1229, 0x1229 }, { 0x122A, 0x122A, 0x122A }, { 0x122B, 0x122B, 0x122B }, { 0x122C, 0x122C, 0x122C }, { 0x122D, 0x122D, 0x122D }, { 0x122E, 0x122E, 0x122E }, { 0x122F, 0x122F, 0x122F }, { 0x1230, 0x1230, 0x1230 }, { 0x1231, 0x1231, 0x1231 }, { 0x1232, 0x1232, 0x1232 }, { 0x1233, 0x1233, 0x1233 }, { 0x1234, 0x1234, 0x1234 }, { 0x1235, 0x1235, 0x1235 }, { 0x1236, 0x1236, 0x1236 }, { 0x1237, 0x1237, 0x1237 }, { 0x1238, 0x1238, 0x1238 }, { 0x1239, 0x1239, 0x1239 }, { 0x123A, 0x123A, 0x123A }, { 0x123B, 0x123B, 0x123B }, { 0x123C, 0x123C, 0x123C }, { 0x123D, 0x123D, 0x123D }, { 0x123E, 0x123E, 0x123E }, { 0x123F, 0x123F, 0x123F }, { 0x1240, 0x1240, 0x1240 }, { 0x1241, 0x1241, 0x1241 }, { 0x1242, 0x1242, 0x1242 }, { 0x1243, 0x1243, 0x1243 }, { 0x1244, 0x1244, 0x1244 }, { 0x1245, 0x1245, 0x1245 }, { 0x1246, 0x1246, 0x1246 }, { 0x1247, 0x1247, 0x1247 }, { 0x1248, 0x1248, 0x1248 }, { 0x124A, 0x124A, 0x124A }, { 0x124B, 0x124B, 0x124B }, { 0x124C, 0x124C, 0x124C }, { 0x124D, 0x124D, 0x124D }, { 0x1250, 0x1250, 0x1250 }, { 0x1251, 0x1251, 0x1251 }, { 0x1252, 0x1252, 0x1252 }, { 0x1253, 0x1253, 0x1253 }, { 0x1254, 0x1254, 0x1254 }, { 0x1255, 0x1255, 0x1255 }, { 0x1256, 0x1256, 0x1256 }, { 0x1258, 0x1258, 0x1258 }, { 0x125A, 0x125A, 0x125A }, { 0x125B, 0x125B, 0x125B }, { 0x125C, 0x125C, 0x125C }, { 0x125D, 0x125D, 0x125D }, { 0x1260, 0x1260, 0x1260 }, { 0x1261, 0x1261, 0x1261 }, { 0x1262, 0x1262, 0x1262 }, { 0x1263, 0x1263, 0x1263 }, { 0x1264, 0x1264, 0x1264 }, { 0x1265, 0x1265, 0x1265 }, { 0x1266, 0x1266, 0x1266 }, { 0x1267, 0x1267, 0x1267 }, { 0x1268, 0x1268, 0x1268 }, { 0x1269, 0x1269, 0x1269 }, { 0x126A, 0x126A, 0x126A }, { 0x126B, 0x126B, 0x126B }, { 0x126C, 0x126C, 0x126C }, { 0x126D, 0x126D, 0x126D }, { 0x126E, 0x126E, 0x126E }, { 0x126F, 0x126F, 0x126F }, { 0x1270, 0x1270, 0x1270 }, { 0x1271, 0x1271, 0x1271 }, { 0x1272, 0x1272, 0x1272 }, { 0x1273, 0x1273, 0x1273 }, { 0x1274, 0x1274, 0x1274 }, { 0x1275, 0x1275, 0x1275 }, { 0x1276, 0x1276, 0x1276 }, { 0x1277, 0x1277, 0x1277 }, { 0x1278, 0x1278, 0x1278 }, { 0x1279, 0x1279, 0x1279 }, { 0x127A, 0x127A, 0x127A }, { 0x127B, 0x127B, 0x127B }, { 0x127C, 0x127C, 0x127C }, { 0x127D, 0x127D, 0x127D }, { 0x127E, 0x127E, 0x127E }, { 0x127F, 0x127F, 0x127F }, { 0x1280, 0x1280, 0x1280 }, { 0x1281, 0x1281, 0x1281 }, { 0x1282, 0x1282, 0x1282 }, { 0x1283, 0x1283, 0x1283 }, { 0x1284, 0x1284, 0x1284 }, { 0x1285, 0x1285, 0x1285 }, { 0x1286, 0x1286, 0x1286 }, { 0x1287, 0x1287, 0x1287 }, { 0x1288, 0x1288, 0x1288 }, { 0x128A, 0x128A, 0x128A }, { 0x128B, 0x128B, 0x128B }, { 0x128C, 0x128C, 0x128C }, { 0x128D, 0x128D, 0x128D }, { 0x1290, 0x1290, 0x1290 }, { 0x1291, 0x1291, 0x1291 }, { 0x1292, 0x1292, 0x1292 }, { 0x1293, 0x1293, 0x1293 }, { 0x1294, 0x1294, 0x1294 }, { 0x1295, 0x1295, 0x1295 }, { 0x1296, 0x1296, 0x1296 }, { 0x1297, 0x1297, 0x1297 }, { 0x1298, 0x1298, 0x1298 }, { 0x1299, 0x1299, 0x1299 }, { 0x129A, 0x129A, 0x129A }, { 0x129B, 0x129B, 0x129B }, { 0x129C, 0x129C, 0x129C }, { 0x129D, 0x129D, 0x129D }, { 0x129E, 0x129E, 0x129E }, { 0x129F, 0x129F, 0x129F }, { 0x12A0, 0x12A0, 0x12A0 }, { 0x12A1, 0x12A1, 0x12A1 }, { 0x12A2, 0x12A2, 0x12A2 }, { 0x12A3, 0x12A3, 0x12A3 }, { 0x12A4, 0x12A4, 0x12A4 }, { 0x12A5, 0x12A5, 0x12A5 }, { 0x12A6, 0x12A6, 0x12A6 }, { 0x12A7, 0x12A7, 0x12A7 }, { 0x12A8, 0x12A8, 0x12A8 }, { 0x12A9, 0x12A9, 0x12A9 }, { 0x12AA, 0x12AA, 0x12AA }, { 0x12AB, 0x12AB, 0x12AB }, { 0x12AC, 0x12AC, 0x12AC }, { 0x12AD, 0x12AD, 0x12AD }, { 0x12AE, 0x12AE, 0x12AE }, { 0x12AF, 0x12AF, 0x12AF }, { 0x12B0, 0x12B0, 0x12B0 }, { 0x12B2, 0x12B2, 0x12B2 }, { 0x12B3, 0x12B3, 0x12B3 }, { 0x12B4, 0x12B4, 0x12B4 }, { 0x12B5, 0x12B5, 0x12B5 }, { 0x12B8, 0x12B8, 0x12B8 }, { 0x12B9, 0x12B9, 0x12B9 }, { 0x12BA, 0x12BA, 0x12BA }, { 0x12BB, 0x12BB, 0x12BB }, { 0x12BC, 0x12BC, 0x12BC }, { 0x12BD, 0x12BD, 0x12BD }, { 0x12BE, 0x12BE, 0x12BE }, { 0x12C0, 0x12C0, 0x12C0 }, { 0x12C2, 0x12C2, 0x12C2 }, { 0x12C3, 0x12C3, 0x12C3 }, { 0x12C4, 0x12C4, 0x12C4 }, { 0x12C5, 0x12C5, 0x12C5 }, { 0x12C8, 0x12C8, 0x12C8 }, { 0x12C9, 0x12C9, 0x12C9 }, { 0x12CA, 0x12CA, 0x12CA }, { 0x12CB, 0x12CB, 0x12CB }, { 0x12CC, 0x12CC, 0x12CC }, { 0x12CD, 0x12CD, 0x12CD }, { 0x12CE, 0x12CE, 0x12CE }, { 0x12CF, 0x12CF, 0x12CF }, { 0x12D0, 0x12D0, 0x12D0 }, { 0x12D1, 0x12D1, 0x12D1 }, { 0x12D2, 0x12D2, 0x12D2 }, { 0x12D3, 0x12D3, 0x12D3 }, { 0x12D4, 0x12D4, 0x12D4 }, { 0x12D5, 0x12D5, 0x12D5 }, { 0x12D6, 0x12D6, 0x12D6 }, { 0x12D8, 0x12D8, 0x12D8 }, { 0x12D9, 0x12D9, 0x12D9 }, { 0x12DA, 0x12DA, 0x12DA }, { 0x12DB, 0x12DB, 0x12DB }, { 0x12DC, 0x12DC, 0x12DC }, { 0x12DD, 0x12DD, 0x12DD }, { 0x12DE, 0x12DE, 0x12DE }, { 0x12DF, 0x12DF, 0x12DF }, { 0x12E0, 0x12E0, 0x12E0 }, { 0x12E1, 0x12E1, 0x12E1 }, { 0x12E2, 0x12E2, 0x12E2 }, { 0x12E3, 0x12E3, 0x12E3 }, { 0x12E4, 0x12E4, 0x12E4 }, { 0x12E5, 0x12E5, 0x12E5 }, { 0x12E6, 0x12E6, 0x12E6 }, { 0x12E7, 0x12E7, 0x12E7 }, { 0x12E8, 0x12E8, 0x12E8 }, { 0x12E9, 0x12E9, 0x12E9 }, { 0x12EA, 0x12EA, 0x12EA }, { 0x12EB, 0x12EB, 0x12EB }, { 0x12EC, 0x12EC, 0x12EC }, { 0x12ED, 0x12ED, 0x12ED }, { 0x12EE, 0x12EE, 0x12EE }, { 0x12EF, 0x12EF, 0x12EF }, { 0x12F0, 0x12F0, 0x12F0 }, { 0x12F1, 0x12F1, 0x12F1 }, { 0x12F2, 0x12F2, 0x12F2 }, { 0x12F3, 0x12F3, 0x12F3 }, { 0x12F4, 0x12F4, 0x12F4 }, { 0x12F5, 0x12F5, 0x12F5 }, { 0x12F6, 0x12F6, 0x12F6 }, { 0x12F7, 0x12F7, 0x12F7 }, { 0x12F8, 0x12F8, 0x12F8 }, { 0x12F9, 0x12F9, 0x12F9 }, { 0x12FA, 0x12FA, 0x12FA }, { 0x12FB, 0x12FB, 0x12FB }, { 0x12FC, 0x12FC, 0x12FC }, { 0x12FD, 0x12FD, 0x12FD }, { 0x12FE, 0x12FE, 0x12FE }, { 0x12FF, 0x12FF, 0x12FF }, { 0x1300, 0x1300, 0x1300 }, { 0x1301, 0x1301, 0x1301 }, { 0x1302, 0x1302, 0x1302 }, { 0x1303, 0x1303, 0x1303 }, { 0x1304, 0x1304, 0x1304 }, { 0x1305, 0x1305, 0x1305 }, { 0x1306, 0x1306, 0x1306 }, { 0x1307, 0x1307, 0x1307 }, { 0x1308, 0x1308, 0x1308 }, { 0x1309, 0x1309, 0x1309 }, { 0x130A, 0x130A, 0x130A }, { 0x130B, 0x130B, 0x130B }, { 0x130C, 0x130C, 0x130C }, { 0x130D, 0x130D, 0x130D }, { 0x130E, 0x130E, 0x130E }, { 0x130F, 0x130F, 0x130F }, { 0x1310, 0x1310, 0x1310 }, { 0x1312, 0x1312, 0x1312 }, { 0x1313, 0x1313, 0x1313 }, { 0x1314, 0x1314, 0x1314 }, { 0x1315, 0x1315, 0x1315 }, { 0x1318, 0x1318, 0x1318 }, { 0x1319, 0x1319, 0x1319 }, { 0x131A, 0x131A, 0x131A }, { 0x131B, 0x131B, 0x131B }, { 0x131C, 0x131C, 0x131C }, { 0x131D, 0x131D, 0x131D }, { 0x131E, 0x131E, 0x131E }, { 0x131F, 0x131F, 0x131F }, { 0x1320, 0x1320, 0x1320 }, { 0x1321, 0x1321, 0x1321 }, { 0x1322, 0x1322, 0x1322 }, { 0x1323, 0x1323, 0x1323 }, { 0x1324, 0x1324, 0x1324 }, { 0x1325, 0x1325, 0x1325 }, { 0x1326, 0x1326, 0x1326 }, { 0x1327, 0x1327, 0x1327 }, { 0x1328, 0x1328, 0x1328 }, { 0x1329, 0x1329, 0x1329 }, { 0x132A, 0x132A, 0x132A }, { 0x132B, 0x132B, 0x132B }, { 0x132C, 0x132C, 0x132C }, { 0x132D, 0x132D, 0x132D }, { 0x132E, 0x132E, 0x132E }, { 0x132F, 0x132F, 0x132F }, { 0x1330, 0x1330, 0x1330 }, { 0x1331, 0x1331, 0x1331 }, { 0x1332, 0x1332, 0x1332 }, { 0x1333, 0x1333, 0x1333 }, { 0x1334, 0x1334, 0x1334 }, { 0x1335, 0x1335, 0x1335 }, { 0x1336, 0x1336, 0x1336 }, { 0x1337, 0x1337, 0x1337 }, { 0x1338, 0x1338, 0x1338 }, { 0x1339, 0x1339, 0x1339 }, { 0x133A, 0x133A, 0x133A }, { 0x133B, 0x133B, 0x133B }, { 0x133C, 0x133C, 0x133C }, { 0x133D, 0x133D, 0x133D }, { 0x133E, 0x133E, 0x133E }, { 0x133F, 0x133F, 0x133F }, { 0x1340, 0x1340, 0x1340 }, { 0x1341, 0x1341, 0x1341 }, { 0x1342, 0x1342, 0x1342 }, { 0x1343, 0x1343, 0x1343 }, { 0x1344, 0x1344, 0x1344 }, { 0x1345, 0x1345, 0x1345 }, { 0x1346, 0x1346, 0x1346 }, { 0x1347, 0x1347, 0x1347 }, { 0x1348, 0x1348, 0x1348 }, { 0x1349, 0x1349, 0x1349 }, { 0x134A, 0x134A, 0x134A }, { 0x134B, 0x134B, 0x134B }, { 0x134C, 0x134C, 0x134C }, { 0x134D, 0x134D, 0x134D }, { 0x134E, 0x134E, 0x134E }, { 0x134F, 0x134F, 0x134F }, { 0x1350, 0x1350, 0x1350 }, { 0x1351, 0x1351, 0x1351 }, { 0x1352, 0x1352, 0x1352 }, { 0x1353, 0x1353, 0x1353 }, { 0x1354, 0x1354, 0x1354 }, { 0x1355, 0x1355, 0x1355 }, { 0x1356, 0x1356, 0x1356 }, { 0x1357, 0x1357, 0x1357 }, { 0x1358, 0x1358, 0x1358 }, { 0x1359, 0x1359, 0x1359 }, { 0x135A, 0x135A, 0x135A }, { 0x135F, 0x135F, 0x135F }, { 0x1380, 0x1380, 0x1380 }, { 0x1381, 0x1381, 0x1381 }, { 0x1382, 0x1382, 0x1382 }, { 0x1383, 0x1383, 0x1383 }, { 0x1384, 0x1384, 0x1384 }, { 0x1385, 0x1385, 0x1385 }, { 0x1386, 0x1386, 0x1386 }, { 0x1387, 0x1387, 0x1387 }, { 0x1388, 0x1388, 0x1388 }, { 0x1389, 0x1389, 0x1389 }, { 0x138A, 0x138A, 0x138A }, { 0x138B, 0x138B, 0x138B }, { 0x138C, 0x138C, 0x138C }, { 0x138D, 0x138D, 0x138D }, { 0x138E, 0x138E, 0x138E }, { 0x138F, 0x138F, 0x138F }, { 0x13A0, 0x13A0, 0x13A0 }, { 0x13A1, 0x13A1, 0x13A1 }, { 0x13A2, 0x13A2, 0x13A2 }, { 0x13A3, 0x13A3, 0x13A3 }, { 0x13A4, 0x13A4, 0x13A4 }, { 0x13A5, 0x13A5, 0x13A5 }, { 0x13A6, 0x13A6, 0x13A6 }, { 0x13A7, 0x13A7, 0x13A7 }, { 0x13A8, 0x13A8, 0x13A8 }, { 0x13A9, 0x13A9, 0x13A9 }, { 0x13AA, 0x13AA, 0x13AA }, { 0x13AB, 0x13AB, 0x13AB }, { 0x13AC, 0x13AC, 0x13AC }, { 0x13AD, 0x13AD, 0x13AD }, { 0x13AE, 0x13AE, 0x13AE }, { 0x13AF, 0x13AF, 0x13AF }, { 0x13B0, 0x13B0, 0x13B0 }, { 0x13B1, 0x13B1, 0x13B1 }, { 0x13B2, 0x13B2, 0x13B2 }, { 0x13B3, 0x13B3, 0x13B3 }, { 0x13B4, 0x13B4, 0x13B4 }, { 0x13B5, 0x13B5, 0x13B5 }, { 0x13B6, 0x13B6, 0x13B6 }, { 0x13B7, 0x13B7, 0x13B7 }, { 0x13B8, 0x13B8, 0x13B8 }, { 0x13B9, 0x13B9, 0x13B9 }, { 0x13BA, 0x13BA, 0x13BA }, { 0x13BB, 0x13BB, 0x13BB }, { 0x13BC, 0x13BC, 0x13BC }, { 0x13BD, 0x13BD, 0x13BD }, { 0x13BE, 0x13BE, 0x13BE }, { 0x13BF, 0x13BF, 0x13BF }, { 0x13C0, 0x13C0, 0x13C0 }, { 0x13C1, 0x13C1, 0x13C1 }, { 0x13C2, 0x13C2, 0x13C2 }, { 0x13C3, 0x13C3, 0x13C3 }, { 0x13C4, 0x13C4, 0x13C4 }, { 0x13C5, 0x13C5, 0x13C5 }, { 0x13C6, 0x13C6, 0x13C6 }, { 0x13C7, 0x13C7, 0x13C7 }, { 0x13C8, 0x13C8, 0x13C8 }, { 0x13C9, 0x13C9, 0x13C9 }, { 0x13CA, 0x13CA, 0x13CA }, { 0x13CB, 0x13CB, 0x13CB }, { 0x13CC, 0x13CC, 0x13CC }, { 0x13CD, 0x13CD, 0x13CD }, { 0x13CE, 0x13CE, 0x13CE }, { 0x13CF, 0x13CF, 0x13CF }, { 0x13D0, 0x13D0, 0x13D0 }, { 0x13D1, 0x13D1, 0x13D1 }, { 0x13D2, 0x13D2, 0x13D2 }, { 0x13D3, 0x13D3, 0x13D3 }, { 0x13D4, 0x13D4, 0x13D4 }, { 0x13D5, 0x13D5, 0x13D5 }, { 0x13D6, 0x13D6, 0x13D6 }, { 0x13D7, 0x13D7, 0x13D7 }, { 0x13D8, 0x13D8, 0x13D8 }, { 0x13D9, 0x13D9, 0x13D9 }, { 0x13DA, 0x13DA, 0x13DA }, { 0x13DB, 0x13DB, 0x13DB }, { 0x13DC, 0x13DC, 0x13DC }, { 0x13DD, 0x13DD, 0x13DD }, { 0x13DE, 0x13DE, 0x13DE }, { 0x13DF, 0x13DF, 0x13DF }, { 0x13E0, 0x13E0, 0x13E0 }, { 0x13E1, 0x13E1, 0x13E1 }, { 0x13E2, 0x13E2, 0x13E2 }, { 0x13E3, 0x13E3, 0x13E3 }, { 0x13E4, 0x13E4, 0x13E4 }, { 0x13E5, 0x13E5, 0x13E5 }, { 0x13E6, 0x13E6, 0x13E6 }, { 0x13E7, 0x13E7, 0x13E7 }, { 0x13E8, 0x13E8, 0x13E8 }, { 0x13E9, 0x13E9, 0x13E9 }, { 0x13EA, 0x13EA, 0x13EA }, { 0x13EB, 0x13EB, 0x13EB }, { 0x13EC, 0x13EC, 0x13EC }, { 0x13ED, 0x13ED, 0x13ED }, { 0x13EE, 0x13EE, 0x13EE }, { 0x13EF, 0x13EF, 0x13EF }, { 0x13F0, 0x13F0, 0x13F0 }, { 0x13F1, 0x13F1, 0x13F1 }, { 0x13F2, 0x13F2, 0x13F2 }, { 0x13F3, 0x13F3, 0x13F3 }, { 0x13F4, 0x13F4, 0x13F4 }, { 0x1401, 0x1401, 0x1401 }, { 0x1402, 0x1402, 0x1402 }, { 0x1403, 0x1403, 0x1403 }, { 0x1404, 0x1404, 0x1404 }, { 0x1405, 0x1405, 0x1405 }, { 0x1406, 0x1406, 0x1406 }, { 0x1407, 0x1407, 0x1407 }, { 0x1408, 0x1408, 0x1408 }, { 0x1409, 0x1409, 0x1409 }, { 0x140A, 0x140A, 0x140A }, { 0x140B, 0x140B, 0x140B }, { 0x140C, 0x140C, 0x140C }, { 0x140D, 0x140D, 0x140D }, { 0x140E, 0x140E, 0x140E }, { 0x140F, 0x140F, 0x140F }, { 0x1410, 0x1410, 0x1410 }, { 0x1411, 0x1411, 0x1411 }, { 0x1412, 0x1412, 0x1412 }, { 0x1413, 0x1413, 0x1413 }, { 0x1414, 0x1414, 0x1414 }, { 0x1415, 0x1415, 0x1415 }, { 0x1416, 0x1416, 0x1416 }, { 0x1417, 0x1417, 0x1417 }, { 0x1418, 0x1418, 0x1418 }, { 0x1419, 0x1419, 0x1419 }, { 0x141A, 0x141A, 0x141A }, { 0x141B, 0x141B, 0x141B }, { 0x141C, 0x141C, 0x141C }, { 0x141D, 0x141D, 0x141D }, { 0x141E, 0x141E, 0x141E }, { 0x141F, 0x141F, 0x141F }, { 0x1420, 0x1420, 0x1420 }, { 0x1421, 0x1421, 0x1421 }, { 0x1422, 0x1422, 0x1422 }, { 0x1423, 0x1423, 0x1423 }, { 0x1424, 0x1424, 0x1424 }, { 0x1425, 0x1425, 0x1425 }, { 0x1426, 0x1426, 0x1426 }, { 0x1427, 0x1427, 0x1427 }, { 0x1428, 0x1428, 0x1428 }, { 0x1429, 0x1429, 0x1429 }, { 0x142A, 0x142A, 0x142A }, { 0x142B, 0x142B, 0x142B }, { 0x142C, 0x142C, 0x142C }, { 0x142D, 0x142D, 0x142D }, { 0x142E, 0x142E, 0x142E }, { 0x142F, 0x142F, 0x142F }, { 0x1430, 0x1430, 0x1430 }, { 0x1431, 0x1431, 0x1431 }, { 0x1432, 0x1432, 0x1432 }, { 0x1433, 0x1433, 0x1433 }, { 0x1434, 0x1434, 0x1434 }, { 0x1435, 0x1435, 0x1435 }, { 0x1436, 0x1436, 0x1436 }, { 0x1437, 0x1437, 0x1437 }, { 0x1438, 0x1438, 0x1438 }, { 0x1439, 0x1439, 0x1439 }, { 0x143A, 0x143A, 0x143A }, { 0x143B, 0x143B, 0x143B }, { 0x143C, 0x143C, 0x143C }, { 0x143D, 0x143D, 0x143D }, { 0x143E, 0x143E, 0x143E }, { 0x143F, 0x143F, 0x143F }, { 0x1440, 0x1440, 0x1440 }, { 0x1441, 0x1441, 0x1441 }, { 0x1442, 0x1442, 0x1442 }, { 0x1443, 0x1443, 0x1443 }, { 0x1444, 0x1444, 0x1444 }, { 0x1445, 0x1445, 0x1445 }, { 0x1446, 0x1446, 0x1446 }, { 0x1447, 0x1447, 0x1447 }, { 0x1448, 0x1448, 0x1448 }, { 0x1449, 0x1449, 0x1449 }, { 0x144A, 0x144A, 0x144A }, { 0x144B, 0x144B, 0x144B }, { 0x144C, 0x144C, 0x144C }, { 0x144D, 0x144D, 0x144D }, { 0x144E, 0x144E, 0x144E }, { 0x144F, 0x144F, 0x144F }, { 0x1450, 0x1450, 0x1450 }, { 0x1451, 0x1451, 0x1451 }, { 0x1452, 0x1452, 0x1452 }, { 0x1453, 0x1453, 0x1453 }, { 0x1454, 0x1454, 0x1454 }, { 0x1455, 0x1455, 0x1455 }, { 0x1456, 0x1456, 0x1456 }, { 0x1457, 0x1457, 0x1457 }, { 0x1458, 0x1458, 0x1458 }, { 0x1459, 0x1459, 0x1459 }, { 0x145A, 0x145A, 0x145A }, { 0x145B, 0x145B, 0x145B }, { 0x145C, 0x145C, 0x145C }, { 0x145D, 0x145D, 0x145D }, { 0x145E, 0x145E, 0x145E }, { 0x145F, 0x145F, 0x145F }, { 0x1460, 0x1460, 0x1460 }, { 0x1461, 0x1461, 0x1461 }, { 0x1462, 0x1462, 0x1462 }, { 0x1463, 0x1463, 0x1463 }, { 0x1464, 0x1464, 0x1464 }, { 0x1465, 0x1465, 0x1465 }, { 0x1466, 0x1466, 0x1466 }, { 0x1467, 0x1467, 0x1467 }, { 0x1468, 0x1468, 0x1468 }, { 0x1469, 0x1469, 0x1469 }, { 0x146A, 0x146A, 0x146A }, { 0x146B, 0x146B, 0x146B }, { 0x146C, 0x146C, 0x146C }, { 0x146D, 0x146D, 0x146D }, { 0x146E, 0x146E, 0x146E }, { 0x146F, 0x146F, 0x146F }, { 0x1470, 0x1470, 0x1470 }, { 0x1471, 0x1471, 0x1471 }, { 0x1472, 0x1472, 0x1472 }, { 0x1473, 0x1473, 0x1473 }, { 0x1474, 0x1474, 0x1474 }, { 0x1475, 0x1475, 0x1475 }, { 0x1476, 0x1476, 0x1476 }, { 0x1477, 0x1477, 0x1477 }, { 0x1478, 0x1478, 0x1478 }, { 0x1479, 0x1479, 0x1479 }, { 0x147A, 0x147A, 0x147A }, { 0x147B, 0x147B, 0x147B }, { 0x147C, 0x147C, 0x147C }, { 0x147D, 0x147D, 0x147D }, { 0x147E, 0x147E, 0x147E }, { 0x147F, 0x147F, 0x147F }, { 0x1480, 0x1480, 0x1480 }, { 0x1481, 0x1481, 0x1481 }, { 0x1482, 0x1482, 0x1482 }, { 0x1483, 0x1483, 0x1483 }, { 0x1484, 0x1484, 0x1484 }, { 0x1485, 0x1485, 0x1485 }, { 0x1486, 0x1486, 0x1486 }, { 0x1487, 0x1487, 0x1487 }, { 0x1488, 0x1488, 0x1488 }, { 0x1489, 0x1489, 0x1489 }, { 0x148A, 0x148A, 0x148A }, { 0x148B, 0x148B, 0x148B }, { 0x148C, 0x148C, 0x148C }, { 0x148D, 0x148D, 0x148D }, { 0x148E, 0x148E, 0x148E }, { 0x148F, 0x148F, 0x148F }, { 0x1490, 0x1490, 0x1490 }, { 0x1491, 0x1491, 0x1491 }, { 0x1492, 0x1492, 0x1492 }, { 0x1493, 0x1493, 0x1493 }, { 0x1494, 0x1494, 0x1494 }, { 0x1495, 0x1495, 0x1495 }, { 0x1496, 0x1496, 0x1496 }, { 0x1497, 0x1497, 0x1497 }, { 0x1498, 0x1498, 0x1498 }, { 0x1499, 0x1499, 0x1499 }, { 0x149A, 0x149A, 0x149A }, { 0x149B, 0x149B, 0x149B }, { 0x149C, 0x149C, 0x149C }, { 0x149D, 0x149D, 0x149D }, { 0x149E, 0x149E, 0x149E }, { 0x149F, 0x149F, 0x149F }, { 0x14A0, 0x14A0, 0x14A0 }, { 0x14A1, 0x14A1, 0x14A1 }, { 0x14A2, 0x14A2, 0x14A2 }, { 0x14A3, 0x14A3, 0x14A3 }, { 0x14A4, 0x14A4, 0x14A4 }, { 0x14A5, 0x14A5, 0x14A5 }, { 0x14A6, 0x14A6, 0x14A6 }, { 0x14A7, 0x14A7, 0x14A7 }, { 0x14A8, 0x14A8, 0x14A8 }, { 0x14A9, 0x14A9, 0x14A9 }, { 0x14AA, 0x14AA, 0x14AA }, { 0x14AB, 0x14AB, 0x14AB }, { 0x14AC, 0x14AC, 0x14AC }, { 0x14AD, 0x14AD, 0x14AD }, { 0x14AE, 0x14AE, 0x14AE }, { 0x14AF, 0x14AF, 0x14AF }, { 0x14B0, 0x14B0, 0x14B0 }, { 0x14B1, 0x14B1, 0x14B1 }, { 0x14B2, 0x14B2, 0x14B2 }, { 0x14B3, 0x14B3, 0x14B3 }, { 0x14B4, 0x14B4, 0x14B4 }, { 0x14B5, 0x14B5, 0x14B5 }, { 0x14B6, 0x14B6, 0x14B6 }, { 0x14B7, 0x14B7, 0x14B7 }, { 0x14B8, 0x14B8, 0x14B8 }, { 0x14B9, 0x14B9, 0x14B9 }, { 0x14BA, 0x14BA, 0x14BA }, { 0x14BB, 0x14BB, 0x14BB }, { 0x14BC, 0x14BC, 0x14BC }, { 0x14BD, 0x14BD, 0x14BD }, { 0x14BE, 0x14BE, 0x14BE }, { 0x14BF, 0x14BF, 0x14BF }, { 0x14C0, 0x14C0, 0x14C0 }, { 0x14C1, 0x14C1, 0x14C1 }, { 0x14C2, 0x14C2, 0x14C2 }, { 0x14C3, 0x14C3, 0x14C3 }, { 0x14C4, 0x14C4, 0x14C4 }, { 0x14C5, 0x14C5, 0x14C5 }, { 0x14C6, 0x14C6, 0x14C6 }, { 0x14C7, 0x14C7, 0x14C7 }, { 0x14C8, 0x14C8, 0x14C8 }, { 0x14C9, 0x14C9, 0x14C9 }, { 0x14CA, 0x14CA, 0x14CA }, { 0x14CB, 0x14CB, 0x14CB }, { 0x14CC, 0x14CC, 0x14CC }, { 0x14CD, 0x14CD, 0x14CD }, { 0x14CE, 0x14CE, 0x14CE }, { 0x14CF, 0x14CF, 0x14CF }, { 0x14D0, 0x14D0, 0x14D0 }, { 0x14D1, 0x14D1, 0x14D1 }, { 0x14D2, 0x14D2, 0x14D2 }, { 0x14D3, 0x14D3, 0x14D3 }, { 0x14D4, 0x14D4, 0x14D4 }, { 0x14D5, 0x14D5, 0x14D5 }, { 0x14D6, 0x14D6, 0x14D6 }, { 0x14D7, 0x14D7, 0x14D7 }, { 0x14D8, 0x14D8, 0x14D8 }, { 0x14D9, 0x14D9, 0x14D9 }, { 0x14DA, 0x14DA, 0x14DA }, { 0x14DB, 0x14DB, 0x14DB }, { 0x14DC, 0x14DC, 0x14DC }, { 0x14DD, 0x14DD, 0x14DD }, { 0x14DE, 0x14DE, 0x14DE }, { 0x14DF, 0x14DF, 0x14DF }, { 0x14E0, 0x14E0, 0x14E0 }, { 0x14E1, 0x14E1, 0x14E1 }, { 0x14E2, 0x14E2, 0x14E2 }, { 0x14E3, 0x14E3, 0x14E3 }, { 0x14E4, 0x14E4, 0x14E4 }, { 0x14E5, 0x14E5, 0x14E5 }, { 0x14E6, 0x14E6, 0x14E6 }, { 0x14E7, 0x14E7, 0x14E7 }, { 0x14E8, 0x14E8, 0x14E8 }, { 0x14E9, 0x14E9, 0x14E9 }, { 0x14EA, 0x14EA, 0x14EA }, { 0x14EB, 0x14EB, 0x14EB }, { 0x14EC, 0x14EC, 0x14EC }, { 0x14ED, 0x14ED, 0x14ED }, { 0x14EE, 0x14EE, 0x14EE }, { 0x14EF, 0x14EF, 0x14EF }, { 0x14F0, 0x14F0, 0x14F0 }, { 0x14F1, 0x14F1, 0x14F1 }, { 0x14F2, 0x14F2, 0x14F2 }, { 0x14F3, 0x14F3, 0x14F3 }, { 0x14F4, 0x14F4, 0x14F4 }, { 0x14F5, 0x14F5, 0x14F5 }, { 0x14F6, 0x14F6, 0x14F6 }, { 0x14F7, 0x14F7, 0x14F7 }, { 0x14F8, 0x14F8, 0x14F8 }, { 0x14F9, 0x14F9, 0x14F9 }, { 0x14FA, 0x14FA, 0x14FA }, { 0x14FB, 0x14FB, 0x14FB }, { 0x14FC, 0x14FC, 0x14FC }, { 0x14FD, 0x14FD, 0x14FD }, { 0x14FE, 0x14FE, 0x14FE }, { 0x14FF, 0x14FF, 0x14FF }, { 0x1500, 0x1500, 0x1500 }, { 0x1501, 0x1501, 0x1501 }, { 0x1502, 0x1502, 0x1502 }, { 0x1503, 0x1503, 0x1503 }, { 0x1504, 0x1504, 0x1504 }, { 0x1505, 0x1505, 0x1505 }, { 0x1506, 0x1506, 0x1506 }, { 0x1507, 0x1507, 0x1507 }, { 0x1508, 0x1508, 0x1508 }, { 0x1509, 0x1509, 0x1509 }, { 0x150A, 0x150A, 0x150A }, { 0x150B, 0x150B, 0x150B }, { 0x150C, 0x150C, 0x150C }, { 0x150D, 0x150D, 0x150D }, { 0x150E, 0x150E, 0x150E }, { 0x150F, 0x150F, 0x150F }, { 0x1510, 0x1510, 0x1510 }, { 0x1511, 0x1511, 0x1511 }, { 0x1512, 0x1512, 0x1512 }, { 0x1513, 0x1513, 0x1513 }, { 0x1514, 0x1514, 0x1514 }, { 0x1515, 0x1515, 0x1515 }, { 0x1516, 0x1516, 0x1516 }, { 0x1517, 0x1517, 0x1517 }, { 0x1518, 0x1518, 0x1518 }, { 0x1519, 0x1519, 0x1519 }, { 0x151A, 0x151A, 0x151A }, { 0x151B, 0x151B, 0x151B }, { 0x151C, 0x151C, 0x151C }, { 0x151D, 0x151D, 0x151D }, { 0x151E, 0x151E, 0x151E }, { 0x151F, 0x151F, 0x151F }, { 0x1520, 0x1520, 0x1520 }, { 0x1521, 0x1521, 0x1521 }, { 0x1522, 0x1522, 0x1522 }, { 0x1523, 0x1523, 0x1523 }, { 0x1524, 0x1524, 0x1524 }, { 0x1525, 0x1525, 0x1525 }, { 0x1526, 0x1526, 0x1526 }, { 0x1527, 0x1527, 0x1527 }, { 0x1528, 0x1528, 0x1528 }, { 0x1529, 0x1529, 0x1529 }, { 0x152A, 0x152A, 0x152A }, { 0x152B, 0x152B, 0x152B }, { 0x152C, 0x152C, 0x152C }, { 0x152D, 0x152D, 0x152D }, { 0x152E, 0x152E, 0x152E }, { 0x152F, 0x152F, 0x152F }, { 0x1530, 0x1530, 0x1530 }, { 0x1531, 0x1531, 0x1531 }, { 0x1532, 0x1532, 0x1532 }, { 0x1533, 0x1533, 0x1533 }, { 0x1534, 0x1534, 0x1534 }, { 0x1535, 0x1535, 0x1535 }, { 0x1536, 0x1536, 0x1536 }, { 0x1537, 0x1537, 0x1537 }, { 0x1538, 0x1538, 0x1538 }, { 0x1539, 0x1539, 0x1539 }, { 0x153A, 0x153A, 0x153A }, { 0x153B, 0x153B, 0x153B }, { 0x153C, 0x153C, 0x153C }, { 0x153D, 0x153D, 0x153D }, { 0x153E, 0x153E, 0x153E }, { 0x153F, 0x153F, 0x153F }, { 0x1540, 0x1540, 0x1540 }, { 0x1541, 0x1541, 0x1541 }, { 0x1542, 0x1542, 0x1542 }, { 0x1543, 0x1543, 0x1543 }, { 0x1544, 0x1544, 0x1544 }, { 0x1545, 0x1545, 0x1545 }, { 0x1546, 0x1546, 0x1546 }, { 0x1547, 0x1547, 0x1547 }, { 0x1548, 0x1548, 0x1548 }, { 0x1549, 0x1549, 0x1549 }, { 0x154A, 0x154A, 0x154A }, { 0x154B, 0x154B, 0x154B }, { 0x154C, 0x154C, 0x154C }, { 0x154D, 0x154D, 0x154D }, { 0x154E, 0x154E, 0x154E }, { 0x154F, 0x154F, 0x154F }, { 0x1550, 0x1550, 0x1550 }, { 0x1551, 0x1551, 0x1551 }, { 0x1552, 0x1552, 0x1552 }, { 0x1553, 0x1553, 0x1553 }, { 0x1554, 0x1554, 0x1554 }, { 0x1555, 0x1555, 0x1555 }, { 0x1556, 0x1556, 0x1556 }, { 0x1557, 0x1557, 0x1557 }, { 0x1558, 0x1558, 0x1558 }, { 0x1559, 0x1559, 0x1559 }, { 0x155A, 0x155A, 0x155A }, { 0x155B, 0x155B, 0x155B }, { 0x155C, 0x155C, 0x155C }, { 0x155D, 0x155D, 0x155D }, { 0x155E, 0x155E, 0x155E }, { 0x155F, 0x155F, 0x155F }, { 0x1560, 0x1560, 0x1560 }, { 0x1561, 0x1561, 0x1561 }, { 0x1562, 0x1562, 0x1562 }, { 0x1563, 0x1563, 0x1563 }, { 0x1564, 0x1564, 0x1564 }, { 0x1565, 0x1565, 0x1565 }, { 0x1566, 0x1566, 0x1566 }, { 0x1567, 0x1567, 0x1567 }, { 0x1568, 0x1568, 0x1568 }, { 0x1569, 0x1569, 0x1569 }, { 0x156A, 0x156A, 0x156A }, { 0x156B, 0x156B, 0x156B }, { 0x156C, 0x156C, 0x156C }, { 0x156D, 0x156D, 0x156D }, { 0x156E, 0x156E, 0x156E }, { 0x156F, 0x156F, 0x156F }, { 0x1570, 0x1570, 0x1570 }, { 0x1571, 0x1571, 0x1571 }, { 0x1572, 0x1572, 0x1572 }, { 0x1573, 0x1573, 0x1573 }, { 0x1574, 0x1574, 0x1574 }, { 0x1575, 0x1575, 0x1575 }, { 0x1576, 0x1576, 0x1576 }, { 0x1577, 0x1577, 0x1577 }, { 0x1578, 0x1578, 0x1578 }, { 0x1579, 0x1579, 0x1579 }, { 0x157A, 0x157A, 0x157A }, { 0x157B, 0x157B, 0x157B }, { 0x157C, 0x157C, 0x157C }, { 0x157D, 0x157D, 0x157D }, { 0x157E, 0x157E, 0x157E }, { 0x157F, 0x157F, 0x157F }, { 0x1580, 0x1580, 0x1580 }, { 0x1581, 0x1581, 0x1581 }, { 0x1582, 0x1582, 0x1582 }, { 0x1583, 0x1583, 0x1583 }, { 0x1584, 0x1584, 0x1584 }, { 0x1585, 0x1585, 0x1585 }, { 0x1586, 0x1586, 0x1586 }, { 0x1587, 0x1587, 0x1587 }, { 0x1588, 0x1588, 0x1588 }, { 0x1589, 0x1589, 0x1589 }, { 0x158A, 0x158A, 0x158A }, { 0x158B, 0x158B, 0x158B }, { 0x158C, 0x158C, 0x158C }, { 0x158D, 0x158D, 0x158D }, { 0x158E, 0x158E, 0x158E }, { 0x158F, 0x158F, 0x158F }, { 0x1590, 0x1590, 0x1590 }, { 0x1591, 0x1591, 0x1591 }, { 0x1592, 0x1592, 0x1592 }, { 0x1593, 0x1593, 0x1593 }, { 0x1594, 0x1594, 0x1594 }, { 0x1595, 0x1595, 0x1595 }, { 0x1596, 0x1596, 0x1596 }, { 0x1597, 0x1597, 0x1597 }, { 0x1598, 0x1598, 0x1598 }, { 0x1599, 0x1599, 0x1599 }, { 0x159A, 0x159A, 0x159A }, { 0x159B, 0x159B, 0x159B }, { 0x159C, 0x159C, 0x159C }, { 0x159D, 0x159D, 0x159D }, { 0x159E, 0x159E, 0x159E }, { 0x159F, 0x159F, 0x159F }, { 0x15A0, 0x15A0, 0x15A0 }, { 0x15A1, 0x15A1, 0x15A1 }, { 0x15A2, 0x15A2, 0x15A2 }, { 0x15A3, 0x15A3, 0x15A3 }, { 0x15A4, 0x15A4, 0x15A4 }, { 0x15A5, 0x15A5, 0x15A5 }, { 0x15A6, 0x15A6, 0x15A6 }, { 0x15A7, 0x15A7, 0x15A7 }, { 0x15A8, 0x15A8, 0x15A8 }, { 0x15A9, 0x15A9, 0x15A9 }, { 0x15AA, 0x15AA, 0x15AA }, { 0x15AB, 0x15AB, 0x15AB }, { 0x15AC, 0x15AC, 0x15AC }, { 0x15AD, 0x15AD, 0x15AD }, { 0x15AE, 0x15AE, 0x15AE }, { 0x15AF, 0x15AF, 0x15AF }, { 0x15B0, 0x15B0, 0x15B0 }, { 0x15B1, 0x15B1, 0x15B1 }, { 0x15B2, 0x15B2, 0x15B2 }, { 0x15B3, 0x15B3, 0x15B3 }, { 0x15B4, 0x15B4, 0x15B4 }, { 0x15B5, 0x15B5, 0x15B5 }, { 0x15B6, 0x15B6, 0x15B6 }, { 0x15B7, 0x15B7, 0x15B7 }, { 0x15B8, 0x15B8, 0x15B8 }, { 0x15B9, 0x15B9, 0x15B9 }, { 0x15BA, 0x15BA, 0x15BA }, { 0x15BB, 0x15BB, 0x15BB }, { 0x15BC, 0x15BC, 0x15BC }, { 0x15BD, 0x15BD, 0x15BD }, { 0x15BE, 0x15BE, 0x15BE }, { 0x15BF, 0x15BF, 0x15BF }, { 0x15C0, 0x15C0, 0x15C0 }, { 0x15C1, 0x15C1, 0x15C1 }, { 0x15C2, 0x15C2, 0x15C2 }, { 0x15C3, 0x15C3, 0x15C3 }, { 0x15C4, 0x15C4, 0x15C4 }, { 0x15C5, 0x15C5, 0x15C5 }, { 0x15C6, 0x15C6, 0x15C6 }, { 0x15C7, 0x15C7, 0x15C7 }, { 0x15C8, 0x15C8, 0x15C8 }, { 0x15C9, 0x15C9, 0x15C9 }, { 0x15CA, 0x15CA, 0x15CA }, { 0x15CB, 0x15CB, 0x15CB }, { 0x15CC, 0x15CC, 0x15CC }, { 0x15CD, 0x15CD, 0x15CD }, { 0x15CE, 0x15CE, 0x15CE }, { 0x15CF, 0x15CF, 0x15CF }, { 0x15D0, 0x15D0, 0x15D0 }, { 0x15D1, 0x15D1, 0x15D1 }, { 0x15D2, 0x15D2, 0x15D2 }, { 0x15D3, 0x15D3, 0x15D3 }, { 0x15D4, 0x15D4, 0x15D4 }, { 0x15D5, 0x15D5, 0x15D5 }, { 0x15D6, 0x15D6, 0x15D6 }, { 0x15D7, 0x15D7, 0x15D7 }, { 0x15D8, 0x15D8, 0x15D8 }, { 0x15D9, 0x15D9, 0x15D9 }, { 0x15DA, 0x15DA, 0x15DA }, { 0x15DB, 0x15DB, 0x15DB }, { 0x15DC, 0x15DC, 0x15DC }, { 0x15DD, 0x15DD, 0x15DD }, { 0x15DE, 0x15DE, 0x15DE }, { 0x15DF, 0x15DF, 0x15DF }, { 0x15E0, 0x15E0, 0x15E0 }, { 0x15E1, 0x15E1, 0x15E1 }, { 0x15E2, 0x15E2, 0x15E2 }, { 0x15E3, 0x15E3, 0x15E3 }, { 0x15E4, 0x15E4, 0x15E4 }, { 0x15E5, 0x15E5, 0x15E5 }, { 0x15E6, 0x15E6, 0x15E6 }, { 0x15E7, 0x15E7, 0x15E7 }, { 0x15E8, 0x15E8, 0x15E8 }, { 0x15E9, 0x15E9, 0x15E9 }, { 0x15EA, 0x15EA, 0x15EA }, { 0x15EB, 0x15EB, 0x15EB }, { 0x15EC, 0x15EC, 0x15EC }, { 0x15ED, 0x15ED, 0x15ED }, { 0x15EE, 0x15EE, 0x15EE }, { 0x15EF, 0x15EF, 0x15EF }, { 0x15F0, 0x15F0, 0x15F0 }, { 0x15F1, 0x15F1, 0x15F1 }, { 0x15F2, 0x15F2, 0x15F2 }, { 0x15F3, 0x15F3, 0x15F3 }, { 0x15F4, 0x15F4, 0x15F4 }, { 0x15F5, 0x15F5, 0x15F5 }, { 0x15F6, 0x15F6, 0x15F6 }, { 0x15F7, 0x15F7, 0x15F7 }, { 0x15F8, 0x15F8, 0x15F8 }, { 0x15F9, 0x15F9, 0x15F9 }, { 0x15FA, 0x15FA, 0x15FA }, { 0x15FB, 0x15FB, 0x15FB }, { 0x15FC, 0x15FC, 0x15FC }, { 0x15FD, 0x15FD, 0x15FD }, { 0x15FE, 0x15FE, 0x15FE }, { 0x15FF, 0x15FF, 0x15FF }, { 0x1600, 0x1600, 0x1600 }, { 0x1601, 0x1601, 0x1601 }, { 0x1602, 0x1602, 0x1602 }, { 0x1603, 0x1603, 0x1603 }, { 0x1604, 0x1604, 0x1604 }, { 0x1605, 0x1605, 0x1605 }, { 0x1606, 0x1606, 0x1606 }, { 0x1607, 0x1607, 0x1607 }, { 0x1608, 0x1608, 0x1608 }, { 0x1609, 0x1609, 0x1609 }, { 0x160A, 0x160A, 0x160A }, { 0x160B, 0x160B, 0x160B }, { 0x160C, 0x160C, 0x160C }, { 0x160D, 0x160D, 0x160D }, { 0x160E, 0x160E, 0x160E }, { 0x160F, 0x160F, 0x160F }, { 0x1610, 0x1610, 0x1610 }, { 0x1611, 0x1611, 0x1611 }, { 0x1612, 0x1612, 0x1612 }, { 0x1613, 0x1613, 0x1613 }, { 0x1614, 0x1614, 0x1614 }, { 0x1615, 0x1615, 0x1615 }, { 0x1616, 0x1616, 0x1616 }, { 0x1617, 0x1617, 0x1617 }, { 0x1618, 0x1618, 0x1618 }, { 0x1619, 0x1619, 0x1619 }, { 0x161A, 0x161A, 0x161A }, { 0x161B, 0x161B, 0x161B }, { 0x161C, 0x161C, 0x161C }, { 0x161D, 0x161D, 0x161D }, { 0x161E, 0x161E, 0x161E }, { 0x161F, 0x161F, 0x161F }, { 0x1620, 0x1620, 0x1620 }, { 0x1621, 0x1621, 0x1621 }, { 0x1622, 0x1622, 0x1622 }, { 0x1623, 0x1623, 0x1623 }, { 0x1624, 0x1624, 0x1624 }, { 0x1625, 0x1625, 0x1625 }, { 0x1626, 0x1626, 0x1626 }, { 0x1627, 0x1627, 0x1627 }, { 0x1628, 0x1628, 0x1628 }, { 0x1629, 0x1629, 0x1629 }, { 0x162A, 0x162A, 0x162A }, { 0x162B, 0x162B, 0x162B }, { 0x162C, 0x162C, 0x162C }, { 0x162D, 0x162D, 0x162D }, { 0x162E, 0x162E, 0x162E }, { 0x162F, 0x162F, 0x162F }, { 0x1630, 0x1630, 0x1630 }, { 0x1631, 0x1631, 0x1631 }, { 0x1632, 0x1632, 0x1632 }, { 0x1633, 0x1633, 0x1633 }, { 0x1634, 0x1634, 0x1634 }, { 0x1635, 0x1635, 0x1635 }, { 0x1636, 0x1636, 0x1636 }, { 0x1637, 0x1637, 0x1637 }, { 0x1638, 0x1638, 0x1638 }, { 0x1639, 0x1639, 0x1639 }, { 0x163A, 0x163A, 0x163A }, { 0x163B, 0x163B, 0x163B }, { 0x163C, 0x163C, 0x163C }, { 0x163D, 0x163D, 0x163D }, { 0x163E, 0x163E, 0x163E }, { 0x163F, 0x163F, 0x163F }, { 0x1640, 0x1640, 0x1640 }, { 0x1641, 0x1641, 0x1641 }, { 0x1642, 0x1642, 0x1642 }, { 0x1643, 0x1643, 0x1643 }, { 0x1644, 0x1644, 0x1644 }, { 0x1645, 0x1645, 0x1645 }, { 0x1646, 0x1646, 0x1646 }, { 0x1647, 0x1647, 0x1647 }, { 0x1648, 0x1648, 0x1648 }, { 0x1649, 0x1649, 0x1649 }, { 0x164A, 0x164A, 0x164A }, { 0x164B, 0x164B, 0x164B }, { 0x164C, 0x164C, 0x164C }, { 0x164D, 0x164D, 0x164D }, { 0x164E, 0x164E, 0x164E }, { 0x164F, 0x164F, 0x164F }, { 0x1650, 0x1650, 0x1650 }, { 0x1651, 0x1651, 0x1651 }, { 0x1652, 0x1652, 0x1652 }, { 0x1653, 0x1653, 0x1653 }, { 0x1654, 0x1654, 0x1654 }, { 0x1655, 0x1655, 0x1655 }, { 0x1656, 0x1656, 0x1656 }, { 0x1657, 0x1657, 0x1657 }, { 0x1658, 0x1658, 0x1658 }, { 0x1659, 0x1659, 0x1659 }, { 0x165A, 0x165A, 0x165A }, { 0x165B, 0x165B, 0x165B }, { 0x165C, 0x165C, 0x165C }, { 0x165D, 0x165D, 0x165D }, { 0x165E, 0x165E, 0x165E }, { 0x165F, 0x165F, 0x165F }, { 0x1660, 0x1660, 0x1660 }, { 0x1661, 0x1661, 0x1661 }, { 0x1662, 0x1662, 0x1662 }, { 0x1663, 0x1663, 0x1663 }, { 0x1664, 0x1664, 0x1664 }, { 0x1665, 0x1665, 0x1665 }, { 0x1666, 0x1666, 0x1666 }, { 0x1667, 0x1667, 0x1667 }, { 0x1668, 0x1668, 0x1668 }, { 0x1669, 0x1669, 0x1669 }, { 0x166A, 0x166A, 0x166A }, { 0x166B, 0x166B, 0x166B }, { 0x166C, 0x166C, 0x166C }, { 0x166F, 0x166F, 0x166F }, { 0x1670, 0x1670, 0x1670 }, { 0x1671, 0x1671, 0x1671 }, { 0x1672, 0x1672, 0x1672 }, { 0x1673, 0x1673, 0x1673 }, { 0x1674, 0x1674, 0x1674 }, { 0x1675, 0x1675, 0x1675 }, { 0x1676, 0x1676, 0x1676 }, { 0x1681, 0x1681, 0x1681 }, { 0x1682, 0x1682, 0x1682 }, { 0x1683, 0x1683, 0x1683 }, { 0x1684, 0x1684, 0x1684 }, { 0x1685, 0x1685, 0x1685 }, { 0x1686, 0x1686, 0x1686 }, { 0x1687, 0x1687, 0x1687 }, { 0x1688, 0x1688, 0x1688 }, { 0x1689, 0x1689, 0x1689 }, { 0x168A, 0x168A, 0x168A }, { 0x168B, 0x168B, 0x168B }, { 0x168C, 0x168C, 0x168C }, { 0x168D, 0x168D, 0x168D }, { 0x168E, 0x168E, 0x168E }, { 0x168F, 0x168F, 0x168F }, { 0x1690, 0x1690, 0x1690 }, { 0x1691, 0x1691, 0x1691 }, { 0x1692, 0x1692, 0x1692 }, { 0x1693, 0x1693, 0x1693 }, { 0x1694, 0x1694, 0x1694 }, { 0x1695, 0x1695, 0x1695 }, { 0x1696, 0x1696, 0x1696 }, { 0x1697, 0x1697, 0x1697 }, { 0x1698, 0x1698, 0x1698 }, { 0x1699, 0x1699, 0x1699 }, { 0x169A, 0x169A, 0x169A }, { 0x16A0, 0x16A0, 0x16A0 }, { 0x16A1, 0x16A1, 0x16A1 }, { 0x16A2, 0x16A2, 0x16A2 }, { 0x16A3, 0x16A3, 0x16A3 }, { 0x16A4, 0x16A4, 0x16A4 }, { 0x16A5, 0x16A5, 0x16A5 }, { 0x16A6, 0x16A6, 0x16A6 }, { 0x16A7, 0x16A7, 0x16A7 }, { 0x16A8, 0x16A8, 0x16A8 }, { 0x16A9, 0x16A9, 0x16A9 }, { 0x16AA, 0x16AA, 0x16AA }, { 0x16AB, 0x16AB, 0x16AB }, { 0x16AC, 0x16AC, 0x16AC }, { 0x16AD, 0x16AD, 0x16AD }, { 0x16AE, 0x16AE, 0x16AE }, { 0x16AF, 0x16AF, 0x16AF }, { 0x16B0, 0x16B0, 0x16B0 }, { 0x16B1, 0x16B1, 0x16B1 }, { 0x16B2, 0x16B2, 0x16B2 }, { 0x16B3, 0x16B3, 0x16B3 }, { 0x16B4, 0x16B4, 0x16B4 }, { 0x16B5, 0x16B5, 0x16B5 }, { 0x16B6, 0x16B6, 0x16B6 }, { 0x16B7, 0x16B7, 0x16B7 }, { 0x16B8, 0x16B8, 0x16B8 }, { 0x16B9, 0x16B9, 0x16B9 }, { 0x16BA, 0x16BA, 0x16BA }, { 0x16BB, 0x16BB, 0x16BB }, { 0x16BC, 0x16BC, 0x16BC }, { 0x16BD, 0x16BD, 0x16BD }, { 0x16BE, 0x16BE, 0x16BE }, { 0x16BF, 0x16BF, 0x16BF }, { 0x16C0, 0x16C0, 0x16C0 }, { 0x16C1, 0x16C1, 0x16C1 }, { 0x16C2, 0x16C2, 0x16C2 }, { 0x16C3, 0x16C3, 0x16C3 }, { 0x16C4, 0x16C4, 0x16C4 }, { 0x16C5, 0x16C5, 0x16C5 }, { 0x16C6, 0x16C6, 0x16C6 }, { 0x16C7, 0x16C7, 0x16C7 }, { 0x16C8, 0x16C8, 0x16C8 }, { 0x16C9, 0x16C9, 0x16C9 }, { 0x16CA, 0x16CA, 0x16CA }, { 0x16CB, 0x16CB, 0x16CB }, { 0x16CC, 0x16CC, 0x16CC }, { 0x16CD, 0x16CD, 0x16CD }, { 0x16CE, 0x16CE, 0x16CE }, { 0x16CF, 0x16CF, 0x16CF }, { 0x16D0, 0x16D0, 0x16D0 }, { 0x16D1, 0x16D1, 0x16D1 }, { 0x16D2, 0x16D2, 0x16D2 }, { 0x16D3, 0x16D3, 0x16D3 }, { 0x16D4, 0x16D4, 0x16D4 }, { 0x16D5, 0x16D5, 0x16D5 }, { 0x16D6, 0x16D6, 0x16D6 }, { 0x16D7, 0x16D7, 0x16D7 }, { 0x16D8, 0x16D8, 0x16D8 }, { 0x16D9, 0x16D9, 0x16D9 }, { 0x16DA, 0x16DA, 0x16DA }, { 0x16DB, 0x16DB, 0x16DB }, { 0x16DC, 0x16DC, 0x16DC }, { 0x16DD, 0x16DD, 0x16DD }, { 0x16DE, 0x16DE, 0x16DE }, { 0x16DF, 0x16DF, 0x16DF }, { 0x16E0, 0x16E0, 0x16E0 }, { 0x16E1, 0x16E1, 0x16E1 }, { 0x16E2, 0x16E2, 0x16E2 }, { 0x16E3, 0x16E3, 0x16E3 }, { 0x16E4, 0x16E4, 0x16E4 }, { 0x16E5, 0x16E5, 0x16E5 }, { 0x16E6, 0x16E6, 0x16E6 }, { 0x16E7, 0x16E7, 0x16E7 }, { 0x16E8, 0x16E8, 0x16E8 }, { 0x16E9, 0x16E9, 0x16E9 }, { 0x16EA, 0x16EA, 0x16EA }, { 0x1700, 0x1700, 0x1700 }, { 0x1701, 0x1701, 0x1701 }, { 0x1702, 0x1702, 0x1702 }, { 0x1703, 0x1703, 0x1703 }, { 0x1704, 0x1704, 0x1704 }, { 0x1705, 0x1705, 0x1705 }, { 0x1706, 0x1706, 0x1706 }, { 0x1707, 0x1707, 0x1707 }, { 0x1708, 0x1708, 0x1708 }, { 0x1709, 0x1709, 0x1709 }, { 0x170A, 0x170A, 0x170A }, { 0x170B, 0x170B, 0x170B }, { 0x170C, 0x170C, 0x170C }, { 0x170E, 0x170E, 0x170E }, { 0x170F, 0x170F, 0x170F }, { 0x1710, 0x1710, 0x1710 }, { 0x1711, 0x1711, 0x1711 }, { 0x1712, 0x1712, 0x1712 }, { 0x1713, 0x1713, 0x1713 }, { 0x1714, 0x1714, 0x1714 }, { 0x1720, 0x1720, 0x1720 }, { 0x1721, 0x1721, 0x1721 }, { 0x1722, 0x1722, 0x1722 }, { 0x1723, 0x1723, 0x1723 }, { 0x1724, 0x1724, 0x1724 }, { 0x1725, 0x1725, 0x1725 }, { 0x1726, 0x1726, 0x1726 }, { 0x1727, 0x1727, 0x1727 }, { 0x1728, 0x1728, 0x1728 }, { 0x1729, 0x1729, 0x1729 }, { 0x172A, 0x172A, 0x172A }, { 0x172B, 0x172B, 0x172B }, { 0x172C, 0x172C, 0x172C }, { 0x172D, 0x172D, 0x172D }, { 0x172E, 0x172E, 0x172E }, { 0x172F, 0x172F, 0x172F }, { 0x1730, 0x1730, 0x1730 }, { 0x1731, 0x1731, 0x1731 }, { 0x1732, 0x1732, 0x1732 }, { 0x1733, 0x1733, 0x1733 }, { 0x1734, 0x1734, 0x1734 }, { 0x1740, 0x1740, 0x1740 }, { 0x1741, 0x1741, 0x1741 }, { 0x1742, 0x1742, 0x1742 }, { 0x1743, 0x1743, 0x1743 }, { 0x1744, 0x1744, 0x1744 }, { 0x1745, 0x1745, 0x1745 }, { 0x1746, 0x1746, 0x1746 }, { 0x1747, 0x1747, 0x1747 }, { 0x1748, 0x1748, 0x1748 }, { 0x1749, 0x1749, 0x1749 }, { 0x174A, 0x174A, 0x174A }, { 0x174B, 0x174B, 0x174B }, { 0x174C, 0x174C, 0x174C }, { 0x174D, 0x174D, 0x174D }, { 0x174E, 0x174E, 0x174E }, { 0x174F, 0x174F, 0x174F }, { 0x1750, 0x1750, 0x1750 }, { 0x1751, 0x1751, 0x1751 }, { 0x1752, 0x1752, 0x1752 }, { 0x1753, 0x1753, 0x1753 }, { 0x1760, 0x1760, 0x1760 }, { 0x1761, 0x1761, 0x1761 }, { 0x1762, 0x1762, 0x1762 }, { 0x1763, 0x1763, 0x1763 }, { 0x1764, 0x1764, 0x1764 }, { 0x1765, 0x1765, 0x1765 }, { 0x1766, 0x1766, 0x1766 }, { 0x1767, 0x1767, 0x1767 }, { 0x1768, 0x1768, 0x1768 }, { 0x1769, 0x1769, 0x1769 }, { 0x176A, 0x176A, 0x176A }, { 0x176B, 0x176B, 0x176B }, { 0x176C, 0x176C, 0x176C }, { 0x176E, 0x176E, 0x176E }, { 0x176F, 0x176F, 0x176F }, { 0x1770, 0x1770, 0x1770 }, { 0x1772, 0x1772, 0x1772 }, { 0x1773, 0x1773, 0x1773 }, { 0x1780, 0x1780, 0x1780 }, { 0x1781, 0x1781, 0x1781 }, { 0x1782, 0x1782, 0x1782 }, { 0x1783, 0x1783, 0x1783 }, { 0x1784, 0x1784, 0x1784 }, { 0x1785, 0x1785, 0x1785 }, { 0x1786, 0x1786, 0x1786 }, { 0x1787, 0x1787, 0x1787 }, { 0x1788, 0x1788, 0x1788 }, { 0x1789, 0x1789, 0x1789 }, { 0x178A, 0x178A, 0x178A }, { 0x178B, 0x178B, 0x178B }, { 0x178C, 0x178C, 0x178C }, { 0x178D, 0x178D, 0x178D }, { 0x178E, 0x178E, 0x178E }, { 0x178F, 0x178F, 0x178F }, { 0x1790, 0x1790, 0x1790 }, { 0x1791, 0x1791, 0x1791 }, { 0x1792, 0x1792, 0x1792 }, { 0x1793, 0x1793, 0x1793 }, { 0x1794, 0x1794, 0x1794 }, { 0x1795, 0x1795, 0x1795 }, { 0x1796, 0x1796, 0x1796 }, { 0x1797, 0x1797, 0x1797 }, { 0x1798, 0x1798, 0x1798 }, { 0x1799, 0x1799, 0x1799 }, { 0x179A, 0x179A, 0x179A }, { 0x179B, 0x179B, 0x179B }, { 0x179C, 0x179C, 0x179C }, { 0x179D, 0x179D, 0x179D }, { 0x179E, 0x179E, 0x179E }, { 0x179F, 0x179F, 0x179F }, { 0x17A0, 0x17A0, 0x17A0 }, { 0x17A1, 0x17A1, 0x17A1 }, { 0x17A2, 0x17A2, 0x17A2 }, { 0x17A3, 0x17A3, 0x17A3 }, { 0x17A4, 0x17A4, 0x17A4 }, { 0x17A5, 0x17A5, 0x17A5 }, { 0x17A6, 0x17A6, 0x17A6 }, { 0x17A7, 0x17A7, 0x17A7 }, { 0x17A8, 0x17A8, 0x17A8 }, { 0x17A9, 0x17A9, 0x17A9 }, { 0x17AA, 0x17AA, 0x17AA }, { 0x17AB, 0x17AB, 0x17AB }, { 0x17AC, 0x17AC, 0x17AC }, { 0x17AD, 0x17AD, 0x17AD }, { 0x17AE, 0x17AE, 0x17AE }, { 0x17AF, 0x17AF, 0x17AF }, { 0x17B0, 0x17B0, 0x17B0 }, { 0x17B1, 0x17B1, 0x17B1 }, { 0x17B2, 0x17B2, 0x17B2 }, { 0x17B3, 0x17B3, 0x17B3 }, { 0x17B7, 0x17B7, 0x17B7 }, { 0x17B8, 0x17B8, 0x17B8 }, { 0x17B9, 0x17B9, 0x17B9 }, { 0x17BA, 0x17BA, 0x17BA }, { 0x17BB, 0x17BB, 0x17BB }, { 0x17BC, 0x17BC, 0x17BC }, { 0x17BD, 0x17BD, 0x17BD }, { 0x17C6, 0x17C6, 0x17C6 }, { 0x17C9, 0x17C9, 0x17C9 }, { 0x17CA, 0x17CA, 0x17CA }, { 0x17CB, 0x17CB, 0x17CB }, { 0x17CC, 0x17CC, 0x17CC }, { 0x17CD, 0x17CD, 0x17CD }, { 0x17CE, 0x17CE, 0x17CE }, { 0x17CF, 0x17CF, 0x17CF }, { 0x17D0, 0x17D0, 0x17D0 }, { 0x17D1, 0x17D1, 0x17D1 }, { 0x17D2, 0x17D2, 0x17D2 }, { 0x17D3, 0x17D3, 0x17D3 }, { 0x17D7, 0x17D7, 0x17D7 }, { 0x17DC, 0x17DC, 0x17DC }, { 0x17DD, 0x17DD, 0x17DD }, { 0x180B, 0x180B, 0x180B }, { 0x180C, 0x180C, 0x180C }, { 0x180D, 0x180D, 0x180D }, { 0x1820, 0x1820, 0x1820 }, { 0x1821, 0x1821, 0x1821 }, { 0x1822, 0x1822, 0x1822 }, { 0x1823, 0x1823, 0x1823 }, { 0x1824, 0x1824, 0x1824 }, { 0x1825, 0x1825, 0x1825 }, { 0x1826, 0x1826, 0x1826 }, { 0x1827, 0x1827, 0x1827 }, { 0x1828, 0x1828, 0x1828 }, { 0x1829, 0x1829, 0x1829 }, { 0x182A, 0x182A, 0x182A }, { 0x182B, 0x182B, 0x182B }, { 0x182C, 0x182C, 0x182C }, { 0x182D, 0x182D, 0x182D }, { 0x182E, 0x182E, 0x182E }, { 0x182F, 0x182F, 0x182F }, { 0x1830, 0x1830, 0x1830 }, { 0x1831, 0x1831, 0x1831 }, { 0x1832, 0x1832, 0x1832 }, { 0x1833, 0x1833, 0x1833 }, { 0x1834, 0x1834, 0x1834 }, { 0x1835, 0x1835, 0x1835 }, { 0x1836, 0x1836, 0x1836 }, { 0x1837, 0x1837, 0x1837 }, { 0x1838, 0x1838, 0x1838 }, { 0x1839, 0x1839, 0x1839 }, { 0x183A, 0x183A, 0x183A }, { 0x183B, 0x183B, 0x183B }, { 0x183C, 0x183C, 0x183C }, { 0x183D, 0x183D, 0x183D }, { 0x183E, 0x183E, 0x183E }, { 0x183F, 0x183F, 0x183F }, { 0x1840, 0x1840, 0x1840 }, { 0x1841, 0x1841, 0x1841 }, { 0x1842, 0x1842, 0x1842 }, { 0x1843, 0x1843, 0x1843 }, { 0x1844, 0x1844, 0x1844 }, { 0x1845, 0x1845, 0x1845 }, { 0x1846, 0x1846, 0x1846 }, { 0x1847, 0x1847, 0x1847 }, { 0x1848, 0x1848, 0x1848 }, { 0x1849, 0x1849, 0x1849 }, { 0x184A, 0x184A, 0x184A }, { 0x184B, 0x184B, 0x184B }, { 0x184C, 0x184C, 0x184C }, { 0x184D, 0x184D, 0x184D }, { 0x184E, 0x184E, 0x184E }, { 0x184F, 0x184F, 0x184F }, { 0x1850, 0x1850, 0x1850 }, { 0x1851, 0x1851, 0x1851 }, { 0x1852, 0x1852, 0x1852 }, { 0x1853, 0x1853, 0x1853 }, { 0x1854, 0x1854, 0x1854 }, { 0x1855, 0x1855, 0x1855 }, { 0x1856, 0x1856, 0x1856 }, { 0x1857, 0x1857, 0x1857 }, { 0x1858, 0x1858, 0x1858 }, { 0x1859, 0x1859, 0x1859 }, { 0x185A, 0x185A, 0x185A }, { 0x185B, 0x185B, 0x185B }, { 0x185C, 0x185C, 0x185C }, { 0x185D, 0x185D, 0x185D }, { 0x185E, 0x185E, 0x185E }, { 0x185F, 0x185F, 0x185F }, { 0x1860, 0x1860, 0x1860 }, { 0x1861, 0x1861, 0x1861 }, { 0x1862, 0x1862, 0x1862 }, { 0x1863, 0x1863, 0x1863 }, { 0x1864, 0x1864, 0x1864 }, { 0x1865, 0x1865, 0x1865 }, { 0x1866, 0x1866, 0x1866 }, { 0x1867, 0x1867, 0x1867 }, { 0x1868, 0x1868, 0x1868 }, { 0x1869, 0x1869, 0x1869 }, { 0x186A, 0x186A, 0x186A }, { 0x186B, 0x186B, 0x186B }, { 0x186C, 0x186C, 0x186C }, { 0x186D, 0x186D, 0x186D }, { 0x186E, 0x186E, 0x186E }, { 0x186F, 0x186F, 0x186F }, { 0x1870, 0x1870, 0x1870 }, { 0x1871, 0x1871, 0x1871 }, { 0x1872, 0x1872, 0x1872 }, { 0x1873, 0x1873, 0x1873 }, { 0x1874, 0x1874, 0x1874 }, { 0x1875, 0x1875, 0x1875 }, { 0x1876, 0x1876, 0x1876 }, { 0x1877, 0x1877, 0x1877 }, { 0x1880, 0x1880, 0x1880 }, { 0x1881, 0x1881, 0x1881 }, { 0x1882, 0x1882, 0x1882 }, { 0x1883, 0x1883, 0x1883 }, { 0x1884, 0x1884, 0x1884 }, { 0x1885, 0x1885, 0x1885 }, { 0x1886, 0x1886, 0x1886 }, { 0x1887, 0x1887, 0x1887 }, { 0x1888, 0x1888, 0x1888 }, { 0x1889, 0x1889, 0x1889 }, { 0x188A, 0x188A, 0x188A }, { 0x188B, 0x188B, 0x188B }, { 0x188C, 0x188C, 0x188C }, { 0x188D, 0x188D, 0x188D }, { 0x188E, 0x188E, 0x188E }, { 0x188F, 0x188F, 0x188F }, { 0x1890, 0x1890, 0x1890 }, { 0x1891, 0x1891, 0x1891 }, { 0x1892, 0x1892, 0x1892 }, { 0x1893, 0x1893, 0x1893 }, { 0x1894, 0x1894, 0x1894 }, { 0x1895, 0x1895, 0x1895 }, { 0x1896, 0x1896, 0x1896 }, { 0x1897, 0x1897, 0x1897 }, { 0x1898, 0x1898, 0x1898 }, { 0x1899, 0x1899, 0x1899 }, { 0x189A, 0x189A, 0x189A }, { 0x189B, 0x189B, 0x189B }, { 0x189C, 0x189C, 0x189C }, { 0x189D, 0x189D, 0x189D }, { 0x189E, 0x189E, 0x189E }, { 0x189F, 0x189F, 0x189F }, { 0x18A0, 0x18A0, 0x18A0 }, { 0x18A1, 0x18A1, 0x18A1 }, { 0x18A2, 0x18A2, 0x18A2 }, { 0x18A3, 0x18A3, 0x18A3 }, { 0x18A4, 0x18A4, 0x18A4 }, { 0x18A5, 0x18A5, 0x18A5 }, { 0x18A6, 0x18A6, 0x18A6 }, { 0x18A7, 0x18A7, 0x18A7 }, { 0x18A8, 0x18A8, 0x18A8 }, { 0x18A9, 0x18A9, 0x18A9 }, { 0x1900, 0x1900, 0x1900 }, { 0x1901, 0x1901, 0x1901 }, { 0x1902, 0x1902, 0x1902 }, { 0x1903, 0x1903, 0x1903 }, { 0x1904, 0x1904, 0x1904 }, { 0x1905, 0x1905, 0x1905 }, { 0x1906, 0x1906, 0x1906 }, { 0x1907, 0x1907, 0x1907 }, { 0x1908, 0x1908, 0x1908 }, { 0x1909, 0x1909, 0x1909 }, { 0x190A, 0x190A, 0x190A }, { 0x190B, 0x190B, 0x190B }, { 0x190C, 0x190C, 0x190C }, { 0x190D, 0x190D, 0x190D }, { 0x190E, 0x190E, 0x190E }, { 0x190F, 0x190F, 0x190F }, { 0x1910, 0x1910, 0x1910 }, { 0x1911, 0x1911, 0x1911 }, { 0x1912, 0x1912, 0x1912 }, { 0x1913, 0x1913, 0x1913 }, { 0x1914, 0x1914, 0x1914 }, { 0x1915, 0x1915, 0x1915 }, { 0x1916, 0x1916, 0x1916 }, { 0x1917, 0x1917, 0x1917 }, { 0x1918, 0x1918, 0x1918 }, { 0x1919, 0x1919, 0x1919 }, { 0x191A, 0x191A, 0x191A }, { 0x191B, 0x191B, 0x191B }, { 0x191C, 0x191C, 0x191C }, { 0x1920, 0x1920, 0x1920 }, { 0x1921, 0x1921, 0x1921 }, { 0x1922, 0x1922, 0x1922 }, { 0x1927, 0x1927, 0x1927 }, { 0x1928, 0x1928, 0x1928 }, { 0x1932, 0x1932, 0x1932 }, { 0x1939, 0x1939, 0x1939 }, { 0x193A, 0x193A, 0x193A }, { 0x193B, 0x193B, 0x193B }, { 0x1950, 0x1950, 0x1950 }, { 0x1951, 0x1951, 0x1951 }, { 0x1952, 0x1952, 0x1952 }, { 0x1953, 0x1953, 0x1953 }, { 0x1954, 0x1954, 0x1954 }, { 0x1955, 0x1955, 0x1955 }, { 0x1956, 0x1956, 0x1956 }, { 0x1957, 0x1957, 0x1957 }, { 0x1958, 0x1958, 0x1958 }, { 0x1959, 0x1959, 0x1959 }, { 0x195A, 0x195A, 0x195A }, { 0x195B, 0x195B, 0x195B }, { 0x195C, 0x195C, 0x195C }, { 0x195D, 0x195D, 0x195D }, { 0x195E, 0x195E, 0x195E }, { 0x195F, 0x195F, 0x195F }, { 0x1960, 0x1960, 0x1960 }, { 0x1961, 0x1961, 0x1961 }, { 0x1962, 0x1962, 0x1962 }, { 0x1963, 0x1963, 0x1963 }, { 0x1964, 0x1964, 0x1964 }, { 0x1965, 0x1965, 0x1965 }, { 0x1966, 0x1966, 0x1966 }, { 0x1967, 0x1967, 0x1967 }, { 0x1968, 0x1968, 0x1968 }, { 0x1969, 0x1969, 0x1969 }, { 0x196A, 0x196A, 0x196A }, { 0x196B, 0x196B, 0x196B }, { 0x196C, 0x196C, 0x196C }, { 0x196D, 0x196D, 0x196D }, { 0x1970, 0x1970, 0x1970 }, { 0x1971, 0x1971, 0x1971 }, { 0x1972, 0x1972, 0x1972 }, { 0x1973, 0x1973, 0x1973 }, { 0x1974, 0x1974, 0x1974 }, { 0x1980, 0x1980, 0x1980 }, { 0x1981, 0x1981, 0x1981 }, { 0x1982, 0x1982, 0x1982 }, { 0x1983, 0x1983, 0x1983 }, { 0x1984, 0x1984, 0x1984 }, { 0x1985, 0x1985, 0x1985 }, { 0x1986, 0x1986, 0x1986 }, { 0x1987, 0x1987, 0x1987 }, { 0x1988, 0x1988, 0x1988 }, { 0x1989, 0x1989, 0x1989 }, { 0x198A, 0x198A, 0x198A }, { 0x198B, 0x198B, 0x198B }, { 0x198C, 0x198C, 0x198C }, { 0x198D, 0x198D, 0x198D }, { 0x198E, 0x198E, 0x198E }, { 0x198F, 0x198F, 0x198F }, { 0x1990, 0x1990, 0x1990 }, { 0x1991, 0x1991, 0x1991 }, { 0x1992, 0x1992, 0x1992 }, { 0x1993, 0x1993, 0x1993 }, { 0x1994, 0x1994, 0x1994 }, { 0x1995, 0x1995, 0x1995 }, { 0x1996, 0x1996, 0x1996 }, { 0x1997, 0x1997, 0x1997 }, { 0x1998, 0x1998, 0x1998 }, { 0x1999, 0x1999, 0x1999 }, { 0x199A, 0x199A, 0x199A }, { 0x199B, 0x199B, 0x199B }, { 0x199C, 0x199C, 0x199C }, { 0x199D, 0x199D, 0x199D }, { 0x199E, 0x199E, 0x199E }, { 0x199F, 0x199F, 0x199F }, { 0x19A0, 0x19A0, 0x19A0 }, { 0x19A1, 0x19A1, 0x19A1 }, { 0x19A2, 0x19A2, 0x19A2 }, { 0x19A3, 0x19A3, 0x19A3 }, { 0x19A4, 0x19A4, 0x19A4 }, { 0x19A5, 0x19A5, 0x19A5 }, { 0x19A6, 0x19A6, 0x19A6 }, { 0x19A7, 0x19A7, 0x19A7 }, { 0x19A8, 0x19A8, 0x19A8 }, { 0x19A9, 0x19A9, 0x19A9 }, { 0x19C1, 0x19C1, 0x19C1 }, { 0x19C2, 0x19C2, 0x19C2 }, { 0x19C3, 0x19C3, 0x19C3 }, { 0x19C4, 0x19C4, 0x19C4 }, { 0x19C5, 0x19C5, 0x19C5 }, { 0x19C6, 0x19C6, 0x19C6 }, { 0x19C7, 0x19C7, 0x19C7 }, { 0x1A00, 0x1A00, 0x1A00 }, { 0x1A01, 0x1A01, 0x1A01 }, { 0x1A02, 0x1A02, 0x1A02 }, { 0x1A03, 0x1A03, 0x1A03 }, { 0x1A04, 0x1A04, 0x1A04 }, { 0x1A05, 0x1A05, 0x1A05 }, { 0x1A06, 0x1A06, 0x1A06 }, { 0x1A07, 0x1A07, 0x1A07 }, { 0x1A08, 0x1A08, 0x1A08 }, { 0x1A09, 0x1A09, 0x1A09 }, { 0x1A0A, 0x1A0A, 0x1A0A }, { 0x1A0B, 0x1A0B, 0x1A0B }, { 0x1A0C, 0x1A0C, 0x1A0C }, { 0x1A0D, 0x1A0D, 0x1A0D }, { 0x1A0E, 0x1A0E, 0x1A0E }, { 0x1A0F, 0x1A0F, 0x1A0F }, { 0x1A10, 0x1A10, 0x1A10 }, { 0x1A11, 0x1A11, 0x1A11 }, { 0x1A12, 0x1A12, 0x1A12 }, { 0x1A13, 0x1A13, 0x1A13 }, { 0x1A14, 0x1A14, 0x1A14 }, { 0x1A15, 0x1A15, 0x1A15 }, { 0x1A16, 0x1A16, 0x1A16 }, { 0x1A17, 0x1A17, 0x1A17 }, { 0x1A18, 0x1A18, 0x1A18 }, { 0x1D00, 0x1D00, 0x1D00 }, { 0x1D01, 0x1D01, 0x1D01 }, { 0x1D02, 0x1D02, 0x1D02 }, { 0x1D03, 0x1D03, 0x1D03 }, { 0x1D04, 0x1D04, 0x1D04 }, { 0x1D05, 0x1D05, 0x1D05 }, { 0x1D06, 0x1D06, 0x1D06 }, { 0x1D07, 0x1D07, 0x1D07 }, { 0x1D08, 0x1D08, 0x1D08 }, { 0x1D09, 0x1D09, 0x1D09 }, { 0x1D0A, 0x1D0A, 0x1D0A }, { 0x1D0B, 0x1D0B, 0x1D0B }, { 0x1D0C, 0x1D0C, 0x1D0C }, { 0x1D0D, 0x1D0D, 0x1D0D }, { 0x1D0E, 0x1D0E, 0x1D0E }, { 0x1D0F, 0x1D0F, 0x1D0F }, { 0x1D10, 0x1D10, 0x1D10 }, { 0x1D11, 0x1D11, 0x1D11 }, { 0x1D12, 0x1D12, 0x1D12 }, { 0x1D13, 0x1D13, 0x1D13 }, { 0x1D14, 0x1D14, 0x1D14 }, { 0x1D15, 0x1D15, 0x1D15 }, { 0x1D16, 0x1D16, 0x1D16 }, { 0x1D17, 0x1D17, 0x1D17 }, { 0x1D18, 0x1D18, 0x1D18 }, { 0x1D19, 0x1D19, 0x1D19 }, { 0x1D1A, 0x1D1A, 0x1D1A }, { 0x1D1B, 0x1D1B, 0x1D1B }, { 0x1D1C, 0x1D1C, 0x1D1C }, { 0x1D1D, 0x1D1D, 0x1D1D }, { 0x1D1E, 0x1D1E, 0x1D1E }, { 0x1D1F, 0x1D1F, 0x1D1F }, { 0x1D20, 0x1D20, 0x1D20 }, { 0x1D21, 0x1D21, 0x1D21 }, { 0x1D22, 0x1D22, 0x1D22 }, { 0x1D23, 0x1D23, 0x1D23 }, { 0x1D24, 0x1D24, 0x1D24 }, { 0x1D25, 0x1D25, 0x1D25 }, { 0x1D26, 0x1D26, 0x1D26 }, { 0x1D27, 0x1D27, 0x1D27 }, { 0x1D28, 0x1D28, 0x1D28 }, { 0x1D29, 0x1D29, 0x1D29 }, { 0x1D2A, 0x1D2A, 0x1D2A }, { 0x1D2B, 0x1D2B, 0x1D2B }, { 0x1D2C, 0x1D2C, 0x1D2C }, { 0x1D2D, 0x1D2D, 0x1D2D }, { 0x1D2E, 0x1D2E, 0x1D2E }, { 0x1D2F, 0x1D2F, 0x1D2F }, { 0x1D30, 0x1D30, 0x1D30 }, { 0x1D31, 0x1D31, 0x1D31 }, { 0x1D32, 0x1D32, 0x1D32 }, { 0x1D33, 0x1D33, 0x1D33 }, { 0x1D34, 0x1D34, 0x1D34 }, { 0x1D35, 0x1D35, 0x1D35 }, { 0x1D36, 0x1D36, 0x1D36 }, { 0x1D37, 0x1D37, 0x1D37 }, { 0x1D38, 0x1D38, 0x1D38 }, { 0x1D39, 0x1D39, 0x1D39 }, { 0x1D3A, 0x1D3A, 0x1D3A }, { 0x1D3B, 0x1D3B, 0x1D3B }, { 0x1D3C, 0x1D3C, 0x1D3C }, { 0x1D3D, 0x1D3D, 0x1D3D }, { 0x1D3E, 0x1D3E, 0x1D3E }, { 0x1D3F, 0x1D3F, 0x1D3F }, { 0x1D40, 0x1D40, 0x1D40 }, { 0x1D41, 0x1D41, 0x1D41 }, { 0x1D42, 0x1D42, 0x1D42 }, { 0x1D43, 0x1D43, 0x1D43 }, { 0x1D44, 0x1D44, 0x1D44 }, { 0x1D45, 0x1D45, 0x1D45 }, { 0x1D46, 0x1D46, 0x1D46 }, { 0x1D47, 0x1D47, 0x1D47 }, { 0x1D48, 0x1D48, 0x1D48 }, { 0x1D49, 0x1D49, 0x1D49 }, { 0x1D4A, 0x1D4A, 0x1D4A }, { 0x1D4B, 0x1D4B, 0x1D4B }, { 0x1D4C, 0x1D4C, 0x1D4C }, { 0x1D4D, 0x1D4D, 0x1D4D }, { 0x1D4E, 0x1D4E, 0x1D4E }, { 0x1D4F, 0x1D4F, 0x1D4F }, { 0x1D50, 0x1D50, 0x1D50 }, { 0x1D51, 0x1D51, 0x1D51 }, { 0x1D52, 0x1D52, 0x1D52 }, { 0x1D53, 0x1D53, 0x1D53 }, { 0x1D54, 0x1D54, 0x1D54 }, { 0x1D55, 0x1D55, 0x1D55 }, { 0x1D56, 0x1D56, 0x1D56 }, { 0x1D57, 0x1D57, 0x1D57 }, { 0x1D58, 0x1D58, 0x1D58 }, { 0x1D59, 0x1D59, 0x1D59 }, { 0x1D5A, 0x1D5A, 0x1D5A }, { 0x1D5B, 0x1D5B, 0x1D5B }, { 0x1D5C, 0x1D5C, 0x1D5C }, { 0x1D5D, 0x1D5D, 0x1D5D }, { 0x1D5E, 0x1D5E, 0x1D5E }, { 0x1D5F, 0x1D5F, 0x1D5F }, { 0x1D60, 0x1D60, 0x1D60 }, { 0x1D61, 0x1D61, 0x1D61 }, { 0x1D62, 0x1D62, 0x1D62 }, { 0x1D63, 0x1D63, 0x1D63 }, { 0x1D64, 0x1D64, 0x1D64 }, { 0x1D65, 0x1D65, 0x1D65 }, { 0x1D66, 0x1D66, 0x1D66 }, { 0x1D67, 0x1D67, 0x1D67 }, { 0x1D68, 0x1D68, 0x1D68 }, { 0x1D69, 0x1D69, 0x1D69 }, { 0x1D6A, 0x1D6A, 0x1D6A }, { 0x1D6B, 0x1D6B, 0x1D6B }, { 0x1D6C, 0x1D6C, 0x1D6C }, { 0x1D6D, 0x1D6D, 0x1D6D }, { 0x1D6E, 0x1D6E, 0x1D6E }, { 0x1D6F, 0x1D6F, 0x1D6F }, { 0x1D70, 0x1D70, 0x1D70 }, { 0x1D71, 0x1D71, 0x1D71 }, { 0x1D72, 0x1D72, 0x1D72 }, { 0x1D73, 0x1D73, 0x1D73 }, { 0x1D74, 0x1D74, 0x1D74 }, { 0x1D75, 0x1D75, 0x1D75 }, { 0x1D76, 0x1D76, 0x1D76 }, { 0x1D77, 0x1D77, 0x1D77 }, { 0x1D78, 0x1D78, 0x1D78 }, { 0x1D79, 0x1D79, 0x1D79 }, { 0x1D7A, 0x1D7A, 0x1D7A }, { 0x1D7B, 0x1D7B, 0x1D7B }, { 0x1D7C, 0x1D7C, 0x1D7C }, { 0x1D7D, 0x1D7D, 0x1D7D }, { 0x1D7E, 0x1D7E, 0x1D7E }, { 0x1D7F, 0x1D7F, 0x1D7F }, { 0x1D80, 0x1D80, 0x1D80 }, { 0x1D81, 0x1D81, 0x1D81 }, { 0x1D82, 0x1D82, 0x1D82 }, { 0x1D83, 0x1D83, 0x1D83 }, { 0x1D84, 0x1D84, 0x1D84 }, { 0x1D85, 0x1D85, 0x1D85 }, { 0x1D86, 0x1D86, 0x1D86 }, { 0x1D87, 0x1D87, 0x1D87 }, { 0x1D88, 0x1D88, 0x1D88 }, { 0x1D89, 0x1D89, 0x1D89 }, { 0x1D8A, 0x1D8A, 0x1D8A }, { 0x1D8B, 0x1D8B, 0x1D8B }, { 0x1D8C, 0x1D8C, 0x1D8C }, { 0x1D8D, 0x1D8D, 0x1D8D }, { 0x1D8E, 0x1D8E, 0x1D8E }, { 0x1D8F, 0x1D8F, 0x1D8F }, { 0x1D90, 0x1D90, 0x1D90 }, { 0x1D91, 0x1D91, 0x1D91 }, { 0x1D92, 0x1D92, 0x1D92 }, { 0x1D93, 0x1D93, 0x1D93 }, { 0x1D94, 0x1D94, 0x1D94 }, { 0x1D95, 0x1D95, 0x1D95 }, { 0x1D96, 0x1D96, 0x1D96 }, { 0x1D97, 0x1D97, 0x1D97 }, { 0x1D98, 0x1D98, 0x1D98 }, { 0x1D99, 0x1D99, 0x1D99 }, { 0x1D9A, 0x1D9A, 0x1D9A }, { 0x1D9B, 0x1D9B, 0x1D9B }, { 0x1D9C, 0x1D9C, 0x1D9C }, { 0x1D9D, 0x1D9D, 0x1D9D }, { 0x1D9E, 0x1D9E, 0x1D9E }, { 0x1D9F, 0x1D9F, 0x1D9F }, { 0x1DA0, 0x1DA0, 0x1DA0 }, { 0x1DA1, 0x1DA1, 0x1DA1 }, { 0x1DA2, 0x1DA2, 0x1DA2 }, { 0x1DA3, 0x1DA3, 0x1DA3 }, { 0x1DA4, 0x1DA4, 0x1DA4 }, { 0x1DA5, 0x1DA5, 0x1DA5 }, { 0x1DA6, 0x1DA6, 0x1DA6 }, { 0x1DA7, 0x1DA7, 0x1DA7 }, { 0x1DA8, 0x1DA8, 0x1DA8 }, { 0x1DA9, 0x1DA9, 0x1DA9 }, { 0x1DAA, 0x1DAA, 0x1DAA }, { 0x1DAB, 0x1DAB, 0x1DAB }, { 0x1DAC, 0x1DAC, 0x1DAC }, { 0x1DAD, 0x1DAD, 0x1DAD }, { 0x1DAE, 0x1DAE, 0x1DAE }, { 0x1DAF, 0x1DAF, 0x1DAF }, { 0x1DB0, 0x1DB0, 0x1DB0 }, { 0x1DB1, 0x1DB1, 0x1DB1 }, { 0x1DB2, 0x1DB2, 0x1DB2 }, { 0x1DB3, 0x1DB3, 0x1DB3 }, { 0x1DB4, 0x1DB4, 0x1DB4 }, { 0x1DB5, 0x1DB5, 0x1DB5 }, { 0x1DB6, 0x1DB6, 0x1DB6 }, { 0x1DB7, 0x1DB7, 0x1DB7 }, { 0x1DB8, 0x1DB8, 0x1DB8 }, { 0x1DB9, 0x1DB9, 0x1DB9 }, { 0x1DBA, 0x1DBA, 0x1DBA }, { 0x1DBB, 0x1DBB, 0x1DBB }, { 0x1DBC, 0x1DBC, 0x1DBC }, { 0x1DBD, 0x1DBD, 0x1DBD }, { 0x1DBE, 0x1DBE, 0x1DBE }, { 0x1DBF, 0x1DBF, 0x1DBF }, { 0x1DC0, 0x1DC0, 0x1DC0 }, { 0x1DC1, 0x1DC1, 0x1DC1 }, { 0x1DC2, 0x1DC2, 0x1DC2 }, { 0x1DC3, 0x1DC3, 0x1DC3 }, { 0x1E00, 0x1E00, 0x1E01 }, { 0x1E01, 0x1E00, 0x1E01 }, { 0x1E02, 0x1E02, 0x1E03 }, { 0x1E03, 0x1E02, 0x1E03 }, { 0x1E04, 0x1E04, 0x1E05 }, { 0x1E05, 0x1E04, 0x1E05 }, { 0x1E06, 0x1E06, 0x1E07 }, { 0x1E07, 0x1E06, 0x1E07 }, { 0x1E08, 0x1E08, 0x1E09 }, { 0x1E09, 0x1E08, 0x1E09 }, { 0x1E0A, 0x1E0A, 0x1E0B }, { 0x1E0B, 0x1E0A, 0x1E0B }, { 0x1E0C, 0x1E0C, 0x1E0D }, { 0x1E0D, 0x1E0C, 0x1E0D }, { 0x1E0E, 0x1E0E, 0x1E0F }, { 0x1E0F, 0x1E0E, 0x1E0F }, { 0x1E10, 0x1E10, 0x1E11 }, { 0x1E11, 0x1E10, 0x1E11 }, { 0x1E12, 0x1E12, 0x1E13 }, { 0x1E13, 0x1E12, 0x1E13 }, { 0x1E14, 0x1E14, 0x1E15 }, { 0x1E15, 0x1E14, 0x1E15 }, { 0x1E16, 0x1E16, 0x1E17 }, { 0x1E17, 0x1E16, 0x1E17 }, { 0x1E18, 0x1E18, 0x1E19 }, { 0x1E19, 0x1E18, 0x1E19 }, { 0x1E1A, 0x1E1A, 0x1E1B }, { 0x1E1B, 0x1E1A, 0x1E1B }, { 0x1E1C, 0x1E1C, 0x1E1D }, { 0x1E1D, 0x1E1C, 0x1E1D }, { 0x1E1E, 0x1E1E, 0x1E1F }, { 0x1E1F, 0x1E1E, 0x1E1F }, { 0x1E20, 0x1E20, 0x1E21 }, { 0x1E21, 0x1E20, 0x1E21 }, { 0x1E22, 0x1E22, 0x1E23 }, { 0x1E23, 0x1E22, 0x1E23 }, { 0x1E24, 0x1E24, 0x1E25 }, { 0x1E25, 0x1E24, 0x1E25 }, { 0x1E26, 0x1E26, 0x1E27 }, { 0x1E27, 0x1E26, 0x1E27 }, { 0x1E28, 0x1E28, 0x1E29 }, { 0x1E29, 0x1E28, 0x1E29 }, { 0x1E2A, 0x1E2A, 0x1E2B }, { 0x1E2B, 0x1E2A, 0x1E2B }, { 0x1E2C, 0x1E2C, 0x1E2D }, { 0x1E2D, 0x1E2C, 0x1E2D }, { 0x1E2E, 0x1E2E, 0x1E2F }, { 0x1E2F, 0x1E2E, 0x1E2F }, { 0x1E30, 0x1E30, 0x1E31 }, { 0x1E31, 0x1E30, 0x1E31 }, { 0x1E32, 0x1E32, 0x1E33 }, { 0x1E33, 0x1E32, 0x1E33 }, { 0x1E34, 0x1E34, 0x1E35 }, { 0x1E35, 0x1E34, 0x1E35 }, { 0x1E36, 0x1E36, 0x1E37 }, { 0x1E37, 0x1E36, 0x1E37 }, { 0x1E38, 0x1E38, 0x1E39 }, { 0x1E39, 0x1E38, 0x1E39 }, { 0x1E3A, 0x1E3A, 0x1E3B }, { 0x1E3B, 0x1E3A, 0x1E3B }, { 0x1E3C, 0x1E3C, 0x1E3D }, { 0x1E3D, 0x1E3C, 0x1E3D }, { 0x1E3E, 0x1E3E, 0x1E3F }, { 0x1E3F, 0x1E3E, 0x1E3F }, { 0x1E40, 0x1E40, 0x1E41 }, { 0x1E41, 0x1E40, 0x1E41 }, { 0x1E42, 0x1E42, 0x1E43 }, { 0x1E43, 0x1E42, 0x1E43 }, { 0x1E44, 0x1E44, 0x1E45 }, { 0x1E45, 0x1E44, 0x1E45 }, { 0x1E46, 0x1E46, 0x1E47 }, { 0x1E47, 0x1E46, 0x1E47 }, { 0x1E48, 0x1E48, 0x1E49 }, { 0x1E49, 0x1E48, 0x1E49 }, { 0x1E4A, 0x1E4A, 0x1E4B }, { 0x1E4B, 0x1E4A, 0x1E4B }, { 0x1E4C, 0x1E4C, 0x1E4D }, { 0x1E4D, 0x1E4C, 0x1E4D }, { 0x1E4E, 0x1E4E, 0x1E4F }, { 0x1E4F, 0x1E4E, 0x1E4F }, { 0x1E50, 0x1E50, 0x1E51 }, { 0x1E51, 0x1E50, 0x1E51 }, { 0x1E52, 0x1E52, 0x1E53 }, { 0x1E53, 0x1E52, 0x1E53 }, { 0x1E54, 0x1E54, 0x1E55 }, { 0x1E55, 0x1E54, 0x1E55 }, { 0x1E56, 0x1E56, 0x1E57 }, { 0x1E57, 0x1E56, 0x1E57 }, { 0x1E58, 0x1E58, 0x1E59 }, { 0x1E59, 0x1E58, 0x1E59 }, { 0x1E5A, 0x1E5A, 0x1E5B }, { 0x1E5B, 0x1E5A, 0x1E5B }, { 0x1E5C, 0x1E5C, 0x1E5D }, { 0x1E5D, 0x1E5C, 0x1E5D }, { 0x1E5E, 0x1E5E, 0x1E5F }, { 0x1E5F, 0x1E5E, 0x1E5F }, { 0x1E60, 0x1E60, 0x1E61 }, { 0x1E61, 0x1E60, 0x1E61 }, { 0x1E62, 0x1E62, 0x1E63 }, { 0x1E63, 0x1E62, 0x1E63 }, { 0x1E64, 0x1E64, 0x1E65 }, { 0x1E65, 0x1E64, 0x1E65 }, { 0x1E66, 0x1E66, 0x1E67 }, { 0x1E67, 0x1E66, 0x1E67 }, { 0x1E68, 0x1E68, 0x1E69 }, { 0x1E69, 0x1E68, 0x1E69 }, { 0x1E6A, 0x1E6A, 0x1E6B }, { 0x1E6B, 0x1E6A, 0x1E6B }, { 0x1E6C, 0x1E6C, 0x1E6D }, { 0x1E6D, 0x1E6C, 0x1E6D }, { 0x1E6E, 0x1E6E, 0x1E6F }, { 0x1E6F, 0x1E6E, 0x1E6F }, { 0x1E70, 0x1E70, 0x1E71 }, { 0x1E71, 0x1E70, 0x1E71 }, { 0x1E72, 0x1E72, 0x1E73 }, { 0x1E73, 0x1E72, 0x1E73 }, { 0x1E74, 0x1E74, 0x1E75 }, { 0x1E75, 0x1E74, 0x1E75 }, { 0x1E76, 0x1E76, 0x1E77 }, { 0x1E77, 0x1E76, 0x1E77 }, { 0x1E78, 0x1E78, 0x1E79 }, { 0x1E79, 0x1E78, 0x1E79 }, { 0x1E7A, 0x1E7A, 0x1E7B }, { 0x1E7B, 0x1E7A, 0x1E7B }, { 0x1E7C, 0x1E7C, 0x1E7D }, { 0x1E7D, 0x1E7C, 0x1E7D }, { 0x1E7E, 0x1E7E, 0x1E7F }, { 0x1E7F, 0x1E7E, 0x1E7F }, { 0x1E80, 0x1E80, 0x1E81 }, { 0x1E81, 0x1E80, 0x1E81 }, { 0x1E82, 0x1E82, 0x1E83 }, { 0x1E83, 0x1E82, 0x1E83 }, { 0x1E84, 0x1E84, 0x1E85 }, { 0x1E85, 0x1E84, 0x1E85 }, { 0x1E86, 0x1E86, 0x1E87 }, { 0x1E87, 0x1E86, 0x1E87 }, { 0x1E88, 0x1E88, 0x1E89 }, { 0x1E89, 0x1E88, 0x1E89 }, { 0x1E8A, 0x1E8A, 0x1E8B }, { 0x1E8B, 0x1E8A, 0x1E8B }, { 0x1E8C, 0x1E8C, 0x1E8D }, { 0x1E8D, 0x1E8C, 0x1E8D }, { 0x1E8E, 0x1E8E, 0x1E8F }, { 0x1E8F, 0x1E8E, 0x1E8F }, { 0x1E90, 0x1E90, 0x1E91 }, { 0x1E91, 0x1E90, 0x1E91 }, { 0x1E92, 0x1E92, 0x1E93 }, { 0x1E93, 0x1E92, 0x1E93 }, { 0x1E94, 0x1E94, 0x1E95 }, { 0x1E95, 0x1E94, 0x1E95 }, { 0x1E96, 0x1E96, 0x1E96 }, { 0x1E97, 0x1E97, 0x1E97 }, { 0x1E98, 0x1E98, 0x1E98 }, { 0x1E99, 0x1E99, 0x1E99 }, { 0x1E9A, 0x1E9A, 0x1E9A }, { 0x1E9B, 0x1E60, 0x1E9B }, { 0x1EA0, 0x1EA0, 0x1EA1 }, { 0x1EA1, 0x1EA0, 0x1EA1 }, { 0x1EA2, 0x1EA2, 0x1EA3 }, { 0x1EA3, 0x1EA2, 0x1EA3 }, { 0x1EA4, 0x1EA4, 0x1EA5 }, { 0x1EA5, 0x1EA4, 0x1EA5 }, { 0x1EA6, 0x1EA6, 0x1EA7 }, { 0x1EA7, 0x1EA6, 0x1EA7 }, { 0x1EA8, 0x1EA8, 0x1EA9 }, { 0x1EA9, 0x1EA8, 0x1EA9 }, { 0x1EAA, 0x1EAA, 0x1EAB }, { 0x1EAB, 0x1EAA, 0x1EAB }, { 0x1EAC, 0x1EAC, 0x1EAD }, { 0x1EAD, 0x1EAC, 0x1EAD }, { 0x1EAE, 0x1EAE, 0x1EAF }, { 0x1EAF, 0x1EAE, 0x1EAF }, { 0x1EB0, 0x1EB0, 0x1EB1 }, { 0x1EB1, 0x1EB0, 0x1EB1 }, { 0x1EB2, 0x1EB2, 0x1EB3 }, { 0x1EB3, 0x1EB2, 0x1EB3 }, { 0x1EB4, 0x1EB4, 0x1EB5 }, { 0x1EB5, 0x1EB4, 0x1EB5 }, { 0x1EB6, 0x1EB6, 0x1EB7 }, { 0x1EB7, 0x1EB6, 0x1EB7 }, { 0x1EB8, 0x1EB8, 0x1EB9 }, { 0x1EB9, 0x1EB8, 0x1EB9 }, { 0x1EBA, 0x1EBA, 0x1EBB }, { 0x1EBB, 0x1EBA, 0x1EBB }, { 0x1EBC, 0x1EBC, 0x1EBD }, { 0x1EBD, 0x1EBC, 0x1EBD }, { 0x1EBE, 0x1EBE, 0x1EBF }, { 0x1EBF, 0x1EBE, 0x1EBF }, { 0x1EC0, 0x1EC0, 0x1EC1 }, { 0x1EC1, 0x1EC0, 0x1EC1 }, { 0x1EC2, 0x1EC2, 0x1EC3 }, { 0x1EC3, 0x1EC2, 0x1EC3 }, { 0x1EC4, 0x1EC4, 0x1EC5 }, { 0x1EC5, 0x1EC4, 0x1EC5 }, { 0x1EC6, 0x1EC6, 0x1EC7 }, { 0x1EC7, 0x1EC6, 0x1EC7 }, { 0x1EC8, 0x1EC8, 0x1EC9 }, { 0x1EC9, 0x1EC8, 0x1EC9 }, { 0x1ECA, 0x1ECA, 0x1ECB }, { 0x1ECB, 0x1ECA, 0x1ECB }, { 0x1ECC, 0x1ECC, 0x1ECD }, { 0x1ECD, 0x1ECC, 0x1ECD }, { 0x1ECE, 0x1ECE, 0x1ECF }, { 0x1ECF, 0x1ECE, 0x1ECF }, { 0x1ED0, 0x1ED0, 0x1ED1 }, { 0x1ED1, 0x1ED0, 0x1ED1 }, { 0x1ED2, 0x1ED2, 0x1ED3 }, { 0x1ED3, 0x1ED2, 0x1ED3 }, { 0x1ED4, 0x1ED4, 0x1ED5 }, { 0x1ED5, 0x1ED4, 0x1ED5 }, { 0x1ED6, 0x1ED6, 0x1ED7 }, { 0x1ED7, 0x1ED6, 0x1ED7 }, { 0x1ED8, 0x1ED8, 0x1ED9 }, { 0x1ED9, 0x1ED8, 0x1ED9 }, { 0x1EDA, 0x1EDA, 0x1EDB }, { 0x1EDB, 0x1EDA, 0x1EDB }, { 0x1EDC, 0x1EDC, 0x1EDD }, { 0x1EDD, 0x1EDC, 0x1EDD }, { 0x1EDE, 0x1EDE, 0x1EDF }, { 0x1EDF, 0x1EDE, 0x1EDF }, { 0x1EE0, 0x1EE0, 0x1EE1 }, { 0x1EE1, 0x1EE0, 0x1EE1 }, { 0x1EE2, 0x1EE2, 0x1EE3 }, { 0x1EE3, 0x1EE2, 0x1EE3 }, { 0x1EE4, 0x1EE4, 0x1EE5 }, { 0x1EE5, 0x1EE4, 0x1EE5 }, { 0x1EE6, 0x1EE6, 0x1EE7 }, { 0x1EE7, 0x1EE6, 0x1EE7 }, { 0x1EE8, 0x1EE8, 0x1EE9 }, { 0x1EE9, 0x1EE8, 0x1EE9 }, { 0x1EEA, 0x1EEA, 0x1EEB }, { 0x1EEB, 0x1EEA, 0x1EEB }, { 0x1EEC, 0x1EEC, 0x1EED }, { 0x1EED, 0x1EEC, 0x1EED }, { 0x1EEE, 0x1EEE, 0x1EEF }, { 0x1EEF, 0x1EEE, 0x1EEF }, { 0x1EF0, 0x1EF0, 0x1EF1 }, { 0x1EF1, 0x1EF0, 0x1EF1 }, { 0x1EF2, 0x1EF2, 0x1EF3 }, { 0x1EF3, 0x1EF2, 0x1EF3 }, { 0x1EF4, 0x1EF4, 0x1EF5 }, { 0x1EF5, 0x1EF4, 0x1EF5 }, { 0x1EF6, 0x1EF6, 0x1EF7 }, { 0x1EF7, 0x1EF6, 0x1EF7 }, { 0x1EF8, 0x1EF8, 0x1EF9 }, { 0x1EF9, 0x1EF8, 0x1EF9 }, { 0x1F00, 0x1F08, 0x1F00 }, { 0x1F01, 0x1F09, 0x1F01 }, { 0x1F02, 0x1F0A, 0x1F02 }, { 0x1F03, 0x1F0B, 0x1F03 }, { 0x1F04, 0x1F0C, 0x1F04 }, { 0x1F05, 0x1F0D, 0x1F05 }, { 0x1F06, 0x1F0E, 0x1F06 }, { 0x1F07, 0x1F0F, 0x1F07 }, { 0x1F08, 0x1F08, 0x1F00 }, { 0x1F09, 0x1F09, 0x1F01 }, { 0x1F0A, 0x1F0A, 0x1F02 }, { 0x1F0B, 0x1F0B, 0x1F03 }, { 0x1F0C, 0x1F0C, 0x1F04 }, { 0x1F0D, 0x1F0D, 0x1F05 }, { 0x1F0E, 0x1F0E, 0x1F06 }, { 0x1F0F, 0x1F0F, 0x1F07 }, { 0x1F10, 0x1F18, 0x1F10 }, { 0x1F11, 0x1F19, 0x1F11 }, { 0x1F12, 0x1F1A, 0x1F12 }, { 0x1F13, 0x1F1B, 0x1F13 }, { 0x1F14, 0x1F1C, 0x1F14 }, { 0x1F15, 0x1F1D, 0x1F15 }, { 0x1F18, 0x1F18, 0x1F10 }, { 0x1F19, 0x1F19, 0x1F11 }, { 0x1F1A, 0x1F1A, 0x1F12 }, { 0x1F1B, 0x1F1B, 0x1F13 }, { 0x1F1C, 0x1F1C, 0x1F14 }, { 0x1F1D, 0x1F1D, 0x1F15 }, { 0x1F20, 0x1F28, 0x1F20 }, { 0x1F21, 0x1F29, 0x1F21 }, { 0x1F22, 0x1F2A, 0x1F22 }, { 0x1F23, 0x1F2B, 0x1F23 }, { 0x1F24, 0x1F2C, 0x1F24 }, { 0x1F25, 0x1F2D, 0x1F25 }, { 0x1F26, 0x1F2E, 0x1F26 }, { 0x1F27, 0x1F2F, 0x1F27 }, { 0x1F28, 0x1F28, 0x1F20 }, { 0x1F29, 0x1F29, 0x1F21 }, { 0x1F2A, 0x1F2A, 0x1F22 }, { 0x1F2B, 0x1F2B, 0x1F23 }, { 0x1F2C, 0x1F2C, 0x1F24 }, { 0x1F2D, 0x1F2D, 0x1F25 }, { 0x1F2E, 0x1F2E, 0x1F26 }, { 0x1F2F, 0x1F2F, 0x1F27 }, { 0x1F30, 0x1F38, 0x1F30 }, { 0x1F31, 0x1F39, 0x1F31 }, { 0x1F32, 0x1F3A, 0x1F32 }, { 0x1F33, 0x1F3B, 0x1F33 }, { 0x1F34, 0x1F3C, 0x1F34 }, { 0x1F35, 0x1F3D, 0x1F35 }, { 0x1F36, 0x1F3E, 0x1F36 }, { 0x1F37, 0x1F3F, 0x1F37 }, { 0x1F38, 0x1F38, 0x1F30 }, { 0x1F39, 0x1F39, 0x1F31 }, { 0x1F3A, 0x1F3A, 0x1F32 }, { 0x1F3B, 0x1F3B, 0x1F33 }, { 0x1F3C, 0x1F3C, 0x1F34 }, { 0x1F3D, 0x1F3D, 0x1F35 }, { 0x1F3E, 0x1F3E, 0x1F36 }, { 0x1F3F, 0x1F3F, 0x1F37 }, { 0x1F40, 0x1F48, 0x1F40 }, { 0x1F41, 0x1F49, 0x1F41 }, { 0x1F42, 0x1F4A, 0x1F42 }, { 0x1F43, 0x1F4B, 0x1F43 }, { 0x1F44, 0x1F4C, 0x1F44 }, { 0x1F45, 0x1F4D, 0x1F45 }, { 0x1F48, 0x1F48, 0x1F40 }, { 0x1F49, 0x1F49, 0x1F41 }, { 0x1F4A, 0x1F4A, 0x1F42 }, { 0x1F4B, 0x1F4B, 0x1F43 }, { 0x1F4C, 0x1F4C, 0x1F44 }, { 0x1F4D, 0x1F4D, 0x1F45 }, { 0x1F50, 0x1F50, 0x1F50 }, { 0x1F51, 0x1F59, 0x1F51 }, { 0x1F52, 0x1F52, 0x1F52 }, { 0x1F53, 0x1F5B, 0x1F53 }, { 0x1F54, 0x1F54, 0x1F54 }, { 0x1F55, 0x1F5D, 0x1F55 }, { 0x1F56, 0x1F56, 0x1F56 }, { 0x1F57, 0x1F5F, 0x1F57 }, { 0x1F59, 0x1F59, 0x1F51 }, { 0x1F5B, 0x1F5B, 0x1F53 }, { 0x1F5D, 0x1F5D, 0x1F55 }, { 0x1F5F, 0x1F5F, 0x1F57 }, { 0x1F60, 0x1F68, 0x1F60 }, { 0x1F61, 0x1F69, 0x1F61 }, { 0x1F62, 0x1F6A, 0x1F62 }, { 0x1F63, 0x1F6B, 0x1F63 }, { 0x1F64, 0x1F6C, 0x1F64 }, { 0x1F65, 0x1F6D, 0x1F65 }, { 0x1F66, 0x1F6E, 0x1F66 }, { 0x1F67, 0x1F6F, 0x1F67 }, { 0x1F68, 0x1F68, 0x1F60 }, { 0x1F69, 0x1F69, 0x1F61 }, { 0x1F6A, 0x1F6A, 0x1F62 }, { 0x1F6B, 0x1F6B, 0x1F63 }, { 0x1F6C, 0x1F6C, 0x1F64 }, { 0x1F6D, 0x1F6D, 0x1F65 }, { 0x1F6E, 0x1F6E, 0x1F66 }, { 0x1F6F, 0x1F6F, 0x1F67 }, { 0x1F70, 0x1FBA, 0x1F70 }, { 0x1F71, 0x1FBB, 0x1F71 }, { 0x1F72, 0x1FC8, 0x1F72 }, { 0x1F73, 0x1FC9, 0x1F73 }, { 0x1F74, 0x1FCA, 0x1F74 }, { 0x1F75, 0x1FCB, 0x1F75 }, { 0x1F76, 0x1FDA, 0x1F76 }, { 0x1F77, 0x1FDB, 0x1F77 }, { 0x1F78, 0x1FF8, 0x1F78 }, { 0x1F79, 0x1FF9, 0x1F79 }, { 0x1F7A, 0x1FEA, 0x1F7A }, { 0x1F7B, 0x1FEB, 0x1F7B }, { 0x1F7C, 0x1FFA, 0x1F7C }, { 0x1F7D, 0x1FFB, 0x1F7D }, { 0x1F80, 0x1F88, 0x1F80 }, { 0x1F81, 0x1F89, 0x1F81 }, { 0x1F82, 0x1F8A, 0x1F82 }, { 0x1F83, 0x1F8B, 0x1F83 }, { 0x1F84, 0x1F8C, 0x1F84 }, { 0x1F85, 0x1F8D, 0x1F85 }, { 0x1F86, 0x1F8E, 0x1F86 }, { 0x1F87, 0x1F8F, 0x1F87 }, { 0x1F88, 0x1F88, 0x1F80 }, { 0x1F89, 0x1F89, 0x1F81 }, { 0x1F8A, 0x1F8A, 0x1F82 }, { 0x1F8B, 0x1F8B, 0x1F83 }, { 0x1F8C, 0x1F8C, 0x1F84 }, { 0x1F8D, 0x1F8D, 0x1F85 }, { 0x1F8E, 0x1F8E, 0x1F86 }, { 0x1F8F, 0x1F8F, 0x1F87 }, { 0x1F90, 0x1F98, 0x1F90 }, { 0x1F91, 0x1F99, 0x1F91 }, { 0x1F92, 0x1F9A, 0x1F92 }, { 0x1F93, 0x1F9B, 0x1F93 }, { 0x1F94, 0x1F9C, 0x1F94 }, { 0x1F95, 0x1F9D, 0x1F95 }, { 0x1F96, 0x1F9E, 0x1F96 }, { 0x1F97, 0x1F9F, 0x1F97 }, { 0x1F98, 0x1F98, 0x1F90 }, { 0x1F99, 0x1F99, 0x1F91 }, { 0x1F9A, 0x1F9A, 0x1F92 }, { 0x1F9B, 0x1F9B, 0x1F93 }, { 0x1F9C, 0x1F9C, 0x1F94 }, { 0x1F9D, 0x1F9D, 0x1F95 }, { 0x1F9E, 0x1F9E, 0x1F96 }, { 0x1F9F, 0x1F9F, 0x1F97 }, { 0x1FA0, 0x1FA8, 0x1FA0 }, { 0x1FA1, 0x1FA9, 0x1FA1 }, { 0x1FA2, 0x1FAA, 0x1FA2 }, { 0x1FA3, 0x1FAB, 0x1FA3 }, { 0x1FA4, 0x1FAC, 0x1FA4 }, { 0x1FA5, 0x1FAD, 0x1FA5 }, { 0x1FA6, 0x1FAE, 0x1FA6 }, { 0x1FA7, 0x1FAF, 0x1FA7 }, { 0x1FA8, 0x1FA8, 0x1FA0 }, { 0x1FA9, 0x1FA9, 0x1FA1 }, { 0x1FAA, 0x1FAA, 0x1FA2 }, { 0x1FAB, 0x1FAB, 0x1FA3 }, { 0x1FAC, 0x1FAC, 0x1FA4 }, { 0x1FAD, 0x1FAD, 0x1FA5 }, { 0x1FAE, 0x1FAE, 0x1FA6 }, { 0x1FAF, 0x1FAF, 0x1FA7 }, { 0x1FB0, 0x1FB8, 0x1FB0 }, { 0x1FB1, 0x1FB9, 0x1FB1 }, { 0x1FB2, 0x1FB2, 0x1FB2 }, { 0x1FB3, 0x1FBC, 0x1FB3 }, { 0x1FB4, 0x1FB4, 0x1FB4 }, { 0x1FB6, 0x1FB6, 0x1FB6 }, { 0x1FB7, 0x1FB7, 0x1FB7 }, { 0x1FB8, 0x1FB8, 0x1FB0 }, { 0x1FB9, 0x1FB9, 0x1FB1 }, { 0x1FBA, 0x1FBA, 0x1F70 }, { 0x1FBB, 0x1FBB, 0x1F71 }, { 0x1FBC, 0x1FBC, 0x1FB3 }, { 0x1FBE, 0x0399, 0x1FBE }, { 0x1FC2, 0x1FC2, 0x1FC2 }, { 0x1FC3, 0x1FCC, 0x1FC3 }, { 0x1FC4, 0x1FC4, 0x1FC4 }, { 0x1FC6, 0x1FC6, 0x1FC6 }, { 0x1FC7, 0x1FC7, 0x1FC7 }, { 0x1FC8, 0x1FC8, 0x1F72 }, { 0x1FC9, 0x1FC9, 0x1F73 }, { 0x1FCA, 0x1FCA, 0x1F74 }, { 0x1FCB, 0x1FCB, 0x1F75 }, { 0x1FCC, 0x1FCC, 0x1FC3 }, { 0x1FD0, 0x1FD8, 0x1FD0 }, { 0x1FD1, 0x1FD9, 0x1FD1 }, { 0x1FD2, 0x1FD2, 0x1FD2 }, { 0x1FD3, 0x1FD3, 0x1FD3 }, { 0x1FD6, 0x1FD6, 0x1FD6 }, { 0x1FD7, 0x1FD7, 0x1FD7 }, { 0x1FD8, 0x1FD8, 0x1FD0 }, { 0x1FD9, 0x1FD9, 0x1FD1 }, { 0x1FDA, 0x1FDA, 0x1F76 }, { 0x1FDB, 0x1FDB, 0x1F77 }, { 0x1FE0, 0x1FE8, 0x1FE0 }, { 0x1FE1, 0x1FE9, 0x1FE1 }, { 0x1FE2, 0x1FE2, 0x1FE2 }, { 0x1FE3, 0x1FE3, 0x1FE3 }, { 0x1FE4, 0x1FE4, 0x1FE4 }, { 0x1FE5, 0x1FEC, 0x1FE5 }, { 0x1FE6, 0x1FE6, 0x1FE6 }, { 0x1FE7, 0x1FE7, 0x1FE7 }, { 0x1FE8, 0x1FE8, 0x1FE0 }, { 0x1FE9, 0x1FE9, 0x1FE1 }, { 0x1FEA, 0x1FEA, 0x1F7A }, { 0x1FEB, 0x1FEB, 0x1F7B }, { 0x1FEC, 0x1FEC, 0x1FE5 }, { 0x1FF2, 0x1FF2, 0x1FF2 }, { 0x1FF3, 0x1FFC, 0x1FF3 }, { 0x1FF4, 0x1FF4, 0x1FF4 }, { 0x1FF6, 0x1FF6, 0x1FF6 }, { 0x1FF7, 0x1FF7, 0x1FF7 }, { 0x1FF8, 0x1FF8, 0x1F78 }, { 0x1FF9, 0x1FF9, 0x1F79 }, { 0x1FFA, 0x1FFA, 0x1F7C }, { 0x1FFB, 0x1FFB, 0x1F7D }, { 0x1FFC, 0x1FFC, 0x1FF3 }, { 0x2071, 0x2071, 0x2071 }, { 0x207F, 0x207F, 0x207F }, { 0x2090, 0x2090, 0x2090 }, { 0x2091, 0x2091, 0x2091 }, { 0x2092, 0x2092, 0x2092 }, { 0x2093, 0x2093, 0x2093 }, { 0x2094, 0x2094, 0x2094 }, { 0x20D0, 0x20D0, 0x20D0 }, { 0x20D1, 0x20D1, 0x20D1 }, { 0x20D2, 0x20D2, 0x20D2 }, { 0x20D3, 0x20D3, 0x20D3 }, { 0x20D4, 0x20D4, 0x20D4 }, { 0x20D5, 0x20D5, 0x20D5 }, { 0x20D6, 0x20D6, 0x20D6 }, { 0x20D7, 0x20D7, 0x20D7 }, { 0x20D8, 0x20D8, 0x20D8 }, { 0x20D9, 0x20D9, 0x20D9 }, { 0x20DA, 0x20DA, 0x20DA }, { 0x20DB, 0x20DB, 0x20DB }, { 0x20DC, 0x20DC, 0x20DC }, { 0x20E1, 0x20E1, 0x20E1 }, { 0x20E5, 0x20E5, 0x20E5 }, { 0x20E6, 0x20E6, 0x20E6 }, { 0x20E7, 0x20E7, 0x20E7 }, { 0x20E8, 0x20E8, 0x20E8 }, { 0x20E9, 0x20E9, 0x20E9 }, { 0x20EA, 0x20EA, 0x20EA }, { 0x20EB, 0x20EB, 0x20EB }, { 0x2102, 0x2102, 0x2102 }, { 0x2107, 0x2107, 0x2107 }, { 0x210A, 0x210A, 0x210A }, { 0x210B, 0x210B, 0x210B }, { 0x210C, 0x210C, 0x210C }, { 0x210D, 0x210D, 0x210D }, { 0x210E, 0x210E, 0x210E }, { 0x210F, 0x210F, 0x210F }, { 0x2110, 0x2110, 0x2110 }, { 0x2111, 0x2111, 0x2111 }, { 0x2112, 0x2112, 0x2112 }, { 0x2113, 0x2113, 0x2113 }, { 0x2115, 0x2115, 0x2115 }, { 0x2119, 0x2119, 0x2119 }, { 0x211A, 0x211A, 0x211A }, { 0x211B, 0x211B, 0x211B }, { 0x211C, 0x211C, 0x211C }, { 0x211D, 0x211D, 0x211D }, { 0x2124, 0x2124, 0x2124 }, { 0x2126, 0x2126, 0x03C9 }, { 0x2128, 0x2128, 0x2128 }, { 0x212A, 0x212A, 0x006B }, { 0x212B, 0x212B, 0x00E5 }, { 0x212C, 0x212C, 0x212C }, { 0x212D, 0x212D, 0x212D }, { 0x212F, 0x212F, 0x212F }, { 0x2130, 0x2130, 0x2130 }, { 0x2131, 0x2131, 0x2131 }, { 0x2133, 0x2133, 0x2133 }, { 0x2134, 0x2134, 0x2134 }, { 0x2135, 0x2135, 0x2135 }, { 0x2136, 0x2136, 0x2136 }, { 0x2137, 0x2137, 0x2137 }, { 0x2138, 0x2138, 0x2138 }, { 0x2139, 0x2139, 0x2139 }, { 0x213C, 0x213C, 0x213C }, { 0x213D, 0x213D, 0x213D }, { 0x213E, 0x213E, 0x213E }, { 0x213F, 0x213F, 0x213F }, { 0x2145, 0x2145, 0x2145 }, { 0x2146, 0x2146, 0x2146 }, { 0x2147, 0x2147, 0x2147 }, { 0x2148, 0x2148, 0x2148 }, { 0x2149, 0x2149, 0x2149 }, { 0x2C00, 0x2C00, 0x2C30 }, { 0x2C01, 0x2C01, 0x2C31 }, { 0x2C02, 0x2C02, 0x2C32 }, { 0x2C03, 0x2C03, 0x2C33 }, { 0x2C04, 0x2C04, 0x2C34 }, { 0x2C05, 0x2C05, 0x2C35 }, { 0x2C06, 0x2C06, 0x2C36 }, { 0x2C07, 0x2C07, 0x2C37 }, { 0x2C08, 0x2C08, 0x2C38 }, { 0x2C09, 0x2C09, 0x2C39 }, { 0x2C0A, 0x2C0A, 0x2C3A }, { 0x2C0B, 0x2C0B, 0x2C3B }, { 0x2C0C, 0x2C0C, 0x2C3C }, { 0x2C0D, 0x2C0D, 0x2C3D }, { 0x2C0E, 0x2C0E, 0x2C3E }, { 0x2C0F, 0x2C0F, 0x2C3F }, { 0x2C10, 0x2C10, 0x2C40 }, { 0x2C11, 0x2C11, 0x2C41 }, { 0x2C12, 0x2C12, 0x2C42 }, { 0x2C13, 0x2C13, 0x2C43 }, { 0x2C14, 0x2C14, 0x2C44 }, { 0x2C15, 0x2C15, 0x2C45 }, { 0x2C16, 0x2C16, 0x2C46 }, { 0x2C17, 0x2C17, 0x2C47 }, { 0x2C18, 0x2C18, 0x2C48 }, { 0x2C19, 0x2C19, 0x2C49 }, { 0x2C1A, 0x2C1A, 0x2C4A }, { 0x2C1B, 0x2C1B, 0x2C4B }, { 0x2C1C, 0x2C1C, 0x2C4C }, { 0x2C1D, 0x2C1D, 0x2C4D }, { 0x2C1E, 0x2C1E, 0x2C4E }, { 0x2C1F, 0x2C1F, 0x2C4F }, { 0x2C20, 0x2C20, 0x2C50 }, { 0x2C21, 0x2C21, 0x2C51 }, { 0x2C22, 0x2C22, 0x2C52 }, { 0x2C23, 0x2C23, 0x2C53 }, { 0x2C24, 0x2C24, 0x2C54 }, { 0x2C25, 0x2C25, 0x2C55 }, { 0x2C26, 0x2C26, 0x2C56 }, { 0x2C27, 0x2C27, 0x2C57 }, { 0x2C28, 0x2C28, 0x2C58 }, { 0x2C29, 0x2C29, 0x2C59 }, { 0x2C2A, 0x2C2A, 0x2C5A }, { 0x2C2B, 0x2C2B, 0x2C5B }, { 0x2C2C, 0x2C2C, 0x2C5C }, { 0x2C2D, 0x2C2D, 0x2C5D }, { 0x2C2E, 0x2C2E, 0x2C5E }, { 0x2C30, 0x2C00, 0x2C30 }, { 0x2C31, 0x2C01, 0x2C31 }, { 0x2C32, 0x2C02, 0x2C32 }, { 0x2C33, 0x2C03, 0x2C33 }, { 0x2C34, 0x2C04, 0x2C34 }, { 0x2C35, 0x2C05, 0x2C35 }, { 0x2C36, 0x2C06, 0x2C36 }, { 0x2C37, 0x2C07, 0x2C37 }, { 0x2C38, 0x2C08, 0x2C38 }, { 0x2C39, 0x2C09, 0x2C39 }, { 0x2C3A, 0x2C0A, 0x2C3A }, { 0x2C3B, 0x2C0B, 0x2C3B }, { 0x2C3C, 0x2C0C, 0x2C3C }, { 0x2C3D, 0x2C0D, 0x2C3D }, { 0x2C3E, 0x2C0E, 0x2C3E }, { 0x2C3F, 0x2C0F, 0x2C3F }, { 0x2C40, 0x2C10, 0x2C40 }, { 0x2C41, 0x2C11, 0x2C41 }, { 0x2C42, 0x2C12, 0x2C42 }, { 0x2C43, 0x2C13, 0x2C43 }, { 0x2C44, 0x2C14, 0x2C44 }, { 0x2C45, 0x2C15, 0x2C45 }, { 0x2C46, 0x2C16, 0x2C46 }, { 0x2C47, 0x2C17, 0x2C47 }, { 0x2C48, 0x2C18, 0x2C48 }, { 0x2C49, 0x2C19, 0x2C49 }, { 0x2C4A, 0x2C1A, 0x2C4A }, { 0x2C4B, 0x2C1B, 0x2C4B }, { 0x2C4C, 0x2C1C, 0x2C4C }, { 0x2C4D, 0x2C1D, 0x2C4D }, { 0x2C4E, 0x2C1E, 0x2C4E }, { 0x2C4F, 0x2C1F, 0x2C4F }, { 0x2C50, 0x2C20, 0x2C50 }, { 0x2C51, 0x2C21, 0x2C51 }, { 0x2C52, 0x2C22, 0x2C52 }, { 0x2C53, 0x2C23, 0x2C53 }, { 0x2C54, 0x2C24, 0x2C54 }, { 0x2C55, 0x2C25, 0x2C55 }, { 0x2C56, 0x2C26, 0x2C56 }, { 0x2C57, 0x2C27, 0x2C57 }, { 0x2C58, 0x2C28, 0x2C58 }, { 0x2C59, 0x2C29, 0x2C59 }, { 0x2C5A, 0x2C2A, 0x2C5A }, { 0x2C5B, 0x2C2B, 0x2C5B }, { 0x2C5C, 0x2C2C, 0x2C5C }, { 0x2C5D, 0x2C2D, 0x2C5D }, { 0x2C5E, 0x2C2E, 0x2C5E }, { 0x2C80, 0x2C80, 0x2C81 }, { 0x2C81, 0x2C80, 0x2C81 }, { 0x2C82, 0x2C82, 0x2C83 }, { 0x2C83, 0x2C82, 0x2C83 }, { 0x2C84, 0x2C84, 0x2C85 }, { 0x2C85, 0x2C84, 0x2C85 }, { 0x2C86, 0x2C86, 0x2C87 }, { 0x2C87, 0x2C86, 0x2C87 }, { 0x2C88, 0x2C88, 0x2C89 }, { 0x2C89, 0x2C88, 0x2C89 }, { 0x2C8A, 0x2C8A, 0x2C8B }, { 0x2C8B, 0x2C8A, 0x2C8B }, { 0x2C8C, 0x2C8C, 0x2C8D }, { 0x2C8D, 0x2C8C, 0x2C8D }, { 0x2C8E, 0x2C8E, 0x2C8F }, { 0x2C8F, 0x2C8E, 0x2C8F }, { 0x2C90, 0x2C90, 0x2C91 }, { 0x2C91, 0x2C90, 0x2C91 }, { 0x2C92, 0x2C92, 0x2C93 }, { 0x2C93, 0x2C92, 0x2C93 }, { 0x2C94, 0x2C94, 0x2C95 }, { 0x2C95, 0x2C94, 0x2C95 }, { 0x2C96, 0x2C96, 0x2C97 }, { 0x2C97, 0x2C96, 0x2C97 }, { 0x2C98, 0x2C98, 0x2C99 }, { 0x2C99, 0x2C98, 0x2C99 }, { 0x2C9A, 0x2C9A, 0x2C9B }, { 0x2C9B, 0x2C9A, 0x2C9B }, { 0x2C9C, 0x2C9C, 0x2C9D }, { 0x2C9D, 0x2C9C, 0x2C9D }, { 0x2C9E, 0x2C9E, 0x2C9F }, { 0x2C9F, 0x2C9E, 0x2C9F }, { 0x2CA0, 0x2CA0, 0x2CA1 }, { 0x2CA1, 0x2CA0, 0x2CA1 }, { 0x2CA2, 0x2CA2, 0x2CA3 }, { 0x2CA3, 0x2CA2, 0x2CA3 }, { 0x2CA4, 0x2CA4, 0x2CA5 }, { 0x2CA5, 0x2CA4, 0x2CA5 }, { 0x2CA6, 0x2CA6, 0x2CA7 }, { 0x2CA7, 0x2CA6, 0x2CA7 }, { 0x2CA8, 0x2CA8, 0x2CA9 }, { 0x2CA9, 0x2CA8, 0x2CA9 }, { 0x2CAA, 0x2CAA, 0x2CAB }, { 0x2CAB, 0x2CAA, 0x2CAB }, { 0x2CAC, 0x2CAC, 0x2CAD }, { 0x2CAD, 0x2CAC, 0x2CAD }, { 0x2CAE, 0x2CAE, 0x2CAF }, { 0x2CAF, 0x2CAE, 0x2CAF }, { 0x2CB0, 0x2CB0, 0x2CB1 }, { 0x2CB1, 0x2CB0, 0x2CB1 }, { 0x2CB2, 0x2CB2, 0x2CB3 }, { 0x2CB3, 0x2CB2, 0x2CB3 }, { 0x2CB4, 0x2CB4, 0x2CB5 }, { 0x2CB5, 0x2CB4, 0x2CB5 }, { 0x2CB6, 0x2CB6, 0x2CB7 }, { 0x2CB7, 0x2CB6, 0x2CB7 }, { 0x2CB8, 0x2CB8, 0x2CB9 }, { 0x2CB9, 0x2CB8, 0x2CB9 }, { 0x2CBA, 0x2CBA, 0x2CBB }, { 0x2CBB, 0x2CBA, 0x2CBB }, { 0x2CBC, 0x2CBC, 0x2CBD }, { 0x2CBD, 0x2CBC, 0x2CBD }, { 0x2CBE, 0x2CBE, 0x2CBF }, { 0x2CBF, 0x2CBE, 0x2CBF }, { 0x2CC0, 0x2CC0, 0x2CC1 }, { 0x2CC1, 0x2CC0, 0x2CC1 }, { 0x2CC2, 0x2CC2, 0x2CC3 }, { 0x2CC3, 0x2CC2, 0x2CC3 }, { 0x2CC4, 0x2CC4, 0x2CC5 }, { 0x2CC5, 0x2CC4, 0x2CC5 }, { 0x2CC6, 0x2CC6, 0x2CC7 }, { 0x2CC7, 0x2CC6, 0x2CC7 }, { 0x2CC8, 0x2CC8, 0x2CC9 }, { 0x2CC9, 0x2CC8, 0x2CC9 }, { 0x2CCA, 0x2CCA, 0x2CCB }, { 0x2CCB, 0x2CCA, 0x2CCB }, { 0x2CCC, 0x2CCC, 0x2CCD }, { 0x2CCD, 0x2CCC, 0x2CCD }, { 0x2CCE, 0x2CCE, 0x2CCF }, { 0x2CCF, 0x2CCE, 0x2CCF }, { 0x2CD0, 0x2CD0, 0x2CD1 }, { 0x2CD1, 0x2CD0, 0x2CD1 }, { 0x2CD2, 0x2CD2, 0x2CD3 }, { 0x2CD3, 0x2CD2, 0x2CD3 }, { 0x2CD4, 0x2CD4, 0x2CD5 }, { 0x2CD5, 0x2CD4, 0x2CD5 }, { 0x2CD6, 0x2CD6, 0x2CD7 }, { 0x2CD7, 0x2CD6, 0x2CD7 }, { 0x2CD8, 0x2CD8, 0x2CD9 }, { 0x2CD9, 0x2CD8, 0x2CD9 }, { 0x2CDA, 0x2CDA, 0x2CDB }, { 0x2CDB, 0x2CDA, 0x2CDB }, { 0x2CDC, 0x2CDC, 0x2CDD }, { 0x2CDD, 0x2CDC, 0x2CDD }, { 0x2CDE, 0x2CDE, 0x2CDF }, { 0x2CDF, 0x2CDE, 0x2CDF }, { 0x2CE0, 0x2CE0, 0x2CE1 }, { 0x2CE1, 0x2CE0, 0x2CE1 }, { 0x2CE2, 0x2CE2, 0x2CE3 }, { 0x2CE3, 0x2CE2, 0x2CE3 }, { 0x2CE4, 0x2CE4, 0x2CE4 }, { 0x2D00, 0x10A0, 0x2D00 }, { 0x2D01, 0x10A1, 0x2D01 }, { 0x2D02, 0x10A2, 0x2D02 }, { 0x2D03, 0x10A3, 0x2D03 }, { 0x2D04, 0x10A4, 0x2D04 }, { 0x2D05, 0x10A5, 0x2D05 }, { 0x2D06, 0x10A6, 0x2D06 }, { 0x2D07, 0x10A7, 0x2D07 }, { 0x2D08, 0x10A8, 0x2D08 }, { 0x2D09, 0x10A9, 0x2D09 }, { 0x2D0A, 0x10AA, 0x2D0A }, { 0x2D0B, 0x10AB, 0x2D0B }, { 0x2D0C, 0x10AC, 0x2D0C }, { 0x2D0D, 0x10AD, 0x2D0D }, { 0x2D0E, 0x10AE, 0x2D0E }, { 0x2D0F, 0x10AF, 0x2D0F }, { 0x2D10, 0x10B0, 0x2D10 }, { 0x2D11, 0x10B1, 0x2D11 }, { 0x2D12, 0x10B2, 0x2D12 }, { 0x2D13, 0x10B3, 0x2D13 }, { 0x2D14, 0x10B4, 0x2D14 }, { 0x2D15, 0x10B5, 0x2D15 }, { 0x2D16, 0x10B6, 0x2D16 }, { 0x2D17, 0x10B7, 0x2D17 }, { 0x2D18, 0x10B8, 0x2D18 }, { 0x2D19, 0x10B9, 0x2D19 }, { 0x2D1A, 0x10BA, 0x2D1A }, { 0x2D1B, 0x10BB, 0x2D1B }, { 0x2D1C, 0x10BC, 0x2D1C }, { 0x2D1D, 0x10BD, 0x2D1D }, { 0x2D1E, 0x10BE, 0x2D1E }, { 0x2D1F, 0x10BF, 0x2D1F }, { 0x2D20, 0x10C0, 0x2D20 }, { 0x2D21, 0x10C1, 0x2D21 }, { 0x2D22, 0x10C2, 0x2D22 }, { 0x2D23, 0x10C3, 0x2D23 }, { 0x2D24, 0x10C4, 0x2D24 }, { 0x2D25, 0x10C5, 0x2D25 }, { 0x2D30, 0x2D30, 0x2D30 }, { 0x2D31, 0x2D31, 0x2D31 }, { 0x2D32, 0x2D32, 0x2D32 }, { 0x2D33, 0x2D33, 0x2D33 }, { 0x2D34, 0x2D34, 0x2D34 }, { 0x2D35, 0x2D35, 0x2D35 }, { 0x2D36, 0x2D36, 0x2D36 }, { 0x2D37, 0x2D37, 0x2D37 }, { 0x2D38, 0x2D38, 0x2D38 }, { 0x2D39, 0x2D39, 0x2D39 }, { 0x2D3A, 0x2D3A, 0x2D3A }, { 0x2D3B, 0x2D3B, 0x2D3B }, { 0x2D3C, 0x2D3C, 0x2D3C }, { 0x2D3D, 0x2D3D, 0x2D3D }, { 0x2D3E, 0x2D3E, 0x2D3E }, { 0x2D3F, 0x2D3F, 0x2D3F }, { 0x2D40, 0x2D40, 0x2D40 }, { 0x2D41, 0x2D41, 0x2D41 }, { 0x2D42, 0x2D42, 0x2D42 }, { 0x2D43, 0x2D43, 0x2D43 }, { 0x2D44, 0x2D44, 0x2D44 }, { 0x2D45, 0x2D45, 0x2D45 }, { 0x2D46, 0x2D46, 0x2D46 }, { 0x2D47, 0x2D47, 0x2D47 }, { 0x2D48, 0x2D48, 0x2D48 }, { 0x2D49, 0x2D49, 0x2D49 }, { 0x2D4A, 0x2D4A, 0x2D4A }, { 0x2D4B, 0x2D4B, 0x2D4B }, { 0x2D4C, 0x2D4C, 0x2D4C }, { 0x2D4D, 0x2D4D, 0x2D4D }, { 0x2D4E, 0x2D4E, 0x2D4E }, { 0x2D4F, 0x2D4F, 0x2D4F }, { 0x2D50, 0x2D50, 0x2D50 }, { 0x2D51, 0x2D51, 0x2D51 }, { 0x2D52, 0x2D52, 0x2D52 }, { 0x2D53, 0x2D53, 0x2D53 }, { 0x2D54, 0x2D54, 0x2D54 }, { 0x2D55, 0x2D55, 0x2D55 }, { 0x2D56, 0x2D56, 0x2D56 }, { 0x2D57, 0x2D57, 0x2D57 }, { 0x2D58, 0x2D58, 0x2D58 }, { 0x2D59, 0x2D59, 0x2D59 }, { 0x2D5A, 0x2D5A, 0x2D5A }, { 0x2D5B, 0x2D5B, 0x2D5B }, { 0x2D5C, 0x2D5C, 0x2D5C }, { 0x2D5D, 0x2D5D, 0x2D5D }, { 0x2D5E, 0x2D5E, 0x2D5E }, { 0x2D5F, 0x2D5F, 0x2D5F }, { 0x2D60, 0x2D60, 0x2D60 }, { 0x2D61, 0x2D61, 0x2D61 }, { 0x2D62, 0x2D62, 0x2D62 }, { 0x2D63, 0x2D63, 0x2D63 }, { 0x2D64, 0x2D64, 0x2D64 }, { 0x2D65, 0x2D65, 0x2D65 }, { 0x2D6F, 0x2D6F, 0x2D6F }, { 0x2D80, 0x2D80, 0x2D80 }, { 0x2D81, 0x2D81, 0x2D81 }, { 0x2D82, 0x2D82, 0x2D82 }, { 0x2D83, 0x2D83, 0x2D83 }, { 0x2D84, 0x2D84, 0x2D84 }, { 0x2D85, 0x2D85, 0x2D85 }, { 0x2D86, 0x2D86, 0x2D86 }, { 0x2D87, 0x2D87, 0x2D87 }, { 0x2D88, 0x2D88, 0x2D88 }, { 0x2D89, 0x2D89, 0x2D89 }, { 0x2D8A, 0x2D8A, 0x2D8A }, { 0x2D8B, 0x2D8B, 0x2D8B }, { 0x2D8C, 0x2D8C, 0x2D8C }, { 0x2D8D, 0x2D8D, 0x2D8D }, { 0x2D8E, 0x2D8E, 0x2D8E }, { 0x2D8F, 0x2D8F, 0x2D8F }, { 0x2D90, 0x2D90, 0x2D90 }, { 0x2D91, 0x2D91, 0x2D91 }, { 0x2D92, 0x2D92, 0x2D92 }, { 0x2D93, 0x2D93, 0x2D93 }, { 0x2D94, 0x2D94, 0x2D94 }, { 0x2D95, 0x2D95, 0x2D95 }, { 0x2D96, 0x2D96, 0x2D96 }, { 0x2DA0, 0x2DA0, 0x2DA0 }, { 0x2DA1, 0x2DA1, 0x2DA1 }, { 0x2DA2, 0x2DA2, 0x2DA2 }, { 0x2DA3, 0x2DA3, 0x2DA3 }, { 0x2DA4, 0x2DA4, 0x2DA4 }, { 0x2DA5, 0x2DA5, 0x2DA5 }, { 0x2DA6, 0x2DA6, 0x2DA6 }, { 0x2DA8, 0x2DA8, 0x2DA8 }, { 0x2DA9, 0x2DA9, 0x2DA9 }, { 0x2DAA, 0x2DAA, 0x2DAA }, { 0x2DAB, 0x2DAB, 0x2DAB }, { 0x2DAC, 0x2DAC, 0x2DAC }, { 0x2DAD, 0x2DAD, 0x2DAD }, { 0x2DAE, 0x2DAE, 0x2DAE }, { 0x2DB0, 0x2DB0, 0x2DB0 }, { 0x2DB1, 0x2DB1, 0x2DB1 }, { 0x2DB2, 0x2DB2, 0x2DB2 }, { 0x2DB3, 0x2DB3, 0x2DB3 }, { 0x2DB4, 0x2DB4, 0x2DB4 }, { 0x2DB5, 0x2DB5, 0x2DB5 }, { 0x2DB6, 0x2DB6, 0x2DB6 }, { 0x2DB8, 0x2DB8, 0x2DB8 }, { 0x2DB9, 0x2DB9, 0x2DB9 }, { 0x2DBA, 0x2DBA, 0x2DBA }, { 0x2DBB, 0x2DBB, 0x2DBB }, { 0x2DBC, 0x2DBC, 0x2DBC }, { 0x2DBD, 0x2DBD, 0x2DBD }, { 0x2DBE, 0x2DBE, 0x2DBE }, { 0x2DC0, 0x2DC0, 0x2DC0 }, { 0x2DC1, 0x2DC1, 0x2DC1 }, { 0x2DC2, 0x2DC2, 0x2DC2 }, { 0x2DC3, 0x2DC3, 0x2DC3 }, { 0x2DC4, 0x2DC4, 0x2DC4 }, { 0x2DC5, 0x2DC5, 0x2DC5 }, { 0x2DC6, 0x2DC6, 0x2DC6 }, { 0x2DC8, 0x2DC8, 0x2DC8 }, { 0x2DC9, 0x2DC9, 0x2DC9 }, { 0x2DCA, 0x2DCA, 0x2DCA }, { 0x2DCB, 0x2DCB, 0x2DCB }, { 0x2DCC, 0x2DCC, 0x2DCC }, { 0x2DCD, 0x2DCD, 0x2DCD }, { 0x2DCE, 0x2DCE, 0x2DCE }, { 0x2DD0, 0x2DD0, 0x2DD0 }, { 0x2DD1, 0x2DD1, 0x2DD1 }, { 0x2DD2, 0x2DD2, 0x2DD2 }, { 0x2DD3, 0x2DD3, 0x2DD3 }, { 0x2DD4, 0x2DD4, 0x2DD4 }, { 0x2DD5, 0x2DD5, 0x2DD5 }, { 0x2DD6, 0x2DD6, 0x2DD6 }, { 0x2DD8, 0x2DD8, 0x2DD8 }, { 0x2DD9, 0x2DD9, 0x2DD9 }, { 0x2DDA, 0x2DDA, 0x2DDA }, { 0x2DDB, 0x2DDB, 0x2DDB }, { 0x2DDC, 0x2DDC, 0x2DDC }, { 0x2DDD, 0x2DDD, 0x2DDD }, { 0x2DDE, 0x2DDE, 0x2DDE }, { 0x3005, 0x3005, 0x3005 }, { 0x3006, 0x3006, 0x3006 }, { 0x302A, 0x302A, 0x302A }, { 0x302B, 0x302B, 0x302B }, { 0x302C, 0x302C, 0x302C }, { 0x302D, 0x302D, 0x302D }, { 0x302E, 0x302E, 0x302E }, { 0x302F, 0x302F, 0x302F }, { 0x3031, 0x3031, 0x3031 }, { 0x3032, 0x3032, 0x3032 }, { 0x3033, 0x3033, 0x3033 }, { 0x3034, 0x3034, 0x3034 }, { 0x3035, 0x3035, 0x3035 }, { 0x303B, 0x303B, 0x303B }, { 0x303C, 0x303C, 0x303C }, { 0x3041, 0x3041, 0x3041 }, { 0x3042, 0x3042, 0x3042 }, { 0x3043, 0x3043, 0x3043 }, { 0x3044, 0x3044, 0x3044 }, { 0x3045, 0x3045, 0x3045 }, { 0x3046, 0x3046, 0x3046 }, { 0x3047, 0x3047, 0x3047 }, { 0x3048, 0x3048, 0x3048 }, { 0x3049, 0x3049, 0x3049 }, { 0x304A, 0x304A, 0x304A }, { 0x304B, 0x304B, 0x304B }, { 0x304C, 0x304C, 0x304C }, { 0x304D, 0x304D, 0x304D }, { 0x304E, 0x304E, 0x304E }, { 0x304F, 0x304F, 0x304F }, { 0x3050, 0x3050, 0x3050 }, { 0x3051, 0x3051, 0x3051 }, { 0x3052, 0x3052, 0x3052 }, { 0x3053, 0x3053, 0x3053 }, { 0x3054, 0x3054, 0x3054 }, { 0x3055, 0x3055, 0x3055 }, { 0x3056, 0x3056, 0x3056 }, { 0x3057, 0x3057, 0x3057 }, { 0x3058, 0x3058, 0x3058 }, { 0x3059, 0x3059, 0x3059 }, { 0x305A, 0x305A, 0x305A }, { 0x305B, 0x305B, 0x305B }, { 0x305C, 0x305C, 0x305C }, { 0x305D, 0x305D, 0x305D }, { 0x305E, 0x305E, 0x305E }, { 0x305F, 0x305F, 0x305F }, { 0x3060, 0x3060, 0x3060 }, { 0x3061, 0x3061, 0x3061 }, { 0x3062, 0x3062, 0x3062 }, { 0x3063, 0x3063, 0x3063 }, { 0x3064, 0x3064, 0x3064 }, { 0x3065, 0x3065, 0x3065 }, { 0x3066, 0x3066, 0x3066 }, { 0x3067, 0x3067, 0x3067 }, { 0x3068, 0x3068, 0x3068 }, { 0x3069, 0x3069, 0x3069 }, { 0x306A, 0x306A, 0x306A }, { 0x306B, 0x306B, 0x306B }, { 0x306C, 0x306C, 0x306C }, { 0x306D, 0x306D, 0x306D }, { 0x306E, 0x306E, 0x306E }, { 0x306F, 0x306F, 0x306F }, { 0x3070, 0x3070, 0x3070 }, { 0x3071, 0x3071, 0x3071 }, { 0x3072, 0x3072, 0x3072 }, { 0x3073, 0x3073, 0x3073 }, { 0x3074, 0x3074, 0x3074 }, { 0x3075, 0x3075, 0x3075 }, { 0x3076, 0x3076, 0x3076 }, { 0x3077, 0x3077, 0x3077 }, { 0x3078, 0x3078, 0x3078 }, { 0x3079, 0x3079, 0x3079 }, { 0x307A, 0x307A, 0x307A }, { 0x307B, 0x307B, 0x307B }, { 0x307C, 0x307C, 0x307C }, { 0x307D, 0x307D, 0x307D }, { 0x307E, 0x307E, 0x307E }, { 0x307F, 0x307F, 0x307F }, { 0x3080, 0x3080, 0x3080 }, { 0x3081, 0x3081, 0x3081 }, { 0x3082, 0x3082, 0x3082 }, { 0x3083, 0x3083, 0x3083 }, { 0x3084, 0x3084, 0x3084 }, { 0x3085, 0x3085, 0x3085 }, { 0x3086, 0x3086, 0x3086 }, { 0x3087, 0x3087, 0x3087 }, { 0x3088, 0x3088, 0x3088 }, { 0x3089, 0x3089, 0x3089 }, { 0x308A, 0x308A, 0x308A }, { 0x308B, 0x308B, 0x308B }, { 0x308C, 0x308C, 0x308C }, { 0x308D, 0x308D, 0x308D }, { 0x308E, 0x308E, 0x308E }, { 0x308F, 0x308F, 0x308F }, { 0x3090, 0x3090, 0x3090 }, { 0x3091, 0x3091, 0x3091 }, { 0x3092, 0x3092, 0x3092 }, { 0x3093, 0x3093, 0x3093 }, { 0x3094, 0x3094, 0x3094 }, { 0x3095, 0x3095, 0x3095 }, { 0x3096, 0x3096, 0x3096 }, { 0x3099, 0x3099, 0x3099 }, { 0x309A, 0x309A, 0x309A }, { 0x309D, 0x309D, 0x309D }, { 0x309E, 0x309E, 0x309E }, { 0x309F, 0x309F, 0x309F }, { 0x30A1, 0x30A1, 0x30A1 }, { 0x30A2, 0x30A2, 0x30A2 }, { 0x30A3, 0x30A3, 0x30A3 }, { 0x30A4, 0x30A4, 0x30A4 }, { 0x30A5, 0x30A5, 0x30A5 }, { 0x30A6, 0x30A6, 0x30A6 }, { 0x30A7, 0x30A7, 0x30A7 }, { 0x30A8, 0x30A8, 0x30A8 }, { 0x30A9, 0x30A9, 0x30A9 }, { 0x30AA, 0x30AA, 0x30AA }, { 0x30AB, 0x30AB, 0x30AB }, { 0x30AC, 0x30AC, 0x30AC }, { 0x30AD, 0x30AD, 0x30AD }, { 0x30AE, 0x30AE, 0x30AE }, { 0x30AF, 0x30AF, 0x30AF }, { 0x30B0, 0x30B0, 0x30B0 }, { 0x30B1, 0x30B1, 0x30B1 }, { 0x30B2, 0x30B2, 0x30B2 }, { 0x30B3, 0x30B3, 0x30B3 }, { 0x30B4, 0x30B4, 0x30B4 }, { 0x30B5, 0x30B5, 0x30B5 }, { 0x30B6, 0x30B6, 0x30B6 }, { 0x30B7, 0x30B7, 0x30B7 }, { 0x30B8, 0x30B8, 0x30B8 }, { 0x30B9, 0x30B9, 0x30B9 }, { 0x30BA, 0x30BA, 0x30BA }, { 0x30BB, 0x30BB, 0x30BB }, { 0x30BC, 0x30BC, 0x30BC }, { 0x30BD, 0x30BD, 0x30BD }, { 0x30BE, 0x30BE, 0x30BE }, { 0x30BF, 0x30BF, 0x30BF }, { 0x30C0, 0x30C0, 0x30C0 }, { 0x30C1, 0x30C1, 0x30C1 }, { 0x30C2, 0x30C2, 0x30C2 }, { 0x30C3, 0x30C3, 0x30C3 }, { 0x30C4, 0x30C4, 0x30C4 }, { 0x30C5, 0x30C5, 0x30C5 }, { 0x30C6, 0x30C6, 0x30C6 }, { 0x30C7, 0x30C7, 0x30C7 }, { 0x30C8, 0x30C8, 0x30C8 }, { 0x30C9, 0x30C9, 0x30C9 }, { 0x30CA, 0x30CA, 0x30CA }, { 0x30CB, 0x30CB, 0x30CB }, { 0x30CC, 0x30CC, 0x30CC }, { 0x30CD, 0x30CD, 0x30CD }, { 0x30CE, 0x30CE, 0x30CE }, { 0x30CF, 0x30CF, 0x30CF }, { 0x30D0, 0x30D0, 0x30D0 }, { 0x30D1, 0x30D1, 0x30D1 }, { 0x30D2, 0x30D2, 0x30D2 }, { 0x30D3, 0x30D3, 0x30D3 }, { 0x30D4, 0x30D4, 0x30D4 }, { 0x30D5, 0x30D5, 0x30D5 }, { 0x30D6, 0x30D6, 0x30D6 }, { 0x30D7, 0x30D7, 0x30D7 }, { 0x30D8, 0x30D8, 0x30D8 }, { 0x30D9, 0x30D9, 0x30D9 }, { 0x30DA, 0x30DA, 0x30DA }, { 0x30DB, 0x30DB, 0x30DB }, { 0x30DC, 0x30DC, 0x30DC }, { 0x30DD, 0x30DD, 0x30DD }, { 0x30DE, 0x30DE, 0x30DE }, { 0x30DF, 0x30DF, 0x30DF }, { 0x30E0, 0x30E0, 0x30E0 }, { 0x30E1, 0x30E1, 0x30E1 }, { 0x30E2, 0x30E2, 0x30E2 }, { 0x30E3, 0x30E3, 0x30E3 }, { 0x30E4, 0x30E4, 0x30E4 }, { 0x30E5, 0x30E5, 0x30E5 }, { 0x30E6, 0x30E6, 0x30E6 }, { 0x30E7, 0x30E7, 0x30E7 }, { 0x30E8, 0x30E8, 0x30E8 }, { 0x30E9, 0x30E9, 0x30E9 }, { 0x30EA, 0x30EA, 0x30EA }, { 0x30EB, 0x30EB, 0x30EB }, { 0x30EC, 0x30EC, 0x30EC }, { 0x30ED, 0x30ED, 0x30ED }, { 0x30EE, 0x30EE, 0x30EE }, { 0x30EF, 0x30EF, 0x30EF }, { 0x30F0, 0x30F0, 0x30F0 }, { 0x30F1, 0x30F1, 0x30F1 }, { 0x30F2, 0x30F2, 0x30F2 }, { 0x30F3, 0x30F3, 0x30F3 }, { 0x30F4, 0x30F4, 0x30F4 }, { 0x30F5, 0x30F5, 0x30F5 }, { 0x30F6, 0x30F6, 0x30F6 }, { 0x30F7, 0x30F7, 0x30F7 }, { 0x30F8, 0x30F8, 0x30F8 }, { 0x30F9, 0x30F9, 0x30F9 }, { 0x30FA, 0x30FA, 0x30FA }, { 0x30FC, 0x30FC, 0x30FC }, { 0x30FD, 0x30FD, 0x30FD }, { 0x30FE, 0x30FE, 0x30FE }, { 0x30FF, 0x30FF, 0x30FF }, { 0x3105, 0x3105, 0x3105 }, { 0x3106, 0x3106, 0x3106 }, { 0x3107, 0x3107, 0x3107 }, { 0x3108, 0x3108, 0x3108 }, { 0x3109, 0x3109, 0x3109 }, { 0x310A, 0x310A, 0x310A }, { 0x310B, 0x310B, 0x310B }, { 0x310C, 0x310C, 0x310C }, { 0x310D, 0x310D, 0x310D }, { 0x310E, 0x310E, 0x310E }, { 0x310F, 0x310F, 0x310F }, { 0x3110, 0x3110, 0x3110 }, { 0x3111, 0x3111, 0x3111 }, { 0x3112, 0x3112, 0x3112 }, { 0x3113, 0x3113, 0x3113 }, { 0x3114, 0x3114, 0x3114 }, { 0x3115, 0x3115, 0x3115 }, { 0x3116, 0x3116, 0x3116 }, { 0x3117, 0x3117, 0x3117 }, { 0x3118, 0x3118, 0x3118 }, { 0x3119, 0x3119, 0x3119 }, { 0x311A, 0x311A, 0x311A }, { 0x311B, 0x311B, 0x311B }, { 0x311C, 0x311C, 0x311C }, { 0x311D, 0x311D, 0x311D }, { 0x311E, 0x311E, 0x311E }, { 0x311F, 0x311F, 0x311F }, { 0x3120, 0x3120, 0x3120 }, { 0x3121, 0x3121, 0x3121 }, { 0x3122, 0x3122, 0x3122 }, { 0x3123, 0x3123, 0x3123 }, { 0x3124, 0x3124, 0x3124 }, { 0x3125, 0x3125, 0x3125 }, { 0x3126, 0x3126, 0x3126 }, { 0x3127, 0x3127, 0x3127 }, { 0x3128, 0x3128, 0x3128 }, { 0x3129, 0x3129, 0x3129 }, { 0x312A, 0x312A, 0x312A }, { 0x312B, 0x312B, 0x312B }, { 0x312C, 0x312C, 0x312C }, { 0x3131, 0x3131, 0x3131 }, { 0x3132, 0x3132, 0x3132 }, { 0x3133, 0x3133, 0x3133 }, { 0x3134, 0x3134, 0x3134 }, { 0x3135, 0x3135, 0x3135 }, { 0x3136, 0x3136, 0x3136 }, { 0x3137, 0x3137, 0x3137 }, { 0x3138, 0x3138, 0x3138 }, { 0x3139, 0x3139, 0x3139 }, { 0x313A, 0x313A, 0x313A }, { 0x313B, 0x313B, 0x313B }, { 0x313C, 0x313C, 0x313C }, { 0x313D, 0x313D, 0x313D }, { 0x313E, 0x313E, 0x313E }, { 0x313F, 0x313F, 0x313F }, { 0x3140, 0x3140, 0x3140 }, { 0x3141, 0x3141, 0x3141 }, { 0x3142, 0x3142, 0x3142 }, { 0x3143, 0x3143, 0x3143 }, { 0x3144, 0x3144, 0x3144 }, { 0x3145, 0x3145, 0x3145 }, { 0x3146, 0x3146, 0x3146 }, { 0x3147, 0x3147, 0x3147 }, { 0x3148, 0x3148, 0x3148 }, { 0x3149, 0x3149, 0x3149 }, { 0x314A, 0x314A, 0x314A }, { 0x314B, 0x314B, 0x314B }, { 0x314C, 0x314C, 0x314C }, { 0x314D, 0x314D, 0x314D }, { 0x314E, 0x314E, 0x314E }, { 0x314F, 0x314F, 0x314F }, { 0x3150, 0x3150, 0x3150 }, { 0x3151, 0x3151, 0x3151 }, { 0x3152, 0x3152, 0x3152 }, { 0x3153, 0x3153, 0x3153 }, { 0x3154, 0x3154, 0x3154 }, { 0x3155, 0x3155, 0x3155 }, { 0x3156, 0x3156, 0x3156 }, { 0x3157, 0x3157, 0x3157 }, { 0x3158, 0x3158, 0x3158 }, { 0x3159, 0x3159, 0x3159 }, { 0x315A, 0x315A, 0x315A }, { 0x315B, 0x315B, 0x315B }, { 0x315C, 0x315C, 0x315C }, { 0x315D, 0x315D, 0x315D }, { 0x315E, 0x315E, 0x315E }, { 0x315F, 0x315F, 0x315F }, { 0x3160, 0x3160, 0x3160 }, { 0x3161, 0x3161, 0x3161 }, { 0x3162, 0x3162, 0x3162 }, { 0x3163, 0x3163, 0x3163 }, { 0x3164, 0x3164, 0x3164 }, { 0x3165, 0x3165, 0x3165 }, { 0x3166, 0x3166, 0x3166 }, { 0x3167, 0x3167, 0x3167 }, { 0x3168, 0x3168, 0x3168 }, { 0x3169, 0x3169, 0x3169 }, { 0x316A, 0x316A, 0x316A }, { 0x316B, 0x316B, 0x316B }, { 0x316C, 0x316C, 0x316C }, { 0x316D, 0x316D, 0x316D }, { 0x316E, 0x316E, 0x316E }, { 0x316F, 0x316F, 0x316F }, { 0x3170, 0x3170, 0x3170 }, { 0x3171, 0x3171, 0x3171 }, { 0x3172, 0x3172, 0x3172 }, { 0x3173, 0x3173, 0x3173 }, { 0x3174, 0x3174, 0x3174 }, { 0x3175, 0x3175, 0x3175 }, { 0x3176, 0x3176, 0x3176 }, { 0x3177, 0x3177, 0x3177 }, { 0x3178, 0x3178, 0x3178 }, { 0x3179, 0x3179, 0x3179 }, { 0x317A, 0x317A, 0x317A }, { 0x317B, 0x317B, 0x317B }, { 0x317C, 0x317C, 0x317C }, { 0x317D, 0x317D, 0x317D }, { 0x317E, 0x317E, 0x317E }, { 0x317F, 0x317F, 0x317F }, { 0x3180, 0x3180, 0x3180 }, { 0x3181, 0x3181, 0x3181 }, { 0x3182, 0x3182, 0x3182 }, { 0x3183, 0x3183, 0x3183 }, { 0x3184, 0x3184, 0x3184 }, { 0x3185, 0x3185, 0x3185 }, { 0x3186, 0x3186, 0x3186 }, { 0x3187, 0x3187, 0x3187 }, { 0x3188, 0x3188, 0x3188 }, { 0x3189, 0x3189, 0x3189 }, { 0x318A, 0x318A, 0x318A }, { 0x318B, 0x318B, 0x318B }, { 0x318C, 0x318C, 0x318C }, { 0x318D, 0x318D, 0x318D }, { 0x318E, 0x318E, 0x318E }, { 0x31A0, 0x31A0, 0x31A0 }, { 0x31A1, 0x31A1, 0x31A1 }, { 0x31A2, 0x31A2, 0x31A2 }, { 0x31A3, 0x31A3, 0x31A3 }, { 0x31A4, 0x31A4, 0x31A4 }, { 0x31A5, 0x31A5, 0x31A5 }, { 0x31A6, 0x31A6, 0x31A6 }, { 0x31A7, 0x31A7, 0x31A7 }, { 0x31A8, 0x31A8, 0x31A8 }, { 0x31A9, 0x31A9, 0x31A9 }, { 0x31AA, 0x31AA, 0x31AA }, { 0x31AB, 0x31AB, 0x31AB }, { 0x31AC, 0x31AC, 0x31AC }, { 0x31AD, 0x31AD, 0x31AD }, { 0x31AE, 0x31AE, 0x31AE }, { 0x31AF, 0x31AF, 0x31AF }, { 0x31B0, 0x31B0, 0x31B0 }, { 0x31B1, 0x31B1, 0x31B1 }, { 0x31B2, 0x31B2, 0x31B2 }, { 0x31B3, 0x31B3, 0x31B3 }, { 0x31B4, 0x31B4, 0x31B4 }, { 0x31B5, 0x31B5, 0x31B5 }, { 0x31B6, 0x31B6, 0x31B6 }, { 0x31B7, 0x31B7, 0x31B7 }, { 0x31F0, 0x31F0, 0x31F0 }, { 0x31F1, 0x31F1, 0x31F1 }, { 0x31F2, 0x31F2, 0x31F2 }, { 0x31F3, 0x31F3, 0x31F3 }, { 0x31F4, 0x31F4, 0x31F4 }, { 0x31F5, 0x31F5, 0x31F5 }, { 0x31F6, 0x31F6, 0x31F6 }, { 0x31F7, 0x31F7, 0x31F7 }, { 0x31F8, 0x31F8, 0x31F8 }, { 0x31F9, 0x31F9, 0x31F9 }, { 0x31FA, 0x31FA, 0x31FA }, { 0x31FB, 0x31FB, 0x31FB }, { 0x31FC, 0x31FC, 0x31FC }, { 0x31FD, 0x31FD, 0x31FD }, { 0x31FE, 0x31FE, 0x31FE }, { 0x31FF, 0x31FF, 0x31FF }, { 0x3400, 0x3400, 0x3400 }, { 0x4DB5, 0x4DB5, 0x4DB5 }, { 0x4E00, 0x4E00, 0x4E00 }, { 0x9FBB, 0x9FBB, 0x9FBB }, { 0xA000, 0xA000, 0xA000 }, { 0xA001, 0xA001, 0xA001 }, { 0xA002, 0xA002, 0xA002 }, { 0xA003, 0xA003, 0xA003 }, { 0xA004, 0xA004, 0xA004 }, { 0xA005, 0xA005, 0xA005 }, { 0xA006, 0xA006, 0xA006 }, { 0xA007, 0xA007, 0xA007 }, { 0xA008, 0xA008, 0xA008 }, { 0xA009, 0xA009, 0xA009 }, { 0xA00A, 0xA00A, 0xA00A }, { 0xA00B, 0xA00B, 0xA00B }, { 0xA00C, 0xA00C, 0xA00C }, { 0xA00D, 0xA00D, 0xA00D }, { 0xA00E, 0xA00E, 0xA00E }, { 0xA00F, 0xA00F, 0xA00F }, { 0xA010, 0xA010, 0xA010 }, { 0xA011, 0xA011, 0xA011 }, { 0xA012, 0xA012, 0xA012 }, { 0xA013, 0xA013, 0xA013 }, { 0xA014, 0xA014, 0xA014 }, { 0xA015, 0xA015, 0xA015 }, { 0xA016, 0xA016, 0xA016 }, { 0xA017, 0xA017, 0xA017 }, { 0xA018, 0xA018, 0xA018 }, { 0xA019, 0xA019, 0xA019 }, { 0xA01A, 0xA01A, 0xA01A }, { 0xA01B, 0xA01B, 0xA01B }, { 0xA01C, 0xA01C, 0xA01C }, { 0xA01D, 0xA01D, 0xA01D }, { 0xA01E, 0xA01E, 0xA01E }, { 0xA01F, 0xA01F, 0xA01F }, { 0xA020, 0xA020, 0xA020 }, { 0xA021, 0xA021, 0xA021 }, { 0xA022, 0xA022, 0xA022 }, { 0xA023, 0xA023, 0xA023 }, { 0xA024, 0xA024, 0xA024 }, { 0xA025, 0xA025, 0xA025 }, { 0xA026, 0xA026, 0xA026 }, { 0xA027, 0xA027, 0xA027 }, { 0xA028, 0xA028, 0xA028 }, { 0xA029, 0xA029, 0xA029 }, { 0xA02A, 0xA02A, 0xA02A }, { 0xA02B, 0xA02B, 0xA02B }, { 0xA02C, 0xA02C, 0xA02C }, { 0xA02D, 0xA02D, 0xA02D }, { 0xA02E, 0xA02E, 0xA02E }, { 0xA02F, 0xA02F, 0xA02F }, { 0xA030, 0xA030, 0xA030 }, { 0xA031, 0xA031, 0xA031 }, { 0xA032, 0xA032, 0xA032 }, { 0xA033, 0xA033, 0xA033 }, { 0xA034, 0xA034, 0xA034 }, { 0xA035, 0xA035, 0xA035 }, { 0xA036, 0xA036, 0xA036 }, { 0xA037, 0xA037, 0xA037 }, { 0xA038, 0xA038, 0xA038 }, { 0xA039, 0xA039, 0xA039 }, { 0xA03A, 0xA03A, 0xA03A }, { 0xA03B, 0xA03B, 0xA03B }, { 0xA03C, 0xA03C, 0xA03C }, { 0xA03D, 0xA03D, 0xA03D }, { 0xA03E, 0xA03E, 0xA03E }, { 0xA03F, 0xA03F, 0xA03F }, { 0xA040, 0xA040, 0xA040 }, { 0xA041, 0xA041, 0xA041 }, { 0xA042, 0xA042, 0xA042 }, { 0xA043, 0xA043, 0xA043 }, { 0xA044, 0xA044, 0xA044 }, { 0xA045, 0xA045, 0xA045 }, { 0xA046, 0xA046, 0xA046 }, { 0xA047, 0xA047, 0xA047 }, { 0xA048, 0xA048, 0xA048 }, { 0xA049, 0xA049, 0xA049 }, { 0xA04A, 0xA04A, 0xA04A }, { 0xA04B, 0xA04B, 0xA04B }, { 0xA04C, 0xA04C, 0xA04C }, { 0xA04D, 0xA04D, 0xA04D }, { 0xA04E, 0xA04E, 0xA04E }, { 0xA04F, 0xA04F, 0xA04F }, { 0xA050, 0xA050, 0xA050 }, { 0xA051, 0xA051, 0xA051 }, { 0xA052, 0xA052, 0xA052 }, { 0xA053, 0xA053, 0xA053 }, { 0xA054, 0xA054, 0xA054 }, { 0xA055, 0xA055, 0xA055 }, { 0xA056, 0xA056, 0xA056 }, { 0xA057, 0xA057, 0xA057 }, { 0xA058, 0xA058, 0xA058 }, { 0xA059, 0xA059, 0xA059 }, { 0xA05A, 0xA05A, 0xA05A }, { 0xA05B, 0xA05B, 0xA05B }, { 0xA05C, 0xA05C, 0xA05C }, { 0xA05D, 0xA05D, 0xA05D }, { 0xA05E, 0xA05E, 0xA05E }, { 0xA05F, 0xA05F, 0xA05F }, { 0xA060, 0xA060, 0xA060 }, { 0xA061, 0xA061, 0xA061 }, { 0xA062, 0xA062, 0xA062 }, { 0xA063, 0xA063, 0xA063 }, { 0xA064, 0xA064, 0xA064 }, { 0xA065, 0xA065, 0xA065 }, { 0xA066, 0xA066, 0xA066 }, { 0xA067, 0xA067, 0xA067 }, { 0xA068, 0xA068, 0xA068 }, { 0xA069, 0xA069, 0xA069 }, { 0xA06A, 0xA06A, 0xA06A }, { 0xA06B, 0xA06B, 0xA06B }, { 0xA06C, 0xA06C, 0xA06C }, { 0xA06D, 0xA06D, 0xA06D }, { 0xA06E, 0xA06E, 0xA06E }, { 0xA06F, 0xA06F, 0xA06F }, { 0xA070, 0xA070, 0xA070 }, { 0xA071, 0xA071, 0xA071 }, { 0xA072, 0xA072, 0xA072 }, { 0xA073, 0xA073, 0xA073 }, { 0xA074, 0xA074, 0xA074 }, { 0xA075, 0xA075, 0xA075 }, { 0xA076, 0xA076, 0xA076 }, { 0xA077, 0xA077, 0xA077 }, { 0xA078, 0xA078, 0xA078 }, { 0xA079, 0xA079, 0xA079 }, { 0xA07A, 0xA07A, 0xA07A }, { 0xA07B, 0xA07B, 0xA07B }, { 0xA07C, 0xA07C, 0xA07C }, { 0xA07D, 0xA07D, 0xA07D }, { 0xA07E, 0xA07E, 0xA07E }, { 0xA07F, 0xA07F, 0xA07F }, { 0xA080, 0xA080, 0xA080 }, { 0xA081, 0xA081, 0xA081 }, { 0xA082, 0xA082, 0xA082 }, { 0xA083, 0xA083, 0xA083 }, { 0xA084, 0xA084, 0xA084 }, { 0xA085, 0xA085, 0xA085 }, { 0xA086, 0xA086, 0xA086 }, { 0xA087, 0xA087, 0xA087 }, { 0xA088, 0xA088, 0xA088 }, { 0xA089, 0xA089, 0xA089 }, { 0xA08A, 0xA08A, 0xA08A }, { 0xA08B, 0xA08B, 0xA08B }, { 0xA08C, 0xA08C, 0xA08C }, { 0xA08D, 0xA08D, 0xA08D }, { 0xA08E, 0xA08E, 0xA08E }, { 0xA08F, 0xA08F, 0xA08F }, { 0xA090, 0xA090, 0xA090 }, { 0xA091, 0xA091, 0xA091 }, { 0xA092, 0xA092, 0xA092 }, { 0xA093, 0xA093, 0xA093 }, { 0xA094, 0xA094, 0xA094 }, { 0xA095, 0xA095, 0xA095 }, { 0xA096, 0xA096, 0xA096 }, { 0xA097, 0xA097, 0xA097 }, { 0xA098, 0xA098, 0xA098 }, { 0xA099, 0xA099, 0xA099 }, { 0xA09A, 0xA09A, 0xA09A }, { 0xA09B, 0xA09B, 0xA09B }, { 0xA09C, 0xA09C, 0xA09C }, { 0xA09D, 0xA09D, 0xA09D }, { 0xA09E, 0xA09E, 0xA09E }, { 0xA09F, 0xA09F, 0xA09F }, { 0xA0A0, 0xA0A0, 0xA0A0 }, { 0xA0A1, 0xA0A1, 0xA0A1 }, { 0xA0A2, 0xA0A2, 0xA0A2 }, { 0xA0A3, 0xA0A3, 0xA0A3 }, { 0xA0A4, 0xA0A4, 0xA0A4 }, { 0xA0A5, 0xA0A5, 0xA0A5 }, { 0xA0A6, 0xA0A6, 0xA0A6 }, { 0xA0A7, 0xA0A7, 0xA0A7 }, { 0xA0A8, 0xA0A8, 0xA0A8 }, { 0xA0A9, 0xA0A9, 0xA0A9 }, { 0xA0AA, 0xA0AA, 0xA0AA }, { 0xA0AB, 0xA0AB, 0xA0AB }, { 0xA0AC, 0xA0AC, 0xA0AC }, { 0xA0AD, 0xA0AD, 0xA0AD }, { 0xA0AE, 0xA0AE, 0xA0AE }, { 0xA0AF, 0xA0AF, 0xA0AF }, { 0xA0B0, 0xA0B0, 0xA0B0 }, { 0xA0B1, 0xA0B1, 0xA0B1 }, { 0xA0B2, 0xA0B2, 0xA0B2 }, { 0xA0B3, 0xA0B3, 0xA0B3 }, { 0xA0B4, 0xA0B4, 0xA0B4 }, { 0xA0B5, 0xA0B5, 0xA0B5 }, { 0xA0B6, 0xA0B6, 0xA0B6 }, { 0xA0B7, 0xA0B7, 0xA0B7 }, { 0xA0B8, 0xA0B8, 0xA0B8 }, { 0xA0B9, 0xA0B9, 0xA0B9 }, { 0xA0BA, 0xA0BA, 0xA0BA }, { 0xA0BB, 0xA0BB, 0xA0BB }, { 0xA0BC, 0xA0BC, 0xA0BC }, { 0xA0BD, 0xA0BD, 0xA0BD }, { 0xA0BE, 0xA0BE, 0xA0BE }, { 0xA0BF, 0xA0BF, 0xA0BF }, { 0xA0C0, 0xA0C0, 0xA0C0 }, { 0xA0C1, 0xA0C1, 0xA0C1 }, { 0xA0C2, 0xA0C2, 0xA0C2 }, { 0xA0C3, 0xA0C3, 0xA0C3 }, { 0xA0C4, 0xA0C4, 0xA0C4 }, { 0xA0C5, 0xA0C5, 0xA0C5 }, { 0xA0C6, 0xA0C6, 0xA0C6 }, { 0xA0C7, 0xA0C7, 0xA0C7 }, { 0xA0C8, 0xA0C8, 0xA0C8 }, { 0xA0C9, 0xA0C9, 0xA0C9 }, { 0xA0CA, 0xA0CA, 0xA0CA }, { 0xA0CB, 0xA0CB, 0xA0CB }, { 0xA0CC, 0xA0CC, 0xA0CC }, { 0xA0CD, 0xA0CD, 0xA0CD }, { 0xA0CE, 0xA0CE, 0xA0CE }, { 0xA0CF, 0xA0CF, 0xA0CF }, { 0xA0D0, 0xA0D0, 0xA0D0 }, { 0xA0D1, 0xA0D1, 0xA0D1 }, { 0xA0D2, 0xA0D2, 0xA0D2 }, { 0xA0D3, 0xA0D3, 0xA0D3 }, { 0xA0D4, 0xA0D4, 0xA0D4 }, { 0xA0D5, 0xA0D5, 0xA0D5 }, { 0xA0D6, 0xA0D6, 0xA0D6 }, { 0xA0D7, 0xA0D7, 0xA0D7 }, { 0xA0D8, 0xA0D8, 0xA0D8 }, { 0xA0D9, 0xA0D9, 0xA0D9 }, { 0xA0DA, 0xA0DA, 0xA0DA }, { 0xA0DB, 0xA0DB, 0xA0DB }, { 0xA0DC, 0xA0DC, 0xA0DC }, { 0xA0DD, 0xA0DD, 0xA0DD }, { 0xA0DE, 0xA0DE, 0xA0DE }, { 0xA0DF, 0xA0DF, 0xA0DF }, { 0xA0E0, 0xA0E0, 0xA0E0 }, { 0xA0E1, 0xA0E1, 0xA0E1 }, { 0xA0E2, 0xA0E2, 0xA0E2 }, { 0xA0E3, 0xA0E3, 0xA0E3 }, { 0xA0E4, 0xA0E4, 0xA0E4 }, { 0xA0E5, 0xA0E5, 0xA0E5 }, { 0xA0E6, 0xA0E6, 0xA0E6 }, { 0xA0E7, 0xA0E7, 0xA0E7 }, { 0xA0E8, 0xA0E8, 0xA0E8 }, { 0xA0E9, 0xA0E9, 0xA0E9 }, { 0xA0EA, 0xA0EA, 0xA0EA }, { 0xA0EB, 0xA0EB, 0xA0EB }, { 0xA0EC, 0xA0EC, 0xA0EC }, { 0xA0ED, 0xA0ED, 0xA0ED }, { 0xA0EE, 0xA0EE, 0xA0EE }, { 0xA0EF, 0xA0EF, 0xA0EF }, { 0xA0F0, 0xA0F0, 0xA0F0 }, { 0xA0F1, 0xA0F1, 0xA0F1 }, { 0xA0F2, 0xA0F2, 0xA0F2 }, { 0xA0F3, 0xA0F3, 0xA0F3 }, { 0xA0F4, 0xA0F4, 0xA0F4 }, { 0xA0F5, 0xA0F5, 0xA0F5 }, { 0xA0F6, 0xA0F6, 0xA0F6 }, { 0xA0F7, 0xA0F7, 0xA0F7 }, { 0xA0F8, 0xA0F8, 0xA0F8 }, { 0xA0F9, 0xA0F9, 0xA0F9 }, { 0xA0FA, 0xA0FA, 0xA0FA }, { 0xA0FB, 0xA0FB, 0xA0FB }, { 0xA0FC, 0xA0FC, 0xA0FC }, { 0xA0FD, 0xA0FD, 0xA0FD }, { 0xA0FE, 0xA0FE, 0xA0FE }, { 0xA0FF, 0xA0FF, 0xA0FF }, { 0xA100, 0xA100, 0xA100 }, { 0xA101, 0xA101, 0xA101 }, { 0xA102, 0xA102, 0xA102 }, { 0xA103, 0xA103, 0xA103 }, { 0xA104, 0xA104, 0xA104 }, { 0xA105, 0xA105, 0xA105 }, { 0xA106, 0xA106, 0xA106 }, { 0xA107, 0xA107, 0xA107 }, { 0xA108, 0xA108, 0xA108 }, { 0xA109, 0xA109, 0xA109 }, { 0xA10A, 0xA10A, 0xA10A }, { 0xA10B, 0xA10B, 0xA10B }, { 0xA10C, 0xA10C, 0xA10C }, { 0xA10D, 0xA10D, 0xA10D }, { 0xA10E, 0xA10E, 0xA10E }, { 0xA10F, 0xA10F, 0xA10F }, { 0xA110, 0xA110, 0xA110 }, { 0xA111, 0xA111, 0xA111 }, { 0xA112, 0xA112, 0xA112 }, { 0xA113, 0xA113, 0xA113 }, { 0xA114, 0xA114, 0xA114 }, { 0xA115, 0xA115, 0xA115 }, { 0xA116, 0xA116, 0xA116 }, { 0xA117, 0xA117, 0xA117 }, { 0xA118, 0xA118, 0xA118 }, { 0xA119, 0xA119, 0xA119 }, { 0xA11A, 0xA11A, 0xA11A }, { 0xA11B, 0xA11B, 0xA11B }, { 0xA11C, 0xA11C, 0xA11C }, { 0xA11D, 0xA11D, 0xA11D }, { 0xA11E, 0xA11E, 0xA11E }, { 0xA11F, 0xA11F, 0xA11F }, { 0xA120, 0xA120, 0xA120 }, { 0xA121, 0xA121, 0xA121 }, { 0xA122, 0xA122, 0xA122 }, { 0xA123, 0xA123, 0xA123 }, { 0xA124, 0xA124, 0xA124 }, { 0xA125, 0xA125, 0xA125 }, { 0xA126, 0xA126, 0xA126 }, { 0xA127, 0xA127, 0xA127 }, { 0xA128, 0xA128, 0xA128 }, { 0xA129, 0xA129, 0xA129 }, { 0xA12A, 0xA12A, 0xA12A }, { 0xA12B, 0xA12B, 0xA12B }, { 0xA12C, 0xA12C, 0xA12C }, { 0xA12D, 0xA12D, 0xA12D }, { 0xA12E, 0xA12E, 0xA12E }, { 0xA12F, 0xA12F, 0xA12F }, { 0xA130, 0xA130, 0xA130 }, { 0xA131, 0xA131, 0xA131 }, { 0xA132, 0xA132, 0xA132 }, { 0xA133, 0xA133, 0xA133 }, { 0xA134, 0xA134, 0xA134 }, { 0xA135, 0xA135, 0xA135 }, { 0xA136, 0xA136, 0xA136 }, { 0xA137, 0xA137, 0xA137 }, { 0xA138, 0xA138, 0xA138 }, { 0xA139, 0xA139, 0xA139 }, { 0xA13A, 0xA13A, 0xA13A }, { 0xA13B, 0xA13B, 0xA13B }, { 0xA13C, 0xA13C, 0xA13C }, { 0xA13D, 0xA13D, 0xA13D }, { 0xA13E, 0xA13E, 0xA13E }, { 0xA13F, 0xA13F, 0xA13F }, { 0xA140, 0xA140, 0xA140 }, { 0xA141, 0xA141, 0xA141 }, { 0xA142, 0xA142, 0xA142 }, { 0xA143, 0xA143, 0xA143 }, { 0xA144, 0xA144, 0xA144 }, { 0xA145, 0xA145, 0xA145 }, { 0xA146, 0xA146, 0xA146 }, { 0xA147, 0xA147, 0xA147 }, { 0xA148, 0xA148, 0xA148 }, { 0xA149, 0xA149, 0xA149 }, { 0xA14A, 0xA14A, 0xA14A }, { 0xA14B, 0xA14B, 0xA14B }, { 0xA14C, 0xA14C, 0xA14C }, { 0xA14D, 0xA14D, 0xA14D }, { 0xA14E, 0xA14E, 0xA14E }, { 0xA14F, 0xA14F, 0xA14F }, { 0xA150, 0xA150, 0xA150 }, { 0xA151, 0xA151, 0xA151 }, { 0xA152, 0xA152, 0xA152 }, { 0xA153, 0xA153, 0xA153 }, { 0xA154, 0xA154, 0xA154 }, { 0xA155, 0xA155, 0xA155 }, { 0xA156, 0xA156, 0xA156 }, { 0xA157, 0xA157, 0xA157 }, { 0xA158, 0xA158, 0xA158 }, { 0xA159, 0xA159, 0xA159 }, { 0xA15A, 0xA15A, 0xA15A }, { 0xA15B, 0xA15B, 0xA15B }, { 0xA15C, 0xA15C, 0xA15C }, { 0xA15D, 0xA15D, 0xA15D }, { 0xA15E, 0xA15E, 0xA15E }, { 0xA15F, 0xA15F, 0xA15F }, { 0xA160, 0xA160, 0xA160 }, { 0xA161, 0xA161, 0xA161 }, { 0xA162, 0xA162, 0xA162 }, { 0xA163, 0xA163, 0xA163 }, { 0xA164, 0xA164, 0xA164 }, { 0xA165, 0xA165, 0xA165 }, { 0xA166, 0xA166, 0xA166 }, { 0xA167, 0xA167, 0xA167 }, { 0xA168, 0xA168, 0xA168 }, { 0xA169, 0xA169, 0xA169 }, { 0xA16A, 0xA16A, 0xA16A }, { 0xA16B, 0xA16B, 0xA16B }, { 0xA16C, 0xA16C, 0xA16C }, { 0xA16D, 0xA16D, 0xA16D }, { 0xA16E, 0xA16E, 0xA16E }, { 0xA16F, 0xA16F, 0xA16F }, { 0xA170, 0xA170, 0xA170 }, { 0xA171, 0xA171, 0xA171 }, { 0xA172, 0xA172, 0xA172 }, { 0xA173, 0xA173, 0xA173 }, { 0xA174, 0xA174, 0xA174 }, { 0xA175, 0xA175, 0xA175 }, { 0xA176, 0xA176, 0xA176 }, { 0xA177, 0xA177, 0xA177 }, { 0xA178, 0xA178, 0xA178 }, { 0xA179, 0xA179, 0xA179 }, { 0xA17A, 0xA17A, 0xA17A }, { 0xA17B, 0xA17B, 0xA17B }, { 0xA17C, 0xA17C, 0xA17C }, { 0xA17D, 0xA17D, 0xA17D }, { 0xA17E, 0xA17E, 0xA17E }, { 0xA17F, 0xA17F, 0xA17F }, { 0xA180, 0xA180, 0xA180 }, { 0xA181, 0xA181, 0xA181 }, { 0xA182, 0xA182, 0xA182 }, { 0xA183, 0xA183, 0xA183 }, { 0xA184, 0xA184, 0xA184 }, { 0xA185, 0xA185, 0xA185 }, { 0xA186, 0xA186, 0xA186 }, { 0xA187, 0xA187, 0xA187 }, { 0xA188, 0xA188, 0xA188 }, { 0xA189, 0xA189, 0xA189 }, { 0xA18A, 0xA18A, 0xA18A }, { 0xA18B, 0xA18B, 0xA18B }, { 0xA18C, 0xA18C, 0xA18C }, { 0xA18D, 0xA18D, 0xA18D }, { 0xA18E, 0xA18E, 0xA18E }, { 0xA18F, 0xA18F, 0xA18F }, { 0xA190, 0xA190, 0xA190 }, { 0xA191, 0xA191, 0xA191 }, { 0xA192, 0xA192, 0xA192 }, { 0xA193, 0xA193, 0xA193 }, { 0xA194, 0xA194, 0xA194 }, { 0xA195, 0xA195, 0xA195 }, { 0xA196, 0xA196, 0xA196 }, { 0xA197, 0xA197, 0xA197 }, { 0xA198, 0xA198, 0xA198 }, { 0xA199, 0xA199, 0xA199 }, { 0xA19A, 0xA19A, 0xA19A }, { 0xA19B, 0xA19B, 0xA19B }, { 0xA19C, 0xA19C, 0xA19C }, { 0xA19D, 0xA19D, 0xA19D }, { 0xA19E, 0xA19E, 0xA19E }, { 0xA19F, 0xA19F, 0xA19F }, { 0xA1A0, 0xA1A0, 0xA1A0 }, { 0xA1A1, 0xA1A1, 0xA1A1 }, { 0xA1A2, 0xA1A2, 0xA1A2 }, { 0xA1A3, 0xA1A3, 0xA1A3 }, { 0xA1A4, 0xA1A4, 0xA1A4 }, { 0xA1A5, 0xA1A5, 0xA1A5 }, { 0xA1A6, 0xA1A6, 0xA1A6 }, { 0xA1A7, 0xA1A7, 0xA1A7 }, { 0xA1A8, 0xA1A8, 0xA1A8 }, { 0xA1A9, 0xA1A9, 0xA1A9 }, { 0xA1AA, 0xA1AA, 0xA1AA }, { 0xA1AB, 0xA1AB, 0xA1AB }, { 0xA1AC, 0xA1AC, 0xA1AC }, { 0xA1AD, 0xA1AD, 0xA1AD }, { 0xA1AE, 0xA1AE, 0xA1AE }, { 0xA1AF, 0xA1AF, 0xA1AF }, { 0xA1B0, 0xA1B0, 0xA1B0 }, { 0xA1B1, 0xA1B1, 0xA1B1 }, { 0xA1B2, 0xA1B2, 0xA1B2 }, { 0xA1B3, 0xA1B3, 0xA1B3 }, { 0xA1B4, 0xA1B4, 0xA1B4 }, { 0xA1B5, 0xA1B5, 0xA1B5 }, { 0xA1B6, 0xA1B6, 0xA1B6 }, { 0xA1B7, 0xA1B7, 0xA1B7 }, { 0xA1B8, 0xA1B8, 0xA1B8 }, { 0xA1B9, 0xA1B9, 0xA1B9 }, { 0xA1BA, 0xA1BA, 0xA1BA }, { 0xA1BB, 0xA1BB, 0xA1BB }, { 0xA1BC, 0xA1BC, 0xA1BC }, { 0xA1BD, 0xA1BD, 0xA1BD }, { 0xA1BE, 0xA1BE, 0xA1BE }, { 0xA1BF, 0xA1BF, 0xA1BF }, { 0xA1C0, 0xA1C0, 0xA1C0 }, { 0xA1C1, 0xA1C1, 0xA1C1 }, { 0xA1C2, 0xA1C2, 0xA1C2 }, { 0xA1C3, 0xA1C3, 0xA1C3 }, { 0xA1C4, 0xA1C4, 0xA1C4 }, { 0xA1C5, 0xA1C5, 0xA1C5 }, { 0xA1C6, 0xA1C6, 0xA1C6 }, { 0xA1C7, 0xA1C7, 0xA1C7 }, { 0xA1C8, 0xA1C8, 0xA1C8 }, { 0xA1C9, 0xA1C9, 0xA1C9 }, { 0xA1CA, 0xA1CA, 0xA1CA }, { 0xA1CB, 0xA1CB, 0xA1CB }, { 0xA1CC, 0xA1CC, 0xA1CC }, { 0xA1CD, 0xA1CD, 0xA1CD }, { 0xA1CE, 0xA1CE, 0xA1CE }, { 0xA1CF, 0xA1CF, 0xA1CF }, { 0xA1D0, 0xA1D0, 0xA1D0 }, { 0xA1D1, 0xA1D1, 0xA1D1 }, { 0xA1D2, 0xA1D2, 0xA1D2 }, { 0xA1D3, 0xA1D3, 0xA1D3 }, { 0xA1D4, 0xA1D4, 0xA1D4 }, { 0xA1D5, 0xA1D5, 0xA1D5 }, { 0xA1D6, 0xA1D6, 0xA1D6 }, { 0xA1D7, 0xA1D7, 0xA1D7 }, { 0xA1D8, 0xA1D8, 0xA1D8 }, { 0xA1D9, 0xA1D9, 0xA1D9 }, { 0xA1DA, 0xA1DA, 0xA1DA }, { 0xA1DB, 0xA1DB, 0xA1DB }, { 0xA1DC, 0xA1DC, 0xA1DC }, { 0xA1DD, 0xA1DD, 0xA1DD }, { 0xA1DE, 0xA1DE, 0xA1DE }, { 0xA1DF, 0xA1DF, 0xA1DF }, { 0xA1E0, 0xA1E0, 0xA1E0 }, { 0xA1E1, 0xA1E1, 0xA1E1 }, { 0xA1E2, 0xA1E2, 0xA1E2 }, { 0xA1E3, 0xA1E3, 0xA1E3 }, { 0xA1E4, 0xA1E4, 0xA1E4 }, { 0xA1E5, 0xA1E5, 0xA1E5 }, { 0xA1E6, 0xA1E6, 0xA1E6 }, { 0xA1E7, 0xA1E7, 0xA1E7 }, { 0xA1E8, 0xA1E8, 0xA1E8 }, { 0xA1E9, 0xA1E9, 0xA1E9 }, { 0xA1EA, 0xA1EA, 0xA1EA }, { 0xA1EB, 0xA1EB, 0xA1EB }, { 0xA1EC, 0xA1EC, 0xA1EC }, { 0xA1ED, 0xA1ED, 0xA1ED }, { 0xA1EE, 0xA1EE, 0xA1EE }, { 0xA1EF, 0xA1EF, 0xA1EF }, { 0xA1F0, 0xA1F0, 0xA1F0 }, { 0xA1F1, 0xA1F1, 0xA1F1 }, { 0xA1F2, 0xA1F2, 0xA1F2 }, { 0xA1F3, 0xA1F3, 0xA1F3 }, { 0xA1F4, 0xA1F4, 0xA1F4 }, { 0xA1F5, 0xA1F5, 0xA1F5 }, { 0xA1F6, 0xA1F6, 0xA1F6 }, { 0xA1F7, 0xA1F7, 0xA1F7 }, { 0xA1F8, 0xA1F8, 0xA1F8 }, { 0xA1F9, 0xA1F9, 0xA1F9 }, { 0xA1FA, 0xA1FA, 0xA1FA }, { 0xA1FB, 0xA1FB, 0xA1FB }, { 0xA1FC, 0xA1FC, 0xA1FC }, { 0xA1FD, 0xA1FD, 0xA1FD }, { 0xA1FE, 0xA1FE, 0xA1FE }, { 0xA1FF, 0xA1FF, 0xA1FF }, { 0xA200, 0xA200, 0xA200 }, { 0xA201, 0xA201, 0xA201 }, { 0xA202, 0xA202, 0xA202 }, { 0xA203, 0xA203, 0xA203 }, { 0xA204, 0xA204, 0xA204 }, { 0xA205, 0xA205, 0xA205 }, { 0xA206, 0xA206, 0xA206 }, { 0xA207, 0xA207, 0xA207 }, { 0xA208, 0xA208, 0xA208 }, { 0xA209, 0xA209, 0xA209 }, { 0xA20A, 0xA20A, 0xA20A }, { 0xA20B, 0xA20B, 0xA20B }, { 0xA20C, 0xA20C, 0xA20C }, { 0xA20D, 0xA20D, 0xA20D }, { 0xA20E, 0xA20E, 0xA20E }, { 0xA20F, 0xA20F, 0xA20F }, { 0xA210, 0xA210, 0xA210 }, { 0xA211, 0xA211, 0xA211 }, { 0xA212, 0xA212, 0xA212 }, { 0xA213, 0xA213, 0xA213 }, { 0xA214, 0xA214, 0xA214 }, { 0xA215, 0xA215, 0xA215 }, { 0xA216, 0xA216, 0xA216 }, { 0xA217, 0xA217, 0xA217 }, { 0xA218, 0xA218, 0xA218 }, { 0xA219, 0xA219, 0xA219 }, { 0xA21A, 0xA21A, 0xA21A }, { 0xA21B, 0xA21B, 0xA21B }, { 0xA21C, 0xA21C, 0xA21C }, { 0xA21D, 0xA21D, 0xA21D }, { 0xA21E, 0xA21E, 0xA21E }, { 0xA21F, 0xA21F, 0xA21F }, { 0xA220, 0xA220, 0xA220 }, { 0xA221, 0xA221, 0xA221 }, { 0xA222, 0xA222, 0xA222 }, { 0xA223, 0xA223, 0xA223 }, { 0xA224, 0xA224, 0xA224 }, { 0xA225, 0xA225, 0xA225 }, { 0xA226, 0xA226, 0xA226 }, { 0xA227, 0xA227, 0xA227 }, { 0xA228, 0xA228, 0xA228 }, { 0xA229, 0xA229, 0xA229 }, { 0xA22A, 0xA22A, 0xA22A }, { 0xA22B, 0xA22B, 0xA22B }, { 0xA22C, 0xA22C, 0xA22C }, { 0xA22D, 0xA22D, 0xA22D }, { 0xA22E, 0xA22E, 0xA22E }, { 0xA22F, 0xA22F, 0xA22F }, { 0xA230, 0xA230, 0xA230 }, { 0xA231, 0xA231, 0xA231 }, { 0xA232, 0xA232, 0xA232 }, { 0xA233, 0xA233, 0xA233 }, { 0xA234, 0xA234, 0xA234 }, { 0xA235, 0xA235, 0xA235 }, { 0xA236, 0xA236, 0xA236 }, { 0xA237, 0xA237, 0xA237 }, { 0xA238, 0xA238, 0xA238 }, { 0xA239, 0xA239, 0xA239 }, { 0xA23A, 0xA23A, 0xA23A }, { 0xA23B, 0xA23B, 0xA23B }, { 0xA23C, 0xA23C, 0xA23C }, { 0xA23D, 0xA23D, 0xA23D }, { 0xA23E, 0xA23E, 0xA23E }, { 0xA23F, 0xA23F, 0xA23F }, { 0xA240, 0xA240, 0xA240 }, { 0xA241, 0xA241, 0xA241 }, { 0xA242, 0xA242, 0xA242 }, { 0xA243, 0xA243, 0xA243 }, { 0xA244, 0xA244, 0xA244 }, { 0xA245, 0xA245, 0xA245 }, { 0xA246, 0xA246, 0xA246 }, { 0xA247, 0xA247, 0xA247 }, { 0xA248, 0xA248, 0xA248 }, { 0xA249, 0xA249, 0xA249 }, { 0xA24A, 0xA24A, 0xA24A }, { 0xA24B, 0xA24B, 0xA24B }, { 0xA24C, 0xA24C, 0xA24C }, { 0xA24D, 0xA24D, 0xA24D }, { 0xA24E, 0xA24E, 0xA24E }, { 0xA24F, 0xA24F, 0xA24F }, { 0xA250, 0xA250, 0xA250 }, { 0xA251, 0xA251, 0xA251 }, { 0xA252, 0xA252, 0xA252 }, { 0xA253, 0xA253, 0xA253 }, { 0xA254, 0xA254, 0xA254 }, { 0xA255, 0xA255, 0xA255 }, { 0xA256, 0xA256, 0xA256 }, { 0xA257, 0xA257, 0xA257 }, { 0xA258, 0xA258, 0xA258 }, { 0xA259, 0xA259, 0xA259 }, { 0xA25A, 0xA25A, 0xA25A }, { 0xA25B, 0xA25B, 0xA25B }, { 0xA25C, 0xA25C, 0xA25C }, { 0xA25D, 0xA25D, 0xA25D }, { 0xA25E, 0xA25E, 0xA25E }, { 0xA25F, 0xA25F, 0xA25F }, { 0xA260, 0xA260, 0xA260 }, { 0xA261, 0xA261, 0xA261 }, { 0xA262, 0xA262, 0xA262 }, { 0xA263, 0xA263, 0xA263 }, { 0xA264, 0xA264, 0xA264 }, { 0xA265, 0xA265, 0xA265 }, { 0xA266, 0xA266, 0xA266 }, { 0xA267, 0xA267, 0xA267 }, { 0xA268, 0xA268, 0xA268 }, { 0xA269, 0xA269, 0xA269 }, { 0xA26A, 0xA26A, 0xA26A }, { 0xA26B, 0xA26B, 0xA26B }, { 0xA26C, 0xA26C, 0xA26C }, { 0xA26D, 0xA26D, 0xA26D }, { 0xA26E, 0xA26E, 0xA26E }, { 0xA26F, 0xA26F, 0xA26F }, { 0xA270, 0xA270, 0xA270 }, { 0xA271, 0xA271, 0xA271 }, { 0xA272, 0xA272, 0xA272 }, { 0xA273, 0xA273, 0xA273 }, { 0xA274, 0xA274, 0xA274 }, { 0xA275, 0xA275, 0xA275 }, { 0xA276, 0xA276, 0xA276 }, { 0xA277, 0xA277, 0xA277 }, { 0xA278, 0xA278, 0xA278 }, { 0xA279, 0xA279, 0xA279 }, { 0xA27A, 0xA27A, 0xA27A }, { 0xA27B, 0xA27B, 0xA27B }, { 0xA27C, 0xA27C, 0xA27C }, { 0xA27D, 0xA27D, 0xA27D }, { 0xA27E, 0xA27E, 0xA27E }, { 0xA27F, 0xA27F, 0xA27F }, { 0xA280, 0xA280, 0xA280 }, { 0xA281, 0xA281, 0xA281 }, { 0xA282, 0xA282, 0xA282 }, { 0xA283, 0xA283, 0xA283 }, { 0xA284, 0xA284, 0xA284 }, { 0xA285, 0xA285, 0xA285 }, { 0xA286, 0xA286, 0xA286 }, { 0xA287, 0xA287, 0xA287 }, { 0xA288, 0xA288, 0xA288 }, { 0xA289, 0xA289, 0xA289 }, { 0xA28A, 0xA28A, 0xA28A }, { 0xA28B, 0xA28B, 0xA28B }, { 0xA28C, 0xA28C, 0xA28C }, { 0xA28D, 0xA28D, 0xA28D }, { 0xA28E, 0xA28E, 0xA28E }, { 0xA28F, 0xA28F, 0xA28F }, { 0xA290, 0xA290, 0xA290 }, { 0xA291, 0xA291, 0xA291 }, { 0xA292, 0xA292, 0xA292 }, { 0xA293, 0xA293, 0xA293 }, { 0xA294, 0xA294, 0xA294 }, { 0xA295, 0xA295, 0xA295 }, { 0xA296, 0xA296, 0xA296 }, { 0xA297, 0xA297, 0xA297 }, { 0xA298, 0xA298, 0xA298 }, { 0xA299, 0xA299, 0xA299 }, { 0xA29A, 0xA29A, 0xA29A }, { 0xA29B, 0xA29B, 0xA29B }, { 0xA29C, 0xA29C, 0xA29C }, { 0xA29D, 0xA29D, 0xA29D }, { 0xA29E, 0xA29E, 0xA29E }, { 0xA29F, 0xA29F, 0xA29F }, { 0xA2A0, 0xA2A0, 0xA2A0 }, { 0xA2A1, 0xA2A1, 0xA2A1 }, { 0xA2A2, 0xA2A2, 0xA2A2 }, { 0xA2A3, 0xA2A3, 0xA2A3 }, { 0xA2A4, 0xA2A4, 0xA2A4 }, { 0xA2A5, 0xA2A5, 0xA2A5 }, { 0xA2A6, 0xA2A6, 0xA2A6 }, { 0xA2A7, 0xA2A7, 0xA2A7 }, { 0xA2A8, 0xA2A8, 0xA2A8 }, { 0xA2A9, 0xA2A9, 0xA2A9 }, { 0xA2AA, 0xA2AA, 0xA2AA }, { 0xA2AB, 0xA2AB, 0xA2AB }, { 0xA2AC, 0xA2AC, 0xA2AC }, { 0xA2AD, 0xA2AD, 0xA2AD }, { 0xA2AE, 0xA2AE, 0xA2AE }, { 0xA2AF, 0xA2AF, 0xA2AF }, { 0xA2B0, 0xA2B0, 0xA2B0 }, { 0xA2B1, 0xA2B1, 0xA2B1 }, { 0xA2B2, 0xA2B2, 0xA2B2 }, { 0xA2B3, 0xA2B3, 0xA2B3 }, { 0xA2B4, 0xA2B4, 0xA2B4 }, { 0xA2B5, 0xA2B5, 0xA2B5 }, { 0xA2B6, 0xA2B6, 0xA2B6 }, { 0xA2B7, 0xA2B7, 0xA2B7 }, { 0xA2B8, 0xA2B8, 0xA2B8 }, { 0xA2B9, 0xA2B9, 0xA2B9 }, { 0xA2BA, 0xA2BA, 0xA2BA }, { 0xA2BB, 0xA2BB, 0xA2BB }, { 0xA2BC, 0xA2BC, 0xA2BC }, { 0xA2BD, 0xA2BD, 0xA2BD }, { 0xA2BE, 0xA2BE, 0xA2BE }, { 0xA2BF, 0xA2BF, 0xA2BF }, { 0xA2C0, 0xA2C0, 0xA2C0 }, { 0xA2C1, 0xA2C1, 0xA2C1 }, { 0xA2C2, 0xA2C2, 0xA2C2 }, { 0xA2C3, 0xA2C3, 0xA2C3 }, { 0xA2C4, 0xA2C4, 0xA2C4 }, { 0xA2C5, 0xA2C5, 0xA2C5 }, { 0xA2C6, 0xA2C6, 0xA2C6 }, { 0xA2C7, 0xA2C7, 0xA2C7 }, { 0xA2C8, 0xA2C8, 0xA2C8 }, { 0xA2C9, 0xA2C9, 0xA2C9 }, { 0xA2CA, 0xA2CA, 0xA2CA }, { 0xA2CB, 0xA2CB, 0xA2CB }, { 0xA2CC, 0xA2CC, 0xA2CC }, { 0xA2CD, 0xA2CD, 0xA2CD }, { 0xA2CE, 0xA2CE, 0xA2CE }, { 0xA2CF, 0xA2CF, 0xA2CF }, { 0xA2D0, 0xA2D0, 0xA2D0 }, { 0xA2D1, 0xA2D1, 0xA2D1 }, { 0xA2D2, 0xA2D2, 0xA2D2 }, { 0xA2D3, 0xA2D3, 0xA2D3 }, { 0xA2D4, 0xA2D4, 0xA2D4 }, { 0xA2D5, 0xA2D5, 0xA2D5 }, { 0xA2D6, 0xA2D6, 0xA2D6 }, { 0xA2D7, 0xA2D7, 0xA2D7 }, { 0xA2D8, 0xA2D8, 0xA2D8 }, { 0xA2D9, 0xA2D9, 0xA2D9 }, { 0xA2DA, 0xA2DA, 0xA2DA }, { 0xA2DB, 0xA2DB, 0xA2DB }, { 0xA2DC, 0xA2DC, 0xA2DC }, { 0xA2DD, 0xA2DD, 0xA2DD }, { 0xA2DE, 0xA2DE, 0xA2DE }, { 0xA2DF, 0xA2DF, 0xA2DF }, { 0xA2E0, 0xA2E0, 0xA2E0 }, { 0xA2E1, 0xA2E1, 0xA2E1 }, { 0xA2E2, 0xA2E2, 0xA2E2 }, { 0xA2E3, 0xA2E3, 0xA2E3 }, { 0xA2E4, 0xA2E4, 0xA2E4 }, { 0xA2E5, 0xA2E5, 0xA2E5 }, { 0xA2E6, 0xA2E6, 0xA2E6 }, { 0xA2E7, 0xA2E7, 0xA2E7 }, { 0xA2E8, 0xA2E8, 0xA2E8 }, { 0xA2E9, 0xA2E9, 0xA2E9 }, { 0xA2EA, 0xA2EA, 0xA2EA }, { 0xA2EB, 0xA2EB, 0xA2EB }, { 0xA2EC, 0xA2EC, 0xA2EC }, { 0xA2ED, 0xA2ED, 0xA2ED }, { 0xA2EE, 0xA2EE, 0xA2EE }, { 0xA2EF, 0xA2EF, 0xA2EF }, { 0xA2F0, 0xA2F0, 0xA2F0 }, { 0xA2F1, 0xA2F1, 0xA2F1 }, { 0xA2F2, 0xA2F2, 0xA2F2 }, { 0xA2F3, 0xA2F3, 0xA2F3 }, { 0xA2F4, 0xA2F4, 0xA2F4 }, { 0xA2F5, 0xA2F5, 0xA2F5 }, { 0xA2F6, 0xA2F6, 0xA2F6 }, { 0xA2F7, 0xA2F7, 0xA2F7 }, { 0xA2F8, 0xA2F8, 0xA2F8 }, { 0xA2F9, 0xA2F9, 0xA2F9 }, { 0xA2FA, 0xA2FA, 0xA2FA }, { 0xA2FB, 0xA2FB, 0xA2FB }, { 0xA2FC, 0xA2FC, 0xA2FC }, { 0xA2FD, 0xA2FD, 0xA2FD }, { 0xA2FE, 0xA2FE, 0xA2FE }, { 0xA2FF, 0xA2FF, 0xA2FF }, { 0xA300, 0xA300, 0xA300 }, { 0xA301, 0xA301, 0xA301 }, { 0xA302, 0xA302, 0xA302 }, { 0xA303, 0xA303, 0xA303 }, { 0xA304, 0xA304, 0xA304 }, { 0xA305, 0xA305, 0xA305 }, { 0xA306, 0xA306, 0xA306 }, { 0xA307, 0xA307, 0xA307 }, { 0xA308, 0xA308, 0xA308 }, { 0xA309, 0xA309, 0xA309 }, { 0xA30A, 0xA30A, 0xA30A }, { 0xA30B, 0xA30B, 0xA30B }, { 0xA30C, 0xA30C, 0xA30C }, { 0xA30D, 0xA30D, 0xA30D }, { 0xA30E, 0xA30E, 0xA30E }, { 0xA30F, 0xA30F, 0xA30F }, { 0xA310, 0xA310, 0xA310 }, { 0xA311, 0xA311, 0xA311 }, { 0xA312, 0xA312, 0xA312 }, { 0xA313, 0xA313, 0xA313 }, { 0xA314, 0xA314, 0xA314 }, { 0xA315, 0xA315, 0xA315 }, { 0xA316, 0xA316, 0xA316 }, { 0xA317, 0xA317, 0xA317 }, { 0xA318, 0xA318, 0xA318 }, { 0xA319, 0xA319, 0xA319 }, { 0xA31A, 0xA31A, 0xA31A }, { 0xA31B, 0xA31B, 0xA31B }, { 0xA31C, 0xA31C, 0xA31C }, { 0xA31D, 0xA31D, 0xA31D }, { 0xA31E, 0xA31E, 0xA31E }, { 0xA31F, 0xA31F, 0xA31F }, { 0xA320, 0xA320, 0xA320 }, { 0xA321, 0xA321, 0xA321 }, { 0xA322, 0xA322, 0xA322 }, { 0xA323, 0xA323, 0xA323 }, { 0xA324, 0xA324, 0xA324 }, { 0xA325, 0xA325, 0xA325 }, { 0xA326, 0xA326, 0xA326 }, { 0xA327, 0xA327, 0xA327 }, { 0xA328, 0xA328, 0xA328 }, { 0xA329, 0xA329, 0xA329 }, { 0xA32A, 0xA32A, 0xA32A }, { 0xA32B, 0xA32B, 0xA32B }, { 0xA32C, 0xA32C, 0xA32C }, { 0xA32D, 0xA32D, 0xA32D }, { 0xA32E, 0xA32E, 0xA32E }, { 0xA32F, 0xA32F, 0xA32F }, { 0xA330, 0xA330, 0xA330 }, { 0xA331, 0xA331, 0xA331 }, { 0xA332, 0xA332, 0xA332 }, { 0xA333, 0xA333, 0xA333 }, { 0xA334, 0xA334, 0xA334 }, { 0xA335, 0xA335, 0xA335 }, { 0xA336, 0xA336, 0xA336 }, { 0xA337, 0xA337, 0xA337 }, { 0xA338, 0xA338, 0xA338 }, { 0xA339, 0xA339, 0xA339 }, { 0xA33A, 0xA33A, 0xA33A }, { 0xA33B, 0xA33B, 0xA33B }, { 0xA33C, 0xA33C, 0xA33C }, { 0xA33D, 0xA33D, 0xA33D }, { 0xA33E, 0xA33E, 0xA33E }, { 0xA33F, 0xA33F, 0xA33F }, { 0xA340, 0xA340, 0xA340 }, { 0xA341, 0xA341, 0xA341 }, { 0xA342, 0xA342, 0xA342 }, { 0xA343, 0xA343, 0xA343 }, { 0xA344, 0xA344, 0xA344 }, { 0xA345, 0xA345, 0xA345 }, { 0xA346, 0xA346, 0xA346 }, { 0xA347, 0xA347, 0xA347 }, { 0xA348, 0xA348, 0xA348 }, { 0xA349, 0xA349, 0xA349 }, { 0xA34A, 0xA34A, 0xA34A }, { 0xA34B, 0xA34B, 0xA34B }, { 0xA34C, 0xA34C, 0xA34C }, { 0xA34D, 0xA34D, 0xA34D }, { 0xA34E, 0xA34E, 0xA34E }, { 0xA34F, 0xA34F, 0xA34F }, { 0xA350, 0xA350, 0xA350 }, { 0xA351, 0xA351, 0xA351 }, { 0xA352, 0xA352, 0xA352 }, { 0xA353, 0xA353, 0xA353 }, { 0xA354, 0xA354, 0xA354 }, { 0xA355, 0xA355, 0xA355 }, { 0xA356, 0xA356, 0xA356 }, { 0xA357, 0xA357, 0xA357 }, { 0xA358, 0xA358, 0xA358 }, { 0xA359, 0xA359, 0xA359 }, { 0xA35A, 0xA35A, 0xA35A }, { 0xA35B, 0xA35B, 0xA35B }, { 0xA35C, 0xA35C, 0xA35C }, { 0xA35D, 0xA35D, 0xA35D }, { 0xA35E, 0xA35E, 0xA35E }, { 0xA35F, 0xA35F, 0xA35F }, { 0xA360, 0xA360, 0xA360 }, { 0xA361, 0xA361, 0xA361 }, { 0xA362, 0xA362, 0xA362 }, { 0xA363, 0xA363, 0xA363 }, { 0xA364, 0xA364, 0xA364 }, { 0xA365, 0xA365, 0xA365 }, { 0xA366, 0xA366, 0xA366 }, { 0xA367, 0xA367, 0xA367 }, { 0xA368, 0xA368, 0xA368 }, { 0xA369, 0xA369, 0xA369 }, { 0xA36A, 0xA36A, 0xA36A }, { 0xA36B, 0xA36B, 0xA36B }, { 0xA36C, 0xA36C, 0xA36C }, { 0xA36D, 0xA36D, 0xA36D }, { 0xA36E, 0xA36E, 0xA36E }, { 0xA36F, 0xA36F, 0xA36F }, { 0xA370, 0xA370, 0xA370 }, { 0xA371, 0xA371, 0xA371 }, { 0xA372, 0xA372, 0xA372 }, { 0xA373, 0xA373, 0xA373 }, { 0xA374, 0xA374, 0xA374 }, { 0xA375, 0xA375, 0xA375 }, { 0xA376, 0xA376, 0xA376 }, { 0xA377, 0xA377, 0xA377 }, { 0xA378, 0xA378, 0xA378 }, { 0xA379, 0xA379, 0xA379 }, { 0xA37A, 0xA37A, 0xA37A }, { 0xA37B, 0xA37B, 0xA37B }, { 0xA37C, 0xA37C, 0xA37C }, { 0xA37D, 0xA37D, 0xA37D }, { 0xA37E, 0xA37E, 0xA37E }, { 0xA37F, 0xA37F, 0xA37F }, { 0xA380, 0xA380, 0xA380 }, { 0xA381, 0xA381, 0xA381 }, { 0xA382, 0xA382, 0xA382 }, { 0xA383, 0xA383, 0xA383 }, { 0xA384, 0xA384, 0xA384 }, { 0xA385, 0xA385, 0xA385 }, { 0xA386, 0xA386, 0xA386 }, { 0xA387, 0xA387, 0xA387 }, { 0xA388, 0xA388, 0xA388 }, { 0xA389, 0xA389, 0xA389 }, { 0xA38A, 0xA38A, 0xA38A }, { 0xA38B, 0xA38B, 0xA38B }, { 0xA38C, 0xA38C, 0xA38C }, { 0xA38D, 0xA38D, 0xA38D }, { 0xA38E, 0xA38E, 0xA38E }, { 0xA38F, 0xA38F, 0xA38F }, { 0xA390, 0xA390, 0xA390 }, { 0xA391, 0xA391, 0xA391 }, { 0xA392, 0xA392, 0xA392 }, { 0xA393, 0xA393, 0xA393 }, { 0xA394, 0xA394, 0xA394 }, { 0xA395, 0xA395, 0xA395 }, { 0xA396, 0xA396, 0xA396 }, { 0xA397, 0xA397, 0xA397 }, { 0xA398, 0xA398, 0xA398 }, { 0xA399, 0xA399, 0xA399 }, { 0xA39A, 0xA39A, 0xA39A }, { 0xA39B, 0xA39B, 0xA39B }, { 0xA39C, 0xA39C, 0xA39C }, { 0xA39D, 0xA39D, 0xA39D }, { 0xA39E, 0xA39E, 0xA39E }, { 0xA39F, 0xA39F, 0xA39F }, { 0xA3A0, 0xA3A0, 0xA3A0 }, { 0xA3A1, 0xA3A1, 0xA3A1 }, { 0xA3A2, 0xA3A2, 0xA3A2 }, { 0xA3A3, 0xA3A3, 0xA3A3 }, { 0xA3A4, 0xA3A4, 0xA3A4 }, { 0xA3A5, 0xA3A5, 0xA3A5 }, { 0xA3A6, 0xA3A6, 0xA3A6 }, { 0xA3A7, 0xA3A7, 0xA3A7 }, { 0xA3A8, 0xA3A8, 0xA3A8 }, { 0xA3A9, 0xA3A9, 0xA3A9 }, { 0xA3AA, 0xA3AA, 0xA3AA }, { 0xA3AB, 0xA3AB, 0xA3AB }, { 0xA3AC, 0xA3AC, 0xA3AC }, { 0xA3AD, 0xA3AD, 0xA3AD }, { 0xA3AE, 0xA3AE, 0xA3AE }, { 0xA3AF, 0xA3AF, 0xA3AF }, { 0xA3B0, 0xA3B0, 0xA3B0 }, { 0xA3B1, 0xA3B1, 0xA3B1 }, { 0xA3B2, 0xA3B2, 0xA3B2 }, { 0xA3B3, 0xA3B3, 0xA3B3 }, { 0xA3B4, 0xA3B4, 0xA3B4 }, { 0xA3B5, 0xA3B5, 0xA3B5 }, { 0xA3B6, 0xA3B6, 0xA3B6 }, { 0xA3B7, 0xA3B7, 0xA3B7 }, { 0xA3B8, 0xA3B8, 0xA3B8 }, { 0xA3B9, 0xA3B9, 0xA3B9 }, { 0xA3BA, 0xA3BA, 0xA3BA }, { 0xA3BB, 0xA3BB, 0xA3BB }, { 0xA3BC, 0xA3BC, 0xA3BC }, { 0xA3BD, 0xA3BD, 0xA3BD }, { 0xA3BE, 0xA3BE, 0xA3BE }, { 0xA3BF, 0xA3BF, 0xA3BF }, { 0xA3C0, 0xA3C0, 0xA3C0 }, { 0xA3C1, 0xA3C1, 0xA3C1 }, { 0xA3C2, 0xA3C2, 0xA3C2 }, { 0xA3C3, 0xA3C3, 0xA3C3 }, { 0xA3C4, 0xA3C4, 0xA3C4 }, { 0xA3C5, 0xA3C5, 0xA3C5 }, { 0xA3C6, 0xA3C6, 0xA3C6 }, { 0xA3C7, 0xA3C7, 0xA3C7 }, { 0xA3C8, 0xA3C8, 0xA3C8 }, { 0xA3C9, 0xA3C9, 0xA3C9 }, { 0xA3CA, 0xA3CA, 0xA3CA }, { 0xA3CB, 0xA3CB, 0xA3CB }, { 0xA3CC, 0xA3CC, 0xA3CC }, { 0xA3CD, 0xA3CD, 0xA3CD }, { 0xA3CE, 0xA3CE, 0xA3CE }, { 0xA3CF, 0xA3CF, 0xA3CF }, { 0xA3D0, 0xA3D0, 0xA3D0 }, { 0xA3D1, 0xA3D1, 0xA3D1 }, { 0xA3D2, 0xA3D2, 0xA3D2 }, { 0xA3D3, 0xA3D3, 0xA3D3 }, { 0xA3D4, 0xA3D4, 0xA3D4 }, { 0xA3D5, 0xA3D5, 0xA3D5 }, { 0xA3D6, 0xA3D6, 0xA3D6 }, { 0xA3D7, 0xA3D7, 0xA3D7 }, { 0xA3D8, 0xA3D8, 0xA3D8 }, { 0xA3D9, 0xA3D9, 0xA3D9 }, { 0xA3DA, 0xA3DA, 0xA3DA }, { 0xA3DB, 0xA3DB, 0xA3DB }, { 0xA3DC, 0xA3DC, 0xA3DC }, { 0xA3DD, 0xA3DD, 0xA3DD }, { 0xA3DE, 0xA3DE, 0xA3DE }, { 0xA3DF, 0xA3DF, 0xA3DF }, { 0xA3E0, 0xA3E0, 0xA3E0 }, { 0xA3E1, 0xA3E1, 0xA3E1 }, { 0xA3E2, 0xA3E2, 0xA3E2 }, { 0xA3E3, 0xA3E3, 0xA3E3 }, { 0xA3E4, 0xA3E4, 0xA3E4 }, { 0xA3E5, 0xA3E5, 0xA3E5 }, { 0xA3E6, 0xA3E6, 0xA3E6 }, { 0xA3E7, 0xA3E7, 0xA3E7 }, { 0xA3E8, 0xA3E8, 0xA3E8 }, { 0xA3E9, 0xA3E9, 0xA3E9 }, { 0xA3EA, 0xA3EA, 0xA3EA }, { 0xA3EB, 0xA3EB, 0xA3EB }, { 0xA3EC, 0xA3EC, 0xA3EC }, { 0xA3ED, 0xA3ED, 0xA3ED }, { 0xA3EE, 0xA3EE, 0xA3EE }, { 0xA3EF, 0xA3EF, 0xA3EF }, { 0xA3F0, 0xA3F0, 0xA3F0 }, { 0xA3F1, 0xA3F1, 0xA3F1 }, { 0xA3F2, 0xA3F2, 0xA3F2 }, { 0xA3F3, 0xA3F3, 0xA3F3 }, { 0xA3F4, 0xA3F4, 0xA3F4 }, { 0xA3F5, 0xA3F5, 0xA3F5 }, { 0xA3F6, 0xA3F6, 0xA3F6 }, { 0xA3F7, 0xA3F7, 0xA3F7 }, { 0xA3F8, 0xA3F8, 0xA3F8 }, { 0xA3F9, 0xA3F9, 0xA3F9 }, { 0xA3FA, 0xA3FA, 0xA3FA }, { 0xA3FB, 0xA3FB, 0xA3FB }, { 0xA3FC, 0xA3FC, 0xA3FC }, { 0xA3FD, 0xA3FD, 0xA3FD }, { 0xA3FE, 0xA3FE, 0xA3FE }, { 0xA3FF, 0xA3FF, 0xA3FF }, { 0xA400, 0xA400, 0xA400 }, { 0xA401, 0xA401, 0xA401 }, { 0xA402, 0xA402, 0xA402 }, { 0xA403, 0xA403, 0xA403 }, { 0xA404, 0xA404, 0xA404 }, { 0xA405, 0xA405, 0xA405 }, { 0xA406, 0xA406, 0xA406 }, { 0xA407, 0xA407, 0xA407 }, { 0xA408, 0xA408, 0xA408 }, { 0xA409, 0xA409, 0xA409 }, { 0xA40A, 0xA40A, 0xA40A }, { 0xA40B, 0xA40B, 0xA40B }, { 0xA40C, 0xA40C, 0xA40C }, { 0xA40D, 0xA40D, 0xA40D }, { 0xA40E, 0xA40E, 0xA40E }, { 0xA40F, 0xA40F, 0xA40F }, { 0xA410, 0xA410, 0xA410 }, { 0xA411, 0xA411, 0xA411 }, { 0xA412, 0xA412, 0xA412 }, { 0xA413, 0xA413, 0xA413 }, { 0xA414, 0xA414, 0xA414 }, { 0xA415, 0xA415, 0xA415 }, { 0xA416, 0xA416, 0xA416 }, { 0xA417, 0xA417, 0xA417 }, { 0xA418, 0xA418, 0xA418 }, { 0xA419, 0xA419, 0xA419 }, { 0xA41A, 0xA41A, 0xA41A }, { 0xA41B, 0xA41B, 0xA41B }, { 0xA41C, 0xA41C, 0xA41C }, { 0xA41D, 0xA41D, 0xA41D }, { 0xA41E, 0xA41E, 0xA41E }, { 0xA41F, 0xA41F, 0xA41F }, { 0xA420, 0xA420, 0xA420 }, { 0xA421, 0xA421, 0xA421 }, { 0xA422, 0xA422, 0xA422 }, { 0xA423, 0xA423, 0xA423 }, { 0xA424, 0xA424, 0xA424 }, { 0xA425, 0xA425, 0xA425 }, { 0xA426, 0xA426, 0xA426 }, { 0xA427, 0xA427, 0xA427 }, { 0xA428, 0xA428, 0xA428 }, { 0xA429, 0xA429, 0xA429 }, { 0xA42A, 0xA42A, 0xA42A }, { 0xA42B, 0xA42B, 0xA42B }, { 0xA42C, 0xA42C, 0xA42C }, { 0xA42D, 0xA42D, 0xA42D }, { 0xA42E, 0xA42E, 0xA42E }, { 0xA42F, 0xA42F, 0xA42F }, { 0xA430, 0xA430, 0xA430 }, { 0xA431, 0xA431, 0xA431 }, { 0xA432, 0xA432, 0xA432 }, { 0xA433, 0xA433, 0xA433 }, { 0xA434, 0xA434, 0xA434 }, { 0xA435, 0xA435, 0xA435 }, { 0xA436, 0xA436, 0xA436 }, { 0xA437, 0xA437, 0xA437 }, { 0xA438, 0xA438, 0xA438 }, { 0xA439, 0xA439, 0xA439 }, { 0xA43A, 0xA43A, 0xA43A }, { 0xA43B, 0xA43B, 0xA43B }, { 0xA43C, 0xA43C, 0xA43C }, { 0xA43D, 0xA43D, 0xA43D }, { 0xA43E, 0xA43E, 0xA43E }, { 0xA43F, 0xA43F, 0xA43F }, { 0xA440, 0xA440, 0xA440 }, { 0xA441, 0xA441, 0xA441 }, { 0xA442, 0xA442, 0xA442 }, { 0xA443, 0xA443, 0xA443 }, { 0xA444, 0xA444, 0xA444 }, { 0xA445, 0xA445, 0xA445 }, { 0xA446, 0xA446, 0xA446 }, { 0xA447, 0xA447, 0xA447 }, { 0xA448, 0xA448, 0xA448 }, { 0xA449, 0xA449, 0xA449 }, { 0xA44A, 0xA44A, 0xA44A }, { 0xA44B, 0xA44B, 0xA44B }, { 0xA44C, 0xA44C, 0xA44C }, { 0xA44D, 0xA44D, 0xA44D }, { 0xA44E, 0xA44E, 0xA44E }, { 0xA44F, 0xA44F, 0xA44F }, { 0xA450, 0xA450, 0xA450 }, { 0xA451, 0xA451, 0xA451 }, { 0xA452, 0xA452, 0xA452 }, { 0xA453, 0xA453, 0xA453 }, { 0xA454, 0xA454, 0xA454 }, { 0xA455, 0xA455, 0xA455 }, { 0xA456, 0xA456, 0xA456 }, { 0xA457, 0xA457, 0xA457 }, { 0xA458, 0xA458, 0xA458 }, { 0xA459, 0xA459, 0xA459 }, { 0xA45A, 0xA45A, 0xA45A }, { 0xA45B, 0xA45B, 0xA45B }, { 0xA45C, 0xA45C, 0xA45C }, { 0xA45D, 0xA45D, 0xA45D }, { 0xA45E, 0xA45E, 0xA45E }, { 0xA45F, 0xA45F, 0xA45F }, { 0xA460, 0xA460, 0xA460 }, { 0xA461, 0xA461, 0xA461 }, { 0xA462, 0xA462, 0xA462 }, { 0xA463, 0xA463, 0xA463 }, { 0xA464, 0xA464, 0xA464 }, { 0xA465, 0xA465, 0xA465 }, { 0xA466, 0xA466, 0xA466 }, { 0xA467, 0xA467, 0xA467 }, { 0xA468, 0xA468, 0xA468 }, { 0xA469, 0xA469, 0xA469 }, { 0xA46A, 0xA46A, 0xA46A }, { 0xA46B, 0xA46B, 0xA46B }, { 0xA46C, 0xA46C, 0xA46C }, { 0xA46D, 0xA46D, 0xA46D }, { 0xA46E, 0xA46E, 0xA46E }, { 0xA46F, 0xA46F, 0xA46F }, { 0xA470, 0xA470, 0xA470 }, { 0xA471, 0xA471, 0xA471 }, { 0xA472, 0xA472, 0xA472 }, { 0xA473, 0xA473, 0xA473 }, { 0xA474, 0xA474, 0xA474 }, { 0xA475, 0xA475, 0xA475 }, { 0xA476, 0xA476, 0xA476 }, { 0xA477, 0xA477, 0xA477 }, { 0xA478, 0xA478, 0xA478 }, { 0xA479, 0xA479, 0xA479 }, { 0xA47A, 0xA47A, 0xA47A }, { 0xA47B, 0xA47B, 0xA47B }, { 0xA47C, 0xA47C, 0xA47C }, { 0xA47D, 0xA47D, 0xA47D }, { 0xA47E, 0xA47E, 0xA47E }, { 0xA47F, 0xA47F, 0xA47F }, { 0xA480, 0xA480, 0xA480 }, { 0xA481, 0xA481, 0xA481 }, { 0xA482, 0xA482, 0xA482 }, { 0xA483, 0xA483, 0xA483 }, { 0xA484, 0xA484, 0xA484 }, { 0xA485, 0xA485, 0xA485 }, { 0xA486, 0xA486, 0xA486 }, { 0xA487, 0xA487, 0xA487 }, { 0xA488, 0xA488, 0xA488 }, { 0xA489, 0xA489, 0xA489 }, { 0xA48A, 0xA48A, 0xA48A }, { 0xA48B, 0xA48B, 0xA48B }, { 0xA48C, 0xA48C, 0xA48C }, { 0xA800, 0xA800, 0xA800 }, { 0xA801, 0xA801, 0xA801 }, { 0xA803, 0xA803, 0xA803 }, { 0xA804, 0xA804, 0xA804 }, { 0xA805, 0xA805, 0xA805 }, { 0xA806, 0xA806, 0xA806 }, { 0xA807, 0xA807, 0xA807 }, { 0xA808, 0xA808, 0xA808 }, { 0xA809, 0xA809, 0xA809 }, { 0xA80A, 0xA80A, 0xA80A }, { 0xA80B, 0xA80B, 0xA80B }, { 0xA80C, 0xA80C, 0xA80C }, { 0xA80D, 0xA80D, 0xA80D }, { 0xA80E, 0xA80E, 0xA80E }, { 0xA80F, 0xA80F, 0xA80F }, { 0xA810, 0xA810, 0xA810 }, { 0xA811, 0xA811, 0xA811 }, { 0xA812, 0xA812, 0xA812 }, { 0xA813, 0xA813, 0xA813 }, { 0xA814, 0xA814, 0xA814 }, { 0xA815, 0xA815, 0xA815 }, { 0xA816, 0xA816, 0xA816 }, { 0xA817, 0xA817, 0xA817 }, { 0xA818, 0xA818, 0xA818 }, { 0xA819, 0xA819, 0xA819 }, { 0xA81A, 0xA81A, 0xA81A }, { 0xA81B, 0xA81B, 0xA81B }, { 0xA81C, 0xA81C, 0xA81C }, { 0xA81D, 0xA81D, 0xA81D }, { 0xA81E, 0xA81E, 0xA81E }, { 0xA81F, 0xA81F, 0xA81F }, { 0xA820, 0xA820, 0xA820 }, { 0xA821, 0xA821, 0xA821 }, { 0xA822, 0xA822, 0xA822 }, { 0xA825, 0xA825, 0xA825 }, { 0xA826, 0xA826, 0xA826 }, { 0xAC00, 0xAC00, 0xAC00 }, { 0xD7A3, 0xD7A3, 0xD7A3 }, { 0xF900, 0xF900, 0xF900 }, { 0xF901, 0xF901, 0xF901 }, { 0xF902, 0xF902, 0xF902 }, { 0xF903, 0xF903, 0xF903 }, { 0xF904, 0xF904, 0xF904 }, { 0xF905, 0xF905, 0xF905 }, { 0xF906, 0xF906, 0xF906 }, { 0xF907, 0xF907, 0xF907 }, { 0xF908, 0xF908, 0xF908 }, { 0xF909, 0xF909, 0xF909 }, { 0xF90A, 0xF90A, 0xF90A }, { 0xF90B, 0xF90B, 0xF90B }, { 0xF90C, 0xF90C, 0xF90C }, { 0xF90D, 0xF90D, 0xF90D }, { 0xF90E, 0xF90E, 0xF90E }, { 0xF90F, 0xF90F, 0xF90F }, { 0xF910, 0xF910, 0xF910 }, { 0xF911, 0xF911, 0xF911 }, { 0xF912, 0xF912, 0xF912 }, { 0xF913, 0xF913, 0xF913 }, { 0xF914, 0xF914, 0xF914 }, { 0xF915, 0xF915, 0xF915 }, { 0xF916, 0xF916, 0xF916 }, { 0xF917, 0xF917, 0xF917 }, { 0xF918, 0xF918, 0xF918 }, { 0xF919, 0xF919, 0xF919 }, { 0xF91A, 0xF91A, 0xF91A }, { 0xF91B, 0xF91B, 0xF91B }, { 0xF91C, 0xF91C, 0xF91C }, { 0xF91D, 0xF91D, 0xF91D }, { 0xF91E, 0xF91E, 0xF91E }, { 0xF91F, 0xF91F, 0xF91F }, { 0xF920, 0xF920, 0xF920 }, { 0xF921, 0xF921, 0xF921 }, { 0xF922, 0xF922, 0xF922 }, { 0xF923, 0xF923, 0xF923 }, { 0xF924, 0xF924, 0xF924 }, { 0xF925, 0xF925, 0xF925 }, { 0xF926, 0xF926, 0xF926 }, { 0xF927, 0xF927, 0xF927 }, { 0xF928, 0xF928, 0xF928 }, { 0xF929, 0xF929, 0xF929 }, { 0xF92A, 0xF92A, 0xF92A }, { 0xF92B, 0xF92B, 0xF92B }, { 0xF92C, 0xF92C, 0xF92C }, { 0xF92D, 0xF92D, 0xF92D }, { 0xF92E, 0xF92E, 0xF92E }, { 0xF92F, 0xF92F, 0xF92F }, { 0xF930, 0xF930, 0xF930 }, { 0xF931, 0xF931, 0xF931 }, { 0xF932, 0xF932, 0xF932 }, { 0xF933, 0xF933, 0xF933 }, { 0xF934, 0xF934, 0xF934 }, { 0xF935, 0xF935, 0xF935 }, { 0xF936, 0xF936, 0xF936 }, { 0xF937, 0xF937, 0xF937 }, { 0xF938, 0xF938, 0xF938 }, { 0xF939, 0xF939, 0xF939 }, { 0xF93A, 0xF93A, 0xF93A }, { 0xF93B, 0xF93B, 0xF93B }, { 0xF93C, 0xF93C, 0xF93C }, { 0xF93D, 0xF93D, 0xF93D }, { 0xF93E, 0xF93E, 0xF93E }, { 0xF93F, 0xF93F, 0xF93F }, { 0xF940, 0xF940, 0xF940 }, { 0xF941, 0xF941, 0xF941 }, { 0xF942, 0xF942, 0xF942 }, { 0xF943, 0xF943, 0xF943 }, { 0xF944, 0xF944, 0xF944 }, { 0xF945, 0xF945, 0xF945 }, { 0xF946, 0xF946, 0xF946 }, { 0xF947, 0xF947, 0xF947 }, { 0xF948, 0xF948, 0xF948 }, { 0xF949, 0xF949, 0xF949 }, { 0xF94A, 0xF94A, 0xF94A }, { 0xF94B, 0xF94B, 0xF94B }, { 0xF94C, 0xF94C, 0xF94C }, { 0xF94D, 0xF94D, 0xF94D }, { 0xF94E, 0xF94E, 0xF94E }, { 0xF94F, 0xF94F, 0xF94F }, { 0xF950, 0xF950, 0xF950 }, { 0xF951, 0xF951, 0xF951 }, { 0xF952, 0xF952, 0xF952 }, { 0xF953, 0xF953, 0xF953 }, { 0xF954, 0xF954, 0xF954 }, { 0xF955, 0xF955, 0xF955 }, { 0xF956, 0xF956, 0xF956 }, { 0xF957, 0xF957, 0xF957 }, { 0xF958, 0xF958, 0xF958 }, { 0xF959, 0xF959, 0xF959 }, { 0xF95A, 0xF95A, 0xF95A }, { 0xF95B, 0xF95B, 0xF95B }, { 0xF95C, 0xF95C, 0xF95C }, { 0xF95D, 0xF95D, 0xF95D }, { 0xF95E, 0xF95E, 0xF95E }, { 0xF95F, 0xF95F, 0xF95F }, { 0xF960, 0xF960, 0xF960 }, { 0xF961, 0xF961, 0xF961 }, { 0xF962, 0xF962, 0xF962 }, { 0xF963, 0xF963, 0xF963 }, { 0xF964, 0xF964, 0xF964 }, { 0xF965, 0xF965, 0xF965 }, { 0xF966, 0xF966, 0xF966 }, { 0xF967, 0xF967, 0xF967 }, { 0xF968, 0xF968, 0xF968 }, { 0xF969, 0xF969, 0xF969 }, { 0xF96A, 0xF96A, 0xF96A }, { 0xF96B, 0xF96B, 0xF96B }, { 0xF96C, 0xF96C, 0xF96C }, { 0xF96D, 0xF96D, 0xF96D }, { 0xF96E, 0xF96E, 0xF96E }, { 0xF96F, 0xF96F, 0xF96F }, { 0xF970, 0xF970, 0xF970 }, { 0xF971, 0xF971, 0xF971 }, { 0xF972, 0xF972, 0xF972 }, { 0xF973, 0xF973, 0xF973 }, { 0xF974, 0xF974, 0xF974 }, { 0xF975, 0xF975, 0xF975 }, { 0xF976, 0xF976, 0xF976 }, { 0xF977, 0xF977, 0xF977 }, { 0xF978, 0xF978, 0xF978 }, { 0xF979, 0xF979, 0xF979 }, { 0xF97A, 0xF97A, 0xF97A }, { 0xF97B, 0xF97B, 0xF97B }, { 0xF97C, 0xF97C, 0xF97C }, { 0xF97D, 0xF97D, 0xF97D }, { 0xF97E, 0xF97E, 0xF97E }, { 0xF97F, 0xF97F, 0xF97F }, { 0xF980, 0xF980, 0xF980 }, { 0xF981, 0xF981, 0xF981 }, { 0xF982, 0xF982, 0xF982 }, { 0xF983, 0xF983, 0xF983 }, { 0xF984, 0xF984, 0xF984 }, { 0xF985, 0xF985, 0xF985 }, { 0xF986, 0xF986, 0xF986 }, { 0xF987, 0xF987, 0xF987 }, { 0xF988, 0xF988, 0xF988 }, { 0xF989, 0xF989, 0xF989 }, { 0xF98A, 0xF98A, 0xF98A }, { 0xF98B, 0xF98B, 0xF98B }, { 0xF98C, 0xF98C, 0xF98C }, { 0xF98D, 0xF98D, 0xF98D }, { 0xF98E, 0xF98E, 0xF98E }, { 0xF98F, 0xF98F, 0xF98F }, { 0xF990, 0xF990, 0xF990 }, { 0xF991, 0xF991, 0xF991 }, { 0xF992, 0xF992, 0xF992 }, { 0xF993, 0xF993, 0xF993 }, { 0xF994, 0xF994, 0xF994 }, { 0xF995, 0xF995, 0xF995 }, { 0xF996, 0xF996, 0xF996 }, { 0xF997, 0xF997, 0xF997 }, { 0xF998, 0xF998, 0xF998 }, { 0xF999, 0xF999, 0xF999 }, { 0xF99A, 0xF99A, 0xF99A }, { 0xF99B, 0xF99B, 0xF99B }, { 0xF99C, 0xF99C, 0xF99C }, { 0xF99D, 0xF99D, 0xF99D }, { 0xF99E, 0xF99E, 0xF99E }, { 0xF99F, 0xF99F, 0xF99F }, { 0xF9A0, 0xF9A0, 0xF9A0 }, { 0xF9A1, 0xF9A1, 0xF9A1 }, { 0xF9A2, 0xF9A2, 0xF9A2 }, { 0xF9A3, 0xF9A3, 0xF9A3 }, { 0xF9A4, 0xF9A4, 0xF9A4 }, { 0xF9A5, 0xF9A5, 0xF9A5 }, { 0xF9A6, 0xF9A6, 0xF9A6 }, { 0xF9A7, 0xF9A7, 0xF9A7 }, { 0xF9A8, 0xF9A8, 0xF9A8 }, { 0xF9A9, 0xF9A9, 0xF9A9 }, { 0xF9AA, 0xF9AA, 0xF9AA }, { 0xF9AB, 0xF9AB, 0xF9AB }, { 0xF9AC, 0xF9AC, 0xF9AC }, { 0xF9AD, 0xF9AD, 0xF9AD }, { 0xF9AE, 0xF9AE, 0xF9AE }, { 0xF9AF, 0xF9AF, 0xF9AF }, { 0xF9B0, 0xF9B0, 0xF9B0 }, { 0xF9B1, 0xF9B1, 0xF9B1 }, { 0xF9B2, 0xF9B2, 0xF9B2 }, { 0xF9B3, 0xF9B3, 0xF9B3 }, { 0xF9B4, 0xF9B4, 0xF9B4 }, { 0xF9B5, 0xF9B5, 0xF9B5 }, { 0xF9B6, 0xF9B6, 0xF9B6 }, { 0xF9B7, 0xF9B7, 0xF9B7 }, { 0xF9B8, 0xF9B8, 0xF9B8 }, { 0xF9B9, 0xF9B9, 0xF9B9 }, { 0xF9BA, 0xF9BA, 0xF9BA }, { 0xF9BB, 0xF9BB, 0xF9BB }, { 0xF9BC, 0xF9BC, 0xF9BC }, { 0xF9BD, 0xF9BD, 0xF9BD }, { 0xF9BE, 0xF9BE, 0xF9BE }, { 0xF9BF, 0xF9BF, 0xF9BF }, { 0xF9C0, 0xF9C0, 0xF9C0 }, { 0xF9C1, 0xF9C1, 0xF9C1 }, { 0xF9C2, 0xF9C2, 0xF9C2 }, { 0xF9C3, 0xF9C3, 0xF9C3 }, { 0xF9C4, 0xF9C4, 0xF9C4 }, { 0xF9C5, 0xF9C5, 0xF9C5 }, { 0xF9C6, 0xF9C6, 0xF9C6 }, { 0xF9C7, 0xF9C7, 0xF9C7 }, { 0xF9C8, 0xF9C8, 0xF9C8 }, { 0xF9C9, 0xF9C9, 0xF9C9 }, { 0xF9CA, 0xF9CA, 0xF9CA }, { 0xF9CB, 0xF9CB, 0xF9CB }, { 0xF9CC, 0xF9CC, 0xF9CC }, { 0xF9CD, 0xF9CD, 0xF9CD }, { 0xF9CE, 0xF9CE, 0xF9CE }, { 0xF9CF, 0xF9CF, 0xF9CF }, { 0xF9D0, 0xF9D0, 0xF9D0 }, { 0xF9D1, 0xF9D1, 0xF9D1 }, { 0xF9D2, 0xF9D2, 0xF9D2 }, { 0xF9D3, 0xF9D3, 0xF9D3 }, { 0xF9D4, 0xF9D4, 0xF9D4 }, { 0xF9D5, 0xF9D5, 0xF9D5 }, { 0xF9D6, 0xF9D6, 0xF9D6 }, { 0xF9D7, 0xF9D7, 0xF9D7 }, { 0xF9D8, 0xF9D8, 0xF9D8 }, { 0xF9D9, 0xF9D9, 0xF9D9 }, { 0xF9DA, 0xF9DA, 0xF9DA }, { 0xF9DB, 0xF9DB, 0xF9DB }, { 0xF9DC, 0xF9DC, 0xF9DC }, { 0xF9DD, 0xF9DD, 0xF9DD }, { 0xF9DE, 0xF9DE, 0xF9DE }, { 0xF9DF, 0xF9DF, 0xF9DF }, { 0xF9E0, 0xF9E0, 0xF9E0 }, { 0xF9E1, 0xF9E1, 0xF9E1 }, { 0xF9E2, 0xF9E2, 0xF9E2 }, { 0xF9E3, 0xF9E3, 0xF9E3 }, { 0xF9E4, 0xF9E4, 0xF9E4 }, { 0xF9E5, 0xF9E5, 0xF9E5 }, { 0xF9E6, 0xF9E6, 0xF9E6 }, { 0xF9E7, 0xF9E7, 0xF9E7 }, { 0xF9E8, 0xF9E8, 0xF9E8 }, { 0xF9E9, 0xF9E9, 0xF9E9 }, { 0xF9EA, 0xF9EA, 0xF9EA }, { 0xF9EB, 0xF9EB, 0xF9EB }, { 0xF9EC, 0xF9EC, 0xF9EC }, { 0xF9ED, 0xF9ED, 0xF9ED }, { 0xF9EE, 0xF9EE, 0xF9EE }, { 0xF9EF, 0xF9EF, 0xF9EF }, { 0xF9F0, 0xF9F0, 0xF9F0 }, { 0xF9F1, 0xF9F1, 0xF9F1 }, { 0xF9F2, 0xF9F2, 0xF9F2 }, { 0xF9F3, 0xF9F3, 0xF9F3 }, { 0xF9F4, 0xF9F4, 0xF9F4 }, { 0xF9F5, 0xF9F5, 0xF9F5 }, { 0xF9F6, 0xF9F6, 0xF9F6 }, { 0xF9F7, 0xF9F7, 0xF9F7 }, { 0xF9F8, 0xF9F8, 0xF9F8 }, { 0xF9F9, 0xF9F9, 0xF9F9 }, { 0xF9FA, 0xF9FA, 0xF9FA }, { 0xF9FB, 0xF9FB, 0xF9FB }, { 0xF9FC, 0xF9FC, 0xF9FC }, { 0xF9FD, 0xF9FD, 0xF9FD }, { 0xF9FE, 0xF9FE, 0xF9FE }, { 0xF9FF, 0xF9FF, 0xF9FF }, { 0xFA00, 0xFA00, 0xFA00 }, { 0xFA01, 0xFA01, 0xFA01 }, { 0xFA02, 0xFA02, 0xFA02 }, { 0xFA03, 0xFA03, 0xFA03 }, { 0xFA04, 0xFA04, 0xFA04 }, { 0xFA05, 0xFA05, 0xFA05 }, { 0xFA06, 0xFA06, 0xFA06 }, { 0xFA07, 0xFA07, 0xFA07 }, { 0xFA08, 0xFA08, 0xFA08 }, { 0xFA09, 0xFA09, 0xFA09 }, { 0xFA0A, 0xFA0A, 0xFA0A }, { 0xFA0B, 0xFA0B, 0xFA0B }, { 0xFA0C, 0xFA0C, 0xFA0C }, { 0xFA0D, 0xFA0D, 0xFA0D }, { 0xFA0E, 0xFA0E, 0xFA0E }, { 0xFA0F, 0xFA0F, 0xFA0F }, { 0xFA10, 0xFA10, 0xFA10 }, { 0xFA11, 0xFA11, 0xFA11 }, { 0xFA12, 0xFA12, 0xFA12 }, { 0xFA13, 0xFA13, 0xFA13 }, { 0xFA14, 0xFA14, 0xFA14 }, { 0xFA15, 0xFA15, 0xFA15 }, { 0xFA16, 0xFA16, 0xFA16 }, { 0xFA17, 0xFA17, 0xFA17 }, { 0xFA18, 0xFA18, 0xFA18 }, { 0xFA19, 0xFA19, 0xFA19 }, { 0xFA1A, 0xFA1A, 0xFA1A }, { 0xFA1B, 0xFA1B, 0xFA1B }, { 0xFA1C, 0xFA1C, 0xFA1C }, { 0xFA1D, 0xFA1D, 0xFA1D }, { 0xFA1E, 0xFA1E, 0xFA1E }, { 0xFA1F, 0xFA1F, 0xFA1F }, { 0xFA20, 0xFA20, 0xFA20 }, { 0xFA21, 0xFA21, 0xFA21 }, { 0xFA22, 0xFA22, 0xFA22 }, { 0xFA23, 0xFA23, 0xFA23 }, { 0xFA24, 0xFA24, 0xFA24 }, { 0xFA25, 0xFA25, 0xFA25 }, { 0xFA26, 0xFA26, 0xFA26 }, { 0xFA27, 0xFA27, 0xFA27 }, { 0xFA28, 0xFA28, 0xFA28 }, { 0xFA29, 0xFA29, 0xFA29 }, { 0xFA2A, 0xFA2A, 0xFA2A }, { 0xFA2B, 0xFA2B, 0xFA2B }, { 0xFA2C, 0xFA2C, 0xFA2C }, { 0xFA2D, 0xFA2D, 0xFA2D }, { 0xFA30, 0xFA30, 0xFA30 }, { 0xFA31, 0xFA31, 0xFA31 }, { 0xFA32, 0xFA32, 0xFA32 }, { 0xFA33, 0xFA33, 0xFA33 }, { 0xFA34, 0xFA34, 0xFA34 }, { 0xFA35, 0xFA35, 0xFA35 }, { 0xFA36, 0xFA36, 0xFA36 }, { 0xFA37, 0xFA37, 0xFA37 }, { 0xFA38, 0xFA38, 0xFA38 }, { 0xFA39, 0xFA39, 0xFA39 }, { 0xFA3A, 0xFA3A, 0xFA3A }, { 0xFA3B, 0xFA3B, 0xFA3B }, { 0xFA3C, 0xFA3C, 0xFA3C }, { 0xFA3D, 0xFA3D, 0xFA3D }, { 0xFA3E, 0xFA3E, 0xFA3E }, { 0xFA3F, 0xFA3F, 0xFA3F }, { 0xFA40, 0xFA40, 0xFA40 }, { 0xFA41, 0xFA41, 0xFA41 }, { 0xFA42, 0xFA42, 0xFA42 }, { 0xFA43, 0xFA43, 0xFA43 }, { 0xFA44, 0xFA44, 0xFA44 }, { 0xFA45, 0xFA45, 0xFA45 }, { 0xFA46, 0xFA46, 0xFA46 }, { 0xFA47, 0xFA47, 0xFA47 }, { 0xFA48, 0xFA48, 0xFA48 }, { 0xFA49, 0xFA49, 0xFA49 }, { 0xFA4A, 0xFA4A, 0xFA4A }, { 0xFA4B, 0xFA4B, 0xFA4B }, { 0xFA4C, 0xFA4C, 0xFA4C }, { 0xFA4D, 0xFA4D, 0xFA4D }, { 0xFA4E, 0xFA4E, 0xFA4E }, { 0xFA4F, 0xFA4F, 0xFA4F }, { 0xFA50, 0xFA50, 0xFA50 }, { 0xFA51, 0xFA51, 0xFA51 }, { 0xFA52, 0xFA52, 0xFA52 }, { 0xFA53, 0xFA53, 0xFA53 }, { 0xFA54, 0xFA54, 0xFA54 }, { 0xFA55, 0xFA55, 0xFA55 }, { 0xFA56, 0xFA56, 0xFA56 }, { 0xFA57, 0xFA57, 0xFA57 }, { 0xFA58, 0xFA58, 0xFA58 }, { 0xFA59, 0xFA59, 0xFA59 }, { 0xFA5A, 0xFA5A, 0xFA5A }, { 0xFA5B, 0xFA5B, 0xFA5B }, { 0xFA5C, 0xFA5C, 0xFA5C }, { 0xFA5D, 0xFA5D, 0xFA5D }, { 0xFA5E, 0xFA5E, 0xFA5E }, { 0xFA5F, 0xFA5F, 0xFA5F }, { 0xFA60, 0xFA60, 0xFA60 }, { 0xFA61, 0xFA61, 0xFA61 }, { 0xFA62, 0xFA62, 0xFA62 }, { 0xFA63, 0xFA63, 0xFA63 }, { 0xFA64, 0xFA64, 0xFA64 }, { 0xFA65, 0xFA65, 0xFA65 }, { 0xFA66, 0xFA66, 0xFA66 }, { 0xFA67, 0xFA67, 0xFA67 }, { 0xFA68, 0xFA68, 0xFA68 }, { 0xFA69, 0xFA69, 0xFA69 }, { 0xFA6A, 0xFA6A, 0xFA6A }, { 0xFA70, 0xFA70, 0xFA70 }, { 0xFA71, 0xFA71, 0xFA71 }, { 0xFA72, 0xFA72, 0xFA72 }, { 0xFA73, 0xFA73, 0xFA73 }, { 0xFA74, 0xFA74, 0xFA74 }, { 0xFA75, 0xFA75, 0xFA75 }, { 0xFA76, 0xFA76, 0xFA76 }, { 0xFA77, 0xFA77, 0xFA77 }, { 0xFA78, 0xFA78, 0xFA78 }, { 0xFA79, 0xFA79, 0xFA79 }, { 0xFA7A, 0xFA7A, 0xFA7A }, { 0xFA7B, 0xFA7B, 0xFA7B }, { 0xFA7C, 0xFA7C, 0xFA7C }, { 0xFA7D, 0xFA7D, 0xFA7D }, { 0xFA7E, 0xFA7E, 0xFA7E }, { 0xFA7F, 0xFA7F, 0xFA7F }, { 0xFA80, 0xFA80, 0xFA80 }, { 0xFA81, 0xFA81, 0xFA81 }, { 0xFA82, 0xFA82, 0xFA82 }, { 0xFA83, 0xFA83, 0xFA83 }, { 0xFA84, 0xFA84, 0xFA84 }, { 0xFA85, 0xFA85, 0xFA85 }, { 0xFA86, 0xFA86, 0xFA86 }, { 0xFA87, 0xFA87, 0xFA87 }, { 0xFA88, 0xFA88, 0xFA88 }, { 0xFA89, 0xFA89, 0xFA89 }, { 0xFA8A, 0xFA8A, 0xFA8A }, { 0xFA8B, 0xFA8B, 0xFA8B }, { 0xFA8C, 0xFA8C, 0xFA8C }, { 0xFA8D, 0xFA8D, 0xFA8D }, { 0xFA8E, 0xFA8E, 0xFA8E }, { 0xFA8F, 0xFA8F, 0xFA8F }, { 0xFA90, 0xFA90, 0xFA90 }, { 0xFA91, 0xFA91, 0xFA91 }, { 0xFA92, 0xFA92, 0xFA92 }, { 0xFA93, 0xFA93, 0xFA93 }, { 0xFA94, 0xFA94, 0xFA94 }, { 0xFA95, 0xFA95, 0xFA95 }, { 0xFA96, 0xFA96, 0xFA96 }, { 0xFA97, 0xFA97, 0xFA97 }, { 0xFA98, 0xFA98, 0xFA98 }, { 0xFA99, 0xFA99, 0xFA99 }, { 0xFA9A, 0xFA9A, 0xFA9A }, { 0xFA9B, 0xFA9B, 0xFA9B }, { 0xFA9C, 0xFA9C, 0xFA9C }, { 0xFA9D, 0xFA9D, 0xFA9D }, { 0xFA9E, 0xFA9E, 0xFA9E }, { 0xFA9F, 0xFA9F, 0xFA9F }, { 0xFAA0, 0xFAA0, 0xFAA0 }, { 0xFAA1, 0xFAA1, 0xFAA1 }, { 0xFAA2, 0xFAA2, 0xFAA2 }, { 0xFAA3, 0xFAA3, 0xFAA3 }, { 0xFAA4, 0xFAA4, 0xFAA4 }, { 0xFAA5, 0xFAA5, 0xFAA5 }, { 0xFAA6, 0xFAA6, 0xFAA6 }, { 0xFAA7, 0xFAA7, 0xFAA7 }, { 0xFAA8, 0xFAA8, 0xFAA8 }, { 0xFAA9, 0xFAA9, 0xFAA9 }, { 0xFAAA, 0xFAAA, 0xFAAA }, { 0xFAAB, 0xFAAB, 0xFAAB }, { 0xFAAC, 0xFAAC, 0xFAAC }, { 0xFAAD, 0xFAAD, 0xFAAD }, { 0xFAAE, 0xFAAE, 0xFAAE }, { 0xFAAF, 0xFAAF, 0xFAAF }, { 0xFAB0, 0xFAB0, 0xFAB0 }, { 0xFAB1, 0xFAB1, 0xFAB1 }, { 0xFAB2, 0xFAB2, 0xFAB2 }, { 0xFAB3, 0xFAB3, 0xFAB3 }, { 0xFAB4, 0xFAB4, 0xFAB4 }, { 0xFAB5, 0xFAB5, 0xFAB5 }, { 0xFAB6, 0xFAB6, 0xFAB6 }, { 0xFAB7, 0xFAB7, 0xFAB7 }, { 0xFAB8, 0xFAB8, 0xFAB8 }, { 0xFAB9, 0xFAB9, 0xFAB9 }, { 0xFABA, 0xFABA, 0xFABA }, { 0xFABB, 0xFABB, 0xFABB }, { 0xFABC, 0xFABC, 0xFABC }, { 0xFABD, 0xFABD, 0xFABD }, { 0xFABE, 0xFABE, 0xFABE }, { 0xFABF, 0xFABF, 0xFABF }, { 0xFAC0, 0xFAC0, 0xFAC0 }, { 0xFAC1, 0xFAC1, 0xFAC1 }, { 0xFAC2, 0xFAC2, 0xFAC2 }, { 0xFAC3, 0xFAC3, 0xFAC3 }, { 0xFAC4, 0xFAC4, 0xFAC4 }, { 0xFAC5, 0xFAC5, 0xFAC5 }, { 0xFAC6, 0xFAC6, 0xFAC6 }, { 0xFAC7, 0xFAC7, 0xFAC7 }, { 0xFAC8, 0xFAC8, 0xFAC8 }, { 0xFAC9, 0xFAC9, 0xFAC9 }, { 0xFACA, 0xFACA, 0xFACA }, { 0xFACB, 0xFACB, 0xFACB }, { 0xFACC, 0xFACC, 0xFACC }, { 0xFACD, 0xFACD, 0xFACD }, { 0xFACE, 0xFACE, 0xFACE }, { 0xFACF, 0xFACF, 0xFACF }, { 0xFAD0, 0xFAD0, 0xFAD0 }, { 0xFAD1, 0xFAD1, 0xFAD1 }, { 0xFAD2, 0xFAD2, 0xFAD2 }, { 0xFAD3, 0xFAD3, 0xFAD3 }, { 0xFAD4, 0xFAD4, 0xFAD4 }, { 0xFAD5, 0xFAD5, 0xFAD5 }, { 0xFAD6, 0xFAD6, 0xFAD6 }, { 0xFAD7, 0xFAD7, 0xFAD7 }, { 0xFAD8, 0xFAD8, 0xFAD8 }, { 0xFAD9, 0xFAD9, 0xFAD9 }, { 0xFB00, 0xFB00, 0xFB00 }, { 0xFB01, 0xFB01, 0xFB01 }, { 0xFB02, 0xFB02, 0xFB02 }, { 0xFB03, 0xFB03, 0xFB03 }, { 0xFB04, 0xFB04, 0xFB04 }, { 0xFB05, 0xFB05, 0xFB05 }, { 0xFB06, 0xFB06, 0xFB06 }, { 0xFB13, 0xFB13, 0xFB13 }, { 0xFB14, 0xFB14, 0xFB14 }, { 0xFB15, 0xFB15, 0xFB15 }, { 0xFB16, 0xFB16, 0xFB16 }, { 0xFB17, 0xFB17, 0xFB17 }, { 0xFB1D, 0xFB1D, 0xFB1D }, { 0xFB1E, 0xFB1E, 0xFB1E }, { 0xFB1F, 0xFB1F, 0xFB1F }, { 0xFB20, 0xFB20, 0xFB20 }, { 0xFB21, 0xFB21, 0xFB21 }, { 0xFB22, 0xFB22, 0xFB22 }, { 0xFB23, 0xFB23, 0xFB23 }, { 0xFB24, 0xFB24, 0xFB24 }, { 0xFB25, 0xFB25, 0xFB25 }, { 0xFB26, 0xFB26, 0xFB26 }, { 0xFB27, 0xFB27, 0xFB27 }, { 0xFB28, 0xFB28, 0xFB28 }, { 0xFB2A, 0xFB2A, 0xFB2A }, { 0xFB2B, 0xFB2B, 0xFB2B }, { 0xFB2C, 0xFB2C, 0xFB2C }, { 0xFB2D, 0xFB2D, 0xFB2D }, { 0xFB2E, 0xFB2E, 0xFB2E }, { 0xFB2F, 0xFB2F, 0xFB2F }, { 0xFB30, 0xFB30, 0xFB30 }, { 0xFB31, 0xFB31, 0xFB31 }, { 0xFB32, 0xFB32, 0xFB32 }, { 0xFB33, 0xFB33, 0xFB33 }, { 0xFB34, 0xFB34, 0xFB34 }, { 0xFB35, 0xFB35, 0xFB35 }, { 0xFB36, 0xFB36, 0xFB36 }, { 0xFB38, 0xFB38, 0xFB38 }, { 0xFB39, 0xFB39, 0xFB39 }, { 0xFB3A, 0xFB3A, 0xFB3A }, { 0xFB3B, 0xFB3B, 0xFB3B }, { 0xFB3C, 0xFB3C, 0xFB3C }, { 0xFB3E, 0xFB3E, 0xFB3E }, { 0xFB40, 0xFB40, 0xFB40 }, { 0xFB41, 0xFB41, 0xFB41 }, { 0xFB43, 0xFB43, 0xFB43 }, { 0xFB44, 0xFB44, 0xFB44 }, { 0xFB46, 0xFB46, 0xFB46 }, { 0xFB47, 0xFB47, 0xFB47 }, { 0xFB48, 0xFB48, 0xFB48 }, { 0xFB49, 0xFB49, 0xFB49 }, { 0xFB4A, 0xFB4A, 0xFB4A }, { 0xFB4B, 0xFB4B, 0xFB4B }, { 0xFB4C, 0xFB4C, 0xFB4C }, { 0xFB4D, 0xFB4D, 0xFB4D }, { 0xFB4E, 0xFB4E, 0xFB4E }, { 0xFB4F, 0xFB4F, 0xFB4F }, { 0xFB50, 0xFB50, 0xFB50 }, { 0xFB51, 0xFB51, 0xFB51 }, { 0xFB52, 0xFB52, 0xFB52 }, { 0xFB53, 0xFB53, 0xFB53 }, { 0xFB54, 0xFB54, 0xFB54 }, { 0xFB55, 0xFB55, 0xFB55 }, { 0xFB56, 0xFB56, 0xFB56 }, { 0xFB57, 0xFB57, 0xFB57 }, { 0xFB58, 0xFB58, 0xFB58 }, { 0xFB59, 0xFB59, 0xFB59 }, { 0xFB5A, 0xFB5A, 0xFB5A }, { 0xFB5B, 0xFB5B, 0xFB5B }, { 0xFB5C, 0xFB5C, 0xFB5C }, { 0xFB5D, 0xFB5D, 0xFB5D }, { 0xFB5E, 0xFB5E, 0xFB5E }, { 0xFB5F, 0xFB5F, 0xFB5F }, { 0xFB60, 0xFB60, 0xFB60 }, { 0xFB61, 0xFB61, 0xFB61 }, { 0xFB62, 0xFB62, 0xFB62 }, { 0xFB63, 0xFB63, 0xFB63 }, { 0xFB64, 0xFB64, 0xFB64 }, { 0xFB65, 0xFB65, 0xFB65 }, { 0xFB66, 0xFB66, 0xFB66 }, { 0xFB67, 0xFB67, 0xFB67 }, { 0xFB68, 0xFB68, 0xFB68 }, { 0xFB69, 0xFB69, 0xFB69 }, { 0xFB6A, 0xFB6A, 0xFB6A }, { 0xFB6B, 0xFB6B, 0xFB6B }, { 0xFB6C, 0xFB6C, 0xFB6C }, { 0xFB6D, 0xFB6D, 0xFB6D }, { 0xFB6E, 0xFB6E, 0xFB6E }, { 0xFB6F, 0xFB6F, 0xFB6F }, { 0xFB70, 0xFB70, 0xFB70 }, { 0xFB71, 0xFB71, 0xFB71 }, { 0xFB72, 0xFB72, 0xFB72 }, { 0xFB73, 0xFB73, 0xFB73 }, { 0xFB74, 0xFB74, 0xFB74 }, { 0xFB75, 0xFB75, 0xFB75 }, { 0xFB76, 0xFB76, 0xFB76 }, { 0xFB77, 0xFB77, 0xFB77 }, { 0xFB78, 0xFB78, 0xFB78 }, { 0xFB79, 0xFB79, 0xFB79 }, { 0xFB7A, 0xFB7A, 0xFB7A }, { 0xFB7B, 0xFB7B, 0xFB7B }, { 0xFB7C, 0xFB7C, 0xFB7C }, { 0xFB7D, 0xFB7D, 0xFB7D }, { 0xFB7E, 0xFB7E, 0xFB7E }, { 0xFB7F, 0xFB7F, 0xFB7F }, { 0xFB80, 0xFB80, 0xFB80 }, { 0xFB81, 0xFB81, 0xFB81 }, { 0xFB82, 0xFB82, 0xFB82 }, { 0xFB83, 0xFB83, 0xFB83 }, { 0xFB84, 0xFB84, 0xFB84 }, { 0xFB85, 0xFB85, 0xFB85 }, { 0xFB86, 0xFB86, 0xFB86 }, { 0xFB87, 0xFB87, 0xFB87 }, { 0xFB88, 0xFB88, 0xFB88 }, { 0xFB89, 0xFB89, 0xFB89 }, { 0xFB8A, 0xFB8A, 0xFB8A }, { 0xFB8B, 0xFB8B, 0xFB8B }, { 0xFB8C, 0xFB8C, 0xFB8C }, { 0xFB8D, 0xFB8D, 0xFB8D }, { 0xFB8E, 0xFB8E, 0xFB8E }, { 0xFB8F, 0xFB8F, 0xFB8F }, { 0xFB90, 0xFB90, 0xFB90 }, { 0xFB91, 0xFB91, 0xFB91 }, { 0xFB92, 0xFB92, 0xFB92 }, { 0xFB93, 0xFB93, 0xFB93 }, { 0xFB94, 0xFB94, 0xFB94 }, { 0xFB95, 0xFB95, 0xFB95 }, { 0xFB96, 0xFB96, 0xFB96 }, { 0xFB97, 0xFB97, 0xFB97 }, { 0xFB98, 0xFB98, 0xFB98 }, { 0xFB99, 0xFB99, 0xFB99 }, { 0xFB9A, 0xFB9A, 0xFB9A }, { 0xFB9B, 0xFB9B, 0xFB9B }, { 0xFB9C, 0xFB9C, 0xFB9C }, { 0xFB9D, 0xFB9D, 0xFB9D }, { 0xFB9E, 0xFB9E, 0xFB9E }, { 0xFB9F, 0xFB9F, 0xFB9F }, { 0xFBA0, 0xFBA0, 0xFBA0 }, { 0xFBA1, 0xFBA1, 0xFBA1 }, { 0xFBA2, 0xFBA2, 0xFBA2 }, { 0xFBA3, 0xFBA3, 0xFBA3 }, { 0xFBA4, 0xFBA4, 0xFBA4 }, { 0xFBA5, 0xFBA5, 0xFBA5 }, { 0xFBA6, 0xFBA6, 0xFBA6 }, { 0xFBA7, 0xFBA7, 0xFBA7 }, { 0xFBA8, 0xFBA8, 0xFBA8 }, { 0xFBA9, 0xFBA9, 0xFBA9 }, { 0xFBAA, 0xFBAA, 0xFBAA }, { 0xFBAB, 0xFBAB, 0xFBAB }, { 0xFBAC, 0xFBAC, 0xFBAC }, { 0xFBAD, 0xFBAD, 0xFBAD }, { 0xFBAE, 0xFBAE, 0xFBAE }, { 0xFBAF, 0xFBAF, 0xFBAF }, { 0xFBB0, 0xFBB0, 0xFBB0 }, { 0xFBB1, 0xFBB1, 0xFBB1 }, { 0xFBD3, 0xFBD3, 0xFBD3 }, { 0xFBD4, 0xFBD4, 0xFBD4 }, { 0xFBD5, 0xFBD5, 0xFBD5 }, { 0xFBD6, 0xFBD6, 0xFBD6 }, { 0xFBD7, 0xFBD7, 0xFBD7 }, { 0xFBD8, 0xFBD8, 0xFBD8 }, { 0xFBD9, 0xFBD9, 0xFBD9 }, { 0xFBDA, 0xFBDA, 0xFBDA }, { 0xFBDB, 0xFBDB, 0xFBDB }, { 0xFBDC, 0xFBDC, 0xFBDC }, { 0xFBDD, 0xFBDD, 0xFBDD }, { 0xFBDE, 0xFBDE, 0xFBDE }, { 0xFBDF, 0xFBDF, 0xFBDF }, { 0xFBE0, 0xFBE0, 0xFBE0 }, { 0xFBE1, 0xFBE1, 0xFBE1 }, { 0xFBE2, 0xFBE2, 0xFBE2 }, { 0xFBE3, 0xFBE3, 0xFBE3 }, { 0xFBE4, 0xFBE4, 0xFBE4 }, { 0xFBE5, 0xFBE5, 0xFBE5 }, { 0xFBE6, 0xFBE6, 0xFBE6 }, { 0xFBE7, 0xFBE7, 0xFBE7 }, { 0xFBE8, 0xFBE8, 0xFBE8 }, { 0xFBE9, 0xFBE9, 0xFBE9 }, { 0xFBEA, 0xFBEA, 0xFBEA }, { 0xFBEB, 0xFBEB, 0xFBEB }, { 0xFBEC, 0xFBEC, 0xFBEC }, { 0xFBED, 0xFBED, 0xFBED }, { 0xFBEE, 0xFBEE, 0xFBEE }, { 0xFBEF, 0xFBEF, 0xFBEF }, { 0xFBF0, 0xFBF0, 0xFBF0 }, { 0xFBF1, 0xFBF1, 0xFBF1 }, { 0xFBF2, 0xFBF2, 0xFBF2 }, { 0xFBF3, 0xFBF3, 0xFBF3 }, { 0xFBF4, 0xFBF4, 0xFBF4 }, { 0xFBF5, 0xFBF5, 0xFBF5 }, { 0xFBF6, 0xFBF6, 0xFBF6 }, { 0xFBF7, 0xFBF7, 0xFBF7 }, { 0xFBF8, 0xFBF8, 0xFBF8 }, { 0xFBF9, 0xFBF9, 0xFBF9 }, { 0xFBFA, 0xFBFA, 0xFBFA }, { 0xFBFB, 0xFBFB, 0xFBFB }, { 0xFBFC, 0xFBFC, 0xFBFC }, { 0xFBFD, 0xFBFD, 0xFBFD }, { 0xFBFE, 0xFBFE, 0xFBFE }, { 0xFBFF, 0xFBFF, 0xFBFF }, { 0xFC00, 0xFC00, 0xFC00 }, { 0xFC01, 0xFC01, 0xFC01 }, { 0xFC02, 0xFC02, 0xFC02 }, { 0xFC03, 0xFC03, 0xFC03 }, { 0xFC04, 0xFC04, 0xFC04 }, { 0xFC05, 0xFC05, 0xFC05 }, { 0xFC06, 0xFC06, 0xFC06 }, { 0xFC07, 0xFC07, 0xFC07 }, { 0xFC08, 0xFC08, 0xFC08 }, { 0xFC09, 0xFC09, 0xFC09 }, { 0xFC0A, 0xFC0A, 0xFC0A }, { 0xFC0B, 0xFC0B, 0xFC0B }, { 0xFC0C, 0xFC0C, 0xFC0C }, { 0xFC0D, 0xFC0D, 0xFC0D }, { 0xFC0E, 0xFC0E, 0xFC0E }, { 0xFC0F, 0xFC0F, 0xFC0F }, { 0xFC10, 0xFC10, 0xFC10 }, { 0xFC11, 0xFC11, 0xFC11 }, { 0xFC12, 0xFC12, 0xFC12 }, { 0xFC13, 0xFC13, 0xFC13 }, { 0xFC14, 0xFC14, 0xFC14 }, { 0xFC15, 0xFC15, 0xFC15 }, { 0xFC16, 0xFC16, 0xFC16 }, { 0xFC17, 0xFC17, 0xFC17 }, { 0xFC18, 0xFC18, 0xFC18 }, { 0xFC19, 0xFC19, 0xFC19 }, { 0xFC1A, 0xFC1A, 0xFC1A }, { 0xFC1B, 0xFC1B, 0xFC1B }, { 0xFC1C, 0xFC1C, 0xFC1C }, { 0xFC1D, 0xFC1D, 0xFC1D }, { 0xFC1E, 0xFC1E, 0xFC1E }, { 0xFC1F, 0xFC1F, 0xFC1F }, { 0xFC20, 0xFC20, 0xFC20 }, { 0xFC21, 0xFC21, 0xFC21 }, { 0xFC22, 0xFC22, 0xFC22 }, { 0xFC23, 0xFC23, 0xFC23 }, { 0xFC24, 0xFC24, 0xFC24 }, { 0xFC25, 0xFC25, 0xFC25 }, { 0xFC26, 0xFC26, 0xFC26 }, { 0xFC27, 0xFC27, 0xFC27 }, { 0xFC28, 0xFC28, 0xFC28 }, { 0xFC29, 0xFC29, 0xFC29 }, { 0xFC2A, 0xFC2A, 0xFC2A }, { 0xFC2B, 0xFC2B, 0xFC2B }, { 0xFC2C, 0xFC2C, 0xFC2C }, { 0xFC2D, 0xFC2D, 0xFC2D }, { 0xFC2E, 0xFC2E, 0xFC2E }, { 0xFC2F, 0xFC2F, 0xFC2F }, { 0xFC30, 0xFC30, 0xFC30 }, { 0xFC31, 0xFC31, 0xFC31 }, { 0xFC32, 0xFC32, 0xFC32 }, { 0xFC33, 0xFC33, 0xFC33 }, { 0xFC34, 0xFC34, 0xFC34 }, { 0xFC35, 0xFC35, 0xFC35 }, { 0xFC36, 0xFC36, 0xFC36 }, { 0xFC37, 0xFC37, 0xFC37 }, { 0xFC38, 0xFC38, 0xFC38 }, { 0xFC39, 0xFC39, 0xFC39 }, { 0xFC3A, 0xFC3A, 0xFC3A }, { 0xFC3B, 0xFC3B, 0xFC3B }, { 0xFC3C, 0xFC3C, 0xFC3C }, { 0xFC3D, 0xFC3D, 0xFC3D }, { 0xFC3E, 0xFC3E, 0xFC3E }, { 0xFC3F, 0xFC3F, 0xFC3F }, { 0xFC40, 0xFC40, 0xFC40 }, { 0xFC41, 0xFC41, 0xFC41 }, { 0xFC42, 0xFC42, 0xFC42 }, { 0xFC43, 0xFC43, 0xFC43 }, { 0xFC44, 0xFC44, 0xFC44 }, { 0xFC45, 0xFC45, 0xFC45 }, { 0xFC46, 0xFC46, 0xFC46 }, { 0xFC47, 0xFC47, 0xFC47 }, { 0xFC48, 0xFC48, 0xFC48 }, { 0xFC49, 0xFC49, 0xFC49 }, { 0xFC4A, 0xFC4A, 0xFC4A }, { 0xFC4B, 0xFC4B, 0xFC4B }, { 0xFC4C, 0xFC4C, 0xFC4C }, { 0xFC4D, 0xFC4D, 0xFC4D }, { 0xFC4E, 0xFC4E, 0xFC4E }, { 0xFC4F, 0xFC4F, 0xFC4F }, { 0xFC50, 0xFC50, 0xFC50 }, { 0xFC51, 0xFC51, 0xFC51 }, { 0xFC52, 0xFC52, 0xFC52 }, { 0xFC53, 0xFC53, 0xFC53 }, { 0xFC54, 0xFC54, 0xFC54 }, { 0xFC55, 0xFC55, 0xFC55 }, { 0xFC56, 0xFC56, 0xFC56 }, { 0xFC57, 0xFC57, 0xFC57 }, { 0xFC58, 0xFC58, 0xFC58 }, { 0xFC59, 0xFC59, 0xFC59 }, { 0xFC5A, 0xFC5A, 0xFC5A }, { 0xFC5B, 0xFC5B, 0xFC5B }, { 0xFC5C, 0xFC5C, 0xFC5C }, { 0xFC5D, 0xFC5D, 0xFC5D }, { 0xFC5E, 0xFC5E, 0xFC5E }, { 0xFC5F, 0xFC5F, 0xFC5F }, { 0xFC60, 0xFC60, 0xFC60 }, { 0xFC61, 0xFC61, 0xFC61 }, { 0xFC62, 0xFC62, 0xFC62 }, { 0xFC63, 0xFC63, 0xFC63 }, { 0xFC64, 0xFC64, 0xFC64 }, { 0xFC65, 0xFC65, 0xFC65 }, { 0xFC66, 0xFC66, 0xFC66 }, { 0xFC67, 0xFC67, 0xFC67 }, { 0xFC68, 0xFC68, 0xFC68 }, { 0xFC69, 0xFC69, 0xFC69 }, { 0xFC6A, 0xFC6A, 0xFC6A }, { 0xFC6B, 0xFC6B, 0xFC6B }, { 0xFC6C, 0xFC6C, 0xFC6C }, { 0xFC6D, 0xFC6D, 0xFC6D }, { 0xFC6E, 0xFC6E, 0xFC6E }, { 0xFC6F, 0xFC6F, 0xFC6F }, { 0xFC70, 0xFC70, 0xFC70 }, { 0xFC71, 0xFC71, 0xFC71 }, { 0xFC72, 0xFC72, 0xFC72 }, { 0xFC73, 0xFC73, 0xFC73 }, { 0xFC74, 0xFC74, 0xFC74 }, { 0xFC75, 0xFC75, 0xFC75 }, { 0xFC76, 0xFC76, 0xFC76 }, { 0xFC77, 0xFC77, 0xFC77 }, { 0xFC78, 0xFC78, 0xFC78 }, { 0xFC79, 0xFC79, 0xFC79 }, { 0xFC7A, 0xFC7A, 0xFC7A }, { 0xFC7B, 0xFC7B, 0xFC7B }, { 0xFC7C, 0xFC7C, 0xFC7C }, { 0xFC7D, 0xFC7D, 0xFC7D }, { 0xFC7E, 0xFC7E, 0xFC7E }, { 0xFC7F, 0xFC7F, 0xFC7F }, { 0xFC80, 0xFC80, 0xFC80 }, { 0xFC81, 0xFC81, 0xFC81 }, { 0xFC82, 0xFC82, 0xFC82 }, { 0xFC83, 0xFC83, 0xFC83 }, { 0xFC84, 0xFC84, 0xFC84 }, { 0xFC85, 0xFC85, 0xFC85 }, { 0xFC86, 0xFC86, 0xFC86 }, { 0xFC87, 0xFC87, 0xFC87 }, { 0xFC88, 0xFC88, 0xFC88 }, { 0xFC89, 0xFC89, 0xFC89 }, { 0xFC8A, 0xFC8A, 0xFC8A }, { 0xFC8B, 0xFC8B, 0xFC8B }, { 0xFC8C, 0xFC8C, 0xFC8C }, { 0xFC8D, 0xFC8D, 0xFC8D }, { 0xFC8E, 0xFC8E, 0xFC8E }, { 0xFC8F, 0xFC8F, 0xFC8F }, { 0xFC90, 0xFC90, 0xFC90 }, { 0xFC91, 0xFC91, 0xFC91 }, { 0xFC92, 0xFC92, 0xFC92 }, { 0xFC93, 0xFC93, 0xFC93 }, { 0xFC94, 0xFC94, 0xFC94 }, { 0xFC95, 0xFC95, 0xFC95 }, { 0xFC96, 0xFC96, 0xFC96 }, { 0xFC97, 0xFC97, 0xFC97 }, { 0xFC98, 0xFC98, 0xFC98 }, { 0xFC99, 0xFC99, 0xFC99 }, { 0xFC9A, 0xFC9A, 0xFC9A }, { 0xFC9B, 0xFC9B, 0xFC9B }, { 0xFC9C, 0xFC9C, 0xFC9C }, { 0xFC9D, 0xFC9D, 0xFC9D }, { 0xFC9E, 0xFC9E, 0xFC9E }, { 0xFC9F, 0xFC9F, 0xFC9F }, { 0xFCA0, 0xFCA0, 0xFCA0 }, { 0xFCA1, 0xFCA1, 0xFCA1 }, { 0xFCA2, 0xFCA2, 0xFCA2 }, { 0xFCA3, 0xFCA3, 0xFCA3 }, { 0xFCA4, 0xFCA4, 0xFCA4 }, { 0xFCA5, 0xFCA5, 0xFCA5 }, { 0xFCA6, 0xFCA6, 0xFCA6 }, { 0xFCA7, 0xFCA7, 0xFCA7 }, { 0xFCA8, 0xFCA8, 0xFCA8 }, { 0xFCA9, 0xFCA9, 0xFCA9 }, { 0xFCAA, 0xFCAA, 0xFCAA }, { 0xFCAB, 0xFCAB, 0xFCAB }, { 0xFCAC, 0xFCAC, 0xFCAC }, { 0xFCAD, 0xFCAD, 0xFCAD }, { 0xFCAE, 0xFCAE, 0xFCAE }, { 0xFCAF, 0xFCAF, 0xFCAF }, { 0xFCB0, 0xFCB0, 0xFCB0 }, { 0xFCB1, 0xFCB1, 0xFCB1 }, { 0xFCB2, 0xFCB2, 0xFCB2 }, { 0xFCB3, 0xFCB3, 0xFCB3 }, { 0xFCB4, 0xFCB4, 0xFCB4 }, { 0xFCB5, 0xFCB5, 0xFCB5 }, { 0xFCB6, 0xFCB6, 0xFCB6 }, { 0xFCB7, 0xFCB7, 0xFCB7 }, { 0xFCB8, 0xFCB8, 0xFCB8 }, { 0xFCB9, 0xFCB9, 0xFCB9 }, { 0xFCBA, 0xFCBA, 0xFCBA }, { 0xFCBB, 0xFCBB, 0xFCBB }, { 0xFCBC, 0xFCBC, 0xFCBC }, { 0xFCBD, 0xFCBD, 0xFCBD }, { 0xFCBE, 0xFCBE, 0xFCBE }, { 0xFCBF, 0xFCBF, 0xFCBF }, { 0xFCC0, 0xFCC0, 0xFCC0 }, { 0xFCC1, 0xFCC1, 0xFCC1 }, { 0xFCC2, 0xFCC2, 0xFCC2 }, { 0xFCC3, 0xFCC3, 0xFCC3 }, { 0xFCC4, 0xFCC4, 0xFCC4 }, { 0xFCC5, 0xFCC5, 0xFCC5 }, { 0xFCC6, 0xFCC6, 0xFCC6 }, { 0xFCC7, 0xFCC7, 0xFCC7 }, { 0xFCC8, 0xFCC8, 0xFCC8 }, { 0xFCC9, 0xFCC9, 0xFCC9 }, { 0xFCCA, 0xFCCA, 0xFCCA }, { 0xFCCB, 0xFCCB, 0xFCCB }, { 0xFCCC, 0xFCCC, 0xFCCC }, { 0xFCCD, 0xFCCD, 0xFCCD }, { 0xFCCE, 0xFCCE, 0xFCCE }, { 0xFCCF, 0xFCCF, 0xFCCF }, { 0xFCD0, 0xFCD0, 0xFCD0 }, { 0xFCD1, 0xFCD1, 0xFCD1 }, { 0xFCD2, 0xFCD2, 0xFCD2 }, { 0xFCD3, 0xFCD3, 0xFCD3 }, { 0xFCD4, 0xFCD4, 0xFCD4 }, { 0xFCD5, 0xFCD5, 0xFCD5 }, { 0xFCD6, 0xFCD6, 0xFCD6 }, { 0xFCD7, 0xFCD7, 0xFCD7 }, { 0xFCD8, 0xFCD8, 0xFCD8 }, { 0xFCD9, 0xFCD9, 0xFCD9 }, { 0xFCDA, 0xFCDA, 0xFCDA }, { 0xFCDB, 0xFCDB, 0xFCDB }, { 0xFCDC, 0xFCDC, 0xFCDC }, { 0xFCDD, 0xFCDD, 0xFCDD }, { 0xFCDE, 0xFCDE, 0xFCDE }, { 0xFCDF, 0xFCDF, 0xFCDF }, { 0xFCE0, 0xFCE0, 0xFCE0 }, { 0xFCE1, 0xFCE1, 0xFCE1 }, { 0xFCE2, 0xFCE2, 0xFCE2 }, { 0xFCE3, 0xFCE3, 0xFCE3 }, { 0xFCE4, 0xFCE4, 0xFCE4 }, { 0xFCE5, 0xFCE5, 0xFCE5 }, { 0xFCE6, 0xFCE6, 0xFCE6 }, { 0xFCE7, 0xFCE7, 0xFCE7 }, { 0xFCE8, 0xFCE8, 0xFCE8 }, { 0xFCE9, 0xFCE9, 0xFCE9 }, { 0xFCEA, 0xFCEA, 0xFCEA }, { 0xFCEB, 0xFCEB, 0xFCEB }, { 0xFCEC, 0xFCEC, 0xFCEC }, { 0xFCED, 0xFCED, 0xFCED }, { 0xFCEE, 0xFCEE, 0xFCEE }, { 0xFCEF, 0xFCEF, 0xFCEF }, { 0xFCF0, 0xFCF0, 0xFCF0 }, { 0xFCF1, 0xFCF1, 0xFCF1 }, { 0xFCF2, 0xFCF2, 0xFCF2 }, { 0xFCF3, 0xFCF3, 0xFCF3 }, { 0xFCF4, 0xFCF4, 0xFCF4 }, { 0xFCF5, 0xFCF5, 0xFCF5 }, { 0xFCF6, 0xFCF6, 0xFCF6 }, { 0xFCF7, 0xFCF7, 0xFCF7 }, { 0xFCF8, 0xFCF8, 0xFCF8 }, { 0xFCF9, 0xFCF9, 0xFCF9 }, { 0xFCFA, 0xFCFA, 0xFCFA }, { 0xFCFB, 0xFCFB, 0xFCFB }, { 0xFCFC, 0xFCFC, 0xFCFC }, { 0xFCFD, 0xFCFD, 0xFCFD }, { 0xFCFE, 0xFCFE, 0xFCFE }, { 0xFCFF, 0xFCFF, 0xFCFF }, { 0xFD00, 0xFD00, 0xFD00 }, { 0xFD01, 0xFD01, 0xFD01 }, { 0xFD02, 0xFD02, 0xFD02 }, { 0xFD03, 0xFD03, 0xFD03 }, { 0xFD04, 0xFD04, 0xFD04 }, { 0xFD05, 0xFD05, 0xFD05 }, { 0xFD06, 0xFD06, 0xFD06 }, { 0xFD07, 0xFD07, 0xFD07 }, { 0xFD08, 0xFD08, 0xFD08 }, { 0xFD09, 0xFD09, 0xFD09 }, { 0xFD0A, 0xFD0A, 0xFD0A }, { 0xFD0B, 0xFD0B, 0xFD0B }, { 0xFD0C, 0xFD0C, 0xFD0C }, { 0xFD0D, 0xFD0D, 0xFD0D }, { 0xFD0E, 0xFD0E, 0xFD0E }, { 0xFD0F, 0xFD0F, 0xFD0F }, { 0xFD10, 0xFD10, 0xFD10 }, { 0xFD11, 0xFD11, 0xFD11 }, { 0xFD12, 0xFD12, 0xFD12 }, { 0xFD13, 0xFD13, 0xFD13 }, { 0xFD14, 0xFD14, 0xFD14 }, { 0xFD15, 0xFD15, 0xFD15 }, { 0xFD16, 0xFD16, 0xFD16 }, { 0xFD17, 0xFD17, 0xFD17 }, { 0xFD18, 0xFD18, 0xFD18 }, { 0xFD19, 0xFD19, 0xFD19 }, { 0xFD1A, 0xFD1A, 0xFD1A }, { 0xFD1B, 0xFD1B, 0xFD1B }, { 0xFD1C, 0xFD1C, 0xFD1C }, { 0xFD1D, 0xFD1D, 0xFD1D }, { 0xFD1E, 0xFD1E, 0xFD1E }, { 0xFD1F, 0xFD1F, 0xFD1F }, { 0xFD20, 0xFD20, 0xFD20 }, { 0xFD21, 0xFD21, 0xFD21 }, { 0xFD22, 0xFD22, 0xFD22 }, { 0xFD23, 0xFD23, 0xFD23 }, { 0xFD24, 0xFD24, 0xFD24 }, { 0xFD25, 0xFD25, 0xFD25 }, { 0xFD26, 0xFD26, 0xFD26 }, { 0xFD27, 0xFD27, 0xFD27 }, { 0xFD28, 0xFD28, 0xFD28 }, { 0xFD29, 0xFD29, 0xFD29 }, { 0xFD2A, 0xFD2A, 0xFD2A }, { 0xFD2B, 0xFD2B, 0xFD2B }, { 0xFD2C, 0xFD2C, 0xFD2C }, { 0xFD2D, 0xFD2D, 0xFD2D }, { 0xFD2E, 0xFD2E, 0xFD2E }, { 0xFD2F, 0xFD2F, 0xFD2F }, { 0xFD30, 0xFD30, 0xFD30 }, { 0xFD31, 0xFD31, 0xFD31 }, { 0xFD32, 0xFD32, 0xFD32 }, { 0xFD33, 0xFD33, 0xFD33 }, { 0xFD34, 0xFD34, 0xFD34 }, { 0xFD35, 0xFD35, 0xFD35 }, { 0xFD36, 0xFD36, 0xFD36 }, { 0xFD37, 0xFD37, 0xFD37 }, { 0xFD38, 0xFD38, 0xFD38 }, { 0xFD39, 0xFD39, 0xFD39 }, { 0xFD3A, 0xFD3A, 0xFD3A }, { 0xFD3B, 0xFD3B, 0xFD3B }, { 0xFD3C, 0xFD3C, 0xFD3C }, { 0xFD3D, 0xFD3D, 0xFD3D }, { 0xFD50, 0xFD50, 0xFD50 }, { 0xFD51, 0xFD51, 0xFD51 }, { 0xFD52, 0xFD52, 0xFD52 }, { 0xFD53, 0xFD53, 0xFD53 }, { 0xFD54, 0xFD54, 0xFD54 }, { 0xFD55, 0xFD55, 0xFD55 }, { 0xFD56, 0xFD56, 0xFD56 }, { 0xFD57, 0xFD57, 0xFD57 }, { 0xFD58, 0xFD58, 0xFD58 }, { 0xFD59, 0xFD59, 0xFD59 }, { 0xFD5A, 0xFD5A, 0xFD5A }, { 0xFD5B, 0xFD5B, 0xFD5B }, { 0xFD5C, 0xFD5C, 0xFD5C }, { 0xFD5D, 0xFD5D, 0xFD5D }, { 0xFD5E, 0xFD5E, 0xFD5E }, { 0xFD5F, 0xFD5F, 0xFD5F }, { 0xFD60, 0xFD60, 0xFD60 }, { 0xFD61, 0xFD61, 0xFD61 }, { 0xFD62, 0xFD62, 0xFD62 }, { 0xFD63, 0xFD63, 0xFD63 }, { 0xFD64, 0xFD64, 0xFD64 }, { 0xFD65, 0xFD65, 0xFD65 }, { 0xFD66, 0xFD66, 0xFD66 }, { 0xFD67, 0xFD67, 0xFD67 }, { 0xFD68, 0xFD68, 0xFD68 }, { 0xFD69, 0xFD69, 0xFD69 }, { 0xFD6A, 0xFD6A, 0xFD6A }, { 0xFD6B, 0xFD6B, 0xFD6B }, { 0xFD6C, 0xFD6C, 0xFD6C }, { 0xFD6D, 0xFD6D, 0xFD6D }, { 0xFD6E, 0xFD6E, 0xFD6E }, { 0xFD6F, 0xFD6F, 0xFD6F }, { 0xFD70, 0xFD70, 0xFD70 }, { 0xFD71, 0xFD71, 0xFD71 }, { 0xFD72, 0xFD72, 0xFD72 }, { 0xFD73, 0xFD73, 0xFD73 }, { 0xFD74, 0xFD74, 0xFD74 }, { 0xFD75, 0xFD75, 0xFD75 }, { 0xFD76, 0xFD76, 0xFD76 }, { 0xFD77, 0xFD77, 0xFD77 }, { 0xFD78, 0xFD78, 0xFD78 }, { 0xFD79, 0xFD79, 0xFD79 }, { 0xFD7A, 0xFD7A, 0xFD7A }, { 0xFD7B, 0xFD7B, 0xFD7B }, { 0xFD7C, 0xFD7C, 0xFD7C }, { 0xFD7D, 0xFD7D, 0xFD7D }, { 0xFD7E, 0xFD7E, 0xFD7E }, { 0xFD7F, 0xFD7F, 0xFD7F }, { 0xFD80, 0xFD80, 0xFD80 }, { 0xFD81, 0xFD81, 0xFD81 }, { 0xFD82, 0xFD82, 0xFD82 }, { 0xFD83, 0xFD83, 0xFD83 }, { 0xFD84, 0xFD84, 0xFD84 }, { 0xFD85, 0xFD85, 0xFD85 }, { 0xFD86, 0xFD86, 0xFD86 }, { 0xFD87, 0xFD87, 0xFD87 }, { 0xFD88, 0xFD88, 0xFD88 }, { 0xFD89, 0xFD89, 0xFD89 }, { 0xFD8A, 0xFD8A, 0xFD8A }, { 0xFD8B, 0xFD8B, 0xFD8B }, { 0xFD8C, 0xFD8C, 0xFD8C }, { 0xFD8D, 0xFD8D, 0xFD8D }, { 0xFD8E, 0xFD8E, 0xFD8E }, { 0xFD8F, 0xFD8F, 0xFD8F }, { 0xFD92, 0xFD92, 0xFD92 }, { 0xFD93, 0xFD93, 0xFD93 }, { 0xFD94, 0xFD94, 0xFD94 }, { 0xFD95, 0xFD95, 0xFD95 }, { 0xFD96, 0xFD96, 0xFD96 }, { 0xFD97, 0xFD97, 0xFD97 }, { 0xFD98, 0xFD98, 0xFD98 }, { 0xFD99, 0xFD99, 0xFD99 }, { 0xFD9A, 0xFD9A, 0xFD9A }, { 0xFD9B, 0xFD9B, 0xFD9B }, { 0xFD9C, 0xFD9C, 0xFD9C }, { 0xFD9D, 0xFD9D, 0xFD9D }, { 0xFD9E, 0xFD9E, 0xFD9E }, { 0xFD9F, 0xFD9F, 0xFD9F }, { 0xFDA0, 0xFDA0, 0xFDA0 }, { 0xFDA1, 0xFDA1, 0xFDA1 }, { 0xFDA2, 0xFDA2, 0xFDA2 }, { 0xFDA3, 0xFDA3, 0xFDA3 }, { 0xFDA4, 0xFDA4, 0xFDA4 }, { 0xFDA5, 0xFDA5, 0xFDA5 }, { 0xFDA6, 0xFDA6, 0xFDA6 }, { 0xFDA7, 0xFDA7, 0xFDA7 }, { 0xFDA8, 0xFDA8, 0xFDA8 }, { 0xFDA9, 0xFDA9, 0xFDA9 }, { 0xFDAA, 0xFDAA, 0xFDAA }, { 0xFDAB, 0xFDAB, 0xFDAB }, { 0xFDAC, 0xFDAC, 0xFDAC }, { 0xFDAD, 0xFDAD, 0xFDAD }, { 0xFDAE, 0xFDAE, 0xFDAE }, { 0xFDAF, 0xFDAF, 0xFDAF }, { 0xFDB0, 0xFDB0, 0xFDB0 }, { 0xFDB1, 0xFDB1, 0xFDB1 }, { 0xFDB2, 0xFDB2, 0xFDB2 }, { 0xFDB3, 0xFDB3, 0xFDB3 }, { 0xFDB4, 0xFDB4, 0xFDB4 }, { 0xFDB5, 0xFDB5, 0xFDB5 }, { 0xFDB6, 0xFDB6, 0xFDB6 }, { 0xFDB7, 0xFDB7, 0xFDB7 }, { 0xFDB8, 0xFDB8, 0xFDB8 }, { 0xFDB9, 0xFDB9, 0xFDB9 }, { 0xFDBA, 0xFDBA, 0xFDBA }, { 0xFDBB, 0xFDBB, 0xFDBB }, { 0xFDBC, 0xFDBC, 0xFDBC }, { 0xFDBD, 0xFDBD, 0xFDBD }, { 0xFDBE, 0xFDBE, 0xFDBE }, { 0xFDBF, 0xFDBF, 0xFDBF }, { 0xFDC0, 0xFDC0, 0xFDC0 }, { 0xFDC1, 0xFDC1, 0xFDC1 }, { 0xFDC2, 0xFDC2, 0xFDC2 }, { 0xFDC3, 0xFDC3, 0xFDC3 }, { 0xFDC4, 0xFDC4, 0xFDC4 }, { 0xFDC5, 0xFDC5, 0xFDC5 }, { 0xFDC6, 0xFDC6, 0xFDC6 }, { 0xFDC7, 0xFDC7, 0xFDC7 }, { 0xFDF0, 0xFDF0, 0xFDF0 }, { 0xFDF1, 0xFDF1, 0xFDF1 }, { 0xFDF2, 0xFDF2, 0xFDF2 }, { 0xFDF3, 0xFDF3, 0xFDF3 }, { 0xFDF4, 0xFDF4, 0xFDF4 }, { 0xFDF5, 0xFDF5, 0xFDF5 }, { 0xFDF6, 0xFDF6, 0xFDF6 }, { 0xFDF7, 0xFDF7, 0xFDF7 }, { 0xFDF8, 0xFDF8, 0xFDF8 }, { 0xFDF9, 0xFDF9, 0xFDF9 }, { 0xFDFA, 0xFDFA, 0xFDFA }, { 0xFDFB, 0xFDFB, 0xFDFB }, { 0xFE00, 0xFE00, 0xFE00 }, { 0xFE01, 0xFE01, 0xFE01 }, { 0xFE02, 0xFE02, 0xFE02 }, { 0xFE03, 0xFE03, 0xFE03 }, { 0xFE04, 0xFE04, 0xFE04 }, { 0xFE05, 0xFE05, 0xFE05 }, { 0xFE06, 0xFE06, 0xFE06 }, { 0xFE07, 0xFE07, 0xFE07 }, { 0xFE08, 0xFE08, 0xFE08 }, { 0xFE09, 0xFE09, 0xFE09 }, { 0xFE0A, 0xFE0A, 0xFE0A }, { 0xFE0B, 0xFE0B, 0xFE0B }, { 0xFE0C, 0xFE0C, 0xFE0C }, { 0xFE0D, 0xFE0D, 0xFE0D }, { 0xFE0E, 0xFE0E, 0xFE0E }, { 0xFE0F, 0xFE0F, 0xFE0F }, { 0xFE20, 0xFE20, 0xFE20 }, { 0xFE21, 0xFE21, 0xFE21 }, { 0xFE22, 0xFE22, 0xFE22 }, { 0xFE23, 0xFE23, 0xFE23 }, { 0xFE70, 0xFE70, 0xFE70 }, { 0xFE71, 0xFE71, 0xFE71 }, { 0xFE72, 0xFE72, 0xFE72 }, { 0xFE73, 0xFE73, 0xFE73 }, { 0xFE74, 0xFE74, 0xFE74 }, { 0xFE76, 0xFE76, 0xFE76 }, { 0xFE77, 0xFE77, 0xFE77 }, { 0xFE78, 0xFE78, 0xFE78 }, { 0xFE79, 0xFE79, 0xFE79 }, { 0xFE7A, 0xFE7A, 0xFE7A }, { 0xFE7B, 0xFE7B, 0xFE7B }, { 0xFE7C, 0xFE7C, 0xFE7C }, { 0xFE7D, 0xFE7D, 0xFE7D }, { 0xFE7E, 0xFE7E, 0xFE7E }, { 0xFE7F, 0xFE7F, 0xFE7F }, { 0xFE80, 0xFE80, 0xFE80 }, { 0xFE81, 0xFE81, 0xFE81 }, { 0xFE82, 0xFE82, 0xFE82 }, { 0xFE83, 0xFE83, 0xFE83 }, { 0xFE84, 0xFE84, 0xFE84 }, { 0xFE85, 0xFE85, 0xFE85 }, { 0xFE86, 0xFE86, 0xFE86 }, { 0xFE87, 0xFE87, 0xFE87 }, { 0xFE88, 0xFE88, 0xFE88 }, { 0xFE89, 0xFE89, 0xFE89 }, { 0xFE8A, 0xFE8A, 0xFE8A }, { 0xFE8B, 0xFE8B, 0xFE8B }, { 0xFE8C, 0xFE8C, 0xFE8C }, { 0xFE8D, 0xFE8D, 0xFE8D }, { 0xFE8E, 0xFE8E, 0xFE8E }, { 0xFE8F, 0xFE8F, 0xFE8F }, { 0xFE90, 0xFE90, 0xFE90 }, { 0xFE91, 0xFE91, 0xFE91 }, { 0xFE92, 0xFE92, 0xFE92 }, { 0xFE93, 0xFE93, 0xFE93 }, { 0xFE94, 0xFE94, 0xFE94 }, { 0xFE95, 0xFE95, 0xFE95 }, { 0xFE96, 0xFE96, 0xFE96 }, { 0xFE97, 0xFE97, 0xFE97 }, { 0xFE98, 0xFE98, 0xFE98 }, { 0xFE99, 0xFE99, 0xFE99 }, { 0xFE9A, 0xFE9A, 0xFE9A }, { 0xFE9B, 0xFE9B, 0xFE9B }, { 0xFE9C, 0xFE9C, 0xFE9C }, { 0xFE9D, 0xFE9D, 0xFE9D }, { 0xFE9E, 0xFE9E, 0xFE9E }, { 0xFE9F, 0xFE9F, 0xFE9F }, { 0xFEA0, 0xFEA0, 0xFEA0 }, { 0xFEA1, 0xFEA1, 0xFEA1 }, { 0xFEA2, 0xFEA2, 0xFEA2 }, { 0xFEA3, 0xFEA3, 0xFEA3 }, { 0xFEA4, 0xFEA4, 0xFEA4 }, { 0xFEA5, 0xFEA5, 0xFEA5 }, { 0xFEA6, 0xFEA6, 0xFEA6 }, { 0xFEA7, 0xFEA7, 0xFEA7 }, { 0xFEA8, 0xFEA8, 0xFEA8 }, { 0xFEA9, 0xFEA9, 0xFEA9 }, { 0xFEAA, 0xFEAA, 0xFEAA }, { 0xFEAB, 0xFEAB, 0xFEAB }, { 0xFEAC, 0xFEAC, 0xFEAC }, { 0xFEAD, 0xFEAD, 0xFEAD }, { 0xFEAE, 0xFEAE, 0xFEAE }, { 0xFEAF, 0xFEAF, 0xFEAF }, { 0xFEB0, 0xFEB0, 0xFEB0 }, { 0xFEB1, 0xFEB1, 0xFEB1 }, { 0xFEB2, 0xFEB2, 0xFEB2 }, { 0xFEB3, 0xFEB3, 0xFEB3 }, { 0xFEB4, 0xFEB4, 0xFEB4 }, { 0xFEB5, 0xFEB5, 0xFEB5 }, { 0xFEB6, 0xFEB6, 0xFEB6 }, { 0xFEB7, 0xFEB7, 0xFEB7 }, { 0xFEB8, 0xFEB8, 0xFEB8 }, { 0xFEB9, 0xFEB9, 0xFEB9 }, { 0xFEBA, 0xFEBA, 0xFEBA }, { 0xFEBB, 0xFEBB, 0xFEBB }, { 0xFEBC, 0xFEBC, 0xFEBC }, { 0xFEBD, 0xFEBD, 0xFEBD }, { 0xFEBE, 0xFEBE, 0xFEBE }, { 0xFEBF, 0xFEBF, 0xFEBF }, { 0xFEC0, 0xFEC0, 0xFEC0 }, { 0xFEC1, 0xFEC1, 0xFEC1 }, { 0xFEC2, 0xFEC2, 0xFEC2 }, { 0xFEC3, 0xFEC3, 0xFEC3 }, { 0xFEC4, 0xFEC4, 0xFEC4 }, { 0xFEC5, 0xFEC5, 0xFEC5 }, { 0xFEC6, 0xFEC6, 0xFEC6 }, { 0xFEC7, 0xFEC7, 0xFEC7 }, { 0xFEC8, 0xFEC8, 0xFEC8 }, { 0xFEC9, 0xFEC9, 0xFEC9 }, { 0xFECA, 0xFECA, 0xFECA }, { 0xFECB, 0xFECB, 0xFECB }, { 0xFECC, 0xFECC, 0xFECC }, { 0xFECD, 0xFECD, 0xFECD }, { 0xFECE, 0xFECE, 0xFECE }, { 0xFECF, 0xFECF, 0xFECF }, { 0xFED0, 0xFED0, 0xFED0 }, { 0xFED1, 0xFED1, 0xFED1 }, { 0xFED2, 0xFED2, 0xFED2 }, { 0xFED3, 0xFED3, 0xFED3 }, { 0xFED4, 0xFED4, 0xFED4 }, { 0xFED5, 0xFED5, 0xFED5 }, { 0xFED6, 0xFED6, 0xFED6 }, { 0xFED7, 0xFED7, 0xFED7 }, { 0xFED8, 0xFED8, 0xFED8 }, { 0xFED9, 0xFED9, 0xFED9 }, { 0xFEDA, 0xFEDA, 0xFEDA }, { 0xFEDB, 0xFEDB, 0xFEDB }, { 0xFEDC, 0xFEDC, 0xFEDC }, { 0xFEDD, 0xFEDD, 0xFEDD }, { 0xFEDE, 0xFEDE, 0xFEDE }, { 0xFEDF, 0xFEDF, 0xFEDF }, { 0xFEE0, 0xFEE0, 0xFEE0 }, { 0xFEE1, 0xFEE1, 0xFEE1 }, { 0xFEE2, 0xFEE2, 0xFEE2 }, { 0xFEE3, 0xFEE3, 0xFEE3 }, { 0xFEE4, 0xFEE4, 0xFEE4 }, { 0xFEE5, 0xFEE5, 0xFEE5 }, { 0xFEE6, 0xFEE6, 0xFEE6 }, { 0xFEE7, 0xFEE7, 0xFEE7 }, { 0xFEE8, 0xFEE8, 0xFEE8 }, { 0xFEE9, 0xFEE9, 0xFEE9 }, { 0xFEEA, 0xFEEA, 0xFEEA }, { 0xFEEB, 0xFEEB, 0xFEEB }, { 0xFEEC, 0xFEEC, 0xFEEC }, { 0xFEED, 0xFEED, 0xFEED }, { 0xFEEE, 0xFEEE, 0xFEEE }, { 0xFEEF, 0xFEEF, 0xFEEF }, { 0xFEF0, 0xFEF0, 0xFEF0 }, { 0xFEF1, 0xFEF1, 0xFEF1 }, { 0xFEF2, 0xFEF2, 0xFEF2 }, { 0xFEF3, 0xFEF3, 0xFEF3 }, { 0xFEF4, 0xFEF4, 0xFEF4 }, { 0xFEF5, 0xFEF5, 0xFEF5 }, { 0xFEF6, 0xFEF6, 0xFEF6 }, { 0xFEF7, 0xFEF7, 0xFEF7 }, { 0xFEF8, 0xFEF8, 0xFEF8 }, { 0xFEF9, 0xFEF9, 0xFEF9 }, { 0xFEFA, 0xFEFA, 0xFEFA }, { 0xFEFB, 0xFEFB, 0xFEFB }, { 0xFEFC, 0xFEFC, 0xFEFC }, { 0xFF21, 0xFF21, 0xFF41 }, { 0xFF22, 0xFF22, 0xFF42 }, { 0xFF23, 0xFF23, 0xFF43 }, { 0xFF24, 0xFF24, 0xFF44 }, { 0xFF25, 0xFF25, 0xFF45 }, { 0xFF26, 0xFF26, 0xFF46 }, { 0xFF27, 0xFF27, 0xFF47 }, { 0xFF28, 0xFF28, 0xFF48 }, { 0xFF29, 0xFF29, 0xFF49 }, { 0xFF2A, 0xFF2A, 0xFF4A }, { 0xFF2B, 0xFF2B, 0xFF4B }, { 0xFF2C, 0xFF2C, 0xFF4C }, { 0xFF2D, 0xFF2D, 0xFF4D }, { 0xFF2E, 0xFF2E, 0xFF4E }, { 0xFF2F, 0xFF2F, 0xFF4F }, { 0xFF30, 0xFF30, 0xFF50 }, { 0xFF31, 0xFF31, 0xFF51 }, { 0xFF32, 0xFF32, 0xFF52 }, { 0xFF33, 0xFF33, 0xFF53 }, { 0xFF34, 0xFF34, 0xFF54 }, { 0xFF35, 0xFF35, 0xFF55 }, { 0xFF36, 0xFF36, 0xFF56 }, { 0xFF37, 0xFF37, 0xFF57 }, { 0xFF38, 0xFF38, 0xFF58 }, { 0xFF39, 0xFF39, 0xFF59 }, { 0xFF3A, 0xFF3A, 0xFF5A }, { 0xFF41, 0xFF21, 0xFF41 }, { 0xFF42, 0xFF22, 0xFF42 }, { 0xFF43, 0xFF23, 0xFF43 }, { 0xFF44, 0xFF24, 0xFF44 }, { 0xFF45, 0xFF25, 0xFF45 }, { 0xFF46, 0xFF26, 0xFF46 }, { 0xFF47, 0xFF27, 0xFF47 }, { 0xFF48, 0xFF28, 0xFF48 }, { 0xFF49, 0xFF29, 0xFF49 }, { 0xFF4A, 0xFF2A, 0xFF4A }, { 0xFF4B, 0xFF2B, 0xFF4B }, { 0xFF4C, 0xFF2C, 0xFF4C }, { 0xFF4D, 0xFF2D, 0xFF4D }, { 0xFF4E, 0xFF2E, 0xFF4E }, { 0xFF4F, 0xFF2F, 0xFF4F }, { 0xFF50, 0xFF30, 0xFF50 }, { 0xFF51, 0xFF31, 0xFF51 }, { 0xFF52, 0xFF32, 0xFF52 }, { 0xFF53, 0xFF33, 0xFF53 }, { 0xFF54, 0xFF34, 0xFF54 }, { 0xFF55, 0xFF35, 0xFF55 }, { 0xFF56, 0xFF36, 0xFF56 }, { 0xFF57, 0xFF37, 0xFF57 }, { 0xFF58, 0xFF38, 0xFF58 }, { 0xFF59, 0xFF39, 0xFF59 }, { 0xFF5A, 0xFF3A, 0xFF5A }, { 0xFF66, 0xFF66, 0xFF66 }, { 0xFF67, 0xFF67, 0xFF67 }, { 0xFF68, 0xFF68, 0xFF68 }, { 0xFF69, 0xFF69, 0xFF69 }, { 0xFF6A, 0xFF6A, 0xFF6A }, { 0xFF6B, 0xFF6B, 0xFF6B }, { 0xFF6C, 0xFF6C, 0xFF6C }, { 0xFF6D, 0xFF6D, 0xFF6D }, { 0xFF6E, 0xFF6E, 0xFF6E }, { 0xFF6F, 0xFF6F, 0xFF6F }, { 0xFF70, 0xFF70, 0xFF70 }, { 0xFF71, 0xFF71, 0xFF71 }, { 0xFF72, 0xFF72, 0xFF72 }, { 0xFF73, 0xFF73, 0xFF73 }, { 0xFF74, 0xFF74, 0xFF74 }, { 0xFF75, 0xFF75, 0xFF75 }, { 0xFF76, 0xFF76, 0xFF76 }, { 0xFF77, 0xFF77, 0xFF77 }, { 0xFF78, 0xFF78, 0xFF78 }, { 0xFF79, 0xFF79, 0xFF79 }, { 0xFF7A, 0xFF7A, 0xFF7A }, { 0xFF7B, 0xFF7B, 0xFF7B }, { 0xFF7C, 0xFF7C, 0xFF7C }, { 0xFF7D, 0xFF7D, 0xFF7D }, { 0xFF7E, 0xFF7E, 0xFF7E }, { 0xFF7F, 0xFF7F, 0xFF7F }, { 0xFF80, 0xFF80, 0xFF80 }, { 0xFF81, 0xFF81, 0xFF81 }, { 0xFF82, 0xFF82, 0xFF82 }, { 0xFF83, 0xFF83, 0xFF83 }, { 0xFF84, 0xFF84, 0xFF84 }, { 0xFF85, 0xFF85, 0xFF85 }, { 0xFF86, 0xFF86, 0xFF86 }, { 0xFF87, 0xFF87, 0xFF87 }, { 0xFF88, 0xFF88, 0xFF88 }, { 0xFF89, 0xFF89, 0xFF89 }, { 0xFF8A, 0xFF8A, 0xFF8A }, { 0xFF8B, 0xFF8B, 0xFF8B }, { 0xFF8C, 0xFF8C, 0xFF8C }, { 0xFF8D, 0xFF8D, 0xFF8D }, { 0xFF8E, 0xFF8E, 0xFF8E }, { 0xFF8F, 0xFF8F, 0xFF8F }, { 0xFF90, 0xFF90, 0xFF90 }, { 0xFF91, 0xFF91, 0xFF91 }, { 0xFF92, 0xFF92, 0xFF92 }, { 0xFF93, 0xFF93, 0xFF93 }, { 0xFF94, 0xFF94, 0xFF94 }, { 0xFF95, 0xFF95, 0xFF95 }, { 0xFF96, 0xFF96, 0xFF96 }, { 0xFF97, 0xFF97, 0xFF97 }, { 0xFF98, 0xFF98, 0xFF98 }, { 0xFF99, 0xFF99, 0xFF99 }, { 0xFF9A, 0xFF9A, 0xFF9A }, { 0xFF9B, 0xFF9B, 0xFF9B }, { 0xFF9C, 0xFF9C, 0xFF9C }, { 0xFF9D, 0xFF9D, 0xFF9D }, { 0xFF9E, 0xFF9E, 0xFF9E }, { 0xFF9F, 0xFF9F, 0xFF9F }, { 0xFFA0, 0xFFA0, 0xFFA0 }, { 0xFFA1, 0xFFA1, 0xFFA1 }, { 0xFFA2, 0xFFA2, 0xFFA2 }, { 0xFFA3, 0xFFA3, 0xFFA3 }, { 0xFFA4, 0xFFA4, 0xFFA4 }, { 0xFFA5, 0xFFA5, 0xFFA5 }, { 0xFFA6, 0xFFA6, 0xFFA6 }, { 0xFFA7, 0xFFA7, 0xFFA7 }, { 0xFFA8, 0xFFA8, 0xFFA8 }, { 0xFFA9, 0xFFA9, 0xFFA9 }, { 0xFFAA, 0xFFAA, 0xFFAA }, { 0xFFAB, 0xFFAB, 0xFFAB }, { 0xFFAC, 0xFFAC, 0xFFAC }, { 0xFFAD, 0xFFAD, 0xFFAD }, { 0xFFAE, 0xFFAE, 0xFFAE }, { 0xFFAF, 0xFFAF, 0xFFAF }, { 0xFFB0, 0xFFB0, 0xFFB0 }, { 0xFFB1, 0xFFB1, 0xFFB1 }, { 0xFFB2, 0xFFB2, 0xFFB2 }, { 0xFFB3, 0xFFB3, 0xFFB3 }, { 0xFFB4, 0xFFB4, 0xFFB4 }, { 0xFFB5, 0xFFB5, 0xFFB5 }, { 0xFFB6, 0xFFB6, 0xFFB6 }, { 0xFFB7, 0xFFB7, 0xFFB7 }, { 0xFFB8, 0xFFB8, 0xFFB8 }, { 0xFFB9, 0xFFB9, 0xFFB9 }, { 0xFFBA, 0xFFBA, 0xFFBA }, { 0xFFBB, 0xFFBB, 0xFFBB }, { 0xFFBC, 0xFFBC, 0xFFBC }, { 0xFFBD, 0xFFBD, 0xFFBD }, { 0xFFBE, 0xFFBE, 0xFFBE }, { 0xFFC2, 0xFFC2, 0xFFC2 }, { 0xFFC3, 0xFFC3, 0xFFC3 }, { 0xFFC4, 0xFFC4, 0xFFC4 }, { 0xFFC5, 0xFFC5, 0xFFC5 }, { 0xFFC6, 0xFFC6, 0xFFC6 }, { 0xFFC7, 0xFFC7, 0xFFC7 }, { 0xFFCA, 0xFFCA, 0xFFCA }, { 0xFFCB, 0xFFCB, 0xFFCB }, { 0xFFCC, 0xFFCC, 0xFFCC }, { 0xFFCD, 0xFFCD, 0xFFCD }, { 0xFFCE, 0xFFCE, 0xFFCE }, { 0xFFCF, 0xFFCF, 0xFFCF }, { 0xFFD2, 0xFFD2, 0xFFD2 }, { 0xFFD3, 0xFFD3, 0xFFD3 }, { 0xFFD4, 0xFFD4, 0xFFD4 }, { 0xFFD5, 0xFFD5, 0xFFD5 }, { 0xFFD6, 0xFFD6, 0xFFD6 }, { 0xFFD7, 0xFFD7, 0xFFD7 }, { 0xFFDA, 0xFFDA, 0xFFDA }, { 0xFFDB, 0xFFDB, 0xFFDB }, { 0xFFDC, 0xFFDC, 0xFFDC } }; qt-client-4.1.0/hunspell/w_char.hxx000066400000000000000000000004171217451700100172420ustar00rootroot00000000000000#ifndef __WCHARHXX__ #define __WCHARHXX__ #ifndef GCC typedef struct { #else typedef struct __attribute__ ((packed)) { #endif unsigned char l; unsigned char h; } w_char; // two character arrays struct replentry { char * pattern; char * pattern2; }; #endif qt-client-4.1.0/openrpt/000077500000000000000000000000001217451700100151015ustar00rootroot00000000000000qt-client-4.1.0/scriptapi/000077500000000000000000000000001217451700100154105ustar00rootroot00000000000000qt-client-4.1.0/scriptapi/README.txt000066400000000000000000000112451217451700100171110ustar00rootroot00000000000000This directory holds the interface between various classes and the scripting engine available to the xTuple ERP GUI client. There are several ways to use a class while scripting: - Use a Qt class as is - this restricts you to using the properties, slots, and signals as defined by Qt. This only works for classes which inherit from QObject. - Extend a QObject subclass - make more of its methods Q_INVOKABLE. - create a prototype class. - as a last resort, add to the ScriptToolbox Using Qt classes as they are: ----------------------------- [ not written yet ] Extending QObject subclasses: ----------------------------- If the class is part of the xTuple ERP sources and inherits from QObject then you should do the following: - make the public methods in your class Q_INVOKABLE - add Q_INVOKABLE methods from the parent classes if they are not already exposed to scripting - write a constructor function - write conversion functions XtoScriptValue and XfromScriptValue and register these conversion functions with qScriptRegisterMetaType If all you need to do is pass pointers back and forth, you can write these like so: QScriptValue XtoScriptValue(QScriptEngine *engine, X* const &obj) { return engine->newQObject(obj); } QScriptValue XfromScriptValue(const QScriptValue obj X* &item) { item = qobject_cast(obj.toQObject()); } void setupX(QScriptEngine *engine) { qScriptRegisterMetaType(engine, XtoScriptValue, XfromScriptValue); // register the constructor function if you have one } - add this setup function and Q_DECLARE_METATYPE(X*) to the appropriate header - expose any enumerations used - call this setup function If the class is defined in common or widgets directories, add the call to scriptapi/setupscriptapi.cpp. Otherwise add it to guiclient.cpp? you need to use in the appropriate header file and recompile. The following method is for classes you /don't/ have control over, such as Qt classes themselves. Short Description of creating a Prototype class: $ edit newproto.h $ awk -f h2cpp.awk newproto.h > newproto.cpp $ edit newproto.cpp $ edit scriptapi.pro # add newproto.h and newproto.cpp $ edit setupscriptapi.cpp # add #include "newproto.h" and setupNewProto(engine) Long Description: To add a prototype for the class named 'new', you have to create header and implementation files, add these two files to the scriptapi project, and register the new prototype class with the scripting engine. $ edit newproto.h Create the header file. It's probably best to start with a copy of an existing small prototype .h. Change the #ifndef, #define, #includes, Q_DECLARE_METATYPE, setup* and construct* function names, and the class name and constructor at the top to refer to your new class. Replace the Q_INVOKABLE methods of the copied file with signatures for the public methods in the class you want to expose. One way to get a complete list is to copy the class summary from the documentation page, paste it into your editor, and add Q_INVOKABLE. You will probably have to replace symbolic constants with integer literals and references to enums with int. $ awk -f h2cpp.awk newproto.h > newproto.cpp This awk script takes the edited header file and fills in the boilerplate code necessary to make most methods work. The awk script is really dumb, so: $ edit newproto.cpp Edit the resulting C++ implementation by hand. You'll have to do things like move * from after NewProto:: to before it remove data type names from function calls, remove const from the end of function call lines, fill in the occasional variable names where method parameters in the .h were declared with a type but no name. Methods that return pointers will need their default return values changed to 0 or NULL. For example, when creating qtabwidgetproto.cpp, the following code was generated: QWidget QTabWidgetProto::*cornerWidget(int corner) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->*cornerWidget(int corner) const; return QWidget(); } This had to be changed to: QWidget *QTabWidgetProto::cornerWidget(int corner) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->cornerWidget(corner); return 0; } If there's a reasonable QString representation of an object, modify the default implementation of the toString() method to reflect this and add toString() to the .h file. Otherwise remove or comment out the default toString(). $ edit scriptapi.pro # add newproto.h and newproto.cpp $ edit setupscriptapi.cpp # add #include "newproto.h" and setupNewProto(engine) qt-client-4.1.0/scriptapi/addressclustersetup.cpp000066400000000000000000000021341217451700100222240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "addresscluster.h" #include void setupAddressCluster(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("CHECK", QScriptValue(engine, AddressCluster::CHECK), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CHANGEONE", QScriptValue(engine, AddressCluster::CHANGEONE), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CHANGEALL", QScriptValue(engine, AddressCluster::CHANGEALL), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("AddressCluster", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/addressclustersetup.h000066400000000000000000000011201217451700100216630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ADDRESSCLUSTERSETUP_H__ #define __ADDRESSCLUSTERSETUP_H__ class QScriptEngine; void setupAddressCluster(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/alarmssetup.cpp000066400000000000000000000122361217451700100204600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "alarms.h" #include void setupAlarms(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Uninitialized", QScriptValue(engine, Alarms::Uninitialized), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Address", QScriptValue(engine, Alarms::Address), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BBOMHead", QScriptValue(engine, Alarms::BBOMHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BBOMItem", QScriptValue(engine, Alarms::BBOMItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOMHead", QScriptValue(engine, Alarms::BOMHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOMItem", QScriptValue(engine, Alarms::BOMItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOOHead", QScriptValue(engine, Alarms::BOOHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOOItem", QScriptValue(engine, Alarms::BOOItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CRMAccount", QScriptValue(engine, Alarms::CRMAccount), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Contact", QScriptValue(engine, Alarms::Contact), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Customer", QScriptValue(engine, Alarms::Customer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Employee", QScriptValue(engine, Alarms::Employee), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Incident", QScriptValue(engine, Alarms::Incident), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Item", QScriptValue(engine, Alarms::Item), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemSite", QScriptValue(engine, Alarms::ItemSite), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemSource", QScriptValue(engine, Alarms::ItemSource), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Location", QScriptValue(engine, Alarms::Location), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LotSerial", QScriptValue(engine, Alarms::LotSerial), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Opportunity", QScriptValue(engine, Alarms::Opportunity), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Project", QScriptValue(engine, Alarms::Project), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrder", QScriptValue(engine, Alarms::PurchaseOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrderItem",QScriptValue(engine, Alarms::PurchaseOrderItem),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReturnAuth", QScriptValue(engine, Alarms::ReturnAuth), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReturnAuthItem", QScriptValue(engine, Alarms::ReturnAuthItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Quote", QScriptValue(engine, Alarms::Quote), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("QuoteItem", QScriptValue(engine, Alarms::QuoteItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrder", QScriptValue(engine, Alarms::SalesOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrderItem", QScriptValue(engine, Alarms::SalesOrderItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TodoItem", QScriptValue(engine, Alarms::TodoItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrder", QScriptValue(engine, Alarms::TransferOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrderItem",QScriptValue(engine, Alarms::TransferOrderItem),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vendor", QScriptValue(engine, Alarms::Vendor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Warehouse", QScriptValue(engine, Alarms::Warehouse), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WorkOrder", QScriptValue(engine, Alarms::WorkOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("Alarms", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/alarmssetup.h000066400000000000000000000010701217451700100201170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ALARMSSETUP_H__ #define __ALARMSSETUP_H__ class QScriptEngine; void setupAlarms(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/clineeditsetup.cpp000066400000000000000000000040641217451700100211410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "clineeditsetup.h" #include QScriptValue CLineEditTypesToScriptValue(QScriptEngine *engine, const CLineEdit::CLineEditTypes &type) { return QScriptValue(engine, (int)type); } void CLineEditTypesFromScriptValue(const QScriptValue &obj, CLineEdit::CLineEditTypes &type) { type = (CLineEdit::CLineEditTypes)obj.toInt32(); } void setupCLineEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("AllCustomers", QScriptValue(engine, CLineEdit::AllCustomers), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ActiveCustomers", QScriptValue(engine, CLineEdit::ActiveCustomers), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllProspects", QScriptValue(engine, CLineEdit::AllProspects), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ActiveProspects", QScriptValue(engine, CLineEdit::ActiveProspects), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllCustomersAndProspects", QScriptValue(engine, CLineEdit::AllCustomersAndProspects), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ActiveCustomersAndProspects",QScriptValue(engine, CLineEdit::ActiveCustomersAndProspects),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("CLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, CLineEditTypesToScriptValue, CLineEditTypesFromScriptValue); } qt-client-4.1.0/scriptapi/clineeditsetup.h000066400000000000000000000012171217451700100206030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CLINEEDITSETUP_H__ #define __CLINEEDITSETUP_H__ #include "custcluster.h" class QScriptEngine; Q_DECLARE_METATYPE(enum CLineEdit::CLineEditTypes) void setupCLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/commentssetup.cpp000066400000000000000000000121421217451700100210220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "comments.h" #include void setupComments(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Uninitialized", QScriptValue(engine, Comments::Uninitialized), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Address", QScriptValue(engine, Comments::Address), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BBOMHead", QScriptValue(engine, Comments::BBOMHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BBOMItem", QScriptValue(engine, Comments::BBOMItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOMHead", QScriptValue(engine, Comments::BOMHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOMItem", QScriptValue(engine, Comments::BOMItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOOHead", QScriptValue(engine, Comments::BOOHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOOItem", QScriptValue(engine, Comments::BOOItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CRMAccount", QScriptValue(engine, Comments::CRMAccount), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Contact", QScriptValue(engine, Comments::Contact), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Customer", QScriptValue(engine, Comments::Customer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Employee", QScriptValue(engine, Comments::Employee), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Incident", QScriptValue(engine, Comments::Incident), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Item", QScriptValue(engine, Comments::Item), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemSite", QScriptValue(engine, Comments::ItemSite), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemSource", QScriptValue(engine, Comments::ItemSource), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Location", QScriptValue(engine, Comments::Location), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LotSerial", QScriptValue(engine, Comments::LotSerial), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Opportunity", QScriptValue(engine, Comments::Opportunity), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Project", QScriptValue(engine, Comments::Project), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrder", QScriptValue(engine, Comments::PurchaseOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrderItem",QScriptValue(engine, Comments::PurchaseOrderItem),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReturnAuth", QScriptValue(engine, Comments::ReturnAuth), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReturnAuthItem", QScriptValue(engine, Comments::ReturnAuthItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Quote", QScriptValue(engine, Comments::Quote), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("QuoteItem", QScriptValue(engine, Comments::QuoteItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrder", QScriptValue(engine, Comments::SalesOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrderItem", QScriptValue(engine, Comments::SalesOrderItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrder", QScriptValue(engine, Comments::TransferOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrderItem",QScriptValue(engine, Comments::TransferOrderItem),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vendor", QScriptValue(engine, Comments::Vendor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Warehouse", QScriptValue(engine, Comments::Warehouse), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WorkOrder", QScriptValue(engine, Comments::WorkOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("Comments", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/commentssetup.h000066400000000000000000000010501217451700100204630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __COMMENTSSETUP_H__ #define __COMMENTSSETUP_H__ void setupComments(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/contactclustersetup.cpp000066400000000000000000000027631217451700100222420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "contactcluster.h" #include void setupContactCluster(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Employee", QScriptValue(engine, ContactCluster::Employee), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Customer", QScriptValue(engine, ContactCluster::Customer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vendor", QScriptValue(engine, ContactCluster::Vendor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Partner ", QScriptValue(engine, ContactCluster::Partner), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Prospect", QScriptValue(engine, ContactCluster::Prospect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Competitor",QScriptValue(engine, ContactCluster::Competitor),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ContactCluster", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/contactclustersetup.h000066400000000000000000000010721217451700100216770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CONTACTCLUSTERSETUP_H__ #define __CONTACTCLUSTERSETUP_H__ void setupContactCluster(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/contactwidgetsetup.cpp000066400000000000000000000027521217451700100220420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "contactwidget.h" #include void setupContactWidget(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Employee", QScriptValue(engine, ContactWidget::Employee), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Customer", QScriptValue(engine, ContactWidget::Customer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vendor", QScriptValue(engine, ContactWidget::Vendor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Partner ", QScriptValue(engine, ContactWidget::Partner), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Prospect", QScriptValue(engine, ContactWidget::Prospect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Competitor",QScriptValue(engine, ContactWidget::Competitor),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ContactWidget", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/contactwidgetsetup.h000066400000000000000000000010671217451700100215050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CONTACTWIDGETSETUP_H__ #define __CONTACTWIDGETSETUP_H__ void setupContactWidget(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/crmacctlineeditsetup.cpp000066400000000000000000000034771217451700100223420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmacctcluster.h" #include void setupCRMAcctLineEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Crmacct", QScriptValue(engine, CRMAcctLineEdit::Crmacct), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Competitor", QScriptValue(engine, CRMAcctLineEdit::Competitor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Cust", QScriptValue(engine, CRMAcctLineEdit::Cust), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Partner", QScriptValue(engine, CRMAcctLineEdit::Partner), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Prospect", QScriptValue(engine, CRMAcctLineEdit::Prospect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Taxauth", QScriptValue(engine, CRMAcctLineEdit::Taxauth), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vend", QScriptValue(engine, CRMAcctLineEdit::Vend), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustAndProspect",QScriptValue(engine, CRMAcctLineEdit::CustAndProspect),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("CRMAcctLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/crmacctlineeditsetup.h000066400000000000000000000010751217451700100217770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CRMACCTLINEEDITSETUP_H__ #define __CRMACCTLINEEDITSETUP_H__ void setupCRMAcctLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/currdisplaysetup.cpp000066400000000000000000000025061217451700100215410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "currcluster.h" #include void setupCurrDisplay(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Money", QScriptValue(engine, CurrDisplay::Money), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesPrice",QScriptValue(engine, CurrDisplay::SalesPrice),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchPrice",QScriptValue(engine, CurrDisplay::PurchPrice),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ExtPrice", QScriptValue(engine, CurrDisplay::ExtPrice), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Cost", QScriptValue(engine, CurrDisplay::Cost), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("CurrDisplay", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/currdisplaysetup.h000066400000000000000000000010611217451700100212010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CURRDISPLAYSETUP_H__ #define __CURRDISPLAYSETUP_H__ void setupCurrDisplay(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/documentssetup.cpp000066400000000000000000000122271217451700100212020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "documents.h" #include void setupDocuments(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Uninitialized", QScriptValue(engine, Documents::Uninitialized), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Address", QScriptValue(engine, Documents::Address), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BBOMHead", QScriptValue(engine, Documents::BBOMHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BBOMItem", QScriptValue(engine, Documents::BBOMItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOMHead", QScriptValue(engine, Documents::BOMHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOMItem", QScriptValue(engine, Documents::BOMItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOOHead", QScriptValue(engine, Documents::BOOHead), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOOItem", QScriptValue(engine, Documents::BOOItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CRMAccount", QScriptValue(engine, Documents::CRMAccount), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Contact", QScriptValue(engine, Documents::Contact), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Customer", QScriptValue(engine, Documents::Customer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Employee", QScriptValue(engine, Documents::Employee), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Incident", QScriptValue(engine, Documents::Incident), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Item", QScriptValue(engine, Documents::Item), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemSite", QScriptValue(engine, Documents::ItemSite), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemSource", QScriptValue(engine, Documents::ItemSource), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Location", QScriptValue(engine, Documents::Location), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LotSerial", QScriptValue(engine, Documents::LotSerial), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Opportunity", QScriptValue(engine, Documents::Opportunity), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Project", QScriptValue(engine, Documents::Project), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrder", QScriptValue(engine, Documents::PurchaseOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrderItem",QScriptValue(engine, Documents::PurchaseOrderItem),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReturnAuth", QScriptValue(engine, Documents::ReturnAuth), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReturnAuthItem", QScriptValue(engine, Documents::ReturnAuthItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Quote", QScriptValue(engine, Documents::Quote), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("QuoteItem", QScriptValue(engine, Documents::QuoteItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrder", QScriptValue(engine, Documents::SalesOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrderItem", QScriptValue(engine, Documents::SalesOrderItem), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrder", QScriptValue(engine, Documents::TransferOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrderItem",QScriptValue(engine, Documents::TransferOrderItem),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vendor", QScriptValue(engine, Documents::Vendor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Warehouse", QScriptValue(engine, Documents::Warehouse), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WorkOrder", QScriptValue(engine, Documents::WorkOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("Documents", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/documentssetup.h000066400000000000000000000010531217451700100206420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DOCUMENTSSETUP_H__ #define __DOCUMENTSSETUP_H__ void setupDocuments(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/glclustersetup.cpp000066400000000000000000000027061217451700100212060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "glcluster.h" #include void setupGLCluster(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("cUndefined",QScriptValue(engine, GLCluster::cUndefined),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cAsset", QScriptValue(engine, GLCluster::cAsset), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cLiability",QScriptValue(engine, GLCluster::cLiability),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cExpense", QScriptValue(engine, GLCluster::cExpense), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cRevenue", QScriptValue(engine, GLCluster::cRevenue), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cEquity", QScriptValue(engine, GLCluster::cEquity), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("GLCluster", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/glclustersetup.h000066400000000000000000000010531217451700100206450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __GLCLUSTERSETUP_H__ #define __GLCLUSTERSETUP_H__ void setupGLCluster(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/h2cpp.awk000066400000000000000000000071501217451700100171330ustar00rootroot00000000000000# do the bulk of the plug-n-chug creation of a prototype class .cpp from a # prototype .h. you decide what should be exposed and this script creates # most of the boilerplate code. the resulting .cpp must still be edited by # hand. /^\/\*/,/^ *\*\// { print; if ($1 ~ /\*\//) { print ""; print "#include \"" FILENAME "\""; print ""; } next; } /^class *[A-Za-z][A-Za-z0-9_]*;/ { sub(/;/, "", $2); print "#include <" $2 ">"; } /^void setup.*QScriptEngine/ { protoclass = substr($2, 6, index($2, "(") - 6); baseclass = substr(protoclass, 1, index(protoclass, "Proto") - 1); print "QScriptValue " baseclass "toScriptValue(QScriptEngine *engine, " baseclass "* const &item)"; print "{ return engine->newQObject(item); }"; print ""; print "void " baseclass "fromScriptValue(const QScriptValue &obj, " baseclass "* &item)"; print "{\n item = qobject_cast<" baseclass "*>(obj.toQObject());\n}"; print ""; sub(/;/, ""); print; print "{"; print " qScriptRegisterMetaType(engine, " baseclass "toScriptValue, " baseclass "fromScriptValue);" print ""; print " QScriptValue proto = engine->newQObject(new " protoclass "(engine));"; print " engine->setDefaultPrototype(qMetaTypeId<" baseclass "*>(), proto);"; print " engine->setDefaultPrototype(qMetaTypeId<" baseclass ">(), proto);"; print ""; print " QScriptValue constructor = engine->newFunction(construct" baseclass ","; print " proto);"; print " engine->globalObject().setProperty(\"" baseclass "\", constructor);"; print "}"; print ""; } /^QScriptValue construct/ { print "QScriptValue construct" baseclass "(QScriptContext * /*context*/,"; print " QScriptEngine *engine)"; print "{"; print " " baseclass " *obj = 0;"; print " /* if (context->argumentCount() ...)"; print " else if (something bad)"; print " context->throwError(QScriptContext::UnknownError,"; print " \"Could not find an appropriate " baseclass "constructor\");"; print " else"; print " */"; print " obj = new " baseclass "();"; print " return engine->toScriptValue(obj);"; print "}"; print "" } $1 ~ protoclass ".QObject" { sub(/^ */, ""); sub(/;/, ""); print protoclass "::" $0; print " : QObject(parent)" print "{\n}\n"; } /Q_INVOKABLE/ { sub(/ *Q_INVOKABLE */, ""); sub(/ */, " "); sub(/;/, ""); type = $1; functn = substr($2, 1, index($2, "(") - 1); arglist = substr($0, index($0, "("), length - index($0, "(") + 1); gsub(/ = [^,]*(\(\))?\)/, ")", arglist); gsub(/ = [^,]*(\(\))?,/, ",", arglist); print $1, protoclass "::" functn arglist print "{"; print " " baseclass " *item = qscriptvalue_cast<" baseclass "*>(thisObject());"; print " if (item)"; if (type == "void") { print " item->" functn arglist ";"; } else { print " return item->" functn arglist ";"; if (type == "int") print " return 0;"; else if (type == "qint64") print " return 0;"; else if (type == "uint") print " return 0;"; else if (type == "bool") print " return false;"; else print " return " type "();"; } print "}"; print ""; if (functn == "toString") foundToString = 1; } END { if (! foundToString) { print "QString " protoclass "::toString() const"; print "{"; print " " baseclass " *item = qscriptvalue_cast<" baseclass "*>(thisObject());"; print " if (item)"; print " return QString(\"" baseclass "()\");"; print " return QString(\"" baseclass "(unknown)\");"; print "}"; } } qt-client-4.1.0/scriptapi/include.cpp000066400000000000000000000105211217451700100175360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "include.h" #include /*! \file include.cpp \brief Implement the include facility of the \ref scriptapi "Scripting API" This file implements the include() function used in %scripts to extend xTuple ERP. */ /*! \brief Sets the include() function as a property of the global object. This installs the include() function as a property in the global namespace of the given QScriptEngine. It should only be called by setupScriptApi(). \param engine A pointer to the script engine in which to install the include function. */ void setupInclude(QScriptEngine *engine) { engine->globalObject().setProperty("include", engine->newFunction(includeScript)); } /*! \brief Implements an include facility for use in xTuple ERP %scripts. This is the C++ implementation of the include() function. It should never be called directly. \param context The context contains a list of arguments passed to the include() function by the calling script. All arguments are processed as potential script names to be loaded and run. \param engine The QScriptEngine in which to load the included %scripts. \see include() */ QScriptValue includeScript(QScriptContext *context, QScriptEngine *engine) { int count = 0; XSqlQuery scriptq; scriptq.prepare("SELECT script_id, script_source AS src" " FROM script" " WHERE ((script_name=:script_name)" " AND (script_enabled))" " ORDER BY script_order;"); context->setActivationObject(context->parentContext()->activationObject()); context->setThisObject(context->parentContext()->thisObject()); for (; count < context->argumentCount(); count++) { QString scriptname = context->argument(count).toString(); scriptq.bindValue(":script_name", scriptname); scriptq.exec(); while (scriptq.next()) { QScriptValue result = engine->evaluate(scriptq.value("src").toString(), scriptname, 1); if (engine->hasUncaughtException()) { qWarning() << "uncaught exception in" << scriptname << "(id" << scriptq.value("script_id").toInt() << ") at line" << engine->uncaughtExceptionLineNumber() << ":" << result.toString(); break; } } } return engine->toScriptValue(count); } /*! \ingroup scriptapi \brief Include the named script(s) in the current script. This lets the script developer put commonly used QtScript (JavaScript) code in a single place and use it in multiple other %scripts. All named %scripts are included in the order listed. If more than one script exists with the given name, all of them are included in increasing order by script_order. The inclusion is done as the script is executed, so if an include() call appears in the middle of a function, the include will not be done until that function gets called. If any of the included %scripts throws an exception while being included, no subsequent %scripts in the list will be processed. For example: \code include("soap2js"); \endcode This tells the current QScriptEngine to use the contents of the script named "soap2js" and appears near the top of the weatherForAddress.js script. \code include("storedProcErrLookup", "xtmfgErrors"); \endcode This tells the current QScriptEngine to use the contents of two %scripts, one named "storedProcErrLookup" and the other named "xtmfgErrors". \param first The name of a script to include \param second Optional: The name of a second script to include \return The number of arguments that were processed \see weatherForAddress.js \see include.cpp */ #ifdef XTUPLEDOXYGEN include(String first, String second, ... ) {} #endif qt-client-4.1.0/scriptapi/include.h000066400000000000000000000012171217451700100172050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __INCLUDE_H__ #define __INCLUDE_H__ #include #include void setupInclude(QScriptEngine *engine); QScriptValue includeScript(QScriptContext *context, QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/itemlineeditsetup.cpp000066400000000000000000000124431217451700100216550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemcluster.h" #include Q_DECLARE_METATYPE(ItemLineEdit*) QScriptValue ItemLineEditToScriptValue(QScriptEngine *engine, ItemLineEdit* const &in) { return engine->newQObject(in); } void ItemLineEditFromScriptValue(const QScriptValue &object, ItemLineEdit* &out) { out = qobject_cast(object.toQObject()); } void setupItemLineEdit(QScriptEngine *engine) { qScriptRegisterMetaType(engine, ItemLineEditToScriptValue, ItemLineEditFromScriptValue); QScriptValue widget = engine->newObject(); widget.setProperty("cUndefined", QScriptValue(engine, ItemLineEdit::cUndefined), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cPurchased", QScriptValue(engine, ItemLineEdit::cPurchased), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cManufactured", QScriptValue(engine, ItemLineEdit::cManufactured), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cPhantom", QScriptValue(engine, ItemLineEdit::cPhantom), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cBreeder", QScriptValue(engine, ItemLineEdit::cBreeder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cCoProduct", QScriptValue(engine, ItemLineEdit::cCoProduct), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cByProduct", QScriptValue(engine, ItemLineEdit::cByProduct), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cReference", QScriptValue(engine, ItemLineEdit::cReference), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cCosting", QScriptValue(engine, ItemLineEdit::cCosting), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cTooling", QScriptValue(engine, ItemLineEdit::cTooling), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cOutsideProcess", QScriptValue(engine, ItemLineEdit::cOutsideProcess), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cPlanning", QScriptValue(engine, ItemLineEdit::cPlanning), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cKit", QScriptValue(engine, ItemLineEdit::cKit), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cAllItemTypes_Mask", QScriptValue(engine, ItemLineEdit::cAllItemTypes_Mask), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cPlanningMRP", QScriptValue(engine, ItemLineEdit::cPlanningMRP), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cPlanningMPS", QScriptValue(engine, ItemLineEdit::cPlanningMPS), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cPlanningNone", QScriptValue(engine, ItemLineEdit::cPlanningNone), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cPlanningAny", QScriptValue(engine, ItemLineEdit::cPlanningAny), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cItemActive", QScriptValue(engine, ItemLineEdit::cItemActive), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cSold", QScriptValue(engine, ItemLineEdit::cSold), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cLocationControlled", QScriptValue(engine, ItemLineEdit::cLocationControlled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cLotSerialControlled",QScriptValue(engine, ItemLineEdit::cLotSerialControlled),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cDefaultLocation", QScriptValue(engine, ItemLineEdit::cDefaultLocation), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cActive", QScriptValue(engine, ItemLineEdit::cActive), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cGeneralManufactured",QScriptValue(engine, ItemLineEdit::cGeneralManufactured),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cGeneralPurchased", QScriptValue(engine, ItemLineEdit::cGeneralPurchased), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cGeneralComponents", QScriptValue(engine, ItemLineEdit::cGeneralComponents), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cGeneralInventory", QScriptValue(engine, ItemLineEdit::cGeneralInventory), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cKitComponents", QScriptValue(engine, ItemLineEdit::cKitComponents), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ItemLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/itemlineeditsetup.h000066400000000000000000000010641217451700100213170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ITEMLINEEDITSETUP_H__ #define __ITEMLINEEDITSETUP_H__ void setupItemLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/metasqlhighlighterproto.cpp000066400000000000000000000046111217451700100230670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "metasqlhighlighterproto.h" #include #include #include "qtextdocumentproto.h" #include "qtexteditproto.h" #define DEBUG true void setupMetaSQLHighlighterProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new MetaSQLHighlighterProto(engine)); //engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructMetaSQLHighlighter, proto); engine->globalObject().setProperty("MetaSQLHighlighter", constructor); } QScriptValue constructMetaSQLHighlighter(QScriptContext *context, QScriptEngine *engine) { MetaSQLHighlighter *obj = 0; if (context->argumentCount() > 0) { if (QTextDocument *doc = qscriptvalue_cast(context->argument(0))) { if (DEBUG) qDebug("constructMetaSQLHighlighter(): doc = %p", doc); obj = new MetaSQLHighlighter(doc); } else if (QTextEdit *edit = qscriptvalue_cast(context->argument(0))) { if (DEBUG) qDebug("constructMetaSQLHighlighter(): edit = %p", edit); obj = new MetaSQLHighlighter(edit); } else if (QObject *qobj = qscriptvalue_cast(context->argument(0))) { if (DEBUG) qDebug("constructMetaSQLHighlighter(): qobj = %p", qobj); obj = new MetaSQLHighlighter(qobj); } } return engine->toScriptValue(obj); } MetaSQLHighlighterProto::MetaSQLHighlighterProto(QObject *parent) : QObject(parent) { } QString MetaSQLHighlighterProto::toString() const { MetaSQLHighlighter *item = qscriptvalue_cast(thisObject()); if (item) return QString("[MetaSQLHighlighter %1 on %2]") .arg(item->objectName()) .arg(item->parent() ? item->parent()->objectName() : "(no parent)"); return QString(); } qt-client-4.1.0/scriptapi/metasqlhighlighterproto.h000066400000000000000000000020101217451700100225230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __METASQLHIGHLIGHTERPROTO_H__ #define __METASQLHIGHLIGHTERPROTO_H__ #include #include #include "metasqlhighlighter.h" class QString; Q_DECLARE_METATYPE(MetaSQLHighlighter*) //Q_DECLARE_METATYPE(MetaSQLHighlighter) void setupMetaSQLHighlighterProto(QScriptEngine *engine); QScriptValue constructMetaSQLHighlighter(QScriptContext *context, QScriptEngine *engine); class MetaSQLHighlighterProto : public QObject, public QScriptable { Q_OBJECT public: MetaSQLHighlighterProto(QObject *parent); Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/orderlineeditsetup.cpp000066400000000000000000000035471217451700100220370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "ordercluster.h" #include void setupOrderLineEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("AnyStatus",QScriptValue(engine, OrderLineEdit::AnyStatus),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Unposted", QScriptValue(engine, OrderLineEdit::Unposted), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Open", QScriptValue(engine, OrderLineEdit::Open), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Closed", QScriptValue(engine, OrderLineEdit::Closed), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AnyType", QScriptValue(engine, OrderLineEdit::AnyType), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Purchase",QScriptValue(engine, OrderLineEdit::Purchase), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Return", QScriptValue(engine, OrderLineEdit::Return), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Sales", QScriptValue(engine, OrderLineEdit::Sales), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Transfer",QScriptValue(engine, OrderLineEdit::Transfer), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("OrderLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/orderlineeditsetup.h000066400000000000000000000010671217451700100214770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ORDERLINEEDITSETUP_H__ #define __ORDERLINEEDITSETUP_H__ void setupOrderLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/orreportproto.cpp000066400000000000000000000241271217451700100210620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "orreportproto.h" #include #include #include #include #include #include #include "parameterlistsetup.h" #include "qprinterproto.h" #include "qsqldatabaseproto.h" #define DEBUG false /* TODO: make this work even though orReport isn't a QObject QScriptValue orReporttoScriptValue(QScriptEngine *engine, orReport* const &item) { return engine->newQObject(item); } void orReportfromScriptValue(const QScriptValue &obj, orReport* &item) { item = qobject_cast(obj.toQObject()); } */ QScriptValue scriptBeginMultiPrint(QScriptContext *context, QScriptEngine * /*engine*/) { bool result = false; if (context->argumentCount() > 1) { QPrinter *printer = qscriptvalue_cast(context->argument(0).toObject()); bool userCanceled = false; result = orReport::beginMultiPrint(printer, userCanceled); if (DEBUG) qDebug("beginMultiPrint(%p, %d) returned %d", printer, userCanceled, result); if (context->argumentCount() > 1) { // TODO: figure out how to set userCanceled in the script } } else { QPrinter *printer = qscriptvalue_cast(context->argument(0).toObject()); result = orReport::beginMultiPrint(printer); } return result; } QScriptValue scriptEndMultiPrint(QScriptContext *context, QScriptEngine * /*engine*/) { bool result = false; if (context->argumentCount() > 0) { QPrinter *printer = qscriptvalue_cast(context->argument(0).toObject()); result = orReport::endMultiPrint(printer); if (DEBUG) qDebug("endMultiPrint(%p) returned %d", printer, result); } return result; } void setupOrReportProto(QScriptEngine *engine) { //qScriptRegisterMetaType(engine, orReporttoScriptValue, orReportfromScriptValue); QScriptValue proto = engine->newQObject(new orReportProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructOrReport, proto); engine->globalObject().setProperty("orReport", constructor); constructor.setProperty("beginMultiPrint", engine->newFunction(scriptBeginMultiPrint)); constructor.setProperty("endMultiPrint", engine->newFunction(scriptEndMultiPrint)); } QScriptValue constructOrReport(QScriptContext *context, QScriptEngine *engine) { orReport *obj = 0; if (context->argumentCount() == 0) obj = new orReport(); else if (context->argumentCount() == 1 && context->argument(0).isString()) obj = new orReport(context->argument(0).toString()); else if (context->argumentCount() == 1) obj = new orReport(qscriptvalue_cast(context->argument(0))); /* TODO: figure out how to differentiate between types of arg 1 in the meanwhile, ParameterList is used more frequently so expose that constructor else if (context->argumentCount() == 2 && context->argument(1) is a QSqlDatabase) obj = new orReport(context->argument(0).toString(), qscriptvalue_cast(context->argument(1))); */ else if (context->argumentCount() == 2 /* && context->argument(1) is a ParameterList */) obj = new orReport(context->argument(0).toString(), qscriptvalue_cast(context->argument(1).toObject())); else if (context->argumentCount() == 3) obj = new orReport(context->argument(0).toString(), qscriptvalue_cast(context->argument(1)), qscriptvalue_cast(context->argument(2))); return engine->toScriptValue(obj); } orReportProto::orReportProto(QObject *parent) : QObject(parent) { } int orReportProto::backgroundAlignment() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->backgroundAlignment(); return 0; } QImage orReportProto::backgroundImage() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->backgroundImage(); return QImage(); } unsigned char orReportProto::backgroundOpacity() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->backgroundOpacity(); return 0; } QRect orReportProto::backgroundRect() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->backgroundRect(); return QRect(); } bool orReportProto::backgroundScale() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->backgroundScale(); return false; } Qt::AspectRatioMode orReportProto::backgroundScaleMode() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->backgroundScaleMode(); return Qt::IgnoreAspectRatio; } bool orReportProto::doParamsSatisfy() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->doParamsSatisfy(); return false; } bool orReportProto::doesReportExist() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->doesReportExist(); return false; } bool orReportProto::exportToPDF(const QString& fileName) { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->exportToPDF(fileName); return false; } ParameterList orReportProto::getParamList() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->getParamList(); return ParameterList(); } bool orReportProto::isValid() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->isValid(); return false; } bool orReportProto::print(QPrinter *prtThis, bool boolSetupPrinter, bool showPreview, QWidget *parent) { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->print(prtThis, boolSetupPrinter, showPreview, parent); return false; } bool orReportProto::render(QPainter *painter, QPrinter *printer) { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->render(painter, printer); return false; } int orReportProto::reportError(QWidget *widget) { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->reportError(widget); return 0; } bool orReportProto::satisfyParams(QWidget *widget) { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->satisfyParams(widget); return false; } bool orReportProto::setDom(const QDomDocument &docPReport) { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->setDom(docPReport); return false; } void orReportProto::setBackgroundAlignment(int alignment) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundAlignment(alignment); } void orReportProto::setBackgroundImage(const QImage &image) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundImage(image); } void orReportProto::setBackgroundOpacity(unsigned char opacity) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundOpacity(opacity); } void orReportProto::setBackgroundRect(const QRect &rect) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundRect(rect); } void orReportProto::setBackgroundRect(int x, int y, int w, int h) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundRect(x, y, w, h); } void orReportProto::setBackgroundScale(bool scale) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundScale(scale); } void orReportProto::setBackgroundScaleMode(Qt::AspectRatioMode mode) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundScaleMode(mode); } void orReportProto::setDatabase(QSqlDatabase db) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setDatabase(db); } void orReportProto::setParamList(const ParameterList ¶ms) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setParamList(params); } void orReportProto::setParamList(const QStringList &list) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setParamList(list); } void orReportProto::setWatermarkFont(const QFont &font) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setWatermarkFont(font); } void orReportProto::setWatermarkOpacity(unsigned char opacity) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setWatermarkOpacity(opacity); } void orReportProto::setWatermarkText(const QString &text) { orReport *item = qscriptvalue_cast(thisObject()); if (item) item->setWatermarkText(text); } QFont orReportProto::watermarkFont() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->watermarkFont(); return QFont(); } unsigned char orReportProto::watermarkOpacity() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->watermarkOpacity(); return 0; } QString orReportProto::watermarkText() { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->watermarkText(); return QString(); } /* QString orReportProto::toString() const { orReport *item = qscriptvalue_cast(thisObject()); if (item) return item->toString(); return QString(); } */ qt-client-4.1.0/scriptapi/orreportproto.h000066400000000000000000000066641217451700100205350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ORREPORTPROTO_H__ #define __ORREPORTPROTO_H__ #include "openreports.h" #include "parameter.h" #include #include #include #include class QDomDocument; class QFont; class QPainter; class QPrinter; class QSqlDatabase; class QStringList; Q_DECLARE_METATYPE(orReport*) Q_DECLARE_METATYPE(orReport) void setupOrReportProto(QScriptEngine *engine); QScriptValue constructOrReport(QScriptContext *context, QScriptEngine *engine); class orReportProto : public QObject, public QScriptable { Q_OBJECT public: orReportProto(QObject *parent); // these are handled as properties of the global object // static bool beginMultiPrint(QPrinter *printer, bool &userCanceled); // static bool endMultiPrint(QPrinter *printer); Q_INVOKABLE int backgroundAlignment(); Q_INVOKABLE QImage backgroundImage(); Q_INVOKABLE unsigned char backgroundOpacity(); Q_INVOKABLE QRect backgroundRect(); Q_INVOKABLE bool backgroundScale(); Q_INVOKABLE Qt::AspectRatioMode backgroundScaleMode(); Q_INVOKABLE bool doParamsSatisfy(); Q_INVOKABLE bool doesReportExist(); Q_INVOKABLE bool exportToPDF(const QString& fileName); Q_INVOKABLE ParameterList getParamList(); Q_INVOKABLE bool isValid(); Q_INVOKABLE bool print(QPrinter *prtThis = 0, bool boolSetupPrinter = TRUE, bool showPreview = false, QWidget *parent = 0); Q_INVOKABLE bool render(QPainter *painter, QPrinter *printer = 0); Q_INVOKABLE int reportError(QWidget *widget); Q_INVOKABLE bool satisfyParams(QWidget *widget); Q_INVOKABLE bool setDom(const QDomDocument &docPReport); Q_INVOKABLE void setBackgroundAlignment(int alignment); Q_INVOKABLE void setBackgroundImage(const QImage &image); Q_INVOKABLE void setBackgroundOpacity(unsigned char opacity); Q_INVOKABLE void setBackgroundRect(const QRect &rect); Q_INVOKABLE void setBackgroundRect(int x, int y, int w, int h); Q_INVOKABLE void setBackgroundScale(bool scale); Q_INVOKABLE void setBackgroundScaleMode(Qt::AspectRatioMode mode); Q_INVOKABLE void setDatabase(QSqlDatabase db); Q_INVOKABLE void setParamList(const ParameterList ¶ms); Q_INVOKABLE void setParamList(const QStringList &list); Q_INVOKABLE void setWatermarkFont(const QFont &font); Q_INVOKABLE void setWatermarkOpacity(unsigned char opacity); Q_INVOKABLE void setWatermarkText(const QString &text); Q_INVOKABLE QFont watermarkFont(); Q_INVOKABLE unsigned char watermarkOpacity(); Q_INVOKABLE QString watermarkText(); //Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/parametereditproto.cpp000066400000000000000000000036711217451700100220350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "parametereditproto.h" #include #define DEBUG false QScriptValue ParameterEdittoScriptValue(QScriptEngine *engine, ParameterEdit* const &item) { return engine->newQObject(item); } void ParameterEditfromScriptValue(const QScriptValue &obj, ParameterEdit* &item) { item = qobject_cast(obj.toQObject()); } void setupParameterEditProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, ParameterEdittoScriptValue, ParameterEditfromScriptValue); QScriptValue proto = engine->newQObject(new ParameterEditProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructParameterEdit, proto); engine->globalObject().setProperty("ParameterEdit", constructor); } QScriptValue constructParameterEdit(QScriptContext *context, QScriptEngine *engine) { ParameterEdit *obj = 0; if (context->argumentCount() == 0) obj = new ParameterEdit(); else if (context->argumentCount() == 1) obj = new ParameterEdit(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() == 2) obj = new ParameterEdit(qscriptvalue_cast(context->argument(0)), (Qt::WindowFlags)(context->argument(1).toInt32())); return engine->toScriptValue(obj); } ParameterEditProto::ParameterEditProto(QObject *parent) : QObject(parent) { } qt-client-4.1.0/scriptapi/parametereditproto.h000066400000000000000000000016401217451700100214740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PARAMETEREDITPROTO_H__ #define __PARAMETEREDITPROTO_H__ #include "parameteredit.h" #include #include Q_DECLARE_METATYPE(ParameterEdit*) //Q_DECLARE_METATYPE(ParameterEdit) void setupParameterEditProto(QScriptEngine *engine); QScriptValue constructParameterEdit(QScriptContext *context, QScriptEngine *engine); class ParameterEditProto : public QObject, public QScriptable { Q_OBJECT public: ParameterEditProto(QObject *parent); }; #endif qt-client-4.1.0/scriptapi/parametergroupsetup.cpp000066400000000000000000000054341217451700100222400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "parametergroup.h" #include void setupParameterGroup(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("AdhocGroup", QScriptValue(engine, ParameterGroup::AdhocGroup), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PlannerCode", QScriptValue(engine, ParameterGroup::PlannerCode), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ProductCategory",QScriptValue(engine, ParameterGroup::ProductCategory),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ClassCode", QScriptValue(engine, ParameterGroup::ClassCode), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemGroup", QScriptValue(engine, ParameterGroup::ItemGroup), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CostCategory", QScriptValue(engine, ParameterGroup::CostCategory), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomerType", QScriptValue(engine, ParameterGroup::CustomerType), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomerGroup", QScriptValue(engine, ParameterGroup::CustomerGroup), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CurrencyNotBase",QScriptValue(engine, ParameterGroup::CurrencyNotBase),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Currency", QScriptValue(engine, ParameterGroup::Currency), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WorkCenter", QScriptValue(engine, ParameterGroup::WorkCenter), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("User", QScriptValue(engine, ParameterGroup::User), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("All", QScriptValue(engine, ParameterGroup::All), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Selected",QScriptValue(engine, ParameterGroup::Selected),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Pattern", QScriptValue(engine, ParameterGroup::Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ParameterGroup", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/parametergroupsetup.h000066400000000000000000000010721217451700100216770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PARAMETERGROUPSETUP_H__ #define __PARAMETERGROUPSETUP_H__ void setupParameterGroup(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/parameterlistsetup.cpp000066400000000000000000000026721217451700100220600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "parameterlistsetup.h" #include "qtsetup.h" QScriptValue ParameterListtoScriptValue(QScriptEngine *engine, const ParameterList ¶ms) { QScriptValue obj = engine->newObject(); for(int i = 0; i < params.count(); i++) { obj.setProperty(params.name(i), engine->newVariant(params.value(i))); } return obj; } void ParameterListfromScriptValue(const QScriptValue &obj, ParameterList ¶ms) { QScriptValueIterator it(obj); while (it.hasNext()) { it.next(); if(it.flags() & QScriptValue::SkipInEnumeration) continue; if (it.value().isArray()) { QList cpplist; for (int i = 0; i < it.value().property("length").toInt32(); i++) cpplist.append(it.value().property(i).toVariant()); params.append(it.name(), cpplist); } else params.append(it.name(), it.value().toVariant()); } } void setupParameterList(QScriptEngine *engine) { qScriptRegisterMetaType(engine, ParameterListtoScriptValue, ParameterListfromScriptValue); } qt-client-4.1.0/scriptapi/parameterlistsetup.h000066400000000000000000000015151217451700100215200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PARAMETERLISTSETUP_H__ #define __PARAMETERLISTSETUP_H__ #include #include "parameter.h" class QScriptEngine; Q_DECLARE_METATYPE(ParameterList) void setupParameterList(QScriptEngine *engine); QScriptValue ParameterListtoScriptValue(QScriptEngine *engine, const ParameterList ¶ms); void ParameterListfromScriptValue(const QScriptValue &obj, ParameterList ¶ms); #endif qt-client-4.1.0/scriptapi/projectlineeditsetup.cpp000066400000000000000000000024021217451700100223570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "projectcluster.h" #include void setupProjectLineEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Undefined", QScriptValue(engine, ProjectLineEdit::Undefined), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrder", QScriptValue(engine, ProjectLineEdit::SalesOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WorkOrder", QScriptValue(engine, ProjectLineEdit::WorkOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrder",QScriptValue(engine, ProjectLineEdit::PurchaseOrder),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ProjectLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/projectlineeditsetup.h000066400000000000000000000010751217451700100220310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PROJECTLINEEDITSETUP_H__ #define __PROJECTLINEEDITSETUP_H__ void setupProjectLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/qactionproto.cpp000066400000000000000000000270661217451700100206510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qactionproto.h" #include #include #include #include #define DEBUG false QScriptValue QActiontoScriptValue(QScriptEngine *engine, QAction* const &item) { return engine->newQObject(item); } void QActionfromScriptValue(const QScriptValue &obj, QAction* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue QActionListtoScriptValue(QScriptEngine *engine, QList const &cpplist) { QScriptValue scriptlist = engine->newArray(cpplist.size()); for (int i = 0; i < cpplist.size(); i++) scriptlist.setProperty(i, engine->newQObject(cpplist.at(i))); return scriptlist; } void QActionListfromScriptValue(const QScriptValue &obj, QList &cpplist) { cpplist.clear(); int listlen = obj.property("length").toInt32(); for (int i = 0; i < listlen; i++) { QAction *tmp = qobject_cast(obj.property(i).toQObject()); cpplist.append(tmp); } } void setupQActionProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QActiontoScriptValue, QActionfromScriptValue); qScriptRegisterMetaType(engine, QActionListtoScriptValue, QActionListfromScriptValue); QScriptValue proto = engine->newQObject(new QActionProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQAction, proto); engine->globalObject().setProperty("QAction", constructor); } QScriptValue constructQAction(QScriptContext *context, QScriptEngine *engine) { QAction *obj = 0; if (context->argumentCount() == 1 && context->argument(0).isQObject()) { if (DEBUG) qDebug("constructQAction(): calling QAction(QObject)"); obj = new QAction(context->argument(0).toQObject()); } else if (context->argumentCount() == 2 && context->argument(1).isQObject()) { if (DEBUG) qDebug("constructQAction(): calling QAction(%s, QObject)", qPrintable(context->argument(0).toString())); obj = new QAction(context->argument(0).toString(), context->argument(1).toQObject()); } else if (context->argumentCount() == 3 && context->argument(2).isQObject()) { qWarning("QActionProto's constructQAction(): can't convert arg 0 from " "QScriptValue to QIcon; using QAction(%s, QObject).", qPrintable(context->argument(1).toString())); // QIcon icon = dynamic_cast(context->argument(0).toObject()); // obj = new QAction(icon, // context->argument(1).toString(), // context->argument(2).toQObject()); obj = new QAction(context->argument(1).toString(), context->argument(2).toQObject()); } else context->throwError(QScriptContext::UnknownError, QString("Could not find an appropriate QAction constructor to call")); if (DEBUG) qDebug("constructQAction() returning %p", obj); return engine->toScriptValue(obj); } QActionProto::QActionProto(QObject *parent) : QObject(parent) { } QActionGroup *QActionProto::actionGroup() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->actionGroup(); return 0; } void QActionProto::activate(int event) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->activate((QAction::ActionEvent)event); } QList QActionProto::associatedGraphicsWidgets() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->associatedGraphicsWidgets(); return QList(); } QList QActionProto::associatedWidgets() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->associatedWidgets(); return QList(); } bool QActionProto::autoRepeat() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->autoRepeat(); return false; } QVariant QActionProto::data() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->data(); return QVariant(); } QFont QActionProto::font() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->font(); return QFont(); } QIcon QActionProto::icon() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->icon(); return QIcon(); } QString QActionProto::iconText() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->iconText(); return QString(); } bool QActionProto::isCheckable() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->isCheckable(); return false; } bool QActionProto::isChecked() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->isChecked(); return false; } bool QActionProto::isEnabled() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->isEnabled(); return false; } bool QActionProto::isIconVisibleInMenu() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->isIconVisibleInMenu(); return false; } bool QActionProto::isSeparator() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->isSeparator(); return false; } bool QActionProto::isVisible() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->isVisible(); return false; } QMenu *QActionProto::menu() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->menu(); return 0; } QAction::MenuRole QActionProto::menuRole() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->menuRole(); return QAction::NoRole; } QWidget *QActionProto::parentWidget() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->parentWidget(); return 0; } void QActionProto::setActionGroup(QActionGroup *group) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setActionGroup(group); } void QActionProto::setAutoRepeat(bool b) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setAutoRepeat(b); } void QActionProto::setCheckable(bool b) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setCheckable(b); } void QActionProto::setChecked(bool b) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setChecked(b); } void QActionProto::setData(const QVariant &userData) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setData(userData); } void QActionProto::setEnabled(bool b) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setEnabled(b); } void QActionProto::setFont(const QFont &font) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setFont(font); } void QActionProto::setIcon(const QIcon &icon) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setIcon(icon); } void QActionProto::setIconText(const QString &text) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setIconText(text); } void QActionProto::setIconVisibleInMenu(bool visible) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setIconVisibleInMenu(visible); } void QActionProto::setMenu(QMenu *menu) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setMenu(menu); } void QActionProto::setMenuRole(QAction::MenuRole menuRole) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setMenuRole((QAction::MenuRole)menuRole); } void QActionProto::setSeparator(bool b) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setSeparator(b); } void QActionProto::setShortcut(const QKeySequence &shortcut) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setShortcut(shortcut); } void QActionProto::setShortcutContext(Qt::ShortcutContext context) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setShortcutContext(context); } void QActionProto::setShortcuts(const QList &shortcuts) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setShortcuts(shortcuts); } void QActionProto::setShortcuts(int key) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setShortcuts((QKeySequence::StandardKey)key); } void QActionProto::setStatusTip(const QString &statusTip) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setStatusTip(statusTip); } void QActionProto::setText(const QString &text) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setText(text); } void QActionProto::setToolTip(const QString &tip) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setToolTip(tip); } void QActionProto::setVisible(bool b) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setVisible(b); } void QActionProto::setWhatsThis(const QString &what) { QAction *item = qscriptvalue_cast(thisObject()); if (item) item->setWhatsThis(what); } QKeySequence QActionProto::shortcut() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->shortcut(); return QKeySequence(); } Qt::ShortcutContext QActionProto::shortcutContext() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->shortcutContext(); return (Qt::ShortcutContext)0; } QList QActionProto::shortcuts() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->shortcuts(); return QList(); } bool QActionProto::showStatusText(QWidget *widget) { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->showStatusText(widget); return false; } QString QActionProto::statusTip() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->statusTip(); return QString(); } QString QActionProto::text() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->text(); return QString(); } QString QActionProto::toolTip() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->toolTip(); return QString(); } QString QActionProto::whatsThis() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return item->whatsThis(); return QString(); } QString QActionProto::toString() const { QAction *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QAction %1: %2]") .arg(item->objectName()) .arg(item->text()); return QString(); } qt-client-4.1.0/scriptapi/qactionproto.h000066400000000000000000000131771217451700100203140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QACTIONPROTO_H__ #define __QACTIONPROTO_H__ #include #include #include #include #include class QActionGroup; class QGraphicsWidget; class QString; Q_DECLARE_METATYPE(QAction*) Q_DECLARE_METATYPE(QList) void setupQActionProto(QScriptEngine *engine); QScriptValue constructQAction(QScriptContext *context, QScriptEngine *engine); class QActionProto : public QObject, public QScriptable { Q_OBJECT Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat) Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable) Q_PROPERTY(bool checked READ isChecked WRITE setChecked) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) Q_PROPERTY(QFont font READ font WRITE setFont) Q_PROPERTY(QIcon icon READ icon WRITE setIcon) Q_PROPERTY(QString iconText READ iconText WRITE setIconText) Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu) Q_PROPERTY(QAction::MenuRole menuRole READ menuRole WRITE setMenuRole) Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut) Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext) Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip) Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip) Q_PROPERTY(bool visible READ isVisible WRITE setVisible) Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis) public: QActionProto(QObject *parent); Q_INVOKABLE QActionGroup *actionGroup() const; Q_INVOKABLE void activate(int event); Q_INVOKABLE QList associatedGraphicsWidgets() const; Q_INVOKABLE QList associatedWidgets() const; Q_INVOKABLE bool autoRepeat() const; Q_INVOKABLE QVariant data() const; Q_INVOKABLE QFont font() const; Q_INVOKABLE QIcon icon() const; Q_INVOKABLE QString iconText() const; Q_INVOKABLE bool isCheckable() const; Q_INVOKABLE bool isChecked() const; Q_INVOKABLE bool isEnabled() const; Q_INVOKABLE bool isIconVisibleInMenu() const; Q_INVOKABLE bool isSeparator() const; Q_INVOKABLE bool isVisible() const; Q_INVOKABLE QMenu *menu() const; Q_INVOKABLE QAction::MenuRole menuRole() const; Q_INVOKABLE QWidget *parentWidget() const; Q_INVOKABLE void setActionGroup(QActionGroup *group); Q_INVOKABLE void setAutoRepeat(bool); Q_INVOKABLE void setCheckable(bool); Q_INVOKABLE void setChecked(bool); Q_INVOKABLE void setData(const QVariant &userData); Q_INVOKABLE void setEnabled(bool); Q_INVOKABLE void setFont(const QFont &font); Q_INVOKABLE void setIcon(const QIcon &icon); Q_INVOKABLE void setIconText(const QString &text); Q_INVOKABLE void setIconVisibleInMenu(bool visible); Q_INVOKABLE void setMenu(QMenu *menu); Q_INVOKABLE void setMenuRole(QAction::MenuRole menuRole); Q_INVOKABLE void setSeparator(bool b); Q_INVOKABLE void setShortcut(const QKeySequence &shortcut); Q_INVOKABLE void setShortcutContext(Qt::ShortcutContext context); Q_INVOKABLE void setShortcuts(const QList &shortcuts); Q_INVOKABLE void setShortcuts(int key); Q_INVOKABLE void setStatusTip(const QString &statusTip); Q_INVOKABLE void setText(const QString &text); Q_INVOKABLE void setToolTip(const QString &tip); Q_INVOKABLE void setVisible(bool); Q_INVOKABLE void setWhatsThis(const QString &what); Q_INVOKABLE QKeySequence shortcut() const; Q_INVOKABLE Qt::ShortcutContext shortcutContext() const; Q_INVOKABLE QList shortcuts() const; Q_INVOKABLE bool showStatusText(QWidget *widget = 0); Q_INVOKABLE QString statusTip() const; Q_INVOKABLE QString text() const; Q_INVOKABLE QString toolTip() const; Q_INVOKABLE QString whatsThis() const; Q_INVOKABLE QString toString() const; //signals: // void changed(); // void hovered(); // void toggled(bool checked); // void triggered(bool checked = false); }; #endif qt-client-4.1.0/scriptapi/qboxlayoutproto.cpp000066400000000000000000000250121217451700100214070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qboxlayoutproto.h" #include #include #include #define DEBUG false QScriptValue QBoxLayouttoScriptValue(QScriptEngine *engine, QBoxLayout* const &item) { return engine->newQObject(item); } void QBoxLayoutfromScriptValue(const QScriptValue &obj, QBoxLayout* &item) { item = qobject_cast(obj.toQObject()); } void setupQBoxLayoutProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QBoxLayouttoScriptValue, QBoxLayoutfromScriptValue); QScriptValue proto = engine->newQObject(new QBoxLayoutProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQBoxLayout, proto); engine->globalObject().setProperty("QBoxLayout", constructor); constructor.setProperty("LeftToRight", QScriptValue(engine, QBoxLayout::LeftToRight), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("RightToLeft", QScriptValue(engine, QBoxLayout::RightToLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("TopToBottom", QScriptValue(engine, QBoxLayout::TopToBottom), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("BottomToTop", QScriptValue(engine, QBoxLayout::BottomToTop), QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue constructQBoxLayout(QScriptContext *context, QScriptEngine *engine) { QBoxLayout *obj = 0; if (context->argumentCount() == 1) { if (DEBUG) qDebug("QBoxLayout(%s)", qPrintable(context->argument(0).toString())); obj = new QBoxLayout((QBoxLayout::Direction)(context->argument(0).toInt32())); } else if (context->argumentCount() > 1 && qobject_cast(context->argument(1).toQObject())) { if (DEBUG) qDebug("QBoxLayout(%s, %p)", qPrintable(context->argument(0).toString()), context->argument(1).toQObject()); obj = new QBoxLayout((QBoxLayout::Direction)(context->argument(0).toInt32()), qobject_cast(context->argument(1).toQObject())); } else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QBoxLayout constructor"); if (DEBUG) qDebug("constructBoxLayout returning %p", obj); return engine->toScriptValue(obj); } QBoxLayoutProto::QBoxLayoutProto(QObject *parent) : QObject(parent) { } bool QBoxLayoutProto::activate() { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->activate(); return false; } void QBoxLayoutProto::addItem(QLayoutItem *item) { QBoxLayout *boxitem = qscriptvalue_cast(thisObject()); if (boxitem) boxitem->addItem(item); } void QBoxLayoutProto::addLayout(QLayout *layout, int stretch) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addLayout(layout, stretch); } void QBoxLayoutProto::addSpacerItem(QSpacerItem *spacerItem) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addSpacerItem(spacerItem); } void QBoxLayoutProto::addSpacing(int size) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addSpacing(size); } void QBoxLayoutProto::addStretch(int stretch) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addStretch(stretch); } void QBoxLayoutProto::addStrut(int size) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addStrut(size); } void QBoxLayoutProto::addWidget(QWidget *widget, int stretch, Qt::Alignment alignment) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addWidget(widget, stretch, alignment); } QRect QBoxLayoutProto::contentsRect() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->contentsRect(); return QRect(); } int QBoxLayoutProto::count() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } QBoxLayout::Direction QBoxLayoutProto::direction() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->direction(); return QBoxLayout::LeftToRight; } Qt::Orientations QBoxLayoutProto::expandingDirections() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->expandingDirections(); return Qt::Horizontal; } void QBoxLayoutProto::getContentsMargins(int *left, int *top, int *right, int *bottom) const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->getContentsMargins(left, top, right, bottom); } int QBoxLayoutProto::indexOf(QWidget *widget) const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(widget); return 0; } void QBoxLayoutProto::insertLayout(int index, QLayout *layout, int stretch) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertLayout(index, layout, stretch); } void QBoxLayoutProto::insertSpacerItem(int index, QSpacerItem *spacerItem) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertSpacerItem(index, spacerItem); } void QBoxLayoutProto::insertSpacing(int index, int size) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertSpacing(index, size); } void QBoxLayoutProto::insertStretch(int index, int stretch) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertStretch(index, stretch); } void QBoxLayoutProto::insertWidget(int index, QWidget *widget, int stretch, Qt::Alignment alignment) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertWidget(index, widget, stretch, alignment); } void QBoxLayoutProto::invalidate() { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->invalidate(); } bool QBoxLayoutProto::isEnabled() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->isEnabled(); return false; } QLayoutItem *QBoxLayoutProto::itemAt(int index) const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->itemAt(index); return 0; } QSize QBoxLayoutProto::maximumSize() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->maximumSize(); return QSize(); } QWidget *QBoxLayoutProto::menuBar() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->menuBar(); return 0; } QSize QBoxLayoutProto::minimumSize() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumSize(); return QSize(); } QWidget *QBoxLayoutProto::parentWidget() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->parentWidget(); return 0; } void QBoxLayoutProto::removeItem(QLayoutItem *item) { QBoxLayout *boxitem = qscriptvalue_cast(thisObject()); if (boxitem) boxitem->removeItem(item); } void QBoxLayoutProto::removeWidget(QWidget *widget) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->removeWidget(widget); } void QBoxLayoutProto::setAlignment(Qt::Alignment alignment) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setAlignment(alignment); } void QBoxLayoutProto::setContentsMargins(int left, int top, int right, int bottom) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setContentsMargins(left, top, right, bottom); } void QBoxLayoutProto::setDirection(int direction) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setDirection((QBoxLayout::Direction)direction); } void QBoxLayoutProto::setEnabled(bool enable) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setEnabled(enable); } void QBoxLayoutProto::setMenuBar(QWidget *widget) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setMenuBar(widget); } void QBoxLayoutProto::setStretch(int index, int stretch) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setStretch(index, stretch); } bool QBoxLayoutProto::setAlignment(QLayout *l, Qt::Alignment alignment) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setAlignment(l, alignment); return false; } bool QBoxLayoutProto::setAlignment(QWidget *w, Qt::Alignment alignment) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setAlignment(w, alignment); return false; } bool QBoxLayoutProto::setStretchFactor(QLayout *layout, int stretch) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setStretchFactor(layout, stretch); return false; } bool QBoxLayoutProto::setStretchFactor(QWidget *widget, int stretch) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setStretchFactor(widget, stretch); return false; } int QBoxLayoutProto::stretch(int index) const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->stretch(index); return 0; } QLayoutItem *QBoxLayoutProto::takeAt(int index) { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->takeAt(index); return 0; } void QBoxLayoutProto::update() { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) item->update(); } /* QString QBoxLayoutProto::toString() const { QBoxLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->toString() const; return //QString(); } */ qt-client-4.1.0/scriptapi/qboxlayoutproto.h000066400000000000000000000065121217451700100210600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QBOXLAYOUTPROTO_H__ #define __QBOXLAYOUTPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QBoxLayout*) void setupQBoxLayoutProto(QScriptEngine *engine); QScriptValue constructQBoxLayout(QScriptContext *context, QScriptEngine *engine); class QBoxLayoutProto : public QObject, public QScriptable { Q_OBJECT public: QBoxLayoutProto(QObject *parent); Q_INVOKABLE bool activate(); Q_INVOKABLE void addItem(QLayoutItem *item); Q_INVOKABLE void addLayout(QLayout *layout, int stretch = 0); Q_INVOKABLE void addSpacerItem(QSpacerItem *spacerItem); Q_INVOKABLE void addSpacing(int size); Q_INVOKABLE void addStretch(int stretch = 0); Q_INVOKABLE void addStrut(int size); Q_INVOKABLE void addWidget(QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0); Q_INVOKABLE QRect contentsRect() const; Q_INVOKABLE int count() const; Q_INVOKABLE QBoxLayout::Direction direction() const; Q_INVOKABLE Qt::Orientations expandingDirections() const; Q_INVOKABLE void getContentsMargins(int *left, int *top, int *right, int *bottom) const; Q_INVOKABLE int indexOf(QWidget *widget) const; Q_INVOKABLE void insertLayout(int index, QLayout *layout, int stretch = 0); Q_INVOKABLE void insertSpacerItem(int index, QSpacerItem *spacerItem); Q_INVOKABLE void insertSpacing(int index, int size); Q_INVOKABLE void insertStretch(int index, int stretch = 0); Q_INVOKABLE void insertWidget(int index, QWidget *widget, int stretch = 0, Qt::Alignment alignment = 0); Q_INVOKABLE void invalidate(); Q_INVOKABLE bool isEnabled() const; Q_INVOKABLE QLayoutItem *itemAt(int index) const; Q_INVOKABLE QSize maximumSize() const; Q_INVOKABLE QWidget *menuBar() const; Q_INVOKABLE QSize minimumSize() const; Q_INVOKABLE QWidget *parentWidget() const; Q_INVOKABLE void removeItem(QLayoutItem *item); Q_INVOKABLE void removeWidget(QWidget *widget); Q_INVOKABLE void setAlignment(Qt::Alignment alignment); Q_INVOKABLE void setContentsMargins(int left, int top, int right, int bottom); //Q_INVOKABLE void setDirection(QBoxLayout::Direction direction); Q_INVOKABLE void setDirection(int direction); Q_INVOKABLE void setEnabled(bool enable); Q_INVOKABLE void setMenuBar(QWidget *widget); Q_INVOKABLE void setStretch(int index, int stretch); Q_INVOKABLE bool setAlignment(QLayout *l, Qt::Alignment alignment); Q_INVOKABLE bool setAlignment(QWidget *w, Qt::Alignment alignment); Q_INVOKABLE bool setStretchFactor(QLayout *layout, int stretch); Q_INVOKABLE bool setStretchFactor(QWidget *widget, int stretch); Q_INVOKABLE int stretch(int index) const; Q_INVOKABLE QLayoutItem *takeAt(int index); Q_INVOKABLE void update(); //Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qbytearrayproto.cpp000066400000000000000000000525211217451700100213700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qbytearrayproto.h" static QByteArray nullBA = QByteArray(); QScriptValue QByteArraytoScriptValue(QScriptEngine *engine, QByteArray* const &item) { QByteArray tmpBA = *item; QVariant *tmpVar = new QVariant(tmpBA); // TODO: memory leak? return engine->newVariant(*tmpVar); } void QByteArrayfromScriptValue(const QScriptValue &obj, QByteArray* &item) { item = new QByteArray(obj.toVariant().toByteArray()); } void setupQByteArrayProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QByteArraytoScriptValue, QByteArrayfromScriptValue); QScriptValue proto = engine->newQObject(new QByteArrayProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQByteArray, proto); engine->globalObject().setProperty("QByteArray", constructor); } QScriptValue constructQByteArray(QScriptContext *context, QScriptEngine *engine) { QByteArray *obj = 0; if (context->argumentCount() == 0) obj = new QByteArray(); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new QByteArray(*(qscriptvalue_cast(context->argument(0)))); else if (context->argumentCount() == 1 && context->argument(0).isString()) obj = new QByteArray(context->argument(0).toString().toAscii().data()); else if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isNumber()) obj = new QByteArray(context->argument(0).toString().toAscii().data(), context->argument(1).toInt32()); else if (context->argumentCount() == 2 && context->argument(0).isNumber() && context->argument(1).isString()) obj = new QByteArray(context->argument(0).toInt32(), context->argument(1).toString().at(0).toAscii()); else context->throwError(QScriptContext::UnknownError, "could not find appropriate QByteArray constructor"); return engine->toScriptValue(obj); } QByteArrayProto::QByteArrayProto(QObject *parent) : QObject(parent) { } /* QByteArray &QByteArrayProto::append(const QByteArray &ba) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->append(ba); return nullBA; } QByteArray &QByteArrayProto::append(const QString &str) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->append(str); return nullBA; } QByteArray &QByteArrayProto::append(const char *str) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->append(str); return nullBA; } QByteArray &QByteArrayProto::append(const char *str, int len) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->append(str, len); return nullBA; } QByteArray &QByteArrayProto::append(char ch) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->append(ch); return nullBA; } char QByteArrayProto::at(int i) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->at(i); return char(); } int QByteArrayProto::capacity() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->capacity(); return 0; } void QByteArrayProto::chop(int n) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->chop(n); } void QByteArrayProto::clear() { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } const char *QByteArrayProto::constData() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->constData(); return 0; } bool QByteArrayProto::contains(const QByteArray &ba) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->contains(ba); return false; } bool QByteArrayProto::contains(const char *str) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->contains(str); return false; } bool QByteArrayProto::contains(char ch) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->contains(ch); return false; } int QByteArrayProto::count(const QByteArray &ba) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->count(ba); return 0; } int QByteArrayProto::count(const char *str) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->count(str); return 0; } int QByteArrayProto::count(char ch) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->count(ch); return 0; } int QByteArrayProto::count() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } char *QByteArrayProto::data() { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->data(); return 0; } const char *QByteArrayProto::data() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->data(); return 0; } bool QByteArrayProto::endsWith(const QByteArray &ba) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->endsWith(ba); return false; } bool QByteArrayProto::endsWith(const char *str) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->endsWith(str); return false; } bool QByteArrayProto::endsWith(char ch) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->endsWith(ch); return false; } QByteArray &QByteArrayProto::fill(char ch, int size) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->fill(ch, size); return nullBA; } int QByteArrayProto::indexOf(const QByteArray &ba, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(ba, from); return 0; } int QByteArrayProto::indexOf(const QString &str, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(str, from); return 0; } int QByteArrayProto::indexOf(const char *str, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(str, from); return 0; } int QByteArrayProto::indexOf(char ch, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(ch, from); return 0; } QByteArray &QByteArrayProto::insert(int i, const QByteArray &ba) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->insert(i, ba); return nullBA; } QByteArray &QByteArrayProto::insert(int i, const QString &str) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->insert(i, str); return nullBA; } QByteArray &QByteArrayProto::insert(int i, const char *str) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->insert(i, str); return nullBA; } QByteArray &QByteArrayProto::insert(int i, char ch) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->insert(i, ch); return nullBA; } bool QByteArrayProto::isEmpty() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } bool QByteArrayProto::isNull() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(); return false; } int QByteArrayProto::lastIndexOf(const QByteArray &ba, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->lastIndexOf(ba, from); return 0; } int QByteArrayProto::lastIndexOf(const QString &str, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->lastIndexOf(str, from); return 0; } int QByteArrayProto::lastIndexOf(const char *str, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->lastIndexOf(str, from); return 0; } int QByteArrayProto::lastIndexOf(char ch, int from) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->lastIndexOf(ch, from); return 0; } QByteArray QByteArrayProto::left(int len) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->left(len); return nullBA; } QByteArray QByteArrayProto::leftJustified(int width, char fill, bool truncate) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->leftJustified(width, fill, truncate); return nullBA; } int QByteArrayProto::length() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->length(); return 0; } QByteArray QByteArrayProto::mid(int pos, int len) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->mid(pos, len); return nullBA; } QByteArray &QByteArrayProto::prepend(const QByteArray &ba) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->prepend(ba); return nullBA; } QByteArray &QByteArrayProto::prepend(const char *str) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->prepend(str); return nullBA; } QByteArray &QByteArrayProto::prepend(char ch) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->prepend(ch); return nullBA; } void QByteArrayProto::push_back(const QByteArray &other) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->push_back(other); } void QByteArrayProto::push_back(const char *str) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->push_back(str); } void QByteArrayProto::push_back(char ch) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->push_back(ch); } void QByteArrayProto::push_front(const QByteArray &other) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->push_front(other); } void QByteArrayProto::push_front(const char *str) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->push_front(str); } void QByteArrayProto::push_front(char ch) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->push_front(ch); } QByteArray &QByteArrayProto::remove(int pos, int len) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->remove(pos, len); return nullBA; } QByteArray QByteArrayProto::repeated(int times) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->repeated(times); return nullBA; } QByteArray &QByteArrayProto::replace(int pos, int len, const QByteArray &after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(pos, len, after); return nullBA; } QByteArray &QByteArrayProto::replace(int pos, int len, const char *after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(pos, len, after); return nullBA; } QByteArray &QByteArrayProto::replace(const QByteArray &before, const QByteArray &after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(const char *before, const QByteArray &after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(const char *before, int bsize, const char *after, int asize) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, bsize, after, asize); return nullBA; } QByteArray &QByteArrayProto::replace(const QByteArray &before, const char *after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(const QString &before, const QByteArray &after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(const QString &before, const char *after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(const char *before, const char *after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(char before, const QByteArray &after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(char before, const QString &after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(char before, const char *after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } QByteArray &QByteArrayProto::replace(char before, char after) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->replace(before, after); return nullBA; } void QByteArrayProto::reserve(int size) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->reserve(size); } void QByteArrayProto::resize(int size) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->resize(size); } QByteArray QByteArrayProto::right(int len) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->right(len); return nullBA; } QByteArray QByteArrayProto::rightJustified(int width, char fill, bool truncate) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->rightJustified(width, fill, truncate); return nullBA; } QByteArray &QByteArrayProto::setNum(int n, int base) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, base); return nullBA; } QByteArray &QByteArrayProto::setNum(uint n, int base) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, base); return nullBA; } QByteArray &QByteArrayProto::setNum(short n, int base) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, base); return nullBA; } QByteArray &QByteArrayProto::setNum(ushort n, int base) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, base); return nullBA; } QByteArray &QByteArrayProto::setNum(qlonglong n, int base) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, base); return nullBA; } QByteArray &QByteArrayProto::setNum(qulonglong n, int base) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, base); return nullBA; } QByteArray &QByteArrayProto::setNum(double n, char f, int prec) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, f, prec); return nullBA; } QByteArray &QByteArrayProto::setNum(float n, char f, int prec) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->setNum(n, f, prec); return nullBA; } QByteArray QByteArrayProto::simplified() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->simplified(); return nullBA; } int QByteArrayProto::size() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } QList QByteArrayProto::split(char sep) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->split(sep); return QList(); } void QByteArrayProto::squeeze() { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->squeeze(); } bool QByteArrayProto::startsWith(const QByteArray &ba) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->startsWith(ba); return false; } bool QByteArrayProto::startsWith(const char *str) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->startsWith(str); return false; } bool QByteArrayProto::startsWith(char ch) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->startsWith(ch); return false; } QByteArray QByteArrayProto::toBase64() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toBase64(); return nullBA; } double QByteArrayProto::toDouble(bool *ok) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toDouble(ok); return double(); } float QByteArrayProto::toFloat(bool *ok) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toFloat(ok); return float(); } QByteArray QByteArrayProto::toHex() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toHex(); return nullBA; } int QByteArrayProto::toInt(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toInt(ok, base); return 0; } long QByteArrayProto::toLong(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toLong(ok, base); return long(); } qlonglong QByteArrayProto::toLongLong(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toLongLong(ok, base); return qlonglong(); } QByteArray QByteArrayProto::toLower() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toLower(); return nullBA; } QByteArray QByteArrayProto::toPercentEncoding(const QByteArray &exclude, const QByteArray &include, char percent) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toPercentEncoding(exclude, include, percent); return nullBA; } short QByteArrayProto::toShort(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toShort(ok, base); return short(); } uint QByteArrayProto::toUInt(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toUInt(ok, base); return 0; } ulong QByteArrayProto::toULong(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toULong(ok, base); return ulong(); } qulonglong QByteArrayProto::toULongLong(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toULongLong(ok, base); return qulonglong(); } ushort QByteArrayProto::toUShort(bool *ok, int base) const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toUShort(ok, base); return ushort(); } QByteArray QByteArrayProto::toUpper() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->toUpper(); return nullBA; } QByteArray QByteArrayProto::trimmed() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return item->trimmed(); return nullBA; } void QByteArrayProto::truncate(int pos) { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) item->truncate(pos); } */ QString QByteArrayProto::toString() const { QByteArray *item = qscriptvalue_cast(thisObject()); if (item) return QString(*item); return QString(); } qt-client-4.1.0/scriptapi/qbytearrayproto.h000066400000000000000000000152711217451700100210360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QBYTEARRAYPROTO_H__ #define __QBYTEARRAYPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QByteArray*) void setupQByteArrayProto(QScriptEngine *engine); QScriptValue constructQByteArray(QScriptContext *context, QScriptEngine *engine); class QByteArrayProto : public QObject, public QScriptable { Q_OBJECT public: QByteArrayProto(QObject *parent); /* Q_INVOKABLE QByteArray &append(const QByteArray &ba); Q_INVOKABLE QByteArray &append(const QString &str); Q_INVOKABLE QByteArray &append(const char *str); Q_INVOKABLE QByteArray &append(const char *str, int len); Q_INVOKABLE QByteArray &append(char ch); Q_INVOKABLE char at(int i) const; Q_INVOKABLE int capacity() const; Q_INVOKABLE void chop(int n); Q_INVOKABLE void clear(); Q_INVOKABLE const char *constData() const; Q_INVOKABLE bool contains(const QByteArray &ba) const; Q_INVOKABLE bool contains(const char *str) const; Q_INVOKABLE bool contains(char ch) const; Q_INVOKABLE int count(const QByteArray &ba) const; Q_INVOKABLE int count(const char *str) const; Q_INVOKABLE int count(char ch) const; Q_INVOKABLE int count() const; Q_INVOKABLE char *data(); Q_INVOKABLE const char *data() const; Q_INVOKABLE bool endsWith(const QByteArray &ba) const; Q_INVOKABLE bool endsWith(const char *str) const; Q_INVOKABLE bool endsWith(char ch) const; Q_INVOKABLE QByteArray &fill(char ch, int size = -1); Q_INVOKABLE int indexOf(const QByteArray &ba, int from = 0) const; Q_INVOKABLE int indexOf(const QString &str, int from = 0) const; Q_INVOKABLE int indexOf(const char *str, int from = 0) const; Q_INVOKABLE int indexOf(char ch, int from = 0) const; Q_INVOKABLE QByteArray &insert(int i, const QByteArray &ba); Q_INVOKABLE QByteArray &insert(int i, const QString &str); Q_INVOKABLE QByteArray &insert(int i, const char *str); Q_INVOKABLE QByteArray &insert(int i, char ch); Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE bool isNull() const; Q_INVOKABLE int lastIndexOf(const QByteArray &ba, int from = -1) const; Q_INVOKABLE int lastIndexOf(const QString &str, int from = -1) const; Q_INVOKABLE int lastIndexOf(const char *str, int from = -1) const; Q_INVOKABLE int lastIndexOf(char ch, int from = -1) const; Q_INVOKABLE QByteArray left(int len) const; Q_INVOKABLE QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const; Q_INVOKABLE int length() const; Q_INVOKABLE QByteArray mid(int pos, int len = -1) const; Q_INVOKABLE QByteArray &prepend(const QByteArray &ba); Q_INVOKABLE QByteArray &prepend(const char *str); Q_INVOKABLE QByteArray &prepend(char ch); Q_INVOKABLE void push_back(const QByteArray &other); Q_INVOKABLE void push_back(const char *str); Q_INVOKABLE void push_back(char ch); Q_INVOKABLE void push_front(const QByteArray &other); Q_INVOKABLE void push_front(const char *str); Q_INVOKABLE void push_front(char ch); Q_INVOKABLE QByteArray &remove(int pos, int len); Q_INVOKABLE QByteArray repeated(int times) const; Q_INVOKABLE QByteArray &replace(int pos, int len, const QByteArray &after); Q_INVOKABLE QByteArray &replace(int pos, int len, const char *after); Q_INVOKABLE QByteArray &replace(const QByteArray &before, const QByteArray &after); Q_INVOKABLE QByteArray &replace(const char *before, const QByteArray &after); Q_INVOKABLE QByteArray &replace(const char *before, int bsize, const char *after, int asize); Q_INVOKABLE QByteArray &replace(const QByteArray &before, const char *after); Q_INVOKABLE QByteArray &replace(const QString &before, const QByteArray &after); Q_INVOKABLE QByteArray &replace(const QString &before, const char *after); Q_INVOKABLE QByteArray &replace(const char *before, const char *after); Q_INVOKABLE QByteArray &replace(char before, const QByteArray &after); Q_INVOKABLE QByteArray &replace(char before, const QString &after); Q_INVOKABLE QByteArray &replace(char before, const char *after); Q_INVOKABLE QByteArray &replace(char before, char after); Q_INVOKABLE void reserve(int size); Q_INVOKABLE void resize(int size); Q_INVOKABLE QByteArray right(int len) const; Q_INVOKABLE QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const; Q_INVOKABLE QByteArray &setNum(int n, int base = 10); Q_INVOKABLE QByteArray &setNum(uint n, int base = 10); Q_INVOKABLE QByteArray &setNum(short n, int base = 10); Q_INVOKABLE QByteArray &setNum(ushort n, int base = 10); Q_INVOKABLE QByteArray &setNum(qlonglong n, int base = 10); Q_INVOKABLE QByteArray &setNum(qulonglong n, int base = 10); Q_INVOKABLE QByteArray &setNum(double n, char f = 'g', int prec = 6); Q_INVOKABLE QByteArray &setNum(float n, char f = 'g', int prec = 6); Q_INVOKABLE QByteArray simplified() const; Q_INVOKABLE int size() const; Q_INVOKABLE QList split(char sep) const; Q_INVOKABLE void squeeze(); Q_INVOKABLE bool startsWith(const QByteArray &ba) const; Q_INVOKABLE bool startsWith(const char *str) const; Q_INVOKABLE bool startsWith(char ch) const; Q_INVOKABLE QByteArray toBase64() const; Q_INVOKABLE double toDouble(bool *ok = 0) const; Q_INVOKABLE float toFloat(bool *ok = 0) const; Q_INVOKABLE QByteArray toHex() const; Q_INVOKABLE int toInt(bool *ok = 0, int base = 10) const; Q_INVOKABLE long toLong(bool *ok = 0, int base = 10) const; Q_INVOKABLE qlonglong toLongLong(bool *ok = 0, int base = 10) const; Q_INVOKABLE QByteArray toLower() const; Q_INVOKABLE QByteArray toPercentEncoding(const QByteArray &exclude = QByteArray(), const QByteArray &include = QByteArray(), char percent = '%') const; Q_INVOKABLE short toShort(bool *ok = 0, int base = 10) const; Q_INVOKABLE uint toUInt(bool *ok = 0, int base = 10) const; Q_INVOKABLE ulong toULong(bool *ok = 0, int base = 10) const; Q_INVOKABLE qulonglong toULongLong(bool *ok = 0, int base = 10) const; Q_INVOKABLE ushort toUShort(bool *ok = 0, int base = 10) const; Q_INVOKABLE QByteArray toUpper() const; Q_INVOKABLE QByteArray trimmed() const; Q_INVOKABLE void truncate(int pos); */ Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdialogbuttonboxproto.cpp000066400000000000000000000244301217451700100225700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdialogbuttonboxproto.h" #include #include QScriptValue QDialogButtonBoxtoScriptValue(QScriptEngine *engine, QDialogButtonBox* const &item) { return engine->newQObject(item); } void QDialogButtonBoxfromScriptValue(const QScriptValue &obj, QDialogButtonBox* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue QDialogButtonBoxButtonLayouttoScriptValue(QScriptEngine *engine, const enum QDialogButtonBox::ButtonLayout &p) { return QScriptValue(engine, (int)p); } void QDialogButtonBoxButtonLayoutfromScriptValue(const QScriptValue &obj, enum QDialogButtonBox::ButtonLayout &p) { p = (enum QDialogButtonBox::ButtonLayout)obj.toInt32(); } QScriptValue QDialogButtonBoxButtonRoletoScriptValue(QScriptEngine *engine, const enum QDialogButtonBox::ButtonRole &p) { return QScriptValue(engine, (int)p); } void QDialogButtonBoxButtonRolefromScriptValue(const QScriptValue &obj, enum QDialogButtonBox::ButtonRole &p) { p = (enum QDialogButtonBox::ButtonRole)obj.toInt32(); } QScriptValue QDialogButtonBoxStandardButtontoScriptValue(QScriptEngine *engine, const enum QDialogButtonBox::StandardButton &p) { return QScriptValue(engine, (int)p); } void QDialogButtonBoxStandardButtonfromScriptValue(const QScriptValue &obj, enum QDialogButtonBox::StandardButton &p) { p = (enum QDialogButtonBox::StandardButton)obj.toInt32(); } void setupQDialogButtonBoxProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QDialogButtonBoxtoScriptValue, QDialogButtonBoxfromScriptValue); QScriptValue proto = engine->newQObject(new QDialogButtonBoxProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDialogButtonBox, proto); engine->globalObject().setProperty("QDialogButtonBox", constructor); // enum ButtonLayout qScriptRegisterMetaType(engine, QDialogButtonBoxButtonLayouttoScriptValue, QDialogButtonBoxButtonLayoutfromScriptValue); constructor.setProperty("WinLayout", QScriptValue(engine, QDialogButtonBox::WinLayout), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("MacLayout", QScriptValue(engine, QDialogButtonBox::MacLayout), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("KdeLayout", QScriptValue(engine, QDialogButtonBox::KdeLayout), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("GnomeLayout", QScriptValue(engine, QDialogButtonBox::GnomeLayout), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum ButtonRole qScriptRegisterMetaType(engine, QDialogButtonBoxButtonRoletoScriptValue, QDialogButtonBoxButtonRolefromScriptValue); constructor.setProperty("InvalidRole", QScriptValue(engine, QDialogButtonBox::InvalidRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("AcceptRole", QScriptValue(engine, QDialogButtonBox::AcceptRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("RejectRole", QScriptValue(engine, QDialogButtonBox::RejectRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("DestructiveRole", QScriptValue(engine, QDialogButtonBox::DestructiveRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("ActionRole", QScriptValue(engine, QDialogButtonBox::ActionRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("HelpRole", QScriptValue(engine, QDialogButtonBox::HelpRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("YesRole", QScriptValue(engine, QDialogButtonBox::YesRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("NoRole", QScriptValue(engine, QDialogButtonBox::NoRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("ApplyRole", QScriptValue(engine, QDialogButtonBox::ApplyRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("ResetRole", QScriptValue(engine, QDialogButtonBox::ResetRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum StandardButton qScriptRegisterMetaType(engine, QDialogButtonBoxStandardButtontoScriptValue, QDialogButtonBoxStandardButtonfromScriptValue); constructor.setProperty("Ok", QScriptValue(engine, QDialogButtonBox::Ok), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Open", QScriptValue(engine, QDialogButtonBox::Open), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Save", QScriptValue(engine, QDialogButtonBox::Save ), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Cancel", QScriptValue(engine, QDialogButtonBox::Cancel), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Close", QScriptValue(engine, QDialogButtonBox::Close), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Discard", QScriptValue(engine, QDialogButtonBox::Discard), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Apply", QScriptValue(engine, QDialogButtonBox::Apply), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Reset", QScriptValue(engine, QDialogButtonBox::Reset), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("RestoreDefaults", QScriptValue(engine, QDialogButtonBox::RestoreDefaults), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Help", QScriptValue(engine, QDialogButtonBox::Help), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("SaveAll", QScriptValue(engine, QDialogButtonBox::SaveAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Yes", QScriptValue(engine, QDialogButtonBox::Yes), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("YesToAll", QScriptValue(engine, QDialogButtonBox::YesToAll ), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("No", QScriptValue(engine, QDialogButtonBox::No), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("NoToAll", QScriptValue(engine, QDialogButtonBox::NoToAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Abort", QScriptValue(engine, QDialogButtonBox::Abort), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Retry", QScriptValue(engine, QDialogButtonBox::Retry), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Ignore", QScriptValue(engine, QDialogButtonBox::Ignore), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("NoButton", QScriptValue(engine, QDialogButtonBox::NoButton), QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue constructQDialogButtonBox(QScriptContext * context, QScriptEngine *engine) { QDialogButtonBox *obj = 0; if (context->argumentCount() == 3) { obj = new QDialogButtonBox((QDialogButtonBox::StandardButton)(context->argument(0).toInt32()), (Qt::Orientation)(context->argument(1).toInt32()), qobject_cast(context->argument(2).toQObject())); } else if (context->argumentCount() == 2) { obj = new QDialogButtonBox((Qt::Orientation)(context->argument(0).toInt32()), qobject_cast(context->argument(1).toQObject())); } else if (context->argumentCount() == 1) { obj = new QDialogButtonBox(qobject_cast(context->argument(0).toQObject())); } else obj = new QDialogButtonBox(); return engine->toScriptValue(obj); } QDialogButtonBoxProto::QDialogButtonBoxProto(QObject *parent) : QObject(parent) { } void QDialogButtonBoxProto::addButton ( QAbstractButton * button, QDialogButtonBox::ButtonRole role ) { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) item->addButton ( button, role ); } QPushButton * QDialogButtonBoxProto::addButton ( const QString & text, QDialogButtonBox::ButtonRole role ) { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) return item->addButton( text, role ); return 0; } QPushButton * QDialogButtonBoxProto::addButton ( QDialogButtonBox::StandardButton button ) { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) return item->addButton( button ); return 0; } QPushButton* QDialogButtonBoxProto::button ( QDialogButtonBox::StandardButton which ) const { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) return item->button( which ); return 0; } QDialogButtonBox::ButtonRole QDialogButtonBoxProto::buttonRole ( QAbstractButton * button ) const { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) return item->buttonRole(button); return QDialogButtonBox::NoRole; } QList QDialogButtonBoxProto::buttons () const { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) return item->buttons(); return QList(); } void QDialogButtonBoxProto::clear () { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } void QDialogButtonBoxProto::removeButton ( QAbstractButton * button ) { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) item->removeButton(button); } QDialogButtonBox::StandardButton QDialogButtonBoxProto::standardButton ( QAbstractButton * button ) const { QDialogButtonBox *item = qscriptvalue_cast(thisObject()); if (item) return item->standardButton(button); return QDialogButtonBox::NoButton; } qt-client-4.1.0/scriptapi/qdialogbuttonboxproto.h000066400000000000000000000033641217451700100222400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDIALOGBUTTONBOX_H__ #define __QDIALOGBUTTONBOX_H__ #include #include #include Q_DECLARE_METATYPE(QDialogButtonBox*) Q_DECLARE_METATYPE(QDialogButtonBox::ButtonLayout) Q_DECLARE_METATYPE(QDialogButtonBox::ButtonRole) Q_DECLARE_METATYPE(QDialogButtonBox::StandardButton) void setupQDialogButtonBoxProto(QScriptEngine *engine); QScriptValue constructQDialogButtonBox(QScriptContext *context, QScriptEngine *engine); class QDialogButtonBoxProto : public QObject, public QScriptable { Q_OBJECT public: QDialogButtonBoxProto(QObject *parent); Q_INVOKABLE void addButton ( QAbstractButton * button, QDialogButtonBox::ButtonRole role ); Q_INVOKABLE QPushButton * addButton ( const QString & text, QDialogButtonBox::ButtonRole role ); Q_INVOKABLE QPushButton * addButton ( QDialogButtonBox::StandardButton button ); Q_INVOKABLE QPushButton * button ( QDialogButtonBox::StandardButton which ) const; Q_INVOKABLE QDialogButtonBox::ButtonRole buttonRole ( QAbstractButton * button ) const; Q_INVOKABLE QList buttons () const; Q_INVOKABLE void clear (); Q_INVOKABLE void removeButton ( QAbstractButton * button ); Q_INVOKABLE QDialogButtonBox::StandardButton standardButton ( QAbstractButton * button ) const; }; #endif qt-client-4.1.0/scriptapi/qdialogsetup.cpp000066400000000000000000000016531217451700100206220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include void setupQDialog(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Accepted", QScriptValue(engine, QDialog::Accepted), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Rejected", QScriptValue(engine, QDialog::Rejected), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("QDialog", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/qdialogsetup.h000066400000000000000000000010451217451700100202620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDIALOGSETUP_H__ #define __QDIALOGSETUP_H__ void setupQDialog(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/qdirproto.cpp000066400000000000000000000572701217451700100201520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scriptapi_internal.h" #include "qdirproto.h" /** \ingroup scriptapi \brief Expose QDir class to scriptiong \todo implement QDir::drives() */ static QScriptValue qdir_addSearchPath(QScriptContext *context, QScriptEngine * /*engine*/ ) { if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isString()) QDir::addSearchPath(context->argument(0).toString(), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Coule not find an appropriate QDir::addSearchPath()"); return QScriptValue(); } static QScriptValue qdir_cleanPath(QScriptContext *context, QScriptEngine * /*engine*/ ) { QString result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QDir::cleanPath(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::cleanPath()"); return QScriptValue(result); } static QScriptValue qdir_current(QScriptContext * /*context*/, QScriptEngine *engine ) { QVariant v; v.setValue(new QDir(QDir::current())); return engine->newVariant(v); } static QScriptValue qdir_currentPath(QScriptContext * /*context*/, QScriptEngine * /*engine*/ ) { QString result = QDir::currentPath(); return QScriptValue(result); } static QScriptValue qdir_drives(QScriptContext * /*context*/, QScriptEngine * /*engine*/ ) { /* QFileInfoList result = QDir::drives(); return QScriptValue(result); */ return QScriptValue(); } static QScriptValue qdir_fromNativeSeparators(QScriptContext *context, QScriptEngine * /*engine*/ ) { QString result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QDir::fromNativeSeparators(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::fromNativeSeparators()"); return QScriptValue(result); } static QScriptValue qdir_home(QScriptContext * /*context*/, QScriptEngine *engine) { QVariant v; v.setValue(new QDir(QDir::home())); return engine->newVariant(v); } static QScriptValue qdir_homePath(QScriptContext *context, QScriptEngine *engine) { Q_UNUSED(context); Q_UNUSED(engine); QString result = QDir::homePath(); return QScriptValue(result); } static QScriptValue qdir_isAbsolutePath(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QDir::isAbsolutePath(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::isAbsolutePath()"); return QScriptValue(result); } static QScriptValue qdir_isRelativePath(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QDir::isRelativePath(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::isiRelativePath()"); return QScriptValue(result); } static QScriptValue qdir_match(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isString()) result = QDir::match(context->argument(0).toString(), context->argument(1).toString()); else if (context->argumentCount() == 2 && context->argument(0).isArray() && context->argument(1).isString()) result = QDir::match(context->argument(0).toVariant().toStringList(), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::match()"); return QScriptValue(result); } static QScriptValue qdir_root(QScriptContext * /*context*/, QScriptEngine *engine) { QVariant v; v.setValue(new QDir(QDir::root())); return engine->newVariant(v); } static QScriptValue qdir_rootPath(QScriptContext *context, QScriptEngine *engine) { Q_UNUSED(context); Q_UNUSED(engine); QString result = QDir::rootPath(); return QScriptValue(result); } static QScriptValue qdir_searchPaths(QScriptContext *context, QScriptEngine *engine) { QStringList result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QDir::searchPaths(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::searchPaths()"); return engine->newVariant(result); } static QScriptValue qdir_separator(QScriptContext * /*context*/, QScriptEngine * /*engine*/ ) { QChar result = QDir::separator(); return QScriptValue(result); } static QScriptValue qdir_setCurrent(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QDir::setCurrent(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::setCurrent()"); return QScriptValue(result); } static QScriptValue qdir_setSearchPaths(QScriptContext *context, QScriptEngine * /*engine*/ ) { if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isArray()) QDir::setSearchPaths(context->argument(0).toString(), context->argument(0).toVariant().toStringList()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QDir::setSearchPaths()"); return QScriptValue(); } static QScriptValue qdir_temp(QScriptContext * /*context*/, QScriptEngine *engine) { QVariant v; v.setValue(new QDir(QDir::temp())); return engine->newVariant(v); } static QScriptValue qdir_tempPath(QScriptContext * /*context*/, QScriptEngine * /*engine*/ ) { QString result = QDir::tempPath(); return QScriptValue(result); } static QScriptValue qdir_toNativeSeparators(QScriptContext *context, QScriptEngine * /*engine*/ ) { QString result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QDir::toNativeSeparators(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate " "QDir::toNativeSeparators()"); return QScriptValue(result); } void setupQDirProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDirProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDir, proto); engine->globalObject().setProperty("QDir", constructor, CTORPROPFLAGS); constructor.setProperty("addSearchPath", engine->newFunction(qdir_addSearchPath), STATICPROPFLAGS); constructor.setProperty("cleanPath", engine->newFunction(qdir_cleanPath), STATICPROPFLAGS); constructor.setProperty("current", engine->newFunction(qdir_current), STATICPROPFLAGS); constructor.setProperty("currentPath", engine->newFunction(qdir_currentPath), STATICPROPFLAGS); constructor.setProperty("drives", engine->newFunction(qdir_drives), STATICPROPFLAGS); constructor.setProperty("fromNativeSeparators", engine->newFunction(qdir_fromNativeSeparators),STATICPROPFLAGS); constructor.setProperty("home", engine->newFunction(qdir_home), STATICPROPFLAGS); constructor.setProperty("homePath", engine->newFunction(qdir_homePath), STATICPROPFLAGS); constructor.setProperty("isAbsolutePath", engine->newFunction(qdir_isAbsolutePath), STATICPROPFLAGS); constructor.setProperty("isRelativePath", engine->newFunction(qdir_isRelativePath), STATICPROPFLAGS); constructor.setProperty("match", engine->newFunction(qdir_match), STATICPROPFLAGS); constructor.setProperty("root", engine->newFunction(qdir_root), STATICPROPFLAGS); constructor.setProperty("rootPath", engine->newFunction(qdir_rootPath), STATICPROPFLAGS); constructor.setProperty("searchPaths", engine->newFunction(qdir_searchPaths), STATICPROPFLAGS); constructor.setProperty("separator", engine->newFunction(qdir_separator), STATICPROPFLAGS); constructor.setProperty("setCurrent", engine->newFunction(qdir_setCurrent), STATICPROPFLAGS); constructor.setProperty("setSearchPaths", engine->newFunction(qdir_setSearchPaths), STATICPROPFLAGS); constructor.setProperty("temp", engine->newFunction(qdir_temp), STATICPROPFLAGS); constructor.setProperty("tempPath", engine->newFunction(qdir_tempPath), STATICPROPFLAGS); constructor.setProperty("toNativeSeparators", engine->newFunction(qdir_toNativeSeparators), STATICPROPFLAGS); constructor.setProperty("Dirs", QScriptValue(engine, QDir::Dirs), ENUMPROPFLAGS); constructor.setProperty("AllDirs", QScriptValue(engine, QDir::AllDirs), ENUMPROPFLAGS); constructor.setProperty("Files", QScriptValue(engine, QDir::Files), ENUMPROPFLAGS); constructor.setProperty("Drives", QScriptValue(engine, QDir::Drives), ENUMPROPFLAGS); constructor.setProperty("NoSymLinks", QScriptValue(engine, QDir::NoSymLinks), ENUMPROPFLAGS); constructor.setProperty("NoDotAndDotDot", QScriptValue(engine, QDir::NoDotAndDotDot), ENUMPROPFLAGS); constructor.setProperty("AllEntries", QScriptValue(engine, QDir::AllEntries), ENUMPROPFLAGS); constructor.setProperty("Readable", QScriptValue(engine, QDir::Readable), ENUMPROPFLAGS); constructor.setProperty("Writable", QScriptValue(engine, QDir::Writable), ENUMPROPFLAGS); constructor.setProperty("Executable", QScriptValue(engine, QDir::Executable), ENUMPROPFLAGS); constructor.setProperty("Modified", QScriptValue(engine, QDir::Modified), ENUMPROPFLAGS); constructor.setProperty("Hidden", QScriptValue(engine, QDir::Hidden), ENUMPROPFLAGS); constructor.setProperty("System", QScriptValue(engine, QDir::System), ENUMPROPFLAGS); constructor.setProperty("CaseSensitive", QScriptValue(engine, QDir::CaseSensitive), ENUMPROPFLAGS); constructor.setProperty("Name", QScriptValue(engine, QDir::Name), ENUMPROPFLAGS); constructor.setProperty("Time", QScriptValue(engine, QDir::Time), ENUMPROPFLAGS); constructor.setProperty("Size", QScriptValue(engine, QDir::Size), ENUMPROPFLAGS); constructor.setProperty("Type", QScriptValue(engine, QDir::Type), ENUMPROPFLAGS); constructor.setProperty("Unsorted", QScriptValue(engine, QDir::Unsorted), ENUMPROPFLAGS); constructor.setProperty("NoSort", QScriptValue(engine, QDir::NoSort), ENUMPROPFLAGS); constructor.setProperty("DirsFirst", QScriptValue(engine, QDir::DirsFirst), ENUMPROPFLAGS); constructor.setProperty("DirsLast", QScriptValue(engine, QDir::DirsLast), ENUMPROPFLAGS); constructor.setProperty("Reversed", QScriptValue(engine, QDir::Reversed), ENUMPROPFLAGS); constructor.setProperty("IgnoreCase", QScriptValue(engine, QDir::IgnoreCase), ENUMPROPFLAGS); constructor.setProperty("LocaleAware", QScriptValue(engine, QDir::LocaleAware), ENUMPROPFLAGS); } QScriptValue constructQDir(QScriptContext *context, QScriptEngine *engine) { QDir *obj = 0; if (context->argumentCount() == 1 && context->argument(0).isString()) obj = new QDir(context->argument(0).toString()); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new QDir(*(qscriptvalue_cast(context->argument(0)))); else if (context->argumentCount() >= 2 && context->argument(0).isString() && context->argument(1).isString()) { obj = new QDir(context->argument(0).toString(), context->argument(1).toString()); if (context->argumentCount() >= 3 && context->argument(2).isNumber()) obj->setSorting((QDir::SortFlags)(context->argument(2).toInt32())); if (context->argumentCount() >= 4 && context->argument(3).isNumber()) obj->setFilter((QDir::Filters)(context->argument(3).toInt32())); } else obj = new QDir(); return engine->toScriptValue(obj); } QDirProto::QDirProto(QObject *parent) : QObject(parent) { } QString QDirProto::absoluteFilePath(const QString &fileName) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->absoluteFilePath(fileName); else if (! thisObject().isNull()) return thisObject().toVariant().value().absoluteFilePath(fileName); return QString(); } QString QDirProto::absolutePath() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->absolutePath(); else if (! thisObject().isNull()) return thisObject().toVariant().value().absolutePath(); return QString(); } QString QDirProto::canonicalPath() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->canonicalPath(); else if (! thisObject().isNull()) return thisObject().toVariant().value().canonicalPath(); return QString(); } bool QDirProto::cd(const QString &dirName) { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->cd(dirName); else if (! thisObject().isNull()) return thisObject().toVariant().value().cd(dirName); return false; } bool QDirProto::cdUp() { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->cdUp(); else if (! thisObject().isNull()) return thisObject().toVariant().value().cdUp(); return false; } uint QDirProto::count() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); else if (! thisObject().isNull()) return thisObject().toVariant().value().count(); return 0; } QString QDirProto::dirName() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->dirName(); else if (! thisObject().isNull()) return thisObject().toVariant().value().dirName(); return QString(); } QFileInfoList QDirProto::entryInfoList(const QStringList &nameFilters, QDir::Filters filters, QDir::SortFlags sort) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->entryInfoList(nameFilters, filters, sort); else if (! thisObject().isNull()) return thisObject().toVariant().value().entryInfoList(nameFilters, filters, sort); return QFileInfoList(); } QFileInfoList QDirProto::entryInfoList(QDir::Filters filters, QDir::SortFlags sort) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->entryInfoList(filters, sort); else if (! thisObject().isNull()) return thisObject().toVariant().value().entryInfoList(filters, sort); return QFileInfoList(); } QStringList QDirProto::entryList(const QStringList &nameFilters, QDir::Filters filters, QDir::SortFlags sort) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->entryList(nameFilters, filters, sort); else if (! thisObject().isNull()) return thisObject().toVariant().value().entryList(nameFilters, filters, sort); return QStringList(); } QStringList QDirProto::entryList(QDir::Filters filters, QDir::SortFlags sort) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->entryList(filters, sort); else if (! thisObject().isNull()) return thisObject().toVariant().value().entryList(filters, sort); return QStringList(); } bool QDirProto::exists(const QString &name) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->exists(name); else if (! thisObject().isNull()) return thisObject().toVariant().value().exists(name); return false; } bool QDirProto::exists() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->exists(); else if (! thisObject().isNull()) return thisObject().toVariant().value().exists(); return false; } QString QDirProto::filePath(const QString &fileName) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->filePath(fileName); else if (! thisObject().isNull()) return thisObject().toVariant().value().filePath(fileName); return QString(); } QDir::Filters QDirProto::filter() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->filter(); else if (! thisObject().isNull()) return thisObject().toVariant().value().filter(); return QDir::Filters(); } bool QDirProto::isAbsolute() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->isAbsolute(); else if (! thisObject().isNull()) return thisObject().toVariant().value().isAbsolute(); return false; } bool QDirProto::isReadable() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->isReadable(); else if (! thisObject().isNull()) return thisObject().toVariant().value().isReadable(); return false; } bool QDirProto::isRelative() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->isRelative(); else if (! thisObject().isNull()) return thisObject().toVariant().value().isRelative(); return false; } bool QDirProto::isRoot() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->isRoot(); else if (! thisObject().isNull()) return thisObject().toVariant().value().isRoot(); return false; } bool QDirProto::makeAbsolute() { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->makeAbsolute(); else if (! thisObject().isNull()) return thisObject().toVariant().value().makeAbsolute(); return false; } bool QDirProto::mkdir(const QString &dirName) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->mkdir(dirName); else if (! thisObject().isNull()) return thisObject().toVariant().value().mkdir(dirName); return false; } bool QDirProto::mkpath(const QString &dirPath) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->mkpath(dirPath); else if (! thisObject().isNull()) return thisObject().toVariant().value().mkpath(dirPath); return false; } QStringList QDirProto::nameFilters() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->nameFilters(); else if (! thisObject().isNull()) return thisObject().toVariant().value().nameFilters(); return QStringList(); } QString QDirProto::path() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->path(); else if (! thisObject().isNull()) return thisObject().toVariant().value().path(); return QString(); } void QDirProto::refresh() { QDir *item = qscriptvalue_cast(thisObject()); if (item) item->refresh(); else if (! thisObject().isNull()) thisObject().toVariant().value().refresh(); } QString QDirProto::relativeFilePath(const QString &fileName) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->relativeFilePath(fileName); else if (! thisObject().isNull()) return thisObject().toVariant().value().relativeFilePath(fileName); return QString(); } bool QDirProto::remove(const QString &fileName) { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->remove(fileName); else if (! thisObject().isNull()) return thisObject().toVariant().value().remove(fileName); return false; } bool QDirProto::rename(const QString &oldName, const QString &newName) { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->rename(oldName, newName); else if (! thisObject().isNull()) return thisObject().toVariant().value().rename(oldName, newName); return false; } bool QDirProto::rmdir(const QString &dirName) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->rmdir(dirName); else if (! thisObject().isNull()) return thisObject().toVariant().value().rmdir(dirName); return false; } bool QDirProto::rmpath(const QString &dirPath) const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->rmpath(dirPath); else if (! thisObject().isNull()) return thisObject().toVariant().value().rmpath(dirPath); return false; } void QDirProto::setFilter(QDir::Filters filters) { QDir *item = qscriptvalue_cast(thisObject()); if (item) item->setFilter(filters); else if (! thisObject().isNull()) thisObject().toVariant().value().setFilter(filters); } void QDirProto::setNameFilters(const QStringList &nameFilters) { QDir *item = qscriptvalue_cast(thisObject()); if (item) item->setNameFilters(nameFilters); else if (! thisObject().isNull()) thisObject().toVariant().value().setNameFilters(nameFilters); } void QDirProto::setPath(const QString &path) { QDir *item = qscriptvalue_cast(thisObject()); if (item) item->setPath(path); else if (! thisObject().isNull()) thisObject().toVariant().value().setPath(path); } void QDirProto::setSorting(QDir::SortFlags sort) { QDir *item = qscriptvalue_cast(thisObject()); if (item) item->setSorting(sort); else if (! thisObject().isNull()) thisObject().toVariant().value().setSorting(sort); } QDir::SortFlags QDirProto::sorting() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return item->sorting(); else if (! thisObject().isNull()) return thisObject().toVariant().value().sorting(); return QDir::SortFlags(); } /* QString QDirProto::toString() const { QDir *item = qscriptvalue_cast(thisObject()); if (item) return QString("QDir()"); return QString("QDir(unknown)"); } */ qt-client-4.1.0/scriptapi/qdirproto.h000066400000000000000000000064521217451700100176130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDIRPROTO_H__ #define __QDIRPROTO_H__ #include #include #include #include #include Q_DECLARE_METATYPE(QDir) Q_DECLARE_METATYPE(QDir*) Q_DECLARE_METATYPE(enum QDir::Filter); Q_DECLARE_METATYPE(enum QDir::SortFlag); void setupQDirProto(QScriptEngine *engine); QScriptValue constructQDir(QScriptContext *context, QScriptEngine *engine); class QDirProto : public QObject, public QScriptable { Q_OBJECT public: QDirProto(QObject *parent); Q_INVOKABLE QString absoluteFilePath(const QString &fileName) const; Q_INVOKABLE QString absolutePath() const; Q_INVOKABLE QString canonicalPath() const; Q_INVOKABLE bool cd(const QString &dirName); Q_INVOKABLE bool cdUp(); Q_INVOKABLE uint count() const; Q_INVOKABLE QString dirName() const; Q_INVOKABLE QFileInfoList entryInfoList(const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; Q_INVOKABLE QFileInfoList entryInfoList(QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; Q_INVOKABLE QStringList entryList(const QStringList &nameFilters, QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; Q_INVOKABLE QStringList entryList(QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort) const; Q_INVOKABLE bool exists(const QString &name) const; Q_INVOKABLE bool exists() const; Q_INVOKABLE QString filePath(const QString &fileName) const; Q_INVOKABLE QDir::Filters filter() const; Q_INVOKABLE bool isAbsolute() const; Q_INVOKABLE bool isReadable() const; Q_INVOKABLE bool isRelative() const; Q_INVOKABLE bool isRoot() const; Q_INVOKABLE bool makeAbsolute(); Q_INVOKABLE bool mkdir(const QString &dirName) const; Q_INVOKABLE bool mkpath(const QString &dirPath) const; Q_INVOKABLE QStringList nameFilters() const; Q_INVOKABLE QString path() const; Q_INVOKABLE void refresh(); Q_INVOKABLE QString relativeFilePath(const QString &fileName) const; Q_INVOKABLE bool remove(const QString &fileName); Q_INVOKABLE bool rename(const QString &oldName, const QString &newName); Q_INVOKABLE bool rmdir(const QString &dirName) const; Q_INVOKABLE bool rmpath(const QString &dirPath) const; Q_INVOKABLE void setFilter(QDir::Filters filters); Q_INVOKABLE void setNameFilters(const QStringList &nameFilters); Q_INVOKABLE void setPath(const QString &path); Q_INVOKABLE void setSorting(QDir::SortFlags sort); Q_INVOKABLE QDir::SortFlags sorting() const; }; #endif qt-client-4.1.0/scriptapi/qdockwidgetproto.cpp000066400000000000000000000057721217451700100215200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdockwidgetproto.h" #include #include QScriptValue QDockWidgettoScriptValue(QScriptEngine *engine, QDockWidget* const &item) { return engine->newQObject(item); } void QDockWidgetfromScriptValue(const QScriptValue &obj, QDockWidget* &item) { item = qobject_cast(obj.toQObject()); } void setupQDockWidgetProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QDockWidgettoScriptValue, QDockWidgetfromScriptValue); QScriptValue proto = engine->newQObject(new QDockWidgetProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDockWidget, proto); engine->globalObject().setProperty("QDockWidget", constructor); } QScriptValue constructQDockWidget(QScriptContext * context, QScriptEngine *engine) { QDockWidget *obj = 0; if (context->argumentCount() == 3) { obj = new QDockWidget(context->argument(0).toString(), qobject_cast(context->argument(0).toQObject()), (Qt::WindowFlags)(context->argument(1).toInt32())); } else if (context->argumentCount() == 2) { obj = new QDockWidget(qobject_cast(context->argument(0).toQObject()), (Qt::WindowFlags)(context->argument(1).toInt32())); } else if (context->argumentCount() == 1) { obj = new QDockWidget(qobject_cast(context->argument(0).toQObject())); } else obj = new QDockWidget(); return engine->toScriptValue(obj); } QDockWidgetProto::QDockWidgetProto(QObject *parent) : QObject(parent) { } void QDockWidgetProto::setTitleBarWidget ( QWidget * widget ) { QDockWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTitleBarWidget(widget); } void QDockWidgetProto::setWidget ( QWidget * widget ) { QDockWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setWidget(widget); } QWidget* QDockWidgetProto::titleBarWidget () const { QDockWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->titleBarWidget(); return 0; } QAction* QDockWidgetProto::toggleViewAction () const { QDockWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->toggleViewAction(); return 0; } QWidget* QDockWidgetProto::widget() const { QDockWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->widget(); return 0; } qt-client-4.1.0/scriptapi/qdockwidgetproto.h000066400000000000000000000021561217451700100211560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOCKWIDGETPROTO_H__ #define __QDOCKWIDGETPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QDockWidget*) void setupQDockWidgetProto(QScriptEngine *engine); QScriptValue constructQDockWidget(QScriptContext *context, QScriptEngine *engine); class QDockWidgetProto : public QObject, public QScriptable { Q_OBJECT public: QDockWidgetProto(QObject *parent); Q_INVOKABLE void setTitleBarWidget ( QWidget * widget ); Q_INVOKABLE void setWidget ( QWidget * widget ); Q_INVOKABLE QWidget * titleBarWidget () const; Q_INVOKABLE QAction * toggleViewAction () const; Q_INVOKABLE QWidget * widget () const; }; #endif qt-client-4.1.0/scriptapi/qdomattrproto.cpp000066400000000000000000000047571217451700100210500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomattrproto.h" #include #include #include void setupQDomAttrProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomAttrProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomAttr, proto); engine->globalObject().setProperty("QDomAttr", constructor); } QScriptValue constructQDomAttr(QScriptContext * /*context*/, QScriptEngine *engine) { QDomAttr *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomAttr(); return engine->toScriptValue(obj); } QDomAttrProto::QDomAttrProto(QObject *parent) : QObject(parent) { } QDomElement QDomAttrProto:: ownerElement() const { QDomAttr *item = qscriptvalue_cast(thisObject()); if (item) return item->ownerElement(); return QDomElement(); } QString QDomAttrProto:: name() const { QDomAttr *item = qscriptvalue_cast(thisObject()); if (item) return item->name(); return QString(); } QString QDomAttrProto:: value() const { QDomAttr *item = qscriptvalue_cast(thisObject()); if (item) return item->value(); return QString(); } bool QDomAttrProto:: specified() const { QDomAttr *item = qscriptvalue_cast(thisObject()); if (item) return item->specified(); return false; } int QDomAttrProto:: nodeType() const { QDomAttr *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } void QDomAttrProto:: setValue(const QString &str) { QDomAttr *item = qscriptvalue_cast(thisObject()); if (item) item->setValue(str); } QString QDomAttrProto:: toString() const { QDomAttr *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomAttr %1='%2']").arg(item->name()).arg(item->value()); return QString(); } qt-client-4.1.0/scriptapi/qdomattrproto.h000066400000000000000000000023701217451700100205020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMATTRPROTO_H__ #define __QDOMATTRPROTO_H__ #include #include #include #include class QString; Q_DECLARE_METATYPE(QDomAttr*) Q_DECLARE_METATYPE(QDomAttr) void setupQDomAttrProto(QScriptEngine *engine); QScriptValue constructQDomAttr(QScriptContext *context, QScriptEngine *engine); class QDomAttrProto : public QObject, public QScriptable { Q_OBJECT public: QDomAttrProto(QObject *parent); Q_INVOKABLE QDomElement ownerElement() const; Q_INVOKABLE QString name() const; Q_INVOKABLE QString value() const; Q_INVOKABLE bool specified() const; Q_INVOKABLE int nodeType() const; Q_INVOKABLE void setValue(const QString&); Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomcdatasectionproto.cpp000066400000000000000000000034271217451700100225300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomcdatasectionproto.h" #include void setupQDomCDATASectionProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomCDATASectionProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomCDATASection, proto); engine->globalObject().setProperty("QDomCDATASection", constructor); } QScriptValue constructQDomCDATASection(QScriptContext * /*context*/, QScriptEngine *engine) { QDomCDATASection *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomCDATASection(); return engine->toScriptValue(obj); } QDomCDATASectionProto::QDomCDATASectionProto(QObject *parent) : QObject(parent) { } int QDomCDATASectionProto:: nodeType() const { QDomCDATASection *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QString QDomCDATASectionProto::toString() const { QDomCDATASection *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomCDATASection(length=%1]").arg(item->length()); return QString("[QDomCDATASection(unknown)]"); } qt-client-4.1.0/scriptapi/qdomcdatasectionproto.h000066400000000000000000000020131217451700100221630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMCDATASECTIONPROTO_H__ #define __QDOMCDATASECTIONPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QDomCDATASection*) Q_DECLARE_METATYPE(QDomCDATASection) void setupQDomCDATASectionProto(QScriptEngine *engine); QScriptValue constructQDomCDATASection(QScriptContext *context, QScriptEngine *engine); class QDomCDATASectionProto : public QObject, public QScriptable { Q_OBJECT public: QDomCDATASectionProto(QObject *parent); Q_INVOKABLE int nodeType() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomcharacterdataproto.cpp000066400000000000000000000067121217451700100226550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomcharacterdataproto.h" #include #include void setupQDomCharacterDataProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomCharacterDataProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomCharacterData, proto); engine->globalObject().setProperty("QDomCharacterData", constructor); } QScriptValue constructQDomCharacterData(QScriptContext * /*context*/, QScriptEngine *engine) { QDomCharacterData *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomCharacterData(); return engine->toScriptValue(obj); } QDomCharacterDataProto::QDomCharacterDataProto(QObject *parent) : QObject(parent) { } void QDomCharacterDataProto:: appendData(const QString& arg) { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) item->appendData(arg); } QString QDomCharacterDataProto:: data() const { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) return item->data(); return QString(); } void QDomCharacterDataProto:: deleteData(unsigned long offset, unsigned long count) { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) item->deleteData(offset, count); } void QDomCharacterDataProto:: insertData(unsigned long offset, const QString& arg) { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) item->insertData(offset, arg); } uint QDomCharacterDataProto:: length() const { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) return item->length(); return 0; } int QDomCharacterDataProto:: nodeType() const { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } void QDomCharacterDataProto:: replaceData(unsigned long offset, unsigned long count, const QString& arg) { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) item->replaceData(offset, count, arg); } void QDomCharacterDataProto:: setData(const QString&data) { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) item->setData(data); } QString QDomCharacterDataProto:: substringData(unsigned long offset, unsigned long count) { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) return item->substringData(offset, count); return QString(); } QString QDomCharacterDataProto::toString() const { QDomCharacterData *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomCharacterData(length=%1)]").arg(item->length()); return QString("[QDomCharacterData(unknown)]"); } qt-client-4.1.0/scriptapi/qdomcharacterdataproto.h000066400000000000000000000030641217451700100223170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMCHARACTERDATAPROTO_H__ #define __QDOMCHARACTERDATAPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QDomCharacterData*) Q_DECLARE_METATYPE(QDomCharacterData) void setupQDomCharacterDataProto(QScriptEngine *engine); QScriptValue constructQDomCharacterData(QScriptContext *context, QScriptEngine *engine); class QDomCharacterDataProto : public QObject, public QScriptable { Q_OBJECT public: QDomCharacterDataProto(QObject *parent); Q_INVOKABLE void appendData(const QString& arg); Q_INVOKABLE QString data() const; Q_INVOKABLE void deleteData(unsigned long offset, unsigned long count); Q_INVOKABLE void insertData(unsigned long offset, const QString& arg); Q_INVOKABLE uint length() const; Q_INVOKABLE int nodeType() const; Q_INVOKABLE void replaceData(unsigned long offset, unsigned long count, const QString& arg); Q_INVOKABLE void setData(const QString&); Q_INVOKABLE QString substringData(unsigned long offset, unsigned long count); Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomcommentproto.cpp000066400000000000000000000041221217451700100215220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomcommentproto.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void setupQDomCommentProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomCommentProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomComment, proto); engine->globalObject().setProperty("QDomComment", constructor); } QScriptValue constructQDomComment(QScriptContext * /*context*/, QScriptEngine *engine) { QDomComment *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomComment(); return engine->toScriptValue(obj); } QDomCommentProto::QDomCommentProto(QObject *parent) : QObject(parent) { } int QDomCommentProto:: nodeType() const { QDomComment *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QString QDomCommentProto::toString() const { QDomComment *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomComment(%1)").arg(item->data().left(25)); return QString("[QDomComment(unknown)]"); } qt-client-4.1.0/scriptapi/qdomcommentproto.h000066400000000000000000000025031217451700100211700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMCOMMENTPROTO_H__ #define __QDOMCOMMENTPROTO_H__ #include #include #include class QDomAttr; class QDomCDATASection; class QDomCharacterData; class QDomDocument; class QDomDocumentFragment; class QDomDocumentType; class QDomElement; class QDomEntity; class QDomEntityReference; class QDomImplementation; class QDomNamedNodeMap; class QDomNode; class QDomNodeList; class QDomNotation; class QDomProcessingInstruction; class QDomText; Q_DECLARE_METATYPE(QDomComment*) Q_DECLARE_METATYPE(QDomComment) void setupQDomCommentProto(QScriptEngine *engine); QScriptValue constructQDomComment(QScriptContext *context, QScriptEngine *engine); class QDomCommentProto : public QObject, public QScriptable { Q_OBJECT public: QDomCommentProto(QObject *parent); Q_INVOKABLE int nodeType() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomdocumentfragmentproto.cpp000066400000000000000000000035601217451700100234270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomdocumentfragmentproto.h" #include void setupQDomDocumentFragmentProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomDocumentFragmentProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomDocumentFragment, proto); engine->globalObject().setProperty("QDomDocumentFragment", constructor); } QScriptValue constructQDomDocumentFragment(QScriptContext * /*context*/, QScriptEngine *engine) { QDomDocumentFragment *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomDocumentFragment(); return engine->toScriptValue(obj); } QDomDocumentFragmentProto::QDomDocumentFragmentProto(QObject *parent) : QObject(parent) { } int QDomDocumentFragmentProto:: nodeType() const { QDomDocumentFragment *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QString QDomDocumentFragmentProto::toString() const { QDomDocumentFragment *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomDocumentFragment(nodeType=%1)]").arg(item->nodeType()); return QString("[QDomDocumentFragment(unknown)]"); } qt-client-4.1.0/scriptapi/qdomdocumentfragmentproto.h000066400000000000000000000020571217451700100230740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMDOCUMENTFRAGMENTPROTO_H__ #define __QDOMDOCUMENTFRAGMENTPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QDomDocumentFragment*) Q_DECLARE_METATYPE(QDomDocumentFragment) void setupQDomDocumentFragmentProto(QScriptEngine *engine); QScriptValue constructQDomDocumentFragment(QScriptContext *context, QScriptEngine *engine); class QDomDocumentFragmentProto : public QObject, public QScriptable { Q_OBJECT public: QDomDocumentFragmentProto(QObject *parent); Q_INVOKABLE int nodeType() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomdocumentproto.cpp000066400000000000000000000501151217451700100217010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomdocumentproto.h" #include #include #include #include #include #include #include #include #include #include #include #include #include void setupQDomDocumentProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomDocumentProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomDocument, proto); engine->globalObject().setProperty("QDomDocument", constructor); } QScriptValue constructQDomDocument(QScriptContext * /*context*/, QScriptEngine *engine) { QDomDocument *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomDocument(); return engine->toScriptValue(obj); } QDomDocumentProto::QDomDocumentProto(QObject *parent) : QObject(parent) { } QDomAttr QDomDocumentProto::createAttribute(const QString& name) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createAttribute(name); return QDomAttr(); } QDomAttr QDomDocumentProto::createAttributeNS(const QString& nsURI, const QString& qName) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createAttributeNS(nsURI, qName); return QDomAttr(); } QDomCDATASection QDomDocumentProto::createCDATASection(const QString& data) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createCDATASection(data); return QDomCDATASection(); } QDomComment QDomDocumentProto::createComment(const QString& data) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createComment(data); return QDomComment(); } QDomDocumentFragment QDomDocumentProto::createDocumentFragment() { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createDocumentFragment(); return QDomDocumentFragment(); } QDomElement QDomDocumentProto::createElement(const QString& tagName) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createElement(tagName); return QDomElement(); } QDomElement QDomDocumentProto::createElementNS(const QString& nsURI, const QString& qName) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createElementNS(nsURI, qName); return QDomElement(); } QDomEntityReference QDomDocumentProto::createEntityReference(const QString& name) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createEntityReference(name); return QDomEntityReference(); } QDomProcessingInstruction QDomDocumentProto::createProcessingInstruction(const QString& target, const QString& data) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createProcessingInstruction(target, data); return QDomProcessingInstruction(); } QDomText QDomDocumentProto::createTextNode(const QString& data) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->createTextNode(data); return QDomText(); } QDomDocumentType QDomDocumentProto::doctype() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->doctype(); return QDomDocumentType(); } QDomElement QDomDocumentProto::documentElement() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->documentElement(); return QDomElement(); } QDomElement QDomDocumentProto::elementById(const QString& elementId) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->elementById(elementId); return QDomElement(); } QDomNodeList QDomDocumentProto::elementsByTagName(const QString& tagname) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->elementsByTagName(tagname); return QDomNodeList(); } QDomNodeList QDomDocumentProto::elementsByTagNameNS(const QString& nsURI, const QString& localName) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->elementsByTagNameNS(nsURI, localName); return QDomNodeList(); } QDomImplementation QDomDocumentProto::implementation() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->implementation(); return QDomImplementation(); } QDomNode QDomDocumentProto::importNode(const QDomNode& importedNode, bool deep) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->importNode(importedNode, deep); return QDomNode(); } int QDomDocumentProto::nodeType() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } bool QDomDocumentProto::setContent(QIODevice* dev, QString *errorMsg, int *errorLine, int *errorColumn) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->setContent(dev, errorMsg, errorLine, errorColumn ); return false; } bool QDomDocumentProto::setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->setContent(dev, namespaceProcessing, errorMsg, errorLine, errorColumn); return false; } bool QDomDocumentProto::setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->setContent(source, reader, errorMsg, errorLine, errorColumn); return false; } bool QDomDocumentProto::setContent(const QByteArray& text, QString *errorMsg, int *errorLine, int *errorColumn) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->setContent(text, errorMsg, errorLine, errorColumn); return false; } bool QDomDocumentProto::setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn ) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->setContent(text, namespaceProcessing, errorMsg, errorLine, errorColumn); return false; } bool QDomDocumentProto::setContent(const QString& text, QString *errorMsg, int *errorLine, int *errorColumn ) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->setContent(text, errorMsg, errorLine, errorColumn); return false; } bool QDomDocumentProto::setContent(const QString& text, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn ) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->setContent(text, namespaceProcessing, errorMsg, errorLine, errorColumn); return false; } QByteArray QDomDocumentProto::toByteArray(int arg) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toByteArray(arg); return QByteArray(); } QString QDomDocumentProto::toString(int arg) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toString(arg); return QString(); } // now for the inherited domnode methods QDomNode QDomDocumentProto::appendChild(const QDomNode& newChild) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->appendChild(newChild); return QDomDocument(); } QDomNamedNodeMap QDomDocumentProto::attributes() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->attributes(); return QDomNamedNodeMap(); } QDomNodeList QDomDocumentProto::childNodes() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->childNodes(); return QDomNodeList(); } void QDomDocumentProto::clear() { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } QDomNode QDomDocumentProto::cloneNode(bool deep) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->cloneNode(deep); return QDomNode(); } int QDomDocumentProto::columnNumber() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->columnNumber(); return 0; } QDomNode QDomDocumentProto::firstChild() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->firstChild(); return QDomNode(); } QDomElement QDomDocumentProto::firstChildElement(const QString &tagName) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->firstChildElement(tagName); return QDomElement(); } bool QDomDocumentProto::hasAttributes() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->hasAttributes(); return false; } bool QDomDocumentProto::hasChildNodes() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->hasChildNodes(); return false; } QDomNode QDomDocumentProto::insertAfter(const QDomNode& newChild, const QDomNode& refChild) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->insertAfter(newChild, refChild); return QDomNode(); } QDomNode QDomDocumentProto::insertBefore(const QDomNode& newChild, const QDomNode& refChild) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->insertBefore(newChild, refChild); return QDomNode(); } bool QDomDocumentProto::isAttr() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isAttr(); return false; } bool QDomDocumentProto::isCDATASection() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isCDATASection(); return false; } bool QDomDocumentProto::isCharacterData() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isCharacterData(); return false; } bool QDomDocumentProto::isComment() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isComment(); return false; } bool QDomDocumentProto::isDocument() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocument(); return false; } bool QDomDocumentProto::isDocumentFragment() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocumentFragment(); return false; } bool QDomDocumentProto::isDocumentType() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocumentType(); return false; } bool QDomDocumentProto::isElement() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isElement(); return false; } bool QDomDocumentProto::isEntity() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isEntity(); return false; } bool QDomDocumentProto::isEntityReference() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isEntityReference(); return false; } bool QDomDocumentProto::isNotation() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isNotation(); return false; } bool QDomDocumentProto::isNull() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(); return false; } bool QDomDocumentProto::isProcessingInstruction() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isProcessingInstruction(); return false; } bool QDomDocumentProto::isSupported(const QString& feature, const QString& version) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isSupported(feature, version); return false; } bool QDomDocumentProto::isText() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isText(); return false; } QDomNode QDomDocumentProto::lastChild() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->lastChild(); return QDomNode(); } QDomElement QDomDocumentProto::lastChildElement(const QString &tagName) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->lastChildElement(tagName); return QDomElement(); } int QDomDocumentProto::lineNumber() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->lineNumber(); return 0; } QString QDomDocumentProto::localName() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->localName(); return QString(); } QDomNode QDomDocumentProto::namedItem(const QString& name) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->namedItem(name); return QDomNode(); } QString QDomDocumentProto::namespaceURI() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->namespaceURI(); return QString(); } QDomNode QDomDocumentProto::nextSibling() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->nextSibling(); return QDomNode(); } QDomElement QDomDocumentProto::nextSiblingElement(const QString &taName) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->nextSiblingElement(taName); return QDomElement(); } QString QDomDocumentProto::nodeName() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeName(); return QString(); } QString QDomDocumentProto::nodeValue() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeValue(); return QString(); } void QDomDocumentProto::normalize() { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) item->normalize(); } QDomDocument QDomDocumentProto::ownerDocument() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->ownerDocument(); return QDomDocument(); } QDomNode QDomDocumentProto::parentNode() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->parentNode(); return QDomNode(); } QString QDomDocumentProto::prefix() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->prefix(); return QString(); } QDomNode QDomDocumentProto::previousSibling() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->previousSibling(); return QDomNode(); } QDomElement QDomDocumentProto::previousSiblingElement(const QString &tagName) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->previousSiblingElement(tagName); return QDomElement(); } QDomNode QDomDocumentProto::removeChild(const QDomNode& oldChild) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->removeChild(oldChild); return QDomNode(); } QDomNode QDomDocumentProto::replaceChild(const QDomNode& newChild, const QDomNode& oldChild) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->replaceChild(newChild, oldChild); return QDomNode(); } void QDomDocumentProto::save(QTextStream& stream, int intarg) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) item->save(stream, intarg); } void QDomDocumentProto::save(QTextStream& stream, int intarg, int policy) const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) item->save(stream, intarg, (QDomNode::EncodingPolicy)policy); } void QDomDocumentProto::setNodeValue(const QString&value) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) item->setNodeValue(value); } void QDomDocumentProto::setPrefix(const QString& pre) { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) item->setPrefix(pre); } QDomAttr QDomDocumentProto::toAttr() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toAttr(); return QDomAttr(); } QDomCDATASection QDomDocumentProto::toCDATASection() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toCDATASection(); return QDomCDATASection(); } QDomCharacterData QDomDocumentProto::toCharacterData() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toCharacterData(); return QDomCharacterData(); } QDomComment QDomDocumentProto::toComment() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toComment(); return QDomComment(); } QDomDocument QDomDocumentProto::toDocument() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocument(); return QDomDocument(); } QDomDocumentFragment QDomDocumentProto::toDocumentFragment() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocumentFragment(); return QDomDocumentFragment(); } QDomDocumentType QDomDocumentProto::toDocumentType() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocumentType(); return QDomDocumentType(); } QDomElement QDomDocumentProto::toElement() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toElement(); return QDomElement(); } QDomEntity QDomDocumentProto::toEntity() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toEntity(); return QDomEntity(); } QDomEntityReference QDomDocumentProto::toEntityReference() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toEntityReference(); return QDomEntityReference(); } QDomNotation QDomDocumentProto::toNotation() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toNotation(); return QDomNotation(); } QDomProcessingInstruction QDomDocumentProto::toProcessingInstruction() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toProcessingInstruction(); return QDomProcessingInstruction(); } QDomText QDomDocumentProto::toText() const { QDomDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toText(); return QDomText(); } qt-client-4.1.0/scriptapi/qdomdocumentproto.h000066400000000000000000000172161217451700100213530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMDOCUMENTPROTO_H__ #define __QDOMDOCUMENTPROTO_H__ #include #include #include #include #include #include #include #include class QDomCDATASection; class QDomCharacterData; class QDomComment; class QDomDocumentFragment; class QDomDocumentType; class QDomElement; class QDomEntity; class QDomEntityReference; class QDomImplementation; class QDomNotation; class QDomProcessingInstruction; class QDomText; class QXmlInputSource; class QXmlReader; Q_DECLARE_METATYPE(QDomDocument*) Q_DECLARE_METATYPE(QDomDocument) void setupQDomDocumentProto(QScriptEngine *engine); QScriptValue constructQDomDocument(QScriptContext *context, QScriptEngine *engine); class QDomDocumentProto : public QObject, public QScriptable { Q_OBJECT public: QDomDocumentProto(QObject *parent); Q_INVOKABLE QDomAttr createAttribute(const QString& name); Q_INVOKABLE QDomAttr createAttributeNS(const QString& nsURI, const QString& qName); Q_INVOKABLE QDomCDATASection createCDATASection(const QString& data); Q_INVOKABLE QDomComment createComment(const QString& data); Q_INVOKABLE QDomDocumentFragment createDocumentFragment(); Q_INVOKABLE QDomElement createElement(const QString& tagName); Q_INVOKABLE QDomElement createElementNS(const QString& nsURI, const QString& qName); Q_INVOKABLE QDomEntityReference createEntityReference(const QString& name); Q_INVOKABLE QDomProcessingInstruction createProcessingInstruction(const QString& target, const QString& data); Q_INVOKABLE QDomText createTextNode(const QString& data); Q_INVOKABLE QDomDocumentType doctype() const; Q_INVOKABLE QDomElement documentElement() const; Q_INVOKABLE QDomElement elementById(const QString& elementId); Q_INVOKABLE QDomNodeList elementsByTagName(const QString& tagname) const; Q_INVOKABLE QDomNodeList elementsByTagNameNS(const QString& nsURI, const QString& localName); Q_INVOKABLE QDomImplementation implementation() const; Q_INVOKABLE QDomNode importNode(const QDomNode& importedNode, bool deep); Q_INVOKABLE int nodeType() const; Q_INVOKABLE bool setContent(QIODevice* dev, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); Q_INVOKABLE bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); Q_INVOKABLE bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); Q_INVOKABLE bool setContent(const QByteArray& text, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); Q_INVOKABLE bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); Q_INVOKABLE bool setContent(const QString& text, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); Q_INVOKABLE bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=0, int *errorLine=0, int *errorColumn=0 ); Q_INVOKABLE QByteArray toByteArray(int = 1) const; Q_INVOKABLE QString toString(int = 1) const; // now the inherited QDomNode methods Q_INVOKABLE QDomNode appendChild(const QDomNode& newChild); Q_INVOKABLE QDomNamedNodeMap attributes() const; Q_INVOKABLE QDomNodeList childNodes() const; Q_INVOKABLE void clear(); Q_INVOKABLE QDomNode cloneNode(bool deep = true) const; Q_INVOKABLE int columnNumber() const; Q_INVOKABLE QDomNode firstChild() const; Q_INVOKABLE QDomElement firstChildElement(const QString &tagName = QString()) const; Q_INVOKABLE bool hasAttributes() const; Q_INVOKABLE bool hasChildNodes() const; Q_INVOKABLE QDomNode insertAfter(const QDomNode& newChild, const QDomNode& refChild); Q_INVOKABLE QDomNode insertBefore(const QDomNode& newChild, const QDomNode& refChild); Q_INVOKABLE bool isAttr() const; Q_INVOKABLE bool isCDATASection() const; Q_INVOKABLE bool isCharacterData() const; Q_INVOKABLE bool isComment() const; Q_INVOKABLE bool isDocument() const; Q_INVOKABLE bool isDocumentFragment() const; Q_INVOKABLE bool isDocumentType() const; Q_INVOKABLE bool isElement() const; Q_INVOKABLE bool isEntity() const; Q_INVOKABLE bool isEntityReference() const; Q_INVOKABLE bool isNotation() const; Q_INVOKABLE bool isNull() const; Q_INVOKABLE bool isProcessingInstruction() const; Q_INVOKABLE bool isSupported(const QString& feature, const QString& version) const; Q_INVOKABLE bool isText() const; Q_INVOKABLE QDomNode lastChild() const; Q_INVOKABLE QDomElement lastChildElement(const QString &tagName = QString()) const; Q_INVOKABLE int lineNumber() const; Q_INVOKABLE QString localName() const; Q_INVOKABLE QDomNode namedItem(const QString& name) const; Q_INVOKABLE QString namespaceURI() const; Q_INVOKABLE QDomNode nextSibling() const; Q_INVOKABLE QDomElement nextSiblingElement(const QString &taName = QString()) const; Q_INVOKABLE QString nodeName() const; Q_INVOKABLE QString nodeValue() const; Q_INVOKABLE void normalize(); Q_INVOKABLE QDomDocument ownerDocument() const; Q_INVOKABLE QDomNode parentNode() const; Q_INVOKABLE QString prefix() const; Q_INVOKABLE QDomNode previousSibling() const; Q_INVOKABLE QDomElement previousSiblingElement(const QString &tagName = QString()) const; Q_INVOKABLE QDomNode removeChild(const QDomNode& oldChild); Q_INVOKABLE QDomNode replaceChild(const QDomNode& newChild, const QDomNode& oldChild); Q_INVOKABLE void save(QTextStream&, int) const; Q_INVOKABLE void save(QTextStream&, int, int) const; Q_INVOKABLE void setNodeValue(const QString&); Q_INVOKABLE void setPrefix(const QString& pre); Q_INVOKABLE QDomAttr toAttr() const; Q_INVOKABLE QDomCDATASection toCDATASection() const; Q_INVOKABLE QDomCharacterData toCharacterData() const; Q_INVOKABLE QDomComment toComment() const; Q_INVOKABLE QDomDocument toDocument() const; Q_INVOKABLE QDomDocumentFragment toDocumentFragment() const; Q_INVOKABLE QDomDocumentType toDocumentType() const; Q_INVOKABLE QDomElement toElement() const; Q_INVOKABLE QDomEntity toEntity() const; Q_INVOKABLE QDomEntityReference toEntityReference() const; Q_INVOKABLE QDomNotation toNotation() const; Q_INVOKABLE QDomProcessingInstruction toProcessingInstruction() const; Q_INVOKABLE QDomText toText() const; }; #endif qt-client-4.1.0/scriptapi/qdomdocumenttypeproto.cpp000066400000000000000000000062441217451700100226070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomdocumenttypeproto.h" #include #include #include void setupQDomDocumentTypeProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomDocumentTypeProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomDocumentType, proto); engine->globalObject().setProperty("QDomDocumentType", constructor); } QScriptValue constructQDomDocumentType(QScriptContext * /*context*/, QScriptEngine *engine) { QDomDocumentType *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomDocumentType(); return engine->toScriptValue(obj); } QDomDocumentTypeProto::QDomDocumentTypeProto(QObject *parent) : QObject(parent) { } QDomNamedNodeMap QDomDocumentTypeProto:: entities() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return item->entities(); return QDomNamedNodeMap(); } QString QDomDocumentTypeProto:: internalSubset() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return item->internalSubset(); return QString(); } QString QDomDocumentTypeProto:: name() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return item->name(); return QString(); } int QDomDocumentTypeProto:: nodeType() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QDomNamedNodeMap QDomDocumentTypeProto:: notations() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return item->notations(); return QDomNamedNodeMap(); } QString QDomDocumentTypeProto:: publicId() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return item->publicId(); return QString(); } QString QDomDocumentTypeProto:: systemId() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return item->systemId(); return QString(); } QString QDomDocumentTypeProto::toString() const { QDomDocumentType *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomDocumentType(type = %1, public = %2, system = %3)]") .arg(item->name()) .arg(item->publicId()) .arg(item->systemId()); return QString("[QDomDocumentType(unknown)]"); } qt-client-4.1.0/scriptapi/qdomdocumenttypeproto.h000066400000000000000000000026551217451700100222560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMDOCUMMENTTYPEPROTO_H__ #define __QDOMDOCUMMENTTYPEPROTO_H__ #include #include #include #include class QString; Q_DECLARE_METATYPE(QDomDocumentType*) Q_DECLARE_METATYPE(QDomDocumentType) void setupQDomDocumentTypeProto(QScriptEngine *engine); QScriptValue constructQDomDocumentType(QScriptContext *context, QScriptEngine *engine); class QDomDocumentTypeProto : public QObject, public QScriptable { Q_OBJECT public: QDomDocumentTypeProto(QObject *parent); Q_INVOKABLE QDomNamedNodeMap entities() const; Q_INVOKABLE QString internalSubset() const; Q_INVOKABLE QString name() const; Q_INVOKABLE int nodeType() const; Q_INVOKABLE QDomNamedNodeMap notations() const; Q_INVOKABLE QString publicId() const; Q_INVOKABLE QString systemId() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomelementproto.cpp000066400000000000000000000467471217451700100215340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomelementproto.h" #include #include #include #include #include "qdomnodeproto.h" void setupQDomElementProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomElementProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomElement, proto); engine->globalObject().setProperty("QDomElement", constructor); } QScriptValue constructQDomElement(QScriptContext * /*context*/, QScriptEngine *engine) { QDomElement *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomElement(); return engine->toScriptValue(obj); } QDomElementProto::QDomElementProto(QObject *parent) : QObject(parent) { } QString QDomElementProto:: attribute(const QString& name, const QString& defValue) const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->attribute(name, defValue); return QString(); } QString QDomElementProto:: attributeNS(const QString nsURI, const QString& localName, const QString& defValue) const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->attributeNS(nsURI, localName, defValue); return QString(); } QDomAttr QDomElementProto:: attributeNode(const QString& name) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->attributeNode(name); return QDomAttr(); } QDomAttr QDomElementProto:: attributeNodeNS(const QString& nsURI, const QString& localName) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->attributeNodeNS(nsURI, localName); return QDomAttr(); } QDomNamedNodeMap QDomElementProto:: attributes() const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->attributes(); return QDomNamedNodeMap(); } QDomNodeList QDomElementProto:: elementsByTagName(const QString& tagname) const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->elementsByTagName(tagname); return QDomNodeList(); } QDomNodeList QDomElementProto:: elementsByTagNameNS(const QString& nsURI, const QString& localName) const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->elementsByTagNameNS(nsURI, localName); return QDomNodeList(); } bool QDomElementProto:: hasAttribute(const QString& name) const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->hasAttribute(name); return false; } bool QDomElementProto:: hasAttributeNS(const QString& nsURI, const QString& localName) const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->hasAttributeNS(nsURI, localName); return false; } int QDomElementProto:: nodeType() const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } void QDomElementProto:: removeAttribute(const QString& name) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->removeAttribute(name); } void QDomElementProto:: removeAttributeNS(const QString& nsURI, const QString& localName) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->removeAttributeNS(nsURI, localName); } QDomAttr QDomElementProto:: removeAttributeNode(const QDomAttr& oldAttr) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->removeAttributeNode(oldAttr); return QDomAttr(); } void QDomElementProto:: setAttribute(const QString& name, const QString& value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(name, value); } void QDomElementProto:: setAttribute(const QString& name, double value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(name, value); } void QDomElementProto:: setAttribute(const QString& name, float value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(name, value); } void QDomElementProto:: setAttribute(const QString& name, int value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(name, value); } void QDomElementProto:: setAttribute(const QString& name, qlonglong value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(name, value); } void QDomElementProto:: setAttribute(const QString& name, qulonglong value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(name, value); } void QDomElementProto:: setAttribute(const QString& name, uint value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(name, value); } void QDomElementProto:: setAttributeNS(const QString nsURI, const QString& qName, const QString& value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttributeNS(nsURI, qName, value); } void QDomElementProto:: setAttributeNS(const QString nsURI, const QString& qName, double value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttributeNS(nsURI, qName, value); } void QDomElementProto:: setAttributeNS(const QString nsURI, const QString& qName, int value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttributeNS(nsURI, qName, value); } void QDomElementProto:: setAttributeNS(const QString nsURI, const QString& qName, qlonglong value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttributeNS(nsURI, qName, value); } void QDomElementProto:: setAttributeNS(const QString nsURI, const QString& qName, qulonglong value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttributeNS(nsURI, qName, value); } void QDomElementProto:: setAttributeNS(const QString nsURI, const QString& qName, uint value) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setAttributeNS(nsURI, qName, value); } QDomAttr QDomElementProto:: setAttributeNode(const QDomAttr& newAttr) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->setAttributeNode(newAttr); return QDomAttr(); } QDomAttr QDomElementProto:: setAttributeNodeNS(const QDomAttr& newAttr) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->setAttributeNodeNS(newAttr); return QDomAttr(); } void QDomElementProto:: setTagName(const QString& name) { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) item->setTagName(name); } QString QDomElementProto:: tagName() const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->tagName(); return QString(); } QString QDomElementProto:: text() const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return item->text(); return QString(); } QString QDomElementProto::toString() const { QDomElement *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomElement(tagname %1)]").arg(item->tagName()); return QString("[QDomElement(unknown)]"); } QDomNode QDomElementProto::appendChild(const QDomNode& newChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->appendChild(newChild); return QDomNode(); } QDomNodeList QDomElementProto::childNodes() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->childNodes(); return QDomNodeList(); } void QDomElementProto::clear() { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } QDomNode QDomElementProto::cloneNode(bool deep) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->cloneNode(deep); return QDomNode(); } int QDomElementProto::columnNumber() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->columnNumber(); return 0; } QDomNode QDomElementProto::firstChild() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->firstChild(); return QDomNode(); } QDomElement QDomElementProto::firstChildElement(const QString &tagName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->firstChildElement(tagName); return QDomElement(); } bool QDomElementProto::hasAttributes() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->hasAttributes(); return false; } bool QDomElementProto::hasChildNodes() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->hasChildNodes(); return false; } QDomNode QDomElementProto::insertAfter(const QDomNode& newChild, const QDomNode& refChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->insertAfter(newChild, refChild); return QDomNode(); } QDomNode QDomElementProto::insertBefore(const QDomNode& newChild, const QDomNode& refChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->insertBefore(newChild, refChild); return QDomNode(); } bool QDomElementProto::isAttr() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isAttr(); return false; } bool QDomElementProto::isCDATASection() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isCDATASection(); return false; } bool QDomElementProto::isCharacterData() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isCharacterData(); return false; } bool QDomElementProto::isComment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isComment(); return false; } bool QDomElementProto::isDocument() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocument(); return false; } bool QDomElementProto::isDocumentFragment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocumentFragment(); return false; } bool QDomElementProto::isDocumentType() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocumentType(); return false; } bool QDomElementProto::isElement() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isElement(); return false; } bool QDomElementProto::isEntity() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isEntity(); return false; } bool QDomElementProto::isEntityReference() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isEntityReference(); return false; } bool QDomElementProto::isNotation() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isNotation(); return false; } bool QDomElementProto::isNull() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(); return false; } bool QDomElementProto::isProcessingInstruction() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isProcessingInstruction(); return false; } bool QDomElementProto::isSupported(const QString& feature, const QString& version) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isSupported(feature, version); return false; } bool QDomElementProto::isText() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isText(); return false; } QDomNode QDomElementProto::lastChild() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->lastChild(); return QDomNode(); } QDomElement QDomElementProto::lastChildElement(const QString &tagName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->lastChildElement(tagName); return QDomElement(); } int QDomElementProto::lineNumber() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->lineNumber(); return 0; } QString QDomElementProto::localName() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->localName(); return QString(); } QDomNode QDomElementProto::namedItem(const QString& name) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->namedItem(name); return QDomNode(); } QString QDomElementProto::namespaceURI() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->namespaceURI(); return QString(); } QDomNode QDomElementProto::nextSibling() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nextSibling(); return QDomNode(); } QDomElement QDomElementProto::nextSiblingElement(const QString &taName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nextSiblingElement(taName); return QDomElement(); } QString QDomElementProto::nodeName() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeName(); return QString(); } QString QDomElementProto::nodeValue() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeValue(); return QString(); } void QDomElementProto::normalize() { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->normalize(); } QDomDocument QDomElementProto::ownerDocument() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->ownerDocument(); return QDomDocument(); } QDomNode QDomElementProto::parentNode() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->parentNode(); return QDomNode(); } QString QDomElementProto::prefix() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->prefix(); return QString(); } QDomNode QDomElementProto::previousSibling() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->previousSibling(); return QDomNode(); } QDomElement QDomElementProto::previousSiblingElement(const QString &tagName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->previousSiblingElement(tagName); return QDomElement(); } QDomNode QDomElementProto::removeChild(const QDomNode& oldChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->removeChild(oldChild); return QDomNode(); } QDomNode QDomElementProto::replaceChild(const QDomNode& newChild, const QDomNode& oldChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->replaceChild(newChild, oldChild); return QDomNode(); } void QDomElementProto::save(QTextStream& stream, int intarg) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->save(stream, intarg); } void QDomElementProto::save(QTextStream& stream, int intarg, int policy) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->save(stream, intarg, (QDomNode::EncodingPolicy)policy); } void QDomElementProto::setNodeValue(const QString&value) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->setNodeValue(value); } void QDomElementProto::setPrefix(const QString& pre) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->setPrefix(pre); } QDomAttr QDomElementProto::toAttr() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toAttr(); return QDomAttr(); } QDomCDATASection QDomElementProto::toCDATASection() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toCDATASection(); return QDomCDATASection(); } QDomCharacterData QDomElementProto::toCharacterData() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toCharacterData(); return QDomCharacterData(); } QDomComment QDomElementProto::toComment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toComment(); return QDomComment(); } QDomDocument QDomElementProto::toDocument() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocument(); return QDomDocument(); } QDomDocumentFragment QDomElementProto::toDocumentFragment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocumentFragment(); return QDomDocumentFragment(); } QDomDocumentType QDomElementProto::toDocumentType() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocumentType(); return QDomDocumentType(); } QDomElement QDomElementProto::toElement() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toElement(); return QDomElement(); } QDomEntity QDomElementProto::toEntity() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toEntity(); return QDomEntity(); } QDomEntityReference QDomElementProto::toEntityReference() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toEntityReference(); return QDomEntityReference(); } QDomNotation QDomElementProto::toNotation() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toNotation(); return QDomNotation(); } QDomProcessingInstruction QDomElementProto::toProcessingInstruction() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toProcessingInstruction(); return QDomProcessingInstruction(); } QDomText QDomElementProto::toText() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toText(); return QDomText(); } qt-client-4.1.0/scriptapi/qdomelementproto.h000066400000000000000000000170061217451700100211630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMELEMENTPROTO_H__ #define __QDOMELEMENTPROTO_H__ #include #include #include #include #include #include #include class QDomCDATASection; class QDomCharacterData; class QDomComment; class QDomDocument; class QDomDocumentFragment; class QDomDocumentType; class QDomEntity; class QDomEntityReference; class QDomImplementation; class QDomNotation; class QDomProcessingInstruction; class QDomText; Q_DECLARE_METATYPE(QDomElement*) Q_DECLARE_METATYPE(QDomElement) void setupQDomElementProto(QScriptEngine *engine); QScriptValue constructQDomElement(QScriptContext *context, QScriptEngine *engine); class QDomElementProto : public QObject, public QScriptable { Q_OBJECT public: QDomElementProto(QObject *parent); Q_INVOKABLE QString attribute(const QString& name, const QString& defValue = QString() ) const; Q_INVOKABLE QString attributeNS(const QString nsURI, const QString& localName, const QString& defValue = QString()) const; Q_INVOKABLE QDomAttr attributeNode(const QString& name); Q_INVOKABLE QDomAttr attributeNodeNS(const QString& nsURI, const QString& localName); Q_INVOKABLE QDomNamedNodeMap attributes() const; Q_INVOKABLE QDomNodeList elementsByTagName(const QString& tagname) const; Q_INVOKABLE QDomNodeList elementsByTagNameNS(const QString& nsURI, const QString& localName) const; Q_INVOKABLE bool hasAttribute(const QString& name) const; Q_INVOKABLE bool hasAttributeNS(const QString& nsURI, const QString& localName) const; Q_INVOKABLE int nodeType() const; Q_INVOKABLE void removeAttribute(const QString& name); Q_INVOKABLE void removeAttributeNS(const QString& nsURI, const QString& localName); Q_INVOKABLE QDomAttr removeAttributeNode(const QDomAttr& oldAttr); Q_INVOKABLE void setAttribute(const QString& name, const QString& value); Q_INVOKABLE void setAttribute(const QString& name, double value); Q_INVOKABLE void setAttribute(const QString& name, float value); Q_INVOKABLE void setAttribute(const QString& name, int value); Q_INVOKABLE void setAttribute(const QString& name, qlonglong value); Q_INVOKABLE void setAttribute(const QString& name, qulonglong value); Q_INVOKABLE void setAttribute(const QString& name, uint value); Q_INVOKABLE void setAttributeNS(const QString nsURI, const QString& qName, const QString& value); Q_INVOKABLE void setAttributeNS(const QString nsURI, const QString& qName, double value); Q_INVOKABLE void setAttributeNS(const QString nsURI, const QString& qName, int value); Q_INVOKABLE void setAttributeNS(const QString nsURI, const QString& qName, qlonglong value); Q_INVOKABLE void setAttributeNS(const QString nsURI, const QString& qName, qulonglong value); Q_INVOKABLE void setAttributeNS(const QString nsURI, const QString& qName, uint value); Q_INVOKABLE QDomAttr setAttributeNode(const QDomAttr& newAttr); Q_INVOKABLE QDomAttr setAttributeNodeNS(const QDomAttr& newAttr); Q_INVOKABLE void setTagName(const QString& name); Q_INVOKABLE QString tagName() const; Q_INVOKABLE QString text() const; Q_INVOKABLE QString toString() const; // now for the inherited stuff from QDomNode Q_INVOKABLE QDomNode appendChild(const QDomNode& newChild); Q_INVOKABLE QDomNodeList childNodes() const; Q_INVOKABLE void clear(); Q_INVOKABLE QDomNode cloneNode(bool deep = true) const; Q_INVOKABLE int columnNumber() const; Q_INVOKABLE QDomNode firstChild() const; Q_INVOKABLE QDomElement firstChildElement(const QString &tagName = QString()) const; Q_INVOKABLE bool hasAttributes() const; Q_INVOKABLE bool hasChildNodes() const; Q_INVOKABLE QDomNode insertAfter(const QDomNode& newChild, const QDomNode& refChild); Q_INVOKABLE QDomNode insertBefore(const QDomNode& newChild, const QDomNode& refChild); Q_INVOKABLE bool isAttr() const; Q_INVOKABLE bool isCDATASection() const; Q_INVOKABLE bool isCharacterData() const; Q_INVOKABLE bool isComment() const; Q_INVOKABLE bool isDocument() const; Q_INVOKABLE bool isDocumentFragment() const; Q_INVOKABLE bool isDocumentType() const; Q_INVOKABLE bool isElement() const; Q_INVOKABLE bool isEntity() const; Q_INVOKABLE bool isEntityReference() const; Q_INVOKABLE bool isNotation() const; Q_INVOKABLE bool isNull() const; Q_INVOKABLE bool isProcessingInstruction() const; Q_INVOKABLE bool isSupported(const QString& feature, const QString& version) const; Q_INVOKABLE bool isText() const; Q_INVOKABLE QDomNode lastChild() const; Q_INVOKABLE QDomElement lastChildElement(const QString &tagName = QString()) const; Q_INVOKABLE int lineNumber() const; Q_INVOKABLE QString localName() const; Q_INVOKABLE QDomNode namedItem(const QString& name) const; Q_INVOKABLE QString namespaceURI() const; Q_INVOKABLE QDomNode nextSibling() const; Q_INVOKABLE QDomElement nextSiblingElement(const QString &taName = QString()) const; Q_INVOKABLE QString nodeName() const; Q_INVOKABLE QString nodeValue() const; Q_INVOKABLE void normalize(); Q_INVOKABLE QDomDocument ownerDocument() const; Q_INVOKABLE QDomNode parentNode() const; Q_INVOKABLE QString prefix() const; Q_INVOKABLE QDomNode previousSibling() const; Q_INVOKABLE QDomElement previousSiblingElement(const QString &tagName = QString()) const; Q_INVOKABLE QDomNode removeChild(const QDomNode& oldChild); Q_INVOKABLE QDomNode replaceChild(const QDomNode& newChild, const QDomNode& oldChild); Q_INVOKABLE void save(QTextStream&, int) const; Q_INVOKABLE void save(QTextStream&, int, int) const; Q_INVOKABLE void setNodeValue(const QString&); Q_INVOKABLE void setPrefix(const QString& pre); Q_INVOKABLE QDomAttr toAttr() const; Q_INVOKABLE QDomCDATASection toCDATASection() const; Q_INVOKABLE QDomCharacterData toCharacterData() const; Q_INVOKABLE QDomComment toComment() const; Q_INVOKABLE QDomDocument toDocument() const; Q_INVOKABLE QDomDocumentFragment toDocumentFragment() const; Q_INVOKABLE QDomDocumentType toDocumentType() const; Q_INVOKABLE QDomElement toElement() const; Q_INVOKABLE QDomEntity toEntity() const; Q_INVOKABLE QDomEntityReference toEntityReference() const; Q_INVOKABLE QDomNotation toNotation() const; Q_INVOKABLE QDomProcessingInstruction toProcessingInstruction() const; Q_INVOKABLE QDomText toText() const; }; #endif qt-client-4.1.0/scriptapi/qdomentityproto.cpp000066400000000000000000000043721217451700100214030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomentityproto.h" #include #include void setupQDomEntityProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomEntityProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomEntity, proto); engine->globalObject().setProperty("QDomEntity", constructor); } QScriptValue constructQDomEntity(QScriptContext * /*context*/, QScriptEngine *engine) { QDomEntity *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomEntity(); return engine->toScriptValue(obj); } QDomEntityProto::QDomEntityProto(QObject *parent) : QObject(parent) { } int QDomEntityProto:: nodeType() const { QDomEntity *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QString QDomEntityProto:: notationName() const { QDomEntity *item = qscriptvalue_cast(thisObject()); if (item) return item->notationName(); return QString(); } QString QDomEntityProto:: publicId() const { QDomEntity *item = qscriptvalue_cast(thisObject()); if (item) return item->publicId(); return QString(); } QString QDomEntityProto:: systemId() const { QDomEntity *item = qscriptvalue_cast(thisObject()); if (item) return item->systemId(); return QString(); } QString QDomEntityProto::toString() const { QDomEntity *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomEntity(%1=%2)]") .arg(item->nodeName()).arg(item->nodeValue()); return QString("[QDomEntity(unknown)]"); } qt-client-4.1.0/scriptapi/qdomentityproto.h000066400000000000000000000021671217451700100210500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMENTITYPROTO_H__ #define __QDOMENTITYPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QDomEntity*) Q_DECLARE_METATYPE(QDomEntity) void setupQDomEntityProto(QScriptEngine *engine); QScriptValue constructQDomEntity(QScriptContext *context, QScriptEngine *engine); class QDomEntityProto : public QObject, public QScriptable { Q_OBJECT public: QDomEntityProto(QObject *parent); Q_INVOKABLE int nodeType() const; Q_INVOKABLE QString notationName() const; Q_INVOKABLE QString publicId() const; Q_INVOKABLE QString systemId() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomentityreferenceproto.cpp000066400000000000000000000036001217451700100232530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomentityreferenceproto.h" #include void setupQDomEntityReferenceProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomEntityReferenceProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomEntityReference, proto); engine->globalObject().setProperty("QDomEntityReference", constructor); } QScriptValue constructQDomEntityReference(QScriptContext * /*context*/, QScriptEngine *engine) { QDomEntityReference *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomEntityReference(); return engine->toScriptValue(obj); } QDomEntityReferenceProto::QDomEntityReferenceProto(QObject *parent) : QObject(parent) { } int QDomEntityReferenceProto:: nodeType() const { QDomEntityReference *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QString QDomEntityReferenceProto::toString() const { QDomEntityReference *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomEntityReference(%1=%2)]") .arg(item->nodeName()).arg(item->nodeValue()); return QString("[QDomEntityReference(unknown)]"); } qt-client-4.1.0/scriptapi/qdomentityreferenceproto.h000066400000000000000000000020461217451700100227230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMENTITYREFERENCEPROTO_H__ #define __QDOMENTITYREFERENCEPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QDomEntityReference*) Q_DECLARE_METATYPE(QDomEntityReference) void setupQDomEntityReferenceProto(QScriptEngine *engine); QScriptValue constructQDomEntityReference(QScriptContext *context, QScriptEngine *engine); class QDomEntityReferenceProto : public QObject, public QScriptable { Q_OBJECT public: QDomEntityReferenceProto(QObject *parent); Q_INVOKABLE int nodeType() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomimplementationproto.cpp000066400000000000000000000062411217451700100231110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomimplementationproto.h" #include #include #include #include void setupQDomImplementationProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomImplementationProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomImplementation, proto); engine->globalObject().setProperty("QDomImplementation", constructor); } QScriptValue constructQDomImplementation(QScriptContext * /*context*/, QScriptEngine *engine) { QDomImplementation *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomImplementation(); return engine->toScriptValue(obj); } QDomImplementationProto::QDomImplementationProto(QObject *parent) : QObject(parent) { } QDomDocument QDomImplementationProto:: createDocument(const QString& nsURI, const QString& qName, const QDomDocumentType& doctype) { QDomImplementation *item = qscriptvalue_cast(thisObject()); if (item) return item->createDocument(nsURI, qName, doctype); return QDomDocument(); } QDomDocumentType QDomImplementationProto:: createDocumentType(const QString& qName, const QString& publicId, const QString& systemId) { QDomImplementation *item = qscriptvalue_cast(thisObject()); if (item) return item->createDocumentType(qName, publicId, systemId); return QDomDocumentType(); } bool QDomImplementationProto:: hasFeature(const QString& feature, const QString& version) const { QDomImplementation *item = qscriptvalue_cast(thisObject()); if (item) return item->hasFeature(feature, version); return false; } int QDomImplementationProto::invalidDataPolicy() { QDomImplementation *item = qscriptvalue_cast(thisObject()); if (item) return item->invalidDataPolicy(); return 0; } bool QDomImplementationProto::isNull() { QDomImplementation *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(); return false; } void QDomImplementationProto::setInvalidDataPolicy(int policy) { QDomImplementation *item = qscriptvalue_cast(thisObject()); if (item) item->setInvalidDataPolicy((QDomImplementation::InvalidDataPolicy)policy); } QString QDomImplementationProto::toString() const { QDomImplementation *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomImplementation()]"); return QString("[QDomImplementation(unknown)]"); } qt-client-4.1.0/scriptapi/qdomimplementationproto.h000066400000000000000000000031021217451700100225470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMIMPLEMENTATIONPROTO_H__ #define __QDOMIMPLEMENTATIONPROTO_H__ #include #include #include #include #include class QString; Q_DECLARE_METATYPE(QDomImplementation*) Q_DECLARE_METATYPE(QDomImplementation) void setupQDomImplementationProto(QScriptEngine *engine); QScriptValue constructQDomImplementation(QScriptContext *context, QScriptEngine *engine); class QDomImplementationProto : public QObject, public QScriptable { Q_OBJECT public: QDomImplementationProto(QObject *parent); Q_INVOKABLE QDomDocument createDocument(const QString& nsURI, const QString& qName, const QDomDocumentType& doctype); Q_INVOKABLE QDomDocumentType createDocumentType(const QString& qName, const QString& publicId, const QString& systemId); Q_INVOKABLE bool hasFeature(const QString& feature, const QString& version) const; Q_INVOKABLE int invalidDataPolicy(); Q_INVOKABLE bool isNull(); Q_INVOKABLE void setInvalidDataPolicy(int policy); Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomnamednodemapproto.cpp000066400000000000000000000102101217451700100225030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomnamednodemapproto.h" #include #include void setupQDomNamedNodeMapProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomNamedNodeMapProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomNamedNodeMap, proto); engine->globalObject().setProperty("QDomNamedNodeMap", constructor); } QScriptValue constructQDomNamedNodeMap(QScriptContext * /*context*/, QScriptEngine *engine) { QDomNamedNodeMap *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomNamedNodeMap(); return engine->toScriptValue(obj); } QDomNamedNodeMapProto::QDomNamedNodeMapProto(QObject *parent) : QObject(parent) { } bool QDomNamedNodeMapProto:: contains(const QString& name) const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->contains(name); return false; } int QDomNamedNodeMapProto:: count() const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } bool QDomNamedNodeMapProto:: isEmpty() const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } QDomNode QDomNamedNodeMapProto:: item(int index) const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->item(index); return QDomNode(); } uint QDomNamedNodeMapProto:: length() const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->length(); return 0; } QDomNode QDomNamedNodeMapProto:: namedItem(const QString& name) const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->namedItem(name); return QDomNode(); } QDomNode QDomNamedNodeMapProto:: namedItemNS(const QString& nsURI, const QString& localName) const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->namedItemNS(nsURI, localName); return QDomNode(); } QDomNode QDomNamedNodeMapProto:: removeNamedItem(const QString& name) { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->removeNamedItem(name); return QDomNode(); } QDomNode QDomNamedNodeMapProto:: removeNamedItemNS(const QString& nsURI, const QString& localName) { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->removeNamedItemNS(nsURI, localName); return QDomNode(); } QDomNode QDomNamedNodeMapProto:: setNamedItem(const QDomNode& newNode) { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->setNamedItem(newNode); return QDomNode(); } QDomNode QDomNamedNodeMapProto:: setNamedItemNS(const QDomNode& newNode) { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->setNamedItemNS(newNode); return QDomNode(); } int QDomNamedNodeMapProto:: size() const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } QString QDomNamedNodeMapProto::toString() const { QDomNamedNodeMap *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomNamedNodeMap(size = %1)]").arg(item->size()); return QString("[QDomNamedNodeMap(unknown)]"); } qt-client-4.1.0/scriptapi/qdomnamednodemapproto.h000066400000000000000000000033471217451700100221650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMNAMEDNODEMAPPROTO_H__ #define __QDOMNAMEDNODEMAPPROTO_H__ #include #include #include #include class QString; Q_DECLARE_METATYPE(QDomNamedNodeMap*) Q_DECLARE_METATYPE(QDomNamedNodeMap) void setupQDomNamedNodeMapProto(QScriptEngine *engine); QScriptValue constructQDomNamedNodeMap(QScriptContext *context, QScriptEngine *engine); class QDomNamedNodeMapProto : public QObject, public QScriptable { Q_OBJECT public: QDomNamedNodeMapProto(QObject *parent); Q_INVOKABLE bool contains(const QString& name) const; Q_INVOKABLE int count() const; Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE QDomNode item(int index) const; Q_INVOKABLE uint length() const; Q_INVOKABLE QDomNode namedItem(const QString& name) const; Q_INVOKABLE QDomNode namedItemNS(const QString& nsURI, const QString& localName) const; Q_INVOKABLE QDomNode removeNamedItem(const QString& name); Q_INVOKABLE QDomNode removeNamedItemNS(const QString& nsURI, const QString& localName); Q_INVOKABLE QDomNode setNamedItem(const QDomNode& newNode); Q_INVOKABLE QDomNode setNamedItemNS(const QDomNode& newNode); Q_INVOKABLE int size() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomnodelistproto.cpp000066400000000000000000000051041217451700100217020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomnodelistproto.h" #include void setupQDomNodeListProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomNodeListProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomNodeList, proto); engine->globalObject().setProperty("QDomNodeList", constructor); } QScriptValue constructQDomNodeList(QScriptContext * /*context*/, QScriptEngine *engine) { QDomNodeList *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomNodeList(); return engine->toScriptValue(obj); } QDomNodeListProto::QDomNodeListProto(QObject *parent) : QObject(parent) { } QDomNode QDomNodeListProto:: at(int index) const { QDomNodeList *item = qscriptvalue_cast(thisObject()); if (item) return item->at(index); return QDomNode(); } int QDomNodeListProto:: count() const { QDomNodeList *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } bool QDomNodeListProto:: isEmpty() const { QDomNodeList *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } QDomNode QDomNodeListProto:: item(int index) const { QDomNodeList *item = qscriptvalue_cast(thisObject()); if (item) return item->item(index); return QDomNode(); } uint QDomNodeListProto:: length() const { QDomNodeList *item = qscriptvalue_cast(thisObject()); if (item) return item->length(); return 0; } int QDomNodeListProto:: size() const { QDomNodeList *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } QString QDomNodeListProto::toString() const { QDomNodeList *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomNodeList(size=%1)]").arg(item->size()); return QString("[QDomNodeList(unknown)]"); } qt-client-4.1.0/scriptapi/qdomnodelistproto.h000066400000000000000000000023701217451700100213510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMNODELISTPROTO_H__ #define __QDOMNODELISTPROTO_H__ #include #include #include #include Q_DECLARE_METATYPE(QDomNodeList*) Q_DECLARE_METATYPE(QDomNodeList) void setupQDomNodeListProto(QScriptEngine *engine); QScriptValue constructQDomNodeList(QScriptContext *context, QScriptEngine *engine); class QDomNodeListProto : public QObject, public QScriptable { Q_OBJECT public: QDomNodeListProto(QObject *parent); Q_INVOKABLE QDomNode at(int index) const; Q_INVOKABLE int count() const; Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE QDomNode item(int index) const; Q_INVOKABLE uint length() const; Q_INVOKABLE int size() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomnodeproto.cpp000066400000000000000000000327341217451700100210170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomnodeproto.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include void setupQDomNodeProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomNodeProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomNode, proto); engine->globalObject().setProperty("QDomNode", constructor); } QScriptValue constructQDomNode(QScriptContext * /*context*/, QScriptEngine *engine) { QDomNode *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomNode(); return engine->toScriptValue(obj); } QDomNodeProto::QDomNodeProto(QObject *parent) : QObject(parent) { } QDomNode QDomNodeProto:: appendChild(const QDomNode& newChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->appendChild(newChild); return QDomNode(); } QDomNamedNodeMap QDomNodeProto:: attributes() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->attributes(); return QDomNamedNodeMap(); } QDomNodeList QDomNodeProto:: childNodes() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->childNodes(); return QDomNodeList(); } void QDomNodeProto:: clear() { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } QDomNode QDomNodeProto:: cloneNode(bool deep) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->cloneNode(deep); return QDomNode(); } int QDomNodeProto:: columnNumber() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->columnNumber(); return 0; } QDomNode QDomNodeProto:: firstChild() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->firstChild(); return QDomNode(); } QDomElement QDomNodeProto:: firstChildElement(const QString &tagName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->firstChildElement(tagName); return QDomElement(); } bool QDomNodeProto:: hasAttributes() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->hasAttributes(); return false; } bool QDomNodeProto:: hasChildNodes() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->hasChildNodes(); return false; } QDomNode QDomNodeProto:: insertAfter(const QDomNode& newChild, const QDomNode& refChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->insertAfter(newChild, refChild); return QDomNode(); } QDomNode QDomNodeProto:: insertBefore(const QDomNode& newChild, const QDomNode& refChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->insertBefore(newChild, refChild); return QDomNode(); } bool QDomNodeProto:: isAttr() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isAttr(); return false; } bool QDomNodeProto:: isCDATASection() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isCDATASection(); return false; } bool QDomNodeProto:: isCharacterData() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isCharacterData(); return false; } bool QDomNodeProto:: isComment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isComment(); return false; } bool QDomNodeProto:: isDocument() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocument(); return false; } bool QDomNodeProto:: isDocumentFragment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocumentFragment(); return false; } bool QDomNodeProto:: isDocumentType() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isDocumentType(); return false; } bool QDomNodeProto:: isElement() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isElement(); return false; } bool QDomNodeProto:: isEntity() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isEntity(); return false; } bool QDomNodeProto:: isEntityReference() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isEntityReference(); return false; } bool QDomNodeProto:: isNotation() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isNotation(); return false; } bool QDomNodeProto:: isNull() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(); return false; } bool QDomNodeProto:: isProcessingInstruction() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isProcessingInstruction(); return false; } bool QDomNodeProto:: isSupported(const QString& feature, const QString& version) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isSupported(feature, version); return false; } bool QDomNodeProto:: isText() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->isText(); return false; } QDomNode QDomNodeProto:: lastChild() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->lastChild(); return QDomNode(); } QDomElement QDomNodeProto:: lastChildElement(const QString &tagName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->lastChildElement(tagName); return QDomElement(); } int QDomNodeProto:: lineNumber() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->lineNumber(); return 0; } QString QDomNodeProto:: localName() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->localName(); return QString(); } QDomNode QDomNodeProto:: namedItem(const QString& name) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->namedItem(name); return QDomNode(); } QString QDomNodeProto:: namespaceURI() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->namespaceURI(); return QString(); } QDomNode QDomNodeProto:: nextSibling() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nextSibling(); return QDomNode(); } QDomElement QDomNodeProto:: nextSiblingElement(const QString &taName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nextSiblingElement(taName); return QDomElement(); } QString QDomNodeProto:: nodeName() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeName(); return QString(); } int QDomNodeProto::nodeType() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QString QDomNodeProto:: nodeValue() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeValue(); return QString(); } void QDomNodeProto:: normalize() { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->normalize(); } QDomDocument QDomNodeProto:: ownerDocument() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->ownerDocument(); return QDomDocument(); } QDomNode QDomNodeProto:: parentNode() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->parentNode(); return QDomNode(); } QString QDomNodeProto:: prefix() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->prefix(); return QString(); } QDomNode QDomNodeProto:: previousSibling() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->previousSibling(); return QDomNode(); } QDomElement QDomNodeProto:: previousSiblingElement(const QString &tagName) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->previousSiblingElement(tagName); return QDomElement(); } QDomNode QDomNodeProto:: removeChild(const QDomNode& oldChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->removeChild(oldChild); return QDomNode(); } QDomNode QDomNodeProto:: replaceChild(const QDomNode& newChild, const QDomNode& oldChild) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->replaceChild(newChild, oldChild); return QDomNode(); } void QDomNodeProto:: save(QTextStream& stream, int intarg) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->save(stream, intarg); } void QDomNodeProto:: save(QTextStream& stream, int intarg, int policy) const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->save(stream, intarg, (QDomNode::EncodingPolicy)policy); } void QDomNodeProto:: setNodeValue(const QString&value) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->setNodeValue(value); } void QDomNodeProto:: setPrefix(const QString& pre) { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) item->setPrefix(pre); } QDomAttr QDomNodeProto:: toAttr() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toAttr(); return QDomAttr(); } QDomCDATASection QDomNodeProto:: toCDATASection() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toCDATASection(); return QDomCDATASection(); } QDomCharacterData QDomNodeProto:: toCharacterData() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toCharacterData(); return QDomCharacterData(); } QDomComment QDomNodeProto:: toComment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toComment(); return QDomComment(); } QDomDocument QDomNodeProto:: toDocument() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocument(); return QDomDocument(); } QDomDocumentFragment QDomNodeProto:: toDocumentFragment() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocumentFragment(); return QDomDocumentFragment(); } QDomDocumentType QDomNodeProto:: toDocumentType() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toDocumentType(); return QDomDocumentType(); } QDomElement QDomNodeProto:: toElement() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toElement(); return QDomElement(); } QDomEntity QDomNodeProto:: toEntity() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toEntity(); return QDomEntity(); } QDomEntityReference QDomNodeProto:: toEntityReference() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toEntityReference(); return QDomEntityReference(); } QDomNotation QDomNodeProto:: toNotation() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toNotation(); return QDomNotation(); } QDomProcessingInstruction QDomNodeProto:: toProcessingInstruction() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toProcessingInstruction(); return QDomProcessingInstruction(); } QDomText QDomNodeProto:: toText() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return item->toText(); return QDomText(); } QString QDomNodeProto::toString() const { QDomNode *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomNode(%1=%2, %3, %4)]") .arg(item->nodeName()) .arg(item->nodeValue()) .arg(item->nodeType()) .arg(item->hasChildNodes() ? "has children" : "leaf node"); return QString("[QDomNode(unknown)]"); } qt-client-4.1.0/scriptapi/qdomnodeproto.h000066400000000000000000000122431217451700100204550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMNODEPROTO_H__ #define __QDOMNODEPROTO_H__ #include #include #include #include #include class QDomAttr; class QDomCDATASection; class QDomCharacterData; class QDomComment; class QDomDocument; class QDomDocumentFragment; class QDomDocumentType; class QDomElement; class QDomEntity; class QDomEntityReference; class QDomImplementation; class QDomNotation; class QDomProcessingInstruction; class QDomText; Q_DECLARE_METATYPE(QDomNode*) Q_DECLARE_METATYPE(QDomNode) void setupQDomNodeProto(QScriptEngine *engine); QScriptValue constructQDomNode(QScriptContext *context, QScriptEngine *engine); class QDomNodeProto : public QObject, public QScriptable { Q_OBJECT public: QDomNodeProto(QObject *parent); Q_INVOKABLE QDomNode appendChild(const QDomNode& newChild); Q_INVOKABLE QDomNamedNodeMap attributes() const; Q_INVOKABLE QDomNodeList childNodes() const; Q_INVOKABLE void clear(); Q_INVOKABLE QDomNode cloneNode(bool deep = true) const; Q_INVOKABLE int columnNumber() const; Q_INVOKABLE QDomNode firstChild() const; Q_INVOKABLE QDomElement firstChildElement(const QString &tagName = QString()) const; Q_INVOKABLE bool hasAttributes() const; Q_INVOKABLE bool hasChildNodes() const; Q_INVOKABLE QDomNode insertAfter(const QDomNode& newChild, const QDomNode& refChild); Q_INVOKABLE QDomNode insertBefore(const QDomNode& newChild, const QDomNode& refChild); Q_INVOKABLE bool isAttr() const; Q_INVOKABLE bool isCDATASection() const; Q_INVOKABLE bool isCharacterData() const; Q_INVOKABLE bool isComment() const; Q_INVOKABLE bool isDocument() const; Q_INVOKABLE bool isDocumentFragment() const; Q_INVOKABLE bool isDocumentType() const; Q_INVOKABLE bool isElement() const; Q_INVOKABLE bool isEntity() const; Q_INVOKABLE bool isEntityReference() const; Q_INVOKABLE bool isNotation() const; Q_INVOKABLE bool isNull() const; Q_INVOKABLE bool isProcessingInstruction() const; Q_INVOKABLE bool isSupported(const QString& feature, const QString& version) const; Q_INVOKABLE bool isText() const; Q_INVOKABLE QDomNode lastChild() const; Q_INVOKABLE QDomElement lastChildElement(const QString &tagName = QString()) const; Q_INVOKABLE int lineNumber() const; Q_INVOKABLE QString localName() const; Q_INVOKABLE QDomNode namedItem(const QString& name) const; Q_INVOKABLE QString namespaceURI() const; Q_INVOKABLE QDomNode nextSibling() const; Q_INVOKABLE QDomElement nextSiblingElement(const QString &taName = QString()) const; Q_INVOKABLE QString nodeName() const; Q_INVOKABLE int nodeType() const; Q_INVOKABLE QString nodeValue() const; Q_INVOKABLE void normalize(); Q_INVOKABLE QDomDocument ownerDocument() const; Q_INVOKABLE QDomNode parentNode() const; Q_INVOKABLE QString prefix() const; Q_INVOKABLE QDomNode previousSibling() const; Q_INVOKABLE QDomElement previousSiblingElement(const QString &tagName = QString()) const; Q_INVOKABLE QDomNode removeChild(const QDomNode& oldChild); Q_INVOKABLE QDomNode replaceChild(const QDomNode& newChild, const QDomNode& oldChild); Q_INVOKABLE void save(QTextStream&, int) const; Q_INVOKABLE void save(QTextStream&, int, int) const; Q_INVOKABLE void setNodeValue(const QString&); Q_INVOKABLE void setPrefix(const QString& pre); Q_INVOKABLE QDomAttr toAttr() const; Q_INVOKABLE QDomCDATASection toCDATASection() const; Q_INVOKABLE QDomCharacterData toCharacterData() const; Q_INVOKABLE QDomComment toComment() const; Q_INVOKABLE QDomDocument toDocument() const; Q_INVOKABLE QDomDocumentFragment toDocumentFragment() const; Q_INVOKABLE QDomDocumentType toDocumentType() const; Q_INVOKABLE QDomElement toElement() const; Q_INVOKABLE QDomEntity toEntity() const; Q_INVOKABLE QDomEntityReference toEntityReference() const; Q_INVOKABLE QDomNotation toNotation() const; Q_INVOKABLE QDomProcessingInstruction toProcessingInstruction() const; Q_INVOKABLE QString toString() const; Q_INVOKABLE QDomText toText() const; }; #endif qt-client-4.1.0/scriptapi/qdomnotationproto.cpp000066400000000000000000000042011217451700100217110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomnotationproto.h" #include #include void setupQDomNotationProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomNotationProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomNotation, proto); engine->globalObject().setProperty("QDomNotation", constructor); } QScriptValue constructQDomNotation(QScriptContext * /*context*/, QScriptEngine *engine) { QDomNotation *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomNotation(); return engine->toScriptValue(obj); } QDomNotationProto::QDomNotationProto(QObject *parent) : QObject(parent) { } int QDomNotationProto:: nodeType() const { QDomNotation *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QString QDomNotationProto:: publicId() const { QDomNotation *item = qscriptvalue_cast(thisObject()); if (item) return item->publicId(); return QString(); } QString QDomNotationProto:: systemId() const { QDomNotation *item = qscriptvalue_cast(thisObject()); if (item) return item->systemId(); return QString(); } QString QDomNotationProto::toString() const { QDomNotation *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomNotation(system id = %1, public id = %2)]") .arg(item->systemId()).arg(item->publicId()); return QString("[QDomNotation(unknown)]"); } qt-client-4.1.0/scriptapi/qdomnotationproto.h000066400000000000000000000021131217451700100213560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMNOTATIONPROTO_H__ #define __QDOMNOTATIONPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QDomNotation*) Q_DECLARE_METATYPE(QDomNotation) void setupQDomNotationProto(QScriptEngine *engine); QScriptValue constructQDomNotation(QScriptContext *context, QScriptEngine *engine); class QDomNotationProto : public QObject, public QScriptable { Q_OBJECT public: QDomNotationProto(QObject *parent); Q_INVOKABLE int nodeType() const; Q_INVOKABLE QString publicId() const; Q_INVOKABLE QString systemId() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomprocessinginstructionproto.cpp000066400000000000000000000051251217451700100245420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomprocessinginstructionproto.h" #include #include void setupQDomProcessingInstructionProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomProcessingInstructionProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomProcessingInstruction, proto); engine->globalObject().setProperty("QDomProcessingInstruction", constructor); } QScriptValue constructQDomProcessingInstruction(QScriptContext * /*context*/, QScriptEngine *engine) { QDomProcessingInstruction *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomProcessingInstruction(); return engine->toScriptValue(obj); } QDomProcessingInstructionProto::QDomProcessingInstructionProto(QObject *parent) : QObject(parent) { } QString QDomProcessingInstructionProto:: data() const { QDomProcessingInstruction *item = qscriptvalue_cast(thisObject()); if (item) return item->data(); return QString(); } int QDomProcessingInstructionProto:: nodeType() const { QDomProcessingInstruction *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } void QDomProcessingInstructionProto:: setData(const QString& d) { QDomProcessingInstruction *item = qscriptvalue_cast(thisObject()); if (item) item->setData(d); } QString QDomProcessingInstructionProto:: target() const { QDomProcessingInstruction *item = qscriptvalue_cast(thisObject()); if (item) return item->target(); return QString(); } QString QDomProcessingInstructionProto::toString() const { QDomProcessingInstruction *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomProcessingInstruction(%1)]").arg(item->data()); return QString("[QDomProcessingInstruction(unknown)]"); } qt-client-4.1.0/scriptapi/qdomprocessinginstructionproto.h000066400000000000000000000023551217451700100242110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMPROCESSINGINSTRUCTIONPROTO_H__ #define __QDOMPROCESSINGINSTRUCTIONPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QDomProcessingInstruction*) Q_DECLARE_METATYPE(QDomProcessingInstruction) void setupQDomProcessingInstructionProto(QScriptEngine *engine); QScriptValue constructQDomProcessingInstruction(QScriptContext *context, QScriptEngine *engine); class QDomProcessingInstructionProto : public QObject, public QScriptable { Q_OBJECT public: QDomProcessingInstructionProto(QObject *parent); Q_INVOKABLE QString data() const; Q_INVOKABLE int nodeType() const; Q_INVOKABLE void setData(const QString& d); Q_INVOKABLE QString target() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdomtextproto.cpp000066400000000000000000000035211217451700100210460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdomtextproto.h" #include void setupQDomTextProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QDomTextProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQDomText, proto); engine->globalObject().setProperty("QDomText", constructor); } QScriptValue constructQDomText(QScriptContext * /*context*/, QScriptEngine *engine) { QDomText *obj = 0; // if (context->argumentCount() > 0) // else obj = new QDomText(); return engine->toScriptValue(obj); } QDomTextProto::QDomTextProto(QObject *parent) : QObject(parent) { } int QDomTextProto:: nodeType() const { QDomText *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeType(); return 0; } QDomText QDomTextProto:: splitText(int offset) { QDomText *item = qscriptvalue_cast(thisObject()); if (item) return item->splitText(offset); return QDomText(); } QString QDomTextProto::toString() const { QDomText *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QDomText(%1=%2)]") .arg(item->nodeName()).arg(item->nodeValue()); return QString("[QDomText(unknown)]"); } qt-client-4.1.0/scriptapi/qdomtextproto.h000066400000000000000000000017651217451700100205230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOMTEXTPROTO_H__ #define __QDOMTEXTPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QDomText*) Q_DECLARE_METATYPE(QDomText) void setupQDomTextProto(QScriptEngine *engine); QScriptValue constructQDomText(QScriptContext *context, QScriptEngine *engine); class QDomTextProto : public QObject, public QScriptable { Q_OBJECT public: QDomTextProto(QObject *parent); Q_INVOKABLE int nodeType() const; Q_INVOKABLE QDomText splitText(int offset); Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qdoublevalidatorproto.cpp000066400000000000000000000045471217451700100225530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qdoublevalidatorproto.h" #define DEBUG false QScriptValue QDoubleValidatorToScriptValue(QScriptEngine *engine, QDoubleValidator* const &in) { return engine->newQObject(in); } void QDoubleValidatorFromScriptValue(const QScriptValue &object, QDoubleValidator* &out) { out = qobject_cast(object.toQObject()); } void setupQDoubleValidatorProto(QScriptEngine *engine) { //QScriptValue proto = engine->newQObject(new QDoubleValidatorProto(engine)); //engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); qScriptRegisterMetaType(engine, QDoubleValidatorToScriptValue, QDoubleValidatorFromScriptValue); //QScriptValue constructor = engine->newFunction(constructQDoubleValidator, // proto); //engine->globalObject().setProperty("QDoubleValidator", constructor); } QScriptValue constructQDoubleValidator(QScriptContext *context, QScriptEngine *engine) { QDoubleValidator *obj = 0; if (DEBUG) { qDebug("constructQDoubleValidator() entered"); for (int i = 0; i < context->argumentCount(); i++) qDebug("context->argument(%d) = %s", i, qPrintable(context->argument(i).toString())); } if (context->argumentCount() >= 4) obj = new QDoubleValidator(context->argument(0).toNumber(), context->argument(1).toNumber(), context->argument(2).toInt32(), context->argument(3).toQObject()); else if (context->argumentCount() == 1) obj = new QDoubleValidator(context->argument(0).toQObject()); else context->throwError(QScriptContext::UnknownError, "QDoubleValidator() constructor is not yet supported"); return engine->toScriptValue(obj); } QDoubleValidatorProto::QDoubleValidatorProto(QObject *parent) : QObject(parent) { } qt-client-4.1.0/scriptapi/qdoublevalidatorproto.h000066400000000000000000000030411217451700100222040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QDOUBLEVALIDATORPROTO_H__ #define __QDOUBLEVALIDATORPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QDoubleValidator*) //Q_DECLARE_METATYPE(QDoubleValidator) void setupQDoubleValidatorProto(QScriptEngine *engine); QScriptValue constructQDoubleValidator(QScriptContext *context, QScriptEngine *engine); class QDoubleValidatorProto : public QObject, public QScriptable { Q_OBJECT public: QDoubleValidatorProto(QObject *parent); /* * Leaving these out for now as we just need the ability to * pass this class without changing anything Q_INVOKABLE double bottom () const; Q_INVOKABLE int decimals () const; Q_INVOKABLE Notation notation () const; Q_INVOKABLE void setBottom ( double ); Q_INVOKABLE void setDecimals ( int ); Q_INVOKABLE void setNotation ( Notation ); Q_INVOKABLE void setRange ( double minimum, double maximum, int decimals = 0 ); Q_INVOKABLE void setTop ( double ); Q_INVOKABLE double top () const; Q_INVOKABLE virtual QValidator::State validate ( QString & input, int & pos ) const; */ }; #endif qt-client-4.1.0/scriptapi/qeventproto.cpp000066400000000000000000000063271217451700100205120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qeventproto.h" #include #define DEBUG false void setupQEventProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QEventProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); //QScriptValue constructor = engine->newFunction(constructQEvent, proto); //engine->globalObject().setProperty("QEvent", constructor); } /* QScriptValue constructQEvent(QScriptContext *context, QScriptEngine *engine) { QEvent *obj = 0; if (DEBUG) { qDebug("constructQEvent() entered"); for (int i = 0; i < context->argumentCount(); i++) qDebug("context->argument(%d) = %s", i, qPrintable(context->argument(i).toString())); } if (context->argumentCount() >= 4) obj = new QEvent(context->argument(0).toString(), context->argument(1).toInt32(), context->argument(2).toInt32(), context->argument(3).toBool()); else if (context->argumentCount() == 3) obj = new QEvent(context->argument(0).toString(), context->argument(1).toInt32(), context->argument(2).toInt32()); else if (context->argumentCount() == 2 && qscriptvalue_cast(context->argument(1))) obj = new QEvent(qscriptvalue_cast(context->argument(0)), qscriptvalue_cast(context->argument(1))); else if (context->argumentCount() == 2) obj = new QEvent(context->argument(0).toString(), context->argument(1).toInt32()); else if (context->argumentCount() == 1 && context->argument(0).isString()) { if (DEBUG) qDebug("calling new QEvent(QString)"); obj = new QEvent(context->argument(0).toString()); } else if (context->argumentCount() == 1) obj = new QEvent(qscriptvalue_cast(context->argument(0))); else obj = new QEvent(); return engine->toScriptValue(obj); } */ QEventProto::QEventProto(QObject *parent) : QObject(parent) { } void QEventProto::accept() { QEvent *item = qscriptvalue_cast(thisObject()); if (item) item->accept(); } void QEventProto::ignore() { QEvent *item = qscriptvalue_cast(thisObject()); if (item) item->ignore(); } bool QEventProto::isAccepted() const { QEvent *item = qscriptvalue_cast(thisObject()); if (item) return item->isAccepted(); return false; } void QEventProto::setAccepted(bool accepted) { QEvent *item = qscriptvalue_cast(thisObject()); if (item) item->setAccepted(accepted); } bool QEventProto::spontaneous() const { QEvent *item = qscriptvalue_cast(thisObject()); if (item) return item->spontaneous(); return false; } qt-client-4.1.0/scriptapi/qeventproto.h000066400000000000000000000020711217451700100201470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QEVENTPROTO_H__ #define __QEVENTPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QEvent*) //Q_DECLARE_METATYPE(QEvent) void setupQEventProto(QScriptEngine *engine); //QScriptValue constructQEvent(QScriptContext *context, QScriptEngine *engine); class QEventProto : public QObject, public QScriptable { Q_OBJECT public: QEventProto(QObject *parent); Q_INVOKABLE void accept (); Q_INVOKABLE void ignore (); Q_INVOKABLE bool isAccepted () const; Q_INVOKABLE void setAccepted ( bool accepted ); Q_INVOKABLE bool spontaneous () const; }; #endif qt-client-4.1.0/scriptapi/qfileinfoproto.cpp000066400000000000000000000236201217451700100211570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scriptapi_internal.h" #include "qdirproto.h" #include "qfileproto.h" #include "qfileinfoproto.h" QScriptValue QFileInfotoScriptValue(QScriptEngine *engine, QFileInfo* const &item) { QVariant v; v.setValue(item); return engine->newVariant(v); } void QFileInfofromScriptValue(const QScriptValue &obj, QFileInfo* &item) { item = obj.toVariant().value(); } void setupQFileInfoProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QFileInfotoScriptValue, QFileInfofromScriptValue); QScriptValue proto = engine->newQObject(new QFileInfoProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQFileInfo, proto); engine->globalObject().setProperty("QFileInfo", constructor, CTORPROPFLAGS); } QScriptValue constructQFileInfo(QScriptContext *context, QScriptEngine *engine) { QFileInfo *obj = 0; if (context->argumentCount() == 1 && context->argument(0).isString()) obj = new QFileInfo(context->argument(0).toString()); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new QFileInfo(*(qscriptvalue_cast(context->argument(0)))); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new QFileInfo(*(qscriptvalue_cast(context->argument(0)))); else if (context->argumentCount() == 2 && // qscriptvalue_cast(context->argument(0)) && // TODO: how do we check if this worked? context->argument(1).isString()) obj = new QFileInfo(qscriptvalue_cast(context->argument(0)), context->argument(1).toString()); else obj = new QFileInfo(); return engine->toScriptValue(obj); } QFileInfoProto::QFileInfoProto(QObject *parent) : QObject(parent) { } QDir QFileInfoProto::absoluteDir() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->absoluteDir(); return QDir(); } QString QFileInfoProto::absoluteFilePath() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->absoluteFilePath(); return QString(); } QString QFileInfoProto::absolutePath() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->absolutePath(); return QString(); } QString QFileInfoProto::baseName() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->baseName(); return QString(); } QString QFileInfoProto::bundleName() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->bundleName(); return QString(); } bool QFileInfoProto::caching() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->caching(); return false; } QString QFileInfoProto::canonicalFilePath() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->canonicalFilePath(); return QString(); } QString QFileInfoProto::canonicalPath() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->canonicalPath(); return QString(); } QString QFileInfoProto::completeBaseName() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->completeBaseName(); return QString(); } QString QFileInfoProto::completeSuffix() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->completeSuffix(); return QString(); } QDateTime QFileInfoProto::created() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->created(); return QDateTime(); } QDir QFileInfoProto::dir() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->dir(); return QDir(); } bool QFileInfoProto::exists() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->exists(); return false; } QString QFileInfoProto::fileName() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->fileName(); return QString(); } QString QFileInfoProto::filePath() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->filePath(); return QString(); } QString QFileInfoProto::group() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->group(); return QString(); } uint QFileInfoProto::groupId() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->groupId(); return 0; } bool QFileInfoProto::isAbsolute() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isAbsolute(); return false; } bool QFileInfoProto::isBundle() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isBundle(); return false; } bool QFileInfoProto::isDir() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isDir(); return false; } bool QFileInfoProto::isExecutable() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isExecutable(); return false; } bool QFileInfoProto::isFile() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isFile(); return false; } bool QFileInfoProto::isHidden() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isHidden(); return false; } bool QFileInfoProto::isReadable() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isReadable(); return false; } bool QFileInfoProto::isRelative() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isRelative(); return false; } bool QFileInfoProto::isRoot() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isRoot(); return false; } bool QFileInfoProto::isSymLink() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isSymLink(); return false; } bool QFileInfoProto::isWritable() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->isWritable(); return false; } QDateTime QFileInfoProto::lastModified() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->lastModified(); return QDateTime(); } QDateTime QFileInfoProto::lastRead() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->lastRead(); return QDateTime(); } bool QFileInfoProto::makeAbsolute() { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->makeAbsolute(); return false; } QString QFileInfoProto::owner() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->owner(); return QString(); } uint QFileInfoProto::ownerId() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->ownerId(); return 0; } QString QFileInfoProto::path() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->path(); return QString(); } bool QFileInfoProto::permission(QFile::Permissions permissions) const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->permission(permissions); return false; } QFile::Permissions QFileInfoProto::permissions() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->permissions(); return QFile::Permissions(); } void QFileInfoProto::refresh() { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) item->refresh(); } void QFileInfoProto::setCaching(bool enable) { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) item->setCaching(enable); } void QFileInfoProto::setFile(const QString & file) { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) item->setFile(file); } void QFileInfoProto::setFile(const QFile & file) { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) item->setFile(file); } void QFileInfoProto::setFile(const QDir & dir, const QString & file) { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) item->setFile(dir, file); } qint64 QFileInfoProto::size() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } QString QFileInfoProto::suffix() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->suffix(); return QString(); } QString QFileInfoProto::symLinkTarget() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return item->symLinkTarget(); return QString(); } /* QString QFileInfoProto::toString() const { QFileInfo *item = qscriptvalue_cast(thisObject()); if (item) return QString("QFileInfo()"); return QString("QFileInfo(unknown)"); } */ qt-client-4.1.0/scriptapi/qfileinfoproto.h000066400000000000000000000062571217451700100206330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QFILEINFOPROTO_H__ #define __QFILEINFOPROTO_H__ #include #include #include #include #include #include Q_DECLARE_METATYPE(QFileInfo*) void setupQFileInfoProto(QScriptEngine *engine); QScriptValue constructQFileInfo(QScriptContext *context, QScriptEngine *engine); class QFileInfoProto : public QObject, public QScriptable { Q_OBJECT public: QFileInfoProto(QObject *parent); Q_INVOKABLE QDir absoluteDir() const; Q_INVOKABLE QString absoluteFilePath() const; Q_INVOKABLE QString absolutePath() const; Q_INVOKABLE QString baseName() const; Q_INVOKABLE QString bundleName() const; Q_INVOKABLE bool caching() const; Q_INVOKABLE QString canonicalFilePath() const; Q_INVOKABLE QString canonicalPath() const; Q_INVOKABLE QString completeBaseName() const; Q_INVOKABLE QString completeSuffix() const; Q_INVOKABLE QDateTime created() const; Q_INVOKABLE QDir dir() const; Q_INVOKABLE bool exists() const; Q_INVOKABLE QString fileName() const; Q_INVOKABLE QString filePath() const; Q_INVOKABLE QString group() const; Q_INVOKABLE uint groupId() const; Q_INVOKABLE bool isAbsolute() const; Q_INVOKABLE bool isBundle() const; Q_INVOKABLE bool isDir() const; Q_INVOKABLE bool isExecutable() const; Q_INVOKABLE bool isFile() const; Q_INVOKABLE bool isHidden() const; Q_INVOKABLE bool isReadable() const; Q_INVOKABLE bool isRelative() const; Q_INVOKABLE bool isRoot() const; Q_INVOKABLE bool isSymLink() const; Q_INVOKABLE bool isWritable() const; Q_INVOKABLE QDateTime lastModified() const; Q_INVOKABLE QDateTime lastRead() const; Q_INVOKABLE bool makeAbsolute(); Q_INVOKABLE QString owner() const; Q_INVOKABLE uint ownerId() const; Q_INVOKABLE QString path() const; Q_INVOKABLE bool permission(QFile::Permissions permissions) const; Q_INVOKABLE QFile::Permissions permissions() const; Q_INVOKABLE void refresh(); Q_INVOKABLE void setCaching(bool enable); Q_INVOKABLE void setFile(const QString & file); Q_INVOKABLE void setFile(const QFile & file); Q_INVOKABLE void setFile(const QDir & dir, const QString & file); Q_INVOKABLE qint64 size() const; Q_INVOKABLE QString suffix() const; Q_INVOKABLE QString symLinkTarget() const; }; #endif qt-client-4.1.0/scriptapi/qfileproto.cpp000066400000000000000000000503451217451700100203070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scriptapi_internal.h" #include "qfileproto.h" /** \ingroup scriptapi \brief Script Exposure of QFile class. \todo implement QFile::setDecodingFunction(DecoderFn) \todo implement QFile::setEncodingFunction(EncoderFn) */ //static functions static QScriptValue qfile_copy(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isString()) result = QFile::copy(context->argument(0).toString(), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::copy()"); return QScriptValue(result); } static QScriptValue qfile_decodeName(QScriptContext *context, QScriptEngine * /*engine*/ ) { QString result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QFile::decodeName(context->argument(0).toString().toUtf8()); else if (context->argumentCount() == 1 && ! qscriptvalue_cast(context->argument(0)).isEmpty()) result = QFile::decodeName(qscriptvalue_cast(context->argument(0))); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::decodeName()"); return QScriptValue(result); } static QScriptValue qfile_encodeName(QScriptContext *context, QScriptEngine *engine) { QByteArray result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QFile::encodeName(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::encodeName()"); return engine->newVariant(result); } static QScriptValue qfile_exists(QScriptContext *context, QScriptEngine * /*engine*/) { bool result = false; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QFile::exists(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::exists()"); return QScriptValue(result); } static QScriptValue qfile_link(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isString()) result = QFile::link(context->argument(0).toString(), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::link()"); return QScriptValue(result); } static QScriptValue qfile_permissions(QScriptContext *context, QScriptEngine * /*engine*/ ) { QFile::Permissions result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QFile::permissions(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::permissions()"); return QScriptValue(result); } static QScriptValue qfile_remove(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QFile::remove(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::remove()"); return QScriptValue(result); } static QScriptValue qfile_rename(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isString()) result = QFile::rename(context->argument(0).toString(), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::rename()"); return QScriptValue(result); } static QScriptValue qfile_resize(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isNumber()) result = QFile::resize(context->argument(0).toString(), context->argument(1).toInteger()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::resize()"); return QScriptValue(result); } /* static QScriptValue qfile_setDecodingFunction(DecoderFn function) { } static QScriptValue qfile_setEncodingFunction(EncoderFn function) { } */ static QScriptValue qfile_setPermissions(QScriptContext *context, QScriptEngine * /*engine*/ ) { bool result = false; if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isNumber()) result = QFile::setPermissions(context->argument(0).toString(), (QFile::Permissions)(context->argument(1).toInt32())); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::setPermissions()"); return QScriptValue(result); } static QScriptValue qfile_symLinkTarget(QScriptContext *context, QScriptEngine * /*engine*/ ) { QString result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QFile::symLinkTarget(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile::symLinkTarget()"); return QScriptValue(result); } void setupQFileProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QFileProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQFile, proto); engine->globalObject().setProperty("QFile", constructor, CTORPROPFLAGS); constructor.setProperty("copy", engine->newFunction(qfile_copy), STATICPROPFLAGS); constructor.setProperty("decodeName", engine->newFunction(qfile_decodeName), STATICPROPFLAGS); constructor.setProperty("encodeName", engine->newFunction(qfile_encodeName), STATICPROPFLAGS); constructor.setProperty("exists", engine->newFunction(qfile_exists), STATICPROPFLAGS); constructor.setProperty("link", engine->newFunction(qfile_link), STATICPROPFLAGS); constructor.setProperty("permissions", engine->newFunction(qfile_permissions), STATICPROPFLAGS); constructor.setProperty("remove", engine->newFunction(qfile_remove), STATICPROPFLAGS); constructor.setProperty("rename", engine->newFunction(qfile_rename), STATICPROPFLAGS); constructor.setProperty("resize", engine->newFunction(qfile_resize), STATICPROPFLAGS); /* constructor.setProperty("setDecodingFunction",engine->newFunction(qfile_setDecodingFunction),STATICPROPFLAGS); constructor.setProperty("setEncodingFunction",engine->newFunction(qfile_setEncodingFunction),STATICPROPFLAGS); */ constructor.setProperty("setPermissions", engine->newFunction(qfile_setPermissions), STATICPROPFLAGS); constructor.setProperty("symLinkTarget", engine->newFunction(qfile_symLinkTarget), STATICPROPFLAGS); constructor.setProperty("NoError", QScriptValue(engine, QFile::NoError), ENUMPROPFLAGS); constructor.setProperty("ReadError", QScriptValue(engine, QFile::ReadError), ENUMPROPFLAGS); constructor.setProperty("WriteError", QScriptValue(engine, QFile::WriteError), ENUMPROPFLAGS); constructor.setProperty("FatalError", QScriptValue(engine, QFile::FatalError), ENUMPROPFLAGS); constructor.setProperty("ResourceError", QScriptValue(engine, QFile::ResourceError), ENUMPROPFLAGS); constructor.setProperty("OpenError", QScriptValue(engine, QFile::OpenError), ENUMPROPFLAGS); constructor.setProperty("AbortError", QScriptValue(engine, QFile::AbortError), ENUMPROPFLAGS); constructor.setProperty("TimeOutError", QScriptValue(engine, QFile::TimeOutError), ENUMPROPFLAGS); constructor.setProperty("UnspecifiedError", QScriptValue(engine, QFile::UnspecifiedError),ENUMPROPFLAGS); constructor.setProperty("RemoveError", QScriptValue(engine, QFile::RemoveError), ENUMPROPFLAGS); constructor.setProperty("RenameError", QScriptValue(engine, QFile::RenameError), ENUMPROPFLAGS); constructor.setProperty("PositionError", QScriptValue(engine, QFile::PositionError), ENUMPROPFLAGS); constructor.setProperty("ResizeError", QScriptValue(engine, QFile::ResizeError), ENUMPROPFLAGS); constructor.setProperty("PermissionsError", QScriptValue(engine, QFile::PermissionsError),ENUMPROPFLAGS); constructor.setProperty("CopyError", QScriptValue(engine, QFile::CopyError), ENUMPROPFLAGS); constructor.setProperty("NoOptions", QScriptValue(engine, QFile::NoOptions), ENUMPROPFLAGS); constructor.setProperty("ReadOwner", QScriptValue(engine, QFile::ReadOwner), ENUMPROPFLAGS); constructor.setProperty("WriteOwner", QScriptValue(engine, QFile::WriteOwner), ENUMPROPFLAGS); constructor.setProperty("ExeOwner", QScriptValue(engine, QFile::ExeOwner), ENUMPROPFLAGS); constructor.setProperty("ReadUser", QScriptValue(engine, QFile::ReadUser), ENUMPROPFLAGS); constructor.setProperty("WriteUser", QScriptValue(engine, QFile::WriteUser), ENUMPROPFLAGS); constructor.setProperty("ExeUser", QScriptValue(engine, QFile::ExeUser), ENUMPROPFLAGS); constructor.setProperty("ReadGroup", QScriptValue(engine, QFile::ReadGroup), ENUMPROPFLAGS); constructor.setProperty("WriteGroup", QScriptValue(engine, QFile::WriteGroup), ENUMPROPFLAGS); constructor.setProperty("ExeGroup", QScriptValue(engine, QFile::ExeGroup), ENUMPROPFLAGS); constructor.setProperty("ReadOther", QScriptValue(engine, QFile::ReadOther), ENUMPROPFLAGS); constructor.setProperty("WriteOther", QScriptValue(engine, QFile::WriteOther), ENUMPROPFLAGS); constructor.setProperty("ExeOther", QScriptValue(engine, QFile::ExeOther), ENUMPROPFLAGS); } QScriptValue constructQFile(QScriptContext *context, QScriptEngine *engine) { QFile *obj = 0; if (context->argumentCount() == 1 && context->argument(0).isString()) obj = new QFile(context->argument(0).toString()); else if (context->argumentCount() == 1 && context->argument(0).isQObject()) obj = new QFile(context->argument(0).toQObject()); else if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isQObject()) obj = new QFile(context->argument(0).toString(), context->argument(1).toQObject()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QFile constructor"); return engine->toScriptValue(obj); } QFileProto::QFileProto(QObject *parent) : QObject(parent) { } bool QFileProto::atEnd() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->atEnd(); return false; } qint64 QFileProto::bytesAvailable() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesAvailable(); return 0; } qint64 QFileProto::bytesToWrite() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesToWrite(); return 0; } bool QFileProto::canReadLine() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->canReadLine(); return false; } void QFileProto::close() { QFile *item = qscriptvalue_cast(thisObject()); if (item) item->close(); } bool QFileProto::copy(const QString &newName) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->copy(newName); return false; } QFile::FileError QFileProto::error() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->error(); return QFile::FileError(); } QString QFileProto::errorString() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->errorString(); return QString(); } bool QFileProto::exists() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->exists(); return false; } QString QFileProto::fileName() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->fileName(); return QString(); } bool QFileProto::flush() { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->flush(); return false; } bool QFileProto::getChar(char *c) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->getChar(c); return false; } int QFileProto::handle() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->handle(); return 0; } bool QFileProto::isOpen() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->isOpen(); return false; } bool QFileProto::isReadable() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->isReadable(); return false; } bool QFileProto::isSequential() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->isSequential(); return false; } bool QFileProto::isTextModeEnabled() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->isTextModeEnabled(); return false; } bool QFileProto::isWritable() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->isWritable(); return false; } bool QFileProto::link(const QString &linkName) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->link(linkName); return false; } uchar *QFileProto::map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->map(offset, size, flags); return 0; } bool QFileProto::open(FILE *fh, int mode) { QIODevice::OpenModeFlag p; p = (enum QIODevice::OpenModeFlag)mode; QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->open(fh, p); return false; } bool QFileProto::open(int fd, int mode) { QIODevice::OpenModeFlag p; p = (enum QIODevice::OpenModeFlag)mode; QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->open(fd, p); return false; } bool QFileProto::open(int mode) { QIODevice::OpenModeFlag p; p = (enum QIODevice::OpenModeFlag)mode; QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->open(p); return false; } QIODevice::OpenMode QFileProto::openMode() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->openMode(); return QIODevice::OpenMode(); } qint64 QFileProto::peek(char *data, qint64 maxSize) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(data, maxSize); return 0; } QByteArray QFileProto::peek(qint64 maxSize) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(maxSize); return QByteArray(); } QFile::Permissions QFileProto::permissions() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->permissions(); return QFile::Permissions(); } qint64 QFileProto::pos() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->pos(); return 0; } bool QFileProto::putChar(char c) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->putChar(c); return false; } qint64 QFileProto::read(char *data, qint64 maxSize) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->read(data, maxSize); return 0; } QByteArray QFileProto::read(qint64 maxSize) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->read(maxSize); return QByteArray(); } QByteArray QFileProto::readAll() { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->readAll(); return QByteArray(); } qint64 QFileProto::readLine(char *data, qint64 maxSize) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(data, maxSize); return 0; } QByteArray QFileProto::readLine(qint64 maxSize) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(maxSize); return QByteArray(); } bool QFileProto::remove() { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->remove(); return false; } bool QFileProto::rename(const QString &newName) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->rename(newName); return false; } bool QFileProto::reset() { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->reset(); return false; } bool QFileProto::resize(qint64 sz) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->resize(sz); return false; } bool QFileProto::seek(qint64 pos) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->seek(pos); return false; } void QFileProto::setFileName(const QString &name) { QFile *item = qscriptvalue_cast(thisObject()); if (item) item->setFileName(name); } bool QFileProto::setPermissions(QFile::Permissions permissions) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->setPermissions(permissions); return false; } void QFileProto::setTextModeEnabled(bool enabled) { QFile *item = qscriptvalue_cast(thisObject()); if (item) item->setTextModeEnabled(enabled); } qint64 QFileProto::size() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } QString QFileProto::symLinkTarget() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->symLinkTarget(); return QString(); } void QFileProto::ungetChar(char c) { QFile *item = qscriptvalue_cast(thisObject()); if (item) item->ungetChar(c); } bool QFileProto::unmap(uchar *address) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->unmap(address); return false; } void QFileProto::unsetError() { QFile *item = qscriptvalue_cast(thisObject()); if (item) item->unsetError(); } bool QFileProto::waitForBytesWritten(int msecs) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForBytesWritten(msecs); return false; } bool QFileProto::waitForReadyRead(int msecs) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForReadyRead(msecs); return false; } qint64 QFileProto::write(const QByteArray &byteArray) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->write(byteArray); return 0; } qint64 QFileProto::write(const char *data) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->write(data); return 0; } qint64 QFileProto::write(const char *data, qint64 maxSize) { QFile *item = qscriptvalue_cast(thisObject()); if (item) return item->write(data, maxSize); return 0; } /* QString QFileProto::toString() const { QFile *item = qscriptvalue_cast(thisObject()); if (item) return QString("QFile()"); return QString("QFile(unknown)"); } */ qt-client-4.1.0/scriptapi/qfileproto.h000066400000000000000000000101471217451700100177500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QFILEPROTO_H__ #define __QFILEPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QFile*) Q_DECLARE_METATYPE(enum QFile::FileError); Q_DECLARE_METATYPE(enum QFile::MemoryMapFlags); Q_DECLARE_METATYPE(enum QFile::Permission); void setupQFileProto(QScriptEngine *engine); QScriptValue constructQFile(QScriptContext *context, QScriptEngine *engine); class QFileProto : public QObject, public QScriptable { Q_OBJECT public: QFileProto(QObject *parent); Q_INVOKABLE bool atEnd() const; Q_INVOKABLE qint64 bytesAvailable() const; Q_INVOKABLE qint64 bytesToWrite() const; Q_INVOKABLE bool canReadLine() const; Q_INVOKABLE void close(); Q_INVOKABLE bool copy(const QString &newName); Q_INVOKABLE QFile::FileError error() const; Q_INVOKABLE QString errorString() const; Q_INVOKABLE bool exists() const; Q_INVOKABLE QString fileName() const; Q_INVOKABLE bool flush(); Q_INVOKABLE bool getChar(char *c); Q_INVOKABLE int handle() const; Q_INVOKABLE bool isOpen() const; Q_INVOKABLE bool isReadable() const; Q_INVOKABLE bool isSequential() const; Q_INVOKABLE bool isTextModeEnabled() const; Q_INVOKABLE bool isWritable() const; Q_INVOKABLE bool link(const QString &linkName); Q_INVOKABLE uchar *map(qint64 offset, qint64 size, QFile::MemoryMapFlags flags = QFile::NoOptions); Q_INVOKABLE bool open(FILE *fh, int mode); Q_INVOKABLE bool open(int fd, int mode); Q_INVOKABLE bool open(int mode); Q_INVOKABLE QIODevice::OpenMode openMode() const; Q_INVOKABLE qint64 peek(char *data, qint64 maxSize); Q_INVOKABLE QByteArray peek(qint64 maxSize); Q_INVOKABLE QFile::Permissions permissions() const; Q_INVOKABLE qint64 pos() const; Q_INVOKABLE bool putChar(char c); Q_INVOKABLE qint64 read(char *data, qint64 maxSize); Q_INVOKABLE QByteArray read(qint64 maxSize); Q_INVOKABLE QByteArray readAll(); Q_INVOKABLE qint64 readLine(char *data, qint64 maxSize); Q_INVOKABLE QByteArray readLine(qint64 maxSize = 0); Q_INVOKABLE bool remove(); Q_INVOKABLE bool rename(const QString &newName); Q_INVOKABLE bool reset(); Q_INVOKABLE bool resize(qint64 sz); Q_INVOKABLE bool seek(qint64 pos); Q_INVOKABLE void setFileName(const QString &name); Q_INVOKABLE bool setPermissions(QFile::Permissions permissions); Q_INVOKABLE void setTextModeEnabled(bool enabled); Q_INVOKABLE qint64 size() const; Q_INVOKABLE QString symLinkTarget() const; Q_INVOKABLE void ungetChar(char c); Q_INVOKABLE bool unmap(uchar *address); Q_INVOKABLE void unsetError(); Q_INVOKABLE bool waitForBytesWritten(int msecs); Q_INVOKABLE bool waitForReadyRead(int msecs); Q_INVOKABLE qint64 write(const QByteArray &byteArray); Q_INVOKABLE qint64 write(const char *data); Q_INVOKABLE qint64 write(const char *data, qint64 maxSize); signals: void aboutToClose(); void bytesWritten(qint64 bytes); void readChannelFinished(); void readyRead(); }; #endif qt-client-4.1.0/scriptapi/qfontproto.cpp000066400000000000000000000260021217451700100203270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qfontproto.h" #include #define DEBUG false void setupQFontProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QFontProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQFont, proto); engine->globalObject().setProperty("QFont", constructor); } QScriptValue constructQFont(QScriptContext *context, QScriptEngine *engine) { QFont *obj = 0; if (DEBUG) { qDebug("constructQFont() entered"); for (int i = 0; i < context->argumentCount(); i++) qDebug("context->argument(%d) = %s", i, qPrintable(context->argument(i).toString())); } if (context->argumentCount() >= 4) obj = new QFont(context->argument(0).toString(), context->argument(1).toInt32(), context->argument(2).toInt32(), context->argument(3).toBool()); else if (context->argumentCount() == 3) obj = new QFont(context->argument(0).toString(), context->argument(1).toInt32(), context->argument(2).toInt32()); else if (context->argumentCount() == 2 && qscriptvalue_cast(context->argument(1))) obj = new QFont(qscriptvalue_cast(context->argument(0)), qscriptvalue_cast(context->argument(1))); else if (context->argumentCount() == 2) obj = new QFont(context->argument(0).toString(), context->argument(1).toInt32()); else if (context->argumentCount() == 1 && context->argument(0).isString()) { if (DEBUG) qDebug("calling new QFont(QString)"); obj = new QFont(context->argument(0).toString()); } else if (context->argumentCount() == 1) obj = new QFont(qscriptvalue_cast(context->argument(0))); else obj = new QFont(); return engine->toScriptValue(obj); } QFontProto::QFontProto(QObject *parent) : QObject(parent) { } bool QFontProto::bold() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->bold(); return false; } int QFontProto::capitalization() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->capitalization(); return 0; } QString QFontProto::defaultFamily() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->defaultFamily(); return QString(); } bool QFontProto::exactMatch() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->exactMatch(); return false; } QString QFontProto::family() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->family(); return QString(); } bool QFontProto::fixedPitch() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->fixedPitch(); return false; } /* FT_Face QFontProto::freetypeFace() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->freetypeFace(); return FT_Face(); } */ bool QFontProto::fromString(const QString &descrip) { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->fromString(descrip); return false; } /* HFONT QFontProto::handle() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->handle(); return HFONT(); } */ bool QFontProto::isCopyOf(const QFont &f) const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->isCopyOf(f); return false; } bool QFontProto::italic() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->italic(); return false; } bool QFontProto::kerning() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->kerning(); return false; } QString QFontProto::key() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->key(); return QString(); } QString QFontProto::lastResortFamily() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->lastResortFamily(); return QString(); } QString QFontProto::lastResortFont() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->lastResortFont(); return QString(); } qreal QFontProto::letterSpacing() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->letterSpacing(); return qreal(); } int QFontProto::letterSpacingType() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->letterSpacingType(); return 0; } #ifdef Q_WS_MAC quint32 QFontProto::macFontID() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->macFontID(); return quint32(); } #endif bool QFontProto::overline() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->overline(); return false; } int QFontProto::pixelSize() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->pixelSize(); return 0; } int QFontProto::pointSize() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->pointSize(); return 0; } qreal QFontProto::pointSizeF() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->pointSizeF(); return 0; } bool QFontProto::rawMode() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->rawMode(); return false; } QString QFontProto::rawName() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->rawName(); return QString(); } QFont QFontProto::resolve(const QFont &other) const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->resolve(other); return QFont(); } void QFontProto::setBold(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setBold(enable); } void QFontProto::setCapitalization(int caps) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setCapitalization((QFont::Capitalization)caps); } void QFontProto::setFamily(const QString &family) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setFamily(family); } void QFontProto::setFixedPitch(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setFixedPitch(enable); } void QFontProto::setItalic(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setItalic(enable); } void QFontProto::setKerning(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setKerning(enable); } void QFontProto::setLetterSpacing(int type, qreal spacing) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setLetterSpacing((QFont::SpacingType)type, spacing); } void QFontProto::setOverline(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setOverline(enable); } void QFontProto::setPixelSize(int pixelSize) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setPixelSize(pixelSize); } void QFontProto::setPointSize(int pointSize) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setPointSize(pointSize); } void QFontProto::setPointSizeF(qreal pointSize) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setPointSizeF(pointSize); } void QFontProto::setRawMode(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setRawMode(enable); } void QFontProto::setRawName(const QString &name) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setRawName(name); } void QFontProto::setStretch(int factor) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setStretch(factor); } void QFontProto::setStrikeOut(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setStrikeOut(enable); } void QFontProto::setStyle(int style) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setStyle((QFont::Style)style); } void QFontProto::setStyleHint(int hint, int strategy) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setStyleHint((QFont::StyleHint)hint, (QFont::StyleStrategy)strategy); } void QFontProto::setStyleStrategy(int s) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setStyleStrategy((QFont::StyleStrategy)s); } void QFontProto::setUnderline(bool enable) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setUnderline(enable); } void QFontProto::setWeight(int weight) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setWeight(weight); } void QFontProto::setWordSpacing(qreal spacing) { QFont *item = qscriptvalue_cast(thisObject()); if (item) item->setWordSpacing(spacing); } int QFontProto::stretch() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->stretch(); return 0; } bool QFontProto::strikeOut() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->strikeOut(); return false; } int QFontProto::style() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->style(); return 0; } int QFontProto::styleHint() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->styleHint(); return 0; } int QFontProto::styleStrategy() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->styleStrategy(); return 0; } QString QFontProto::toString() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->toString(); return QString(); } bool QFontProto::underline() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->underline(); return false; } int QFontProto::weight() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->weight(); return 0; } qreal QFontProto::wordSpacing() const { QFont *item = qscriptvalue_cast(thisObject()); if (item) return item->wordSpacing(); return qreal(); } qt-client-4.1.0/scriptapi/qfontproto.h000066400000000000000000000072531217451700100200030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QFONTPROTO_H__ #define __QFONTPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QFont*) Q_DECLARE_METATYPE(QFont) // this really belongs in qpaintdeviceproto.h Q_DECLARE_METATYPE(QPaintDevice*) void setupQFontProto(QScriptEngine *engine); QScriptValue constructQFont(QScriptContext *context, QScriptEngine *engine); class QFontProto : public QObject, public QScriptable { Q_OBJECT public: QFontProto(QObject *parent); Q_INVOKABLE bool bold() const; Q_INVOKABLE int capitalization() const; Q_INVOKABLE QString defaultFamily() const; Q_INVOKABLE bool exactMatch() const; Q_INVOKABLE QString family() const; Q_INVOKABLE bool fixedPitch() const; // Q_INVOKABLE FT_Face freetypeFace() const; Q_INVOKABLE bool fromString(const QString &descrip); // Q_INVOKABLE HFONT handle() const; Q_INVOKABLE bool isCopyOf(const QFont &f) const; Q_INVOKABLE bool italic() const; Q_INVOKABLE bool kerning() const; Q_INVOKABLE QString key() const; Q_INVOKABLE QString lastResortFamily() const; Q_INVOKABLE QString lastResortFont() const; Q_INVOKABLE qreal letterSpacing() const; Q_INVOKABLE int letterSpacingType() const; #ifdef Q_WS_MAC Q_INVOKABLE quint32 macFontID() const; #endif Q_INVOKABLE bool overline() const; Q_INVOKABLE int pixelSize() const; Q_INVOKABLE int pointSize() const; Q_INVOKABLE qreal pointSizeF() const; Q_INVOKABLE bool rawMode() const; Q_INVOKABLE QString rawName() const; Q_INVOKABLE QFont resolve(const QFont &other) const; Q_INVOKABLE void setBold(bool enable); Q_INVOKABLE void setCapitalization(int caps); Q_INVOKABLE void setFamily(const QString &family); Q_INVOKABLE void setFixedPitch(bool enable); Q_INVOKABLE void setItalic(bool enable); Q_INVOKABLE void setKerning(bool enable); Q_INVOKABLE void setLetterSpacing(int type, qreal spacing); Q_INVOKABLE void setOverline(bool enable); Q_INVOKABLE void setPixelSize(int pixelSize); Q_INVOKABLE void setPointSize(int pointSize); Q_INVOKABLE void setPointSizeF(qreal pointSize); Q_INVOKABLE void setRawMode(bool enable); Q_INVOKABLE void setRawName(const QString &name); Q_INVOKABLE void setStretch(int factor); Q_INVOKABLE void setStrikeOut(bool enable); Q_INVOKABLE void setStyle(int style); Q_INVOKABLE void setStyleHint(int hint, int strategy = 0); Q_INVOKABLE void setStyleStrategy(int s); Q_INVOKABLE void setUnderline(bool enable); Q_INVOKABLE void setWeight(int weight); Q_INVOKABLE void setWordSpacing(qreal spacing); Q_INVOKABLE int stretch() const; Q_INVOKABLE bool strikeOut() const; Q_INVOKABLE int style() const; Q_INVOKABLE int styleHint() const; Q_INVOKABLE int styleStrategy() const; Q_INVOKABLE QString toString() const; Q_INVOKABLE bool underline() const; Q_INVOKABLE int weight() const; Q_INVOKABLE qreal wordSpacing() const; }; #endif qt-client-4.1.0/scriptapi/qformlayoutproto.cpp000066400000000000000000000357601217451700100215750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qformlayoutproto.h" #include #include #define DEBUG false QScriptValue QFormLayouttoScriptValue(QScriptEngine *engine, QFormLayout* const &item) { return engine->newQObject(item); } void QFormLayoutfromScriptValue(const QScriptValue &obj, QFormLayout* &item) { item = qobject_cast(obj.toQObject()); } void setupQFormLayoutProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QFormLayouttoScriptValue, QFormLayoutfromScriptValue); QScriptValue proto = engine->newQObject(new QFormLayoutProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQFormLayout, proto); engine->globalObject().setProperty("QFormLayout", constructor); // enum QFormLayout::FieldGrowthPolicy constructor.setProperty("FieldsStayAtSizeHint", QScriptValue(engine, QFormLayout::FieldsStayAtSizeHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("ExpandingFieldsGrow", QScriptValue(engine, QFormLayout::ExpandingFieldsGrow), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("AllNonFixedFieldsGrow", QScriptValue(engine, QFormLayout::AllNonFixedFieldsGrow), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QFormLayout::ItemRole constructor.setProperty("LabelRole", QScriptValue(engine, QFormLayout::LabelRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("FieldRole", QScriptValue(engine, QFormLayout::FieldRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("SpanningRole", QScriptValue(engine, QFormLayout::SpanningRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QFormLayout::RowWrapPolicy constructor.setProperty("DontWrapRows", QScriptValue(engine, QFormLayout::DontWrapRows), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("WrapLongRows", QScriptValue(engine, QFormLayout::WrapLongRows), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("WrapAllRows", QScriptValue(engine, QFormLayout::WrapAllRows), QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue constructQFormLayout(QScriptContext *context, QScriptEngine *engine) { QFormLayout *obj = 0; if (context->argumentCount() == 0) obj = new QFormLayout(); else if (context->argumentCount() > 0 && qscriptvalue_cast(context->argument(0))) obj = new QFormLayout(qscriptvalue_cast(context->argument(0))); return engine->toScriptValue(obj); } QFormLayoutProto::QFormLayoutProto(QObject *parent) : QObject(parent) { } bool QFormLayoutProto::activate() { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->activate(); return false; } void QFormLayoutProto::addItem(QLayoutItem *item) { QFormLayout *formitem = qscriptvalue_cast(thisObject()); if (DEBUG) qDebug("QFormLayoutProto::addItem(%p) called", item); if (formitem) formitem->addItem(item); } void QFormLayoutProto::addRow(QWidget *label, QWidget *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addRow(label, field); } void QFormLayoutProto::addRow(QWidget *label, QLayout *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addRow(label, field); } void QFormLayoutProto::addRow(const QString &labelText, QWidget *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addRow(labelText, field); } void QFormLayoutProto::addRow(const QString &labelText, QLayout *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addRow(labelText, field); } void QFormLayoutProto::addRow(QWidget *widget) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addRow(widget); } void QFormLayoutProto::addRow(QLayout *layout) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addRow(layout); } void QFormLayoutProto::addWidget(QWidget *widget) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addWidget(widget); } QRect QFormLayoutProto::contentsRect() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->contentsRect(); return QRect(); } int QFormLayoutProto::count() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } Qt::Orientations QFormLayoutProto::expandingDirections() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->expandingDirections(); return Qt::Orientations(); } QFormLayout::FieldGrowthPolicy QFormLayoutProto::fieldGrowthPolicy() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->fieldGrowthPolicy(); return QFormLayout::FieldsStayAtSizeHint; } Qt::Alignment QFormLayoutProto::formAlignment() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->formAlignment(); return 0; } void QFormLayoutProto::getContentsMargins(int *left, int *top, int *right, int *bottom) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->getContentsMargins(left, top, right, bottom); } void QFormLayoutProto::getItemPosition(int index, int *rowPtr, QFormLayout::ItemRole *rolePtr) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->getItemPosition(index, rowPtr, rolePtr); } void QFormLayoutProto::getLayoutPosition(QLayout *layout, int *rowPtr, QFormLayout::ItemRole *rolePtr) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->getLayoutPosition(layout, rowPtr, rolePtr); } void QFormLayoutProto::getWidgetPosition(QWidget *widget, int *rowPtr, QFormLayout::ItemRole *rolePtr) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->getWidgetPosition(widget, rowPtr, rolePtr); } int QFormLayoutProto::horizontalSpacing() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->horizontalSpacing(); return 0; } int QFormLayoutProto::indexOf(QWidget *widget) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(widget); return 0; } void QFormLayoutProto::insertRow(int row, QWidget *label, QWidget *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertRow(row, label, field); } void QFormLayoutProto::insertRow(int row, QWidget *label, QLayout *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertRow(row, label, field); } void QFormLayoutProto::insertRow(int row, const QString &labelText, QWidget *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertRow(row, labelText, field); } void QFormLayoutProto::insertRow(int row, const QString &labelText, QLayout *field) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertRow(row, labelText, field); } void QFormLayoutProto::insertRow(int row, QWidget *widget) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertRow(row, widget); } void QFormLayoutProto::insertRow(int row, QLayout *layout) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->insertRow(row, layout); } void QFormLayoutProto::invalidate() { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->invalidate(); } bool QFormLayoutProto::isEmpty() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } bool QFormLayoutProto::isEnabled() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->isEnabled(); return false; } QLayoutItem *QFormLayoutProto::itemAt(int index, QFormLayout::ItemRole role) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->itemAt(index, role); return 0; } QLayoutItem *QFormLayoutProto::itemAt(int index) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->itemAt(index); return 0; } Qt::Alignment QFormLayoutProto::labelAlignment() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->labelAlignment(); return 0; } QWidget *QFormLayoutProto::labelForField(QWidget *field) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->labelForField(field); return 0; } QWidget *QFormLayoutProto::labelForField(QLayout *field) const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->labelForField(field); return 0; } QSize QFormLayoutProto::maximumSize() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->maximumSize(); return QSize(); } QWidget *QFormLayoutProto::menuBar() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->menuBar(); return 0; } QSize QFormLayoutProto::minimumSize() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumSize(); return QSize(); } QWidget *QFormLayoutProto::parentWidget() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->parentWidget(); return 0; } void QFormLayoutProto::removeItem(QLayoutItem *item) { QFormLayout *formitem = qscriptvalue_cast(thisObject()); if (formitem) formitem->removeItem(item); } void QFormLayoutProto::removeWidget(QWidget *widget) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->removeWidget(widget); } int QFormLayoutProto::rowCount() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->rowCount(); return 0; } QFormLayout::RowWrapPolicy QFormLayoutProto::rowWrapPolicy() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->rowWrapPolicy(); return QFormLayout::DontWrapRows; } bool QFormLayoutProto::setAlignment(QWidget *w, Qt::Alignment alignment) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setAlignment(w, alignment); return false; } void QFormLayoutProto::setAlignment(Qt::Alignment alignment) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setAlignment(alignment); } bool QFormLayoutProto::setAlignment(QLayout *l, Qt::Alignment alignment) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setAlignment(l, alignment); return false; } void QFormLayoutProto::setContentsMargins(int left, int top, int right, int bottom) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setContentsMargins(left, top, right, bottom); } void QFormLayoutProto::setEnabled(bool enable) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setEnabled(enable); } void QFormLayoutProto::setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setFieldGrowthPolicy(policy); } void QFormLayoutProto::setFormAlignment(Qt::Alignment alignment) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setFormAlignment(alignment); } void QFormLayoutProto::setHorizontalSpacing(int spacing) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setHorizontalSpacing(spacing); } void QFormLayoutProto::setItem(int row, QFormLayout::ItemRole role, QLayoutItem *item) { QFormLayout *i = qscriptvalue_cast(thisObject()); if (i) i->setItem(row, role, item); } void QFormLayoutProto::setLabelAlignment(Qt::Alignment alignment) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setLabelAlignment(alignment); } void QFormLayoutProto::setLayout(int row, QFormLayout::ItemRole role, QLayout *layout) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setLayout(row, role, layout); } void QFormLayoutProto::setMenuBar(QWidget *widget) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setMenuBar(widget); } void QFormLayoutProto::setRowWrapPolicy(QFormLayout::RowWrapPolicy policy) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setRowWrapPolicy(policy); } void QFormLayoutProto::setSpacing(int spacing) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setSpacing(spacing); } void QFormLayoutProto::setVerticalSpacing(int spacing) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setVerticalSpacing(spacing); } void QFormLayoutProto::setWidget(int row, QFormLayout::ItemRole role, QWidget *widget) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setWidget(row, role, widget); } int QFormLayoutProto::spacing() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->spacing(); return 0; } QLayoutItem *QFormLayoutProto::takeAt(int index) { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->takeAt(index); return 0; } void QFormLayoutProto::update() { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) item->update(); } int QFormLayoutProto::verticalSpacing() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->verticalSpacing(); return 0; } QString QFormLayoutProto::toString() const { QFormLayout *item = qscriptvalue_cast(thisObject()); if (item) return tr("[ QFormLayout %1 ]").arg(item->objectName()); return QString(); } qt-client-4.1.0/scriptapi/qformlayoutproto.h000066400000000000000000000121201217451700100212230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QFORMLAYOUTPROTO_H__ #define __QFORMLAYOUTPROTO_H__ #include #include #include class QString; class QWidget; Q_DECLARE_METATYPE(QFormLayout*) Q_DECLARE_METATYPE(enum QFormLayout::FieldGrowthPolicy) Q_DECLARE_METATYPE(enum QFormLayout::ItemRole) Q_DECLARE_METATYPE(enum QFormLayout::RowWrapPolicy) void setupQFormLayoutProto(QScriptEngine *engine); QScriptValue constructQFormLayout(QScriptContext *context, QScriptEngine *engine); class QFormLayoutProto : public QObject, public QScriptable { Q_OBJECT public: QFormLayoutProto(QObject *parent); Q_INVOKABLE bool activate(); Q_INVOKABLE void addItem(QLayoutItem *item); Q_INVOKABLE void addRow(QWidget *label, QWidget *field); Q_INVOKABLE void addRow(QWidget *label, QLayout *field); Q_INVOKABLE void addRow(const QString &labelText, QWidget *field); Q_INVOKABLE void addRow(const QString &labelText, QLayout *field); Q_INVOKABLE void addRow(QWidget *widget); Q_INVOKABLE void addRow(QLayout *layout); Q_INVOKABLE void addWidget(QWidget *widget); Q_INVOKABLE QRect contentsRect() const; Q_INVOKABLE int count() const; Q_INVOKABLE Qt::Orientations expandingDirections() const; Q_INVOKABLE QFormLayout::FieldGrowthPolicy fieldGrowthPolicy() const; Q_INVOKABLE Qt::Alignment formAlignment() const; Q_INVOKABLE void getContentsMargins(int *left, int *top, int *right, int *bottom) const; Q_INVOKABLE void getItemPosition(int index, int *rowPtr, QFormLayout::ItemRole *rolePtr) const; Q_INVOKABLE void getLayoutPosition(QLayout *layout, int *rowPtr, QFormLayout::ItemRole *rolePtr) const; Q_INVOKABLE void getWidgetPosition(QWidget *widget, int *rowPtr, QFormLayout::ItemRole *rolePtr) const; Q_INVOKABLE int horizontalSpacing() const; Q_INVOKABLE int indexOf(QWidget *widget) const; Q_INVOKABLE void insertRow(int row, QWidget *label, QWidget *field); Q_INVOKABLE void insertRow(int row, QWidget *label, QLayout *field); Q_INVOKABLE void insertRow(int row, const QString &labelText, QWidget *field); Q_INVOKABLE void insertRow(int row, const QString &labelText, QLayout *field); Q_INVOKABLE void insertRow(int row, QWidget *widget); Q_INVOKABLE void insertRow(int row, QLayout *layout); Q_INVOKABLE void invalidate(); Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE bool isEnabled() const; Q_INVOKABLE QLayoutItem *itemAt(int index, QFormLayout::ItemRole role) const; Q_INVOKABLE QLayoutItem *itemAt(int index) const; Q_INVOKABLE Qt::Alignment labelAlignment() const; Q_INVOKABLE QWidget *labelForField(QWidget *field) const; Q_INVOKABLE QWidget *labelForField(QLayout *field) const; Q_INVOKABLE QSize maximumSize() const; Q_INVOKABLE QWidget *menuBar() const; Q_INVOKABLE QSize minimumSize() const; Q_INVOKABLE QWidget *parentWidget() const; Q_INVOKABLE void removeItem(QLayoutItem *item); Q_INVOKABLE void removeWidget(QWidget *widget); Q_INVOKABLE int rowCount() const; Q_INVOKABLE QFormLayout::RowWrapPolicy rowWrapPolicy() const; Q_INVOKABLE bool setAlignment(QWidget *w, Qt::Alignment alignment); Q_INVOKABLE void setAlignment(Qt::Alignment alignment); Q_INVOKABLE bool setAlignment(QLayout *l, Qt::Alignment alignment); Q_INVOKABLE void setContentsMargins(int left, int top, int right, int bottom); Q_INVOKABLE void setEnabled(bool enable); Q_INVOKABLE void setFieldGrowthPolicy(QFormLayout::FieldGrowthPolicy policy); Q_INVOKABLE void setFormAlignment(Qt::Alignment alignment); Q_INVOKABLE void setHorizontalSpacing(int spacing); Q_INVOKABLE void setItem(int row, QFormLayout::ItemRole role, QLayoutItem *item); Q_INVOKABLE void setLabelAlignment(Qt::Alignment alignment); Q_INVOKABLE void setLayout(int row, QFormLayout::ItemRole role, QLayout *layout); Q_INVOKABLE void setMenuBar(QWidget *widget); Q_INVOKABLE void setRowWrapPolicy(QFormLayout::RowWrapPolicy policy); Q_INVOKABLE void setSpacing(int spacing); Q_INVOKABLE void setVerticalSpacing(int spacing); Q_INVOKABLE void setWidget(int row, QFormLayout::ItemRole role, QWidget *widget); Q_INVOKABLE int spacing() const; Q_INVOKABLE QLayoutItem *takeAt(int index); Q_INVOKABLE void update(); Q_INVOKABLE int verticalSpacing() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qgridlayoutproto.cpp000066400000000000000000000267221217451700100215550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qgridlayoutproto.h" #include #include #define DEBUG false QScriptValue QGridLayouttoScriptValue(QScriptEngine *engine, QGridLayout* const &item) { return engine->newQObject(item); } void QGridLayoutfromScriptValue(const QScriptValue &obj, QGridLayout* &item) { item = qobject_cast(obj.toQObject()); } void setupQGridLayoutProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QGridLayouttoScriptValue, QGridLayoutfromScriptValue); QScriptValue proto = engine->newQObject(new QGridLayoutProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQGridLayout, proto); engine->globalObject().setProperty("QGridLayout", constructor); } QScriptValue constructQGridLayout(QScriptContext *context, QScriptEngine *engine) { QGridLayout *obj = 0; if (context->argumentCount() == 0) obj = new QGridLayout(); else if (context->argumentCount() > 0 && qscriptvalue_cast(context->argument(0))) obj = new QGridLayout(qscriptvalue_cast(context->argument(0))); return engine->toScriptValue(obj); } QGridLayoutProto::QGridLayoutProto(QObject *parent) : QObject(parent) { } bool QGridLayoutProto::activate() { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->activate(); return false; } void QGridLayoutProto::addItem(QLayoutItem *item, int row, int column, int rowspan, int columnSpan, Qt::Alignment alignment) { QGridLayout *griditem = qscriptvalue_cast(thisObject()); if (DEBUG) qDebug("QGridLayoutProto(%p, %d, %d, %d, %d, %d) called", item, row, column, rowspan, columnSpan, (int)alignment); if (griditem) griditem->addItem(item, row, column, rowspan, columnSpan, alignment); } void QGridLayoutProto::addLayout(QLayout *layout, int row, int column, Qt::Alignment a) { if (DEBUG) qDebug("QGridLayoutProto::addlayout(%p, %d, %d, %d)", layout, row, column, (int)a); QGridLayout *item = qscriptvalue_cast(thisObject()); if (item && layout) item->addLayout(layout, row, column, a); } void QGridLayoutProto::addLayout(QLayout *layout, int row, int column, int rowSpan, int columnSpan, Qt::Alignment a) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item && layout) item->addLayout(layout, row, column, rowSpan, columnSpan, a); } void QGridLayoutProto::addWidget(QWidget *widget, int row, int column, Qt::Alignment a) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addWidget(widget, row, column, a); } void QGridLayoutProto::addWidget(QWidget *widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment a) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->addWidget(widget, fromRow, fromColumn, rowSpan, columnSpan, a); } QRect QGridLayoutProto::cellRect(int row, int column) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->cellRect(row, column); return QRect(); } int QGridLayoutProto::columnCount() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->columnCount(); return 0; } int QGridLayoutProto::columnMinimumWidth(int column) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->columnMinimumWidth(column); return 0; } int QGridLayoutProto::columnStretch(int column) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->columnStretch(column); return 0; } QRect QGridLayoutProto::contentsRect() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->contentsRect(); return QRect(); } int QGridLayoutProto::count() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } Qt::Orientations QGridLayoutProto::expandingDirections() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->expandingDirections(); return Qt::Orientations(); } void QGridLayoutProto::getContentsMargins(int *left, int *top, int *right, int *bottom) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->getContentsMargins(left, top, right, bottom); } void QGridLayoutProto::getItemPosition(int index, int *row, int *column, int *rowSpan, int *columnSpan) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->getItemPosition(index, row, column, rowSpan, columnSpan); } int QGridLayoutProto::horizontalSpacing() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->horizontalSpacing(); return 0; } int QGridLayoutProto::indexOf(QWidget *widget) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(widget); return 0; } void QGridLayoutProto::invalidate() { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->invalidate(); } bool QGridLayoutProto::isEnabled() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->isEnabled(); return false; } QLayoutItem *QGridLayoutProto::itemAt(int index) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->itemAt(index); return 0; } QLayoutItem *QGridLayoutProto::itemAtPosition(int row, int column) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->itemAtPosition(row, column); return 0; } QSize QGridLayoutProto::maximumSize() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->maximumSize(); return QSize(); } QWidget *QGridLayoutProto::menuBar() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->menuBar(); return 0; } QSize QGridLayoutProto::minimumSize() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumSize(); return QSize(); } Qt::Corner QGridLayoutProto::originCorner() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->originCorner(); return (Qt::Corner)0; } QWidget *QGridLayoutProto::parentWidget() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->parentWidget(); return 0; } void QGridLayoutProto::removeItem(QLayoutItem *item) { QGridLayout *griditem = qscriptvalue_cast(thisObject()); if (griditem) griditem->removeItem(item); } void QGridLayoutProto::removeWidget(QWidget *widget) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->removeWidget(widget); } int QGridLayoutProto::rowCount() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->rowCount(); return 0; } int QGridLayoutProto::rowMinimumHeight(int row) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->rowMinimumHeight(row); return 0; } int QGridLayoutProto::rowStretch(int row) const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->rowStretch(row); return 0; } bool QGridLayoutProto::setAlignment(QWidget *w, Qt::Alignment alignment) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setAlignment(w, alignment); return false; } void QGridLayoutProto::setAlignment(Qt::Alignment alignment) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setAlignment(alignment); } bool QGridLayoutProto::setAlignment(QLayout *l, Qt::Alignment alignment) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->setAlignment(l, alignment); return false; } void QGridLayoutProto::setColumnMinimumWidth(int column, int minSize) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setColumnMinimumWidth(column, minSize); } void QGridLayoutProto::setColumnStretch(int column, int stretch) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setColumnStretch(column, stretch); } void QGridLayoutProto::setContentsMargins(int left, int top, int right, int bottom) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setContentsMargins(left, top, right, bottom); } void QGridLayoutProto::setEnabled(bool enable) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setEnabled(enable); } void QGridLayoutProto::setHorizontalSpacing(int spacing) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setHorizontalSpacing(spacing); } void QGridLayoutProto::setMenuBar(QWidget *widget) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setMenuBar(widget); } void QGridLayoutProto::setOriginCorner(Qt::Corner corner) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setOriginCorner(corner); } void QGridLayoutProto::setRowMinimumHeight(int row, int minSize) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setRowMinimumHeight(row, minSize); } void QGridLayoutProto::setRowStretch(int row, int stretch) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setRowStretch(row, stretch); } void QGridLayoutProto::setSpacing(int spacing) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setSpacing(spacing); } void QGridLayoutProto::setVerticalSpacing(int spacing) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->setVerticalSpacing(spacing); } int QGridLayoutProto::spacing() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->spacing(); return 0; } QLayoutItem *QGridLayoutProto::takeAt(int index) { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->takeAt(index); return 0; } void QGridLayoutProto::update() { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) item->update(); } int QGridLayoutProto::verticalSpacing() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->verticalSpacing(); return 0; } /* QString QGridLayoutProto::toString() const { QGridLayout *item = qscriptvalue_cast(thisObject()); if (item) return item->toString(); return //QString(); } */ qt-client-4.1.0/scriptapi/qgridlayoutproto.h000066400000000000000000000077321217451700100212220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QGRIDLAYOUTPROTO_H__ #define __QGRIDLAYOUTPROTO_H__ #include #include #include class QString; class QWidget; Q_DECLARE_METATYPE(QGridLayout*) void setupQGridLayoutProto(QScriptEngine *engine); QScriptValue constructQGridLayout(QScriptContext *context, QScriptEngine *engine); class QGridLayoutProto : public QObject, public QScriptable { Q_OBJECT public: QGridLayoutProto(QObject *parent); Q_INVOKABLE bool activate(); Q_INVOKABLE void addItem(QLayoutItem *item, int row, int column, int rowspan = 1, int columnSpan = 1, Qt::Alignment alignment = 0); Q_INVOKABLE void addLayout(QLayout *layout, int row, int column, Qt::Alignment = 0); Q_INVOKABLE void addLayout(QLayout *layout, int row, int column, int rowSpan, int columnSpan, Qt::Alignment = 0); Q_INVOKABLE void addWidget(QWidget *widget, int row, int column, Qt::Alignment = 0); Q_INVOKABLE void addWidget(QWidget *widget, int fromRow, int fromColumn, int rowSpan, int columnSpan, Qt::Alignment = 0); Q_INVOKABLE QRect cellRect(int row, int column) const; Q_INVOKABLE int columnCount() const; Q_INVOKABLE int columnMinimumWidth(int column) const; Q_INVOKABLE int columnStretch(int column) const; Q_INVOKABLE QRect contentsRect() const; Q_INVOKABLE int count() const; Q_INVOKABLE Qt::Orientations expandingDirections() const; Q_INVOKABLE void getContentsMargins(int *left, int *top, int *right, int *bottom) const; Q_INVOKABLE void getItemPosition(int index, int *row, int *coliumn, int *rowSpan, int *columnSpan); Q_INVOKABLE int horizontalSpacing() const; Q_INVOKABLE int indexOf(QWidget *widget) const; Q_INVOKABLE void invalidate(); Q_INVOKABLE bool isEnabled() const; Q_INVOKABLE QLayoutItem *itemAt(int index) const; Q_INVOKABLE QLayoutItem *itemAtPosition(int row, int column) const; Q_INVOKABLE QSize maximumSize() const; Q_INVOKABLE QWidget *menuBar() const; Q_INVOKABLE QSize minimumSize() const; Q_INVOKABLE Qt::Corner originCorner() const; Q_INVOKABLE QWidget *parentWidget() const; Q_INVOKABLE void removeItem(QLayoutItem *item); Q_INVOKABLE void removeWidget(QWidget *widget); Q_INVOKABLE int rowCount() const; Q_INVOKABLE int rowMinimumHeight(int row) const; Q_INVOKABLE int rowStretch(int row) const; Q_INVOKABLE bool setAlignment(QWidget *w, Qt::Alignment alignment); Q_INVOKABLE void setAlignment(Qt::Alignment alignment); Q_INVOKABLE bool setAlignment(QLayout *l, Qt::Alignment alignment); Q_INVOKABLE void setColumnMinimumWidth(int column, int minSize); Q_INVOKABLE void setColumnStretch(int column, int stretch); Q_INVOKABLE void setContentsMargins(int left, int top, int right, int bottom); Q_INVOKABLE void setEnabled(bool enable); Q_INVOKABLE void setHorizontalSpacing(int spacing); Q_INVOKABLE void setMenuBar(QWidget *widget); Q_INVOKABLE void setOriginCorner(Qt::Corner corner); Q_INVOKABLE void setRowMinimumHeight(int row, int minSize); Q_INVOKABLE void setRowStretch(int row, int stretch); Q_INVOKABLE void setSpacing(int spacing); Q_INVOKABLE void setVerticalSpacing(int spacing); Q_INVOKABLE int spacing() const; Q_INVOKABLE QLayoutItem *takeAt(int index); Q_INVOKABLE void update(); Q_INVOKABLE int verticalSpacing() const; //Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qiconproto.cpp000066400000000000000000000040011217451700100203040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qiconproto.h" #include "xsqlquery.h" #include #include #include void setupQIconProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QIconProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQIcon, proto); engine->globalObject().setProperty("QIcon", constructor); } QScriptValue constructQIcon(QScriptContext * context, QScriptEngine *engine) { QIcon *obj = 0; if(context->argumentCount() == 1) obj = new QIcon(context->argument(0).toString()); else obj = new QIcon(); return engine->toScriptValue(obj); } QIconProto::QIconProto(QObject *parent) : QObject(parent) { } bool QIconProto::isNull() const { QIcon *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(); return true; } /*! Adds image \a name from the xTuple databes to the icon. */ void QIconProto::addDbImage(const QString& name) { QIcon *item = qscriptvalue_cast(thisObject()); if (item) { QImage img; XSqlQuery image; image.prepare( "SELECT image_data " "FROM image " "WHERE (image_name=:name);" ); image.bindValue(":name", name); image.exec(); if (image.first()) { img.loadFromData(QUUDecode(image.value("image_data").toString())); item->addPixmap(QPixmap::fromImage(img)); } } } qt-client-4.1.0/scriptapi/qiconproto.h000066400000000000000000000017521217451700100177630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QICONPROTO_H__ #define __QICONPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QIcon*) Q_DECLARE_METATYPE(QIcon) void setupQIconProto(QScriptEngine *engine); QScriptValue constructQIcon(QScriptContext *context, QScriptEngine *engine); class QIconProto : public QObject, public QScriptable { Q_OBJECT public: QIconProto(QObject *parent); Q_INVOKABLE bool isNull() const; Q_INVOKABLE void addDbImage(const QString&); // TODO: add in all the other functions this class supports }; #endif qt-client-4.1.0/scriptapi/qintvalidatorproto.cpp000066400000000000000000000043611217451700100220650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qintvalidatorproto.h" #define DEBUG false QScriptValue QIntValidatorToScriptValue(QScriptEngine *engine, QIntValidator* const &in) { return engine->newQObject(in); } void QIntValidatorFromScriptValue(const QScriptValue &object, QIntValidator* &out) { out = qobject_cast(object.toQObject()); } void setupQIntValidatorProto(QScriptEngine *engine) { //QScriptValue proto = engine->newQObject(new QIntValidatorProto(engine)); //engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); qScriptRegisterMetaType(engine, QIntValidatorToScriptValue, QIntValidatorFromScriptValue); //QScriptValue constructor = engine->newFunction(constructQIntValidator, // proto); //engine->globalObject().setProperty("QIntValidator", constructor); } QScriptValue constructQIntValidator(QScriptContext *context, QScriptEngine *engine) { QIntValidator *obj = 0; if (DEBUG) { qDebug("constructQIntValidator() entered"); for (int i = 0; i < context->argumentCount(); i++) qDebug("context->argument(%d) = %s", i, qPrintable(context->argument(i).toString())); } if (context->argumentCount() >= 3) obj = new QIntValidator(context->argument(0).toNumber(), context->argument(1).toNumber(), context->argument(2).toQObject()); else if (context->argumentCount() == 1) obj = new QIntValidator(context->argument(0).toQObject()); else context->throwError(QScriptContext::UnknownError, "QIntValidator() constructor is not yet supported"); return engine->toScriptValue(obj); } QIntValidatorProto::QIntValidatorProto(QObject *parent) : QObject(parent) { } qt-client-4.1.0/scriptapi/qintvalidatorproto.h000066400000000000000000000030031217451700100215220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QINTVALIDATORPROTO_H__ #define __QINTVALIDATORPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QIntValidator*) //Q_DECLARE_METATYPE(QIntValidator) void setupQIntValidatorProto(QScriptEngine *engine); QScriptValue constructQIntValidator(QScriptContext *context, QScriptEngine *engine); class QIntValidatorProto : public QObject, public QScriptable { Q_OBJECT public: QIntValidatorProto(QObject *parent); /* * Leaving these out for now as we just need the ability to * pass this class without changing anything Q_INVOKABLE int bottom () const; Q_INVOKABLE int decimals () const; Q_INVOKABLE Notation notation () const; Q_INVOKABLE void setBottom ( double ); Q_INVOKABLE void setDecimals ( int ); Q_INVOKABLE void setNotation ( Notation ); Q_INVOKABLE void setRange ( double minimum, double maximum, int decimals = 0 ); Q_INVOKABLE void setTop ( double ); Q_INVOKABLE double top () const; Q_INVOKABLE virtual QValidator::State validate ( QString & input, int & pos ) const; */ }; #endif qt-client-4.1.0/scriptapi/qiodeviceproto.cpp000066400000000000000000000202231217451700100211470ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #include "qiodeviceproto.h" /** \ingroup scriptapi \class QIODeviceProto \brief This class exposes the QIODevice class to Qt Scripting. The QIODeviceProto class exposes as much of the API to the QIODevice class as possible. */ QScriptValue QIODevicetoScriptValue(QScriptEngine *engine, QIODevice* const &item) { return engine->newQObject(item); } void QIODevicefromScriptValue(const QScriptValue &obj, QIODevice* &item) { item = qobject_cast(obj.toQObject()); } void setupQIODeviceProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QIODevicetoScriptValue, QIODevicefromScriptValue); QScriptValue iodev = engine->newObject(); engine->globalObject().setProperty("QIODevice", iodev, QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QIODevice::OpenModeFlag iodev.setProperty("NotOpen", QScriptValue(engine, QIODevice::NotOpen), QScriptValue::ReadOnly | QScriptValue::Undeletable); iodev.setProperty("ReadOnly", QScriptValue(engine, QIODevice::ReadOnly), QScriptValue::ReadOnly | QScriptValue::Undeletable); iodev.setProperty("WriteOnly", QScriptValue(engine, QIODevice::WriteOnly), QScriptValue::ReadOnly | QScriptValue::Undeletable); iodev.setProperty("ReadWrite", QScriptValue(engine, QIODevice::ReadWrite), QScriptValue::ReadOnly | QScriptValue::Undeletable); iodev.setProperty("Append", QScriptValue(engine, QIODevice::Append), QScriptValue::ReadOnly | QScriptValue::Undeletable); iodev.setProperty("Truncate", QScriptValue(engine, QIODevice::Truncate), QScriptValue::ReadOnly | QScriptValue::Undeletable); iodev.setProperty("Text", QScriptValue(engine, QIODevice::Text), QScriptValue::ReadOnly | QScriptValue::Undeletable); iodev.setProperty("Unbuffered", QScriptValue(engine, QIODevice::Unbuffered), QScriptValue::ReadOnly | QScriptValue::Undeletable); } Q_DECLARE_METATYPE(enum QIODevice::OpenModeFlag); QIODeviceProto::QIODeviceProto(QObject *parent) : QObject(parent) { } bool QIODeviceProto::atEnd() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->atEnd(); return false; } qint64 QIODeviceProto::bytesAvailable() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesAvailable(); return 0; } qint64 QIODeviceProto::bytesToWrite() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesToWrite(); return 0; } bool QIODeviceProto::canReadLine() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->canReadLine(); return false; } void QIODeviceProto::close() { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) item->close(); } QString QIODeviceProto::errorString() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->errorString(); return QString(); } bool QIODeviceProto::getChar(char *c) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->getChar(c); return false; } bool QIODeviceProto::isOpen() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->isOpen(); return false; } bool QIODeviceProto::isReadable() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->isReadable(); return false; } bool QIODeviceProto::isSequential() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->isSequential(); return false; } bool QIODeviceProto::isTextModeEnabled() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->isTextModeEnabled(); return false; } bool QIODeviceProto::isWritable() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->isWritable(); return false; } bool QIODeviceProto::open(QIODevice::OpenMode mode) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->open(mode); return false; } QIODevice::OpenMode QIODeviceProto::openMode() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->openMode(); return QIODevice::OpenMode(); } qint64 QIODeviceProto::peek(char *data, qint64 maxSize) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(data, maxSize); return 0; } QByteArray QIODeviceProto::peek(qint64 maxSize) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(maxSize); return QByteArray(); } qint64 QIODeviceProto::pos() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->pos(); return 0; } bool QIODeviceProto::putChar(char c) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->putChar(c); return false; } qint64 QIODeviceProto::read(char *data, qint64 maxSize) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->read(data, maxSize); return 0; } QByteArray QIODeviceProto::read(qint64 maxSize) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->read(maxSize); return QByteArray(); } QByteArray QIODeviceProto::readAll() { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->readAll(); return QByteArray(); } qint64 QIODeviceProto::readLine(char *data, qint64 maxSize) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(data, maxSize); return 0; } QByteArray QIODeviceProto::readLine(qint64 maxSize) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(maxSize); return QByteArray(); } bool QIODeviceProto::reset() { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->reset(); return false; } bool QIODeviceProto::seek(qint64 pos) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->seek(pos); return false; } void QIODeviceProto::setTextModeEnabled(bool enabled) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) item->setTextModeEnabled(enabled); } qint64 QIODeviceProto::size() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } void QIODeviceProto::ungetChar(char c) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) item->ungetChar(c); } bool QIODeviceProto::waitForBytesWritten(int msecs) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForBytesWritten(msecs); return false; } bool QIODeviceProto::waitForReadyRead(int msecs) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForReadyRead(msecs); return false; } qint64 QIODeviceProto::write(const QByteArray &byteArray) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->write(byteArray); return 0; } qint64 QIODeviceProto::write(const char *data) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->write(data); return 0; } qint64 QIODeviceProto::write(const char *data, qint64 maxSize) { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return item->write(data, maxSize); return 0; } /** QString QIODeviceProto::toString() const { QIODevice *item = qscriptvalue_cast(thisObject()); if (item) return QString("QIODevice()"); return QString("QIODevice(unknown)"); } */ qt-client-4.1.0/scriptapi/qiodeviceproto.h000066400000000000000000000060061217451700100206170ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #ifndef __QIODEVICEPROTO_H__ #define __QIODEVICEPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QIODevice*) void setupQIODeviceProto(QScriptEngine *engine); QScriptValue constructQIODevice(QScriptContext *context, QScriptEngine *engine); class QIODeviceProto : public QObject, public QScriptable { Q_OBJECT public: QIODeviceProto(QObject *parent); Q_INVOKABLE bool atEnd() const; Q_INVOKABLE qint64 bytesAvailable() const; Q_INVOKABLE qint64 bytesToWrite() const; Q_INVOKABLE bool canReadLine() const; Q_INVOKABLE void close(); Q_INVOKABLE QString errorString() const; Q_INVOKABLE bool getChar(char *c); Q_INVOKABLE bool isOpen() const; Q_INVOKABLE bool isReadable() const; Q_INVOKABLE bool isSequential() const; Q_INVOKABLE bool isTextModeEnabled() const; Q_INVOKABLE bool isWritable() const; Q_INVOKABLE bool open(QIODevice::OpenMode mode); Q_INVOKABLE QIODevice::OpenMode openMode() const; Q_INVOKABLE qint64 peek(char *data, qint64 maxSize); Q_INVOKABLE QByteArray peek(qint64 maxSize); Q_INVOKABLE qint64 pos() const; Q_INVOKABLE bool putChar(char c); Q_INVOKABLE qint64 read(char *data, qint64 maxSize); Q_INVOKABLE QByteArray read(qint64 maxSize); Q_INVOKABLE QByteArray readAll(); Q_INVOKABLE qint64 readLine(char *data, qint64 maxSize); Q_INVOKABLE QByteArray readLine(qint64 maxSize = 0); Q_INVOKABLE bool reset(); Q_INVOKABLE bool seek(qint64 pos); Q_INVOKABLE void setTextModeEnabled(bool enabled); Q_INVOKABLE qint64 size() const; Q_INVOKABLE void ungetChar(char c); Q_INVOKABLE bool waitForBytesWritten(int msecs); Q_INVOKABLE bool waitForReadyRead(int msecs); Q_INVOKABLE qint64 write(const QByteArray &byteArray); Q_INVOKABLE qint64 write(const char *data); Q_INVOKABLE qint64 write(const char *data, qint64 maxSize); public slots: signals: void aboutToClose(); void bytesWritten(qint64 bytes); void readChannelFinished(); void readyRead(); }; #endif qt-client-4.1.0/scriptapi/qitemdelegateproto.cpp000066400000000000000000000036601217451700100220170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qitemdelegateproto.h" #define DEBUG false QScriptValue QItemDelegateToScriptValue(QScriptEngine *engine, QItemDelegate* const &in) { return engine->newQObject(in); } void QItemDelegateFromScriptValue(const QScriptValue &object, QItemDelegate* &out) { out = qobject_cast(object.toQObject()); } void setupQItemDelegateProto(QScriptEngine *engine) { //QScriptValue proto = engine->newQObject(new QItemDelegateProto(engine)); //engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); qScriptRegisterMetaType(engine, QItemDelegateToScriptValue, QItemDelegateFromScriptValue); //QScriptValue constructor = engine->newFunction(constructQItemDelegate, // proto); //engine->globalObject().setProperty("QItemDelegate", constructor); } QScriptValue constructQItemDelegate(QScriptContext *context, QScriptEngine *engine) { QItemDelegate *obj = 0; if (DEBUG) { qDebug("constructQItemDelegate() entered"); for (int i = 0; i < context->argumentCount(); i++) qDebug("context->argument(%d) = %s", i, qPrintable(context->argument(i).toString())); } context->throwError(QScriptContext::UnknownError, "QItemDelegate() constructor is not yet supported"); return engine->toScriptValue(obj); } QItemDelegateProto::QItemDelegateProto(QObject *parent) : QObject(parent) { } qt-client-4.1.0/scriptapi/qitemdelegateproto.h000066400000000000000000000016351217451700100214640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QITEMDELEGATEPROTO_H__ #define __QITEMDELEGATEPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QItemDelegate*) //Q_DECLARE_METATYPE(QItemDelegate) void setupQItemDelegateProto(QScriptEngine *engine); QScriptValue constructQItemDelegate(QScriptContext *context, QScriptEngine *engine); class QItemDelegateProto : public QObject, public QScriptable { Q_OBJECT public: QItemDelegateProto(QObject *parent); }; #endif qt-client-4.1.0/scriptapi/qlayoutitemproto.cpp000066400000000000000000000107561217451700100215660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qlayoutitemproto.h" #include "qspaceritemproto.h" #define DEBUG false QScriptValue QLayoutItemtoScriptValue(QScriptEngine *engine, QLayoutItem* const &item) { if (DEBUG) qDebug("QLayoutItemtoScriptValue(%p, %p) called", engine, item); QScriptValue result = engine->newObject(); result.setData(engine->newVariant(qVariantFromValue(item))); return result; } // TODO: why must we check for all possible value<> castings? this is fragile void QLayoutItemfromScriptValue(const QScriptValue &obj, QLayoutItem* &item) { if (DEBUG) qDebug("QLayoutItemfromScriptValue(obj, %p) called", item); item = obj.data().toVariant().value(); if (! item) item = obj.data().toVariant().value(); if (DEBUG) qDebug("QLayoutItemfromScriptValue set %p", item); } void setupQLayoutItemProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QLayoutItemtoScriptValue, QLayoutItemfromScriptValue); QScriptValue proto = engine->newQObject(new QLayoutItemProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); if (DEBUG) qDebug("setupQLayoutItemProto() returning"); } QLayoutItemProto::QLayoutItemProto(QObject *parent) : QObject(parent) { } Qt::Alignment QLayoutItemProto::alignment() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->alignment(); return (Qt::Alignment)0; } Qt::Orientations QLayoutItemProto::expandingDirections() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->expandingDirections(); return (Qt::Orientations)0; } QRect QLayoutItemProto::geometry() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->geometry(); return QRect(); } bool QLayoutItemProto::hasHeightForWidth() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->hasHeightForWidth(); return false; } int QLayoutItemProto::heightForWidth(int w) const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->heightForWidth(w); return 0; } void QLayoutItemProto::invalidate() { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) item->invalidate(); } bool QLayoutItemProto::isEmpty() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } QLayout *QLayoutItemProto::layout() { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->layout(); return 0; } QSize QLayoutItemProto::maximumSize() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->maximumSize(); return QSize(); } int QLayoutItemProto::minimumHeightForWidth(int w) const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumHeightForWidth(w); return 0; } QSize QLayoutItemProto::minimumSize() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumSize(); return QSize(); } void QLayoutItemProto::setAlignment(Qt::Alignment alignment) { if (DEBUG) qDebug("QLayoutItemProto::setAlignment(%d)", (int)alignment); QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) item->setAlignment(alignment); } void QLayoutItemProto::setGeometry(const QRect &r) { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) item->setGeometry(r); } QSize QLayoutItemProto::sizeHint() const { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->sizeHint(); return QSize(); } QSpacerItem *QLayoutItemProto::spacerItem() { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->spacerItem(); return 0; } QWidget *QLayoutItemProto::widget() { QLayoutItem *item = qscriptvalue_cast(thisObject()); if (item) return item->widget(); return 0; } qt-client-4.1.0/scriptapi/qlayoutitemproto.h000066400000000000000000000036561217451700100212340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QLAYOUTITEMPROTO_H__ #define __QLAYOUTITEMPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QLayoutItem*) void setupQLayoutItemProto(QScriptEngine *engine); QScriptValue constructQLayoutItem(QScriptContext *context, QScriptEngine *engine); class QLayoutItemProto : public QObject, public QScriptable { Q_OBJECT public: QLayoutItemProto(QObject *parent); Q_INVOKABLE Qt::Alignment alignment() const; QSizePolicy::ControlTypes controlTypes () const; Q_INVOKABLE Qt::Orientations expandingDirections() const; Q_INVOKABLE QRect geometry() const; Q_INVOKABLE bool hasHeightForWidth() const; Q_INVOKABLE int heightForWidth(int w) const; Q_INVOKABLE void invalidate(); Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE QLayout *layout(); Q_INVOKABLE QSize maximumSize() const; Q_INVOKABLE int minimumHeightForWidth(int w) const; Q_INVOKABLE QSize minimumSize() const; Q_INVOKABLE void setAlignment(Qt::Alignment alignment); Q_INVOKABLE void setGeometry(const QRect &r); Q_INVOKABLE QSize sizeHint() const; Q_INVOKABLE QSpacerItem *spacerItem(); Q_INVOKABLE QWidget *widget(); }; #endif qt-client-4.1.0/scriptapi/qlayoutproto.cpp000066400000000000000000000034771217451700100207110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qlayoutproto.h" #include #include #include QScriptValue QLayouttoScriptValue(QScriptEngine *engine, QLayout* const &item) { return engine->newQObject(item); } void QLayoutfromScriptValue(const QScriptValue &obj, QLayout* &item) { item = qobject_cast(obj.toQObject()); } void setupQLayoutProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QLayouttoScriptValue, QLayoutfromScriptValue); QScriptValue layout = engine->newObject(); engine->globalObject().setProperty("QLayout", layout); layout.setProperty("SetDefaultConstraint", QScriptValue(engine, QLayout::SetDefaultConstraint), QScriptValue::ReadOnly | QScriptValue::Undeletable); layout.setProperty("SetFixedSize", QScriptValue(engine, QLayout::SetFixedSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); layout.setProperty("SetMinimumSize", QScriptValue(engine, QLayout::SetMinimumSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); layout.setProperty("SetMaximumSize", QScriptValue(engine, QLayout::SetMaximumSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); layout.setProperty("SetMinAndMaxSize", QScriptValue(engine, QLayout::SetMinAndMaxSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); layout.setProperty("SetNoConstraint", QScriptValue(engine, QLayout::SetNoConstraint), QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/qlayoutproto.h000066400000000000000000000012221217451700100203400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QLAYOUTPROTO_H__ #define __QLAYOUTPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QLayout*) void setupQLayoutProto(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/qmainwindowproto.cpp000066400000000000000000000212251217451700100215370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qmainwindowproto.h" #include "qtsetup.h" #include "xtsettings.h" #include "qtabwidgetproto.h" QScriptValue QMainWindowtoScriptValue(QScriptEngine *engine, QMainWindow* const &item) { return engine->newQObject(item); } void QMainWindowfromScriptValue(const QScriptValue &obj, QMainWindow* &item) { item = qobject_cast(obj.toQObject()); } void setupQMainWindowProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QMainWindowtoScriptValue, QMainWindowfromScriptValue); QScriptValue proto = engine->newQObject(new QMainWindowProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQMainWindow, proto); engine->globalObject().setProperty("QMainWindow", constructor); } QScriptValue constructQMainWindow(QScriptContext * context, QScriptEngine *engine) { QMainWindow *obj = 0; if (context->argumentCount() == 2) { obj = new QMainWindow(qobject_cast(context->argument(0).toQObject()), (Qt::WindowFlags)(context->argument(1).toInt32())); } if (context->argumentCount() == 1) obj = new QMainWindow(qobject_cast(context->argument(0).toQObject())); else obj = new QMainWindow(); return engine->toScriptValue(obj); } QMainWindowProto::QMainWindowProto(QObject *parent) : QObject(parent) { } void QMainWindowProto::addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->addDockWidget(area, dockwidget); } void QMainWindowProto::addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget, Qt::Orientation orientation ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->addDockWidget(area, dockwidget, orientation); } void QMainWindowProto::addToolBar ( Qt::ToolBarArea area, QToolBar * toolbar ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->addToolBar(area, toolbar); } void QMainWindowProto::addToolBar ( QToolBar * toolbar ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->addToolBar(toolbar); } QToolBar * QMainWindowProto::addToolBar ( const QString & title ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->addToolBar(title); return 0; } void QMainWindowProto::addToolBarBreak ( Qt::ToolBarArea area ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->addToolBarBreak(area); } QWidget* QMainWindowProto::centralWidget () const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->centralWidget(); return 0; } Qt::DockWidgetArea QMainWindowProto::corner ( Qt::Corner corner ) const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->corner(corner); return Qt::NoDockWidgetArea; } QMenu* QMainWindowProto::createPopupMenu () { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->createPopupMenu(); return 0; } Qt::DockWidgetArea QMainWindowProto::dockWidgetArea ( QDockWidget * dockwidget ) const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->dockWidgetArea (dockwidget); return Qt::NoDockWidgetArea; } void QMainWindowProto::insertToolBar ( QToolBar * before, QToolBar * toolbar ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->insertToolBar(before, toolbar); } void QMainWindowProto::insertToolBarBreak ( QToolBar * before ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->insertToolBarBreak(before); } QMenuBar* QMainWindowProto::menuBar () const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->menuBar(); return 0; } QWidget* QMainWindowProto::menuWidget () const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->menuWidget(); return 0; } void QMainWindowProto::removeDockWidget ( QDockWidget * dockwidget ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->removeDockWidget(dockwidget); } void QMainWindowProto::removeToolBar ( QToolBar * toolbar ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->removeToolBar(toolbar); } void QMainWindowProto::removeToolBarBreak ( QToolBar * before ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->removeToolBarBreak (before); } bool QMainWindowProto::restoreDockWidget ( QDockWidget * dockwidget ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->restoreDockWidget(dockwidget); return false; } bool QMainWindowProto::restoreState ( int version ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) { QByteArray state; state = xtsettingsValue(item->objectName() + "/WindowState", QByteArray()).toByteArray(); return item->restoreState(state, version); } return false; } void QMainWindowProto::saveState ( int version) const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) { QByteArray state = item->saveState(version); xtsettingsSetValue(item->objectName() + "/WindowState", state); } } void QMainWindowProto::setCentralWidget ( QWidget * widget ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->setCentralWidget(widget); } void QMainWindowProto::setCorner ( Qt::Corner corner, Qt::DockWidgetArea area ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->setCorner(corner, area); } void QMainWindowProto::setMenuBar ( QMenuBar * menuBar ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->setMenuBar(menuBar); } void QMainWindowProto::setMenuWidget ( QWidget * menuBar ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->setMenuWidget(menuBar); } void QMainWindowProto::setStatusBar ( QStatusBar * statusbar ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->setStatusBar(statusbar); } void QMainWindowProto::setTabPosition ( Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->setTabPosition (areas, tabPosition); } void QMainWindowProto::splitDockWidget ( QDockWidget * first, QDockWidget * second, Qt::Orientation orientation ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->splitDockWidget (first, second, orientation); } QStatusBar* QMainWindowProto::statusBar () const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->statusBar(); return 0; } QTabWidget::TabPosition QMainWindowProto::tabPosition ( Qt::DockWidgetArea area ) const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->tabPosition (area); return QTabWidget::North; } QList QMainWindowProto::tabifiedDockWidgets ( QDockWidget * dockwidget ) const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->tabifiedDockWidgets (dockwidget); return QList(); } void QMainWindowProto::tabifyDockWidget ( QDockWidget * first, QDockWidget * second ) { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) item->tabifyDockWidget (first, second); } Qt::ToolBarArea QMainWindowProto::toolBarArea ( QToolBar * toolbar ) const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return item->toolBarArea(toolbar); return Qt::NoToolBarArea; } bool QMainWindowProto::toolBarBreak ( QToolBar * toolbar ) const { QMainWindow *item = qscriptvalue_cast(thisObject()); if (item) return toolBarBreak (toolbar); return false; } qt-client-4.1.0/scriptapi/qmainwindowproto.h000066400000000000000000000065511217451700100212110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QMAINWINDOWPROTO_H__ #define __QMAINWINDOWPROTO_H__ #include #include #include #include #include Q_DECLARE_METATYPE(QMainWindow*) void setupQMainWindowProto(QScriptEngine *engine); void DockOptionScriptValue(const QScriptValue &obj, enum QMainWindow::DockOption &p); QScriptValue constructQMainWindow(QScriptContext *context, QScriptEngine *engine); QScriptValue DockOptiontoScriptValue(QScriptEngine *engine, const enum QMainWindow::DockOption &p); class QMainWindowProto : public QObject, public QScriptable { Q_OBJECT public: QMainWindowProto(QObject *parent); Q_INVOKABLE void addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget ); Q_INVOKABLE void addDockWidget ( Qt::DockWidgetArea area, QDockWidget * dockwidget, Qt::Orientation orientation ); Q_INVOKABLE void addToolBar ( Qt::ToolBarArea area, QToolBar * toolbar ); Q_INVOKABLE void addToolBar ( QToolBar * toolbar ); Q_INVOKABLE QToolBar * addToolBar ( const QString & title ); Q_INVOKABLE void addToolBarBreak ( Qt::ToolBarArea area = Qt::TopToolBarArea ); Q_INVOKABLE QWidget * centralWidget () const; Q_INVOKABLE Qt::DockWidgetArea corner ( Qt::Corner corner ) const; Q_INVOKABLE QMenu * createPopupMenu (); Q_INVOKABLE Qt::DockWidgetArea dockWidgetArea ( QDockWidget * dockwidget ) const; Q_INVOKABLE void insertToolBar ( QToolBar * before, QToolBar * toolbar ); Q_INVOKABLE void insertToolBarBreak ( QToolBar * before ); Q_INVOKABLE QMenuBar * menuBar () const; Q_INVOKABLE QWidget * menuWidget () const; Q_INVOKABLE void removeDockWidget ( QDockWidget * dockwidget ); Q_INVOKABLE void removeToolBar ( QToolBar * toolbar ); Q_INVOKABLE void removeToolBarBreak ( QToolBar * before ); Q_INVOKABLE bool restoreDockWidget ( QDockWidget * dockwidget ); Q_INVOKABLE bool restoreState ( int version = 0 ); Q_INVOKABLE void saveState ( int version = 0 ) const; Q_INVOKABLE void setCentralWidget ( QWidget * widget ); Q_INVOKABLE void setCorner ( Qt::Corner corner, Qt::DockWidgetArea area ); Q_INVOKABLE void setMenuBar ( QMenuBar * menuBar ); Q_INVOKABLE void setMenuWidget ( QWidget * menuBar ); Q_INVOKABLE void setStatusBar ( QStatusBar * statusbar ); Q_INVOKABLE void setTabPosition ( Qt::DockWidgetAreas areas, QTabWidget::TabPosition tabPosition ); Q_INVOKABLE void splitDockWidget ( QDockWidget * first, QDockWidget * second, Qt::Orientation orientation ); Q_INVOKABLE QStatusBar * statusBar () const; Q_INVOKABLE QTabWidget::TabPosition tabPosition ( Qt::DockWidgetArea area ) const; Q_INVOKABLE QList tabifiedDockWidgets ( QDockWidget * dockwidget ) const; Q_INVOKABLE void tabifyDockWidget ( QDockWidget * first, QDockWidget * second ); Q_INVOKABLE Qt::ToolBarArea toolBarArea ( QToolBar * toolbar ) const; Q_INVOKABLE bool toolBarBreak ( QToolBar * toolbar ) const; }; #endif qt-client-4.1.0/scriptapi/qmenuproto.cpp000066400000000000000000000211031217451700100203220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qmenuproto.h" #define DEBUG false void setupQMenuProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QMenuProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQMenu, proto); engine->globalObject().setProperty("QMenu", constructor); } QScriptValue constructQMenu(QScriptContext *context, QScriptEngine *engine) { QMenu *obj = 0; if (context->argumentCount() == 1 && context->argument(0).isQObject()) obj = new QMenu(qobject_cast(context->argument(0).toQObject())); else if (context->argumentCount() == 2 && context->argument(1).isQObject()) obj = new QMenu(context->argument(0).toString(), qobject_cast(context->argument(1).toQObject())); else obj = new QMenu(); return engine->toScriptValue(obj); } QMenuProto::QMenuProto(QObject *parent) : QObject(parent) { } QAction *QMenuProto::actionAt(const QPoint &pt) const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->actionAt(pt); return 0; } QRect QMenuProto::actionGeometry(QAction *act) const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->actionGeometry(act); return QRect(); } QAction *QMenuProto::activeAction() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->activeAction(); return 0; } QList QMenuProto::actions() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->actions(); return QList(); } QAction *QMenuProto::addAction(const QString &text) { if (DEBUG) qDebug("addAction(QString = %s)", qPrintable(text)); QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addAction(text); return 0; } QAction *QMenuProto::addAction(const QIcon &icon, const QString &text) { if (DEBUG) qDebug("addAction(QIcon, QString = %s)", qPrintable(text)); QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addAction(icon, text); return 0; } QAction *QMenuProto::addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut) { if (DEBUG) qDebug("addAction(QString = %s, QObject, char* = %s, QKeySequence)", qPrintable(text), member); QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addAction(text, receiver, member, shortcut); return 0; } QAction *QMenuProto::addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut) { if (DEBUG) qDebug("addAction(QIcon, QString = %s, QObject, char* = %s, QKeySequence)", qPrintable(text), member); QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addAction(icon, text, receiver, member, shortcut); return 0; } void QMenuProto::appendAction(QAction *action) { // Can't use addAction here because of ambiguity problem if (DEBUG) qDebug("addAction(QAction)"); QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->addAction(action); } QAction *QMenuProto::addMenu(QMenu *menu) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addMenu(menu); return 0; } QMenu *QMenuProto::addMenu(const QString &title) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addMenu(title); return 0; } QMenu *QMenuProto::addMenu(const QIcon &icon, const QString &title) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addMenu(icon, title); return 0; } QAction *QMenuProto::addSeparator() { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->addSeparator(); return 0; } void QMenuProto::clear() { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } QAction *QMenuProto::defaultAction() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->defaultAction(); return 0; } QAction *QMenuProto::exec() { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->exec(); return 0; } QAction *QMenuProto::exec(const QPoint &p, QAction *action) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->exec(p, action); return 0; } void QMenuProto::hideTearOffMenu() { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->hideTearOffMenu(); } QIcon QMenuProto::icon() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->icon(); return QIcon(); } void QMenuProto::insertAction(QAction *before, QAction *action) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->insertAction(before, action); } void QMenuProto::insertActions(QAction *before, QListactions) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->insertActions(before, actions); } QAction *QMenuProto::insertMenu(QAction *before, QMenu *menu) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->insertMenu(before, menu); return 0; } QAction *QMenuProto::insertSeparator(QAction *before) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->insertSeparator(before); return 0; } bool QMenuProto::isEmpty() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } bool QMenuProto::isTearOffEnabled() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->isTearOffEnabled(); return false; } bool QMenuProto::isTearOffMenuVisible() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->isTearOffMenuVisible(); return false; } QAction *QMenuProto::menuAction() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->menuAction(); return 0; } void QMenuProto::popup(const QPoint &p, QAction *atAction) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->popup(p, atAction); } void QMenuProto::removeAction(QAction *action) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->removeAction(action); } bool QMenuProto::separatorsCollapsible() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->separatorsCollapsible(); return false; } void QMenuProto::setActiveAction(QAction *act) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->setActiveAction(act); } void QMenuProto::setDefaultAction(QAction *act) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->setDefaultAction(act); } void QMenuProto::setIcon(const QIcon &icon) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->setIcon(icon); } void QMenuProto::setSeparatorsCollapsible(bool collapse) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->setSeparatorsCollapsible(collapse); } void QMenuProto::setTearOffEnabled(bool enabled) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->setTearOffEnabled(enabled); } void QMenuProto::setTitle(const QString &title) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) item->setTitle(title); } QString QMenuProto::title() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->title(); return QString(); } /* HMENU QMenuProto::wceMenu(bool create) { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return item->wceMenu(create); return HMENU(); } */ QString QMenuProto::toString() const { QMenu *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QMenu named %1: %2]") .arg(item->objectName()) .arg(item->title()); return QString("QMenu(unknown)"); } qt-client-4.1.0/scriptapi/qmenuproto.h000066400000000000000000000063701217451700100200000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QMENUPROTO_H__ #define __QMENUPROTO_H__ #include #include #include #include "qactionproto.h" Q_DECLARE_METATYPE(QMenu*) void setupQMenuProto(QScriptEngine *engine); QScriptValue constructQMenu(QScriptContext *context, QScriptEngine *engine); class QMenuProto : public QObject, public QScriptable { Q_OBJECT public: QMenuProto(QObject *parent); Q_INVOKABLE QAction *actionAt(const QPoint &pt) const; Q_INVOKABLE QRect actionGeometry(QAction *act) const; Q_INVOKABLE QAction *activeAction() const; Q_INVOKABLE QList actions() const; Q_INVOKABLE QAction *addAction(const QString &text); Q_INVOKABLE QAction *addAction(const QIcon &icon, const QString &text); Q_INVOKABLE QAction *addAction(const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0); Q_INVOKABLE QAction *addAction(const QIcon &icon, const QString &text, const QObject *receiver, const char *member, const QKeySequence &shortcut = 0); Q_INVOKABLE void appendAction(QAction *action); Q_INVOKABLE QAction *addMenu(QMenu *menu); Q_INVOKABLE QMenu *addMenu(const QString &title); Q_INVOKABLE QMenu *addMenu(const QIcon &icon, const QString &title); Q_INVOKABLE QAction *addSeparator(); Q_INVOKABLE void clear(); Q_INVOKABLE QAction *defaultAction() const; Q_INVOKABLE QAction *exec(); Q_INVOKABLE QAction *exec(const QPoint &p, QAction *action = 0); Q_INVOKABLE void hideTearOffMenu(); Q_INVOKABLE QIcon icon() const; Q_INVOKABLE void insertAction(QAction *before, QAction *action); Q_INVOKABLE void insertActions(QAction *before, QListactions); Q_INVOKABLE QAction *insertMenu(QAction *before, QMenu *menu); Q_INVOKABLE QAction *insertSeparator(QAction *before); Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE bool isTearOffEnabled() const; Q_INVOKABLE bool isTearOffMenuVisible() const; Q_INVOKABLE QAction *menuAction() const; Q_INVOKABLE void popup(const QPoint &p, QAction *atAction = 0); Q_INVOKABLE void removeAction(QAction *action); Q_INVOKABLE bool separatorsCollapsible() const; Q_INVOKABLE void setActiveAction(QAction *act); Q_INVOKABLE void setDefaultAction(QAction *act); Q_INVOKABLE void setIcon(const QIcon &icon); Q_INVOKABLE void setSeparatorsCollapsible(bool collapse); Q_INVOKABLE void setTearOffEnabled(bool); Q_INVOKABLE void setTitle(const QString &title); Q_INVOKABLE QString title() const; // Q_INVOKABLE HMENU wceMenu(bool create = false); Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qmessageboxsetup.cpp000066400000000000000000000376411217451700100215260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qmessageboxsetup.h" QScriptValue MessageBoxButtonRoletoScriptValue(QScriptEngine *engine, const enum QMessageBox::ButtonRole &p) { return QScriptValue(engine, (int)p); } void MessageBoxButtonRolefromScriptValue(const QScriptValue &obj, enum QMessageBox::ButtonRole &p) { p = (enum QMessageBox::ButtonRole)obj.toInt32(); } QScriptValue MessageBoxIcontoScriptValue(QScriptEngine *engine, const enum QMessageBox::Icon &p) { return QScriptValue(engine, (int)p); } void MessageBoxIconfromScriptValue(const QScriptValue &obj, enum QMessageBox::Icon &p) { p = (enum QMessageBox::Icon)obj.toInt32(); } QScriptValue MessageBoxStandardButtontoScriptValue(QScriptEngine *engine, const enum QMessageBox::StandardButton &p) { return QScriptValue(engine, (int)p); } void MessageBoxStandardButtonfromScriptValue(const QScriptValue &obj, enum QMessageBox::StandardButton &p) { p = (enum QMessageBox::StandardButton)obj.toInt32(); } QScriptValue scriptAbout(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() >= 3 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString()) QMessageBox::about(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString()); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate QMessageBox::about()"); return QScriptValue(); } QScriptValue scriptAboutQt(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() >= 2 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString()) QMessageBox::aboutQt(qscriptvalue_cast(context->argument(0)), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate QMessageBox::aboutQt()"); return QScriptValue(); } QScriptValue scriptCritical(QScriptContext *context, QScriptEngine * /*engine*/) { QMessageBox::StandardButton result = QMessageBox::NoButton; if (context->argumentCount() == 3 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString()) result = QMessageBox::critical(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString()); else if (context->argumentCount() == 4 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber()) result = QMessageBox::critical(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButton)(context->argument(3).toInt32())); else if (context->argumentCount() >= 5 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber() && context->argument(4).isNumber()) result = QMessageBox::critical(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButtons)(context->argument(3).toInt32()), (QMessageBox::StandardButton)(context->argument(4).toInt32())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate QMessageBox::critical()"); return QScriptValue((int)result); } QScriptValue scriptInformation(QScriptContext *context, QScriptEngine * /*engine*/) { QMessageBox::StandardButton result = QMessageBox::NoButton; if (context->argumentCount() == 3 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString()) result = QMessageBox::information(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString()); else if (context->argumentCount() == 4 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber()) result = QMessageBox::information(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButton)(context->argument(3).toInt32())); else if (context->argumentCount() >= 5 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber() && context->argument(4).isNumber()) result = QMessageBox::information(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButtons)(context->argument(3).toInt32()), (QMessageBox::StandardButton)(context->argument(4).toInt32())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate QMessageBox::information()"); return QScriptValue((int)result); } QScriptValue scriptQuestion(QScriptContext *context, QScriptEngine * /*engine*/) { QMessageBox::StandardButton result = QMessageBox::NoButton; if (context->argumentCount() == 3 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString()) result = QMessageBox::question(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString()); else if (context->argumentCount() == 4 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber()) result = QMessageBox::question(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButtons)(context->argument(3).toInt32())); else if (context->argumentCount() >= 5 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber() && context->argument(4).isNumber()) result = QMessageBox::question(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButtons)(context->argument(3).toInt32()), (QMessageBox::StandardButton)(context->argument(4).toInt32())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate QMessageBox::question()"); return QScriptValue((int)result); } QScriptValue scriptWarning(QScriptContext *context, QScriptEngine * /*engine*/) { QMessageBox::StandardButton result = QMessageBox::NoButton; if (context->argumentCount() == 3 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString()) result = QMessageBox::warning(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString()); else if (context->argumentCount() == 4 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber()) result = QMessageBox::warning(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButton)(context->argument(3).toInt32())); else if (context->argumentCount() >= 5 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString() && context->argument(2).isString() && context->argument(3).isNumber() && context->argument(4).isNumber()) result = QMessageBox::warning(qscriptvalue_cast(context->argument(0)), context->argument(1).toString(), context->argument(2).toString(), (QMessageBox::StandardButtons)(context->argument(3).toInt32()), (QMessageBox::StandardButton)(context->argument(4).toInt32())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate QMessageBox::warning()"); return QScriptValue((int)result); } void setupQMessageBox(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); qScriptRegisterMetaType(engine, MessageBoxButtonRoletoScriptValue, MessageBoxButtonRolefromScriptValue); widget.setProperty("InvalidRole", QScriptValue(engine, QMessageBox::InvalidRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AcceptRole", QScriptValue(engine, QMessageBox::AcceptRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RejectRole", QScriptValue(engine, QMessageBox::RejectRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DestructiveRole",QScriptValue(engine, QMessageBox::DestructiveRole),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ActionRole", QScriptValue(engine, QMessageBox::ActionRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("HelpRole", QScriptValue(engine, QMessageBox::HelpRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("YesRole", QScriptValue(engine, QMessageBox::YesRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoRole", QScriptValue(engine, QMessageBox::NoRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ApplyRole", QScriptValue(engine, QMessageBox::ApplyRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ResetRole", QScriptValue(engine, QMessageBox::ResetRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, MessageBoxIcontoScriptValue, MessageBoxIconfromScriptValue); widget.setProperty("NoIcon", QScriptValue(engine, QMessageBox::NoIcon), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Question", QScriptValue(engine, QMessageBox::Question), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Information", QScriptValue(engine, QMessageBox::Information), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Warning", QScriptValue(engine, QMessageBox::Warning), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Critical", QScriptValue(engine, QMessageBox::Critical), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, MessageBoxStandardButtontoScriptValue, MessageBoxStandardButtonfromScriptValue); widget.setProperty("Ok", QScriptValue(engine, QMessageBox::Ok), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Open", QScriptValue(engine, QMessageBox::Open), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Save", QScriptValue(engine, QMessageBox::Save), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Cancel", QScriptValue(engine, QMessageBox::Cancel), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Close", QScriptValue(engine, QMessageBox::Close), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Discard", QScriptValue(engine, QMessageBox::Discard), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Apply", QScriptValue(engine, QMessageBox::Apply), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Reset", QScriptValue(engine, QMessageBox::Reset), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RestoreDefaults",QScriptValue(engine, QMessageBox::RestoreDefaults),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Help", QScriptValue(engine, QMessageBox::Help), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SaveAll", QScriptValue(engine, QMessageBox::SaveAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Yes", QScriptValue(engine, QMessageBox::Yes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("YesToAll", QScriptValue(engine, QMessageBox::YesToAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("No", QScriptValue(engine, QMessageBox::No), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoToAll", QScriptValue(engine, QMessageBox::NoToAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Abort", QScriptValue(engine, QMessageBox::Abort), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Retry", QScriptValue(engine, QMessageBox::Retry), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Ignore", QScriptValue(engine, QMessageBox::Ignore), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoButton", QScriptValue(engine, QMessageBox::NoButton), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("QMessageBox", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("about", engine->newFunction(scriptAbout)); widget.setProperty("aboutQt", engine->newFunction(scriptAboutQt)); widget.setProperty("critical", engine->newFunction(scriptCritical)); widget.setProperty("information",engine->newFunction(scriptInformation)); widget.setProperty("question", engine->newFunction(scriptQuestion)); widget.setProperty("warning", engine->newFunction(scriptWarning)); } qt-client-4.1.0/scriptapi/qmessageboxsetup.h000066400000000000000000000013571217451700100211660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QMESSAGEBOXSETUP_H__ #define __QMESSAGEBOXSETUP_H__ #include #include void setupQMessageBox(QScriptEngine *engine); Q_DECLARE_METATYPE(enum QMessageBox::ButtonRole) Q_DECLARE_METATYPE(enum QMessageBox::Icon) Q_DECLARE_METATYPE(enum QMessageBox::StandardButton) #endif qt-client-4.1.0/scriptapi/qnetworkreplyproto.cpp000066400000000000000000000236631217451700100221400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qnetworkreplyproto.h" #include void setupQNetworkReplyProto(QScriptEngine *engine) { QScriptValue replyproto = engine->newQObject(new QNetworkReplyProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), replyproto); } QNetworkReplyProto::QNetworkReplyProto(QObject *parent) : QObject(parent) { } void QNetworkReplyProto::abort() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) item->abort(); } QVariant QNetworkReplyProto::attribute(const QNetworkRequest::Attribute &code) const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->attribute(code); return QVariant(); } void QNetworkReplyProto::close() { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) item->close(); } int QNetworkReplyProto::error() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->error(); return (QNetworkReply::UnknownNetworkError); } bool QNetworkReplyProto::hasRawHeader(const QByteArray &headerName) const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->hasRawHeader(headerName); return false; } QVariant QNetworkReplyProto::header(QNetworkRequest::KnownHeaders header) const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->header(header); return QVariant(); } QNetworkAccessManager *QNetworkReplyProto::manager() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->manager(); return 0; } QNetworkAccessManager::Operation QNetworkReplyProto::operation() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->operation(); return QNetworkAccessManager::HeadOperation; } QByteArray QNetworkReplyProto::rawHeader(const QByteArray &headerName) const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) item->rawHeader(headerName); return QByteArray(); } QList QNetworkReplyProto::rawHeaderList() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->rawHeaderList(); return QList(); } qint64 QNetworkReplyProto::readBufferSize() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->readBufferSize(); return 0; } QNetworkRequest QNetworkReplyProto::request() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->request(); return QNetworkRequest(); } void QNetworkReplyProto::setReadBufferSize(qint64 size) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) item->setReadBufferSize(size); } #ifndef QT_NO_OPENSSL void QNetworkReplyProto::setSslConfiguration(const QSslConfiguration &config) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) item->setSslConfiguration(config); } QSslConfiguration QNetworkReplyProto::sslConfiguration() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->sslConfiguration(); return QSslConfiguration(); } #endif QUrl QNetworkReplyProto::url() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->url(); return QUrl(); } QString QNetworkReplyProto::toString() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QNetworkReply(url=%1)]") .arg(url().toString(QUrl::RemovePassword)); return QString("[QNetworkReply(unknown)]") .arg(url().toString(QUrl::RemovePassword)); } qint64 QNetworkReplyProto::bytesAvailable() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesAvailable(); return 0; } qint64 QNetworkReplyProto::bytesToWrite() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesToWrite(); return 0; } bool QNetworkReplyProto::canReadLine() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->canReadLine(); return false; } QString QNetworkReplyProto::errorString() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->errorString(); return QString(); } bool QNetworkReplyProto::getChar(char * c) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->getChar(c); return false; } bool QNetworkReplyProto::isOpen() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->isOpen(); return false; } bool QNetworkReplyProto::isReadable() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->isReadable(); return false; } bool QNetworkReplyProto::isSequential() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->isSequential(); return false; } bool QNetworkReplyProto::isTextModeEnabled() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->isTextModeEnabled(); return false; } bool QNetworkReplyProto::isWritable() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->isWritable(); return false; } bool QNetworkReplyProto::open(int mode) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->open((QIODevice::OpenMode)mode); return false; } int QNetworkReplyProto::openMode() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->openMode(); return 0; } qint64 QNetworkReplyProto::peek(char * data, qint64 maxSize) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(data, maxSize); return 0; } QByteArray QNetworkReplyProto::peek(qint64 maxSize) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(maxSize); return QByteArray(); } qint64 QNetworkReplyProto::pos() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->pos(); return 0; } bool QNetworkReplyProto::putChar(char c) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->putChar(c); return false; } qint64 QNetworkReplyProto::read(char * data, qint64 maxSize) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->read(data, maxSize); return 0; } QByteArray QNetworkReplyProto::read(qint64 maxSize) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->read(maxSize); return QByteArray(); } QByteArray QNetworkReplyProto::readAll() { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->readAll(); return QByteArray(); } qint64 QNetworkReplyProto::readLine(char * data, qint64 maxSize) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(data, maxSize); return 0; } QByteArray QNetworkReplyProto::readLine(qint64 maxSize) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(maxSize); return QByteArray(); } bool QNetworkReplyProto::reset() { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->reset(); return false; } bool QNetworkReplyProto::seek(qint64 pos) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->seek(pos); return false; } void QNetworkReplyProto::setTextModeEnabled(bool enabled) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) item->setTextModeEnabled(enabled); } qint64 QNetworkReplyProto::size() const { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } void QNetworkReplyProto::ungetChar(char c) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) item->ungetChar(c); } bool QNetworkReplyProto::waitForBytesWritten(int msecs) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForBytesWritten(msecs); return false; } bool QNetworkReplyProto::waitForReadyRead(int msecs) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForReadyRead(msecs); return false; } qint64 QNetworkReplyProto::write(const char * data, qint64 maxSize) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->write(data, maxSize); return 0; } qint64 QNetworkReplyProto::write(const QByteArray &byteArray) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->write(byteArray); return 0; } qint64 QNetworkReplyProto::write(const QString &string) { QNetworkReply *item = qscriptvalue_cast(thisObject()); if (item) return item->write(string.toAscii()); return 0; } qt-client-4.1.0/scriptapi/qnetworkreplyproto.h000066400000000000000000000073261217451700100216030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QNETWORKREPLYPROTO_H__ #define __QNETWORKREPLYPROTO_H__ #include #include #include #include #include #include class QByteArray; Q_DECLARE_METATYPE(QNetworkReply*) void setupQNetworkReplyProto(QScriptEngine *engine); class QNetworkReplyProto : public QObject, public QScriptable { Q_OBJECT public: QNetworkReplyProto(QObject *parent); Q_INVOKABLE void abort() const; Q_INVOKABLE QVariant attribute(const QNetworkRequest::Attribute &code) const; Q_INVOKABLE void close(); Q_INVOKABLE int error() const; Q_INVOKABLE bool hasRawHeader(const QByteArray &headerName) const; Q_INVOKABLE QVariant header(QNetworkRequest::KnownHeaders header) const; Q_INVOKABLE QNetworkAccessManager *manager() const; Q_INVOKABLE QNetworkAccessManager::Operation operation() const; Q_INVOKABLE QByteArray rawHeader(const QByteArray &headerName) const; Q_INVOKABLE QList rawHeaderList() const; Q_INVOKABLE qint64 readBufferSize() const; Q_INVOKABLE QNetworkRequest request() const; Q_INVOKABLE void setReadBufferSize(qint64 size); #ifndef QT_NO_OPENSSL Q_INVOKABLE void setSslConfiguration(const QSslConfiguration &config); Q_INVOKABLE QSslConfiguration sslConfiguration() const; #endif Q_INVOKABLE QString toString() const; Q_INVOKABLE QUrl url() const; // now for the QIODevice API Q_INVOKABLE qint64 bytesAvailable() const; Q_INVOKABLE qint64 bytesToWrite() const; Q_INVOKABLE bool canReadLine() const; Q_INVOKABLE QString errorString() const; Q_INVOKABLE bool getChar(char * c); Q_INVOKABLE bool isOpen() const; Q_INVOKABLE bool isReadable() const; Q_INVOKABLE bool isSequential() const; Q_INVOKABLE bool isTextModeEnabled() const; Q_INVOKABLE bool isWritable() const; Q_INVOKABLE bool open(int mode); Q_INVOKABLE int openMode() const; Q_INVOKABLE qint64 peek(char * data, qint64 maxSize); Q_INVOKABLE QByteArray peek(qint64 maxSize); Q_INVOKABLE qint64 pos() const; Q_INVOKABLE bool putChar(char c); Q_INVOKABLE qint64 read(char * data, qint64 maxSize); Q_INVOKABLE QByteArray read(qint64 maxSize); Q_INVOKABLE QByteArray readAll(); Q_INVOKABLE qint64 readLine(char * data, qint64 maxSize); Q_INVOKABLE QByteArray readLine(qint64 maxSize = 0); Q_INVOKABLE bool reset(); Q_INVOKABLE bool seek(qint64 pos); Q_INVOKABLE void setTextModeEnabled(bool enabled); Q_INVOKABLE qint64 size() const; Q_INVOKABLE void ungetChar(char c); Q_INVOKABLE bool waitForBytesWritten(int msecs); Q_INVOKABLE bool waitForReadyRead(int msecs); Q_INVOKABLE qint64 write(const char * data, qint64 maxSize); Q_INVOKABLE qint64 write(const QByteArray &byteArray); Q_INVOKABLE qint64 write(const QString &string); }; #endif qt-client-4.1.0/scriptapi/qnetworkrequestproto.cpp000066400000000000000000000106751217451700100224740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qnetworkrequestproto.h" #include #include #include #include #include #define DEBUG false void setupQNetworkRequestProto(QScriptEngine *engine) { if (DEBUG) qDebug("setupQNetworkRequestProto entered"); QScriptValue netreqproto = engine->newQObject(new QNetworkRequestProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), netreqproto); QScriptValue netreqConstructor = engine->newFunction(constructQNetworkRequest, netreqproto); engine->globalObject().setProperty("QNetworkRequest", netreqConstructor); } QScriptValue constructQNetworkRequest(QScriptContext *context, QScriptEngine *engine) { if (DEBUG) qDebug("constructQNetworkRequest called"); QNetworkRequest *req = 0; if (context->argumentCount() > 0) context->throwError(QScriptContext::UnknownError, "QNetworkRequest() constructors with " "arguments are not supported"); else req = new QNetworkRequest(); return engine->toScriptValue(req); } QNetworkRequestProto::QNetworkRequestProto(QObject *parent) : QObject(parent) { } QVariant QNetworkRequestProto::attribute(QNetworkRequest::Attribute code, const QVariant &defaultValue) const { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) return item->attribute(code, defaultValue); return QVariant(); } bool QNetworkRequestProto::hasRawHeader(const QByteArray &headerName) const { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) return item->hasRawHeader(headerName); return false; } QVariant QNetworkRequestProto::header(QNetworkRequest::KnownHeaders header) const { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) return item->header(header); return QVariant(); } QByteArray QNetworkRequestProto::rawHeader(const QByteArray &headerName) const { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) item->rawHeader(headerName); return QByteArray(); } QList QNetworkRequestProto::rawHeaderList() const { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) return item->rawHeaderList(); return QList(); } void QNetworkRequestProto::setAttribute(QNetworkRequest::Attribute code, const QVariant &value) { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute(code, value); } void QNetworkRequestProto::setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value) { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) item->setHeader(header, value); } void QNetworkRequestProto::setRawHeader(const QByteArray &headerName, const QByteArray &headerValue) { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) item->setRawHeader(headerName, headerValue); } #ifndef QT_NO_OPENSSL void QNetworkRequestProto::setSslConfiguration(const QSslConfiguration &config) { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) item->setSslConfiguration(config); } QSslConfiguration QNetworkRequestProto::sslConfiguration() const { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) return item->sslConfiguration(); return QSslConfiguration(); } #endif void QNetworkRequestProto::setUrl(const QUrl &url) { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) item->setUrl(url); } QUrl QNetworkRequestProto::url() const { QNetworkRequest *item = qscriptvalue_cast(thisObject()); if (item) return item->url(); return QUrl(); } QString QNetworkRequestProto::toString() const { return QString("[QNetworkRequest(url=%1)]") .arg(url().toString(QUrl::RemovePassword)); } qt-client-4.1.0/scriptapi/qnetworkrequestproto.h000066400000000000000000000043621217451700100221350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QNETWORKREQUESTPROTO_H__ #define __QNETWORKREQUESTPROTO_H__ #include #include #include #include class QByteArray; Q_DECLARE_METATYPE(QNetworkRequest*) void setupQNetworkRequestProto(QScriptEngine *engine); QScriptValue constructQNetworkRequest(QScriptContext *context, QScriptEngine *engine); class QNetworkRequestProto : public QObject, public QScriptable { Q_OBJECT public: QNetworkRequestProto(QObject *parent); Q_INVOKABLE QVariant attribute(const QNetworkRequest::Attribute code, const QVariant &defaultValue = QVariant()) const; Q_INVOKABLE bool hasRawHeader(const QByteArray &headerName) const; Q_INVOKABLE QVariant header(QNetworkRequest::KnownHeaders header) const; Q_INVOKABLE QByteArray rawHeader(const QByteArray &headerName) const; Q_INVOKABLE QList rawHeaderList() const; Q_INVOKABLE void setAttribute(QNetworkRequest::Attribute code, const QVariant &value); Q_INVOKABLE void setHeader(QNetworkRequest::KnownHeaders header, const QVariant &value); Q_INVOKABLE void setRawHeader(const QByteArray &headerName, const QByteArray &headerValue); #ifndef QT_NO_OPENSSL Q_INVOKABLE void setSslConfiguration(const QSslConfiguration &config); Q_INVOKABLE QSslConfiguration sslConfiguration() const; #endif Q_INVOKABLE void setUrl(const QUrl &url); Q_INVOKABLE QString toString() const; Q_INVOKABLE QUrl url() const; }; #endif qt-client-4.1.0/scriptapi/qprinterproto.cpp000066400000000000000000000614101217451700100210460ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #include "qprinterproto.h" #include void setupQPrinterProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QPrinterProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQPrinter, proto); engine->globalObject().setProperty("QPrinter", constructor); // enum QPrinter::ColorMode constructor.setProperty("Color", QScriptValue(engine, QPrinter::Color), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("GrayScale",QScriptValue(engine, QPrinter::GrayScale),QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::DuplexMode constructor.setProperty("DuplexNone", QScriptValue(engine, QPrinter::DuplexNone), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("DuplexAuto", QScriptValue(engine, QPrinter::DuplexAuto), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("DuplexLongSide", QScriptValue(engine, QPrinter::DuplexLongSide), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("DuplexShortSide",QScriptValue(engine, QPrinter::DuplexShortSide),QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::Orientation constructor.setProperty("Portrait", QScriptValue(engine, QPrinter::Portrait), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Landscape",QScriptValue(engine, QPrinter::Landscape),QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::OutputFormat constructor.setProperty("NativeFormat", QScriptValue(engine, QPrinter::NativeFormat), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("PdfFormat", QScriptValue(engine, QPrinter::PdfFormat), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("PostScriptFormat",QScriptValue(engine, QPrinter::PostScriptFormat),QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::PageOrder constructor.setProperty("FirstPageFirst",QScriptValue(engine, QPrinter::FirstPageFirst),QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("LastPageFirst", QScriptValue(engine, QPrinter::LastPageFirst), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::PaperSize constructor.setProperty("A0", QScriptValue(engine, QPrinter::A0), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A1", QScriptValue(engine, QPrinter::A1), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A2", QScriptValue(engine, QPrinter::A2), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A3", QScriptValue(engine, QPrinter::A3), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A4", QScriptValue(engine, QPrinter::A4), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A5", QScriptValue(engine, QPrinter::A5), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A6", QScriptValue(engine, QPrinter::A6), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A7", QScriptValue(engine, QPrinter::A7), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A8", QScriptValue(engine, QPrinter::A8), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("A9", QScriptValue(engine, QPrinter::A9), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B0", QScriptValue(engine, QPrinter::B0), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B1", QScriptValue(engine, QPrinter::B1), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B10", QScriptValue(engine, QPrinter::B10), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B2", QScriptValue(engine, QPrinter::B2), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B3", QScriptValue(engine, QPrinter::B3), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B4", QScriptValue(engine, QPrinter::B4), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B5", QScriptValue(engine, QPrinter::B5), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B6", QScriptValue(engine, QPrinter::B6), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B7", QScriptValue(engine, QPrinter::B7), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B8", QScriptValue(engine, QPrinter::B8), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("B9", QScriptValue(engine, QPrinter::B9), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("C5E", QScriptValue(engine, QPrinter::C5E), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Comm10E", QScriptValue(engine, QPrinter::Comm10E), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("DLE", QScriptValue(engine, QPrinter::DLE), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Executive",QScriptValue(engine, QPrinter::Executive),QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Folio", QScriptValue(engine, QPrinter::Folio), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Ledger", QScriptValue(engine, QPrinter::Ledger), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Legal", QScriptValue(engine, QPrinter::Legal), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Letter", QScriptValue(engine, QPrinter::Letter), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Tabloid", QScriptValue(engine, QPrinter::Tabloid), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Custom", QScriptValue(engine, QPrinter::Custom), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::PaperSource constructor.setProperty("Auto", QScriptValue(engine, QPrinter::Auto), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Cassette", QScriptValue(engine, QPrinter::Cassette), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Envelope", QScriptValue(engine, QPrinter::Envelope), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("EnvelopeManual",QScriptValue(engine, QPrinter::EnvelopeManual),QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("FormSource", QScriptValue(engine, QPrinter::FormSource), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("LargeCapacity", QScriptValue(engine, QPrinter::LargeCapacity), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("LargeFormat", QScriptValue(engine, QPrinter::LargeFormat), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Lower", QScriptValue(engine, QPrinter::Lower), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("MaxPageSource", QScriptValue(engine, QPrinter::MaxPageSource), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Middle", QScriptValue(engine, QPrinter::Middle), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Manual", QScriptValue(engine, QPrinter::Manual), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("OnlyOne", QScriptValue(engine, QPrinter::OnlyOne), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Tractor", QScriptValue(engine, QPrinter::Tractor), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("SmallFormat", QScriptValue(engine, QPrinter::SmallFormat), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::PrintRange constructor.setProperty("AllPages", QScriptValue(engine, QPrinter::AllPages), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Selection", QScriptValue(engine, QPrinter::Selection), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("PageRange", QScriptValue(engine, QPrinter::PageRange), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::PrinterMode constructor.setProperty("ScreenResolution", QScriptValue(engine, QPrinter::ScreenResolution), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("PrinterResolution",QScriptValue(engine, QPrinter::PrinterResolution),QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("HighResolution", QScriptValue(engine, QPrinter::HighResolution), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::PrinterState constructor.setProperty("Idle", QScriptValue(engine, QPrinter::Idle), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Active", QScriptValue(engine, QPrinter::Active), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Aborted",QScriptValue(engine, QPrinter::Aborted),QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Error", QScriptValue(engine, QPrinter::Error), QScriptValue::ReadOnly | QScriptValue::Undeletable); // enum QPrinter::Unit constructor.setProperty("Millimeter",QScriptValue(engine, QPrinter::Millimeter),QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Point", QScriptValue(engine, QPrinter::Point), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Inch", QScriptValue(engine, QPrinter::Inch), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Pica", QScriptValue(engine, QPrinter::Pica), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Didot", QScriptValue(engine, QPrinter::Didot), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Cicero", QScriptValue(engine, QPrinter::Cicero), QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue constructQPrinter(QScriptContext *context, QScriptEngine *engine) { QPrinter *obj = 0; if (context->argumentCount() == 0) obj = new QPrinter(); else if (context->argumentCount() == 1 && context->argument(0).isNumber()) obj = new QPrinter((QPrinter::PrinterMode)context->argument(0).toInt32()); else context->throwError("Scripting does not yet support the " "QPrinter(QPrinterInfo, PrinterMode) constructor"); return engine->toScriptValue(obj); } QPrinterProto::QPrinterProto(QObject *parent) : QObject(parent) { } bool QPrinterProto::abort() { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->abort(); return false; } bool QPrinterProto::collateCopies() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->collateCopies(); return false; } QPrinter::ColorMode QPrinterProto::colorMode() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->colorMode(); return QPrinter::Color; } QString QPrinterProto::creator() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->creator(); return QString(); } int QPrinterProto::depth() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->depth(); return 0; } QString QPrinterProto::docName() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->docName(); return QString(); } bool QPrinterProto::doubleSidedPrinting() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->doubleSidedPrinting(); return false; } QPrinter::DuplexMode QPrinterProto::duplex() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->duplex(); return QPrinter::DuplexNone; } bool QPrinterProto::fontEmbeddingEnabled() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->fontEmbeddingEnabled(); return false; } int QPrinterProto::fromPage() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->fromPage(); return 0; } bool QPrinterProto::fullPage() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->fullPage(); return false; } /* HDC QPrinterProto::getDC() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->getDC(); return ????; } */ void QPrinterProto::getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, QPrinter::Unit unit) const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->getPageMargins(left, top, right, bottom, unit); } int QPrinterProto::height() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->height(); return 0; } int QPrinterProto::heightMM() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->heightMM(); return 0; } bool QPrinterProto::isValid() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->isValid(); return false; } int QPrinterProto::logicalDpiX() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->logicalDpiX(); return 0; } int QPrinterProto::logicalDpiY() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->logicalDpiY(); return 0; } bool QPrinterProto::newPage() { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->newPage(); return false; } int QPrinterProto::numColors() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->numColors(); return 0; } int QPrinterProto::numCopies() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->numCopies(); return 0; } QPrinter::Orientation QPrinterProto::orientation() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->orientation(); return QPrinter::Portrait; } QString QPrinterProto::outputFileName() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->outputFileName(); return QString(); } QPrinter::OutputFormat QPrinterProto::outputFormat() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->outputFormat(); return QPrinter::NativeFormat; } QPrinter::PageOrder QPrinterProto::pageOrder() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->pageOrder(); return QPrinter::FirstPageFirst; } QRect QPrinterProto::pageRect() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->pageRect(); return QRect(); } QRectF QPrinterProto::pageRect(QPrinter::Unit unit) const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->pageRect(unit); return QRectF(); } QPaintEngine *QPrinterProto::paintEngine() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->paintEngine(); return 0; } bool QPrinterProto::paintingActive() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->paintingActive(); return false; } QRect QPrinterProto::paperRect() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->paperRect(); return QRect(); } QRectF QPrinterProto::paperRect(QPrinter::Unit unit) const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->paperRect(unit); return QRectF(); } QPrinter::PaperSize QPrinterProto::paperSize() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->paperSize(); return QPrinter::Letter; } QSizeF QPrinterProto::paperSize(QPrinter::Unit unit) const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->paperSize(unit); return QSizeF(); } QPrinter::PaperSource QPrinterProto::paperSource() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->paperSource(); return QPrinter::Auto; } int QPrinterProto::physicalDpiX() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->physicalDpiX(); return 0; } int QPrinterProto::physicalDpiY() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->physicalDpiY(); return 0; } QPrintEngine *QPrinterProto::printEngine() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->printEngine(); return 0; } QString QPrinterProto::printProgram() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->printProgram(); return QString(); } QPrinter::PrintRange QPrinterProto::printRange() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->printRange(); return QPrinter::AllPages; } QString QPrinterProto::printerName() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->printerName(); return QString(); } #ifndef Q_WS_WIN QString QPrinterProto::printerSelectionOption() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->printerSelectionOption(); return QString(); } #endif QPrinter::PrinterState QPrinterProto::printerState() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->printerState(); return QPrinter::Idle; } /* void QPrinterProto::releaseDC(HDC hdc) const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->releaseDC(hdc); } */ int QPrinterProto::resolution() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->resolution(); return 0; } void QPrinterProto::setCollateCopies(bool collate) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setCollateCopies(collate); } void QPrinterProto::setColorMode(QPrinter::ColorMode newColorMode) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setColorMode(newColorMode); } void QPrinterProto::setCreator(const QString & creator) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setCreator(creator); } void QPrinterProto::setDocName(const QString & name) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setDocName(name); } void QPrinterProto::setDoubleSidedPrinting(bool doubleSided) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setDoubleSidedPrinting(doubleSided); } void QPrinterProto::setDuplex(QPrinter::DuplexMode duplex) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setDuplex(duplex); } void QPrinterProto::setFontEmbeddingEnabled(bool enable) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setFontEmbeddingEnabled(enable); } void QPrinterProto::setFromTo(int from, int to) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setFromTo(from, to); } void QPrinterProto::setFullPage(bool fp) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setFullPage(fp); } void QPrinterProto::setNumCopies(int numCopies) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setNumCopies(numCopies); } void QPrinterProto::setOrientation(QPrinter::Orientation orientation) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setOrientation(orientation); } void QPrinterProto::setOutputFileName(const QString & fileName) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setOutputFileName(fileName); } void QPrinterProto::setOutputFormat(QPrinter::OutputFormat format) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setOutputFormat(format); } void QPrinterProto::setPageMargins(qreal left, qreal top, qreal right, qreal bottom, QPrinter::Unit unit) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPageMargins(left, top, right, bottom, unit); } void QPrinterProto::setPageOrder(QPrinter::PageOrder pageOrder) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPageOrder(pageOrder); } void QPrinterProto::setPaperSize(QPrinter::PaperSize newPaperSize) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPaperSize(newPaperSize); } void QPrinterProto::setPaperSize(const QSizeF & paperSize, QPrinter::Unit unit) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPaperSize(paperSize, unit); } void QPrinterProto::setPaperSource(QPrinter::PaperSource source) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPaperSource(source); } void QPrinterProto::setPrintProgram(const QString & printProg) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPrintProgram(printProg); } void QPrinterProto::setPrintRange(QPrinter::PrintRange range) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPrintRange(range); } void QPrinterProto::setPrinterName(const QString & name) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPrinterName(name); } #ifndef Q_WS_WIN void QPrinterProto::setPrinterSelectionOption(const QString & option) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setPrinterSelectionOption(option); } #endif void QPrinterProto::setResolution(int dpi) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setResolution(dpi); } #ifdef Q_WS_WIN void QPrinterProto::setWinPageSize(int pageSize) { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) item->setWinPageSize(pageSize); } QList QPrinterProto::supportedPaperSources() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->supportedPaperSources(); return QList(); } #endif QList QPrinterProto::supportedResolutions() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->supportedResolutions(); return QList(); } int QPrinterProto::toPage() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->toPage(); return 0; } int QPrinterProto::width() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->width(); return 0; } int QPrinterProto::widthMM() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->widthMM(); return 0; } #ifdef Q_WS_WIN int QPrinterProto::winPageSize() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return item->winPageSize(); return 0; } #endif /* QString QPrinterProto::toString() const { QPrinter *item = qscriptvalue_cast(thisObject()); if (item) return QString("QPrinter()"); return QString("QPrinter(unknown)"); } */ qt-client-4.1.0/scriptapi/qprinterproto.h000066400000000000000000000137561217451700100205250ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #ifndef __QPRINTERPROTO_H__ #define __QPRINTERPROTO_H__ #include #include class QString; Q_DECLARE_METATYPE(QPrinter*) //Q_DECLARE_METATYPE(QPrinter) Q_DECLARE_METATYPE(enum QPrinter::ColorMode) Q_DECLARE_METATYPE(enum QPrinter::DuplexMode) Q_DECLARE_METATYPE(enum QPrinter::Orientation) Q_DECLARE_METATYPE(enum QPrinter::OutputFormat) Q_DECLARE_METATYPE(enum QPrinter::PageOrder) Q_DECLARE_METATYPE(/*enum*/ QPrinter::PaperSize) Q_DECLARE_METATYPE(enum QPrinter::PaperSource) Q_DECLARE_METATYPE(enum QPrinter::PrintRange) Q_DECLARE_METATYPE(enum QPrinter::PrinterMode) Q_DECLARE_METATYPE(enum QPrinter::PrinterState) Q_DECLARE_METATYPE(enum QPrinter::Unit) void setupQPrinterProto(QScriptEngine *engine); QScriptValue constructQPrinter(QScriptContext *context, QScriptEngine *engine); class QPrinterProto : public QObject, public QScriptable { Q_OBJECT public: QPrinterProto(QObject *parent); Q_INVOKABLE bool abort(); Q_INVOKABLE bool collateCopies() const; Q_INVOKABLE QPrinter::ColorMode colorMode() const; Q_INVOKABLE QString creator() const; Q_INVOKABLE int depth() const; Q_INVOKABLE QString docName() const; Q_INVOKABLE bool doubleSidedPrinting() const; Q_INVOKABLE QPrinter::DuplexMode duplex() const; Q_INVOKABLE bool fontEmbeddingEnabled() const; Q_INVOKABLE int fromPage() const; Q_INVOKABLE bool fullPage() const; // Q_INVOKABLE virtual HDC getDC() const; // what's an HDC? Q_INVOKABLE void getPageMargins(qreal *left, qreal *top, qreal *right, qreal *bottom, QPrinter::Unit unit) const; Q_INVOKABLE int height() const; Q_INVOKABLE int heightMM() const; Q_INVOKABLE bool isValid() const; Q_INVOKABLE int logicalDpiX() const; Q_INVOKABLE int logicalDpiY() const; Q_INVOKABLE bool newPage(); Q_INVOKABLE int numColors() const; Q_INVOKABLE int numCopies() const; Q_INVOKABLE QPrinter::Orientation orientation() const; Q_INVOKABLE QString outputFileName() const; Q_INVOKABLE QPrinter::OutputFormat outputFormat() const; Q_INVOKABLE QPrinter::PageOrder pageOrder() const; Q_INVOKABLE QRect pageRect() const; Q_INVOKABLE QRectF pageRect(QPrinter::Unit unit) const; Q_INVOKABLE virtual QPaintEngine *paintEngine() const; Q_INVOKABLE bool paintingActive() const; Q_INVOKABLE QRect paperRect() const; Q_INVOKABLE QRectF paperRect(QPrinter::Unit unit) const; Q_INVOKABLE QPrinter::PaperSize paperSize() const; Q_INVOKABLE QSizeF paperSize(QPrinter::Unit unit) const; Q_INVOKABLE QPrinter::PaperSource paperSource() const; Q_INVOKABLE int physicalDpiX() const; Q_INVOKABLE int physicalDpiY() const; Q_INVOKABLE QPrintEngine *printEngine() const; Q_INVOKABLE QString printProgram() const; Q_INVOKABLE QPrinter::PrintRange printRange() const; Q_INVOKABLE QString printerName() const; #ifndef Q_WS_WIN Q_INVOKABLE QString printerSelectionOption() const; #endif Q_INVOKABLE QPrinter::PrinterState printerState() const; // Q_INVOKABLE virtual void releaseDC(HDC hdc) const; Q_INVOKABLE int resolution() const; Q_INVOKABLE void setCollateCopies(bool collate); Q_INVOKABLE void setColorMode(QPrinter::ColorMode newColorMode); Q_INVOKABLE void setCreator(const QString & creator); Q_INVOKABLE void setDocName(const QString & name); Q_INVOKABLE void setDoubleSidedPrinting(bool doubleSided); Q_INVOKABLE void setDuplex(QPrinter::DuplexMode duplex); Q_INVOKABLE void setFontEmbeddingEnabled(bool enable); Q_INVOKABLE void setFromTo(int from, int to); Q_INVOKABLE void setFullPage(bool fp); Q_INVOKABLE void setNumCopies(int numCopies); Q_INVOKABLE void setOrientation(QPrinter::Orientation orientation); Q_INVOKABLE void setOutputFileName(const QString & fileName); Q_INVOKABLE void setOutputFormat(QPrinter::OutputFormat format); Q_INVOKABLE void setPageMargins(qreal left, qreal top, qreal right, qreal bottom, QPrinter::Unit unit); Q_INVOKABLE void setPageOrder(QPrinter::PageOrder pageOrder); Q_INVOKABLE void setPaperSize(QPrinter::PaperSize newPaperSize); Q_INVOKABLE void setPaperSize(const QSizeF & paperSize, QPrinter::Unit unit); Q_INVOKABLE void setPaperSource(QPrinter::PaperSource source); Q_INVOKABLE void setPrintProgram(const QString & printProg); Q_INVOKABLE void setPrintRange(QPrinter::PrintRange range); Q_INVOKABLE void setPrinterName(const QString & name); #ifndef Q_WS_WIN Q_INVOKABLE void setPrinterSelectionOption(const QString & option); #endif Q_INVOKABLE void setResolution(int dpi); #ifdef Q_WS_WIN Q_INVOKABLE void setWinPageSize(int pageSize); Q_INVOKABLE QList supportedPaperSources() const; #endif Q_INVOKABLE QList supportedResolutions() const; Q_INVOKABLE int toPage() const; Q_INVOKABLE int width() const; Q_INVOKABLE int widthMM() const; #ifdef Q_WS_WIN Q_INVOKABLE int winPageSize() const; #endif }; #endif qt-client-4.1.0/scriptapi/qprocessenvironmentproto.cpp000066400000000000000000000131651217451700100233320ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #include "qprocessenvironmentproto.h" #include #include #define DEBUG true /** \ingroup scriptapi \class QProcessEnvironment \brief This class exposes the QProcessEnvironment class to Qt Scripting. In this first implementation, the QProcessEnvironment is represented in JavaScript as a straightforward Object with properties. The name of the property is the name of the corresponding environment variable and the value of the property is the value of the environment variable. This makes use of the QScriptValue::SkipInEnumeration property when converting back and forth betweeh C++ QProcessEnvironment objects and JavaScript Objects to decide what to represent in the environment. For example, to set the environment variable \c PGHOST to the value \c localhost in a QProcessEnvironemt, C++ code would look like this: \code QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); if (! env.contains("PGHOST") env.insert("PGHOST", "localhost"); \endcode while the equivalent JavaScript would look like this: \code var env = QProcessEnvironment.systemEnvironment(); if (! ("PGHOST" in env)) env.PGHOST = "localhost"; \endcode */ // TODO: remove as much of this file as possible, as most of it isn't necessary QScriptValue QProcessEnvironmenttoScriptValue(QScriptEngine *engine, const QProcessEnvironment &item) { QScriptValue result = engine->newObject(); QStringList env = item.toStringList(); for (int i = 0; i < env.size(); i++) { QStringList line = env[i].split("="); result.setProperty(line[0], line[1]); } return result; } void QProcessEnvironmentfromScriptValue(const QScriptValue &obj, QProcessEnvironment &item) { item = QProcessEnvironment(); QScriptValueIterator it(obj); while (it.hasNext()) { it.next(); if (it.flags() & QScriptValue::SkipInEnumeration) continue; item.insert(it.name(), it.value().toString()); } } static QScriptValue getSystemEnvironment(QScriptContext * /*context*/, QScriptEngine *engine) { return QProcessEnvironmenttoScriptValue(engine, QProcessEnvironment::systemEnvironment()); } void setupQProcessEnvironmentProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QProcessEnvironmenttoScriptValue, QProcessEnvironmentfromScriptValue); QScriptValue proto = engine->newQObject(new QProcessEnvironmentProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQProcessEnvironment, proto); constructor.setProperty("systemEnvironment", engine->newFunction(getSystemEnvironment, QScriptValue::SkipInEnumeration)); engine->globalObject().setProperty("QProcessEnvironment", constructor); } QScriptValue constructQProcessEnvironment(QScriptContext *context, QScriptEngine *engine) { QProcessEnvironment *obj = 0; if (context->argumentCount() > 0 && qscriptvalue_cast(context->argument(0))) obj = new QProcessEnvironment(*(qscriptvalue_cast(context->argument(0)))); else obj = new QProcessEnvironment(); return engine->toScriptValue(obj); } QProcessEnvironmentProto::QProcessEnvironmentProto(QObject *parent) : QObject(parent) { } /* void QProcessEnvironmentProto::clear() { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } bool QProcessEnvironmentProto::contains(const QString &name) const { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) return item->contains(name); return false; } void QProcessEnvironmentProto::insert(const QString &name, const QString &value) { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) item->insert(name, value); } bool QProcessEnvironmentProto::isEmpty() const { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } void QProcessEnvironmentProto::remove(const QString &name) { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) item->remove(name); } QStringList QProcessEnvironmentProto::toStringList() const { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) return item->toStringList(); return QStringList(); } QString QProcessEnvironmentProto::value(const QString &name, const QString &defaultValue) const { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) return item->value(name, defaultValue); return QString(); } */ QProcessEnvironment QProcessEnvironmentProto::systemEnvironment() { return QProcessEnvironment::systemEnvironment(); } /* QString QProcessEnvironmentProto::toString() const { QProcessEnvironment *item = qscriptvalue_cast(thisObject()); if (item) return QString("QProcessEnvironment()"); return QString("QProcessEnvironment(unknown)"); } */ qt-client-4.1.0/scriptapi/qprocessenvironmentproto.h000066400000000000000000000027421217451700100227760ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #ifndef __QPROCESSENVIRONMENTPROTO_H__ #define __QPROCESSENVIRONMENTPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QProcessEnvironment) Q_DECLARE_METATYPE(QProcessEnvironment*) void setupQProcessEnvironmentProto(QScriptEngine *engine); QScriptValue constructQProcessEnvironment(QScriptContext *context, QScriptEngine *engine); class QProcessEnvironmentProto : public QObject, public QScriptable { Q_OBJECT public: QProcessEnvironmentProto(QObject *parent); /* Q_INVOKABLE void clear(); Q_INVOKABLE bool contains(const QString &name) const; Q_INVOKABLE void insert(const QString &name, const QString &value); Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE void remove(const QString &name); Q_INVOKABLE QStringList toStringList() const; Q_INVOKABLE QString value(const QString &name, const QString &defaultValue = QString()) const; */ Q_INVOKABLE QProcessEnvironment systemEnvironment(); }; #endif qt-client-4.1.0/scriptapi/qprocessproto.cpp000066400000000000000000000416541217451700100210510ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #include "qprocessproto.h" /** \ingroup scriptapi \class QProcessProto \brief This class exposes the QIODevice class to Qt Scripting. The QProcessProto class exposes as much of the API to the QProcess class as possible. */ QScriptValue QProcesstoScriptValue(QScriptEngine *engine, QProcess* const &item) { return engine->newQObject(item); } void QProcessfromScriptValue(const QScriptValue &obj, QProcess* &item) { item = qobject_cast(obj.toQObject()); } void ExitStatusfromScriptValue(const QScriptValue &obj, enum QProcess::ExitStatus &p) { p = (enum QProcess::ExitStatus)obj.toInt32(); } QScriptValue ExitStatustoScriptValue(QScriptEngine *engine, const enum QProcess::ExitStatus &p) { return QScriptValue(engine, (int)p); } void ProcessChannelfromScriptValue(const QScriptValue &obj, enum QProcess::ProcessChannel &p) { p = (enum QProcess::ProcessChannel)obj.toInt32(); } QScriptValue ProcessChanneltoScriptValue(QScriptEngine *engine, const enum QProcess::ProcessChannel &p) { return QScriptValue(engine, (int)p); } void ProcessChannelModefromScriptValue(const QScriptValue &obj, enum QProcess::ProcessChannelMode &p) { p = (enum QProcess::ProcessChannelMode)obj.toInt32(); } QScriptValue ProcessChannelModetoScriptValue(QScriptEngine *engine, const enum QProcess::ProcessChannelMode &p) { return QScriptValue(engine, (int)p); } void ProcessErrorfromScriptValue(const QScriptValue &obj, enum QProcess::ProcessError &p) { p = (enum QProcess::ProcessError)obj.toInt32(); } QScriptValue ProcessErrortoScriptValue(QScriptEngine *engine, const enum QProcess::ProcessError &p) { return QScriptValue(engine, (int)p); } void ProcessStatefromScriptValue(const QScriptValue &obj, enum QProcess::ProcessState &p) { p = (enum QProcess::ProcessState)obj.toInt32(); } QScriptValue ProcessStatetoScriptValue(QScriptEngine *engine, const enum QProcess::ProcessState &p) { return QScriptValue(engine, (int)p); } void setupQProcessProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QProcesstoScriptValue, QProcessfromScriptValue); QScriptValue proto = engine->newQObject(new QProcessProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQProcess, proto); engine->globalObject().setProperty("QProcess", constructor); qScriptRegisterMetaType(engine, ExitStatustoScriptValue, ExitStatusfromScriptValue); constructor.setProperty("NormalExit", QScriptValue(engine, QProcess::NormalExit), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("CrashExit", QScriptValue(engine, QProcess::CrashExit), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ProcessChanneltoScriptValue, ProcessChannelfromScriptValue); constructor.setProperty("StandardOutput", QScriptValue(engine, QProcess::StandardOutput), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("StandardError", QScriptValue(engine, QProcess::StandardError), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ProcessChannelModetoScriptValue, ProcessChannelModefromScriptValue); constructor.setProperty("SeparateChannels", QScriptValue(engine, QProcess::SeparateChannels), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("MergedChannels", QScriptValue(engine, QProcess::MergedChannels), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("ForwardedChannels", QScriptValue(engine, QProcess::ForwardedChannels), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ProcessErrortoScriptValue, ProcessErrorfromScriptValue); constructor.setProperty("FailedToStart", QScriptValue(engine, QProcess::FailedToStart), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Crashed", QScriptValue(engine, QProcess::Crashed), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Timedout", QScriptValue(engine, QProcess::Timedout), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("WriteError", QScriptValue(engine, QProcess::WriteError), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("ReadError", QScriptValue(engine, QProcess::ReadError), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("UnknownError", QScriptValue(engine, QProcess::UnknownError), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ProcessStatetoScriptValue, ProcessStatefromScriptValue); constructor.setProperty("NotRunning", QScriptValue(engine, QProcess::NotRunning), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Starting", QScriptValue(engine, QProcess::Starting), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("Running", QScriptValue(engine, QProcess::Running), QScriptValue::ReadOnly | QScriptValue::Undeletable); } Q_DECLARE_METATYPE(enum QProcess::ExitStatus); Q_DECLARE_METATYPE(enum QProcess::ProcessChannel); Q_DECLARE_METATYPE(enum QProcess::ProcessChannelMode); Q_DECLARE_METATYPE(enum QProcess::ProcessError); Q_DECLARE_METATYPE(enum QProcess::ProcessState); QScriptValue constructQProcess(QScriptContext *context, QScriptEngine *engine) { QProcess *obj = 0; if (context->argumentCount() == 0) obj = new QProcess(); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new QProcess(qscriptvalue_cast(context->argument(0))); else context->throwError(QScriptContext::UnknownError, QString("Could not find an appropriate QProcess constructor to call")); return engine->toScriptValue(obj); } QProcessProto::QProcessProto(QObject *parent) : QObject(parent) { } bool QProcessProto::atEnd() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->atEnd(); return false; } qint64 QProcessProto::bytesAvailable() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesAvailable(); return 0; } qint64 QProcessProto::bytesToWrite() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->bytesToWrite(); return 0; } bool QProcessProto::canReadLine() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->canReadLine(); return false; } void QProcessProto::close() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->close(); } void QProcessProto::closeReadChannel(QProcess::ProcessChannel channel) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->closeReadChannel(channel); } void QProcessProto::closeWriteChannel() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->closeWriteChannel(); } QProcess::ProcessError QProcessProto::error() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->error(); return QProcess::ProcessError(); } QString QProcessProto::errorString() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->errorString(); return QString(); } int QProcessProto::exitCode() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->exitCode(); return 0; } QProcess::ExitStatus QProcessProto::exitStatus() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->exitStatus(); return QProcess::ExitStatus(); } bool QProcessProto::getChar(char *c) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->getChar(c); return false; } bool QProcessProto::isOpen() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->isOpen(); return false; } bool QProcessProto::isReadable() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->isReadable(); return false; } bool QProcessProto::isSequential() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->isSequential(); return false; } bool QProcessProto::isTextModeEnabled() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->isTextModeEnabled(); return false; } bool QProcessProto::isWritable() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->isWritable(); return false; } bool QProcessProto::open(QIODevice::OpenMode mode) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->open(mode); return false; } QIODevice::OpenMode QProcessProto::openMode() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->openMode(); return QIODevice::OpenMode(); } qint64 QProcessProto::peek(char *data, qint64 maxSize) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(data, maxSize); return 0; } QByteArray QProcessProto::peek(qint64 maxSize) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->peek(maxSize); return QByteArray(); } Q_PID QProcessProto::pid() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->pid(); return Q_PID(); } qint64 QProcessProto::pos() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->pos(); return 0; } QProcess::ProcessChannelMode QProcessProto::processChannelMode() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->processChannelMode(); return QProcess::ProcessChannelMode(); } QProcessEnvironment QProcessProto::processEnvironment() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->processEnvironment(); return QProcessEnvironment(); } bool QProcessProto::putChar(char c) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->putChar(c); return false; } qint64 QProcessProto::read(char *data, qint64 maxSize) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->read(data, maxSize); return 0; } QByteArray QProcessProto::read(qint64 maxSize) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->read(maxSize); return QByteArray(); } QByteArray QProcessProto::readAll() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->readAll(); return QByteArray(); } QByteArray QProcessProto::readAllStandardError() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->readAllStandardError(); return QByteArray(); } QByteArray QProcessProto::readAllStandardOutput() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->readAllStandardOutput(); return QByteArray(); } QProcess::ProcessChannel QProcessProto::readChannel() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->readChannel(); return QProcess::ProcessChannel(); } qint64 QProcessProto::readLine(char *data, qint64 maxSize) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(data, maxSize); return 0; } QByteArray QProcessProto::readLine(qint64 maxSize) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->readLine(maxSize); return QByteArray(); } bool QProcessProto::reset() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->reset(); return false; } bool QProcessProto::seek(qint64 pos) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->seek(pos); return false; } void QProcessProto::setProcessChannelMode(QProcess::ProcessChannelMode mode) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setProcessChannelMode(mode); } void QProcessProto::setProcessEnvironment(const QProcessEnvironment &environment) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setProcessEnvironment(environment); } void QProcessProto::setReadChannel(QProcess::ProcessChannel channel) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setReadChannel(channel); } void QProcessProto::setStandardErrorFile(const QString &fileName, QIODevice::OpenMode mode) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setStandardErrorFile(fileName, mode); } void QProcessProto::setStandardInputFile(const QString &fileName) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setStandardInputFile(fileName); } void QProcessProto::setStandardOutputFile(const QString &fileName, QIODevice::OpenMode mode) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setStandardOutputFile(fileName, mode); } void QProcessProto::setStandardOutputProcess(QProcess *destination) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setStandardOutputProcess(destination); } void QProcessProto::setTextModeEnabled(bool enabled) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setTextModeEnabled(enabled); } void QProcessProto::setWorkingDirectory(const QString &dir) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->setWorkingDirectory(dir); } qint64 QProcessProto::size() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } void QProcessProto::start(const QString &program, QIODevice::OpenMode mode) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->start(program, mode); } void QProcessProto::start(const QString &program, const QStringList &arguments, QIODevice::OpenMode mode) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->start(program, arguments, mode); } QProcess::ProcessState QProcessProto::state() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->state(); return QProcess::ProcessState(); } void QProcessProto::ungetChar(char c) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->ungetChar(c); } bool QProcessProto::waitForBytesWritten(int msecs) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForBytesWritten(msecs); return false; } bool QProcessProto::waitForFinished(int msecs) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForFinished(msecs); return false; } bool QProcessProto::waitForReadyRead(int msecs) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForReadyRead(msecs); return false; } bool QProcessProto::waitForStarted(int msecs) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->waitForStarted(msecs); return false; } QString QProcessProto::workingDirectory() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->workingDirectory(); return QString(); } qint64 QProcessProto::write(const QByteArray &byteArray) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->write(byteArray); return 0; } qint64 QProcessProto::write(const char *data) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->write(data); return 0; } qint64 QProcessProto::write(const char *data, qint64 maxSize) { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return item->write(data, maxSize); return 0; } void QProcessProto::kill() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->kill(); } void QProcessProto::terminate() { QProcess *item = qscriptvalue_cast(thisObject()); if (item) item->terminate(); } /** QString QProcessProto::toString() const { QProcess *item = qscriptvalue_cast(thisObject()); if (item) return QString("QProcess()"); return QString("QProcess(unknown)"); } */ qt-client-4.1.0/scriptapi/qprocessproto.h000066400000000000000000000120751217451700100205110ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #ifndef __QPROCESSPROTO_H__ #define __QPROCESSPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QProcess*) void setupQProcessProto(QScriptEngine *engine); QScriptValue constructQProcess(QScriptContext *context, QScriptEngine *engine); class QProcessProto : public QObject, public QScriptable { Q_OBJECT public: QProcessProto(QObject *parent); Q_INVOKABLE bool atEnd() const; Q_INVOKABLE qint64 bytesAvailable() const; Q_INVOKABLE qint64 bytesToWrite() const; Q_INVOKABLE bool canReadLine() const; Q_INVOKABLE void close(); Q_INVOKABLE void closeReadChannel(QProcess::ProcessChannel channel); Q_INVOKABLE void closeWriteChannel(); Q_INVOKABLE QProcess::ProcessError error() const; Q_INVOKABLE QString errorString() const; Q_INVOKABLE int exitCode() const; Q_INVOKABLE QProcess::ExitStatus exitStatus() const; Q_INVOKABLE bool getChar(char *c); Q_INVOKABLE bool isOpen() const; Q_INVOKABLE bool isReadable() const; Q_INVOKABLE bool isSequential() const; Q_INVOKABLE bool isTextModeEnabled() const; Q_INVOKABLE bool isWritable() const; Q_INVOKABLE bool open(QIODevice::OpenMode mode); Q_INVOKABLE QIODevice::OpenMode openMode() const; Q_INVOKABLE qint64 peek(char *data, qint64 maxSize); Q_INVOKABLE QByteArray peek(qint64 maxSize); Q_INVOKABLE Q_PID pid() const; Q_INVOKABLE qint64 pos() const; Q_INVOKABLE QProcess::ProcessChannelMode processChannelMode() const; Q_INVOKABLE QProcessEnvironment processEnvironment() const; Q_INVOKABLE bool putChar(char c); Q_INVOKABLE qint64 read(char *data, qint64 maxSize); Q_INVOKABLE QByteArray read(qint64 maxSize); Q_INVOKABLE QByteArray readAll(); Q_INVOKABLE QByteArray readAllStandardError(); Q_INVOKABLE QByteArray readAllStandardOutput(); Q_INVOKABLE QProcess::ProcessChannel readChannel() const; Q_INVOKABLE qint64 readLine(char *data, qint64 maxSize); Q_INVOKABLE QByteArray readLine(qint64 maxSize = 0); Q_INVOKABLE bool reset(); Q_INVOKABLE bool seek(qint64 pos); Q_INVOKABLE void setProcessChannelMode(QProcess::ProcessChannelMode mode); Q_INVOKABLE void setProcessEnvironment(const QProcessEnvironment &environment); Q_INVOKABLE void setReadChannel(QProcess::ProcessChannel channel); Q_INVOKABLE void setStandardErrorFile(const QString &fileName, QIODevice::OpenMode mode = QIODevice::Truncate); Q_INVOKABLE void setStandardInputFile(const QString &fileName); Q_INVOKABLE void setStandardOutputFile(const QString &fileName, QIODevice::OpenMode mode = QIODevice::Truncate); Q_INVOKABLE void setStandardOutputProcess(QProcess *destination); Q_INVOKABLE void setTextModeEnabled(bool enabled); Q_INVOKABLE void setWorkingDirectory(const QString &dir); Q_INVOKABLE qint64 size() const; Q_INVOKABLE void start(const QString &program, QIODevice::OpenMode mode = QIODevice::ReadWrite); Q_INVOKABLE void start(const QString &program, const QStringList &arguments, QIODevice::OpenMode mode = QIODevice::ReadWrite); Q_INVOKABLE QProcess::ProcessState state() const; Q_INVOKABLE void ungetChar(char c); Q_INVOKABLE bool waitForBytesWritten(int msecs); Q_INVOKABLE bool waitForFinished(int msecs = 30000); Q_INVOKABLE bool waitForReadyRead(int msecs); Q_INVOKABLE bool waitForStarted(int msecs = 30000); Q_INVOKABLE QString workingDirectory() const; Q_INVOKABLE qint64 write(const QByteArray &byteArray); Q_INVOKABLE qint64 write(const char *data); Q_INVOKABLE qint64 write(const char *data, qint64 maxSize); public slots: void kill(); void terminate(); signals: void aboutToClose(); void bytesWritten(qint64 bytes); void readChannelFinished(); void readyRead(); }; #endif qt-client-4.1.0/scriptapi/qpushbuttonproto.cpp000066400000000000000000000035451217451700100216030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qpushbuttonproto.h" #include #include QScriptValue QPushButtontoScriptValue(QScriptEngine *engine, QPushButton* const &item) { return engine->newQObject(item); } void QPushButtonfromScriptValue(const QScriptValue &obj, QPushButton* &item) { item = qobject_cast(obj.toQObject()); } void setupQPushButtonProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QPushButtontoScriptValue, QPushButtonfromScriptValue); QScriptValue proto = engine->newQObject(new QPushButtonProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQPushButton, proto); engine->globalObject().setProperty("QPushButton", constructor); } QScriptValue constructQPushButton(QScriptContext * context, QScriptEngine *engine) { QPushButton *obj = 0; if (context->argumentCount() == 2) { obj = new QPushButton(context->argument(0).toString(), qobject_cast(context->argument(1).toQObject())); } else if (context->argumentCount() == 1) { obj = new QPushButton(qobject_cast(context->argument(0).toQObject())); } else obj = new QPushButton(); return engine->toScriptValue(obj); } QPushButtonProto::QPushButtonProto(QObject *parent) : QObject(parent) { } qt-client-4.1.0/scriptapi/qpushbuttonproto.h000066400000000000000000000015371217451700100212470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QPUSHBUTTON_H__ #define __QPUSHBUTTON_H__ #include #include #include Q_DECLARE_METATYPE(QPushButton*) void setupQPushButtonProto(QScriptEngine *engine); QScriptValue constructQPushButton(QScriptContext *context, QScriptEngine *engine); class QPushButtonProto : public QObject, public QScriptable { Q_OBJECT public: QPushButtonProto(QObject *parent); }; #endif qt-client-4.1.0/scriptapi/qsizepolicyproto.cpp000066400000000000000000000061301217451700100215530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qsizepolicyproto.h" QScriptValue QSizePolicyControlTypetoScriptValue(QScriptEngine *engine, const enum QSizePolicy::ControlType &p) { return QScriptValue(engine, (int)p); } void QSizePolicyControlTypefromScriptValue(const QScriptValue &obj, enum QSizePolicy::ControlType &p) { p = (enum QSizePolicy::ControlType)obj.toInt32(); } QScriptValue QSizePolicyPolicytoScriptValue(QScriptEngine *engine, const enum QSizePolicy::Policy &p) { return QScriptValue(engine, (int)p); } void QSizePolicyPolicyfromScriptValue(const QScriptValue &obj, enum QSizePolicy::Policy &p) { p = (enum QSizePolicy::Policy)obj.toInt32(); } QScriptValue QSizePolicyPolicyFlagtoScriptValue(QScriptEngine *engine, const enum QSizePolicy::PolicyFlag &p) { return QScriptValue(engine, (int)p); } void QSizePolicyPolicyFlagfromScriptValue(const QScriptValue &obj, enum QSizePolicy::PolicyFlag &p) { p = (enum QSizePolicy::PolicyFlag)obj.toInt32(); } void setupQSizePolicy(QScriptEngine *engine) { QScriptValue proto = engine->newObject(); //enum ControlType proto.setProperty("DefaultType", QSizePolicy::DefaultType); proto.setProperty("ButtonBox", QSizePolicy::ButtonBox); proto.setProperty("CheckBox", QSizePolicy::CheckBox); proto.setProperty("ComboBox", QSizePolicy::ComboBox); proto.setProperty("Frame", QSizePolicy::Frame); proto.setProperty("GroupBox", QSizePolicy::GroupBox); proto.setProperty("Label", QSizePolicy::Label); proto.setProperty("Line", QSizePolicy::Line); proto.setProperty("LineEdit", QSizePolicy::LineEdit); proto.setProperty("PushButton", QSizePolicy::PushButton); proto.setProperty("RadioButton", QSizePolicy::RadioButton); proto.setProperty("Slider", QSizePolicy::Slider); proto.setProperty("SpinBox", QSizePolicy::SpinBox); proto.setProperty("TabWidget", QSizePolicy::TabWidget); proto.setProperty("ToolButton", QSizePolicy::ToolButton); //enum Policy proto.setProperty("Fixed", QSizePolicy::Fixed); proto.setProperty("Minimum", QSizePolicy::Minimum); proto.setProperty("Maximum", QSizePolicy::Maximum); proto.setProperty("Preferred", QSizePolicy::Preferred); proto.setProperty("Expanding", QSizePolicy::Expanding); proto.setProperty("MinimumExpanding",QSizePolicy::MinimumExpanding); proto.setProperty("Ignored", QSizePolicy::Ignored); // enum PolicyFlag proto.setProperty("GrowFlag", QSizePolicy::GrowFlag); proto.setProperty("ExpandFlag", QSizePolicy::ExpandFlag); proto.setProperty("ShrinkFlag", QSizePolicy::ShrinkFlag); proto.setProperty("IgnoreFlag", QSizePolicy::IgnoreFlag); engine->globalObject().setProperty("QSizePolicy", proto); } qt-client-4.1.0/scriptapi/qsizepolicyproto.h000066400000000000000000000014011217451700100212140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QSIZEPOLICYPROTO_H__ #define __QSIZEPOLICYPROTO_H__ #include #include #include Q_DECLARE_METATYPE(enum QSizePolicy::ControlType) Q_DECLARE_METATYPE(enum QSizePolicy::Policy) Q_DECLARE_METATYPE(enum QSizePolicy::PolicyFlag) void setupQSizePolicy(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/qspaceritemproto.cpp000066400000000000000000000144041217451700100215200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qspaceritemproto.h" #include "qsizepolicyproto.h" #define DEBUG false QScriptValue QSpacerItemtoScriptValue(QScriptEngine *engine, QSpacerItem* const &item) { if (DEBUG) qDebug("QSpacerItemtoScriptValue(%p, %p) called", engine, item); QScriptValue result = engine->newObject(); result.setData(engine->newVariant(qVariantFromValue(item))); return result; } void QSpacerItemfromScriptValue(const QScriptValue &obj, QSpacerItem* &item) { if (DEBUG) qDebug("QSpacerItemfromScriptValue(obj, %p) called", item); item = obj.data().toVariant().value(); if (DEBUG) qDebug("QSpacerItemfromScriptValue set %p", item); } void setupQSpacerItem(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QSpacerItemtoScriptValue, QSpacerItemfromScriptValue); QScriptValue proto = engine->newQObject(new QSpacerItemProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQSpacerItem, proto); engine->globalObject().setProperty("QSpacerItem", constructor); } QScriptValue constructQSpacerItem(QScriptContext *context, QScriptEngine *engine) { if (DEBUG) qDebug("constructQSpacerItem() called with %d args", context->argumentCount()); QSpacerItem *obj = 0; if (context->argumentCount() == 2 && context->argument(0).isNumber() && context->argument(1).isNumber()) obj = new QSpacerItem(context->argument(0).toInt32(), context->argument(1).toInt32()); else if (context->argumentCount() == 3 && context->argument(0).isNumber() && context->argument(1).isNumber() && context->argument(2).isNumber()) obj = new QSpacerItem(context->argument(0).toInt32(), context->argument(1).toInt32(), qscriptvalue_cast(context->argument(2))); else if (context->argumentCount() == 4 && context->argument(0).isNumber() && context->argument(1).isNumber() && context->argument(2).isNumber() && context->argument(3).isNumber()) obj = new QSpacerItem(context->argument(0).toInt32(), context->argument(1).toInt32(), qscriptvalue_cast(context->argument(2)), qscriptvalue_cast(context->argument(3))); else context->throwError(QScriptContext::UnknownError, "could not find appropriate QSpacerItem constructor"); if (DEBUG) qDebug("constructQSpacerItem() returning %p", obj); return engine->toScriptValue(obj); } QSpacerItemProto::QSpacerItemProto(QObject *parent) : QObject(parent) { } Qt::Alignment QSpacerItemProto::alignment() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->alignment(); return (Qt::Alignment)0; } void QSpacerItemProto::changeSize(int w, int h, QSizePolicy::Policy hPolicy, QSizePolicy::Policy vPolicy) { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) item->changeSize(w, h, hPolicy, vPolicy); } Qt::Orientations QSpacerItemProto::expandingDirections() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->expandingDirections(); return (Qt::Orientations)0; } QRect QSpacerItemProto::geometry() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->geometry(); return QRect(); } bool QSpacerItemProto::hasHeightForWidth() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->hasHeightForWidth(); return false; } int QSpacerItemProto::heightForWidth(int w) const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->heightForWidth(w); return 0; } void QSpacerItemProto::invalidate() { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) item->invalidate(); } bool QSpacerItemProto::isEmpty() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } QLayout *QSpacerItemProto::layout() { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->layout(); return 0; } QSize QSpacerItemProto::maximumSize() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->maximumSize(); return QSize(); } int QSpacerItemProto::minimumHeightForWidth(int w) const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumHeightForWidth(w); return 0; } QSize QSpacerItemProto::minimumSize() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumSize(); return QSize(); } void QSpacerItemProto::setAlignment(Qt::Alignment alignment) { if (DEBUG) qDebug("QSpacerItemProto::setAlignment(%d)", (int)alignment); QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) item->setAlignment(alignment); } void QSpacerItemProto::setGeometry(const QRect &r) { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) item->setGeometry(r); } QSize QSpacerItemProto::sizeHint() const { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->sizeHint(); return QSize(); } QSpacerItem *QSpacerItemProto::spacerItem() { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->spacerItem(); return 0; } QWidget *QSpacerItemProto::widget() { QSpacerItem *item = qscriptvalue_cast(thisObject()); if (item) return item->widget(); return 0; } qt-client-4.1.0/scriptapi/qspaceritemproto.h000066400000000000000000000041141217451700100211620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QSPACERITEMPROTO_H__ #define __QSPACERITEMPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QSpacerItem*) void setupQSpacerItem(QScriptEngine *engine); QScriptValue constructQSpacerItem(QScriptContext *context, QScriptEngine *engine); class QSpacerItemProto : public QObject, public QScriptable { Q_OBJECT public: QSpacerItemProto(QObject *parent); Q_INVOKABLE Qt::Alignment alignment() const; Q_INVOKABLE void changeSize(int w, int h, QSizePolicy::Policy hPolicy = QSizePolicy::Minimum, QSizePolicy::Policy vPolicy = QSizePolicy::Minimum); QSizePolicy::ControlTypes controlTypes () const; Q_INVOKABLE Qt::Orientations expandingDirections() const; Q_INVOKABLE QRect geometry() const; Q_INVOKABLE bool hasHeightForWidth() const; Q_INVOKABLE int heightForWidth(int w) const; Q_INVOKABLE void invalidate(); Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE QLayout *layout(); Q_INVOKABLE QSize maximumSize() const; Q_INVOKABLE int minimumHeightForWidth(int w) const; Q_INVOKABLE QSize minimumSize() const; Q_INVOKABLE void setAlignment(Qt::Alignment alignment); Q_INVOKABLE void setGeometry(const QRect &r); Q_INVOKABLE QSize sizeHint() const; Q_INVOKABLE QSpacerItem *spacerItem(); Q_INVOKABLE QWidget *widget(); }; #endif qt-client-4.1.0/scriptapi/qsqldatabaseproto.cpp000066400000000000000000000417401217451700100216530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "scriptapi_internal.h" #include "qsqldatabaseproto.h" /** \ingroup scriptapi \brief Script Exposure of QSqlDatabase class. \todo implement QSqlDatabase::addDatabase(QSqlDriver*, const QString &connectionName) \todo implement QSqlDatabase::registerSqlDriver(const QString &, QSqlDriverCreatorBase *) */ QScriptValue QSqlDatabasetoScriptValue(QScriptEngine *engine, QSqlDatabase const &item) { QVariant v; v.setValue(item); return engine->newVariant(v); } void QSqlDatabasefromScriptValue(const QScriptValue &obj, QSqlDatabase &item) { item = obj.toVariant().value(); } QScriptValue QSqlDatabasePtrtoScriptValue(QScriptEngine *engine, QSqlDatabase* const &item) { QVariant v; v.setValue(item); return engine->newVariant(v); } void QSqlDatabasePtrfromScriptValue(const QScriptValue &obj, QSqlDatabase* &item) { item = obj.toVariant().value(); } static QScriptValue qsqldatabase_addDatabase(QScriptContext *context, QScriptEngine *engine) { QSqlDatabase result; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QSqlDatabase::addDatabase(context->argument(0).toString()); else if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isString()) result = QSqlDatabase::addDatabase(context->argument(0).toString(), context->argument(1).toString()); /* else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) result = QSqlDatabase::addDatabase(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() == 2 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString()) result = QSqlDatabase::addDatabase(qscriptvalue_cast(context->argument(0)), context->argument(1).toString()); */ else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QSqlDatabase::addDatabase()"); QVariant v; v.setValue(result); return engine->newVariant(v); } static QScriptValue qsqldatabase_cloneDatabase(QScriptContext *context, QScriptEngine *engine) { QSqlDatabase result; if (context->argumentCount() == 2 && // context->argument(0) is a QSqlDatabase // TODO: how do we know this? context->argument(1).isString()) result = QSqlDatabase::cloneDatabase(qscriptvalue_cast(context->argument(0)), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QSqlDatabase::cloneDatabase()"); QVariant v; v.setValue(result); return engine->newVariant(v); } static QScriptValue qsqldatabase_connectionNames(QScriptContext * /*context*/, QScriptEngine *engine) { QStringList result; result = QSqlDatabase::connectionNames(); QVariant v; v.setValue(result); return engine->newVariant(v); } static QScriptValue qsqldatabase_contains(QScriptContext *context, QScriptEngine * /*engine*/) { bool result = false; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QSqlDatabase::contains(context->argument(0).toString()); else result = QSqlDatabase::contains(); return QScriptValue(result); } static QScriptValue qsqldatabase_database(QScriptContext *context, QScriptEngine *engine) { QSqlDatabase result; if (context->argumentCount() == 0) result = QSqlDatabase::database(); else if (context->argumentCount() == 1 && context->argument(0).isString()) result = QSqlDatabase::database(context->argument(0).toString()); else if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isBool()) result = QSqlDatabase::database(context->argument(0).toString(), context->argument(1).toBool()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QSqlDatabase::database()"); QVariant v; v.setValue(result); return engine->newVariant(v); } static QScriptValue qsqldatabase_drivers(QScriptContext * /*context*/, QScriptEngine *engine) { QStringList result; result = QSqlDatabase::drivers(); QVariant v; v.setValue(result); return engine->newVariant(v); } static QScriptValue qsqldatabase_isDriverAvailable(QScriptContext *context, QScriptEngine * /*engine*/) { bool result = false; if (context->argumentCount() == 1 && context->argument(0).isString()) result = QSqlDatabase::isDriverAvailable(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QSqlDatabase::isDriverAvailable()"); return QScriptValue(result); } /* static QScriptValue qsqldatabase_registerSqlDriver(QScriptContext *context, QScriptEngine *engine) { if (context->argumentCount() == 2) QSqlDatabase::registerSqlDriver(context->argument(0).toString(), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QSqlDatabase::registerSqlDriver()"); return QScriptValue(); } */ static QScriptValue qsqldatabase_removeDatabase(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() == 1 && context->argument(0).isString()) QSqlDatabase::removeDatabase(context->argument(0).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate QSqlDatabase::removeDatabase()"); return QScriptValue(); } void setupQSqlDatabaseProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QSqlDatabasetoScriptValue, QSqlDatabasefromScriptValue); qScriptRegisterMetaType(engine, QSqlDatabasePtrtoScriptValue, QSqlDatabasePtrfromScriptValue); QScriptValue proto = engine->newQObject(new QSqlDatabaseProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQSqlDatabase, proto); engine->globalObject().setProperty("QSqlDatabase", constructor, CTORPROPFLAGS); constructor.setProperty("addDatabase", engine->newFunction(qsqldatabase_addDatabase), STATICPROPFLAGS); constructor.setProperty("cloneDatabase", engine->newFunction(qsqldatabase_cloneDatabase), STATICPROPFLAGS); constructor.setProperty("connectionNames", engine->newFunction(qsqldatabase_connectionNames), STATICPROPFLAGS); constructor.setProperty("contains", engine->newFunction(qsqldatabase_contains), STATICPROPFLAGS); constructor.setProperty("database", engine->newFunction(qsqldatabase_database), STATICPROPFLAGS); constructor.setProperty("drivers", engine->newFunction(qsqldatabase_drivers), STATICPROPFLAGS); constructor.setProperty("isDriverAvailable",engine->newFunction(qsqldatabase_isDriverAvailable),STATICPROPFLAGS); //constructor.setProperty("registerSqlDriver",engine->newFunction(qsqldatabase_registerSqlDriver),STATICPROPFLAGS); constructor.setProperty("removeDatabase", engine->newFunction(qsqldatabase_removeDatabase), STATICPROPFLAGS); } QScriptValue constructQSqlDatabase(QScriptContext *context, QScriptEngine *engine) { QSqlDatabase *obj = 0; if (context->argumentCount() == 1) obj = new QSqlDatabase(qscriptvalue_cast(context->argument(0))); else obj = new QSqlDatabase(); return engine->toScriptValue(obj); } QSqlDatabaseProto::QSqlDatabaseProto(QObject *parent) : QObject(parent) { } void QSqlDatabaseProto::close() { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) item->close(); else if (! thisObject().isNull()) thisObject().toVariant().value().close(); } bool QSqlDatabaseProto::commit() { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->commit(); else if (! thisObject().isNull()) return thisObject().toVariant().value().commit(); return false; } QString QSqlDatabaseProto::connectOptions() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->connectOptions(); else if (! thisObject().isNull()) return thisObject().toVariant().value().connectOptions(); return QString(); } QString QSqlDatabaseProto::connectionName() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->connectionName(); else if (! thisObject().isNull()) return thisObject().toVariant().value().connectionName(); return QString(); } QString QSqlDatabaseProto::databaseName() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->databaseName(); else if (! thisObject().isNull()) return thisObject().toVariant().value().databaseName(); return QString(); } QSqlDriver *QSqlDatabaseProto::driver() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->driver(); else if (! thisObject().isNull()) return thisObject().toVariant().value().driver(); return 0; } QString QSqlDatabaseProto::driverName() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->driverName(); else if (! thisObject().isNull()) return thisObject().toVariant().value().driverName(); return QString(); } QSqlQuery QSqlDatabaseProto::exec(const QString &query) const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->exec(query); else if (! thisObject().isNull()) return thisObject().toVariant().value().exec(query); return QSqlQuery(); } QString QSqlDatabaseProto::hostName() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->hostName(); else if (! thisObject().isNull()) return thisObject().toVariant().value().hostName(); return QString(); } bool QSqlDatabaseProto::isOpen() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->isOpen(); else if (! thisObject().isNull()) return thisObject().toVariant().value().isOpen(); return false; } bool QSqlDatabaseProto::isOpenError() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->isOpenError(); else if (! thisObject().isNull()) return thisObject().toVariant().value().isOpenError(); return false; } bool QSqlDatabaseProto::isValid() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->isValid(); else if (! thisObject().isNull()) return thisObject().toVariant().value().isValid(); return false; } QSqlError QSqlDatabaseProto::lastError() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->lastError(); else if (! thisObject().isNull()) return thisObject().toVariant().value().lastError(); return QSqlError(); } bool QSqlDatabaseProto::open() { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->open(); else if (! thisObject().isNull()) return thisObject().toVariant().value().open(); return false; } bool QSqlDatabaseProto::open(const QString &user, const QString &password) { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->open(user, password); else if (! thisObject().isNull()) return thisObject().toVariant().value().open(user, password); return false; } QString QSqlDatabaseProto::password() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->password(); else if (! thisObject().isNull()) return thisObject().toVariant().value().password(); return QString(); } int QSqlDatabaseProto::port() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->port(); else if (! thisObject().isNull()) return thisObject().toVariant().value().port(); return 0; } QSqlIndex QSqlDatabaseProto::primaryIndex(const QString &tablename) const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->primaryIndex(tablename); else if (! thisObject().isNull()) return thisObject().toVariant().value().primaryIndex(tablename); return QSqlIndex(); } QSqlRecord QSqlDatabaseProto::record(const QString &tablename) const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->record(tablename); else if (! thisObject().isNull()) return thisObject().toVariant().value().record(tablename); return QSqlRecord(); } bool QSqlDatabaseProto::rollback() { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->rollback(); else if (! thisObject().isNull()) return thisObject().toVariant().value().rollback(); return false; } void QSqlDatabaseProto::setConnectOptions(const QString &options) { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) item->setConnectOptions(options); else if (! thisObject().isNull()) thisObject().toVariant().value().setConnectOptions(options); } void QSqlDatabaseProto::setDatabaseName(const QString &name) { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) item->setDatabaseName(name); else if (! thisObject().isNull()) thisObject().toVariant().value().setDatabaseName(name); } void QSqlDatabaseProto::setHostName(const QString &host) { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) item->setHostName(host); else if (! thisObject().isNull()) thisObject().toVariant().value().setHostName(host); } void QSqlDatabaseProto::setPassword(const QString &password) { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) item->setPassword(password); else if (! thisObject().isNull()) thisObject().toVariant().value().setPassword(password); } void QSqlDatabaseProto::setPort(int port) { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) item->setPort(port); else if (! thisObject().isNull()) thisObject().toVariant().value().setPort(port); } void QSqlDatabaseProto::setUserName(const QString &name) { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) item->setUserName(name); else if (! thisObject().isNull()) thisObject().toVariant().value().setUserName(name); } QStringList QSqlDatabaseProto::tables(int type) const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->tables((QSql::TableType)type); else if (! thisObject().isNull()) return thisObject().toVariant().value().tables((QSql::TableType)type); return QStringList(); } bool QSqlDatabaseProto::transaction() { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->transaction(); else if (! thisObject().isNull()) return thisObject().toVariant().value().transaction(); return false; } QString QSqlDatabaseProto::userName() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return item->userName(); else if (! thisObject().isNull()) return thisObject().toVariant().value().userName(); return QString(); } QString QSqlDatabaseProto::toString() const { QSqlDatabase *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QSqlDatabase(driver=%1, database=%2, " "host=%3, port=%4, user=%5)]") .arg(item->driverName()).arg(item->databaseName()) .arg(item->hostName()).arg(item->port()).arg(item->userName()); return QString("[QSqlDatabase(unknown)]"); } qt-client-4.1.0/scriptapi/qsqldatabaseproto.h000066400000000000000000000053561217451700100213230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QSQLDATABASEPROTO_H__ #define __QSQLDATABASEPROTO_H__ #include #include #include #include #include #include #include #include class QSqlDriver; Q_DECLARE_METATYPE(QSqlDatabase*) Q_DECLARE_METATYPE(QSqlDatabase) void setupQSqlDatabaseProto(QScriptEngine *engine); QScriptValue constructQSqlDatabase(QScriptContext *context, QScriptEngine *engine); class QSqlDatabaseProto : public QObject, public QScriptable { Q_OBJECT public: QSqlDatabaseProto(QObject *parent); Q_INVOKABLE void close(); Q_INVOKABLE bool commit(); Q_INVOKABLE QString connectOptions() const; Q_INVOKABLE QString connectionName() const; Q_INVOKABLE QString databaseName() const; Q_INVOKABLE QSqlDriver *driver() const; Q_INVOKABLE QString driverName() const; Q_INVOKABLE QSqlQuery exec(const QString &query = QString()) const; Q_INVOKABLE QString hostName() const; Q_INVOKABLE bool isOpen() const; Q_INVOKABLE bool isOpenError() const; Q_INVOKABLE bool isValid() const; Q_INVOKABLE QSqlError lastError() const; Q_INVOKABLE bool open(); Q_INVOKABLE bool open(const QString &user, const QString &password); Q_INVOKABLE QString password() const; Q_INVOKABLE int port() const; Q_INVOKABLE QSqlIndex primaryIndex(const QString &tablename) const; Q_INVOKABLE QSqlRecord record(const QString &tablename) const; Q_INVOKABLE bool rollback(); Q_INVOKABLE void setConnectOptions(const QString &options = QString()); Q_INVOKABLE void setDatabaseName(const QString &name); Q_INVOKABLE void setHostName(const QString &host); Q_INVOKABLE void setPassword(const QString &password); Q_INVOKABLE void setPort(int port); Q_INVOKABLE void setUserName(const QString &name); Q_INVOKABLE QStringList tables(int type = QSql::Tables) const; Q_INVOKABLE QString toString() const; Q_INVOKABLE bool transaction(); Q_INVOKABLE QString userName() const; }; #endif qt-client-4.1.0/scriptapi/qsqlerrorproto.cpp000066400000000000000000000034401217451700100212330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qsqlerrorproto.h" void setupQSqlErrorProto(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); qScriptRegisterMetaType(engine, QSqlErrorTypetoScriptValue, QSqlErrorTypefromScriptValue); widget.setProperty("NoError", QScriptValue(engine, QSqlError::NoError), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ConnectionError", QScriptValue(engine, QSqlError::ConnectionError), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("StatementError", QScriptValue(engine, QSqlError::StatementError), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransactionError",QScriptValue(engine, QSqlError::TransactionError),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UnknownError", QScriptValue(engine, QSqlError::UnknownError), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("QSqlError", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } Q_DECLARE_METATYPE(enum QSqlError::ErrorType); QScriptValue QSqlErrorTypetoScriptValue(QScriptEngine *engine, const enum QSqlError::ErrorType &p) { return QScriptValue(engine, (int)p); } void QSqlErrorTypefromScriptValue(const QScriptValue &obj, enum QSqlError::ErrorType &p) { p = (enum QSqlError::ErrorType)obj.toInt32(); } qt-client-4.1.0/scriptapi/qsqlerrorproto.h000066400000000000000000000037311217451700100207030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QSQLERRORPROTO_H__ #define __QSQLERRORPROTO_H__ #include #include #include /* initially only need access to the enum. save the following in case we need it class QString; Q_DECLARE_METATYPE(QSqlError*) Q_DECLARE_METATYPE(QSqlError) */ void setupQSqlErrorProto(QScriptEngine *engine); QScriptValue QSqlErrorTypetoScriptValue(QScriptEngine *engine, const enum QSqlError::ErrorType &p); void QSqlErrorTypefromScriptValue(const QScriptValue &obj, enum QSqlError::ErrorType &p); /* initially only need access to the enum. save the following in case we need it QScriptValue constructQSqlError(QScriptContext *context, QScriptEngine *engine); class QSqlErrorProto : public QObject, public QScriptable { Q_OBJECT public: QSqlErrorProto(QObject *parent); QSqlError ( const QString & driverText = QString(), const QString & databaseText = QString(), ErrorType type = NoError, int number = -1 ); QSqlError ( const QSqlError & other ); ~QSqlError (); Q_INVOKABLE QString databaseText () const; Q_INVOKABLE QString driverText () const; Q_INVOKABLE bool isValid () const; Q_INVOKABLE int number () const; Q_INVOKABLE void setDatabaseText ( const QString & databaseText ); Q_INVOKABLE void setDriverText ( const QString & driverText ); Q_INVOKABLE void setNumber ( int number ); Q_INVOKABLE void setType ( ErrorType type ); Q_INVOKABLE QString text () const; Q_INVOKABLE ErrorType type () const; Public Functions }; */ #endif qt-client-4.1.0/scriptapi/qsqlrecordproto.cpp000066400000000000000000000135531217451700100213660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qsqlrecordproto.h" #include void setupQSqlRecordProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QSqlRecordProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQSqlRecord, proto); engine->globalObject().setProperty("QSqlRecord", constructor); } QScriptValue constructQSqlRecord(QScriptContext *context, QScriptEngine *engine) { QSqlRecord *obj = 0; if (context->argumentCount() == 0) obj = new QSqlRecord(); else if (context->argumentCount() == 1) qWarning("QSqlRecordProto copy constructor not implemented yet"); return engine->toScriptValue(obj); } QSqlRecordProto::QSqlRecordProto(QObject *parent) : QObject(parent) { } void QSqlRecordProto::append(const QSqlField & field) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->append(field); } void QSqlRecordProto::clear() { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } void QSqlRecordProto::clearValues() { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->clearValues(); } bool QSqlRecordProto::contains(const QString &name) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->contains(name); return false; } int QSqlRecordProto::count() const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } QSqlField QSqlRecordProto::field(int index) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->field(index); return QSqlField(); } QSqlField QSqlRecordProto::field(const QString &name) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->field(name); return QSqlField(); } QString QSqlRecordProto::fieldName(int index) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->fieldName(index); return QString(); } int QSqlRecordProto::indexOf(const QString & name) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(name); return -1; } void QSqlRecordProto::insert(int pos, const QSqlField &field) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->insert(pos, field); } bool QSqlRecordProto::isEmpty() const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } bool QSqlRecordProto::isGenerated(const QString &name) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->isGenerated(name); return false; } bool QSqlRecordProto::isGenerated(int index) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->isGenerated(index); return false; } bool QSqlRecordProto::isNull(const QString &name) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(name); return false; } bool QSqlRecordProto::isNull(int index) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->isNull(index); return false; } void QSqlRecordProto::remove(int pos) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->remove(pos); } void QSqlRecordProto::replace(int pos, const QSqlField &field) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->replace(pos, field); } void QSqlRecordProto::setGenerated(const QString &name, bool generated) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->setGenerated(name, generated); } void QSqlRecordProto::setGenerated(int index, bool generated) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->setGenerated(index, generated); } void QSqlRecordProto::setNull(int index) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->setNull(index); } void QSqlRecordProto::setNull(const QString &name) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->setNull(name); } void QSqlRecordProto::setValue(int index, const QVariant &val) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->setValue(index, val); } void QSqlRecordProto::setValue(const QString &name, const QVariant &val) { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) item->setValue(name, val); } QVariant QSqlRecordProto::value(int index) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->value(index); return QVariant(); } QVariant QSqlRecordProto::value(const QString &name) const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return item->value(name); return QVariant(); } /* QString QSqlRecordProto::toString() const { QSqlRecord *item = qscriptvalue_cast(thisObject()); if (item) return QString("QSqlRecord()"); return QString("QSqlRecord(unknown)"); } */ qt-client-4.1.0/scriptapi/qsqlrecordproto.h000066400000000000000000000047741217451700100210400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QSQLRECORDPROTO_H__ #define __QSQLRECORDPROTO_H__ #include #include #include #include #include #include class QString; Q_DECLARE_METATYPE(QSqlRecord*) Q_DECLARE_METATYPE(QSqlRecord) void setupQSqlRecordProto(QScriptEngine *engine); QScriptValue constructQSqlRecord(QScriptContext *context, QScriptEngine *engine); class QSqlRecordProto : public QObject, public QScriptable { Q_OBJECT public: QSqlRecordProto(QObject *parent); Q_INVOKABLE void append(const QSqlField & field); Q_INVOKABLE void clear(); Q_INVOKABLE void clearValues(); Q_INVOKABLE bool contains(const QString &name) const; Q_INVOKABLE int count() const; Q_INVOKABLE QSqlField field(int index) const; Q_INVOKABLE QSqlField field(const QString &name) const; Q_INVOKABLE QString fieldName(int index) const; Q_INVOKABLE int indexOf(const QString & name) const; Q_INVOKABLE void insert(int pos, const QSqlField &field); Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE bool isGenerated(const QString &name) const; Q_INVOKABLE bool isGenerated(int index) const; Q_INVOKABLE bool isNull(const QString &name) const; Q_INVOKABLE bool isNull(int index) const; Q_INVOKABLE void remove(int pos); Q_INVOKABLE void replace(int pos, const QSqlField &field); Q_INVOKABLE void setGenerated(const QString &name, bool generated); Q_INVOKABLE void setGenerated(int index, bool generated); Q_INVOKABLE void setNull(int index); Q_INVOKABLE void setNull(const QString &name); Q_INVOKABLE void setValue(int index, const QVariant &val); Q_INVOKABLE void setValue(const QString &name, const QVariant &val); Q_INVOKABLE QVariant value(int index) const; Q_INVOKABLE QVariant value(const QString &name) const; }; #endif qt-client-4.1.0/scriptapi/qstackedwidgetproto.cpp000066400000000000000000000066161217451700100222140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qstackedwidgetproto.h" QScriptValue QStackedWidgettoScriptValue(QScriptEngine *engine, QStackedWidget* const &item) { return engine->newQObject(item); } void QStackedWidgetfromScriptValue(const QScriptValue &obj, QStackedWidget* &item) { item = qobject_cast(obj.toQObject()); } void setupQStackedWidgetProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QStackedWidgetProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQStackedWidget, proto); engine->globalObject().setProperty("QStackedWidget", constructor); } QScriptValue constructQStackedWidget(QScriptContext * context, QScriptEngine *engine) { QStackedWidget *obj = 0; if (context->argumentCount() == 1) obj = new QStackedWidget(qobject_cast(context->argument(0).toQObject())); else obj = new QStackedWidget(); return engine->toScriptValue(obj); } QStackedWidgetProto::QStackedWidgetProto(QObject *parent) : QObject(parent) { } int QStackedWidgetProto::addWidget(QWidget *widget) { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->addWidget(widget); return -1; } int QStackedWidgetProto::count() const { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } int QStackedWidgetProto::currentIndex() const { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->currentIndex(); return 0; } QWidget *QStackedWidgetProto::currentWidget() const { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->currentWidget(); return 0; } int QStackedWidgetProto::indexOf(QWidget *widget) const { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(widget); return 0; } int QStackedWidgetProto::insertWidget(int index, QWidget *widget) { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->insertWidget(index, widget); return 0; } void QStackedWidgetProto::removeWidget(QWidget *widget) { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) item->removeWidget(widget); } QWidget *QStackedWidgetProto::widget(int index) const { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->widget(index); return 0; } /* QString QStackedWidgetProto::toString() const { QStackedWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->toString() const; return QString(); } */ qt-client-4.1.0/scriptapi/qstackedwidgetproto.h000066400000000000000000000026601217451700100216540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QSTACKEDWIDGETPROTO_H__ #define __QSTACKEDWIDGETPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QStackedWidget*) //Q_DECLARE_METATYPE(QStackedWidget) void setupQStackedWidgetProto(QScriptEngine *engine); QScriptValue constructQStackedWidget(QScriptContext *context, QScriptEngine *engine); class QStackedWidgetProto : public QObject, public QScriptable { Q_OBJECT public: QStackedWidgetProto(QObject *parent); Q_INVOKABLE int addWidget(QWidget *widget); Q_INVOKABLE int count() const; Q_INVOKABLE int currentIndex() const; Q_INVOKABLE QWidget *currentWidget() const; Q_INVOKABLE int indexOf(QWidget *widget) const; Q_INVOKABLE int insertWidget(int index, QWidget *widget); Q_INVOKABLE void removeWidget(QWidget *widget); Q_INVOKABLE QWidget *widget(int index) const; //Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qtabwidgetproto.cpp000066400000000000000000000211601217451700100213330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qtabwidgetproto.h" #include void setupQTabWidgetProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QTabWidgetProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQTabWidget, proto); engine->globalObject().setProperty("QTabWidget", constructor); } QScriptValue constructQTabWidget(QScriptContext * /*context*/, QScriptEngine *engine) { QTabWidget *obj = 0; // if (context->argumentCount() > 0) // else obj = new QTabWidget(); return engine->toScriptValue(obj); } QTabWidgetProto::QTabWidgetProto(QObject *parent) : QObject(parent) { } int QTabWidgetProto::addTab(QWidget * page, const QString &label) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->addTab(page, label); return 0; } int QTabWidgetProto::addTab(QWidget * page, const QIcon &icon, const QString &label) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->addTab(page, icon, label); return 0; } void QTabWidgetProto::clear() { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } QWidget *QTabWidgetProto::cornerWidget(int corner) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->cornerWidget((Qt::Corner)corner); return 0; } int QTabWidgetProto::count() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } int QTabWidgetProto::currentIndex() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->currentIndex(); return 0; } QWidget *QTabWidgetProto::currentWidget() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->currentWidget(); return 0; } #if QT_VERSION >= 0x040500 bool QTabWidgetProto::documentMode() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->documentMode(); return false; } #endif int QTabWidgetProto::elideMode() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->elideMode(); return 0; } QSize QTabWidgetProto::iconSize() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->iconSize(); return QSize(); } int QTabWidgetProto::indexOf(QWidget *w) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOf(w); return 0; } int QTabWidgetProto::insertTab(int index, QWidget *page, const QString &label) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->insertTab(index, page, label); return 0; } int QTabWidgetProto::insertTab(int index, QWidget *page, const QIcon &icon, const QString & label) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->insertTab(index, page, icon, label); return 0; } #if QT_VERSION >= 0x040500 bool QTabWidgetProto::isMovable() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->isMovable(); return false; } #endif bool QTabWidgetProto::isTabEnabled(int index) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->isTabEnabled(index); return false; } void QTabWidgetProto::removeTab(int index) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->removeTab(index); } void QTabWidgetProto::setCornerWidget(QWidget *widget, int corner) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setCornerWidget(widget, (Qt::Corner)corner); } #if QT_VERSION >= 0x040500 void QTabWidgetProto::setDocumentMode(bool set) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setDocumentMode(set); } #endif void QTabWidgetProto::setElideMode(int mode) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setElideMode((Qt::TextElideMode)mode); } void QTabWidgetProto::setIconSize(const QSize &size) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setIconSize(size); } #if QT_VERSION >= 0x040500 void QTabWidgetProto::setMovable(bool movable) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setMovable(movable); } #endif void QTabWidgetProto::setTabEnabled(int index, bool enable) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabEnabled(index, enable); } void QTabWidgetProto::setTabIcon(int index, const QIcon &icon) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabIcon(index, icon); } void QTabWidgetProto::setTabPosition(int position) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabPosition((QTabWidget::TabPosition)position); } void QTabWidgetProto::setTabShape(int s) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabShape((QTabWidget::TabShape)s); } void QTabWidgetProto::setTabText(int index, const QString &label) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabText(index, label); } void QTabWidgetProto::setTabToolTip(int index, const QString &tip) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabToolTip(index, tip); } void QTabWidgetProto::setTabWhatsThis(int index, const QString &text) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabWhatsThis(index, text); } #if QT_VERSION >= 0x040500 void QTabWidgetProto::setTabsClosable(bool closeable) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setTabsClosable(closeable); } #endif void QTabWidgetProto::setUsesScrollButtons(bool useButtons) { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setUsesScrollButtons(useButtons); } QIcon QTabWidgetProto::tabIcon(int index) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->tabIcon(index); return QIcon(); } int QTabWidgetProto::tabPosition() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->tabPosition(); return 0; } int QTabWidgetProto::tabShape() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->tabShape(); return 0; } QString QTabWidgetProto::tabText(int index) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->tabText(index); return QString(); } QString QTabWidgetProto::tabToolTip(int index) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->tabToolTip(index); return QString(); } QString QTabWidgetProto::tabWhatsThis(int index) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->tabWhatsThis(index); return QString(); } #if QT_VERSION >= 0x040500 bool QTabWidgetProto::tabsClosable() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->tabsClosable(); return false; } #endif bool QTabWidgetProto::usesScrollButtons() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->usesScrollButtons(); return false; } QWidget *QTabWidgetProto::widget(int index) const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->widget(index); return 0; } /* QString QTabWidgetProto::toString() const { QTabWidget *item = qscriptvalue_cast(thisObject()); if (item) return QString("QTabWidget()"); return QString("QTabWidget(unknown)"); } */ qt-client-4.1.0/scriptapi/qtabwidgetproto.h000066400000000000000000000071471217451700100210110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QTABWIDGETPROTO_H__ #define __QTABWIDGETPROTO_H__ #include #include #include class QString; Q_DECLARE_METATYPE(QTabWidget*) //Q_DECLARE_METATYPE(QTabWidget) void setupQTabWidgetProto(QScriptEngine *engine); void TabPositionScriptValue(const QScriptValue &obj, enum QTabWidget::TabPosition &p); void TabShapeScriptValue(const QScriptValue &obj, enum QTabWidget::TabShape &p); QScriptValue constructQTabWidget(QScriptContext *context, QScriptEngine *engine); QScriptValue TabPositionScriptValue(QScriptEngine *engine, const enum QTabWidget::TabPosition &p); QScriptValue TabShapeScriptValue(QScriptEngine *engine, const enum QTabWidget::TabShape &p); class QTabWidgetProto : public QObject, public QScriptable { Q_OBJECT public: QTabWidgetProto(QObject *parent); Q_INVOKABLE int addTab(QWidget *page, const QString &label); Q_INVOKABLE int addTab(QWidget *page, const QIcon &icon, const QString &label); Q_INVOKABLE void clear(); Q_INVOKABLE QWidget *cornerWidget(int corner = 1) const; Q_INVOKABLE int count() const; Q_INVOKABLE int currentIndex() const; Q_INVOKABLE QWidget *currentWidget() const; #if QT_VERSION >= 0x040500 Q_INVOKABLE bool documentMode() const; #endif Q_INVOKABLE int elideMode() const; Q_INVOKABLE QSize iconSize() const; Q_INVOKABLE int indexOf(QWidget *w) const; Q_INVOKABLE int insertTab(int index, QWidget *page, const QString &label); Q_INVOKABLE int insertTab(int index, QWidget *page, const QIcon &icon, const QString & label); #if QT_VERSION >= 0x040500 Q_INVOKABLE bool isMovable() const; #endif Q_INVOKABLE bool isTabEnabled(int index) const; Q_INVOKABLE void removeTab(int index); Q_INVOKABLE void setCornerWidget(QWidget *widget, int corner = 1); #if QT_VERSION >= 0x040500 Q_INVOKABLE void setDocumentMode(bool set); #endif Q_INVOKABLE void setElideMode(int); Q_INVOKABLE void setIconSize(const QSize &size); #if QT_VERSION >= 0x040500 Q_INVOKABLE void setMovable(bool movable); #endif Q_INVOKABLE void setTabEnabled(int index, bool enable); Q_INVOKABLE void setTabIcon(int index, const QIcon &icon); Q_INVOKABLE void setTabPosition(int position); Q_INVOKABLE void setTabShape(int s); Q_INVOKABLE void setTabText(int index, const QString &label); Q_INVOKABLE void setTabToolTip(int index, const QString &tip); Q_INVOKABLE void setTabWhatsThis(int index, const QString &text); #if QT_VERSION >= 0x040500 Q_INVOKABLE void setTabsClosable(bool closeable); #endif Q_INVOKABLE void setUsesScrollButtons(bool useButtons); Q_INVOKABLE QIcon tabIcon(int index) const; Q_INVOKABLE int tabPosition() const; Q_INVOKABLE int tabShape() const; Q_INVOKABLE QString tabText(int index) const; Q_INVOKABLE QString tabToolTip(int index) const; Q_INVOKABLE QString tabWhatsThis(int index) const; #if QT_VERSION >= 0x040500 Q_INVOKABLE bool tabsClosable() const; #endif Q_INVOKABLE bool usesScrollButtons() const; Q_INVOKABLE QWidget *widget(int index) const; }; #endif qt-client-4.1.0/scriptapi/qtextdocumentproto.cpp000066400000000000000000000243701217451700100221120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qtextdocumentproto.h" #include void setupQTextDocumentProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QTextDocumentProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); // engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQTextDocument, proto); engine->globalObject().setProperty("QTextDocument", constructor); } QScriptValue constructQTextDocument(QScriptContext *context, QScriptEngine *engine) { QTextDocument *obj = 0; switch (context->argumentCount()) { case 0: obj = new QTextDocument(); break; case 1: obj = new QTextDocument(context->argument(0).toQObject()); break; case 2: default: obj = new QTextDocument(context->argument(0).toString(), context->argument(0).toQObject()); break; } return engine->toScriptValue(obj); } QTextDocumentProto::QTextDocumentProto(QObject *parent) : QObject(parent) { } void QTextDocumentProto::addResource(int type, const QUrl &name, const QVariant &resource) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->addResource(type, name, resource); } void QTextDocumentProto::adjustSize() { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->adjustSize(); } QVector QTextDocumentProto::allFormats() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->allFormats(); return QVector(); } QTextBlock QTextDocumentProto::begin() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->begin(); return QTextBlock(); } QChar QTextDocumentProto::characterAt(int pos) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->characterAt(pos); return QChar(); } int QTextDocumentProto::characterCount() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->characterCount(); return 0; } void QTextDocumentProto::clear() { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } QTextDocument *QTextDocumentProto::clone(QObject *parent) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->clone(parent); return 0; } QAbstractTextDocumentLayout *QTextDocumentProto::documentLayout() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->documentLayout(); return 0; } void QTextDocumentProto::drawContents(QPainter *p, const QRectF &rect) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->drawContents(p, rect); } QTextBlock QTextDocumentProto::end() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->end(); return QTextBlock(); } QTextCursor QTextDocumentProto::find(const QString &subString, const QTextCursor &cursor, int options) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->find(subString, cursor, (QTextDocument::FindFlags)options); return QTextCursor(); } QTextCursor QTextDocumentProto::find(const QRegExp &expr, const QTextCursor &cursor, int options) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->find(expr, cursor, (QTextDocument::FindFlags)options); return QTextCursor(); } QTextCursor QTextDocumentProto::find(const QString &subString, int position, int options) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->find(subString, position, (QTextDocument::FindFlags)options); return QTextCursor(); } QTextCursor QTextDocumentProto::find(const QRegExp &expr, int position, int options) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->find(expr, position, (QTextDocument::FindFlags)options); return QTextCursor(); } QTextBlock QTextDocumentProto::findBlock(int pos) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->findBlock(pos); return QTextBlock(); } QTextBlock QTextDocumentProto::findBlockByLineNumber(int lineNumber) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->findBlockByLineNumber(lineNumber); return QTextBlock(); } QTextBlock QTextDocumentProto::findBlockByNumber(int blockNumber) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->findBlockByNumber(blockNumber); return QTextBlock(); } QTextBlock QTextDocumentProto::firstBlock() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->firstBlock(); return QTextBlock(); } qreal QTextDocumentProto::idealWidth() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->idealWidth(); return qreal(); } bool QTextDocumentProto::isEmpty() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return false; } bool QTextDocumentProto::isRedoAvailable() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isRedoAvailable(); return false; } bool QTextDocumentProto::isUndoAvailable() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->isUndoAvailable(); return false; } QTextBlock QTextDocumentProto::lastBlock() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->lastBlock(); return QTextBlock(); } int QTextDocumentProto::lineCount() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->lineCount(); return 0; } void QTextDocumentProto::markContentsDirty(int position, int length) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->markContentsDirty(position, length); } QString QTextDocumentProto::metaInformation(int info) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->metaInformation((QTextDocument::MetaInformation)info); return QString(); } QTextObject *QTextDocumentProto::object(int objectIndex) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->object(objectIndex); return 0; } QTextObject *QTextDocumentProto::objectForFormat(const QTextFormat &f) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->objectForFormat(f); return 0; } int QTextDocumentProto::pageCount() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->pageCount(); return 0; } void QTextDocumentProto::print(QPrinter *printer) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->print(printer); } void QTextDocumentProto::redo(QTextCursor *cursor) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->redo(cursor); } QVariant QTextDocumentProto::resource(int type, const QUrl &name) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->resource(type, name); return QVariant(); } int QTextDocumentProto::revision() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->revision(); return 0; } QTextFrame *QTextDocumentProto::rootFrame() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->rootFrame(); return 0; } void QTextDocumentProto::setDefaultFont(const QFont &font) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->setDefaultFont(font); } void QTextDocumentProto::setDocumentLayout(QAbstractTextDocumentLayout *layout) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->setDocumentLayout(layout); } void QTextDocumentProto::setHtml(const QString &html) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->setHtml(html); } void QTextDocumentProto::setMetaInformation(int info, const QString &string) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->setMetaInformation((QTextDocument::MetaInformation)info, string); } void QTextDocumentProto::setPlainText(const QString &text) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->setPlainText(text); } QString QTextDocumentProto::toHtml(const QByteArray &encoding) const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toHtml(encoding); return QString(); } QString QTextDocumentProto::toPlainText() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toPlainText(); return QString(); } void QTextDocumentProto::undo(QTextCursor *cursor) { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) item->undo(cursor); } QString QTextDocumentProto::toString() const { QTextDocument *item = qscriptvalue_cast(thisObject()); if (item) return item->toPlainText(); return QString(); } qt-client-4.1.0/scriptapi/qtextdocumentproto.h000066400000000000000000000077321217451700100215620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QTEXTDOCUMENTPROTO_H__ #define __QTEXTDOCUMENTPROTO_H__ #include #include #include #include #include #include #include #include #include #include #include class QString; Q_DECLARE_METATYPE(QTextDocument*) //Q_DECLARE_METATYPE(QTextDocument) void setupQTextDocumentProto(QScriptEngine *engine); QScriptValue constructQTextDocument(QScriptContext *context, QScriptEngine *engine); class QTextDocumentProto : public QObject, public QScriptable { Q_OBJECT public: QTextDocumentProto(QObject *parent); Q_INVOKABLE void addResource(int type, const QUrl &name, const QVariant &resource); Q_INVOKABLE void adjustSize(); Q_INVOKABLE QVector allFormats() const; Q_INVOKABLE QTextBlock begin() const; Q_INVOKABLE QChar characterAt(int pos) const; Q_INVOKABLE int characterCount() const; Q_INVOKABLE void clear(); Q_INVOKABLE QTextDocument *clone(QObject *parent = 0) const; Q_INVOKABLE QAbstractTextDocumentLayout *documentLayout() const; Q_INVOKABLE void drawContents(QPainter *p, const QRectF &rect = QRectF()); Q_INVOKABLE QTextBlock end() const; Q_INVOKABLE QTextCursor find(const QString &subString, const QTextCursor &cursor, int options = 0) const; Q_INVOKABLE QTextCursor find(const QRegExp &expr, const QTextCursor &cursor, int options = 0) const; Q_INVOKABLE QTextCursor find(const QString &subString, int position = 0, int options = 0) const; Q_INVOKABLE QTextCursor find(const QRegExp &expr, int position = 0, int options = 0) const; Q_INVOKABLE QTextBlock findBlock(int pos) const; Q_INVOKABLE QTextBlock findBlockByLineNumber(int lineNumber) const; Q_INVOKABLE QTextBlock findBlockByNumber(int blockNumber) const; Q_INVOKABLE QTextBlock firstBlock() const; Q_INVOKABLE qreal idealWidth() const; Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE bool isRedoAvailable() const; Q_INVOKABLE bool isUndoAvailable() const; Q_INVOKABLE QTextBlock lastBlock() const; Q_INVOKABLE int lineCount() const; Q_INVOKABLE void markContentsDirty(int position, int length); Q_INVOKABLE QString metaInformation(int info) const; Q_INVOKABLE QTextObject *object(int objectIndex) const; Q_INVOKABLE QTextObject *objectForFormat(const QTextFormat &f) const; Q_INVOKABLE int pageCount() const; Q_INVOKABLE void print(QPrinter *printer) const; Q_INVOKABLE void redo(QTextCursor *cursor); Q_INVOKABLE QVariant resource(int type, const QUrl &name) const; Q_INVOKABLE int revision() const; Q_INVOKABLE QTextFrame *rootFrame() const; Q_INVOKABLE void setDefaultFont(const QFont &font); Q_INVOKABLE void setDocumentLayout(QAbstractTextDocumentLayout *layout); Q_INVOKABLE void setHtml(const QString &html); Q_INVOKABLE void setMetaInformation(int info, const QString &string); Q_INVOKABLE void setPlainText(const QString &text); Q_INVOKABLE QString toHtml(const QByteArray &encoding = QByteArray()) const; Q_INVOKABLE QString toPlainText() const; Q_INVOKABLE void undo(QTextCursor *cursor); Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qtexteditproto.cpp000066400000000000000000000161111217451700100212130ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which (including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #include "qtexteditproto.h" #include #define DEBUG false void setupQTextEditProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QTextEditProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQTextEdit, proto); engine->globalObject().setProperty("QTextEdit", constructor); } QScriptValue constructQTextEdit(QScriptContext *context, QScriptEngine *engine) { QTextEdit *obj = 0; switch (context->argumentCount()) { case 0: obj = new QTextEdit(); break; case 1: obj = new QTextEdit(qobject_cast(context->argument(0).toQObject())); break; case 2: default: obj = new QTextEdit(context->argument(0).toString(), qobject_cast(context->argument(0).toQObject())); break; } return engine->toScriptValue(obj); } QTextEditProto::QTextEditProto(QObject *parent) : QObject(parent) { } int QTextEditProto::alignment() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->alignment(); return 0; } QString QTextEditProto::anchorAt(const QPoint &pos) const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->anchorAt(pos); return QString(); } bool QTextEditProto::canPaste() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->canPaste(); return false; } QMenu *QTextEditProto::createStandardContextMenu() { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->createStandardContextMenu(); return 0; } QMenu *QTextEditProto::createStandardContextMenu(const QPoint &position) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->createStandardContextMenu(position); return 0; } QTextCharFormat QTextEditProto::currentCharFormat() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->currentCharFormat(); return QTextCharFormat(); } QFont QTextEditProto::currentFont() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->currentFont(); return QFont(); } QTextCursor QTextEditProto::cursorForPosition(const QPoint &pos) const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->cursorForPosition(pos); return QTextCursor(); } QRect QTextEditProto::cursorRect(const QTextCursor &cursor) const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->cursorRect(cursor); return QRect(); } QRect QTextEditProto::cursorRect() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->cursorRect(); return QRect(); } QTextDocument *QTextEditProto::document() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (DEBUG) qDebug("QTextEditProto::document() item = %p", item); if (item) { if (DEBUG) qDebug("QTextEditProto::document() item->document() = %p", item->document()); return item->document(); } return 0; } void QTextEditProto::ensureCursorVisible() { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) item->ensureCursorVisible(); } bool QTextEditProto::find(const QString &exp, int options) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->find(exp, (QTextDocument::FindFlag)options); return false; } QString QTextEditProto::fontFamily() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->fontFamily(); return QString(); } bool QTextEditProto::fontItalic() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->fontItalic(); return false; } qreal QTextEditProto::fontPointSize() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->fontPointSize(); return qreal(); } bool QTextEditProto::fontUnderline() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->fontUnderline(); return false; } int QTextEditProto::fontWeight() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->fontWeight(); return 0; } QVariant QTextEditProto::loadResource(int type, const QUrl &name) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->loadResource(type, name); return QVariant(); } void QTextEditProto::mergeCurrentCharFormat(const QTextCharFormat &modifier) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) item->mergeCurrentCharFormat(modifier); } void QTextEditProto::moveCursor(int operation, int mode) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) item->moveCursor((QTextCursor::MoveOperation)operation, (QTextCursor::MoveMode)mode); } void QTextEditProto::print(QPrinter *printer) const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) item->print(printer); } void QTextEditProto::setCurrentCharFormat(const QTextCharFormat &format) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) item->setCurrentCharFormat(format); } void QTextEditProto::setDocument(QTextDocument *document) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) item->setDocument(document); } void QTextEditProto::setTextCursor(const QTextCursor &cursor) { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) item->setTextCursor(cursor); } QColor QTextEditProto::textBackgroundColor() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->textBackgroundColor(); return QColor(); } QColor QTextEditProto::textColor() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->textColor(); return QColor(); } QTextCursor QTextEditProto::textCursor() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return item->textCursor(); return QTextCursor(); } QString QTextEditProto::toString() const { QTextEdit *item = qscriptvalue_cast(thisObject()); if (item) return QString("[ QTextEdit starting: %1... ]").arg(item->toPlainText().left(50)); return QString("QTextEdit(unknown)"); } qt-client-4.1.0/scriptapi/qtexteditproto.h000066400000000000000000000060341217451700100206630ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which (including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #ifndef __QTEXTEDITPROTO_H__ #define __QTEXTEDITPROTO_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include class QString; Q_DECLARE_METATYPE(QTextEdit*) //Q_DECLARE_METATYPE(QTextEdit) void setupQTextEditProto(QScriptEngine *engine); QScriptValue constructQTextEdit(QScriptContext *context, QScriptEngine *engine); class QTextEditProto : public QObject, public QScriptable { Q_OBJECT public: QTextEditProto(QObject *parent); Q_INVOKABLE int alignment() const; Q_INVOKABLE QString anchorAt(const QPoint &pos) const; Q_INVOKABLE bool canPaste() const; Q_INVOKABLE QMenu *createStandardContextMenu(); Q_INVOKABLE QMenu *createStandardContextMenu(const QPoint &position); Q_INVOKABLE QTextCharFormat currentCharFormat() const; Q_INVOKABLE QFont currentFont() const; Q_INVOKABLE QTextCursor cursorForPosition(const QPoint &pos) const; Q_INVOKABLE QRect cursorRect(const QTextCursor &cursor) const; Q_INVOKABLE QRect cursorRect() const; Q_INVOKABLE QTextDocument *document() const; Q_INVOKABLE void ensureCursorVisible(); // QList extraSelections() const; Q_INVOKABLE bool find(const QString &exp, int options = 0); Q_INVOKABLE QString fontFamily() const; Q_INVOKABLE bool fontItalic() const; Q_INVOKABLE qreal fontPointSize() const; Q_INVOKABLE bool fontUnderline() const; Q_INVOKABLE int fontWeight() const; Q_INVOKABLE QVariant loadResource(int type, const QUrl &name); Q_INVOKABLE void mergeCurrentCharFormat(const QTextCharFormat &modifier); Q_INVOKABLE void moveCursor(int operation, int mode = QTextCursor::MoveAnchor); Q_INVOKABLE void print(QPrinter *printer) const; Q_INVOKABLE void setCurrentCharFormat(const QTextCharFormat &format); Q_INVOKABLE void setDocument(QTextDocument *document); // void setExtraSelections(const QList &selections); Q_INVOKABLE void setTextCursor(const QTextCursor &cursor); Q_INVOKABLE QColor textBackgroundColor() const; Q_INVOKABLE QColor textColor() const; Q_INVOKABLE QTextCursor textCursor() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qtimerproto.cpp000066400000000000000000000055371217451700100205130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qtimerproto.h" QScriptValue QTimertoScriptValue(QScriptEngine *engine, QTimer* const &item) { return engine->newQObject(item); } void QTimerfromScriptValue(const QScriptValue &obj, QTimer* &item) { item = qobject_cast(obj.toQObject()); } void setupQTimerProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QTimertoScriptValue, QTimerfromScriptValue); QScriptValue proto = engine->newQObject(new QTimerProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQTimer, proto); engine->globalObject().setProperty("QTimer", constructor); } QScriptValue constructQTimer(QScriptContext *context, QScriptEngine *engine) { QTimer *obj = 0; if (context->argumentCount() == 1 && context->argument(0).isQObject()) obj = new QTimer(context->argument(0).toQObject()); else obj = new QTimer(); return engine->toScriptValue(obj); } QTimerProto::QTimerProto(QObject *parent) : QObject(parent) { } int QTimerProto::interval() const { QTimer *item = qscriptvalue_cast(thisObject()); if (item) return item->interval(); return -1; } void QTimerProto::setInterval(int msec) { QTimer *item = qscriptvalue_cast(thisObject()); if (item) item->setInterval(msec); } void QTimerProto::setSingleShot(bool single) { QTimer *item = qscriptvalue_cast(thisObject()); if (item) item->setSingleShot(single); } bool QTimerProto::isActive() const { QTimer *item = qscriptvalue_cast(thisObject()); if (item) return item->isActive(); return false; } bool QTimerProto::isSingleShot() const { QTimer *item = qscriptvalue_cast(thisObject()); if (item) return item->isSingleShot(); return false; } int QTimerProto::timerId() const { QTimer *item = qscriptvalue_cast(thisObject()); if (item) return item->timerId(); return -1; } void QTimerProto::start(int msec) { QTimer *item = qscriptvalue_cast(thisObject()); if (item) item->start(msec); } void QTimerProto::start() { QTimer *item = qscriptvalue_cast(thisObject()); if (item) item->start(); } void QTimerProto::stop() { QTimer *item = qscriptvalue_cast(thisObject()); if (item) item->stop(); } qt-client-4.1.0/scriptapi/qtimerproto.h000066400000000000000000000025661217451700100201570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QTIMERPROTO_H__ #define __QTIMERPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QTimer*) //Q_DECLARE_METATYPE(QTimer) void setupQTimerProto(QScriptEngine *engine); QScriptValue constructQTimer(QScriptContext *context, QScriptEngine *engine); class QTimerProto : public QObject, public QScriptable { Q_OBJECT Q_PROPERTY(bool active READ isActive) Q_PROPERTY(int interval READ interval WRITE setInterval) Q_PROPERTY(bool singleShot READ isSingleShot WRITE setSingleShot) public: QTimerProto(QObject *parent); int interval() const; Q_INVOKABLE bool isActive() const; Q_INVOKABLE bool isSingleShot() const; Q_INVOKABLE void setInterval(int); Q_INVOKABLE void setSingleShot(bool); Q_INVOKABLE int timerId() const; public slots: void start(int); void start(); void stop(); //signals: // void timeout(); }; #endif qt-client-4.1.0/scriptapi/qtoolbarproto.cpp000066400000000000000000000051611217451700100210260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qtoolbarproto.h" #include QScriptValue QToolBartoScriptValue(QScriptEngine *engine, QToolBar* const &item) { return engine->newQObject(item); } void QToolBarfromScriptValue(const QScriptValue &obj, QToolBar* &item) { item = qobject_cast(obj.toQObject()); } void setupQToolBarProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QToolBartoScriptValue, QToolBarfromScriptValue); QScriptValue proto = engine->newQObject(new QToolBarProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQToolBar, proto); engine->globalObject().setProperty("QToolBar", constructor); } QScriptValue constructQToolBar(QScriptContext * context, QScriptEngine *engine) { QToolBar *obj = 0; if (context->argumentCount() >= 2 && context->argument(1).isQObject()) obj = new QToolBar(context->argument(0).toString(), qobject_cast(context->argument(1).toQObject())); else if(context->argumentCount() == 1 && context->argument(0).isQObject()) obj = new QToolBar(qobject_cast(context->argument(0).toQObject())); else if(context->argumentCount() == 1) obj = new QToolBar(context->argument(0).toString()); else obj = new QToolBar(); return engine->toScriptValue(obj); } QToolBarProto::QToolBarProto(QObject *parent) : QObject(parent) { } void QToolBarProto::addAction( QAction * action ) { QToolBar *item = qscriptvalue_cast(thisObject()); if (item) item->addAction(action); } void QToolBarProto::addWidget( QWidget * widget ) { QToolBar *item = qscriptvalue_cast(thisObject()); if (item) item->addWidget(widget); } QWidget * QToolBarProto::widgetForAction ( QAction * action ) const { QToolBar *item = qscriptvalue_cast(thisObject()); if (item) return item->widgetForAction(action); return 0; } QAction * QToolBarProto::insertWidget ( QAction * before, QWidget * widget ) { QToolBar *item = qscriptvalue_cast(thisObject()); if (item) return item->insertWidget(before, widget); return 0; } qt-client-4.1.0/scriptapi/qtoolbarproto.h000066400000000000000000000022321217451700100204670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QTOOLBARPROTO_H__ #define __QTOOLBARPROTO_H__ #include #include Q_DECLARE_METATYPE(QToolBar*) //Q_DECLARE_METATYPE(QToolBar) void setupQToolBarProto(QScriptEngine *engine); QScriptValue constructQToolBar(QScriptContext *context, QScriptEngine *engine); class QToolBarProto : public QObject, public QScriptable { Q_OBJECT public: QToolBarProto(QObject *parent); Q_INVOKABLE void addAction ( QAction * action ); Q_INVOKABLE void addWidget ( QWidget * widget ); Q_INVOKABLE QWidget * widgetForAction ( QAction * action ) const; Q_INVOKABLE QAction * insertWidget ( QAction * before, QWidget * widget ); // TODO: fill in the rest of the function this class has }; #endif qt-client-4.1.0/scriptapi/qtreewidgetitemproto.cpp000066400000000000000000000471561217451700100224200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qtreewidgetitemproto.h" #include void setupQTreeWidgetItemProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QTreeWidgetItemProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQTreeWidgetItem, proto); engine->globalObject().setProperty("QTreeWidgetItem", constructor); QScriptValue widget = engine->newObject(); widget.setProperty("ShowIndicator", QScriptValue(engine, QTreeWidgetItem::ShowIndicator), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DontShowIndicator", QScriptValue(engine, QTreeWidgetItem::DontShowIndicator), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DontShowIndicatorWhenChildless",QScriptValue(engine, QTreeWidgetItem::DontShowIndicatorWhenChildless), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Type", QScriptValue(engine, QTreeWidgetItem::Type), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UserType", QScriptValue(engine, QTreeWidgetItem::UserType), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("OrderLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue constructQTreeWidgetItem(QScriptContext *context, QScriptEngine *engine) { QTreeWidgetItem *obj = 0; if (context->argumentCount() == 0) obj = new QTreeWidgetItem(); else if (context->argumentCount() == 1 && context->argument(0).isNumber()) obj = new QTreeWidgetItem(context->argument(0).toInt32()); else if (context->argumentCount() == 1 && context->argument(0).isQObject() && qobject_cast(context->argument(0).toQObject())) obj = new QTreeWidgetItem(qobject_cast(context->argument(0).toQObject())); else if (context->argumentCount() == 1 && context->argument(0).isObject() && qscriptvalue_cast(context->argument(0).toObject())) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject())); /* else if (context->argumentCount() == 1 && context->argument(0).isObject() && qscriptvalue_cast(context->argument(0).toObject())) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject())); else if (context->argumentCount() == 1 && context->argument(0).isObject() && qscriptvalue_cast(context->argument(0).toObject())) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject())); else if (context->argumentCount() == 2 context->argument(0).isQObject() && qobject_cast(context->argument(0).toQObject()) && context->argument(1).isNumber()) obj = new QTreeWidgetItem(qobject_cast(context->argument(0).toQObject()), context->argument(1).toInt32()); else if (context->argumentCount() == 2 context->argument(0).isQObject() && qscriptvalue_cast(context->argument(0).toObject()) && context->argument(1).isNumber()) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject()), context->argument(1).toInt32()); else if (context->argumentCount() == 2 && context->argument(0).isObject() && qscriptvalue_cast(context->argument(0).toObject()) && context->argument(1).isNumber()) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject()), context->argument(1).toInt32()); else if (context->argumentCount() == 2 && context->argument(0).isQObject() && qobject_cast(context->argument(0).toQObject()) && context->argument(1).isQObject() && qscriptvalue_cast(context->argument(1).toObject())) obj = new QTreeWidgetItem(qobject_cast(context->argument(0).toQObject()), qscriptvalue_cast(context->argument(1).toObject())); else if (context->argumentCount() == 2 && context->argument(0).isQObject() && qscriptvalue_cast(context->argument(0).toObject()) && context->argument(1).isQObject() && qscriptvalue_cast(context->argument(1).toObject())) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject()), qscriptvalue_cast(context->argument(1).toObject())); else if (context->argumentCount() == 2 && context->argument(0).isObject() && qscriptvalue_cast(context->argument(0).toObject()) && context->argument(1).isObject() && qscriptvalue_cast(context->argument(1).toObject())) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject()), qobject_cast(context->argument(1).toObject())); else if (context->argumentCount() == 3 context->argument(0).isQObject() && qobject_cast(context->argument(0).toQObject()) && qscriptvalue_cast(context->argument(1).toObject()) && context->argument(2).isNumber()) obj = new QTreeWidgetItem(qobject_cast(context->argument(0).toQObject()), qscriptvalue_cast(context->argument(1).toObject()), context->argument(2).toInt32()); else if (context->argumentCount() == 3 context->argument(0).isQObject() && qobject_cast(context->argument(0).toQObject()) && qscriptvalue_cast(context->argument(1).toObject()) && context->argument(2).isNumber()) obj = new QTreeWidgetItem(qobject_cast(context->argument(0).toQObject()), qscriptvalue_cast(context->argument(1).toObject()), context->argument(2).toInt32()); else if (context->argumentCount() == 3 && context->argument(0).isObject() && qscriptvalue_cast(context->argument(0).toObject()) && context->argument(1).isObject() && qscriptvalue_cast(context->argument(1).toObject()) && context->argument(2).isNumber()) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject()), qscriptvalue_cast(context->argument(1).toObject()), context->argument(2).toInt32()); else if (context->argumentCount() == 3 && context->argument(0).isObject() && qscriptvalue_cast(context->argument(0).toObject()) && context->argument(1).isObject() && qscriptvalue_cast(context->argument(1).toObject()) && context->argument(2).isNumber()) obj = new QTreeWidgetItem(qscriptvalue_cast(context->argument(0).toObject()), qscriptvalue_cast(context->argument(1).toObject()), context->argument(2).toInt32()); */ else obj = 0; return engine->toScriptValue(obj); } QTreeWidgetItemProto::QTreeWidgetItemProto(QObject *parent) : QObject(parent) { } void QTreeWidgetItemProto::addChild(QTreeWidgetItem *child) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->addChild(child); } void QTreeWidgetItemProto::addChildren(const QList &children) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->addChildren(children); } QBrush QTreeWidgetItemProto::background(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->background(column); return QBrush(); } int QTreeWidgetItemProto::checkState(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->checkState(column); return 0; } QTreeWidgetItem *QTreeWidgetItemProto::child(int index) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->child(index); return 0; } int QTreeWidgetItemProto::childCount() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->childCount(); return 0; } int QTreeWidgetItemProto::childIndicatorPolicy() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->childIndicatorPolicy(); return 0; } QTreeWidgetItem *QTreeWidgetItemProto::clone() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item ->clone(); return 0; } int QTreeWidgetItemProto::columnCount() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->columnCount(); return 0; } QVariant QTreeWidgetItemProto::data(int column, int role) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->data(column, role); return QVariant(); } int QTreeWidgetItemProto::flags() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->flags(); return 0; } QFont QTreeWidgetItemProto::font(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->font(column); return QFont(); } QBrush QTreeWidgetItemProto::foreground(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->foreground(column); return QBrush(); } QIcon QTreeWidgetItemProto::icon(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->icon(column); return QIcon(); } int QTreeWidgetItemProto::indexOfChild(QTreeWidgetItem *child) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->indexOfChild(child); return -1; } void QTreeWidgetItemProto::insertChild(int index, QTreeWidgetItem *child) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->insertChild(index, child); } void QTreeWidgetItemProto::insertChildren(int index, const QList &children) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->insertChildren(index, children); } bool QTreeWidgetItemProto::isDisabled() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->isDisabled(); return false; } bool QTreeWidgetItemProto::isExpanded() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->isExpanded(); return false; } bool QTreeWidgetItemProto::isFirstColumnSpanned() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->isFirstColumnSpanned(); return false; } bool QTreeWidgetItemProto::isHidden() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->isHidden(); return false; } bool QTreeWidgetItemProto::isSelected() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->isSelected(); return false; } QTreeWidgetItem *QTreeWidgetItemProto::parent() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item ->parent(); return 0; } void QTreeWidgetItemProto::read(QDataStream &in) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->read(in); } void QTreeWidgetItemProto::removeChild(QTreeWidgetItem *child) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->removeChild(child); } void QTreeWidgetItemProto::setBackground(int column, const QBrush &brush) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setBackground(column, brush); } void QTreeWidgetItemProto::setCheckState(int column, int state) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setCheckState(column, (Qt::CheckState)state); } void QTreeWidgetItemProto::setChildIndicatorPolicy(int policy) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setChildIndicatorPolicy((QTreeWidgetItem::ChildIndicatorPolicy)policy); } void QTreeWidgetItemProto::setData(int column, int role, const QVariant &value) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setData(column, role, value); } void QTreeWidgetItemProto::setDisabled(bool disabled) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setDisabled(disabled); } void QTreeWidgetItemProto::setExpanded(bool expand) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setExpanded(expand); } void QTreeWidgetItemProto::setFirstColumnSpanned(bool span) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setFirstColumnSpanned(span); } void QTreeWidgetItemProto::setFlags(int flags) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setFlags((Qt::ItemFlags)flags); } void QTreeWidgetItemProto::setFont(int column, const QFont &font) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setFont(column, font); } void QTreeWidgetItemProto::setForeground(int column, const QBrush &brush) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setForeground(column, brush); } void QTreeWidgetItemProto::setHidden(bool hide) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setHidden(hide); } void QTreeWidgetItemProto::setIcon(int column, const QIcon &icon) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setIcon(column, icon); } void QTreeWidgetItemProto::setSelected(bool select) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setSelected(select); } void QTreeWidgetItemProto::setSizeHint(int column, const QSize &size) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setSizeHint(column, size); } void QTreeWidgetItemProto::setStatusTip(int column, const QString &statusTip) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setStatusTip(column, statusTip); } void QTreeWidgetItemProto::setText(int column, const QString &text) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setText(column, text); } void QTreeWidgetItemProto::setTextAlignment(int column, int alignment) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setTextAlignment(column, alignment); } void QTreeWidgetItemProto::setToolTip(int column, const QString &toolTip) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setToolTip(column, toolTip); } void QTreeWidgetItemProto::setWhatsThis(int column, const QString &whatsThis) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setWhatsThis(column, whatsThis); } QSize QTreeWidgetItemProto::sizeHint(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->sizeHint(column); return QSize(); } void QTreeWidgetItemProto::sortChildren(int column, int order) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->sortChildren(column, (Qt::SortOrder)order); } QString QTreeWidgetItemProto::statusTip(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->statusTip(column); return QString(); } QTreeWidgetItem *QTreeWidgetItemProto::takeChild(int index) { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item ->takeChild(index); return 0; } QList QTreeWidgetItemProto::takeChildren() { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->takeChildren(); return QList(); } QString QTreeWidgetItemProto::text(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->text(column); return QString(); } int QTreeWidgetItemProto::textAlignment(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->textAlignment(column); return 0; } QString QTreeWidgetItemProto::toolTip(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->toolTip(column); return QString(); } QTreeWidget *QTreeWidgetItemProto::treeWidget() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->treeWidget(); return 0; } int QTreeWidgetItemProto::type() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->type(); return 0; } QString QTreeWidgetItemProto::whatsThis(int column) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->whatsThis(column); return QString(); } void QTreeWidgetItemProto::write(QDataStream &out) const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->write(out); } QString QTreeWidgetItemProto::toString() const { QTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return QString("[QTreeWidgetItem with %1 children and %2 columns]") .arg(item->childCount()) .arg(item->columnCount()); return QString(); } qt-client-4.1.0/scriptapi/qtreewidgetitemproto.h000066400000000000000000000116651217451700100220610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QTREEWIDGETITEMPROTO_H__ #define __QTREEWIDGETITEMPROTO_H__ #include #include #include #include #include #include #include #include #include #include #include Q_DECLARE_METATYPE(QTreeWidgetItem*) Q_DECLARE_METATYPE(QTreeWidgetItem) void setupQTreeWidgetItemProto(QScriptEngine *engine); QScriptValue constructQTreeWidgetItem(QScriptContext *context, QScriptEngine *engine); class QTreeWidgetItemProto : public QObject, public QScriptable { Q_OBJECT public: QTreeWidgetItemProto(QObject *parent); Q_INVOKABLE void addChild(QTreeWidgetItem * child); Q_INVOKABLE void addChildren(const QList &children); Q_INVOKABLE QBrush background(int column) const; Q_INVOKABLE int checkState(int column) const; Q_INVOKABLE QTreeWidgetItem *child(int index) const; Q_INVOKABLE int childCount() const; Q_INVOKABLE int childIndicatorPolicy() const; Q_INVOKABLE QTreeWidgetItem *clone() const; Q_INVOKABLE int columnCount() const; Q_INVOKABLE QVariant data(int column, int role) const; Q_INVOKABLE int flags() const; Q_INVOKABLE QFont font(int column) const; Q_INVOKABLE QBrush foreground(int column) const; Q_INVOKABLE QIcon icon(int column) const; Q_INVOKABLE int indexOfChild(QTreeWidgetItem *child) const; Q_INVOKABLE void insertChild(int index, QTreeWidgetItem *child); Q_INVOKABLE void insertChildren(int index, const QList &children); Q_INVOKABLE bool isDisabled() const; Q_INVOKABLE bool isExpanded() const; Q_INVOKABLE bool isFirstColumnSpanned() const; Q_INVOKABLE bool isHidden() const; Q_INVOKABLE bool isSelected() const; Q_INVOKABLE QTreeWidgetItem *parent() const; Q_INVOKABLE void read(QDataStream &in); Q_INVOKABLE void removeChild(QTreeWidgetItem *child); Q_INVOKABLE void setBackground(int column, const QBrush &brush); Q_INVOKABLE void setCheckState(int column, int state); Q_INVOKABLE void setChildIndicatorPolicy(int policy); Q_INVOKABLE void setData(int column, int role, const QVariant &value); Q_INVOKABLE void setDisabled(bool disabled); Q_INVOKABLE void setExpanded(bool expand); Q_INVOKABLE void setFirstColumnSpanned(bool span); Q_INVOKABLE void setFlags(int flags); Q_INVOKABLE void setFont(int column, const QFont &font); Q_INVOKABLE void setForeground(int column, const QBrush &brush); Q_INVOKABLE void setHidden(bool hide); Q_INVOKABLE void setIcon(int column, const QIcon &icon); Q_INVOKABLE void setSelected(bool select); Q_INVOKABLE void setSizeHint(int column, const QSize &size); Q_INVOKABLE void setStatusTip(int column, const QString &statusTip); Q_INVOKABLE void setText(int column, const QString &text); Q_INVOKABLE void setTextAlignment(int column, int alignment); Q_INVOKABLE void setToolTip(int column, const QString &toolTip); Q_INVOKABLE void setWhatsThis(int column, const QString &whatsThis); Q_INVOKABLE QSize sizeHint(int column) const; Q_INVOKABLE void sortChildren(int column, int order); Q_INVOKABLE QString statusTip(int column) const; Q_INVOKABLE QTreeWidgetItem *takeChild(int index); Q_INVOKABLE QList takeChildren(); Q_INVOKABLE QString text(int column) const; Q_INVOKABLE int textAlignment(int column) const; Q_INVOKABLE QString toolTip(int column) const; Q_INVOKABLE QTreeWidget *treeWidget() const; Q_INVOKABLE int type() const; Q_INVOKABLE QString whatsThis(int column) const; Q_INVOKABLE void write(QDataStream &out) const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/qtsetup.cpp000066400000000000000000003704531217451700100176350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qtsetup.h" void setupQt(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); qScriptRegisterMetaType(engine, AlignmentFlagtoScriptValue, AlignmentFlagfromScriptValue); widget.setProperty("AlignLeft", QScriptValue(engine, Qt::AlignLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignRight", QScriptValue(engine, Qt::AlignRight), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignHCenter", QScriptValue(engine, Qt::AlignHCenter), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignJustify", QScriptValue(engine, Qt::AlignJustify), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignTop", QScriptValue(engine, Qt::AlignTop), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignBottom", QScriptValue(engine, Qt::AlignBottom), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignVCenter", QScriptValue(engine, Qt::AlignVCenter), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignCenter", QScriptValue(engine, Qt::AlignCenter), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignAbsolute", QScriptValue(engine, Qt::AlignAbsolute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignLeading", QScriptValue(engine, Qt::AlignLeading), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignTrailing", QScriptValue(engine, Qt::AlignTrailing), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignHorizontal_Mask", QScriptValue(engine, Qt::AlignHorizontal_Mask), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AlignVertical_Mask", QScriptValue(engine, Qt::AlignVertical_Mask), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, AnchorAttributetoScriptValue, AnchorAttributefromScriptValue); widget.setProperty("AnchorName", QScriptValue(engine, Qt::AnchorName), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AnchorHref", QScriptValue(engine, Qt::AnchorHref), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ApplicationAttributetoScriptValue, ApplicationAttributefromScriptValue); widget.setProperty("AA_ImmediateWidgetCreation", QScriptValue(engine, Qt::AA_ImmediateWidgetCreation), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AA_MSWindowsUseDirect3DByDefault", QScriptValue(engine, Qt::AA_MSWindowsUseDirect3DByDefault), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AA_DontShowIconsInMenus", QScriptValue(engine, Qt::AA_DontShowIconsInMenus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AA_NativeWindows", QScriptValue(engine, Qt::AA_NativeWindows), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AA_DontCreateNativeWidgetSiblings", QScriptValue(engine, Qt::AA_DontCreateNativeWidgetSiblings), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AA_MacPluginApplication", QScriptValue(engine, Qt::AA_MacPluginApplication), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ArrowTypetoScriptValue, ArrowTypefromScriptValue); widget.setProperty("NoArrow", QScriptValue(engine, Qt::NoArrow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UpArrow", QScriptValue(engine, Qt::UpArrow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DownArrow", QScriptValue(engine, Qt::DownArrow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LeftArrow", QScriptValue(engine, Qt::LeftArrow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RightArrow", QScriptValue(engine, Qt::RightArrow), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, AspectRatioModetoScriptValue, AspectRatioModefromScriptValue); widget.setProperty("IgnoreAspectRatio", QScriptValue(engine, Qt::IgnoreAspectRatio), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("KeepAspectRatio", QScriptValue(engine, Qt::KeepAspectRatio), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("KeepAspectRatioByExpanding", QScriptValue(engine, Qt::KeepAspectRatioByExpanding), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, AxistoScriptValue, AxisfromScriptValue); widget.setProperty("XAxis", QScriptValue(engine, Qt::XAxis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("YAxis", QScriptValue(engine, Qt::YAxis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ZAxis", QScriptValue(engine, Qt::ZAxis), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, BGModetoScriptValue, BGModefromScriptValue); widget.setProperty("TransparentMode", QScriptValue(engine, Qt::TransparentMode), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OpaqueMode", QScriptValue(engine, Qt::OpaqueMode), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, BrushStyletoScriptValue, BrushStylefromScriptValue); widget.setProperty("NoBrush", QScriptValue(engine, Qt::NoBrush), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SolidPattern", QScriptValue(engine, Qt::SolidPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dense1Pattern", QScriptValue(engine, Qt::Dense1Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dense2Pattern", QScriptValue(engine, Qt::Dense2Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dense3Pattern", QScriptValue(engine, Qt::Dense3Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dense4Pattern", QScriptValue(engine, Qt::Dense4Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dense5Pattern", QScriptValue(engine, Qt::Dense5Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dense6Pattern", QScriptValue(engine, Qt::Dense6Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dense7Pattern", QScriptValue(engine, Qt::Dense7Pattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("HorPattern", QScriptValue(engine, Qt::HorPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("VerPattern", QScriptValue(engine, Qt::VerPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CrossPattern", QScriptValue(engine, Qt::CrossPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BDiagPattern", QScriptValue(engine, Qt::BDiagPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FDiagPattern", QScriptValue(engine, Qt::FDiagPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DiagCrossPattern", QScriptValue(engine, Qt::DiagCrossPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LinearGradientPattern", QScriptValue(engine, Qt::LinearGradientPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ConicalGradientPattern", QScriptValue(engine, Qt::ConicalGradientPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RadialGradientPattern", QScriptValue(engine, Qt::RadialGradientPattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TexturePattern", QScriptValue(engine, Qt::TexturePattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, CaseSensitivitytoScriptValue, CaseSensitivityfromScriptValue); widget.setProperty("CaseInsensitive", QScriptValue(engine, Qt::CaseInsensitive), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CaseSensitive", QScriptValue(engine, Qt::CaseSensitive), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, CheckStatetoScriptValue, CheckStatefromScriptValue); widget.setProperty("Unchecked", QScriptValue(engine, Qt::Unchecked), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PartiallyChecked", QScriptValue(engine, Qt::PartiallyChecked), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Checked", QScriptValue(engine, Qt::Checked), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ClipOperationtoScriptValue, ClipOperationfromScriptValue); widget.setProperty("NoClip", QScriptValue(engine, Qt::NoClip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReplaceClip", QScriptValue(engine, Qt::ReplaceClip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IntersectClip", QScriptValue(engine, Qt::IntersectClip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UniteClip", QScriptValue(engine, Qt::UniteClip), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ConnectionTypetoScriptValue, ConnectionTypefromScriptValue); widget.setProperty("DirectConnection", QScriptValue(engine, Qt::DirectConnection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("QueuedConnection", QScriptValue(engine, Qt::QueuedConnection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BlockingQueuedConnection", QScriptValue(engine, Qt::BlockingQueuedConnection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AutoConnection", QScriptValue(engine, Qt::AutoConnection), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ContextMenuPolicytoScriptValue, ContextMenuPolicyfromScriptValue); widget.setProperty("NoContextMenu", QScriptValue(engine, Qt::NoContextMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PreventContextMenu", QScriptValue(engine, Qt::PreventContextMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DefaultContextMenu", QScriptValue(engine, Qt::DefaultContextMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ActionsContextMenu", QScriptValue(engine, Qt::ActionsContextMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomContextMenu", QScriptValue(engine, Qt::CustomContextMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, CornertoScriptValue, CornerfromScriptValue); widget.setProperty("TopLeftCorner", QScriptValue(engine, Qt::TopLeftCorner), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TopRightCorner", QScriptValue(engine, Qt::TopRightCorner), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BottomLeftCorner", QScriptValue(engine, Qt::BottomLeftCorner), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BottomRightCorner", QScriptValue(engine, Qt::BottomRightCorner), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, CursorShapetoScriptValue, CursorShapefromScriptValue); widget.setProperty("ArrowCursor", QScriptValue(engine, Qt::ArrowCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UpArrowCursor", QScriptValue(engine, Qt::UpArrowCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CrossCursor", QScriptValue(engine, Qt::CrossCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WaitCursor", QScriptValue(engine, Qt::WaitCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IBeamCursor", QScriptValue(engine, Qt::IBeamCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SizeVerCursor", QScriptValue(engine, Qt::SizeVerCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SizeHorCursor", QScriptValue(engine, Qt::SizeHorCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SizeBDiagCursor", QScriptValue(engine, Qt::SizeBDiagCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SizeFDiagCursor", QScriptValue(engine, Qt::SizeFDiagCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SizeAllCursor", QScriptValue(engine, Qt::SizeAllCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BlankCursor", QScriptValue(engine, Qt::BlankCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SplitVCursor", QScriptValue(engine, Qt::SplitVCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SplitHCursor", QScriptValue(engine, Qt::SplitHCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PointingHandCursor", QScriptValue(engine, Qt::PointingHandCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ForbiddenCursor", QScriptValue(engine, Qt::ForbiddenCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OpenHandCursor", QScriptValue(engine, Qt::OpenHandCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ClosedHandCursor", QScriptValue(engine, Qt::ClosedHandCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WhatsThisCursor", QScriptValue(engine, Qt::WhatsThisCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BusyCursor", QScriptValue(engine, Qt::BusyCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BitmapCursor", QScriptValue(engine, Qt::BitmapCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, DateFormattoScriptValue, DateFormatfromScriptValue); widget.setProperty("TextDate", QScriptValue(engine, Qt::TextDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ISODate", QScriptValue(engine, Qt::ISODate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SystemLocaleShortDate", QScriptValue(engine, Qt::SystemLocaleShortDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SystemLocaleLongDate", QScriptValue(engine, Qt::SystemLocaleLongDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DefaultLocaleShortDate", QScriptValue(engine, Qt::DefaultLocaleShortDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DefaultLocaleLongDate", QScriptValue(engine, Qt::DefaultLocaleLongDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SystemLocaleDate", QScriptValue(engine, Qt::SystemLocaleDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LocaleDate", QScriptValue(engine, Qt::LocaleDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LocalDate", QScriptValue(engine, Qt::LocalDate), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, DayOfWeektoScriptValue, DayOfWeekfromScriptValue); widget.setProperty("Monday", QScriptValue(engine, Qt::Monday), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Tuesday", QScriptValue(engine, Qt::Tuesday), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Wednesday", QScriptValue(engine, Qt::Wednesday), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Thursday", QScriptValue(engine, Qt::Thursday), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Friday", QScriptValue(engine, Qt::Friday), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Saturday", QScriptValue(engine, Qt::Saturday), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Sunday", QScriptValue(engine, Qt::Sunday), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, DockWidgetAreatoScriptValue, DockWidgetAreafromScriptValue); widget.setProperty("LeftDockWidgetArea", QScriptValue(engine, Qt::LeftDockWidgetArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RightDockWidgetArea", QScriptValue(engine, Qt::RightDockWidgetArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TopDockWidgetArea", QScriptValue(engine, Qt::TopDockWidgetArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BottomDockWidgetArea", QScriptValue(engine, Qt::BottomDockWidgetArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllDockWidgetAreas", QScriptValue(engine, Qt::AllDockWidgetAreas), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoDockWidgetArea", QScriptValue(engine, Qt::NoDockWidgetArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, DropActiontoScriptValue, DropActionfromScriptValue); widget.setProperty("CopyAction", QScriptValue(engine, Qt::CopyAction), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MoveAction", QScriptValue(engine, Qt::MoveAction), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LinkAction", QScriptValue(engine, Qt::LinkAction), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ActionMask", QScriptValue(engine, Qt::ActionMask), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IgnoreAction", QScriptValue(engine, Qt::IgnoreAction), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TargetMoveAction", QScriptValue(engine, Qt::TargetMoveAction), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, EventPrioritytoScriptValue, EventPriorityfromScriptValue); widget.setProperty("HighEventPriority", QScriptValue(engine, Qt::HighEventPriority), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NormalEventPriority", QScriptValue(engine, Qt::NormalEventPriority), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LowEventPriority", QScriptValue(engine, Qt::LowEventPriority), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, FillRuletoScriptValue, FillRulefromScriptValue); widget.setProperty("OddEvenFill", QScriptValue(engine, Qt::OddEvenFill), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindingFill", QScriptValue(engine, Qt::WindingFill), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, FocusPolicytoScriptValue, FocusPolicyfromScriptValue); widget.setProperty("TabFocus", QScriptValue(engine, Qt::TabFocus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ClickFocus", QScriptValue(engine, Qt::ClickFocus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("StrongFocus", QScriptValue(engine, Qt::StrongFocus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WheelFocus", QScriptValue(engine, Qt::WheelFocus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoFocus", QScriptValue(engine, Qt::NoFocus), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, FocusReasontoScriptValue, FocusReasonfromScriptValue); widget.setProperty("MouseFocusReason", QScriptValue(engine, Qt::MouseFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TabFocusReason", QScriptValue(engine, Qt::TabFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BacktabFocusReason", QScriptValue(engine, Qt::BacktabFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ActiveWindowFocusReason", QScriptValue(engine, Qt::ActiveWindowFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PopupFocusReason", QScriptValue(engine, Qt::PopupFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ShortcutFocusReason", QScriptValue(engine, Qt::ShortcutFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MenuBarFocusReason", QScriptValue(engine, Qt::MenuBarFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OtherFocusReason", QScriptValue(engine, Qt::OtherFocusReason), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, GlobalColortoScriptValue, GlobalColorfromScriptValue); widget.setProperty("white", QScriptValue(engine, Qt::white), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("black", QScriptValue(engine, Qt::black), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("red", QScriptValue(engine, Qt::red), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("darkRed", QScriptValue(engine, Qt::darkRed), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("green", QScriptValue(engine, Qt::green), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("darkGreen", QScriptValue(engine, Qt::darkGreen), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("blue", QScriptValue(engine, Qt::blue), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("darkBlue", QScriptValue(engine, Qt::darkBlue), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("cyan", QScriptValue(engine, Qt::cyan), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("darkCyan", QScriptValue(engine, Qt::darkCyan), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("magenta", QScriptValue(engine, Qt::magenta), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("darkMagenta", QScriptValue(engine, Qt::darkMagenta), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("yellow", QScriptValue(engine, Qt::yellow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("darkYellow", QScriptValue(engine, Qt::darkYellow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("gray", QScriptValue(engine, Qt::gray), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("darkGray", QScriptValue(engine, Qt::darkGray), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("lightGray", QScriptValue(engine, Qt::lightGray), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("transparent", QScriptValue(engine, Qt::transparent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("color0", QScriptValue(engine, Qt::color0), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("color1", QScriptValue(engine, Qt::color1), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, HitTestAccuracytoScriptValue, HitTestAccuracyfromScriptValue); widget.setProperty("ExactHit", QScriptValue(engine, Qt::ExactHit), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FuzzyHit", QScriptValue(engine, Qt::FuzzyHit), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ImageConversionFlagtoScriptValue, ImageConversionFlagfromScriptValue); widget.setProperty("AutoColor", QScriptValue(engine, Qt::AutoColor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ColorOnly", QScriptValue(engine, Qt::ColorOnly), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MonoOnly", QScriptValue(engine, Qt::MonoOnly), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DiffuseDither", QScriptValue(engine, Qt::DiffuseDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OrderedDither", QScriptValue(engine, Qt::OrderedDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ThresholdDither", QScriptValue(engine, Qt::ThresholdDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ThresholdAlphaDither", QScriptValue(engine, Qt::ThresholdAlphaDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OrderedAlphaDither", QScriptValue(engine, Qt::OrderedAlphaDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DiffuseAlphaDither", QScriptValue(engine, Qt::DiffuseAlphaDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PreferDither", QScriptValue(engine, Qt::PreferDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AvoidDither", QScriptValue(engine, Qt::AvoidDither), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, InputMethodQuerytoScriptValue, InputMethodQueryfromScriptValue); widget.setProperty("ImMicroFocus", QScriptValue(engine, Qt::ImMicroFocus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ImFont", QScriptValue(engine, Qt::ImFont), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ImCursorPosition", QScriptValue(engine, Qt::ImCursorPosition), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ImSurroundingText", QScriptValue(engine, Qt::ImSurroundingText), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ImCurrentSelection", QScriptValue(engine, Qt::ImCurrentSelection), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ItemDataRoletoScriptValue, ItemDataRolefromScriptValue); widget.setProperty("DisplayRole", QScriptValue(engine, Qt::DisplayRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DecorationRole", QScriptValue(engine, Qt::DecorationRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("EditRole", QScriptValue(engine, Qt::EditRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ToolTipRole", QScriptValue(engine, Qt::ToolTipRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("StatusTipRole", QScriptValue(engine, Qt::StatusTipRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WhatsThisRole", QScriptValue(engine, Qt::WhatsThisRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SizeHintRole", QScriptValue(engine, Qt::SizeHintRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FontRole", QScriptValue(engine, Qt::FontRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextAlignmentRole", QScriptValue(engine, Qt::TextAlignmentRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BackgroundRole", QScriptValue(engine, Qt::BackgroundRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BackgroundColorRole", QScriptValue(engine, Qt::BackgroundColorRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ForegroundRole", QScriptValue(engine, Qt::ForegroundRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextColorRole", QScriptValue(engine, Qt::TextColorRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CheckStateRole", QScriptValue(engine, Qt::CheckStateRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AccessibleTextRole", QScriptValue(engine, Qt::AccessibleTextRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AccessibleDescriptionRole", QScriptValue(engine, Qt::AccessibleDescriptionRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UserRole", QScriptValue(engine, Qt::UserRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ItemFlagtoScriptValue, ItemFlagfromScriptValue); widget.setProperty("NoItemFlags", QScriptValue(engine, Qt::NoItemFlags), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemIsSelectable", QScriptValue(engine, Qt::ItemIsSelectable), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemIsEditable", QScriptValue(engine, Qt::ItemIsEditable), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemIsDragEnabled", QScriptValue(engine, Qt::ItemIsDragEnabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemIsDropEnabled", QScriptValue(engine, Qt::ItemIsDropEnabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemIsUserCheckable", QScriptValue(engine, Qt::ItemIsUserCheckable), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemIsEnabled", QScriptValue(engine, Qt::ItemIsEnabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemIsTristate", QScriptValue(engine, Qt::ItemIsTristate), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ItemSelectionModetoScriptValue, ItemSelectionModefromScriptValue); widget.setProperty("ContainsItemShape", QScriptValue(engine, Qt::ContainsItemShape), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IntersectsItemShape", QScriptValue(engine, Qt::IntersectsItemShape), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ContainsItemBoundingRect", QScriptValue(engine, Qt::ContainsItemBoundingRect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IntersectsItemBoundingRect", QScriptValue(engine, Qt::IntersectsItemBoundingRect), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, KeytoScriptValue, KeyfromScriptValue); widget.setProperty("Key_Escape", QScriptValue(engine, Qt::Key_Escape), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Tab", QScriptValue(engine, Qt::Key_Tab), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Backtab", QScriptValue(engine, Qt::Key_Backtab), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Backspace", QScriptValue(engine, Qt::Key_Backspace), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Return", QScriptValue(engine, Qt::Key_Return), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Enter", QScriptValue(engine, Qt::Key_Enter), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Insert", QScriptValue(engine, Qt::Key_Insert), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Delete", QScriptValue(engine, Qt::Key_Delete), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Pause", QScriptValue(engine, Qt::Key_Pause), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Print", QScriptValue(engine, Qt::Key_Print), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_SysReq", QScriptValue(engine, Qt::Key_SysReq), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Clear", QScriptValue(engine, Qt::Key_Clear), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Home", QScriptValue(engine, Qt::Key_Home), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_End", QScriptValue(engine, Qt::Key_End), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Left", QScriptValue(engine, Qt::Key_Left), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Up", QScriptValue(engine, Qt::Key_Up), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Right", QScriptValue(engine, Qt::Key_Right), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Down", QScriptValue(engine, Qt::Key_Down), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_PageUp", QScriptValue(engine, Qt::Key_PageUp), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_PageDown", QScriptValue(engine, Qt::Key_PageDown), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Shift", QScriptValue(engine, Qt::Key_Shift), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Control", QScriptValue(engine, Qt::Key_Control), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Meta", QScriptValue(engine, Qt::Key_Meta), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Alt", QScriptValue(engine, Qt::Key_Alt), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_AltGr", QScriptValue(engine, Qt::Key_AltGr), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_CapsLock", QScriptValue(engine, Qt::Key_CapsLock), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_NumLock", QScriptValue(engine, Qt::Key_NumLock), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_ScrollLock", QScriptValue(engine, Qt::Key_ScrollLock), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F1", QScriptValue(engine, Qt::Key_F1), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F2", QScriptValue(engine, Qt::Key_F2), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F3", QScriptValue(engine, Qt::Key_F3), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F4", QScriptValue(engine, Qt::Key_F4), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F5", QScriptValue(engine, Qt::Key_F5), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F6", QScriptValue(engine, Qt::Key_F6), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F7", QScriptValue(engine, Qt::Key_F7), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F8", QScriptValue(engine, Qt::Key_F8), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F9", QScriptValue(engine, Qt::Key_F9), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F10", QScriptValue(engine, Qt::Key_F10), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F11", QScriptValue(engine, Qt::Key_F11), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F12", QScriptValue(engine, Qt::Key_F12), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F13", QScriptValue(engine, Qt::Key_F13), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F14", QScriptValue(engine, Qt::Key_F14), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F15", QScriptValue(engine, Qt::Key_F15), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F16", QScriptValue(engine, Qt::Key_F16), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F17", QScriptValue(engine, Qt::Key_F17), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F18", QScriptValue(engine, Qt::Key_F18), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F19", QScriptValue(engine, Qt::Key_F19), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F20", QScriptValue(engine, Qt::Key_F20), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F21", QScriptValue(engine, Qt::Key_F21), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F22", QScriptValue(engine, Qt::Key_F22), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F23", QScriptValue(engine, Qt::Key_F23), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F24", QScriptValue(engine, Qt::Key_F24), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F25", QScriptValue(engine, Qt::Key_F25), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F26", QScriptValue(engine, Qt::Key_F26), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F27", QScriptValue(engine, Qt::Key_F27), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F28", QScriptValue(engine, Qt::Key_F28), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F29", QScriptValue(engine, Qt::Key_F29), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F30", QScriptValue(engine, Qt::Key_F30), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F31", QScriptValue(engine, Qt::Key_F31), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F32", QScriptValue(engine, Qt::Key_F32), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F33", QScriptValue(engine, Qt::Key_F33), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F34", QScriptValue(engine, Qt::Key_F34), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F35", QScriptValue(engine, Qt::Key_F35), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Super_L", QScriptValue(engine, Qt::Key_Super_L), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Super_R", QScriptValue(engine, Qt::Key_Super_R), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Menu", QScriptValue(engine, Qt::Key_Menu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hyper_L", QScriptValue(engine, Qt::Key_Hyper_L), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hyper_R", QScriptValue(engine, Qt::Key_Hyper_R), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Help", QScriptValue(engine, Qt::Key_Help), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Direction_L", QScriptValue(engine, Qt::Key_Direction_L), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Direction_R", QScriptValue(engine, Qt::Key_Direction_R), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Space", QScriptValue(engine, Qt::Key_Space), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Any", QScriptValue(engine, Qt::Key_Any), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Exclam", QScriptValue(engine, Qt::Key_Exclam), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_QuoteDbl", QScriptValue(engine, Qt::Key_QuoteDbl), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_NumberSign", QScriptValue(engine, Qt::Key_NumberSign), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dollar", QScriptValue(engine, Qt::Key_Dollar), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Percent", QScriptValue(engine, Qt::Key_Percent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ampersand", QScriptValue(engine, Qt::Key_Ampersand), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Apostrophe", QScriptValue(engine, Qt::Key_Apostrophe), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_ParenLeft", QScriptValue(engine, Qt::Key_ParenLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_ParenRight", QScriptValue(engine, Qt::Key_ParenRight), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Asterisk", QScriptValue(engine, Qt::Key_Asterisk), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Plus", QScriptValue(engine, Qt::Key_Plus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Comma", QScriptValue(engine, Qt::Key_Comma), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Minus", QScriptValue(engine, Qt::Key_Minus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Period", QScriptValue(engine, Qt::Key_Period), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Slash", QScriptValue(engine, Qt::Key_Slash), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_0", QScriptValue(engine, Qt::Key_0), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_1", QScriptValue(engine, Qt::Key_1), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_2", QScriptValue(engine, Qt::Key_2), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_3", QScriptValue(engine, Qt::Key_3), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_4", QScriptValue(engine, Qt::Key_4), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_5", QScriptValue(engine, Qt::Key_5), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_6", QScriptValue(engine, Qt::Key_6), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_7", QScriptValue(engine, Qt::Key_7), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_8", QScriptValue(engine, Qt::Key_8), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_9", QScriptValue(engine, Qt::Key_9), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Colon", QScriptValue(engine, Qt::Key_Colon), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Semicolon", QScriptValue(engine, Qt::Key_Semicolon), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Less", QScriptValue(engine, Qt::Key_Less), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Equal", QScriptValue(engine, Qt::Key_Equal), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Greater", QScriptValue(engine, Qt::Key_Greater), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Question", QScriptValue(engine, Qt::Key_Question), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_At", QScriptValue(engine, Qt::Key_At), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_A", QScriptValue(engine, Qt::Key_A), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_B", QScriptValue(engine, Qt::Key_B), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_C", QScriptValue(engine, Qt::Key_C), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_D", QScriptValue(engine, Qt::Key_D), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_E", QScriptValue(engine, Qt::Key_E), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_F", QScriptValue(engine, Qt::Key_F), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_G", QScriptValue(engine, Qt::Key_G), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_H", QScriptValue(engine, Qt::Key_H), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_I", QScriptValue(engine, Qt::Key_I), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_J", QScriptValue(engine, Qt::Key_J), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_K", QScriptValue(engine, Qt::Key_K), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_L", QScriptValue(engine, Qt::Key_L), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_M", QScriptValue(engine, Qt::Key_M), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_N", QScriptValue(engine, Qt::Key_N), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_O", QScriptValue(engine, Qt::Key_O), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_P", QScriptValue(engine, Qt::Key_P), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Q", QScriptValue(engine, Qt::Key_Q), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_R", QScriptValue(engine, Qt::Key_R), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_S", QScriptValue(engine, Qt::Key_S), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_T", QScriptValue(engine, Qt::Key_T), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_U", QScriptValue(engine, Qt::Key_U), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_V", QScriptValue(engine, Qt::Key_V), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_W", QScriptValue(engine, Qt::Key_W), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_X", QScriptValue(engine, Qt::Key_X), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Y", QScriptValue(engine, Qt::Key_Y), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Z", QScriptValue(engine, Qt::Key_Z), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_BracketLeft", QScriptValue(engine, Qt::Key_BracketLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Backslash", QScriptValue(engine, Qt::Key_Backslash), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_BracketRight", QScriptValue(engine, Qt::Key_BracketRight), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_AsciiCircum", QScriptValue(engine, Qt::Key_AsciiCircum), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Underscore", QScriptValue(engine, Qt::Key_Underscore), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_QuoteLeft", QScriptValue(engine, Qt::Key_QuoteLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_BraceLeft", QScriptValue(engine, Qt::Key_BraceLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Bar", QScriptValue(engine, Qt::Key_Bar), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_BraceRight", QScriptValue(engine, Qt::Key_BraceRight), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_AsciiTilde", QScriptValue(engine, Qt::Key_AsciiTilde), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_nobreakspace", QScriptValue(engine, Qt::Key_nobreakspace), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_exclamdown", QScriptValue(engine, Qt::Key_exclamdown), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_cent", QScriptValue(engine, Qt::Key_cent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_sterling", QScriptValue(engine, Qt::Key_sterling), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_currency", QScriptValue(engine, Qt::Key_currency), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_yen", QScriptValue(engine, Qt::Key_yen), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_brokenbar", QScriptValue(engine, Qt::Key_brokenbar), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_section", QScriptValue(engine, Qt::Key_section), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_diaeresis", QScriptValue(engine, Qt::Key_diaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_copyright", QScriptValue(engine, Qt::Key_copyright), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_ordfeminine", QScriptValue(engine, Qt::Key_ordfeminine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_guillemotleft", QScriptValue(engine, Qt::Key_guillemotleft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_notsign", QScriptValue(engine, Qt::Key_notsign), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_hyphen", QScriptValue(engine, Qt::Key_hyphen), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_registered", QScriptValue(engine, Qt::Key_registered), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_macron", QScriptValue(engine, Qt::Key_macron), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_degree", QScriptValue(engine, Qt::Key_degree), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_plusminus", QScriptValue(engine, Qt::Key_plusminus), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_twosuperior", QScriptValue(engine, Qt::Key_twosuperior), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_threesuperior", QScriptValue(engine, Qt::Key_threesuperior), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_acute", QScriptValue(engine, Qt::Key_acute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_mu", QScriptValue(engine, Qt::Key_mu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_paragraph", QScriptValue(engine, Qt::Key_paragraph), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_periodcentered", QScriptValue(engine, Qt::Key_periodcentered), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_cedilla", QScriptValue(engine, Qt::Key_cedilla), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_onesuperior", QScriptValue(engine, Qt::Key_onesuperior), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_masculine", QScriptValue(engine, Qt::Key_masculine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_guillemotright", QScriptValue(engine, Qt::Key_guillemotright), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_onequarter", QScriptValue(engine, Qt::Key_onequarter), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_onehalf", QScriptValue(engine, Qt::Key_onehalf), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_threequarters", QScriptValue(engine, Qt::Key_threequarters), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_questiondown", QScriptValue(engine, Qt::Key_questiondown), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Agrave", QScriptValue(engine, Qt::Key_Agrave), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Aacute", QScriptValue(engine, Qt::Key_Aacute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Acircumflex", QScriptValue(engine, Qt::Key_Acircumflex), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Atilde", QScriptValue(engine, Qt::Key_Atilde), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Adiaeresis", QScriptValue(engine, Qt::Key_Adiaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Aring", QScriptValue(engine, Qt::Key_Aring), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_AE", QScriptValue(engine, Qt::Key_AE), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ccedilla", QScriptValue(engine, Qt::Key_Ccedilla), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Egrave", QScriptValue(engine, Qt::Key_Egrave), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Eacute", QScriptValue(engine, Qt::Key_Eacute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ecircumflex", QScriptValue(engine, Qt::Key_Ecircumflex), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ediaeresis", QScriptValue(engine, Qt::Key_Ediaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Igrave", QScriptValue(engine, Qt::Key_Igrave), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Iacute", QScriptValue(engine, Qt::Key_Iacute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Icircumflex", QScriptValue(engine, Qt::Key_Icircumflex), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Idiaeresis", QScriptValue(engine, Qt::Key_Idiaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_ETH", QScriptValue(engine, Qt::Key_ETH), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ntilde", QScriptValue(engine, Qt::Key_Ntilde), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ograve", QScriptValue(engine, Qt::Key_Ograve), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Oacute", QScriptValue(engine, Qt::Key_Oacute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ocircumflex", QScriptValue(engine, Qt::Key_Ocircumflex), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Otilde", QScriptValue(engine, Qt::Key_Otilde), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Odiaeresis", QScriptValue(engine, Qt::Key_Odiaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_multiply", QScriptValue(engine, Qt::Key_multiply), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ooblique", QScriptValue(engine, Qt::Key_Ooblique), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ugrave", QScriptValue(engine, Qt::Key_Ugrave), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Uacute", QScriptValue(engine, Qt::Key_Uacute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Ucircumflex", QScriptValue(engine, Qt::Key_Ucircumflex), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Udiaeresis", QScriptValue(engine, Qt::Key_Udiaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Yacute", QScriptValue(engine, Qt::Key_Yacute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_THORN", QScriptValue(engine, Qt::Key_THORN), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_ssharp", QScriptValue(engine, Qt::Key_ssharp), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_division", QScriptValue(engine, Qt::Key_division), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_ydiaeresis", QScriptValue(engine, Qt::Key_ydiaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Multi_key", QScriptValue(engine, Qt::Key_Multi_key), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Codeinput", QScriptValue(engine, Qt::Key_Codeinput), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_SingleCandidate", QScriptValue(engine, Qt::Key_SingleCandidate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_MultipleCandidate", QScriptValue(engine, Qt::Key_MultipleCandidate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_PreviousCandidate", QScriptValue(engine, Qt::Key_PreviousCandidate), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Mode_switch", QScriptValue(engine, Qt::Key_Mode_switch), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Kanji", QScriptValue(engine, Qt::Key_Kanji), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Muhenkan", QScriptValue(engine, Qt::Key_Muhenkan), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Henkan", QScriptValue(engine, Qt::Key_Henkan), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Romaji", QScriptValue(engine, Qt::Key_Romaji), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hiragana", QScriptValue(engine, Qt::Key_Hiragana), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Katakana", QScriptValue(engine, Qt::Key_Katakana), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hiragana_Katakana", QScriptValue(engine, Qt::Key_Hiragana_Katakana), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Zenkaku", QScriptValue(engine, Qt::Key_Zenkaku), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hankaku", QScriptValue(engine, Qt::Key_Hankaku), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Zenkaku_Hankaku", QScriptValue(engine, Qt::Key_Zenkaku_Hankaku), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Touroku", QScriptValue(engine, Qt::Key_Touroku), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Massyo", QScriptValue(engine, Qt::Key_Massyo), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Kana_Lock", QScriptValue(engine, Qt::Key_Kana_Lock), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Kana_Shift", QScriptValue(engine, Qt::Key_Kana_Shift), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Eisu_Shift", QScriptValue(engine, Qt::Key_Eisu_Shift), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Eisu_toggle", QScriptValue(engine, Qt::Key_Eisu_toggle), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul", QScriptValue(engine, Qt::Key_Hangul), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_Start", QScriptValue(engine, Qt::Key_Hangul_Start), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_End", QScriptValue(engine, Qt::Key_Hangul_End), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_Hanja", QScriptValue(engine, Qt::Key_Hangul_Hanja), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_Jamo", QScriptValue(engine, Qt::Key_Hangul_Jamo), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_Romaja", QScriptValue(engine, Qt::Key_Hangul_Romaja), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_Jeonja", QScriptValue(engine, Qt::Key_Hangul_Jeonja), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_Banja", QScriptValue(engine, Qt::Key_Hangul_Banja), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_PreHanja", QScriptValue(engine, Qt::Key_Hangul_PreHanja), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_PostHanja", QScriptValue(engine, Qt::Key_Hangul_PostHanja), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangul_Special", QScriptValue(engine, Qt::Key_Hangul_Special), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Grave", QScriptValue(engine, Qt::Key_Dead_Grave), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Acute", QScriptValue(engine, Qt::Key_Dead_Acute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Circumflex", QScriptValue(engine, Qt::Key_Dead_Circumflex), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Tilde", QScriptValue(engine, Qt::Key_Dead_Tilde), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Macron", QScriptValue(engine, Qt::Key_Dead_Macron), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Breve", QScriptValue(engine, Qt::Key_Dead_Breve), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Abovedot", QScriptValue(engine, Qt::Key_Dead_Abovedot), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Diaeresis", QScriptValue(engine, Qt::Key_Dead_Diaeresis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Abovering", QScriptValue(engine, Qt::Key_Dead_Abovering), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Doubleacute", QScriptValue(engine, Qt::Key_Dead_Doubleacute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Caron", QScriptValue(engine, Qt::Key_Dead_Caron), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Cedilla", QScriptValue(engine, Qt::Key_Dead_Cedilla), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Ogonek", QScriptValue(engine, Qt::Key_Dead_Ogonek), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Iota", QScriptValue(engine, Qt::Key_Dead_Iota), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Voiced_Sound", QScriptValue(engine, Qt::Key_Dead_Voiced_Sound), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Semivoiced_Sound", QScriptValue(engine, Qt::Key_Dead_Semivoiced_Sound), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Belowdot", QScriptValue(engine, Qt::Key_Dead_Belowdot), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Hook", QScriptValue(engine, Qt::Key_Dead_Hook), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Dead_Horn", QScriptValue(engine, Qt::Key_Dead_Horn), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Back", QScriptValue(engine, Qt::Key_Back), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Forward", QScriptValue(engine, Qt::Key_Forward), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Stop", QScriptValue(engine, Qt::Key_Stop), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Refresh", QScriptValue(engine, Qt::Key_Refresh), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_VolumeDown", QScriptValue(engine, Qt::Key_VolumeDown), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_VolumeMute", QScriptValue(engine, Qt::Key_VolumeMute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_VolumeUp", QScriptValue(engine, Qt::Key_VolumeUp), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_BassBoost", QScriptValue(engine, Qt::Key_BassBoost), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_BassUp", QScriptValue(engine, Qt::Key_BassUp), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_BassDown", QScriptValue(engine, Qt::Key_BassDown), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_TrebleUp", QScriptValue(engine, Qt::Key_TrebleUp), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_TrebleDown", QScriptValue(engine, Qt::Key_TrebleDown), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_MediaPlay", QScriptValue(engine, Qt::Key_MediaPlay), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_MediaStop", QScriptValue(engine, Qt::Key_MediaStop), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_MediaPrevious", QScriptValue(engine, Qt::Key_MediaPrevious), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_MediaNext", QScriptValue(engine, Qt::Key_MediaNext), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_MediaRecord", QScriptValue(engine, Qt::Key_MediaRecord), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_HomePage", QScriptValue(engine, Qt::Key_HomePage), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Favorites", QScriptValue(engine, Qt::Key_Favorites), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Search", QScriptValue(engine, Qt::Key_Search), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Standby", QScriptValue(engine, Qt::Key_Standby), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_OpenUrl", QScriptValue(engine, Qt::Key_OpenUrl), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchMail", QScriptValue(engine, Qt::Key_LaunchMail), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchMedia", QScriptValue(engine, Qt::Key_LaunchMedia), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch0", QScriptValue(engine, Qt::Key_Launch0), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch1", QScriptValue(engine, Qt::Key_Launch1), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch2", QScriptValue(engine, Qt::Key_Launch2), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch3", QScriptValue(engine, Qt::Key_Launch3), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch4", QScriptValue(engine, Qt::Key_Launch4), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch5", QScriptValue(engine, Qt::Key_Launch5), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch6", QScriptValue(engine, Qt::Key_Launch6), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch7", QScriptValue(engine, Qt::Key_Launch7), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch8", QScriptValue(engine, Qt::Key_Launch8), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Launch9", QScriptValue(engine, Qt::Key_Launch9), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchA", QScriptValue(engine, Qt::Key_LaunchA), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchB", QScriptValue(engine, Qt::Key_LaunchB), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchC", QScriptValue(engine, Qt::Key_LaunchC), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchD", QScriptValue(engine, Qt::Key_LaunchD), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchE", QScriptValue(engine, Qt::Key_LaunchE), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_LaunchF", QScriptValue(engine, Qt::Key_LaunchF), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_MediaLast", QScriptValue(engine, Qt::Key_MediaLast), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_unknown", QScriptValue(engine, Qt::Key_unknown), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Call", QScriptValue(engine, Qt::Key_Call), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Context1", QScriptValue(engine, Qt::Key_Context1), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Context2", QScriptValue(engine, Qt::Key_Context2), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Context3", QScriptValue(engine, Qt::Key_Context3), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Context4", QScriptValue(engine, Qt::Key_Context4), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Flip", QScriptValue(engine, Qt::Key_Flip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Hangup", QScriptValue(engine, Qt::Key_Hangup), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_No", QScriptValue(engine, Qt::Key_No), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Select", QScriptValue(engine, Qt::Key_Select), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Yes", QScriptValue(engine, Qt::Key_Yes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Execute", QScriptValue(engine, Qt::Key_Execute), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Printer", QScriptValue(engine, Qt::Key_Printer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Play", QScriptValue(engine, Qt::Key_Play), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Sleep", QScriptValue(engine, Qt::Key_Sleep), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Zoom", QScriptValue(engine, Qt::Key_Zoom), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Key_Cancel", QScriptValue(engine, Qt::Key_Cancel), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, KeyboardModifiertoScriptValue, KeyboardModifierfromScriptValue); widget.setProperty("NoModifier", QScriptValue(engine, Qt::NoModifier), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ShiftModifier", QScriptValue(engine, Qt::ShiftModifier), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ControlModifier", QScriptValue(engine, Qt::ControlModifier), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AltModifier", QScriptValue(engine, Qt::AltModifier), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MetaModifier", QScriptValue(engine, Qt::MetaModifier), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("KeypadModifier", QScriptValue(engine, Qt::KeypadModifier), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("GroupSwitchModifier", QScriptValue(engine, Qt::GroupSwitchModifier), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, LayoutDirectiontoScriptValue, LayoutDirectionfromScriptValue); widget.setProperty("LeftToRight", QScriptValue(engine, Qt::LeftToRight), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RightToLeft", QScriptValue(engine, Qt::RightToLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, MaskModetoScriptValue, MaskModefromScriptValue); widget.setProperty("MaskInColor", QScriptValue(engine, Qt::MaskInColor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MaskOutColor", QScriptValue(engine, Qt::MaskOutColor), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, MatchFlagtoScriptValue, MatchFlagfromScriptValue); qScriptRegisterMetaType(engine, MatchFlagstoScriptValue,MatchFlagsfromScriptValue); widget.setProperty("MatchExactly", QScriptValue(engine, Qt::MatchExactly), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchFixedString", QScriptValue(engine, Qt::MatchFixedString), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchContains", QScriptValue(engine, Qt::MatchContains), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchStartsWith", QScriptValue(engine, Qt::MatchStartsWith), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchEndsWith", QScriptValue(engine, Qt::MatchEndsWith), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchCaseSensitive", QScriptValue(engine, Qt::MatchCaseSensitive), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchRegExp", QScriptValue(engine, Qt::MatchRegExp), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchWildcard", QScriptValue(engine, Qt::MatchWildcard), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchWrap", QScriptValue(engine, Qt::MatchWrap), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MatchRecursive", QScriptValue(engine, Qt::MatchRecursive), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ModifiertoScriptValue, ModifierfromScriptValue); widget.setProperty("SHIFT", QScriptValue(engine, Qt::SHIFT), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("META", QScriptValue(engine, Qt::META), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CTRL", QScriptValue(engine, Qt::CTRL), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ALT", QScriptValue(engine, Qt::ALT), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UNICODE_ACCEL", QScriptValue(engine, Qt::UNICODE_ACCEL), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, MouseButtontoScriptValue, MouseButtonfromScriptValue); widget.setProperty("NoButton", QScriptValue(engine, Qt::NoButton), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LeftButton", QScriptValue(engine, Qt::LeftButton), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RightButton", QScriptValue(engine, Qt::RightButton), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MidButton", QScriptValue(engine, Qt::MidButton), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("XButton1", QScriptValue(engine, Qt::XButton1), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("XButton2", QScriptValue(engine, Qt::XButton2), QScriptValue::ReadOnly | QScriptValue::Undeletable); /* Designer problem -- this line causes problems with the embedded designer and testing has shown that it is not required as the conversion appear to work correctly without it. qScriptRegisterMetaType(engine, OrientationtoScriptValue, OrientationfromScriptValue); */ widget.setProperty("Horizontal", QScriptValue(engine, Qt::Horizontal), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vertical", QScriptValue(engine, Qt::Vertical), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, PenCapStyletoScriptValue, PenCapStylefromScriptValue); widget.setProperty("SquareCap", QScriptValue(engine, Qt::SquareCap), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FlatCap", QScriptValue(engine, Qt::FlatCap), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SquareCap", QScriptValue(engine, Qt::SquareCap), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RoundCap", QScriptValue(engine, Qt::RoundCap), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, PenJoinStyletoScriptValue, PenJoinStylefromScriptValue); widget.setProperty("BevelJoin", QScriptValue(engine, Qt::BevelJoin), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MiterJoin", QScriptValue(engine, Qt::MiterJoin), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BevelJoin", QScriptValue(engine, Qt::BevelJoin), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RoundJoin", QScriptValue(engine, Qt::RoundJoin), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SvgMiterJoin", QScriptValue(engine, Qt::SvgMiterJoin), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, PenStyletoScriptValue, PenStylefromScriptValue); widget.setProperty("SolidLine", QScriptValue(engine, Qt::SolidLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DashDotLine", QScriptValue(engine, Qt::DashDotLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoPen", QScriptValue(engine, Qt::NoPen), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SolidLine", QScriptValue(engine, Qt::SolidLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DashLine", QScriptValue(engine, Qt::DashLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DotLine", QScriptValue(engine, Qt::DotLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DashDotLine", QScriptValue(engine, Qt::DashDotLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DashDotDotLine", QScriptValue(engine, Qt::DashDotDotLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomDashLine", QScriptValue(engine, Qt::CustomDashLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ScrollBarPolicytoScriptValue, ScrollBarPolicyfromScriptValue); widget.setProperty("ScrollBarAsNeeded", QScriptValue(engine, Qt::ScrollBarAsNeeded), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ScrollBarAlwaysOff", QScriptValue(engine, Qt::ScrollBarAlwaysOff), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ScrollBarAlwaysOn", QScriptValue(engine, Qt::ScrollBarAlwaysOn), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ShortcutContexttoScriptValue, ShortcutContextfromScriptValue); widget.setProperty("WidgetShortcut", QScriptValue(engine, Qt::WidgetShortcut), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WidgetWithChildrenShortcut", QScriptValue(engine, Qt::WidgetWithChildrenShortcut), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowShortcut", QScriptValue(engine, Qt::WindowShortcut), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ApplicationShortcut", QScriptValue(engine, Qt::ApplicationShortcut), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, SizeHinttoScriptValue, SizeHintfromScriptValue); widget.setProperty("MinimumSize", QScriptValue(engine, Qt::MinimumSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PreferredSize", QScriptValue(engine, Qt::PreferredSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MaximumSize", QScriptValue(engine, Qt::MaximumSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MinimumDescent", QScriptValue(engine, Qt::MinimumDescent), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, SizeModetoScriptValue, SizeModefromScriptValue); widget.setProperty("AbsoluteSize", QScriptValue(engine, Qt::AbsoluteSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RelativeSize", QScriptValue(engine, Qt::RelativeSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, SortOrdertoScriptValue, SortOrderfromScriptValue); widget.setProperty("AscendingOrder", QScriptValue(engine, Qt::AscendingOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("DescendingOrder", QScriptValue(engine, Qt::DescendingOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, TextElideModetoScriptValue, TextElideModefromScriptValue); widget.setProperty("ElideLeft", QScriptValue(engine, Qt::ElideLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ElideRight", QScriptValue(engine, Qt::ElideRight), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ElideMiddle", QScriptValue(engine, Qt::ElideMiddle), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ElideNone", QScriptValue(engine, Qt::ElideNone), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ElideMiddle", QScriptValue(engine, Qt::ElideMiddle), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, TextFlagtoScriptValue, TextFlagfromScriptValue); widget.setProperty("TextSingleLine", QScriptValue(engine, Qt::TextSingleLine), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextDontClip", QScriptValue(engine, Qt::TextDontClip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextExpandTabs", QScriptValue(engine, Qt::TextExpandTabs), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextShowMnemonic", QScriptValue(engine, Qt::TextShowMnemonic), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextWordWrap", QScriptValue(engine, Qt::TextWordWrap), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextWrapAnywhere", QScriptValue(engine, Qt::TextWrapAnywhere), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextHideMnemonic", QScriptValue(engine, Qt::TextHideMnemonic), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextDontPrint", QScriptValue(engine, Qt::TextDontPrint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextIncludeTrailingSpaces", QScriptValue(engine, Qt::TextIncludeTrailingSpaces), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextJustificationForced", QScriptValue(engine, Qt::TextJustificationForced), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, TextFormattoScriptValue, TextFormatfromScriptValue); widget.setProperty("PlainText", QScriptValue(engine, Qt::PlainText), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RichText", QScriptValue(engine, Qt::RichText), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AutoText", QScriptValue(engine, Qt::AutoText), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LogText", QScriptValue(engine, Qt::LogText), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, TextInteractionFlagtoScriptValue, TextInteractionFlagfromScriptValue); widget.setProperty("NoTextInteraction", QScriptValue(engine, Qt::NoTextInteraction), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextSelectableByMouse", QScriptValue(engine, Qt::TextSelectableByMouse), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextSelectableByKeyboard", QScriptValue(engine, Qt::TextSelectableByKeyboard), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LinksAccessibleByMouse", QScriptValue(engine, Qt::LinksAccessibleByMouse), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LinksAccessibleByKeyboard", QScriptValue(engine, Qt::LinksAccessibleByKeyboard), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextEditable", QScriptValue(engine, Qt::TextEditable), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextEditorInteraction", QScriptValue(engine, Qt::TextEditorInteraction), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TextBrowserInteraction", QScriptValue(engine, Qt::TextBrowserInteraction), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, TimeSpectoScriptValue, TimeSpecfromScriptValue); widget.setProperty("LocalTime", QScriptValue(engine, Qt::LocalTime), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UTC", QScriptValue(engine, Qt::UTC), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OffsetFromUTC", QScriptValue(engine, Qt::OffsetFromUTC), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ToolBarAreatoScriptValue, ToolBarAreafromScriptValue); widget.setProperty("LeftToolBarArea", QScriptValue(engine, Qt::LeftToolBarArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RightToolBarArea", QScriptValue(engine, Qt::RightToolBarArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TopToolBarArea", QScriptValue(engine, Qt::TopToolBarArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BottomToolBarArea", QScriptValue(engine, Qt::BottomToolBarArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllToolBarAreas", QScriptValue(engine, Qt::AllToolBarAreas), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoToolBarArea", QScriptValue(engine, Qt::NoToolBarArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, ToolButtonStyletoScriptValue, ToolButtonStylefromScriptValue); widget.setProperty("ToolButtonIconOnly", QScriptValue(engine, Qt::ToolButtonIconOnly), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ToolButtonTextOnly", QScriptValue(engine, Qt::ToolButtonTextOnly), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ToolButtonTextBesideIcon", QScriptValue(engine, Qt::ToolButtonTextBesideIcon), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ToolButtonTextUnderIcon", QScriptValue(engine, Qt::ToolButtonTextUnderIcon), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, TransformationModetoScriptValue, TransformationModefromScriptValue); widget.setProperty("FastTransformation", QScriptValue(engine, Qt::FastTransformation), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SmoothTransformation", QScriptValue(engine, Qt::SmoothTransformation), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, UIEffecttoScriptValue, UIEffectfromScriptValue); widget.setProperty("UI_AnimateMenu", QScriptValue(engine, Qt::UI_AnimateMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UI_FadeMenu", QScriptValue(engine, Qt::UI_FadeMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UI_AnimateCombo", QScriptValue(engine, Qt::UI_AnimateCombo), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UI_AnimateTooltip", QScriptValue(engine, Qt::UI_AnimateTooltip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UI_FadeTooltip", QScriptValue(engine, Qt::UI_FadeTooltip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UI_AnimateToolBox", QScriptValue(engine, Qt::UI_AnimateToolBox), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, WhiteSpaceModetoScriptValue, WhiteSpaceModefromScriptValue); widget.setProperty("WhiteSpaceNormal", QScriptValue(engine, Qt::WhiteSpaceNormal), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WhiteSpacePre", QScriptValue(engine, Qt::WhiteSpacePre), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WhiteSpaceNoWrap", QScriptValue(engine, Qt::WhiteSpaceNoWrap), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, WidgetAttributetoScriptValue, WidgetAttributefromScriptValue); widget.setProperty("WA_AcceptDrops", QScriptValue(engine, Qt::WA_AcceptDrops), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_AlwaysShowToolTips", QScriptValue(engine, Qt::WA_AlwaysShowToolTips), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_ContentsPropagated", QScriptValue(engine, Qt::WA_ContentsPropagated), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_CustomWhatsThis", QScriptValue(engine, Qt::WA_CustomWhatsThis), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_DeleteOnClose", QScriptValue(engine, Qt::WA_DeleteOnClose), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_Disabled", QScriptValue(engine, Qt::WA_Disabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_ForceDisabled", QScriptValue(engine, Qt::WA_ForceDisabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_ForceUpdatesDisabled", QScriptValue(engine, Qt::WA_ForceUpdatesDisabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_GroupLeader", QScriptValue(engine, Qt::WA_GroupLeader), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_Hover", QScriptValue(engine, Qt::WA_Hover), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_InputMethodEnabled", QScriptValue(engine, Qt::WA_InputMethodEnabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_KeyboardFocusChange", QScriptValue(engine, Qt::WA_KeyboardFocusChange), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_KeyCompression", QScriptValue(engine, Qt::WA_KeyCompression), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_LayoutOnEntireRect", QScriptValue(engine, Qt::WA_LayoutOnEntireRect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_LayoutUsesWidgetRect", QScriptValue(engine, Qt::WA_LayoutUsesWidgetRect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacNoClickThrough", QScriptValue(engine, Qt::WA_MacNoClickThrough), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacOpaqueSizeGrip", QScriptValue(engine, Qt::WA_MacOpaqueSizeGrip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacShowFocusRect", QScriptValue(engine, Qt::WA_MacShowFocusRect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacNormalSize", QScriptValue(engine, Qt::WA_MacNormalSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacSmallSize", QScriptValue(engine, Qt::WA_MacSmallSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacMiniSize", QScriptValue(engine, Qt::WA_MacMiniSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacVariableSize", QScriptValue(engine, Qt::WA_MacVariableSize), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacBrushedMetal", QScriptValue(engine, Qt::WA_MacBrushedMetal), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_Mapped", QScriptValue(engine, Qt::WA_Mapped), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MouseNoMask", QScriptValue(engine, Qt::WA_MouseNoMask), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MouseTracking", QScriptValue(engine, Qt::WA_MouseTracking), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_Moved", QScriptValue(engine, Qt::WA_Moved), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MSWindowsUseDirect3D", QScriptValue(engine, Qt::WA_MSWindowsUseDirect3D), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_NoBackground", QScriptValue(engine, Qt::WA_NoBackground), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_NoChildEventsForParent", QScriptValue(engine, Qt::WA_NoChildEventsForParent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_NoChildEventsFromChildren", QScriptValue(engine, Qt::WA_NoChildEventsFromChildren), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_NoMouseReplay", QScriptValue(engine, Qt::WA_NoMouseReplay), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_NoMousePropagation", QScriptValue(engine, Qt::WA_NoMousePropagation), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_TransparentForMouseEvents", QScriptValue(engine, Qt::WA_TransparentForMouseEvents), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_NoSystemBackground", QScriptValue(engine, Qt::WA_NoSystemBackground), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_OpaquePaintEvent", QScriptValue(engine, Qt::WA_OpaquePaintEvent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_OutsideWSRange", QScriptValue(engine, Qt::WA_OutsideWSRange), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_PaintOnScreen", QScriptValue(engine, Qt::WA_PaintOnScreen), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_PaintOutsidePaintEvent", QScriptValue(engine, Qt::WA_PaintOutsidePaintEvent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_PaintUnclipped", QScriptValue(engine, Qt::WA_PaintUnclipped), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_PendingMoveEvent", QScriptValue(engine, Qt::WA_PendingMoveEvent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_PendingResizeEvent", QScriptValue(engine, Qt::WA_PendingResizeEvent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_QuitOnClose", QScriptValue(engine, Qt::WA_QuitOnClose), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_Resized", QScriptValue(engine, Qt::WA_Resized), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_RightToLeft", QScriptValue(engine, Qt::WA_RightToLeft), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_SetCursor", QScriptValue(engine, Qt::WA_SetCursor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_SetFont", QScriptValue(engine, Qt::WA_SetFont), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_SetPalette", QScriptValue(engine, Qt::WA_SetPalette), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_SetStyle", QScriptValue(engine, Qt::WA_SetStyle), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_ShowModal", QScriptValue(engine, Qt::WA_ShowModal), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_StaticContents", QScriptValue(engine, Qt::WA_StaticContents), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_StyleSheet", QScriptValue(engine, Qt::WA_StyleSheet), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_TranslucentBackground", QScriptValue(engine, Qt::WA_TranslucentBackground), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_UnderMouse", QScriptValue(engine, Qt::WA_UnderMouse), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_UpdatesDisabled", QScriptValue(engine, Qt::WA_UpdatesDisabled), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_WindowModified", QScriptValue(engine, Qt::WA_WindowModified), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_WindowPropagation", QScriptValue(engine, Qt::WA_WindowPropagation), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacAlwaysShowToolWindow", QScriptValue(engine, Qt::WA_MacAlwaysShowToolWindow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_SetLocale", QScriptValue(engine, Qt::WA_SetLocale), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_StyledBackground", QScriptValue(engine, Qt::WA_StyledBackground), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_ShowWithoutActivating", QScriptValue(engine, Qt::WA_ShowWithoutActivating), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_NativeWindow", QScriptValue(engine, Qt::WA_NativeWindow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_DontCreateNativeAncestors", QScriptValue(engine, Qt::WA_DontCreateNativeAncestors), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeDesktop", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeDesktop), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeDock", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeDock), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeToolBar", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeToolBar), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeMenu", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeUtility", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeUtility), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeSplash", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeSplash), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeDialog", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeDialog), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeDropDownMenu", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeDropDownMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypePopupMenu", QScriptValue(engine, Qt::WA_X11NetWmWindowTypePopupMenu), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeToolTip", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeToolTip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeNotification", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeNotification), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeCombo", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeCombo), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_X11NetWmWindowTypeDND", QScriptValue(engine, Qt::WA_X11NetWmWindowTypeDND), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WA_MacFrameworkScaled", QScriptValue(engine, Qt::WA_MacFrameworkScaled), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, WindowFrameSectiontoScriptValue, WindowFrameSectionfromScriptValue); widget.setProperty("NoSection", QScriptValue(engine, Qt::NoSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LeftSection", QScriptValue(engine, Qt::LeftSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TopLeftSection", QScriptValue(engine, Qt::TopLeftSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TopSection", QScriptValue(engine, Qt::TopSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TopRightSection", QScriptValue(engine, Qt::TopRightSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RightSection", QScriptValue(engine, Qt::RightSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BottomRightSection", QScriptValue(engine, Qt::BottomRightSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BottomSection", QScriptValue(engine, Qt::BottomSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BottomLeftSection", QScriptValue(engine, Qt::BottomLeftSection), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TitleBarArea", QScriptValue(engine, Qt::TitleBarArea), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, WindowModalitytoScriptValue, WindowModalityfromScriptValue); widget.setProperty("NonModal", QScriptValue(engine, Qt::NonModal), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowModal", QScriptValue(engine, Qt::WindowModal), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ApplicationModal", QScriptValue(engine, Qt::ApplicationModal), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, WindowStatetoScriptValue, WindowStatefromScriptValue); widget.setProperty("WindowNoState", QScriptValue(engine, Qt::WindowNoState), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowMinimized", QScriptValue(engine, Qt::WindowMinimized), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowMaximized", QScriptValue(engine, Qt::WindowMaximized), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowFullScreen", QScriptValue(engine, Qt::WindowFullScreen), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowActive", QScriptValue(engine, Qt::WindowActive), QScriptValue::ReadOnly | QScriptValue::Undeletable); qScriptRegisterMetaType(engine, WindowTypetoScriptValue, WindowTypefromScriptValue); widget.setProperty("Widget", QScriptValue(engine, Qt::Widget), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Window", QScriptValue(engine, Qt::Window), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Dialog", QScriptValue(engine, Qt::Dialog), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Sheet", QScriptValue(engine, Qt::Sheet), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Drawer", QScriptValue(engine, Qt::Drawer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Popup", QScriptValue(engine, Qt::Popup), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Tool", QScriptValue(engine, Qt::Tool), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ToolTip", QScriptValue(engine, Qt::ToolTip), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SplashScreen", QScriptValue(engine, Qt::SplashScreen), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Desktop", QScriptValue(engine, Qt::Desktop), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SubWindow", QScriptValue(engine, Qt::SubWindow), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MSWindowsFixedSizeDialogHint", QScriptValue(engine, Qt::MSWindowsFixedSizeDialogHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MSWindowsOwnDC", QScriptValue(engine, Qt::MSWindowsOwnDC), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("X11BypassWindowManagerHint", QScriptValue(engine, Qt::X11BypassWindowManagerHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FramelessWindowHint", QScriptValue(engine, Qt::FramelessWindowHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomizeWindowHint", QScriptValue(engine, Qt::CustomizeWindowHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowTitleHint", QScriptValue(engine, Qt::WindowTitleHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowSystemMenuHint", QScriptValue(engine, Qt::WindowSystemMenuHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowMinimizeButtonHint", QScriptValue(engine, Qt::WindowMinimizeButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowMaximizeButtonHint", QScriptValue(engine, Qt::WindowMaximizeButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowMinMaxButtonsHint", QScriptValue(engine, Qt::WindowMinMaxButtonsHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowCloseButtonHint", QScriptValue(engine, Qt::WindowCloseButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowContextHelpButtonHint", QScriptValue(engine, Qt::WindowContextHelpButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("MacWindowToolBarButtonHint", QScriptValue(engine, Qt::MacWindowToolBarButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BypassGraphicsProxyWidget", QScriptValue(engine, Qt::BypassGraphicsProxyWidget), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowShadeButtonHint", QScriptValue(engine, Qt::WindowShadeButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowStaysOnTopHint", QScriptValue(engine, Qt::WindowStaysOnTopHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowStaysOnBottomHint", QScriptValue(engine, Qt::WindowStaysOnBottomHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowOkButtonHint", QScriptValue(engine, Qt::WindowOkButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowCancelButtonHint", QScriptValue(engine, Qt::WindowCancelButtonHint), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WindowType_Mask", QScriptValue(engine, Qt::WindowType_Mask), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("Qt", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } Q_DECLARE_METATYPE(enum Qt::AlignmentFlag); Q_DECLARE_METATYPE(enum Qt::AnchorAttribute); Q_DECLARE_METATYPE(enum Qt::ApplicationAttribute); Q_DECLARE_METATYPE(enum Qt::ArrowType); Q_DECLARE_METATYPE(enum Qt::AspectRatioMode); Q_DECLARE_METATYPE(enum Qt::Axis); Q_DECLARE_METATYPE(enum Qt::BGMode); Q_DECLARE_METATYPE(enum Qt::BrushStyle); Q_DECLARE_METATYPE(enum Qt::CaseSensitivity); Q_DECLARE_METATYPE(enum Qt::CheckState); Q_DECLARE_METATYPE(enum Qt::ClipOperation); Q_DECLARE_METATYPE(enum Qt::ConnectionType); Q_DECLARE_METATYPE(enum Qt::ContextMenuPolicy); Q_DECLARE_METATYPE(enum Qt::Corner); Q_DECLARE_METATYPE(enum Qt::CursorShape); Q_DECLARE_METATYPE(enum Qt::DateFormat); Q_DECLARE_METATYPE(enum Qt::DayOfWeek); Q_DECLARE_METATYPE(enum Qt::DockWidgetArea); Q_DECLARE_METATYPE(enum Qt::DropAction); Q_DECLARE_METATYPE(enum Qt::EventPriority); Q_DECLARE_METATYPE(enum Qt::FillRule); Q_DECLARE_METATYPE(enum Qt::FocusPolicy); Q_DECLARE_METATYPE(enum Qt::FocusReason); Q_DECLARE_METATYPE(enum Qt::GlobalColor); Q_DECLARE_METATYPE(enum Qt::HitTestAccuracy); Q_DECLARE_METATYPE(enum Qt::ImageConversionFlag); Q_DECLARE_METATYPE(enum Qt::InputMethodQuery); Q_DECLARE_METATYPE(enum Qt::ItemDataRole); Q_DECLARE_METATYPE(enum Qt::ItemFlag); Q_DECLARE_METATYPE(enum Qt::ItemSelectionMode); Q_DECLARE_METATYPE(enum Qt::Key); Q_DECLARE_METATYPE(enum Qt::KeyboardModifier); Q_DECLARE_METATYPE(enum Qt::LayoutDirection); Q_DECLARE_METATYPE(enum Qt::MaskMode); Q_DECLARE_METATYPE(enum Qt::MatchFlag); Q_DECLARE_METATYPE(Qt::MatchFlags); Q_DECLARE_METATYPE(enum Qt::Modifier); Q_DECLARE_METATYPE(enum Qt::MouseButton); Q_DECLARE_METATYPE(enum Qt::Orientation); Q_DECLARE_METATYPE(enum Qt::PenCapStyle); Q_DECLARE_METATYPE(enum Qt::PenJoinStyle); Q_DECLARE_METATYPE(enum Qt::PenStyle); Q_DECLARE_METATYPE(enum Qt::ScrollBarPolicy); Q_DECLARE_METATYPE(enum Qt::ShortcutContext); Q_DECLARE_METATYPE(enum Qt::SizeHint); Q_DECLARE_METATYPE(enum Qt::SizeMode); Q_DECLARE_METATYPE(enum Qt::SortOrder); Q_DECLARE_METATYPE(enum Qt::TextElideMode); Q_DECLARE_METATYPE(enum Qt::TextFlag); Q_DECLARE_METATYPE(enum Qt::TextFormat); Q_DECLARE_METATYPE(enum Qt::TextInteractionFlag); Q_DECLARE_METATYPE(enum Qt::TimeSpec); Q_DECLARE_METATYPE(enum Qt::ToolBarArea); Q_DECLARE_METATYPE(enum Qt::ToolButtonStyle); Q_DECLARE_METATYPE(enum Qt::TransformationMode); Q_DECLARE_METATYPE(enum Qt::UIEffect); Q_DECLARE_METATYPE(enum Qt::WhiteSpaceMode); Q_DECLARE_METATYPE(enum Qt::WidgetAttribute); Q_DECLARE_METATYPE(enum Qt::WindowFrameSection); Q_DECLARE_METATYPE(enum Qt::WindowModality); Q_DECLARE_METATYPE(enum Qt::WindowState); Q_DECLARE_METATYPE(enum Qt::WindowType); QScriptValue AlignmentFlagtoScriptValue(QScriptEngine *engine, const enum Qt::AlignmentFlag &p) { return QScriptValue(engine, (int)p); } QScriptValue AnchorAttributetoScriptValue(QScriptEngine *engine, const enum Qt::AnchorAttribute &p) { return QScriptValue(engine, (int)p); } QScriptValue ApplicationAttributetoScriptValue(QScriptEngine *engine, const enum Qt::ApplicationAttribute &p) { return QScriptValue(engine, (int)p); } QScriptValue ArrowTypetoScriptValue(QScriptEngine *engine, const enum Qt::ArrowType &p) { return QScriptValue(engine, (int)p); } QScriptValue AspectRatioModetoScriptValue(QScriptEngine *engine, const enum Qt::AspectRatioMode &p) { return QScriptValue(engine, (int)p); } QScriptValue AxistoScriptValue(QScriptEngine *engine, const enum Qt::Axis &p) { return QScriptValue(engine, (int)p); } QScriptValue BGModetoScriptValue(QScriptEngine *engine, const enum Qt::BGMode &p) { return QScriptValue(engine, (int)p); } QScriptValue BrushStyletoScriptValue(QScriptEngine *engine, const enum Qt::BrushStyle &p) { return QScriptValue(engine, (int)p); } QScriptValue CaseSensitivitytoScriptValue(QScriptEngine *engine, const enum Qt::CaseSensitivity &p) { return QScriptValue(engine, (int)p); } QScriptValue CheckStatetoScriptValue(QScriptEngine *engine, const enum Qt::CheckState &p) { return QScriptValue(engine, (int)p); } QScriptValue ClipOperationtoScriptValue(QScriptEngine *engine, const enum Qt::ClipOperation &p) { return QScriptValue(engine, (int)p); } QScriptValue ConnectionTypetoScriptValue(QScriptEngine *engine, const enum Qt::ConnectionType &p) { return QScriptValue(engine, (int)p); } QScriptValue ContextMenuPolicytoScriptValue(QScriptEngine *engine, const enum Qt::ContextMenuPolicy &p) { return QScriptValue(engine, (int)p); } QScriptValue CornertoScriptValue(QScriptEngine *engine, const enum Qt::Corner &p) { return QScriptValue(engine, (int)p); } QScriptValue CursorShapetoScriptValue(QScriptEngine *engine, const enum Qt::CursorShape &p) { return QScriptValue(engine, (int)p); } QScriptValue DateFormattoScriptValue(QScriptEngine *engine, const enum Qt::DateFormat &p) { return QScriptValue(engine, (int)p); } QScriptValue DayOfWeektoScriptValue(QScriptEngine *engine, const enum Qt::DayOfWeek &p) { return QScriptValue(engine, (int)p); } QScriptValue DockWidgetAreatoScriptValue(QScriptEngine *engine, const enum Qt::DockWidgetArea &p) { return QScriptValue(engine, (int)p); } QScriptValue DropActiontoScriptValue(QScriptEngine *engine, const enum Qt::DropAction &p) { return QScriptValue(engine, (int)p); } QScriptValue EventPrioritytoScriptValue(QScriptEngine *engine, const enum Qt::EventPriority &p) { return QScriptValue(engine, (int)p); } QScriptValue FillRuletoScriptValue(QScriptEngine *engine, const enum Qt::FillRule &p) { return QScriptValue(engine, (int)p); } QScriptValue FocusPolicytoScriptValue(QScriptEngine *engine, const enum Qt::FocusPolicy &p) { return QScriptValue(engine, (int)p); } QScriptValue FocusReasontoScriptValue(QScriptEngine *engine, const enum Qt::FocusReason &p) { return QScriptValue(engine, (int)p); } QScriptValue GlobalColortoScriptValue(QScriptEngine *engine, const enum Qt::GlobalColor &p) { return QScriptValue(engine, (int)p); } QScriptValue HitTestAccuracytoScriptValue(QScriptEngine *engine, const enum Qt::HitTestAccuracy &p) { return QScriptValue(engine, (int)p); } QScriptValue ImageConversionFlagtoScriptValue(QScriptEngine *engine, const enum Qt::ImageConversionFlag &p) { return QScriptValue(engine, (int)p); } QScriptValue InputMethodQuerytoScriptValue(QScriptEngine *engine, const enum Qt::InputMethodQuery &p) { return QScriptValue(engine, (int)p); } QScriptValue ItemDataRoletoScriptValue(QScriptEngine *engine, const enum Qt::ItemDataRole &p) { return QScriptValue(engine, (int)p); } QScriptValue ItemFlagtoScriptValue(QScriptEngine *engine, const enum Qt::ItemFlag &p) { return QScriptValue(engine, (int)p); } QScriptValue ItemSelectionModetoScriptValue(QScriptEngine *engine, const enum Qt::ItemSelectionMode &p) { return QScriptValue(engine, (int)p); } QScriptValue KeytoScriptValue(QScriptEngine *engine, const enum Qt::Key &p) { return QScriptValue(engine, (int)p); } QScriptValue KeyboardModifiertoScriptValue(QScriptEngine *engine, const enum Qt::KeyboardModifier &p) { return QScriptValue(engine, (int)p); } QScriptValue LayoutDirectiontoScriptValue(QScriptEngine *engine, const enum Qt::LayoutDirection &p) { return QScriptValue(engine, (int)p); } QScriptValue MaskModetoScriptValue(QScriptEngine *engine, const enum Qt::MaskMode &p) { return QScriptValue(engine, (int)p); } QScriptValue MatchFlagtoScriptValue(QScriptEngine *engine, const enum Qt::MatchFlag &p) { return QScriptValue(engine, (int)p); } QScriptValue MatchFlagstoScriptValue(QScriptEngine *engine, const Qt::MatchFlags &p) { return QScriptValue(engine, (int)p); } QScriptValue ModifiertoScriptValue(QScriptEngine *engine, const enum Qt::Modifier &p) { return QScriptValue(engine, (int)p); } QScriptValue MouseButtontoScriptValue(QScriptEngine *engine, const enum Qt::MouseButton &p) { return QScriptValue(engine, (int)p); } /* QScriptValue OrientationtoScriptValue(QScriptEngine *engine, const enum Qt::Orientation &p) { return QScriptValue(engine, (int)p); } */ QScriptValue PenCapStyletoScriptValue(QScriptEngine *engine, const enum Qt::PenCapStyle &p) { return QScriptValue(engine, (int)p); } QScriptValue PenJoinStyletoScriptValue(QScriptEngine *engine, const enum Qt::PenJoinStyle &p) { return QScriptValue(engine, (int)p); } QScriptValue PenStyletoScriptValue(QScriptEngine *engine, const enum Qt::PenStyle &p) { return QScriptValue(engine, (int)p); } QScriptValue ScrollBarPolicytoScriptValue(QScriptEngine *engine, const enum Qt::ScrollBarPolicy &p) { return QScriptValue(engine, (int)p); } QScriptValue ShortcutContexttoScriptValue(QScriptEngine *engine, const enum Qt::ShortcutContext &p) { return QScriptValue(engine, (int)p); } QScriptValue SizeHinttoScriptValue(QScriptEngine *engine, const enum Qt::SizeHint &p) { return QScriptValue(engine, (int)p); } QScriptValue SizeModetoScriptValue(QScriptEngine *engine, const enum Qt::SizeMode &p) { return QScriptValue(engine, (int)p); } QScriptValue SortOrdertoScriptValue(QScriptEngine *engine, const enum Qt::SortOrder &p) { return QScriptValue(engine, (int)p); } QScriptValue TextElideModetoScriptValue(QScriptEngine *engine, const enum Qt::TextElideMode &p) { return QScriptValue(engine, (int)p); } QScriptValue TextFlagtoScriptValue(QScriptEngine *engine, const enum Qt::TextFlag &p) { return QScriptValue(engine, (int)p); } QScriptValue TextFormattoScriptValue(QScriptEngine *engine, const enum Qt::TextFormat &p) { return QScriptValue(engine, (int)p); } QScriptValue TextInteractionFlagtoScriptValue(QScriptEngine *engine, const enum Qt::TextInteractionFlag &p) { return QScriptValue(engine, (int)p); } QScriptValue TimeSpectoScriptValue(QScriptEngine *engine, const enum Qt::TimeSpec &p) { return QScriptValue(engine, (int)p); } QScriptValue ToolBarAreatoScriptValue(QScriptEngine *engine, const enum Qt::ToolBarArea &p) { return QScriptValue(engine, (int)p); } QScriptValue ToolButtonStyletoScriptValue(QScriptEngine *engine, const enum Qt::ToolButtonStyle &p) { return QScriptValue(engine, (int)p); } QScriptValue TransformationModetoScriptValue(QScriptEngine *engine, const enum Qt::TransformationMode &p) { return QScriptValue(engine, (int)p); } QScriptValue UIEffecttoScriptValue(QScriptEngine *engine, const enum Qt::UIEffect &p) { return QScriptValue(engine, (int)p); } QScriptValue WhiteSpaceModetoScriptValue(QScriptEngine *engine, const enum Qt::WhiteSpaceMode &p) { return QScriptValue(engine, (int)p); } QScriptValue WidgetAttributetoScriptValue(QScriptEngine *engine, const enum Qt::WidgetAttribute &p) { return QScriptValue(engine, (int)p); } QScriptValue WindowFrameSectiontoScriptValue(QScriptEngine *engine, const enum Qt::WindowFrameSection &p) { return QScriptValue(engine, (int)p); } QScriptValue WindowModalitytoScriptValue(QScriptEngine *engine, const enum Qt::WindowModality &p) { return QScriptValue(engine, (int)p); } QScriptValue WindowStatetoScriptValue(QScriptEngine *engine, const enum Qt::WindowState &p) { return QScriptValue(engine, (int)p); } QScriptValue WindowTypetoScriptValue(QScriptEngine *engine, const enum Qt::WindowType &p) { return QScriptValue(engine, (int)p); } void AlignmentFlagfromScriptValue(const QScriptValue &obj, enum Qt::AlignmentFlag &p) { p = (enum Qt::AlignmentFlag)obj.toInt32(); } void AnchorAttributefromScriptValue(const QScriptValue &obj, enum Qt::AnchorAttribute &p) { p = (enum Qt::AnchorAttribute)obj.toInt32(); } void ApplicationAttributefromScriptValue(const QScriptValue &obj, enum Qt::ApplicationAttribute &p) { p = (enum Qt::ApplicationAttribute)obj.toInt32(); } void ArrowTypefromScriptValue(const QScriptValue &obj, enum Qt::ArrowType &p) { p = (enum Qt::ArrowType)obj.toInt32(); } void AspectRatioModefromScriptValue(const QScriptValue &obj, enum Qt::AspectRatioMode &p) { p = (enum Qt::AspectRatioMode)obj.toInt32(); } void AxisfromScriptValue(const QScriptValue &obj, enum Qt::Axis &p) { p = (enum Qt::Axis)obj.toInt32(); } void BGModefromScriptValue(const QScriptValue &obj, enum Qt::BGMode &p) { p = (enum Qt::BGMode)obj.toInt32(); } void BrushStylefromScriptValue(const QScriptValue &obj, enum Qt::BrushStyle &p) { p = (enum Qt::BrushStyle)obj.toInt32(); } void CaseSensitivityfromScriptValue(const QScriptValue &obj, enum Qt::CaseSensitivity &p) { p = (enum Qt::CaseSensitivity)obj.toInt32(); } void CheckStatefromScriptValue(const QScriptValue &obj, enum Qt::CheckState &p) { p = (enum Qt::CheckState)obj.toInt32(); } void ClipOperationfromScriptValue(const QScriptValue &obj, enum Qt::ClipOperation &p) { p = (enum Qt::ClipOperation)obj.toInt32(); } void ConnectionTypefromScriptValue(const QScriptValue &obj, enum Qt::ConnectionType &p) { p = (enum Qt::ConnectionType)obj.toInt32(); } void ContextMenuPolicyfromScriptValue(const QScriptValue &obj, enum Qt::ContextMenuPolicy &p) { p = (enum Qt::ContextMenuPolicy)obj.toInt32(); } void CornerfromScriptValue(const QScriptValue &obj, enum Qt::Corner &p) { p = (enum Qt::Corner)obj.toInt32(); } void CursorShapefromScriptValue(const QScriptValue &obj, enum Qt::CursorShape &p) { p = (enum Qt::CursorShape)obj.toInt32(); } void DateFormatfromScriptValue(const QScriptValue &obj, enum Qt::DateFormat &p) { p = (enum Qt::DateFormat)obj.toInt32(); } void DayOfWeekfromScriptValue(const QScriptValue &obj, enum Qt::DayOfWeek &p) { p = (enum Qt::DayOfWeek)obj.toInt32(); } void DockWidgetAreafromScriptValue(const QScriptValue &obj, enum Qt::DockWidgetArea &p) { p = (enum Qt::DockWidgetArea)obj.toInt32(); } void DropActionfromScriptValue(const QScriptValue &obj, enum Qt::DropAction &p) { p = (enum Qt::DropAction)obj.toInt32(); } void EventPriorityfromScriptValue(const QScriptValue &obj, enum Qt::EventPriority &p) { p = (enum Qt::EventPriority)obj.toInt32(); } void FillRulefromScriptValue(const QScriptValue &obj, enum Qt::FillRule &p) { p = (enum Qt::FillRule)obj.toInt32(); } void FocusPolicyfromScriptValue(const QScriptValue &obj, enum Qt::FocusPolicy &p) { p = (enum Qt::FocusPolicy)obj.toInt32(); } void FocusReasonfromScriptValue(const QScriptValue &obj, enum Qt::FocusReason &p) { p = (enum Qt::FocusReason)obj.toInt32(); } void GlobalColorfromScriptValue(const QScriptValue &obj, enum Qt::GlobalColor &p) { p = (enum Qt::GlobalColor)obj.toInt32(); } void HitTestAccuracyfromScriptValue(const QScriptValue &obj, enum Qt::HitTestAccuracy &p) { p = (enum Qt::HitTestAccuracy)obj.toInt32(); } void ImageConversionFlagfromScriptValue(const QScriptValue &obj, enum Qt::ImageConversionFlag &p) { p = (enum Qt::ImageConversionFlag)obj.toInt32(); } void InputMethodQueryfromScriptValue(const QScriptValue &obj, enum Qt::InputMethodQuery &p) { p = (enum Qt::InputMethodQuery)obj.toInt32(); } void ItemDataRolefromScriptValue(const QScriptValue &obj, enum Qt::ItemDataRole &p) { p = (enum Qt::ItemDataRole)obj.toInt32(); } void ItemFlagfromScriptValue(const QScriptValue &obj, enum Qt::ItemFlag &p) { p = (enum Qt::ItemFlag)obj.toInt32(); } void ItemSelectionModefromScriptValue(const QScriptValue &obj, enum Qt::ItemSelectionMode &p) { p = (enum Qt::ItemSelectionMode)obj.toInt32(); } void KeyfromScriptValue(const QScriptValue &obj, enum Qt::Key &p) { p = (enum Qt::Key)obj.toInt32(); } void KeyboardModifierfromScriptValue(const QScriptValue &obj, enum Qt::KeyboardModifier &p) { p = (enum Qt::KeyboardModifier)obj.toInt32(); } void LayoutDirectionfromScriptValue(const QScriptValue &obj, enum Qt::LayoutDirection &p) { p = (enum Qt::LayoutDirection)obj.toInt32(); } void MaskModefromScriptValue(const QScriptValue &obj, enum Qt::MaskMode &p) { p = (enum Qt::MaskMode)obj.toInt32(); } void MatchFlagfromScriptValue(const QScriptValue &obj, enum Qt::MatchFlag &p) { p = (enum Qt::MatchFlag)obj.toInt32(); } void MatchFlagsfromScriptValue(const QScriptValue &obj, Qt::MatchFlags &p) { p = (Qt::MatchFlags)obj.toInt32(); } void ModifierfromScriptValue(const QScriptValue &obj, enum Qt::Modifier &p) { p = (enum Qt::Modifier)obj.toInt32(); } void MouseButtonfromScriptValue(const QScriptValue &obj, enum Qt::MouseButton &p) { p = (enum Qt::MouseButton)obj.toInt32(); } /* void OrientationfromScriptValue(const QScriptValue &obj, enum Qt::Orientation &p) { p = (enum Qt::Orientation)obj.toInt32(); } */ void PenCapStylefromScriptValue(const QScriptValue &obj, enum Qt::PenCapStyle &p) { p = (enum Qt::PenCapStyle)obj.toInt32(); } void PenJoinStylefromScriptValue(const QScriptValue &obj, enum Qt::PenJoinStyle &p) { p = (enum Qt::PenJoinStyle)obj.toInt32(); } void PenStylefromScriptValue(const QScriptValue &obj, enum Qt::PenStyle &p) { p = (enum Qt::PenStyle)obj.toInt32(); } void ScrollBarPolicyfromScriptValue(const QScriptValue &obj, enum Qt::ScrollBarPolicy &p) { p = (enum Qt::ScrollBarPolicy)obj.toInt32(); } void ShortcutContextfromScriptValue(const QScriptValue &obj, enum Qt::ShortcutContext &p) { p = (enum Qt::ShortcutContext)obj.toInt32(); } void SizeHintfromScriptValue(const QScriptValue &obj, enum Qt::SizeHint &p) { p = (enum Qt::SizeHint)obj.toInt32(); } void SizeModefromScriptValue(const QScriptValue &obj, enum Qt::SizeMode &p) { p = (enum Qt::SizeMode)obj.toInt32(); } void SortOrderfromScriptValue(const QScriptValue &obj, enum Qt::SortOrder &p) { p = (enum Qt::SortOrder)obj.toInt32(); } void TextElideModefromScriptValue(const QScriptValue &obj, enum Qt::TextElideMode &p) { p = (enum Qt::TextElideMode)obj.toInt32(); } void TextFlagfromScriptValue(const QScriptValue &obj, enum Qt::TextFlag &p) { p = (enum Qt::TextFlag)obj.toInt32(); } void TextFormatfromScriptValue(const QScriptValue &obj, enum Qt::TextFormat &p) { p = (enum Qt::TextFormat)obj.toInt32(); } void TextInteractionFlagfromScriptValue(const QScriptValue &obj, enum Qt::TextInteractionFlag &p) { p = (enum Qt::TextInteractionFlag)obj.toInt32(); } void TimeSpecfromScriptValue(const QScriptValue &obj, enum Qt::TimeSpec &p) { p = (enum Qt::TimeSpec)obj.toInt32(); } void ToolBarAreafromScriptValue(const QScriptValue &obj, enum Qt::ToolBarArea &p) { p = (enum Qt::ToolBarArea)obj.toInt32(); } void ToolButtonStylefromScriptValue(const QScriptValue &obj, enum Qt::ToolButtonStyle &p) { p = (enum Qt::ToolButtonStyle)obj.toInt32(); } void TransformationModefromScriptValue(const QScriptValue &obj, enum Qt::TransformationMode &p) { p = (enum Qt::TransformationMode)obj.toInt32(); } void UIEffectfromScriptValue(const QScriptValue &obj, enum Qt::UIEffect &p) { p = (enum Qt::UIEffect)obj.toInt32(); } void WhiteSpaceModefromScriptValue(const QScriptValue &obj, enum Qt::WhiteSpaceMode &p) { p = (enum Qt::WhiteSpaceMode)obj.toInt32(); } void WidgetAttributefromScriptValue(const QScriptValue &obj, enum Qt::WidgetAttribute &p) { p = (enum Qt::WidgetAttribute)obj.toInt32(); } void WindowFrameSectionfromScriptValue(const QScriptValue &obj, enum Qt::WindowFrameSection &p) { p = (enum Qt::WindowFrameSection)obj.toInt32(); } void WindowModalityfromScriptValue(const QScriptValue &obj, enum Qt::WindowModality &p) { p = (enum Qt::WindowModality)obj.toInt32(); } void WindowStatefromScriptValue(const QScriptValue &obj, enum Qt::WindowState &p) { p = (enum Qt::WindowState)obj.toInt32(); } void WindowTypefromScriptValue(const QScriptValue &obj, enum Qt::WindowType &p) { p = (enum Qt::WindowType)obj.toInt32(); } qt-client-4.1.0/scriptapi/qtsetup.h000066400000000000000000000266621217451700100173020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QTSETUP_H__ #define __QTSETUP_H__ #include #include #include void setupQt(QScriptEngine *engine); QScriptValue AlignmentFlagtoScriptValue(QScriptEngine *engine, const enum Qt::AlignmentFlag &p); QScriptValue AnchorAttributetoScriptValue(QScriptEngine *engine, const enum Qt::AnchorAttribute &p); QScriptValue ApplicationAttributetoScriptValue(QScriptEngine *engine, const enum Qt::ApplicationAttribute &p); QScriptValue ArrowTypetoScriptValue(QScriptEngine *engine, const enum Qt::ArrowType &p); QScriptValue AspectRatioModetoScriptValue(QScriptEngine *engine, const enum Qt::AspectRatioMode &p); QScriptValue AxistoScriptValue(QScriptEngine *engine, const enum Qt::Axis &p); QScriptValue BGModetoScriptValue(QScriptEngine *engine, const enum Qt::BGMode &p); QScriptValue BrushStyletoScriptValue(QScriptEngine *engine, const enum Qt::BrushStyle &p); QScriptValue CaseSensitivitytoScriptValue(QScriptEngine *engine, const enum Qt::CaseSensitivity &p); QScriptValue CheckStatetoScriptValue(QScriptEngine *engine, const enum Qt::CheckState &p); QScriptValue ClipOperationtoScriptValue(QScriptEngine *engine, const enum Qt::ClipOperation &p); QScriptValue ConnectionTypetoScriptValue(QScriptEngine *engine, const enum Qt::ConnectionType &p); QScriptValue ContextMenuPolicytoScriptValue(QScriptEngine *engine, const enum Qt::ContextMenuPolicy &p); QScriptValue CornertoScriptValue(QScriptEngine *engine, const enum Qt::Corner &p); QScriptValue CursorShapetoScriptValue(QScriptEngine *engine, const enum Qt::CursorShape &p); QScriptValue DateFormattoScriptValue(QScriptEngine *engine, const enum Qt::DateFormat &p); QScriptValue DayOfWeektoScriptValue(QScriptEngine *engine, const enum Qt::DayOfWeek &p); QScriptValue DockWidgetAreatoScriptValue(QScriptEngine *engine, const enum Qt::DockWidgetArea &p); QScriptValue DropActiontoScriptValue(QScriptEngine *engine, const enum Qt::DropAction &p); QScriptValue EventPrioritytoScriptValue(QScriptEngine *engine, const enum Qt::EventPriority &p); QScriptValue FillRuletoScriptValue(QScriptEngine *engine, const enum Qt::FillRule &p); QScriptValue FocusPolicytoScriptValue(QScriptEngine *engine, const enum Qt::FocusPolicy &p); QScriptValue FocusReasontoScriptValue(QScriptEngine *engine, const enum Qt::FocusReason &p); QScriptValue GlobalColortoScriptValue(QScriptEngine *engine, const enum Qt::GlobalColor &p); QScriptValue HitTestAccuracytoScriptValue(QScriptEngine *engine, const enum Qt::HitTestAccuracy &p); QScriptValue ImageConversionFlagtoScriptValue(QScriptEngine *engine, const enum Qt::ImageConversionFlag &p); QScriptValue InputMethodQuerytoScriptValue(QScriptEngine *engine, const enum Qt::InputMethodQuery &p); QScriptValue ItemDataRoletoScriptValue(QScriptEngine *engine, const enum Qt::ItemDataRole &p); QScriptValue ItemFlagtoScriptValue(QScriptEngine *engine, const enum Qt::ItemFlag &p); QScriptValue ItemSelectionModetoScriptValue(QScriptEngine *engine, const enum Qt::ItemSelectionMode &p); QScriptValue KeytoScriptValue(QScriptEngine *engine, const enum Qt::Key &p); QScriptValue KeyboardModifiertoScriptValue(QScriptEngine *engine, const enum Qt::KeyboardModifier &p); QScriptValue LayoutDirectiontoScriptValue(QScriptEngine *engine, const enum Qt::LayoutDirection &p); QScriptValue MaskModetoScriptValue(QScriptEngine *engine, const enum Qt::MaskMode &p); QScriptValue MatchFlagtoScriptValue(QScriptEngine *engine, const enum Qt::MatchFlag &p); QScriptValue MatchFlagstoScriptValue(QScriptEngine *engine, const Qt::MatchFlags &p); QScriptValue ModifiertoScriptValue(QScriptEngine *engine, const enum Qt::Modifier &p); QScriptValue MouseButtontoScriptValue(QScriptEngine *engine, const enum Qt::MouseButton &p); //QScriptValue OrientationtoScriptValue(QScriptEngine *engine, const enum Qt::Orientation &p); QScriptValue PenCapStyletoScriptValue(QScriptEngine *engine, const enum Qt::PenCapStyle &p); QScriptValue PenJoinStyletoScriptValue(QScriptEngine *engine, const enum Qt::PenJoinStyle &p); QScriptValue PenStyletoScriptValue(QScriptEngine *engine, const enum Qt::PenStyle &p); QScriptValue ScrollBarPolicytoScriptValue(QScriptEngine *engine, const enum Qt::ScrollBarPolicy &p); QScriptValue ShortcutContexttoScriptValue(QScriptEngine *engine, const enum Qt::ShortcutContext &p); QScriptValue SizeHinttoScriptValue(QScriptEngine *engine, const enum Qt::SizeHint &p); QScriptValue SizeModetoScriptValue(QScriptEngine *engine, const enum Qt::SizeMode &p); QScriptValue SortOrdertoScriptValue(QScriptEngine *engine, const enum Qt::SortOrder &p); QScriptValue TextElideModetoScriptValue(QScriptEngine *engine, const enum Qt::TextElideMode &p); QScriptValue TextFlagtoScriptValue(QScriptEngine *engine, const enum Qt::TextFlag &p); QScriptValue TextFormattoScriptValue(QScriptEngine *engine, const enum Qt::TextFormat &p); QScriptValue TextInteractionFlagtoScriptValue(QScriptEngine *engine, const enum Qt::TextInteractionFlag &p); QScriptValue TimeSpectoScriptValue(QScriptEngine *engine, const enum Qt::TimeSpec &p); QScriptValue ToolBarAreatoScriptValue(QScriptEngine *engine, const enum Qt::ToolBarArea &p); QScriptValue ToolButtonStyletoScriptValue(QScriptEngine *engine, const enum Qt::ToolButtonStyle &p); QScriptValue TransformationModetoScriptValue(QScriptEngine *engine, const enum Qt::TransformationMode &p); QScriptValue UIEffecttoScriptValue(QScriptEngine *engine, const enum Qt::UIEffect &p); QScriptValue WhiteSpaceModetoScriptValue(QScriptEngine *engine, const enum Qt::WhiteSpaceMode &p); QScriptValue WidgetAttributetoScriptValue(QScriptEngine *engine, const enum Qt::WidgetAttribute &p); QScriptValue WindowFrameSectiontoScriptValue(QScriptEngine *engine, const enum Qt::WindowFrameSection &p); QScriptValue WindowModalitytoScriptValue(QScriptEngine *engine, const enum Qt::WindowModality &p); QScriptValue WindowStatetoScriptValue(QScriptEngine *engine, const enum Qt::WindowState &p); QScriptValue WindowTypetoScriptValue(QScriptEngine *engine, const enum Qt::WindowType &p); void AlignmentFlagfromScriptValue(const QScriptValue &obj, enum Qt::AlignmentFlag &p); void AnchorAttributefromScriptValue(const QScriptValue &obj, enum Qt::AnchorAttribute &p); void ApplicationAttributefromScriptValue(const QScriptValue &obj, enum Qt::ApplicationAttribute &p); void ArrowTypefromScriptValue(const QScriptValue &obj, enum Qt::ArrowType &p); void AspectRatioModefromScriptValue(const QScriptValue &obj, enum Qt::AspectRatioMode &p); void AxisfromScriptValue(const QScriptValue &obj, enum Qt::Axis &p); void BGModefromScriptValue(const QScriptValue &obj, enum Qt::BGMode &p); void BrushStylefromScriptValue(const QScriptValue &obj, enum Qt::BrushStyle &p); void CaseSensitivityfromScriptValue(const QScriptValue &obj, enum Qt::CaseSensitivity &p); void CheckStatefromScriptValue(const QScriptValue &obj, enum Qt::CheckState &p); void ClipOperationfromScriptValue(const QScriptValue &obj, enum Qt::ClipOperation &p); void ConnectionTypefromScriptValue(const QScriptValue &obj, enum Qt::ConnectionType &p); void ContextMenuPolicyfromScriptValue(const QScriptValue &obj, enum Qt::ContextMenuPolicy &p); void CornerfromScriptValue(const QScriptValue &obj, enum Qt::Corner &p); void CursorShapefromScriptValue(const QScriptValue &obj, enum Qt::CursorShape &p); void DateFormatfromScriptValue(const QScriptValue &obj, enum Qt::DateFormat &p); void DayOfWeekfromScriptValue(const QScriptValue &obj, enum Qt::DayOfWeek &p); void DockWidgetAreafromScriptValue(const QScriptValue &obj, enum Qt::DockWidgetArea &p); void DropActionfromScriptValue(const QScriptValue &obj, enum Qt::DropAction &p); void EventPriorityfromScriptValue(const QScriptValue &obj, enum Qt::EventPriority &p); void FillRulefromScriptValue(const QScriptValue &obj, enum Qt::FillRule &p); void FocusPolicyfromScriptValue(const QScriptValue &obj, enum Qt::FocusPolicy &p); void FocusReasonfromScriptValue(const QScriptValue &obj, enum Qt::FocusReason &p); void GlobalColorfromScriptValue(const QScriptValue &obj, enum Qt::GlobalColor &p); void HitTestAccuracyfromScriptValue(const QScriptValue &obj, enum Qt::HitTestAccuracy &p); void ImageConversionFlagfromScriptValue(const QScriptValue &obj, enum Qt::ImageConversionFlag &p); void InputMethodQueryfromScriptValue(const QScriptValue &obj, enum Qt::InputMethodQuery &p); void ItemDataRolefromScriptValue(const QScriptValue &obj, enum Qt::ItemDataRole &p); void ItemFlagfromScriptValue(const QScriptValue &obj, enum Qt::ItemFlag &p); void ItemSelectionModefromScriptValue(const QScriptValue &obj, enum Qt::ItemSelectionMode &p); void KeyfromScriptValue(const QScriptValue &obj, enum Qt::Key &p); void KeyboardModifierfromScriptValue(const QScriptValue &obj, enum Qt::KeyboardModifier &p); void LayoutDirectionfromScriptValue(const QScriptValue &obj, enum Qt::LayoutDirection &p); void MaskModefromScriptValue(const QScriptValue &obj, enum Qt::MaskMode &p); void MatchFlagfromScriptValue(const QScriptValue &obj, enum Qt::MatchFlag &p); void MatchFlagsfromScriptValue(const QScriptValue &obj, Qt::MatchFlags &p); void ModifierfromScriptValue(const QScriptValue &obj, enum Qt::Modifier &p); void MouseButtonfromScriptValue(const QScriptValue &obj, enum Qt::MouseButton &p); //void OrientationfromScriptValue(const QScriptValue &obj, enum Qt::Orientation &p); void PenCapStylefromScriptValue(const QScriptValue &obj, enum Qt::PenCapStyle &p); void PenJoinStylefromScriptValue(const QScriptValue &obj, enum Qt::PenJoinStyle &p); void PenStylefromScriptValue(const QScriptValue &obj, enum Qt::PenStyle &p); void ScrollBarPolicyfromScriptValue(const QScriptValue &obj, enum Qt::ScrollBarPolicy &p); void ShortcutContextfromScriptValue(const QScriptValue &obj, enum Qt::ShortcutContext &p); void SizeHintfromScriptValue(const QScriptValue &obj, enum Qt::SizeHint &p); void SizeModefromScriptValue(const QScriptValue &obj, enum Qt::SizeMode &p); void SortOrderfromScriptValue(const QScriptValue &obj, enum Qt::SortOrder &p); void TextElideModefromScriptValue(const QScriptValue &obj, enum Qt::TextElideMode &p); void TextFlagfromScriptValue(const QScriptValue &obj, enum Qt::TextFlag &p); void TextFormatfromScriptValue(const QScriptValue &obj, enum Qt::TextFormat &p); void TextInteractionFlagfromScriptValue(const QScriptValue &obj, enum Qt::TextInteractionFlag &p); void TimeSpecfromScriptValue(const QScriptValue &obj, enum Qt::TimeSpec &p); void ToolBarAreafromScriptValue(const QScriptValue &obj, enum Qt::ToolBarArea &p); void ToolButtonStylefromScriptValue(const QScriptValue &obj, enum Qt::ToolButtonStyle &p); void TransformationModefromScriptValue(const QScriptValue &obj, enum Qt::TransformationMode &p); void UIEffectfromScriptValue(const QScriptValue &obj, enum Qt::UIEffect &p); void WhiteSpaceModefromScriptValue(const QScriptValue &obj, enum Qt::WhiteSpaceMode &p); void WidgetAttributefromScriptValue(const QScriptValue &obj, enum Qt::WidgetAttribute &p); void WindowFrameSectionfromScriptValue(const QScriptValue &obj, enum Qt::WindowFrameSection &p); void WindowModalityfromScriptValue(const QScriptValue &obj, enum Qt::WindowModality &p); void WindowStatefromScriptValue(const QScriptValue &obj, enum Qt::WindowState &p); void WindowTypefromScriptValue(const QScriptValue &obj, enum Qt::WindowType &p); #endif qt-client-4.1.0/scriptapi/qurlproto.cpp000066400000000000000000000333771217451700100202000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qurlproto.h" #include #include #include #include #include #include #define DEBUG false // support functions void setupQUrlProto(QScriptEngine *engine) { if (DEBUG) qDebug("setupQUrlProto entered"); QScriptValue urlproto = engine->newQObject(new QUrlProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), urlproto); QScriptValue urlConstructor = engine->newFunction(constructQUrl, urlproto); engine->globalObject().setProperty("QUrl", urlConstructor); } QScriptValue constructQUrl(QScriptContext *context, QScriptEngine *engine) { if (DEBUG) qDebug("constructQUrl called"); QUrl *url = 0; if (context->argumentCount() == 2) { if (DEBUG) qDebug("qurl(2 args)"); url = new QUrl(context->argument(0).toString(), (QUrl::ParsingMode)(context->argument(2).toInt32())); } else if (context->argumentCount() == 1 && context->argument(0).isString()) { if (DEBUG) qDebug("qurl(1 string arg)"); url = new QUrl(context->argument(0).toString()); } else if (context->argumentCount() == 1 && context->argument(0).isVariant() && context->argument(0).toVariant().type() == QVariant::Url) { url = new QUrl(context->argument(0).toVariant().toUrl()); } else if (context->argumentCount() == 1) // && argument(0) is not a string { if (DEBUG) qDebug("qurl(1 arg that isn't a string)"); // url = new QUrl(dynamic_cast(context->argument(0).toObject())); context->throwError(QScriptContext::UnknownError, "QUrl(QUrl &other) constructor is not yet supported"); } else url = new QUrl(); if (DEBUG) qDebug("end result: %s", qPrintable(url->toString())); return engine->toScriptValue(url); } // QUrlProto itself QUrlProto::QUrlProto(QObject *parent) : QObject(parent) { } void QUrlProto::addEncodedQueryItem(const QByteArray &key, const QByteArray &value) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->addEncodedQueryItem(key, value); } void QUrlProto::addQueryItem(const QString &key, const QString &value) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->addQueryItem(key, value); } QList QUrlProto::allEncodedQueryItemValues(const QByteArray &key) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->allEncodedQueryItemValues(key); return QList(); } QStringList QUrlProto::allQueryItemValues(const QString &key) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->allQueryItemValues(key); return QStringList(); } QString QUrlProto::authority() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->authority(); return QString(); } void QUrlProto::clear() { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } QByteArray QUrlProto::encodedFragment() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedFragment(); return QByteArray(); } QByteArray QUrlProto::encodedHost() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedHost(); return QByteArray(); } QByteArray QUrlProto::encodedPassword() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedPassword(); return QByteArray(); } QByteArray QUrlProto::encodedPath() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedPath(); return QByteArray(); } QByteArray QUrlProto::encodedQuery() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedQuery(); return QByteArray(); } QByteArray QUrlProto::encodedQueryItemValue(const QByteArray &key) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedQueryItemValue(key); return QByteArray(); } QList > QUrlProto::encodedQueryItems() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedQueryItems(); return QList >(); } QByteArray QUrlProto::encodedUserName() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->encodedUserName(); return QByteArray(); } QString QUrlProto::errorString() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->errorString(); return QString(); } QString QUrlProto::fragment() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->fragment(); return QString(); } bool QUrlProto::hasEncodedQueryItem(const QByteArray &key) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->hasEncodedQueryItem(key); return false; } bool QUrlProto::hasFragment() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->hasFragment(); return false; } bool QUrlProto::hasQuery() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->hasQuery(); return false; } bool QUrlProto::hasQueryItem(const QString &key) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->hasQueryItem(key); return false; } QString QUrlProto::host() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->host(); return QString(); } bool QUrlProto::isEmpty() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->isEmpty(); return true; } bool QUrlProto::isParentOf(const QUrl &childUrl) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->isParentOf(childUrl); return false; } bool QUrlProto::isRelative() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->isRelative(); return false; } bool QUrlProto::isValid() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->isValid(); return false; } QString QUrlProto::password() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->password(); return QString(); } QString QUrlProto::path() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->path(); return QString(); } int QUrlProto::port() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->port(); return 0; } int QUrlProto::port(int defaultPort) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->port(defaultPort); return 0; } QString QUrlProto::queryItemValue(const QString &key) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->queryItemValue(key); return QString(); } QList > QUrlProto::queryItems() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->queryItems(); return QList >(); } char QUrlProto::queryPairDelimiter() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->queryPairDelimiter(); return '\0'; } char QUrlProto::queryValueDelimiter() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->queryValueDelimiter(); return '\0'; } void QUrlProto::removeAllEncodedQueryItems(const QByteArray &key) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->removeAllEncodedQueryItems(key); } void QUrlProto::removeAllQueryItems(const QString &key) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->removeAllQueryItems(key); } void QUrlProto::removeEncodedQueryItem(const QByteArray &key) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->removeEncodedQueryItem(key); } void QUrlProto::removeQueryItem(const QString &key) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->removeQueryItem(key); } QUrl QUrlProto::resolved(const QUrl &relative) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->resolved(relative); return QUrl(); } QString QUrlProto::scheme() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->scheme(); return QString(); } void QUrlProto::setAuthority(const QString &authority) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setAuthority(authority); } void QUrlProto::setEncodedFragment(const QByteArray &fragment) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedFragment(fragment); } void QUrlProto::setEncodedHost(const QByteArray &host) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedHost(host); } void QUrlProto::setEncodedPassword(const QByteArray &password) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedPassword(password); } void QUrlProto::setEncodedPath(const QByteArray &path) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedPath(path); } void QUrlProto::setEncodedQuery(const QByteArray &query) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedQuery(query); } void QUrlProto::setEncodedQueryItems(const QList > &query) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedQueryItems(query); } void QUrlProto::setEncodedUrl(const QByteArray &encodedUrl) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedUrl(encodedUrl); } void QUrlProto::setEncodedUrl(const QByteArray &encodedUrl, QUrl::ParsingMode parsingMode) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedUrl(encodedUrl, parsingMode); } void QUrlProto::setEncodedUserName(const QByteArray &userName) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setEncodedUserName(userName); } void QUrlProto::setFragment(const QString &fragment) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setFragment(fragment); } void QUrlProto::setHost(const QString &host) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setHost(host); } void QUrlProto::setPassword(const QString &password) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setPassword(password); } void QUrlProto::setPath(const QString &path) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setPath(path); } void QUrlProto::setPort(int port) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setPort(port); } void QUrlProto::setQueryDelimiters(char valueDelimiter, char pairDelimiter) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setQueryDelimiters(valueDelimiter, pairDelimiter); } void QUrlProto::setQueryItems(const QList > &query) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setQueryItems(query); } void QUrlProto::setQueryItems(const QVariantMap &map) { if (DEBUG) qDebug("setQueryItems(const QVariantMap &map) entered"); QUrl *item = qscriptvalue_cast(thisObject()); if (item) { QList > query; QMapIterator i(map); while (i.hasNext()) { i.next(); query.append(qMakePair(i.key(), i.value().toString())); } item->setQueryItems(query); } } void QUrlProto::setScheme(const QString &scheme) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setScheme(scheme); } void QUrlProto::setUrl(const QString &url) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setUrl(url); } void QUrlProto::setUrl(const QString &url, QUrl::ParsingMode parsingMode) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setUrl(url, parsingMode); } void QUrlProto::setUserInfo(const QString &userInfo) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setUserInfo(userInfo); } void QUrlProto::setUserName(const QString &userName) { QUrl *item = qscriptvalue_cast(thisObject()); if (item) item->setUserName(userName); } QByteArray QUrlProto::toEncoded(QUrl::FormattingOptions options) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->toEncoded(options); return QByteArray(); } QString QUrlProto::toLocalFile() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->toLocalFile(); return QString(); } QString QUrlProto::toString(QUrl::FormattingOptions options) const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->toString(options); return QString("[QUrl(no data available)]"); } QString QUrlProto::userInfo() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->userInfo(); return QString(); } QString QUrlProto::userName() const { QUrl *item = qscriptvalue_cast(thisObject()); if (item) return item->userName(); return QString(); } qt-client-4.1.0/scriptapi/qurlproto.h000066400000000000000000000123111217451700100176260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QURLPROTO_H__ #define __QURLPROTO_H__ #include #include #include #include #include class QByteArray; class QSslConfiguration; Q_DECLARE_METATYPE(QUrl*) void setupQUrlProto(QScriptEngine *engine); QScriptValue constructQUrl(QScriptContext *context, QScriptEngine *engine); class QUrlProto : public QObject, public QScriptable { Q_OBJECT public: QUrlProto(QObject *parent = 0); Q_INVOKABLE void addEncodedQueryItem(const QByteArray &key, const QByteArray &value); Q_INVOKABLE void addQueryItem(const QString &key, const QString & value); Q_INVOKABLE QList allEncodedQueryItemValues(const QByteArray &key) const; Q_INVOKABLE QStringList allQueryItemValues(const QString &key) const; Q_INVOKABLE QString authority() const; Q_INVOKABLE void clear(); Q_INVOKABLE QByteArray encodedFragment() const; Q_INVOKABLE QByteArray encodedHost() const; Q_INVOKABLE QByteArray encodedPassword() const; Q_INVOKABLE QByteArray encodedPath() const; Q_INVOKABLE QByteArray encodedQuery() const; Q_INVOKABLE QByteArray encodedQueryItemValue(const QByteArray &key) const; Q_INVOKABLE QList > encodedQueryItems() const; Q_INVOKABLE QByteArray encodedUserName() const; Q_INVOKABLE QString errorString() const; Q_INVOKABLE QString fragment() const; Q_INVOKABLE bool hasEncodedQueryItem(const QByteArray &key) const; Q_INVOKABLE bool hasFragment() const; Q_INVOKABLE bool hasQuery() const; Q_INVOKABLE bool hasQueryItem(const QString &key) const; Q_INVOKABLE QString host() const; Q_INVOKABLE bool isEmpty() const; Q_INVOKABLE bool isParentOf(const QUrl &childUrl) const; Q_INVOKABLE bool isRelative() const; Q_INVOKABLE bool isValid() const; Q_INVOKABLE QString password() const; Q_INVOKABLE QString path() const; Q_INVOKABLE int port() const; Q_INVOKABLE int port(int defaultPort) const; Q_INVOKABLE QString queryItemValue(const QString &key) const; Q_INVOKABLE QList > queryItems() const; Q_INVOKABLE char queryPairDelimiter() const; Q_INVOKABLE char queryValueDelimiter() const; Q_INVOKABLE void removeAllEncodedQueryItems(const QByteArray &key); Q_INVOKABLE void removeAllQueryItems(const QString &key); Q_INVOKABLE void removeEncodedQueryItem(const QByteArray &key); Q_INVOKABLE void removeQueryItem(const QString &key); Q_INVOKABLE QUrl resolved(const QUrl &relative) const; Q_INVOKABLE QString scheme() const; Q_INVOKABLE void setAuthority(const QString &authority); Q_INVOKABLE void setEncodedFragment(const QByteArray &fragment); Q_INVOKABLE void setEncodedHost(const QByteArray &host); Q_INVOKABLE void setEncodedPassword(const QByteArray &password); Q_INVOKABLE void setEncodedPath(const QByteArray &path); Q_INVOKABLE void setEncodedQuery(const QByteArray &query); Q_INVOKABLE void setEncodedQueryItems(const QList > &query); Q_INVOKABLE void setEncodedUrl(const QByteArray &encodedUrl); Q_INVOKABLE void setEncodedUrl(const QByteArray &encodedUrl, QUrl::ParsingMode parsingMode); Q_INVOKABLE void setEncodedUserName(const QByteArray &userName); Q_INVOKABLE void setFragment(const QString &fragment); Q_INVOKABLE void setHost(const QString &host); Q_INVOKABLE void setPassword(const QString &password); Q_INVOKABLE void setPath(const QString &path); Q_INVOKABLE void setPort(int port); Q_INVOKABLE void setQueryDelimiters(char valueDelimiter, char pairDelimiter); Q_INVOKABLE void setQueryItems(const QList > &query); Q_INVOKABLE void setQueryItems(const QVariantMap &map); Q_INVOKABLE void setScheme(const QString &scheme); Q_INVOKABLE void setUrl(const QString &url); Q_INVOKABLE void setUrl(const QString &url, QUrl::ParsingMode parsingMode); Q_INVOKABLE void setUserInfo(const QString &userInfo); Q_INVOKABLE void setUserName(const QString &userName); Q_INVOKABLE QByteArray toEncoded(QUrl::FormattingOptions options = QUrl::None) const; Q_INVOKABLE QString toLocalFile() const; Q_INVOKABLE QString userInfo() const; Q_INVOKABLE QString userName() const; public slots: Q_INVOKABLE QString toString(QUrl::FormattingOptions options = QUrl::None) const; }; #endif qt-client-4.1.0/scriptapi/qvalidatorproto.cpp000066400000000000000000000035641217451700100213560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qvalidatorproto.h" #define DEBUG false QScriptValue QValidatorToScriptValue(QScriptEngine *engine, QValidator* const &in) { return engine->newQObject(in); } void QValidatorFromScriptValue(const QScriptValue &object, QValidator* &out) { out = qobject_cast(object.toQObject()); } void setupQValidatorProto(QScriptEngine *engine) { //QScriptValue proto = engine->newQObject(new QValidatorProto(engine)); //engine->setDefaultPrototype(qMetaTypeId(), proto); //engine->setDefaultPrototype(qMetaTypeId(), proto); qScriptRegisterMetaType(engine, QValidatorToScriptValue, QValidatorFromScriptValue); //QScriptValue constructor = engine->newFunction(constructQValidator, // proto); //engine->globalObject().setProperty("QValidator", constructor); } QScriptValue constructQValidator(QScriptContext *context, QScriptEngine *engine) { QValidator *obj = 0; if (DEBUG) { qDebug("constructQValidator() entered"); for (int i = 0; i < context->argumentCount(); i++) qDebug("context->argument(%d) = %s", i, qPrintable(context->argument(i).toString())); } context->throwError(QScriptContext::UnknownError, "QValidator() constructor is not yet supported"); return engine->toScriptValue(obj); } QValidatorProto::QValidatorProto(QObject *parent) : QObject(parent) { } qt-client-4.1.0/scriptapi/qvalidatorproto.h000066400000000000000000000023211217451700100210110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QVALIDATORPROTO_H__ #define __QVALIDATORPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QValidator*) //Q_DECLARE_METATYPE(QValidator) void setupQValidatorProto(QScriptEngine *engine); QScriptValue constructQValidator(QScriptContext *context, QScriptEngine *engine); class QValidatorProto : public QObject, public QScriptable { Q_OBJECT public: QValidatorProto(QObject *parent); /* * Leaving these out for now as we just need the ability to * pass this class without changing anything Q_INVOKABLE void fixup ( QString & input ) const; Q_INVOKABLE QLocale locale () const; Q_INVOKABLE void setLocale ( const QLocale & locale ); Q_INVOKABLE State validate ( QString & input, int & pos ) const; */ }; #endif qt-client-4.1.0/scriptapi/qwebpageproto.cpp000066400000000000000000000040621217451700100207750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qwebpageproto.h" #include QScriptValue QWebPagetoScriptValue(QScriptEngine *engine, QWebPage* const &item) { return engine->newQObject(item); } void QWebPagefromScriptValue(const QScriptValue &obj, QWebPage* &item) { item = qobject_cast(obj.toQObject()); } void setupQWebPageProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QWebPagetoScriptValue, QWebPagefromScriptValue); QScriptValue proto = engine->newQObject(new QWebPageProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQWebPage, proto); engine->globalObject().setProperty("QWebPage", constructor); constructor.setProperty("DontDelegateLinks", QScriptValue(engine, QWebPage::DontDelegateLinks), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("DelegateExternalLinks", QScriptValue(engine, QWebPage::DelegateExternalLinks), QScriptValue::ReadOnly | QScriptValue::Undeletable); constructor.setProperty("DelegateAllLinks", QScriptValue(engine, QWebPage::DelegateAllLinks), QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue constructQWebPage(QScriptContext * context, QScriptEngine *engine) { QWebPage *obj = 0; if (context->argumentCount() == 1) obj = new QWebPage(qobject_cast(context->argument(0).toQObject())); else obj = new QWebPage(); return engine->toScriptValue(obj); } QWebPageProto::QWebPageProto(QObject *parent) : QObject(parent) { } qt-client-4.1.0/scriptapi/qwebpageproto.h000066400000000000000000000016521217451700100204440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QWEBPAGEPROTO_H__ #define __QWEBPAGEPROTO_H__ #include #include #include Q_DECLARE_METATYPE(QWebPage*) Q_DECLARE_METATYPE(enum QWebPage::LinkDelegationPolicy) void setupQWebPageProto(QScriptEngine *engine); QScriptValue constructQWebPage(QScriptContext *context, QScriptEngine *engine); class QWebPageProto : public QObject, public QScriptable { Q_OBJECT public: QWebPageProto(QObject *parent); // TO DO: add public functions }; #endif qt-client-4.1.0/scriptapi/qwebviewproto.cpp000066400000000000000000000100061217451700100210260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "qwebviewproto.h" #include #include #include #include QScriptValue QWebViewtoScriptValue(QScriptEngine *engine, QWebView* const &item) { return engine->newQObject(item); } void QWebViewfromScriptValue(const QScriptValue &obj, QWebView* &item) { item = qobject_cast(obj.toQObject()); } void setupQWebViewProto(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QWebViewtoScriptValue, QWebViewfromScriptValue); QScriptValue proto = engine->newQObject(new QWebViewProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQWebView, proto); engine->globalObject().setProperty("QWebView", constructor); } QScriptValue constructQWebView(QScriptContext * context, QScriptEngine *engine) { QWebView *obj = 0; if (context->argumentCount() == 1) obj = new QWebView(qobject_cast(context->argument(0).toQObject())); else obj = new QWebView(); return engine->toScriptValue(obj); } QWebViewProto::QWebViewProto(QObject *parent) : QObject(parent) { } bool QWebViewProto::findText(const QString &subString, QWebPage::FindFlags options) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) return item->findText(subString, options); return false; } QWebHistory* QWebViewProto::history() const { QWebView *item = qscriptvalue_cast(thisObject()); if (item) return item->history(); return 0; } void QWebViewProto::load(const QUrl &url) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) item->load(url); } void QWebViewProto::load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation, const QByteArray &body) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) item->load(request, operation, body); } QWebPage* QWebViewProto::page() const { QWebView *item = qscriptvalue_cast(thisObject()); if (item) return item->page(); return 0; } QAction* QWebViewProto::pageAction(QWebPage::WebAction action) const { QWebView *item = qscriptvalue_cast(thisObject()); if (item) return item->pageAction(action); return 0; } void QWebViewProto::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) item->setContent(data, mimeType, baseUrl); } void QWebViewProto::setHtml(const QString &html, const QUrl &baseUrl) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) item->setHtml(html, baseUrl); } void QWebViewProto::setPage(QWebPage *page) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) item->setPage(page); } void QWebViewProto::setTextSizeMultiplier(qreal factor) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) item->setTextSizeMultiplier(factor); } QWebSettings* QWebViewProto::settings() const { QWebView *item = qscriptvalue_cast(thisObject()); if (item) return item->settings(); return 0; } qreal QWebViewProto::textSizeMultiplier() const { QWebView *item = qscriptvalue_cast(thisObject()); if (item) return item->textSizeMultiplier(); return qreal(); } void QWebViewProto::triggerPageAction(QWebPage::WebAction action, bool checked) { QWebView *item = qscriptvalue_cast(thisObject()); if (item) item->triggerPageAction(action, checked); } qt-client-4.1.0/scriptapi/qwebviewproto.h000066400000000000000000000042521217451700100205010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QWEBVIEWPROTO_H__ #define __QWEBVIEWPROTO_H__ #include #include #include #include #include #include #include #include #include #include #include class QAction; class QWebHistory; class QWebSettings; Q_DECLARE_METATYPE(QWebView*) void setupQWebViewProto(QScriptEngine *engine); QScriptValue constructQWebView(QScriptContext *context, QScriptEngine *engine); class QWebViewProto : public QObject, public QScriptable { Q_OBJECT public: QWebViewProto(QObject *parent); Q_INVOKABLE bool findText(const QString &subString, QWebPage::FindFlags options = 0); Q_INVOKABLE QWebHistory* history() const; Q_INVOKABLE void load(const QUrl &url); Q_INVOKABLE void load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray()); Q_INVOKABLE QWebPage *page() const; Q_INVOKABLE QAction *pageAction(QWebPage::WebAction action) const; Q_INVOKABLE void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl()); Q_INVOKABLE void setHtml(const QString &html, const QUrl &baseUrl = QUrl()); Q_INVOKABLE void setPage(QWebPage *page); Q_INVOKABLE void setTextSizeMultiplier(qreal factor); Q_INVOKABLE QWebSettings *settings() const; Q_INVOKABLE qreal textSizeMultiplier() const; Q_INVOKABLE void triggerPageAction(QWebPage::WebAction action, bool checked = false); }; #endif qt-client-4.1.0/scriptapi/qwidgetproto.cpp000066400000000000000000000470141217451700100206520ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #include "qwidgetproto.h" #include #define DEBUG false QScriptValue scriptFind(QScriptContext *context, QScriptEngine * engine) { #ifndef Q_WS_WIN if (context->argumentCount() >= 1 && qscriptvalue_cast(context->argument(0))) return engine->toScriptValue(QWidget::find(qscriptvalue_cast(context->argument(0)))); #endif return 0; } QScriptValue scriptKeyboardGrabber(QScriptContext * /*context*/, QScriptEngine *engine) { return engine->toScriptValue(QWidget::keyboardGrabber()); } QScriptValue scriptMouseGrabber(QScriptContext * /*context*/, QScriptEngine *engine) { return engine->toScriptValue(QWidget::mouseGrabber()); } QScriptValue scriptSetTabOrder(QScriptContext *context, QScriptEngine * /*engine*/) { if (context->argumentCount() >= 2 && qscriptvalue_cast(context->argument(0)) && qscriptvalue_cast(context->argument(1))) { if (DEBUG) qDebug("scriptSetTabOrder(%p, %p)", qscriptvalue_cast(context->argument(0)), qscriptvalue_cast(context->argument(1))); QWidget::setTabOrder(qscriptvalue_cast(context->argument(0)), qscriptvalue_cast(context->argument(1))); } else context->throwError(QScriptContext::UnknownError, "could not set tab order as requested"); return QScriptValue(); } void setupQWidgetProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new QWidgetProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructQWidget, proto); engine->globalObject().setProperty("QWidget", constructor); constructor.setProperty("find", engine->newFunction(scriptFind)); constructor.setProperty("keyboardGrabber",engine->newFunction(scriptKeyboardGrabber)); constructor.setProperty("mouseGrabber", engine->newFunction(scriptMouseGrabber)); constructor.setProperty("setTabOrder", engine->newFunction(scriptSetTabOrder)); } QScriptValue constructQWidget(QScriptContext *context, QScriptEngine *engine) { QWidget *obj = 0; if (context->argumentCount() >= 2) obj = new QWidget(qscriptvalue_cast(context->argument(0)), (Qt::WindowFlags)(context->argument(1).toInt32())); else if (context->argumentCount() == 1) obj = new QWidget(qscriptvalue_cast(context->argument(0))); else obj = new QWidget(); return engine->toScriptValue(obj); } QWidgetProto::QWidgetProto(QObject *parent) : QObject(parent) { } QList QWidgetProto::actions() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->actions(); return QList(); } void QWidgetProto::activateWindow() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->activateWindow(); } void QWidgetProto::addAction(QAction *action) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->addAction(action); } void QWidgetProto::addActions(QList actions) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->addActions(actions); } void QWidgetProto::adjustSize() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->adjustSize(); } int QWidgetProto::backgroundRole() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->backgroundRole(); return 0; } QWidget *QWidgetProto::childAt(int x, int y) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->childAt(x, y); return 0; } QWidget *QWidgetProto::childAt(const QPoint &p) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->childAt(p); return 0; } void QWidgetProto::clearFocus() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->clearFocus(); } void QWidgetProto::clearMask() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->clearMask(); } QRect QWidgetProto::contentsRect() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->contentsRect(); return QRect(); } #ifndef Q_WS_WIN WId QWidgetProto::effectiveWinId() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->effectiveWinId(); return WId(); } #endif void QWidgetProto::ensurePolished() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->ensurePolished(); } QWidget *QWidgetProto::focusProxy() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->focusProxy(); return 0; } QWidget *QWidgetProto::focusWidget() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->focusWidget(); return 0; } QFontInfo QWidgetProto::fontInfo() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->fontInfo(); return QFontInfo(QApplication::font()); } QFontMetrics QWidgetProto::fontMetrics() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->fontMetrics(); return QFontMetrics(QApplication::font()); } int QWidgetProto::foregroundRole() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->foregroundRole(); return 0; } void QWidgetProto::getContentsMargins(int *left, int * top, int * right, int * bottom) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->getContentsMargins(left, top, right, bottom); } void QWidgetProto::grabKeyboard() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->grabKeyboard(); } void QWidgetProto::grabMouse() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->grabMouse(); } void QWidgetProto::grabMouse(const QCursor &cursor) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->grabMouse(cursor); } int QWidgetProto::grabShortcut(const QKeySequence &key, int context) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->grabShortcut(key, (Qt::ShortcutContext)context); return 0; } QGraphicsProxyWidget *QWidgetProto::graphicsProxyWidget() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->graphicsProxyWidget(); return 0; } /* bool QWidgetProto::hasEditFocus() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->hasEditFocus(); return false; } */ bool QWidgetProto::hasFocus() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->hasFocus(); return false; } int QWidgetProto::heightForWidth(int w) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->heightForWidth(w); return 0; } QInputContext *QWidgetProto::inputContext() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->inputContext(); return 0; } QVariant QWidgetProto::inputMethodQuery(int query) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->inputMethodQuery((Qt::InputMethodQuery)query); return QVariant(); } void QWidgetProto::insertAction(QAction *before, QAction *action) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->insertAction(before, action); } void QWidgetProto::insertActions(QAction *before, QList actions) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->insertActions(before, actions); } bool QWidgetProto::isAncestorOf(const QWidget *child) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->isAncestorOf(child); return false; } bool QWidgetProto::isEnabledTo(QWidget *ancestor) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->isEnabledTo(ancestor); return false; } bool QWidgetProto::isHidden() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->isHidden(); return false; } bool QWidgetProto::isVisibleTo(QWidget *ancestor) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->isVisibleTo(ancestor); return false; } bool QWidgetProto::isWindow() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->isWindow(); return false; } QLayout *QWidgetProto::layout() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->layout(); return 0; } QPoint QWidgetProto::mapFrom(QWidget *parent, const QPoint &pos) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->mapFrom(parent, pos); return QPoint(); } QPoint QWidgetProto::mapFromGlobal(const QPoint &pos) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->mapFromGlobal(pos); return QPoint(); } QPoint QWidgetProto::mapFromParent(const QPoint &pos) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->mapFromParent(pos); return QPoint(); } QPoint QWidgetProto::mapTo(QWidget *parent, const QPoint &pos) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->mapTo(parent, pos); return QPoint(); } QPoint QWidgetProto::mapToGlobal(const QPoint &pos) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->mapToGlobal(pos); return QPoint(); } QPoint QWidgetProto::mapToParent(const QPoint &pos) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->mapToParent(pos); return QPoint(); } QRegion QWidgetProto::mask() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->mask(); return QRegion(); } QSize QWidgetProto::minimumSizeHint() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->minimumSizeHint(); return QSize(); } QWidget *QWidgetProto::nativeParentWidget() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->nativeParentWidget(); return 0; } QWidget *QWidgetProto::nextInFocusChain() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->nextInFocusChain(); return 0; } void QWidgetProto::overrideWindowFlags(int flags) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->overrideWindowFlags((Qt::WindowFlags)flags); } QPaintEngine *QWidgetProto::paintEngine() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->paintEngine(); return 0; } QWidget *QWidgetProto::parentWidget() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->parentWidget(); return 0; } void QWidgetProto::releaseKeyboard() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->releaseKeyboard(); } void QWidgetProto::releaseMouse() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->releaseMouse(); } void QWidgetProto::releaseShortcut(int id) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->releaseShortcut(id); } void QWidgetProto::removeAction(QAction *action) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->removeAction(action); } void QWidgetProto::repaint(int x, int y, int w, int h) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->repaint(x, y, w, h); } void QWidgetProto::repaint(const QRect &rect) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->repaint(rect); } void QWidgetProto::repaint(const QRegion &rgn) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->repaint(rgn); } bool QWidgetProto::restoreGeometry(const QByteArray &geometry) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->restoreGeometry(geometry); return false; } QByteArray QWidgetProto::saveGeometry() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->saveGeometry(); return QByteArray(); } void QWidgetProto::scroll(int dx, int dy) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->scroll(dx, dy); } void QWidgetProto::scroll(int dx, int dy, const QRect &r) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->scroll(dx, dy, r); } void QWidgetProto::setAttribute(int attribute, bool on) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setAttribute((Qt::WidgetAttribute)attribute, on); } void QWidgetProto::setBackgroundRole(int role) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setBackgroundRole((QPalette::ColorRole)role); } void QWidgetProto::setContentsMargins(int left, int top, int right, int bottom) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setContentsMargins(left, top, right, bottom); } /* void QWidgetProto::setEditFocus(bool enable) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setEditFocus(enable); } */ void QWidgetProto::setFixedHeight(int h) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setFixedHeight(h); } void QWidgetProto::setFixedSize(const QSize &s) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setFixedSize(s); } void QWidgetProto::setFixedSize(int w, int h) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setFixedSize(w, h); } void QWidgetProto::setFixedWidth(int w) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setFixedWidth(w); } void QWidgetProto::setFocus(int reason) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setFocus((Qt::FocusReason)reason); } void QWidgetProto::setFocusProxy(QWidget *w) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setFocusProxy(w); } void QWidgetProto::setForegroundRole(int role) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setForegroundRole((QPalette::ColorRole)role); } void QWidgetProto::setInputContext(QInputContext *context) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setInputContext(context); } void QWidgetProto::setLayout(QLayout *layout) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setLayout(layout); } void QWidgetProto::setMask(const QBitmap &bitmap) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setMask(bitmap); } void QWidgetProto::setMask(const QRegion ®ion) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setMask(region); } void QWidgetProto::setParent(QWidget *parent) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setParent(parent); } void QWidgetProto::setParent(QWidget *parent, int f) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setParent(parent, (Qt::WindowFlags)f); } void QWidgetProto::setShortcutAutoRepeat(int id, bool enable) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setShortcutAutoRepeat(id, enable); } void QWidgetProto::setShortcutEnabled(int id, bool enable) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setShortcutEnabled(id, enable); } void QWidgetProto::setStyle(QStyle *style) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setStyle(style); } void QWidgetProto::setWindowRole(const QString &role) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setWindowRole(role); } void QWidgetProto::setWindowState(int windowState) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->setWindowState((Qt::WindowStates)windowState); } void QWidgetProto::stackUnder(QWidget *w) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->stackUnder(w); } QStyle *QWidgetProto::style() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->style(); return 0; } bool QWidgetProto::testAttribute(int attribute) const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->testAttribute((Qt::WidgetAttribute)attribute); return false; } bool QWidgetProto::underMouse() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->underMouse(); return false; } void QWidgetProto::unsetCursor() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->unsetCursor(); } void QWidgetProto::update(int x, int y, int w, int h) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->update(x, y, w, h); } void QWidgetProto::update(const QRect &rect) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->update(rect); } void QWidgetProto::update(const QRegion &rgn) { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->update(rgn); } void QWidgetProto::updateGeometry() { QWidget *item = qscriptvalue_cast(thisObject()); if (item) item->updateGeometry(); } QRegion QWidgetProto::visibleRegion() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->visibleRegion(); return QRegion(); } #ifndef Q_WS_WIN WId QWidgetProto::winId() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->winId(); return WId(); } #endif QWidget *QWidgetProto::window() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->window(); return 0; } QString QWidgetProto::windowRole() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->windowRole(); return QString(); } int QWidgetProto::windowState() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->windowState(); return 0; } int QWidgetProto::windowType() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return item->windowType(); return 0; } QString QWidgetProto::toString() const { QWidget *item = qscriptvalue_cast(thisObject()); if (item) return QString(item->objectName()); return QString(); } qt-client-4.1.0/scriptapi/qwidgetproto.h000066400000000000000000000157611217451700100203230ustar00rootroot00000000000000/* *This file is part of the xTuple ERP: PostBooks Edition, a free and *open source Enterprise Resource Planning software suite, *Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. *It is licensed to you under the Common Public Attribution License *version 1.0, the full text of which(including xTuple-specific Exhibits) *is available at www.xtuple.com/CPAL. By using this software, you agree *to be bound by its terms. */ #ifndef __QWIDGETPROTO_H__ #define __QWIDGETPROTO_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include Q_DECLARE_METATYPE(QWidget*) //Q_DECLARE_METATYPE(QWidget) void setupQWidgetProto(QScriptEngine *engine); QScriptValue constructQWidget(QScriptContext *context, QScriptEngine *engine); class QWidgetProto : public QObject, public QScriptable { Q_OBJECT public: QWidgetProto(QObject *parent); Q_INVOKABLE QList actions() const; Q_INVOKABLE void activateWindow(); Q_INVOKABLE void addAction(QAction *action); Q_INVOKABLE void addActions(QList actions); Q_INVOKABLE void adjustSize(); Q_INVOKABLE int backgroundRole() const; Q_INVOKABLE QWidget *childAt(int x, int y) const; Q_INVOKABLE QWidget *childAt(const QPoint &p) const; Q_INVOKABLE void clearFocus(); Q_INVOKABLE void clearMask(); Q_INVOKABLE QRect contentsRect() const; #ifndef Q_WS_WIN Q_INVOKABLE WId effectiveWinId() const; #endif Q_INVOKABLE void ensurePolished() const; Q_INVOKABLE QWidget *focusProxy() const; Q_INVOKABLE QWidget *focusWidget() const; Q_INVOKABLE QFontInfo fontInfo() const; Q_INVOKABLE QFontMetrics fontMetrics() const; Q_INVOKABLE int foregroundRole() const; Q_INVOKABLE void getContentsMargins(int *left, int * top, int * right, int * bottom) const; Q_INVOKABLE void grabKeyboard(); Q_INVOKABLE void grabMouse(); Q_INVOKABLE void grabMouse(const QCursor &cursor); Q_INVOKABLE int grabShortcut(const QKeySequence &key, int context = Qt::WindowShortcut); Q_INVOKABLE QGraphicsProxyWidget *graphicsProxyWidget() const; //Q_INVOKABLE bool hasEditFocus() const; Q_INVOKABLE bool hasFocus() const; Q_INVOKABLE int heightForWidth(int w) const; Q_INVOKABLE QInputContext *inputContext(); Q_INVOKABLE QVariant inputMethodQuery(int query) const; Q_INVOKABLE void insertAction(QAction *before, QAction *action); Q_INVOKABLE void insertActions(QAction *before, QList actions); Q_INVOKABLE bool isAncestorOf(const QWidget *child) const; Q_INVOKABLE bool isEnabledTo(QWidget *ancestor) const; Q_INVOKABLE bool isHidden() const; Q_INVOKABLE bool isVisibleTo(QWidget *ancestor) const; Q_INVOKABLE bool isWindow() const; Q_INVOKABLE QLayout *layout() const; Q_INVOKABLE QPoint mapFrom(QWidget *parent, const QPoint &pos) const; Q_INVOKABLE QPoint mapFromGlobal(const QPoint &pos) const; Q_INVOKABLE QPoint mapFromParent(const QPoint &pos) const; Q_INVOKABLE QPoint mapTo(QWidget *parent, const QPoint &pos) const; Q_INVOKABLE QPoint mapToGlobal(const QPoint &pos) const; Q_INVOKABLE QPoint mapToParent(const QPoint &pos) const; Q_INVOKABLE QRegion mask() const; Q_INVOKABLE QSize minimumSizeHint() const; Q_INVOKABLE QWidget *nativeParentWidget() const; Q_INVOKABLE QWidget *nextInFocusChain() const; Q_INVOKABLE void overrideWindowFlags(int flags); Q_INVOKABLE QPaintEngine *paintEngine() const; Q_INVOKABLE QWidget *parentWidget() const; Q_INVOKABLE void releaseKeyboard(); Q_INVOKABLE void releaseMouse(); Q_INVOKABLE void releaseShortcut(int id); Q_INVOKABLE void removeAction(QAction *action); Q_INVOKABLE void repaint(int x, int y, int w, int h); Q_INVOKABLE void repaint(const QRect &rect); Q_INVOKABLE void repaint(const QRegion &rgn); Q_INVOKABLE bool restoreGeometry(const QByteArray &geometry); Q_INVOKABLE QByteArray saveGeometry() const; Q_INVOKABLE void scroll(int dx, int dy); Q_INVOKABLE void scroll(int dx, int dy, const QRect &r); Q_INVOKABLE void setAttribute(int attribute, bool on = true); Q_INVOKABLE void setBackgroundRole(int role); Q_INVOKABLE void setContentsMargins(int left, int top, int right, int bottom); //Q_INVOKABLE void setEditFocus(bool enable); Q_INVOKABLE void setFixedHeight(int h); Q_INVOKABLE void setFixedSize(const QSize &s); Q_INVOKABLE void setFixedSize(int w, int h); Q_INVOKABLE void setFixedWidth(int w); Q_INVOKABLE void setFocus(int reason); Q_INVOKABLE void setFocusProxy(QWidget *w); Q_INVOKABLE void setForegroundRole(int role); Q_INVOKABLE void setInputContext(QInputContext *context); Q_INVOKABLE void setLayout(QLayout *layout); Q_INVOKABLE void setMask(const QBitmap &bitmap); Q_INVOKABLE void setMask(const QRegion ®ion); Q_INVOKABLE void setParent(QWidget *parent); Q_INVOKABLE void setParent(QWidget *parent, int f); Q_INVOKABLE void setShortcutAutoRepeat(int id, bool enable = true); Q_INVOKABLE void setShortcutEnabled(int id, bool enable = true); Q_INVOKABLE void setStyle(QStyle *style); Q_INVOKABLE void setWindowRole(const QString &role); Q_INVOKABLE void setWindowState(int windowState); Q_INVOKABLE void stackUnder(QWidget *w); Q_INVOKABLE QStyle *style() const; Q_INVOKABLE bool testAttribute(int attribute) const; Q_INVOKABLE bool underMouse() const; Q_INVOKABLE void unsetCursor(); Q_INVOKABLE void update(int x, int y, int w, int h); Q_INVOKABLE void update(const QRect &rect); Q_INVOKABLE void update(const QRegion &rgn); Q_INVOKABLE void updateGeometry(); Q_INVOKABLE QRegion visibleRegion() const; #ifndef Q_WS_WIN Q_INVOKABLE WId winId() const; #endif Q_INVOKABLE QWidget *window() const; Q_INVOKABLE QString windowRole() const; Q_INVOKABLE int windowState() const; Q_INVOKABLE int windowType() const; Q_INVOKABLE QString toString() const; }; #endif qt-client-4.1.0/scriptapi/ralineeditsetup.cpp000066400000000000000000000020751217451700100213210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "racluster.h" #include void setupRaLineEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("AnyStatus",QScriptValue(engine, RaLineEdit::AnyStatus),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Open", QScriptValue(engine, RaLineEdit::Open), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Closed", QScriptValue(engine, RaLineEdit::Closed), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("RaLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/ralineeditsetup.h000066400000000000000000000010561217451700100207640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __RALINEEDITSETUP_H__ #define __RALINEEDITSETUP_H__ void setupRaLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/revisionlineeditsetup.cpp000066400000000000000000000027261217451700100225600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "revisioncluster.h" #include void setupRevisionLineEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("View", QScriptValue(engine, RevisionLineEdit::View), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Use", QScriptValue(engine, RevisionLineEdit::Use), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Maintain",QScriptValue(engine, RevisionLineEdit::Maintain),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("All", QScriptValue(engine, RevisionLineEdit::All), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOM", QScriptValue(engine, RevisionLineEdit::BOM), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("BOO", QScriptValue(engine, RevisionLineEdit::BOO), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("RevisionLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/revisionlineeditsetup.h000066400000000000000000000011001217451700100222060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __REVISIONLINEEDITSETUP_H__ #define __REVISIONLINEEDITSETUP_H__ void setupRevisionLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/screensetup.cpp000066400000000000000000000026111217451700100204540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "screen.h" #include void setupScreen(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("New", QScriptValue(engine, Screen::New), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Edit", QScriptValue(engine, Screen::Edit), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("View", QScriptValue(engine, Screen::View), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NoChanges",QScriptValue(engine, Screen::NoChanges),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Save", QScriptValue(engine, Screen::Save), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Cancel", QScriptValue(engine, Screen::Cancel), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("Screen", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/screensetup.h000066400000000000000000000010421217451700100201160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SCREENSETUP_H__ #define __SCREENSETUP_H__ void setupScreen(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/scriptapi.pro000066400000000000000000000132021217451700100201260ustar00rootroot00000000000000include( ../global.pri ) TARGET = xtuplescriptapi TEMPLATE = lib CONFIG += qt \ warn_on \ staticlib DBFILE = scriptapi.db LANGUAGE = C++ INCLUDEPATH += $${XTUPLE_DIR}/common $${XTUPLE_BLD}/common \ $${XTUPLE_DIR}/widgets $${XTUPLE_BLD}/widgets \ $${XTUPLE_DIR}/widgets/tmp/lib $${XTUPLE_BLD}/widgets/tmp/lib \ $${XTUPLE_DIR}/scriptapi $${XTUPLE_BLD}/scriptapi INCLUDEPATH = $$unique(INCLUDEPATH) DEPENDPATH += $${INCLUDEPATH} DESTDIR = ../lib MOC_DIR = tmp OBJECTS_DIR = tmp UI_DIR = tmp HEADERS += setupscriptapi.h \ include.h \ scriptapi_internal.h \ metasqlhighlighterproto.h \ orreportproto.h \ parameterlistsetup.h \ qactionproto.h \ qboxlayoutproto.h \ qbytearrayproto.h \ qdialogbuttonboxproto.h \ qdialogsetup.h \ qdirproto.h \ qdockwidgetproto.h \ qdomattrproto.h \ qdomcdatasectionproto.h \ qdomcharacterdataproto.h \ qdomcommentproto.h \ qdomdocumentfragmentproto.h \ qdomdocumentproto.h \ qdomdocumenttypeproto.h \ qdomelementproto.h \ qdomentityproto.h \ qdomentityreferenceproto.h \ qdomimplementationproto.h \ qdomnamednodemapproto.h \ qdomnodelistproto.h \ qdomnodeproto.h \ qdomnotationproto.h \ qdomprocessinginstructionproto.h \ qdomtextproto.h \ qdoublevalidatorproto.h \ qintvalidatorproto.h \ qeventproto.h \ qfileproto.h \ qfileinfoproto.h \ qfontproto.h \ qformlayoutproto.h \ qgridlayoutproto.h \ qiconproto.h \ qiodeviceproto.h \ qitemdelegateproto.h \ qlayoutproto.h \ qlayoutitemproto.h \ qmainwindowproto.h \ qmenuproto.h \ qmessageboxsetup.h \ qnetworkreplyproto.h \ qnetworkrequestproto.h \ qprinterproto.h \ qprocessproto.h \ qprocessenvironmentproto.h \ qpushbuttonproto.h \ qsizepolicyproto.h \ qspaceritemproto.h \ qsqldatabaseproto.h \ qsqlerrorproto.h \ qsqlrecordproto.h \ qstackedwidgetproto.h \ qtabwidgetproto.h \ qtextdocumentproto.h \ qtexteditproto.h \ qtimerproto.h \ qtoolbarproto.h \ qtreewidgetitemproto.h \ qtsetup.h \ qurlproto.h \ qvalidatorproto.h \ qwebpageproto.h \ qwebviewproto.h \ qwidgetproto.h \ xdatawidgetmapperproto.h \ xnetworkaccessmanager.h \ xsqltablemodelproto.h \ xsqlqueryproto.h \ addressclustersetup.h \ alarmssetup.h \ clineeditsetup.h \ commentssetup.h \ contactwidgetsetup.h \ crmacctlineeditsetup.h \ currdisplaysetup.h \ documentssetup.h \ glclustersetup.h \ itemlineeditsetup.h \ orderlineeditsetup.h \ parametereditproto.h \ parametergroupsetup.h \ projectlineeditsetup.h \ ralineeditsetup.h \ revisionlineeditsetup.h \ screensetup.h \ shipmentclusterlineeditsetup.h \ vendorgroupsetup.h \ wcomboboxsetup.h \ womatlclustersetup.h \ xdateeditsetup.h \ xsqltablenodeproto.h \ xt.h \ xvariantsetup.h SOURCES += setupscriptapi.cpp \ include.cpp \ metasqlhighlighterproto.cpp \ orreportproto.cpp \ parameterlistsetup.cpp \ qactionproto.cpp \ qboxlayoutproto.cpp \ qbytearrayproto.cpp \ qdialogbuttonboxproto.cpp \ qdialogsetup.cpp \ qdirproto.cpp \ qdockwidgetproto.cpp \ qdomattrproto.cpp \ qdomcdatasectionproto.cpp \ qdomcharacterdataproto.cpp \ qdomcommentproto.cpp \ qdomdocumentfragmentproto.cpp \ qdomdocumentproto.cpp \ qdomdocumenttypeproto.cpp \ qdomelementproto.cpp \ qdomentityproto.cpp \ qdomentityreferenceproto.cpp \ qdomimplementationproto.cpp \ qdomnamednodemapproto.cpp \ qdomnodelistproto.cpp \ qdomnodeproto.cpp \ qdomnotationproto.cpp \ qdomprocessinginstructionproto.cpp \ qdomtextproto.cpp \ qdoublevalidatorproto.cpp \ qintvalidatorproto.cpp \ qeventproto.cpp \ qfileproto.cpp \ qfileinfoproto.cpp \ qfontproto.cpp \ qformlayoutproto.cpp \ qgridlayoutproto.cpp \ qiconproto.cpp \ qiodeviceproto.cpp \ qitemdelegateproto.cpp \ qlayoutitemproto.cpp \ qlayoutproto.cpp \ qmainwindowproto.cpp \ qmenuproto.cpp \ qmessageboxsetup.cpp \ qnetworkreplyproto.cpp \ qnetworkrequestproto.cpp \ qprinterproto.cpp \ qprocessproto.cpp \ qprocessenvironmentproto.cpp \ qpushbuttonproto.cpp \ qsizepolicyproto.cpp \ qspaceritemproto.cpp \ qsqldatabaseproto.cpp \ qsqlerrorproto.cpp \ qsqlrecordproto.cpp \ qstackedwidgetproto.cpp \ qtabwidgetproto.cpp \ qtextdocumentproto.cpp \ qtexteditproto.cpp \ qtimerproto.cpp \ qtoolbarproto.cpp \ qtreewidgetitemproto.cpp \ qtsetup.cpp \ qurlproto.cpp \ qvalidatorproto.cpp \ qwebpageproto.cpp \ qwebviewproto.cpp \ qwidgetproto.cpp \ xdatawidgetmapperproto.cpp \ xnetworkaccessmanager.cpp \ xsqltablemodelproto.cpp \ xsqlqueryproto.cpp \ addressclustersetup.cpp \ alarmssetup.cpp \ clineeditsetup.cpp \ commentssetup.cpp \ contactwidgetsetup.cpp \ crmacctlineeditsetup.cpp \ currdisplaysetup.cpp \ documentssetup.cpp \ glclustersetup.cpp \ itemlineeditsetup.cpp \ orderlineeditsetup.cpp \ parametereditproto.cpp \ parametergroupsetup.cpp \ projectlineeditsetup.cpp \ ralineeditsetup.cpp \ revisionlineeditsetup.cpp \ screensetup.cpp \ shipmentclusterlineeditsetup.cpp \ vendorgroupsetup.cpp \ wcomboboxsetup.cpp \ womatlclustersetup.cpp \ xdateeditsetup.cpp \ xsqltablnodeproto.cpp \ xt.cpp \ xvariantsetup.cpp QT += sql \ xml \ script \ network \ webkit qt-client-4.1.0/scriptapi/scriptapi_internal.h000066400000000000000000000015501217451700100214540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* This file should be included by all .cpp files in the scriptapi dir and /only/ .cpp files in the scriptapi dir */ #ifndef __SCRIPTAPI_INTERNAL_H__ #define __SCRIPTAPI_INTERNAL_H__ #define CTORPROPFLAGS (QScriptValue::ReadOnly | QScriptValue::Undeletable) #define ENUMPROPFLAGS (QScriptValue::ReadOnly | QScriptValue::Undeletable) #define STATICPROPFLAGS (QScriptValue::ReadOnly | QScriptValue::Undeletable) #endif qt-client-4.1.0/scriptapi/setupscriptapi.cpp000066400000000000000000000163741217451700100212060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "addressclustersetup.h" #include "alarmssetup.h" #include "calendarTools.h" #include "clineeditsetup.h" #include "commentssetup.h" #include "contactwidgetsetup.h" #include "crmacctlineeditsetup.h" #include "currdisplaysetup.h" #include "documentssetup.h" #include "empcluster.h" #include "exporthelper.h" #include "filemoveselector.h" #include "glclustersetup.h" #include "include.h" #include "itemlineeditsetup.h" #include "metasqlhighlighterproto.h" #include "orderlineeditsetup.h" #include "orreportproto.h" #include "parametereditproto.h" #include "parametergroupsetup.h" #include "parameterlistsetup.h" #include "parameterwidget.h" #include "projectlineeditsetup.h" #include "qactionproto.h" #include "qboxlayoutproto.h" #include "qbytearrayproto.h" #include "qdialogsetup.h" #include "qdialogbuttonboxproto.h" #include "qdirproto.h" #include "qdockwidgetproto.h" #include "qdomattrproto.h" #include "qdomcdatasectionproto.h" #include "qdomcharacterdataproto.h" #include "qdomcommentproto.h" #include "qdomdocumentfragmentproto.h" #include "qdomdocumentproto.h" #include "qdomdocumenttypeproto.h" #include "qdomelementproto.h" #include "qdomentityproto.h" #include "qdomentityreferenceproto.h" #include "qdomimplementationproto.h" #include "qdomnamednodemapproto.h" #include "qdomnodelistproto.h" #include "qdomnodeproto.h" #include "qdomnotationproto.h" #include "qdomprocessinginstructionproto.h" #include "qdomtextproto.h" #include "qdoublevalidatorproto.h" #include "qintvalidatorproto.h" #include "qeventproto.h" #include "qfileproto.h" #include "qfileinfoproto.h" #include "qfontproto.h" #include "qformlayoutproto.h" #include "qgridlayoutproto.h" #include "qiconproto.h" #include "qiodeviceproto.h" #include "qitemdelegateproto.h" #include "qlayoutitemproto.h" #include "qlayoutproto.h" #include "qmainwindowproto.h" #include "qmenuproto.h" #include "qmessageboxsetup.h" #include "qnetworkreplyproto.h" #include "qnetworkrequestproto.h" #include "qprinterproto.h" #include "qprocessproto.h" #include "qprocessenvironmentproto.h" #include "qpushbuttonproto.h" #include "qsizepolicyproto.h" #include "qspaceritemproto.h" #include "qsqldatabaseproto.h" #include "qsqlerrorproto.h" #include "qsqlrecordproto.h" #include "qstackedwidgetproto.h" #include "qtabwidgetproto.h" #include "qtextdocumentproto.h" #include "qtexteditproto.h" #include "qtimerproto.h" #include "qtoolbarproto.h" #include "qtreewidgetitemproto.h" #include "qtsetup.h" #include "queryset.h" #include "qurlproto.h" #include "qvalidatorproto.h" #include "qwebpageproto.h" #include "qwebviewproto.h" #include "qwidgetproto.h" #include "ralineeditsetup.h" #include "recurrencewidget.h" #include "revisionlineeditsetup.h" #include "screensetup.h" #include "setupscriptapi.h" #include "shipmentclusterlineeditsetup.h" #include "usernamecluster.h" #include "vendorgroupsetup.h" #include "wcomboboxsetup.h" #include "wocluster.h" #include "womatlclustersetup.h" #include "xcheckbox.h" #include "xcombobox.h" #include "xdatawidgetmapperproto.h" #include "xdateeditsetup.h" #include "xdoccopysetter.h" #include "xnetworkaccessmanager.h" #include "xsqltablemodelproto.h" #include "xsqlqueryproto.h" #include "xt.h" #include "xtreewidget.h" #include "xvariantsetup.h" /*! \defgroup scriptapi The xTuple ERP Scripting API The xTuple ERP Scripting API defines the interface between extension %scripts and the xTuple ERP C++ core. */ void setupScriptApi(QScriptEngine *engine) { setupAddressCluster(engine); setupAlarms(engine); setupCLineEdit(engine); setupCRMAcctLineEdit(engine); setupComments(engine); setupContactWidget(engine); setupCurrDisplay(engine); setupDocuments(engine); setupEmpCluster(engine); setupEmpClusterLineEdit(engine); setupExportHelper(engine); setupFileMoveSelector(engine); setupGLCluster(engine); setupInclude(engine); setupItemLineEdit(engine); setupMetaSQLHighlighterProto(engine); setupOrderLineEdit(engine); setupOrReportProto(engine); setupParameterEditProto(engine); setupParameterGroup(engine); setupParameterList(engine); setupParameterWidget(engine); setupPeriodListViewItem(engine); setupProjectLineEdit(engine); setupQActionProto(engine); setupQBoxLayoutProto(engine); setupQByteArrayProto(engine); setupQDialog(engine); setupQDialogButtonBoxProto(engine); setupQDirProto(engine); setupQDockWidgetProto(engine); setupQDomAttrProto(engine); setupQDomCDATASectionProto(engine); setupQDomCharacterDataProto(engine); setupQDomCommentProto(engine); setupQDomDocumentFragmentProto(engine); setupQDomDocumentProto(engine); setupQDomDocumentTypeProto(engine); setupQDomElementProto(engine); setupQDomEntityProto(engine); setupQDomEntityReferenceProto(engine); setupQDomImplementationProto(engine); setupQDomNamedNodeMapProto(engine); setupQDomNodeListProto(engine); setupQDomNodeProto(engine); setupQDomNotationProto(engine); setupQDomProcessingInstructionProto(engine); setupQDomTextProto(engine); setupQDoubleValidatorProto(engine); setupQIntValidatorProto(engine); setupQEventProto(engine); setupQFileProto(engine); setupQFileInfoProto(engine); setupQFontProto(engine); setupQFormLayoutProto(engine); setupQGridLayoutProto(engine); setupQIconProto(engine); setupQIODeviceProto(engine); setupQItemDelegateProto(engine); setupQLayoutItemProto(engine); setupQLayoutProto(engine); setupQMainWindowProto(engine); setupQMenuProto(engine); setupQMessageBox(engine); setupQNetworkAccessManagerProto(engine); setupQNetworkReplyProto(engine); setupQNetworkRequestProto(engine); setupQPrinterProto(engine); setupQProcessProto(engine); setupQProcessEnvironmentProto(engine); setupQPushButtonProto(engine); setupQSizePolicy(engine); setupQSpacerItem(engine); setupQSqlDatabaseProto(engine); setupQSqlErrorProto(engine); setupQSqlRecordProto(engine); setupQStackedWidgetProto(engine); setupQTabWidgetProto(engine); setupQTextDocumentProto(engine); setupQTextEditProto(engine); setupQTimerProto(engine); setupQToolBarProto(engine); setupQTreeWidgetItemProto(engine); setupQt(engine); setupQuerySet(engine); setupQUrlProto(engine); setupQValidatorProto(engine); setupQWebPageProto(engine); setupQWebViewProto(engine); setupQWidgetProto(engine); setupRaLineEdit(engine); setupRecurrenceWidget(engine); setupRevisionLineEdit(engine); setupScreen(engine); setupShipmentClusterLineEdit(engine); setupUsernameCluster(engine); setupUsernameLineEdit(engine); setupVendorGroup(engine); setupWComboBox(engine); setupWoCluster(engine); setupWomatlCluster(engine); setupXCheckBox(engine); setupXComboBox(engine); setupXDataWidgetMapperProto(engine); setupXDateEdit(engine); setupXDocCopySetter(engine); setupXSqlTableModelProto(engine); setupXSqlQueryProto(engine); setupXt(engine); setupXTreeWidget(engine); setupXTreeWidgetItem(engine); setupXVariant(engine); } qt-client-4.1.0/scriptapi/setupscriptapi.h000066400000000000000000000011011217451700100206310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SETUPSCRIPTAPI_H__ #define __SETUPSCRIPTAPI_H__ class QScriptEngine; void setupScriptApi(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/shipmentclusterlineeditsetup.cpp000066400000000000000000000022341217451700100241450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shipmentcluster.h" #include void setupShipmentClusterLineEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("All", QScriptValue(engine, ShipmentClusterLineEdit::All), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrder", QScriptValue(engine, ShipmentClusterLineEdit::SalesOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrder",QScriptValue(engine, ShipmentClusterLineEdit::TransferOrder),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ShipmentClusterLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/shipmentclusterlineeditsetup.h000066400000000000000000000011251217451700100236100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SHIPMENTCLUSTERLINEEDITSETUP_H__ #define __SHIPMENTCLUSTERLINEEDITSETUP_H__ void setupShipmentClusterLineEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/vendorgroupsetup.cpp000066400000000000000000000023431217451700100215510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorgroup.h" #include void setupVendorGroup(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("All", QScriptValue(engine, VendorGroup::All), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Selected", QScriptValue(engine, VendorGroup::Selected), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SelectedType", QScriptValue(engine, VendorGroup::SelectedType),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TypePattern", QScriptValue(engine, VendorGroup::TypePattern), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("VendorGroup", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/vendorgroupsetup.h000066400000000000000000000010611217451700100212120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __VENDORGROUPSETUP_H__ #define __VENDORGROUPSETUP_H__ void setupVendorGroup(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/wcomboboxsetup.cpp000066400000000000000000000035241217451700100212000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "warehouseCluster.h" #include void setupWComboBox(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("All", QScriptValue(engine, WComboBox::All), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllActive", QScriptValue(engine, WComboBox::AllActive), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("NonTransit", QScriptValue(engine, WComboBox::NonTransit), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Shipping", QScriptValue(engine, WComboBox::Shipping), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Sold", QScriptValue(engine, WComboBox::Sold), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Supply", QScriptValue(engine, WComboBox::Supply), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Transit", QScriptValue(engine, WComboBox::Transit), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllActiveInventory",QScriptValue(engine, WComboBox::AllActiveInventory),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("WComboBox", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/wcomboboxsetup.h000066400000000000000000000010531217451700100206400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WCOMBOBOXSETUP_H__ #define __WCOMBOBOXSETUP_H__ void setupWComboBox(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/womatlclustersetup.cpp000066400000000000000000000027341217451700100221100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "wocluster.h" #include void setupWomatlCluster(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("WorkOrder", QScriptValue(engine, WomatlCluster::WorkOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WoMaterial", QScriptValue(engine, WomatlCluster::WoMaterial), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Wooper", QScriptValue(engine, WomatlCluster::Wooper), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Pull", QScriptValue(engine, WomatlCluster::Pull), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Push", QScriptValue(engine, WomatlCluster::Push), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Mixed", QScriptValue(engine, WomatlCluster::Mixed), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("WomatlCluster", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/womatlclustersetup.h000066400000000000000000000010671217451700100215530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WOMATLCLUSTERSETUP_H__ #define __WOMATLCLUSTERSETUP_H__ void setupWomatlCluster(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/xdatawidgetmapperproto.cpp000066400000000000000000000137751217451700100227270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xdatawidgetmapperproto.h" #include "xdatawidgetmapper.h" void setupXDataWidgetMapperProto(QScriptEngine *engine) { QScriptValue mapperproto = engine->newQObject(new XDataWidgetMapperProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), mapperproto); } XDataWidgetMapperProto::XDataWidgetMapperProto(QObject *parent) : QObject(parent) { } /* compiler errors (confusion between int and char*) void XDataWidgetMapperProto::addMapping(QWidget *widget, int section) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->addMapping(widget, section); } */ /* compiler errors (confusion between int and char*) void XDataWidgetMapperProto::addMapping(QWidget *widget, int section, const QByteArray &propertyName) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->addMapping(widget, section, propertyName); } */ void XDataWidgetMapperProto::clearMapping() { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->clearMapping(); } int XDataWidgetMapperProto::currentIndex() const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->currentIndex(); return -1; } QAbstractItemDelegate *XDataWidgetMapperProto::itemDelegate() const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->itemDelegate(); return 0; } QByteArray XDataWidgetMapperProto::mappedPropertyName(QWidget *widget) const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->mappedPropertyName(widget); return QByteArray(); } int XDataWidgetMapperProto::mappedSection(QWidget *widget) const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->mappedSection(widget); return -1; } QWidget *XDataWidgetMapperProto::mappedWidgetAt(int section) const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->mappedWidgetAt(section); return 0; } QAbstractItemModel *XDataWidgetMapperProto::model() const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->model(); return 0; } int XDataWidgetMapperProto::orientation() const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return (int)(item->orientation()); return 0; } void XDataWidgetMapperProto::removeMapping(QWidget *widget) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->removeMapping(widget); } QModelIndex XDataWidgetMapperProto::rootIndex() const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->rootIndex(); return QModelIndex(); } void XDataWidgetMapperProto::setItemDelegate(QAbstractItemDelegate *delegate) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->setItemDelegate(delegate); } void XDataWidgetMapperProto::setModel(QAbstractItemModel *model) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->setModel(model); } void XDataWidgetMapperProto::setOrientation(int orientation) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->setOrientation((Qt::Orientation)orientation); } void XDataWidgetMapperProto::setRootIndex(const QModelIndex &index) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->setRootIndex(index); } void XDataWidgetMapperProto::setSubmitPolicy(int policy) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->setSubmitPolicy((QDataWidgetMapper::SubmitPolicy)policy); } int XDataWidgetMapperProto::submitPolicy() const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->submitPolicy(); return -1; } QByteArray XDataWidgetMapperProto::mappedDefaultName(QWidget *widget) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return item->mappedDefaultName(widget); return QByteArray(); } void XDataWidgetMapperProto::addMapping(QWidget *widget, QString fieldName) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->addMapping(widget, fieldName); } void XDataWidgetMapperProto::addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->addMapping(widget, fieldName, propertyName); } void XDataWidgetMapperProto::addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName, const QByteArray &defaultName) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->addMapping(widget, fieldName, propertyName, defaultName); } void XDataWidgetMapperProto::removeDefault(QWidget *widget) { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) item->removeDefault(widget); } QString XDataWidgetMapperProto::toString() const { XDataWidgetMapper *item = qscriptvalue_cast(thisObject()); if (item) return QString("[XDataWidgetMapper(%1)]").arg(item->objectName()); return QString("[XDataWidgetMapper(unknown)]"); } qt-client-4.1.0/scriptapi/xdatawidgetmapperproto.h000066400000000000000000000050201217451700100223540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XWIDGETDATAMAPPERPROTO_H__ #define __XWIDGETDATAMAPPERPROTO_H__ #include #include class QAbstractItemDelegate; class XDataWidgetMapper; Q_DECLARE_METATYPE(XDataWidgetMapper*) void setupXDataWidgetMapperProto(QScriptEngine *engine); class XDataWidgetMapperProto : public QObject, public QScriptable { Q_OBJECT public: XDataWidgetMapperProto(QObject *parent = 0); Q_INVOKABLE void addMapping(QWidget *widget, QString fieldName); Q_INVOKABLE void addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName); Q_INVOKABLE void addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName, const QByteArray &defaultName); /* compiler errors (confusion between int and char*) Q_INVOKABLE void addMapping(QWidget *widget, int section); Q_INVOKABLE void addMapping(QWidget *widget, int section, const QByteArray &propertyName); */ Q_INVOKABLE void clearMapping(); Q_INVOKABLE int currentIndex() const; Q_INVOKABLE QAbstractItemDelegate *itemDelegate() const; Q_INVOKABLE QByteArray mappedDefaultName(QWidget *widget); Q_INVOKABLE QByteArray mappedPropertyName(QWidget *widget) const; Q_INVOKABLE int mappedSection(QWidget *widget) const; Q_INVOKABLE QWidget *mappedWidgetAt(int section) const; Q_INVOKABLE QAbstractItemModel *model() const; Q_INVOKABLE int orientation() const; Q_INVOKABLE void removeDefault(QWidget *widget); Q_INVOKABLE void removeMapping(QWidget *widget); Q_INVOKABLE QModelIndex rootIndex() const; Q_INVOKABLE void setItemDelegate(QAbstractItemDelegate *delegate); Q_INVOKABLE void setModel(QAbstractItemModel *model); Q_INVOKABLE void setOrientation(int orientation); Q_INVOKABLE void setRootIndex(const QModelIndex &index); Q_INVOKABLE void setSubmitPolicy(int policy); Q_INVOKABLE int submitPolicy() const; public slots: virtual QString toString() const; }; #endif qt-client-4.1.0/scriptapi/xdateeditsetup.cpp000066400000000000000000000020641217451700100211520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "datecluster.h" #include void setupXDateEdit(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Empty", QScriptValue(engine, XDateEdit::Empty), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Current", QScriptValue(engine, XDateEdit::Current), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("None", QScriptValue(engine, XDateEdit::None), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("XDateEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/scriptapi/xdateeditsetup.h000066400000000000000000000010531217451700100206140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XDATEEDITSETUP_H__ #define __XDATEEDITSETUP_H__ void setupXDateEdit(QScriptEngine *engine); #endif qt-client-4.1.0/scriptapi/xnetworkaccessmanager.cpp000066400000000000000000000074511217451700100225210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xnetworkaccessmanager.h" #include #include #include #include #include #include #define DEBUG false // support functions void setupQNetworkAccessManagerProto(QScriptEngine *engine) { if (DEBUG) qDebug("setupQNetworkAccessManagerProto entered"); QScriptValue netmgrproto = engine->newQObject(new XNetworkAccessManager(engine)); engine->setDefaultPrototype(qMetaTypeId(), netmgrproto); QScriptValue netmgrConstructor = engine->newFunction(constructQNetworkAccessManager, netmgrproto); engine->globalObject().setProperty("QNetworkAccessManager", netmgrConstructor); } QScriptValue constructQNetworkAccessManager(QScriptContext *context, QScriptEngine *engine) { if (DEBUG) qDebug("constructQNetworkAccessManager called"); XNetworkAccessManager *netmgr = 0; if (context->argumentCount() == 1) { if (DEBUG) qDebug("netmgr(1 arg)"); netmgr = new XNetworkAccessManager(context->argument(0).toQObject()); } else netmgr = new XNetworkAccessManager(); return engine->toScriptValue(netmgr); } // XNetworkAccessManager itself XNetworkAccessManager::XNetworkAccessManager(QObject *parent) : QNetworkAccessManager(parent) { } QNetworkCookieJar *XNetworkAccessManager::cookieJar() const { return QNetworkAccessManager::cookieJar(); } QNetworkReply *XNetworkAccessManager::get(const QNetworkRequest &request) { return QNetworkAccessManager::get(request); } QNetworkReply *XNetworkAccessManager::head(const QNetworkRequest &request) { return QNetworkAccessManager::head(request); } QNetworkReply *XNetworkAccessManager::post(const QNetworkRequest &request, QIODevice *data) { return QNetworkAccessManager::post(request, data); } QNetworkReply *XNetworkAccessManager::post(const QNetworkRequest &request, const QByteArray &data) { return QNetworkAccessManager::post(request, data); } QNetworkReply *XNetworkAccessManager::post(const QNetworkRequest &request, const QString &data) { if (DEBUG) qDebug("XNetworkAccessManager::post(QNetworkRequest, QString) entered"); return QNetworkAccessManager::post(request, data.toAscii()); } QNetworkProxy XNetworkAccessManager::proxy() const { return QNetworkAccessManager::proxy(); } QNetworkReply *XNetworkAccessManager::put(const QNetworkRequest &request, QIODevice *data) { return QNetworkAccessManager::put(request, data); } QNetworkReply * XNetworkAccessManager::put(const QNetworkRequest &request, const QByteArray &data) { return QNetworkAccessManager::put(request, data); } void XNetworkAccessManager::setCookieJar(QNetworkCookieJar *cookieJar) { QNetworkAccessManager::setCookieJar(cookieJar); } void XNetworkAccessManager::setProxy(const QNetworkProxy &proxy) { QNetworkAccessManager::setProxy(proxy); } QString XNetworkAccessManager::toString() const { return QString("[QNetworkAccessManager(%1)]") .arg(parent() ? parent()->objectName() : QString("unparented")); } qt-client-4.1.0/scriptapi/xnetworkaccessmanager.h000066400000000000000000000043011217451700100221550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XNETWORKACCESSMANAGER_H__ #define __XNETWORKACCESSMANAGER_H__ #include #include #include #include class QByteArray; class QIODevice; class QNetworkCookieJar; class QNetworkReply; class QNetworkRequest; class QSslError; void setupQNetworkAccessManagerProto(QScriptEngine *engine); QScriptValue constructQNetworkAccessManager(QScriptContext *context, QScriptEngine *engine); class XNetworkAccessManager : public QNetworkAccessManager { Q_OBJECT public: XNetworkAccessManager(QObject *parent = 0); Q_INVOKABLE QNetworkCookieJar *cookieJar() const; Q_INVOKABLE QNetworkReply *get(const QNetworkRequest &request); Q_INVOKABLE QNetworkReply *head(const QNetworkRequest &request); Q_INVOKABLE QNetworkReply *post(const QNetworkRequest &request, QIODevice *data); Q_INVOKABLE QNetworkReply *post(const QNetworkRequest &request, const QByteArray &data); Q_INVOKABLE QNetworkReply *post(const QNetworkRequest &request, const QString &data); Q_INVOKABLE QNetworkProxy proxy() const; Q_INVOKABLE QNetworkReply *put(const QNetworkRequest &request, QIODevice *data); Q_INVOKABLE QNetworkReply *put(const QNetworkRequest &request, const QByteArray &data); Q_INVOKABLE void setCookieJar(QNetworkCookieJar *cookieJar); Q_INVOKABLE void setProxy(const QNetworkProxy &proxy); Q_INVOKABLE QString toString() const; }; Q_DECLARE_METATYPE(XNetworkAccessManager*) #endif qt-client-4.1.0/scriptapi/xsqlqueryproto.cpp000066400000000000000000000110461217451700100212570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xsqlqueryproto.h" #include void setupXSqlQueryProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new XSqlQueryProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); engine->setDefaultPrototype(qMetaTypeId(), proto); /* QScriptValue constructor = engine->newFunction(constructXSqlQuery, proto); engine->globalObject().setProperty("XSqlQuery", constructor); */ } /* QScriptValue constructXSqlQuery(QScriptContext * context, QScriptEngine *engine) { XSqlQuery *obj = 0; if (context->argumentCount() == 1) obj = new XSqlQuery(context->argument(1).toQObject()); else obj = new XSqlQuery(); return engine->toScriptValue(obj); } */ XSqlQueryProto::XSqlQueryProto(QObject * parent) : QObject(parent) { } QSqlRecord XSqlQueryProto::record() const { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->record(); return QSqlRecord(); } bool XSqlQueryProto::isActive() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->isActive(); return false; } bool XSqlQueryProto::isValid() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->isValid(); return false; } bool XSqlQueryProto::isForwardOnly() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->isForwardOnly(); return true; } bool XSqlQueryProto::isSelect() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->isSelect(); return true; } bool XSqlQueryProto::first() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->first(); return false; } bool XSqlQueryProto::last() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->last(); return true; } bool XSqlQueryProto::next() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->next(); return false; } bool XSqlQueryProto::previous() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->previous(); return false; } int XSqlQueryProto::size() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->size(); return 0; } int XSqlQueryProto::numRowsAffected() { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->numRowsAffected(); return 0; } QVariant XSqlQueryProto::value(int index) { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->value(index); return QVariant(); } QVariant XSqlQueryProto::value(const QString & field) { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->value(field); return QVariant(); } QVariantMap XSqlQueryProto::lastError() { QVariantMap m; XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) { QSqlError err = item->lastError(); m.insert("databaseText", err.databaseText()); m.insert("driverText", err.driverText()); m.insert("text", err.text()); m.insert("number", err.number()); m.insert("type", err.type()); m.insert("isValid", QVariant(err.isValid())); } return m; } QString XSqlQueryProto::toString() const { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->lastQuery(); return QString(); } int XSqlQueryProto::findFirst(int col, int val) { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->findFirst(col, val); return -1; } int XSqlQueryProto::findFirst(const QString & col, int val) { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->findFirst(col, val); return -1; } int XSqlQueryProto::findFirst(const QString & col, const QString & val) { XSqlQuery *item = qscriptvalue_cast(thisObject()); if (item) return item->findFirst(col, val); return -1; } qt-client-4.1.0/scriptapi/xsqlqueryproto.h000066400000000000000000000031471217451700100207270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SCRIPTQUERY_H__ #define __SCRIPTQUERY_H__ #include #include #include #include #include Q_DECLARE_METATYPE(XSqlQuery*) Q_DECLARE_METATYPE(XSqlQuery) void setupXSqlQueryProto(QScriptEngine *engine); //QScriptValue constructXSqlQuery(QScriptContext *context, QScriptEngine *engine); class XSqlQueryProto : public QObject, public QScriptable { Q_OBJECT public: XSqlQueryProto(QObject * parent = 0); Q_INVOKABLE QSqlRecord record() const; Q_INVOKABLE QString toString() const; Q_INVOKABLE bool isActive(); Q_INVOKABLE bool isValid(); Q_INVOKABLE bool isForwardOnly(); Q_INVOKABLE bool isSelect(); Q_INVOKABLE int size(); Q_INVOKABLE int numRowsAffected(); Q_INVOKABLE QVariant value(int index); Q_INVOKABLE QVariant value(const QString & field); Q_INVOKABLE QVariantMap lastError(); Q_INVOKABLE int findFirst(int, int); Q_INVOKABLE int findFirst(const QString &, int); Q_INVOKABLE int findFirst(const QString &, const QString &); public slots: bool first(); bool last(); bool next(); bool previous(); }; #endif // __SCRIPTQUERY_H__ qt-client-4.1.0/scriptapi/xsqltablemodelproto.cpp000066400000000000000000000372001217451700100222220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xsqltablemodelproto.h" #include "parameterlistsetup.h" #include void setupXSqlTableModelProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new XSqlTableModelProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructXSqlTableModel, proto); engine->globalObject().setProperty("XSqlTableModel", constructor); } QScriptValue constructXSqlTableModel(QScriptContext * context, QScriptEngine *engine) { XSqlTableModel *obj = 0; if (context->argumentCount() == 1) obj = new XSqlTableModel(context->argument(1).toQObject()); else obj = new XSqlTableModel(); return engine->toScriptValue(obj); } XSqlTableModelProto::XSqlTableModelProto(QObject *parent) : QObject(parent) { } QModelIndex XSqlTableModelProto::buddy(const QModelIndex &index) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->buddy(index); return QModelIndex(); } bool XSqlTableModelProto::canFetchMore(const QModelIndex &parent) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->canFetchMore(parent); return false; } void XSqlTableModelProto::clear() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } int XSqlTableModelProto::columnCount(const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->columnCount(parent); return 0; } QVariant XSqlTableModelProto::data(const QModelIndex &item, int role) const { XSqlTableModel *tmpitem = qscriptvalue_cast(thisObject()); if (tmpitem) return tmpitem->data(item, role); return QVariant(); } QSqlDatabase XSqlTableModelProto::database() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->database(); return QSqlDatabase(); } bool XSqlTableModelProto::dropMimeData(const QMimeData *data, int action, int row, int column, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->dropMimeData(data, (Qt::DropAction)action, row, column, parent); return false; } int XSqlTableModelProto::editStrategy() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->editStrategy(); return 0; } void XSqlTableModelProto::fetchMore(const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->fetchMore(parent); } int XSqlTableModelProto::fieldIndex(const QString &fieldName) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->fieldIndex(fieldName); return 0; } QString XSqlTableModelProto::filter() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->filter(); return QString(); } int XSqlTableModelProto::flags(const QModelIndex &index) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->flags(index); return 0; } bool XSqlTableModelProto::hasIndex(int row, int column, const QModelIndex &parent) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->hasIndex(row, column, parent); return false; } QVariant XSqlTableModelProto::headerData(int section, int orientation, int role) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->headerData(section, (Qt::Orientation)orientation, role); return QVariant(); } QModelIndex XSqlTableModelProto::index(int row, int column, const QModelIndex &parent) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->index(row, column, parent); return QModelIndex(); } bool XSqlTableModelProto::insertColumn(int column, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->insertColumn(column, parent); return false; } bool XSqlTableModelProto::insertColumns(int column, int count, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->insertColumns(column, count, parent); return false; } bool XSqlTableModelProto::insertRecord(int row, const QSqlRecord &record) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->insertRecord(row, record); return false; } bool XSqlTableModelProto::insertRow(int row, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->insertRow(row, parent); return false; } bool XSqlTableModelProto::insertRows(int row, int count, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->insertRows(row, count, parent); return false; } bool XSqlTableModelProto::isDirty(const QModelIndex &index) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->isDirty(index); return false; } QMap XSqlTableModelProto::itemData(const QModelIndex &index) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->itemData(index); return QMap(); } QSqlError XSqlTableModelProto::lastError() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->lastError(); return QSqlError(); } QModelIndexList XSqlTableModelProto::match(const QModelIndex &start, int role, const QVariant &value, int hits, int flags) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->match(start, role, value, hits, (Qt::MatchFlags)flags); return QModelIndexList(); } QMimeData *XSqlTableModelProto::mimeData(const QModelIndexList &indexes) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->mimeData(indexes); return 0; } QStringList XSqlTableModelProto::mimeTypes() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->mimeTypes(); return QStringList(); } QSqlIndex XSqlTableModelProto::primaryKey() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->primaryKey(); return QSqlIndex(); } QSqlQuery XSqlTableModelProto::query() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->query(); return QSqlQuery(); } QSqlRecord XSqlTableModelProto::record() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->record(); return QSqlRecord(); } QSqlRecord XSqlTableModelProto::record(int row) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->record(row); return QSqlRecord(); } QSqlRelation XSqlTableModelProto::relation(int column) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->relation(column); return QSqlRelation(); } QSqlTableModel *XSqlTableModelProto::relationModel(int column) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->relationModel(column); return 0; } bool XSqlTableModelProto::removeColumn(int column, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->removeColumn(column, parent); return false; } bool XSqlTableModelProto::removeColumns(int column, int count, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->removeColumns(column, count, parent); return false; } bool XSqlTableModelProto::removeRows(int row, int count, const QModelIndex &parent) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->removeRows(row, count, parent); return false; } void XSqlTableModelProto::revertRow(int row) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->revertRow(row); } int XSqlTableModelProto::rowCount(const QModelIndex &parent) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->rowCount(parent); return 0; } bool XSqlTableModelProto::select() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->select(); return false; } bool XSqlTableModelProto::setData(const QModelIndex &index, const QVariant &value, int role) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->setData(index, value, role); return false; } void XSqlTableModelProto::setEditStrategy(int strategy) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->setEditStrategy((QSqlTableModel::EditStrategy)strategy); } void XSqlTableModelProto::setFilter(const QString &filter) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->setFilter(filter); } bool XSqlTableModelProto::setHeaderData(int section, int orientation, const QVariant &value, int role) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->setHeaderData(section, (Qt::Orientation)orientation, value, role); return false; } bool XSqlTableModelProto::setItemData(const QModelIndex &index, const QMap &roles) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->setItemData(index, roles); return false; } void XSqlTableModelProto::setKeys(int keyColumns) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->setKeys(keyColumns); } bool XSqlTableModelProto::setRecord(int row, const QSqlRecord &record) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->setRecord(row, record); return false; } void XSqlTableModelProto::setRelation(int column, const QSqlRelation &relation) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->setRelation(column, relation); } void XSqlTableModelProto::setSort(int column, int order) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->setSort(column, (Qt::SortOrder)order); } void XSqlTableModelProto::setSupportedDragActions(int actions) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->setSupportedDragActions((Qt::DropActions)actions); } void XSqlTableModelProto::setTable(const QString &tableName, int keyColumns) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->setTable(tableName, keyColumns); } QModelIndex XSqlTableModelProto::sibling(int row, int column, const QModelIndex &index) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->sibling(row, column, index); return QModelIndex(); } void XSqlTableModelProto::sort(int column, int order) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->sort(column, (Qt::SortOrder)order); } QSize XSqlTableModelProto::span(const QModelIndex &index) const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->span(index); return QSize(); } int XSqlTableModelProto::supportedDragActions() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->supportedDragActions(); return 0; } int XSqlTableModelProto::supportedDropActions() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->supportedDropActions(); return 0; } QString XSqlTableModelProto::tableName() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->tableName(); return QString(); } QString XSqlTableModelProto::toString() const { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return QString("[XSqlTableModelProto(table %1, query %2)]") .arg(item->tableName()) .arg(item->query().lastQuery().left(80)); return QString(); } int XSqlTableModelProto::nodeCount() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->nodeCount(); return 0; } void XSqlTableModelProto::appendChild(XSqlTableNode *child) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->appendChild(child); } void XSqlTableModelProto::clearChildren() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->clearChildren(); } void XSqlTableModelProto::removeChild(int index) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->removeChild(index); } XSqlTableNode* XSqlTableModelProto::appendChild(const QString &tableName, ParameterList &relations) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->appendChild(tableName, relations); return 0; } QList XSqlTableModelProto::children() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->children(); return QList(); } XSqlTableNode* XSqlTableModelProto::child(int index) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->child(index); return 0; } XSqlTableNode* XSqlTableModelProto::child(const QString &tableName) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->child(tableName); return 0; } void XSqlTableModelProto::set(ParameterList params) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->set(params); } ParameterList XSqlTableModelProto::parameters() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->parameters(); return ParameterList(); } void XSqlTableModelProto::loadAll() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->loadAll(); } void XSqlTableModelProto::load(int row) { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) item->load(row); } bool XSqlTableModelProto::save() { XSqlTableModel *item = qscriptvalue_cast(thisObject()); if (item) return item->save(); return false; } qt-client-4.1.0/scriptapi/xsqltablemodelproto.h000066400000000000000000000150461217451700100216730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XSQLTABLEMODELPROTO_H__ #define __XSQLTABLEMODELPROTO_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xsqltablemodel.h" class QMimeData; Q_DECLARE_METATYPE(XSqlTableModel*) void setupXSqlTableModelProto(QScriptEngine *engine); QScriptValue constructXSqlTableModel(QScriptContext *context, QScriptEngine *engine); class XSqlTableModelProto : public QObject, public QScriptable { Q_OBJECT public: XSqlTableModelProto(QObject *parent = 0); Q_INVOKABLE QModelIndex buddy(const QModelIndex &index) const; Q_INVOKABLE bool canFetchMore(const QModelIndex &parent = QModelIndex()) const; Q_INVOKABLE void clear(); Q_INVOKABLE int columnCount(const QModelIndex &parent = QModelIndex()); Q_INVOKABLE QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const; Q_INVOKABLE QSqlDatabase database() const; Q_INVOKABLE bool dropMimeData(const QMimeData *data, int action, int row, int column, const QModelIndex &parent); Q_INVOKABLE int editStrategy() const; Q_INVOKABLE void fetchMore(const QModelIndex &parent = QModelIndex()); Q_INVOKABLE int fieldIndex(const QString &fieldName) const; Q_INVOKABLE QString filter() const; Q_INVOKABLE int flags(const QModelIndex &index) const; Q_INVOKABLE bool hasIndex(int row, int column, const QModelIndex &parent = QModelIndex()) const; Q_INVOKABLE QVariant headerData(int section, int orientation, int role = Qt::DisplayRole) const; Q_INVOKABLE QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; Q_INVOKABLE bool insertColumn(int column, const QModelIndex &parent = QModelIndex()); Q_INVOKABLE bool insertColumns(int column, int count, const QModelIndex &parent = QModelIndex()); Q_INVOKABLE bool insertRecord(int row, const QSqlRecord &record); Q_INVOKABLE bool insertRow(int row, const QModelIndex &parent = QModelIndex()); Q_INVOKABLE bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()); Q_INVOKABLE bool isDirty(const QModelIndex &index) const; Q_INVOKABLE QMap itemData(const QModelIndex &index) const; Q_INVOKABLE QSqlError lastError() const; Q_INVOKABLE QModelIndexList match(const QModelIndex &start, int role, const QVariant &value, int hits = 1, int flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap)) const; Q_INVOKABLE QMimeData *mimeData(const QModelIndexList &indexes) const; Q_INVOKABLE QStringList mimeTypes() const; Q_INVOKABLE QSqlIndex primaryKey() const; Q_INVOKABLE QSqlQuery query() const; Q_INVOKABLE QSqlRecord record() const; Q_INVOKABLE QSqlRecord record(int row) const; Q_INVOKABLE QSqlRelation relation(int column) const; Q_INVOKABLE QSqlTableModel *relationModel(int column) const; Q_INVOKABLE bool removeColumn(int column, const QModelIndex &parent = QModelIndex()); Q_INVOKABLE bool removeColumns(int column, int count, const QModelIndex &parent = QModelIndex()); Q_INVOKABLE bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()); Q_INVOKABLE void revertRow(int row); Q_INVOKABLE int rowCount(const QModelIndex &parent = QModelIndex()) const; Q_INVOKABLE bool select(); Q_INVOKABLE bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); Q_INVOKABLE void setEditStrategy(int strategy); Q_INVOKABLE void setFilter(const QString &filter); Q_INVOKABLE bool setHeaderData(int section, int orientation, const QVariant &value, int role = Qt::EditRole); Q_INVOKABLE bool setItemData(const QModelIndex &index, const QMap &roles); Q_INVOKABLE void setKeys(int keyColumns); Q_INVOKABLE bool setRecord(int row, const QSqlRecord &record); Q_INVOKABLE void setRelation(int column, const QSqlRelation &relation); Q_INVOKABLE void setSort(int column, int order); Q_INVOKABLE void setSupportedDragActions(int actions); Q_INVOKABLE void setTable(const QString &tableName, int keyColumns); Q_INVOKABLE QModelIndex sibling(int row, int column, const QModelIndex &index) const; Q_INVOKABLE void sort(int column, int order = Qt::AscendingOrder); Q_INVOKABLE QSize span(const QModelIndex &index) const; Q_INVOKABLE int supportedDragActions() const; Q_INVOKABLE int supportedDropActions() const; Q_INVOKABLE QString tableName() const; Q_INVOKABLE QString toString() const; Q_INVOKABLE int nodeCount(); Q_INVOKABLE void appendChild(XSqlTableNode *child); Q_INVOKABLE void clearChildren(); Q_INVOKABLE void removeChild(int index); Q_INVOKABLE XSqlTableNode* appendChild(const QString &tableName, ParameterList &relations); Q_INVOKABLE QList children(); Q_INVOKABLE XSqlTableNode* child(int index); Q_INVOKABLE XSqlTableNode* child(const QString &tableName); Q_INVOKABLE void set(ParameterList params); Q_INVOKABLE ParameterList parameters(); Q_INVOKABLE void load(int row); Q_INVOKABLE void loadAll(); Q_INVOKABLE bool save(); }; #endif qt-client-4.1.0/scriptapi/xsqltablenodeproto.h000066400000000000000000000036531217451700100215210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XSQLTABLENODEPROTO_H__ #define __XSQLTABLENODEPROTO_H__ #include #include #include #include #include #include #include #include #include #include #include #include #include "xsqltablemodel.h" class QMimeData; Q_DECLARE_METATYPE(XSqlTableNode*) void setupXSqlTableNodeProto(QScriptEngine *engine); QScriptValue constructXSqlTableNode(QScriptContext *context, QScriptEngine *engine); class XSqlTableNodeProto : public QObject, public QScriptable { Q_OBJECT public: XSqlTableNodeProto(QObject *parent = 0); virtual ~XSqlTableNodeProto(); Q_INVOKABLE int index() const; Q_INVOKABLE int count() const; Q_INVOKABLE void appendChild(XSqlTableNode *child); Q_INVOKABLE void removeChild(int index); Q_INVOKABLE XSqlTableNode* appendChild(const QString &tableName, ParameterList &relations); Q_INVOKABLE QMap, XSqlTableModel* > modelMap(); Q_INVOKABLE QString tableName(); Q_INVOKABLE QList children(); Q_INVOKABLE ParameterList relations(); Q_INVOKABLE XSqlTableNode* child(int index); Q_INVOKABLE XSqlTableNode* child(const QString &tableName); Q_INVOKABLE XSqlTableNode* parent() const; Q_INVOKABLE XSqlTableModel* model(XSqlTableModel* parent = 0, int row = 0); Q_INVOKABLE void clear(); Q_INVOKABLE void load(QPair key); Q_INVOKABLE bool save(); }; #endif qt-client-4.1.0/scriptapi/xsqltablnodeproto.cpp000066400000000000000000000116211217451700100217010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xsqltablenodeproto.h" #include "parameterlistsetup.h" #include "parameter.h" void setupXSqlTableNodeProto(QScriptEngine *engine) { QScriptValue proto = engine->newQObject(new XSqlTableNodeProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), proto); QScriptValue constructor = engine->newFunction(constructXSqlTableNode, proto); engine->globalObject().setProperty("XSqlTableNode", constructor); } QScriptValue constructXSqlTableNode(QScriptContext * context, QScriptEngine *engine) { XSqlTableNode *obj = 0; if (!context->argument(1).isNull()) obj = 0; else { if ( (context->argumentCount() == 3) && context->argument(0).isString() && qscriptvalue_cast(context->argument(2))) obj = new XSqlTableNode(context->argument(0).toString(), qscriptvalue_cast(context->argument(1)), qscriptvalue_cast(context->argument(2))); else if (context->argumentCount() == 2 && context->argument(0).isString()) obj = new XSqlTableNode(context->argument(0).toString(), qscriptvalue_cast(context->argument(1))); else obj = 0; } return engine->toScriptValue(obj); } XSqlTableNodeProto::XSqlTableNodeProto(QObject *parent) : QObject(parent) { } XSqlTableNodeProto::~XSqlTableNodeProto() { } int XSqlTableNodeProto::index() const { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->index(); return 0; } int XSqlTableNodeProto::count() const { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->count(); return 0; } void XSqlTableNodeProto::appendChild(XSqlTableNode *child) { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) item->appendChild(child); } void XSqlTableNodeProto::removeChild(int index) { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) item->removeChild(index); } XSqlTableNode* XSqlTableNodeProto::appendChild(const QString &tableName, ParameterList &relations) { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->appendChild(tableName, relations); return 0; } QMap, XSqlTableModel* > XSqlTableNodeProto::modelMap() { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->modelMap(); return QMap, XSqlTableModel* >(); } QString XSqlTableNodeProto::tableName() { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->tableName(); return QString(); } QList XSqlTableNodeProto::children() { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->children(); return QList(); } ParameterList XSqlTableNodeProto::relations() { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->relations(); return ParameterList(); } XSqlTableNode* XSqlTableNodeProto::child(int index) { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->child(index); return 0; } XSqlTableNode* XSqlTableNodeProto::child(const QString &tableName) { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->child(tableName); return 0; } XSqlTableNode* XSqlTableNodeProto::parent() const { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->parent(); return 0; } XSqlTableModel* XSqlTableNodeProto::model(XSqlTableModel* parent, int row) { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->model(parent, row); return 0; } void XSqlTableNodeProto::clear() { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) item->clear(); } void XSqlTableNodeProto::load(QPair key) { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) item->load(key); } bool XSqlTableNodeProto::save() { XSqlTableNode *item = qscriptvalue_cast(thisObject()); if (item) return item->save(); return false; } qt-client-4.1.0/scriptapi/xtreewidgetitemproto.cpp000066400000000000000000000070051217451700100224140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xtreewidgetitemproto.h" #include "xtreewidget.h" void setupXTreeWidgetItemProto(QScriptEngine *engine) { QScriptValue itemproto = engine->newQObject(new XTreeWidgetItemProto(engine)); engine->setDefaultPrototype(qMetaTypeId(), itemproto); } XTreeWidgetItemProto::XTreeWidgetItemProto(QObject *parent) : QObject(parent) { } int XTreeWidgetItemProto::altId() const { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->altId(); return -1; } int XTreeWidgetItemProto::id() const { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->id(); return -1; } void XTreeWidgetItemProto::setAltId(const int pId) { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->setAltId(pId); } void XTreeWidgetItemProto::setId(const int pId) { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->setId(pId); } XTreeWidgetItem *XTreeWidgetItemProto::child(int idx) const { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->child(idx); return 0; } int XTreeWidgetItemProto::id(const QString p) { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->id(p); return -1; } QVariant XTreeWidgetItemProto::rawValue(const QString pName) { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->rawValue(pName); return QVariant(); } void XTreeWidgetItemProto::setText(int pColumn, const QVariant & pVariant) { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setText(pColumn, pVariant.toString()); } void XTreeWidgetItemProto::setTextColor(int column, const QColor & color) { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setTextColor(column, color); } void XTreeWidgetItemProto::setTextColor(const QColor &pColor) { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) item->setTextColor(pColor); } QString XTreeWidgetItemProto::text(int p) const { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->text(p); return QString(); } QString XTreeWidgetItemProto::text(const QString &pColumn) const { XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) return item->text(pColumn); return QString(); } QString XTreeWidgetItemProto::toString() const { QString returnVal = QString("XTreeWidgetItem"); XTreeWidgetItem *item = qscriptvalue_cast(thisObject()); if (item) { QStringList data; for (int i = 0; i < item->columnCount(); i++) data << item->text(i); returnVal += QString("(id = %1, altId = %2, data = [%3])") .arg(item->id()).arg(item->altId()).arg(data.join(", ")); } else returnVal += "(unknown)"; return "[" + returnVal + "]"; } qt-client-4.1.0/scriptapi/xtreewidgetitemproto.h000066400000000000000000000032261217451700100220620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTREEWIDGETITEMPROTO_H__ #define __XTREEWIDGETITEMPROTO_H__ #include #include class XTreeWidgetItem; Q_DECLARE_METATYPE(XTreeWidgetItem*) void setupXTreeWidgetItemProto(QScriptEngine *engine); class XTreeWidgetItemProto : public QObject, public QScriptable { Q_OBJECT Q_PROPERTY(int id READ id WRITE setId DESIGNABLE false) Q_PROPERTY(int altId READ altId WRITE setAltId DESIGNABLE false) public: XTreeWidgetItemProto(QObject *parent = 0); int altId() const; int id() const; void setAltId(const int pId); void setId(const int pId); Q_INVOKABLE virtual XTreeWidgetItem *child(int idx) const; Q_INVOKABLE virtual int id(const QString); Q_INVOKABLE virtual QVariant rawValue(const QString); Q_INVOKABLE virtual void setText(int, const QVariant &); Q_INVOKABLE virtual void setTextColor(int column, const QColor & color); Q_INVOKABLE virtual void setTextColor(const QColor &); Q_INVOKABLE virtual QString text(int p) const; Q_INVOKABLE virtual QString text(const QString &) const; public slots: virtual QString toString() const; }; #endif qt-client-4.1.0/scriptapi/xvariantsetup.cpp000066400000000000000000000047001217451700100210320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xvariantsetup.h" static QScriptValue scriptEncode(QScriptContext *context, QScriptEngine * /*engine*/) { QString result; if (context->argumentCount() == 1 && ! qscriptvalue_cast(context->argument(0)).isNull()) result = XVariant::encode(qscriptvalue_cast(context->argument(0))); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate XVariant::encode()"); return QScriptValue(result); } static QScriptValue scriptDecode(QScriptContext *context, QScriptEngine *engine) { QVariant result; if (context->argumentCount() == 2 && context->argument(0).isString() && context->argument(1).isString()) result = XVariant::decode(context->argument(0).toString(), context->argument(1).toString()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate XVariant::decode()"); return engine->newVariant(result); } // TODO: this should really be in a QVariant exposure static QScriptValue scriptTypeName(QScriptContext *context, QScriptEngine * /*engine*/) { QString result; if (context->argumentCount() == 1 && ! qscriptvalue_cast(context->argument(0)).isNull()) result = (qscriptvalue_cast(context->argument(0))).typeName(); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate XVariant::typeName()"); return QScriptValue(result); } void setupXVariant(QScriptEngine *engine) { QScriptValue xvar = engine->newObject(); engine->globalObject().setProperty("XVariant", xvar, QScriptValue::ReadOnly | QScriptValue::Undeletable); xvar.setProperty("encode", engine->newFunction(scriptEncode)); xvar.setProperty("decode", engine->newFunction(scriptDecode)); xvar.setProperty("typeName", engine->newFunction(scriptTypeName)); } qt-client-4.1.0/scriptapi/xvariantsetup.h000066400000000000000000000011231217451700100204730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which(including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XVARIANTSETUP_H__ #define __XVARIANTSETUP_H__ #include #include void setupXVariant(QScriptEngine *engine); #endif qt-client-4.1.0/share/000077500000000000000000000000001217451700100145145ustar00rootroot00000000000000qt-client-4.1.0/share/XTupleGUIClient.qhcp000066400000000000000000000011341217451700100203150ustar00rootroot00000000000000 xTuple Documentation qthelp://xtuple.org/postbooks/index.html .xTupleDocs XTupleGUIClient.qhp XTupleGUIClient.qch XTupleGUIClient.qch qt-client-4.1.0/share/XTupleGUIClient.qhp000066400000000000000000000005511217451700100201540ustar00rootroot00000000000000 xtuple.org postbooks
    index.html qt-client-4.1.0/share/dict/000077500000000000000000000000001217451700100154375ustar00rootroot00000000000000qt-client-4.1.0/share/dict/Makefile000066400000000000000000000001671217451700100171030ustar00rootroot00000000000000SAXONPATH=${HOME}/src/saxon8 xTuple.base.qph: xTuple.base.ts java -jar $(SAXONPATH)/saxon8.jar $< ts_to_qph.xsl > $@ qt-client-4.1.0/share/dict/reports.base.ts000066400000000000000000024050101217451700100204200ustar00rootroot00000000000000 AccountingPeriodsMasterList 100 Start 100 End 80 Closed 80 Frozen 450 Accounting Periods Master List 100 End 80 Frozen 100 Start 80 Closed 85 Page: 85 Report Date: AccountingYearPeriodsMasterList 80 Closed 100 Start 100 End 329 Fiscal Years Master List 80 Closed 100 End 100 Start 85 Page: 85 Report Date: AccountNumberMasterList 95 Profit Center 95 Sub 450 Chart of Accounts Master List 80 Description 95 Company 95 Account # 55 Type 95 Profit Center 95 Sub 95 Account # 55 Type 80 Description 95 Company 85 Report Date: 85 Page: AddressesMasterList 95 First Name / Number 120 Phone 120 Line 2 120 Use of Address 120 Last Name / Name 120 Country 120 Line 1 120 City 450 Addresses Master List 120 State/Province 95 Line 3 120 Email Address 120 CRM Account 120 Fax 120 Postal Code 95 Line 3 120 Phone 120 CRM Account 120 Use of Address 120 State/Province 120 Country 95 First Name / Number 120 Email Address 120 Last Name / Name 120 City 120 Line 2 120 Fax 120 Postal Code 120 Line 1 85 Page: 85 Report Date: AdjustmentTypes 465 Adjustment Types 100 Name 80 Adj. Account # 100 Description 100 Debit/Credit 100 Name 100 Debit/Credit 80 Adj. Account # 100 Description 85 Page: 85 Report Date: Alignment 100 800 100 600 100 200 100 600 100 700 100 300 100 700 100 400 100 300 100 900 100 1100 100 200 100 400 100 800 100 100 100 500 100 500 100 1000 100 100 APAging 365 Accounts Payable Aging Report 40 As of: 15 y 85 Vendor Inv # 15 T 103 Vendor Name: 40 Discount 75 31+60 Days 103 Vendor Number: 45 Discount 40 Date 80 Original 80 Invoice Amount 75 90+ Days 15 e 15 p 75 0+30 Days 60 Due Date 85 Voucher # 75 61+90 Days 60 Invoice Date 75 Current 103 Terms: 475 All amounts are in base currency as of the document date. 55 Note: 135 Total For Vendor 475 All amounts are in base currency as of the document date. 55 Note: 170 Total For All Vendors 95 Report Totals: 35 Page: 35 Page: APApplications 100 Vendor Name 475 A/P Applications 100 Start Date: 159 Source Document 45 Currency 55 Amount 141 Apply To Document 80 Date 80 Vendor # 100 End Date: 80 Vendor # 100 Vendor Name 150 Apply To Document 55 Amount 164 Source Document 80 Date 45 Currency 100 Page: 100 Report Date: 150 Total Applications (base): APAssignmentsMasterList 495 A/P Account Assignments Master List 95 Vendor Type 80 A/P Account 145 Discount Account 135 Prepaid Account 80 A/P Account 95 Vendor Type 80 Prepaid Account 80 Discount Account 85 Report Date: 85 Page: APCheck 75 Reference: 61 Check # 85 Discount / Credit: 111 Invoice / Document: 45 Amount: 75 Memo: 75 Check Total: 75 Memo: 85 Discount / Credit: 75 Reference: 110 Invoice / Document: 45 Amount: 61 Check # 65 Check Total: 75 Memo: APOpenItemsByVendor 50 P/O # 100 As of Date: 50 Paid 475 Open Payables 100 End Date: 100 Start Date: 50 Balance 80 Due Date 50 Amount 80 Doc. Type 50 Doc.# 80 Doc. Date 50 Curr 100 Selection: 115 Vendor 50 Paid 80 Doc. Date 80 Doc. Type 50 Doc.# 50 Balance 50 Amount 80 Due Date 50 P/O # 50 Curr 115 Vendor 100 Page: 100 Report Date: 130 Total: ARAging 50 As of: 365 Accounts Receivable Aging Report 75 90+ Days 75 31-60 Days 85 Invoice# 102 Terms: 25 Type 75 61-90 Days 60 Doc Date 80 Original 75 0-30 Days 80 Doc Amount 85 Debit Memo/ 102 Customer Name: 75 0+Days 60 Due Date 85 Credit/ 85 PO Number 102 Customer Number: 135 Total For Customer 440 All amounts are in base currency as of the document date. 41 Note: 41 170 Total For All Customers 35 Page: 170 Report Totals: 440 All amounts are in base currency as of the document date. 41 Note: 35 Page: ARApplications 100 Customer Name 475 A/R Applications 100 Start Date: 150 Source 45 Currency 55 Amount 150 Target 50 Date 80 Cust. # 100 End Date: 80 Cust. # 100 Customer Name 150 Target 55 Amount 150 Source 80 Date 45 Currency 100 Page: 100 Report Date: 150 Total Applications (base): AROpenItems 80 Doc. Date 400 Open Receivables 100 Document # 80 Due Date 100 Customer 50 Doc. Type 80 Balance 80 Paid 80 Amount 50 Currency 100 Selection: 100 Type: 100 Incidents Only: 100 As Of Date: 50 Currency 100 Customer 80 Due Date 80 Amount 80 Balance 50 Doc. Type 80 Paid 80 Doc. Date 100 Document # 100 Report Date: 100 Page: 80 Total: AROpenItem 126.032 Customer: 142 Order Number: 100 Due Date: 85.8 Sales Rep.: 51.5 Terms: 67 Balance: 152 Document Number: 143.191 Document Date: 146 Reason Code: 131 Commission Due: 133 Document Type: 61.4 Amount: 42.6 Paid: 132 Commission Paid: 100 Notes: 166 Journal Number: 100 Doc Type 100 Doc Number 100 Apply Date 100 Amount 100 Currency 100 Base Amount Backlog 102 Item Number 110 Customer 102 Description 465 Backlog 50 UOM 60 S/O # 50 # 75 Balance 75 Qty. Shipped 75 Ordered 75 Scheduled 75 Qty. Ordered 75 Qty. Ordered 102 Item Number 102 Description 50 # 75 Ordered 75 Qty. Shipped 50 UOM 75 Balance 75 Scheduled 60 S/O # 110 Customer 415 Total: 85 Report Date: 85 Page: BankAccountsMasterList 80 A/R 95 Name 450 Bank Accounts Master List 80 A/P 80 Description 80 Type 80 A/P 80 Type 80 Description 95 Name 80 A/R 85 Page: 85 Report Date: BankAdjustmentEditList 100 Amount 465 Bank Adjustment Edit List 75 Dist. Date 100 Bank Account 80 Doc. Number 60 Adj. Type 100 Amount 75 Dist. Date 80 Doc. Number 60 Adj. Type 100 Bank Account 85 Report Date: 85 Page: BankrecHistory 100 Amount 100 Posted By: 150 Doc. Number/Notes 100 Date Posted: 75 Dist. Date 117 Bank Rec. Post: 100 Bark Account: 465 Bank Reconciliation History 121 Reconciled 150 Doc. Number/Notes 75 Dist. Date 100 Amount 49 TOTAL 121 Unreconciled 162 Add: Checks in Circulation: 235 General Legder Reconciliation 163 Deduct: Deposits in Circulation: 219 Actual Account Balance: 162 Ending Reconciled Balance: 56 Subtotal: 177 Add: Adjustments in Circulation: 75 Report Date: 85 Page: BillingSelections 100 Cust. # 100 Order # 465 Billing Selections 100 Cust Name 100 Order # 100 Cust Name 100 Cust. # 85 Report Date: 85 Page: Bookings 100 S/O # 100 Description 80 Ord. Date 100 Customer # 80 Unit Price 80 Ext'd Price 100 Item Number 475 Bookings 80 Shipped 100 Customer Name 100 Item Number 100 Customer # 80 Unit Price 80 Shipped 100 Customer Name 80 Ord. Date 100 S/O # 80 Ext'd Price 100 Description 100 Page: 100 Report Date: BriefEarnedCommissions 103 End Date: 50 Cust. # 50 # 80 Base Commision 80 Base Ext. Price 103 Sales Rep: 80 Invc. Number 80 S/O # 106 Sales Rep. 103 Start Date: 50 Customer 450 Brief Earned Commissions 80 Invc. Date 50 Cust. # 80 Ext. Price 50 # 80 S/O # 80 Invc. Number 106 Sales Rep. 50 Customer 80 Commision 80 Invc. Date 85 Page: 85 Report Date: 80 Totals: BriefSalesHistory 100 Doc. # 80 Ship Date 100 Invoice # 400 Brief Sales History 80 Total 80 Ord. Date 80 Total 80 Ord. Date 100 Invoice # 80 Ship Date 100 Doc. # 100 Report Date: 100 Page: 80 Total: BudgetsMasterList 95 Start Date 95 End Date 80 Description 450 Budgets Master List 95 Name 95 Name 95 End Date 95 Start Date 80 Description 85 Page: 85 Report Date: Budget 95 Account 95 Start Date 80 Amount 95 End Date 95 Budget Name: 95 Description: 450 Budget 95 Start Date 80 Amount 95 End Date 95 Account 85 Page: 85 Report Date: BuyCard 100 Ordered 80 Due Date 50 # 100 Vendor Part #: 400 Buy Card 50 Status 50 P/O # 80 Received 100 Vendor #: 80 Unit Cost 125 Vendor Description: 80 Due Date 50 # 80 Unit Cost 50 Status 50 P/O # 100 Ordered 80 Received 100 Report Date: 100 Page: 100 Comments: CapacityUOMsByClassCode 90 Class Code 100 Inventory UOM 100 Inv./Alt. Cap. Ratio 200 Item Description 380 Capacity UOMs by Class Code 104 Class Code(s): 100 Shipping UOM 100 Inv./Cap. Ratio 100 Capacity UOM 100 Inv./Ship. Ratio 100 Alt. Capacity UOM 200 Item Number 100 Inv./Ship. Ratio 200 Item Number 100 Shipping UOM 200 Item Description 90 Class Code 100 Alt. Capacity UOM 100 Capacity UOM 100 Inv./Cap. Ratio 100 Inventory UOM 100 Inv./Alt. Cap. Ratio 85 Report Date: 85 Page: CapacityUOMsByProductCategory 458 Capacity UOMs by Product Category 100 Alt. Capacity UOM 100 Inv./Alt. Cap. Ratio 228 Item Description 55 Prod. Cat. 100 Capacity UOM 100 Inventory UOM 100 Shipping UOM 228 Item Number 145 Product Category(ies): 100 Inv./Cap. Ratio 100 Inv./Ship. Ratio 100 Inv./Ship. Ratio 55 Prod. Cat. 100 Inventory UOM 100 Capacity UOM 228 Item Number 100 Shipping UOM 228 Item Description 100 Inv./Cap. Ratio 100 Alt. Capacity UOM 100 Inv./Alt. Cap. Ratio 85 Page: 85 Report Date: CashReceiptsEditList 125 Customer 80 Amount Applied 80 Amount 155 Document/Account Number 75 Doc. Type 80 Payment Type 60 Cust # 465 Cash Receipts Edit List 60 Dist. Date 70 Reference # 80 Bank Account 80 Applications: 85 Page: 85 Report Date: 80 Total Receipts: CashReceipts 80 Cust. # 85 Target 100 Start Date: 100 Customer Name 100 Amount 80 Date 45 Currency 100 End Date: 80 Source 100 Base Amount 475 Cash Receipts 100 Customer Name 80 Cust. # 95 Source 70 Target 45 Currency 100 Amount 80 Date 75 Base Amount 100 Page: 100 Report Date: 100 Total Base Amount CCReceipt 150 Printed: 150 Credit Card Receipt 125 Approval Code: 125 Card Number: 125 Status: 125 Order: 125 Customer Name: 125 Amount: 125 Transaction Date: 125 Transaction Type: 125 By: 125 Cardholder: CharacteristicsMasterList 50 Lot/Serial 50 Options 95 Name 200 may be used for 50 Attributes 80 Notes 450 Characteristics Master List 50 Items 50 Items 200 may be used for 50 Attributes 50 Options 95 Name 80 Notes 50 Lot/Serial 85 Report Date: 85 Page: CheckMultiPage 55 Amount: 75 Check Total: 60 Memo: 70 Net Amount: 90 Discount / Credit: 111 Invoice / Document: 61 Check # 75 Reference: 75 Reference: 60 Memo: 61 Check # 70 Net Amount: 111 Invoice / Document: 90 Discount / Credit: 55 Amount: 75 Check Total: 75 Memo: CheckRegister 90 Check Date 50 Misc. 100 End Date: 100 Recipient 100 Check. # 50 Void 100 Start Date: 90 Amount 50 Printed 110 Bank Account: 50 Posted 475 Check Register 100 Recipient 90 Check Date 50 Misc. 50 Printed 100 Check. # 100 Posted 90 Amount 50 Void 100 Report Date: 100 Page: 90 Total: ClassCodesMasterList 80 Description 450 Class Codes Master List 95 Class Code 95 Class Code 80 Description 85 Report Date: 85 Page: ContactsMasterList 450 Contacts Master List 75 Phone 2 100 Account Name 75 Phone 100 First Name 120 Last Name 75 Fax 145 Email 75 Account # 120 Web Address 100 First Name 120 Account Name 75 Account # 75 Phone 75 Phone 2 120 Web Address 120 Last Name 145 Email 75 Fax 85 Report Date: 85 Page: Contracts 135 Vendor Name 115 Contracts 55 Vendor # 40 Expires 50 Contract # 60 Effective 135 Contract Description 55 Item Count 50 Vendor # 135 Vendor Name 50 Contract # 135 Contract Description 65 Effective 45 Expires 50 Item Count 85 Report Date: 85 Page: CostCategoriesMasterList 450 Cost Categories Master List 160 Inventory Scrap: 160 Purchase Price Variance: 80 Description: 90 Category: 160 Inventory Asset: 160 WIP Asset: 160 Inventory Cost Variance: 160 Liability Clearing: 160 Inventory Adjustment: 85 Page: 85 Report Date: CostedIndentedBOM 75 Expires 90 Document #: 75 Ext. Qty. Req. 165 Component Item Number 40 Seq. # 75 Issue Method 80 Unit Cost 50 UOM 75 Effective 75 Scrap 90 Revision Date: 90 Revision: 80 Item: 465 Costed Indented Bill of Materials 229 Description 50 UOM: 75 Create W/O 80 Ext'd Cost 165 Component Item Number 80 Ext'd Cost 75 Ext. Qty. Req. 75 Issue Method 75 Create W/O 75 Effective 40 Seq. # 229 Description 75 Scrap 75 Expires 80 Unit Cost 50 UOM 85 Page: 85 Report Date: 90 Standard Cost: 75 Actual Cost: 75 Total Cost: CostedSingleLevelBOM 75 Expires 90 Revision: 75 Qty. Per 75 Effective 75 Extended Cost 443 Costed Single Level Bill of Materials 75 Unit Cost 80 Cost Type: 90 Document #: 90 Revision Date: 75 Qty. Required 228 Item Description 80 Item: 228 Component Item Number 75 Create W/O 75 Scrap 50 Seq. # 75 Issue Method 40 UOM 75 Fxd. Qty. 75 Scrap 75 Expires 228 Item Description 75 Issue Method 75 Unit Cost 50 Seq. # 75 Create W/O 75 Extended Cost 228 Component Item Number 75 Effective 75 Qty. Required 40 UOM 75 Qty. Per 85 Page: 85 Report Date: 103 Report Total: 103 Item Standard Cost: 103 Item Actual Cost: CostedSummarizedBOM 75 Ext. Qty. Req. 75 Ext'd Cost 90 Revision Date: 50 UOM 90 Revision: 80 Cost Type: 165 Item Number 229 Description 75 Unit Cost 500 Costed Summarized Bill of Materials 50 UOM: 80 Item: 90 Document #: 75 Ext. Qty. Req. 165 Item Number 229 Description 75 Unit Cost 75 Ext'd Cost 50 UOM 85 Page: 85 Report Date: CountSlipEditList 75 Posted 80 Item: 114 Entered 350 Count Slip Edit List 85 Count Tag #: 70 # 100 User 75 Slip Qty. 80 Site: 75 Posted 114 Entered 70 # 75 Slip Qty. 100 User 85 Page: 85 Report Date: CountSlipsByWarehouse 35 Site 80 Site: 150 Tag Number 229 Item Description 55 Posted 85 Entered 85 ( By ) 80 Start Date: 350 Count Slips By Site 80 Qty. Counted 80 End Date: 150 Slip Number 229 Item Number 229 Item Number 150 Tag Number 85 Entered 229 Item Description 35 Site 150 Slip Number 80 Qty. Counted 55 Posted 85 ( By ) 85 Page: 85 Report Date: CountTagEditList 45 Priority 350 Count Tag Edit List 100 Tag Date 35 Site 100 Item Number 75 Variance 75 QOH 100 Description 75 % 80 Site: 75 Count Qty 100 Tag # 75 Location 75 Amount 100 Tag Date 35 Site 75 Count Qty 75 % 75 Location 100 Tag # 100 Description 75 QOH 75 $ 100 Item Number 45 Priority 75 Variance 85 Page: 85 Report Date: CountTagsByClassCode 80 Start Date: 80 End Date: 75 Qty. Before 75 ( By ) 80 Site: 75 ( By ) 100 Description 75 Posted 75 Entered 75 Qty. After 100 Tag # 80 Class Code: 350 Count Tags By Class Code 75 Created 35 Site 75 Variance 75 % 75 ( By ) 100 Item Number 100 Tag # 75 Qty. After 100 Description 75 ( By ) 75 ( By ) 75 Entered 100 Item Number 75 Posted 35 Site 75 ( By ) 75 Qty. Before 75 % 75 Variance 75 Created 85 Page: 85 Report Date: CountTagsByItem 80 End Date: 75 ( By ) 75 Variance 75 Created 80 Site: 75 % 100 Tag # 350 Count Tags By Item 80 Item: 35 Site 75 ( By ) 75 Qty. After 80 Start Date: 75 ( By ) 75 Qty. Before 75 Posted 75 Entered 75 Qty. Before 75 Created 75 Variance 75 Qty. After 75 ( By ) 75 ( By ) 75 Entered 75 ( By ) 75 Posted 75 % 35 Site 100 Tag # 85 Page: 85 Report Date: CountTagsByWarehouse 350 Count Tags By Site 75 Qty. Before 75 Qty. After 100 Item Number 35 Site 75 ( By ) 75 ( By ) 75 ( By ) 75 Posted 75 Created 75 % 80 End Date: 75 Entered 100 Description 80 Site: 100 Tag # 80 Start Date: 75 Variance 75 Variance 100 Item Number 75 ( By ) 35 Site 75 Entered 100 Tag # 75 Qty. Before 75 Created 75 Posted 100 Description 75 ( By ) 75 Qty. After 75 ( By ) 75 % 85 Page: 85 Report Date: CreditMemoEditList 465 Credit Memo Edit List 50 UOM 80 Sales Account 60 Doc. # 75 Price 75 Ext. Price 80 A/R Account 100 Name/Description 60 Order # 75 Qty. to Bill 75 Cust./Item # 80 A/R Account 75 Ext. Price 60 Invoice # 60 Order # 80 Sales Account 100 Name/Description 75 Qty. to Bill 75 Cust./Item # 50 UOM 75 Price 85 Page: 85 Report Date: CreditMemo 120 P.O. Number 100 Date: 100 Ext. Price 80 UOM 195 Credit Memo Currency 80 Ship To: 100 Document Date 100 Unit Price 100 Credit Memo #: 120 Qty. Returned 100 Apply To: 104 Customer #: 120 Item Description 175 Credit Memo 80 Bill To: 120 Qty. Credited 120 Item Number 55 Notes: 100 Subtotal: 100 Comments 100 Sales Tax: 100 Freight: 100 Total Credit: 100 Misc. Comments: 100 Misc: CRMAccountMasterList 95 Account Name 60 Competitor 60 Tax Auth 60 Partner 60 Customer 450 CRM Accounts 60 Prospect 60 Vendor 95 Account # 95 Contact Name 60 Phone 60 Email 95 Account # 60 Partner 95 Account Name 60 Prospect 60 Tax Auth 60 Vendor 60 Customer 60 Competitor 95 Contact Name 60 Phone 60 Email 85 Page: 85 Report Date: CurrencyConversionList 575 Currency Exchange Rates 140 Base Currency: 140 Foreign Currencies: 37 Start 37 End 80 Currency 110 Exchange Rate 80 Report Date: CustomerARHistory 100 Start Date: 90 Due Date 100 Balance 100 Doc. # 100 End Date: 100 Amount 400 Customer A/R History 100 Customer: 60 Open 100 Doc. Type 90 Doc. Date 90 Doc. Date 100 Amount 100 Doc. # 100 Balance 90 Due Date 100 Doc. Type 60 Open 100 Report Date: 100 Page: CustomerBOL 200 724-258-3670 110 Order #: 110 Customer #: 130 Customer P/O #: 110 Shipped From: CustomerInformation 85 FAX: 95 Credit Status: 350 Customer Information 95 Last Year Sales: 80 Name: 95 Last Sales Date: 85 FAX: 85 Contact Name: 85 Phone: 95 YTD Sales: 95 Backlog: 85 Email: 135 Billing Address 85 Contact Name: 85 Phone: 170 Correspondence Address 95 Late Balance: 95 Notes: 80 Number: 85 Email: 95 Open Balance: 95 First Sales Date: 95 Comments: 95 Comment 95 User 95 Date 75 Doc. Type 75 Doc. # 85 Due Date 65 Open 85 Amount 95 A/R History: 85 Doc. Date 85 Balance 85 Page: 85 Report Date: Customers 40 Active 100 Name 100 Bill Address 100 Number 475 Customers 100 Type 100 Bill Address 40 Active 100 Name 100 Number 100 Type 75 Contact: 75 Phone: 75 Email: 100 Report Date: 100 Page: CustomerTypesMasterList 95 Type Code 450 Customer Types Master List 80 Description 95 Type Code 80 Description 85 Report Date: 85 Page: CustOrderAcknowledgement 140 PO Number 406 Sales Order Acknowledgement 67 Balance 100 SHIP TO: 57 Ship Via: 57 Terms 100 Description 70 Ship Date 75 Amount 60 Price 95 Item 50 BILL TO: 70 Ordered 37 FOB 40 UOM 165.637 CUSTOMER ADDRESS: 115 MISCELLANEOUS 170 Balance Due: 115 FREIGHT 115 SUBTOTAL 115 TAX 115 TOTAL 115 CREDITS DeliveryDateVariancesByItem 475 Delivery Date Variances By Item 112 Vendor Item Number 100 Start Date: 80 Agrd. Due Date 60 Item: 100 End Date: 85 Purch. Agent: 50 P/O # 80 Recv. Date 50 UOM: 112 Description 80 Qty. 100 Vendor 85 Site: 80 Order Date 80 Reqd. Due Date 80 Lead Time 50 P/O # 80 Due Date 80 Qty. 80 Recv. Date 112 Vendor Item Number 112 Vendor Description 100 Vendor 80 Order Date 80 Lead Time 80 Reqd. Due Date 100 Report Date: 100 Page: DeliveryDateVariancesByVendor 85 Purch. Agent: 60 Vendor: 100 End Date: 475 Delivery Date Variances By Vendor 100 Start Date: 85 Site: 80 Qty. 50 P/O # 80 Recv. Date 112 Vendor Item Number 80 Lead Time 80 Agrd. Due Date 80 Reqd. Due Date 80 Order Date 112 Description 112 Item Number 50 P/O # 112 Description 112 Vendor Item Number 80 Reqd. Due Date 80 Recv. Date 80 Agrd. Due Date 80 Qty. 80 Lead Time 80 Order Date 112 Item Number 100 Page: 100 Report Date: DepartmentsMasterList 200 Department Name 651 Departments 150 Department Number DepositsRegister 40 Jrnl 106 Account 55 Doc. 35 Source 80 Amount 106 Reference 100 Current Base 100 Balance Due 130 End Date: 465 Deposits Register 40 Date 100 to A/R 35 Type 75 Received 55 Username 130 Start Date: 40 Posted 100 Total Credit 55 Doc. # 100 Current Base 55 Doc. 55 Username 100 Total Credit 35 Type 40 Jrnl 40 Date 100 Balance Due 35 Source 106 Reference 80 Amount 40 Posted 100 to A/R 75 Received 106 Account 55 Doc. # 85 Page: 85 Report Date: 55 Total: 85 Page: 85 Report Date: DetailedInventoryHistoryByLocation 35 Site 100 Time 228 Item Description 104 Start Date: 100 Order Number 100 Username 70 Restricted: 75 QOH After 104 Location: 125 Lot/Serial # 75 QOH Before 70 Netable: 483 Detailed Inventory History by Location 75 Trans-Qty 104 Site: 125 Item Number 75 UOM 35 Type 104 End Date: 35 Type 125 Item Number 75 UOM 100 Username 125 Lot/Serial # 228 Item Description 75 Trans-Qty 75 QOH Before 35 Site 75 QOH After 100 Order Number 100 Time 85 Page: 85 Report Date: EarnedCommissions 80 Invc. Date 50 Cust. # 40 Paid 60 Qty. 103 Start Date: 50 S/O # 100 Item Number 70 Base Ext. Price 103 Sales Rep: 103 End Date: 85 Ship-to 450 Earned Commissions 106 Sales Rep. 70 Base Commision 106 Sales Rep. 80 Invc. Date 70 Commision 50 S/O # 60 Qty. 50 Cust. # 70 Ext. Price 100 Item Number 40 Paid 85 Ship-to 85 Report Date: 85 Page: 85 Totals: EmployeeList 50 Manager 80 Department 95 Employee Code 90 Last 50 Active 50 Shift 450 Employees List 90 Employee Number 90 First 90 Employee Number 50 Manager 95 Employee Code 50 Shift 60 Department 50 Active 85 Page: 85 Report Date: ExpenseCategoriesMasterList 80 Description 450 Expense Categories Master List 95 Code 100 Expense Account 175 Purchase Price Variance Account 175 P/O Liability Clearing Account 175 P/O Line Freight Account 95 Code 80 Description 100 Expense Account 175 Purchase Price Variance Account 175 P/O Liability Clearing Account 175 P/O Line Freight Account 85 Page: 85 Report Date: ExpiredInventoryByClassCode 492 Expired Inventory By Class Code 50 Whs. 80 Expire By: 150 Item Number 80 UOM 227 Item Description 85 Expiration 112 Threshold Days: 80 Warehouse: 110 Class Code(s): 85 Lot/Serial # 80 QOH 85 Lot/Serial # 227 Item Description 80 UOM 50 Whs. 150 Item Number 85 Expiration 80 QOH 85 Report Date: 85 Page: FinancialReportMonthBudget 80 Name: 70 Budget 75 Budget Diff. 380 Financial Report 55 Name 80 Type: 70 % Diff. 70 Budget 55 Name 75 Budget Diff. 70 % Diff. 85 Report Date: 85 Page: FinancialReportMonthDbCr 80 Name: 380 Financial Report 70 Debits 70 % of Group 80 Type: 55 Name 70 Credits 70 Debits 55 Name 70 Credits 85 Report Date: 85 Page: FinancialReportMonthPriorMonth 55 Name 380 Financial Report 80 Name: 80 Type: 55 Name 85 Report Date: 85 Page: FinancialReportMonthPriorQuarter 55 Name 80 Type: 380 Financial Report 80 Name: 55 Name 85 Report Date: 85 Page: FinancialReportMonthPriorYear 80 Name: 380 Financial Report 80 Type: 55 Name 55 Name 85 Report Date: 85 Page: FinancialReportMonthQuarter 80 Type: 55 Name 80 Name: 70 % of Group 380 Financial Report 70 % of Group 55 Name 70 % of Group 70 % of Group 85 Page: 85 Report Date: FinancialReportMonth 70 % of Group 380 Financial Report 80 Name: 80 Type: 55 Name 55 Name 70 % of Group 85 Page: 85 Report Date: FinancialReportMonthYear 70 % of Group 55 Name 80 Name: 380 Financial Report 70 % of Group 80 Type: 55 Name 70 % of Group 70 % of Group 85 Report Date: 85 Page: FinancialReportQuarterBudget 80 Name: 80 Type: 380 Financial Report 55 Name 75 Budget Diff. 70 Budget 75 Budget Diff. 70 % Diff. 55 Name 70 Budget 70 % Diff. 85 Report Date: 85 Page: FinancialReportQuarterPriorQuarter 80 Name: 80 Type: 55 Name 380 Financial Report 55 Name 85 Report Date: 85 Page: FinancialReportQuarter 70 % of Group 80 Name: 380 Financial Report 55 Name 80 Type: 55 Name 70 % of Group 85 Report Date: 85 Page: FinancialReport 80 Name: 350 Financial Report 75 % 75 % 75 % 75 % 75 % 75 % 55 Name 75 % 75 % 75 % 75 % 75 % 55 Name 75 % 80 Period: 75 % 75 % 85 Report Date: 85 Page: FinancialReportYearBudget 85 Budget 80 Name: 380 Financial Report 80 Type: 80 % Diff. 55 Name 85 Budget 55 Name 80 % Diff. 85 Report Date: 85 Page: FinancialReportYearPriorYear 80 Type: 80 Name: 55 Name 380 Financial Report 55 Name 85 Page: 85 Report Date: FinancialReportYear 80 % of Group 80 Name: 55 Name 380 Financial Report 80 Type: 80 % of Group 55 Name 85 Page: 85 Report Date: FinancialTrend 80 Type: 55 Name 350 Financial Trend 80 Name: 55 Name 85 Page: 85 Report Date: FreightAccountAssignmentsMasterList 530 A/R Account Assignments Master List 120 A/R Account 120 Freight Account 120 Customer Type Code 120 Deferred Account 120 Prepaid Account 120 A/R Account 120 Customer Type Code 120 Freight Account 120 Prepaid Account 120 Deferred Account 85 Page: 85 Report Date: FreightClassesMasterList 450 Freight Classes Master List 80 Description 95 Freight Class 95 Freight Class 80 Description 85 Report Date: 85 Page: FreightPricesByCustomerType 100 Schedule 80 Qty. Break 100 Freight Class 155 Show Expired Prices: 85 Method 100 To 100 From 100 Ship Via 405 Freight Prices by Customer Type 155 Show Future Prices: 80 Price 104 Customer Type: 80 Currency 100 Source 100 From 100 Ship Via 80 Qty. Break 100 To 85 Method 100 Source 80 Currency 80 Price 100 Freight Class 100 Schedule 85 Page: 85 Report Date: FreightPricesByCustomer 80 Qty. Break 80 Price 100 Schedule 85 Method 350 Freight Prices by Customer 155 Show Future Prices: 100 To 100 From 155 Show Expired Prices: 100 Freight Class 80 Currency 100 Ship Via 100 Source 80 Customer: 100 To 100 Source 100 Freight Class 100 Schedule 85 Method 100 Ship Via 80 Price 80 Qty. Break 100 From 80 Currency 85 Page: 85 Report Date: FrozenItemSites 80 Reorder Lvl. 80 Safety Stock 75 Create P/Rs 350 Frozen Item Sites 85 on Manual Ords. 55 Cycle Cnt. 45 Supplied 75 Default Loc. 55 Event Fnc. 85 Enforce Params. 80 Order Up To 229 Item Number 80 Last Counted 75 Location Cntrl. 55 Lead Time 55 ABC Class 80 Last Used 150 Cost Category 45 Sold 100 Planner Code 65 QOH 229 Item Description 35 Site 80 Order Mult. 35 Active 80 Site: 65 Count Tag # 75 Control Method 75 Ranking 45 Stocked 85 on Manual Ords. 55 ABC Class 75 Control Method 75 Create P/Rs 75 Ranking 80 Last Counted 85 Enforce Params. 100 Planner Code 80 Reorder Lvl. 75 Default Loc. 75 Location Cntrl. 80 Last Used 35 Active 229 Item Description 80 Safety Stock 65 Count Tag # 45 Supplied 150 Cost Category 80 Order Up To 65 QOH 55 Lead Time 55 Cycle Cnt. 45 Sold 35 Site 80 Order Mult. 45 Stocked 55 Event Fnc. 229 Item Number 85 Page: 85 Report Date: GLSeries 80 Doc. # 130 Start Date: 60 Posted 80 Credit 80 Date 130 Source: 130 End Date: 80 Jrnl. #/Source 85 Debit 80 Doc. Type 106 Notes/Account 106 Notes/Account 80 Doc. # 80 Doc. Type 80 Jrnl./Source 85 Debit 80 Date 80 Credit 60 Posted 85 Page: 85 Report Date: 85 Totals: GLTransactions 105 Account 100 Running Total 105 Reference 50 Doc. Type 40 Date 50 Doc. # 60 Source 465 G/L Transactions 40 Posted 80 Credit 85 Debit 40 Deleted 105 Account 50 Doc. Type 60 Source 80 Credit 40 Date 40 Posted 50 Doc. # 85 Debit 100 Running Total 105 Reference 85 Report Date: 85 Page: 55 Total: 55 Balance: Image 95 Image Name: 450 Image 95 Image Description: 85 Page: 85 Report Date: IncidentCategoriesList 450 Incident Categories 300 Description 120 Name 75 Order 75 Order 300 Description 120 Name 85 Page: 85 Report Date: IncidentPrioritiesList 450 Priorities 75 Order 120 Name 300 Description 75 Order 120 Name 300 Description 85 Report Date: 85 Page: IncidentResolutionsList 450 Incident Resolutions 300 Description 120 Name 75 Order 75 Order 300 Description 120 Name 85 Page: 85 Report Date: IncidentSeveritiesList 450 Incident Severities 300 Description 120 Name 75 Order 75 Order 300 Description 120 Name 85 Page: 85 Report Date: IncidentWorkbenchList 75 Created 450 Incident List 60 Incident 50 Priority 50 Status 230 Summary 75 Assigned To 110 CRM Account 50 Severity 50 Priority 75 Created 50 Severity 60 Incident 110 CRM Account 75 Assigned To 230 Summary 50 Status 85 Page: 85 Report Date: Incident 104 Description: 98 Contact Name: 112 Severity : 112 Contact Job Title: 131 INCIDENT 66.8 Owner: 79.8 Assigned to: 100 Contact Email: 79.8 Category: 79.8 Status: 112 CRM Acnt Name : 66.8 Priority: 114 Incident Notes: 100 Contact Phone: 100 Contact Phone: 114 Comments: 114 Documents: 100 Title 100 URL 85 Page: 85 Report Date: IndentedBOM 80 Item: 75 Effective 165 Component Item Number 75 Scrap 50 UOM 90 Revsion Date: 50 UOM: 75 Ext. Qty. Req. 228 Description 75 Expires 40 Seq. # 90 Document #: 75 Create W/O 90 Revision: 350 Indented Bill of Materials 75 Issue Method 75 Expires 165 Component Item Number 75 Ext. Qty. Per 40 Seq. # 75 Create W/O 50 UOM 75 Scrap 75 Effective 75 Issue Method 228 Description 85 Report Date: 85 Page: IndentedWhereUsed 40 Seq. # 75 Qty. Per 228 Description 350 Indented Where Used 50 UOM 80 Item: 75 Scrap 50 UOM: 165 Component Item Number 75 Expires 75 Effective 75 Fxd. Qty. 75 Scrap 75 Effective 50 UOM 40 Seq. # 75 Qty. Per 75 Expires 228 Description 165 Component Item Number 75 Fxd. Qty. 85 Report Date: 85 Page: InventoryAvailabilityByCustomerType 75 UOM 125 Description 100 QOH 102 Customer Type: 100 Total Available 100 Due Date 100 Start Date 100 At Shipping 65 Status 100 This Allocated 100 Orders 100 Qty Due 100 This Available 125 W/O Number 500 Inventory Availability by Customer Type 125 Item 100 Total Allocated 100 This Available 100 This Allocated 100 Orders 100 Total Allocated 125 Description 100 QOH 75 UOM 100 Total Available 100 At Shipping 125 Item 55 S/O #: 80 Customer: 85 Report Date: 85 Page: InventoryAvailabilityBySalesOrder 100 Qty Due 100 Total Allocated 65 Status 102 Customer: 100 Start Date 102 Cust. Phone: 100 This Available 102 Sales Order #: 500 Inventory Availability by Sales Order 102 P/O #: 100 Orders 125 W/O Number 125 Description 100 This Allocated 102 Order Date: 100 Due Date 125 Item 75 UOM 100 QOH 100 Total Available 100 At Shipping 100 This Allocated 75 UOM 125 Description 100 At Shipping 100 Total Available 125 Item 100 This Available 100 Total Allocated 100 QOH 100 Orders 85 Report Date: 85 Page: InventoryAvailabilityBySourceVendor 100 QOH 45 Site 100 Allocated 100 On Order 100 Available 530 Inventory Availability by Source Vendor 45 LT 100 OUT Level 100 Unallocated 100 Reorder Level 100 Vendor # 106 Item Number 130 Availability as of: 106 Description 100 On Order 106 Item Number 45 LT 100 QOH 100 OUT Level 100 Allocated 100 Unallocated 100 Reorder Level 45 Site 106 Description 100 Vendor # 100 Available 75 Report Date: 75 Page: InventoryAvailability 100 Unallocated 35 Site 100 Reorder Level 450 Inventory Availability 130 Availability as of: 106 Item Number 35 LT 100 QOH 100 Allocated 106 Description 100 On Order 100 Available 100 PO Requests 100 Unallocated 106 Description 35 LT 100 Reorder Level 106 Item Number 100 Available 100 QOH 100 Allocated 35 Site 100 On Order 85 Page: 85 Report Date: InventoryHistory 50 Site 72 Area To 72 Val. After 72 QOH After 228 Item Description 72 Val. Before 130 Time 50 Type 72 Area From 72 QOH Before 228 Item Number 72 Cost Method 72 UOM 130 Order Number 72 Qty 130 Username 72 Value 310 Inventory History 32 Site 72 Area From 72 QOH Before 72 Val. Before 228 Item Number 72 Cost Method 32 Type 130 Time 72 Area To 228 Item Description 72 UOM 130 Username 72 Val. After 72 QOH After 130 Order Number 72 Qty 72 Value 85 Report Date: 85 Page: 130 Total: InvoiceInformation 150 Cust. P/O Number: 50 Ship To: 125 Invoice Amount: 50 Notes: 50 Bill To: 125 Ship Date: 150 Customer #: 150 Invoice #: 125 Invoice Date: 400 Invoice Information 100 Apply Date 100 Type 150 Doc./Ref. Number 100 Applications: 100 Amount 85 Report Date: 85 Page: InvoiceRegister 130 End Date: 80 Doc. Type 60 Source 465 Invoice Register 80 Date 104 Account 80 Doc. # 130 Account: 104 Reference 130 Start Date: 80 Credit 85 Debit 104 Reference 80 Date 60 Source 85 Debit 80 Credit 80 Doc. Type 80 Doc. # 104 Account 80 Subtotal: 85 Report Date: 85 Page: 80 Total: Invoice 247 Invoice 80 Bill To: 80 F.O.B. 80 Order # 120 P.O. Number 80 Ship To: 70 Order Date 110 Customer #: 85 Invoice #: 121 Invoice Date: 121 Due Date: 121 Discount Date: 65 Terms: 70 Tracking # 240 Shipment Details 70 Ship Date 120 Carrier 120 Invoice Currency: 75 Unit Price 120 Qty. Shipped 80 UOM 120 Item Description 100 Ext. Price 120 Item Number 100 Serial #/Lot Information: 40 Notes: 90 Doc # 90 Total Credit 100 Allocated 240 Pre-Allocated Credits 140 Allocated 90 Prev. Applied 90 Balance 240 Total Allocated: 100 Freight: 100 Subtotal: 40 Page: 140 Pre-Allocated Credit 100 Misc. Charge: 100 Sales Tax: 100 Total Due: 40 Page: ItemCostDetail 50 UOM 80 Cost 350 Item Cost Detail 50 Seq. # 80 Cost Type: 208 Descrip 100 Item Number 80 Scrap 80 Qty Per. 80 Ext. Cost 80 Cost: 80 Item: 100 Item Number 50 UOM 50 Seq. # 80 Scrap 80 Qty Per. 80 Ext. Cost 185 Descrip 80 Cost 85 Report Date: 85 Page: 100 Totals: ItemCostHistory 50 Type 100 Time 80 New Cost 100 User 45 Lower 350 Item Costs History 80 Item: 100 Element 85 Old Cost 45 Lower 80 New Cost 85 Old Cost 100 Element 50 Type 100 User 100 Time 85 Report Date: 85 Page: ItemCostsByClassCode 104 Class Code(s): 55 Class Code 228 Item Description 380 Item Costs by Class Code 100 UOM 100 Actual Cost 228 Item Number 100 Standard Cost 100 Actual Cost 100 Standard Cost 55 Class Code 228 Item Description 100 UOM 228 Item Number 85 Page: 85 Report Date: ItemCostSummary 350 Item Costs Summary 75 Standard Cost 75 Posted 80 Updated 45 Lower 100 Element 85 Actual Cost 80 Item: 100 Element 85 Actual Cost 45 Lower 75 Standard Cost 75 Posted 80 Updated 85 Report Date: 85 Page: 100 Totals: ItemMaster 200 Shipping/Inventory UOM Ratio: 100 Product Weight: 125 Packaging Weight: 100 Configured: 125 Alt. Capacity UOM: 400 Item Master 100 Fractional: 100 Shipping UOM: 100 Item is Sold: 100 Pick List Item: 200 Capacity/Inventory UOM Ratio: 100 Active: 100 Inventory UOM: 100 Class Code: 220 Alt. Capacity/Inventory UOM Ratio: 100 Freight Class: 100 Item #: 120 Item Type: 100 Capacity UOM: 140 Ext. Price: 140 Product Category: 140 List Price: 100 Exclusive 200 Price/Inventory UOM Ratio: 100 Taxable: 100 Price UOM: 100 Notes: 110 Ext. Description: 100 Value 145 Item Characteristics 100 Characteristic 110 Purpose 100 Name 145 Image List: 100 Description 100 User 110 Comment 145 Comments: 80 Date 100 Report Date: 100 Page: ItemSites 80 Last Counted 80 Last Used 75 Create P/Rs 45 Stocked 35 Active 100 Planner Code 80 Order Up To 55 Lead Time 45 Sold 75 Ranking 55 Event Fnc. 65 QOH 85 Enforce Params. 350 Item Sites 80 Reorder Lvl. 35 Site 55 Cycle Cnt. 55 ABC Class 45 Supplied 85 on Manual Ords. 229 Item Description 229 Item Number 75 Location Cntrl. 75 Control Method 75 Default Loc. 80 Order Mult. 80 Safety Stock 75 Location Cntrl. 100 Planner Code 85 on Manual Ords. 75 Control Method 35 Site 55 Cycle Cnt. 75 Ranking 35 Active 75 Create P/Rs 229 Item Description 75 Default Loc. 229 Item Number 55 Lead Time 85 Enforce Params. 80 Order Up To 65 QOH 55 Event Fnc. 80 Safety Stock 45 Sold 80 Last Counted 45 Stocked 55 ABC Class 80 Order Mult. 80 Last Used 45 Supplied 80 Reorder Lvl. 85 Report Date: 85 Page: ItemSources 530 Item Sources 106 Item Number 50 UOM Ratio 50 Vendor UOM 150 Vendor Item Number 106 Description 50 UOM 106 Vendor 50 Vendor UOM 50 UOM 106 Description 50 UOM Ratio 150 Vendor Item Number 106 Vendor 106 Item Number 75 Report Date: 75 Page: Items 100 Item Number 60 Configured 100 Item Type 100 Packaging Weight 60 Sold 100 Shipping UOM 100 Price UOM 66 Class Code 60 Pick List 150 Alt. Capacity/Inventory Ratio 150 Shipping/Inventory Ratio 100 Inventory UOM 100 Description 2 100 Alt. Capacity UOM 150 Capacity/Inventory Ratio 100 Capacity UOM 60 Exclusive 50 Active 100 Product Weight 100 Description 1 150 Price/Inventory Ratio 356 Items 60 Configured 100 Description 1 150 Capacity/Inventory Ratio 100 Description 2 100 Inventory UOM 100 Price UOM 50 Active 100 Capacity UOM 100 Item Number 60 Exclusive 150 Price/Inventory Ratio 100 Alt. Capacity UOM 150 Shipping/Inventory Ratio 100 Packaging Weight 150 Alt. Capacity/Inventory Ratio 100 Product Weight 66 Class Code 100 Item Type 60 Pick List 60 Sold 100 Shipping UOM 75 Report Date: 75 Page: JobCosting 40 UOM 80 Work Order: 219 Work Center/Item 229 Description 75 Cost 75 Qty. 50 Type 350 Work Order Costing 75 Cost 214 Work Center/Item 229 Description 40 UOM 75 Qty. 50 Type 85 Page: 85 Report Date: 60 Total Cost: Journals 105 Account 105 Reference 50 Doc. Type 40 Date 50 Doc. # 60 Source 465 Journals 80 Credit 85 Debit 40 Posted 80 Username 105 Account 50 Doc. Type 60 Source 80 Credit 40 Date 50 Doc. # 85 Debit 105 Reference 40 Posted 80 Username 55 Total: 85 Report Date: 85 Page: 85 Page: 85 Report Date: ListOpenSalesOrders 50 S/O # 150 Customer P/O Number 100 Customer 350 List Sales Orders 100 Ordered 100 Ordered 50 S/O # 100 Customer 150 Customer P/O Number 85 Report Date: 85 Page: ListTransferOrders 50 T/O # 100 Transit 100 To 50 Status 100 Shipped 100 From 100 Ordered 350 List Transfer Orders 100 Scheduled 120 From Site: 120 To Site: 120 Status: 100 Shipped 50 T/O # 100 To 50 Status 100 Scheduled 100 From 100 Ordered 100 Transit 85 Page: 85 Report Date: LocationDispatchList 280 View Contents 110 Site: 284 Location Dispatch List 280 Issue Balance and Post 280 General Use 125 Description 125 Location MaterialUsageVarianceByBOMItem 80 Proj. Req. 80 Proj. Qty. per 103 Site: 80 Act. Issue 103 Item Number: 80 % 80 Produced 75 Post Date 80 Ordered 50 UOM: 80 Qty. per Var. 50 UOM: 50 Seq. #: 80 Act. Qty. per 545 Material Usage Variance By BOM Item 120 Component Item: 75 Post Date 80 Proj. Qty. per 80 Act. Issue 80 Proj. Req. 80 Produced 80 % 80 Qty. per Var. 80 Act. Qty. per 80 Ordered 85 Page: 85 Report Date: MaterialUsageVarianceByComponentItem 80 Act. Qty. per 50 UOM: 85 Proj. Req. 545 Material Usage Variance By Component Item 75 Post Date 104 Item Number: 104 Site: 100 Description 80 Produced 104 End Date: 80 % 100 Parent Item 80 Act. Issue 80 Ordered 104 Start Date: 80 Proj. Qty. per 80 Qty. per Var. 80 Ordered 80 Produced 100 Description 100 Parent Item 75 Post Date 80 Proj. Qty. per 80 Act. Issue 80 % 80 Qty. per Var. 80 Act. Qty. per 85 Proj. Req. 85 Report Date: 85 Page: MaterialUsageVarianceByItem 80 % 100 Component Item 104 Site: 50 UOM: 80 Qty. per Var. 80 Produced 100 Description 104 Item Number: 100 End Date: 80 Act. Issue 80 Act. Qty. per 75 Post Date 450 Material Usage Variance By Item 100 Start Date: 80 Ordered 85 Proj. Req. 80 Proj. Qty. per 80 Act. Issue 80 Act. Qty. per 80 % 75 Post Date 80 Produced 100 Component Item 100 Description 80 Qty. per Var. 80 Ordered 85 Proj. Req. 80 Proj. Qty. per 85 Page: 85 Report Date: MaterialUsageVarianceByWarehouse 80 Act. Issue 80 Act. Qty. per 100 Description 100 Component Item 75 Proj. Req. 104 Start Date: 75 Ordered 75 Qty. per Var. 104 Site: 100 Parent Item 75 Post Date 494 Material Usage Variance By Site 70 Proj. Qty. per 75 Produced 104 End Date: 75 % 100 Description 75 Produced 75 Post Date 100 Description 70 Proj. Qty. per 75 Qty. per Var. 75 Ordered 75 Proj. Req. 100 Description 75 % 80 Act. Issue 80 Act. Qty. per 100 Parent Item 100 Component Item 85 Page: 85 Report Date: MaterialUsageVarianceByWorkOrder 75 Post Date 100 Description 100 Component Item 80 Produced 80 Proj. Qty. per 80 Qty. per Var. 104 Item Number: 80 Act. Issue 80 % 85 Proj. Req. 80 Ordered 50 Site: 104 Status: 50 UOM: 104 Work Order #: 490 Material Usage Variance By Work Order 80 Act. Qty. per 80 Qty. per Var. 85 Proj. Req. 100 Component Item 80 Act. Issue 75 Post Date 80 Ordered 80 Produced 80 Proj. Qty. per 80 Act. Qty. per 80 % 100 Description 85 Page: 85 Report Date: MetaSQLMasterList 300 MetaSQL Statements 25 of OpenWorkOrdersWithClosedParentSalesOrders 75 S/O # 80 Due Date 100 Item Number 105 Site: 80 Start Date 100 Description 75 Ordered 40 Site 686 Open Work Orders With Closed Parent Sales Orders 75 Status 75 W/O # 80 Received 75 W/O # 100 Item Number 80 Start Date 75 Ordered 75 S/O # 75 Status 40 Site 100 Description 80 Due Date 80 Received 80 Page: 80 Report Date: OpenWorkOrdersWithParentSalesOrders 100 Description 75 Status 686 Open Work Orders With Parent Sales Orders 75 S/O # 105 Site: 75 W/O # 80 Received 80 Start Date 80 Due Date 40 Site 75 Ordered 100 Item Number 40 Site 75 Status 100 Item Number 80 Received 75 S/O # 80 Due Date 75 W/O # 75 Ordered 100 Description 80 Start Date 80 Page: 80 Report Date: OpportunityList 80 Source 80 Amount 100 Actual Date 80 Stage 450 Opportunity List 55 Curr. 80 CRM Acct # 100 Target Date 80 Prob. % 80 Type 80 Owner 200 Name 80 Type 200 Name 80 Stage 80 CRM Acct # 80 Amount 80 Source 80 Prob. % 100 Actual Date 55 Curr. 80 Owner 100 Target Date 85 Page: 85 Report Date: OrderActivityByProject 105 Project Number: 80 Name: 350 Order Activity by Project 135 Quantity Ordered / Billed 50 Value 85 Status 104 Order Number - Line 90 Order Type: 95 Item 140 Section Total: 85 Page: 85 Report Date: PackageMasterList 80 Description 450 Package Master List 95 Package 100 Version 50 Enabled 95 Package 80 Description 100 Version 50 Enabled 85 Page: 85 Report Date: PackingListBatchEditList 50 Hold Type 100 Shipment # 80 Customer Name 450 Packing List Batch Edit List 80 Customer # 100 Order # 50 Printed 100 Ship Via 50 Printed 80 Customer # 80 Shipment # 80 Customer Name 100 Order # 50 Hold Type 100 Ship Via 85 Page: 85 Report Date: PackingList-Shipment 355 Shipment Packing List 200 Item Description 150 Shipment #: 75 Verified 75 Terms: 150 Customer P/O #: 150 Sched. Date: 150 Order Date: 95 Attention: 40 UOM 75 Bill To: 100 Ship Via: 75 Order Line 80 Ordered 80 Shipped 200 Item Number 100 Ship To: 150 Customer #: 50 Status: 55 Notes: 37 Page: 61 Print Date: 160 Completed By: 165 Checked By: PackingList 150 Customer #: 150 Customer P/O #: 80 Packed 200 Item Number 100 Ship To: 95 Attention: 75 Terms: 75 Bill To: 80 Ordered 300 PACKING List 100 Ship Via: 150 Shipment #: 200 Item Description 150 Sched. Date: 150 Order Date: 40 UOM 75 Verified 55 Notes: 50 Status: 180 Lot / Serial Number 200 Quantity 200 Item 200 Lot Detail Information: 61 Print Date: 37 Page: 160 Completed By: 165 Checked By: PartiallyShippedOrders 100 End Date: 100 Start Date: 100 Customer 100 Site: 80 Scheduled 356 Partially Shipped Orders 80 Ordered 80 Hold Type 50 S/O # 80 Pack Date 80 Hold Type 80 Scheduled 80 Pack Date 80 Ordered 100 Customer 50 S/O # 75 Page: 75 Report Date: PendingBOMChanges 80 Item: 75 Qty. Required 405 Pending Bill of Materials Changes 80 Cutoff Date: 90 Revision Date: 229 Item Description 229 Component Item Number 75 Create W/O 40 UOM 90 Revision: 50 Seq. # 90 Document #: 75 Scrap 75 Action 75 Date 75 Qty. Per 75 Issue Method 75 Fxd. Qty. 75 Create W/O 75 Date 75 Qty. Required 75 Scrap 40 UOM 75 Action 75 Issue Method 50 Seq. # 229 Component Item Number 75 Qty. Per 229 Item Description 75 Fxd. Qty. 85 Report Date: 85 Page: PendingWOMaterialAvailability 450 Pending W/O Material Availability 104 Site: 100 UOM 35 Seq. # 85 Item Number 80 QOH 80 Total Alloc. 80 Available 100 Description 104 Item Number: 80 Pend. Alloc. 104 Description: 35 Level 100 Description 80 Pend. Alloc. 80 QOH 80 Available 35 Seq. # 100 UOM 85 Item Number 80 Total Alloc. 35 Level 85 Report Date: 85 Page: PickingListSOClosedLines 100 Ordered 100 At Shipping 35 UOM 100 Shipped 102 S/O Date: 55 Packed 60 S/O #: 75 Ship To: 121 Sched. Date: 122 Customer #: 100 Balance 150 Customer P/O #: 330 Picking List (SO) 95 Attention: 65 Bill To: 75 Terms: 85 Item Number 95 Item Description 102 Ship Via: 60 Status: 75 Notes: 47 Carton: 47 Qty: 60 Batch #: 62 Print Date: 37 Page: 90 Sales Order #: 165 Checked By: 160 Completed By: PickingListSOLocsNoClosedLines 75 Terms: 75 Ship To: 100 Shipped 95 Attention: 150 Customer P/O #: 35 UOM 122 Customer #: 60 S/O #: 100 Ordered 330 Sales Order Pick List 125 Ship Via: 125 S/O Date: 100 Balance 85 Item Number 95 Item Description 55 Packed 100 At Shipping 100 To Pick 65 Bill To: 125 Sched. Date: 90 Expiration 48 Qty: 205 QtyAtLocn QtyReserved UOM 80 Location: 145 Lot / Serial 48 Carton: 135 Qty Picked 60 Status: 135 Loc / Lot 48 Item: 145 Total, All Lot/Ser/Loc: 90 Sales Order #: 62 Print Date: 37 Page: 160 Completed By: 85 Order Notes: 165 Checked By: PickingListSONoClosedLines 100 At Shipping 65 Bill To: 75 Ship To: 121 Sched. Date: 122 Customer #: 100 Ordered 330 Picking List (SO) 35 UOM 102 Ship Via: 75 Terms: 95 Attention: 100 Shipped 60 S/O #: 150 Customer P/O #: 95 Item Description 55 Packed 85 Item Number 100 Balance 102 S/O Date: 48 Carton: 60 Status: 60 Batch #: 75 Notes: 48 Qty: 37 Page: 90 Sales Order #: 62 Print Date: 160 Completed By: 165 Checked By: PickListWOShowLocations 154 Start Date: 150 Site: 154 Work Order #: 154 Due Date: 154 Date: 150 Qty. Ordered: 150 Qty. Received: 204 WO Pick List 150 Item: 100 Issue Method 100 Qty. Issued 100 Qty. To Pick 100 Qty. Required 120 Total Qty. Picked 125 Lot 150 Item Number 125 Location Coment; 90 Expiration 300 Item Description 100 Issue UOM 125 Qty / UOM 140 Loc / Lot Qty Picked 125 Location 165 Total All Lot/Locations: 194 Production Notes: PickList 300 Item Description 154 Date: 154 Work Order #: 100 Qty. To Pick 154 Due Date: 150 Site: 150 Item: 150 Qty. Received: 204 Pick List 100 Qty. Picked 125 Location 100 Qty. Required 100 Issue Method 150 Item Number 150 Qty. Ordered: 100 Qty. Issued 100 Issue UOM 154 Start Date: 100 Issue UOM 300 Item Number 125 Location 100 Issue Method 100 Qty. Picked 100 Qty. Issued 100 Qty. Required 300 Item Description 100 Qty. To Pick 139 Production Notes: PlannerCodeMasterList 80 Description 95 Code 450 Planner Code Master List 95 Code 80 Description 85 Page: 85 Report Date: POHistory 50 Received 530 P/O History 50 Due Date 106 Vend. Item # 35 # 105 Vendor: 85 Vendor UOM or 50 UOM or 106 Item 50 Ordered 105 P/O #: 80 Exp. Cat. Code 100 Exp. Cat. Descrip. 106 Item 35 # 80 Exp. Cat. Code 100 Exp. Cat. Descrip. 106 Vend. Item # 50 Due Date 50 Ordered 50 Received 50 UOM or 85 Vendor UOM or 75 Page: 75 Report Date: POLineItemsByDate 125 Purchasing Agent: 100 Start Due Date: 400 P/O Line Items By Date 80 Ordered 80 Due Date 100 Item Number 100 End Due Date: 80 Received 80 Returned 50 UOM 80 P/O # 40 # 80 Vendor 100 Site: 40 Site 80 Returned 50 UOM 80 Ordered 80 Vendor 80 P/O # 80 Due Date 40 # 80 Received 100 Item Number 40 Site 100 Report Date: 100 Page: POLineItemsByItem 50 UOM 100 Vendor 80 Returned 80 P/O # 80 Received 400 P/O Line Items By Item 85 Item: 80 Ordered 50 UOM 80 Due Date 40 Site 100 Site: 125 Purchasing Agent: 80 P/O # 80 Returned 50 UOM 80 Received 100 Vendor 80 Due Date 80 Ordered 40 Site 100 Page: 100 Report Date: POLineItemsByVendor 80 Received 50 UOM 100 Site: 80 Due Date 80 P/O # 400 P/O Line Items By Vendor 125 Purchasing Agent: 100 Item Number 125 Selection: 80 Ordered 40 Site 80 Returned 50 UOM 80 Received 40 Site 80 Ordered 80 Due Date 100 Item Number 80 P/O # 80 Returned 100 Page: 100 Report Date: POsByDate 80 Vendor 80 P/O # 80 Status 80 Due Date 100 Site: 400 P/Os By Date 125 Purchasing Agent: 40 Site 100 End Order Date: 110 Start Order Date: 80 Order Date 80 P/O # 80 Due Date 80 Status 40 Site 80 Vendor 100 Page: 100 Report Date: POsByVendor 100 End Date: 100 Site: 100 Start Date: 80 P/O # 40 Site 80 Status 80 Date 400 P/Os By Vendor 80 Vendor 125 Selection: 80 Vendor 80 Status 80 P/O # 80 Date 40 Site 100 Report Date: 100 Page: PricesByCustomerType 100 Source 80 Qty. Break 350 Prices by Customer Type 105 Customer Type: 155 Show Future Prices: 100 Schedule 155 Description 155 Item Number 80 Price 155 Show Expired Prices: 80 Qty. Break 155 Item Number 80 Price 100 Schedule 155 Description 100 Source 85 Page: 85 Report Date: PricesByCustomer 155 Show Future Prices: 155 Show Expired Prices: 100 Source 100 Item Number 100 Schedule 80 Qty. Break 155 Description 80 Customer: 350 Prices by Customer 80 Price 100 Schedule 80 Qty. Break 155 Description 80 Price 100 Source 100 Item Number 85 Report Date: 85 Page: PricesByItem 155 Customer/Customer Type 350 Prices by Item 155 Show Expired Prices: 80 Qty. Break 80 Price 100 Schedule 155 Show Future Prices: 100 Source 80 Item: 155 Customer/Customer Type 80 Price 100 Schedule 80 Qty. Break 100 Source 85 Report Date: 85 Page: PricingScheduleAssignments 95 Customer Name 95 Customer # 100 Pricing Schedule 95 Cust. Ship-To 450 Pricing Schedule Assignments 95 Cust. Type 95 Cust. Ship-To 95 Customer # 95 Cust. Type 100 Pricing Schedule 85 Page: 85 Report Date: ProductCategoriesMasterList 80 Description 95 Product Category 450 Product Categories Master List 95 Product Category 80 Description 85 Page: 85 Report Date: ProjectTaskList 50 Number 50 Project: 100 Description 100 Name 450 Project Task List 85 Page: 85 Report Date: PurchaseOrderTypes 80 Description 450 Purchase Order Types 95 Name 95 Name 80 Description 85 Report Date: 85 Page: PurchaseOrder 70 ORDER DATE 80 P/O NUMBER 100 EXTENDED PRICE 100 REQ. DATE 135 ITEM DESCRIPTION 85 UNIT PRICE 80 YOUR ITEM # 85 CURRENCY 80 UOM 75 SHIP VIA: 85 QTY. ORDERED 252 Purchase Order 17 TO: 37 TERMS 37 LINE 60 F.O.B. 17 TO: 80 OUR ITEM # 35 PAGE 95 ORDERED BY 37 SHIP 75 PRINT DATE 60 SUB TOTAL 60 FREIGHT 60 TAX 60 TOTAL 37 PurchasePriceVariancesByItem 100 Vendor 50 P/O # 85 Site: 112 Vendor Description 85 Purch. Agent: 100 Start Date: 60 Item: 80 Received 80 Qty. 80 Dist. Date 95 Variance 475 Purchase Price Variances By Item 50 UOM: 95 % 112 Vendor Item Number 100 End Date: 95 Vouchered 95 % 50 P/O # 112 Vendor Description 95 Variance 80 Received 100 Vendor 80 Dist Date 112 Vendor Item Number 80 Qty. 95 Vouchered 100 Page: 100 Report Date: PurchasePriceVariancesByVendor 112 Vendor Item Number 475 Purchase Price Variances By Vendor 95 Vouchered 85 Site: 100 End Date: 50 P/O # 95 % 112 Vendor Description 80 Received 80 Dist. Date 80 Qty. 100 Start Date: 85 Purch. Agent: 112 Vendor 95 Variance 50 P/O # 95 % 112 Vendor Item Number 80 Received 80 Dist. Date 95 Vouchered 80 Qty. 112 Vendor Description 112 Vendor Number 95 Variance 112 Vendor Name 100 Page: 100 Report Date: PurchaseReqsByPlannerCode 475 Purchase Requests By Planner Code 100 Start Date: 200 Description 80 Due Date 100 Item Number 50 Status 100 End Date: 100 Purchase Request 100 Parent Order 120 Planner Code: 80 Qty. 100 Site: 80 Create Date 100 Parent Order 100 Purchase Request 53 Status 100 Description 80 Due Date 80 Qty. 100 Item Number 80 Create Date 38 Notes 100 Page: 100 Report Date: PurchaseRequestsByItem 90 Qty. 80 Status 100 Site: 120 Item: 100 Parent Order 475 Purchase Requests By Item 50 UOM: 90 Due Date 90 Purchase Request 80 Create Date 90 Qty. 90 Purchase Request 100 Parent Order 80 Status 90 Due Date 80 Create Date 38 Notes 100 Page: 100 Report Date: PurchaseReqsByPlannerCode 100 Parent Order 80 Qty. 120 Planner Code: 100 End Date: 475 Purchase Requests By Planner Code 100 Description 100 Item Number 100 Start Date: 100 Site: 80 Status 80 Due Date 100 Item Number 80 Qty. 80 Status 80 Due Date 100 Description 100 Parent Order 100 Page: 100 Report Date: QOHByLocation 80 Lot/Serial # 75 Restricted: 80 UOM 410 Quantities on Hand by Location 70 Site 75 Netable: 80 Site: 230 Item Number 230 Item Description 80 QOH 110 Location: 80 As of: 80 Reserved 80 UOM 230 Item Number 80 Lot/Serial # 80 QOH 70 Site 230 Item Description 85 Page: 85 Report Date: QOH 35 Site 65 QOH 80 Non-Netable 80 Reorder Lvl. 150 Item Number 90 Default Location 229 Item Description 240 Quantity On Hand 65 QOH 229 Item Description 35 Site 150 Item Number 80 Reorder Lvl. 80 Non-Netable 90 Default Location 85 Page: 85 Report Date: 40 Totals Quote 103 Pack Date: 103 Terms: 126 Quote 103 Description 103 Extended Price 103 Ship-To #: 103 Ship Via: 112 Qty Ordered, UOM 52 Bill To: 103 Order Date: 50 Line # 52 Fax: 103 Customer PO #: 103 Price, UOM 103 Customer #: 52 Phone: 103 Order #: 56 Ship To: 103 Sale Type: 103 Item 50 Site 103 Sales Rep.: 103 F.O.B.: 125 Option Description: 85 Options: 130 Additional Description: 85.6497 Customer P/N: 103 Tax: 103 Freight: 103 Misc. Charges: 103 Sub-Total: 103 Total: 208 Note, this quotation is priced in: 132 Order Comments: 132 Shipping Comments: 103 Quote Date: 103 Page: ReasonCodeMasterList 95 Code 450 Reason Code Master List 80 Description 80 Description 95 Code 85 Page: 85 Report Date: ReceiptsReturnsByDate 106 Description 530 Receipts and Returns By Date 106 Item Number 100 Rcvd/Rtnd 103 Start Date: 100 Recv. Date 100 Sched. Date 103 Site: 100 P/O # 103 Purch. Agent: 103 End Date: 100 Qty. 100 Vendor 100 Rcvd/Rtnd 100 Sched. Date 100 Recv. Date 106 Item Number 106 Description 100 P/O # 100 Qty. 100 Vendor 75 Report Date: 75 Page: ReceiptsReturnsByItem 100 Sched. Date 103 Purch. Agent: 100 Rcvd/Rtnd 106 Description 100 P/O # 100 Qty. 530 Receipts and Returns By Item 103 Start Date: 100 Vendor 103 Item: 106 Vend. Item Number 103 End Date: 100 Recv. Date 103 Site: 100 Sched. Date 100 Vendor 100 Recv. Date 106 Description 100 Rcvd/Rtnd 100 Qty. 100 P/O # 106 Vend. Item Number 75 Report Date: 75 Page: ReceiptsReturnsByVendor 100 Qty. 103 Vendor: 103 End Date: 106 Description 106 Item Number 103 Start Date: 100 Rcvd/Rtnd 530 Receipts and Returns By Vendor 100 Recv. Date 103 Purch. Agent: 103 Site: 100 Sched. Date 100 P/O # 100 Recv. Date 106 Description 100 P/O # 100 Rcvd/Rtnd 106 Item Number 100 Qty. 100 Sched. Date 75 Page: 75 Report Date: ReceivingLabelOrder 25 Date: ReceivingLabel 25 Date: RejectCodeMasterList 95 Code 450 Reject Code Master List 80 Description 80 Description 95 Code 85 Page: 85 Report Date: RejectedMaterialByVendor 112 Vendor Description 85 Purch. Agent: 60 Vendor: 475 Rejected Material By Vendor 80 Date 80 Reject Code 100 End Date: 50 P/O # 80 Qty. 100 Vendor 112 Vendor Item Number 100 Start Date: 85 Site: 50 P/O # 80 Qty. 112 Vendor Item Number 80 Reject Code 100 Vendor 112 Vendor Description 80 Date 100 Report Date: 100 Page: ReorderExceptionsByPlannerCode 100 Exception Date 106 Description 100 Reorder Level 175 Include Planned Orders: 484 Reorder Exceptions by Planner Code 105 Site: 100 Proj. Avail. 106 Item Number 35 Site 130 Look Ahead Days: 105 Planner Code(s): 106 Item Number 100 Proj. Avail. 100 Reorder Level 100 Exception Date 106 Description 35 Site 85 Page: 85 Report Date: ReportsMasterList 80 Description 450 Reports Master List 95 Report 95 Report 80 Description 85 Page: 85 Report Date: ReturnAuthorizationWorkbenchDueCredit 75 Amount 80 Auth. # 165 Customer/Cust Type: 75 Authorized 75 Customer 695 Return Authorization Workbench Due Credit 75 Eligible 100 Credited By 75 Authorized 80 Auth. # 75 Amount 75 Customer 75 Eligible 100 Credited By 85 Page: 85 Report Date: ReturnAuthorizationWorkbenchReview 75 Disposition 75 Customer 75 Authorized 75 Awaiting 75 Expires 695 Return Authorization Workbench Review 173 Customer/Cust Type/Group: 80 Auth. # 100 Credited By 75 Authorized 100 Credited By 80 Auth. # 75 Expires 75 Disposition 75 Customer 75 Awaiting 85 Page: 85 Report Date: RunningAvailability 80 Ordered 150 Parent Item Number 120 Reorder Level: 120 Order up to Qty.: 100 Due Date 80 Balance 50 QOH: 160 Show Planned Orders: 475 Running Availability 100 Order Multiple: 100 Running Availability 100 Order Type/# 50 UOM: 80 Received 80 Site: 80 Item: 150 Parent Item Number 100 Order Type/# 100 Running Availability 80 Balance 100 Due Date 80 Received 80 Ordered 100 Report Date: 100 Page: SalesAccountAssignmentsMasterList 75 Credit Accnt: 75 Sales Accnt: 530 Sales Account Assignments Master List 80 Customer Type: 75 COS Accnt: 65 Product Cat: 50 Site: 75 Returns Accnt: 75 COR Accnt: 80 COW Accnt: 45 Site: 80 Customer Type: 65 Product Cat: 75 Sales Accnt: 75 Credit Accnt: 75 COS Accnt: 75 Returns Accnt: 75 COR Accnt: 80 COW Accnt: 85 Report Date: 85 Page: SalesCategoriesMasterList 75 Prepaid Accnt: 75 Sales Accnt: 530 Sales Categories Master List 80 Description: 75 A/R Accnt: 50 Name: 45 Name: 80 Description: 75 Sales Accnt: 75 Prepaid Accnt: 75 A/R Accnt: 85 Report Date: 85 Page: SalesHistory 400 Sales History 100 Doc. # 80 Ord. Date 100 Description 100 Item Number 80 Shipped 100 Invoice # 80 Invc. Date 80 Invc. Date 100 Invoice # 100 Doc. # 80 Shipped 100 Item Number 100 Description 80 Ord. Date 80 Total Sales: 100 Report Date: 100 Page: SalesOrderAcknowledgement 75 Terms: 102 Ship Via: 95 Item Description 100 Shipped 121 Sched. Date: 100 Balance 100 At Shipping 365 Sales Order Acknowledgement 150 Customer P/O #: 75 Ship To: 95 Attention: 55 Packed 65 Bill To: 85 Item Number 100 Ordered 102 S/O Date: 35 UOM 60 S/O #: 122 Customer #: 48 Qty: 75 Notes: 60 Batch #: 48 Carton: 60 Status: 37 Page: 90 Sales Order #: 62 Print Date: 165 Checked By: 160 Completed By: SalesOrderStatus 100 Description 100 S/O #: 80 Qty. Invoiced 120 Customer Phone: 355 Sales Order Status 35 UOM 100 Balance 120 P/O #: 100 Child Ord./Status 50 Site 80 Qty. Returned 100 Order Date: 120 Last Updated: 120 Customer Name: 100 Item Number 25 # 80 Qty. Ordered 100 Close Date (User) 80 Qty. Shipped 100 Description 50 Site 150 Balance/Close Date (User) 80 Qty. Ordered 100 Item Number 80 UOM 80 Qty. Returned 80 Qty. Shipped 25 # 100 Child Ord./Status 75 Report Date: 75 Page: SalesRepsMasterList 50 Active 450 Sales Reps. Master List 100 Number 80 % Commission 80 Name 50 Active 100 Number 80 Name 80 % Commission 85 Page: 85 Report Date: SaleTypesMasterList 80 Description 450 Sale Types Master List 95 Code 30 Active 95 Code 80 Description 30 Active 85 Report Date: 85 Page: SelectedPaymentsList 530 Selected Payments List 100 Selected 80 P/O # 120 Vendor 80 Voucher # 120 Bank Account 100 Selected 80 Voucher # 80 P/O # 120 Bank Account 120 Vendor 85 Page: 85 Report Date: SelectPaymentsList 80 Voucher # 80 P/O # 100 Selected 65 Late 80 Doc. Date 80 Due Date 120 Vendor 100 Amount 530 Select Payments List 80 Status 65 Late 80 P/O # 100 Selected 80 Due Date 80 Doc. Date 120 Vendor 80 Voucher # 100 Amount 85 Report Date: 85 Page: ShipmentsByDate 130 Start Date: 105 Description 105 Item Number 50 Site 50 # 75 Ship Date 465 Shipments By Date 95 Shipment # 75 Shipped 75 Ordered 130 End Date: 75 Shipped 50 # 75 Ship Date 50 Site 105 Item Number 75 Ordered 105 Description 105 Order #: 105 Customer: 85 Page: 85 Report Date: ShipmentsBySalesOrder 120 P/O Number: 75 Ship Date 50 Site 105 Description 465 Shipments By Sales Order 75 Shipped 75 Ordered 50 UOM 130 Sales Order #: 105 Item Number 125 Customer Name: 50 # 130 Order Date: 100 Shipment # 120 Customer Phone: 105 Item Number 75 Shipped 75 Ordered 105 Description 50 # 75 Ship Date 50 UOM 50 UOM 85 Page: 85 Report Date: ShipmentsByShipment 120 P/O Number: 75 Ship Date 50 Site 105 Description 465 Shipments By Shipment 75 Shipped 75 Ordered 130 Order #: 105 Item Number 125 Customer Name: 50 # 130 Order Date: 100 Shipment # 120 Customer Phone: 130 Shipment #: 120 Tracking Number: 120 Freight: 105 Item Number 75 Shipped 75 Ordered 105 Description 50 # 75 Ship Date 50 UOM 50 UOM 85 Page: 85 Report Date: ShipmentsPending 130 Site: 105 Name/Description 105 Cust./Item # 50 Ship Via 80 Order/Line # 50 Order Type 465 Shipments Pending 95 Shipment # 75 Value at Ship 75 Qty at Ship 50 UOM 75 Value at Ship 60 Order/Line # 45 Order Type 50 Ship Via 105 Cust/Item # 75 Qty at Ship 105 Name/Description 75 Shipment # 50 UOM 85 Page: 85 Report Date: 95 Total Value at Ship ShippingLabelsByInvoice 90 Invoice #: 80 P/O #: 90 Customer #: 16 of ShippingLabelsBySo 90 Order #: 80 P/O #: 90 Customer #: 16 of ShippingZonesMasterList 95 Name 80 Description 450 Shipping Zones Master List 95 Name 80 Description 85 Page: 85 Report Date: ShipToMasterList 120 Customer #: 100 City, State, Zip 80 Name 50 Number 80 Address 400 Ship-To Addresses 100 City, State, Zip 50 Number 80 Name 80 Address 100 Page: 100 Report Date: SingleLevelBOM 75 Effective 55 Issue UOM 80 Item: 130 Item Description 50 Seq. # 40 ECN # 75 Issue Method 75 Qty. Required 100 Document #: 100 Revision Date: 75 Expires 227 Component Item Number 75 Create W/O 75 Scrap 100 Revision: 75 Inv. Qty. Per 350 Single Level Bill of Materials 75 Issue Qty. Per 55 Inv. UOM 75 Issue Fxd. Qty. 75 Inv. Fxd. Qty. 75 Expires 40 ECN # 50 Seq. # 75 Create W/O 75 Effective 75 Qty. Required 55 Inv. UOM 75 Issue Method 75 Scrap 95 Component Item Number 95 Item Description 75 Inv. Qty. Per 75 Issue Qty. Per 55 Issue UOM 75 Issue Fxd. Qty. 75 Inv. Fxd. Qty. 85 Report Date: 85 Page: SingleLevelWhereUsed 350 Single Level Where Used 75 Qty. Required 75 Create W/O 75 Scrap 108 Component Item: 65 Seq. # 75 Qty. Per 75 Expires 229 Item Description 75 Effective 229 Parent Item Number 40 UOM 75 Issue Method 108 Effective: 108 UOM: 75 Fxd. Qty. 75 Qty. Per 229 Item Description 75 Issue Method 75 Effective 40 UOM 75 Scrap 75 Qty. Required 75 Create W/O 75 Expires 229 Parent Item Number 65 Seq. # 75 Fxd. Qty. 85 Report Date: 85 Page: SiteTypesMasterList 80 Description 95 Site Type 450 Site Types Master List 95 Site Type 80 Description 85 Page: 85 Report Date: SlowMovingInventoryByClassCode 80 QOH 495 Slow Moving Inventory By Class Code 80 Last Movement 229 Item Description 150 Item Number 50 Site 80 UOM 80 Site: 100 Cutoff Date: 110 Class Code(s): 80 QOH 80 UOM 50 Site 150 Item Number 80 Last Movement 229 Item Description 85 Page: 85 Report Date: StandardBOL 110 Customer #: 110 Order #: 110 Shipped From: 130 Customer P/O #: StandardJournalGroupMasterList 80 Description 450 Standard Journal Group Master List 95 Name 80 Description 95 Name 85 Report Date: 85 Page: StandardJournalHistory 85 Debit 60 Posted 130 Start Date: 465 Standard Journal History 130 End Date: 106 Account 80 Credit 80 Date 80 Journal # 100 Journal Name 106 Account 80 Date 85 Debit 80 Journal # 100 Journal Name 60 Posted 80 Credit 85 Report Date: 85 Page: StandardJournalMasterList 80 Description 450 Standard Journal Master List 95 Name 80 Description 95 Name 85 Report Date: 85 Page: Statement 95 Balance Due 86.4477 Document Type 175 Statement 90 Document Date 75 Due Date 80 Document No. 140 STATEMENT DATE 60 Amount 60 Applied 80 As Of Date: 80 61 to 90 Days 85 31 to 60 Days 85 Current 75 Currency: 75 Total Due 85 Over 90 85 1 to 30 Days SubAccountTypeMasterList 80 Description 95 Type 450 Subaccount Type Master List 95 Code 95 Code 80 Description 95 Type 85 Report Date: 85 Page: SubstituteAvailabilityByRootItem 106 Item Number 35 LT 450 Substitute Availability By Root Item 100 Reorder Level 100 Allocated 100 Available 35 Site 106 Description 100 QOH 100 On Order 105 Site: 105 Item Number: 106 Description 100 Allocated 35 Site 106 Item Number 100 Reorder Level 100 QOH 35 LT 100 Available 100 On Order 85 Page: 85 Report Date: SummarizedBacklogByWarehouse 104 Site: 70 Scheduled 60 Hold Type 60 Shipment # 70 Pack Date 60 Shipped 70 Ordered 465 Summarized Backlog By Site 145 Shipvia 104 Customer Type: 80 Start Date: 145 Customer 70 Shipped 80 End Date: 75 S/O # 70 Pack Date 110 Customer/Shipvia 75 S/O #/Shipped 90 Ordered/Shipped 70 Scheduled 60 Hold Type 85 Page: 85 Report Date: SummarizedBankrecHistory 80 Post Date 90 User 625 Summarized Bank Reconciliation History 90 Start Date 80 Posted 90 Opening Bal. 90 End Date 90 Ending Bal. 100 Bank Account: 80 Post Date 90 User 80 Posted 90 Ending Bal. 90 Opening Bal. 90 Start Date 90 End Date 85 Page: 85 Report Date: SummarizedBOM 50 UOM: 350 Summarized Bill of Materials 90 Revision: 228 Description 50 UOM 90 Revision Date: 90 Document #: 165 Item Number 80 Item: 75 Ext. Qty. Req. 50 UOM 165 Item Number 228 Description 75 Ext. Qty. Req. 85 Page: 85 Report Date: SummarizedGLTransactions 50 Doc. Type 125 Decription/Notes 130 Start Date: 36 Source 80 Credit 130 End Date: 465 Summarized G/L Transactions 125 Account/Date 80 Debit 130 Source: 80 Doc. # 80 Doc. # 125 Decription/Notes 100 Account/Date 80 Credit 50 Doc. Type 80 Debit 60 Source 85 Page: 85 Report Date: SummarizedSalesHistory 80 Total Sales 60 First Sale 60 Last Sale 515 Summarized Sales History 60 Total Qty. 100 Description 90 Group 100 Name 50 Currency 60 Last Sale 60 First Sale 80 Total Sales 100 Name 100 Description 50 Currency 60 Total Qty. 90 Group 100 Report Date: 100 Page: TaxAuthoritiesMasterList 80 Name 450 Tax Authorities Master List 95 Code 95 Code 80 Name 85 Report Date: 85 Page: TaxHistoryDetail 450 Tax History Detail 103 End Date: 103 Start Date: 103 Basis: 103 Purchases: 103 Sales: 103 Show: 100 Tax Code 100 Source 200 Description 100 Doc# 200 Item# 100 Doc. Type 75 Tax 100 Doc. Date 75 Currency 100 Doc. Type 100 Tax Code 200 Item# 75 Tax 200 Description 100 Source 75 Currency 100 Doc# 100 Doc. Date 85 Report Date: 85 Page: 100 Total: TaxHistorySummary 450 Tax History Summary 100 Freight 100 Purchases 100 Sales 100 Sales Tax 50 Taxed 100 Purchase Tax 103 End Date: 103 Start Date: 103 Basis: 103 Purchases: 100 Net Tax 100 Freight 103 Sales: 103 Type: 100 Freight 50 Taxed 100 Sales Tax 100 Purchase Tax 90 Purchase 100 Sales 100 Net Tax 85 Report Date: 85 Page: 100 Total: TaxTypesMasterList 80 Description 450 Tax Types Master List 95 Tax Type 95 Tax Type 80 Description 85 Report Date: 85 Page: TermsMasterList 80 Due Days 450 Terms Master List 95 Code 80 Discount % 80 Discnt. Days 80 Description 80 Due Days 80 Description 95 Code 80 Discnt. Days 80 Discount % 85 Report Date: 85 Page: TimePhasedAvailability 250 Period 80 Amount 35 Site 105 Site: 484 Time Phased Availability 120 Planner Code: 35 UOM 80 Item 80 Item 80 Amount 35 Site 250 Period 35 UOM 85 Page: 85 Report Date: TimePhasedBookings 150 Period 385 Time Phased Bookings 35 Site 35 Site 150 Period 110 Total: 85 Report Date: 85 Page: TimePhasedDemandByPlannerCode 80 UOM 120 Planner Code 35 Site 580 Time Phased Demand By Planner Code 120 Planner Code: 250 Period 105 Site: 250 Period 80 UOM 114 Planner Code 35 Site 85 Report Date: 85 Page: TimePhasedOpenAPItems 100 Vend # 250 Period 100 Vend Name 100 Amount 580 Time Phased Open A/P Items 250 Period 100 Amount 100 Vend # 100 Vend Name 100 Total: 85 Page: 85 Report Date: TimePhasedOpenARItems 100 Customer Name 100 Customer # 100 Amount 250 Period 580 Time Phased Open A/R Items 100 Customer # 250 Period 100 Customer Name 100 Amount 100 Total: 85 Page: 85 Report Date: TimePhasedPlannedRevenueExpensesByPlannerCode 120 Planner Code: 740 Time Phased Planned Revenue/Expenses By Planner Code 105 Site: 100 Revenue 100 Gross Profit 100 Cost 250 Period 100 Gross Profit 100 Cost 250 Period 100 Revenue 85 Page: 85 Report Date: TimePhasedProductionByItem 35 Site 580 Time Phased Production By Item 250 Period 120 Item Number 120 Planner Code: 105 Site: 80 Qty. 80 UOM 250 Period 114 Item Number 80 UOM 80 Qty. 35 Site 85 Page: 85 Report Date: TimePhasedProductionByPlannerCode 80 UOM 120 Planner Code: 120 Planner Code 35 Site 105 Site: 250 Period 580 Time Phased Production By Planner Code 35 Site 80 UOM 250 Period 114 Planner Code 85 Report Date: 85 Page: TimePhasedSalesHistory 150 Period 385 Time Phased Sales History 35 Site 35 Site 150 Period 110 Total: 85 Report Date: 85 Page: TimePhasedStatisticsByItem 300 Scrapped (RedGreen/Line) Adjusted (RedBlue/Points&Line) 104 Warehouse: 80 Scrap 80 Issued 80 Adjusted 360 Legend: Issued (Green/Bar) Received: (BlueGreen/Line) Sold: (Blue/Bar) 35 Whs. 80 Sold 80 Received 644 Time Phased Usage Statistics By Item with Graph 104 Item Number: 250 Period 80 Sold 80 Scrap 80 Received 35 Whs. 80 Adjusted 250 Period 80 Issued 85 Report Date: 85 Page: TimePhasedStatisticsByItem 300 Scrapped (RedGreen/Line) Adjusted (RedBlue/Points&Line) 104 Warehouse: 80 Scrap 80 Issued 80 Adjusted 360 Legend: Issued (Green/Bar) Received: (BlueGreen/Line) Sold: (Blue/Bar) 35 Whs. 80 Sold 80 Received 644 Time Phased Usage Statistics By Item with Graph 104 Item Number: 250 Period 80 Sold 80 Scrap 80 Received 35 Whs. 80 Adjusted 250 Period 80 Issued 85 Report Date: 85 Page: TitleList 450 Titles 95 Title 95 Title 85 Page: 85 Report Date: TodoItem 75 User: 100 Incident: 55 Type: 60 Name: 100 Status: 100 Due Date: 70 Sequence: 450 To-Do Item 85 Page: 85 Report Date: TodoList 100 Due Date 75 Assigned To 85 Show Incidents: 50 Priority 35 Type 85 Completed: 450 To-Do List 100 Status 200 Name 100 Parent# 100.893 Show Project Tasks: 100 Status 35 Type 50 Priority 100 Due Date 200 Name 75 Assigned To 100 Parent# 85 Report Date: 85 Page: TrialBalances 100 Ending Bal. 100 Beg. Bal. 100 Credits 90 Period End 90 Description 100 Debits 90 Account # 90 Period Start 100 Difference 350 Trial Balances 100 Difference 100 Beg. Bal. 90 Description 90 Period Start 90 Account # 100 Credits 100 Ending Bal. 90 Period End 100 Debits 85 Page: 85 Report Date: 90 Total: UnappliedAPCreditMemos 100 Amount 80 Vendor 80 Doc. # 100 Applied 450 Unapplied A/P Credit Memos 100 Balance 100 Balance 100 Applied 80 Doc. # 80 Vendor 100 Amount 85 Page: 85 Report Date: UnappliedARCreditMemos 100 Amount 80 Customer 80 Doc. # 100 Applied 450 Unapplied A/R Credit Memos 100 Balance 100 Balance 100 Applied 80 Doc. # 80 Customer 100 Amount 85 Page: 85 Report Date: UniformBOL 120 *Weight (Sub. to Corr.) 60 Ck. Column 90 No. Packages 60 CL or Rate 380 Kind of package, description of articles, special marks and exceptions 40 HM? 65 Street 110 Order #: 110 Customer #: 110 Notes/Special Instructions 80 City, State, Zip 75 P.O. No. 53 To: 53 From: 50 Date: 65 Street 80 City, State, Zip 380 NOTE: Liability Limitation for loss or damage on this shipment 75 Shipper's No. 380 may be applicable. See 49 U.S.C. 14706 (c)(1)(A) and (B). 75 Shipper 75 Route 110 Shipped From: 325 Uniform Bill of Lading 75 Consignee 185 The fiber boxes used for this shipment conform 200 Freight charges are PREPAID 20 $ 780 and carrier makes no guarantees concerning the delivery dates or times (Subject to terms and conditions of any applicable Gold Medal Service agreement). 190 Bill Of Lading shall state whether it is 375 CARRIER CERTIFICATION 185 additional care or attention in handling or 185 stowing must be marked and packaged as to 150 CHECK BOX IF COLLECT 385 certifies that the above named materials are properly classified, described, packaged, marked and labeled, 315 Hazardous Materials Emergency Response Phone Number: 15 { 775 ? Mark with "X" if appropriate to designate Hazardous Materials or Hazardous Substances as defined in the Department of Transportation Regulations governing the transportation of hazardous materials. 185 See Sec. 2(e) or NMFC item 360. 780 National Motor Freight Classification 100-X and successive issues. Note: It is also agreed that the carrier will not be liable for any consequential damages arising from the delay of delivery 190 all other lawful charges. 385 Shipper certifies by its signature, its agreement to all of the foregoing terms and conditions, and further 190 'carrier's or shipper's weight'. 75 C.O.D. fee 160 C.O.D. Amount 185 Collect On Delivery 190 carrier by water, the law requires that the 190 (Signature of consigner) 75 to be paid by 175 to apply in the prepayment of 190 property. The agreed or declared value of the 190 without recourse on the consignor, the 100 Shipper 190 shipper to be not exceeding: 60 Consignee 20 $ 30 per 385 information was made available and/or carrier has the DOT emergency response guidebook or equivelent 200 unless marked collect. 190 property is hereby specifically stated by the 780 except as noted (contents and condition of contents of packages unknown) marked, consigned, and destined as shown above, which said carrier agrees to carry to destination, if on its route, 150 Cash or Certified Check 100 Authorized Signature 385 document in the vehicle. 190 *If the shipment moves between two ports by 185 to the specifications set forth in the box maker's 780 RECEIVED, subject to individually determined rates or contracts that have been agreed upon in writing between the carrier and shipper, if applicable, otherwise the rates, classifications and 780 rules (Estes Express Lines 105 series) that have been established by the carrier and are available to the shipper, on request. The property described above, in apparent good order, 780 party at any time interested in all or any of said property, that every service to be performed thereunder shall be subject to all the terms and conditions of the Uniform Bill of Lading set forth in the 185 of Consolidated Uniform or National Motor 190 consignor shall sign the following statement: 175 described hereof. 100 Authorized Signature 190 The carrier shall not make delivery of the 190 Subject to Section 7 of Conditions, if this 185 Freight Classification. 385 Carrier acknowledges receipt of packages and required placards. Carrier certifies emergency response 75 Date 375 SHIPPER CERTIFICATION 75 Received $ 185 Charges Advanced 100 Carrier 60 Shipper 190 writing the agreed or declared value of the 780 otherwise to deliver to another carrier on the route to destination. It is mutually agreed, as to each carrier of all or any of said property over all or any portion of said route to destination and as to each 190 shippers are required to state specifically in 185 NOTE: Commodities requiring special or 190 shipment is to be delivered to the consignee 185 certificate thereon, and all other requirements 150 Consignee Check Accepted 190 shipment without payment of freight and 385 and are in proper condition for transportation according to the applicable regulations of the DOT. 175 the charges on the property 190 NOTE: Where the rate is dependent on value, 185 ensure safe transportation with ordinary care. UninvoicedReceipts 65 P/O # 80 Item Number 80 By 60 Type 90 Purch. Agent: 80 Value 60 Uninvoiced 80 Vendor 70 Date 509 Uninvoiced Receipts and Returns 35 # 80 Site: 60 Type 35 # 75 By 80 Vendor 70 Date 60 Uninvoiced 80 Value 80 P/O # 80 Item Number 85 Report Date: 85 Page: 37 Total: UninvoicedShipments 229 Item Number 80 UOM 50 # 80 Shipped 50 Order # 80 Selected 350 Uninvoiced Shipments 80 Site: 300 Item Description 80 UOM 80 Shipped 229 Item Number 50 # 300 Item Description 50 Order # 80 Selected 85 Report Date: 85 Page: UnpostedGlSeries 90 Distribution Date 70 Credit 150 Reference 70 Debit 450 Unposted G/L Series Transactions 45 Doc. Type 100 Doc. Number 130 Account 45 Source 70 Debit 90 Distribution Date 100 Doc. Number 130 Account 70 Credit 45 Source 45 Doc. Type 150 Reference 85 Page: 85 Report Date: UnpostedGLTransactions 60 Source 40 Date 105 Reference 130 Start Date: 55 Doc. # 55 Doc. Type 85 Debit 130 End Date: 130 Period: 80 Credit 105 Account 465 Unposted G/L Transactions 80 Credit 105 Reference 40 Date 60 Source 55 Doc. # 105 Account 55 Doc. Type 85 Debit 55 Balance: 55 Total: 85 Report Date: 85 Page: 85 Page: 85 Report Date: UnpostedPoReceipts 450 Unposted Purchase Order Receipts 100 Item Number 75 Qty To Receive 100 Vendor Item Number 40 UOM 70 Qty Ordered 100 Order #: 80 Due Date 80 Vendor: 70 Qty Received 35 Line # 80 Receipt Date 40 UOM 85 Report Date: 85 Page: UnpostedReturnsForPO 450 Purchase Order Returns 50 To: 35 Line # 100 Vendor Item Number 40 UOM 40 UOM 100 Item Number 100 Qty Received 100 Purchase Order #: 100 Vendor: 85 Qty To Return 100 Previously Returned 60 Reason 85 Page: 85 Report Date: UnpostedVouchers 60 Vendor 75 Vend. Type 80 Dist. Date 90 Amount 60 Voucher # 465 Unposted Vouchers 50 P/O # 90 Vendor Invc. # 80 Post Date 80 Dist. Date 75 Vend. Type 50 P/O # 80 Post Date 90 Amount 60 Voucher # 90 Vendor Invc. # 60 Vendor 85 Page: 85 Report Date: UnusedPurchasedItems 80 Last Cnt'd 80 UOM 409 Unused Purchased Items 80 Last Used 110 Class Code(s): 150 Item Number 80 Total QOH 229 Item Description 150 Item Number 229 Item Description 80 Last Used 80 UOM 80 Last Cnt'd 80 Total QOH 85 Page: 85 Report Date: UOMs 95 UOM 450 Units of Measure 80 Description 80 Description 95 UOM 85 Page: 85 Report Date: UsageStatistics 75 Transfers 75 Sold 465 Item Usage Statistics 75 Issued 106 Description 75 Scrap 106 Item Number 75 Adjustments 35 Site 75 Received 75 Sold 106 Description 75 Scrap 106 Item Number 75 Adjustments 75 Issued 75 Transfers 35 Site 75 Received 85 Page: 85 Report Date: UsersMasterList 450 Users Master List 90 Proper Name 95 Username 70 Purchasing 50 Locale 50 Active 50 Agent 50 Initials 70 Purchasing 50 Initials 90 Proper Name 50 Active 50 Agent 95 Username 50 Locale 85 Report Date: 85 Page: ValidLocationsByItem 80 Restrict 80 Site: 80 Item: 150 Location 80 Netable 45 Site 80 Description 350 Valid Locations By Item 80 Netable 80 Description 80 Restrict 150 Location 45 Site 85 Report Date: 85 Page: VendorAddressList 100 City, State, Zip 80 Address 400 Vendor Address List 120 Vendor #: 50 Number 80 Name 50 Number 100 City, State, Zip 80 Address 80 Name 100 Report Date: 100 Page: VendorAPHistory 50 Open 80 Doc. Date 90 Balance 80 Amount 100 Start Date: 100 Doc. Type 70 Invoice # 100 End Date: 475 Vendor History 60 Vendor: 70 Doc. # 80 Due Date 70 P/O # 90 Doc. Date 90 Amount 90 Balance 50 Open 90 Due Date 112 Doc. # 100 Doc. Type 100 Page: 100 Report Date: VendorInformation 85 FAX: 350 Vendor Information 120 Last Year Purchases: 80 Name: 115 Last Purchase Date: 85 FAX: 85 Contact Name: 85 Phone: 100 YTD Purchases: 118.393 Backlog: 85 Email: 135 Contact 2 85 Contact Name: 85 Phone: 170 Contact 1 95 Notes: 80 Number: 85 Email: 104 Open Balance: 115 First Purchase Date: 85 Page: 85 Report Date: VendorMasterList 95 Number 80 Name 450 Vendor Master List 80 Address 95 Number 80 Address 80 Name 85 Page: 85 Report Date: VendorTypesMasterList 80 Description 450 Vendor Types Master List 95 Code 95 Code 80 Description 85 Report Date: 85 Page: ViewAPCheckRunEditList 55 Void 55 Printed 125 Recipient 100 Check Date 125 Check # 125 Invoice/Credit Memo # 120 Bank Account: 125 Voucher/Return Auth. # 465 A/P Check Run Edit List 100 Amount 45 Currency 57 Currency 125 Check/Voucher # 125 Recipient/Invoice # 100 Amount 100 Check Date 55 Printed 55 Void 85 Page: 85 Report Date: 145 Report Total (Base): 145 Report Total: VoucherRegister 106 Reference 106 Account 80 Doc. Type 80 Vend. Name 465 Voucher Register 80 Credit 85 Debit 130 Start Date: 130 End Date: 130 Account: 80 Doc. # 80 Vend. # 80 Date 80 Doc. # 80 Doc. Type 80 Vend. # 106 Account 106 Reference 80 Vend. Name 85 Debit 80 Credit 80 Date 85 Page: 85 Report Date: WarehouseLocationMasterList 50 Whs. 100 Restricted Item 100 Location 75 Description: 70 Restricted 450 Warehouse Location Master List 50 Netable 100 Restricted Item 50 Netable 70 Restricted 75 Description: 100 Location 50 Whs. 85 Report Date: 85 Page: WarehouseMasterList 450 Warehouse Master List 150 Force the use of Count Slips: 110 Next Bill of Lading #: 110 Next Count Tag #: 75 Description: 50 Active: 85 Default F.O.B.: 75 Address: 50 Code: 100 Shipping Whs.: 85 Page: 85 Report Date: WOHistoryByClassCode 80 Start Date 40 W/O # 80 Due Date 100 Site: 100 Class Code(s): 100 Item 80 Received 80 Ordered 484 Work Order History By Class Code 40 Status 40 UOM 40 Site 100 Item 80 Due Date 40 Status 40 Site 80 Received 80 Ordered 80 Start Date 40 UOM 40 W/O # 85 Page: 85 Report Date: WOHistoryByItem 80 Due Date 80 Start Date 100 W/O Number 80 Received 50 Status 100 Site: 50 Site 484 Work Order History By Item 80 Ordered 100 End Date: 100 Start Date: 100 Item Number 80 Start Date 50 Site 50 Status 80 Received 80 Due Date 100 W/O Number 80 Ordered 85 Page: 85 Report Date: WOHistoryByNumber 40 Site 80 Due Date 80 Start Date 100 W/O Pattern: 80 Ordered 40 Status 483 Work Order History By W/O Number 40 W/O # 100 Item 80 Received 40 UOM 40 UOM 40 Site 100 Item 80 Due Date 80 Received 40 W/O # 80 Start Date 40 Status 80 Ordered 85 Report Date: 85 Page: WOLabel 61 PART #: WOLabelForm 52 PART #: WOMaterialAvailabilityByWorkOrder 90 Work Order #: 85 Item Number: 55 UOM: 75 UOM 100 WO/Item Number 75 Total Alloc. 85 Site: 85 Status: 558 W/O Material Availability By Work Order 75 QOH 75 Total Avail. 75 W/O Avail. 75 W/O Alloc. 75 Orders 125 Description 70 Item Filter: 70 WO Filter: 75 W/O Alloc. 75 Total Alloc. 75 Total Avail. 100 WO/Item Number 100 Description 75 W/O Avail. 75 Orders 75 Adj. QOH 75 UOM 76 Report Date: 76 Page: WOMaterialRequirementsByComponentItem 100 Description 75 Issued 75 Required 75 Due Date 75 Qty Per 75 Scrap % 75 Issue Method 80 Item: 80 W/O # 100 Parent Item # 80 Site: 593 W/O Material Requirements By Component Item 75 Balance 75 Fxd Qty 75 Issued 75 Scrap % 100 Parent Item # 100 Description 75 Required 80 W/O # 75 Due Date 75 Qty Per 75 Balance 75 Issue Method 75 Fxd Qty 80 Page: 80 Report Date: 100 Totals: WOMaterialRequirementsByWorkOrder 75 Issued 85 Site: 85 Item Number: 90 Work Order #: 100 Description 75 Issue Method 75 Due Date 558 W/O Material Requirements By Work Order 75 Required 75 Balance 75 Qty Per 75 Scrap % 85 Status: 100 Component Item # 75 Fxd Qty 75 Required 75 Issued 75 Issue Method 75 Qty Per 100 Description 75 Due Date 75 Balance 75 Scrap % 100 Component Item # 75 Fxd Qty 80 Page: 80 Report Date: WOSchedule 80 Ordered 100 Item 40 Site 80 Start Date 40 UOM 80 W/O Number 80 Received 484 Work Order Schedule 80 Due Date 40 Status 80 Start Date 40 Status 100 Item 80 W/O Number 80 Received 40 UOM 40 Site 80 Due Date 80 Ordered 85 Report Date: 85 Page: qt-client-4.1.0/share/dict/ts_to_qph.xsl000066400000000000000000000026071217451700100201740ustar00rootroot00000000000000 qt-client-4.1.0/share/dict/welcome/000077500000000000000000000000001217451700100170725ustar00rootroot00000000000000qt-client-4.1.0/share/dict/welcome/wmsg.base.ts000066400000000000000000000023651217451700100213360ustar00rootroot00000000000000 QDialogButtonBox OK &OK & welcomeStub Welcome Do not show again. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p><p>%1<p> qt-client-4.1.0/share/dict/welcome/wmsg.cs.ts000066400000000000000000000026021217451700100210230ustar00rootroot00000000000000 QDialogButtonBox OK OK &OK &OK welcomeStub Welcome Vítejte Do not show again. Už nezobrazovat. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Vypadá to, že na vaÅ¡em systému nemáte instalován soubor s pÅ™ekladem xTuple . NavÅ¡tivte tento odkaz pro vyhledání vaÅ¡eho jazyka a informace o tom jak instalovat soubory prekladu do xTuple ERP:<p>%1<p> qt-client-4.1.0/share/dict/welcome/wmsg.de.ts000066400000000000000000000023751217451700100210150ustar00rootroot00000000000000 welcomeStub Welcome Willkommen Do not show again. Diese Meldung nicht mehr anzeigen. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Es scheint keine Übersetzungsdatei in Ihrer Sprache auf dem System installiert zu sein. Bitte folgen Sie diesem Link, um eine Übersetzungsdatei in Ihrer Sprache sowie Informationen zur Installation von Übersetzungsdateien zu erhalten:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.el.ts000066400000000000000000000027661217451700100210310ustar00rootroot00000000000000 welcomeStub Welcome ΚαλωσοÏίσατε Do not show again. Μην εμφανίσεις ξανά αυτό το μήνυμα <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Δεν βÏέθηκε εγκατεστημένο αÏχείο μετάφÏασης στον υπολογιστή σας. ΠαÏακαλώ ακολουθείστε στον παÏακάτω σÏνδεσμο για να βÏείτε το αÏχείο μετάφÏασης για την γλώσσα σας και να μάθετε πεÏισσότεÏα για την εγκατάσταση αÏχείων μετάφÏασης στο xTuple ERP:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.es.ts000066400000000000000000000023241217451700100210260ustar00rootroot00000000000000 welcomeStub Welcome Bienvenido Do not show again. No volver a mostrar. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Al parecer usted no tiene el archivo de traducciones xTuple en su sistema. Por favor use el siguiente vínculo para encontrar un archivo de traducciones en su idioma y aprenda como instalarlas en su ERP xTuple:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.fa.ts000066400000000000000000000030251217451700100210040ustar00rootroot00000000000000 QDialogButtonBox OK تایید &OK &تایید welcomeStub Welcome خوش آمدید Do not show again. عدم نمایش مجدد این پیغام. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>ظاهرا ÙØ§ÛŒÙ„های مربوط به ترجمه ÙØ§Ø±Ø³ÛŒ بر روی سیستم شما نصب نشده است Ù„Ø·ÙØ§ با مراجعه به آدرس زیر ÙØ§ÛŒÙ„ مورد نظر را ÛŒØ§ÙØªÙ‡ Ùˆ با Ø§Ø³ØªÙØ§Ø¯Ù‡ از دستورالعمل راهنما آنرا نصب نمایید<p>%1<p> qt-client-4.1.0/share/dict/welcome/wmsg.fil.ts000066400000000000000000000023171217451700100211730ustar00rootroot00000000000000 welcomeStub Welcome Welcome Do not show again. Huwag ipakita muli. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Walang naka-install na xTuple translation file sa iyong system. Maaring gamitin ang sumusunod na link upang hanapin ang translation file ng iyong wika at para matutunan kung paano ito i-install sa xTuple ERP:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.fr.ts000066400000000000000000000025301217451700100210250ustar00rootroot00000000000000 welcomeStub Welcome Bienvenue Do not show again. Ne plus afficher. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Il semble que vous n'avez pas un fichier de traduction xTuple installé sur votre système. S'il vous plaît utilisez le lien suivant pour obtenir un fichier de traduction pour votre langue et en apprendre davantage sur la façon d'installer les fichiers de traduction en xTuple ERP:<p>%1<p> QDialogButtonBox OK &OK OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.hi.ts000066400000000000000000000027611217451700100210240ustar00rootroot00000000000000 welcomeStub Welcome सà¥à¤µà¤¾à¤—तमॠDo not show again. दà¥à¤¬à¤¾à¤°à¤¾ मत दिखाना। <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>à¤à¤¸à¤¾ पà¥à¤°à¤¤à¤¿à¤¤ होता है कि आपके सिसà¥à¤Ÿà¥‡à¤® में à¤à¤•à¥à¤¸-टà¥à¤¯à¥‚पल भाषानà¥à¤¤à¤° की फाईल मौजà¥à¤¼à¤¦ नहीं है। इस लिंक का इसà¥à¤¤à¥‡à¤®à¤¾à¤² करके फाईल को डाउनलोड करें और इसे कैसे इनà¥à¤¸à¥à¤Ÿà¥Œà¤² करें वो जानिà¤à¥¤<p>%1<p> QDialogButtonBox OK बराबर &OK बराबर qt-client-4.1.0/share/dict/welcome/wmsg.hu.ts000066400000000000000000000024231217451700100210330ustar00rootroot00000000000000 welcomeStub Welcome Üdvözlöm! Do not show again. Ne jelenjen meg újra <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Úgy tűnik, hogy nincs xTuple fordítási fájl telepítve. Kérjük, látogasson el az alábbi linkre, ahol találhat fordítási fájlt az Ön nyelvén és további információkért arról, hogyan kell telepíteni fordítási fájlok az xTuple ERP rendszerben:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.it.ts000066400000000000000000000023741217451700100210400ustar00rootroot00000000000000 welcomeStub Welcome Benvenuti Do not show again. Non mostrare di nuovo. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Sembra di non esistere un file xTuple di traduzione installato sul suo sistema. Si prega di utilizzare questo link per trovare il file di traduzione per la lingua italiana e saperne di più su come installare questo file di traduzione in xTuple ERP:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.ja.ts000066400000000000000000000024331217451700100210120ustar00rootroot00000000000000 welcomeStub Welcome よã†ã“ã Do not show again. å†åº¦è¡¨ç¤ºã—ã¾ã›ã‚“。 <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>ã‚ãªãŸã®xTupleシステムã§è¨€èªžç¿»è¨³ãƒ•ァイルãŒã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã•れã¦ã„ãªã„ã“ã¨ãŒåˆ¤æ˜Žã—ã¾ã—ãŸã€‚ 次ã®ãƒªãƒ³ã‚¯ã§ã‚ãªãŸã®è¨€èªžç¿»è¨³ãƒ•ァイルを探ã—ã€ç¿»è¨³ãƒ•ァイルをインストールã™ã‚‹æ–¹æ³•を学んã§ä¸‹ã•ã„。 :<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.nl.ts000066400000000000000000000024031217451700100210260ustar00rootroot00000000000000 welcomeStub Welcome Welkom Do not show again. Dit bericht niet meer laten zien. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Het lijkt erop dat op uw systeem geen xTuple vertaalbestand is geïnstalleerd. Indien dit het geval is gebruik dan de volgende link om een vertaling voor uw taal te vinden en meer informatie over hoe dit vertaalbestand in xTuple ERP te installeren:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.pl.ts000066400000000000000000000023201217451700100210260ustar00rootroot00000000000000 welcomeStub Welcome Witaj Do not show again. Nie pokazuj tego wiÄ™cej <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Wydaje siÄ™, że nie masz zainstalowanego pliku z polskim tÅ‚umaczeniem. ProszÄ™ skorzystaj z tego linku aby odszukać plik z tÅ‚umaczeniem i dowiedz siÄ™ wiÄ™cej jak zainstalować jÄ™zyk polski w xTuple ERP<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.pt.ts000066400000000000000000000023461217451700100210460ustar00rootroot00000000000000 welcomeStub Welcome Bem-vindo Do not show again. Não mostrar novamente. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Parece que você não tem o arquivo de tradução do xTuple instalado no seu sistema. Por favor use o seguinte link para localizar o arquivo de tradução para o seu idioma e aprenda como instalar estes arquivos no xTuple ERP:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.ru.ts000066400000000000000000000026671217451700100210570ustar00rootroot00000000000000 welcomeStub Welcome Добро пожаловать Do not show again. Больше не отображать. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Похоже что у Ð²Ð°Ñ Ð¾Ñ‚ÑутÑтвует файл перевода ÑиÑтемы xTuple. ПожалуйÑта, иÑпользуйте Ñледующую ÑÑылку Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка файла перевода Ð´Ð»Ñ Ð²Ð°ÑˆÐµÐ³Ð¾ Ñзыка и более подробной информации об уÑтановке файлов переводов в xTuple ERP:<p>%1<p> QDialogButtonBox OK Готово &OK Готово qt-client-4.1.0/share/dict/welcome/wmsg.sv.ts000066400000000000000000000023431217451700100210500ustar00rootroot00000000000000 welcomeStub Welcome Välkommen Do not show again. Visa inte denna information igen. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Det verkar saknas en installerad xTuple översättningsfil pÃ¥ ditt system. Använd länken här för att hitta översättningsfilen pÃ¥ svenska. Och läs hur xTuple översättningsfiler installeras i xTuple ERP:<p>%1<p> QDialogButtonBox OK OK &OK &OK qt-client-4.1.0/share/dict/welcome/wmsg.th.ts000066400000000000000000000030661217451700100210360ustar00rootroot00000000000000 welcomeStub Welcome ยินดีต้อนรับ Do not show again. จะไม่à¹à¸ªà¸”งอีà¸à¸„รั้ง <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>ดูเหมือนคุณไม่ได้มีไฟล์à¹à¸›à¸¥ xTuple ติดตั้งในระบบของคุณ โปรดใช้เชื่อมโยงต่อไปนี้เพื่อค้นหาà¹à¸Ÿà¹‰à¸¡à¸à¸²à¸£à¹à¸›à¸¥à¸ªà¸³à¸«à¸£à¸±à¸šà¸ à¸²à¸©à¸²à¸‚องคุณà¹à¸¥à¸°à¹€à¸£à¸µà¸¢à¸™à¸£à¸¹à¹‰ เพิ่มเติมเà¸à¸µà¹ˆà¸¢à¸§à¸à¸±à¸šà¸§à¸´à¸˜à¸µà¸à¸²à¸£à¸•ิดตั้งà¹à¸Ÿà¹‰à¸¡à¹à¸›à¸¥à¹ƒà¸™ xTuple ERP<p>%1<p> QDialogButtonBox OK ตà¸à¸¥à¸‡ &OK ตà¸à¸¥à¸‡ qt-client-4.1.0/share/dict/welcome/wmsg.tr.ts000066400000000000000000000023651217451700100210510ustar00rootroot00000000000000 welcomeStub Welcome HoÅŸ Geldiniz Do not show again. Bunu tekrar gösterme. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>Sisteminizde yüklü bir xTuple çeviri dosyası yok görünüyor. Diliniz için bir çeviri dosyası bulmak ve xTuple ERP çeviri dosyalarını yükleme hakkında daha fazla bilgi edinmek için lütfen aÅŸağıdaki linki kullanın:<p>%1<p> QDialogButtonBox OK Tamam &OK &Tamam qt-client-4.1.0/share/dict/welcome/wmsg.zh.ts000066400000000000000000000022431217451700100210400ustar00rootroot00000000000000 welcomeStub Welcome 欢迎 Do not show again. è¯·å‹¿å†æ¬¡æ˜¾ç¤ºã€‚ <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> <p>您的系统没有安装 xTuple ç¿»è¯‘æ–‡ä»¶ã€‚è¯·ä½¿ç”¨ä»¥ä¸‹é“¾æŽ¥æŸ¥æ‰¾é€‚åˆæ‚¨çš„翻译文件,您还å¯ä»¥å­¦åˆ°å¦‚何安装 xTuple ERP 的翻译文件。<p>%1<p> QDialogButtonBox OK 好的 &OK 好的 qt-client-4.1.0/share/dict/xTuple.base.ts000066400000000000000000204541761217451700100202240ustar00rootroot00000000000000 AddressCluster Address Addresses Street Address: City: State: Country: Active Error Getting Id Error Setting Id Error Saving Address <p>There are multiple Contacts sharing this Address.</p><p>What would you like to do?</p> A System Error Occurred at %1::%2. %1::sInfo() not yet defined Could not instantiate a List Dialog Could not instantiate a Search Dialog Question Saving Address ... Postal: Change This One Change Address for All Error <p>This address appears to have a non-standard country. Please select a country from the list before saving. There was an error checking this Address (%1). AddressList CRM Account Line 1 Line 2 Line 3 City State Country Postal Code Only addresses for %1 Error Getting Addresses AddressSearch Search Street Address Search City Search State Search Country Search Postal Code Show Inactive Addresses CRM Account Line 1 Line 2 Line 3 City State Country Postal Code Only addresses for %1 Error Searching Addresses Alarms Qualifier Due Event Recipient SysMsg Recipient Email Recipient Email Event System Message Other minutes before hours before days before mintues after hours after days after AropenLineEdit Credit Memo Credit Memos Debit Memo Debit Memos Invoice Invoices Cash Deposit Cash Deposits A/R Open Item A/R Open Items AuthorizeDotNetProcessor A Login is required. The Login must be 20 characters or less. The Transaction Key must be 16 characters or less. The Delimiting Character must be exactly 1 character. The response from the Gateway appears to be incorrectly formatted (could not find field %1 as there are only %2 fields present). The response from the Gateway failed the MD5 security check. The response from the Gateway has failed the MD5 security check but will be processed anyway. The Gateway returned the following error: %1 & (ampersand) is not a valid Delimiting Character. The Delimiting Character and the Encapsulating Character cannot be the same. Please change one or the other. BOM Bill of Materials Docu&ment #: Batch Size: &Save &Print &New &Edit &View E&xpire Move &Up Move Do&wn Item #: Revision: Show Expi&red Show &Future Da&te: Number of Items Totals: Standard Material Cost: Actual Material Cost: Non-Pick List Items: Pick List Items: Total Qty. Per Maximum Desired Cost: Total Qty. Per should equal # Item Number Description Type Issue Method Fixd. Qty. Qty. Per Scrap % Effective Expires Item Number Required You must specify a valid item number to continue. Batch Size Error <p>The Batch Size quantity must be greater than zero. Purchased Manufactured Job Phantom Breeder Co-Product By-Product Costing Tooling Outside Process Planning Assortment Kit View Edit Expire Replace Delete Move Up Move Down Push Pull Mixed Error Delete Item? <p>This action can not be undone. Are you sure you want to delete this Item? Total Qty. Per Required Issue UOM Cancel <p>A required total Qty. Per was specified but not met. Please correct the problem before continuing. Notes Reference 'Always' 'Never' BarcodeEditor Bar Code Properties Format: Column: Query Source: 3of9 3of9+ 128 ean13 ean8 upc-a upc-e i2of5 Datamatrix square Datamatrix rectangle Alignment Left Center Right Position/Size X: 0.00 Width: 0.01 Y: Height: Narrow bar width: in inches &OK Alt+O &Cancel Alt+C BatchMessageHandler Information Warning Error CLineEdit Customer Customers Edit Number Sets number for editing Prospect Customer or Prospect? <p>Would you like to create a new Customer or convert an existing Prospect? <p>Would you like to create a new Customer or a new Prospect? Processing Error CRMAcctLineEdit CRM Account CRM Accounts CRMAcctList Number Name First Last Phone Email Address City State Country Postal Code Search For Customer Search For Employee Search For Prospect Search For Sales Rep Search For Tax Authority Search For User Search For Vendor Search For Customer or Prospect Search For CRM Account Database Error CRMAcctSearch Primary Contact Address: Street Address City State Postal Code Country Contact Name Contact Phone # Contact Email Show Inactive Search through: Number Name First Last Phone Email Address Search For Customer Customer Number Customer Name Billing Contact Name Billing Contact Phone # Billing Contact Email Billing Contact Address: Search For Employee Employee Code Employee Number Contact Email Contact Address: Search For Prospect Prospect Number Prospect Name Search For Sales Rep Sales Rep Number Sales Rep Name Search For Tax Authority Tax Authority Code Tax Authority Name Tax Authority Address: Search For User Username User Proper Name Search For Vendor Vendor Number Vendor Name Main Address: Search For Customer or Prospect Billing or Primary Contact Name Billing or Primary Contact Phone # Billing or Primary Contact Email Billing or Primary Contact Address: Search For CRM Account CRM Account Number CRM Account Name Primary Contact Name Primary Contact Phone # Primary Contact Email Database Error Search Combo Vendor Type: CSVAddMapInputDialog Dialog Schema: Table/View: Map Name: Database Error CSVAtlasWindow CSV Atlas Map: Rename &Add Alt+A Delete Table: _table Properties Action: Description: Delimiter: Insert Update Append Pre SQL Continue load on errors Post SQL Field Mappings: Key Field Type Required Use Value Column # If Col. Null Alt. Column # Alt. If Null Alt. Value &File &Help &New New Ctrl+N &Open... Open Ctrl+O &Save Save Ctrl+S Save &As... Save As &Print... Print Ctrl+P &Close &Contents... Contents &Index... Index &About About Open Atlas File Error Reading File <p>An error was encountered while trying to read the Atlas file: %1. Error Opening File <p>Could not open the file %1 for writing: %2 Save Atlas File Print not yet implemented Help Index not yet implemented Help Contents not yet implemented About %1 %1 version %2 %3 is a tool for importing CSV files into a database. %4, All Rights Reserved Renaming Maps feature has not yet been implemented. Must enter name <p>Please enter a name for the new map. Must enter unique name <p>The new map name you entered already exists. Please enter in a unique map name. No Database Could not get the database connection. Table: No Existing Table <p>The table %1 does not exist in this database. You may continue to use and edit this map but only those fields that are known will be shown. Unknown Yes No Column CSVData Open Failed <p>Could not open %1 for reading: %2 Loading %1: line %2 Stop Read Error <p>Error Reading %1: %2 Parsing Error <p>Error parsing the data from %1 (delimiter %2). CSVImportProgress Import Progress Processing CSV file with map _map Import method: _action 0 Current Record: Total Records: Ignored: Errors: Stop CSVToolWindow CSV Tool Delimiter: | ; : Treat first row as header information 1 2 3 All Preview: &File &Map &Import &Help &New New Ctrl+N &Open CSV... Open Open CSV file Ctrl+O &Save Save Ctrl+S Save &As... Save As &Print... Print Ctrl+P E&xit Exit &Contents... Contents &Index... Index &About About Edit Ctrl+E Start... Ctrl+T View Log... Ctrl+L Not Yet Implemented This function has not been implemented. Select CSV File Loading %1... Done loading %1 Displaying Record %1 of %2 Stop (NULL) Are you sure? <p>Printing does not work well yet. Files with more than a handful of columns print each column only a few characters wide.<p>Are you sure you want to print? About %1 %1 version %2 %3 is a tool for importing CSV files into a database. %4, All Rights Reserved { tab } Done reloading No Maps Loaded <p>There are no maps loaded to select from. Either load an atlas that contains maps or create a new one before continuing. Select Map Select Map: Invalid Map <p>The selected map does not appear to be valid. Action not implemented <p>The action %1 for this map is not supported. No data <p>There are no data to process. Load a CSV file before continuing. Continuing with rest of import Error <p>There was an error running the Pre SQL query. Please see the log for more details. Aborting transaction. Importing %1: %2 rows out of %3 Cancel Map: %1 Table: %2 Method: %3 Total Records: %4 # Processed: %5 # Ignored: %6 # Errors: %7 Import Processing Status <p>There was an error running the post sql query and changes were rolled back. Please see the log for more details. Import canceled by user. Changes were rolled back. Import Complete The import of %1 completed successfully. ClassCode Class Code &Code &Description Last Modified Unknown ClassCodeList Class Code List &Code Ignore Equals RegEx &Description &Results &Query &Edit &New CmheadClusterLineEdit Credit Memo Credit Memos ColorEditor Color Editor Name: Components Green Red Blue &OK &Cancel Color... 0 ColorList Color Definitions &Close &Add &Edit Delete Error This dialog was not properly setup and cannot perform the requested action! Warning No color name was specified! Please specify a name for this color. The color name you specified is already in use! Please specify a UNIQUE name for this color. Comments Verbose Text Type Source User Comment Public New View Edit None Date/Time ConfigAuthorizeDotNetProcessor Authorize.Net-Specific Configuration Authorize.Net Options: Transaction Version: 3.1 Delimiting Character: , Encapsulating Character: Duplicate Window: 00:00:00 MD5 Hash: Set on Gateway Fail if MD5 check fails Warn if MD5 check fails Currency of Transactions: Same as Order Always Use: Additional Options: Using Wells Fargo SecureSource Ignore SSL Errors ConfigCyberSourceProcessor CyberSource-Specific Configuration CyberSource Options: None ContactCluster Title: Phone: Alternate: Fax: Email: Web: Name: ContactClusterLineEdit A System Error Occurred at %1::%2. Could not instantiate a List Dialog Could not instantiate a Search Dialog Contact Contacts ContactList Contacts First Name Last Name CRM Account List Error Only contacts for %1 ContactSearch Contacts Search First Name Search Last Name Search CRM Account Search Phone Numbers Search Email Address Search Web Address Show Inactive Contacts First Name Last Name CRM Account Phone Alt. Phone Fax Email Address Web Address Search Error Search Title Title Only contacts for %1 ContactWidget Contact Contacts ... Number: Name: Initials: Job Title: Active Voice: Alternate: Fax: E-Mail: Web: CRM Account: Owner: A contact exists with the same first and last name not associated with any CRM Account on the current CRM Account associated with another CRM Account . Would you like to use the existing contact? Existing Contact A contact exists with the same first and last name on the current CRM Account. Would you like to use the existing contact? Multple contacts exist with the same first and last name . Would you like to view all the existing contacts? Existing Contacts A System Error Occurred at %1::%2. Could not instantiate a Search Dialog Question Saving Address There are multiple Contacts sharing this Address. What would you like to do? Change This One Change Address for All Question Saving %1 <p>Would you like to update the existing Contact or create a new one? Create New Change Existing Error There was an error checking this Contact (%1). %1::sInfo() not yet defined Could not instantiate a List Dialog CreditCardProcessor Confirm Post-authorization of Credit Card Purchase Confirm Credit Card Credit Confirm Preauthorization of Credit Card Purchase This transaction was approved. %1 Database Error You don't have permission to process Credit Card transactions. The application is not set up to process credit cards. The Bank Accounts are not set for all Credit Card types. The encryption key is not defined. The login for the proxy server is not defined. The password for the proxy server is not defined. The proxy server is not defined. The port to use for the proxy server is not defined. Credit Card %1 is not active. Make it active or select another Credit Card. Credit Card %1 has expired. The Credit Card configuration is inconsistent and the application cannot determine whether to run in Test or Live mode. Could not figure out which Credit Card Processing Company to set up (based on %1). The digital certificate (.pem file) is not set. Could not open digital certificate (.pem file) %1. Could not find a Credit Card with internal ID %1. Error with message transfer program: %1 %2 %3 %1 is not implemented. The application does not support either Credit Cards or Checks with %1. Please choose a different company. The amount to charge must be greater than 0.00. Could not generate a sequence number while preauthorizing. Could not find the Credit Card preauthorization to charge. You must select a preauthorization to charge. The preauthorization (for %1) is not sufficient to cover the desired transaction amount (%2). No Preauthorization found This preauthorization may not be charged. It was created for a Sales Order which has been canceled. Inconsistent data passed to charge(): [%1] [%2] Could not generate a sequence number while charging. Could not find original Credit Card payment to credit. Could not find the Credit Card transaction to void. User chose not to process the preauthorization. User chose not to post-authorize process the charge. User chose not to process the charge. User chose not to process the credit. User chose not to process the void. User chose not to proceed without CVV code. Scripting error in %1: Input parameter %2 is not a(n) %3 This Credit Card transaction was denied. %1 This Credit Card transaction is a duplicate. %1 This Credit Card transaction was declined. %1 This Credit Card transaction was denied because of possible fraud. %1 The Bank Account is not set for Credit Card type %1. Either this card type is not accepted or the Credit Card configuration is not complete. This transaction failed the CVV check. This transaction failed the Address Verification check. You may not process this transaction without a CVV code. Please enter one and try again. The CVV value is not valid. No approval code was received: %1 %2 %3 Could not generate a unique key for the ccpay table. Stored Procedure Error The Credit Card transaction completed successfully but it was not recorded correctly: %1 The Server is %2 and is expected to be %3 in %1 mode, while the Port is %4 and is expected to be %5. Credit Card processing transactions may fail. The Server is %2 and is expected to be %3 in %1 mode.Credit Card processing transactions may fail. The Port is %2 and is expected to be %3 in %1 mode. Credit Card processing transactions may fail. There was a problem printing the credit card receipt. This transaction failed the CVV check but will be processed anyway. This transaction failed the Address Verification check but will be processed anyway. The Credit Card Processing Company Street Address matches but not Postal Code Address not provided for AVS check Address Verification error Card issuing bank is not a U.S. bank No match on Street Address or Postal Code Address Verification does not apply to this transaction Retry - system unavailable or timed out Address Verification service not supported Address information not available 9-Digit Postal Code matches but not Street Address Street Address and 9-digit Postal Code match Street Address and 5-digit Postal Code match 5-Digit Postal Code matches but not Street Address CVV matches CVV does not match CVV was not processed CVV should be on the card but was not supplied Card issuing bank was not certified for CVV Card Verification is not supported for this processor or card type <p>Are you sure that you want to preauthorize a charge to credit card %1 in the amount of %2 %3? Confirm Charge of Credit Card Purchase Are you sure that you want to charge credit card %1 in the amount of %2 %3? Are you sure that you want to charge a pre-authorized transaction to credit card %1 in the amount of %2 %3? Live Test Are you sure that you want to refund %2 %3 to credit card %1? Credit Card Pre-Authorization %1 reversed fully partially Confirm No CVV Code <p>You must confirm that you wish to proceed without a CVV code. Would you like to continue? Could not find PEM file <p>Failed to find the PEM file %1 Questionable Security <p>The security of this transaction may be compromised. The following SSL errors have been reported:<ul>%1</ul></p><p>Would you like to continue anyway?</p> Failed to load Certificate %2 reported an error: %1 %2 returned an error: %1 <p>There are no Certificates in %1. This may cause communication problems. <p>Failed to load a Certificate from the PEM file %1. This may cause communication problems. Invalid Certificate <p>The Certificate in %1 appears to be invalid. This may cause communication problems. Preauthorization Charge Refund Authorized Approved Declined Reversed Voided No Approval Code CrmClusterLineEdit A System Error Occurred at %1::%2. CrmaccountMergePickAccountsPage Error Getting CRM Accounts Number Name First Last Phone Email Address City State Country Postal Code Customer Prospect Vendor Competitor Partner Tax Auth. User Employee Sales Rep Hide Merges in Progress Show Inactive Account Number Pattern Account Name Pattern Contact Name Pattern Phone Pattern Email Pattern Street Pattern City Pattern State Pattern Postal Code Pattern Country Pattern Clearing Old Selections Updating Selections Inserting New Selections Error Getting CRM Account CrmaccountMergePickDataPage Number Name Active Type Primary Contact Secondary Contact Owner Parent Customer Prospect Vendor Competitor Partner Tax Auth. User Employee Sales Rep Notes Getting CRM Accounts Getting CRM Account Perform this merge? <p>Are you sure you want to merge the CRM Accounts as described here?</p><p>If you click YES then the merge will be run immediately. You will have a chance to undo it later.</p> Error Merging Updating Merge Sources Delete CRM Account? Are you sure you want to delete CRM Account %1? Error Deleting Merge Data Error Deleting CRM Account Individual Organization [N/A] Edit CRM Account View CRM Account Delete CRM Account Updating Merge Destination CrmaccountMergePickTaskPage Where next? Try selecting one of the tasks before going on. Looking for Merges CrmaccountMergePurgePage Getting List of Merges CRM Account Number CRM Account Name Status Delete? <p>Are you sure you want to delete the selected merge records?</p><p>Note that obsolete CRM Accounts will be deleted when purging completed merges.</p> Purge Error <p>Are you sure you want to delete all of these merge records?</p><p>Note that obsolete CRM Accounts will be deleted when purging completed merges.</p> Obsolete - will be deleted by purge Merge complete Data selection in progress CrmaccountMergeResultPage Getting Source CRM Accounts Could not draw CRM Account Could not find the portion of the window in which to draw the target CRM Account. CRM Account Number CRM Account Name Error Getting CRM Account Could Not Find CRM Account Could not find the merged CRM Account (%1). Error Getting Obsolete CRM Accounts Revert? <p>Are you sure you want to undo this CRM Account Merge?</p><p>The CRM Accounts will be restored and you will need to start the merge from the beginning.</p> Error Undoing Merge Checking Undo Status CrossTabEditor Properties (Field) Query Source: Table properties Table cell margins (inches) Left: Right: Top: Bottom: Wrapping policy First display all rows First display all columns Display header Display column header on each part Display row header on each part &Font... Column query source Column query column: Horizontal alignment: Normal Left Center Right Vertical alignment: Top Bottom Row query source Row query column: Value query source Value query column: &OK Alt+O &Cancel Alt+C CurrCluster N/A CurrDisplay A System Error occurred at %1::%2. N/A CustCluster Customer #: CustomerSelector All Customers Select Customer Group Customer Type Customer Type Pattern CyberSourceProcessor The Merchant ID is required The message sent to CyberSource was incomplete: %1 The message sent to CyberSource had invalid data in the following field: %1 CyberSource rejected this request (code %1) CyberSource reports a general system failure The Merchant ID %1 is too long SOAP error (probably an xTuple ERP bug): %1 Error reading response XML: %1 CyberSource returned an error for this request (code %1) The amount authorized was 0. Only a portion of the total amount requested was authorized Street Address matches but Postal Code is not verified Street Address and Postal Code do not match Street Address and Postal Code match AVS data are invalid or AVS not allowed for this card type Card holder's name does not match but Postal Code matches Card holder's name does not match but Street Address and Postal Code match Address not verified Card holder's name matches but Billing Street Address and Postal Code do not match Card holder's name and Billing Postal Code match but Street Address does not match Card holder's name and Billing Street Address match but Postal Code does not match Postal Code matches but Street Address was not verified Card holder's name does not match but Street Address matches Address information unavailable; either the US bank does not support non-US AVS or the AVS at a US bank is not functioning properly Card holder's name, Street Address, and Postal Code match AVS is not supported for this processor or card type The processor returned an unrecognized AVS response The bank thinks this transaction is suspicious The CVV failed the processor's data validation check CVV is not supported by the card association The processor returned an unrecognized CVV response The processor did not return a CVV result Could not convert '%1' to %2 CyberSource XML response CyberSource XML Error <p>There was an error processing the response from CyberSource, line %1 column %2: %3<br>(%4) , [no invalid fields listed] DBFileDialog Database File Name Grade Report Name: Grade: ## &OK &Cancel DBarcodeConfig Form Maximum Length of Value 5 DMatrixPreview Form Preview DMatrixRectConfig Form Datamatrix Format Format : Capacity : 10/6 Preview 8x18 8x32 12x26 12x36 16x36 16x48 DMatrixSquareConfig Form Datamatrix Format Format : Capacity : 36/25 18x18 Preview DateCluster Start Date: End Date: DeptClusterLineEdit Department Departments DetailGroupSectionDialog Group Section Editor Column: Group Name: Show Group Header Show Group Footer Insert Page Break After this Footer &OK &Cancel DetailSectionDialog Detail Section Properties Section Name: Query Source: Insert Page Break At End of Last Section Group Sections &Add &Edit Delete Move &Up Move &Down &Close Alt+C unnamed Error Encountered Unable to add a new group because a non-unique name could be generated. No document specified. Tried to add a new Group section with a non-unique name. DocumentScene No Section You must place an object inside a section on the report. Report Header Report Footer Page Header (First) Page Header (Odd) Page Header (Even) Page Header (Last) Page Header (Any) Page Footer (First) Page Footer (Odd) Page Footer (Even) Page Footer (Last) Page Footer (Any) Report Writer Unable to open/create file for writing! Save Failed! Check to make sure that you have permissions to the file you are trying to save to. Ok Choose filename to save XML (*.xml) Save Report to Database Error saving to database Invalid Document The detail section %1 is not valid because no query is specified. DocumentWindow Untitled Document * Report Writer The document '%1' contains unsaved changes. Do you want to save the changes before closing? Save Discard Cancel Documents Description To Do URL Inventory Description Type Name Relationship Incident Could Not Create File %1. Task Opportunity Project Image Number Can View Can Edit Attachment Error Error Getting Image Info File Open Error Could not open %1. Error Getting Assignment Error Unknown document type %1 Confirm Detach <p>You have requested to detach the selected document. In some cases this may permanently remove the document from the system.</p><p>Are you sure you want to continue?</p> Error Detaching Product Description Engineering Reference Miscellaneous Parent Child Related to Duplicate of Purchase Order Sales Order Quote Work Order Time Expense To-Do Item CRM Account Customer Vendor Contact Contract Employee File Error Getting Documents Open View Other EditPreferences Preferences Language : Default Font &Font... Grid Options Show grid Snap to grid Grid Size Interval X Interval: Y Interval: Symetrical values &OK &Cancel EditWatermark Invoice/Credit Memo Watermark Watermark: Show Prices &Cancel &Save EmpClusterLineEdit Employee Employees EmpGroupCluster Name Description EmpGroupClusterLineEdit Employee Group Employee Groups EmpGroupInfo Name: Description: EmpGroupList Name Description EmpGroupSearch Search through Name Search through Description EmpInfo Code: Number: EmpList Code Number EmpSearch Search through Codes Search through Numbers ErrorReporter The selected CRM Account cannot be deleted as it has related Incidents. Error File %1, line %2 File %1 ExpenseCluster Expense Category: ExpenseLineEdit Expense Category Expense Categories ExportHelper Could not open %1 (%2). Could not open %1: %2. Error writing to %1: %2 <p>Cannot export data because the query set with id %1 was not found. Could not find the XSLT directory and command metrics. Cannot find the XSLT file as either %1 or %2 Error starting XSLT Processing: %1 %2 The XSLT Processor encountered an error: %1 %2 The XSLT Processor did not exit normally: %1 %2 The XSLT Processor returned an error code: %1 returned %2 %3 Could not open temporary input file (%1). Could not open temporary output file (%1). Could not find XSLT mapping with internal id %1. ExternalCCProcessor User reported that an error occurred. The 'approved' parameter is empty; this should never happen. FieldEditor Properties (Field) Query Source: Column: Display as Running Total Use Subtotal Value Format String Format Example: %0.2f Built-in Locale Format Array 1 Columns: Lines: H spacing: V spacing: 0 Page break Fill columns first HAlign None Left Center Right VAlign Top Middle Bottom Word wrap Position/Size 0.01 Y: Height: X: Width: in inches 0.00 Preview: Preview Area &OK Alt+O &Cancel Alt+C &Font... FileCluster Open File ... Any Files (*) FileMoveSelector File Status Selector [ Select One of the Following ] Append: Move to: Do nothing Add a suffix Move to a subdirectory Delete GLCluster project GLClusterLineEdit Account Accounts Asset Liability Revenue Expense Equity A System Error Occurred at %1::%2. %1::sList() not yet defined %1::sSearch() not yet defined Company Incomplete The Company associated with this Account has incomplete information. You must complete the Company record to use this Account. The Account used here would typically be type %1. Selecting this Account may cause unexpected results in your General Ledger. Are you sure this is the Account you want to use here? Non-standard Account Type GUIClient Initializing Internal Data A Critical Error occurred at %1::%2. Please immediately log out and contact your Systems Adminitrator. Loading the Background Image Initializing Internal Timers Completing Initialization Loading Database Information Unnamed Database %1 Evaluation %2 - Logged on as %3 %1 %2 - %3 on %4/%5 AS %6 Initializing the Products Module Initializing the Inventory Module Initializing the Scheduling Module Initializing the Purchase Module Initializing the Manufacture Module Initializing the CRM Module Initializing the Sales Module Initializing the Accounting Module Initializing the System Module Custom Could Not Create Form <p>Could not create the '%1' form. Either an error occurred or the specified form does not exist. Could not load file There was an error loading the UI Form from the database. Failed to open URL OK Help Quick Help <p>Before you can run a browser you must set the environment variable BROWSER to point to the browser executable. .aff .dic /xTuple/user.dic /xTuple xTuple <p>You have been disconnected from the database server. This is usually caused by an interruption in your network. Please exit the application and restart.<br><pre>%1</pre> GraphEditor Graph Editor General Query Source: Position/Size 0.01 Y: Height: X: Width: in inches 0.00 Base Font Font... Title Title: Use Base Font Title Font Data Axis Data Axis Labels Column: Data Axis Font Data Axis Title Data Axis Title Font Value Axis Min: Max: Expand Min/Max if needed Value Axis Font Value Axis Title Value Axis Title Font Series Series: New Remove Series Properties Color: Edit Name: Style Bars Lines Points &OK Alt+O &Cancel Alt+C GraphWindow Graph Window Labels Data: Title: Value: Padding (in pixels) Vertical: Horizontal: Value Range Max: Min: Clear All Graph Style Bars Lines Points Number of Sets: Number of References: Label Populate with SQL Execute ImageCluster picture here ImageClusterLineEdit Image Images ImageEditor Image Editor Resize Mode Clip Stretch Static Image Static &Load... Database Column: Query Source: Position/Size 0.01 Y: Height: X: Width: in inches 0.00 &OK Alt+O &Cancel Alt+C Choose a file Images(*.png *.jpg *.xpm) ImportHelper Could not find the metrics for handling import results. <p>Could not write error file %1 after processing %2 (%3). %4 Trying to save backup copy. Could not remove %1 after successful processing (%2). Could not rename %1 to %2 after successful processing (%3). <p>Could not move %1 to %2 after successful processing (%3). <p>Don't know what to do %1 after import so leaving it where it was. Could not open %1: %2 Could not read the first line from %1 Could not open CSV File %1 Could not open Atlas %1 Could not set Map to %1 Could not set first line status Could not import the CSV data from %1 Could not find a Map or Atlas for %1 Could not find the XSLT directory and command metrics. <p>Could not find a map for doctype '%1' and system id '%2'. Write an XSLT stylesheet to convert this to valid xtuple import XML and add it to the Map of XSLT Import Filters. Cannot process %1 element without a key attribute Could not process %1: invalid mode %2 Ignored error while importing %1: %2 Error processing %1. Saving to retry later: %2 Error importing %1: %2 <p>Could not open file %1 (error %2) Problem reading %1, line %2 column %3:<br>%4 ImportWindow MetaSQL Import Tool Import into schema: MetaSQL Files &Add Alt+A Remove &Import Alt+I Select All Messages &File &Help &Contents... Contents &Index... Index &About About E&xit Report Import Tool Reports <font color=red>The following error was encountered retrieving available schemas: %1 %2 </font> Not Yet Implemented This function has not been implemented. %1 version %2 %3, All Rights Reserved Build: %4 %5 is a tool for importing MetaSQL files into a database. Select one or more MetaSQL files to open MetSQL (*.mql) Import Started... No Reports Selected You have not selected any reports to import. Would you like to select all loaded reports now? <font color=red>The following error was encountered disabling the trigger: %1 %2 </font> <font color=red>The following error was encountered while trying to import %1 into the database: %2 %3 </font> The saveMetasql stored procedure failed for %1, returning %2. Import successful of %1 No results returned from query for %1 <font color=orange>The document %1 does not have a name and/or group defined </font> <font color=red>Error reading file %1 or file was empty </font> <font color=red>Could not open the specified file: %1 </font> <font color=red>The following error was encountered re-enabling the trigger: %1 %2 </font> Import complete! %1 version %2 %3, All Rights Reserved Build: %4 %5 is a tool for importing report definition files into a database. Select one or more reports to open Report Definitions (*.xml) <font color=orange>The document %1 does not have a report name defined </font> <font color=red>XML Document %1 does not have root node of report </font> <font color=red>Error parsing file %1: %2 on line %3 column %4 </font> Edit Grade Grade: IncidentClusterLineEdit Incident Incidents InputManager Scanned Work Order #%1-%2. Work Order #%1-%2 does not exist in the Database. Scanned Work Order #%1-%2, Operation %3. Work Order #%1-%2, Operation %3 does not exist in the Database. Scanned Purchase Order #%1. Purchase Order #%1 does not exist in the Database. Scanned Sales Order #%1. Sales Order #%1 does not exist in the Database. Scanned Purchase Order Line #%1-%2. Purchase Order Line #%1-%2 does not exist in the Database. Scanned Sales Order Line #%1-%2. Sales Order Line #%1-%2 does not exist in the Database. Scanned Item %1. Item %1 does not exist in the Database. Scanned UPC %1 for Item %2. UPC Code %1 does not exist in the Database. Scanned Count Tag %1. Scanned User %1. User %1 not exist in the Database. Scanned Transfer Order #%1. Transfer Order #%1 does not exist in the Database. Scanned Transfer Order Line #%1-%2. Transfer Order Line #%1-%2 does not exist in the Database. Scanned Lot/Serial # %1. Lot/Serial # %1 does not exist in the Database. Scanned Item %1, Site %2. Item %1, Site %2 does not exist in the Database. Scanned Site %1, Location %2. Site %1, Location %2 does not exist in the Database. InteractiveMessageHandler Information Warning Error %1, line %2, column %3 %1 line %1, column %2 InvoiceClusterLineEdit Invoice Invoices ItemCluster Item Number: UOM: ItemLineEdit Sold Active Multiply Located Lot/Serial # Controlled Purchased and Manufactured Purchased Manufactured Breeder Co-Product and By-Product Costing Component Kit Components Item Items LabelDefinitionEditor Label Definition Editor Label Name: Label Properties Paper Size: Columns: Rows: Width: Height: Offset X: Offset Y: Horizontal Gap: Vertical Gap: Cancel Save Warning LabelDefinitions Label Definitions Close New Edit Delete Delete Label Definition Really delete this label definition? This cannot be undone. LabelEditor Properties (Label) Text: HAlign None Left Center Right VAlign Top Middle Bottom Position/Size 0.01 Y: Height: X: Width: in inches 0.00 Preview: Preview Area &OK Alt+O &Cancel Alt+C &Font... LanguageOptions Default LogOutput Log Output LogWindow Log Print Clear LotserialLineEdit Lot/Serial Number Lot/Serial Numbers A System Error Occurred at %1::%2. Lot/Serial # Not Found This Lot/Serial # was not found for this item. This Lot/Serial # was not found. Are you sure it is correct? LotserialList Lot/Serial # Item # LotserialSearch Lot/Serial # Item # LotserialseqClusterLineEdit Lot/Serial Sequence Lot/Serial Sequences MQLEdit [*]MetaSQL Editor &Tools &Help &View &Edit &File &New New Ctrl+N &Open... Open Ctrl+O &Save Save Ctrl+S Save &As... (File) Save As &Print... Print Ctrl+P E&xit Exit &Undo Undo Ctrl+Z &Redo Redo Ctrl+Y &Cut Cut Ctrl+X C&opy Copy Ctrl+C &Paste Paste Ctrl+V &Find... Find Ctrl+F &Contents... Contents &Index... Index &About About Database Connect to Database... Connect... Disconnect From Database Disconnect Unnamed Parameter List... Log Output... Results... Parse Query Execute Query Executed SQL... Open... (Database) Save As... (Database) Test Mode Search For Parameters MetaSQL Editor Close Database only File only Database and File Not Yet Implemented This function has not been implemented. About %1 %1 version %2 %3 Build: %4 %5 is a tool for editing and testing MetaSQL statements. Document Modified! Would you like to save your changes before continuing? Warning Encountered an unknown response. No action will be taken. No file Specified No file was specified to save to. Error Saving file There was an error while trying to save the file. Save MetaSQL File MetaSQL Files (*.mql);;Text Files (*.txt) [*]%1 - File: %2 (%3) Database Error <p>Trying to read the MetaSQL statement, the database server returned an error: %1 Not Found <p>Could not find the MetaSQL statement with id %1. <p>There was a problem saving the MetaSQL statement. Only database administrators may change grade 0 statements. Either %1 and choose a different grade or log in as a database administrator to make your changes.</p><pre>%2</pre> Save to %1? <p>Do you also want to save this MetaSQL statement to %1? Could not save MetaSQL statement <p>Trying to save the MetaSQL statement, saveMetasql returned the error code %1. <p>Trying to save the MetaSQL statement, the database server returned an error: %1 <p>There was a problem resetting triggers.Please manually enable the %1 trigger on the %2 table.</p><pre>%3</pre> ---- Parsing Query ---- Query parsed. ERROR: Invalid query! Not Connected You must be connected to a database in order to execute a query. ---- Executing Query ---- Failed to execute query. Save (File) Save (Database) [*]%1 - Group: %2 Name: %3 Grade: %4 (%5) MenuButton A System Error occurred at %1::%2. Form MenuButton MetaSQLSaveParameters MetaSQL Save Parameters Schema: Group: Name: Grade: ## Notes: Database Errror MissingField Missing Field Field _field not in database. Change to: Change Drop NumberGenComboBox Manual Automatic Automatic With Override Shared ORGraphicsSectionDetail unnamed ORGraphicsSectionDetailGroup Group Header Group Footer OpportunityClusterLineEdit Opportunity Opportunities OrderCluster Order #: From: To: OrderLineEdit Order Orders A System Error Occurred at %1::%2. %1::sList() not yet defined %1::sSearch() not yet defined Invalid Order Type %1 is not a valid Order Type. Invalid Order Status Order %1 has an invalid status %2. Order locked This order is being edited in another window or by another user. Please try again later. OrderList Order Type Status From To OrderSearch Order Type Status From To Search through Order Type Search through Status PageSetup Edit page settings... Paper Size Custom dimensions Width: 8.5 Height: 11.0 in Inches Margins Top: 1.0 Bottom: Left: Right: Orientation Portrait Landscape Labels Type: Letter Legal A4 Custom Label ParamListEdit List List: Select Cancel ParameterEdit Parameter List Active Name Type Value &OK Alt+O &Cancel Alt+C &New Alt+N &Edit Alt+E List Delete Not a Valid Report The report definition does not appear to be a valid report. The root node is not 'report'. Name already exists <p>The name for the parameter you specified already exists in the list. ParameterGroup Selected: Pattern: ParameterProperties Parameter Properties Type: String Bool Int Double List Name: Value: False True Values: &New Alt+N Move &Up Alt+U &Edit Alt+E Move &Down Alt+D Delete Active Warning I do not know how to edit QVariant type %1. I do not recognize type %1. Unknown Type I do not understand the type %1. ParameterWidget - Invalid Filter Set This filter set contains an obsolete filter and will be deleted. Do you want to do this? --- Please Select --- Default True False More + Save Filter: Manage PathEditor Stroke properties Width: Style &OK &Cancel Color... PaymentechProcessor A Login is required. A Password is required. A Division Number must be no more than 10 characters long. The response from the Gateway appears to be incorrectly formatted (could not find field %1 as there are only %2 fields present). The response from the Gateway failed the MD5 security check. The response from the Gateway has failed the MD5 security check but will be processed anyway. The Gateway returned the following error: %1 The selected credit card is not a know type for Paymentech. PeriodsListView Name Selected Periods PlanOrdCluster Whs.: Item Number: UOM: PlanOrdLineEdit Planned Order Planned Orders PoitemTableDelegate Selected Item Missing Cost <p>The selected item has no Std. Costing information. Please see your controller to correct this situation before continuing. PoitemTableModel # Item Vend Item # Vend UOM Qty. Unit Price Ext. Price Freight Due Date Project # Expense Cat. <p>You must specify an Expense Category for this non-Inventory Item before you may save it. <p>You must select an Item Number before you may save. <p>You must enter a quantity before you may save this Purchase Order Item. <p>The quantity that you are ordering is below the Minimum Order Quantity for this Item Source. You may continue but this Vendor may not honor pricing or delivery quotations. <p>The quantity that you are ordering does not fall within the Order Multiple for this Item Source. You may continue but this Vendor may not honor pricing or delivery quotations. <p>You must enter a due date. <p>The Due Date that you are requesting does not fall within the Lead Time Days for this Item Source. You may continue but this Vendor may not honor pricing or delivery quotations or may not be able to deliver by the requested Due Date. <p>There is no Purchase Order header yet. Try entering a Vendor if you are using the Purchase Order window. Are you sure you want to continue? <p>Do you wish to Save this Order? Supplying Site Vend Description <p>You must select a Supplying Site before you may save. <p>There is no Item Site for this Site (%1) and Item Number (%2). PreviewDialog Print Preview Zoom in Zoom out Print Cancel ProjectCluster Project #: ProjectLineEdit Project Projects QFormLayoutProto [ QFormLayout %1 ] QObject Cannot Load Dictionary Checking License Key <p>Your license has expired. <p>Your xTuple license expired over 30 days ago, and this software will no longer function. Please contact xTuple immediately to reinstate your software. <p>Attention: Your xTuple license has expired, and in %1 days this software will cease to function. Please make arrangements for immediate payment <p>Multiple concurrent users of xTuple PostBooks require a license key. Please contact key@xtuple.com to request a free license key for your local installation, or sales@xtuple.com to purchase additional users in the xTuple Cloud Service. <p>Thank you. <p>You have exceeded the number of allowed concurrent users for your license. <p>Please note: your xTuple license will expire in %1 days. You should already have received your renewal invoice; please contact xTuple at your earliest convenience. <p>The Registration key installed for this system does not appear to be valid. Registration Key %1 <p>Would you like to continue anyway? Version Mismatch <p>The version of the database you are connecting to is not the version this client was designed to work against. This client was designed to work against the database version %1. The system has been configured to disallow access in this case.<p>Please contact your systems administrator. <p>The version of the database you are connecting to is not the version this client was designed to work against. This client was designed to work against the database version %1. If you continue some or all functionality may not work properly or at all. You may also cause other problems on the database.<p>Do you want to continue anyway? Loading Database Metrics Loading User Preferences Loading User Privileges Loading Translation Dictionary Loading Database Encryption Metrics Additional Configuration Required System Message System Message (%1 at %2) Ready... Snooze No Currency Exchange Rate No Base Currency All All Class Codes All Planner Codes All Product Categories All Item Groups All Cost Categories All Customer Types All Customer Groups All Foreign Currencies All Currencies All Work Centers All Users All Opportunity Sources All Opportunity Stages All Opportunity Types Found %1 tables with mismatched serial values. No problems found A System Error Occurred at %1::%2. <p>The Translation Dictionaries %1 cannot be loaded. Reverting to the default dictionary. , < << > >> <p>Your system is configured to use multiple Currencies, but the Currency Gain/Loss Account and/or the G/L Series Discrepancy Account does not appear to be configured correctly. You should define these Accounts in 'System | Configure Modules | Configure G/L...' before posting any transactions in the system. <p>This document uses a currency which has no valid Exchange Rate. Please review your Exchange Rates to correct the problem. (%1 on %2) <p>No base currency has been defined. Call your system administrator. Yes No Plugin Error Could not load the CSVImp plugin Can not load database driver <p>Unable to load the database driver. Please contact your systems adminstrator. Unable to connect to database <p>Unable to connect to the database with the given information. %1 %2 Copyright (c) 1999-2012, OpenMFG, LLC CSV Import MetaSQL Import Tool for Windows MetaSQL Import Tool for Linux MetaSQL Import Tool for OS X MetaSQL Import Tool Unable to load the database driver. Please contact your systems administrator. Unable to connect to the database with the given information. MetaSQL Editor for Windows MetaSQL Editor for Linux MetaSQL Editor for OS X MetaSQL Editor MQLEdit for Windows MQLEdit for Linux MQLEdit for OS X MQLEdit Could not open file '%1': %2 Report Import Tool for Windows Report Import Tool for Linux Report Import Tool for OS X Report Import Tool Report Definition Not Found The report definition for this report, "%1" cannot be found. Please contact your Systems Administrator and report this issue. Unknown Error An unknown error was encountered while processing your request. Please contact your Systems Administrator and report this issue. Label : field total field textarea 3of9 barcode image graph SECTION TITLE -- Select Query -- Connect to Database Disconnect from Database OpenRPT Report Writer for Windows OpenRPT Report Writer for Linux OpenRPT Report Writer for OS X OpenRPT Report Writer Copyright (c) 2002-2012, OpenMFG, LLC. 3.3.4 QueryComboBox Context Query Parameter Query -- Select Query -- QueryEditor Query Editor Name: Load MetaSQL from Database Group: &OK &Cancel Query: Change may be lost <p>Any changes you have made to the sql query may be lost by turning this option on. Are you sure you want to continue? QueryItem Entire Table or View Pre-defined MetaSQL Custom Query Database Error Unknown Query Source <p>Could not populate this Query Item properly because the query source %1 is not recognized. <p>Could not save this Query Item because the query source %1 is not recognized. Query Item Order: Type of Query: [ Pick a type of query ] Name: Cancel Save Schema or Package: [ Select a schema ] Table or View: [ Select a table or view ] Notes: QueryList Query List Querys: &Close &Add &Edit Delete Duplicate Name The name you specified already exists in the list of query names. QuerySet Order Name Source Schema/Group Table/Name Database Error Delete Query Item? <p>Are you sure you want to delete this Query Item from the Query Set? Save First? <p>The Query Set has not yet been saved to the database. You must save it before adding queries.</p><p>Would you like to save before continuing?</p> Query Set Name: Description: Cancel Save Queries in this set: New Edit Delete Notes: QuoteLineEdit Quote Quotes A System Error Occurred at %1::%2. A System Error Occurred at %1::%2. Could not instantiate a Quote Search Dialog QuoteList Quote Number Customer/Prospect QuoteSearch Quote Number Customer/Prospect RaLineEdit Return Authorization Return Authorizations Access Denied You may not view or edit this Return Authorization as it references a warehouse for which you have not been granted privileges. RaList Disposition Status RecurrenceWidget Days Weeks Months Years From: Until: Today Forever Minutes Hours Custom Processing Error Database Error Change Open Events? <p>This event is part of a recurring series. Do you want to change all open events in this series? Could not save Recurrence information. The parent object/event has not been set. Missing Data You must choose how open events are to be handled Schedule Recurring Event Recurring Every: Create no more than: RenderWindow OpenRPT Renderer Report Definition: Not Loaded Report Information Description: Name: Title: Parameters Active Name Type Value &Add Alt+A &Edit Alt+E &List Alt+L Delete &Help &File &Open... Open Ctrl+O &Print... Print Ctrl+P E&xit Exit &About About Print to PDF... Load from Database... Print Preview... About %1 %1 version %2 %3, All Rights Reserved Build: %4 %5 is a tool for printing reports from a database. XML (*.xml);;All Files (*) Error Loading File There was an error opening the file %1. %2 on line %3 column %4. Not a Valid File The file %1 does not appear to be a valid file. The root node is not 'report'. Not a Valid Report The report definition does not appear to be a valid report. The root node is not 'report'. Load Report from Database Error Loading Report There was an error loading the report from the database. There was an error opening the report %1. %2 on line %3 column %4. Choose filename to save print.pdf Pdf (*.pdf) Name already exists <p>The name for the parameter you specified already exists in the list. ReportHandler &New File &Open File... &Save File Save &As... &Close Print Preview... Print... Print to PDF... E&xit Undo Redo Cu&t &Copy &Paste &Delete Preferences Select All Properties Zoom In Zoom Out Show Grid Snap to Grid Insert Label Insert Field Insert Text Insert Line Insert Rectangle Insert CrossTab Insert Bar Code Insert Image Insert Chart/Graph Load from Database Save to Database Properties... &Page Setup... Query &Sources... Section Editor... Color Definitions... Defined Parameters... Label Definitions... Align Top Align V. Center Align Bottom Align Left Align H. Center Align Right Even Horizontal Spacing Even Vertical Spacing Color Fill Border Rotation File Operations Database Operations Edit Operations Layout Options Report Elements B i Font &File Data&base &Edit &Insert &Document &Help Position [X: %1, Y: %2] Size [W: %3, H: %4] Start Point [X: %1, Y: %2] End Point [X: %3, Y: %4] Unknown Entity Type Group Selection Open File XML (*.xml) Failed read on Open File Encountered and error while parsing %s %s (Line %d Column %d) Nothing to undo Nothing to redo No Section Found Items must be pasted into a section. Language: %1 The language change will take effect the next time the report writer will be run. Warning You must connect to a database with a 'labeldef' table to edit label definitions. Load Report from Database Error Loading Report ReportWriterWindow::dbLoadDoc() : ERROR on setContent() %s (Line %d Column %d) No Database Connection There is no database connection that can be used to load a document. There is no database connection that can be used to save this document. Choose filename to save print.pdf Pdf (*.pdf) Section Angle (0-360) : ReportParameter Parameter Name: Type: String Integer Double Bool Active Default: &OK &Cancel Description Defined List List Type Static Dynamic Static List Values: Value Label Add Edit Remove Dynamic List Query: ReportParameterList Parameter List Parameters: &Close &Add &Edit Delete ReportParameterListItem List Item Label: Value: &OK Alt+O &Cancel Alt+C ReportProperties Report Properties Info Title: Name: Description: Background Enable Background Image General Source Static Dynamic Database Column: Query Source: Opacity 0% (transparent) 10% 100% (opaque) Layout Resize Mode Clip Stretch HAlign Left Center Right VAlign Top Middle Bottom Bounds Y: Width: X: 11.0 Height: 0.0 8.5 in inches Static Image Choose Image Load... Watermark Static Text Use best font Font Arial Change... &OK &Cancel Choose a file Images(*.png *.jpg *.xpm) ReportWriterWindow E&xit &Windows Version %1 - %2 on %3/%4 AS %5 &Cascade &Tile ResultsOutput Results Output Copy All RevisionLineEdit Revision Revisions Activate Activate revision Activate Revision This action will make this revision the system default for theitem it belongs to and deactivate the currently active revision. Are you sure you want proceed? Invalid Mode RevisionLineEdit::setMode received an invalid Mode %1 Invalid Revision Type RevisionLineEdit::setType received an invalid RevisionType %1 Active Pending Inactive Create New Revision? Revision does not exist. Would you like to create a new one from the current active revision? A System Error Occurred at %1::%2. Screen Unsaved work Error Saving %1 Error saving %1 at %2::%3 %4 Record locked This record is currently in use by another user. It will be opened in view mode. This record is currently in use by another user. It may not be edited or deleted at this time. You have made changes that have not been saved. Would you like an opportunity to save your work? ScriptToolbox Could Not Create Form <p>Could not create the '%1' form. Either an error occurred or the specified form does not exist. Could not load file There was an error loading the UI Form from the database. Could not initialize printing system for multiple reports. Any Files (*) Could not load UI <p>There was an error loading the UI Form from the database. <p>There was an error creating a window from the UI Form. It may be empty or invalid. SectionEditor Section Editor Report Header Page Footer Even Page(s) First Page Last Page Odd Page(s) Any Page(s) Report Footer Page Header Even Pages(s) Any Pages(s) Detail Sections &Add &Edit Delete Move &Up Move &Down &Close Alt+C unnamed Error Encountered Unable to add a new section because a non-unique name could be generated. No document was set Tried to add a new Detail section with a non-unique name. SelectMQL Choose a MetaSQL Query Schema or Package: Database Error ShiftClusterLineEdit Shift Shifts ShipmentClusterLineEdit Shipment Shipments Invalid Shipment Type <p>ShipmentClusterLineEdit::setType received an invalid ShipmentType %1 ShipmentClusterLineEdit::setType received an invalid ShipmentType %1 Invalid Shipment Status <p>ShipmentClusterLineEdit::setStatus received an invalid ShipmentStatus %1 ShipmentClusterLineEdit::setStatus received an invalid ShipmentStatus %1 ShipmentList Shipped Date Tracking Number ShipmentSearch Shipped Date Tracking Number Search through Shipped Date Search through Tracking Number ShiptoCluster Ship To# ShiptoEdit Ship To Address Ship To Addresses A System Error Occurred at %1::%2. %1::sList() not yet defined %1::sSearch() not yet defined TextEditor Properties (Text) Bottom Padding: Query Source: Column: HAlign None Left Center Right VAlign Top Middle Bottom Position/Size 0.01 Y: Height: X: Width: in inches 0.00 Preview: Preview Area &OK Alt+O &Cancel Alt+C &Font... ToitemTableDelegate No Standard Cost <p>The selected item has no Standard Costing information. Please see your controller to correct this situation before continuing. ToitemTableModel # Item Qty. Std. Cost Freight Due Date Project # <p>You must select an Item Number before you may save. <p>You must enter a quantity before you may save this Purchase Order Item. <p>You must enter a due date. <p>There is no Transfer Order header yet. Try entering ????. Are you sure you want to continue? <p>Do you wish to Save this Order? UsernameLineEdit User Name User Names UsernameList User Name UsernameSearch User Name VendorGroup All Vendors Select Vendor Type Vendor Type Pattern VendorLineEdit Vendor Vendors VirtualClusterLineEdit Object Objects Info... View record information Open... Open record detail New... Create new record A System Error Occurred at %1::%2. %1::sList() not yet defined %1::sSearch() not yet defined %1::sInfo() not yet defined Ctrl+Shift+I Ctrl+Shift+O Ctrl+Shift+N VirtualInfo Number: Name: Description: &Close A System Error Occurred at %1::%2. VirtualList S&earch for: Number Name Description Category VirtualSearch S&earch for: Search through Numbers Search through Names Search through Descriptions Number Name Description WarehouseGroup Selected: All Sites Site: WoCluster Work Order #: Item Number: UOM: Status: Site: Method: WoLineEdit Work Order Work Orders Assembly Disassembly Open Exploded In Process Released Closed A System Error Occurred at %1::%2. %1::sList() not yet defined WomatlCluster Component Item Number: UOM: Qty. Per: Scrap %: Qty. Required: Fxd. Qty.: Qty. Issued: Form WorkCenterLineEdit Work Center Work Centers XComboBoxPrivate Edit List XDateEdit No work week calendar found <p>The selected Site has no work week defined. Please go to Schedule Setup and define the working days for this site. <p>The selected date is not a working day for the Site selected. Do you want to automatically select the next working day? Non-Working Day Entered XDateInputDialog Enter a Date Enter a date: &Cancel OK XDialog Remember Position Remember Size XDocCopySetter Configure Document Copies Copies # of Copies: Yes No Copy # Watermark Show Prices Copy #%1 XErrorMessage &Show this message again &OK XLabel A System Error occurred at %1::%2. XLineEdit List... List all records Search... Ctrl+Shift+L Ctrl+Shift+Space Search on specific criteria Alias... Ctrl+Shift+A List of alias records XMessageBoxMessageHandler Error <p>There was a problem reading the file, line %1 column %2: %3<br>(%4) XSqlTableModel Yes No XTableView Error Saving %1 Error saving %1 at %2::%3 %4 Export Contents... Reset this Width Reset all Widths Remember Widths Do Not Remember Widths XTextEdit Add Word Ignore Word XTreeView Export Contents... Reset this Width Reset all Widths Remember Widths Do Not Remember Widths Export Save Filename Text CSV (*.csv);;Text (*.txt);;ODF Text Document (*.odt);;HTML Document (*.html) Error Saving %1 Error saving %1 at %2::%3 %4 XTreeWidget Remember Sort Order Do Not Remember Sort Order Export Save Filename Reset this Width Ctrl+M Copy to Clipboard All Row Cell Export As... Reset all Widths Remember Widths Do Not Remember Widths Text CSV (*.csv);;Text (*.txt);;ODF Text Document (*.odt);;HTML Document (*.html) Total Totals XTreeWidgetProgress Stop YourPayProcessor Could not find US $ in the curr_symbol table; defaulting to base currency. No Approval Code %1 %2 %3 The YourPay Store Number is not set. Received unexpected approval code %1. This transaction has been treated as approved by YourPay. If LinkShield is enabled then the cutoff score should be set between 1 and 100 but it is currently set to %1. Higher Numbers indicate higher risk. Transaction failed LinkShield check. Either the score was greater than the maximum configured allowed score or the score was empty (this may happen if the application is configured to check the LinkShield score but you have not subscribed to this service). absoluteCalendarItem Absolute Calendar Item Calendar Name: Period Name: Start Date: Period Length: accountList Account Numbers Company Profit Account Number Sub. Description Type Sub. Type Code Sub. Type Chart of Accounts Asset Expense Liability Equity Revenue accountNumber Account has Balance <p>This Account has a balance. Are you sure you want to mark it inactive? Cannot Save Account No Account Number Account Number &Number: &Description: E&xt. Reference: - Type: Asset Liability Expense Revenue Equity Sub Type: Currency: Automatically Forward Update Trial Balances Co&mments: Active <p>This Account cannot be saved as an Account with the same number already exists. <p>You must specify an account number before you may save this record. accountNumbers Company Profit Sub. Description Type Chart of Accounts &G/L Account Numbers: Show Inactive &Close &Print &New &Edit &Delete Asset Expense Liability Equity Revenue Main Segment Sub. Type Code Sub. Type Active External View Edit Show External Companies accountSearch Search for Account ALL Asset Liability Expense Revenue Equity Company Profit Account Number Sub. Description Type: Type Sub. Type Code Sub. Type accountingPeriod Accounting Period Name: Start Date: End Date: Number: Closed Frozen Cannot Save Period The start date must be less than the end date. Period dates are outside the selected Fiscal Year. Fiscal Year: Quarter: accountingPeriods Name Start End Number Closed Frozen Edit... View... Delete... Close... Open... Freeze... Thaw... Accounting Periods: &Close &Print &New &Edit &View Close Period Freeze Period &Delete Qtr Year List Accounting Periods accountingYearPeriod Fiscal Year Start Date: End Date: Closed accountingYearPeriods Start End Closed Edit... View... Delete... Close... Open... Fiscal Years: &Close &Print &New &Edit &View Close Year &Delete List Fiscal Years addPoComment Add Purchase Order Comment address Address Notes Comments Characteristics New Edit Delete Uses of the Address View Used by First Name or Number Last Name or Name CRM Account Phone Alternate Fax E-Mail Web Address Characteristic Value There was an error creating a new address (%). Check the database server log for errors. Saving Shared Address There are multiple Contacts sharing this Address. If you save this Address, the Address for all of these Contacts will be changed. Would you like to save this Address? There was an error saving this address (%1). Check the database server log for errors. Contact Ship-To Vendor Vendor Address Edit... View... Site addresses List Addresses Show Active Addresses Only Addresses Show Inactive Line 1 Line 2 Line 3 City State Country Postal Code Edit... View... Delete Cannot Delete Selected Address adjustInvValue Adjust Inventory Value Site: Post Close Qty on Hand: 0.00 Current Value: Current Unit Cost: New Value: New Unit Cost: Use alternate adjustment account Account #: &Close You must select a valid Itemsite before posting this transaction. <p>You must enter a valid New Value before posting this transaction. <p>You must enter a valid Alternate G/L Account before posting this transaction. You must select an Itemsite with a positive Qty on Hand before posting this transaction. Cannot Post Transaction Post Successful <p>Value successfully updated. adjustmentTrans &Close Adjustment Transaction Username: &Cancel &Post &Site: &Document #: &Relative &Absolute &Adjustment Qty.: Transaction &Date: After: Before: Inventory Adjustment Transaction Canceled You must select an Item before posting this transaction. <p>You must enter a Quantity before posting this Transaction. Cannot Post Transaction <p>You must enter a total cost value for the inventory to be transacted. <p>Average cost adjustments may not result in a negative quantity on hand. <p>No transaction was done because Item %1 was not found at Site %2. N/A Cost Adjust Value Calculated Manual Total Cost: Unit Cost: Notes alarmMaint Alarm Due: minutes before hours before days before minutes after hours after days after Event Email System Message &User... &Contact... alarms Form &New &Edit &View &Delete allocateARCreditMemo Allocate A/R Credit Memos Document Total: Unallocated Balance: &Close Credits Allocate Doc. Type Doc. # Doc. Date Due Date Amount Paid Balance This Alloc. Total Alloc. Credit Memo Customer Deposit Sales Order Invoice allocateReservations Invalid Date Range You must specify a valid date range. Selected Selected Customer Ship-To: Selected Customer Type: Customer Type Pattern: Allocate Reservations Automatically Add to Packing List Batch apAccountAssignment <p>You must select an A/P Account before saving this A/P Account Assignment. <p>You must select a Prepaid Account before saving this A/P Account Assignment. <p>You must select a Discount Account before saving this A/P Account Assignment. <p>You may not save this A/P Account Assignment as it already exists. Cannot Save A/P Account Assignment Payables Account Assignment All Vendor Types: Selected Vendor Type: Vendor Type Pattern: Prepaid Account: Discount Account: Payables Account: apAccountAssignments Vendor Type A/P Account Prepaid Account Discount Account All &Close &Print &New &View &Edit List Payables Account Assignments Payables Account Assignments: &Delete apCreditMemoApplication A/P Credit Memo Application Vendor #: Apply-To Information Doc. Type: Doc. Date: Due Date: Doc. Number: Amount: Paid: Balance: Available to Apply: Amount to Apply: apOpenItem Type Doc. # Apply Date Amount Currency - Enter Misc. Credit Memo - Enter Misc. Debit Memo Post Cannot Save A/P Memo The tax amount may not be greater than the total A/P Memo amount. Internal Error: _docType has an invalid document type %1 A/P Open Amount Changed Yes No Cannot Create A/P Memo Check Voucher Other Cannot set tax amounts You must enter document and due dates for this A/P Memo before you may set tax amounts. A/P Open Item Vendor #: Document Date: Due Date: Status: Document Type: Document #: P/O #: Journal #: Credit Memo Debit Memo Terms: Amount: Paid: Balance: Use Alternate Prepaid Account Alternate Prepaid Account: <p>You must enter a date for this A/P Memo before you may save it <p>You must enter an amount for this A/P Memo before you may save it <p>You must choose a valid Alternate Prepaid Account Number for this A/P Memo before you may save it. <p>You are changing the open amount of this A/P Open Item. If you do not post a G/L Transaction to distribute this change then the A/P Open Item total will be out of balance with the A/P Trial Balance(s). Are you sure that you want to save this change? <p>The A/P Memo cannot be created as there are missing A/P Account Assignments for the selected Vendor. You must create an A/P Account Assignment for the selected Vendor's Vendor Type before you may create this A/P Memo. Notes Account Tax: Applications apWorkBench Payables Workbench &Close &Query Open Vouchers Payables Credits Selections Checks applyAPCreditMemo Post Doc. Type Doc. Number Doc. Date Due Date Open Currency Applied Voucher In %1: Apply A/P Credit Memo Vendor #: Available to Apply: Applied: Balance: Document #: Distribution Date: Apply to &Balance &Apply Clear Application Debit Memo applyARCreditMemo Post Doc. Type Doc. Number Doc. Date Due Date Open Currency Applied Debit Memo Invoice In %1: Apply A/R Credit Memo Available to Apply: Applied: Balance: Credit Information Document #: Distribution Date: Find Document: Apply to &Balance &Apply Apply Line Bal. Clear Application All Pending applyARDiscount Apply A/R Discount Customer: Doc. Type: Doc. #: Doc. Date: Terms: Discount Date: Discount %: Total Owed: Discounts Applied: Discount Amount: Invoice Credit Memo applyDiscount Apply A/P Discount Terms: Discount Date: Discount %: Doc. Type: Doc. #: Doc. Date: Total Owed: Discounts Applied: Discount Amount: Vendor: Total Discountable Owed: Voucher Debit Memo arAccountAssignment <p>You must select a A/R Account before saving this A/R Account Assignment. <p>You must select a Prepaid Receivables Account before saving this A/R Account Assignment. <p>You must select a Freight Account before saving this A/R Account Assignment. <p>You must select a Deferred Revenue Account before saving this A/R Account Assignment. <p>You must select a Discount Account before saving this A/R Account Assignment. <p>You may not save this A/R Account Assignment as it already exists. Cannot Save A/R Account Assignment A/R Account Assignment Selected Customer Type: Customer Type Pattern: A/R Account: Prepaid Receivables Account: Freight Account: Discount Account: Deferred Revenue Account: arAccountAssignments Customer Type A/R Account Prepaid Account Freight Account Discount Account &Close &Print &New &View &Edit List Receivables Account Assignments Receivables Account Assignments: &Delete Deferred Rev. Account arCreditMemoApplication Invalid Application You may not apply more than the balance due to this Document. You may not apply more than the amount available to apply for this Credit Memo. Receivables Credit Memo Application Apply-To Information Doc. Type: Doc. Date: Due Date: Pending: Doc. Number: Amount: Paid: Balance: Available To Apply: Amount To Apply: arOpenItem Type Doc. # Apply Date Dist. Date Amount Currency - Enter Misc. Credit Memo - Enter Misc. Debit Memo Post Cannot Save Receivable Memo You must enter a date for this Receivable Memo before you may save it You must enter an amount for this Receivable Memo before you may save it The tax amount may not be greater than the total Receivable Memo amount. You must choose a valid Alternate Sales Category for this Receivable Memo before you may save it You must choose a valid Alternate Prepaid Account Number for this Receivable Memo before you may save it. A/R Open Amount Changed You are changing the open amount of this A/R Open Item. If you do not post a G/L Transaction to distribute this change then the A/R Open Item total will be out of balance with the A/R Trial Balance(s). Are you sure that you want to save this change? Yes No Check Certified Check Master Card Visa American Express Discover Card Other Credit Card Cash Wire Transfer Other Cash Receipt You must enter an amount for this Receivable Memo before you may set tax amounts. Invoice Debit Memo Error Cannot set tax amounts You must enter document and due dates for this Receivable Memo before you may set tax amounts. A/R Open Item Document Type: Document #: Order #: Journal #: Print on post Credit Memo Document Date: Due Date: Sales Rep.: Terms: Amount: Commission Due: Paid: Balance: Reason Code: Use Alternate Prepaid Account From Sales Category: Account Number: Saving Credit Memo Failed: %1 Cash Deposit Customer Deposit A/P Check Base Amount Notes Account Tax: Applications arWorkBench Dist. Date Amount Currency Invoice Other &Close Unposted New Edit View Delete Post Edit Cash Receipt... View Cash Receipt... Delete Cash Receipt... Post Cash Receipt... Bank Account Credit Memo Debit Memo Customer Deposit Receivables Workbench Receivables Credits Cash Receipts Credit Card Cust. # Name Check/Doc. # Funds Type Earliest Latest Check Certified Check Master Card Visa American Express Discover Card Other Credit Card Cash Wire Transfer &Query Debits Both Find Document #: Due Date: All On or Before Between and archRestoreSalesHistory Archive Sales History Archive Freight, Sales Tax and Misc. Items Restore Sales History Restore Freight, Sales Tax and Misc. Items Processing Error Archive/Restore Sales History Act on Miscellaneous Items assignClassCodeToPlannerCode Assign Items to Planner Code by Class Code Planner Code: No Planner Code Selected You must select a Planner Code to assign before continuing. assignItemToPlannerCode Assign Item to Planner Code &Planner Code: No Planner Code Selected You must select a Planner Code to assign before continuing. assignLotSerial Print Lot/Serial # Expires Qty. Cannot Cancel Distribution Incomplete Assignment Lot#: Serial#: <p>Could not initialize printing system for multiple reports. Assign Lot/Serial # Qty. to Assign: Qty. Assigned: Qty. Remaining: Lot/Serial # Assignment &New &Delete Options... <p>You must indicate the Lot/Serial # to assign and select the 'Assign' button. You may not cancel this action. <p>You must assign a Lot/Serial # to the remaining Quantity before saving this assignment. Warranty atlasMap <p>There was a problem reading the Atlas file, line %1 column %2: %3<br>(%4) XML Error You do not have sufficient privilege to view this window Atlas Files (*.xml) File name First line of file Cannot Save Atlas Map <p>Please enter a name for this Atlas Map before saving it. <p>Please enter a filter before saving this Atlas Map. <p>Please select a filter type before saving this Atlas Map. <p>Please enter an Atlas File Name before saving this Atlas Map. Please select a Map Name before saving this Atlas Map. <p>This Name is already in use by another Atlas Map. Could not find Atlas <p>Could not find the Atlas file to open to look for CSV import Maps. Could not open Atlas <p>Could not open the Atlas file %1 (error %2). No Focus <p>Could not set focus on the Atlas %1 Invalid Query <p>The query is not valid for some reason No Maps <p>Could not find any Maps in the Atlas %1 CSV File to Atlas Map Name: Pattern: Apply Pattern to: Atlas File: Map: [ Select how to apply the Pattern ] [ Select a Map from the Atlas ] Treat first row as header information bankAccount <p>The bank's Routing Number is not valid. <p>The Federal Reserve Routing Number is not valid. Cannot Save Bank Account Bank Account Bank Name: Account Number: Name: Description: Type: Currency: Checking Cash Credit Card Next Check #: Check Format: Enable EFT Check Printing Create Check Number for EFT Checks Asset Account: <p>Select an G/L Account for this Bank Account before saving it. <p>You must choose which value to use for the Immediate Origin. <p>You must enter an Immediate Origin Name if you choose 'Other'. <p>You must enter an Immediate Origin if you choose 'Other'. <p>You must choose which value to use for the Immediate Destination. <p>You must enter an Immediate Destination Name if you choose 'Other'. <p>You must enter an Immediate Destination number if you choose 'Other'. <p>The Account Number is not valid for EFT purposes. Immediate Origin Too Small? <p>The Immediate Origin is usually either a 10 digit Company Id number or a space followed by a 9 digit Routing Number. Does %1 match what your bank told you to enter here? Use Bank Routing Number twice? <p>Are you sure your bank expects the Bank Routing Number as both the Immediate Origin and the Immediate Destination? Immediate Destination Too Small? <p>The Immediate Destination is usually either a 10 digit Company Id number or a space followed by a 9 digit Routing Number. Does %1 match what your bank told you to enter here? <p>Bank Account name is already in use. Please enter a unique name. Used in Accounts Payable Used in Accounts Receivable Notes Transmission Routing Number: Immediate Origin Name and Number Company Name default Bank Name Routing Number Settlement Lead Time: Immediate Destination Name and Number Federal Reserve bankAccounts Name Description Type A/P A/R Currency Checking Cash Credit Card Cannot Delete Bank Account Bank Accounts: &Close &Print &New &Edit &View &Delete <p>The selected Bank Account cannot be deleted as Cash Receipts have been posted against it. <p>The selected Bank Account cannot be delete as Checks have been posted against it. List Bank Accounts bankAdjustment Cannot Post Bank Adjustment You must enter a date before posting this Bank Adjustment. You must enter an amount before posting this Bank Adjustment. A System Error occurred at %1::%2. Bank Adjustment Adjustment Type: Bank Account: &Cancel &Save Date: Document #: Amount: Notes: bankAdjustmentEditList Bank Account Adj. Type Dist. Date Doc. Number Amount Currency Edit... View... Delete... Post... Bank Adjustments Edit List Bank Account: Adjustments &Close &Print &New &Edit &View &Delete bankAdjustmentType Cannot Save Adjustment Type You must enter a valid name for this Adjustment Type. You must select a valid account for this Adjustment Type. Adjustment Type &Name: &Description: Type Debit Credit Adj. Account: bankAdjustmentTypes Name Description Adjustment Types: &Close &Print &New &Edit &View &Delete List Adjustment Types bomItem Always Effective Never Expires Rank Item Number Description Ratio Element Lower Std. Cost Currency Posted Act. Cost Updated !ERROR! Totals ????? You must enter a Scrap value before saving this BOM Item. The expiration date cannot be earlier than the effective date. Cannot Save Bill of Material Item Reference Item <p>Adding a Reference Item to a Bill of Material may cause W/O variances. <p> OK to continue? Bill of Materials Item Effectivity &Qty. Per: Sc&rap %: Issue Method: ECN #: Push Pull Mixed Fixed Qty.: Substitutions No Substitutions Item-Defined Substitutions BOM-Defined Substitutions New Edit Delete Comments Costs Costs are specific to this Bill of Material Item Costing &Elements: &New &Edit &Delete Create Child W/O at Parent W/O Explosion Issue Child W/O to Parent W/O at Receipt Issue UOM: You must enter a Quantity Per value before saving this BOM Item. Configuration Characteristic: Value: Notes Reference bomList Item Number Description Delete Bill of Materials Are you sure that you want to delete the selected Bill of Materials? &Yes &No Bills of Materials S&earch for: Show BOMs for &Inactive Items BOMs with &Component Items &Close Bills of Materials: &New &Edit &View &Print Co&py &Delete budgets Start Date End Date Code Description Budgets: &Close &Print &New &Edit &View Cop&y &Delete List Budgets buyCard P/O # Line Status Due Date Ordered Received Unit Cost Buy Card Vendor: Close &Print Vendor Part Number: Vendor Description: Purchase History: Notes: Closed Unposted Partial Open calendar Name Start Date Period Offset Period Length Day(s) Calendar Name Required You must enter a Calendar Name to continue. Business Day(s) Week(s) Month(s) Quarter(s) Year(s) User-Defined Calendar Name: Description: Calendar Type: A&bsolute &Relative Origin: Current Day Tomorrow Beginning of Current Week Beginning of Next Week Beginning of Current Month Beginning of Next Month Beginning of Last Year Beginning of Current Year Beginning of Next Year Calendar Items: &New &Edit &Delete Duplicate Calendar Name A Calendar already exists for the Name specified. calendars Name Description New Calendar Type? What type of Calendar do you want to create? Cancel Absolute Relative Calendars: &Close &New &Edit &Delete List Calendars cashReceipt Doc. Type Doc. # Ord. # Doc. Date Due Date Currency Applied Discount Account # Notes Balance Amount Sequence Type Number Active Name Expiration Date &Close Error Applying Credits Could not apply %1 %2 to Cash Receipt (%3) Error Applying Debits Cash Receipt Transaction Not In Bank Currency Invoice No Bank Account <p>Cannot find the Bank Account to post this transaction against. Either this card type is not accepted or the Credit Card configuration is not complete. MasterCard VISA American Express Check Certified Check Master Card Visa Discover Card Other Credit Card Cash Wire Transfer Discover Other Record Receipt as: Cash Receipt &Cancel &Save Amount Received: Misc. Distributions: Amount Applied: Balance: Post to: Distribution Date: Funds Type: Check/Document #: Applications Sales Category: Apply to &Balance &Apply Clear Find Document #: Number: Discount: Application Date: Check/Document Date: Include Credits Add &Edit &Delete Credit Card New Edit View Move Up Move Down CVV Code Apply &Line Bal. Apply Balance As: Credit Memo Customer Deposit All Pending Overapplied? This Cash Receipt appears to apply too much to at least one of the Open Items. Do you want to save the current applications anyway? <p>This transaction is specified in %1 while the Bank Account is specified in %2. Do you wish to convert at the current Exchange Rate?<p>If not, click NO and change the Bank Account in the POST TO field. Credit Card Processing Error Credit Card Processing Warning Credit Card Processing Note Use Alternate A/R Account Misc. Distributions Select a Credit Card Please select a Credit Card from the list before continuing. Debit Memo cashReceiptItem Cannot Apply You may not apply more than the balance of this item. Cash Receipt Application Doc. Date: Due Date: Doc. Type: Doc. Number: Discount: Open Amount: Amount to Apply: Edit Discount cashReceiptMiscDistrib Select Account You must select an Account to post this Miscellaneous Distribution to. Enter Amount You must enter an amount for this Miscellaneous Distribution. Miscellaneous Cash Receipt Distribution Account: Amount To Distribute: Notes: cashReceiptsEditList Dist. Date Amount Currency Edit... View... Delete... Post... Cash Receipts Edit List Cash Receipts &Close &Print &New &Edit &View &Delete P&ost Number Cust. # Name Check/Doc. # Bank Account Funds Type Check Certified Check Master Card Visa American Express Discover Card Other Credit Card Cash Wire Transfer Other changePoitemQty Change P/O Item Quantity Line Item: Qty. Ordered: New Qty. Received: Current Qty. Balance: Line Item Freight: Post Comment Comment Type: Quantity 0? <p>You have changed the quantity to 0 or less. Are you sure you want to do this? changeWoQty Cannot Reschedule Released W/O Invalid Order Qty &Yes &No Change W/O Quantity Ordered Qty. Ordered: New Qty. Received: Current Qty. Balance: Post Comment Comment Type: <p>The selected Work Order has been Released. Rescheduling it. <p>The new Order Quantity that you have entered does not meet the Order Parameters set for the parent Item Site for this Work Order. In order to meet the Item Site Order Parameters the new Order Quantity must be increased to %1. Do you want to change the Order Quantity for this Work Order to %2? Zero Qty. Value The current value specified is 0. Are you sure you want to continue? characteristic Characteristic Name: Type: Text List Date Order: Include in searches May be used on: Item Options New Delete No Options Description Address Contact CRM Account Opportunity Customer Employee Lot/Serial Incident Input Mask: 00/00/0000 ###-###-#### ###-##-#### 00,000.00 Validator: Missing Name <p>You must name this Characteristic before saving it. Apply Characteristic <p>You must apply this Characteristic to at least one type of application object. Error Option list may not contain duplicates. Value Order This value is in use and can not be deleted. characteristicAssignment Item Characteristic Customer Characteristic No Characteristic Selected No Value Entered You must enter a value before saving this Item Characteristic. You must select a Characteristic before saving this Item Characteristic. Error You can not use the same characteristic for date type characteristics more than once in this context. Incident Characteristic Characteristic: &Value: Contact Characteristic Address Characteristic CRM Account Characteristic Default Opportunity Characteristic Lot Serial Characteristic Employee Characteristic &List Price: Lot/Serial Registration Characteristic characteristicPrice The application has encountered an error and must stop editing this Pricing Schedule. %1 &Close No Characteristic Selected You must select a Characteristic before saving this Item Characteristic. Characteristic Price Characteristic: &Cancel &Save Value: Price: List Price: characteristics Name Description Cannot Delete Characteristic Characteristics: &Close &Print &New &Edit &Delete List Characteristics &View check P/O Voucher Invoice C/M R/A A/P Doc. A/R Doc. Doc. Date Amount Discount Amount (in %1) Check Information Check Number: # Written To: Recipient # Recipient Name Memo: Check Items: For Batch # Recipient Type Bank Account: Close Posted Void Replaced Miscellaneous Expense: Deleted checkForUpdates Check For Updates Your client doesn't match the server. Would you like to upgrade? Your client does not match the server version: %1. Would you like to update? Update There already exists a file called %1 in the current directory. Overwrite? Unable to save the file %1: %2. Downloading %1... Failed: %1 checkFormat Check Format &Name: &Description: &Report: You must enter a valid Name for this Check Format before continuing You must select a Report for this Check Format before continuing A Form has already been defined with the selected Name. You may not create duplicate Forms. Cannot Save Check Format checkFormats Name Description Forms: &Close &New &Edit &Delete List Check Formats classCode You must enter a valid Class Code before continuing Cannot Save Class Code A System Error occurred at %1::%2. Class Code C&lass Code: &Description: classCodes Class Code Description Delete Unused Class Codes Class Codes: &Close &Print &New &Edit &View &Delete Delete &Unused List Class Codes <p>Are you sure that you wish to delete all unused Class Codes? closePurchaseOrder &Close Close Purchase Order &Cancel Close &P/O Number Vendor Agent Order Date First Item Purchase Order: Access Denied You may not close this Purchase Order as it references a Site for which you have not been granted privileges. closeWo Invalid date You must enter a valid transaction date. <p>Work Orders for item sites with the Job cost method are posted when shipping the Sales Order they are associated with. No Production Posted <p>There has not been any Production received from this Work Order. This probably means Production Postings for this Work Order have been overlooked. Unissued Push Items <p>The selected Work Order has Material Requirements that are Push-Issued but have not had any material issued to them. This probably means that required manual material issues have been overlooked. Unissued Pull Items <p>The selected Work Order has Material Requirements that are Pull-Issued but have not had any material issued to them. This probably means that Production was posted for this Work Order through posting Operations. The BOM for this Item should be modified to list Used At selections for each BOM Item. Cannot close Work Order %1 because the Item does not appear to have an Item Type! Please check the Item definition. You may need to reset the Type and save the Item record. Close Work Order &Close Transaction Date: Post &Material Usage Variances Cancel Close W/O Comments <p>Are you sure you want to close this Work Order? Invalid Work Order comment Comment Comment Type: Public &More &Close Cannot Post Comment <p>You must select a Comment Type for this Comment before you may post it. <p>A Stored Procedure failed to run properly.<br>(%1, %2)<br> Error Selecting Comment &Previous &Next commentType Cannot Save Comment Type You must enter a valid Comment Type before saving this Item Type. A System Error occurred at %1::%2. Comment Type &Name: &Description: Editable &Order: &Module: Add-> Add All->> <-Revoke <<-Revoke All commentTypes Name Sys. Description Order Cannot Delete Comment Type The selected Comment Type cannot be deleted because there are Comments that are assigned to it. Comment Types: &Close &New &Edit &Delete List Comment Types companies Number Description View... Edit... Delete... Companies: &Close &New &Edit &View &Delete List Companies company Company Number Number: Description: Cannot Save Company You must enter a valid Number. <p>You must enter a Server if this is an external Company. <p>You must enter a Port if this is an external Company. <p>You must enter a Database if this is an external Company. Duplicate Company Number A Company Number already exists for the one specified. Company Account Mismatch The Retained Earnings Account must belong to this Company. The Currency Gain/Loss Account must belong to this Company. The G/L Discrepancy Account must belong to this Company. The Unrealized Currency Gain/Loss Account must belong to this Company. Change All Accounts? <p>The old Company Number %1 might be used by existing Accounts, including Accounts in the %2 child database. Would you like to change all accounts in the current database that use it to Company Number %3?<p>If you answer 'No' then either Cancel or change the Number back to %4 and Save again. If you answer 'Yes' then change the Company Number in the child database as well. <p>The old Company Number %1 might be used by existing Accounts. Would you like to change all accounts that use it to Company Number %2?<p>If you answer 'No' then either Cancel or change the Number back to %3 and Save again. Accounts Required You will need to return to this window to set required Accounts before you can use Accounts for this company in the system. Versions Incompatible <p>The version of the child database is not the same as the version of the parent database (%1 vs. %2). The data cannot safely be synchronized. Currencies Incompatible <p>The currency of the child database does not appear to match the selected currency for the company (%1 %2 %3 vs. %4 %5 %6). The data may not synchronize properly. Delete Imported Data? Financial history has already been imported for this company. Changing the currency will delete this data. This action is not reversible. Are you sure this is what you want to do? A System Error occurred at %1::%2. No Base Currency <p>The child database does not appear to have a base currency defined. The data cannot safely be synchronized. <p>The parent database does not appear to have a base currency defined. The data cannot safely be synchronized. Test Successful. No Corresponding Company <p>The child database does not appear to have a Company %1 defined. The data cannot safely be synchronized. External Company Server: Port: Database: Test Currency: Unrealized Gain/Loss: Currency Gain/Loss: G/L Series Discrepancy : Retained Earnings: configureCC Cannot Read Configuration Credit Card Configuration Accept Credit Cards Work in Test Mode Verification Service: General Confirm Transaction Server Server Name: Login: Password: Port: Use Proxy Server Service Options YourPay Options: Link Shield: Store Number: Paymentech Options: Division Number: Key File <p>Cannot read encrypted information from database. Error getting Credit Card Processor <p>Internal error finding the right Credit Card Processor. The application saved what it could but you should re-open this window and double-check all of the settings before continuing. Invalid Credit Card Configuration <p>The configuration has been saved but at least one configuration option appears to be invalid:<p>%1<p>Would you like to fix it now? For Authorize.Net please configure CVV and AVS using the Merchant Interface. Transaction Key: Merchant Id: Pre-Authorization Direct Charge Charge Pre-Authorization Credit Enable Transaction on Sales Order Number of days Pre-Authorizations are valid for: Default Bank Accounts: American Express: [ Don't accept this card ] Discover: MasterCard: Visa: Fraud Detection Require Card Verification Value/Code (CVV) Card Verification Do not check Warn if failure Reject if failure Address Verification Service Warn on failed AVS check Reject on failed AVS check Fail CVV Check If: Code does not match CVV was not processed Card has no code Card issuer is not certified Fail AVS check If: Address does not match Address comparison not available ZIP does not match ZIP comparison not available Enabled Reject if Score Exceeds: Digital Certificate (PEM File) Location: Windows: Linux: Mac: In Test Mode, transactions should <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">tooltip</p></body></html> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">whatsthis</p></body></html> Always Fail (Be Declined or Marked as Duplicates) Sometimes Fail Always Succeed If Possible External Processing Options: None General Options Print Receipts configureCRM Incident # Generation: Automatic Next #: Use Projects Automatically create Projects for Sales Orders Account # Generation: Manual Automatic, Allow Override CRM Configuration Show Incident Public checkbox Incidents Public by Default Default Incident Email Delivery Profile: Email Delivery when Incident Created Assigned Status Changed Updated Comments added Incident Status Colors New: Feedback: Confirmed: Assigned: Resolved: Closed: Default Country for Addresses: [ no default ] Enforce Valid Country Names Post Opportunity Changes to the Change Log Query Not Found <p>The application could not find the MetaSQL query crm-strictcountrycheck. Invalid Countries <p>The database contains invalid countries in active records, such as addresses and open sales orders. Please correct these records before turning on strict country checking. You may download and install the fixCountry.gz package to help with this task. <p>The database contains invalid countries in historical records, such as closed sales orders and posted invoices. If you do not correct these countries before turning on strict country checking, you may lose country values if you open these documents and save them again. You may download and install the fixCountry.gz package to help update your records.<p>Are you sure you want to turn on strict country checking? configureEncryption Cannot Read Configuration <p>Cannot read encrypted information from database. Encryption Configuration Key File Name: keyfile.txt <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">whatsthis for a label with a buddy that's an empty text field</p></body></html> Windows Location: Linux Location: Mac Location: Encryption Key location for Credit Card and EFT processing: configureGL Main Segment Size: Use Company Segment Company Segment Size: Use Profit Centers Profit Center Segment Size: Allow Free-Form Profit Centers Main Use Subaccounts Subaccount Segment Size: Allow Free-Form Subaccounts Meaning of Currency Exchange Rates: Base × Exchange Rate = Foreign Foreign × Exchange Rate = Base Default Tax Authority: None Manual Forward Update Trial Balances Transactions Post to Journal Mandatory notes for Manual Journal Entries Assignments Retained Earnings: Currency Gain/Loss: G/L Series Discrepancy : Accounts Payable Enable EFT Check Printing Select an EFT Format ACH ABA Custom .aba Default Suffix ^\d+$ ^(\d{3}-\d{3})|(\d{6}000)$ ^\d{9}$ Routing # Format Formatting Procedure formatAchChecks formatAbaChecks stored procedure name Account # Format ^\d{4,17}$ ^\d{1,9}$ Require Vendor Invoice # on: Regular Vouchers Miscellaneous Vouchers Recurring Voucher Buffer: Accounts Receivable Credit Taxes for Early Payment Discounts Global Interface Control Interface Inventory to General Ledger Interface A/P to General Ledger Interface A/R to General Ledger Hide 'Apply to Balance' button Enable Customer Deposits Remit-To Address Name: Phone: General Ledger Credit Warn Customers when Late Default Grace Period Days: Recurring Invoice Buffer: days Accounting Configuration Enable External Company Consolidation Please enter a default Company Id if you are going to create ACH files. EIN, TIN, and DUNS numbers are all 9 digit numbers. Other characters (except dashes for readability) are not allowed. Company Ids must be 10 characters or shorter (not counting dashes in EIN's, TIN's, and DUNS numbers). Please mark whether the Company Id is an EIN, TIN, DUNS number, or Other. Cannot Save Accounting Configuration Use Profit Centers? You are turning off the use of Profit Centers. This will clear the Profit Centers from your Chart of Accounts. Are you sure you want to do this? Cannot turn off Profit Centers Use Subaccounts? You are turning off the use of Subaccounts. This will clear the Subaccounts from your Chart of Accounts. Are you sure you want to do this? Cannot turn off Subaccounts Cannot turn off Profit Centers and Subaccounts Set Encryption? Your encryption key is not set. You will not be able to configure electronic checking information for Vendors until you configure encryption. Would you like to do this now? Your encryption key is not set. You will not be able to configure electronic checking information for Vendors until the system is configured to perform encryption. Next Accounts Payable Memo #: Next Batch #: 1 Company ID: Company Name: .ach .dat .txt is a(n): Options: EIN/TIN DUNS Number Other Next Receivables Memo #: Next Cash Receipt #: Default Incident Category: Auto Close Incidents when Invoice Paid configureIE Name Document Type System Identifier Import XSLT File Export XSLT File Type Matches Atlas File CSV Map Inconsistent Selection <p>Please choose to add a suffix after errors, move the import file after errors, or uncheck '%1'. Incomplete Data <p>XSLT is not configured. Some XML imports may fail. Would you like to fix this now?</p> <p>Please choose whether to use the internal XSLT processor or an external XSLT processor. Delete Map? Are you sure you want to delete this CSV Atlas Map? Are you sure you want to delete this XSLT Map? New... Edit... Delete Configure Import and Export Map of XSLT import and export filters: New Edit XSLT Processor: XSLT Settings Show file Paths for: Linux Windows Macintosh Default XSLT File Directory Linux Directory: Windows Directory: Macintosh Directory: Use Internal XSLT Processor Use External XSLT Processor. Commands: Linux Processor: Windows Processor: Macintosh Processor: Directories Default Import File Directory Successful Imports: After successful import: Error Handling: After error during import: Note: If this is selected, XML files will always be handled as though they were successfully imported, even though an error file may have been produced. Save failed XML elements to a separate file CSV Atlas Directory Default Export File Directory Import Settings General Import Options CSV Import Options Map of CSV file properties and CSV Atlas files: XML Export configureIM I/M Module Configuration Defaults Event Fence: Days Post Item Site Changes to the Change Log Set default Location while transacting Location-controlled Items When Count Tag Qty. exceeds Slip Qty. Post Difference to Default Location, if any Do Not Post Count Tag Count Slip # Auditing When Posting a Count Tag for Avg. Cost Items Use Standard Cost Use Average Cost Use Actual Cost if no Average Cost Enable Shipping by Customer By default Print and Issue by: Customer Order Disallow Purchase Order Receipt of Qty greater than ordered Warn if Purchase Order Receipt Qty differs from receivable Qty <p>You must have checked Standard Cost, Average Cost or both before saving. Enable As-Of QOH Reporting <p>Enabling As-Of QOH reporting requires some processing to occur for it to work correctly. This may take some time. Would you like to continue? Error Enabing As-Of Reporting Receipt Cost Override Warning Unposted or uninvoiced receipts could be negatively affected if this feature is disabled. Inventory Enable Shipping Interface from Transfer Order screen Post Transfer Order Changes to the Change Log Manual Automatic Automatic, Allow Override Transfer Order # Generation: Next #: Enable Lot/Serial Control Enable As-Of QOH reporting Allow Duplications No Unposted Slip # Duplications in a Site No Unposted Slip # Duplications No Slip # Duplications within a Site No Slip # Duplications Allow Inventory Receipt Cost Override (Average costing method only) Shipping and Receiving Shipment # Generation: Kit Components Inherit COS from Kit Parent By the following amount: % Default Shipping Form Copies: ShippingFormCopies ShippingFormShowPrices ShippingFormWatermark Record Purchase Price Variance on Receipt No Cost selected Post Site Changes to the Change Log Enable Multiple Sites Default Transit Site: Costing Methods Allowed Average Standard Job configureMS M/S Module Configuration Next Planned Order #: Default Calendar: configurePD P/D Module Configuration Post Item Changes to the Change Log Allow Inactive Items to be Added to BOMs Allow deletion of Items from Bill of Material Defaults Set Sold Items as E&xclusive W/O Material &Issue Method: Push Pull Mixed Enable Transforms Enable Revision Control Enabling revision control will create control records for products that contain revision number data. This change can not be undone. Do you wish to proceed? A System Error Occurred at %1::%2. configurePO P/O Module Configuration Order # Generation: Voucher # Generation: Purchase Request # Generation: Manual Automatic Automatic, Allow Override Next #: Options Post Purchase Order Changes to the Change Log Post Vendor Changes to the Change Log Use Earliest Avail. as Due Date for Purchase Order Item Prevent Purchase Order Items when no Std. Cost Exists Check Print Purchase Order on Save by Default Copy Purchase Request notes to Purchase Order Item notes Enable Drop Shipments Select Drop Shipped Orders for Billing on Receipt Require Tax on Purchase Orders POCopies POShowPrices POWatermark Vendor Defaults Default Purchase Order Copies: Ship Via: configureSO S/O Module Configuration Sales Order # Generation: Quote # Generation: Credit Memo # Generation: Invoice # Generation: Automatic, Use Quote #'s Automatic, Use Quote #'s, Allow Override Automatic, Use S/O #'s Automatic, Use C/M #'s Automatic, Use C/M #'s, Allow Override Next #: General Allow Price Discounts Allow ASAP Schedule Dates Hide Misc. Charges on Sales Order screen Enable Shipping interface from Sales Order screen Show Quotes After Converted Invoice Invoice Date Source Shipped Date Scheduled Date Default Invoice Copies: Default Credit Memo Copies: Customer Defaults Shipping Form: Ship Via: Balance Method: Customer Type: Balance Forward Open Item Accepts Partial Shipments Accepts Backorders Allow Free Form Ship-Tos Credit Limit: Credit Rating: Return Auth. # Generation: Automatic, Use R/A #'s Automatic, Use R/A #'s, Allow Override Disallow Override of Sales Price on Sales Order Price Effective Date Current Order Scheduled Update Price Do not Update Price Prompt before Updating Ignore if Discounted Show 'Save and Add to Packing List' button on Sales Order Check 'Select for Billing' option on Ship Order Enable Promise Dates Include Package Weight in Freight Calculation Restrict Credit Memos to Items on their Apply-To Document Print Sales Order on Save by Default Allocate Credit Memos to New Sales Order on Save Pricing Use Wholesale Price as Unit Cost for Markups Use "Long 30" Method for Markups Item Precedence Over Product Category Pricing InvoiceCopies InvoiceShowPrices InvoiceWatermark CreditMemoCopies CreditMemoShowPrices CreditMemoWatermark Sales Rep: Terms: Returns Enable Return Authorizations Post Return Authorization Changes to the Change Log Default Disposition: Credit Return Replace Service Substitute [ no default ] Credit/Ship: Immediately Upon Receipt Default Credit Method: None Credit Memo Check Credit Card Check Print On Save by Default Reserve by Location Disabled <p>All existing location reservations will be removed. Are you sure you want to continue? Enable Sales Reservations Price Control Reserve by Location Lowest Quantity First Highest Quantity First Alpha by Location Name Pricing on Line Item Edits Ship Control Date Control Change Log Post Customer Changes Post Sales Order Changes Credit Control Current Date Firm Sales Orders when added to Packing List Batch Freight Pricing Use calculated Freight values by default configureSearchPath Set Search Path Schemas Not in Order: Schemas in Order: Add -> Add All ->> <-Remove <<-Remove All Move Up Move Down Show all schemas New Search Path: Schema Package Enabled Order Setting Search Path Adding to Search Path Changing Order Getting Excluded Schemas Getting Included Schemas Showing New Search Path Removing Schema configureWO Automatic Manual Automatic, Allow Override W/O Module Configuration Next Work Order #: Post Work Order Changes to the Change Log Date of Explosion Single Level Multiple Level Post Material Usage Variances Inventory Item Cost Defaults Work Order Number Creation: Automatically Explode Work Orders Explode Work Order's Effective as of: Work Order Start Date Default Work Order Explosion Level: Work Order Cost Recognition Defaults To Date Proportional confirmAchOK ACH File OK? Was the EFT file created OK? File Name Yes No contact Contact Cancel Number: General Account #: Owner: Notes Comments Characteristics New Edit Delete Show Orders Documents Characteristic Value Owner <p>You must fill in a contact first or last name as a minimum before saving. Question Saving Address Change This One Change Address for All Used by Number Name Role Active Edit... View... Detach Contact Blank Cannot make Contact inactive <p>You may not mark this Contact as not Active when this person is a Contact for an active CRM Account, Customer, Vendor, or Prospect. Primary Contact Secondary Contact Billing Contact Correspondence Contact CRM Account Customer Vendor Prospect Getting Number Saving Placeholder <p>There was an error creating a new contact (%). Check the database server log for errors. Cleaning up Contact In Use <p>There are multiple Contacts sharing this Address. What would you like to do? Saving Address <p>There was an error saving this Address (%1). Check the database server log for errors. Saving Contact <p>There was an error saving this Contact (%1). Check the database server log for errors. Deleting Characteristic Getting Characteristics Getting Contact Uses Sales Order Opportunity Purchase Order Quote Ship-To Address To-Do Item Vendor Address Vendor Contact Incident Lot/Serial Registration Transfer Order Source Contact Destination Contact Are you sure that you want to remove this Contact as the Primary Contact for this CRM Account? Are you sure that you want to remove this Contact as the Secondary Contact for this CRM Account? Are you sure that you want to remove this Contact as the Billing Contact for this Customer? Are you sure that you want to remove this Contact as the Correspondence Contact for this Customer? Are you sure that you want to remove this Contact as the Primary Contact for this Vendor? Are you sure that you want to remove this Contact as the Secondary Contact for this Vendor? Are you sure that you want to remove this Contact as the Contact for this Prospect? Are you sure that you want to remove this Contact as the Contact for this Ship-To Address? Are you sure that you want to remove this Contact as the Contact for this Vendor Address? Are you sure that you want to remove the link between this Contact and this Sales Order? The name and address will still be kept in the order for future reference. Are you sure you want to remove this Contact as the Contact for this Incident? Are you sure you want to remove this Contact as the Contact for this Lot/Serial Registration? Are you sure you want to remove this Contact as the Contact for this Opportunity? Are you sure you want to remove the link between this Contact and this Purchase Order? The name and address will still be kept in the order for future reference. Are you sure you want to remove the link between this Contact and this Quote? The name and address will still be kept in the quote for future reference. Are you sure you want to remove this Contact as the Contact for this To-Do Item? Are you sure you want to remove the link between this Contact and this Transfer Order? The name and address will still be kept in the order for future reference. Detach Contact? Detaching Uses of the Contact View Employee Are you sure that you want to remove this Contact as the Contact for this Employee? Site Are you sure that you want to remove this Contact as the Contact for this Site? contactEmail Contact Email Addresses New Delete A System Error Occurred at %1::%2. contactMerge Contact Merge Utility Mode: Merge Purge Merge and Purge Restore &Close Contacts Search for: Query Search Through Name Blank Contact Names Phone # Account Number &Inactive Email Account Name Find duplicates with matching criteria: Honorific First Middle Last Suffix Right click for selection options Selections Source Contacts Target Contact Contact# Active Acct.# Acct. Name Hnrfc Initials Phone Alt. Phone Fax Web Title Owner Notes Address1 Address2 Address3 City State Postal Country The delete action cannot be undone. Are you sure you want to proceed? Delete Contact Merg? Set as Source... Set as Target... Deselect... Restore... Purge... Edit... View... Delete CRM Account First Name Middle Initial Last Name Web Address Address Merge to target Deselect The purge action cannot be undone. Are you sure you want to proceed? Purge Contact Merge? contacts List Contacts Show Active Contacts Only Contacts Owner Owner Pattern CRM Account Name Pattern Phone Pattern Email Pattern Street Pattern City Pattern State Pattern Postal Code Pattern Country Pattern First Name Last Name Account # Account Name Title Phone Alternate Fax E-Mail Web Address Address City State Country Postal Code Attach Detach Edit... View... Checking Usage Delete Delete Contact? <p>Are you sure that you want to completely delete the selected contact? Deleting Contact Detach Contact? <p>This Contact is currently attached to a different CRM Account. Are you sure you want to change the CRM Account for this person? Attaching Contact <p>Are you sure you want to detach this Contact from this CRM Account? Error detaching Contact from CRM Account (%1). Detaching Contact Restricted Access You have not been granted privileges to open this Contact. contract Contract Vendor #: Contract #: Description: &Cancel &Save &Notes &Documents Always Effective Never Expires &Close You must select a Vendor before you may save this Contract. The expiration date cannot be earlier than the effective date. You must enter a Contract Number before you may save this Contract. You must enter a Description before you may save this Contract. A Contract already exists for the Vendor, Contract Number you have specified. Cannot Save Contract contracts Contracts Vendor Effective Start Effective End Expires Start Expires End Vendor Number Vendor Name Contract Number Description Effective Expires Item Count Always Never Edit... View... Copy... Delete... Delete Contract Are you sure that you want to delete the selected Contract? Do you want to deactivate the associated Item Sources? copyBOM Dependent BOO Data One or more of the components for this Bill of Materials make reference to a Bill of Operations. These references cannot be copied and must be added manually. Copy Bill of Materials Source Item: Target Item: &Close Co&py copyBudget Name Required Budget Name is a required field. Error Copying Budget There was an error copying the budget. Make sure there are valid periods In the future to match the current periods of the budget being copied plus the period inteval. periods Period Interval: Description: New Budget Name: &Close Co&py Copy Budget copyContract Copy Contract Contract #: Vendor Name: New Contract #: Vendor Phone: Effective: New Effective: Expires: New Expires: You must select an Effective Date before you may copy this Contract. You must select an Expiration Date before you may copy this Contract. The expiration date cannot be earlier than the effective date. You must enter a Contract Number before you may save this Contract. The date range overlaps with another date range. Please check the values of these dates. A Contract already exists for the Vendor, Contract Number you have specified. Cannot Save Contract copyItem Enter Item Number <p>Please enter a Target Item Number. <p>An Item with the item number '%1' already exists. You may not copy over an existing item. <p>Would you like to create new Item Sites for the newly created Item? Item Number Exists Create New Item Sites &Close Copy Item Source Item: &Target Item Number: Copy &Item Costs Copy &Bill of Materials &Cancel Co&py copyPurchaseOrder # Item Description Ordered Price Extended Could Not Copy Purchase Order Copy Purchase Order Purchase Order #: Order Date: Currency: Vendor Phone: Original Line Items: Use Today's Date Schedule Purchase Order for: Use latest Item Sources and Prices Site copySalesOrder # Item Description Ordered Price Extended Copy Sales Order Order Date: Order #: Cust. Name: Cust. Phone: P/O Number: Line Items: Use Source Schedule Dates Reschedule all Schedule Dates to: Site copyTransferOrder # Item Description Ordered Could Not Copy Transfer Order Copy Transfer Order Order #: Order Date: Original Line Items: Use Today's Date Schedule Transfer Order for: correctProductionPosting Cannot Post Correction You may not post a correction to a Work Order for a Item Site with the Job cost method. You must, instead, adjust shipped quantities. &Close Correct Production Posting &Cancel Qty. Ordered: Qty. Received: Transaction &Date: Balance Due: &Qty. to Correct: Backflush &Materials &Return Items not on Pick List Transaction Canceled The Quantity to correct must be less than or equal to the Quantity already Posted. Invalid date You must enter a valid transaction date. Qty. to Disassemble: Qty. Disassembled: &Post costCategories Category Description Delete Cost Category &Delete Cost Category in Use Edit Inventory Cost Cateogry... View Inventory Cost Category... Delete Inventory Cost Category... List Items in this Inventory Cost Category... Cost Categories: &Close &Print &New &Edit &View Co&py List Cost Categories <p>Are you sure that you want to delete the selected Cost Category? <p>The selected Cost Category cannot be deleted as it still contains Items. You must reassign these Items before deleting this Cost Category. costCategory Cost Category Category: Description: Expense: Shipping Asset: Inventory Scrap: WIP Asset: Transform Clearing: Inventory Asset: Purchase Price Variance: Inventory Adjustment: Manufacturing Scrap: Inventory Cost Variance: P/O Liability Clearing: Line Item Freight Expense: Transfer Order Liability Clearing: <p>You must enter a name for this Cost Category before saving it. <p>You must select an Inventory Asset Account before saving. <p>You must select an Expense Asset Account before saving. <p>You must select a WIP Asset Account before saving. <p>You must select an Inventory Cost Variance Account before saving. <p>You must select a Transform Clearing Account before saving. <p>You must select a Purchase Price Variance Account before saving. <p>You must select an Inventory Adjustment Account before saving. <p>You must select an Inventory Scrap Account before saving. <p>You must select a Manufacturing Scrap Account before saving. <p>You must select a P/O Liability Clearing Account before saving. <p>You must select a Shipping Asset Account before saving. <p>You must select a Line Item Freight Expense Account before saving. <p>You must select a Transfer Order Liability Clearing Account before saving. <p>The Name you have entered for this Cost Category is already in use. Cannot Save Cost Category costingElements Costing Element Cannot Delete Selected User Costing Element User Costing Elements: &Close &New &Edit &Delete List User-Defined Costing Elements <p>The selected User Costing Element cannot be deleted as it is being used by an existing Item Cost. You must first delete all Item Costs assigned to the selected User Costing Element before you may delete it. <p>The selected User Costing Element cannot be deleted as it is there is Costing History assigned to it. You may only deactivate the selected User Costing Element. countSlip &Close &Post You must enter a Count Slip # for this Count Slip. You must enter a counted quantity for this Count Slip. A Count Slip has already been entered with this Serial #. Please verify the Serial # of the Count Slip you are entering. This Serial # exists in a different Location. Please verify the Serial # of the Count Slip you are entering. Count Slip Count &Tag #: ... &Cancel &Save Counted Qty. TD: Slip #: Slip &Qty: Location: Lot/Serial #: Co&mments: Lot Expiration: Warranty Expiration: Site: An unposted Count Slip for this Site has already been entered with this #. The I/M Module has been configured to disallow the duplication of unposted Count Slip #s within a given Site. Please verify the # of the Count Slip you are entering. An unposted Count Slip has already been entered with this #. The I/M Module has been configured to disallow the duplication of unposted Count Slip #s. Please verify the # of the Count Slip you are entering. An Count Slip for this Site has already been entered with this #. The I/M Module has been configured to disallow the duplication of Count Slip #s within a given Site. Please verify the # of the Count Slip you are entering. An Count Slip has already been entered with this #. The I/M Module has been configured to disallow the duplication of Count Slip #s. Please verify the # of the Count Slip you are entering. Cannot Save Count Slip countTag &Post Count &Close Cannot Post Count Tag There are unposted Count Slips for this Count Tag. You must either post or delete unposted Count Slips for this Count Tag before you may post this Tag. Either total quantity indicated by posted Count Slips for this Count Tag is less than the quantity entered for this Count Tag or there are no Count Slips posted to this Count Tag. The Item Site in question does not have a default Location into which the remaining quantity may be distributed. Please verify the Count Tag quantity and attempt to post this Count Tag again. Either total quantity indicated by posted Count Slips for this Count Tag is less than the quantity entered for this Count Tag or there are no Count Slips posted to this Count Tag. This database has been configured to disallow default Count Tag posting into the default Location for an Item Site. Please verify the Count Tag quantity and attempt to post this Count Tag again. An unknown error occurred while posting this Count Tag. Please contact your Systems Administrator and report this issue. N/A Count Tag Count &Tag #: ... &Cancel &Save Count &Qty.: Thaw Inventory Only for Specific Location: Current Comments: New Co&mments: This Item Site is Lot/Serial # controlled, which means the Count Tag Qty. must match the Qty. of Count Slips posted to it. Please verify the Count Tag Qty. and attempt to post again. Site: The total quantity indicated by posted Count Slips for this Count Tag is greater than the quantity entered for this Count Tag. Please verify the Count Tag quantity and attempt to post this Count Tag again. countTagList Tag # Item Number Description Count Tag List S&earch for: &Cancel &Select Count Tags: Site countries Abbreviation Name Currency Abbr Currency Name Symbol Confirm Delete <p>This is a master table used for selecting country names for Addresses and default currency symbols for the Currency window. Are you sure you want to delete this country and its associated information? Countries: &Close &New &Edit &View &Delete List Countries country Country name is required. Country abbreviation is required. Country abbreviation must be 2 characters long. Currency abbreviations must be 3 characters long. Currency numbers must be 3 digits long. Cannot save Country Country Country Abbreviation: Currency Symbol: Currency Name: Country Name: Currency Abbreviation: Currency Number: createCountTagsByItem &Close Create &Tag Mark Created Count Tag as Priority Free&ze Inventory Only for Specified Location: Comments: Create Count Tag by Item/Site Site: No Count Tags Created No Count Tags were created. Likely causes are the Item Site has Control Method: None or the Item is not a countable Type. Error Creating Count Tags createCountTagsByParameterList No Count Tags Created &Cancel Create &Tags Options Mark Created Count Tag as Priority Freeze Inventory Ignore Zero Balance Item Sites Only for Specified Location Notes Create Count Tags by Class Code Create Count Tags by Planner Code <p>No Count Tags were created. Either no Item Sites matched the criteria, the matching Item Sites all have Control Method: None, or the Items are not countable Items. Create Count Tags by Parameter List/Site Site: createCycleCountTags Mark Created Count Tag as &Priority &Freeze Inventory Ignore Zero Balance Item Sites Ma&ximum Number of Tags to Create: &Cancel Create &Tags Item Sites in Class Code Planner Code Only for Specified Location Notes Create Cycle Count Tags Options &Site: createInvoices Create Invoices Consolidate By Customer &Cancel &Create Invoices createItemSitesByClassCode Cannot Create Item Sites Create Item Sites by Class Code &Cancel C&reate &Reorder Level: Order &Up To: Order &Multiple: Days Safety Stock: ABC Class: Site can Purchase this item Create Purchase Requests for Sales Orders Create Purchase Orders linked to Sales Orders Drop ship items by default Create Purchase Requests for Work Order requirements Allow automatic ABC updates Cycl. Cnt. Fre&q.: Over-ride Work Order Cost Default To Date Proportional Location Disallow Blank WIP Locations Planning Enforce Order Parameters Scheduling Planning System: Group MRP Orders Every: First Group &Lead Time: Requires Warranty when Purchased Auto Register Lot/Serial at Shipping Event &Fence: A B C &Planner Code: Ranking: C&ontrol Method: Automatic Lot/Serial Numbering Sequence #: Enforce on Manual Orders Create Planned Transfer Orders Supplied from Site: Expiration Perishable Multiple Location Control Sold from this site Site can manufacture this Item Create Work Orders linked to Sales Orders Inventory Use Default Location Location: User-Defined: Location Comment: Cost Cate&gory: MPS Time Fence: Stocked Cannot Save Item Site <p>You must set a reorder level for a stocked item before you may save it. Select a Site <p>You must select a Site for this Item Site before creating it. <p>You must select a Cost Category for these Item Sites before you may create them. <p>You must select a Planner Code for these Item Sites before you may create them. <p>You must select a Control Method for these Item Sites before you may create them. <p>You must select a Cost Method for this Item Site before you may save it. You must first create at least one valid Location for this Site before items may be multiply located. &Site: Minimum Order: Maximum Order: Costing Method None Average Standard createLotSerial Enter Quantity Enter Expiration Date Item is Non-Fractional Create Lot/Serial # &OK Lot/Serial #: Expiration Date: &Cancel Enter Lot/Serial Number <p>You must enter a Lot/Serial number. Lot/Serial Number Contains Spaces <p>The Lot/Serial Number contains spaces. Do you want to save it anyway? <p>You must enter a positive value to assign to this Lot/Serial number. <p>You must enter an expiration date to this Perishable Lot/Serial number. <p>The Item in question is not stored in fractional quantities. You must enter a whole value to assign to this Lot/Serial number. Invalid Number <p>The number entered is not valid. Please select from the list of valid numbers. Duplicate Serial Number This Serial Number has already been used and cannot be reused. Enter Warranty Expire Date <p>You must enter a warranty expiration date for this Lot/Serial number. Invalid Qty <p>The quantity being assigned is greater than the quantity preassigned to the order being received. Use Existing? <p>A record with for lot number %1 for this item already exists. Reference existing lot? Qty. Remaining: Qty To Assign: Warranty Date: createPlannedOrdersByItem Enter Cut Off Date You must enter a valid Cut Off Date before creating Planned Orders. &Close Run MRP by Item &Cancel C&reate &Delete Existing Firmed MRP Orders Cut&off Date: &Explode Children &Site: createPlannedOrdersByPlannerCode Site: %1 Item: %2 - %3 Enter Cut Off Date You must enter a valid Cut Off Date before creating Planned Orders. Run MRP by Planner Code Cutoff Date: &Delete Existing Firmed MRP Orders createRecurringInvoices Create Recurring Invoices &Cancel Create Recurring Invoices within the defined buffer period for all Customers. &Create createRecurringItems Processing Errors <p>%n error(s) occurred during processing:<ul><li>%1</li></ul> Processing Complete <p>%n record(s) were created. Create Recurring Items Create Recurring Items: &Cancel &Create &Schedule Incidents To-Do Items Projects Invoices Vouchers creditCard &Close The name of the card holder must be entered The city must be entered The state must be entered The zip code must be entered The country must be entered Valid Expiration Months are 01 through 12 Valid Expiration Years are CCYY in format Valid Expiration Years are 1970 through 2100 Invalid Credit Card Number Credit Card Customer #: &Cancel &Save Expiration Year: Active Credit Card Type: Credit Card Number: &Name: Master Card Visa American Express Discover Expiration Month: The first address line must be entered The Expiration Month must be entered Cannot Save Credit Card Information Third Address Line Ignored Invalid Credit Card Information The credit card number must be all numeric and must be 13, 15 or 16 characters in length <p>The third line of the street address will not be saved as part of the credit card address. The xTuple credit card interface supports only 2 lines of street address.</p><p>Continue processing? creditMemo # Item Description Returned Credited Price Extended &View No Misc. Charge Account Number Posted Unposted Credit Memo &Save &Close Header Information Memo #: Memo Date: Status: Apply To: ... Sales Rep.: Commission: % Copy to Ship-to -> Cust. PO #: &Place on Hold Tax Zone: Reason Code: Project: Sale Type: Shipping Zone: Bill To Name: Ship From Ship From# Line Items Currency: Misc. Charge Description: Misc. Charge Credit Account: Subtotal: Tax: Misc. Charge: &New &Edit &Delete Freight: Total: Notes Select a Customer Please select a Customer before continuing. <p>You may not enter a Misc. Charge without indicating the G/L Sales Account number for the charge. Please set the Misc. Charge amount to 0 or select a Misc. Charge Sales Account. Total Less than Zero <p>The Total must be a positive value. <p>This Credit Memo has been Posted and this cannot be modified. <p>Are you sure that you want to delete the current Line Item? None Qty UOM Price UOM Site Invalid Memo # Entered <p>You must enter a valid Memo # for this Credit Memo before you may save it. <p>The Memo # is already in use. You must enter an unused Memo # for this Credit Memo before you may save it. creditMemoEditList Document # Order # Cust./Item # Name/Description UOM Qty. to Bill Price Ext. Price Currency Edit Credit Memo... Edit Credit Memo Item... Not Assigned Taxes Debit Credit Credit Memo Edit List &Close &Print Billing List: Access Denied You may not view or edit this Credit Memo as it references a Site for which you have not been granted privileges. creditMemoItem &Close Invalid Credit Quantity N/A In %1: Credit Memo Item Line #: &Cancel &Save Qty. Shipped: Qty. &Returned: &Qty. To Credit: Net Unit Price: Extended Price: Pricing UOM: List Price: Sale Price: Discount % from Sale: Reason Code: <p>You have not selected a quantity of the selected item to credit. If you wish to return a quantity to stock but not issue a Credit Memo then you should enter a Return to Stock transaction from the I/M module. Otherwise, you must enter a quantity to credit. ... Tax Type: None Tax: Qty. UOM: Memo #: Recv. &Site: Update Inventory Detail Costs Unit Cost: List Discount % Tax Notes crmaccount Account Name: Account Number: Active Type Organization Individual Partner Competitor Close Save Roles Sales Rep... Employee... User... Parent: Owner: Notes Comments Characteristics New Edit Delete Contacts Characteristic Value Error detaching Contact from CRM Account. Error detaching Contact from CRM Account Error deleting a child record Error deleting the initial CRM Account record Error looking for duplicate CRM Account Number The %1 relationship is selected but no appropriate data have been created. Either click the %2 button to enter the data or unselect the check box. This CRM Account Number is already in use by an existing CRM Account. Please choose a different number and save again. You must enter a number for this CRM Account before saving it. You must enter a name for this CRM Account before saving it. This CRM Account cannot be a parent to itself. This CRM Account is a Prospect but it is marked as a Customer. Either mark it as a Prospect or click %1 to convert it before saving. Customer Employee This CRM Account is a Customer but it is marked as a Prospect. Either mark it as a Customer or click %1 to convert it before saving. Prospect Sales Rep Tax Authority Vendor Cannot Save CRM Account Tax Auth Delete %1? <p>Are you sure you want to delete %1 as a %2? Database Error Error deleting %1 Error saving CRM Account Error deleting Characteristic Assignment Error getting Characteristic Assignments Error reading the CRM Account Error creating Prospect Error collecting Lot/Serial data Error deleting Lot/Serial data Error deleting temporary CRM Account Edit... View... Description User CRM Account Error creating Initial Account Close without saving? <p>Are you sure you want to close this window without saving the new CRM Account? Convert <p>Are you sure you want to convert this Prospect to a Customer? <p>Do you want to convert all of the Quotes for the Prospect to Sales Orders? Convert Error <p>Are you sure you want to convert this Customer to a Prospect and delete its Customer information? Primary Secondary All Lot/Serial Item Qty Sold Registered Expires Prospect... Customer... Workbench... Vendor... Tax Authority... Activities Registrations &New &Edit &Delete Account Documents crmaccountMerge Merge CRM Accounts Close crmaccountMergePickAccountsPage WizardPage Select the CRM Accounts to Merge Select the CRM Accounts you want to merge together from the list below. Then, at the bottom of the screen, choose which of those Accounts they should be merged into. Accounts to Merge: Destination Account: [ Keep this CRM Account ] Query crmaccountMergePickDataPage WizardPage Pick the Details to Add to the Target Double-click in the table below to indicate what you want in the final merged CRM Account. Alternatively, click once on values in the table then click Select or Deselect to record your choices. Continue when there is one value highlighted in each column. You can select more than one Notes. You may choose either one Customer or one Prospect, but not one of each. Source CRM Accounts: Select Deselect [ Selected values are in this color ] crmaccountMergePickTaskPage WizardPage Pick a Task This Wizard guides you through the steps of merging CRM Accounts. You can close at any time. The work in progress will be saved for you to come back to later. Start a new merge Continue an existing merge Revert a completed merge Purge old records crmaccountMergePurgePage WizardPage Purge Completed Merges The following CRM Accounts have been merged. Pick a parent account and click Purge Selected to remove the obsolete CRM Accounts and merge data. You should do this as soon as you have confirmed that the merge was successful. Purge Purge All Completed Merges: crmaccountMergeResultPage WizardPage Result of Merge To keep this merge result, make sure Keep is selected below and click the Continue or Next Page button. To undo the merge, make sure the Undo button is selected and click Next Page or Continue. Result of CRM Account Merge: Source CRM Accounts: Keep Undo crmaccounts Delete Number Accounts Owner Owner Pattern Show Inactive Account Number Pattern Account Name Pattern Contact Name Pattern Phone Pattern Email Pattern Street Pattern City Pattern State Pattern Postal Code Pattern Country Pattern Name First Last Phone Email Address City State Country Postal Code Customer Prospect Vendor Competitor Partner User Employee Sales Rep Delete? Are you sure you want to delete this CRM Account? Error deleting CRM Account Edit... View... Tax Auth. currencies Base Name Symbol Abbreviation Additional Configuration Required <p>Your system is configured to use multiple Currencies, but the Currency Gain/Loss Account and/or the G/L Series Discrepancy Account does not appear to be configured correctly. You should define these Accounts in 'System | Configure Modules | Configure G/L...' before posting any transactions in the system. View... Edit... Delete... Cannot delete base currency You cannot delete the base currency. Currencies: &Close &New &Edit &View &Delete List Currencies currenciesDialog Please select a base currency for this database. currency Name Required Currency name is required. Symbol or Abbreviation Required Either the currency symbol or abbreviation must be supplied. (Both would be better.) Abbreviation Too Long The currency abbreviation must have 3 or fewer characters. ISO abbreviations are exactly 3 characters long. Set Base Currency? You cannot change the base currency after it is set. Are you sure you want %1 to be the base currency? Currency Name: Symbol: Abbreviation: Base Currency Select currencyConversion Missing Currency Please specify a currency for this exchange rate. Missing Start Date Please specify a Start Date for this exchange rate. Missing End Date Please specify an End Date for this exchange rate. Invalid Date Order The Start Date for this exchange rate is later than the End Date. Please check the values of these dates. Invalid Date Range The date range overlaps with another date range. Please check the values of these dates. A System Error occurred at %1::%2. Currency Exchange Rate Exchange Rate: Currency: No Rate Specified You must specify a Rate that is not zero. currencyConversions Currency Exchange Rate Effective Expires Earliest Latest Base x Exchange Rate = Foreign Foreign x Exchange Rate = Base No Exchange Rate Direction Defined No Foreign Currencies Defined A System Error occurred at %1::%2. Edit... View... Delete... Base Currency: NONE DEFINED Foreign Currencies: &Close Query &Print &New &Edit &View &Delete New Currency List Currency Exchange Rates <p>No selection has yet been made for whether exchange rates convert from the base currency to foreign currencies or from foreign to base. Go to System | Configure Modules | Configure G/L and make your selection. <p>There is only a base currency defined. You must add more currencies before you can create an exchange rate. Click the NEW CURRENCY button to add another currency. currencySelect Currency Selection Country: Currency Name: Symbol: Abbreviation: &Cancel &Select customCommand Order Argument Cannot Save You must enter in a Menu Label for this command. You must enter in a program to execute. Priv Name may not contain spaces. Custom Command Priv. Name: Menu Label: Module: A/P A/R C/P G/L I/M M/S P/D P/M P/O S/A S/O S/R W/O Sys Executable: &Cancel &OK Description Arguments New Edit Delete CRM Action Name: &Close customCommandArgument No Argument Specified You must specify an argument in order to save. Custom Command Argument Order: Argument: &Cancel &OK customCommands Module Menu Label Commands &Close &New &Edit &Delete List Custom Commands Package customer Balance Forward Open Items Default Number Name Address City, State, Zip Sequence Type Active Characteristic Value <p>The newly entered Customer Number cannot be used as it is currently in use by the Customer '%1'. Please correct or enter a new Customer Number. Cannot Save Customer Error Saving Saving Characteristic Convert Error Checking Number Deleting Ship To Deleting Characteristic Getting Characteristics Getting Ship Tos Deleting Tax Registrations Getting Tax Registrations Getting Commission Getting Customer Expiring Credit Card Getting Credit Cards Getting CRM Account Customer Saved The customer record was automatically saved to the database. The committed changeswill not be cancelled. Getting new id You must enter a number for this Customer before continuing You must select a Customer Type code for this Customer before continuing. You must select a Terms code for this Customer before continuing. You must select a Sales Rep. for this Customer before continuing. Are you sure that you want to delete this Ship To? Delete Ship To? User Edit... View... Delete... CRM Account MasterCard VISA American Express Discover Other Customer Customer #: Customer Type: Customer Name: &Active &Cancel &Save General Terms Sales Rep: Commission: % Ship Via: Shipping Form: Shipping Charges: Accepts Backorders Accepts Partial Shipments Allow Free-Form Ship-Tos Allow Free-Form Bill-To Balance Method: Credit Rating: Activities Credit Limit: In Good Standing On Credit Warning On Credit Hold Uses Purchase Orders Uses Blanket P/O's Addresses CRM Account... &Print Print &New &Edit &View &Delete CRM Contacts Sales Summary Quotes Orders Returns First Sales Date: Last Sales Date: Backlog: Last Year Sales: Year To Date Sales: Open Balance: Late Balance: Accounting Receivables Cash Receipts Documents Remarks Notes Characteristics Comments Credit Cards New Edit View Default Tax Zone: Move Up Move Down Tax Authority Registration # Tax Tax Registration Numbers: Delete Convert <p>Do you want to convert all of the Quotes for the Prospect to Sales Orders? Customer Exists <p>This number is currently used by an existing Customer. Do you want to edit that Customer? <p>This number is currently assigned to a Prospect. Do you want to convert the Prospect to a Customer? <p>This number is currently assigned to CRM Account. Do you want to convert the CRM Account to a Customer? Place on Credit Warning when Credit Limit/Grace Days is Exceeded Alternate Late Grace Days Grace Days: You must enter a name for this Customer before continuing Invalid Number <p>This number is currently assigned to another CRM account. Preferred Selling Site: Settings Terms: Discount: Currency: Place open Sales Orders on Credit Hold when Credit Limit is Exceeded Billing Contact Correspondence Contact Ship To customerFormAssignment Default Customer Form Assignment Selected Customer Type: Customer Type Pattern: Invoice Form: Credit Memo Form: Statement Form: Quote Form: Packing List Form: Sales Order Pick List Form: Duplicate Entry The Customer Type specified is already in the database. customerFormAssignments Customer Type Invoice Credit Memo Statement Quote Packing List Default Customer Form Assignments: &Close &New &View &Edit &Delete S/O Pick List List Customer Form Assignments customerGroup Number Name &Close Cannot Save Customer Group You cannot have an empty name. You cannot have a duplicate name. Customer Group Name: Description: &Save Member Customers: &New &Delete customerGroups Name Description Customer Groups: &Close &New &Edit &View &Delete List Customer Groups customerType Invalid Customer Type Code You must enter a valid Code for this Customer Type before creating it. Cannot Save Customer Type You have entered a duplicate Code for this Customer Type. Please select a different Code before saving. A System Error occurred at %1::%2. Customer Type C&ode: &Description: Characteristic Value Default Enable Characteristics Profile &New &Edit &Delete customerTypeList Code Description Customer Types Customer Types: &Cancel Clea&r &Select customerTypes Code Description Customer Types: &Close &Print &New &Edit &Delete List Customer Types customers Type Number Customers Show Inactive Customer Number Pattern Customer Name Pattern Customer Type Pattern Contact Name Pattern Phone Pattern Email Pattern Street Pattern City Pattern State Pattern Postal Code Pattern Country Pattern Sales Rep. Active Name Bill First Bill Last Bill Title Bill Phone Bill Fax Bill Email Bill Addr. 1 Bill Addr. 2 Bill Addr. 3 Bill City Bill State Bill Country Bill Postal Corr. First Corr. Last Corr. Phone Corr. Fax Corr. Email Corr. Addr. 1 Corr. Addr. 2 Corr. Addr. 3 Corr. City Corr. State Corr. Postal Corr. Country Setting Customer Type Delete Customer? <p>Are you sure that you want to completely delete the selected Customer? Error Deleting databaseInformation Database Information Server Address: Database Name: Database Version: Database &Description: Active Users Only Admin Users Only (Maintenance Mode) Any Users not Inactive Access Mode: C&omments: Number of Database Users: Number of Server Users: Number of Server Licenses: Open Disable Auto Completer List Do not allow user logins that exceed licensed user count. Application: Patch: Auto Update Signal &Interval: minutes Disallow mismatched client versions Unknown deletePlannedOrder &Close Delete Planned Order Cancel &Delete Delete &Child Orders deletePlannedOrdersByPlannerCode Enter Cut Off Date Delete Planned Orders by Planner Code Cutoff Date: Delete Firmed Orders Delete Child Orders &Cancel &Delete Planning System MPS and MRP MPS MRP You must enter a cut off date for the Planned Orders to be deleted. Select Planning System You must select which Planning System(s) to delete from. department Cannot Save Department You must enter a Department Number You must enter a Department Name The Number you entered already exists. Please choose a different Number. A System Error occurred at %1::%2 %3 Department Department Number: Department Name: departments Dept. Number Dept. Name A System Error occurred at %1::%2 %3 Edit View Delete Departments: Close Print New List Departments dictionaries Dictionaries Check for available spell check dictionaries? Start Could not save one or more files. Dictionaries downloaded. Could not read archive format. Could not uncompress file. Could not save file. No dictionary is currently available. Could not retrieve dictionaries at this time. Downloading... Cancel display display Search: Results Query on start Automatically Update Query Close Print Preview More New Error Parsing Report There was an error Parsing the report definition. %1 %2 Report Not Found The report %1 does not exist. Start Date End Date Search On: search displayTimePhased Time-Phased Report Calendar: Calendar Required You must select a Calendar Periods Required You must select at least one Calendar Period distributeInventory Location Default Netable Lot/Serial # Expiration Qty. Before Tagged Qty. Qty. After Cannot Perform Partial Distribution Distribute to Default It appears you are trying to distribute more than is available to be distributed. <p>Are you sure you want to distribute this quantity? There was an error distributing to default location. Yes No N/A Undefined Location Default: Site: Lot/Serial #: Order #: Qty. to Distribute: Qty. Tagged: Qty. Remaining: Only Show &Locations with Qty &Tagged Lines &Valid Locations: Distri&bute Lot/Serial &Number: F&ind &Post &Default De&fault and Post <p>You must completely distribute the quantity before selecting the 'Post' button. No Bar Code scanned <p>Cannot search for Items by Bar Code without a Bar Code. No Match Found <p>No available lines match the specified Barcode. Qty. Inventory Distribution There was an error posting the transaction. Contact your administrator &Cancel Distribute Stock To/From Site Locations distributeToLocation Cannot Distribute Quantity You must not distribute a quantity to this Location that is greater than the total quantity to distribute. You may not distribute a quantity to this Location that is greater than the total quantity to distribute. You may not distribute a negative value when the balance to distribute is positive. You may not distribute a positive value when the balance to distribute is negative. Distribute to Location Qty. to Distribute: Qty. Tagged: Qty. Balance: Location: Qty. to this Location: &Cancel &Distribute Distribute More Than Available? <p>It appears you are trying to distribute more than is available to be distributed. Are you sure you want to distribute this quantity? docAttach Attach a Document Incident Customer Purchase Order Sales Order Vendor Item Related to Parent of Child of Duplicate of [Select] Contact CRM Account Employee File Opportunity Project Name: ... Save to Database Purchase Order #: Sales Order #: Vendor #: URL: http: Image Document Incident: CRM Account: Web Site Work Order No Selection Employee: File: Opportunity: Project: Image: Edit Attachment Link Must Specify file You must specify a file before you may save. Must Specify valid path You must specify a path before you may save. File Error File %1 was not found and will not be saved. Could not open source file %1 for read. File Open Error Invalid Selection You may not attach a document to itself. Select File documents Form &New &Attach &Edit &Detach &View dspAPApplications Accounts Payable Applications Earliest Latest Vend. # Vendor Post Date Source Doc # Apply-To Amount Currency Amount (in %1) Check Look-Up Failed Found multiple checks with this check number. Could not find the record for this check. View Source Credit Memo... View Source Check... View Apply-To Debit Memo... View Apply-To Voucher... Select Vendor You must select the Vendor(s) whose A/R Applications you wish to view. Enter Start Date You must enter a valid Start Date. Enter End Date You must enter a valid End Date. Select Document Type You must indicate which Document Type(s) you wish to view. Credit Debit Check Voucher A/P Applications Show Checks Show Credit Memos dspAPOpenItemsByVendor Payables Earliest Latest Doc. Type Doc. # Vendor# Name P/O # Invoice # Doc. Date Due Date Amount Paid Balance Currency Status ????? Balance (in %1) Edit... View... On Hold Open Voucher Can not change Status You cannot set this item as On Hold. This Item is already selected for payment. Open Payables Document Date Distribution Date As of Date: Base Balance Credit Memo Debit Memo dspARApplications Earliest Latest Cust. # Customer Source Doc Type Source Apply-To Doc Type Apply-To Amount Select Customer You must select a Customer whose A/R Applications you wish to view. Enter Start Date You must enter a valid Start Date. Enter End Date You must enter a valid End Date. Select Document Type You must indicate which Document Type(s) you wish to view. Invoice Check Cert. Check M/C Visa AmEx Discover Other C/C Cash Wire Trans. Other A/R Applications All Customers Selected Customer: Selected Customer Type: Customer Type Pattern: Show Cash Receipts Show Credit Memos Doc # Credit Memo Not Found <p>The Credit Memo #%1 could not be found. View Source Credit Memo... View Apply-To Debit Memo... View Apply-To Invoice... Cash Deposit A/P Check Post Date Dist. Date Currency Base Amount C/M D/M C/R dspAROpenItems Earliest Latest Balance (in %1) Doc. Type Posted Recurring Open Doc. # Cust./Assign To Order/Incident Doc. Date Due Date Amount Paid Balance Invoice Open Receivables Date Range Document Due Show Debits Only Items with Incidents Credits Unposted Both Closed Print List Statement As of Date: Receivables View Invoice... Currency Name/Desc. New Incident... Edit Incident... View Incident... Credit Memo Amount (in %1) Paid (in %1) Credit Card Notes Misc. Debit Memo Misc. Credit Memo Print... Edit Invoice... Edit Credit Memo... Edit Receivable Item... View Receivable Item... Void Posted Invoice... Edit Posted Invoice... View Invoice Information... Void Posted Credit Memo... View Credit Memo... Post... Delete... Apply Credit Memo... Edit Sales Order... View Sales Order... Shipment Status... Shipments... New Cash Receipt... Refund Cannot Refund by Credit Card <p>The application cannot refund this transaction using a credit card. Credit Card Processing Error Could not find a Credit Card to use for this Credit transaction. Credit Card Processing Warning Credit Card Processing Note Delete Selected Credit Memos? <p>Are you sure that you want to delete the selected Credit Memos? Could not delete Credit Memo. Error deleting Credit Memo %1 Delete Selected Invoices <p>Are you sure that you want to delete the selected Invoices? Delete Cancel Error deleting Invoice %1 Void Posted Credit Memo? <p>This Credit Memo has already been posted. Are you sure you want to void it? Void Credit Memo A System Error occurred voiding Credit Memo. %1 Edit Posted Invoice? <p>This Invoice has already been posted. Are you sure you want to edit it? Void Posted Invoice? <p>This Invoice has already been posted. Are you sure you want to void it? Void Invoice A System Error occurred voiding Invoice. %1 Debit Memo Customer Deposit Deposit Credit Memo Date Post Credit Memo Transaction Canceled Could not post Credit Memo #%1 because of a missing exchange rate. A System Error occurred posting Credit Memo#%1. %2 Invoice Date Invoice Has Value 0 Invoice #%1 has a total value of 0. Would you like to post it anyway? System Error posting Invoice #%1 %2 Could not post Invoice #%1 because of a missing exchange rate. Post Invoice Could not post Invoice #%1 into a closed period. A System Error occurred posting Invoice #%1. %2 Access Denied You may not view or edit this Invoice as it references a Site for which you have not been granted privileges. You may not view or edit this Credit Memo as it references a Site for which you have not been granted privileges. You may not view or edit this Sales Order as it references a Site for which you have not been granted privileges. dspAllocations Type Order # Parent Item Total Qty. Relieved Balance Running Bal. Required View Work Order... View Sales Order... Edit Sales Order... Item Allocations Show Availability as of: Item Site Lead Time Look Ahead Days: Date: Date Range: to View Transfer Order... Edit Transfer Order... Site: dspBOMBase Bill of Materials Show &Expired Components Threshold Days: Show &Future Components Bill Of Materials Invalid Item You must specify a valid item. Always Never Edit... View... dspBacklog Backlog Start Order Date End Order Date Start Schedule Date End Schedule Date Customer Customer Group Customer Group Pattern Customer Type Customer Type Pattern Customer Ship-To Item Product Category Product Category Pattern Sales Order Sales Rep. Site S/O #/Line # Customer/Item Number Order Ship/Sched. UOM Ordered Shipped Balance Ext. Price Firm Edit Order... View Order... Edit Item... View Item... Print Packing List... Add to Packing List Batch dspBankrecHistory Date Doc Number/Notes Amount Opening Balance Checks Deposits Adjustments Reconciled Unreconciled Closing Balance Bank Reconciliation History Bank Account: Date Range: Show unreconciled as of posting N/A Reconciled: Unreconciled: Posted By: Query Date Posted: &Close &Print dspBillingSelections Order # Cust. # Name Payment Rec'd Cannot Create one or more Invoices The G/L Account Assignments for the selected Invoice are not configured correctly. Because of this, G/L Transactions cannot be created for this Invoices. You must contact your Systems Administrator to have this corrected before you may Create this Invoice. A System Error occurred at %1::%2, Error #%3. Cancel Billing Are you sure that you want to cancel billing for the selected order? &Yes &No Billing Selections &Close &Print Billing List: Create &All Create &Invoice &New &Edit &Cancel Subtotal Misc. Freight Tax Total dspBookings Bookings Start Date End Date Customer Customer Ship-to Customer Group Customer Group Pattern Customer Type Customer Type Pattern Item Product Category Product Category Pattern Sales Rep. Site Order # Line # Ord. Date Cust. # Item Number Description Ordered Unit Price Ext. Price Currency Base Unit Price Base Ext. Price View Sales Order... Edit Sales Order... View Sales Order Item... Edit Sales Order Item... dspBriefEarnedCommissions Earned Commissions # Sales Rep. Cust. # Customer S/O # Invoice # Invc. Date Ext. Price Commission Enter Start Date Please enter a valid Start Date. Enter End Date Please enter a valid End Date. Brief Earned Commissions All Sales Reps. Selected Sales Rep. Include Misc. Charges and Items Currency Base Ext. Price Base Commission dspBriefSalesHistory Brief Sales History Start Date End Date Customer Customer Ship-to Customer Group Customer Group Pattern Customer Type Customer Type Pattern Item Product Category Product Category Pattern Sales Rep. Site Cust. # Name Cust. Type Doc. # Invoice # Ord. Date Invc. Date Total View Sales Detail... dspCapacityUOMsByClassCode Class Code Item Number Description Inv. UOM Cap. UOM Cap./Inv. Rat. Alt. UOM Alt/Inv Ratio Capacity UOMs by Class Code dspCapacityUOMsByParameter Capacity UOMs by Class Code Capacity UOMs Edit Item... dspCapacityUOMsByProductCategory Item Number Description Inv. UOM Cap. UOM Cap./Inv. Rat. Alt. UOM Alt/Inv Ratio Capacity UOMs by Product Category dspCashReceipts Earliest Latest Number Cust. # Customer Posted Voided Date Unposted Edit Cash Receipt... View Cash Receipt... Post Cash Receipt Edit Receivable Item... View Receivable Item... Reverse Entire Posting? <p>This will reverse all applications related to this cash receipt. Are you sure you want to do this? Source Apply-To Amount Enter Start Date You must enter a valid Start Date. Enter End Date You must enter a valid End Date. Invoice Check Cert. Check Visa AmEx Discover Other C/C Void Posted Cash Receipt Cash Credit Memo Debit Memo Customer Deposit Master Card Wire Trans. Other Cash Receipts Distribution Display By Applications Currency Base Amount dspCheckRegister Void Misc. Prt'd Posted Check Date Amount Currency Total: Invalid Dates Check Register Bank Account: &Close &Query &Print Checks Chk./Vchr. EFT Batch Void Posted Check... On what date did you void this check? 0.00 USD Recipient <p>Invalid dates specified. Please specify a valid date range. Base Amount Check Number: Show only checks written to: Vendor Customer Tax Authority Vendor #: Tax Authority #: Show Detail dspCostedBOMBase Costed Single Level Bill of Materials Use Standard Costs Use Actual Costs Costed Bill of Materials Seq # Item Number Description UOM Batch Sz. Fxd. Qty. Qty. Per Scrap % Effective Expires Unit Cost Ext. Cost Need Item Number You must select an Item to see its BOM. Always Never Maintain Item Costs... View Item Costing... dspCostedIndentedBOM Actual Cost Standard Cost Costed Indented Bill of Materials Total Cost dspCostedSingleLevelBOM Actual Cost Standard Cost Costed Single Level Bill of Materials dspCostedSummarizedBOM Costed Bill of Material Item Number Description UOM Qty. Req. Unit Cost Item Required You must specify an Item Number. Costed Summarized Bill of Materials Show &Expired Components Threshold Days: Show &Future Components Use Standard Costs Use Actual Costs Ext. Cost dspCountSlipEditList User # Location Lot/Serial # Posted Entered Slip Qty. Delete Count Slip? Are you sure that you want to delete the selected Count Slip? Count Slip Edit List Count &Tag #: ... &Close &Print Count Slips: &New &Edit &Delete P&ost Post &All Site: dspCountSlipsByWarehouse Count Slips Earliest Latest Slip # Tag # Item Description Qty. Counted Posted Missing Slip #%1 Missing Slips #%1 to #%2 Enter Start Date Please enter a valid Start Date. Enter End Date Please enter a valid End Date. Show Unposted Count Slips Treat Slip &Numbers as Numeric Site Count Slips by Site Entered By dspCountTagEditList Pri. Tag/Slip # Tag Date Item Number Description QOH NN QOH Count Qty. Variance % Amount Unfreeze Itemsite? Posted Unposted Count Tag Edit List Item Sites by S&earch for: Show Count &Slips No Highlighting &Close &Query &Print Count Tags: &Edit &Delete P&ost Enter S&lip Automatically Update Location Enter Count Slip... Count Slip Edit List... View Pending Inventory History... Edit Count Tag... Post Count Tag... Delete Count Tag Edit Count Slip... Cannot Delete Count tag <p>There are Count Slips entered for this Count Tag. You must delete Count Slips for the Count Tag before you may delete this Tag. <p>The Itemsite for the Count Tag you deleted is frozen. Would you like to unfreeze the Itemsite at this time? <p>There are Count Slips entered for this count tag. You must delete Count Slips for the Count Tag before you may delete this Tag. All Class Code Planner Code Site Highlight Tag when Variance Value Exceeds &Highlight Tag when Variance % Exceeds dspCountTagsBase Count Tags by Class Code Show Unposted Count Tags Count Tags Earliest Latest Tag # Site Item Created Created By Entered Entered By Posted Posted By QOH Before Qty. Counted Variance % View Count Tag... dspCountTagsByClassCode Count Tags by Class Code dspCountTagsByItem Count Tags by Item dspCountTagsByWarehouse Count Tags by Site dspCreditCardTransactions Timestamp Cust. # Name Type Status Document # Amount Currency Entered By Reference Allocated Allocated Currency Preauthorization Charge Refund Authorized Approved Declined Voided No Approval Code Print Receipt Credit Card Processing Error Credit Card Error Credit Card Processing Warning Credit Card Processing Note Credit Card Transactions &Close &Query Show All Processed Pending Expired Valid Days: Post Void Amount: dspCustomerARHistory Open Doc. Type Doc. # Doc. Date Amount Balance Edit... View... Invoice Credit Memo Debit Memo Check Certified Check Master Card Visa American Express Discover Card Other Credit Card Cash Wire Transfer Customer Deposit Other Enter Customer Number Please enter a valid Customer Number. Enter Start Date Please enter a valid Start Date. Enter End Date Please enter a valid End Date. Customer History Selection Document Date Range Due/Dist Date Currency Base Balance Zero Invoice dspDepositsRegister Date Source Doc Type Doc. # Reference Account Amount Rcv'd Credit to A/R Balance Invoice Credit Memo Deposits Register Invalid Date(s) You must specify a valid date range. Currency Transactions Base Balance dspDetailedInventoryHistoryByLocation Inventory History All Transactions Receipts Issues Shipments Adjustments and Counts Transfers Scraps Date Type Order # Item Number Lot/Serial # UOM Trans-Qty Qty. Before Qty. After View Transaction Information... Enter Start Date Please enter a valid Start Date. Enter End Date Please enter a valid End Date. Enter Location Please enter a valid Location. Detailed Inventory History by Location Location: Netable: Restricted: Transaction Types: Earliest Latest dspDetailedInventoryHistoryByLotSerial Inventory History All Transactions Receipts Issues Shipments Adjustments and Counts Transfers Scraps Date Type Order # Item Number Location Lot/Serial # UOM Trans-Qty Qty. Before Qty. After Start Date End Date Transaction Type View Transaction Information... Enter Lot/Serial # Detailed Inventory History by Lot/Serial # <p>You must enter a Lot/Serial or Item criteria to print Inventory Detail by Lot/Serial #.</p> Multi-Level Trace Forward Backward Item Number: Selected Pattern Site dspEarnedCommissions Earliest Latest Sales Rep. S/O # Cust. # Ship-To Invc. Date Item Number Qty. Ext. Price Commission Paid Earned Commissions All Sales Reps. Selected Sales Rep. Include Misc. Charges and Items Enter a Valid Start and End Date You must enter a valid Start and End Date for this report. Currency Base Ext. Price Base Commission dspExpediteExceptionsByPlannerCode Expedite Exceptions Order Type/# To Site From Site Item Number Descriptions Start/Due Date Exception Release Order Start Production Expedite Production Expedite Exceptions by Planner Code Look Ahead Days: dspExpiredInventoryByClassCode Item Number UOM Lot/Serial # Expiration Qty. Adjust this QOH... Reset this QOH to 0... Enter Misc. Count... Issue Count Tag... Unit Cost Value Expired Inventory Use Standard Costs Use Actual Costs Threshold Days: Class Code Expired By Perishability Warranty Site Cost Method Transfer to another Site... Site: Show Inventory Value Use Posted Costs dspFinancialReport Period Alternate Label Custom %1 %2 %1 %2 % Edit Alternate Label... Enter an alternate label for the period %1: View Financial Report Financial Report: Beg. Bal. Debits Credits End. Bal. Budget Difference Beg. Bal. % Periods Columns Debits % Credits % End. Bal. % Budget % Difference % Custom % Budgets Actuals Show Account Numbers Zero Amounts Statement Notes View Transactions... No period selected <p>You must select at least one period. Setup Incomplete Group Account Name %1 % of Group %1 %2 Diff. %1 %2 % Diff. Report Error You must select at least one Column You must select actuals or budget to proceed. Budget Total Grand Total Error Parsing Report There was an error Parsing the report definition. %1 %2 Balance Income Cash %1 % Ad Hoc Income Statement Balance Sheet Cash Flow Statement Project: Report Type: Trend Report Month Quarter Year Column Layout: No Period(s) Selected You must select at least one period to report on. <p>Please make sure all accounting periods are associated with a quarter and fiscal year before using this application. dspFreightPricesByCustomer Freight Prices Schedule Source Qty. Break Price Method Currency From To Freight Class Ship Via Customer Required You must specify a valid Customer. N/A Any Flat Rate Per UOM Customer Cust. Type Cust. Type Pattern Sale Freight Prices by Customer Show E&xpired Prices Show &Future Prices dspFreightPricesByCustomerType Freight Prices Schedule Source Qty. Break Price Method Currency From To Freight Class Ship Via N/A Any Flat Rate Per UOM Cust. Type Cust. Type Pattern Sale Freight Prices by Customer Type Customer Type: Show E&xpired Prices Show &Future Prices dspFrozenItemSites Count Tags Item Number Description Count Tag # Thaw Frozen Item Sites Site dspGLSeries Journal Transactions Date Journal # Source Doc. Type Doc. Num. Notes/Account Debit Credit Posted Post... Edit Journal... Delete Journal... Reverse Journal... View Journal... General Ledger Series deleted edited Journal %1 by %2 on %3 Journal Series All Sources Selected Source: A/P A/R G/L I/M P/D P/O S/O S/R W/O Journal Number Range Start: End: Type Journal General Ledger Invalid Date Range You must first specify a valid date range. dspGLTransactions Date Date Created Source Doc. Type Doc. # Reference Journal # Account Debit Credit Posted Start Date End Date GL Account Document # Company Profit Center Main Segment Sub Account Account Type Sub Type Show Deleted View... View Journal Series... View Voucher... View Invoice... View Purchase Order... View Journal... Username View Shipment... Running Total Transactions Asset Expense Liability Equity Revenue View Credit Memo... View Debit Memo... View Sales Order... View WO History... View Inventory History... General Ledger Transactions Show Running Total Beginning Balance: dspIndentedBOM Seq # Item Number Description UOM Scrap % Effective Expires Indented Bill of Materials Notes Qty. Req. Reference dspIndentedWhereUsed Bill of Materials Items Seq. # Item Number Description UOM Fxd. Qty. Qty. Per Scrap % Effective Expires View Item Inventory History... Indented Where Used Show &Expired Components Show &Future Components Enter a Valid Item Number Error Executing Report Was unable to create/collect the required information to create this report. You must enter a valid Item Number. dspInvalidBillsOfMaterials Invalid Bill of Material Items Parent Item # Component Item # Component Item Description Edit Parent Item... Edit Parent Item Site... Create Component Item Site... Bills of Materials without Component Item Sites Update when Items or Item Sites are Changed Site dspInventoryAvailability Inventory Availability As of: Item Site Lead Time Look Ahead Days Cutoff Date Dates to Show Shortages Reorder Exceptions Ignore Reorder at 0 By Source Vendor Class Code Class Code Pattern Item Item Group Item Group Pattern Planner Code Planner Code Pattern Source Vendor Source Vendor Type Source Vendor Type Pattern Site Enter Valid Date Please enter a valid date. Enter Valid Dates Please select a valid date range. View Inventory History... View Allocations... View Orders... Running Availability... Create Purchase Request... Create Purchase Order... Create W/O... Post Misc. Production... View Substitute Availability... Issue Count Tag... Enter Misc. Inventory Count... Vendor # Description UOM LT QOH Allocated Unallocated On Order PO Requests Reorder Lvl. OUT Level Available dspInventoryAvailabilityByCustomerType Availability Item Number Description UOM QOH This Alloc. Total Alloc. Orders This Avail. Total Avail. At Shipping Add to Packing List Batch Show Reservations... Unreserve Stock Reserve Stock... Reserve Line Balance This Reserve Error Inventory Availability by Customer Type Only Show Shortages Use Reservation Netting Show Work Order Supply Order/Start Date Sched./Due Date dspInventoryAvailabilityBySalesOrder Availability Item Number Description UOM QOH This Alloc. Total Alloc. Orders This Avail. Total Avail. At Shipping Inventory Availability by Sales Order Sales Order #: Order Date: Cust. Name: Cust. Phone: P/O Number: Only Show Shortages Show W/O Supply Sched. Date No Sales Order Selected You must select a valid Sales Order. Show Reservations... Unreserve Stock Reserve Stock... Reserve Line Balance This Reserve Error Use Reservation Netting Start Date dspInventoryAvailabilityByWorkOrder Work Order Material Availability WO/Item# Description UOM QOH This Alloc. Total Alloc. Orders This Avail. Total Avail. Type Inventory Availability by Work Order Shortages Insufficient Inventory All Materials Parent Work Order Only Summarized Parent/Child Work Orders Indented Work Orders Invalid W/O Selected <p>You must specify a valid Work Order Number. View Inventory History... Create P/R... Post Misc. Production... Enter Misc. Inventory Count... dspInventoryHistory Inventory History Receipts Issues Shipments Adjustments and Counts Transfers Scraps Start Date End Date Class Code Class Code Pattern Item Item Group Item Group Pattern Order Number Pattern Planner Code Planner Code Pattern Sales Order Transaction Type Transfer Order Work Order Site Transaction Time Created Time Item Number Type Order # UOM Qty Value From Area QOH Before To Area QOH After Cost Method Value Before Value After User Average Standard Job None Unknown View Transaction Information... Edit Transaction Information... View Work Order Information... dspInventoryLocator Location Netable Lot/Serial # Expiration Qty. Relocate... Reassign Lot/Serial #... Yes Locations No N/A Location/Lot/Serial # Detail Enter a Valid Item Number You must enter a valid Item Number for this report. Warranty Site dspInvoiceInformation Type Doc./Ref. # Apply Date Amount C/M Error Check Certified Check Master Card Visa American Express Discover Card Other Credit Card Cash Wire Transfer ther Invoice Information &Invoice #: Customer P/O #: Invoice Date: Ship Date: Invoice Amount: &Close &View Details &Print Bill-to: Ship-to: Notes: Applications: ... Cash Deposit Currency Base Amount dspInvoiceRegister Invoice Register All Accounts Selected Account: Date Source Doc Type Doc. # Reference Account Debit Credit Invoice Credit Memo Subtotal Total View Invoice... Transactions View Credit Memo... View Debit Memo... Credit Memo Not Found <p>The Credit Memo #%1 could not be found. Debit Memo Not Found <p>The Debit Memo #%1 could not be found. Document Not Found <p>The Document #%1 could not be found. Debit Memo View Customer Deposit... Customer Deposit Invalid Date Range You must specify a valid date range. dspItemCostDetail Costing Detail # Item Number Description UOM Qty. Per Scrap/Absorb. % Unit Cost Ext'd Cost Item Required You must specify an Item Number. Detailed Item Costs Cost Type: Show Standard Costs Show Actual Costs dspItemCostHistory Costing History Element Lower Type Time User Old Currency New Item Required You must specify an Item Number. Actual Standard Delete Item Costs History dspItemCostSummary Costing &Elements Element Lower Std. Cost Posted Act. Cost Updated View Costing Detail... Item Required You must specify an Item Number. Item Costs Summary Never dspItemCostsByClassCode Items Item Number Active Description UOM Std. Cost Act. Cost % Var. Maintain Item Costs... View Item Costing Summary... Update Actual Costs... Post Actual Costs... Item Costs by Class Code Only Show &Zero Cost Items Only Show Items where Actual and Standard are different Show Inactive Items dspItemSources Item Sources Site Drop Ship Only Item Item Number Pattern Item Description Vendor Vendor Name Vendor Item Number Pattern Contract Contract Number Pattern Manufacturer Pattern Manufacturer Item Number Pattern Effective Start Effective End Expires Start Expires End Show Inactive Order Type Item Number Description UOM Vendor # Contract # Effective Expires Vendor Currency Vendor Item Number Manufacturer Manuf. Item# Default Vendor UOM UOM Ratio Min. Order Order Mult. Vendor Ranking Lead Time Qty. Break Base Unit Price Item Currency Unit Price Edit... View... Set as Default... Delete Item Source <p>This item source is used by existing purchase order records and may not be deleted. Would you like to deactivate it instead? <p>This item source is used by existing purchase order records and may not be deleted. Are you sure that you want to delete the Item Source for %1? 'Always' 'Never' All Into Stock Drop Ship dspItemsWithoutItemSources Item Number Description Type Create Item Source... Edit Item... Purchased Outside Items without Item Sources dspJobCosting Work Center/Item Type Posted Costs Description Qty. UOM Cost Setup Run Time Material Hours Work Order Costing Select Options <p>You must select a Work Order. dspJournals Journals Journal Entries Asset Expense Liability Equity Revenue Date Source Doc. Type Doc. # Reference Journal# Account Debit Credit Posted GL Journal # Username Start Date End Date GL Account Document # Source Pattern Company Profit Center Main Segment Sub Account Account Type Sub Type GL Journal View... View Journal Series... View Voucher... View Invoice... View Purchase Order... View Shipment... View Credit Memo... View Debit Memo... View Sales Order... View WO History... View Inventory History... dspMRPDetail Item Number Description View Allocations... Allocations View Orders... Orders Issue P/R... Issue P/O... Issue W/O... Projected QOH Availability Firmed Allocations Firmed Orders Firmed Availability MRP Detail Calendar: &Close &Print Item Sites: MRP Detail: Incomplete criteria <p>The criteria you specified is not complete. Please make sure all fields are correctly filled out before running the report. Site dspMaterialUsageVarianceByBOMItem Material Usage Variance Earliest Latest Post Date Ordered Produced Proj. Req. Proj. Qty. per Act. Iss. Act. Qty. per Qty. per Var. % Reference Invalid Item You must specify an Item. Invalid BOM Item You must specify a BOM Item. Material Usage Variance by Bill of Materials Item Component Item: Invalid Date Range You must specify a valid date range. Notes dspMaterialUsageVarianceByComponentItem Material Usage Variance Earliest Latest Post Date Parent Item Description Ordered Produced Proj. Req. Proj. Qty. per Act. Iss. Act. Qty. per Qty. per Var. % Reference Invalid Date Range You must specify a valid date range. Invalid Item You must specify an Item. Material Usage Variance by Component Item Notes dspMaterialUsageVarianceByItem Material Usage Variance Earliest Latest Post Date Component Item Ordered Produced Proj. Req. Proj. Qty. per Act. Iss. Act. Qty. per Qty. per Var. % Reference Invalid Date Range You must specify a valid date range. Invalid Item You must specify an Item. Material Usage Variance by Item Description Notes dspMaterialUsageVarianceByWarehouse Material Usage Variance Earliest Latest Post Date Parent Item Component Item Ordered Produced Proj. Req. Proj. Qty. per. Act. Iss. Act. Qty. per. Qty. per Var. % Reference Invalid Date Range You must specify a valid date range. Material Usage Variance by Site Description Notes dspMaterialUsageVarianceByWorkOrder Material Usage Variance Post Date Component Item Ordered Produced Proj. Req. Proj. Qty. per Act. Iss. Act. Qty. per Qty. per Var. % Reference Invalid W/O You must specify a Work Order. Material Usage Variance by Work Order Description Notes dspOrderActivityByProject Status Qty Edit Sales Order... View Sales Order... Edit Quote... Orders Name Item # Description UOM Value View Quote... Edit Quote Item... View Quote Item... Edit Sales Order Item... View Sales Order Item... Edit Invoice... View Invoice... Edit Invoice Item... View Invoice Item... Edit Work Order... View Work Order... View Purchase Request... Edit Purchase Order... View Purchase Order... Edit Purchase Order Item... View Purchase Order Item... Project Required You must specify a Project. Sales Order Work Order Purchase Order Purchase Request Purchase Requests Invoices Open Closed Converted Canceled Expired Unposted Posted Exploded Released In Process Unreleased Total Quote Quotes Invoice Order Activity by Project Show Types Sales Orders Work Orders Purchase Orders dspOrders Type Status Order # Total Received Balance Running Bal. Required Reschedule P/O Item... Change P/O Item Quantity... Reprioritize W/O... Reschedule W/O... Change W/O Quantity... Print Traveler... Item Orders Show Availability as of: Item Site Lead Time Look Ahead Days: Date: Date Range: to Site: dspPOsByDate Earliest Latest P/O # Status Vendor Order Date Due Date Enter Start Date Please enter a valid Start Date. Enter End Date Please eneter a valid End Date. Edit Order... View Order... Closed Purchase Orders Starting Order Date: Ending Order Date: Unposted Partial Received Open Purchase Orders by Date All Purchasing Agents Selected Purchasing Agent Purchasing Agent: Show Closed Purchase Orders Site dspPOsByVendor Purchase Orders P/O # Status Vendor Date Edit Order... View Order... Closed Unposted Partial Received Open Order Date Purchase Orders by Vendor Due Date Receipt Date Show Where Item Description contains Earliest Latest Site dspPartiallyShippedOrders Earliest Latest Hold S/O # Customer Hold Type Ordered Scheduled Pack Date Amount Currency Edit Order... View Order... Print Packing List... None Sales Orders Credit Ship Pack Other Partially Shipped Orders Show Prices Return Amount (%1) dspPendingAvailability Material Requirements Now Latest # Item Number Description UOM Pend. Alloc. Total Alloc. QOH Availability Item Required You must specify an Item Number. Site Required You must specify a Site. Pending W/O Material Availability &Qty. to Build: &Effective: &Build Date Only Show Shortages Site: dspPendingBOMChanges Latest Date Action Seq # Item Number Description UOM Fxd. Qty. Qty. Per Scrap % Edit BOM Item... View BOM Item... Item Required You must specify a valid item. Effective Expires Pending Bill of Materials Changes Cutoff Date: dspPlannedOrders Planned Orders Purchase Manufacture Transfers Item Order Types Planner Code Planner Code Pattern Class Code Item Group Show Inactive Site Order # Type From Site Item Number Description UOM Start Date Due Date Qty Firm Running Availability... Usage Statistics... Edit Order... Firm Order... Soften Order... Release Order... Delete Order... dspPoDeliveryDateVariancesByItem Purchase Item Receipts P/O # Vendor Vend. Item # Vendor Description Qty. Req. Due Req. Leadtime Agrd. Due Agrd. Leadtime Real Leadtime Req. Diff Agrd. Diff Recv. Date Purchase Order Delivery Date Variances by Item All Purchasing Agents Selected Purchasing Agent Purchasing Agent: Earliest Latest dspPoDeliveryDateVariancesByVendor Purchase Item Receipts Earliest Latest P/O # Vendor Date Vend. Item # Vendor Description Qty. Req. Due Req. Leadtime Agrd. Due Agrd. Leadtime Recv. Date Real Leadtime Req. Diff Agrd. Diff Vendor Required You must specify a Vendor. Enter Start Date Please enter a valid Start Date. Enter End Date Please enter a valid End Date. Purchase Order Delivery Date Variances by Vendor Vendor: All Purchasing Agents Selected Purchasing Agent Purchasing Agent: dspPoHistory P/O Items # Item/Doc. # UOM Due/Recvd. Vend. Item # Ordered Received Returned Copy P/O... P/O Required You must specify a P/O Number. Non-Inventory N/A Purchase Order History Description dspPoItemReceivingsByDate Purchase Order &Receipts and Returns P/O # Vendor Sched. Date Recv. Date Item Number Rcvd/Rtnd Qty. Purch. Cost Recv. Cost Value Received Returned Not Vouchered NonInv - N/A Receipts and Returns by Date All Purchasing Agents Selected Purchasing Agent Purchasing Agent: Show Costs Unvouchered Enter Valid Dates Please enter a valid Start and End Date. dspPoItemReceivingsByItem P/O # Vendor Due Date Recv. Date Vend. Item # Description Rcvd/Rtnd Qty. Purch. Cost Recv. Cost Value Received Returned Not Vouchered N/A Receipts and Returns by Item All Purchasing Agents Selected Purchasing Agent Purchasing Agent: Show Purchase &Receipts and Returns: Costs Unvouchered Enter Item Number Please enter a valid Item Number. Enter Valid Dates Please enter a valid Start and End Date. NonInv - dspPoItemReceivingsByVendor P/O # Sched. Date Recv. Date Item Number Description Rcvd/Rtnd Qty. Purch. Cost Recv. Cost Received Returned N/A NonInv - Receipts and Returns by Vendor Vendor#: All Purchasing Agents Selected: Show Unvouchered Costs Enter Valid Dates Please enter a valid Start and End Date. Enter Vendor Number Please enter a valid Vendor Number. Invoiced Purchase Order &Receipts and Returns Value Earliest Latest Not Vouchered Mark As Invoiced... Correct Receiving... Create Voucher... dspPoItemsByDate Earliest Starting Due Date: Latest Ending Due Date: P/O # Status Vendor Due Date Item Number Description Vend. Item # UOM Vend. UOM Ordered Received Returned Edit Order... View Order... Running Availability... Edit Item... View Item... Reschedule... Change Qty... Close Item... Open Item... NonInv - Purchase Order Items by Date All Purchasing Agents Selected Purchasing Agent Purchasing Agent: All Items Open Items Closed Items Closed Unposted Partial Open Enter Start Date Purchase Order Items Please enter a valid Start Date. Enter End Date Please eneter a valid End Date. Site dspPoItemsByItem P/O # Status Vendor Due Date Ordered UOM Vend. UOM Received Returned Edit Order... View Order... Running Availability... Edit Item... View Item... Reschedule... Change Qty... Close Item... Open Item... All Items Open Items Closed Items All Purchasing Agents Purchase Order Items by Item Selected: Closed Unposted Partial Open Enter Item Number Purchase Order Items Please enter a valid Item Number. Site dspPoItemsByVendor P/O # Status Due Date Description Vend. Item # UOM Vend. UOM Ordered Received Returned Non Inventory Edit Order... View Order... Running Availability... Edit Item... View Item... Reschedule... Change Qty... Close Item... Open Item... All Items Open Items Closed Items Purchase Order Items by Vendor All Purchasing Agents Selected: All Purchase Orders Search for: Next Closed Unposted Partial Open Enter Vendor Number Purchase Order Items Site Vendor Item Number Please enter a valid Vendor Number. dspPoPriceVariancesByItem Price Variances Earliest Latest P/O # Dist. Date Recv. Date Vendor Number Vendor Name Purch. Cost Purch. Curr. Rcpt. Cost Received Vouch. Cost Vouchered Variance % Item Required You must specify an Item Number. NonInv - N/A Qty. Currency Purchase Price Variances by Item Only show variances not equal to zero All Purchasing Agents Selected Purchasing Agent Purchasing Agent: Site Voucher Distribution Base Voucher Enter Valid Dates Please enter a valid Start and End Date. dspPoPriceVariancesByVendor Price Variances P/O # Dist. Date Recv. Date Vendor Number Vendor Name Item Number Description Qty. Purch. Cost Purch. Curr. Rcpt. Cost Received Vouch. Cost Vouchered Variance N/A Currency % NonInv - Purchase Price Variances by Vendor Only show variances not equal to zero All Purchasing Agents Selected Purchasing Agent Purchasing Agent: Site Voucher Distribution Base Voucher Enter Valid Dates Please enter a valid Start and End Date. dspPoReturnsByVendor Rejected Material P/O # Vendor Date Vend. Item # Vendor Description Qty. Reject Code Vendor Required You must specify a Vendor. Enter Start Date Please enter a valid Start Date. Enter End Date Please eneter a valid End Date. Rejected Material by Vendor Vendor: All Purchasing Agents Selected Purchasing Agent Purchasing Agent: dspPricesByCustomer Prices Schedule Source Item Number Description Price UOM Qty. Break Price Currency Ext. Cost Mar. % Customer Required You must specify a Customer. N/A ????? Customer Cust. Type Cust. Type Pattern Sale List Price Prices by Customer Show E&xpired Prices Show &Future Prices Show Costs and Margins Use Standard Costs Use Actual Costs dspPricesByCustomerType Prices Schedule Source Item Number Description Price UOM Qty. Break Price Currency Ext. Cost Mar. % Customer Type Required You must specify a Customer Type. N/A ????? Cust. Type Cust. Type Pattern Sale List Price Prices by Customer Type Customer Type: Show E&xpired Prices Show &Future Prices Show Costs and Margins Use Standard Costs Use Actual Costs dspPricesByItem Prices Schedule Source Customer/Customer Type Qty. Break Price Currency Cost Margin Item Required You must specify an Item Number. N/A Customer Cust. Ship-To Cust. Type Cust. Type Pattern Sale List Price Prices by Item Show E&xpired Prices Show &Future Prices Show Costs and Margins Use Standard Costs Use Actual Costs Cust. Ship-To Pattern dspPurchaseReqsByItem Status Parent Order Create Date Due Date Qty. Notes Running Availability... Release P/R... Delete P/R... Manual Purchase Requests Other Purchase Requests by Item P/R # Sub # Item Required <p>Item is required. dspPurchaseReqsByPlannerCode Item Number Description Status Parent Order Create Date Due Date Qty. Notes Running Availability... Release P/R... Delete P/R... Manual Purchase Requests Other Purchase Requests by Planner Code Earliest Latest Enter a Valid Start Date and End Date You must enter a valid Start Date and End Date for this report. P/R # Sub # dspQOH Quantities on Hand Show All Quantities Only Show Positive Quantities Only Show Negative Quantities Show Inventory Value Use Posted Costs Use Standard Costs Use Actual Costs Class Code Class Code Pattern Cost Category Cost Category Pattern Item Item Group Item Group Pattern Site As Of Item Number Description UOM Default Location Reorder Lvl. QOH Non-Netable Unit Cost Value NN Value Cost Method View Location/Lot/Serial # Detail... Transfer to another Site... Adjust this Quantity... Reset this Quanity to 0... Enter Misc. Count... Issue Count Tag... None N/A dspQOHByLocation Location Item Number Description Lot/Serial # UOM QOH Relocate... N/A Quantities on Hand by Location As of Date: Location: Netable: Restricted: Site Reserved dspQuotesByCustomer Earliest Starting Order Date Latest Ending Order Date Quote # Quote Date Ship-to Cust. P/O # Status Edit... View... Convert... Invalid Dates Enter valid Start and End dates. Invalid Options One or more options are not complete. Convert Selected Quote(s) Cannot Convert Quote Quote Lookup by Customer All P/O #s Selected P/O #: Show Converted Quotes <p>Are you sure that you want to convert the selected Quote(s) to Sales Order(s)? <p>Quote #%1 has already been converted to a Sales Order. Error Getting Quote Converting Error Access Denied You may not view, edit, or convert this Quote as it references a Site for which you have not been granted privileges. dspQuotesByItem Earliest Starting Order Date Latest Ending Order Date Quote # Quote Date Customer Status Quoted Edit... View... Quote Lookup by Item Show Converted Quotes Item Required You must specify an Item Number Dates Required You must specify a Start Date and End Date. Access Denied You may not view, edit, or convert this Quote as it references a Site for which you have not been granted privileges. dspReorderExceptionsByPlannerCode Expedite Exceptions Item Number Description Exception Date Reorder Level Proj. Avail. View Running Availability... Create Work Order... Reorder Exceptions by Planner Code Look Ahead Days: &Include Planned Orders Site dspReservations Total Qty. Relieved Reserved Running Bal. Required View Work Order... View Sales Order... Edit Sales Order... View Transfer Order... Edit Transfer Order... Item Required You must specify an Item Number. Item Reservations QOH: Available To Reserve: Order/Location LotSerial Site: dspRunningAvailability Source/Destination Due Date Ordered Received Balance Running Avail. Item Required You must specify an Item Number. Planned W/O (firmed) Planned W/O Work Order Schedule by Item... View Purchase Order... Planned P/O (firmed) Planned P/O Planned T/O (firmed) Planned T/O Soften Order... Firm Order... Release Order... Delete Order... Planned W/O Req. (firmed) Planned W/O Req. View Work Order Details... Running Availability Show Planned Orders QOH: Order Multiple: Reorder Level: Order Up To Qty: Purchase Request Order Type Order # View Sales Order... View Transfer Order... Site: dspSalesHistory Sales History Invoice Start Date Invoice End Date Ship Start Date Ship End Date Customer Customer Ship-to Customer Group Customer Group Pattern Customer Type Customer Type Pattern Item Product Category Product Category Pattern Sales Order Sales Rep. Shipping Zone Sale Type Shipping Zones Site Doc. # Invoice # Ord. Date Invc. Date Item Number Description Shipped Unit Price Ext. Price Currency Base Unit Price Base Ext. Price Unit Cost Ext. Cost Edit... View... dspSalesOrderStatus # Item Description Ordered Shipped Returned Child Ord. #/Status Getting S/O Getting Dates Sales Order Status Order Date: Order #: Cust. Name: Cust. Phone: P/O Number: Last Updated: Invoiced Site Shipment Status Balance Close Date Close User dspSalesOrdersByCustomer Sales Orders Earliest Starting Order Date: Latest Ending Order Date: Order # Ordered Scheduled Status Ship-to Cust. P/O # Edit... View... Shipment Status... Shipments... Incomplete Options One or more of the options are incomplete. No Lines Closed Open Partial Sales Order Lookup by Customer All P/O #s Selected P/O #: Create Return Authorization... Could Not Open Window The new Return Authorization could not be created Access Denied You may not view or edit this Sales Order as it references a Site for which you have not been granted privileges. dspSalesOrdersByCustomerPO Sales Orders Earliest Starting Order Date: Latest Ending Order Date: Cust # Customer Order # Ordered Scheduled Status Ship-to Cust. P/O # Edit... View... Shipment Status... Shipments... P/O Number Required You must specify a P/O Number. Dates Required You must specify a valid Date Range. No Lines Closed Open Partial Sales Order Lookup by Customer PO PO Number: Create Return Authorization... Could Not Open Window The new Return Authorization could not be created Access Denied You may not view or edit this Sales Order as it references a Site for which you have not been granted privileges. dspSalesOrdersByItem Sales Orders Earliest Starting Order Date: Latest Ending Order Date: Order # Order Date Customer Ordered Shipped Returned Balance Edit... View... Shipment Status... Shipments.. Item Required You must specify an Item Number. Dates Required You must specify a valid Date range. Closed Sales Order Lookup by Item Create Return Authorization... Could Not Open Window The new Return Authorization could not be created Access Denied <p>You may not view or edit this Sales Order as it references a Site for which you have not been granted privileges. dspSalesOrdersByParameterList Sales Orders Earliest Starting Order Date: Latest Ending Order Date: Customer Order # Ordered Scheduled Status Ship-to Cust. P/O # Sales Order Lookup by Customer Type Edit... View... Shipment Status... Shipments... Dates Required You must specify a valid Date range. No Lines Closed Open Partial Sales Order Lookup by Parameter List Create Return Authorization... Could Not Open Window The new Return Authorization could not be created Access Denied You may not view or edit this Sales Order as it references a Site for which you have not been granted privileges. dspShipmentsBase Shipments by Sales Order #: Order Date: Shipment: Cust. Name: Cust. Phone: P/O Number: Shipments Shipment # Ship Date # Item Description Site Ordered Shipped Tracking Number Freight at Shipping Print Shipping Form... Query Shipment Status... Getting Sales Order Getting Shipment We do not currently process the shipper %1. Cannot Track %1 We cannot directly show tracking pages for the shipper %1. The tracking number is %2. Shipper dspShipmentsByDate Shipments Ship Date # S/O #/Item Customer/Description Ordered Shipped Freight at Shipping Print Shipping Form... Shipments by Date Shipment # Order Type Tracking # Currency Enter a Valid Start Date and End Date You must enter a valid Start Date and End Date for this report. Site dspShipmentsBySalesOrder Shipments by Sales Order dspShipmentsByShipment Shipments by Shipment dspSingleLevelBOM # Item Number Description Scrap % Effective Expires ECN # Single Level Bill of Materials Notes Issue UOM Issue Fxd. Qty. Issue Qty. Per Inv. UOM Inv. Fxd. Qty. Inv. Qty. Per Reference dspSingleLevelWhereUsed Bill of Materials Items Seq # Parent Item Description UOM Fxd. Qty. Qty. Per Scrap % Effective Expires Edit Bill of Materials... Edit Item Master... View Item Inventory History... Enter a Valid Item Number You must enter a valid Item Number. Always Never Push Pull Mixed Special Single Level Where Used Effective: Today dspSlowMovingInventoryByClassCode Item Number Description UOM Last Movement QOH Adjust this QOH... Reset this QOH to 0... Enter Misc. Count... Issue Count Tag... Unit Cost Value Slow Moving Inventory Cutoff Date: Use Standard Costs Use Actual Costs Show Inventory Value Quantities on Hand No Cutoff Date You must specify a cutoff date. Site Transfer to another Site... dspStandardJournalHistory Date Journal # Journal Name Account Debit Credit Enter Date Please enter a valid Start Date & End Date. Journal deleted by %1 on %2 Posted G/L Transactions Delete Journal... Reverse Journal... Standard Journal History dspSubstituteAvailabilityByItem Substitute Availability Item Number Description LT QOH Allocated On Order Reorder Lvl. Available View Allocations... View Orders... Item Required You must specify an Item Number Date Required You must specify a valid date. Substitute Availability by Root Item Show Availability as of: Item Site Lead Time Look Ahead Days: Date: Normalize to Parent UOM Site dspSummarizedBOM Item Number Description UOM Ext. Qty. Req. Summarized Bill of Materials dspSummarizedBacklogByWarehouse Earliest Latest Customer/Ship Via Hold Type/Shipped Ordered/Shipped Scheduled Pack Date Sales Cost Margin Sales Rep Yes No Delete Sales Order? Cannot Delete Sales Order Inventory Availability by Sales Order... Edit... View... Delete... Pack Backlog Order#/Shipment# Credit Print Packing List... None Ship Other Show Prices and Costs Total Sales Orders: Total Line Items: <p>Are you sure that you want to completely delete the selected Sales Order? <br>Would you like to Close the selected Sales Order instead? Return Total Qty (Inventory UOM): Time Received Pack List Batch Summarized Backlog by Site dspSummarizedBankrecHistory Summarized History Posted Post Date User Start Date End Date Opening Bal. Ending Bal. Summarized Bank Reconciliation History Bank Account: dspSummarizedGLTransactions Description/Notes Src. Doc. Type Doc. # Debit Credit View... View Voucher... View Invoice... View Purchase Order... Username All Sources Selected Source: A/P A/R G/L I/M P/D P/O S/O S/R W/O Account # Date Summarized General Ledger Transactions Transactions All Unposted Posted dspSummarizedSales Summarized Sales Group By Customer Customer Type Item Currency: Sales Rep. Shipping Zone Site Invoice Start Date Invoice End Date Ship Start Date Ship End Date Currency Currency Pattern Customer Ship-to Customer Group Customer Group Pattern Customer Type Pattern Product Category Product Category Pattern Base Local Select a Group By Please select at least one Group By option. 'Customer:' 'Cust. Type:' 'Sales Rep.:' 'Ship Zone:' 'Item:' 'Site:' View Sales Detail... Name Zone Description First Sale Last Sale Min. Price Max. Price Avg. Price Wt. Avg. Price Total Units Total Sales dspTaxHistory Doc# Source Doc. Type Order# Doc. Date Dist. Date Journal# Name Tax Code Tax Type Tax Zone Tax Class Tax Authority Item# Description Qty Unit Price Extension Tax Currency Tax %1 Select items to show You must select sales or purchase items to show. Enter Valid Start Date You must enter a valid Start Date to print this report. Enter Valid End Date You must enter a valid End Date to print this report. Invoice Credit Memo Debit Memo Other None Sales Purchase Voucher Sales %1 Sales Freight %1 Freight Taxed Sales Tax %1 Purchases %1 Purchase Tax %1 Net Tax %1 Summarize by Show only tax Tax History Type Summary Detail Show Purchases Basis Document date Distribution date Date Range Type: Code Class Authority Zone Selection: All &Close &Query &Print Tax History: dspTimePhasedAvailability Item Number UOM View Availability Detail... View Allocations... View Orders... Create W/O... Create P/R... Create P/O... Time-Phased Availability Site dspTimePhasedBookings Time-Phased Bookings Group By: Units: Customer Customer Type Customer Type Pattern Item Product Category Product Category Pattern Site Sales Dollars Inventory Capacity Alt. Capacity View Bookings... Prod. Cat. Description Item Number Cust. # Name UOM dspTimePhasedOpenAPItems Vend. # Vendor View Open Items... Select Calendar Periods Please select one or more Calendar Periods Calendar: Total Open 0+ Days 0-30 Days 31-60 Days 61-90 Days 90+ Days As of: Use Custom Calendar Incomplete criteria <p>The criteria you specified are not complete. Please make sure all fields are correctly filled out before running the report. Total Payables Aging Use Document Date Use Distribution Date dspTimePhasedOpenARItems Cust. # Customer View Open Items... Print Statement... Select Calendar Periods Please select one or more Calendar Periods Receivables Aging Use Document Date Distribution Date Calendar: Total Open 0+ Days 0-30 Days 31-60 Days 61-90 Days 90+ Days As of: Use Custom Calendar Incomplete criteria <p>The criteria you specified are not complete. Please make sure all fields are correctly filled out before running the report. Total dspTimePhasedSales Time-Phased Sales History Customer Customer Group Customer Group Pattern Customer Type Customer Type Pattern Item Product Category Product Category Pattern Site Sales Dollars Inventory Capacity Alt. Capacity View Sales Detail... Prod. Cat. Description Item Number Cust. # Name UOM dspTimePhasedUsageStatisticsByItem Usage Transaction Type View Transactions... Received Issued Sold Scrap Adjustments Time-Phased Item Usage Statistics by Item Site dspTrialBalances Start End Account # Description Beg. Bal. Beg. Bal. Sense Debits Credits Difference Difference Sense End Bal. End Bal. Sense Period Company GL Account Show Zero Amounts View Transactions... Forward Update Trial Balances dspUnbalancedQOHByClassCode &Item Sites Item Number Description UOM QOH QOH Detail. NN QOH NN Detail. Balance Item Site... View Item Site... Edit Item Site... View Inventory Availability... Issue Count Tag... Regular None Lot # Serial # Unbalanced QOH by Class Code Site dspUndefinedManufacturedItems Item Number Description Type Active Exception Create BOM... Edit Item... No BOM Undefined Manufactured Items Show Manufactured Items without valid Bills of Materials Show &Inactive Items dspUninvoicedReceivings Purchase Order &Receipts Date By P/O # # Vendor Item Number Uninvoiced Mark as Invoiced... Correct Receiving... All Purchasing Agents Selected: Type Create Credit Memo... Uninvoiced P/O Receipts and Returns Value dspUnusedPurchasedItems Item Number Description UOM Total QOH Last Cnt'd Last Used Enter Class Code Class Code Pattern cannot be blank. Unused Purchased Items Include &Uncontrolled Items dspUsageStatistics Item Usage Statistics Start Date End Date Class Code Class Code Pattern Item Item Group Item Group Pattern Site Item Number Description Received Issued Sold Scrap Adjustments Transfers dspValidLocationsByItem Valid Locations Location Description Restricted Netable Invalid Item Please select a valid Item. Valid Locations by Item Site dspVendorAPHistory Open Doc. Type Doc. # Invoice # Doc. Date Due Date Amount Amount (%1) Applied (%1) Balance Edit... Voucher Select Number Please select a valid Vendor. Enter Start Date Please enter a valid Start Date. Enter End Date Please enter a valid End Date. Vendor History Vendor: Find Vend. Invoice #: Void Credit Memo Debit Memo Check Other A System Error occurred at %1::%2, Error #%3. P/O # View A/P Open... View G/L Series... View Voucher... Currency Base Balance dspVoucherRegister Vouchers Earliest Latest Date Vend. # Vend. Name Doc. Type Doc. # Reference Account Debit Credit View... View Voucher... View Invoice... View Purchase Order... Invalid Date Enter a valid Start Date. Enter a valid End Date. Invalid Account Enter a valid Account. Username Voucher Register All Accounts Selected Account: Show Username dspWoHistoryByClassCode Work Orders Earliest Latest W/O # Item # Description Status Ordered Received Start Date Due Date View... Invalid Start Date Enter a valid Start Date. Invalid End Date Enter a valid End Date. Cost Work Order History by Class Code Show Only Top Level Work Orders Edit... Site dspWoHistoryByItem Work Orders Earliest Latest W/O # Status Ordered Received Start Date Due Date View... Invalid Item Enter a valid Item. Invalid Start Date Enter a valid Start Date. Invalid End Date Enter a valid End Date. Cost Work Order History by Item Show Work Order Cost Only Show Top Level Work Orders Edit... Site dspWoHistoryByNumber Sub. # Item # Description Status Ordered Received Start Date Due Date View... Cost Work Order History by W/O Number Only Show Top Level Work Orders Show W/O Cost Edit... Invalid Work Order Number You must enter a work order number for this report. W/O # Work Orders Site WIP Project Priority BOM Rev BOO Rev &Work Order Pattern: dspWoMaterialsByItem Material Requirements W/O # Parent Item # Oper. # Iss. Meth. Fxd. Qty. Qty. Per Scrap % Required Issued Scrapped Balance Due Date Item Required You must specify an Item Number. Push Pull Mixed Error W/O Material Requirements by Component Item Iss. UOM dspWoMaterialsByWorkOrder Component Item Oper. # Iss. Meth. Fxd. Qty. Qty. Per Scrap % Required Issued Scrapped Balance Due Date Work Order Required You must specify a Work Order Number. View Requirement... Push Material Requirements Pull Mixed Error Iss. UOM Work Order Material Requirements By Work Order dspWoSchedule Work Order Schedule Open Exploded Released In-Process Start Date End Date Class Code Class Code Pattern Item Item Group Item Group Pattern Planner Code Planner Code Pattern Show Only Top Level Status Site Has Parent Sales Order Has Closed Parent Sales Order parentType Work Order # Pri. Item Number Description UOM Ordered Received Due Date Condition Work Center <p>The Work Order that you selected to delete is a child of another Work Order. If you delete the selected Work Order then the Work Order Materials Requirements for the Component Item will remain but the Work Order to relieve that demand will not. Are you sure that you want to delete the selected Work Order? Cannot Delete Work Order This Work Order is linked to a Sales Order and is a Job Costed Item. The Work Order may not be deleted. <p>The Work Order that you selected to delete was created to satisfy Sales Order demand. If you delete the selected Work Order then the Sales Order demand will remain but the Work Order to relieve that demand will not. Are you sure that you want to delete the selected Work Order? <p>Are you sure that you want to delete the selected Work Order? Delete Work Order? Edit... View... Release Recall Explode... Implode... Delete... Close... View Bill of Materials... View Material Requirements... Inventory Availability... Running Availability... Print Traveler... Issue Material Item... Post Production... Correct Production Posting... Reprioritize... Reschedule... Change Quantity... View Parent Sales Order Information... View Parent Work Order... duplicateAccountNumbers No Segments Selected for Change You have not selected any segments for changing. You must select at least one segment to be changed. A System Error occurred at %1::%2 %3 Company Profit Account Number Sub. Description Type Duplicate Account Numbers Change Profit Center Number: Change Company Number: Change Sub. Accnt. Number: Append to Description: Select Account Numbers to Duplicate: &Close Duplicate editOwners Type Name Description Owner No New Owner A new owner must be selected before you can continue. Confirm Ownership Modification <p>Are you sure that you want to change the new owner to '%1' for the selected records? Edit Owners Owner: New Owner: In the following categories: Project To Do Account Contact Incident Opportunity &Close &Query Modify Modify All empGroup You do not have sufficient privilege to view this window Code Number &Close Invalid Name You must enter a valid Name for this Employee Group. Employee Group Name: Description: &Save Member Employees: &New &Delete empGroups Name Description List Employee Groups Employee Groups: &Close &New &Edit &View &Delete employee You do not have sufficient privilege to view this window Characteristic Value Name Description Month &Close Employee Employee: Employee Number: Active Cancel Save CRM Account... &Contact Image Picture: &Detail Site: Manager: Start Date: Financial Type: Billing Rate: Hourly Salaried Per: Hour Day Week Bi-Weekly Year Dept.: Shift: Employee Name: Compensation: Notes Comments Characteristics New Edit Delete Groups View Detach Attach Cannot Save Employee You must enter a valid Employee Code. No Privileges Database Error You must enter an Employee Number. Error Saving Contact Error saving Employee Error deleting Employee Error getting Employee Error deleting Characteristic Assignment Error getting Characteristic Assignments Error getting Employee Groups Employee in Group The employee is already in the selected group. Error attaching to Employee Group Error detaching from Employee Group An Employee cannot be his or her own Manager. An Employee already exists for the Code specified. An Employee already exists for the Number specified. employees Code Number Employees Show Active Only Site Active First Last Delete? Are you sure you want to delete this Employee? Error deleting Employee Edit... View... Delete enterMiscCount Cannot Enter Misc. Count Count Tag Previously Created Enter Miscellaneous Count &Cancel &Post Count Count &Qty.: Co&mments: <p>The selected Item Site is controlled via a combination of Lot/Serial and/or Location control. Misc. Counts can only be entered for Item Sites that are not Lot/Serial or Location controlled. <p>An unposted Count Tag already exists for this Item and Site. You may not a Misc. Count until the current Count Tag has been posted. Site: enterPoReceipt # Due Date Item Number Vend. Item # Vend. UOM Ordered Received To Receive Vendor Item#: Nothing selected for Receipt This Purchase Order is being drop shipped against a Sales Order that is on Hold. The Sales Order must be taken off Hold before the Receipt may be Posted. Cannot Ship Order &Close RMA Expired <p>The selected Return Authorization is expired and cannot be received. Print Label... Enter Receipt... Invalid Order <p>Cannot search for Items by Bar Code without first selecting an Order. No Bar Code scanned <p>Cannot search for Items by Bar Code without a Bar Code. No Match Found <p>No Items on this Order match the specified Barcode. Non-Inventory N/A Assign all Lot-controlled Items to single Lot # &Cancel Print &Label &Enter Receipt Cancel Receipts? Save <p>No Line Items have been selected for receipt. Select at least one Line Item and enter a Receipt before trying to Post. <p>Are you sure you want to cancel all unposted Receipts for this Order? Enter Order Receipts Drop Ship P&ost Order Line Items: Receive &All Receive Items using bar code: Qty. 1 Auto Post Find Enter Receipts Post Canceled Site Inv. UOM Manufacturer Manuf. Item# Returned &Print Description enterPoReturn # Item Number UOM Vend. Item # Ordered Received Returned To Return &Close Returns made against Drop Shipped Purchase Orders will not reverse shipment transactions generated by the original receipt. Shipment transactions should be reversed separately if necessary. Non-Inventory N/A Enter Purchase Order Returns Drop Ship &Cancel &Post Purchase Order Items: &Enter Return Nothing selected for Return <p>No Purchase Order Items have been selected to be returned. Select at least one Line Item and enter a Return before trying to Post. Saving Shared Address <p>There are multiple uses for this Address. If you save this Address, the Address for all of these uses will be changed. Would you like to save this Address? <p>There was an error saving this address (%1). Check the database server log for errors. Create Credit Memo One or more line items on this P/O are closed. Would you like to automatically create a credit memo against this return? &Yes &No Print Return Report Return Address: Enter PO Return Transaction Canceled Site Description enterPoitemReceipt Correct Qty. to: Correct Freight to: Cannot Receive Yes No Enter PO Receipt <p>Transaction Cancelled. Line #: Item Number: Vendor Item Description: Vend. Item Number: Vendor UOM Ratio: Receipt Vendor UOM: Extended Purchase Cost: Unit Purchase Cost: Notes Due Date: Qty. Ordered: Qty. Received: Qty. to Receive: Freight: Qty. to Receive in Inv. UOM: Print Label <p>Cannot receive more quantity than ordered. Receipt Qty. Differs <p>The Qty entered does not match the receivable Qty for this order. Do you wish to continue anyway? Date Received: Correct Item Receipt <p>Incomplete Parameter List: _orderitem_id=%1, _ordertype=%2, _mode=%3. P/O T/O Enter Item Receipt Order Number: Order Type: Cannot Correct <p>Receipt is a Drop Shipment. The received quantity may not be changed. You must use Purchase Order Return to make corrections. <p>Receipt has been split. The received quantity may not be changed. Qty. Shipped: R/A Vendor Item#: <p>Cannot receive more quantity than authorized. Qty. Returned: enterPoitemReturn Receipt Date Receiving Agent G/L Post Date Returnable Qty. Purchase Cost Cannot Enter Return You may not enter this return until you select a Reject Code. You may not enter a return whose returned quantity is greater than the returnable quantity. You must enter a quantity to return. You may not enter this return until you select a Receipt. Quantity to return may not be greater than the returnable quantity from the selected receipt. Enter P/O Item Return P/O Number: Line #: &Cancel &Return Vend. Item Number: Vendor Item Description: Vendor UOM: Inv./Vendor UOM Ratio: Qty. Ordered: Qty. to Return: Returnable Qty.: Reject Code: Receipts: errorLog Database Log Debug Warning Critical Fatal Clear Close errorReporter An Address already exists with this address number. Cannot set the address number to an empty value. Cannot create an A/P Application for an invalid Vendor. Cannot create an A/P Open Item for an invalid Vendor. The Atlas Map name is required. An Atlas Map already exists with this name. The Bank Account name is required. A Bank Account already exists with this name. The Bank Adjustment Type name is required. A Bank Adjustment Type already exists with this name. The Budget name is required. A Budget already exists with this name. The Calendar name is required. A Calendar already exists with this name. The Cash Receipt number is required. A Cash Receipt already exists with this number. The selected Customer cannot be deleted as it has Credit Cards defined for it. The Characteristic name is required. A Characteristic already exists with this name. The Class Code is required. A Class Code already exists with this code. The Credit Memo number is required. A Credit Memo already exists with this number. The Comment Type name is required. A Comment Type already exists with this name. Cannot delete a CRM Account with attached Contacts. Cannot attach a Contact to an invalid CRM Account. A Contact already exists with this number. The Sales Order number is required. A Sales Order already exists with this Sales Order number. Cannot save Sales Order History for an invalid Sales Rep. The Company Number is required. A Company already exists with this number. The Cost Category code is required. A Cost Category already exists with this code. The Cost Element type is required. A Cost Element already exists with this type. Cannot set the country abbreviation to an empty string. A Country already exists with this abbreviation. Cannot set the country name to an empty string. A Country already exists with this name. Cannot delete the CRM Account since it is still associated with a Customer. Cannot set the CRM Account to an invalid Customer. Cannot set the CRM Account to an invalid Employee. The CRM Account number is required. The delete the CRM Account because it is the parent of another CRM Account. Cannot save a CRM Account with an invalid parent CRM Account. Cannot delete the CRM Account since it is still associated with a Prospect. Cannot set the CRM Account to an invalid Prospect. The Sales Rep cannot be deleted as s/he is still associated with a CRM Account. Cannot set the CRM Account to an invalid Sales Rep. Cannot set the CRM Account to an invalid Tax Authority. Cannot delete the CRM Account since it is still associated with a Vendor. Cannot set the CRM Account to an invalid Vendor. The Customer Group name is required. A Customer Gropu already exists with this name. The Customer number is required. A Customer already exists with this number. Cannot save the Customer with an invalid Sales Rep. The Customer Type code is required. A Customer Type already exists with this code. The Department number is required. A Department already exists with this number. The Employee Type is invalid. This Contact cannot be deleted as s/he is the Contact for an Employee. This Employee cannot be connected to what seems to be a non-existent Contact. The Employee code is required. An Employee already exists with this code. The Employee number is required. An Employee already exists with this Employee Number. The selected Employee Wage Period is invalid. The Employee Group name is required. An Employee Group already exists with this name. The Event Type name is required. An Event Type already exists with this name. The Expense Category code is required. An Expense Category already exists with this code. The Financial Report name is required. A Financial Report already exists with this name. The Form name is required. A Form already exists with this name. The Freight Class code is required. A Freight Class already exists with this code. The Group name is required. A Group already exists with this name. The Honorific (Title) code is required. An Honorific (Title) already exists with this code. The Image name is required. An Image already exists with this name. This Contact cannot be deleted as s/he is the Contact for an Incident. Cannot save the Incident with an invalid CRM Account. The Incident Category name is required. An Incident Category already exists with this name. The Incident Priority name is required. An Incident Priority already exists with this name. The Incident Resolution name is required. An Incident Resolution already exists with this name. The Incident Severity name is required. An Incident Severity already exists with this name. The Invoice number is required. An Invoice already exists with this number. The Pricing Schedule name is required. A Pricing Schedule already exists with this name. The Item number is required. An Item already exists with this number. The Item Alias number is required. An Item Alias with this number already exists with this item. The Item Group name is required. An Item Group already exists with this name. The Label Form name is required. A Label Form already exists with this name. The Locale code is required. A Locale already exists with this code. The Registration number is required. A Registration already exists with this number. The Lot/Serial Sequence number is required. A Lot/Serial Sequence already exists with this number. The Metric name is required. A Metric already exists with this name. The Encrypted Metric name is required. A Encrypted Metric already exists with this name. There is a merge in progress that overlaps with this one. Either complete all merges in progress, delete merge history, or both. The Opportunity number is required. An Opportunity already exists with this number. The Opportunity Source name is required. An Opportunity Source already exists with this name. The Opportunity Stage name is required. An Opportunity Stage already exists with this name. The Opportunity Type name is required. An Opportunity Type already exists with this name. The Order Sequence name is required. An Order Sequence already exists with this name. The Package name is required. A Package already exists with this name. The Planner Code code is required. A Planner Code already exists with this code. The Purchase Order number is required. A Purchase Order already exists with this number. Cannot save the Purchase Order with an invalid Vendor. Cannot save this P/O Return with an invalid Vendor. The Profit Center number is required. A Profit Center already exists with this number. The Privilege name is required. A Privilege already exists with this name. The Project number is required. A Project already exists with this number. The Product Category code is required. A Product Category already exists with this code. The Prospect number is required. A Prospect already exists with this number. The Sales Rep cannot be deleted as s/he is still assigned to one or more Prospects. The Query Head name is required. A Query Head already exists with this name. The Miscellaneous Account and Miscellaneous Amount must either both be set or neither can be set when saving a Quote. The Quote number is required. A Quote already exists with this number. The Sales Rep cannot be deleted as s/he is still associated with one or more Quotes. The Return Authorization number is required. A Return Authorization already exists with this number. The Sales Rep cannot be deleted as s/he is still associated with one or more Return Authorizations. Cannot receive materials from an invalid Vendor. The Registration Type code is required. A Registration Type already exists with this code. The Revision number is required. A Revision with this number already exists for this object. The Rejection code is required. A Rejection Code already exists with this code. The Reason code is required. A Reason Code already exists with this code. The Sale name is required. A Sale name already exists with this name. Cannot delete this Sales Rep as it is associated with an Employee. The Sales Rep number is required. Cannot save this Sales Rep as there is another Sales Rep with this number. The Schema name is required. A Schema Order record already exists with this name. A Schema Order record already exists with this order number. The Shift number is required. A Shift already exists with this number. The Shipping Charge name is required. A Shipping Charge already exists with this name. The Shipping Form name is required. A Shipping Form already exists with this name. The Shipment number is required. A Shipment already exists with this number. Cannot save this Ship-To with an invalid Customer. Cannot save this Ship-To with an invalid Sales Rep. The Ship-Via code is required. A Ship-Via already exists with this code. The Shipping Zone name is required. A Shipping Zone already exists with this name. The Site Type name is required. A Site Type already exists with this name. The Source name is required. A Source already exists with this name. A State with this name already exists for this Country. The State name is required. The Standard Journal name is required. A Standard Journal already exists with this name. The Standard Journal Group name is required. A Standard Journal Group already exists with this name. The Subaccount number is required. A Subaccount already exists with this number. Cannot save this Tax Code with an invalid Tax Authority. The Tax Authority code is required. A Tax Authority already exists with this code. The Tax Class code is required. A Tax Class already exists with this code. The Tax Registration number is required. Cannot delete this Tax Authority as there are still Tax Registrations associated with it. The Tax Type name is required. A Tax Type already exists with this name. The Tax Zone code is required. A Tax Zone already exists with this code. The Terms code is required. A Terms already exists with this code. The selected CRM Account cannot be deleted as it has To-Do Items. The Transfer Order number is required. A Transfer Order already exists with this number. The UOM name is required. A UOM already exists with this name. The UOM Type name is required. A UOM Type already exists with this name. The Vendor Number is required. This Vendor Number cannot be used as it is in use by another Vendor. The Vendor Type code is required. A Vendor Type already exists with this code. Cannot save this Voucher with an invalid Vendor. The Site code is required. A Site already exists with this code. The XSLT Map name is required. An XSLT Map already exists with this name. errorcatorter The Sales Category number is required. A Sales Category already exists with this number. eventManager Time Acknowleged Event Type Order # Acknowledge Delete Inventory Availability by Work Order... View Sales Order... View Sales Order Item... Print Packing List... Issue Count Tag... View Inventory History... View Inventory Availability... Recall Work Order Change W/O Quantity... Print W/O Traveler... Change W/O Due Date... Delete Work Order... Delete Work Order? Are you sure that you want to delete the selected Work Order? &Yes &No Events Current &User &Selected User: Show &Acknowledged Events &Close Events: Automatically Update View Purchase Order Item... Site View Todo Item... View Incident... View Project Task... expenseCategories Category Description Cannot Delete Expense Category &Yes &No Expense Categories: &Close &Print &New &Edit &View Co&py &Delete <p>The selected Expense Category cannot be deleted as there are unposted P/O Lines assigned to it. You must reassign these P/O Lines before you may delete the selected Expense Category.</p> <p>The selected Expense Category cannot be deleted as there are open P/O Lines assigned to it. You must close these P/O Lines before you may delete the selected Expense Category.</p> <p>The selected Expense Category cannot be deleted as there are closed P/O Lines assigned to it. Would you like to mark the selected Expense Category as inactive instead?</p> List Expense Categories <p>The selected Expense Category cannot be deleted as there are Checks and Voucher Distributions assigned to it. You must change these before you may delete the selected Expense Category.</p> expenseCategory <p>You must specify a name. <p>The name you have specified is already in use. <p>You must select a Expense Account Number for this Expense Category before you may save it. <p>You must select a Purchase Price Variance Account Number for this Expense Category before you may save it. <p>You must select a P/O Liability Clearing Account Number for this Expense Category before you may save it. <p>You must select a Freight Receiving Account Number for this Expense Category before you may save it. Cannot Save Expense Category Expense Category Ca&tegory: &Description: &Active PO Line Freight Expense: E&xpense: Purchase Price Variance: P/O &Liability Clearing: expenseTrans Expense Transaction &Close Getting History <p>You must enter a Quantity before posting this transaction. You must select an Expense Category before posting this transaction. Could Not Post Item not found Getting QOH Cannot Post Transaction Transaction Date: Username: &Cancel &Post Before After Document #: Notes: Quantity: Transaction Canceled You must select an Item before posting this transaction. Expense Category: <p>No transaction was done because Item %1 was not found at Site %2. &Site: explodeWo &Close Explode Work Order Level &Single Level Explosion &Multiple Level Explosion &Cancel E&xplode exportData Name Document Type System Identifier Export XSLT File Description Delete Query Set? <p>Are you sure you want to delete this Query Set? Export Output File Processing Complete The export to %1 is complete Processing Error Export Data Close Export Destination format: xTuple XML Alternate XML Query Set: New Edit Delete externalCCTransaction Credit Card Transaction Information &Cancel &Save Credit Card Number: XXXX Transaction Type: Pre-Authorization Charge Capture Pre-Authorization Credit Void Amount: Order: order Passed Address Verification Approval Status: Approved Declined Error Held For Review Approval Code: Passed Card Verification Transaction ID: passed failed or not entered externalShipping You do not have sufficient privilege to view this window. You must enter a valid Order Number for this External Shipping Record before continuing You must select a valid Shipment Number for this External Shipping Record before continuing You must select a valid Shipper for this External Shipping Record before continuing You must select a valid Package Tracking Number for this External Shipping Record before continuing You must select a valid Tracking Number for this External Shipping Record before continuing Cannot Save Shipping Record External Shipping Maintenance Shipment #: Shipper: Billing Option: Package Type: Tracking Number: Package Tracking Number: Weight: Base Freight: Total Freight: Last Updated: Void: N Y Close Save 0 externalShippingList So Number Shipment Number Package Tracking Number Void Billing Option Weight Base Freight Base Freight Currency Total Freight Total Freight Currency Package Type Tracking Number Last Updated You do not have sufficient privilege to view this window. External Shipping List api extshipmaint External Shipping Data: &Close &New &Edit &View &Delete failedPostList Failed Post List <p>Could not post these documents to the G/L because the accounting periods for the posting dates are closed:</p> OK Retry filterManager Filter Set Name Shared Unshare Filter <p>This will un-share the selected filter and assign it to you. Are you sure this is what you want to do? Shared Filter Exists <p>This will replace a shared filter with the same name. Are you sure this is what you want to do? List Saved Filter Sets Close Share Do Not Share Delete filterSave Please enter a name for this filter set before saving. Shared Filter Exists <p>This will over-write a shared filter. Are you sure this is what you want to do? Save Filter Filter Name: Shared financialLayout Group/Account Name Show Beg'ng Show End Show Db/Cr Show Budget Sub./Summ. Oper. Layout Name is Invalid You must enter a valid name for this Financial Report. - + Financial Report &Name: &Description: Show Grand Total Show Beginning Show Ending Show Budget Show Debits/Credits Show Difference Show Custom Alternate Custom Label: Add Top Level Group &Add Group Add Account Add Special Edit Delete &Move Up &Move Down Name Description Error Creating Temporary Record Cannot Change Type All column layouts must be deleted before changing the type. Report type changed Existing row definitions will be changed. Group percentage settings will be reset. Continue? Yes No Show Diff. Show Custom Row Layout &View Column Layouts &Add &Edit &Delete Options Alternate Labels Alternate Debits: Alternate Difference: Notes Alternate Credits: Alternate Ending Balance: Alternate Budget: Alternate Begining Balance: Alternate Grand Total: Active Report Type &Income Statement &Balance Sheet &Cash Flow &Ad Hoc financialLayoutColumns Month End Quarter End Year End Cannot Save settings <p>At least one of Month, Date or Year must be selected. Column Layout Budget % of Group Total Difference % Difference &Edit Selected Period Month Quarter Year Show Debits and Credits Name Description Report Template Prior Period Full Month Full Quarter Full Year Year To Date financialLayoutGroup Parent Financial Report Group Name: Description Subtotal/Summarize Show Subtotal Summarized Show Beginning Balance Show % of Group Total Show Ending Balance Show Debits/Credits Show Budget Show Difference Show Custom Column Use Group for % Total calculation Operation Add to Group Total Subtract from Group Total Use Alt. Label Alt. Subtotal Label: financialLayoutItem Duplicate Account Number The selected Account number is already being used in this Financial Report. Would you like to continue anyway? Invalid Account Number The selected Account number is not valid. Please select a valid account before continuing. Parent Financial Report Item Account: Show Beginning Balance Show % of Group Total Show Ending Balance Show Debits/Credits Show Budget Show Difference Operation Add to Group Total Subtract from Group Total Show Custom Column Use Beginning Balance Use Ending Balance Use Debits Use Credits Use Budget Use Difference Use Group for % Total calculation All Selections Select one Account Select Multiple Accounts by Segment Number: - Type: Asset Liability Expense Revenue Equity Sub Type: Options Show Columns financialLayoutSpecial Parent Financial Report Special Name: A/R Open Items A/P Open Items Type: Show Beginning Balance Show % of Group Total Show Ending Balance Show Debits/Credits Show Budget Show Difference Operation Add to Group Total Subtract from Group Total Show Custom Column Use Beginning Balance Use Ending Balance Use Debits Use Credits Use Budget Use Difference Use Group for % Total calculation financialLayouts Name Description This is a system report and will be opened in view mode. Only status and notes may be changed. Confirm Delete You are about to delete the selected Financial Report and all of its items. Are you sure you want to continue? Copy Financial Report Target Report: The record you are trying to copy is no longer on the database. You must specify a name. The name you specified is already in use. Please choose a different name. There was an unknown error encountered while copying this report. Error Encountered A System Error occurred at %1::%2. List Financial Reports Financial Layouts: &Close &New &Edit Copy &Delete Active System System Report You may not delete a system report, but you may deactivate it. Show &Inactive financialReportNotes Financial Report Notes Layout: Period: A System Error occurred at %1::%2. firmPlannedOrder Purchase Order Work Order ExplodePlannedOrder returned %, indicating an error occurred. Firm Planned Order Order Type: &Quantity: &Due Date: &Cancel &Firm Notes: &Site: firmPlannedOrdersByPlannerCode Enter Cut Off Date You must enter a cut off date for the Planned Orders to be firmed. Firm Planned Orders by Planner Code Cutoff Date: &Cancel &Firm fixACL Fix Access Control Close Fix Sometimes after restoring a database users get unexpected errors relating to permission to modify the data in database tables. This can happen even though the user has been granted privileges through the application. Click the "Fix" button to try to correct database-level permissions problems. This will only work if you are logged in as a PostgreSQL administrative user. TextLabel Done. %1 entities examined. fixSerial Table Name Column Name Sequence Name Largest Key Used Next Key Fix Fix All Fix Serial Columns Only Show Problems Query not run yet &Close Query Schema Name form Form &Name: &Description: &Report: Keyed On: Customers Items Item Sites Purchase Orders Sales Orders Vendors Work Orders Sales Analysis - Special Calendar Production Entry Sheets Return Authorizations You must enter a valid Name for this Form before continuing You must select a Report for this Form before continuing A Form has already been defined with the selected Name. You may not create duplicate Forms. Cannot Save Form forms Name Description Forms: &Close &New &Edit &Delete List Forms forwardUpdateAccounts No Account Selected You have choosen to use an account but no account was specified. Forward Update Accounts All Accounts Selected Account: Account Type: Asset Liability Expense Revenue Equity Close Update freightBreakdown Schedule From To Ship Via Freight Class Total Weight UOM Price Type Total Currency Freight Breakdown for Sales Order: Freight Breakdown for Quote: Freight Breakdown for Return Auth.: Freight Breakdown Freight Breakdown for Document: &Close Calculated Manual freightClass No Freight Class Entered You must enter a valid Freight Class before saving this Item Type. A System Error occurred at %1::%2. Freight Class Freight &Class: &Description: freightClasses Code Description Delete Unused Freight Classes <p>Are you sure that you wish to delete all unused Freight Classes? List Freight Classes Freight Classes: &Close &Print &New &Edit &View &Delete Delete &Unused getGLDistDate Get G/L Distribution Date Distribute to the G/L using the following date: Default Alternate Date: Cancel Continue getLotInfo Enter A Lot Number You must specifiy a Lot Number. Enter Expiration Date You must enter an expiration date to this Perishable Lot/Serial number. Lot Information Lot #: Expiration Date: &Cancel &Assign Enter Warranty Date You must enter an warranty date to this Lot/Serial number. Warranty Date: glSeries Account Debit Credit Schedule Cannot Post G/L Series Series G/L Journal Entry Transaction Series: Dist. Date: N&otes: Totals: Debits Credits &New Ctrl+N &Edit &Delete Difference &Post <p>You must enter a Distribution Date for this Series. <p>You must enter some Notes to describe this transaction. <p>The G/L Series information is unbalanced and cannot be posted. Please correct this before continuing. Delete G/L Series? <p>Are you sure you want to delete this G/L Series Entry? Source: Document #: Document Type: Cannot Maintain G/L Series glSeriesItem Amount: General Ledger Transaction Series Item Debit Credit Account #: G/L Transaction Not In Base Currency G/L transactions are recorded in the base currency. Do you wish to convert %1 %2 at the rate effective on %3? Can not Save Series Item The Company of this Account does not match the Companies for other Accounts on this series. This entry can not be saved. glTransaction G/L Transaction Not In Base Currency G/L transactions are recorded in the base currency. Do you wish to convert %1 %2 at the rate effective on %3? Simple G/L Journal Entry Amount: Distribution Date: Document Type: Debit: Credit: Notes: Post <p>You must enter an amount for this G/L Transaction before you may Post it. <p>You must select a Debit Account for this G/L Transaction before you may Post it. <p>You must select a Credit Account for this G/L Transaction before you may Post it. The Accounts must belong to the same Company to Post this transaciton. <p>You must enter some Notes to describe this transaction. Cannot Post G/L Journal Entry Document #: glTransactionDetail G/L Transaction Detail Transaction Date: Source: Document: Journal Number: Account: Amount: Username: Created: Posted: &Close Notes: Sub Ledger Yes No group &Close Save? <p>Do you wish to save your changes? You must enter a valid Name for this Group before continuing Cannot Save Group Role &Name: &Description: &Cancel &Save &Module: Add-> Add All->> <-Revoke <<-Revoke All groups Name Description Cannot Delete Group The selected Group cannot be deleted as there are one or more Users currently assigned to it. You must reassign these Users before you may delete the selected Group. List Roles Roles: &Close &Print &New &Edit &View &Delete helpDownload Help Download Check for available documentation? Start Received unknown response from server. Could not save one or more files. Documentation downloaded. Could not read archive format. Could not uncompress file. Could not save file. No documentation is currently available. Could not retrieve documentation at this time. Downloading... Cancel helpView xTuple Help Documentation Back Forward Home honorific Title Title: Cannot Save Title You may not rename this Title with the entered value as it is in use by another Title. You must enter a valid Title. Cannot Create Title A Title with the entered code already exists.You may not create a Title with this code. honorifics Titles: &Close &Print &New &Edit &View &Delete Title Edit... View... Delete List Titles hotkey Action Name Display Name F Hot Key Keystroke: Actions: &Close &Save No Action Selected You must select an Action before saving this Hotkey. hotkeys Keystroke Action F%1 List Hot Keys Username: &Close Hot Keys: &New &Edit &Delete idleShutdown Idle Shutdown Cancel Shutdown in %1 seconds You have been idle for %1 minute(s). xTuple ERP will be closed unless you Cancel. image Images ( *. ) Images (*.png *.xpm *.jpg *.gif) Select Image File Could not load file Could not load the selected file. The file is not an image, an unknown image format or is corrupt Image File Name: Name: ... Description: No Image Specified You must load an image before you may save this record. Error Saving Image There was an error trying to save the image. imageAssignment Name Description Image Assignment Purpose: Inventory Description Product Description Engineering Reference Miscellaneous &Close &Save &New &View imageList Name Description Image List &Cancel &Select images Name Description Size Images: &Close &New &Edit &View &Delete List Images Package imageview Images ( *. ) Images (*.png *.xpm *.jpg *.gif) Select Image File Could not load file Could not load the selected file. The file is not an image, an unknown image format or is corrupt Image File Name: Name: ... Description: implodeWo Adhoc Work Order The Work Order you have selected to Implode is adhoc, meaning that its W/O Materials Requirements and/or W/O Operations lists have been manually modified. If you Implode the selected Work Order then these modifications will be lost. Are you sure that you want to Implode the selected Work Order? &Yes &No The Work Order could not be imploded because time clock entries exist for it. The Work Order could not be imploded (reason %1). Work Order Not Imploded Implode Work Order &Cancel &Implode importData You do not have sufficient privilege to view this window The application is not set up to import data. Have an administrator configure Data Import before trying to import data. <p>You must first set up the application to import data. Type File Name Status Select File(s) to Import Data files (*.xml *.csv *.tsv) CSV files (*.csv *.tsv) XML files (*.xml) Any Files (*) Import Selected Clear Status Delete From List Done Error Select File Type Please select the best description of the structure of the file %1: XML Import Warnings Import Data Files from which to import data: Automatically Update Close Add To List Reset List Import All incident Incident Incident #: Public CRM Account: Severity: Status: Print New Feedback Confirmed Assigned Resolved Closed Resolution: Category: Priority: Description: To-Do List Items Edit View Delete History Username Date/Time Description Name Status Due Date Database Error Incomplete Information You must specify the Account that this incident is for. You must specify a Contact for this Incident. View... New Incident Category Severity Priority Characteristic Value Owner A Database Error occured in incident::New: %1 Resolution Assigned To Contact New... Edit... Comment Comments You must specify a description for this incident report. Could Not Open Window The new Return Authorization could not be created Assigned To: Project Notes Characteristics Lot/Serial #: Invoice Relationships Item Receivable Type: Doc #: Credit Memo Debit Memo Customer Deposit You must specify an assignee when the status is assigned. Owner: Documents Alarms incidentCategories Incident Categories: &Close &Print &New &Edit &View &Delete Order Category Description Edit... View... Delete List Incident Categories incidentCategory Incident Category Incident Category: Order: Description: Category Name Required You must enter a Category Name to continue. Cannot Save Incident Category You may not rename this Incident Category with the entered value as it is in use by another Incident Category. Email Delivery Profile: incidentPriorities &Close &Print &New &Edit &View &Delete Order Priority Description Edit... View... Delete List Priorities Priorities: incidentPriority Order: Description: Priority Name Required You must enter a Priority Name to continue. Cannot Save Incident Priority You may not rename this Incident Priority with the entered value as it is in use by another Incident Priority. Priority Priority: incidentResolution Incident Resolution Incident Resolution: Order: Description: Resolution Name Required You must enter a Resolution Name to continue. Cannot Save Incident Resolution You may not rename this Incident Resolution with the entered value as it is in use by another Incident Resolution. incidentResolutions Incident Resolutions: &Close &Print &New &Edit &View &Delete Order Resolution Description Edit... View... Delete List Incident Resolutions incidentSeverities Incident Severities: &Close &Print &New &Edit &View &Delete Order Severity Description Edit... View... Delete List Incident Severities incidentSeverity Incident Severity Incident Severity: Order: Description: Severity Name Required You must enter a Severity Name to continue. Cannot Save Incident Severity You may not rename this Incident Severity with the entered value as it is in use by another Incident Severity. incidentWorkbench Status Feedback Confirmed New Resolved Closed Assigned User Number Created Updated Assigned To Owner Status Above Project Public Summary Category Incidents Start Date End Date Item Lot/Serial Pattern Item Number Lot/Serial Edit... View... CRM Account Severity Priority Contact Account invoice # Order # Item Description Ordered Billed Price Extended Delete Invoice? <p>This Invoice has not been saved. Do you wish to delete this Invoice? Cannot delete Invoice <p>The Invoice has been posted and must be saved. Error deleting Invoice %1 Delete Invoice with no Line Items? <p>This Invoice does not contain any Line Items associated with it. Do you wish to delete this Invoice? Enter Invoice Number <p>You must enter an Invoice Number before you may continue. Duplicate Invoice Number <p>%1 is already used by another Invoice. Please enter a different Invoice Number. Invoice &Save &Close Header Information Order #: Invoice #: Invoice Date: Ship Date: Order Date: Sales Rep.: Commission: Terms: % Tax Zone: Bill To Copy to Ship-to -> Name: Phone: Ship To Cust. PO #: &F.O.B.: Ship &Via: Sale Type: Shipping Zone: Project #: Line Items &New &Edit &View &Delete Currency: Subtotal: Outstanding Credit: Tax: tax Misc. Charge Description: Freight: Total: Authorized CC Payments: Outstanding Balance: Payment Received: Allocated Credit: Notes Misc. Charge Amount: Misc. Charge Sales Account: <p>You must enter a Customer for this Invoice before saving it. Cannot Save Invoice None Qty. UOM Price UOM Total Less than Zero <p>The Total must be a positive value. No Misc. Charge Account Number <p>You may not enter a Misc. Charge without indicating the G/L Sales Account number for the charge. Please set the Misc. Charge amount to 0 or select a Misc. Charge Sales Account. Shipping Chgs. Advanced No Line Items <p>There must be at least one line item for an invoice. invoiceItem &Cancel Cannot Save Invoice Item Customer Cannot Buy at Quantity <p>This item is marked as exclusive and no qualifying price schedule was found. You may click on the price list button (...) next to the Unit Price to determine if there is a minimum quantity the selected Customer may purchase. In %1: Invoice Item Invoice #: Line #: Item: Description: Sales Category: Customer P/N: &Save Qty. Ordered: Qty. Billed: Net Unit Price: Extended Price: Pricing UOM: List Price: Customer Price: <p>You must select an Item for this Invoice Item before you may save it. <p>You must enter an Item Number for this Miscellaneous Invoice Item before you may save it. <p>You must enter a Item Description for this Miscellaneous Invoice Item before you may save it. <p>You must select a Sales Category for this Miscellaneous Invoice Item before you may save it. None Tax: Qty. UOM: Unit Cost (Inv. UOM): Item Miscellaneous Alternate Revenue Account: Update Inventory Detail Costs Tax Type: Notes &Site: ... invoiceList Invoice # Invoice Date S/O # Ship Date Cust. P/O # Invoices &Cancel &Select Invoices: issueLineToShipping Invalid Quantity to Issue to Shipping Inventory Overshipped Yes No Inventory history not found Issue Line to Shipping Sales Order #: &Cancel &Issue Qty. Ordered: Qty. Shipped: Qty. Returned: Balance Due: Qty. at Shipping: Qty. to Issue: <p>Please enter a non-negative, non-zero value to indicate the amount of Stock you wish to Issue to Shipping for this Order Line. <p>You have selected to ship more inventory than required. Do you want to continue? Shipment #: Transfer Order #: Order #: Issue to Shipping Issue Canceled Site: Selling UOM: issueToShipping # Item Number Description Ordered Shipped Returned Balance At Shipping Inventory history not found Cannot Issue Stock Cannot Ship Order No Match Found Order Complete All items for this order have been issued to shipping. Require sufficient Inventory &Close Line Items: &Issue Stock &Return Stock Shipment #: Transaction Date: Issue by: Order Customer &Ship Only show Reserved Items Issue &Line Issue &All Issue Items using bar code: Qty. 1 Find <p>No Items on this Sales Order match the specified Barcode. <p>You must issue some amount of Stock to this Order before you may ship it. No Bar Code scanned <p>Cannot search for Items by Bar Code without a Bar Code. UOM Issue to Shipping Issue Canceled Return Canceled Unrecognized order type %1 Site Sched. Date issueWoMaterialBatch Item Number Description UOM Issue Method Picklist Required QOH Short Invalid date You must enter a valid transaction date. Insufficient Inventory A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2, Error #%3. A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2. Push Pull Mixed Error Issue Items not on Pick List &Cancel Material Issue Transaction Canceled Item Number %1 in Site %2 is a Multiple Location or Lot/Serial controlled Item which is short on Inventory. This transaction cannot be completed as is. Please make sure there is sufficient Quantity on Hand before proceeding. Returned Issue Work Order Material Batch Transaction &Date: &Post Work Order Material Requirements: issueWoMaterialItem Insufficient Inventory A System Error occurred at issueWoMaterialItem::%1, Work Order ID #%2, Error #%3. A System Error occurred at issueWoMaterialItem::%1, Work Order ID #%2. Close &Cancel UOM: Qty. to Issue: Material Issue Transaction Canceled Item Number %1 in Site %2 is a Multiple Location or Lot/Serial controlled Item which is short on Inventory. This transaction cannot be completed as is. Please make sure there is sufficient Quantity on Hand before proceeding. Invalid date You must enter a valid transaction date. A System Error occurred at %1::%2. Issue Work Order Material Item Transaction &Date: &Post QOH Before: QOH After: item Characteristic Value Description Alias Number Comments Rank Item Number Ratio Active Cntrl. Method &Close Cannot Save Item You may not rename this Item to the entered Item Number as it is in use by another Item. You must enter a Item Number for this Item before continuing. You must select an Item Type for this Item Type before continuing. You must select a Class Code for this Item before continuing. You must select an Inventory Unit of Measure for this Item before continuing. Tax Zone Create New Item Sites &Yes &No The selected Item is already a Transformation target for this Item. Cannot Delete Item Site The selected Item Site cannot be deleted as there is Inventory History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Work Order History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Sales History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Purchasing History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Planning History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is a non-zero Inventory Quantity posted againt it. Regular None Lot # Serial # Item &Active Item &Number: &Description: Item &Type: &Inventory UOM: Class Code: Purchased Manufactured Phantom Reference Costing Tooling Outside Process Fractional Maximum Desired Cost: Item is Sold Product C&ategory: List Price: Exclusive &Cancel &Save &Print Materials... Notes Characteristics &New &Edit &Delete Cost Elements Materials Aliases Substitutes New Transformations Delete &View Planning Planning Type Disallowed This item is part of one or more Bills of Materials and cannot be a Planning Item. Default Tax Type Item Costs Exist Any Tax Types Edit You must select a Product Category for this Sold Item before continuing. No Item Site Found There is no Item Site for this item. Would you like to create one now? There is no Item Site for this item. Conversions/Where Used Global You must select a Selling UOM for this Sold Item before continuing. Item Sites Exist Cannot Duplicate Transformation List Price <p>This Item has Item Sites with either on hand quantities or pending inventory activity. This item type does not allow on hand balances or inventory activity. <p>You have changed the Item Type of this Item. This Item has Item Costs associated with it that will be deleted before this change may occur. Do you wish to continue saving and delete the Item Costs? <p>You have changed the Item Type of this Item. To ensure Item Sites do not have invalid settings, all Item Sites for it will be inactivated before this change may occur. You may afterward edit the Item Sites, enter valid information, and reactivate them. Do you wish to continue saving and inactivate the Item Sites? Add conversions? <p>There are records referring to this Item that do not have UOM Conversions to %1. Would you like to create UOM Conversions now?<p>If you answer No then the Item will be saved and you may encounter errors later. The units without conversions are:<br>%2 Would you like to create Item site inventory settings for the newly created Item now? Inventory... Workbench... Pick List Configured Bar Code: Warranty: Days Unit Price UOM: Wholesale Price: Weight &Product: Pac&kaging: Site You must select a Class Code before continuing. This Item is used in an active Bill of Materials and must be marked as active. Expire the Bill of Material items to allow this Item to not be active. This Item is used in an active Item Site and must be marked as active. Deactivate the Item Sites to allow this Item to not be active. Must be Sold Kit item types must be Sold. Please mark this item as sold and set the appropriate options and save again. This item is used in an active bill of materials for a kit and must be marked as sold. Expire the bill of material items or deactivate the kit items to allow this item to not be sold. BOM Items should be marked as Sold <p>You have changed the Item Type of this Item to Kit. This Item has BOM Items associated with it that are not marked as Sold. Do you wish to continue saving? Access Denied You may not view or edit this Item Site as it references a Site for which you have not been granted privileges. Kit Vendor Name Vendor Item Manufacturer Manuf. Item# Weight in This Item is used in an active Item Source and must be marked as active. Deactivate the Item Sources to allow this Item to not be active. Delete Item Source This item source is used by existing purchase order records and may not be deleted. Would you like to deactivate it instead? &Ok This item source is used by existing purchase order records and may not be deleted. Are you sure that you want to delete the Item Source? Freight Class: Remarks Extended Description Conversions Sites Sources &Copy Tax is Recoverable Relationships Documents itemAlias &Close You must enter a valid Alias before continuing Cannot Save Item Alias An Item Alias for the selected Item Number has already been defined with the selected Alias Item Number. You may not create duplicate Item Aliases. Item Alias Use an Alias Description on Billing and Shipping Paperwork Description: &Cancel &Save Comments: Not Specified Item Number: Alias Number: itemAliasList Item Aliases &Alias: Show &Inactive Items &Cancel &Select &Items: Alias Number Item Number Description itemAvailabilityWorkbench Source/Destination Due Date Ordered Received Balance Running Avail. LT QOH Allocated Unallocated On Order Reorder Lvl. OUT Level Available Seq # Item Number Description UOM Ext. Qty. Per Scrap % Effective Expires Unit Cost User Type Trans-Qty From Area QOH Before To Area QOH After All Transactions Receipts Issues Shipments Adjustments and Counts Transfers Scraps Location Netable Lot/Serial # Expiration Qty. Now Parent Item Qty. Per Yes No N/A Undefined Enter Start Date Please enter a valid Start Date. Enter End Date Please enter a valid End Date. Total Cost Actual Cost Standard Cost Planned P/O (firmed) Fxd. Qty. Planned P/O Planned W/O (firmed) Planned W/O Planned T/O (firmed) Planned T/O Planned W/O Req. (firmed) Planned W/O Req. Enter Valid Date Average Standard Job None Unknown Soften Order... Firm Order... Release Order... Delete Order... View Work Order Details... S/O Edit Sales Order... T/O Edit Transfer Order... P/O Edit Purchase Order... View Inventory History... View Allocations... View Orders... Running Availability... Create P/R... Create P/O... Create W/O... Issue Count Tag... Enter Misc. Inventory Count... View Substitute Availability... Maintain Item Costs... View Item Costing... View Transaction Information... Edit Transaction Information... View Work Order Information... Relocate... Reassign Lot/Serial #... Edit Bill of Materials... Edit Item Master... View Item Inventory History... Item Availability Workbench &Close Running Show Planned Orders QOH: Order Multiple: Reorder Level: Order Up To Qty: &Print Running Availability: Inventory Show Availability as of: Item Site Lead Time Look Ahead Days: Cutoff Date: Dates: to Show Reorder Exceptions Bill of Materials Transaction Types: Ignore Reorder at 0 Only Show Shortages &Query Availability: Use Standard Costs Use Actual Costs Costed Bill of Materials: History Inventory History: Locations: Where Used Effective: Bill of Materials Items: Show Costs <p>You have choosen to view Inventory Availability as of a given date but have not indicated the date. Please enter a valid date. Invalid Data You must enter a valid Item Number for this report. You must enter a valid Start Date and End Date for this report. Enter a Valid Item Number Order Type Order # Purchase Request Warranty Inventory Detail Site Ext Cost Always Never Select an Item Please select an Item and try again. <p>Could not collect the Indented BOM information to write write the report.</p><pre>%1</pre> Site: Transaction Time Created Time Order #/Detail Cost Method Value Before Value After itemCost You must select a Costing Element to save this Item Cost. Cannot Save Item Cost No Costing Elements Remaining <p>Item %1 already has all available costing elements assigned. No new Item Costs can be created for it until more costing elements are defined. <p>BOM Item %1 already has all available costing elements assigned. No new BOM Item Costs can be created for it until more costing elements are defined. Item Cost &Cancel &Save Costing Element: Lower Level: Actual Cost: &Post Cost to Standard itemGroup Name Description &Close Cannot Save Item Group You must enter a Name for this Item Group before you may save it. Cannot Add Item to Item Group The selected Item is already a member of this Item Group Item Group Name: Description: &Save Member Items: &New Delete itemGroups Name Description Item Groups: &Close &New &Edit &View &Delete List Item Groups itemImages Inventory Description Product Description Engineering Reference Miscellaneous Other Image Description: << >> &Close List Item Images itemList Item List Show &Inactive Items Item Number Description Bar Code Items &Make Items Only &Buy Items Only itemListPrice &Close Item List Price &Cancel &Save List Price: Price UOM: Inv./Price Ratio: Inventory UOM Price: Cost: Extended Cost: Margin: Standard Actual itemPricingSchedule Always Effective Never Expires Target Type Item/Prod. Cat. Description Qty. Break Method &Close Enter Effective Date You must enter an effective date for this Pricing Schedule. Enter Expiration Date You must enter an expiration date for this Pricing Schedule. Invalid Expiration Date The expiration date cannot be earlier than the effective date. Item Prod. Cat. Pricing Schedule Name: Description: Site: Currency: &Cancel &Save Schedule: &New &Edit &Delete UOM Price/Percent Fixed Amt. Net Price The application has encountered an error and must stop editing this Pricing Schedule. %1 Enter Name You must enter a Name for this Pricing Schedule. Pricing Schedule Already Exists A Pricing Schedule with the entered Name already exists. Nominal Discount Markup Freight Price Fixed Percent Mixed All Sites All Shipping Zones Flat Rate Price Per UOM itemPricingScheduleItem Cannot Create Pricing Schedule Item There is an existing Pricing Schedule Item for the selected Pricing Schedule, Item and Quantity Break defined. You may not create duplicate Pricing Schedule Items. There is an existing Pricing Schedule Item for the selected Pricing Schedule, Product Category and Quantity Break defined. You may not create duplicate Pricing Schedule Items. Pricing Schedule Item Type Item Product Category &Qty. Break (Inventory UOM): List Price: Nominal Discount Markup Price UOM: Price/Inv. Ratio: Cost (Pricing UOM): Margin: Standard Actual Product Category: Discount Percent (List Price): Discount By Fixed Amount: Markup Percent (Wholesale Price): &Price: Qty. UOM: &Qty. Break: Characteristic Value Price Markup Percent (Inventory Cost): The application has encountered an error and must stop editing this Pricing Schedule. %1 Base &New &Edit &Delete Price per There is an existing Pricing Schedule Item for the selected Pricing Schedule, Freight Criteria and Quantity Break defined. You may not create duplicate Pricing Schedule Items. Freight Discount By Markup By Markup Percent: Markup By Fixed Amount: N/A Price: Flat Rate Price per N/A From To All Shipping Zones Selected: All Ship Vias All Freight Classes itemPricingSchedules Name Description Effective Expires Cannot Delete Pricing Schedule The selected Pricing Schedule cannot be deleted as it has been assign to one or more Customers. You must delete these assignments before you may delete the selected Pricing Schedule. The selected Pricing Schedule cannot be deleted as it has been assign to one or more Sales. You must delete these assignments before you may delete the selected Pricing Schedule. Delete Expired? <p>This will permanently delete all expired Pricing Schedules. <p> OK to continue? Always Never Search &for: Show E&xpired Pricing Schedules Show &Future Pricing Schedules &Close &Item Pricing Schedules: &New &Edit &View Copy &Delete Delete Expired List Pricing Schedules itemSearch Search for Item Search through Description 1 Search through Description 2 Search through Bar Code Show &Inactive Items Item Number Description Bar Code Items itemSite Location Description Allowed &Close Cannot Save Item Site Delete Inventory Detail Records? &Cancel Assign Lot Numbers Item Site &Active &Save &Reorder Level: Order &Up To: Minimum Order: Maximum Order: Order &Multiple: Enforce on Manual Orders Days Safety Stock: ABC Class: Cycl. Cnt. Fre&q.: &Lead Time: Event &Fence: A B C &Planner Code: Ranking: None Site can manufacture this Item Create Work Orders linked to Sales Orders Create Purchase Requests for Sales Orders Create Purchase Orders linked to Sales Orders Create Purchase Requests for Work Order requirements Drop ship Items by default &Inventory Regular Lot # Serial # Settings Allow Automatic ABC Updates Over-ride Work Order Item Cost Recognition Default To Date Proportional Automatic Lot/Serial Numbering Sequence #: &Location Receive: Auto Stock: W/O Issue: &Planning Scheduling Create Planned Transfer Orders Supplied from Site: &Notes Co&mments E&xpiration Perishable Multiple Location Control Site can purchase this Item Use Default Location Location: User-Defined: Location Comment: Disallow Blank WIP Locations Cost Cate&gory: Restricted Locations Toggle MPS Time Fence: <p>You must select a Cost Category for this Item Site before you may save it. <p>You must select a Planner Code for this Item Site before you may save it. <p>You have indicated that this Item Site should be Multiple Location Controlled but there are no non-restrictive Locations in the selected Site nor restrictive Locations that will accept the selected Item.<p>You must first create at least one valid Location for this Item Site before it may be Multiple Location Controlled. The Supplied From Site must be different from this Site. Cannot find Supplied From Item Site. <p>You have indicated that this Item Site should be Multiple Location Controlled and there is existing quantity on hand.<p>You must select a default location for the on hand balance to be relocated to. <p>You have indicated that detailed inventory records for this Item Site should no longer be kept. All of the detailed inventory records will be deleted. Are you sure that you want to do this? No Item Source found Purchase Orders cannot be automatically created for this Item as there are no Item Sources for it. You must create one or more Item Sources for this Item before the application can automatically create Purchase Orders for it. <p>There is no active Item Site for this Item at %1. Shipping or receiving this Item will fail if there is no Item Site. Please have an administrator create one before trying to ship this Order. No Active Item Site Inactive Item Site <p>The Item Site for this Item at %1 is inactive. Would you like to make it active? <p>There was a problem checking or creating an Item Site for this Transfer Order Item. Stocked Control Method: Enforce Order Parameters <p>You must set a reorder level for a stocked item before you may save it. <p>You should now use the Reassign Lot/Serial # window to assign Lot/Serial numbers. Average Standard Job Planning System: Group Planned Orders Every: Requires Warranty when Purchased Auto Register Lot/Serial at Shipping <p>You must select a Site for this Item Site before creating it. <p>You must select a Cost Method for this Item Site before you may save it. <p>You can not change an Item Site to Average Costing when it has a negative Qty. On Hand. This Item Site has a quantity on hand and must be marked as active. This Item Site is used in an active order and must be marked as active. No Site <p>The desired Item Site cannot be created as there is no Site with the internal ID %1. &Site: Sold from this Site Costing Method Control This Item Site refers to an inactive Item and must be marked as inactive. Save anyway? <p>You have selected to disallow blank WIP locations but the active Bill Of Operations for this Item is either missing a Final Location or contains an Operation without a WIP Location. Are you sure you want to save this Item Site?<p>If you say 'Yes' then you should fix the Bill Of Operations. First Group itemSites Item Number Active Description Item Sites Class Code Class Code Pattern Cost Category Cost Category Pattern Item Planner Code Planner Code Pattern Show Inactive UOM QOH Loc. Cntrl. Cntrl. Method Sold Ranking ABC Class Cycle Cnt. Last Cnt'd Last Used Delete Selected Line Item? Are you sure that you want to delete the selected Item Site? View... Edit... Copy... Delete... View Inventory Availability... Issue Count Tag... N/A Never Regular None Lot # Serial # Search &for: Show &Inactive Item Sites &Close &Item Sites: &New &Edit &View &Delete Copy List Item Sites Site itemSource Base Qty Break Unit Price Currency Unit Price (%1) &Close Cannot Save Item Source You must select this Vendor that this Item Source is sold by before you may save this Item Source. Always Effective Never Expires Site Order Type Discount Percent Discount Fixed Amt. Type Method The expiration date cannot be earlier than the effective date. You must indicate the Unit of Measure that this Item Source is sold in before you may save this Item Source. You must indicate the Ratio of Inventory to Vendor Unit of Measures before you may save this Item Source. An Item Source already exists for the Item Number, Vendor, Vendor Item, Manfacturer Name and Manufacturer Item Number you have specified. Delete Item Source Price Are you sure you want to delete this Item Source price? Nominal Discount Price Fixed Percent Mixed All Into Stock Drop Ship &Delete &Cancel Item Source Active Default &Save Vendor #: Vendor Item Number: Vendor &UOM: Inventory/Vendor UOM Ratio: Bar Code: &Notes &Prices Vendor &Description &Manufacturer Vendor Currency: Effectivity Contract #: Vendor Ranking: Lead Time: Minimum Order: Order &Multiple: &Add &Edit You must select an Item that this Item Source represents before you may save this Item Source. This Item Source refers to an inactive Item and must be marked as inactive. Name: Item Number: Description itemSourceList Ranking Vendor Item Sources Vendor: &Cancel &Select Item Sources: Vend Item# Manufacturer Manuf. Item# Default itemSourcePrice &Close A Qty. Break with the specified Site, Drop Ship and Qty. already exists for this Item Source. Cannot Save Item Source Price A Qty. Break with the specified Qty. already exists for this Item Source. Item Source Price Discount Percent (Wholesale Price): Price per Unit: &Cancel Pricing Type Nominal Discount Site Restriction Drop Ship &Save Wholesale Price: Discount By Fixed Amount: Qty. Break (Inventory UOM): itemSourceSearch Item Number Description Vendor Vendor Item Vendor Descrip Non-Inventory Item Source Search S&earch for: &Cancel &Select Item Sources: Manufacturer Manuf. Item# Manuf. Descrip. Search through Item Numbers Vendor Item Numbers Description 1 Vendor Description Description 2 Manufacturer Names Manufacturer Item Numbers itemSources Item Number Description Vendor Item Sources Item Show Inactive Contract Contract Number Pattern Show Expired Show Future Contract # Effective Expires UOM Vendor Item Number Vendor UOM UOM Ratio Always Never Edit... View... Copy... Delete... Delete Item Source <p>This item source is used by existing purchase order records and may not be deleted. Would you like to deactivate it instead? <p>This item source is used by existing purchase order records and may not be deleted. Are you sure that you want to delete the Item Source for %1? &Delete Item Sources: &Close &Print &New &Edit &View List Item Sources S&earch for: Show &Inactive Item Sources Manufacturer Manuf. Item# &Copy itemSubstitute &Close Cannot Create Substitute You cannot define an Item to be a substitute for itself. Cannot Create Duplicate Substitute This substitution has already been defined for the selected Item. You may edit the existing Substitution but you may not create a duplicate. This substitution has already been defined for the selected BOM Item. You may edit the existing Substitution but you may not create a duplicate. Item Substitution Root Item: Substitution: Subsitute/Parent UOM Ratio: Ranking: &Save itemUOM &Close Invalid Ratio No Types Selected Unit of Measure Per Fractional &Cancel &Save Available Types Add > < Remove Selected Types <p>You must specify a ratio value greater than 0. <p>You must select at least one UOM Type for this conversion. items Item Number Active Description Class Code Item Types Type UOM Edit... View... Copy... Purchased Manufactured Phantom Breeder Co-Product By-Product Reference Costing Tooling Outside Process Planning Assortment Kit Error Delete... Items Show Inactive Item Number Pattern Item Description Item Group Class Code Pattern Product Category Product Category Pattern Freight Class Freight Class Pattern Delete Item Are you sure that you want to delete the Item? &Delete &Cancel List Items Show All Item Types Buy Items Make Items Sold Items itemtax Item Tax Tax Type: Tax Zone: Any Cancel Save Tax Zone Already Exists The Tax Zone you have choosen already exists for this item. labelForm Format Name is Invalid Report Name is Invalid <p>This Label Form Name already exists. Label Form &Form Name: &Report: # of Labels per &Page <p>You must enter a valid name for this Label Format. <p>You must enter a select Report for this Label Format. labelForms Form Name #/Page Label Forms: &Close &New &Edit &View &Delete List Label Forms listRecurringInvoices List Recurring Invoices Recurring Invoices: &Close New &Edit &View Invoice # Customer Ship-to Invc. Date Interval Type Until Amount Edit... View... Minute Hour Day Week Month Year None Access Denied You may not view or edit this Invoice as it references a Site for which you have not been granted privileges. locales Code Description Cannot Delete Selected Locale The selected Locale cannot be deleted as it has been assigned to one or more Users. You must reassign the Locales for these Users before you may delete the selected Locale. Locales &Close &New &Edit Cop&y &Delete List Locales location Item Number Description A System Error occurred at %1::%2. &Close Enter Location Name Location/Item Exists Location &Zone: Name: Aisle Rack Bin Ne&table &Restricted &Cancel &Save D&escription: Allowable Items: &New &Delete <p>You must enter a unique name to identify this Location. <p>An Item record already exists in the Location. You may not add another record for the same Item Duplicate Location Name Select a Site <p>You must select a Site for this Location before creating it. <p>You must enter a unique name to identify this Location in the specified Site. &Site: locations Name Description Netable Restricted Cannot Delete Selected Location <p>The selected Location cannot be deleted as there has been Inventory Transaction History posted against it.</p> Locations: &Close &Print &New &Edit &View &Delete <p>There are one or more Item Sites that use the selected Location as their default Location. You must assign the default Location for all Item Sites that use the selected Location before you may delete it.</p> <p>There is Inventory contained in the selected Location. You must move all Inventory out of the selected Location and may then set its status to inactive.</p> <p>There are one or more undistributed Location records that have been posted against the selected Locations. This probably indicates a system error.<br><br>Please contact your Systems Adminstrator to have this resolved.</p> Site List Site Locations login Log In Build: &Username: &Password: S&erver: &Database: &Cancel &Login &Options Version Initializing the Database Connector No Database Driver A connection could not be established with the specified Database as the Proper Database Drivers have not been installed. Contact your Systems Administrator. Connecting to the Database Cannot Connect to Database Server A connection to the specified Database Server cannot be made. This may be due to an incorrect Username and/or Password or that the Database Server in question cannot support anymore connections. Please verify your Username and Password and try again or wait until the specified Database Server is less busy. System Error '%1' %2 Logging into the Database login2 Log In Build: Server: demo quickstart Port: Database: Username: Password: Version Initializing the Database Connector No Database Driver Connecting to the Database <p>Sorry, can't connect to the specified xTuple ERP server. <p>This may be due to a problem with your user name, password, or server connection information. <p>Below is more detail on the connection problem: <p>%1 Logging into the Database System Error A System Error occurred at %1::%2: %3 Incomplete Connection Options Recent Login <p>A connection could not be established with the specified Database as the Proper Database Drivers have not been installed. Contact your Systems Administator. <p>One or more connection options are missing. Please check that you have specified the host name, database name, and any other required options. Cannot Connect to xTuple ERP Server Error Logging In <p>An unknown error occurred at %1::%2. You may not log in to the specified xTuple ERP Server at this time. Clear &Menu login2Options Login Options &Database: &Port: S&erver: loginOptions Login Options &Database: S&erver: &Port: Driver: PostgreSQL ODBC &Cancel &Save lotSerial Print Label Characteristic Value Number CRM Account# Name First Name Last Name Phone Save changes? <p>Notes were changed without saving. If you continue your changes will be lost. Would you like an opportunity to save your changes first? Lot#: Serial#: Is this a Lot or a Serial number? Lot Serial Lot/Serial Lot/Serial #: Characteristics &New &Edit &Delete Registrations Notes Comments lotSerialRegistration Characteristic Value Lot/Serial Registration Registration #: Type: Lot/Serial #: Qty: Register Date: Sold Date: Expire Date: CRM Account: Sales Order #: Shipment #: Contact Characteristics &New &Edit &Delete Notes You must provide a CRM Account. You must provide a registration date. You must provide a sold date. You must provide a expiration date. You must provide a lot/serial number. You must provide a quantity greater than zero. lotSerialSequence Invalid Sequence You must enter a valid Code for this Sequence. Cannot Save Sequence This Sequence number already exists. You have been placed in edit mode. A System Error occurred at %1::%2. Cannot Save Sequence Number You may not rename this Sequence number with the entered name as it is in use by another Planner code. Lot/Serial Sequence &Number: &Description: Next Value: 1 Min. Length: Prefix: Suffix: Example: lotSerialSequences Number Description Cannot Delete Sequence The selected Planner Code cannot be deleted as there are one or more Item Sites currently assigned to it. You must reassign these Item Sites before you may delete the selected Planner Code. Lot/Serial Sequences &Close &New &Edit &View &Delete maintainBudget The name is already in use by another budget. Unsaved Changes <p>The document has been changed since the last save.<br>Do you want to save your changes? Account Maintain Budget Table Parameters Accounts: Add Remove Accounting Periods: Select All Invert Unselect All Generate Table Close &Save Cannot Save Budget You must specify a name for this budget before saving. Description: Name: &Print Incomplete criteria <p>Please select at least one Period before generating the table. maintainItemCosts Element Lower Std. Cost Currency Posted Act. Cost Updated Update Actual Cost... View Costing Detail... Delete Cost... Post Actual Cost to Standard... Edit Actual Cost... New Actual Cost... !ERROR! Never Totals ????? Maintain Item Costs &Close Costing &Elements: &New &Edit &Delete Deletion of Costing Elements <p>Before a Costing Element is deleted, the system will set the Actual Cost value to 0. This helps ensure Inventory is valued correctly. Once the 0 value Actual Cost is posted to Standard, the Costing Element will be removed. maintainShipping Order/Line # Cust./Item # Name/Description Ship Via UOM Qty. At Ship Value At Ship No Dirty Yes Maintain Shipping &Close &Query &Print Stock at Shipping: Shipment # Hold Type Issue to Shipping Return Canceled Order Type Printed massExpireComponent Immediate &Close Mass Expire Component Item &Expire as of: EC&N #: &Cancel &Expire Mass Expire <p>This process will only affect active revisions. Items on pending revisions must be expired manually. massReplaceComponent Immediate The original and replacement Items must have the same Unit of Measure. &Close Mass Replace Component Item Original Item: Replacement Item: &Effective: EC&N #: &Cancel &Replace Mass Replace <p>This process will only affect active revisions. Items on pending revisions must be replaced manually. materialReceiptTrans &Close Material Receipt Transaction Transaction Date: Username: &Cancel &Post Receipt Qty.: Before After Immediate Issue to Work Order Document #: Enter Receipt Transaction Canceled You must select an Item before posting this transaction. <p>You must enter a positive Quantity before posting this Transaction. Cannot Post Transaction <p>You must enter a total cost value for the inventory to be transacted. <p>No transaction was done because Item %1 was not found at Site %2. N/A Site: Cost Adjust Value Calculated Manual Total Cost: Unit Cost: Notes menuAccounting Accounting Tools Accounts &Payable Purchase &Order &New... &List Unposted... &Post... &Voucher &List Open... &Release... New &Miscellaneous... List Unposted Vouchers &Memos &New Misc. Credit Memo... &List Unapplied Credit Memos... New &Misc. Debit Memo... &Payments &Select... Select Payments &List Selected... &Prepare Check Run... Create &Miscellaneous Check... Vie&w Check Run... &Void Check Run... Payables Workbench &Forms Print Purchase &Order... Print Check &Run... &Reports &Uninvoiced Receipts and Returns... Payables Aging &Check Register... &Voucher Register... Vendor &History... Ve&ndors... Accounts Recei&vable &Invoice &List Recurring Invoices... List Unposted Invoices C&ash Receipt &Edit List... Cash Receipt Edit List Receivables Workbench Print &Invoices... &Re-Print Invoices... Print S&tatement by Customer... Print State&ments by Customer Type... &Invoice Information... In&voice Register... Cash &Receipts... &Deposits Register... Customer &History... &Customers... General &Ledger &Journal Entry S&imple... &Series... List Unposted Journal Entries &Standard Journals &List... List &Groups... Post G&roup... &Transactions... Su&mmarized Transactions... &Bank Reconciliation &Reconcile... Reconcile Bank Account &New Adjustment... Adjustment Edit &List... &Setup... Accountin&g Standard &Journal History... Financial &Statements &New Financial Report... &List Financial Reports... View &Trial Balances... View &Financial Report... &Fiscal Calendar Fiscal &Years... Accounting &Periods... &Account C&ompanies... &Profit Center Numbers... &Subaccount Numbers... &Chart of Accounts... Open &Payables... &Open Receivables... Receivables Aging &Post Journals to Ledger... Journals... &History Summari&zed History Su&baccount Types... Bu&dget &New Budget... &List Budgets... &Tax Tax &Authorities... Tax &Zones... Tax &Classes... Tax &Codes... Tax &Types... Tax &Registrations... &Tax History... &Utilities &Forward Update Accounts... &Duplicate Account Numbers... Purge &Invoices... Post &Check... P&ost Checks... Print &Check... Tax Assi&gnments... &Update Late Customer Credit Status... &Aging... &Workbench... A&ging... &Applications... &Synchronize Companies menuCRM CRM Tools &Incident &New... &To-Do &List... Incident List To-Do List Pro&ject List Projects &Opportunity &Reports Order &Activity by Project... &Account List Accounts &Contact List Contacts A&ddress Create &Recurring Items... &Merge Contacts... Merge &CRM Accounts... &Setup... C&RM &Calendar List... &Utilities Edit O&wners menuInventory Inventory Tools &List... &Maintain... Transfer &Order &New... &List Open... &Release by Agent... &Physical Inventory &Create Count Tags by &Planner Code... by &Class Code... by &Item... Create C&ycle Count Tags... Enter Count &Slip... Enter Count &Tag... Enter &Misc. Inventory Count... &Zero Uncounted Count Tags... Tha&w Item Sites... Post Count S&lips... Post Count T&ags... &Purge Posted Count Slips... P&urge Posted Count Tags... &Reports &Frozen Item Sites... Count S&lip Edit List... Count Ta&g Edit List... Count &Slips... Count &Tags by Sit&e... R&eceiving &New Receipt... &List Unposted Receipts... List Unposted Receipts &Forms &Print Receiving Labels... &Shipping Issue to Shipping &Maintain Shipping Contents... &Ship Order... R&ecall Orders to Shipping... Packing List &Batch... Print Packing List Batch by Ship &Via... &Packing List... &Shipping Form... S&hipping Forms... Shipping &Labels by &Invoice... &Shipments by Sales &Order... by &Date... &Transactions &Adjustment... &Scrap... E&xpense... &Material Receipt... Trans&form... &Reset QOH Balances... Re&locate Inventory... Print &Item Labels... &Valid Locations by Item... &Location/Lot/Serial # Detail... &Expired Inventory... Slow &Moving Inventory... Inventory Availability by Planner Code &Substitute Availability... Time &Phased Usage Statistics... L&ocations... &Item Site List Item Sites &Workbench... Item Availability Workbench &Lot/Serial Control &Location Detail... &Detailed Inventory History... &Reassign Lot/Serial #... &Utilities U&nbalanced QOH... Adjust Avg. Cost Value... &Update Item Controls &ABC Class... &Cycle Count Frequency... &Item Site Lead Times... &Reorder Levels &Order Up To Levels Summarize &Transaction History... &Create Item Sites... &Setup... &Graphs &Inventory Error Finding Site Purchase Order &Return... by &Shipment... Maintain E&xternal Shipping Records... &Issue to Shipping... by &Sales Order... by &Transfer Order... &Backlog... &Site Transfer... &Quantities On Hand... Quantities On Hand By &Location... Inventory &Availability... &History... History by Lo&cation... History by &Lot/Serial #... &Usage Statistics... &Site menuManufacture Manufacture Tools &Work Order &New... E&xplode... &Implode... &Release... &Close... Re&prioritize... Re&schedule... Change &Quantity... &Materials &Maintain... &Transactions &Issue Material &Batch... &Item... Ret&urn Material &Scrap... Post Productio&n... C&orrect Production Posting... &Close Work Order... Post &Misc. Production... &Forms Print &Traveler... Print &Pick List... Print &Work Order Form... &Reports Work Order &Schedule Work Order Schedule by Planner Code by &Class Code... by &Item... &Material Requirements by &Work Order... by &Component Item... &Inventory Availability... &Pending Material Availability... &History by &W/O Number... Work Order &Costing... Material &Usage Variance by &BOM Item... &Utilities Pur&ge Closed Work Orders... &Setup... &Manufacture by &Site... menuProducts Products Tools &Reports by &Product Category... by &Class Code... &Bills of Materials &Single Level... &Indented... Summari&zed... &Where Used &Pending BOM Changes... Capacity &UOMs &Item &New... &List... List Items &Copy... &Workbench... &Groups... &Images... Bill Of Ma&terials List Bill of Materials Mass &Replace... Mass E&xpire... &Costing &Maintain Item Costs... Update &Actual Costs by &Item... &Post Actual Costs Post &Standard Costs &Costed BOM &Item Costs &Summary... &History... &User-Defined Costing Elements... &Utilities Unused &Purchased Items... Undefined &Manufactured Items... Bills of Ma&terials without Component Item Sites... Reassign &Class Codes... &Reassign Product Categories... &Setup... Produc&ts &Lot/Serial... menuPurchase Purchase Tools Purchase &Requests by &Planner Code... Purchase Requests by Planner Code by &Item... &Purchase Order &New... &List Open... List Open Purchase Orders &Release... Release by A&gent... &List Unposted... &Post... &Close... &Reschedule... Change &Qty... &Add Comment... &Voucher New &Miscellaneous... &Forms Print Purchase &Order... Print Purchase Orders by &Agent... Print &P/O Form... Print &Vendor Form... &Reports Item &Sites... by &Vendor... &Buy Card... &Item Sources... &Purchase Orders by &Date... Purchase &Order Items Purchase Order &History... &Receipts and Returns &Uninvoiced Receipts and Returns... Price &Variances &Delivery Date Variances Rejected &Material... V&endor &List... &Contract &Item Source &Utilities &Items without Item Sources... &Assign Item to Planner Code... Assign Item&s to Planner Code... &Setup... P&urchase &Workbench... menuSales Sales Tools &Quote &New... &List... &Sales Order &List Open... List Open Sales Orders &Billing &Invoice &Uninvoiced Shipments... Uninvoiced Shipments Select &All Shipped Orders for Billing... Select &Order for Billing... Billing &Selections... Billing Selections &List Unposted Invoices... Post &Invoices... &Credit Memo &List Unposted... &Edit List... &Post... &Forms &Print Invoices... &Re-Print Invoices... Print &Credit Memos... Re-Print Credit &Memos... &Lookup by &Customer... by &Item... by Customer &Type... by Customer &PO... Sales Order S&tatus... Print Sales &Order Form... Packing &List Batch... &Print Packing List... &Reports Su&mmarized Backlog... Summarized Backlog &Partially Shipped Orders... &Earned Commissions... B&rief Earned Commissions... &Analysis &Prospect &Customer Update Pricing Schedules... &Setup... S&ales &Workbench... &Create Invoices... &Backlog... Inventory &Availability... Availability by &Sales Order... Availability by &Customer Type... Tax History... &Bookings... T&ime Phased Bookings... Sales &History... Brie&f Sales History... Summari&zed Sales History... Time &Phased Sales History... &Groups... Item &List Price... &Update List Prices... Pricing &Schedules... Pricing Schedule Assi&gnments... S&ales... &Utilities &Reassign Customer Type by Customer Type... &Update Credit Status by Customer... Purge &Invoices... Purge Credit &Memos... &Archive Sales History... Restore &Sales History... &Return Print &Return Auth. Form... Allocate Reser&vations... Reservations by Item... Customer Workbench Pricing Item Prices by Customer &Type... Item Prices by &Customer... Item Prices by &Item... Freight Prices by Customer &Type... Freight Prices by &Customer... menuSchedule Schedule Tools &Scheduling &New Planned Order... Run &MRP by &Planner Code... Run MRP by Planner Code by &Item... &Firm Planned Orders... &Release Planned Orders... &Delete Planned Order... Delete Planned Order&s... &Reports Planned &Orders... Planned Orders &Running Availability... &Time-Phased Availability... &MRP Detail... E&xpedite Exceptions... Reorder &Exceptions... &Setup... Sche&dule menuSystem E&vent Manager... View Database &Log... P&references... Maintain &Users... Maintain &Roles... Maintain CS&V Atlases... &Reports... Community Tools &MetaSQL Statements... S&creens... Scr&ipts... Custom Command&s... &Serial Columns &Import Data &Export Data Print &Alignment Page... S&ystem xTuple.org &Home &xChange online store Discussion &Forums Bl&ogs &Bugs and Feature Requests &Utilities &Setup... My Online User &Account Online Customer &Support Online Documentation / &Wiki &Downloads &Translation Portal C&ommunity &About... Table of &Contents... Download... &Help About... %1 Version %2 %3 Interface Option is Invalid <p>The Maintain CSV Atlases utility is only available when user preferences are set to show windows as free-floating. Rescan &Privileges &Employees &New... &List... &Search... Employee &Groups... &Design &Hot Keys... &Packages... &Access Control E&xit xTuple ERP... menuWindow &Window Close &Active Window Close A&ll Windows &Cascade &Tile T&ab View Remember Position Remember Size metasqls Group Name Grade Notes Package View Delete MetaSQL? Are you sure you want to delete this MetaSQL statement? Deleting MetaSQL Statement Getting MetaSQL Statements Edit... View... Print Delete MetaSQL Statements Close New Edit MetaSQL Statements: Organize By Package miscCheck C&reate Cannot Create Miscellaneous Check <p>You must enter a date for this check. <p>You must enter an amount for this check. <p>You must select a Credit Memo for this expensed check. Invalid Amount <p>You must enter an amount less than or equal to the credit memo selected. <p>You must select an Expense Category for this expensed check. Miscellaneous Check Vendor Customer Tax Authority Vendor #: Tax Authority #: Charge To: Expense Category Apply to Credit Memo Create Credit Memo Cancel Save Date: Bank Account: Amount: Memo: Notes: Write Check To: miscVoucher Account Amount &Close Cannot Save Voucher <p>You must enter an Invoice Date before you may save this Voucher. Creating Voucher <p>You must enter a Due Date before you may save this Voucher. <p>You must enter a Distribution Date before you may save this Voucher. <p>You must enter an Amount to Distribute before you may save this Voucher. <p>You must fully distribute the Amount before you may save this Voucher. <p>You must enter a Vendor Invoice Number before you may save this Voucher. <p>A Voucher for this Vendor has already been entered with the same Vendor Invoice Number. Are you sure you want to use this number again? Reused Invoice Check Saving Voucher Saving Voucher Recurrence <p>You must enter a valid Voucher Number before continuing. Looking for Existing Voucher Getting Vendor Info Deleting Misc Distribution Getting Misc. Distributions Getting Total Getting Number Getting Voucher Deleting Voucher Getting Due Date Enter Voucher Number Miscellaneous Voucher Voucher #: Vendor #: Amount to Distribute: Balance: None Flag for &1099 Misc. Distributions Notes Advanced Invoice Date: Distribution Date: Due Date: Terms: Vendor Invoice #: Reference: &Cancel &Save Tax Zone: &New &Edit &Delete Amount Distributed: newForm New Form Search Criterion: &Close Query Results: openPurchaseOrder PO # PO Date Created By Open Purchase Orders Close Select Open Purchase Orders for : openReturnAuthorizations Cust. # Customer Disposition Created Expires Delete Return Authorization? Are you sure that you want to completely delete the selected Return Authorization? &Yes <p>One or more Line Items on this Return Authorization have associated Work Order(s). Work Orders which have not been processed will be closed but those with transaction history will not be deleted or closed upon deletion of this Return Authorization. <p>Are you sure that you want to completely delete the selected Return Authorization? &No Edit... View... Delete... Print Return Authorization Form... Undefined Return # Credit Return Replace Service Substitute List Open Return Authorizations Show Unauthorized Expired &Close &Print &New &Edit &View &Delete Return Authorizations: Access Denied You may not view or edit this Return Authorization as it references a Site for which you have not been granted privileges. openSalesOrders Cust. # Customer Open Sales Orders Earliest Latest Site Customer Type Customer Type Pattern P/O Number Sales Rep. Order # Ship-To Cust. P/O Number Ordered Scheduled Status Notes Edit... View... Copy... Delete... Enter Start Date You must enter a valid Start Date. Enter End Date You must enter a valid End Date. Print Packing List... Add to Packing List Batch... Shipment Status... Shipments... Error Print Sales Order Form... List Open Sales Orders Order Date Show Closed Issue to Shipping... Access Denied You may not view or edit this Sales Order as it references a Site for which you have not been granted privileges. openVouchers Vchr. # P/O # Vendor Vendor Invc. # Amount Deleting Voucher Changing Dist. Date Getting Journal Number Posting Voucher A/P Journal Series General Ledger Series Edit Voucher... View Voucher... Delete Voucher... Post Voucher... Getting Open Vouchers <p>You may not view or edit this Voucher as it references a Site for which you have not been granted privileges. Checking Privileges Misc. List Unposted Vouchers Vouchers: &Close &Print &New &New Misc. &Edit &View Post &Delete Print Journal Dist. Date G/L Post Date Delete Selected Vouchers <p>Are you sure that you want to delete the selected Vouchers? Distribution Date Vend. Type Access Denied opportunity Name Description Status Due Date Doc # Type Date Ext. Price Characteristic Value Default Incomplete Information You must specify the Account that this opportunity is for. You must specify a Name for this opportunity report. New... Edit... View... Delete Owner Assigned Convert Selected Quote <p>Are you sure that you want to convert the selected Quote to a Sales Order? Quote for Prospect <p>This Quote is for a Prospect, not a Customer. Do you want to convert the Prospect to a Customer using global default values? Cannot Convert Quote <p>The prospect must be manually converted to customer from either the CRM Account or Customer windows before coverting this quote. Delete Selected Quote Are you sure that you want to delete the selected Quote? &Yes &No Quote Sales Order Delete... Print... Opportunity Stage: Lead Source: Target Close: Owner: Amount: Name: Actual Close: Opp. Type: Probability: CRM Account: Number: Active % Assigned to: Priority: Additional Dates Started: Assigned: Notes To-Do's New Edit View Sales Attach Documents Convert Print Characteristics Contact &New &Edit &Delete Comments Priority opportunityList Opportunities Number Active Name CRM Acct. Owner Assigned Stage Priority Source Type Prob.% Amount Currency Target Date Actual Date User Assigned To Target Date on or After Target Date on or Before CRM Account Type Pattern Source Pattern Stage Pattern New... Edit... View... Delete Deactivate Activate Opportunity List Show Inactive opportunitySource Invalid Name You must enter a valid Name for this Opportunity Source. A System Error occurred at %1::%2. Opportunity Source &Name: &Description: opportunitySources Name Description Cannot Delete Opportunity Source The selected Opportunity Source cannot be deleted as there are one or more Opportunities currently assigned to it. You must reassign these Opportunities before you may delete the selected Opportunity Source. Opportunity Sources: &Close &Print &New &Edit &View &Delete List Opportunity Sources opportunityStage Invalid Name You must enter a valid Name for this Opportunity Stage. A System Error occurred at %1::%2. Opportunity Stage &Name: &Description: Mark Opportunity Inactive at this Stage opportunityStages Name Description Cannot Delete Opportunity Stage The selected Opportunity Stage cannot be deleted as there are one or more Opportunities currently assigned to it. You must reassign these Opportunities before you may delete the selected Opportunity Stage. Opportunity Stages: &Close &Print &New &Edit &View &Delete List Opportunity Stages opportunityType Invalid Name You must enter a valid Name for this Opportunity Type. A System Error occurred at %1::%2. Opportunity Type &Name: &Description: opportunityTypes Name Description Cannot Delete Opportunity Type The selected Opportunity Type cannot be deleted as there are one or more Opportunities currently assigned to it. You must reassign these Opportunities before you may delete the selected Opportunity Type. Opportunity Types: &Close &Print &New &Edit &View &Delete List Opportunity Types package You do not have sufficient privilege to view this window Type Name Description Package Version &Close Cannot Save Package <p>You may not rename this Package to %1 as this value is used by a different Package. Script Custom Command Stored Procedure Trigger Image MetaSQL Privilege Report Schema Table Screen View Sequence Index Name: Version: &Cancel Save Description: Developer: Notes Contents Show System Details Requirements This package requires the following packages: Dependencies The following packages depend on this package: Enabled Modifications Allowed packages Name Description Version Enabled Delete Package? <p>Are you sure you want to delete the package %1?<br>If you answer 'Yes' then you should have backed up your database first. Could Not Find Updater <p>xTuple ERP could not find the Updater application. Would you like to look for it? Find Updater Application <p>There was an error running the Updater program: <br>%1 %2<br><br><pre>%3</pre> View... Delete Enable Disable List Packages Packages: Automatically Update &Close Print Load &New Edit &View &Delete packingListBatch Customer # Customer Name Hold Type View Sales Order... None Credit Ship Pack Other Packing List Batch Form Auto Select Pick List Packing List &Close Print &Edit List Print &Batch &Delete Printed &Add S/O &Print Packing List Automatically Update Shipment # Could not initialize printing system for multiple reports. Nothing to Print <p>All of the Packing Lists appear to have been printed already. Shipment Number Required Order # Type View Transfer Order... <p>Packing Lists may only be printed for existing Shipments and there is no Shipment for this Order. Issue Stock To Shipping to create a Shipment. Selected Orders Add T/O De&lete Order Return Ship Via Printed plannedOrder You must enter or select a valid Item number before creating this Planned Order Cannot Save Planned Order The Supplied From Site must be different from the Transfer To Site. You must enter a valid Qty. Ordered before creating this Planned Order You must enter a valid Due Date before creating this Planned Order The Item and Site entered is an invalid Item Site combination. Cannot find Supplied From Item Site. ExplodePlannedOrder returned %, indicating an error occurred. A System Error occurred at %1::%2. Planned Order not Exploded The Planned Order was created but not Exploded as there is no valid Bill of Materials for the selected Item. You must create a valid Bill of Materials before you may explode this Planned Order. &Close Planned Order Planned Order #: &Cancel Qty. Ordered: Due Date: Start Date: Lead Time: &Save Purchase Order Work Order Transfer Order From Site: General Days Notes The Planned Order was created but not Exploded as Component Items defined in the Bill of Materials for the selected Planned Order Item do not exist in the selected Planned Order Site. You must create Item Sites for these Component Items before you may explode this Planned Order. Site: plannerCode Invalid Planner Code You must enter a valid Code for this Planner. Cannot Save Planner Code This Planner code already exists. You have been placed in edit mode. You may not rename this Planner code with the entered name as it is in use by another Planner code. A System Error occurred at %1::%2. Planner Code C&ode: &Description: Reschedule Unreleased Supply Orders per MRP Exceptions Delete Unreleased Supply Orders per MRP Exceptions Automatically Explode Planned Orders Single Level Explosion Multiple Level Explosion plannerCodes Code Description Cannot Delete Planner Code The selected Planner Code cannot be deleted as there are one or more Item Sites currently assigned to it. You must reassign these Item Sites before you may delete the selected Planner Code. Planner Codes: &Close &Print &New &Edit &View &Delete List Planner Codes poLiabilityDistrib Select Account You must select an Account to post the P/O Liability Distribution to. A System Error occurred at %1::%2. P/O Liability Distribution Account: Amount to Distribute: &Cancel &Post postCashReceipts A System Error occurred at %1::%2. Posting Cash Receipt #%1... Cannot Post Cash Receipt The selected Cash Receipt cannot be posted as the amount distributed is greater than the amount received. You must correct this before you may post this Cash Receipt. A Cash Receipt for Customer #%1 cannot be posted as the A/R Account cannot be determined. You must make a A/R Account Assignment for the Customer Type to which this Customer is assigned for you may post this Cash Receipt. A Cash Receipt for Customer #%1 cannot be posted as the Bank Account cannot be determined. You must make a Bank Account Assignment for this Cash Receipt before you may post it. A Cash Receipt for Customer #%1 cannot be posted due to an unknown error. Contact you Systems Administrator. Error Posting A/R Journal Series General Ledger Series No Unposted Cash Receipts There are no unposted Cash Receipts to post. Post Cash Receipts P&rint Journal &Cancel &Post postCheck &Close Post Check Bank Account: Check #: &Cancel &Post postChecks Post Checks Bank Account: Number of Unposted Checks: Print Check Journal &Cancel &Post A/P Journal Series General Ledger Series postCostsByClassCode Post Actual Costs by Class Code &Roll Up Standard Costs Post Material Costs Post Lower Level Material Costs Post Direct Labor Cost Post Lower Level Direct Labor Cost Post Overhead Cost Post Lower Level Overhead Cost Post Machine Overhead Post Lower Machine Overhead Post User Costs Post Lower Level User Costs &Cancel &Post &Select all Costs postCostsByItem A SystemError occurred at %1::%2 &Close Post Actual Costs by Item &Roll Up Standard Costs Post Material Costs Post Lower Level Material Costs Post Direct Labor Cost Post Lower Level Direct Labor Cost Post Overhead Cost Post Lower Level Overhead Cost Post Machine Overhead Post Lower Machine Overhead Post User Costs Post Lower Level User Costs &Cancel &Post &Select all Costs postCountSlips No Count Slips Posted No count slips were posted! Either there were no count slips available to be posted or an error occurred trying to post the count slips. &Cancel &Post Post Count Slips by Site postCountTags Query Error One or More Posts Failed Database Error Post Count Tags Item Sites by Thaw Frozen Inventory &Cancel &Post Class Code Planner Code postCreditMemos No Credit Memos to Post Although there are unposted Credit Memos, there are no unposted Credit Memos that have been printed. You must manually print these Credit Memos or select 'Post Unprinted Credit Memos' before these Credit Memos may be posted. There are no Credit Memos, printed or not, to post. A System Error occurred at %1::%2. Cannot Post one or more Credit Memos The G/L Account Assignments for one or more of the Credit Memos that you are trying to post are not configured correctly. Because of this, G/L Transactions cannot be posted for these Credit Memos. You must contact your Systems Administrator to have this corrected before you may post these Credit Memos. A System Error occurred at postCreditMemos::%1, Error #%2. A/R Journal Series General Ledger Series A System Error occurred at postCreditMemos::%1. &Post Post Credit Memos Post Unprinted Credit Memos P&rint Credit Memo Journal &Cancel Transaction Canceled postInvoices No Invoices to Post Although there are unposted Invoices, there are no unposted Invoices that have been printed. You must manually print these Invoices or select 'Post Unprinted Invoices' before these Invoices may be posted. There are no Invoices, printed or not, to post. Invoices for 0 Amount There are %1 invoices with a total value of 0. Would you like to post them? Post All Post Only Non-0 Cancel Cannot Post one or more Invoices The G/L Account Assignments for one or more of the Invoices that you are trying to post are not configured correctly. Because of this, G/L Transactions cannot be posted for these Invoices. You must contact your Systems Administrator to have this corrected before you may post these Invoices. A/R Journal Series General Ledger Series A System Error occurred at %1::%2, Error #%3. Transaction Canceled &Post Post Invoices Post Unprinted Invoices P&rint Journal &Cancel postJournals Post Journals Transaction Dates General Ledger Distribution Date: Preview Posting Post Cancel Query Select All Eligible Sources Print on Post Earliest Latest Source Description Accounts Payable Accounts Receivable General Ledger Inventory Management Products Purchase Order Sales Order Shipping and Receiving Work Order Other Debit Credit Entries View Journal... <p>Could not initialize printing system for multiple reports. General Ledger Series postMiscProduction Cannot Post Immediate Transfer &Close Post Miscellaneous Production &Cancel &Post Assembly &Qty. to Post: &Issue Items not on Pick List Document #: Backflush &Materials Co&mments: Post Misc. Production Transaction Canceled Invalid Quantity The quantity may not be zero. Transaction canceled. Cannot post an immediate transfer for the newly posted production as the transfer Site is the same as the production Site. You must manually transfer the production to the intended Site. Post Misc Production, Document Number A System Error occurred at interWarehousTransfer::%1, Item Site ID #%2, Site ID #%3 to Site ID #%4. &Site: Immediate &Transfer to Site: Disassembly postPoReturnCreditMemo A System Error occurred at postPoReturnCreditMemo::%1. Post PO Return Credit Memo The selected P/O Return will create a Credit Memo for the following amount. You may change this value if necessary before posting. Amount: Line Item: Reject Qty.: n/a &Cancel &Post postProduction Invalid date You must enter a valid transaction date. Same Transfer and Production Sites <p>You have selected an Interwarehouse Transfer but the Transfer and Production Sites are the same. Either choose a different Transfer Site or uncheck the Immediate Transfer box. <p>Cannot post an immediate transfer for the newly posted production as the transfer Site is the same as the production Site. You must manually transfer the production to the intended Site. Enter Quantity to Post You must enter a quantity of production to Post. &Close Post Production &Cancel Qty. Ordered: Qty. Received: Transaction &Date: Balance Due: &Qty. to Post: Backflush &Materials &Issue Items not on Pick List Close &Work Order after Posting Scrap on Post Production Notes: Transaction Canceled Immediate &Transfer to Site: Qty. to Disassemble: Qty. Disassembled: &Post postPurchaseOrder &Close Release Purchase Order &Cancel &Release postPurchaseOrdersByAgent Release Purchase Orders by Purchasing Agent Purchasing Agent: &Cancel &Release All Purchasing Agents Purchase Orders Released %1 Purchase Orders have been released. postStandardJournal Cannot Post Standard Journal You must enter a Distribution Date before you may post this Standard Journal. A System Error occurred at %1::%2. &Close Post Standard Journal Standard Journal: Distribution Date: Reverse Journal Entries &Cancel &Post Schedule postStandardJournalGroup Cannot Post Standard Journal Group You must enter a Distribution Date before you may post this Standard Journal Group. A System Error occurred at %1::%2. &Close Post Standard Journal Group Reverse Journal Entries Standard Journal Group: Distribution Date: &Cancel &Post Schedule postVouchers No Vouchers to Post There are no Vouchers to post. Cannot Post Voucher The Cost Category(s) for one or more Item Sites for the Purchase Order covered by one or more of the Vouchers that you are trying to post is not configured with Purchase Price Variance or P/O Liability Clearing Account Numbers or the Vendor of these Vouchers is not configured with an A/P Account Number. Because of this, G/L Transactions cannot be posted for these Vouchers. You must contact your Systems Administrator to have this corrected before you may post Vouchers. A System Error occurred at %1::%2, Error #%3. A/P Journal Series General Ledger Series A System Error occurred at %1::%2. %3 P&rint Journal &Post Post Vouchers &Cancel prepareCheckRun Prepare Check Run Bank Account: Check Date: &Cancel &Prepare No Bank Account You must select a Bank Account before you may continue. priceList Schedule Source Qty. Break Qty. UOM Price Price UOM Percent Fixed Amt. Type Currency Price (in Base) Price (in %1) N/A Customer Cust. Ship-To Cust. Type Cust. Type Pattern Sale List Price Nominal Discount Markup Price List Quantity: List Price: Site: Unit Cost: &Cancel &Select &Items: Cust. Ship-To Pattern pricingScheduleAssignment A System Error occurred at %1::%2. Pricing Schedule Assignment Selected Customer: Selected Customer Ship-To: Selected Customer Type: Customer Type Pattern: Pricing Schedule: Selected Cust. Ship-To Pattern: Cannot Save Pricing Schedule Assignment <p>You must select a Pricing Schedule. <p>This Pricing Schedule Assignment already exists. pricingScheduleAssignments Ship-To Customer # Cust. Type Pricing Schedule Pricing Schedule Assignments: &Close &Print &New &View &Edit &Delete List Pricing Schedule Assignments Cust. Name printArOpenItem Print A/R Open Item A/R Open Item: Credit Memo Cash Deposit Check Certified Check Master Card Visa American Express Discover Card Other Credit Card Cash Wire Transfer Other Invoice Debit Memo A/P Check Cash Receipt printCheck Check Already Printed <p>The selected Check has already been printed. Cannot Print Check <p>The selected Check cannot be printed as the Bank Account that it is to draw upon does not have a valid Check Format assigned to it. Please assign a valid Check Format to this Bank Account before attempting to print this Check. Check Printed Was the selected Check printed successfully? EFT Output File Could not open %1 for writing EFT data. &Close Mark Check as Voided Check Number Already Used <p>The selected Check Number has already been used. <p>The recipient of this check has been configured for EFT transactions. Do you want to print this check for them anyway?<p>If you answer 'Yes' then a check will be printed. If you say 'No' then you should click %1. <p>Would you like to mark the selected Check as Void and create a replacement check? Print Check Bank Account: &Cancel &Print Create EFT File Check: Next Check #: Print Anyway? Could Not Open File printChecks <p>Some of the recipients of checks in this check run have been configured for EFT transactions. Do you want to print checks for them anyway?<p>If you answer 'Yes' then a check will be printed. If you say 'No' then you should click %1 first and <i>then</i> click %2. All Checks Printed <p>Did all the Checks print successfully? No Checks Printed <p>No Checks were printed for the selected Bank Account. <p>Some but not all of the checks in this run are for Vendors configured to receive EFT transactions. Do you want to create the EFT file anyway?<p>If you answer 'Yes' then an EFT file will be created but you will have to click Print to get the remainder of the checks in this run. If you say 'No' then you will get a warning when you click Print asking whether you want to print checks for EFT recipients. EFT Output File Could not open %1 for writing EFT data. Print Checks # of Checks to Print: Bank Account: &Cancel &Print Create EFT File Next Check #: Print Anyway? Could Not Open File Order Checks By Name printChecksReview Check Number Action Printed Voided Replace Review Printed Checks Make any necessary adjustments by marking the listed Checks appropriately. Complete &Unmark Mark as &Printed &Void Void && &Replace Select All printCreditMemo Print Credit Memo Credit Memo #: printCreditMemos Print Credit Memos printInvoice Print Invoice First Invoice #: <p>Invoice %1 has a total value of 0.<br/>Would you like to post it anyway?</p> Could not post Invoice %1 because of a missing exchange rate. printInvoices Print Invoices All Ship Vias Selected Ship Via Getting Invoices to Print <p>Invoice %1 has a total value of 0.<br/>Would you like to post it anyway?</p> Could not post Invoice %1 because of a missing exchange rate. Updating Invoice printItemLabelsByClassCode Could not locate report Could not locate the report definition the form "%1" Print Item Labels by Class Code Report Name: Cancel &Print printLabelsByInvoice Could not locate report Could not locate the report definition the form "%1" Print Labels by Invoice &Invoice #: Report Name: Labels: from to Cancel &Print printLabelsByOrder Could not locate report <p>Could not locate the report definition for the form "%1" Print Labels by Order Report Name: Labels: from to Cancel &Print printLabelsBySo Could not locate report Could not locate the report definition the form "%1" Print Labels by Sales Order Sales Order #: Report Name: Labels: from to printLabelsByTo Could not locate report Could not locate the report definition the form "%1" Print Labels by Transfer Order Report Name: Labels: from to printMulticopyDocument Print Multiple Copies of Document &Cancel &Print Post after Printing Database Error Posting %1 #%2 Cannot Post %1 Post Anyway? Posting Canceled Transaction Canceled Processing %1 #%2 No Documents to Print There aren't any documents to print. Mark Documents as Printed? <p>Did all of the documents print correctly? Cannot Print Could not initialize printing system for multiple reports. Cannot Find Form <p>Cannot find form '%1' for %2 %3. It cannot be printed until the Form Assignment is updated to remove references to this Form or the Form is created. Invalid Parameters <p>Report '%1' cannot be run. Parameters are missing. A/R Statement Credit Memo Invoice Pick List Packing List Purchase Order Quote Sales Order printOptions Print Options Print Automatically Always use this printer printPackingList Print Packing List Form Auto Select Pick List Packing List Shipment#: Customer Name: Customer Phone: Purchase Order #: Order Date: Error Getting Shipment Error Finding Form You must enter a Sales Order Number You must enter a Transfer Order Number Cannot Print Getting Recipient Information Error Finding Shipment Shipment for different Order <p>Shipment %1 is for Sales Order %2. Are you sure the Shipment Number is correct? <p>Shipment %1 is for Transfer Order %2. Are you sure the Shipment Number is correct? Error Finding Packing List Data Reprint printPackingListBatchByShipvia Print Packing List Batch by Ship Via Ship Via: &Cancel &Print Form Auto Select Packing List Pick List Schedule Date Range Earliest Latest Enter a Valid Start and End Date You must enter a valid Start and End Date for this report. Could not initialize printing system for multiple reports. printPoForm Print Purchase Order Form Report Name: Getting Purchase Order Form printPurchaseOrder Cannot Print P/O <p>The Purchase Order you are trying to print has not been completed. Please wait until the Purchase Order has been completely saved. Has P/O Been Saved? Print Purchase Order printPurchaseOrdersByAgent No Purchase Orders to Print There are no posted, unprinted Purchase Orders entered by the selected Purchasing Agent to print. Print Purchase Orders by Purchasing Agent Purchasing Agent: Copies: &Vendor &Internal # of C&opies: &Cancel &Print Could not initialize printing system for multiple reports. printQuote Print Quote Quote: Report: [ Select a Report ] Getting Quote Form printRaForm Could not locate report Could not locate the report definition the form "%1" Report Name: Cancel &Print Print Return Authorization Form Return Auth.: printShippingForm You must enter a Shipment Number. You must select a Shipping Form to print. Cannot Print Shipping Form Getting Shipment Getting Order Getting Shipping Form <p>Could not find shipment on this order. Getting Sales Order Print Shipping Form Ship To: Shipping &Form: Shipping Charges: Shipment#: Order#: Could not find data printShippingForms Cannot Print Shipping Forms You must indicate if you wish to print Shipping Forms for New and/or Changed Shipments. Print Shipping Forms Print Shipping Forms for new Shipments Print Shipping Forms for Changed Shipments printSinglecopyDocument Print One Copy of Document Cancel Print Database Error Processing %1 #%2 No Documents to Print There aren't any documents to print. Mark Documents as Printed? <p>Did all of the documents print correctly? Cannot Print Could not initialize printing system for multiple reports. Cannot Find Form <p>Cannot find form '%1' for %2 %3. It cannot be printed until the Form Assignment is updated to remove references to this Form or the Form is created. Invalid Parameters <p>Report '%1' cannot be run. Parameters are missing. A/R Statement Credit Memo Invoice Pick List Packing List Purchase Order Quote Sales Order printSoForm Print Sales Order Form Sales Order #: Report Name: Getting Sales Order Form printStatementByCustomer Enter a Valid Customer Number <p>You must enter a valid Customer Number for this Statement. Invoice Debit Memo Credit Memo Deposit <p>No statement is available for the specified Customer and Asof Date. Database Error No Statement to Print Print Statement by Customer As of : printStatementsByCustomerType Getting Customers to Print Invoice Debit Memo Credit Memo Deposit Print Statements by Customer Type As of : Grace Period: &Only Print Customers with Past Due Amounts printVendorForm Could not locate report Could not locate the report definition the form "%1" Print Vendor Form Vendor: Report Name: Cancel &Print printWoForm Could not locate report Could not locate the report definition the form "%1" Print Work Order Form Form Name: Cancel &Print printWoPickList Print W/O Pick List Co&pies: &Cancel &Print Could not initialize printing system for multiple reports. printWoTraveler Print W/O Traveler &Cancel &Print Release &Work Order Documents: Print P&ick List Print Packing List Print Work Order Label Could not initialize printing system for multiple reports. productCategories Category Description Cannot Delete Product Category You cannot delete the selected Product Category because there are currently items assigned to it. You must first re-assign these items before deleting the selected Product Category. A System Error occurred at %1::%2. Delete Unused Product Categories Are you sure that you wish to delete all unused Product Categories? &Yes &No Product Categories: &Close &Print &New &Edit &View &Delete Delete &Unused List Product Categories productCategory Cannot Create Product Category A Product Category with the entered code already exists.You may not create a Product Category with this code. A Product Category with the entered code already exists. You may not create a Product Category with this code. A System Error occurred at %1::%2. Product Category Category: Description: Missing Category You must name this Category before saving it. profitCenter &Close Profit Center Number Number: Description: &Cancel &Save Cannot Save Profit Center You must enter a valid Number. Duplicate Profit Center Number A Profit Center Number already exists for the one specified. Change All Accounts? <p>The old Profit Center Number might be used by existing Accounts. Would you like to change all accounts that use it to Profit Center Number %1?<p>If you answer 'No' then change the Number back to %2 and Save again. profitCenters Number Description Profit Centers: &Close &New &Edit &View &Delete List Profit Centers project Number Name Description Hours Balance Expense Balance No Project Number was specified. You must specify a project number before saving it. You must specify a due date before saving it. Cannot Save Project Project task not found. Actual hours have been posted to this project task. Actual expenses have been posted to this project task. Error #%1 encountered while trying to delete project task. Cannot Delete Project Task Could not delete the project task for one or more reasons. Project Name: Sales Orders Work Orders Purchase Orders Number: Status: Concept In-Process Complete CRM Account: Additional Activity... Summary Total Hours Budgeted: TextLabel Total Hours Actual: Balance: Total Expenses Budgeted: Total Expenses Actual: Tasks Print &New &Edit &View &Delete Notes Comments Documents Advanced Assignable Orders Owner: Assigned To: Due: Assigned: Started: Completed: projects Projects Number Name Description Status Owner Assigned To CRM Account Contact Due Assigned Started Completed Budget Hrs. Actual Hrs. Balance Hrs. AssignedTo Start Start Date Start End Date Due Start Date Due End Date Assigned Start Date Assigned End Date Completed Start Date Completed End Date One or more Quote's refer to this project. One or more Sales Orders refer to this project. One or more Work Orders refer to this project. One or more Purchase Requests refer to this project. One or more Purchase order Items refer to this project. One or more Invoices refer to this project. Error #%1 encountered while trying to delete project. Cannot Delete Project Could not delete the project for one or more reasons. Project Number Project Number for the new Project: Due Date Offset from old Due Date: Project Number for the new Project cannot be blank. The Project Number entered for the new Project already exists. Source Project not found. Error #%1 encountered while trying to copy project. Cannot Copy Project Could not copy the project for one or more reasons. Concept In-Process Complete Undefined Show Complete List Projects prospect Quote # Quote Date &Close Cancel Cannot Save Prospect <p>The newly entered Prospect Number cannot be used as it is currently in use by '%1'. Please enter a different Prospect Number. Delete Selected Quote Are you sure that you want to delete the selected Quote? You must enter a number for this Prospect Saving Prospect Deleting Quote Getting Quote Edit... View... Delete... Print... Getting Prospect Prospect CRM Account... Prospect Name: Active Prospect #: Save Contact Notes Quotes New Edit View Delete Print Sales Rep: Tax Zone: Site: prospects Prospects Show Inactive Prospect Number Pattern Prospect Name Pattern Contact Name Pattern Phone Pattern Email Pattern Street Pattern City Pattern State Pattern Postal Code Pattern Country Pattern Number Name First Last Phone Email Address City State Country Postal Code Delete? <p>Are you sure you want to delete the selected Prospect? Error deleting purchaseOrder # Status Item Description Orgl. Due Date Due Date Now Ordered Returned Vouchered Unit Price Ext. Price Freight Freight Recv. Freight Vchr. Std. Cost Demand Type Order A System Error occurred at %1::%2. Cannot Create P/O Purchase Order Exists An Unreleased Purchase Order already exists for this Vendor. Would you like to use this Purchase Order? Click Yes to use the existing Purchase Order otherwise a new one will be created. &View &Close Main You may not save this Purchase Order until you have selected a Tax Zone. Cannot Save Purchase Order You may not save this Purchase Order until you have entered a valid Purchase Order Number. You may not save this Purchase Order until you have selected a Vendor. You may not save this Purchase Order until you have created at least one Line Item for it. This Purchase Order has been released. You may not set its Status back to 'Unreleased'. Delete Purchase Order Item? <p>Are you sure you want to delete this Purchase Order Line Item? &Delete C&lose Destination SO WO Enter Purchase Order # The Purchase Order number you entered is already in use. Please enter a different number. <p>This Purchase Order does not have any line items. Are you sure you want to delete this Purchase Order? View Sales Order... Edit Sales Order... View Work Order... Edit Work Order... Purchase Order Documents &Save &Cancel Header Information Tax Zone: None Order #: Order Date: Terms: Status: Purchasing Agent: ... Ship Via: FOB: Unreleased Sales Order #: Ship To: Drop Ship Vendor Address Vendor: Release Date: Address: Line Items &New &Edit Currency: Subtotal: Tax: Misc. Freight: Freight Total: Total: Notes Comments Unposted Open Closed Partial Received Close Purchase Order Item? <p>Are you sure you want to close this Purchase Order Line Item? Delete Purchase Order? <p>Are you sure you want to delete this Purchase Order and all of its associated Line Items? Save Quick Entry Data? Do you want to save your Quick Entry changes? Removing row from view failed Quick Entry Save Quick Entries Delete Quick Entry Print on Save <p>A Purchase Order cannot be automatically created for this Item as there are no Item Sources for it. You must create one or more Item Sources for this Item before the application can automatically create Purchase Orders for it. Receiving Site: UOM Vend. Item# Manufacturer Manuf. Item# purchaseOrderItem A System Error occurred at %1::%2. &Close Invalid Order Quantity Invalid Due Date Purchase Order Item Line #: &Cancel &Save Vend. Item Number: Vendor Description: Vendor UOM: Inv./Vend. UOM Ratio: Min. Order Qty.: Order Qty. Mult.: Qty. Ordered: Qty. Received: Unit Price: Due Date: Extended Price: Notes Comments Name Value Sales Order # Work Order # <p>You must select an Item Number before you may save. <p>The quantity that you are ordering is below the Minimum Order Quantity for this Item Source. You may continue but this Vendor may not honor pricing or delivery quotations. <p>Do you wish to Continue or Change the Order Qty? <p>The quantity that you are ordering does not fall within the Order Multiple for this Item Source. You may continue but this Vendor may not honor pricing or delivery quotations. <p>Do you wish to Continue or Change the Order Qty? Invalid Unit Price <p>The Unit Price is above the Maximum Desired Cost for this Item.<p>Do you wish to Continue or Change the Unit Price? <p>You must enter a due date before you may save this Purchase Order Item. <p>You must specify an Expense Category for this non-Inventory Item before you may save. <p>You must select a Tax Type before you may save. <p>You may not purchase a Job Item without an associated demand. Cannot Save Purchase Order Item <p>The Due Date that you are requesting does not fall within the Lead Time Days for this Item Source. You may continue but this Vendor may not honor pricing or delivery quotations or may not be able to deliver by the requested Due Date. <p>Do you wish to Continue or Change the Due Date? Selected Item Missing Cost <p>The selected item has no Std. Costing information. Please see your controller to correct this situation before continuing. Update Price? <p>The Item qty. has changed. Do you want to update the Price? Update Quantity? <p>You must order at least %1 to qualify for this price. Do you want to update the Quantity? Line Freight: Characteristics ... Order Number: Inventory Non-Inventory Vendor Source Revision Bill of Materials Bill of Operations <p>You must select a Supplying Site before you may save. Zero Order Quantity <p>The quantity that you are ordering is zero. <p>Do you wish to Continue or Change the Order Qty? Invalid Item/Site <p>The Item and Site you have selected does not appear to be a valid combination. Make sure you have a Site selected and that there is a valid itemsite for this Item and Site combination. Site: UOM: Tax Type: None Recoverable Project #: Earliest Avail. Date: Manufacturer Name: Item Number: Description Remarks Demand Order #: Line # Tax: purchaseOrderList Purchase Orders &Purchase Orders: &Cancel &Select Number Vendor Agent Order Date First Item purchaseRequest Invalid Purchase Request Number You must enter a valid Purchase Request number before creating this Purchase Request No Item Number Selected You must enter or select a valid Item number before creating this Purchase Request Invalid Quantity Ordered You have entered an invalid Qty. Ordered. Please correct before creating this Purchase Request. Invalid Due Date Entered You have entered an invalid Due Date. Please correct before creating this Purchase Request. A System Error occurred at %1::%2. Purchase Request Purchase Request #: &Close C&reate Qty. Ordered: Due Date: Project #: Notes: Invalid Site The selected Site for this Purchase Request is not a "Supplied At" Site. You must select a different Site before creating the Purchase Request. Site: purgeClosedWorkOrders Purge Closed Work Orders Cutoff Date: &Cancel &Purge purgeCreditMemos Enter Cutoff Date You must enter a valid cutoff date before purging Invoice Records. Delete Invoice Records You will not be able to re-print a Credit Memo if you delete it. Are you sure that you want to delete the selected Credit Memos? Yes No Purge Credit Memos Cu&t Off Date: &Cancel &Purge purgeInvoices Enter Cutoff Date You must enter a valid cutoff date before purging Invoice Records. Delete Invoice Records This function will purge Invoices and all of the associated documents including: Return Authorizations, Lot/Serial Registrations, Sales Orders, Shipments, and Billing. The results of the process are saved in the log file purgeInvoices.log. You will not be able to re-print an Invoice if you delete that Invoice's Records. Are you sure that you want to delete the selected Invoice Records? Purge Invoices in progress... Cancel Yes No Purge Invoices Cu&t Off Date: &Cancel &Purge purgePostedCountSlips &Close Purge Posted Count Slips Cutoff Date: &Cancel &Purge purgePostedCounts &Cancel Purge Posted Count Tags Cutoff Date: &Purge quoteList Quotes &Cancel &Select Quotes: Order # Customer Ordered Scheduled quotes Quote # Customer Quotes Site Exclude Prospects Customer Type Customer Type Pattern P/O Number Sales Rep. Start Date End Date Status Quote Date Expire Date Notes Print... <p>One or more of the selected Quotes have been converted. You cannot convert an already converted Quote. Open Converted Undefined Copy Edit... View... Delete... Convert Selected Quote(s) <p>Are you sure that you want to convert the selected Quote(s) to %1(s)? Can not Convert Cannot Convert Quote Delete Selected Quotes Quote for Prospect <p>The following Quotes could not be converted. <p>Are you sure that you want to delete the selected Quotes? A System Error occurred deleting Quote #%1 %2. <p>This Quote is for a Prospect, not a Customer. Do you want to convert the Prospect to a Customer using global default values? Convert to S/O... Convert to Invoice... <p>The prospect must be manually converted to customer from either the CRM Account or Customer windows before coverting this quote. List Quotes Show Expired Show Converted Access Denied You may not view, edit, or convert this Quote as it references a Site for which you have not been granted privileges. reasonCode Invalid Reason Code You must enter a valid code for this Reason Code. Cannot Save Reason Code The Code you have entered for this Reason Code already exists. Please enter in a different Code for this Reason Code. Reason Code C&ode: &Description: Document Type All Document Types Selected: A/R Credit Memo A/R Debit Memo Return Authorization reasonCodes Code Description Cannot Delete Reason Code You may not delete the selected Reason Code as there are Credit Memo records that refer it. You must purge these records before you may delete the selected Reason Code. You may not delete the selected Reason Code as there are A/R Open Item records that refer it. You must purge these records before you may delete the selected Reason Code. Reason Codes: &Close &Print &New &Edit &View &Delete List Reason Codes reassignClassCodeByClassCode Reassign Class Code by Class Code Selected Class Code: Class Code Pattern: New Class Code: &Cancel &Reassign Missing Class Code Pattern <p>You must enter a Class Code Pattern. reassignCustomerTypeByCustomerType Reassign Customer Type by Customer Type Selected Customer Type: Customer Type Pattern: New Customer Type: &Cancel &Reassign Missing Customer Type Pattern <p>You must enter a Customer Type Pattern. reassignLotSerial Location Lot/Serial # Expires Qty. Select Source Location You must select a Source Location before reassigning its Lot/Serial #. Enter Quantity to Reassign You must enter a quantity to reassign. Enter New Lot Number to Reassign You must enter a New Lot Number to reassign. &Close Never Reassign Lot/Serial # &Cancel &Reassign Source: Qty. to Reassign: New Lot Number: New Expiration Date: Warranty New Warranty Date: Enter a valid date You must enter a valid expiration date before you can continue. Site: reassignProductCategoryByProductCategory Reassign Product Category by Product Category Selected Product Category: Product Category Pattern: New Product Category: &Cancel &Reassign Missing Product Category Pattern <p>You must enter a Product Category Pattern. recallOrders Ship Date Order # Customer Purge Invoice? <p>There is an unposted Invoice associated this Shipment. This Invoice will be purged as part of the recall process. <p> OK to continue? Recall Orders to Shipping &Close Shipped Orders: &Recall Shipment # Invoiced Show Invoiced Orders Access Denied You may not recall this Shipment as it references a Site for which you have not been granted privileges. reconcileBankaccount Cleared Date Doc. Type Doc. Number Notes Currency Exch. Rate Base Amount Amount Cannot Reconcile Account Missing Opening Date Missing Ending Date Invalid End Date The end date cannot be earlier than the start date. Yes No ????? JS Currency Exchange Rate New Rate: Save Bank Reconciliation? <p>Do you want to save this Bank Reconciliation? Reconcile Bank Account Currency: Bank Account: Opening Balance: Ending Balance: Start Date: End Date: &Cancel Exchange Rate Edit Reconcile Update Add Adjustment Difference: Cleared Balance: Cancel Bank Reconciliation? <p>Are you sure you want to Cancel this Bank Reconciliation and delete all of the Cleared notations for this time period? <p>There was an error creating records to reconcile this account: <br><pre>%1</pre> <p>There was an error trying to reconcile this account. Please contact your Systems Administrator. <p>No Opening Date was specified for this reconciliation. Please specify an Opening Date. <p>No Ending Date was specified for this reconciliation. Please specify an Ending Date. Balances Do Not Match The cleared amounts do not balance with the specified beginning and ending balances. Please correct this before continuing. Save Dates already reconciled The date range you have entered already has reconciled dates in it. Please choose a different date range. Deposits: Payments: Cleared Deposits: Cleared Payments: registrationKey Registration Key Customer: Expiration Date: Max Concurrent Users: Invalid Registration Key <p>The Registration Key you have entered does not appear to be valid. Unlimited Unknown registrationKeyDialog Expired Registration Key New Registration Key &Cancel &Select rejectCode Invalid Reject Code You must enter a valid code for this Reject Code. Cannot Save Reject Code This Reject code already exists. You have been placed in edit mode. You may not rename this Reject code with the entered name as it is in use by another Reject code. Reject Code C&ode: &Description: rejectCodes Code Description Cannot Delete Reject Code You may not delete the selected Reject Code as there are Material Reject records that refer it. You must purge these records before you may delete the selected Reject Code. Reject Codes: &Close &Print &New &Edit &View &Delete List Reject Codes relativeCalendarItem Cannon Create Duplicate Calendar Item A Relative Calendar Item for the selected Calendar exists that has the save Offset and Period as this Calendar Item. You may not create duplicate Calendar Items. Relative Calendar Item Calendar Name: Period Name: Offset: Period Length: Days Weeks Months Years &Cancel &Save releasePlannedOrdersByPlannerCode Enter Cutoff Date Please enter a valid Cutoff Date. Release Planned Orders by Planner Code Cutoff Date: Append planned transfer orders to existing unreleased transfer orders &Cancel &Release Only Release Firmed releaseTransferOrdersByAgent Transfer Orders Released %1 Transfer Orders have been released. Release Transfer Orders by Agent All Agents Agent: &Cancel &Release releaseWorkOrdersByPlannerCode Enter Cutoff Date Please enter a valid Cutoff Date. Release Work Orders by Planner Code Cutoff Date: by Start Date by Due Date &Cancel &Release <p>Could not initialize printing system for multiple reports. Print Correctly? <p>Did the documents all print correctly? Documents: Print P&ick List Print &Routing Print Packing List Print Work Order Label relocateInventory Location Lot/Serial # Qty. &Close Undefined Relocate Inventory Set Target Location as Default on Move &Cancel &Move Source: Target: Qty. to Move: Notes: You must select an Item before posting this transaction. <p>You must enter a positive Quantity before posting this Transaction. <p>You must select a Source Location before relocating Inventory. <p>You must select a Target Location before relocating Inventory. <p>Please select different Locations for the Source and Target. Cannot Post Transaction Transaction Date: Site: reports Name Grade Description Package Getting Reports Error Loading Report Deleting Report Delete Report? <p>Are you sure that you want to completely delete the selected Report? Report Definitions: Organize By Package &Close &Print &New &Edit &Delete List Report Definitions reprintCreditMemos C/M # Doc. Date Cust. # Customer Report Re-Print Credit Memos reprintInvoices Invoice # Doc. Date Cust. # Customer Balance Report Error Getting Invoices Re-Print Invoices Only include Invoices with Balance Search for Invoice Number: Total Amount reprintMulticopyDocument Reprint Multiple Copies of Document &Close Query &Print Select Documents to reprint: Printing %1 #%2 No Documents to Print There aren't any documents to print. Could not initialize printing system for multiple reports. Cannot Find Form <p>Cannot find form '%1' for %2 %3.It cannot be printed until the FormAssignment is updated to remove references to this Form or the Form is created. Invalid Parameters <p>Report '%1' cannot be run. Parameters are missing. Getting Documents A/R Statement Credit Memo Invoice Pick List Packing List Purchase Order Quote Sales Order reprioritizeWo Cannot Reschedule Released W/O The selected Work Order has been Released. You must Recall this Work Order before Rescheduling it. &Close A System Error occurred at %1::%2. Reprioritize Work Order &Cancel &Reprioritize Current Priority: New Priority: Reprioritize Child Work Orders (if any) reschedulePoitem P/O Not Open The P/O line item you are trying to reschedule does not belong to an Open P/O. Invalid Reschedule Date <p>You must enter a reschedule due date before you may save this Purchase Order Item. Reschedule Purchase Order Item Line Item: &Cancel &Reschedule Due Date: Current Rescheduled rescheduleWo Cannot Reschedule Released W/O The selected Work Order has been Released. You must Recall this Work Order before Rescheduling it. &Close Valid Dates Required You must specify a valid Start/Due date. Reschedule Work Order &Cancel &Reschedule Start Date: Due Date: Current Rescheduled Reschedule Child Work Orders (if any) Post Comment Comment Type: reserveSalesOrderItem Invalid Quantity to Issue to Shipping <p>Please enter a non-negative, non-zero value to indicate the amount of Stock you wish to Reserve for this Order Line. Reserve Stock to Order Sales Order #: Line #: Order Item To Reserve Qty: &Cancel &Reserve Balance Due: Qty. at Shipping Unreserved Qty: Qty. Reserved: Availability On Hand: Reserved: Unreserved: UOM: Site: resetQOHBalances Reset Selected QOH Balances? Reset Quantity-On-Hand Balances &Cancel &Reset Transaction Date: Username: <p>You are about to issue Adjustment Transactions for all Item Sites within the selected Site and Class Code(s) that are not Lot/Serial or Location Controlled to adjust their QOH values to 0.<br>Are you sure that you want to do this? returnAuthCheck Cannot Create Miscellaneous Check <p>You must enter a date for this check. <p>You must enter an amount for this check. <p>You must select a bank account for this check. Bank Uses Different Currency <p>The currency of the bank account is not the same as the currency of the credit memo. You may not use this bank account. Return Authorization Check Customer: &Cancel &Save Credit Memo: Date: Bank Account: Amount: Check Number: Memo: Notes: returnAuthItemLotSerial &Close No Lot/Serial Number Selected You must select a Lot/Serial Number. Return Authorization Item Lot/Serial Lot/Serial #: &Cancel &Save Qty. &Auth.: Qty. UOM: Qty. Registered: Qty. Received: returnAuthorization # Kit Seq. # Item UOM Description Status Disposition Warranty Sold Authorized Received To Receive Shipped Extended Credited Sale Price Net Due Orig. Order New Order Sched. Date Item Type Invalid Disposition <p>You must enter a Disposition. Invalid Timing <p>You must enter a Timing. <p>You must enter a Credit Method. Cannot Save Return Authorization You may not save this Return Authorization until you have entered a valid Authorization Number. Work Order Closed The current Return Authorization Line Item has associated Work Order which has not been processed. This Work Order will be closed upon deletion of this line item. Work Order Unchanged Getting A/R Open Creating R/A Credit Memo Manual Freight? <p>Manually editing the freight will disable automatic Freight recalculations. Are you sure you want to do this? Automatic Freight? <p>Manually clearing the freight will enable automatic Freight recalculations. Are you sure you want to do this? Invalid Credit Method <p>You may not enter a Disposition of Credit and a Credit By of None. No Misc. Charge Account Number <p>You may not enter a Misc. Charge without indicating the G/L Sales Account number for the charge. Please set the Misc. Charge amount to 0 or select a Misc. Charge Sales Account. Total Less than Zero <p>The Total must be a positive value. Invalid Receiving Site <p>You must enter a valid Receiving Site. Invalid Shipping Site <p>You must enter a valid Shipping Site. Invalid Sales Order This sales order is already linked to open return authorization %1. <p>Are you sure that you want to delete the the selected Line Item(s)? Credit Return Replace Service Ship Credit By 'None' not allowed Non-Inventory N/A New Credit Memo Created <p>A new CreditMemo has been created and assigned #%1 Credit Card Processing Error Credit Card Processing Warning Credit Card Processing Note Could not find a Credit Card to use for this Credit transaction. Return Authorization &Save &Cancel &Header Information Auth. #: Expire Date: Auth. Date: None Sales Rep.: Commission: Reason Code: % Disposition: Substitute [ no default ] Credit/Ship: Immediately Upon Receipt Credit by: Credit Memo Check Credit Card Print on Save Shipping Zone: Sale Type: Original Order #: New Order #: Bill To Undefined Ship To Ship From# &View Authorize &Line Clear Authori&zation Enter &Receipt... Rece&ive All &Post Receipts Re&fund N&otes Co&mments Cust. Type: Copy to Ship-from -> Tax Zone: Project #: Name: Cust. PO #: Incident: &Line Items &New &Edit Close &Delete &Authorize All CVV Code: Currency: Subtotal: Misc. Charge Description: Misc. Charge: Misc. Charge Credit Account: Freight: Tax: Total Credit: Net Due: Edit Line... Close Line... Open Line... Delete Line... View Original Order... Edit New Order... View New Order... Edit New Order Line... View New Order Line... New Order Shipment Status... New Order Shipments... Site Credit Price Create Line Items for this Order <p>You must create at least one Line Item for this Return Authorization before you may save it. The current Return Authorization Line Item has an associated Work Order with Transaction History. This Work Order will not be closed/deleted upon deletion of this line item. Receiving Site Warning This Return Authorization has line items with a different Receiving Site. You may need to review the line items. Shipping Site Warning This Return Authorization has line items with a different Shipping Site. You may need to review the line items. <p>This Return Authorization has authorized credit amounts. You may not set the Credit By to 'None' unless all credit amounts are zero. Recv. Site: Ship Site: returnAuthorizationItem &Close Item site not found <p>No valid item site record was found for the selected item at the selected shipping site. Reschedule W/O? <p>The Scheduled Date for this Line Item has been changed. Should the W/O for this Line Item be Re-Scheduled to reflect this change? Change W/O Quantity? <p>The quantity authorized for this Return Authorization Line Item has been changed. Should the quantity required for the associated Work Order be changed to reflect this? <p>Only Items Sites using the Job cost method may have a Disposition of Service. N/A In %1: Delete Work Order <p>You are requesting to delete the Work Order created for the Sales Order Item linked to this Return. Are you sure you want to do this? Return Authorization Item Auth. #: Line #: Original Order #: New Order #: &Cancel &Save Disposition: Credit Return Replace Service Ship Reason Code: Qty. Sold: Qty. Received: Qty. Shipped: &Restock Charge %: Net Unit Price: ... [ Pick One ] Customer P/N: &Price UOM: Extended Price: Sale Discount %: Sc&heduled Date: Warranty Availability On Hand: Allocated: Unallocated: On Order: Available: Leadtime: Create Work Order W/O Qty.: W/O Due Date: W/O Status: Costs Unit Cost: List Price: Sale Price: List Discount %: Tax Tax Type: None Tax: Alternate Cost of Sales Account: Co&mments Lot/Serial &Edit Delete &New Over Authorize <p>The authorized quantity exceeds the original sold quantity on the original Sales Order. Do you want to correct the quantity? Cannot use Service Disposition Cannot change Disposition <p>A work order is associated with this Return. First delete the work order, then change this disposition. Qty. &Auth.: Qty. &UOM: Registered Authorized Received <p>You must enter a valid Schedule Date. &Supply &Lot/Serial &Detail No&tes A&ccounting &Recv. Site: Ship Site: Authorize &only these Lot/Serial Numbers Show Availability returnAuthorizationWorkbench Auth. # Customer Authorized Expires Disposition Credit By Awaiting Amount Currency Amount (%1) New Credit Memo Created <p>A new CreditMemo has been created and assigned #%1 Credit Card Processing Error Credit Card Processing Warning Credit Card Processing Note Could not find a Credit Card to use for this Credit transaction. Credit Return None Memo Check Card Customer not selected <p>Please select a customer. Invalid Dates <p>Invalid dates specified. Please specify a valid date range. Undefined Replace Service Payment Receipt Shipment Never Closed Edit... View... Process... Return Authorization Workbench &Close Review Returns Awaiting Include Expired Unauthorized Include Closed Return Authorizations: &Query &Print &New Edit View Due Credit Post Credit Memos Immediately Print Credit Memo Returns Eligible for Credit: Process Credit Memo Credit Card Access Denied You may not view or edit this Return Authorization as it references a Site for which you have not been granted privileges. returnWoMaterialBatch Invalid date You must enter a valid transaction date. Cannot return Work Order Material This Work Order has had material received against it and thus the material issued against it cannot be returned. You must instead return each Work Order Material item individually. A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2, Error #%3. A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2. Return Work Order Material Batch Transaction &Date: &Cancel Material Return Transaction Canceled &Post returnWoMaterialItem Invalid date You must enter a valid transaction date. Select Work Order You must select the Work Order from which you with to return Materal &Close A System Error occurred at %1::%2. &Cancel Qty. to Return: Material Return Transaction Canceled Return Work Order Material Item &Post UOM: Transaction &Date: QOH Before: QOH After: reverseGLSeries Reversal for Journal # A System Error occurred at reverseGLSeries::%1. Cannot Reverse Series A valid distribution date must be entered before the G/L Series can be reversed. Cannot Post G/L Series You must enter some Notes to describe this transaction. Error Reversing G/L Series An Unknown Error was encountered while reversing the G/L Series. Reversed G/L Series Reversing Journal #%1 was sucessfully created. Journal Number: Distribution Date: JOURNAL NUMBER &Cancel &Post Reverse Journal Notes: sale &Close Enter Sale Name You must enter a name for this Sale before saving it. Cannot Save Sale You cannot enter a duplicate name for this Sale before saving it. Enter Start Date You must enter a start date for this Sale. You must enter an end date for this Sale. Invalid End Date The start date cannot be earlier than the end date. Enter End Date A System Error occurred at %1::%2. Sale Schedule: &Name: &Description: &Cancel &Save saleType Sale Type &Code: &Description: Active You must enter a valid Sale Type Code before continuing Cannot Save Sale Type saleTypes List Sale Types Sale Type: &Close &Print &New &Edit &View &Delete Code Active Description Error deleting Sale Type sales Name Schedule Start End Delete Selected Sale? <p>Are you sure that you want to delete the selected Sale? Sales: &Close &New &Edit &Delete List Sales salesAccount Any <p>You must select a Sales Account for this Assignment. <p>You must select a Credit Memo Account for this Assignment. <p>You must select a Cost of Sales Account for this Assignment. <p>You must select a Returns Account for this Assignment. <p>You must select a Cost of Returns Account for this Assignment. <p>You must select a Cost of Warranty Account for this Assignment. <p>You cannot specify a duplicate Warehouse/Customer Type/Product Category for the Sales Account Assignment. Cannot Save Sales Account Assignment Sales Account Assignment Credit &Memo Account: C&ost of Sales Account: Inventory Sa&les Account: Shipping Zone: Sale Type: &Returns Account: Cost of R&eturns Account: Cost of W&arranty Account: &Site: salesAccounts Cust. Type Shipping Zone Sale Type Prod. Cat. Sales Accnt. # Credit Accnt. # COS Accnt. # Any N/A Sales Account Assignments: &Close &Print &New &View &Edit &Delete Returns Accnt. # Cost of Returns Accnt. # Cost of Warranty Accnt. # List Sales Account Assignments Site salesCategories Category Description Cannot Delete Sales Category The selected Sales Category cannot be deleted as there are unposted Invoice Lines assigned to it. You must reassign these Invoice Lines before you may delete the selected Sales Category. The selected Sales Category cannot be deleted as there are closed Invoice Lines assigned to it. Would you like to mark the selected Sales Category as inactive instead? &Yes &No The selected Sales Category cannot be deleted as there are A/R Open Items assigned to it. Would you like to mark the selected Sales Category as inactive instead? A System Error occurred at %1::%2. Sales Categories: &Close &Print &New &Edit &View Co&py &Delete List Sales Categories salesCategory <p>You must specify a name for the Sales Category. <p>You cannot specify a duplicate name for the Sales Category. <p>You must select a Sales Account Number for this Sales Category before you may save it. <p>You must select a Prepaid Account Number for this Sales Category before you may save it. <p>You must select an A/R Account Number for this Sales Category before you may save it. Cannot Save Sales Category Sales Category Ca&tegory: &Description: Receivables Account: &Active Non Inv Sales Account: Prepaid Account: salesHistoryInformation &Close Sales History Information Order Number: Invoice Number: Order Date: Invoice Date: &Cancel &Save Bill-To Ship-To Shipped: Extended Price: Unit Price: Extended Cost: Unit Cost: Is a Credit Card payment Sales Rep.: Commission: Paid Site: salesOrder # Item Description Status Sched. Date Ordered Shipped At Shipping Balance Price Extended Sequence Type Number Active Name Expiration Date Quote View Supply Type Order Number Cannot Save Sales Order You must enter an Order Date for this order before you may save it. You must enter an Scheduled Date for this order before you may save it. You must select a Customer for this order before you may save it. Only opportunities from Customers or Prospects can be related. You must enter a Customer P/O for this Sales Order before you may save it. <p>You must create at least one Line Item for this order before you may save it. <p>You must enter a valid Number for this order before you may save it. Auto Generated Project from Sales Order. Open Line... Edit Line... Close Line... Delete Line... Return Stock Issue Stock... Issue Line Balance View Purchase Order... Edit Purchase Order... Release P/R... View Purchase Request... View Work Order... Edit Work Order... Enter S/O # You must enter a S/O # for this Sales Order before you may continue. Enter Quote # You must enter a Quote # for this Quote before you may continue. <p>The Quote Order Number you have entered already exists. Please enter a new one. Selected Customer on Credit Hold Selected Customer on Credit Warning Cannot Delete Related Purchase Order Access Denied You may not delete this Sales Order as it refers to a Site for which you have not been granted privileges. <p>Are you sure that you want to completely delete the selected Sales Order? <p>A work order for one of the line items on the selected Sales Order is already in progress. Are you sure that you want to completely delete the Sales Order? Getting Work Order Information Cannot Delete Sales Order Could not find the ccpay records! Error Closing Deleting Sales Order Invalid Cash Payment Cash Payment Amount Received cannot be greater than Balance. Reschedule Work Order? <p>Should any associated work orders be rescheduled to reflect this change? Close Open Delete Selected Line Item? Cancel Sales Order? Cancel Quote? Record Currently Being Edited Cannot Lock Record for Editing No MasterCard VISA American Express Discover Other Cannot Process Credit Card Transaction Insufficient Inventory Update all prices? Do you want to recalculate all prices for the order including: - Line items - Taxes - Freight ? Order Date Required Prices can not be recalculated without a valid Order Date. Schedule Date Required Prices can not be recalculated without a valid Schedule Date. Customer Cannot Buy at Quantity <p>One or more items are marked as exclusive and no qualifying price schedule was found. Update all schedule dates? Changing this date will update the Schedule Date on all editable line items. Is this what you want to do? Can not reschedule all Items Some exclusive items may not be rescheduled because there is no valid price schedule for the date entered. Proceed rescheduling only qualifying items? Can not reschedule Items No Items can be rescheduled because there are no valid price schedules for the date entered. Sales Order Order #: ... &Save &Close &Header Information Pack Date: From Quote: Sales Rep.: Commission: % Copy to Ship-to -> &F.O.B.: Ship &Via: Hold Type: Clea&r Save and Add to Packing List &Batch Terms Order &Date: Scheduled Da&te: None E&xpire: More Quote Status: Bill-To Name: Ship-To Cust. &PO #: Credit Shipping Packing Relat&ionships &Order Notes Co&mments Shippin&g Notes Doc&uments Pa&yment Shipping Chgs.: Shipping Form: Ship Complete &Line Items &New &Edit &Delete Issue Stock Issue Line Bal. Require sufficient Inventory Currency: At Shipping: Show Canceled Line Items Margin: Subtotal: Tax: Misc. Charge Description: Misc. Charge: Misc. Charge Sales Account: Freight: Total: Authorized CC Payments: Tax Zone: Sale Type: Shipping Zone: Opportunity: Credit Card New Edit Move Up Move Down Authorize Charge Amount: CVV Code: Cash Amount Received: Funds Type: Check/Document #: Post to: Distribution Date: Application Date: Check/Document Date: Use Alternate A/R Account Sales Category: Post Cash Payment Cannot Close Item The item cannot be Closed at this time as there is inventory at shipping. <p>This Customer does not use Blanket P/O Numbers and the P/O Number you entered has already been used for another Sales Order.Please verify the P/O Number and eitherenter a new P/O Number or add to theexisting Sales Order. <p>You may not enter a Misc. Charge without indicating the G/L Sales Account number for the charge. Please set the Misc. Charge amount to 0 or select a Misc. Charge Sales Account. Could not delete Quote. <p>The selected Customer has been placed on a Credit Hold and you do not have privilege to create Sales Orders for Customers on Credit Hold. The selected Customer must be taken off of Credit Hold before you may create a new Sales Order for the Customer. Cust. Price Cust. Discount You must select a Sales Rep. for this order before you may save it. You must select the Terms for this order before you may save it. You must select a Ship-To for this order before you may save it. <p>You must Post Cash Payment before you may save it. Overapplied? The Cash Payment is more than the Balance. Do you want to continue? Bank Currency? <p>This Sales Order is specified in %1 while the Bank Account is specified in %2. Do you wish to convert at the current Exchange Rate?<p>If not, click NO and change the Bank Account in the POST TO field. <p>The selected Customer has been placed on a Credit Warning and you do not have privilege to create Sales Orders for Customers on Credit Warning. The selected Customer must be taken off of Credit Warning before you may create a new Sales Order for the Customer. <p>Are you sure that you want to delete the selected Line Item? <p>You have deleted all of the Line Items for this Sales Order. Would you like to cancel this Sales Order? <p>You have deleted all of the order lines for this Quote. Would you like to cancel this Quote?. <p>The record you are trying to edit is currently being edited by another user. Continue in View Mode. <p>There was an unexpected error while trying to lock the record for editing. Please report this to your administator. Delete Sales Order? <p>Are you sure you want to delete this Sales Order and its associated Line Items? Delete Quote? <p>Are you sure you want to delete this Quote and its associated Line Items? Could not release this Sales Order record. <p>You must enter a Customer P/O for this Sales Order before you may process a creditcard transaction. <p>This Customer does not use Blanket P/O Numbers and the P/O Number you entered has already been used for another Sales Order. Please verify the P/O Number and either enter a new P/O Number or add to the existing Sales Order. <br>Line Item %1 Line Item %1 Qty UOM Price UOM Show Reservations... Unreserve Stock Reserve Stock... Reserve Line Balance From Return Authorization: Print on Save Return Reserve Stock Res. Line Bal. Credit Card Error Credit Card Processing Error Credit Card Processing Warning Credit Card Processing Note Transaction Canceled Issue to Shipping <p>The Total must be a positive value. Kit Seq. # Site Quote Order Number Already exists. <p>There is not enough Inventory to issue the amount required of Item %1 in Site %2. <p>Item Number %1 in Site %2 is a Multiple Location or Lot/Serial controlled Item which is short on Inventory. This transaction cannot be completed as is. Please make sure there is sufficient Quantity on Hand before proceeding. Site: Allocated Credit: Freight Weight: Outstanding Credit: Firm Firm Line... Soften Line... Issue Canceled Inventory history not found Manual Freight? <p>Manually editing the freight will disable automatic Freight recalculations. Are you sure you want to do this? Automatic Freight? <p>Manually clearing the freight will enable automatic Freight recalculations. Are you sure you want to do this? Project #: Balance: salesOrderInformation None Credit Ship Pack Other Sales Order Information Order #: Order Date: Ship Date: Pack Date: Ship &Via: Hold Type: &Close Bill-To Address: Phone: Ship-To Address: Return Shipping Site: salesOrderItem # Item Number Description UOM Pend. Alloc. Total Alloc. On Order QOH Availability Name Value Next New Quote Item Cannot Save Sales Order Item Reschedule P/R? <p>You must enter a valid Ship-To # before saving this Sales Order Item. Vendor # Vendor Name Qty Break Base Price Site LT Allocated Reorder Lvl. Available Earliest Latest P/O # Vendor Due Date Recv. Date Vend. Item # Rcvd/Rtnd Qty. Purch. Cost Recv. Cost Customer Doc. # Invoice # Ord. Date Invc. Date Shipped Unit Price Ext. Price Currency Base Unit Price Base Ext. Price Unit Cost Ext. Cost <p>You must select a valid Site before saving this Sales Order Item. Change Qty Ordered? This Qty Ordered/Qty UOM will result in a fractional Inventory Qty for this Item. This Item does not allow fractional quantities. Do you want to change the Qty Ordered? <p>You must enter a Substitute Item before saving this Sales Order Item. Quantity Can Not be Updated The Purchase Order Item this Sales Order Item is linked to is closed. The quantity may not be updated. Reschedule Work Order? <p>The Supply Order Due Date for this Line Item has changed.<p>Should the W/O for this Line Item be rescheduled? <p>The Supply Order Due Date for this Line Item has changed.<p>Should the P/R for this Line Item be rescheduled? Reschedule P/O? <p>The Supply Order Due Date for this Line Item has changed.<p>Should the P/O for this Line Item be rescheduled? Change Work Order Quantity? <p>The Supply Order Quantity for this Line Item has changed from %1 to %2.<p>Should the W/O quantity for this Line Item be changed? Change P/R Quantity? <p>The Supply Order Quantity for this Line Item has changed from %1 to %2.<p>Should the P/R quantity for this Line Item be changed? Change P/O Quantity? <p>The Supply Order Quantity for this Line Item has changed from %1 to %2.<p>Should the P/O quantity for this Line Item be changed? changePoQty failed Error Checking Characteristics Change Characteristics? <p>Should the characteristics for the associated supply order be updated? Error with Characteristics Characteristic Scheduled Date Item quantity Price UOM <p>The %1 has changed. Do you want to update the Price? Customer Cannot Buy at Quantity Create Purchase Order Cannot Create P/O <p> Purchase Orders cannot be automatically created for this Item as there are no Item Sources for it. You must create one or more Item Sources for this Item before the application can automatically create Purchase Orders for it. C&reate Work Order C&reate Purchase Request Nominal Discount Fixed Percent Mixed Substitute... Received Returned Not Vouchered NonInv - N/A Delete Work Order Delete Purchase Order Item deletepoitem failed Delete Purchase Request Cannot Update Item The Purchase Order Item this Sales Order Item is linked to is closed. The quantity may not be updated. In %1: Unsaved Changed Can not delete PO Purchase Order linked to this Sales Order Item will not be affected. The Purchase Order should be closed or deleted manually if necessary. Kit At least one child item from this kit has already shipped. At least one child item from this kit is at shipping. The Purchase Order Item this Sales Order Item is linked to is closed. The date may not be updated. Invalid Item for Date This item may not be purchased in this date. Please select another date or item. Sales Order Item Order #: Line #: Pre&vious Ne&xt Cance&l Item S&ite: Customer P/N: Su&bstitute for: Qty. &UOM: &Net Unit Price: Pric&e UOM: Cust Discount %: Suppl&y Item Sources Substitutes On Hand: Allocated: Unallocated: On Order: Available: Create Supply Order History Costs History Sales History List Price Discount %: Margin: Unit Cost Markup %: N&otes Co&mments Accountin&g Alternate Cost of Sales Account: Alternate Revenue Account: &Close &Save &Qty. Ordered: Extended Price: Sc&heduled Date: &Promised Date: Qty.: Due Date: Status: Drop Ship Override Price: Ch&aracteristics De&tail Customer Price: Unit Cost: List Price: <p>You must enter a valid Quantity Ordered before saving this Sales Order Item. <p>You must enter a Price before saving this Sales Order Item. <p>You must enter a valid Schedule Date before saving this Sales Order Item. changePrQty failed Update Price? <p>This item is marked as exclusive and no qualifying price schedule was found. You may click on the price list button (...) next to the Unit Price to determine if there is a minimum quantity the selected Customer may purchase. C&reate Supply Order <p>You are requesting to delete the Work Order created for this Sales Order Item.Are you sure you want to do this? <p>You are requesting to delete the Purchase Order Item created for this Sales Order Item. The associated Purchase Order will also be deleted if no other Purchase Order Item exists for that Purchase Order. Are you sure you want to do this? <p>You are requesting to delete the Purchase Request created for this Sales Order Item. Are you sure you want to do this? deletePr failed Create Purchase Request <p>You have made some changes which have not yet been saved! Would you like to save them now? Tax: None Return Auth. #: ... Qty. Shipped: Warranty Create Work Order Costs Tax Type: Invalid Quantity This UOM for this Item does not allow fractional quantities. Please fix the quantity. Lead Time: Price Base Price: <p>Before an Order may be created, a valid Supplied at Site must be selected. Unreserve Sales Order Item <p>The quantity ordered for this Sales Order Line Item has been changed. Reservations have been removed. <br>Line Item %1 Line Item %1 Supplying Site: Show Availability Inventory Dependencies Show dependencies as Indented BOM salesOrderList Sales Orders &Cancel &Select Sales Orders: Order # Customer P/O # Ordered Scheduled salesRep Error checking for existing Sales Rep You must enter a Number for this Sales Rep. You must enter a Commission Rate for this Sales Rep. This Sales Rep is used by an active Customer and must be marked as active. This Sales Rep is used by an active Ship To and must be marked as active. Cannot Save Sales Rep Error saving Sales Rep Database Error CRM Account Error <p>The Sales Rep should now have a CRM Account, but that CRM Account could not be found. Please check the database server log for errors. Sales Representative &Number: N&ame: Comm. &Prcnt.: CRM Account... &Active salesReps Number Name Active Delete Sales Rep? <p>Are you sure you want to delete the selected Sales Rep? Error Deleting Error getting Sales Reps Edit Sales Rep... View Sales Rep... Delete Sales Rep... Sales Representatives: &Close &Print &New &Edit &View &Delete List Sales Representatives scrapTrans Scrap Transaction &Close <p>You must enter a Quantity before posting this Transaction. Transaction Date: Username: &Cancel &Post Before After Scrap Qty.: Document #: Notes: Transaction Canceled You must select an Item before posting this transaction. Cannot Post Transaction <p>No transaction was done because Item %1 was not found at Site %2. &Site: scrapWoMaterialFromWIP Invalid date You must enter a valid transaction date. Cannot Scrap from WIP You must enter a quantity of the selected W/O Material to Scrap. The component quantity to scrap must be less than or equal to quantity issued. You must enter a quantity of the W/O Top Level Item to Scrap. A System Error occurred scrapping material for Work Order ID #%1, Error #%2. Top Level Item A System Error occurred scrapping material for Work Order ID #%1 %2 Transaction &Date: Top-Level Finished Item &Cancel &Post Qty.: Production receipt already posted Scrap Component Qty. Scrapped from WIP: Scrap Work Order Material Transaction Canceled Posting of scrap against disassembly work orders is not supported. scriptEditor &Close <p>You must enter a valid name for this Script. Saved but Not Moved <p>The script was saved to its original location but could not be moved. Getting Script Open File Could not import file Could not export file &Name: No&tes: &Enabled &Save Package: [ Not in a Package ] &Order: &Import Script &Export Script <p>The script appears incomplete are you sure you want to save? Script (*.script *.js) Save Changes? Do you want to save your changes? Cannot Save CRM Account Database only File only Database and File Error Saving The script was not saved properly Move to different package? Do you want to move this script to the %1 package? Script Editor - %1 Save Script File Continue Search? <p>'%1' was not found. Start search from the beginning? Not Found <p>'%1' was not found. [*]Script Editor Find scripts Name Description Order Enabled Deleting Script Getting Scripts List Scripts Scripts: Organize By Package &Close &New &Edit &Delete Package Delete Script? <p>Are you sure that you want to completely delete the selected script? searchForEmp You do not have sufficient privilege to view this window Code Number Manager Dept. Shift View... Edit... View Manager... Edit Manager... Search for Employees S&earch for: Show &Inactive Employees &Close Print Employees: &New &Edit &View Site First Last Search through Employee Codes Manager Codes and Numbers Employee Numbers Departments Employee Name Shifts selectBankAccount Select Bank Account Bank Account: &Cancel &Select selectBillingQty Select Billing Quantity Sales Order #: Line #: Ordered: Shipped: Balance: Uninvoiced: Close this &Line After Billing To &Bill: &Cancel &Save Tax Type: None Qty UOM: selectOrderForBilling # Item Ordered Shipped Returned Uninvoiced Selected Extended Close &Cancel No Ship Date Entered No Misc. Charge Account Number Select Order for Billing Sales Order #: Order Date: Ship Date: Invoice Date: Cust. Name: P/O Number: Ship-To Name: Tax Zone: Currency: &Close &Save &Edit Order Show Closed Line Items Select &Balance Ship Via: Close all Open Items Misc. Charge Description: Freight: Subtotal: Total: Payment Received: <p>You must enter a Ship Date before selecting this order for billing. <p>You may not enter a Misc. Charge without indicating the G/L Sales Account number for the charge. Please set the Misc. Charge amount to 0 or select a Misc. Charge Sales Account. None Tax: UOM Site Line Items &Edit Ca&ncel Misc. Amount: Misc. Charge Account: Notes selectPayment Cannot Select for Payment You must specify an amount smaller than or equal to the Balance. Currencies Do Not Match In %1: Select Payment Balance Owed: Total Owed: Bank Account: Doc. Date: Due Date: Document #: P/O #: Vendor #: Terms: Payment Amount: &Cancel &Save Discount: Edit Discount <p>You must specify an amount greater than zero. If you want to clear this selection you may do so from the screen you selected this payment from. <p>You must select a Bank Account from which this Payment is to be paid. <p>The currency selected for this payment (%1) is not the same as the currency for the Bank Account (%2). Would you like to use this Bank Account anyway? selectPayments Vendor Doc. Type Doc. # Inv. # P/O # Due Date Doc. Date Amount Amount (%1) Running Amount (%1) Selected Selected (%1) Running Selected (%1) Discount (%1) Currency Status Can not do Payment Item is On Hold apopen not found Voucher On Hold Open Can not change Status <p>You cannot set this item as On Hold. This Item is already selected for payment. Select Payments &Close &Print All Select all Due Clear Selections Clear Selection Apply all Credits Use default Bank Account: Discount Select... Select Line Select all Discounts Debit Memo Due Date: On or Before Between and Open Items: selectShippedOrders Select Shipped Orders for Billing &Cancel &Select selectedPayments Bank Accnt. Vendor Doc. Type Doc. # Inv. # P/O # Selected Currency Running All Bank Accounts Bank Account: &Close &Print Payment Selections: &Edit Clear Selection List Selected Payments Running (%1) Voucher Debit Memo setup Setup Module: TextLabel All Accounting Sales CRM Manufacture Purchase Schedule Inventory Products System Credit Card Database Encryption Import/Export Registration Search Path Cost Categories Expense Categories Payables Assignments Receivables Assignments Sales Assignments Sales Categories Bank Accounts Bank Adjustment Types Calendars Characteristics Check Formats Class Codes Comment Types Countries Currencies Customer Form Assignments Customer Types Departments Exchange Rates Forms Freight Classes Images Incident Categories Incident Priorities Incident Resolutions Incident Severities Label Forms Locales Lot/Serial Sequences Opportunity Sources Opportunity Stages Opportunity Types Planner Codes Product Categories Reason Codes Reject Codes Sales Reps Sale Types States and Provinces Shipping Charge Types Shipping Forms Shipping Zones Ship Vias Site Types Tax Codes Terms Titles Units of Measure Vendor Types Configure Accounting Mappings Master Information Could not load UI <p>There was an error loading the UI Form from the database. shipOrder # Item Number Description UOM Qty. Cannot Ship Order &Close Ship Order Ship To: Bill To: Select for Billing Create and Print Invoice Print Packing List &Cancel &Ship Items to Ship: Shipment Value: Freight: Ship Via: Tracking Number: Already Invoiced <p>This shipment appears to have been invoiced already. It will not be selected for billing again. <p>Although Sales Order %1 was successfully shipped and selected for billing, the Invoice was not created properly. You may need to create an Invoice manually from the Billing Selection. <p>Although Sales Order %1 was successfully shipped, it was not selected for billing. You must manually select this Sales Order for Billing. Nothing to ship <p>You may not ship this Sales Order because no stock has been issued to shipping for it. Shipment/Order mismatch Shipment #: <p>Receiving inventory for this Transfer Order failed although Shipping the Order succeeded. Manually receive this order using the Enter Order Receipt window. Transfer Order <p>You may not ship this Transfer Order because no stock has been issued to shipping for it. <p>Shipment #%1 either is not part of Order #%2 or has already shipped. Please change either the Order # or Shipment #. Receive Immediately One or more required accounts are not set or set incorrectly. Please make sure that all your Cost Category and Sales Account Assignments are complete and correct. Date Shipped: Order #: shipTo &Close Ship-To Customer #: &Cancel &Save Active Default Ship-&To #: &Name: Address Sales Rep.: Comm&ission: Ship Zone: Tax Zone: Defaults: Ship Via: Shipping Form: Shipping Charges: Contact General Notes Shipping Notes Question Saving Address Change This One Change Address for All Cancel <p>There are multiple uses of this Ship-To Address. What would you like to do? Cannot Save Ship To You must enter a valid Name. <p>There was an error saving this address (%1). Check the database server log for errors. None shipToList Name: Address: Address City, State, Zip Customer #: shipToSearch Address City, State, Zip shipVia Cannot Save Ship Via The new Ship Via information cannot be saved as the new Ship Via Code that you entered conflicts with an existing Ship Via. You must uniquely name this Ship Via before you may save it. Ship Via Code: Description: You must enter a valid Code. shipVias Code Description Ship Vias: &Close &New &Edit &Delete List Ship Vias shippingChargeType Cannot Save Shipping Charge Type The new Shipping Charge Type information cannot be saved as the new Shipping Charge Type that you entered conflicts with an existing Shipping Charge Type. You must uniquely name this Shipping Charge Type before you may save it. Shipping Charge Type Name: Description: Customer may pay Freight Charges Cannot Save Shipping Charge You must enter a valid Name. shippingChargeTypes Name Description Cannot Delete Shipping Charge Type The selected Shipping Charge Type cannot be delete as one or more Customers are assigned to it. You must reassigned these Customers before you may delete the selected Shipping Charge Type. The selected Shipping Charge Type cannot be delete as one or more ShipTo's are assigned to it. You must reassigned these ShipTo's before you may delete the selected Shipping Charge Type. The selected Shipping Charge Type cannot be delete as one or more Sales Orders are assigned to it. You must reassigned these Sales Orders before you may delete the selected Shipping Charge Type. The selected Shipping Charge Type cannot be delete as one or more Shipments are assigned to it. You must reassigned these Shipments before you may delete the selected Shipping Charge Type. The selected Shipping Charge Type cannot be delete as one or more Invoices are assigned to it. You must reassigned these Invoices before you may delete the selected Shipping Charge Type. Shipping Charge Types: &Close &New &Edit &Delete List Shipping Charge Types shippingForm Format Name is Invalid You must enter a valid name for this Bill of Lading Format. Report Name is Invalid You must enter a select report for this Bill of Lading Format. Shipping Form &Form Name: &Report: shippingForms Form Name Cannot Delete Shipping Form The selected Shipping Form cannot be deleted as there are one or more Customers assigned to use it. You must reassign these Customers before you may delete the selected Shipping Form. The selected Shipping Form cannot be deleted as there are one or more Ship-Tos assigned to use it. You must reassign these Ship-Tos before you may delete the selected Shipping Form. Shipping Forms: &Close &New &Edit &View &Delete List Shipping Forms shippingInformation # Item At Shipping Net Wght. Tare Wght. Gross Wght. No Ship Date Entered Issue Additional Stock for this Order Line to Shipping... View Order Line... Shipping Information Order Date: Cust. Name: Order #: Cust. Phone: P/O Number: Ship To Name: Items Notes Freight: Ship Date: Shipment Header Ship Via: Shipping Chgs.: Shipping Form: <p>You must enter a Ship Date before selecting this order for billing. Shipment #: Order on Hold Return ALL Stock Issued for this Order Line to the Site... shippingZone No Name Entered You must enter a valid name before saving this Shipping Zone. Cannot Save Shipping Zone You have entered a duplicate Name for this Shipping Zone. Please select a different name before saving. A System Error occurred at %1::%2. Shipping Zone &Name: &Description: shippingZones Name Description Cannot Delete Shipping Zone The selected Shipping Zone cannot be deleted as there are one or more Ship-Tos assigned to it. You must reassign these Ship-Tos to a different Shipping Zone before you may delete the selected Shipping Zone. Shipping Zones: &Close &Print &New &Edit &View &Delete List Shipping Zones siteType Cannot Save Site Type You must uniquely name this Site Type before you may save it. The new Site Type information cannot be saved as the new Site Type Name that you entered conflicts with an existing Site Type. You must uniquely name this Site Type before you may save it. Site Type Code: Description: siteTypes Code Description Delete Site Type Are you sure that you want to delete the selected Site Type? &Delete &Cancel Site Type in Use The selected Site Type cannot be deleted as it still contains Sites. You must reassign these Sites before deleting this Site Type. Edit Site Type... View Site Type... Delete Site Type... List Site Types Site Types: &Close &Print &New &Edit &View splitReceipt Split Receipt Order Number: Line #: &Cancel &Split Date Received: Qty. Received: Freight: Qty. Split: Freight Split: standardJournal Account Notes Debit Credit &Close The Name you have entered for this Standard Journal already exists. Please enter in a different Name for this Standard Journal. A System Error occurred at %1::%2. Standard Journal Name: Description: &Cancel &Save Transactions: Totals: Debits Credits &New &Edit &View &Delete Notes: Cannot Save Standard Journal You must enter a valid Name. standardJournalGroup Name Description To Apply Applied Effective Expires &Close Cannot Save Standard Journal Group You must enter a Name for this Standard Journal Group before you may save it. The Name you have entered for this Standard Journal Group is already in use. Please enter in a different Name for this Standard Journal Group. Always Standard Journal Group Name: Description: &Save Show Expi&red Standard Journal Members Show &Future Standard Journal Members Member Items: &New &Edit &View &Delete standardJournalGroupItem Always Effective Never Expires &Close Enter Effective Date You must enter an effective date for this Standard Journal Group Item. Enter Expiration Date You must enter an expiration date for this Standard Journal Group Item. Invalid Expiration Date The expiration date cannot be earlier than the effective date. Standard Journal Group Item Standard Journal: May be Applied any Amount of Times May only be applied Times &Cancel &Save standardJournalGroups Name Description Standard Journal Groups: &Close &Print &New &Edit &View &Delete Post List Standard Journal Groups standardJournalItem &Close Incomplete Data You must enter an amount value. You must enter an account. G/L Transaction Not In Base Currency G/L transactions are recorded in the base currency. Do you wish to convert %1 %2 at the current rate? A System Error occurred at %1::%2. Standard Journal Item Amount: Sense Debit Credit Account #: Notes: &Cancel &Save standardJournals Name Description Standard Journals: &Close &Print &New &Edit &View &Delete Post List Standard Journals state <p>You must select a country. <p>You must enter a name for the state/province. Cannot Save State/Province There is already another state/province for %1 with the same name or abbreviation. Save? <p>Do you want to try saving this State/Province? [*]State or Province Country: [ pick a country ] Abbreviation: Name: states Abbreviation Name Country Delete State? <p>The state %1 is used in addresses. Are you sure you want to delete it? <p>Are you sure you want to delete this state? List States and Provinces States and Provinces in: [ All Countries ] &Close &New &Edit &View &Delete storedProcErrorLookup The selected Quote cannot be attached because the Quote cannot be found. The selected Quote cannot be attached because the Opportunity cannot be found. The selected Quote cannot be attached because it is already associated with an Opportunity. You must detach this Quote before you may attach it. The selected Sales Order cannot be attached because the Sales Order cannot be found. The selected Sales Order cannot be attached because the Opportunity cannot be found. The selected Sales Order cannot be attached because it is already associated with an Opportunity. You must detach this Sales Order before you may attach it. This Credit Memo was not found. This Tax Authority was not found. This Invoice was not found. Freight Tax Type was not found. This Bill was not found. This Quote was not found. This Sales Order was not found. This Transfer Order was not found. The selected Accounting Period cannot be closed because it is already closed. The selected Accounting Period cannot be closed because there is a gap between the end of the previous Period and the start of this Period. You must edit either the previous Perod or this Period to eliminate the gap. The selected Accounting Period cannot be closed because the previous Period is not closed. You must close the previous Period before you may close this Period. The selected Accounting Period cannot be closed because there is a gap between the end of this Period and the start of the next Period. You must edit either this Period or the next Period to eliminate the gap. The selected Accounting Period cannot be closed because it ends in the future. The selected Accounting Period cannot be closed because it is the last period in the Fiscal Year and the next Fiscal Year has not been defined yet. Create the next Fiscal Year before closing this Accounting Period. The selected Fiscal Year cannot be closed because you have not specified a Year End Equity Account in the accounting configuration. The selected Fiscal Year cannot be closed because there does not seem to be an Accounting Period defined for the beginning of the next Fiscal Year. The selected Fiscal Year cannot be closed because there is no Trial Balance record for the account in the required Period. Or you have not specified a Year End Equity Account in the accounting configuration. The selected Fiscal Year cannot be closed because there are periods within the year that are still open. The selected Fiscal Year cannot be closed because there are prior years that are still open. The item cannot be Closed at this time as there is inventory at shipping. Could not convert Customer to Prospect to because there is already a Prospect with this internal ID. Could not convert Prospect to Customer because there is already a Customer with this internal ID. Quote #%1 has one or more line items without a warehouse specified. These line items must be fixed before you may convert this quote. Cannot find the Customer data for Quote #%1. Quote #%1 is associated with a Prospect, not a Customer. Convert the Prospect to a Customer first. Quote #%1 is for a Customer that has been placed on a Credit Hold and you do not have privilege to create Sales Orders for Customers on Credit Hold. The selected Customer must be taken off of Credit Hold before you may create convert this Quote. Quote #%1 is for a Customer that has been placed on a Credit Warning and you do not have privilege to create Sales Orders for Customers on Credit Warning. The selected Customer must be taken off of Credit Warning before you may create convert this Quote. Quote #%1 has expired and can not be converted. Could not copy the Item Site because it does not appear to exist. Could not copy the Item Site because the warehouse for the new Item Site record does not appear to exist. You do not have sufficient privilege to create an Item Site. Could not find the Source BOM to copy. The selected source Item does not have any Bill of Material Component Items associated with it. The selected target Item already has a Bill of Materials associated with it. You must first delete the Bill of Materials for the selected target item before attempting to copy an existing Bill of Materials. The Item you are trying to copy this Bill of Material to is a component item which would cause a recursive Bill of Material. Could not find the P/O to copy. The Vendor of the original P/O does not match the Vendor for the copy. Changing the Vendor is not yet supported when copying a P/O. The system does not allow purchases of Items for this Vendor without Item Sources and at least one line item item in the original P/O does not have an active Item Source. At least one line item in the original P/O does not have an active Item Source Price for this Vendor. Copying an existing project failed, possibly because the source project does not exist. You may not correct a quantity greater than the amount originally posted. The receipt has been split and may not be corrected. Correct Receipt. The Start Date falls within another Accounting Period. The End Date falls within another Accounting Period. The Start and End Dates enclose another Accounting Period. The Period dates are outside the selected Fiscal Year. The Start Date must be prior to the End Date. The Year is closed. Year dates may not overlap another year. Periods exist for this year outside the proposed dates. The Start Date must be prior to the End Date You may not apply more than the balance due to this document. You may not apply more than the amount available to apply for this Credit Memo. Either the Prepaid Account or the A/R Account for this Customer could not be found. You may not create a BOM Item that defines a Parent that is composed of itself. The Component that you have selected for thisBOM Item is a manufactured or phantom Item that uses the Parent Item as a Component Item in its own BOM. You may not create a recursive BOM. This CRM Account Number is already in use by an existing CRM Account. Please choose a different number and save again. This CRM Account Number is already in use by an existing Customer. Please choose a different number and save again. This CRM Account Number is already in use by an existing Prospect. Please choose a different number and save again. This CRM Account Number is already in use by an existing Vendor. Please choose a different number and save again. This CRM Account Number is already in use by an existing Tax Authority. Please choose a different number and save again. Cannot create a Prospect because there is no CRM Account to tie it to. Cannot create a Prospect for this CRM Account because it is already a Customer. Cannot create a Prospect for this CRM Account because it is already a Prospect. SO Header Information related to this SO Item not found! Item Source Information not found! Cannot create recurring items with an unrecognized object type. Revision control not enabled. The To-Do List Item cannot be created as there is no assigned User. The To-Do List Item cannot be created as the Task Name is blank. The To-Do List Item cannot be created as there is no Due Date. Work Order can not be created because Site not allowed to Manufacture this Item. Work Order can not be exploded because items on the BOM exist without itemsites. The selected G/L Account cannot be deleted as it is currently used in one or more Cost Categories. You must reassign these Cost Category assignments before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Sales Account Assignment. You must reassign these Sales Account Assignments before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Customer A/R Account assignments. You must reassign these Customer A/R Account assignments before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used as the default Account one or more Sites. You must reassign the default Account for these Sites before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Bank Accounts. You must reassign these Bank Accounts before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Expense Categories. You must reassign these Expense Categories before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Tax Codes. You must reassign these Tax Codes before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Standard Journals. You must reassign these Standard Journal Items before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Customer A/P Account assignments. You must reassign these Customer A/P Account assignments before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more Currency definition. You must reassign these Currency definitions before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as it is currently used in one or more A/R Open Items. You must reassign these Currency definitions before you may delete the selected G/L Account. The selected G/L Account cannot be deleted as there have been G/L Transactions posted against it. The selected Accounting Period has G/L Transactions posted against it and, thus, cannot be deleted. The selected Accounting Period is not the last accounting period and cannot be deleted. The selected Fiscal Year cannot be deleted because it is closed. The selected Fiscal Year cannot be deleted because there are Accounting Periods defined for it. The selected Address cannot be deleted as it is used by an active Contact. The selected Address cannot be deleted as it is used by an active Vendor. The selected Address cannot be deleted as it is used by an active Ship-To Address. The selected Address cannot be deleted as it is used by an active Vendor Address. The selected Address cannot be deleted as it is used by an active Site. The selected Bank Adjustment Type cannot be deleted because it is currently used by a Bank Adjustment. The selected Cash Receipt cannot be deleted because it is a Customer Deposit made with a Credit Card and the card has already been charged. The selected Characteristic cannot be deleted because there are Items assigned to it. You must remove these assignments before you may delete the selected Characteristic. The selected Characteristic cannot be deleted because there are Customers assigned to it. You must remove these assignments before you may delete the selected Characteristic. The selected Characteristic cannot be deleted because there are Addresses assigned to it. You must remove these assignments before you may delete the selected Characteristic. The selected Characteristic cannot be deleted because there are Contacts assigned to it. You must remove these assignments before you may delete the selected Characteristic. The selected Characteristic cannot be deleted because there are CRM Accounts assigned to it. You must remove these assignments before you may delete the selected Characteristic. The selected Characteristic cannot be deleted because there are Incidents assigned to it. You must remove these assignments before you may delete the selected Characteristic. The selected Characteristic cannot be deleted because there are Employees assigned to it. You must remove these assignments before you may delete the selected Characteristic. Cannot delete this check because either it has not been voided, it has already been posted or replaced, or it has been transmitted electronically. The selected Class Code cannot be deleted because there are Items that are assigned to it. You must reassign these Items before you may delete the selected Class Code. The selected Company cannot be deleted as it is in use by existing Account. You must reclass these Accounts before you may delete the selected Company. The selected Contact cannot be deleted as s/he is the primary or secondary Contact for a CRM Account. The selected Contact cannot be deleted as s/he is the Correspondence or Billing Contact for a Customer. The selected Contact cannot be deleted as s/he is the primary or secondary Contact for a Vendor. The selected Contact cannot be deleted as s/he is the Contact for a Ship-To Address. The selected Contact cannot be deleted as s/he is the Contact for a Vendor Address. The selected Contact cannot be deleted as s/he is the Contact for a Site. The selected CRM Account cannot be deleted as it is a Customer. The selected CRM Account cannot be deleted as it is a Vendor. The selected CRM Account cannot be deleted as it is a Prospect. The selected CRM Account cannot be deleted as it has Contacts. You may Detach the Contacts from this CRM Account and try deleting it again or set its status to inactive The selected CRM Account cannot be deleted as it is a Tax Authority. The selected CRM Account cannot be deleted as it is a Sales Rep. The selected CRM Account cannot be deleted as it is a Employee. The selected CRM Account cannot be deleted as it is a User. The selected Customer cannot be deleted as there are still Ship-Tos assigned to it. You must delete all of the selected Customer's Ship-Tos before you may delete it. The selected Customer cannot be deleted as there has been Sales History recorded for this Customer. You may Edit the selected Customer and set its status to inactive. The selected Customer cannot be deleted as Checks have been written to it. The selected Customer cannot be deleted as there are still Invoices assigned to it. You must delete all of the selected Customer's Invoices before you may delete it The selected Customer cannot be deleted as there are still Quotes assigned to it. You must delete all of the selected Customer's Quotes before you may delete it The selected Customer Type cannot be deleted as there are one or more Customers assigned to it. You must reassign these Customers before you may delete the selected Customer Type. The selected Employee Group cannot be deleted as there are one or more Employees assigned to it. You must reassign these Employees before you may delete the selected Employee Group. The selected Check Format cannot be deleted as it is used by one or more Bank Accounts. You must reassign these Bank Accounts before you may delete the selected Check Form. The selected Freight Class cannot be deleted because there are Items that are assigned to it. You must reassign these Items before you may delete the selected Freight Class. This Incident cannot be deleted as there are To-Do List Items associated with it. This Incident cannot be deleted as there are Comments associated with it. This Item cannot be deleted as it is used in one or more bills of materials. This Item cannot be deleted as there are Item Site records associated with it. This Item cannot be deleted as there are Substitute records associated with it. This Item cannot be deleted as there are Breeder BOM records associated with it. This Item cannot be deleted as there are assignement records associated with it. This Item cannot be deleted as there are Revision Control records associated with it. The selected Item Site cannot be deleted as there is Inventory History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Work Order History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Sales History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Purchasing History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there is Planning History posted against it. You may edit the Item Site and deactivate it. The selected Item Site cannot be deleted as there are Production Plans associated with it. The selected Item Site cannot be deleted as it is used as a Supplied from Site. The selected Item Site cannot be deleted as there is a non-zero Inventory Quantity posted against it. This UOM Conversion cannot be deleted as there are records for this Item which use this UOM. Cannot delete open recurring items with an invalid type. Cannot delete open recurring items without a valid parent item. The selected Opportunity cannot be deleted because there are ToDo Items assigned to it. You must delete or reassign these ToDo Items before you may delete it. The selected Opportunity cannot be deleted because there are Quotes assigned to it. You must delete or reassign these Quotes before you may delete it. The selected Opportunity cannot be deleted because there are Sales Orders assigned to it. You must delete or reassign these Sales Orders before you may delete it. The selected Package cannot be deleted because there are other packages that depend on it to function properly. The selected Profit Center cannot be deleted as it is in use by existing Account. You must reclass these Accounts before you may delete the selected Profit Center. The selected Prospect cannot be deleted as there are still Quotes for it. You must delete all of this Prospect's Quotes before you may delete the Prospect. The selected Sales Rep. cannot be deleted as he/she is still assigned to one or more Customers. You must reassign different Sales Reps. to all Customers to which the selected Sales Rep. is assigned before you may delete the selected Sales Rep. The selected Sales Rep. cannot be deleted as he/she is still assigned to one or more Ship-tos. You must reassign different Sales Reps. to all Ship-tos to which the selected Sales Rep. is assigned before you may delete the selected Sales Rep. The selected Sales Rep. cannot be deleted as there has been sales history recorded against him/her. You may edit and set the selected Sales Rep's active status to inactive. The selected Shipto cannot be deleted as there is still Archived Sales History assigned to it. You must delete all of the selected Customer's Ship-Tos before you may delete it. The selected Shipto cannot be deleted as there has been Sales History recorded for this Shipto. You may Edit the selected Shipto and set its status to inactive. This Sales Order cannot be deleted because a Credit Card has been charged for it. This Sales Order cannot be deleted because there is Credit Card transaction history for it. This Sales Order cannot be deleted as some of its line items have already been shipped. This Sales Order cannot be deleted as some of its line items have already been issued to shipping. This Sales Order cannot be deleted as some of its line items are linked to a Return Authorization. You must resolve this conflict before you may delete this Sales Order. This Sales Order cannot be deleted as some of its line items are linked to an In Process Work Order. You must resolve this conflict before you may delete this Sales Order. This Sales Order cannot be deleted as some of its line items have transaction history. This Sales Order cannot be deleted as one or more of its Line items have associated Purchase Order Line Items which are either closed or have receipts associated with them. You may want to consider cancelling this Sales Order instead. The Sales Order was deleted successfully. However, the Released Purchase Orders associated with one or more line items of this Sales Order could not be deleted. You must delete these Purchase Orders seperately if desired. This Sales Order Item cannot be deleted as it has already been shipped. This Sales Order Item cannot be deleted as it has already been issued to shipping. This Sales Order Item cannot be deleted as it is linked to a Return Authorization. You must resolve this conflict before you may delete this Sales Order Item. This Sales Order Item cannot be deleted as it is linked to an In Process Work Order. You must resolve this conflict before you may delete this Sales Order Item. This Sales Order Item cannot be deleted as it has generated Inventory History. You may want to consider cancelling this Sales Order Item. This Sales Order Item cannot be deleted as it has associated Purchase Order Line Item which is either closed or has receipts associated with it. You may want to consider cancelling this Sales Order Item instead. The Sales Order Item was deleted successfully. However, the Purchase Order Line Item associated with this Sales Line could not be deleted. You must delete this Purchase Line Item seperately if desired. The selected Subaccount cannot be deleted as it is in use by existing Account. You must reclass these Accounts before you may delete the selected Subaccount. This Transfer Order cannot be deleted as some of its line items have already been shipped. This Transfer Order cannot be deleted as some of its line items have already been issued to shipping. You must return this stock before you may delete this Transfer Order. This Tax Code cannot be deleted as there are Tax Assignments that refer to it. Change those Tax Assignments before trying to delete this Tax Code. This Tax Authority cannot be deleted as there are Tax Selections for it. Change or delete those Tax Selections before deleting this Tax Authority. This Tax Authority cannot be deleted as Checks have been written to it. This Tax Class cannot be deleted as there are Tax Codes that refer to it. This Tax Zone cannot be deleted as there are Tax Assignments that refer to it. This Tax Zone cannot be deleted as there are Tax Registrations that refer to it. This Transfer Order cannot be deleted as line items for it have already been shipped. This Transfer Order cannot be deleted as line items for it have been issued to shipping. This Transfer Order cannot be deleted as the order number cannot be released. The selected Vendor cannot be deleted as therehave been P/Os created against it. You may deactivate this Vendor instead. The selected Vendor cannot be deleted as therehas been P/O Material Receipt History posted against it. You may deactivate this Vendor instead. The selected Vendor cannot be deleted as therehas been P/O Material Return History posted against it. You may deactivate this Vendor instead. The selected Vendor cannot be deleted as therehave been Vouchers posted against it. You may deactivate this Vendor instead. The selected Vendor cannot be deleted as therehave been A/P Open Items posted against it. You may deactivate this Vendor instead. The selected Vendor cannot be deleted as therehave been A/P Applications posted against it. You may deactivate this Vendor instead. The selected Vendor cannot be deleted as there have been Checks posted against it. You may deactivate this Vendor instead. The Work Order cannot be deleted because time clock entries exist for it. Please Close it instead of trying to Delete it. The Work Order cannot be deleted for Job Item Types. Please close the associated Sales Order instead of trying to Delete it. The Work Order cannot be deleted in the current status. Please close the associated Sales Order instead of trying to Delete it. This version of the PostgreSQL database server does not support package enabling or disabling. Upgrade to PostgreSQL 8.2 or later. Could not find a package with the internal id % to enable or disable. Distribution would result in zero quantity and amount.Please distribute manually. The purchase order and voucher have different currencies. Please distribute manually. Distribution would result in a negative amount. Please distribute manually. Item has multiple cost elements. Please distribute manually. You must select Master Card, Visa, American Express or Discover as the credit card type. The length of a Master Card credit card number has to be 16 digits. The length of a Visa credit card number has to be either 13 or 16 digits. The length of an American Express credit card number has to be 15 digits. The length of a Discover credit card number has to be 16 digits. The first two digits for a valid Master Card number must be between 51 and 55 The first digit for a valid Visa number must be 4 The first two digits for a valid American Express number must be 34 or 37. The first four digits for a valid Discover Express number must be 6011. The credit card number that you have provided is not valid. Information for this order line item could not be found. If it is a Purchase Order Item then it does not appear to exist. If it is a Transfer Order Item then either the Transfer Order does not exist or there is no Item Site for this line item. Work Order %1 cannot be Exploded as there is no valid Bill of Materials on file for the Work Order Item. You must create a valid Bill of Materials for the Work Order Item before you may explode the Work Order. Work Order %1 cannot be Exploded as there are one or more Component Items on the Bill of Materials for the Work Order Item that are not valid in the Work Order Site. You must create a valid Item Site for all of the Component Items before you may explode this Work Order. Work Order %1 cannot be Exploded as there are one or more Co-Product/By-Product Items on the Breeder Bill of Materials for the Work Order Item that do not exist in the Work Order Site. You must create a valid Item Site for all of the Co-Product/By-Product Items before you may explode this Work Order. Work Order %1 cannot be Exploded because it is not Open. Work Order %1 cannot be Exploded because the quantityordered is not valid. Cannot check dependencies when the contact is one of multiple foreign key columns. Cannot freeze this Accounting Period because it is still open. Cannot freeze this Accounting Period because it is already frozen. Nothing to do as the value to post to the G/L is 0. Cannot post a G/L transaction to a closed period. Cannot add to a G/L Series because the Account is NULL or -1. Cannot add to a G/L Series because the Accounting Period is closed. The Next Shipment Number has not been set in the Configure S/R window. Set that value and try issuing to shipping again. The selected Sales Order is on Credit Hold and must be taken off of Credit Hold before any inventory may be issued to it. The selected Sales Order is on Packing Hold and must be taken off of Packing Hold before any inventory may be issued to it. The selected Sales Order is on Return Hold. The Customer must return all materials for a related Return Authorization before any inventory may be issued to this Order. The selected Sales Order is configured for Auto Registration. The Customer Account does not have a Primary Contact. A Primary Contact must be assigned to this Customer Account before any inventory may be issued to this Order. There is not enough Inventory to issue the amount required of one of the Average Cost items requested. Average Cost items may not have a negative quantity on hand. The specified Username does not exist in the specified Database. Contact your Systems Administrator to report this issue The specified Username exists in the specified Database but is not Active. Contact your Systems Administrator to report this issue. The specified Database is currently in Maintenance Mode and can only be accessed by System Administators. Contact your Systems Administrator to report this issue. Cannot make this BOM Item replacement because it would create a recursive BOM. Cannot open this Accounting Period because it is already open. Cannot open this Accounting Period because it is frozen. Cannot open this Accounting Period because subsequent periods are closed. Cannot open this Accounting Period because the fiscal year is closed. Cannot open this Accounting Year because subsequent years are closed. Cannot count open recurring items with an invalid type. Cannot count open recurring items without a valid parent item. Don't know how to count open recurring invoices. There are no A/P Credit Memo applications to post. The total value of the applications that are you attempting to post is greater than the value of the A/P Credit Memo itself. At least one A/P Credit Memo application cannot be posted because there is no current exchange rate for its currency. The A/P Credit Memo to apply was not found. The amount to apply for this A/P Credit Memo is NULL. There are no A/R Credit Memo applications to post. Either there are no A/R Credit Memo applications to post or there is no exchange rate for one of the applications. The total value of the applications that you are attempting to post is greater than the value of the A/R Credit Memo itself. Please reduce the applications to total less than the value of the Credit Memo. At least one A/R Credit Memo application cannot be posted because there is no current exchange rate for its currency. The A/R Credit Memo to apply was not found. This Bank Adjustment could not be posted because the one or more required records do not exist. This Bank Adjustment could not be posted because the total adjustment is 0 so there is nothing to post. This Bank Reconciliation could not be posted because the G/L Account could not be verified. This Billing Selection cannot be posted because it has already been posted. The G/L Account Assignments for one or more of the Billing Selections that you are trying to post are not configured correctly. Therefore, G/L Transactions cannot be posted for these. You must contact your Systems Administrator to have this corrected before you may post these Billing Selections. The selected Cash Receipt cannot be posted as the amount distributed is greater than the amount received. You must correct this before you may post this Cash Receipt. The selected Cash Receipt cannot be posted as the amount received must be greater than zero. You must correct this before you may post this Cash Receipt. The selected Cash Receipt cannot be posted as the A/R Account cannot be determined. You must make an A/R Account Assignment for the Customer Type to which this Customer is assigned before you may post this Cash Receipt. The selected Cash Receipt cannot be posted as the Bank Account cannot be determined. You must make a Bank Account Assignment for this Cash Receipt before you may post it. The selected Cash Receipt cannot be posted, probably because the Customer's Prepaid Account was not found. Cannot post this Cash Receipt because the credit card records could not be found. Cannot post this Cash Receipt because the record of the credit card transaction either does not exist or is not consistent. Cannot post this Credit Card refund because the default Bank Account for this Credit Card could not be found. Cannot post this Credit Card refund because an invalid id/reference-type pair was passed. Cannot post this Credit Card refund because the credit card and refund records could not be found. Cannot post this Credit Card refund because the credit card payment records is not for a refund. Cannot post this Check because it has already been posted. Cannot post this Check because the recipient type is not valid. Cannot post this Check because the Expense Category could not be found. Cannot post this Check because the G/L Account against which it is to be posted is not valid. Cannot post this Count Tag because The total Count Slip quantity is greater than the Count Tag quantity. Cannot post this Count Tag because the total Count Slip quantity is less than the Count Tag quantity for a Lot/Serial-controlled Item Site. Cannot post this Count Tag because the total Count Slip quantity is less than the Count Tag quantity and there is no default location. Cannot post this Count Tag because the total Count Slip quantity is less than the Count Tag quantity and we don't post to default locations. This Credit Memo cannot be posted because it has already been posted. This Credit Memo is on Hold and, thus, cannot be posted. The Sales Account Assignment for this Credit Memo is not configured correctly. Because of this, G/L Transactions cannot be posted for this Credit Memo. You must contact your Systems Administrator to have this corrected before you may post this Credit Memo. The Misc. Charge Account Assignment for this Credit Memo is not configured correctly. Because of this, G/L Transactions cannot be posted for this Credit Memo. You must contact your Systems Administrator to have this corrected before you may post this Credit Memo. The Freight Account Assignment for this Credit Memo is not configured correctly. Because of this, G/L Transactions cannot be posted for this Credit Memo. You must contact your Systems Administrator to have this corrected before you may post this Credit Memo. The A/R Account Assignment for this Credit Memo is not configured correctly. Because of this, G/L Transactions cannot be posted for this Credit Memo. You must contact your Systems Administrator to have this corrected before you may post this Credit Memo. Could not post this G/L Series because the Accounting Period is closed. Could not post this G/L Series because the G/L Series Discrepancy Account was not found. Could not post this G/L Series because the Debits and Credits are unbalanced. Unable to post this Invoice because it has already been posted. Unable to post this Invoice because the Sales Account was not found. Unable to post this Invoice because there was an error processing Line Item taxes. Unable to post this Invoice because there was an error processing Misc. Line Item taxes. Unable to post this Invoice because the Freight Account was not found. Unable to post this Invoice because there was an error processing Freight taxes. Unable to post this Invoice because there was an error processing Tax Adjustments. Unable to post this Invoice because the A/R Account was not found. Could not post an inventory transaction because the Item Site has no Control Method or the Item has an Item Type of Reference. Could not post an inventory transaction because the transaction will cause an Average Costed Item to go negative which is not allowed. Unable to post this Production because the Work Order status is not Exploded, Released, or InProcess. Unable to post this Production because backflushing component usage could not be completed due to missing Item Sites. Unable to post this Production because of missing Item Site or Cost Category. This Receipt Line has already been posted. This Receipt Line cannot be posted because it has a quantity of 0. This Purchase Order Receipt Line has no Standard Cost assigned to it. Cannot not issue item to shipping. No Sales Order item found against this PO Item. Cannot not issue item to shipping. Inventory history not found. The Cost Category for one or more Item Sites for the Purchase Order covered by this Voucher is not configured with Purchase Price Variance or P/O Liability Clearing Account Numbers or the Vendor of this Voucher is not configured with an A/P Account Number. Because of this, G/L Transactions cannot be posted for this Voucher. This shipment cannot be recalled because it does not appear to have been shipped. This shipment cannot be recalled because it appears to have been invoiced. This shipment cannot be recalled because it has already been received at its destination. This shipment cannot be recalled because it appears to have been invoiced and the invoice has been posted. This shipment cannot be recalled because it contains one or more Line Items with Site/Product Category/Customer combinations that have not been properly described in Sales Account Assignments. These assignments must be made before G/L Transactions can be posted andthis Sales Order is allowed to be recalled. This shipment cannot be recalled because the associated Transfer Order is closed. Cannot release this Purchase Order because it does not have any unreleased Purchase Order Items. Cannot release this Transfer Order because it does not have any line items. Cannot release this Billing Header because it has already been posted. Cannot release this Billing Header because it has Line Items. You cannot Relocate more inventory than is available. Cannot replace this voided check because either it has not been voided, it has already been posted, or it has already beenreplaced. Either a Cost Category for the Items you are trying to Return is not configured with a Shipping Asset Account Number or a Customer Type/Product Category/Site Sales Account assignment does not exist . Because of this, G/L Transactions cannot be posted for this Return. You must contact your Systems Administrator to have this corrected before you may Return this Shipment. The selected Cash Receipt cannot be reversed as the amount distributed is greater than the amount received. The selected Cash Receipt cannot be reversed as the amount received must be greater than zero. The selected Cash Receipt cannot be reversed as the A/R Account cannot be determined. You must make an A/R Account Assignment for the Customer Type to which this Customer is assigned before you may reverse this Cash Receipt. The selected Cash Receipt cannot be reversed as the Bank Account cannot be determined. You must make a Bank Account Assignment for this Cash Receipt before you may reverse it. The selected Cash Receipt cannot be reversed, probably because the Customer's Prepaid Account was not found. Cannot reverse this Cash Receipt because the credit card records could not be found. An alarm for this item already exists. The quantity you have selected for Billing is less than the quantity shipped. You may not bill for less than the quantity shipped. This Sales Order may not be shipped as it contains one or more Line Items that have Site/Product Category/Customer combinations that have not been properly described in Sales Account Assignments. These assignments must be made before G/L Transactions can be posted and this Sales Order is allowed to ship. This Transfer Order may not be shipped because there is no Item Site for the Transit Site. This Shipment cannot be shipped because it appears to have already shipped. The selected Order is on Credit Hold and must be taken off of Credit Hold before it may be shipped. The selected Order is on Packing Hold and must be taken off of Packing Hold before it may be shipped. The selected Order is on Return Hold. The Customer must return all materials for a related Return Authorization before this order may be shipped. The selected Order is on Shipping Hold and must be taken off of Shipping Hold before it may be shipped. This Shipment cannot be shipped because it does not appear to exist. This Order may not be shipped because it has been marked as Ship Complete and quantities for one or more Line Items are still not completely issued. Please correct this before shipping the Order. Only Purchase Order Receipts may be split. Only posted receipts may be split. Vouchered receitps may not be split. Split quantity must me less than original receipt quantity. Split freight may not be greater than original freight. Receipt not found. The split quantity must be a positive number. Cannot create recurring items without a valid parent item to copy. Cannot figure out which line item to issue. There is not enough Inventory to issue the amount required of Item %1 in Site %2. Item Number %1 in Site %2 is a Multiple Location or Lot/Serial controlled Item which is short on Inventory. This transaction cannot be completed as is. Please make sure there is sufficient Quantity on Hand before proceeding. Invalid Order Type. Only Sales Orders and Transfer Orders may be shipped from this window. Cannot check inventory levels foran invalid item. There is not enough Inventory to issue the amount required of one of the items requested. One of the requested items is a Multiple Location or Lot/Serial controlled Item which is sort on Inventory. Cannot thaw this Accounting Period because it is closed. Cannot thaw this Accounting Period because it is not frozen. Cannot change the Sequence of a non-existent To-Do List Item. Possible cause: no To-Do List Item was selected. The To-Do List Item cannot be updated as there is no assigned User. The To-Do List Item cannot be updated as the Task Name is blank. The To-Do List Item cannot be updated as there is no Due Date. The To-Do List Item cannot be updated as an invalid internal ID was supplied . Cannot void this check because either it has already been voided, posted, or replaced, or it has been transmitted electronically. If this check has been posted, try Void Posted Check with the Check Register window. Unable to void this Credit Memo because it has not been posted. Unable to void this Credit Memo because the Sales Account was not found. Unable to void this Credit Memo because there A/R Applications posted against this Credit Memo. Unable to void this Invoice because it has not been posted. Unable to void this Invoice because the Sales Account was not found. Unable to void this Invoice because there A/R Applications posted against this Invoice. Cannot void this check because it has already been voided. Cannot void this check because the recipient type is not valid. Cannot void this check because the Expense Category could not be found. Cannot void this check because the G/L account to which the funds should be credited is not valid. Cannot void this check because the check has has been reconciled in Bank Reconciliation. Cannot replace a check that is not voided or has already been posted or replaced. Cannot replace this voided check because one of its line items has been reselected for billing and is represented on another check. Cannot reserve more quantity than remaining on order. Cannot reserve negative quantities. Cannot reserve more quantity than currently on hand and already reserved. Work Order %1 cannot be Exploded as it seems to have an invalid Order Quantity. Work Order %1 has at least one Item in its Bill of Materials with the Push issue method that has not yet been issued. You must issue all Push Items to this Work Order. Work Order %1 has at least one Item in its Bill of Materials with the Push issue method that does not have the required quantity issued. You must issue all Push Items to this Work Order. Work Order %1 is closed. ErrorLookupHash initialization error ErrorLookupHash has already been initialized. Lookup Error Could not find (%1, %2) in ErrorLookupHash when trying to insert proxy entry for (%3, %4). A Stored Procedure failed to run properly. subAccntType &Close Cannot Create Subaccount Type A Subaccount Type with the entered code already exists.You may not create a Subaccount Type with this code. A Subaccount Type with the entered code already exists. You may not create a Subaccount Type with this code. A System Error occurred at %1::%2. Subaccount Type Asset Liability Expense Revenue Equity Type: Code: Description: &Cancel &Save subAccntTypes Code Type Description Cannot Delete G/L Subaccount Type The selected G/L Subaccount Type cannot be deleted as it is currently used in one or more G/L Accounts. You must reassign these G/L Accounts before you may delete the selected G/L Subaccount Type. Asset Liability Expense Revenue Equity ERROR G/L Subaccount Types: &Close &Print &New &Edit &Delete List G/L Subaccount Types subaccount &Close Subaccount Number Number: Description: &Cancel &Save Cannot Save Sub Account You must enter a valid Number. Duplicate Sub Account Number A Sub Account Number already exists for the one specified. Change All Accounts? <p>The old Subaccount Number %1 might be used by existing Accounts. Would you like to change all accounts that use it to Subaccount Number %2?<p>If you answer 'No' then change the Number back to %3 and Save again. subaccounts Number Description Subaccount Numbers: &Close &New &Edit &View &Delete List Subaccounts submitAction Cannot Submit Action You must indicate an Email address to which the completed Action response will be sent. Invalid Date You must enter a valid date. Schedule Action with xTuple Connect Action: Response Email: Scheduled ASAP Scheduled: &Cancel &Schedule submitReport Cannot Submit Report <p>You must indicate an Email address to which the completed Report will be sent. A System Error occurred at %1::%2. Schedule Report with xTuple Connect Scheduled ASAP Scheduled: &Cancel &Schedule Response Email To: Document Name: Email From: Response Body: substituteList Item Number Description QOH Norm. QOH Availability Norm. Avail. Child Work Order A child Work Order exists for this Material Requirement. You should delete this child Work Order before substituting. Substitute List Show Availability as of: Item Site Lead Time Look Ahead Days: Date: &Cancel &Select Substitutions: Site: summarizeInvTransByClassCode Summarize Inventory Transactions? &Yes &No Summary Complete The selected Inventory Transactions have been summarized. Summarize Inventory Transactions by Class Code &Cancel Summari&ze <p>You are about to summarize Inventory Transactions for the selected Site and Class Code(s). Summarizing Inventory Transactions will delete any detailed Transaction information.<br>Are you sure that you want to summarize the selected Transactions?</p> syncCompanies You do not have sufficient privilege to view this window Number Currency Description Server Port Database Name Start End Closed No Base Currency <p>The parent database does not appear to have a base currency defined. The data cannot safely be synchronized. Company %1 does not appear to have all required Accounts defined. The data cannot safely be synchronized. No Gain/Loss Account Company %1 does not appear to have an unrealized Gain/Loss Account defined. The data cannot safely be synchronized. Synchronizing Company %1 (%2) Skipping Database <p>Company %1 (database %2) will be skipped at the user's request. No Privilege You do not have permission to view or manage the Chart of Accounts on the child database. Versions Incompatible <p>The version of the child database is not the same as the version of the parent database (%1 vs. %2). The data cannot safely be synchronized. No Discrepency Account Synchronizing Company %1 (%2) Period %3 Period Closed Period %1 to %2 is closed and may not be synchronized. Synchronizing Company %1 (%2) Period %3: Clearing old data... Synchronizing Canceled Synchronization Canceled. Synchronizing Complete %1 Companies attempted, %2 errors encountered No Corresponding Company <p>The child database does not appear to have a Company %1 defined. The data cannot safely be synchronized. No Corresponding Period <p>The child database for Company %1 (%2) does not appear to have an Accounting Period starting on %3 and ending on %4. Synchronizing Company %1 (%2): Period: %3 Updating Chart of Accounts... Synchronizing Company %1 (%2) Period: %3 Account: %4 No Conversion Rate The parent database for Company %1 (%2) does not appear to have a conversion rate for %3 on %4. Data imported from Company %1 (%2) Synchronizing Company %1 (%2): Posting into trial balances... Currency Rounding Discrepency Adjustment Synchronizing Company %1 (%2) Forward updating trial balances... Synchronizing Company %1 (%2) Posting currency revaluation adjustments... Unrealized Gain/Loss Adjustment Could Not Connect <p>Could not connect to the child database with these connection parameters. Synchronize Companies Periods: Select All Clear Selection Companies: &Close &Synchronize sysLocale Cannot Save Locale Locale Code: &Description: Language: Sample Date Format: Time Format: Timestamp Format: Interval Format: UOM Ratio: Co&mments: <p>You must enter a Code for this Locale before you may save it. [ Default ] Country: [ Any ] date time interval timestamp Currency: Sales Price: Purch. Price: Ext. Price: Cost: Qty.: Qty. Per: Display Values to # Decimal Places: Percent: Weight: Error: Warning: Emphasis: Alternate: Expired: Future: <p>.Could not translate Qt date/time formatting string %1 to PostgreSQL date/time formatting string. Error at or near character %2. Cannot Create Locale A Locale with the entered code already exists.You may not create a Locale with this code. systemMessage ASAP Never Enter Valid Schedule Date You must enter a valid Schedule Date before saving this Message. System Message Scheduled: Expires: at Posted: Posted by: &Cancel &Save Message: task A System Error occurred at %1::%2. Task Name: Number: Status: Concept In-Process Complete Description: Hours Budgeted: Actual: Balance: Expenses Owner: Assigned to: Due: Assigned: Started: Schedule Completed: Plan Alarms Comments Cannot Save Project Task You must enter a valid Number. You must enter a valid Name. You must enter a valid due date. taxAdjustment Tax Adjustment Tax Code: Select a Code Amount: &Cancel &Save Tax Code Required <p>You must select a tax code before you may save. taxAssignment Tax Code Incorrect Tax Code Tax codes with same group sequence as this tax code are already assigned to this Tax Zone / Tax Type pair. You first need to Revoke those Tax Codes. <p>Tax codes with the same group sequence as this one and which have subordinate taxes are already assigned to this Tax Zone / Tax Type pair.</p><p>You first need to Revoke those Tax Codes.</p> Tax Assignment Tax Type Tax Zone: Any &Close Add-> <-Revoke taxAssignments Tax Zone/Code Tax Type/Description Tax Class Group Sequence List Tax Assignments Tax Zones All Specific Tax Zone: Any Tax Types Specific Tax Type: Close Tax Assignments: New Edit View Delete taxAuthorities Tax Authorities Tax Authority Code Pattern Tax Authority Name Pattern Street Pattern City Pattern State Pattern Postal Code Pattern Country Pattern Code Name Address City State Country Postal Code Delete Tax Authority? <p>Are you sure you want to delete the selected Tax Authority? Error Deleting taxAuthority &Close Error checking for existing Tax Authority A Tax Authority with the entered code already exists. You may not create a Tax Authority with this code. Cannot Create Tax Authority Question Saving Address <p>There are multiple uses of this Address. What would you like to do? Change This One Change Address for All Cancel Error saving Address Cannot save Tax Authority Database Error Tax Authority CRM Account... Name: Ext. Ref.: Currency: Code: County: &Cancel &Save Default G/L Account: Cannot Save Tax Authority You must enter a valid Code. taxBreakdown Invoice Currency: Tax Breakdown for Invoice: Invoice Total: Sales Order Currency: Tax Breakdown for Sales Order: Sales Order Total: Quote Currency: Tax Breakdown for Quote: Quote Total: Billing Currency: Tax Breakdown for Billing Order: Billing Total: Credit Memo Currency: Tax Breakdown for Credit Memo: Credit Memo Total: Purchase Order Currency: Tax Breakdown for Purchase Order: Purchase Order Total: Voucher Currency: Tax Breakdown for Voucher: Voucher Total: Tax Breakdown Tax Breakdown for Document: Tax Zone: None Freight Tax: Freight Value: Close Line Item Tax: Total Tax: Document Currency: Pre-Tax Total Value: Misc. Tax Adjustment: Taxable Line Item Value: Tax Currency: Order Total: Transfer Order Currency: Tax Breakdown for Transfer Order: Transfer Order Total: Return Authorization Currency: Tax Breakdown for Return: Return Total: taxClass &Close Cannot Save Tax Class You must enter a valid Code. Cannot Create Tax Class A Tax Class with the entered code already exists.You may not create a Tax Class with this code. Tax Class Code: &Description: Group Sequence: &Cancel &Save taxClasses Class Description Group Sequence List Tax Classes Tax Classes: &Close &New &Edit &View &Delete taxCode Effective Expires Percent Amount Currency View Edit Expire Delete Delete Tax Code Rate? <p>Are you sure you want to delete this Tax Code Rate ? Expired Tax Rate Cannot expire this Tax Code. It is already expired or is a Future Rate. Error Creating Temporary Record No Tax Code You must specify a Code for this Tax. Duplicate Tax Code A Tax Code already exists for the parameters specified. Delete Tax Code? <p>Are you sure you want to delete this Tax Code and all of its associated Tax Rates? Always Never Tax Code Code: Description: None Calculation basis on: Base Price Tax Class: Tax Authority: Rates New Account: Select G/L Accout You must select a G/L Account for this Tax. taxCodeRate Always Never &Close Incorrect Date Entry The start date should be earlier than the end date. Invalid Date Range A Tax Rate already exists within the specified Date Range. Tax Code Rate Effectivity Percentage: Amount: &Cancel &Save taxCodes Code Description Delete Tax Code? <p>Are you sure you want to delete this Tax Code along with its associated Tax Code Rates? Tax Codes: &Close &New &Edit &View &Delete List Tax Codes taxDetail Code Description Amount Sequence &Close Delete Tax Adjustment? <p>Are you sure that you want to delete this tax adjustment? Tax Detail Tax Type: Description: Tax Codes New Delete Unspecified Taxable Amount: taxRegistration Tax Registration Information Vendor #: Tax Zone: ~Any~ Tax Authority: Registration Number: Notes: Effectivity Always Never Incorrect Date Entry The start date should be earlier than the end date. Duplicate Tax Registration A Tax Registration already exists for the parameters specified. taxRegistrations Tax Zone Tax Authority Registration # Start Date End Date Tax Registrations: &Close &New &Edit &View &Delete List Tax Registrations taxType &Close Cannot Create Tax Type A Tax Type with the entered name already exists.You may not create a Tax Type with this name. A Tax Type with the entered name already exists. You may not create a Tax Type with this name. A System Error occurred at %1::%2. Tax Type Name: Description: &Cancel &Save Missing Name <p>You must name this Tax Type before saving it. taxTypes Name Description Cannot Delete Tax Type You cannot delete the selected Tax Type because there are currently items assigned to it. You must first re-assign these items before deleting the selected Tax Type. A System Error occurred at %1::%2. Tax Types: &Close &Print &New &Edit &View &Delete List Tax Types taxZone &Close Cannot Save Tax Zone You must enter a valid Code. Cannot Create Tax Zone A Tax Zone with the entered code already exists.You may not create a Tax Zone with this code. Tax Zone Code: &Description: &Cancel &Save taxZones Area Description List Tax Zones Tax Zones: &Close &New &Edit &View &Delete terms A System Error occurred at %1::%2. Cannot Save Terms You must specify a code for the Terms. Cannot Save Terms Code This Terms code already exists. You have been placed in edit mode. You may not rename this Terms code with the entered name as it is in use by another Terms code. Due Days: Discnt. Days: Due Day: Discnt. Day: Terms C&ode: &Description: Type: Da&ys &Proximo Used in Payables Used in Receivables D&ue Days: Disc&nt. Days: D&iscount %: Cut-o&ff Day: termses Code Description Type A/P A/R Days Proximo Cannot Delete Terms Code Terms: &Close &Print &New &Edit &View &Delete List Terms <p>You may not delete the selected Terms Code are there are one or more Customers assigned to it. You must reassign these Customers before you may delete the selected Terms Code. <p>You may not delete the selected Terms Code as there are one or more Vendors assigned to it. You must reassign these Vendors before you may delete the selected Terms Code. thawItemSitesByClassCode &Cancel &Thaw Thaw Item Sites by Class Code/Site Site: todoItem To-Do List Item Assigned to: Task Name: Pending Input Deferred Neither Active Description: Status Due: Assigned: Started: Completed: Contact Notes Relationships Opportunity #: Incident #: Account #: Comments Documents Priority: Owner: Alarms todoList To-Do List Completed Closed Concept New Type Assigned To Name Due Date Incident Edit To-Do... Edit Incident View Incident Priority Start Date Account# Account Name Owner CRM Account Assigned To-Do Items To-Do Item View To-Do... Delete To-Do Edit Task View Task Edit Project View Project Edit Customer View Customer Delete Recurring Item? <p>This is a recurring item. Do you want to delete just this one item or delete all open items in this recurrence? Delete List Item? <p>Are you sure that you want to completely delete the selected item? To-do Task Project User Start Date on or Before Start Date on or After Due Date on or Before Due Date on or After Show Completed Show Completed Only Notes Stage Parent Customer Opportunity Edit Opportunity View Opportunity Deferred Pending InProcess Feedback Confirmed Resolved Restricted Access You have not been granted privileges to open this item. Show Opportunities Incidents Projects todoListCalendar Type Seq Priority Name Description Status Due Date Incident Customer Owner Assigned New... Edit... View... Delete Edit Customer View Customer To-Do List Calendar Active Only Completed Close transactionInformation &Close Transaction Information Transaction Type: Transaction Date: Username: &Save Transaction Qty.: QOH Before: QOH After: Include in Inventory Analysis Notes: Created Date: Site: transferOrder # Item Description Status Sched. Date Ordered At Shipping Shipped Balance Received A System Error occurred at %1::%2. Unreleased Transfer Order Exists An Unreleased Transfer Order already exists for this Source/Destination Warehouse. Would you like to use this Transfer Order? Click Yes to use the existing Transfer Order otherwise a new one will be created. Error Creating Header Error Adding to Packing List Batch You must create at least one Line Item for this Transfer Order before you may save it. You must enter a valid T/O # for this TransferOrder before you may save it. Cannot Save Transfer Order Error Saving Transfer Order Open Line... Edit Line... Close Line... Delete Line... Return Stock Issue Stock... Issue Line Balance Error Getting Number Enter T/O # <p>You must enter a T/O # for this Transfer Order before you may continue. Error Releasing Number Open Close Delete Selected Line Item? <p>Are you sure that you want to delete the selected Line Item? Cancel Transfer Order? <p>You have deleted all of the Line Items for this Transfer Order. Would you like to cancel this Transfer Order? Record Currently Being Edited <p>The record you are trying to edit is currently being edited by another user. Continue in View Mode. Cannot Lock Record for Editing <p>There was an unexpected error while trying to lock the record for editing. Please report this to your administator. Delete Transfer Order? <p>Are you sure you want to delete this Transfer Order and its associated Line Items? Error Getting Site Could not release this Transfer Order record. Save Quick Entry Data? Releasing Error Error Opening Line Error Closing Line Error Getting Status Error Deleting Line Error Deleting Order Error Getting Order Error Getting Lines Error Getting Summary <p>This Transfer Order does not have any line items. Are you sure you want to delete this Transfer Order? Do you want to save your Quick Entry changes? Error Updating Details View <br>Line Item %1 Line Item %1 Error Getting Item Error Checking Inventory Error Calculating Tax Removing row from view failed Quick Entry Requires a Date <p>You must enter either a Scheduled Date or a Pack Date before using the Quick Entry tab. Transfer Order Clear Order #: ... Save and Add to Packing List Batch &Save &Close &Header Information Order Status: Order Date: Scheduled Date: Tax Zone: Pack Date: Agent: Ship Complete Ship &Via: Shipping Form: &Line Items &New &Edit &Delete Issue Stock Issue Line Bal. Order-Level Freight: Freight Weight: Tax: Total: Show Canceled Line Items Require sufficient Inventory Line Item Freight Subtotal: Freight Currency: Unreleased Closed Project #: Ship From Site: Ship To Order Notes Comments Shipping Notes Quick Entry Currency for Freight Charges: Save Quick Entries Delete Quick Entry Transaction Canceled Issue to Shipping No Transit Site There are no transit sites defined in the system. You must define at least one transit site to use Transfer Orders. You must select a Source Site for this Transfer Order before you may save it. You must select a Transit Site for this Transfer Order before you may save it. You must select a Destination Site for this Transfer Order before you may save it. The Source and Destination Sites must be different. Transit Site: transferOrderItem # Item Number Description UOM Pend. Alloc. Total Alloc. On Order QOH Availability Name Value Next New Cannot Save Transfer Order Item <p>You must enter a valid Quantity Ordered before saving this Transfer Order Item. <p>You must enter a valid Schedule Date before saving this Transfer Order Item. <p>You cannot set the quantity of the order to a value less than the quantity that has already been shipped. Unsaved Changed <p>You have made some changes which have not yet been saved! Would you like to save them now? Transfer Order Item Order #: Line #: Show Availability On Hand: Allocated: Unallocated: On Order: Available: &Close &Save Previous Cancel Item Sc&heduled Date: &Promised Date: &Qty. Ordered: Standard Cost: Line Item Freight: Tax: Notes Comments From &Site: Qty. Shipped: Supply Inventory Dependencies Show dependencies as Indented BOM Characteristics transferOrderList Transfer Orders &Cancel &Select Transfer Orders: Order # From Whs. To Whs. Ordered Scheduled From Site: To Site: transferOrders Ordered Scheduled Unreleased Open Closed Delete Transfer Order? <p>Are you sure that you want to completely delete the selected Transfer Order? Cannot Delete Transfer Order <p>The selected Transfer Order cannot be deleted as there have been shipments posted against it. Would you like to Close it instead? Edit... View... Status Delete... Release... Issue To Shipping... Copy... Print Packing List... Add to Packing List Batch... List Open Transfer Orders All Statuses Selected: &Close &Print Transfer Orders: &New Release &Edit &View &Delete Issue Stock Co&py Order # Source Site Dest. Site Source Site: Destination Site: transferTrans &Close Transaction Date: Username: &Cancel &Post Before After Transferred Qty.: Document #: Notes: Transfer Transaction Transaction Canceled You must select an Item before posting this transaction. <p>You must enter a positive Quantity before posting this Transaction. Cannot Post Transaction <p>The Target Site is the same as the Source Site. You must select a different Site for each before posting this Transaction A System Error occurred at transferTrans::%1, Item Site ID #%2, To Site ID #%3, From Site #%4. Inter-Site Transaction From Site: To Site: transformTrans Location Lot/Serial # Qty. This Target Item cannot be Transformed because it has no Item Site or the Item Site is either Inactive or has a Control Method of None. N/A Transform Transaction &Close &Post Source: Target Item Number: Qty. to Transform: Transaction Canceled You must select an Item before posting this transaction. <p>You must enter a positive Quantity before posting this Transaction. <p>You may not transform a quantity that is greater than the quantity of the Transform Source. <p>>You must select a Target Item before posting this transaction. Cannot Post Transaction No Transform Targets This Source Item cannot be Transformed because it has no Transformations. Either select another Source Item or use the Transformations tab on the Item window to define a target Item. Transaction Date: Username: Before After Document #: Notes: <p>No transaction was done because either Item %1 or Item %2 was not found at Site %3. Site: translations Translations Locale: Language: Default Country: Close Check for Translations Package Found Location No Yes Connecting... Could not save file. No translation is currently available. Could not retrieve translation at this time. %1 bytes downloaded Check for translation uiform Name Description Order Enabled Module Menu Label &Close UI Form Name is Invalid <p>You must enter a valid name for this UI Form. UI Form Source is Empty <p>You must enter some source for this UI Form. Move to different package? Do you want to move this screen to the %1 package? <p>The screen was saved to its original location but could not be moved: %1 <p>The screen was saved to its original location but could not be moved: <pre>%1</pre> Open File UI (*.ui) Could not import file Could not load .ui (%1) Save File Could not export file A System Error occurred at customCommands::%1 Screen No&tes: [ Not in a Package ] &Enabled &Cancel Na&me: &Grade: &Package: &Save &Import &Export Scripts &New &Edit &Delete Commands Package Delete Script? <p>Are you sure that you want to completely delete the selected script? Delete Command? <p>Are you sure that you want to completely delete the selected command? Save first? The screen appears to have changed. Do you want to save your changes? Edit uiforms Name Description Grade Enabled Deleting Screen Getting Screens Getting Form Could not load file There was an error loading the UI Form from the database. <p>Could not interpret the UI Form data as a UI definition. List Screens Screens: Organize By Package &Close &New &Edit &Delete &Test Package Really delete? Are you sure you want to delete this screen? unappliedAPCreditMemos Doc. # Vendor Amount Amount (%1) Applied Applied (%1) Balance Currency &Close &Print &New &View &Apply List Unapplied A/P Credit Memos Balance (%1) Unapplied Accounts Payable Credit Memos: unappliedARCreditMemos Doc. # Cust. # Customer Amount Applied Balance Currency Getting Credit Memos Unapplied A/R Credit Memos: &Close &Print &New &View &Apply List Unapplied A/R Credit Memos uninvoicedShipments Order/Line # Cust./Item Number Cust. Name/Description Shipped Selected Select This Order for Billing... Uninvoiced Shipments Only Show Unselected Shipments &Close &Print Uninvoiced Shipments: UOM unpostedCreditMemos C/M # Prnt'd Customer Hold Edit... View... Post... Unposted Credit Memos: &Close &New &Edit &View &Print &Post &Delete Memo Date G/L Dist Date Credit Memo Date A System Error occurred posting Credit Memo#%1. %2 Delete Selected Credit Memos? <p>Are you sure that you want to delete the selected Credit Memos? Could not delete Credit Memo. Error deleting Credit Memo %1 List Unposted Credit Memos Post Credit Memo Transaction Canceled Access Denied You may not view or edit this Credit Memo as it references a Site for which you have not been granted privileges. unpostedGLTransactions Date Source Doc. Type Doc. # Reference Account Debit Credit Posted View... View Voucher... View Invoice... View Purchase Order... Unposted G/L Transactions Period Name: &Cancel Open Period &Print The following G/L Transactions will be posted to the Trial Balance if you open this period: unpostedGlSeries Date Source Doc. Type Doc. # Reference Account Debit Credit Cancel G/L Transactions? <p>Are you sure you want to delete these unposted G/L Transactions? Edit G/L Series... View G/L Series... Delete G/L Series... Post G/L Series... Unposted G/L Series Entries Unposted G/L Series Entries: &Close &Print &New &Edit Post &Delete View unpostedInvoices Unposted Invoices Invoice # Prnt'd S/O # Customer Ship-to Invc. Date Delete Selected Invoices Delete Cancel Invoice Has Value 0 Invoice #%1 has a total value of 0. Would you like to post it anyway? System Error posting Invoice #%1 %2 Could not post Invoice #%1 because of a missing exchange rate. Post Invoices Transaction Canceled A System Error occurred posting Invoice #%1. %2 A/R Journal Series General Ledger Series Edit... View... Delete... Print... Post... P&rint Journal Ship Date G/L Dist Date <p>Are you sure that you want to delete the selected Invoices? Error deleting Invoice %1 Invoice Date List Unposted Invoices Recurring P/O # Access Denied You may not view or edit this Invoice as it references a Site for which you have not been granted privileges. Total Amount unpostedPoReceipts Line # Due Date Item Number UOM Vend. Item # Ordered Received To Receive Receipt Date G/L Post Date Cancel Receipts? Purchase Order %1 is being drop shipped against a Sales Order that is on Hold. The Sales Order must be taken off Hold before the Receipt may be Posted. Cannot Ship Order Edit Receipt... Delete Receipt... Post Receipt... Non-Inventory N/A &Close &Print &New &Edit Post &Delete Order # Type <p>Are you sure you want to delete these unposted Receipts? View Order Item... Unposted Receipts: View Order Item From List Unposted Receipts Unposted Receipts Post Canceled Site unpostedPurchaseOrders Vendor Vendor Type Vendor Type Pattern Purchase Agent Vendor # Due Date Vend. Type Agent Delete Selected Purchase Orders <p>The Purchase Order that you selected to delete was created to satisfy Sales Order demand. If you delete the selected Purchase Order then the Sales Order demand will remain but the Purchase Order to relieve that demand will not. Are you sure that you want to delete the selected Purchase Order? Delete Purchase Order? Edit... View... Delete... Print... List Open Purchase Orders Unreleased Open Status Nothing To Edit <p>There were no selected Purchase Orders that you could edit. <p>Are you sure that you want to delete the selected Purchase Orders? <p>Only Unposted Purchase Orders may be deleted. Check the status of Purchase Order %1. If it is 'U' then contact your system Administrator. Nothing To Delete <p>There were no selected Purchase Orders that could be deleted. Nothing To Post <p>There were no selected Purchase Orders to be posted. P/O # Site Release... Access Denied Printed Open Purchase Orders <p>You may not view or edit this Purchase Order as it references a Site for which you have not been granted privileges. uom No UOM Name Entered You must enter a valid UOM name before saving this UOM. A System Error occurred at %1::%2. Unit of Measure &Name: &Description: UOM/UOM Fractional &View &Edit Global Conversion Ratios: &New &Delete From Value To Value Set Item Weight? The Item Weight UOM has already been set. Are you sure you want to clear the existing entry and set %1 to be the Item Weight UOM? Item weight unit of measure uomConv &Close You must select a From UOM. You must select a To UOM. You must enter a valid Ratio before saving this UOM Conversion. Cannot Save UOM Conversion A System Error occurred at %1::%2. Conversion Per 1.0 Fractional &Cancel &Save uoms UOM Description Units of Measure: &Close &Print &New &Edit &View &Delete List Units of Measure Item Weight updateABCClass Start Evaluation Date End Evaluation Date Enter Class Code Pattern You must enter the Class Code pattern to be used when updating Item Site Class Codes or select a Class Code from the Class Code list. Enter Evaluation Start Date You must enter the Start Date of the evaluation period. Enter Evaluation End Date You must enter the End Date of the evaluation period. Enter Class A Cutoff % You must enter the cutoff point for Class A Items. Enter Class B Cutoff % You must enter the cutoff point for Class B Items. ABC Class Code Updated The ABC Class Code was updated for %1 Item Sites. A System Error occurred at %1::%2. &Close Update ABC Class Class &A Cutoff: Class &B Cutoff: % &Cancel &Update updateActualCostsByClassCode Update Standard Costs By Class Code &Roll Up Standard Costs A System Error occurred at %1::%2. Illegal parameter value '%3' for 'costtype' Update Actual Costs by Class Code &Roll Up Actual Costs Update Lower Level Material Costs Update Direct Labor Cost Update Lower Level Direct Labor Cost Update Overhead Cost Update Lower Level Overhead Cost Update Machine Overhead Update Lower Machine Overhead Update User Costs Update Lower Level User Costs &Cancel &Update &Select all Costs updateActualCostsByItem Update Standard Costs By Item &Roll Up Standard Costs A System Error occurred at %1::%2. &Close Update Actual Costs by Item &Roll Up Actual Costs Update Lower Level Material Costs Update Direct Labor Cost Update Lower Level Direct Labor Cost Update Overhead Cost Update Lower Level Overhead Cost Update Machine Overhead Update Lower Machine Overhead Update User Costs Update Lower Level User Costs &Cancel &Update &Select all Costs updateCreditStatusByCustomer In Good Standing On Credit Warning On Credit Hold Update Credit Status by Customer Current Credit Status: New Credit Status &Cancel &Update updateCycleCountFrequency Update Cycle Count Frequency Class &A Frequency: Class &B Frequency: Class &C Frequency: Days &Cancel &Update updateItemSiteLeadTimes Update Item Site Lead Time Days Pad Lead Time by: Days &Cancel &Update updateLateCustCreditStatus Update Late Customer Credit Status Check and Update Customers Credit Status if they have Late Open Items &Cancel &Update updateListPricesByProductCategory Enter a Update Percentage You must indicate the percentage to update the selected Pricing Schedule. Update List Prices by Product Category Update Prices by: Percent Fixed Amount &Cancel &Update updateOUTLevelByItem Update Order Up To Level by Item Days of Stock at Reorder Level Item Site Lead Time + Days Fixed Days: &Cancel &Update Periods to Include in Analysis Calendar: Incomplete Data You must select at least one Period to continue. updateOUTLevels Update Order Up To Levels by Planner Code Days of Stock at Reorder Level Item Site Lead Time + Days Fixed Days: &Cancel &Update Periods to Include in Analysis Calendar: Incomplete Data You must select at least one Period to continue. updateOUTLevelsByClassCode Update Order Up To Levels by Class Code Days of Stock at Reorder Level Item Site Lead Time + Days Fixed Days: &Cancel &Update Periods to Include in Analysis Calendar: Incomplete Data You must select at least one Period to continue. updatePrices Schedule Description Effective Expires Incomplete Data You must select an Item to continue. You must select a Pricing Schedule to continue. You must provide a Value to continue. Success Update Completed. Update Pricing Schedules Update By Product Category Item Group Item &Cancel &Update Show Current Show Expired Show Future Available > < >> << Selected Update Prices by: Percent Fixed Amount Also Update Characteristic Prices updateReorderLevels Days of Stock at Reorder Level Item Site Lead Time + Days Fixed Days: &Cancel Periods to Include in Analysis Calendar: Site Item Number Description Leadtime Curr. Level Days Stock Total Usage New Level No item sites records found. No Calendar Periods selected. Update Reorder Levels Criteria Q&uery Site Selection Options Preview Results Update Immediately Results Total Days Analyzed: ot &Post user &Close Enhanced Authentication User Information &Username: Proper &Name: &Email Address: &Active &Initials: &Password: &Verify: Purchasing Agent Can Create System Users Disable Export Display Contents Use Enhanced Authentication L&ocale: 5 CRM Account... &Save &Cancel &Module: Add-> Add All->> <-Revoke <<-Revoke All Roles Employee: Privileges Cannot save User You must enter a valid Username before you can save this User. Deleting Privileges The Username cannot include any spaces. You must enter a valid Password before you can save this User. The entered password and verify do not match. Please enter both again carefully. Creating User Saving User Setting Password Getting Groups Please select an Available Privilege. Granting Privilege Granting Privileges Please select a Granted Privilege. Revoking Privileges Granting Group Privileges Revoking Group Privileges Error User names must begin with a letter. Getting User No Spaces Allowed <p>Usernames cannot include space characters but must also match the associated CRM Account numbers. Please Cancel the User window and remove the spaces from the CRM Account number before trying to create this User. Getting User Sites <p>You have changed this user's Enhanced Authentication option. The password must be updated in order for this change to take full effect. Granting Site Privilege Revoking Site Privilege Getting Sites Getting Ungranted Sites Getting Granted Sites Sites Grant Access to all Sites Grant access only to selected Sites userCostingElement &Close Cannot Save Costing Element This Costing Element already exists. You have been placed in edit mode. A Costing Elements with the entered code already exists. You may not create a Costing Element with this code. A System Error occurred at %1::%2. User Costing Element Element &Name: &Active Accept P/&O Distributions Use Costing Item for Cost Source Expense Account: &Cancel &Save You must enter a Name for this Costing Element. userList Username Proper Name User List Users: &Cancel &Select userPreferences List Search User Preferences Current &User &Selected User: Background Image None Image: ... Defaults List Numeric Item Numbers First Default Ellipses Action: Show windows inside workspace Idle Timeout: Show CRM Menu Show CRM Toolbar Interface Options Show Manufacture Menu Show Manufacture Toolbar Show Sales Menu Show Sales Toolbar Show Accounting Menu Show Inventory Menu Show Inventory Toolbar Show Products Menu Show Products Toolbar Show Schedule Menu Show Schedule Toolbar Show Purchase Menu Keystroke Action Module Name Description Notify Spell Dictionary Missing The following Hunspell files are required for spell checking: <p> .aff <p> .dic .aff Cannot save User You must enter a valid Current Password before you can save this User. You must enter a valid Password before you can save this User. Please Verify Current Password. Password do not Match The entered password and verify do not match Please enter both again carefully. F%1 Yes No Application Enable Spell Check on Text Edit Fields Copy Lists to Rich Text Plain Text Free Floating Windows Get Translations... Get Dictionaries... Menu Show Purchase Toolbar Show Accounting Toolbar Hot Keys &New &Edit &Delete Events Event: Password Username Current Password Retype Password Advanced Enable Script Debugging New Password Ignore Missing Translations Site Preferred Site: Site: Alternating Row Colors Send Email notification of selected Events Alarms Default Actions Event Email System Message users Username Proper Name Status Error getting Users Active A System Error occurred at %1::%2. Inactive &Show Inactive Users Users: &Close &Print &New &Edit List Users vendor Number Name &Close Please enter a Number for this new Vendor. Please enter a Name for this new Vendor. The Routing Number is not valid. The Account Number is not valid. Please enter an Individual Name if EFT Check Printing is enabled and '%1' is checked. Vendor Vendor #: Vendor Type: CRM Account... &Active &Cancel &Save General Default FOB Sells &Purchase Order Items Receives a &1099 &Qualified Addresses Print &New &Edit &View &Delete Notes Comments Contact 1 Contact 2 Question Saving Address Change This One Change Address for All Cancel Tax Authority Registration # Getting Id You must select a Terms code for this Vendor. You must select a Vendor Type for this Vendor. Database Error Error Saving Address <p>There was an error saving this address (%1). Check the database server log for errors. Error Saving Vendor Releasing Number Getting Vendor Getting CRM Account Could not find the Vendor information. Perhaps the Vendor and CRM Account have been disconnected. Getting Vendor Addresses Getting Tax Registrations Deleting Tax Registration At Last Record You are already on the last record. At First Record You are already on the first record. Save Changes? Would you like to save any changes before continuing? Name: Number: Next Previous Tax None Tax Registration Numbers: New Edit View Delete City State Country Postal Code Tax Zone Cannot Save Vendor <p>The newly entered Vendor Number cannot be used as it is already used by the Vendor '%1'. Please correct or enter a new Vendor Number. <p>There are multiple uses of this Vendor's Address. What would you like to do? Vendor Exists <p>This number is currently used by an existing Vendor. Do you want to edit that Vendor? Invalid Number <p>This number is currently assigned to another CRM account. Convert <p>This number is currently assigned to CRM Account. Do you want to convert the CRM Account to a Vendor? N/A Default Terms: Ship Via: Currency: Receiving Site Vendor Specific: Default Miscellaneous Distribution Account Tax Code Expense Category May only Sell Items defined by an Item Source Check for matching Voucher and Purchase Order amounts Default Tax Zone: Contacts Main Alternates Order Notes Transmission Checks Enable EFT Check Printing Routing Number: Account Number: Account Type: Use Instead of Vendor Number and Name: Identification Number: vendorAddress &Close Vendor Address Number: Name: &Cancel &Save Contact Notes: Question Saving Address Change This One Change Address for All Cancel There are multiple uses of this Vendor Address. What would you like to do? There was an error saving this address (%1). Check the database server log for errors. vendorAddressList Code Name Address Vendor Address List Vendor: &Cancel &Select Vendor Addresses: vendorPriceList Base Site Order Type Qty Break Currency Unit Price Discount Percent Discount Fixed Amt. Unit Price (%1) Type Nominal Discount Price Fixed Percent Mixed All Into Stock Drop Ship Price List Quantity: Unit Price: Extended Price: &Cancel &Select &Items: vendorType Invalid Vendor Type Code You must enter a valid Code for this Vendor Type before creating it. A System Error occurred at %1::%2. Vendor Type C&ode: &Description: Duplicate Entry The Code you have entered for this Vendor Type is already in the system. vendorTypes Code Description Cannot Delete Vendor Type The selected Vendor Type cannot be deleted as there are one or more Vendors assigned to it. You must reassign these Vendors before you may delete the selected Vendor Type. Vendor Types: &Close &Print &New &Edit &Delete List Vendor Types vendorWorkBench Earliest Latest Edit View No Vendor Selected You must select a valid Vendor. Vendor Workbench Name: Name Default Terms: Type: Active Account... Vendor #: Close Print First Purchase: Last Year's Purchases: Most Recent Purchase: YTD Purchases: Backlog: Open Balance: Contacts Contact 1 Contact 2 Purchase Orders Receipts and Returns Payables Credit Memos A/P History Checks Default Ship Via: vendors Vendors Show Inactive Vendor Number Pattern Vendor Name Pattern Vendor Type Pattern Contact Name Pattern Phone Pattern Email Pattern Street Pattern City Pattern State Pattern Postal Code Pattern Country Pattern Type Number Name First Last Phone Email Address City State Country Postal Code Are you sure that you want to delete this vendor? Error Deleting Delete Vendor? Edit Vendor... View Vendor... Delete Vendor... viewCheckRun Void Misc. Prt'd Chk./Voucher/RA # Recipient/Invc./CM # Check Date Amount Currency EFT Batch All Checks... Post All... View Check Run Bank Account: &Close Checks: Replace All Selected Check... Check Run... Edit List Prepare... Pri&nt Po&st New &Void Edit Delete Replace voidChecks Check %1 Void Checks Bank Account: First Check #: # of Checks to Void: Issue Replacement Checks &Cancel &Void voucher # Status Item Number UOM Vend. Item # Ordered Uninvoiced Rejected Quantity Amount Account &Close Cannot Save Voucher Enter Voucher Number Getting P/O Information Getting Misc. Distributions Getting Distributions Getting ID Getting Voucher Save Voucher? Do you want to save this voucher? Deleting Placeholder Getting Due Date View P/O Item... Voucher #: Order #: Amount to Distribute: Amount Distributed: Balance: Tax Zone: Flag for &1099 Vendor: [*]Voucher Invoice Date: Distribution Date: Due Date: Terms: Vendor Invoice #: Reference: None Notes &Cancel &Save &Distributions... &New &Edit &Delete PO Unit Price PO Ext Price PO Line Freight Inserting Voucher Reused Invoice Check Saving Voucher Looking for Existing Voucher Voucher for P/O # %1 Error Distributing Distributing Line Clearing Distributions Deleting Distributions Closed Unposted Partial Received Open Updating Voucher Distribute &Line &Clear Distribute &All Line Items Misc. Distributions Invoiced <p>You must enter an PO Number before you may save this Voucher. <p>You must enter an Invoice Date before you may save this Voucher. <p>You must enter a Due Date before you may save this Voucher. <p>You must enter a Distribution Date before you may save this Voucher. <p>You must enter a Vendor Invoice Number before you may save this Voucher. <p>A Voucher for this Vendor has already been entered with the same Vendor Invoice Number. Are you sure you want to use this number again? <p>You must enter a valid Voucher Number before continuing voucherItem Cost Element Amount Receipt/Reject Date Qty. Unit Price Tagged Receiving Reject Cannot Save Voucher Item You must enter a postive Quantity to Voucher before saving this Voucher Item You must make at least one distribution for this Voucher Item before you may save it. None Voucher Item Line #: &Cancel &Save Quantity Ordered: Received: Rejected: Uninvoiced Received: Uninvoiced Rejected: Close Distributions Tax Type: Tax: Freight: Detail Vend. Item Number: UOM: Vend. Item Descrip.: Due Date: Total Distributed: &New Order Number: Qty. To Voucher: Amt. To Voucher: Uninvoiced Recepts and Returns &Edit &Delete Invoice Value Mismatch Yes No 0.00 Line Item Freight: Ext. Price: Unit Price: 0 Correct Receipt... Split Receipt... The application has encountered an error and must stop editing this Voucher Item. %1 voucherItemDistrib None Voucher Item Distribution Costing Element: Amount to Distribute: Discountable Notes: &Cancel &Save voucherMiscDistrib Select Account You must select an Account to post this Miscellaneous Distribution to. Select Tax Code You must select a Tax Code to post this Miscellaneous Distribution to. A System Error occurred at %1::%2. Miscellaneous Voucher Distribution Account Tax Code None Expense Category Amount to Distribute: Discountable Notes: &Cancel &Save Select Expense Category You must select an Expense Category to post this Miscellaneous Distribution to. warehouse Name Description &Close C&ode: &Description: &Active Default &F.O.B.: Next &Bill of Lading #: Next Count &Tag #: Force the use of Count Slips &Cancel &Save Tax Zone: Scheduling Sequence: Contact Enforce ARBL Naming Convention Aisle Size: Rack Size: Bin Size: Location Size: Allow Alpha Characters Enforce the use of Zones Shipping Commission: Post Unassigned Transactions to: &New &Edit &Delete Comments Question Saving Address <p>There are multiple uses of this Site Address.</p><p>What would you like to do?</p> Change This One Change Address for All Cancel There was an error saving this address (%1). Check the database server log for errors. None General Shipping Comments: Default Shipping Form: Default Ship-Via: Default Cost Category: Cannot Save Site <p>You must enter a code for this Site before saving it. <p>You must enter a Type for this Site before saving it. <p>The Count Tag prefix entered has been used in another Site. To enable Count Tag audits, the application requires a unique Count Tag prefix for each Site. Please enter a different Count Tag prefix. <p>The new Site information cannot be saved as the new Site Code that you entered conflicts with an existing Site. You must uniquely name this Site before you may save it. <p>You must enter a default Account for this Site before saving it. <p>You must select a Cost Category for this Transit Site before saving it. Checking Count Tag Checking Site Code This Site is used in an active Item Site and must be marked as active. Deactivate the Item Sites to allow this Site to not be active. Checking Active Itemsites Error Saving Cannot Delete Site Zone <p>The selected Site Zone cannot be deleted as one or more Site Locations have been assigned to it. You must delete or reassign these Site Location before you may delete the selected Site Zone. Site Type: Inventory Site Transit Site Shipping &Site Site Locations Site Zones warehouseZone &Close <p>The Site Zone information cannot be saved as the Site Zone Name that you entered conflicts with an existing Site Zone. You must uniquely name this Site Zone before you may save it. Checking Site Zone Name Cannot Save Site Zone &Name: &Description: &Cancel &Save Site Zone <p>You must enter a valid name before saving this Site Zone. warehouses Active Description Address Edit... View... List Item Sites... &Close &Print &New &Edit &View Site Type List Sites Show &Inactive Sites Sites: welcomeStub Welcome Do not show again. <p>It appears you do not have an xTuple translation file installed on your system. Please use the following link to find a translation file for your language and learn more about how to install translation files in xTuple ERP:<p>%1<p> woList Order# Status Whs. Item Number Description woMaterialItem &Close Cannot Create W/O Material Requirement A W/O Material Requirement cannot be created for the selected Work Order/Item as the selected Item does not exist in the warehouse that the selected Work Order does. Error Saving Work Order Material Requirement Qty. Per: Scrap %: Qty. Required: Issue Method: Push Pull Mixed &Cancel &Save Issue UOM: Component Details Pick List Fixed Qty.: Notes Reference woSearch Order# Status Whs. Item Number Description workOrder &Close A System Error occurred at %1::%2, W/O ID %3. Item# Description Status Scrap Start Date Due Date A System Error occurred at %1::%2, Planned Order ID %3. The Work Order was created but not Exploded as the Work Order status is not Open You have entered an invalid Qty. Ordered. Please correct before creating this Work Order Order# Qty Per. Ord/Req. UOM Issued Received On hand Short Setup Remain. Run Remain. Reference <p>The selected Site for this Work Order is not a "Supplied At" Site. You must select a different Site before creating the Work Order. Invalid Item Item %1 is set to Job Costing on Item Site %2. Work Orders for Job Cost Item Sites may only be created by Sales Orders. A System Error occurred at %1::%2. Invalid Order Quantitiy Order Parameters for this Item do not allow a quantitiy of %1 to be created. You must create an order for at least %2 of this item. Do you want to update the order quantity and create the order? &Yes &No Work Order not Created There was an error creating the work order. Make sure the itemsite you are creating the work order in is set to allow manufacturing of the item. Work Order not Exploded The Work Order was created but not Exploded as Component Items defined in the Bill of Materials for the selected Work Order Item are not valid in the selected Work Order Site. You must create valid Item Sites for these Component Items before you may explode this Work Order. Cannot Save Work Order <p>The Work Order that you selected to delete is a child of another Work Order. If you delete the selected Work Order then the Work Order Materials Requirements for the Component Item will remain but the Work Order to relieve that demand will not. Are you sure that you want to delete the selected Work Order? <p>The Work Order that you selected to delete was created to satisfy Sales Order demand. If you delete the selected Work Order then the Sales Order demand will remain but the Work Order to relieve that demand will not. Are you sure that you want to delete the selected Work Order? <p>Are you sure that you want to delete the selected Work Order? Delete Work Order? Change Priority Change Date The new Order Quantity that you have entered does not meet the Order Parameters set for the parent Item Site for this Work Order. In order to meet the Item Site Order Parameters the new Order Quantity must be increased to %1. Do you want to change the Order Quantity for this Work Order to %2? Change Qty A quantity change from %1 to %2 will update all work order requirements. Are you sure you want to change the work order quantity? Cannot return Work Order Material This Work Order has had material received against it and thus the material issued against it cannot be returned. You must instead return each Work Order Material item individually. A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2, Error #%3. Material Return Transaction Canceled A System Error occurred at returnWoMaterialBatch::%1, W/O ID #%2. Insufficient Inventory Item Number %1 in Site %2 is a Multiple Location or Lot/Serial controlled Item which is short on Inventory. This transaction cannot be completed as is. Please make sure there is sufficient Quantity on Hand before proceeding. A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2, Error #%3. Material Issue A System Error occurred at issueWoMaterialBatch::%1, Work Order ID #%2. W/O Material Requirement cannot be Deleted <p>This W/O Material Requirement cannot be deleted as it has has material issued to it. You must return this material to stock before you can delete this Material Requirement. Would you like to return this material to stock now? <p>This W/O Material Requirement cannot be deleted as it has material issued to it. You must return this material to stock before you can delete this Material Requirement. Explode... Implode... Release Recall Delete... Close... New Material... Issue Batch... Return Batch... Post Production... Correct Production Posting... Running Availability... Inventory Availability... Reprioritize... Reschedule... Change Quantity... Edit... View... Issue... Return... Scrap... Substitute... Availability... Substitute Availability... Print Traveler... Work Order Work Order #: Priority: &Cancel Qty. Ordered: Qty. Received: Due Date: Start Date: Lead Time: Days Detail Show Operations Materials Indented Comments &Print Traveler Name Value &Save You have entered an invalid Due Date. Please correct before updating this Work Order You have entered an invalid Start Date. Please correct before updating this Work Order A priority change from %1 to %2 will update all work order requirements. Are you sure you want to change the work order priority? Changing the start or due date will update all work order requirements. Are you sure you want to reschedule all dates? Changing the due date may change the Bill of Material components that are effective. You may want to consider imploding and exploding the Work Order. Invalid Order Qty Characteristics Costing Accumulated Costs Posted: Received: WIP: To Date Proportional Revision Bill of Materials Bill of Operations Documents Invalid Site Site: Cost Recognition Assembly Disassembly Project #: Notes workOrderMaterials Component Item Description Iss. Meth. Fxd. Qty. Qty. Per Scrap % Required Issued Scrapped Balance Due Date Edit... View... Delete... View Availability... View Item-Defined Subsitute Availability... Substitute... W/O Material Requirement cannot be Deleted Maintain Work Order Materials &Close Material Requirements: &New &Edit &View &Delete Totals: Non-Pick List Items: Number Of Items Pick List Items: Total Qty. Per Current Std. Material Cost: Current Act. Material Cost: Maximum Desired Cost: <p>This W/O Material Requirement cannot be deleted as it has has material issued to it. You must return this material to stock before you can delete this Material Requirement. Would you like to return this material to stock now? <p>This W/O Material Requirement cannot be deleted as it has material issued to it. You must return this material to stock before you can delete this Material Requirement. Iss. UOM Push Pull Mixed Error Notes Reference xTuple Version Please translate this Version string to the base version of the application you are translating. This is a hack to embed the application version number into the translation file so the Update Manager can find the best translation file for a given version of the application. xTupleDesigner Widget Box Object Inspector Property Editor Signal/Slot Editor &File &Edit &Form &Tool xTupleDesignerActions &Close &Open... &Revert &Save... CTRL+W CTRL+O CTRL+R CTRL+S CTRL+Z CTRL+SHIFT+Z Edit Widgets Save changes? Do you want to save your changes before closing the window? Open File UI (*.ui) Really revert? Are you sure you want to throw away your changes since the last save? Database only File only Database and File Save File Could not export file Not implemented yet. Buddy editing is not implemented yet. Visual Signal/Slot editing is not implemented yet. Tab Order editing is not implemented yet. xsltMap You do not have sufficient privilege to view this window XSLT Files (*.xsl *.xslt) Cannot Save XSLT Map <p>You must enter a name for this XSLT Map before saving it. <p>You must enter a Document Type, a System Identifier, or both before saving this XSLT Map. <p>You must enter either an Import or Export XSLT File Name before saving this XSLT Map. <p>This Name is already in use by another XSLT Map. XSLT Map Map Name: Document Type: System Identifier: Import XSLT File Name: Export XSLT File Name: Cancel Save zeroUncountedCountTagsByWarehouse Zero Uncounted Count Tags by Warehouse &Close &Zero Co&mments: qt-client-4.1.0/share/index.html000066400000000000000000000015161217451700100165140ustar00rootroot00000000000000 xTuple ERP: Help Files Not Installed

    You have asked for help with the xTuple ERP application but do not have the documentation locally installed. You can do one of the following:

    • Read the latest available documentation directlly from the xTuple web site: http://www.xtuple.org/docs/reference-guide
    • Download and follow the Instructions for setting up online help at http://www.xtuple.org/AppBasedHelpFiles/

    You can learn more about the xTuple ERP applications at http://www.xtuple.org.

    qt-client-4.1.0/share/reports/000077500000000000000000000000001217451700100162125ustar00rootroot00000000000000qt-client-4.1.0/share/reports/APAging.xml000066400000000000000000000574531217451700100202200ustar00rootroot00000000000000 AP 30 60 90 Aging APAging Enhanced AP Aging - Uses 30-60-90 columns - User provides Relative Date - all amounts in base currency based on Document Date. Date Relative to Today Letter 50 50 50 50 detail SELECT apaging_docdate, apaging_duedate, apaging_ponumber, apaging_docnumber, apaging_invcnumber, apaging_doctype, apaging_vend_id, apaging_vend_number, apaging_vend_name, apaging_vend_vendtype_id, apaging_vendtype_code, apaging_terms_descrip, formatMoney(apaging_apopen_amount) AS apaging_apopen_amount, apaging_cur_val, formatMoney(apaging_cur_val) AS apaging_cur_amt, apaging_thirty_val,formatMoney(apaging_thirty_val) AS apaging_thirty_amt, apaging_sixty_val, formatMoney(apaging_sixty_val) AS apaging_sixty_amt, apaging_ninety_val,formatMoney(apaging_ninety_val) AS apaging_ninety_amt, apaging_plus_val, formatMoney(apaging_plus_val) AS apaging_plus_amt, apaging_total_val, formatMoney(apaging_total_val) AS apaging_total_amt, apaging_disc_val, formatMoney(apaging_disc_val) AS apaging_disc_amt, apaging_discdate, apaging_discdays, apaging_discprcnt FROM apaging(<? value("relDate") ?>, <? value("useDocDate") ?>) <? if exists("vend_id") ?> WHERE (apaging_vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> WHERE (apaging_vend_vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> WHERE (apaging_vendtype_code ~ <? value("vendtype_pattern") ?>) <? endif ?>; 77 45 40 110 12 Arial 8 bold Parameter Query relDate
    detail Vendor apaging_vend_number 113 125 25 220 12 Arial 8 normal detail apaging_vend_number 0 105 1000 105 0 125 40 220 12 Arial 8 normal detail apaging_terms_descrip 0 5 1000 5 0 125 10 220 12 Arial 8 normal detail apaging_vend_name 96 0 50 220 12 Arial 8 bold detail vend_name 530 5 75 12 Arial 8 normal detail apaging_thirty_val qty 237 32 237 32 0 450 5 75 12 Arial 8 normal detail apaging_cur_val qty 220 50 75 12 Arial 8 normal detail apaging_total_val qty 938 5 55 12 Arial 8 normal detail apaging_disc_val qty 620 5 70 12 Arial 8 normal detail apaging_sixty_val qty 705 5 70 12 Arial 8 normal detail apaging_ninety_val qty 0 0 1000 0 0 780 5 75 12 Arial 8 normal detail apaging_plus_val qty detail 18 860 0 70 12 Arial 8 normal detail apaging_discdate 939 0 55 12 Arial 8 normal detail apaging_disc_amt 270 0 85 12 Arial 8 normal detail apaging_duedate 20 0 80 12 Arial 8 normal detail apaging_invcnumber 0 0 15 12 Arial 8 normal detail apaging_doctype 530 0 75 12 Arial 8 normal detail apaging_thirty_amt 110 0 80 12 Arial 8 normal detail apaging_docnumber 450 0 75 12 Arial 8 normal detail apaging_cur_amt 795 0 55 12 Arial 8 normal detail apaging_plus_amt 355 0 80 12 Arial 8 normal detail apaging_apopen_amount 620 0 70 12 Arial 8 normal detail apaging_sixty_amt 705 0 70 12 Arial 8 normal detail apaging_ninety_amt 200 0 85 12 Arial 8 normal detail apaging_docdate
    102 220 35 75 12 Arial 8 normal detail apaging_total_val qty 620 5 70 12 Arial 8 normal detail apaging_sixty_val qty 530 5 75 12 Arial 8 normal detail apaging_thirty_val qty 450 5 75 12 Arial 8 normal detail apaging_cur_val qty 710 5 70 12 Arial 8 normal detail apaging_ninety_val qty 780 5 75 12 Arial 8 normal detail apaging_plus_val qty 942 5 55 12 Arial 8 normal detail apaging_disc_val qty 515 80 42 12 Arial 8 normal Context Query page_number 1 2 1000 2 2 47 515 25 42 12 Arial 8 normal Context Query page_number
    qt-client-4.1.0/share/reports/APApplications.xml000066400000000000000000000316611217451700100216120ustar00rootroot00000000000000 A/P Applications APApplications 0.05 0.05 Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("showChecks") ?> <? if exists("showCreditMemos") ?> 'Show Checks and Credit Memos' <? else ?> 'Show Checks' <? endif ?> <? elseif exists("showCreditMemos") ?> 'Show Credit Memos' <? else ?> '' <? endif ?> AS f_show, <? if exists("vend_id") ?> 'Vendor:' AS f_label, vend_number AS f_value <? elseif exists("vendtype_id") ?> 'Vendor Type:' AS f_label, vendtype_code AS f_value <? elseif exists("vendtype_pattern") ?> 'Vendor Type matches:' AS f_label, <? value("vendtype_pattern") ?> AS f_value <? else ?> 'Vendors:' AS f_label, 'All' AS f_value <? endif ?> <? if exists("vend_id") ?> FROM vendinfo WHERE vend_id=<? value("vend_id") ?> <? elseif exists("vendtype_id") ?> FROM vendtype WHERE vendtype_id=<? value("vendtype_id") <? endif ?> ; detail apApplications detail 146 5 140 745 140 2 565 63 100 20 Arial 10 bold head startdate 565 83 100 20 Arial 10 bold head enddate 10 63 139 20 Arial 10 normal head f_label 159 83 350 20 Arial 10 bold head f_show 157 63 300 20 Arial 10 bold head f_value 6 26 5 20 745 20 2
    detail detail 16 5 0 80 15 Arial 8 bold detail vend_number 620 0 65 15 Arial 8 bold detail f_amount 200 0 81 15 Arial 8 bold detail f_postdate 500 0 110 15 Arial 8 bold detail apapply_target_docnumber 700 0 45 15 Arial 8 bold detail currAbbr 340 0 110 15 Arial 8 bold detail apapply_source_docnumber 90 0 115 15 Arial 8 bold detail vend_name 291 0 40 15 Arial 8 normal detail apapply_source_doctype_qtdisplayrole 460 0 40 15 Arial 8 normal detail apapply_target_doctype_qtdisplayrole
    16 104 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 16 585 0 100 15 Arial 8 bold detail base_applied money
    qt-client-4.1.0/share/reports/APAssignmentsMasterList.xml000066400000000000000000000141751217451700100234700ustar00rootroot00000000000000 A/P Account Assignments Master List APAssignmentsMasterList Letter 50 50 50 50 detail SELECT CASE WHEN (apaccnt_vendtype_id=-1) THEN apaccnt_vendtype ELSE (SELECT vendtype_code FROM vendtype WHERE (vendtype_id=apaccnt_vendtype_id)) END AS vendtypecode, formatGLAccount(apaccnt_ap_accnt_id) AS apaccnt, formatGLAccount(apaccnt_prepaid_accnt_id) AS prepaidaccnt, formatGLAccount(apaccnt_discount_accnt_id) AS discountaccnt FROM apaccnt ORDER BY vendtypecode; 77 5 70 745 70 2 7 22 5 15 745 15 2
    detail detail 17 10 0 100 15 Arial 8 bold detail vendtypecode 120 0 175 15 Arial 8 bold detail apaccnt 320 -1 190 15 Arial 8 bold detail prepaidaccnt 530 -1 195 15 Arial 8 bold detail discountaccnt
    17 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/APCheck.xml000066400000000000000000000535171217451700100202050ustar00rootroot00000000000000 Sample Check Format - 3 Part - MC - Remit APCheck Sample Check Format - 3 Part - MC - Uses primary Vendor or address with names: REMIT, Remit, or remit if one exists. Letter 0 0 0 50 Head SELECT checkhead_id, checkhead_number, checkhead_for AS memo, formatDate(checkhead_checkdate) AS f_checkdate, formatMoney(checkhead_amount) AS f_amount, INITCAP(spellAmount(checkhead_amount, curr_id)) AS f_words, CASE WHEN(checkhead_void) THEN TEXT('V O I D') ELSE TEXT('') END AS f_void, CASE WHEN checkhead_recip_type = 'C' THEN (SELECT cust_number FROM custinfo WHERE (cust_id=checkhead_recip_id)) WHEN checkhead_recip_type = 'T' THEN (SELECT taxauth_code FROM taxauth WHERE (taxauth_id=checkhead_recip_id)) WHEN checkhead_recip_type = 'V' THEN (SELECT vend_number FROM vendinfo WHERE (vend_id=checkhead_recip_id)) ELSE 'Unknown Recipient Type' END AS recip_number, formatAddr(CASE WHEN checkhead_recip_type = 'C' THEN (SELECT cntct_addr_id FROM cntct, custinfo WHERE ((cust_cntct_id=cntct_id) AND (cust_id=checkhead_recip_id))) WHEN checkhead_recip_type = 'T' THEN (SELECT taxauth_addr_id FROM taxauth WHERE (taxauth_id=checkhead_recip_id)) WHEN checkhead_recip_type = 'V' THEN COALESCE((SELECT vendaddr_addr_id FROM vendaddrinfo WHERE ((UPPER(vendaddr_code)='REMIT') AND (vendaddr_vend_id=checkhead_recip_id))), (SELECT vend_addr_id FROM vendinfo WHERE (vend_id=checkhead_recip_id))) END) AS check_address, CASE WHEN checkhead_recip_type = 'C' THEN (SELECT cust_name FROM custinfo WHERE cust_id=checkhead_recip_id) WHEN checkhead_recip_type = 'T' THEN (SELECT taxauth_name FROM taxauth WHERE taxauth_id=checkhead_recip_id) WHEN checkhead_recip_type = 'V' THEN COALESCE((SELECT vendaddr_name FROM vendaddrinfo WHERE ((UPPER(vendaddr_code)='REMIT') AND (vendaddr_vend_id=checkhead_recip_id))), (SELECT vend_name FROM vendinfo WHERE (vend_id=checkhead_recip_id))) END AS recip_name, curr_symbol, curr_abbr, curr_name FROM checkhead, curr_symbol WHERE ((checkhead_curr_id = curr_id) AND (checkhead_id=<? value("checkhead_id") ?>) ); TopDetail2 SELECT --VOUCHER------------- 1 AS ord, 1 AS sequence_value, checkitem_invcnumber, checkitem_ponumber, formatMoney(checkitem_amount) AS f_amount, 'Invoice#: ' || vohead_invcnumber AS doc_number, formatDate(vohead_docdate) AS f_docdate, vohead_reference AS doc_reference, 'Voucher: ' || checkitem_vouchernumber AS vouchernumber, formatMoney(apopen_amount) AS amount, formatMoney(checkitem_discount) AS disc_cred FROM checkitem, vohead, apopen WHERE ((checkitem_checkhead_id= <? value("checkhead_id") ?>) AND (checkitem_vouchernumber = vohead_number) AND (apopen_docnumber = checkitem_vouchernumber) AND (apopen_doctype = 'V')) UNION SELECT --DEBIT MEMO ------------------------- 2 AS ord, 1 AS sequence_value, checkitem_invcnumber, checkitem_ponumber, formatMoney(checkitem_amount) AS f_amount, 'Debit Memo PO#: ' || checkitem_ponumber AS doc_number, '' AS f_docdate, 'Debit Memo: ' || checkitem_vouchernumber AS doc_reference, checkitem_vouchernumber AS vouchernumber, formatMoney(apopen_amount) AS amount, formatMoney(checkitem_discount) AS disc_cred FROM checkitem, apopen WHERE ((checkitem_checkhead_id= <? value("checkhead_id") ?>) AND (checkitem_vouchernumber = apopen_docnumber) AND (apopen_doctype = 'D')) UNION SELECT --CREDITs-------------------------- 3 AS ord, 1 AS sequence_value, checkitem_invcnumber, checkitem_ponumber, formatMoney(checkitem_amount) AS f_amount, 'Invoice#: ' || vohead_invcnumber AS doc_number, formatDate(vohead_docdate) AS f_docdate, 'Credit Applied: ' || apapply_source_doctype || ' ' || apapply_source_docnumber AS doc_reference, 'Voucher ' || checkitem_vouchernumber AS vouchernumber, '' AS amount, formatMoney((apapply_amount)) AS disc_cred FROM checkitem, vohead, apapply WHERE ((checkitem_checkhead_id=<? value("checkhead_id") ?>) AND (checkitem_vouchernumber = vohead_number) AND (apapply_target_docnumber = checkitem_vouchernumber )) UNION SELECT --NON-VENDOR----------------------- 4 AS ord, 1 AS sequence_value, checkitem_invcnumber, checkitem_ponumber, formatMoney(checkitem_amount) AS f_amount, checkitem_invcnumber AS doc_number, formatDate(checkitem_docdate) AS f_docdate, '' AS doc_reference, '' AS vouchernumber, '' AS amount, '' AS disc_cred FROM checkhead LEFT OUTER JOIN checkitem ON (checkitem_checkhead_id=checkhead_id) WHERE ((checkhead_id=<? value("checkhead_id") ?>) AND (checkhead_recip_type != 'V')) UNION SELECT --BLANK LINES FOR SPACING------------------ 5 AS ord, sequence_value, '' AS checkkitem_invcnumber, '' AS checkitem_ponumber, '' AS f_amount, '' AS vohead_invcnumber, '' AS f_docdate, '' AS doc_reference, '' AS vouchernumber, '' AS amount, '' AS disc_cred FROM sequence ORDER BY ord LIMIT 16; 6
    Top Detail Header Head 51 305 30 147 15 Arial 8 normal Context Query report_date 305 15 155 15 Arial 8 normal Head recip_name 5 45 805 45 0 51 7 51 7 0 705 15 90 15 Arial 10 normal Head checkhead_number 494 15 104 15 Arial 8 normal Head recip_number
    Top Detail TopDetail2 16 5 0 155 15 Arial 8 normal TopDetail2 doc_number 610 0 75 15 Arial 8 normal TopDetail2 disc_cred 310 0 100 15 Arial 8 normal TopDetail2 docdate 175 0 120 15 Arial 8 normal TopDetail2 doc_reference 468 0 100 15 Arial 8 normal TopDetail2 amount
    Top Detail Amount Head 36 468 0 100 15 Arial 8 normal Head f_amount 70 15 690 15 Arial 8 normal Head memo 395 0 55 15 Arial 10 normal Head curr_symbol
    Apchkitem Head 301 25 120 225 20 Arial 10 normal Head recip_name 420 100 121 20 Arial 10 normal Head f_checkdate 615 100 125 20 Arial 10 normal Head f_amount 30 55 560 24 Arial 12 normal Head f_words 25 135 270 15 10 Arial 10 normal Head check_address 70 280 690 15 Arial 8 normal Head memo 560 100 55 20 Arial 10 normal Head curr_symbol
    Bottom Detail Header Head 41 520 0 104 15 Arial 8 normal Head recip_number 320 15 147 15 Arial 8 normal Context Query report_date 710 0 90 15 Arial 10 normal Head checkhead_number 0 35 800 35 0 320 0 155 15 Arial 8 normal Head recip_name
    Bottom Detail TopDetail2 16 175 0 155 15 Arial 8 normal TopDetail2 doc_reference 5 0 160 15 Arial 8 normal TopDetail2 doc_number 468 0 100 15 Arial 8 normal TopDetail2 amount 610 0 75 15 Arial 8 normal TopDetail2 disc_cred 340 0 100 15 Arial 8 normal TopDetail2 docdate
    Bottom Detail Amount Head 37 70 15 690 15 Arial 8 normal Head memo 408 0 55 15 Arial 10 normal Head curr_symbol 468 0 100 15 Arial 8 normal Head f_amount
    qt-client-4.1.0/share/reports/APOpenItemsByVendor.xml000066400000000000000000000364361217451700100225450ustar00rootroot00000000000000 Open Payables APOpenItemsByVendor Letter 50 50 50 50 head SELECT <? if exists("vend_id") ?> (SELECT vend_name FROM vendinfo WHERE vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> (SELECT vendtype_code FROM vendtype WHERE vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> ('Vendor Type pattern = ' || <? value("vendtype_pattern") ?>) <? else ?> 'All Vendors' <? endif ?> AS selection, currConcat(baseCurrId()) AS baseCurr, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, formatDate(<? value("asofDate") ?>) AS asofDate; detail apOpenItems detail 166 5 160 745 160 2 550 108 100 15 Arial 10 bold head asofDate 550 65 100 15 Arial 10 bold head startdate 550 83 100 15 Arial 10 bold head enddate 695 143 50 15 Arial 8 normal head baseCurr 110 65 250 15 Arial 10 bold head selection 6 26 5 20 745 20 2 695 4 50 15 Arial 8 normal head baseCurr
    detail detail 16 305 2 80 15 Arial 8 bold detail f_docdate 250 2 50 15 Arial 8 bold detail apopen_ponumber 585 2 50 15 Arial 8 bold detail f_balance 530 2 50 15 Arial 8 bold detail f_paid 5 2 70 15 Arial 8 bold detail f_doctype 390 2 80 15 Arial 8 bold detail f_duedate 475 2 50 15 Arial 8 bold detail f_amount 75 2 50 15 Arial 8 bold detail apopen_docnumber 695 2 50 15 Arial 8 bold detail f_base_balance 640 2 50 15 Arial 8 bold detail currAbbr 130 2 115 15 Arial 8 bold detail vend_name
    16 102 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 16 642 0 100 15 Arial 8 bold detail base_balance qty
    qt-client-4.1.0/share/reports/ARAging.xml000066400000000000000000000535021217451700100202110ustar00rootroot00000000000000 AR 30 60 90 Aging ARAging Enhanced AR Aging - Uses 30-60-90 columns - User provides Relative Date - all amounts in base currency based on Document Date. 0.05 0.05 Letter 100 100 50 50 detail SELECT araging_docdate, araging_duedate, araging_ponumber, araging_docnumber, araging_doctype, araging_cust_id, araging_cust_number, araging_cust_name, araging_cust_custtype_id, araging_custtype_code, araging_terms_descrip, formatMoney(araging_aropen_amount) AS araging_aropen_amount, araging_cur_val, formatMoney(araging_cur_val) AS araging_cur_amt, araging_thirty_val,formatMoney(araging_thirty_val) AS araging_thirty_amt, araging_sixty_val, formatMoney(araging_sixty_val) AS araging_sixty_amt, araging_ninety_val,formatMoney(araging_ninety_val) AS araging_ninety_amt, araging_plus_val, formatMoney(araging_plus_val) AS araging_plus_amt, araging_total_val, formatMoney(araging_total_val) AS araging_total_amt FROM araging(<? value("relDate") ?>, <? value("useDocDate") ?>) <? if exists("cust_id") ?> WHERE (araging_cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> WHERE (araging_cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> LEFT OUTER JOIN custgrpitem ON (araging_cust_id=custgrpitem_cust_id) WHERE (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? elseif exists("custtype_pattern") ?> WHERE (araging_custtype_code ~ <? value("custtype_pattern") ?>) <? endif ?>; 81 60 40 110 11 Arial 8 bold Parameter Query relDate
    detail Customer araging_cust_number 113 0 100 980 100 0 0 5 967 5 0 125 40 220 11 Arial 8 normal detail araging_terms_descrip 125 25 220 11 Arial 8 normal detail araging_cust_number 125 10 220 11 Arial 8 normal detail araging_cust_name 111 825 5 70 11 Arial 8 normal detail araging_ninety_val qty 740 5 70 11 Arial 8 normal detail araging_sixty_val qty 250 50 75 11 Arial 8 normal detail araging_total_val qty 570 5 75 11 Arial 8 normal detail araging_cur_val qty 650 5 75 11 Arial 8 normal detail araging_thirty_val qty 5 50 220 11 Arial 8 bold detail araging_cust_name 0 5 967 5 0 900 5 70 11 Arial 8 normal detail araging_plus_val qty 237 31 237 31 0 detail 18 740 0 70 11 Arial 8 normal detail araging_sixty_amt 480 0 80 11 Arial 8 normal detail araging_aropen_amount 0 0 25 11 Arial 8 normal detail araging_doctype 40 0 61 11 Arial 8 normal detail araging_docnumber 215 0 85 11 Arial 8 normal detail araging_duedate 910 0 55 11 Arial 8 normal detail araging_plus_amt 825 0 70 11 Arial 8 normal detail araging_ninety_amt 120 0 85 11 Arial 8 normal detail araging_docdate 340 0 61 11 Arial 8 normal detail araging_ponumber 570 0 75 11 Arial 8 normal detail araging_cur_amt 650 0 75 11 Arial 8 normal detail araging_thirty_amt
    103 650 5 75 11 Arial 8 normal detail araging_thirty_val qty 740 5 70 11 Arial 8 normal detail araging_sixty_val qty 570 5 75 11 Arial 8 normal detail araging_cur_val qty 910 5 55 11 Arial 8 normal detail araging_plus_val qty 1 1 967 1 2 440 75 41 11 Arial 8 normal Context Query page_number 250 50 75 11 Arial 8 normal detail araging_total_val qty 825 5 70 11 Arial 8 normal detail araging_ninety_val qty 57 440 20 41 11 Arial 8 normal Context Query page_number
    qt-client-4.1.0/share/reports/ARApplications.xml000066400000000000000000000353441217451700100216160ustar00rootroot00000000000000 A/R Applications ARApplications Letter 50 50 50 50 head SELECT <? if exists("cust_id") ?> (SELECT (cust_number || '-' || cust_name) FROM custinfo WHERE (cust_id=<? value("cust_id") ?>) ) <? elseif exists("custtype_id") ?> (select (custtype_code||'-'||custtype_descrip) FROM custtype WHERE (custtype_id=<? value("custtype_id") ?>) ) <? elseif exists("custtype_pattern") ?> text(<? value("custtype_pattern") ?>) <? else ?> text('All Customers') <? endif ?> AS f_value, <? if exists("custtype_id") ?> text('Cust. Type:') <? elseif exists("custtype_pattern") ?> text('Cust. Type Pattern:') <? else ?> text('Customer:') <? endif ?> AS f_label, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("includeCashReceipts") ?> <? if exists("includeCreditMemos") ?> text('Show Cash Receipts and Credit Memos') <? else ?> text('Show Cash Receipts') <? endif ?> <? elseif exists("includeCreditMemos") ?> text('Show Credit Memos') <? else ?> text('Error: No transaction type selected.') <? endif ?> AS f_show; detail SELECT arapply_id, formatDate(arapply_postdate) AS f_postdate, formatMoney(arapply_applied) AS f_applied, cust_number, cust_name, (CASE WHEN (arapply_source_doctype='C') THEN <? value("creditMemo") ?> WHEN (arapply_source_doctype='R') THEN <? value("cashdeposit") ?> WHEN (arapply_fundstype='C') THEN <? value("check") ?> WHEN (arapply_fundstype='T') THEN <? value("certifiedCheck") ?> WHEN (arapply_fundstype='M') THEN <? value("masterCard") ?> WHEN (arapply_fundstype='V') THEN <? value("visa") ?> WHEN (arapply_fundstype='A') THEN <? value("americanExpress") ?> WHEN (arapply_fundstype='D') THEN <? value("discoverCard") ?> WHEN (arapply_fundstype='R') THEN <? value("otherCreditCard") ?> WHEN (arapply_fundstype='K') THEN <? value("cash") ?> WHEN (arapply_fundstype='W') THEN <? value("wireTransfer") ?> WHEN (arapply_fundstype='O') THEN <? value("other") ?> END || ' ' || CASE WHEN (arapply_source_doctype IN ('C','R')) THEN TEXT(arapply_source_docnumber) ELSE arapply_refnumber END) AS source, (CASE WHEN (arapply_target_doctype='D') THEN <? value("debitMemo") ?> WHEN (arapply_target_doctype='I') THEN <? value("invoice") ?> WHEN (arapply_target_doctype='K') THEN <? value("apcheck") ?> ELSE <? value("other") ?> END || ' ' || TEXT(arapply_target_docnumber)) AS target, currConcat(arapply_curr_id) AS currAbbr, currtobase(arapply_curr_id,arapply_applied,arapply_postdate) AS base_applied FROM arapply, custinfo WHERE ( (arapply_cust_id=cust_id) AND (arapply_postdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) AND (arapply_source_doctype IN ( <? if exists("includeCreditMemos") ?> <? if exists("includeCashReceipts") ?> 'K', 'C', 'R' <? else ?> 'C', 'R' <? endif ?> <? else ?> 'K' <? endif ?> )) <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> ) ORDER BY arapply_postdate, source; 146 5 140 745 140 2 565 65 100 20 Arial 10 bold head startdate 565 85 100 20 Arial 10 bold head enddate 10 65 125 20 Arial 10 normal head f_label 95 90 350 20 Arial 10 bold head f_show 140 65 300 20 Arial 10 bold head f_value 6 26 5 20 745 20 2
    detail detail 16 5 0 80 15 Arial 8 bold detail cust_number 620 0 65 15 Arial 8 bold detail f_applied 220 0 70 15 Arial 8 bold detail f_postdate 460 0 150 15 Arial 8 bold detail target 700 0 45 15 Arial 8 bold detail currAbbr 300 0 150 15 Arial 8 bold detail source 90 0 115 15 Arial 8 bold detail cust_name
    16 104 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 16 585 0 100 15 Arial 8 bold detail base_applied qty
    qt-client-4.1.0/share/reports/AROpenItem.xml000066400000000000000000000444541217451700100207120ustar00rootroot00000000000000 AROpenItem AROpenItem A report showing details of a single AR Open Item Letter 50 50 50 50 head SELECT aropen_cust_id, aropen_docdate, aropen_duedate, aropen_doctype, CASE WHEN (aropen_doctype = 'C' AND ((SELECT COUNT(*) AS num_rows FROM cmhead, aropen WHERE cmhead_number = aropen_ordernumber AND aropen_id = <? value("aropen_id") ?> ) = 0)) THEN 'Misc. Credit Memo' WHEN (aropen_doctype = 'D' AND ((SELECT COUNT(*) AS num_rows FROM cmhead, aropen WHERE cmhead_number = aropen_ordernumber AND aropen_id = <? value("aropen_id") ?> ) = 0)) THEN 'Misc. Debit Memo' WHEN (aropen_doctype = 'C' AND ((SELECT COUNT(*) AS num_rows FROM cmhead, aropen WHERE cmhead_number = aropen_ordernumber AND aropen_id = <? value("aropen_id") ?> ) > 0)) THEN 'Credit Memo' WHEN (aropen_doctype = 'D' AND ((SELECT COUNT(*) AS num_rows FROM cmhead, aropen WHERE cmhead_number = aropen_ordernumber AND aropen_id = <? value("aropen_id") ?> ) > 0)) THEN 'Debit Memo' END AS doc_name, aropen_docnumber, aropen_ordernumber, aropen_journalnumber, aropen_amount, aropen_amount, aropen_paid, (aropen_amount - aropen_paid) AS f_balance, aropen_terms_id, aropen_salesrep_id, aropen_commission_due, aropen_notes, aropen_rsncode_id, aropen_salescat_id, aropen_accnt_id, aropen_curr_id, cust_name, salesrep_name, terms_code, rsncode_code, formatboolyn(aropen_commission_paid) AS commission_paid FROM aropen JOIN custinfo ON(cust_id = aropen_cust_id) LEFT OUTER JOIN salesrep ON(aropen_salesrep_id = salesrep_id) LEFT OUTER JOIN terms ON(terms_id = aropen_terms_id) LEFT OUTER JOIN rsncode ON(rsncode_id = aropen_rsncode_id) WHERE (aropen_id=<? value("aropen_id") ?>) applications <? if exists("docTypeID") ?> SELECT arapply_id, arapply_source_aropen_id, CASE WHEN (arapply_source_doctype = 'C') THEN <? value("creditMemo") ?> WHEN (arapply_source_doctype = 'R') THEN <? value("cashdeposit") ?> WHEN (arapply_fundstype='C') THEN <? value("check") ?> WHEN (arapply_fundstype='T') THEN <? value("certifiedCheck") ?> WHEN (arapply_fundstype='M') THEN <? value("masterCard") ?> WHEN (arapply_fundstype='V') THEN <? value("visa") ?> WHEN (arapply_fundstype='A') THEN <? value("americanExpress") ?> WHEN (arapply_fundstype='D') THEN <? value("discoverCard") ?> WHEN (arapply_fundstype='R') THEN <? value("otherCreditCard") ?> WHEN (arapply_fundstype='K') THEN <? value("cash") ?> WHEN (arapply_fundstype='W') THEN <? value("wireTransfer") ?> WHEN (arapply_fundstype='O') THEN <? value("other") ?> END AS doctype, CASE WHEN (arapply_source_doctype IN ('C','R')) THEN arapply_source_docnumber WHEN (arapply_source_doctype = 'K') THEN arapply_refnumber ELSE 'Other' END AS docnumber, arapply_postdate, arapply_applied, currConcat(arapply_curr_id) AS currabbr, currToBase(arapply_curr_id, arapply_applied, arapply_postdate) AS baseapplied, 'curr' AS arapply_applied_xtnumericrole, 'curr' AS baseapplied_xtnumericrole FROM arapply WHERE (arapply_target_aropen_id=<? value("aropen_id") ?> ) ORDER BY arapply_postdate <? elseif exists("docTypeRC") ?> SELECT arapply_id, arapply_target_aropen_id, CASE WHEN (arapply_target_doctype = 'I') THEN <? value("invoice") ?> WHEN (arapply_target_doctype = 'D') THEN <? value("debitMemo") ?> WHEN (arapply_target_doctype = 'K') THEN <? value("apcheck") ?> WHEN (arapply_target_doctype = 'R') THEN <? value("cashreceipt") ?> ELSE <? value("other") ?> END AS doctype, arapply_target_docnumber AS docnumber, arapply_postdate, arapply_applied, currConcat(arapply_curr_id) AS currabbr, currToBase(arapply_curr_id, arapply_applied, arapply_postdate) AS baseapplied, 'curr' AS arapply_applied_xtnumericrole, 'curr' AS baseapplied_xtnumericrole FROM arapply WHERE (arapply_source_aropen_id=<? value("aropen_id") ?> ) ORDER BY arapply_postdate <? endif ?> 445 492.06 160.717 196 25 Sans Serif 12 normal head aropen_paid 491.06 184.717 195 25 Sans Serif 12 normal head f_balance 167.902 68.2357 201 25 Sans Serif 12 normal head aropen_docdate 169.06 233 175 25 Sans Serif 12 normal head rsncode_code 492.06 136 216 25 Sans Serif 12 normal head aropen_amount 494.06 68.8712 247.562 25 Sans Serif 12 normal head terms_code 169.06 160.717 176 25 Sans Serif 12 normal head aropen_docnumber 167.902 91.1813 216 25 Sans Serif 12 normal head aropen_duedate 167.902 44.9813 432.315 25 Sans Serif 12 normal head cust_name 169.06 136 175 25 Sans Serif 12 normal head aropen_doctype 87.7597 271.717 624 127.611 Sans Serif 12 normal head aropen_notes 169.06 209 177 25 Sans Serif 12 normal head aropen_journalnumber 490 233 199 25 Sans Serif 12 normal head commission_paid 494.06 91.8168 242.264 25 Sans Serif 12 normal head salesrep_name 491.06 209 198 25 Sans Serif 12 normal head aropen_commission_due 169.06 184.717 176 25 Sans Serif 12 normal head aropen_ordernumber 4 434 737 434 2 30.7855 9.22414 698.682 37.1 Sans Serif 20 bold head doc_name
    applications_detail applications 23 8 1.71311 100 25 Sans Serif 12 normal applications doctype 124 1.71311 100 25 Sans Serif 12 normal applications docnumber 241 1.71311 100 25 Sans Serif 12 normal applications arapply_postdate 352 1.71311 100 25 Sans Serif 12 normal applications arapply_applied 474 1.71311 100 25 Sans Serif 12 normal applications currabbr 611 1.71311 100 25 Sans Serif 12 normal applications baseapplied
    qt-client-4.1.0/share/reports/AROpenItems.xml000066400000000000000000000375431217451700100210760ustar00rootroot00000000000000 A/R Open Items AROpenItems Letter 50 50 50 50 head SELECT CASE WHEN (<? value("asofDate") ?> = endOfTime()) THEN 'Latest' ELSE formatDate(<? value("asofDate") ?>) END AS asOfDate, <? if exists("creditsOnly") ?> 'Credits Only' AS type, <? elseif exists("debitsOnly") ?> 'Debits Only' AS type, <? else ?> 'Debits and Credits' AS type, <? endif ?> <? if exists("cust_id") ?> (SELECT cust_name FROM custinfo WHERE cust_id=<? value("cust_id") ?>) AS selection, <? elseif exists("custtype_id") ?> (SELECT custtype_code FROM custtype WHERE custtype_id=<? value("custtype_id") ?>) AS selection, <? elseif exists("custtype_pattern") ?> ('Customer Type pattern = ' || <? value("custtype_pattern") ?>) AS selection, <? elseif exists("custgrp_id") ?> (SELECT custgrp_name FROM custgrp WHERE custgrp_id=<? value("custgrp_id") ?>) AS selection, <? else ?> 'All Customers' AS selection, <? endif ?> <? if exists("startDate") ?> 'Start Doc Date:' AS start_label, 'End Doc Date:' AS end_label, <? else ?> 'Start Due Date:' AS start_label, 'End Due Date:' AS end_label, <? endif ?> formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, currConcat(baseCurrId()) AS baseAbbr, <? if exists("incidentsOnly") ?> 'Yes' AS incidentsOnly <? else ?> 'No' AS incidentsOnly <? endif ?>; detail arOpenItems f_detail 178 514 69.7785 100 15 Arial 10 bold head enddate 514 52.6662 100 15 Arial 10 bold head startdate 5 170 745 170 2 410 52.6662 100 15 Arial 10 normal head start_label 410.317 69.7785 100 15 Arial 10 normal head end_label 141.375 69.7785 200 15 Arial 10 bold head type 142 52.6662 250 15 Arial 10 bold head selection 141.375 88.4798 200 15 Arial 10 bold head incidentsOnly 514.049 88.4798 100 15 Arial 10 bold head asOfDate 5 52 5 45 745 45 2
    detail detail 18 350 0 80 15 Arial 8 bold detail f_duedate 600 0 80 15 Arial 8 bold detail f_balance 85 0 77 15 Arial 8 bold detail docnumber 700 0 50 15 Arial 8 bold detail currAbbr 440 0 80 15 Arial 8 bold detail f_amount 520 0 80 15 Arial 8 bold detail f_paid 5 0 78.9 15 Arial 8 bold detail doctype 270 0 80 15 Arial 8 bold detail f_docdate 165 0 100 15 Arial 8 bold detail cust_name
    18 705 0 40 15 Arial 8 bold Context Query page_number 104 0 100 15 Arial 8 bold Context Query report_date 18 700 0 50 15 Arial 8 bold head baseAbbr 600 0 80 15 Arial 8 bold detail base_balance qty
    qt-client-4.1.0/share/reports/AccountNumberMasterList.xml000066400000000000000000000175151217451700100235220ustar00rootroot00000000000000 Chart of Accounts Master List AccountNumberMasterList Letter 50 50 50 50 detail select accnt_company, accnt_profit, accnt_number, accnt_sub, accnt_descrip, accnt_comments, CASE WHEN(accnt_type='A') THEN text('Asset') WHEN(accnt_type='L') THEN text('Liability') WHEN(accnt_type='E') THEN text('Expense') WHEN(accnt_type='R') THEN text('Revenue') WHEN(accnt_type='Q') THEN text('Equity') ELSE text(accnt_type) END AS f_type from accnt ORDER BY accnt_number, accnt_sub, accnt_profit; 77 5 70 745 70 2 6 21 10 15 750 15 2
    detail detail 17 325 0 100 15 Arial 8 bold detail accnt_sub 220 0 100 15 Arial 8 bold detail accnt_number 115 0 100 15 Arial 8 bold detail accnt_profit 10 0 100 15 Arial 8 bold detail accnt_company 494 0 250 15 Arial 8 bold detail accnt_descrip 430 0 55 15 Arial 8 bold detail f_type
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/AccountingPeriodsMasterList.xml000066400000000000000000000135601217451700100243710ustar00rootroot00000000000000 Accounting Periods Master List AccountingPeriodsMasterList Letter 50 50 50 50 detail SELECT period_id, formatDate(period_start) AS f_start, formatDate(period_end) AS f_end, formatBoolYN(period_closed) AS f_closed, formatBoolYN(period_freeze) AS f_frozen FROM period ORDER BY period_start; 77 5 70 745 70 2 7 22 5 15 745 15 2
    detail detail 17 420 0 80 15 Arial 8 bold detail f_closed 114 0 100 15 Arial 8 bold detail f_end 515 0 80 15 Arial 8 bold detail f_frozen 10 0 100 15 Arial 8 bold detail f_start
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/AccountingYearPeriodsMasterList.xml000066400000000000000000000120161217451700100252050ustar00rootroot00000000000000 Accounting Year Periods Master List AccountingYearPeriodsMasterList Letter 50 50 50 50 detail SELECT yearperiod_id, formatDate(yearperiod_start) AS f_start, formatDate(yearperiod_end) AS f_end, formatBoolYN(yearperiod_closed) AS f_closed FROM yearperiod ORDER BY yearperiod_start; 75 5 70 745 70 2 6 21 5 14 745 14 2
    detail detail 17 113 0 100 14 Arial 8 bold detail f_end 10 0 100 14 Arial 8 bold detail f_start 420 0 80 14 Arial 8 bold detail f_closed
    15 90 0 100 14 Arial 8 bold Context Query report_date 705 0 40 14 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/AddressesMasterList.xml000066400000000000000000000457031217451700100226720ustar00rootroot00000000000000 Addresses Master List AddressesMasterList 0.05 0.05 Letter 50 50 50 50 detail SELECT * FROM ( SELECT 'Contact' AS type, cntct_first_name AS first, cntct_last_name AS last, crmacct_number, cntct_phone AS phone, cntct_email AS email, cntct_fax AS fax, addr.* FROM addr, cntct LEFT OUTER JOIN crmacct ON (cntct_crmacct_id=crmacct_id) WHERE (cntct_addr_id=addr_id) UNION SELECT 'Ship-To' AS type, shipto_num AS first, shipto_name AS last, crmacct_number, '' AS phone, '' AS email, '' AS fax, addr.* FROM addr, shiptoinfo LEFT OUTER JOIN crmacct ON (shipto_cust_id=crmacct_cust_id ) WHERE (shipto_addr_id=addr_id) UNION SELECT 'Vendor' AS type, vend_number AS first, vend_name AS last, crmacct_number, '' AS phone, '' AS email, '' AS fax, addr.* FROM addr, vendinfo LEFT OUTER JOIN crmacct ON (vend_id=crmacct_vend_id) WHERE (vend_addr_id=addr_id) UNION SELECT 'Vendor Address' AS type, vendaddr_code AS first, vendaddr_name AS last, crmacct_number, '' AS phone, '' AS email, '' AS fax, addr.* FROM addr, vendaddrinfo LEFT OUTER JOIN crmacct ON (vendaddr_vend_id=crmacct_vend_id) WHERE (vendaddr_addr_id=addr_id) UNION SELECT 'Site' AS type, warehous_code AS first, warehous_descrip AS last, '' AS crmacct_number, '' AS phone, '' AS email, '' AS fax, addr.* FROM addr, whsinfo WHERE (warehous_addr_id=addr_id) UNION SELECT '' AS type, '' AS first, '' AS last, '' AS crmacct_number, '' AS phone, '' AS email, '' AS fax, addr.* FROM addr WHERE addr_id NOT IN ( SELECT cntct_addr_id FROM cntct WHERE (cntct_addr_id IS NOT NULL) UNION SELECT shipto_addr_id FROM shiptoinfo WHERE (shipto_addr_id IS NOT NULL) UNION SELECT vend_addr_id FROM vendinfo WHERE (vend_addr_id IS NOT NULL) UNION SELECT vendaddr_addr_id FROM vendaddrinfo WHERE (vendaddr_addr_id IS NOT NULL) UNION SELECT warehous_addr_id FROM whsinfo WHERE (warehous_addr_id IS NOT NULL)) ) data <? foreach("char_id_text_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_text_list") ?> ON ((charass_alias<? literal("char_id_text_list") ?>.charass_target_type='ADDR') AND (charass_alias<? literal("char_id_text_list") ?>.charass_target_id=addr_id) AND (charass_alias<? literal("char_id_text_list") ?>.charass_char_id=<? value("char_id_text_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_text_list") ?> ON (charass_alias<? literal("char_id_text_list") ?>.charass_char_id=char_alias<? literal("char_id_text_list") ?>.char_id) <? endforeach ?> <? foreach("char_id_list_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_list_list") ?> ON ((charass_alias<? literal("char_id_list_list") ?>.charass_target_type='ADDR') AND (charass_alias<? literal("char_id_list_list") ?>.charass_target_id=addr_id) AND (charass_alias<? literal("char_id_list_list") ?>.charass_char_id=<? value("char_id_list_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_list_list") ?> ON (charass_alias<? literal("char_id_list_list") ?>.charass_char_id=char_alias<? literal("char_id_list_list") ?>.char_id) <? endforeach ?> <? foreach("char_id_date_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_date_list") ?> ON ((charass_alias<? literal("char_id_date_list") ?>.charass_target_type='ADDR') AND (charass_alias<? literal("char_id_date_list") ?>.charass_target_id=addr_id) AND (charass_alias<? literal("char_id_date_list") ?>.charass_char_id=<? value("char_id_date_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_date_list") ?> ON (charass_alias<? literal("char_id_date_list") ?>.charass_char_id=char_alias<? literal("char_id_date_list") ?>.char_id) <? endforeach ?> WHERE true <? if not exists("showInactive") ?> AND addr_active <? endif ?> <? literal("charClause") ?> ORDER BY addr_country, addr_state, addr_city, addr_postalcode, addr_line1, addr_line2, addr_line3, type, last, first; 156 6.33333 150.333 995.333 150.333 2 5 36 725 15 12 Arial 10 bold Parameter Query filter 6 38 5 31 992 31 2
    detail Address addr_id 22 375 5 120 15 Arial 8 bold detail addr_city 750 5 120 15 Arial 8 bold detail addr_postalcode 625 5 120 15 Arial 8 bold detail addr_country 140 5 120 15 Arial 8 bold detail addr_line2 10 5 120 15 Arial 8 bold detail addr_line1 500 5 120 15 Arial 8 bold detail addr_state 270 5 100 15 Arial 8 bold detail addr_line3 detail 12 375 0 100 15 Arial 8 normal detail last 750 0 120 12 Arial 8 normal detail fax 500 0 100 15 Arial 8 normal detail crmacct_number 625 0 100 15 Arial 8 normal detail phone 270 0 100 15 Arial 8 normal detail first 875 0 100 15 Arial 8 normal detail email 140 0 100 15 Arial 8 normal detail type
    17 90 -1 100 15 Arial 8 bold Context Query report_date 945 -1 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/AdjustmentTypes.xml000066400000000000000000000136401217451700100221030ustar00rootroot00000000000000 Adjustment Types AdjustmentTypes Letter 50 50 50 50 detail SELECT bankadjtype_name, bankadjtype_descrip, formatGLAccountLong(bankadjtype_accnt_id) AS f_accnt, CASE WHEN(bankadjtype_iscredit) THEN text('Credit') ELSE text('Debit') END AS f_type FROM bankadjtype; 121 5 115 745 115 2 9 36 5 30 745 30 2
    detail detail 18 5 0 155 15 Arial 8 bold detail bankadjtype_name 165 0 170 15 Arial 8 bold detail bankadjtype_descrip 340 0 300 15 Arial 8 bold detail f_accnt 645 0 100 15 Arial 8 bold detail f_type
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/Alignment.xml000066400000000000000000000745031217451700100206630ustar00rootroot00000000000000 Alignment Alignment Letter 0 0 0 0 1152 0 919 850 919 1 580 0 580 1150 1 280 0 280 1150 1 0 470 850 470 1 0 869 850 869 1 0 800 850 800 1 0 459 850 459 1 340 0 340 1150 1 0 690 850 690 1 0 960 850 960 1 0 1090 850 1090 1 0 380 850 380 1 560 0 560 1150 1 0 300 850 300 1 0 1120 850 1120 1 0 819 850 819 1 350 0 350 1150 1 0 30 850 30 1 170 0 170 1150 1 0 990 850 990 1 0 760 850 760 1 0 0 0 1150 1 0 220 850 220 1 360 0 360 1150 1 0 10 850 10 1 0 1150 850 1150 1 0 210 850 210 1 0 570 850 570 1 70 0 70 1150 1 0 100 850 100 1 400 0 400 1150 1 540 0 540 1150 1 730 0 730 1150 1 20 0 20 1150 1 0 900 850 900 1 220 0 220 1150 1 200 0 200 1150 1 0 509 850 509 1 300 0 300 1150 1 0 740 850 740 1 490 0 490 1150 1 0 530 850 530 1 0 930 850 930 1 630 0 630 1150 1 0 980 850 980 1 0 620 850 620 1 780 0 780 1150 1 0 670 850 670 1 420 0 420 1150 1 0 180 850 180 1 0 150 850 150 1 0 730 850 730 1 80 0 80 1150 1 0 400 850 400 1 0 110 850 110 1 0 310 850 310 1 0 940 850 940 1 0 640 850 640 1 0 1040 850 1040 1 140 0 140 1150 1 440 0 440 1150 1 0 280 850 280 1 0 660 850 660 1 30 0 30 1150 1 130 0 130 1150 1 0 950 850 950 1 0 40 850 40 1 0 650 850 650 1 0 700 850 700 1 470 0 470 1150 1 0 130 850 130 1 0 260 850 260 1 0 360 850 360 1 0 890 850 890 1 0 350 850 350 1 0 480 850 480 1 260 0 260 1150 1 0 370 850 370 1 550 0 550 1150 1 250 0 250 1150 1 0 600 850 600 1 600 0 600 1150 1 0 0 850 0 1 509 0 509 1150 1 640 0 640 1150 1 409 0 409 1150 1 0 250 850 250 1 480 0 480 1150 1 0 50 850 50 1 0 720 850 720 1 0 1070 850 1070 1 819 0 819 1150 1 0 770 850 770 1 0 560 850 560 1 0 20 850 20 1 0 90 850 90 1 0 860 850 860 1 660 0 660 1150 1 790 0 790 1150 1 0 580 850 580 1 459 0 459 1150 1 0 170 850 170 1 50 0 50 1150 1 150 0 150 1150 1 0 1100 850 1100 1 500 0 500 1150 1 0 70 850 70 1 0 610 850 610 1 0 1140 850 1140 1 110 0 110 1150 1 770 0 770 1150 1 0 590 850 590 1 740 0 740 1150 1 0 630 850 630 1 0 1030 850 1030 1 690 0 690 1150 1 0 550 850 550 1 0 140 850 140 1 0 1050 850 1050 1 0 1019 850 1019 1 520 0 520 1150 1 0 1000 850 1000 1 100 0 100 1150 1 450 0 450 1150 1 720 0 720 1150 1 160 0 160 1150 1 0 60 850 60 1 0 450 850 450 1 760 0 760 1150 1 0 420 850 420 1 680 0 680 1150 1 0 850 850 850 1 650 0 650 1150 1 620 0 620 1150 1 0 190 850 190 1 0 409 850 409 1 40 0 40 1150 1 700 0 700 1150 1 0 1010 850 1010 1 800 0 800 1150 1 240 0 240 1150 1 310 0 310 1150 1 710 0 710 1150 1 0 540 850 540 1 10 0 10 1150 1 570 0 570 1150 1 0 810 850 810 1 0 1130 850 1130 1 390 0 390 1150 1 229 0 229 1150 1 0 680 850 680 1 0 270 850 270 1 180 0 180 1150 1 850 0 850 1150 1 0 80 850 80 1 0 240 850 240 1 0 750 850 750 1 0 160 850 160 1 0 290 850 290 1 0 910 850 910 1 840 0 840 1150 1 0 229 850 229 1 670 0 670 1150 1 0 330 850 330 1 0 710 850 710 1 0 840 850 840 1 60 0 60 1150 1 0 790 850 790 1 0 1060 850 1060 1 190 0 190 1150 1 590 0 590 1150 1 810 0 810 1150 1 530 0 530 1150 1 0 520 850 520 1 0 340 850 340 1 0 390 850 390 1 90 0 90 1150 1 0 120 850 120 1 0 830 850 830 1 0 880 850 880 1 0 200 850 200 1 830 0 830 1150 1 0 780 850 780 1 0 500 850 500 1 120 0 120 1150 1 0 440 850 440 1 320 0 320 1150 1 370 0 370 1150 1 0 430 850 430 1 210 0 210 1150 1 610 0 610 1150 1 290 0 290 1150 1 330 0 330 1150 1 0 1080 850 1080 1 430 0 430 1150 1 380 0 380 1150 1 750 0 750 1150 1 0 969 850 969 1 0 490 850 490 1 270 0 270 1150 1 0 1110 850 1110 1 0 320 850 320 1 qt-client-4.1.0/share/reports/Backlog.xml000066400000000000000000000500661217451700100203050ustar00rootroot00000000000000 Backlog Backlog 0.05 0.05 Letter 50 50 50 50 head SELECT CASE WHEN (checkPrivilege('ViewCustomerPrices') AND isMultiCurr()) THEN text('Amount(base)') WHEN (checkPrivilege('ViewCustomerPrices')) THEN text('Amount') ELSE text('') END AS lbl_baseamount, CASE WHEN (checkPrivilege('ViewCustomerPrices') AND isMultiCurr()) THEN text('Amount(foreign)') ELSE text('') END AS lbl_foreignamount; detail SELECT cohead_number, coitem_linenumber, cust_name, formatDate(cohead_orderdate) AS f_orderdate, formatDate(coitem_scheddate) AS f_scheddate, item_number, uom_name, item_descrip1, item_descrip2, formatQty(coitem_qtyord) AS f_qtyord, formatQty(coitem_qtyshipped) AS f_qtyship, formatQty(noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) AS f_balance, CASE WHEN (checkPrivilege('ViewCustomerPrices')) THEN formatMoney(round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (currtobase(cohead_curr_id,coitem_price,cohead_orderdate) / coitem_price_invuomratio),2)) ELSE text('') END AS f_ammount, CASE WHEN (checkPrivilege('ViewCustomerPrices') AND isMultiCurr()) THEN formatMoney(round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio),2)) ELSE text('') END AS foreign_ammount, round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (currtobase(cohead_curr_id,coitem_price,cohead_orderdate) / coitem_price_invuomratio),2) AS backlog FROM cohead, coitem, itemsite, item, custinfo, uom WHERE ((coitem_cohead_id=cohead_id) AND (cohead_cust_id=cust_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (coitem_status='O') <? if exists("cohead_id") ?> AND (coitem_cohead_id=<? value("cohead_id") ?>) <? endif ?> <? if exists("startDate") ?> AND (cohead_orderdate >= <? value("startDate") ?>) <? endif ?> <? if exists("endDate") ?> AND (cohead_orderdate <= <? value("endDate") ?>) <? endif ?> <? if exists("startDateSched") ?> AND (coitem_scheddate >= <? value("startDateSched") ?>) <? endif ?> <? if exists("endDateSched") ?> AND (coitem_scheddate <= <? value("endDateSched") ?>) <? endif ?> <? if exists("salesrep_id") ?> AND (cohead_salesrep_id=<? value("salesrep_id") ?>) <? endif ?> <? if exists("shipto_id") ?> AND (cohead_shipto_id=<? value("shipto_id") ?>) <? endif ?> <? if exists("cust_id") ?> AND (cohead_cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? endif ?> <? if exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT DISTINCT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("custgrp") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrpitem)) <? endif ?> <? if exists("custgrp_id") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrpitem WHERE (custgrpitem_custgrp_id=<? value("custgrp_id") ?>))) <? endif ?> <? if exists("custgrp_pattern") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrp, custgrpitem WHERE ( (custgrpitem_custgrp_id=custgrp_id) AND (custgrp_name ~ <? value("custgrp_pattern") ?>) )) ) <? endif ?> <? if exists("item_id") ?> AND (itemsite_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT DISTINCT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY coitem_scheddate, cohead_number, coitem_linenumber; total SELECT now() WHERE 't' = CASE WHEN (checkPrivilege('ViewCustomerPrices')) THEN 't' ELSE 'f' END ; 226 660 185 85 15 Arial 8 normal head lbl_baseamount 5 215 745 215 2 660 200 85 15 Arial 8 normal head lbl_foreignamount 5 28 725 15 12 Arial 10 bold Parameter Query filter 6 36 660 0 85 15 Arial 8 normal head lbl_baseamount 660 15 85 15 Arial 8 normal head lbl_foreignamount 5 30 745 30 2
    detail detail 52 305 30 250 15 Arial 8 bold detail item_descrip2 65 0 50 15 Arial 8 bold detail coitem_linenumber 5 45 745 45 0 305 15 200 15 Arial 8 bold detail item_descrip1 507 15 75 15 Arial 8 bold detail f_qtyship 671 15 75 15 Arial 8 bold detail foreign_ammount 305 0 140 15 Arial 8 bold detail item_number 670 0 75 15 Arial 8 bold detail f_ammount 450 0 50 15 Arial 8 bold detail uom_name 225 0 75 15 Arial 8 bold detail f_orderdate 507 0 75 15 Arial 8 bold detail f_qtyord 225 15 75 15 Arial 8 bold detail f_scheddate 112 0 110 15 Arial 8 bold detail cust_name 580 0 75 15 Arial 8 bold detail f_balance 5 0 60 15 Arial 8 bold detail cohead_number
    totals total 18 670 0 75 15 Arial 8 bold detail backlog money
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/BankAccountsMasterList.xml000066400000000000000000000156101217451700100233220ustar00rootroot00000000000000 Bank Accounts Master List BankAccountsMasterList Letter 50 50 50 50 detail SELECT bankaccnt_id, bankaccnt_name AS f_name, bankaccnt_descrip AS f_descrip, CASE WHEN (bankaccnt_type='K') THEN text('Checking') WHEN (bankaccnt_type='C') THEN text('Cash') WHEN (bankaccnt_type='R') THEN text('Credit Card') ELSE text('?') END AS f_type, formatBoolYN(bankaccnt_ap) AS f_ap, formatBoolYN(bankaccnt_ar) AS f_ar FROM bankaccnt ORDER BY bankaccnt_name; 77 5 70 745 70 2 7 22 5 15 745 15 2
    detail detail 17 495 0 80 15 Arial 8 bold detail f_type 95 0 395 15 Arial 8 bold detail f_descrip 580 0 80 15 Arial 8 bold detail f_ap 10 0 80 15 Arial 8 bold detail f_name 665 0 80 15 Arial 8 bold detail f_ar
    17 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/BankAdjustmentEditList.xml000066400000000000000000000157661217451700100233270ustar00rootroot00000000000000 Bank Adjustment Edit List BankAdjustmentEditList Letter 50 50 50 50 detail SELECT bankadj_id, (bankaccnt_name || '-' || bankaccnt_descrip) AS f_bank, bankadjtype_name, formatDate(bankadj_date) AS f_date, bankadj_docnumber, formatMoney(bankadj_amount) AS f_amount FROM bankadj LEFT OUTER JOIN bankaccnt ON (bankadj_bankaccnt_id=bankaccnt_id) LEFT OUTER JOIN bankadjtype ON (bankadj_bankadjtype_id=bankadjtype_id) WHERE ( (NOT bankadj_posted) AND (bankadj_bankaccnt_id=<? value("bankaccnt_id") ?>) ); 121 5 115 745 115 2 9 21 5 15 745 15 2
    detail detail 18 5 0 155 15 Arial 8 bold detail f_bank 165 0 80 15 Arial 8 bold detail bankadjtype_name 340 0 300 15 Arial 8 bold detail bankadj_docnumber 645 0 100 15 Arial 8 bold detail f_amount 250 0 80 15 Arial 8 bold detail f_date
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/BankrecHistory.xml000066400000000000000000000511021217451700100216620ustar00rootroot00000000000000 Bank Reconciliation History BankrecHistory Letter 50 50 50 50 reconciled bankrecHistory reconciled head SELECT (bankaccnt_name || '-' || bankaccnt_descrip) AS f_bankaccnt, (formatDate(bankrec_opendate) || '-' || formatDate(bankrec_enddate)) AS f_bankrec, bankrec_username AS f_username, formatDate(bankrec_created) AS f_created, formatDate(bankrec_opendate) AS f_opendate, formatDate(bankrec_enddate) AS f_enddate, formatMoney(bankrec_openbal) AS f_openbal, formatMoney(bankrec_endbal) AS f_endbal, text('Opening Balance') AS f_opendescrip, text('Ending Balance') AS f_enddescrip FROM bankrec, bankaccnt WHERE ((bankrec_bankaccnt_id=bankaccnt_id) AND (bankrec_id=<? value("bankrec_id") ?>)); Subtotal SELECT formatMoney(COALESCE(MAX(selrec.bankrec_endbal) + SUM(currtolocal(bankaccnt_curr_id,gltrans_amount,gltrans_date) * -1),0)) AS amount FROM gltrans JOIN bankaccnt ON (bankaccnt_accnt_id = gltrans_accnt_id) JOIN bankrec selrec ON ((selrec.bankrec_bankaccnt_id = bankaccnt_id) AND (selrec.bankrec_id=<? value("bankrec_id") ?>)) LEFT OUTER JOIN bankrecitem ON ((bankrecitem_source='GL') AND (bankrecitem_source_id=gltrans_id)) LEFT OUTER JOIN bankrec actrec ON (actrec.bankrec_id = bankrecitem_bankrec_id) WHERE ((COALESCE(actrec.bankrec_postdate,endoftime()) > COALESCE(selrec.bankrec_postdate,now())) AND (gltrans_doctype='CK')) ActualAmount SELECT formatMoney(COALESCE(MAX(selrec.bankrec_endbal) + SUM(currtolocal(bankaccnt_curr_id,gltrans_amount,gltrans_date) * -1),0)) AS amount FROM gltrans JOIN bankaccnt ON (bankaccnt_accnt_id = gltrans_accnt_id) JOIN bankrec selrec ON ((selrec.bankrec_bankaccnt_id = bankaccnt_id) AND (selrec.bankrec_id=<? value("bankrec_id") ?>)) LEFT OUTER JOIN bankrecitem ON ((bankrecitem_source='GL') AND (bankrecitem_source_id=gltrans_id)) LEFT OUTER JOIN bankrec actrec ON (actrec.bankrec_id = bankrecitem_bankrec_id) WHERE (COALESCE(actrec.bankrec_postdate,endoftime()) > COALESCE(selrec.bankrec_postdate,now())) unreconciled bankrecHistory unreconciled 166 100 148 535 15 Arial 8 bold head f_opendescrip 145 65 220 15 Arial 8 bold head f_bankrec 5 115 745 115 2 145 50 245 15 Arial 8 bold head f_bankaccnt 475 65 220 15 Arial 8 bold head f_created 9 148 80 15 Arial 8 bold head f_opendate 475 50 220 15 Arial 8 bold head f_username 644 148 100 15 Arial 8 bold head f_openbal 0 31 5 15 745 15 2
    reconciled reconciled-group amount_xtnumericrole 21 645 3.28 100 15 Arial 8 bold head f_endbal 10 3.28 80 15 Arial 8 bold head f_enddate 100 3.28 200 15 Arial 8 bold head f_enddescrip reconciled-type sort 27 10 6.78 94 15 Arial 8 bold reconciled type 18 645 2 100 15 Arial 8 bold reconciled amount qty 438 2 168 15 Arial 8 bold reconciled type reconciled 18 206 0 430 15 Arial 8 bold reconciled notes 645 0 100 15 Arial 8 bold reconciled f_amount 10 0 80 15 Arial 8 bold reconciled f_date 100 -0.182 100 15 Arial 8 bold reconciled gltrans_docnumber
    unreconciled unreconciled-group amount_xtnumericrole 33 136.499 642 25.4985 100 15 Arial 8 bold head f_endbal 642 41.5 100 15 Arial 8 bold unreconciled rtcheck money 641 57.5 100 15 Arial 8 bold Subtotal amount 642 73.5 100 15 Arial 8 bold unreconciled rtdep money 641 89.5 100 15 Arial 8 bold unreconciled rtadj money 641 105 100 15 Arial 8 bold ActualAmount amount unreconciled-type type 26.0233 10 4.9 94 15 Arial 8 bold unreconciled type unreconciled 21.9767 204 0.687 430 15 Arial 8 bold unreconciled notes 10 0.687 80 15 Arial 8 bold unreconciled f_date 98.5 0.687 94 15 Arial 8 bold unreconciled gltrans_docnumber 643 0.687 100 15 Arial 8 bold unreconciled f_amount
    15 705 0 40 15 Arial 8 bold Context Query page_number 80 0 100 15 Arial 8 bold Context Query report_date 143
    qt-client-4.1.0/share/reports/BillingSelections.xml000066400000000000000000000121601217451700100223450ustar00rootroot00000000000000 Billing Selections BillingSelections Letter 50 50 50 50 detail SELECT cobmisc_id, cohead_id, COALESCE(TEXT(cobmisc_invcnumber), '?') AS docnumber, cohead_number, cust_number, cust_name FROM cobmisc, cohead, custinfo WHERE ((cobmisc_cohead_id=cohead_id) AND (cohead_cust_id=cust_id) AND (NOT cobmisc_posted) ) ORDER BY docnumber; 123 5 112 745 112 2 102 80 5 20 745 20 2
    detail detail 18 110 1 100 15 Arial 8 bold detail cust_number 5 1 100 15 Arial 8 bold detail cohead_number 214 1 300 15 Arial 8 bold detail cust_name
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/Bookings.xml000066400000000000000000000336421217451700100205170ustar00rootroot00000000000000 Bookings Bookings 0.05 0.05 Letter 50 50 50 50 detail SELECT cohead_number AS sonumber, formatDate(cohead_orderdate) AS orddate, cust_number, cust_name, item_number, item_descrip1, item_descrip2, formatQty(coitem_qtyord) AS ordered, formatPrice(currtobase(cohead_curr_id,coitem_price,cohead_orderdate) / coitem_price_invuomratio) AS unitprice, formatExtPrice(round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (currtobase(cohead_curr_id,coitem_price,cohead_orderdate) / coitem_price_invuomratio),2)) AS f_extprice FROM coitem JOIN cohead ON (cohead_id=coitem_cohead_id) JOIN custinfo ON (cust_id=cohead_cust_id) JOIN itemsite ON (itemsite_id=coitem_itemsite_id) JOIN site() ON (warehous_id=itemsite_warehous_id) JOIN item ON (item_id=itemsite_item_id) JOIN uom ON (uom_id=coitem_qty_uom_id) JOIN curr_symbol ON (curr_id=cohead_curr_id) WHERE ( (coitem_status<>'X') <? if exists("cohead_id") ?> AND (coitem_cohead_id=<? value("cohead_id") ?>) <? endif ?> <? if exists("openOnly") ?> AND (coitem_status<>'C') <? endif ?> <? if exists("startDate") ?> AND (cohead_orderdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("salesrep_id") ?> AND (cohead_salesrep_id=<? value("salesrep_id") ?>) <? endif ?> <? if exists("shipto_id") ?> AND (cohead_shipto_id=<? value("shipto_id") ?>) <? endif ?> <? if exists("cust_id") ?> AND (cohead_cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? endif ?> <? if exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT DISTINCT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("custgrp") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrpitem)) <? endif ?> <? if exists("custgrp_id") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrpitem WHERE (custgrpitem_custgrp_id=<? value("custgrp_id") ?>))) <? endif ?> <? if exists("custgrp_pattern") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrp, custgrpitem WHERE ( (custgrpitem_custgrp_id=custgrp_id) AND (custgrp_name ~ <? value("custgrp_pattern") ?>) )) ) <? endif ?> <? if exists("item_id") ?> AND (itemsite_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT DISTINCT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY cohead_orderdate; 237 5 233 745 233 2 10 41 725 15 12 Arial 10 bold Parameter Query filter 7 37 5 30 745 30 2
    detail detail 52 585 0 80 15 Arial 8 bold detail ordered 432 15 225 15 Arial 8 bold detail item_descrip1 5 0 100 15 Arial 8 bold detail sonumber 432 0 150 15 Arial 8 bold detail item_number 665 15 80 15 Arial 8 bold detail f_extprice 200 15 200 15 Arial 8 bold detail cust_name 665 0 80 15 Arial 8 bold detail unitprice 4 47 744 47 0 200 0 200 15 Arial 8 bold detail cust_number 432 30 300 15 Arial 8 bold detail item_descrip2 110 0 80 15 Arial 8 bold detail orddate
    17 102 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/BriefEarnedCommissions.xml000066400000000000000000000341171217451700100233340ustar00rootroot00000000000000 Brief Earned Commissions BriefEarnedCommissions Letter 50 50 50 50 head SELECT <? if exists("salesrep_id") ?> ( SELECT salesrep_name FROM salesrep WHERE (salesrep_id=<? value("salesrep_id") ?>) ) <? else ?> text('All Sales Reps') <? endif ?> AS salesrep, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate; detail SELECT cohist_salesrep_id, salesrep_number, salesrep_name, cust_number, cust_name, cohist_ordernumber, cohist_invcnumber, formatDate(cohist_invcdate) AS f_invcdate, currAbbr, formatMoney(SUM(baseextprice)) AS f_extprice, formatMoney(SUM(basecommission)) AS f_commission, SUM(baseextprice) AS extprice, SUM(basecommission) AS commission <? if exists("includeMisc") ?> FROM saleshistorymisc <? else ?> FROM saleshistory <? endif ?> WHERE ( (cohist_commission <> 0) AND (cohist_invcdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("includeMisc") ?> AND (COALESCE(cohist_misc_type, '') <> 'T') AND (COALESCE(cohist_misc_type, '') <> 'F') <? endif ?> <? if exists("salesrep_id") ?> AND (cohist_salesrep_id=<? value("salesrep_id") ?>) <? endif ?> ) GROUP BY cohist_salesrep_id, salesrep_number, salesrep_name, cust_number, cust_name, cohist_ordernumber, cohist_invcnumber, cohist_invcdate, currAbbr ORDER BY salesrep_number, cust_number, cohist_invcdate 221 5 215 745 215 2 140 100 385 20 Arial 10 bold head salesrep 140 120 200 20 Arial 10 bold head startdate 140 140 200 20 Arial 10 bold head enddate 6 26 5 20 745 20 2
    detail detail 16 345 0 80 15 Arial 8 bold detail cohist_ordernumber 585 0 80 15 Arial 8 bold detail f_extprice 665 0 80 15 Arial 8 bold detail f_commission 165 0 50 15 Arial 8 bold detail cust_number 505 0 80 15 Arial 8 bold detail f_invcdate 220 0 120 15 Arial 8 bold detail cust_name 60 0 100 15 Arial 8 bold detail salesrep_name 425 0 80 15 Arial 8 bold detail cohist_invcnumber 5 0 50 15 Arial 8 bold detail salesrep_number
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 16 585 0 80 15 Arial 8 bold detail extprice money 665 0 80 15 Arial 8 bold detail commission money
    qt-client-4.1.0/share/reports/BriefSalesHistory.xml000066400000000000000000000314631217451700100223440ustar00rootroot00000000000000 Brief Sales History BriefSalesHistory 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("startDate") ?> formatDate(date(<? value("startDate") ?>)) <? else ?> text('Earliest') <? endif ?> AS startDate, <? if exists("endDate") ?> formatDate(date(<? value("endDate") ?>)) <? else ?> text('Latest') <? endif ?> AS endDate, <? if exists("showPrices") ?> text('Unit Price') AS lbl_unitprice, text('Total') AS lbl_total, <? else ?> text('') AS lbl_unitprice, text('') AS lbl_total, <? endif ?> <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("cust_id") ?> (SELECT cust_name FROM custinfo WHERE cust_id=<? value("cust_id") ?>) <? else ?> text('All Customers') <? endif ?> AS cust_name, <? if exists("custtype_id") ?> (SELECT custtype_code FROM custtype WHERE custtype_id=<? value("custtype_id") ?>) <? else ?> text('All Customer Types') <? endif ?> AS custtype_code, <? if exists("custtype_pattern") ?> text(<? value("custtype_pattern") ?>) <? else ?> text('Not Applicable') <? endif ?> AS custtype_pattern, <? if exists("custgrp_id") ?> (SELECT custgrp_name FROM custgrp WHERE custgrp_id=<? value("custgrp_id") ?>) <? else ?> text('All Customer Groups') <? endif ?> AS custgrp_name, <? if exists("custgrp_pattern") ?> text(<? value("custgrp_pattern") ?>) <? else ?> text('Not Applicable') <? endif ?> AS custgrp_pattern, <? if exists("prodcat_id") ?> (SELECT prodcat_code FROM prodcat WHERE prodcat_id=<? value("prodcat_id") ?>) <? else ?> text('All Product Categories') <? endif ?> AS prodcat_code, <? if exists("prodcat_pattern") ?> text(<? value("prodcat_pattern") ?>) <? else ?> text('Not Applicable') <? endif ?> AS prodcat_pattern, <? if exists("item_id") ?> (SELECT item_number FROM item WHERE item_id=<? value("item_id") ?>) <? else ?> text('All Item Numbers') <? endif ?> AS item_number, <? if exists("cohead_id") ?> (SELECT cohead_number FROM cohead WHERE cohead_id=<? value("cohead_id") ?>) <? else ?> text('All Orders') <? endif ?> AS docnumber; detail SELECT cohist_ordernumber AS sonumber, cohist_invcnumber AS invnumber, formatDate(cohist_orderdate) AS orddate, formatDate(cohist_invcdate, 'Return') AS shipdate, SUM(round(cohist_qtyshipped * currtobase(cohist_curr_id,cohist_unitprice,cohist_invcdate),2)) as extended, formatMoney(SUM(round(cohist_qtyshipped * currtobase(cohist_curr_id,cohist_unitprice,cohist_invcdate),2))) as f_total, SUM(round(cohist_qtyshipped * currtobase(cohist_curr_id,cohist_unitprice,cohist_invcdate),2)) as total FROM saleshistory LEFT OUTER JOIN cohead ON (cohead_number=cohist_ordernumber) WHERE ((cohist_invcdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("cust_id") ?> AND (cohist_cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("shipto_id") ?> AND (cohist_shipto_id=<? value("shipto_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? endif ?> <? if exists("custtype_pattern") ?> AND (custtype_code ~ <? value("custtype_pattern") ?>) <? endif ?> <? if exists("custgrp_id") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrpitem WHERE (custgrpitem_custgrp_id=<? value("custgrp_id") ?>))) <? endif ?> <? if exists("custgrp_pattern") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrp, custgrpitem WHERE ( (custgrpitem_custgrp_id=custgrp_id) AND (custgrp_name ~ <? value("custgrp_pattern") ?>) )) ) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("item_id") ?> AND (itemsite_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("salesrep_id") ?> AND (cohist_salesrep_id=<? value("salesrep_id") ?>) <? endif ?> ) GROUP BY cohead_id, cust_id,cust_number,cust_custtype_id,cohist_cust_id,custtype_code, cust_name,cohist_ordernumber, cohist_ponumber, cohist_invcnumber,cohist_orderdate, cohist_invcdate ORDER BY cohist_invcdate, cohist_orderdate; 221 0 218 745 218 2 10 38 725 15 12 Arial 10 bold Parameter Query filter 6 21 5 15 745 15 2
    detail detail 16 5 0 100 15 Arial 8 bold detail sonumber 110 0 100 15 Arial 8 bold detail invnumber 665 0 80 15 Arial 8 bold detail f_total 355 0 80 15 Arial 8 bold detail shipdate 270 0 80 15 Arial 8 bold detail orddate
    16 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date 21 665 0 80 15 Arial 8 bold detail total money
    qt-client-4.1.0/share/reports/Budget.xml000066400000000000000000000164051217451700100201540ustar00rootroot00000000000000 Budget Budget Letter 50 50 50 50 detail SELECT formatDate(period_start) AS f_firstperiod, formatDate(period_end) AS f_lastperiod, formatGLAccountLong(budgitem_accnt_id) AS f_accnt, formatMoney(budgitem_amount) AS f_amount FROM budgitem JOIN period ON (budgitem_period_id=period_id) WHERE(budgitem_budghead_id=<? value("budghead_id") ?>) ORDER BY period_start, f_accnt; head SELECT budghead_name, budghead_descrip FROM budghead WHERE(budghead_id=<? value("budghead_id") ?>); 161 160 80 375 15 Arial 8 bold head budghead_descrip 160 65 375 15 Arial 8 bold head budghead_name 5 155 745 155 2 6 21 5 15 745 15 2
    detail detail 17 110 0 100 15 Arial 8 bold detail f_lastperiod 5 0 100 15 Arial 8 bold detail f_firstperiod 215 0 150 15 Arial 8 bold detail f_accnt 370 0 375 15 Arial 8 bold detail f_amount
    17 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/BudgetsMasterList.xml000066400000000000000000000137771217451700100223600ustar00rootroot00000000000000 Budgets Master List BudgetsMasterList Letter 50 50 50 50 detail SELECT formatDate(min(period_start)) AS f_firstperiod, formatDate(max(period_end)) AS f_lastperiod, budghead_name, budghead_descrip FROM budghead LEFT OUTER JOIN budgitem JOIN period ON (budgitem_period_id=period_id) ON (budgitem_budghead_id=budghead_id) GROUP BY budghead_name, budghead_descrip ORDER BY budghead_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 215 0 150 15 Arial 8 bold detail budghead_name 5 0 100 15 Arial 8 bold detail f_firstperiod 370 0 375 15 Arial 8 bold detail budghead_descrip 110 0 100 15 Arial 8 bold detail f_lastperiod
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/BuyCard.xml000066400000000000000000000311111217451700100202620ustar00rootroot00000000000000 Buy Card BuyCard Letter 50 50 50 50 head SELECT vend_number, vend_name, itemsrc_vend_item_number, itemsrc_vend_item_descrip FROM vendinfo, itemsrc WHERE ((vend_id=<? value("vend_id") ?>) AND (itemsrc_id=<? value("itemsrc_id") ?>) ) detail SELECT poitem_id, pohead_number, poitem_linenumber, CASE WHEN(poitem_status='C') THEN TEXT('Closed') WHEN(poitem_status='U') THEN TEXT('Unposted') WHEN(poitem_status='O' AND ((poitem_qty_received-poitem_qty_returned) > 0) AND (poitem_qty_ordered>(poitem_qty_received-poitem_qty_returned))) THEN TEXT('Partial') WHEN(poitem_status='O' AND ((poitem_qty_received-poitem_qty_returned) > 0) AND (poitem_qty_ordered=(poitem_qty_received-poitem_qty_returned))) THEN TEXT('Received') WHEN(poitem_status='O') THEN TEXT('Open') ELSE poitem_status END AS poitemstatus, formatDate(poitem_duedate) as f_duedate, formatQty(poitem_qty_ordered) as f_qtyord, formatQty(COALESCE(SUM(recv_qty), 0)) as f_qty, formatPrice(poitem_unitprice) as f_unitprice FROM pohead, poitem LEFT OUTER JOIN recv ON (recv_orderitem_id=poitem_id) WHERE ( (poitem_pohead_id=pohead_id) AND (recv_order_type='PO') AND (pohead_vend_id=<? value("vend_id") ?>) AND (poitem_vend_item_number=(select itemsrc_vend_item_number from itemsrc where itemsrc_id=<? value("itemsrc_id") ?>)) ) GROUP BY poitem_id, pohead_number, poitem_linenumber, poitem_status, poitem_qty_received, poitem_qty_returned, poitem_duedate, poitem_qty_ordered, poitem_unitprice ORDER BY pohead_number, poitem_linenumber; foot SELECT itemsrc_comments FROM itemsrc WHERE itemsrc_id=<? value("itensrc_id") ?>; 221 135 114 300 20 Arial 10 bold head itemsrc_vend_item_number 5 215 745 215 2 135 65 300 20 Arial 10 bold head vend_number 135 85 300 20 Arial 10 bold head vend_name 135 135 300 20 Arial 10 bold head itemsrc_vend_item_descrip 6 26 5 20 745 20 2
    detail detail 16 260 0 100 15 Arial 8 bold detail f_qtyord 455 0 80 15 Arial 8 bold detail f_unitprice 175 0 80 15 Arial 8 bold detail f_duedate 5 0 50 15 Arial 8 bold detail pohead_number 60 0 50 15 Arial 8 bold detail poitem_linenumber 370 0 80 15 Arial 8 bold detail f_qty 114 0 50 15 Arial 8 bold detail poitemstatus
    16 705 0 40 15 Arial 8 bold Context Query page_number 104 0 100 15 Arial 8 bold Context Query report_date 31 125 5 615 20 5 Arial 10 bold foot itemsrc_comments
    qt-client-4.1.0/share/reports/CCReceipt.xml000066400000000000000000000230471217451700100205430ustar00rootroot00000000000000 Credit Card Receipt CCReceipt Letter 100 100 100 100 header SELECT remitto.*, formatAddr(remitto_address1, remitto_address2, remitto_address3, remitto_citystatezip, remitto_country) AS remitto_addr FROM remitto; detail SELECT *, formatbytea(decrypt(setbytea(ccard_name), setbytea(<? value("key") ?>), 'bf')) AS holder, formatccnumber(decrypt(setbytea(ccard_number), setbytea(<? value("key") ?>), 'bf')) AS xxxx, CASE WHEN (ccpay_type='A') THEN <? value("preauth") ?> WHEN (ccpay_type='C') THEN <? value("charge") ?> WHEN (ccpay_type='R') THEN <? value("refund") ?> ELSE ccpay_type END AS type, CASE WHEN (ccpay_status='A') THEN <? value("authorized") ?> WHEN (ccpay_status='C') THEN <? value("approved") ?> WHEN (ccpay_status='D') THEN <? value("declined") ?> WHEN (ccpay_status='R') THEN <? value("reversed") ?> WHEN (ccpay_status='V') THEN <? value("voided") ?> WHEN (ccpay_status='X') THEN <? value("noapproval") ?> ELSE ccpay_status END AS status FROM ccpay JOIN ccard ON (ccpay_ccard_id=ccard_id) JOIN custinfo ON (ccard_cust_id=cust_id) WHERE (ccpay_id=<? value("ccpay_id") ?>); 101 0 60 250 15 40 Arial 10 normal header remitto_addr 0 40 150 15 Arial 10 normal header remitto_name 160 20 100 15 Arial 10 normal Context Query report_date
    Header header 101
    Detail detail 231 130 160 200 15 Arial 10 bold detail ccpay_r_ref 130 200 200 15 Arial 10 bold detail ccpay_r_ordernum 130 60 200 15 Arial 10 bold detail ccpay_transaction_datetime 130 80 200 15 Arial 10 bold detail type 130 100 200 15 Arial 10 bold detail ccpay_amount 130 180 200 15 Arial 10 bold detail ccpay_by_username 130 20 200 15 Arial 10 bold detail holder 130 0 200 15 Arial 10 bold detail cust_name 130 140 200 15 Arial 10 bold detail status 130 40 200 15 Arial 10 bold detail xxxx
    qt-client-4.1.0/share/reports/CRMAccountMasterList.xml000066400000000000000000000300751217451700100227070ustar00rootroot00000000000000 CRM Accounts Master List CRMAccountMasterList 0.05 0.05 Letter 50 50 50 50 detail crmaccounts detail 160 4.76465 156.293 744.765 156.293 2 5 40 725 15 12 Arial 10 bold Parameter Query filter 6 34 4.23535 30.2931 744.235 30.2931 2
    detail detail 32 550 0 60 15 Arial 8 bold detail competitor 10 0 100 15 Arial 8 bold detail crmacct_number 615 0 60 15 Arial 8 bold detail partner 418.235 0 60 15 Arial 8 bold detail prospect 115 0 234 15 Arial 8 bold detail crmacct_name 680 0 60 15 Arial 8 bold detail taxauth 355 0 60 15 Arial 8 bold detail cust 485 0 60 15 Arial 8 bold detail vend 302.941 15.3526 100 15 Arial 8 bold detail cntct_phone 115 15.3526 185 15 Arial 8 bold detail cntct_name 417.941 15.3526 100 15 Arial 8 bold detail cntct_email
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CapacityUOMsByClassCode.xml000066400000000000000000000321171217451700100233150ustar00rootroot00000000000000 Capacity UOMs By Class Code CapacityUOMsByClassCode Letter 50 50 50 50 head SELECT <? if exists("classcode_id") ?> ( SELECT (classcode_code || '-' || classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) <? else ?> text('All Class Codes') <? endif ?> AS classcode; detail SELECT classcode_code, item_number, item_descrip1, item_descrip2, uom_name, itemcapuom(item_id) AS capuom, formatRatio(itemcapinvrat(item_id)) AS capratio, itemaltcapuom(item_id) AS altcapuom, formatRatio(itemaltcapinvrat(item_id)) AS altcapratio, itemsellinguom(item_id) AS shipuom, formatRatio(iteminvpricerat(item_id)) AS shipratio FROM item, classcode, uom WHERE ((item_classcode_id=classcode_id) AND (item_inv_uom_id=uom_id) <? if exists("classcode_id") ?> AND (classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (classcode_code ~ <? value("classcode_pattern") ?>) <? endif ?> ) ORDER BY classcode_code, item_number; 234 120 120 565 20 Arial 10 bold head classcode 5 228 745 228 2 6 36 5 30 745 30 2
    detail detail 51 600 15 100 15 Arial 8 bold detail shipratio 5 0 90 15 Arial 8 bold detail classcode_code 600 0 100 15 Arial 8 bold detail shipuom 300 0 100 15 Arial 8 bold detail uom_name 400 0 100 15 Arial 8 bold detail capuom 500 0 100 15 Arial 8 bold detail altcapuom 500 15 100 15 Arial 8 bold detail altcapratio 100 15 228 15 Arial 8 bold detail item_descrip1 400 15 100 15 Arial 8 bold detail capratio 5 45 745 45 0 100 0 200 15 Arial 8 bold detail item_number 100 30 228 15 Arial 8 bold detail item_descrip2
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CapacityUOMsByProductCategory.xml000066400000000000000000000321141217451700100245700ustar00rootroot00000000000000 Capacity UOMs by Product Category CapacityUOMsByProductCategory Letter 50 50 50 50 detail SELECT prodcat_code, item_number, item_descrip1, item_descrip2, uom_name, itemcapuom(item_id) AS capuom, formatRatio(itemcapinvrat(item_id)) AS capratio, itemaltcapuom(item_id) AS altcapuom, formatRatio(itemaltcapinvrat(item_id)) AS altcapratio, itemsellinguom(item_id) AS shipuom, formatRatio(iteminvpricerat(item_id)) AS shipratio FROM item, prodcat, uom WHERE ((item_sold) AND (item_inv_uom_id=uom_id) AND (item_prodcat_id=prodcat_id) <? if exists("prodcat_id") ?> AND (prodcat_id=<? value("prodcat_id") ?>) <? elseif exists("prodcat_pattern") ?> AND (prodcat_code ~ <? value("prodcat_pattern") ?>) <? endif ?> ) ORDER BY prodcat_code, item_number; head SELECT <? if exists("prodcat_id") ?> ( SELECT (prodcat_code||'-'||prodcat_descrip) FROM prodcat WHERE (prodcat_id=<? value("prodcat_id") ?>) ) <? elseif exists("prodcat_pattern") ?> text(<? value("prodcat_pattern") ?>) <? else ?> text('All Product Categories') <? endif ?> AS prodcat; 234 160 120 483 20 Arial 10 bold head prodcat 5 228 745 228 2 6 36 5 30 745 30 2
    detail detail 51 600 15 100 15 Arial 8 bold detail shipratio 5 0 55 15 Arial 8 bold detail prodcat_code 70 15 228 15 Arial 8 bold detail item_descrip1 500 15 100 15 Arial 8 bold detail altcapratio 70 0 228 15 Arial 8 bold detail item_number 5 45 745 45 0 600 0 100 15 Arial 8 bold detail shipuom 400 15 100 15 Arial 8 bold detail capratio 300 0 100 15 Arial 8 bold detail uom_name 500 0 100 15 Arial 8 bold detail altcapuom 70 30 228 15 Arial 8 bold detail item_descrip2 400 0 100 15 Arial 8 bold detail capuom
    16 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/CashReceipts.xml000066400000000000000000000376011217451700100213200ustar00rootroot00000000000000 Cash Receipts CashReceipts 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("cust_id") ?> (SELECT (cust_number || '-' || cust_name) FROM custinfo WHERE (cust_id=<? value("cust_id") ?>) ) <? elseif exists("custtype_id") ?> (select (custtype_code||'-'||custtype_descrip) FROM custtype WHERE (custtype_id=<? value("custtype_id") ?>) ) <? elseif exists("custtype_pattern") ?> text(<? value("custtype_pattern") ?>) <? else ?> text('All Customers') <? endif ?> AS f_value, <? if exists("custtype_id") ?> text('Cust. Type:') <? elseif exists("custtype_pattern") ?> text('Cust. Type Pattern:') <? else ?> text('Customer:') <? endif ?> AS f_label, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate; detail cashReceipts detail foot SELECT formatMoney(SUM(base_applied)) AS f_base_applied_total FROM ( <? if exists("LegacyDisplayMode") ?> -- Posted cash receipts SELECT currtobase(arapply_curr_id,arapply_applied,arapply_postdate) AS base_applied FROM custinfo LEFT OUTER JOIN custgrpitem ON (custgrpitem_cust_id=cust_id), arapply WHERE ( (arapply_cust_id=cust_id) AND (arapply_postdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) AND (arapply_source_doctype ='K') <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> ) -- Unposted cash receipts UNION ALL SELECT currtobase(cashrcpt_curr_id,cashrcpt_amount,cashrcpt_distdate) AS base_applied FROM cashrcpt, custinfo LEFT OUTER JOIN custgrpitem ON (custgrpitem_cust_id=cust_id) WHERE ( (NOT cashrcpt_posted) AND (cashrcpt_cust_id=cust_id) AND (cashrcpt_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> ) -- Cash Advance UNION ALL SELECT aropen_amount / aropen_curr_rate AS base_applied FROM custinfo LEFT OUTER JOIN custgrpitem ON (custgrpitem_cust_id=cust_id), aropen JOIN cashrcptitem ON (aropen_id=cashrcptitem_aropen_id) WHERE ( (aropen_cust_id=cust_id) AND (aropen_doctype IN ('R','C')) AND (aropen_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> ) <? else ?> -- New mode SELECT (cashrcpt_amount / cashrcpt_curr_rate) AS base_applied FROM cashrcpt JOIN custinfo ON (cust_id=cashrcpt_cust_id) <? if exists("custgrp_id") ?> LEFT OUTER JOIN custgrpitem ON (custgrpitem_cust_id=cust_id) <? endif ?> WHERE ( (cashrcpt_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> ) <? endif ?> ) data ; 146 10 65 125 20 Arial 10 normal head f_label 140 65 300 20 Arial 10 bold head f_value 565 85 100 20 Arial 10 bold head enddate 5 140 745 140 2 565 65 100 20 Arial 10 bold head startdate 6 28 5 20 745 20 2
    detail detail 20 55 0 155 15 Arial 8 bold detail cust_name 215 0 65 15 Arial 8 bold detail f_postdate 600 0 40 15 Arial 8 bold detail currAbbr 400 0 110 15 Arial 8 bold detail target 5 0 40 15 Arial 8 bold detail cust_number 285 0 115 15 Arial 8 bold detail source 645 0 90 15 Arial 8 bold detail f_base_applied 509 0 80 15 Arial 8 bold detail f_applied
    18 700.755 2 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date 100 646 10.7068 90 15 Arial 8 bold foot f_base_applied_total
    qt-client-4.1.0/share/reports/CashReceiptsEditList.xml000066400000000000000000000306401217451700100227560ustar00rootroot00000000000000 Cash Receipt Edit List CashReceiptsEditList 0.05 0.05 Letter 50 50 50 50 detail SELECT cashrcpt_id, 1 AS orderBy, cust_number, cust_name, formatDate(cashrcpt_distdate) AS f_distdate, CASE WHEN (cashrcpt_fundstype = 'C') THEN <? value("check") ?> WHEN (cashrcpt_fundstype = 'T') THEN <? value("certifiedCheck") ?> WHEN (cashrcpt_fundstype = 'M') THEN <? value("masterCard") ?> WHEN (cashrcpt_fundstype = 'V') THEN <? value("visa") ?> WHEN (cashrcpt_fundstype = 'A') THEN <? value("americanExpress") ?> WHEN (cashrcpt_fundstype = 'D') THEN <? value("discoverCard") ?> WHEN (cashrcpt_fundstype = 'R') THEN <? value("otherCreditCard") ?> WHEN (cashrcpt_fundstype = 'K') THEN <? value("cash") ?> WHEN (cashrcpt_fundstype = 'W') THEN <? value("wireTransfer") ?> ELSE <? value("other") ?> END AS f_fundstype, 'C/R' AS doctype, cashrcpt_docnumber AS docnumber, cashrcpt_amount AS amount, formatMoney(cashrcpt_amount) AS f_amount, 0 AS detailedamount, formatMoney(0) AS f_detailedamount, bankaccnt_name FROM cashrcpt, bankaccnt, custinfo WHERE ( (cashrcpt_bankaccnt_id=bankaccnt_id) AND (cashrcpt_cust_id=cust_id) AND (NOT cashrcpt_posted) AND (NOT cashrcpt_void) ) UNION SELECT cashrcpt_id, 2 AS orderBy, '' AS cust_number, '' AS cust_name, '' AS f_distdate, '' AS f_fundstype, aropen_doctype AS doctype, aropen_docnumber AS docnumber, 0 AS amount, formatMoney(0) AS f_amount, cashrcptitem_amount AS detailedamount, formatMoney(cashrcptitem_amount) AS f_detailedamount, '' AS bankaccnt_name FROM cashrcptitem, cashrcpt, aropen WHERE ( (cashrcptitem_cashrcpt_id=cashrcpt_id) AND (cashrcptitem_aropen_id=aropen_id) AND (NOT cashrcpt_posted) AND (NOT cashrcpt_void) ) UNION SELECT cashrcpt_id, 3 AS orderBy, '' AS cust_number, '' AS cust_name, '' AS f_distdate, '' AS f_fundstype, 'Misc.' AS doctype, (formatGLAccount(accnt_id) || '-' || accnt_descrip) AS docnumber, 0 AS amount, formatMoney(0) AS f_amount, cashrcptmisc_amount AS detailedamount, formatMoney(cashrcptmisc_amount) AS f_detailedamount, '' AS bankaccnt_name FROM cashrcptmisc, cashrcpt, accnt WHERE ( (cashrcptmisc_cashrcpt_id=cashrcpt_id) AND (cashrcptmisc_accnt_id=accnt_id) AND (NOT cashrcpt_posted) AND (NOT cashrcpt_void) ) ORDER BY cashrcpt_id, orderBy; 145 5 130 745 130 2
    detail detail cashrcpt_id 18 540 0 60 15 Arial 8 bold detail f_amount 85 0 130 15 Arial 8 bold detail cust_name 615 0 125 15 Arial 8 bold detail bankaccnt_name 10 0 60 15 Arial 8 bold detail cust_number 315 0 80 15 Arial 8 bold detail f_fundstype 409 0 110 15 Arial 8 bold detail docnumber 229 0 60 15 Arial 8 bold detail f_distdate 41 670 5 75 15 Arial 8 bold detail detailedamount extprice 5 25 740 25 2 detail 18 85 0 315 15 Arial 8 bold detail docnumber 15 0 50 15 Arial 8 bold detail doctype 540 0 60 15 Arial 8 bold detail f_detailedamount
    28 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 43 670 5 75 15 Arial 8 bold detail amount extprice 7 28 742 28 2
    qt-client-4.1.0/share/reports/CharacteristicsMasterList.xml000066400000000000000000000202641217451700100240630ustar00rootroot00000000000000 Characteristics Master List CharacteristicsMasterList Letter 50 50 50 50 detail SELECT char_id, char_name, formatBoolYN(char_items) AS f_items, formatBoolYN(char_options) AS f_options, formatBoolYN(char_attributes) AS f_attributes, formatBoolYN(char_lotserial) AS f_lotserial, char_notes FROM char ORDER BY char_name; 86 5 80 745 80 2 6 41 5 35 745 35 2
    detail detail 17 270 0 50 15 Arial 8 bold detail f_options 220 0 50 15 Arial 8 bold detail f_items 10 0 200 15 Arial 8 bold detail char_name 425 0 320 13 5 Arial 8 bold detail char_notes 320 0 50 15 Arial 8 bold detail f_attributes 370 0 50 15 Arial 8 bold detail f_lotserial
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/CheckMultiPage.xml000066400000000000000000000531621217451700100215700ustar00rootroot00000000000000 Sample Check Format - 3 Part - MC - Remit - Multi Page CheckMultiPage Sample Check Format - 3 Part - MC - Uses primary Vendor or address with names: REMIT, Remit, or remit if one exists. Multi-Page. Letter 50 0 50 50 Head SELECT checkhead_id, checkhead_number, checkhead_for AS memo, formatDate(checkhead_checkdate) AS f_checkdate, formatMoney(checkhead_amount) AS f_amount, INITCAP(spellAmount(checkhead_amount, curr_id)) AS f_words, CASE WHEN(checkhead_void) THEN TEXT('V O I D') ELSE TEXT('') END AS f_void, CASE WHEN checkhead_recip_type = 'C' THEN (SELECT cust_number FROM custinfo WHERE (cust_id=checkhead_recip_id)) WHEN checkhead_recip_type = 'T' THEN (SELECT taxauth_code FROM taxauth WHERE (taxauth_id=checkhead_recip_id)) WHEN checkhead_recip_type = 'V' THEN (SELECT vend_number FROM vendinfo WHERE (vend_id=checkhead_recip_id)) ELSE 'Unknown Recipient Type' END AS recip_number, formatAddr(CASE WHEN checkhead_recip_type = 'C' THEN (SELECT cntct_addr_id FROM cntct, custinfo WHERE ((cust_cntct_id=cntct_id) AND (cust_id=checkhead_recip_id))) WHEN checkhead_recip_type = 'T' THEN (SELECT taxauth_addr_id FROM taxauth WHERE (taxauth_id=checkhead_recip_id)) WHEN checkhead_recip_type = 'V' THEN COALESCE((SELECT vendaddr_addr_id FROM vendaddrinfo WHERE ((UPPER(vendaddr_code)='REMIT') AND (vendaddr_vend_id=checkhead_recip_id))), (SELECT vend_addr_id FROM vendinfo WHERE (vend_id=checkhead_recip_id))) END) AS check_address, CASE WHEN checkhead_recip_type = 'C' THEN (SELECT cust_name FROM custinfo WHERE cust_id=checkhead_recip_id) WHEN checkhead_recip_type = 'T' THEN (SELECT taxauth_name FROM taxauth WHERE taxauth_id=checkhead_recip_id) WHEN checkhead_recip_type = 'V' THEN COALESCE((SELECT vendaddr_name FROM vendaddrinfo WHERE ((UPPER(vendaddr_code)='REMIT') AND (vendaddr_vend_id=checkhead_recip_id))), (SELECT vend_name FROM vendinfo WHERE (vend_id=checkhead_recip_id))) END AS recip_name, curr_symbol, curr_abbr, curr_name FROM checkhead, curr_symbol WHERE ((checkhead_curr_id = curr_id) AND (checkhead_id=<? value("checkhead_id") ?>) ); CheckDetail SELECT checkdata_page, checkdata_checknumber, checkdata_checkwords, checkdata_checkdate, checkdata_checkamount, checkdata_checkcurrsymbol, checkdata_checkcurrabbr, checkdata_checkcurrname, checkdata_checkpayto, checkdata_checkaddress, checkdata_checkmemo, checkdata_docnumber, checkdata_docreference, checkdata_docdate, checkdata_docamount, checkdata_docdiscount, checkdata_docnetamount FROM checkDetailFormatted(<? value("checkhead_id") ?>, 12);
    Check Line Detail checkdata_page 351 175 50 120 250 Arial 8 normal CheckDetail checkdata_docreference 555 50 80 250 Arial 8 normal CheckDetail checkdata_docdiscount 85 325 660 20 Arial 8 normal Head memo 645 50 100 250 Arial 8 normal CheckDetail checkdata_docnetamount 305 25 147 20 Arial 8 normal Context Query report_date 5 50 155 250 Arial 8 normal CheckDetail checkdata_docnumber 145 0 175 25 Arial 8 normal Head recip_name 5 45 745 45 0 450 305 745 305 0 650 0 95 25 Arial 10 normal Head checkhead_number 640 305 104 20 Arial 8 normal Head f_amount 444 50 100 250 Arial 8 normal CheckDetail checkdata_docamount 10 0 135 25 Arial 8 normal Head recip_number 580 305 55 20 Arial 8 normal Head curr_symbol 310 50 100 250 Arial 8 normal CheckDetail checkdata_docdate 351 645 0 95 25 Arial 10 normal Head checkhead_number 5 50 155 250 Arial 8 normal CheckDetail checkdata_docnumber 550 50 80 250 Arial 8 normal CheckDetail checkdata_docdiscount 445 305 740 305 0 170 50 120 250 Arial 8 normal CheckDetail checkdata_docreference 440 50 100 250 Arial 8 normal CheckDetail checkdata_docamount 80 325 660 20 Arial 8 normal Head memo 575 305 55 20 Arial 8 normal Head curr_symbol 5 45 745 45 0 300 25 147 20 Arial 8 normal Context Query report_date 140 0 175 25 Arial 8 normal Head recip_name 640 50 100 250 Arial 8 normal CheckDetail checkdata_docnetamount 305 50 100 250 Arial 8 normal CheckDetail checkdata_docdate 635 305 104 20 Arial 8 normal Head f_amount 5 0 135 25 Arial 8 normal Head recip_number CheckDetail 292 10 100 225 25 Arial 10 normal CheckDetail checkdata_checkpayto 15 40 560 30 Arial 12 normal CheckDetail checkdata_checkwords 405 85 121 25 Arial 10 normal CheckDetail checkdata_checkdate 80 260 650 20 Arial 8 normal CheckDetail checkdata_checkmemo 10 125 300 20 10 Arial 10 normal CheckDetail checkdata_checkaddress 545 85 55 25 Arial 10 normal CheckDetail checkdata_checkcurrsymbol 600 85 125 25 Arial 10 normal CheckDetail checkdata_checkamount
    qt-client-4.1.0/share/reports/CheckRegister.xml000066400000000000000000000430701217451700100214620ustar00rootroot00000000000000 Check Register CheckRegister Letter 50 50 50 50 head SELECT bankaccnt_name, bankaccnt_descrip, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, curr_symbol FROM bankaccnt, curr_symbol WHERE ((bankaccnt_id=<? value("bankaccnt_id") ?>) AND (bankaccnt_curr_id = curr_id)); detail SELECT checkhead_id AS checkid, CASE WHEN(checkhead_void) THEN -1 WHEN(checkhead_posted) THEN 1 ELSE 0 END AS extra, -1 AS checkitem_id, formatBoolYN(checkhead_void) AS f_void, formatBoolYN(checkhead_misc) AS f_misc, formatBoolYN(checkhead_printed) AS f_printed, formatBoolYN(checkhead_posted) AS f_posted, CASE when checkhead_number = -1 THEN 'Unspecified' ELSE TEXT(checkhead_number) END AS number, COALESCE(checkrecip_number || '-' || checkrecip_name, checkhead_recip_type || '-' || checkhead_recip_id ) AS description, formatDate(checkhead_checkdate) AS f_checkdate, formatMoney(checkhead_amount) AS f_amount, currConcat(checkhead_curr_id) AS currAbbr, checkhead_number, checkhead_ach_batch, 1 AS orderby FROM checkhead LEFT OUTER JOIN checkrecip ON ((checkhead_recip_id=checkrecip_id) AND (checkhead_recip_type=checkrecip_type)) WHERE ((checkhead_checkdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) AND (checkhead_bankaccnt_id=<? value("bankaccnt_id") ?>) <? if exists("check_number") ?> AND (CAST(checkhead_number AS text) ~ <? value("check_number") ?>) <? endif ?> <? if exists("recip") ?> <? if exists("recip_type_v") ?> AND (checkhead_recip_type = 'V' ) <? endif ?> <? if exists("recip_type_c") ?> AND (checkhead_recip_type = 'C' ) <? endif ?> <? if exists("recip_type_t") ?> AND (checkhead_recip_type = 'T' ) <? endif ?> <? if exists("recip_id") ?> AND (checkhead_recip_id = <? value("recip_id") ?> ) <? endif ?> <? endif ?> ) <? if exists("showDetail") ?> UNION SELECT checkitem_checkhead_id AS checkid, 0 AS extra, checkitem_id, '' AS f_void, '' AS f_misc, '' AS f_printed, '' AS f_posted, checkitem_vouchernumber AS number, checkitem_invcnumber AS description, '' AS f_checkdate, formatMoney(checkitem_amount) AS f_amount, currConcat(checkitem_curr_id) AS currAbbr, checkhead_number, NULL, 2 AS orderby FROM checkitem, checkhead WHERE ( (checkitem_checkhead_id=checkhead_id) AND (checkhead_checkdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) AND (checkhead_bankaccnt_id=<? value("bankaccnt_id") ?>) <? if exists("check_number") ?> AND (CAST(checkhead_number AS text) ~ <? value("check_number") ?>) <? endif ?> <? if exists("recip") ?> <? if exists("recip_type_v") ?> AND (checkhead_recip_type = 'V' ) <? endif ?> <? if exists("recip_type_c") ?> AND (checkhead_recip_type = 'C' ) <? endif ?> <? if exists("recip_type_t") ?> AND (checkhead_recip_type = 'T' ) <? endif ?> <? if exists("recip_id") ?> AND (checkhead_recip_id = <? value("recip_id") ?> ) <? endif ?> <? endif ?> ) <? endif ?> ORDER BY checkhead_number, checkid, orderby; total SELECT formatMoney(SUM(currToCurr(checkhead_curr_id, bankaccnt_curr_id, checkhead_amount, checkhead_checkdate))) AS f_amount, currConcat(bankaccnt_curr_id) AS currAbbr FROM checkhead, checkrecip, bankaccnt WHERE ( (checkhead_recip_id=checkrecip_id) AND (checkhead_recip_type=checkrecip_type) AND (NOT checkhead_void) AND (checkhead_checkdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) AND (checkhead_bankaccnt_id=bankaccnt_id) AND (checkhead_bankaccnt_id=<? value("bankaccnt_id") ?>) <? if exists("check_number") ?> AND (CAST(checkhead_number AS text) ~ <? value("check_number") ?>) <? endif ?> <? if exists("recip") ?> <? if exists("recip_type_v") ?> AND (checkhead_recip_type = 'V' ) <? endif ?> <? if exists("recip_type_c") ?> AND (checkhead_recip_type = 'C' ) <? endif ?> <? if exists("recip_type_t") ?> AND (checkhead_recip_type = 'T' ) <? endif ?> <? if exists("recip_id") ?> AND (checkhead_recip_id = <? value("recip_id") ?> ) <? endif ?> <? endif ?> ) GROUP BY bankaccnt_curr_id; 168 550 65 100 20 Arial 10 bold head startdate 140 65 150 20 Arial 10 bold head bankaccnt_name 550 85 100 20 Arial 10 bold head enddate 140 85 300 20 Arial 10 bold head bankaccnt_descrip 5 155 745 155 2 12 28 5 15 745 15 2
    detail detail 31 111 0 50 15 Arial 8 bold detail f_printed 560 0 90 15 Arial 8 bold detail f_checkdate 170 0 50 15 Arial 8 bold detail f_posted 5 0 50 15 Arial 8 bold detail f_void 330 0 225 15 Arial 8 bold detail description 225 15 100 15 Arial 8 bold detail checkhead_ach_batch 225 0 100 15 Arial 8 bold detail number 750 0 35 15 Arial 8 bold detail currAbbr 60 0 50 15 Arial 8 bold detail f_misc 655 0 90 15 Arial 8 bold detail f_amount
    28 101 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 28 565 0 745 0 0 750 0 35 15 Arial 8 normal head curr_symbol 655 0 90 15 Arial 8 bold total f_amount
    qt-client-4.1.0/share/reports/ClassCodesMasterList.xml000066400000000000000000000101511217451700100227650ustar00rootroot00000000000000 Class Codes Master List ClassCodesMasterList Letter 50 50 50 50 detail select classcode_code, classcode_descrip from classcode order by classcode_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail classcode_code 175 0 565 15 Arial 8 bold detail classcode_descrip
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ContactsMasterList.xml000066400000000000000000000244741217451700100225350ustar00rootroot00000000000000 Contacts Master List ContactsMasterList 0.05 0.05 Letter 50 50 50 50 detail contacts detail 143 6 137 995 137 2 5 33 725 15 12 Arial 10 bold Parameter Query filter 6 21 5 15 994 15 2
    detail detail 17 250 0 75 15 Arial 8 bold detail crmacct_number 10 0 100 15 Arial 8 bold detail cntct_first_name 725 0 145 15 0 Arial 8 bold detail cntct_email 875 0 120 15 Arial 8 bold detail cntct_webaddr 545 0 75 15 Arial 8 bold detail cntct_phone2 450 0 75 15 Arial 8 bold detail cntct_phone 120 0 120 15 Arial 8 bold detail cntct_last_name 625 0 75 15 Arial 8 bold detail cntct_fax 325 0 100 15 0 Arial 8 bold detail crmacct_name
    17 90 0 100 15 Arial 8 bold Context Query report_date 945 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/Contracts.xml000066400000000000000000000204611217451700100206770ustar00rootroot00000000000000 Contracts Contracts 0.05 0.05 Letter 50 50 50 50 detail contracts detail 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 22 10 2 75 15 Arial 8 bold detail vend_number 90 2 135 15 Arial 8 bold detail vend_name 235 2 75 15 Arial 8 bold detail contrct_number 320 2 135 15 Arial 8 bold detail contrct_descrip 470 2 75 15 Arial 8 bold detail contrct_effective 565 2 75 15 Arial 8 bold detail contrct_expires 655 2 35 15 Arial 8 bold detail item_count
    25 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CostCategoriesMasterList.xml000066400000000000000000000272241217451700100236710ustar00rootroot00000000000000 Cost Categories Master List CostCategoriesMasterList Letter 50 50 50 50 detail SELECT costcat_code, costcat_descrip, CASE WHEN (costcat_asset_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_asset_accnt_id) ELSE '' END AS asset, CASE WHEN (costcat_wip_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_wip_accnt_id) ELSE '' END AS wip, CASE WHEN (costcat_invcost_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_invcost_accnt_id) ELSE '' END AS invcost, CASE WHEN (costcat_purchprice_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_purchprice_accnt_id) ELSE '' END AS purchprice, CASE WHEN (costcat_adjustment_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_adjustment_accnt_id) ELSE '' END AS adjustment, CASE WHEN (costcat_scrap_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_scrap_accnt_id) ELSE '' END AS scrap, CASE WHEN fetchMetricBool('Routings') THEN 'Labor and Overhead Costs:' ELSE '' END AS laboroverheadLit, CASE WHEN (fetchMetricBool('Routings') AND costcat_laboroverhead_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_laboroverhead_accnt_id) ELSE '' END AS laboroverhead, CASE WHEN (costcat_liability_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_liability_accnt_id) ELSE '' END AS liability, CASE WHEN fetchMetricBool('MultiWhs') THEN 'Transfer Order Liability Clearing:' ELSE '' END AS toliabilityLit, CASE WHEN (fetchMetricBool('MultiWhs') AND costcat_toliability_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_toliability_accnt_id) ELSE '' END AS toliability, CASE WHEN fetchMetricBool('Transforms') THEN 'Transform Clearing:' ELSE '' END AS transformLit, CASE WHEN (fetchMetricBool('Transforms') AND costcat_transform_accnt_id IS NOT NULL) THEN formatGlAccountLong(costcat_transform_accnt_id) ELSE '' END AS transform FROM costcat ORDER BY costcat_code; 61 5 55 745 55 2
    detail detail 161 415 55 160 15 Arial 8 normal detail transformLit 575 55 250 15 Arial 8 normal detail transform 165 55 250 15 Arial 8 bold detail wip 575 70 250 15 Arial 8 bold detail toliability 415 70 160 15 Arial 8 normal detail toliabilityLit 165 100 250 15 Arial 8 bold detail adjustment 120 20 600 15 Arial 8 bold detail costcat_descrip 165 131 250 15 Arial 8 bold detail liability 165 40 250 15 Arial 8 bold detail asset 20 150 760 150 0 120 5 600 15 Arial 8 bold detail costcat_code 415 40 160 15 Arial 8 normal detail laboroverheadLit 165 84 250 15 Arial 8 bold detail purchprice 575 40 250 15 Arial 8 bold detail laboroverhead 165 70 250 15 Arial 8 bold detail invcost 165 115 250 15 Arial 8 bold detail scrap
    15 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CostedIndentedBOM.xml000066400000000000000000000522261217451700100221750ustar00rootroot00000000000000 Costed Indented Bill of Materials CostedIndentedBOM 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, uom_name AS item_invuom, item_descrip1, item_descrip2, <? if exists("useActualCosts") ?> text('Using Actual Costs') AS lbl_usecosts, (SELECT formatCost(SUM(bomdata_actextendedcost)) FROM indentedbom(<? value("item_id") ?>,<? value("revision_id") ?>,0,0) WHERE (bomdata_bomwork_level=1)) as t_extendedcost, <? else ?> text('Using Standard Costs') AS lbl_usecosts, (SELECT formatCost(SUM(bomdata_stdextendedcost)) FROM indentedbom(<? value("item_id") ?>,<? value("revision_id") ?>,0,0) WHERE (bomdata_bomwork_level=1)) as t_extendedcost, <? endif ?> formatCost(actcost(item_id)) AS f_actual, formatCost(stdcost(item_id)) AS f_standard FROM item JOIN uom ON (uom_id=item_inv_uom_id) WHERE (item_id=<? value("item_id") ?>); detail select (REPEAT(' ',(bomdata_bomwork_level-1)*3) || bomdata_bomwork_seqnumber) AS f_seqnumber, 1 AS seq_ord, bomdata_item_number AS item_number, bomdata_uom_name AS item_invuom, bomdata_item_descrip1 AS item_descrip1, bomdata_item_descrip2 AS item_descrip2, bomdata_createchild as createchild, bomdata_issuemethod AS issuemethod, formatQtyPer(bomdata_qtyreq) AS qtyreq, formatScrap(bomdata_scrap) AS scrap, CASE WHEN COALESCE(bomdata_effective, startOfTime()) <= startOfTime() THEN <? value("always") ?> ELSE formatDate(bomdata_effective) END AS effective, CASE WHEN COALESCE(bomdata_expires, endOfTime()) <= endOfTime() THEN <? value("never") ?> ELSE formatDate(bomdata_expires) END AS expires, <? if exists("useActualCosts") ?> formatCost(bomdata_actunitcost) AS f_unitcost, formatCost(bomdata_actextendedcost) AS f_extendedcost, CASE WHEN(bomdata_bomwork_parent_id=-1) THEN bomdata_actextendedcost ELSE 0 END AS extendedcost, <? else ?> formatCost(bomdata_stdunitcost) AS f_unitcost, formatCost(bomdata_stdextendedcost) AS f_extendedcost, CASE WHEN(bomdata_bomwork_parent_id=-1) THEN bomdata_stdextendedcost ELSE 0 END AS extendedcost, <? endif ?> bomdata_bomwork_level FROM indentedBOM(<? value("item_id") ?>,<? value("revision_id") ?>,0,0); bomhead SELECT bomhead_docnum, bomhead_revision, formatDate(bomhead_revisiondate) AS f_revisiondate FROM bomhead WHERE ((bomhead_item_id=<? value("item_id") ?>) AND (bomhead_rev_id=<? value("revision_id") ?>)); 242 100 104 150 20 Arial 10 bold head item_number 5 235 745 235 2 585 104 150 20 Arial 10 bold bomhead bomhead_docnum 100 145 300 20 Arial 10 bold head item_descrip2 585 145 150 20 Arial 10 bold bomhead bomhead_revision 315 104 150 20 Arial 10 bold head item_invuom 350 60 205 20 Arial 10 bold head lbl_usecosts 100 125 300 20 Arial 10 bold head item_descrip1 585 125 150 20 Arial 10 bold bomhead f_revisiondate 6 36 5 30 745 30 2
    detail detail 52 500 0 75 15 Arial 8 bold detail effective 114 0 150 15 Arial 8 bold detail item_number 114 15 300 15 Arial 8 bold detail item_descrip1 5 0 104 15 Arial 8 bold detail f_seqnumber 580 0 75 15 Arial 8 bold detail expires 665 15 80 15 Arial 8 bold detail f_extendedcost 340 0 75 15 Arial 8 bold detail qtyreq 5 45 745 45 0 275 0 50 15 Arial 8 bold detail item_invuom 665 0 80 15 Arial 8 bold detail f_unitcost 419 0 75 15 Arial 8 bold detail scrap 580 15 75 15 Arial 8 bold detail issuemethod 500 15 75 15 Arial 8 bold detail createchild 114 30 300 15 Arial 8 bold detail item_descrip2
    18 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 47 665 15 80 15 Arial 8 bold head f_actual 665 30 80 15 Arial 8 bold head f_standard 665 0 80 15 Arial 8 bold head t_extendedcost
    qt-client-4.1.0/share/reports/CostedSingleLevelBOM.xml000066400000000000000000000536131217451700100226550ustar00rootroot00000000000000 Costed Single Level Bill of Materials CostedSingleLevelBOM Letter 50 50 50 50 head SELECT item_number, uom_name AS item_invuom, item_descrip1, item_descrip2, formatCost(stdcost(item_id)) AS standardcost, formatCost(actcost(item_id)) AS actualcost, <? if exists("useActualCosts") ?> text('Actual Cost') <? else ?> text('Standard Cost') <? endif ?> AS costtype FROM item JOIN uom ON (uom_id=item_inv_uom_id) WHERE (item_id=<? value("item_id") ?>); detail SELECT bomdata_bomwork_seqnumber AS orderby, CASE WHEN bomdata_bomwork_seqnumber > 0 THEN text(bomdata_bomwork_seqnumber) ELSE NULL END AS seqnumber, bomdata_item_number AS item_number, bomdata_uom_name AS item_invuom, bomdata_item_descrip1 AS item_descrip1, bomdata_item_descrip2 AS item_descrip2, bomdata_issuemethod AS issuemethod, formatQty(bomdata_qtyfxd) AS qtyfxd, formatQtyPer(bomdata_qtyper) AS qtyper, formatScrap(bomdata_scrap) AS scrap, CASE WHEN item_inv_uom_id IS NOT NULL THEN formatqtyper((bomitem_qtyfxd + bomitem_qtyper) * (1 + bomitem_scrap) * itemuomtouomratio(bomitem_item_id,bomitem_uom_id,item_inv_uom_id)) ELSE '' END AS qtyreq, CASE WHEN COALESCE(bomdata_effective, startOfTime()) <= startOfTime() THEN <? value("always") ?> ELSE formatDate(bomdata_effective) END AS effective, CASE WHEN COALESCE(bomdata_expires, endOfTime()) >= endOfTime() THEN <? value("never") ?> ELSE formatDate(bomdata_expires) END AS expires, <? if exists("useActualCosts") ?> formatCost(bomdata_actunitcost) <? else ?> formatCost(bomdata_stdunitcost) <? endif ?> AS unitcost, <? if exists("useActualCosts") ?> formatCost(bomdata_actextendedcost) <? else ?> formatCost(bomdata_stdextendedcost) <? endif ?> AS extcost FROM singlelevelbom(<? value("item_id") ?>,<? value("revision_id") ?>,0,0) LEFT OUTER JOIN bomitem ON (bomdata_bomitem_id=bomitem_id) LEFT OUTER JOIN item ON (bomitem_item_id=item_id) ORDER BY orderby; bomhead SELECT bomhead_docnum, bomhead_revision, formatDate(bomhead_revisiondate) AS f_revisiondate FROM bomhead WHERE ((bomhead_item_id=<? value("item_id") ?>) AND (bomhead_rev_id=<? value("revision_id") ?>)); 217 510 100 200 20 Arial 10 bold bomhead f_revisiondate 125 80 200 20 Arial 10 bold head item_number 510 120 200 20 Arial 10 bold bomhead bomhead_revision 125 120 300 20 Arial 10 bold head item_descrip2 5 210 745 210 2 510 80 200 20 Arial 10 bold bomhead bomhead_docnum 430 50 200 20 Arial 10 bold head costtype 125 100 300 20 Arial 10 bold head item_descrip1 6 36 5 30 745 30 2
    detail detail 53 405 0 37 15 Arial 8 bold detail item_invuom 675 0 75 15 Arial 8 bold detail expires 315 0 75 15 Arial 8 bold detail qtyfxd 70 0 228 15 Arial 8 bold detail item_number 315 31 75 15 Arial 8 bold detail unitcost 675 15 75 15 Arial 8 bold detail issuemethod 443 15 75 15 Arial 8 bold detail extcost 70 15 228 15 Arial 8 bold detail item_descrip1 443 0 75 15 Arial 8 bold detail scrap 5 45 745 45 0 70 30 228 15 Arial 8 bold detail item_descrip2 15 0 40 15 Arial 8 bold detail seqnumber 600 0 75 15 Arial 8 bold detail effective 600 15 75 15 Arial 8 bold detail createchild 525 0 75 15 Arial 8 bold detail qtyreq 315 16 75 15 Arial 8 bold detail qtyper
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 53 443 35 75 15 Arial 8 bold head standardcost 443 20 75 15 Arial 8 bold head actualcost 443 5 75 15 Arial 8 bold detail extcost %9.4f
    qt-client-4.1.0/share/reports/CostedSummarizedBOM.xml000066400000000000000000000322341217451700100225600ustar00rootroot00000000000000 Costed Summarized Bill of Materials CostedSummarizedBOM Letter 50 50 50 50 head SELECT item_number, uom_name AS item_invuom, item_descrip1, item_descrip2, <? if exists("useActualCosts") ?> text('Actual Costs') AS f_costtype <? else ?> text('Standard Costs') AS f_costtype <? endif ?> FROM item JOIN uom ON (uom_id=item_inv_uom_id) WHERE (item_id=<? value("item_id") ?>); detail select bomdata_item_number AS item_number, bomdata_uom_name AS item_invuom, bomdata_item_descrip1 AS item_descrip1, bomdata_item_descrip2 AS item_descrip2, formatQtyPer(bomdata_qtyreq) AS qtyreq, <? if exists("useActualCosts") ?> formatCost(bomdata_actunitcost) AS f_cost, formatCost(bomdata_actextendedcost) AS f_extcost <? else ?> formatCost(bomdata_stdunitcost) AS f_cost, formatCost(bomdata_stdextendedcost) AS f_extcost <? endif ?> FROM summarizedBOM(<? value("item_id") ?>,<? value("revision_id") ?>,<? value("expiredDays") ?>,<? value("futureDays") ?>); bomhead SELECT bomhead_docnum, bomhead_revision, formatDate(bomhead_revisiondate) AS f_revisiondate FROM bomhead WHERE ((bomhead_item_id=<? value("item_id") ?>) AND (bomhead_rev_id=<? value("revision_id") ?>)); 242 100 104 150 20 Arial 10 bold head item_number 315 104 150 20 Arial 10 bold head item_invuom 100 125 300 20 Arial 10 bold head item_descrip1 100 145 300 20 Arial 10 bold head item_descrip2 580 125 150 20 Arial 10 bold bomhead f_revisiondate 410 50 150 20 Arial 10 bold head f_costtype 580 145 150 20 Arial 10 bold bomhead bomhead_revision 5 235 745 235 2 580 104 150 20 Arial 10 bold bomhead bomhead_docnum 6 36 5 30 745 30 2
    detail detail 52 665 0 75 15 Arial 8 bold detail f_extcost 425 0 75 15 Arial 8 bold detail qtyreq 585 0 75 15 Arial 8 bold detail f_cost 113 30 300 15 Arial 8 bold detail item_descrip2 5 45 745 45 0 113 15 300 15 Arial 8 bold detail item_descrip1 113 0 150 15 Arial 8 bold detail item_number 275 0 50 15 Arial 8 bold detail item_invuom
    18 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/CountSlipEditList.xml000066400000000000000000000227341217451700100223260ustar00rootroot00000000000000 Count Slip Edit List CountSlipEditList Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, warehous_code as warehouse, invcnt_tagnumber FROM item, itemsite, invcnt, whsinfo WHERE ((itemsite_item_id=item_id) AND (invcnt_itemsite_id=itemsite_id) AND (invcnt_id=<? value("cnttag_id") ?>) AND (itemsite_warehous_id=warehous_id) ); detail SELECT cntslip_username AS f_username, cntslip_number, formatBoolYN(cntslip_posted) AS f_posted, formatDateTime(cntslip_entered) AS f_entered, formatQty(cntslip_qty) AS f_qty FROM cntslip WHERE (cntslip_cnttag_id=<? value("cnttag_id") ?>) ORDER BY cntslip_number; 221 100 95 200 20 Arial 10 bold head item_number 5 215 745 215 2 100 135 300 20 Arial 10 bold head item_descrip2 100 75 200 20 Arial 10 bold head invcnt_tagnumber 100 114 300 20 Arial 10 bold head item_descrip1 100 155 200 20 Arial 10 bold head warehouse 6 21 5 15 745 15 2
    detail detail 16 165 0 275 15 Arial 8 bold detail cntslip_number 540 0 114 15 Arial 8 bold detail f_entered 455 0 75 15 Arial 8 bold detail f_posted 665 0 75 15 Arial 8 bold detail f_qty 50 0 105 15 Arial 8 bold detail f_username
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CountSlipsByWarehouse.xml000066400000000000000000000327341217451700100232260ustar00rootroot00000000000000 Count Slips By Site CountSlipsByWarehouse 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate detail SELECT invcnt_tagnumber AS tagnum, <? if exists("asNumeric") ?> int4(cntslip_number) <? else ?> cntslip_number <? endif ?> AS slipnum, warehous_code, item_number, item_descrip1, item_descrip2, formatDate(cntslip_entered) AS date_entered, ('( ' || cntslip_username || ' )') AS enteredby, formatQty(cntslip_qty) AS f_qtycounted, formatBoolYN(cntslip_posted) AS f_posted FROM cntslip, invcnt, itemsite, item, whsinfo WHERE ((cntslip_cnttag_id=invcnt_id) AND (invcnt_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (cntslip_entered BETWEEN <? value("startDate") ?> AND (<? value("endDate") ?>::DATE + 1)) <? if not exists("showUnposted") ?> AND (cntslip_posted) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY slipnum; 191 515 110 200 20 Arial 10 bold head enddate 100 90 200 20 Arial 10 bold head warehouse 5 185 745 185 2 515 90 200 20 Arial 10 bold head startdate 6 36 5 30 745 30 2
    detail detail 56 300 15 150 15 Arial 8 bold detail tagnum 50 0 245 15 Arial 8 bold detail item_number 580 0 80 15 Arial 8 bold detail f_qtycounted 5 50 745 50 0 50 15 245 15 Arial 8 bold detail item_descrip1 10 0 35 15 Arial 8 bold detail warehous_code 50 30 245 15 Arial 8 bold detail item_descrip2 484 15 85 15 Arial 8 bold detail enteredby 300 0 150 15 Arial 8 bold detail slipnum 484 0 85 15 Arial 8 bold detail date_entered 670 0 55 15 Arial 8 bold detail f_posted
    16 95 0 100 15 Arial 8 bold Context Query report_date 710 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/CountTagEditList.xml000066400000000000000000000434641217451700100221350ustar00rootroot00000000000000 Count Tag Edit List CountTagEditList Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("classcode_id") ?> ( SELECT (classcode_code ||'-'||classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) AS code, text('Class Code:') AS codelbl <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) AS code, text('Class Code:') AS codelbl <? elseif exists("plancode_id") ?> ( SELECT (plancode_code ||'-'|| plancode_name) FROM plancode WHERE (plancode_id=<? value("plancode_id") ?>) ) AS code, text('Planner Code:') AS codelbl <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) AS code, text('Planner Code:') AS codelbl <? else ?> text('') AS code, text('') AS codelbl <? endif ?> detail SELECT formatBoolYN(invcnt_priority) AS f_priority, CASE WHEN (invcnt_tagnumber IS NULL) THEN 'Misc.' ELSE invcnt_tagnumber END AS f_tagnumber, formatDate(invcnt_tagdate) AS f_tagdate, item_number, item_descrip1, item_descrip2, warehous_code, CASE WHEN (invcnt_location_id IS NOT NULL) THEN (SELECT formatQty(SUM(itemloc_qty)) FROM itemloc WHERE ((itemloc_itemsite_id=itemsite_id) AND (itemloc_location_id=invcnt_location_id)) ) ELSE formatQty(itemsite_qtyonhand) END AS f_qoh, CASE WHEN (location_id IS NOT NULL) THEN location_name ELSE 'All' END AS location_name, CASE WHEN (invcnt_qoh_after IS NULL) THEN '' ELSE formatQty(invcnt_qoh_after) END AS f_cntqty, CASE WHEN (invcnt_qoh_after IS NULL) THEN '' ELSE formatQty(invcnt_qoh_after - itemsite_qtyonhand) END AS f_variance, CASE WHEN (invcnt_qoh_after IS NULL) THEN '' WHEN ((itemsite_qtyonhand = 0) AND (invcnt_qoh_after > 0)) THEN formatPrcnt(1) WHEN ((itemsite_qtyonhand = 0) AND (invcnt_qoh_after < 0)) THEN formatPrcnt(-1) WHEN ((itemsite_qtyonhand = 0) AND (invcnt_qoh_after = 0)) THEN formatPrcnt(0) ELSE formatPrcnt((1 - (invcnt_qoh_after / itemsite_qtyonhand)) * -1) END AS f_percent, formatExtPrice(stdcost(item_id) * (invcnt_qoh_after - itemsite_qtyonhand)) AS f_amount FROM invcnt LEFT OUTER JOIN location ON (invcnt_location_id=location_id), item, whsinfo, itemsite WHERE ((invcnt_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (NOT invcnt_posted) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN ( SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>))) <? elseif exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN ( SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> ) ORDER BY f_priority DESC, item_number <? if exists("maxTags") ?> LIMIT <? value("maxTags") ?> <? endif ?> 205 5 200 745 200 2 100 100 330 20 Arial 10 bold head warehouse 100 80 330 20 Arial 10 bold head code 0 80 95 20 Arial 10 normal head codelbl 8 38 5 30 745 30 2
    detail detail 55 580 0 75 15 Arial 8 bold detail f_variance 5 45 745 45 0 295 15 104 15 Arial 8 bold detail f_tagdate 408 15 75 15 Arial 8 normal detail location_name 580 15 75 15 Arial 8 bold detail f_percent 494 0 75 15 Arial 8 bold detail f_cntqty 60 0 225 15 Arial 8 bold detail item_number 665 0 80 15 Arial 8 bold detail f_amount 295 0 104 15 Arial 8 bold detail f_tagnumber 408 0 75 15 Arial 8 bold detail f_qoh 10 0 35 15 Arial 8 bold detail warehous_code 10 15 35 15 Arial 8 bold detail f_priority 60 15 225 15 Arial 8 bold detail item_descrip1 60 30 225 15 Arial 8 bold detail item_descrip2
    21 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/CountTagsByClassCode.xml000066400000000000000000000473701217451700100227320ustar00rootroot00000000000000 Count Tags By Class Code CountTagsByClassCode Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("classcode_id") ?> ( SELECT (classcode_code || '-' || classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) <? else ?> text('All Class Codes') <? endif ?> AS classcode, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT invcnt_id, invcnt_tagnumber, warehous_code, item_number, item_descrip1, item_descrip2, formatDate(invcnt_tagdate) AS createddate, invcnt_tag_username AS createdby, CASE WHEN (invcnt_cntdate IS NULL) THEN '' ELSE formatDate(invcnt_cntdate) END AS entereddate, CASE WHEN (invcnt_cntdate IS NULL) THEN '' ELSE invcnt_cnt_username END AS enteredby, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatDate(invcnt_postdate) END AS posteddate, CASE WHEN (NOT invcnt_posted) THEN '' ELSE invcnt_post_username END AS postedby, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatQty(invcnt_qoh_before) END AS qohbefore, CASE WHEN (invcnt_qoh_after IS NULL) THEN '' ELSE formatQty(invcnt_qoh_after) END AS qohafter, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatQty(invcnt_qoh_after - invcnt_qoh_before) END AS variance, CASE WHEN (NOT invcnt_posted) THEN '' WHEN (invcnt_qoh_before=0) THEN formatScrap(1) ELSE formatScrap((1 - (invcnt_qoh_after / invcnt_qoh_before)) * -1) END AS percentage FROM invcnt, itemsite, item, whsinfo WHERE ((invcnt_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (date(invcnt_tagdate) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if not exists("showUnposted") ?> AND (invcnt_posted) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>))) <? endif ?> ) ORDER BY invcnt_tagdate; 236 100 90 300 20 Arial 10 bold head classcode 500 110 200 20 Arial 10 bold head enddate 500 90 200 20 Arial 10 bold head startdate 100 110 200 20 Arial 10 bold head warehouse 5 229 745 229 2 6 66 5 60 745 60 2
    detail detail 66 60 15 225 15 Arial 8 bold detail item_descrip1 295 0 105 15 Arial 8 bold detail invcnt_tagnumber 409 45 75 15 Arial 8 bold detail qohbefore 409 0 75 15 Arial 8 bold detail createddate 5 60 745 60 0 580 15 75 15 Arial 8 bold detail postedby 495 15 75 15 Arial 8 bold detail enteredby 60 30 225 15 Arial 8 bold detail item_descrip2 580 45 75 15 Arial 8 bold detail variance 409 15 75 15 Arial 8 bold detail createdby 10 0 35 15 Arial 8 bold detail warehous_code 580 0 75 15 Arial 8 bold detail posteddate 60 0 225 15 Arial 8 bold detail item_number 665 45 75 15 Arial 8 bold detail percentage 495 45 75 15 Arial 8 bold detail qohafter 495 0 75 15 Arial 8 bold detail entereddate
    17 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CountTagsByItem.xml000066400000000000000000000431461217451700100217650ustar00rootroot00000000000000 Count Tags By Item CountTagsByItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT invcnt_tagnumber, warehous_code, formatDate(invcnt_tagdate) AS createddate, invcnt_tag_username AS createdby, CASE WHEN (invcnt_cntdate IS NULL) THEN '' ELSE formatDate(invcnt_cntdate) END AS entereddate, CASE WHEN (invcnt_cntdate IS NULL) THEN '' ELSE invcnt_cnt_username END AS enteredby, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatDate(invcnt_postdate) END AS posteddate, CASE WHEN (NOT invcnt_posted) THEN '' ELSE invcnt_post_username END AS postedby, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatQty(invcnt_qoh_before) END AS qohbefore, CASE WHEN (invcnt_qoh_after IS NULL) THEN '' ELSE formatQty(invcnt_qoh_after) END AS qohafter, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatQty(invcnt_qoh_after - invcnt_qoh_before) END AS variance, CASE WHEN (NOT invcnt_posted) THEN '' WHEN (invcnt_qoh_before=0) THEN formatScrap(1) ELSE formatScrap((1 - (invcnt_qoh_after / invcnt_qoh_before)) * -1) END AS percentage FROM invcnt, itemsite, whsinfo WHERE ((invcnt_itemsite_id=itemsite_id) AND (itemsite_warehous_id=warehous_id) AND (itemsite_item_id=<? value("item_id") ?>) AND (invcnt_tagdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if not exists("showUnposted") ?> AND (invcnt_posted) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY invcnt_tagdate; 236 515 80 200 20 Arial 10 bold head startdate 100 120 300 20 Arial 10 bold head item_descrip2 5 229 740 229 2 100 145 200 20 Arial 10 bold head warehouse 515 100 200 20 Arial 10 bold head enddate 100 80 200 20 Arial 10 bold head item_number 100 100 300 20 Arial 10 bold head item_descrip1 6 36 5 30 740 30 2
    detail detail 41 5 35 740 35 0 409 0 75 15 Arial 8 bold detail qohbefore 50 0 105 15 Arial 8 bold detail invcnt_tagnumber 245 15 75 15 Arial 8 bold detail enteredby 165 0 75 15 Arial 8 bold detail createddate 325 0 75 15 Arial 8 bold detail posteddate 495 0 75 15 Arial 8 bold detail qohafter 10 0 35 15 Arial 8 bold detail warehous_code 665 0 75 15 Arial 8 bold detail percentage 165 15 75 15 Arial 8 bold detail createdby 325 15 75 15 Arial 8 bold detail postedby 580 0 75 15 Arial 8 bold detail variance 245 0 75 15 Arial 8 bold detail entereddate
    16 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/CountTagsByWarehouse.xml000066400000000000000000000453741217451700100230360ustar00rootroot00000000000000 Count Tags By Site CountTagsByWarehouse With Barcoded Count Tag Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT invcnt_id, formatcounttagbarcode(invcnt_id) AS countag_barcode, invcnt_tagnumber, warehous_code, item_number, item_descrip1, item_descrip2, formatDate(invcnt_tagdate) AS createddate, invcnt_tag_username AS createdby, CASE WHEN (invcnt_cntdate IS NULL) THEN '' ELSE formatDate(invcnt_cntdate) END AS entereddate, CASE WHEN (invcnt_cntdate IS NULL) THEN '' ELSE invcnt_cnt_username END AS enteredby, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatDate(invcnt_postdate) END AS posteddate, CASE WHEN (NOT invcnt_posted) THEN '' ELSE invcnt_post_username END AS postedby, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatQty(invcnt_qoh_before) END AS qohbefore, CASE WHEN (invcnt_qoh_after IS NULL) THEN '' ELSE formatQty(invcnt_qoh_after) END AS qohafter, CASE WHEN (NOT invcnt_posted) THEN '' ELSE formatQty(invcnt_qoh_after - invcnt_qoh_before) END AS variance, CASE WHEN (NOT invcnt_posted) THEN '' WHEN ((invcnt_qoh_before = 0) AND (invcnt_qoh_after = 0)) THEN formatScrap(0) WHEN (invcnt_qoh_before=0) THEN formatScrap(1) ELSE formatScrap((1 - (invcnt_qoh_after / invcnt_qoh_before)) * -1) END AS percentage FROM invcnt, itemsite, item, whsinfo WHERE ((invcnt_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (DATE(invcnt_tagdate) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if not exists("showUnposted") ?> AND (invcnt_posted) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY invcnt_tagdate; 246 100 100 200 20 Arial 10 bold head warehouse 494 120 200 20 Arial 10 bold head enddate 494 100 200 20 Arial 10 bold head startdate 5 235 745 235 2 12 71 5 60 745 60 2
    detail detail 113 419 15 75 15 Arial 8 bold detail createdby 45 0 225 15 Arial 8 bold detail item_number 419 45 75 15 Arial 8 bold detail qohbefore 419 0 75 15 Arial 8 bold detail createddate 5 0 35 15 Arial 8 bold detail warehous_code 5 40 225 15 Arial 8 bold detail item_descrip2 590 45 75 15 Arial 8 bold detail variance 300 70 370 30 128 12 detail countag_barcode 505 45 75 15 Arial 8 bold detail qohafter 295 0 104 15 Arial 8 bold detail invcnt_tagnumber 15 105 750 105 0 505 0 75 15 Arial 8 bold detail entereddate 590 0 75 15 Arial 8 bold detail posteddate 675 45 75 15 Arial 8 bold detail percentage 505 15 75 15 Arial 8 bold detail enteredby 590 15 75 15 Arial 8 bold detail postedby 5 25 225 15 Arial 8 bold detail item_descrip1
    24 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CreditMemo.xml000066400000000000000000000546211217451700100207740ustar00rootroot00000000000000 Credit Memo CreditMemo Sales Module Credit Memo with Logo and CM Currency select cmhead_id, cmhead_number from cmhead; Letter 28 28 0 0 GroupHead SELECT remitto.*, cmhead_number, formatDate(cmhead_docdate) AS docdate, cust_number, cust_name, formatAddr(cmhead_billtoaddress1, cmhead_billtoaddress2, cmhead_billtoaddress3, COALESCE(cmhead_billtocity,'') || ' ' || COALESCE(cmhead_billtostate,'') || ' ' || COALESCE(cmhead_billtozip,''), cmhead_billtocountry) AS f_custaddr, cntct_phone AS cust_phone, cmhead_shipto_name, formatAddr(cmhead_shipto_address1, cmhead_shipto_address2, cmhead_shipto_address3, COALESCE(cmhead_shipto_city,'') ||' '|| COALESCE(cmhead_shipto_state,'') || ' '|| COALESCE(cmhead_shipto_zipcode,''), cmhead_shipto_country) AS f_shiptoaddr, CASE WHEN (cmhead_invcnumber='-1') THEN '' --note: must now set explicit type for Postgres 8.3+ --add ' ' ELSE text(cmhead_invcnumber) END AS invcnumber, cmhead_custponumber, cmhead_comments, cmhead_misc_descrip, curr_symbol, curr_name FROM remitto, cmhead, curr_symbol, custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) WHERE ((cmhead_cust_id=cust_id) AND (cmhead_curr_id = curr_id) AND (cmhead_id=<? value("cmhead_id") ?>)) ORDER BY cmhead_number; Detail SELECT cmitem_linenumber, formatQty(cmitem_qtycredit) AS qtycredit, formatQty(cmitem_qtyreturned) AS qtyreturned, uom_name, item_number, item_descrip1, item_descrip2, formatSalesPrice(cmitem_unitprice) AS unitprice, formatMoney((cmitem_qtycredit * cmitem_qty_invuomratio) * (cmitem_unitprice / cmitem_price_invuomratio)) AS extprice, cmitem_comments FROM cmitem, itemsite, item, uom WHERE ((cmitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (cmitem_cmhead_id=<? value("cmhead_id") ?>)) ORDER BY cmitem_linenumber; GroupFoot SELECT formatExtPrice(SUM((cmitem_qtycredit * cmitem_qty_invuomratio) * cmitem_unitprice / cmitem_price_invuomratio)) AS extprice FROM cmhead, cmitem, itemsite, item WHERE ((cmitem_cmhead_id=cmhead_id) AND (cmitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (cmhead_id=<? value("cmhead_id") ?>)); GroupExtended SELECT formatExtPrice( COALESCE(cmhead_freight,0.0) + ( SELECT COALESCE(SUM(tax * -1.0), 0) FROM ( SELECT ROUND(SUM(taxdetail_tax), 2) AS tax FROM tax JOIN calculateTaxDetailSummary('CM', cmhead_id, 'T') ON (taxdetail_tax_id=tax_id) GROUP BY tax_id ) AS data ) + COALESCE(cmhead_misc,0.0) + ( SELECT COALESCE(SUM((cmitem_qtycredit * cmitem_qty_invuomratio) * cmitem_unitprice / cmitem_price_invuomratio), 0.0) FROM cmitem WHERE (cmitem_cmhead_id=<? value("cmhead_id") ?>) ) ) AS totaldue, formatExtPrice(COALESCE(cmhead_freight,0.0)) AS freight, ( SELECT formatExtPrice(COALESCE(SUM(tax * -1.0), 0)) FROM ( SELECT ROUND(SUM(taxdetail_tax), 2) AS tax FROM tax JOIN calculateTaxDetailSummary('CM', cmhead_id, 'T') ON (taxdetail_tax_id=tax_id) GROUP BY tax_id ) AS data ) AS tax, formatExtPrice(COALESCE(cmhead_misc,0.0)) AS misc FROM cmhead WHERE (cmhead_id=<? value("cmhead_id") ?>); logo SELECT image_data FROM image WHERE ((image_name='logo')); 451 50 370 120 20 helvetica 12 normal GroupHead cmhead_custponumber 660 130 135 20 Helvetica 10 normal GroupHead docdate 50 340 800 340 2 660 110 145 20 Helvetica 10 normal GroupHead cmhead_number 100 205 290 20 Helvetica 12 normal GroupHead cust_name 50 445 800 445 2 390 370 50 20 helvetica 12 normal GroupHead curr_symbol 50 80 260 20 helvetica 10 normal GroupHead remitto_country 100 225 315 15 10 Arial 10 normal GroupHead f_custaddr 185 370 230 20 helvetica 12 normal GroupHead docdate 485 205 300 20 Helvetica 12 normal GroupHead cmhead_shipto_name 444 370 110 20 helvetica 12 normal GroupHead curr_name 50 95 200 20 helvetica 10 normal GroupHead remitto_phone 50 50 200 20 helvetica 10 normal GroupHead remitto_address1 485 225 315 15 10 Arial 10 normal GroupHead f_shiptoaddr 270 0 355 111 stretch logo image_data 660 150 180 20 Helvetica 10 normal GroupHead cust_number 50 30 200 20 Helvetica 10 bold GroupHead remitto_name 50 65 260 20 helvetica 10 normal GroupHead remitto_citystatezip 660 170 150 20 Helvetica 10 normal GroupHead invcnumber
    detail Detail 82 160 55 600 17 14 helvetica 10 normal Detail cmitem_comments 670 5 100 20 helvetica 10 normal Detail extprice 50 25 120 20 helvetica 10 normal Detail qtycredit 260 5 300 20 helvetica 10 normal Detail item_number 175 5 80 20 helvetica 10 normal Detail uom_name 260 25 300 15 helvetica 8 normal Detail item_descrip1 520 5 100 20 helvetica 10 normal Detail unitprice 260 40 300 15 helvetica 8 normal Detail item_descrip2 50 5 120 20 helvetica 10 normal Detail qtyreturned
    144 670 5 100 20 helvetica 10 normal GroupFoot extprice 60 55 515 17 14 helvetica 10 normal GroupHead cmhead_comments 670 65 100 20 helvetica 10 normal GroupExtended tax 670 25 100 20 helvetica 10 normal GroupExtended misc 670 45 100 20 helvetica 10 normal GroupExtended freight 670 85 100 20 helvetica 10 normal GroupExtended totaldue 60 25 525 20 helvetica 10 normal GroupHead cmhead_misc_descrip
    qt-client-4.1.0/share/reports/CreditMemoEditList.xml000066400000000000000000000267301217451700100224360ustar00rootroot00000000000000 Credit Memo Edit List CreditMemoEditList Letter 50 50 50 50 detail SELECT orderid, itemid, documentnumber, CASE WHEN(documentnumber='') THEN item ELSE cust_number END AS name, CASE WHEN(documentnumber='') THEN itemdescrip ELSE billtoname END AS descrip, ordernumber, linenumber, iteminvuom, qtytobill, price, extprice, sence, account FROM creditMemoEditList ORDER BY ordernumber, linenumber; 136 5 130 745 130 2 7 36 5 30 745 30 2
    detail detail 31 340 15 240 15 Arial 8 bold detail sence 75 15 254 15 Arial 8 bold detail descrip 670 0 75 15 Arial 8 bold detail extprice 590 0 75 15 Arial 8 bold detail price 90 0 80 15 Arial 8 bold detail ordernumber 285 0 50 15 Arial 8 bold detail iteminvuom 180 0 100 15 Arial 8 bold detail name 590 15 75 15 Arial 8 bold detail qtytobill 340 0 240 15 Arial 8 bold detail account 685 15 40 15 Arial 8 bold detail shiptostate 5 0 70 15 Arial 8 bold detail documentnumber
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CurrencyConversionList.xml000066400000000000000000000153771217451700100234450ustar00rootroot00000000000000 Currency Exchange Rates CurrencyConversionList Letter 100 100 100 100 exchangeRates currencyConversions detail baseCurrency SELECT curr_name, currConcat(curr_id) AS currConcat FROM curr_symbol WHERE curr_base = TRUE; knownCurrencies SELECT curr_name, currConcat(curr_id) AS currConcat, curr_base FROM curr_symbol WHERE curr_base = FALSE ORDER BY currConcat; 113 0 60 151 15 Arial 10 normal baseCurrency curr_name 150 60 116 15 Arial 10 normal baseCurrency currConcat
    Known Currencies Known curr_base 61 0 50 407 50 2 knownCurrencies 21 150 0 126 15 Arial 10 normal knownCurrencies currConcat 0 0 150 15 Arial 10 normal knownCurrencies curr_name
    Exchange Rates By Currency currConcat 21 409 10 5 10 0 exchangeRates 21 0 0 96 15 Arial 10 normal exchangeRates f_curr 330 0 80 15 Arial 10 normal exchangeRates curr_expires 90 0 120 15 Arial 10 normal exchangeRates rate 230 0 90 15 Arial 10 normal exchangeRates curr_effective
    31 100 10 120 15 Arial 10 normal Context Query report_date
    qt-client-4.1.0/share/reports/CustOrdAcknowledgement.xml000066400000000000000000000551161217451700100233570ustar00rootroot00000000000000 Customer Order Acknowledgement CustOrderAcknowledgement Customer Order Acknowledgement 0.05 0.05 Letter 25 25 25 25 head <? if not exists("shiphead_id") ?> --Run query if no shiphead_id passed - No Shipment Pack List SELECT cust_number, formatsobarcode(cohead_id) AS order_barcode, formataddr(addr_line1, addr_line2, addr_line3, (addr_city || ' ' || addr_state || ' ' || addr_postalcode), addr_country) AS corr_address, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cohead_fob, cohead_billtoname, cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode) AS billtocitystatezip, cntct_phone AS cust_phone, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_number, cohead_shipvia, cohead_shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments, terms_descrip FROM cohead JOIN custinfo ON (cohead_cust_id=cust_id) JOIN terms ON (cohead_terms_id=terms_id) LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE (cohead_id=<? value("sohead_id") ?>); ------------------- <? else ?> --Run New Query for Header with shipment number ----------------------------------------------- SELECT shiphead_number, cohead_number, formatsobarcode(cohead_id) AS order_barcode, cohead_shipvia, cohead_shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments, cohead_billtoname, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, cohead_shiptoname, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, cust_number, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cntct_phone AS cust_phone, cohead_shipchrg_id, shipchrg_descrip, terms_descrip FROM shiphead JOIN cohead ON (cohead_id=shiphead_order_id) JOIN custinfo ON (cohead_cust_id=cust_id) JOIN terms ON (cohead_terms_id=terms_id) JOIN shipchrg ON (cohead_shipchrg_id = shipchrg_id) LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE (shiphead_id=<? value("shiphead_id") ?>); <? endif ?> scheddate <? if not exists("shiphead_id") ?> --Query without shipment number SELECT formatDate(MIN(coitem_scheddate)) AS scheddate FROM coitem WHERE ((coitem_status <> 'X') AND (coitem_cohead_id=<? value("sohead_id") ?>)); -- <? else ?> -------------------------- SELECT formatDate(MIN(coitem_scheddate)) AS scheddate FROM coitem, shipitem WHERE ((coitem_status <> 'X') AND (coitem_id=shipitem_orderitem_id) AND (shipitem_shiphead_id=<? value("shiphead_id") ?>)); <? endif ?> detail salesOrderItems list logo SELECT image_data FROM image WHERE ((image_name='logo')); footer SELECT formatMoney(calcSalesOrderAmt(cohead_id, 'S')) AS f_subtotal, formatMoney(calcSalesOrderAmt(cohead_id, 'T')) AS f_total, formatMoney(calcSalesOrderAmt(cohead_id, 'B')) AS f_balance, formatMoney(calcSalesOrderAmt(cohead_id, 'X')) AS f_tax, formatMoney(calcSalesOrderAmt(cohead_id, 'C')) AS f_credit, formatMoney(cohead_freight) AS f_freight, formatMoney(cohead_misc) AS f_misc FROM cohead WHERE (cohead_id=<? value("sohead_id") ?>) ; lastupdated SELECT formatDate(MAX(lastupdated)) AS f_lastupdated FROM (SELECT cohead_lastupdated AS lastupdated FROM cohead WHERE (cohead_id=<? value("sohead_id") ?>) UNION SELECT coitem_lastupdated AS lastupdated FROM coitem WHERE (coitem_cohead_id=<? value("sohead_id") ?>) ) AS data; 426 6 7 426 115 stretch logo image_data 210 330 330 330 0 40 335 145 20 Arial 10 normal head cohead_custponumber 539 39 250 25 Times New Roman 20 bold head cohead_number 470 330 647 330 0 200 335 165 20 Arial 10 normal head terms_descrip 45 330 177 330 0 355 335 80 20 Arial 10 normal scheddate scheddate 15 415 785 415 2 360 330 440 330 0 622 70 110 20 Arial 12 normal head orderdate 269.976 160.037 491.976 160.037 0 535.987 170.037 254.338 20 Arial 11 normal head cohead_shiptoname 455 335 195 20 Arial 10 normal head cohead_shipvia 655 335 95 16 Arial 10 normal head cohead_fob 270.976 191.037 256 22.2821 10 Arial 11 normal head billing_address 535.987 190.037 253.562 20.2425 10 Arial 11 normal head shipping_address 670 330 750 330 0 271.976 170.037 256 20 Arial 11 normal head cohead_billtoname 535.987 160.037 766.987 160.037 0 17.6809 192.59 222 21.011 10 Arial 11 normal head billing_address 17.6809 171.59 213 20 Arial 11 normal head cohead_billtoname 15.8119 162.124 224.257 162.137 0
    detail detail groupby 36 37 7 707 21 14 Arial 12 normal head cohead_shipcomments lineitem coitem_linenumber 6 detail 41 15 0 85 20 Arial 9 normal detail item_number_cust 600 5 27 17 Arial 9 normal detail qty_uom 515 0 65 20 Arial 9 normal detail f_balance 640 3 56 16 Arial 9 normal detail f_price 125 25 435 12 14 Arial 8 normal detail coitem_memo 705 3 82 17 Arial 9 normal detail f_extprice 435 0 65 20 Arial 9 normal detail f_qtyord 102 0 325 20 Arial 9 normal detail item_descrip1_cust
    233 635 28 97 16 Arial 10 normal footer f_freight 635 48 97 17 Arial 10 normal footer f_misc 605 138 172 32 Arial 16 bold footer f_balance 640 8 92 17 Arial 10 normal footer f_subtotal 635 68 97 17 Arial 10 normal footer f_tax 630 88 102 17 Arial 10 normal footer f_total 630 108 102 17 Arial 10 normal footer f_credit 28
    qt-client-4.1.0/share/reports/CustomerARHistory.xml000066400000000000000000000244251217451700100223510ustar00rootroot00000000000000 Customer A/R History CustomerARHistory Letter 50 50 50 50 head SELECT cust_name, formatDate(date(<? value("startDate") ?>)) AS startDate, formatDate(date(<? value("endDate") ?>)) AS endDate FROM custinfo WHERE (cust_id=<? value("cust_id") ?>); detail arHistory detail 156 550 85 100 20 Arial 10 bold head endDate 550 65 100 20 Arial 10 bold head startDate 135 65 300 20 Arial 10 bold head cust_name 5 150 745 150 2 6 21 5 15 745 15 2
    detail detail 16 540 0 100 15 Arial 8 bold detail amount extprice 645 0 100 15 Arial 8 bold detail balance extprice 349 0 90 15 Arial 8 bold detail f_docdate 444 0 90 15 Arial 8 bold detail f_duedate 5 0 60 15 Arial 8 bold detail f_open 175 0 170 15 Arial 8 bold detail docnumber 70 0 100 15 Arial 8 bold detail documenttype
    16 705 0 40 15 Arial 8 bold Context Query page_number 104 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/CustomerBOL.xml000066400000000000000000000405501217451700100210760ustar00rootroot00000000000000 Drop Ship Bill of Lading CustomerBOL 850 1100 0 50 0 0 head SELECT shiphead_shipvia, formatDate(shiphead_shipdate) AS shipdate, cust_name, ca.addr_line1 AS cust_address1, ca.addr_line2 AS cust_address2, (ca.addr_city || ' ' || ca.addr_state || ' ' || ca.addr_postalcode) AS custcitystatezip, cust_number, cohead_number, cohead_fob, cohead_custponumber, warehous_descrip, wa.addr_line1 AS warehous_addr1, wa.addr_line2 AS warehous_addr2, wa.addr_line3 AS warehous_addr3, wa.addr_city AS warehous_addr4, warehous_fob, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_shiptophone FROM shiphead, cohead, whsinfo, custinfo LEFT OUTER JOIN addr ca ON (cntct_addr_id=ca.addr_id) LEFT OUTER JOIN addr wa ON (warehous_addr_id=wa.addr_id); WHERE ((shiphead_order_id=cohead_id) AND (cohead_cust_id=cust_id) AND (cohead_warehous_id=warehous_id) AND (shiphead_id=%1)); detail SELECT coitem_linenumber, formatQty(SUM(shipitem_qty)) AS invqty, uom_name, roundUp(SUM(shipitem_qty) / itemuomratiobytype(item_id, 'Selling'))::integer AS shipqty, itemsellinguom(item_id) AS shipuom, item_number, item_descrip1, item_descrip2, formatQty(SUM(shipitem_qty) * item_prodweight) AS netweight, formatQty(SUM(shipitem_qty) * (item_prodweight + item_packweight)) AS grossweight FROM shipitem, coitem, itemsite, item, uom WHERE ((shipitem_orderitem_id=coitem_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (shipitem_shiphead_id=%1)) GROUP BY coitem_linenumber, item_number, uom_name, shipuom item_descrip1, item_descrip2, item_prodweight, item_packweight ORDER BY coitem_linenumber; foot SELECT formatQty(SUM(shipitem_qty * item_prodweight)) AS netweight, formatQty(SUM(shipitem_qty * (item_prodweight + item_packweight))) AS grossweight, CASE WHEN ('%3' = 'C') THEN 'X' ELSE ' ' END AS collectflag, CASE WHEN ('%3' = 'C') THEN 'Therm-O-Rock East, Inc.' ELSE ' ' END AS section7, CASE WHEN ('%3' = 'C') THEN cust_name ELSE ' ' END AS collect_name, CASE WHEN ('%3' = 'C') THEN addr_line1 ELSE ' ' END AS collect_address1, CASE WHEN ('%3' = 'C') THEN addr_line2 ELSE ' ' END AS collect_address2, CASE WHEN ('%3' = 'C') THEN (addr_city || ' ' || addr_state || ' ' || addr_postalcode) ELSE ' ' END AS collect_address3 FROM shipitem, cohead, custinfo, coitem, itemsite, item LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE ((shipitem_orderitem_id=coitem_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (coitem_cohead_id=cohead_id) AND (cohead_cust_id=cust_id) AND (shipitem_shiphead_id=%1)) GROUP BY cust_name, addr_line1, addr_line2, addr_city, addr_state, addr_postalcode; notes SELECT shiphead_notes FROM shiphead WHERE (shiphead_id=%1); 318 532 224 300 20 Arial 10 normal head shiptocitystatezip 532 205 200 20 Arial 10 normal head cohead_shiptoaddress3 93 168 200 20 Arial 10 normal head warehous_addr2 93 205 200 20 Arial 10 normal head warehous_addr4 532 168 200 20 Arial 10 normal head cohead_shiptoaddress1 93 149 200 20 Arial 10 normal head cust_name 532 149 200 20 Arial 10 normal head cohead_shiptoname 532 242 300 20 Arial 10 normal head cohead_shiptophone 578 65 100 20 Arial 10 normal head shipdate 93 186 200 20 Arial 10 normal head warehous_addr3 121 65 200 20 Arial 10 normal head shiphead_shipvia 532 186 200 20 Arial 10 normal head cohead_shiptoaddress2
    detail detail coitem_linenumber 54 200 40 300 14 Arial 8 normal detail item_descrip2 94 5 80 20 Arial 10 normal detail shipuom 10 30 80 20 Arial 10 normal detail invqty 200 25 300 14 Arial 8 normal detail item_descrip1 94 30 80 20 Arial 10 normal detail uom_name 10 5 80 20 Arial 10 normal detail shipqty 520 5 100 20 Arial 10 normal detail netweight 200 5 300 20 Arial 10 normal detail item_number 520 25 100 20 Arial 10 normal detail grossweight
    346 614 80 200 20 Arial 10 normal head cust_number 230 200 200 20 Arial 10 normal foot collect_address3 20 180 200 20 Arial 10 normal foot collect_name 520 5 100 20 Arial 10 normal foot netweight 50 10 400 100 Arial 10 normal notes shiphead_notes 614 120 100 20 Arial 10 normal head cohead_custponumber 20 200 200 20 Arial 10 normal foot collect_address1 438 270 200 20 Arial 10 normal foot section7 520 25 100 20 Arial 10 normal foot grossweight 614 60 200 20 Arial 10 normal head cohead_fob 230 180 200 20 Arial 10 normal foot collect_address2 728 270 46 20 Arial 10 normal foot collectflag 614 100 100 20 Arial 10 normal head cohead_number
    qt-client-4.1.0/share/reports/CustomerInformation.xml000066400000000000000000000755561217451700100227650ustar00rootroot00000000000000 Customer Information CustomerInformation Letter 50 50 50 50 head SELECT cust_name, cust_number, ba.addr_line1 AS cust_address1, ba.addr_line2 AS cust_address2, ba.addr_line3 AS cust_address3, ba.addr_city AS cust_city, ba.addr_state AS cust_state, ba.addr_postalcode AS cust_zipcode, (ba.addr_city || ', ' || ba.addr_state || ' ' || ba.addr_postalcode) AS citystatezip, trim(bc.cntct_first_name || ' ' || bc.cntct_last_name) AS cust_contact, bc.cntct_phone AS cust_phone, bc.cntct_fax AS cust_fax, bc.cntct_email AS cust_email, ca.addr_line1 AS cust_corraddress1, ca.addr_line2 AS cust_corraddress2, ca.addr_line3 AS cust_corraddress3, ca.addr_city AS cust_corrcity, ca.addr_state AS cust_corrstate, ca.addr_postalcode AS cust_corrzipcode, (ca.addr_city || ', ' || ca.addr_state || ' ' || ca.addr_postalcode) AS corrcitystatezip, trim(cc.cntct_first_name || ' ' || cc.cntct_last_name) AS cust_corrcontact, cc.cntct_phone AS cust_corrphone, cc.cntct_fax AS cust_corrfax, cc.cntct_email AS cust_corremail, CASE WHEN (cust_creditstatus='G') THEN 'In Good Standing' WHEN (cust_creditstatus='W') THEN 'On Credit Warning' WHEN (cust_creditstatus='H') THEN 'On Credit Hold' ELSE ('Unknown Status: ' || cust_creditstatus) END AS f_creditstatus, cust_comments FROM custinfo LEFT OUTER JOIN cntct cc ON (cust_corrcntct_id=cc.cntct_id) LEFT OUTER JOIN addr ca ON (cc.cntct_addr_id=ca.addr_id) LEFT OUTER JOIN cntct bc ON (cust_cntct_id=bc.cntct_id) LEFT OUTER JOIN addr ba ON (bc.cntct_addr_id=ba.addr_id) WHERE (cust_id=<? value("cust_id") ?>); firstlastorderdate SELECT formatDate(MIN(cohist_invcdate)) AS firstdate, formatDate(MAX(cohist_invcdate)) AS lastdate FROM cohist WHERE (cohist_cust_id=<? value("cust_id") ?>); lysales SELECT formatMoney(COALESCE(SUM(round(cohist_qtyshipped * cohist_unitprice,2)), 0)) AS lysales FROM cohist WHERE ( (cohist_invcdate BETWEEN (DATE_TRUNC('year', CURRENT_TIMESTAMP) - INTERVAL '1 year') AND (DATE_TRUNC('year', CURRENT_TIMESTAMP) - INTERVAL '1 day')) AND (cohist_cust_id=<? value("cust_id") ?>) ); ytdsales SELECT formatExtPrice(SUM(round(cohist_qtyshipped * cohist_unitprice,2))) AS ytdsales FROM cohist WHERE ((cohist_invcdate>=DATE_TRUNC('year', CURRENT_TIMESTAMP)) AND (cohist_cust_id=<? value("cust_id") ?>) ); backlog SELECT formatMoney( COALESCE( SUM( (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio) ), 0 ) ) AS backlog FROM cohead, coitem, itemsite, item WHERE ( (coitem_cohead_id=cohead_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (coitem_status='O') AND (cohead_cust_id=<? value("cust_id") ?>) ); OpenBalance SELECT formatMoney( COALESCE( SUM( CASE WHEN (aropen_doctype IN ('I', 'D')) THEN (aropen_amount - aropen_paid) ELSE ((aropen_amount - aropen_paid) * -1) END ), 0 ) ) AS f_balance FROM aropen WHERE ( (aropen_open) AND (aropen_cust_id=<? value("cust_id") ?>) ); LateBalance SELECT formatMoney( noNeg( COALESCE( SUM( CASE WHEN (aropen_doctype IN ('I', 'D')) THEN (aropen_amount - aropen_paid) ELSE ((aropen_amount - aropen_paid) * -1) END ), 0 ) ) ) AS f_balance FROM aropen WHERE ( (aropen_open) AND (aropen_duedate < CURRENT_DATE) AND (aropen_cust_id=<? value("cust_id") ?>) ); Comments SELECT comment_source_id AS cust_id, comment_id, formatDate(comment_date) AS f_date, comment_user, comment_text FROM comment WHERE ( (comment_source='C') AND (comment_source_id=<? value("cust_id") ?>) ) ORDER BY comment_date; History SELECT aropen_cust_id AS cust_id, aropen_id AS aropenid, -1 AS applyid, aropen_docnumber AS sortnumber, aropen_docnumber AS docnumber, formatBoolYN(aropen_open) AS f_open, CASE WHEN (aropen_doctype='I') THEN text('Invoice') WHEN (aropen_doctype='C') THEN text('C/M') WHEN (aropen_doctype='D') THEN text('D/M') WHEN (aropen_doctype='R') THEN text('C/D') ELSE text('Other') END AS documenttype, formatDate(aropen_docdate) AS f_docdate, formatDate(aropen_duedate) AS f_duedate, formatMoney(aropen_amount) AS f_amount, formatMoney((aropen_amount - aropen_paid)) AS f_balance FROM aropen WHERE (aropen_cust_id=<? value("cust_id") ?>) UNION SELECT aropen_cust_id AS cust_id, -1 AS aropenid, arapply_source_aropen_id AS applyid, aropen_docnumber AS sortnumber, CASE WHEN (arapply_source_doctype='C') THEN arapply_source_docnumber WHEN (arapply_source_doctype='K') THEN arapply_refnumber ELSE :error END AS docnumber, '' AS f_open, CASE WHEN (arapply_source_doctype='C') THEN text('C/M') WHEN (arapply_fundstype='C') THEN text('Check') WHEN (arapply_fundstype='T') THEN text('Certified Check') WHEN (arapply_fundstype='M') THEN text('Master Card') WHEN (arapply_fundstype='V') THEN text('Visa') WHEN (arapply_fundstype='A') THEN text('American Express') WHEN (arapply_fundstype='D') THEN text('Discover Card') WHEN (arapply_fundstype='R') THEN text('Other Credit Card') WHEN (arapply_fundstype='K') THEN text('Cash') WHEN (arapply_fundstype='W') THEN text('Wire Transfer') WHEN (arapply_fundstype='O') THEN text('Other') END AS documenttype, formatDate(arapply_postdate) AS f_docdate, '' AS f_duedate, formatMoney(arapply_applied) AS f_amount, '' AS f_balance FROM arapply, aropen WHERE ( (arapply_target_doctype IN ('I', 'D')) AND (arapply_target_doctype=aropen_doctype) AND (arapply_target_docnumber=aropen_docnumber) AND (arapply_cust_id=<? value("cust_id") ?>) AND (aropen_cust_id=<? value("cust_id") ?>) ) UNION SELECT aropen_cust_id AS cust_id, -1 AS aropenid, arapply_target_aropen_id AS applyid, aropen_docnumber AS sortnumber, arapply_target_docnumber AS docnumber, '' AS f_open, CASE WHEN (arapply_target_doctype='I') THEN text('Invoice') WHEN (arapply_target_doctype='D') THEN text('D/M') ELSE text('Other') END AS documenttype, formatDate(arapply_postdate) AS f_docdate, '' AS f_duedate, formatMoney(arapply_applied) AS f_amount, '' AS f_balance FROM arapply, aropen WHERE ( (arapply_source_doctype IN ('K', 'C')) AND (arapply_source_doctype=aropen_doctype) AND (arapply_source_docnumber=aropen_docnumber) AND (arapply_cust_id=<? value("cust_id") ?>) AND (aropen_cust_id=<? value("cust_id") ?>) ) ORDER BY sortnumber, applyid; 392 105 365 575 15 0 Arial 8 bold head cust_comments 105 305 100 15 Arial 8 bold firstlastorderdate firstdate 370 160 370 295 0 5 155 360 155 0 100 229 260 15 Arial 8 bold head cust_corrcontact 385 160 350 15 Arial 8 bold head cust_address1 100 260 260 15 Arial 8 bold head cust_corrfax 385 175 350 15 Arial 8 bold head cust_address2 10 204 350 15 Arial 8 bold head corrcitystatezip 475 229 260 15 Arial 8 bold head cust_contact 385 190 350 15 Arial 8 bold head cust_address3 600 345 140 15 Arial 8 bold head f_creditstatus 5 295 740 295 2 340 305 145 15 Arial 8 bold lysales lysales 600 325 140 15 Arial 8 bold LateBalance f_balance 475 275 260 15 Arial 8 bold head cust_email 100 275 260 15 Arial 8 bold head cust_corremail 475 260 260 15 Arial 8 bold head cust_fax 100 75 295 20 Arial 10 bold head cust_name 10 190 350 15 Arial 8 bold head cust_corraddress3 340 325 145 15 Arial 8 bold ytdsales ytdsales 475 245 260 15 Arial 8 bold head cust_phone 380 155 735 155 0 10 160 350 15 Arial 8 bold head cust_corraddress1 340 345 145 15 Arial 8 bold backlog backlog 10 175 350 15 Arial 8 bold head cust_corraddress2 100 245 260 15 Arial 8 bold head cust_corrphone 105 325 100 15 Arial 8 bold firstlastorderdate lastdate 600 305 140 15 Arial 8 bold OpenBalance f_balance 100 95 200 20 Arial 10 bold head cust_number 385 204 350 15 Arial 8 bold head citystatezip
    Comments Head cust_id 46 55 40 745 40 0 Comments 16 260 0 484 15 5 Arial 8 bold Comments comment_text 60 0 95 15 Arial 8 bold Comments f_date 160 0 95 15 Arial 8 bold Comments comment_user
    History Head cust_id 46 55 40 745 40 0 History 16 60 0 65 15 Arial 8 bold History f_open 290 0 85 15 Arial 8 bold History f_docdate 210 0 75 15 Arial 8 bold History docnumber 380 0 85 15 Arial 8 bold History f_duedate 470 0 85 15 Arial 8 bold History f_amount 130 0 75 15 Arial 8 bold History documenttype 560 0 85 15 Arial 8 bold History f_balance
    18 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/CustomerTypesMasterList.xml000066400000000000000000000101241217451700100235700ustar00rootroot00000000000000 Customer Types Master List CustomerTypesMasterList Letter 50 50 50 50 detail select custtype_code, custtype_descrip from custtype order by custtype_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 175 0 565 15 Arial 8 bold detail custtype_descrip 10 0 150 15 Arial 8 bold detail custtype_code
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/Customers.xml000066400000000000000000000422311217451700100207220ustar00rootroot00000000000000 Customers Customers 0.05 0.05 Letter 50 50 50 50 detail -- Group: customers -- Name: detail -- Notes: SELECT DISTINCT ON ( cust_number ) cust_id, cust_custtype_id, formatBoolYN(cust_active) as f_active, formatAddr(bill_addr.addr_id) AS f_bill_addr, formatAddr(corr_addr.addr_id) AS f_corr_addr, bill_cntct.cntct_name AS bill_cntct_name, corr_cntct.cntct_name AS corr_cntct_name, cust_active, cust_number, cust_name, custtype_code, bill_cntct.cntct_first_name AS bill_first_name, bill_cntct.cntct_last_name AS bill_last_name, bill_cntct.cntct_phone AS bill_phone, bill_cntct.cntct_fax AS bill_fax, bill_cntct.cntct_email AS bill_email, bill_addr.addr_line1 AS bill_line1, bill_addr.addr_line2 AS bill_line2, bill_addr.addr_line3 AS bill_line3, bill_addr.addr_city AS bill_city, bill_addr.addr_state AS bill_state, bill_addr.addr_postalcode AS bill_postalcode, bill_addr.addr_country AS bill_country, corr_cntct.cntct_first_name AS corr_first_name, corr_cntct.cntct_last_name AS corr_last_name, corr_cntct.cntct_phone AS corr_phone, corr_cntct.cntct_fax AS corr_fax, corr_cntct.cntct_email AS corr_email, corr_addr.addr_line1 AS corr_line1, corr_addr.addr_line2 AS corr_line2, corr_addr.addr_line3 AS corr_line3, corr_addr.addr_city AS corr_city, corr_addr.addr_state AS corr_state, corr_addr.addr_postalcode AS corr_postalcode, corr_addr.addr_country AS corr_country <? foreach("char_id_list") ?> , charass_alias<? literal("char_id_list") ?>.charass_value AS char<? literal("char_id_list") ?> <? endforeach ?> FROM custinfo JOIN custtype ON (cust_custtype_id=custtype_id) LEFT OUTER JOIN cntct bill_cntct ON (cust_cntct_id=bill_cntct.cntct_id) LEFT OUTER JOIN addr bill_addr ON (bill_cntct.cntct_addr_id=bill_addr.addr_id) LEFT OUTER JOIN cntct corr_cntct ON (cust_corrcntct_id=corr_cntct.cntct_id) LEFT OUTER JOIN addr corr_addr ON (corr_cntct.cntct_addr_id=corr_addr.addr_id) <? foreach("char_id_text_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_text_list") ?> ON ((charass_alias<? literal("char_id_text_list") ?>.charass_target_type='C') AND (charass_alias<? literal("char_id_text_list") ?>.charass_target_id=cust_id) AND (charass_alias<? literal("char_id_text_list") ?>.charass_char_id=<? value("char_id_text_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_text_list") ?> ON (charass_alias<? literal("char_id_text_list") ?>.charass_char_id=char_alias<? literal("char_id_text_list") ?>.char_id) <? endforeach ?> <? foreach("char_id_list_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_list_list") ?> ON ((charass_alias<? literal("char_id_list_list") ?>.charass_target_type='C') AND (charass_alias<? literal("char_id_list_list") ?>.charass_target_id=cust_id) AND (charass_alias<? literal("char_id_list_list") ?>.charass_char_id=<? value("char_id_list_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_list_list") ?> ON (charass_alias<? literal("char_id_list_list") ?>.charass_char_id=char_alias<? literal("char_id_list_list") ?>.char_id) <? endforeach ?> <? foreach("char_id_date_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_date_list") ?> ON ((charass_alias<? literal("char_id_date_list") ?>.charass_target_type='C') AND (charass_alias<? literal("char_id_date_list") ?>.charass_target_id=cust_id) AND (charass_alias<? literal("char_id_date_list") ?>.charass_char_id=<? value("char_id_date_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_date_list") ?> ON (charass_alias<? literal("char_id_date_list") ?>.charass_char_id=char_alias<? literal("char_id_date_list") ?>.char_id) <? endforeach ?> WHERE true <? if not exists("showInactive") ?> AND cust_active <? endif ?> <? if exists("search_pattern") ?> AND ((cust_number ~* <? value("search_pattern") ?>) OR (cust_name ~* <? value("search_pattern") ?>) OR (custtype_code ~* <? value("search_pattern") ?>) OR (COALESCE(bill_cntct.cntct_first_name || ' ' || bill_cntct.cntct_last_name,'') ~* <? value("search_pattern") ?>) OR (COALESCE(bill_cntct.cntct_phone || ' ' || bill_cntct.cntct_phone2 || ' ' || bill_cntct.cntct_fax, '') ~* <? value("search_pattern") ?>) OR (COALESCE(bill_cntct.cntct_email, '') ~* <? value("search_pattern") ?>) OR (COALESCE(bill_addr.addr_line1 || ' ' || bill_addr.addr_line2 || ' ' || bill_addr.addr_line3,'') ~* <? value("search_pattern") ?>) OR (COALESCE(bill_addr.addr_city,'') ~* <? value("search_pattern") ?>) OR (COALESCE(bill_addr.addr_state,'') ~* <? value("search_pattern") ?>) OR (COALESCE(bill_addr.addr_postalcode,'') ~* <? value("search_pattern") ?>) OR (COALESCE(bill_addr.addr_country,'') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_cntct.cntct_first_name || ' ' || corr_cntct.cntct_last_name,'') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_cntct.cntct_phone || ' ' || corr_cntct.cntct_phone2 || ' ' || corr_cntct.cntct_fax, '') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_cntct.cntct_email, '') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_addr.addr_line1 || ' ' || corr_addr.addr_line2 || ' ' || corr_addr.addr_line3,'') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_addr.addr_city,'') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_addr.addr_state,'') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_addr.addr_postalcode,'') ~* <? value("search_pattern") ?>) OR (COALESCE(corr_addr.addr_country,'') ~* <? value("search_pattern") ?>)) <? endif ?> <? if exists("cust_number_pattern") ?> AND (cust_number ~* <? value("cust_number_pattern") ?>) <? endif ?> <? if exists("cust_name_pattern") ?> AND (cust_name ~* <? value("cust_name_pattern") ?>) <? endif ?> <? if exists("custtype_code_pattern") ?> AND (custtype_code ~* <? value("custtype_code_pattern") ?>) <? endif ?> <? if exists("cntct_name_pattern") ?> AND (COALESCE(bill_cntct.cntct_first_name || ' ' || bill_cntct.cntct_last_name, '') ~* <? value("cntct_name_pattern") ?> OR COALESCE(corr_cntct.cntct_first_name || ' ' || corr_cntct.cntct_last_name, '') ~* <? value("cntct_name_pattern") ?>) <? endif ?> <? if exists("cntct_phone_pattern") ?> AND (COALESCE(bill_cntct.cntct_phone || ' ' || bill_cntct.cntct_phone2 || ' ' || bill_cntct.cntct_fax,'') ~* <? value("cntct_phone_pattern") ?> OR COALESCE(corr_cntct.cntct_phone || ' ' || corr_cntct.cntct_phone2 || ' ' || corr_cntct.cntct_fax,'') ~* <? value("cntct_phone_pattern") ?>) <? endif ?> <? if exists("cntct_email_pattern") ?> AND (COALESCE(bill_cntct.cntct_email,'') ~* <? value("cntct_email_pattern") ?> OR COALESCE(corr_cntct.cntct_email,'') ~* <? value("cntct_email_pattern") ?>) <? endif ?> <? if exists("addr_street_pattern") ?> AND (COALESCE(bill_addr.addr_line1 || ' ' || bill_addr.addr_line2 || ' ' || bill_addr.addr_line3,'') ~* <? value("addr_street_pattern") ?> OR COALESCE(corr_addr.addr_line1 || ' ' || corr_addr.addr_line2 || ' ' || corr_addr.addr_line3,'') ~* <? value("addr_street_pattern") ?>) <? endif ?> <? if exists("addr_city_pattern") ?> AND (COALESCE(bill_addr.addr_city,'') ~* <? value("addr_city_pattern") ?> OR COALESCE(corr_addr.addr_city,'') ~* <? value("addr_city_pattern") ?>) <? endif ?> <? if exists("addr_state_pattern") ?> AND (COALESCE(bill_addr.addr_state,'') ~* <? value("addr_state_pattern") ?> OR COALESCE(corr_addr.addr_state,'') ~* <? value("addr_state_pattern") ?>) <? endif ?> <? if exists("addr_postalcode_pattern") ?> AND (COALESCE(bill_addr.addr_postalcode,'') ~* <? value("addr_postalcode_pattern") ?> OR COALESCE(corr_addr.addr_postalcode,'') ~* <? value("addr_postalcode_pattern") ?>) <? endif ?> <? if exists("addr_country_pattern") ?> AND (COALESCE(bill_addr.addr_country,'') ~* <? value("addr_country_pattern") ?> OR COALESCE(corr_addr.addr_country,'') ~* <? value("addr_country_pattern") ?>) <? endif ?> <? literal("charClause") ?> ORDER BY cust_number; 146 5 140 745 140 2 5 33 725 15 12 Arial 10 bold Parameter Query filter 6 21 5 15 745 15 2
    detail detail 67 50 2 100 15 Arial 8 bold detail cust_number 5 2 40 15 Arial 8 bold detail f_active 480 2 250 15 0 Arial 8 bold detail f_bill_addr 155 17 200 15 Arial 8 bold detail bill_cntct_name 155 32 200 15 Arial 8 bold detail bill_phone 155 47 200 15 Arial 8 bold detail bill_email 365 2 100 15 Arial 8 bold detail custtype_code 155 2 200 15 Arial 8 bold detail cust_name
    16 105 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/DeliveryDateVariancesByItem.xml000066400000000000000000000374311217451700100242730ustar00rootroot00000000000000 Delivery Date Variances By Item DeliveryDateVariancesByItem 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, uom_name, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername") ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("item_id") ?>); detail poDeliveryDateVariances detail 185 310 47 100 20 Arial 10 bold head uom_name 95 67 300 20 Arial 10 bold head item_descrip1 95 47 150 20 Arial 10 bold head item_number 95 84 300 20 Arial 10 bold head item_descrip2 95 109 300 20 Arial 10 bold head warehouse 5 182 745 182 2 550 47 100 20 Arial 10 bold head startdate 95 129 300 20 Arial 10 bold head agentUsername 550 67 100 20 Arial 10 bold head enddate 6 39 5 35 745 35 2
    detail detail 32 665 0 80 15 Arial 8 bold detail f_recv_date 195 0 150 15 Arial 8 bold detail venditemnumber 580 0 80 15 Arial 8 bold detail argd_duedate 7 31 747 31 0 60 0 150 15 Arial 8 bold detail vend_name 195 15 200 15 Arial 8 bold detail venditemdescrip 5 0 50 15 Arial 8 bold detail recv_order_number 492 0 80 15 Arial 8 bold detail f_qty 493 15 80 15 Arial 8 bold detail real_leadtime 665 15 80 15 Arial 8 bold detail orderdate 581 15 80 15 Arial 8 bold detail release_duedate
    16 102 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/DeliveryDateVariancesByVendor.xml000066400000000000000000000355611217451700100246340ustar00rootroot00000000000000 Delivery Date Variances By Vendor DeliveryDateVariancesByVendor 0.05 0.05 Letter 50 50 50 50 head SELECT vend_name, vend_number, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS purchagent FROM vendinfo WHERE (vend_id=<? value("vend_id") ?>); detail poDeliveryDateVariances detail 171 550 69 100 20 Arial 10 bold head enddate 95 110 300 20 Arial 10 bold head purchagent 95 65 300 20 Arial 10 bold head vend_name 95 90 300 20 Arial 10 bold head warehouse 550 49 100 20 Arial 10 bold head startdate 95 45 150 20 Arial 10 bold head vend_number 1 168 741 168 2 4 -1 744 -1 2 1 35
    detail detail 31 578 0 80 15 Arial 8 bold detail f_qty 62 14 247 15 Arial 8 bold detail venditemdescrip 495 1 80 15 Arial 8 bold detail argd_duedate 665 0 80 15 Arial 8 bold detail f_recv_date 319 0 162 15 Arial 8 bold detail venditemnumber 5 30 745 30 0 5 0 50 15 Arial 8 bold detail recv_order_number 495 15 80 15 Arial 8 bold detail release_duedate 578 14 80 15 Arial 8 bold detail real_leadtime 665 14 80 15 Arial 8 bold detail orderdate 62 0 247 15 Arial 8 bold detail itemnumber
    16 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/DepartmentsMasterList.xml000066400000000000000000000044471217451700100232430ustar00rootroot00000000000000 Departments Master List DepartmentsMasterList Letter 100 100 100 100 deptQuery SELECT dept_number, dept_name FROM dept ORDER BY dept_number; 103 2 100 647 100 0 1 72 646 72 0
    main deptQuery 31 180 10 200 20 Arial 12 normal deptQuery dept_name 15 10 150 20 Arial 12 normal deptQuery dept_number
    qt-client-4.1.0/share/reports/DepositsRegister.xml000066400000000000000000000532301217451700100222360ustar00rootroot00000000000000 Deposits Register DepositsRegister 0.05 0.05 Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("showUsernames") ?> text('Username') <? else ?> text('') <? endif ?> AS f_username detail SELECT trans_id, trans_journalnumber, formatDate(trans_date) AS transdate, trans_source, trans_doctype, trans_docnumber, firstLine(trans_notes) AS transnotes, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, trans_username, formatBoolYN(trans_posted) AS f_posted, -- Debits: CASE WHEN (trans_amount < 0) THEN formatMoney(ABS(trans_amount)) ELSE '' END AS f_debit, CASE WHEN (trans_amount < 0) THEN ABS(trans_amount) ELSE 0 END AS debit_amt, --Credits: CASE WHEN (trans_amount > 0) THEN formatMoney(trans_amount) ELSE '' END AS f_credit, CASE WHEN (trans_amount > 0) THEN trans_amount ELSE 0 END AS credit_amt, --Balance: trans_amount * -1 as balance_amt, --AROPEN Amount formatMoney(currtobase(aropen_curr_id,(aropen_amount - aropen_paid),aropen_docdate)) AS f_aropen_bal, currtobase(aropen_curr_id,(aropen_amount - aropen_paid),aropen_docdate) AS aropen_bal FROM ( SELECT gltrans_id AS trans_id, gltrans_date AS trans_date, gltrans_created AS trans_created, gltrans_source AS trans_source, gltrans_doctype AS trans_doctype, gltrans_sequence AS trans_sequence, gltrans_docnumber AS trans_docnumber, gltrans_notes AS trans_notes, gltrans_amount AS trans_amount, gltrans_journalnumber AS trans_journalnumber, gltrans_username AS trans_username, gltrans_posted AS trans_posted, accnt_id, accnt_descrip, aropen_amount, aropen_paid, aropen_curr_id, aropen_docdate FROM gltrans LEFT OUTER JOIN aropen ON ((text(gltrans_docnumber) = 'I-' || text(aropen_docnumber)) AND (aropen_doctype='I')), accnt WHERE ((gltrans_accnt_id=accnt_id) AND (gltrans_doctype = 'CR') AND (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) ) UNION SELECT sltrans_id AS trans_id, sltrans_date AS trans_date, sltrans_created AS trans_created, sltrans_source AS trans_source, sltrans_doctype AS trans_doctype, sltrans_sequence AS trans_sequence, sltrans_docnumber AS trans_docnumber, sltrans_notes AS trans_notes, sltrans_amount AS trans_amount, sltrans_journalnumber AS trans_journalnumber, sltrans_username AS trans_username, sltrans_posted AS trans_posted, accnt_id, accnt_descrip, aropen_amount, aropen_paid, aropen_curr_id, aropen_docdate FROM sltrans LEFT OUTER JOIN aropen ON ((text(sltrans_docnumber) = 'I-' || text(aropen_docnumber)) AND (aropen_doctype='I')), accnt WHERE ((sltrans_accnt_id=accnt_id) AND (sltrans_doctype = 'CR') AND (sltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) ) ) AS data ORDER BY trans_created DESC, trans_sequence, trans_amount; 206 0 200 1000 200 2 175 90 200 20 Arial 10 bold head enddate 175 70 200 20 Arial 10 bold head startdate 6 57 0 50 1000 50 2
    detail detail 21 12500 0 80 15 Arial 8 bold detail trans_doctype 202 0 100 15 Arial 8 bold detail trans_docnumber 892 0 65 15 Arial 8 bold detail trans_username 55 0 60 15 Arial 8 bold detail transdate 160 0 25 15 Arial 8 bold detail trans_doctype 310 0 175 15 Arial 8 bold detail account 490 0 95 15 Arial 8 bold detail transnotes 695 0 80 15 Arial 8 bold detail f_credit 963 0 60 15 Arial 8 bold detail f_posted 600 0 80 15 Arial 8 bold detail f_debit 0 0 45 15 Arial 8 bold detail trans_journalnumber 790 0 80 15 Arial 8 bold detail f_aropen_bal 120 0 25 15 Arial 8 bold detail trans_source
    78 695 25 75 12 Arial 8 bold detail credit_amt money 600 25 80 12 Arial 8 bold detail debit_amt money 960 60 40 15 Arial 8 bold Context Query page_number 90 60 100 15 Arial 8 bold Context Query report_date 605 5 1015 6 2 790 25 75 12 Arial 8 bold detail aropen_bal qty 21 960 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/DetailedInventoryHistoryByLocation.xml000066400000000000000000000442011217451700100257340ustar00rootroot00000000000000 Detailed Inventory History by Location DetailedInventoryHistoryByLocation Letter 50 50 50 50 head SELECT formatLocationName(location_id) AS locationname, firstLine(location_descrip) as f_descrip, formatBoolYN(location_netable) AS f_netable, formatBoolYN(location_restrict) AS f_restrict, warehous_code AS warehouse, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate FROM location, whsinfo WHERE ((location_id=<? value("location_id") ?>) AND (location_warehous_id=warehous_id) ); detail SELECT invhist_id, formatDateTime(invhist_transdate) AS transdate, invhist_transtype, (invhist_ordtype || '-' || invhist_ordnumber) AS ordernumber, invhist_invuom, item_number, item_descrip1, item_descrip2, formatlotserialnumber(invdetail_ls_id) AS invdetail_lotserial, formatQty(invdetail_qty) AS transqty, formatQty(invdetail_qty_before) AS qohbefore, formatQty(invdetail_qty_after) AS qohafter, invhist_user AS username, (select warehous_code from whsinfo where warehous_id=itemsite_warehous_id) as warehous_code FROM invdetail, invhist, itemsite, item WHERE ((invdetail_invhist_id=invhist_id) AND (invhist_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (invdetail_location_id=<? value("location_id") ?>) AND (date(invhist_transdate) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) AND (transType(invhist_transtype, <? value("transType") ?>)) ) ORDER BY invhist_transdate DESC, invhist_transtype; 251 140 104 375 20 Arial 10 bold head f_descrip 140 85 375 20 Arial 10 bold head locationname 508 150 200 20 Arial 10 bold head enddate 140 130 200 20 Arial 10 bold head warehouse 508 130 200 20 Arial 10 bold head startdate 600 104 65 20 Arial 10 bold head f_restrict 600 85 65 20 Arial 10 bold head f_netable 5 245 745 245 2 6 51 5 45 745 45 2
    detail detail 51 585 0 75 15 Arial 8 bold detail qohbefore 508 0 75 15 Arial 8 bold detail transqty 60 0 100 15 Arial 8 bold detail transdate 433 0 75 15 Arial 8 bold detail invhist_invuom 60 15 100 15 Arial 8 bold detail ordernumber 10 0 35 15 Arial 8 bold detail warehous_code 660 0 75 15 Arial 8 bold detail qohafter 170 15 228 15 Arial 8 bold detail item_descrip1 10 15 35 15 Arial 8 bold detail invhist_transtype 170 0 125 15 Arial 8 bold detail item_number 5 45 745 45 0 305 0 125 15 Arial 8 bold detail invdetail_lotserial 60 30 100 15 Arial 8 bold detail username 170 30 228 15 Arial 8 bold detail item_descrip2
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/EarnedCommissions.xml000066400000000000000000000336631217451700100223710ustar00rootroot00000000000000 Earned Commissions EarnedCommissions Letter 50 50 50 50 head SELECT <? if exists("salesrep_id") ?> ( SELECT salesrep_name FROM salesrep WHERE (salesrep_id=<? value("salesrep_id") ?>) ) <? else ?> text('All Sales Reps') <? endif ?> AS salesrep, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate; detail salesHistory detail 221 140 120 200 20 Arial 10 bold head startdate 140 140 200 20 Arial 10 bold head enddate 140 100 385 20 Arial 10 bold head salesrep 5 215 745 215 2 6 21 5 15 745 15 2
    detail detail 16 395 0 110 15 Arial 8 bold detail item_number 565 0 70 15 Arial 8 bold detail f_baseextprice 155 0 50 15 Arial 8 bold detail cust_number 103 0 50 15 Arial 8 bold detail cohist_ordernumber 705 0 40 15 Arial 8 bold detail f_commissionpaid 5 0 100 15 Arial 8 bold detail salesrep_name 315 0 80 15 Arial 8 bold detail f_invcdate 505 0 60 15 Arial 8 bold detail f_qtyshipped 635 0 70 15 Arial 8 bold detail f_basecommission 202 0 110 15 Arial 8 bold detail cohist_shiptoname
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 16 565 0 70 15 Arial 8 bold detail baseextprice qty 635 0 70 15 Arial 8 bold detail basecommission qty
    qt-client-4.1.0/share/reports/EmployeeList.xml000066400000000000000000000265541217451700100213630ustar00rootroot00000000000000 Employee List EmployeeList Letter 50 50 50 50 detail SELECT e.emp_id, m.emp_id, warehous_code, e.emp_code, e.emp_number, cntct_first_name, cntct_last_name, m.emp_code AS mgr_code, dept_number, shift_number, CASE WHEN (e.emp_active) THEN 'Yes' ELSE 'No' END AS f_active FROM emp e LEFT OUTER JOIN cntct ON (emp_cntct_id=cntct_id) LEFT OUTER JOIN whsinfo ON (emp_warehous_id=warehous_id) LEFT OUTER JOIN emp m ON (e.emp_mgr_emp_id=m.emp_id) LEFT OUTER JOIN shift ON (e.emp_shift_id=shift_id) LEFT OUTER JOIN dept ON (e.emp_dept_id=dept_id) WHERE ((LENGTH(TRIM(COALESCE(<? value("searchString") ?>,''))) = 0) <? if exists("searchCode") ?> OR (e.emp_code ~* <? value("searchString") ?>) <? endif ?> <? if exists("searchDept") ?> OR (dept_number ~* <? value("searchString") ?>) OR (dept_name ~* <? value("searchString") ?>) <? endif ?> <? if exists("searchMgr") ?> OR (m.emp_code ~* <? value("searchString") ?>) OR (m.emp_number ~* <? value("searchString") ?>) <? endif ?> <? if exists("searchNumber") ?> OR (e.emp_number ~* <? value("searchString") ?>) <? endif ?> <? if exists("searchName") ?> OR (cntct_first_name ~* <? value("searchString") ?>) OR (cntct_last_name ~* <? value("searchString") ?>) <? endif ?> <? if exists("searchShift") ?> OR (shift_number ~* <? value("searchString") ?>) OR (shift_name ~* <? value("searchString") ?>) <? endif ?> ) <? if exists("activeOnly") ?> AND e.emp_active <? endif ?> <? if exists("warehouse_id") ?> AND (warehous_id=<? value("warehouse_id") ?>) <? endif ?> ORDER BY emp_code; head SELECT 'Search for "' || <? value("searchString") ?> || '"' || <? if exists("searchCode") ?> ' in Employee Code,' || <? endif ?> <? if exists("searchDept") ?> ' in Department, ' || <? endif ?> <? if exists("searchMgr") ?> ' in Manager, ' || <? endif ?> <? if exists("searchNumber") ?> ' in Employee Number, ' || <? endif ?> <? if exists("searchShift") ?> ' in Shift, ' || <? endif ?> <? if exists("activeOnly") ?> ' Among Active Employees' <? else ?> ' Among All Employees' <? endif ?> AS filter; 131 390 40 360 31 0 Arial 8 normal head filter 747 65 42 12 0 Arial 8 normal 10 130 750 130 2 6 36 5 30 745 30 2
    detail detail 31 460 0 130 15 Arial 8 bold detail cntct_first_name 605 0 130 15 Arial 8 bold detail cntct_last_name 170 15 60 15 Arial 8 bold detail dept_number 310 15 100 15 Arial 8 bold detail shift_number 170 0 200 15 Arial 8 bold detail emp_number 375 0 50 15 Arial 8 bold detail mgr_code 10 0 100 15 Arial 8 bold detail emp_code 112 0 50 15 Arial 8 bold detail f_active
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ExpenseCategoriesMasterList.xml000066400000000000000000000177031217451700100243710ustar00rootroot00000000000000 Expense Categories Master List ExpenseCategoriesMasterList Letter 50 50 28 28 detail SELECT expcat_code, expcat_descrip, formatGLAccountLong(expcat_exp_accnt_id) AS exp_accnt, formatGLAccountLong(expcat_purchprice_accnt_id) AS ppv_accnt, formatGLAccountLong(expcat_liability_accnt_id) AS poliab_accnt, formatGLAccountLong(expcat_freight_accnt_id) AS polinefrgt_accnt FROM expcat AS A ORDER BY expcat_code; 90 6 85 1036 85 2 7 33 6 30 1036 30 2
    detail detail 40 260 -1 490 15 Arial 8 bold detail expcat_descrip 5 0 130 15 Arial 8 bold detail expcat_code 5 14 230 15 Arial 8 bold detail exp_accnt 260 14 240 15 Arial 8 bold detail ppv_accnt 520 14 230 15 Arial 8 bold detail poliab_accnt 780 14 230 15 Arial 8 bold detail polinefrgt_accnt 6 30 1036 30 1
    17 90 0 100 15 Arial 8 bold Context Query report_date 945 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ExpiredInventoryByClassCode.xml000066400000000000000000000425421217451700100243350ustar00rootroot00000000000000 Expired Inventory By Class Code ExpiredInventoryByClassCode 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Warehouses') <? endif ?> AS warehouse, <? if exists("classcode_id") ?> (SELECT (classcode_code || '-' || classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) <? else ?> text('All Class Codes') <? endif ?> AS classcode, <? if exists("perishability") ?> 'Perishability' <? else ?> 'Warranty' <? endif ?> AS expiretype, <? if exists("showValue") ?> <? if exists("useActualCosts") ?> text('Show Inventory Value with Actual Costs') <? elseif exists("useStandardCosts") ?> text('Show Inventory Value with Standard Costs') <? else ?> text('Show Inventory Value with Posted Costs') <? endif ?> AS showvalues, text('Unit Cost') AS f_unitcost, text('Value') AS f_value, <? else ?> text('') AS showvalues, text('') AS f_unitcost, text('') AS f_value, <? endif ?> int4(<? value("thresholdDays") ?>) AS f_thresholddays; detail SELECT warehous_code, item_number, item_descrip1, item_descrip2, uom_name, ls_number AS itemloc_lotserial, formatQty(itemloc_qty) AS f_qoh, formatDate(itemloc_expiration) AS f_expiration, <? if exists("showValue") ?> formatCost(cost) <? else ?> text('') <? endif ?> AS f_unitcost, noNeg(cost * itemloc_qty) AS value, <? if exists("showValue") ?> formatExtPrice(noNeg(cost * itemloc_qty)) <? else ?> text('') <? endif ?> AS f_value FROM ( SELECT itemsite_id, warehous_code, item_number, item_descrip1, item_descrip2, uom_name, ls_number, itemloc_qty, <? if exists("perishability") ?> itemloc_expiration, <? elseif exists("warranty") ?> itemloc_warrpurc AS itemloc_expiration, <? endif ?> <? if exists("useActualCosts") ?> actcost(itemsite_item_id) <? elseif exists("useStandardCosts") ?> stdcost(itemsite_item_id) <? else ?> (itemsite_value / CASE WHEN(itemsite_qtyonhand=0) THEN 1 ELSE itemsite_qtyonhand END) <? endif ?> AS cost FROM itemloc, itemsite, item, whsinfo, uom, ls WHERE ((itemloc_itemsite_id=itemsite_id) AND (itemloc_ls_id=ls_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) <? if exists("perishability") ?> AND (itemsite_perishable) AND (itemloc_expiration < (CURRENT_DATE + <? value("thresholdDays") ?>)) <? elseif exists("warranty") ?> AND (itemsite_warrpurc) AND (itemloc_warrpurc < (CURRENT_DATE + <? value("thresholdDays") ?>)) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE classcode_code ~ <? value("classcode_pattern") ?>) ) <? endif ?> ) ) AS data ORDER BY warehous_code, <? if exists("orderByInventoryValue") ?> value DESC <? elseif exists("orderByExpirationDate") ?> itemloc_expiration <? else ?> item_number <? endif ?> 237 440 140 300 20 Arial 10 bold head showvalues 575 200 80 15 Arial 8 normal head f_unitcost 130 140 200 20 Arial 10 bold head warehouse 660 200 80 15 Arial 8 normal head f_value 5 227 745 227 2 130 120 300 20 Arial 10 bold head classcode 130 160 200 20 Arial 10 bold head expiretype 540 120 195 20 Arial 10 bold head f_thresholddays 6 42 5 35 745 32 2 660 5 80 15 Arial 8 normal head f_value 575 5 80 15 Arial 8 normal head f_unitcost
    detail detail 52 350 15 135 15 Arial 8 bold detail f_expiration 102 0 150 15 Arial 8 bold detail item_number 660 0 80 15 Arial 8 bold detail f_value 25 0 50 15 Arial 8 bold detail warehous_code 490 0 80 15 Arial 8 bold detail f_qoh 265 0 80 15 Arial 8 bold detail uom_name 5 45 745 45 0 575 0 80 15 Arial 8 bold detail f_unitcost 102 30 300 15 Arial 8 bold detail item_descrip2 102 15 240 15 Arial 8 bold detail item_descrip1 350 0 135 15 Arial 8 bold detail itemloc_lotserial
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/FinancialReport.xml000066400000000000000000000650241217451700100220230ustar00rootroot00000000000000 Financial Report FinancialReport Ad Hoc Report 0.05 0.05 Letter 50 50 50 50 head SELECT flhead_name, CASE WHEN(trim(BOTH FROM COALESCE(flhead_custom_label,''))='') THEN 'Custom' ELSE flhead_custom_label END AS custom_label, CASE WHEN(flhead_usealtbegin) THEN flhead_altbegin ELSE text('Begining') END AS begining_label, CASE WHEN(flhead_usealtend) THEN flhead_altend ELSE text('Ending') END AS ending_label, CASE WHEN(flhead_usealtdebits) THEN flhead_altdebits ELSE text('Debits') END AS debits_label, CASE WHEN(flhead_usealtcredits) THEN flhead_altcredits ELSE text('Credits') END AS credits_label, CASE WHEN(flhead_usealtbudget) THEN flhead_altbudget ELSE text('Budget') END AS budget_label, CASE WHEN(flhead_usealtdiff) THEN flhead_altdiff ELSE text('Difference') END AS diff_label FROM flhead WHERE (flhead_id=<? value("flhead_id") ?>) detail SELECT financialReport(<? value("flhead_id") ?>, period_id,<? value("interval") ?>,<? value("prj_id") ?>) FROM period WHERE (period_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )); SELECT period_id, period_start, formatperiodname(period_id,<? value("interval") ?>) AS f_period, flrpt_order, ( repeat(' ', flrpt_level) || flgrp_name ) AS name, CASE WHEN(flgrp_summarize AND flgrp_showstart) THEN formatMoney(flrpt_beginning) ELSE NULL END AS beginning, CASE WHEN(flgrp_summarize AND flgrp_showdelta) THEN formatMoney(flrpt_debits) ELSE NULL END AS debits, CASE WHEN(flgrp_summarize AND flgrp_showdelta) THEN formatMoney(flrpt_credits) ELSE NULL END AS credits, CASE WHEN(flgrp_summarize AND flgrp_showend) THEN formatMoney(flrpt_ending) ELSE NULL END AS ending, CASE WHEN(flgrp_summarize AND flgrp_showbudget) THEN formatMoney(flrpt_budget) ELSE NULL END AS budget, CASE WHEN(flgrp_summarize AND flgrp_showdiff) THEN formatMoney(flrpt_diff) ELSE NULL END AS diff, CASE WHEN(flgrp_summarize AND flgrp_showcustom) THEN formatMoney(flrpt_custom) ELSE NULL END AS custom, CASE WHEN(flgrp_summarize AND flgrp_showstartprcnt) THEN formatPrcnt(flrpt_beginningprcnt) ELSE NULL END AS beginningprcnt, CASE WHEN(flgrp_summarize AND flgrp_showdeltaprcnt) THEN formatPrcnt(flrpt_debitsprcnt) ELSE NULL END AS debitsprcnt, CASE WHEN(flgrp_summarize AND flgrp_showdeltaprcnt) THEN formatPrcnt(flrpt_creditsprcnt) ELSE NULL END AS creditsprcnt, CASE WHEN(flgrp_summarize AND flgrp_showendprcnt) THEN formatPrcnt(flrpt_endingprcnt) ELSE NULL END AS endingprcnt, CASE WHEN(flgrp_summarize AND flgrp_showbudgetprcnt) THEN formatPrcnt(flrpt_budgetprcnt) ELSE NULL END AS budgetprcnt, CASE WHEN(flgrp_summarize AND flgrp_showdiffprcnt) THEN formatPrcnt(flrpt_diffprcnt) ELSE NULL END AS diffprcnt, CASE WHEN(flgrp_summarize AND flgrp_showcustomprcnt) THEN formatPrcnt(flrpt_customprcnt) ELSE NULL END AS customprcnt FROM flrpt, flgrp, period WHERE ((flrpt_type='G') AND (flrpt_type_id=flgrp_id) AND (flrpt_flhead_id=<? value("flhead_id") ?>) AND (flrpt_period_id=period_id) AND (flrpt_username=getEffectiveXtUser()) AND (flrpt_interval=<? value("interval") ?>) AND (period_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ))) UNION SELECT period_id, period_start, formatperiodname(period_id,<? value("interval") ?>) AS f_period, flrpt_order, ( repeat(' ', flrpt_level) || CASE WHEN(accnt_id IS NULL) THEN ('Unknown Account ID ' || flitem_accnt_id) ELSE (formatGLAccount(accnt_id) || '-' || accnt_descrip) END ) AS name, formatMoney(flrpt_beginning) AS beginning, formatMoney(flrpt_debits) AS debits, formatMoney(flrpt_credits) AS credits, formatMoney(flrpt_ending) AS ending, formatMoney(flrpt_budget) AS budget, formatMoney(flrpt_diff) AS diff, formatMoney(flrpt_custom) AS custom, formatPrcnt(flrpt_beginningprcnt) AS beginningprcnt, formatPrcnt(flrpt_debitsprcnt) AS debitsprcnt, formatPrcnt(flrpt_creditsprcnt) AS creditsprcnt, formatPrcnt(flrpt_endingprcnt) AS endingprcnt, formatPrcnt(flrpt_budgetprcnt) AS budgetprcnt, formatPrcnt(flrpt_diffprcnt) AS diffprcnt, formatPrcnt(flrpt_customprcnt) AS customprcnt FROM flrpt LEFT OUTER JOIN accnt ON (flrpt_accnt_id=accnt_id), flitem, period WHERE ((flrpt_type='I') AND (flrpt_type_id=flitem_id) AND (flrpt_flhead_id=<? value("flhead_id") ?>) AND (flrpt_period_id=period_id) AND (flrpt_username=getEffectiveXtUser()) AND (flrpt_interval=<? value("interval") ?>) <? if not exists("showzeros") ?> AND ((flrpt_beginning <> 0) OR (flrpt_debits <> 0) OR (flrpt_credits <> 0) OR (flrpt_ending <> 0) OR (flrpt_budget <> 0) OR (flrpt_diff <> 0) OR (flrpt_custom <> 0)) <? endif ?> AND (period_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ))) UNION SELECT period_id, period_start, formatperiodname(period_id,<? value("interval") ?>) AS f_period, flrpt_order, ( repeat(' ', flrpt_level) || flspec_name ) AS name, formatMoney(flrpt_beginning) AS beginning, formatMoney(flrpt_debits) AS debits, formatMoney(flrpt_credits) AS credits, formatMoney(flrpt_ending) AS ending, formatMoney(flrpt_budget) AS budget, formatMoney(flrpt_diff) AS diff, formatMoney(flrpt_custom) AS custom, formatPrcnt(flrpt_beginningprcnt) AS beginningprcnt, formatPrcnt(flrpt_debitsprcnt) AS debitsprcnt, formatPrcnt(flrpt_creditsprcnt) AS creditsprcnt, formatPrcnt(flrpt_endingprcnt) AS endingprcnt, formatPrcnt(flrpt_budgetprcnt) AS budgetprcnt, formatPrcnt(flrpt_diffprcnt) AS diffprcnt, formatPrcnt(flrpt_customprcnt) AS customprcnt FROM flrpt, flspec, period WHERE ((flrpt_type='S') AND (flrpt_type_id=flspec_id) AND (flrpt_flhead_id=<? value("flhead_id") ?>) AND (flrpt_period_id=period_id) AND (flrpt_username=getEffectiveXtUser()) AND (flrpt_interval=<? value("interval") ?>) AND (period_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ))) UNION SELECT period_id, period_start, formatperiodname(period_id,<? value("interval") ?>) AS f_period, flrpt_order, ( repeat(' ', flrpt_level) || CASE WHEN(flrpt_type='T' AND flrpt_level=0) THEN COALESCE(flrpt_altname,'Total') WHEN(flrpt_type='T') THEN COALESCE(flrpt_altname,'Subtotal') ELSE ('Type ' || flrpt_type || ' ' || text(flrpt_type_id)) END ) AS name, formatMoney(flrpt_beginning) AS beginning, formatMoney(flrpt_debits) AS debits, formatMoney(flrpt_credits) AS credits, formatMoney(flrpt_ending) AS ending, formatMoney(flrpt_budget) AS budget, formatMoney(flrpt_diff) AS diff, formatMoney(flrpt_custom) AS custom, formatPrcnt(flrpt_beginningprcnt) AS beginningprcnt, formatPrcnt(flrpt_debitsprcnt) AS debitsprcnt, formatPrcnt(flrpt_creditsprcnt) AS creditsprcnt, formatPrcnt(flrpt_endingprcnt) AS endingprcnt, formatPrcnt(flrpt_budgetprcnt) AS budgetprcnt, formatPrcnt(flrpt_diffprcnt) AS diffprcnt, formatPrcnt(flrpt_customprcnt) AS customprcnt FROM flrpt, period WHERE ((NOT (flrpt_type IN ('G','I','S'))) AND (flrpt_flhead_id=<? value("flhead_id") ?>) AND (flrpt_period_id=period_id) AND (flrpt_username=getEffectiveXtUser()) AND (flrpt_interval=<? value("interval") ?>) AND (period_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ))) ORDER BY period_start, flrpt_order; notes SELECT flhead_notes AS notes FROM flhead WHERE ((flhead_id=<? value("flhead_id") ?>) AND (length(flhead_notes) > 0)) 136 100 104 459 20 Arial 10 bold head flhead_name 5 38 775 0 75 15 Arial 8 normal head diff_label 615 0 75 15 Arial 8 normal head ending_label 375 0 75 15 Arial 8 normal head begining_label 455 0 75 15 Arial 8 normal head debits_label 5 30 994 30 2 855 0 75 15 Arial 8 normal head custom_label 695 0 75 15 Arial 8 normal head budget_label 535 0 75 15 Arial 8 normal head credits_label
    detail byPeriod period_id 112 855 80 75 15 Arial 8 normal head custom_label 535 80 75 15 Arial 8 normal head credits_label 455 80 75 15 Arial 8 normal head debits_label 100 40 459 20 Arial 10 bold detail f_period 695 80 75 15 Arial 8 normal head budget_label 615 80 75 15 Arial 8 normal head ending_label 775 80 75 15 Arial 8 normal head diff_label 10 110 1000 110 2 375 80 75 15 Arial 8 normal head begining_label detail 33 455 0 75 15 Arial 8 bold detail debits 375 15 75 15 Arial 8 bold detail beginningprcnt 5 0 350 15 Arial 8 bold detail name 855 15 75 15 Arial 8 bold detail customprcnt 615 0 75 15 Arial 8 bold detail ending 775 15 75 15 Arial 8 bold detail diffprcnt 695 0 75 15 Arial 8 bold detail budget 615 15 75 15 Arial 8 bold detail endingprcnt 375 0 75 15 Arial 8 bold detail beginning 695 15 75 15 Arial 8 bold detail budgetprcnt 855 0 75 15 Arial 8 bold detail custom 455 15 75 15 Arial 8 bold detail debitsprcnt 535 0 75 15 Arial 8 bold detail credits 775 0 75 15 Arial 8 bold detail diff 535 15 75 15 Arial 8 bold detail creditsprcnt
    notes head 26 10 6 980 15 0 Arial 9 normal notes notes
    23 930 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/FinancialReportMonth.xml000066400000000000000000000327401217451700100230300ustar00rootroot00000000000000 Financial Report Month FinancialReportMonth Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC 0.05 0.05 Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail -- Group: financialReport -- Name: detail -- Notes: SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_month <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 100 80 459 20 Arial 10 bold head f_name 3.55207 162.602 746.627 162.602 2 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 590.695 145 75 15 Arial 8 normal head flstmthead_typedescrip2 590 130 75 15 Arial 8 normal head flstmthead_month 670 130 75 15 Arial 8 normal head flstmthead_month 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 590 15 75 15 Arial 8 normal head flstmthead_typedescrip2 670 0 75 15 Arial 8 normal head flstmthead_month 2.82852 30.1086 747.989 30.1086 2 590 0 75 15 Arial 8 normal head flstmthead_month
    detail subgrp flstmtitem_subgrp 4 390 0 750 0 0 detail 19 590 0 75 15 Arial 8 bold detail flstmtitem_month 25 0 550 15 Arial 8 bold detail flstmtitem_name 670 0 75 15 Arial 8 bold detail flstmtitem_monthprcnt
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 95 0 100 15 Arial 8 bold Context Query report_date 695 0 40 15 Arial 8 bold Context Query page_number 7
    qt-client-4.1.0/share/reports/FinancialReportMonthBudget.xml000066400000000000000000000406241217451700100241630ustar00rootroot00000000000000 Financial Report Month and Budget FinancialReportMonthBudget Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC 0.05 0.05 Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_month <> 0) OR (flstmtitem_monthbudget <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 380 130 75 15 Arial 8 normal head flstmthead_month 500 130 75 15 Arial 8 normal head flstmthead_month 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 580 130 75 15 Arial 8 normal head flstmthead_month 3.0775 165 748.368 165 2 100 80 459 20 Arial 10 bold head f_name 660 130 75 15 Arial 8 normal head flstmthead_month 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 500 0 75 15 Arial 8 normal head flstmthead_month 660 0 75 15 Arial 8 normal head flstmthead_year 380 0 75 15 Arial 8 normal head flstmthead_month 1.53875 35 749.873 35 2 580 0 75 15 Arial 8 normal head flstmthead_year 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2
    detail subgrp flstmtitem_subgrp 4 380 1 740 1 0 detail 19 500 0 75 15 Arial 8 bold detail flstmtitem_monthbudget 380 0 75 15 Arial 8 bold detail flstmtitem_month 660 0 75 15 Arial 8 bold detail flstmtitem_monthbudgetdiffprcnt 580 0 75 15 Arial 8 bold detail flstmtitem_monthbudgetdiff 25 0 345 15 Arial 8 bold detail flstmtitem_name
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 95 0 100 15 Arial 8 bold Context Query report_date 695 0 40 15 Arial 8 bold Context Query page_number 7
    qt-client-4.1.0/share/reports/FinancialReportMonthDbCr.xml000066400000000000000000000406661217451700100235710ustar00rootroot00000000000000 Financial Report Month with Debits and Credits FinancialReportMonthDbCr Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC 0.05 0.05 Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_monthdb <> 0) OR (flstmtitem_monthcr <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 590 145 75 16 Arial 8 normal head flstmthead_typedescrip2 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 2.62279 160 749 160 2 100 80 459 20 Arial 10 bold head f_name 670 130 75 15 Arial 8 normal head flstmthead_month 505 130 75 15 Arial 8 normal head flstmthead_month 425 130 75 15 Arial 8 normal head flstmthead_month 590 130 75 15 Arial 8 normal head flstmthead_month 100 60 459 20 Arial 10 bold head prj_name 15 60 80 20 Arial 10 normal head project 4 37 1.94814 31 748.325 31 2 670 16 75 15 Arial 8 normal head f_typedescrip_prcnt 505 1 75 15 Arial 8 normal head flstmthead_month 670 1 75 15 Arial 8 normal head flstmthead_month 425 1 75 15 Arial 8 normal head flstmthead_month 590 1 75 15 Arial 8 normal head flstmthead_month 590 16 75 15 Arial 8 normal head flstmthead_typedescrip2
    detail subgrp flstmtitem_subgrp 4 390 0 750 0 0 detail 19 420 0 75 15 Arial 8 bold detail flstmtitem_monthdb 590 0 75 15 Arial 8 bold detail flstmtitem_month 505 0 75 15 Arial 8 bold detail flstmtitem_monthcr 670 0 75 15 Arial 8 bold detail flstmtitem_monthprcnt 25 0 390 15 Arial 8 bold detail flstmtitem_name
    notes notes 24 25 10 700 15 0 Arial 9 normal notes notes
    22 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 7
    qt-client-4.1.0/share/reports/FinancialReportMonthPriorMonth.xml000066400000000000000000000414121217451700100250460ustar00rootroot00000000000000 Financial Report Month and Prior Month FinancialReportMonthPriorMonth Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_typedescrip2 || ' Diff.' AS f_diff, flstmthead_typedescrip2 || ' % Diff.' AS f_diffprcnt, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_month <> 0) OR (flstmtitem_prmonth <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 170 2.82315 160.942 760 160.942 2 100 80 459 20 Arial 10 bold head f_name 500 130 75 15 Arial 8 normal head flstmthead_prmonth 380 130 75 15 Arial 8 normal head flstmthead_month 580 130 75 15 Arial 8 normal head flstmthead_prmonth 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 660 145 75 15 Arial 8 normal head f_diffprcnt 660 130 75 15 Arial 8 normal head flstmthead_prmonth 500 145 75 15 Arial 8 normal head flstmthead_typedescrip2 580 145 75 15 Arial 8 normal head f_diff 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 7 40 660 0 75 15 Arial 8 normal head flstmthead_prmonth 500 0 75 15 Arial 8 normal head flstmthead_prmonth 500 15 75 15 Arial 8 normal head flstmthead_typedescrip2 580 0 75 15 Arial 8 normal head flstmthead_prmonth 380 0 75 15 Arial 8 normal head flstmthead_month 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2 660 15 75 15 Arial 8 normal head f_diffprcnt 580 15 75 15 Arial 8 normal head f_diff 0.0790882 31.4959 747.149 31.4959 2
    detail subgrp flstmtitem_subgrp 7 380 1 740 1 0 detail 22 500 0 75 15 Arial 8 bold detail flstmtitem_prmonth 25 0 345 15 Arial 8 bold detail flstmtitem_name 380 0 75 15 Arial 8 bold detail flstmtitem_month 660 0 75 15 Arial 8 bold detail flstmtitem_prmonthdiffprcnt 580 0 75 15 Arial 8 bold detail flstmtitem_prmonthdiff
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    25 95 0 100 15 Arial 8 bold Context Query report_date 695 0 40 15 Arial 8 bold Context Query page_number 10
    qt-client-4.1.0/share/reports/FinancialReportMonthPriorQuarter.xml000066400000000000000000000413441217451700100254100ustar00rootroot00000000000000 Financial Report Month and Prior Quarter FinancialReportMonthPriorQuarter Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_typedescrip2 || 'Diff.' AS f_diff, flstmthead_typedescrip2 || ' % Diff.' AS f_diffprcnt, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_month <> 0) OR (flstmtitem_prqtr <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 169 100 80 459 20 Arial 10 bold head f_name 500 145 75 15 Arial 8 normal head flstmthead_typedescrip2 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 500 130 75 15 Arial 8 normal head flstmthead_prqtr 660 130 75 15 Arial 8 normal head flstmthead_prqtr 580 130 75 15 Arial 8 normal head flstmthead_prqtr 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 2.16957 162 750 162 2 580 145 75 15 Arial 8 normal head f_diff 660 145 75 15 Arial 8 normal head f_diffprcnt 380 130 75 15 Arial 8 normal head flstmthead_month 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 6 39 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2 500 15 75 15 Arial 8 normal head flstmthead_typedescrip2 580 0 75 15 Arial 8 normal head flstmthead_prqtr 380 0 75 15 Arial 8 normal head flstmthead_month 660 0 75 15 Arial 8 normal head flstmthead_prqtr 660 15 75 15 Arial 8 normal head f_diffprcnt 1.79722 31 749.933 31 2 580 15 75 15 Arial 8 normal head f_diff 500 0 75 15 Arial 8 normal head flstmthead_prqtr
    detail subgrp flstmtitem_subgrp 6 380 1 740 1 0 detail 21 580 0 75 15 Arial 8 bold detail flstmtitem_prqtrdiff 25 0 345 15 Arial 8 bold detail flstmtitem_name 380 0 75 15 Arial 8 bold detail flstmtitem_month 500 0 75 15 Arial 8 bold detail flstmtitem_prqtr 660 0 75 15 Arial 8 bold detail flstmtitem_prqtrdiffprcnt
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    24 95 0 100 15 Arial 8 bold Context Query report_date 695 0 40 15 Arial 8 bold Context Query page_number 9
    qt-client-4.1.0/share/reports/FinancialReportMonthPriorYear.xml000066400000000000000000000413461217451700100246670ustar00rootroot00000000000000 Financial Report Month and Prior Year FinancialReportMonthPriorYear Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_typedescrip2 || ' Diff.' AS f_diff, flstmthead_typedescrip2 || ' % Diff.' AS f_diffprcnt, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_month <> 0) OR (flstmtitem_pryear <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 169 660 130 75 15 Arial 8 normal head flstmthead_pryear 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 0.998194 160 750 160 2 100 80 459 20 Arial 10 bold head f_name 500 130 75 15 Arial 8 normal head flstmthead_pryear 380 130 75 15 Arial 8 normal head flstmthead_month 580 145 75 15 Arial 8 normal head f_diff 500 145 75 15 Arial 8 normal head flstmthead_typedescrip2 580 130 75 15 Arial 8 normal head flstmthead_pryear 660 145 75 15 Arial 8 normal head f_diffprcnt 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 6 39 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2 660 15 75 15 Arial 8 normal head f_diffprcnt 500 15 75 15 Arial 8 normal head flstmthead_typedescrip2 580 0 75 15 Arial 8 normal head flstmthead_pryear 500 0 75 15 Arial 8 normal head flstmthead_pryear 1.55252 30 751 30 2 580 15 75 15 Arial 8 normal head f_diff 380 0 75 15 Arial 8 normal head flstmthead_month 660 0 75 15 Arial 8 normal head flstmthead_pryear
    detail subgrp flstmtitem_subgrp 6 380 1 740 1 0 detail 21 660 0 75 15 Arial 8 bold detail flstmtitem_pryeardiffprcnt 25 0 345 15 Arial 8 bold detail flstmtitem_name 580 0 75 15 Arial 8 bold detail flstmtitem_pryeardiff 500 0 75 15 Arial 8 bold detail flstmtitem_pryear 380 0 75 15 Arial 8 bold detail flstmtitem_month
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    24 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 9
    qt-client-4.1.0/share/reports/FinancialReportMonthQuarter.xml000066400000000000000000000410111217451700100243630ustar00rootroot00000000000000 Financial Report Month and Quarter FinancialReportMonthQuarter Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC 0.05 0.05 Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_month <> 0) OR (flstmtitem_qtr <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 0.00540306 162.686 749.477 162.686 2 580 145 75 15 Arial 8 normal head flstmthead_typedescrip2 380 130 75 15 Arial 8 normal head flstmthead_month 100 80 459 20 Arial 10 bold head f_name 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 459 130 75 15 Arial 8 normal head flstmthead_month 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 580 130 75 15 Arial 8 normal head flstmthead_qtr 660 130 75 15 Arial 8 normal head flstmthead_qtr 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2 0.393337 30 750 30 2 580 0 75 15 Arial 8 normal head flstmthead_qtr 380 0 75 15 Arial 8 normal head flstmthead_month 660 0 75 15 Arial 8 normal head flstmthead_qtr 459 0 75 15 Arial 8 normal head flstmthead_month 580 15 75 15 Arial 8 normal head flstmthead_typedescrip2
    detail subgrp flstmtitem_subgrp 4 380 1 740 1 0 detail 19 660 0 75 15 Arial 8 bold detail flstmtitem_qtrprcnt 459 0 75 15 Arial 8 bold detail flstmtitem_monthprcnt 25 0 345 15 Arial 8 bold detail flstmtitem_name 580 0 75 15 Arial 8 bold detail flstmtitem_qtr 380 0 75 15 Arial 8 bold detail flstmtitem_month
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 95 0 100 15 Arial 8 bold Context Query report_date 695 0 40 15 Arial 8 bold Context Query page_number 7
    qt-client-4.1.0/share/reports/FinancialReportMonthYear.xml000066400000000000000000000407161217451700100236530ustar00rootroot00000000000000 Financial Report Month and Year FinancialReportMonthYear Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_month <> 0) OR (flstmtitem_year <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 166 380 130 75 15 Arial 8 normal head flstmthead_month 660 130 75 15 Arial 8 normal head flstmthead_year 100 80 460 20 Arial 10 bold head f_name 2.08287 160 748 160 2 580 130 75 15 Arial 8 normal head flstmthead_year 460 130 75 15 Arial 8 normal head flstmthead_month 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 100 100 460 20 Arial 10 bold head flstmthead_typedescrip1 580 145 75 15 Arial 8 normal head flstmthead_typedescrip2 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 3 36 460 0 75 15 Arial 8 normal head flstmthead_month 580 15 75 15 Arial 8 normal head flstmthead_typedescrip2 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2 660 0 75 15 Arial 8 normal head flstmthead_year 380 0 75 15 Arial 8 normal head flstmthead_month 580 0 75 15 Arial 8 normal head flstmthead_year 1.43183 30.3326 748.17 30.3326 2
    detail subgrp flstmtitem_subgrp 3 380 1 740 1 0 detail 18 660 0 75 15 Arial 8 bold detail flstmtitem_yearprcnt 580 0 75 15 Arial 8 bold detail flstmtitem_year 380 0 75 15 Arial 8 bold detail flstmtitem_month 25 0 345 15 Arial 8 bold detail flstmtitem_name 460 0 75 15 Arial 8 bold detail flstmtitem_monthprcnt
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    21 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 6
    qt-client-4.1.0/share/reports/FinancialReportQuarter.xml000066400000000000000000000324641217451700100233710ustar00rootroot00000000000000 Financial Report Quarter FinancialReportQuarter Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_qtr <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 168 1 160 750 160 2 100 80 459 20 Arial 10 bold head f_name 590 145 75 15 Arial 8 normal head flstmthead_typedescrip2 670 130 75 15 Arial 8 normal head flstmthead_qtr 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 590 130 75 15 Arial 8 normal head flstmthead_qtr 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 5 38 590 15 75 15 Arial 8 normal head flstmthead_typedescrip2 590 0 75 15 Arial 8 normal head flstmthead_qtr 1 30 749 30 2 670 0 75 15 Arial 8 normal head flstmthead_qtr
    detail subgrp flstmtitem_subgrp 5 380 1 740 1 0 detail 20 25 0 550 15 Arial 8 bold detail flstmtitem_name 590 0 75 15 Arial 8 bold detail flstmtitem_qtr 670 0 75 15 Arial 8 bold detail flstmtitem_qtrprcnt
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    23 95 0 100 15 Arial 8 bold Context Query report_date 695 0 40 15 Arial 8 bold Context Query page_number 8
    qt-client-4.1.0/share/reports/FinancialReportQuarterBudget.xml000066400000000000000000000404571217451700100245250ustar00rootroot00000000000000 Financial Report Quarter and Budget FinancialReportQuarterBudget Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_qtr <> 0) OR (flstmtitem_qtrbudget <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 380 130 75 15 Arial 8 normal head flstmthead_qtr 580 130 75 15 Arial 8 normal head flstmthead_qtr 1 160 749 160 2 500 130 75 15 Arial 8 normal head flstmthead_qtr 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 100 80 459 20 Arial 10 bold head f_name 660 130 75 15 Arial 8 normal head flstmthead_qtr 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 580 0 75 15 Arial 8 normal head flstmthead_qtr 380 0 75 15 Arial 8 normal head flstmthead_qtr 1.80678 30 750 30 2 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2 660 0 75 15 Arial 8 normal head flstmthead_qtr 500 0 75 15 Arial 8 normal head flstmthead_qtr
    detail subgrp flstmtitem_subgrp 4 380 1 740 1 0 detail 19 660 0 75 15 Arial 8 bold detail flstmtitem_qtrbudgetdiffprcnt 580 0 75 15 Arial 8 bold detail flstmtitem_qtrbudgetdiff 500 0 75 15 Arial 8 bold detail flstmtitem_qtrbudget 25 0 345 15 Arial 8 bold detail flstmtitem_name 380 0 75 15 Arial 8 bold detail flstmtitem_qtr
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 7
    qt-client-4.1.0/share/reports/FinancialReportQuarterPriorQuarter.xml000066400000000000000000000413211217451700100257410ustar00rootroot00000000000000 Financial Report Quarter and Prior Quarter FinancialReportQuarterPriorQuarter Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_typedescrip2 || ' Diff.' AS f_diff, flstmthead_typedescrip2 || ' % Diff.' AS f_diffprcnt, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_qtr <> 0) OR (flstmtitem_prqtr <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 380 130 75 15 Arial 8 normal head flstmthead_qtr 500 145 75 15 Arial 8 normal head flstmthead_typedescrip2 580 145 75 15 Arial 8 normal head f_diff 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 500 130 75 15 Arial 8 normal head flstmthead_prqtr 0 159 749 159 2 580 130 75 15 Arial 8 normal head flstmthead_prqtr 660 145 75 15 Arial 8 normal head f_diffprcnt 100 80 459 20 Arial 10 bold head f_name 660 130 75 15 Arial 8 normal head flstmthead_prqtr 380 145 75 15 Arial 8 normal head flstmthead_typedescrip2 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 580 0 75 15 Arial 8 normal head flstmthead_prqtr 500 15 75 15 Arial 8 normal head flstmthead_typedescrip2 660 15 75 15 Arial 8 normal head f_diffprcnt 380 0 75 15 Arial 8 normal head flstmthead_qtr 380 15 75 15 Arial 8 normal head flstmthead_typedescrip2 660 0 75 15 Arial 8 normal head flstmthead_prqtr 580 15 75 15 Arial 8 normal head f_diff 500 0 75 15 Arial 8 normal head flstmthead_prqtr 1 30 748 30 2
    detail subgrp flstmtitem_subgrp 4 380 1 740 1 0 detail 19 380 0 75 15 Arial 8 bold detail flstmtitem_qtr 660 0 75 15 Arial 8 bold detail flstmtitem_prqtrdiffprcnt 500 0 75 15 Arial 8 bold detail flstmtitem_prqtr 25 0 345 15 Arial 8 bold detail flstmtitem_name 580 0 75 15 Arial 8 bold detail flstmtitem_prqtrdiff
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 7
    qt-client-4.1.0/share/reports/FinancialReportYear.xml000066400000000000000000000324741217451700100226470ustar00rootroot00000000000000 Financial Report Year FinancialReportYear Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_year <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 100 80 459 20 Arial 10 bold head f_name 1 160 749 160 2 570 130 85 15 Arial 8 normal head flstmthead_year 665 130 80 15 Arial 8 normal head flstmthead_year 570 145 85 15 Arial 8 normal head flstmthead_typedescrip2 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 570 0 85 15 Arial 8 normal head flstmthead_year 660 0 85 15 Arial 8 normal head flstmthead_year 0 31 751 31 2 570 15 85 15 Arial 8 normal head flstmthead_typedescrip2
    detail subgrp flstmtitem_subgrp 4 390 0 750 0 0 detail 19 665 0 80 15 Arial 8 bold detail flstmtitem_yearprcnt 25 0 550 15 Arial 8 bold detail flstmtitem_name 570 0 85 15 Arial 8 bold detail flstmtitem_year
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 7
    qt-client-4.1.0/share/reports/FinancialReportYearBudget.xml000066400000000000000000000406551217451700100240020ustar00rootroot00000000000000 Financial Report Year and Budget FinancialReportYearBudget Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_year <> 0) OR (flstmtitem_yearbudget <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 465 130 85 15 Arial 8 normal head flstmthead_year 360 130 85 15 Arial 8 normal head flstmthead_year 360 145 85 15 Arial 8 normal head flstmthead_typedescrip2 560 145 85 15 Arial 8 normal head Budget Diff. 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 560 130 85 15 Arial 8 normal head flstmthead_year 100 80 459 20 Arial 10 bold head f_name 3.53065 160 749.738 160 2 650 130 85 15 Arial 8 normal head flstmthead_year 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 555 0 85 15 Arial 8 normal head flstmthead_year 355 15 85 15 Arial 8 normal head flstmthead_typedescrip2 650 0 85 15 Arial 8 normal head flstmthead_year 455 0 85 15 Arial 8 normal head flstmthead_year 355 0 85 15 Arial 8 normal head flstmthead_year -0.610015 29.5831 748.788 29.5831 2 555 15 85 15 Arial 8 normal head Budget Diff.
    detail subgrp flstmtitem_subgrp 4 355 0 750 0 0 detail 19 459 0 85 15 Arial 8 bold detail flstmtitem_yearbudget 560 0 85 15 Arial 8 bold detail flstmtitem_yearbudgetdiff 650 0 85 15 Arial 8 bold detail flstmtitem_yearbudgetdiffprcnt 360 0 85 15 Arial 8 bold detail flstmtitem_year 25 0 345 15 Arial 8 bold detail flstmtitem_name
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 7
    qt-client-4.1.0/share/reports/FinancialReportYearPriorYear.xml000066400000000000000000000413221217451700100244740ustar00rootroot00000000000000 Financial Report Year and Prior Year FinancialReportYearPriorYear Financial Report Column Layout SELECT flcol_id, flhead_name || ' - ' || flcol_name FROM flcol, flhead WHERE ((flcol_flhead_id=flhead_id) AND (flhead_active)) Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Letter 50 50 50 50 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, flstmthead_username, flstmthead_flhead_name || ' - ' || flstmthead_flcol_name AS f_name, flstmthead_typedescrip1, flstmthead_typedescrip2, flstmthead_typedescrip2 || 'Diff.' AS f_diff, flstmthead_typedescrip2 || ' % Diff.' AS f_diffprcnt, flstmthead_month, flstmthead_qtr, flstmthead_year, flstmthead_prmonth, flstmthead_prqtr, flstmthead_pryear FROM getflstmthead(<? value("flcol_id") ?>,<? value("period_id") ?>) detail SELECT flstmtitem_flhead_id, flstmtitem_period_id, flstmtitem_username, flstmtitem_order, flstmtitem_level, flstmtitem_subgrp, flstmtitem_type, flstmtitem_type_id, flstmtitem_parent_id, flstmtitem_accnt_id, flstmtitem_name, formatMoney(flstmtitem_month) AS flstmtitem_month, formatMoney(flstmtitem_monthdb) AS flstmtitem_monthdb, formatMoney(flstmtitem_monthcr) AS flstmtitem_monthcr, formatPrcnt(flstmtitem_monthprcnt) AS flstmtitem_monthprcnt, formatMoney(flstmtitem_monthbudget) AS flstmtitem_monthbudget, formatPrcnt(flstmtitem_monthbudgetprcnt) AS flstmtitem_monthbudgetprcnt, formatMoney(flstmtitem_monthbudgetdiff) AS flstmtitem_monthbudgetdiff, formatPrcnt(flstmtitem_monthbudgetdiffprcnt) AS flstmtitem_monthbudgetdiffprcnt, formatMoney(flstmtitem_qtr) AS flstmtitem_qtr, formatMoney(flstmtitem_qtrdb) AS flstmtitem_qtrdb, formatMoney(flstmtitem_qtrcr) AS flstmtitem_qtrcr, formatPrcnt(flstmtitem_qtrprcnt) AS flstmtitem_qtrprcnt, formatMoney(flstmtitem_qtrbudget) AS flstmtitem_qtrbudget, formatPrcnt(flstmtitem_qtrbudgetprcnt) AS flstmtitem_qtrbudgetprcnt, formatMoney(flstmtitem_qtrbudgetdiff) AS flstmtitem_qtrbudgetdiff, formatPrcnt(flstmtitem_qtrbudgetdiffprcnt) AS flstmtitem_qtrbudgetdiffprcnt, formatMoney(flstmtitem_year) AS flstmtitem_year, formatMoney(flstmtitem_yeardb) AS flstmtitem_yeardb, formatMoney(flstmtitem_yearcr) AS flstmtitem_yearcr, formatPrcnt(flstmtitem_yearprcnt) AS flstmtitem_yearprcnt, formatMoney(flstmtitem_yearbudget) AS flstmtitem_yearbudget, formatPrcnt(flstmtitem_yearbudgetprcnt) AS flstmtitem_yearbudgetprcnt, formatMoney(flstmtitem_yearbudgetdiff) AS flstmtitem_yearbudgetdiff, formatPrcnt(flstmtitem_yearbudgetdiffprcnt) AS flstmtitem_yearbudgetdiffprcnt, formatMoney(flstmtitem_prmonth) AS flstmtitem_prmonth, formatPrcnt(flstmtitem_prmonthprcnt) AS flstmtitem_prmonthprcnt, formatMoney(flstmtitem_prmonthdiff) AS flstmtitem_prmonthdiff, formatPrcnt(flstmtitem_prmonthdiffprcnt) AS flstmtitem_prmonthdiffprcnt, formatMoney(flstmtitem_prqtr) AS flstmtitem_prqtr, formatPrcnt(flstmtitem_prqtrprcnt) AS flstmtitem_prqtrprcnt, formatMoney(flstmtitem_prqtrdiff) AS flstmtitem_prqtrdiff, formatPrcnt(flstmtitem_prqtrdiffprcnt) AS flstmtitem_prqtrdiffprcnt, formatMoney(flstmtitem_pryear) AS flstmtitem_pryear, formatPrcnt(flstmtitem_pryearprcnt) AS flstmtitem_pryearprcnt, formatMoney(flstmtitem_pryeardiff) AS flstmtitem_pryeardiff, formatPrcnt(flstmtitem_pryeardiffprcnt) AS flstmtitem_pryeardiffprcnt FROM financialreport(<? value("flcol_id") ?>,<? value("period_id") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,True,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((flstmtitem_year <> 0) OR (flstmtitem_pryear <> 0) OR (flstmtitem_type <> 'I')) <? endif ?> ; notes SELECT * FROM ( SELECT 1 AS seq, flhead_notes AS notes FROM flhead JOIN flcol ON (flhead_id=flcol_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, flnotes_notes AS notes FROM flnotes JOIN flcol ON (flcol_flhead_id=flnotes_flhead_id) WHERE ((flcol_id=<? value("flcol_id") ?>) AND (flnotes_period_id=<? value("period_id") ?>) AND (length(flnotes_notes) > 0))) data ORDER BY seq; 167 650 130 85 15 Arial 8 normal head flstmthead_pryear 555 145 85 15 Arial 8 normal head f_diff 360 145 85 15 Arial 8 normal head flstmthead_typedescrip2 459 130 85 15 Arial 8 normal head flstmthead_pryear 555 130 85 15 Arial 8 normal head flstmthead_pryear 650 145 85 15 Arial 8 normal head f_diffprcnt 100 100 459 20 Arial 10 bold head flstmthead_typedescrip1 100 80 459 20 Arial 10 bold head f_name 459 145 85 15 Arial 8 normal head flstmthead_typedescrip2 360 130 85 15 Arial 8 normal head flstmthead_year 0 160 750 160 2 99 59.6 459 20 Arial 10 bold head prj_name 15 59.5 80 20 Arial 10 normal head project 4 37 650 0 85 15 Arial 8 normal head flstmthead_pryear 1 30 749 30 2 555 15 85 15 Arial 8 normal head f_diff 555 0 80 15 Arial 8 normal head flstmthead_pryear 360 15 85 15 Arial 8 normal head flstmthead_typedescrip2 360 0 85 15 Arial 8 normal head flstmthead_year 459 0 85 15 Arial 8 normal head flstmthead_pryear 650 15 85 15 Arial 8 normal head f_diffprcnt 459 15 85 15 Arial 8 normal head flstmthead_typedescrip2
    detail subgrp flstmtitem_subgrp 4 360 0 750 0 0 detail 19 25 0 345 15 Arial 8 bold detail flstmtitem_name 459 0 85 15 Arial 8 bold detail flstmtitem_pryear 555 0 85 15 Arial 8 bold detail flstmtitem_pryeardiff 360 0 85 15 Arial 8 bold detail flstmtitem_year 650 0 85 15 Arial 8 bold detail flstmtitem_pryeardiffprcnt
    notes notes 24 25 9 700 15 0 Arial 9 normal notes notes
    22 695 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 7
    qt-client-4.1.0/share/reports/FinancialTrend.xml000066400000000000000000000556561217451700100216360ustar00rootroot00000000000000 Financial Trend FinancialTrend Financial Trend Report Financial Report Layout SELECT flhead_id, flhead_name FROM flhead WHERE (flhead_active) Time period buckets Month Quarter Year Accounting Period Reference SELECT period_id, CASE WHEN period_name <> '' THEN period_name ELSE (formatdate(period_start) || '-' || formatdate(period_end)) END FROM period ORDER BY period_end DESC Display account numbers with description 0.05 0.05 Letter 50 50 25 25 head SELECT <? value("project") ?> AS project, (SELECT prj_name FROM prj WHERE prj_id=<? value("prj_id") ?>) AS prj_name, fltrendhead_username, fltrendhead_flhead_name, fltrendhead_typedescrip, fltrendhead_fld1, fltrendhead_fld2, fltrendhead_fld3, fltrendhead_fld4, fltrendhead_fld5, fltrendhead_fld6, fltrendhead_fld7, fltrendhead_fld8, fltrendhead_fld9, fltrendhead_fld10, fltrendhead_fld11, fltrendhead_fld12, fltrendhead_grndttl FROM getfltrendhead(<? value("flhead_id") ?>,ARRAY[ <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ],<? value("interval") ?>) detail SELECT fltrenditem_flhead_id, fltrenditem_username, fltrenditem_order, fltrenditem_level, fltrenditem_subgrp, fltrenditem_type, fltrenditem_type_id, fltrenditem_parent_id, fltrenditem_accnt_id, fltrenditem_name, fltrenditem_fld1, fltrenditem_fld2, fltrenditem_fld3, fltrenditem_fld4, fltrenditem_fld5, fltrenditem_fld6, fltrenditem_fld7, fltrenditem_fld8, fltrenditem_fld9, fltrenditem_fld10, fltrenditem_fld11, fltrenditem_fld12, fltrenditem_grndttl FROM financialReport(<? value("flhead_id") ?>, ARRAY[ <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ],<? value("interval") ?>, <? if exists("shownumbers") ?> true <? else ?> false <? endif ?> ,<? value("prj_id") ?>) <? if not exists("showzeros") ?> WHERE ((fltrenditem_fld1 <> formatMoney(0) AND fltrenditem_fld1 IS NOT NULL) OR (fltrenditem_fld1 <> formatMoney(0) AND fltrenditem_fld1 IS NOT NULL) OR (fltrenditem_fld2 <> formatMoney(0) AND fltrenditem_fld2 IS NOT NULL) OR (fltrenditem_fld3 <> formatMoney(0) AND fltrenditem_fld3 IS NOT NULL) OR (fltrenditem_fld4 <> formatMoney(0) AND fltrenditem_fld4 IS NOT NULL) OR (fltrenditem_fld5 <> formatMoney(0) AND fltrenditem_fld5 IS NOT NULL) OR (fltrenditem_fld6 <> formatMoney(0) AND fltrenditem_fld6 IS NOT NULL) OR (fltrenditem_fld7 <> formatMoney(0) AND fltrenditem_fld7 IS NOT NULL) OR (fltrenditem_fld8 <> formatMoney(0) AND fltrenditem_fld8 IS NOT NULL) OR (fltrenditem_fld9 <> formatMoney(0) AND fltrenditem_fld9 IS NOT NULL) OR (fltrenditem_fld10 <> formatMoney(0) AND fltrenditem_fld10 IS NOT NULL) OR (fltrenditem_fld11 <> formatMoney(0) AND fltrenditem_fld11 IS NOT NULL) OR (fltrenditem_fld12 <> formatMoney(0) AND fltrenditem_fld12 IS NOT NULL) OR (fltrenditem_type <> 'I')) <? endif ?> notes SELECT * FROM ( SELECT 1 AS seq, text('Notes') AS label, flhead_notes AS notes, startOfTime() AS period_end FROM flhead WHERE ((flhead_id=<? value("flhead_id") ?>) AND (length(flhead_notes) > 0)) UNION ALL SELECT 2 AS seq, period_name AS label, flnotes_notes AS notes, period_end FROM flnotes JOIN period ON (flnotes_period_id=period_id) WHERE ((flnotes_flhead_id=<? value("flhead_id") ?>) AND ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> OR <? endif ?> (flnotes_period_id=<? value("period_id_list") ?>) <? endforeach ?> ) AND (length(flnotes_notes) > 0))) data ORDER BY seq, period_end; 149 208 120 60 15 Arial 8 normal head fltrendhead_fld1 100 60 459 20 Arial 10 bold head fltrendhead_flhead_name 860 120 60 15 Arial 8 normal head fltrendhead_fld11 918 120 60 15 Arial 8 normal head fltrendhead_fld12 469 120 60 15 Arial 8 normal head fltrendhead_fld5 405 120 60 15 Arial 8 normal head fltrendhead_fld4 600 120 60 15 Arial 8 normal head fltrendhead_fld7 275 120 60 15 Arial 8 normal head fltrendhead_fld2 795 120 60 15 Arial 8 normal head fltrendhead_fld10 5 135 1050 135 2 535 120 60 15 Arial 8 normal head fltrendhead_fld6 665 120 60 15 Arial 8 normal head fltrendhead_fld8 104 80 459 20 Arial 10 bold head fltrendhead_typedescrip 989 120 60 15 Arial 8 normal head fltrendhead_grndttl 340 120 60 15 Arial 8 normal head fltrendhead_fld3 730 120 60 15 Arial 8 normal head fltrendhead_fld9 100 40 459 20 Arial 10 bold head prj_name 20 40 80 20 Arial 10 normal head project 10 43 208 10 60 15 Arial 8 normal head fltrendhead_fld1 340 10 60 15 Arial 8 normal head fltrendhead_fld3 665 10 60 15 Arial 8 normal head fltrendhead_fld8 600 10 60 15 Arial 8 normal head fltrendhead_fld7 535 10 60 15 Arial 8 normal head fltrendhead_fld6 5 30 1050 30 2 405 10 60 15 Arial 8 normal head fltrendhead_fld4 730 10 60 15 Arial 8 normal head fltrendhead_fld9 795 10 60 15 Arial 8 normal head fltrendhead_fld10 918 10 60 15 Arial 8 normal head fltrendhead_fld12 860 10 60 15 Arial 8 normal head fltrendhead_fld11 280 10 60 15 Arial 8 normal head fltrendhead_fld2 469 10 60 15 Arial 8 normal head fltrendhead_fld5 985 10 60 15 Arial 8 normal head fltrendhead_grndttl
    detail subgrp fltrenditem_subgrp 7 204 0 1055 0 1 detail 19 925 0 60 15 Arial 8 normal detail fltrenditem_fld12 665 0 60 15 Arial 8 normal detail fltrenditem_fld8 340 0 60 15 Arial 8 normal detail fltrenditem_fld3 469 0 60 15 Arial 8 normal detail fltrenditem_fld5 860 0 60 15 Arial 8 normal detail fltrenditem_fld11 600 0 60 15 Arial 8 normal detail fltrenditem_fld7 535 0 60 15 Arial 8 normal detail fltrenditem_fld6 405 0 60 15 Arial 8 normal detail fltrenditem_fld4 730 0 60 15 Arial 8 normal detail fltrenditem_fld9 208 0 60 15 Arial 8 normal detail fltrenditem_fld1 795 0 60 15 Arial 8 normal detail fltrenditem_fld10 989 0 60 15 Arial 8 bold detail fltrenditem_grndttl 5 0 195 15 Arial 8 bold detail fltrenditem_name 275 0 60 15 Arial 8 normal detail fltrenditem_fld2
    notes notes 32 10 17 1025 15 0 Arial 9 normal notes notes 5 2 500 15 Arial 9 bold notes label
    29 95 0 100 15 Arial 8 bold Context Query report_date 930 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/FreightAccountAssignmentsMasterList.xml000066400000000000000000000161151217451700100260710ustar00rootroot00000000000000 A/R Account Assignments Master List FreightAccountAssignmentsMasterList Letter 50 50 50 50 detail SELECT CASE WHEN araccnt_custtype_id=-1 THEN araccnt_custtype ELSE (SELECT custtype_code FROM custtype WHERE (custtype_id=araccnt_custtype_id)) END AS custtypecode, formatGLAccount(araccnt_ar_accnt_id) AS f_araccnt, formatGLAccount(araccnt_freight_accnt_id) as f_freightaccnt, formatGLAccount(araccnt_prepaid_accnt_id) AS f_prepaidaccnt, formatGLAccount(araccnt_deferred_accnt_id) AS f_deferredaccnt FROM araccnt ORDER BY custtypecode; 88 5 80 745 80 2 8 28 5 20 745 20 2
    detail detail 19 290 1 125 15 Arial 8 bold detail f_freightaccnt 5 0 120 15 Arial 8 bold detail custtypecode 130 0 125 15 Arial 8 bold detail f_araccnt 610 1 125 15 Arial 8 bold detail f_deferredaccnt 450 1 125 15 Arial 8 bold detail f_prepaidaccnt
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/FreightClassesMasterList.xml000066400000000000000000000101671217451700100236570ustar00rootroot00000000000000 Freight Classes Master List FreightClassesMasterList Letter 50 50 50 50 detail select freightclass_code, freightclass_descrip from freightclass order by freightclass_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 175 0 565 15 Arial 8 bold detail freightclass_descrip 10 0 150 15 Arial 8 bold detail freightclass_code
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/FreightPricesByCustomer.xml000066400000000000000000000453151217451700100235170ustar00rootroot00000000000000 Freight Prices By Customer FreightPricesByCustomer Letter 50 50 50 50 head SELECT cust_name, addr_line1 AS cust_address1, addr_line2 AS cust_address2, addr_line3 AS cust_address3, <? if exists("showExpired") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showexpired, <? if exists("showFuture") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showfuture FROM custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE (cust_id=<? value("cust_id") ?>); detail SELECT itemid, sourcetype, ipshead_name, source, formatQty(ipsfreight_qtybreak) AS f_qtybreak, formatSalesPrice(ipsfreight_price) AS f_price, CASE WHEN (ipsfreight_type = 'F') THEN 'Flat Rate' ELSE 'Per UOM' END AS method, currConcat(ipshead_curr_id) AS currConcat, CASE WHEN (warehous_code IS NULL) THEN 'Any' ELSE warehous_code END AS f_warehous, CASE WHEN (shipzone_name IS NULL) THEN 'Any' ELSE shipzone_name END AS f_shipzone, CASE WHEN (freightclass_code IS NULL) THEN 'Any' ELSE freightclass_code END AS f_freightclass, CASE WHEN (ipsfreight_shipvia IS NULL) THEN 'Any' ELSE ipsfreight_shipvia END AS f_shipvia FROM ( SELECT ipsfreight_id AS itemid, 1 AS sourcetype, ipshead_name, 'Customer' AS source, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipshead_curr_id, warehous_code, shipzone_name, freightclass_code, ipsfreight_shipvia FROM ipsass JOIN ipshead ON (ipshead_id=ipsass_ipshead_id) JOIN ipsfreight ON (ipsfreight_ipshead_id=ipshead_id) LEFT OUTER JOIN whsinfo ON (warehous_id=ipsfreight_warehous_id) LEFT OUTER JOIN shipzone ON (shipzone_id=ipsfreight_shipzone_id) LEFT OUTER JOIN freightclass ON (freightclass_id=ipsfreight_freightclass_id) WHERE ( (ipsass_cust_id=<? value("cust_id") ?>) AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) = 0) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsfreight_id AS itemid, 2 AS sourcetype, ipshead_name, 'CustType' AS source, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipshead_curr_id, warehous_code, shipzone_name, freightclass_code, ipsfreight_shipvia FROM ipsass JOIN ipshead ON (ipshead_id=ipsass_ipshead_id) JOIN ipsfreight ON (ipsfreight_ipshead_id=ipshead_id) JOIN custinfo ON (cust_custtype_id=ipsass_custtype_id) LEFT OUTER JOIN whsinfo ON (warehous_id=ipsfreight_warehous_id) LEFT OUTER JOIN shipzone ON (shipzone_id=ipsfreight_shipzone_id) LEFT OUTER JOIN freightclass ON (freightclass_id=ipsfreight_freightclass_id) WHERE ( (cust_id=<? value("cust_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsfreight_id AS itemid, 3 AS sourcetype, ipshead_name, 'CustTypePattern' AS source, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipshead_curr_id, warehous_code, shipzone_name, freightclass_code, ipsfreight_shipvia FROM custinfo JOIN custtype ON (custtype_id=cust_custtype_id) JOIN ipsass ON ((coalesce(length(ipsass_custtype_pattern), 0) > 0) AND (custtype_code ~ ipsass_custtype_pattern)) JOIN ipshead ON (ipshead_id=ipsass_ipshead_id) JOIN ipsfreight ON (ipsfreight_ipshead_id=ipshead_id) LEFT OUTER JOIN whsinfo ON (warehous_id=ipsfreight_warehous_id) LEFT OUTER JOIN shipzone ON (shipzone_id=ipsfreight_shipzone_id) LEFT OUTER JOIN freightclass ON (freightclass_id=ipsfreight_freightclass_id) WHERE ( (cust_id=<? value("cust_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsfreight_id AS itemid, 4 AS sourcetype, ipshead_name, ('Sale' || '-' || sale_name) AS source, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipshead_curr_id, warehous_code, shipzone_name, freightclass_code, ipsfreight_shipvia FROM sale JOIN ipshead ON (ipshead_id=sale_ipshead_id) JOIN ipsfreight ON (ipsfreight_ipshead_id=ipshead_id) LEFT OUTER JOIN whsinfo ON (warehous_id=ipsfreight_warehous_id) LEFT OUTER JOIN shipzone ON (shipzone_id=ipsfreight_shipzone_id) LEFT OUTER JOIN freightclass ON (freightclass_id=ipsfreight_freightclass_id) WHERE ((TRUE) <? if not exists("showExpired") ?> AND (sale_enddate > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (sale_startdate <= CURRENT_DATE) <? endif ?> ) ) AS data ORDER BY ipsfreight_qtybreak, ipsfreight_price; 234 100 140 300 20 Arial 10 bold head cust_address3 565 100 113 20 Arial 10 bold head f_showexpired 100 120 300 20 Arial 10 bold head cust_address2 565 120 113 20 Arial 10 bold head f_showfuture 100 80 605 20 Arial 10 bold head cust_name 100 100 300 20 Arial 10 bold head cust_address1 5 228 745 228 2 6 41 5 35 745 35 2
    detail detail 56 150 15 80 15 Arial 8 bold detail f_price 5 50 745 50 0 480 0 80 15 Arial 8 bold detail f_freightclass 245 15 85 15 Arial 8 bold detail currConcat 10 0 120 15 Arial 8 bold detail ipshead_name 10 15 100 15 Arial 8 bold detail source 360 0 80 15 Arial 8 bold detail f_warehous 360 15 80 15 Arial 8 bold detail f_shipzone 245 0 80 15 Arial 8 bold detail method 480 15 80 15 Arial 8 bold detail f_shipvia 150 0 80 15 Arial 8 bold detail f_qtybreak
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/FreightPricesByCustomerType.xml000066400000000000000000000411571217451700100243610ustar00rootroot00000000000000 Freight Prices By Customer Type FreightPricesByCustomerType Letter 50 50 50 50 head SELECT (custtype_code || '-' || custtype_descrip) as custtype, <? if exists("showExpired") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showexpired, <? if exists("showFuture") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showfuture FROM custtype WHERE (custtype_id=<? value("custtype_id") ?>); detail SELECT itemid, sourcetype, ipshead_name, source, formatQty(ipsfreight_qtybreak) AS f_qtybreak, formatSalesPrice(ipsfreight_price) AS f_price, CASE WHEN (ipsfreight_type = 'F') THEN 'Flat Rate' ELSE 'Per UOM' END AS method, currConcat(ipshead_curr_id) AS currConcat, CASE WHEN (warehous_code IS NULL) THEN 'Any' ELSE warehous_code END AS f_warehous, CASE WHEN (shipzone_name IS NULL) THEN 'Any' ELSE shipzone_name END AS f_shipzone, CASE WHEN (freightclass_code IS NULL) THEN 'Any' ELSE freightclass_code END AS f_freightclass, CASE WHEN (ipsfreight_shipvia IS NULL) THEN 'Any' ELSE ipsfreight_shipvia END AS f_shipvia FROM ( SELECT ipsfreight_id AS itemid, 1 AS sourcetype, ipshead_name, 'CustType' AS source, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipshead_curr_id, warehous_code, shipzone_name, freightclass_code, ipsfreight_shipvia FROM ipsass JOIN ipshead ON (ipshead_id=ipsass_ipshead_id) JOIN ipsfreight ON (ipsfreight_ipshead_id=ipshead_id) LEFT OUTER JOIN whsinfo ON (warehous_id=ipsfreight_warehous_id) LEFT OUTER JOIN shipzone ON (shipzone_id=ipsfreight_shipzone_id) LEFT OUTER JOIN freightclass ON (freightclass_id=ipsfreight_freightclass_id) WHERE ( (ipsass_custtype_id=<? value("custtype_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsfreight_id AS itemid, 2 AS sourcetype, ipshead_name, 'CustTypePattern' AS source, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipshead_curr_id, warehous_code, shipzone_name, freightclass_code, ipsfreight_shipvia FROM custtype JOIN ipsass ON ((coalesce(length(ipsass_custtype_pattern), 0) > 0) AND (custtype_code ~ ipsass_custtype_pattern)) JOIN ipshead ON (ipshead_id=ipsass_ipshead_id) JOIN ipsfreight ON (ipsfreight_ipshead_id=ipshead_id) LEFT OUTER JOIN whsinfo ON (warehous_id=ipsfreight_warehous_id) LEFT OUTER JOIN shipzone ON (shipzone_id=ipsfreight_shipzone_id) LEFT OUTER JOIN freightclass ON (freightclass_id=ipsfreight_freightclass_id) WHERE ( (custtype_id=<? value("custtype_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsfreight_id AS itemid, 3 AS sourcetype, ipshead_name, ('Sale' || '-' || sale_name) AS source, ipsfreight_qtybreak, ipsfreight_price, ipsfreight_type, ipshead_curr_id, warehous_code, shipzone_name, freightclass_code, ipsfreight_shipvia FROM sale JOIN ipshead ON (ipshead_id=sale_ipshead_id) JOIN ipsfreight ON (ipsfreight_ipshead_id=ipshead_id) LEFT OUTER JOIN whsinfo ON (warehous_id=ipsfreight_warehous_id) LEFT OUTER JOIN shipzone ON (shipzone_id=ipsfreight_shipzone_id) LEFT OUTER JOIN freightclass ON (freightclass_id=ipsfreight_freightclass_id) WHERE ((TRUE) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) ) AS data ORDER BY ipsfreight_qtybreak, ipsfreight_price; 233 565 100 112 20 Arial 10 bold head f_showexpired 565 120 112 20 Arial 10 bold head f_showfuture 5 227 745 227 2 125 80 535 20 Arial 10 bold head custtype 6 41 5 35 745 35 2
    detail detail 56 360 15 80 15 Arial 8 bold detail f_shipzone 245 15 85 15 Arial 8 bold detail currConcat 480 15 80 15 Arial 8 bold detail f_shipvia 150 15 80 15 Arial 8 bold detail f_price 10 15 100 15 Arial 8 bold detail source 245 0 80 15 Arial 8 bold detail method 360 0 80 15 Arial 8 bold detail f_warehous 10 0 120 15 Arial 8 bold detail ipshead_name 5 50 745 50 0 150 0 80 15 Arial 8 bold detail f_qtybreak 480 0 80 15 Arial 8 bold detail f_freightclass
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/FrozenItemSites.xml000066400000000000000000000711021217451700100220270ustar00rootroot00000000000000 Frozen Item Sites FrozenItemSites Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT warehous_code, formatBoolYN(itemsite_active) AS active, item_number, item_descrip1, item_descrip2, formatBoolYN(itemsite_wosupply) AS supplied, formatBoolYN(itemsite_sold) AS sold, itemsite_soldranking, formatBoolYN(itemsite_stocked) AS stocked, formatBoolYN(itemsite_createpr) AS createpr, CASE WHEN (itemsite_controlmethod='N') THEN 'None' WHEN (itemsite_controlmethod='R') THEN 'Regular' WHEN (itemsite_controlmethod='L') THEN 'Lot #' WHEN (itemsite_controlmethod='S') THEN 'Serial #' ELSE '?' END AS controlmethod, formatBoolYN(itemsite_loccntrl) AS locationcontrol, CASE WHEN (itemsite_location_id=-1) THEN 'None' ELSE formatLocationName(itemsite_location_id) END AS defaultlocation, formatBoolYN(itemsite_useparams) AS enforceparams, formatBoolYN(itemsite_useparamsmanual) AS onmanualorders, formatQty(itemsite_reorderlevel) AS reorderlevel, formatQty(itemsite_ordertoqty) AS orderupto, formatQty(itemsite_multordqty) AS ordermult, formatQty(itemsite_safetystock) AS safetystock, itemsite_abcclass, itemsite_cyclecountfreq, itemsite_leadtime, itemsite_eventfence, formatQty(itemsite_qtyonhand) AS qoh, formatDate(itemsite_datelastused, 'Never') AS lastused, formatDate(itemsite_datelastcount, 'Never') AS lastcounted, COALESCE((SELECT invcnt_tagnumber FROM invcnt WHERE ((NOT invcnt_posted) AND (invcnt_itemsite_id=itemsite_id))), '') AS counttagnum FROM itemsite, whsinfo, item WHERE ((itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (itemsite_freeze) <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY item_number; 236 5 229 745 229 2 114 80 200 20 Arial 10 bold head warehouse 7 81 5 75 745 75 2
    detail detail 81 50 15 229 15 Arial 8 bold detail item_descrip1 50 0 229 15 Arial 8 bold detail item_number 280 30 45 15 Arial 8 bold detail stocked 50 30 229 15 Arial 8 bold detail item_descrip2 670 45 55 15 Arial 8 bold detail itemsite_eventfence 490 15 85 15 Arial 8 bold detail onmanualorders 430 60 80 15 Arial 8 bold detail lastcounted 670 0 55 15 Arial 8 bold detail itemsite_abcclass 260 60 80 15 Arial 8 bold detail qoh 580 60 145 15 Arial 8 bold detail counttagnum 330 0 75 15 Arial 8 bold detail createpr 580 30 80 15 Arial 8 bold detail ordermult 670 30 55 15 Arial 8 bold detail itemsite_leadtime 409 15 75 15 Arial 8 bold detail locationcontrol 280 0 45 15 Arial 8 bold detail supplied 280 15 45 15 Arial 8 bold detail sold 10 0 35 15 Arial 8 bold detail warehous_code 580 0 80 15 Arial 8 bold detail reorderlevel 345 60 80 15 Arial 8 bold detail lastused 409 0 75 15 Arial 8 bold detail controlmethod 580 15 80 15 Arial 8 bold detail orderupto 409 30 75 15 Arial 8 bold detail defaultlocation 580 45 80 15 Arial 8 bold detail safetystock 490 0 85 15 Arial 8 bold detail enforceparams 10 15 35 15 Arial 8 bold detail active 5 75 745 75 0 670 15 55 15 Arial 8 bold detail itemsite_cyclecountfreq 330 15 75 15 Arial 8 bold detail itemsite_soldranking
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/GLSeries.xml000066400000000000000000000426601217451700100204210ustar00rootroot00000000000000 G/L Series GLSeries 0.05 0.05 Letter 50 50 50 50 head SELECT <? value("title") ?> AS title, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("sourceLit") ?> text(<? value("sourceLit") ?>) <? else ?> text('All Sources') <? endif ?> AS sourceLit, <? if exists("startJrnlnum") ?> text('Start Journal Number:') <? else ?> text('') <? endif ?> AS startJrnlnumLit, <? if exists("endJrnlnum") ?> text('End Journal Number:') <? else ?> text('') <? endif ?> AS endJrnlnumLit; detail <? if exists("gltrans") ?> SELECT gltrans_id, gltrans_sequence, formatDate(gltrans_date) AS transdate, gltrans_journalnumber, gltrans_source, gltrans_doctype, gltrans_docnumber, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, firstLine(gltrans_notes) AS f_notes, CASE WHEN (gltrans_amount < 0) THEN formatMoney(gltrans_amount * -1) ELSE '' END AS f_debit, CASE WHEN (gltrans_amount > 0) THEN formatMoney(gltrans_amount) ELSE '' END AS f_credit, CASE WHEN (gltrans_amount < 0) THEN (gltrans_amount * -1) ELSE 0.0 END AS debit, CASE WHEN (gltrans_amount > 0) THEN (gltrans_amount) ELSE 0.0 END AS credit, formatBoolYN(gltrans_posted) AS f_posted FROM gltrans, accnt WHERE ((gltrans_accnt_id=accnt_id) AND (NOT gltrans_deleted) <? if exists("startDate") ?> AND (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("source") ?> AND (gltrans_source=<? value("source") ?>) <? endif ?> <? if exists("startJrnlnum") ?> AND (gltrans_journalnumber BETWEEN <? value("startJrnlnum") ?> AND <? value("endJrnlnum") ?>) <? endif ?> ) ORDER BY gltrans_date, gltrans_sequence, gltrans_amount DESC; <? else ?> SELECT sltrans_id AS gltrans_id, sltrans_sequence AS gltrans_sequence, formatDate(sltrans_date) AS transdate, sltrans_journalnumber AS gltrans_journalnumber, sltrans_source AS gltrans_source, sltrans_doctype AS gltrans_doctype, sltrans_docnumber AS gltrans_docnumber, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, firstLine(sltrans_notes) AS f_notes, CASE WHEN (sltrans_amount < 0) THEN formatMoney(sltrans_amount * -1) ELSE '' END AS f_debit, CASE WHEN (sltrans_amount > 0) THEN formatMoney(sltrans_amount) ELSE '' END AS f_credit, CASE WHEN (sltrans_amount < 0) THEN (sltrans_amount * -1) ELSE 0.0 END AS debit, CASE WHEN (sltrans_amount > 0) THEN (sltrans_amount) ELSE 0.0 END AS credit, formatBoolYN(sltrans_posted) AS f_posted FROM sltrans, accnt WHERE ((sltrans_accnt_id=accnt_id) <? if exists("startDate") ?> AND (sltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("source") ?> AND (sltrans_source=<? value("source") ?>) <? endif ?> <? if exists("startJrnlnum") ?> AND (sltrans_journalnumber BETWEEN <? value("startJrnlnum") ?> AND <? value("endJrnlnum") ?>) <? endif ?> ) ORDER BY sltrans_date, sltrans_sequence, sltrans_amount DESC; <? endif ?> 206 545 120 200 20 Arial 10 bold Parameter Query startJrnlnum 140 70 290 20 Arial 10 bold head sourceLit 545 90 200 20 Arial 10 bold head enddate 340 140 200 20 Arial 10 normal head endJrnlnumLit 5 200 745 200 2 545 70 200 20 Arial 10 bold head startdate 340 120 200 20 Arial 10 normal head startJrnlnumLit 545 140 200 20 Arial 10 bold Parameter Query endJrnlnum 440 7 300 35 Arial 18 bold head title 6 21 5 15 745 15 2
    detail detail gltrans_sequence 16 95 0 60 15 Arial 8 bold detail gltrans_journalnumber 680 0 60 15 Arial 8 bold detail f_posted 160 0 80 15 Arial 8 bold detail gltrans_doctype 330 0 175 15 Arial 8 bold detail f_notes 10 0 80 15 Arial 8 bold detail transdate 245 0 80 15 Arial 8 bold detail gltrans_docnumber 95 15 60 15 Arial 8 bold detail gltrans_source detail 16 595 0 80 15 Arial 8 bold detail f_credit 330 0 175 15 Arial 8 bold detail account 509 0 80 15 Arial 8 bold detail f_debit
    21 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 35 510 5 80 15 Arial 8 bold detail debit %0.2f 595 5 80 15 Arial 8 bold detail credit %0.2f
    qt-client-4.1.0/share/reports/GLTransactions.xml000066400000000000000000000506651217451700100216430ustar00rootroot00000000000000 G/L Transactions GLTransactions detail query modified to accomodate "Company", "Profit Center", "Account", "Sub", "Type" & "Sub-Type" filters. 0.05 0.05 Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("source") ?> text(<? value("source") ?>) <? else ?> text('All Sources') <? endif ?> AS source, <? if exists("accnt_id") ?> ( SELECT (accnt_number || '-' || accnt_descrip) FROM accnt WHERE (accnt_id=<? value("accnt_id") ?>) ) <? else ?> text('All Accounts') <? endif ?> AS accnt, <? if exists("showUsernames") ?> text('Username') <? else ?> text('') <? endif ?> AS f_username detail <? if exists("beginningBalance") ?> SELECT -1 AS gltrans_id, <? value("startDate") ?> AS gltrans_created, formatDate(<? value("startDate") ?>) AS transdate, '' AS gltrans_source, '' AS gltrans_doctype, '' AS gltrans_docnumber, '' AS invhist_docnumber, 'Beginning Balance' AS transnotes, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, '' AS f_debit, 0.0 AS debit_amt, '' AS f_credit, 0.0 AS credit_amt, <? value("beginningBalance") ?> AS balance_amt, <? value("beginningBalance") ?> AS gltrans_amount, <? value("beginningBalance") ?> AS running, NULL AS f_posted, NULL AS f_deleted, NULL AS f_username, -1 AS gltrans_sequence FROM accnt WHERE (accnt_id=<? value("accnt_id") ?>) UNION <? endif ?> SELECT gltrans_id, gltrans_created, formatDate(gltrans_date) AS transdate, gltrans_source, gltrans_doctype, gltrans_docnumber, invhist_docnumber, firstLine(gltrans_notes) AS transnotes, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, -- Debits: CASE WHEN (gltrans_amount < 0 AND NOT gltrans_deleted) THEN formatMoney(ABS(gltrans_amount)) ELSE '' END AS f_debit, CASE WHEN (gltrans_amount < 0 AND NOT gltrans_deleted) THEN ABS(gltrans_amount) ELSE 0 END AS debit_amt, --Credits: CASE WHEN (gltrans_amount > 0 AND NOT gltrans_deleted) THEN formatMoney(gltrans_amount) ELSE '' END AS f_credit, CASE WHEN (gltrans_amount > 0 AND NOT gltrans_deleted) THEN gltrans_amount ELSE 0 END AS credit_amt, --Balance: CASE WHEN (accnt_type IN ('A','E') AND NOT gltrans_deleted) THEN gltrans_amount * -1 WHEN (NOT gltrans_deleted) THEN gltrans_amount ELSE 0 END AS balance_amt, gltrans_amount, CASE WHEN (accnt_type IN ('A','E') AND NOT gltrans_deleted) THEN gltrans_amount * -1 WHEN (NOT gltrans_deleted) THEN gltrans_amount ELSE 0 END AS running, formatBoolYN(gltrans_posted) AS f_posted, formatBoolYN(gltrans_deleted) AS f_deleted, gltrans_username AS f_username, gltrans_sequence FROM gltrans JOIN accnt ON (gltrans_accnt_id=accnt_id) LEFT OUTER JOIN invhist ON (gltrans_misc_id=invhist_id AND gltrans_docnumber='Misc.') <? if exists("company_id") ?> JOIN company ON (accnt_company=company_number) <? endif ?> <? if exists("prfcntr_id") ?> JOIN prftcntr ON (accnt_profit=prftcntr_number) <? endif ?> <? if exists("subaccnt_id") ?> JOIN subaccnt ON (accnt_sub=subaccnt_number) <? endif ?> <? if exists("subType") ?> JOIN subaccnttype ON (subaccnttype_code=accnt_subaccnttype_code) <? endif ?> WHERE ( <? if exists("startDate") ?> <? if exists("endDate") ?> (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> (gltrans_date BETWEEN <? value("startDate") ?> AND endoftime()) <? endif ?> <? else ?> <? if exists("endDate") ?> (gltrans_date BETWEEN startoftime() AND <? value("endDate") ?>) <? else ?> (gltrans_date BETWEEN startoftime() AND endoftime()) <? endif ?> <? endif ?> <? if not exists("showDeleted") ?> AND (NOT gltrans_deleted) <? endif ?> <? if exists("company_id") ?> AND (company_id=<? value("company_id") ?>) <? endif ?> <? if exists("prfcntr_id") ?> AND (prftcntr_id=<? value("prfcntr_id") ?>) <? endif ?> <? if exists("accnt_number") ?> AND (accnt_number=<? value("accnt_number") ?>) <? endif ?> <? if exists("subaccnt_id") ?> AND (subaccnt_id=<? value("subaccnt_id") ?>) <? endif ?> <? if exists("subType") ?> AND (subaccnttype_id=<? value("subType") ?>) <? endif ?> <? if exists("accntType") ?> AND (accnt_type= <? value("accntType") ?>) <? endif ?> <? if exists("accnt_id") ?> AND (gltrans_accnt_id=<? value("accnt_id") ?>) <? endif ?> <? if exists("docnum") ?> AND (gltrans_docnumber = case when <? value("docnum") ?> = '' then gltrans_docnumber else <? value("docnum") ?> end ) <? endif ?> <? if exists("source") ?> AND (gltrans_source=<? value("source") ?>) <? endif ?> ) ORDER BY gltrans_created <? if not exists("beginningBalance") ?> DESC <? endif ?>, gltrans_sequence, gltrans_amount ; 205 0 200 1000 200 2 900 185 50 15 Arial 8 normal head f_username 10 50 725 15 12 Arial 10 bold Parameter Query filter 5 45 0 40 1000 40 2 900 25 50 15 Arial 8 normal head f_username
    detail detail 30 900 0 50 15 Arial 8 bold detail f_username 240 15 265 15 Arial 8 bold detail transnotes 960 0 60 15 Arial 8 bold detail f_posted 12500 0 80 15 Arial 8 bold detail gltrans_doctype 125 0 50 15 Arial 8 bold detail gltrans_doctype 0 0 60 15 Arial 8 bold detail transdate 65 0 60 15 Arial 8 bold detail gltrans_source 180 15 50 15 Arial 8 bold detail invhist_docnumber 180 0 50 15 Arial 8 bold detail gltrans_docnumber 240 0 270 15 Arial 8 bold detail account 960 15 60 15 Arial 8 bold detail f_deleted 540 0 100 15 Arial 8 bold detail f_debit 780 0 100 15 Arial 8 bold detail running qty 660 0 100 15 Arial 8 bold detail f_credit
    41 958 7 40 15 Arial 8 bold Context Query page_number 87 7 100 20 Arial 8 bold Context Query report_date 49 534 6 999 6 2 660 25 100 14 Arial 8 bold detail credit_amt money 540 25 100 14 Arial 8 bold detail debit_amt money 777 25 100 14 Arial 8 bold detail balance_amt money
    qt-client-4.1.0/share/reports/Image.xml000066400000000000000000000064351217451700100177660ustar00rootroot00000000000000 Image Image Letter 50 50 50 50 head SELECT image_name, image_descrip, image_data FROM image WHERE (image_id=<? value("image_id") ?>); 706 10 110 730 600 stretch head image_data 130 65 360 15 0 Arial 8 bold head image_descrip 130 50 140 15 Arial 8 bold head image_name 17 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date qt-client-4.1.0/share/reports/Incident.xml000066400000000000000000000371671217451700100205070ustar00rootroot00000000000000 Incident Incident Letter 50 50 50 50 head select incdt_number, incdt_summary, incdt_assigned_username, incdt_status, incdt_owner_username, incdtseverity_name, incdtpriority_name, incdtcat_name, crmacct_name, cntct_first_name || ' ' ||cntct_last_name as f_name, cntct_phone, cntct_email,cntct_title from incdt left outer join incdtseverity on (incdt_incdtseverity_id = incdtseverity_id) left outer join incdtpriority on (incdt_incdtpriority_id = incdtpriority_id) left outer join incdtcat on (incdt_incdtcat_id = incdtcat_id) left outer join crmacct on (incdt_crmacct_id = crmacct_id) left outer join cntct on (incdt_cntct_id = cntct_id) where incdt_id = <? value("incdt_id") ?>; detail select incdt_descrip from incdt where incdt_id = <? value("incdt_id") ?>; detail2 select comment_date, comment_user, comment_text from comment where comment_source_id = <? value("incdt_id") ?> and comment_source = 'INCDT' order by comment_date desc; detail3 select url_title, url_url from url where url_source_id = <? value("incdt_id") ?> and url_source = 'INCDT' 268 136 57 598 20 Arial 10 bold head incdt_summary 128 123 251 20 Arial 10 bold head f_name 370 10 171 35 Arial 18 bold head incdt_number 540 144 200 20 Arial 10 bold head incdtseverity_name 128 165 342 20 Arial 10 bold head cntct_title 540 187 150 20 Arial 10 bold head incdt_owner_username 540 208 150 20 Arial 10 bold head incdt_assigned_username 128 208 279 20 Arial 10 bold head cntct_email 540 105 150 20 Arial 10 bold head incdtcat_name 540 123 150 20 Arial 10 bold head incdt_status 128 105 263 20 Arial 10 bold head crmacct_name 540 165 150 20 Arial 10 bold head incdtpriority_name 128 144 150 20 Arial 10 bold head cntct_phone 128 187 170 20 Arial 10 bold head cntct_phone 6 36 5 30 745 30 2
    detail detail 37 10.9 8 730 17 14 Helvetica 9 normal detail incdt_descrip
    detail2 labour 33.9041 2.90454 3.94806 744.812 3.62203 1 detail2 49.0959 10.9 0.621 150 20 Helvetica 9 normal detail2 comment_date 196 0.621 150 20 Arial 9 normal detail2 comment_user 10.9 23.1 730 17 14 Helvetica 9 normal detail2 comment_text
    jobcost_head head 47.4021 4.90454 5.44606 746.812 5.12003 1
    detail3 detail3_footer 39.6984 detail3 28.8318 289 4.08 460 18 Arial 9 normal detail3 url_url 10.9 2.9979 274.1 20 Arial 9 normal detail3 url_title
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 27.5186
    qt-client-4.1.0/share/reports/IncidentCategoriesList.xml000066400000000000000000000116771217451700100233470ustar00rootroot00000000000000 Incident Categories IncidentCategoriesList Letter 50 50 50 50 detail SELECT incdtcat_name, incdtcat_order, incdtcat_descrip FROM incdtcat ORDER BY incdtcat_order, incdtcat_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 250 0 500 15 0 Arial 8 bold detail incdtcat_descrip 10 0 75 15 Arial 8 bold detail incdtcat_order 100 0 120 15 Arial 8 bold detail incdtcat_name
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/IncidentPrioritiesList.xml000066400000000000000000000117431217451700100234050ustar00rootroot00000000000000 Incident Priorities IncidentPrioritiesList Letter 50 50 50 50 detail SELECT incdtpriority_name, incdtpriority_order, incdtpriority_descrip FROM incdtpriority ORDER BY incdtpriority_order, incdtpriority_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 100 0 120 15 Arial 8 bold detail incdtpriority_name 10 0 75 15 Arial 8 bold detail incdtpriority_order 250 0 500 15 0 Arial 8 bold detail incdtpriority_descrip
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/IncidentResolutionsList.xml000066400000000000000000000120011217451700100235660ustar00rootroot00000000000000 Incident Resolutions IncidentResolutionsList Letter 50 50 50 50 detail SELECT incdtresolution_name, incdtresolution_order, incdtresolution_descrip FROM incdtresolution ORDER BY incdtresolution_order, incdtresolution_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 250 0 500 15 0 Arial 8 bold detail incdtresolution_descrip 10 0 75 15 Arial 8 bold detail incdtresolution_order 100 0 120 15 Arial 8 bold detail incdtresolution_name
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/IncidentSeveritiesList.xml000066400000000000000000000117541217451700100234000ustar00rootroot00000000000000 Incident Severities IncidentSeveritiesList Letter 50 50 50 50 detail SELECT incdtseverity_name, incdtseverity_order, incdtseverity_descrip FROM incdtseverity ORDER BY incdtseverity_order, incdtseverity_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 250 0 500 15 0 Arial 8 bold detail incdtseverity_descrip 10 0 75 15 Arial 8 bold detail incdtseverity_order 100 0 120 15 Arial 8 bold detail incdtseverity_name
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/IncidentWorkbenchList.xml000066400000000000000000000235741217451700100232030ustar00rootroot00000000000000 Incident List IncidentWorkbenchList 0.05 0.05 Letter 50 50 50 50 detail incidents detail 144 2 139 742 139 2 10 39 725 15 12 Arial 10 bold Parameter Query filter 5 21 5 15 745 15 2
    detail ByUser usr_username detail 28 320 0 230 15 Arial 8 bold detail incdt_summary 65 0 110 15 Arial 8 bold detail crmacct_name 240 0 75 15 Arial 8 bold detail incdt_assigned_username 180 0 50 15 Arial 8 bold detail incdt_status 690 0 50 15 Arial 8 bold detail incdtpriority_name 560 0 75 15 Arial 8 bold detail incdt_timestamp 640 0 50 15 Arial 8 bold detail incdtseverity_name 10 0 60 15 Arial 8 bold detail incdt_number 320 15 430 15 0 Arial 8 bold detail incdt_descrip
    15 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/IndentedBOM.xml000066400000000000000000000401771217451700100210350ustar00rootroot00000000000000 Indented Bill of Materials IndentedBOM Letter 50 50 50 50 head SELECT item_number, uom_name AS item_invuom, item_descrip1, item_descrip2 FROM item, uom WHERE ((item_id=<? value("item_id") ?>) AND (item_inv_uom_id=uom_id)); detail SELECT (REPEAT(' ',(bomdata_bomwork_level-1)*3) || bomdata_bomwork_seqnumber) AS f_seqnumber, bomdata_item_number AS item_number, bomdata_uom_name AS item_invuom, bomdata_item_descrip1 AS item_descrip1, bomdata_item_descrip2 AS item_descrip2, bomdata_issuemethod AS issuemethod, bomdata_createchild AS createchild, formatQtyPer(bomdata_qtyreq) AS qtyreq, formatScrap(bomdata_scrap) AS scrap, CASE WHEN COALESCE(bomdata_effective, startOfTime()) <= startOfTime() THEN <? value("always") ?> ELSE formatDate(bomdata_effective) END AS effective, CASE WHEN COALESCE(bomdata_expires, endOfTime()) >= endOfTime() THEN <? value("never") ?> ELSE formatDate(bomdata_expires) END AS expires FROM indentedBOM(<? value("item_id") ?>,<? value("revision_id") ?>,<? value("expiredDays") ?>,<? value("futureDays") ?>) WHERE (bomdata_item_id>0); bomhead SELECT bomhead_docnum, bomhead_revision, formatDate(bomhead_revisiondate) AS f_revisiondate FROM bomhead WHERE ((bomhead_item_id=<? value("item_id") ?>) AND (bomhead_rev_id=<? value("revision_id") ?>)); 242 100 103 150 20 Arial 10 bold head item_number 100 125 300 20 Arial 10 bold head item_descrip1 580 103 150 20 Arial 10 bold bomhead bomhead_docnum 580 125 150 20 Arial 10 bold bomhead f_revisiondate 5 235 745 235 2 100 145 300 20 Arial 10 bold head item_descrip2 580 145 150 20 Arial 10 bold bomhead bomhead_revision 315 103 150 20 Arial 10 bold head item_invuom 6 36 5 30 745 30 2
    detail detail 53 505 0 75 15 Arial 8 bold detail scrap 665 15 75 15 Arial 8 bold detail issuemethod 585 0 75 15 Arial 8 bold detail effective 110 0 150 15 Arial 8 bold detail item_number 5 45 745 45 0 665 0 75 15 Arial 8 bold detail expires 275 0 50 15 Arial 8 bold detail item_invuom 5 0 103 15 Arial 8 bold detail f_seqnumber 110 30 300 15 Arial 8 bold detail item_descrip2 425 0 75 15 Arial 8 bold detail qtyreq 110 15 300 15 Arial 8 bold detail item_descrip1 585 15 75 15 Arial 8 bold detail createchild
    18 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/IndentedWhereUsed.xml000066400000000000000000000321441217451700100223060ustar00rootroot00000000000000 Indented Where Used IndentedWhereUsed Letter 50 50 50 50 head SELECT item_number, uom_name AS item_invuom, item_descrip1, item_descrip2 FROM item, uom WHERE ((item_id=<? value("item_id") ?>) AND (item_inv_uom_id=uom_id)); detail SELECT (REPEAT(' ',(bomwork_level-1)*3) || bomwork_seqnumber) AS f_seqnumber, bomworkitemsequence(bomwork_id) AS seqord, item_number, uom_name AS item_invuom, item_descrip1, item_descrip2, formatQty(bomwork_qtyfxd) AS qtyfxd, formatQtyPer(bomwork_qtyper) AS qtyper, formatScrap(bomwork_scrap) AS scrap, formatDate(bomwork_effective, 'Always') AS effective, formatDate(bomwork_expires, 'Never') AS expires FROM bomwork, item, uom WHERE ((bomwork_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (bomwork_set_id=<? value("bomworkset_id") ?>) <? if not exists("showExpired") ?> AND (bomwork_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (bomwork_effective <= CURRENT_DATE) <? endif ?> ) ORDER BY seqord; 242 100 145 300 20 Arial 10 bold head item_descrip2 100 125 300 20 Arial 10 bold head item_descrip1 315 103 150 20 Arial 10 bold head item_invuom 5 235 745 235 2 100 103 150 20 Arial 10 bold head item_number 6 36 5 30 745 30 2
    detail detail 52 275 0 50 15 Arial 8 bold detail item_invuom 665 0 75 15 Arial 8 bold detail expires 5 0 103 15 Arial 8 bold detail f_seqnumber 113 15 300 15 Arial 8 bold detail item_descrip1 585 0 75 15 Arial 8 bold detail effective 505 0 75 15 Arial 8 bold detail scrap 113 0 150 15 Arial 8 bold detail item_number 425 0 75 15 Arial 8 bold detail qtyper 113 30 300 15 Arial 8 bold detail item_descrip2 5 45 745 45 0 345 1 75 15 Arial 8 bold detail qtyfxd
    17 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/InventoryAvailability.xml000066400000000000000000000456531217451700100233010ustar00rootroot00000000000000 Inventory Availability InventoryAvailability 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("byDays") ?> (text('Look ahead ') || text(<? value("byDays") ?>) || text(' days')) <? elseif exists("byDate") ?> (text('Cutoff date ') || formatDate(<? value("byDate") ?>)) <? elseif exists("byDates") ?> (text('Dates from ') || formatDate(<? value("startDate") ?>) || text(' to ') || formatDate(<? value("endDate") ?>)) <? else ?> text('Item Site Lead Time') <? endif ?> AS ltcriteria; detail SELECT item_number, item_descrip1, item_descrip2, warehous_code, itemsite_leadtime, formatQty(qtyonhand) AS f_qtyonhand, formatQty(noNeg(qtyonhand - allocated)) AS f_unallocated, formatQty(noNeg(allocated)) AS f_allocated, formatQty(ordered) AS f_ordered, formatQty(requests) AS f_requests, formatQty(reorderlevel) AS f_reorderlevel, (qtyonhand - allocated + ordered) AS available, formatQty(qtyonhand - allocated + ordered) AS f_available FROM (SELECT <? if reExists("[vV]end") ?> DISTINCT <? endif ?> itemsite_id, CASE WHEN (item_type IN ('P', 'O')) THEN 1 WHEN (item_type IN ('M')) THEN 2 ELSE 0 END AS altId, item_number, item_descrip1, item_descrip2, item_inv_uom_id, warehous_id, warehous_code, itemsite_leadtime, itemsite_qtyonhand AS qtyonhand, CASE WHEN itemsite_useparams THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel, CASE WHEN itemsite_useparams THEN itemsite_ordertoqty ELSE 0.0 END AS outlevel, <? if exists("byVend") ?> vend_number, <? else ?> NULL AS vend_number, <? endif ?> <? if exists("byLeadTime") ?> qtyAllocated(itemsite_id, itemsite_leadtime) AS allocated, qtyOrdered(itemsite_id, itemsite_leadtime) AS ordered, qtypr(itemsite_id, itemsite_leadtime) AS requests <? elseif exists("byDays") ?> qtyAllocated(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS allocated, qtyOrdered(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS ordered, qtypr(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS requests <? elseif exists("byDate") ?> qtyAllocated(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS allocated, qtyOrdered(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS ordered, qtypr(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS requests <? elseif exists("byDates") ?> qtyAllocated(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS allocated, qtyOrdered(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS ordered, qtypr(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS requests <? endif ?> FROM item, itemsite, whsinfo <? if reExists("[vV]end") ?> , vendinfo JOIN itemsrc ON (itemsrc_vend_id=vend_id) <? endif ?> WHERE ( (itemsite_active) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? elseif exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>))) <? elseif exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? elseif exists("itemgrp_id") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>))) <? elseif exists("itemgrp_pattern") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ <? value("itemgrp_pattern") ?>) ) )) <? elseif exists("itemgrp") ?> AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem)) <? endif ?> <? if reExists("[vV]end") ?> AND (itemsrc_item_id=item_id) <? endif ?> <? if exists("vend_id") ?> AND (vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> AND (vend_vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> AND (vend_vendtype_id IN (SELECT vendtype_id FROM vendtype WHERE (vendtype_code ~ <? value("vendtype_pattern") ?>))) <? endif ?> ) ) AS data <? if exists("showReorder") ?> WHERE ( ((qtyonhand - allocated + ordered) <= reorderlevel) <? if exists("ignoreReorderAtZero") ?> AND (NOT ( ((qtyonhand - allocated + ordered) = 0) AND (reorderlevel = 0)) ) <? endif ?> ) <? elseif exists("showShortages") ?> WHERE ((qtyonhand - allocated + ordered) < 0) <? endif ?> ORDER BY item_number, warehous_code DESC; 221 5 215 745 215 2 140 43 280 20 Arial 10 bold head ltcriteria 10 63 725 15 12 Arial 10 bold Parameter Query filter 6 36 5 30 745 30 2
    detail detail 56 330 0 100 15 Arial 8 bold detail f_qtyonhand 645 0 100 15 Arial 8 bold detail f_available 65 0 250 15 Arial 8 bold detail item_number 434 0 100 15 Arial 8 bold detail f_allocated 10 15 35 15 Arial 8 bold detail itemsite_leadtime 540 0 100 15 Arial 8 bold detail f_ordered 5 50 745 50 0 65 15 250 15 Arial 8 bold detail item_descrip1 10 0 35 15 Arial 8 bold detail warehous_code 65 30 250 15 Arial 8 bold detail item_descrip2 434 30 100 16 Arial 8 bold detail f_unallocated 540 31 100 12 Arial 8 bold detail f_reorderlevel 540 14 100 15 Arial 8 bold detail f_requests
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/InventoryAvailabilityByCustomerType.xml000066400000000000000000000521431217451700100261500ustar00rootroot00000000000000 Inventory Availability by Customer Type InventoryAvailabilityByCustomerType 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("onlyShowShortages") ?> text('Only Showing Shortages') <? else ?> text('') <? endif ?> AS f_onlyShowShortages, <? if exists("showWoSupply") ?> text('Show W/O Supply') <? else ?> text('') <? endif ?> AS f_showWoSupply, <? if exists("custtype_id") ?> (SELECT custtype_code from custtype where (custtype_id=<? value("custtype_id") ?>)) <? elseif exists("custtype_pattern") ?> <? value("custtype_pattern") ?> <? else ?> text('All Customer Types') <? endif ?> AS f_custtype; detail SELECT itemsite_id, coitem_id, cohead_id, cohead_number, (cust_number||'-'||cust_name) AS custname, item_number, item_description, uom_name, item_picklist, qoh, formatQty(qoh) AS f_qoh,sobalance, formatQty(sobalance) AS f_sobalance, formatQty(allocated) AS f_allocated, ordered, formatQty(ordered) AS f_ordered, (qoh + ordered - sobalance) AS woavail, <? if exists("useReservationNetting") ?> formatQty(coitem_qtyreserved) AS f_soavail, <? else ?> formatQty(qoh + ordered - sobalance) AS f_soavail, <? endif ?> (qoh + ordered - allocated) AS totalavail, formatQty(qoh + ordered - allocated) AS f_totalavail, atshipping,formatQty(atshipping) AS f_atshipping, reorderlevel <? if exists(showWoSupply) ?>, wo_id, wo_status, wo_number, wo_ordered, CASE WHEN (wo_id = -1) THEN NULL ELSE formatQty(wo_ordered) END AS f_wo_ordered, formatdate(wo_startdate) AS f_wo_startdate, formatdate(wo_duedate) AS f_wo_duedate, COALESCE(wo_latestart,false) AS wo_latestart, COALESCE(wo_latedue,false) AS wo_latedue <? endif ?> FROM ( SELECT itemsite_id, coitem_id, cohead_id, cohead_number, cust_number, cust_name, item_number, (item_descrip1 || ' ' || item_descrip2) AS item_description, uom_name, item_picklist, noNeg(itemsite_qtyonhand) AS qoh, noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) AS sobalance, qtyAllocated(itemsite_id, coitem_scheddate) AS allocated, qtyOrdered(itemsite_id, coitem_scheddate) AS ordered, qtyatshipping(coitem_id) AS atshipping, coitem_qtyreserved, CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel <? if exists(showWoSupply) ?>, COALESCE(wo_id,-1) AS wo_id, formatwonumber(wo_id) AS wo_number, noNeg((wo_qtyord-wo_qtyrcv)) AS wo_ordered, wo_status, wo_startdate, wo_duedate, ((wo_startdate <= CURRENT_DATE) AND (wo_status IN ('O','E','S','R'))) AS wo_latestart, (wo_duedate<=CURRENT_DATE) AS wo_latedue <? endif ?> FROM cohead, itemsite, item, uom, custinfo, coitem <? if exists(showWoSupply) ?> LEFT OUTER JOIN wo ON ((coitem_itemsite_id=wo_itemsite_id) AND (wo_status IN ('E','R','I')) AND (wo_qtyord-wo_qtyrcv > 0) AND (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned-qtyatshipping(coitem_id)) > (SELECT itemsite_qtyonhand FROM itemsite WHERE (itemsite_id=coitem_itemsite_id)))) <? endif ?> WHERE((coitem_cohead_id=cohead_id) AND (cohead_cust_id=cust_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (coitem_status NOT IN ('C', 'X')) <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE(custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> ) ) AS data <? if exists(onlyShowShortages) ?> WHERE ( ((qoh + ordered - allocated) < 0) OR ((qoh + ordered - sobalance) < 0) ) <? endif ?> ORDER BY cohead_id, cohead_number, item_number <? if exists(showWoSupply) ?> , wo_duedate <? endif ?> ; 251 360 120 380 20 Arial 10 bold head f_showWoSupply 10 245 750 245 2 140 100 209 20 Arial 10 bold head f_custtype 360 100 380 20 Arial 10 bold head f_onlyShowShortages 6 41 5 35 745 35 2
    detail cohead cohead_id 26 390 0 209 20 Arial 10 bold detail custname 65 0 209 20 Arial 10 bold detail cohead_number 6 5 0 745 0 0 detail 46 640 15 100 15 Arial 8 bold detail f_totalavail 25 30 150 15 Arial 8 bold detail wo_number 535 0 100 15 Arial 8 bold detail f_ordered 10 15 400 15 Arial 8 bold detail Item_description 640 30 100 15 Arial 8 bold detail f_wo_duedate 10 0 150 15 Arial 8 bold detail Item_number 430 0 100 15 Arial 8 bold detail f_sobalance 185 0 75 15 Arial 8 bold detail uom_name 185 30 75 15 Arial 8 bold detail wo_status 640 0 100 15 Arial 8 bold detail f_soavail 430 15 100 15 Arial 8 bold detail f_allocated 430 30 100 15 Arial 8 bold detail f_wo_ordered 325 0 100 15 Arial 8 bold detail f_qoh 535 15 100 15 Arial 8 bold detail f_atshipping 535 30 100 15 Arial 8 bold detail f_wo_startdate
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/InventoryAvailabilityBySalesOrder.xml000066400000000000000000000545651217451700100255620ustar00rootroot00000000000000 Inventory Availability by Sales Order InventoryAvailabilityBySalesOrder Letter 50 50 50 50 head SELECT cohead_number, formatDate(cohead_orderdate) AS orderdate, cohead_custponumber, cust_name, cntct_phone AS cust_phone, <? if exists("onlyShowShortages") ?> text('Only Showing Shortages') <? else ?> text('') <? endif ?> AS f_onlyShowShortages, <? if exists("showWoSupply") ?> text('Show W/O Supply') <? else ?> text('') <? endif ?> AS f_showWoSupply FROM cohead, custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE ((cohead_cust_id=cust_id) AND (cohead_id=<? value("sohead_id") ?>) ); detail SELECT itemsite_id, coitem_id, item_number, item_description, uom_name, item_picklist, qoh, formatQty(qoh) AS f_qoh,sobalance, formatQty(sobalance) AS f_sobalance, formatQty(allocated) AS f_allocated, ordered, formatQty(ordered) AS f_ordered, (qoh + ordered - sobalance) AS woavail, formatQty(qoh + ordered - sobalance) AS f_soavail, (qoh + ordered - allocated) AS totalavail, formatQty(qoh + ordered - allocated) AS f_totalavail, atshipping,formatQty(atshipping) AS f_atshipping, reorderlevel <? if exists(showWoSupply) ?>, wo_id, wo_status, wo_number, wo_ordered, CASE WHEN (wo_id = -1) THEN NULL ELSE formatQty(wo_ordered) END AS f_wo_ordered, formatdate(wo_startdate) AS f_wo_startdate, formatdate(wo_duedate) AS f_wo_duedate, COALESCE(wo_latestart,false) AS wo_latestart, COALESCE(wo_latedue,false) AS wo_latedue <? endif ?> FROM ( SELECT itemsite_id, coitem_id, item_number, (item_descrip1 || ' ' || item_descrip2) AS item_description, uom_name, item_picklist, noNeg(itemsite_qtyonhand) AS qoh, noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) AS sobalance, qtyAllocated(itemsite_id, coitem_scheddate) AS allocated, qtyOrdered(itemsite_id, coitem_scheddate) AS ordered, qtyatshipping(coitem_id) AS atshipping, CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel <? if exists(showWoSupply) ?>, COALESCE(wo_id,-1) AS wo_id, formatwonumber(wo_id) AS wo_number, noNeg((wo_qtyord-wo_qtyrcv)) AS wo_ordered, wo_status, wo_startdate, wo_duedate, ((wo_startdate <= CURRENT_DATE) AND (wo_status IN ('O','E','S','R'))) AS wo_latestart, (wo_duedate<=CURRENT_DATE) AS wo_latedue <? endif ?> FROM cohead, itemsite, item, uom, coitem <? if exists(showWoSupply) ?> LEFT OUTER JOIN wo ON ((coitem_itemsite_id=wo_itemsite_id) AND (wo_status IN ('E','R','I')) AND (wo_qtyord-wo_qtyrcv > 0) AND (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned-qtyatshipping(coitem_id)) > (SELECT itemsite_qtyonhand FROM itemsite WHERE (itemsite_id=coitem_itemsite_id)))) <? endif ?> WHERE ( (coitem_cohead_id=cohead_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (coitem_status NOT IN ('C', 'X')) AND (cohead_id=<? value(sohead_id) ?>)) ) AS data <? if exists(onlyShowShortages) ?> WHERE ( ((qoh + ordered - allocated) < 0) OR ((qoh + ordered - sobalance) < 0) ) <? endif ?> ORDER BY item_number <? if exists(showWoSupply) ?> , wo_duedate <? endif ?> ; 251 385 140 200 20 Arial 10 bold head cohead_custponumber 360 175 380 20 Arial 10 bold head f_showWoSupply 10 245 750 245 2 140 100 125 20 Arial 10 bold head cohead_number 385 100 350 20 Arial 10 bold head cust_name 385 120 350 20 Arial 10 bold head cust_phone 360 160 380 20 Arial 10 bold head f_onlyShowShortages 140 120 125 20 Arial 10 bold head orderdate 6 41 5 35 745 35 2
    detail coitem coitem_id 31 430 15 100 15 Arial 8 bold detail f_allocated 325 0 100 15 Arial 8 bold detail f_qoh 185 0 75 15 Arial 8 bold detail uom_name 640 0 100 15 Arial 8 bold detail f_soavail 535 15 100 15 Arial 8 bold detail f_atshipping 640 15 100 15 Arial 8 bold detail f_totalavail 535 0 100 15 Arial 8 bold detail f_ordered 10 0 150 15 Arial 8 bold detail Item_number 10 15 400 15 Arial 8 bold detail Item_description 430 0 100 15 Arial 8 bold detail f_sobalance 6 5 0 745 0 0 detail 16 535 0 100 15 Arial 8 bold detail f_wo_startdate 25 0 150 15 Arial 8 bold detail wo_number 430 0 100 15 Arial 8 bold detail f_wo_ordered 640 0 100 15 Arial 8 bold detail f_wo_duedate 185 0 75 15 Arial 8 bold detail wo_status
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/InventoryAvailabilityBySourceVendor.xml000066400000000000000000000501401217451700100261160ustar00rootroot00000000000000 Inventory Availability by Source Vendor InventoryAvailabilityBySourceVendor 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("byDays") ?> (text('Look ahead ') || text(<? value("byDays") ?>) || text(' days')) <? elseif exists("byDate") ?> (text('Cutoff date ') || formatDate(<? value("byDate") ?>)) <? elseif exists("byDates") ?> (text('Dates from ') || formatDate(<? value("startDate") ?>) || text(' to ') || formatDate(<? value("endDate") ?>)) <? else ?> text('Item Site Lead Time') <? endif ?> AS ltcriteria detail SELECT item_number, item_descrip1, item_descrip2, warehous_code, vend_number, itemsite_leadtime, formatQty(qtyonhand) AS f_qtyonhand, formatQty(noNeg(qtyonhand - allocated)) AS f_unallocated, formatQty(noNeg(allocated)) AS f_allocated, formatQty(ordered) AS f_ordered, formatQty(reorderlevel) AS f_reorderlevel, formatQty(outlevel) AS f_outlevel, (qtyonhand - allocated + ordered) AS available, formatQty(qtyonhand - allocated + ordered) AS f_available FROM (SELECT <? if reExists("[vV]end") ?> DISTINCT <? endif ?> itemsite_id, CASE WHEN (item_type IN ('P', 'O')) THEN 1 WHEN (item_type IN ('M')) THEN 2 ELSE 0 END AS altId, item_number, item_descrip1, item_descrip2, item_inv_uom_id, warehous_id, warehous_code, itemsite_leadtime, itemsite_qtyonhand AS qtyonhand, CASE WHEN itemsite_useparams THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel, CASE WHEN itemsite_useparams THEN itemsite_ordertoqty ELSE 0.0 END AS outlevel, <? if exists("byVend") ?> vend_number, <? else ?> NULL AS vend_number, <? endif ?> <? if exists("byLeadTime") ?> qtyAllocated(itemsite_id, itemsite_leadtime) AS allocated, qtyOrdered(itemsite_id, itemsite_leadtime) AS ordered, qtypr(itemsite_id, itemsite_leadtime) AS requests <? elseif exists("byDays") ?> qtyAllocated(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS allocated, qtyOrdered(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS ordered, qtypr(itemsite_id, CAST(<? value("byDays") ?> AS INTEGER)) AS requests <? elseif exists("byDate") ?> qtyAllocated(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS allocated, qtyOrdered(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS ordered, qtypr(itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) AS requests <? elseif exists("byDates") ?> qtyAllocated(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS allocated, qtyOrdered(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS ordered, qtypr(itemsite_id, <? value("startDate") ?>, <? value("endDate") ?>) AS requests <? endif ?> FROM item, itemsite, whsinfo <? if reExists("[vV]end") ?> , vendinfo JOIN itemsrc ON (itemsrc_vend_id=vend_id) <? endif ?> WHERE ( (itemsite_active) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? elseif exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>))) <? elseif exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? elseif exists("itemgrp_id") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>))) <? elseif exists("itemgrp_pattern") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ <? value("itemgrp_pattern") ?>) ) )) <? elseif exists("itemgrp") ?> AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem)) <? endif ?> <? if reExists("[vV]end") ?> AND (itemsrc_item_id=item_id) <? endif ?> <? if exists("vend_id") ?> AND (vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> AND (vend_vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> AND (vend_vendtype_id IN (SELECT vendtype_id FROM vendtype WHERE (vendtype_code ~ <? value("vendtype_pattern") ?>))) <? endif ?> ) ) AS data <? if exists("showReorder") ?> WHERE ( ((qtyonhand - allocated + ordered) <= reorderlevel) <? if exists("ignoreReorderAtZero") ?> AND (NOT ( ((qtyonhand - allocated + ordered) = 0) AND (reorderlevel = 0))) <? endif ?> ) <? elseif exists("showShortages") ?> WHERE ((qtyonhand - allocated + ordered) < 0) <? endif ?> ORDER BY vend_number, item_number, warehous_code DESC; 221 5 215 745 215 2 135 43 280 20 Arial 10 bold head ltcriteria 10 63 725 15 12 Arial 10 bold Parameter Query filter 6 36 5 30 745 30 2
    detail detail 56 645 0 100 15 Arial 8 bold detail f_available 330 0 100 15 Arial 8 bold detail f_qtyonhand 160 0 150 15 Arial 8 bold detail item_number 55 0 100 15 Arial 8 bold detail vend_number 540 15 100 15 Arial 8 bold detail f_reorderlevel 645 15 100 15 Arial 8 bold detail f_outlevel 5 15 45 15 Arial 8 bold detail itemsite_leadtime 434 0 100 15 Arial 8 bold detail f_allocated 540 0 100 15 Arial 8 bold detail f_ordered 160 15 250 15 Arial 8 bold detail item_descrip1 160 30 250 15 Arial 8 bold detail item_descrip2 5 50 745 50 0 434 15 100 15 Arial 8 bold detail f_unallocated 5 0 45 15 Arial 8 bold detail warehous_code
    16 705 0 40 15 Arial 8 bold Context Query page_number 85 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/InventoryHistory.xml000066400000000000000000001043771217451700100223270ustar00rootroot00000000000000 Inventory History InventoryHistory 0.05 0.05 Letter 50 50 50 50 detail SELECT invhist_id, invhist_transdate, formatDateTime(invhist_transdate) AS f_transdate, invhist_transtype, whs1.warehous_code AS warehous_code, item_number, item_descrip1, item_descrip2, formatQty(invhist_invqty) AS transqty, (invhist_value_after-invhist_value_before) AS transvalue, formatMoney(invhist_value_after-invhist_value_before) AS f_transvalue, invhist_invuom, CASE WHEN (invhist_ordtype NOT LIKE '') THEN (invhist_ordtype || '-' || invhist_ordnumber) ELSE invhist_ordnumber END AS ordernumber, formatQty(invhist_qoh_before) AS qohbefore, formatQty(invhist_qoh_after) AS qohafter, CASE WHEN (invhist_costmethod='A') THEN <? value("average") ?> WHEN (invhist_costmethod='S') THEN <? value("standard") ?> WHEN (invhist_costmethod='J') THEN <? value("job") ?> WHEN (invhist_costmethod='N') THEN <? value("none") ?> ELSE <? value("unknown") ?> END AS costmethod, formatMoney(invhist_value_before) AS valbefore, formatMoney(invhist_value_after) AS valafter, invhist_user AS username, invhist_posted, 0 AS invdetail_id, '' AS locationname, '' AS detailqty, '' AS locationqtybefore, '' AS locationqtyafter, CASE WHEN (invhist_transtype='TW') THEN whs1.warehous_code WHEN (invhist_transtype='IB') THEN whs1.warehous_code WHEN (invhist_transtype='IM') THEN whs1.warehous_code WHEN (invhist_transtype='IT') THEN whs1.warehous_code WHEN (invhist_transtype='RB') THEN 'WIP' WHEN (invhist_transtype='RM') THEN 'WIP' WHEN (invhist_transtype='RP') THEN 'PURCH' WHEN (invhist_transtype='RR') THEN 'CUST' WHEN (invhist_transtype='RS') THEN 'SHIP' WHEN (invhist_transtype='SH') THEN whs1.warehous_code WHEN (invhist_transtype='SI') THEN whs1.warehous_code WHEN (invhist_transtype='SV') THEN whs1.warehous_code WHEN (invhist_transtype='TR') THEN whs2.warehous_code WHEN (invhist_transtype='TS') THEN whs1.warehous_code ELSE '' END AS locfrom, CASE WHEN (invhist_transtype='TW') THEN whs2.warehous_code WHEN (invhist_transtype='AD') THEN whs1.warehous_code WHEN (invhist_transtype='CC') THEN whs1.warehous_code WHEN (invhist_transtype='IB') THEN 'WIP' WHEN (invhist_transtype='IM') THEN 'WIP' WHEN (invhist_transtype='NN') THEN whs1.warehous_code WHEN (invhist_transtype='RB') THEN whs1.warehous_code WHEN (invhist_transtype='RM') THEN whs1.warehous_code WHEN (invhist_transtype='RP') THEN whs1.warehous_code WHEN (invhist_transtype='RR') THEN whs1.warehous_code WHEN (invhist_transtype='RS') THEN whs1.warehous_code WHEN (invhist_transtype='RT') THEN whs1.warehous_code WHEN (invhist_transtype='RX') THEN whs1.warehous_code WHEN (invhist_transtype='SH') THEN 'SHIP' WHEN (invhist_transtype='SI') THEN 'SCRAP' WHEN (invhist_transtype='SV') THEN 'SHIP' WHEN (invhist_transtype='TR') THEN whs1.warehous_code WHEN (invhist_transtype='TS') THEN whs2.warehous_code ELSE '' END AS locto FROM itemsite, item, whsinfo AS whs1, invhist LEFT OUTER JOIN whsinfo AS whs2 ON (invhist_xfer_warehous_id=whs2.warehous_id) WHERE ( (NOT invhist_hasdetail) AND (invhist_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=whs1.warehous_id) AND (DATE(invhist_transdate) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?> ) AND (transType(invhist_transtype, <? value("transType") ?>)) <? if exists("orderType") ?> AND (invhist_ordtype=<? value("orderType") ?>) <? endif ?> <? if exists("orderNumber") ?> AND (invhist_ordnumber ~ <? value("orderNumber") ?>) <? endif ?> <? if exists("cohead_id") ?> AND (invhist_ordtype='SO') AND (invhist_ordnumber ~ ( SELECT cohead_number FROM cohead WHERE cohead_id=<? value("cohead_id") ?>)) <? endif ?> <? if exists("pohead_id") ?> AND (invhist_ordtype='PO') AND (invhist_ordnumber ~ ( SELECT pohead_number FROM pohead WHERE pohead_id=<? value("pohead_id") ?>)) <? endif ?> <? if exists("tohead_id") ?> AND (invhist_ordtype='TO') AND (invhist_ordnumber ~ ( SELECT tohead_number FROM tohead WHERE tohead_id=<? value("tohead_id") ?>)) <? endif ?> <? if exists("wo_id") ?> AND (invhist_ordtype='WO') AND (invhist_ordnumber ~ formatWoNumber(<? value("wo_id") ?>)) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("item_id") ?> AND (itemsite_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? endif ?> <? if exists("itemgrp_id") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>))) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? endif ?> <? if exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value ("classcode_pattern") ?>))) <? endif ?> <? if exists("itemgrp_pattern") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ <? value ("itemgrp_pattern") ?>)))) <? endif ?> <? if exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> <? if exists("itemgrp") ?> AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem)) <? endif ?> ) UNION SELECT invhist_id, invhist_transdate, formatDateTime(invhist_transdate) AS transdate, invhist_transtype, whs1.warehous_code AS warehous_code, item_number, item_descrip1, item_descrip2, formatQty(invhist_invqty) AS transqty, 0 AS transvalue, formatMoney(invhist_value_after-invhist_value_before) AS f_transvalue, invhist_invuom, CASE WHEN (invhist_ordtype NOT LIKE '') THEN (invhist_ordtype || '-' || invhist_ordnumber) ELSE invhist_ordnumber END AS ordernumber, formatQty(invhist_qoh_before) AS qohbefore, formatQty(invhist_qoh_after) AS qohafter, CASE WHEN(invhist_costmethod='A') THEN text('Average') WHEN(invhist_costmethod='S') THEN text('Standard') WHEN(invhist_costmethod='J') THEN text('Job') WHEN(invhist_costmethod='N') THEN text('None') ELSE 'UNKNOWN' END AS costmethod, formatMoney(invhist_value_before) AS valbefore, formatMoney(invhist_value_after) AS valafter, invhist_user AS username, invhist_posted, invdetail_id, CASE WHEN (invdetail_location_id=-1) THEN formatlotserialnumber(invdetail_ls_id) WHEN (invdetail_ls_id IS NULL) THEN formatLocationName(invdetail_location_id) ELSE (formatLocationName(invdetail_location_id) || '-' || formatlotserialnumber(invdetail_ls_id)) END AS locationname, formatQty(invdetail_qty) AS detailqty, formatQty(invdetail_qty_before) AS locationqtybefore, formatQty(invdetail_qty_after) AS locationqtyafter, CASE WHEN (invhist_transtype='TW') THEN whs1.warehous_code WHEN (invhist_transtype='IB') THEN whs1.warehous_code WHEN (invhist_transtype='IM') THEN whs1.warehous_code WHEN (invhist_transtype='IT') THEN whs1.warehous_code WHEN (invhist_transtype='RB') THEN 'WIP' WHEN (invhist_transtype='RM') THEN 'WIP' WHEN (invhist_transtype='RP') THEN 'PURCH' WHEN (invhist_transtype='RR') THEN 'CUST' WHEN (invhist_transtype='RS') THEN 'SHIP' WHEN (invhist_transtype='SH') THEN whs1.warehous_code WHEN (invhist_transtype='SI') THEN whs1.warehous_code WHEN (invhist_transtype='SV') THEN whs1.warehous_code WHEN (invhist_transtype='TR') THEN whs2.warehous_code WHEN (invhist_transtype='TS') THEN whs1.warehous_code ELSE '' END AS locfrom, CASE WHEN (invhist_transtype='TW') THEN whs2.warehous_code WHEN (invhist_transtype='AD') THEN whs1.warehous_code WHEN (invhist_transtype='CC') THEN whs1.warehous_code WHEN (invhist_transtype='IB') THEN 'WIP' WHEN (invhist_transtype='IM') THEN 'WIP' WHEN (invhist_transtype='NN') THEN whs1.warehous_code WHEN (invhist_transtype='RB') THEN whs1.warehous_code WHEN (invhist_transtype='RM') THEN whs1.warehous_code WHEN (invhist_transtype='RP') THEN whs1.warehous_code WHEN (invhist_transtype='RR') THEN whs1.warehous_code WHEN (invhist_transtype='RS') THEN whs1.warehous_code WHEN (invhist_transtype='RT') THEN whs1.warehous_code WHEN (invhist_transtype='RX') THEN whs1.warehous_code WHEN (invhist_transtype='SH') THEN 'SHIP' WHEN (invhist_transtype='SI') THEN 'SCRAP' WHEN (invhist_transtype='SV') THEN 'SHIP' WHEN (invhist_transtype='TR') THEN whs1.warehous_code WHEN (invhist_transtype='TS') THEN whs2.warehous_code ELSE '' END AS locto FROM itemsite, item, whsinfo AS whs1, invdetail, invhist LEFT OUTER JOIN whsinfo AS whs2 ON (invhist_xfer_warehous_id=whs2.warehous_id) WHERE ((invhist_hasdetail) AND (invhist_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=whs1.warehous_id) AND (invdetail_invhist_id=invhist_id) AND (DATE(invhist_transdate) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?> ) AND (transType(invhist_transtype, <? value("transType") ?>)) <? if exists("orderType") ?> AND (invhist_ordtype=<? value("orderType") ?>) <? endif ?> <? if exists("orderNumber") ?> AND (invhist_ordnumber ~ <? value("orderNumber") ?>) <? endif ?> <? if exists("cohead_id") ?> AND (invhist_ordtype='SO') AND (invhist_ordnumber ~ ( SELECT cohead_number FROM cohead WHERE cohead_id=<? value("cohead_id") ?>)) <? endif ?> <? if exists("pohead_id") ?> AND (invhist_ordtype='PO') AND (invhist_ordnumber ~ ( SELECT pohead_number FROM pohead WHERE pohead_id=<? value("pohead_id") ?>)) <? endif ?> <? if exists("tohead_id") ?> AND (invhist_ordtype='TO') AND (invhist_ordnumber ~ ( SELECT tohead_number FROM tohead WHERE tohead_id=<? value("tohead_id") ?>)) <? endif ?> <? if exists("wo_id") ?> AND (invhist_ordtype='WO') AND (invhist_ordnumber ~ formatWoNumber(<? value("wo_id") ?>)) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("item_id") ?> AND (itemsite_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? endif ?> <? if exists("itemgrp_id") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>))) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? endif ?> <? if exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value ("classcode_pattern") ?>))) <? endif ?> <? if exists("itemgrp_pattern") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ <? value ("itemgrp_pattern") ?>)))) <? endif ?> <? if exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> <? if exists("itemgrp") ?> AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem)) <? endif ?> ); footer SELECT formatMoney(sum(invhist_value_after-invhist_value_before)) AS transvalue_total FROM itemsite, item, whsinfo AS whs1, invhist LEFT OUTER JOIN whsinfo AS whs2 ON (invhist_xfer_warehous_id=whs2.warehous_id) WHERE ( (invhist_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=whs1.warehous_id) AND (DATE(invhist_transdate) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?> ) AND (transType(invhist_transtype, <? value("transType") ?>)) <? if exists("orderType") ?> AND (invhist_ordtype=<? value("orderType") ?>) <? endif ?> <? if exists("orderNumber") ?> AND (invhist_ordnumber ~ <? value("orderNumber") ?>) AND (invhist_ordtype = 'SO') <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("item_id") ?> AND (itemsite_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("itemgrp_id") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>))) <? elseif exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value ("classcode_pattern") ?>))) <? elseif exists("itemgrp_pattern") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ <? value ("itemgrp_pattern") ?>)))) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? elseif exists("itemgrp") ?> AND (item_id IN (SELECT DISTINCT itemgrpitem_item_id FROM itemgrpitem)) <? endif ?> ) 242 5 237 745 237 2 10 37 725 15 12 Arial 10 bold Parameter Query filter 2 51 5 45 745 45 2
    detail invhist_id invhist_id 45 60 0 132 12 Arial 8 bold detail f_transdate 200 0 228 12 Arial 8 bold detail item_number 200 25 228 12 Arial 8 bold detail item_descrip2 660 25 72 12 Arial 8 bold detail valafter 60 12 132 12 Arial 8 bold detail ordernumber 585 0 72 12 Arial 8 bold detail qohbefore 5 0 50 12 Arial 8 bold detail warehous_code 432 0 72 12 Arial 8 bold detail invhist_invuom 60 25 132 12 Arial 8 bold detail username 585 25 72 12 Arial 8 bold detail valbefore 660 12 72 12 Arial 8 bold detail locto 660 0 72 12 Arial 8 bold detail qohafter 5 12 50 12 Arial 8 bold detail invhist_transtype 510 0 72 12 Arial 8 bold detail transqty 585 12 72 12 Arial 8 bold detail locfrom 200 12 228 12 Arial 8 bold detail item_descrip1 510 12 72 12 Arial 8 bold detail costmethod 510 25 72 12 Arial 8 bold detail f_transvalue 9 5 5 745 5 0 detail 16 585 0 72 12 Arial 8 bold detail locationqtybefore 200 0 228 12 Arial 8 bold detail locationname 508 0 72 12 Arial 8 bold detail detailqty 660 0 72 12 Arial 8 bold detail locationqtyafter
    14 705 0 40 12 Arial 8 bold Context Query page_number 90 0 100 12 Arial 8 bold Context Query report_date 20 510 5 72 12 Arial 8 bold footer transvalue_total
    qt-client-4.1.0/share/reports/Invoice.xml000066400000000000000000001314201217451700100203310ustar00rootroot00000000000000 Invoice Invoice With Logo - With Invoice Currency SELECT invchead_id, invchead_invcnumber FROM invchead ORDER BY invchead_invcnumber; Parameter Query watermark 25 0.05 0.05 Letter 50 50 50 50 GroupHead SELECT --Due Date formatDate(determineDueDate(invchead_terms_id, invchead_invcdate)) AS due_date, --Discount Date formatDate(determineDiscountDate(invchead_terms_id, invchead_invcdate)) AS dis_date, --remitto.*, remitto_name, formatAddr(remitto_address1, remitto_address2, remitto_address3, remitto_citystatezip, remitto_country) AS remitto_adr, invchead_invcnumber AS invoicenumber, formatDate(invchead_invcdate) AS f_invoicedate, cust_number, invchead_billto_name, formatAddr(invchead_billto_address1, invchead_billto_address2, invchead_billto_address3, ( invchead_billto_city || ' ' || invchead_billto_state || ' ' || invchead_billto_zipcode ), invchead_billto_country) AS f_billtoaddress, invchead_billto_phone, invchead_shipto_name, formatAddr(invchead_shipto_address1, invchead_shipto_address2, invchead_shipto_address3, ( invchead_shipto_city || ' ' || invchead_shipto_state || ' ' || invchead_shipto_zipcode ), invchead_shipto_country) AS f_shiptoaddress, invchead_ordernumber AS ordernumber, invchead_ponumber, formatDate(invchead_orderdate) AS f_orderdate, formatDate(invchead_shipdate) AS f_shipdate, invchead_fob, terms_descrip, invchead_shipvia FROM remitto, custinfo, invchead, terms WHERE ( (invchead_cust_id=cust_id) AND (invchead_terms_id=terms_id) AND (invchead_id=<? value("invchead_id") ?>) ) ORDER BY ordernumber; Detail SELECT invcitem_linenumber, formatQty(invcitem_billed) AS f_billed, (select uom_name from uom where uom_id = invcitem_qty_uom_id) AS invuom, CASE WHEN (item_number IS NULL) THEN invcitem_number WHEN (invcitem_custpn != '') THEN invcitem_custpn else item_number END AS number, CASE WHEN (item_number IS NULL) THEN invcitem_descrip WHEN (invcitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip1 ELSE item_descrip1 END AS descrip1, CASE WHEN (invcitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip2 ELSE item_descrip2 END AS descrip2, CASE WHEN (<? value("showcosts") ?>=FALSE) THEN '---' ELSE formatPrice(invcitem_qty_invuomratio * invcitem_price / COALESCE(invcitem_price_invuomratio,1)) END AS f_unitprice, CASE WHEN (<? value("showcosts") ?>=FALSE) THEN '---' ELSE formatMoney(round((invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price / COALESCE(invcitem_price_invuomratio,1)),2)) END AS f_extprice, invcitem_notes, getInvcitemLotSerial(invcitem_id) AS lotserial, --Sub-select updated for 3.1 to support kitting characteristicsToString('SI',invcitem_coitem_id, '=', ', ') AS coitem_characteristics FROM invcitem LEFT OUTER JOIN (item JOIN uom ON (item_inv_uom_id=uom_id)) ON (invcitem_item_id=item_id) LEFT OUTER JOIN itemalias ON (itemalias_item_id=item_id AND itemalias_number=invcitem_custpn) WHERE (invcitem_invchead_id=<? value("invchead_id") ?>) ORDER BY invcitem_linenumber; foot SELECT formatMoney(SUM(round((invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price / COALESCE(invcitem_price_invuomratio,1)),2))) AS f_extprice FROM invcitem LEFT OUTER JOIN item on (invcitem_item_id=item_id) WHERE (invcitem_invchead_id=<? value("invchead_id") ?>); GroupExtended SELECT *, formatMoney(invchead_misc_amount) AS f_misc, formatMoney(tax) AS f_tax, formatMoney(invchead_freight) AS f_freight, formatMoney(invchead_payment) AS f_payment, formatMoney(noNeg(invchead_freight + invchead_misc_amount + tax + itemtotal - total_allocated)) AS f_totaldue, formatMoney(noNeg(invchead_freight + invchead_misc_amount + tax + itemtotal - total_allocated)) AS f_netdue, formatMoney(total_allocated) AS f_allocated FROM (SELECT invchead_misc_amount, invchead_freight, invchead_payment, invchead_notes, invchead_misc_descrip, (SELECT COALESCE(SUM(tax),0) FROM ( SELECT ROUND(SUM(taxdetail_tax),2) AS tax FROM tax JOIN calculateTaxDetailSummary('I', <? value("invchead_id") ?>, 'T') ON (taxdetail_tax_id=tax_id) GROUP BY tax_id) AS data) AS tax, SUM(COALESCE(ROUND(invcitem_billed * invcitem_qty_invuomratio * invcitem_price / COALESCE(invcitem_price_invuomratio,1), 2), 0)) AS itemtotal, COALESCE( CASE WHEN invchead_posted THEN (SELECT SUM(COALESCE(currToCurr(arapply_curr_id, t.aropen_curr_id, arapply_applied, t.aropen_docdate), 0)) FROM arapply, aropen s, aropen t WHERE ( (s.aropen_id=arapply_source_aropen_id) AND (arapply_target_aropen_id=t.aropen_id) AND (arapply_target_doctype='I') AND (arapply_target_docnumber=invchead_invcnumber) AND (arapply_reftype='S') AND (arapply_source_aropen_id=s.aropen_id))) ELSE (SELECT SUM(COALESCE(CASE WHEN((aropen_amount - aropen_paid) >= currToCurr(aropenalloc_curr_id, aropen_curr_id, aropenalloc_amount, aropen_docdate)) THEN currToCurr(aropenalloc_curr_id, invchead_curr_id, aropenalloc_amount, aropen_docdate) ELSE currToCurr(aropen_curr_id, invchead_curr_id, aropen_amount - aropen_paid, aropen_docdate) END, 0)) FROM aropenalloc, aropen LEFT OUTER JOIN cohead ON (cohead_number=invchead_ordernumber) WHERE ( (aropenalloc_aropen_id=aropen_id) AND ((aropenalloc_doctype='S' AND aropenalloc_doc_id=cohead_id) OR (aropenalloc_doctype='I' AND aropenalloc_doc_id=invchead_id)) AND ((aropen_amount - aropen_paid) > 0))) END, 0) AS total_allocated FROM invchead LEFT OUTER JOIN invcitem ON (invcitem_invchead_id=invchead_id) WHERE (invchead_id=<? value("invchead_id") ?>) GROUP BY invchead_freight, invchead_misc_amount, tax, invchead_payment, invchead_notes, invchead_misc_descrip, total_allocated ) AS dummy_outer ; allocatedCMs SELECT cohead_id, aropen_docnumber, formatMoney(aropen_amount) AS f_total, formatMoney(aropen_paid) AS f_paid, formatMoney(aropen_amount - aropen_paid) AS f_balance, CASE WHEN((aropen_amount - aropen_paid) >= currToCurr(aropenalloc_curr_id, aropen_curr_id, aropenalloc_amount, aropen_docdate)) THEN currToCurr(aropenalloc_curr_id, aropen_curr_id, aropenalloc_amount, aropen_docdate) ELSE (aropen_amount - aropen_paid) END AS allocated, CASE WHEN((aropen_amount - aropen_paid) >= currToCurr(aropenalloc_curr_id, aropen_curr_id, aropenalloc_amount, aropen_docdate)) THEN formatMoney(currToCurr(aropenalloc_curr_id, aropen_curr_id, aropenalloc_amount, aropen_docdate)) ELSE formatMoney(aropen_amount - aropen_paid) END AS f_allocated, CASE WHEN((aropen_amount - aropen_paid) >= currToCurr(aropenalloc_curr_id, aropen_curr_id, aropenalloc_amount, aropen_docdate)) THEN currToCurr(aropenalloc_curr_id, invchead_curr_id, aropenalloc_amount, aropen_docdate) ELSE currToCurr(aropen_curr_id, invchead_curr_id, aropen_amount - aropen_paid, aropen_docdate) END AS allocated_invccurr, CASE WHEN((aropen_amount - aropen_paid) >= currToCurr(aropenalloc_curr_id, aropen_curr_id, aropenalloc_amount, aropen_docdate)) THEN formatMoney(currToCurr(aropenalloc_curr_id, invchead_curr_id, aropenalloc_amount, aropen_docdate)) ELSE formatMoney(currToCurr(aropen_curr_id, invchead_curr_id, aropen_amount - aropen_paid, aropen_docdate)) END AS f_allocated_invccurr, curr_symbol AS aropen_currsymbol FROM invchead LEFT OUTER JOIN cohead ON (cohead_number=invchead_ordernumber) JOIN aropenalloc ON ((aropenalloc_doctype='S' AND aropenalloc_doc_id=cohead_id) OR (aropenalloc_doctype='I' AND aropenalloc_doc_id=invchead_id)) JOIN aropen ON (aropenalloc_aropen_id=aropen_id) JOIN curr_symbol ON (aropen_curr_id=curr_id) WHERE ((aropen_amount - aropen_paid) > 0) AND (NOT invchead_posted) AND (invchead_id=<? value("invchead_id") ?>) UNION SELECT cohead_id, arapply_source_docnumber AS aropen_docnumber, formatMoney(s.aropen_amount) AS f_total, formatMoney(s.aropen_paid - currToCurr(arapply_curr_id, s.aropen_curr_id, arapply_applied, arapply_postdate)) AS f_paid, formatMoney(s.aropen_amount - s.aropen_paid + currToCurr(arapply_curr_id, s.aropen_curr_id, arapply_applied, arapply_postdate)) AS f_balance, currToCurr(arapply_curr_id, s.aropen_curr_id, arapply_applied, arapply_postdate) AS allocated, formatMoney(currToCurr(arapply_curr_id, s.aropen_curr_id, arapply_applied, arapply_postdate)) AS f_allocated, currToCurr(arapply_curr_id, invchead_curr_id, arapply_applied, t.aropen_docdate) AS allocated_invccurr, formatMoney(currToCurr(arapply_curr_id, invchead_curr_id, arapply_applied, t.aropen_docdate)) AS f_allocated_invccurr, curr_symbol AS aropen_currsymbol FROM arapply, aropen s, aropen t, cohead, invchead, curr_symbol WHERE ( (s.aropen_id=arapply_source_aropen_id) AND (arapply_target_aropen_id=t.aropen_id) AND (arapply_target_doctype='I') AND (arapply_target_docnumber=invchead_invcnumber) AND (arapply_source_aropen_id=s.aropen_id) AND (arapply_curr_id=curr_id) AND (arapply_reftype='S') AND (cohead_number=invchead_ordernumber) AND (invchead_posted) AND (invchead_id=<? value("invchead_id") ?>) ) ORDER BY aropen_docnumber; currency SELECT currConcat(curr_id) AS currConcat, curr_symbol FROM invchead, curr_symbol WHERE (invchead_id = <? value("invchead_id") ?>) AND (invchead_curr_id = curr_id); logo SELECT image_data FROM image WHERE ((image_name='logo')); tracknum select formatdate(shiphead_shipdate) AS f_shipdate, shiphead_tracknum, shiphead_shipvia from cohead, shiphead, invchead where cohead_id = shiphead_order_id and shiphead_order_type = 'SO' and cohead_number = invchead_ordernumber and invchead_id = <? value("invchead_id") ?> order by shiphead_shipdate; 360 215 5 270 111 stretch logo image_data 430 220 300 20 0 Arial 12 normal GroupHead f_shiptoaddress 129 140 111 20 Sans Serif 10 normal GroupHead invoicenumber 430 200 300 20 Luciduxsans 12 48 GroupHead invchead_shipto_name 55 200 270 20 Luciduxsans 12 48 GroupHead invchead_billto_name 5 5 200 20 Arial 10 bold GroupHead remitto_name 140 125 100 20 Sans Serif 10 normal GroupHead ordernumber 120 155 120 20 Arial 10 normal GroupHead invchead_ponumber 650 100 95 20 Sans Serif 10 normal GroupHead f_orderdate 95 170 145 20 Sans Serif 10 normal GroupHead cust_number 5 25 203 16 10 Arial 10 normal GroupHead remitto_adr 55 220 300 20 0 Arial 12 normal GroupHead f_billtoaddress 5 350 745 350 2 555 115 190 20 Sans Serif 10 normal GroupHead invchead_fob 620 40 125 20 Sans Serif 10 normal GroupHead f_invoicedate 620 55 125 20 Sans Serif 10 normal GroupHead due_date 615 70 130 20 Sans Serif 10 normal GroupHead dis_date 545 85 200 20 Sans Serif 8 normal GroupHead terms_descrip
    tracknumber tracknum shiphead_shipdate 41 40 35 745 35 0 12 40 5 745 5 0 tracknum 21 160 0 225 20 Sans Serif 10 normal tracknum shiphead_shipvia 390 0 280 20 Sans Serif 10 normal tracknum shiphead_tracknum 40 0 100 20 Sans Serif 10 normal tracknum f_shipdate
    ColumnHeadings GroupHead 41 490 10 71 20 Arial 10 normal currency currConcat 40 35 745 35 2
    items Detail 93 25 5 120 20 Arial 10 normal Detail f_billed 260 45 480 14 Arial 8 normal Detail coitem_characteristics 440 70 365 14 0 Arial 8 normal Detail lotserial 171 5 80 20 Arial 10 normal Detail invuom 492 5 31 20 Arial 10 normal currency curr_symbol 645 5 100 20 Arial 10 normal Detail f_extprice 260 35 300 11 Arial 8 normal Detail descrip2 540 5 100 20 Arial 10 normal Detail f_unitprice 70 70 365 14 0 Arial 8 normal Detail invcitem_notes 260 5 220 20 Arial 10 normal Detail number 260 25 300 11 Arial 8 normal Detail descrip1
    allocatedCMs unnamed cohead_id 41 45 35 750 35 0 45 0 750 0 0 21 600 0 31 20 Arial 10 normal currency curr_symbol 640 0 100 20 Arial 10 normal allocatedCMs allocated_invccurr extprice allocatedCMs 21 140 0 40 20 Arial 10 normal allocatedCMs aropen_currsymbol 640 0 100 20 Arial 10 normal allocatedCMs f_allocated_invccurr 590 0 590 30 0 280 0 90 20 Arial 10 normal allocatedCMs f_paid 180 0 90 20 Arial 10 normal allocatedCMs f_total 480 0 100 20 Arial 10 normal allocatedCMs f_allocated 600 0 31 20 Arial 10 normal currency curr_symbol 40 0 90 20 Arial 10 normal allocatedCMs aropen_docnumber 380 0 90 20 Arial 10 normal allocatedCMs f_balance
    167 605 5 31 20 Arial 10 normal currency curr_symbol 640 25 100 20 Arial 10 normal GroupExtended f_freight 20 25 540 20 Arial 10 normal GroupExtended invchead_notes 605 85 31 20 Arial 10 normal currency curr_symbol 605 25 31 20 Arial 10 normal currency curr_symbol 640 103 100 20 Arial 10 normal GroupExtended f_totaldue 640 5 100 20 Arial 10 normal foot f_extprice 605 103 31 20 Arial 10 normal currency curr_symbol 640 45 100 20 Arial 10 normal GroupExtended f_misc 640 85 100 20 Arial 10 normal GroupExtended f_allocated 640 65 100 20 Arial 10 normal GroupExtended f_tax 605 45 31 20 Arial 10 normal currency curr_symbol 605 65 31 20 Arial 10 normal currency curr_symbol 5 5 745 5 2 325 145 20 20 Sans Serif 10 normal Context Query page_number 20 45 540 20 Arial 10 normal GroupExtended invchead_misc_descrip 27 330 0 20 20 Sans Serif 10 normal Context Query page_number
    qt-client-4.1.0/share/reports/InvoiceInformation.xml000066400000000000000000000434201217451700100225410ustar00rootroot00000000000000 Invoice Information InvoiceInformation Parameter Query watermark 25 Letter 50 50 50 50 GroupHead SELECT invchead_id, invchead_ponumber, formatDate(invchead_shipdate) AS f_shipdate, formatDate(invchead_invcdate) AS f_invcdate, formatMoney(invoiceTotal(invchead_id)) AS f_amount, invchead_billto_name, invchead_billto_address1, invchead_billto_address2, invchead_billto_address3, ( invchead_billto_city || ' ' || invchead_billto_state || ', ' || invchead_billto_zipcode ) AS billtocitystatezip, invchead_shipto_name, invchead_shipto_address1, invchead_shipto_address2, invchead_shipto_address3, ( invchead_shipto_city || ' ' || invchead_shipto_state || ', ' || invchead_shipto_zipcode ) AS shiptocitystatezip, invchead_notes, invchead_invcnumber FROM invchead LEFT OUTER JOIN (invcitem LEFT OUTER JOIN item ON (invcitem_item_id=item_id) ) ON (invcitem_invchead_id=invchead_id) WHERE (invchead_id=<? value("invchead_id") ?>) GROUP BY invchead_id, invchead_ponumber, invchead_shipdate, invchead_invcdate, invchead_misc_amount, invchead_freight, invchead_billto_name, invchead_billto_address1, invchead_billto_address2, invchead_billto_address3, invchead_billto_city, invchead_billto_state, invchead_billto_zipcode, invchead_shipto_name, invchead_shipto_address1, invchead_shipto_address2, invchead_shipto_address3, invchead_shipto_city, invchead_shipto_state, invchead_shipto_zipcode, invchead_notes, invchead_invcnumber; CustInfo SELECT cust_id, cust_number, cust_name, addr_line1 AS cust_address1, addr_line2 AS cust_address2, addr_line3 AS cust_address3, addr_city || ' ' || addr_state || ', ' || addr_postalcode AS custcitystatezip FROM invchead, custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE ( (invchead_id=<? value("invchead_id") ?>) AND (invchead_cust_id=cust_id) ); Details SELECT 1 as grpnum, arapply_id, CASE WHEN (arapply_source_doctype = 'C') THEN text('C/M') WHEN (arapply_fundstype='C') THEN text('Check') WHEN (arapply_fundstype='T') THEN text('Certified Check') WHEN (arapply_fundstype='M') THEN text('Master Card') WHEN (arapply_fundstype='V') THEN text('Visa') WHEN (arapply_fundstype='A') THEN text('American Express') WHEN (arapply_fundstype='D') THEN text('Discover Card') WHEN (arapply_fundstype='R') THEN text('Other Credit Card') WHEN (arapply_fundstype='K') THEN text('Cash') WHEN (arapply_fundstype='W') THEN text('Wire Transfer') WHEN (arapply_fundstype='O') THEN text('Other') END AS documenttype, CASE WHEN (arapply_source_doctype = 'C') THEN arapply_source_docnumber WHEN (arapply_source_doctype = 'R') THEN arapply_source_docnumber WHEN (arapply_source_doctype = 'K') THEN arapply_refnumber ELSE text('Error') END AS docnumber, formatDate(arapply_postdate) AS f_postdate, formatMoney(arapply_applied) AS f_amount FROM arapply, invchead WHERE ( (arapply_target_doctype='I') AND (arapply_target_docnumber=invchead_invcnumber) AND (invchead_id=<? value("invchead_id") ?>) ) ORDER BY arapply_postdate; 389 590 80 125 20 Arial 12 bold GroupHead f_invcdate 155 140 300 20 Arial 10 bold CustInfo cust_address2 155 80 125 20 Arial 12 bold CustInfo cust_number 25 280 300 20 Arial 10 bold GroupHead invchead_billto_address2 155 120 300 20 Arial 10 bold CustInfo cust_address1 590 125 125 20 Arial 12 bold GroupHead f_amount 25 240 300 20 Arial 10 bold GroupHead invchead_billto_name 155 25 125 20 Arial 12 bold GroupHead invchead_invcnumber 155 160 300 20 Arial 10 bold CustInfo cust_address3 155 100 300 20 Arial 12 bold CustInfo cust_name 155 180 300 20 Arial 10 bold CustInfo custcitystatezip 25 320 325 20 Arial 10 bold GroupHead billtocitystatezip 385 320 325 20 Arial 10 bold GroupHead shiptocitystatezip 385 300 300 20 Arial 10 bold GroupHead invchead_shipto_address3 385 280 300 20 Arial 10 bold GroupHead invchead_shipto_address2 155 50 125 20 Arial 12 bold GroupHead invchead_ponumber 385 240 300 20 Arial 10 bold GroupHead invchead_shipto_name 20 365 690 20 0 Arial 10 bold GroupHead invchead_notes 25 300 300 20 Arial 10 bold GroupHead invchead_billto_address3 385 260 300 20 Arial 10 bold GroupHead invchead_shipto_address1 25 260 300 20 Arial 10 bold GroupHead invchead_billto_address1 590 100 125 20 Arial 12 bold GroupHead f_shipdate
    details header grpnum 47 5 40 745 40 2 Details 17 645 0 100 15 Arial 8 normal Details f_amount 110 0 425 15 Arial 8 normal Details docnumber 5 0 100 15 Arial 8 normal Details documenttype 540 0 100 15 Arial 8 normal Details f_postdate
    17 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/InvoiceRegister.xml000066400000000000000000000364321217451700100220450ustar00rootroot00000000000000 Invoice Register InvoiceRegister Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("accnt_id") ?> ( SELECT (accnt_number || '-' || accnt_descrip) FROM accnt WHERE (accnt_id=<? value("accnt_id") ?>) ) <? else ?> text('All Accounts') <? endif ?> AS accnt detail SELECT gltrans_id, formatDate(gltrans_date) AS transdate, gltrans_source, CASE WHEN(gltrans_doctype='IN') THEN text('Invoice') WHEN(gltrans_doctype='CM') THEN text('Credit Memo') WHEN(gltrans_doctype='DM') THEN text('Debit Memo') WHEN(gltrans_doctype='CD') THEN text('Customer Deposit') ELSE gltrans_doctype END AS doctype, gltrans_docnumber, CASE WHEN(gltrans_doctype='IN') THEN (SELECT invchead_shipto_name FROM aropen LEFT OUTER JOIN invchead ON (invchead_id=aropen_cobmisc_id AND invchead_cust_id=aropen_cust_id) WHERE ((aropen_docnumber=gltrans_docnumber) AND (aropen_doctype='I'))) ELSE firstLine(gltrans_notes) END AS transnotes, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, CASE WHEN (gltrans_amount < 0) THEN formatMoney(ABS(gltrans_amount)) ELSE '' END AS f_debit, CASE WHEN (gltrans_amount < 0) THEN ABS(gltrans_amount) ELSE 0 END AS debit, CASE WHEN (gltrans_amount > 0) THEN formatMoney(gltrans_amount) ELSE '' END AS f_credit, CASE WHEN (gltrans_amount > 0) THEN gltrans_amount ELSE 0 END AS credit FROM gltrans, accnt WHERE ((gltrans_accnt_id=accnt_id) AND (gltrans_doctype IN ('IN', 'CM', 'DM', 'CD')) AND (gltrans_source = 'A/R') AND (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("accnt_id") ?> AND (gltrans_accnt_id=<? value("accnt_id") ?>) <? endif ?> ) ORDER BY gltrans_date, gltrans_docnumber; 205 545 70 200 20 Arial 10 bold head startdate 140 70 290 20 Arial 10 bold head accnt 545 90 200 20 Arial 10 bold head enddate 5 200 745 200 2 6 41 5 35 745 35 2
    detail bydate transdate 21 10 0 80 15 Arial 8 bold detail transdate 21 509 0 80 15 Arial 8 bold detail debit money 600 0 80 15 Arial 8 bold detail credit money 5 15 745 15 1 detail 31 95 0 60 15 Arial 8 bold detail gltrans_source 160 15 80 15 Arial 8 bold detail gltrans_docnumber 160 0 80 15 Arial 8 bold detail doctype 509 15 80 15 Arial 8 bold detail f_debit 245 15 260 15 Arial 8 bold detail account 600 15 80 15 Arial 8 bold detail f_credit 245 0 260 15 Arial 8 bold detail transnotes
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date 21 600 0 80 15 Arial 8 bold detail credit money 509 0 80 15 Arial 8 bold detail debit money
    qt-client-4.1.0/share/reports/ItemCostDetail.xml000066400000000000000000000413751217451700100216200ustar00rootroot00000000000000 Item Costs Detail ItemCostDetail 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, costelem_type, <? if exists("standardCost") ?> text('Standard Cost') <? else ?> text('Actual Cost') <? endif ?> AS costtype FROM item, costelem WHERE((item_id=<? value("item_id") ?>) AND (costelem_id=<? value("costelem_id") ?>)); detail SELECT seqnumber, item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdescrip, uom_name, formatQtyper(qtyper) AS f_qtyper, formatScrap(bomitem_scrap) AS f_scrap, formatCost(cost) AS f_cost, formatCost(extendedcost) AS f_extendedcost, extendedcost FROM ( SELECT bomitem_seqnumber AS seqnumber, itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper) AS qtyper, bomitem_scrap, item_number, item_descrip1, item_descrip2, uom_name, <? if exists("standardCost") ?> itemcost_stdcost AS cost, (itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper * (1 + bomitem_scrap)) * itemcost_stdcost) AS extendedcost <? else ?> currToBase(itemcost_curr_id, itemcost_actcost, NULL) AS cost, (itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper * (1 + bomitem_scrap)) * currToBase(itemcost_curr_id, itemcost_actcost, NULL)) AS extendedcost <? endif ?> FROM bomitem, item, itemcost, costelem, uom WHERE((bomitem_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (CURRENT_DATE BETWEEN bomitem_effective AND (bomitem_expires-1)) AND (itemcost_item_id=item_id) AND (itemcost_costelem_id=costelem_id) AND (SELECT item_type!='C' FROM item WHERE item_id=<? value("item_id") ?>) AND (bomitem_parent_item_id=<? value("item_id") ?>) AND (costelem_id=<? value("costelem_id") ?>) ) ) AS data UNION SELECT seqnumber, item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdescrip, uom_name, formatQtyPer(bbomitem_qtyper) AS f_qtyper, formatScrap(bbomitem_costabsorb) AS f_scrap, formatCost(cost) AS f_cost, formatCost(extendedcost) AS f_extendedcost, extendedcost FROM ( SELECT bbomitem_seqnumber AS seqnumber, bbomitem_qtyper, bbomitem_costabsorb, item_number, item_descrip1, item_descrip2, uom_name, <? if exists("standardCost") ?> itemcost_stdcost AS cost, (itemcost_stdcost / bbomitem_qtyper * bbomitem_costabsorb) AS extendedcost <? else ?> currToBase(itemcost_curr_id, itemcost_actcost, NULL) AS cost, (currToBase(itemcost_curr_id, itemcost_actcost, NULL) / bbomitem_qtyper * bbomitem_costabsorb) AS extendedcost <? endif ?> FROM bbomitem, item, itemcost, uom WHERE((bbomitem_parent_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (CURRENT_DATE BETWEEN bbomitem_effective AND (bbomitem_expires-1)) AND (itemcost_item_id=bbomitem_parent_item_id) AND (itemcost_costelem_id=<? value("costelem_id") ?>) AND (SELECT item_type='C' FROM item WHERE item_id=<? value("item_id") ?>) AND (bbomitem_item_id=<? value("item_id") ?>) ) UNION SELECT source.bbomitem_seqnumber AS seqnumber, source.bbomitem_qtyper, target.bbomitem_costabsorb, item_number, item_descrip1, item_descrip2, uom_name, <? if exists("standardCost") ?> itemcost_stdcost AS cost, (itemcost_stdcost * source.bbomitem_qtyper / target.bbomitem_qtyper * target.bbomitem_costabsorb) AS extendedcost <? else ?> currToBase(itemcost_curr_id, itemcost_actcost, NULL) AS cost, (currToBase(itemcost_curr_id, itemcost_actcost, NULL) * source.bbomitem_qtyper / target.bbomitem_qtyper * target.bbomitem_costabsorb) AS extendedcost <? endif ?> FROM item, itemcost, bbomitem AS target, bbomitem AS source, uom WHERE ( (source.bbomitem_parent_item_id=target.bbomitem_parent_item_id) AND (CURRENT_DATE BETWEEN source.bbomitem_effective AND (source.bbomitem_expires-1)) AND (CURRENT_DATE BETWEEN target.bbomitem_effective AND (target.bbomitem_expires-1)) AND (source.bbomitem_item_id=itemcost_item_id) AND (source.bbomitem_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (item_type='Y') AND (SELECT item_type='C' FROM item WHERE item_id=<? value("item_id") ?>) AND (target.bbomitem_item_id=<? value("item_id") ?>) AND (itemcost_costelem_id=<? value("costelem_id") ?>) ) ) AS data ORDER BY seqnumber; 223 490 80 200 20 Arial 10 bold head costelem_type 5 215 745 215 2 100 80 200 20 Arial 10 bold head item_number 100 120 300 20 Arial 10 bold head item_descrip2 490 100 200 20 Arial 10 bold head costtype 100 100 300 20 Arial 10 bold head item_descrip1 6 28 5 20 745 20 2
    detail detail 18 220 0 185 15 Arial 8 bold detail itemdescrip 494 0 80 15 Arial 8 bold detail f_scrap 60 0 100 15 Arial 8 bold detail item_number 165 0 50 15 Arial 8 bold detail uom_name 5 0 50 15 Arial 8 bold detail seqnumber 410 0 80 15 Arial 8 bold detail f_qtyper 580 0 80 15 Arial 8 bold detail f_cost 665 0 80 15 Arial 8 bold detail f_extendedcost
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 18 660 0 85 15 Arial 8 bold detail extendedcost qty
    qt-client-4.1.0/share/reports/ItemCostHistory.xml000066400000000000000000000242461217451700100220550ustar00rootroot00000000000000 Item Costs History ItemCostHistory Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2 FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT costhist_id, costelem_type as f_element, formatBoolYN(costhist_lowlevel) as f_lower, CASE WHEN costhist_type='A' THEN 'Actual' WHEN costhist_type='S' THEN 'Standard' WHEN costhist_type='D' THEN 'Delete' WHEN costhist_type='N' THEN 'New' END as f_type, formatDateTime(costhist_date) as f_time, costhist_username as f_user, formatCost(costhist_oldcost) as f_oldcost, formatCost(costhist_newcost) as f_newcost FROM costhist, costelem WHERE ((costhist_costelem_id=costelem_id) AND (costhist_item_id=<? value("item_id") ?>) ) ORDER BY costhist_date, costelem_type; 221 5 215 745 215 2 100 100 300 20 Arial 10 bold head item_descrip1 100 120 300 20 Arial 10 bold head item_descrip2 100 80 200 20 Arial 10 bold head item_number 6 26 5 20 745 20 2
    detail detail 16 50 0 150 15 Arial 8 bold detail f_element 470 0 100 15 Arial 8 bold detail f_user 245 0 45 15 Arial 8 bold detail f_lower 295 0 70 15 Arial 8 bold detail f_type 575 0 85 15 Arial 8 bold detail f_oldcost 365 0 100 15 Arial 8 bold detail f_time 665 0 80 15 Arial 8 bold detail f_newcost
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ItemCostSummary.xml000066400000000000000000000246751217451700100220570ustar00rootroot00000000000000 Item Costs Summary ItemCostSummary 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2 FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT itemcost_id, CASE WHEN (costelem_sys) THEN 1 ELSE 0 END, costelem_type as f_element, formatBoolYN(itemcost_lowlevel) as f_lower, formatCost(itemcost_stdcost) as f_stdcost, formatDate(itemcost_posted, 'Never') as f_posted, formatcost(currToBase(itemcost_curr_id, itemcost_actcost, NULL)) as f_actcost, formatDate(itemcost_updated, 'Never') as f_updated, itemcost_stdcost AS stdcost, currToBase(itemcost_curr_id, itemcost_actcost, NULL) AS actcost FROM itemcost, costelem WHERE ((itemcost_costelem_id=costelem_id) AND (itemcost_item_id=<? value("item_id") ?>) ) ORDER BY itemcost_lowlevel, costelem_type; 221 100 80 200 20 Arial 10 bold head item_number 100 120 300 20 Arial 10 bold head item_descrip2 5 215 745 215 2 100 100 300 20 Arial 10 bold head item_descrip1 6 26 5 20 745 20 2
    detail detail 16 330 0 75 15 Arial 8 bold detail f_stdcost 50 0 150 15 Arial 8 bold detail f_element 580 0 80 15 Arial 8 bold detail f_updated 280 0 45 15 Arial 8 bold detail f_lower 409 0 75 15 Arial 8 bold detail f_posted 490 0 85 15 Arial 8 bold detail f_actcost
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 16 490 0 85 15 Arial 8 bold detail actcost price 330 0 75 15 Arial 8 bold detail stdcost price
    qt-client-4.1.0/share/reports/ItemCostsByClassCode.xml000066400000000000000000000236511217451700100227310ustar00rootroot00000000000000 Item Costs By Class Code ItemCostsByClassCode Letter 50 50 50 50 head SELECT <? if exists("classcode_id") ?> ( SELECT (classcode_code || '-' || classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) <? else ?> text('All Class Codes') <? endif ?> AS classcode; detail SELECT item_id, item_number, item_descrip1, item_descrip2, uom_name as f_uom, formatCost(scost) as f_stdcost, formatCost(acost) as f_actcost, classcode_code FROM ( SELECT item_id, item_number, item_descrip1, item_descrip2, uom_name, stdcost(item_id) AS scost, actcost(item_id) AS acost, classcode_code FROM item, classcode, uom WHERE ((item_classcode_id=classcode_id) AND (item_inv_uom_id=uom_id) <? if exists("classcode_id") ?> AND (classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (classcode_code ~ <? value("classcode_pattern") ?>) <? endif ?> ) ) AS data WHERE ( (true) <? if exists("onlyShowZeroCosts") ?> AND ((scost=0) OR (acost=0)) <? endif ?> <? if exists("onlyShowDiffCosts") ?> AND (scost != acost) <? endif ?> ) ORDER BY item_number 234 5 228 745 228 2 120 120 565 20 Arial 10 bold head classcode 6 36 5 30 745 30 2
    detail detail 51 400 0 100 15 Arial 8 bold detail f_uom 500 0 100 15 Arial 8 bold detail f_stdcost 5 45 745 45 0 5 0 55 15 Arial 8 bold detail classcode_code 70 0 228 15 Arial 8 bold detail item_number 70 30 228 15 Arial 8 bold detail item_descrip2 70 15 228 15 Arial 8 bold detail item_descrip1 600 0 100 15 Arial 8 bold detail f_actcost
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ItemMaster.xml000066400000000000000000000716641217451700100210240ustar00rootroot00000000000000 Item Master ItemMaster Letter 50 50 50 50 head SELECT item_number, formatBoolYN(item_active) AS f_item_active, item_descrip1, item_descrip2, CASE WHEN(item_type='P') THEN 'Purchased' WHEN(item_type='M') THEN 'Manufactured' WHEN(item_type='J') THEN 'Job' WHEN(item_type='F') THEN 'Phantom' WHEN(item_type='B') THEN 'Breeder' WHEN(item_type='C') THEN 'Co-Product' WHEN(item_type='Y') THEN 'By-Product' WHEN(item_type='R') THEN 'Reference' WHEN(item_type='T') THEN 'Tooling' WHEN(item_type='O') THEN 'Outside Process' WHEN(item_type='K') THEN 'Kit' ELSE item_type END AS f_item_type, formatBoolYN(item_config) AS f_item_config, (classcode_code||' - '||classcode_descrip) AS f_classcode, CASE WHEN (COALESCE(freightclass_id, -1) <> -1) THEN (freightclass_code||' - '||freightclass_descrip) END AS f_freightclass, iuom.uom_name AS invuom, formatBoolYN(item_picklist) AS f_item_picklist, formatBoolYN(item_fractional) AS f_item_fractional, itemcapuom(item_id) AS capuom, itemaltcapuom(item_id) AS altcapuom, puom.uom_name AS shipuom, formatUOMRatio(itemcapinvrat(item_id)) AS f_capinvrat, formatUOMRatio(itemaltcapinvrat(item_id)) AS f_altcapinvrat, formatUOMRatio(iteminvpricerat(item_id)) AS f_shipinvrat, formatWeight(item_prodweight) AS f_item_prodweight, formatWeight(item_packweight) AS f_item_packweight, formatBoolYN(item_sold) AS f_item_sold FROM item JOIN classcode ON (classcode_id=item_classcode_id) JOIN uom iuom ON (iuom.uom_id=item_inv_uom_id) JOIN uom puom ON (puom.uom_id=item_price_uom_id) LEFT OUTER JOIN freightclass ON (freightclass_id=item_freightclass_id) WHERE (item_id=<? value("item_id") ?>) ; sold SELECT uom_name, formatUOMRatio(iteminvpricerat(item_id)) AS f_iteminvpricerat, (prodcat_code||' - '||prodcat_descrip) AS f_prodcat, formatBoolYN(item_exclusive) AS f_item_exclusive, formatPrice(item_listprice) AS f_item_listprice, formatExtPrice(item_listprice / iteminvpricerat(item_id)) AS f_extprice FROM item, prodcat, uom WHERE ((item_id=<? value("item_id") ?>) AND (item_price_uom_id=uom_id) AND (item_sold) AND (item_prodcat_id=prodcat_id) ); notes SELECT item_comments, item_extdescrip FROM item WHERE (item_id=<? value("item_id") ?>); itemchar SELECT 1 as one, char_name as charass_name, charass_value FROM charass, char WHERE ((charass_target_type='I') AND (charass_char_id=char_id) AND (charass_target_id=<? value("item_id") ?>)) ORDER BY char_name; imglist SELECT 1 as one, image_name, firstLine(image_descrip) as f_descrip, CASE WHEN (imageass_purpose='I') THEN 'Inventory Description' WHEN (imageass_purpose='P') THEN 'Product Description' WHEN (imageass_purpose='E') THEN 'Engineering Reference' WHEN (imageass_purpose='M') THEN 'Miscellaneous' ELSE 'Other' END as f_purpose FROM imageass, image WHERE ( (imageass_image_id=image_id) AND (imageass_source='I') AND (imageass_source_id=<? value("item_id") ?>) ) ORDER BY image_name; comments SELECT 1 as one, formatDate(comment_date) as f_date, comment_user, comment_text FROM comment WHERE ( (comment_source='I') AND (comment_source_id=<? value("item_id") ?>) ) ORDER BY comment_date; 333 135 310 100 20 Arial 10 bold head f_item_sold 465 252 100 20 Arial 10 bold head f_shipinvrat 505 135 100 20 Arial 10 bold head f_item_config 505 155 225 20 Arial 10 bold head f_freightclass 135 227 100 20 Arial 10 bold head altcapuom 390 285 100 20 Arial 10 bold head f_item_packweight 465 207 100 20 Arial 10 bold head f_capinvrat 135 102 400 20 Arial 10 bold head item_descrip2 135 155 200 20 Arial 10 bold head f_classcode 135 135 200 20 Arial 10 bold head f_item_type 135 65 300 20 Arial 10 bold head item_number 135 185 100 20 Arial 10 bold head invuom 465 227 100 20 Arial 10 bold head f_altcapinvrat 135 252 100 20 Arial 10 bold head shipuom 135 285 100 20 Arial 10 bold head f_item_prodweight 135 207 100 20 Arial 10 bold head capuom 135 85 400 20 Arial 10 bold head item_descrip1 565 65 100 20 Arial 10 bold head f_item_active 590 185 100 20 Arial 10 bold head f_item_fractional 370 185 100 20 Arial 10 bold head f_item_picklist
    sold sold 93 207 45 200 20 Arial 10 bold sold f_item_listprice 640 45 100 20 Arial 10 bold sold f_item_exclusive 207 25 300 20 Arial 10 bold sold f_prodcat 545 5 100 20 Arial 10 bold sold f_iteminvpricerat 207 65 200 20 Arial 10 bold sold f_extprice 207 5 100 20 Arial 10 bold sold uom_name
    notes notes 36 120 5 615 20 5 Arial 10 bold notes item_comments
    extdescrip notes 36 120 5 615 20 5 Arial 10 bold notes item_extdescrip
    itemchar itemchar one 57 120 50 690 50 0 itemchar 21 300 0 385 15 Arial 8 bold itemchar charass_value 125 0 160 15 Arial 8 bold itemchar charass_name
    imglist imglist one 57 120 50 690 50 0 imglist 21 565 0 130 15 Arial 8 bold imglist f_purpose 125 0 120 15 Arial 8 bold imglist image_name 250 0 315 15 Arial 8 bold imglist f_descrip
    comments comments one 57 120 50 690 50 0 comments 21 315 0 370 15 5 Arial 8 bold comments comment_text 207 0 100 15 Arial 8 bold comments comment_user 125 0 80 15 Arial 8 bold comments f_date
    21 102 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ItemSites.xml000066400000000000000000000726751217451700100206630ustar00rootroot00000000000000 Item Sites ItemSites 0.05 0.05 Letter 50 50 50 50 detail SELECT warehous_code, formatBoolYN(itemsite_active) AS active, item_number, item_descrip1, item_descrip2, formatBoolYN(itemsite_wosupply) AS supplied, formatBoolYN(itemsite_sold) AS sold, itemsite_soldranking, formatBoolYN(itemsite_stocked) AS stocked, formatBoolYN(itemsite_createpr) AS createpr, CASE WHEN (itemsite_controlmethod='N') THEN 'None' WHEN (itemsite_controlmethod='R') THEN 'Regular' WHEN (itemsite_controlmethod='L') THEN 'Lot #' WHEN (itemsite_controlmethod='S') THEN 'Serial #' ELSE '?' END AS controlmethod, formatBoolYN(itemsite_loccntrl) AS locationcontrol, CASE WHEN (itemsite_location_id=-1) THEN 'None' ELSE ( SELECT location_name FROM location WHERE (location_id=itemsite_location_id) ) END AS defaultlocation, formatBoolYN(itemsite_useparams) AS enforceparams, formatBoolYN(itemsite_useparamsmanual) AS onmanualorders, formatQty(itemsite_reorderlevel) AS reorderlevel, formatQty(itemsite_ordertoqty) AS orderupto, formatQty(itemsite_multordqty) AS ordermult, formatQty(itemsite_safetystock) AS safetystock, itemsite_abcclass, itemsite_cyclecountfreq, itemsite_leadtime, itemsite_eventfence, formatQty(itemsite_qtyonhand) AS qoh, formatDate(itemsite_datelastused, 'Never') AS lastused, formatDate(itemsite_datelastcount, 'Never') AS lastcounted, CASE WHEN(itemsite_plancode_id=-1) THEN 'Error' ELSE (SELECT (plancode_code || '-' || plancode_name) FROM plancode WHERE (plancode_id=itemsite_plancode_id) ) END AS plannercode FROM item, uom, itemsite, whsinfo WHERE ((itemsite_warehous_id=warehous_id) AND (itemsite_item_id=item_id) AND(item_inv_uom_id=uom_id) <? if exists("search_pattern") ?> AND ((item_number ~* <? value("search_pattern") ?>) OR (item_descrip1 || ' ' || item_descrip2 ~* <? value("search_pattern") ?>) OR (warehous_code ~* <? value("search_pattern") ?>)) <? endif ?> <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? endif ?> <? if exists("itemgrp_id") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>))) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? endif ?> <? if exists("costcat_id") ?> AND (itemsite_costcat_id=<? value("costcat_id") ?>) <? endif ?> <? if exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>))) <? endif ?> <? if exists("itemgrp_pattern") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ <? value("itemgrp_pattern") ?>) ) )) <? endif ?> <? if exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> <? if exists("costcat_pattern") ?> AND (itemsite_costcat_id IN (SELECT costcat_id FROM costcat WHERE (costcat_code ~ <? value("costcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if not exists("showInactive") ?> AND (itemsite_active) <? endif ?> ) ORDER BY item_number, warehous_code; 281 5 275 745 275 2 10 38 725 15 12 Arial 10 bold Parameter Query filter 6 81 5 75 745 75 2
    detail detail 81 580 15 80 15 Arial 8 bold detail orderupto 490 0 85 15 Arial 8 bold detail enforceparams 10 0 35 15 Arial 8 bold detail warehous_code 260 60 80 15 Arial 8 bold detail qoh 430 60 80 15 Arial 8 bold detail lastcounted 580 45 80 15 Arial 8 bold detail safetystock 580 0 80 15 Arial 8 bold detail reorderlevel 409 0 75 15 Arial 8 bold detail controlmethod 50 0 229 15 Arial 8 bold detail item_number 280 0 45 15 Arial 8 bold detail supplied 330 0 75 15 Arial 8 bold detail createpr 280 30 45 15 Arial 8 bold detail stocked 330 15 75 15 Arial 8 bold detail itemsite_soldranking 409 30 75 15 Arial 8 bold detail defaultlocation 409 15 75 15 Arial 8 bold detail locationcontrol 10 15 35 15 Arial 8 bold detail active 5 75 745 75 0 670 15 55 15 Arial 8 bold detail itemsite_cyclecountfreq 280 15 45 15 Arial 8 bold detail sold 50 30 229 15 Arial 8 bold detail item_descrip2 670 0 55 15 Arial 8 bold detail itemsite_abcclass 50 15 229 15 Arial 8 bold detail item_descrip1 490 15 85 15 Arial 8 bold detail onmanualorders 50 45 150 15 Arial 8 bold detail plannercode 345 60 80 15 Arial 8 bold detail lastused 670 45 55 15 Arial 8 bold detail itemsite_eventfence 580 30 80 15 Arial 8 bold detail ordermult 670 30 55 15 Arial 8 bold detail itemsite_leadtime
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ItemSources.xml000066400000000000000000000231431217451700100212010ustar00rootroot00000000000000 Item Sources ItemSources 0.05 0.05 Letter 50 50 50 50 detail SELECT item_number, vend_name, item_descrip1, item_descrip2, uom_name, itemsrc_vend_item_number as f_venditem, itemsrc_vend_uom as f_venduom, formatQty(itemsrc_invvendoruomratio) as f_uomratio FROM itemsrc, vendinfo, item, uom WHERE ((itemsrc_vend_id=vend_id) AND (itemsrc_item_id=item_id) AND (item_inv_uom_id=uom_id) <? if exists("item_id") ?> AND (itemsrc_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("vend_id") ?> AND (itemsrc_vend_id=<? value("vend_id") ?>) <? endif ?> ) ORDER By item_number, vend_name; 221 5 215 745 215 2 15 38 725 15 12 Arial 10 bold Parameter Query filter 6 36 5 30 745 30 2
    detail detail 56 435 2 50 15 Arial 8 bold detail uom_name 695 2 50 15 Arial 8 bold detail f_uomratio 230 2 200 15 Arial 8 bold detail item_number 640 2 50 15 Arial 8 bold detail f_venduom 230 32 400 15 Arial 8 bold detail item_descrip2 230 17 400 15 Arial 8 bold detail item_descrip1 5 50 745 50 0 485 2 150 15 Arial 8 bold detail f_venditem 5 2 215 15 Arial 8 bold detail vend_name
    16 705 0 40 15 Arial 8 bold Context Query page_number 85 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/JobCosting.xml000066400000000000000000000216421217451700100210020ustar00rootroot00000000000000 Job Costing JobCosting Letter 50 50 50 50 head SELECT formatwonumber(<? value("wo_id") ?>) AS wonumber; detail manufacture jobcosting 141 0 135 740 135 2 120 70 200 20 Arial 10 bold head wonumber 9 29 5 20 745 20 2
    detail detail 21 0 20 740 20 0 630 0 29 15 Arial 8 bold detail uom 80 0 219 15 Arial 8 bold detail code 305 0 229 15 Arial 8 bold detail descrip 15 0 55 15 Arial 8 bold detail type 540 0 75 15 Arial 8 bold detail qty qty 666 0 84 15 Arial 8 bold detail cost cost
    21 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date 18 670 0 75 15 Arial 8 bold detail cost cost
    qt-client-4.1.0/share/reports/Journals.xml000066400000000000000000000446011217451700100205360ustar00rootroot00000000000000 Journals Journals 0.05 0.05 Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("source") ?> text(<? value("source") ?>) <? else ?> text('All Sources') <? endif ?> AS source, <? if exists("accnt_id") ?> ( SELECT (accnt_number || '-' || accnt_descrip) FROM accnt WHERE (accnt_id=<? value("accnt_id") ?>) ) <? else ?> text('All Accounts') <? endif ?> AS accnt, <? if exists("showUsernames") ?> text('Username') <? else ?> text('') <? endif ?> AS f_username detail SELECT sltrans_id, sltrans_created, formatDate(sltrans_date) AS transdate, sltrans_source, sltrans_doctype, sltrans_docnumber, invhist_docnumber, firstLine(sltrans_notes) AS transnotes, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, -- Debits: CASE WHEN (sltrans_amount < 0) THEN formatMoney(ABS(sltrans_amount)) ELSE '' END AS f_debit, CASE WHEN (sltrans_amount < 0) THEN ABS(sltrans_amount) ELSE 0 END AS debit_amt, --Credits: CASE WHEN (sltrans_amount > 0) THEN formatMoney(sltrans_amount) ELSE '' END AS f_credit, CASE WHEN (sltrans_amount > 0) THEN sltrans_amount ELSE 0 END AS credit_amt, --Balance: sltrans_amount * -1 as balance_amt, -- sltrans_amount, CASE WHEN accnt_type IN ('A','E') THEN sltrans_amount * -1 ELSE sltrans_amount END AS running, formatBoolYN(sltrans_posted) AS f_posted, sltrans_username AS f_username, sltrans_sequence FROM sltrans JOIN accnt ON (sltrans_accnt_id=accnt_id) LEFT OUTER JOIN invhist ON (sltrans_misc_id=invhist_id AND sltrans_docnumber='Misc.') <? if exists("company_id") ?> JOIN company ON (accnt_company=company_number) <? endif ?> <? if exists("prfcntr_id") ?> JOIN prftcntr ON (accnt_profit=prftcntr_number) <? endif ?> <? if exists("subaccnt_id") ?> JOIN subaccnt ON (accnt_sub=subaccnt_number) <? endif ?> <? if exists("subType") ?> JOIN subaccnttype ON (subaccnttype_code=accnt_subaccnttype_code) <? endif ?> WHERE ( <? if exists("startDate") ?> <? if exists("endDate") ?> (sltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> (sltrans_date BETWEEN <? value("startDate") ?> AND endoftime()) <? endif ?> <? else ?> <? if exists("endDate") ?> (sltrans_date BETWEEN startoftime() AND <? value("endDate") ?>) <? else ?> (sltrans_date BETWEEN startoftime() AND endoftime()) <? endif ?> <? endif ?> <? if exists("company_id") ?> AND (company_id=<? value("company_id") ?>) <? endif ?> <? if exists("prfcntr_id") ?> AND (prftcntr_id=<? value("prfcntr_id") ?>) <? endif ?> <? if exists("accnt_number") ?> AND (accnt_number=<? value("accnt_number") ?>) <? endif ?> <? if exists("subaccnt_id") ?> AND (subaccnt_id=<? value("subaccnt_id") ?>) <? endif ?> <? if exists("subType") ?> AND (subaccnttype_id=<? value("subType") ?>) <? endif ?> <? if exists("accntType") ?> AND (accnt_type= <? value("accntType") ?>) <? endif ?> <? if exists("accnt_id") ?> AND (sltrans_accnt_id=<? value("accnt_id") ?>) <? endif ?> <? if exists("docnum") ?> AND (sltrans_docnumber = case when <? value("docnum") ?> = '' then sltrans_docnumber else <? value("docnum") ?> end ) <? endif ?> <? if exists("source") ?> AND (sltrans_source=<? value("source") ?>) <? endif ?> <? if exists("source_pattern") ?> AND (sltrans_source ~* <? value("source_pattern") ?>) <? endif ?> <? if exists("journalnumber") ?> AND (sltrans_gltrans_journalnumber=<? value("journalnumber") ?>) <? endif ?> <? if exists("posted") ?> AND (sltrans_posted=<? value("posted") ?>) <? endif ?> ) ORDER BY sltrans_created, sltrans_sequence, sltrans_amount; 205 0 200 1000 200 2 10 40 725 15 12 Arial 10 bold Parameter Query filter 5 45 0 40 1000 40 2
    detail detail 31 882.19 -0.890523 50 15 Arial 8 bold detail f_username 790.907 -0.890523 80 15 Arial 8 bold detail f_credit 240 15 265 15 Arial 8 bold detail transnotes 954.846 -0.891 42.1539 15 Arial 8 bold detail f_posted 12500 0 80 15 Arial 8 bold detail gltrans_doctype 125 0 50 15 Arial 8 bold detail sltrans_doctype 0 0 60 15 Arial 8 bold detail transdate 180 15 50 15 Arial 8 bold detail invhist_docnumber 180 0 50 15 Arial 8 bold detail sltrans_docnumber 681.65 -0.890523 80 15 Arial 8 bold detail f_debit 240 0 270 15 Arial 8 bold detail account 65 0 60 15 Arial 8 bold detail sltrans_source
    75 765.907 8.08006 105 14 Arial 8 bold detail credit_amt money 632.141 5.07044 1000 5 2 960 60 40 15 Arial 8 bold Context Query page_number 90 60 100 15 Arial 8 bold Context Query report_date 656.65 8.08006 105 14 Arial 8 bold detail debit_amt money 15 90 0 100 15 Arial 8 bold Context Query report_date 960 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ListOpenSalesOrders.xml000066400000000000000000000167471217451700100226570ustar00rootroot00000000000000 List Open Sales Orders ListOpenSalesOrders 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT DISTINCT cohead.*, COALESCE(cust_number, :error) AS cust_number, getSoSchedDate(cohead_id) AS scheddate, formatDate(cohead_orderdate) AS f_orderdate FROM cohead JOIN custinfo ON (cohead_cust_id=cust_id) <? if exists("selectedSites") ?> JOIN coitem ON (coitem_cohead_id=cohead_id) JOIN itemsite ON (coitem_itemsite_id=itemsite_id) JOIN site() ON (itemsite_warehous_id=warehous_id) <? else ?> LEFT OUTER JOIN coitem ON (coitem_cohead_id=cohead_id) LEFT OUTER JOIN itemsite ON (coitem_itemsite_id=itemsite_id) LEFT OUTER JOIN site() ON (itemsite_warehous_id=warehous_id) <? endif ?> WHERE((true) <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?> ) <? endif ?> <? if not exists("showClosed") ?> AND ((coitem_status = 'O') OR (coitem_status IS NULL)) <? endif ?> <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY cohead_number 173 4 168 744 168 2 10 43 725 15 12 Arial 10 bold Parameter Query filter 6 21 5 15 745 15 2
    detail detail 16 95 0 325 15 Arial 8 bold detail cohead_billtoname 425 0 150 15 Arial 8 bold detail cohead_custponumber 580 0 100 15 Arial 8 bold detail f_orderdate 5 0 85 15 Arial 8 bold detail cohead_number
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ListTransferOrders.xml000066400000000000000000000312671217451700100225440ustar00rootroot00000000000000 List Transfer Orders ListTransferOrders Letter 50 50 50 50 head SELECT <? if exists("src_warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("src_warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS src_warehous_code, <? if exists("dest_warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("dest_warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS dest_warehous_code, CASE WHEN (<? value ("tohead_status") ?>='C') THEN 'Closed' WHEN (<? value ("tohead_status") ?>='O') THEN 'Open' ELSE text('All Statuses') END AS status; detail SELECT tohead_number, tohead_srcname, tohead_trnsname, tohead_destname, formatDate(tohead_orderdate) AS f_orderdate, formatDate(MIN(toitem_schedshipdate)) AS f_scheddate, formatDate(DATE(MAX(shipitem_shipdate))) AS f_shipdate, CASE WHEN (tohead_status='C') THEN 'Closed' WHEN (tohead_status='O') THEN 'Open' ELSE tohead_status END AS status FROM tohead, toitem LEFT OUTER JOIN (shipitem JOIN shiphead ON (shipitem_shiphead_id=shiphead_id AND shiphead_order_type='TO') ) ON (shipitem_orderitem_id=toitem_id) WHERE ((toitem_tohead_id=tohead_id) AND (toitem_status<>'X') <? if exists("tohead_status") ?> AND (tohead_status=<? value("tohead_status") ?>) <? elseif exists("excludeClosed") ?> AND (tohead_status <> 'C') <? endif ?> <? if exists("src_warehous_id") ?> AND (tohead_src_warehous_id=<? value("src_warehous_id") ?>) <? endif ?> <? if exists("dest_warehous_id") ?> AND (tohead_dest_warehous_id=<? value("dest_warehous_id") ?>) <? endif ?> ) GROUP BY tohead_number, tohead_srcname, tohead_trnsname, tohead_destname, tohead_orderdate, tohead_status ORDER BY tohead_number; 221 5 215 745 215 2 140 150 100 20 Arial 10 bold head status 140 105 200 20 Arial 10 bold head src_warehous_code 140 130 200 20 Arial 10 bold head dest_warehous_code 5 21 5 15 745 15 2
    detail detail 15 5 0 85 15 Arial 8 bold detail tohead_number 600 0 100 11 Arial 8 bold detail f_shipdate 200 0 95 11 Arial 8 bold detail tohead_trnsname 300 0 95 11 Arial 8 bold detail tohead_destname 95 0 100 15 Arial 8 bold detail tohead_srcname 500 0 100 11 Arial 8 normal detail f_scheddate 400 0 100 11 Arial 8 bold detail f_orderdate 700 0 50 11 Arial 8 bold detail status
    15 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/LocationDispatchList.xml000066400000000000000000000116641217451700100230300ustar00rootroot00000000000000 Location Dispatch List LocationDispatchList Letter 50 50 50 50 head SELECT warehous_code FROM whsinfo WHERE (warehous_id=%1); detail SELECT formatLocationBarcode(location_id) AS barcode, formatLocationIssueBarcode(location_id) AS issuebarcode, formatLocationContentsBarcode(location_id) AS contentsbarcode, location_name, firstLine(location_descrip) AS description FROM location WHERE (location_id IN (%2)) ORDER BY location_name; 131 5 125 985 125 2 510 35 80 20 Arial 12 bold head warehous_code
    detail detail location_name detail 71 15 5 125 20 Arial 10 normal detail location_name 335 30 280 25 128 20 detail contentsbarcode 5 30 280 25 128 20 detail barcode 670 30 280 25 128 20 detail issuebarcode 170 5 275 20 Arial 10 normal detail description 5 65 985 65 0
    qt-client-4.1.0/share/reports/MaterialUsageVarianceByBOMItem.xml000066400000000000000000000420201217451700100245760ustar00rootroot00000000000000 Material Usage Variance By BOM Item MaterialUsageVarianceByBOMItem Letter 50 50 50 50 head SELECT parent.item_number AS parent_number, parent.item_descrip1 AS parent_descrip1, parent.item_descrip2 AS parent_descrip2, puom.uom_name AS parent_invuom, child.item_number AS comp_number, child.item_descrip1 AS comp_descrip1, child.item_descrip2 AS comp_descrip2, cuom.uom_name AS comp_invuom, bomitem_seqnumber as comp_seqnumber, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse FROM item as parent, item as child, uom AS puom, uom AS cuom, bomitem WHERE ((parent.item_id=<? value("item_id") ?>) AND (parent.item_inv_uom_id=puom.uom_id) AND (bomitem_item_id=child.item_id) AND (child.item_inv_uom_id=cuom.uom_id) AND (bomitem_id=<? value("bomitem_id") ?>) ); detail SELECT formatDate(posted) AS f_posted, formatQty(ordered) AS f_ordered, formatQty(received) AS f_produced, formatQty(projreq) AS f_projreq, formatQtyPer(projqtyper) AS f_projqtyper, formatQty(actiss) AS f_actiss, formatQtyPer(actqtyper) AS f_actqtyper, formatQtyPer(actqtyper - projqtyper) AS f_qtypervar, CASE WHEN (actqtyper=projqtyper) THEN formatPrcnt(0) WHEN (projqtyper=0) THEN formatPrcnt(actqtyper) ELSE formatPrcnt((1 - (actqtyper / projqtyper)) * -1) END AS f_percent FROM ( SELECT womatlvar_posted AS posted, womatlvar_qtyord AS ordered, womatlvar_qtyrcv AS received, (womatlvar_qtyrcv * (womatlvar_qtyper * (1 + womatlvar_scrap))) AS projreq, womatlvar_qtyper AS projqtyper, (womatlvar_qtyiss) AS actiss, (womatlvar_qtyiss / (womatlvar_qtyrcv * (1 + womatlvar_scrap))) AS actqtyper FROM womatlvar, itemsite AS component, itemsite AS parent WHERE ((womatlvar_parent_itemsite_id=parent.itemsite_id) AND (womatlvar_component_itemsite_id=component.itemsite_id) AND (womatlvar_bomitem_id=<? value("bomitem_id") ?>) AND (womatlvar_posted BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("warehous_id") ?> AND (component.itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ) AS data ORDER BY posted; 237 80 140 50 20 Arial 10 bold head comp_seqnumber 5 227 745 227 2 140 180 200 20 Arial 10 bold head warehouse 360 60 150 20 Arial 10 bold head parent_invuom 140 60 150 20 Arial 10 bold head parent_number 360 120 150 20 Arial 10 bold head comp_invuom 140 80 350 20 Arial 10 bold head parent_descrip1 140 120 150 20 Arial 10 bold head comp_number 140 160 350 20 Arial 10 bold head comp_descrip2 140 140 350 20 Arial 10 bold head comp_descrip1 140 100 350 20 Arial 10 bold head parent_descrip2 7 22 5 15 745 15 2
    detail detail 17 250 0 80 15 Arial 8 bold detail f_projreq 665 0 80 15 Arial 8 bold detail f_percent 165 0 80 15 Arial 8 bold detail f_produced 85 0 80 15 Arial 8 bold detail f_ordered 415 0 80 15 Arial 8 bold detail f_actiss 5 0 75 15 Arial 8 bold detail f_posted 330 0 80 15 Arial 8 bold detail f_projqtyper 493 0 80 15 Arial 8 bold detail f_actqtyper 580 0 80 15 Arial 8 bold detail f_qtypervar
    17 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/MaterialUsageVarianceByComponentItem.xml000066400000000000000000000376211217451700100261360ustar00rootroot00000000000000 Material Usage Variance By Component Item MaterialUsageVarianceByComponentItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, uom_name, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("component_item_id") ?>); detail workOrderVariance material 234 120 120 350 20 Arial 10 bold head item_descrip2 590 120 150 20 Arial 10 bold head enddate 5 228 745 228 2 120 80 150 20 Arial 10 bold head item_number 340 80 150 20 Arial 10 bold head uom_name 120 100 350 20 Arial 10 bold head item_descrip1 120 145 200 20 Arial 10 bold head warehouse 590 100 150 20 Arial 10 bold head startdate 6 36 5 30 745 30 2
    detail detail 51 580 15 80 15 Arial 8 bold detail f_actqtyper 85 15 400 15 Arial 8 bold detail parentdescrip 5 0 75 15 Arial 8 bold detail f_posted 494 15 80 15 Arial 8 bold detail f_projqtyper 5 45 745 45 0 494 0 80 15 Arial 8 bold detail f_projreq 580 0 80 15 Arial 8 bold detail f_actiss 315 0 80 15 Arial 8 bold detail f_ordered 665 15 80 15 Arial 8 bold detail f_qtypervarpercent 400 0 80 15 Arial 8 bold detail f_received 85 0 150 15 Arial 8 bold detail parentitemnumber 665 0 80 15 Arial 8 bold detail f_qtypervar
    16 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/MaterialUsageVarianceByItem.xml000066400000000000000000000375641217451700100242610ustar00rootroot00000000000000 Material Usage Variance By Item MaterialUsageVarianceByItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, uom_name, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("item_id") ?>); detail workOrderVariance material 234 5 228 745 228 2 605 90 120 20 Arial 10 bold head startdate 605 110 120 20 Arial 10 bold head enddate 360 90 120 20 Arial 10 bold head uom_name 140 130 350 20 Arial 10 bold head item_descrip2 140 110 350 20 Arial 10 bold head item_descrip1 140 155 200 20 Arial 10 bold head warehouse 140 90 150 20 Arial 10 bold head item_number 6 36 5 30 745 30 2
    detail detail 51 85 15 395 15 Arial 8 bold detail componentdescrip 580 15 80 15 Arial 8 bold detail f_actqtyper 494 15 80 15 Arial 8 bold detail f_projqtyper 5 45 745 45 0 400 0 80 15 Arial 8 bold detail f_received 665 15 80 15 Arial 8 bold detail f_qtypervarpercent 85 0 150 15 Arial 8 bold detail componentitemnumber 494 0 80 15 Arial 8 bold detail f_projreq 5 0 75 15 Arial 8 bold detail f_posted 665 0 80 15 Arial 8 bold detail f_qtypervar 580 0 80 15 Arial 8 bold detail f_actiss 315 0 80 15 Arial 8 bold detail f_ordered
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/MaterialUsageVarianceByWarehouse.xml000066400000000000000000000372451217451700100253210ustar00rootroot00000000000000 Material Usage Variance By Site MaterialUsageVarianceByWarehouse Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail workOrderVariance material 234 490 130 200 20 Arial 10 bold head enddate 140 110 200 20 Arial 10 bold head warehouse 490 110 200 20 Arial 10 bold head startdate 5 228 745 228 2 6 36 5 30 745 30 2
    detail detail 51 520 0 75 15 Arial 8 bold detail f_projreq 85 15 175 15 Arial 8 bold detail parentdescrip 595 15 75 15 Arial 8 bold detail f_actqtyper 444 0 75 15 Arial 8 bold detail f_ordered 265 15 175 15 Arial 8 bold detail componentdescrip 595 0 75 15 Arial 8 bold detail f_actiss 670 15 75 15 Arial 8 bold detail f_qtypervarpercent 265 0 175 15 Arial 8 bold detail componentitemnumber 670 0 75 15 Arial 8 bold detail f_qtypervar 85 0 175 15 Arial 8 bold detail parentitemnumber 444 15 75 15 Arial 8 bold detail f_received 5 0 75 15 Arial 8 bold detail f_posted 5 45 745 45 0 520 15 75 15 Arial 8 bold detail f_projqtyper
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/MaterialUsageVarianceByWorkOrder.xml000066400000000000000000000373001217451700100252650ustar00rootroot00000000000000 Material Usage Variance By Work Order MaterialUsageVarianceByWorkOrder Letter 50 50 50 50 head SELECT formatWONumber(wo_id) AS wonumber, warehous_code, item_number, uom_name, item_descrip1, item_descrip2, wo_status FROM wo, itemsite, item, whsinfo, uom WHERE ((wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (wo_id=<? value("wo_id") ?>)) detail workOrderVariance material 234 140 140 350 20 Arial 10 bold head item_descrip2 5 228 745 228 2 140 120 350 20 Arial 10 bold head item_descrip1 140 100 150 20 Arial 10 bold head item_number 360 70 200 20 Arial 10 bold head warehous_code 140 70 150 20 Arial 10 bold head wonumber 140 165 200 20 Arial 10 bold head wo_status 360 100 150 20 Arial 10 bold head uom_name 6 36 5 30 745 30 2
    detail detail 51 580 0 80 15 Arial 8 bold detail f_actiss 85 15 375 15 Arial 8 bold detail componentdescrip 85 0 150 15 Arial 8 bold detail componentitemnumber 400 0 80 15 Arial 8 bold detail f_received 665 15 80 15 Arial 8 bold detail f_qtypervarpercent 494 0 80 15 Arial 8 bold detail f_projreq 315 0 80 15 Arial 8 bold detail f_ordered 580 15 80 15 Arial 8 bold detail f_actqtyper 5 0 75 15 Arial 8 bold detail f_posted 494 15 80 15 Arial 8 bold detail f_projqtyper 665 0 80 15 Arial 8 bold detail f_qtypervar 5 45 745 45 0
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/MetaSQLMasterList.xml000066400000000000000000000063371217451700100222230ustar00rootroot00000000000000 List of MetaSQL statements MetaSQLMasterList 0.05 0.05 Letter 100 100 100 100 Detail metasqls detail 100
    Detail Detail 27.4992 100 0 100 12.5 Arial 9 bold Detail metasql_group 200 0 150 12.5 Arial 9 bold Detail metasql_name 350 0 300 14 12 Arial 9 normal Detail metasql_notes_qttooltiprole 0 0 100 12.5 Arial 9 bold Detail pkgname
    65.9806 330 22.5008 100 25 Arial 10 normal Context Query page_count 200 22.5008 100 25 Arial 10 normal Context Query page_number
    qt-client-4.1.0/share/reports/OpenWorkOrdersWithClosedParentSalesOrders.xml000066400000000000000000000316221217451700100271720ustar00rootroot00000000000000 Open Work Orders With Closed Parent Sales Orders OpenWorkOrdersWithClosedParentSalesOrders Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT formatWONumber(wo_id) AS wonumber, wo_status, item_number, uom_name, item_descrip1, item_descrip2, warehous_code, cohead_number, formatQty(wo_qtyord) AS qtyord, formatQty(wo_qtyrcv) AS qtyrcv, formatDate(wo_startdate) AS startdate, formatDate(wo_duedate) AS duedate FROM coitem, cohead, wo, itemsite, whsinfo, item, uom WHERE ((coitem_cohead_id=cohead_id) AND (coitem_order_id=wo_id) AND (coitem_status='C') AND (wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (wo_status IN ('O', 'E', 'R', 'I')) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY wo_duedate; 236 5 229 745 229 2 140 110 200 20 Arial 10 bold head warehouse 6 36 5 30 745 30 2
    detail detail 51 265 0 40 15 Arial 8 bold detail warehous_code 85 30 300 15 Arial 8 bold detail item_descrip2 5 0 75 15 Arial 8 bold detail wonumber 85 0 175 15 Arial 8 bold detail item_number 405 0 80 15 Arial 8 bold detail qtyord 580 0 80 15 Arial 8 bold detail startdate 315 0 75 15 Arial 8 bold detail cohead_number 85 15 300 15 Arial 8 bold detail item_descrip1 5 15 75 15 Arial 8 bold detail wo_status 665 0 80 15 Arial 8 bold detail duedate 5 45 745 45 0 490 0 80 15 Arial 8 bold detail qtyrcv
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/OpenWorkOrdersWithParentSalesOrders.xml000066400000000000000000000316021217451700100260360ustar00rootroot00000000000000 Open Work Orders With Parent Sales Orders OpenWorkOrdersWithParentSalesOrders Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT formatWONumber(wo_id) AS wonumber, wo_status, item_number, uom_name, item_descrip1, item_descrip2, warehous_code, cohead_number, formatQty(wo_qtyord) AS qtyord, formatQty(wo_qtyrcv) AS qtyrcv, formatDate(wo_startdate) AS startdate, formatDate(wo_duedate) AS duedate FROM coitem, cohead, wo, itemsite, whsinfo, item, uom WHERE ((coitem_cohead_id=cohead_id) AND (coitem_order_id=wo_id) AND (coitem_status<>'X') AND (wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (wo_status IN ('O', 'E', 'R', 'I')) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY wo_duedate; 236 5 230 745 230 2 140 110 200 20 Arial 10 bold head warehouse 6 36 5 30 745 30 2
    detail detail 51 5 15 75 15 Arial 8 bold detail wo_status 85 0 175 15 Arial 8 bold detail item_number 5 0 75 15 Arial 8 bold detail wonumber 85 15 300 15 Arial 8 bold detail item_descrip1 85 30 300 15 Arial 8 bold detail item_descrip2 490 0 80 15 Arial 8 bold detail qtyrcv 315 0 75 15 Arial 8 bold detail cohead_number 5 45 745 45 0 580 0 80 15 Arial 8 bold detail startdate 265 0 40 15 Arial 8 bold detail warehous_code 405 0 80 15 Arial 8 bold detail qtyord 665 0 80 15 Arial 8 bold detail duedate
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/OpportunityList.xml000066400000000000000000000307321217451700100221510ustar00rootroot00000000000000 Opportunity List OpportunityList 0.05 0.05 Letter 50 50 50 50 detail opportunities detail queryParams SELECT formatDate(<? value("startDate") ?>,'Earliest') AS f_startDate, formatDate(<? value("endDate") ?>,'Latest') AS f_endDate, <? if exists("username") ?> <? value("username") ?> AS usr_username <? elseif exists("usr_pattern") ?> <? value("usr_pattern") ?> AS usr_username <? else ?> text('All') AS usr_username <? endif ?> ; 163 5.66667 158.333 745.667 158.333 2 10 43 725 15 12 Arial 10 bold Parameter Query filter 6 41 5 35 745 35 2
    detail ByUser usr detail 36 220 15 80 15 Arial 8 bold detail opsource_name 395 0 80 15 Arial 8 bold detail f_amount 50 15 80 15 Arial 8 bold detail crmacct_number 480 0 55 15 Arial 8 bold detail f_currency 10 0 200 15 Arial 8 bold detail ophead_name 305 15 80 15 Arial 8 bold detail ophead_probability_prcnt 645 0 100 15 Arial 8 bold detail f_actualdate 220 0 80 15 Arial 8 bold detail opstage_name 540 0 100 15 Arial 8 bold detail f_targetdate 135 15 80 15 Arial 8 bold detail ophead_owner_username 305 0 80 15 Arial 8 bold detail optype_name
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/OrderActivityByProject.xml000066400000000000000000000524751217451700100233630ustar00rootroot00000000000000 Order Activity By Project OrderActivityByProject Order Activity Report 0.05 0.05 Letter 50 50 50 50 head SELECT prj_name, prj_number FROM prj WHERE (prj_id=<? value("prj_id") ?>); detail -- Group: orderActivityByProject -- Name: detail -- Notes: SELECT *, formatQty(qty) AS f_qty, formatMoney(value) AS f_value, 'curr' AS qty_xtnumericrole, 'curr' AS value_xtnumericrole FROM ( <? if exists("showSo") ?> ----- QUOTES ----- SELECT quhead_id AS id, 15 AS type, quhead_number::text AS subtype, 1 AS section, <? value("quotes") ?> AS section_qtdisplayrole, quhead_number::text AS name, CASE WHEN (quhead_status = 'C') THEN <? value("converted") ?> WHEN (quhead_status = 'X') THEN <? value("canceled") ?> WHEN (COALESCE(quhead_expire, current_date + 1) > current_date) THEN <? value("open") ?> ELSE <? value("expired") ?> END AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL::text AS uom, NULL AS value, 0.0 AS ordertotal, 1 AS xtindentrole FROM quhead JOIN quitem ON (quitem_quhead_id = quhead_id) WHERE (quhead_prj_id = <? value("prj_id") ?>) GROUP BY quhead_id, quhead_number, quhead_status, quhead_expire, quhead_freight, quhead_misc UNION ALL SELECT quitem_id AS id, 17 AS type, quhead_number::text AS subtype, 1 AS section, <? value("quotes") ?> AS section_qtdisplayrole, quitem_linenumber::text AS name, CASE WHEN (quhead_status = 'C') THEN <? value("converted") ?> WHEN (quhead_status = 'X') THEN <? value("canceled") ?> WHEN (COALESCE(quhead_expire, current_date + 1) > current_date) THEN <? value("open") ?> ELSE <? value("Expired") ?> END AS status, item_number AS item, item_descrip1 || ' ' || item_descrip2 AS descrip, quitem_qtyord, uom_name AS uom, (quitem_qtyord * quitem_qty_invuomratio) * (quitem_price / quitem_price_invuomratio) AS value, 0.0 AS ordertotal, 2 AS xtindentrole FROM quhead JOIN quitem ON (quitem_quhead_id = quhead_id) JOIN uom ON (quitem_qty_uom_id = uom_id) JOIN itemsite ON (quitem_itemsite_id = itemsite_id) JOIN item ON (itemsite_item_id = item_id) WHERE (quhead_prj_id = <? value("prj_id") ?>) UNION ALL SELECT quhead_id AS id, 18 AS type, quhead_number::text AS subtype, 1 AS section, <? value("quotes") ?> AS section_qtdisplayrole, <? value("total") ?> AS name, NULL AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL::text AS uom, SUM((quitem_qtyord * quitem_qty_invuomratio) * (quitem_price / quitem_price_invuomratio)) AS value, SUM((quitem_qtyord * quitem_qty_invuomratio) * (quitem_price / quitem_price_invuomratio)) AS ordertotal, 1 AS xtindentrole FROM quhead JOIN quitem ON (quitem_quhead_id = quhead_id) WHERE (quhead_prj_id = <? value("prj_id") ?>) GROUP BY quhead_id, quhead_number UNION ALL ------ SALES ORDERS ------ SELECT cohead_id AS id, 25 AS type, cohead_number::text AS subtype, 2 AS section, <? value("sos") ?> AS section_qtdisplayrole, cohead_number::text AS name, COALESCE((SELECT CASE WHEN (coitem_status = 'O') THEN <? value("open") ?> WHEN (coitem_status = 'C') THEN <? value("closed" ?> ELSE <? value("canceled") ?> END FROM (SELECT coitem_status, CASE WHEN (coitem_status = 'O') THEN 1 WHEN (coitem_status = 'C') then 2 ELSE 3 END AS type FROM coitem WHERE (coitem_cohead_id=cohead_id) ORDER BY type LIMIT 1) AS sts) ,'O') AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL::text AS uom, NULL AS value, 0.0 AS ordertotal, 1 AS xtindentrole FROM cohead JOIN coitem ON (coitem_cohead_id = cohead_id) WHERE (cohead_prj_id = <? value("prj_id") ?>) GROUP BY cohead_id, cohead_number UNION ALL SELECT coitem_id AS id, 27 AS type, cohead_number::text AS subtype, 2 AS section, <? value("sos") ?> AS section_qtdisplayrole, coitem_linenumber::text AS name, CASE WHEN (coitem_status = 'O') THEN <? value("open") ?> WHEN (coitem_status = 'C') THEN <? value("closed") ?> WHEN (coitem_status = 'X') THEN <? value("canceled") ?> END AS status, item_number AS item, item_descrip1 || ' ' || item_descrip2 AS descrip, coitem_qtyord, uom_name AS uom, (coitem_qtyord * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio) AS value, 0.0 AS ordertotal, 2 AS xtindentrole FROM cohead JOIN coitem ON (coitem_cohead_id = cohead_id) JOIN uom ON (coitem_qty_uom_id = uom_id) JOIN itemsite ON (coitem_itemsite_id = itemsite_id) JOIN item ON (itemsite_item_id = item_id) WHERE (cohead_prj_id = <? value("prj_id") ?>) UNION ALL SELECT cohead_id AS id, 28 AS type, cohead_number::text AS subtype, 2 AS section, <? value("sos") ?> AS section_qtdisplayrole, <? value("total") ?> AS name, NULL AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL::text AS uom, SUM((coitem_qtyord * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio)) AS value, SUM((coitem_qtyord * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio)) AS ordertotal, 1 AS xtindentrole FROM cohead JOIN coitem ON (coitem_cohead_id = cohead_id) WHERE (cohead_prj_id = <? value("prj_id") ?>) GROUP BY cohead_id, cohead_number UNION ALL ------ INVOICES ------- SELECT invchead_id AS id, 35 AS type, invchead_invcnumber::text AS subtype, 3 AS section, <? value("invoices") ?> AS section_qtdisplayrole, invchead_invcnumber::text AS name, CASE WHEN (invchead_posted) THEN <? value("posted") ?> ELSE <? value("unposted") ?> END AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL::text AS uom, NULL AS value, 0.0 AS ordertotal, 1 AS xtindentrole FROM invchead JOIN invcitem ON (invcitem_invchead_id = invchead_id) WHERE (invchead_prj_id = <? value("prj_id") ?>) GROUP BY invchead_id, invchead_invcnumber, invchead_freight, invchead_misc_amount, invchead_posted UNION ALL SELECT invcitem_id AS id, 37 AS type, invchead_invcnumber::text AS subtype, 3 AS section, <? value("invoices") ?> AS section_qtdisplayrole, invcitem_linenumber::text AS name, CASE WHEN (invchead_posted) THEN <? value("posted") ?> ELSE <? value("unposted") ?> END AS status, COALESCE(item_number,invcitem_number) AS item, COALESCE(item_descrip1 || ' ' || item_descrip2,invcitem_descrip) AS descrip, invcitem_billed AS qty, uom_name AS uom, (invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price / invcitem_price_invuomratio) AS value, 0.0 AS ordertotal, 2 AS xtindentrole FROM invchead JOIN invcitem ON (invcitem_invchead_id = invchead_id) LEFT OUTER JOIN item ON (invcitem_item_id = item_id) LEFT OUTER JOIN uom ON (invcitem_qty_uom_id = uom_id) WHERE (invchead_prj_id = <? value("prj_id") ?>) UNION ALL SELECT invchead_id AS id, 38 AS type, invchead_invcnumber::text AS subtype, 3 AS section, <? value("invoices") ?> AS section_qtdisplayrole, <? value("total") ?> AS name, NULL AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL::text AS uom, SUM((invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price / invcitem_price_invuomratio)) AS value, SUM((invcitem_billed * invcitem_qty_invuomratio) * (invcitem_price / invcitem_price_invuomratio)) AS ordertotal, 1 AS xtindentrole FROM invchead JOIN invcitem ON (invcitem_invchead_id = invchead_id) WHERE (invchead_prj_id = <? value("prj_id") ?>) GROUP BY invchead_id, invchead_invcnumber <? endif ?> <? if exists("showWo") ?> <? if exists("showSo") ?> UNION ALL <? endif ?> ------ WORK ORDERS ------- SELECT wo_id AS id, 45 AS type, formatWoNumber(wo_id) AS subtype, 4 AS section, <? value("wos") ?> AS section_qtdisplayrole, formatWoNumber(wo_id) AS name, CASE WHEN (wo_status = 'O') THEN <? value("open") ?> WHEN (wo_status = 'E') THEN <? value("exploded") ?> WHEN (wo_status = 'R') THEN <? value("released") ?> WHEN (wo_status = 'I') THEN <? value("inprocess") ?> WHEN (wo_status = 'C') THEN <? value("closed") ?> END AS status, item_number AS item, item_descrip1 || ' ' || item_descrip2 AS descrip, wo_qtyord AS qty, uom_name AS uom, wo_postedvalue AS value, wo_postedvalue AS ordertotal, 1 AS xtindentrole FROM wo JOIN itemsite ON (itemsite_id=wo_itemsite_id) JOIN item ON (itemsite_item_id=item_id) JOIN uom ON (item_inv_uom_id=uom_id) WHERE (wo_prj_id = <? value("prj_id") ?>) <? endif ?> <? if exists("showPo") ?> <? if exists("showSo") ?> UNION ALL <? elseif exists("showWo") ?> UNION ALL <? endif ?> ------ PURCHASE REQUESTS ------ SELECT pr_id AS id, 55 AS type, pr_number::text || '-' || pr_subnumber::text AS subtype, 5 AS section, <? value("prs") ?> AS section_qtdisplayrole, pr_number::text || '-' || pr_subnumber::text AS name, <? value("open") ?> AS status, item_number AS item, (item_descrip1 || ' ' || item_descrip2) AS descrip, pr_qtyreq AS qty, uom_name AS uom, stdcost(item_id) * pr_qtyreq AS value, stdcost(item_id) * pr_qtyreq AS ordertotal, 1 AS xtindentrole FROM pr JOIN itemsite ON (itemsite_id = pr_itemsite_id) JOIN item ON (itemsite_item_id = item_id) JOIN uom ON (item_inv_uom_id = uom_id) WHERE (pr_prj_id=<? value("prj_id") ?>) UNION ALL ------ PURCHASE ORDERS ------ SELECT pohead_id AS id, 65 AS type, pohead_number::text AS subtype, 6 AS section, <? value("pos") ?> AS section_qtdisplayrole, pohead_number::text AS name, CASE WHEN (pohead_status = 'U') THEN <? value("unreleased") ?> WHEN (pohead_status = 'O') THEN <? value("open") ?> WHEN (pohead_status = 'C') THEN <? value("closed") ?> END AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL AS uom, NULL AS value, 0.0 AS ordertotal, 1 AS xtindentrole FROM pohead JOIN poitem ON (poitem_pohead_id = pohead_id) WHERE (poitem_prj_id = <? value("prj_id") ?>) GROUP BY pohead_id, pohead_number, pohead_freight, pohead_status UNION ALL SELECT poitem_id AS id, 67 AS type, pohead_number::text AS subtype, 6 AS section, <? value("pos") ?> AS section_qtdisplayrole, poitem_linenumber::text AS name, CASE WHEN (poitem_status = 'U') THEN <? value("unreleased") ?> WHEN (poitem_status = 'O') THEN <? value("open") ?> WHEN (poitem_status = 'C') THEN <? value("closed") ?> END AS status, COALESCE(item_number,poitem_vend_item_number) AS item, COALESCE((item_descrip1 || ' ' || item_descrip2),poitem_vend_item_descrip) AS descrip, poitem_qty_ordered, poitem_vend_uom AS uom, (poitem_qty_ordered * poitem_unitprice) AS value, 0.0 AS ordertotal, 2 AS xtindentrole FROM pohead JOIN poitem ON (poitem_pohead_id = pohead_id) LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id) LEFT OUTER JOIN item ON (itemsite_item_id = item_id) WHERE (poitem_prj_id = <? value("prj_id") ?>) UNION ALL SELECT pohead_id AS id, 68 AS type, pohead_number::text AS subtype, 6 AS section, <? value("pos") ?> AS section_qtdisplayrole, <? value("total") ?> AS name, NULL AS status, NULL::text AS item, NULL::text AS descrip, NULL AS qty, NULL::text AS uom, SUM(poitem_qty_ordered * poitem_unitprice) AS value, SUM(poitem_qty_ordered * poitem_unitprice) AS ordertotal, 1 AS xtindentrole FROM pohead JOIN poitem ON (poitem_pohead_id = pohead_id) WHERE (poitem_prj_id = <? value("prj_id") ?>) GROUP BY pohead_id, pohead_number <? endif ?> ) data ORDER BY section, subtype, type, id; 75 140 25 200 20 Arial 10 bold head prj_number 140 45 509 20 Arial 10 bold head prj_name
    section type section 53 0 45 750 45 2 77 45 77 45 0 90 5 610 15 Arial 10 bold detail section_qtdisplayrole 33 305 5 750 5 0 610 10 100 15 Arial 8 bold detail ordertotal money detail 18 305 0 135 15 Arial 8 bold detail item 100 0 95 15 Arial 8 bold detail name 209 0 85 15 Arial 8 bold detail status 444 0 85 15 Arial 8 bold detail f_qty 544 0 165 15 Arial 8 bold detail f_value
    41 700 15 40 15 Arial 8 bold Context Query page_number 0 5 750 5 2 75 15 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/POHistory.xml000066400000000000000000000325411217451700100206410ustar00rootroot00000000000000 P/O History POHistory select pohead_id, pohead_number from pohead order by pohead_number desc; Letter 50 50 50 50 head SELECT pohead_number, vend_name FROM pohead, vendinfo WHERE ((pohead_id=<? value("pohead_id") ?>) AND (pohead_vend_id=vend_id)); detail SELECT poitem_linenumber as f_number, item_number as f_item, uom_name as f_uom1, formatDate(poitem_duedate) as f_duedate, poitem_vend_item_number as f_vend_item, poitem_vend_uom as f_uom2, formatQty(poitem_qty_ordered) as f_ordered, formatqty(poitem_qty_received) as f_received FROM poitem, itemsite, item, uom WHERE ((poitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (poitem_pohead_id=<? value("pohead_id") ?>)) UNION SELECT poitem_linenumber as f_number, poitem_vend_item_number as f_item, expcat_code as f_uom1, formatDate(poitem_duedate) as f_duedate, poitem_vend_item_descrip as f_vend_item, expcat_descrip as f_uom2, formatQty(poitem_qty_ordered) as f_ordered, formatqty(poitem_qty_received) as f_received FROM poitem, expcat WHERE ((poitem_expcat_id = expcat_id) AND (poitem_pohead_id=<? value("pohead_id") ?>)) ORDER BY f_number; 205 5 200 990 200 2 105 120 385 20 Arial 10 bold head vend_name 105 100 385 20 Arial 10 bold head pohead_number 8 42 5 37 990 37 2
    detail detail 18 45 0 150 15 Arial 8 bold detail f_item 805 0 80 15 Arial 8 bold detail f_ordered 900 0 90 15 Arial 8 bold detail f_received 180 0 145 15 Arial 8 bold detail f_uom1 5 0 35 15 Arial 8 bold detail f_number 730 0 55 15 Arial 8 bold detail f_duedate 525 0 195 15 1 Arial 8 bold detail f_vend_item 325 0 190 15 1 Arial 8 bold detail f_uom2
    32 945 17 40 15 Arial 8 bold Context Query page_number 85 17 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/POLineItemsByDate.xml000066400000000000000000000400111217451700100221510ustar00rootroot00000000000000 P/O Line Items By Date POLineItemsByDate Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, <? if exists("openItems") ?> text('Open Items') <? elseif exists("closedItems") ?> text('Closed Items') <? else ?> text('All Items') <? endif ?> as f_whichitems, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate detail SELECT CASE WHEN (itemsite_id IS NULL) THEN ( SELECT warehous_code FROM whsinfo WHERE (pohead_warehous_id=warehous_id) ) ELSE ( SELECT warehous_code FROM whsinfo WHERE (itemsite_warehous_id=warehous_id) ) END AS warehousecode, pohead_number as f_ponumber, poitem_linenumber as f_linenumber, vend_name, formatDate(poitem_duedate) as f_duedate, COALESCE(item_number, (text('NonInv - ') || poitem_vend_item_number)) AS itemnumber, COALESCE(uom_name, poitem_vend_uom) AS itemuom, formatQty(poitem_qty_ordered) as f_ordered, formatQty(poitem_qty_received) as f_received, formatQty(poitem_qty_returned) as f_returned FROM pohead, vendinfo, poitem LEFT OUTER JOIN (itemsite JOIN item ON (itemsite_item_id=item_id) JOIN uom ON (item_inv_uom_id=uom_id)) ON (poitem_itemsite_id=itemsite_id) WHERE ((poitem_pohead_id=pohead_id) AND (pohead_vend_id=vend_id) AND (poitem_duedate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("warehous_id") ?> AND ( ( (itemsite_id IS NULL) AND (pohead_warehous_id=<? value("warehous_id") ?>) ) OR ( (itemsite_id IS NOT NULL) AND (itemsite_warehous_id=<? value("warehous_id") ?>) ) ) <? endif ?> <? if exists("agentUsername") ?> AND (pohead_agent_username=<? value("agentUsername") ?>) <? endif ?> <? if exists("openItems") ?> AND (poitem_status='O') <? elseif exists("closedItems") ?> AND (poitem_status='C') <? endif ?> ) ORDER BY poitem_duedate; 237 135 75 300 20 Arial 10 bold head agentUsername 5 229 745 229 2 550 95 100 20 Arial 10 bold head enddate 475 130 165 20 Arial 10 bold head f_whichitems 135 95 300 20 Arial 10 bold head warehouse 550 75 100 20 Arial 10 bold head startdate 7 37 5 30 745 30 2
    detail detail 37 5 30 745 30 0 665 0 80 15 Arial 8 bold detail f_returned 525 0 50 15 Arial 8 bold detail itemuom 580 0 80 15 Arial 8 bold detail f_ordered 370 0 150 15 Arial 8 bold detail itemnumber 45 0 80 15 Arial 8 bold detail f_ponumber 580 15 80 15 Arial 8 bold detail f_received 5 0 40 15 Arial 8 bold detail warehousecode 285 0 80 15 Arial 8 bold detail f_duedate 130 0 150 15 Arial 8 bold detail vend_name 5 15 40 15 Arial 8 bold detail f_linenumber
    17 103 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/POLineItemsByItem.xml000066400000000000000000000340621217451700100222030ustar00rootroot00000000000000 P/O Line Items By Item POLineItemsByItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, uom_name, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, <? if exists("openItems") ?> text('Open Items') <? elseif exists("closedItems") ?> text('Closed Items') <? else ?> text('All Items') <? endif ?> AS f_whichitems FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("item_id") ?>); detail SELECT warehous_code, pohead_number as f_ponumber, vend_name, formatDate(poitem_duedate) as f_duedate, poitem_vend_uom as uom_name, formatQty(poitem_qty_ordered) as f_ordered, formatQty(poitem_qty_received) as f_received, formatQty(poitem_qty_returned) as f_returned FROM pohead, poitem, vendinfo, itemsite, whsinfo WHERE ((poitem_pohead_id=pohead_id) AND (pohead_vend_id=vend_id) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("agentUsername") ?> AND (pohead_agent_username=<? value("agentUsername") ?>) <? endif ?> <? if exists("openItems") ?> AND (poitem_status='O') <? elseif exists("closedItems") ?> AND (poitem_status='C') <? endif ?> AND (poitem_itemsite_id=itemsite_id) AND (itemsite_warehous_id=warehous_id) AND (itemsite_item_id=<? value("item_id") ?>) ) ORDER BY poitem_duedate; 221 5 215 745 215 2 325 75 80 20 Arial 10 bold head uom_name 475 130 165 20 Arial 10 bold head f_whichitems 110 112 250 20 Arial 10 bold head item_descrip2 535 95 200 20 Arial 10 bold head warehouse 110 75 150 20 Arial 10 bold head item_number 110 95 250 20 Arial 10 bold head item_descrip1 535 75 200 20 Arial 10 bold head agentUsername 6 21 5 15 745 15 2
    detail detail 16 580 0 80 15 Arial 8 bold detail f_received 440 0 50 15 Arial 8 bold detail uom_name 5 0 40 15 Arial 8 bold detail warehous_code 665 0 80 15 Arial 8 bold detail f_returned 355 0 80 15 Arial 8 bold detail f_duedate 493 0 80 15 Arial 8 bold detail f_ordered 135 0 215 15 Arial 8 bold detail vend_name 45 0 80 15 Arial 8 bold detail f_ponumber
    16 103 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/POLineItemsByVendor.xml000066400000000000000000000305701217451700100225420ustar00rootroot00000000000000 P/O Line Items By Vendor POLineItemsByVendor Letter 50 50 50 50 head SELECT <? if exists("vend_id") ?> (SELECT ('Vendor = ' || vend_name) FROM vendinfo WHERE vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> (SELECT ('Vendor Type = ' || vendtype_code) FROM vendtype WHERE vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> ('Vendor Type pattern = ' || <? value("vendtype_pattern") ?>) <? else ?> 'All Vendors' <? endif ?> AS selection, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, <? if exists("openItems") ?> text('Open Items') <? elseif exists("closedItems") ?> text('Closed Items') <? else ?> text('All Items') <? endif ?> AS f_whichitems ; detail poItems detail 224 535 75 200 20 Arial 10 bold head agentUsername 475 130 165 20 Arial 10 bold head f_whichitems 535 95 200 20 Arial 10 bold head warehouse 150 75 200 20 Arial 10 bold head selection 5 215 745 215 2 9 24 5 15 745 15 2
    detail detail 19 440 0 50 15 Arial 8 bold detail itemuom 225 0 150 15 Arial 8 bold detail itemnumber 45 0 80 15 Arial 8 bold detail pohead_number 135 0 80 15 Arial 8 bold detail poitem_duedate 5 0 40 15 Arial 8 bold detail warehous_code 493 0 80 15 Arial 8 bold detail poitem_qty_ordered qty 580 0 80 15 Arial 8 bold detail poitem_qty_received qty 665 0 80 15 Arial 8 bold detail poitem_qty_returned qty
    19 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/POsByDate.xml000066400000000000000000000240231217451700100205270ustar00rootroot00000000000000 P/Os By Date POsByDate 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate detail purchaseOrders detail 221 550 95 100 20 Arial 10 bold head enddate 5 215 745 215 2 135 75 275 20 Arial 10 bold head agentUsername 135 95 300 20 Arial 10 bold head warehouse 550 75 100 20 Arial 10 bold head startdate 6 21 5 15 745 15 2
    detail detail 18 5 2 70 15 Arial 8 bold detail warehousecode 325 2 230 15 Arial 8 bold detail vend_name 650 2 80 15 Arial 8 bold detail f_duedate 80 2 80 15 Arial 8 bold detail pohead_number 200 2 80 15 Arial 8 bold detail f_status 565 2 80 15 Arial 8 bold detail f_orderdate
    18 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/POsByVendor.xml000066400000000000000000000253661217451700100211220ustar00rootroot00000000000000 P/Os By Vendor POsByVendor 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("vend_id") ?> (SELECT ('Vendor = ' || vend_name) FROM vendinfo WHERE vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> (SELECT ('Vendor Type = ' || vendtype_code) FROM vendtype WHERE vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> ('Vendor Type pattern = ' || <? value("vendtype_pattern") ?>) <? else ?> 'All Vendors' <? endif ?> AS selection, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("byReceiptDate") ?> TEXT('By Receipt Date') <? elseif exists("byDueDate") ?> TEXT('By Due Date') <? else ?> TEXT('By Order Date') <? endif ?> AS f_byDate, <? if exists("descrip_pattern") ?> TEXT('Where Item Description contains ' || <? value("descrip_pattern") ?>) <? else ?> TEXT('') <? endif ?> AS f_descrip detail purchaseOrders detail 221 135 135 540 20 Arial 10 bold head f_descrip 550 115 180 20 Arial 10 bold head f_byDate 135 95 300 20 Arial 10 bold head warehouse 5 215 745 215 2 135 75 300 20 Arial 10 bold head selection 550 95 100 20 Arial 10 bold head enddate 550 75 100 20 Arial 10 bold head startdate 6 21 5 15 745 15 2
    detail detail 18 650 0 80 15 Arial 8 bold detail f_orderdate 5 0 70 15 Arial 8 bold detail warehousecode 200 0 80 15 Arial 8 bold detail f_status 80 0 110 15 Arial 8 bold detail pohead_number 330 0 250 15 Arial 8 bold detail vend_number
    18 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/PackageMasterList.xml000066400000000000000000000134161217451700100223040ustar00rootroot00000000000000 Package Master List PackageMasterList Letter 50 50 50 50 detail SELECT *, formatboolyn(packageIsEnabled(pkghead_name)) AS enabled FROM pkghead ORDER BY pkghead_name, pkghead_version DESC; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 265 0 300 15 Arial 8 bold detail pkghead_descrip 10 0 250 15 Arial 8 bold detail pkghead_name 565 0 100 15 Arial 8 bold detail pkghead_version 665 0 50 15 Arial 8 bold detail enabled
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PackingList-Shipment.xml000066400000000000000000000751471217451700100227470ustar00rootroot00000000000000 Packing List (Shipment) PackingList-Shipment Non-Hybrid version - driven only by shiphead_id parameter - Packing List showing the contents of a particular shipment - Shows RA# if SO is a replacement order for and RA 0.05 0.05 Letter 25 25 25 25 head SELECT shiphead_number, 'S/O #:' AS ordertype, cohead_number AS ordernumber, formatsobarcode(cohead_id) AS order_barcode, COALESCE(shiphead_shipvia, cohead_shipvia) AS shipvia, cohead_shiptophone AS shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments AS shipcomments, cohead_billtoname AS billtoname, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, cohead_shiptoname AS shiptoname, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, cust_number, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cntct_phone AS cust_phone, terms_descrip FROM shiphead JOIN cohead ON (cohead_id=shiphead_order_id) JOIN custinfo ON (cohead_cust_id=cust_id) JOIN terms ON (cohead_terms_id=terms_id) LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE (shiphead_id=<? value("shiphead_id") ?>) <? if exists("MultiWhs") ?> UNION SELECT shiphead_number, 'T/O #:' AS ordertype, tohead_number AS ordernumber, formattobarcode(tohead_id) AS order_barcode, shiphead_shipvia AS shipvia, tohead_destphone AS shiptophone, TEXT(' ') AS cohead_custponumber, formatDate(tohead_orderdate) AS orderdate, tohead_shipcomments AS shipcomments, tohead_srcname AS billtoname, formataddr(tohead_srcaddress1, tohead_srcaddress2, tohead_srcaddress3, (tohead_srccity || ' ' || tohead_srcstate || ' ' || tohead_srcpostalcode), tohead_srccountry) AS billing_address, tohead_destname AS shiptoname, formataddr(tohead_destaddress1, tohead_destaddress2, tohead_destaddress3, (tohead_destcity || ' ' || tohead_deststate || ' ' || tohead_destpostalcode), tohead_destcountry) AS shipping_address, 'Transfer Order' AS cust_number, tohead_destcntct_name AS cust_contact, tohead_destphone AS cust_phone, '' AS terms_descrip FROM shiphead, tohead WHERE ((tohead_id=shiphead_order_id) AND (shiphead_order_type='TO') AND (shiphead_id=<? value("shiphead_id") ?>) ) <? endif ?>; scheddate SELECT formatDate(MIN(coitem_scheddate)) AS scheddate FROM coitem, shipitem WHERE ((coitem_status <> 'X') AND (coitem_id=shipitem_orderitem_id) AND (shipitem_shiphead_id=<? value("shiphead_id") ?>)); detail SELECT 1 AS groupby, coitem_linenumber AS sortline, coitem_subnumber AS sortsubline, formatsolinenumber(coitem_id) AS linenumber, coitem_memo AS memo, CASE WHEN (coitem_custpn != '') THEN coitem_custpn ELSE item_number END AS item_number, formatitemsitebarcode(itemsite_id) AS item_barcode, formatsoitembarcode(coitem_id) AS orderitem_barcode, -- In 2.3 replaced the next line: -- uom_name, -- with: (select uom_name from uom where uom_id = coitem_qty_uom_id) AS uom_name, itemsellinguom(item_id) AS shipuom, CASE WHEN (coitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip1 ELSE item_descrip1 END AS item_descrip1, CASE WHEN (coitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip2 ELSE item_descrip2 END AS item_descrip2, formatQty(coitem_qtyord) AS ordered, (SELECT formatQty(SUM(shipitem_qty)) FROM shipitem WHERE ((shipitem_shiphead_id=<? value("shiphead_id") ?>) AND (shipitem_orderitem_id=coitem_id))) AS shipped, CASE WHEN (coitem_status='O' AND (SELECT cust_creditstatus FROM custinfo,cohead WHERE coitem_cohead_id=cohead_id AND (cust_id=cohead_cust_id))='H') THEN 'H' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=coitem_linenumber) AND (cohead_id=coitem_cohead_id))) >= coitem_qtyord)) THEN 'I' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=coitem_linenumber) AND (cohead_id=coitem_cohead_id))) > 0)) THEN 'P' WHEN (coitem_status='O' AND (itemsite_qtyonhand - qtyAllocated(itemsite_id, CURRENT_DATE) + qtyOrdered(itemsite_id, CURRENT_DATE)) >= (coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) THEN 'R' ELSE coitem_status END AS f_status, CASE WHEN (getPacklistItemLotSerial(shipitem_shiphead_id, coitem_id) = '') THEN '' ELSE 'Serial #/Lot Information:' END AS lotserial_title, getPacklistItemLotSerial(shipitem_shiphead_id, coitem_id) AS lotserial, CASE WHEN (getPacklistCharName(shipitem_shiphead_id, coitem_id) = '') THEN '' ELSE 'Characteristics:' END AS char_title, getPacklistCharName(shipitem_shiphead_id, coitem_id) AS char_name, getPacklistCharValue(shipitem_shiphead_id, coitem_id) AS char_value FROM shipitem JOIN coitem ON (coitem_id=shipitem_orderitem_id) JOIN itemsite ON (itemsite_id=coitem_itemsite_id) JOIN item ON (item_id=itemsite_item_id) JOIN uom ON (uom_id=item_inv_uom_id) LEFT OUTER JOIN itemalias ON (itemalias_item_id=item_id AND itemalias_number=coitem_custpn) WHERE ( (coitem_status <> 'X') AND (shipitem_shiphead_id=<? value("shiphead_id") ?>) ) <? if exists("MultiWhs") ?> UNION SELECT 2 AS groupby, toitem_linenumber AS sortline, 0 AS sortsubline, CAST(toitem_linenumber AS text) AS linenumber, toitem_notes AS memo, item_number, formatitemsitebarcode(itemsite_id) AS item_barcode, formattoitembarcode(toitem_id) AS orderitem_barcode, uom_name, itemsellinguom(item_id) AS shipuom, item_descrip1, item_descrip2, formatQty(toitem_qty_ordered) AS ordered, (SELECT formatQty(SUM(shipitem_qty)) FROM shipitem WHERE ((shipitem_shiphead_id=<? value("shiphead_id") ?>) AND (shipitem_orderitem_id=toitem_id)) ) AS shipped, toitem_status AS f_status, CASE WHEN (getPacklistItemLotSerial(shiphead_id, toitem_id) = '') THEN '' ELSE 'Serial #/Lot Information:' END AS lotserial_title, getPacklistItemLotSerial(shiphead_id, toitem_id) AS lotserial, '' AS char_title, '' AS char_name, '' AS char_value FROM itemsite, item, toitem, tohead, shipitem, shiphead, uom WHERE ((toitem_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (item_id=itemsite_item_id) AND (toitem_tohead_id=tohead_id) AND (toitem_status <> 'X') AND (tohead_src_warehous_id=itemsite_warehous_id) AND (toitem_id=shipitem_orderitem_id) AND (shipitem_shiphead_id=shiphead_id) AND (shiphead_order_type='TO') AND (shiphead_id=<? value("shiphead_id") ?>) ) <? endif ?> ORDER BY sortline, sortsubline; logo SELECT image_data FROM image WHERE ((image_name='logo')); so_ra_relation --added in 2.3 to show RA link to S/O if the SO --was created as the result of a replacement RA <? if exists("EnableReturnAuth") ?> select 'RA #' AS ratext, rahead_number from rahead, cohead, shiphead where rahead_new_cohead_id = cohead_id and cohead_id = shiphead_order_id and shiphead_id = <? value("shiphead_id") ?>; <? else ?> select '' AS ratext, '' AS rahead_number <? endif ?> 463 375 0 425 100 stretch logo image_data 170 112 100 20 Arial 14 normal head ordernumber 170 175 170 20 Arial 14 normal head cust_number 375 202 307 25 3of9 20 0.01 head cohead_custponumber 480 285 300 20 Arial 14 normal head shiptoname 0 425 797 425 0 375 175 177 25 3of9 10 0.01 head cust_number 170 85 100 20 Arial 14 normal head shiphead_number 10 145 150 20 Arial 14 normal so_ra_relation ratext 10 112 150 20 Arial 14 normal head ordertype 480 305 300 15 10 Arial 10 normal head shipping_address 480 252 300 20 Arial 14 normal head shipvia 455 400 320 20 Arial 12 normal head terms_descrip 170 231 100 20 Arial 14 normal head orderdate 170 202 170 20 Arial 14 normal head cohead_custponumber 0 455 797 455 0 375 112 231 25 128 10 0.01 head order_barcode 90 285 300 20 Arial 14 normal head billtoname 170 252 100 20 Arial 14 normal scheddate scheddate 170 145 170 20 Arial 14 normal so_ra_relation rahead_number 112 400 250 20 Arial 12 normal head cust_contact 90 305 300 15 10 Arial 10 normal head billing_address
    detail characteristic linenumber 35 130 5 195 17 14 Arial 10 normal detail char_name 10 5 103 17 14 Arial 10 normal detail char_title 370 5 195 17 14 Arial 10 normal detail char_value lotserial linenumber 29 10 5 185 17 14 Arial 10 normal detail lotserial_title 228 5 550 17 14 Arial 10 normal detail lotserial line linenumber 82 430 0 80 20 Arial 10 normal detail shipped 70 55 665 17 14 Arial 10 normal detail memo 80 0 200 20 Arial 11 bold detail item_number 545 15 595 15 1 290 0 40 20 Arial 10 normal detail uom_name 340 0 80 20 Arial 10 normal detail ordered 80 35 300 15 Arial 11 normal detail item_descrip2 670 0 50 17 Arial 10 normal detail f_status 415 20 380 30 128 15 0.01 detail item_barcode 80 20 300 15 Arial 11 normal detail item_descrip1 5 0 42 20 Arial 11 bold detail linenumber detail 9
    packlist head 41 5 10 625 17 14 Arial 10 normal head shipcomments 5 5 842 5 0
    57 455 7 80 17 Arial 8 normal head ordernumber 735 5 45 17 Arial 8 normal Context Query page_number 90 5 95 17 Arial 8 normal Context Query report_date 365 7 80 17 Arial 8 normal head ordertype 94 540 70 790 70 0 160 70 407 70 0
    qt-client-4.1.0/share/reports/PackingList.xml000066400000000000000000001000771217451700100211510ustar00rootroot00000000000000 Packing List PackingList Hybrid Packing List - use the shiphead_id if it is passed but use the order id and type if they're passed but not shiphead_id - Shows Lot/Serial 0.05 0.05 Letter 25 25 25 25 head SELECT COALESCE(shiphead_number::TEXT, 'Not Issued To Shipping') AS shiphead_number, 'S/O #:' AS ordertype, cohead_number AS ordernumber, formatsobarcode(cohead_id) AS order_barcode, COALESCE(shiphead_shipvia, cohead_shipvia) AS shipvia, cohead_shiptophone AS shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments AS shipcomments, cohead_billtoname AS billtoname, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, cohead_shiptoname AS shiptoname, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, cust_number, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cntct_phone AS cust_phone, terms_descrip FROM custinfo JOIN cohead ON (cohead_cust_id=cust_id) JOIN terms ON (cohead_terms_id=terms_id) LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) <? if exists("shiphead_id") ?> JOIN <? else ?> LEFT OUTER JOIN <? endif ?> shiphead ON (shiphead_order_type='SO') AND (shiphead_order_id=cohead_id) WHERE TRUE <? if exists('shiphead_id') ?> AND (shiphead_id=<? value("shiphead_id") ?>) <? endif ?> <? if exists("head_id") ?> AND (cohead_id=<? value("head_id") ?>) AND (<? value("head_type") ?>='SO') <? endif ?> <? if exists("MultiWhs") ?> UNION SELECT COALESCE(shiphead_number::TEXT, 'Not Issued To Shipping') AS shiphead_number, 'T/O #:' AS ordertype, tohead_number AS ordernumber, formattobarcode(tohead_id) AS order_barcode, COALESCE(shiphead_shipvia, tohead_shipvia) AS shipvia, tohead_destphone AS shiptophone, TEXT(' ') AS cohead_custponumber, formatDate(tohead_orderdate) AS orderdate, tohead_shipcomments AS shipcomments, tohead_srcname AS billtoname, formataddr(tohead_srcaddress1, tohead_srcaddress2, tohead_srcaddress3, (tohead_srccity || ' ' || tohead_srcstate || ' ' || tohead_srcpostalcode), tohead_srccountry) AS billing_address, tohead_destname AS shiptoname, formataddr(tohead_destaddress1, tohead_destaddress2, tohead_destaddress3, (tohead_destcity || ' ' || tohead_deststate || ' ' || tohead_destpostalcode), tohead_destcountry) AS shipping_address, 'Transfer Order' AS cust_number, tohead_destcntct_name AS cust_contact, tohead_destphone AS cust_phone, '' AS terms_descrip FROM tohead <? if exists("shiphead_id") ?> JOIN <? else ?> LEFT OUTER JOIN <? endif ?> shiphead ON (shiphead_order_type='TO') AND (shiphead_order_id=tohead_id) WHERE TRUE <? if exists('shiphead_id') ?> AND (shiphead_id=<? value("shiphead_id")?>) <? endif ?> <? if exists("head_id") ?> AND (tohead_id=<? value("head_id") ?>) AND (<? value("head_type") ?>='TO') <? endif ?> <? endif ?>; scheddate SELECT formatDate(MIN(orderitem_scheddate)) AS scheddate FROM orderitem <? if exists("shiphead_id") ?> JOIN shiphead ON ((orderitem_orderhead_type=shiphead_order_type) AND (orderitem_orderhead_id=shiphead_order_id) AND (shiphead_id=<? value("shiphead_id")?>)) JOIN shipitem ON ((shiphead_id=shipitem_shiphead_id) AND (shipitem_orderitem_id=orderitem_id)) <? endif ?> WHERE ((orderitem_status <> 'X') <? if exists("head_id") ?> AND (orderitem_orderhead_type=<? value("head_type") ?>) AND (orderitem_orderhead_id=<? value("head_id") ?>) <? endif ?> ); detail SELECT 1 AS groupby, coitem_linenumber AS linenumber, coitem_memo AS memo, CASE WHEN (coitem_custpn != '') THEN coitem_custpn ELSE item_number END AS item_number, formatitemsitebarcode(itemsite_id) AS item_barcode, formatsoitembarcode(coitem_id) AS orderitem_barcode, (select uom_name from uom where uom_id = coitem_qty_uom_id) AS uom_name, itemsellinguom(item_id) AS shipuom, CASE WHEN (coitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip1 ELSE item_descrip1 END AS item_descrip1, CASE WHEN (coitem_custpn != '' AND itemalias_usedescrip=TRUE) THEN itemalias_descrip2 ELSE item_descrip2 END AS item_descrip2, formatQty(coitem_qtyord) AS ordered, ( SELECT formatQty(COALESCE(SUM(shipitem_qty), 0)) FROM shipitem JOIN shiphead ON (shiphead_id=shipitem_shiphead_id) WHERE ((shipitem_orderitem_id=coitem_id) AND (shiphead_order_type='SO')) ) AS atShipping, CASE WHEN (coitem_status='O' AND (SELECT cust_creditstatus FROM custinfo,cohead WHERE (coitem_cohead_id=cohead_id) AND (cust_id=cohead_cust_id))='H') THEN 'H' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=coitem_linenumber) AND (cohead_id=coitem_cohead_id))) >= coitem_qtyord)) THEN 'I' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=coitem_linenumber) AND (cohead_id=coitem_cohead_id))) > 0)) THEN 'P' WHEN (coitem_status='O' AND (itemsite_qtyonhand - qtyAllocated(itemsite_id, CURRENT_DATE) + qtyOrdered(itemsite_id, CURRENT_DATE)) >= (coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) THEN 'R' ELSE coitem_status END AS f_status FROM coitem JOIN itemsite ON (itemsite_id=coitem_itemsite_id) JOIN item ON (item_id=itemsite_item_id) JOIN uom ON (uom_id=item_inv_uom_id) LEFT OUTER JOIN itemalias ON (itemalias_item_id=item_id AND itemalias_number=coitem_custpn) WHERE ( (coitem_status <> 'X') <? if exists("shiphead_id") ?> AND (coitem_cohead_id IN (SELECT shiphead_order_id FROM shiphead WHERE ((shiphead_id=<? value("shiphead_id") ?>) AND (shiphead_order_type='SO')))) <? endif ?> <? if exists("head_id") ?> AND (<? value("head_type") ?>='SO') AND (coitem_cohead_id=<? value("head_id") ?>) <? endif ?> ) GROUP BY coitem_qty_uom_id, coitem_linenumber, coitem_id, coitem_memo, item_number, uom_name, shipuom, coitem_custpn, itemalias_usedescrip, itemalias_descrip1, itemalias_descrip2, item_descrip1, item_descrip2, coitem_qtyord, coitem_qty_invuomratio, coitem_qtyshipped, coitem_qtyreturned, coitem_status, coitem_cohead_id, itemsite_id, itemsite_qtyonhand, itemsite_warehous_id, item_id <? if exists("MultiWhs") ?> UNION SELECT 2 AS groupby, toitem_linenumber AS linenumber, toitem_notes AS memo, item_number, formatitemsitebarcode(itemsite_id) AS item_barcode, formattoitembarcode(toitem_id) AS orderitem_barcode, uom_name, itemsellinguom(item_id) AS shipuom, item_descrip1, item_descrip2, formatQty(toitem_qty_ordered) AS ordered, ( SELECT formatQty(COALESCE(SUM(shipitem_qty), 0)) FROM shipitem JOIN shiphead ON (shiphead_id=shipitem_shiphead_id) WHERE ((shipitem_orderitem_id=toitem_id) AND (shiphead_order_type='TO')) ) AS atShipping, toitem_status AS f_status FROM itemsite, item, toitem, tohead, uom WHERE ((toitem_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (item_id=itemsite_item_id) AND (toitem_tohead_id=tohead_id) AND (toitem_status <> 'X') AND (tohead_src_warehous_id=itemsite_warehous_id) <? if exists("shiphead_id") ?> AND (toitem_tohead_id IN (SELECT shiphead_order_id FROM shiphead WHERE ((shiphead_id=<? value("shiphead_id") ?>) AND (shiphead_order_type='TO')))) <? endif ?> <? if exists("head_id") ?> AND (<? value("head_type") ?>='TO') AND (toitem_tohead_id=<? value("head_id") ?>) <? endif ?> ) <? endif ?> ORDER BY linenumber; logo SELECT image_data FROM image WHERE ((image_name='logo')); lotdetail SELECT * FROM ( SELECT shiphead_number, (cohead_number || '-' || coitem_linenumber) AS ordernumber, item_number, formatlotserialnumber(invdetail_ls_id) AS invdetail_lotserial, SUM(invdetail_qty) * -1 AS lotqty, SUM(invhist_invqty) as totalshipmentqty, invhist_transtype, formatdate(MAX(invhist_transdate)) AS invhistdate, formatdate(MAX(shipitem_transdate)) AS shiptransdate FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) JOIN invhist ON (invhist_id=shipitem_invhist_id) JOIN invdetail ON (invdetail_invhist_id=invhist_id) JOIN cohead ON (cohead_id=shiphead_order_id) JOIN coitem ON (coitem_id=shipitem_orderitem_id) JOIN itemsite ON (itemsite_id=coitem_itemsite_id) JOIN item ON (item_id=itemsite_item_id) WHERE ( (shiphead_id = <? value("shiphead_id") ?> ) AND ('SO'=shiphead_order_type) ) GROUP BY shiphead_number,cohead_number,item_number,invdetail_ls_id, coitem_linenumber,invhist_transtype <? if exists("MultiWhs") ?> UNION SELECT shiphead_number, (tohead_number || '-' || toitem_linenumber) AS ordernumber, item_number, formatlotserialnumber(invdetail_ls_id) AS invdetail_lotserial, SUM(invdetail_qty) * -1 AS lotqty, SUM(invhist_invqty) as totalshipmentqty, invhist_transtype, formatdate(MAX(invhist_transdate)) AS invhistdate, formatdate(MAX(shipitem_transdate)) AS shiptransdate FROM shiphead JOIN shipitem ON (shipitem_shiphead_id=shiphead_id) JOIN invhist ON (invhist_id=shipitem_invhist_id) JOIN invdetail ON (invdetail_invhist_id=invhist_id) JOIN tohead ON (tohead_id=shiphead_order_id) JOIN toitem ON (toitem_id=shipitem_orderitem_id) JOIN item ON (item_id=toitem_item_id) WHERE ( (shiphead_id = <? value("shiphead_id") ?> ) AND ('TO'=shiphead_order_type) ) GROUP BY shiphead_number,tohead_number,item_number,invdetail_ls_id, toitem_linenumber,invhist_transtype <? endif ?> ) data ORDER BY ordernumber; 451 375 0 425 100 stretch logo image_data 375 180 307 25 3of9 20 0.01 head cohead_custponumber 170 150 170 20 Arial 14 normal head cust_number 375 120 231 25 128 10 0.01 head order_barcode 120 360 250 20 Arial 12 normal head cust_contact 170 180 170 20 Arial 14 normal head cohead_custponumber 480 260 300 20 Arial 14 normal head shiptoname 375 150 177 25 3of9 10 0.01 head cust_number 480 280 300 15 10 Arial 10 normal head shipping_address 10 120 150 20 Arial 14 normal head ordertype 170 207 100 20 Arial 14 normal head orderdate 170 227 100 20 Arial 14 normal scheddate scheddate 0 390 797 390 0 0 430 797 430 0 480 227 300 20 Arial 14 normal head shipvia 90 280 300 15 10 Arial 10 normal head billing_address 90 260 300 20 Arial 14 normal head billtoname 457 360 320 20 Arial 12 normal head terms_descrip 170 90 100 20 Arial 14 normal head shiphead_number 170 120 100 20 Arial 14 normal head ordernumber
    detail detail groupby 43 50 5 625 17 14 Arial 10 normal head shipcomments lineitem linenumber 21 0 0 837 0 0 detail 81 227 0 40 20 Arial 10 normal detail uom_name 610 0 50 17 Arial 10 normal detail f_status 280 0 80 20 Arial 10 normal detail ordered 20 0 200 20 Arial 11 bold detail item_number 90 50 560 17 14 Arial 10 normal detail memo 507 30 280 30 128 15 0.01 detail item_barcode 20 35 300 15 Arial 11 normal detail item_descrip2 20 20 300 15 Arial 11 normal detail item_descrip1 470 20 520 20 1 370 0 80 20 Arial 10 normal detail atShipping
    lotdetail lotdetail ordernumber 48 0 40 797 40 0 13 0 5 797 5 0 lotdetail 23 232 5 195 15 Arial 11 normal lotdetail invdetail_lotserial 30 5 195 15 Arial 11 normal lotdetail item_number 457 5 60 15 Arial 11 normal lotdetail lotqty
    57 90 8 95 17 Arial 8 normal Context Query report_date 735 8 45 17 Arial 8 normal Context Query page_number 455 8 80 17 Arial 8 normal head ordernumber 365 8 80 17 Arial 8 normal head ordertype 57 540 40 790 40 0 160 40 407 40 0
    qt-client-4.1.0/share/reports/PackingListBatchEditList.xml000066400000000000000000000226661217451700100235640ustar00rootroot00000000000000 Packing List Batch Edit List PackingListBatchEditList Letter 50 50 50 50 detail SELECT cohead_number AS order_number, pack_head_type, cohead_shipvia AS shipvia, formatShipmentNumber(pack_shiphead_id) AS shipment_number, cust_number AS number, cohead_billtoname AS name, CASE WHEN (cohead_holdtype='N') THEN <? value("none") ?> WHEN (cohead_holdtype='C') THEN <? value("credit") ?> WHEN (cohead_holdtype='S') THEN <? value("ship") ?> WHEN (cohead_holdtype='P') THEN <? value("pack") ?> WHEN (cohead_holdtype='R') THEN <? value("return") ?> ELSE <? value("other") ?> END AS f_holdtype, formatBoolYN(pack_printed) AS f_printed FROM pack, cohead, custinfo WHERE ((pack_head_id=cohead_id) AND (cohead_cust_id=cust_id) AND (pack_head_type='SO')) <? if exists("MultiWhs") ?> AND checkSOSitePrivs(cohead_id) UNION SELECT tohead_number AS order_number, pack_head_type, tohead_shipvia AS shipvia, formatShipmentNumber(pack_shiphead_id) AS shipment_number, tohead_destname AS number, tohead_destcntct_name AS name, '' AS f_holdtype, formatBoolYN(pack_printed) AS f_printed FROM pack, tohead WHERE ((pack_head_id=tohead_id) AND (pack_head_type='TO')) <? endif ?> ORDER BY order_number; 75 5 70 745 70 2 5 31 5 20 745 20 2
    detail detail 15 115 0 100 15 Arial 8 bold detail shipment_number 675 0 50 15 Arial 8 bold detail f_printed 220 0 100 15 Arial 8 bold detail number 10 0 100 15 Arial 8 bold detail order_number 600 0 50 15 Arial 8 bold detail f_holdtype 320 0 160 15 Arial 8 bold detail name 490 0 100 15 Arial 8 bold detail shipvia
    15 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PartiallyShippedOrders.xml000066400000000000000000000315261217451700100234000ustar00rootroot00000000000000 Partially Shipped Orders PartiallyShippedOrders Letter 50 50 50 50 detail SELECT CASE WHEN (cohead_holdtype IN ('P', 'C', 'R')) THEN -1 ELSE cohead_id END AS _coheadid, cohead_id, cohead_holdtype, cohead_number, cust_name, CASE WHEN (cohead_holdtype='N') THEN <? value("none") ?> WHEN (cohead_holdtype='C') THEN <? value("credit") ?> WHEN (cohead_holdtype='S') THEN <? value("ship") ?> WHEN (cohead_holdtype='P') THEN <? value("pack") ?> WHEN (cohead_holdtype='R') THEN <? value("return") ?> ELSE <? value("Other") ?> END AS f_holdtype, formatDate(cohead_orderdate) AS f_orderdate, formatDate(MIN(coitem_scheddate)) AS f_scheddate, formatDate(cohead_packdate) AS f_packdate, <? if exists("showPrices") ?> formatExtPrice( SUM( (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio) ) ) <? else ?> text('') <? endif ?> AS f_extprice, SUM( (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio) ) AS backlog, MIN(coitem_scheddate) AS scheddate, COALESCE(MIN(shipitem_id), 0) AS shipped FROM cohead, itemsite, item, custinfo, coitem LEFT OUTER JOIN shipitem ON (shipitem_orderitem_id=coitem_id) WHERE ( (coitem_cohead_id=cohead_id) AND (cohead_cust_id=cust_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (coitem_status='O') AND (cohead_id IN ( SELECT DISTINCT coitem_cohead_id FROM coitem WHERE (coitem_qtyshipped > 0) )) AND (coitem_qtyshipped < coitem_qtyord) AND (coitem_scheddate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) GROUP BY cohead_id, cohead_number, cust_name, cohead_holdtype, cohead_orderdate, cohead_packdate ORDER BY scheddate, cohead_number; head SELECT <? if exists("warehous_id") ?> ( SELECT (warehous_code||'-'||warehous_descrip) FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("showPrices") ?> text('$ Amount') <? else ?> text('') <? endif ?> AS f_amount, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate; 205 484 75 220 20 Arial 10 bold head startdate 113 75 220 20 Arial 10 bold head warehouse 484 95 220 20 Arial 10 bold head enddate 5 200 745 200 2 665 185 80 15 Arial 8 normal head f_amount 8 28 665 5 80 15 Arial 8 normal head f_amount 5 20 745 20 2
    detail detail 18 580 0 80 15 Arial 8 bold detail f_packdate 409 0 80 15 Arial 8 bold detail f_orderdate 75 0 250 15 Arial 8 bold detail cust_name 665 0 80 15 Arial 8 bold detail f_extprice 325 0 80 15 Arial 8 bold detail f_holdtype 495 0 80 15 Arial 8 bold detail f_scheddate 5 0 65 15 Arial 8 bold detail cohead_number
    19 80 0 140 15 Arial 8 bold Context Query report_date 715 0 30 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PendingBOMChanges.xml000066400000000000000000000466631217451700100221660ustar00rootroot00000000000000 Pending Bill of Material Changes PendingBOMChanges 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, uom_name, item_descrip1, item_descrip2, CASE WHEN (<? value("cutOffDate") ?> >= date('2099-12-31')) THEN text('Latest') ELSE formatDate(<? value("cutOffDate") ?>) END AS cutoffdate FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("item_id") ?>); detail SELECT formatDate(bomitem_effective) as actiondate, 'Effective' AS action, bomitem_seqnumber, item_number, uom_name, item_descrip1, item_descrip2, uom_name, formatQty(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyfxd)) AS qtyfxd, formatQtyPer(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper)) AS qtyper, formatScrap(bomitem_scrap) AS scrap, formatQtyPer(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, (bomitem_qtyfxd + bomitem_qtyper) * (1 + bomitem_scrap))) AS qtyreq, formatDate(bomitem_effective, 'Always') AS effective, formatDate(bomitem_expires, 'Never') AS expires, formatBoolYN(bomitem_createwo) AS createchild, CASE WHEN (bomitem_issuemethod='S') THEN 'Push' WHEN (bomitem_issuemethod='L') THEN 'Pull' WHEN (bomitem_issuemethod='M') THEN 'Mixed' ELSE 'Special' END AS issuemethod FROM bomitem(<? value("item_id") ?>,<? value("revision_id") ?>), item, uom WHERE ((bomitem_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (bomitem_effective BETWEEN CURRENT_DATE AND <? value("cutOffDate") ?>) ) UNION SELECT formatDate(bomitem_expires) as actiondate, 'Expires' AS action, bomitem_seqnumber, item_number, uom_name, item_descrip1, item_descrip2, uom_name, formatQty(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyfxd)) AS qtyfxd, formatQtyPer(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper)) AS qtyper, formatScrap(bomitem_scrap) AS scrap, formatQtyPer(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper + (1 * bomitem_scrap))) AS qtyreq, formatDate(bomitem_effective, 'Always') AS effective, formatDate(bomitem_expires, 'Never') AS expires, formatBoolYN(bomitem_createwo) AS createchild, CASE WHEN (bomitem_issuemethod='S') THEN 'Push' WHEN (bomitem_issuemethod='L') THEN 'Pull' WHEN (bomitem_issuemethod='M') THEN 'Mixed' ELSE 'Special' END AS issuemethod FROM bomitem(<? value("item_id") ?>,<? value("revision_id") ?>), item, uom WHERE ((bomitem_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (bomitem_expires BETWEEN CURRENT_DATE AND <? value("cutOffDate") ?>) ) ORDER BY action, actiondate, bomitem_seqnumber; bomhead SELECT bomhead_docnum, bomhead_revision, formatDate(bomhead_revisiondate) AS f_revisiondate FROM bomhead WHERE ((bomhead_item_id=<? value("item_id") ?>) AND (bomhead_rev_id=<? value("revision_id") ?>)); 234 120 140 300 20 Arial 10 bold head item_descrip1 5 229 745 229 2 475 140 200 20 Arial 10 bold bomhead f_revisiondate 430 55 110 20 Arial 10 bold head cutoffdate 120 120 200 20 Arial 10 bold head item_number 475 160 200 20 Arial 10 bold bomhead bomhead_revision 120 160 300 20 Arial 10 bold head item_descrip2 475 120 200 20 Arial 10 bold bomhead bomhead_docnum 6 36 5 30 745 30 2
    detail detail 53 100 0 75 15 Arial 8 normal detail actiondate 5 0 75 15 Arial 8 normal detail action 600 0 75 15 Arial 8 bold detail scrap 600 15 75 15 Arial 8 bold detail createchild 254 30 229 15 Arial 8 bold detail item_descrip2 675 15 75 15 Arial 8 bold detail issuemethod 254 0 229 15 Arial 8 bold detail item_number 254 15 229 15 Arial 8 bold detail item_descrip1 675 0 75 15 Arial 8 bold detail qtyreq 5 45 745 45 0 560 0 38 15 Arial 8 bold detail uom_name 484 0 75 15 Arial 8 bold detail qtyper 204 0 40 15 Arial 8 bold detail bomitem_seqnumber 485 14 75 15 Arial 8 bold detail qtyfxd
    18 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PendingWOMaterialAvailability.xml000066400000000000000000000313761217451700100246120ustar00rootroot00000000000000 Pending W/O Material Availability PendingWOMaterialAvailability 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse FROM item WHERE (item_id=<? value("item_id") ?>); detail pendingAvailability detail 234 140 140 300 20 Arial 10 bold head item_descrip2 140 160 200 20 Arial 10 bold head warehouse 5 229 745 229 2 140 100 198 20 Arial 10 bold head item_number 140 120 300 20 Arial 10 bold head item_descrip1 6 36 5 30 745 30 2
    detail detail 41 290 0 100 15 Arial 8 bold detail uom_name 405 0 80 15 Arial 8 bold detail pendalloc qty 6 32 745 32 0 110 -1 150 15 Arial 8 bold detail item_number 575 0 80 15 Arial 8 bold detail qoh qty 110 15 615 15 Arial 8 bold detail item_descrip 490 0 80 15 Arial 8 bold detail totalalloc qty 660 0 80 15 Arial 8 bold detail totalavail qty 60 -1 35 15 Arial 8 bold detail bomitem_seqnumber 15 -1 35 15 Arial 8 bold detail bomdata_bomwork_level
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/PickList.xml000066400000000000000000000401651217451700100204640ustar00rootroot00000000000000 Pick List PickList Letter 50 28 0 0 Head SELECT formatWoNumber(wo_id) AS wonumber, wo_prodnotes, item_number, uom_name, item_descrip1, item_descrip2, warehous_code, formatQty(wo_qtyord) AS qtyord, formatQty(wo_qtyrcv) AS qtyrcv, formatDate(wo_startdate) AS startdate, formatDate(wo_duedate) AS duedate FROM wo, itemsite, item, whsinfo, uom WHERE ((wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (wo_id=%1)) Detail SELECT item_number, uom_name, item_descrip1, item_descrip2, formatQty(womatl_qtyreq) AS qtyreq, formatQty(womatl_qtyiss) AS qtyiss, formatQty(noNeg(womatl_qtyreq - womatl_qtyiss)) AS qtybalance, itemsite_location, CASE WHEN (womatl_issuemethod='S') THEN text('Push') WHEN (womatl_issuemethod='L') THEN text('Pull') WHEN (womatl_issuemethod='M') THEN text('Mixed') ELSE text(womatl_issuemethod) END AS f_issuemethod FROM womatl, itemsite, item, uom WHERE ((item_picklist) AND (womatl_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (womatl_uom_id=uom_id) AND (womatl_wo_id=%1) ); 246 196 140 100 20 Arial 14 normal Head qtyord 653 65 150 20 Arial 14 normal Head wonumber 196 102 300 17 Arial 10 normal Head item_descrip2 653 102 130 20 Arial 14 normal Head startdate 653 84 130 20 Arial 14 normal Context Query report_date 653 121 130 20 Arial 14 normal Head duedate 196 65 200 20 Arial 14 normal Head item_number 196 158 100 20 Arial 14 normal Head qtyrcv 196 84 300 17 Arial 10 normal Head item_descrip1 195 120 120 20 Arial 14 normal Head warehous_code 10 240 822 240 2 6 47 10 40 822 40 2
    detail Detail 61 215 0 130 20 Arial 10 normal Detail itemsite_location 45 0 160 20 Arial 10 normal Detail item_number 680 30 780 30 1 350 0 100 20 Arial 10 normal Detail qtyreq 457 0 100 20 Arial 10 normal Detail qtyiss 350 20 100 20 Arial 10 normal Detail uom_name 46 37 300 14 Arial 8 normal Detail item_descrip2 459 20 100 20 Arial 10 normal Detail f_issuemethod 10 55 822 55 0 569 0 100 20 Arial 10 normal Detail qtybalance 45 20 300 14 Arial 8 normal Detail item_descrip1
    57 46 28 746 22 0 Arial 12 48 Head wo_prodnotes
    qt-client-4.1.0/share/reports/PickListWOShowLocations.xml000066400000000000000000000520241217451700100234440ustar00rootroot00000000000000 Pick List WO Show Locations PickListWOShowLocations This WO Pick List Shows All Locations and Lots for Each Requirement Letter 50 28 33 33 Head SELECT formatWoNumber(wo_id) AS wonumber, wo_prodnotes, item_number, uom_name, item_descrip1, item_descrip2, warehous_code, formatQty(wo_qtyord) AS qtyord, formatQty(wo_qtyrcv) AS qtyrcv, formatDate(wo_startdate) AS startdate, formatDate(wo_duedate) AS duedate FROM wo, itemsite, item, whsinfo, uom WHERE ((wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (wo_id=%1)) Detail SELECT warehous_code, wo_number, womatl_id, item_number, item_descrip1, item_descrip2, uom_name, -- itemuomtouomratio(item_id,item_inv_uom_id, womatl_uom_id) * womatl_qtyreq AS required_qty, womatl_qtyreq AS required_qty, -- formatqty(itemuomtouomratio(item_id,item_inv_uom_id, womatl_uom_id) * womatl_qtyreq) AS required_fmt, formatqty(womatl_qtyreq) AS required_fmt, -- itemuomtouomratio(item_id,item_inv_uom_id, womatl_uom_id) * womatl_qtyiss AS issued_qty, womatl_qtyiss AS issued_qty, formatqty(womatl_qtyiss) AS issued_fmt, -- (itemuomtouomratio(item_id,item_inv_uom_id, womatl_uom_id) * womatl_qtyreq) - (itemuomtouomratio(item_id,item_inv_uom_id, womatl_uom_id) * womatl_qtyiss) AS pick_qty, womatl_qtyreq - womatl_qtyiss AS pick_qty, formatqty(womatl_qtyreq - womatl_qtyiss) AS pick_fmt, CASE WHEN (womatl_issuemethod='S') THEN text('Push') WHEN (womatl_issuemethod='L') THEN text('Pull') WHEN (womatl_issuemethod='M') THEN text('Mixed') ELSE text(womatl_issuemethod) END AS f_issuemethod, location_aisle || '-' || location_rack || '-' || location_bin || '-' || location_name AS location_name, formatlotserialnumber(itemloc_ls_id), -- itemloc_lotserial, itemsite_location_comments AS location_comment, itemloc_qty AS location_qty_qty, itemuomtouomratio(item_id,item_inv_uom_id, womatl_uom_id) * itemloc_qty AS loc_issue_uom_qty, formatqty(itemuomtouomratio(item_id,item_inv_uom_id, womatl_uom_id) * itemloc_qty) AS loc_issue_uom_fmt, CASE WHEN itemloc_expiration = '1970-01-01' THEN text ('N/A') WHEN itemloc_expiration = '2100-01-01' THEN text ('N/A') ELSE CAST(formatdate(itemloc_expiration) AS text) END AS expiration FROM item, uom, whsinfo, womatl, wo, itemsite LEFT OUTER JOIN itemloc ON (itemloc_itemsite_id = itemsite_id) LEFT OUTER JOIN location ON (itemloc_location_id = location_id) WHERE itemsite_item_id = item_id and itemsite_warehous_id = warehous_id and womatl_uom_id = uom_id and itemsite_id = womatl_itemsite_id and womatl_wo_id = wo_id and wo_id = <? value("wo_id") ?> ORDER BY wo_number, womatl_id, item_number, itemloc_expiration, location_name; 188 196 5 150 40 Arial 14 normal Head wonumber 196 140 100 20 Arial 14 normal Head qtyord 195 120 100 20 Arial 14 normal Head warehous_code 196 102 300 17 Arial 10 normal Head item_descrip2 649 100 130 20 Arial 14 normal Head startdate 196 65 200 20 Arial 14 normal Head item_number 649 120 130 20 Arial 14 normal Head duedate 649 80 130 20 Arial 14 normal Context Query report_date 196 84 300 17 Arial 10 normal Head item_descrip1 196 158 100 20 Arial 14 normal Head qtyrcv 6 6
    detail_group detail_group womatl_id 133 208 40 100 20 Arial 10 normal Detail required_fmt 330 55 100 20 Arial 10 normal Detail f_issuemethod 10 35 822 35 2 575 40 45 20 Arial 10 normal Detail uom_name 469 75 300 20 Arial 10 normal Detail location_comment 80 100 817 100 1 469 40 100 20 Arial 10 bold Detail pick_fmt 37 60 195 14 Arial 8 normal Detail item_descrip1 37 40 160 20 Arial 10 normal Detail item_number 208 55 100 20 Arial 10 normal Detail uom_name 37 75 300 14 Arial 8 normal Detail item_descrip2 330 40 100 20 Arial 10 normal Detail issued_fmt 680 57 780 57 1 36 75 25 825 25 1 75 5 822 5 1 465 5 50 20 Arial 10 normal Detail uom_name 355 5 100 20 Arial 10 normal Detail loc_issue_uom_qty qty Detail 21 75 0 115 20 Arial 10 normal Detail location_name 555 0 75 20 Arial 10 normal Detail expiration 465 0 50 20 Arial 10 normal Detail uom_name 690 17 790 17 1 215 0 115 20 Arial 10 normal Detail formatlotserialnumber 355 0 100 20 Arial 10 normal Detail loc_issue_uom_fmt
    57 110 30 480 22 0 Arial 12 48 Head wo_prodnotes
    qt-client-4.1.0/share/reports/PickingListSOClosedLines.xml000066400000000000000000000636241217451700100235560ustar00rootroot00000000000000 Picking List - SO PickingListSOClosedLines Shows Closed Lines -- With Barcodes formatitemsitebarcode(itemsite_id) -- SO # barcoded formatsobarcode(cohead_id) -- With Logo, place logo graphic in images DB with name "logo" 0.05 0.05 Letter 25 25 25 25 head SELECT cust_number, formatsobarcode(cohead_id) AS order_barcode, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cohead_billtoname, cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode) AS billtocitystatezip, cntct_phone AS cust_phone, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_number, cohead_shipvia, cohead_shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments, terms_descrip FROM cohead JOIN custinfo ON (cohead_cust_id=cust_id) JOIN terms ON (cohead_terms_id=terms_id) LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) WHERE (cohead_id=<? value("sohead_id") ?>); scheddate SELECT formatDate(MIN(coitem_scheddate)) AS scheddate FROM coitem WHERE ((coitem_status <> 'X') AND (coitem_cohead_id=<? value("sohead_id") ?>)); detail SELECT 1 AS groupby, coitem_linenumber AS sortline, coitem_subnumber AS sortsubline, formatsolinenumber(coitem_id) AS linenumber, coitem_memo, item_number, formatitemsitebarcode(itemsite_id) AS item_barcode, -- In 2.3 replaced the next line: -- uom_name, -- with: (select uom_name from uom where uom_id = coitem_qty_uom_id) AS uom_name, itemsellinguom(item_id) AS shipuom, item_descrip1, item_descrip2, formatQty(coitem_qtyord) AS ordered, CASE WHEN ((coitem_qtyshipped - coitem_qtyreturned) > 0.0) THEN formatQty(coitem_qtyshipped - coitem_qtyreturned) ELSE NULL END AS shipped, CASE WHEN ((coitem_qtyshipped - coitem_qtyreturned) > 0.0) THEN formatQty(noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) ELSE NULL END AS balance, CASE WHEN (qtyAtShipping('SO', coitem_id) > 0.0) THEN formatQty(qtyAtShipping('SO', coitem_id)) ELSE NULL END AS atShipping, CASE WHEN (coitem_status='O' AND (SELECT cust_creditstatus FROM custinfo,cohead WHERE coitem_cohead_id=cohead_id AND cust_id=cohead_cust_id)='H') THEN 'H' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=CASE WHEN(coitem_subnumber > 0) THEN (coitem_linenumber * 1000) + coitem_subnumber ELSE coitem_linenumber END) AND (cohead_id=coitem_cohead_id))) >= coitem_qtyord)) THEN 'I' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=CASE WHEN(coitem_subnumber > 0) THEN (coitem_linenumber * 1000) + coitem_subnumber ELSE coitem_linenumber END) AND (cohead_id=coitem_cohead_id))) > 0)) THEN 'P' WHEN (coitem_status='O' AND (itemsite_qtyonhand - qtyAllocated(itemsite_id, CURRENT_DATE) + qtyOrdered(itemsite_id, CURRENT_DATE)) >= (coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) THEN 'R' ELSE coitem_status END AS f_status FROM itemsite, item, uom, coitem WHERE ( (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (item_type != 'K') AND (coitem_status <> 'X') AND (coitem_cohead_id=<? value("sohead_id") ?>) ) --2.3 add coitem_qty_uom_id, to the GROUP BY clause GROUP BY coitem_qty_uom_id, linenumber, coitem_linenumber, coitem_subnumber, coitem_id, coitem_memo, item_number, uom_name, shipuom, item_descrip1, item_descrip2, coitem_qtyord, coitem_qty_invuomratio, coitem_qtyshipped, coitem_qtyreturned, coitem_status, coitem_cohead_id, itemsite_id, itemsite_qtyonhand, itemsite_warehous_id, item_id ORDER BY sortline, sortsubline; logo SELECT image_data FROM image WHERE ((image_name='logo')); 477 375 0 425 85 stretch logo image_data 465 280 305 20 10 Arial 10 normal head shipping_address 120 400 252 25 Arial 12 normal head cust_contact 25 425 822 425 0 170 155 170 20 Arial 14 normal head cohead_custponumber 75 280 295 20 10 Arial 10 normal head billing_address 375 95 232 25 128 10 0.01 head order_barcode 465 260 305 20 Arial 14 normal head cohead_shiptoname 432 215 331 20 Arial 14 normal head cohead_shipvia 170 125 170 20 Arial 14 normal head cust_number 75 260 305 20 Arial 14 normal head cohead_billtoname 170 95 100 20 Arial 14 normal head cohead_number 175 195 100 20 Arial 14 normal head orderdate 25 465 822 465 0 175 215 100 20 Arial 14 normal scheddate scheddate 375 160 307 25 3of9 20 0.01 head cohead_custponumber 467 400 320 20 Arial 12 normal head terms_descrip 375 130 177 25 3of9 10 0.01 head cust_number
    detail detail groupby 73 50 5 625 17 14 Arial 10 normal head cohead_shipcomments lineitem linenumber 28 5 5 842 5 0 detail 156 415 80 500 80 0 305 110 395 110 0 80 80 170 80 0 745 15 795 15 1 25 0 200 20 Arial 11 bold detail item_number 100 120 700 17 14 Arial 10 normal detail coitem_memo 415 110 500 110 0 305 80 395 80 0 630 95 85 15 Arial 10 normal detail f_status 365 30 467 35 128 15 0.01 detail item_barcode 190 80 280 80 0 530 0 100 20 Arial 10 normal detail balance 80 110 170 110 0 632 80 720 80 0 25 40 295 20 Arial 11 bold detail item_descrip2 320 0 100 20 Arial 10 normal detail ordered 227 0 85 20 Arial 10 normal detail uom_name 425 0 100 20 Arial 10 normal detail shipped 190 110 280 110 0 25 20 295 20 Arial 11 bold detail item_descrip1 635 0 100 20 Arial 10 normal detail atshipping
    57 735 5 45 17 Arial 8 normal Context Query page_number 90 5 95 17 Arial 8 normal Context Query report_date 455 5 80 17 Arial 8 normal head cohead_number 113 186 90 360 90 0 185 25 362 25 0
    qt-client-4.1.0/share/reports/PickingListSOLocsNoClosedLines.xml000066400000000000000000001017761217451700100246750ustar00rootroot00000000000000 Picking List SO With Locations PickingListSOLocsNoClosedLines This report definition shows location / lot / serial information on an SO Pick List. If the item is not Location Controlled it shows the contents of its Location Comment in the corresponding Item Site record. 0.05 0.05 Letter 25 25 25 25 head SELECT cust_number, formatsobarcode(cohead_id) AS order_barcode, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cohead_billtoname, cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode) AS billtocitystatezip, cntct_phone AS cust_phone, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_number, cohead_shipvia, cohead_shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments, terms_descrip FROM custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) JOIN cohead ON (cohead_cust_id=cust_id) LEFT OUTER JOIN terms ON (cohead_terms_id=terms_id) WHERE (cohead_id=<? value("sohead_id") ?>) -- AND (cohead_id='9999') ); scheddate SELECT formatDate(MIN(coitem_scheddate)) AS scheddate FROM coitem WHERE ((coitem_status <> 'X') AND (coitem_cohead_id=<? value("sohead_id") ?>)); detail SELECT coitem_linenumber AS sortline, coitem_subnumber AS sortsubline, formatsolinenumber(coitem_id) AS linenumber, coitem_memo, item_number, formatitemsitebarcode(itemsite_id) AS item_barcode, CASE WHEN (formatLocationName(location_id) = 'N/A') THEN itemsite_location_comments || ' ' || '(comment)' ELSE formatLocationName(location_id) END AS location_name, itemsite_location_comments AS location_comment, formatlotserialnumber(itemloc_ls_id), formatDate(itemloc_expiration, 'N/A') AS expiration, itemloc_qty AS location_qty_qty, CASE WHEN (SELECT metric_value::boolean FROM metric WHERE metric_name = 'EnableSOReservationsByLocation') THEN formatQty(qtyReservedLocation(itemloc_id, 'SO', coitem_id)) ELSE formatQty(0) END AS location_reserved_qty, itemuomtouomratio(item_id,item_inv_uom_id, coitem_qty_uom_id) * itemloc_qty AS loc_issue_uom_qty, formatqty(itemuomtouomratio(item_id,item_inv_uom_id, coitem_qty_uom_id) * itemloc_qty) AS loc_issue_uom_fmt, coitemuom.uom_name AS uom_name, item_descrip1, item_descrip2, formatQty(coitem_qtyord) AS ordered, CASE WHEN ((coitem_qtyshipped - coitem_qtyreturned) > 0.0) THEN formatQty(coitem_qtyshipped - coitem_qtyreturned) ELSE NULL END AS shipped, CASE WHEN ((coitem_qtyshipped - coitem_qtyreturned) > 0.0) THEN formatQty(noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) ELSE NULL END AS balance, CASE WHEN (qtyAtShipping('SO', coitem_id) > 0.0) THEN formatQty(qtyAtShipping('SO', coitem_id)) ELSE NULL END AS atShipping, formatQty(roundUp((coitem_qtyord * coitem_qty_invuomratio))) AS shipordered, formatQty(roundUp(((coitem_qtyshipped - coitem_qtyreturned) * coitem_qty_invuomratio))) AS shipshipped, formatQty(roundUp((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio))) AS shipbalance, CASE WHEN (coitem_status='O' AND cust_creditstatus='H') THEN 'H' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=CASE WHEN(coitem_subnumber > 0) THEN (coitem_linenumber * 1000) + coitem_subnumber ELSE coitem_linenumber END) AND (cohead_id=coitem_cohead_id))) >= coitem_qtyord)) THEN 'I' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=CASE WHEN(coitem_subnumber > 0) THEN (coitem_linenumber * 1000) + coitem_subnumber ELSE coitem_linenumber END) AND (cohead_id=coitem_cohead_id))) > 0)) THEN 'P' WHEN (coitem_status='O' AND (itemsite_qtyonhand - qtyAllocated(itemsite_id, CURRENT_DATE) + qtyOrdered(itemsite_id, CURRENT_DATE)) >= (coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) THEN 'R' ELSE coitem_status END AS f_status FROM coitem JOIN cohead ON (cohead_id = coitem_cohead_id) JOIN custinfo ON (cust_id = cohead_cust_id) JOIN itemsite ON (itemsite_id = coitem_itemsite_id) JOIN item ON (item_id = itemsite_item_id) JOIN whsinfo ON (warehous_id = itemsite_warehous_id) JOIN uom invuom ON (invuom.uom_id = item_inv_uom_id) JOIN uom coitemuom ON (coitemuom.uom_id = coitem_qty_uom_id) LEFT OUTER JOIN itemloc ON (itemloc_itemsite_id = itemsite_id) LEFT OUTER JOIN location ON (itemloc_location_id = location_id) WHERE ( (coitem_status <> 'X') AND (coitem_status <> 'C') AND (item_type != 'K') --REMOVE LINE ABOVE AND CLOSED LINES WILL BE DISPLAYED AND (coitem_cohead_id=<? value("sohead_id") ?>) ) ORDER BY sortline, sortsubline, expiration, location_name; logo SELECT image_data FROM image WHERE ((image_name='logo')); 467 375 5 425 85 stretch logo image_data 170 125 170 20 Arial 14 normal head cust_number 75 280 295 20 10 Arial 10 normal head billing_address 5 425 797 425 0 100 400 253 25 Arial 12 normal head cust_contact 170 200 100 20 Arial 14 normal scheddate scheddate 475 400 320 20 Arial 12 normal head terms_descrip 170 220 390 20 Arial 14 normal head cohead_shipvia 170 155 170 20 Arial 14 normal head cohead_custponumber 170 95 100 20 Arial 14 normal head cohead_number 375 130 177 25 3of9 10 0.01 head cust_number 375 95 233 25 128 10 0.01 head order_barcode 170 180 100 20 Arial 14 normal head orderdate 465 260 305 20 Arial 14 normal head cohead_shiptoname 75 260 305 20 Arial 14 normal head cohead_billtoname 465 280 305 20 10 Arial 10 normal head shipping_address 375 160 307 25 3of9 20 0.01 head cohead_custponumber
    detail lineitems linenumber 132 5 5 797 5 2 30 25 285 20 Arial 11 bold detail item_descrip1 20 10 200 20 Arial 11 bold detail item_number 408 35 380 45 128 15 0.01 detail item_barcode 225 10 85 20 Arial 10 normal detail uom_name 620 10 100 20 Arial 10 normal detail atshipping 135 75 175 75 0 75 75 112 75 0 75 95 112 95 0 252 75 295 75 0 515 10 100 20 Arial 10 bold detail balance 252 95 295 95 0 615 30 535 30 0 135 95 175 95 0 415 10 100 20 Arial 10 normal detail shipped 745 25 795 25 1 195 95 235 95 0 365 30 25 17 Arial 10 normal detail f_status 30 40 285 20 Arial 11 bold detail item_descrip2 195 75 235 75 0 70 120 793 120 0 305 10 100 20 Arial 10 normal detail ordered 29 490 5 50 20 Arial 10 normal detail uom_name 70 5 793 5 0 415 5 70 20 Arial 10 normal detail loc_issue_uom_qty qty 110 5 135 17 Arial 10 normal detail item_number detail 29 250 0 145 20 Arial 10 normal detail formatlotserialnumber 490 0 70 20 Arial 10 normal detail location_reserved_qty 415 0 70 20 Arial 10 normal detail loc_issue_uom_fmt 745 15 795 15 1 80 0 155 20 Arial 10 normal detail location_name 565 0 50 20 Arial 10 normal detail uom_name 635 0 85 20 Arial 10 normal detail expiration
    29 750 5 45 17 Arial 8 normal Context Query page_number 430 5 80 17 Arial 8 normal head cohead_number 70 5 95 17 Arial 8 normal Context Query report_date 94 0 0 203 0 2 215 35 580 17 14 Arial 10 normal head cohead_shipcomments 202 0 203 55 2 155 25 195 25 0 155 50 195 50 0 0 55 203 55 2
    qt-client-4.1.0/share/reports/PickingListSONoClosedLines.xml000066400000000000000000000651231217451700100240470ustar00rootroot00000000000000 Picking List PickingListSONoClosedLines Omits Closed Lines -- With Barcodes formatitemsitebarcode(itemsite_id) -- SO # barcoded formatsobarcode(cohead_id) -- With Logo, place logo graphic in images DB with name "logo" 0.05 0.05 Letter 25 25 25 25 head SELECT cust_number, formatsobarcode(cohead_id) AS order_barcode, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cohead_billtoname, cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode) AS billtocitystatezip, cntct_phone AS cust_phone, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_number, cohead_shipvia, cohead_shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments, terms_descrip FROM cohead JOIN custinfo ON (cohead_cust_id=cust_id) LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) JOIN terms ON (cohead_terms_id=terms_id) WHERE (cohead_id=<? value("sohead_id") ?>); scheddate SELECT formatDate(MIN(coitem_scheddate)) AS scheddate FROM coitem WHERE ((coitem_status <> 'X') AND (coitem_cohead_id=<? value("sohead_id") ?>)); detail SELECT 1 AS groupby, coitem_linenumber AS sortline, coitem_subnumber AS sortsubline, formatsolinenumber(coitem_id) AS linenumber, coitem_memo, item_number, formatitemsitebarcode(itemsite_id) AS item_barcode, (select uom_name from uom where uom_id = coitem_qty_uom_id) AS item_invuom, item_descrip1, item_descrip2, formatQty(coitem_qtyord) AS ordered, CASE WHEN ((coitem_qtyshipped - coitem_qtyreturned) > 0.0) THEN formatQty(coitem_qtyshipped - coitem_qtyreturned) ELSE NULL END AS shipped, CASE WHEN ((coitem_qtyshipped - coitem_qtyreturned) > 0.0) THEN formatQty(noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) ELSE NULL END AS balance, CASE WHEN (qtyAtShipping('SO', coitem_id) > 0.0) THEN formatQty(qtyAtShipping('SO', coitem_id)) ELSE NULL END AS atShipping, formatQty(roundUp( ( SELECT COALESCE(SUM(shipitem_qty), 0) FROM shipitem, shiphead WHERE ( (shipitem_orderitem_id=coitem_id) AND (shipitem_shiphead_id=shiphead_id) AND (NOT shiphead_shipped) ) )/ CASE WHEN(itemuomratiobytype(item_id, 'Selling') = 0) THEN 1 ELSE itemuomratiobytype(item_id, 'Selling') END ) ) AS shipatshipping, CASE WHEN (coitem_status='O' AND (SELECT cust_creditstatus FROM custinfo,cohead WHERE coitem_cohead_id=cohead_id AND cust_id=cohead_cust_id)='H') THEN 'H' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=CASE WHEN(coitem_subnumber > 0) THEN (coitem_linenumber * 1000) + coitem_subnumber ELSE coitem_linenumber END) AND (cohead_id=coitem_cohead_id))) >= coitem_qtyord)) THEN 'I' WHEN (coitem_status='O' AND ((SELECT SUM(invcitem_billed) FROM cohead, invchead, invcitem WHERE ((invchead_ordernumber=cohead_number) AND (invcitem_invchead_id=invchead_id) AND (invcitem_item_id=item_id) AND (invcitem_warehous_id=itemsite_warehous_id) AND (invcitem_linenumber=CASE WHEN(coitem_subnumber > 0) THEN (coitem_linenumber * 1000) + coitem_subnumber ELSE coitem_linenumber END) AND (cohead_id=coitem_cohead_id))) > 0)) THEN 'P' WHEN (coitem_status='O' AND (itemsite_qtyonhand - qtyAllocated(itemsite_id, CURRENT_DATE) + qtyOrdered(itemsite_id, CURRENT_DATE)) >= (coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) THEN 'R' ELSE coitem_status END AS f_status FROM itemsite, item, uom, coitem WHERE ( (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (coitem_status <> 'X') AND (coitem_status <> 'C') AND (item_type != 'K') -- 1 REMOVE THIS AND CLOSED LINES WILL NOT DISPLAY ON PACKING LIST <? if exists("hide closed") ?> AND (coitem_status <> 'C') -- 2 REMOVE THIS AND CLOSED LINES WILL NOT DISPLAY ON PACKING LIST <? endif ?> AND (coitem_cohead_id=<? value("sohead_id") ?>) ) GROUP BY coitem_qty_uom_id, coitem_linenumber, coitem_subnumber, coitem_id, coitem_memo, item_number, item_invuom, item_descrip1, item_descrip2, coitem_qtyord, coitem_qty_invuomratio, coitem_qtyshipped, coitem_qtyreturned, coitem_status, coitem_cohead_id, itemsite_id, itemsite_qtyonhand, itemsite_warehous_id, item_id ORDER BY sortline, sortsubline; logo SELECT image_data FROM image WHERE ((image_name='logo')); 477 375 0 425 85 stretch logo image_data 120 400 253 25 Arial 12 normal head cust_contact 375 160 307 25 3of9 20 0.01 head cohead_custponumber 175 215 100 20 Arial 14 normal scheddate scheddate 465 280 305 20 10 Arial 10 normal head shipping_address 170 125 170 20 Arial 14 normal head cust_number 433 215 331 20 Arial 14 normal head cohead_shipvia 468 400 320 20 Arial 12 normal head terms_descrip 170 155 170 20 Arial 14 normal head cohead_custponumber 75 280 295 20 10 Arial 10 normal head billing_address 375 95 233 25 128 10 0.01 head order_barcode 175 195 100 20 Arial 14 normal head orderdate 170 95 100 20 Arial 14 normal head cohead_number 25 465 823 465 0 25 425 823 425 0 465 260 305 20 Arial 14 normal head cohead_shiptoname 375 130 177 25 3of9 10 0.01 head cust_number 75 260 305 20 Arial 14 normal head cohead_billtoname
    detail detail groupby 68 50 5 625 17 14 Arial 10 normal head cohead_shipcomments lineitem linenumber 23 5 5 843 5 0 detail 148 630 95 85 15 Arial 10 normal detail f_status 25 40 295 20 Arial 11 bold detail item_descrip2 190 110 280 110 0 635 0 100 20 Arial 10 normal detail atshipping 25 20 295 20 Arial 11 bold detail item_descrip1 100 120 700 17 14 Arial 10 normal detail coitem_memo 415 110 500 110 0 415 80 500 80 0 80 110 170 110 0 190 80 280 80 0 530 0 100 20 Arial 10 normal detail balance 305 110 395 110 0 305 80 395 80 0 25 0 200 20 Arial 11 bold detail item_number 425 0 100 20 Arial 10 normal detail shipped 228 0 85 20 Arial 10 normal detail item_invuom 745 15 795 15 1 80 80 170 80 0 365 30 468 35 128 15 0.01 detail item_barcode 632 80 720 80 0 320 0 100 20 Arial 10 normal detail ordered
    56 455 5 80 17 Arial 8 normal head cohead_number 90 5 95 17 Arial 8 normal Context Query report_date 735 5 45 17 Arial 8 normal Context Query page_number 111 185 25 363 25 0 186 90 360 90 0
    qt-client-4.1.0/share/reports/PlannerCodeMasterList.xml000066400000000000000000000101331217451700100231340ustar00rootroot00000000000000 Planner Code Master List PlannerCodeMasterList Letter 50 50 50 50 detail SELECT plancode_id, plancode_code, plancode_name FROM plancode ORDER BY plancode_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 175 0 565 15 Arial 8 bold detail plancode_name 10 0 150 15 Arial 8 bold detail plancode_code
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PricesByCustomer.xml000066400000000000000000000430531217451700100222030ustar00rootroot00000000000000 Prices By Customer PricesByCustomer Letter 50 50 50 50 head SELECT cust_name, addr_line1 AS cust_address1, addr_line2 AS cust_address2, addr_line3 AS cust_address3, <? if exists("showExpired") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showexpired, <? if exists("showFuture") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showfuture, <? if exists("showCosts") ?> <? if exists("actualCosts") ?> text('Show Costs and Margins using Actual Costs') <? else ?> text('Show Costs and Margins using Standard Costs') <? endif ?> AS f_showcosts, text('Cost') AS f_costlabel, text('Margin') AS f_marginlabel <? else ?> text('') AS f_showcosts, text('') AS f_costlabel, text('') AS f_marginlabel <? endif ?> FROM custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE (cust_id=<? value("cust_id") ?>); detail SELECT itemid, sourcetype, schedulename, type, itemnumber, item_descrip1, item_descrip2, CASE WHEN (qtybreak = -1) THEN 'N/A' ELSE formatQty(qtybreak) END AS f_qtybreak, price, formatPrice(price) AS f_price, <? if exists("showCosts") ?> cost AS cost, formatCost(cost) AS f_cost, CASE WHEN ((price = 0) OR (cost = 0)) THEN 'N/A' ELSE formatScrap((price - cost) / price) END AS f_margin <? else ?> 0 AS cost, text('') AS f_cost, text('') AS f_margin <? endif ?> FROM ( SELECT ipsprice_id AS itemid, 1 AS sourcetype, ipshead_name AS schedulename, 'Customer' AS type, item_number AS itemnumber, item_descrip1, item_descrip2, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, item WHERE ((ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsprice_item_id=item_id) AND (ipsass_cust_id=<? value("cust_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 2 AS sourcetype, ipshead_name AS schedulename, 'Cust. Type' AS type, item_number AS itemnumber, item_descrip1, item_descrip2, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, item, custinfo WHERE ((ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsprice_item_id=item_id) AND (ipsass_custtype_id=cust_custtype_id) AND (cust_id=<? value("cust_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 3 AS sourcetype, ipshead_name AS schedulename, ('Sale' || '-' || sale_name) AS type, item_number AS itemnumber, item_descrip1, item_descrip2, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM sale, ipshead, ipsprice, item WHERE ((sale_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsprice_item_id=item_id) <? if not exists("showExpired") ?> AND (sale_enddate > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (sale_startdate <= CURRENT_DATE) <? endif ?> ) UNION SELECT item_id AS itemid, 0 AS sourcetype, '' AS schedulename, 'List Price' AS type, item_number AS itemnumber, item_descrip1, item_descrip2, -1 AS qtybreak, (item_listprice - (item_listprice * cust_discntprcnt)) AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM item, custinfo WHERE ( (item_sold) AND (item_active) AND (cust_id=<? value("cust_id") ?>) AND (NOT item_exclusive) ) ) AS data ORDER BY itemnumber, price; 236 565 120 114 20 Arial 10 bold head f_showfuture 100 80 605 20 Arial 10 bold head cust_name 665 200 80 15 Arial 8 normal head f_marginlabel 585 200 80 15 Arial 8 normal head f_costlabel 5 229 745 229 2 100 140 300 20 Arial 10 bold head cust_address3 100 100 300 20 Arial 10 bold head cust_address1 405 140 335 20 Arial 10 bold head f_showcosts 565 100 114 20 Arial 10 bold head f_showexpired 100 120 300 20 Arial 10 bold head cust_address2 6 41 665 5 80 15 Arial 8 normal head f_marginlabel 5 35 745 35 2 585 5 80 15 Arial 8 normal head f_costlabel
    detail detail 56 10 30 240 15 Arial 8 bold detail item_descrip2 10 0 150 15 Arial 8 bold detail itemnumber 425 0 80 15 Arial 8 bold detail f_qtybreak 5 50 745 50 0 585 0 80 15 Arial 8 bold detail f_cost 195 0 120 15 Arial 8 bold detail schedulename 505 0 80 15 Arial 8 bold detail f_price 10 15 240 15 Arial 8 bold detail item_descrip1 665 0 80 15 Arial 8 bold detail f_margin 320 0 100 15 Arial 8 bold detail type
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PricesByCustomerType.xml000066400000000000000000000370401217451700100230440ustar00rootroot00000000000000 Prices By Customer Type PricesByCustomerType Letter 50 50 50 50 head SELECT (custtype_code || '-' || custtype_descrip) as custtype, <? if exists("showExpired") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showexpired, <? if exists("showFuture") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showfuture, <? if exists("showCosts") ?> <? if exists("actualCosts") ?> text('Show Costs and Margins using Actual Costs') <? else ?> text('Show Costs and Margins using Standard Costs') <? endif ?> AS f_showcosts, text('Cost') AS f_costlabel, text('Margin') AS f_marginlabel <? else ?> text('') AS f_showcosts, text('') AS f_costlabel, text('') AS f_marginlabel <? endif ?> FROM custtype WHERE (custtype_id=<? value("custtype_id") ?>); detail SELECT itemid, sourcetype, schedulename, type, itemnumber, item_descrip1, item_descrip2, CASE WHEN (qtybreak = -1) THEN 'N/A' ELSE formatQty(qtybreak) END AS f_qtybreak, price, formatSalesPrice(price) AS f_price, <? if exists("showCosts") ?> cost AS cost, formatCost(cost) AS f_cost, CASE WHEN ((price = 0) OR (cost = 0)) THEN 'N/A' ELSE formatScrap((price - cost) / price) END AS f_margin <? else ?> 0 AS cost, '' AS f_cost, '' AS f_margin <? endif ?> FROM ( SELECT ipsprice_id AS itemid, 2 AS sourcetype, ipshead_name AS schedulename, 'Cust. Type' AS type, item_number AS itemnumber, item_descrip1, item_descrip2, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(ipsprice_item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(ipsprice_item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, item WHERE ((ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsprice_item_id=item_id) AND (ipsass_custtype_id=<? value("custtype_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 3 AS sourcetype, ipshead_name AS schedulename, ('Sale' || '-' || sale_name) AS type, item_number AS itemnumber, item_descrip1, item_descrip2, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(ipsprice_item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(ipsprice_item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM sale, ipshead, ipsprice, item WHERE ( (sale_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsprice_item_id=item_id) <? if not exists("showExpired") ?> AND (sale_enddate > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (sale_startdate <= CURRENT_DATE) <? endif ?> ) UNION SELECT item_id AS itemid, 0 AS sourcetype, '' AS schedulename, 'List Price' AS type, item_number AS itemnumber, item_descrip1, item_descrip2, -1 AS qtybreak, item_listprice AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM item WHERE ( (item_sold) AND (item_active) AND (NOT item_exclusive) ) ) AS data ORDER BY itemnumber, price; 236 585 200 80 15 Arial 8 normal head f_costlabel 665 200 80 15 Arial 8 normal head f_marginlabel 130 80 500 20 Arial 10 bold head custtype 565 120 113 20 Arial 10 bold head f_showfuture 565 100 113 20 Arial 10 bold head f_showexpired 5 229 745 229 2 405 140 335 20 Arial 10 bold head f_showcosts 6 41 665 5 80 15 Arial 8 normal head f_marginlabel 5 35 745 35 2 585 5 80 15 Arial 8 normal head f_costlabel
    detail detail 56 5 50 745 50 0 425 0 80 15 Arial 8 bold detail f_qtybreak 10 15 240 15 Arial 8 bold detail item_descrip1 195 0 120 15 Arial 8 bold detail schedulename 10 0 150 15 Arial 8 bold detail itemnumber 505 0 80 15 Arial 8 bold detail f_price 665 0 80 15 Arial 8 bold detail f_margin 10 30 240 15 Arial 8 bold detail item_descrip2 585 0 80 15 Arial 8 bold detail f_cost 320 0 100 15 Arial 8 bold detail type
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PricesByItem.xml000066400000000000000000000457511217451700100213070ustar00rootroot00000000000000 Prices By Item PricesByItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, <? if exists("showExpired") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showexpired, <? if exists("showFuture") ?> text('Yes') <? else ?> text('No') <? endif ?> AS f_showfuture, <? if exists("showCosts") ?> <? if exists("actualCosts") ?> text('Show Costs and Margins using Actual Costs') <? else ?> text('Show Costs and Margins using Standard Costs') <? endif ?> AS f_showcosts, text('Cost') AS f_costlabel, text('Margin') AS f_marginlabel <? else ?> text('') AS f_showcosts, text('') AS f_costlabel, text('') AS f_marginlabel <? endif ?> FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT itemid, sourcetype, schedulename, type, typename, CASE WHEN (qtybreak = -1) THEN 'N/A' ELSE formatQty(qtybreak) END AS f_qtybreak, price, formatPrice(price) AS f_price, <? if exists("showCosts") ?> cost AS cost, formatCost(cost) AS f_cost, CASE WHEN ((price = 0) OR (cost = 0)) THEN 'N/A' ELSE formatScrap((price - cost) / price) END AS f_margin <? else ?> 0 AS cost, text('') AS f_cost, text('') AS f_margin <? endif ?> FROM ( SELECT ipsprice_id AS itemid, 1 AS sourcetype, ipshead_name AS schedulename, 'Customer' AS type, cust_name AS typename, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, custinfo, item WHERE ( (ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsass_cust_id=cust_id) AND (ipsprice_item_id=item_id) AND (item_id=<? value("item_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 2 AS sourcetype, ipshead_name AS schedulename, 'Cust. Type' AS type, (custtype_code || '-' || custtype_descrip) AS typename, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, custtype, item WHERE ( (ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsass_custtype_id=custtype_id) AND (ipsprice_item_id=item_id) AND (item_id=<? value("item_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 3 AS sourcetype, ipshead_name AS schedulename, 'Cust. Type Pattern' AS type, (custtype_code || '-' || custtype_descrip) AS typename, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, custtype, item WHERE ( (ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (COALESCE(LENGTH(ipsass_custtype_pattern), 0) > 0) AND (custtype_code ~ ipsass_custtype_pattern) AND (ipsprice_item_id=item_id) AND (item_id=<? value("item_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 4 AS sourcetype, ipshead_name AS schedulename, 'Sale' AS type, sale_name AS typename, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM sale, ipshead, ipsprice, item WHERE ( (sale_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsprice_item_id=item_id) AND (item_id=<? value("item_id") ?>) <? if not exists("showExpired") ?> AND (sale_enddate > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (sale_startdate <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 5 AS sourcetype, ipshead_name AS schedulename, 'Cust. Ship-To' AS type, (cust_name || '-' || shipto_num) AS typename, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, custinfo, shiptoinfo, item WHERE ( (ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (ipsass_shipto_id=shipto_id) AND (shipto_cust_id=cust_id) AND (ipsprice_item_id=item_id) AND (item_id=<? value("item_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT ipsprice_id AS itemid, 5 AS sourcetype, ipshead_name AS schedulename, 'Cust. Ship-To Pattern' AS type, (cust_name || '-' || shipto_num) AS typename, ipsprice_qtybreak AS qtybreak, ipsprice_price AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM ipsass, ipshead, ipsprice, custinfo, shiptoinfo, item WHERE ( (ipsass_ipshead_id=ipshead_id) AND (ipsprice_ipshead_id=ipshead_id) AND (COALESCE(LENGTH(ipsass_shipto_pattern), 0) > 0) AND (shipto_num ~ ipsass_shipto_pattern) AND (shipto_cust_id=cust_id) AND (ipsprice_item_id=item_id) AND (item_id=<? value("item_id") ?>) <? if not exists("showExpired") ?> AND (ipshead_expires > CURRENT_DATE) <? endif ?> <? if not exists("showFuture") ?> AND (ipshead_effective <= CURRENT_DATE) <? endif ?> ) UNION SELECT item_id AS itemid, 0 AS sourcetype, 'List Price' AS schedulename, 'N/A' AS type, '' AS typename, -1 AS qtybreak, item_listprice AS price, <? if exists("actualCosts") ?> (actcost(item_id) * iteminvpricerat(item_id)) <? else ?> (stdcost(item_id) * iteminvpricerat(item_id)) <? endif ?> AS cost FROM item WHERE ( (NOT item_exclusive) AND (item_id=<? value("item_id") ?>) ) ) AS data ORDER BY price; 221 565 80 114 20 Arial 10 bold head f_showexpired 100 80 200 20 Arial 10 bold head item_number 665 200 80 15 Arial 8 normal head f_marginlabel 100 100 300 20 Arial 10 bold head item_descrip1 5 215 745 215 2 585 200 80 15 Arial 8 normal head f_costlabel 405 120 335 20 Arial 10 bold head f_showcosts 565 100 114 20 Arial 10 bold head f_showfuture 100 120 300 20 Arial 10 bold head item_descrip2 6 26 5 20 745 20 2 585 5 80 15 Arial 8 normal head f_costlabel 665 5 80 15 Arial 8 normal head f_costlabel
    detail detail 16 505 0 80 15 Arial 8 bold detail f_price 135 0 100 15 Arial 8 bold detail type 10 0 120 15 Arial 8 bold detail schedulename 585 0 80 15 Arial 8 bold detail f_cost 425 0 80 15 Arial 8 bold detail f_qtybreak 665 0 80 15 Arial 8 bold detail f_margin 240 0 185 15 Arial 8 bold detail typename
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PricingScheduleAssignments.xml000066400000000000000000000173251217451700100242300ustar00rootroot00000000000000 Pricing Schedule Assignments PricingScheduleAssignments 0.05 0.05 Letter 50 50 50 50 detail SELECT ipsass_id, CASE WHEN (ipsass_shipto_id != -1) THEN (SELECT shipto_num FROM shiptoinfo WHERE (shipto_id=ipsass_shipto_id)) WHEN (COALESCE(LENGTH(ipsass_shipto_pattern), 0) > 0) THEN ipsass_shipto_pattern ELSE TEXT('ANY') END AS shiptonum, CASE WHEN (ipsass_shipto_id != -1) THEN (SELECT cust_number FROM shiptoinfo, custinfo WHERE ((shipto_cust_id=cust_id) AND (shipto_id=ipsass_shipto_id))) WHEN (ipsass_cust_id=-1) THEN TEXT('Any') ELSE (SELECT cust_number FROM custinfo WHERE (cust_id=ipsass_cust_id)) END AS custnumber, CASE WHEN (ipsass_shipto_id != -1) THEN (SELECT cust_name FROM shiptoinfo, custinfo WHERE ((shipto_cust_id=cust_id) AND (shipto_id=ipsass_shipto_id))) WHEN (ipsass_cust_id=-1) THEN '' ELSE (SELECT cust_name FROM custinfo WHERE (cust_id=ipsass_cust_id)) END AS custname, CASE WHEN (ipsass_cust_id != -1) THEN TEXT('N/A') WHEN (ipsass_shipto_id != -1) THEN TEXT('N/A') WHEN (COALESCE(LENGTH(ipsass_shipto_pattern),0) > 0) THEN TEXT('N/A') WHEN (ipsass_custtype_id=-1) THEN ipsass_custtype_pattern ELSE (SELECT custtype_code FROM custtype WHERE (custtype_id=ipsass_custtype_id)) END AS custtype, ipshead_name FROM ipsass, ipshead WHERE (ipshead_id=ipsass_ipshead_id) ORDER BY custname, custtype; 78 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 18 465 0 100 15 Arial 8 bold detail custtype 5 0 100 15 Arial 8 bold detail shiptonum 240 0 205 15 Arial 8 bold detail custname 115 0 100 15 Arial 8 bold detail custnumber 580 0 150 15 Arial 8 bold detail ipshead_name
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ProductCategoriesMasterList.xml000066400000000000000000000101501217451700100243670ustar00rootroot00000000000000 Product Categories Master List ProductCategoriesMasterList Letter 50 50 50 50 detail select prodcat_code, prodcat_descrip from prodcat order by prodcat_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail prodcat_code 175 0 565 15 Arial 8 bold detail prodcat_descrip
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ProjectTaskList.xml000066400000000000000000000113011217451700100220150ustar00rootroot00000000000000 ProjectTaskList ProjectTaskList Letter 50 50 50 50 detail SELECT prjtask_number, prjtask_name, prjtask_descrip FROM prjtask WHERE (prjtask_prj_id=<?value("prj_id")?>) ORDER BY prjtask_number; head SELECT (prj_number||'-'||prj_name) AS project FROM prj WHERE (prj_id=<? value("prj_id") ?>); 102 120 50 450 15 Arial 8 bold head project 5 95 745 95 2
    detail detail 17 10 0 50 15 Arial 8 bold detail prjtask_number 285 0 450 15 Arial 8 bold detail prjtask_descrip 70 0 200 15 Arial 8 bold detail prjtask_name
    18 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/PurchaseOrder.xml000066400000000000000000000634661217451700100215210ustar00rootroot00000000000000 Purchase Order PurchaseOrder Selecting an Alt Address on the PO will cause the printed PO to display that address as the Ship To on the printed document. Head title 25 0.05 0.05 Letter 28 28 20 20 Head SELECT pohead_number, formatDate(pohead_orderdate) AS f_orderdate, pohead_fob, pohead_shipvia, terms_descrip, vend_number, vend_name, warehous_descrip, pohead_agent_username, usr.usr_propername AS username, pohead_comments, text(<? value("title") ?>) AS title FROM pohead LEFT OUTER JOIN usr ON (pohead_agent_username = usr_username) LEFT OUTER JOIN terms ON (pohead_terms_id = terms_id) LEFT OUTER JOIN vendinfo ON (pohead_vend_id = vend_id) LEFT OUTER JOIN whsinfo ON (pohead_warehous_id = warehous_id) WHERE (pohead_id=<? value("pohead_id") ?>); Detail SELECT poitem_linenumber, poitem_comments, poitem_linenumber AS f_line, item_number, poitem_vend_item_number, CASE WHEN (LENGTH(TRIM(BOTH ' ' FROM poitem_vend_item_descrip)) <= 0) THEN (item_descrip1 || '' || item_descrip2) ELSE (poitem_vend_item_descrip) END AS itemdescription, formatQty(poitem_qty_ordered) AS f_ordered, CASE WHEN (poitem_vend_uom LIKE '') THEN (uom_name) ELSE (poitem_vend_uom) END AS itemuom, formatPurchPrice(poitem_unitprice) AS f_price, formatExtPrice(poitem_unitprice * poitem_qty_ordered) AS f_extended, formatDate(poitem_duedate) AS f_duedate, characteristicsToString('PI', poitem_id, '=', ', ') AS poitem_characteristics FROM poitem LEFT OUTER JOIN itemsite ON (poitem_itemsite_id = itemsite_id) LEFT OUTER JOIN (item JOIN uom ON (item_inv_uom_id=uom_id)) ON (itemsite_item_id = item_id) WHERE (poitem_pohead_id=<? value("pohead_id") ?>) ORDER BY poitem_linenumber; Foot SELECT formatExtPrice(subtotal) AS f_subtotal, formatExtPrice(totalfreight) AS f_totalfreight, formatExtPrice(tax) AS f_tax, formatExtPrice(subtotal + totalfreight + tax) AS f_totaldue FROM ( SELECT COALESCE(SUM(poitem_qty_ordered * poitem_unitprice), 0) AS subtotal, COALESCE(SUM(poitem_freight)+pohead_freight,0) AS totalfreight, (SELECT COALESCE(SUM(tax), 0.0) FROM (SELECT ROUND(SUM(taxdetail_tax),2) AS tax FROM tax JOIN calculateTaxDetailSummary('PO', <? value("pohead_id") ?>, 'T') ON (taxdetail_tax_id=tax_id) GROUP BY tax_id) AS taxdata) AS tax FROM pohead JOIN poitem ON (poitem_pohead_id=pohead_id) WHERE (pohead_id=<? value("pohead_id") ?>) GROUP BY pohead_freight ) AS data; Logo SELECT image_data FROM image WHERE ((image_name='logo')); Currency SELECT curr_symbol FROM pohead, curr_symbol WHERE (pohead_id = <? value("pohead_id") ?>) AND pohead_curr_id = curr_id; Address SELECT warehous_descrip, formatAddr(addr_line1, addr_line2, addr_line3, ( addr_city || ' ' || addr_state || ' ' || addr_postalcode), addr_country) AS warehouse_address FROM whsinfo, addr, pohead WHERE addr_id = warehous_addr_id and pohead_warehous_id = warehous_id AND pohead_id=<? value("pohead_id") ?> ; ShipToAddress SELECT pohead_number, formatDate(pohead_orderdate) AS f_orderdate, pohead_fob, pohead_shipvia, terms_descrip, vend_number, vend_name, va.addr_line1 AS vend_address1, va.addr_line2 AS vend_address2, va.addr_line3 AS vend_address3, (va.addr_city || ' ' || va.addr_state || ' ' || va.addr_postalcode) AS vendcitystatezip, formatcntctname(pohead_vend_cntct_id) AS vend_contact, formataddr(pohead_vendaddress1, pohead_vendaddress2, pohead_vendaddress3, (pohead_vendcity || ' ' || pohead_vendstate || ' ' || pohead_vendzipcode), pohead_vendcountry) as vend_address, warehous_descrip, wa.addr_line1 as warehous_addr1, wa.addr_line2 as warehous_addr2, wa.addr_line3 as warehous_addr3, wa.addr_city as warehous_addr4, wa.addr_postalcode as zip, wa.addr_state, wa.addr_country, formatcntctname(pohead_shipto_cntct_id) AS shipto_contact, formataddr(pohead_shiptoaddress1, pohead_shiptoaddress2, pohead_shiptoaddress3, (pohead_shiptocity || ' ' || pohead_shiptostate || ' ' || pohead_shiptozipcode), pohead_shiptocountry) as shipto_address, pohead_agent_username AS username, pohead_comments, text(<? value("title") ?>) AS title FROM pohead LEFT OUTER JOIN terms ON (pohead_terms_id = terms_id), vendinfo LEFT OUTER JOIN addr va ON (vend_addr_id=va.addr_id), whsinfo LEFT OUTER JOIN addr wa ON (warehous_addr_id = wa.addr_id) WHERE ((pohead_vend_id=vend_id) AND (pohead_warehous_id = warehous_id) AND (pohead_id=<? value("pohead_id") ?>) ); 376 290 10 225 75 stretch Logo image_data 0 130 270 130 0 5 315 805 315 0 535 130 810 130 0 535 0 535 130 0 645 60 140 17 Arial 12 normal Head f_orderdate 500 142 300 17 10 Arial 10 normal ShipToAddress shipto_contact 5 25 265 17 10 Arial 10 normal Address warehouse_address 5 5 267 17 Arial 12 normal Address warehous_descrip 645 40 126 17 Arial 12 normal Head pohead_number 5 360 805 360 0 75 155 300 17 10 Arial 10 normal ShipToAddress vend_contact 270 0 270 130 0 5 290 187 17 Arial 11 normal Head pohead_fob 202 290 252 17 Arial 11 normal Head pohead_shipvia 655 290 117 17 Arial 11 normal Head username 442 290 202 17 Arial 11 normal Head terms_descrip 645 85 35 16 Arial 12 normal Context Query page_number 5 285 805 285 0 75 137 300 20 Arial 12 normal Head vend_name 645 107 140 17 Arial 12 normal Context Query report_date 500 162 300 17 10 Arial 10 normal ShipToAddress shipto_address 75 172 300 17 10 Arial 10 normal ShipToAddress vend_address
    detail Detail 107 625 25 55 16 Arial 10 normal Detail itemuom 50 65 605 17 0 Arial 10 normal Detail poitem_comments 700 25 100 17 Arial 10 normal Detail f_duedate 700 5 92 16 Arial 10 normal Detail f_extended 50 45 750 17 Arial 9 normal Detail poitem_characteristics 545 25 75 16 Arial 10 normal Detail f_ordered 555 5 75 16 Arial 10 normal Detail f_price 505 5 25 16 Arial 10 normal Currency curr_symbol 150 5 350 17 0 Arial 10 normal Detail itemdescription 50 25 225 17 Arial 9 normal Detail poitem_vend_item_number 50 5 92 17 Arial 10 normal Detail item_number 10 5 36 17 Arial 10 normal Detail f_line
    113 670 85 25 16 Arial 10 normal Currency curr_symbol 35 10 530 17 14 Arial 10 normal Head pohead_comments 705 55 100 16 Arial 10 normal Foot f_tax 705 85 100 16 Arial 10 normal Foot f_totaldue 670 12 25 16 Arial 10 normal Currency curr_symbol 670 55 25 16 Arial 10 normal Currency curr_symbol 585 75 806 75 0 705 35 100 16 Arial 10 normal Foot f_totalfreight 10 5 805 5 0 705 12 100 16 Arial 10 normal Foot f_subtotal 670 35 25 16 Arial 10 normal Currency curr_symbol 57
    qt-client-4.1.0/share/reports/PurchaseOrderTypes.xml000066400000000000000000000101061217451700100225250ustar00rootroot00000000000000 Purchase Order Types PurchaseOrderTypes Letter 50 50 50 50 detail SELECT potype_id, potype_name, potype_descrip FROM potype ORDER BY potype_name; 77 5 70 745 70 2 7 22 5 15 745 15 2
    detail detail 17 175 0 565 15 Arial 8 bold detail potype_descrip 10 0 150 15 Arial 8 bold detail potype_name
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PurchasePriceVariancesByItem.xml000066400000000000000000000373261217451700100244520ustar00rootroot00000000000000 Purchase Price Variances By Item PurchasePriceVariancesByItem 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, uom_name, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("item_id") ?>); detail poPriceVariances detail 236 95 135 300 20 Arial 10 bold head warehouse 550 65 100 20 Arial 10 bold head startdate 95 155 300 20 Arial 10 bold head agentUsername 550 85 100 20 Arial 10 bold head enddate 95 65 150 20 Arial 10 bold head item_number 95 85 300 20 Arial 10 bold head item_descrip1 95 103 300 20 Arial 10 bold head item_descrip2 5 230 745 230 2 310 65 100 20 Arial 10 bold head uom_name 6 41 5 35 745 35 2
    detail detail 36 5 0 50 15 Arial 8 bold detail recv_order_number 665 15 80 15 Arial 8 bold detail f_varprcnt 665 0 80 15 Arial 8 bold detail f_variance 60 0 150 15 Arial 8 bold detail vend_name 5 30 745 30 0 575 0 80 15 Arial 8 bold detail f_recv_value 215 0 80 15 Arial 8 bold detail f_date 300 0 150 15 Arial 8 bold detail itemnumber 300 15 200 15 Arial 8 bold detail itemdescrip 490 0 80 15 Arial 8 bold detail f_qty 575 15 80 15 Arial 8 bold detail f_voucher_value
    17 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/PurchasePriceVariancesByVendor.xml000066400000000000000000000343161217451700100250050ustar00rootroot00000000000000 Purchase Price Variances By Vendor PurchasePriceVariancesByVendor 0.05 0.05 Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername; detail poPriceVariances detail 236 550 64.8725 100 20 Arial 10 bold head startdate 550 85 100 20 Arial 10 bold head enddate 94.254 64.8725 300 20 Arial 10 bold head warehouse 95.746 84.8725 300 20 Arial 10 bold head agentUsername 5 230 745 230 2 6 41 5 35 745 35 2
    detail detail 36 665 15 80 15 Arial 8 bold detail f_varprcnt 6.49 -1.88608e-20 50 15 Arial 8 bold detail recv_order_number 5 30 745 30 0 490 0 80 15 Arial 8 bold detail f_qty 300 15 200 15 Arial 8 bold detail itemdescrip 575 15 80 15 Arial 8 bold detail f_voucher_value 215 0 80 15 Arial 8 bold detail f_date 300 0 150 15 Arial 8 bold detail itemnumber 575 0 80 15 Arial 8 bold detail f_recv_value 69.9 0 143 15 Arial 8 bold detail vend_name 665 -0.442 80 15 Arial 8 bold detail f_variance
    17 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/PurchaseReqsByPlannerCode.xml000066400000000000000000000343061217451700100237550ustar00rootroot00000000000000 Purchase Requests By Planner Code PurchaseReqsByPlannerCode Letter 50 50 50 50 head SELECT <? if exists("plancode_id") ?> ( SELECT (plancode_code||'-'||plancode_name) FROM plancode WHERE plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plancode, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate; detail SELECT pr_number || '-' || pr_subnumber AS pr_number, item_number, (item_descrip1 || ' ' || item_descrip2) as item_descrip, pr_status, CASE WHEN (pr_order_type='W') THEN ('W/O ' || ( SELECT formatWoNumber(womatl_wo_id) FROM womatl WHERE (womatl_id=pr_order_id) ) ) WHEN (pr_order_type='S') THEN ('S/O ' || (SELECT formatSoNumber(pr_order_id))) WHEN (pr_order_type='F') THEN ('Planned Order') WHEN (pr_order_type='M') THEN 'Manual' ELSE 'Other' END AS f_type, formatdatetime(pr_createdate) AS f_createdate, formatDate(pr_duedate) AS f_duedate, formatQty(pr_qtyreq) AS f_qtyreq, pr_releasenote as f_notes FROM pr, itemsite, item WHERE ((pr_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (pr_duedate BETWEEN <? value("startDate") ?> and <? value("endDate") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>) ) ) <? endif ?> ) ORDER BY pr_duedate; 171 555 65 100 20 Arial 10 bold head startdate 5 165 745 165 2 555 85 100 20 Arial 10 bold head enddate 135 85 300 20 Arial 10 bold head warehouse 135 65 300 20 Arial 10 bold head plancode 5 34 5 30 745 30 2
    detail detail 38 665 0 80 15 Arial 8 bold detail f_qtyreq 215 0 204 15 Arial 8 bold detail item_descrip 115 0 100 15 Arial 8 bold detail item_number 418 0 46 15 Arial 8 bold detail pr_status 18 0 92 15 Arial 8 bold detail pr_number 554 0 113 15 Arial 8 bold detail f_createdate 468 0 85 15 Arial 8 bold detail f_type 57 16 500 15 14 Helvetica 6 normal detail f_notes 573 15 80 15 Arial 8 bold detail f_duedate
    18 104 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PurchaseRequestsByItem.xml000066400000000000000000000273021217451700100233600ustar00rootroot00000000000000 Purchase Requests By Item PurchaseRequestsByItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, uom_name, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("item_id") ?>); detail SELECT pr_status, pr_number || '-' || pr_subnumber AS pr_number, CASE WHEN (pr_order_type='W') THEN ('W/O ' || ( SELECT formatWoNumber(womatl_wo_id) FROM womatl WHERE (womatl_id=pr_order_id) ) ) WHEN (pr_order_type='S') THEN ('S/O ' || (SELECT formatSoNumber(pr_order_id))) WHEN (pr_order_type='F') THEN ('Planned Order') WHEN (pr_order_type='M') THEN 'Manual' ELSE 'Other' END as f_type, pr_createdate as f_createdate, formatDate(pr_duedate) as f_duedate, formatQty(pr_qtyreq) as f_qtyreq, pr_releasenote as f_notes FROM pr, itemsite WHERE ((pr_itemsite_id=itemsite_id) AND (itemsite_item_id=<? value("item_id") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY pr_duedate; 221 135 85 300 20 Arial 10 bold head item_descrip1 135 105 300 20 Arial 10 bold head item_descrip2 135 135 300 20 Arial 10 bold head warehouse 135 65 150 20 Arial 10 bold head item_number 355 65 100 20 Arial 10 bold head uom_name 5 215 745 215 2 5 25 5 20 745 20 2
    detail detail 39 655 0 90 15 Arial 8 bold detail f_qtyreq 190 0 209 15 Arial 8 bold detail f_type 560 0 90 15 Arial 8 bold detail f_duedate 10 0 90 15 Arial 8 bold detail pr_number 105 0 80 15 Arial 8 bold detail pr_status 52 18 683 15 14 Helvetica 6 normal detail f_notes 445 0 110 16 Arial 8 bold detail f_createdate
    15 105 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/PurchaseRequestsByPlannerCode.xml000066400000000000000000000276161217451700100246640ustar00rootroot00000000000000 Purchase Requests By Planner Code PurchaseReqsByPlannerCode Letter 50 50 50 50 head SELECT <? if exists("plancode_id") ?> ( SELECT (plancode_code||'-'||plancode_name) FROM plancode WHERE plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plancode, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate; detail SELECT item_number, (item_descrip1 || ' ' || item_descrip2) as item_descrip, pr_status, CASE WHEN (pr_order_type='W') THEN ('W/O ' || ( SELECT formatWoNumber(womatl_wo_id) FROM womatl WHERE (womatl_id=pr_order_id) ) ) WHEN (pr_order_type='S') THEN ('S/O ' || (SELECT formatSoNumber(pr_order_id))) WHEN (pr_order_type='F') THEN ('Planned Order') WHEN (pr_order_type='M') THEN 'Manual' ELSE 'Other' END AS f_type, formatDate(pr_duedate) AS f_duedate, formatQty(pr_qtyreq) AS f_qtyreq FROM pr, itemsite, item WHERE ((pr_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (pr_duedate BETWEEN <? value("startDate") ?> and <? value("endDate") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>) ) ) <? endif ?> ) ORDER BY pr_duedate; 171 555 85 100 20 Arial 10 bold head enddate 555 65 100 20 Arial 10 bold head startdate 5 165 745 165 2 135 65 300 20 Arial 10 bold head plancode 135 85 300 20 Arial 10 bold head warehouse 6 26 5 20 745 20 2
    detail detail 16 665 0 80 15 Arial 8 bold detail f_qtyreq 10 0 120 15 Arial 8 bold detail item_number 135 0 200 15 Arial 8 bold detail item_descrip 340 0 80 15 Arial 8 bold detail pr_status 580 0 80 15 Arial 8 bold detail f_duedate 425 0 150 15 Arial 8 bold detail f_type
    16 105 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/QOH.xml000066400000000000000000000471601217451700100173730ustar00rootroot00000000000000 Quantities on Hand QOH 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("onlyShowPositive") ?> text('Only Showing Positive Quantities') <? elseif exists("onlyShowNegative") ?> text('Only Showing Negative Quantities') <? else ?> text('Showing All Quantities') <? endif ?> AS showquantities, <? if exists("showValue") ?> text('Unit Cost') AS lbl_unitcost, text('Value') AS lbl_value, text('NN Value') AS lbl_nnvalue, text('Cost Method') AS lbl_costmethod, <? else ?> text('') AS lbl_unitcost, text('') AS lbl_value, text('') AS lbl_nnvalue, text('') AS lbl_costmethod, <? endif ?> <? if exists("showValue") ?> <? if exists("useActualCosts") ?> text('Showing Actual Costs') <? elseif exists("useStandardCosts") ?> text('Showing Standard Costs') <? else ?> text('Showing Posted Costs') <? endif ?> <? else ?> text('') <? endif ?> AS showvalues; detail qoh detail total SELECT SUM(qoh) AS f_qoh, SUM(nonnetable) AS f_nonnetable, <? if exists("showValue") ?> FormatExtPrice(SUM(standardcost * qoh)) <? else ?> '' <? endif ?> AS f_value, <? if exists("showValue") ?> FormatExtPrice(SUM(CASE WHEN (itemsite_loccntrl) THEN (standardcost * nonnetable) ELSE 0 END)) <? else ?> '' <? endif ?> AS f_nonnetvalue FROM ( SELECT itemsite_id, itemsite_costmethod, item_number, item_descrip1, item_descrip2, itemsite_loccntrl, warehous_code, uom_name, CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel, itemsite_qtyonhand AS qoh, CASE WHEN ((itemsite_loccntrl) OR (itemsite_controlmethod IN ('L', 'S'))) THEN 1 ELSE 0 END AS detail, itemsite_nnqoh AS nonnetable, <? if exists("useActualCosts") ?> actcost(itemsite_item_id) <? elseif exists("useStandardCosts") ?> stdcost(itemsite_item_id) <? else ?> (itemsite_value / CASE WHEN(itemsite_qtyonhand=0) THEN 1 ELSE itemsite_qtyonhand END) <? endif ?> AS standardcost FROM itemsite, item, uom, whsinfo, costcat WHERE ((itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (itemsite_costcat_id=costcat_id) AND (itemsite_active) <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? endif ?> <? if exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>) ) ) <? endif ?> <? if exists("costcat_id") ?> AND (costcat_id=<? value("costcat_id") ?>) <? endif ?> <? if exists("costcat_pattern") ?> AND (costcat_id IN (SELECT costcat_id FROM costcat WHERE (costcat_code ~ <? value("costcat_pattern") ?>) ) ) <? endif ?> <? if exists("itemgrp_id") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem WHERE (itemgrpitem_itemgrp_id=<? value("itemgrp_id") ?>))) <? endif ?> <? if exists("itemgrp_pattern") ?> AND (item_id IN (SELECT itemgrpitem_item_id FROM itemgrpitem, itemgrp WHERE ( (itemgrpitem_itemgrp_id=itemgrp_id) AND (itemgrp_name ~ <? value("itemgrp_pattern") ?>) ) )) <? endif ?> <? if exists("onlyShowPositive") ?> AND (itemsite_qtyonhand > 0) <? elseif exists("onlyShowNegative") ?> AND (itemsite_qtyonhand < 0) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ) AS data ; 234 590 200 80 15 Arial 8 normal head lbl_value 509 200 80 15 Arial 8 normal head lbl_unitcost 185 43 300 15 Arial 10 bold head showvalues 8 231.167 748 231.167 2 670 200 80 15 Arial 8 normal head lbl_nnvalue 10 43 300 15 Arial 10 bold head showquantities 670 215 80 15 Arial 8 normal head lbl_costmethod 10 58 725 15 12 Arial 10 bold Parameter Query filter 6 36 590 0 80 15 Arial 8 normal head lbl_value 670 0 80 15 Arial 8 normal head lbl_nnvalue 509 0 80 15 Arial 8 normal head lbl_unitcost 670 15 80 15 Arial 8 normal head lbl_costmethod 10 33.3333 750 33.3333 2
    detail detail 51 265 0 80 15 Arial 8 bold detail f_reorderlevel 5 45 745 45 0 104 0 150 15 Arial 8 bold detail item_number 104 30 300 15 Arial 8 bold detail item_descrip2 5 0 95 15 Arial 8 bold detail warehous_code 10 15 90 15 Arial 8 bold detail defaultlocation 585 0 80 15 Arial 8 bold detail f_value 345 0 80 15 Arial 8 bold detail f_qoh 104 15 300 15 Arial 8 bold detail item_descrip1 665 0 80 15 Arial 8 bold detail f_nnvalue 580 15 170 15 Arial 8 bold detail f_costmethod 505 0 80 15 Arial 8 bold detail f_cost 425 0 80 15 Arial 8 bold detail f_nnqoh
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date 16 425 0 80 15 Arial 8 bold detail nnqoh qty 585 0 80 15 Arial 8 bold detail f_value money 665 0 80 15 Arial 8 bold detail f_nnvalue money 345 0 80 15 Arial 8 bold detail qoh qty
    qt-client-4.1.0/share/reports/QOHByLocation.xml000066400000000000000000000267771217451700100213720ustar00rootroot00000000000000 Quantities on Hand by Location QOHByLocation 0.05 0.05 Letter 50 50 50 50 head SELECT (location_name||'-'||firstLine(location_descrip)) AS f_location, formatBoolYN(location_netable) AS f_netable, formatBoolYN(location_restrict) AS f_restricted, warehous_code, formatDate(<? value("asOf") ?>) AS asofdate FROM location, whsinfo WHERE ((location_warehous_id=warehous_id) AND (location_id=<? value("location_id") ?>) ); detail qoh detail 234 130 140 200 20 Arial 10 bold head warehous_code 435 140 200 20 Arial 10 bold head f_restricted 130 120 200 20 Arial 10 bold head f_location 5 228 745 228 2 435 120 200 20 Arial 10 bold head f_netable 130 160 200 20 Arial 10 bold head asofdate 6 41 5 35 745 35 2
    detail detail 51 320 0 230 15 Arial 8 bold detail f_lotserial 85 0 220 15 Arial 8 bold detail item_number 5 45 745 45 0 565 0 80 15 Arial 8 bold detail uom_name 85 15 526 15 Arial 8 bold detail f_descrip 10 0 70 15 Arial 8 bold detail warehous_code 665 0 80 15 Arial 8 bold detail qoh qty 665 14 80 20 Arial 8 bold detail reservedqty qty
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/Quote.xml000066400000000000000000000744271217451700100200470ustar00rootroot00000000000000 Quote Quote 0.05 0.05 Letter 50 50 50 50 head SELECT quhead_number, quhead_shipvia, formatDate(quhead_quotedate) as f_orderdate, formatDate(quhead_packdate) as f_packdate, salesrep_name, formatScrap(quhead_commission) as f_commission, (terms_code||' - '||terms_descrip) as f_terms, cust_number, quhead_billtoname, formatAddr(quhead_billtoaddress1, quhead_billtoaddress2, quhead_billtoaddress3, (quhead_billtocity || ', ' || quhead_billtostate || ' ' || quhead_billtozip), quhead_billtocountry) AS f_billtoaddress, CASE WHEN(quhead_shipto_id=-1) THEN text('') ELSE (SELECT text(shipto_num) FROM shiptoinfo WHERE (shipto_id=quhead_shipto_id)) END AS f_shiptonum, quhead_shiptoname, formatAddr(quhead_shiptoaddress1, quhead_shiptoaddress2, quhead_shiptoaddress3, (quhead_shiptocity || ', ' || quhead_shiptostate || ' ' || quhead_shiptozipcode), quhead_shiptocountry) AS f_shiptoaddress, quhead_custponumber, quhead_fob, saletype_code FROM quhead LEFT OUTER JOIN custinfo ON (quhead_cust_id = cust_id) LEFT OUTER JOIN terms ON (quhead_terms_id = terms_id) LEFT OUTER JOIN salesrep ON (quhead_salesrep_id = salesrep_id) LEFT OUTER JOIN saletype ON (quhead_saletype_id = saletype_id) WHERE (quhead_id = <? value("quhead_id") ?>) notes SELECT quhead_ordercomments, quhead_shipcomments FROM quhead WHERE (quhead_id=<? value("quhead_id") ?>); items SELECT quitem_id, quitem_linenumber, quitem_custpn, item_number, item_descrip1, --The following 2 lines are new in 2.3 (select uom_name from uom where uom_id = quitem_qty_uom_id) AS uom_ordered, (select uom_name from uom where uom_id = quitem_price_uom_id) AS uom_pricing, warehous_code, formatQty(quitem_qtyord) as f_ordered, formatPrice(quitem_price) as f_price, --The following line was changed in 2.3 from: --formatExtprice(quitem_qtyord * (quitem_price / iteminvpricerat(item_id))) as f_extprice --To: formatExtprice((quitem_qtyord * quitem_qty_invuomratio) * (quitem_price / quitem_price_invuomratio)) as f_extprice, quitem_memo, char_name, charass_value FROM quitem JOIN item ON (item_id=quitem_item_id) LEFT OUTER JOIN (itemsite JOIN whsinfo ON (itemsite_warehous_id=warehous_id)) ON (quitem_itemsite_id=itemsite_id) LEFT OUTER JOIN charass ON ((charass_target_id = quitem_id) AND (charass_target_type = 'QI')) LEFT OUTER JOIN char ON (charass_char_id = char_id) WHERE (quitem_quhead_id=<? value("quhead_id") ?>) ORDER BY quitem_linenumber; totals SELECT 1 as one, formatExtPrice(subtotal) AS f_subtotal, formatExtPrice(tax) AS f_tax, formatExtPrice(quhead_freight) AS f_freight, formatExtPrice(quhead_misc) AS f_misc, formatExtPrice(subtotal + tax + quhead_freight + quhead_misc) AS f_total FROM quhead, (SELECT SUM(ROUND((quitem_qtyord * quitem_qty_invuomratio) * (quitem_price / quitem_price_invuomratio),2)) AS subtotal FROM quitem WHERE (quitem_quhead_id=<? value("quhead_id") ?>) ) AS subtot, (SELECT COALESCE(SUM(tax),0.0) AS tax FROM ( SELECT ROUND(SUM(taxdetail_tax),2) AS tax FROM tax JOIN calculateTaxDetailSummary('Q', <? value("quhead_id") ?>, 'T') ON (taxdetail_tax_id=tax_id) GROUP BY tax_id) AS data) AS taxtot WHERE (quhead_id=<? value("quhead_id") ?>); logo SELECT image_data FROM image WHERE ((image_name='logo')); currency_info --this was added in version 2.3 SELECT curr_name, curr_symbol, curr_abbr FROM quhead, curr_symbol WHERE ( (quhead_curr_id = curr_id) AND (quhead_id = <? value("quhead_id") ?>) ); address SELECT warehous_descrip, formatAddr(addr_line1, addr_line2, addr_line3, (addr_city || ' ' || addr_state || ' ' || addr_postalcode), addr_country) AS warehouse_address FROM whsinfo, addr, quhead WHERE ( (addr_id = warehous_addr_id) AND (quhead_warehous_id = warehous_id) AND (quhead_id=<? value("quhead_id") ?>) ); contact_fax_phone SELECT cntct_fax, cntct_phone FROM cntct, quhead, custinfo WHERE ( (cust_id = quhead_cust_id) AND (cust_cntct_id = cntct_id) AND (quhead_id = <? value("quhead_id") ?>) ); 427 275 5 238 100 stretch logo image_data 10 25 265 15 10 Arial 10 normal address warehouse_address 100 175 206 21 Arial 10 bold head cust_number 440 215 300 20 Arial 10 bold head quhead_shiptoname 55 325 121 20 Arial 10 bold contact_fax_phone cntct_phone 55 215 285 20 Arial 10 bold head quhead_billtoname 208 325 121 20 Arial 10 bold contact_fax_phone cntct_fax 440 190 206 21 Arial 10 bold head f_shiptonum 100 130 206 21 Arial 10 bold head quhead_number 440 145 103 21 Arial 10 bold head f_packdate 100 160 206 21 Arial 10 bold head saletype_code 100 145 206 21 Arial 10 bold head salesrep_name 440 130 103 21 Arial 10 bold head f_orderdate 505 350 206 21 Arial 10 bold head quhead_shipvia 140 370 206 21 Arial 10 bold head quhead_fob 440 160 262 21 Arial 10 bold head f_terms 55 233 300 15 0 Arial 10 normal head f_billtoaddress 140 350 206 21 Arial 10 bold head quhead_custponumber 10 5 257 19 Arial 10 bold address warehous_descrip 440 233 300 15 0 Arial 10 normal head f_shiptoaddress
    lineitems lineitems quitem_linenumber 32 155 0 225 15 Arial 8 bold items item_descrip1 5 0 783 0 2 665 0 80 15 Arial 8 bold items f_extprice 5 0 25 15 Arial 8 bold items quitem_linenumber 385 0 50 15 Arial 8 bold items warehous_code 640 0 37 15 Arial 8 bold items uom_pricing 525 0 37 15 Arial 8 bold items uom_ordered 45 0 103 15 Arial 8 bold items item_number 565 0 72 15 Arial 8 bold items f_price 440 0 77 15 Arial 8 bold items f_ordered 33.8828 290 0 454.347 13.2412 10 Arial 8 bold items quitem_memo 289.596 15.5884 199 17.1 0 Sans Serif 8 bold items quitem_custpn items 18 385 0 300 15 Arial 8 bold items charass_value 208 0 165 15 Arial 8 bold items char_name
    items items one 87 670 65 75 15 Arial 8 bold totals f_total 670 50 75 15 Arial 8 bold totals f_tax 670 35 75 15 Arial 8 bold totals f_freight 670 20 75 15 Arial 8 bold totals f_misc 204 10 206 18 Arial 10 bold currency_info curr_name 670 5 75 15 Arial 8 bold totals f_subtotal items 7
    notes notes 32 155 5 591 18 5 Arial 10 bold notes quhead_ordercomments
    extdescrip notes 32 155 5 591 21 5 Arial 10 bold notes quhead_shipcomments
    29 705 0 42 11 Arial 8 bold Context Query page_number 85 0 103 11 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ReasonCodeMasterList.xml000066400000000000000000000100741217451700100227700ustar00rootroot00000000000000 Reason Code Master List ReasonCodeMasterList Letter 50 50 50 50 detail SELECT rsncode_code, rsncode_descrip FROM rsncode ORDER BY rsncode_code; 77 5 70 745 70 2 7 22 5 15 745 15 2
    detail detail 17 10 0 150 15 Arial 8 bold detail rsncode_code 175 0 565 15 Arial 8 bold detail rsncode_descrip
    17 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ReceiptsReturnsByDate.xml000066400000000000000000000343451217451700100231770ustar00rootroot00000000000000 Receipts and Returns By Date ReceiptsReturnsByDate 0.05 0.05 Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, <? if exists("showVariances") ?> text('Purch. Cost') AS f_purchcost, text('Recv. Cost') AS f_recvcost <? else ?> text('') AS f_purchcost, text('') AS f_recvcost <? endif ?> detail receivings detail 221 645 185 100 15 Arial 8 bold head f_purchcost 455 70 200 20 Arial 10 bold head startdate 120 70 200 20 Arial 10 bold head warehouse 645 200 100 15 Arial 8 bold head f_recvcost 455 95 200 20 Arial 10 bold head enddate 120 95 200 20 Arial 10 bold head agentUsername 5 215 745 215 2 6 41 5 35 745 35 2 645 20 100 15 Arial 8 bold head f_recvcost 645 5 100 15 Arial 8 bold head f_purchcost
    detail detail 56 215 0 200 15 Arial 8 bold detail venditemnumber 530 0 100 15 Arial 8 bold detail f_qty 645 15 100 15 Arial 8 bold detail f_recvcost 215 15 400 15 Arial 8 bold detail venditemdescrip 645 0 100 15 Arial 8 bold detail f_purchcost 5 15 100 15 Arial 8 bold detail vend_name 110 0 100 15 Arial 8 bold detail f_duedate 110 15 100 15 Arial 8 bold detail f_recvdate 5 50 745 50 0 5 0 100 15 Arial 8 bold detail ponumber 418 0 100 15 Arial 8 bold detail sense
    16 705 0 40 15 Arial 8 bold Context Query page_number 85 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ReceiptsReturnsByItem.xml000066400000000000000000000367571217451700100232310ustar00rootroot00000000000000 Receipts and Returns By Item ReceiptsReturnsByItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, <? if exists("showVariances") ?> text('Purch. Cost') AS f_purchcost, text('Recv. Cost') AS f_recvcost <? else ?> text('') AS f_purchcost, text('') AS f_recvcost <? endif ?> FROM item WHERE (item_id=<? value("item_id") ?>); detail receivings detail 221 120 90 200 20 Arial 10 bold head item_descrip1 455 90 200 20 Arial 10 bold head enddate 120 155 200 20 Arial 10 bold head agentUsername 645 185 100 15 Arial 8 bold head f_purchcost 645 200 100 15 Arial 8 bold head f_recvcost 455 70 200 20 Arial 10 bold head startdate 120 70 200 20 Arial 10 bold head item_number 120 110 200 20 Arial 10 bold head item_descrip2 5 215 745 215 2 120 135 200 20 Arial 10 bold head warehouse 6 41 645 20 100 15 Arial 8 bold head f_recvcost 645 5 100 15 Arial 8 bold head f_purchcost 5 35 745 35 2
    detail detail 37 215 0 200 15 Arial 8 bold detail venditemnumber 110 15 100 15 Arial 8 bold detail f_recvdate 215 15 400 15 Arial 8 bold detail venditemdescrip 418 0 100 15 Arial 8 bold detail sense 5 15 100 15 Arial 8 bold detail vend_name 110 0 100 15 Arial 8 bold detail f_duedate 5 0 100 15 Arial 8 bold detail ponumber 645 15 100 15 Arial 8 bold detail f_recvcost 645 0 100 15 Arial 8 bold detail f_purchcost 530 0 100 15 Arial 8 bold detail f_qty 5 30 745 30 0
    17 705 0 40 15 Arial 8 bold Context Query page_number 85 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ReceiptsReturnsByVendor.xml000066400000000000000000000345061217451700100235560ustar00rootroot00000000000000 Receipts and Returns By Vendor ReceiptsReturnsByVendor Letter 50 50 50 50 head SELECT vend_name, vend_number, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, <? if exists("showVariances") ?> text('Purch. Cost') AS f_purchcost, text('Recv. Cost') AS f_recvcost <? else ?> text('') AS f_purchcost, text('') AS f_recvcost <? endif ?> FROM vendinfo WHERE (vend_id=<? value("vend_id") ?>); detail receivings detail 221 120 70 200 20 Arial 10 bold head vend_number 5 215 745 215 2 455 70 200 20 Arial 10 bold head startdate 645 185 100 15 Arial 8 bold head f_purchcost 645 200 100 15 Arial 8 bold head f_recvcost 120 140 200 20 Arial 10 bold head agentUsername 120 112 200 20 Arial 10 bold head warehouse 120 90 200 20 Arial 10 bold head vend_name 455 90 200 20 Arial 10 bold head enddate 6 41 645 20 100 15 Arial 8 bold head f_recvcost 645 5 100 15 Arial 8 bold head f_purchcost 5 35 745 35 2
    detail detail 56 530 0 100 15 Arial 8 bold detail f_qty 645 0 100 15 Arial 8 bold detail f_purchcost 5 50 745 50 0 215 15 400 15 Arial 8 bold detail venditemdescrip 645 15 100 15 Arial 8 bold detail f_recvcost 215 0 200 15 Arial 8 bold detail venditemnumber 5 0 100 15 Arial 8 bold detail ponumber 418 0 100 15 Arial 8 bold detail sense 110 15 100 15 Arial 8 bold detail f_recvdate 110 0 100 15 Arial 8 bold detail f_duedate
    16 85 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ReceivingLabel.xml000066400000000000000000000133021217451700100216060ustar00rootroot00000000000000 Receiving Label ReceivingLabel must be a positive number or 0. used to specify how many day back from today the report takes into account when printing recieving labels Item Number - Used to filter the item numbers by the first matching characters from the left of the string used to specify the number of repeated sets of labels required used with the pirnt receiving label form used to filter the report by a PO number CILS ALP1-9200-1 Labels 10 0 0 10 detail SELECT formatDate(current_date) AS date, COALESCE(item_number,poitem_vend_item_number) AS item_number, COALESCE(item_descrip1, poitem_vend_item_descrip) AS item_descrip1, <? value("vendorItemLit") ?> AS vendoritemlit, poitem_vend_item_number, <? value("ordertype") ?> || '#:' AS typenum, pohead_number AS head_number FROM pohead, poitem LEFT OUTER JOIN itemsite ON (itemsite_id = poitem_itemsite_id) LEFT OUTER JOIN item ON (item_id = itemsite_item_id) WHERE ((pohead_id = poitem_pohead_id) AND (poitem_id = <? value("orderitemid") ?>) AND ('PO' = <? value("ordertype") ?>)) UNION SELECT formatDate(current_date) AS date, item_number AS item_number, item_descrip1 AS item_descrip1, NULL, NULL, <? value("ordertype") ?> || '#:' AS typenum, rahead_number AS head_number FROM rahead, raitem JOIN itemsite ON (itemsite_id = raitem_itemsite_id) JOIN item ON (item_id = itemsite_item_id) WHERE ((rahead_id = raitem_rahead_id) AND (raitem_id = <? value("orderitemid") ?>) AND ('RA' = <? value("ordertype") ?>)) UNION SELECT formatDate(current_date) AS date, item_number AS item_number, item_descrip1 AS item_descrip1, NULL, NULL, <? value("ordertype") ?> || '#:' AS typenum, tohead_number AS head_number FROM tohead, toitem JOIN item ON (item_id = toitem_item_id) WHERE ((tohead_id = toitem_tohead_id) AND (toitem_id = <? value("orderitemid") ?>) AND ('TO' = <? value("ordertype") ?>))
    detail detail 698 5 5 190 15 Arial 11 bold detail item_number 5 20 175 10 0 Arial 7 normal detail item_descrip1 80 50 100 15 Helvetica 8 normal detail poitem_vend_item_number 35 65 45 15 Helvetica 8 normal detail head_number 115 65 65 15 Helvetica 8 normal detail date 5 65 25 15 Helvetica 8 normal detail typenum 5 50 75 15 Helvetica 8 normal detail vendoritemlit
    qt-client-4.1.0/share/reports/ReceivingLabelOrder.xml000066400000000000000000000134571217451700100226150ustar00rootroot00000000000000 Receiving Label Order ReceivingLabelOrder must be a positive number or 0. used to specify how many day back from today the report takes into account when printing recieving labels Item Number - Used to filter the item numbers by the first matching characters from the left of the string used to specify the number of repeated sets of labels required used with the pirnt receiving label form used to filter the report by a PO number 0.05 0.05 CILS ALP1-9200-1 Labels 10 0 0 10 detail SELECT formatDate(current_date) AS date, COALESCE(item_number,poitem_vend_item_number) AS item_number, COALESCE(item_descrip1, poitem_vend_item_descrip) AS item_descrip1, <? value("vendorItemLit") ?> AS vendoritemlit, poitem_vend_item_number, <? value("orderhead_type") ?> || '#:' AS typenum, pohead_number AS head_number FROM pohead JOIN poitem ON (poitem_pohead_id = pohead_id) LEFT OUTER JOIN itemsite ON (itemsite_id = poitem_itemsite_id) LEFT OUTER JOIN item ON (item_id = itemsite_item_id) WHERE ((pohead_id = <? value("orderhead_id") ?>) AND ('PO' = <? value("orderhead_type") ?>)) UNION SELECT formatDate(current_date) AS date, item_number AS item_number, item_descrip1 AS item_descrip1, NULL, NULL, <? value("orderhead_type") ?> || '#:' AS typenum, rahead_number AS head_number FROM rahead JOIN raitem ON (raitem_rahead_id = rahead_id) JOIN itemsite ON (itemsite_id = raitem_itemsite_id) JOIN item ON (item_id = itemsite_item_id) WHERE ((rahead_id = <? value("orderhead_id") ?>) AND ('RA' = <? value("orderhead_type") ?>)) UNION SELECT formatDate(current_date) AS date, item_number AS item_number, item_descrip1 AS item_descrip1, NULL, NULL, <? value("orderhead_type") ?> || '#:' AS typenum, tohead_number AS head_number FROM tohead JOIN toitem ON (toitem_tohead_id = tohead_id) JOIN item ON (item_id = toitem_item_id) WHERE ((tohead_id = <? value("orderhead_id") ?>) AND ('TO' = <? value("orderhead_type") ?>))
    detail detail 698 5 5 190 15 Arial 11 bold detail item_number 5 20 175 10 0 Arial 7 normal detail item_descrip1 80 50 100 15 Helvetica 8 normal detail poitem_vend_item_number 35 65 45 15 Helvetica 8 normal detail head_number 115 65 65 15 Helvetica 8 normal detail date 5 65 25 15 Helvetica 8 normal detail typenum 5 50 75 15 Helvetica 8 normal detail vendoritemlit
    qt-client-4.1.0/share/reports/RejectCodeMasterList.xml000066400000000000000000000101021217451700100227450ustar00rootroot00000000000000 Reject Code Master List RejectCodeMasterList Letter 50 50 50 50 detail SELECT rjctcode_code, rjctcode_descrip FROM rjctcode ORDER BY rjctcode_code; 77 5 70 745 70 2 7 22 5 15 745 15 2
    detail detail 17 10 0 150 15 Arial 8 bold detail rjctcode_code 175 0 565 15 Arial 8 bold detail rjctcode_descrip
    17 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/RejectedMaterialByVendor.xml000066400000000000000000000321631217451700100236160ustar00rootroot00000000000000 Rejected Material By Vendor RejectedMaterialByVendor Letter 50 50 50 50 head SELECT vend_number, vend_name, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE warehous_id=<? value("warehous_id") ?>) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate FROM vendinfo WHERE (vend_id=<? value("vend_id") ?>); detail SELECT poreject_id, poreject_ponumber, vend_name, formatDate(poreject_date) as f_date, poreject_vend_item_number as f_itemnum, poreject_vend_item_descrip as f_itemdescrip, formatQty(poreject_qty) as f_qty, rjctcode_code as f_rejectcode FROM poreject, vendinfo, itemsite, rjctcode WHERE ( (poreject_posted) AND (poreject_vend_id=vend_id) AND (poreject_rjctcode_id=rjctcode_id) AND (poreject_itemsite_id=itemsite_id) AND (vend_id=<? value("vend_id") ?>) AND (date(poreject_date) BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("agentUsername") ?> AND (poreject_agent_username=<? value("agentUsername") ?>) <? endif ?> ) ORDER BY poreject_date DESC; 236 95 135 300 20 Arial 10 bold head warehouse 95 85 300 20 Arial 10 bold head vend_name 95 65 150 20 Arial 10 bold head vend_number 5 229 745 229 2 550 85 100 20 Arial 10 bold head enddate 95 155 300 20 Arial 10 bold head agentUsername 550 65 100 20 Arial 10 bold head startdate 6 41 5 35 745 35 2
    detail detail 36 580 0 80 15 Arial 8 bold detail f_rejectcode 492 0 80 15 Arial 8 bold detail f_qty 300 0 150 15 Arial 8 bold detail f_itemnum 60 0 150 15 Arial 8 bold detail vend_name 5 0 50 15 Arial 8 bold detail poreject_ponumber 300 15 200 15 Arial 8 bold detail f_itemdescrip 215 0 80 15 Arial 8 bold detail f_date 5 30 745 30 0
    16 102 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ReorderExceptionsByPlannerCode.xml000066400000000000000000000321041217451700100250060ustar00rootroot00000000000000 Reorder Exceptions by Planner Code ReorderExceptionsByPlannerCode Letter 50 50 50 50 head SELECT <? if exists("plancode_id") ?> ( SELECT (plancode_code || '-' || plancode_name) FROM plancode WHERE plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plannercode, <? if exists("includePlannedOrders") ?> formatBoolYN(true) <? else ?> formatBoolYN(false) <? endif ?> AS includeplnord, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT warehous_code, item_number, item_descrip1, item_descrip2, formatDate(reorderdate) AS f_reorderdate, formatQty(reorderlevel) AS f_reorderlevel, formatQty((itemsite_qtyonhand - qtyAllocated(itemsite_id, reorderdate) + qtyOrdered(itemsite_id, reorderdate))) AS f_projavail, reorderdate FROM ( SELECT itemsite_id, CASE WHEN (item_type IN ('M', 'B', 'T')) THEN 1 WHEN (item_type IN ('P', 'O')) THEN 2 ELSE 3 END AS itemtype, warehous_code, item_number, item_descrip1, item_descrip2, reorderDate(itemsite_id, <? value("lookAheadDays") ?>, <? if exists("includePlannedOrder") ?>true<? else ?>false<? endif ?>) AS reorderdate, itemsite_qtyonhand, reorderlevel FROM ( SELECT itemsite_id, itemsite_item_id, itemsite_warehous_id, itemsite_qtyonhand, CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END AS reorderlevel FROM itemsite WHERE ((true) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> ) ) AS itemsitedate, item, whsinfo WHERE ((itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id)) ) AS data WHERE (reorderdate IS NOT NULL) ORDER BY reorderdate, item_number; 221 140 120 200 20 Arial 10 bold Parameter Query lookAheadDays 5 215 745 215 2 525 80 200 20 Arial 10 bold head includeplnord 140 100 200 20 Arial 10 bold head warehouse 140 80 385 20 Arial 10 bold head plannercode 6 41 5 35 745 35 2
    detail detail 51 5 45 745 45 0 5 0 35 15 Arial 8 bold detail warehous_code 50 30 300 15 Arial 8 bold detail item_descrip2 385 0 100 15 Arial 8 bold detail f_reorderdate 490 0 100 15 Arial 8 bold detail f_reorderlevel 595 0 100 15 Arial 8 bold detail f_projavail 50 0 250 15 Arial 8 bold detail item_number 50 15 300 15 Arial 8 bold detail item_descrip1
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ReportsMasterList.xml000066400000000000000000000107121217451700100224030ustar00rootroot00000000000000 Reports Master List ReportsMasterList 0.05 0.05 Letter 50 50 50 50 detail reports detail 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 80 2 175 15 Arial 8 bold detail report_name 0 2 75 15 Arial 8 bold detail pkgname 265 2 475 15 1 Arial 8 bold detail report_descrip_qttooltiprole
    16 90 1 100 15 Arial 8 bold Context Query report_date 705 1 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ReturnAuthorizationWorkbenchDueCredit.xml000066400000000000000000000245071217451700100264400ustar00rootroot00000000000000 Return Authorization Workbench Due Credit ReturnAuthorizationWorkbenchDueCredit Letter 50 50 50 50 head SELECT <? if exists("cust_id") ?> cust_number AS f_custtype FROM custinfo WHERE(cust_id=<? value("cust_id") ?>); <? elseif exists("custtype_id") ?> custtype_name AS f_custtype FROM custtype WHERE(custtype_id=<? value("custtype_id") ?>); <? elseif exists("custgrp_id") ?> custgrp_name AS f_custtype FROM custgrp WHERE(custgrp_id=<? value("custgrp_id") ?>); <? else ?> text('All Customer Types') AS f_custtype <? endif ?> detail SELECT DISTINCT rahead_id, CASE WHEN rahead_creditmethod = 'M' THEN 1 WHEN rahead_creditmethod = 'K' THEN 2 WHEN rahead_creditmethod = 'C' THEN 3 END, rahead_number, cust_name, formatDate(rahead_authdate) AS f_authdate, formatDate(NULL) AS f_eligibledate, formatMoney(currtobase(rahead_curr_id, calcradueamt(rahead_id), current_date)) AS f_amount, CASE WHEN rahead_creditmethod = 'M' THEN <? value("creditmemo") ?> WHEN rahead_creditmethod = 'K' THEN <? value("check") ?> WHEN rahead_creditmethod = 'C' THEN <? value("creditcard") ?> END AS creditmethod, rahead_authdate FROM rahead, raitem, custtype, custinfo LEFT OUTER JOIN custgrpitem ON (cust_id=custgrpitem_cust_id) WHERE ( (rahead_id=raitem_rahead_id) AND (rahead_cust_id=cust_id) AND (cust_custtype_id=custtype_id) AND ((raitem_disposition = 'R' AND rahead_timing = 'R' AND raitem_qtyreceived > raitem_qtycredited) OR (raitem_disposition = 'R' AND rahead_timing = 'I' AND raitem_qtyauthorized > raitem_qtycredited) OR (raitem_disposition = 'C' AND raitem_qtyauthorized > raitem_qtycredited)) AND (raitem_status = 'O') AND (rahead_creditmethod != 'N') AND (calcradueamt(rahead_id) > 0) AND (raitem_disposition IN ('C','R')) <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> AND (custtype_id=<? value("custtype_id") ?>) <? elseif exists("custtype_pattern") ?> AND (custtype_pattern=<? value("custtype_pattern") ?>) <? elseif exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? endif ?> AND (rahead_creditmethod IN ('$' <? if exists("doM") ?>, 'M'<? endif ?> <? if exists("doK") ?>, 'K'<? endif ?> <? if exists("doC") ?>, 'C'<? endif ?> )) ) ORDER BY rahead_authdate,rahead_number; 223 5 215 745 215 2 185 80 200 20 Arial 10 bold head f_custtype 6 28 5 20 745 20 2
    detail detail 18 245 0 75 15 Arial 8 bold detail f_eligibledate 325 0 75 15 Arial 8 bold detail f_amount 410 0 100 15 Arial 8 bold detail creditmethod 5 0 80 15 Arial 8 bold detail rahead_number 90 0 75 15 Arial 8 bold detail cust_name 170 0 75 15 Arial 8 bold detail f_authdate
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ReturnAuthorizationWorkbenchReview.xml000066400000000000000000000316051217451700100260260ustar00rootroot00000000000000 Return Authorization Workbench Review ReturnAuthorizationWorkbenchReview Letter 50 50 50 50 head SELECT <? if exists("cust_id") ?> (cust_number || '-' || cust_name) AS f_custtype FROM custinfo WHERE(cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> (custtype_code || '-' || custtype_descrip) AS f_custtype FROM custtype WHERE(custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> (custgrp_name || '-' || custgrp_descrip) AS f_custtype FROM custgrp WHERE(custgrp_id=<? value("custgrp_id") ?>) <? else ?> text('All Customer Types') AS f_custtype <? endif ?> ; detail SELECT * FROM ( SELECT rahead_id, rahead_number, COALESCE(cust_name,text('Undefined')) AS custnumber, formatDate(rahead_authdate) AS f_authdate, COALESCE(formatDate(rahead_expiredate),text('Never')) AS f_expiredate, CASE WHEN raitem_disposition = 'C' THEN text('Credit') WHEN raitem_disposition = 'R' THEN text('Return') WHEN raitem_disposition = 'P' THEN text('Replace') WHEN raitem_disposition = 'V' THEN text('Service') WHEN raitem_disposition = 'S' THEN text('Shipment') END AS disposition, CASE WHEN rahead_creditmethod = 'N' THEN text('None') WHEN rahead_creditmethod = 'M' THEN text('Memo') WHEN rahead_creditmethod = 'K' THEN text('Check') WHEN rahead_creditmethod = 'C' THEN text('Card') END AS creditmethod, CASE WHEN raitem_status = 'C' THEN text('Closed') WHEN raitem_disposition = 'C' THEN text('Payment') WHEN raitem_disposition = 'R' AND SUM(raitem_qtyauthorized-raitem_qtycredited) > 0 AND SUM(raitem_qtyauthorized-raitem_qtyreceived) > 0 THEN text('Receipt') || ',' || text('Payment') WHEN raitem_disposition = 'R' AND SUM(raitem_qtyreceived-raitem_qtycredited) > 0 THEN text('Payment') WHEN raitem_disposition = 'R' AND SUM(raitem_qtyauthorized-raitem_qtyreceived) > 0 THEN text('Receipt') WHEN raitem_disposition IN ('P','V') AND SUM(raitem_qtyauthorized-COALESCE(coitem_qtyshipped,0)) > 0 AND SUM(raitem_qtyauthorized-raitem_qtyreceived) > 0 THEN text('Receipt') || ',' || text('Shipment') WHEN raitem_disposition IN ('P','V') AND SUM(raitem_qtyauthorized-COALESCE(coitem_qtyshipped,0)) > 0 THEN text('Shipment') WHEN raitem_disposition IN ('P','V') AND SUM(raitem_qtyauthorized-raitem_qtyreceived) > 0 THEN text('Receipt') WHEN raitem_disposition = 'S' THEN text('Shipment') ELSE '' END AS awaiting FROM rahead LEFT OUTER JOIN custinfo ON (rahead_cust_id=cust_id) LEFT OUTER JOIN custtype ON (cust_custtype_id=custtype_id) LEFT OUTER JOIN custgrpitem ON (custgrpitem_cust_id=cust_id), raitem LEFT OUTER JOIN coitem ON (raitem_new_coitem_id=coitem_id) WHERE ( (rahead_id=raitem_rahead_id) <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id")?>) <? elseif exists("custtype_id") ?> AND (custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? elseif exists("custtype_pattern") ?> AND (custtype_code ~ <? value("custtype_pattern") ?>) <? endif ?> <? if not exists("showExpired") ?> AND (COALESCE(rahead_expiredate,CURRENT_DATE) >= CURRENT_DATE) <? endif ?> <? if exists("showClosed") ?> AND (raitem_status='O' OR rahead_authdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> AND (raitem_status = 'O') <? endif ?> ) GROUP BY rahead_id,rahead_number,cust_name,rahead_expiredate, rahead_authdate,raitem_status,raitem_disposition,rahead_creditmethod, rahead_curr_id ORDER BY rahead_authdate,rahead_number ) as data WHERE (FALSE) <? if exists("showReceipts") ?> OR ((disposition IN ('Return','Replace','Service')) AND (awaiting ~ 'Receipt')) <? endif ?> <? if exists("showShipments") ?> OR ((disposition IN ('Replace','Service','Shipment')) AND (awaiting ~ 'Shipment')) <? endif ?> <? if exists("showPayments") ?> OR ((disposition IN ('Credit','Return')) AND (awaiting ~ 'Payment')) <? endif ?> <? if exists("showClosed") ?> OR ((awaiting = 'Closed')) <? endif ?> 223 185 80 200 20 Arial 10 bold head f_custtype 5 215 745 215 2 6 28 5 20 745 20 2
    detail detail 18 5 0 80 15 Arial 8 bold detail rahead_number 170 0 75 15 Arial 8 bold detail f_authdate 245 0 75 15 Arial 8 bold detail f_expiredate 410 0 100 15 Arial 8 bold detail creditmethod 325 0 75 15 Arial 8 bold detail disposition 525 0 195 15 Arial 8 bold detail awaiting 90 0 75 15 Arial 8 bold detail custnumber
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/RunningAvailability.xml000066400000000000000000000357241217451700100227220ustar00rootroot00000000000000 Running Availability RunningAvailability Updated in 2.3 to show order number and item code on higherlevel planned work orders. 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, uom_name, warehous_code AS warehouse, <? if exists("showPlanned") ?> text('Yes') <? else ?> text('No') <? endif ?> AS showplnord FROM item, uom, whsinfo WHERE ((item_id=<? value("item_id") ?>) AND (item_inv_uom_id=uom_id) AND (warehous_id=<? value("warehous_id") ?>)) detail runningAvailability detail info SELECT formatQty(itemsite_qtyonhand) AS qoh, formatQty(CASE WHEN(itemsite_useparams) THEN itemsite_reorderlevel ELSE 0.0 END) AS reorderlevel, formatQty(CASE WHEN(itemsite_useparams) THEN itemsite_ordertoqty ELSE 0.0 END) AS ordertoqty, formatQty(CASE WHEN(itemsite_useparams) THEN itemsite_multordqty ELSE 0.0 END) AS multorderqty FROM itemsite WHERE ((itemsite_item_id=<? value("item_id") ?>) AND (itemsite_warehous_id=<? value("warehous_id") ?>)); 238 95 125 300 20 Arial 10 bold head warehouse 95 75 300 20 Arial 10 bold head item_descrip1 95 95 300 20 Arial 10 bold head item_descrip2 595 145 100 20 Arial 10 bold info ordertoqty 365 125 100 20 Arial 10 bold info qoh 305 55 100 20 Arial 10 bold head uom_name 595 125 100 20 Arial 10 bold info reorderlevel 595 75 100 20 Arial 10 bold head showplnord 5 228 740 228 2 95 55 150 20 Arial 10 bold head item_number 365 145 100 20 Arial 10 bold info multorderqty 12 28 5 20 745 20 2
    detail detail 22 90 0 55 15 Arial 8 bold detail ordernumber 285 0 100 15 Arial 8 bold detail f_duedate 5 0 80 15 Arial 8 bold detail ordertype 555 0 80 15 Arial 8 bold detail f_balance 385 0 80 15 Arial 8 bold detail f_qtyordered 645 0 100 15 Arial 8 bold detail balance qty 467 0 80 15 Arial 8 bold detail f_qtyreceived 150 0 150 15 Arial 8 bold detail item_number
    22 705 0 40 15 Arial 8 bold Context Query page_number 102 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/SaleTypesMasterList.xml000066400000000000000000000116621217451700100226630ustar00rootroot00000000000000 Sale Types Master List SaleTypesMasterList 0.05 0.05 Letter 50 50 50 50 detail select * from saletype order by saletype_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail saletype_code 240 0 500 15 Arial 8 bold detail saletype_descr 180 2 50 15 Arial 8 bold detail saletype_active
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/SalesAccountAssignmentsMasterList.xml000066400000000000000000000256411217451700100255540ustar00rootroot00000000000000 Sales Account Assignments Master List SalesAccountAssignmentsMasterList Letter 50 50 50 50 detail SELECT salesaccnt_id, CASE WHEN salesaccnt_warehous_id=-1 THEN 'Any'::TEXT ELSE (SELECT warehous_code FROM whsinfo WHERE (warehous_id=salesaccnt_warehous_id)) END AS warehouscode, CASE WHEN salesaccnt_custtype_id=-1 THEN salesaccnt_custtype ELSE (SELECT custtype_code FROM custtype WHERE (custtype_id=salesaccnt_custtype_id)) END AS custtypecode, CASE WHEN salesaccnt_prodcat_id=-1 THEN salesaccnt_prodcat ELSE (SELECT prodcat_code FROM prodcat WHERE (prodcat_id=salesaccnt_prodcat_id)) END AS prodcatcode, formatGLAccount(salesaccnt_sales_accnt_id) AS salesaccnt, formatGLAccount(salesaccnt_credit_accnt_id) AS creditaccnt, formatGLAccount(salesaccnt_cos_accnt_id) AS costaccnt, formatGLAccount(salesaccnt_returns_accnt_id) AS returnsaccnt, formatGLAccount(salesaccnt_cor_accnt_id) AS coraccnt, formatGLAccount(salesaccnt_cow_accnt_id) AS cowaccnt FROM salesaccnt ORDER BY warehouscode, custtypecode, prodcatcode; 87 0 81 740 81 2 7 27 5 20 745 20 2
    detail detail 17 230 -1 75 15 Arial 8 bold detail salesaccnt 5 0 50 15 Arial 8 bold detail warehouscode 65 -1 75 15 Arial 8 bold detail custtypecode 315 -1 75 15 Arial 8 bold detail creditaccnt 150 -1 70 15 Arial 8 bold detail prodcatcode 400 -1 75 15 Arial 8 bold detail costaccnt 485 -1 75 15 Arial 8 bold detail returnsaccnt 570 -1 75 15 Arial 8 bold detail coraccnt 655 -1 75 15 Arial 8 bold detail cowaccnt
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SalesCategoriesMasterList.xml000066400000000000000000000154511217451700100240270ustar00rootroot00000000000000 Sales Categories Master List SalesCategoriesMasterList Letter 50 50 50 50 detail SELECT salescat_id, salescat_name, salescat_descrip, formatGLAccount(salescat_sales_accnt_id) AS salesaccnt, formatGLAccount(salescat_prepaid_accnt_id) AS prepaidaccnt, formatGLAccount(salescat_ar_accnt_id) AS araccnt FROM salescat ORDER BY salescat_name; 87 0 81 740 81 2 7 27 5 20 745 20 2
    detail detail 17 230 -1 75 15 Arial 8 bold detail salesaccnt 5 0 50 15 Arial 8 bold detail salescat_name 65 -1 155 15 Arial 8 bold detail salescat_descrip 315 -1 75 15 Arial 8 bold detail prepaidaccnt 400 -1 75 15 Arial 8 bold detail araccnt
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SalesHistory.xml000066400000000000000000000402731217451700100213730ustar00rootroot00000000000000 Sales History SalesHistory 0.05 0.05 Letter 50 50 50 50 detail SELECT cohist_ordernumber AS sonumber, cohist_invcnumber AS invnumber, formatDate(cohist_orderdate) AS orddate, formatDate(cohist_invcdate, 'Return') AS invcdate, item_number, item_descrip1, item_descrip2, formatQty(cohist_qtyshipped) AS shipped, <? if exists("showPrices") ?> formatPrice(currtobase(cohist_curr_id,cohist_unitprice,cohist_invcdate)) AS unitprice, formatMoney(round(cohist_qtyshipped * currtobase(cohist_curr_id,cohist_unitprice,cohist_invcdate),2)) AS f_total, <? else ?> '' AS unitprice, '' AS f_total, <? endif ?> round(cohist_qtyshipped * currtobase(cohist_curr_id,cohist_unitprice,cohist_invcdate),2) AS total FROM cohist JOIN custinfo ON (cust_id=cohist_cust_id) JOIN salesrep ON (salesrep_id=cohist_salesrep_id) <? if exists("includeMisc") ?> LEFT OUTER JOIN itemsite ON (itemsite_id=cohist_itemsite_id) LEFT OUTER JOIN site() ON (warehous_id=itemsite_warehous_id) LEFT OUTER JOIN item ON (item_id=itemsite_item_id) <? else ?> JOIN itemsite ON (itemsite_id=cohist_itemsite_id) JOIN site() ON (warehous_id=itemsite_warehous_id) JOIN item ON (item_id=itemsite_item_id) <? endif ?> <? if exists("cohead_id") ?> JOIN cohead ON (cohead_number=cohist_ordernumber) <? endif ?> WHERE ( (true) <? if exists("includeMisc") ?> AND (COALESCE(cohist_misc_type, '') <> 'F') AND (COALESCE(cohist_misc_type, '') <> 'T') <? endif ?> <? if exists("startDate") ?> AND (cohist_invcdate >= <? value("startDate") ?>) <? endif ?> <? if exists("endDate") ?> AND (cohist_invcdate <= <? value("endDate") ?>) <? endif ?> <? if exists("shipStartDate") ?> AND (cohist_shipdate >= <? value("shipStartDate") ?>) <? endif ?> <? if exists("shipEndDate") ?> AND (cohist_shipdate <= <? value("shipEndDate") ?>) <? endif ?> <? if exists("salesrep_id") ?> AND (cohist_salesrep_id=<? value("salesrep_id") ?>) <? endif ?> <? if exists("shipto_id") ?> AND (cohist_shipto_id=<? value("shipto_id") ?>) <? endif ?> <? if exists("billToName") ?> AND (UPPER(cohist_billtoname) ~ UPPER(<? value("billToName") ?>)) <? endif ?> <? if exists("cust_id") ?> AND (cohist_cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT DISTINCT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("by_custgrp" ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrpitem)) <? endif ?> <? if exists("custgrp_id") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrpitem WHERE (custgrpitem_custgrp_id=<? value("custgrp_id") ?>))) <? endif ?> <? if exists("custgrp_pattern") ?> AND (cust_id IN (SELECT DISTINCT custgrpitem_cust_id FROM custgrp, custgrpitem WHERE ( (custgrpitem_custgrp_id=custgrp_id) AND (custgrp_name ~ <? value("custgrp_pattern") ?>) )) ) <? endif ?> <? if exists("item_id") ?> AND (itemsite_item_id=<? value("item_id") ?>) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT DISTINCT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("shipzone_id") ?> AND (cohist_shipzone_id=<? value("shipzone_id") ?>) <? endif ?> <? if exists("saletype_id") ?> AND (cohist_saletype_id=<? value("saletype_id") ?>) <? endif ?> <? if exists("cohead_id") ?> AND (cohead_id=<? value("cohead_id") ?>) <? endif ?> ) ORDER BY cohist_invcdate, item_number head SELECT <? if exists("showPrices") ?> text('Unit Price') AS lbl_unitprice, text('Total') AS lbl_total <? else ?> text('') AS lbl_unitprice, text('') AS lbl_total <? endif ?>; 233 665 200 80 15 Arial 8 normal head lbl_total 5 230 745 230 2 585 200 80 15 Arial 8 normal head lbl_unitprice 15 48 725 15 12 Arial 10 bold Parameter Query filter 6 36 665 0 80 15 Arial 8 normal head lbl_total 5 30 745 30 2 585 0 80 15 Arial 8 normal head lbl_unitprice
    detail detail 51 355 15 300 15 Arial 8 bold detail item_descrip1 5 0 100 15 Arial 8 bold detail sonumber 355 30 300 15 Arial 8 bold detail item_descrip2 585 0 80 15 Arial 8 bold detail unitprice 270 0 80 15 Arial 8 bold detail orddate 505 0 80 15 Arial 8 bold detail shipped 5 45 745 45 0 270 15 80 15 Arial 8 bold detail invcdate 355 0 150 15 Arial 8 bold detail item_number 665 0 80 15 Arial 8 bold detail f_total 110 0 100 15 Arial 8 bold detail invnumber
    total showPrices 16 665 0 80 15 Arial 8 bold detail total money
    16 705 0 40 15 Arial 8 bold Context Query page_number 103 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/SalesOrderAcknowledgement.xml000066400000000000000000000547071217451700100240440ustar00rootroot00000000000000 Sales Order Acknowledgement SalesOrderAcknowledgement Sales Order Acknowledgement Omits Closed Lines -- With Barcodes formatitemsitebarcode(itemsite_id) -- SO # barcoded formatsobarcode(cohead_id) -- With Logo, place logo graphic in images DB with name "logo" 0.05 0.05 Letter 25 25 25 25 head SELECT cust_number, formatsobarcode(cohead_id) AS order_barcode, formataddr(cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode), cohead_billtocountry) AS billing_address, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, trim(cntct_first_name || ' ' || cntct_last_name) AS cust_contact, cohead_billtoname, cohead_billtoaddress1, cohead_billtoaddress2, cohead_billtoaddress3, (cohead_billtocity || ' ' || cohead_billtostate || ' ' || cohead_billtozipcode) AS billtocitystatezip, cntct_phone AS cust_phone, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_number, cohead_shipvia, cohead_shiptophone, cohead_custponumber, formatDate(cohead_orderdate) AS orderdate, cohead_shipcomments, terms_descrip FROM cohead, custinfo, terms, cntct WHERE ((cohead_cust_id=cust_id) AND (cust_cntct_id=cntct_id) AND (cohead_terms_id=terms_id) AND (cohead_id=<? value("sohead_id") ?>) ); scheddate SELECT formatDate(MIN(coitem_scheddate)) AS scheddate FROM coitem WHERE ((coitem_status <> 'X') AND (coitem_cohead_id=<? value("sohead_id") ?>)); detail salesOrderItems list logo SELECT image_data FROM image WHERE ((image_name='logo')); 477 375 0 425 85 stretch logo image_data 120 400 253 25 Arial 12 normal head cust_contact 175 195 100 20 helvetica 14 normal head orderdate 469 400 320 20 Arial 12 normal head terms_descrip 375 130 177 25 3of9 10 0.01 head cust_number 375 160 307 25 3of9 20 0.01 head cohead_custponumber 170 155 170 20 helvetica 14 normal head cohead_custponumber 433 215 331 20 helvetica 14 normal head cohead_shipvia 170 95 100 20 helvetica 14 normal head cohead_number 375 95 234 25 128 10 0.01 head order_barcode 25 465 823 465 0 75 260 305 20 Arial 14 normal head cohead_billtoname 75 280 295 20 10 Arial 10 normal head billing_address 465 280 305 20 10 Arial 10 normal head shipping_address 170 125 170 20 helvetica 14 normal head cust_number 465 260 305 20 helvetica 14 normal head cohead_shiptoname 175 215 100 20 helvetica 14 normal scheddate scheddate 25 425 823 425 0
    detail detail groupby 72 50 5 625 17 14 helvetica 10 normal head cohead_shipcomments lineitem coitem_linenumber 28 5 5 843 5 0 detail 153 425 0 100 20 helvetica 10 normal detail f_qtyshipped 635 0 100 20 helvetica 10 normal detail f_qtyatshipping 365 30 469 35 128 15 0.01 detail item_barcode 630 95 85 15 helvetica 10 normal detail enhanced_status 100 120 700 17 14 helvetica 10 normal detail coitem_memo 80 80 170 80 0 415 80 500 80 0 530 0 100 20 helvetica 10 normal detail f_balance 80 110 170 110 0 25 40 295 20 Arial 11 bold detail item_descrip2_cust 305 110 395 110 0 25 0 200 20 Arial 11 bold detail item_number_cust 25 20 295 20 Arial 11 bold detail item_descrip1_cust 745 15 795 15 1 190 80 280 80 0 632 80 720 80 0 190 110 280 110 0 228 0 85 20 helvetica 10 normal detail qty_uom 415 110 500 110 0 305 80 395 80 0 320 0 100 20 helvetica 10 normal detail f_qtyord
    57 90 5 95 17 Arial 8 normal Context Query report_date 455 5 80 17 Arial 8 normal head cohead_number 735 5 45 17 Arial 8 normal Context Query page_number 113 185 25 363 25 0 186 90 360 90 0
    qt-client-4.1.0/share/reports/SalesOrderStatus.xml000066400000000000000000000442541217451700100222140ustar00rootroot00000000000000 Sales Order Status SalesOrderStatus Letter 50 50 50 50 detail SELECT --the following line was added for version 2.3: (select uom_name from uom where uom_id = coitem_qty_uom_id) AS uom_orderuom, coitem_linenumber, item_number, item_descrip1, item_descrip2, warehous_code, formatQty(coitem_qtyord) AS qtyord, formatQty(coitem_qtyshipped) AS qtyship, formatQty(coitem_qtyreturned) AS qtyret, formatQty(SUM(COALESCE(shipitem_qty, 0))) AS qtyinvcd, formatQty(noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned)) AS f_balance, CASE WHEN (coitem_status='C') THEN ( formatDate(coitem_closedate) || ' (' || coitem_close_username || ')' ) ELSE '' END AS f_dateuser, CASE WHEN (coitem_order_id=-1) THEN '' WHEN (coitem_order_type='W') THEN ( SELECT (formatWoNumber(wo_id) || '/' || wo_status) FROM wo WHERE (wo_id=coitem_order_id) ) ELSE '' END AS f_childord FROM itemsite, item, whsinfo, coitem LEFT OUTER JOIN shipitem ON (shipitem_orderitem_id=coitem_id AND shipitem_invcitem_id IS NOT NULL) WHERE ((coitem_itemsite_id=itemsite_id) AND (coitem_status<>'X') AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (coitem_cohead_id=<? value("sohead_id") ?>) ) GROUP BY uom_orderuom, coitem_id, coitem_linenumber, item_number, item_descrip1, item_descrip2, warehous_code, coitem_qtyord, coitem_qtyshipped, coitem_status, coitem_closedate, coitem_close_username, coitem_qtyreturned, coitem_order_id, coitem_order_type ORDER BY coitem_linenumber; head SELECT cohead_number, formatDate(cohead_orderdate) AS orderdate, cohead_custponumber, cust_name, cntct_phone AS cust_phone FROM cohead, custinfo, cntct WHERE ((cohead_cust_id=cust_id) AND (cust_cntct_id=cntct_id) AND (cohead_id=<? value("sohead_id") ?>) ); lastupdated SELECT formatDate(MAX(lastupdated)) AS f_lastupdated FROM (SELECT cohead_lastupdated AS lastupdated FROM cohead WHERE (cohead_id=:sohead_id) UNION SELECT coitem_lastupdated AS lastupdated FROM coitem WHERE (coitem_cohead_id=<? value("sohead_id") ?>) ) AS data; 224 112 95 220 20 Arial 10 bold head orderdate 475 75 220 20 Arial 10 bold head cust_name 5 215 745 215 2 475 112 220 20 Arial 10 bold head cohead_custponumber 475 95 220 20 Arial 10 bold head cust_phone 475 135 220 20 Arial 10 bold lastupdated f_lastupdated 112 75 220 20 Arial 10 bold head cohead_number 7 37 5 30 745 30 2
    detail detail 54 645 0 100 15 Arial 8 bold detail f_childord 550 15 100 15 Arial 8 bold detail f_dateuser 550 0 100 15 Arial 8 bold detail f_balance 5 45 745 45 0 5 0 25 15 Arial 8 bold detail coitem_linenumber 469 0 80 15 Arial 8 bold detail qtyinvcd 35 0 150 15 Arial 8 bold detail item_number 229 0 80 15 Arial 8 bold detail qtyord 170 0 50 15 Arial 8 bold detail warehous_code 390 0 80 15 Arial 8 bold detail qtyret 35 30 300 15 Arial 8 bold detail item_descrip2 310 0 80 15 Arial 8 bold detail qtyship 35 15 300 15 Arial 8 bold detail item_descrip1 200 0 55 15 Arial 8 bold detail uom_orderuom
    20 715 0 30 15 Arial 8 bold Context Query page_number 80 0 140 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/SalesRepsMasterList.xml000066400000000000000000000135411217451700100226510ustar00rootroot00000000000000 Sales Reps Master List SalesRepsMasterList Letter 50 50 50 50 detail select salesrep_number, salesrep_name, formatBoolYN(salesrep_active) AS f_active, formatScrap(salesrep_commission) AS f_commprcnt from salesrep order by salesrep_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 610 0 50 15 Arial 8 bold detail f_active 10 0 100 15 Arial 8 bold detail salesrep_number 115 0 490 15 Arial 8 bold detail salesrep_name 665 0 80 15 Arial 8 bold detail f_commprcnt
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/SelectPaymentsList.xml000066400000000000000000000321511217451700100225320ustar00rootroot00000000000000 Select Payments List SelectPaymentsList Letter 50 50 50 50 detail SELECT apopen_id, apselectid, vendor, apopen_docnumber, apopen_ponumber, formatDate(apopen_duedate) AS f_duedate, formatDate(apopen_docdate) AS f_docdate, formatMoney(amount) AS f_amount, f_selected, f_late, status FROM (SELECT apopen_id, COALESCE(apselect_id, -1) AS apselectid, (vend_number || '-' || vend_name) AS vendor, apopen_docnumber, apopen_ponumber, apopen_duedate, apopen_docdate, (apopen_amount - apopen_paid - COALESCE((SELECT SUM(checkitem_amount / checkitem_curr_rate) FROM checkitem, checkhead WHERE ((checkitem_checkhead_id=checkhead_id) AND (checkitem_apopen_id=apopen_id) AND (NOT checkhead_void) AND (NOT checkhead_posted)) ), 0)) AS amount, formatMoney(COALESCE(SUM(apselect_amount), 0)) AS f_selected, formatBoolYN(apopen_duedate <= CURRENT_DATE) AS f_late, CASE WHEN (apopen_status='O') THEN TEXT('Open') ELSE CASE WHEN (apopen_status='H') THEN TEXT('On Hold') ELSE CASE WHEN (apopen_status='C') THEN TEXT('Close') END END END AS status FROM vendinfo, apopen LEFT OUTER JOIN apselect ON (apselect_apopen_id=apopen_id) WHERE ( (apopen_open) AND (apopen_doctype IN ('V', 'D')) AND (apopen_vend_id=vend_id) <? if exists("vend_id") ?> AND (vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> AND (vend_vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> AND (vend_vendtype_id IN (SELECT vendtype_id FROM vendtype WHERE (vendtype_code ~ <? value("vendtype_pattern") ?>))) <? endif ?> ) GROUP BY apopen_id, apselect_id, vend_number, vend_name, apopen_docnumber, apopen_ponumber, apopen_duedate, apopen_docdate, apopen_amount, apopen_paid, apopen_curr_id, apopen_status) AS data WHERE (amount <> 0.0) ORDER BY apopen_duedate, amount DESC; head SELECT <? if exists("vend_id") ?> ( SELECT vend_name FROM vendinfo WHERE (vend_id=<? value("vend_id") ?>) ) <? elseif exists("vendtype_id") ?> ( SELECT (vendtype_code || '-' || vendtype_descrip) FROM vendtype WHERE (vendtype_id=<? value("vendtype_id") ?>) ) <? elseif exists("vendtype_pattern") ?> text(<? value("vendtype_pattern") ?>) <? else ?> text('All Vendors') <? endif ?> AS f_value, <? if reExists("vendtype_.*") ?> text('Vendor Type:') <? else ?> text('Vendor:') <? endif ?> AS f_label; 141 20 65 125 20 Arial 10 normal head f_label 150 65 200 20 Arial 10 bold head f_value 5 135 745 135 2 6 21 5 15 745 15 2
    detail detail 17 205 -1 80 15 Arial 8 bold detail apopen_ponumber 280 0 80 15 Arial 8 bold detail f_duedate 590 0 100 15 Arial 8 bold detail f_selected 505 0 100 15 Arial 8 bold detail f_amount 360 0 80 15 Arial 8 bold detail f_docdate 680 0 65 15 Arial 8 bold detail f_late 130 0 80 15 Arial 8 bold detail apopen_docnumber 5 0 120 15 Arial 8 bold detail vendor 435 0 80 15 Arial 8 bold detail status
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SelectedPaymentsList.xml000066400000000000000000000166531217451700100230540ustar00rootroot00000000000000 Selected Payments List SelectedPaymentsList Letter 50 50 50 50 detail SELECT apopen_id, apselect_id, (bankaccnt_name || '-' || bankaccnt_descrip) AS bankaccnt, (vend_number || '-' || vend_name) AS vendor, apopen_docnumber, apopen_ponumber, formatMoney(apselect_amount) AS f_selected FROM apselect, apopen, vendinfo, bankaccnt WHERE ((apopen_vend_id=vend_id) AND (apselect_apopen_id=apopen_id) AND (apselect_bankaccnt_id=bankaccnt_id) <? if exists("vend_id") ?> AND (vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> AND (vend_vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> AND (vend_vendtype_id IN (SELECT vendtype_id FROM vendtype WHERE (vendtype_code ~ <? value("vendtype_pattern") ?>))) <? endif ?> ) ORDER BY bankaccnt_name, vend_number, apopen_docnumber; 141 5 135 745 135 2 6 21 5 15 745 15 2
    detail detail 16 575 0 100 15 Arial 8 bold detail f_selected 450 0 100 15 Arial 8 bold detail apopen_ponumber 10 0 225 15 Arial 8 bold detail bankaccnt 365 0 80 15 Arial 8 bold detail apopen_docnumber 240 0 120 15 Arial 8 bold detail vendor
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ShipToMasterList.xml000066400000000000000000000157351217451700100221650ustar00rootroot00000000000000 Ship-To Master List ShipToMasterList Letter 50 50 50 50 head SELECT cust_number, cust_name FROM custinfo WHERE (cust_id=<? value("cust_id") ?>); detail SELECT shipto_num AS num, shipto_name AS name, addr_line1 AS address, (addr_city || ', ' || addr_state || ' ' || addr_postalcode) AS citystatezip FROM shiptoinfo LEFT OUTER JOIN addr ON (shipto_addr_id=addr_id) WHERE (shipto_cust_id=<? value("cust_id") ?>) ORDER BY shipto_num; 171 5 165 745 165 2 135 70 300 20 Arial 10 bold head cust_number 135 90 300 20 Arial 10 bold head cust_name 6 21 5 15 745 15 2
    detail detail 16 5 0 50 15 Arial 8 bold detail num 270 0 250 15 Arial 8 bold detail address 545 0 200 15 Arial 8 bold detail citystatezip 65 0 200 15 Arial 8 bold detail name
    16 705 0 40 15 Arial 8 bold Context Query page_number 105 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ShipmentsByDate.xml000066400000000000000000000371621217451700100220100ustar00rootroot00000000000000 Shipments By Date ShipmentsByDate Letter 50 50 50 50 head SELECT formatDate(date(<? value("startDate") ?>)) AS startDate, formatDate(date(<? value("endDate") ?>)) AS endDate; detail SELECT shiphead_id, lineitem_id, CASE WHEN (level=0) THEN order_number ELSE item_number END AS order_item, CASE WHEN (level=0) THEN customer ELSE itemdescription END AS cust_desc, shiphead_order_type, shiphead_number, order_number, customer, shiphead_shipdate AS f_shipdate, shiphead_tracknum, shiphead_freight, freight_curr_abbr, linenumber, item_number, itemdescription, warehous_code, formatQty(qtyord) AS f_qtyord, formatQty(qtyshipped) AS f_qtyshipped FROM ( SELECT shiphead_id, coitem_id AS lineitem_id, cohead_number AS sortkey1, shiphead_number AS sortkey2, 1 AS level, shiphead_order_type, shiphead_number, cohead_number AS order_number, (cust_number || '-' || cust_name) AS customer, shiphead_shipdate, shiphead_tracknum, shiphead_freight, currConcat(shiphead_freight_curr_id) AS freight_curr_abbr, coitem_linenumber AS linenumber, item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdescription, warehous_code, coitem_qtyord AS qtyord, SUM(shipitem_qty) AS qtyshipped FROM shipitem, shiphead, coitem, cohead, custinfo, itemsite, item, whsinfo WHERE ( (shipitem_shiphead_id=shiphead_id) AND (shipitem_orderitem_id=coitem_id) AND (coitem_itemsite_id=itemsite_id) AND (coitem_status <> 'X') AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (shiphead_order_id=cohead_id) AND (cohead_cust_id=cust_id) AND (shiphead_shipped) AND (shiphead_order_type='SO') <? if exists("startDate") ?> AND (shiphead_shipdate BETWEEN <? value("startDate") ?> and <? value("endDate") ?>) <? endif ?> <? if exists("sohead_id") ?> AND (cohead_id = <? value("sohead_id") ?>) <? endif ?> <? if exists("shiphead_id") ?> AND (shiphead_id = <? value("shiphead_id") ?>) <? endif ?> ) GROUP BY shiphead_id, coitem_id, shiphead_order_type, shiphead_number, cohead_number, cust_number, cust_name, shiphead_shipdate, coitem_linenumber, item_number, item_descrip1, item_descrip2, warehous_code, shiphead_tracknum, coitem_qtyord, shiphead_freight, shiphead_freight_curr_id <? if exists("MultiWhs") ?> UNION SELECT shiphead_id, toitem_id AS lineitem_id, tohead_number AS sortkey1, shiphead_number AS sortkey2, 1 AS level, shiphead_order_type, shiphead_number, tohead_number AS order_number, tohead_destname AS customer, shiphead_shipdate, shiphead_tracknum, shiphead_freight, currConcat(shiphead_freight_curr_id) AS freight_curr_abbr, toitem_linenumber AS linenumber, item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdescription, tohead_srcname AS warehous_code, toitem_qty_ordered AS qtyord, SUM(shipitem_qty) AS qtyshipped FROM shipitem, shiphead, toitem, tohead, item WHERE ( (shipitem_shiphead_id=shiphead_id) AND (shipitem_orderitem_id=toitem_id) AND (toitem_status <> 'X') AND (toitem_item_id=item_id) AND (shiphead_order_id=tohead_id) AND (shiphead_shipped) AND (shiphead_order_type='TO') <? if exists("startDate") ?> AND (shiphead_shipdate BETWEEN <? value("startDate") ?> and <? value("endDate") ?>) <? endif ?> <? if exists("tohead_id") ?> AND (tohead_id = <? value("tohead_id") ?>) <? endif ?> <? if exists("shiphead_id") ?> AND (shiphead_id = <? value("shiphead_id") ?>) <? endif ?> ) GROUP BY shiphead_id, toitem_id, shiphead_order_type, shiphead_number, tohead_number, tohead_destname, shiphead_shipdate, toitem_linenumber, item_number, item_descrip1, item_descrip2, tohead_srcname, shiphead_tracknum, toitem_qty_ordered, shiphead_freight, shiphead_freight_curr_id <? endif ?> ) AS data ORDER BY sortkey1, sortkey2, level, linenumber DESC; 221 140 70 200 20 Arial 10 bold head startdate 5 215 745 215 2 140 90 200 20 Arial 10 bold head enddate 5 41 5 35 745 35 2
    detail cohead_number order_number 45 85 40 745 40 2 114 5 140 15 Arial 8 bold detail order_number 114 20 300 15 Arial 8 bold detail customer detail 33 240 0 140 15 Arial 8 bold detail item_number 520 0 75 15 Arial 8 bold detail f_qtyord 5 28 745 28 0 5 0 95 15 Arial 8 bold detail shiphead_number 600 0 75 15 Arial 8 bold detail f_qtyshipped 185 0 50 15 Arial 8 bold detail linenumber 105 0 75 15 Arial 8 bold detail f_shipdate 440 0 50 15 Arial 8 bold detail warehous_code 240 15 455 15 Arial 8 bold detail itemdescription
    15 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ShipmentsBySalesOrder.xml000066400000000000000000000345001217451700100231670ustar00rootroot00000000000000 Shipments By Sales Order ShipmentsBySalesOrder Letter 50 50 50 50 head SELECT cohead_number AS f_sonumber, formatDate(cohead_orderdate) AS f_orderdate, cohead_custponumber AS f_ponumber, cust_name AS f_custname, cntct_phone AS f_custphone FROM cohead, custinfo, cntct WHERE ((cohead_cust_id=cust_id) AND (cust_cntct_id=cntct_id) AND (cohead_id=<? value("sohead_id") ?>)); detail SELECT shiphead_id, coitem_id, formatShipmentNumber(shiphead_id) AS shiphead_number, formatDate(shiphead_shipdate) AS f_shipdate, coitem_linenumber, item_number, item_descrip1, item_descrip2, uom_name, warehous_code, formatQty(coitem_qtyord) AS f_qtyord, formatQty(SUM(shipitem_qty)) AS f_qtyshipped FROM shipitem, shiphead, coitem, itemsite, item, uom, whsinfo WHERE ( (shipitem_shiphead_id=shiphead_id) AND (shiphead_order_type='SO') AND (shipitem_orderitem_id=coitem_id) AND (shiphead_shipped) AND (coitem_itemsite_id=itemsite_id) AND (coitem_status<>'X') AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (coitem_cohead_id=<? value("sohead_id") ?>) ) GROUP BY shiphead_id, coitem_id, shiphead_shipdate, coitem_linenumber, item_number, item_descrip1, item_descrip2, uom_name, warehous_code, coitem_qtyord ORDER BY shiphead_id DESC, coitem_linenumber DESC; 221 140 90 200 20 Arial 10 bold head f_orderdate 140 155 200 20 Arial 10 bold head f_ponumber 140 135 200 20 Arial 10 bold head f_custphone 140 114 200 20 Arial 10 bold head f_custname 140 70 200 20 Arial 10 bold head f_sonumber 5 215 745 215 2 5 41 5 35 745 35 2
    detail detail 51 240 15 250 15 Arial 8 bold detail item_descrip1 185 0 50 15 Arial 8 bold detail coitem_linenumber 520 0 75 15 Arial 8 bold detail f_qtyord 105 0 75 15 Arial 8 bold detail f_shipdate 5 0 100 15 Arial 8 bold detail shiphead_number 600 0 75 15 Arial 8 bold detail f_qtyshipped 240 30 250 15 Arial 8 bold detail item_descrip2 385 0 50 15 Arial 8 bold detail uom_name 240 0 140 15 Arial 8 bold detail item_number 440 0 50 15 Arial 8 bold detail warehous_code 5 45 745 45 0
    15 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ShipmentsByShipment.xml000066400000000000000000000362641217451700100227240ustar00rootroot00000000000000 Shipments By Shipment ShipmentsByShipment Letter 50 50 50 50 head SELECT shiphead_number AS f_shipnumber, shiphead_tracknum AS f_tracknum, formatMoney(shiphead_freight) AS freight, ordernumber AS f_sonumber, formatDate(orderdate) AS f_orderdate, custponumber AS f_ponumber, cust_name AS f_custname, cntct_phone AS f_custphone FROM custinfo JOIN cntct ON (cust_cntct_id=cntct_id), (SELECT shiphead_number, shiphead_tracknum, shiphead_freight, cohead_number AS ordernumber, cohead_cust_id AS order_cust_id, cohead_orderdate AS orderdate, cohead_custponumber AS custponumber FROM cohead JOIN shiphead ON (shiphead_order_id=cohead_id AND shiphead_order_type='SO') WHERE(shiphead_id=<? value("shiphead_id") ?>) UNION SELECT shiphead_number, shiphead_tracknum, shiphead_freight, tohead_number AS ordernumber, NULL AS order_cust_id, tohead_orderdate AS orderdate, NULL AS custponumber FROM tohead JOIN shiphead ON (shiphead_order_id=tohead_id AND shiphead_order_type='TO') WHERE(shiphead_id=<? value("shiphead_id") ?>) ) AS taborder WHERE(order_cust_id=cust_id); detail shipments detail 221 140 90 200 20 Arial 10 bold head f_orderdate 140 155 200 20 Arial 10 bold head f_ponumber 140 135 200 20 Arial 10 bold head f_custphone 140 114 200 20 Arial 10 bold head f_custname 140 70 200 20 Arial 10 bold head f_sonumber 5 215 745 215 2 140 49 200 20 Arial 10 bold head f_shipnumber 540 129 200 20 Arial 10 bold head f_tracknum 540 149 200 20 Arial 10 bold head f_freight 5 41 5 35 745 35 2
    detail detail 38 240 15 480 15 Arial 8 bold detail item_description 185 0 50 15 Arial 8 bold detail linenumber 520 0 75 15 Arial 8 bold detail f_qtyord 105 0 75 15 Arial 8 bold detail f_shipdate 5 0 100 15 Arial 8 bold detail shiphead_number 600 0 75 15 Arial 8 bold detail f_qtyshipped 240 0 140 15 Arial 8 bold detail item_number 440 0 50 15 Arial 8 bold detail warehous_code 5 33 745 33 0
    15 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ShipmentsPending.xml000066400000000000000000000272001217451700100222140ustar00rootroot00000000000000 Shipments Pending ShipmentsPending Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail maintainShipping detail 221 140 70 200 20 Arial 10 bold head warehouse 5 215 745 215 2 5 41 5 35 745 35 2
    detail detail 33 240 0 140 15 Arial 8 bold detail dest 520 0 75 15 Arial 8 bold detail f_shipqty 5 28 745 28 0 5 0 95 15 Arial 8 bold detail shiphead_number 600 0 75 15 Arial 8 bold detail f_shipvalue 160 0 75 15 Arial 8 bold detail linenumber 105 0 45 15 Arial 8 bold detail ordertype 390 0 80 15 Arial 8 bold detail shiphead_shipvia 240 13 455 15 Arial 8 bold detail description 480 0 30 15 Arial 8 bold detail uom_name
    15 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date 100 600 10 75 15 Arial 8 bold detail shipvalue cost
    qt-client-4.1.0/share/reports/ShippingLabelsByInvoice.xml000066400000000000000000000131501217451700100234500ustar00rootroot00000000000000 Shipping Labels By Invoice ShippingLabelsByInvoice Avery 5263 Labels 100 100 100 100 detail SELECT sequence_value, invchead_invcnumber, cust_number, invchead_ordernumber, invchead_ponumber, invchead_shipto_name, invchead_shipto_address1, invchead_shipto_address2, invchead_shipto_address3, (COALESCE(invchead_shipto_city,'') || ' ' || COALESCE(invchead_shipto_state,'') || ' ' || COALESCE(invchead_shipto_zipcode,'')) AS citystatezip FROM invchead, custinfo, sequence WHERE ( (invchead_cust_id=cust_id) AND (sequence_value BETWEEN <? value("labelFrom") ?> AND <? value("labelTo") ?>) AND (invchead_id=<? value("invchead_id") ?>) );
    detail detail 201 100 125 155 17 Arial 10 normal detail cust_number 100 140 155 17 Arial 10 normal detail invchead_invcnumber 285 180 36 17 Arial 10 normal detail sequence_value 30 85 285 15 Arial 10 normal detail citystatezip 30 40 285 15 Arial 10 normal detail invchead_shipto_address1 340 180 36 17 Arial 10 normal Parameter Query labelTo 30 25 285 15 Arial 10 normal detail invchead_shipto_name 30 70 285 15 Arial 10 normal detail invchead_shipto_address3 30 55 285 15 Arial 10 normal detail invchead_shipto_address2 100 155 155 17 Arial 10 normal detail invchead_ponumber
    qt-client-4.1.0/share/reports/ShippingLabelsBySO.xml000066400000000000000000000114601217451700100223770ustar00rootroot00000000000000 Shippinig Labels By S/O ShippingLabelsBySo Letter 100 100 100 100 detail SELECT sequence_value, cust_number, cohead_number, formataddr(cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode), cohead_shiptocountry) AS shipping_address, cohead_custponumber, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (COALESCE(cohead_shiptocity,'') || ' ' || COALESCE(cohead_shiptostate,'') || ' ' || COALESCE(cohead_shiptozipcode,'')) AS citystatezip FROM cohead, custinfo, sequence WHERE ( (cohead_cust_id=cust_id) AND (sequence_value BETWEEN <? value("labelFrom") ?> AND <? value("labelTo") ?>) AND (cohead_id=<? value("sohead_id") ?>) ) LIMIT <? value("labelTo") ?>;
    detail detail 494 725 9 155 16 Arial 10 normal detail cust_number 800 445 36 16 Arial 10 normal Parameter Query labelTo 15 119 880 55 0 Arial 36 bold detail shipping_address 9 65 884 50 Arial 36 bold detail cohead_shiptoname 725 40 155 16 Arial 10 normal detail cohead_custponumber 725 25 155 16 Arial 10 normal detail cohead_number 735 445 36 16 Arial 10 normal detail sequence_value
    qt-client-4.1.0/share/reports/ShippingZonesMasterList.xml000066400000000000000000000101631217451700100235450ustar00rootroot00000000000000 Shipping Zones Master List ShippingZonesMasterList 850 1100 50 50 50 50 detail select shipzone_name, shipzone_descrip from shipzone order by shipzone_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail shipzone_name 175 0 565 15 Arial 8 bold detail shipzone_descrip
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/SingleLevelBOM.xml000066400000000000000000000530711217451700100215110ustar00rootroot00000000000000 Single Level Bill of Materials SingleLevelBOM Letter 50 50 50 50 head SELECT item_number, uom_name AS item_invuom, item_descrip1, item_descrip2 FROM item, uom WHERE ((item_id=<? value("item_id") ?>) AND (item_inv_uom_id=uom_id)); detail SELECT bomitem_seqnumber, item_number, invuom.uom_name AS invuomname, issueuom.uom_name AS issueuomname, item_descrip1, item_descrip2, formatBoolYN(bomitem_createwo) AS createchild, CASE WHEN (bomitem_issuemethod='S') THEN 'Push' WHEN (bomitem_issuemethod='L') THEN 'Pull' WHEN (bomitem_issuemethod='M') THEN 'Mixed' ELSE 'Special' END AS issuemethod, formatQty(bomitem_qtyfxd) AS issueqtyfxd, formatQty(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyfxd)) AS invqtyfxd, formatQtyPer(bomitem_qtyper) AS issueqtyper, formatQtyPer(itemuomtouom(bomitem_item_id, bomitem_uom_id, NULL, bomitem_qtyper)) AS invqtyper, formatScrap(bomitem_scrap) AS scrap, formatQtyPer((bomitem_qtyfxd + bomitem_qtyper) * (1 + bomitem_scrap)) AS qtyreq, formatDate(bomitem_effective, <? value("always") ?>) AS effective, formatDate(bomitem_expires, <? value("never") ?>) AS expires, bomitem_ecn <? if exists("revision_id") ?> FROM bomitem(<? value("item_id") ?>,<? value("revision_id") ?>) <? else ?> FROM bomitem(<? value("item_id") ?>) <? endif ?> , item, uom AS issueuom, uom AS invuom WHERE ((bomitem_item_id=item_id) AND (item_inv_uom_id=invuom.uom_id) AND (bomitem_uom_id=issueuom.uom_id) <? if exists("expiredDays") ?> AND (bomitem_expires > (CURRENT_DATE - <? value("expiredDays") ?>)) <? else ?> AND (bomitem_expires > CURRENT_DATE) <? endif ?> <? if exists("effectiveDays") ?> AND (bomitem_effective <= (CURRENT_DATE + <? value("effectiveDays") ?>)) <? else ?> AND (bomitem_effective <= CURRENT_DATE) <? endif ?> ) ORDER BY bomitem_seqnumber, bomitem_effective; bomhead SELECT bomhead_docnum, bomhead_revision, formatDate(bomhead_revisiondate) AS f_revisiondate FROM bomhead WHERE ((bomhead_item_id=<? value("item_id") ?>) <? if exists("revision_id") ?> AND (bomhead_rev_id=<? value("revision_id") ?>) <? else ?> AND (bomhead_rev_id=getActiveRevId('BOM',<? value("item_id") ?>)) <? endif ?> ); 208 120 110 300 20 Arial 10 bold head item_descrip1 482 130 200 20 Arial 10 bold bomhead bomhead_revision 120 90 200 20 Arial 10 bold head item_number 482 110 200 20 Arial 10 bold bomhead f_revisiondate 482 90 200 20 Arial 10 bold bomhead bomhead_docnum 120 130 300 20 Arial 10 bold head item_descrip2 5 202 745 202 2 7 37 5 30 745 30 2
    detail detail 57 405 18 37 15 Arial 8 bold detail invuomname 675 18 75 15 Arial 8 bold detail issuemethod 675 3 75 15 Arial 8 bold detail expires 440 3 75 15 Arial 8 bold detail scrap 15 0 40 15 Arial 8 bold detail bomitem_seqnumber 315 33 227 15 Arial 8 bold detail item_descrip2 315 18 75 15 Arial 8 bold detail invqtyper 70 0 115 15 Arial 8 bold detail item_number 5 45 745 45 0 600 3 75 15 Arial 8 bold detail effective 455 18 135 15 Arial 8 bold detail bomitem_ecn 525 3 75 15 Arial 8 bold detail qtyreq 600 18 75 15 Arial 8 bold detail createchild 70 33 227 15 Arial 8 bold detail item_descrip1 315 3 75 15 Arial 8 bold detail issueqtyper 405 3 37 15 Arial 8 bold detail issueuomname 235 3 75 15 Arial 8 bold detail issueqtyfxd 235 18 75 15 Arial 8 bold detail invqtyfxd
    21 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SingleLevelWhereUsed.xml000066400000000000000000000373421217451700100227720ustar00rootroot00000000000000 Single Level Where Used SingleLevelWhereUsed 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, uom_name, item_descrip1, item_descrip2, <? if exists("effective") ?> formatDate(<? value("effective") ?>) <? else ?> text('Now') <? endif ?> AS effective FROM item JOIN uom ON (item_inv_uom_id=uom_id) WHERE (item_id=<? value("item_id") ?>); detail whereUsed detail 241 5 235 745 235 2 114 140 300 20 Arial 10 bold head item_descrip1 450 120 200 20 Arial 10 bold head effective 114 160 300 20 Arial 10 bold head item_descrip2 114 120 200 20 Arial 10 bold head item_number 450 138 185 20 Arial 10 bold head uom_name 6 41 5 35 745 35 2
    detail detail 56 444 0 75 15 Arial 8 bold detail f_scrap 75 15 229 15 Arial 8 bold detail item_descrip1 75 30 229 15 Arial 8 bold detail item_descrip2 404 0 38 15 Arial 8 bold detail uom_name 675 15 75 15 Arial 8 bold detail f_issuemethod 675 0 75 15 Arial 8 bold detail f_expires 75 0 229 15 Arial 8 bold detail item_number 4 50 745 50 0 5 0 65 15 Arial 8 bold detail bomitem_seqnumber 525 0 75 15 Arial 8 bold detail f_qtyreq 600 15 75 15 Arial 8 bold detail f_createwo 315 0 75 15 Arial 8 bold detail f_qtyper 600 0 75 15 Arial 8 bold detail f_effective 315 17 75 15 Arial 8 bold detail f_qtyfxd
    16 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SiteTypesMasterList.xml000066400000000000000000000101101217451700100226660ustar00rootroot00000000000000 Site Types Master List SiteTypesMasterList Letter 50 50 50 50 detail select sitetype_name, sitetype_descrip from sitetype order by sitetype_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail sitetype_name 175 0 565 15 Arial 8 bold detail sitetype_descrip
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SlowMovingInventoryByClassCode.xml000066400000000000000000000363201217451700100250360ustar00rootroot00000000000000 Slow Moving Inventory By Class Code SlowMovingInventoryByClassCode Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("classcode_id") ?> (SELECT (classcode_code || '-' || classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) <? else ?> text('All Class Codes') <? endif ?> AS classcode, <? if exists("showValue") ?> <? if exists("useActualCosts") ?> text('Show Inventory Value with Actual Costs') <? else ?> text('Show Inventory Value with Standard Costs') <? endif ?> AS showvalues, text('Unit Cost') AS f_unitcost, text('Value') AS f_value, <? else ?> text('') AS showvalues, text('') AS f_unitcost, text('') AS f_value, <? endif ?> formatDate(<? value("cutoffDate") ?>) AS f_cutoff; detail SELECT warehous_code, item_number, item_descrip1, item_descrip2, uom_name, formatQty(itemsite_qtyonhand) AS f_qoh, formatDate(itemsite_datelastused) AS f_datelastused, <? if exists("showValue") ?> formatCost(cost) <? else ?> text('') <? endif ?> AS f_unitcost, noNeg(cost * itemsite_qtyonhand) AS value, <? if exists("showValue") ?> formatExtPrice(noNeg(cost * itemsite_qtyonhand)) <? else ?> text('') <? endif ?> AS f_value FROM ( SELECT itemsite_id, warehous_code, item_number, item_descrip1, item_descrip2, uom_name, itemsite_qtyonhand, itemsite_datelastused, <? if exists("useActualCosts") ?> actcost(itemsite_item_id) <? else ?> stdcost(itemsite_item_id) <? endif ?> AS cost FROM itemsite, item, whsinfo, uom WHERE ((itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (itemsite_active) AND (itemsite_datelastused < <? value("cutoffDate") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE classcode_code ~ <? value("classcode_pattern") ?>) ) <? endif ?> ) ) AS data ORDER BY warehous_code, <? if exists("orderByInventoryValue") ?> value DESC <? elseif exists("orderByDateLastUsed") ?> itemsite_datelastused <? else ?> item_number <? endif ?> 236 575 200 80 15 Arial 8 normal head f_unitcost 130 140 200 20 Arial 10 bold head warehouse 5 229 745 229 2 440 140 300 20 Arial 10 bold head showvalues 660 200 80 15 Arial 8 normal head f_value 130 120 300 20 Arial 10 bold head classcode 540 120 195 20 Arial 10 bold head f_cutoff 6 41 5 35 745 34 2 660 5 80 15 Arial 8 normal head f_value 575 5 80 15 Arial 8 normal head f_unitcost
    detail detail 51 380 0 80 15 Arial 8 bold detail f_datelastused 105 0 150 15 Arial 8 bold detail item_number 660 0 80 15 Arial 8 bold detail f_value 105 15 300 15 Arial 8 bold detail item_descrip1 25 0 50 15 Arial 8 bold detail warehous_code 490 0 80 15 Arial 8 bold detail f_qoh 5 45 745 45 0 105 30 300 15 Arial 8 bold detail item_descrip2 265 0 80 15 Arial 8 bold detail uom_name 575 0 80 15 Arial 8 bold detail f_unitcost
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date 16
    qt-client-4.1.0/share/reports/StandardBOL.xml000066400000000000000000000374551217451700100210470ustar00rootroot00000000000000 Standard Bill of Lading StandardBOL Letter 50 50 0 0 head SELECT shiphead_shipvia, formatDate(shiphead_shipdate) AS shipdate, cust_name, cust_number, cohead_number, cohead_fob, cohead_custponumber, warehous_descrip, addr_line1 AS warehous_addr1, addr_line2 AS warehous_addr2, addr_line3 AS warehous_addr3, addr_city AS warehous_addr4, warehous_fob, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_shiptophone FROM shiphead, cohead, whsinfo, custinfo LEFT OUTER JOIN addr ON (warehous_addr_id=addr_id) WHERE ((shiphead_order_id=cohead_id) AND (cohead_cust_id=cust_id) AND (cohead_warehous_id=warehous_id) AND (shiphead_id=%1)); detail SELECT coitem_linenumber, formatQty(SUM(shipitem_qty)) AS invqty, uom_name, roundUp(SUM(shipitem_qty) / itemuomratiobytype(item_id, 'Selling'))::integer AS shipqty, itemsellinguom(item_id) AS shipuom, item_number, item_descrip1, item_descrip2, formatQty(SUM(shipitem_qty) * item_prodweight) AS netweight, formatQty(SUM(shipitem_qty) * (item_prodweight + item_packweight)) AS grossweight FROM shipitem, coitem, itemsite, item, uom WHERE ((shipitem_orderitem_id=coitem_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (shipitem_shiphead_id=%1)) GROUP BY coitem_linenumber, item_number, uom_name, shipuom, item_descrip1, item_descrip2, item_prodweight, item_packweight ORDER BY coitem_linenumber; foot SELECT formatQty(SUM(shipitem_qty * item_prodweight)) AS netweight, formatQty(SUM(shipitem_qty * (item_prodweight + item_packweight))) AS grossweight, CASE WHEN ('%3' = 'C') THEN 'X' ELSE ' ' END AS collectflag, CASE WHEN ('%3' = 'C') THEN 'Therm-O-Rock East, Inc.' ELSE ' ' END AS section7, CASE WHEN ('%3' = 'C') THEN 'Therm-O-Rock, East, Inc.' ELSE ' ' END AS collect_name, CASE WHEN ('%3' = 'C') THEN 'Pine Street' ELSE ' ' END AS collect_address1, CASE WHEN ('%3' = 'C') THEN '' ELSE ' ' END AS collect_address2, CASE WHEN ('%3' = 'C') THEN 'New Eagle PA 15067' ELSE ' ' END AS collect_address3 FROM shipitem, coitem, itemsite, item WHERE ((shipitem_orderitem_id=coitem_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (shipitem_shiphead_id=%1)); notes SELECT shiphead_notes FROM shiphead WHERE (shiphead_id=%1); 242 95 125 200 20 Arial 10 normal head warehous_addr2 600 5 100 20 Arial 10 normal head shipdate 530 165 300 20 Arial 10 normal head shiptocitystatezip 95 165 200 20 Arial 10 normal head warehous_addr4 530 145 200 20 Arial 10 normal head cohead_shiptoaddress3 530 125 200 20 Arial 10 normal head cohead_shiptoaddress2 95 145 200 20 Arial 10 normal head warehous_addr3 95 85 200 20 Arial 10 normal head warehous_descrip 530 85 200 20 Arial 10 normal head cohead_shiptoname 530 105 200 20 Arial 10 normal head cohead_shiptoaddress1 115 35 200 20 Arial 10 normal head shiphead_shipvia 95 105 200 20 Arial 10 normal head warehous_addr1 530 185 300 20 Arial 10 normal head cohead_shiptophone
    detail detail 57 200 40 300 14 Arial 8 normal detail item_descrip2 95 30 80 20 Arial 10 normal detail uom_name 10 30 80 20 Arial 10 normal detail invqty 200 5 300 20 Arial 10 normal detail item_number 520 5 100 20 Arial 10 normal detail netweight 10 5 80 20 Arial 10 normal detail shipqty 520 25 100 20 Arial 10 normal detail grossweight 94 5 80 20 Arial 10 normal detail shipuom 200 25 300 14 Arial 8 normal detail item_descrip1
    287 230 180 200 20 Arial 10 normal foot collect_address2 438 261 200 20 Arial 10 normal foot section7 520 5 100 20 Arial 10 normal foot netweight 614 60 200 20 Arial 10 normal head cohead_fob 20 180 200 20 Arial 10 normal foot collect_name 520 25 100 20 Arial 10 normal foot grossweight 230 200 200 20 Arial 10 normal foot collect_address3 728 261 46 20 Arial 10 normal foot collectflag 614 100 100 20 Arial 10 normal head cohead_number 614 120 100 20 Arial 10 normal head cohead_custponumber 614 80 200 20 Arial 10 normal head cust_number 20 200 200 20 Arial 10 normal foot collect_address1 50 10 400 100 Arial 10 normal notes shiphead_notes
    qt-client-4.1.0/share/reports/StandardJournalGroupMasterList.xml000066400000000000000000000102121217451700100250500ustar00rootroot00000000000000 Standard Journal Group Master List StandardJournalGroupMasterList Letter 50 50 50 50 detail SELECT stdjrnlgrp_id, stdjrnlgrp_name, stdjrnlgrp_descrip FROM stdjrnlgrp ORDER BY stdjrnlgrp_name; 77 5 70 745 70 2 7 22 5 15 745 15 2
    detail detail 17 220 0 500 15 Arial 8 bold detail stdjrnlgrp_descrip 10 0 200 15 Arial 8 bold detail stdjrnlgrp_name
    17 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/StandardJournalHistory.xml000066400000000000000000000261051217451700100234150ustar00rootroot00000000000000 Standard Journal History StandardJournalHistory Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("source") ?> text(<? value("source") ?>) <? else ?> text('All Sources') <? endif ?> AS source, <? if exists("startJrnlnum") ?> text('Start Journal Number:') <? else ?> text('') <? endif ?> AS startJrnlnumLit, <? if exists("endJrnlnum") ?> text('End Journal Number:') <? else ?> text('') <? endif ?> AS endJrnlnumLit; detail SELECT formatDate(gltrans_date) AS transdate, gltrans_journalnumber, gltrans_docnumber, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, CASE WHEN (gltrans_amount < 0) THEN formatMoney(gltrans_amount * -1) ELSE '' END AS f_debit, CASE WHEN (gltrans_amount > 0) THEN formatMoney(gltrans_amount) ELSE '' END AS f_credit, formatBoolYN(gltrans_posted) AS f_posted FROM gltrans, accnt WHERE ( (gltrans_accnt_id=accnt_id) AND (NOT gltrans_deleted) AND (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) AND (gltrans_doctype='ST') ) ORDER BY gltrans_date, gltrans_sequence, gltrans_docnumber, gltrans_amount; 162 200 65 200 20 Arial 10 bold head startdate 200 85 200 20 Arial 10 bold head enddate 5 155 745 155 2 6 21 5 15 745 15 2
    detail JournalSeries gltrans_journalnumber 16 680 0 60 15 Arial 8 bold detail f_posted 10 0 80 15 Arial 8 bold detail transdate 100 0 85 15 Arial 8 bold detail gltrans_journalnumber JournalName gltrans_docnumber 16 190 0 130 15 Arial 8 bold detail gltrans_docnumber detail 17 595 0 80 15 Arial 8 bold detail f_credit 330 0 175 15 Arial 8 bold detail account 509 0 80 15 Arial 8 bold detail f_debit
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/StandardJournalMasterList.xml000066400000000000000000000101441217451700100240370ustar00rootroot00000000000000 Standard Journal Master List StandardJournalMasterList Letter 50 50 50 50 detail SELECT stdjrnl_id, stdjrnl_name, stdjrnl_descrip FROM stdjrnl ORDER BY stdjrnl_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 220 0 500 15 Arial 8 bold detail stdjrnl_descrip 10 0 200 15 Arial 8 bold detail stdjrnl_name
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/Statement.xml000066400000000000000000000414021217451700100207010ustar00rootroot00000000000000 Statement Statement "As of" date included 0.05 0.05 Letter 100 100 100 100 detail SELECT CASE WHEN (araging_doctype = 'I') THEN <? value("invoice") ?> WHEN (araging_doctype = 'D') THEN <? value("debit") ?> WHEN (araging_doctype = 'C') THEN <? value("credit") ?> WHEN (araging_doctype = 'R') THEN <? value("deposit") ?> ELSE 'Misc.' END AS doctype, araging_docnumber AS f_docnumber, formatDate(CAST(araging_docdate AS DATE)) AS f_docdate, CASE WHEN (araging_doctype IN ('I','C','D')) THEN formatDate(araging_duedate) ELSE '' END AS f_duedate, formatMoney(araging_aropen_amount) AS f_amount, formatMoney(araging_aropen_amount - araging_total_val) AS f_applied, formatMoney(araging_total_val) AS f_balance FROM araging(<? value("asofdate") ?>, true, false) WHERE ((araging_cust_id = <? value("cust_id") ?>) AND (abs(araging_aropen_amount) > 0) ) ORDER BY araging_duedate; head SELECT cust_name, addr_line1 AS cust_address1, addr_line2 AS cust_address2, addr_line3 AS cust_address3, (addr_city || ' ' || addr_state || ' ' || addr_postalcode) AS citystatezip, formatDate(COALESCE(<? value("asofdate") ?>, current_date)) AS asofdate FROM custinfo LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) WHERE (cust_id = <? value("cust_id") ?>); Currency SELECT currconcat(cust_curr_id) AS currAbbr FROM custinfo WHERE (cust_id=<? value("cust_id") ?>) foot SELECT formatMoney(SUM(araging_cur_val)) AS f_current, formatMoney(SUM(araging_thirty_val)) AS f_thirty, formatMoney(SUM(araging_sixty_val)) AS f_sixty, formatMoney(SUM(araging_ninety_val)) AS f_ninety, formatMoney(SUM(araging_plus_val)) AS f_plus, formatMoney(SUM(araging_total_val)) AS f_total FROM araging(<? value("asofdate") ?>, true, false) WHERE ((abs(araging_aropen_amount) > 0) AND (araging_cust_id = <? value("cust_id") ?>)); 277 475 245 475 270 0 25 190 300 20 Arial 10 bold head citystatezip 10 245 10 270 0 445 40 445 75 0 395 245 395 270 0 445 75 585 75 0 310 245 310 270 0 123.972 244.219 123.972 269.461 0 25 150 300 15 Arial 10 bold head cust_address1 25 165 300 15 Arial 10 bold head cust_address2 10 244.541 640 244.541 0 25 135 300 15 Arial 10 bold head cust_name 210 245.459 210 270.459 0 475 60 90 15 Arial 12 normal Context Query report_date 640 245 640 270 0 25 180 300 15 Arial 10 bold head cust_address3 545 245 545 270 0 585 40 585 75 0 445 40 585 40 0 10 270 640 270 0 445 55 585 55 0 105 50 100 15 Arial 10 normal head asofdate
    detail unnamed detail 16 20 0 100 15 Arial 12 normal detail doctype 395 0 80 15 Arial 11 normal detail f_amount 130 0 75 15 Arial 11 normal detail f_docnumber 480 0 75 15 Arial 11 normal detail f_applied 315 0 75 15 Arial 11 normal detail f_duedate 215 0 90 15 Arial 11 normal detail f_docdate 560 0 80 15 Arial 11 normal detail f_balance
    111 190 5 190 35 0 10 5 10 35 0 100 5 100 35 0 365 5 365 35 0 190 15 85 20 Arial 11 normal foot f_sixty 365 15 85 20 Arial 11 normal foot f_plus 100 15 85 20 Arial 11 normal foot f_thirty 10 35 640 35 0 10 15 85 20 Arial 11 normal foot f_current 640 5 640 35 0 280 5 280 35 0 280 15 80 20 Arial 11 normal foot f_ninety 455 5 455 35 0 100 45 67 15 Arial 11 normal Currency currAbbr 10 5 640 5 0 544 15 85 20 Arial 11 normal foot f_total
    qt-client-4.1.0/share/reports/SubAccountTypeMasterList.xml000066400000000000000000000124601217451700100236570ustar00rootroot00000000000000 Subaccount Type Master List SubAccountTypeMasterList Letter 50 50 50 50 detail SELECT subaccnttype_code, subaccnttype_descrip, CASE WHEN(subaccnttype_accnt_type='A') THEN text('Asset') WHEN(subaccnttype_accnt_type='L') THEN text('Liability') WHEN(subaccnttype_accnt_type='E') THEN text('Expense') WHEN(subaccnttype_accnt_type='R') THEN text('Revenue') WHEN(subaccnttype_accnt_type='Q') THEN text('Equity') ELSE text('ERROR') END AS f_type FROM subaccnttype ORDER BY subaccnttype_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 240 0 500 15 Arial 8 bold detail subaccnttype_descrip 120 0 100 15 Arial 8 bold detail f_type 10 0 100 15 Arial 8 bold detail subaccnttype_code
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SubstituteAvailabilityByRootItem.xml000066400000000000000000000352001217451700100254200ustar00rootroot00000000000000 Substitue Availability By Root Item SubstituteAvailabilityByRootItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT warehous_code, item_number, item_descrip1, item_descrip2, formatQty(sub.itemsite_qtyonhand) AS f_qtyonhand, formatQty(CASE WHEN(sub.itemsite_useparams) THEN sub.itemsite_reorderlevel ELSE 0.0 END) AS f_reorderlevel, sub.itemsite_leadtime as leadtime, <? if exists("byDays") ?> formatQty(qtyAllocated(sub.itemsite_id, <? value("byDays") ?>)) AS f_allocated, formatQty(qtyOrdered(sub.itemsite_id, <? value("byDays") ?>)) AS f_ordered, formatQty(sub.itemsite_qtyonhand + qtyOrdered(sub.itemsite_id, <? value("byDays") ?>) - qtyAllocated(sub.itemsite_id, <? value("byDays") ?>)) as f_avail <? elseif exists("byDate") ?> formatQty(qtyAllocated(sub.itemsite_id, (<? value("byDate") ?> - CURRENT_DATE))) AS f_allocated, formatQty(qtyOrdered(sub.itemsite_id, (<? value("byDate") ?> - CURRENT_DATE))) AS f_ordered, formatQty(sub.itemsite_qtyonhand + qtyOrdered(sub.itemsite_id, (<? value("byDate") ?> - CURRENT_DATE)) - qtyAllocated(sub.itemsite_id, (<? value("byDate") ?> - CURRENT_DATE))) as f_avail <? else ?> formatQty(qtyAllocated(sub.itemsite_id, sub.itemsite_leadtime)) AS f_allocated, formatQty(qtyOrdered(sub.itemsite_id, sub.itemsite_leadtime)) AS f_ordered, formatQty(sub.itemsite_qtyonhand + qtyOrdered(sub.itemsite_id, sub.itemsite_leadtime) - qtyAllocated(sub.itemsite_id, sub.itemsite_leadtime)) as f_avail <? endif ?> FROM item, itemsite AS sub, itemsite AS root, whsinfo, itemsub WHERE ((sub.itemsite_item_id=item_id) AND (root.itemsite_item_id=itemsub_parent_item_id) AND (sub.itemsite_item_id=itemsub_sub_item_id) AND (root.itemsite_warehous_id=sub.itemsite_warehous_id) AND (sub.itemsite_warehous_id=warehous_id) AND (root.itemsite_item_id=<? value("item_id") ?>) <? if exists("warehous_id") ?> AND (root.itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY itemsub_rank; 221 140 140 200 20 Arial 10 bold head warehouse 140 100 385 20 Arial 10 bold head item_descrip1 140 120 385 20 Arial 10 bold head item_descrip2 5 215 745 215 2 140 80 385 20 Arial 10 bold head item_number 6 41 5 35 745 35 2
    detail detail 56 65 30 250 15 Arial 8 bold detail item_descrip2 65 15 250 15 Arial 8 bold detail item_descrip1 10 0 35 15 Arial 8 bold detail warehous_code 330 0 100 15 Arial 8 bold detail f_qtyonhand 10 15 35 15 Arial 8 bold detail leadtime 645 0 100 15 Arial 8 bold detail f_avail 540 0 100 15 Arial 8 bold detail f_ordered 540 15 100 15 Arial 8 bold detail f_reorderlevel 434 0 100 15 Arial 8 bold detail f_allocated 65 0 250 15 Arial 8 bold detail item_number 5 50 745 50 0
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SummarizedBOM.xml000066400000000000000000000247421217451700100214230ustar00rootroot00000000000000 Summarized Bill of Materials SummarizedBOM Letter 50 50 50 50 head SELECT item_number, uom_name AS item_invuom, item_descrip1, item_descrip2 FROM item, uom WHERE ((item_id=<? value("item_id") ?>) AND (item_inv_uom_id=uom_id)); detail select bomdata_item_number AS item_number, bomdata_uom_name AS item_invuom, bomdata_item_descrip1 AS item_descrip1, bomdata_item_descrip2 AS item_descrip2, formatQtyPer(bomdata_qtyreq) AS qtyreq FROM summarizedBOM(<? value("item_id") ?>,<? value("revision_id") ?>,<? value("expiredDays") ?>,<? value("futureDays") ?>) bomhead SELECT bomhead_docnum, bomhead_revision, formatDate(bomhead_revisiondate) AS f_revisiondate FROM bomhead WHERE ((bomhead_item_id=<? value("item_id") ?>) AND (bomhead_rev_id=<? value("revision_id") ?>)); 242 315 103 150 20 Arial 10 bold head item_invuom 585 103 150 20 Arial 10 bold bomhead bomhead_docnum 100 145 300 20 Arial 10 bold head item_descrip2 5 235 745 235 2 100 103 150 20 Arial 10 bold head item_number 100 125 300 20 Arial 10 bold head item_descrip1 585 145 150 20 Arial 10 bold bomhead bomhead_revision 585 125 150 20 Arial 10 bold bomhead f_revisiondate 6 36 5 30 745 30 2
    detail detail 52 112 15 300 15 Arial 8 bold detail item_descrip1 5 45 745 45 0 112 0 150 15 Arial 8 bold detail item_number 112 30 300 15 Arial 8 bold detail item_descrip2 275 0 50 15 Arial 8 bold detail item_invuom 425 0 75 15 Arial 8 bold detail qtyreq
    17 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/SummarizedBacklogByWarehouse.xml000066400000000000000000000556071217451700100245320ustar00rootroot00000000000000 Summarized Backlog By Site SummarizedBacklogByWarehouse Letter 50 50 50 50 head SELECT <? if exists("custtype_id") ?> ( SELECT (custtype_code||'-'||custtype_descrip) FROM custtype WHERE (custtype_id=<? value("custtype_id") ?>) ) <? elseif exists("custtype_pattern") ?> text(<? value("custtype_pattern") ?>) <? else ?> text('All Customer Types') <? endif ?> AS custtype, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("showPrices") ?> text('Sales') AS lbl_sales, text('Cost') AS lbl_cost, text('Margin') AS lbl_margin, text('Totals:') AS lbl_totals, <? else ?> text('') AS lbl_sales, text('') AS lbl_cost, text('') AS lbl_margin, text('') AS lbl_totals, <? endif ?> formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate; detail SELECT CASE WHEN (cohead_holdtype='P') THEN -1 ELSE cohead_id END AS _coheadid, cohead_id, cohead_holdtype, cohead_number, cust_name, CASE WHEN (cohead_holdtype='N') THEN <? value("none") ?> WHEN (cohead_holdtype='C') THEN <? value("credit") ?> WHEN (cohead_holdtype='S') THEN <? value("ship") ?> WHEN (cohead_holdtype='P') THEN <? value("pack") ?> WHEN (cohead_holdtype='R') THEN <? value("return") ?> ELSE <? value("Other") ?> END AS f_holdtype, formatDate(cohead_orderdate) AS f_orderdate, formatDate(MIN(coitem_scheddate)) AS f_scheddate, formatDate(cohead_packdate) AS f_packdate, <? if exists("showPrices") ?> formatMoney( SUM( round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio),2) ) ) <? else ?> text('') <? endif ?> AS f_sales, <? if exists("showPrices") ?> formatCost(SUM((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * stdcost(item_id) ) ) <? else ?> text('') <? endif ?> AS f_cost, <? if exists("showPrices") ?> formatMoney( SUM( (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * ((coitem_price / coitem_price_invuomratio) - stdcost(item_id)) ) ) <? else ?> text('') <? endif ?> AS f_margin, SUM( round( (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio),2) ) AS sales, SUM((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * stdcost(item_id) ) AS cost, SUM((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * ((coitem_price / coitem_price_invuomratio) - stdcost(item_id)) ) AS margin, MIN(coitem_scheddate) AS scheddate, formatShipmentNumber(shiphead_id) AS shiphead_number, CASE WHEN (shiphead_shipped IS NULL) THEN text('') WHEN (shiphead_shipped) THEN text('Yes') WHEN (NOT shiphead_shipped) THEN text('No') END AS shipstatus, COALESCE(shiphead_shipvia, '') AS shipvia, CASE WHEN (shiphead_shipdate IS NULL) THEN text('') ELSE formatDate(shiphead_shipdate) END AS shipdate FROM coitem, itemsite, item, custinfo, cohead LEFT OUTER JOIN shiphead ON (shiphead_order_id=cohead_id AND shiphead_order_type='SO') WHERE ( (coitem_cohead_id=cohead_id) AND (cohead_cust_id=cust_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (coitem_status NOT IN ('C','X')) AND (coitem_scheddate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) GROUP BY cohead_id, cohead_number, cust_name, cohead_holdtype, cohead_orderdate, cohead_packdate, shiphead_shipped, shiphead_shipvia, shiphead_shipdate, shiphead_id ORDER BY <? if exists("orderByShipDate") ?> scheddate, <? elseif exists("orderByPackDate") ?> cohead_packdate, <? endif ?> cohead_number, shiphead_shipped; totals SELECT <? if exists("showPrices") ?> formatMoney( SUM( sales ) ) AS f_sales, formatCost( SUM( cost ) ) AS f_cost, formatMoney( SUM( margin ) ) AS f_margin FROM ( SELECT SUM( round((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio),2) ) AS sales, SUM((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * stdcost(item_id) ) AS cost, SUM((noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * ((coitem_price / coitem_price_invuomratio) - stdcost(item_id)) ) AS margin FROM coitem, itemsite, item, custinfo, cohead WHERE ( (coitem_cohead_id=cohead_id) AND (cohead_cust_id=cust_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (coitem_status NOT IN ('C','X')) AND (coitem_scheddate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) GROUP BY cohead_id, cohead_number, cust_name, cohead_holdtype, cohead_orderdate, cohead_packdate ) AS data <? else ?> text('') AS f_sales, text('') AS f_cost, text('') AS f_margin <? endif ?> 206 5 200 745 200 2 670 170 80 15 Arial 8 normal head lbl_margin 140 104 200 20 Arial 10 bold head warehouse 140 85 200 20 Arial 10 bold head custtype 515 85 200 20 Arial 10 bold head startdate 510 170 80 15 Arial 8 normal head lbl_sales 515 104 200 20 Arial 10 bold head enddate 590 170 80 15 Arial 8 normal head lbl_cost 6 28 5 20 745 20 2 585 5 80 15 Arial 8 normal head lbl_cost 665 5 80 15 Arial 8 normal head lbl_margin 505 5 80 15 Arial 8 normal head lbl_sales
    detail unnamed cohead_id 18 70 0 145 15 Arial 8 bold detail cust_name 370 0 70 15 Arial 8 bold detail f_scheddate 510 0 80 15 Arial 8 bold detail f_sales 290 0 70 15 Arial 8 bold detail f_orderdate 670 0 80 15 Arial 8 bold detail f_margin 5 0 70 15 Arial 8 bold detail cohead_number 220 0 60 15 Arial 8 bold detail f_holdtype 590 0 80 15 Arial 8 bold detail f_cost 440 0 70 15 Arial 8 bold detail f_packdate detail 18 220 0 60 15 Arial 8 bold detail shiphead_number 5 0 60 15 Arial 8 bold detail shipstatus 70 0 145 15 Arial 8 bold detail shipvia 290 0 70 15 Arial 8 bold detail shipdate
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 18 590 0 80 15 Arial 8 bold totals f_cost 407 0 80 15 Arial 8 normal head lbl_totals 510 0 80 15 Arial 8 bold totals f_sales 670 0 80 15 Arial 8 bold totals f_margin
    qt-client-4.1.0/share/reports/SummarizedBankrecHistory.xml000066400000000000000000000230531217451700100237270ustar00rootroot00000000000000 Summarized Bank Reconciliation History SummarizedBankrecHistory 0.05 0.05 Letter 50 50 50 50 detail SELECT bankrec_id, formatBoolYN(bankrec_posted) AS f_posted, formatDate(bankrec_created) AS f_created, formatDate(bankrec_postdate) AS f_postdate, bankrec_username AS f_username, formatDate(bankrec_opendate) AS f_opendate, formatDate(bankrec_enddate) AS f_enddate, formatMoney(bankrec_openbal) AS f_openbal, formatMoney(bankrec_endbal) AS f_endbal FROM bankrec WHERE (bankrec_bankaccnt_id=<? value("bankaccntid") ?>) ORDER BY bankrec_created; head SELECT (bankaccnt_name || '-' || bankaccnt_descrip) AS f_bankaccnt FROM bankaccnt WHERE (bankaccnt_id=<? value("bankaccntid") ?>); 121 5 115 745 115 2 145 60 220 15 Arial 8 bold head f_bankaccnt 6 21 5 15 745 15 2
    detail detail 16 10 0 80 15 Arial 8 bold detail f_posted 96 0 80 15 Arial 8 bold detail f_postdate 370 0 90 15 Arial 8 bold detail f_opendate 655 0 90 15 Arial 8 bold detail f_endbal 560 0 90 15 Arial 8 bold detail f_openbal 180 0 185 15 Arial 8 bold detail f_username 465 0 90 15 Arial 8 bold detail f_enddate
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SummarizedGLTransactions.xml000066400000000000000000000375441217451700100237050ustar00rootroot00000000000000 Summarized G/L Transactions SummarizedGLTransactions Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("source") ?> text(<? value("source") ?>) <? else ?> text('All Sources') <? endif ?> AS source, <? if exists("showUsernames") ?> text('Username') <? else ?> text('') <? endif ?> AS f_username; detail SELECT data.accnt_id AS accnt_id, -- account information formatGLAccount(data.accnt_id) AS account, accnt_descrip, f_debit, f_credit, -- transactionn details formatDate(gltrans_date) AS transdate, gltrans_source, gltrans_doctype, gltrans_docnumber, gltrans_notes, f_debitdetail, f_creditdetail, <? if exists("showUsernames") ?> gltrans_username <? else ?> text('') <? endif ?> AS f_username FROM ( SELECT accnt_id, accnt_number, accnt_profit, accnt_sub, accnt_descrip, formatMoney( SUM( CASE WHEN (gltrans_amount < 0) THEN (gltrans_amount * -1) ELSE 0 END ) ) AS f_debit, formatMoney( SUM( CASE WHEN (gltrans_amount > 0) THEN gltrans_amount ELSE 0 END ) ) AS f_credit FROM gltrans, accnt WHERE ( (gltrans_accnt_id=accnt_id) AND (NOT gltrans_deleted) AND (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("source") ?> AND (gltrans_source=<? value("source") ?>) <? endif ?> <? if exists("unpostedTransactions") ?> AND (NOT gltrans_posted) <? elseif exists("postedTransactions") ?> AND (gltrans_posted) <? endif ?> ) GROUP BY accnt_id, accnt_number, accnt_profit, accnt_sub, accnt_descrip ) AS data LEFT OUTER JOIN ( SELECT accnt_id, gltrans_date, gltrans_created, gltrans_source, gltrans_doctype, gltrans_docnumber, gltrans_notes, gltrans_username, CASE WHEN (gltrans_amount < 0) THEN formatMoney(gltrans_amount * -1) ELSE '' END AS f_debitdetail, CASE WHEN (gltrans_amount > 0) THEN formatMoney(gltrans_amount) ELSE '' END AS f_creditdetail FROM gltrans, accnt WHERE ((gltrans_accnt_id=accnt_id) AND (NOT gltrans_deleted) AND (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("source") ?> AND (gltrans_source=<? value("source") ?>) <? endif ?> <? if exists("unpostedTransactions") ?> AND (NOT gltrans_posted) <? elseif exists("postedTransactions") ?> AND (gltrans_posted) <? endif ?> ) ) AS data2 ON (data.accnt_id=data2.accnt_id) ORDER BY accnt_number, accnt_profit, accnt_sub, gltrans_date DESC, gltrans_created; 201 5 200 745 200 2 545 90 200 20 Arial 10 bold head enddate 140 70 290 20 Arial 10 bold head source 665 185 80 15 Arial 8 normal head f_username 545 70 200 20 Arial 10 bold head startdate 17 28 5 20 745 20 2 665 5 80 15 Arial 8 normal head f_username
    detail detail accnt_id 23 10 0 100 15 Arial 8 bold detail account 595 0 80 15 Arial 8 bold detail f_credit 120 0 305 15 Arial 8 bold detail accnt_descrip 509 0 80 15 Arial 8 bold detail f_debit 14 112 5 744 5 0 detail 24 10 0 100 15 Arial 8 bold detail transdate 375 0 50 15 Arial 8 bold detail gltrans_doctype 595 0 80 15 Arial 8 bold detail f_creditdetail 330 0 36 15 Arial 8 bold detail gltrans_source 434 0 80 15 Arial 8 bold detail gltrans_docnumber 120 0 200 15 5 Arial 8 bold detail gltrans_notes 665 0 80 15 Arial 8 bold detail f_username 509 0 80 15 Arial 8 bold detail f_debitdetail
    26 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/SummarizedSalesHistory.xml000066400000000000000000000231711217451700100234320ustar00rootroot00000000000000 Summarized Sales History SummarizedSalesHistory 0.05 0.05 Letter 50 50 50 50 detail summarizedSalesHistory detail 163 3 159 743 159 2 15 40 725 15 11 Arial 10 bold Parameter Query filter 6 21 5 15 745 15 2
    detail detail 16 605 0 80 15 Arial 8 bold detail totalsales extprice 540 0 60 15 Arial 8 bold detail qtyshipped 405 0 60 15 Arial 8 bold detail firstdate 475 0 60 15 Arial 8 bold detail lastdate 10 0 80 15 11 Arial 8 bold detail groupsLit 100 0 90 15 11 Arial 8 bold detail groups 200 0 190 15 11 Arial 8 bold detail groupsDescrip 695 0 50 15 Arial 8 bold detail currAbbr
    17 105 1 100 15 Arial 8 bold Context Query report_date 705 1 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TaxAuthoritiesMasterList.xml000066400000000000000000000107131217451700100237230ustar00rootroot00000000000000 Tax Authorities Master List TaxAuthoritiesMasterList 0.05 0.05 Letter 50 50 50 50 detail taxAuthorities detail 128 5 120 745 120 2 10 38 725 15 12 Arial 10 bold Parameter Query filter 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail taxauth_code 175 0 565 15 Arial 8 bold detail taxauth_name
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TaxHistoryDetail.xml000066400000000000000000000645561217451700100222150ustar00rootroot00000000000000 Tax History Detail TaxHistoryDetail Letter 50 50 50 50 head SELECT <? if exists("showSales") ?> 'Yes' <? else ?> 'No' <? endif ?> AS showSales, <? if exists("showPurchases") ?> 'Yes' <? else ?> 'No' <? endif ?> AS showPurchases, <? if exists("groupProper") ?> <? value("groupProper") ?> || '=' || <? value("selection") ?> <? else ?> 'All' <? endif ?> AS selection, <? if exists("distDate") ?> text('Distribution Date') <? else ?> text('Document Date') <? endif ?> AS basis, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate, 'Tax ' || (SELECT curr_symbol FROM curr_symbol WHERE curr_base) AS taxbaseLit; detail <? if exists("showSales") ?> ------------BEGIN SALES-------------- -- All sales tax history including memos SELECT formatDate(taxhist_distdate) AS f_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, COALESCE(taxzone_code,<? value("none") ?>) AS taxzone, taxzone_descrip, curr_abbr, CASE WHEN (cohist_doctype != 'C') THEN cohist_invcnumber ELSE cohist_ordernumber END AS docnumber, <? value("sales") ?> AS source, CASE WHEN (cohist_doctype='I') THEN <? value("invoice") ?> WHEN (cohist_doctype='C') THEN <? value("creditmemo") ?> WHEN (cohist_doctype='D') THEN <? value("debitmemo") ?> ELSE <? value("other") ?> END AS doctype, item_number, COALESCE(item_descrip1,cohist_misc_descrip) AS description, CASE WHEN (cohist_doctype != 'C') THEN cohist_ordernumber END AS ordernumber, cohist_invcdate AS docdate, cohist_billtoname AS name, formatQty(cohist_qtyshipped) AS f_qty, formatSalesPrice(cohist_unitprice) AS f_unitprice, formatMoney(cohist_qtyshipped * cohist_unitprice) AS f_amount, formatMoney(taxhist_tax) AS f_taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, formatMoney(taxhist_tax / taxhist_curr_rate) AS f_taxbase FROM cohisttax JOIN cohist ON (cohist_id=taxhist_parent_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) LEFT OUTER JOIN taxzone ON (cohist_taxzone_id=taxzone_id) LEFT OUTER JOIN itemsite ON (cohist_itemsite_id=itemsite_id) LEFT OUTER JOIN item ON (itemsite_item_id=item_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (taxzone_id=<? value("taxzone_id") ?>) <? endif ?> ) <? endif ?> --------------END SALES-------------------- <? if exists("showPurchases") ?> <? if exists("showSales") ?> -- Union because sales and purchase shown together UNION ALL <? endif ?> <? endif ?> ------------BEGIN PURCHASE---------------- <? if exists("showPurchases") ?> -- A/P Memo history SELECT formatDate(taxhist_distdate) AS f_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, <? value("none") ?> AS taxzone,'' AS taxzone_descrip, curr_abbr, apopen_docnumber AS docnumber, <? value("purchase") ?> AS source, CASE WHEN (apopen_doctype='C') THEN <? value("creditmemo") ?> WHEN (apopen_doctype='D') THEN <? value("debitmemo") ?> ELSE <? value("other") ?> END AS doctype, '' AS item_number, apopen_notes AS description, apopen_ponumber AS ordernumber, apopen_docdate AS docdate, vend_name AS name, formatQty(1) AS f_qty, formatPurchPrice(apopen_amount) AS unitprice, formatMoney(apopen_amount) AS f_amount, formatMoney(taxhist_tax) AS f_taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, formatMoney(taxhist_tax / taxhist_curr_rate) AS f_taxbase FROM apopentax JOIN apopen ON (apopen_id=taxhist_parent_id) JOIN vendinfo ON (apopen_vend_id=vend_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (false) <? endif ?> AND (taxhist_distdate IS NOT NULL) ) UNION ALL --Voucher Header History SELECT formatDate(taxhist_distdate) AS f_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, COALESCE(taxzone_code,<? value("none") ?>) AS taxzone, taxzone_descrip, curr_abbr, vohead_number AS docnumber, <? value("purchase") ?> AS source, <? value("voucher") ?> AS doctype, '', vohead_notes AS description, pohead_number AS ordernumber, vohead_docdate AS docdate, vend_name AS name, formatQty(1) AS f_qty, formatPurchPrice(0) AS f_unitprice, formatMoney(0) AS f_amount, formatMoney(taxhist_tax) AS f_taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, formatMoney(taxhist_tax / taxhist_curr_rate) AS f_taxbase FROM voheadtax JOIN vohead ON (vohead_id=taxhist_parent_id) LEFT OUTER JOIN pohead ON (vohead_pohead_id=pohead_id) JOIN vendinfo ON (vohead_vend_id=vend_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) LEFT OUTER JOIN taxzone ON (vohead_taxzone_id=taxzone_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (taxzone_id=<? value("taxzone_id") ?>) <? endif ?> AND (taxhist_distdate IS NOT NULL) ) UNION ALL --Voucher Line Item SELECT formatDate(taxhist_distdate) AS f_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, COALESCE(taxzone_code,<? value("none") ?>) AS taxzone, taxzone_descrip, curr_abbr, vohead_number AS docnumber, <? value("purchase") ?> AS source, <? value("voucher") ?> AS doctype, COALESCE(item_number,expcat_code), COALESCE(item_descrip1,expcat_descrip) AS description, pohead_number AS ordernumber, vohead_docdate AS docdate, vend_name AS name, formatQty(voitem_qty) AS f_qty, formatPurchPrice(COALESCE(SUM(vodist_amount),0)/voitem_qty) AS unitprice, formatMoney(COALESCE(SUM(vodist_amount),0)) AS f_amount, formatMoney(taxhist_tax) AS taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, formatMoney(taxhist_tax / taxhist_curr_rate) AS f_taxbase FROM voitemtax JOIN voitem ON (voitem_id=taxhist_parent_id) JOIN vohead ON (vohead_id=voitem_vohead_id) JOIN pohead ON (vohead_pohead_id=pohead_id) JOIN poitem ON (voitem_poitem_id=poitem_id) JOIN vodist ON ((vodist_poitem_id=poitem_id) AND (vodist_vohead_id=vohead_id)) JOIN vendinfo ON (vohead_vend_id=vend_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) LEFT OUTER JOIN taxzone ON (vohead_taxzone_id=taxzone_id) LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id) LEFT OUTER JOIN item ON (itemsite_item_id=item_id) LEFT OUTER JOIN expcat ON (expcat_id=poitem_expcat_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (taxzone_id=<? value("taxzone_id") ?>) <? endif ?> AND (taxhist_distdate IS NOT NULL) ) GROUP BY taxhist_id,taxhist_distdate,tax_code,tax_descrip, taxtype_name,taxtype_descrip,taxclass_code,taxclass_descrip, taxauth_code,taxauth_descrip,taxzone,taxzone_descrip,curr_abbr, vohead_number,pohead_number,item_number,item_descrip1, vohead_curr_id,vohead_distdate,vohead_docdate,vend_name, expcat_code,expcat_descrip,taxhist_tax,taxhist_curr_rate, voitem_qty <? endif ?> -------------END PURCHASE-------------- ORDER BY docdate DESC, docnumber DESC 221 5 215 745 215 2 460.577 137.571 200 20 Arial 10 bold head enddate 460.577 116.571 200 20 Arial 10 bold head startdate 461 96 200 20 Arial 10 bold head basis 141 137 230 20 Arial 10 bold head selection 141 117 230 20 Arial 10 bold head showPurchases 141 96 230 20 Arial 10 bold head showSales 650 182 100 15 Arial 8 normal head taxbaseLit 6 52 6 45 746 45 2 650 12 100 15 Arial 8 normal head taxbaseLit
    detail detail 37 200 0 100 15 Arial 8 bold detail tax 100 0 100 15 Arial 8 bold detail source 575 0 75 15 Arial 8 bold detail curr_abbr 500 0 75 15 Arial 8 bold detail f_taxlocal 5 0 95 15 Arial 8 bold detail docnumber 300 16.6 200 15 Arial 8 bold detail description 300 0 200 15 Arial 8 bold detail item_number 650 0 100 15 Arial 8 bold detail f_taxbase 200 16.6 100 15 Arial 8 bold detail docdate 100 16.6 100 15 Arial 8 bold detail doctype 6 33 746 33 1
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 23 648 4 100 15 Arial 8 bold detail taxbase money
    qt-client-4.1.0/share/reports/TaxHistorySummary.xml000066400000000000000000000665221217451700100224430ustar00rootroot00000000000000 Tax History Summary TaxHistorySummary Letter 50 50 50 50 head SELECT <? if exists("showSales") ?> 'Yes' <? else ?> 'No' <? endif ?> AS showSales, <? if exists("showPurchases") ?> 'Yes' <? else ?> 'No' <? endif ?> AS showPurchases, <? value("groupProper") ?> AS group, <? value("groupProper") ?> || ':' AS selectionLit, <? value("selection") ?> AS selection, <? if exists("distDate") ?> text('Distribution Date') <? else ?> text('Document Date') <? endif ?> AS basis, formatDate(<? value("startDate") ?>) AS startdate, formatDate(<? value("endDate") ?>) AS enddate; detail -----------BEGIN SUMMARY---------- SELECT <? literal("groupBy") ?> AS group, <? literal("groupBy") ?>_descrip AS description, formatMoney(SUM(salesbase)) AS f_salesbase, formatMoney(SUM(freightbase)) AS f_freightbase, CASE WHEN (SUM(freighttax) > 0) THEN true ELSE false END AS freighttax, SUM(salestaxbase) AS salestaxbase, formatMoney(SUM(salestaxbase)) AS f_salestaxbase, formatMoney(SUM(purchasebase)) AS f_purchasebase, SUM(purchasetaxbase) * -1 AS purchasetaxbase, formatMoney(SUM(purchasetaxbase) * -1) AS f_purchasetaxbase, SUM(salestaxbase) + SUM(purchasetaxbase) AS nettaxbase, formatMoney(SUM(salestaxbase) + SUM(purchasetaxbase)) AS f_nettaxbase FROM ( ------------END SUMMARY-------------- <? if exists("showSales") ?> ------------BEGIN SALES-------------- -- All sales tax history including memos SELECT taxhist_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, COALESCE(taxzone_code,<? value("none") ?>) AS taxzone, taxzone_descrip, curr_abbr, CASE WHEN (cohist_doctype != 'C') THEN cohist_invcnumber ELSE cohist_ordernumber END AS docnumber, <? value("sales") ?> AS source, CASE WHEN (cohist_doctype='I') THEN <? value("invoice") ?> WHEN (cohist_doctype='C') THEN <? value("creditmemo") ?> WHEN (cohist_doctype='D') THEN <? value("debitmemo") ?> ELSE <? value("other") ?> END AS doctype, item_number, COALESCE(item_descrip1,cohist_misc_descrip) AS description, CASE WHEN (cohist_doctype != 'C') THEN cohist_ordernumber END AS ordernumber, cohist_invcdate AS docdate, cohist_billtoname AS name, cohist_qtyshipped AS qty, cohist_unitprice AS unitprice, (cohist_qtyshipped * cohist_unitprice) AS amount, CASE WHEN (cohist_misc_type IS NULL OR cohist_misc_type IN ('M','F')) THEN currToBase(cohist_curr_id, cohist_qtyshipped * cohist_unitprice, cohist_invcdate) ELSE 0 END AS salesbase, CASE WHEN (cohist_misc_type = 'F') THEN currToBase(cohist_curr_id, cohist_qtyshipped * cohist_unitprice, cohist_invcdate) ELSE 0 END AS freightbase, CASE WHEN (cohist_misc_type = 'F') THEN taxhist_tax / taxhist_curr_rate ELSE 0 END AS freighttax, 0 AS purchasebase, taxhist_tax AS taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, taxhist_tax / taxhist_curr_rate AS salestaxbase, 0 AS purchasetaxbase FROM cohisttax JOIN cohist ON (cohist_id=taxhist_parent_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) LEFT OUTER JOIN taxzone ON (cohist_taxzone_id=taxzone_id) LEFT OUTER JOIN itemsite ON (cohist_itemsite_id=itemsite_id) LEFT OUTER JOIN item ON (itemsite_item_id=item_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (taxzone_id=<? value("taxzone_id") ?>) <? endif ?> ) <? endif ?> --------------END SALES-------------------- <? if exists("showPurchases") ?> <? if exists("showSales") ?> -- Union because sales and purchase shown together UNION ALL <? endif ?> <? endif ?> ------------BEGIN PURCHASE---------------- <? if exists("showPurchases") ?> -- A/P Memo history SELECT taxhist_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, <? value("none") ?> AS taxzone,'' AS taxzone_descrip, curr_abbr, apopen_docnumber AS docnumber, <? value("purchase") ?> AS source, CASE WHEN (apopen_doctype='C') THEN <? value("creditmemo") ?> WHEN (apopen_doctype='D') THEN <? value("debitmemo") ?> ELSE <? value("other") ?> END AS doctype, '' AS item_number, apopen_notes AS description, apopen_ponumber AS ordernumber, apopen_docdate AS docdate, vend_name AS name, 1 AS qty, apopen_amount AS unitprice, apopen_amount AS amount, 0 AS salesbase, 0 AS freightbase, 0 AS freighttax, apopen_amount / apopen_curr_rate AS purchasebase, taxhist_tax AS taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, 0 AS salestaxbase, taxhist_tax / taxhist_curr_rate AS purchasetaxbase FROM apopentax JOIN apopen ON (apopen_id=taxhist_parent_id) JOIN vendinfo ON (apopen_vend_id=vend_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (false) <? endif ?> AND (taxhist_distdate IS NOT NULL) ) UNION ALL --Voucher Header History SELECT taxhist_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, COALESCE(taxzone_code,<? value("none") ?>) AS taxzone, taxzone_descrip, curr_abbr, vohead_number AS docnumber, <? value("purchase") ?> AS source, <? value("voucher") ?> AS doctype, '', vohead_notes AS description, pohead_number AS ordernumber, vohead_docdate AS docdate, vend_name AS name, 1 AS qty, 0 AS unitprice, 0 AS amount, 0 AS salesbase, 0 AS freightbase, 0 AS freighttax, 0 AS purchasebase, taxhist_tax AS taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, 0 AS salestaxbase, taxhist_tax / taxhist_curr_rate AS purchasetaxbase FROM voheadtax JOIN vohead ON (vohead_id=taxhist_parent_id) LEFT OUTER JOIN pohead ON (vohead_pohead_id=pohead_id) JOIN vendinfo ON (vohead_vend_id=vend_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) LEFT OUTER JOIN taxzone ON (vohead_taxzone_id=taxzone_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (_taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (taxzone_id=<? value("taxzone_id") ?>) <? endif ?> AND (taxhist_distdate IS NOT NULL) ) UNION ALL --Voucher Line Item SELECT taxhist_distdate, tax_code AS tax, tax_descrip, COALESCE(taxtype_name,<? value("none") ?>) AS taxtype, taxtype_descrip, COALESCE(taxclass_code,<? value("none") ?>) AS taxclass, taxclass_descrip, COALESCE(taxauth_code,<? value("none") ?>) AS taxauth, taxauth_name AS taxauth_descrip, COALESCE(taxzone_code,<? value("none") ?>) AS taxzone, taxzone_descrip, curr_abbr, vohead_number AS docnumber, <? value("purchase") ?> AS source, <? value("voucher") ?> AS doctype, COALESCE(item_number,expcat_code), COALESCE(item_descrip1,expcat_descrip) AS description, pohead_number AS ordernumber, vohead_docdate AS docdate, vend_name AS name, voitem_qty AS qty, COALESCE(SUM(vodist_amount),0)/voitem_qty AS unitprice, COALESCE(SUM(vodist_amount),0) AS amount, 0 AS salesbase, 0 AS freightbase, 0 AS freighttax, currToBase(vohead_curr_id, COALESCE(SUM(vodist_amount),0), vohead_distdate) AS purchasebase, taxhist_tax AS taxlocal, taxhist_tax / taxhist_curr_rate AS taxbase, 0 AS salestaxbase, taxhist_tax / taxhist_curr_rate AS purchasetaxbase FROM voitemtax JOIN voitem ON (voitem_id=taxhist_parent_id) JOIN vohead ON (vohead_id=voitem_vohead_id) JOIN pohead ON (vohead_pohead_id=pohead_id) JOIN poitem ON (voitem_poitem_id=poitem_id) JOIN vodist ON ((vodist_poitem_id=poitem_id) AND (vodist_vohead_id=vohead_id)) JOIN vendinfo ON (vohead_vend_id=vend_id) JOIN taxtype ON (taxtype_id=taxhist_taxtype_id) JOIN tax ON (tax_id=taxhist_tax_id) JOIN curr_symbol ON (curr_id=taxhist_curr_id) LEFT OUTER JOIN taxclass ON (tax_taxclass_id=taxclass_id) LEFT OUTER JOIN taxauth ON (tax_taxauth_id=taxauth_id) LEFT OUTER JOIN taxzone ON (vohead_taxzone_id=taxzone_id) LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id) LEFT OUTER JOIN item ON (itemsite_item_id=item_id) LEFT OUTER JOIN expcat ON (expcat_id=poitem_expcat_id) <? if exists("distDate") ?> WHERE ((taxhist_distdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? else ?> WHERE ((taxhist_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? endif ?> <? if exists("tax_id") ?> AND (taxhist_tax_id=<? value("tax_id") ?>) <? endif ?> <? if exists("taxtype_id") ?> AND (taxhist_taxtype_id=<? value("taxtype_id") ?>) <? endif ?> <? if exists("taxclass_id") ?> AND (taxclass_id=<? value("taxclass_id") ?>) <? endif ?> <? if exists("taxauth_id") ?> AND (taxauth_id=<? value("taxauth_id") ?>) <? endif ?> <? if exists("taxzone_id") ?> AND (taxzone_id=<? value("taxzone_id") ?>) <? endif ?> AND (taxhist_distdate IS NOT NULL) ) GROUP BY taxhist_id,taxhist_distdate,tax_code,tax_descrip, taxtype_name,taxtype_descrip,taxclass_code,taxclass_descrip, taxauth_code,taxauth_descrip,taxzone,taxzone_descrip,curr_abbr, vohead_number,pohead_number,item_number,item_descrip1, vohead_curr_id,vohead_distdate,vohead_docdate,vend_name, expcat_code,expcat_descrip,taxhist_tax,taxhist_curr_rate, voitem_qty <? endif ?> -------------END PURCHASE-------------- ORDER BY docdate DESC, docnumber DESC ) AS data GROUP BY <? literal("groupBy") ?>, <? literal("groupBy") ?>_descrip ORDER BY <? literal("groupBy") ?> 221 5 215 745 215 2 141 138 230 20 Arial 10 bold head selection 460.577 137.571 200 20 Arial 10 bold head enddate 460.577 116.571 200 20 Arial 10 bold head startdate 461 96 200 20 Arial 10 bold head basis 141 117 230 20 Arial 10 bold head group 65.6 138 65.9 20 Arial 10 normal head selectionLit 4 199 100 15 Arial 8 normal detail group 141 97 230 20 Arial 10 bold head showPurchases 141 76 230 20 Arial 10 bold head showSales 6 26 5 20 745 20 2 0 2 100 20 Arial 8 normal detail group
    detail detail 19 200 0 100 15 Arial 8 bold detail f_freightbase 100 0 100 15 Arial 8 bold detail f_salesbase 550 0 100 15 Arial 8 bold detail f_purchasetaxbase 450 0 100 15 Arial 8 bold detail f_purchasebase 0 0 100 15 Arial 8 bold detail group 350 0 100 15 Arial 8 bold detail f_salestaxbase 300 0 50 15 Arial 8 bold detail freighttax 650 0 100 15 Arial 8 bold detail f_nettaxbase
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 20 650 3 100 15 Arial 8 bold detail nettaxbase money 350 3 100 15 Arial 8 bold detail salestaxbase qty 551 3 100 15 Arial 8 bold detail purchasetaxbase money
    qt-client-4.1.0/share/reports/TaxTypesMasterList.xml000066400000000000000000000101231217451700100225220ustar00rootroot00000000000000 Tax Types Master List TaxTypesMasterList Letter 50 50 50 50 detail select taxtype_name, taxtype_descrip from taxtype order by taxtype_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail taxtype_name 175 0 565 15 Arial 8 bold detail taxtype_descrip
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TermsMasterList.xml000066400000000000000000000152371217451700100220460ustar00rootroot00000000000000 Terms Master List TermsMasterList Letter 50 50 50 50 detail select terms_code, terms_descrip, terms_duedays, terms_discdays, formatScrap(terms_discprcnt) AS f_discprcnt from terms order by terms_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 495 0 80 15 Arial 8 bold detail terms_duedays 580 0 80 15 Arial 8 bold detail terms_discdays 95 0 395 15 Arial 8 bold detail terms_descrip 10 0 80 15 Arial 8 bold detail terms_code 665 0 80 15 Arial 8 bold detail f_discprcnt
    16 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TimePhasedAvailability.xml000066400000000000000000000260101217451700100233110ustar00rootroot00000000000000 Time Phased Availability TimePhasedAvailability Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("plancode_id") ?> ( SELECT (plancode_code || '-' || plancode_name) FROM plancode WHERE (plancode_id=<? value("plancode_id") ?>) ) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plncode; detail SELECT findPeriodStart(rcalitem_id) AS pstart, findPeriodEnd(rcalitem_id) AS pend, (formatDate(findPeriodStart(rcalitem_id)) || '-' || formatDate(findPeriodEnd(rcalitem_id))) AS period, item_number, uom_name AS f_uom, warehous_code, formatQty(qtyAvailable(itemsite_id, findPeriodStart(rcalitem_id))) AS f_unit FROM rcalitem, itemsite, item, uom, whsinfo WHERE ((rcalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) AND (itemsite_warehous_id=warehous_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN ( SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> ) UNION SELECT findPeriodStart(acalitem_id) AS pstart, findPeriodEnd(acalitem_id) AS pend, (formatDate(findPeriodStart(acalitem_id)) || '-' || formatDate(findPeriodEnd(acalitem_id))) AS period, item_number, uom_name AS f_uom, warehous_code, formatQty(qtyAvailable(itemsite_id, findPeriodStart(acalitem_id))) AS f_unit FROM acalitem, itemsite, item, uom, whsinfo WHERE ((acalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) AND (itemsite_warehous_id=warehous_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN ( SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> ) ORDER BY pstart, item_number, warehous_code; 221 5 215 745 215 2 140 105 200 20 Arial 10 bold head warehouse 140 80 300 20 Arial 10 bold head plncode 6 21 5 15 745 15 2
    detail detail pstart 6 10 5 250 15 Arial 8 bold detail period detail 16 660 0 80 15 Arial 8 bold detail f_unit 530 0 80 15 Arial 8 bold detail f_uom 615 0 35 15 Arial 8 bold detail warehous_code 320 0 200 15 Arial 8 bold detail item_number
    16 690 0 51 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TimePhasedBookings.xml000066400000000000000000000430301217451700100224530ustar00rootroot00000000000000 Time Phased Bookings TimePhasedBookings 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("byCust") ?> text('Customer') <? elseif exists("byProdcat") ?> text('Product Category') <? else ?> text('Item') <? endif ?> AS groupby, <? if exists("byCust") ?> text('Name') <? else ?> text('Description') <? endif ?> AS groupbyDescrip, <? if exists("salesDollars") ?> text('') <? else ?> text('UOM') <? endif ?> AS lbl_uom, <? if exists("inventoryUnits") ?> text('Qty.') <? elseif exists("capacityUnits") ?> text('Capacity') <? elseif exists("altCapacityUnits") ?> text('Alt. Capacity') <? elseif exists("salesDollars") ?> text('Sales') <? else ?> text('ERROR') <? endif ?> AS lbl_unittype; detail SELECT *, coalesce(unit,0) AS unit, <? if exists("salesDollars") ?> formatExtPrice(coalesce(unit,0)) AS f_unit <? else ?> formatQty(coalesce(unit,0)) AS f_unit <? endif ?> FROM -- Outer Table Query (SELECT DISTINCT calitem_id, findPeriodStart(calitem_id) AS pstart, findPeriodEnd(calitem_id) AS pend, (formatDate(findPeriodStart(calitem_id)) || '-' || formatDate(findPeriodEnd(calitem_id))) AS period, <? if exists("byCust") ?> cust_id, cust_number AS f_number, cust_name AS f_description <? elseif exists("byProdcat") ?> prodcat_id, prodcat_code AS f_number, prodcat_descrip AS f_description <? elseif exists("byItem") ?> item_id, item_number AS f_number, item_descrip1 AS f_description <? endif ?> , warehous_id, warehous_code <? if exists("salesDollars") ?> , <? value("baseCurrAbbr") ?>::text AS f_uom <? else ?> <? if exists("inventoryUnits") ?> , uom_name AS f_uom <? elseif exists("capacityUnits") ?> , itemcapuom(item_id) AS f_uom <? elseif exists("altCapacityUnits") ?> , itemaltcapuom(item_id) AS f_uom <? endif ?> <? endif ?> FROM coitem JOIN cohead ON (coitem_cohead_id=cohead_id) JOIN itemsite ON (coitem_itemsite_id=itemsite_id) JOIN item ON (itemsite_item_id=item_id) <? if exists("inventoryUnits") ?> JOIN uom ON (item_inv_uom_id=uom_id) <? endif ?> JOIN site() ON (itemsite_warehous_id=warehous_id) <? if reExists("[cC]ust") ?> JOIN custinfo ON (cohead_cust_id=cust_id) <? endif ?> <? if reExists("[pP]rodcat") ?> JOIN prodcat ON (item_prodcat_id=prodcat_id) <? endif ?> , ( SELECT rcalitem_id AS calitem_id, findPeriodStart(rcalitem_id) AS calitem_start, findPeriodEnd(rcalitem_id) AS calitem_end FROM rcalitem WHERE (rcalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) UNION SELECT acalitem_id AS calitem_id, findPeriodStart(acalitem_id) AS calitem_start, findPeriodEnd(acalitem_id) AS calitem_end FROM acalitem WHERE (acalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) ) AS calitem WHERE ((cohead_orderdate BETWEEN <? foreach("period_id_list") ?> <? if isfirst("period_id_list") ?> findPeriodStart(<? value("period_id_list") ?>) <? endif ?> <? if isLast("period_id_list") ?> AND findPeriodEnd(<? value("period_id_list") ?>) <? endif ?> <? endforeach ?> ) AND (coitem_status != 'X') <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? endif ?> <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? endif ?> <? if exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND(itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY pstart, f_number, f_description, f_uom, warehous_code) list LEFT OUTER JOIN -- Bookings calcuations -- Loop through each period bucket to find bookings for period (<? foreach("period_id_list") ?> SELECT <? value("period_id_list") ?> AS calitem_id, warehous_id, <? if exists("byCust") ?> cust_id <? elseif exists("byProdcat") ?> prodcat_id <? elseif exists("byItem") ?> item_id <? endif ?> <? if exists("salesDollars") ?> , sum(round((coitem_qtyord * coitem_qty_invuomratio) * (currtobase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2)) AS unit , <? value("baseCurrAbbr") ?>::text AS f_uom <? else ?> , sum(coitem_qtyord) <? if exists("capacityUnits") ?> * itemcapinvrat(item_id) <? elseif exists("altCapacityUnits") ?> * itemaltcapinvrat(item_id) <? endif ?> AS unit <? if exists("inventoryUnits") ?> , uom_name AS f_uom <? elseif exists("capacityUnits") ?> , itemcapuom(item_id) AS f_uom <? elseif exists("altCapacityUnits") ?> , itemaltcapuom(item_id) AS f_uom <? endif ?> <? endif ?> FROM coitem JOIN cohead ON (coitem_cohead_id=cohead_id) JOIN itemsite ON (coitem_itemsite_id=itemsite_id) JOIN item ON (itemsite_item_id=item_id) <? if exists("inventoryUnits") ?> JOIN uom ON (item_inv_uom_id=uom_id) <? endif ?> JOIN site() ON (itemsite_warehous_id=warehous_id) <? if reExists("[cC]ust") ?> JOIN custinfo ON (cohead_cust_id=cust_id) <? endif ?> <? if reExists("[pP]rodcat") ?> JOIN prodcat ON (item_prodcat_id=prodcat_id) <? endif ?> WHERE ((cohead_orderdate BETWEEN findPeriodStart(<? value("period_id_list") ?>) AND findPeriodEnd(<? value("period_id_list") ?>)) AND (coitem_status != 'X') <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? endif ?> <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? endif ?> <? if exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND(itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) GROUP BY <? if exists("byCust") ?> cust_id, <? if exists("capacityUnits") ?> item_id, <? elseif exists("altCapacityUnits") ?> item_id, <? endif ?> <? elseif exists("byProdcat") ?> prodcat_id, <? if exists("capacityUnits") ?> item_id, <? elseif exists("altCapacityUnits") ?> item_id, <? endif ?> <? elseif exists("byItem") ?> item_id, <? endif ?> f_uom, warehous_id <? if isLast("period_id_list") ?> <? else ?> UNION <? endif ?> <? endforeach ?> ) bookings ON <? if exists("byCust") ?> (list.cust_id=bookings.cust_id) <? elseif exists("byProdcat") ?> (list.prodcat_id=bookings.prodcat_id) <? elseif exists("byItem") ?> (list.item_id=bookings.item_id) <? endif ?> AND (list.calitem_id=bookings.calitem_id) AND (list.warehous_id=bookings.warehous_id) AND (list.f_uom=bookings.f_uom) 221 5 215 745 215 2 660 200 80 15 Arial 8 normal head lbl_unittype 530 200 80 15 Arial 8 normal head lbl_uom 220 200 80 15 Arial 8 normal head groupby 330 200 200 15 Arial 8 normal head groupbyDescrip 10 33 725 15 12 Arial 10 bold Parameter Query filter 6 21 5 15 745 15 2 530 -1 80 15 Arial 8 normal head lbl_uom 660 -1 80 15 Arial 8 normal head lbl_unittype 215 -1 80 15 Arial 8 normal head groupby 330 -1 200 15 Arial 8 normal head groupbyDescrip
    detail detail pstart 6 10 5 150 15 Arial 8 bold detail period 31 660 5 80 15 Arial 8 bold detail unit extprice 640 0 745 0 0 detail 16 660 0 80 15 Arial 8 bold detail f_unit 615 0 35 15 Arial 8 bold detail warehous_code 530 0 80 15 Arial 8 bold detail f_uom 220 0 100 15 Arial 8 bold detail f_number 330 0 200 15 Arial 8 bold detail f_description
    16 95 -1 100 15 Arial 8 bold Context Query report_date 690 -1 51 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TimePhasedDemandByPlannerCode.xml000066400000000000000000000266111217451700100245040ustar00rootroot00000000000000 Time Phased Demand By Planner Code TimePhasedDemandByPlannerCode Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("plancode_id") ?> ( SELECT (plancode_code||'-'||plancode_name) FROM plancode WHERE plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plancode, <? if exists("inventoryUnits") ?> text('Qty.') <? elseif exists("capacityUnits") ?> text('Capacity') <? elseif exists("altCapacityUnits") ?> text('Alt. Capacity') <? else ?> text('ERROR') <? endif ?> AS lbl_unittype ; detail SELECT findPeriodStart(calitem_id) AS pstart, findPeriodEnd(calitem_id) AS pend, (formatDate(findPeriodStart(calitem_id)) || '-' || formatDate(findPeriodEnd(calitem_id))) AS period, plancode_code, <? if exists("inventoryUnits") ?> uom_name <? elseif exists("capacityUnits") ?> itemcapuom(item_id) <? elseif exists("altCapacityUnits") ?> itemaltcapuom(item_id) <? else ?> text('') <? endif ?> AS f_uom, warehous_code, <? if exists("inventoryUnits") ?> formatQty(SUM(summDemand(itemsite_id, calitem_id))) <? elseif exists("capacityUnits") ?> formatQty(SUM(summDemand(itemsite_id, calitem_id) * itemcapinvrat(item_id))) <? elseif exists("altCapacityUnits") ?> formatQty(SUM(summDemand(itemsite_id, calitem_id) * itemaltcapinvrat(item_id))) <? else ?> formatQty(SUM(summDemand(itemsite_id, calitem_id))) <? endif ?> AS f_unit FROM itemsite, item, uom, whsinfo, plancode, (SELECT rcalitem_id AS calitem_id FROM rcalitem WHERE (rcalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) UNION SELECT acalitem_id as calitem_id FROM acalitem WHERE (acalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) ) AS calitem WHERE ((itemsite_warehous_id=warehous_id) AND (itemsite_active) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_plancode_id=plancode_id) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (plancode_code ~ <? value("plancode_pattern") ?>) <? endif ?> ) GROUP BY pstart, pend, period, plancode_code, warehous_code, f_uom ORDER BY pstart, plancode_code, warehous_code, f_uom; 221 5 215 745 215 2 660 200 80 15 Arial 8 normal head lbl_unittype 140 105 200 20 Arial 10 bold head warehouse 140 80 200 20 Arial 10 bold head plancode 6 21 660 0 80 15 Arial 8 normal head lbl_unittype 5 15 745 15 2
    detail detail pstart 6 10 5 250 15 Arial 8 bold detail period detail 16 320 0 200 15 Arial 8 bold detail plancode_code 615 0 35 15 Arial 8 bold detail warehous_code 530 0 80 15 Arial 8 bold detail f_uom 660 0 80 15 Arial 8 bold detail f_unit
    16 95 0 100 15 Arial 8 bold Context Query report_date 690 0 51 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TimePhasedOpenAPItems.xml000066400000000000000000000240031217451700100230230ustar00rootroot00000000000000 Time Phased Open A/P Items TimePhasedOpenAPItems Letter 50 50 50 50 head SELECT <? if exists("vend_id") ?> ( SELECT vend_name FROM vendinfo WHERE (vend_id=<? value("vend_id") ?>) ) <? elseif exists("vendtype_id") ?> ( SELECT (vendtype_code || '-' || vendtype_descrip) FROM vendtype WHERE (vendtype_id=<? value("vendtype_id") ?>) ) <? elseif exists("vendtype_pattern") ?> text(<? value("vendtype_pattern") ?>) <? else ?> text('All Vendors') <? endif ?> AS f_value, <? if reExists("vendtype_.*") ?> text('Vendor Type:') <? else ?> text('Vendor:') <? endif ?> AS f_label; detail SELECT pstart, pend, period, vend_number, vend_name, value, formatMoney(value) AS f_value FROM ( SELECT calitem_start AS pstart, calitem_end AS pend, (formatDate(calitem_start) || '-' || formatDate(calitem_end)) AS period, vend_number, vend_name, openAPItemsValue(vend_id, calitem_id) AS value FROM vendinfo, ( SELECT rcalitem_id AS calitem_id, findPeriodStart(rcalitem_id) AS calitem_start, findPeriodEnd(rcalitem_id) AS calitem_end FROM rcalitem WHERE (rcalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) UNION SELECT acalitem_id AS calitem_id, findPeriodStart(acalitem_id) AS calitem_start, findPeriodEnd(acalitem_id) AS calitem_end FROM acalitem WHERE (acalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) ) AS calitem <? if exists("vend_id") ?> WHERE (vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> WHERE (vend_vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> WHERE (vend_vendtype_id IN (SELECT vendtype_id FROM vendtype WHERE (vendtype_code ~ <? value("vendtype_pattern") ?>) )) <? endif ?> ) AS data WHERE (value != 0) ORDER BY pstart, pend, vend_number 221 10 100 125 20 Arial 10 normal head f_label 5 215 745 215 2 140 100 200 20 Arial 10 bold head f_value 6 21 5 15 745 15 2
    detail detail pstart 6 10 5 250 15 Arial 8 bold detail period 31 645 10 100 15 Arial 8 bold detail value money 635 5 745 5 0 detail 16 320 0 100 15 Arial 8 bold detail vend_number 430 0 210 15 Arial 8 bold detail vend_name 645 0 100 15 Arial 8 bold detail f_value
    16 690 0 51 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TimePhasedOpenARItems.xml000066400000000000000000000250551217451700100230350ustar00rootroot00000000000000 Time Phased Open A/R Items TimePhasedOpenARItems Letter 50 50 50 50 head SELECT <? if exists("cust_id") ?> ( SELECT cust_name FROM custinfo WHERE (cust_id=<? value("cust_id") ?>) ) <? elseif exists("custtype_id") ?> ( SELECT (custtype_code || '-' || custtype_descrip) FROM custtype WHERE (custtype_id=<? value("custtype_id") ?>) ) <? elseif exists("custgrp_id") ?> ( SELECT (custgrp_name || '-' || custgrp_descrip) FROM custgrp WHERE (custgrp_id=<? value("custgrp_id") ?>) ) <? elseif exists("custtype_pattern") ?> text(<? value("custtype_pattern") ?>) <? else ?> text('All Customers') <? endif ?> AS f_value, <? if reExists("custtype_.*") ?> text('Customer Type:') <? elseif exists("custgrp_id") ?> text('Customer Group:') <? else ?> text('Customer:') <? endif ?> AS f_label; detail SELECT pstart, pend, period, cust_number, cust_name, value, formatMoney(value) AS f_value FROM ( SELECT calitem_start AS pstart, calitem_end AS pend, (formatDate(calitem_start) || '-' || formatDate(calitem_end)) AS period, cust_number, cust_name, openARItemsValue(cust_id, calitem_id) AS value FROM custinfo LEFT OUTER JOIN custgrpitem ON (cust_id=custgrpitem_cust_id) LEFT OUTER JOIN custgrp ON (custgrpitem_custgrp_id=custgrp_id), ( SELECT rcalitem_id AS calitem_id, findPeriodStart(rcalitem_id) AS calitem_start, findPeriodEnd(rcalitem_id) AS calitem_end FROM rcalitem WHERE (rcalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) UNION SELECT acalitem_id AS calitem_id, findPeriodStart(acalitem_id) AS calitem_start, findPeriodEnd(acalitem_id) AS calitem_end FROM acalitem WHERE (acalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) ) AS calitem <? if exists("cust_id") ?> WHERE (cust_id=<? value("cust_id") ?>) <? elseif exists("custtype_id") ?> WHERE (cust_custtype_id=<? value("custtype_id") ?>) <? elseif exists("custgrp_id") ?> WHERE (custgrp_id=<? value("custgrp_id") ?>) <? elseif exists("custtype_pattern") ?> WHERE (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>) )) <? endif ?> ) AS data WHERE (value != 0) ORDER BY pstart, pend, cust_number 222 10 100 125 20 Arial 10 normal head f_label 5 215 745 215 2 140 100 200 20 Arial 10 bold head f_value 7 22 5 15 745 15 2
    detail detail pstart 7 10 5 250 15 Arial 8 bold detail period 27 635 5 745 5 0 645 5 100 15 Arial 8 bold detail value money detail 17 430 0 210 15 Arial 8 bold detail cust_name 320 0 100 15 Arial 8 bold detail cust_number 645 0 100 15 Arial 8 bold detail f_value
    17 95 0 100 15 Arial 8 bold Context Query report_date 690 0 51 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TimePhasedPlannedRevenueExpensesByPlannerCode.xml000066400000000000000000000242421217451700100277400ustar00rootroot00000000000000 Time Phased Planned Revenue/Expenses By Planner Code TimePhasedPlannedRevenueExpensesByPlannerCode Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("plancode_id") ?> ( SELECT (plancode_code || '-' || plancode_name) FROM plancode WHERE (plancode_id=<? value("plancode_id") ?>) ) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plncode; detail SELECT (formatDate(calitem_startdate) || '-' || formatDate(calitem_enddate)) AS period, formatMoney(COALESCE(cost,0.0)) AS f_cost, formatMoney(COALESCE(revenue,0.0)) AS f_revenue, formatMoney(COALESCE(revenue,0.0) - COALESCE(cost,0.0)) AS f_profit FROM ( SELECT calitem_startdate, calitem_enddate, SUM(plannedCost(plancode_id, warehous_id, <? if exists("actualCost") ?>'A'<? else ?>'S'<? endif ?> , calitem_id)) AS cost, <? if exists("averagePrice") ?> SUM(plannedRevenue(plancode_id, warehous_id, 'A', calitem_id, <? value("startEvalDate") ?>, <? value("endEvalDate") ?>)) <? else ?> SUM(plannedRevenue(plancode_id, warehous_id, 'L', calitem_id)) <? endif ?> AS revenue FROM plancode, whsinfo, ( SELECT rcalitem_id AS calitem_id, findPeriodStart(rcalitem_id) AS calitem_startdate, findPeriodEnd(rcalitem_id) AS calitem_enddate FROM rcalitem WHERE (rcalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) UNION SELECT acalitem_id AS calitem_id, findPeriodStart(acalitem_id) AS calitem_startdate, findPeriodEnd(acalitem_id) AS calitem_enddate FROM acalitem WHERE (acalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) ) AS calitem WHERE ((TRUE) <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (plancode_code ~ <? value("plancode_pattern") ?>) <? endif ?> ) GROUP BY calitem_startdate, calitem_enddate ) AS data ORDER BY calitem_startdate 221 140 105 200 20 Arial 10 bold head warehouse 140 80 300 20 Arial 10 bold head plncode 5 215 745 215 2 6 26 5 20 745 20 2
    detail detail 16 430 0 100 15 Arial 8 bold detail f_cost 10 0 250 15 Arial 8 bold detail period 640 0 100 15 Arial 8 bold detail f_profit 535 0 100 15 Arial 8 bold detail f_revenue
    16 690 0 51 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TimePhasedProductionByItem.xml000066400000000000000000000242561217451700100241510ustar00rootroot00000000000000 Time Phased Production By Item TimePhasedProductionByItem Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("plancode_id") ?> ( SELECT (plancode_code||'-'||plancode_name) FROM plancode WHERE plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plancode ; detail SELECT findPeriodStart(calitem_id) AS pstart, findPeriodEnd(calitem_id) AS pend, (formatDate(findPeriodStart(calitem_id)) || '-' || formatDate(findPeriodEnd(calitem_id))) AS period, item_number, uom_name, warehous_code, formatQty(SUM(summProd(itemsite_id, calitem_id))) AS f_unit FROM itemsite, item, uom, whsinfo, (SELECT rcalitem_id AS calitem_id FROM rcalitem WHERE (rcalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) UNION SELECT acalitem_id as calitem_id FROM acalitem WHERE (acalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) ) AS calitem WHERE ((itemsite_warehous_id=warehous_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (itemsite_plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (itemsite_plancode_id IN (SELECT plancode_id FROM plancode WHERE (plancode_code ~ <? value("plancode_pattern") ?>))) <? endif ?> ) GROUP BY pstart, pend, period, item_number, warehous_code, uom_name ORDER BY pstart, item_number, warehous_code; 221 140 80 200 20 Arial 10 bold head plancode 5 215 745 215 2 140 105 200 20 Arial 10 bold head warehouse 6 21 5 15 745 15 2
    detail detail pstart 6 10 5 250 15 Arial 8 bold detail period detail 16 660 0 80 15 Arial 8 bold detail f_unit 615 0 35 15 Arial 8 bold detail warehous_code 320 0 200 15 Arial 8 bold detail item_number 530 0 80 15 Arial 8 bold detail uom_name
    16 690 0 51 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TimePhasedProductionByPlannerCode.xml000066400000000000000000000277421217451700100254500ustar00rootroot00000000000000 Time Phased Production By Planner Code TimePhasedProductionByPlannerCode Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("plancode_id") ?> ( SELECT (plancode_code||'-'||plancode_name) FROM plancode WHERE plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> text(<? value("plancode_pattern") ?>) <? else ?> text('All Planner Codes') <? endif ?> AS plancode, <? if exists("inventoryUnits") ?> text('Qty.') <? elseif exists("capacityUnits") ?> text('Capacity') <? elseif exists("altCapacityUnits") ?> text('Alt. Capacity') <? else ?> text('ERROR') <? endif ?> AS lbl_unittype, <? if exists("showInactive") ?> text('Showing Active and Inactive Item Sites') <? else ?> text('Showing Active Item Sites Only') <? endif ?> AS lbl_showing ; detail SELECT findPeriodStart(calitem_id) AS pstart, findPeriodEnd(calitem_id) AS pend, (formatDate(findPeriodStart(calitem_id)) || '-' || formatDate(findPeriodEnd(calitem_id))) AS period, plancode_code, <? if exists("inventoryUnits") ?> uom_name <? elseif exists("capacityUnits") ?> itemcapuom(item_id) <? elseif exists("altCapacityUnits") ?> itemaltcapuom(item_id) <? else ?> text('') <? endif ?> AS f_uom, warehous_code, <? if exists("inventoryUnits") ?> formatQty(SUM(summProd(itemsite_id, calitem_id))) <? elseif exists("capacityUnits") ?> formatQty(SUM(summProd(itemsite_id, calitem_id) * itemcapinvrat(item_id))) <? elseif exists("altCapacityUnits") ?> formatQty(SUM(summProd(itemsite_id, calitem_id) * itemaltcapinvrat(item_id))) <? else ?> formatQty(SUM(summProd(itemsite_id, calitem_id))) <? endif ?> AS f_unit FROM itemsite, item, uom, whsinfo, plancode, (SELECT rcalitem_id AS calitem_id FROM rcalitem WHERE (rcalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) UNION SELECT acalitem_id as calitem_id FROM acalitem WHERE (acalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) ) AS calitem WHERE ((itemsite_warehous_id=warehous_id) <? if not exists("showInactive") ?> AND (itemsite_active) <? endif ?> AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_plancode_id=plancode_id) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("plancode_id") ?> AND (plancode_id=<? value("plancode_id") ?>) <? elseif exists("plancode_pattern") ?> AND (plancode_code ~ <? value("plancode_pattern") ?>) <? endif ?> ) GROUP BY pstart, pend, period, plancode_code, warehous_code, f_uom ORDER BY pstart, plancode_code, warehous_code, f_uom; 221 140 105 200 20 Arial 10 bold head warehouse 140 80 200 20 Arial 10 bold head plancode 660 200 80 15 Arial 8 normal head lbl_unittype 5 215 745 215 2 360 80 380 20 Arial 10 bold head lbl_showing 6 21 660 0 80 15 Arial 8 normal head lbl_unittype 5 15 745 15 2
    detail detail pstart 6 10 5 250 15 Arial 8 bold detail period detail 16 530 0 80 15 Arial 8 bold detail f_uom 615 0 35 15 Arial 8 bold detail warehous_code 660 0 80 15 Arial 8 bold detail f_unit 320 0 200 15 Arial 8 bold detail plancode_code
    16 690 0 51 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TimePhasedSalesHistory.xml000066400000000000000000000441331217451700100233360ustar00rootroot00000000000000 Time Phased Sales History TimePhasedSalesHistory 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("byCust") ?> text('Customer') <? elseif exists("byProdcat") ?> text('Product Category') <? else ?> text('Item') <? endif ?> AS groupby, <? if exists("byCust") ?> text('Name') <? else ?> text('Description') <? endif ?> AS groupbyDescrip, <? if exists("salesDollars") ?> text('') <? else ?> text('UOM') <? endif ?> AS lbl_uom, <? if exists("inventoryUnits") ?> text('Qty.') <? elseif exists("capacityUnits") ?> text('Capacity') <? elseif exists("altCapacityUnits") ?> text('Alt. Capacity') <? elseif exists("salesDollars") ?> text('Sales') <? else ?> text('ERROR') <? endif ?> AS lbl_unittype; detail SELECT *, coalesce(unit,0) AS unit, <? if exists("salesDollars") ?> formatExtPrice(coalesce(unit,0)) AS f_unit <? else ?> formatQty(coalesce(unit,0)) AS f_unit <? endif ?> FROM -- Outer Table Query (SELECT DISTINCT calitem_id, findPeriodStart(calitem_id) AS pstart, findPeriodEnd(calitem_id) AS pend, (formatDate(findPeriodStart(calitem_id)) || '-' || formatDate(findPeriodEnd(calitem_id))) AS period, <? if exists("byCust") ?> cust_id, cust_number AS f_number, cust_name AS f_description <? elseif exists("byProdcat") ?> prodcat_id, prodcat_code AS f_number, prodcat_descrip AS f_description <? elseif exists("byItem") ?> item_id, item_number AS f_number, item_descrip1 AS f_description <? endif ?> , warehous_id, warehous_code <? if exists("salesDollars") ?> , <? value("baseCurrAbbr") ?>::text AS f_uom <? else ?> <? if exists("inventoryUnits") ?> , uom_name AS f_uom <? elseif exists("capacityUnits") ?> , itemcapuom(item_id) AS f_uom <? elseif exists("altCapacityUnits") ?> , itemaltcapuom(item_id) AS f_uom <? endif ?> <? endif ?> FROM cohist JOIN itemsite ON (itemsite_id=cohist_itemsite_id) JOIN item ON (item_id=itemsite_item_id) <? if exists("inventoryUnits") ?> JOIN uom ON (item_inv_uom_id=uom_id) <? endif ?> JOIN site() ON (itemsite_warehous_id=warehous_id) <? if reExists("[cC]ust") ?> JOIN custinfo ON (cohist_cust_id=cust_id) <? endif ?> <? if reExists("[pP]rodcat") ?> JOIN prodcat ON (item_prodcat_id=prodcat_id) <? endif ?> <? if reExists("custgrp") ?> JOIN custgrpitem ON (custgrpitem_cust_id=cohist_cust_id) JOIN custgrp ON (custgrpitem_custgrp_id=custgrp_id) <? endif ?> , ( SELECT rcalitem_id AS calitem_id, findPeriodStart(rcalitem_id) AS calitem_start, findPeriodEnd(rcalitem_id) AS calitem_end FROM rcalitem WHERE (rcalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) UNION SELECT acalitem_id AS calitem_id, findPeriodStart(acalitem_id) AS calitem_start, findPeriodEnd(acalitem_id) AS calitem_end FROM acalitem WHERE (acalitem_id IN ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> ) ) ) AS calitem WHERE ((cohist_invcdate BETWEEN <? foreach("period_id_list") ?> <? if isfirst("period_id_list") ?> findPeriodStart(<? value("period_id_list") ?>) <? endif ?> <? if isLast("period_id_list") ?> AND findPeriodEnd(<? value("period_id_list") ?>) <? endif ?> <? endforeach ?> ) <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? endif ?> <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? endif ?> <? if exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? endif ?> <? if exists("custgrp_pattern") ?> AND (cust_custgrp_name ~ <? value("custgrp_pattern") ?>))) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND(itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY pstart, f_number, f_description, f_uom, warehous_code) list LEFT OUTER JOIN -- Sales calcuations -- Loop through each period bucket to find bookings for period (<? foreach("period_id_list") ?> SELECT <? value("period_id_list") ?> AS calitem_id, warehous_id, <? if exists("byCust") ?> cust_id <? elseif exists("byProdcat") ?> prodcat_id <? elseif exists("byItem") ?> item_id <? endif ?> <? if exists("salesDollars") ?> , sum(round(cohist_qtyshipped * currtobase(cohist_curr_id, cohist_unitprice, cohist_invcdate), 2)) AS unit , <? value("baseCurrAbbr") ?>::text AS f_uom <? else ?> , sum(cohist_qtyshipped) <? if exists("capacityUnits") ?> * itemcapinvrat(item_id) <? elseif exists("altCapacityUnits") ?> * itemaltcapinvrat(item_id) <? endif ?> AS unit <? if exists("inventoryUnits") ?> , uom_name AS f_uom <? elseif exists("capacityUnits") ?> , itemcapuom(item_id) AS f_uom <? elseif exists("altCapacityUnits") ?> , itemaltcapuom(item_id) AS f_uom <? endif ?> <? endif ?> FROM cohist JOIN itemsite ON (itemsite_id=cohist_itemsite_id) JOIN item ON (item_id=itemsite_item_id) <? if exists("inventoryUnits") ?> JOIN uom ON (item_inv_uom_id=uom_id) <? endif ?> JOIN site() ON (itemsite_warehous_id=warehous_id) <? if reExists("[cC]ust") ?> JOIN custinfo ON (cohist_cust_id=cust_id) <? endif ?> <? if reExists("[pP]rodcat") ?> JOIN prodcat ON (item_prodcat_id=prodcat_id) <? endif ?> <? if reExists("custgrp") ?> JOIN custgrpitem ON (custgrpitem_cust_id=cohist_cust_id) JOIN custgrp ON (custgrpitem_custgrp_id=custgrp_id) <? endif ?> WHERE ((cohist_invcdate BETWEEN findPeriodStart(<? value("period_id_list") ?>) AND findPeriodEnd(<? value("period_id_list") ?>)) <? if exists("item_id") ?> AND (item_id=<? value("item_id") ?>) <? endif ?> <? if exists("cust_id") ?> AND (cust_id=<? value("cust_id") ?>) <? endif ?> <? if exists("custtype_id") ?> AND (cust_custtype_id=<? value("custtype_id") ?>) <? endif ?> <? if exists("custtype_pattern") ?> AND (cust_custtype_id IN (SELECT custtype_id FROM custtype WHERE (custtype_code ~ <? value("custtype_pattern") ?>))) <? endif ?> <? if exists("custgrp_id") ?> AND (custgrpitem_custgrp_id=<? value("custgrp_id") ?>) <? endif ?> <? if exists("custgrp_pattern") ?> AND (cust_custgrp_name ~ <? value("custgrp_pattern") ?>))) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (item_prodcat_id IN (SELECT prodcat_id FROM prodcat WHERE (prodcat_code ~ <? value("prodcat_pattern") ?>))) <? endif ?> <? if exists("warehous_id") ?> AND(itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) GROUP BY <? if exists("byCust") ?> cust_id, <? if exists("capacityUnits") ?> item_id, <? elseif exists("altCapacityUnits") ?> item_id, <? endif ?> <? elseif exists("byProdcat") ?> prodcat_id, <? if exists("capacityUnits") ?> item_id, <? elseif exists("altCapacityUnits") ?> item_id, <? endif ?> <? elseif exists("byItem") ?> item_id, <? endif ?> f_uom, warehous_id <? if isLast("period_id_list") ?> <? else ?> UNION <? endif ?> <? endforeach ?> ) sales ON <? if exists("byCust") ?> (list.cust_id=sales.cust_id) <? elseif exists("byProdcat") ?> (list.prodcat_id=sales.prodcat_id) <? elseif exists("byItem") ?> (list.item_id=sales.item_id) <? endif ?> AND (list.calitem_id=sales.calitem_id) AND (list.warehous_id=sales.warehous_id) AND (list.f_uom=sales.f_uom) 221 5 215 745 215 2 660 200 80 15 Arial 8 normal head lbl_unittype 530 200 80 15 Arial 8 normal head lbl_uom 220 200 80 15 Arial 8 normal head groupby 330 200 200 15 Arial 8 normal head groupbyDescrip 10 33 725 15 12 Arial 10 bold Parameter Query filter 6 21 5 15 745 15 2 530 -1 80 15 Arial 8 normal head lbl_uom 660 -1 80 15 Arial 8 normal head lbl_unittype 215 -1 80 15 Arial 8 normal head groupby 330 -1 200 15 Arial 8 normal head groupbyDescrip
    detail detail pstart 6 10 5 150 15 Arial 8 bold detail period 31 660 5 80 15 Arial 8 bold detail unit extprice 640 0 745 0 0 detail 16 660 0 80 15 Arial 8 bold detail f_unit 615 0 35 15 Arial 8 bold detail warehous_code 530 0 80 15 Arial 8 bold detail f_uom 220 0 100 15 Arial 8 bold detail f_number 330 0 200 15 Arial 8 bold detail f_description
    16 95 -1 100 15 Arial 8 bold Context Query report_date 690 -1 51 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TimePhasedStatisticsByItem.xml000066400000000000000000000352231217451700100241510ustar00rootroot00000000000000 Time Phased Usage Statistics By Item TimePhasedStatisticsByItem Shows graph Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Warehouses') <? endif ?> AS warehouse FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT calitem_pstart AS pstart, calitem_pend AS pend, (formatDate(calitem_pstart) || '-' || formatDate(calitem_pend)) AS period, warehous_code, formatQty(summTransR(itemsite_id, calitem_id)) AS received, formatQty(summTransI(itemsite_id, calitem_id)) AS issued, formatQty(summTransS(itemsite_id, calitem_id)) AS sold, formatQty(summTransC(itemsite_id, calitem_id)) AS scrap, formatQty(summTransA(itemsite_id, calitem_id)) AS adjustments FROM itemsite, whsinfo, ( SELECT rcalitem_id as calitem_id, findPeriodStart(rcalitem_id) as calitem_pstart, findPeriodEnd(rcalitem_id) as calitem_pend FROM rcalitem WHERE (rcalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) UNION SELECT acalitem_id as calitem_id, findPeriodStart(acalitem_id) as calitem_pstart, findPeriodEnd(acalitem_id) as calitem_pend FROM acalitem WHERE (acalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) ORDER BY calitem_pstart, calitem_pend ) as calitem WHERE ((itemsite_warehous_id=warehous_id) AND (itemsite_item_id=<? value("item_id") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY calitem_pstart, warehous_code; Blue 0 0 255 BlueGreen 0 255 255 Green 0 255 0 Red 255 0 0 RedBlue 255 0 255 RedGreen 255 255 0 683 130 63 385 18 Arial 10 bold head item_descrip1 130 50 200 18 Arial 10 bold head item_number 0 675 735 675 2 35 116 712 467 Arial 8 normal detail <string>Time Phased Activity Graph</string> <string>Date Range</string> period <string>Quantity</string> 0 0 true IssuedQuanity issued Green Received received BlueGreen Sold sold Blue Scrapped scrap RedGreen Adjusted adjustments RedBlue 543 43 200 18 Arial 10 bold head warehouse 130 80 385 18 Arial 10 bold head item_descrip2 9 23 5 13 738 13 2
    detail detail pstart 15 10 5 250 13 Arial 8 bold detail period detail 18 405 0 80 13 Arial 8 bold detail issued 575 0 80 13 Arial 8 bold detail scrap 318 0 80 13 Arial 8 bold detail received 268 0 35 13 Arial 8 bold detail warehous_code 488 0 80 13 Arial 8 bold detail sold 660 0 80 13 Arial 8 bold detail adjustments
    18 688 0 51 13 Arial 8 bold Context Query page_number 93 0 100 13 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TimePhasedUsageStatisticsByItem.xml000066400000000000000000000357761217451700100251530ustar00rootroot00000000000000 Time Phased Usage Statistics By Item TimePhasedStatisticsByItem Shows graph 0.05 0.05 Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Warehouses') <? endif ?> AS warehouse FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT calitem_pstart AS pstart, calitem_pend AS pend, (formatDate(calitem_pstart) || '-' || formatDate(calitem_pend)) AS period, warehous_code, formatQty(summTransR(itemsite_id, calitem_id)) AS received, formatQty(summTransI(itemsite_id, calitem_id)) AS issued, formatQty(summTransS(itemsite_id, calitem_id)) AS sold, formatQty(summTransC(itemsite_id, calitem_id)) AS scrap, formatQty(summTransA(itemsite_id, calitem_id)) AS adjustments, -- summTransR(itemsite_id, calitem_id) AS a_received, summTransI(itemsite_id, calitem_id) AS a_issued, summTransS(itemsite_id, calitem_id) AS a_sold, summTransC(itemsite_id, calitem_id) AS a_scrap, summTransA(itemsite_id, calitem_id) AS a_adjustments FROM itemsite, whsinfo, ( SELECT rcalitem_id as calitem_id, findPeriodStart(rcalitem_id) as calitem_pstart, findPeriodEnd(rcalitem_id) as calitem_pend FROM rcalitem WHERE (rcalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) UNION SELECT acalitem_id as calitem_id, findPeriodStart(acalitem_id) as calitem_pstart, findPeriodEnd(acalitem_id) as calitem_pend FROM acalitem WHERE (acalitem_id in ( <? foreach("period_id_list") ?> <? if not isfirst("period_id_list") ?> , <? endif ?> <? value("period_id_list") ?> <? endforeach ?> )) ORDER BY calitem_pstart, calitem_pend ) as calitem WHERE ((itemsite_warehous_id=warehous_id) AND (itemsite_item_id=<? value("item_id") ?>) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY calitem_pstart, warehous_code; Blue 0 0 255 BlueGreen 0 255 255 Green 0 255 0 Red 255 0 0 RedBlue 255 0 255 RedGreen 255 255 0 683 130 63 385 18 Arial 10 bold head item_descrip1 130 50 200 18 Arial 10 bold head item_number 0 675 735 675 2 35 116 712 467 Arial 8 normal detail <string>Time Phased Activity Graph</string> <string>Date Range</string> period <string>Quantity</string> 0 0 true IssuedQuanity a_issued Green Received a_received BlueGreen Sold a_sold Blue Scrapped a_scrap RedGreen Adjusted a_adjustments RedBlue 543 43 200 18 Arial 10 bold head warehouse 130 80 385 18 Arial 10 bold head item_descrip2 9 23 5 13 738 13 2
    detail detail pstart 15 10 5 250 13 Arial 8 bold detail period detail 18 405 0 80 13 Arial 8 bold detail issued 575 0 80 13 Arial 8 bold detail scrap 318 0 80 13 Arial 8 bold detail received 268 0 35 13 Arial 8 bold detail warehous_code 488 0 80 13 Arial 8 bold detail sold 660 0 80 13 Arial 8 bold detail adjustments
    18 688 0 51 13 Arial 8 bold Context Query page_number 93 0 100 13 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/TitleList.xml000066400000000000000000000062241217451700100206550ustar00rootroot00000000000000 Titles TitleList Letter 50 50 50 50 detail SELECT hnfc_code FROM hnfc ORDER BY hnfc_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail hnfc_code
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TodoItem.xml000066400000000000000000000153451217451700100204700ustar00rootroot00000000000000 To-Do Item TodoItem Letter 50 50 50 50 detail SELECT todoitem_id AS id, 'T' AS type, todoitem_seq AS seq, todoitem_name AS name, firstLine(todoitem_description) AS descrip, todoitem_status AS status, todoitem_due_date AS due, todoitem_username AS usr, incdt_number AS incdt FROM todoitem LEFT OUTER JOIN incdt ON (incdt_id=todoitem_incdt_id) WHERE (todoitem_id=<? value("todoitem_id") ?>) ORDER BY seq, usr; 141 385 30 100 15 Arial 8 bold detail status 110 35 80 15 Arial 8 bold detail type 385 45 100 15 Arial 8 bold detail due 385 60 100 15 Arial 8 bold detail incdt 110 20 75 15 Arial 8 bold detail usr 110 65 200 15 Arial 8 bold detail name 110 80 600 15 0 Arial 8 bold detail descrip 10 135 750 135 2 110 50 50 15 Arial 8 bold detail seq 6 21 5 15 745 15 2 16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number qt-client-4.1.0/share/reports/TodoList.xml000066400000000000000000000260101217451700100204740ustar00rootroot00000000000000 To-Do List TodoList 0.05 0.05 Letter 50 50 50 50 detail todolist detail queryParams SELECT <? if exists("completed") ?> 'Yes' <? else ?> 'No' <? endif ?> AS showClosed, <? if exists("projects") ?> 'Yes' <? else ?> 'No' <? endif ?> AS showTasks, <? if exists("incidents") ?> 'Yes' <? else ?> 'No' <? endif ?> AS showIncdts; 141 325 43 100 15 Arial 8 bold queryParams showClosed 110 43 100 15 Arial 8 bold queryParams showIncdts 10 135 750 135 2 555 43 100 15 Arial 8 bold queryParams showTasks 10 63 725 15 12 Arial 8 bold Parameter Query filter 6 21 5 15 745 15 2
    detail ByUser assigned detail 31 630 0 115 15 Arial 8 bold detail f_parent 10 0 75 15 Arial 8 bold detail assigned 230 15 520 15 0 Arial 8 bold detail notes 435 0 100 15 Arial 8 bold detail stage 100 0 55 15 Arial 8 bold detail type 165 0 50 15 Arial 8 bold detail priority 540 0 75 15 Arial 8 bold detail due 230 0 200 15 Arial 8 bold detail name
    16 90 1 100 15 Arial 8 bold Context Query report_date 705 1 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/TrialBalances.xml000066400000000000000000000420061217451700100214420ustar00rootroot00000000000000 Trial Balances TrialBalances 0.05 0.05 Letter 50 50 50 50 head SELECT <? if exists("accnt_id") ?> ( SELECT (accnt_number || '-' || accnt_descrip) FROM accnt WHERE (accnt_id=<? value("accnt_id") ?>) ) <? else ?> text('All Accounts') <? endif ?> AS accnt, <? if exists("period_id") ?> ( SELECT (formatDate(period_start) || '-' || formatDate(period_end)) FROM period WHERE (period_id=<? value("period_id") ?>) ) <? else ?> text('All Periods') <? endif ?> AS period; detail SELECT accnt_id, period_id, formatDate(period_start) AS f_start, formatDate(period_end) AS f_end, formatGLAccount(accnt_id) AS f_account, accnt_descrip, formatMoney(abs(trialbal_beginning)) AS f_beginning, CASE WHEN(trialbal_beginning>0) THEN text('CR') ELSE text('') END AS f_beginningcr, formatMoney(trialbal_debits) AS f_debits, formatMoney(trialbal_credits) AS f_credits, formatMoney(abs(trialbal_debits - trialbal_credits)) AS f_diff, CASE WHEN((trialbal_debits - trialbal_credits) < 0) THEN text('CR') ELSE text('') END AS f_diffcr, formatMoney(abs(trialbal_ending)) AS f_ending, CASE WHEN(trialbal_ending>0) THEN text('CR') ELSE text('') END AS f_endingcr FROM trialbal, accnt, period WHERE ((trialbal_accnt_id=accnt_id) AND (trialbal_period_id=period_id) <? if exists("accnt_id") ?> AND (trialbal_accnt_id=<? value("accnt_id") ?>) <? endif ?> <? if exists("period_id") ?> AND (period_id=<? value("period_id") ?>) <? endif ?> <? if not exists("showZero") ?> AND (abs(trialbal_beginning)+abs(trialbal_ending)+abs(trialbal_debits)+abs(trialbal_credits) > 0) <? endif ?> ) ORDER BY period_start, formatGLAccount(accnt_id); total SELECT formatMoney(abs(beginning)) AS f_beginning, CASE WHEN(beginning<0) THEN text('CR') ELSE text('') END AS f_beginningcr, formatMoney(debits) AS f_debits, formatMoney(credits) AS f_credits, formatMoney(abs(debits - credits)) AS f_diff, CASE WHEN((debits - credits) < 0) THEN text('CR') ELSE text('') END AS f_diffcr, formatMoney(abs(ending)) AS f_ending, CASE WHEN(ending<0) THEN text('CR') ELSE text('') END AS f_endingcr FROM ( SELECT SUM(trialbal_beginning*-1) AS beginning, SUM(trialbal_debits) AS debits, SUM(trialbal_credits) AS credits, SUM(trialbal_ending*-1) AS ending FROM trialbal, accnt, period WHERE ((trialbal_accnt_id=accnt_id) AND (trialbal_period_id=period_id) <? if exists("accnt_id") ?> AND (trialbal_accnt_id=<? value("accnt_id") ?>) <? endif ?> <? if exists("period_id") ?> AND (period_id=<? value("period_id") ?>) <? endif ?> ) ) AS data; 191 5 185 990 185 2 10 38 725 15 12 Arial 10 bold Parameter Query filter 6 36 5 30 990 30 2
    detail detail 31 475 0 30 15 Arial 8 bold detail f_beginningcr 105 0 90 15 Arial 8 bold detail f_end 965 0 30 15 Arial 8 bold detail f_endingcr 510 0 100 15 Arial 8 bold detail f_debits 370 0 100 15 Arial 8 bold detail f_beginning 615 0 100 15 Arial 8 bold detail f_credits 200 15 140 15 Arial 8 bold detail accnt_descrip 10 0 90 15 Arial 8 bold detail f_start 860 0 100 15 Arial 8 bold detail f_ending 720 0 100 15 Arial 8 bold detail f_diff 825 0 30 15 Arial 8 bold detail f_diffcr 200 0 150 15 Arial 8 bold detail f_account
    17 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date 21 370 0 100 15 Arial 8 bold total f_beginning 720 0 100 15 Arial 8 bold total f_diff 510 0 100 15 Arial 8 bold total f_debits 615 0 100 15 Arial 8 bold total f_credits 860 0 100 15 Arial 8 bold total f_ending 965 0 30 15 Arial 8 bold total f_endingcr 475 0 30 15 Arial 8 bold total f_beginningcr 825 0 30 15 Arial 8 bold total f_diffcr
    qt-client-4.1.0/share/reports/UOMs.xml000066400000000000000000000100121217451700100175510ustar00rootroot00000000000000 Units of Measure UOMs Letter 50 50 50 50 detail SELECT uom_name, uom_descrip FROM uom ORDER BY uom_name; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 10 0 150 15 Arial 8 bold detail uom_name 175 0 565 15 Arial 8 bold detail uom_descrip
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/UnappliedAPCreditMemos.xml000066400000000000000000000164711217451700100232430ustar00rootroot00000000000000 Unapplied A/P Credit Memos UnappliedAPCreditMemos Letter 50 50 50 50 detail SELECT apopen_id, apopen_docnumber, (vend_number || '-' || vend_name) AS vendor, formatMoney(apopen_amount) AS f_amount, formatMoney(apopen_paid) AS f_paid, formatMoney(apopen_amount - apopen_paid) AS f_balance FROM apopen, vendinfo WHERE ( (apopen_doctype='C') AND (apopen_open) AND (apopen_vend_id=vend_id) <? if exists("vend_id") ?> AND (vend_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> AND (vend_vendtype_id=<? value("vendtype_id") ?>) <? elseif exists("vendtype_pattern") ?> AND (vend_vendtype_id IN (SELECT vendtype_id FROM vendtype WHERE (vendtype_code ~ <? value("vendtype_pattern") ?>))) <? endif ?> ) ORDER BY apopen_docnumber; 77 5 70 745 70 2 6 26 5 20 745 20 2
    detail detail 17 645 0 100 15 Arial 8 bold detail f_balance 10 0 80 15 Arial 8 bold detail apopen_docnumber 540 0 100 15 Arial 8 bold detail f_paid 434 0 100 15 Arial 8 bold detail f_amount 100 0 300 15 Arial 8 bold detail vendor
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/UnappliedARCreditMemos.xml000066400000000000000000000155561217451700100232500ustar00rootroot00000000000000 Unapplied A/R Credit Memos UnappliedARCreditMemos Letter 50 50 50 50 detail SELECT aropen_id, aropen_docnumber, (cust_number || '-' || cust_name) AS cust, formatMoney(aropen_amount) AS f_amount, formatMoney(aropen_paid) AS f_paid, formatMoney(aropen_amount - aropen_paid) AS f_balance FROM aropen, custinfo WHERE ( (aropen_doctype IN ('C', 'R')) AND (aropen_open) AND (aropen_cust_id=cust_id) ) ORDER BY aropen_docnumber; 77 5 70 745 70 2 6 26 5 20 745 20 2
    detail detail 17 645 0 100 15 Arial 8 bold detail f_balance 10 0 80 15 Arial 8 bold detail aropen_docnumber 540 0 100 15 Arial 8 bold detail f_paid 434 0 100 15 Arial 8 bold detail f_amount 100 0 300 15 Arial 8 bold detail cust
    17 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/UniformBOL.xml000066400000000000000000001336561217451700100207260ustar00rootroot00000000000000 Uniform Bill of Lading UniformBOL 0.05 0.05 Letter 50 50 25 25 head SELECT shiphead_shipvia, formatDate(shiphead_shipdate) AS shipdate, cust_name, cust_number, cohead_number, cohead_fob, cohead_custponumber, warehous_descrip, addr_line1 AS warehous_addr1, addr_line2 AS warehous_addr2, addr_line3 AS warehous_addr3, addr_city AS warehous_addr4, warehous_fob, cohead_shiptoname, cohead_shiptoaddress1, cohead_shiptoaddress2, cohead_shiptoaddress3, (cohead_shiptocity || ' ' || cohead_shiptostate || ' ' || cohead_shiptozipcode) AS shiptocitystatezip, cohead_shiptophone FROM shiphead JOIN cohead ON (cohead_id=shiphead_order_id) LEFT OUTER JOIN whsinfo ON (warehous_id=cohead_warehous_id) JOIN custinfo ON (cust_id=cohead_cust_id) LEFT OUTER JOIN addr ON (warehous_addr_id=addr_id) WHERE (shiphead_id=<? value("shiphead_id") ?>); detail SELECT 1 as one, coitem_linenumber, formatQty(SUM(shipitem_qty)) AS invqty, uom_name, itemsellinguom(item_id) AS shipuom, roundUp(SUM(shipitem_qty) / iteminvpricerat(item_id))::integer AS shipqty, item_number, item_descrip1, item_descrip2, formatQty(SUM(shipitem_qty) * item_prodweight) AS netweight, formatQty(SUM(shipitem_qty) * (item_prodweight + item_packweight)) AS grossweight FROM shipitem, coitem, itemsite, item, uom WHERE ((shipitem_orderitem_id=coitem_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (shipitem_shiphead_id=<? value("shiphead_id") ?>)) GROUP BY coitem_linenumber, item_number, item_id, uom_name, shipuom, item_descrip1, item_descrip2, item_prodweight, item_packweight ORDER BY coitem_linenumber; foot SELECT formatQty(SUM(shipitem_qty * item_prodweight)) AS netweight, formatQty(SUM(shipitem_qty * (item_prodweight + item_packweight))) AS grossweight FROM shipitem, coitem, itemsite, item WHERE ((shipitem_orderitem_id=coitem_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (shipitem_shiphead_id=<? value("shiphead_id") ?>)); notes SELECT shiphead_notes FROM shiphead WHERE (shiphead_id=<? value("shiphead_id") ?>); legal1 SELECT text('*If the shipment moves between two ports by carrier by water, the law requires that the Bill Of Lading shall state whether it is ''carrier''s or shipper''s weight''.\n\nNOTE: Where the rate is dependent on value, shippers are required to state specifically in writing the agreed or declared value of the property. The agreed or declared value of the property is hereby specifically stated by the shipper to be not exceeding:\n\n_________________________\n\nper ______________________') AS legal3 42 5 35 795 35 2 332 145 5 200 20 Arial 10 normal head cust_number 405 85 405 185 0 419 160 370 25 Arial 10 bold head shiphead_shipvia 100 305 300 20 Arial 10 bold head warehous_addr4 795 85 795 185 0 405 185 795 185 0 145 45 200 20 Arial 10 normal head cohead_fob 405 150 795 150 0 600 112 600 150 0 100 285 300 20 Arial 10 bold head warehous_addr3 100 190 200 20 Arial 10 bold head cohead_shiptophone 100 130 300 20 Arial 10 bold head cohead_shiptoaddress2 100 225 300 20 Arial 10 bold head warehous_descrip 145 25 100 20 Arial 10 normal head cohead_number 100 170 300 20 Arial 10 bold head shiptocitystatezip 615 125 175 25 Arial 10 bold head cohead_custponumber 100 150 300 20 Arial 10 bold head cohead_shiptoaddress3 100 265 300 20 Arial 10 bold head warehous_addr2 415 200 380 15 0 Arial 8 bold notes shiphead_notes 100 90 300 20 Arial 10 bold head cohead_shiptoname 100 245 300 20 Arial 10 bold head warehous_addr1 405 85 795 85 0 635 50 100 20 Arial 10 bold head shipdate 405 112 795 112 0 100 110 300 20 Arial 10 bold head cohead_shiptoaddress1
    detail detail 52 150 35 380 15 Arial 8 normal detail item_descrip2 540 0 120 20 Arial 10 bold detail grossweight 5 0 80 20 Arial 10 bold detail shipqty 150 20 380 15 Arial 8 normal detail item_descrip1 145 0 390 20 Arial 10 bold detail item_number
    466 5 90 795 90 0 220 80 228 80 0 560 75 570 75 0 400 90 400 245 0 5 5 5 445 0 210 220 385 220 0 220 70 228 70 0 220 55 220 65 0 600 90 600 245 0 560 65 560 75 0 560 60 570 60 0 600 135 795 135 0 560 50 570 50 0 540 5 120 25 Arial 10 bold foot grossweight 795 5 795 445 0 560 50 560 60 0 765 70 765 80 0 570 75 570 65 0 5 320 795 320 0 228 65 228 55 0 200 90 200 245 0 665 5 665 30 0 220 70 220 80 0 580 30 580 90 0 5 340 795 340 0 210 30 210 90 0 390 30 390 90 0 220 65 228 65 0 5 408 795 408 0 433 240 586 240 0 765 80 775 80 0 5 375 795 375 0 5 50 210 50 0 408 220 586 220 0 560 65 570 65 0 670 170 762 170 0 5 30 795 30 0 5 445 795 445 0 775 80 775 70 0 765 70 775 70 0 5 245 795 245 0 685 408 685 445 0 400 320 400 445 0 228 80 228 70 0 5 5 795 5 0 535 5 535 30 0 600 110 795 110 0 220 55 228 55 0 570 60 570 50 0
    qt-client-4.1.0/share/reports/UninvoicedReceipts.xml000066400000000000000000000341401217451700100225400ustar00rootroot00000000000000 Uninvoiced Receipts UninvoicedReceipts Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("agentUsername") ?> TEXT(<? value("agentUsername" ?>) <? else ?> TEXT('All Agents') <? endif ?> AS agentUsername; detail SELECT recv_id, formatDate(recv_date) as f_date, recv_trans_usr_name as f_user, recv_order_number AS f_ponumber, poitem_linenumber, vend_name, COALESCE(item_number, ('Misc. - ' || recv_vend_item_number)) AS item_number, formatQty(recv_qty) as f_qty, 'Receipt' AS f_type, recv_value AS value, formatMoney(recv_value) AS f_value FROM recv LEFT OUTER JOIN itemsite ON (recv_itemsite_id=itemsite_id) LEFT OUTER JOIN item ON (itemsite_item_id=item_id), poitem, vendinfo WHERE ((recv_orderitem_id=poitem_id) AND (recv_order_type='PO') AND (recv_vend_id=vend_id) AND (recv_posted) AND (recv_vohead_id IS NULL) AND (NOT recv_invoiced) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("agentUsername") ?> AND (recv_agent_username=<? value("agentUsername") ?>) <? endif ?> ) UNION SELECT poreject_id, formatDate(poreject_date) as f_date, poreject_trans_username as f_user, poreject_ponumber AS f_ponumber, poitem_linenumber, vend_name, COALESCE(item_number, ('Misc. - ' || poreject_vend_item_number)) AS item_number, formatQty(poreject_qty) as f_qty, 'Return' AS f_type, poreject_value *-1 AS value, formatMoney(poreject_value*-1) AS f_value FROM poreject LEFT OUTER JOIN itemsite ON (poreject_itemsite_id=itemsite_id) LEFT OUTER JOIN item ON (itemsite_item_id=item_id), poitem, vendinfo WHERE ((poreject_poitem_id=poitem_id) -- AND (poreject_itemsite_id=itemsite_id) -- AND (itemsite_item_id=item_id) AND (poreject_vend_id=vend_id) AND (poreject_posted) AND (NOT poreject_invoiced) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> <? if exists("agentUsername") ?> AND (poreject_agent_username=<? value("agentUsername") ?>) <? endif ?> ) ORDER BY f_ponumber, poitem_linenumber; 221 145 90 200 20 Arial 10 bold head warehouse 5 215 745 215 2 145 110 200 20 Arial 10 bold head agentUsername 6 29 5 20 745 20 2
    detail detail 18 85 0 80 15 Arial 8 bold detail f_user 520 0 60 15 Arial 8 bold detail f_qty 170 0 65 15 Arial 8 bold detail f_ponumber 285 0 150 15 Arial 8 bold detail vend_name 400 0 150 15 Arial 8 bold detail item_number 5 0 70 15 Arial 8 bold detail f_date 245 0 35 15 Arial 8 bold detail poitem_linenumber 590 0 60 15 Arial 8 bold detail f_type 665 0 75 15 Arial 8 bold detail f_value
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date 104 665 0 75 15 Arial 8 bold detail value qty
    qt-client-4.1.0/share/reports/UninvoicedShipments.xml000066400000000000000000000255061217451700100227420ustar00rootroot00000000000000 Uninvoiced Shipments UninvoicedShipments Letter 50 50 50 50 head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse; detail SELECT cohead_id, shipitem_id, cohead_number, coitem_linenumber, item_number, item_descrip1, item_descrip2, uom_name, shipped, formatQty(shipped) AS f_shipped, selected, formatQty(selected) AS f_selected FROM ( SELECT cohead_id, shipitem_id, cohead_number, coitem_linenumber, item_number, item_descrip1, item_descrip2, uom_name, COALESCE(SUM(shipitem_qty), 0) AS shipped, COALESCE(SUM(cobill_qty), 0) AS selected FROM cohead, itemsite, item, uom, whsinfo, shipitem, shiphead, coitem LEFT OUTER JOIN ( cobill JOIN cobmisc ON ( (cobill_cobmisc_id=cobmisc_id) AND (NOT cobmisc_posted) ) ) ON (cobill_coitem_id=coitem_id) WHERE ( (shipitem_orderitem_id=coitem_id) AND (shipitem_shiphead_id=shiphead_id) AND (coitem_cohead_id=cohead_id) AND (coitem_itemsite_id=itemsite_id) AND (coitem_qty_uom_id=uom_id) AND (itemsite_item_id=item_id) AND (itemsite_warehous_id=warehous_id) AND (shiphead_shipped) AND (NOT shipitem_invoiced) <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) GROUP BY cohead_number, coitem_id, coitem_linenumber, item_number, item_descrip1, item_descrip2, cohead_id, shipitem_id, uom_name ) AS data <? if exists("showUnselected") ?> WHERE (selected = 0) <? endif ?> ; 236 100 104 200 20 Arial 10 bold head warehouse 5 229 745 229 2 6 37 5 30 745 30 2
    detail detail 57 5 0 85 15 Arial 8 bold detail cohead_number 494 0 80 15 Arial 8 bold detail uom_name 665 0 80 15 Arial 8 bold detail f_selected 150 15 300 15 Arial 8 bold detail item_descrip1 95 0 50 15 Arial 8 bold detail coitem_linenumber 580 0 80 15 Arial 8 bold detail f_shipped 150 0 229 15 Arial 8 bold detail item_number 150 30 300 15 Arial 8 bold detail item_descrip2 5 50 745 50 0
    18 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/UnpostedGLTransactions.xml000066400000000000000000000375171217451700100233660ustar00rootroot00000000000000 Unposted G/L Transactions UnpostedGLTransactions Letter 50 50 50 50 head <? if exists("period_id") ?> SELECT formatDate(period_start, 'Earliest') AS startdate, formatDate(period_end, 'Latest') AS enddate, period_name FROM period WHERE (period_id=<? value("period_id") ?>); <? else ?> SELECT 'Earliest' AS startdate, 'Latest' AS enddate, 'All Periods' AS period_name; <? endif ?> detail SELECT gltrans_id, formatDate(gltrans_date) AS transdate, gltrans_source, gltrans_doctype, gltrans_docnumber, invhist_docnumber, firstLine(gltrans_notes) AS transnotes, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, -- Debits: CASE WHEN (gltrans_amount < 0) THEN formatMoney(ABS(gltrans_amount)) ELSE '' END AS f_debit, CASE WHEN (gltrans_amount < 0) THEN ABS(gltrans_amount) ELSE 0 END AS debit_amt, --Credits: CASE WHEN (gltrans_amount > 0) THEN formatMoney(gltrans_amount) ELSE '' END AS f_credit, CASE WHEN (gltrans_amount > 0) THEN gltrans_amount ELSE 0 END AS credit_amt, --Balance: gltrans_amount * -1 as balance_amt -- FROM period, gltrans JOIN accnt ON (gltrans_accnt_id=accnt_id) LEFT OUTER JOIN invhist ON (gltrans_misc_id=invhist_id AND gltrans_docnumber='Misc.') WHERE (NOT gltrans_posted AND (NOT gltrans_deleted) AND (gltrans_date BETWEEN period_start AND period_end) <? if exists("period_id") ?> AND (period_id=<? value("period_id") ?>) <? endif ?> ) ORDER BY gltrans_created, gltrans_sequence, gltrans_amount; 205 545 70 200 20 Arial 10 bold head startdate 140 70 290 20 Arial 10 bold head period_name 545 90 200 20 Arial 10 bold head enddate 0 200 1000 200 2 5 45 0 40 1000 40 2
    detail detail 31 310 0 270 15 Arial 8 bold detail account 12500 0 80 15 Arial 8 bold detail gltrans_doctype 208 15 95 15 Arial 8 bold detail invhist_docnumber 0 0 60 15 Arial 8 bold detail transdate 125 0 100 15 Arial 8 bold detail gltrans_doctype 204 0 100 15 Arial 8 bold detail gltrans_docnumber 310 15 265 15 Arial 8 bold detail transnotes 720 0 80 15 Arial 8 bold detail f_credit 65 0 60 15 Arial 8 bold detail gltrans_source 605 0 80 15 Arial 8 bold detail f_debit
    75 835 25 105 14 Arial 8 bold detail balance_amt money 605 5 1015 5 2 960 60 40 15 Arial 8 bold Context Query page_number 90 60 100 15 Arial 8 bold Context Query report_date 720 25 105 14 Arial 8 bold detail credit_amt money 605 25 105 14 Arial 8 bold detail debit_amt money 15 960 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/UnpostedGlSeries.xml000066400000000000000000000234711217451700100222020ustar00rootroot00000000000000 Unposted G/L Series Transactions UnpostedGlSeries Letter 50 50 50 50 detail SELECT *, glseries_sequence, (formatGLAccount(glseries_accnt_id) || ' - ' || accnt_descrip) AS account, CASE WHEN (glseries_amount < 0) THEN formatMoney(glseries_amount * -1) ELSE '' END AS debit, CASE WHEN (glseries_amount >= 0) THEN formatMoney(glseries_amount) ELSE '' END AS credit FROM glseries, accnt WHERE (glseries_accnt_id=accnt_id) ORDER BY glseries_distdate, glseries_sequence, glseries_amount; 75 5 70 745 70 2 11 51 5 40 740 40 2
    detail glseries_sequence glseries_sequence 11 10 0 40 0 0 detail 21 610 0 150 11 0 Arial 8 bold detail glseries_notes 95 0 45 15 Arial 8 bold detail glseries_source 310 0 130 15 Arial 8 bold detail account 0 0 90 15 Arial 8 bold detail glseries_distdate 530 0 70 11 Arial 8 bold detail credit 450 0 70 11 Arial 8 bold detail debit 200 0 100 15 Arial 8 bold detail glseries_docnumber 145 0 45 15 Arial 8 bold detail glseries_doctype
    15 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/UnpostedPoReceipts.xml000066400000000000000000000272121217451700100225370ustar00rootroot00000000000000 Unposted Purchase Order Receipts UnpostedPoReceipts Letter 50 50 50 50 detail SELECT recv_id, recv_orderitem_id, recv_order_number, recv_order_type, orderhead_from, orderitem_linenumber, formatDate(recv_duedate) AS recv_duedate, warehous_code, COALESCE(item_number, <? value("nonInventory") ?>) AS item_number, COALESCE(uom_name, <? value("na") ?>) AS uom_name, recv_vend_item_number, recv_vend_uom, formatQty(orderitem_qty_ordered) AS qty_ordered, formatQty(orderitem_qty_received) AS qty_received, formatQty(recv_qty) AS recv_qty, formatDate(recv_date) AS recv_date, formatDate(COALESCE(recv_gldistdate, recv_date)) AS recv_gldistdate FROM orderhead JOIN orderitem ON ((orderitem_orderhead_id=orderhead_id) AND (orderitem_orderhead_type=orderhead_type)) JOIN recv ON ((recv_orderitem_id=orderitem_id) AND (recv_order_type=orderitem_orderhead_type)) LEFT OUTER JOIN (itemsite JOIN item ON (itemsite_item_id=item_id) JOIN uom ON (item_inv_uom_id=uom_id) JOIN site() ON (itemsite_warehous_id=warehous_id) ) ON (recv_itemsite_id=itemsite_id) LEFT OUTER JOIN vendinfo ON (orderhead_type='PO' AND orderhead_from_id=vend_id) WHERE (NOT recv_posted) ORDER BY orderhead_from, recv_order_number, orderitem_linenumber; 76 5 70 745 70 2
    detail ponumber recv_order_number 51 100 0 27 15 Arial 8 bold detail recv_order_type 100 15 200 15 Arial 8 bold detail orderhead_from 135 0 100 15 Arial 8 bold detail recv_order_number detail 21 685 0 80 15 Arial 8 bold detail recv_date 130 0 100 15 Arial 8 normal detail item_number 395 0 40 15 Arial 8 normal detail recv_vend_uom 0 0 35 15 Arial 8 bold detail orderitem_linenumber 285 0 100 15 Arial 8 normal detail recv_vend_item_number 520 0 70 15 Arial 8 normal detail qty_received 40 0 80 15 Arial 8 bold detail recv_duedate 240 0 40 15 Arial 8 normal detail uom_name 600 0 75 15 Arial 8 bold detail recv_qty 440 0 70 15 Arial 8 normal detail qty_ordered
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/UnpostedReturnsForPO.xml000066400000000000000000000267311217451700100230370ustar00rootroot00000000000000 Unposted Returns For Purchase Order UnpostedReturnsForPO Letter 100 100 50 50 address select formatAddr(<? value("addr_id") ?>) AS f_addr; detail SELECT poitem_linenumber, COALESCE(item_number, 'Non-Inventory') AS item_number, COALESCE(uom_name, 'N/A') AS uom_name, poitem_vend_item_number, poitem_vend_uom, formatQty(poitem_qty_ordered) AS f_poitem_qty_ordered, formatQty(poitem_qty_received) AS f_poitem_qty_received, formatQty(poitem_qty_returned) AS f_poitem_qty_returned, formatQty(SUM(COALESCE(poreject_qty, 0))) AS f_poreject_qty, rjctcode_code FROM poreject LEFT OUTER JOIN rjctcode ON (poreject_rjctcode_id=rjctcode_id), poitem LEFT OUTER JOIN ( itemsite JOIN item ON (itemsite_item_id=item_id) JOIN uom ON (item_inv_uom_id=uom_id) ) ON (poitem_itemsite_id=itemsite_id) WHERE ((poreject_poitem_id=poitem_id) AND (NOT poreject_posted) AND (poitem_pohead_id=<? value("pohead_id") ?>)) GROUP BY poitem_linenumber, item_number, uom_name, poitem_vend_item_number, poitem_vend_uom, poitem_qty_ordered, poitem_qty_received, poitem_qty_returned, rjctcode_code ORDER BY poitem_linenumber; pohead SELECT * FROM pohead, vendinfo WHERE ((pohead_vend_id=vend_id) AND (pohead_id=<? value("pohead_id") ?>)); logo SELECT image_data FROM image WHERE ((image_name='logo')); 127 5 5 155 95 stretch logo image_data 0 113 740 113 2
    Address address 23 60 0 500 18 11 Arial 10 bold address f_addr
    POHead pohead 107 100 41 100 11 Arial 8 bold pohead vend_number 100 30 100 11 Arial 8 bold pohead pohead_number 0 95 740 95 0
    detail detail 42 355 0 85 11 Arial 8 bold detail f_poitem_qty_received 200 0 100 11 Arial 8 bold detail poitem_vend_item_number 570 0 85 11 Arial 8 bold detail f_poreject_qty 45 15 645 11 1 Arial 8 bold detail rjctcode_code 310 0 40 11 Arial 8 bold detail poitem_vend_uom 1 0 35 11 Arial 8 bold detail poitem_linenumber 459 0 90 11 Arial 8 bold detail f_poitem_qty_returned 150 0 40 11 Arial 8 bold detail uom_name 40 0 100 11 Arial 8 bold detail item_number
    23 90 0 100 11 Arial 8 normal Context Query report_date 700 0 40 11 Arial 8 normal Context Query page_number
    qt-client-4.1.0/share/reports/UnpostedVouchers.xml000066400000000000000000000223141217451700100222560ustar00rootroot00000000000000 Unposted Vouchers UnpostedVouchers 0.05 0.05 Letter 50 50 50 50 detail openVouchers populate 78 3.66667 74 743.667 74 2 6 41 5 35 745 35 2
    detail detail orderid detail 17 650 2 90 15 Arial 8 bold detail f_amount 400 2 80 15 Arial 8 bold detail vohead_invcnumber 90 2 50 15 Arial 8 bold detail ponumber 5 2 80 15 Arial 8 bold detail vohead_number 490 2 80 15 Arial 8 bold detail f_distdate 310 2 80 15 Arial 8 bold detail vendtype_code 570 2 80 15 Arial 8 bold detail f_postdate 150 2 150 15 Arial 8 bold detail vendor
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/UnusedPurchasedItems.xml000066400000000000000000000247321217451700100230500ustar00rootroot00000000000000 Unused Purchased Items UnusedPurchasedItems Letter 50 50 50 50 head SELECT <? if exists("classcode_id") ?> ( SELECT (classcode_code||'-'||classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) <? else ?> text('All Class Codes') <? endif ?> AS classcode, <? if exists("includeUncontrolledItems") ?> text('Showing Uncontrolled Items') <? else ?> text('') <? endif ?> AS lbl_showuncontrolled detail SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2, uom_name, formatQty(SUM(itemsite_qtyonhand)) AS f_qoh, formatDate(MAX(itemsite_datelastcount), 'Never') AS f_lastcntd, formatDate(MAX(itemsite_datelastused), 'Never') AS f_lastused FROM item, itemsite, uom WHERE ((itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (item_id NOT IN (SELECT DISTINCT bomitem_item_id FROM bomitem)) AND (NOT item_sold) AND (item_type IN ('P', 'O')) <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? elseif exists("classcode_pattern") ?> AND (item_classcode_id IN (SELECT classcode_id FROM classcode WHERE (classcode_code ~ <? value("classcode_pattern") ?>))) <? endif ?> <? if not exists("includeUncontrolledItems") ?> AND (itemsite_controlmethod <> 'N') <? endif ?> ) GROUP BY item_id, item_number, uom_name, item_descrip1, item_descrip2 ORDER BY item_number; 236 130 120 300 20 Arial 10 bold head classcode 440 120 300 20 Arial 10 bold head lbl_showuncontrolled 5 229 745 229 2 6 37 5 30 745 31 2
    detail detail 51 509 0 80 15 Arial 8 bold detail f_lastused 5 45 745 45 0 425 0 80 15 Arial 8 bold detail f_lastcntd 15 0 200 15 Arial 8 bold detail item_number 15 15 300 15 Arial 8 bold detail item_descrip1 320 0 80 15 Arial 8 bold detail f_qoh 225 0 80 15 Arial 8 bold detail uom_name 15 30 300 15 Arial 8 bold detail item_descrip2
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/UsageStatistics.xml000066400000000000000000000246721217451700100220660ustar00rootroot00000000000000 Item Usage Statistics UsageStatistics 0.05 0.05 Letter 50 50 50 50 detail usageStatistics detail 221 5 215 745 215 2 10 38 725 15 12 Arial 10 bold Parameter Query filter 6 36 5 30 745 30 2
    detail detail 37 425 0 75 15 Arial 8 bold detail f_sold 10 0 35 15 Arial 8 bold detail warehous_code 3 31 743 31 0 665 0 75 15 Arial 8 bold detail f_transfer 505 0 75 15 Arial 8 bold detail f_scrap 585 0 75 15 Arial 8 bold detail f_adjust 345 0 75 15 Arial 8 bold detail f_issued 65 15 250 15 Arial 8 bold detail itemdescrip 65 0 185 15 Arial 8 bold detail item_number 260 0 75 15 Arial 8 bold detail f_received
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/UsersMasterList.xml000066400000000000000000000202451217451700100220500ustar00rootroot00000000000000 Users Master List UsersMasterList Letter 50 50 50 50 detail select usr_username, usr_propername, usr_initials, formatBoolYN(usr_active) AS f_active, formatBoolYN(usr_agent) AS f_pa, locale_code FROM usr, locale WHERE ((usr_locale_id=locale_id) <? if not exists("showInactive") ?> AND (usr_active=true) <? endif ?> ) ORDER BY usr_username; 76 5 70 745 70 2 6 36 5 30 745 30 2
    detail detail 16 434 0 50 15 Arial 8 bold detail f_pa 114 0 50 15 Arial 8 bold detail f_active 375 0 50 15 Arial 8 bold detail usr_initials 170 0 200 15 Arial 8 bold detail usr_propername 10 0 100 15 Arial 8 bold detail usr_username 500 0 100 15 Arial 8 bold detail locale_code
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/ValidLocationsByItem.xml000066400000000000000000000224351217451700100227670ustar00rootroot00000000000000 Valid Locations By Item ValidLocationsByItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse FROM item WHERE (item_id=<? value("item_id") ?>); detail SELECT warehous_code, formatLocationName(location_id) AS locationname, firstLine(location_descrip) as f_descrip, formatBoolYN(location_restrict) AS restricted, formatBoolYN(location_netable) AS netable FROM itemsite, location, whsinfo WHERE ((validLocation(location_id, itemsite_id)) AND ((itemsite_loccntrl) OR (itemsite_location_id=location_id)) AND (itemsite_item_id=<? value("item_id") ?>) AND (itemsite_warehous_id=warehous_id) <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY warehous_code, locationname; 221 100 120 300 20 Arial 10 bold head item_descrip2 100 80 200 20 Arial 10 bold head item_number 100 145 200 20 Arial 10 bold head warehouse 100 100 300 20 Arial 10 bold head item_descrip1 5 215 745 215 2 6 21 5 15 745 15 2
    detail detail 16 10 0 45 15 Arial 8 bold detail warehous_code 640 0 80 15 Arial 8 bold detail netable 555 0 80 15 Arial 8 bold detail restricted 70 0 150 15 Arial 8 bold detail locationname 235 0 310 15 Arial 8 bold detail f_descrip
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/VendorAPHistory.xml000066400000000000000000000343171217451700100220040ustar00rootroot00000000000000 Vendor AP History VendorAPHistory Letter 50 50 50 50 head SELECT vend_number, vend_name, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate FROM vendinfo WHERE (vend_id=<? value("vend_id") ?>); detail SELECT 1 AS type, apopen_id, -1 AS applyid, apopen_docdate AS sortdate, apopen_docnumber AS sortnumber, apopen_docnumber AS docnumber, formatBoolYN(apopen_open) AS f_open, CASE WHEN (apopen_doctype='V') THEN text('Voucher') WHEN (apopen_doctype='C') THEN text('C/M') WHEN (apopen_doctype='D') THEN text('D/M') ELSE text('Other') END AS documenttype, apopen_invcnumber AS invoicenumber, apopen_ponumber AS ponumber, formatDate(apopen_docdate) AS f_docdate, formatDate(apopen_duedate) AS f_duedate, formatMoney(apopen_amount) AS f_amount, formatMoney((apopen_amount - apopen_paid)) AS f_balance FROM apopen WHERE ( (apopen_vend_id=<? value("vend_id") ?>) AND (apopen_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) ) UNION SELECT 2 AS type, apopen_id, apapply_source_apopen_id AS applyid, apopen_docdate AS sortdate, apopen_docnumber AS sortnumber, apapply_source_docnumber AS docnumber, '' AS f_open, CASE WHEN (apapply_source_doctype='C') THEN text('C/M') WHEN (apapply_source_doctype='K') THEN text('Check') ELSE text('Other') END AS documenttype, '' AS invoicenumber, '' AS ponumber, formatDate(apapply_postdate) AS f_docdate, '' AS f_duedate, formatMoney(apapply_amount) AS f_amount, '' AS f_balance FROM apapply, apopen WHERE ( (apapply_target_apopen_id=apopen_id) AND (apapply_vend_id=<? value("vend_id") ?>) AND (apopen_vend_id=<? value("vend_id") ?>) AND (apopen_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) ) UNION SELECT 3 AS type, apopen_id, apapply_target_apopen_id AS applyid, apopen_docdate AS sortdate, apopen_docnumber AS sortnumber, apapply_target_docnumber AS docnumber, '' AS f_open, CASE WHEN (apapply_target_doctype='V') THEN text('Voucher') WHEN (apapply_target_doctype='D') THEN text('D/M') ELSE text('Other') END AS documenttype, apopen_invcnumber AS invoicenumber, '' AS ponumber, formatDate(apapply_postdate) AS f_docdate, '' AS f_duedate, formatMoney(apapply_amount) AS f_amount, '' AS f_balance FROM apapply, apopen WHERE ( (apapply_source_doctype IN ('C', 'K')) AND (apapply_source_doctype=apopen_doctype) AND (apapply_source_docnumber=apopen_docnumber) AND (apapply_vend_id=<? value("vend_id") ?>) AND (apopen_vend_id=<? value("vend_id") ?>) AND (apopen_docdate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) ) ORDER BY sortdate, apopen_id, type; 162 550 85 100 20 Arial 10 bold head enddate 95 65 150 20 Arial 10 bold head vend_number 5 155 745 155 2 95 85 300 20 Arial 10 bold head vend_name 550 65 100 20 Arial 10 bold head startdate 6 21 5 15 745 14 2
    detail detail 17 400 0 80 15 Arial 8 bold detail f_docdate 570 0 80 15 Arial 8 bold detail f_amount 655 0 90 15 Arial 8 bold detail f_balance 315 0 80 15 Arial 8 bold detail ponumber 60 0 80 15 Arial 8 bold detail documenttype 485 0 80 15 Arial 8 bold detail f_duedate 5 0 50 15 Arial 8 bold detail f_open 145 0 80 15 Arial 8 bold detail docnumber 230 0 80 15 Arial 8 bold detail invoicenumber
    17 705 0 40 15 Arial 8 bold Context Query page_number 104 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/VendorAddressList.xml000066400000000000000000000157541217451700100223470ustar00rootroot00000000000000 Vendor Address List VendorAddressList Letter 50 50 50 50 head SELECT vend_number, vend_name FROM vendinfo WHERE (vend_id=<? value("vend_id") ?>); detail SELECT vendaddr_code as num, vendaddr_name as name, addr_line1 AS address, (addr_city || ', ' || addr_state || ' ' || addr_postalcode) AS citystatezip FROM vendaddrinfo LEFT OUTER JOIN addr ON (vendaddr_addr_id=addr_id) WHERE (vendaddr_vend_id=<? value("vend_id") ?>) ORDER BY vendaddr_code; 171 135 70 300 20 Arial 10 bold head vend_number 5 165 745 165 2 135 90 300 20 Arial 10 bold head vend_name 6 21 5 15 745 15 2
    detail detail 17 5 0 50 15 Arial 8 bold detail num 65 0 200 15 Arial 8 bold detail name 545 0 200 15 Arial 8 bold detail citystatezip 270 0 250 15 Arial 8 bold detail address
    17 705 0 40 15 Arial 8 bold Context Query page_number 105 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/VendorInformation.xml000066400000000000000000000427661217451700100224160ustar00rootroot00000000000000 Vendor Information VendorInformation 0.05 0.05 Letter 50 50 50 50 head SELECT vend_name, vend_vendtype_id, vend_terms_id, vend_shipvia, vend_active, vend_cntct1_id, vend_cntct2_id, crmacct_id, vend_number, MIN(pohead_orderdate) AS minpodate, MAX(pohead_orderdate) AS maxpodate, formatMoney(SUM(currToBase(pohead_curr_id, (poitem_qty_ordered - poitem_qty_received) * poitem_unitprice, CURRENT_DATE))) AS backlog , c1.cntct_first_name || ' ' || c1.cntct_last_name AS contact1_name, c1.cntct_phone AS contact1_phone, c1.cntct_phone2 AS contact1_phone, formataddr(a1.addr_id) AS contact1_address, c1.cntct_fax as contact1_fax, c1.cntct_email AS contct1_email, c2.cntct_first_name || ' ' || c2.cntct_last_name AS contact2_name, c2.cntct_phone AS contact2_phone, c2.cntct_phone2 AS contact2_phone, c2.cntct_fax as contact2_fax, c2.cntct_email AS contct2_email, formataddr(a2.addr_id) AS contact2_address, vend_comments FROM vendinfo LEFT OUTER JOIN cntct c1 ON (vend_cntct1_id = c1.cntct_id) LEFT OUTER JOIN addr a1 ON (c1.cntct_addr_id = a1.addr_id) LEFT OUTER JOIN cntct c2 ON (vend_cntct2_id = c2.cntct_id) LEFT OUTER JOIN addr a2 ON (c2.cntct_addr_id = a2.addr_id) LEFT OUTER JOIN pohead ON (pohead_vend_id=vend_id) LEFT OUTER JOIN poitem ON (poitem_pohead_id=pohead_id AND poitem_status='O') JOIN crmacct ON (crmacct_vend_id=vend_id) WHERE (vend_id=<? value("vend_id") ?>) GROUP BY vend_name, vend_vendtype_id, vend_terms_id, vend_shipvia, vend_active,vend_cntct1_id, vend_cntct2_id, crmacct_id, c1.cntct_first_name, c1.cntct_last_name, c1.cntct_phone, c1.cntct_phone2, a1.addr_id,c1.cntct_fax, c1.cntct_email, c2.cntct_first_name,c2.cntct_last_name , c2.cntct_phone, c2.cntct_phone2, c2.cntct_fax, c2.cntct_email,a2.addr_id, vend_comments, vend_number; lypurch SELECT formatMoney(SUM(currToBase(vohead_curr_id, vohead_amount, vohead_gldistdate))) AS purchases FROM vohead WHERE (vohead_posted AND (vohead_gldistdate BETWEEN (DATE_TRUNC('year', CURRENT_DATE) - INTERVAL '1 year') AND (DATE_TRUNC('year', CURRENT_DATE) - INTERVAL '1 day')) AND (vohead_vend_id=<? value("vend_id") ?>)); ytdpurch SELECT formatMoney(SUM(currToBase(vohead_curr_id, vohead_amount, vohead_gldistdate))) AS purchases FROM vohead WHERE (vohead_posted AND (vohead_gldistdate BETWEEN (DATE_TRUNC('year', CURRENT_DATE)) AND (CURRENT_DATE - INTERVAL '1 day')) AND (vohead_vend_id=<? value("vend_id") ?>)); backlog SELECT formatMoney( COALESCE( SUM( (noNeg(coitem_qtyord - coitem_qtyshipped + coitem_qtyreturned) * coitem_qty_invuomratio) * (coitem_price / coitem_price_invuomratio) ), 0 ) ) AS backlog FROM cohead, coitem, itemsite, item WHERE ( (coitem_cohead_id=cohead_id) AND (coitem_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (coitem_status='O') AND (cohead_cust_id=<? value("cust_id") ?>) ); OpenBalance SELECT formatMoney(COALESCE(SUM((apopen_amount-apopen_paid) / apopen_curr_rate * CASE WHEN (apopen_doctype IN ('D','V')) THEN 1 ELSE -1 END), 0.0)) AS balance FROM apopen WHERE ((apopen_open) AND (apopen_vend_id=<? value("vend_id") ?>)); podate SELECT formatDate(MIN(pohead_orderdate)) AS firstpodate, formatDate(MAX(pohead_orderdate)) AS lastpodate FROM pohead WHERE (pohead_vend_id=<? value("vend_id") ?>) 392 105 368 575 15 0 Arial 8 bold head vend_comments 134 305 100 15 Arial 8 bold podate firstpodate 370 160 370 295 0 5 155 360 155 0 99.8 229 260 15 Arial 8 bold head contact1_name 100 260 260 15 Arial 8 bold head contact1_fax 474 229 260 15 Arial 8 bold head contact2_name 5 295 740 295 2 400 305 145 15 Arial 8 bold lypurch purchases 475 275 260 15 Arial 8 bold head contact2_email 100 275 260 15 Arial 8 bold head contact1_email 475 260 260 15 Arial 8 bold head contact2_fax 100 75 295 20 Arial 10 bold head vend_name 400 325 145 15 Arial 8 bold ytdpurch purchases 475 245 260 15 Arial 8 bold head contact2_phone 380 155 735 155 0 130 344.893 103 15 Arial 8 bold head backlog 100 245 260 15 Arial 8 bold head contact1_phone 130 325 105 15 Arial 8 bold podate lastpodate 410 345 134.643 15 Arial 8 bold OpenBalance balance 100 95 200 20 Arial 10 bold head vend_number 21 163 341 12 0 Arial 8 bold head contact1_address 399 164 333 12 0 Arial 8 bold head contact2_address 18 95 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number qt-client-4.1.0/share/reports/VendorMasterList.xml000066400000000000000000000155551217451700100222140ustar00rootroot00000000000000 Vendor Master List VendorMasterList 0.05 0.05 Letter 50 50 50 50 detail vendors detail 153 8 149 748 149 2 10 43 725 15 12 Arial 10 bold Parameter Query filter 6 36 5 30 745 30 2
    detail detail 91 175 30 565 15 Arial 8 bold detail addr_line2 515 60 204 15 Arial 8 bold detail addr_zip 175 0 565 15 Arial 8 bold detail vend_name 175 15 565 15 Arial 8 bold detail addr_line1 175 60 204 15 Arial 8 bold detail addr_city 10 0 150 15 Arial 8 bold detail vend_number 175 45 565 15 Arial 8 bold detail addr_line3 370 60 140 15 Arial 8 bold detail addr_state
    21 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/VendorTypesMasterList.xml000066400000000000000000000101371217451700100232300ustar00rootroot00000000000000 Vendor Types Master List VendorTypesMasterList Letter 50 50 50 50 detail SELECT vendtype_id, vendtype_code, vendtype_descrip FROM vendtype ORDER BY vendtype_code; 76 5 70 745 70 2 6 21 5 15 745 15 2
    detail detail 16 175 0 565 15 Arial 8 bold detail vendtype_descrip 10 0 150 15 Arial 8 bold detail vendtype_code
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/ViewAPCheckRunEditList.xml000066400000000000000000000354041217451700100231620ustar00rootroot00000000000000 View Check Run Edit List ViewAPCheckRunEditList Letter 50 50 50 50 detail SELECT CASE WHEN checkhead_void THEN 0 ELSE checkhead_amount END AS amt_check, CASE WHEN checkhead_void THEN 0 ELSE currToBase(checkhead_curr_id,checkhead_amount, checkhead_checkdate) END AS base_amt_check, checkhead_id AS primaryid, -1 AS secondaryid, formatBoolYN(checkhead_void) AS f_void, formatBoolYN(checkhead_printed) AS f_printed, TEXT(checkhead_number) AS number, (checkrecip_number || '-' || checkrecip_name) AS description, formatDate(checkhead_checkdate) AS f_checkdate, formatMoney(checkhead_amount) AS f_amount, formatMoney(currtobase(checkhead_curr_id,checkhead_amount,checkhead_checkdate)) AS f_baseamount, currconcat(checkhead_curr_id) AS currAbbr, checkhead_number, 1 AS orderby FROM checkhead LEFT OUTER JOIN checkrecip ON ((checkrecip_id=checkhead_recip_id) AND (checkrecip_type=checkhead_recip_type)) WHERE ((checkhead_bankaccnt_id=<? value("bankaccnt_id") ?>) AND (NOT checkhead_posted) AND (NOT checkhead_replaced) AND (NOT checkhead_deleted) <? if exists("vend_id") ?> AND (checkrecip_type='V') AND (checkrecip_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> AND (checkrecip_type='V') AND (checkrecip_id IN (SELECT vend_id FROM vendinfo WHERE (vend_vendtype_id=<? value("vendtype_id") ?>))) <? elseif exists("vendtype_pattern") ?> AND (checkrecip_type='V') AND (checkrecip_id IN (SELECT vend_id FROM vendinfo, vendtype WHERE ((vend_vendtype_id=vendtype_id) AND (vendtype_code ~ <? value("vendtype_pattern") ?>)))) <? endif ?> ) UNION SELECT 0 AS amt_check, 0 AS base_amt_check, checkitem_checkhead_id AS primaryid, checkitem_id AS secondaryid, '' AS f_void, '' AS f_printed, CASE WHEN (checkitem_ranumber IS NOT NULL) THEN checkitem_ranumber::TEXT ELSE checkitem_vouchernumber END AS number, CASE WHEN (checkitem_cmnumber IS NOT NULL) THEN checkitem_cmnumber::TEXT ELSE checkitem_invcnumber END AS description, '' AS f_checkdate, formatMoney(checkitem_amount) AS f_amount, formatMoney(currtobase(checkitem_curr_id,checkitem_amount,checkhead_checkdate)) AS f_baseamount, currconcat(checkitem_curr_id) AS currAbbr, checkhead_number, 2 AS orderby FROM checkitem, checkhead WHERE ( (checkitem_checkhead_id=checkhead_id) AND (checkhead_bankaccnt_id=<? value("bankaccnt_id") ?>) AND (NOT checkhead_posted) AND (NOT checkhead_replaced) AND (NOT checkhead_deleted) <? if exists("vend_id") ?> AND (checkhead_recip_type='V') AND (checkhead_recip_id=<? value("vend_id") ?>) <? elseif exists("vendtype_id") ?> AND (checkhead_recip_type='V') AND (checkhead_recip_id IN (SELECT vend_id FROM vendinfo WHERE (vend_vendtype_id=<? value("vendtype_id") ?>))) <? elseif exists("vendtype_pattern") ?> AND (checkhead_recip_type='V') AND (checkhead_recip_id IN (SELECT vend_id FROM vendinfo, vendtype WHERE ((vend_vendtype_id=vendtype_id) AND (vendtype_code ~ <? value("vendtype_pattern") ?>)))) <? endif ?> ) ORDER BY checkhead_number, primaryid, orderby; head SELECT (bankaccnt_name || '-' || bankaccnt_descrip) AS bankaccnt FROM bankaccnt WHERE (bankaccnt_id=<? value("bankaccnt_id") ?>); 127 5 112 745 112 2 145 55 350 20 Arial 10 bold head bankaccnt 11 28 5 20 745 20 2
    detail detail orderid detail 21 130 0 100 15 Arial 8 bold detail number 585 0 53 15 Arial 8 bold detail currAbbr 5 0 55 15 Arial 8 bold detail f_void 65 0 55 15 Arial 8 bold detail f_printed 465 0 75 15 Arial 8 bold detail f_checkdate 245 0 200 15 Arial 8 bold detail description 645 0 100 15 Arial 8 bold detail f_amount
    21 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number 61 645 5 100 15 Arial 8 bold detail amt_check qty 645 20 100 15 Arial 8 bold detail base_amt_check qty 567 2 745 2 2
    qt-client-4.1.0/share/reports/VoucherRegister.xml000066400000000000000000000344121217451700100220600ustar00rootroot00000000000000 Voucher Register VoucherRegister Letter 50 50 50 50 head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate, <? if exists("accnt_id") ?> ( SELECT (accnt_number || '-' || accnt_descrip) FROM accnt WHERE (accnt_id=<? value("accnt_id") ?>) ) <? else ?> text('All Accounts') <? endif ?> AS accnt, <? if exists("showUsernames") ?> text('Username') <? else ?> text('') <? endif ?> AS f_username detail SELECT gltrans_id, formatDate(gltrans_date) AS transdate, vend_number, vend_name, gltrans_doctype, gltrans_docnumber, firstLine(gltrans_notes) AS transnotes, (formatGLAccount(accnt_id) || ' - ' || accnt_descrip) AS account, CASE WHEN (gltrans_amount < 0) THEN formatMoney(ABS(gltrans_amount)) ELSE '' END AS f_debit, CASE WHEN (gltrans_amount > 0) THEN formatMoney(gltrans_amount) ELSE '' END AS f_credit, <? if exists("showUsernames") ?> gltrans_username <? else ?> text('') <? endif ?> AS f_username FROM accnt, gltrans LEFT OUTER JOIN vohead JOIN vendinfo ON (vohead_vend_id=vend_id) ON (gltrans_doctype='VO' and gltrans_docnumber=vohead_number) WHERE ((gltrans_accnt_id=accnt_id) AND (gltrans_date BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) <? if exists("accnt_id") ?> AND (gltrans_accnt_id=<? value("accnt_id") ?>) <? endif ?> AND (gltrans_source='A/P') ) ORDER BY gltrans_created DESC, gltrans_sequence, gltrans_amount; 221 545 70 200 20 Arial 10 bold head startdate 5 215 745 215 2 670 170 80 15 Arial 8 normal head f_username 545 90 200 20 Arial 10 bold head enddate 140 70 290 20 Arial 10 bold head accnt 6 56 670 5 80 15 Arial 8 normal head f_username 5 50 745 50 2
    detail detail 46 245 0 260 15 Arial 8 bold detail transnotes 15 30 80 15 Arial 8 bold detail vend_number 245 15 260 15 Arial 8 bold detail account 160 0 80 15 Arial 8 bold detail gltrans_doctype 10 0 80 15 Arial 8 bold detail transdate 510 30 80 15 Arial 8 bold detail f_debit 105 30 265 15 Arial 8 bold detail vend_name 595 30 80 15 Arial 8 bold detail f_credit 620 0 120 15 Arial 8 bold detail f_username 160 15 80 15 Arial 8 bold detail gltrans_docnumber
    18 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/WOHistoryByClassCode.xml000066400000000000000000000342301217451700100227210ustar00rootroot00000000000000 Work Order History By Class Code WOHistoryByClassCode 0.05 0.05 Letter 50 50 50 50 Detail workOrderHistory detail head SELECT <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("classcode_id") ?> ( SELECT (classcode_code||'-'||classcode_descrip) FROM classcode WHERE (classcode_id=<? value("classcode_id") ?>) ) <? elseif exists("classcode_pattern") ?> text(<? value("classcode_pattern") ?>) <? else ?> text('All Class Codes') <? endif ?> AS classcode, <? if exists("showOnlyTopLevel") ?> text('Only Show Top level Work Orders') <? else ?> text('') <? endif ?> AS lbl_toplevel, <? if exists("showCosts") ?> text('Cost') <? else ?> text('') <? endif ?> AS lbl_cost ; 172 5 165 740 165 2 135 85 170 20 Arial 10 bold head classcode 365 85 355 20 Arial 10 bold head lbl_toplevel 135 105 170 20 Arial 10 bold head warehouse 665 151 70 15 Arial 8 normal head lbl_cost 7 32 5 25 740 25 2 660 8 70 15 Arial 8 normal head lbl_cost
    detail Detail 52 5 0 40 15 Arial 8 bold Detail wonumber 85 0 40 15 Arial 8 bold Detail warehous_code 509 0 80 15 Arial 8 bold Detail f_wo_duedate 45 0 40 15 Arial 8 bold Detail wo_status 125 0 100 15 Arial 8 bold Detail item_number 229 0 40 15 Arial 8 bold Detail uom_name 125 30 300 15 Arial 8 bold Detail item_descrip2 670 0 70 15 Arial 8 bold Detail f_wo_postedvalue 270 0 80 15 Arial 8 bold Detail f_wo_qtyord 125 15 300 15 Arial 8 bold Detail item_descrip1 350 0 80 15 Arial 8 bold Detail f_wo_qtyrcv 5 45 740 45 0 430 0 80 15 Arial 8 bold Detail f_wo_startdate
    17 95 0 113 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/WOHistoryByItem.xml000066400000000000000000000343061217451700100217630ustar00rootroot00000000000000 Work Order History by Item WOHistoryByItem Letter 50 50 50 50 Detail SELECT formatWONumber(wo_id) AS wonumber, wo_status, warehous_code, formatQty(wo_qtyord) AS ordered, formatQty(wo_qtyrcv) AS received, formatDate(wo_startdate) AS startdate, formatDate(wo_duedate) AS duedate, <? if exists("showCosts") ?> formatCost(wo_postedvalue) <? else ?> text('') <? endif ?> AS value FROM wo, itemsite, whsinfo WHERE ((wo_itemsite_id=itemsite_id) AND (itemsite_warehous_id=warehous_id) AND (itemsite_item_id=<? value("item_id") ?>) <? if exists("showOnlyTopLevel") ?> AND ((wo_ordtype<>'W') OR (wo_ordtype IS NULL)) <? endif ?> <? if exists("warehous_id") ?> AND (itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> AND (wo_duedate BETWEEN <? value("startDate") ?> AND <? value("endDate") ?>) ) ORDER BY wo_startdate DESC, wo_number, wo_subnumber; head SELECT item_number, item_descrip1, item_descrip2, <? if exists("warehous_id") ?> (SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>)) <? else ?> text('All Sites') <? endif ?> AS warehouse, <? if exists("showOnlyTopLevel") ?> text('Only Show Top Level Work Orders') <? else ?> text('') <? endif ?> AS lbl_toplevel, <? if exists("showCosts") ?> text('Cost') <? else ?> text('') <? endif ?> AS lbl_cost, formatDate(<? value("startDate") ?>, 'Earliest') AS startdate, formatDate(<? value("endDate") ?>, 'Latest') AS enddate FROM item WHERE (item_id=<? value("item_id") ?>); 191 135 85 300 20 Arial 10 bold head item_descrip1 550 85 150 20 Arial 10 bold head enddate 445 105 250 20 Arial 10 bold head lbl_toplevel 550 65 150 20 Arial 10 bold head startdate 135 105 300 20 Arial 10 bold head item_descrip2 5 185 740 185 2 135 125 150 20 Arial 10 bold head warehouse 135 65 305 20 Arial 10 bold head item_number 660 170 80 15 Arial 8 normal head lbl_cost 6 31 5 25 740 25 2 660 10 80 15 Arial 8 normal head lbl_cost
    detail Detail 16 405 0 80 15 Arial 8 bold Detail startdate 170 0 50 15 Arial 8 bold Detail warehous_code 490 0 80 15 Arial 8 bold Detail duedate 10 0 100 15 Arial 8 bold Detail wonumber 114 0 50 15 Arial 8 bold Detail wo_status 235 0 80 15 Arial 8 bold Detail ordered 320 0 80 15 Arial 8 bold Detail received 660 0 80 15 Arial 8 bold Detail value
    16 95 0 114 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/WOHistoryByNumber.xml000066400000000000000000000321521217451700100223120ustar00rootroot00000000000000 Work Order History by Number WOHistoryByNumber 0.05 0.05 Letter 50 50 50 50 Detail SELECT formatWoNumber(wo_id) AS number, wo_subnumber AS subnumber, wo_status, warehous_code, item_number, item_descrip1, item_descrip2, uom_name, formatQty(wo_qtyord) AS ordered, formatQty(wo_qtyrcv) AS received, formatDate(wo_startdate) AS startdate, formatDate(wo_duedate) AS duedate, <? if exists("showCosts") ?> text('W/O Cost') AS lbl_value, formatCost(wo_postedvalue) AS value <? else ?> text('') AS lbl_value, text('') AS value <? endif ?> FROM wo, itemsite, whsinfo, item, uom WHERE ((wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (CAST(wo_number AS TEXT) ~ <? value("woNumber") ?>) <? if exists("showOnlyTopLevel") ?> AND ((wo_ordtype<>'W') OR (wo_ordtype IS NULL)) <? endif ?> ) ORDER BY wo_subnumber; 172 135 85 170 20 Arial 10 bold Parameter Query woNumber 5 165 740 165 2 670 151 70 15 Arial 8 bold Detail lbl_value 7 32 5 25 740 25 2 665 13 70 15 Arial 8 bold Detail lbl_value
    detail Detail 52 125 15 300 15 Arial 8 bold Detail item_descrip1 5 0 55 15 Arial 8 bold Detail number 125 30 300 15 Arial 8 bold Detail item_descrip2 270 0 80 15 Arial 8 bold Detail ordered 350 0 80 15 Arial 8 bold Detail received 670 0 70 15 Arial 8 bold Detail value 65 0 20 15 Arial 8 bold Detail wo_status 85 0 40 15 Arial 8 bold Detail warehous_code 430 0 80 15 Arial 8 bold Detail startdate 5 45 740 45 0 508 0 80 15 Arial 8 bold Detail duedate 228 0 40 15 Arial 8 bold Detail uom_name 125 0 100 15 Arial 8 bold Detail item_number
    17 705 0 40 15 Arial 8 bold Context Query page_number 95 0 112 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/WOLabel.xml000066400000000000000000000057001217451700100202230ustar00rootroot00000000000000 WO Order Label WOLabel Labels generated for use in labeling parts out of a work order 0.05 0.05 400 333 25 25 25 25 detail SELECT sequence_value, formatDate(wo_duedate) AS due_date, item_number, item_descrip1, COALESCE(prodcat_descrip, '') AS prodcat_descrip FROM wo JOIN itemsite ON (itemsite_id=wo_itemsite_id) JOIN item ON (item_id=itemsite_item_id) JOIN sequence ON (sequence.sequence_value BETWEEN 1 AND <? value("labelTo") ?>) LEFT OUTER JOIN prodcat ON (prodcat_id=item_prodcat_id) WHERE (wo_id=<? value("wo_id") ?>);
    detail detail 218 10 150 330 25 Arial 12 bold detail item_descrip1 10 95 330 25 Arial 12 bold detail prodcat_descrip 10 180 330 25 3of9 5 0.01 detail item_number 150 35 120 18 Arial 12 bold detail due_date 75 125 265 18 Arial 12 bold detail item_number
    qt-client-4.1.0/share/reports/WOLabelX.xml000066400000000000000000000054251217451700100203570ustar00rootroot00000000000000 WO Order Label WOLabelForm Labels generated for use in labeling parts out of a work order 275 212 25 25 25 25 detail SELECT sequence_value, formatDate(wo_duedate) AS due_date, item_number, item_descrip1, prodcat_descrip FROM wo, itemsite, item, prodcat, sequence WHERE ( (wo_itemsite_id = itemsite_id) AND (wo_id=<? value("wo_id") ?>) AND (item_prodcat_id = prodcat_id) AND (itemsite_item_id = item_id) AND (sequence.sequence_value BETWEEN 1 AND 1));
    detail detail 214 21 91 192 25 Arial 10 bold detail prodcat_descrip 10 182 212 25 3of9 5
    detail item_number 62 122 265 17 Arial 10 bold detail item_number 145 5 77 17 Arial 9 bold detail due_date 20 151 185 25 Arial 10 bold detail item_descrip1
    qt-client-4.1.0/share/reports/WOMaterialAvailabilityByWorkOrder.xml000066400000000000000000000402301217451700100254240ustar00rootroot00000000000000 W/O Material Availability By Work Order WOMaterialAvailabilityByWorkOrder Letter 50 50 50 50 head SELECT formatWONumber(wo_id) AS wonumber, warehous_code as warehouse, item_number, item_descrip1, item_descrip2, uom_name, wo_status AS status, <? if exists("onlyShowShortages") ?> text('Only Show Shortages') <? elseif exists("onlyShowInsufficientInventory") ?> text('Only Show Insufficient Inventory') <? else ?> text('All Materials') <? endif ?> AS itemfiltertext, <? if exists("IndentedParentChild") ?> text('Indented Works Orders') <? elseif exists("summarizedParentChild") ?> text('Summarized Parent/Child Orders') <? else ?> text('Parent Order Only') <? endif ?> AS wofiltertext FROM wo, itemsite, item, uom, whsinfo WHERE ((wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (wo_id=<? value("wo_id") ?>) ); detail SELECT *, (REPEAT(' ',(woinvav_level-1)*3) || woinvav_item_wo_number) AS itemwonumber FROM woinvavail(<? value("wo_id") ?>, <? if exists("IndentedParentChild") ?> true, <? else ?> false, <? endif ?> <? if exists("summarizedParentChild") ?> true, <? else ?> false, <? endif ?> <? if exists("onlyShowShortages") ?> true, <? else ?> false, <? endif ?> <? if exists("onlyShowInsufficientInventory") ?> true) <? else ?> false) <? endif ?> 236 325 100 100 20 Arial 10 bold head uom_name 100 75 150 20 Arial 10 bold head warehouse 100 100 150 20 Arial 10 bold head item_number 100 55 300 20 Arial 10 bold head wonumber 5 229 745 229 2 100 120 300 20 Arial 10 bold head item_descrip1 100 165 100 20 Arial 10 bold head status 100 140 300 20 Arial 10 bold head item_descrip2 325 55 365 18 Arial 10 bold head itemfiltertext 325 75 365 18 Arial 10 bold head wofiltertext 6 36 5 30 745 30 2
    detail detail 32 350 0 75 15 Arial 8 bold detail woinvav_balance 270 0 75 15 Arial 8 bold detail woinvav_qoh 670 0 75 15 Arial 8 bold detail woinvav_totalavail 430 0 75 15 Arial 8 bold detail woinvav_allocated 509 0 75 15 Arial 8 bold detail woinvav_ordered 10 0 170 15 Arial 8 bold detail itemwonumber 0 29 750 29 0 190 15 555 15 Arial 8 bold detail woinvav_descrip 590 0 75 15 Arial 8 bold detail woinvav_woavail 190 0 75 15 Arial 8 bold detail woinvav_uomname
    16 695 0 50 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/WOMaterialRequirementsByComponentItem.xml000066400000000000000000000403151217451700100263440ustar00rootroot00000000000000 W/O Material Requirements By Component Item WOMaterialRequirementsByComponentItem Letter 50 50 50 50 head SELECT item_number, item_descrip1, item_descrip2, <? if exists("warehous_id") ?> ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) <? else ?> text('All Sites') <? endif ?> AS warehouse FROM item WHERE (item_id=<? value("item_id") ?>); detail workOrderMaterial detail total SELECT formatQty(SUM(womatl_qtyreq)) AS required, formatQty(SUM(womatl_qtyiss)) AS issued, formatQty(SUM(noNeg(womatl_qtyreq - womatl_qtyiss))) AS balance FROM wo, womatl, itemsite AS parentsite, itemsite AS componentsite, item, uom WHERE ((womatl_wo_id=wo_id) AND (womatl_uom_id=uom_id) AND (wo_status <> 'C') AND (wo_itemsite_id=parentsite.itemsite_id) AND (womatl_itemsite_id=componentsite.itemsite_id) AND (parentsite.itemsite_item_id=item_id) AND (componentsite.itemsite_item_id=<? value("item_id") ?>) <? if exists("warehous_id") ?> AND (componentsite.itemsite_warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ; 236 100 120 300 20 Arial 10 bold head item_descrip2 100 145 200 20 Arial 10 bold head warehouse 100 100 300 20 Arial 10 bold head item_descrip1 100 80 200 20 Arial 10 bold head item_number 5 229 745 229 2 6 36 5 30 745 30 2
    detail detail 51 10 0 80 15 Arial 8 bold detail wonumber 95 32 300 15 Arial 8 bold detail item_descrip1 5 45 745 45 0 590 0 75 15 Arial 8 bold detail f_balance 95 0 100 15 Arial 8 bold detail item_number 515 0 75 15 Arial 8 bold detail f_qtyiss 670 0 75 15 Arial 8 bold detail f_duedate 200 0 75 15 Arial 8 bold detail issuemethod 360 0 75 15 Arial 8 bold detail f_scrap 400 32 300 15 Arial 8 bold detail item_descrip2 440 0 75 15 Arial 8 bold detail f_qtyreq 280 0 75 15 Arial 8 bold detail f_qtyper 280 17 75 15 Arial 8 bold detail f_qtyfxd
    16 705 0 40 15 Arial 8 bold Context Query page_number 90 0 100 15 Arial 8 bold Context Query report_date 16 595 1 70 15 Arial 8 bold total balance 520 1 70 15 Arial 8 bold total issued 445 1 70 15 Arial 8 bold total required
    qt-client-4.1.0/share/reports/WOMaterialRequirementsByWorkOrder.xml000066400000000000000000000351321217451700100255020ustar00rootroot00000000000000 W/O Material Requirements By Work Order WOMaterialRequirementsByWorkOrder Letter 50 50 50 50 head SELECT formatWONumber(wo_id) AS wonumber, warehous_code as warehouse, item_number, item_descrip1, item_descrip2, uom_name, wo_status AS status FROM wo, itemsite, item, uom, whsinfo WHERE ((wo_itemsite_id=itemsite_id) AND (itemsite_item_id=item_id) AND (item_inv_uom_id=uom_id) AND (itemsite_warehous_id=warehous_id) AND (wo_id=<? value("wo_id") ?>) ); detail workOrderMaterial detail 236 100 165 100 20 Arial 10 bold head status 100 100 150 20 Arial 10 bold head item_number 100 140 300 20 Arial 10 bold head item_descrip2 100 75 300 20 Arial 10 bold head warehouse 100 120 300 20 Arial 10 bold head item_descrip1 100 55 300 20 Arial 10 bold head wonumber 5 229 745 229 2 6 36 5 30 745 30 2
    detail detail 51 10 0 100 15 Arial 8 bold detail item_number 430 0 75 15 Arial 8 bold detail f_qtyreq 190 0 75 15 Arial 8 bold detail issuemethod 350 0 75 15 Arial 8 bold detail f_scrap 509 0 75 15 Arial 8 bold detail f_qtyiss 5 45 745 45 0 10 30 300 15 Arial 8 bold detail item_descrip2 670 0 75 15 Arial 8 bold detail f_duedate 590 0 75 15 Arial 8 bold detail f_balance 10 15 255 15 Arial 8 bold detail item_descrip1 270 0 75 15 Arial 8 bold detail f_qtyper 270 17 75 15 Arial 8 bold detail f_qtyfxd
    16 90 0 100 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/WOSchedule.xml000066400000000000000000000267341217451700100207520ustar00rootroot00000000000000 Work Order Schedule WOSchedule 0.05 0.05 Letter 50 50 50 50 Detail workOrderSchedule detail Head SELECT formatDate(<? value("startDate") ?>, 'Earliest') AS f_startdate, formatDate(<? value("endDate") ?>, 'Latest') AS f_enddate, <? if exists("warehous_id") ?> warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>); <? else ?> TEXT('All Sites') AS warehous_code; <? endif ?> 191 5 185 740 185 2 10 38 725 15 12 Arial 10 bold Parameter Query filter 6 31 5 25 740 25 2
    detail Detail 52 405 0 80 15 Arial 8 bold Detail ordered 190 30 200 15 Arial 8 bold Detail item_descrip2 360 0 40 15 Arial 8 bold Detail uom_name 190 0 100 15 Arial 8 bold Detail item_number 140 0 40 15 Arial 8 bold Detail warehous_code 490 0 80 15 Arial 8 bold Detail received 10 0 80 15 Arial 8 bold Detail wonumber 5 45 740 45 0 190 15 200 15 Arial 8 bold Detail item_descrip1 95 0 40 15 Arial 8 bold Detail wo_status 575 0 80 15 Arial 8 bold Detail startdate 660 0 80 15 Arial 8 bold Detail duedate
    17 95 0 112 15 Arial 8 bold Context Query report_date 705 0 40 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/reports/WarehouseLocationMasterList.xml000066400000000000000000000235741217451700100244120ustar00rootroot00000000000000 Warehouse Location Master List WarehouseLocationMasterList Letter 50 50 50 50 detail SELECT (warehous_code || ' ' || location_name) AS whs_bin, warehous_code, formatLocationName(location_id) AS locationname, location_descrip, formatBoolYN(location_netable) AS f_netable, formatBoolYN(location_restrict) AS f_restrict, item_number, (item_descrip1 || ' ' || item_descrip2) AS itemdesc FROM location LEFT OUTER JOIN (SELECT locitem_location_id, item_number, item_descrip1, item_descrip2 FROM locitem, item WHERE locitem_item_id=item_id) AS itemlocation ON (locitem_location_id=location_id and location_restrict=true), whsinfo WHERE ((location_warehous_id=warehous_id) <? if exists("warehous_id") ?> AND (warehous_id=<? value("warehous_id") ?>) <? endif ?> ) ORDER BY warehous_code, location_name; head SELECT <? if exists("warehous_id") ?> text('Warehouse:') AS f_text, ( SELECT warehous_code FROM whsinfo WHERE (warehous_id=<? value("warehous_id") ?>) ) AS f_value <? else ?> text('') AS f_text, text('') AS f_value <? endif ?> 102 30 50 100 20 Arial 10 normal head f_text 140 50 175 20 Arial 10 bold head f_value 5 100 745 100 2 6 21 5 15 745 15 2
    detail detail locationname 21 225 5 50 15 Arial 8 bold detail f_restrict 5 5 50 15 Arial 8 bold detail warehous_code 395 5 350 15 0 Arial 8 bold detail location_descrip 5 0 745 0 0 55 5 114 15 Arial 8 bold detail locationname 170 5 50 15 Arial 8 bold detail f_netable detail 18 290 0 100 15 Arial 8 bold detail item_number 395 0 350 15 Arial 8 bold detail itemdesc
    18 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/WarehouseMasterList.xml000066400000000000000000000262701217451700100227150ustar00rootroot00000000000000 Warehouse Master List WarehouseMasterList Letter 50 50 50 50 detail SELECT warehous_code, formatBoolYN(warehous_active) AS f_active, warehous_descrip, addr_line1 AS warehous_addr1, addr_line2 AS warehous_addr2, addr_line3 AS warehous_addr3, (addr_city || ',' || addr_state || ' ' || addr_postalcode) AS warehous_addr4, warehous_fob, warehous_bol_prefix, warehous_bol_number, formatBoolYN(warehous_shipping) AS f_shipping, warehous_counttag_prefix, warehous_counttag_number, formatBoolYN(warehous_useslips) as f_useslips FROM site() JOIN addr ON (addr_id=warehous_addr_id) LEFT OUTER JOIN sitetype ON (sitetype_id=warehous_sitetype_id) WHERE ((TRUE) <? if not exists("showInactive") ?> AND (warehous_active) <? endif ?> ) ORDER BY warehous_code; head SELECT <? if exists("showInactive") ?> text('Showing Active and Inactive Warehouses') <? else ?> text('Showing Active Warehouses') <? endif ?> AS f_show; 61 5 55 745 55 2 10 40 450 15 Arial 8 bold head f_show
    detail detail 151 615 110 75 15 Arial 8 bold detail f_shipping 5 145 745 145 0 120 5 50 15 Arial 8 bold detail warehous_code 295 90 450 15 Arial 8 bold detail warehous_fob 350 110 100 15 Arial 8 bold detail warehous_bol_number 120 25 50 15 Arial 8 bold detail f_active 295 5 450 15 Arial 8 bold detail warehous_descrip 295 110 50 15 Arial 8 bold detail warehous_bol_prefix 295 125 50 15 Arial 8 bold detail warehous_counttag_prefix 295 70 450 15 Arial 8 bold detail warehous_addr4 350 140 450 140 0 295 125 345 125 0 350 125 100 15 Arial 8 bold detail warehous_counttag_number 350 125 450 125 0 295 25 450 15 Arial 8 bold detail warehous_addr1 615 125 75 15 Arial 8 bold detail f_useslips 295 55 450 15 Arial 8 bold detail warehous_addr3 295 40 450 15 Arial 8 bold detail warehous_addr2 295 140 345 140 0
    16 705 0 40 15 Arial 8 bold Context Query page_number 95 0 100 15 Arial 8 bold Context Query report_date
    qt-client-4.1.0/share/reports/items.xml000066400000000000000000000642611217451700100200660ustar00rootroot00000000000000 Items Items 0.05 0.05 Letter 50 50 50 50 detail SELECT <? if exists("ListNumericItemNumbersFirst") ?> DISTINCT ON ( toNumeric(item_number, 999999999999999), item_number ) <? else ?> DISTINCT ON ( item_number ) <? endif ?> item_number, item_descrip1, item_descrip2, formatBoolYN(item_active) AS active, CASE WHEN (item_type='M') THEN 'Manufactured' WHEN (item_type='P') THEN 'Purchased' WHEN (item_type='F') THEN 'Phantom' WHEN (item_type='B') THEN 'Breeder' WHEN (item_type='C') THEN 'Co-Product' WHEN (item_type='Y') THEN 'By-Product' WHEN (item_type='R') THEN 'Reference' WHEN (item_type='T') THEN 'Tooling' WHEN (item_type='O') THEN 'Outside Process' WHEN (item_type='J') THEN 'Job' WHEN (item_type='K') THEN 'Kit' WHEN (item_type='L') THEN 'Planning' ELSE item_type END AS itemtype, iuom.uom_name AS invuom, itemcapuom(item_id) AS capuom, itemaltcapuom(item_id) AS altcapuom, puom.uom_name AS priceuom, puom.uom_name AS shipuom, formatRatio(itemcapinvrat(item_id)) AS capratio, formatRatio(itemaltcapinvrat(item_id)) AS altcapratio, formatRatio(iteminvpricerat(item_id)) AS shipratio, formatRatio(iteminvpricerat(item_id)) AS priceratio, formatBoolYN(item_sold) AS sold, formatBoolYN(item_exclusive) AS exclusive, formatBoolYN(item_picklist) AS picklist, formatBoolYN(item_config) AS configured, formatWeight(item_prodweight) AS prodweight, formatWeight(item_packweight) AS packweight, classcode_code FROM item JOIN classcode ON (item_classcode_id=classcode_id) JOIN uom iuom ON (item_inv_uom_id=iuom.uom_id) JOIN uom puom ON (item_price_uom_id=puom.uom_id) <? if exists("itemgrp_id") ?> JOIN itemgrpitem ON (item_id=itemgrpitem_item_id) JOIN itemgrp ON (itemgrp_id=itemgrpitem_itemgrp_id) <? endif ?> <? foreach("char_id_text_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_text_list") ?> ON ((charass_alias<? literal("char_id_text_list") ?>.charass_target_type='I') AND (charass_alias<? literal("char_id_text_list") ?>.charass_target_id=item_id) AND (charass_alias<? literal("char_id_text_list") ?>.charass_char_id=<? value("char_id_text_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_text_list") ?> ON (charass_alias<? literal("char_id_text_list") ?>.charass_char_id=char_alias<? literal("char_id_text_list") ?>.char_id) <? endforeach ?> <? foreach("char_id_list_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_list_list") ?> ON ((charass_alias<? literal("char_id_list_list") ?>.charass_target_type='I') AND (charass_alias<? literal("char_id_list_list") ?>.charass_target_id=item_id) AND (charass_alias<? literal("char_id_list_list") ?>.charass_char_id=<? value("char_id_list_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_list_list") ?> ON (charass_alias<? literal("char_id_list_list") ?>.charass_char_id=char_alias<? literal("char_id_list_list") ?>.char_id) <? endforeach ?> <? foreach("char_id_date_list") ?> LEFT OUTER JOIN charass charass_alias<? literal("char_id_date_list") ?> ON ((charass_alias<? literal("char_id_date_list") ?>.charass_target_type='I') AND (charass_alias<? literal("char_id_date_list") ?>.charass_target_id=item_id) AND (charass_alias<? literal("char_id_date_list") ?>.charass_char_id=<? value("char_id_date_list") ?>)) LEFT OUTER JOIN char char_alias<? literal("char_id_date_list") ?> ON (charass_alias<? literal("char_id_date_list") ?>.charass_char_id=char_alias<? literal("char_id_date_list") ?>.char_id) <? endforeach ?> WHERE ( true <? if exists("search_pattern") ?> AND ( (item_number ~* <? value("search_pattern") ?>) OR (item_descrip1 || item_descrip2 ~* <? value("search_pattern") ?>) ) <? endif ?> <? if exists("showPurchased") ?> AND (item_type IN ('P', 'O')) <? elseif exists("showManufactured") ?> AND (item_type IN ('M', 'F', 'B','K')) <? elseif exists("showSold") ?> AND (item_sold) <? endif ?> <? if exists("item_type") ?> AND (item_type=<? value("item_type") ?>) <? endif ?> <? if not exists("showInactive") ?> AND (item_active) <? endif ?> <? if exists("classcode_id") ?> AND (item_classcode_id=<? value("classcode_id") ?>) <? endif ?> <? if exists("prodcat_id") ?> AND (item_prodcat_id=<? value("prodcat_id") ?>) <? endif ?> <? if exists("freightclass_id") ?> AND (item_freightclass_id=<? value("freightclass_id") ?>) <? endif ?> <? if exists("itemgrp_id") ?> AND (itemgrp_id=<? value("itemgrp_id") ?>) <? endif ?> <? if exists("item_number_pattern") ?> AND (item_number ~* <? value("item_number_pattern") ?>) <? endif ?> <? if exists("item_descrip_pattern") ?> AND (item_descrip1 || item_descrip2 ~* <? value("item_descrip_pattern") ?>) <? endif ?> <? if exists("classcode_pattern") ?> AND (classcode_code ~* <? value("classcode_pattern") ?>) <? endif ?> <? if exists("prodcat_pattern") ?> AND (prodcat_code ~* <? value("prodcat_pattern") ?>) <? endif ?> <? if exists("freightclass_pattern") ?> AND (freightclass_code ~* <? value("freightclass_pattern") ?>) <? endif ?> <? literal("charClause") ?> ) ORDER BY <? if exists("ListNumericItemNumbersFirst") ?> toNumeric(item_number, 999999999999999), <? endif ?> item_number; 241 5 235 745 235 2 10 28 725 15 12 Arial 10 bold Parameter Query filter 6 81 5 75 745 75 2
    unnamed detail 81 565 30 60 15 Arial 8 40 detail picklist 10 15 250 15 Arial 8 40 detail item_descrip1 565 15 60 15 Arial 8 40 detail exclusive 433 45 90 15 Arial 8 40 detail priceratio 10 45 250 15 Arial 8 40 detail itemtype 640 0 100 15 Arial 8 40 detail packweight 10 30 250 15 Arial 8 40 detail item_descrip2 433 30 90 15 Arial 8 40 detail altcapratio 275 60 100 15 Arial 8 40 detail shipuom 10 0 250 15 Arial 8 normal detail item_number 5 75 745 75 0 565 0 60 15 Arial 8 40 detail sold 565 45 60 15 Arial 8 40 detail configured 275 45 100 15 Arial 8 40 detail priceuom 275 0 100 15 Arial 8 40 detail invuom 10 60 50 15 Arial 8 40 detail active 433 15 90 15 Arial 8 40 detail capratio 104 60 66 15 Arial 8 40 detail classcode_code 275 30 100 15 Arial 8 40 detail altcapuom 275 15 100 15 Arial 8 40 detail capuom 640 15 100 15 Arial 8 40 detail prodweight 433 60 90 15 Arial 8 40 detail shipratio
    16 80 0 140 15 Arial 8 bold Context Query report_date 715 0 30 15 Arial 8 bold Context Query page_number
    qt-client-4.1.0/share/sample_scripts/000077500000000000000000000000001217451700100175445ustar00rootroot00000000000000qt-client-4.1.0/share/sample_scripts/TODO.txt000066400000000000000000000006741217451700100210610ustar00rootroot00000000000000In no particular order: - make all strings translatable and update .ts and .pro files - update use of scripting api (i.e. QMessageBox.critical & symbolic constants) - add an ItemCluster to DisplayItemLocations to show how - add a right-click to DisplayItemLocations to show how to build menus - add initMenu to put stuff in a reasonable place - remove redundant scripts - either incorporate simpleSalesOrder into the package or move it qt-client-4.1.0/share/scriptlib/000077500000000000000000000000001217451700100165075ustar00rootroot00000000000000qt-client-4.1.0/share/scriptlib/resources/000077500000000000000000000000001217451700100205215ustar00rootroot00000000000000qt-client-4.1.0/share/scriptlib/resources/client/000077500000000000000000000000001217451700100217775ustar00rootroot00000000000000qt-client-4.1.0/share/scriptlib/resources/client/scripts/000077500000000000000000000000001217451700100234665ustar00rootroot00000000000000qt-client-4.1.0/share/scriptlib/resources/client/scripts/js2soap.js000066400000000000000000000105631217451700100254120ustar00rootroot00000000000000function identifierToTag(identifier, namespace) { try { if (namespace instanceof Array) { for (var i in namespace) { var nsidx = identifier.indexOf(namespace[i].ns + "_"); if (nsidx == 0) return namespace[i].ns + ":" + identifier.substring(namespace[i].ns.length + 1); } return null; } else if (namespace instanceof Object) { var nsidx = identifier.indexOf(namespace.ns + "_"); if (nsidx == 0) return namespace.ns + ":" + identifier.substring(namespace.ns.length + 1); return null; } else if (namespace != null) { var nsidx = identifier.indexOf(namespace + "_"); if (nsidx == 0) return namespace + ":" + identifier.substring(namespace.length + 1); return null; } else return identifier; } catch(e) { print("identifierToTag exception at line " + e.lineNumber + ": " + e); } } function js2xml(input, inputname, namespace, level) { try { if (input == null) return ""; if (level == null) level = 0; var tag = identifierToTag(input.xmltag == null ? inputname : input.xmltag, namespace); if (tag == null || tag.length == 0) return ""; var indent = ""; for (var i = 0; i < level; i++) indent += " "; var output = ""; var xmlattribute = ""; if (input.xmlattribute != null) for (var i in input.xmlattribute) xmlattribute += ' ' + i + '="' + input.xmlattribute[i] + '"'; if (! hasXMLChildren(input, namespace)) { output += indent + "<" + tag + xmlattribute; if ((input + "").indexOf("[") != 0) output += ">" + input + "\n"; else output += "/>\n" } else { if (input instanceof Array) { for (var i = 0; i < input.length; i++) output += js2xml(input[i], input[i].xmltag, namespace, level + 1); } else if (typeof input == "object") { output += indent + "<" + tag + xmlattribute + ">\n"; for (var j in input) output += js2xml(input[j], j, namespace, level + 1); if (input.xmltext != null) output += indent + " " + input.xmltext + "\n"; output += indent + "\n"; } } return output; } catch(e) { print("js2xml exception at line " + e.lineNumber + ": " + e); } } function hasXMLChildren(object, namespace) { try { if (object.xmltext != null) return true; else if (namespace instanceof Array) { for (var i in namespace) if (hasXMLChildren(object, namespace[i])) return true; } else if (namespace instanceof Object) return hasXMLChildren(object, namespace.ns); else if (namespace != null) { if (object instanceof Array) { if (object["xmltag"].indexOf(namespace + "_") == 0) return true; } else if (object instanceof Object) { for (var j in object) { if ((j + "").indexOf(namespace + "_") == 0) return true; } } } else { print("hasXMLChildren: namespace is empty!"); if (object instanceof Array) return true; else if (object instanceof Object) return true; } return false; } catch(e) { print("hasXMLChildren exception at line " + e.lineNumber + ": " + e); } } function js2soap(input, namespace) { try { var output = ""; var nsprefix = ' xmlns:'; output += '\n'; output += ' 0) return tag.substring(0, nsidx) + "_" + tag.substring(nsidx + 1); else return tag; } function xml2js(input) { try { if ((input + "").indexOf("QDom") != 0 && (input + "").indexOf("[QDom") != 0) { var doc = new QDomDocument(); var err = new Object(); var line = 0; var col = 0; if (! doc.setContent(input, false, err, line, col)) throw "error reading XML at " + line + ":" + col + "\n" + err; input = doc; } var attribute = input.attributes(); var nodename = tagToIdentifier(input.nodeName()); var xmlattribute; var xmltag = nodename; if (attribute.size() > 0) { xmlattribute = new Object(); for (var attr = 0; attr < attribute.size(); attr++) xmlattribute[tagToIdentifier(attribute.item(attr).toAttr().name())] = attribute.item(attr).toAttr().value(); } var child = input.childNodes(); var seq = 0; var output = new Object(); for (var i = 0; i < child.size(); i++) { var childtag = tagToIdentifier(child.at(i).nodeName()); if (child.at(i).isText()) { output = new String(child.at(i).nodeValue().split(/\s+/).join(" ")); output.xmltag = xmltag; seq = 0; } else if (child.size() > i + 1 && child.at(i).nodeName() == child.at(i + 1).nodeName()) { if (output[childtag] == null) { output[childtag] = new Array(); output[childtag].xmltag = childtag; } output[childtag][seq] = xml2js(child.at(i)); if (output[childtag][seq]) output[childtag][seq].xmltag = childtag; seq = seq + 1; } else if (child.size() > 1 && i > 0 && child.at(i).nodeName() == child.at(i - 1).nodeName()) { output[childtag][seq] = xml2js(child.at(i)); if (output[childtag][seq]) output[childtag][seq].xmltag = childtag; seq = seq + 1; } else { output[childtag] = xml2js(child.at(i)); if (output[childtag]) { output[childtag].xmltag = childtag; } seq = 0; } } output.xmltag = xmltag; if (xmlattribute != null) output.xmlattribute = xmlattribute; return output; } catch (e) { print("xml2js - exception at line " + e.lineNumber + ": " + e); } } /* take a SOAP document in the form of a string and return a javascript object with the contents of the SOAP document as its properties. if the SOAP-ENV:Body contains multiple elements, the object returned will be an array of JS objects */ function soap2js(input) { try { var doc = new QDomDocument(); var err = new Object(); var line = 0; var col = 0; if (! doc.setContent(input, false, err, line, col)) throw "error reading XML at " + line + ":" + col + "\n" + err; var envelope = doc.documentElement(); if (envelope.tagName() != "SOAP-ENV:Envelope") throw "error: expected SOAP-ENV:Envelope but found " + envelope.tagName(); var body = envelope.firstChildElement(); if (body.tagName() != "SOAP-ENV:Body") throw "error: expected SOAP-ENV:Body but found " + body.tagName(); var child = body.childNodes(); if (child.size() < 1) return null; else if (child.size() == 1) output = xml2js(child.at(0)); else { output = new Array(); for (var i = 0; i < child.size(); i++) output[i] = xml2js(child.at(i)); } return output; } catch (e) { print("soap2js - exception at line " + e.lineNumber + ": " + e); } } qt-client-4.1.0/share/scriptlib/resources/client/scripts/storedProcErrorLookup.js000066400000000000000000000023731217451700100303610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ /* This simplified version of xtuple/common/storedProcErrorLookup.cpp takes an error structure, allowing packages to define their own errors. */ function storedProcErrorLookup(procName, returnVal, errorStruct) { var message; if (null != errorStruct) { if (procName in errorStruct && returnVal in errorStruct[procName]) message = errorStruct[procName][returnVal]; else { procName = procName.toLowerCase(); for (var tmpProcName in errorStruct) if (procName == tmpProcName.toLowerCase()) { message = errorStruct[tmpProcName][returnVal]; break; } } if (message != null) return "

    " + message + qsTr("
    (%1, %2)
    ").arg(procName).arg(returnVal); } return toolbox.storedProcErrorLookup(procName, returnVal); } qt-client-4.1.0/share/scriptlib/resources/package.xml000066400000000000000000000007451217451700100226440ustar00rootroot00000000000000 scriptlib package scriptlib package scriptlib package qt-client-4.1.0/share/xml/000077500000000000000000000000001217451700100153145ustar00rootroot00000000000000qt-client-4.1.0/share/xml/utility.xsl000066400000000000000000000035171217451700100175550ustar00rootroot00000000000000 ' \' \" qt-client-4.1.0/share/xml/xtupleapi.dtd000066400000000000000000001014471217451700100200330ustar00rootroot00000000000000 qt-client-4.1.0/share/xml/yahoo_to_xtupleapi.xsl000066400000000000000000000610641217451700100217670ustar00rootroot00000000000000 SELECT country_name FROM country WHERE (country_abbr= 'UK' '' ) getCustNumberFromInfo('', '', '', '', '', '') getCustNameFromInfo('', '', '', '', '', '') getShiptoNumberFromInfo( , '', '', '', '', '', '', '', NULL, '', '', '', '', , ) Cannot find Customer Number for Order Cannot find Customer Name for Order The customer_corresp_type parameter has the value '' but must be either 'bill' or 'ship'. type expiration : : = Order number is not valid since it does not start with the store account name Cannot find Customer Number for Order SELECT curr_abbr FROM curr_symbol WHERE (curr_id=basecurrid()) type expiration : = : Coupon: : = DATE '' + INTERVAL '' : qt-client-4.1.0/utilities/000077500000000000000000000000001217451700100154255ustar00rootroot00000000000000qt-client-4.1.0/utilities/doxygen/000077500000000000000000000000001217451700100171025ustar00rootroot00000000000000qt-client-4.1.0/utilities/doxygen/Doxyfile.public000066400000000000000000001774321217451700100221030ustar00rootroot00000000000000# Doxyfile 1.6.1 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "xTuple ERP Programmer Reference" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 4.0.0Beta2 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, # Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English # messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, # Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, # Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the \ "The $name class" # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it parses. # With this tag you can assign which parser to use for a given extension. # Doxygen has a built-in mapping, but you can override or extend it using this tag. # The format is ext=language, where ext is a file extension, and language is one of # the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, # Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat # .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), # use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. EXTENSION_MAPPING = js=JavaScript script=JavaScript # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO # The SYMBOL_CACHE_SIZE determines the size of the internal cache use to # determine which symbols to keep in memory and which to flush to disk. # When the cache is full, less often used symbols will be written to disk. # For small to medium size projects (<1000 input files) the default value is # probably good enough. For larger projects a too small cache size can cause # doxygen to be busy swapping symbols to and from disk most of the time # causing a significant performance penality. # If the system has enough physical memory increasing the cache will improve the # performance by keeping more symbols in memory. Note that the value works on # a logarithmic scale so increasing the size by one will rougly double the # memory usage. The cache size is given by this formula: # 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, # corresponding to a cache size of 2^16 = 65536 symbols SYMBOL_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = NO # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = NO # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = YES # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. SORT_MEMBERS_CTORS_1ST = YES # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = YES # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. # This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by # doxygen. The layout file controls the global structure of the generated output files # in an output format independent way. The create the layout file that represents # doxygen's defaults, run doxygen with the -l option. You can optionally specify a # file name after the option, if omitted DoxygenLayout.xml will be used as the name # of the layout file. LAYOUT_FILE = utilities/doxygen/DoxygenLayout.xml #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = common \ guiclient \ scriptapi \ share/scriptlib \ widgets # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.d \ *.java \ *.js \ *.script \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.idl \ *.odl \ *.cs \ *.php \ *.php3 \ *.inc \ *.m \ *.mm \ *.dox \ *.py # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = */.svn/* \ moc_* \ *.moc \ */html*/* # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = ../sample_scripts # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = YES # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. # If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. # Doxygen will compare the file name with each pattern and apply the # filter if there is a match. # The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. # Otherwise they will link to the documentation. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = utilities/doxygen/xtuple_doxygen_header.html # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = utilities/doxygen/xtuple_doxygen_footer.html # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = utilities/doxygen/xtuple_doxygen.css # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. # See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER # are set, an additional index file will be generated that can be used as input for # Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated # HTML documentation. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can # be used to specify the file name of the resulting .qch file. # The path specified is relative to the HTML output folder. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#namespace QHP_NAMESPACE = # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating # Qt Help Project output. For more information please see # http://doc.trolltech.com/qthelpproject.html#virtual-folders QHP_VIRTUAL_FOLDER = doc # If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. # For more information please see # http://doc.trolltech.com/qthelpproject.html#custom-filters QHP_CUST_FILTER_NAME = # The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see #
    Qt Help Project / Custom Filters. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's # filter section matches. # Qt Help Project / Filter Attributes. QHP_SECT_FILTER_ATTRS = # If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can # be used to specify the location of Qt's qhelpgenerator. # If non-empty doxygen will try to run qhelpgenerator on the generated # .qhp file. QHG_LOCATION = # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to YES, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). # Windows users are probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, # and Class Hierarchy pages using a tree view instead of an ordered list. USE_INLINE_TREES = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 # When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript # and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) # there is already a search function so this one should typically # be disabled. SEARCHENGINE = NO #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO # If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. LATEX_SOURCE_CODE = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. # This is useful # if you want to understand what is going on. # On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = "XTUPLEDOXYGEN" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. #TAGFILES = utilities/doxygen/qt_doxygen.tag=http://qt.nokia.com/doc/4.5 TAGFILES = /Developer/Documentation/Qt/html/qt.tags=http://qt.nokia.com/doc/4.6 # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = NO # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = NO # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = NO # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. # The default size is 10pt. DOT_FONTSIZE = 10 # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = NO # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = NO # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = NO # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = NO # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = NO # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not # seem to support this out of the box. Warning: Depending on the platform used, # enabling this option may lead to badly anti-aliased labels on the edges of # a graph (i.e. they become hard to read). DOT_TRANSPARENT = YES # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = YES # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES qt-client-4.1.0/utilities/doxygen/DoxygenLayout.xml000066400000000000000000000130501217451700100224360ustar00rootroot00000000000000 qt-client-4.1.0/utilities/doxygen/README.txt000066400000000000000000000065561217451700100206140ustar00rootroot00000000000000Dependencies: - You must have Doxygen 1.6 or later. - You must have the environment variable QTDIR set to the Qt installed directory and exported. - You must have the Qt docs installed in QTDIR/doc/html. Steps to run: 1 $ svn co the-right-xtuple-code-url 2 $ cd .../xtuple[/tag/tag_name] 3 $ qmake ; make 4 $ edit utilities/doxygen/Doxyfile.public # set PROJECT_NUMBER to match version.cpp # fix the URL in TAGFILES to match the Qt version we're using 5 $ doxygen utilities/doxygen/Doxyfile.public Then copy the resulting html directory to the web server to publish the docs. Note: The build in step 3 is required to get the list of widgets from the .ui files. First pass at usage guidelines; comments welcome. - document in the .cpp file instead of the .h as much as possible (e.g. describe methods in the .cpp but enums in the .h) - if the only items in the .cpp are class members, start the .cpp with @class; if there are globals or statics in the .cpp, start with @file and continue with @class? - use /** to start doxygen comments, not /*! - use @ style directives, not backslashes - use @brief instead of relying on doxygen to guess for you. - put % in front of words that you're using casually that happen to be names of classes/functions/... so they don't get converted to links - tag order seems to be important. put the tags you use in the following order: /** @brief long description @dontinclude samplefile.js bits of samplefile.js using @skip, @until, ... more long description @param @return @see @see samplefile.js */ the method/function definition /** @example */ Futures: * Figure out how to make examples work (see scripttoolbox.cpp for more info) * How deep should we go into how the internals work? * Should we restrict the docs to simply what the class and its components do? * How rich should the See Also tagging be? Look at turning on HAVE_DOT and using the various graph options. Some of particular are listed below. However, even if we don't use dot, we should look at turning on CLASS_DIAGRAMS. The inheritance hierarchy is pretty flat right now but should get deeper over time. If so, CLASS_DIAGRAMS would be helpful. It would be really nice if we could figure out how to build diagrams of JavaScript object inheritance if we ever start writing JS code that way. Look at http://ww.mcternan.me.uk/mscgen and Doxygen's MSCGEN_PATH option. We could use Doxygen calling mscgen to document the default signal/slot connections so scripters know what connections they can/should break to accomplish a desired goal. Look at turning on COLLABORATION_GRAPH. This would be more useful for people working in the core. One problem with it, though, is that the diagrams are really hairy - we have a lot of interdependencies. On the other hand, this would provide good data on ways we could simplify the code. Look at turning off EXTRACT_ALL once we've documented everything. Look into documenting stored procedures. We would have to write a parser for PL/PGSQL and a filter to convert -- comments to C- or C++-style comments. The filter could be run on all source files with a .sql suffix. We might be able to do the same with COMMENTS on tables and their columns and/or views and their columns. Maybe we should create COMMENTS on functions, too, so everyone gets them in the db. qt-client-4.1.0/utilities/doxygen/xtuple_doxygen.css000066400000000000000000000153471217451700100227040ustar00rootroot00000000000000@import url("http://www.xtuple.org/issuetracker/css/default.css"); DIV.qindex { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.nav { width: 100%; background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } DIV.navtab { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } TD.navtab { font-size: 70%; } DL.el { margin-left: -1cm } .fragment { font-family: monospace, fixed; font-size: 95%; } PRE.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } BODY { background: white; color: black; margin-right: 20px; margin-left: 20px; } TD.indexkey { background-color: #e8eef2; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TD.indexvalue { background-color: #e8eef2; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } TR.memlist { background-color: #f0f0f0; } P.formulaDsp { text-align: center; } IMG.formulaDsp { } IMG.formulaInl { vertical-align: middle; } SPAN.keyword { color: #008000 } SPAN.keywordtype { color: #604020 } SPAN.keywordflow { color: #e08000 } SPAN.comment { color: #800000 } SPAN.preprocessor { color: #806020 } SPAN.stringliteral { color: #002080 } SPAN.charliteral { color: #008080 } .mdescLeft { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .mdescRight { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .memItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA; font-size: 80%; } .search { color: #003399; font-weight: bold; } FORM.search { margin-bottom: 0px; margin-top: 0px; } INPUT.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #e8eef2; } TD.tiny { font-size: 75%; } a { color: #1A41A8; } a:visited { color: #2A3798; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #84b0c7; } TH.dirtab { background: #e8eef2; font-weight: bold; } HR { height: 1px; border: none; border-top: 1px solid black; } /* Style for detailed member documentation */ .memtemplate { font-size: 80%; color: #606060; font-weight: normal; } .memnav { background-color: #e8eef2; border: 1px solid #84b0c7; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } .memitem { padding: 4px; background-color: #eef3f5; border-width: 1px; border-style: solid; border-color: #dedeee; -moz-border-radius: 8px 8px 8px 8px; } .memname { white-space: nowrap; font-weight: bold; } .memdoc{ padding-left: 10px; } .memproto { background-color: #d5e1e8; width: 100%; border-width: 1px; border-style: solid; border-color: #84b0c7; font-weight: bold; -moz-border-radius: 8px 8px 8px 8px; } .paramkey { text-align: right; } .paramtype { white-space: nowrap; } .paramname { color: #602020; font-style: italic; white-space: nowrap; } /* End Styling for detailed member documentation */ /* for the tree view */ .ftvtree { font-family: sans-serif; margin:0.5em; } .directory { font-size: 9pt; font-weight: bold; } .directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } .directory > h3 { margin-top: 0; } .directory p { margin: 0px; white-space: nowrap; } .directory div { display: none; margin: 0px; } .directory img { vertical-align: -30%; } qt-client-4.1.0/utilities/doxygen/xtuple_doxygen_footer.html000066400000000000000000000007451217451700100244320ustar00rootroot00000000000000


    Generated on $datetime $projectname, Version $projectnumber doxygen $doxygenversion
    qt-client-4.1.0/utilities/doxygen/xtuple_doxygen_header.html000066400000000000000000000005001217451700100243510ustar00rootroot00000000000000 $title qt-client-4.1.0/utilities/rptdiff.sh000077500000000000000000000123721217451700100174270ustar00rootroot00000000000000# # This file is part of the xTuple ERP: PostBooks Edition, a free and # open source Enterprise Resource Planning software suite, # Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. # It is licensed to you under the Common Public Attribution License # version 1.0, the full text of which (including xTuple-specific Exhibits) # is available at www.xtuple.com/CPAL. By using this software, you agree # to be bound by its terms. # PROG=`basename $0` OLDDIR= NEWDIR= TMPDIR="${TMPDIR:-/tmp}/${PROG}_`date +%Y_%m_%d`" RUNEXTRACT=true #undocumented feature XSLT=xsltproc XSLTFILE=$TMPDIR/rptdiff.xslt usage () { echo "$PROG -h" echo "$PROG [ -o oldversiondir -n newversiondir ] [ -t temporarydir ]" echo echo "-h print this usage message" echo "-o directory to search for the old versions of the reports" echo "-n directory to search for the new versions of the reports" echo "-t directory in which to store extracted queries [$TMPDIR]" } # x is an undocumented option set -- `getopt ho:n:t:x $*` while [ $1 != -- ] ; do case "$1" in -h) usage exit 0 ;; -o) OLDDIR=$2 shift ;; -n) NEWDIR=$2 shift ;; -t) TMPDIR=$2 XSLTFILE=$TMPDIR/rptdiff.xslt shift ;; -x) RUNEXTRACT=false #undocumented feature ;; esac shift done shift #past the -- if [ -z "$OLDDIR" ] ; then echo "$PROG: no oldversiondir given" usage exit 1 elif [ ! -d "$OLDDIR" ] ; then echo "$PROG: oldversiondir is not a directory" usage exit 1 elif [ `ls $OLDDIR/*.xml | wc -l` -le 0 ] ; then echo "$PROG: $OLDDIR doesn't seem to have any xml files in it" exit 1 fi if [ -z "$NEWDIR" ] ; then echo "$PROG: no newversiondir given" usage exit 1 elif [ ! -d "$NEWDIR" ] ; then echo "$PROG: newversiondir is not a directory" usage exit 1 elif [ `ls $NEWDIR/*.xml | wc -l` -le 0 ] ; then echo "$PROG: $NEWDIR doesn't seem to have any xml files in it" exit 1 fi if [ -z "$TMPDIR" ] ; then echo "$PROG: no temporarydir given" usage exit 1 elif [ -e "$TMPDIR" -a ! -d "$TMPDIR" ] ; then echo "$PROG: temporarydir is not a directory" usage exit 1 elif ! mkdir -p $TMPDIR/old || ! mkdir -p $TMPDIR/new ; then exit 2 fi cat > $XSLTFILE < ==================================================================== REPORT: QUERY: == MetaSQL statement - -------------------------------------------------------------------- EOF if $RUNEXTRACT ; then for DIR in $OLDDIR $NEWDIR ; do if [ "$DIR" = "$OLDDIR" ] ; then DESTDIR="$TMPDIR/old" elif [ "$DIR" = "$NEWDIR" ] ; then DESTDIR="$TMPDIR/new" else echo "$PROG: I'm confused and don't know where to write my output" exit 3 fi if ! rm -f "$DESTDIR/*" ; then exit 4 fi FILELIST=`ls $DIR/*.xml` if [ -z "$FILELIST" ] ; then echo no .xml files in $DIR exit 2 fi for FILE in $FILELIST ; do INPUTFILE=$FILE OUTPUTFILE=$DESTDIR/`basename $INPUTFILE` echo processing $INPUTFILE > /dev/stderr if [ "$XSLT" = Xalan ] ; then "$XSLT" "$INPUTFILE" "$XSLTFILE" > "$OUTPUTFILE" elif [ "$XSLT" = xsltproc ] ; then "$XSLT" "$XSLTFILE" "$INPUTFILE" > "$OUTPUTFILE" else Cannot find XSLT Processor "$XSLT" exit 2 fi done done fi # if $RUNEXTRACT RMLIST= NEWLIST= CHANGEDLIST= if [ -s $TMPDIR/diffs ] && ! rm $TMPDIR/diffs ; then exit 3 fi for FILE in `ls $TMPDIR/old/* $TMPDIR/new/* | xargs -J X -n 1 basename X | sort -u` ; do if [ -f $TMPDIR/old/$FILE -a ! -f $TMPDIR/new/$FILE ] ; then REPORTNAME="`head -3 $TMPDIR/old/$FILE | tail -1 | cut -f2 -d:`" RMLIST="$RMLIST $REPORTNAME" elif [ ! -f $TMPDIR/old/$FILE -a -f $TMPDIR/new/$FILE ] ; then REPORTNAME="`head -3 $TMPDIR/new/$FILE | tail -1 | cut -f2 -d:`" NEWLIST="$NEWLIST $REPORTNAME" else cmp -s $TMPDIR/old/$FILE $TMPDIR/new/$FILE EXITCODE=$? if [ $EXITCODE -eq 1 ]; then REPORTNAME="`head -3 $TMPDIR/new/$FILE | tail -1 | cut -f2 -d:`" CHANGEDLIST="$CHANGEDLIST $REPORTNAME" diff -E -b -i -U `wc -l $TMPDIR/new/$FILE | awk '{print $1}'` $TMPDIR/old/$FILE $TMPDIR/new/$FILE | tail -n +4 >> $TMPDIR/diffs fi fi done if [ -n "$RMLIST" ] ; then echo ==================================================================== echo REMOVED REPORTS: echo $RMLIST | tr -s [:blank:] "\n" fi if [ -n "$NEWLIST" ] ; then echo ==================================================================== echo NEW REPORTS: echo $NEWLIST | tr -s [:blank:] "\n" fi if [ -n "$CHANGEDLIST" ] ; then echo ==================================================================== echo CHANGED REPORTS: echo $CHANGEDLIST | tr -s [:blank:] "\n" echo cat $TMPDIR/diffs fi qt-client-4.1.0/utilities/runbinary.sh000077500000000000000000000020731217451700100177770ustar00rootroot00000000000000#!/bin/sh # # This file is part of the xTuple ERP: PostBooks Edition, a free and # open source Enterprise Resource Planning software suite, # Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. # It is licensed to you under the Common Public Attribution License # version 1.0, the full text of which (including xTuple-specific Exhibits) # is available at www.xtuple.com/CPAL. By using this software, you agree # to be bound by its terms. # # Get the path to this program. All the libraries and # executables we need should be in the same location. XTUPLE_DIR=`dirname $0` XTUPLE_DIR=`(cd $XTUPLE_DIR; /bin/pwd)` # Get the name of the executable we are supposed # to be running. XTUPLE_EXE=`basename $0 .sh` # Check to see if LD_LIBRARY_PATH is already set with # a value. If so then we will prepend our values. if [ -z $LD_LIBRARY_PATH ]; then LD_LIBRARY_PATH="$XTUPLE_DIR" else LD_LIBRARY_PATH="$XTUPLE_DIR":$LD_LIBRARY_PATH fi export LD_LIBRARY_PATH # Execute the real binary we want now that our # environment has been setup correctly. "$XTUPLE_DIR/$XTUPLE_EXE.bin" $@ qt-client-4.1.0/utilities/uncrustify.cfg000066400000000000000000000442451217451700100203320ustar00rootroot00000000000000# Uncrustify 0.56 newlines = auto input_tab_size = 8 output_tab_size = 2 string_escape_char = 92 string_escape_char2 = 0 indent_columns = 2 indent_continue = 0 indent_with_tabs = 0 indent_cmt_with_tabs = false indent_align_string = true indent_xml_string = 2 indent_brace = 0 indent_braces = false indent_braces_no_func = false indent_braces_no_class = false indent_braces_no_struct = false indent_brace_parent = false indent_namespace = true indent_namespace_level = 2 indent_namespace_limit = 0 indent_extern = false indent_class = true indent_class_colon = true indent_else_if = false indent_var_def_blk = 0 indent_var_def_cont = false indent_func_call_param = false indent_func_def_param = false indent_func_proto_param = false indent_func_class_param = false indent_func_ctor_var_param = false indent_template_param = false indent_func_param_double = false indent_func_const = 0 indent_func_throw = 0 indent_member = 0 indent_sing_line_comments = 0 indent_relative_single_line_comments = false indent_switch_case = 2 indent_case_shift = 0 indent_case_brace = 0 indent_col1_comment = false indent_label = 1 indent_access_spec = 0 indent_access_spec_body = true indent_paren_nl = false indent_paren_close = 0 indent_comma_paren = false indent_bool_paren = false indent_first_bool_expr = false indent_square_nl = false indent_preserve_sql = false indent_align_assign = true sp_arith = ignore sp_assign = ignore sp_assign_default = ignore sp_before_assign = ignore sp_after_assign = ignore sp_enum_assign = ignore sp_enum_before_assign = ignore sp_enum_after_assign = ignore sp_pp_concat = add sp_pp_stringify = add sp_bool = ignore sp_compare = ignore sp_inside_paren = ignore sp_paren_paren = ignore sp_balance_nested_parens = false sp_paren_brace = ignore sp_before_ptr_star = add sp_before_unnamed_ptr_star = ignore sp_between_ptr_star = ignore sp_after_ptr_star = remove sp_after_ptr_star_func = remove sp_before_ptr_star_func = add sp_before_byref = add sp_before_unnamed_byref = remove sp_after_byref = remove sp_after_byref_func = ignore sp_before_byref_func = ignore sp_after_type = force sp_template_angle = ignore sp_before_angle = ignore sp_inside_angle = ignore sp_after_angle = ignore sp_angle_paren = ignore sp_angle_word = ignore sp_before_sparen = force sp_inside_sparen = ignore sp_inside_sparen_close = remove sp_after_sparen = remove sp_sparen_brace = ignore sp_invariant_paren = ignore sp_after_invariant_paren = ignore sp_special_semi = add sp_before_semi = remove sp_before_semi_for = ignore sp_before_semi_for_empty = ignore sp_after_semi = add sp_after_semi_for = force sp_after_semi_for_empty = ignore sp_before_square = ignore sp_before_squares = ignore sp_inside_square = ignore sp_after_comma = ignore sp_before_comma = remove sp_before_ellipsis = ignore sp_after_class_colon = add sp_before_class_colon = add sp_before_case_colon = remove sp_after_operator = ignore sp_after_operator_sym = ignore sp_after_cast = remove sp_inside_paren_cast = remove sp_cpp_cast_paren = remove sp_sizeof_paren = remove sp_after_tag = ignore sp_inside_braces_enum = ignore sp_inside_braces_struct = ignore sp_inside_braces = ignore sp_inside_braces_empty = ignore sp_type_func = ignore sp_func_proto_paren = remove sp_func_def_paren = remove sp_inside_fparens = remove sp_inside_fparen = ignore sp_square_fparen = ignore sp_fparen_brace = ignore sp_func_call_paren = remove sp_func_call_user_paren = ignore sp_func_class_paren = remove sp_return_paren = add sp_attribute_paren = ignore sp_defined_paren = ignore sp_throw_paren = ignore sp_macro = ignore sp_macro_func = ignore sp_else_brace = ignore sp_brace_else = ignore sp_brace_typedef = ignore sp_catch_brace = ignore sp_brace_catch = ignore sp_finally_brace = ignore sp_brace_finally = ignore sp_try_brace = ignore sp_getset_brace = ignore sp_before_dc = remove sp_after_dc = remove sp_d_array_colon = ignore sp_not = remove sp_inv = remove sp_addr = remove sp_member = remove sp_deref = remove sp_sign = remove sp_incdec = remove sp_before_nl_cont = add sp_after_oc_scope = ignore sp_after_oc_colon = ignore sp_before_oc_colon = ignore sp_after_send_oc_colon = ignore sp_before_send_oc_colon = ignore sp_after_oc_type = ignore sp_after_oc_return_type = ignore sp_after_oc_at_sel = ignore sp_after_oc_at_sel_parens = ignore sp_inside_oc_at_sel_parens = ignore sp_before_oc_block_caret = ignore sp_after_oc_block_caret = ignore sp_cond_colon = ignore sp_cond_question = ignore sp_case_label = ignore sp_range = ignore sp_cmt_cpp_start = add sp_endif_cmt = ignore align_keep_tabs = false align_with_tabs = false align_on_tabstop = true align_number_left = false align_func_params = true align_same_func_call_params = true align_var_def_span = 2 align_var_def_star_style = 2 align_var_def_amp_style = 2 align_var_def_thresh = 8 align_var_def_gap = 0 align_var_def_colon = false align_var_def_attribute = false align_var_def_inline = true align_assign_span = 2 align_assign_thresh = 8 align_enum_equ_span = 2 align_enum_equ_thresh = 8 align_var_struct_span = 2 align_var_struct_thresh = 8 align_var_struct_gap = 0 align_struct_init_span = 2 align_typedef_gap = 0 align_typedef_span = 2 align_typedef_func = 0 align_typedef_star_style = 2 align_typedef_amp_style = 2 align_right_cmt_span = 2 align_right_cmt_mix = false align_right_cmt_gap = 1 align_right_cmt_at_col = 1 align_func_proto_span = 2 align_func_proto_gap = 1 align_on_operator = false align_mix_var_proto = true align_single_line_func = true align_single_line_brace = true align_single_line_brace_gap = 0 align_oc_msg_spec_span = 2 align_nl_cont = false align_pp_define_gap = 0 align_pp_define_span = 2 align_left_shift = true align_oc_msg_colon_span = 2 align_oc_decl_colon = false nl_collapse_empty_body = false nl_assign_leave_one_liners = true nl_class_leave_one_liners = true nl_enum_leave_one_liners = true nl_getset_leave_one_liners = true nl_func_leave_one_liners = true nl_if_leave_one_liners = false nl_start_of_file = remove nl_start_of_file_min = 0 nl_end_of_file = force nl_end_of_file_min = 1 nl_assign_brace = ignore nl_assign_square = ignore nl_after_square_assign = ignore nl_func_var_def_blk = 0 nl_fcall_brace = add nl_enum_brace = force nl_struct_brace = force nl_union_brace = force nl_if_brace = force nl_brace_else = force nl_elseif_brace = force nl_else_brace = force nl_else_if = remove nl_brace_finally = force nl_finally_brace = force nl_try_brace = force nl_getset_brace = force nl_for_brace = force nl_catch_brace = force nl_brace_catch = force nl_while_brace = force nl_using_brace = force nl_brace_brace = force nl_do_brace = force nl_brace_while = remove nl_switch_brace = force nl_multi_line_cond = true nl_multi_line_define = false nl_before_case = true nl_before_throw = force nl_after_case = true nl_namespace_brace = force nl_template_class = force nl_class_brace = force nl_class_init_args = ignore nl_func_type_name = remove # ignore? nl_func_type_name_class = ignore nl_func_scope_name = remove nl_func_proto_type_name = remove nl_func_paren = remove nl_func_decl_start = remove nl_func_decl_start_single = remove nl_func_decl_args = remove nl_func_decl_end = remove nl_func_decl_end_single = remove nl_func_decl_empty = remove nl_fdef_brace = force nl_after_return = true nl_return_expr = remove nl_after_semicolon = true nl_after_brace_open = true nl_after_brace_open_cmt = true nl_after_vbrace_open = true nl_after_vbrace_open_empty = true nl_after_brace_close = true nl_after_vbrace_close = true nl_define_macro = false nl_squeeze_ifdef = false nl_before_if = ignore nl_after_if = ignore nl_before_for = ignore nl_after_for = ignore nl_before_while = ignore nl_after_while = ignore nl_before_switch = ignore nl_after_switch = ignore nl_before_do = ignore nl_after_do = ignore nl_ds_struct_enum_cmt = false nl_ds_struct_enum_close_brace = false nl_class_colon = ignore nl_create_if_one_liner = false nl_create_for_one_liner = false nl_create_while_one_liner = false pos_arith = trail pos_assign = trail pos_bool = trail pos_compare = trail pos_conditional = trail pos_comma = trail pos_class_comma = trail pos_class_colon = ignore code_width = 0 ls_for_split_full = false ls_func_split_full = false nl_max = 2 nl_after_func_proto = 0 nl_after_func_proto_group = 1 nl_after_func_body = 2 nl_after_func_body_one_liner = 0 nl_before_block_comment = 1 nl_before_c_comment = 0 nl_before_cpp_comment = 0 nl_after_multiline_comment = false nl_before_access_spec = 2 nl_after_access_spec = 0 nl_comment_func_def = 1 nl_after_try_catch_finally = 0 nl_around_cs_property = 0 nl_between_get_set = 0 eat_blanks_after_open_brace = true eat_blanks_before_close_brace = true mod_full_brace_do = ignore mod_full_brace_for = ignore mod_full_brace_function = ignore mod_full_brace_if = ignore mod_full_brace_if_chain = false mod_full_brace_nl = 0 mod_full_brace_while = ignore mod_full_brace_using = ignore mod_paren_on_return = ignore mod_pawn_semicolon = false mod_full_paren_if_bool = false mod_remove_extra_semicolon = false mod_add_long_function_closebrace_comment = 0 mod_add_long_switch_closebrace_comment = 0 mod_add_long_ifdef_endif_comment = 0 mod_add_long_ifdef_else_comment = 0 mod_sort_import = false mod_sort_using = false mod_sort_include = false mod_move_case_break = false mod_case_brace = ignore mod_remove_empty_return = false cmt_width = 0 cmt_reflow_mode = 0 cmt_indent_multi = false cmt_c_group = false cmt_c_nl_start = false cmt_c_nl_end = false cmt_cpp_group = false cmt_cpp_nl_start = false cmt_cpp_nl_end = false cmt_cpp_to_c = false cmt_star_cont = false cmt_sp_before_star_cont = 0 cmt_sp_after_star_cont = 0 cmt_multi_check_last = true cmt_insert_file_header = "" cmt_insert_file_footer = "" cmt_insert_func_header = "" cmt_insert_class_header = "" cmt_insert_before_preproc = false pp_indent = ignore pp_indent_at_level = false pp_indent_count = 1 pp_space = ignore pp_space_count = 0 pp_indent_region = 0 pp_region_indent_code = false pp_indent_if = 0 pp_if_indent_code = false pp_define_at_level = false qt-client-4.1.0/widgets/000077500000000000000000000000001217451700100150605ustar00rootroot00000000000000qt-client-4.1.0/widgets/addressCluster.cpp000066400000000000000000001021671217451700100205620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include "xsqlquery.h" #include "xcheckbox.h" #include "addresscluster.h" #include "errorReporter.h" #define DEBUG false void AddressCluster::init() { _list = new QPushButton(tr("..."), this); _list->setObjectName("_list"); _list->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); #ifndef Q_WS_MAC _list->setMaximumWidth(25); #else _list->setMinimumWidth(60); _list->setMinimumHeight(32); #endif _titleSingular = tr("Address"); _titlePlural = tr("Addresses"); _query = "SELECT * FROM address "; _searchAcctId = -1; // handle differences between VirtualCluster and AddressCluster _grid->removeWidget(_label); _grid->removeWidget(_description); delete _description; _description = 0; _addrChange = new XLineEdit(this); _number = new XLineEdit(this); _addrLit = new QLabel(tr("Street\nAddress:"), this); _addr1 = new XLineEdit(this); _addr2 = new XLineEdit(this); _addr3 = new XLineEdit(this); _cityLit = new QLabel(tr("City:"), this); _city = new XLineEdit(this); _stateLit = new QLabel(tr("State:")); _state = new XComboBox(this, "_state"); _postalcodeLit = new QLabel(tr("Postal:")); _postalcode = new XLineEdit(this); _countryLit = new QLabel(tr("Country:")); _country = new XComboBox(this, "_country"); _active = new QCheckBox(tr("Active"), this); _mapper = new XDataWidgetMapper(this); _addrChange->hide(); #if defined Q_OS_MAC _city->setMinimumWidth(110); #else _city->setMinimumWidth(85); #endif if (! DEBUG) _number->hide(); _addrLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _cityLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _stateLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _state->setEditable(true); _state->setAllowNull(true); _country->setMaximumWidth(250); _country->setEditable(! (_x_metrics && _x_metrics->boolean("StrictAddressCountry"))); if (DEBUG) qDebug("%s::_country.isEditable() = %d", (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())), _country->isEditable()); _postalcodeLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _countryLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _grid->setMargin(0); _grid->setSpacing(2); _grid->addWidget(_label, 0, 0, 1, -1); _grid->addWidget(_addrLit, 1, 0, 3, 1); _grid->addWidget(_addr1, 1, 1, 1, -1); _grid->addWidget(_addr2, 2, 1, 1, -1); _grid->addWidget(_addr3, 3, 1, 1, -1); _grid->addWidget(_cityLit, 5, 0); _grid->addWidget(_city, 5, 1); _grid->addWidget(_stateLit, 5, 2); _grid->addWidget(_state, 5, 3); _grid->addWidget(_postalcodeLit, 5, 4); _grid->addWidget(_postalcode, 5, 5, 1, 2); _grid->addWidget(_countryLit, 4, 0); _grid->addWidget(_country, 4, 1, 1, 3); _grid->addWidget(_active, 4, 4); QHBoxLayout* hbox = new QHBoxLayout; hbox->addWidget(_list); _grid->addLayout(hbox, 4, 5, 1, -1, Qt::AlignRight); _grid->setColumnStretch(0, 0); _grid->setColumnStretch(1, 3); _grid->setColumnStretch(2, 0); _grid->setColumnStretch(3, 1); _grid->setColumnStretch(4, 0); _grid->setColumnStretch(5, 2); #if defined Q_WS_MAC setMinimumSize(_grid->columnCount() * 60, 132); #endif connect(_list, SIGNAL(clicked()), this, SLOT(sEllipses())); connect(_addr1, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_addr2, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_addr3, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_city, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_state, SIGNAL(editTextChanged(const QString&)), this, SIGNAL(changed())); connect(_state, SIGNAL(newID(int)), this, SIGNAL(changed())); connect(_postalcode,SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_country,SIGNAL(editTextChanged(const QString&)),this, SLOT(setCountry(const QString&))); connect(_country, SIGNAL(newID(int)), this, SIGNAL(changed())); connect(_country, SIGNAL(newID(int)), this, SLOT(populateStateComboBox())); connect(_addr1, SIGNAL(requestList()), this, SLOT(sList())); connect(_addr2, SIGNAL(requestList()), this, SLOT(sList())); connect(_addr3, SIGNAL(requestList()), this, SLOT(sList())); connect(_city, SIGNAL(requestList()), this, SLOT(sList())); connect(_postalcode, SIGNAL(requestList()), this, SLOT(sList())); connect(_addr1, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_addr2, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_addr3, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_city, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_postalcode, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_addr1, SIGNAL(textChanged(QString)), this, SLOT(emitAddressChanged())); connect(_addr2, SIGNAL(textChanged(QString)), this, SLOT(emitAddressChanged())); connect(_addr3, SIGNAL(textChanged(QString)), this, SLOT(emitAddressChanged())); connect(_city, SIGNAL(textChanged(QString)), this, SLOT(emitAddressChanged())); connect(_postalcode,SIGNAL(textChanged(QString)), this, SLOT(emitAddressChanged())); setFocusProxy(_addr1); setFocusPolicy(Qt::StrongFocus); setLabel(""); setActiveVisible(false); silentSetId(-1); _list->show(); _mode = Edit; } AddressCluster::AddressCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { init(); } void AddressCluster::populateStateComboBox() { if(_x_metrics == 0) return; QString tmpstate = _state->currentText(); if (DEBUG) qDebug("%s::populateStateComboBox() entered country %d/%s (matching id = %d) with state %s", (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())), _country->id(), qPrintable(_country->currentText()), _country->id() == _country->id(_country->findText(_country->currentText(), Qt::MatchExactly)), qPrintable(tmpstate)); _state->clear(); XSqlQuery stateq; if (_country->id() >= 0 && _country->id() == _country->id(_country->findText(_country->currentText(), Qt::MatchExactly))) { MetaSQLQuery state("SELECT DISTINCT state_id," " CASE WHEN state_abbr IS NULL THEN state_name" " WHEN TRIM(state_abbr) = '' THEN state_name" " ELSE state_abbr END," " CASE WHEN state_abbr IS NULL THEN state_name" " WHEN TRIM(state_abbr) = '' THEN state_name" " ELSE state_abbr END" " FROM state" " WHERE (state_country_id=) " "ORDER BY 2;"); ParameterList params; params.append("country_id", _country->id()); stateq = state.toQuery(params); _state->populate(stateq); _state->setEditable(_state->count() <= 1 || (! tmpstate.isEmpty() && ! (_state->findText(tmpstate, Qt::MatchExactly) >= 0))); if (_state->count() <= 1) { if (DEBUG) qDebug("%s::populateStateComboBox() find states for stateless country", (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName()))); stateq.prepare("SELECT MIN(addr_id), addr_state, addr_state" " FROM addr" " WHERE (addr_country=:country)" " GROUP BY addr_state" " ORDER BY addr_state;"); stateq.bindValue(":country", _country->currentText()); stateq.exec(); _state->populate(stateq); } } else { stateq.exec("SELECT MIN(addr_id), addr_state, addr_state" " FROM addr" " GROUP BY addr_state" " ORDER BY addr_state;"); _state->populate(stateq); _state->setEditable(true); } if (_state->isEditable()) _state->setEditText(tmpstate); else _state->setText(tmpstate); if (DEBUG) qDebug("%s::populateStateComboBox() returning id %d, text %s, tmpstate %s", (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())), _state->id(), qPrintable(_state->currentText()), qPrintable(tmpstate)); } void AddressCluster::populateCountryComboBox() { if(_x_metrics == 0) return; _country->clear(); XSqlQuery country; country.prepare("SELECT -1, '','' AS country_name " "UNION " "SELECT country_id, country_name, country_name " "FROM country ORDER BY country_name;"); country.exec(); _country->populate(country); setCountry(_x_metrics->value("DefaultAddressCountry")); } void AddressCluster::setNumber(QString pNumber) { XSqlQuery address; address.prepare("SELECT addr_id FROM addr WHERE (addr_number=:addr_number);"); address.bindValue(":addr_number", pNumber); address.exec(); if (address.first()) setId(address.value("addr_id").toInt()); else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Id"), address, __FILE__, __LINE__)) return; } void AddressCluster::setId(const int pId) { if (pId == _id) return; silentSetId(pId); emit newId(pId); } void AddressCluster::silentSetId(const int pId) { if (pId == -1) { _id = pId; _valid = false; clear(); } else { clear(); XSqlQuery idQ; idQ.prepare("SELECT * from addr WHERE addr_id = :id;"); idQ.bindValue(":id", pId); idQ.exec(); if (idQ.first()) { _id = pId; _valid = true; _number->setText(idQ.value("addr_number").toString()); _addr1->setText(idQ.value("addr_line1").toString()); _addr2->setText(idQ.value("addr_line2").toString()); _addr3->setText(idQ.value("addr_line3").toString()); _city->setText(idQ.value("addr_city").toString()); _postalcode->setText(idQ.value("addr_postalcode").toString()); // set country before state or populateStateComboBox may clear the state setCountry(idQ.value("addr_country").toString()); setState(idQ.value("addr_state").toString()); _active->setChecked(idQ.value("addr_active").toBool()); _notes = idQ.value("addr_notes").toString(); if (_mapper->model()) { _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_number)), _number->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_active)), _active->isChecked()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_addr1)), _addr1->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_addr2)), _addr2->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_addr3)), _addr3->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_city)), _city->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_state)), _state->currentText()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_postalcode)), _postalcode->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_country)), _country->currentText()); } c_number = _number->text(); c_addr1 = _addr1->text(); c_addr2 = _addr2->text(); c_addr3 = _addr3->text(); c_city = _city->text(); c_state = _state->currentText(); c_postalcode = _postalcode->text(); c_country = _country->currentText(); c_active = _active->isChecked(); c_notes = _notes; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Setting Id"), idQ, __FILE__, __LINE__)) return; } // _parsed = TRUE; } void AddressCluster::setState(const QString &p) { if (DEBUG) qDebug("%s::setState(%s) entered", (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())), qPrintable(p)); if (p == _state->currentText()) return; if (p.isEmpty()) _state->setId(-1); else if (_state->findText(p, Qt::MatchExactly) >= 0) _state->setText(p); else // invalid state? { _state->setEditable(true); _state->setEditText(p); } emitAddressChanged(); } void AddressCluster::setCountry(const QString& p) { if (DEBUG) qDebug("%s::setCountry(%s) entered", (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())), qPrintable(p)); if (p == _country->currentText()) return; int matchid = _country->id(_country->findText(p, Qt::MatchExactly)); if (p.isEmpty()) { if (DEBUG) qDebug("%s::setCountry() handling empty country", (objectName().isEmpty() ? "AddressCluster" : qPrintable(objectName()))); _country->setEditable(! (_x_metrics && _x_metrics->boolean("StrictAddressCountry"))); _country->setId(-1); } else if (matchid >= 0) { if (DEBUG) qDebug("%s::setCountry(%s) found matching country", (objectName().isEmpty() ? "AddressCluster":qPrintable(objectName())), qPrintable(p)); _country->setEditable(! (_x_metrics && _x_metrics->boolean("StrictAddressCountry"))); _country->setId(matchid); } else { _country->setEditable(true); _country->setId(-1); bool blocked = _country->blockSignals(true); _country->setEditText(p); _country->blockSignals(blocked); } emitAddressChanged(); } void AddressCluster::clear() { _id = -1; _valid = false; populateCountryComboBox(); // reset cache c_active = true; c_addr1 = ""; c_addr2 = ""; c_addr3 = ""; c_city = ""; c_state = ""; c_postalcode = ""; c_country = ""; c_notes = ""; _number->clear(); _addr1->clear(); _addr2->clear(); _addr3->clear(); _city->clear(); _state->setText(QString()); _postalcode->clear(); _active->setChecked(c_active); _selected = false; } void AddressCluster::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(_addrChange , _fieldNameAddrChange, "text", "defaultText"); m->addMapping(_active, _fieldNameActive, "text", "defaultText"); m->addMapping(_number, _fieldNameNumber, "text", "defaultText"); m->addMapping(_addr1, _fieldNameLine1, "text", "defaultText"); m->addMapping(_addr2, _fieldNameLine2, "text", "defaultText"); m->addMapping(_addr3, _fieldNameLine3, "text", "defaultText"); m->addMapping(_city, _fieldNameCity, "text", "defaultText"); m->addMapping(_postalcode, _fieldNamePostalCode, "text", "defaultText"); _state->setFieldName(_fieldNameState); _state->setDataWidgetMap(m); _country->setFieldName(_fieldNameCountry); _country->setDataWidgetMap(m); _mapper=m; } /* return +N addr_id if save is successful or if found another addr with the same info return 0 if there is no address to save return -1 if there was an error return -2 if there are N contacts sharing this address */ int AddressCluster::save(enum SaveFlags flag) { if (_number->text() == "" && _addr1->text() == "" && _addr2->text() == "" && _addr3->text() == "" && _city->text() == "" && _state->currentText() == "" && _postalcode->text() == "" && (_country->currentText() == "" || (_x_metrics && _country->currentText()==_x_metrics->value("DefaultAddressCountry"))) ) { silentSetId(-1); return 0; } if (_x_metrics && _x_metrics->boolean("StrictAddressCountry") && !_country->currentText().isEmpty() && _country->findText(_country->currentText(), Qt::MatchExactly) < 0) { QMessageBox::critical(this, tr("Error"), tr("

    This address appears to have a non-standard " "country. Please select a country from the list " "before saving.")); return -3; } XSqlQuery datamodQ; datamodQ.prepare("SELECT saveAddr(:addr_id,:addr_number,:addr1,:addr2,:addr3," ":city,:state,:postalcode,:country,:active,:notes,:flag) AS result;"); datamodQ.bindValue(":addr_id", id()); if (!_number->text().isEmpty()) datamodQ.bindValue(":addr_number", _number->text()); datamodQ.bindValue(":addr1", _addr1->text()); datamodQ.bindValue(":addr2", _addr2->text()); datamodQ.bindValue(":addr3", _addr3->text()); datamodQ.bindValue(":city", _city->text()); datamodQ.bindValue(":state", _state->currentText()); datamodQ.bindValue(":postalcode", _postalcode->text()); datamodQ.bindValue(":country", _country->currentText()); datamodQ.bindValue(":active", QVariant(_active->isChecked())); datamodQ.bindValue(":notes", _notes); if (flag == CHECK) datamodQ.bindValue(":flag", QString("CHECK")); else if (flag == CHANGEALL) datamodQ.bindValue(":flag", QString("CHANGEALL")); else if (flag == CHANGEONE) datamodQ.bindValue(":flag", QString("CHANGEONE")); else return -1; datamodQ.exec(); if (datamodQ.first()) { if (datamodQ.value("result").toInt() > 0) { _id=datamodQ.value("result").toInt(); _selected = FALSE; _valid = true; silentSetId(id()); return id(); } if (datamodQ.value("result").toInt() == -2) return -2; else return -1; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Saving Address"), datamodQ, __FILE__, __LINE__)) return -1; return id(); } void AddressCluster::check() { //If this is mapped then we need to check whether change flags need to be set if (_mapper->model()) { XSqlQuery tx; tx.exec("BEGIN;"); int result=save(CHECK); tx.exec("ROLLBACK;"); if (result == -2) { int answer = 2; // Cancel answer = QMessageBox::question(this, tr("Question Saving Address"), tr("

    There are multiple Contacts sharing this Address.

    " "

    What would you like to do?

    "), tr("Change This One"), tr("Change Address for All"), 0, 0); if (answer==0) _addrChange->setText("CHANGEONE"); else if (answer==1) _addrChange->setText("CHANGEALL"); // Make sure the mapper is aware of this change if (_mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_addrChange))).toString() != _addrChange->text()) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_addrChange)), _addrChange->text()); } else if (result < 0) { QMessageBox::critical(this, tr("Error"), tr("There was an error checking this Address (%1).").arg(result)); return; } } } void AddressCluster::emitAddressChanged() { emit addressChanged( _addr1->text(), _addr2->text(), _addr3->text(), _city->text(), _state->currentText(), _postalcode->text(), _country->currentText()); } void AddressCluster::sEllipses() { if (_x_preferences && _x_preferences->value("DefaultEllipsesAction") == "search") sSearch(); else sList(); } void AddressCluster::sInfo() { /* AddressInfo* newdlg = new AddressInfo(this, "AddressInfo", true)); if (newdlg) { int id = newdlg->exec(); setId(id); } else */ QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sInfo() not yet defined").arg(metaObject()->className())); } void AddressCluster::sList() { AddressList* newdlg = new AddressList(this); if (newdlg) { int id = newdlg->exec(); if (id != QDialog::Rejected) { setId(id); _selected = true; } } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("Could not instantiate a List Dialog")); } void AddressCluster::sSearch() { AddressSearch* newdlg = new AddressSearch(this); if (newdlg) { int id = newdlg->exec(); if (id != QDialog::Rejected) { setId(id); _selected = true; } } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("Could not instantiate a Search Dialog")); } void AddressCluster::setActiveVisible(const bool p) { _active->setHidden(!p); if (p) { _grid->removeWidget(_country); _grid->addWidget(_active, 4, 4); _grid->addWidget(_country, 4, 1, 1, 3); } else { _grid->removeWidget(_active); _grid->removeWidget(_country); _grid->addWidget(_country, 4, 1, 1, 4); } } void AddressCluster::setAddrChange(QString p) { _addrChange->setText(p); if (_mapper->model() && _mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_addrChange))).toString() != _addrChange->text()) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_addrChange)), _addrChange->text()); } /////////////////////////////////////////////////////////////////////////// AddressList::AddressList(QWidget* pParent, const char* pName, bool, Qt::WFlags) : VirtualList(pParent, 0) { _parent = (AddressCluster*)(pParent); if (!pName) setObjectName("AddressList"); else setObjectName(pName); _id = _parent->_id; setWindowTitle(_parent->_titlePlural); _listTab->setColumnCount(0); _listTab->addColumn(tr("CRM Account"), -1, Qt::AlignLeft, true, "crmacct_name"); _listTab->addColumn(tr("Line 1"), -1, Qt::AlignLeft, true, "addr_line1"); _listTab->addColumn(tr("Line 2"), 75, Qt::AlignLeft, true, "addr_line2"); _listTab->addColumn(tr("Line 3"), 75, Qt::AlignLeft, true, "addr_line3"); _listTab->addColumn(tr("City"), 75, Qt::AlignLeft, true, "addr_city"); _listTab->addColumn(tr("State"), 50, Qt::AlignLeft, true, "addr_state"); _listTab->addColumn(tr("Country"), 50, Qt::AlignLeft, true, "addr_country"); _listTab->addColumn(tr("Postal Code"), 50, Qt::AlignLeft, true, "addr_postalcode"); resize(700, size().height()); _searchAcct = new QCheckBox(); _searchAcct->setMaximumWidth(480); XSqlQuery crmacct; crmacct.prepare("SELECT crmacct_number || ' - ' || crmacct_name AS account " "FROM crmacct " "WHERE (crmacct_id = :crmacct_id);"); crmacct.bindValue(":crmacct_id", _parent->_searchAcctId); crmacct.exec(); if (crmacct.first()) { _searchAcct->setChecked(true); _dialogLyt->addWidget(_searchAcct); _searchAcct->setText(tr("Only addresses for %1").arg(crmacct.value("account").toString())); connect(_searchAcct, SIGNAL(toggled(bool)), this, SLOT(sFillList())); } sFillList(); } void AddressList::sFillList() { _listTab->clear(); QString crmacctClause; if (_searchAcct->isChecked()) _parent->_extraClause = QString("WHERE (crmacct_id=%1) ").arg(_parent->_searchAcctId); else _parent->_extraClause = QString(); XSqlQuery query; query.prepare(_parent->_query + _parent->_extraClause + " ORDER BY addr_country, addr_state, addr_postalcode;"); query.exec(); query.first(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Addresses"), query, __FILE__, __LINE__)) return; else if (query.size() < 1)// no rows found with limit so try without { query.prepare(_parent->_query + " ORDER BY addr_country, addr_state, addr_postalcode;"); query.exec(); query.first(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Addresses"), query, __FILE__, __LINE__)) return; } _listTab->populate(query); } /* do this differently than VirtualList::sSearch(QString&): look for any consecutive characters that match, not just the first field */ void AddressList::sSearch(const QString& pTarget) { XTreeWidgetItem *target = 0; for (int i = 0; i < _listTab->topLevelItemCount(); i++) { target = _listTab->topLevelItem(i); if (target == NULL || (target->text(0) + " " + target->text(1) + " " + target->text(2) + " " + target->text(3) + " " + target->text(4) + " " + target->text(5) + " " + target->text(6) + " " + target->text(7)).contains(pTarget.toUpper(), Qt::CaseInsensitive)) break; } if (target) { _listTab->setCurrentItem(target); _listTab->scrollToItem(target); } } /////////////////////////////////////////////////////////////////////////// AddressSearch::AddressSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { // remove the stuff we won't use disconnect(_searchNumber, SIGNAL(toggled(bool)), this, SLOT(sFillList())); disconnect(_searchName, SIGNAL(toggled(bool)), this, SLOT(sFillList())); disconnect(_searchDescrip, SIGNAL(toggled(bool)), this, SLOT(sFillList())); selectorsLyt->removeWidget(_searchNumber); selectorsLyt->removeWidget(_searchName); selectorsLyt->removeWidget(_searchNumber); delete _searchNumber; delete _searchName; delete _searchDescrip; _listTab->setColumnCount(0); _searchStreet = new XCheckBox(tr("Search Street Address"),this); _searchCity = new XCheckBox(tr("Search City"),this); _searchState = new XCheckBox(tr("Search State"),this); _searchCountry = new XCheckBox(tr("Search Country"),this); _searchPostalCode = new XCheckBox(tr("Search Postal Code"),this); _searchInactive = new XCheckBox(tr("Show Inactive Addresses"),this); _searchStreet->setObjectName("_searchStreet"); _searchCity->setObjectName("_searchCity"); _searchState->setObjectName("_searchState"); _searchCountry->setObjectName("_searchCountry"); _searchPostalCode->setObjectName("_searchPostalCode"); _searchInactive->setObjectName("_searchInactive"); selectorsLyt->addWidget(_searchStreet, 0, 0); selectorsLyt->addWidget(_searchCity, 1, 0); selectorsLyt->addWidget(_searchState, 2, 0); selectorsLyt->addWidget(_searchCountry, 3, 0); selectorsLyt->addWidget(_searchPostalCode, 4, 0); selectorsLyt->addWidget(_searchInactive, 0, 1); connect(_searchStreet, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchCity, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchState, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchCountry, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchPostalCode, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchInactive, SIGNAL(toggled(bool)), this, SLOT(sFillList())); _listTab->addColumn(tr("CRM Account"), -1, Qt::AlignLeft, true, "crmacct_name"); _listTab->addColumn(tr("Line 1"), -1, Qt::AlignLeft, true, "addr_line1"); _listTab->addColumn(tr("Line 2"), 75, Qt::AlignLeft, true, "addr_line2"); _listTab->addColumn(tr("Line 3"), 75, Qt::AlignLeft, true, "addr_line3"); _listTab->addColumn(tr("City"), 75, Qt::AlignLeft, true, "addr_city"); _listTab->addColumn(tr("State"), 50, Qt::AlignLeft, true, "addr_state"); _listTab->addColumn(tr("Country"), 50, Qt::AlignLeft, true, "addr_country"); _listTab->addColumn(tr("Postal Code"), 50, Qt::AlignLeft, true, "addr_postalcode"); resize(700, size().height()); _parent = (AddressCluster*)(pParent); setObjectName("virtualSearch"); setWindowTitle(_parent->_titlePlural); _titleLit->setText(_parent->_titlePlural); _id = _parent->_id; _searchAcct = new QCheckBox(); _searchAcct->setMaximumWidth(480); _dialogLyt->addWidget(_searchAcct); XSqlQuery crmacct; crmacct.prepare("SELECT crmacct_number || ' - ' || crmacct_name AS account " "FROM crmacct " "WHERE (crmacct_id = :crmacct_id);"); crmacct.bindValue(":crmacct_id", _parent->_searchAcctId); crmacct.exec(); if (crmacct.first()) { _searchAcct->setChecked(true); _searchAcct->setText(tr("Only addresses for %1").arg(crmacct.value("account").toString())); connect(_searchAcct, SIGNAL(toggled(bool)), this, SLOT(sFillList())); } else _searchAcct->hide(); } void AddressSearch::sFillList() { _listTab->clear(); if (_search->text().isEmpty() || (!_searchStreet->isChecked() && !_searchCity->isChecked() && !_searchState->isChecked() && !_searchCountry->isChecked() && !_searchPostalCode->isChecked() )) return; QString sql = _parent->_query + " " " " "" " WHERE true " " " " " " AND addr_active " "" " " " AND (" " " " crmacct_name || '\n' || " "" " " " addr_line1 || '\n' || addr_line2 || '\n' || addr_line3 || '\n' " " " " '\n' " " " " " " || addr_city || '\n' " " " " " " || addr_state || '\n' " " " " " " || addr_country || '\n' " " " " " " || addr_postalcode || '\n' " " " " ~* )" "" " " " crmacct_name ~* " "" "" "ORDER BY addr_country, addr_state, addr_postalcode;"; ParameterList params; if (_searchAcct->isChecked()) _parent->_extraClause = QString(" WHERE crmacct_id=%1").arg(_parent->_searchAcctId); else _parent->_extraClause = QString(); if (_searchStreet->isChecked()) params.append("searchStreet"); if (_searchCity->isChecked()) params.append("searchCity"); if (_searchState->isChecked()) params.append("searchState"); if (_searchCountry->isChecked()) params.append("searchCountry"); if (_searchPostalCode->isChecked()) params.append("searchPostalCode"); if (_searchInactive->isChecked()) params.append("searchInactive"); if (! _parent->_extraClause.isEmpty()) params.append("extraClause", _parent->_extraClause); params.append("searchText", _search->text()); MetaSQLQuery mql(sql); XSqlQuery query = mql.toQuery(params); query.exec(); _listTab->populate(query); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Searching Addresses"), query, __FILE__, __LINE__)) return; } void AddressCluster::setMode(Mode p) { if (p == _mode) return; bool enabled = (p == Edit); QList widgets = findChildren(); for (int i = 0; i < widgets.size(); i++) widgets.at(i)->setEnabled(enabled); if (p == Select) _list->setEnabled(true); } qt-client-4.1.0/widgets/addresscluster.h000066400000000000000000000220551217451700100202640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef addressCluster_h #define addressCluster_h #include "widgets.h" #include "virtualCluster.h" #include "xcheckbox.h" #include "xcombobox.h" #include #include #include #include #include class QGridLayout; class AddressCluster; class XTUPLEWIDGETS_EXPORT AddressList : public VirtualList { Q_OBJECT friend class AddressCluster; friend class AddressInfo; friend class AddressSearch; public: AddressList(QWidget*, const char* = 0, bool = false, Qt::WFlags = 0); public slots: virtual void sFillList(); virtual void sSearch(const QString& pTarget); protected: AddressCluster* _parent; QLabel* _searchLit; QLineEdit* _search; QLabel* _titleLit; QPushButton* _close; QPushButton* _select; XTreeWidget* _list; QCheckBox* _searchAcct; }; class XTUPLEWIDGETS_EXPORT AddressSearch : public VirtualSearch { Q_OBJECT friend class AddressCluster; public: AddressSearch(QWidget*, Qt::WindowFlags = 0); public slots: virtual void sFillList(); protected: AddressCluster* _parent; XCheckBox* _searchStreet; XCheckBox* _searchCity; XCheckBox* _searchState; XCheckBox* _searchCountry; XCheckBox* _searchPostalCode; XCheckBox* _searchInactive; QCheckBox* _searchAcct; }; class XTUPLEWIDGETS_EXPORT AddressCluster : public VirtualCluster { Q_OBJECT Q_ENUMS (Mode) Q_PROPERTY(bool activeVisible READ activeVisible WRITE setActiveVisible) Q_PROPERTY(QString fieldNameAddressChange READ fieldNameAddrChange WRITE setFieldNameAddrChange) Q_PROPERTY(QString fieldNameNumber READ fieldNameNumber WRITE setFieldNameNumber) Q_PROPERTY(QString fieldNameActive READ fieldNameActive WRITE setFieldNameActive) Q_PROPERTY(QString fieldNameLine1 READ fieldNameLine1 WRITE setFieldNameLine1) Q_PROPERTY(QString fieldNameLine2 READ fieldNameLine2 WRITE setFieldNameLine2) Q_PROPERTY(QString fieldNameLine3 READ fieldNameLine3 WRITE setFieldNameLine3) Q_PROPERTY(QString fieldNameCity READ fieldNameCity WRITE setFieldNameCity) Q_PROPERTY(QString fieldNameState READ fieldNameState WRITE setFieldNameState) Q_PROPERTY(QString fieldNamePostalCode READ fieldNamePostalCode WRITE setFieldNamePostalCode) Q_PROPERTY(QString fieldNameCountry READ fieldNameCountry WRITE setFieldNameCountry) Q_PROPERTY(Mode mode READ mode WRITE setMode) friend class AddressInfo; friend class AddressList; friend class AddressSearch; public: enum SaveFlags { CHECK = 0, CHANGEONE = 1, CHANGEALL = 2 }; enum Mode { Edit, View, Select }; AddressCluster(QWidget*, const char* = 0); inline virtual bool activeVisible() const { return _active->isVisible(); }; inline virtual QString addrChange() const { return _addrChange->text(); }; Q_INVOKABLE virtual QString city() const { return _city->text(); } Q_INVOKABLE virtual QString country() const { return _country->currentText(); } Q_INVOKABLE virtual QString description() const { return ""; } Q_INVOKABLE virtual bool isValid() const { return _valid; } inline virtual QString label() const { return _label->text(); }; Q_INVOKABLE virtual QString line1() const { return _addr1->text(); } Q_INVOKABLE virtual QString line2() const { return _addr2->text(); } Q_INVOKABLE virtual QString line3() const { return _addr3->text(); } Q_INVOKABLE virtual int id() const { return _id; } Q_INVOKABLE virtual Mode mode() const { return _mode; }; inline virtual QString notes() const { return _notes; }; Q_INVOKABLE virtual QString number() const { return _number->text(); }; Q_INVOKABLE virtual QString postalCode() const { return _postalcode->text(); } Q_INVOKABLE virtual QString state() const { return _state->currentText(); } Q_INVOKABLE virtual int searchAcctId() { return _searchAcctId; } // Return data map values virtual QString fieldNameAddrChange() const { return _fieldNameAddrChange; }; virtual QString fieldNameNumber() const { return _fieldNameNumber; }; virtual QString fieldNameActive() const { return _fieldNameActive; }; virtual QString fieldNameLine1() const { return _fieldNameLine1; }; virtual QString fieldNameLine2() const { return _fieldNameLine2; }; virtual QString fieldNameLine3() const { return _fieldNameLine3; }; virtual QString fieldNameCity() const { return _fieldNameCity; }; virtual QString fieldNamePostalCode() const { return _fieldNamePostalCode; }; virtual QString fieldNameState() const { return _fieldNameState; }; virtual QString fieldNameCountry() const { return _fieldNameCountry; }; public slots: inline virtual void clearExtraClause() { }; inline virtual void setExtraClause(const QString&) { }; virtual void setActiveVisible(const bool p); virtual void setAddrChange(QString p); inline virtual void setCity(const QString& p) { _city->setText(p); }; virtual void setCountry(const QString& p); inline virtual void setDescription(const QString&) { }; inline virtual void setLabel(const QString& p) { _label->setText(p); _label->setHidden(_label->text().isEmpty()); }; inline virtual void setLine1(const QString& p) { _addr1->setText(p); }; inline virtual void setLine2(const QString& p) { _addr2->setText(p); }; inline virtual void setLine3(const QString& p) { _addr3->setText(p); }; virtual void setMode(const Mode p); inline virtual void setNotes(const QString& p) { _notes = p; }; virtual void setNumber(QString p); virtual void setNumber(const int) {}; inline virtual void setPostalCode(const QString& p) { _postalcode->setText(p); }; virtual void setState(const QString& p); virtual void setListVisible(bool p) { _list->setVisible(p); } virtual void clear(); virtual void sEllipses(); virtual void sInfo(); virtual void sList(); virtual void sSearch(); virtual void setId(const int); virtual void setSearchAcct(const int crmAcctId) { _searchAcctId = crmAcctId; } virtual int save(enum SaveFlags); virtual void check(); virtual void populateStateComboBox(); // Set data map values virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setFieldNameAddrChange(QString p) { _fieldNameAddrChange = p ; }; virtual void setFieldNameNumber(QString p) { _fieldNameNumber = p ; }; virtual void setFieldNameActive(QString p) { _fieldNameActive = p ; }; virtual void setFieldNameLine1(QString p) { _fieldNameLine1 = p ; }; virtual void setFieldNameLine2(QString p) { _fieldNameLine2 = p ; }; virtual void setFieldNameLine3(QString p) { _fieldNameLine3 = p ; }; virtual void setFieldNameCity(QString p) { _fieldNameCity = p ; }; virtual void setFieldNamePostalCode(QString p) { _fieldNamePostalCode = p ; }; virtual void setFieldNameState(QString p) { _fieldNameState = p ; }; virtual void setFieldNameCountry(QString p) { _fieldNameCountry = p ; }; private slots: void emitAddressChanged(); signals: void addressChanged(QString, QString, QString, QString, QString, QString, QString); void newId(int); void changed(); protected: QString _query; QString _extraClause; XLineEdit* _addrChange; XLineEdit* _number; QLabel* _addrLit; XLineEdit* _addr1; XLineEdit* _addr2; XLineEdit* _addr3; QLabel* _cityLit; XLineEdit* _city; Mode _mode; QLabel* _stateLit; XComboBox* _state; QLabel* _postalcodeLit; XLineEdit* _postalcode; QLabel* _countryLit; XComboBox* _country; QCheckBox* _active; private: virtual void init(); virtual void populateCountryComboBox(); virtual void silentSetId(const int); int _id; QString _notes; int _searchAcctId; bool _selected; QString _titlePlural; QString _titleSingular; bool _valid; XDataWidgetMapper* _mapper; QPushButton* _list; // cached values QString c_number; QString c_addr1; QString c_addr2; QString c_addr3; QString c_city; QString c_state; QString c_postalcode; QString c_country; bool c_active; QString c_notes; // data map values QString _fieldNameAddrChange; QString _fieldNameNumber; QString _fieldNameActive; QString _fieldNameLine1; QString _fieldNameLine2; QString _fieldNameLine3; QString _fieldNameCity; QString _fieldNamePostalCode; QString _fieldNameState; QString _fieldNameCountry; }; #endif qt-client-4.1.0/widgets/alarmMaint.cpp000066400000000000000000000212771217451700100176620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include "alarmMaint.h" #include "shortcuts.h" const char *_alarmQualifiers[] = { "MB", "HB", "DB", "MA", "HA", "DA" }; alarmMaint::alarmMaint(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, fl) { setupUi(this); setObjectName(name ? name : "alarmMaint"); setModal(modal); _userLookup = _buttonBox->addButton(tr("&User..."), QDialogButtonBox::ActionRole); _contactLookup = _buttonBox->addButton(tr("&Contact..."), QDialogButtonBox::ActionRole); // signals and slots connections connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(_userLookup, SIGNAL(clicked()), _usernameCluster, SLOT(sList())); connect(_contactLookup, SIGNAL(clicked()), _contactCluster, SLOT(sList())); connect(_contactCluster, SIGNAL(newId(int)), this, SLOT(sContactLookup(int))); connect(_usernameCluster, SIGNAL(newId(int)), this, SLOT(sUserLookup(int))); _mode = cNew; _source = Alarms::Uninitialized; _sourceid = -1; _alarmid = -1; XSqlQuery tickle; tickle.exec( "SELECT CURRENT_TIME AS dbdate;" ); if (tickle.first()) { _alarmDate->setDate(tickle.value("dbdate").toDate()); _alarmTime->setTime(tickle.value("dbdate").toTime()); } _eventAlarm->setChecked(_x_preferences && _x_preferences->boolean("AlarmEventDefault")); if (_x_metrics) { if (_x_metrics->boolean("EnableBatchManager")) _emailAlarm->setChecked(_x_preferences && _x_preferences->boolean("AlarmEmailDefault")); else { _emailAlarm->hide(); _emailRecipient->hide(); } } _sysmsgAlarm->setChecked(_x_preferences && _x_preferences->boolean("AlarmSysmsgDefault")); _contactCluster->hide(); _usernameCluster->hide(); adjustSize(); shortcuts::setStandardKeys(this); } alarmMaint::~alarmMaint() { // no need to delete child widgets, Qt does it all for us } void alarmMaint::languageChange() { retranslateUi(this); } void alarmMaint::set( const ParameterList & pParams ) { QVariant param; bool valid; param = pParams.value("source", &valid); if (valid) { _source = (enum Alarms::AlarmSources)param.toInt(); if ( (QString(Alarms::_alarmMap[_source].ident) == QString("TODO")) || (QString(Alarms::_alarmMap[_source].ident) == QString("J")) ) _alarmDate->setEnabled(false); } param = pParams.value("source_id", &valid); if(valid) _sourceid = param.toInt(); param = pParams.value("due_date", &valid); if(valid) _alarmDate->setDate(param.toDate()); param = pParams.value("usrId1", &valid); if(valid) sGetUser(param.toInt()); param = pParams.value("usrId2", &valid); if(valid) sGetUser(param.toInt()); param = pParams.value("usrId3", &valid); if(valid) sGetUser(param.toInt()); param = pParams.value("cntctId1", &valid); if(valid) sGetContact(param.toInt()); param = pParams.value("cntctId2", &valid); if(valid) sGetContact(param.toInt()); param = pParams.value("cntctId3", &valid); if(valid) sGetContact(param.toInt()); param = pParams.value("mode", &valid); if(valid) { if(param.toString() == "new") { _mode = cNew; } else if(param.toString() == "edit") _mode = cEdit; else if(param.toString() == "view") { _mode = cView; _buttonBox->setStandardButtons(QDialogButtonBox::Cancel); } } param = pParams.value("alarm_id", &valid); if (valid) { _alarmid = param.toInt(); sPopulate(); } } void alarmMaint::sSave() { XSqlQuery q; q.prepare("SELECT saveAlarm(:alarm_id, :alarm_number," " :alarm_date, :alarm_time, :alarm_time_offset, :alarm_time_qualifier," " :alarm_event, :alarm_event_recipient," " :alarm_email, :alarm_email_recipient," " :alarm_sysmsg, :alarm_sysmsg_recipient," " :alarm_source, :alarm_source_id, 'CHANGEALL') AS result; "); q.bindValue(":alarm_event", QVariant(_eventAlarm->isChecked())); q.bindValue(":alarm_email", QVariant(_emailAlarm->isChecked())); q.bindValue(":alarm_sysmsg", QVariant(_sysmsgAlarm->isChecked())); q.bindValue(":alarm_event_recipient", _eventRecipient->text()); q.bindValue(":alarm_email_recipient", _emailRecipient->text()); q.bindValue(":alarm_sysmsg_recipient", _sysmsgRecipient->text()); q.bindValue(":alarm_date", _alarmDate->date()); q.bindValue(":alarm_time", _alarmTime->time()); q.bindValue(":alarm_time_offset", _alarmOffset->value()); q.bindValue(":alarm_time_qualifier", _alarmQualifiers[_alarmQualifier->currentIndex()]); q.bindValue(":alarm_source", Alarms::_alarmMap[_source].ident); q.bindValue(":alarm_source_id", _sourceid); q.bindValue(":alarm_id", _alarmid); q.exec(); accept(); } void alarmMaint::sUserLookup(int pId) { sGetUser(pId); } void alarmMaint::sContactLookup(int /*pId*/) { QString recipient; recipient = _emailRecipient->text(); if (recipient.length() == 0) recipient = _contactCluster->emailAddress(); else if (recipient != _contactCluster->emailAddress()) { recipient += ","; recipient += _contactCluster->emailAddress(); } _emailRecipient->setText(recipient); } void alarmMaint::sGetUser(int pUsrId) { XSqlQuery q; q.prepare( "SELECT usr.* " "FROM usr " "WHERE (usr_id=:usr_id);" ); q.bindValue(":usr_id", pUsrId); q.exec(); if (q.first()) { bool recipientFound = false; QString recipient; recipient = _eventRecipient->text(); for (int pcounter = 0; pcounter < 10; pcounter++) { if (recipient.section(",", pcounter, pcounter) == q.value("usr_username").toString()) recipientFound = true; } if (recipient.length() == 0) recipient = q.value("usr_username").toString(); else if (!recipientFound) { recipient += ","; recipient += q.value("usr_username").toString(); } _eventRecipient->setText(recipient); _sysmsgRecipient->setText(recipient); recipientFound = false; recipient = _emailRecipient->text(); for (int pcounter = 0; pcounter < 10; pcounter++) { if (recipient.section(",", pcounter, pcounter) == q.value("usr_email").toString()) recipientFound = true; } if (recipient.length() == 0) recipient = q.value("usr_email").toString(); else if (!recipientFound) { recipient += ","; recipient += q.value("usr_email").toString(); } _emailRecipient->setText(recipient); } } void alarmMaint::sGetContact(int pCntctId) { XSqlQuery q; q.prepare( "SELECT cntct.* " "FROM cntct " "WHERE (cntct_id=:cntct_id);" ); q.bindValue(":cntct_id", pCntctId); q.exec(); if (q.first()) { QString recipient; recipient = _emailRecipient->text(); if (recipient.length() == 0) recipient = q.value("cntct_email").toString(); else if (recipient != q.value("cntct_email").toString()) { recipient += ","; recipient += q.value("cntct_email").toString(); } _emailRecipient->setText(recipient); } } void alarmMaint::sPopulate() { XSqlQuery q; q.prepare( "SELECT * " "FROM alarm " "WHERE (alarm_id=:alarm_id);" ); q.bindValue(":alarm_id", _alarmid); q.exec(); if (q.first()) { _alarmOffset->setValue(q.value("alarm_time_offset").toInt()); for (int pcounter = 0; pcounter < _alarmQualifier->count(); pcounter++) { if (QString(q.value("alarm_time_qualifier").toString()) == _alarmQualifiers[pcounter]) _alarmQualifier->setCurrentIndex(pcounter); } _alarmDate->setDate(q.value("alarm_time").toDate()); _alarmTime->setTime(q.value("alarm_time").toTime()); _eventAlarm->setChecked(q.value("alarm_event").toBool()); _emailAlarm->setChecked(q.value("alarm_email").toBool()); _sysmsgAlarm->setChecked(q.value("alarm_sysmsg").toBool()); _eventRecipient->setText(q.value("alarm_event_recipient").toString()); _emailRecipient->setText(q.value("alarm_email_recipient").toString()); _sysmsgRecipient->setText(q.value("alarm_sysmsg_recipient").toString()); _source = (enum Alarms::AlarmSources)q.value("alarm_source").toInt(); _sourceid = q.value("alarm_source_id").toInt(); } } qt-client-4.1.0/widgets/alarmMaint.h000066400000000000000000000024711217451700100173220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef ALARMMAINT_H #define ALARMMAINT_H #include #include #include "alarms.h" #include "widgets.h" #include "ui_alarmMaint.h" class alarmMaint : public QDialog, public Ui::alarmMaint { Q_OBJECT public: alarmMaint(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~alarmMaint(); QPushButton* _userLookup; QPushButton* _contactLookup; public slots: virtual void set( const ParameterList & pParams ); virtual void sSave(); virtual void sGetUser(int pUsrId); virtual void sGetContact(int pCntctId); virtual void sPopulate(); virtual void sUserLookup(int pId); virtual void sContactLookup(int pId); protected slots: virtual void languageChange(); private: enum Alarms::AlarmSources _source; int _mode; int _alarmid; int _sourceid; }; #endif // ALARMMAINT_H qt-client-4.1.0/widgets/alarmMaint.ui000066400000000000000000000147331217451700100175140ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. alarmMaint 0 0 612 388 Alarm Due: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 15 0 0 minutes before hours before days before minutes after hours after days after true Event false true Email true System Message true Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save ContactCluster QWidget
    contactcluster.h
    DLineEdit QWidget
    datecluster.h
    1
    UsernameCluster QWidget
    usernamecluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    _alarmOffset _alarmQualifier _alarmDate _alarmTime _eventAlarm _eventRecipient _emailAlarm _emailRecipient _sysmsgAlarm _sysmsgRecipient parameter.h
    qt-client-4.1.0/widgets/alarms.cpp000066400000000000000000000215231217451700100170460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include "alarmMaint.h" #include "alarms.h" // CAUTION: This will break if the order of this list does not match // the order of the enumerated values as defined. const Alarms::AlarmMap Alarms::_alarmMap[] = { AlarmMap( Uninitialized, " " ), AlarmMap( Address, "ADDR"), AlarmMap( BBOMHead, "BBH" ), AlarmMap( BBOMItem, "BBI" ), AlarmMap( BOMHead, "BMH" ), AlarmMap( BOMItem, "BMI" ), AlarmMap( BOOHead, "BOH" ), AlarmMap( BOOItem, "BOI" ), AlarmMap( CRMAccount, "CRMA"), AlarmMap( Contact, "T" ), AlarmMap( Customer, "C" ), AlarmMap( Employee, "EMP" ), AlarmMap( Incident, "INCDT"), AlarmMap( Item, "I" ), AlarmMap( ItemSite, "IS" ), AlarmMap( ItemSource, "IR" ), AlarmMap( Location, "L" ), AlarmMap( LotSerial, "LS" ), AlarmMap( Opportunity, "OPP" ), AlarmMap( Project, "J" ), AlarmMap( PurchaseOrder, "P" ), AlarmMap( PurchaseOrderItem, "PI" ), AlarmMap( ReturnAuth, "RA" ), AlarmMap( ReturnAuthItem, "RI" ), AlarmMap( Quote, "Q" ), AlarmMap( QuoteItem, "QI" ), AlarmMap( SalesOrder, "S" ), AlarmMap( SalesOrderItem, "SI" ), AlarmMap( TodoItem, "TODO" ), AlarmMap( TransferOrder, "TO" ), AlarmMap( TransferOrderItem, "TI" ), AlarmMap( Vendor, "V" ), AlarmMap( Warehouse, "WH" ), AlarmMap( WorkOrder, "W" ), }; Alarms::Alarms(QWidget *pParent) : QWidget(pParent) { setupUi(this); _source = Uninitialized; _sourceid = -1; _usrId1 = -1; _usrId2 = -1; _usrId3 = -1; _cntctId1 = -1; _cntctId2 = -1; _cntctId3 = -1; _readOnly = false; XSqlQuery tickle; if(_x_metrics) { tickle.exec( "SELECT CURRENT_TIME AS dbdate;" ); if (tickle.first()) { _dueDate = tickle.value("dbdate").toDate(); _dueTime = tickle.value("dbdate").toTime(); } } _alarms->addColumn(tr("Qualifier"), _itemColumn, Qt::AlignLeft, true, "f_offset" ); _alarms->addColumn(tr("Due"), -1, Qt::AlignLeft, true, "alarm_time" ); _alarms->addColumn(tr("Event Recipient"), _itemColumn, Qt::AlignLeft, true, "alarm_event_recipient" ); _alarms->addColumn(tr("SysMsg Recipient"), _itemColumn, Qt::AlignLeft, true, "alarm_sysmsg_recipient" ); if (_x_metrics) { if (_x_metrics->boolean("EnableBatchManager")) _alarms->addColumn(tr("Email Recipient"), _itemColumn, Qt::AlignLeft, true, "alarm_email_recipient" ); } connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_edit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); } void Alarms::setType(enum AlarmSources pSource) { _source = pSource; } void Alarms::setId(int pSourceid) { _sourceid = pSourceid; refresh(); } void Alarms::setUsrId1(int pUsrId) { _usrId1 = pUsrId; } void Alarms::setUsrId2(int pUsrId) { _usrId2 = pUsrId; } void Alarms::setUsrId3(int pUsrId) { _usrId3 = pUsrId; } void Alarms::setCntctId1(int pCntctId) { _cntctId1 = pCntctId; } void Alarms::setCntctId2(int pCntctId) { _cntctId2 = pCntctId; } void Alarms::setCntctId3(int pCntctId) { _cntctId3 = pCntctId; } void Alarms::setDate(QDate pDate) { _dueDate = pDate; XSqlQuery q; q.prepare("SELECT saveAlarm(alarm_id, alarm_number," " :alarm_date, LOCALTIME, alarm_time_offset, alarm_time_qualifier," " alarm_event, alarm_event_recipient," " alarm_email, alarm_email_recipient," " alarm_sysmsg, alarm_sysmsg_recipient," " alarm_source, alarm_source_id, 'CHANGEALL') AS result " "FROM alarm " "WHERE ( (alarm_source=:alarm_source)" " AND (alarm_source_id=:alarm_source_id) ); "); q.bindValue(":alarm_date", _dueDate); q.bindValue(":alarm_source", Alarms::_alarmMap[_source].ident); q.bindValue(":alarm_source_id", _sourceid); q.exec(); refresh(); } void Alarms::setReadOnly(bool pReadOnly) { if (_readOnly == pReadOnly) return; if(pReadOnly){ disconnect(_alarms, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); disconnect(_alarms, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); disconnect(_alarms, SIGNAL(doubleClicked(QModelIndex)), _edit, SLOT(animateClick())); connect(_alarms, SIGNAL(doubleClicked(QModelIndex)), _view, SLOT(animateClick())); } else { connect(_alarms, SIGNAL(valid(bool)), _edit, SLOT(setEnabled(bool))); connect(_alarms, SIGNAL(valid(bool)), _delete, SLOT(setEnabled(bool))); connect(_alarms, SIGNAL(doubleClicked(QModelIndex)), _edit, SLOT(animateClick())); disconnect(_alarms, SIGNAL(doubleClicked(QModelIndex)), _view, SLOT(animateClick())); } _new->setEnabled(!pReadOnly); _edit->setEnabled(!pReadOnly); _delete->setEnabled(!pReadOnly); } void Alarms::sNew() { ParameterList params; params.append("mode", "new"); params.append("source", _source); params.append("source_id", _sourceid); params.append("due_date", _dueDate); params.append("usrId1", _usrId1); params.append("usrId2", _usrId2); params.append("usrId3", _usrId3); params.append("cntctId1", _cntctId1); params.append("cntctId2", _cntctId2); params.append("cntctId3", _cntctId3); alarmMaint newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) refresh(); } void Alarms::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("alarm_id", _alarms->id()); alarmMaint newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) refresh(); } void Alarms::sView() { ParameterList params; params.append("mode", "view"); params.append("alarm_id", _alarms->id()); alarmMaint newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void Alarms::sDelete() { XSqlQuery q; q.prepare( "DELETE FROM alarm " "WHERE (alarm_id=:alarm_id);" ); q.bindValue(":alarm_id", _alarms->id()); q.exec(); refresh(); } void Alarms::refresh() { if(-1 == _sourceid) { _alarms->clear(); return; } XSqlQuery query; //Populate alarms QString sql( "SELECT alarm_id," " CASE WHEN (alarm_time_offset > 0) THEN" " CAST(alarm_time_offset AS TEXT) || ' ' || " " CASE WHEN (alarm_time_qualifier = 'MB') THEN :minutesbefore" " WHEN (alarm_time_qualifier = 'HB') THEN :hoursbefore" " WHEN (alarm_time_qualifier = 'DB') THEN :daysbefore" " WHEN (alarm_time_qualifier = 'MA') THEN :minutesafter" " WHEN (alarm_time_qualifier = 'HA') THEN :hoursafter" " WHEN (alarm_time_qualifier = 'DA') THEN :daysafter" " END" " ELSE '' " " END AS f_offset, alarm_time," " CASE WHEN (alarm_event) THEN alarm_event_recipient END AS alarm_event_recipient," " CASE WHEN (alarm_email) THEN alarm_email_recipient END AS alarm_email_recipient," " CASE WHEN (alarm_sysmsg) THEN alarm_sysmsg_recipient END AS alarm_sysmsg_recipient " "FROM alarm " "WHERE ( (alarm_source=:source) " " AND (alarm_source_id=:sourceid) ) " "ORDER BY alarm_time; "); query.prepare(sql); query.bindValue(":email", tr("Email")); query.bindValue(":event", tr("Event")); query.bindValue(":sysmsg", tr("System Message")); query.bindValue(":other", tr("Other")); query.bindValue(":minutesbefore", tr("minutes before")); query.bindValue(":hoursbefore", tr("hours before")); query.bindValue(":daysbefore", tr("days before")); query.bindValue(":minutesafter", tr("mintues after")); query.bindValue(":hoursafter", tr("hours after")); query.bindValue(":daysafter", tr("days after")); query.bindValue(":source", _alarmMap[_source].ident); query.bindValue(":sourceid", _sourceid); query.exec(); _alarms->populate(query); } qt-client-4.1.0/widgets/alarms.h000066400000000000000000000051251217451700100165130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef alarms_h #define alarms_h #include #include #include #include "ui_alarms.h" class XTUPLEWIDGETS_EXPORT Alarms : public QWidget, public Ui::alarms { Q_OBJECT Q_ENUMS(AlarmSources) Q_PROPERTY(AlarmSources type READ type WRITE setType) friend class alarm; public: Alarms(QWidget *); // if you add to this then add to the _alarmMap[] below enum AlarmSources { Uninitialized, Address, BBOMHead, BBOMItem, BOMHead, BOMItem, BOOHead, BOOItem, CRMAccount, Contact, Customer, Employee, Incident, Item, ItemSite, ItemSource, Location, LotSerial, Opportunity, Project, PurchaseOrder, PurchaseOrderItem, ReturnAuth, ReturnAuthItem, Quote, QuoteItem, SalesOrder, SalesOrderItem, TodoItem, TransferOrder, TransferOrderItem, Vendor, Warehouse, WorkOrder }; inline int sourceid() { return _sourceid; } inline enum AlarmSources type() { return _source; } struct AlarmMap { enum AlarmSources source; const char * ident; AlarmMap(enum AlarmSources s, const char * i) { source = s; ident = i; } }; static const struct AlarmMap _alarmMap[]; // see Alarms.cpp for init public slots: void setType(enum AlarmSources); void setId(int); void setUsrId1(int); void setUsrId2(int); void setUsrId3(int); void setCntctId1(int); void setCntctId2(int); void setCntctId3(int); void setDate(QDate); void setReadOnly(bool); void sNew(); void sEdit(); void sView(); void sDelete(); void refresh(); private: enum AlarmSources _source; int _sourceid; int _usrId1; int _usrId2; int _usrId3; int _cntctId1; int _cntctId2; int _cntctId3; QDate _dueDate; QTime _dueTime; bool _readOnly; }; #endif qt-client-4.1.0/widgets/alarms.ui000066400000000000000000000107551217451700100167060ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. alarms 0 0 604 217 0 200 Form 0 0 0 0 32767 32767 Qt::ClickFocus 0 &New false &Edit false &View false &Delete Qt::Vertical QSizePolicy::Expanding 20 0 XTreeWidget QTreeWidget
    xtreewidget.h
    _alarms valid(bool) _edit setEnabled(bool) 270 71 352 77 _alarms valid(bool) _view setEnabled(bool) 261 104 356 102 _alarms valid(bool) _delete setEnabled(bool) 262 152 354 153 _alarms doubleClicked(QModelIndex) _edit animateClick() 216 80 332 78
    qt-client-4.1.0/widgets/aropencluster.cpp000066400000000000000000000121721217451700100204550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "aropencluster.h" #define DEBUG false #define EXTRACLAUSE " (aropen_open) " \ " AND aropen_amount - aropen_paid - " \ "(SELECT COALESCE(SUM(checkhead_amount),0) " \ " FROM checkhead,checkitem " \ " WHERE ((checkhead_id=checkitem_checkhead_id) " \ " AND (NOT checkhead_posted) " \ " AND (NOT checkhead_void) " \ " AND (checkitem_aropen_id=aropen_id))) > 0 " AropenCluster::AropenCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new AropenLineEdit(this, pName)); } AropenLineEdit::DocTypes AropenCluster::allowedDocTypes() const { return (qobject_cast(_number))->allowedDocTypes(); } void AropenLineEdit::setExtraClause(const QString &clause) { _userExtraClause = QString(clause); } void AropenCluster::setExtraClause(const QString &clause) { (qobject_cast(_number))->setExtraClause(clause); } AropenLineEdit::DocType AropenCluster::type() const { return (qobject_cast(_number))->type(); } QString AropenCluster::typeString() const { return (qobject_cast(_number))->typeString(); } void AropenCluster::setCustId(int pcustid) { return (qobject_cast(_number))->setCustId(pcustid); } void AropenCluster::setAllowedDocTypes(const AropenLineEdit::DocTypes ptypes) { return (qobject_cast(_number))->setAllowedDocTypes(ptypes); } AropenLineEdit::AropenLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "aropen", "aropen_id", "aropen_docnumber", "formatmoney(aropen_amount-aropen_paid- " //Subtract amount on existing checks "(SELECT COALESCE(SUM(checkhead_amount),0) " " FROM checkhead,checkitem " " WHERE ((checkhead_id=checkitem_checkhead_id) " " AND (NOT checkhead_posted) " " AND (NOT checkhead_void) " " AND (checkitem_aropen_id=aropen_id))) " ")" , "aropen_doctype", EXTRACLAUSE, pName) { setAllowedDocTypes(AnyType); _custId = -1; _standardExtraClause = EXTRACLAUSE; if (DEBUG) qDebug("%s::AropenLineEdit() _standardExtraClause = %s", qPrintable(objectName()), qPrintable(_standardExtraClause)); } void AropenLineEdit::setCustId(int pCust) { _custId = pCust; _custClause = QString("aropen_cust_id=%1").arg(_custId); (void)buildExtraClause(); } AropenLineEdit::DocTypes AropenLineEdit::allowedDocTypes() const { return _allowedTypes; } void AropenLineEdit::setAllowedDocTypes(DocTypes ptypes) { QStringList typelist; _allowedTypes = ptypes; if (ptypes == AnyType) _typeClause = ""; else { if (_allowedTypes & CreditMemo) typelist << "'C'"; if (_allowedTypes & DebitMemo) typelist << "'D'"; if (_allowedTypes & Invoice) typelist << "'I'"; if (_allowedTypes & CashDeposit) typelist << "'R'"; _typeClause = "(aropen_doctype IN (" + typelist.join(", ") + "))" ; } switch (ptypes) { case CreditMemo: setTitles(tr("Credit Memo"), tr("Credit Memos")); break; case DebitMemo: setTitles(tr("Debit Memo"), tr("Debit Memos")); break; case Invoice: setTitles(tr("Invoice"), tr("Invoices")); break; case CashDeposit: setTitles(tr("Cash Deposit"), tr("Cash Deposits")); break; default: setTitles(tr("A/R Open Item"),tr("A/R Open Items"));break; } (void)buildExtraClause(); } AropenLineEdit::DocType AropenLineEdit::type() const { if ("C" == _description) return CreditMemo; if ("D" == _description) return DebitMemo; if ("I" == _description) return Invoice; if ("R" == _description) return CashDeposit; return AnyType; } QString AropenLineEdit::typeString() const { if ("C" == _description) return tr("Credit Memo"); if ("D" == _description) return tr("Debit Memo"); if ("I" == _description) return tr("Invoice"); if ("R" == _description) return tr("Cash Deposit"); return QString("A/R Open Item"); } QString AropenLineEdit::buildExtraClause() { QStringList clauses; if (! _custClause.isEmpty()) clauses << _custClause; if (! _typeClause.isEmpty()) clauses << _typeClause; if (! _standardExtraClause.isEmpty()) clauses << _standardExtraClause; if (! _userExtraClause.isEmpty()) clauses << _userExtraClause; VirtualClusterLineEdit::setExtraClause(clauses.join(" AND ")); if (DEBUG) qDebug("%s::buildExtraClause() returning %s", qPrintable(objectName()), qPrintable(_extraClause)); return _extraClause; } qt-client-4.1.0/widgets/aropencluster.h000066400000000000000000000044601217451700100201230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __AROPENCLUSTER_H__ #define __AROPENCLUSTER_H__ #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT AropenLineEdit : public VirtualClusterLineEdit { Q_OBJECT Q_ENUMS (DocTypes) Q_PROPERTY(DocTypes allowedDocTypes READ allowedDocTypes WRITE setAllowedDocTypes) public: AropenLineEdit(QWidget *, const char * = 0); enum DocType { AnyType = 0x00, CreditMemo = 0x01, DebitMemo = 0x02, Invoice = 0x04, CashDeposit = 0x08 }; Q_DECLARE_FLAGS(DocTypes, DocType) Q_INVOKABLE virtual DocTypes allowedDocTypes() const; Q_INVOKABLE virtual void setExtraClause(const QString &); Q_INVOKABLE virtual DocType type() const; Q_INVOKABLE virtual QString typeString() const; public slots: virtual void setCustId(int pCustid); virtual void setAllowedDocTypes(const DocTypes ptypes); protected: virtual QString buildExtraClause(); private: DocTypes _allowedTypes; QString _custClause; int _custId; QString _standardExtraClause; QString _typeClause; QString _userExtraClause; }; Q_DECLARE_OPERATORS_FOR_FLAGS(AropenLineEdit::DocTypes); class XTUPLEWIDGETS_EXPORT AropenCluster : public VirtualCluster { Q_OBJECT Q_ENUMS (AropenLineEdit::DocTypes) Q_PROPERTY(AropenLineEdit::DocTypes allowedDocTypes READ allowedDocTypes WRITE setAllowedDocTypes) public: AropenCluster(QWidget *, const char * = 0); Q_INVOKABLE virtual AropenLineEdit::DocTypes allowedDocTypes() const; Q_INVOKABLE virtual void setExtraClause(const QString&); Q_INVOKABLE virtual AropenLineEdit::DocType type() const; Q_INVOKABLE virtual QString typeString() const; public slots: virtual void setCustId(int pCustid); virtual void setAllowedDocTypes(const AropenLineEdit::DocTypes ptypes); }; #endif qt-client-4.1.0/widgets/calendarTools.cpp000066400000000000000000000160551217451700100203650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "calendarTools.h" CalendarComboBox::CalendarComboBox(QWidget *pParent, const char *pName) : XComboBox(pParent, pName) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setAllowNull(TRUE); if(_x_metrics) { XSqlQuery q; q.exec( "SELECT calhead_id, calhead_name, calhead_name " "FROM calhead " "ORDER BY calhead_name;" ); populate(q); } connect(this, SIGNAL(newID(int)), this, SIGNAL(newCalendarId(int))); } void CalendarComboBox::load(ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("calitem_id(0)", &valid); if (valid) { XSqlQuery q; q.prepare( "SELECT acalitem_calhead_id AS calheadid " "FROM acalitem " "WHERE (acalitem_id=:calitem_id) " "UNION SELECT rcalitem_calhead_id AS calheadid " "FROM rcalitem " "WHERE (rcalitem_id=:calitem_id);" ); q.bindValue(":calitem_id", param.toInt()); q.exec(); if (q.first()) setId(q.value("calheadid").toInt()); emit select(pParams); } } PeriodsListView::PeriodsListView(QWidget *pParent, const char *pName) : XTreeWidget(pParent) { setObjectName(pName); _calheadid = -1; setSelectionMode(QAbstractItemView::ExtendedSelection); // If we're in a Designer, don't populate if (_x_metrics) { QObject *ancestor = this; bool designMode; for ( ; ancestor; ancestor = ancestor->parent()) { designMode = ancestor->inherits("xTupleDesigner"); if (designMode) return; } addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "periodname"); addColumn(tr("Selected Periods"), -1, Qt::AlignCenter, true, "periodrange"); } } void PeriodsListView::populate(int pCalheadid) { XSqlQuery caltype( QString( "SELECT calhead_type " "FROM calhead " "WHERE (calhead_id=%1);" ) .arg(pCalheadid) ); if (caltype.first()) { QString sql; _calheadid = pCalheadid; clear(); if (caltype.value("calhead_type").toString() == "A") sql = QString( "SELECT acalitem_id, periodstart, periodend, acalitem_name AS periodname," " (formatDate(periodstart) || ' - ' || formatDate(periodend)) AS periodrange " "FROM ( SELECT acalitem_id, acalitem_name," " findPeriodStart(acalitem_id) AS periodstart," " findPeriodEnd(acalitem_id) AS periodend " " FROM acalitem " " WHERE (acalitem_calhead_id=%1) ) AS data " "ORDER BY periodstart;" ) .arg(pCalheadid); else if (caltype.value("calhead_type").toString() == "R") sql = QString( "SELECT rcalitem_id, periodstart, periodend, rcalitem_name AS periodname," " (formatDate(periodstart) || ' - ' || formatDate(periodend)) AS periodrange " "FROM ( SELECT rcalitem_id, rcalitem_name," " findPeriodStart(rcalitem_id) AS periodstart," " findPeriodEnd(rcalitem_id) AS periodend " " FROM rcalitem " " WHERE (rcalitem_calhead_id=%1) ) AS data " "ORDER BY periodstart;" ) .arg(pCalheadid); XSqlQuery query(sql); XTreeWidgetItem *last = 0; QAbstractItemView::SelectionMode tmp = selectionMode(); setSelectionMode(QAbstractItemView::MultiSelection); while (query.next()) { last = new PeriodListViewItem(this, last, query.value(0).toInt(), query.value(1).toDate(), query.value(2).toDate(), query.value(3).toString(), query.value(4).toString() ); setCurrentItem(last); } setSelectionMode(tmp); } else _calheadid = -1; } void PeriodsListView::getSelected(ParameterList &pParams) { QListlist = selectedItems(); int counter = 0; for (int i = 0; i < list.size(); i++) pParams.append(QString("calitem_id(%1)").arg(counter++), ((XTreeWidgetItem*)list[i])->id()); } bool PeriodsListView::isPeriodSelected() { QListlist = selectedItems(); return (list.size() > 0); } QString PeriodsListView::periodString() { QString returnString; QListlist = selectedItems(); for (int i = 0; i < list.size(); i++) { if (returnString.length()) returnString += ","; returnString += QString("%1").arg(((XTreeWidgetItem*)list[i])->id()); } return returnString; } QList PeriodsListView::periodList() { QList returnList; QListlist = selectedItems(); for (int i = 0; i < list.size(); i++) returnList.append(((XTreeWidgetItem*)(list[i]))->id()); return returnList; } PeriodListViewItem *PeriodsListView::getSelected(int pIndex) { QListlist = selectedItems(); int i; for (i = 0; i < list.size(); i++) if (--pIndex == 0) break; if (pIndex == 0) return (PeriodListViewItem *)list[i]; else return NULL; } void PeriodsListView::load(ParameterList &pParams) { clearSelection(); QAbstractItemView::SelectionMode oldSelMode = selectionMode(); setSelectionMode(QAbstractItemView::MultiSelection); if (topLevelItemCount() > 0) { QVariant param; bool valid = TRUE; for (unsigned int counter = 0; valid; counter++) { param = pParams.value(QString("calitem_id(%1)").arg(counter), &valid); if (valid) { for (int i = 0; i < topLevelItemCount(); i++) if (((XTreeWidgetItem*)topLevelItem(i))->id() == param.toInt()) setCurrentItem(topLevelItem(i)); } } } setSelectionMode(oldSelMode); } QScriptValue PeriodListViewItemtoScriptValue(QScriptEngine *engine, PeriodListViewItem* const &item) { return engine->newQObject(item); } void PeriodListViewItemfromScriptValue(const QScriptValue &obj, PeriodListViewItem* &item) { item = qobject_cast(obj.toQObject()); } void setupPeriodListViewItem(QScriptEngine *engine) { qScriptRegisterMetaType(engine, PeriodListViewItemtoScriptValue, PeriodListViewItemfromScriptValue); } PeriodListViewItem::PeriodListViewItem( PeriodsListView *parent, XTreeWidgetItem *itm, int pId, QDate pStartDate, QDate pEndDate, QString s0, QString s1 ) : XTreeWidgetItem(parent, itm, pId, QVariant(s0), QVariant(s1)) { _startDate = pStartDate; _endDate = pEndDate; } qt-client-4.1.0/widgets/calendarTools.h000066400000000000000000000046641217451700100200350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef calendarTools_h #define calendarTools_h #include #include #include "widgets.h" #include "xcombobox.h" #include "xtreewidget.h" class QString; class XTUPLEWIDGETS_EXPORT Numeric { public: Numeric() { value = 0.0; } inline double operator+=(double pValue) { value += pValue; return value; } inline double toDouble() { return value; } double value; }; class XTUPLEWIDGETS_EXPORT DatePair { public: DatePair() { } DatePair(QDate pStartDate, QDate pEndDate) { startDate = pStartDate; endDate = pEndDate; } QDate startDate; QDate endDate; }; class XTUPLEWIDGETS_EXPORT CalendarComboBox : public XComboBox { Q_OBJECT public: CalendarComboBox(QWidget *, const char * = 0); Q_INVOKABLE void load(ParameterList &); signals: void newCalendarId(int); void select(ParameterList &); }; class PeriodListViewItem; class XTUPLEWIDGETS_EXPORT PeriodsListView : public XTreeWidget { Q_OBJECT public: PeriodsListView(QWidget *, const char * = 0); Q_INVOKABLE QList periodList(); Q_INVOKABLE QString periodString(); Q_INVOKABLE PeriodListViewItem *getSelected(int); Q_INVOKABLE void getSelected(ParameterList &); Q_INVOKABLE bool isPeriodSelected(); public slots: void populate(int); void load(ParameterList &); private: int _calheadid; }; void setupPeriodListViewItem(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT PeriodListViewItem : public XTreeWidgetItem { Q_OBJECT public: PeriodListViewItem( PeriodsListView *, XTreeWidgetItem *, int, QDate, QDate, QString, QString ); Q_INVOKABLE inline QDate startDate() { return _startDate; } Q_INVOKABLE inline QDate endDate() { return _endDate; } private: QDate _startDate; QDate _endDate; }; Q_DECLARE_METATYPE(PeriodListViewItem*) #endif qt-client-4.1.0/widgets/calendarcombobox.h000066400000000000000000000007271217451700100205410ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/widgets/clineedit.h000066400000000000000000000007251217451700100171750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/widgets/cmheadcluster.cpp000066400000000000000000000015751217451700100204170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "cmheadcluster.h" CmheadCluster::CmheadCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new CmheadClusterLineEdit(this, pName)); } CmheadClusterLineEdit::CmheadClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "cmhead", "cmhead_id", "cmhead_number", "cmhead_invcnumber", 0, 0, pName) { setTitles(tr("Credit Memo"), tr("Credit Memos")); } qt-client-4.1.0/widgets/cmheadcluster.h000066400000000000000000000015171217451700100200600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _cmheadCluster_h #define _cmheadCluster_h #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT CmheadClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: CmheadClusterLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT CmheadCluster : public VirtualCluster { Q_OBJECT public: CmheadCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/comment.cpp000077500000000000000000000426251217451700100172420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtextedit.h" #include "xcombobox.h" #include "comment.h" #include "shortcuts.h" #define cNew 1 #define cEdit 2 #define cView 3 comment::comment( QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl ) : QDialog( parent, fl ) { if(name) setObjectName(name); setWindowTitle(tr("Comment")); if(modal) setWindowModality(Qt::WindowModal); _commentid = -1; _targetId = -1; _mode = cNew; if (!name) setObjectName("comment"); QVBoxLayout *moreLayout = new QVBoxLayout(this); moreLayout->setContentsMargins(5, 5, 5, 5); moreLayout->setSpacing(7); moreLayout->setObjectName("moreLayout"); QHBoxLayout *commentLayout = new QHBoxLayout(this); commentLayout->setContentsMargins(5, 5, 5, 5); commentLayout->setSpacing(7); commentLayout->setObjectName("commentLayout"); QVBoxLayout *layout11 = new QVBoxLayout(this); layout11->setSpacing(5); layout11->setObjectName("layout11"); QHBoxLayout *layout9 = new QHBoxLayout(this); layout9->setObjectName("layout9"); QBoxLayout *layout8 = new QHBoxLayout(this); layout8->setSpacing(5); layout8->setObjectName("layout8"); QLabel *_cmnttypeLit = new QLabel(tr("Comment Type:"), this); _cmnttypeLit->setObjectName("_cmnttypeLit"); layout8->addWidget( _cmnttypeLit ); _cmnttype = new XComboBox( FALSE, this); _cmnttype->setObjectName("_cmnttype" ); layout8->addWidget( _cmnttype ); layout9->addLayout( layout8 ); QSpacerItem* spacer = new QSpacerItem( 66, 10, QSizePolicy::Expanding, QSizePolicy::Minimum ); layout9->addItem( spacer ); _public = new QCheckBox(tr("Public"), this); _public->setObjectName("_public"); if(!(_x_metrics && _x_metrics->boolean("CommentPublicPrivate"))) _public->hide(); _public->setChecked(_x_metrics && _x_metrics->boolean("CommentPublicDefault")); layout9->addWidget(_public); layout11->addLayout( layout9 ); _comment = new XTextEdit( this); _comment->setObjectName("_comment" ); _comment->setSpellEnable(true); layout11->addWidget( _comment ); commentLayout->addLayout( layout11 ); QDialogButtonBox* buttonBox = new QDialogButtonBox(this); buttonBox->setOrientation(Qt::Vertical); buttonBox->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel); _close = buttonBox->button(QDialogButtonBox::Cancel); _close->setObjectName("_close"); _save = buttonBox->button(QDialogButtonBox::Save); _save->setObjectName("_save"); _prev = buttonBox->addButton(tr("&Previous"), QDialogButtonBox::ActionRole); _prev->setObjectName("_prev"); _next = buttonBox->addButton(tr("&Next"), QDialogButtonBox::ActionRole); _next->setObjectName("_next"); _more = buttonBox->addButton(tr("&More"), QDialogButtonBox::ActionRole); _more->setObjectName("_more"); _more->setCheckable(true); commentLayout->addWidget(buttonBox); moreLayout->addLayout(commentLayout); _comments = new Comments(this); _comments->setObjectName("_comments"); _comments->setReadOnly(true); _comments->findChild("_verbose")->setForgetful(true); _comments->findChild("_verbose")->hide(); _comments->findChild("_verbose")->setChecked(false); _comments->_newComment->setVisible(false); _comments->setVerboseCommentList(true); _comments->setVisible(false); _comments->setEditable(false); moreLayout->addWidget(_comments); resize( QSize(524, 270).expandedTo(minimumSizeHint()) ); //clearWState( WState_Polished ); // signals and slots connections connect(buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_next, SIGNAL(clicked()), this, SLOT(sNextComment())); connect(_prev, SIGNAL(clicked()), this, SLOT(sPrevComment())); connect(_more, SIGNAL(toggled(bool)), _comments, SLOT(setVisible(bool))); // tab order setTabOrder( _cmnttype, _comment ); setTabOrder( _comment, _save ); setTabOrder( _save, _close ); _source = Comments::Uninitialized; _cmnttype->setAllowNull(true); shortcuts::setStandardKeys(this); } void comment::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("comment_id", &valid); if (valid) { _cmnttype->setType(XComboBox::AllCommentTypes); _commentid = param.toInt(); populate(); } param = pParams.value("commentIDList", &valid); if (valid) { _commentIDList = param.toList(); _commentLocation = _commentIDList.indexOf(_commentid); if((_commentLocation-1) >= 0) _prev->setEnabled(true); else _prev->setEnabled(false); if((_commentLocation+1) < _commentIDList.size()) _next->setEnabled(true); else _next->setEnabled(false); } param = pParams.value("cust_id", &valid); if (valid) { _source = Comments::Customer; _cmnttype->setType(XComboBox::CustomerCommentTypes); _targetId = param.toInt(); } param = pParams.value("vend_id", &valid); if (valid) { _source = Comments::Vendor; _cmnttype->setType(XComboBox::VendorCommentTypes); _targetId = param.toInt(); } param = pParams.value("item_id", &valid); if (valid) { _source = Comments::Item; _cmnttype->setType(XComboBox::ItemCommentTypes); _targetId = param.toInt(); } param = pParams.value("itemsite_id", &valid); if (valid) { _source = Comments::ItemSite; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } // Quotes param = pParams.value("quhead_id", &valid); if (valid) { _source = Comments::Quote; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } param = pParams.value("quitem_id", &valid); if (valid) { _source = Comments::QuoteItem; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } // Sales Orders param = pParams.value("sohead_id", &valid); if (valid) { _source = Comments::SalesOrder; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } param = pParams.value("soitem_id", &valid); if (valid) { _source = Comments::SalesOrderItem; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } // Sales Orders param = pParams.value("tohead_id", &valid); if (valid) { _source = Comments::TransferOrder; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } // Return Authorizations param = pParams.value("rahead_id", &valid); if (valid) { _source = Comments::ReturnAuth; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } param = pParams.value("raitem_id", &valid); if (valid) { _source = Comments::ReturnAuthItem; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } // Purchase Orders param = pParams.value("pohead_id", &valid); if (valid) { _source = Comments::PurchaseOrder; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } param = pParams.value("poitem_id", &valid); if (valid) { _source = Comments::PurchaseOrderItem; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } param = pParams.value("lsdetail_id", &valid); if (valid) { _source = Comments::LotSerial; _cmnttype->setType(XComboBox::LotSerialCommentTypes); _targetId = param.toInt(); } param = pParams.value("prj_id", &valid); if (valid) { _source = Comments::Project; _cmnttype->setType(XComboBox::ProjectCommentTypes); _targetId = param.toInt(); } param = pParams.value("warehous_id", &valid); if (valid) { _source = Comments::Warehouse; _cmnttype->setType(XComboBox::WarehouseCommentTypes); _targetId = param.toInt(); } param = pParams.value("todoitem_id", &valid); if (valid) { _source = Comments::TodoItem; _cmnttype->setType(XComboBox::TodoItemCommentTypes); _targetId = param.toInt(); } param = pParams.value("prjtask_id", &valid); if (valid) { _source = Comments::Task; _cmnttype->setType(XComboBox::TaskCommentTypes); _targetId = param.toInt(); } param = pParams.value("addr_id", &valid); if (valid) { _source = Comments::Address; _cmnttype->setType(XComboBox::AllCommentTypes); _targetId = param.toInt(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _cmnttype->setFocus(); _next->setVisible(false); _prev->setVisible(false); } else if (param.toString() == "edit") { _mode = cEdit; _next->setVisible(false); _prev->setVisible(false); _cmnttype->setEnabled(false); } else if (param.toString() == "view") { _mode = cView; _next->setVisible(true); _prev->setVisible(true); _cmnttype->setEnabled(false); _comment->setReadOnly(true); _save->hide(); _close->setText(tr("&Close")); _close->setShortcut(QKeySequence::Close); _more->hide(); _close->setFocus(); } } param = pParams.value("sourceType", &valid); if (valid) { _source = (enum Comments::CommentSources)param.toInt(); if(!(_mode == cEdit || _mode == cView)) { switch (_source) { case Comments::Address: _cmnttype->setType(XComboBox::AddressCommentTypes); break; case Comments::BBOMHead: _cmnttype->setType(XComboBox::BBOMHeadCommentTypes); break; case Comments::BBOMItem: _cmnttype->setType(XComboBox::BBOMItemCommentTypes); break; case Comments::BOMHead: _cmnttype->setType(XComboBox::BOMHeadCommentTypes); break; case Comments::BOMItem: _cmnttype->setType(XComboBox::BOMItemCommentTypes); break; case Comments::BOOHead: _cmnttype->setType(XComboBox::BOOHeadCommentTypes); break; case Comments::BOOItem: _cmnttype->setType(XComboBox::BOOItemCommentTypes); break; case Comments::CRMAccount: _cmnttype->setType(XComboBox::CRMAccountCommentTypes); break; case Comments::Contact: _cmnttype->setType(XComboBox::ContactCommentTypes); break; case Comments::Customer: _cmnttype->setType(XComboBox::CustomerCommentTypes); break; case Comments::Employee: _cmnttype->setType(XComboBox::EmployeeCommentTypes); break; case Comments::Incident: _cmnttype->setType(XComboBox::IncidentCommentTypes); break; case Comments::Item: _cmnttype->setType(XComboBox::ItemCommentTypes); break; case Comments::ItemSite: _cmnttype->setType(XComboBox::ItemSiteCommentTypes); break; case Comments::ItemSource: _cmnttype->setType(XComboBox::ItemSourceCommentTypes); break; case Comments::Location: _cmnttype->setType(XComboBox::LocationCommentTypes); break; case Comments::LotSerial: _cmnttype->setType(XComboBox::LotSerialCommentTypes); break; case Comments::Opportunity: _cmnttype->setType(XComboBox::OpportunityCommentTypes); break; case Comments::Project: _cmnttype->setType(XComboBox::ProjectCommentTypes); break; case Comments::PurchaseOrder: _cmnttype->setType(XComboBox::PurchaseOrderCommentTypes); break; case Comments::PurchaseOrderItem: _cmnttype->setType(XComboBox::PurchaseOrderItemCommentTypes); break; case Comments::ReturnAuth: _cmnttype->setType(XComboBox::ReturnAuthCommentTypes); break; case Comments::ReturnAuthItem: _cmnttype->setType(XComboBox::ReturnAuthItemCommentTypes); break; case Comments::Quote: _cmnttype->setType(XComboBox::QuoteCommentTypes); break; case Comments::QuoteItem: _cmnttype->setType(XComboBox::QuoteItemCommentTypes); break; case Comments::SalesOrder: _cmnttype->setType(XComboBox::SalesOrderCommentTypes); break; case Comments::SalesOrderItem: _cmnttype->setType(XComboBox::SalesOrderItemCommentTypes); break; case Comments::Task: _cmnttype->setType(XComboBox::TaskCommentTypes); break; case Comments::TodoItem: _cmnttype->setType(XComboBox::TodoItemCommentTypes); break; case Comments::TransferOrder: _cmnttype->setType(XComboBox::TransferOrderCommentTypes); break; case Comments::TransferOrderItem: _cmnttype->setType(XComboBox::TransferOrderItemCommentTypes); break; case Comments::Vendor: _cmnttype->setType(XComboBox::VendorCommentTypes); break; case Comments::Warehouse: _cmnttype->setType(XComboBox::WarehouseCommentTypes); break; case Comments::WorkOrder: _cmnttype->setType(XComboBox::WorkOrderCommentTypes); break; default: _cmnttype->setType(XComboBox::AllCommentTypes); break; } } } param = pParams.value("source_id", &valid); if (valid) { _targetId = param.toInt(); } _comments->setType(_source); _comments->setId(_targetId); } void comment::sSave() { if (_cmnttype->id() == -1) { QMessageBox::critical( this, tr("Cannot Post Comment"), tr("

    You must select a Comment Type for this " "Comment before you may post it.") ); _cmnttype->setFocus(); return; } int result = -1; if(_mode == cNew) { _query.prepare("SELECT postComment(:cmnttype_id, :source, :source_id, :text, :public) AS result;"); _query.bindValue(":cmnttype_id", _cmnttype->id()); _query.bindValue(":source", Comments::_commentMap[_source].ident); _query.bindValue(":source_id", _targetId); _query.bindValue(":text", _comment->toPlainText().trimmed()); _query.bindValue(":public", _public->isChecked()); _query.exec(); if (_query.first()) { int result = _query.value("result").toInt(); if (result < 0) { QMessageBox::critical(this, tr("Cannot Post Comment"), tr("

    A Stored Procedure failed to run " "properly.
    (%1, %2)
    ") .arg("postComment").arg(result)); } } else if (_query.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("Cannot Post Comment"), _query.lastError().databaseText()); } } else if(_mode == cEdit) { result = _commentid; _query.prepare("UPDATE comment SET comment_text=:text, comment_public=:public WHERE comment_id=:comment_id"); _query.bindValue(":text", _comment->toPlainText().trimmed()); _query.bindValue(":comment_id", _commentid); _query.bindValue(":public", _public->isChecked()); _query.exec(); if(_query.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("Cannot Post Comment"), _query.lastError().databaseText()); return; } } if(result < 0) done(result); else reject(); } void comment::populate() { _query.prepare( "SELECT comment_cmnttype_id, comment_text, comment_public " "FROM comment " "WHERE (comment_id=:comment_id);" ); _query.bindValue(":comment_id", _commentid); _query.exec(); if (_query.first()) { _cmnttype->setId(_query.value("comment_cmnttype_id").toInt()); _comment->setText(_query.value("comment_text").toString()); _public->setChecked(_query.value("comment_public").toBool()); } else if (_query.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("Error Selecting Comment"), _query.lastError().databaseText()); return; } } void comment::sNextComment() { if((_commentLocation+1) < _commentIDList.size()) { _commentLocation++; _commentid = _commentIDList[_commentLocation].toInt(); populate(); if((_commentLocation+1) < _commentIDList.size()) _next->setEnabled(true); else _next->setEnabled(false); if((_commentLocation-1) >= 0) _prev->setEnabled(true); else _prev->setEnabled(false); } } void comment::sPrevComment() { if((_commentLocation-1) >= 0) { _commentLocation--; _commentid = _commentIDList[_commentLocation].toInt(); populate(); if((_commentLocation-1) >= 0) _prev->setEnabled(true); else _prev->setEnabled(false); if((_commentLocation+1) < _commentIDList.size()) _next->setEnabled(true); else _next->setEnabled(false); } } qt-client-4.1.0/widgets/comment.h000077500000000000000000000026531217451700100167040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef comment_h #define comment_h #include #include #include "widgets.h" #include "comments.h" class XComboBox; class XTextEdit; class QPushButton; class ParameterList; class XTUPLEWIDGETS_EXPORT comment : public QDialog { Q_OBJECT friend class Comments; public: comment(QWidget * = 0, const char * = 0, bool = FALSE, Qt::WindowFlags = 0); XComboBox* _cmnttype; XTextEdit* _comment; QPushButton* _close; QPushButton* _save; QPushButton* _next; QPushButton* _prev; QPushButton* _more; Comments* _comments; QCheckBox* _public; public slots: virtual void set(const ParameterList & pParams); virtual void sSave(); virtual void populate(); virtual void sNextComment(); virtual void sPrevComment(); private: XSqlQuery _query; QList _commentIDList; int _commentLocation; int _commentid; int _targetId; int _mode; enum Comments::CommentSources _source; }; #endif qt-client-4.1.0/widgets/comments.cpp000066400000000000000000000351001217451700100174100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include "comment.h" #include "comments.h" void Comments::showEvent(QShowEvent *event) { if (event) { QScrollBar * scrbar = _browser->verticalScrollBar(); scrbar->setValue(0); } } // CAUTION: This will break if the order of this list does not match // the order of the enumerated values as defined. const Comments::CommentMap Comments::_commentMap[] = { CommentMap( Uninitialized, " " ), CommentMap( Address, "ADDR"), CommentMap( BBOMHead, "BBH" ), CommentMap( BBOMItem, "BBI" ), CommentMap( BOMHead, "BMH" ), CommentMap( BOMItem, "BMI" ), CommentMap( BOOHead, "BOH" ), CommentMap( BOOItem, "BOI" ), CommentMap( CRMAccount, "CRMA"), CommentMap( Contact, "T" ), CommentMap( Customer, "C" ), CommentMap( Employee, "EMP" ), CommentMap( Incident, "INCDT"), CommentMap( Item, "I" ), CommentMap( ItemSite, "IS" ), CommentMap( ItemSource, "IR" ), CommentMap( Location, "L" ), CommentMap( LotSerial, "LS" ), CommentMap( Opportunity, "OPP" ), CommentMap( Project, "J" ), CommentMap( PurchaseOrder, "P" ), CommentMap( PurchaseOrderItem, "PI" ), CommentMap( ReturnAuth, "RA" ), CommentMap( ReturnAuthItem, "RI" ), CommentMap( Quote, "Q" ), CommentMap( QuoteItem, "QI" ), CommentMap( SalesOrder, "S" ), CommentMap( SalesOrderItem, "SI" ), CommentMap( Task, "TA" ), CommentMap( TodoItem, "TD" ), CommentMap( TransferOrder, "TO" ), CommentMap( TransferOrderItem, "TI" ), CommentMap( Vendor, "V" ), CommentMap( Warehouse, "WH" ), CommentMap( WorkOrder, "W" ), }; Comments::Comments(QWidget *pParent, const char *name) : QWidget(pParent) { setObjectName(name); _source = Uninitialized; _sourceid = -1; _editable = true; _verboseCommentList = false; QVBoxLayout *vbox = new QVBoxLayout(this); QHBoxLayout *hbox = new QHBoxLayout(); hbox->setMargin(0); hbox->setSpacing(7); _verbose = new XCheckBox(tr("Verbose Text"), this); _verbose->setObjectName("_verbose"); _verboseCommentList = _verbose->isChecked(); vbox->addWidget(_verbose); vbox->addLayout(hbox); QWidget *buttons = new QWidget(this); QVBoxLayout * buttonsLayout = new QVBoxLayout(buttons); buttonsLayout->setMargin(0); buttonsLayout->setSpacing(0); _comment = new XTreeWidget(this); _comment->setObjectName("_comment"); _comment->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); _comment->addColumn(tr("Date/Time"), _timeDateColumn, Qt::AlignCenter,true, "comment_date"); _comment->addColumn(tr("Type"), _itemColumn, Qt::AlignCenter,true, "type"); _comment->addColumn(tr("Source"), _itemColumn, Qt::AlignCenter,true, "comment_source"); _comment->addColumn(tr("User"), _userColumn, Qt::AlignCenter,true, "comment_user"); _comment->addColumn(tr("Comment"), -1, Qt::AlignLeft, true, "first"); _comment->addColumn(tr("Public"), _ynColumn, Qt::AlignLeft, false, "comment_public"); hbox->addWidget(_comment); _browser = new QTextBrowser(this); _browser->setObjectName("_browser"); _browser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); _browser->setOpenLinks(false); hbox->addWidget(_browser); _newComment = new QPushButton(tr("New"), buttons); _newComment->setObjectName("_newComment"); buttonsLayout->addWidget(_newComment); _viewComment = new QPushButton(tr("View"), buttons); _viewComment->setObjectName("_viewComment"); _viewComment->setEnabled(FALSE); buttonsLayout->addWidget(_viewComment); _editComment = new QPushButton(tr("Edit"), buttons); _editComment->setObjectName("_editComment"); _editComment->setEnabled(false); buttonsLayout->addWidget(_editComment); QSpacerItem *_buttonSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); buttonsLayout->addItem(_buttonSpacer); buttons->setLayout(buttonsLayout); hbox->addWidget(buttons); _editmap = new QMultiMap(); _editmap2 = new QMultiMap(); connect(_newComment, SIGNAL(clicked()), this, SLOT( sNew())); connect(_viewComment, SIGNAL(clicked()), this, SLOT( sView())); connect(_editComment, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_comment, SIGNAL(valid(bool)), this, SLOT(sCheckButtonPriv(bool))); connect(_comment, SIGNAL(itemSelected(int)), _viewComment, SLOT(animateClick())); connect(_browser, SIGNAL(anchorClicked(QUrl)), this, SLOT(anchorClicked(QUrl))); connect(_verbose, SIGNAL(toggled(bool)), this, SLOT(setVerboseCommentList(bool))); setFocusProxy(_comment); setVerboseCommentList(_verboseCommentList); } void Comments::setType(enum CommentSources pSource) { _source = pSource; } void Comments::setId(int pSourceid) { _sourceid = pSourceid; refresh(); } void Comments::setReadOnly(bool pReadOnly) { _newComment->setDisabled(pReadOnly); _editable = !pReadOnly; } void Comments::sNew() { ParameterList params; params.append("mode", "new"); params.append("sourceType", _source); params.append("source_id", _sourceid); comment newdlg(this, "", TRUE); newdlg.setWindowModality(Qt::WindowModal); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) { emit commentAdded(); refresh(); } } void Comments::sView() { ParameterList params; params.append("mode", "view"); params.append("sourceType", _source); params.append("source_id", _sourceid); params.append("comment_id", _comment->id()); params.append("commentIDList", _commentIDList); comment newdlg(this, "", TRUE); newdlg.setWindowModality(Qt::WindowModal); newdlg.set(params); newdlg.exec(); } void Comments::sEdit() { ParameterList params; params.append("mode", "edit"); params.append("sourceType", _source); params.append("source_id", _sourceid); params.append("comment_id", _comment->id()); params.append("commentIDList", _commentIDList); comment newdlg(this, "", TRUE); newdlg.setWindowModality(Qt::WindowModal); newdlg.set(params); newdlg.exec(); refresh(); } void Comments::refresh() { _browser->document()->clear(); _editmap->clear(); _editmap2->clear(); if(-1 == _sourceid) { _comment->clear(); return; } XSqlQuery comment; if(_source != CRMAccount) { _comment->hideColumn(2); comment.prepare( "SELECT comment_id, comment_date, comment_source," " CASE WHEN (cmnttype_name IS NOT NULL) THEN cmnttype_name" " ELSE :none" " END AS type," " comment_user," " firstLine(detag(comment_text)) AS first," " comment_text, " " COALESCE(cmnttype_editable,false) AS editable, " " comment_public, " " comment_user=getEffectiveXtUser() AS self " "FROM comment LEFT OUTER JOIN cmnttype ON (comment_cmnttype_id=cmnttype_id) " "WHERE ( (comment_source=:source)" " AND (comment_source_id=:sourceid) ) " "ORDER BY comment_date DESC;" ); } else { // If it's CRMAccount we want to do some extra joining in our SQL _comment->showColumn(2); comment.prepare( "SELECT comment_id, comment_date, comment_source," " CASE WHEN (cmnttype_name IS NOT NULL) THEN cmnttype_name" " ELSE :none" " END AS type," " comment_user," " firstLine(detag(comment_text)) AS first," " comment_text, " " COALESCE(cmnttype_editable,false) AS editable, " " comment_public, " " comment_user=getEffectiveXtUser() AS self " " FROM comment LEFT OUTER JOIN cmnttype ON (comment_cmnttype_id=cmnttype_id) " " WHERE((comment_source=:source)" " AND (comment_source_id=:sourceid) ) " " UNION " "SELECT comment_id, comment_date, comment_source," " CASE WHEN (cmnttype_name IS NOT NULL) THEN cmnttype_name" " ELSE :none" " END," " comment_user, firstLine(detag(comment_text))," " comment_text, " " COALESCE(cmnttype_editable,false) AS editable, " " comment_public, " " comment_user=getEffectiveXtUser() AS self " " FROM crmacct, comment LEFT OUTER JOIN cmnttype ON (comment_cmnttype_id=cmnttype_id) " " WHERE((comment_source=:sourceCust)" " AND (crmacct_id=:sourceid)" " AND (comment_source_id=crmacct_cust_id) ) " " UNION " "SELECT comment_id, comment_date, comment_source," " CASE WHEN (cmnttype_name IS NOT NULL) THEN cmnttype_name" " ELSE :none" " END," " comment_user, firstLine(detag(comment_text))," " comment_text, " " COALESCE(cmnttype_editable,false) AS editable, " " comment_public, " " comment_user=getEffectiveXtUser() AS self " " FROM crmacct, comment LEFT OUTER JOIN cmnttype ON (comment_cmnttype_id=cmnttype_id) " " WHERE((comment_source=:sourceVend)" " AND (crmacct_id=:sourceid)" " AND (comment_source_id=crmacct_vend_id) ) " " UNION " "SELECT comment_id, comment_date, comment_source," " CASE WHEN (cmnttype_name IS NOT NULL) THEN cmnttype_name" " ELSE :none" " END," " comment_user, firstLine(detag(comment_text))," " comment_text, " " COALESCE(cmnttype_editable,false) AS editable, " " comment_public, " " comment_user=getEffectiveXtUser() AS self " " FROM cntct, comment LEFT OUTER JOIN cmnttype ON (comment_cmnttype_id=cmnttype_id) " " WHERE((comment_source=:sourceContact)" " AND (cntct_crmacct_id=:sourceid)" " AND (comment_source_id=cntct_id) ) " "ORDER BY comment_date DESC;" ); comment.bindValue(":sourceCust", _commentMap[Customer].ident); comment.bindValue(":sourceContact", _commentMap[Contact].ident); comment.bindValue(":sourceVend", _commentMap[Vendor].ident); } comment.bindValue(":none", tr("None")); comment.bindValue(":source", _commentMap[_source].ident); comment.bindValue(":sourceid", _sourceid); comment.exec(); QString lclHtml = ""; QRegExp br("\r?\n"); _commentIDList.clear(); while(comment.next()) { _editmap->insert(comment.value("comment_id").toInt(),comment.value("editable").toBool()); _editmap2->insert(comment.value("comment_id").toInt(),comment.value("self").toBool()); int cid = comment.value("comment_id").toInt(); _commentIDList.push_back(cid); lclHtml += comment.value("comment_date").toDateTime().toString(); lclHtml += " "; lclHtml += comment.value("type").toString(); lclHtml += " "; lclHtml += comment.value("comment_user").toString(); if(_x_metrics && _x_metrics->boolean("CommentPublicPrivate")) { lclHtml += " ("; if(comment.value("comment_public").toBool()) lclHtml += "Public"; else lclHtml += "Private"; lclHtml += ")"; } if(userCanEdit(cid)) { lclHtml += " edit"; } lclHtml += "

    \n

    "; lclHtml += comment.value("comment_text").toString().replace("<", "<").replace(br,"
    \n"); lclHtml += "
    \n
    \n"; } lclHtml += ""; _browser->document()->setHtml(lclHtml); comment.first(); _comment->populate(comment); } void Comments::setVerboseCommentList(bool vcl) { _verboseCommentList = vcl; _comment->setVisible(!vcl); _viewComment->setVisible(!vcl); _editComment->setVisible(!vcl); _browser->setVisible(vcl); } void Comments::anchorClicked(const QUrl & url) { if(url.host().isEmpty() && url.path() == "edit") { int cid = url.queryItemValue("id").toInt(); if(userCanEdit(cid)) { ParameterList params; params.append("mode", "edit"); params.append("sourceType", _source); params.append("source_id", _sourceid); params.append("comment_id", cid); params.append("commentIDList", _commentIDList); comment newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); refresh(); } } else { QDesktopServices::openUrl(url); } } void Comments::sCheckButtonPriv(bool pValid) { _viewComment->setEnabled(pValid); if(pValid) { _editComment->setEnabled(userCanEdit(_comment->id()) && _editable); } else _editComment->setEnabled(false); } bool Comments::userCanEdit(int id) { QList values = _editmap->values(id); QList values2 = _editmap2->values(id); if(values.at(0)) { if(_x_privileges && _x_privileges->check("EditOthersComments") && _editable) return true; if(_x_privileges && _x_privileges->check("EditOwnComments") && values2.at(0) && _editable) return true; } return false; } qt-client-4.1.0/widgets/comments.h000066400000000000000000000053201217451700100170560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef comments_h #define comments_h #include #include #include "xtreewidget.h" #include "xcheckbox.h" class QPushButton; class QTextBrowser; class XTreeWidget; class Comment; class XTUPLEWIDGETS_EXPORT Comments : public QWidget { Q_OBJECT Q_ENUMS(CommentSources) Q_PROPERTY(CommentSources type READ type WRITE setType) friend class comment; public: Comments(QWidget *, const char * = 0); // if you add to this then add to the _commentMap[] below enum CommentSources { Uninitialized, Address, BBOMHead, BBOMItem, BOMHead, BOMItem, BOOHead, BOOItem, CRMAccount, Contact, Customer, Employee, Incident, Item, ItemSite, ItemSource, Location, LotSerial, Opportunity, Project, PurchaseOrder, PurchaseOrderItem, ReturnAuth, ReturnAuthItem, Quote, QuoteItem, SalesOrder, SalesOrderItem, Task, TodoItem, TransferOrder, TransferOrderItem, Vendor, Warehouse, WorkOrder }; inline int sourceid() { return _sourceid; } inline enum CommentSources type() { return _source; } struct CommentMap { enum CommentSources source; const char * ident; CommentMap(enum CommentSources s, const char * i) { source = s; ident = i; } }; static const struct CommentMap _commentMap[]; // see comments.cpp for init bool userCanEdit(int); public slots: void setType(enum CommentSources); void setId(int); void setReadOnly(bool); void setVerboseCommentList(bool); void setEditable(bool p) {_editable = p;} void sNew(); void sView(); void sEdit(); void refresh(); void anchorClicked(const QUrl &); void sCheckButtonPriv(bool); signals: void commentAdded(); private: void showEvent(QShowEvent *event); enum CommentSources _source; int _sourceid; QList _commentIDList; bool _verboseCommentList; bool _editable; QTextBrowser *_browser; XTreeWidget *_comment; QPushButton *_newComment; QPushButton *_viewComment; QPushButton *_editComment; QMultiMap *_editmap; QMultiMap *_editmap2; XCheckBox *_verbose; }; #endif qt-client-4.1.0/widgets/contactCluster.cpp000066400000000000000000000353031217451700100205650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include "contactcluster.h" #include "contactwidget.h" ContactClusterLineEdit::ContactClusterLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "cntct()", "cntct_id", "cntct_name", 0, "cntct_title", "cntct_owner_username", 0, 0, pName, "cntct_active") { _objtype = "T"; _searchAcctId = -1; setTitles(tr("Contact"), tr("Contacts")); setUiName("contact"); setEditPriv("MaintainAllContacts"); setNewPriv("MaintainAllContacts"); setViewPriv("ViewAllContacts"); setEditOwnPriv("MaintainPersonalContacts"); setViewOwnPriv("ViewPersonalContacts"); _query = "SELECT cntct_id AS id, cntct_name AS number, cntct_title AS description, " " cntct_active AS active, " " cntct_first_name, cntct_last_name, crmacct_name, cntct_title, cntct_phone, " " cntct_phone2,cntct_fax, cntct_email, cntct_webaddr " "FROM cntct LEFT OUTER JOIN crmacct ON (cntct_crmacct_id = crmacct_id) " "WHERE (true) "; } void ContactClusterLineEdit::setNewAddr(QString line1, QString line2, QString line3, QString city, QString state, QString postalcode, QString country) { _newAddr.clear(); _newAddr << line1 << line2 << line3 << city << state << postalcode << country; } void ContactClusterLineEdit::setSearchAcct(int crmAcctId) { _searchAcctId = crmAcctId; if (crmAcctId != -1) _extraClause = QString(" (cntct_crmacct_id=%1) ").arg(crmAcctId); else _extraClause = ""; } void ContactClusterLineEdit::sList() { ContactList* newdlg = listFactory(); if (newdlg) { ParameterList params; if (_searchAcctId != -1) params.append("searchAcctId", _searchAcctId); newdlg->set(params); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("Could not instantiate a List Dialog")); } void ContactClusterLineEdit::sNew() { if (canOpen()) { // virtualCluster performs priv checking?? //if (!_x_privileges->check(_editPriv)) // return; ParameterList params; params.append("mode", "new"); if (_searchAcctId != -1) params.append("crmacct_id", _searchAcctId); if (_newAddr.count()) { params.append("addr_line1", _newAddr.at(0)); params.append("addr_line2", _newAddr.at(1)); params.append("addr_line3", _newAddr.at(2)); params.append("addr_city", _newAddr.at(3)); params.append("addr_state", _newAddr.at(4)); params.append("addr_postalcode", _newAddr.at(5)); params.append("addr_country", _newAddr.at(6)); } QDialog* newdlg = (QDialog*)_guiClientInterface->openWindow(_uiName, params, parentWidget(),Qt::WindowModal); int id = newdlg->exec(); if (id != QDialog::Rejected) setId(id); return; } } void ContactClusterLineEdit::sSearch() { ContactSearch* newdlg = searchFactory(); if (newdlg) { ParameterList params; if (_searchAcctId != -1) params.append("searchAcctId", _searchAcctId); newdlg->set(params); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("Could not instantiate a Search Dialog")); } ContactList* ContactClusterLineEdit::listFactory() { return new ContactList(this); } ContactSearch* ContactClusterLineEdit::searchFactory() { return new ContactSearch(this); } ContactCluster::ContactCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new ContactClusterLineEdit(this, pName)); _crmAcctId = -1; _minLayout = true; _fname = new QStringList(); for (int i = 0; i < 5; ++i) _fname->append(""); _label = new QLabel(this); _label->setObjectName("_label"); _label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); _name->setVisible(false); _description->setVisible(true); QSpacerItem* _cntctSpacer = new QSpacerItem(15, 3,QSizePolicy::Fixed,QSizePolicy::Fixed); _grid->addItem(_cntctSpacer, 1, 1, 1, 1); _grid->removeWidget(_description); _grid->removeWidget(_name); _grid->setVerticalSpacing(0); setLabel(tr("Name:")); _titleLit = new QLabel(tr("Title:"),this); _phoneLit = new QLabel(tr("Phone:"),this); _phone2Lit = new QLabel(tr("Alternate:"),this); _faxLit = new QLabel(tr("Fax:"),this); _emailLit = new QLabel(tr("Email:"),this); _webaddrLit = new QLabel(tr("Web:"),this); _phone = new QLabel(this); _phone2 = new QLabel(this); _fax = new QLabel(this); _email = new XURLLabel(this); _webaddr = new XURLLabel(this); _addr = new QLabel(this); _titleLit->setObjectName("_titleLit"); _phoneLit->setObjectName("_phoneLit"); _phone2Lit->setObjectName("_phone2Lit"); _faxLit->setObjectName("_faxLit"); _emailLit->setObjectName("_emailLit"); _webaddrLit->setObjectName("_webaddrLit"); _phone->setObjectName("_phone"); _phone2->setObjectName("_phone2"); _fax->setObjectName("_fax"); _email->setObjectName("_email"); _webaddr->setObjectName("_webaddr"); _addr->setObjectName("_addr"); _phone->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); _description->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); _addr->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Preferred); _titleLit->setAlignment(Qt::AlignRight); _phoneLit->setAlignment(Qt::AlignRight); _phone2Lit->setAlignment(Qt::AlignRight); _faxLit->setAlignment(Qt::AlignRight); _emailLit->setAlignment(Qt::AlignRight); _webaddrLit->setAlignment(Qt::AlignRight); _addrLayout = new QVBoxLayout; QSpacerItem* _addrSpacer = new QSpacerItem(20,0,QSizePolicy::Preferred,QSizePolicy::Expanding); _addrLayout->addWidget(_addr); _addrLayout->addSpacerItem(_addrSpacer); connect(this, SIGNAL(valid(bool)), this, SLOT(populate())); connect(_email, SIGNAL(leftClickedURL(QString)), this, SLOT(launchEmail(QString))); connect(_webaddr, SIGNAL(leftClickedURL(QString)), this, SLOT(openUrl(QString))); connect(this, SIGNAL(newId(int)), this, SIGNAL(changed())); setMinimalLayout(false); } void ContactCluster::setDescriptionVisible(bool p) { _titleLit->setVisible(p); _description->setVisible(p); _phoneLit->setVisible(p); _phone->setVisible(p); _phone2Lit->setVisible(p); _phone2->setVisible(p); _emailLit->setVisible(p); _email->setVisible(p); _faxLit->setVisible(p); _fax->setVisible(p); _webaddrLit->setVisible(p); _webaddr->setVisible(p); _addr->setVisible(p); } void ContactCluster::setMinimalLayout(bool isMinimal) { if (isMinimal == _minLayout) return; _grid->removeWidget(_titleLit); _grid->removeWidget(_description); _grid->removeWidget(_phoneLit); _grid->removeWidget(_phone); _grid->removeWidget(_phone2Lit); _grid->removeWidget(_phone2); _grid->removeWidget(_emailLit) ; _grid->removeWidget(_email); _grid->removeWidget(_faxLit); _grid->removeWidget(_fax); _grid->removeWidget(_webaddrLit); _grid->removeWidget(_webaddr); _grid->removeWidget(_addr); _grid->removeItem(_addrLayout); if (isMinimal) { _addr->hide(); _grid->addWidget(_phoneLit, 2, 0, 1, 1); _grid->addWidget(_phone, 2, 1, 1 ,1); _grid->addWidget(_titleLit, 2, 2, 1, 1); _grid->addWidget(_description, 2, 3, 1, 1); _grid->addWidget(_phone2Lit, 3, 0, 1, 1); _grid->addWidget(_phone2, 3, 1, 1, 1); _grid->addWidget(_emailLit, 3, 2, 1, 1) ; _grid->addWidget(_email, 3, 3, 1, 1); _grid->addWidget(_faxLit, 4, 0, 1, 1); _grid->addWidget(_fax, 4, 1, 1, 1); _grid->addWidget(_webaddrLit, 4, 2, 1, 1) ; _grid->addWidget(_webaddr, 4, 3, 1, 1); } else { _addr->show(); _grid->addWidget(_titleLit, 2, 0, 1, 1); _grid->addWidget(_description, 2, 1, 1, 2); _grid->addWidget(_phoneLit, 3, 0, 1, 1); _grid->addWidget(_phone, 3, 1, 1 ,1); _grid->addWidget(_phone2Lit, 4, 0, 1, 1); _grid->addWidget(_phone2, 4, 1, 1, 1); _grid->addWidget(_faxLit, 5, 0, 1, 1); _grid->addWidget(_fax, 5, 1, 1, 1); _grid->addWidget(_emailLit, 6, 0, 1, 1) ; _grid->addWidget(_email, 6, 1, 1, 1); _grid->addWidget(_webaddrLit, 7, 0, 1, 1) ; _grid->addWidget(_webaddr, 7, 1, 1, 1); _grid->addLayout(_addrLayout, 3, 2, 4, 1); } _minLayout = isMinimal; } void ContactCluster::setNewAddr(QString line1, QString line2, QString line3, QString city, QString state, QString postalcode, QString country) { static_cast(_number)->setNewAddr(line1, line2, line3, city, state, postalcode, country); } void ContactCluster::setSearchAcct(int crmAcctId) { ContactClusterLineEdit* ccle = static_cast(_number); ccle->setSearchAcct(crmAcctId); } void ContactCluster::populate() { if (id() == -1) { _phone->clear(); _phone2->clear(); _fax->clear(); _email->clear(); _webaddr->clear(); _addr->clear(); setName(0, ""); setName(1, ""); setName(2, ""); setName(3, ""); setName(4, ""); _crmAcctId = -1; } else { if (_number->completer()) disconnect(_number, SIGNAL(textChanged(QString)), _number, SLOT(sHandleCompleter())); XSqlQuery dataQ; dataQ.prepare("SELECT cntct_honorific, cntct_first_name, " " cntct_middle, cntct_last_name, cntct_suffix, " " cntct_phone, cntct_phone2, " " cntct_fax, cntct_email, cntct_webaddr, " " formatAddr(cntct_addr_id) AS address, " " cntct_crmacct_id " "FROM cntct " "WHERE (cntct_id=:id);"); dataQ.bindValue(":id", id()); dataQ.exec(); if (dataQ.first()) { setName(0, dataQ.value("cntct_honorific").toString()); setName(1, dataQ.value("cntct_first_name").toString()); setName(2, dataQ.value("cntct_middle").toString()); setName(3, dataQ.value("cntct_last_name").toString()); setName(4, dataQ.value("cntct_suffix").toString()); _phone->setText(dataQ.value("cntct_phone").toString()); _phone2->setText(dataQ.value("cntct_phone2").toString()); _fax->setText(dataQ.value("cntct_fax").toString()); _email->setText(dataQ.value("cntct_email").toString()); _webaddr->setText(dataQ.value("cntct_webaddr").toString()); _email->setURL("mailto:" + dataQ.value("cntct_email").toString()); QUrl url(dataQ.value("cntct_webaddr").toString()); if(url.scheme().isEmpty()) url.setScheme("http"); _webaddr->setURL(url.toString()); _addr->setText(dataQ.value("address").toString()); _crmAcctId=-1; } if (_number->completer()) connect(_number, SIGNAL(textChanged(QString)), _number, SLOT(sHandleCompleter())); } } void ContactCluster::launchEmail(QString url) { QString extUrl = QString(url); if (!_subjText.isEmpty() || !_bodyText.isEmpty()) extUrl.append("?"); if (!_subjText.isEmpty()) { extUrl.append(_subjText.prepend("subject=")); if (!_bodyText.isEmpty()) extUrl.append("&"); } if (!_bodyText.isEmpty()) extUrl.append(_bodyText.prepend("body=")); QDesktopServices::openUrl(QUrl(extUrl)); } void ContactCluster::openUrl(QString url) { QUrl tmpurl(url); if (QDesktopServices::openUrl(tmpurl)) return; if(tmpurl.scheme().isEmpty()) { tmpurl.setScheme("http"); if (QDesktopServices::openUrl(tmpurl)) return; } if (tmpurl.scheme() == "http" && tmpurl.host().isEmpty() && ! tmpurl.path().isEmpty()) { tmpurl.setHost(tmpurl.path()); tmpurl.setPath(""); if (QDesktopServices::openUrl(tmpurl)) return; } if (tmpurl.scheme() == "http" && ! tmpurl.host().startsWith("www.")) { tmpurl.setHost("www." + tmpurl.host()); if (QDesktopServices::openUrl(tmpurl)) return; } qWarning("%s::openUrl(%s) could not open %s", qPrintable(objectName()), qPrintable(url), qPrintable(tmpurl.toString())); } void ContactCluster::addNumberWidget(ContactClusterLineEdit* pNumberWidget) { _number = pNumberWidget; if (! _number) return; _number->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _number->setMinimumWidth(200); QHBoxLayout* hbox = new QHBoxLayout; QSpacerItem* item = new QSpacerItem(100, 20, QSizePolicy::Fixed, QSizePolicy::Fixed); hbox->addWidget(_number); hbox->addItem(item); _grid->addLayout(hbox, 0, 1, 1, 3); setFocusProxy(pNumberWidget); connect(_number, SIGNAL(newId(int)), this, SIGNAL(newId(int))); connect(_number, SIGNAL(parsed()), this, SLOT(sRefresh())); connect(_number, SIGNAL(valid(bool)), this, SIGNAL(valid(bool))); } void ContactCluster::setName(int segment, const QString name) { if ((segment == 0 || segment == 2) && !name.endsWith('.') && !name.isEmpty()) _fname->replace(segment, name + "."); else _fname->replace(segment, name); _number->setText(_fname->join(" ").replace(" ", " ").trimmed()); } void ContactCluster::setHonorific(const QString honorific) { setName(0, honorific); } void ContactCluster::setFirst(const QString first) { setName(1, first); } void ContactCluster::setMiddle(const QString middle) { setName(2, middle); } void ContactCluster::setLast(const QString last) { setName(3, last); } void ContactCluster::setSuffix(const QString suffix) { setName(4, suffix); } void ContactCluster::setPhone(const QString phone) { _phone->setText(phone); } void ContactCluster::setTitle(const QString title) { _description->setText(title); } void ContactCluster::setFax(const QString fax) { _fax->setText(fax); } void ContactCluster::setEmailAddress(const QString email) { _email->setText(email); } void ContactCluster::setEmailSubjectText(const QString text) { _subjText = text; } QString ContactCluster::name() const { return _number->text(); } void ContactCluster::setEmailBodyText(const QString text) { _bodyText = text; } qt-client-4.1.0/widgets/contactWidget.cpp000066400000000000000000001373521217451700100203760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include "xsqlquery.h" #include "contactemail.h" #include "contactwidget.h" #include "errorReporter.h" #define FAKEEMAILID -999 void ContactWidget::init() { _ignoreSignals = false; _titleSingular = tr("Contact"); _titlePlural = tr("Contacts"); _query = "SELECT cntct.*, crmacct_name " "FROM cntct() LEFT OUTER JOIN crmacct ON (cntct_crmacct_id = crmacct_id) "; _layoutDone = false; _minimalLayout = false; _searchAcctId = -1; _list = new QPushButton(tr("..."), this); _list->setObjectName("_list"); _list->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); #ifndef Q_WS_MAC _list->setMaximumWidth(25); #else _list->setMinimumWidth(60); _list->setMinimumHeight(32); #endif _grid->removeWidget(_label); // will be reinserted _grid->removeWidget(_description); delete _description; _description = 0; _grid->setMargin(0); _grid->setSpacing(2); _nameBox = new QHBoxLayout; _nameBox->setSpacing(2); _initialsBox = new QHBoxLayout; _initialsBox->setSpacing(2); _titleBox = new QHBoxLayout; _titleBox->setSpacing(2); _change = new XLineEdit(this); _numberLit = new QLabel(tr("Number:"), this); _numberLit->setObjectName("_numberLit"); _number = new XLineEdit(this, "_number"); _change->hide(); _number->hide(); _numberLit->hide(); _nameLit = new QLabel(tr("Name:"), this); _nameLit->setObjectName("_nameLit"); _honorific = new XComboBox(this, "_honorific"); _first = new XLineEdit(this, "_first"); _middle = new XLineEdit(this, "_middle"); _middle->setFixedWidth(20); _last = new XLineEdit(this, "_last"); _suffix = new XLineEdit(this, "_suffix"); _suffix->setFixedWidth(30); _initialsLit = new QLabel(tr("Initials:"), this); _initialsLit->setObjectName("_initialsLit"); _initials = new XLineEdit(this, "_initials"); _initials->setFixedWidth(_initials->size().width() / 3); _titleLit = new QLabel(tr("Job Title:"), this); _titleLit->setObjectName("_titleLit"); _title = new XLineEdit(this, "_title"); _mapper = new XDataWidgetMapper(this); //_nameBox->addWidget(_nameLit, 0); _nameBox->addWidget(_honorific, 0); _nameBox->addWidget(_first, 1); _nameBox->addWidget(_middle, 0); _nameBox->addWidget(_last, 2); _nameBox->addWidget(_suffix, 0); _nameBox->addWidget(_list, 0, Qt::AlignRight); //_initialsBox->addWidget(_initialsLit, 0); _initialsBox->addWidget(_initials, 0); _initialsBox->addStretch(0); //_titleBox->addWidget(_titleLit, 0); _titleBox->addWidget(_title, 2); _buttonBox = new QGridLayout; _crmAcct = new CRMAcctCluster(this, "_crmAcct"); _active = new QCheckBox(tr("Active"), this); _active->setObjectName("_active"); _owner = new UsernameCluster(this, "_owner"); _buttonBox->addWidget(_crmAcct, 0, 1, Qt::AlignTop); _buttonBox->addWidget(_owner, 0, 2, Qt::AlignTop); QRegExp rx("^([0-9a-z]+[-._+&])*[0-9a-z]+@([-0-9a-z]+[.])+[a-z]{2,6}$"); QValidator *validator = new QRegExpValidator(rx, this); _phoneLit = new QLabel(tr("Voice:"), this); _phoneLit->setObjectName("_phoneLit"); _phone = new XLineEdit(this, "_phone"); _phone2Lit = new QLabel(tr("Alternate:"), this); _phone2Lit->setObjectName("_phone2Lit"); _phone2 = new XLineEdit(this, "_phone2"); _faxLit = new QLabel(tr("Fax:"), this); _faxLit->setObjectName("_faxLit"); _fax = new XLineEdit(this, "_fax"); _emailLit = new QLabel(tr("E-Mail:"), this); _emailLit->setObjectName("_emailLit"); _email = new XComboBox(this, "_email"); _email->setEditable(true); _email->setValidator(validator); _email->lineEdit()->installEventFilter(this); _email->insertEditor(XComboBox::Adhoc, this, SLOT(sEditEmailList())); _webaddrLit = new QLabel(tr("Web:"), this); _webaddrLit->setObjectName("_webaddrLit"); _webaddr = new XLineEdit(this, "_webaddr"); _address = new AddressCluster(this, "_address"); //So we can manipulate just the line edit QLineEdit* emailEdit = _email->lineEdit(); #if defined Q_OS_MAC _honorific->setMinimumHeight(26); _first->setMinimumHeight(22); _middle->setMinimumHeight(22); _last->setMinimumHeight(22); _suffix->setMinimumHeight(22); _phone->setMinimumWidth(140); _crmAcct->setMinimumHeight(72); #endif QPalette p = _email->palette(); p.setColor(QPalette::Text, Qt::blue); emailEdit->setPalette(p); _webaddr->setPalette(p); QFont newFont = _email->font(); newFont.setUnderline(TRUE); emailEdit->setFont(newFont); _webaddr->setFont(newFont); _numberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _nameLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _titleLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _phoneLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _phone2Lit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _faxLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _emailLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _initialsLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _webaddrLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _honorific->setEditable(true); _honorific->setType(XComboBox::Honorifics); _crmAcct->setLabel(tr("CRM Account:")); _owner->setLabel(tr("Owner:")); layout(); connect(_list, SIGNAL(clicked()), this, SLOT(sEllipses())); connect(_honorific, SIGNAL(newID(int)), this, SIGNAL(changed())); connect(_first, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_middle, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_last, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_suffix, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_initials, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_crmAcct, SIGNAL(newId(int)), this, SIGNAL(changed())); connect(_title, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_phone, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_phone2, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_fax, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_email, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_webaddr, SIGNAL(textChanged(const QString&)), this, SIGNAL(changed())); connect(_address, SIGNAL(changed()), this, SIGNAL(changed())); connect(this, SIGNAL(changed()), this, SLOT(setChanged())); connect(_honorific, SIGNAL(newID(int)), this, SLOT(sCheck())); connect(_first, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_middle, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_last, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_suffix, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_initials, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_crmAcct, SIGNAL(newId(int)), this, SLOT(sCheck())); connect(_title, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_phone, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_phone2, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_fax, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(emailEdit, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_webaddr, SIGNAL(editingFinished()), this, SLOT(sCheck())); connect(_address, SIGNAL(changed()), this, SLOT(sCheck())); connect(_webaddr, SIGNAL(doubleClicked()), this, SLOT(sLaunchWebaddr())); setListVisible(true); connect(_first, SIGNAL(editingFinished()), this, SLOT(findDuplicates())); connect(_last, SIGNAL(editingFinished()), this, SLOT(findDuplicates())); connect(_crmAcct, SIGNAL(newId(int)), this, SLOT(setSearchAcct(int))); setFocusPolicy(Qt::StrongFocus); setFocusProxy(_honorific); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setLabel(""); _limits = 0; silentSetId(-1); setOwnerVisible(false); _mode = Edit; } ContactWidget::ContactWidget(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { init(); } void ContactWidget::findDuplicates() { if (_first->text().isEmpty() && _last->text().isEmpty()) return; QString msg; XSqlQuery r; r.prepare( "SELECT cntct_id, COALESCE(cntct_crmacct_id,0) AS cntct_crmacct_id " "FROM cntct " "WHERE ( ( cntct_first_name ~~* :first) " " AND (cntct_last_name ~~* :last) );"); r.bindValue(":first", _first->text()); r.bindValue(":last", _last->text()); r.bindValue(":crmacct_id", _searchAcctId); r.exec(); if (r.size() == 1) { r.first(); msg = tr("A contact exists with the same first and last name"); if (_searchAcctId > 0 && r.value("cntct_crmacct_id").toInt() == 0) msg += tr(" not associated with any CRM Account"); else if (_searchAcctId == r.value("cntct_crmacct_id").toInt()) msg += tr(" on the current CRM Account"); else if (_searchAcctId > 0) msg += tr(" associated with another CRM Account"); msg += tr(". Would you like to use the existing contact?"); if (QMessageBox::question(this, tr("Existing Contact"), msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { r.first(); setId(r.value("cntct_id").toInt()); } } else if (r.size() > 1) { if (_searchAcctId > 0) { int cnt = 0; int cntctid = 0; while (r.next()) { if (r.value("cntct_crmacct_id").toInt() == _searchAcctId) { cnt += 1; cntctid = r.value("cntct_id").toInt(); } } if (cnt == 1) { msg = tr("A contact exists with the same first and last name " "on the current CRM Account. " "Would you like to use the existing contact?"); if (QMessageBox::question(this, tr("Existing Contact"), msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) setId(cntctid); return; } if (cnt == 0) _searchAcctId = -1; } QString msg = tr("Multple contacts exist with the same first and last name"); msg += tr(". Would you like to view all the existing contacts?"); if (QMessageBox::question(this, tr("Existing Contacts"), msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { ContactSearch* newdlg = new ContactSearch(this); if (newdlg) { newdlg->_searchFirst->setChecked(true); newdlg->_searchLast->setChecked(true); newdlg->_search->setText(_first->text() + " " + _last->text()); newdlg->sFillList(); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("Could not instantiate a Search Dialog")); } } else if (r.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), r.lastError().databaseText()); } void ContactWidget::setChanged() { _changed=true; } void ContactWidget::setId(const int pId) { if (pId == _id) return; else { silentSetId(pId); emit newId(pId); } } void ContactWidget::silentSetId(const int pId) { disconnect(_first, SIGNAL(editingFinished()), this, SLOT(findDuplicates())); disconnect(_last, SIGNAL(editingFinished()), this, SLOT(findDuplicates())); if (pId == -1 || pId == 0) { _id = -1; _valid = false; connect(_first, SIGNAL(editingFinished()), this, SLOT(findDuplicates())); connect(_last, SIGNAL(editingFinished()), this, SLOT(findDuplicates())); clear(); } else if (pId == _id) return; else { XSqlQuery idQ; _query.replace("cntct()","cntct"); // Switch to non-restrictive table idQ.prepare(_query + " WHERE cntct_id = :id;"); _query.replace("FROM cntct", "FROM cntct()"); // Switch back to restrictive table function idQ.bindValue(":id", pId); idQ.exec(); if (idQ.first()) { _ignoreSignals = true; _id = pId; _valid = true; _number->setText(idQ.value("cntct_number").toString()); _honorific->setEditText(idQ.value("cntct_honorific").toString()); _first->setText(idQ.value("cntct_first_name").toString()); _middle->setText(idQ.value("cntct_middle").toString()); _last->setText(idQ.value("cntct_last_name").toString()); _suffix->setText(idQ.value("cntct_suffix").toString()); _initials->setText(idQ.value("cntct_initials").toString()); _crmAcct->setId(idQ.value("cntct_crmacct_id").toInt()); _title->setText(idQ.value("cntct_title").toString()); _phone->setText(idQ.value("cntct_phone").toString()); _phone2->setText(idQ.value("cntct_phone2").toString()); _fax->setText(idQ.value("cntct_fax").toString()); _emailCache=idQ.value("cntct_email").toString(); _email->append(FAKEEMAILID, idQ.value("cntct_email").toString()); // TODO: this is rotten _webaddr->setText(idQ.value("cntct_webaddr").toString()); _address->setId(idQ.value("cntct_addr_id").toInt()); _active->setChecked(idQ.value("cntct_active").toBool()); _notes = idQ.value("cntct_notes").toString(); _owner->setUsername(idQ.value("cntct_owner_username").toString()); fillEmail(); if (_mapper->model()) { _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_number)), _number->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_number)), _number->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_honorific)), _honorific->currentText()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_first)), _first->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_last)), _last->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_initials)), _initials->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this)), _number->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_title)), _title->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_phone)), _phone->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_phone2)), _phone2->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_fax)), _fax->text()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_email)), _email->currentText()); _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_webaddr)), _webaddr->text()); } _ignoreSignals = false; } else if (idQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), idQ.lastError().databaseText()); _valid = true; } _changed=false; // _parsed = TRUE; } void ContactWidget::setListVisible(bool p) { _first->disconnect(); _middle->disconnect(); _last->disconnect(); _suffix->disconnect(); _first->disconnect(); _middle->disconnect(); _last->disconnect(); _suffix->disconnect(); _list->setVisible(p); if (p) { connect(_first, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_middle, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_last, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_suffix, SIGNAL(requestSearch()), this, SLOT(sSearch())); connect(_first, SIGNAL(requestList()), this, SLOT(sList())); connect(_middle, SIGNAL(requestList()), this, SLOT(sList())); connect(_last, SIGNAL(requestList()), this, SLOT(sList())); connect(_suffix, SIGNAL(requestList()), this, SLOT(sList())); } } void ContactWidget::setNumber(QString p) { if (p == _number->text()) return; _number->setText(p); XSqlQuery q; q.prepare("SELECT cntct_id " "FROM cntct " "WHERE (cntct_number=:number);"); q.bindValue(":number", p); q.exec(); if (q.first()) { if (q.value("cntct_id").toInt() != _id) silentSetId(q.value("cntct_id").toInt()); } else _number->setText(p); } void ContactWidget::clear() { _id = -1; _valid = false; _honorific->clearEditText(); _first->clear(); _middle->clear(); _last->clear(); _suffix->clear(); _initials->clear(); _crmAcct->setId(-1); _title->clear(); _phone->clear(); _phone2->clear(); _fax->clear(); _email->clear(); _webaddr->clear(); _address->clear(); _active->setChecked(true); _notes = ""; _number->clear(); } QString ContactWidget::name() const { QString name; if (!_first->text().isEmpty()) name = _first->text(); if (!_middle->text().isEmpty()) { if (!name.isEmpty()) name += " "; name += _middle->text(); } if (!_last->text().isEmpty()) { if (!name.isEmpty()) name += " "; name += _last->text(); } return name; } void ContactWidget::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(this , _fieldNameNumber, "number", "defaultText"); m->addMapping(_change , _fieldNameChange, "text", "defaultText"); m->addMapping(_active , _fieldNameActive); m->addMapping(_first , _fieldNameFirst, "text", "defaultText"); m->addMapping(_middle , _fieldNameMiddle, "text", "defaultText"); m->addMapping(_last , _fieldNameLast, "text", "defaultText"); m->addMapping(_suffix , _fieldNameSuffix, "text", "defaultText"); m->addMapping(_initials , _fieldNameInitials, "text", "defaultText"); m->addMapping(_title , _fieldNameTitle, "text", "defaultText"); m->addMapping(_phone , _fieldNamePhone, "text", "defaultText"); m->addMapping(_phone2 , _fieldNamePhone2, "text", "defaultText"); m->addMapping(_fax , _fieldNameFax, "text", "defaultText"); m->addMapping(_email , _fieldNameEmailAddress, "text", "defaultText"); m->addMapping(_webaddr , _fieldNameWebAddress, "text", "defaultText"); _honorific->setFieldName(_fieldNameHonorific); _honorific->setDataWidgetMap(m); _crmAcct->setFieldName(_fieldNameCrmAccount); _crmAcct->setDataWidgetMap(m); _address->setFieldNameAddrChange(_fieldNameAddrChange); _address->setFieldNameNumber(_fieldNameAddrNumber); _address->setFieldNameLine1(_fieldNameLine1); _address->setFieldNameLine2(_fieldNameLine2); _address->setFieldNameLine3(_fieldNameLine3); _address->setFieldNameCity(_fieldNameCity); _address->setFieldNameState(_fieldNameState); _address->setFieldNamePostalCode(_fieldNamePostalCode); _address->setFieldNameCountry(_fieldNameCountry); _address->setDataWidgetMap(m); _mapper=m; } void ContactWidget::setName(const QString& p) { int firstSpace = p.indexOf(" "); if (firstSpace > 0) { setFirst(p.left(firstSpace)); setLast(p.right(p.length() - firstSpace - 1)); } else setLast(p); } /* returns -1 if error -2 if address is shared -10 if unclear if intent is to overwrite or create new contact */ int ContactWidget::save(AddressCluster::SaveFlags flag) { int addrSave = _address->save(flag); if (addrSave < 0) return addrSave; XSqlQuery datamodQ; datamodQ.prepare("SELECT COALESCE(saveCntct(:cntct_id,:cntct_number,:crmacct_id,:addr_id," ":honorific,:first,:middle,:last,:suffix,:initials," ":active,:phone,:phone2,:fax,:email,:webaddr," ":notes,:title,:flag,:owner),0) AS result;"); datamodQ.bindValue(":cntct_number", _number->text()); datamodQ.bindValue(":cntct_id", id()); datamodQ.bindValue(":honorific", _honorific->currentText()); if (_address->id() > 0) datamodQ.bindValue(":addr_id", _address->id()); datamodQ.bindValue(":first", _first->text()); datamodQ.bindValue(":middle", _middle->text()); datamodQ.bindValue(":last", _last->text()); datamodQ.bindValue(":suffix", _suffix->text()); datamodQ.bindValue(":initials", _initials->text()); datamodQ.bindValue(":title", _title->text()); datamodQ.bindValue(":phone", _phone->text()); datamodQ.bindValue(":phone2", _phone2->text()); datamodQ.bindValue(":fax", _fax->text()); datamodQ.bindValue(":email", _email->currentText()); datamodQ.bindValue(":webaddr", _webaddr->text()); datamodQ.bindValue(":notes", _notes); datamodQ.bindValue(":owner", _owner->username()); if (flag == AddressCluster::CHECK) datamodQ.bindValue(":flag", QString("CHECK")); else if (flag == AddressCluster::CHANGEALL) datamodQ.bindValue(":flag", QString("CHANGEALL")); else if (flag == AddressCluster::CHANGEONE) datamodQ.bindValue(":flag", QString("CHANGEONE")); else return -1; if (_crmAcct->id() > 0) datamodQ.bindValue(":crmacct_id",_crmAcct->id()); // else NULL datamodQ.bindValue(":active", QVariant(_active->isChecked())); datamodQ.exec(); if (datamodQ.first()) { if (datamodQ.value("result").toInt() == 0) return 0; else if (datamodQ.value("result").toInt() > 0) if (_mapper->model()) { _id=datamodQ.value("result").toInt(); _changed=false; } else silentSetId(datamodQ.value("result").toInt()); else if (datamodQ.value("result").toInt() == -10) return -10; } else return -1; return id(); } void ContactWidget::setAccount(const int p) { if (_crmAcct->id() != p) { _crmAcct->setId(p); _changed = true; } } void ContactWidget::setOwnerVisible(const bool vis) { _owner->setVisible(vis); layout(); } void ContactWidget::setOwnerEnabled(const bool vis) { _owner->setEnabled(vis); } void ContactWidget::setNumberVisible(const bool vis) { _number->setVisible(vis); _numberLit->setVisible(vis); layout(); } void ContactWidget::setAddressVisible(const bool vis) { _address->setVisible(vis); layout(); } void ContactWidget::setAccountVisible(const bool p) { _crmAcct->setVisible(p); layout(); } void ContactWidget::setActiveVisible(const bool p) { _active->setVisible(p); layout(); } void ContactWidget::setEmailVisible(const bool p) { _emailLit->setVisible(p); _email->setVisible(p); // layout(); } void ContactWidget::setInitialsVisible(const bool p) { _initialsLit->setVisible(p); _initials->setVisible(p); layout(); } void ContactWidget::setPhonesVisible(const bool p) { _phoneLit->setVisible(p); _phone->setVisible(p); _phone2Lit->setVisible(p); _phone2->setVisible(p); _faxLit->setVisible(p); _fax->setVisible(p); // layout(); } void ContactWidget::setWebaddrVisible(const bool p) { _webaddrLit->setVisible(p); _webaddr->setVisible(p); // layout(); } void ContactWidget::setMinimalLayout(const bool p) { // always visible _label->setVisible(true); _nameLit->setVisible(true); _honorific->setVisible(true); _first->setVisible(true); _middle->setVisible(true); _last->setVisible(true); _title->setVisible(true); _phoneLit->setVisible(true); _phone->setVisible(true); _faxLit->setVisible(true); _fax->setVisible(true); _emailLit->setVisible(true); _email->setVisible(true); // at the mercy of minimal layout _initialsLit->setVisible(! p); _initials->setVisible(! p); _crmAcct->setVisible(! p); _active->setVisible(! p); _phone2Lit->setVisible(! p); _phone2->setVisible(! p); _webaddrLit->setVisible(! p); _webaddr->setVisible(! p); _address->setVisible(! p); _minimalLayout = p; layout(); } void ContactWidget::layout() { QLayout* pwl = 0; if(parentWidget()) pwl = parentWidget()->layout(); QLayout* currLayout = (_layoutDone) ? _grid : pwl; if (_layoutDone) { currLayout->removeItem(_nameBox); currLayout->removeItem(_initialsBox); currLayout->removeItem(_buttonBox); currLayout->removeItem(_titleBox); } if (currLayout) { currLayout->removeWidget(_label); currLayout->removeItem(_nameBox); currLayout->removeItem(_buttonBox); currLayout->removeItem(_titleBox); currLayout->removeWidget(_phoneLit); currLayout->removeWidget(_phone); currLayout->removeWidget(_phone2Lit); currLayout->removeWidget(_phone2); currLayout->removeWidget(_faxLit); currLayout->removeWidget(_fax); currLayout->removeWidget(_emailLit); currLayout->removeWidget(_email); currLayout->removeWidget(_webaddrLit); currLayout->removeWidget(_webaddr); currLayout->removeWidget(_address); } _grid->addWidget(_label, 0, 0, 1, -1); //_grid->addItem(_numberBox, 1, 0, 1, -1); Possible implement at a later time _grid->addWidget(_nameLit, 1, 0, 1, 1); _grid->addItem(_nameBox, 1, 1, 1, -1); _grid->addWidget(_initialsLit,2, 0, 1, 1); _grid->addItem(_initialsBox, 2, 1, 1, -1); _grid->addWidget(_active, 2, 2, 1, -1); _grid->addItem(_buttonBox, 3, 0, 1, -1); _grid->addWidget(_titleLit, 4, 0, 1, 1); _grid->addItem(_titleBox, 4, 1, 1, -1); if (_minimalLayout) { _grid->setColumnStretch(0, 0); _grid->setColumnStretch(1, 1); _grid->setColumnStretch(2, 0); _grid->setColumnStretch(3, 1); _grid->setColumnStretch(4, 0); _grid->setColumnStretch(5, 2); _grid->addWidget(_phoneLit, 5, 0); _grid->addWidget(_phone, 5, 1); _grid->addWidget(_faxLit, 5, 2); _grid->addWidget(_fax, 5, 3); _grid->addWidget(_emailLit, 5, 4); _grid->addWidget(_email, 5, 5); _grid->addWidget(_phone2Lit, 5, 0); _grid->addWidget(_phone2, 5, 1); _grid->addWidget(_webaddrLit, 5, 4); _grid->addWidget(_webaddr, 6, 0); _grid->addWidget(_address, 6, 1); //, -1, -1); } else if (_address->isVisibleTo(this)) { _grid->setColumnStretch(0, 0); _grid->setColumnStretch(1, 1); _grid->setColumnStretch(2, 3); _grid->addWidget(_phoneLit, 5, 0); _grid->addWidget(_phone, 5, 1); _grid->addWidget(_address, 5, 2, 5, -1); _grid->addWidget(_phone2Lit, 6, 0); _grid->addWidget(_phone2, 6, 1); _grid->addWidget(_faxLit, 7, 0); _grid->addWidget(_fax, 7, 1); _grid->addWidget(_emailLit, 8, 0); _grid->addWidget(_email, 8, 1); _grid->addWidget(_webaddrLit, 9, 0); _grid->addWidget(_webaddr, 9, 1); } else { _grid->setColumnStretch(0, 0); _grid->setColumnStretch(1, 1); _grid->setColumnStretch(2, 0); _grid->setColumnStretch(3, 2); _grid->setColumnStretch(4, 0); _grid->setColumnStretch(5, 2); _grid->addWidget(_phoneLit, 6, 0); _grid->addWidget(_phone, 6, 1); _grid->addWidget(_faxLit, 6, 2); _grid->addWidget(_fax, 6, 3); _grid->addWidget(_webaddrLit, 6, 4); _grid->addWidget(_webaddr, 5, 5); _grid->addWidget(_phone2Lit, 7, 0); _grid->addWidget(_phone2, 7, 1); _grid->addWidget(_emailLit, 7, 2); _grid->addWidget(_email, 7, 3); _grid->addWidget(_address, 8, 0, 1, -1); } #if defined Q_WS_MAC setMinimumSize(_grid->columnCount() * 50, _grid->rowCount() * 11); #endif _layoutDone = true; } void ContactWidget::setSearchAcct(const int p) { _searchAcctId = p; addressWidget()->setSearchAcct(p); } void ContactWidget::check() { QString oldNumber = _number->text(); XSqlQuery tx; tx.exec("BEGIN;"); int result=save(); tx.exec("ROLLBACK;"); _number->setText(oldNumber); if (result == -2) { int answer = 2; // Cancel answer = QMessageBox::question(this, tr("Question Saving Address"), tr("There are multiple Contacts sharing this Address.\n" "What would you like to do?"), tr("Change This One"), tr("Change Address for All"), 0, 0); if (answer==0) { _address->setAddrChange(QString("CHANGEONE")); _change->setText("CHANGEONE"); } else if (answer==1) { _address->setAddrChange(QString("CHANGEALL")); _change->setText("CHANGEALL"); } } else if (result == -10) { int answer; answer = QMessageBox::question(this, tr("Question Saving %1").arg(label()), tr("

    Would you like to update the existing Contact or " "create a new one?"), tr("Create New"), tr("Change Existing"), 0, 0); if (0 == answer) _change->setText("CHANGEONE"); else if (1 == answer) _change->setText("CHANGEALL"); // Make sure the mapper is aware of this change if (_mapper && _mapper->model() && (_mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(), _mapper->mappedSection(_change))).toString() != _change->text())) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(), _mapper->mappedSection(_change)), _change->text()); } else if (result < 0) { QMessageBox::critical(this, tr("Error"),tr("There was an error checking this Contact (%1).").arg(result)); return; } } void ContactWidget::sCheck() { if(_ignoreSignals) return; if ((! _honorific->isVisibleTo(this) || _honorific->currentText().simplified().isEmpty()) && (! _first->isVisibleTo(this) || _first->text().simplified().isEmpty()) && (! _middle->isVisibleTo(this) || _middle->text().simplified().isEmpty()) && (! _last->isVisibleTo(this) || _last->text().simplified().isEmpty()) && (! _suffix->isVisibleTo(this) || _suffix->text().simplified().isEmpty()) && (! _initials->isVisibleTo(this) || _initials->text().simplified().isEmpty()) && (! _crmAcct->isVisibleTo(this) || _crmAcct->id() <= 0) && (! _title->isVisibleTo(this) || _title->text().simplified().isEmpty()) && (! _phone->isVisibleTo(this) || _phone->text().simplified().isEmpty()) && (! _phone2->isVisibleTo(this) || _phone2->text().simplified().isEmpty()) && (! _fax->isVisibleTo(this) || _fax->text().simplified().isEmpty()) && (! _email->isVisibleTo(this) || _email->currentText().simplified().isEmpty()) && (! _webaddr->isVisibleTo(this) || _webaddr->text().simplified().isEmpty()) && (! _address->isVisibleTo(this) || _address->id() <= 0)) setId(-1); } void ContactWidget::sEllipses() { if (_x_preferences && _x_preferences->value("DefaultEllipsesAction") == "search") sSearch(); else sList(); } void ContactWidget::sInfo() { /* ContactInfo* newdlg = new ContactInfo(this, "ContactInfo", true); if (newdlg) { int id = newdlg->exec(); setId(id); } else */ QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sInfo() not yet defined").arg(metaObject()->className())); } void ContactWidget::sList() { ContactList* newdlg = new ContactList(this); if (newdlg) { ParameterList params; params.append("searchAcctId", _searchAcctId); newdlg->set(params); int id = newdlg->exec(); if (id > 0) setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("Could not instantiate a List Dialog")); } void ContactWidget::sSearch() { ContactSearch* newdlg = new ContactSearch(this); if (newdlg) { ParameterList params; params.append("searchAcctId", _searchAcctId); newdlg->set(params); int id = newdlg->exec(); if (id > 0) setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("Could not instantiate a Search Dialog")); } void ContactWidget::setChange(QString p) { _change->setText(p); if (_mapper->model() && _mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_change))).toString() != _change->text()) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(_change)), _change->text()); } void ContactWidget::sLaunchEmail() { QString extUrl = QString(_email->currentText()); if (!_subjText.isEmpty() || !_bodyText.isEmpty()) extUrl.append("?"); if (!_subjText.isEmpty()) { extUrl.append(_subjText.prepend("subject=")); if (!_bodyText.isEmpty()) extUrl.append("&"); } if (!_bodyText.isEmpty()) extUrl.append(_bodyText.prepend("body=")); QDesktopServices::openUrl(QUrl("mailto:" + extUrl)); } void ContactWidget::sLaunchWebaddr() { QUrl tmpurl(_webaddr->text()); if (QDesktopServices::openUrl(tmpurl)) return; if(tmpurl.scheme().isEmpty()) { tmpurl.setScheme("http"); if (QDesktopServices::openUrl(tmpurl)) return; } if (tmpurl.scheme() == "http" && tmpurl.host().isEmpty() && ! tmpurl.path().isEmpty()) { tmpurl.setHost(tmpurl.path()); tmpurl.setPath(""); if (QDesktopServices::openUrl(tmpurl)) return; } if (tmpurl.scheme() == "http" && ! tmpurl.host().startsWith("www.")) { tmpurl.setHost("www." + tmpurl.host()); if (QDesktopServices::openUrl(tmpurl)) return; } qWarning("%s::sLaunchWebaddr() could not open %s", qPrintable(objectName()), qPrintable(tmpurl.toString())); } /////////////////////////////////////////////////////////////////////////////// ContactList::ContactList(QWidget* pParent, const char* pName, bool, Qt::WFlags) : VirtualList(pParent, 0) { setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("Contacts")); _searchAcctId = -1; if (!pName) setObjectName("ContactList"); else setObjectName(pName); _searchAcct = new QCheckBox(); _dialogLyt->addWidget(_searchAcct); _searchAcct->hide(); _listTab->setColumnCount(0); _listTab->addColumn(tr("First Name"), 80, Qt::AlignLeft, true, "cntct_first_name"); _listTab->addColumn(tr("Last Name"), -1, Qt::AlignLeft, true, "cntct_last_name"); _listTab->addColumn(tr("CRM Account"), 100, Qt::AlignLeft, true, "crmacct_name"); } void ContactList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("searchAcctId", &valid); if (valid) { _searchAcctId = param.toInt(); XSqlQuery crmacct; crmacct.prepare("SELECT crmacct_number || ' - ' || crmacct_name AS account " "FROM crmacct " "WHERE (crmacct_id = :crmacct_id);"); crmacct.bindValue(":crmacct_id", _searchAcctId); crmacct.exec(); if (crmacct.first()) { _searchAcct->setChecked(true); _searchAcct->setText(tr("Only contacts for %1").arg(crmacct.value("account").toString())); connect(_searchAcct, SIGNAL(toggled(bool)), this, SLOT(sFillList())); } } _searchAcct->setVisible(_searchAcctId > 0); } void ContactList::sFillList() { MetaSQLQuery mql("SELECT cntct.*, crmacct_name " " FROM cntct()" " LEFT OUTER JOIN crmacct ON (cntct_crmacct_id = crmacct_id)" " WHERE cntct_active" "" " AND (cntct_crmacct_id=)" "" " ORDER BY cntct_last_name, cntct_first_name;"); ParameterList params; if (_searchAcct->isChecked()) params.append("crmacctid", _searchAcctId); XSqlQuery query = mql.toQuery(params); if (ErrorReporter::error(QtCriticalMsg, this, tr("List Error"), query, __FILE__, __LINE__)) return; if (query.size() < 1) // no rows found with limit so try without { ParameterList noparams; mql.toQuery(noparams); if (ErrorReporter::error(QtCriticalMsg, this, tr("List Error"), query, __FILE__, __LINE__)) return; } _listTab->populate(query); } /* do this differently than VirtualList::sSearch(QString&): look for characters that match the beginning of first or last name, not just the first field */ void ContactList::sSearch(const QString& pTarget) { XTreeWidgetItem *target = 0; for (int i = 0; i < _listTab->topLevelItemCount(); i++) { target = _listTab->topLevelItem(i); if (target == NULL || target->text(0).startsWith(pTarget.toUpper(), Qt::CaseInsensitive) || target->text(1).startsWith(pTarget.toUpper(), Qt::CaseInsensitive) || target->text(2).startsWith(pTarget.toUpper(), Qt::CaseInsensitive) || target->text(3).startsWith(pTarget.toUpper(), Qt::CaseInsensitive)) break; } if (target) { _listTab->setCurrentItem(target); _listTab->scrollToItem(target); } } /////////////////////////////////////////////////////////////////////////// ContactSearch::ContactSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose); setWindowTitle(tr("Contacts")); // remove the stuff we won't use disconnect(_searchNumber, SIGNAL(toggled(bool)), this, SLOT(sFillList())); disconnect(_searchName, SIGNAL(toggled(bool)), this, SLOT(sFillList())); disconnect(_searchDescrip, SIGNAL(toggled(bool)), this, SLOT(sFillList())); selectorsLyt->removeWidget(_searchNumber); selectorsLyt->removeWidget(_searchName); selectorsLyt->removeWidget(_searchNumber); delete _searchNumber; delete _searchName; delete _searchDescrip; _searchNumber = _searchName = _searchDescrip = 0; _listTab->setColumnCount(0); _searchFirst = new XCheckBox(tr("Search First Name"),this); _searchLast = new XCheckBox(tr("Search Last Name"),this); _searchCRMAcct = new XCheckBox(tr("Search CRM Account"),this); _searchTitle = new XCheckBox(tr("Search Title"),this); _searchPhones = new XCheckBox(tr("Search Phone Numbers"),this); _searchEmail = new XCheckBox(tr("Search Email Address"),this); _searchWebAddr = new XCheckBox(tr("Search Web Address"),this); _searchInactive = new XCheckBox(tr("Show Inactive Contacts"),this); _searchFirst->setObjectName("_searchName"); _searchLast->setObjectName("_searchLast"); _searchCRMAcct->setObjectName("_searchCRMAcct"); _searchTitle->setObjectName("_searchTitle"); _searchPhones->setObjectName("_searchPhones"); _searchEmail->setObjectName("_searchEmail"); _searchWebAddr->setObjectName("_searchWebAddr"); _searchInactive->setObjectName("_searchInactive"); selectorsLyt->addWidget(_searchFirst, 0, 0); selectorsLyt->addWidget(_searchLast, 1, 0); selectorsLyt->addWidget(_searchCRMAcct, 2, 0); selectorsLyt->addWidget(_searchTitle, 3, 0); selectorsLyt->addWidget(_searchPhones, 0, 1); selectorsLyt->addWidget(_searchEmail, 1, 1); selectorsLyt->addWidget(_searchWebAddr, 2, 1); selectorsLyt->addWidget(_searchInactive, 3, 1); _searchAcct = new QCheckBox(); _dialogLyt->addWidget(_searchAcct); _searchAcct->hide(); connect(_searchFirst, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchLast, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchCRMAcct, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchTitle, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchPhones, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchEmail, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchWebAddr, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchInactive, SIGNAL(toggled(bool)), this, SLOT(sFillList())); _listTab->addColumn(tr("First Name"), 80, Qt::AlignLeft, true, "cntct_first_name"); _listTab->addColumn(tr("Last Name"), -1, Qt::AlignLeft, true, "cntct_last_name"); _listTab->addColumn(tr("CRM Account"), 100, Qt::AlignLeft, true, "crmacct_name"); _listTab->addColumn(tr("Title"), 100, Qt::AlignLeft, true, "cntct_title"); _listTab->addColumn(tr("Phone"), 75, Qt::AlignLeft, true, "cntct_phone"); _listTab->addColumn(tr("Alt. Phone"), 75, Qt::AlignLeft, true, "cntct_phone2"); _listTab->addColumn(tr("Fax"), 75, Qt::AlignLeft, true, "cntct_fax"); _listTab->addColumn(tr("Email Address"), 100, Qt::AlignLeft, true, "cntct_email"); _listTab->addColumn(tr("Web Address"), 100, Qt::AlignLeft, true, "cntct_webaddr"); setObjectName("contactSearch"); } void ContactSearch::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("searchAcctId", &valid); if (valid) { _searchAcctId = param.toInt(); if (_searchAcctId > 0) { XSqlQuery crmacct; crmacct.prepare("SELECT crmacct_number || ' - ' || crmacct_name AS account " "FROM crmacct " "WHERE (crmacct_id = :crmacct_id);"); crmacct.bindValue(":crmacct_id", _searchAcctId); crmacct.exec(); if (crmacct.first()) { _searchAcct->setChecked(true); _searchAcct->setText(tr("Only contacts for %1").arg(crmacct.value("account").toString())); connect(_searchAcct, SIGNAL(toggled(bool)), this, SLOT(sFillList())); } } } _searchAcct->setVisible(_searchAcctId > 0); } void ContactSearch::sFillList() { if (_search->text().isEmpty() || (!_searchFirst->isChecked() && !_searchLast->isChecked() && !_searchCRMAcct->isChecked() && !_searchTitle->isChecked() && !_searchPhones->isChecked() && !_searchEmail->isChecked() && !_searchWebAddr->isChecked() )) return; MetaSQLQuery mql("SELECT cntct.*, crmacct_name" " FROM cntct()" " LEFT OUTER JOIN crmacct ON (cntct_crmacct_id = crmacct_id)" " WHERE TRUE" "" " AND (cntct_crmacct_id=)" "" " " " AND cntct_active " "" " " " AND (" " " " COALESCE(TRIM(cntct_first_name),'') || ' ' " " " " E'\n' " " " " " " || COALESCE(TRIM(cntct_last_name),'') || E'\n' " " " " " " || COALESCE(crmacct_name,'') || E'\n' " " " " " " || COALESCE(cntct_title,'') || E'\n' " " " " " " || COALESCE(cntct_phone,'') || E'\n' " " || COALESCE(cntct_phone2,'') || E'\n' " " || COALESCE(cntct_fax,'') || E'\n' " " " " " " || COALESCE(cntct_email,'') || E'\n' " " " " " " || COALESCE(cntct_webaddr,'') || E'\n' " " " " ~* ) " "" "ORDER BY cntct_last_name, cntct_first_name, crmacct_number;"); ParameterList params; if (_searchAcct->isChecked()) params.append("crmacctid", _searchAcctId); if (_searchFirst->isChecked()) params.append("searchFirst"); if (_searchLast->isChecked()) params.append("searchLast"); if (_searchCRMAcct->isChecked()) params.append("searchCRMAcct"); if (_searchTitle->isChecked()) params.append("searchTitle"); if (_searchPhones->isChecked()) params.append("searchPhones"); if (_searchEmail->isChecked()) params.append("searchEmail"); if (_searchWebAddr->isChecked()) params.append("searchWebAddr"); if (_searchInactive->isChecked()) params.append("searchInactive"); params.append("searchText", _search->text()); XSqlQuery query = mql.toQuery(params); _listTab->populate(query); ErrorReporter::error(QtCriticalMsg, this, tr("Search Error"), query, __FILE__, __LINE__); } void ContactWidget::setMode(Mode p) { if (p == _mode) return; bool enabled = (p == Edit); QList widgets = findChildren(); for (int i = 0; i < widgets.size(); i++) widgets.at(i)->setEnabled(enabled); if (p == Select) _list->setEnabled(true); } void ContactWidget::setEmailSubjectText(const QString text) { _subjText = text; } void ContactWidget::setEmailBodyText(const QString text) { _bodyText = text; } void ContactWidget::fillEmail() { XSqlQuery qry; qry.prepare("SELECT cntcteml_id AS id, cntcteml_email AS email " "FROM cntcteml " "WHERE (cntcteml_cntct_id=:cntct_id) " "ORDER BY email, id;"); qry.bindValue(":cntct_id", _id); qry.exec(); QString curremail = _email->currentText(); if(qry.first()) { _email->populate(qry); } if (curremail.isEmpty()) curremail = _emailCache; if (! curremail.isEmpty()) { qDebug() << "using" << curremail; if (_email->findText(curremail) >= 0) _email->setText(curremail); else _email->append(FAKEEMAILID, curremail); } } void ContactWidget::sEditEmailList() { int emailId = _email->id(); ParameterList params; params.append("cntct_id", _id); contactEmail newdlg(this, "", TRUE); newdlg.set(params); int selected = newdlg.exec(); fillEmail(); if (selected) _email->setId(selected); else _email->setId(emailId); } bool ContactWidget::eventFilter(QObject *obj, QEvent *event) { if (obj != _email->lineEdit()) return QObject::eventFilter(obj, event); switch (event->type()) { case QEvent::MouseButtonDblClick: {; sLaunchEmail(); return true; } default: break; } return QObject::eventFilter(obj, event); } qt-client-4.1.0/widgets/contactcluster.h000066400000000000000000000100651217451700100202700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _contactCluster_h #define _contactCluster_h #include "crmcluster.h" #include "addresscluster.h" #include "xurllabel.h" #include "contactwidget.h" class XTUPLEWIDGETS_EXPORT ContactClusterLineEdit : public CrmClusterLineEdit { Q_OBJECT friend class ContactCluster; public: ContactClusterLineEdit(QWidget*, const char* = 0); Q_INVOKABLE int searchAcctId() { return _searchAcctId; } public slots: void setNewAddr(QString line1, QString line2, QString line3, QString city, QString state, QString postalcode, QString country); void setSearchAcct(int crmAcctId); void sList(); void sNew(); void sSearch(); protected slots: ContactList* listFactory(); ContactSearch* searchFactory(); private: QStringList _newAddr; int _searchAcctId; }; class XTUPLEWIDGETS_EXPORT ContactCluster : public VirtualCluster { Q_OBJECT Q_PROPERTY(bool minimalLayout READ minimalLayout WRITE setMinimalLayout); public: ContactCluster(QWidget*, const char* = 0); Q_INVOKABLE int searchAcctId() { return _searchAcctId; } Q_INVOKABLE int crmAcctId() { return _crmAcctId; } Q_INVOKABLE bool minimalLayout() { return _minLayout; } Q_INVOKABLE void setHonorific(const QString honorifc); Q_INVOKABLE void setFirst(const QString first); Q_INVOKABLE void setMiddle(const QString middle); Q_INVOKABLE void setLast(const QString last); Q_INVOKABLE void setSuffix(const QString suffix); Q_INVOKABLE void setPhone(const QString phone); Q_INVOKABLE void setTitle(const QString title); Q_INVOKABLE void setFax(const QString fax); Q_INVOKABLE void setEmailAddress(const QString email); Q_INVOKABLE void setEmailSubjectText(const QString text); Q_INVOKABLE void setEmailBodyText(const QString text); Q_INVOKABLE QString name() const; Q_INVOKABLE QString honorific() const { return _fname->at(0); } Q_INVOKABLE QString first() const { return _fname->at(1); } Q_INVOKABLE QString middle() const { return _fname->at(2); } Q_INVOKABLE QString last() const { return _fname->at(3); } Q_INVOKABLE QString suffix() const { return _fname->at(4); } Q_INVOKABLE QString title() const { return _description->text(); } Q_INVOKABLE QString phone() const { return _phone->text(); } Q_INVOKABLE QString fax() const { return _fax->text(); } Q_INVOKABLE QString emailAddress() const { return _email->text(); } public slots: void launchEmail(QString url); void openUrl(QString url); void setDescriptionVisible(const bool p); void setMinimalLayout(bool); void setNameVisible(const bool) { } void setNewAddr(QString line1, QString line2, QString line3, QString city, QString state, QString postalcode, QString country); void setSearchAcct(int crmAcctId); private slots: void populate(); signals: void changed(); protected: void addNumberWidget(ContactClusterLineEdit* pNumberWidget); void setName(int segment, const QString name); private: bool _minLayout; int _crmAcctId; int _searchAcctId; QVBoxLayout* _addrLayout; QLabel* _titleLit; QLabel* _phoneLit; QLabel* _phone; QLabel* _phone2Lit; QLabel* _phone2; QLabel* _faxLit; QLabel* _fax; QLabel* _emailLit; QLabel* _webaddrLit; QLabel* _addr; QStringList* _fname; XURLLabel* _email; XURLLabel* _webaddr; QString _subjText; QString _bodyText; }; #endif qt-client-4.1.0/widgets/contactemail.cpp000066400000000000000000000137711217451700100202400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "contactemail.h" /* * This screen will receive the contact id from the calling screen and * populate alternate email addresses from the contact. Users can add * or delete alternate email addresses. */ contactEmail::contactEmail(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, fl) { setupUi(this); setObjectName(name ? name : "contactEmail"); setModal(modal); _new = _buttonBox->addButton(tr("New"), QDialogButtonBox::ActionRole); _new->setObjectName("_new"); _new->setShortcut(QKeySequence::New); _delete = _buttonBox->addButton(tr("Delete"), QDialogButtonBox::ActionRole); _delete->setObjectName("_delete"); _delete->setEnabled(false); _list->addColumn("Hidden", -1, Qt::AlignLeading, true, "cntcteml_email"); _list->setHeaderHidden(true); _list->setAlternatingRowColors(false); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(accept())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_delete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_list, SIGNAL(valid(bool)), this, SLOT(sHandleButtons(bool))); connect(_new, SIGNAL(clicked()), this, SLOT(sAdd())); connect(_list, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(sCloseEdit(QTreeWidgetItem*, QTreeWidgetItem*))); connect(_list, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(sOpenEdit(QTreeWidgetItem*))); _buttonBox->setFocus(); } /* * Destroys the object and frees any allocated resources */ contactEmail::~contactEmail() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void contactEmail::languageChange() { retranslateUi(this); } void contactEmail::accept() { XTreeWidgetItem* item; // Update the database XSqlQuery ins; ins.prepare("INSERT INTO cntcteml ( " " cntcteml_cntct_id, cntcteml_email) " "VALUES (" " :cntct_id, :email) " "RETURNING cntcteml_id;"); XSqlQuery upd; upd.prepare("UPDATE cntcteml SET " " cntcteml_email=:email " "WHERE (cntcteml_id=:cntcteml_id);"); XSqlQuery del; del.prepare("DELETE FROM cntcteml " "WHERE (cntcteml_id=:cntcteml_id);"); for (int i = 0; i < _list->topLevelItemCount(); i++) { item = _list->topLevelItem(i); // Inserted if (!item->id()) { if (item->data(0,Qt::DisplayRole).toString().isEmpty()) continue; ins.bindValue(":cntct_id", _cntctid); ins.bindValue(":email", item->data(0, Qt::DisplayRole)); ins.exec(); if(ins.first()) item->setId(ins.value("cntcteml_id").toInt()); else if (ins.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), ins.lastError().databaseText()); } // Deleted else if (item->data(0, Xt::DeletedRole).toBool()) { del.bindValue(":cntcteml_id", item->id()); del.exec(); if (del.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), del.lastError().databaseText()); } // Updated else { upd.bindValue(":email", item->data(0, Qt::DisplayRole)); upd.bindValue(":cntcteml_id", item->id()); upd.exec(); if (upd.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), upd.lastError().databaseText()); } } if (_list->id() > 0) done(_list->id()); else reject(); } void contactEmail::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("cntct_id", &valid); if (valid) { _cntctid = param.toInt(); sFillList(); } } void contactEmail::sFillList() { XSqlQuery qry; qry.prepare("SELECT cntcteml_id, cntcteml_email " "FROM cntcteml " "WHERE (cntcteml_cntct_id=:cntct_id);"); qry.bindValue(":cntct_id", _cntctid); qry.exec(); _list->populate(qry); } void contactEmail::sAdd() { XTreeWidgetItem* item = new XTreeWidgetItem(_list, 0, 0, ""); sOpenEdit(item); } void contactEmail::sDelete() { XTreeWidgetItem* item = _list->currentItem(); item->setData(0, Xt::DeletedRole, true); QFont font = item->font(0); font.setStrikeOut(true); item->setFont(0, font); item->setTextColor(Qt::gray); _delete->setEnabled(false); } void contactEmail::sOpenEdit(QTreeWidgetItem *item) { XTreeWidgetItem* xitem = (XTreeWidgetItem*)item; if (xitem) { _list->openPersistentEditor(xitem,0); _list->editItem(xitem,0); _delete->setEnabled(false); } } void contactEmail::sCloseEdit(QTreeWidgetItem* /*current*/, QTreeWidgetItem* previous) { XTreeWidgetItem* xitem = (XTreeWidgetItem*)previous; if (xitem) { _list->closePersistentEditor(xitem,0); QString email = xitem->data(0, Qt::DisplayRole).toString().toLower(); xitem->setData(0, Qt::EditRole, email); } } void contactEmail::sHandleButtons(bool valid) { if (_list->currentItem()) { bool deleted = _list->currentItem()->data(0, Xt::DeletedRole).toBool(); _delete->setEnabled(valid && !deleted); } } qt-client-4.1.0/widgets/contactemail.h000066400000000000000000000022711217451700100176760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CONTACTEMAIL_H #define CONTACTEMAIL_H #include #include "documents.h" #include "ui_contactemail.h" class contactEmail : public QDialog, public Ui::contactEmail { Q_OBJECT public: contactEmail(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~contactEmail(); QPushButton* _new; QPushButton* _delete; public slots: void accept(); void set( const ParameterList & pParams ); void sAdd(); void sDelete(); void sFillList(); void sOpenEdit(QTreeWidgetItem *item); void sCloseEdit(QTreeWidgetItem *, QTreeWidgetItem*); void sHandleButtons(bool); protected slots: virtual void languageChange(); private: int _cntctid; }; #endif // CONTACTEMAIL_H qt-client-4.1.0/widgets/contactemail.ui000066400000000000000000000020511217451700100200600ustar00rootroot00000000000000 contactEmail 0 0 369 216 Contact Email Addresses Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Ok XTreeWidget QTreeWidget

    xtreewidget.h
    1 qt-client-4.1.0/widgets/contactwidget.h000066400000000000000000000454361217451700100201040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef contactWidget_h #define contactWidget_h #include "widgets.h" #include "virtualCluster.h" #include "xcombobox.h" #include "addresscluster.h" #include "crmacctcluster.h" #include "usernamecluster.h" #include "xcheckbox.h" #include #include #include #include #include #include #include #include class QGridLayout; class ContactWidget; class XTUPLEWIDGETS_EXPORT ContactList : public VirtualList { Q_OBJECT friend class ContactWidget; friend class ContactInfo; friend class ContactSearch; public: ContactList(QWidget*, const char* = 0, bool = false, Qt::WFlags = 0); virtual void set(const ParameterList & pParams); public slots: virtual void sFillList(); virtual void sSearch(const QString&); protected: QCheckBox* _searchAcct; private: int _id; int _searchAcctId; }; class XTUPLEWIDGETS_EXPORT ContactSearch : public VirtualSearch { Q_OBJECT friend class ContactWidget; public: ContactSearch(QWidget*, Qt::WindowFlags = 0); virtual void set(const ParameterList & pParams); public slots: virtual void sFillList(); protected: XCheckBox* _searchFirst; XCheckBox* _searchLast; XCheckBox* _searchTitle; XCheckBox* _searchCRMAcct; XCheckBox* _searchPhones; XCheckBox* _searchEmail; XCheckBox* _searchWebAddr; XCheckBox* _searchInactive; QCheckBox* _searchAcct; private: int _searchAcctId; QString _query; }; class XTUPLEWIDGETS_EXPORT ContactWidget : public VirtualCluster { Q_OBJECT Q_ENUMS (Mode); Q_PROPERTY(bool accountVisible READ accountVisible WRITE setAccountVisible); Q_PROPERTY(bool ownerVisible READ ownerVisible WRITE setOwnerVisible); Q_PROPERTY(bool ownerEnabled READ ownerEnabled WRITE setOwnerEnabled); Q_PROPERTY(bool activeVisible READ activeVisible WRITE setActiveVisible); Q_PROPERTY(bool addressVisible READ addressVisible WRITE setAddressVisible); Q_PROPERTY(bool emailVisible READ emailVisible WRITE setEmailVisible); Q_PROPERTY(bool initialsVisible READ initialsVisible WRITE setInitialsVisible); Q_PROPERTY(bool minimalLayout READ minimalLayout WRITE setMinimalLayout); Q_PROPERTY(bool phonesVisible READ phonesVisible WRITE setPhonesVisible); Q_PROPERTY(bool webaddrVisible READ webaddrVisible WRITE setWebaddrVisible); Q_PROPERTY(QString fieldNameChange READ fieldNameChange WRITE setFieldNameChange); Q_PROPERTY(QString fieldNameNumber READ fieldNameNumber WRITE setFieldNameNumber); Q_PROPERTY(QString fieldNameActive READ fieldNameActive WRITE setFieldNameActive); Q_PROPERTY(QString fieldNameCrmAccount READ fieldNameCrmAccount WRITE setFieldNameCrmAccount); Q_PROPERTY(QString fieldNameHonorific READ fieldNameHonorific WRITE setFieldNameHonorific); Q_PROPERTY(QString fieldNameFirst READ fieldNameFirst WRITE setFieldNameFirst); Q_PROPERTY(QString fieldNameMiddle READ fieldNameMiddle WRITE setFieldNameMiddle); Q_PROPERTY(QString fieldNameLast READ fieldNameLast WRITE setFieldNameLast); Q_PROPERTY(QString fieldNameSuffix READ fieldNameSuffix WRITE setFieldNameSuffix); Q_PROPERTY(QString fieldNameInitials READ fieldNameInitials WRITE setFieldNameInitials); Q_PROPERTY(QString fieldNameTitle READ fieldNameTitle WRITE setFieldNameTitle); Q_PROPERTY(QString fieldNamePhone READ fieldNamePhone WRITE setFieldNamePhone); Q_PROPERTY(QString fieldNamePhone2 READ fieldNamePhone2 WRITE setFieldNamePhone2); Q_PROPERTY(QString fieldNameFax READ fieldNameFax WRITE setFieldNameFax); Q_PROPERTY(QString fieldNameEmailAddress READ fieldNameEmailAddress WRITE setFieldNameEmailAddress); Q_PROPERTY(QString fieldNameWebAddress READ fieldNameWebAddress WRITE setFieldNameWebAddress); Q_PROPERTY(QString fieldNameAddressChange READ fieldNameAddrChange WRITE setFieldNameAddrChange); Q_PROPERTY(QString fieldNameAddressNumber READ fieldNameAddrNumber WRITE setFieldNameAddrNumber); Q_PROPERTY(QString fieldNameLine1 READ fieldNameLine1 WRITE setFieldNameLine1); Q_PROPERTY(QString fieldNameLine2 READ fieldNameLine2 WRITE setFieldNameLine2); Q_PROPERTY(QString fieldNameLine3 READ fieldNameLine3 WRITE setFieldNameLine3); Q_PROPERTY(QString fieldNameCity READ fieldNameCity WRITE setFieldNameCity); Q_PROPERTY(QString fieldNameState READ fieldNameState WRITE setFieldNameState); Q_PROPERTY(QString fieldNamePostalCode READ fieldNamePostalCode WRITE setFieldNamePostalCode); Q_PROPERTY(QString fieldNameCountry READ fieldNameCountry WRITE setFieldNameCountry); Q_PROPERTY(Mode mode READ mode WRITE setMode); Q_PROPERTY(QString number READ number WRITE setNumber DESIGNABLE false); Q_PROPERTY(QString defaultText READ defaultText DESIGNABLE false); friend class ContactInfo; friend class ContactList; friend class ContactSearch; public: // AccountLimits may be ORed together enum AccountLimits { Employee = 1, Customer = 2, Vendor = 4, Partner = 8, Prospect = 16, Competitor = 32}; enum Mode { Edit, View, Select }; ContactWidget(QWidget*, const char* = 0); inline virtual AddressCluster* addressWidget() const { return _address; } inline virtual bool ownerVisible() const { return _owner->isVisible(); } inline virtual bool ownerEnabled() const { return _owner->isEnabled(); } inline virtual bool numberVisible() const { return _number->isVisible(); } inline virtual bool activeVisible() const { return _active->isVisible(); } inline virtual bool accountVisible() const { return _crmAcct->isVisible(); } inline virtual bool addressVisible() const { return _address->isVisible(); } inline virtual int addressId() const { return _address->id(); } inline virtual QString change() const { return _change->text(); } inline virtual int crmAcctId() const { return _crmAcct->id(); } inline virtual int ownerId() const { return _owner->id(); } inline virtual QString description() const { return ""; } inline virtual bool emailVisible() const { return _email->isVisible(); } inline virtual QString defaultText() const { return QString(); } inline virtual bool initialsVisible()const { return _initials->isVisible(); } inline virtual bool isValid() const { return _valid; } inline virtual QString label() const { return _label->text(); } inline virtual bool minimalLayout() const { return _minimalLayout; } Q_INVOKABLE virtual Mode mode() const { return _mode; } inline virtual QString notes() const { return _notes; } inline virtual bool phonesVisible() const { return _phone->isVisible(); } inline virtual int searchAcct() const { return _searchAcctId; } inline virtual bool webaddrVisible() const { return _webaddr->isVisible(); } Q_INVOKABLE virtual bool active() const { return _active->isChecked(); } Q_INVOKABLE virtual int id() const { return _id; } Q_INVOKABLE virtual QString emailAddress() const { return _email->currentText(); } Q_INVOKABLE virtual QString fax() const { return _fax->text(); } Q_INVOKABLE virtual QString first() const { return _first->text(); } Q_INVOKABLE virtual QString honorific() const { return _honorific->currentText(); } Q_INVOKABLE virtual QString initials() const { return _initials->text(); } Q_INVOKABLE virtual QString last() const { return _last->text(); } Q_INVOKABLE virtual QString name() const; Q_INVOKABLE virtual QString number() const { return _number->text(); } Q_INVOKABLE virtual QString ownerUsername() const { return _owner->username(); } Q_INVOKABLE virtual QString phone() const { return _phone->text(); } Q_INVOKABLE virtual QString phone2() const { return _phone2->text(); } Q_INVOKABLE virtual QString title() const { return _title->text(); } Q_INVOKABLE virtual QString webAddress() const { return _webaddr->text(); } Q_INVOKABLE virtual QString suffix() const { return _suffix->text(); } Q_INVOKABLE virtual QString middle() const { return _middle->text(); } Q_INVOKABLE virtual QString address1() const { return _address->line1(); } Q_INVOKABLE virtual QString address2() const { return _address->line2(); } Q_INVOKABLE virtual QString address3() const { return _address->line3(); } Q_INVOKABLE virtual QString city() const { return _address->city(); } Q_INVOKABLE virtual QString postalCode() const { return _address->postalCode(); } Q_INVOKABLE virtual QString state() const { return _address->state(); } Q_INVOKABLE virtual QString country() const { return _address->country(); } Q_INVOKABLE virtual QString owner() const { return _owner->username(); } //Return Data Mapping values virtual QString fieldNameChange() const { return _fieldNameChange; } virtual QString fieldNameNumber() const { return _fieldNameNumber; } virtual QString fieldNameActive() const { return _fieldNameActive; } virtual QString fieldNameCrmAccount() const { return _fieldNameCrmAccount; } virtual QString fieldNameHonorific() const { return _fieldNameHonorific; } virtual QString fieldNameFirst() const { return _fieldNameFirst; } virtual QString fieldNameMiddle() const { return _fieldNameMiddle; } virtual QString fieldNameLast() const { return _fieldNameLast; } virtual QString fieldNameSuffix() const { return _fieldNameSuffix; } virtual QString fieldNameInitials() const { return _fieldNameInitials; } virtual QString fieldNameTitle() const { return _fieldNameTitle; } virtual QString fieldNamePhone() const { return _fieldNamePhone; } virtual QString fieldNamePhone2() const { return _fieldNamePhone2; } virtual QString fieldNameFax() const { return _fieldNameFax; } virtual QString fieldNameEmailAddress() const { return _fieldNameEmailAddress; } virtual QString fieldNameWebAddress() const { return _fieldNameWebAddress; } virtual QString fieldNameAddrChange() const { return _fieldNameAddrChange; } virtual QString fieldNameAddrNumber() const { return _fieldNameAddrNumber; } virtual QString fieldNameLine1() const { return _fieldNameLine1; } virtual QString fieldNameLine2() const { return _fieldNameLine2; } virtual QString fieldNameLine3() const { return _fieldNameLine3; } virtual QString fieldNameCity() const { return _fieldNameCity; } virtual QString fieldNameState() const { return _fieldNameState; } virtual QString fieldNamePostalCode() const { return _fieldNamePostalCode; } virtual QString fieldNameCountry() const { return _fieldNameCountry; } public slots: virtual void setListVisible(bool p); virtual void setNumber(QString p); inline virtual void clearExtraClause() { } virtual void findDuplicates(); inline virtual void setExtraClause(const QString&) { } inline virtual void setAddress(const int p) { _address->setId(p); } inline virtual void setActive(const bool p) { _active->setChecked(p); } virtual void setChange(QString p); inline virtual void setCrmAcctId(const int p) { _crmAcct->setId(p); } inline virtual void setDescription(const QString&) { } inline virtual void setEmailAddress(const QString& p) { _email->setText(p); } inline virtual void setFax(const QString& p) { _fax->setText(p); } inline virtual void setFirst(const QString& p) { _first->setText(p); } inline virtual void setHonorific(const QString& p) { _honorific->setEditText(p); } inline virtual void setLabel(const QString& p) { _label->setText(p); _label->setHidden(_label->text().isEmpty()); } inline virtual void setLast(const QString& p) { _last->setText(p); } inline virtual void setMiddle(const QString& p) { _middle->setText(p); } virtual void setMode(const Mode p); inline virtual void setNotes(const QString& p) { _notes = p; } inline virtual void setPhone(const QString& p) { _phone->setText(p); } inline virtual void setPhone2(const QString& p) { _phone2->setText(p); } inline virtual void setSuffix(const QString& p) { _suffix->setText(p); } inline virtual void setTitle(const QString& p) { _title->setText(p); } inline virtual void setWebAddress(const QString& p) { _webaddr->setText(p); } inline virtual void setOwnerUsername(const QString& p){ _owner->setUsername(p); } inline virtual void setOwnerId(const int p) { _owner->setId(p); } Q_INVOKABLE void setEmailSubjectText(const QString text); Q_INVOKABLE void setEmailBodyText(const QString text); virtual void clear(); virtual void check(); virtual bool sChanged() { return _changed; } virtual void sEllipses(); virtual void sInfo(); virtual void sList(); virtual void sLaunchEmail(); virtual void sLaunchWebaddr(); virtual void sSearch(); virtual int save(AddressCluster::SaveFlags = AddressCluster::CHECK); virtual void setAccount(const int); virtual void setOwnerVisible(const bool); virtual void setOwnerEnabled(const bool); virtual void setNumberVisible(const bool); virtual void setAccountVisible(const bool); virtual void setActiveVisible(const bool); virtual void setAddressVisible(const bool); virtual void setEmailVisible(const bool); virtual void setId(const int); virtual void setInitialsVisible(const bool); virtual void setMinimalLayout(const bool); virtual void setName(const QString& p); virtual void setPhonesVisible(const bool); virtual void setSearchAcct(const int); virtual void setWebaddrVisible(const bool); //Set Data Mapping virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setFieldNameChange(QString p) { _fieldNameChange = p ; } virtual void setFieldNameNumber(QString p) { _fieldNameNumber = p ; } virtual void setFieldNameActive(QString p) { _fieldNameActive = p ; } virtual void setFieldNameCrmAccount(QString p) { _fieldNameCrmAccount = p ; } virtual void setFieldNameHonorific(QString p) { _fieldNameHonorific = p ; } virtual void setFieldNameFirst(QString p) { _fieldNameFirst = p ; } virtual void setFieldNameMiddle(QString p) { _fieldNameMiddle = p ; } virtual void setFieldNameLast(QString p) { _fieldNameLast = p ; } virtual void setFieldNameSuffix(QString p) { _fieldNameSuffix = p ; } virtual void setFieldNameInitials(QString p) { _fieldNameInitials = p ; } virtual void setFieldNameTitle(QString p) { _fieldNameTitle = p ; } virtual void setFieldNamePhone(QString p) { _fieldNamePhone = p ; } virtual void setFieldNamePhone2(QString p) { _fieldNamePhone2 = p ; } virtual void setFieldNameFax(QString p) { _fieldNameFax = p ; } virtual void setFieldNameEmailAddress(QString p) { _fieldNameEmailAddress = p ; } virtual void setFieldNameWebAddress(QString p) { _fieldNameWebAddress = p ; } virtual void setFieldNameAddrChange(QString p) { _fieldNameAddrChange = p ; } virtual void setFieldNameAddrNumber(QString p) { _fieldNameAddrNumber = p ; } virtual void setFieldNameLine1(QString p) { _fieldNameLine1 = p ; } virtual void setFieldNameLine2(QString p) { _fieldNameLine2 = p ; } virtual void setFieldNameLine3(QString p) { _fieldNameLine3 = p ; } virtual void setFieldNameCity(QString p) { _fieldNameCity = p ; } virtual void setFieldNamePostalCode(QString p) { _fieldNamePostalCode = p ; } virtual void setFieldNameState(QString p) { _fieldNameState = p ; } virtual void setFieldNameCountry(QString p) { _fieldNameCountry = p ; } private slots: void sCheck(); void sEditEmailList(); void setChanged(); signals: void changed(); void newId(int); protected: QHBoxLayout* _nameBox; QHBoxLayout* _initialsBox; QHBoxLayout* _titleBox; QGridLayout* _buttonBox; QVBoxLayout* _ownerBox; XLineEdit* _change; XLineEdit* _number; XComboBox* _honorific; Mode _mode; QLabel* _numberLit; QLabel* _nameLit; XLineEdit* _first; XLineEdit* _middle; XLineEdit* _last; XLineEdit* _suffix; QLabel* _initialsLit; XLineEdit* _initials; QLabel* _crmAcctLit; CRMAcctCluster* _crmAcct; QLabel* _titleLit; XLineEdit* _title; QLabel* _phoneLit; XLineEdit* _phone; QLabel* _phone2Lit; XLineEdit* _phone2; QLabel* _faxLit; XLineEdit* _fax; QLabel* _emailLit; XComboBox* _email; QLabel* _webaddrLit; XLineEdit* _webaddr; QCheckBox* _active; QString _addressChange; AddressCluster* _address; UsernameCluster* _owner; QString _extraClause; QString _query; int _searchAcctId; QString _titleSingular; QString _titlePlural; bool _ignoreSignals; int _crmacctid; QString _crmacctname; bool eventFilter(QObject *obj, QEvent* event); private: virtual void init(); virtual void fillEmail(); virtual void layout(); virtual void silentSetId(const int); XDataWidgetMapper* _mapper; QPushButton* _list; int _id; bool _layoutDone; int _limits; bool _minimalLayout; QString _notes; bool _valid; bool _changed; QString _emailCache; //Data Mapping Values QString _fieldNameChange; QString _fieldNameNumber; QString _fieldNameActive; QString _fieldNameCrmAccount; QString _fieldNameHonorific; QString _fieldNameFirst; QString _fieldNameMiddle; QString _fieldNameLast; QString _fieldNameSuffix; QString _fieldNameInitials; QString _fieldNameTitle; QString _fieldNamePhone; QString _fieldNamePhone2; QString _fieldNameFax; QString _fieldNameEmailAddress; QString _fieldNameWebAddress; QString _fieldNameAddrChange; QString _fieldNameAddrNumber; QString _fieldNameLine1; QString _fieldNameLine2; QString _fieldNameLine3; QString _fieldNameCity; QString _fieldNamePostalCode; QString _fieldNameState; QString _fieldNameCountry; QString _subjText; QString _bodyText; }; #endif qt-client-4.1.0/widgets/crmCluster.cpp000066400000000000000000000205441217451700100177140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "crmcluster.h" #include #include #define DEBUG false /* TODO: rewrite VirtualClusterLineEdit and CrmClusterLineEdit classes (and some of their children) to use a map of table column names and output column names. that'll make it easier to add columns to the output (as in contacts and addresses) and reduce the need for special-case handling. it's unclear if sList and sSearch correctly implement privilege enforcement. */ CrmClusterLineEdit::CrmClusterLineEdit(QWidget* pParent, const char* pTabName, const char* pIdColumn, const char* pNumberColumn, const char* pNameColumn, const char* pDescripColumn, const char* pOwnerColumn, const char* pAssignToColumn, const char* pExtra, const char* pName, const char* pActiveColumn) : VirtualClusterLineEdit(pParent, pTabName, pIdColumn, pNumberColumn, pNameColumn, pDescripColumn, pExtra, pName, pActiveColumn), _hasAssignto(false), _hasOwner(false) { setTableAndColumnNames(pTabName, pIdColumn, pNumberColumn, pNameColumn, pDescripColumn, pActiveColumn, pOwnerColumn, pAssignToColumn); } void CrmClusterLineEdit::setTableAndColumnNames(const char* pTabName, const char* pIdColumn, const char* pNumberColumn, const char* pNameColumn, const char* pDescripColumn, const char* pActiveColumn, const char* pOwnerColumn, const char* pAssignToColumn) { // If no owner ignore because this call came from virtualCluster constructor if(!pOwnerColumn) return; _idColName = QString(pIdColumn); _numColName = QString(pNumberColumn); _nameColName = QString(pNameColumn); _descripColName = QString(pDescripColumn); _activeColName = QString(pActiveColumn); _ownerColName = QString(pOwnerColumn); _assigntoColName = QString(pAssignToColumn); _query = QString("SELECT %1 AS id, %2 AS number ") .arg(pIdColumn).arg(pNumberColumn); _hasName = (pNameColumn && QString(pNameColumn).trimmed().length()); if (_hasName) _query += QString(", %1 AS name ").arg(pNameColumn); _hasDescription = (pDescripColumn && QString(pDescripColumn).trimmed().length()); if (_hasDescription) _query += QString(", %1 AS description ").arg(pDescripColumn); _hasOwner = (pOwnerColumn && QString(pOwnerColumn).trimmed().length()); if (_hasOwner) _query += QString(", %1 AS owner ").arg(pOwnerColumn); _hasAssignto = (pAssignToColumn && QString(pAssignToColumn).trimmed().length()); if (_hasAssignto) _query += QString(", %1 AS assignto ").arg(pAssignToColumn); _hasActive = (pActiveColumn && QString(pActiveColumn).trimmed().length()); if (_hasActive) _query += QString(", %1 AS active ").arg(pActiveColumn); _query += QString("FROM %1 WHERE (TRUE) ").arg(pTabName); _idClause = QString(" AND (%1=:id) ").arg(pIdColumn); _numClause = QString(" AND (%1 ~* :number) ").arg(pNumberColumn); if (_hasActive) _activeClause = QString(" AND (%1) ").arg(pActiveColumn); else _activeClause = ""; _extraClause = ""; _model = new QSqlQueryModel(this); } void CrmClusterLineEdit::silentSetId(const int pId) { if (DEBUG) qDebug("VCLE %s::silentSetId(%d)", qPrintable(objectName()), pId); if (pId == -1) { XLineEdit::clear(); _model = new QSqlQueryModel(this); } else { XSqlQuery idQ; idQ.prepare(_query + _idClause + QString(";")); idQ.bindValue(":id", pId); idQ.exec(); if (idQ.first()) { if (_completer) static_cast(_completer->model())->setQuery(QSqlQuery()); _id = pId; _valid = true; _model->setQuery(idQ); setText(idQ.value("number").toString()); if (_hasName) _name = (idQ.value("name").toString()); if (_hasDescription) _description = idQ.value("description").toString(); if (_hasActive) setStrikeOut(!idQ.value("active").toBool()); if (_hasOwner) _owner = idQ.value("owner").toString(); if (_hasAssignto) _assignto = idQ.value("assignto").toString(); } else if (idQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), idQ.lastError().databaseText()); } _parsed = true; sHandleNullStr(); emit parsed(); } void CrmClusterLineEdit::sUpdateMenu() { if (! _x_privileges) return; _listAct->setEnabled(isEnabled()); _searchAct->setEnabled(isEnabled()); _aliasAct->setEnabled(isEnabled()); _infoAct->setEnabled(_id != -1); _openAct->setEnabled((_x_privileges->check(_editPriv) || _x_privileges->check(_viewPriv) || (_x_privileges->check(_editOwnPriv) && (_owner == _x_username || _assignto == _x_username)) || (_x_privileges->check(_viewOwnPriv) && (_owner == _x_username || _assignto == _x_username))) && _id != -1); _newAct->setEnabled((_x_privileges->check(_newPriv) || _x_privileges->check(_editOwnPriv)) && isEnabled()); if (canOpen()) { if (!menu()->actions().contains(_openAct)) menu()->addAction(_openAct); if (!menu()->actions().contains(_newAct) && !_newPriv.isEmpty()) menu()->addAction(_newAct); } else { if (menu()->actions().contains(_openAct)) menu()->removeAction(_openAct); if (menu()->actions().contains(_newAct)) menu()->removeAction(_newAct); } } void CrmClusterLineEdit::sOpen() { ParameterList params; if (_x_privileges->check(_editPriv) || _x_privileges->check(_editOwnPriv) && (_owner == _x_username || _assignto == _x_username)) params.append("mode", "edit"); else params.append("mode", "view"); params.append(_idColName, id()); sOpenWindow(_uiName, params); } void CrmClusterLineEdit::setEditOwnPriv(const QString& priv) { _editOwnPriv = priv; buildExtraClause(); sUpdateMenu(); } void CrmClusterLineEdit::setViewOwnPriv(const QString& priv) { _viewOwnPriv = priv; buildExtraClause(); sUpdateMenu(); } void CrmClusterLineEdit::buildExtraClause() { if ( _x_privileges && !_x_privileges->check(_editPriv) && !_x_privileges->check(_viewPriv) && (_x_privileges->check(_editOwnPriv) || _x_privileges->check(_viewOwnPriv) ) ) { QStringList userCols; if(_hasOwner) userCols.append(_ownerColName); if(_hasAssignto) userCols.append(_assigntoColName); _extraClause = QString("'%1' IN (%2)").arg(_x_username).arg(userCols.join(",")); } } // TODO: fix 9258 then add/subtract from the list of extra clauses void CrmClusterLineEdit::sList() { QString oldextra = extraClause(); setExtraClause(QString(oldextra.isEmpty() ? " " : (oldextra + " AND ")) + QString("hasPrivOnObject('VIEW', '%1', %2)") .arg(_objtype).arg(_idColName)); VirtualClusterLineEdit::sList(); setExtraClause(oldextra); } void CrmClusterLineEdit::sSearch() { QString oldextra = extraClause(); setExtraClause(QString(oldextra.isEmpty() ? " " : (oldextra + " AND ")) + QString("hasPrivOnObject('VIEW', '%1', %2)") .arg(_objtype).arg(_idColName)); VirtualClusterLineEdit::sSearch(); setExtraClause(oldextra); } qt-client-4.1.0/widgets/crmacctCluster.cpp000066400000000000000000000656271217451700100205620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include "crmacctcluster.h" #include "custcluster.h" #include "errorReporter.h" #include "xcombobox.h" /* _listAndSearchQueryString is, as you may have guessed, shared by the CRMAcctList and CRMAcctSearch classes. It's a big 'un and has a couple of tricky parts: - there's potential for a UNION of customers and prospects - the vendor case has an extra column - CRMAcctList can only control activeOnly in the WHERE clause but CRMAcctSearch can control lots of OR'ed search criteria + activeOnly */ static QString _listAndSearchQueryString( "SELECT *, formataddr(addr.addr_id) AS street" " FROM (" "" " SELECT crmacct_id AS id, crmacct_number AS number," " crmacct_name AS name, crmacct_cntct_id_1 AS cntct_id," " crmacct_active AS active, cntct_addr_id AS addr_id" " FROM crmacct()" " LEFT OUTER JOIN cntct ON (crmacct_cntct_id_1=cntct_id)" "" " SELECT cust_id AS id, cust_number AS number," " cust_name AS name, cust_cntct_id AS cntct_id," " cust_active AS active, cntct_addr_id AS addr_id" " FROM custinfo" " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id)" "" " SELECT emp_id AS id, emp_code AS number," " emp_number AS name, emp_cntct_id AS cntct_id," " emp_active AS active, cntct_addr_id AS addr_id" " FROM emp" " LEFT OUTER JOIN cntct ON (emp_cntct_id=cntct_id)" "" " SELECT salesrep_id AS id, salesrep_number AS number," " salesrep_name AS name, NULL AS cntct_id," " salesrep_active AS active, NULL AS addr_id" " FROM salesrep" "" " SELECT taxauth_id AS id, taxauth_code AS number," " taxauth_name AS name, NULL AS cntct_id," " TRUE AS active, taxauth_addr_id AS addr_id" " FROM taxauth" "" " SELECT usr_id AS id, usr_username AS number," " usr_propername AS name, NULL AS cntct_id," " usr_active AS active, NULL AS addr_id" " FROM usr" "" " SELECT vend_id AS id, vend_number AS number," " vend_name AS name, vend_cntct1_id AS cntct_id," " vend_active AS active, cntct_addr_id AS addr_id," " vendtype_code AS type" " FROM vendinfo" " JOIN vendtype ON (vend_vendtype_id=vendtype_id)" " LEFT OUTER JOIN cntct ON (vend_cntct1_id=cntct_id)" "" "" " UNION" " SELECT prospect_id AS id, prospect_number AS number," " prospect_name AS name, prospect_cntct_id AS cntct_id," " prospect_active AS active, cntct_addr_id AS addr_id" " FROM prospect" " LEFT OUTER JOIN cntct ON (prospect_cntct_id=cntct_id)" "" " ) AS crminfo" " LEFT OUTER JOIN cntct ON (crminfo.cntct_id=cntct.cntct_id)" " LEFT OUTER JOIN addr ON (crminfo.addr_id=addr.addr_id)" "" " WHERE " " active AND " " (false " " " " OR (UPPER(number) ~ )" " " " " " OR (UPPER(name) ~ )" " " " " " OR (UPPER(cntct_first_name || ' ' || cntct_last_name) " " ~ )" " " " " " OR (UPPER(cntct_phone || ' ' || cntct_phone2 || ' ' || " " cntct_fax) ~ )" " " " " " OR (cntct_email ~* )" " " " " " OR (UPPER(addr_line1 || ' ' || addr_line2 || ' ' || " " addr_line3) ~ )" " " " " " OR (UPPER(addr_city) ~ )" " " " " " OR (UPPER(addr_state) ~ )" " " " " " OR (UPPER(addr_postalcode) ~ )" " " " " " OR (UPPER(addr_country) ~ )" " " " )" "" " " " WHERE active" " " "" " ORDER BY number;" ); CRMAcctCluster::CRMAcctCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new CRMAcctLineEdit(this, pName)); setNameVisible(true); setSubtype(CRMAcctLineEdit::Crmacct); } void CRMAcctCluster::setSubtype(const CRMAcctLineEdit::CRMAcctSubtype subtype) { // is this calling setSubtype on a class that sets its own type in its // constructor? // TODO: make this do something useful if (_number->inherits("CRMAcctLineEdit")) (qobject_cast(_number))->setSubtype(subtype); } /////////////////////////////////////////////////////////////////////// CRMAcctLineEdit::CRMAcctSubtype CRMAcctCluster::subtype() const { if (_number->inherits("CRMAcctLineEdit")) return (qobject_cast(_number))->subtype(); return CRMAcctLineEdit::Crmacct; } CRMAcctLineEdit::CRMAcctLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "crmacct", "crmacct_id", "crmacct_number", "crmacct_name", 0, "crmacct_owner_username", 0, 0, pName, "crmacct_active") { _objtype = "CRMA"; setTitles(tr("CRM Account"), tr("CRM Accounts")); setUiName("crmaccount"); setEditPriv("MaintainAllCRMAccounts"); setViewPriv("ViewAllCRMAccounts"); setNewPriv("MaintainAllCRMAccounts"); setEditOwnPriv("MaintainPersonalCRMAccounts"); setViewOwnPriv("ViewPersonalCRMAccounts"); setSubtype(Crmacct); } VirtualList* CRMAcctLineEdit::listFactory() { return new CRMAcctList(this); } VirtualSearch* CRMAcctLineEdit::searchFactory() { return new CRMAcctSearch(this); } /////////////////////////////////////////////////////////////////////// void CRMAcctLineEdit::setSubtype(const CRMAcctSubtype subtype) { _subtype = subtype; //TODO: refigure everything about this line edit, including find the id for the current text } CRMAcctLineEdit::CRMAcctSubtype CRMAcctLineEdit::subtype() const { return _subtype; } /////////////////////////////////////////////////////////////////////// CRMAcctList::CRMAcctList(QWidget* pParent, const char* pName, bool, Qt::WFlags pFlags) : VirtualList(pParent, pFlags) { _parent = pParent; _queryParams = 0; if (!pName) setObjectName("CRMAcctList"); _listTab->setColumnCount(0); _listTab->addColumn(tr("Number"), 80, Qt::AlignLeft, true, "number"); _listTab->addColumn(tr("Name"), 75, Qt::AlignLeft, true, "name" ); _listTab->addColumn(tr("First"), 100, Qt::AlignLeft, true, "cntct_first_name"); _listTab->addColumn(tr("Last"), 100, Qt::AlignLeft, true, "cntct_last_name"); _listTab->addColumn(tr("Phone"), 100, Qt::AlignLeft, true, "cntct_phone"); _listTab->addColumn(tr("Email"), 100, Qt::AlignLeft, true, "cntct_email"); _listTab->addColumn(tr("Address"), 100, Qt::AlignLeft|Qt::AlignTop,true,"street"); _listTab->addColumn(tr("City"), 75, Qt::AlignLeft, true, "addr_city"); _listTab->addColumn(tr("State"), 50, Qt::AlignLeft, true, "addr_state"); _listTab->addColumn(tr("Country"), 100, Qt::AlignLeft, true, "addr_country"); _listTab->addColumn(tr("Postal Code"), 75, Qt::AlignLeft, true, "addr_postalcode"); _showInactive = false; // must be before inherits() checks if (_parent->inherits("CRMAcctCluster")) // handles Crmacct, Competitor, Employee, Partner, Prospect, SalesRep, Taxauth setSubtype((qobject_cast(_parent))->subtype()); else if (_parent->inherits("CRMAcctLineEdit")) setSubtype((qobject_cast(_parent))->subtype()); else if (_parent->inherits("CLineEdit") || _parent->inherits("CustCluster") || _parent->inherits("CustInfo")) { CLineEdit::CLineEditTypes type = CLineEdit::AllCustomersAndProspects; if (_parent->inherits("CLineEdit")) type = (qobject_cast(_parent))->type(); else if (_parent->inherits("CustCluster")) type = (qobject_cast(_parent))->type(); // else if (_parent->inherits("CustInfo")) // type = (qobject_cast(_parent))->type(); switch (type) { case CLineEdit::AllCustomers: _showInactive = true; setSubtype(CRMAcctLineEdit::Cust); break; case CLineEdit::ActiveCustomers: _showInactive = false; setSubtype(CRMAcctLineEdit::Cust); break; case CLineEdit::AllProspects: _showInactive = true; setSubtype(CRMAcctLineEdit::Prospect); break; case CLineEdit::ActiveProspects: _showInactive = false; setSubtype(CRMAcctLineEdit::Prospect); break; case CLineEdit::AllCustomersAndProspects: _showInactive = true; setSubtype(CRMAcctLineEdit::CustAndProspect); break; case CLineEdit::ActiveCustomersAndProspects: _showInactive = false; setSubtype(CRMAcctLineEdit::CustAndProspect); break; } } else if (_parent->inherits("VendorLineEdit") || _parent->inherits("VendorCluster")) setSubtype(CRMAcctLineEdit::Vend); else if (_parent->inherits("UsernameCluster")) setSubtype(CRMAcctLineEdit::User); else setSubtype(CRMAcctLineEdit::Crmacct); resize(800, size().height()); } void CRMAcctList::setId(const int id) { _id = id; _listTab->setId(id); } void CRMAcctList::setShowInactive(const bool show) { if (_showInactive != show) { _showInactive = show; sFillList(); } } void CRMAcctList::setSubtype(const CRMAcctLineEdit::CRMAcctSubtype subtype) { _subtype = subtype; if (_queryParams) delete _queryParams; _queryParams = new ParameterList(); bool hasContact = true; bool hasAddress = true; switch (subtype) { case CRMAcctLineEdit::Cust: setWindowTitle(tr("Search For Customer")); _queryParams->append("customer"); break; case CRMAcctLineEdit::Employee: setWindowTitle(tr("Search For Employee")); _queryParams->append("employee"); break; case CRMAcctLineEdit::Prospect: setWindowTitle(tr("Search For Prospect")); _queryParams->append("prospect"); break; case CRMAcctLineEdit::SalesRep: setWindowTitle(tr("Search For Sales Rep")); _queryParams->append("salesrep"); hasContact = false; hasAddress = false; break; case CRMAcctLineEdit::Taxauth: setWindowTitle(tr("Search For Tax Authority")); _queryParams->append("taxauth"); hasContact = false; break; case CRMAcctLineEdit::User: setWindowTitle(tr("Search For User")); _queryParams->append("user"); hasContact = false; hasAddress = false; break; case CRMAcctLineEdit::Vend: setWindowTitle(tr("Search For Vendor")); _queryParams->append("vendor"); _listTab->addColumn("Vend. Type", _itemColumn, Qt::AlignLeft, true, "type"); break; case CRMAcctLineEdit::CustAndProspect: setWindowTitle(tr("Search For Customer or Prospect")); _queryParams->append("customer"); _queryParams->append("prospect"); break; case CRMAcctLineEdit::Crmacct: case CRMAcctLineEdit::Competitor: case CRMAcctLineEdit::Partner: default: setWindowTitle(tr("Search For CRM Account")); _queryParams->append("crmaccount"); break; } _listTab->setColumnHidden(_listTab->column("cntct_first_name"), ! hasContact); _listTab->setColumnHidden(_listTab->column("cntct_last_name"), ! hasContact); _listTab->setColumnHidden(_listTab->column("cntct_phone"), ! hasContact); _listTab->setColumnHidden(_listTab->column("street"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_city"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_state"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_country"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_postalcode"), ! hasAddress); // don't (re)populate the list if the widget isn't visible // this also fixes an issue where the subType is being set // multiple times before it is visible and thus running // multiple queries and processing results for no reason if(isVisible()) sFillList(); } void CRMAcctList::sFillList() { MetaSQLQuery mql(_listAndSearchQueryString); ParameterList params(*_queryParams); if (! _showInactive) params.append("activeOnly"); XSqlQuery fillq = mql.toQuery(params); _listTab->populate(fillq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), fillq, __FILE__, __LINE__)) return; } /////////////////////////////////////////////////////////////////////// CRMAcctSearch::CRMAcctSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { // remove the stuff we won't use disconnect(_searchDescrip, SIGNAL(toggled(bool)), this, SLOT(sFillList())); selectorsLyt->removeWidget(_searchDescrip); delete _searchDescrip; _queryParams = 0; _listTab->setColumnCount(0); _addressLit = new QLabel(tr("Primary Contact Address:"),this); _searchStreet = new XCheckBox(tr("Street Address"), this); _searchCity = new XCheckBox(tr("City"),this); _searchState = new XCheckBox(tr("State"),this); _searchPostalCode = new XCheckBox(tr("Postal Code"),this); _searchCountry = new XCheckBox(tr("Country"),this); _searchContact = new XCheckBox(tr("Contact Name"),this); _searchPhone = new XCheckBox(tr("Contact Phone #"),this); _searchEmail = new XCheckBox(tr("Contact Email "),this); _showInactive = new QCheckBox(tr("Show Inactive"),this); _searchCombo = new XCheckBox(tr("Search Combo"),this); _comboCombo = new XComboBox(this, "_comboCombo"); _addressLit->setObjectName("_addressLit"); _searchStreet->setObjectName("_searchStreet"); _searchCity->setObjectName("_searchCity"); _searchState->setObjectName("_searchState"); _searchPostalCode->setObjectName("_searchPostalCode"); _searchCountry->setObjectName("_searchCountry"); _searchContact->setObjectName("_searchContact"); _searchPhone->setObjectName("_searchPhone"); _searchEmail->setObjectName("_searchEmail"); _showInactive->setObjectName("_showInactive"); _searchCombo->setObjectName("_searchCombo"); selectorsLyt->removeWidget(_searchName); selectorsLyt->removeWidget(_searchNumber); QLabel * lbl = new QLabel(tr("Search through:"), this); lbl->setObjectName("_searchLit"); selectorsLyt->addWidget(lbl, 0, 0); selectorsLyt->addWidget(_searchNumber, 1, 0); selectorsLyt->addWidget(_searchName, 2, 0); selectorsLyt->addWidget(_searchContact, 1, 1); selectorsLyt->addWidget(_searchPhone, 2, 1); selectorsLyt->addWidget(_searchEmail, 3, 1); selectorsLyt->addWidget(_addressLit, 0, 2); selectorsLyt->addWidget(_searchStreet, 1, 2); selectorsLyt->addWidget(_searchCity, 2, 2); selectorsLyt->addWidget(_searchState, 3, 2); selectorsLyt->addWidget(_searchPostalCode, 4, 2); selectorsLyt->addWidget(_searchCombo, 5, 0); selectorsLyt->addWidget(_comboCombo, 5, 1); selectorsLyt->addWidget(_searchCountry, 5, 2); selectorsLyt->addWidget(_showInactive, 5, 3); _listTab->addColumn(tr("Number"), 80, Qt::AlignLeft, true, "number"); _listTab->addColumn(tr("Name"), 75, Qt::AlignLeft, true, "name" ); _listTab->addColumn(tr("First"), 100, Qt::AlignLeft, true, "cntct_first_name"); _listTab->addColumn(tr("Last"), 100, Qt::AlignLeft, true, "cntct_last_name"); _listTab->addColumn(tr("Phone"), 100, Qt::AlignLeft, true, "cntct_phone"); _listTab->addColumn(tr("Email"), 100, Qt::AlignLeft, true, "cntct_email"); _listTab->addColumn(tr("Address"), 100, Qt::AlignLeft|Qt::AlignTop,true,"street"); _listTab->addColumn(tr("City"), 75, Qt::AlignLeft, true, "addr_city"); _listTab->addColumn(tr("State"), 50, Qt::AlignLeft, true, "addr_state"); _listTab->addColumn(tr("Country"), 100, Qt::AlignLeft, true, "addr_country"); _listTab->addColumn(tr("Postal Code"), 75, Qt::AlignLeft, true, "addr_postalcode"); setTabOrder(_search, _searchNumber); setTabOrder(_searchNumber, _searchName); setTabOrder(_searchName, _searchContact); setTabOrder(_searchContact, _searchPhone); setTabOrder(_searchPhone, _searchEmail); setTabOrder(_searchEmail, _searchStreet); setTabOrder(_searchStreet, _searchCity); setTabOrder(_searchCity, _searchState); setTabOrder(_searchState, _searchPostalCode); setTabOrder(_searchPostalCode,_searchCountry); setTabOrder(_searchCountry, _searchCombo); setTabOrder(_searchCombo, _comboCombo); setTabOrder(_comboCombo, _showInactive); setTabOrder(_showInactive, _listTab); setTabOrder(_listTab, _buttonBox); setTabOrder(_buttonBox, _search); resize(800, size().height()); _parent = pParent; setObjectName("crmacctSearch"); if (_parent->inherits("CRMAcctCluster")) // handles Crmacct, Competitor, Partner, Prospect, Taxauth setSubtype((qobject_cast(_parent))->subtype()); else if (_parent->inherits("CRMAcctLineEdit")) setSubtype((qobject_cast(_parent))->subtype()); else if (_parent->inherits("CLineEdit") || _parent->inherits("CustCluster")) { CLineEdit::CLineEditTypes type = _parent->inherits("CLineEdit") ? (qobject_cast(_parent))->type() : (qobject_cast(_parent))->type(); switch (type) { case CLineEdit::AllCustomers: setSubtype(CRMAcctLineEdit::Cust); _showInactive->setChecked(true); break; case CLineEdit::ActiveCustomers: setSubtype(CRMAcctLineEdit::Cust); _showInactive->setChecked(false); break; case CLineEdit::AllProspects: setSubtype(CRMAcctLineEdit::Prospect); _showInactive->setChecked(true); break; case CLineEdit::ActiveProspects: setSubtype(CRMAcctLineEdit::Prospect); _showInactive->setChecked(false); break; case CLineEdit::AllCustomersAndProspects: setSubtype(CRMAcctLineEdit::CustAndProspect); _showInactive->setChecked(true); break; case CLineEdit::ActiveCustomersAndProspects: setSubtype(CRMAcctLineEdit::CustAndProspect); _showInactive->setChecked(false); break; } } else if (_parent->inherits("VendorCluster") || _parent->inherits("VendorInfo") || _parent->inherits("VendorLineEdit")) { setSubtype(CRMAcctLineEdit::Vend); } else setSubtype(CRMAcctLineEdit::Crmacct); // do this late so the constructor can set defaults without triggering queries connect(_searchStreet, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchCity, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchState, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchPostalCode,SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchCountry,SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchContact,SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchPhone, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchEmail, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_searchCombo, SIGNAL(toggled(bool)), this, SLOT(sFillList())); connect(_comboCombo, SIGNAL(newID(int)), this, SLOT(sFillList())); _search->setFocus(); } void CRMAcctSearch::setId(const int id) { _id = id; _listTab->setId(id); } void CRMAcctSearch::setShowInactive(const bool show) { if (show != _showInactive->isChecked()) _showInactive->setChecked(show); } void CRMAcctSearch::setSubtype(const CRMAcctLineEdit::CRMAcctSubtype subtype) { _subtype = subtype; if (_queryParams) delete _queryParams; _queryParams = new ParameterList(); if(subtype != CRMAcctLineEdit::Vend) { _searchCombo->hide(); _comboCombo->hide(); } bool hasContact = true; bool hasAddress = true; switch (subtype) { case CRMAcctLineEdit::Cust: setWindowTitle(tr("Search For Customer")); _queryParams->append("customer"); _searchNumber->setText(tr("Customer Number")); _searchName->setText(tr("Customer Name")); _searchContact->setText(tr("Billing Contact Name")); _searchPhone->setText(tr("Billing Contact Phone #")); _searchEmail->setText(tr("Billing Contact Email")); _addressLit->setText(tr("Billing Contact Address:")); break; case CRMAcctLineEdit::Employee: setWindowTitle(tr("Search For Employee")); _queryParams->append("employee"); _searchNumber->setText(tr("Employee Code")); _searchName->setText(tr("Employee Number")); _searchContact->setText(tr("Contact Name")); _searchPhone->setText(tr("Contact Phone #")); _searchEmail->setText(tr("Contact Email")); _addressLit->setText(tr("Contact Address:")); break; case CRMAcctLineEdit::Prospect: setWindowTitle(tr("Search For Prospect")); _queryParams->append("prospect"); _searchNumber->setText(tr("Prospect Number")); _searchName->setText(tr("Prospect Name")); break; case CRMAcctLineEdit::SalesRep: setWindowTitle(tr("Search For Sales Rep")); _queryParams->append("salesrep"); _searchNumber->setText(tr("Sales Rep Number")); _searchName->setText(tr("Sales Rep Name")); hasContact = false; hasAddress = false; break; case CRMAcctLineEdit::Taxauth: setWindowTitle(tr("Search For Tax Authority")); _queryParams->append("taxauth"); _searchNumber->setText(tr("Tax Authority Code")); _searchName->setText(tr("Tax Authority Name")); hasContact = false; _addressLit->setText(tr("Tax Authority Address:")); _showInactive->setVisible(false); break; case CRMAcctLineEdit::User: setWindowTitle(tr("Search For User")); _queryParams->append("user"); _searchNumber->setText(tr("Username")); _searchName->setText(tr("User Proper Name")); hasContact = false; hasAddress = false; break; case CRMAcctLineEdit::Vend: setWindowTitle(tr("Search For Vendor")); _queryParams->append("vendor"); _searchCombo->setText(tr("Vendor Type:")); _comboCombo->setType(XComboBox::VendorTypes); _searchNumber->setText(tr("Vendor Number")); _searchName->setText(tr("Vendor Name")); _addressLit->setText(tr("Main Address:")); _listTab->addColumn("Vend. Type", _itemColumn, Qt::AlignLeft, true, "type"); break; case CRMAcctLineEdit::CustAndProspect: setWindowTitle(tr("Search For Customer or Prospect")); _queryParams->append("customer"); _queryParams->append("prospect"); _searchNumber->setText(tr("Number")); _searchName->setText(tr("Name")); _searchContact->setText(tr("Billing or Primary Contact Name")); _searchPhone->setText(tr("Billing or Primary Contact Phone #")); _searchEmail->setText(tr("Billing or Primary Contact Email")); _addressLit->setText(tr("Billing or Primary Contact Address:")); break; case CRMAcctLineEdit::Crmacct: case CRMAcctLineEdit::Competitor: case CRMAcctLineEdit::Partner: default: setWindowTitle(tr("Search For CRM Account")); _queryParams->append("crmaccount"); _searchNumber->setText(tr("CRM Account Number")); _searchName->setText(tr("CRM Account Name")); _searchContact->setText(tr("Primary Contact Name")); _searchPhone->setText(tr("Primary Contact Phone #")); _searchEmail->setText(tr("Primary Contact Email")); _addressLit->setText(tr("Primary Contact Address:")); break; } _searchContact->setVisible(hasContact); _searchPhone->setVisible(hasContact); _searchEmail->setVisible(hasContact); _addressLit->setVisible(hasAddress); _listTab->setColumnHidden(_listTab->column("cntct_first_name"), ! hasContact); _listTab->setColumnHidden(_listTab->column("cntct_last_name"), ! hasContact); _listTab->setColumnHidden(_listTab->column("cntct_phone"), ! hasContact); _listTab->setColumnHidden(_listTab->column("street"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_city"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_state"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_country"), ! hasAddress); _listTab->setColumnHidden(_listTab->column("addr_postalcode"), ! hasAddress); } void CRMAcctSearch::sFillList() { if (_search->text().trimmed().length() == 0) return; MetaSQLQuery mql(_listAndSearchQueryString); ParameterList params(*_queryParams); params.append("searchString", _search->text().trimmed().toUpper()); if (! _showInactive->isChecked()) params.append("activeOnly"); if (_searchNumber->isChecked()) params.append("searchNumber"); if (_searchName->isChecked()) params.append("searchName"); // some crmacct types don't have contacts (yet) if (_subtype != CRMAcctLineEdit::SalesRep && _subtype != CRMAcctLineEdit::Taxauth && _subtype != CRMAcctLineEdit::User) { if (_searchContact->isChecked()) params.append("searchContactName"); if (_searchPhone->isChecked()) params.append("searchPhone"); if (_searchEmail->isChecked()) params.append("searchEmail"); } // some crmacct types don't have addresses (yet) if (_subtype != CRMAcctLineEdit::SalesRep && _subtype != CRMAcctLineEdit::User) { if (_searchStreet->isChecked()) params.append("searchStreetAddr"); if (_searchCity->isChecked()) params.append("searchCity"); if (_searchState->isChecked()) params.append("searchState"); if (_searchPostalCode->isChecked()) params.append("searchPostalCode"); if (_searchCountry->isChecked()) params.append("searchCountry"); } if (_searchCombo->isChecked()) params.append("combo_id", _comboCombo->id()); XSqlQuery fillq = mql.toQuery(params); _listTab->populate(fillq); if (ErrorReporter::error(QtCriticalMsg, this, tr("Database Error"), fillq, __FILE__, __LINE__)) return; } qt-client-4.1.0/widgets/crmacctcluster.h000066400000000000000000000057301217451700100202540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _crmaccttCluster_h #define _crmaccttCluster_h #include "crmcluster.h" #include "xcheckbox.h" class XComboBox; class XTUPLEWIDGETS_EXPORT CRMAcctInfoAction { public: virtual ~CRMAcctInfoAction() {}; virtual void crmacctInformation(QWidget* parent, int pCustid) = 0; }; class XTUPLEWIDGETS_EXPORT CRMAcctLineEdit : public CrmClusterLineEdit { Q_OBJECT public: CRMAcctLineEdit(QWidget*, const char* = 0); enum CRMAcctSubtype { Crmacct, Competitor, Cust, Employee, Partner, Prospect, SalesRep, Taxauth, User, Vend, CustAndProspect }; virtual void setSubtype(const CRMAcctSubtype); virtual CRMAcctSubtype subtype() const; protected slots: VirtualList* listFactory(); VirtualSearch* searchFactory(); protected: CRMAcctSubtype _subtype; }; class XTUPLEWIDGETS_EXPORT CRMAcctList : public VirtualList { Q_OBJECT friend class CRMAcctCluster; friend class CRMAcctLineEdit; public: CRMAcctList(QWidget*, const char* = 0, bool = false, Qt::WFlags = 0); public slots: virtual void sFillList(); virtual void setId(const int); virtual void setShowInactive(const bool); virtual void setSubtype(const CRMAcctLineEdit::CRMAcctSubtype); protected: QWidget* _parent; bool _showInactive; enum CRMAcctLineEdit::CRMAcctSubtype _subtype; ParameterList *_queryParams; }; class XTUPLEWIDGETS_EXPORT CRMAcctSearch : public VirtualSearch { Q_OBJECT friend class CRMAcctCluster; friend class CRMAcctLineEdit; public: CRMAcctSearch(QWidget*, Qt::WindowFlags = 0); virtual void setId(const int); virtual void setShowInactive(const bool); virtual void setSubtype(const CRMAcctLineEdit::CRMAcctSubtype); public slots: virtual void sFillList(); protected: QLabel* _addressLit; QWidget* _parent; XCheckBox* _searchContact; XCheckBox* _searchPhone; XCheckBox* _searchEmail; XCheckBox* _searchStreet; XCheckBox* _searchCity; XCheckBox* _searchState; XCheckBox* _searchPostalCode; XCheckBox* _searchCountry; QCheckBox* _showInactive; XCheckBox* _searchCombo; XComboBox* _comboCombo; enum CRMAcctLineEdit::CRMAcctSubtype _subtype; ParameterList *_queryParams; private: }; class XTUPLEWIDGETS_EXPORT CRMAcctCluster : public VirtualCluster { Q_OBJECT public: CRMAcctCluster(QWidget*, const char* = 0); virtual void setSubtype(CRMAcctLineEdit::CRMAcctSubtype const); virtual CRMAcctLineEdit::CRMAcctSubtype subtype() const; }; #endif qt-client-4.1.0/widgets/crmcluster.h000066400000000000000000000042541217451700100174210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _crmcluster_h #define _crmcluster_h #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT CrmClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: CrmClusterLineEdit(QWidget*, const char*, const char*, const char*, const char*, const char*, const char*, const char*, const char* = 0, const char* = 0, const char* = 0); Q_INVOKABLE inline virtual QString editOwnPriv() const { return _editOwnPriv; } Q_INVOKABLE inline virtual QString viewOwnPriv() const { return _viewOwnPriv; } public slots: virtual void sList(); virtual void sOpen(); virtual void sSearch(); virtual void setEditOwnPriv(const QString& priv); virtual void setViewOwnPriv(const QString& priv); protected slots: virtual void sUpdateMenu(); virtual void setTableAndColumnNames(const char* pTabName, const char* pIdColumn, const char* pNumberColumn, const char* pNameColumn, const char* pDescripColumn, const char* pActiveColumn, const char* pOwnerColumn = 0, const char* pAssignToColumn = 0); virtual void silentSetId(const int); protected: void buildExtraClause(); QString _editOwnPriv; QString _viewOwnPriv; QString _owner; QString _assignto; QString _objtype; QString _ownerColName; QString _assigntoColName; QString _setQuery; bool _hasAssignto; bool _hasOwner; }; #endif qt-client-4.1.0/widgets/currCluster.cpp000066400000000000000000000656251217451700100201170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "xsqlquery.h" #include "xcombobox.h" #include "format.h" #include "xdoublevalidator.h" #include #include "currcluster.h" // d should be the number of places used by the id() currency #define EPSILON(d) (pow(10.0, -1 * (1 + d + decimals())) * 5) #define ABS(f) ((f) > 0 ? (f) : 0 - (f)) #define MINWIDTH 120 #define MAXWIDTH 200 #define MAXHEIGHT 32767 #define MAXCURRWIDTH 80 /* max width of _currency combobox */ #define UNKNOWNSTR "?????" #define DEBUG false /* If there's no conversion rate available for the given currency on the given date, then produce an error message. However, since there are often multiple CurrDisplay and/or CurrCluster widgets in the same window, only complain once. When the window is closed and the CurrDisplay/CurrCluster widgets are destroyed or when the user switches to another currency or to an existing conversion rate, then reset so subsequent errors or repeats of the same error can be reported. */ #include #include typedef QMap, int> DateToCurrMap; static DateToCurrMap errorMap; static QDate nullDate = QDate(); static QMutex errorListLock; /* Report if there is no conversion rate for the currency passed in (curr_id in curr_symbol and curr_rate tables). curr_id < 0 indicates that we really want to report that no base currency has been defined (sNoConversionRate is overloaded to avoid duplicating its logic in sNoBase(QWidget*) below). */ static void sNoConversionRate(QWidget* parent, const int curr_id, const QDate& effective, const char *caller) { bool displayMsg = false; QPair currDatePair = qMakePair(curr_id, curr_id < 0 ? nullDate : effective); errorListLock.lock(); DateToCurrMap::Iterator currMap = errorMap.find(currDatePair); // int* if (currMap == errorMap.end()) { errorMap[currDatePair] = 0; currMap = errorMap.find(currDatePair); } if (currMap.value() <= 0) { displayMsg = true; errorMap[currDatePair] = currMap.value() + 1; } errorListLock.unlock(); if (displayMsg) { qWarning("%s::sNoConversionRate(%p, %d, %s, %s)", (parent ? qPrintable(parent->objectName()) : "unknown"), parent, curr_id, qPrintable(effective.toString()), caller); if (curr_id >= 0) QMessageBox::critical(parent, QObject::tr("No Currency Exchange Rate"), QObject::tr("

    This document uses a currency which " "has no valid Exchange Rate. Please review your " "Exchange Rates to correct the problem. (%1 on %2)") .arg(curr_id) .arg(effective.toString())); else QMessageBox::critical(parent, QObject::tr("No Base Currency"), QObject::tr("

    No base currency has been defined. " "Call your system administrator.")); } } static void sZeroErrorCount(const int curr_id, const QDate& effective) { // see comment on negative curr_id before sNoConversionRate() QPair currDatePair = qMakePair(curr_id, curr_id < 0 ? nullDate : effective); errorListLock.lock(); DateToCurrMap::Iterator currMap = errorMap.find(currDatePair); // int* if (currMap != errorMap.end() && *currMap > 0) errorMap[currDatePair] = 0; errorListLock.unlock(); } static void sNoBase(QWidget* parent, const char* caller) { sNoConversionRate(parent, -1, nullDate, caller); } /* create the following widget for currency entry: +----------+------------+ |xcombobox | textfield| | ABR-S | valueInBase| +----------+------------+ where xcombobox is a drop-down list of currencies defaulting to base textfield is a monetary data entry field checked by a QDoubleValidator showing the value in the currency displayed in the xcombobox ABR-S is the currConcat() for the base currency valueInBase is a label showing textfield converted to the base currency ABR-S and valueInBase are hidden if the selected currency IS the base currency There's a property called localControl that determines whether changing the xcombobox or the effective date should convert the current base currency to the local currency or the local currency to the base. Conversions are made using the current date unless effective is changed. Beware - there are subtle differences between how _valueLocalWidget and _valueBaseWidget are handled. This is because _valueLocalWidget is an XLineEdit while _valueBaseWidget is a QLabel; they emit different signals. */ CurrCluster::CurrCluster(QWidget * parent, const char* name) : CurrDisplay(parent, name) { _baseVisible = true; _currencyEnabled = true; setObjectName("CurrCluster"); setWindowTitle("CurrCluster"); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); _grid->removeWidget(_valueLocalWidget); _currency = new XComboBox(this, "_currency"); //_currency->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _currency->setMaximumSize(MAXCURRWIDTH, MAXHEIGHT); _grid->addWidget(_valueLocalWidget, 0, 0); _grid->addWidget(_currency, 0, 1); _valueBaseWidget = new QLabel("", this); _valueBaseWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _grid->addWidget(_valueBaseWidget, 1, 0); _valueBaseLit = new QLabel("", this); _valueBaseLit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _valueBaseLit->setAlignment(Qt::AlignLeft); _grid->addWidget(_valueBaseLit, 1, 1); setFocusProxy(_valueLocalWidget); setFocusPolicy(Qt::StrongFocus); _currency->setType(XComboBox::Currencies); _validator = new XDoubleValidator(0, +999999999, _localScale, this); _valueLocalWidget->setValidator(_validator); _valueBaseWidget->setAlignment(Qt::AlignRight|Qt::AlignTop); // setTabOrder(_currency, _valueLocalWidget); // setTabOrder(_valueLocalWidget, 0); connect(_currency, SIGNAL(newID(int)), this, SLOT(sId(int))); connect(_valueLocalWidget, SIGNAL(editingFinished()), this, SLOT(sLostFocus())); connect(_valueLocalWidget, SIGNAL(textChanged(const QString&)), this, SLOT(sValueLocalChanged())); _valueBaseLit->setText(_baseAbbr); _valueBaseLit->setHidden(TRUE); _valueBaseWidget->setHidden(TRUE); #ifdef Q_WS_MAC setMinimumWidth(160); #endif clear(); setEnabled(TRUE); setBaseVisible(TRUE); setCurrencyEnabled(TRUE); } void CurrCluster::clear() { _state = New; _valueBaseWidget->clear(); CurrDisplay::clear(); } void CurrCluster::setCurrencyVisible(bool showCurrency) { _currency->setHidden(! showCurrency); } void CurrCluster::setBaseVisible(bool showBase) { _baseVisible = showBase; if (showBase) { _valueBaseLit->setHidden(_baseId == _currency->id()); _valueBaseWidget->setHidden(_baseId == _currency->id()); } else { _valueBaseLit->setHidden(TRUE); _valueBaseWidget->setHidden(TRUE); } } void CurrCluster::setId(int curr_id) { if (_currency->id() != curr_id) { _currency->setId(curr_id); emit idChanged(curr_id); } } void CurrCluster::sId(int id) { if (_baseVisible) { _valueBaseLit->setHidden(id == _baseId); _valueBaseWidget->setHidden(id == _baseId); } if (_localControl) sValueLocalChanged(_valueLocal); else sValueBaseChanged(_valueBase); sReformat(); emit idChanged(id); } void CurrCluster::sLostFocus() { _valueLocal = _valueLocalWidget->toDouble(); sReformat(); emit(editingFinished()); } void CurrCluster::sReformat() const { if (DEBUG) qDebug("CC %s::sReformat() entered with _state %d, _format %d", qPrintable(objectName()), _state, _format); QString na = tr("N/A"); QString unknown = tr(UNKNOWNSTR); QString base = ""; QString local = ""; switch (_state) { case New: base = local = ""; break; case NANew: base = local = na; break; case Initialized: if (isZero()) switch (_format) { case SalesPrice: base = local = formatSalesPrice(0.0, id()); break; case PurchPrice: base = local = formatPurchPrice(0.0, id()); break; case ExtPrice: base = local = formatExtPrice(0.0, id()); break; case Cost: base = local = formatCost(0.0, id()); break; case Money: default: base = local = formatMoney(0.0, id()); break; } else { if (_baseKnown) switch (_format) { case SalesPrice: base = formatSalesPrice(_valueBase, id()); break; case PurchPrice: base = formatPurchPrice(_valueBase, id()); break; case ExtPrice: base = formatExtPrice(_valueBase, id()); break; case Cost: base = formatCost(_valueBase, id()); break; case Money: default: base = formatMoney(_valueBase, id()); break; } else base = unknown; if (_localKnown) switch (_format) { case SalesPrice: local = formatSalesPrice(_valueLocal, id()); break; case PurchPrice: local = formatPurchPrice(_valueLocal, id()); break; case ExtPrice: local = formatExtPrice(_valueLocal, id()); break; case Cost: local = formatCost(_valueLocal, id()); break; case Money: default: local = formatMoney(_valueLocal, id()); break; } else local = unknown; } break; case NAInit: if (isZero()) base = local = na; else { switch (_format) { case SalesPrice: base = formatSalesPrice(_valueBase, id()); break; local = formatSalesPrice(_valueLocal, id()); break; case PurchPrice: base = formatPurchPrice(_valueBase, id()); break; local = formatPurchPrice(_valueLocal, id()); break; case ExtPrice: base = formatExtPrice(_valueBase, id()); break; local = formatExtPrice(_valueLocal, id()); break; case Cost: base = formatCost(_valueBase, id()); break; local = formatCost(_valueLocal, id()); break; case Money: default: base = formatMoney(_valueBase, id()); break; local = formatMoney(_valueLocal, id()); break; } } break; default: break; } _valueLocalWidget->setText(local); _valueBaseWidget->setText(base); } void CurrCluster::set(const double newValue, const int newId, const QDate& newDate, const bool isBase) { bool emitId = false; bool emitDate = false; if (newId != id()) { emitId = true; _currency->setId(newId); } if (newDate != _effective) { emitDate = true; _effective = newDate; } if (isBase) setBaseValue(newValue); else setLocalValue(newValue); if (emitId) emit idChanged(newId); if (emitDate) emit effectiveChanged(newDate); } void CurrCluster::setAllowNegative(bool value) { if (value) _validator->setBottom(0 - _validator->top()); else _validator->setBottom(0); } void CurrCluster::setFormat(CurrDisplayFormats pFormat) { CurrDisplay::setFormat(pFormat); _validator->setDecimals(_decimals + _localScale); if (DEBUG) qDebug("%s::setFormat() returning with _validator set to %d", qPrintable(objectName()), _validator->decimals()); } void CurrCluster::setEnabled(bool newValue) { CurrDisplay::setEnabled(newValue); _currency->setEnabled(newValue && currencyEnabled()); } void CurrCluster::setPaletteForegroundColor(const QColor &newColor) { CurrDisplay::setPaletteForegroundColor(newColor); QPalette p = _valueLocalWidget->palette(); p.setColor(QPalette::Text, newColor); _currency->setPalette(p); _valueBaseLit->setPalette(p); _valueBaseWidget->setPalette(p); } // deprecated void CurrCluster::setCurrencyEditable(bool newValue) { setCurrencyEnabled(newValue); } void CurrCluster::setCurrencyEnabled(bool newValue) { _currencyEnabled = newValue; _currency->setEnabled(newValue && _valueLocalWidget->isEnabled()); } void CurrCluster::setCurrencyDisabled(bool newValue) { setCurrencyEnabled(! newValue); } void CurrCluster::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(_currency, _fieldNameCurr, "code", "currentDefault"); m->addMapping(this, _fieldNameValue, "localValue", "defaultLocalValue"); _mapper=m; } /////////////////////////////// int CurrDisplay::_baseId = -1; QString CurrDisplay::_baseAbbr = QString(); int CurrDisplay::_baseScale = 2; int CurrDisplay::baseId() { if (_x_preferences && _baseId <= 0) { XSqlQuery baseQuery; baseQuery.prepare("SELECT curr_id, " " ' ' || curr_abbr || '-' || curr_symbol AS f_curr " //currConcat(curr_id) AS curr_symbol " "FROM curr_symbol " "WHERE curr_base = TRUE;"); baseQuery.exec(); if (baseQuery.first()) { _baseId = baseQuery.value("curr_id").toInt(); _baseAbbr = baseQuery.value("f_curr").toString(); } else if (baseQuery.lastError().number() == 2000 /* NOT FOUND */) { sNoBase(0, "baseId"); } else if (baseQuery.lastError().type() != QSqlError::NoError) { QMessageBox::critical(0, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), baseQuery.lastError().databaseText()); } // TODO: add # decimal places to the currency descriptions _baseScale = 2; } return _baseId; } QString CurrDisplay::baseCurrAbbr() { (void)baseId(); return _baseAbbr; } CurrDisplay::CurrDisplay(QWidget * parent, const char* name) : QWidget(parent) { setObjectName(name ? name : "CurrDisplay"); setWindowTitle("CurrDisplay"); _grid = new QGridLayout(this); _grid->setMargin(2); _grid->setSpacing(2); _valueLocalWidget = new XLineEdit(this); _valueLocalWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _valueLocalWidget->setMinimumWidth(QFontMetrics(QFont()).width("99999.9999")); _grid->addWidget(_valueLocalWidget, 0, 0); _valueLocalWidget->setAlignment(Qt::AlignRight|Qt::AlignTop); setLayout(_grid); connect(this, SIGNAL(valueLocalChanged(const double)), this, SIGNAL(valueChanged())); connect(this, SIGNAL(valueBaseChanged(const double)), this, SIGNAL(valueChanged())); _localId = baseId(); _localScale = _baseScale; _effective = QDate().currentDate(); _decimals = 0; _format = Money; _default = 0; clear(); setEnabled(FALSE); setLocalControl(TRUE); setMinimumSize(MINWIDTH, 0); setMaximumSize(MAXWIDTH, MAXHEIGHT); _mapper = new XDataWidgetMapper(this); } CurrDisplay::~CurrDisplay() { sZeroErrorCount(id(), effective()); sZeroErrorCount(-1, effective()); } void CurrDisplay::clear() { _state = New; _valueBase = 0; _valueLocal = 0; _baseKnown = false; _localKnown = false; _valueLocalWidget->clear(); emit valueChanged(); } void CurrDisplay::reset() { clear(); setId(_baseId); setEffective(QDate().currentDate()); } void CurrDisplay::setFormat(CurrDisplayFormats pFormat) { if (DEBUG) qDebug("%s::setFormat(%d)", qPrintable(objectName()), pFormat); int precision = _decimals + _localScale; _format = pFormat; switch (pFormat) { case SalesPrice: precision = decimalPlaces("salesprice"); break; case PurchPrice: precision = decimalPlaces("purchprice"); break; case ExtPrice: precision = decimalPlaces("extprice"); break; case Cost: precision = decimalPlaces("cost"); break; case Money: default: precision = decimalPlaces("curr"); break; } _decimals = precision - _localScale; if (DEBUG) qDebug("%s::setFormat(%d) returning with _format %d, _decimals %d", qPrintable(objectName()), pFormat, _format, _decimals); } void CurrDisplay::setLocalControl(bool newValue) { _localControl = newValue; } void CurrDisplay::sReformat() const { if (DEBUG) qDebug("CD %s::sReformat() entered with _state %d, _format %d", qPrintable(objectName()), _state, _format); QString na = tr("N/A"); QString unknown = tr(UNKNOWNSTR); QString local = ""; switch (_state) { case New: local = ""; break; case NANew: local = na; break; case Initialized: if (isZero()) switch (_format) { case SalesPrice: local = formatSalesPrice(0.0, id()); break; case PurchPrice: local = formatPurchPrice(0.0, id()); break; case ExtPrice: local = formatExtPrice(0.0, id()); break; case Cost: local = formatCost(0.0, id()); break; case Money: default: local = formatMoney(0.0, id()); break; } else if (_localKnown) switch (_format) { case SalesPrice: local = formatSalesPrice(_valueLocal, id()); break; case PurchPrice: local = formatPurchPrice(_valueLocal, id()); break; case ExtPrice: local = formatExtPrice(_valueLocal, id()); break; case Cost: local = formatCost(_valueLocal, id()); break; case Money: default: local = formatMoney(_valueLocal, id()); break; } else local = unknown; break; case NAInit: if (isZero()) local = na; else switch (_format) { case SalesPrice: local = formatSalesPrice(_valueLocal, id()); break; case PurchPrice: local = formatPurchPrice(_valueLocal, id()); break; case ExtPrice: local = formatExtPrice(_valueLocal, id()); break; case Cost: local = formatCost(_valueLocal, id()); break; case Money: default: local = formatMoney(_valueLocal, id()); break; } break; default: break; } _valueLocalWidget->setText(local); } void CurrDisplay::setId(int curr_id) { // ToDo - set _localScale when the currency id changes if (_localId != curr_id) { _localId = curr_id; if (_localControl) sValueLocalChanged(_valueLocal); else sValueBaseChanged(_valueBase); sReformat(); emit idChanged(curr_id); } } void CurrDisplay::setBaseValue(double newValue) { _state = (_state == NANew || _state == NAInit) ? NAInit : Initialized; // either the value has significantly changed or we're explicitly setting 0 if (ABS(_valueBase - newValue) > EPSILON(_baseScale) || newValue < EPSILON(_baseScale)) { _valueBase = newValue; _baseKnown = true; emit valueBaseChanged(_valueBase); sValueBaseChanged(_valueBase); sReformat(); } } void CurrDisplay::setLocalValue(double newValue) { _state = (_state == NANew || _state == NAInit) ? NAInit : Initialized; // either the value has significantly changed or we're explicitly setting 0 if (ABS(_valueLocal - newValue) > EPSILON(_localScale) || newValue < EPSILON(_localScale)) { double prec = pow(10.0, qMax(0, (_decimals + _localScale))); // use the floor function here instead of qRound to prevent problem on windows builds _valueLocal = floor(newValue*prec + 0.5f)/prec; _localKnown = true; emit valueLocalChanged(_valueLocal); sValueLocalChanged(_valueLocal); sReformat(); } } void CurrDisplay::sValueBaseChanged() { sValueBaseChanged(_valueBase); } void CurrDisplay::sValueBaseChanged(double newValue) { double oldLocal = _valueLocal; if (ABS(newValue) < EPSILON(_baseScale) || _effective.isNull()) { if (ABS(_valueLocal) >= EPSILON(_localScale)) { _valueLocal = 0; _valueLocalWidget->clear(); } } else { XSqlQuery convertVal; convertVal.prepare("SELECT currToLocal(:curr_id, :value, :date) " " AS localValue;"); convertVal.bindValue(":curr_id", id()); convertVal.bindValue(":value", newValue); convertVal.bindValue(":date", _effective); convertVal.exec(); if (convertVal.first()) { _valueLocal = convertVal.value("localValue").toDouble(); sZeroErrorCount(id(), effective()); _localKnown = true; } else if (convertVal.lastError().type() != QSqlError::NoError) { if (convertVal.lastError().databaseText().contains("No exchange rate")) { emit noConversionRate(); sNoConversionRate(this, id(), effective(), "sValueBaseChanged"); } else QMessageBox::critical(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), convertVal.lastError().databaseText()); _localKnown = false; } } if (ABS(oldLocal - _valueLocal) > EPSILON(_localScale)) emit valueLocalChanged(_valueLocal); } void CurrDisplay::sValueLocalChanged() { if (_valueLocalWidget->text().trimmed().isEmpty()) _state = New; else _state = (_state == NANew || _state == NAInit) ? NAInit : Initialized; if (_valueLocalWidget->text() != tr(UNKNOWNSTR)) { _valueLocal = _valueLocalWidget->toDouble(); _localKnown = true; sValueLocalChanged(_valueLocal); } } void CurrDisplay::sValueLocalChanged(double newValue) { if (_mapper->model() && _mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this))).toDouble() != newValue) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this)), newValue); double oldBase = _valueBase; if (ABS(newValue) < EPSILON(_localScale) || _effective.isNull()) { if (ABS(_valueBase) >= EPSILON(_baseScale)) { _valueBase = 0; _baseKnown = true; } } else { XSqlQuery convertVal; convertVal.prepare("SELECT currToBase(:curr_id, :value, :date) " " AS baseValue;"); convertVal.bindValue(":curr_id", id()); convertVal.bindValue(":value", newValue); convertVal.bindValue(":date", _effective); convertVal.exec(); if (convertVal.first()) { _valueBase = convertVal.value("baseValue").toDouble(); sZeroErrorCount(id(), effective()); _baseKnown = true; } else if (convertVal.lastError().type() != QSqlError::NoError) { if (convertVal.lastError().databaseText().contains("No exchange rate")) { emit noConversionRate(); sNoConversionRate(this, id(), effective(), "sValueLocalChanged"); } else QMessageBox::critical(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), convertVal.lastError().databaseText()); _baseKnown = false; } } if (ABS(oldBase - _valueBase) > EPSILON(_baseScale)) emit valueBaseChanged(_valueBase); } void CurrDisplay::set(const double newValue, const int newId, const QDate& newDate, const bool isBase) { bool emitId = false; bool emitDate = false; if (newId != id()) { emitId = true; _localId = newId; } if (newDate != _effective) { emitDate = true; _effective = newDate; } if (isBase) setBaseValue(newValue); else setLocalValue(newValue); if (emitId) emit idChanged(newId); if (emitDate) emit effectiveChanged(newDate); } void CurrDisplay::setEffective(const QDate& newValue) { // qWarning(QString("CurrDisplay::setEffective(%1)").arg(newValue.toString())); if (! newValue.isNull()) { _effective = newValue; if (_localControl) sValueLocalChanged(_valueLocal); else sValueBaseChanged(_valueBase); sReformat(); emit effectiveChanged(newValue); } } bool CurrDisplay::isZero() const { if (_localControl) return ABS(_valueLocal) < EPSILON(_localScale); else return ABS(_valueBase) < EPSILON(_baseScale); } // cache it? QString CurrDisplay::currAbbr() const { QString returnValue(""); XSqlQuery getAbbr; getAbbr.prepare("SELECT currConcat(:curr_id) AS currConcat;"); getAbbr.bindValue(":curr_id", id()); getAbbr.exec(); if (getAbbr.first()) returnValue = getAbbr.value("currConcat").toString(); else if (getAbbr.lastError().type() != QSqlError::NoError) QMessageBox::critical(0, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), getAbbr.lastError().databaseText()); return returnValue; } QString CurrDisplay::currSymbol(const int pid) { XSqlQuery symq; symq.prepare("SELECT curr_symbol FROM curr_symbol WHERE (curr_id=:id);"); symq.bindValue(":id", pid); if (symq.first()) return symq.value("curr_symbol").toString(); else if (symq.lastError().type() != QSqlError::NoError) QMessageBox::critical(0, tr("A System Error occurred at %1::%2.") .arg(__FILE__).arg(__LINE__), symq.lastError().databaseText()); return ""; } void CurrDisplay::setPaletteForegroundColor(const QColor &newColor) { QPalette p = _valueLocalWidget->palette(); p.setColor(QPalette::Text, newColor); _valueLocalWidget->setPalette(p); } void CurrDisplay::setNA(const bool isNA) { switch (_state) { case New: case NANew: _state = (isNA) ? NANew : New; break; case NAInit: case Initialized: _state = (isNA) ? NAInit : Initialized; break; } if (isNA) setLocalValue(0); } double CurrDisplay::convert(const int from, const int to, const double amount, const QDate& date) { if (from == to) return amount; XSqlQuery convq; convq.prepare("SELECT currToCurr(:from, :to, :amount, :date) AS result;"); convq.bindValue(":from", from); convq.bindValue(":to", to); convq.bindValue(":amount", amount); convq.bindValue(":date", date); convq.exec(); if (convq.first()) return convq.value("result").toDouble(); else if (convq.lastError().type() != QSqlError::NoError) { if (convq.lastError().databaseText().contains("No exchange rate")) sNoConversionRate(0, from, date, "convert"); else QMessageBox::critical(0, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), convq.lastError().databaseText()); } return 0.0; } void CurrDisplay::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(this, _fieldNameValue, QByteArray("localValue")); _mapper=m; } qt-client-4.1.0/widgets/currcluster.h000066400000000000000000000201711217451700100176070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef currCluster_h #define currCluster_h #include #include class QLabel; class QGridLayout; class QDoubleValidator; #include "widgets.h" #include "xcombobox.h" #include "xlineedit.h" /* There are several places where all we need is a widget that shows a currency value. It has to internally hold a value in the base currency but show it converted to local. To do so it must respond to signals that the currency to display in or the exchange rate has changed. */ class XTUPLEWIDGETS_EXPORT CurrDisplay : public QWidget { Q_OBJECT Q_ENUMS(CurrDisplayFormats) Q_PROPERTY(double baseValue READ baseValue WRITE setBaseValue) Q_PROPERTY(double defaultLocalValue READ defaultLocalValue WRITE setDefaultLocalValue) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) Q_PROPERTY(QString fieldNameValue READ fieldNameValue WRITE setFieldNameValue) Q_PROPERTY(CurrDisplayFormats format READ format WRITE setFormat) Q_PROPERTY(bool localControl READ localControl WRITE setLocalControl) Q_PROPERTY(double localValue READ localValue WRITE setLocalValue) public: CurrDisplay(QWidget * parent, const char* name = 0); ~CurrDisplay(); // correspond to format.cpp's monetary scales, // which can be overridden in the db via locales enum CurrDisplayFormats { Money, SalesPrice, PurchPrice, ExtPrice, Cost }; double defaultLocalValue() const { return _default; }; virtual bool isZero() const; virtual inline bool isEmpty() const { return (New == _state); }; static QString baseCurrAbbr(); virtual QString currAbbr() const; static QString currSymbol(const int); Q_INVOKABLE virtual inline int id() const { return _localId; }; static int baseId(); virtual inline double baseValue() const { return _valueBase; }; virtual inline double localValue() const { return _valueLocal; }; virtual int decimals() const { return _decimals; }; virtual CurrDisplayFormats format() const { return _format; }; virtual inline bool localControl() const { return _localControl; }; virtual inline QDate effective() const { return _effective; }; virtual inline bool isEnabled() const { return _valueLocalWidget->isEnabled(); }; virtual inline bool isBase() const { return _localId == _baseId; }; static double convert(const int, const int, const double, const QDate&); virtual QString fieldNameValue() const { return _fieldNameValue; }; public slots: void clear(); void reset(); void setId(int); void setBaseValue(double); void setDefaultLocalValue(double p) { _default = p; }; void setLocalValue(double); virtual void setFormat(CurrDisplayFormats = Money); void setLocalControl(bool); void setEffective(const QDate&); inline void setEnabled(bool B) { _valueLocalWidget->setEnabled(B); }; void setPaletteForegroundColor ( const QColor & ); void set(const double, const int, const QDate&, const bool = true); void setNA(const bool = true); virtual void setFieldNameValue(QString p) { _fieldNameValue = p; }; signals: void idChanged(int); void valueBaseChanged(const double); void valueLocalChanged(const double); void valueChanged(); void effectiveChanged(const QDate&); void noConversionRate(); protected: static QString _baseAbbr; static int _baseId; static int _baseScale; QGridLayout* _grid; int _localId; QDate _effective; int _decimals; CurrDisplayFormats _format; double _valueLocal; XLineEdit* _valueLocalWidget; double _valueBase; bool _localControl; int _localScale; // if New then display "" instead of 0 // if NA* then display N/A instead of 0 enum State { New, NANew, Initialized, NAInit }; State _state; bool _baseKnown; bool _localKnown; QString _fieldNameValue; XDataWidgetMapper *_mapper; protected slots: virtual void sReformat() const; virtual void sValueBaseChanged(); virtual void sValueBaseChanged(double); virtual void sValueLocalChanged(); virtual void sValueLocalChanged(double); virtual void setDataWidgetMap(XDataWidgetMapper* m); private: double _default; }; /* The currCluster looks like so: +-----------+------------+ | xcombobox | textfield | | ABR-S | valueInBase| +-----------+------------+ Property descriptions: currencyVisible whether the "Currency" label and xcombobox are shown baseVisible whether the base currency abbreviation and value are shown; they are always hidden if the xcombobox shows the base currency is selected, but are usually visible if the current currency selected is NOT the base. If baseVisible is FALSE then the base value is never shown format locale format used to determine the number of decimal places displayed for currency values allowNegative whether input may include negative numbers or only >= 0 localControl if TRUE then changes to the xcombobox leave the local value unchanged and reconverts the local value to base; if FALSE then changes to the xcombobox leave the base value alone and converts the base value to local */ class XTUPLEWIDGETS_EXPORT CurrCluster : public CurrDisplay { Q_OBJECT Q_PROPERTY(bool allowNegative READ allowNegative WRITE setAllowNegative) Q_PROPERTY(bool baseVisible READ baseVisible WRITE setBaseVisible) Q_PROPERTY(bool currencyDisabled READ currencyDisabled WRITE setCurrencyDisabled) Q_PROPERTY(bool currencyEditable READ currencyEnabled WRITE setCurrencyEnabled) Q_PROPERTY(bool currencyEnabled READ currencyEnabled WRITE setCurrencyEnabled) Q_PROPERTY(bool currencyVisible READ currencyVisible WRITE setCurrencyVisible) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) Q_PROPERTY(QString fieldNameCurr READ fieldNameCurr WRITE setFieldNameCurr) public: CurrCluster(QWidget * parent, const char* name = 0); inline bool allowNegative() const { return _validator->bottom() < 0; }; inline bool baseVisible() const { return _baseVisible; }; inline QString currAbbr() const { return _currency->currentText(); }; inline bool currencyDisabled() const { return ! _currencyEnabled; }; inline bool currencyEnabled() const { return _currencyEnabled; }; inline bool currencyVisible() const { return !_currency->isHidden(); }; inline int id() const { return _currency->id(); }; inline bool isBase() const { return _currency->id() == _baseId; }; inline bool isEnabled() const { return _valueLocalWidget->isEnabled(); }; QString fieldNameCurr() const { return _fieldNameCurr; }; public slots: void clear(); void set(const double, const int, const QDate&, const bool = true); void setAllowNegative(bool); void setBaseVisible(bool); void setCurrencyDisabled(bool); void setCurrencyEditable(bool); // deprecated: use setCurrencyEnabled void setCurrencyEnabled(bool); void setCurrencyVisible(bool); void setEnabled(bool); virtual void setFormat(CurrDisplayFormats); void setId(int); void setPaletteForegroundColor ( const QColor & ); void sLostFocus(); void setDataWidgetMap(XDataWidgetMapper* m); void setFieldNameCurr(QString p) { _fieldNameCurr = p; }; signals: void editingFinished(); protected: bool _baseVisible; QDoubleValidator* _validator; bool _currencyEnabled; QLabel* _valueBaseLit; QLabel* _valueBaseWidget; XComboBox* _currency; protected slots: virtual void sId(int); virtual void sReformat() const; private: QString _fieldNameCurr; }; #endif qt-client-4.1.0/widgets/currdisplay.h000066400000000000000000000007251217451700100175760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/widgets/custCluster.cpp000066400000000000000000000266221217451700100201140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ //#include #include #include #include #include #include #include #include #include #include #include "custcluster.h" #include "format.h" #include "storedProcErrorLookup.h" #define DEBUG false CLineEdit::CLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "cust", "id", "number", "name", "description", 0, pName, "active") { _crmacctId = -1; _type = AllCustomers; _subtype = CRMAcctLineEdit::Cust; _canEdit = false; _editMode = false; setTitles(tr("Customer"), tr("Customers")); setUiName("customer"); setEditPriv("MaintainCustomerMasters"); setViewPriv("ViewCustomerMasters"); setNewPriv("MaintainCustomerMasters"); _query = " SELECT * FROM ( " " SELECT cust_id AS id, " " cust_number AS number, " " cust_name AS name," " addr_line1 AS description," " cust_active AS active, " " cust_creditstatus, " " crmacct_id, true AS iscustomer, " " addr.*, cntct.*, " " formatAddr(addr_line1, addr_line2, addr_line3, '', '') AS street " " FROM custinfo " " LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) " " LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) " " LEFT OUTER JOIN crmacct ON (crmacct_cust_id=cust_id) " " UNION ALL " " SELECT prospect_id AS id, " " prospect_number AS number," " prospect_name AS name," " addr_line1 AS description," " prospect_active AS active, " " 'G' AS cust_creditstatus, " " crmacct_id, false AS iscustomer, " " addr.*, cntct.*, " " formatAddr(addr_line1, addr_line2, addr_line3, '', '') AS street " " FROM prospect " " LEFT OUTER JOIN cntct ON (prospect_cntct_id=cntct_id) " " LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) " " LEFT OUTER JOIN crmacct ON (crmacct_prospect_id=prospect_id) " " ) cust " "WHERE (true) "; _modeSep = 0; _modeAct = new QAction(tr("Edit Number"), this); _modeAct->setToolTip(tr("Sets number for editing")); _modeAct->setCheckable(true); connect(_modeAct, SIGNAL(triggered(bool)), this, SLOT(setEditMode(bool))); } void CLineEdit::sNew() { QString uiName="customer"; ParameterList params; QMessageBox ask(this); ask.setIcon(QMessageBox::Question); QPushButton *pbutton = ask.addButton(tr("Prospect"), QMessageBox::YesRole); QPushButton *cbutton = ask.addButton(tr("Customer"), QMessageBox::YesRole); ask.setDefaultButton(cbutton); ask.setWindowTitle(tr("Customer or Prospect?")); if (_subtype == CRMAcctLineEdit::Prospect || (_subtype == CRMAcctLineEdit::CustAndProspect && !_x_privileges->check("MaintainCustomerMasters"))) { params.append("mode", "new"); uiName="prospect"; } if (_subtype == CRMAcctLineEdit::CustAndProspect && !_x_privileges->check("MaintainProspectMasters")) params.append("mode", "new"); else { if (_subtype == CRMAcctLineEdit::Cust) ask.setText(tr("

    Would you like to create a new Customer or convert " "an existing Prospect?")); else ask.setText(tr("

    Would you like to create a new Customer or " "a new Prospect?")); ask.exec(); if (ask.clickedButton() == pbutton && _subtype == CRMAcctLineEdit::Cust) // converting prospect { int prospectid = -1; if (_x_preferences->value("DefaultEllipsesAction") == "search") { CRMAcctSearch* search = new CRMAcctSearch(this); search->setSubtype(CRMAcctLineEdit::Prospect); prospectid = search->exec(); } else { CRMAcctList* list = new CRMAcctList(this); list->setSubtype(CRMAcctLineEdit::Prospect); prospectid = list->exec(); } if (prospectid > 0) { XSqlQuery convertq; convertq.prepare("SELECT convertProspectToCustomer(:id) AS result;"); convertq.bindValue(":id", prospectid); convertq.exec(); if (convertq.first()) { int result = convertq.value("result").toInt(); if (result < 0) { QMessageBox::critical(this, tr("Processing Error"), storedProcErrorLookup("convertProspectToCustomer", result)); return; } params.append("cust_id", prospectid); params.append("mode", "edit"); } } else return; } else { params.append("mode", "new"); if (ask.clickedButton() == pbutton) uiName = "prospect"; } } sOpenWindow(uiName, params); } void CLineEdit::setId(int pId) { VirtualClusterLineEdit::setId(pId); if (model() && _id != -1) { if (model()->data(model()->index(0,ISCUSTOMER)).toBool()) { setUiName("customer"); setEditPriv("MaintainCustomerMasters"); setViewPriv("ViewCustomerMasters"); setNewPriv("MaintainCustomerMasters"); _idColName="cust_id"; } else { setUiName("prospect"); setEditPriv("MaintainProspectMasters"); setViewPriv("ViewProspectMasters"); setNewPriv("MaintainProspectMasters"); _idColName="prospect_id"; } sUpdateMenu(); _crmacctId = model()->data(model()->index(0,CRMACCT_ID)).toInt(); emit newCrmacctId(_crmacctId); // Handle Credit Status QString status = model()->data(model()->index(0,CREDITSTATUS)).toString(); if (!editMode() && status != "G") { if (status == "W") _menuLabel->setPixmap(QPixmap(":/widgets/images/credit_warn.png")); else _menuLabel->setPixmap(QPixmap(":/widgets/images/credit_hold.png")); return; } } if (_editMode) _menuLabel->setPixmap(QPixmap(":/widgets/images/edit.png")); else _menuLabel->setPixmap(QPixmap(":/widgets/images/magnifier.png")); } void CLineEdit::setType(CLineEditTypes pType) { _type = pType; QStringList list; switch (_type) { case ActiveCustomers: list.append("active"); // fall-through case AllCustomers: list.append("iscustomer"); _subtype = CRMAcctLineEdit::Cust; break; case ActiveProspects: list.append("active"); // fall-through case AllProspects: list.append("NOT iscustomer"); _subtype = CRMAcctLineEdit::Prospect; break; case ActiveCustomersAndProspects: list.append("active"); // fall-through case AllCustomersAndProspects: _subtype = CRMAcctLineEdit::CustAndProspect; break; } list.removeDuplicates(); setExtraClause(list.join(" AND ")); } VirtualList* CLineEdit::listFactory() { CRMAcctList* list = new CRMAcctList(this); list->setSubtype(_subtype); return list; } VirtualSearch* CLineEdit::searchFactory() { CRMAcctSearch* search = new CRMAcctSearch(this); search->setSubtype(_subtype); return search; } bool CLineEdit::canEdit() { return _canEdit; } void CLineEdit::setCanEdit(bool p) { if (p == _canEdit || !_x_metrics) return; if (p) { if (_x_privileges && _subtype == CRMAcctLineEdit::Cust) _canEdit = _x_privileges->check("MaintainCustomerMasters"); else if (_x_privileges && _subtype == CRMAcctLineEdit::Prospect) _canEdit = _x_privileges->check("MaintainProspectMasters"); else if (_x_privileges) _canEdit = _x_privileges->check("MaintainCustomerMasters") || _x_privileges->check("MaintainProspectMasters"); } else _canEdit=p; if (!_canEdit) setEditMode(false); sUpdateMenu(); } bool CLineEdit::editMode() { return _editMode; } bool CLineEdit::setEditMode(bool p) { if (p == _editMode) return p; if (!_canEdit) return false; _editMode=p; _modeAct->setChecked(p); if (_x_preferences) { if (!_x_preferences->boolean("ClusterButtons")) { if (_editMode) _menuLabel->setPixmap(QPixmap(":/widgets/images/edit.png")); else _menuLabel->setPixmap(QPixmap(":/widgets/images/magnifier.png")); } if (!_x_metrics->boolean("DisableAutoComplete") && _editMode) disconnect(this, SIGNAL(textEdited(QString)), this, SLOT(sHandleCompleter())); else if (!_x_metrics->boolean("DisableAutoComplete")) connect(this, SIGNAL(textEdited(QString)), this, SLOT(sHandleCompleter())); } sUpdateMenu(); setDisabled(_editMode && _x_metrics->value("CRMAccountNumberGeneration") == "A"); if (!_editMode) selectAll(); emit editable(p); return p; } void CLineEdit::sParse() { if (_editMode) return; VirtualClusterLineEdit::sParse(); } void CLineEdit::sUpdateMenu() { VirtualClusterLineEdit::sUpdateMenu(); if (_x_preferences) { if (_x_preferences->boolean("ClusterButtons")) return; } else return; if (_canEdit) { if (!menu()->actions().contains(_modeAct)) { _infoAct->setVisible(false); menu()->addAction(_modeAct); } _listAct->setDisabled(_editMode); _searchAct->setDisabled(_editMode); _listAct->setVisible(!_editMode); _searchAct->setVisible(!_editMode); } else { if (menu()->actions().contains(_modeAct)) { _infoAct->setVisible(true); menu()->removeAction(_modeAct); } } // Handle New bool canNew = false; if (_subtype == CRMAcctLineEdit::Cust) canNew = (_x_privileges->check("MaintainCustomerMasters")); else if (_subtype == CRMAcctLineEdit::Prospect) canNew = (_x_privileges->check("MaintainProspectMasters")); else canNew = (_x_privileges->check("MaintainCustomerMasters") || _x_privileges->check("MaintainProspectMasters")); _newAct->setEnabled(canNew && isEnabled()); } bool CLineEdit::canOpen() { return VirtualClusterLineEdit::canOpen() && !canEdit(); } ////////////////////////////////////////////////////////////// CustCluster::CustCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new CLineEdit(this, pName)); CLineEdit* number = static_cast(_number); connect(number, SIGNAL(newCrmacctId(int)), this, SIGNAL(newCrmacctId(int))); connect(number, SIGNAL(editable(bool)), this, SIGNAL(editable(bool))); connect(number, SIGNAL(editable(bool)), this, SLOT(sHandleEditMode(bool))); setLabel(tr("Customer #:")); setNameVisible(true); setDescriptionVisible(true); } void CustCluster::setType(CLineEdit::CLineEditTypes pType) { static_cast(_number)->setType(pType); } bool CustCluster::setEditMode(bool p) const { return static_cast(_number)->setEditMode(p); } void CustCluster::sHandleEditMode(bool p) { CLineEdit* number = static_cast(_number); if (p) connect(number, SIGNAL(editingFinished()), this, SIGNAL(editingFinished())); else disconnect(number, SIGNAL(editingFinished()), this, SIGNAL(editingFinished())); } qt-client-4.1.0/widgets/custcluster.h000066400000000000000000000056451217451700100176230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef custCluster_h #define custCluster_h #include "parameter.h" #include "widgets.h" #include "virtualCluster.h" #include "crmacctcluster.h" class QLabel; class QPushButton; class QDragEnterEvent; class QDropEvent; class QMouseEvent; class CustInfo; #define __allCustomers 0x01 #define __activeCustomers 0x02 #define CREDITSTATUS 5 #define CRMACCT_ID 6 #define ISCUSTOMER 7 class XTUPLEWIDGETS_EXPORT CLineEdit : public VirtualClusterLineEdit { Q_OBJECT Q_ENUMS(CLineEditTypes) Q_PROPERTY(CLineEditTypes type READ type WRITE setType ) friend class CustInfo; public: CLineEdit(QWidget * = 0, const char * = 0); enum CLineEditTypes { AllCustomers, ActiveCustomers, AllProspects, ActiveProspects, AllCustomersAndProspects, ActiveCustomersAndProspects }; inline CLineEditTypes type() const { return _type; } bool canOpen(); bool canEdit(); void setCanEdit(bool); bool editMode(); public slots: bool setEditMode(bool); void sNew(); void setId(const int); void setType(CLineEditTypes); protected slots: VirtualList* listFactory(); VirtualSearch* searchFactory(); void sParse(); void sUpdateMenu(); protected: QAction* _modeSep; QAction* _modeAct; signals: void newCrmacctId(int); void editable(bool); private: CLineEditTypes _type; CRMAcctLineEdit::CRMAcctSubtype _subtype; int _crmacctId; bool _canEdit; bool _editMode; }; class XTUPLEWIDGETS_EXPORT CustCluster : public VirtualCluster { Q_OBJECT Q_PROPERTY(bool canEdit READ canEdit WRITE setCanEdit ) Q_PROPERTY(CLineEdit::CLineEditTypes type READ type WRITE setType ) public: CustCluster(QWidget *parent, const char *name = 0); inline CLineEdit::CLineEditTypes type() const { return static_cast(_number)->type(); }; Q_INVOKABLE void setType(CLineEdit::CLineEditTypes); bool canEdit() const { return static_cast(_number)->canEdit(); } void setCanEdit(bool p) const { static_cast(_number)->setCanEdit(p); } Q_INVOKABLE bool editMode() { return static_cast(_number)->editMode(); } Q_INVOKABLE bool setEditMode(bool p) const; private slots: void sHandleEditMode(bool); signals: void newCrmacctId(int); void editable(bool); void editingFinished(); }; #endif qt-client-4.1.0/widgets/custinfo.h000066400000000000000000000007251217451700100170670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/widgets/customerselector.cpp000066400000000000000000000114121217451700100211650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "customerselector.h" CustomerSelector::CustomerSelector(QWidget *pParent, const char *pName) : QWidget(pParent) { setupUi(this); if (pName) setObjectName(pName); setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); _select->setCurrentIndex(All); _cust->setType(CLineEdit::AllCustomers); _cust->setId(-1); _customerTypes->setId(-1); _customerGroup->setId(-1); _customerType->setText(""); connect(_select,SIGNAL(currentIndexChanged(int)), this, SIGNAL(updated())); connect(_select,SIGNAL(currentIndexChanged(int)), this, SIGNAL(newState(int))); connect(_cust, SIGNAL(newId(int)), this, SIGNAL(updated())); connect(_cust, SIGNAL(newId(int)), this, SIGNAL(newCustId(int))); connect(_customerTypes, SIGNAL(newID(int)), this, SIGNAL(updated())); connect(_customerTypes, SIGNAL(newID(int)), this, SIGNAL(newCustTypeId(int))); connect(_customerType, SIGNAL(editingFinished()), this, SIGNAL(updated())); connect(_customerType, SIGNAL(editingFinished()), this, SLOT(sTypePatternFinished())); connect(_customerType,SIGNAL(textChanged(QString)), this, SIGNAL(newTypePattern(QString))); connect(_customerGroup, SIGNAL(newID(int)), this, SIGNAL(updated())); connect(_customerGroup, SIGNAL(newID(int)), this, SIGNAL(newCustGroupId(int))); setFocusProxy(_select); } CustomerSelector::~CustomerSelector() { } void CustomerSelector::languageChange() { retranslateUi(this); } void CustomerSelector::appendValue(ParameterList &pParams) { switch (_select->currentIndex()) { case Selected: pParams.append("cust_id", _cust->id()); break; case SelectedGroup: pParams.append("custgrp_id", _customerGroup->id()); break; case SelectedType: pParams.append("custtype_id", _customerTypes->id()); break; case TypePattern: pParams.append("custtype_pattern", _customerType->text()); break; case All: default: ; // nothing } } void CustomerSelector::bindValue(XSqlQuery &pQuery) { switch (_select->currentIndex()) { case Selected: pQuery.bindValue(":cust_id", _cust->id()); break; case SelectedGroup: pQuery.bindValue(":custgrp_id", _customerGroup->id()); break; case SelectedType: pQuery.bindValue(":custtype_id", _customerTypes->id()); break; case TypePattern: pQuery.bindValue(":custtype_pattern", _customerType->text()); break; case All: default: ; // nothing } } bool CustomerSelector::isValid() { switch (_select->currentIndex()) { case Selected: return _cust->isValid(); break; case SelectedGroup: return _customerGroup->isValid(); break; case SelectedType: return _customerTypes->isValid(); break; case TypePattern: return ! _customerType->text().trimmed().isEmpty(); break; case All: return true; break; } return false; } void CustomerSelector::setCustId(int p) { _cust->setId(p); setState(Selected); } void CustomerSelector::setCustTypeId(int p) { _customerTypes->setId(p); setState(SelectedType); } void CustomerSelector::setTypePattern(const QString &p) { _customerType->setText(p); sTypePatternFinished(); setState(TypePattern); } void CustomerSelector::setCustGroupId(int p) { _customerGroup->setId(p); setState(SelectedGroup); } void CustomerSelector::setState(enum CustomerSelectorState p) { _select->setCurrentIndex(p); } void CustomerSelector::sTypePatternFinished() { emit newTypePattern(_customerType->text()); emit updated(); } /* keep the contents of another customer group (p) synchronized with this in a manner which allows any changes on this to propagate to p and any objects listening for signals from p will respond to changes to this. hide p because it's superfluous. */ void CustomerSelector::synchronize(CustomerSelector *p) { connect(this, SIGNAL(newTypePattern(QString)), p, SLOT(setTypePattern(QString))); connect(this, SIGNAL(newState(int)), p, SLOT(setState(int))); connect(this, SIGNAL(newCustId(int)), p, SLOT(setCustId(int))); connect(this, SIGNAL(newCustTypeId(int)), p, SLOT(setCustTypeId(int))); connect(this, SIGNAL(newCustGroupId(int)), p, SLOT(setCustGroupId(int))); p->hide(); } qt-client-4.1.0/widgets/customerselector.h000066400000000000000000000052411217451700100206350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef CUSTOMERSELECTOR_H #define CUSTOMERSELECTOR_H #include "widgets.h" #include "ui_customerselector.h" class ParameterList; class XTUPLEWIDGETS_EXPORT CustomerSelector : public QWidget, public Ui::CustomerSelector { Q_OBJECT Q_ENUMS(CustomerSelectorState) Q_PROPERTY(enum CustomerSelectorState state READ state WRITE setState) public: CustomerSelector(QWidget * = 0, const char * = 0); virtual ~CustomerSelector(); virtual void synchronize(CustomerSelector*); enum CustomerSelectorState { All, Selected, SelectedGroup, SelectedType, TypePattern }; Q_INVOKABLE virtual void appendValue(ParameterList &); Q_INVOKABLE virtual void bindValue(XSqlQuery &); Q_INVOKABLE virtual QString typePattern() { return _customerType->text(); } enum CustomerSelectorState state() { return (CustomerSelectorState)_select->currentIndex(); } Q_INVOKABLE virtual int custId() { return _cust->id(); } Q_INVOKABLE virtual int custTypeId() { return _customerTypes->id(); } Q_INVOKABLE virtual int custGroupId() { return _customerGroup->id(); } Q_INVOKABLE inline bool isAll() { return _select->currentIndex() == All; } Q_INVOKABLE inline bool isSelectedCust() { return _select->currentIndex() == Selected; } Q_INVOKABLE inline bool isSelectedType() { return _select->currentIndex() == SelectedType; } Q_INVOKABLE inline bool isSelectedGroup() { return _select->currentIndex() == SelectedGroup; } Q_INVOKABLE inline bool isTypePattern() { return _select->currentIndex() == TypePattern; } Q_INVOKABLE virtual bool isValid(); public slots: virtual void setCustId(int p); virtual void setCustTypeId(int p); virtual void setCustGroupId(int p); virtual void setTypePattern(const QString &p); virtual void setState(int p) { setState((CustomerSelectorState)p); } virtual void setState(enum CustomerSelectorState p); signals: void newTypePattern(QString); void newState(int); void newCustId(int); void newCustTypeId(int); void newCustGroupId(int); void updated(); protected slots: virtual void languageChange(); virtual void sTypePatternFinished(); }; #endif qt-client-4.1.0/widgets/customerselector.ui000066400000000000000000000213341217451700100210240ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. CustomerSelector 0 0 502 84 0 QFrame::NoFrame QFrame::Raised All Customers Select Customer Group Customer Type Customer Type Pattern Qt::Vertical 20 13 0 0 0 false Qt::Horizontal Qt::Vertical 20 0 true XComboBox::CustomerGroups Qt::Vertical 20 0 true XComboBox::CustomerTypes Qt::Vertical 20 0 true Qt::Vertical 20 0 Qt::Vertical 20 0 Qt::Horizontal 13 13 CustCluster QWidget

    custcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _select currentIndexChanged(int) _selectStack setCurrentIndex(int) 112 20 265 23 qt-client-4.1.0/widgets/datecluster.cpp000066400000000000000000000525051217451700100201120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "datecluster.h" #include "dcalendarpopup.h" #include "format.h" #define DEBUG false static bool determineIfStd() { if (_x_metrics && _x_metrics->value("Application") == "Standard") { return true; } return false; } DCalendarPopup::DCalendarPopup(const QDate &date, QWidget *parent) : QWidget(parent, Qt::Popup) { _cal = new QCalendarWidget(this); _cal->setVerticalHeaderFormat(QCalendarWidget::NoVerticalHeader); _cal->setSelectedDate(date); QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setMargin(0); vbox->setSpacing(0); vbox->addWidget(_cal); connect(_cal, SIGNAL(activated(QDate)), this, SLOT(dateSelected(QDate))); connect(_cal, SIGNAL(clicked(QDate)), this, SLOT(dateSelected(QDate))); connect(_cal, SIGNAL(activated(QDate)), this, SLOT(dateSelected(QDate))); // position the center of the popup near the center of its parent if (parent) { QSize parentsize = parent->sizeHint(); QPoint parentcenter = parent->pos() + QPoint(parentsize.width() / 2, parentsize.height() / 2); parentcenter = parent->mapToGlobal(parentcenter); QRect screen = QApplication::desktop()->availableGeometry(parentcenter); QSize mysize = sizeHint(); QPoint mycenter = parentcenter; if (mycenter.x() + (mysize.width() / 2) > screen.right()) mycenter.setX(screen.right() - (mysize.width() / 2)); else if (mycenter.x() - (mysize.width() / 2) < screen.left()) mycenter.setX(screen.left() + (mysize.width() / 2)); if (mycenter.y() + (mysize.height() / 2) > screen.bottom()) mycenter.setY(screen.bottom() - (mysize.height() / 2)); else if (mycenter.y() - (mysize.height() / 2) < screen.top()) mycenter.setY(screen.top() + (mysize.height() / 2)); QPoint myorigin(mycenter.x() - mysize.width() / 2, mycenter.y() - mysize.height() / 2); move(myorigin); } _cal->setFocus(); } void DCalendarPopup::dateSelected(const QDate &pDate) { if (DEBUG) qDebug("DCalendarPopup::dateSelected(%s)", qPrintable(pDate.toString())); if (parent()) { ((XDateEdit*)parent())->checkDate(pDate); } emit newDate(pDate); close(); } /////////////////////////////////////////////////////////////////////////////// XDateEdit::XDateEdit(QWidget *parent, const char *name) : XLineEdit(parent, name) { connect(this, SIGNAL(editingFinished()), this, SLOT(parseDate())); connect(this, SIGNAL(requestList()), this, SLOT(showCalendar())); connect(this, SIGNAL(requestSearch()), this, SLOT(showCalendar())); if (parent && ! parent->objectName().isEmpty()) setObjectName(parent->objectName()); else setObjectName(metaObject()->className()); _allowNull = FALSE; _default = Empty; _parsed = FALSE; _nullString = QString::null; _valid = FALSE; _siteId = -1; } XDateEdit::~XDateEdit() { } void XDateEdit::parseDate() { QString dateString = text().trimmed(); bool isNumeric; if (DEBUG) qDebug("%s::parseDate() with dateString %s, _currentDate %s, _allowNull %d", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(dateString), qPrintable(_currentDate.toString()), _allowNull); #ifdef GUIClient_h QDate today = ofmgThis->dbDate(); #else QDate today = QDate::currentDate(); #endif if (_parsed) { if (DEBUG) qDebug("%s::parseDate() looks like we've already parsed this string", qPrintable(parent() ? parent()->objectName() : objectName())); return; } _valid = false; if (dateString.contains(QRegExp("[0-9]+[-][0-9]+"))) //user enters hyphens instead of slashes { dateString.replace("-", "/"); } if (dateString == _nullString || dateString.isEmpty()) setNull(); else if (dateString == "0") // today checkDate(today); else if (dateString.contains(QRegExp("^[+-][0-9]+"))) // offset from today { int offset = dateString.toInt(&isNumeric); if (isNumeric) checkDate(today.addDays(offset)); } else if (dateString[0] == '#') // julian day { int offset = dateString.right(dateString.length() - 1).toInt(&isNumeric); if (isNumeric) checkDate(QDate(today.year(), 1, 1).addDays(offset - 1)); } else if (dateString.contains(QRegExp("^[0-9][0-9]?$"))) // date in month { int offset = dateString.toInt(&isNumeric, 10); if (isNumeric) { if (offset > today.daysInMonth()) offset = today.daysInMonth(); checkDate(QDate(today.year(), today.month(), 1).addDays(offset - 1)); } } else // interpret with locale { QString dateFormatStr = QLocale().dateFormat(QLocale::ShortFormat); if (DEBUG) qDebug("%s::parseDate() trying to parse with %s", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(dateFormatStr)); QDate tmp = QDate::fromString(dateString, dateFormatStr); bool twodigitformat = !(dateFormatStr.indexOf(QRegExp("y{4}")) >= 0); if (tmp.isValid()) { if (twodigitformat && tmp.year() < 1950) // Qt docs say 2-digit years are 1900-based so { qDebug("%s::parseDate() found valid 2-digit year %d", qPrintable(parent() ? parent()->objectName() : objectName()), tmp.year()); tmp = tmp.addYears(100); // add backwards-compat with pre-3.0 DLineEdit qDebug("%s::parseDate() altered year to %d", qPrintable(parent() ? parent()->objectName() : objectName()), tmp.year()); } } else if (twodigitformat) { // try 4 digits, ignoring the possibility of '-literals in the format str dateFormatStr.replace(QRegExp("y{2}"), "yyyy"); if (DEBUG) qDebug("%s::parseDate() rewriting 2-digit year format string to %s", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(dateFormatStr)); tmp = QDate::fromString(dateString, dateFormatStr); if (tmp.isValid()) { if (tmp.year() < 10) tmp = tmp.addYears(today.year() - today.year() % 100); if (DEBUG) qDebug("%s::parseDate() after changing to 4-digit year, year = %d", qPrintable(parent() ? parent()->objectName() : objectName()), tmp.year()); } else if (DEBUG) qDebug("%s::parseDate() after changing to 4-digit year, date still isn't valid", qPrintable(parent() ? parent()->objectName() : objectName())); } else { // try 2 digits, ignoring the possibility of '-literals in the format str dateFormatStr.replace(QRegExp("y{4}"), "yy"); if (DEBUG) qDebug("%s::parseDate() rewriting 4-digit year format string to %s", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(dateFormatStr)); tmp = QDate::fromString(dateString, dateFormatStr); if (tmp.isValid() && tmp.year() < 1950) // Qt docs say 2-digit years are 1900-based so { qDebug("%s::parseDate() found valid 2-digit year %d", qPrintable(parent() ? parent()->objectName() : objectName()), tmp.year()); tmp = tmp.addYears(100); // add backwards-compat with pre-3.0 DLineEdit qDebug("%s::parseDate() altered year to %d", qPrintable(parent() ? parent()->objectName() : objectName()), tmp.year()); } } if(!tmp.isValid()) { // still no match -- we will decompose the format and input and // build a date based on that information QRegExp rx("(\\d+)"); QRegExp rx2("(m+|y+|d+)"); rx2.setCaseSensitivity(Qt::CaseInsensitive); QStringList numberList; QStringList formatList; int pos = 0; while ((pos = rx.indexIn(dateString, pos)) != -1) { numberList << rx.cap(1); pos += rx.matchedLength(); } pos = 0; while((pos = rx2.indexIn(dateFormatStr, pos)) != -1) { formatList << rx2.cap(1); pos += rx2.matchedLength(); } if (DEBUG) qDebug("%s::parseDate() aligning numberList %s with formatList %s", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(numberList.join(":")), qPrintable(formatList.join(":"))); // if we don't have exactly 3 and the numberList is not 2 or 3 then don't bother if(formatList.size() == 3 && (numberList.size() == 2 || numberList.size() == 3)) { int year = today.year(); int day = -1; int month = -1; pos = 0; for (int i = 0; i < formatList.size(); ++i) { QChar ch = formatList.at(i).toLower().at(0); if(ch == 'y' && numberList.size() == 3) { year = numberList.at(pos).toInt(); pos++; } else if(ch == 'm') { month = numberList.at(pos).toInt(); pos++; } else if(ch == 'd') { day = numberList.at(pos).toInt(); pos++; } } // if single digit year, move it to the current century if (year < 10) year += today.year() - today.year() % 100; if(day > 0 && month > 0 && year > 0) tmp = QDate(year, month, day); } else if(formatList.size() == 3 && numberList.size() == 1) { QString ns = numberList.at(0); bool isNumber = false; (void)ns.toInt(&isNumber); if(isNumber && (ns.length() == 6 || ns.length() == 8)) { int year = today.year(); int day = -1; int month = -1; pos = 0; for (int i = 0; i < formatList.size(); ++i) { QChar ch = formatList.at(i).toLower().at(0); if(ch == 'y') { if(ns.length() == 8) { year = ns.mid(pos, 4).toInt(); pos+=4; } else { year = ns.mid(pos, 2).toInt(&isNumber); pos+=2; if(isNumber) { if(year < 50) year += 2000; else year += 1900; } } } else if(ch == 'm') { month = ns.mid(pos, 2).toInt(); pos+=2; } else if(ch == 'd') { day = ns.mid(pos, 2).toInt(); pos+=2; } } if(day > 0 && month > 0 && year > 0) tmp = QDate(year, month, day); } } } checkDate(QDate(tmp.year(), tmp.month(), tmp.day())); } if (!_valid) setText(""); _parsed = true; } void XDateEdit::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(this, _fieldName, "date", "currentDefault"); } void XDateEdit::setNull() { if (DEBUG) qDebug("%s::setNull() with _currentDate %s, _allowNull %d", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(_currentDate.toString()), _allowNull); if (_allowNull) { _valid = TRUE; _parsed = TRUE; setText(_nullString); _currentDate = _nullDate; emit newDate(_currentDate); } else { _valid = FALSE; _parsed = TRUE; setText(""); _currentDate = QDate(); } } void XDateEdit::setDate(const QDate &pDate, bool pAnnounce) { if (DEBUG) qDebug("%s::setDate(%s, %d) with _currentDate %s, _allowNull %d", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(pDate.toString()), pAnnounce, qPrintable(_currentDate.toString()), _allowNull); if (pDate.isNull()) setNull(); else { if(!pAnnounce) { if(determineIfStd() && (_siteId != -1)) return checkDate(pDate); } else { pAnnounce = (pDate != _currentDate); } _currentDate = pDate; _valid = _currentDate.isValid(); _parsed = _valid; if (DEBUG) qDebug("%s::setDate() setting text", qPrintable(parent() ? parent()->objectName() : objectName())); if ((_allowNull) && (_currentDate == _nullDate)) setText(_nullString); else setText(formatDate(pDate)); if (DEBUG) qDebug("%s::setDate() done setting text", qPrintable(parent() ? parent()->objectName() : objectName())); } if (pAnnounce) { if (DEBUG) qDebug("%s::setDate() emitting newDate(%s)", qPrintable(parent() ? parent()->objectName() : objectName()), qPrintable(_currentDate.toString())); emit newDate(_currentDate); } } void XDateEdit::checkDate(const QDate &pDate) { QDate nextWorkDate = pDate; if(determineIfStd() && (_siteId != -1)) { XSqlQuery workday; workday.prepare("SELECT calculatenextworkingdate(:whsid, :date, :desired) AS result;"); workday.bindValue(":whsid", _siteId); workday.bindValue(":date", pDate); workday.bindValue(":desired", 0); workday.exec(); if (workday.first()) nextWorkDate = workday.value("result").toDate(); else if (workday.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("No work week calendar found"), tr("

    The selected Site has no work week defined. " "Please go to Schedule Setup and define " "the working days for this site.")); return; } } if (nextWorkDate == pDate) setDate(pDate, TRUE); else { if (QMessageBox::question(this, tr("Non-Working Day Entered"), tr("

    The selected date is not a working " "day for the Site selected. Do you want to " "automatically select the next working day?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) setDate(nextWorkDate, TRUE); else setDate(pDate, TRUE); } } void XDateEdit::clear() { if (DEBUG) qDebug("%s::clear()", qPrintable(parent() ? parent()->objectName() : objectName())); setDate(_nullDate, true); } QDate XDateEdit::currentDefault() { XSqlQuery query; if (_default==Empty) return _nullDate; else if (_default==Current) { query.exec("SELECT current_date AS result;"); if (query.first()) return query.value("result").toDate(); } return date(); } QDate XDateEdit::date() { if (DEBUG) qDebug("%s::date()", qPrintable(parent() ? parent()->objectName() : objectName())); if (!_parsed) parseDate(); if (!_valid) return _nullDate; return _currentDate; } bool XDateEdit::isNull() { if (DEBUG) qDebug("%s::isNull()", qPrintable(parent() ? parent()->objectName() : objectName())); if (!_parsed) parseDate(); return date().isNull(); } bool XDateEdit::isValid() { if (DEBUG) qDebug("%s::isValid()", qPrintable(parent() ? parent()->objectName() : objectName())); if (!_parsed) parseDate(); return _valid; } void XDateEdit::showCalendar() { if (DEBUG) qDebug("%s::showCalendar()", qPrintable(parent() ? parent()->objectName() : objectName())); QDate d = date(); if(d.isNull() || d == _nullDate) d = QDate::currentDate(); DCalendarPopup *cal = new DCalendarPopup(d, this); connect(cal, SIGNAL(newDate(const QDate &)), this, SIGNAL(newDate(const QDate &))); cal->show(); } /////////////////////////////////////////////////////////////////////////////// DLineEdit::DLineEdit(QWidget *parent, const char *name) : QWidget(parent) { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); setFocusPolicy(Qt::StrongFocus); setMaximumWidth(200); setObjectName(name); QHBoxLayout *hbox = new QHBoxLayout(this); hbox->addWidget(&_lineedit); hbox->addWidget(&_calbutton); hbox->setSpacing(1); hbox->setMargin(0); QPixmap pixmap(":/widgets/images/calendar_24.png"); _calbutton.setIconSize(QSize(24,24)); _calbutton.setIcon(QIcon(pixmap)); _calbutton.setFlat(true); _calbutton.setMaximumSize(pixmap.size()); _calbutton.setFocusPolicy(Qt::NoFocus); connect(&_calbutton, SIGNAL(clicked()), &_lineedit, SLOT(showCalendar())); connect(&_lineedit, SIGNAL(editingFinished()), &_lineedit, SLOT(parseDate())); connect(&_lineedit,SIGNAL(newDate(const QDate &)), this, SIGNAL(newDate(const QDate &))); setFocusProxy(&_lineedit); } /*! Sets the date on the cluster to \a p where \a b flags whether to emit the newDate signal. Specifically designed to work in a scripted environment where java script dates are passed as a QVariant. */ void DLineEdit::setDate(const QVariant &p, bool b) { _lineedit.setDate(p.toDate(), b); } void DLineEdit::setEnabled(const bool p) { QWidget::setEnabled(p); _lineedit.setEnabled(p); _calbutton.setEnabled(p); } QString DLineEdit::toISOString() { QDate mydate = _lineedit.date(); return mydate.toString(Qt::ISODate); } DateCluster::DateCluster(QWidget *pParent, const char *pName) : QWidget(pParent) { if(pName) setObjectName(pName); QSizePolicy tsizePolicy(static_cast(0), static_cast(0)); tsizePolicy.setHorizontalStretch(0); tsizePolicy.setVerticalStretch(0); tsizePolicy.setHeightForWidth(sizePolicy().hasHeightForWidth()); setSizePolicy(tsizePolicy); QHBoxLayout *mainLayout = new QHBoxLayout(this); mainLayout->setSpacing(5); mainLayout->setMargin(0); mainLayout->setObjectName(QString::fromUtf8("mainLayout")); QVBoxLayout *literalLayout = new QVBoxLayout(); literalLayout->setSpacing(5); literalLayout->setMargin(0); literalLayout->setObjectName(QString::fromUtf8("literalLayout")); _startDateLit = new QLabel(tr("Start Date:"), this); _startDateLit->setObjectName("_startDateLit"); _startDateLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); literalLayout->addWidget(_startDateLit); _endDateLit = new QLabel(tr("End Date:"), this); _endDateLit->setObjectName("_endDateLit"); _endDateLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); literalLayout->addWidget(_endDateLit); mainLayout->addLayout(literalLayout); QVBoxLayout *dataLayout = new QVBoxLayout(); dataLayout->setSpacing(5); dataLayout->setMargin(0); dataLayout->setObjectName(QString::fromUtf8("dataLayout")); _startDate = new DLineEdit(this); _startDate->setObjectName("_startDate"); dataLayout->addWidget(_startDate); _endDate = new DLineEdit(this); _endDate->setObjectName("_endDate"); dataLayout->addWidget(_endDate); mainLayout->addLayout(dataLayout); _startDateLit->setBuddy(_startDate); _endDateLit->setBuddy(_endDate); connect(_startDate, SIGNAL(newDate(const QDate &)), this, SIGNAL(updated())); connect(_endDate, SIGNAL(newDate(const QDate &)), this, SIGNAL(updated())); //setTabOrder(_startDate, _endDate); //setTabOrder(_endDate, _startDate); setFocusProxy(_startDate); } /*! Sets the start date on the cluster to \a pDate. Specifically designed to work in a scripted environment where java script dates are passed as a QVariant. */ void DateCluster::setStartDate(const QVariant &pDate) { _startDate->setDate(pDate.toDate()); } /*! Sets the end date on the cluster to \a pDate. Specifically designed to work in a scripted environment where java script dates are passed as a QVariant. */ void DateCluster::setEndDate(const QVariant &pDate) { _endDate->setDate(pDate.toDate()); } void DateCluster::setStartNull(const QString &pString, const QDate &pDate, bool pSetNull) { _startDate->setAllowNullDate(TRUE); _startDate->setNullString(pString); _startDate->setNullDate(pDate); if (pSetNull) _startDate->setNull(); } void DateCluster::setEndNull(const QString &pString, const QDate &pDate, bool pSetNull) { _endDate->setAllowNullDate(TRUE); _endDate->setNullString(pString); _endDate->setNullDate(pDate); if (pSetNull) _endDate->setNull(); } void DateCluster::setStartCaption(const QString &pString) { _startDateLit->setText(pString); } void DateCluster::setEndCaption(const QString &pString) { _endDateLit->setText(pString); } void DateCluster::appendValue(ParameterList &pParams) { pParams.append("startDate", _startDate->date()); pParams.append("endDate", _endDate->date()); } void DateCluster::bindValue(XSqlQuery &pQuery) { pQuery.bindValue(":startDate", _startDate->date()); pQuery.bindValue(":endDate", _endDate->date()); } void DateCluster::setStartVisible(bool p) { _startDate->setVisible(p); _startDateLit->setVisible(p); } void DateCluster::setEndVisible(bool p) { _endDate->setVisible(p); _endDateLit->setVisible(p); } qt-client-4.1.0/widgets/datecluster.h000066400000000000000000000145531217451700100175600ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef datecluster_h #define datecluster_h #include #include #include #include #include "xdatawidgetmapper.h" #include "xlineedit.h" class ParameterList; class QFocusEvent; class XSqlQuery; class XDateEdit : public XLineEdit { Q_OBJECT Q_ENUMS (Defaults) Q_PROPERTY(QDate date READ date WRITE setDate) Q_PROPERTY(Defaults defaultDate READ defaultDate WRITE setDefaultDate) Q_PROPERTY(QDate currentDefault READ currentDefault) Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) public: XDateEdit(QWidget *parent = 0, const char * = 0); virtual ~XDateEdit(); enum Defaults { Empty, Current, None }; virtual bool isNull(); virtual bool isValid(); virtual int calendarSiteId() { return _siteId; } virtual Defaults defaultDate() { return _default;} virtual QDate currentDefault(); virtual QDate date(); virtual QString fieldName() const { return _fieldName; } virtual void clear(); inline void setAllowNullDate(bool pAllowNull) { _allowNull = pAllowNull; } inline void setNullString(const QString &pNullString) { _nullString = pNullString;} inline void setNullDate(const QDate &pNullDate) { _nullDate = pNullDate; } inline void setCalendarSiteId(int siteId) { _siteId = siteId; } public slots: virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setFieldName(QString p) { _fieldName = p; } void setNull(); void setDate(const QDate &, bool = false); void setDefaultDate(Defaults p) { _default = p; } void parseDate(); void showCalendar(); void checkDate(const QDate &); signals: void newDate(const QDate &); private: bool fixMonthEnd(int *, int, int); bool _allowNull; enum Defaults _default; QDate _currentDate; QDate _nullDate; QString _fieldName; QString _nullString; int _siteId; }; class XTUPLEWIDGETS_EXPORT DLineEdit : public QWidget { Q_OBJECT Q_ENUMS(XDateEdit::Defaults) Q_PROPERTY(QDate date READ date WRITE setDate) Q_PROPERTY(XDateEdit::Defaults defaultDate READ defaultDate WRITE setDefaultDate) Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) public: DLineEdit(QWidget *parent = 0, const char * = 0); Q_INVOKABLE inline void setAllowNullDate(bool p) { _lineedit.setAllowNullDate(p); } Q_INVOKABLE inline void setNullString(const QString &p){ _lineedit.setNullString(p); } Q_INVOKABLE inline void setNullDate(const QDate &p) { _lineedit.setNullDate(p); } Q_INVOKABLE inline void setCalendarSiteId(int siteId) { _lineedit.setCalendarSiteId(siteId); } Q_INVOKABLE void setDate(const QVariant &p, bool b = false); Q_INVOKABLE virtual bool isNull() { return _lineedit.isNull(); } Q_INVOKABLE virtual bool isValid() { return _lineedit.isValid(); } Q_INVOKABLE virtual int calendarSiteId() { return _lineedit.calendarSiteId(); } virtual XDateEdit::Defaults defaultDate() { return _lineedit.defaultDate(); } virtual QDate date() { return _lineedit.date(); } virtual QString fieldName() const { return _lineedit.fieldName(); } Q_INVOKABLE virtual void clear() { _lineedit.clear(); } public slots: virtual void setDataWidgetMap(XDataWidgetMapper* m) { _lineedit.setDataWidgetMap(m); } virtual void setDefaultDate(XDateEdit::Defaults p) { _lineedit.setDefaultDate(p); } virtual void setEnabled(const bool); virtual void setFieldName(QString p) { _lineedit.setFieldName(p); } void setDate(const QDate &p, bool b = false) { _lineedit.setDate(p, b); } void setNull() { _lineedit.setNull(); } void showCalendar() { _lineedit.showCalendar(); } QString toISOString(); signals: void newDate(const QDate &); private: QPushButton _calbutton; XDateEdit _lineedit; }; class XTUPLEWIDGETS_EXPORT DateCluster : public QWidget { Q_OBJECT Q_PROPERTY(QDate startDate READ startDate WRITE setStartDate) Q_PROPERTY(QDate endDate READ endDate WRITE setEndDate) public: DateCluster(QWidget *, const char * = 0); Q_INVOKABLE void setStartNull(const QString &, const QDate &, bool); Q_INVOKABLE void setEndNull(const QString &, const QDate &, bool); Q_INVOKABLE void appendValue(ParameterList &); void bindValue(XSqlQuery &); inline QDate startDate() { return _startDate->date(); } inline QDate endDate() { return _endDate->date(); } inline void setStartDate(const QDate &pDate) { _startDate->setDate(pDate); } inline void setEndDate(const QDate &pDate) { _endDate->setDate(pDate); } Q_INVOKABLE void setStartDate(const QVariant &pDate); Q_INVOKABLE void setEndDate(const QVariant &pDate); Q_INVOKABLE inline bool allValid() { return ((_startDate->isValid()) && (_endDate->isValid())); } Q_INVOKABLE void setStartCaption(const QString &); Q_INVOKABLE void setEndCaption(const QString &); Q_INVOKABLE bool startVisible() const { return _startDate->isVisible(); } Q_INVOKABLE bool endVisible() const { return _endDate->isVisible(); } public slots: void setStartVisible(bool p); void setEndVisible(bool p); signals: void updated(); protected: DLineEdit *_startDate; DLineEdit *_endDate; private: QLabel *_startDateLit; QLabel *_endDateLit; QString _fieldNameStart; QString _fieldNameEnd; }; #endif qt-client-4.1.0/widgets/dcalendarpopup.h000066400000000000000000000014641217451700100202370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef dcalendarpopup_h #define dcalendarpopup_h #include #include #include class DCalendarPopup : public QWidget { Q_OBJECT public: DCalendarPopup(const QDate&, QWidget* = 0); public slots: void dateSelected(const QDate &); signals: void newDate(const QDate &); private: QCalendarWidget *_cal; }; #endif qt-client-4.1.0/widgets/deptCluster.cpp000066400000000000000000000017351217451700100200700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "deptcluster.h" DeptCluster::DeptCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new DeptClusterLineEdit(this, pName)); _name->show(); } DeptClusterLineEdit::DeptClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "dept", "dept_id", "dept_number", "dept_name", 0, 0, pName) { setTitles(tr("Department"), tr("Departments")); setUiName("department"); setEditPriv("MaintainDepartments"); setViewPriv("ViewDepartments"); } qt-client-4.1.0/widgets/deptcluster.h000066400000000000000000000015031217451700100175660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _deptCluster_h #define _deptCluster_h #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT DeptClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: DeptClusterLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT DeptCluster : public VirtualCluster { Q_OBJECT public: DeptCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/dlineedit.h000066400000000000000000000007251217451700100171760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/widgets/dll.pro000066400000000000000000000001431217451700100163530ustar00rootroot00000000000000# # Compile the widgets project as a Qt Designer DLL # CONFIG += dynamic include( widgets.pro ) qt-client-4.1.0/widgets/docAttach.cpp000066400000000000000000000327131217451700100174640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "documents.h" #include "docAttach.h" #include "../common/shortcuts.h" #include "imageview.h" /* * Constructs a docAttach as a child of 'parent', with the * name 'name' and widget flags set to 'f'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. * * This screen will receive the source type and id from the calling screen. * Then the user will select a target type and id on this screen. * When the user clicks Save, a new row will be entered into docass and * the screen will return a docass_id to the calling screen. */ docAttach::docAttach(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, fl) { setupUi(this); setObjectName(name ? name : "docAttach"); setModal(modal); // signals and slots connections _save = _buttonBox->button(QDialogButtonBox::Save); _save->setEnabled(false); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); connect(_docType, SIGNAL(currentIndexChanged(int)), this, SLOT(sHandleButtons())); connect(_fileList, SIGNAL(clicked()), this, SLOT(sFileList())); _source = -1; _sourceid = -1; _targetid = -1; _urlid = -1; _mode = "new"; _po->setAllowedTypes(OrderLineEdit::Purchase); _so->setAllowedTypes(OrderLineEdit::Sales); #ifndef Q_WS_MAC _fileList->setMaximumWidth(25); #else _fileList->setMinimumWidth(60); _fileList->setMinimumHeight(32); #endif shortcuts::setStandardKeys(this); adjustSize(); } /* * Destroys the object and frees any allocated resources */ docAttach::~docAttach() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void docAttach::languageChange() { retranslateUi(this); } void docAttach::set(const ParameterList &pParams) { QVariant param; bool valid; //source type from document widget param = pParams.value("sourceType", &valid); if (valid) _source = (enum Documents::DocumentSources)param.toInt(); //source id from document widget param = pParams.value("source_id", &valid); if (valid) _sourceid = param.toInt(); // Only urls are editable param = pParams.value("url_id", &valid); if(valid) { XSqlQuery qry; _urlid = param.toInt(); qry.prepare("SELECT url_source, url_source_id, url_title, url_url, url_stream " " FROM url" " WHERE (url_id=:url_id);" ); qry.bindValue(":url_id", _urlid); qry.exec(); if(qry.first()) { setWindowTitle(tr("Edit Attachment Link")); QUrl url(qry.value("url_url").toString()); if (url.scheme().isEmpty()) url.setScheme("file"); _url->setText(url.toString()); if (url.scheme() == "file") { _docType->setCurrentIndex(5); _filetitle->setText(qry.value("url_title").toString()); _file->setText(url.toString()); if (qry.value("url_stream").toString().length()) { _fileList->setEnabled(false); _file->setEnabled(false); _saveDbCheck->setEnabled(false); } } else { _docType->setCurrentIndex(14); _urltitle->setText(qry.value("url_title").toString()); _url->setText(url.toString()); } _mode = "edit"; _docType->setEnabled(false); } } } void docAttach::sHandleButtons() { _save->disconnect(); _docAttachPurpose->setEnabled(true); if (_docType->currentIndex() == 1) { connect(_cntct, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_cntct->isValid()); } else if (_docType->currentIndex() == 2) { connect(_crmacct, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_crmacct->isValid()); } else if (_docType->currentIndex() == 3) { connect(_cust, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_cust->isValid()); } else if (_docType->currentIndex() == 4) { connect(_emp, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_emp->isValid()); } else if (_docType->currentIndex() == 5) { _docAttachPurpose->setEnabled(false); _docAttachPurpose->setCurrentIndex(0); _save->setEnabled(true); } else if (_docType->currentIndex() == 6) { connect(_img, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_img->isValid()); } else if (_docType->currentIndex() == 7) { connect(_incdt, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_incdt->isValid()); } else if (_docType->currentIndex() == 8) { connect(_item, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_item->isValid()); } else if (_docType->currentIndex() == 9) { connect(_opp, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_opp->isValid()); } else if (_docType->currentIndex() == 10) { connect(_proj, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_proj->isValid()); } else if (_docType->currentIndex() == 11) { connect(_po, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_po->isValid()); } else if (_docType->currentIndex() == 12) { connect(_so, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_so->isValid()); } else if (_docType->currentIndex() == 13) { connect(_vend, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_vend->isValid()); } else if (_docType->currentIndex() == 14) { _docAttachPurpose->setEnabled(false); _docAttachPurpose->setCurrentIndex(0); _save->setEnabled(true); } else if (_docType->currentIndex() == 15) { connect(_wo, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); _save->setEnabled(_wo->isValid()); } else return; connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); } void docAttach::sSave() { XSqlQuery newDocass; QString title; QUrl url; //set the purpose if (_docAttachPurpose->currentIndex() == 0) _purpose = "S"; else if (_docAttachPurpose->currentIndex() == 1) _purpose = "A"; else if (_docAttachPurpose->currentIndex() == 2) _purpose = "C"; else if (_docAttachPurpose->currentIndex() == 3) _purpose = "D"; //if then series, type derived from the stack index. e.g. if (_docType->currentIndex() == 1) { _targettype = "T"; _targetid = _cntct->id(); } else if (_docType->currentIndex() == 2) { _targettype = "CRMA"; _targetid = _crmacct->id(); } else if (_docType->currentIndex() == 3) { _targettype = "C"; _targetid = _cust->id(); } else if (_docType->currentIndex() == 4) { _targettype = "EMP"; _targetid = _emp->id(); } else if (_docType->currentIndex() == 5) { if(_file->text().trimmed().isEmpty()) { QMessageBox::warning( this, tr("Must Specify file"), tr("You must specify a file before you may save.") ); return; } _targettype = "URL"; title = _filetitle->text(); url = QUrl(_file->text()); if (url.scheme().isEmpty()) url.setScheme("file"); } else if (_docType->currentIndex() == 6) { _targettype = "IMG"; _targetid = _img->id(); } else if (_docType->currentIndex() == 7) { _targettype = "INCDT"; _targetid = _incdt->id(); } else if (_docType->currentIndex() == 8) { _targettype = "I"; _targetid = _item->id(); } else if (_docType->currentIndex() == 9) { _targettype = "OPP"; _targetid = _opp->id(); } else if (_docType->currentIndex() == 10) { _targettype = "J"; _targetid = _proj->id(); } else if (_docType->currentIndex() == 11) { _targettype = "P"; _targetid = _po->id(); } else if (_docType->currentIndex() == 12) { _targettype = "S"; _targetid = _so->id(); } else if (_docType->currentIndex() == 13) { _targettype = "V"; _targetid = _vend->id(); } else if (_docType->currentIndex() == 14) { if(_url->text().trimmed().isEmpty()) { QMessageBox::warning( this, tr("Must Specify file"), tr("You must specify a file before you may save.") ); return; } _targettype = "URL"; title = _urltitle->text(); url = QUrl(_url->text()); if (url.scheme().isEmpty()) url.setScheme("http"); } else if (_docType->currentIndex() == 15) { _targettype = "W"; _targetid = _wo->id(); } if (_targettype == "IMG") { // First determine if the id is in the image table, and not one of it's inherited versions // if it is not then we will create a copy in the image table to keep the FK's working XSqlQuery qq; qq.prepare("SELECT image_id FROM ONLY image WHERE image_id=:image_id"); qq.bindValue(":image_id", _targetid); if(qq.exec() && !qq.first()) { qq.exec("SELECT nextval(('\"image_image_id_seq\"'::text)::regclass) AS newid;"); if(qq.first()) { int newid = qq.value("newid").toInt(); qq.prepare("INSERT INTO image (image_id, image_name, image_descrip, image_data) " "SELECT :newid, image_name, image_descrip, image_data" " FROM image WHERE image_id=:image_id;"); qq.bindValue(":newid", newid); qq.bindValue(":image_id", _targetid); if(qq.exec()) _targetid = newid; } } // For now images are handled differently because of legacy structures... newDocass.prepare( "INSERT INTO imageass " "( imageass_source, imageass_source_id, imageass_image_id, imageass_purpose ) " "VALUES " "( :docass_source_type, :docass_source_id, :docass_target_id, :docass_purpose );" ); } else if (_targettype == "URL") { if(!url.isValid()) { QMessageBox::warning( this, tr("Must Specify valid path"), tr("You must specify a path before you may save.") ); return; } QByteArray bytarr; QFileInfo fi(url.toLocalFile()); if(_saveDbCheck->isChecked() && (url.scheme()=="file") && (_mode == "new")) { if (!fi.exists()) { QMessageBox::warning( this, tr("File Error"), tr("File %1 was not found and will not be saved.").arg(url.toLocalFile())); return; } QFile sourceFile(url.toLocalFile()); if (!sourceFile.open(QIODevice::ReadOnly)) { QMessageBox::warning( this, tr("File Open Error"), tr("Could not open source file %1 for read.") .arg(url.toLocalFile())); return; } bytarr = sourceFile.readAll(); url.setPath(fi.fileName().remove(" ")); url.setScheme(""); } // TODO: replace use of URL view if (_mode == "new" && bytarr.isNull()) newDocass.prepare( "INSERT INTO url " "( url_source, url_source_id, url_title, url_url, url_stream ) " "VALUES " "( :docass_source_type, :docass_source_id, :title, :url, :stream );" ); else if (_mode == "new") newDocass.prepare( "INSERT INTO url " "( url_source, url_source_id, url_title, url_url, url_stream ) " "VALUES " "( :docass_source_type, :docass_source_id, :title, :url, E:stream );" ); else newDocass.prepare( "UPDATE url SET " " url_title = :title, " " url_url = :url " "WHERE (url_id=:url_id);" ); newDocass.bindValue(":url_id", _urlid); newDocass.bindValue(":title", title); newDocass.bindValue(":url", url.toString()); newDocass.bindValue(":stream", bytarr); } else { newDocass.prepare( "INSERT INTO docass " "( docass_source_type, docass_source_id, docass_target_type, docass_target_id, docass_purpose ) " "VALUES " "( :docass_source_type, :docass_source_id, :docass_target_type, :docass_target_id, :docass_purpose );" ); newDocass.bindValue(":docass_target_type", _targettype); } if (_targettype == Documents::_documentMap[_source].ident && _targetid == _sourceid) { QMessageBox::critical(this,tr("Invalid Selection"), tr("You may not attach a document to itself.")); return; } newDocass.bindValue(":docass_source_type", Documents::_documentMap[_source].ident); newDocass.bindValue(":docass_source_id", _sourceid); newDocass.bindValue(":docass_target_id", _targetid); newDocass.bindValue(":docass_purpose", _purpose); newDocass.exec(); accept(); } void docAttach::sFileList() { _file->setText(QString("file:%1").arg(QFileDialog::getOpenFileName( this, tr("Select File"), QString::null))); if (!_filetitle->text().length()) { QFileInfo fi = QFileInfo(_file->text()); _filetitle->setText(fi.fileName()); } } qt-client-4.1.0/widgets/docAttach.h000066400000000000000000000021651217451700100171270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef DOCATTACH_H #define DOCATTACH_H #include "documents.h" #include "ui_docAttach.h" class docAttach : public QDialog, public Ui::docAttach { Q_OBJECT public: docAttach(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~docAttach(); QPushButton* _save; public slots: virtual void set( const ParameterList & pParams ); virtual void sFileList(); virtual void sHandleButtons(); virtual void sSave(); protected slots: virtual void languageChange(); private: int _sourceid; int _source; int _targetid; int _urlid; QString _targettype; QString _purpose; QString _mode; }; #endif // docAttach_H qt-client-4.1.0/widgets/docAttach.ui000066400000000000000000000745641217451700100173310ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. docAttach 0 0 446 294 Attach a Document Related to Parent of Child of Duplicate of [Select] Contact CRM Account Customer Employee File Image Incident Item Opportunity Project Purchase Order Sales Order Vendor Web Site Work Order Qt::Horizontal 0 20 Qt::Vertical 20 0 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save Qt::Vertical 20 0 0 1 Document 0 No Selection Qt::AlignCenter CRM Account: Qt::Vertical 20 0 Qt::Horizontal 0 20 Qt::Vertical 20 0 Qt::Horizontal 0 20 Employee: Qt::Vertical 20 0 Qt::Horizontal 0 20 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter File: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter File: ... 6 Qt::Horizontal 40 20 Save to Database Qt::Vertical 20 13 Image: Incident: Qt::Vertical 20 0 Qt::Horizontal 0 20 Qt::Vertical 20 0 Qt::Horizontal 0 20 Opportunity: Qt::Vertical 20 0 Qt::Horizontal 0 20 Project: Qt::Vertical 20 0 Qt::Horizontal 0 20 Purchase Order #: Qt::Vertical 20 0 Qt::Horizontal 0 20 Sales Order #: Qt::Vertical 20 0 Qt::Horizontal 0 20 Vendor #: false Qt::Vertical 20 0 Qt::Horizontal 0 20 Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter URL: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter http: Qt::Vertical 20 13 Qt::Vertical 20 0 Qt::Horizontal 0 20 ContactCluster QWidget

    contactcluster.h
    CRMAcctCluster QWidget
    crmacctcluster.h
    CustCluster QWidget
    custcluster.h
    EmpCluster QWidget
    empcluster.h
    ImageCluster QWidget
    imagecluster.h
    IncidentCluster QWidget
    incidentcluster.h
    ItemCluster QWidget
    itemcluster.h
    1
    OrderCluster QWidget
    ordercluster.h
    OpportunityCluster QWidget
    opportunitycluster.h
    ProjectCluster QWidget
    projectcluster.h
    VendorCluster QWidget
    vendorcluster.h
    WoCluster QWidget
    wocluster.h
    XCheckBox QCheckBox
    xcheckbox.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _docType currentIndexChanged(int) _documentsStack setCurrentIndex(int) 194 64 248 242 qt-client-4.1.0/widgets/documents.cpp000066400000000000000000000451711217451700100175750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "mqlutil.h" #include "documents.h" #include "errorReporter.h" #include "imageview.h" #include "imageAssignment.h" #include "docAttach.h" // CAUTION: This will break if the order of this list does not match // the order of the enumerated values as defined. const Documents::DocumentMap Documents::_documentMap[] = { DocumentMap( Uninitialized, " " ), DocumentMap( Address, "ADDR"), DocumentMap( BBOMHead, "BBH" ), DocumentMap( BBOMItem, "BBI" ), DocumentMap( BOMHead, "BMH" ), DocumentMap( BOMItem, "BMI" ), DocumentMap( BOOHead, "BOH" ), DocumentMap( BOOItem, "BOI" ), DocumentMap( CRMAccount, "CRMA", "crmacct_id", "crmaccount" ), DocumentMap( Contact, "T", "cntct_id", "contact" ), DocumentMap( Contract, "CNTR", "contrct_id", "contrct" ), DocumentMap( Customer, "C", "cust_id", "customer" ), DocumentMap( Employee, "EMP", "emp_id", "employee" ), DocumentMap( Incident, "INCDT", "incdt_id", "incident" ), DocumentMap( Item, "I", "item_id", "item" ), DocumentMap( ItemSite, "IS" ), DocumentMap( ItemSource, "IR" ), DocumentMap( Location, "L" ), DocumentMap( LotSerial, "LS" ), DocumentMap( Opportunity, "OPP", "ophead_id", "opportunity" ), DocumentMap( Project, "J", "prj_id", "project" ), DocumentMap( PurchaseOrder, "P", "pohead_id", "purchaseOrder" ), DocumentMap( PurchaseOrderItem, "PI" ), DocumentMap( ReturnAuth, "RA" ), DocumentMap( ReturnAuthItem, "RI" ), DocumentMap( Quote, "Q", "quhead_id", "salesOrder" ), DocumentMap( QuoteItem, "QI" ), DocumentMap( SalesOrder, "S", "sohead_id", "salesOrder" ), DocumentMap( SalesOrderItem, "SI" ), DocumentMap( TimeExpense, "TE" ), DocumentMap( Todo, "TODO", "todoitem_id", "todoItem" ), DocumentMap( TransferOrder, "TO" ), DocumentMap( TransferOrderItem, "TI" ), DocumentMap( Vendor, "V", "vend_id", "vendor" ), DocumentMap( Warehouse, "WH" ), DocumentMap( WorkOrder, "W", "wo_id", "workOrder" ), }; GuiClientInterface* Documents::_guiClientInterface = 0; Documents::Documents(QWidget *pParent) : QWidget(pParent) { setupUi(this); _source = Uninitialized; _sourceid = -1; _readOnly = false; _doc->addColumn(tr("Type"), _itemColumn, Qt::AlignLeft, true, "target_type" ); _doc->addColumn(tr("Number"), _itemColumn, Qt::AlignLeft, true, "target_number" ); _doc->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "name" ); _doc->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); _doc->addColumn(tr("Relationship"), _itemColumn, Qt::AlignLeft,true, "purpose"); _doc->addColumn(tr("Can View"), _ynColumn, Qt::AlignCenter, false, "canview"); _doc->addColumn(tr("Can Edit"), _ynColumn, Qt::AlignCenter, false, "canedit"); connect(_attachDoc, SIGNAL(clicked()), this, SLOT(sAttachDoc())); connect(_editDoc, SIGNAL(clicked()), this, SLOT(sEditDoc())); connect(_viewDoc, SIGNAL(clicked()), this, SLOT(sViewDoc())); connect(_detachDoc, SIGNAL(clicked()), this, SLOT(sDetachDoc())); connect(_doc, SIGNAL(valid(bool)), this, SLOT(handleSelection())); connect(_doc, SIGNAL(itemSelected(int)), this, SLOT(handleItemSelected())); handleSelection(); if (_x_privileges) { QMenu * newDocMenu = new QMenu; QAction* imgAct = new QAction(tr("Image"), this); imgAct->setEnabled(_x_privileges->check("MaintainImages")); connect(imgAct, SIGNAL(triggered()), this, SLOT(sNewImage())); newDocMenu->addAction(imgAct); QAction* incdtAct = new QAction(tr("Incident"), this); incdtAct->setEnabled(_x_privileges->check("MaintainPersonalIncidents") || _x_privileges->check("MaintainAllIncidents")); connect(incdtAct, SIGNAL(triggered()), this, SLOT(sNewIncdt())); newDocMenu->addAction(incdtAct); QAction* todoAct = new QAction(tr("To Do"), this); todoAct->setEnabled(_x_privileges->check("MaintainPersonalToDoItems") || _x_privileges->check("MaintainAllToDoItems")); connect(todoAct, SIGNAL(triggered()), this, SLOT(sNewToDo())); newDocMenu->addAction(todoAct); QAction* oppAct = new QAction(tr("Opportunity"), this); oppAct->setEnabled(_x_privileges->check("MaintainPersonalOpportunities") || _x_privileges->check("MaintainAllOpportunities")); connect(oppAct, SIGNAL(triggered()), this, SLOT(sNewOpp())); newDocMenu->addAction(oppAct); QAction* projAct = new QAction(tr("Project"), this); projAct->setEnabled(_x_privileges->check("MaintainPersonalProjects") || _x_privileges->check("MaintainAllProjects")); connect(projAct, SIGNAL(triggered()), this, SLOT(sNewProj())); newDocMenu->addAction(projAct); _newDoc->setMenu(newDocMenu); } } void Documents::setType(enum DocumentSources pSource) { _source = pSource; } void Documents::setId(int pSourceid) { _sourceid = pSourceid; refresh(); } void Documents::setReadOnly(bool pReadOnly) { _readOnly = pReadOnly; _newDoc->setEnabled(!pReadOnly); _attachDoc->setEnabled(!pReadOnly); _editDoc->setEnabled(!pReadOnly); _detachDoc->setEnabled(!pReadOnly); handleSelection(); } void Documents::sNewDoc(QString type, QString ui) { ParameterList params; params.append("mode", "new"); int target_id; QDialog* newdlg = qobject_cast(_guiClientInterface->openWindow(ui, params, parentWidget(),Qt::WindowModal, Qt::Dialog)); target_id = newdlg->exec(); if (target_id != QDialog::Rejected) sInsertDocass(type, target_id); refresh(); } void Documents::sNewImage() { ParameterList params; params.append("sourceType", _source); params.append("source_id", _sourceid); imageAssignment newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) refresh(); } void Documents::sNewIncdt() { sNewDoc("INCDT","incident"); } void Documents::sNewToDo() { sNewDoc("TODO", "todoItem"); } void Documents::sNewProj() { sNewDoc("J", "project"); } void Documents::sNewOpp() { sNewDoc("OPP","opportunity"); } void Documents::sInsertDocass(QString target_type, int target_id) { XSqlQuery ins; ins.prepare("INSERT INTO docass ( docass_source_id, docass_source_type, docass_target_id, docass_target_type )" " VALUES ( :sourceid, :sourcetype::text, :targetid, :targettype); "); ins.bindValue(":sourceid", _sourceid); ins.bindValue(":sourcetype", _documentMap[_source].ident); ins.bindValue(":targetid", target_id); ins.bindValue(":targettype", target_type); ins.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Attachment Error"), ins, __FILE__, __LINE__); } void Documents::sEditDoc() { sOpenDoc("edit"); } void Documents::sOpenDoc(QString mode) { QString ui; QString docType = _doc->currentItem()->rawValue("target_type").toString(); int targetid = _doc->currentItem()->id("target_number"); ParameterList params; if (docType == "Q" && mode == "view") params.append("mode", "viewQuote"); else if (docType == "Q" && mode == "edit") params.append("mode", "editQuote"); else params.append("mode", mode); // TODO: image -- change to use docass instead of imageass if (docType == "IMG") { XSqlQuery img; img.prepare("SELECT imageass_image_id " "FROM imageass " "WHERE (imageass_id=:imageass_id); "); img.bindValue(":imageass_id", _doc->id()); img.exec(); img.first(); if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Image Info"), img, __FILE__, __LINE__)) return; params.append("image_id", img.value("imageass_image_id").toInt()); imageview newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) refresh(); return; } // TODO: url -- change to use docass instead of url // TODO: separate URL from FILE handling and replace use of url view else if (docType == "URL" || docType == "FILE") { if (mode == "edit") { ParameterList params; params.append("url_id", targetid); docAttach newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); refresh(); return; } XSqlQuery qfile; qfile.prepare("SELECT url_id, url_source_id, url_source, url_title, url_url, url_stream" " FROM url" " WHERE (url_id=:url_id);"); qfile.bindValue(":url_id", _doc->id()); qfile.exec(); // If file is in the database, copy to a temp. directory in the file system and open it. if (qfile.first() && (docType == "FILE")) { QFileInfo fi( qfile.value("url_url").toString() ); QDir tdir; // TODO: QDesktopServices::openUrl(urldb) on windows does not open files // containing spaces. why not? #ifdef Q_WS_WIN QString fileName = fi.fileName().remove(" "); #else QString fileName = fi.fileName(); #endif QString filePath = tdir.tempPath() + "/xtTempDoc/" + qfile.value("url_id").toString() + "/"; QFile tfile(filePath + fileName); // Remove any previous watches if (_guiClientInterface) _guiClientInterface->removeDocumentWatch(tfile.fileName()); if (! tdir.exists(filePath)) tdir.mkpath(filePath); if (!tfile.open(QIODevice::WriteOnly)) { QMessageBox::warning( this, tr("File Open Error"), tr("Could Not Create File %1.").arg(tfile.fileName()) ); return; } tfile.write(qfile.value("url_stream").toByteArray()); QUrl urldb; urldb.setUrl(tfile.fileName()); #ifndef Q_WS_WIN urldb.setScheme("file"); #endif tfile.close(); if (! QDesktopServices::openUrl(urldb)) { QMessageBox::warning(this, tr("File Open Error"), tr("Could not open %1.").arg(urldb.toString())); return; } // Add a watch to the file that will save any changes made to the file back to the database. if (_guiClientInterface && !_readOnly) // TODO: only if NOT read-only _guiClientInterface->addDocumentWatch(tfile.fileName(),qfile.value("url_id").toInt()); return; } else if (ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Assignment"), qfile, __FILE__, __LINE__)) return; else { QUrl url(_doc->currentItem()->rawValue("description").toString()); if (url.scheme().isEmpty()) url.setScheme("file"); QDesktopServices::openUrl(url); return; } } else { unsigned int i = 0; // TODO: find a better data structure than array of structs for _documentMap for ( ; i < sizeof(_documentMap) / sizeof(_documentMap[0]); i++) if (_documentMap[i].ident == docType) { params.append(_documentMap[i].keyparam, targetid); ui = _documentMap[i].uiname; break; } if (i >= sizeof(_documentMap) / sizeof(_documentMap[0])) { QMessageBox::critical(this, tr("Error"), tr("Unknown document type %1").arg(docType)); return; } } QWidget* w = 0; if (parentWidget()->window()) { if (parentWidget()->window()->isModal()) w = _guiClientInterface->openWindow(ui, params, parentWidget()->window(), Qt::WindowModal, Qt::Dialog); else w = _guiClientInterface->openWindow(ui, params, parentWidget()->window(), Qt::NonModal, Qt::Window); } if (w && w->inherits("QDialog")) { QDialog* newdlg = qobject_cast(w); newdlg->exec(); } refresh(); } void Documents::sViewDoc() { sOpenDoc("view"); } void Documents::sAttachDoc() { ParameterList params; params.append("sourceType", _source); params.append("source_id", _sourceid); docAttach newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); refresh(); } void Documents::sDetachDoc() { XSqlQuery detach; if (_doc->id() < 0) return; if(QMessageBox::question( this, tr("Confirm Detach"), tr("

    You have requested to detach the selected document." " In some cases this may permanently remove the document from the system.

    " "

    Are you sure you want to continue?

    "), QMessageBox::Yes|QMessageBox::No, QMessageBox::No) == QMessageBox::No) return; // user doesn't want to continue so get out of here if ( _doc->currentItem()->rawValue("target_type") == "IMG" ) { detach.prepare( "DELETE FROM imageass " "WHERE (imageass_id = :docid );" ); } else if ( _doc->currentItem()->rawValue("target_type") == "URL" || _doc->currentItem()->rawValue("target_type") == "FILE") { detach.prepare( "DELETE FROM url " "WHERE (url_id = :docid );" ); } else { detach.prepare( "DELETE FROM docass " "WHERE (docass_id = :docid );" ); } detach.bindValue(":docid", _doc->id()); detach.exec(); ErrorReporter::error(QtCriticalMsg, this, tr("Error Detaching"), detach, __FILE__, __LINE__); refresh(); } void Documents::refresh() { if(-1 == _sourceid) { _doc->clear(); return; } XSqlQuery query; //Populate doc list QString sql("SELECT id, target_number, target_type, " " target_id AS target_number_xtidrole, source_type, source_id, purpose, " " name, description, " " hasPrivOnObject('view', target_type, target_id) AS canview," " hasPrivOnObject('edit', target_type, target_id) AS canedit," " CASE WHEN (purpose='I') THEN :inventory" " WHEN (purpose='P') THEN :product" " WHEN (purpose='E') THEN :engineering" " WHEN (purpose='M') THEN :misc" " WHEN (purpose='A') THEN :child" " WHEN (purpose='C') THEN :parent" " WHEN (purpose='S') THEN :sibling" " WHEN (purpose='D') THEN :dupe" " ELSE :other" " END AS purpose_qtdisplayrole, " " CASE WHEN (target_type='T') THEN :contact " " WHEN (target_type='CNTR') THEN :contract " " WHEN (target_type='CRMA') THEN :crma " " WHEN (target_type='C') THEN :cust " " WHEN (target_type='EMP') THEN :emp " " WHEN (target_type='URL') THEN :url " " WHEN (target_type='FILE') THEN :file " " WHEN (target_type='IMG') THEN :image " " WHEN (target_type='INCDT') THEN :incident " " WHEN (target_type='I') THEN :item " " WHEN (target_type='OPP') THEN :opp " " WHEN (target_type='J') THEN :project " " WHEN (target_type='P') THEN :po " " WHEN (target_type='S') THEN :so " " WHEN (target_type='Q') THEN :quote " " WHEN (target_type='V') THEN :vendor " " WHEN (target_type='W') THEN :wo " " WHEN (target_type='TE') THEN :timeexpense " " WHEN (target_type='TODO') THEN :todo " " ELSE :error " " END AS target_type_qtdisplayrole " "FROM docinfo " "WHERE ((source_type=:source) " " AND (source_id=:sourceid)) " "ORDER by target_type_qtdisplayrole, target_number; "); query.prepare(sql); query.bindValue(":inventory", tr("Inventory Description")); query.bindValue(":product", tr("Product Description")); query.bindValue(":engineering", tr("Engineering Reference")); query.bindValue(":misc", tr("Miscellaneous")); query.bindValue(":parent", tr("Parent")); query.bindValue(":child", tr("Child")); query.bindValue(":sibling", tr("Related to")); query.bindValue(":dupe", tr("Duplicate of")); query.bindValue(":other", tr("Other")); query.bindValue(":po", tr("Purchase Order")); query.bindValue(":so", tr("Sales Order")); query.bindValue(":quote", tr("Quote")); query.bindValue(":wo", tr("Work Order")); query.bindValue(":image", tr("Image")); query.bindValue(":incident", tr("Incident")); query.bindValue(":timeexpense", tr("Time Expense")); query.bindValue(":todo", tr("To-Do")); query.bindValue(":task", tr("Task")); query.bindValue(":project", tr("Project")); query.bindValue(":item", tr("Item")); query.bindValue(":crma", tr("CRM Account")); query.bindValue(":cust", tr("Customer")); query.bindValue(":vendor", tr("Vendor")); query.bindValue(":contact", tr("Contact")); query.bindValue(":contract", tr("Contract")); query.bindValue(":opp", tr("Opportunity")); query.bindValue(":url", tr("URL")); query.bindValue(":emp", tr("Employee")); query.bindValue(":file", tr("File")); query.bindValue(":source", _documentMap[_source].ident); query.bindValue(":sourceid", _sourceid); query.exec(); _doc->populate(query,TRUE); ErrorReporter::error(QtCriticalMsg, this, tr("Error Getting Documents"), query, __FILE__, __LINE__); } void Documents::handleSelection(bool /*pReadOnly*/) { if (_doc->selectedItems().count() && (_doc->currentItem()->rawValue("target_type").toString() == "URL" || _doc->currentItem()->rawValue("target_type").toString() == "FILE" )) { _viewDoc->setText(tr("Open")); } else { _viewDoc->setText(tr("View")); } bool valid = (_doc->selectedItems().count() > 0); _editDoc->setEnabled(valid && !_readOnly && _doc->currentItem()->rawValue("canedit").toBool()); _viewDoc->setEnabled(valid && _doc->currentItem()->rawValue("canview").toBool()); } void Documents::handleItemSelected() { if(_readOnly || (_doc->currentItem()->rawValue("target_type").toString() == "URL" || _doc->currentItem()->rawValue("target_type").toString() == "FILE" )) { _viewDoc->animateClick(); } else { _editDoc->animateClick(); } } qt-client-4.1.0/widgets/documents.h000066400000000000000000000060061217451700100172340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef documents_h #define documents_h #include #include #include "widgets.h" #include "guiclientinterface.h" #include "ui_documents.h" #define cNew 1 #define cEdit 2 #define cView 3 class XTUPLEWIDGETS_EXPORT Documents : public QWidget, public Ui::documents { Q_OBJECT Q_ENUMS(DocumentSources) Q_PROPERTY(DocumentSources type READ type WRITE setType) friend class image; friend class file; public: Documents(QWidget *); // if you add to this then add to the _documentMap[] below enum DocumentSources { Uninitialized, Address, BBOMHead, BBOMItem, BOMHead, BOMItem, BOOHead, BOOItem, CRMAccount, Contact, Contract, Customer, Employee, Incident, Item, ItemSite, ItemSource, Location, LotSerial, Opportunity, Project, PurchaseOrder, PurchaseOrderItem,ReturnAuth, ReturnAuthItem, Quote, QuoteItem, SalesOrder, SalesOrderItem, TimeExpense, Todo, TransferOrder, TransferOrderItem, Vendor, Warehouse, WorkOrder }; static GuiClientInterface *_guiClientInterface; inline int sourceid() { return _sourceid; } inline enum DocumentSources type() { return _source; } struct DocumentMap { enum DocumentSources source; const char *ident; const char *keyparam; const char *uiname; DocumentMap(enum DocumentSources s, const char *i, const char *k = 0, const char *u = 0) { source = s; ident = i; keyparam = k; uiname = u; } }; static const struct DocumentMap _documentMap[]; // see Documents.cpp for init public slots: void setType(enum DocumentSources); void setId(int); void setReadOnly(bool); void sNewDoc(QString type, QString ui); void sNewImage(); void sNewToDo(); void sNewIncdt(); void sNewOpp(); void sNewProj(); void sInsertDocass(QString, int); void sAttachDoc(); void sViewDoc(); void sEditDoc(); void sOpenDoc(QString mode = "edit"); void sDetachDoc(); void refresh(); private slots: void handleSelection(bool = false); void handleItemSelected(); private: enum DocumentSources _source; int _sourceid; bool _readOnly; }; #endif qt-client-4.1.0/widgets/documents.ui000066400000000000000000000103411217451700100174170ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at http://www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. documents 0 0 502 200 0 200 Form 0 0 16 175 0 0 0 0 32767 32767 Qt::ClickFocus true &New false &Edit false &View true &Attach true &Detach Qt::Vertical QSizePolicy::Expanding 70 41 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    qt-client-4.1.0/widgets/editwatermark.cpp000066400000000000000000000025321217451700100204310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "editwatermark.h" #include /** @class EditWatermark @brief The EditWatermark class is for internal use only. This is a helper dialog for XDocCopySetter. */ EditWatermark::EditWatermark(QWidget* parent, Qt::WindowFlags fl) : QDialog(parent, fl) { setupUi(this); } EditWatermark::~EditWatermark() { // no need to delete child widgets, Qt does it all for us } void EditWatermark::languageChange() { retranslateUi(this); } bool EditWatermark::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("watermark", &valid); if (valid) _watermark->setText(param.toString()); param = pParams.value("showPrices", &valid); if (valid) _showPrices->setChecked(param.toBool()); return true; } QString EditWatermark::watermark() { return _watermark->text(); } bool EditWatermark::showPrices() { return _showPrices->isChecked(); } qt-client-4.1.0/widgets/editwatermark.h000066400000000000000000000017061217451700100201000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef EDITWATERMARK_H #define EDITWATERMARK_H #include #include #include "ui_editwatermark.h" class EditWatermark : public QDialog, public Ui::EditWatermark { Q_OBJECT public: EditWatermark(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~EditWatermark(); virtual bool showPrices(); virtual QString watermark(); public slots: virtual bool set(const ParameterList &pParams); protected slots: virtual void languageChange(); }; #endif // EDITWATERMARK_H qt-client-4.1.0/widgets/editwatermark.ui000066400000000000000000000151221217451700100202630ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. EditWatermark 0 0 400 80 Invoice/Credit Memo Watermark 5 7 0 0 5 0 5 0 Watermark: Qt::AlignVCenter|Qt::AlignRight 0 0 Show Prices 56 10 Expanding Horizontal 10 46 Expanding Vertical 0 0 5 0 &Cancel &Save true true 11 66 Expanding Vertical _watermark _showPrices _save _close parameter.h _close clicked() EditWatermark reject() _save clicked() EditWatermark accept() qt-client-4.1.0/widgets/empcluster.cpp000066400000000000000000000122021217451700100177440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "empcluster.h" EmpCluster::EmpCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new EmpClusterLineEdit(this, pName)); } int EmpClusterLineEdit::idFromList(QWidget *pParent) { return EmpClusterLineEdit(pParent).listFactory()->exec(); } EmpClusterLineEdit::EmpClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "emp", "emp_id", "emp_code", "emp_number", 0, 0, pName, "emp_active") { setTitles(tr("Employee"), tr("Employees")); setUiName("employee"); setEditPriv("MaintainEmployees"); setNewPriv("MaintainEmployees"); setViewPriv("ViewEmployees"); } VirtualInfo *EmpClusterLineEdit::infoFactory() { return new EmpInfo(this); } VirtualList *EmpClusterLineEdit::listFactory() { return new EmpList(this); } VirtualSearch *EmpClusterLineEdit::searchFactory() { return new EmpSearch(this); } EmpInfo::EmpInfo(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualInfo(pParent, pFlags) { _numberLit->setText(tr("Code:")); _nameLit->setText(tr("Number:")); } EmpList::EmpList(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { QTreeWidgetItem *hitem = _listTab->headerItem(); hitem->setText(0, tr("Code")); hitem->setText(1, tr("Number")); } EmpSearch::EmpSearch(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { _searchNumber->setText(tr("Search through Codes")); _searchName->setText(tr("Search through Numbers")); } // script exposure //////////////////////////////////////////////////////////// QScriptValue EmpClusterLineEdittoScriptValue(QScriptEngine *engine, EmpClusterLineEdit* const &item) { return engine->newQObject(item); } void EmpClusterLineEditfromScriptValue(const QScriptValue &obj, EmpClusterLineEdit* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructEmpClusterLineEdit(QScriptContext *context, QScriptEngine *engine) { EmpClusterLineEdit *obj = 0; if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new EmpClusterLineEdit(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() >= 2 && qscriptvalue_cast(context->argument(0))) obj = new EmpClusterLineEdit(qscriptvalue_cast(context->argument(0)), qPrintable(context->argument(1).toString())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate EmpClusterLineEdit constructor"); return engine->toScriptValue(obj); } void setupEmpClusterLineEdit(QScriptEngine *engine) { qScriptRegisterMetaType(engine, EmpClusterLineEdittoScriptValue, EmpClusterLineEditfromScriptValue); QScriptValue widget = engine->newFunction(constructEmpClusterLineEdit); // widget.setProperty("EmpAll", QScriptValue(engine, EmpClusterLineEdit::EmpAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); // widget.setProperty("EmpActive", QScriptValue(engine, EmpClusterLineEdit::EmpActive), QScriptValue::ReadOnly | QScriptValue::Undeletable); // widget.setProperty("EmpInactive",QScriptValue(engine, EmpClusterLineEdit::EmpInactive),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("EmpClusterLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue EmpClustertoScriptValue(QScriptEngine *engine, EmpCluster* const &item) { return engine->newQObject(item); } void EmpClusterfromScriptValue(const QScriptValue &obj, EmpCluster* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructEmpCluster(QScriptContext *context, QScriptEngine *engine) { EmpCluster *obj = 0; if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new EmpCluster(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() >= 2 && qscriptvalue_cast(context->argument(0))) obj = new EmpCluster(qscriptvalue_cast(context->argument(0)), qPrintable(context->argument(1).toString())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate EmpCluster constructor"); return engine->toScriptValue(obj); } void setupEmpCluster(QScriptEngine *engine) { qScriptRegisterMetaType(engine, EmpClustertoScriptValue, EmpClusterfromScriptValue); QScriptValue widget = engine->newFunction(constructEmpCluster); engine->globalObject().setProperty("EmpCluster", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/empcluster.h000066400000000000000000000030701217451700100174140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _empCluster_h #define _empCluster_h #include "virtualCluster.h" void setupEmpClusterLineEdit(QScriptEngine *engine); void setupEmpCluster(QScriptEngine *engine); class EmpInfo : public VirtualInfo { Q_OBJECT public: EmpInfo(QWidget*, Qt::WindowFlags = 0); }; class EmpList : public VirtualList { Q_OBJECT public: EmpList(QWidget*, Qt::WindowFlags = 0); }; class EmpSearch : public VirtualSearch { Q_OBJECT public: EmpSearch(QWidget*, Qt::WindowFlags = 0); }; class XTUPLEWIDGETS_EXPORT EmpClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: EmpClusterLineEdit(QWidget*, const char* = 0); static int idFromList(QWidget* = 0); // TODO: put in VirtualClusterLineEdit? protected: virtual VirtualInfo *infoFactory(); virtual VirtualList *listFactory(); virtual VirtualSearch *searchFactory(); }; class XTUPLEWIDGETS_EXPORT EmpCluster : public VirtualCluster { Q_OBJECT public: EmpCluster(QWidget*, const char* = 0); }; Q_DECLARE_METATYPE(EmpClusterLineEdit*) Q_DECLARE_METATYPE(EmpCluster*) #endif qt-client-4.1.0/widgets/empgroupcluster.cpp000066400000000000000000000037341217451700100210330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "empgroupcluster.h" EmpGroupCluster::EmpGroupCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new EmpGroupClusterLineEdit(this, pName)); _number->setText(tr("Name")); _name->setText(tr("Description")); } int EmpGroupClusterLineEdit::idFromList(QWidget *pParent) { return EmpGroupClusterLineEdit(pParent).listFactory()->exec(); } EmpGroupClusterLineEdit::EmpGroupClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "empgrp", "empgrp_id", "empgrp_name", "empgrp_descrip", 0, 0, pName) { setTitles(tr("Employee Group"), tr("Employee Groups")); } VirtualInfo *EmpGroupClusterLineEdit::infoFactory() { return new EmpGroupInfo(this); } VirtualList *EmpGroupClusterLineEdit::listFactory() { return new EmpGroupList(this); } VirtualSearch *EmpGroupClusterLineEdit::searchFactory() { return new EmpGroupSearch(this); } EmpGroupInfo::EmpGroupInfo(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualInfo(pParent, pFlags) { _numberLit->setText(tr("Name:")); _nameLit->setText(tr("Description:")); } EmpGroupList::EmpGroupList(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { QTreeWidgetItem *hitem = _listTab->headerItem(); hitem->setText(0, tr("Name")); hitem->setText(1, tr("Description")); } EmpGroupSearch::EmpGroupSearch(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { _searchNumber->setText(tr("Search through Name")); _searchName->setText(tr("Search through Description")); } qt-client-4.1.0/widgets/empgroupcluster.h000066400000000000000000000027061217451700100204760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _empGroupCluster_h #define _empGroupCluster_h #include "virtualCluster.h" class EmpGroupInfo : public VirtualInfo { Q_OBJECT public: EmpGroupInfo(QWidget*, Qt::WindowFlags = 0); }; class EmpGroupList : public VirtualList { Q_OBJECT public: EmpGroupList(QWidget*, Qt::WindowFlags = 0); }; class EmpGroupSearch : public VirtualSearch { Q_OBJECT public: EmpGroupSearch(QWidget*, Qt::WindowFlags = 0); }; class XTUPLEWIDGETS_EXPORT EmpGroupClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: EmpGroupClusterLineEdit(QWidget*, const char* = 0); static int idFromList(QWidget* = 0); // TODO: put in VirtualClusterLineEdit? protected: virtual VirtualInfo *infoFactory(); virtual VirtualList *listFactory(); virtual VirtualSearch *searchFactory(); }; class XTUPLEWIDGETS_EXPORT EmpGroupCluster : public VirtualCluster { Q_OBJECT public: EmpGroupCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/expensecluster.cpp000066400000000000000000000021321217451700100206330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "expensecluster.h" ExpenseCluster::ExpenseCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new ExpenseLineEdit(this, pName)); _description->show(); setLabel(tr("Expense Category:")); } ExpenseLineEdit::ExpenseLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "expcat", "expcat_id", "expcat_code", "", "expcat_descrip", 0, pName, "expcat_active") { setTitles(tr("Expense Category"), tr("Expense Categories")); setUiName("expenseCategory"); setEditPriv("MaintainExpenseCategories"); setNewPriv("MaintainExpenseCategories"); setViewPriv("ViewExpenseCategories"); } qt-client-4.1.0/widgets/expensecluster.h000066400000000000000000000016341217451700100203060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __EXPENSECLUSTER_H__ #define __EXPENSECLUSTER_H__ #include "widgets.h" #include "xlineedit.h" #include #include #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT ExpenseLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: ExpenseLineEdit(QWidget *, const char * = 0); }; class XTUPLEWIDGETS_EXPORT ExpenseCluster : public VirtualCluster { Q_OBJECT public: ExpenseCluster(QWidget *, const char * = 0); }; #endif qt-client-4.1.0/widgets/filecluster.cpp000066400000000000000000000045521217451700100201130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "filecluster.h" #include FileCluster::FileCluster(QWidget* pParent, const char* pName) : QWidget(pParent) { setObjectName(pName); _caption = tr("Open File"); _dir = ""; _fileMode = QFileDialog::AnyFile; _filter = ""; QHBoxLayout *hbox = new QHBoxLayout(this); hbox->setContentsMargins(0, 0, 0, 0); // prevent double margins _file = new FileLineEdit(); _list = new QPushButton(tr("..."), this); _list->setObjectName("_list"); _list->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); #ifndef Q_WS_MAC _list->setMaximumWidth(25); #endif hbox->addWidget(_file); hbox->addWidget(_list); connect(_file, SIGNAL(editingFinished()), this, SIGNAL(editingFinished())); connect(_file, SIGNAL(requestList()), this, SLOT(sEllipses())); connect(_file, SIGNAL(requestSearch()), this, SLOT(sEllipses())); connect(_file, SIGNAL(textChanged(const QString&)), this, SIGNAL(textChanged(const QString&))); connect(_list, SIGNAL(clicked()), this, SLOT(sEllipses())); } FileCluster::~FileCluster() { } void FileCluster::sEllipses() { QFileDialog newdlg(this, _caption, _dir); newdlg.setFileMode(_fileMode); if (! _filter.isEmpty()) { QStringList filters; filters << _filter << tr("Any Files (*)"); newdlg.setFilters(filters); } if (newdlg.exec()) { _file->setText(newdlg.selectedFiles().join(", ")); emit editingFinished(); } } FileLineEdit::FileLineEdit(QWidget *parent) : QLineEdit(parent) { } void FileLineEdit::keyPressEvent(QKeyEvent *event) { bool handled = false; if (event->modifiers() & Qt::ControlModifier) { if (event->key() == Qt::Key_L) { emit (requestList()); handled = true; } else if (event->key() == Qt::Key_S) { emit (requestSearch()); handled = true; } } if (handled) event->accept(); else QLineEdit::keyPressEvent(event); } qt-client-4.1.0/widgets/filecluster.h000066400000000000000000000060441217451700100175560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FILECLUSTER_H #define FILECLUSTER_H #include "widgets.h" #include "parameter.h" #include "xtreewidget.h" #include #include #include #include #include class FileLineEdit : public QLineEdit { Q_OBJECT public: FileLineEdit(QWidget * parent = 0); protected: virtual void keyPressEvent(QKeyEvent *event); signals: void requestList(); void requestSearch(); }; /* FileCluster allows the user to enter a string or browse the filesystem. The text() of the FileCluster should name a file or directory. The ellipsis button instantiates a QFileDialog, so the class has methods to control that QFileDialog. */ class XTUPLEWIDGETS_EXPORT FileCluster : public QWidget { Q_OBJECT Q_PROPERTY(QString caption READ caption WRITE setCaption ) Q_PROPERTY(bool listVisible READ listVisible WRITE setListVisible ) Q_PROPERTY(QFileDialog::FileMode fileMode READ fileMode WRITE setFileMode ) Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly ) Q_PROPERTY(QString text READ text WRITE setText ) public: FileCluster(QWidget*, const char* = 0); ~FileCluster(); virtual inline QString caption() const { return _caption; }; virtual inline void clear() { _file->clear(); }; virtual inline QString dir() const { return _dir; }; virtual inline QFileDialog::FileMode fileMode() const { return _fileMode; }; virtual inline bool isReadOnly() const { return _file->isReadOnly(); }; virtual inline bool listVisible() const { return _list->isVisible(); }; virtual inline void setListVisible(bool b) { _list->setVisible(b); }; virtual inline void setReadOnly(bool b) { _file->setReadOnly(b); setListVisible(! b); }; virtual inline QString text() const { return _file->text(); }; public slots: virtual void sEllipses(); virtual void setCaption(const QString &s) { _caption = s; } ; virtual void setDir(const QString &s) { _dir = s; } ; virtual void setEnabled(const bool b) { _file->setEnabled(b); _list->setEnabled(! isReadOnly()); } ; virtual void setFileMode(const QFileDialog::FileMode &m) { _fileMode = m; }; virtual void setFilter(const QString &s) { _filter = s; } ; virtual void setText(const QString &s) { _file->setText(s); }; signals: void editingFinished(); void textChanged(const QString&); protected: QString _caption; QString _dir; FileLineEdit *_file; QString _filter; QPushButton *_list; QFileDialog::FileMode _fileMode; }; #endif qt-client-4.1.0/widgets/filemoveselector.cpp000066400000000000000000000167761217451700100211540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "filemoveselector.h" #include "shortcuts.h" #include #define DEBUG false /** \class FileMoveSelector \brief The FileMoveSelector provides a standardized user interface for selecting what the application should do with a file in the host file system after it has been processed. The FileMoveSelector encodes a simple user interface paradigm for how the application should handle files after they have been processed. The application window that has a FileMoveSelector must store the user's selection. The application code that processes the files should check this stored selection and have its own means of handling files in the selected manner. \see configureIE \see ImportHelper */ FileMoveSelector::FileMoveSelector(QWidget* parent, Qt::WFlags fl) : QWidget(parent, fl) { setupUi(this); setObjectName("fileMoveSelector"); shortcuts::setStandardKeys(this); _status->append(Nothing, tr("Do nothing"), codeForOption(Nothing)); _status->append(Suffix, tr("Add a suffix"), codeForOption(Suffix)); _status->append(ChangeDir, tr("Move to a subdirectory"), codeForOption(ChangeDir)); _status->append(Delete, tr("Delete"), codeForOption(Delete)); } FileMoveSelector::~FileMoveSelector() { // no need to delete child widgets, Qt does it all for us } void FileMoveSelector::languageChange() { retranslateUi(this); } /** \brief Return the text code value of the currently-selected return option. \see codeForOption(FileMoveOption) for possible return values */ QString FileMoveSelector::code() const { return _status->code(); } /** \brief Translate a FileMoveOption enumerated value to a text code value. The text code values are not translatable. They are intended to be used for storing the user's selection in a database or configuration file, and for applications to read from the database or configuration file when deciding how to handle a file after it has been processed. \return The text code value corresponding to the FileMoveOption enumerated value. Possible values are "None", "Rename", "Move", and "Delete", or QString::null if poption is invalid or not yet supported. */ QString FileMoveSelector::codeForOption(FileMoveOption poption) const { QString returnValue = QString::null; switch (poption) { case Nothing: returnValue = "None"; break; case Suffix: returnValue = "Rename"; break; case ChangeDir: returnValue = "Move"; break; case Delete: returnValue = "Delete"; break; } if (DEBUG) qDebug("%s::codeForOption(%d) returning '%s'", qPrintable(objectName()), poption, qPrintable(returnValue)); return returnValue; } /** \brief The destination directory for files which are to be moved. This value reflects the current contents of the destination directory field. The destination directory may not be visible, depending on the currently selected option. \returns The text entered in the destination directory field of the FileMoveSelector. This value should not be used to determine how the user would like files to be handled. Use code() or option() for this purpose. */ QString FileMoveSelector::destdir() const { return _movedir->text(); } /** \brief The enumerated FileMoveOption value of the current selection. \returns The currently selected option, or -1 if there is an error. */ FileMoveSelector::FileMoveOption FileMoveSelector::option() const { return (FileMoveOption)_status->id(); } /** \brief The suffix that should be appended to files that have been processed. This value reflects the current contents of the suffix field. This field may not be visible, depending on the currently selected option. \returns The text entered in the suffix field of the FileMoveSelector. This value should not be used to determine how the user would like files to be handled. Use code() or option() for this purpose. */ QString FileMoveSelector::suffix() const { return _suffix->text(); } /** \brief Programatically set the selection using a text code value. \return true if successful or false if the pcode does not exactly match a known value. */ bool FileMoveSelector::setCode(QString pcode) { if (DEBUG) qDebug("%s::setCode(%s) entered", qPrintable(objectName()), qPrintable(pcode)); _status->setCode(pcode); if (_status->id() < 0) _status->setItemText(0, _status->nullStr()); if (DEBUG) qDebug("%s::setCode() returning %d with id %d", qPrintable(objectName()), _status->id() >= 0, _status->id()); return (_status->id() >= 0); } /** \brief Programatically set the destination directory. This does not automatically set the selection to ChangeDir. \return true */ bool FileMoveSelector::setDestdir(QString pdir) { _movedir->setText(pdir); return true; } /** \brief Programatically set the selection using one of the FileMoveOption enumerated values. \return true if successful or false if poption is not valid. */ bool FileMoveSelector::setOption(FileMoveOption poption) { _status->setId(poption); return (_status->id() >= 0); } /** \brief Programatically set the suffix to append. This does not automatically set the selection to Suffix. \return true */ bool FileMoveSelector::setSuffix(QString psuffix) { _suffix->setText(psuffix); return true; } /* script exposure *********************************************************/ QScriptValue constructFileMoveSelector(QScriptContext *context, QScriptEngine *engine) { FileMoveSelector *obj = 0; if (context->argumentCount() == 0) obj = new FileMoveSelector(); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new FileMoveSelector(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() > 1 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isNumber()) obj = new FileMoveSelector(qscriptvalue_cast(context->argument(0)), (Qt::WFlags)context->argument(1).toInteger()); else context->throwError(QScriptContext::UnknownError, "Could not find an appropriate FileMoveSelector constructor"); return engine->toScriptValue(obj); } QScriptValue FileMoveSelectorToScriptValue(QScriptEngine *engine, FileMoveSelector *const &item) { return engine->newQObject(item); } void FileMoveSelectorFromScriptValue(const QScriptValue &obj, FileMoveSelector * &item) { item = qobject_cast(obj.toQObject()); } void setupFileMoveSelector(QScriptEngine *engine) { qScriptRegisterMetaType(engine, FileMoveSelectorToScriptValue, FileMoveSelectorFromScriptValue); QScriptValue constructor = engine->newFunction(constructFileMoveSelector); engine->globalObject().setProperty("FileMoveSelector", constructor, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/filemoveselector.h000066400000000000000000000026721217451700100206070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FILEMOVESELECTOR_H #define FILEMOVESELECTOR_H #include "widgets.h" #include "ui_filemoveselector.h" void setupFileMoveSelector(QScriptEngine *engine); class FileMoveSelector : public QWidget, public Ui::FileMoveSelector { Q_OBJECT Q_ENUMS(FileMoveOption) public: enum FileMoveOption { Nothing, Suffix, ChangeDir, Delete }; FileMoveSelector(QWidget* parent = 0, Qt::WFlags fl = 0); ~FileMoveSelector(); Q_INVOKABLE QString code() const; Q_INVOKABLE QString codeForOption(FileMoveOption poption) const; Q_INVOKABLE QString destdir() const; Q_INVOKABLE FileMoveOption option() const; Q_INVOKABLE QString suffix() const; public slots: bool setCode(QString pcode); bool setDestdir(QString pdir); bool setOption(FileMoveOption poption); bool setSuffix(QString psuffix); protected slots: virtual void languageChange(); private: }; Q_DECLARE_METATYPE(FileMoveSelector*) #endif qt-client-4.1.0/widgets/filemoveselector.ui000066400000000000000000000061031217451700100207660ustar00rootroot00000000000000 FileMoveSelector 0 0 387 58 File Status Selector true [ Select One of the Following ] XComboBox::None 0 0 Append: 0 Move to: QFileDialog::Directory FileCluster QWidget
    filecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    _status currentIndexChanged(int) _statusStack setCurrentIndex(int) 101 46 173 46
    qt-client-4.1.0/widgets/filterManager.cpp000066400000000000000000000123521217451700100203470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "filterManager.h" #include "parameterwidget.h" #include "shortcuts.h" #include #include #include #include #include #include #include #include filterManager::filterManager(QWidget* parent, const char* name) : QDialog(parent) { if(name) setObjectName(name); setupUi(this); _filterSet->addColumn(tr("Filter Set Name"), -1, Qt::AlignLeft, true, "filter_name" ); _filterSet->addColumn(tr("Shared"), _ynColumn, Qt::AlignLeft, true, "shared"); connect(_filterSet, SIGNAL(valid(bool)), this, SLOT( handleButtons(bool) )); connect(_share, SIGNAL(clicked()), this, SLOT( shareFilter() )); connect(_unshare, SIGNAL(clicked()), this, SLOT( unshareFilter() )); connect(_delete, SIGNAL(clicked()), this, SLOT( deleteFilter() ) ); connect(this, SIGNAL(filterDeleted()), parent, SLOT(setSavedFilters()) ); shortcuts::setStandardKeys(this); } void filterManager::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("screen", &valid); if (valid) { _screen = param.toString(); populate(); } } void filterManager::populate() { if (parent()) { if (parent()->parent()) { XSqlQuery qry; qry.prepare("select filter_id, filter_name, " " case when filter_username is null then " " true " " else false end as shared " "from filter " "where COALESCE(filter_username,getEffectiveXtUser())=getEffectiveXtUser() " " and filter_screen=:screen " "order by filter_name;"); qry.bindValue(":screen", parent()->parent()->objectName()); qry.exec(); _filterSet->populate(qry, false); } } } void filterManager::unshareFilter() { XSqlQuery qry; if ( QMessageBox::question( this, tr("Unshare Filter"), tr("

    This will un-share the selected filter and assign it to you.\n" " Are you sure this is what you want to do?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No ) return; else { qry.prepare("UPDATE filter SET filter_username=getEffectiveXtUser() WHERE (filter_id=:filter_id);"); qry.bindValue(":filter_id", _filterSet->id()); qry.exec(); } populate(); } void filterManager::shareFilter() { XSqlQuery qry; // See if there is already a shared filter by this name qry.prepare("SELECT shr.filter_id AS filter_id " "FROM filter prv " " JOIN filter shr ON ((prv.filter_name=shr.filter_name) " " AND (prv.filter_screen=shr.filter_screen) " " AND (shr.filter_id != prv.filter_id)) " "WHERE ((shr.filter_username IS NULL) " " AND (prv.filter_id=:filter_id)); "); qry.bindValue(":filter_id", _filterSet->id()); qry.exec(); if (qry.first()) { if ( QMessageBox::question( this, tr("Shared Filter Exists"), tr("

    This will replace a shared filter with the same name.\n" " Are you sure this is what you want to do?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No ) return; else { int filterid = qry.value("filter_id").toInt(); qry.prepare("UPDATE filter shr SET filter_value=prv.filter_value " "FROM filter prv " "WHERE ((shr.filter_id=:shr_filter_id) " " AND (prv.filter_id=:prv_filter_id)); " "DELETE FROM filter WHERE (filter_id=:prv_filter_id);"); qry.bindValue(":shr_filter_id", filterid); qry.bindValue(":prv_filter_id", _filterSet->id()); qry.exec(); emit filterDeleted(); } } else { qry.prepare("UPDATE filter SET filter_username=NULL WHERE (filter_id=:filter_id);"); qry.bindValue(":filter_id", _filterSet->id()); qry.exec(); } populate(); } void filterManager::deleteFilter() { QString query = "delete from filter where filter_id=:filter_id"; XSqlQuery qry; qry.prepare(query); qry.bindValue(":filter_id", _filterSet->id()); qry.exec(); this->populate(); emit filterDeleted(); } void filterManager::handleButtons(bool valid) { _share->setEnabled(valid && !_filterSet->currentItem()->rawValue("shared").toBool()); _delete->setEnabled(valid); _unshare->setEnabled(valid && _filterSet->currentItem()->rawValue("shared").toBool()); } qt-client-4.1.0/widgets/filterManager.h000066400000000000000000000017521217451700100200160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FILTERMANAGER_H #define FILTERMANAGER_H #include "parameter.h" #include "ui_filterManager.h" class filterManager : public QDialog, public Ui::filterManager { Q_OBJECT public: filterManager(QWidget* parent = 0, const char* name = 0); void set(const ParameterList & pParams); void populate(); public slots: void shareFilter(); void unshareFilter(); void deleteFilter(); private slots: void handleButtons(bool valid); signals: void filterDeleted(); private: QString _screen; }; #endif // FILTERMANAGER_H qt-client-4.1.0/widgets/filterManager.ui000066400000000000000000000055321217451700100202040ustar00rootroot00000000000000 filterManager Qt::WindowModal 0 0 356 300 List Saved Filter Sets true 75 23 Close 75 23 Share Do Not Share 75 23 Delete Qt::Vertical 20 40 XTreeWidget QTreeWidget

    xtreewidget.h
    1 _close clicked() filterManager close() 351 22 199 149 qt-client-4.1.0/widgets/filterSave.cpp000066400000000000000000000074251217451700100177000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "filtersave.h" #include "shortcuts.h" #include #include #include #include #include #include filterSave::filterSave(QWidget* parent, const char* name) : QDialog(parent) { if(name) setObjectName(name); setupUi(this); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(save())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject())); shortcuts::setStandardKeys(this); } void filterSave::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("filter", &valid); if (valid) _filter = param.toString(); param = pParams.value("filtersetname", &valid); if (valid) _filterName->setText(param.toString()); param = pParams.value("username", &valid); if (valid) _username = param.toString(); param = pParams.value("classname", &valid); if (valid) _classname = param.toString(); param = pParams.value("shared", &valid); if (valid) _shared->setChecked(true); } void filterSave::save() { if ( _filterName->text().isEmpty() ) { QMessageBox msgBox; msgBox.setText(tr("Please enter a name for this filter set before saving.")); msgBox.exec(); return; } int filterid = -1; QString user; QString query; XSqlQuery qry; if (_shared->isChecked()) user = "null"; else user = "getEffectiveXtUser()"; //check to see if filter name exists for this screen QString filter_query = "select filter_id, filter_name, filter_username " "from filter " "where filter_name=:name " " and COALESCE(filter_username,getEffectiveXtUser())=getEffectiveXtUser() " " and filter_screen=:screen"; qry.prepare(filter_query); qry.bindValue(":name", _filterName->text()); qry.bindValue(":screen", _classname); qry.exec(); //if the filter name is found, update it if (qry.first()) { if (qry.value("filter_username").toString().isEmpty()) { if ( QMessageBox::question( this, tr("Shared Filter Exists"), tr("

    This will over-write a shared filter.\n" " Are you sure this is what you want to do?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No ) return; } filterid = qry.value("filter_id").toInt(); query = QString("update filter set " " filter_value=:value, " " filter_username=%1 " "where filter_id=:filter_id;").arg(user); } else { qry.prepare("SELECT nextval('filter_filter_id_seq') AS result"); qry.exec(); qry.first(); filterid = qry.value("result").toInt(); query = QString("insert into filter (filter_id, filter_screen, filter_name, filter_value, filter_username) " " values (:filter_id, :screen, :name, :value, %1); ").arg(user); } qry.prepare(query); qry.bindValue(":filter_id", filterid); qry.bindValue(":screen", _classname); qry.bindValue(":value", _filter); qry.bindValue(":name", _filterName->text() ); if (qry.exec()) done(filterid); } qt-client-4.1.0/widgets/filterSave.ui000066400000000000000000000036121217451700100175250ustar00rootroot00000000000000 filterSave 0 0 400 100 Save Filter Filter Name: Shared Qt::Vertical 20 13 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save _filterName _shared _buttonBox qt-client-4.1.0/widgets/filtersave.h000066400000000000000000000015331217451700100173770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef FILTERSAVE_H #define FILTERSAVE_H #include "parameter.h" #include "ui_filterSave.h" class filterSave : public QDialog, public Ui::filterSave { Q_OBJECT public: filterSave(QWidget* parent = 0, const char* name = 0); void set(const ParameterList & pParams); public slots: void save(); private: QString _filter; QString _username; QString _classname; }; #endif // filterSave_H qt-client-4.1.0/widgets/glCluster.cpp000066400000000000000000000441171217451700100175370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "glcluster.h" static QString _listAndSearchQueryString( "SELECT accnt_id, *," " CASE accnt_type WHEN 'A' THEN " " WHEN 'E' THEN " " WHEN 'L' THEN " " WHEN 'Q' THEN " " WHEN 'R' THEN " " ELSE accnt_type" " END AS accnt_type_qtdisplayrole" " FROM (ONLY accnt" " LEFT OUTER JOIN company ON (accnt_company=company_number)) " " LEFT OUTER JOIN subaccnttype ON (accnt_type=subaccnttype_accnt_type" " AND accnt_subaccnttype_code=subaccnttype_code)" " WHERE accnt_active" "" " AND (accnt_type IN ())" "" "" " AND (NOT COALESCE(company_external, false)) " "" "" " AND (company_yearend_accnt_id <> -1)" " AND (company_gainloss_accnt_id <> -1)" " AND (company_dscrp_accnt_id <> -1)" "" "" " AND ((accnt_name ~* )" " OR (accnt_descrip ~* )" " OR (accnt_extref ~* ))" "" " ORDER BY accnt_number, accnt_sub, accnt_profit;"); GLClusterLineEdit::GLClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "accnt", "accnt_id", "accnt_name", "accnt_descrip", "accnt_extref", 0, pName, "accnt_active") { setTitles(tr("Account"), tr("Accounts")); setUiName("accountNumber"); setEditPriv("MaintainChartOfAccounts"); setViewPriv("ViewChartOfAccounts"); setNewPriv("MaintainChartOfAccounts"); _showExternal = false; _ignoreCompany = false; if (_x_metrics) { if (_x_metrics->value("GLCompanySize").toInt() == 0) _ignoreCompany = true; } _query = "SELECT accnt_id AS id, accnt_name AS number, " " accnt_descrip AS name, accnt_extref AS description, " " accnt_active AS active, accnt_type, " " COALESCE(company_id, -1) AS company_id, " " COALESCE(company_yearend_accnt_id, -1) AS company_yearend_accnt_id, " " COALESCE(company_gainloss_accnt_id, -1) AS company_gainloss_accnt_id, " " COALESCE(company_dscrp_accnt_id, -1) AS company_dscrp_accnt_id " "FROM ONLY accnt " " LEFT OUTER JOIN company ON (accnt_company=company_number) " "WHERE (true) "; _typeMap.insert("A", tr("Asset")); _typeMap.insert("L",tr("Liability")); _typeMap.insert("R", tr("Revenue")); _typeMap.insert("E",tr("Expense")); _typeMap.insert("Q", tr("Equity")); setType(GLCluster::cUndefined); } void GLClusterLineEdit::setId(const int pId) { _query.replace("FROM ONLY accnt","FROM accnt"); VirtualClusterLineEdit::setId(pId); _query.replace("FROM accnt","FROM ONLY accnt"); } void GLClusterLineEdit::setType(unsigned int pType) { _type = pType; buildExtraClause(); } void GLClusterLineEdit::setShowExternal(bool p) { _showExternal = p; buildExtraClause(); } void GLClusterLineEdit::setIgnoreCompany(bool p) { _ignoreCompany = p; } int GLClusterLineEdit::companyId() { if (model()) { if (model()->rowCount()) return model()->data(model()->index(0,6)).toInt(); } return -1; } void GLClusterLineEdit::buildExtraClause() { _extraClause.clear(); _types.clear(); if(_type > 0) { if(_type & GLCluster::cAsset || _type & GLCluster::cUndefined) _types << ("A"); if(_type & GLCluster::cLiability || _type & GLCluster::cUndefined) _types << ("L"); if(_type & GLCluster::cExpense || _type & GLCluster::cUndefined) _types << ("E"); if(_type & GLCluster::cRevenue || _type & GLCluster::cUndefined) _types << ("R"); if(_type & GLCluster::cEquity || _type & GLCluster::cUndefined) _types << ("Q"); } if(!_types.isEmpty()) _extraClause = "(accnt_type IN ('" + _types.join("','") + "'))"; if (!_extraClause.isEmpty() && !_showExternal) _extraClause += " AND "; if (!_showExternal) _extraClause += "(NOT COALESCE(company_external, false)) "; } void GLClusterLineEdit::sList() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); accountList* newdlg = listFactory(); if (newdlg) { ParameterList params; params.append("accnt_id", _id); params.append("type", _type); if (_showExternal) params.append("showExternal"); if (_ignoreCompany) params.append("ignoreCompany"); newdlg->set(params); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sList() not yet defined") .arg(metaObject()->className())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void GLClusterLineEdit::sSearch() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); accountSearch* newdlg = searchFactory(); if (newdlg) { ParameterList params; params.append("accnt_id", _id); params.append("type", _type); if (_showExternal) params.append("showExternal"); if (_ignoreCompany) params.append("ignoreCompany"); newdlg->set(params); newdlg->setSearchText(text()); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sSearch() not yet defined") .arg(metaObject()->className())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void GLClusterLineEdit::sParse() { int oldid = _id; setStrict(false); VirtualClusterLineEdit::sParse(); if (_id != oldid && model()->rowCount()) { QString type = model()->data(model()->index(0,5)).toString(); int yearendid = model()->data(model()->index(0,7)).toInt(); int gainlossid = model()->data(model()->index(0,8)).toInt(); int dscrpid = model()->data(model()->index(0,9)).toInt(); if (!_ignoreCompany && (yearendid == -1 || gainlossid == -1 || dscrpid == -1 )) { QMessageBox::critical(this,tr("Company Incomplete"), tr("The Company associated with this Account has incomplete information. " "You must complete the Company record to use this Account.")); setId(-1); } else if (_type && !_types.contains(type)) { QStringList _typeNameList; for (int i = 0; i < _types.count(); i++) _typeNameList.append(_typeMap.value(_types.at(i))); QString _typeNames = _typeNameList.join(" or "); QString msg = tr("The Account used here would typically be type %1. " "Selecting this Account may cause unexpected results in your " "General Ledger. Are you sure this is the Account you " "want to use here?").arg(_typeNames); if (QMessageBox::warning(this, tr("Non-standard Account Type"),msg, QMessageBox::No | QMessageBox::Default | QMessageBox::Yes | QMessageBox::Escape) == QMessageBox::No) setId(-1); } } setStrict(true); } accountList* GLClusterLineEdit::listFactory() { return new accountList(this); } accountSearch* GLClusterLineEdit::searchFactory() { return new accountSearch(this); } ////////////////////////////////////// GLCluster::GLCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new GLClusterLineEdit(this, pName)); disconnect(_number, SIGNAL(newId(int)), this, SIGNAL(newId(int))); connect(_number, SIGNAL(newId(int)), this, SLOT(sNewId(int))); _id = -1; _name->show(); _projectVisible = false; _projectLit = new QLabel("-", this); _projectLit->setVisible(false); _grid->addWidget(_projectLit, 0, 2); _project = new ProjectLineEdit(this); _project->setAllowedStatuses(ProjectLineEdit::InProcess); _project->setEnabled(false); _project->setVisible(false); _project->setNullStr(tr("project")); _grid->addWidget(_project, 0, 3); setFocusProxy(_number); setTabOrder(_number, _project); setOrientation(Qt::Horizontal); } bool GLCluster::projectVisible() { return _project->isVisible(); } void GLCluster::setId(const int p) { int id = p; if (_x_metrics) { if (_x_metrics->boolean("EnableProjectAccounting")) { XSqlQuery qry; qry.prepare("SELECT accnt_id, prjaccnt_prj_id " "FROM xtprjaccnt.prjaccnt " "WHERE (accnt_id=:accnt_id); "); qry.bindValue(":accnt_id", p); qry.exec(); if (qry.first()) { id = qry.value("accnt_id").toInt(); if (qry.value("prjaccnt_prj_id").toInt() != -1 && !_projectVisible) setProjectVisible(true); if (_projectVisible) _project->setId(qry.value("prjaccnt_prj_id").toInt()); } } VirtualCluster::setId(id); } } bool GLCluster::setProjectVisible(bool p) { if (_x_metrics && p == true) { if (!_x_metrics->boolean("EnableProjectAccounting")) return false; } GLClusterLineEdit* number = static_cast(_number); number->disconnect(this, SLOT(sHandleProjectState(int))); _project->disconnect(this, SLOT(sHandleProjectId())); _projectLit->setVisible(p); _project->setVisible(p); _projectVisible = p; if (p) { setOrientation(Qt::Vertical); connect(number, SIGNAL(newId(int)), this, SLOT(sHandleProjectState(int))); connect(_project, SIGNAL(newId(int)), this, SLOT(sHandleProjectId())); } else setOrientation(Qt::Horizontal); return (p); } void GLCluster::sHandleProjectState(int p) { if (p == -1) { _project->setId(-1); _project->setEnabled(false); } else if (_project->isEnabled()) return; else { _project->setEnabled(true); _project->setFocus(); } } void GLCluster::sNewId(int p) { if(_project->isValid() && p != _id) sHandleProjectId(); else emit newId(p); } void GLCluster::sHandleProjectId() { XSqlQuery qry; qry.prepare("SELECT getPrjAccntId(:prj_id,:accnt_id) AS accnt_id"); qry.bindValue(":prj_id", _project->id()); qry.bindValue(":accnt_id", _number->id()); qry.exec(); qry.first(); _id = qry.value("accnt_id").toInt(); _number->setId(qry.value("accnt_id").toInt()); } /////////////////////////////////////////////////////////////////////////////// accountList::accountList(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { setObjectName("accountList"); setMinimumWidth(600); _search->hide(); _searchLit->hide(); disconnect(_search, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); _listTab->setColumnCount(0); if (_x_metrics) { if (_x_metrics->value("GLCompanySize").toInt() > 0) _listTab->addColumn(tr("Company"), 50, Qt::AlignCenter, true, "accnt_company"); if (_x_metrics->value("GLProfitSize").toInt() > 0) _listTab->addColumn(tr("Profit"), 50, Qt::AlignCenter, true, "accnt_profit"); } _listTab->addColumn(tr("Account Number"), 100, Qt::AlignCenter, true, "accnt_number"); if (_x_metrics) { if (_x_metrics->value("GLSubaccountSize").toInt() > 0) _listTab->addColumn(tr("Sub."), 50, Qt::AlignCenter, true, "accnt_sub"); } _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "accnt_descrip"); _listTab->addColumn(tr("Type"), 75, Qt::AlignLeft , true, "accnt_type"); _listTab->addColumn(tr("Sub. Type Code"), 75, Qt::AlignLeft, false, "subaccnttype_code"); _listTab->addColumn(tr("Sub. Type"), 100, Qt::AlignLeft, false, "subaccnttype_descrip"); setWindowTitle(tr("Account Numbers")); _titleLit->setText(tr("Chart of Accounts")); _parent = (GLClusterLineEdit*)(pParent); } XTreeWidget* accountList::xtreewidget() { return _listTab; } void accountList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("accnt_id", &valid); if (valid) _accntid = param.toInt(); param = pParams.value("type", &valid); if (valid) _type = param.toUInt(); _showExternal = pParams.inList("showExternal"); _ignoreCompany = pParams.inList("ignoreCompany"); } void accountList::sFillList() { ParameterList params; params.append("asset", tr("Asset")); params.append("expense", tr("Expense")); params.append("liability", tr("Liability")); params.append("equity", tr("Equity")); params.append("revenue", tr("Revenue")); if(_type > 0) { QStringList types; if(_type & GLCluster::cAsset) types << ("'A'"); if(_type & GLCluster::cLiability) types << ("'L'"); if(_type & GLCluster::cExpense) types << ("'E'"); if(_type & GLCluster::cRevenue) types << ("'R'"); if(_type & GLCluster::cEquity) types << ("'Q'"); if(!types.isEmpty()) params.append("typelist", types.join(", ")); } if (_showExternal) params.append("showExternal"); if (_ignoreCompany) params.append("ignoreCompany"); MetaSQLQuery mql(_listAndSearchQueryString); _listTab->populate(mql.toQuery(params), _accntid); } /////////////////////////// accountSearch::accountSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose); setObjectName( "accountSearch" ); setMinimumWidth(600); _accntid = -1; _typeval = 0; setWindowTitle( tr( "Search for Account" ) ); _typeLit = new QLabel(tr("Type:")); _type = new QComboBox(); _type->addItem(tr("ALL"), QVariant("")); _type->addItem(tr("Asset"), QVariant("A")); _type->addItem(tr("Liability"), QVariant("L")); _type->addItem(tr("Expense"), QVariant("E")); _type->addItem(tr("Revenue"), QVariant("R")); _type->addItem(tr("Equity"), QVariant("Q")); _typeStrLyt = new QHBoxLayout(this); _typeStrLyt->setObjectName("typeStrLyt"); _typeStrLyt->addWidget(_typeLit); _typeStrLyt->addWidget(_type); _typeStrLyt->addItem(new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed)); searchLyt->addItem(_typeStrLyt); // signals and slots connections connect( _type, SIGNAL(currentIndexChanged(int)), this, SLOT( sFillList())); _listTab->setColumnCount(0); if (_x_metrics) { if (_x_metrics->value("GLCompanySize").toInt() > 0) _listTab->addColumn(tr("Company"), 50, Qt::AlignCenter, true, "accnt_company"); if (_x_metrics->value("GLProfitSize").toInt() > 0) _listTab->addColumn(tr("Profit"), 50, Qt::AlignCenter, true, "accnt_profit"); } _listTab->addColumn(tr("Account Number"), 100, Qt::AlignCenter, true, "accnt_number"); if (_x_metrics) { if (_x_metrics->value("GLSubaccountSize").toInt() > 0) _listTab->addColumn(tr("Sub."), 50, Qt::AlignCenter, true, "accnt_sub"); } _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "accnt_descrip"); _listTab->addColumn(tr("Type"), 75, Qt::AlignLeft , true, "accnt_type"); _listTab->addColumn(tr("Sub. Type Code"), 75, Qt::AlignLeft, false, "subaccnttype_code"); _listTab->addColumn(tr("Sub. Type"), 100, Qt::AlignLeft, false, "subaccnttype_descrip"); disconnect(_searchNumber, SIGNAL(clicked()), this, SLOT(sFillList())); disconnect(_searchDescrip, SIGNAL(clicked()), this, SLOT(sFillList())); _searchNumber->hide(); _searchName->hide(); _searchDescrip->hide(); _showExternal = false; } void accountSearch::showEvent(QShowEvent* e) { if (!_search->text().isEmpty()) sFillList(); VirtualSearch::showEvent(e); } void accountSearch::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("accnt_id", &valid); if (valid) _accntid = param.toInt(); param = pParams.value("type", &valid); if (valid) { _typeval = param.toUInt(); if(_typeval > 0) { if(!(_typeval & GLCluster::cEquity)) _type->removeItem(5); if(!(_typeval & GLCluster::cRevenue)) _type->removeItem(4); if(!(_typeval & GLCluster::cExpense)) _type->removeItem(3); if(!(_typeval & GLCluster::cLiability)) _type->removeItem(2); if(!(_typeval & GLCluster::cAsset)) _type->removeItem(1); } } _showExternal = pParams.inList("showExternal"); _ignoreCompany = pParams.inList("ignoreCompany"); } void accountSearch::sFillList() { ParameterList params; params.append("asset", tr("Asset")); params.append("expense", tr("Expense")); params.append("liability", tr("Liability")); params.append("equity", tr("Equity")); params.append("revenue", tr("Revenue")); QStringList types; if (_type->currentIndex() > 0) types << _type->itemData(_type->currentIndex()).toString(); else if(_typeval > 0) { if(_typeval & GLCluster::cAsset) types << ("'A'"); if(_typeval & GLCluster::cLiability) types << ("'L'"); if(_typeval & GLCluster::cExpense) types << ("'E'"); if(_typeval & GLCluster::cRevenue) types << ("'R'"); if(_typeval & GLCluster::cEquity) types << ("'Q'"); } if(!types.isEmpty()) params.append("typelist", types.join(", ")); if (_showExternal) params.append("showExternal"); if (_ignoreCompany) params.append("ignoreCompany"); if (!_search->text().isEmpty()) params.append("searchtext", _search->text()); MetaSQLQuery mql(_listAndSearchQueryString); _listTab->populate(mql.toQuery(params), _accntid); } qt-client-4.1.0/widgets/glcluster.h000066400000000000000000000074541217451700100172470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef glCluster_h #define glCluster_h #include "virtualCluster.h" #include "parameter.h" #include "projectcluster.h" #include class XTUPLEWIDGETS_EXPORT accountList : public VirtualList { Q_OBJECT public: accountList(QWidget*, Qt::WindowFlags = 0); virtual XTreeWidget* xtreewidget(); public slots: virtual void set(const ParameterList & pParams); virtual void sFillList(); private: int _accntid; bool _showExternal; bool _ignoreCompany; unsigned int _type; }; class XTUPLEWIDGETS_EXPORT accountSearch : public VirtualSearch { Q_OBJECT public: accountSearch(QWidget*, Qt::WindowFlags = 0); public slots: void set(const ParameterList & pParams); void sFillList(); protected: void showEvent(QShowEvent*); private: int _accntid; bool _showExternal; bool _ignoreCompany; unsigned int _typeval; QComboBox* _type; QLabel* _typeLit; QHBoxLayout* _typeStrLyt; }; class XTUPLEWIDGETS_EXPORT GLClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: GLClusterLineEdit(QWidget*, const char* = 0); unsigned int type() const { return _type; } void setType(unsigned int pType); bool showExternal() { return _showExternal; } void setShowExternal(bool p); bool ignoreCompany() { return _ignoreCompany; } void setIgnoreCompany(bool p); int companyId(); public slots: void sList(); void sSearch(); void setId(const int); protected slots: accountList* listFactory(); accountSearch* searchFactory(); void buildExtraClause(); void sParse(); protected: QMap _typeMap; private: unsigned int _type; bool _showExternal; bool _ignoreCompany; QStringList _types; }; class XTUPLEWIDGETS_EXPORT GLCluster : public VirtualCluster { Q_OBJECT public: GLCluster(QWidget*, const char* = 0); enum Type { cUndefined = 0x00, cAsset = 0x01, cLiability = 0x02, cExpense = 0x04, cRevenue = 0x08, cEquity = 0x10 }; Q_INVOKABLE unsigned int type() const { return static_cast(_number)->type(); } Q_INVOKABLE void setType(unsigned int pType) { static_cast(_number)->setType(pType); } Q_INVOKABLE bool showExternal() { return static_cast(_number)->showExternal(); } Q_INVOKABLE void setShowExternal(bool p) { static_cast(_number)->setShowExternal(p); } Q_INVOKABLE bool ignoreCompany() { return static_cast(_number)->ignoreCompany(); } Q_INVOKABLE void setIgnoreCompany(bool p) { static_cast(_number)->setIgnoreCompany(p); } Q_INVOKABLE bool projectVisible(); Q_INVOKABLE bool setProjectVisible(bool p); Q_INVOKABLE int companyId() { return static_cast(_number)->companyId(); } public slots: void setId(const int p); protected slots: void sHandleProjectState(int p); void sHandleProjectId(); void sNewId(int p); private: ProjectLineEdit* _project; QLabel* _projectLit; bool _projectVisible; int _id; }; #endif qt-client-4.1.0/widgets/guiclientinterface.h000066400000000000000000000024201217451700100210730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef guiclientinterface_h #define guiclientinterface_h #include "parameter.h" #include #include class XSqlQuery; class GuiClientInterface { public: virtual ~GuiClientInterface() {} virtual QWidget* openWindow(const QString pname, ParameterList pparams, QWidget *parent = 0, Qt::WindowModality modality = Qt::NonModal, Qt::WindowFlags flags = 0) = 0; virtual QAction* findAction(const QString pname) = 0; virtual void addDocumentWatch(QString path, int id) = 0; virtual void removeDocumentWatch(QString path) = 0; virtual bool hunspell_ready() = 0; virtual int hunspell_check(const QString word) = 0; virtual const QStringList hunspell_suggest(const QString word) = 0; virtual int hunspell_add(const QString word) = 0; virtual int hunspell_ignore(const QString word) = 0; }; #endif qt-client-4.1.0/widgets/imageAssignment.cpp000066400000000000000000000145701217451700100207060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include "imageAssignment.h" #include "imageview.h" imageAssignment::imageAssignment(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, fl) { setupUi(this); setObjectName(name ? name : "imageAssignment"); setModal(modal); // signals and slots connections connect(_image, SIGNAL(valid(bool)), _save, SLOT(setEnabled(bool))); connect(_close, SIGNAL(clicked()), this, SLOT(reject())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_new, SIGNAL(clicked()), this, SLOT(sNew())); connect(_view, SIGNAL(clicked()), this, SLOT(sView())); _image->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "image_name" ); _image->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "image_descrip" ); _imageassid = -1; _mode = cNew; _source = Documents::Uninitialized; _sourceid = -1; sFillList(); } /* * Destroys the object and frees any allocated resources */ imageAssignment::~imageAssignment() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void imageAssignment::languageChange() { retranslateUi(this); } void imageAssignment::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("sourceType", &valid); if (valid) { _source = (enum Documents::DocumentSources)param.toInt(); if (_source != Documents::Item) { _purpose->setCurrentIndex(3); _purpose->hide(); _purposeLit->hide(); } } param = pParams.value("source_id", &valid); if (valid) _sourceid = param.toInt(); param = pParams.value("imageass_id", &valid); if (valid) { _imageassid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _purpose->setFocus(); } else if (param.toString() == "edit") { _mode = cEdit; _save->setFocus(); _purpose->setEnabled(FALSE); } else if (param.toString() == "view") { _mode = cView; _save->hide(); _new->hide(); _purpose->setEnabled(FALSE); _image->setEnabled(FALSE); } } } void imageAssignment::sSave() { QString purpose; if (_purpose->currentIndex() == 0) purpose = "I"; if (_purpose->currentIndex() == 1) purpose = "P"; if (_purpose->currentIndex() == 2) purpose = "E"; if (_purpose->currentIndex() == 3) purpose = "M"; XSqlQuery newImage; if (_mode == cNew) { _imageassid = -1; if (purpose != "M") { XSqlQuery imageassid; imageassid.prepare( "SELECT imageass_id " "FROM imageass " "WHERE ( (imageass_source_id=:source_id)" " AND ( imageass_source=:source) " " AND (imageass_purpose=:imageass_purpose) );" ); imageassid.bindValue(":source", Documents::_documentMap[_source].ident); imageassid.bindValue(":source_id", _sourceid); imageassid.bindValue(":imageass_purpose", purpose); imageassid.exec(); if (imageassid.first()) { _imageassid = imageassid.value("imageass_id").toInt(); _mode = cEdit; } } if (_imageassid == -1) { XSqlQuery imageassid; imageassid.prepare("SELECT NEXTVAL('docass_docass_id_seq') AS _imageass_id;"); imageassid.exec(); if (imageassid.first()) _imageassid = imageassid.value("_imageass_id").toInt(); } newImage.prepare( "INSERT INTO imageass " "( imageass_id, imageass_source, imageass_source_id, imageass_purpose, imageass_image_id ) " "VALUES " "( :imageass_id, :imageass_source, :imageass_source_id, :imageass_purpose, :imageass_image_id );" ); } if (_mode == cEdit) newImage.prepare( "UPDATE imageass " "SET imageass_purpose=:imageass_purpose, imageass_image_id=:imageass_image_id " "WHERE (imageass_id=:imageass_id);" ); newImage.bindValue(":imageass_id", _imageassid); newImage.bindValue(":imageass_source", Documents::_documentMap[_source].ident); newImage.bindValue(":imageass_source_id", _sourceid); newImage.bindValue(":imageass_image_id", _image->id()); newImage.bindValue(":imageass_purpose", purpose); newImage.exec(); done(_imageassid); } void imageAssignment::sNew() { ParameterList params; params.append("mode", "new"); imageview newdlg(this, "", TRUE); newdlg.set(params); if (newdlg.exec() != QDialog::Rejected) sFillList(); } void imageAssignment::sView() { ParameterList params; params.append("mode", "view"); params.append("image_id", _image->id()); imageview newdlg(this, "", TRUE); newdlg.set(params); newdlg.exec(); } void imageAssignment::sFillList() { _image->populate( "SELECT image_id, image_name, firstLine(image_descrip) AS image_descrip " "FROM image " "ORDER BY image_name;" ); } void imageAssignment::populate() { XSqlQuery imageass; imageass.prepare( "SELECT imageass_purpose, imageass_image_id, imageass_source " "FROM imageass " "WHERE (imageass_id=:imageass_id);" ); imageass.bindValue(":imageass_id", _imageassid); imageass.exec(); if (imageass.first()) { if (imageass.value("imageass_source").toString() == "I") { QString purpose = imageass.value("imageass_purpose").toString(); if (purpose == "I") _purpose->setCurrentIndex(0); else if (purpose == "P") _purpose->setCurrentIndex(1); else if (purpose == "E") _purpose->setCurrentIndex(2); else if (purpose == "M") _purpose->setCurrentIndex(3); } else { _purpose->setCurrentIndex(3); _purpose->hide(); _purposeLit->hide(); } _image->setId(imageass.value("imageass_image_id").toInt()); } } qt-client-4.1.0/widgets/imageAssignment.h000066400000000000000000000023421217451700100203450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IMAGEASSIGNMENT_H #define IMAGEASSIGNMENT_H #include #include #include "documents.h" #include "widgets.h" #include "ui_imageAssignment.h" class imageAssignment : public QDialog, public Ui::imageAssignment { Q_OBJECT public: imageAssignment(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~imageAssignment(); virtual void populate(); public slots: virtual void set( const ParameterList & pParams ); virtual void sSave(); virtual void sNew(); virtual void sView(); virtual void sFillList(); protected slots: virtual void languageChange(); private: enum Documents::DocumentSources _source; int _mode; int _sourceid; int _imageassid; }; #endif // IMAGEASSIGNMENT_H qt-client-4.1.0/widgets/imageAssignment.ui000066400000000000000000000171371217451700100205430ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. imageAssignment 0 0 484 313 Image Assignment 12 12 12 12 12 12 Purpose: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 0 0 Inventory Description Product Description Engineering Reference Miscellaneous Qt::Horizontal 40 20 Qt::Vertical QSizePolicy::Preferred 20 0 Qt::Horizontal 40 20 5 &Close false &Save 7 0 &New false &View Qt::Vertical QSizePolicy::Expanding 20 20 XComboBox QComboBox

    xcombobox.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    _purpose _image _new _view _save _close _image valid(bool) _save setEnabled(bool) 26 94 561 59 _close clicked() imageAssignment reject() 561 27 20 20 _image valid(bool) _view setEnabled(bool) 432 111 572 117 qt-client-4.1.0/widgets/imagecluster.cpp000066400000000000000000000065411217451700100202560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "imagecluster.h" #include #include #include #define DEBUG false ImageCluster::ImageCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new ImageClusterLineEdit(this, pName)); _image = new QLabel("picture here"); _image->setPixmap(_nullPixmap); _image->setAlignment(Qt::AlignLeft | Qt::AlignTop); QScrollArea * scrollArea = new QScrollArea(); scrollArea->setWidgetResizable(true); scrollArea->setAlignment(Qt::AlignLeft | Qt::AlignTop); scrollArea->setWidget(_image); _grid->addWidget(scrollArea, 1, 0, -1, -1); _description->hide(); _name->hide(); _nullPixmap = QPixmap(); } void ImageCluster::clear() { if (DEBUG) qDebug("%s::clear()", qPrintable(objectName())); VirtualCluster::clear(); _image->setPixmap(_nullPixmap); } void ImageCluster::sRefresh() { if (DEBUG) qDebug("%s::sRefresh()", qPrintable(objectName())); VirtualCluster::sRefresh(); if (id() == -1) { if (DEBUG) qDebug("ImageCluster::sRefresh() without a picture"); _image->setText(tr("picture here")); _image->setPixmap(_nullPixmap); } else { XSqlQuery data; data.prepare("SELECT image_data FROM image WHERE image_id=:image_id"); data.bindValue(":image_id", id()); data.exec(); if (data.first()) { if (DEBUG) qDebug("ImageCluster::sRefresh() has picture %s, %d", qPrintable(_description->text().right(128)), data.value("image_data").toString().length()); QImage tmpImage; tmpImage.loadFromData(QUUDecode(data.value("image_data").toString())); _image->setPixmap(QPixmap::fromImage(tmpImage)); } } if (DEBUG) qDebug("ImageCluster::sRefresh() returning"); } void ImageCluster::setNumberVisible(const bool p) { _number->setVisible(p); _label->setVisible(!_label->text().trimmed().isEmpty() || p || _name->isVisible()); } ImageClusterLineEdit::ImageClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "image", "image_id", "image_name", "image_descrip", 0, 0, pName) { setTitles(tr("Image"), tr("Images")); setUiName("image"); setEditPriv("MaintainImages"); setNewPriv("MaintainImages"); } VirtualInfo *ImageClusterLineEdit::infoFactory() { return new ImageInfo(this); } VirtualList *ImageClusterLineEdit::listFactory() { return new ImageList(this); } VirtualSearch *ImageClusterLineEdit::searchFactory() { return new ImageSearch(this); } ImageInfo::ImageInfo(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualInfo(pParent, pFlags) { _descripLit->hide(); _descrip->hide(); } ImageList::ImageList(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { _listTab->hideColumn(2); } ImageSearch::ImageSearch(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { _listTab->hideColumn(2); _searchDescrip->hide(); } qt-client-4.1.0/widgets/imagecluster.h000066400000000000000000000032541217451700100177210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _imageCluster_h #define _imageCluster_h #include "virtualCluster.h" #include class ImageInfo : public VirtualInfo { Q_OBJECT public: ImageInfo(QWidget*, Qt::WindowFlags = 0); }; class ImageList : public VirtualList { Q_OBJECT public: ImageList(QWidget*, Qt::WindowFlags = 0); }; class ImageSearch : public VirtualSearch { Q_OBJECT public: ImageSearch(QWidget*, Qt::WindowFlags = 0); }; class XTUPLEWIDGETS_EXPORT ImageClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: ImageClusterLineEdit(QWidget*, const char* = 0); protected: virtual VirtualInfo *infoFactory(); virtual VirtualList *listFactory(); virtual VirtualSearch *searchFactory(); }; class XTUPLEWIDGETS_EXPORT ImageCluster : public VirtualCluster { Q_OBJECT Q_PROPERTY(bool numberVisible READ numberVisible WRITE setNumberVisible) public: ImageCluster(QWidget*, const char* = 0); public slots: virtual void clear(); virtual void sRefresh(); virtual bool numberVisible() const { return _number->isVisible(); }; virtual void setNumberVisible(const bool p); protected slots: private: QLabel *_image; QPixmap _nullPixmap; }; #endif qt-client-4.1.0/widgets/images/000077500000000000000000000000001217451700100163255ustar00rootroot00000000000000qt-client-4.1.0/widgets/images/add_24.png000066400000000000000000000031311217451700100200660ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDùC» pHYsHHFÉk> vpAgxL¥¦äIDATHÇ–ÛU‡Ÿµ¾Ó>ÌÞ{f˜étZZq ¤Jc-Eeš¦ˆ!j(ÚØj4M$bÔÄD%鯄»F@1†4b,c$G(uжÐv˜¡Ó™=³Oßi}ëäÅ êˆoòÞ¬‹çIÖZïú-Áÿªy@"041Lâi Èl’’â¹ôÁñ¾«÷‚Í}¾&á§[ÍÖîZRkx<….ò¬ÌVŒ1/#xÉ_Í?D æ¾ð³Á“{f÷|õ¡ûš8zð(³Ó³ `X Yí­ryå2 WX\ZÜfÃ_g ¸B œÿ3ø7üˆÀ÷=4x°^¯?wú §~æûÏÔO~ö$Ó·Mc¥¥t%>ð´ÛmöìÚÃÌôL=³Ùá<à…ÿ'5®³¸ü_1/ðÎC̃íVûÙ§¾õÔþ3ß<ƒ—ž¥%Ö³uln)úÅ ÀÄš5µFjR“ã“h¡gzEï˜Ç_$Ù–üã=Á^ž»“Zòì™GÏìâĬl®°6ZcTP^qëò*ˋ˜ûù9:³-ÊFŽr…ÉHÍxR“Mºø$ð"6¹¡8"ðøøÑ‰c'>vü1n¬ß _öÉLFn2¬°X¿Õ›½MʲÀÈ’ÌXÊn°Ò[¡7 ÂÙ”r?Äð=Å„h>5»söÔã_zœõá:݂ٙ+WBàp8¬±h£!r¬ë® ¯Ò«úØÐ4$NÄx¥¨NYížCp!Ü>ããóæ'':¬VIMJî¶àÚ— ’xûÚ ¶ËJuY7tÂJʲ"$ ðÎO•B?Çá…Ð[?$Áýæ°1Ú`T()Q^a¨°Ò„GJIÈÄ311^ µ¡,5y^!EŠskιù²¬š!ŽÉF­q{k¬Åf¾I~àiF ¼ðx2¬¥]ÍswÎq¨3OÏã=¸Èãj(^ŠÏëú5´ŽÐÚìõÞß­(ŒÆ´Ó ÕQÄòëË$µ„JUH)‰âˆ8Ž9|ø0½kâšÀ{uU*ʪ ùñ&IR)KcÖ¹Và¼cTŒ…¤nê¼xþEzýÆZ ¤¤(r²,CJÉÌÌ am ¬A•й»æØ{pœ0 CI„Æ"H•VÙúp_÷”IÉá¯Ü‹12‚JD I§?Ã`9åÂ+øÚ¾ˆ˜Í0ÆQiƒÒëžܲ¬þ¤ÿ>™|˜†ÜM“A=8Ùî´&g&¦˜™˜fº=Ŏ֦Ʀ EÈRï:{waóæ`åyç8D\® ÏúÓà ýo†˜„C$<%á‘F½¾·Y«5ã8Æã2e‹¥ÊVöøs_ªîÓ£ÿóWñ^}PÀ8cDLËf ¤”©¢k ŸŠªŸÙDü °CZ† XöƒIEND®B`‚qt-client-4.1.0/widgets/images/binoculars_24.png000066400000000000000000000027541217451700100215110ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDùC» pHYsHHFÉk> vpAgxL¥¦wIDATHÇí•ÛoõÇ¿3¿¹îÌîxvmovuœõÆŽ“˜Û$¡•P*Rå! ¥-OÐ4â¡JU[)ªÈ€DRH@€€@@‘Eqdµ&©cǎח¯›]Û{Ÿ™Ëo†‡H ªúŸ·£#Ï9:::ÀOüÌ÷%ƒ ÀŽÎ´ÈòQÖ?sæÌñt¦Ç>÷‹Ÿ^ŸœàˤëKs6Ã0ÿ›€çœzòýìü/†þË=ƒê­å•âæíü±î¾~·Z.}’êH¤–ç×®þí—¿:vé¥çÏÁ¨×¾U‹|38zâQ,ÌLbµâ)-­§Y–œnm–äP×ø®í·mGˆÅ“²a•ÜE)íaxé=žÚ}``xëÊ?/æ'æ7075þí ºûáᇎ£R©‘•ð¢é)—¶°¾²øŠ$`xø¢mí¸13‹Ó“`X‚ÄÎ.Ä;á6ͬ٨þNÓ´Ëÿ¹€WFÿ{‚¡Ã÷cîæMuooÏs áF}ÀhÔ!"ZÛãˆèm`ÔjU4] A`š&ÇCQÂày¿üÅåãí­ÎÂìÔׂ}÷ cw: Y–Œh‘ÓÔux¸p›Êå2!Pé®N¸^J=†z­ =‚"x®øAʧôZXU³D”p{}åŽàÀðd¸H8ò¥t˜° "‘0:’I0P¼G€`:`ù"á…ü­ÜB£°¾Ý“éÆžL¾ï£Ñh R­ò¦iÒ™ìüÇñ ?—–iB×´!êÓ£¢ Ù…"ª‚t: ®O~9G}öÏQ] r óÏÜ;˜éH&1—G¹RE4ž„¨h åÊј® 9vóßîj•|ßïHttFcñ$ì¦B8”¶7Q©V°3Õ‰®t&159¾íû>ÅyAÀøÄ8<» "ÊàyšEµZ‰®ÜZì äÎz¹c¿ý=ÔpŽm'4=JõØÑÏ’qmb¶íÔCjxdÏÀ“ãE8ÆÖÈÒâbÿfñvxx DÁ¢|?@K¬ô¼/!"ºzöƒsÛ[V\–¤“ð†ƒI`aaAà¿Y*•^6LkA!` †aŸiZæÐ'8Bu)…’À1.@Æs쓵Zõ=–a lKDEu«pBâ¹Át+ì‚!l×LúT*ÑþùØÈß›cŸ}„Kç?Äè§ï7“í­ŸúÔfÅ‚œMÆ2Ù× ñd°¾]8¡k*Èbv&¾g遼ªžÚ`ÝLbk6ÀÊâ2x"ÞÙ±òÞÛ¯}ô›“ObæË«€GNýï¾õ 8zü”YóFë¨_o‡•mÃÆ\†(Nìâù>a»2½}ðI_nr-z»zbHuÇ@(‹Ù+³°m'}öÕwåtï¾»çŸî݇g_ÿ@¶m;}ãÊ4H¥cØÕƒU±|}ÔcúR»3û¸ˆ¦[¶c:¤Å@æ~é.ŽÃ¢vÕÇêLÅüZƒãê{Þ]O)8^ …µ†‹vì °ÿUñ ®±X¼TƒíðŽ¢j&+ˆò´ç¹cÚNE/‡†°Š2“ƒ%nC‰ V1¿öÎéÇí¸ßxž‹?=vÜ)æ×ßQ¢’e‰e”°C\CÑ[‚–áyöÏ ÓD G\Û¶¦}êeIèôR­„Õ•\qm5wv{këUYQ¼Kç?¼+øbt‘–(ª•RÖs]W’¥~>$)†m¡°™wŠ…ü…F½öWË469¤B …øÎóÜÏEQènZ–U)—®zž7àëÖ¿Ž®¿Eo¹O–CrÓvÇùÃ’rÓ2þ߇øcà+ÄB‘Ð[¤ ”IEND®B`‚qt-client-4.1.0/widgets/images/bold.xpm000066400000000000000000000012131217451700100177700ustar00rootroot00000000000000/* XPM */ static char *bold_xpm[] = { "22 22 2 1", " c None", ". c #000000", " ", " ", " ", " ", " ......... ", " ... ... ", " ... ... ", " ... ... ", " ... ... ", " ... ... ", " ........ ", " ... .... ", " ... .... ", " ... ... ", " ... ... ", " ... ... ", " ... ... ", " .......... ", " ", " ", " ", " "}; qt-client-4.1.0/widgets/images/calendar_24.png000066400000000000000000000020171217451700100211110ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDÿÿÿ ½§“ÄIDATHǵ–MOW†Ÿ;66õß`",D²©h©U»TEBbÕ?‘ÒʶÙd—þ„"µ‹ZâS¤,,lË Ð˜àÖ±Ží™ÓøÆnJ¥DÍ‘Fwž{®î«9£D„O€RJ½ÿóÞ%ñ¬[èµû~9·»?ÇŠ6°¢ÞíÕÀŠùXÑ*Ðþ¤RW4\“†kÝŽ&Js¼ Vønø£)€²ÇQö µ¿~Æo|†4xWU¼jõò5vW3Å»¾ Q)‚ØÁì®/©ÿ™ÆŠ}xR·ðÞ¼n/‘±º0ÃãX‚‰{ÔË¿"^ eˆßàMf‹Ø7+H­Š_3¸>:¢vô^ÕÄ þ‡mñ¯°{Ã!EçàzV¼ŽRÈß¢ì ø>~]¡Ô=nˆªóÿíméî°üþwïP¶P¹,¡,¡»/~Ã%Þ^T tw÷PvKˆ±þ¤[Qê,ã× éAŠ«ŠËÚO¨Å›6í{ò䉸¾/""ÙlVÖÖÖdggGóóçÏåéÓ§šŸ={&›››""rxx(«««âº®ˆˆœŸŸ 0-"ïö÷÷¥ÙlVÒé´xž§ykkK.//5g³Ù¶õ™LFs«€ö@Dð}_ß›¦ €ïûˆñxœP(¤¹™k©Â{Üê¹±±A¡PÀ²,ÇáììŒññq"‘ŽãpuuÅðð0ápÇqÈd2<|øÃ0p‡ëëk ”ËeàÆƒ¦€wttÄãÇ1M“\.ÇÞÞ÷ïßgrr’\.Ç‹/H&“qü Ð^q[t®ÌIEND®B`‚qt-client-4.1.0/widgets/images/center.xpm000066400000000000000000000012151217451700100203320ustar00rootroot00000000000000/* XPM */ static char *center_xpm[] = { "22 22 2 1", " c None", ". c #000000", " ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ", " "}; qt-client-4.1.0/widgets/images/credit_hold.png000066400000000000000000000007121217451700100213130ustar00rootroot00000000000000‰PNG  IHDR ™ fsRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÚ$SߊJIDAT(Ï•‘±KBqÇ¿÷»K›"Á(ŸQ‹ BCT´¸ØðÖZ¢"pìï°@—„úžÐ$-A Ás*h‰J(4í½§×ZZ Þr÷ûq÷á¾ßúÂ#Zl½D5jNÖ%TiHHëÒv¾­IxfЬéó©Çòî³í± axßc™ ˜³ƒ Ò•ÁpNªE%€+´ti?#Y‡ÖÛ_¡øGåyý~ÜOL­Ì€iP ¨@záíÉïôär9- Ý™D"ñ—êF¬q7biy2vâF,u#V©¿'ŸÏ«mÛšÉd´g“›è\@Õ€>Ô,CuDG+/ÔrGS©õxðØ5€j Ø3ßR6 8Pþχ çľ1;Ë|“¥ä³ `9ö ߘôHƞœ£ÆªÂ\ÔÞz¼s†¹Îioj¾Ñ8ÞGIEND®B`‚qt-client-4.1.0/widgets/images/credit_warn.png000066400000000000000000000006521217451700100213370ustar00rootroot00000000000000‰PNG  IHDR ™ fsRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÚ1Û *IDAT(ϕѱj“qðß _þß,EPº$ƒƒ ¥SR—:¥BE"}qq$ƒ¯ÐR‚ƒK@}€t¨JÍââæݤ("ô:4i›žérï=‡sÏ g/ÜÆX‹g>š1%¿tK — ‡_p7žøö?‘Æ´*^gí»Ê=…hz¬¸ªØ:ÏI5­j—ñ&ìÆ±ôXZÌ9Ωfœlái°49§46\(ÈWîhx‹+“Ö®°~Ÿì ƒ‡SN«ÕšÉñȧ,®)hÚQ¬hÚ›ÝéõzÑívA»ÝÖï÷ãïwÞYÀ!~ágr3x€çqÿ´cFÙétâl°Ÿq˜<œ0–±‰¯ÿÊáDàô‹+ëj×£ØWˆÚ¶ZCeÕEp4¹çv~ð#ßëÌËû6•H1«IIEND®B`‚qt-client-4.1.0/widgets/images/diskette_24.png000066400000000000000000000023561217451700100211620ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDùC» pHYsHHFÉk> vpAgxL¥¦yIDATHǵ•¿nG‡¿þ3ȉ’HB°|JRæPâDÀÀ€3~?G Güvp.8Â]p‰ì€†aP¹\“ÃÝÙîéé.£ŠÂ9pà4Pt}U¿éª†¿ÙÔÓ§OI)Ý»}ûöçççG!„_D„,˶?~üIY–@DH)!"ÔuMÓ4h­UJ©yñâÅ¢ªªª®ë½|ùò»íííþÙ³gØk×®Ñ÷ý½½½½/뺶Ëå2xïÕææ¦ÞÙÙ!„@¾ï !ðöí[QJ‘e7oÞDk-wïÞU“Éä³ÂöóçÏ¿>88ˆ6Æ8\,j6›{ïY­Vxï麎®ëðÞ3N9::B)Ežçh­ñÞ+çY–]ßÝÝýêÉ“'ˇ~c»®#„€÷žù|Îéé)Y–Q×5Î9êº+ˆ12›Í˜N§#àÆ¬V+š¦!ƈRjk2™|zppð­õÞÓ÷=Î9æóùxp2™ðúõë±:¥J)ÎÏÏ999A)EQܹsg¬“ðÞkÛuÝÀéé)J)B¼yó†<Ï¯Ü ­5ggg£µ¦,K‹Å@ß÷´m‹µë½'ÆÈjµâââ‚ét:[øP×5Óét4MƒsŽår9š¦¡(Š«€uÆœsœœœP–%Zk´Öˆ"BUUQ7ž“eÏ2$’ AŒVX V+¬ÑdF ¾†ÍÂ’!Œ· À®ï¹ˆB áh˜.{Dø š÷!—€Â§A÷÷Í®c }X…ĉ÷ q … - BÃà‹B dÚRèA÷+€õ|ÉóœÐulj˜”~/kþ¿¯/+¨JKþ µ!PfŠJ4ƒ™ÖC%扣o”¢* ¹¨õ4eEQ¼tž¡S‡N•z”¨ P`Šœ¢,(‹œ2+(Ë‚Í K š”Þ{&“ɰÖbŒaccƒ‹úŒtü3vó&FzŒôhéÑ)¢¥`€É2$ËYYFÌsBQpþæ7Þ=:TUÅ«W¯°!bŒiww—º®ùõdžfŠñÊJ1S$öþÃÜöý8ò›¦akk‹®ëÒb±ÀÎf3D俇‡‡Ÿ_¿~ݶm;>u¥”H)áœÓÀOι«üï°?4çxÉwŠîÁIEND®B`‚qt-client-4.1.0/widgets/images/edit.png000066400000000000000000000006601217451700100177620ustar00rootroot00000000000000‰PNG  IHDR ™ fsRGB®ÎébKGDÿÿÿ ½§“ pHYs  šœtIMEÚ*)ç$010IDAT(Ïc` z–¯f»¿jéòÓñ‘ûp©aÁgÀñ‰Ç9yµy÷<~ûÊêË \êqI$J`•ä‘Z¯÷[ÛûòÚËÇÔýã--í›M6\Š|ŠÛï¾¹k·öš­§ …ò[Jü"Ú;YDzXD9E7ÜûxÏî乓‡>üüÈ%ñŸ·YÐ] Ê)ºáþ›û®§.œÚ}ëí€ÿmÿQ X¸páÿ5kÖÀù:::ˆ0I8”ÀªÈ§¸çÞÇ{v'OÜýõÏW¯Ç•ÿ`³yÑ¢EÿW¯^Í ««ËÐÖÖ1C}§w͹š-q{âþ«w©d¬bä"õ{÷îý"°âBÃò؃ñÿ5{5·ˆ5‹±2 ^o5=º>õƒuæ"†v6nr€£áÔYÕŽú –,x\*ÊjÈIEND®B`‚qt-client-4.1.0/widgets/images/folder_zoom_64.png000077500000000000000000000100641217451700100216670ustar00rootroot00000000000000‰PNG  IHDR@@ªiqÞbKGDùC» pHYsHHFÉk> vpAg@@êóø`¿IDATxÚíš[Œ]ÕyÇk­½÷9g®žÏ_ÁµÁsÒˆ–D*¤ªR©B }¨*µ‘š¨j¥>DjûÒ<4T%RÚô¡U%)QCÚR( lŒ Æ€Ûø:ØsŸ±gÎu_ÖZ}Øûœ³Ïž}ƒ"9r½¤uÖõœ³þß÷ÿ¾õ­µ7\O×Óõt=]O×Óõt=ý?M"Ý8üCÆ€?²†AÀ B€ $H™i'ãÍ1)‘BòŠÖüÜu`ËÓWâêÉiÿǤbù‚t YÝåI§HS¹9- BX¢Ê l0·Kyì*Wà ZË“=kïñnzâ'(o°WücBH–Oü-哽[Hv®6ÀOJ2ÓÞ"% ny·ç¤Óƒtz¯8 U¢´á«8¥Ñ!)øÀÔ WâêÉ8ò#°€G”׳Å) P}¬F$^¢å,DRO÷·êkj¸=ˆôÜo:’Àréjƒ\- €w~X<áòoRˆg”[BHѲõ¦ãëV—)  +Zóµß¿N ,›lë#lâTif™pª-Ejõr¥"šF+Rãé‚`vþAÂ]›DÀ^ „ÔÛšNk=]Ï0`å\Ñ…â{CLa;w› ˆXÐ$³MЉ@›ýéÒÒ®g׃H0‹ìzZË]‚oZ86€5°ž5¢Ð±¼Ä.RP?½„Ýìè>Á¶v“ÀðNÁ¤·æ’Sπϲ˜ÐÓl8©å´¸(”ÇðŽ¯Ñ»nÖ„`5Æh°k#0k5¶Ù—´±Q»Þœ“7ßF@ROJHúZí8Çßk`¢2&ZŽý’̀ͫç"Uä¬ÁíÛÀš›~›úâqFw=Gÿ†‡0Qk|¬1:Àš›*Ûu`Síf6&Àš¤?ɘkSmÛl‡X]C‹h£/aM !t'[rÀ“66æ“ÐÉvå±~ï·¸|ú&ö}“õ{ÿœÍaµƒÏ›#-ˆD³?Þ&ÀMMð6bŒ /Õ§ˆÓ‰ÆÃ°ÈŸ›cú·a» kÉèÎ?é2yðo볬Ùúe¬I3  p&‚IÍki9Ln2 ÖvÔ˜%¬M ý¬®'þA€]aZÛb5ˆ•V º ‹Ñ ¬ Þñ4R¹Ìù>QmŽ¡›¿‚µ&fCF¹ÀMxSØDã&Äè Qm’ rÌaMo§JÄàÓ ›ÛYvw ‡9> Û½*¬ö1Q£}6=B1óÎ÷ˆê Ýò;€í¤wõÛŒÀf¨oÄEÂêAù#´?D)JtÙº—]ýAÚîsL «h‚3ÚÇêV‡ô®»›uwÿiÌÿ÷< Baµ¿’úi­§„€ 1ºFX›À_G7f\R´´Ü“ ¬:ê]À7c‡À¼!Ç$œ•ðI´ÚÀD~‹ÎÅ¡[Xw×3{ôÌ5þ‰áO#”—šÓ ܦ€[ãÕ.Ò¸üaýذ¼ZvÒ]tBW6dLáJ(6M f€Ñ>F70a ·o£;Ÿ#ªÏ2÷Á «3XÓ4—ö\kXíƒñÑþ<µ¹T¦^&¬žEµ¨¾"+*UOõgç6ǤJÆÓYæ·¥é€Hr¾°mÐÚÇF–?0Q U\ÃÈí¿5 ãÿJX™JàÇÀMÂSÃ_§|ñE—ÞÚzìÜVÕÔt*3Oå–+K§=OfÚéÿ[…  ÈO|Aâ"ÕN‘¡í_Eº=,ž|ž üqKŸÈŸ§:ý•éWÑÁ|ʳ“«y2BAuj¹ƒ2Gãªp“²­,8wu‚&ÙbàyÑ]ˆŠÍ_dùãWX:ûsú7~§4LP>Cmþ-´?·ÂΛ`É´;ÆÅ*íæéN°ò Ñq&°+bnþ Ç ÚxSûA×H,}ëï§6+(OîÃ-”Oµéž#2àóÚ"0þ¾íZ ´H9>›¿Kd@gÛ]†vf‰‡7¹û|²ÍQÜ‚¿|œÆâû‰‹m‘£ù<íwx RX¬T„ôšA´u€GÖ(xe ÊGHÛq<ÎÛóŽð]!Ñ2™8¾ŽØ?¼¹åEõ)ª3ûÑþ|§“Kk2ÓÀÓ—mIi1²Ä2»¹=Äbm—+µzH[§ä̲¶ïÛFßeÝÐRl®9¤BЄ"?cÿí`TÎS~,"”hïÁ¢XÖˆUçXu ò9..ïäÄ©iÎMœg©²„µQ|…ÂUEúzïedÍ.>·é÷Ýv€Þj¬Ù´©°R«‡Â´CáŽ8?}¢3þò)ªÓ°Q¹mï t\däÙvx¾áîeÎù3ŽrxíÍ_RU>·Ž²ó†m”Š%|B¿Ê¥ÙËL[ࣳ½Ì.ÜÏ…¹ažzèEF‡–Ú´ïr>) tÝ„öR&Ðy´m7ÕŽ»Ã´V³·7+’Ž´„îN‹Åá#K¼üÖklÙµ§öîd¸Ïèh™F0‹Ž"¶m Úåpî£:ãG9~þ¢(àë_~‘¾z§Ö³'!"WlÓ ¦B\“:ßûK§¨Îˆ/(¤XH4i–µû´pVø‹•ƒ”{ÿ„c' ÿóÖ›ÜùÈžzh/V× Â%‚°Ìrå4F/à9!¥qû k÷FGBí¯svêv^}ûcžzìí\_¾ánš@—H0H­mÑ_>KuúMLTK!Íd™ß^Õ1 вP¿ƒ}û÷³ùÎÛø½ÇE Öu ÁRå FÏÒãùôú >½^ƒ^¯Î·캳F±XâðøLÎ ¢œÎpYfBd©º ½ &g£}‚òªSob¢j|;ÓHVû÷ryÂ’€ô _ä£S˜ÓO>üMÖ" £yJž¦ä…”<Ÿž‚Oo¡ÑÂ]»*ŒŒ ¶rôä†ÜhQ8åêNPÈ$¾‰ê T§ßB‡Ë­£kÖ¦ºåæ°"[ŒÂ7sêÜ1F7­gãÈ*2ñÅhD¤Ëx*¤àD’Rp<¢¤)(6oª¢ÃõLLn@›ã(Ç®Œ 2N0ÇHÝøè`‰êÌÛD ÓæsoÊ» º ÎÊ!a‘ùË—ÂZMdÂäö8B £ ®Ò¸ŽÆU' à4(¸5ŠN•’'X728ØK#ÆeLýôYÂédD.ZNPlT§>÷au2^³È¬=oëKcÎzÿôwR¿a…CYÂ()ñ£­ãëq‰Æu\¢”48ÒàH’Ž pU„@º=”Šý½øåbå2@¾ "h,Á_:Ó]{™®<úwÌéÆ  „Æ•ŠJ¥BÍo Hž-ˆ%”rVþ ˜ƒrÖFýýƒ,* ¦Ëùá“âïÆ_¢±x<¡aFõÝhÿIæÐe\Ù9\¹ÀØÈ0ã“3Ì,-3Úï`MÌ «0H´•h«0ÖA[¬Åu6¢íµ† Š"ú.P,ÚÎm7+ˆî>ÀbÂذÚeåW|EòÆŠËÍa¶oÛF8·È±sçh„¡Ö„ZÓCm "2¡qŒ‡¯ f ^ñQf|Lœç¦Í¨ÔýAëámæŽ!ŸXüåó„µ™ÕÁ–ÔE0BXúí³iýÃl[Ïo¿ÏØP‰M#½`5õÆ2‹#Ê "‹`ð(õîb©pì¸ÇÂT˯ò·-b,§Ñg’|Œ+Z/ | Ÿ5Y%1ÎXágìݳ“¾*<ð.ggg¸°0Ë|¹B-t¨‡õÐ¥zf Ê»ƒKeÉg¹xa-ããûyôþC¬ W¾×Ò¤~êhžÏk2O…»®úWš†1÷'láÁ½÷pàÐaÞÜ÷.7Þ:ÈèZ…ã€ãH”öp]E#ðøðdó§]–™~w¿È{¦±†öƒ”nkï¾ \‘ÊVj<¯ïSý¤ÀU¶õÿ½¡ŠØ{ã'/2yh’…502æÑß')yjK–Úr‘FÝ0=} ¢ãÜûìyeã§{ÍåØv¶¦½[­rþ¤”„WíËô[®\æÖ‘3à}À`é1ÎOÝÂôlòDËZÇÀ„B KÁf°g’yч/¶óŸ¯ø<ûÌaz 4I,“Ç&žQÔÀ¶Ë”4iþhSÔ–+ϱ.+@¤ú• Ø´æ Ö ¼Ãì [™º´…¥5TëŠ0 qU™u#“lß<Áºµe|ø»Œïbp~ ¯ÿý[?ËŽ‡2ÿgÛoŸˆOb€!=„tRt‘J!”ƒtâºt\„ã ©œx,oÖ;ˤ_ÆíV]:Éá<{aG}dCÀíhŒ­Æ/S"e€R= ¶ƒˆxdçî)ÞÏ€ûy^ÿîëš,Ñ32Çæ;$Ø(yï Û_­ê´h-0Zap1xh¬p1ÒÅ #Üv¦Y÷âºuÐÉwŒu1ÖE㢃¶.Úº㢭ƒ±J!J†8*DÉ%C”ŠÃݸLÆTˆãÄ¥ëÄuië œ|•¾£3ÜLÓ;ö8Gþc‚HžfpL ¸Ž¥Xñ™à“`MDEDºF¤!ÔE‹¶Zed J× Dº]†ÍvówLó·âR[pp]ðܸt½Î¶çÅ}­v!éKênüP`?´Œú‚ÆøÔo}C?=ÃÞg¦é<ðœTôc-× ¤ äåÙ+ïóºåæSž+Ÿ›mnÓzÄ• uÙc™6P~ÆæÎàûily€é#—Ùû•åÖaÌhÒ7bX~¬þ~¬åÊb€d^k+ú,Éf¶²”úlfL(y{ê%îÙ8ÇÆ.~ˆYÏÄ»ñNá÷í}2x[G(!X¶‚Ò[嵌…Þ(¨)»}WQüûŽ‚½çRÿÓw=Á¡ÓSÿë¥}_îë=óÓåÎ÷·Õgü¿_»ôïÀÆ"üÖ X<Ñà|O¬Óµ>£5Å›oßh£ÏL¼¼ËQþÓ¦ä5#€C5XçÀ·.ræK"ìW<6\¿ìØR?…MÛn·µZýù¹Åý÷Ia/ÚkP¯Wàïn„Ó>ï(±aXê»{j—Qk×Ë:ÎnçÂÅ“ŸG1gìµ'€—ÊðìZN†-Iqï˜õ7ÏÏÏs* Ttœ[ÎV~1ì°|Zw¹½ÒkeËçJLœjØ¿8y/¬½‘ÝG+Lõ…K°è\3î•ô‘¸ü—Ý£ß8üðú_¼·³øô· ßjϹæåðíDWYœïúÔïŽ^íEý:¥ÿøvbŽ©½{ IEND®B`‚qt-client-4.1.0/widgets/images/italic.xpm000066400000000000000000000012151217451700100203170ustar00rootroot00000000000000/* XPM */ static char *italic_xpm[] = { "22 22 2 1", " c None", ". c #000000", " ", " ", " ", " ", " ..... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ... ", " ..... ", " ", " ", " ", " "}; qt-client-4.1.0/widgets/images/justify.xpm000066400000000000000000000012151217451700100205470ustar00rootroot00000000000000/* XPM */ static char * block_xpm[] = { "22 22 2 1", " c None", ". c #000000", " ", " ", " ................. ", " ", " ................. ", " ", " ................. ", " ", " ................. ", " ", " ................. ", " ", " ................. ", " ", " ................. ", " ", " ................. ", " ", " ............. ", " ", " ", " "}; qt-client-4.1.0/widgets/images/left.xpm000066400000000000000000000012131217451700100200020ustar00rootroot00000000000000/* XPM */ static char *left_xpm[] = { "22 22 2 1", " c None", ". c #000000", " ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ", " "}; qt-client-4.1.0/widgets/images/magnifier.png000066400000000000000000000006671217451700100210050ustar00rootroot00000000000000‰PNG  IHDR ™ fbKGDÿÿÿ ½§“ pHYs  šœWIDAT(ÏŽ!‹2a…ŸwßÑ`r°iEPÁªi‚Ñd²b5+Ø ŠÀlWç'bÐbrD0N˜`Dœ2Ü/)ú­vœpî=åy¯º\.ض-§Ó €t:M½^WñxœŸ¤|ßß÷ÇR*•¨T*¬×kv»ÝnW%“ÉÏ%çóù&“‰Äb1Z­ÖÛÑt:åv»ÑétÔ§’/Ã0xØu],Ë╆eYì÷ûoüÅÆ[k$á¾ñ‡ ­õ3äóyÇ!“ɼ9ŽC±XDkÍl6“Åbñöó, ‚€ëõÊv»% CªÕ*Ëå’ÍfÃp8TZk†RJÉ|>§P(Ðï÷• à  r80M“l6Ëñx —ËÑn·U"‘ø”ËeFá~¿Óëõ¤V«I³ÙÏó‘_ùkµZ‰ëº˜¦Éh4R©TŠ_KD°mûO þz/Ò„â“ÂIEND®B`‚qt-client-4.1.0/widgets/images/next_24.png000066400000000000000000000031571217451700100203240ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDùC» pHYsHHFÉk> vpAgxL¥¦úIDATHÇ–KŒžUÇçò¾ïw{¿¹~3i --Ö:¹™ ¶RI0´Jl šFM Y˜˜@º јtGÂNWuãVÅ£¸èÂ@ˆ´--Ì;òuf:ýîïýrŽ‹)âÄ'9›³øý’ó<çüàÕ Ô)˜ÄR@!袱\üx„øÈ݇K΃¾¦=ý_÷ï¨x•šÅçq&a»(Š7¼‚äó—Oˆ-¸ìGðÜ®¹]ßxìÁÇ&¹÷æZs `Ùèm°Ü^féÊ—Ö.u‡áð×À‹(VH€×>dªÿÀ¶o¡Æ£Õjõ—§?õÄK?z©zâK'hMµ(DA\Ƥ6ÅjK³Ùd×§v1Ûš­†eøÀ ±Â¾K…UöËÿ% k,¸<Úô›g_øÞ Nç4VZÖ:klŽ6é%=Ù€a6$ÈGŒò!A1-˜Ÿ$ùl/î¶Øóx·%ï| Ø-ÀrWñΞþîéÏ<ù ín››£›Y@PŒ‹¸Ü^I“˜ˆ¤Œˆ‹ a•%(‰8?ü‡.A‰EÅ:XΜŒ çÐÜÌÜɧ¿ú4[Ã-:a‡a6d” ‰Š€ÄD¤6ª󾥕ÌÒçÁ?ÙÌ®Qê¯&©Õ]ª U‘'ñ¸ôí[˜_˜œ›`c°APD&"31))¹H1Rb­e'{èÆ[´Ç¯bŒJVÇJI@`ND~Üuõ›Ú–¶¡<õðüÞy:£ƒt@hBr‘’“RŠŒRf™¡\E^æLMNqðæÈPñvëu®¯¡”D1–²4c’$«k “µJm§ßðé†]†åºS'ÛHÁJ”p‘RãÈ R ÖW7¨f>““ìèÞI¹n©íª³,/cŒ¥(Jò¼$Ï‹ÝÖÚ) øŽv¹ÉéÇ}B’n&üö/£µFkã8¸®G¥âá7}táÒëu©ÕêTúM¦:{98ïr>‹,+pÝÇQÒ_kÅ#ˆ!’Õ´ÊÊÊ £`„1!RJ´v¨×kŒáû>žç‘g9SÓSÜ»çn<ÇA;ZK´Vè iž†[Ã-LÕŠ€±†ÏâáE¢8 ƒ)@iÍÕwW¹pþÃ×í¡…C|j'+Þ9DJJ”TH)!ÅH4O¯¯Ý\Ûïø#1däôÐG ²Œ‘•’†_¡áW˜kÍ0÷r‹ ç/"¥âèãGøâ³ó\¿„M D.Bàj)â5,M“ÀÄæ¥•¥£×¢k¤•„ÂMÑUCÍw÷jÕ¦^ů;”²ŽšãO}…C?ØËúø eZP–†¢(©ª)óúÌÌX¨¸€8*¢¯wÒNµ_ÈDŠÖ ×Ñ¸ŽÆÑ ­U§‚ó¯ öìÛÃü÷w°9v…´È‰£Œ0J1¹dBÏr£·~+ÉÒŸ…i+î26ñ؋޾}Â8ŽÚn”–Û3.Á‡ö-’ØbÝ{,/ˆ£”0J)øôØçXïnp£¿þ«4ÉÏ*%b ø XFrÅ¬Õ ´@)…”Û犅Üäܰ«Ü2dEIga‚*<w|™þhÄÒõsç³,ÿ±ë:[íŸtoçÁ]@“+#·„`X eYe1yVÇ)YjØ×ü,OÞ}Š÷;m^½ü‡Õ ‰žu]ý÷4-þšÜ\½-9ÆUÞã‚û­`Vi…VÀZ°„‘ԤϾñƒÛ{’/ì8Ÿ.ÿ‘W.þîB?œÞ£_l–lü¬ÿ™| hCîÁã9UU'šcþäìÄ4³-ZÍifü¦-´Ð¬õVyëÆRw}Ðþ1¼¨–³Ø²ufø ¡ÿ- ÀÅã><Ž;ž^¬U«»ë•JÝu],&LËx-+³¿Yìï•Ðÿ²[gFÿç¯âƒú&ã4phIM]i”2BÜ*bÙÏËEüžž÷ôwµ‚ÇIEND®B`‚qt-client-4.1.0/widgets/images/prev_24.png000066400000000000000000000031671217451700100203230ustar00rootroot00000000000000‰PNG  IHDRàw=øtIMEØ8.K“Íâ pHYs  ÒÝ~üIDATxÚV[leþþ¹íÎì­Ýv»”RnÑR¹%ÈM•"ÆÖ¨A|0¼iŒ‰B"‰ÆÈI}‘7|ñÉDCˆÀ JT$J¹¤`KiÙvÛ-íîvwvwî3žJ눻9»›þÿ;ç|ç;ç_†ÿzuq`°!Kƒ¬3ÔÈ ¨  Vo>‚=ruSðD‚…õô½W /Æ"±–p(¬x„§YZ­ªW³¶m_¢ç§(ˆ+t¯OpÀ:<ÍA¯¤'‡Z›[ßÚµ~Wý–ç· 9Õì.keäŠ9 dÐ{§ý™þB¹ZþŽAèôëü<&?¾™Àg\ÁY–¿Ý÷ʾÝ=ŸôÈ]Û»jHÁf64Gƒáðñx­ [‘N¥åªS]W2JÛ<æý0F(<`à_‚ÈÝ òñXüäÑŽ>}äý#ð8™|“ê$Šz%³„²YFÅR¡Zôm«€À¬KÂbVº¨·…ךurÛ/á¼ÿp^ÐH$V†cÀ<'ÀætÈ\Iªâ–Q4§‘)`¸xãå,QX£'î“ï,^€û  š›š»ýÈ •,Ç‚,ʈŠQˆœÛµ‘›…;æAwuÄå\fávé&Í{p!…ƒ‘ G%ða®›2Y ñ!E@gG{G²>QbµÃ6@„i™°\ ƒ#7°Ëày¾ƒe`¡oâ ' ËvH(ˆÅ( h%„,6r·'LÏñ¢|ˆßÔ¾¼y5¥Éˆð¤’ < ô£-² Éä²Ù€÷° «f`V°G­h$â›ç‹p®ëvèºàVXY‹ÆP¨æL=Ûwõ/´pKJJ¸;<Œ‰ñâRe§Œ-ƒù { IÄ×#_ÇD‘œX–½˜2nh-& bÔ§bF›™Ãï?s |3ܤ‡¡¡!¨ªŠÌ]RÕeºnÀ4 ±*}º„Ù“EïùŽ¢ŽëÆ‚U—òS5Ò´6ŸÀõßn!?ý;DI$*ŒÀA©TBµJJ±-Ÿ‚ &ÇÁÏ> çüu›ê"<Û¥QÅP1,£:Už‚+{¨² –ˆ­h{{~9‘ÃÅ çœ>û\;Öv¬Cû}é7'#ŠYÁtü6ס[0 Çw\aSý òä`4s?³RŒ‰PYªX„^©¡ó³Ä¿‰áü¹ ™ƒÍ»7 ²¿Dê‰a¼0>縦çQï)Ð4“¢w! õŽ–!¶òâÔ3š{©w°wç½Ú=a¶d@]ôéÝ ö&^ÃéïÏÂáìИv±°q!uú(Õ—³Mt! Fæ• ËIG65%ª3ñÕâ$õ­fÈÁ3”‘?`9l¥ùšö¨2Œ¦$ÏóT,4ñ‰!«?м?‹¨€Š êvæؘގRZïè•ë¦i}*IâTöóÂì}°”,Ž<$Um%Guž?8€ûê&qQ35X¦C¥^0\Šz5ÞxjÆòYœ½õóHE¯}$IÂeàxAŸu0<뤓~ á9Yë1¢Ý§ˆ÷•Ì>Ï~÷*\ +êÚй¼lù[gpêæO7*zåÃÆeÂùÒ¤ƒÜ—3¸“;ÉRde¬¢šâe¾+žˆ%ÓõH×§Š7¢)Ö„ÆhЍ)Žàêxoa¢”ý‘úë8/bÀ¤+wêXù —þ»d6U.D=„=bHجÈòâH˜æ£äz·j8ZÆtÌ?höŸæ™ÐçKeú˜ú?ÿU<|½ã‹ž¬t1 EwN„§âû]Ê16mk^…Éæ ç±ÿxƒ÷53‹Æ{IEND®B`‚qt-client-4.1.0/widgets/images/printer_24.png000066400000000000000000000021431217451700100210230ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDùC» pHYsHHFÉk> vpAgxL¥¦îIDATHÇÕ•ÏoTUÇ?÷¾ûÞÌ›¶C)-%X*„,©DðÇB&ºf &.ÜûhÔ¸5Ñ1( ŒD ‰$’uÁƒVŒ€%šJm:Óé´3óÞ»÷¶Øc0qáMNî¹÷%çsÏy9ßÿñR.½€Ø £@ €xUBÑ4š)ÀÅa{8Ó `€í‰ãSçéqÎÃÊî¬'5?”Ô‹"T;Åêp>ÿ–ZéK=ýί·ëüB@oŸ E:—¨s9€ÄAb×^Ý y6îßZöŸšµ’=x6‡¬ì è>?P÷2ðÄ­øölŒù›øèN—ƒÝpö‹Ï65Sg¯X±ô>ÅšIrêÄÆ[¿^ïPñÄQ@Â=»¶í‹Q÷ÂBMmhÞ~õð±Wž »6à¼à¼gÕÏw…[œ•KΟZî>¡A¥¶4wçüÕkì&Oæ%Ú½o?ÀسûF?*ÂÁùŦLýt9šýùÎ9êõ:õzååIš`­E¼GDHjñ¡ÇŽö Ž寕»‡ž/£JmòÞ?ß3†uþQ)öŒT2Ô(P™ŸåÌ•ËdÖáœ´ÖÆƒ Æ …˜žrÉØž^ƒVlìéÛõôððv/R9÷9˜ïîLsþ‡9â‚yÄyxçX˜Œù£ÚOoS*•ˆã8·bL1.R,ÑZc³Œpx+][wæå УÞùKçCï0OއøbÏ¥H –o<ÌèÐ" âñ"H~ÀËIŠÎZ¶— LLŒ!"(Ð(µI‘7†ùà뛼ûÂÞ¾8_ªû–Sd”›ßOBu†0ŠÃ0 ‚gY–åf3l–R-mafDðÞQ!’$ÞÜÛN| €¯Î|Étݲز(oÑ ’n")IDD„Áà½#ó+V,^{n\Ÿ&˜;޲B_¹›8DíÙœ–šEÞ9~š÷¾ù­2;_c©•‰ö{‹K80®¢BL`B¢u@fIš’¦if¹3õ‹\œºF—¹ÅðŒv0Ó?\qµÆZ?‚GïðÎí´KÔÉ×_~éÀÁC­h2—wm›¡¨þ~{á­7^{óÛÛÕé’ÕZtd3S8¯‘»éå÷ÛNâ­œkpn)‘Ý냮‡)…Û\VǪ-N<±”úkÈ6-š_­ÆkMkÙöWgëÎÎ-Ï<µM}8»D›$µšJ¡lPp5Ð¬Š°”­À(°zUƒ@‘Öš½Ðè¨E÷¯zKPŠ‚R„À½>`•´2!—P2·ž¦VÈP¹ã˜ÿ¯?ˆÅ6»@ŒIEND®B`‚qt-client-4.1.0/widgets/images/redo.xpm000066400000000000000000000014251217451700100200060ustar00rootroot00000000000000/* XPM */ static char *redo_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 8 1", " c Gray100", ". c #848284", "X c #000084", "o c Gray0", "O c None", "+ c Gray0", "@ c Gray0", "# c Gray0", /* pixels */ "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOO.XXXXXXOOOOOOOOOOO", "OOOXXXXXXXXXXOOOOOOXOO", "OO.XXOOOOOOXXXXOOOXXOO", "OOXXOOOOOOOOOXXXOXXXOO", "OOXXOOOOOOOOOOXXXXXXOO", "OOXXOOOOOOOOOOOXXXXXOO", "OOXXOOOOOOOOOOXXXXXXOO", "OOXXOOOOOOOOOXXXXXXXOO", "OO.XXOOOOOOOXXXXXXXXOO", "OOOXXX.OOOOOOOOOOOOOOO", "OOOOXXXOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO" }; qt-client-4.1.0/widgets/images/right.xpm000066400000000000000000000012141217451700100201660ustar00rootroot00000000000000/* XPM */ static char *right_xpm[] = { "22 22 2 1", " c None", ". c #000000", " ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ............. ", " ", " ................. ", " ", " ", " "}; qt-client-4.1.0/widgets/images/underline.xpm000066400000000000000000000012201217451700100210330ustar00rootroot00000000000000/* XPM */ static char *underline_xpm[] = { "22 22 2 1", " c None", ". c #000000", " ", " ", " ", " ", " ..... .... ", " ... . ", " ... . ", " ... . ", " ... . ", " ... . ", " ... . ", " ... . ", " ... . ", " ... . ", " ... .. ", " ... .. ", " ...... ", " ", " ............ ", " ", " ", " "}; qt-client-4.1.0/widgets/images/undo.xpm000066400000000000000000000014251217451700100200220ustar00rootroot00000000000000/* XPM */ static char *undo_xpm[] = { /* columns rows colors chars-per-pixel */ "22 22 8 1", " c Gray100", ". c #848284", "X c #000084", "o c Gray0", "O c None", "+ c Gray0", "@ c Gray0", "# c Gray0", /* pixels */ "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOXXXXXX.OOOO", "OOXOOOOOOXXXXXXXXXXOOO", "OOXXOOOXXXXOOOOOOXX.OO", "OOXXXOXXXOOOOOOOOOXXOO", "OOXXXXXXOOOOOOOOOOXXOO", "OOXXXXXOOOOOOOOOOOXXOO", "OOXXXXXXOOOOOOOOOOXXOO", "OOXXXXXXXOOOOOOOOOXXOO", "OOXXXXXXXXOOOOOOOXX.OO", "OOOOOOOOOOOOOOO.XXXOOO", "OOOOOOOOOOOOOOOXXXOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO", "OOOOOOOOOOOOOOOOOOOOOO" }; qt-client-4.1.0/widgets/images/window_24.png000066400000000000000000000011761217451700100206540ustar00rootroot00000000000000‰PNG  IHDRàw=øbKGDùC» pHYsHHFÉk> vpAgxL¥¦ IDATHǵV]kA=÷Ε¶º5Mʦ‹PJUðA¬ þŸ}ñøü¾ø3|ôÍBŸ›€ )´˜¬ IKv2ׇýH6Ù Yvgö {î=÷ÜaøÏƒŽÞ''‡ow½­¶SUU@U¡ É<ÅR\…B¢Óýk+ˆ¢üÖ„ƒöBê÷ãŸ§çæƒÜ´>êØ»ïè5âØ¥Ä1` A A ƒ Jö±UŒF7Û‚§÷°5Žq¿µƒýè on}ÆŽ\œŽŸ}’ñËmœO®áœÎ‹ËI‰L# QåT±Ën?Ä„¿ìÚ˜àëÕm\>ñ©õ¸Åò_à><ÏËxAÉ-§ä4»G”ï§é$K"èÁ£Çá7ˆ¿×À«ÏÑn@Uól‰”J š 8;ûŽnת03œSÄqœ`æ…—æ1f^ì˜T*`­HYiU EÉ`fˆ1Ì f®TP•DUš¶"3C–ÕreØlÉò-SPsÎM,ó``Y²bŒ)H«cfV0y¾Dÿšq™y€º]² –%[ð +Ñ:åÉÈK»hÖƒu”vQ•‚ºXá e”)ØH›–)Xׇ…ƒÆÌ0ÆÔ °ì¹`²ˆ C ‡Ãü»;?f±UÖÖZ A!¢‹^¯÷ÑZ»³ÉŸ‰f³zž×ß gùø åDÖ\W-IEND®B`‚qt-client-4.1.0/widgets/images/xcheckbox.png000066400000000000000000000002731217451700100210130ustar00rootroot00000000000000‰PNG  IHDR„™ÃtIME× š« pHYs  ÒÝ~üZIDATxÚc¾uë–ˆˆÈ“'OòóógÍšÅ,!!±uëV~þ›7oþùó‡åÁƒiiir r<:qâÃÉ“'þüùÿÿ d3~üø‘ ~ DÀsª9²£#IEND®B`‚qt-client-4.1.0/widgets/imageview.cpp000066400000000000000000000141631217451700100175460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "imageview.h" #include "widgets.h" #include "shortcuts.h" #include #include #include #include #include #include #include #include #include imageview::imageview(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, fl) { setupUi(this); setObjectName(name ? name : "imageview"); setModal(modal); _save = _buttonBox->button(QDialogButtonBox::Save); _save->setEnabled(false); // signals and slots connections connect(_fileList, SIGNAL(clicked()), this, SLOT(sFileList())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSave())); #ifndef Q_WS_MAC _fileList->setMaximumWidth(25); #endif _imageview = new QLabel(); _imageview->setAlignment(Qt::AlignLeft | Qt::AlignTop); QScrollArea * scrollArea = new QScrollArea(); scrollArea->setWidgetResizable(true); scrollArea->setAlignment(Qt::AlignLeft | Qt::AlignTop); scrollArea->setWidget(_imageview); QHBoxLayout *layout = new QHBoxLayout; layout->setMargin(0); layout->addWidget(scrollArea); _imageFrame->setLayout(layout); shortcuts::setStandardKeys(this); } /* * Destroys the object and frees any allocated resources */ imageview::~imageview() { // no need to delete child widgets, Qt does it all for us } /* * Sets the strings of the subwidgets using the current * language. */ void imageview::languageChange() { retranslateUi(this); } void imageview::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("image_id", &valid); if (valid) { _imageviewid = param.toInt(); populate(); } param = pParams.value("mode", &valid); if (valid) { if (param.toString() == "new") { _mode = cNew; _fileName->setFocus(); } else if (param.toString() == "edit") { _mode = cEdit; _filenameLit->hide(); _fileName->hide(); _fileList->hide(); _name->setFocus(); } else if (param.toString() == "view") { _mode = cView; _name->setEnabled(FALSE); _descrip->setEnabled(FALSE); _filenameLit->hide(); _fileName->hide(); _fileList->hide(); _buttonBox->setStandardButtons(QDialogButtonBox::Close); _buttonBox->button(QDialogButtonBox::Close)->setShortcut(QKeySequence::Close); _buttonBox->setFocus(); } } } void imageview::populate() { XSqlQuery image; image.prepare( "SELECT image_name, image_descrip, image_data " "FROM image " "WHERE (image_id=:image_id);" ); image.bindValue(":image_id", _imageviewid); image.exec(); if (image.first()) { _name->setText(image.value("image_name").toString()); _descrip->setText(image.value("image_descrip").toString()); __imageview.loadFromData(QUUDecode(image.value("image_data").toString())); _imageview->setPixmap(QPixmap::fromImage(__imageview)); } } void imageview::sSave() { XSqlQuery newImage; if (_mode == cNew) { if (!__imageview.isNull()) { XSqlQuery imageid("SELECT NEXTVAL('image_image_id_seq') AS _image_id"); if (imageid.first()) _imageviewid = imageid.value("_image_id").toInt(); // ToDo QImageWriter imageIo; QBuffer imageBuffer; QString imageString; imageBuffer.open(QIODevice::ReadWrite); imageIo.setDevice(&imageBuffer); imageIo.setFormat("PNG"); if (!imageIo.write(__imageview)) { // ToDo - should issue an error here reject(); return; } imageBuffer.close(); imageString = QUUEncode(imageBuffer); newImage.prepare( "INSERT INTO image " "(image_id, image_name, image_descrip, image_data) " "VALUES " "(:image_id, :image_name, :image_descrip, :image_data);" ); newImage.bindValue(":image_id", _imageviewid); newImage.bindValue(":image_name", _name->text()); newImage.bindValue(":image_descrip", _descrip->toPlainText()); newImage.bindValue(":image_data", imageString); } } else if (_mode == cEdit) { newImage.prepare( "UPDATE image " "SET image_name=:image_name, image_descrip=:image_descrip " "WHERE (image_id=:image_id);" ); newImage.bindValue(":image_id", _imageviewid); newImage.bindValue(":image_name", _name->text()); newImage.bindValue(":image_descrip", _descrip->toPlainText()); } newImage.exec(); done(_imageviewid); } void imageview::sFileList() { bool first = TRUE; bool havejpg = FALSE; QString frmtList = QString(tr("Images (")); QString ext = QString::null; QList list = QImageReader::supportedImageFormats(); for (int i = 0; i < list.size(); ++i) { if (!first) frmtList += QString(tr(" ")); ext = QString(list.at(i)).toLower(); if (ext == "jpeg") ext = "jpg"; if (ext != "jpg" || !havejpg) frmtList += QString(tr("*.")) + ext; if (ext == "jpg") havejpg = TRUE; first = FALSE; } frmtList += QString(tr(")")); if (first) frmtList = QString(tr("Images (*.png *.xpm *.jpg *.gif)")); // should I do this? _fileName->setText(QFileDialog::getOpenFileName( this, tr("Select Image File"), QString::null, frmtList)); if (_fileName->text().length()) { if(!__imageview.load(_fileName->text())) QMessageBox::warning(this, tr("Could not load file"), tr( "Could not load the selected file.\n" "The file is not an image, an unknown image format or is corrupt" ) ); else _save->setEnabled(true); _imageview->setPixmap(QPixmap::fromImage(__imageview)); } } qt-client-4.1.0/widgets/imageview.h000066400000000000000000000021221217451700100172030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef IMAGEVIEW_H #define IMAGEVIEW_H #include #include "widgets.h" #include "ui_imageview.h" class imageview : public QDialog, public Ui::imageview { Q_OBJECT public: imageview(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WFlags fl = 0); ~imageview(); QPushButton* _save; public slots: virtual void set( const ParameterList & pParams ); virtual void populate(); virtual void sSave(); virtual void sFileList(); protected slots: virtual void languageChange(); private: int _mode; int _imageviewid; QImage __imageview; QLabel *_imageview; }; #endif // IMAGEVIEW_H qt-client-4.1.0/widgets/imageview.ui000066400000000000000000000164201217451700100173770ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. imageview 0 0 600 600 Image 7 5 5 5 File Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Name: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter 5 5 ... 0 Qt::Horizontal QSizePolicy::Expanding 20 20 5 0 0 0 Description: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::Vertical QSizePolicy::Expanding 20 90 0 0 32767 120 Qt::Vertical QDialogButtonBox::Cancel|QDialogButtonBox::Save 1 1 QFrame::Box QFrame::Plain XLineEdit QLineEdit
    xlineedit.h
    1
    _fileName _fileList _name _descrip _buttonBox rejected() imageview reject() 464 115 20 20
    qt-client-4.1.0/widgets/incidentCluster.cpp000066400000000000000000000022501217451700100207220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "incidentcluster.h" IncidentCluster::IncidentCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new IncidentClusterLineEdit(this, pName)); } IncidentClusterLineEdit::IncidentClusterLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "incdt", "incdt_id", "incdt_number::text", "incdt_summary", 0, "incdt_owner_username", "incdt_assigned_username", 0, pName) { _objtype = "INCDT"; setTitles(tr("Incident"), tr("Incidents")); setUiName("incident"); setEditPriv("MaintainAllIncidents"); setNewPriv("MaintainAllIncidents"); setViewPriv("ViewAllIncidents"); setEditOwnPriv("MaintainPersonalIncidents"); setViewOwnPriv("ViewPersonalIncidents"); } qt-client-4.1.0/widgets/incidentcluster.h000066400000000000000000000015221217451700100204300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _incidentCluster_h #define _incidentCluster_h #include "crmcluster.h" class XTUPLEWIDGETS_EXPORT IncidentClusterLineEdit : public CrmClusterLineEdit { Q_OBJECT public: IncidentClusterLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT IncidentCluster : public VirtualCluster { Q_OBJECT public: IncidentCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/invoiceCluster.cpp000066400000000000000000000020341217451700100205610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "invoiceCluster.h" InvoiceCluster::InvoiceCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new InvoiceClusterLineEdit(this, pName)); } InvoiceClusterLineEdit::InvoiceClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "invchead", "invchead_id", "invchead_invcnumber", "invchead_billto_name", 0, 0, pName) { setTitles(tr("Invoice"), tr("Invoices")); setUiName("invoice"); setEditPriv("EditAROpenItems"); setViewPriv("ViewAROpenItems"); setExtraClause("(checkInvoiceSitePrivs(invchead_id))"); } qt-client-4.1.0/widgets/invoiceCluster.h000066400000000000000000000015241217451700100202310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _INVOICECLUSTER_H #define _INVOICECLUSTER_H #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT InvoiceClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: InvoiceClusterLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT InvoiceCluster : public VirtualCluster { Q_OBJECT public: InvoiceCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/invoiceLineEdit.cpp000066400000000000000000000050431217451700100206400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include "invoicelineedit.h" InvoiceLineEdit::InvoiceLineEdit(QWidget *pParent, const char *name) : XLineEdit(pParent, name) { _custid = -1; _coheadid = -1; _invoiceNumber = ""; _id = -1; connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void InvoiceLineEdit::sParse() { setInvoiceNumber(text()); } void InvoiceLineEdit::setInvoiceNumber(QString pInvoiceNumber) { XSqlQuery query; query.prepare( "SELECT cohead_id, invchead_cust_id, invchead_id " "FROM invchead LEFT OUTER JOIN cohead ON (invchead_ordernumber=cohead_number) " "WHERE (invchead_invcnumber=:invoiceNumber);" ); query.bindValue(":invoiceNumber", pInvoiceNumber); query.exec(); if (query.first()) { _custid = query.value("invchead_cust_id").toInt(); _coheadid = query.value("cohead_id").toInt(); _invoiceNumber = pInvoiceNumber; _id = query.value("invchead_id").toInt(); _valid = TRUE; setText(_invoiceNumber); } else { _custid = -1; _coheadid = -1; _invoiceNumber = ""; _id = -1; _valid = FALSE; setText(""); } emit newCustid(_custid); emit newCoheadid(_coheadid); emit newInvoiceNumber(_invoiceNumber); emit newId(_id); emit valid(_valid); } void InvoiceLineEdit::setId(const int pId) { XSqlQuery query; query.prepare( "SELECT cohead_id, invchead_cust_id, invchead_invcnumber " "FROM invchead LEFT OUTER JOIN cohead ON (invchead_ordernumber=cohead_number) " "WHERE (invchead_id=:id);" ); query.bindValue(":id", pId); query.exec(); if (query.first()) { _custid = query.value("invchead_cust_id").toInt(); _coheadid = query.value("cohead_id").toInt(); _invoiceNumber = query.value("invchead_invcnumber").toString(); _id = pId; _valid = TRUE; setText(_invoiceNumber); } else { _custid = -1; _coheadid = -1; _invoiceNumber = ""; _id = -1; _valid = FALSE; setText(""); } emit newCustid(_custid); emit newCoheadid(_coheadid); emit newInvoiceNumber(_invoiceNumber); emit newId(_id); emit valid(_valid); } qt-client-4.1.0/widgets/invoicelineedit.h000066400000000000000000000022511217451700100204030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef invoiceLineEdit_h #define invoiceLineEdit_h #include "xlineedit.h" #include "widgets.h" class XTUPLEWIDGETS_EXPORT InvoiceLineEdit : public XLineEdit { Q_OBJECT public: InvoiceLineEdit(QWidget *, const char * = 0); inline int custid() { return _custid; } inline int coheadid() { return _coheadid; } inline QString invoiceNumber() { return _invoiceNumber; } public slots: void setInvoiceNumber(QString); void sParse(); virtual void setId(const int); signals: void newCustid(int); void newCoheadid(int); void newInvoiceNumber(QString); void newId(int); void valid(bool); private: int _custid; int _coheadid; QString _invoiceNumber; }; #endif qt-client-4.1.0/widgets/itemAliasList.cpp000066400000000000000000000147141217451700100203370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "itemAliasList.h" #include #include #include #include #include #include #include #include #include #include "itemcluster.h" #include "xtreewidget.h" QString buildItemLineEditQuery(const QString, const QStringList, const QString, const unsigned int); QString buildItemLineEditTitle(const unsigned int, const QString); itemAliasList::itemAliasList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, fl) { setObjectName(name ? name : "itemAliasList"); setModal(modal); setWindowTitle(tr( "Item Aliases")); _itemType = ItemLineEdit::cUndefined; if ( !name ) setObjectName( "itemAliasList" ); QVBoxLayout *_mainLayout = new QVBoxLayout(this); QHBoxLayout *_itemLayout = new QHBoxLayout(0); QHBoxLayout *_line1Layout = new QHBoxLayout(0); QVBoxLayout *_enterLayout = new QVBoxLayout(0); QHBoxLayout *_topLayout = new QHBoxLayout( 0); QVBoxLayout *_buttonsLayout= new QVBoxLayout(0); QVBoxLayout *_listLayout = new QVBoxLayout(0); _mainLayout->setContentsMargins(5, 5, 5, 5); _itemLayout->setContentsMargins(0, 0, 0, 0); _line1Layout->setContentsMargins(0, 0, 0, 0); _enterLayout->setContentsMargins(0, 0, 0, 0); _topLayout->setContentsMargins(0, 0, 0, 0); _buttonsLayout->setContentsMargins(0, 0, 0, 0); _listLayout->setContentsMargins(0, 0, 0, 0); _mainLayout->setSpacing(5); _itemLayout->setSpacing(5); _line1Layout->setSpacing(7); _enterLayout->setSpacing(5); _topLayout->setSpacing(7); _buttonsLayout->setSpacing(5); _listLayout->setSpacing(0); QLabel *_aliasLit = new QLabel(tr("&Alias:"), this); _aliasLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _aliasLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _itemLayout->addWidget(_aliasLit); _alias = new QLineEdit(this); _alias->setObjectName("_alias"); _alias->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _aliasLit->setBuddy(_alias); _itemLayout->addWidget(_alias); _line1Layout->addLayout(_itemLayout); _showInactive = new QCheckBox(tr("Show &Inactive Items"), this); _line1Layout->addWidget(_showInactive); _enterLayout->addLayout(_line1Layout); QSpacerItem* spacer = new QSpacerItem( 20, 32, QSizePolicy::Minimum, QSizePolicy::Fixed ); _enterLayout->addItem( spacer ); _topLayout->addLayout(_enterLayout); _close = new QPushButton(tr("&Cancel"), this); _buttonsLayout->addWidget(_close); _select = new QPushButton(tr("&Select"), this); _select->setEnabled( FALSE ); _select->setAutoDefault( TRUE ); _select->setDefault( TRUE ); _buttonsLayout->addWidget(_select); _topLayout->addLayout(_buttonsLayout); _mainLayout->addLayout(_topLayout); QLabel *_itemsLit = new QLabel(tr("&Items:"), this); _listLayout->addWidget(_itemsLit); _item = new XTreeWidget(this); _item->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); _itemsLit->setBuddy(_item); _listLayout->addWidget(_item); _mainLayout->addLayout(_listLayout); connect( _item, SIGNAL( itemSelected(int) ), this, SLOT( sSelect() ) ); connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) ); connect( _alias, SIGNAL( editingFinished() ), this, SLOT( sFillList() ) ); connect( _item, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) ); connect( _close, SIGNAL( clicked() ), this, SLOT( reject() ) ); _useQuery = FALSE; _item->addColumn(tr("Alias Number"),100, Qt::AlignLeft, true, "itemalias_number"); _item->addColumn(tr("Item Number"), 100, Qt::AlignLeft, true, "item_number"); _item->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "item_descrip"); } void itemAliasList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("itemType", &valid); if (valid) { _itemType = param.toUInt(); setWindowTitle(buildItemLineEditTitle(_itemType, tr("Item Aliases"))); } else { _itemType = ItemLineEdit::cUndefined; setWindowTitle(tr("Item Aliases")); } param = pParams.value("extraClauses", &valid); if (valid) _extraClauses = param.toStringList(); _showInactive->setChecked(FALSE); _showInactive->setEnabled(!(_itemType & ItemLineEdit::cActive)); param = pParams.value("sql", &valid); if (valid) _sql = param.toString(); } void itemAliasList::sSelect() { done(_item->altId()); } void itemAliasList::sFillList() { _item->clear(); if (_alias->text().trimmed().length() == 0) return; QString pre( "SELECT item_id, itemalias_id, itemalias_number, item_number, (item_descrip1 || ' ' || item_descrip2) AS item_descrip " "FROM (SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2"); QString post(") AS data, itemalias " "WHERE ( (itemalias_item_id=item_id)" " AND (UPPER(itemalias_number)~UPPER(:searchString)) )" ); if(_x_preferences && _x_preferences->boolean("ListNumericItemNumbersFirst")) post += " ORDER BY toNumeric(item_number, 999999999999999), item_number"; else post += " ORDER BY item_number"; QStringList clauses; clauses = _extraClauses; if ( !(_itemType & ItemLineEdit::cActive) && !_showInactive->isChecked()) clauses << "(item_active)"; XSqlQuery alias; alias.prepare(buildItemLineEditQuery(pre, clauses, post, _itemType)); alias.bindValue(":searchString", _alias->text().trimmed()); alias.exec(); if (alias.first()) { if (_useQuery) { XSqlQuery item(_sql); if (item.first()) { XTreeWidgetItem *last = NULL; do { if (item.findFirst("item_id", alias.value("item_id").toInt()) != -1) last = new XTreeWidgetItem( _item, last, alias.value("item_id").toInt(), alias.value("itemalias_id").toInt(), alias.value("itemalias_number").toString(), alias.value("item_number").toString(), alias.value("item_descrip").toString() ); } while (alias.next()); } } else _item->populate(alias, TRUE); } } qt-client-4.1.0/widgets/itemAliasList.h000066400000000000000000000023071217451700100177770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef itemAliasList_h #define itemAliasList_h #include #include #include "widgets.h" #include "itemcluster.h" class QLineEdit; class QCheckBox; class QPushButton; class XTreeWidget; class ParameterList; class XTUPLEWIDGETS_EXPORT itemAliasList : public QDialog { Q_OBJECT public: itemAliasList(QWidget * = 0, const char * = 0, bool = FALSE, Qt::WFlags = 0 ); QLineEdit* _alias; QCheckBox* _showInactive; QPushButton* _close; QPushButton* _select; XTreeWidget* _item; virtual void set(const ParameterList & pParams); protected slots: virtual void sSelect(); virtual void sFillList(); private: unsigned int _itemType; bool _useQuery; QString _sql; QStringList _extraClauses; }; #endif qt-client-4.1.0/widgets/itemCluster.cpp000066400000000000000000001057031217451700100200720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include "itemcluster.h" #include "itemAliasList.h" #include "xsqltablemodel.h" #define DEBUG false QString buildItemLineEditQuery(const QString, const QStringList, const QString, const unsigned int); QString buildItemLineEditTitle(const unsigned int, const QString); QString buildItemLineEditQuery(const QString pPre, const QStringList pClauses, const QString pPost, const unsigned int pType) { QStringList clauses = pClauses; QString sql = pPre + " FROM item, uom"; clauses << "(item_inv_uom_id=uom_id)"; if (pType & (ItemLineEdit::cLocationControlled | ItemLineEdit::cLotSerialControlled | ItemLineEdit::cDefaultLocation | ItemLineEdit::cActive)) { sql += ", itemsite"; clauses << "(itemsite_item_id=item_id)"; } if (pType & ItemLineEdit::cAllItemTypes_Mask) { QStringList types; if (pType & ItemLineEdit::cPurchased) types << "'P'"; if (pType & ItemLineEdit::cManufactured) types << "'M'"; if (pType & ItemLineEdit::cPhantom) types << "'F'"; if (pType & ItemLineEdit::cBreeder) types << "'B'"; if (pType & ItemLineEdit::cCoProduct) types << "'C'"; if (pType & ItemLineEdit::cByProduct) types << "'Y'"; if (pType & ItemLineEdit::cReference) types << "'R'"; if (pType & ItemLineEdit::cCosting) types << "'S'"; if (pType & ItemLineEdit::cTooling) types << "'T'"; if (pType & ItemLineEdit::cOutsideProcess) types << "'O'"; if (pType & ItemLineEdit::cPlanning) types << "'L'"; if (pType & ItemLineEdit::cKit) types << "'K'"; if (!types.isEmpty()) clauses << QString("(item_type IN (" + types.join(",") + "))"); } if (pType & (ItemLineEdit::cLocationControlled | ItemLineEdit::cLotSerialControlled | ItemLineEdit::cDefaultLocation)) { QString sub; if (pType & ItemLineEdit::cLocationControlled) sub = "(itemsite_loccntrl)"; if (pType & ItemLineEdit::cLotSerialControlled) { if (!sub.isEmpty()) sub += " OR "; sub += "(itemsite_controlmethod IN ('L', 'S'))"; } if (pType & ItemLineEdit::cDefaultLocation) { if (!sub.isEmpty()) sub += " OR "; sub += "(useDefaultLocation(itemsite_id))"; } clauses << QString("( " + sub + " )"); } if (pType & ItemLineEdit::cSold) clauses << "(item_sold)"; if (pType & (ItemLineEdit::cActive | ItemLineEdit::cItemActive)) clauses << "(item_active)"; if (!clauses.isEmpty()) sql += " WHERE (" + clauses.join(" AND ") + ")"; if (!pPost.isEmpty()) sql += " " + pPost; sql += ";"; return sql; } QString buildItemLineEditTitle(const unsigned int pType, const QString pPost) { QString caption; unsigned int items = (0xFFFF & pType); // mask so this value only has the individual items if (pType & ItemLineEdit::cSold) caption += ItemLineEdit::tr("Sold "); if (pType & ItemLineEdit::cActive) caption = ItemLineEdit::tr("Active "); if (pType & ItemLineEdit::cLocationControlled) caption += ItemLineEdit::tr("Multiply Located "); else if (pType & ItemLineEdit::cLotSerialControlled) caption += ItemLineEdit::tr("Lot/Serial # Controlled "); else if (items == (ItemLineEdit::cGeneralPurchased | ItemLineEdit::cGeneralManufactured)) caption += ItemLineEdit::tr("Purchased and Manufactured "); else if ((items == ItemLineEdit::cGeneralPurchased) || (items == ItemLineEdit::cPurchased) ) caption += ItemLineEdit::tr("Purchased "); else if ( (items == ItemLineEdit::cGeneralManufactured) || (items == ItemLineEdit::cManufactured) ) caption += ItemLineEdit::tr("Manufactured "); else if (items == ItemLineEdit::cBreeder) caption += ItemLineEdit::tr("Breeder "); else if (items == (ItemLineEdit::cCoProduct | ItemLineEdit::cByProduct)) caption += ItemLineEdit::tr("Co-Product and By-Product "); else if (items == ItemLineEdit::cCosting) caption += ItemLineEdit::tr("Costing "); else if (items == ItemLineEdit::cGeneralComponents) caption += ItemLineEdit::tr("Component "); else if (items == ItemLineEdit::cKitComponents) caption += ItemLineEdit::tr("Kit Components "); if(!pPost.isEmpty()) caption += pPost; return caption; } ItemLineEditDelegate::ItemLineEditDelegate(QObject *parent) : QItemDelegate(parent) { _template = qobject_cast(parent); } ItemLineEditDelegate::~ItemLineEditDelegate() { } QWidget *ItemLineEditDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/*option*/, const QModelIndex &index) const { if (!index.isValid()) return 0; ItemLineEdit *widget = new ItemLineEdit(parent); // Make editor share certain properties with template widget->setType(_template->type()); QStringList clauses = _template->getExtraClauseList(); for (int i = 0; i < clauses.size(); i++) widget->addExtraClause(clauses.at(i)); return widget; } void ItemLineEditDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const { const XSqlTableModel *model = qobject_cast(index.model()); if (model) { ItemLineEdit *widget = qobject_cast(editor); if (widget) widget->setItemNumber(model->data(index).toString()); } } void ItemLineEditDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { if (!index.isValid()) return; if (model) { ItemLineEdit *widget = qobject_cast(editor); if (widget) model->setData(index, widget->itemNumber(), Qt::EditRole); } } ItemLineEdit::ItemLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "item", "item_id", "item_number", "(item_descrip1 || ' ' || item_descrip2) ", 0, 0, pName) { if (DEBUG) qDebug("ItemLineEdit::ItemLineEdit(%p, %s) entered", pParent, pName); setObjectName(pName ? pName : "ItemLineEdit"); setTitles(tr("Item"), tr("Items")); setUiName("item"); setEditPriv("MaintainItemMasters"); setViewPriv("ViewItemMasters"); setNewPriv("MaintainItemMasters"); setAcceptDrops(TRUE); _type = cUndefined; _defaultType = cUndefined; _useQuery = FALSE; _useValidationQuery = FALSE; _itemNumber = ""; _uom = ""; _itemType = ""; _id = -1; _configured = FALSE; _fractional = FALSE; _delegate = new ItemLineEditDelegate(this); connect(_aliasAct, SIGNAL(triggered()), this, SLOT(sAlias())); // Add alias if (_x_preferences) { if (!_x_preferences->boolean("ClusterButtons")) menu()->insertAction(menu()->actions().at(2),_aliasAct); } } void ItemLineEdit::setItemNumber(const QString& pNumber) { if (DEBUG) qDebug("%s::setItemNumber(%s) entered", qPrintable(objectName()), qPrintable(pNumber)); XSqlQuery item; bool found = FALSE; _parsed = TRUE; if (pNumber == text()) return; if (!pNumber.isEmpty()) { if (_useValidationQuery) { item.prepare(_validationSql); item.bindValue(":item_number", pNumber); item.exec(); if (item.first()) found = TRUE; } else if (_useQuery) { item.prepare(_sql); item.exec(); found = (item.findFirst("item_number", pNumber) != -1); } else if (pNumber != QString::Null()) { QString pre( "SELECT DISTINCT item_id, item_number, item_descrip1, item_descrip2," " uom_name, item_type, item_config, item_fractional, item_upccode"); QStringList clauses; clauses = _extraClauses; clauses << "(item_number=:item_number OR item_upccode=:item_number)"; item.prepare(buildItemLineEditQuery(pre, clauses, QString::null, _type)); item.bindValue(":item_number", pNumber); item.exec(); if (item.size() > 1) { ParameterList params; params.append("search", pNumber); params.append("searchNumber"); params.append("searchUpc"); sSearch(params); return; } else found = item.first(); } } if (found) { _itemNumber = pNumber; _uom = item.value("uom_name").toString(); _itemType = item.value("item_type").toString(); _configured = item.value("item_config").toBool(); _fractional = item.value("item_fractional").toBool(); _id = item.value("item_id").toInt(); _upc = item.value("item_upccode").toInt(); _valid = TRUE; setText(item.value("item_number").toString()); emit aliasChanged(""); emit typeChanged(_itemType); emit descrip1Changed(item.value("item_descrip1").toString()); emit descrip2Changed(item.value("item_descrip2").toString()); emit uomChanged(item.value("uom_name").toString()); emit configured(item.value("item_config").toBool()); emit fractional(item.value("item_fractional").toBool()); emit upcChanged(item.value("item_upccode").toString()); emit valid(TRUE); } else { _itemNumber = ""; _uom = ""; _itemType = ""; _id = -1; _valid = FALSE; _upc = ""; setText(""); emit aliasChanged(""); emit typeChanged(""); emit descrip1Changed(""); emit descrip2Changed(""); emit uomChanged(""); emit configured(FALSE); emit fractional(FALSE); emit upcChanged(""); emit valid(FALSE); } } void ItemLineEdit::silentSetId(const int pId) { if (DEBUG) qDebug("%s::silentSetId(%d) entered", qPrintable(objectName()), pId); XSqlQuery item; bool found = FALSE; _parsed = TRUE; if (_useValidationQuery) { item.prepare(_validationSql); item.bindValue(":item_id", pId); item.exec(); if (item.first()) found = TRUE; } else if (_useQuery) { item.prepare(_sql); item.exec(); found = (item.findFirst("item_id", pId) != -1); } else if (pId != -1) { QString pre( "SELECT DISTINCT item_number, item_descrip1, item_descrip2," " uom_name, item_type, item_config, item_fractional, item_upccode"); QStringList clauses; clauses = _extraClauses; clauses << "(item_id=:item_id)"; item.prepare(buildItemLineEditQuery(pre, clauses, QString::null, _type)); item.bindValue(":item_id", pId); item.exec(); found = item.first(); } if (found) { if (completer()) { disconnect(this, SIGNAL(textChanged(QString)), this, SLOT(sHandleCompleter())); static_cast(completer()->model())->setQuery(QSqlQuery()); } _itemNumber = item.value("item_number").toString(); _uom = item.value("uom_name").toString(); _itemType = item.value("item_type").toString(); _configured = item.value("item_config").toBool(); _fractional = item.value("item_fractional").toBool(); _upc = item.value("item_upccode").toString(); _id = pId; _valid = TRUE; setText(item.value("item_number").toString()); emit aliasChanged(""); emit typeChanged(_itemType); emit descrip1Changed(item.value("item_descrip1").toString()); emit descrip2Changed(item.value("item_descrip2").toString()); emit uomChanged(item.value("uom_name").toString()); emit configured(item.value("item_config").toBool()); emit fractional(item.value("item_fractional").toBool()); emit upcChanged(item.value("item_upccode").toString()); emit valid(TRUE); if (completer()) connect(this, SIGNAL(textChanged(QString)), this, SLOT(sHandleCompleter())); } else { _itemNumber = ""; _uom = ""; _itemType = ""; _id = -1; _upc = ""; _valid = FALSE; setText(""); emit aliasChanged(""); emit typeChanged(""); emit descrip1Changed(""); emit descrip2Changed(""); emit uomChanged(""); emit configured(FALSE); emit fractional(FALSE); emit upcChanged(""); emit valid(FALSE); } } void ItemLineEdit::setId(int pId) { if (DEBUG) qDebug("%s::setId(%d) entered", qPrintable(objectName()), pId); bool changed = (pId != _id); silentSetId(pId); if (changed) { emit privateIdChanged(_id); emit newId(_id); } } void ItemLineEdit::setItemsiteid(int pItemsiteid) { if (DEBUG) qDebug("%s::setItemsiteId(%d) entered", qPrintable(objectName()), pItemsiteid); XSqlQuery itemsite; itemsite.prepare( "SELECT itemsite_item_id, itemsite_warehous_id " "FROM itemsite " "WHERE (itemsite_id=:itemsite_id);" ); itemsite.bindValue(":itemsite_id", pItemsiteid); itemsite.exec(); if (itemsite.first()) { setId(itemsite.value("itemsite_item_id").toInt()); emit warehouseIdChanged(itemsite.value("itemsite_warehous_id").toInt()); } else { setId(-1); emit warehouseIdChanged(-1); } } void ItemLineEdit::sInfo() { ParameterList params; params.append("item_id", id()); _guiClientInterface->openWindow("itemAvailabilityWorkbench", params, parentWidget()->window() , Qt::NonModal, Qt::Window); } void ItemLineEdit::sHandleCompleter() { if (DEBUG) qDebug("%s::sHandleCompleter() entered", qPrintable(objectName())); if (!hasFocus()) return; QString stripped = text().trimmed().toUpper(); if (stripped.isEmpty()) return; int width = 0; QSqlQueryModel* model = static_cast(_completer->model()); QTreeView * view = static_cast(_completer->popup()); _parsed = true; XSqlQuery numQ; if (_useQuery) { numQ.prepare(QString("SELECT *" " FROM (%1) data" " WHERE (POSITION(:number IN item_number)=1)" " LIMIT 10") .arg(QString(_sql)).remove(";")); numQ.bindValue(":number", stripped); } else { QString pre( "SELECT DISTINCT item_id, item_number, " "(item_descrip1 || ' ' || item_descrip2) AS itemdescrip, " "item_upccode AS description " ); QStringList clauses; clauses = _extraClauses; clauses << "((POSITION(:searchString IN item_number) = 1)" " OR (POSITION(:searchString IN item_upccode) = 1))"; numQ.prepare(buildItemLineEditQuery(pre, clauses, QString::null, _type) .replace(";"," ORDER BY item_number LIMIT 10;")); numQ.bindValue(":searchString", QString(text().trimmed().toUpper())); } numQ.exec(); if (numQ.first()) { int numberCol = numQ.record().indexOf("item_number"); int descripCol = numQ.record().indexOf("itemdescrip"); model->setQuery(numQ); _completer->setCompletionPrefix(stripped); for (int i = 0; i < model->columnCount(); i++) { if ( (i == numberCol) || (i == descripCol) ) { view->resizeColumnToContents(i); width += view->columnWidth(i); } else view->hideColumn(i); } } else model->setQuery(QSqlQuery()); if (width > 350) width = 350; QRect rect; rect.setHeight(height()); rect.setWidth(width); rect.setBottomLeft(QPoint(0, height() - 2)); _completer->complete(rect); _parsed = false; } void ItemLineEdit::sUpdateMenu() { VirtualClusterLineEdit::sUpdateMenu(); if (_x_privileges) _infoAct->setEnabled(_x_privileges->check("ViewItemAvailabilityWorkbench") && _id != -1); } void ItemLineEdit::sList() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); ParameterList params; params.append("item_id", _id); if (queryUsed()) params.append("sql", _sql); else params.append("itemType", _defaultType); if (!_extraClauses.isEmpty()) params.append("extraClauses", _extraClauses); itemList* newdlg = listFactory(); newdlg->set(params); int id; if ((id = newdlg->exec())!= _id) setId(id); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void ItemLineEdit::sSearch() { ParameterList params; sSearch(params); } void ItemLineEdit::sSearch(ParameterList params) { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); params.append("item_id", _id); if (queryUsed()) params.append("sql", _sql); else params.append("itemType", _type); if (!_extraClauses.isEmpty()) params.append("extraClauses", _extraClauses); itemSearch* newdlg = searchFactory(); newdlg->set(params); QString stripped = text().trimmed(); if(stripped.length()) { XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + QString("ORDER BY %1;").arg(_numColName)); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if (numQ.first()) newdlg->setQuery(numQ); } newdlg->setSearchText(text()); int id; if ((id = newdlg->exec()) != QDialog::Rejected) setId(id); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } itemList* ItemLineEdit::listFactory() { return new itemList(this); } itemSearch* ItemLineEdit::searchFactory() { return new itemSearch(this); } void ItemLineEdit::sAlias() { ParameterList params; if (queryUsed()) params.append("sql", _sql); else params.append("itemType", _type); if (!_extraClauses.isEmpty()) params.append("extraClauses", _extraClauses); itemAliasList newdlg(parentWidget(), "", TRUE); newdlg.set(params); int itemaliasid; if ((itemaliasid = newdlg.exec()) != QDialog::Rejected) { XSqlQuery itemalias; itemalias.prepare( "SELECT itemalias_number, itemalias_item_id " "FROM itemalias " "WHERE (itemalias_id=:itemalias_id);" ); itemalias.bindValue(":itemalias_id", itemaliasid); itemalias.exec(); if (itemalias.first()) { setId(itemalias.value("itemalias_item_id").toInt()); emit aliasChanged(itemalias.value("itemalias_number").toString()); focusNextPrevChild(TRUE); } } } QString ItemLineEdit::itemNumber() { sParse(); return _itemNumber; } QString ItemLineEdit::uom() { sParse(); return _uom; } QString ItemLineEdit::upc() { sParse(); return _upc; } QString ItemLineEdit::itemType() { sParse(); return _itemType; } bool ItemLineEdit::isConfigured() { sParse(); return _configured; } bool ItemLineEdit::isFractional() { sParse(); return _fractional; } void ItemLineEdit::sParse() { if (DEBUG) qDebug("%s::sParse() entered with parsed %d, text [%s], " "_useValidationQuery %d, _useQuery %d", qPrintable(objectName()), _parsed, qPrintable(text()), _useValidationQuery, _useQuery); if (!_parsed) { _parsed = TRUE; if (text().length() == 0) { setId(-1); return; } else if (_useValidationQuery) { XSqlQuery item; if (completer()) item.prepare("SELECT item_id" " FROM item" " WHERE ((POSITION(:searchString IN item_number) = 1)" " OR (POSITION(:searchString IN item_upccode) = 1));"); else item.prepare("SELECT item_id" " FROM item" " WHERE (item_number = :searchString" " OR item_upccode = :searchString);"); item.bindValue(":searchString", text().trimmed().toUpper()); item.exec(); while (item.next()) { int itemid = item.value("item_id").toInt(); XSqlQuery oneq; oneq.prepare(_validationSql); oneq.bindValue(":item_id", itemid); oneq.exec(); if (oneq.size() > 1) { ParameterList params; params.append("search", text().trimmed().toUpper()); params.append("searchNumber"); params.append("searchUpc"); sSearch(params); return; } else if (oneq.first()) { setId(itemid); return; } } } else if (_useQuery) { XSqlQuery item; item.prepare(_sql); item.exec(); if (item.first()) { do { if (item.value("item_number").toString().startsWith(text().trimmed().toUpper()) || item.value("item_upccode").toString().startsWith(text().trimmed().toUpper())) { setId(item.value("item_id").toInt()); return; } } while (item.next()); } } else { XSqlQuery item; QString pre( "SELECT DISTINCT item_id, item_number AS number, " "(item_descrip1 || ' ' || item_descrip2) AS name, " "item_upccode AS description " ); QStringList clauses; clauses = _extraClauses; clauses << "((POSITION(:searchString IN item_number) = 1)" " OR (POSITION(:searchString IN item_upccode) = 1))"; item.prepare(buildItemLineEditQuery(pre, clauses, QString::null, _type) .replace(";"," ORDER BY item_number LIMIT 1;")); item.bindValue(":searchString", QString(text().trimmed().toUpper())); item.exec(); if (item.first()) { setId(item.value("item_id").toInt()); return; } } setId(-1); } } void ItemLineEdit::addExtraClause(const QString & pClause) { _extraClauses << pClause; } ItemCluster::ItemCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { setObjectName(pName); addNumberWidget(new ItemLineEdit(this, pName)); setLabel(tr("Item Number:")); // Create the component Widgets QLabel *_uomLit = new QLabel(tr("UOM:"), this); _uomLit->setObjectName("_uomLit"); _uomLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _uom = new QLabel(this); _uom->setObjectName("_uom"); _uom->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); _uom->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); _uom->setMinimumWidth(50); _grid->addWidget(_uomLit, 0, 2); _grid->addWidget(_uom, 0, 3); _descrip2 = new QLabel(this); _descrip2->setObjectName("_descrip2"); _descrip2->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); _descrip2->setMaximumWidth(300); _grid->addWidget(_descrip2, 3, 1, 1, -1); setDescriptionVisible(true); // Make some internal connections ItemLineEdit* itemNumber = static_cast(_number); connect(itemNumber, SIGNAL(aliasChanged(const QString &)), this, SIGNAL(aliasChanged(const QString &))); connect(itemNumber, SIGNAL(privateIdChanged(int)), this, SIGNAL(privateIdChanged(int))); connect(itemNumber, SIGNAL(newId(int)), this, SIGNAL(newId(int))); connect(itemNumber, SIGNAL(uomChanged(const QString &)), this, SIGNAL(uomChanged(const QString &))); connect(itemNumber, SIGNAL(descrip1Changed(const QString &)), this, SIGNAL(descrip1Changed(const QString &))); connect(itemNumber, SIGNAL(descrip2Changed(const QString &)), this, SIGNAL(descrip2Changed(const QString &))); connect(itemNumber, SIGNAL(valid(bool)), this, SIGNAL(valid(bool))); connect(itemNumber, SIGNAL(warehouseIdChanged(int)), this, SIGNAL(warehouseIdChanged(int))); connect(itemNumber, SIGNAL(typeChanged(const QString &)), this, SIGNAL(typeChanged(const QString &))); connect(itemNumber, SIGNAL(upcChanged(const QString &)), this, SIGNAL(upcChanged(const QString &))); connect(itemNumber, SIGNAL(configured(bool)), this, SIGNAL(configured(bool))); connect(itemNumber, SIGNAL(fractional(bool)), this, SIGNAL(fractional(bool))); connect(itemNumber, SIGNAL(uomChanged(const QString &)), _uom, SLOT(setText(const QString &))); connect(itemNumber, SIGNAL(descrip1Changed(const QString &)), _description, SLOT(setText(const QString &))); connect(itemNumber, SIGNAL(descrip2Changed(const QString &)), _descrip2, SLOT(setText(const QString &))); } void ItemCluster::addNumberWidget(ItemLineEdit* pNumberWidget) { _number = pNumberWidget; if (! _number) return; _grid->addWidget(_number, 0, 1); setFocusProxy(pNumberWidget); connect(_number, SIGNAL(newId(int)), this, SIGNAL(newId(int))); connect(_number, SIGNAL(parsed()), this, SLOT(sRefresh())); connect(_number, SIGNAL(valid(bool)), this, SIGNAL(valid(bool))); } void ItemCluster::setDescriptionVisible(const bool p) { _description->setVisible(p); _descrip2->setVisible(p); } void ItemCluster::setReadOnly(const bool pReadOnly) { if (pReadOnly) _number->setEnabled(FALSE); else _number->setEnabled(TRUE); } void ItemCluster::setEnabled(const bool pEnabled) { setReadOnly(!pEnabled); } void ItemCluster::setDisabled(bool pDisabled) { setReadOnly(pDisabled); } void ItemCluster::setId(const int pId) { _number->setId(pId); } void ItemCluster::setItemNumber(QString pNumber) { static_cast(_number)->setItemNumber(pNumber); } void ItemCluster::setItemsiteid(int intPItemsiteid) { static_cast(_number)->setItemsiteid(intPItemsiteid); } void ItemCluster::setOrientation(Qt::Orientation orientation) { _descrip2->setVisible(orientation == Qt::Vertical); VirtualCluster::setOrientation(orientation); } //////////////////////////////////////////////////////////////////////// itemList::itemList(QWidget* pParent, Qt::WindowFlags pFlags ) : VirtualList(pParent, pFlags) { setObjectName( "itemList" ); setAttribute(Qt::WA_DeleteOnClose); setMinimumWidth(600); _itemid = -1; _itemType = ItemLineEdit::cUndefined; _useQuery = FALSE; setWindowTitle(tr("Item List")); _showInactive = new QCheckBox(tr("Show &Inactive Items"), this); _showInactive->setObjectName("_showInactive"); _dialogLyt->insertWidget(1, _showInactive ); _showMake = new QCheckBox(tr("&Make Items Only"), this); _showMake->setObjectName("_showMake"); _showBuy = new QCheckBox(tr("&Buy Items Only"), this); _showBuy->setObjectName("_showBuy"); _dialogLyt->insertWidget(2, _showMake ); _dialogLyt->insertWidget(3, _showBuy ); connect( _showInactive, SIGNAL( clicked() ), this, SLOT( sFillList() ) ); connect( _showMake, SIGNAL( clicked() ), this, SLOT( sFillList() ) ); connect( _showBuy, SIGNAL( clicked() ), this, SLOT( sFillList() ) ); _listTab->setColumnCount(0); _listTab->addColumn(tr("Item Number"), 100, Qt::AlignLeft, true); _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true); _listTab->addColumn(tr("Bar Code"), 100, Qt::AlignLeft, true); } void itemList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _itemid = param.toInt(); else _itemid = -1; param = pParams.value("sql", &valid); if (valid) { _sql = param.toString(); _useQuery = TRUE; } else _useQuery = FALSE; param = pParams.value("itemType", &valid); if (valid) { _itemType = param.toUInt(); setWindowTitle(buildItemLineEditTitle(_itemType, tr("Items"))); _showMake->setChecked(_itemType & ItemLineEdit::cGeneralManufactured); _showBuy->setChecked(_itemType & ItemLineEdit::cGeneralPurchased); } else { _itemType = ItemLineEdit::cUndefined; _showMake->hide(); _showBuy->hide(); } param = pParams.value("extraClauses", &valid); if (valid) _extraClauses = param.toStringList(); _showInactive->setChecked(FALSE); _showInactive->setEnabled(!(_itemType & ItemLineEdit::cActive)); if(!_showInactive->isEnabled()) _showInactive->hide(); param = pParams.value("caption", &valid); if (valid) setWindowTitle(param.toString()); sFillList(); } void itemList::sSearch(const QString &pTarget) { if (_listTab->currentItem()) _listTab->setCurrentItem(0); _listTab->clearSelection(); int i; for (i = 0; i < _listTab->topLevelItemCount(); i++) if (_listTab->topLevelItem(i)->text(0).startsWith(pTarget, Qt::CaseInsensitive) || _listTab->topLevelItem(i)->text(1).startsWith(pTarget, Qt::CaseInsensitive) || _listTab->topLevelItem(i)->text(2).startsWith(pTarget, Qt::CaseInsensitive)) break; if (i < _listTab->topLevelItemCount()) { _listTab->setCurrentItem(_listTab->topLevelItem(i)); _listTab->scrollToItem(_listTab->topLevelItem(i)); } } void itemList::sFillList() { _listTab->clear(); if (_useQuery) { _listTab->populate(_sql, _itemid); } else { QString pre; QString post; if(_x_preferences && _x_preferences->boolean("ListNumericItemNumbersFirst")) { pre = "SELECT DISTINCT ON (toNumeric(item_number, 999999999999999), item_number) item_id, item_number," "(item_descrip1 || ' ' || item_descrip2) AS itemdescrip, item_upccode "; post = "ORDER BY toNumeric(item_number, 999999999999999), item_number, item_upccode "; } else { pre = "SELECT DISTINCT item_id, item_number," "(item_descrip1 || ' ' || item_descrip2) AS itemdescrip, item_upccode "; post = "ORDER BY item_number"; } QStringList clauses; clauses = _extraClauses; if(!(_itemType & ItemLineEdit::cActive) && !_showInactive->isChecked()) clauses << "(item_active)"; if (_showMake->isChecked()) _itemType = (_itemType | ItemLineEdit::cGeneralManufactured); else if (_itemType & ItemLineEdit::cGeneralManufactured) _itemType = (_itemType ^ ItemLineEdit::cGeneralManufactured); if (_showBuy->isChecked()) _itemType = (_itemType | ItemLineEdit::cGeneralPurchased); else if (_itemType & ItemLineEdit::cGeneralPurchased) _itemType = (_itemType ^ ItemLineEdit::cGeneralPurchased); setWindowTitle(buildItemLineEditTitle(_itemType, tr("Items"))); _listTab->populate(buildItemLineEditQuery(pre, clauses, post, _itemType), _itemid); } } void itemList::reject() { done(_itemid); } ////////////////////////////////////////////////////////////////////// itemSearch::itemSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose); setObjectName( "itemSearch" ); setMinimumWidth(600); _itemid = -1; _itemType = ItemLineEdit::cUndefined; _useQuery = FALSE; setWindowTitle( tr( "Search for Item" ) ); _searchName->setText(tr("Search through Description 1")); _searchDescrip->show(); _searchDescrip->setText(tr("Search through Description 2")); _searchUpc = new XCheckBox(tr("Search through Bar Code")); _searchUpc->setChecked( TRUE ); _searchUpc->setObjectName("_searchUpc"); selectorsLyt->addWidget(_searchUpc); _showInactive = new XCheckBox(tr("Show &Inactive Items")); _showInactive->setObjectName("_showInactive"); selectorsLyt->addWidget(_showInactive); // signals and slots connections connect( _showInactive, SIGNAL( clicked() ), this, SLOT( sFillList() ) ); connect( _searchName, SIGNAL(clicked() ), this, SLOT( sFillList() ) ); connect( _searchUpc, SIGNAL( clicked() ), this, SLOT( sFillList() ) ); _listTab->setColumnCount(0); _listTab->addColumn(tr("Item Number"), 100, Qt::AlignLeft, true ); _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true ); _listTab->addColumn(tr("Bar Code"), 100, Qt::AlignLeft, true ); } void itemSearch::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("item_id", &valid); if (valid) _itemid = param.toInt(); else _itemid = -1; param = pParams.value("sql", &valid); if (valid) { _sql = param.toString(); _useQuery = TRUE; } else _useQuery = FALSE; param = pParams.value("itemType", &valid); if (valid) { _itemType = param.toUInt(); setWindowTitle(buildItemLineEditTitle(_itemType, tr("Items"))); } else _itemType = ItemLineEdit::cUndefined; param = pParams.value("extraClauses", &valid); if (valid) _extraClauses = param.toStringList(); _showInactive->setChecked(FALSE); _showInactive->setEnabled(!(_itemType & ItemLineEdit::cActive)); param = pParams.value("caption", &valid); if (valid) setWindowTitle(param.toString()); param = pParams.value("search", &valid); if (valid) _search->setText(param.toString()); param = pParams.value("searchNumber", &valid); if (valid) _searchNumber->setChecked(true); param = pParams.value("searchUpc", &valid); if (valid) _searchUpc->setChecked(true); sFillList(); } void itemSearch::sFillList() { _search->setText(_search->text().trimmed().toUpper()); if (_search->text().length() == 0) return; QString sql; if (_useQuery) { QStringList clauses; if (!_showInactive->isChecked()) clauses << "(item_active)"; QStringList subClauses; if (_searchNumber->isChecked()) subClauses << "(item_number ~* :searchString)"; if (_searchName->isChecked()) subClauses << "(item_descrip1 ~* :searchString)"; if (_searchDescrip->isChecked()) subClauses << "(item_descrip2 ~* :searchString)"; if (_searchUpc->isChecked()) subClauses << "(item_upccode ~* :searchString)"; if(!subClauses.isEmpty()) clauses << QString("( " + subClauses.join(" OR ") + " )"); sql = "SELECT * FROM (" + _sql + ") AS dummy WHERE (" + clauses.join(" AND ") + ");" ; } else { if ( (!_searchNumber->isChecked()) && (!_searchName->isChecked()) && (!_searchDescrip->isChecked()) && (!_searchUpc->isChecked()) ) { _listTab->clear(); return; } QString pre; QString post; if(_x_preferences && _x_preferences->boolean("ListNumericItemNumbersFirst")) { pre = "SELECT DISTINCT ON (toNumeric(item_number, 999999999999999), item_number) item_id, item_number, (item_descrip1 || ' ' || item_descrip2), item_upccode "; post = "ORDER BY toNumeric(item_number, 999999999999999), item_number"; } else { pre = "SELECT DISTINCT item_id, item_number AS number, " "(item_descrip1 || ' ' || item_descrip2) AS name, " "item_upccode AS description "; post = "ORDER BY item_number"; } QStringList clauses; clauses = _extraClauses; if(!(_itemType & ItemLineEdit::cActive) && !_showInactive->isChecked()) clauses << "(item_active)"; QStringList subClauses; if (_searchNumber->isChecked()) subClauses << "(item_number ~* :searchString)"; if (_searchName->isChecked()) subClauses << "(item_descrip1 ~* :searchString)"; if (_searchDescrip->isChecked()) subClauses << "(item_descrip2 ~* :searchString)"; if (_searchUpc->isChecked()) subClauses << "(item_upccode ~* :searchString)"; if(!subClauses.isEmpty()) clauses << QString("( " + subClauses.join(" OR ") + " )"); sql = buildItemLineEditQuery(pre, clauses, post, _itemType); } XSqlQuery search; search.prepare(sql); search.bindValue(":searchString", _search->text()); search.exec(); _listTab->populate(search, _itemid); } qt-client-4.1.0/widgets/itemcluster.h000066400000000000000000000240001217451700100175650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef itemCluster_h #define itemCluster_h #include "virtualCluster.h" #include "qstringlist.h" #include #include #include #include "virtualCluster.h" class ParameterList; class QPushButton; class QLabel; class QDragEnterEvent; class QDropEvent; class QMouseEvent; class ItemLineEditDelegate; class itemList; class itemSearch; class XTUPLEWIDGETS_EXPORT itemList : public VirtualList { Q_OBJECT public: itemList(QWidget*, Qt::WindowFlags = 0); QCheckBox* _showInactive; QCheckBox* _showMake; QCheckBox* _showBuy; public slots: virtual void set(const ParameterList & pParams); virtual void reject(); virtual void sSearch( const QString & pTarget ); virtual void sFillList(); private: int _itemid; unsigned int _itemType; bool _useQuery; QString _sql; QStringList _extraClauses; }; class XTUPLEWIDGETS_EXPORT itemSearch : public VirtualSearch { Q_OBJECT public: itemSearch(QWidget*, Qt::WindowFlags = 0); XCheckBox* _searchDescrip2; XCheckBox* _searchUpc; XCheckBox* _showInactive; public slots: void set(const ParameterList & pParams); void sFillList(); private: int _itemid; unsigned int _itemType; bool _useQuery; QString _sql; QStringList _extraClauses; }; class XTUPLEWIDGETS_EXPORT ItemLineEdit : public VirtualClusterLineEdit { Q_OBJECT Q_PROPERTY(unsigned int type READ type WRITE setType DESIGNABLE false) friend class ItemCluster; friend class ItemLineEditDelegate; public: ItemLineEdit(QWidget *, const char * = 0); enum Type { cUndefined = 0x00, // Specific Item Types cPurchased = 0x00000001, cManufactured = 0x00000002, cPhantom = 0x00000004, cBreeder = 0x00000008, cCoProduct = 0x00000010, cByProduct = 0x00000020, cReference = 0x00000040, cCosting = 0x00000080, cTooling = 0x00000100, cOutsideProcess = 0x00000200, cPlanning = 0x00000400, cKit = 0x00001000, // The first 16 bits are reserved for individual item types and we // have this mask defined here for convenience. cAllItemTypes_Mask = 0x0000FFFF, // Planning Systems // TODO // Planning Type moved to Itemsite, don't think this is used cPlanningMRP = 0x00100000, cPlanningMPS = 0x00200000, cPlanningNone = 0x00400000, cPlanningAny = cPlanningMRP | cPlanningMPS | cPlanningNone, // Misc. Options cItemActive = 0x04000000, cSold = 0x08000000, // Lot/Serial and Location Controlled cLocationControlled = 0x10000000, cLotSerialControlled = 0x20000000, cDefaultLocation = 0x40000000, // Active ItemSite cActive = 0x80000000, // Groups of Item Types cGeneralManufactured = cManufactured | cBreeder, cGeneralPurchased = cPurchased | cOutsideProcess | cTooling, cGeneralComponents = cManufactured | cPhantom | cCoProduct | cPurchased | cOutsideProcess | cReference | cTooling, cGeneralInventory = cAllItemTypes_Mask ^ cReference, cKitComponents = cSold | (cAllItemTypes_Mask ^ cKit) }; Q_INVOKABLE inline unsigned int type() const { return _type; } Q_INVOKABLE inline void setType(unsigned int pType) { _type = pType; _defaultType = pType; } Q_INVOKABLE inline void setDefaultType(unsigned int pType) { _defaultType = pType; } Q_INVOKABLE inline void setQuery(const QString &pSql) { _sql = pSql; _useQuery = TRUE; } Q_INVOKABLE inline void setValidationQuery(const QString &pSql) { _validationSql = pSql; _useValidationQuery = TRUE; } Q_INVOKABLE inline int queryUsed() const { return _useQuery; } Q_INVOKABLE inline int validationQueryUsed() const { return _useValidationQuery; } Q_INVOKABLE void addExtraClause(const QString &); Q_INVOKABLE inline QStringList getExtraClauseList() const { return _extraClauses; } Q_INVOKABLE inline void clearExtraClauseList() { _extraClauses.clear(); } Q_INVOKABLE ItemLineEditDelegate* itemDelegate() { return _delegate;} Q_INVOKABLE QString itemNumber(); Q_INVOKABLE QString uom(); Q_INVOKABLE QString upc(); Q_INVOKABLE QString itemType(); Q_INVOKABLE bool isConfigured(); Q_INVOKABLE bool isFractional(); public slots: void sHandleCompleter(); void sInfo(); void sList(); void sSearch(); void sSearch(ParameterList params); void sAlias(); void silentSetId(const int); void setId(const int); void setItemNumber(const QString& pNumber); // Legacy support void setItemsiteid(int); void setNumber(const QString& pNumber) { setItemNumber(pNumber); } void sParse(); signals: void privateIdChanged(int); void newId(int); void aliasChanged(const QString &); void uomChanged(const QString &); void descrip1Changed(const QString &); void descrip2Changed(const QString &); void typeChanged(const QString &); void upcChanged(const QString &); void configured(bool); void fractional(bool); void warehouseIdChanged(int); void valid(bool); protected slots: itemList* listFactory(); itemSearch* searchFactory(); void sUpdateMenu(); private: void constructor(); ItemLineEditDelegate *_delegate; QString _sql; QString _validationSql; QString _itemNumber; QString _uom; QString _upc; QString _itemType; QStringList _extraClauses; unsigned int _type; unsigned int _defaultType; bool _configured; bool _fractional; bool _useQuery; bool _useValidationQuery; }; class ItemLineEditDelegate : public QItemDelegate { Q_OBJECT public: ItemLineEditDelegate(QObject *parent = 0); ~ItemLineEditDelegate(); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; private: ItemLineEdit *_template; }; class XTUPLEWIDGETS_EXPORT ItemCluster : public VirtualCluster { Q_OBJECT Q_PROPERTY(unsigned int type READ type WRITE setType DESIGNABLE false) friend class ContactList; friend class ContactSearch; public: ItemCluster(QWidget*, const char* = 0); Q_INVOKABLE void setReadOnly(const bool); void setEnabled(const bool); void setDisabled(bool); Q_INVOKABLE inline void setType(unsigned int pType) { static_cast(_number)->setType(pType); static_cast(_number)->setDefaultType(pType); } Q_INVOKABLE inline unsigned int type() const { return static_cast(_number)->type(); } Q_INVOKABLE inline void setDefaultType(unsigned int pType){ static_cast(_number)->setDefaultType(pType); } Q_INVOKABLE inline void setQuery(const QString &pSql) { static_cast(_number)->setQuery(pSql); } Q_INVOKABLE inline void setValidationQuery(const QString &pSql) { static_cast(_number)->setValidationQuery(pSql); } Q_INVOKABLE QString itemNumber() const { return static_cast(_number)->itemNumber(); } Q_INVOKABLE QString itemType() const { return static_cast(_number)->itemType(); } Q_INVOKABLE bool isConfigured() const { return static_cast(_number)->isConfigured(); } Q_INVOKABLE bool isFractional() const { return static_cast(_number)->isFractional(); } Q_INVOKABLE QString uom() const { return static_cast(_number)->uom(); } Q_INVOKABLE QString upc() const { return static_cast(_number)->upc(); } Q_INVOKABLE inline void addExtraClause(const QString & pClause) { static_cast(_number)->addExtraClause(pClause); } Q_INVOKABLE inline QStringList getExtraClauseList() const { return static_cast(_number)->getExtraClauseList(); } Q_INVOKABLE inline void clearExtraClauseList() { static_cast(_number)->clearExtraClauseList(); } Q_INVOKABLE ItemLineEdit *itemLineEdit() { return static_cast(_number); } void setOrientation(Qt::Orientation orientation); public slots: QItemDelegate *itemDelegate() { return static_cast(_number)->itemDelegate(); } void setDescriptionVisible(const bool p); void setId(const int pId); void setItemNumber(QString); void setItemsiteid(int); signals: void privateIdChanged(int); void aliasChanged(const QString &); void uomChanged(const QString &); void descrip1Changed(const QString &); void descrip2Changed(const QString &); void warehouseIdChanged(int); void typeChanged(const QString &); void upcChanged(const QString &); void configured(bool); void fractional(bool); protected: void addNumberWidget(ItemLineEdit* pNumberWidget); private: QLabel *_uom; QLabel *_descrip2; QString _default; }; #endif qt-client-4.1.0/widgets/itemlineedit.h000066400000000000000000000007251217451700100177110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/widgets/lotserialCluster.cpp000066400000000000000000000171071217451700100211320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "lotserialcluster.h" #include #include #include "xsqlquery.h" LotserialList::LotserialList(QWidget* pParent, Qt::WindowFlags flags) : VirtualList(pParent, flags) { setObjectName("LotserialList"); _listTab->headerItem()->setText(0, tr("Lot/Serial #")); _listTab->headerItem()->setText(1, tr("Item #")); } LotserialSearch::LotserialSearch(QWidget* pParent, Qt::WindowFlags flags) : VirtualSearch(pParent, flags) { setObjectName("LotserialSearch"); _listTab->headerItem()->setText(0, tr("Lot/Serial #")); _listTab->headerItem()->setText(1, tr("Item #")); } LotserialCluster::LotserialCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { LotserialLineEdit* lsle=new LotserialLineEdit(this, pName); addNumberWidget(lsle); connect(lsle, SIGNAL(newItemId(int)), this, SIGNAL(newItemId(int))); } LotserialLineEdit::LotserialLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "ls", "ls_id", "ls_number", "item_number", "item_id", 0, pName) { _itemid = -1; setTitles(tr("Lot/Serial Number"), tr("Lot/Serial Numbers")); _query = QString("SELECT ls_id AS id, " " ls_number AS number, " " item_id," " item_number AS name, " " ls_notes AS description " "FROM ls " " JOIN item ON (ls_item_id=item_id) " "WHERE (true) "); _strict = true; } int LotserialCluster::itemId() const { if (_number && _number->inherits("LotserialLineEdit")) return ((LotserialLineEdit*)(_number))->itemId(); return true; } void LotserialCluster::setItemId(const int p) { if (_number && _number->inherits("LotserialLineEdit")) ((LotserialLineEdit*)(_number))->setItemId(p); } bool LotserialCluster::strict() const { if (_number && _number->inherits("LotserialLineEdit")) return ((LotserialLineEdit*)(_number))->strict(); return true; } void LotserialCluster::setStrict(const bool p) { if (_number && _number->inherits("LotserialLineEdit")) ((LotserialLineEdit*)(_number))->setStrict(p); } void LotserialLineEdit::setItemId(const int itemid) { if (_itemid == itemid) return; else if (itemid <= 0) { _itemid = -1; _extraClause = ""; } else { _itemid = itemid; _extraClause = QString(" (item_id=%1) ").arg(itemid); } if (_id != -1) { XSqlQuery qry; qry.prepare("SELECT ls_id " "FROM ls " "WHERE ((ls_id=:ls_id) " " AND (ls_item_id=:item_id)); "); qry.bindValue(":ls_id", _id); qry.bindValue(":item_id", _itemid); qry.exec(); if (!qry.first()) VirtualClusterLineEdit::clear(); } } void LotserialLineEdit::clear() { VirtualClusterLineEdit::clear(); } void LotserialLineEdit::setId(const int lsid) { if (_x_metrics) { if (_x_metrics->boolean("LotSerialControl")) { VirtualClusterLineEdit::setId(lsid); XSqlQuery qq; qq.prepare("SELECT ls_item_id" " FROM ls" " WHERE(ls_id=:id);"); qq.bindValue(":id", id()); qq.exec(); if(qq.first()) emit newItemId(qq.value("ls_item_id").toInt()); } } } /* copied from virtualCluster.cpp but with one important difference: if a not-strict flag is set then warn the user but don't clear the lotserial field */ void LotserialLineEdit::sParse() { if (_x_metrics) if (_x_metrics->boolean("LotSerialControl")) { if (! _parsed) { QString stripped = text().trimmed().toUpper(); if (stripped.length() == 0) { _parsed = true; setId(-1); } else { XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() ? "" : " AND " + _extraClause) + QString("ORDER BY %1 LIMIT 1;").arg(_numColName)); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if (numQ.first()) { _valid = true; setId(numQ.value("id").toInt()); _name = (numQ.value("name").toString()); _itemid = (numQ.value("item_id").toInt()); } else if (numQ.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), numQ.lastError().databaseText()); return; } else if (_strict || _itemid == -1) VirtualClusterLineEdit::clear(); else if (isVisible() && QMessageBox::question(this, tr("Lot/Serial # Not Found"), (_itemid > 0 ? tr("This Lot/Serial # was not found for this item.") : tr("This Lot/Serial # was not found.")) + tr(" Are you sure it is correct?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { VirtualClusterLineEdit::clear(); return; } else { int lsid=-1; numQ.exec("SELECT nextval('ls_ls_id_seq') AS ls_id;"); if (numQ.first()) lsid= numQ.value("ls_id").toInt(); else if (numQ.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), numQ.lastError().databaseText()); return; } numQ.prepare("INSERT INTO ls (ls_id,ls_item_id,ls_number) " "VALUES (:ls_id,:item_id,:number)"); numQ.bindValue(":ls_id", lsid); numQ.bindValue(":item_id", _itemid); numQ.bindValue(":number", stripped); numQ.exec(); if (numQ.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), numQ.lastError().databaseText()); return; } setId(lsid); } } } _parsed = TRUE; emit parsed(); } } LotserialList* LotserialLineEdit::listFactory() { return new LotserialList(this); } LotserialSearch* LotserialLineEdit::searchFactory() { return new LotserialSearch(this); } /* LotserialInfo* LotserialLineEdit::infoFactory() { return new LotserialInfo(this, "LotserialInfo", true); } */ qt-client-4.1.0/widgets/lotserialcluster.h000066400000000000000000000044061217451700100206350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _lotserialCluster_h #define _lotserialCluster_h #include "virtualCluster.h" class LotserialCluster; class XTUPLEWIDGETS_EXPORT LotserialList : public VirtualList { Q_OBJECT friend class LotSerialLineEdit; public: LotserialList(QWidget*, Qt::WindowFlags = 0); private: LotserialCluster* _parent; }; class XTUPLEWIDGETS_EXPORT LotserialSearch : public VirtualSearch { Q_OBJECT friend class LotSerialLineEdit; public: LotserialSearch(QWidget*, Qt::WindowFlags = 0); private: LotserialCluster* _parent; }; class XTUPLEWIDGETS_EXPORT LotserialLineEdit : public VirtualClusterLineEdit { Q_OBJECT Q_PROPERTY(bool strict READ strict WRITE setStrict) friend class LotserialCluster; public: LotserialLineEdit(QWidget*, const char* = 0); inline virtual int itemId() const { return _itemid; }; inline virtual bool strict() const { return _strict; }; public slots: virtual void setId(const int); virtual void clear(); virtual void sParse(); virtual void setItemId(const int); inline virtual void setStrict(const bool p) { _strict = p; }; protected slots: virtual LotserialList* listFactory(); virtual LotserialSearch* searchFactory(); // virtual LotserialInfo* infoFactory(); signals: void newItemId(int); private: int _itemid; bool _strict; }; class XTUPLEWIDGETS_EXPORT LotserialCluster : public VirtualCluster { Q_OBJECT Q_PROPERTY(bool strict READ strict WRITE setStrict) friend class LotserialLineEdit; public: LotserialCluster(QWidget*, const char* = 0); virtual bool strict() const; virtual int itemId() const; public slots: virtual void setItemId (const int); virtual void setStrict (const bool); signals: void newItemId(int); }; #endif qt-client-4.1.0/widgets/lotserialseqcluster.cpp000066400000000000000000000020501217451700100216720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "lotserialseqcluster.h" LotserialseqCluster::LotserialseqCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new LotserialseqClusterLineEdit(this, pName)); } LotserialseqClusterLineEdit::LotserialseqClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "lsseq", "lsseq_id", "lsseq_number", 0, "lsseq_descrip", 0, pName) { setTitles(tr("Lot/Serial Sequence"), tr("Lot/Serial Sequences")); setUiName("lotSerialSequence"); setEditPriv("MaintainLotSerialSequences"); setViewPriv("ViewLotSerialSequences"); } qt-client-4.1.0/widgets/lotserialseqcluster.h000066400000000000000000000015631217451700100213470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _lotserialseqCluster_h #define _lotserialseqCluster_h #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT LotserialseqClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: LotserialseqClusterLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT LotserialseqCluster : public VirtualCluster { Q_OBJECT public: LotserialseqCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/menubutton.cpp000077500000000000000000000115111217451700100177660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "menubutton.h" #include #include #include #include #include #include #include #include GuiClientInterface* MenuButton::_guiClientInterface = 0; MenuButton::MenuButton(QWidget *pParent) : QWidget(pParent) { setupUi(this); _action = 0; _shown = false; setEnabled(false); _button->setIconSize(QSize(48,48)); _button->setIcon(QIcon(QPixmap(":/widgets/images/folder_zoom_64.png"))); #ifdef Q_WS_MAC QFont font = _label->font(); font.setPointSize(11); _label->setFont(font); #endif _label->setWordWrap(true); _label->setAlignment(Qt::AlignCenter); } MenuButton::~MenuButton() { } void MenuButton::actionEvent(QActionEvent *event) { QAction *action = event->action(); switch (event->type()) { case QEvent::ActionChanged: if (action == _action) setAction(action); // update button state break; case QEvent::ActionRemoved: if (_action == action) _action = 0; action->disconnect(this); break; default: ; } QWidget::actionEvent(event); } QString MenuButton::actionName() const { if (_action) return _action->objectName(); return QString(); } QString MenuButton::image() const { return _image; } QString MenuButton::label() const { return _label->text(); } void MenuButton::setLabel(const QString & text) { _label->setText(text); } void MenuButton::setAction(QAction *action) { _button->disconnect(); if (!action) return; if (_action) removeAction(_action); _action = action; addAction(_action); connect(_button, SIGNAL(clicked()), _action, SLOT(trigger())); setEnabled(_action->isEnabled()); } void MenuButton::setAction(const QString & name) { if (actionName() == name) return; if (_guiClientInterface) { QAction *action = _guiClientInterface->findAction(name); if (!action) { // Create one so property can be saved. Maybe gui client // action name provided will be valid in another instance. action = new QAction(this); action->setObjectName(name); action->setEnabled(false); } setAction(action); } } void MenuButton::setImage(const QString & image) { _image = image; if (_shown) { XSqlQuery qry; qry.prepare("SELECT image_data " "FROM image " "WHERE (image_name=:image);"); qry.bindValue(":image", _image); qry.exec(); if (qry.first()) { QImage img; img.loadFromData(QUUDecode(qry.value("image_data").toString())); _button->setIcon(QIcon(QPixmap::fromImage(img))); return; } else if (qry.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), qry.lastError().databaseText()); _button->setIcon(QIcon(QPixmap(":/widgets/images/folder_zoom_64.png"))); } } void MenuButton::showEvent(QShowEvent *e) { if (!_shown) { _shown = true; if (!_image.isEmpty()) setImage(_image); } QWidget::showEvent(e); } // scripting exposure ///////////////////////////////////////////////////////// QScriptValue MenuButtontoScriptValue(QScriptEngine *engine, MenuButton* const &item) { return engine->newQObject(item); } void MenuButtonfromScriptValue(const QScriptValue &obj, MenuButton* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructMenuButton(QScriptContext *context, QScriptEngine *engine) { MenuButton *button = 0; if (context->argumentCount() == 0) button = new MenuButton(); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) button = new MenuButton(qscriptvalue_cast(context->argument(0))); else context->throwError(QScriptContext::UnknownError, QString("Could not find an appropriate MenuButton constructor")); return engine->toScriptValue(button); } void setupMenuButton(QScriptEngine *engine) { qScriptRegisterMetaType(engine, MenuButtontoScriptValue, MenuButtonfromScriptValue); QScriptValue widget = engine->newFunction(constructMenuButton); engine->globalObject().setProperty("MenuButton", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/menubutton.h000077500000000000000000000030641217451700100174370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __MENUBUTTON_H__ #define __MENUBUTTON_H__ #include #include #include "widgets.h" #include "guiclientinterface.h" #include "ui_menubutton.h" class QScriptEngine; void setupMenuButton(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT MenuButton : public QWidget, public Ui::MenuButton { Q_OBJECT Q_PROPERTY(QString image READ image WRITE setImage) Q_PROPERTY(QString label READ label WRITE setLabel) Q_PROPERTY(QString actionName READ actionName WRITE setAction) public: MenuButton(QWidget * = 0); ~MenuButton(); static GuiClientInterface *_guiClientInterface; QString image() const; void setImage(const QString & image); QString label() const; void setLabel(const QString & text ); QString actionName() const; void setAction(const QString & name ); public slots: void setAction(QAction *action); protected: void actionEvent(QActionEvent *); void showEvent(QShowEvent *); private: QAction *_action; QString _image; bool _shown; }; Q_DECLARE_METATYPE(MenuButton*) #endif qt-client-4.1.0/widgets/menubutton.ui000066400000000000000000000037511217451700100176250ustar00rootroot00000000000000 MenuButton 0 0 77 79 Form 0 0 Qt::Vertical 20 0 0 0 true MenuButton Qt::AlignCenter Qt::Vertical 20 0 qt-client-4.1.0/widgets/numbergencombobox.cpp000066400000000000000000000141371217451700100213050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "numbergencombobox.h" #include "xt.h" #define DEBUG false // prototype for reimplementing XComboBox using Qt's model/view. NumberGenComboBox::NumberGenComboBox(QWidget *pParent) : QComboBox(pParent), _allowedMethods(Manual | Automatic | Override | Shared) { setAllowedMethods(_allowedMethods); connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleIndexChanged(int))); } void NumberGenComboBox::append(NumberGenComboBox::GenMethod id, QString text, QString code) { int index = count(); insertItem(index, text); setItemData(index, id, Xt::IdRole); setItemData(index, code.isEmpty() ? text : code, Xt::RawRole); } NumberGenComboBox::~NumberGenComboBox() { } NumberGenComboBox::GenMethods NumberGenComboBox::allowedMethods() const { return _allowedMethods; } QString NumberGenComboBox::automaticText() const { int i = indexOfMethod(Automatic); return (i >= 0) ? itemText(i) : QString(); } QString NumberGenComboBox::manualText() const { int i = indexOfMethod(Manual); return (i >= 0) ? itemText(i) : QString(); } // equivalent to XComboBox::id() NumberGenComboBox::GenMethod NumberGenComboBox::method() const { return (GenMethod)itemData(currentIndex(), Xt::IdRole).toInt(); } // equivalent to XComboBox::code() QString NumberGenComboBox::methodCode() const { return itemData(currentIndex(), Xt::RawRole).toString(); } QString NumberGenComboBox::overrideText() const { int i = indexOfMethod(Override); return (i >= 0) ? itemText(i) : QString(); } QString NumberGenComboBox::sharedText() const { int i = indexOfMethod(Shared); return (i >= 0) ? itemText(i) : QString(); } QString NumberGenComboBox::methodToCode(const GenMethod method) { QString result; switch (method) { case Manual: result = "M"; break; case Automatic: result = "A"; break; case Override: result = "O"; break; case Shared: result = "S"; break; } return result; } void NumberGenComboBox::handleIndexChanged(const int /*index*/) { emit newMethod(method()); emit newMethod((int)method()); emit newMethodCode(methodCode()); } void NumberGenComboBox::setAllowedMethods(const GenMethods methods) { if (DEBUG) qDebug("%s::setAllowedMethods(0x%x) entered", qPrintable(objectName()), (int)methods); clear(); if (methods & (int)Manual) append(Manual, tr("Manual"), methodToCode(Manual)); if (methods & (int)Automatic) append(Automatic, tr("Automatic"), methodToCode(Automatic)); if (methods & (int)Override) append(Override, tr("Automatic With Override"), methodToCode(Override)); if (methods & (int)Shared) append(Shared, tr("Shared"), methodToCode(Shared)); _allowedMethods = methods; if (DEBUG) qDebug("%s::setAllowedMethods(%x) returning", qPrintable(objectName()), (int)methods); } void NumberGenComboBox::setAutomaticText(const QString text) { int i = indexOfMethod(Automatic); if (i >= 0) setItemText(i, text); } void NumberGenComboBox::setManualText(const QString text) { int i = indexOfMethod(Manual); if (i >= 0) setItemText(i, text); } // this is equivalent to XComboBox::setId() void NumberGenComboBox::setMethod(const NumberGenComboBox::GenMethod method) { int i = indexOfMethod(method); setCurrentIndex(i); } void NumberGenComboBox::setMethod(const QString method) { int index = -1; for (int i = 0; i < count(); i++) if (itemData(i, Xt::RawRole).toString() == method) { index = i; break; } setCurrentIndex(index); } void NumberGenComboBox::setOverrideText(const QString text) { int i = indexOfMethod(Override); if (i >= 0) setItemText(i, text); } void NumberGenComboBox::setSharedText(const QString text) { int i = indexOfMethod(Shared); if (i >= 0) setItemText(i, text); } int NumberGenComboBox::indexOfMethod(const NumberGenComboBox::GenMethod method) const { for (int i = 0; i < count(); i++) if ((GenMethod)itemData(i, Xt::IdRole).toInt() == method) return i; return -1; } // script exposure //////////////////////////////////////////////////////////// void NumberGenComboBoxFromScriptValue(const QScriptValue &obj, NumberGenComboBox * &item) { item = qobject_cast(obj.toQObject()); } QScriptValue NumberGenComboBoxToScriptValue(QScriptEngine *engine, NumberGenComboBox *const &item) { return engine->newQObject(item); } QScriptValue constructNumberGenComboBox(QScriptContext *context, QScriptEngine *engine) { NumberGenComboBox *obj = 0; if (context->argumentCount() >= 1 && qscriptvalue_cast(context->argument(0))) obj = new NumberGenComboBox(qscriptvalue_cast(context->argument(0))); else obj = new NumberGenComboBox(); return engine->toScriptValue(obj); } #define CONST(a) QScriptValue(engine, a) #define CONSTFLAGS QScriptValue::ReadOnly | QScriptValue::Undeletable void setupNumberGenComboBox(QScriptEngine *engine) { QScriptValue glob = engine->newFunction(constructNumberGenComboBox); qScriptRegisterMetaType(engine, NumberGenComboBoxToScriptValue, NumberGenComboBoxFromScriptValue); glob.setProperty("Manual", CONST(NumberGenComboBox::Manual), CONSTFLAGS); glob.setProperty("Automatic", CONST(NumberGenComboBox::Automatic), CONSTFLAGS); glob.setProperty("Override", CONST(NumberGenComboBox::Override), CONSTFLAGS); glob.setProperty("Shared", CONST(NumberGenComboBox::Shared), CONSTFLAGS); engine->globalObject().setProperty("NumberGenComboBox", glob, CONSTFLAGS); } qt-client-4.1.0/widgets/numbergencombobox.h000066400000000000000000000054461217451700100207550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef numbergencombobox_h #define numbergencombobox_h #include #include "widgets.h" #include class QScriptEngine; class QStandardItemModel; void setupNumberGenComboBox(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT NumberGenComboBox : public QComboBox { Q_OBJECT Q_ENUMS(GenMethod) Q_FLAGS(GenMethods) Q_PROPERTY(GenMethods allowedMethods READ allowedMethods WRITE setAllowedMethods ) Q_PROPERTY(QString automaticText READ automaticText WRITE setAutomaticText ) Q_PROPERTY(QString manualText READ manualText WRITE setManualText ) Q_PROPERTY(QString overrideText READ overrideText WRITE setOverrideText ) Q_PROPERTY(QString sharedText READ sharedText WRITE setSharedText ) public: NumberGenComboBox(QWidget *parent = 0); virtual ~NumberGenComboBox(); enum GenMethod { Manual = 0x01, Automatic = 0x02, Override = 0x04, Shared = 0x08 }; Q_DECLARE_FLAGS(GenMethods, GenMethod) Q_INVOKABLE void append(GenMethod method, QString text, QString code = QString()); Q_INVOKABLE GenMethods allowedMethods() const; Q_INVOKABLE QString automaticText() const; Q_INVOKABLE QString manualText() const; Q_INVOKABLE GenMethod method() const; Q_INVOKABLE QString methodCode() const; Q_INVOKABLE QString overrideText() const; Q_INVOKABLE QString sharedText() const; Q_INVOKABLE static QString methodToCode(const GenMethod method); public slots: void handleIndexChanged(const int index); void setAllowedMethods(const GenMethods methods); void setAutomaticText(const QString text); void setManualText(const QString text); void setMethod(const GenMethod method); void setMethod(const QString methodCode); void setOverrideText(const QString text); void setSharedText(const QString text); signals: void newMethod(GenMethod); void newMethod(int); void newMethodCode(QString); protected: int indexOfMethod(const GenMethod method) const; private: GenMethods _allowedMethods; }; Q_DECLARE_OPERATORS_FOR_FLAGS(NumberGenComboBox::GenMethods); Q_DECLARE_METATYPE(NumberGenComboBox*) // TODO: is this necessary for script exposure? Q_DECLARE_METATYPE(enum NumberGenComboBox::GenMethod) #endif qt-client-4.1.0/widgets/opportunitycluster.cpp000066400000000000000000000023311217451700100216010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "opportunitycluster.h" OpportunityCluster::OpportunityCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new OpportunityClusterLineEdit(this, pName)); } OpportunityClusterLineEdit::OpportunityClusterLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "ophead", "ophead_id", "ophead_name", 0, "ophead_notes", "ophead_owner_username", "ophead_username", 0, pName) { _objtype = "OPP"; setTitles(tr("Opportunity"), tr("Opportunities")); setUiName("opportunity"); setEditPriv("MaintainAllOpportunities"); setNewPriv("MaintainAllOpportunities"); setViewPriv("ViewAllOpportunities"); setEditOwnPriv("MaintainPersonalOpportunities"); setViewOwnPriv("ViewPersonalOpportunities"); } qt-client-4.1.0/widgets/opportunitycluster.h000066400000000000000000000015441217451700100212530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _opportunityCluster_h #define _opportunityCluster_h #include "crmcluster.h" class XTUPLEWIDGETS_EXPORT OpportunityClusterLineEdit : public CrmClusterLineEdit { Q_OBJECT public: OpportunityClusterLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT OpportunityCluster : public VirtualCluster { Q_OBJECT public: OpportunityCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/ordercluster.cpp000066400000000000000000000623301217451700100203050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "ordercluster.h" #include "xsqlquery.h" #define DEBUG false OrderCluster::OrderCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new OrderLineEdit(this, pName)); _name->setVisible(true); _grid->removeWidget(_number); _grid->removeWidget(_description); _grid->removeWidget(_name); _grid->addWidget(_number, 0, 1, 1, 2); _grid->addWidget(_name, 1, 1); _grid->addWidget(_description, 1, 2); _fromLit = new QLabel(this); _fromLit->setObjectName("_fromLit"); _from = new QLabel(this); _from->setObjectName("_from"); _toLit = new QLabel(this); _toLit->setObjectName("_toLit"); _to = new QLabel(this); _to->setObjectName("_to"); _grid->addWidget(_fromLit, 2, 1); _grid->addWidget(_from, 2, 2); _grid->addWidget(_toLit, 2, 3); _grid->addWidget(_to, 2, 4); connect(_number, SIGNAL(newId(const int, const QString &)), this, SIGNAL(newId(const int, const QString &))); connect(_number, SIGNAL(numberChanged(const QString &, const QString &)), this, SIGNAL(numberChanged(const QString &, const QString &))); setAllowedStatuses(OrderLineEdit::AnyStatus); setAllowedTypes(OrderLineEdit::AnyType); setNameVisible(true); setDescriptionVisible(true); setLabel(tr("Order #:")); } OrderLineEdit::OrderStatuses OrderCluster::allowedStatuses() const { return ((OrderLineEdit*)_number)->allowedStatuses(); } OrderLineEdit::OrderTypes OrderCluster::allowedTypes() const { return ((OrderLineEdit*)_number)->allowedTypes(); } QString OrderCluster::from() const { return ((OrderLineEdit*)_number)->from(); } bool OrderCluster::isClosed() const { return ((OrderLineEdit*)_number)->isClosed(); } bool OrderCluster::isOpen() const { return ((OrderLineEdit*)_number)->isOpen(); } bool OrderCluster::isPO() const { return ((OrderLineEdit*)_number)->isPO(); } bool OrderCluster::isRA() const { return ((OrderLineEdit*)_number)->isRA(); } bool OrderCluster::isSO() const { return ((OrderLineEdit*)_number)->isSO(); } bool OrderCluster::isTO() const { return ((OrderLineEdit*)_number)->isTO(); } bool OrderCluster::isUnposted() const { return ((OrderLineEdit*)_number)->isUnposted(); } bool OrderCluster::fromSitePrivsEnforced() const { return ((OrderLineEdit*)_number)->fromSitePrivsEnforced(); } bool OrderCluster::toSitePrivsEnforced() const { return ((OrderLineEdit*)_number)->toSitePrivsEnforced(); } void OrderCluster::setExtraClause(const QString &pType, const QString &pClause) { ((OrderLineEdit*)_number)->setExtraClause(pType, pClause); } void OrderCluster::setExtraClause(const OrderLineEdit::OrderTypes pTypes, const QString &pClause) { ((OrderLineEdit*)_number)->setExtraClause(pTypes, pClause); } void OrderCluster::setAllowedStatuses(const OrderLineEdit::OrderStatuses p) { ((OrderLineEdit*)_number)->setAllowedStatuses(p); } void OrderCluster::setAllowedStatuses(const int p) { ((OrderLineEdit*)_number)->setAllowedStatuses((OrderLineEdit::OrderStatuses)p); } void OrderCluster::setFromSitePrivsEnforced(const bool p) { ((OrderLineEdit*)_number)->setFromSitePrivsEnforced(p); } void OrderCluster::setToSitePrivsEnforced(const bool p) { ((OrderLineEdit*)_number)->setFromSitePrivsEnforced(p); } OrderLineEdit::OrderStatus OrderCluster::status() const { return ((OrderLineEdit*)_number)->status(); } QString OrderCluster::to() const { return ((OrderLineEdit*)_number)->to(); } QString OrderCluster::type() const { return ((OrderLineEdit*)_number)->type(); } void OrderCluster::setAllowedType(const QString &p) { ((OrderLineEdit*)_number)->setAllowedType(p); } void OrderCluster::setAllowedTypes(const OrderLineEdit::OrderTypes p) { ((OrderLineEdit*)_number)->setAllowedTypes(p); } void OrderCluster::setAllowedTypes(const int p) { setAllowedTypes((OrderLineEdit::OrderTypes)p); } void OrderCluster::setCustId(int p) { ((OrderLineEdit*)_number)->setCustId(p); } bool OrderCluster::descriptionVisible() { return _descripVisible; } bool OrderCluster::lockSelected() { return ((OrderLineEdit*)_number)->lockSelected(); } void OrderCluster::setLockSelected(bool lock) { ((OrderLineEdit*)_number)->setLockSelected(lock); } void OrderCluster::setDescriptionVisible(const bool p) { _fromLit->setVisible(p); _from->setVisible(p); _toLit->setVisible(p); _to->setVisible(p); _descripVisible=p; } bool OrderCluster::nameVisible() { return _nameVisible; } void OrderCluster::setNameVisible(const bool p) { _name->setVisible(p); _description->setVisible(p); _nameVisible=p; } void OrderCluster::setId(const int pId, const QString &pType) { ((OrderLineEdit*)_number)->setId(pId, pType); } void OrderCluster::sRefresh() { VirtualCluster::sRefresh(); _grid->removeWidget(_fromLit); _grid->removeWidget(_toLit); _grid->removeWidget(_from); _grid->removeWidget(_to); if (type() == "PO") { _grid->addWidget(_fromLit, 2, 1); _grid->addWidget(_from, 2, 2, 1, -1); _grid->addWidget(_toLit, 2, 0); _grid->addWidget(_to, 2, 0); _fromLit->setText("Vendor:"); _toLit->setText(""); } else if (type() == "RA") { _grid->addWidget(_fromLit, 2, 1); _grid->addWidget(_from, 2, 2, 1, -1); _grid->addWidget(_toLit, 2, 0); _grid->addWidget(_to, 2, 0); _fromLit->setText("Customer:"); _toLit->setText(""); } else if (type() == "SO") { _grid->addWidget(_fromLit, 2, 0); _grid->addWidget(_from, 2, 0); _grid->addWidget(_toLit, 2, 1); _grid->addWidget(_to, 2, 2, 1, -1); _fromLit->setText(""); _toLit->setText("Customer:"); } else if (type() == "TO") { _grid->addWidget(_fromLit, 2, 1); _grid->addWidget(_from, 2, 2); _grid->addWidget(_toLit, 2, 3); _grid->addWidget(_to, 2, 4); _fromLit->setText(tr("From:")); _toLit->setText(tr("To:")); } else { _grid->addWidget(_fromLit, 2, 1); _grid->addWidget(_from, 2, 2); _grid->addWidget(_toLit, 2, 3); _grid->addWidget(_to, 2, 4); _fromLit->setText(""); _toLit->setText(""); } _from->setText(((OrderLineEdit*)_number)->from()); _to->setText(((OrderLineEdit*)_number)->to()); } // LineEdit /////////////////////////////////////////////////////////////////// OrderLineEdit::OrderLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "orderhead", "orderhead_id", "orderhead_number", "orderhead_type", "orderhead_status", pName) { _toPrivs=false; _fromPrivs=false; _custid = -1; _lock = false; setTitles(tr("Order"), tr("Orders")); connect(this, SIGNAL(newId(int)), this, SLOT(sNewId(int))); _query = "SELECT orderhead_id AS id, orderhead_number AS number," " orderhead_type AS name, orderhead_status AS description," " orderhead_from, orderhead_to " "FROM orderhead WHERE (TRUE) "; } OrderLineEdit::~OrderLineEdit() { unlock(); } void OrderLineEdit::sNewId(const int p) { emit newId(p, _name); emit numberChanged(text(), _name); } void OrderLineEdit::sParse() { if (DEBUG) qDebug("VCLE %s::sParse() entered with _parsed %d and text() %s", qPrintable(objectName()), _parsed, qPrintable(text())); if (! _parsed) { _parsed = TRUE; QString stripped = text().trimmed().toUpper(); if (stripped.length() == 0) { setId(-1); } else { XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + (_hasActive ? _activeClause : "" ) + QString("ORDER BY %1 LIMIT 1;").arg(_numColName)); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if(numQ.first()) { // Check for other active orders with the same number XSqlQuery countQ; countQ.prepare("SELECT COUNT(*) AS count FROM orderhead WHERE (TRUE) " + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + (_hasActive ? _activeClause : "" ) + QString(";")); countQ.bindValue(":number", numQ.value("number").toString()); countQ.exec(); countQ.first(); int result = countQ.value("count").toInt(); if (result <= 0) setId(-1); else if (result == 1) { _valid = true; _name = (numQ.value("name").toString()); _description = numQ.value("description").toString(); _from = numQ.value("orderhead_from").toString(); _to = numQ.value("orderhead_to").toString(); setId(numQ.value("id").toInt(), numQ.value("name").toString()); } else { setText(numQ.value("number").toString()); sEllipses(); } } else { setId(-1); if (numQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), numQ.lastError().databaseText()); } } emit valid(_valid); emit parsed(); emit numberChanged(text(), _name); } } void OrderLineEdit::sList() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); OrderList* newdlg = new OrderList(this); if (newdlg) { int id = newdlg->exec(); if(id != -1) setId(id, newdlg->type()); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sList() not yet defined").arg(objectName())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void OrderLineEdit::sSearch() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); OrderSearch* newdlg = new OrderSearch(this); if (newdlg) { QString stripped = text().trimmed(); if(stripped.length()) { XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + ((_hasActive && ! _showInactive) ? _activeClause : "" ) + QString("ORDER BY %1;").arg(_numColName)); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if (numQ.first()) newdlg->setQuery(numQ); } newdlg->setSearchText(text()); int id = newdlg->exec(); if(id != -1) setId(id, newdlg->type()); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sSearch() not yet defined").arg(objectName())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } OrderLineEdit::OrderStatuses OrderLineEdit::allowedStatuses() const { return _allowedStatuses; } OrderLineEdit::OrderTypes OrderLineEdit::allowedTypes() const { return _allowedTypes; } void OrderLineEdit::clear() { _from = ""; _to = ""; VirtualClusterLineEdit::clear(); } QString OrderLineEdit::from() const { return _from; } bool OrderLineEdit::isClosed() const { return _description == "C"; } bool OrderLineEdit::isOpen() const { return _description == "O"; } bool OrderLineEdit::isPO() const { return _name == "PO"; } bool OrderLineEdit::isRA() const { return _name == "RA"; } bool OrderLineEdit::isSO() const { return _name == "SO"; } bool OrderLineEdit::isTO() const { return _name == "TO"; } bool OrderLineEdit::isUnposted() const { return _description == "U"; } void OrderLineEdit::setExtraClause(const QString &pType, const QString &pClause) { if (pType == "" || pType.compare("All", Qt::CaseInsensitive) == 0 || pType.compare("Any", Qt::CaseInsensitive) == 0) { _poClause = _raClause = _soClause = _toClause = ""; _allClause = pClause; } else if (pType == "PO") _poClause = " (((orderhead_type='PO') AND (" + pClause + ")) OR (orderhead_type != 'PO')) "; else if (pType == "RA") _raClause = " (((orderhead_type='RA') AND (" + pClause + ")) OR (orderhead_type != 'RA')) "; else if (pType == "SO") _soClause = " (((orderhead_type='SO') AND (" + pClause + ")) OR (orderhead_type != 'SO')) "; else if (pType == "TO") _toClause = " (((orderhead_type='TO') AND (" + pClause + ")) OR (orderhead_type != 'TO')) "; else { QMessageBox::critical(this, tr("Invalid Order Type"), tr("%1 is not a valid Order Type.").arg(pType)); _allClause = _poClause = _raClause = _soClause = _toClause = ""; } VirtualClusterLineEdit::setExtraClause(buildExtraClause()); } void OrderLineEdit::setExtraClause(const OrderTypes pTypes, const QString &pClause) { if (pTypes == AnyType || ((pTypes & Purchase) && ((pTypes & Return) || ! _x_metrics->boolean("EnableReturnAuth")) && (pTypes & Sales) && ((pTypes & Transfer) || ! _x_metrics->boolean("MultiWhs")))) _allClause = pClause; else { // not else if because multiple flags can be set if (pTypes | Purchase) setExtraClause("PO", pClause); if (pTypes | Return) setExtraClause("RA", pClause); if (pTypes | Sales) setExtraClause("SO", pClause); if (pTypes | Transfer) setExtraClause("TO", pClause); } VirtualClusterLineEdit::setExtraClause(buildExtraClause()); } void OrderLineEdit::setToSitePrivsEnforced(const bool p) { if (_toPrivs == p) return; _toPrivs=p; if (p) _toPrivsClause = " AND ((orderhead_type='TO' " " AND orderhead_to_id IN (SELECT warehous_id FROM site()))" " OR (orderhead_type != 'TO'))"; else _toPrivsClause.clear(); } void OrderLineEdit::setFromSitePrivsEnforced(const bool p) { if (_fromPrivs == p) return; _fromPrivs=p; if (p) _fromPrivsClause = " AND ((orderhead_type='TO' " " AND orderhead_from_id IN (SELECT warehous_id FROM site()))" " OR (orderhead_type != 'TO'))"; else _fromPrivsClause.clear(); } VirtualList * OrderLineEdit::listFactory() { return new OrderList(this); } VirtualSearch * OrderLineEdit::searchFactory() { return new OrderSearch(this); } OrderLineEdit::OrderStatus OrderLineEdit::status() { if (_description.isEmpty()) return OrderLineEdit::AnyStatus; else if (_description == "O") return OrderLineEdit::Open; else if (_description == "C") return OrderLineEdit::Closed; else { QMessageBox::critical(this, tr("Invalid Order Status"), tr("Order %1 has an invalid status %2.") .arg(text()).arg(_description)); return AnyStatus; } } QString OrderLineEdit::to() const { return _to; } QString OrderLineEdit::type() { return _name; } void OrderLineEdit::setAllowedStatuses(const OrderStatuses p) { if (p && (p != Unposted + Open + Closed)) { QStringList statusList; if (p & Unposted) statusList << "'U'"; if (p & Open) statusList << "'O'"; if (p & Closed) statusList << "'C'"; _statusClause = "(orderhead_status IN (" + statusList.join(", ") + "))"; } else _statusClause = ""; VirtualClusterLineEdit::setExtraClause(buildExtraClause()); _allowedStatuses = p; } void OrderLineEdit::setAllowedType(const QString &p) { if (p == "PO") setAllowedTypes(Purchase); else if (p == "RA") setAllowedTypes(Return); else if (p == "SO") setAllowedTypes(Sales); else if (p == "TO") setAllowedTypes(Transfer); else setAllowedTypes(AnyType); } void OrderLineEdit::setAllowedTypes(const OrderTypes p) { if (_x_metrics && (p & Purchase) && ((p & Return) || ! _x_metrics->boolean("EnableReturnAuth")) && (p & Sales) && ((p & Transfer) || ! _x_metrics->boolean("MultiWhs"))) { _typeClause = ""; _allowedTypes = AnyType; } else if (p) { QStringList typeList; if (p & Purchase) typeList << "'PO'"; if (p & Sales) typeList << "'SO'"; if (p & Transfer && _x_metrics->boolean("MultiWhs")) typeList << "'TO'"; if (p & Return) typeList << "'RA'"; if (typeList.count() == 1) { if (p & Purchase) { setUiName("purchaseOrder"); setNewPriv("MaintainPurchaseOrders"); } else if (p & Sales) { setUiName("salesOrder"); setNewPriv("MaintainSalesOrders"); } else if (p & Transfer && _x_metrics->boolean("MultiWhs")) { setUiName("transferOrder"); setNewPriv("MaintainTransferOrders"); } else { setUiName("returnAuthorization"); setNewPriv("MaintainReturns"); } } else setNewPriv(""); _typeClause = "(orderhead_type IN (" + typeList.join(", ") + "))" ; _allowedTypes = p; } else { _typeClause = ""; _allowedTypes = AnyType; } VirtualClusterLineEdit::setExtraClause(buildExtraClause()); } void OrderLineEdit::setCustId(int pId) { if (pId != -1) setAllowedTypes(Sales); _custid = pId; setExtraClause(buildExtraClause()); } void OrderLineEdit::setId(const int pId, const QString &pType) { // Release any previous lock unlock(); if (pId == -1) clear(); else { OrderTypes oldTypes = _allowedTypes; if(!pType.isNull()) setAllowedType(pType); silentSetId(pId); // Attempt to obtain an application lock on the order if (_lock && _id != -1) { XSqlQuery lock; lock.prepare("SELECT trylock(oid::integer, :id) AS locked " "FROM pg_class " "WHERE relname = :table;"); lock.bindValue(":id", _id); if (isPO()) lock.bindValue(":table","pohead"); else if (isSO()) lock.bindValue(":table","cohead"); else if (isRA()) lock.bindValue(":table","rahead"); else if (isTO()) lock.bindValue(":table","tohead"); lock.exec(); lock.first(); if (!lock.value("locked").toBool()) { QMessageBox::critical(this, tr("Order locked"), tr("This order is being edited in another window or by " "another user. Please try again later.")); clear(); if(!pType.isNull()) setAllowedTypes(oldTypes); return; } } if(!pType.isNull()) setAllowedTypes(oldTypes); emit newId(pId, pType); emit valid(_valid); } } QString OrderLineEdit::buildExtraClause() { QStringList clauses; if (! _statusClause.isEmpty()) clauses << _statusClause; if (! _typeClause.isEmpty()) clauses << _typeClause; if (! _allClause.isEmpty()) clauses << _allClause; if (! _poClause.isEmpty()) clauses << _poClause; if (! _raClause.isEmpty()) clauses << _raClause; if (! _soClause.isEmpty()) clauses << _soClause; if (! _toClause.isEmpty()) clauses << _toClause; QString tmpClause = clauses.join(" AND "); if (DEBUG) qDebug("buildExtraClause returning %s", qPrintable(tmpClause)); if (_custid != -1 && !tmpClause.isEmpty()) tmpClause += " AND "; if (_custid != -1) tmpClause += QString(" orderhead_to_id=%1 ").arg(_custid); return tmpClause; } void OrderLineEdit::silentSetId(const int pId) { if (pId == -1) XLineEdit::clear(); else { QString oldExtraClause = _extraClause; XSqlQuery countQ; countQ.prepare("SELECT COUNT(*) AS count FROM orderhead WHERE (TRUE) " + _idClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + QString(";")); countQ.bindValue(":id", pId); countQ.exec(); if (countQ.first()) { int result = countQ.value("count").toInt(); if (result <= 0) { _id = -1; XLineEdit::clear(); } else if (result == 1) _id = pId; else { _extraClause += "AND (orderhead_id=" + QString::number(pId) + ")"; sEllipses(); _extraClause += "AND (orderhead_type='" + type() + "')"; } } else if (countQ.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), countQ.lastError().databaseText()); } if (_id > 0) { XSqlQuery idQ; idQ.prepare(_query + _idClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + QString(";")); idQ.bindValue(":id", pId); idQ.exec(); if (idQ.first()) { _id = pId; _valid = true; setText(idQ.value("number").toString()); _name = idQ.value("name").toString(); _description = idQ.value("description").toString(); _from = idQ.value("orderhead_from").toString(); _to = idQ.value("orderhead_to").toString(); } else if (idQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), idQ.lastError().databaseText()); } } if (isPO()) { setUiName("purchaseOrder"); setEditPriv("MaintainPurchaseOrders"); setViewPriv("ViewPurchaseOrders"); _idColName="pohead_id"; } else if (isRA()) { setUiName("returnAuthorization"); setEditPriv("MaintainReturns"); setViewPriv("ViewReturns"); _idColName="rahead_id"; } else if (isSO()) { setUiName("salesOrder"); setEditPriv("MaintainSalesOrders"); setViewPriv("ViewSalesOrders"); _idColName="sohead_id"; } else if (isTO()) { setUiName("transferOrder"); setEditPriv("MaintainTransferOrders"); setViewPriv("ViewTransferOrders"); _idColName="tohead_id"; } else { setUiName(QString()); setEditPriv(QString()); setViewPriv(QString()); _idColName="orderhead_id"; } _parsed = TRUE; emit parsed(); } void OrderLineEdit::unlock() { if (_lock && _id != -1) { XSqlQuery lock; lock.prepare("SELECT pg_advisory_unlock(oid::integer, :id) " "FROM pg_class " "WHERE relname = :table;"); lock.bindValue(":id", _id); if (isPO()) lock.bindValue(":table","pohead"); else if (isSO()) lock.bindValue(":table","cohead"); else if (isRA()) lock.bindValue(":table","rahead"); else if (isTO()) lock.bindValue(":table","tohead"); lock.exec(); } } // List /////////////////////////////////////////////////////////////////////// OrderList::OrderList(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose, false); resize( QSize(490, 390).expandedTo(minimumSizeHint()) ); QTreeWidgetItem *headerItem = _listTab->headerItem(); headerItem->setText(1, tr("Order Type")); headerItem->setText(2, tr("Status")); _listTab->addColumn(tr("From"), -1, Qt::AlignLeft, true, "orderhead_from"); _listTab->addColumn(tr("To"), -1, Qt::AlignLeft, true, "orderhead_to"); OrderLineEdit *lineedit = qobject_cast(_parent); if (lineedit) { if (! lineedit->fromPrivsClause().isEmpty()) lineedit->setExtraClause(lineedit->extraClause() + lineedit->fromPrivsClause()); if (! lineedit->toPrivsClause().isEmpty()) lineedit->setExtraClause(lineedit->extraClause() + lineedit->toPrivsClause()); } } void OrderList::sClose() { done(-1); } QString OrderList::type() const { if(selectedAtDone.count() > 0) { return selectedAtDone.at(0)->text(1); } return ""; } void OrderList::done(int p) { selectedAtDone = _listTab->selectedItems(); VirtualList::done(p); } // Search ///////////////////////////////////////////////////////////////////// OrderSearch::OrderSearch(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose, false); QTreeWidgetItem *headerItem = _listTab->headerItem(); headerItem->setText(1, tr("Order Type")); headerItem->setText(2, tr("Status")); resize( QSize(490, 390).expandedTo(minimumSizeHint()) ); _searchName->setText(tr("Search through Order Type")); _searchDescrip->setText(tr("Search through Status")); _listTab->addColumn(tr("From"), -1, Qt::AlignLeft, true, "orderhead_from"); _listTab->addColumn(tr("To"), -1, Qt::AlignLeft, true, "orderhead_to"); if (! ((OrderLineEdit*)_parent)->fromPrivsClause().isEmpty()) ((OrderLineEdit*)_parent)->setExtraClause(((OrderLineEdit*)_parent)->extraClause() + ((OrderLineEdit*)_parent)->fromPrivsClause()); if (! ((OrderLineEdit*)_parent)->toPrivsClause().isEmpty()) ((OrderLineEdit*)_parent)->setExtraClause(((OrderLineEdit*)_parent)->extraClause() + ((OrderLineEdit*)_parent)->toPrivsClause()); sFillList(); } void OrderSearch::sClose() { done(-1); } QString OrderSearch::type() const { QList items = (selectedAtDone.size() > 0) ? selectedAtDone : _listTab->selectedItems(); if(items.count() > 0) return items.at(0)->text(1); return ""; } void OrderSearch::done(int p) { selectedAtDone = _listTab->selectedItems(); VirtualSearch::done(p); } qt-client-4.1.0/widgets/ordercluster.h000066400000000000000000000200371217451700100177500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _orderCluster_h #define _orderCluster_h #include "parameter.h" #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT OrderLineEdit : public VirtualClusterLineEdit { Q_OBJECT Q_FLAGS (OrderStatuses) Q_FLAGS (OrderTypes) Q_PROPERTY(OrderStatuses allowedStatuses READ allowedStatuses WRITE setAllowedStatuses) Q_PROPERTY(OrderTypes allowedTypes READ allowedTypes WRITE setAllowedTypes) public: OrderLineEdit(QWidget*, const char* = 0); ~OrderLineEdit(); enum OrderStatus { AnyStatus = 0x00, Unposted = 0x01, Open = 0x02, Closed = 0x04 }; Q_DECLARE_FLAGS(OrderStatuses, OrderStatus) enum OrderType { AnyType = 0x00, Purchase = 0x01, Return = 0x02, Sales = 0x04, Transfer = 0x08 }; Q_DECLARE_FLAGS(OrderTypes, OrderType) Q_INVOKABLE virtual OrderStatuses allowedStatuses() const; Q_INVOKABLE virtual OrderTypes allowedTypes() const; Q_INVOKABLE virtual void clear(); Q_INVOKABLE virtual QString from() const; Q_INVOKABLE virtual bool isClosed() const; Q_INVOKABLE virtual bool isOpen() const; Q_INVOKABLE virtual bool isPO() const; Q_INVOKABLE virtual bool isRA() const; Q_INVOKABLE virtual bool isSO() const; Q_INVOKABLE virtual bool isTO() const; Q_INVOKABLE virtual bool isUnposted() const; Q_INVOKABLE virtual bool fromSitePrivsEnforced() const {return _fromPrivs; } Q_INVOKABLE virtual bool toSitePrivsEnforced() const {return _toPrivs; } Q_INVOKABLE virtual void setExtraClause(const QString & p) {VirtualClusterLineEdit::setExtraClause(p);} Q_INVOKABLE virtual void setExtraClause(const QString &, const QString &); Q_INVOKABLE virtual void setExtraClause(const OrderTypes, const QString &); Q_INVOKABLE virtual void setFromSitePrivsEnforced(const bool p); Q_INVOKABLE virtual void setToSitePrivsEnforced(const bool p); Q_INVOKABLE virtual OrderStatus status(); Q_INVOKABLE virtual QString to() const; Q_INVOKABLE virtual QString type(); Q_INVOKABLE virtual QString fromPrivsClause() {return _fromPrivsClause;} Q_INVOKABLE virtual QString toPrivsClause() {return _toPrivsClause;} Q_INVOKABLE virtual bool lockSelected() {return _lock; } Q_INVOKABLE virtual void setLockSelected(bool lock) { _lock = lock; } public slots: virtual void setAllowedStatuses(const OrderStatuses); virtual void setAllowedType(const QString &); virtual void setAllowedTypes(const OrderTypes); virtual void setCustId(int); virtual void setId(const int, const QString & = QString::null); virtual void sList(); virtual void sSearch(); signals: void newId(const int, const QString &); void numberChanged(const QString &, const QString &); protected: OrderStatuses _allowedStatuses; OrderTypes _allowedTypes; QString _from; QString _to; virtual QString buildExtraClause(); virtual void silentSetId(const int); virtual void unlock(); protected slots: virtual void sNewId(const int); virtual void sParse(); virtual VirtualList* listFactory(); virtual VirtualSearch* searchFactory(); private: bool _fromPrivs; bool _toPrivs; bool _lock; QString _toPrivsClause; QString _fromPrivsClause; QString _allClause; QString _poClause; QString _raClause; QString _soClause; QString _toClause; QString _statusClause; QString _typeClause; int _custid; }; Q_DECLARE_OPERATORS_FOR_FLAGS(OrderLineEdit::OrderStatuses) Q_DECLARE_OPERATORS_FOR_FLAGS(OrderLineEdit::OrderTypes) class XTUPLEWIDGETS_EXPORT OrderCluster : public VirtualCluster { Q_OBJECT Q_PROPERTY(OrderLineEdit::OrderStatuses allowedStatuses READ allowedStatuses WRITE setAllowedStatuses) Q_PROPERTY(OrderLineEdit::OrderTypes allowedTypes READ allowedTypes WRITE setAllowedTypes) Q_PROPERTY(bool nameVisible READ nameVisible WRITE setNameVisible) Q_PROPERTY(bool descriptionVisible READ descriptionVisible WRITE setDescriptionVisible) public: OrderCluster(QWidget*, const char* = 0); Q_INVOKABLE virtual OrderLineEdit::OrderStatuses allowedStatuses() const; Q_INVOKABLE virtual OrderLineEdit::OrderTypes allowedTypes() const; Q_INVOKABLE virtual QString from() const; Q_INVOKABLE virtual bool isClosed() const; Q_INVOKABLE virtual bool isOpen() const; Q_INVOKABLE virtual bool isPO() const; Q_INVOKABLE virtual bool isRA() const; Q_INVOKABLE virtual bool isSO() const; Q_INVOKABLE virtual bool isTO() const; Q_INVOKABLE virtual bool isUnposted() const; Q_INVOKABLE virtual bool fromSitePrivsEnforced() const; Q_INVOKABLE virtual bool toSitePrivsEnforced() const; Q_INVOKABLE virtual void setExtraClause(const QString &, const QString &); Q_INVOKABLE virtual void setExtraClause(const OrderLineEdit::OrderTypes, const QString &); Q_INVOKABLE virtual OrderLineEdit::OrderStatus status() const; Q_INVOKABLE virtual QString to() const; Q_INVOKABLE virtual QString type() const; Q_INVOKABLE virtual bool lockSelected(); Q_INVOKABLE virtual void setLockSelected(bool lock); virtual bool nameVisible(); virtual void setNameVisible(const bool p); virtual bool descriptionVisible(); virtual void setDescriptionVisible(const bool p); public slots: virtual void setAllowedStatuses(const OrderLineEdit::OrderStatuses); virtual void setAllowedStatuses(const int); virtual void setAllowedType(const QString &); virtual void setAllowedTypes(const OrderLineEdit::OrderTypes); virtual void setAllowedTypes(const int); virtual void setCustId(int); virtual void setId(const int, const QString& = QString::null); virtual void setFromSitePrivsEnforced(const bool p); virtual void setToSitePrivsEnforced(const bool p); virtual void sRefresh(); signals: void newId(const int, const QString &); void numberChanged(const QString &, const QString &); protected: QLabel *_fromLit; QLabel *_from; QLabel *_toLit; QLabel *_to; bool _nameVisible; bool _descripVisible; }; class XTUPLEWIDGETS_EXPORT OrderList : public VirtualList { Q_OBJECT public: OrderList(QWidget*, Qt::WindowFlags = 0); QString type() const; public slots: virtual void sClose(); protected: QList selectedAtDone; protected slots: virtual void done(int); }; class XTUPLEWIDGETS_EXPORT OrderSearch : public VirtualSearch { Q_OBJECT public: OrderSearch(QWidget*, Qt::WindowFlags = 0); QString type() const; public slots: virtual void sClose(); protected: QList selectedAtDone; protected slots: virtual void done(int); }; #endif qt-client-4.1.0/widgets/parametergroup.cpp000066400000000000000000000321731217451700100206270ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "xcombobox.h" #include "parametergroup.h" ParameterGroup::ParameterGroup(QWidget *pParent, const char *pName) : QGroupBox(pParent) { _fixed = true; if(pName) setObjectName(pName); _type = AdhocGroup; _selectedGroup = new QWidget(this); _patternGroup = new QWidget(this); _all= new QRadioButton(QObject::tr("All"), this); _all->setObjectName("_all"); _all->setChecked(TRUE); _selected = new QRadioButton(tr("Selected:"), this); _selected->setObjectName("_selected"); _items = new XComboBox(FALSE, _selectedGroup); _items->setObjectName("_items"); _items->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); _items->setEnabled(FALSE); _usePattern = new QRadioButton(tr("Pattern:"), this); _usePattern->setObjectName("_usePattern"); _pattern = new QLineEdit(this); _pattern->setObjectName("_pattern"); _pattern->setEnabled(FALSE); _buttonGroup = new QButtonGroup(this); setFixedSize(false); connect(_selected, SIGNAL(toggled(bool)), _items, SLOT(setEnabled(bool))); connect(_usePattern, SIGNAL(toggled(bool)), _pattern, SLOT(setEnabled(bool))); connect(_buttonGroup, SIGNAL(buttonClicked(int)), this, SIGNAL(updated())); connect(_items, SIGNAL(newID(int)), this, SIGNAL(updated())); connect(_pattern, SIGNAL(editingFinished()), this, SIGNAL(updated())); setFocusProxy(_all); } void ParameterGroup::setFixedSize(bool pFixed) { if (pFixed == _fixed) return; if (layout()) delete layout(); if (_selectedGroup->layout()) delete _selectedGroup->layout(); if (_patternGroup->layout()) delete _patternGroup->layout(); if (pFixed) { setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); QHBoxLayout * hLayout = new QHBoxLayout(_selectedGroup); hLayout->setSpacing(5); hLayout->setMargin(0); hLayout->addWidget(_selected); hLayout->addWidget(_items); _selectedGroup->setLayout(hLayout); hLayout = new QHBoxLayout(_patternGroup); hLayout->setSpacing(5); hLayout->setMargin(0); hLayout->addWidget(_usePattern); hLayout->addWidget(_pattern); _patternGroup->setLayout(hLayout); QVBoxLayout * vLayout = new QVBoxLayout(this); vLayout->setSpacing(0); vLayout->setMargin(5); vLayout->addWidget(_all); vLayout->addWidget(_selectedGroup); vLayout->addWidget(_patternGroup); setLayout(vLayout); } else { setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); QGridLayout * gridLayout = new QGridLayout(this); QGridLayout * gridLayout1 = new QGridLayout(); #if defined Q_OS_MAC gridLayout1->setRowMinimumHeight(0,24); #endif gridLayout1->addWidget(_all, 0, 0, 1, 2); gridLayout1->addWidget(_selected, 1, 0, 1, 1); QHBoxLayout * hboxLayout = new QHBoxLayout(); hboxLayout->setSpacing(5); hboxLayout->addWidget(_items); QSpacerItem * spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout->addItem(spacerItem); gridLayout1->addLayout(hboxLayout, 1, 1, 1, 1); gridLayout1->addWidget(_usePattern, 2, 0, 1, 1); QHBoxLayout * hboxLayout1 = new QHBoxLayout(); hboxLayout1->setSpacing(5); hboxLayout1->addWidget(_pattern); QSpacerItem * spacerItem1 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hboxLayout1->addItem(spacerItem1); gridLayout1->addLayout(hboxLayout1, 2, 1, 1, 1); QVBoxLayout * vboxLayout1 = new QVBoxLayout(); vboxLayout1->setSpacing(5); vboxLayout1->addLayout(gridLayout1); QSpacerItem * spacerItem2 = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); vboxLayout1->addItem(spacerItem2); gridLayout->addLayout(vboxLayout1, 0, 0, 1, 1); } _buttonGroup->addButton(_all); _buttonGroup->addButton(_selected); _buttonGroup->addButton(_usePattern); _fixed = pFixed; } void ParameterGroup::setType(enum ParameterGroupTypes pType) { if (_type == pType) return; _type = pType; switch (_type) { case AdhocGroup: _all->setText(QObject::tr("All")); break; case ClassCode: _all->setText(QObject::tr("All Class Codes")); _items->setType(XComboBox::ClassCodes); break; case PlannerCode: _all->setText(QObject::tr("All Planner Codes")); _items->setType(XComboBox::PlannerCodes); break; case ProductCategory: _all->setText(QObject::tr("All Product Categories")); _items->setType(XComboBox::ProductCategories); break; case ItemGroup: _all->setText(QObject::tr("All Item Groups")); _items->setType(XComboBox::ItemGroups); break; case CostCategory: _all->setText(QObject::tr("All Cost Categories")); _items->setType(XComboBox::CostCategories); break; case CustomerType: _all->setText(QObject::tr("All Customer Types")); _items->setType(XComboBox::CustomerTypes); break; case CustomerGroup: _all->setText(QObject::tr("All Customer Groups")); _items->setType(XComboBox::CustomerGroups); break; case CurrencyNotBase: _all->setText(QObject::tr("All Foreign Currencies")); _items->setType(XComboBox::CurrenciesNotBase); if (_items->isHidden()) // if there's only one currency defined hide(); break; case Currency: _all->setText(QObject::tr("All Currencies")); _items->setType(XComboBox::Currencies); if (_items->isHidden()) // if there's only one currency defined hide(); break; case WorkCenter: _all->setText(QObject::tr("All Work Centers")); _items->setType(XComboBox::WorkCenters); break; case User: _all->setText(QObject::tr("All Users")); _items->setType(XComboBox::Users); break; case ActiveUser: _all->setText(QObject::tr("All Users")); _items->setType(XComboBox::ActiveUsers); break; case OpportunitySource: _all->setText(QObject::tr("All Opportunity Sources")); _items->setType(XComboBox::OpportunitySources); break; case OpportunityStage: _all->setText(QObject::tr("All Opportunity Stages")); _items->setType(XComboBox::OpportunityStages); break; case OpportunityType: _all->setText(QObject::tr("All Opportunity Types")); _items->setType(XComboBox::OpportunityTypes); break; } } void ParameterGroup::setId(int pId) { _selected->setChecked(TRUE); _items->setId(pId); } void ParameterGroup::setPattern(const QString &pPattern) { _usePattern->setChecked(TRUE); _pattern->setText(pPattern); } void ParameterGroup::setState(enum ParameterGroupStates pState) { switch(pState) { case Selected: _selected->setChecked(true); break; case Pattern: _usePattern->setChecked(true); break; case All: default: _all->setChecked(true); } } void ParameterGroup::appendValue(ParameterList &pParams) { if (_selected->isChecked()) { if (_type == ClassCode) pParams.append("classcode_id", _items->id()); else if (_type == PlannerCode) pParams.append("plancode_id", _items->id()); else if (_type == ProductCategory) pParams.append("prodcat_id", _items->id()); else if (_type == ItemGroup) pParams.append("itemgrp_id", _items->id()); else if (_type == CostCategory) pParams.append("costcat_id", _items->id()); else if (_type == CustomerType) pParams.append("custtype_id", _items->id()); else if (_type == CustomerGroup) pParams.append("custgrp_id", _items->id()); else if (_type == CurrencyNotBase || _type == Currency) pParams.append("curr_id", _items->id()); else if (_type == WorkCenter) pParams.append("wrkcnt_id", _items->id()); else if (_type == OpportunitySource) pParams.append("opsource_id", _items->id()); else if (_type == OpportunityStage) pParams.append("opstage_id", _items->id()); else if (_type == OpportunityType) pParams.append("optype_id", _items->id()); else if (_type == User || _type == ActiveUser ) { pParams.append("usr_id", _items->id()); pParams.append("username", _items->itemText(_items->currentIndex())); } } else if (_usePattern->isChecked() && !_pattern->text().isEmpty()) { if (_type == ClassCode) pParams.append("classcode_pattern", _pattern->text()); else if (_type == PlannerCode) pParams.append("plancode_pattern", _pattern->text()); else if (_type == ProductCategory) pParams.append("prodcat_pattern", _pattern->text()); else if (_type == ItemGroup) pParams.append("itemgrp_pattern", _pattern->text()); else if (_type == CostCategory) pParams.append("costcat_pattern", _pattern->text()); else if (_type == CustomerType) pParams.append("custtype_pattern", _pattern->text()); else if (_type == CustomerGroup) pParams.append("custgrp_pattern", _pattern->text()); else if (_type == CurrencyNotBase || _type == Currency) pParams.append("currConcat_pattern", _pattern->text()); else if (_type == WorkCenter) pParams.append("wrkcnt_pattern", _pattern->text()); else if (_type == OpportunitySource) pParams.append("opsource_pattern", _pattern->text()); else if (_type == OpportunityStage) pParams.append("opstage_pattern", _pattern->text()); else if (_type == OpportunityType) pParams.append("optype_pattern", _pattern->text()); else if (_type == User || _type == ActiveUser) pParams.append("usr_pattern", _pattern->text()); } } void ParameterGroup::repopulateSelected() { _items->populate(); } void ParameterGroup::bindValue(XSqlQuery &pQuery) { if (_selected->isChecked()) { QString name; switch (_type) { case ClassCode: name = ":classcode_id"; break; case PlannerCode: name = ":plancode_id"; break; case ProductCategory: name = ":prodcat_id"; break; case ItemGroup: name = ":itemgrp_id"; break; case CostCategory: name = ":costcat_id"; break; case CustomerType: name = ":custtype_id"; break; case CustomerGroup: name = ":custgrp_id"; break; case CurrencyNotBase: case Currency: name = ":curr_id"; break; case WorkCenter: name = ":wrkcnt_id"; break; case OpportunitySource: name = ":opsource_id"; break; case OpportunityStage: name = ":opstage_id"; break; case OpportunityType: name = ":optype_id"; break; case User: name = ":usr_id"; break; case AdhocGroup: name = ":id"; break; default: break; } pQuery.bindValue(name, _items->id()); } else if (_usePattern->isChecked() && !_pattern->text().isEmpty()) { QString name; switch (_type) { case ClassCode: name = ":classcode_pattern"; break; case PlannerCode: name = ":plancode_pattern"; break; case ProductCategory: name = ":prodcat_pattern"; break; case ItemGroup: name = ":itemgrp_pattern"; break; case CostCategory: name = ":costcat_pattern"; break; case CustomerType: name = ":custtype_pattern"; break; case CustomerGroup: name = ":custgrp_pattern"; break; case CurrencyNotBase: case Currency: name = ":currConcat_pattern"; break; case WorkCenter: name = ":wrkcnt_pattern"; break; case OpportunitySource: name = ":opsource_pattern"; break; case OpportunityStage: name = ":opstage_pattern"; break; case OpportunityType: name = ":optype_pattern"; break; case User: name = ":usr_pattern"; break; case AdhocGroup: name = ":pattern"; break; default: break; } pQuery.bindValue(name, _pattern->text()); } } enum ParameterGroup::ParameterGroupStates ParameterGroup::state() { if (_all->isChecked()) return All; else if (_selected->isChecked()) return Selected; else return Pattern; } int ParameterGroup::id() { if (_selected->isChecked()) return _items->id(); else return -1; } QString ParameterGroup::pattern() { if (_usePattern->isChecked()) return _pattern->text(); else return QString::null; } QString ParameterGroup::selected() { if (_selected->isChecked()) return _items->code(); else return QString::null; } void ParameterGroup::setSelected(const QString &p) { _selected->setChecked(TRUE); _items->setCode(p); } qt-client-4.1.0/widgets/parametergroup.h000066400000000000000000000053021217451700100202660ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef patterngroup_h #define patterngroup_h #include #include #include "widgets.h" class XComboBox; class QLineEdit; class ParameterList; class XSqlQuery; class XTUPLEWIDGETS_EXPORT ParameterGroup : public QGroupBox { Q_OBJECT Q_ENUMS(ParameterGroupTypes) Q_ENUMS(ParameterGroupStates) Q_PROPERTY(bool fixedSize READ fixedSize WRITE setFixedSize) Q_PROPERTY(QString selected READ selected WRITE setSelected) Q_PROPERTY(QString pattern READ pattern WRITE setPattern) Q_PROPERTY(enum ParameterGroupTypes type READ type WRITE setType) Q_PROPERTY(enum ParameterGroupStates state READ state WRITE setState) public: ParameterGroup(QWidget * = 0, const char * = 0); enum ParameterGroupTypes { AdhocGroup, PlannerCode, ProductCategory, ClassCode, ItemGroup, CostCategory, CustomerType, CustomerGroup, CurrencyNotBase, Currency, WorkCenter, User, ActiveUser, OpportunitySource, OpportunityStage, OpportunityType }; enum ParameterGroupStates { All, Selected, Pattern }; bool fixedSize() {return _fixed;}; enum ParameterGroupStates state(); Q_INVOKABLE int id(); Q_INVOKABLE QString selected(); Q_INVOKABLE QString pattern(); void appendValue(ParameterList &); void bindValue(XSqlQuery &); enum ParameterGroupTypes type() { return _type; } Q_INVOKABLE inline bool isAll() { return _all->isChecked(); } Q_INVOKABLE inline bool isSelected() { return _selected->isChecked(); } Q_INVOKABLE inline bool isPattern() { return _usePattern->isChecked(); } public slots: void setFixedSize(bool); void setId(int); void setPattern(const QString &); void setSelected(const QString &); void setType(enum ParameterGroupTypes); void setState(enum ParameterGroupStates); void repopulateSelected(); signals: void updated(); private: bool _fixed; enum ParameterGroupTypes _type; QButtonGroup *_buttonGroup; QRadioButton *_all; QRadioButton *_selected; QRadioButton *_usePattern; QWidget *_selectedGroup; QWidget *_patternGroup; XComboBox *_items; QLineEdit *_pattern; }; #endif qt-client-4.1.0/widgets/parameterwidget.cpp000066400000000000000000001756431217451700100207700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #ifdef Q_WS_MAC #include #endif #include "parameterwidget.h" #include "widgets.h" #include "xcombobox.h" #include "usernamecluster.h" #include "datecluster.h" #include "crmacctcluster.h" #include "filterManager.h" #include "contactcluster.h" #include "filtersave.h" #include "glcluster.h" #include "projectcluster.h" #include "custcluster.h" #include "warehouseCluster.h" #include "vendorcluster.h" #include "itemcluster.h" #include "empcluster.h" #include "shiptocluster.h" #include "ordercluster.h" #include "wocluster.h" #define DEBUG false /* TODO: - add Flag to the set of types to handle parameters that are either passed or not (this is different from boolean parameters, that can be either true or false). - add XComboBoxCode to the set of types to handle parameters that require the code value from an xcombobox instead of the id. - store the text value of the enum in the filter definition, not the integer. otherwise the db contents will prevent reorganizing the order of the symbolic values of the type enumeration. - rename methods to align better with qt naming conventions - find a solution to the problem that multiselect's use of qtablewidget violates the one-unit-high rule */ /** @ingroup widgets @class ParameterWidget @brief The ParameterWidget provides a consistent user and programming interface for managing query criteria. The ParameterWidget can be used to set filtering criteria to apply to MetaSQL queries. The application developer defines what criteria can be used (e.g. filter by a date range), what the default values should be, if any, and which criteria are mandatory. The user then chooses which criteria to actually use at runtime and supplies values (e.g. 'January 1, 2010' through 'December 31, 2010'). It is the application developer's responsibility to ensure that the user's selections are honored by the query. Specific sets of filtering criteria can be saved, reused, and shared between users. The details of the filter can be hidden from view or made visible, allowing for efficient use of screen real estate. If application preferences are available, the most recently selected filter will saved when the parent window closes and will be reselected when the window is next opened. */ /** @brief Create a new Parameter Widget. @param pParent The parent of this widget @param pName The object name to assign to this widget */ ParameterWidget::ParameterWidget(QWidget *pParent, const char *pName) : QWidget(pParent) { setupUi(this); if(pName) setObjectName(pName); _initialized = false; _shared = false; setSavedFilters(-1); _filterSignalMapper = new QSignalMapper(this); _saveButton->setDisabled(true); _filterGroup->setVisible(false); _filterButton->setChecked(false); connect(_addFilterRow, SIGNAL(clicked()), this, SLOT(addParam())); connect(_filterButton, SIGNAL(toggled(bool)), this, SLOT(setFiltersVisible(bool))); connect(_filterList, SIGNAL(currentIndexChanged(int)), this, SLOT(applySaved(int))); connect(_filterList, SIGNAL(currentIndexChanged(int)), this, SLOT(setFiltersDefault())); connect(_filterSignalMapper, SIGNAL(mapped(int)), this, SLOT(removeParam(int))); connect(_manageButton, SIGNAL(clicked()), this, SLOT(sManageFilters())); connect(_saveButton, SIGNAL(clicked()), this, SLOT(save())); connect(this, SIGNAL(updated()), this, SLOT(toggleSave())); _saveButton->setShortcut(QKeySequence::Save); _saveButton->setToolTip(_saveButton->text() .remove("&") .append(" ") .append(_saveButton->shortcut().toString(QKeySequence::NativeText))); } ParameterWidget::~ParameterWidget() { foreach (ParamProps *pp, _params) if (pp) delete pp; } void ParameterWidget::showEvent(QShowEvent * event) { if(!_initialized) { if(window()) _name = window()->objectName() + "/"; _settingsName = _name + objectName(); if(_x_preferences) setFiltersVisible(_x_preferences->boolean(_settingsName + "/checked")); _initialized = true; } QWidget::showEvent(event); } /** @brief Add name/value pairs to the input ParameterList to reflect the current user selections. The ParameterList passed in to this method is modified to reflect the current selections. Parameters already in the list have their associated values changed and parameters not in the list are added. No name/value pairs are removed from the list. This should be used carefully, as cached ParameterLists may have name/value pairs that the caller does not expect. @param[in,out] pParams The ParameterList to modify */ void ParameterWidget::appendValue(ParameterList &pParams) { QMapIterator > i(_filterValues); while (i.hasNext()) { i.next(); QPair tempPair = i.value(); if (pParams.inList(tempPair.first)) pParams.remove(tempPair.first); pParams.append(tempPair.first, tempPair.second); } } /** @brief Find the default filter set for the ParameterWidget with the current parent and apply it. This method searches for the default filter set based on the QObject::objectName of the parent and the QObject::objectName of this ParameterWidget instance. If it is found, then this filter set is applied. */ void ParameterWidget::applyDefaultFilterSet() { XSqlQuery qry; QString filter_name; int filter_id = -1; QString pname; if(window()) pname = window()->objectName() + "/"; _settingsName2 = pname + this->objectName(); if(_x_preferences) { _settingsName2 += "/filter_default"; filter_id = _x_preferences->value(_settingsName2).toInt(); } QString query = "SELECT filter_name " "FROM filter " "WHERE filter_id=:id "; if (parent()) { QString classname(parent()->objectName()); if (classname.isEmpty()) classname = parent()->metaObject()->className(); qry.prepare(query); qry.bindValue(":id", filter_id); qry.exec(); if (qry.first()) { filter_name = qry.value("filter_name").toString(); setSavedFiltersIndex(filter_name); applySaved(0, filter_id); } else { addParam(); applySaved(0, 0); } } } void ParameterWidget::addParam() { XComboBox *xcomboBox = new XComboBox(_filterGroup); QToolButton *toolButton = new QToolButton(_filterGroup); QLineEdit *lineEdit = new QLineEdit(_filterGroup); QGridLayout *gridLayout = new QGridLayout(); QVBoxLayout *xcomboLayout = new QVBoxLayout(); QHBoxLayout *widgetLayout1 = new QHBoxLayout(); QVBoxLayout *widgetLayout2 = new QVBoxLayout(); QVBoxLayout *buttonLayout = new QVBoxLayout(); int nextRow = _filtersLayout->rowCount(); QString currRow = QString().setNum(nextRow); // Set up objects gridLayout->setObjectName("topLayout" + currRow); xcomboLayout->setObjectName("xcomboLayout" + currRow); xcomboLayout->setContentsMargins(0, 0, 0, 0); xcomboBox->setObjectName("xcomboBox" + currRow); xcomboBox->addItem("", currRow + ":" + "2"); widgetLayout1->setObjectName("widgetLayout1" + currRow); widgetLayout2->setObjectName("widgetLayout2" + currRow); widgetLayout2->setContentsMargins(0, 0, 0, 0); lineEdit->setObjectName("widget" + currRow); lineEdit->setDisabled(true); buttonLayout->setObjectName("buttonLayout" + currRow); buttonLayout->setContentsMargins(0, 0, 0, 0); toolButton->setObjectName("button" + currRow); toolButton->setText(tr("-")); #ifdef Q_WS_MAC toolButton->setMinimumWidth(25); #else toolButton->setMinimumWidth(21); #endif //grab the items provided by other widgets to populate xcombobox with QMapIterator i(_params); while (i.hasNext()) { i.next(); ParamProps* pp = i.value(); QString value = QString().setNum(nextRow) + ":" + QString().setNum(pp->paramType); if ( _usedTypes.isEmpty() || !containsUsedType(pp->name) ) xcomboBox->addItem(pp->name, value ); } xcomboLayout->addWidget(xcomboBox); xcomboLayout->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Expanding)); // Place the default line edit/button combo widgetLayout1->addWidget(lineEdit); widgetLayout1->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Fixed)); widgetLayout2->addLayout(widgetLayout1); widgetLayout2->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Expanding)); gridLayout->addLayout(widgetLayout2, 0, 0, 1, 1); // Place Button buttonLayout->addWidget(toolButton); buttonLayout->addItem(new QSpacerItem(10, 0, QSizePolicy::Fixed, QSizePolicy::Expanding)); gridLayout->addLayout(buttonLayout, 0, 1, 1, 1); _filtersLayout->addLayout(gridLayout, nextRow, 1, 1, 1); _filtersLayout->addLayout(xcomboLayout, nextRow, 0, 1, 1); // Hook up connections connect(toolButton, SIGNAL(clicked()), _filterSignalMapper, SLOT(map())); connect(toolButton, SIGNAL(clicked()), gridLayout, SLOT( deleteLater() ) ); connect(toolButton, SIGNAL(clicked()), xcomboBox, SLOT( deleteLater() ) ); connect(toolButton, SIGNAL(clicked()), lineEdit, SLOT( deleteLater() ) ); connect(toolButton, SIGNAL(clicked()), toolButton, SLOT( deleteLater() ) ); connect(xcomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT( addUsedType() ) ); connect(xcomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT( changeFilterObject(int)) ); connect(xcomboBox, SIGNAL(currentIndexChanged(int)), this, SLOT( repopulateComboboxes() ) ); connect(lineEdit, SIGNAL(editingFinished()), this, SLOT( storeFilterValue() ) ); _filterSignalMapper->setMapping(toolButton, nextRow); _addFilterRow->setDisabled(true); } /** @brief Add a new filter to the set of available filters. @param pName The user-visible name for this filter to distinguish it from other filters in the same set @param pParam The name to use for the parameter in the ParameterList @param pType The type of widget for the user to enter a criterion in @param pDefault The default value to use for this parameter @param pRequired Required parameters cannot be removed from the filter set @param pExtraInfo A query string to use if pType indicates a combo box or multiselect */ void ParameterWidget::append(QString pName, QString pParam, ParameterWidgetTypes pType, QVariant pDefault, bool pRequired, QString pExtraInfo) { if (DEBUG) qDebug("%s::append(%s, %s, %d, %s, %d, %s) entered", qPrintable(objectName()), qPrintable(pName), qPrintable(pParam), pType, qPrintable(pDefault.toString()), pRequired, qPrintable(pExtraInfo.left(50))); ParamProps *pp = _params.value(_params.count(), 0); if (! pp) { if (DEBUG) qDebug("%s::append() instantiating a new ParamProps", qPrintable(objectName())); pp = new ParamProps(); pp->name = pName; pp->param = pParam; pp->paramType = pType; pp->defaultValue = pDefault; pp->required = pRequired; pp->comboType = XComboBox::Adhoc; pp->query = pExtraInfo; pp->enabled = true; _params.insert(_params.count(), pp); } if (pType == Multiselect && !pExtraInfo.length()) { qWarning("%s::setType(%s, %s, %d, %s, %s) called for Multiselect but " "was not given a query to use", qPrintable(objectName()), qPrintable(pName), qPrintable(pParam), pType, qPrintable(pDefault.toString()), qPrintable(pExtraInfo)); } resetEmptyParameter(); } /** @brief Add a new XComboBox-based filter to the set of available filters. @param pName The user-visible name for this filter to distinguish it from other filters in the same set @param pParam The name to use for the parameter in the ParameterList @param pType Set the XComboBox to use the corresponding XComboBox::XComboBoxTypes value @param pDefault The default internal id to select for this XComboBox @param pRequired Required parameters cannot be removed from the filter set */ void ParameterWidget::appendComboBox(QString pName, QString pParam, int pType, QVariant pDefault, bool pRequired) { ParamProps *pp = _params.value(_params.count(), 0); if (! pp) { pp = new ParamProps(); pp->name = pName; pp->param = pParam; pp->paramType = XComBox; pp->defaultValue = pDefault; pp->required = pRequired; pp->comboType = (XComboBox::XComboBoxTypes)pType; pp->enabled = true; _params.insert(_params.count(), pp); } resetEmptyParameter(); } /** @brief Add a new XComboBox-based filter to the set of available filters. @param pName The user-visible name for this filter to distinguish it from other filters in the same set @param pParam The name to use for the parameter in the ParameterList @param pQuery Set the XComboBox to populate itself with this query @param pDefault The default internal id to select for this XComboBox @param pRequired Required parameters cannot be removed from the filter set */ void ParameterWidget::appendComboBox(QString pName, QString pParam, QString pQuery, QVariant pDefault, bool pRequired) { ParamProps *pp = _params.value(_params.count(), 0); if (! pp) { pp = new ParamProps(); pp->name = pName; pp->param = pParam; pp->paramType = XComBox; pp->defaultValue = pDefault; pp->required = pRequired; pp->comboType = XComboBox::Adhoc; pp->query = pQuery; pp->enabled = true; _params.insert(_params.count(), pp); } resetEmptyParameter(); } /** If the last parameter that has been added has not been selected, then reset it. */ void ParameterWidget::resetEmptyParameter() { if (_filtersLayout->rowCount() > 1) { int id; int row; QLayoutItem *item; XComboBox *box; QToolButton *btn; row = _filtersLayout->rowCount() - 1; item = _filtersLayout->itemAtPosition(row, 0)->layout()->itemAt(0); box = (XComboBox*)item->widget(); id = box->id(); if (id < 0) { QString btnName = "button" + QString().setNum(row); btn = _filterGroup->findChild(btnName); btn->click(); addParam(); } } } void ParameterWidget::applySaved(int pId, int filter_id) { QWidget *found = 0; XSqlQuery qry; QString query; QString filterValue; QDate today = QDate::currentDate(); int xid, init_filter_id; init_filter_id = filter_id; clearFilters(); if (!parent()) return; if (_filterList->id() == -1) { emit updated(); return; } if (filter_id == 0 && _filterList->id() != -1) filter_id = _filterList->id(_filterList->currentIndex()); QString classname(parent()->objectName()); if (classname.isEmpty()) classname = parent()->metaObject()->className(); query = " SELECT filter_value, " " CASE WHEN (filter_username IS NULL) THEN true " " ELSE false END AS shared " " FROM filter " " WHERE filter_id=:id "; qry.prepare(query); qry.bindValue(":id", filter_id ); qry.exec(); if (qry.first()) { filterValue = qry.value("filter_value").toString(); _shared = qry.value("shared").toBool(); } QStringList filterRows = filterValue.split("`"); QString tempFilter = QString(); int windowIdx = _filtersLayout->rowCount(); if (filterRows.size() == 1 && pId == 0 && filter_id != 0) { emit updated(); return; } for (int i = 0; i < filterRows.size(); ++i) { tempFilter = filterRows[i]; if ( !(tempFilter.isEmpty()) ) { //0 is filterType, 1 is filterValue, 2 is parameterwidgettype QStringList tempFilterList = tempFilter.split(":"); QString key = this->getParameterTypeKey(tempFilterList[0]); if (key.isEmpty()) { //parametertype is no longer found, prompt user to delete filter if (!isVisible() || QMessageBox::question(this, tr("Invalid Filter Set"), tr("This filter set contains an obsolete filter and will be deleted. Do you want to do this?"), QMessageBox::No | QMessageBox::Default, QMessageBox::Yes) == QMessageBox::No) return; else { QString query = "delete from filter where filter_id=:filter_id"; XSqlQuery qry; qry.prepare(query); qry.bindValue(":filter_id", filter_id); qry.exec(); setSavedFilters(); return; } } else { addParam(); QLayoutItem *test = _filtersLayout->itemAtPosition(windowIdx, 0)->layout()->itemAt(0); XComboBox *mybox = qobject_cast(test->widget()); if (mybox) mybox->setCurrentIndex(mybox->findText(key)); found = getFilterWidget(windowIdx); int widgetType = tempFilterList[2].toInt(); switch (widgetType) { case Date: { DLineEdit *dLineEdit = qobject_cast(found); if (dLineEdit != 0) dLineEdit->setDate(today.addDays(tempFilterList[1].toInt()), true); } break; case User: { UsernameCluster *usernameCluster = qobject_cast(found); if (usernameCluster != 0) usernameCluster->setUsername(tempFilterList[1]); } break; case Crmacct: { CRMAcctCluster *crmacctCluster = qobject_cast(found); if (crmacctCluster != 0) crmacctCluster->setId(tempFilterList[1].toInt()); } break; case Customer: { CustCluster *custCluster = qobject_cast(found); if (custCluster != 0) custCluster->setId(tempFilterList[1].toInt()); } break; case Shipto: { ShiptoCluster *shiptoCluster = qobject_cast(found); if (shiptoCluster != 0) shiptoCluster->setId(tempFilterList[1].toInt()); } break; case Vendor: { VendorCluster *vendCluster = qobject_cast(found); if (vendCluster != 0) vendCluster->setId(tempFilterList[1].toInt()); } break; case Contact: { ContactCluster *contactCluster = qobject_cast(found); if (contactCluster != 0) contactCluster->setId(tempFilterList[1].toInt()); } break; case GLAccount: { GLCluster *glCluster = qobject_cast(found); if (glCluster != 0) glCluster->setId(tempFilterList[1].toInt()); } break; case Project: { ProjectCluster *projectCluster = qobject_cast(found); if (projectCluster != 0) projectCluster->setId(tempFilterList[1].toInt()); } break; case Item: { ItemCluster *itemCluster = qobject_cast(found); if (itemCluster != 0) itemCluster->setId(tempFilterList[1].toInt()); } break; case Employee: { EmpCluster *employeeCluster = qobject_cast(found); if (employeeCluster != 0) employeeCluster->setId(tempFilterList[1].toInt()); } break; case SalesOrder: { OrderCluster *soCluster = qobject_cast(found); if (soCluster != 0) soCluster->setId(tempFilterList[1].toInt()); } break; case PurchaseOrder: { OrderCluster *poCluster = qobject_cast(found); if (poCluster != 0) poCluster->setId(tempFilterList[1].toInt()); } break; case TransferOrder: { OrderCluster *toCluster = qobject_cast(found); if (toCluster != 0) toCluster->setId(tempFilterList[1].toInt()); } break; case WorkOrder: { WoCluster *woCluster = qobject_cast(found); if (woCluster != 0) woCluster->setId(tempFilterList[1].toInt()); } break; case Site: { WComboBox *wBox = qobject_cast(found); if (wBox != 0) wBox->setId(tempFilterList[1].toInt()); } break; case XComBox: { XComboBox *xBox = qobject_cast(found); if (xBox != 0) { //fix for setid not emitting id signal if id found for filter is first in list //set to any other valid id first to fix it xBox->setId(2); xid = tempFilterList[1].toInt(); xBox->setId(xid); } } break; case Multiselect: { QTableWidget *tab = qobject_cast(found); if (tab != 0) { QStringList savedval = tempFilterList[1].split(","); bool oldblk = tab->blockSignals(true); /* the obvious, loop calling tab->selectRow(), gives one selected row, so try this to get multiple selections: make only the desired values selectable, select everything, and connect to a slot that can clean up after us. yuck. */ for (int j = 0; j < tab->rowCount(); j++) { if (! savedval.contains(tab->item(j, 0)->data(Qt::UserRole).toString())) tab->item(j, 0)->setFlags(tab->item(j, 0)->flags() & (~ Qt::ItemIsSelectable)); } QTableWidgetSelectionRange range(0, 0, tab->rowCount() - 1, tab->columnCount() - 1); tab->setRangeSelected(range, true); connect(tab, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(resetMultiselect(QTableWidgetItem*))); tab->blockSignals(oldblk); storeFilterValue(-1, tab); } } break; case CheckBox: { QCheckBox *checkBox = qobject_cast(found); if (checkBox != 0) checkBox->setChecked(QVariant(tempFilterList[1]).toBool()); } break; default: { QLineEdit *lineEdit = qobject_cast(found); if (lineEdit != 0) { lineEdit->setText(tempFilterList[1]); storeFilterValue(-1, lineEdit); } } break; }//end of switch }//end of not empty key else windowIdx++; }//end of if tempfilter not empty }//end of for // TODO: the switch below is like the switch above. can we remove duplication? //This code is similar in concept, but the implementation is different. if (filterRows.size() == 1 && pId == 0) { //apply filter defaults QMapIterator k(_params); while(k.hasNext()) { k.next(); ParamProps* pp = k.value(); if (!pp->defaultValue.isValid()) continue; int windowIdx = _filtersLayout->rowCount(); addParam(); QLayoutItem *test = _filtersLayout->itemAtPosition(windowIdx, 0)->layout()->itemAt(0); XComboBox *mybox = qobject_cast(test->widget()); if (mybox) mybox->setCurrentIndex(mybox->findText(pp->name)); found = getFilterWidget(windowIdx); switch (pp->paramType) { case Date: { DLineEdit *dLineEdit = qobject_cast(found); if (dLineEdit != 0) dLineEdit->setDate(pp->defaultValue.toDate(), true); } break; case User: { UsernameCluster *usernameCluster = qobject_cast(found); if (usernameCluster != 0) usernameCluster->setUsername(pp->defaultValue.toString()); } break; case Crmacct: { CRMAcctCluster *crmacctCluster = qobject_cast(found); if (crmacctCluster != 0) crmacctCluster->setId(pp->defaultValue.toInt()); } break; case Customer: { CustCluster *custCluster = qobject_cast(found); if (custCluster != 0) custCluster->setId(pp->defaultValue.toInt()); } break; case Shipto: { ShiptoCluster *shiptoCluster = qobject_cast(found); if (shiptoCluster != 0) shiptoCluster->setId(pp->defaultValue.toInt()); } break; case Vendor: { VendorCluster *vendCluster = qobject_cast(found); if (vendCluster != 0) vendCluster->setId(pp->defaultValue.toInt()); } break; case Contact: { ContactCluster *contactCluster = qobject_cast(found); if (contactCluster != 0) contactCluster->setId(pp->defaultValue.toInt()); } break; case GLAccount: { GLCluster *glCluster = qobject_cast(found); if (glCluster != 0) glCluster->setId(pp->defaultValue.toInt()); } break; case Project: { ProjectCluster *projectCluster = qobject_cast(found); if (projectCluster != 0) projectCluster->setId(pp->defaultValue.toInt()); } break; case Item: { ItemCluster *itemCluster = qobject_cast(found); if (itemCluster != 0) itemCluster->setId(pp->defaultValue.toInt()); } break; case Employee: { EmpCluster *employeeCluster = qobject_cast(found); if (employeeCluster != 0) employeeCluster->setId(pp->defaultValue.toInt()); } break; case SalesOrder: { OrderCluster *soCluster = qobject_cast(found); if (soCluster != 0) soCluster->setId(pp->defaultValue.toInt()); } break; case TransferOrder: { OrderCluster *toCluster = qobject_cast(found); if (toCluster != 0) toCluster->setId(pp->defaultValue.toInt()); } break; case PurchaseOrder: { OrderCluster *poCluster = qobject_cast(found); if (poCluster != 0) poCluster->setId(pp->defaultValue.toInt()); } break; case WorkOrder: { WoCluster *woCluster = qobject_cast(found); if (woCluster != 0) woCluster->setId(pp->defaultValue.toInt()); } break; case Site: { WComboBox *wBox = qobject_cast(found); if (wBox != 0) wBox->setId(pp->defaultValue.toInt()); } break; case XComBox: { XComboBox *xBox = qobject_cast(found); if (xBox != 0) { //fix for setid not emitting id signal if id found for filter is first in list //set to any other valid id first to fix it xBox->setId(2); xid = pp->defaultValue.toInt(); xBox->setId(xid); } } break; case Multiselect: { QTableWidget *tab = qobject_cast(found); if (tab != 0) { QVariantList vlist = pp->defaultValue.toList(); bool oldblk = tab->blockSignals(true); /* see the comment in the 'case Multiselect:' above */ for (int j = 0; j < tab->rowCount(); j++) { if (! vlist.contains(tab->item(j, 0)->data(Qt::UserRole).toString())) tab->item(j, 0)->setFlags(tab->item(j, 0)->flags() & (~ Qt::ItemIsSelectable)); } QTableWidgetSelectionRange range(0, 0, tab->rowCount() - 1, tab->columnCount() - 1); tab->setRangeSelected(range, true); connect(tab, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(resetMultiselect(QTableWidgetItem*))); tab->blockSignals(oldblk); storeFilterValue(-1, tab); } } break; case CheckBox: { QCheckBox *checkBox = qobject_cast(found); if (checkBox != 0) checkBox->setChecked(pp->defaultValue.toBool()); } break; default: { QLineEdit *lineEdit = qobject_cast(found); if (lineEdit != 0) { lineEdit->setText(pp->defaultValue.toString()); storeFilterValue(-1, lineEdit); } } break; } found->setEnabled(pp->enabled); windowIdx++; }//end of while _defaultTypes } emit updated(); } void ParameterWidget::resetMultiselect(QTableWidgetItem *item) { QTableWidget *tab = qobject_cast(sender()); if (! tab) return; if (DEBUG) qDebug("%s::resetMultiselect(%p) entered for %p", qPrintable(objectName()), item, tab); disconnect(tab, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(resetMultiselect(QTableWidgetItem*))); for (int j = 0; j < tab->rowCount(); j++) tab->item(j, 0)->setFlags(tab->item(j, 0)->flags() | Qt::ItemIsSelectable); tab->selectRow(tab->row(item)); storeFilterValue(-1, tab); // why is this necessary? } void ParameterWidget::changeFilterObject(int index) { XComboBox *mybox = qobject_cast(sender()); if (! mybox) return; QStringList split = mybox->itemData(index).toString().split(":"); QString row = split.at(0); int type = split.at(1).toInt(); XSqlQuery qry; int siteid = -1; QWidget *widget = _filterGroup->findChild("widget" + row); QWidget *widget2 = _filterGroup->findChild("widget2" + row); QWidget *button = _filterGroup->findChild("button" + row); QHBoxLayout *layout = _filterGroup->findChild("widgetLayout1" + row); if (widget && layout && button) { delete widget; widget = 0; if (widget2) { delete widget2; widget2 = 0; } } else return; int pidx = paramIndex(mybox->currentText()); if (DEBUG) qDebug() << __FUNCTION__ << index << mybox << mybox->currentText() << pidx; if (pidx >= 0) { mybox->setDisabled(_params[pidx]->required); button->setDisabled(_params[pidx]->required); } QWidget *newWidget = 0; switch (type) { case Date: { DLineEdit *dLineEdit = new DLineEdit(_filterGroup); newWidget = dLineEdit; connect(dLineEdit, SIGNAL(newDate(QDate)), this, SLOT( storeFilterValue() ) ); } break; case User: { UsernameCluster *usernameCluster = new UsernameCluster(_filterGroup); newWidget = usernameCluster; usernameCluster->setOrientation(Qt::Horizontal); usernameCluster->setLabel(""); connect(usernameCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Crmacct: { CRMAcctCluster *crmacctCluster = new CRMAcctCluster(_filterGroup); newWidget = crmacctCluster; crmacctCluster->setOrientation(Qt::Horizontal); crmacctCluster->setLabel(""); connect(crmacctCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Customer: { CustCluster *custCluster = new CustCluster(_filterGroup); newWidget = custCluster; custCluster->setOrientation(Qt::Horizontal); custCluster->setLabel(""); custCluster->setDescriptionVisible(false); connect(custCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Shipto: { CustCluster *custCluster = new CustCluster(_filterGroup); QWidget *custWidget = custCluster; custCluster->setOrientation(Qt::Horizontal); custCluster->setLabel(""); custCluster->setNameVisible(false); custCluster->setDescriptionVisible(false); connect(button, SIGNAL(clicked()), custCluster, SLOT( deleteLater() ) ); ShiptoCluster *shiptoCluster = new ShiptoCluster(_filterGroup); QWidget *newWidgetAlt = shiptoCluster; shiptoCluster->setOrientation(Qt::Horizontal); shiptoCluster->setLabel(""); shiptoCluster->setDescriptionVisible(false); connect(custCluster, SIGNAL(newId(int)), shiptoCluster, SLOT(setCustid(int))); connect(button, SIGNAL(clicked()), shiptoCluster, SLOT( deleteLater() ) ); connect(shiptoCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); custCluster->setObjectName("widget" + row); newWidgetAlt->setObjectName("widget2" + row); layout->insertWidget(0,custWidget); layout->insertWidget(1,newWidgetAlt); layout->addStretch(1); } break; case Vendor: { VendorCluster *vendCluster = new VendorCluster(_filterGroup); newWidget = vendCluster; vendCluster->setOrientation(Qt::Horizontal); vendCluster->setLabel(""); connect(vendCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Contact: { ContactCluster *contactCluster = new ContactCluster(_filterGroup); newWidget = contactCluster; contactCluster->setDescriptionVisible(false); contactCluster->setLabel(""); connect(contactCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case GLAccount: { GLCluster *glCluster = new GLCluster(_filterGroup); newWidget = glCluster; glCluster->setLabel(""); connect(glCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Project: { ProjectCluster *projectCluster = new ProjectCluster(_filterGroup); newWidget = projectCluster; projectCluster->setOrientation(Qt::Horizontal); projectCluster->setLabel(""); connect(projectCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Item: { ItemCluster *itemCluster = new ItemCluster(_filterGroup); newWidget = itemCluster; itemCluster->setOrientation(Qt::Horizontal); itemCluster->setLabel(""); itemCluster->setNameVisible(false); connect(itemCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Employee: { EmpCluster *employeeCluster = new EmpCluster(_filterGroup); newWidget = employeeCluster; employeeCluster->setOrientation(Qt::Horizontal); employeeCluster->setLabel(""); connect(employeeCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case SalesOrder: { OrderCluster *soCluster = new OrderCluster(_filterGroup); newWidget = soCluster; soCluster->setDescriptionVisible(false); soCluster->setOrientation(Qt::Horizontal); soCluster->setAllowedTypes(OrderLineEdit::Sales); soCluster->setAllowedStatuses(OrderLineEdit::AnyStatus); soCluster->setLabel(""); connect(soCluster, SIGNAL(newId(int,QString)), this, SLOT( storeFilterValue(int) ) ); } break; case TransferOrder: { OrderCluster *toCluster = new OrderCluster(_filterGroup); newWidget = toCluster; toCluster->setDescriptionVisible(false); toCluster->setOrientation(Qt::Horizontal); toCluster->setAllowedTypes(OrderLineEdit::Transfer); toCluster->setAllowedStatuses(OrderLineEdit::AnyStatus); toCluster->setLabel(""); connect(toCluster, SIGNAL(newId(int,QString)), this, SLOT( storeFilterValue(int) ) ); } break; case PurchaseOrder: { OrderCluster *poCluster = new OrderCluster(_filterGroup); newWidget = poCluster; poCluster->setDescriptionVisible(false); poCluster->setOrientation(Qt::Horizontal); poCluster->setAllowedTypes(OrderLineEdit::Purchase); poCluster->setAllowedStatuses(OrderLineEdit::AnyStatus); poCluster->setLabel(""); connect(poCluster, SIGNAL(newId(int,QString)), this, SLOT( storeFilterValue(int) ) ); } break; case WorkOrder: { WoCluster *woCluster = new WoCluster(_filterGroup); newWidget = woCluster; woCluster->setOrientation(Qt::Horizontal); woCluster->setLabel(""); connect(woCluster, SIGNAL(newId(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Site: { WComboBox *wBox = new WComboBox(_filterGroup); siteid = wBox->id(); newWidget = wBox; connect(wBox, SIGNAL(newID(int)), this, SLOT( storeFilterValue(int) ) ); } break; case XComBox: { XComboBox *xBox = new XComboBox(_filterGroup); newWidget = xBox; xBox->setNullStr(tr("--- Please Select ---")); xBox->setAllowNull(true); xBox->setType(_params[paramIndex(mybox->currentText())]->comboType); if (_params[paramIndex(mybox->currentText())]->comboType == XComboBox::Adhoc && _params[paramIndex(mybox->currentText())]->query.length()) { qry.prepare( _params[paramIndex(mybox->currentText())]->query ); qry.exec(); xBox->populate(qry); } //xBox->setAllowNull(true); connect(xBox, SIGNAL(newID(int)), this, SLOT( storeFilterValue(int) ) ); } break; case Multiselect: { QTableWidget *tab = new QTableWidget(_filterGroup); #ifdef Q_WS_MAC QFont f = tab->font(); f.setPointSize(f.pointSize() - 2); tab->setFont(f); #endif newWidget = tab; tab->setShowGrid(false); tab->setSelectionBehavior(QAbstractItemView::SelectRows); tab->setSelectionMode(QAbstractItemView::ExtendedSelection); tab->horizontalHeader()->setVisible(false); tab->horizontalHeader()->setStretchLastSection(true); tab->verticalHeader()->setVisible(false); tab->setColumnCount(1); XSqlQuery msq; msq.prepare(_params[paramIndex(mybox->currentText())]->query); msq.exec(); for (int i = 0; msq.next(); i++) { if (i >= tab->rowCount()) tab->insertRow(tab->rowCount()); QTableWidgetItem *item = new QTableWidgetItem(msq.value(1).toString()); item->setData(Qt::UserRole, msq.value(0)); item->setFlags(item->flags() & (~ Qt::ItemIsEditable)); if (DEBUG) qDebug("%s::changeFilterObject() Multiselect added %s (%s) at %d", qPrintable(objectName()), qPrintable(item->text()), qPrintable(item->data(Qt::UserRole).toString()), i); tab->setItem(i, 0, item); tab->setRowHeight(i, (tab->fontMetrics().height() * 110) / 100); // TODO: a better way? } // keep the filter vertically small tab->setMaximumHeight(qMin(6, tab->rowCount()) * tab->rowHeight(0)); tab->show(); connect(tab, SIGNAL(itemSelectionChanged()), this, SLOT(storeFilterValue())); } break; case Exists: { QLineEdit *lineEdit = new QLineEdit(_filterGroup); lineEdit->hide(); newWidget = lineEdit; } break; case CheckBox: { QCheckBox *checkBox = new QCheckBox(_filterGroup); newWidget = checkBox; connect(checkBox, SIGNAL(stateChanged(int)), this, SLOT( storeFilterValue(int) ) ); } break; default: { QLineEdit *lineEdit = new QLineEdit(_filterGroup); newWidget = lineEdit; connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT( storeFilterValue() ) ); } break; } if (newWidget) { connect(button, SIGNAL(clicked()), newWidget, SLOT( deleteLater() ) ); newWidget->setObjectName("widget" + row); layout->insertWidget(0, newWidget); // Get initial values pre-set for special boolean cases if (type == Exists || type == CheckBox) { storeFilterValue(1, newWidget); return; } else if (type == Site) { storeFilterValue(siteid, newWidget); return; } else storeFilterValue(-1, newWidget); } _saveButton->setDisabled(true); } void ParameterWidget::clearFilters() { QStringList del; QList llist = _filterGroup->findChildren(); QList wlist = _filterGroup->findChildren(); // Find layout deletion candidates first for (int i = 0; i < llist.count(); i++) { if (llist.at(i)->objectName().startsWith("topLayout") || llist.at(i)->objectName().startsWith("widgetLayout2") || llist.at(i)->objectName().startsWith("buttonLayout")) del.append(llist.at(i)->objectName()); } // Then find widget deletion candidates for (int i = 0; i < wlist.count(); i++) { if (wlist.at(i)->objectName().startsWith("xcombo") || wlist.at(i)->objectName().startsWith("widget") || wlist.at(i)->objectName().startsWith("button")) del.append(wlist.at(i)->objectName()); } // Perform deletions while (del.count()) { QObject *obj = _filterGroup->findChild(del.at(0)); delete obj; del.takeFirst(); } _filtersLayout = new QGridLayout(); _filtersLayout->setObjectName("_filtersLayout"); gridLayout_2->addLayout(_filtersLayout, 1, 0, 1, 1); _filterValues.clear(); _filterWidgets.clear(); _usedTypes.clear(); _addFilterRow->setDisabled(false); emit cleared(); } ParameterList ParameterWidget::parameters() { ParameterList params; appendValue(params); return params; } void ParameterWidget::repopulateComboboxes() { QRegExp rx("^xcomboBox"); XComboBox *signaler = qobject_cast(sender()); QString current; QString value; foreach (XComboBox *combobox, _filterGroup->findChildren(rx)) { if (signaler && signaler == combobox) continue; // avoid Qt bug 20415 current = combobox->currentText(); QStringList split = combobox->itemData(combobox->currentIndex()).toString().split(":"); combobox->blockSignals(true); combobox->clear(); foreach (ParamProps *pp, _params) { value = split[0] + ":" + QString().setNum(pp->paramType); if ( !containsUsedType(pp->name) || current == pp->name ) combobox->addItem(pp->name, value ); } combobox->setText(current); combobox->blockSignals(false); } } void ParameterWidget::addUsedType() { XComboBox *mybox = (XComboBox *)sender(); QVariant filterVar(mybox->itemData(mybox->currentIndex())); QString filterType = filterVar.toString(); QStringList split = filterType.split(":"); int row = split[0].toInt(); if (!_usedTypes.isEmpty()) _usedTypes.remove(row); _usedTypes[row] = mybox->currentText(); } void ParameterWidget::removeParam(int pRow) { QLayoutItem *test; QLayoutItem *test2; test = _filtersLayout->itemAtPosition(pRow, 0)->layout()->itemAt(0); XComboBox *mybox = (XComboBox*)test->widget(); QVariant filterVar(mybox->itemData(mybox->currentIndex())); QString filterType = filterVar.toString(); QStringList split = filterType.split(":"); _filterValues.remove(split[0].toInt()); _filterWidgets.remove(split[0].toInt()); test2 = _filtersLayout->itemAtPosition(pRow, 0)->layout()->takeAt(1); delete test2; test2 = 0; _filtersLayout->update(); _addFilterRow->setDisabled(false); repopulateComboboxes(); if (!mybox->currentText().isEmpty()) _usedTypes.remove(pRow); emit updated(); emit filterChanged(); } void ParameterWidget::save() { QString filter = ""; QString variantString; QVariant tempVar; QDate today = QDate::currentDate(); int filter_id; QMapIterator > i(_filterValues); while (i.hasNext()) { i.next(); QPair tempPair = i.value(); tempVar = tempPair.second; QLayoutItem *test = _filtersLayout->itemAtPosition(i.key(), 0)->layout()->itemAt(0); XComboBox* mybox = (XComboBox*)test->widget(); QStringList split = mybox->itemData(mybox->currentIndex()).toString().split(":"); if ( tempVar.canConvert(QVariant::String) ) { QDate variantDate; if ( tempVar.canConvert() ) variantDate = tempVar.toDate(); if (variantDate.isValid()) { variantString = QString().setNum(today.daysTo(variantDate)); } else variantString = tempVar.toString(); filter = filter + tempPair.first + ":" + variantString + ":" + split[1] + "`"; } else if (tempVar.canConvert(QVariant::StringList)) filter += tempPair.first + ":" + tempVar.toStringList().join(",") + ":" + split[1] + "`"; } QString classname(parent()->objectName()); if (classname.isEmpty()) classname = parent()->metaObject()->className(); ParameterList params; params.append("filter", filter); if (_filterList->id()) params.append("filtersetname", _filterList->currentText()); params.append("classname", classname); if (_shared) params.append("shared", true); filterSave newdlg(this); newdlg.set(params); filter_id = newdlg.exec(); if (!filter_id) return; emit filterSetSaved(); setSavedFilters(); _filterList->setId(filter_id); } /*! Set the default value on an existing parameter @a pName to @a pDefault. If @a pDefault is not passed or 0 then the previous default, if any, will be removed. if @a pAutoApply is true, then the default filter set will be automatically applied. @sa applyDefaultFilterSet(); */ void ParameterWidget::setDefault(QString pName, QVariant pDefault, bool pAutoApply) { int idx = paramIndex(pName); if (idx != -1) { ParamProps* pp = _params[idx]; pp->defaultValue = pDefault; } else qWarning("Parameter %s not found.", qPrintable(pName)); if (pAutoApply) applyDefaultFilterSet(); } /*! Enable or disable an existing parameter @a pName to @a pEnabled. Useful if you want a specific value to be forced based on privilege control or some other specific criteria that would limit the user's selection ability. Is effective the next time a user instantiates the parameter. */ void ParameterWidget::setEnabled(QString pName, bool pEnabled) { int idx = paramIndex(pName); if (idx != -1) { ParamProps* pp = _params[idx]; pp->enabled = pEnabled; } else qWarning("Parameter %s not found.", qPrintable(pName)); } void ParameterWidget::setFiltersVisible(bool visible) { if (_filterGroup->isVisible() == visible) return; if (visible && _filtersLayout->rowCount() == 1) addParam(); _filterGroup->setVisible(visible); if (!_filterButton->isChecked() == visible) _filterButton->setChecked(visible); setFiltersVisabiltyPreference(); } void ParameterWidget::setFiltersVisabiltyPreference() { _settingsName = _name + objectName(); if (!_settingsName.isEmpty() && _x_preferences) { _x_preferences->set(_settingsName + "/checked", _filterGroup->isVisible()); } } /*! Sets the current filter as the default for the parent object it resides in. */ void ParameterWidget::setFiltersDefault() { QString pname; int filter_id; if(parent()) pname = parent()->metaObject()->className(); pname += "/"; _settingsName2 = pname + this->objectName(); filter_id = _filterList->id(_filterList->currentIndex()); if (!_settingsName2.isEmpty() && _x_preferences) _x_preferences->set(_settingsName2 + "/filter_default", filter_id); } /*! Sets a saved filter set with Id @a defaultId to the currently selected filter. If no @a pDefaultId is provided the default filter will be used. @sa setSavedFiltersIndex(QString); */ void ParameterWidget::setSavedFilters(int defaultId) { QString query; XSqlQuery qry; if(this->parent()) { QString classname(parent()->objectName()); if (classname.isEmpty()) classname = parent()->metaObject()->className(); query = " SELECT 0 AS filter_id, :none AS filter_name, 1 AS seq " " UNION " " SELECT filter_id, filter_name, 2 AS seq " " FROM filter " " WHERE COALESCE(filter_username,getEffectiveXtUser())=getEffectiveXtUser() " " AND filter_screen=:screen " " ORDER BY seq, filter_name "; qry.prepare(query); qry.bindValue(":screen", classname); qry.bindValue(":none", tr("Default")); qry.exec(); if (defaultId) _filterList->populate(qry, defaultId); else _filterList->populate(qry, 0); } } void ParameterWidget::setSavedFiltersIndex(QString filterSetName) { _filterList->findText(filterSetName); _filterList->setText(filterSetName); } void ParameterWidget::setType(QString pName, QString pParam, ParameterWidgetTypes type, QVariant pDefault, QVariant extraInfo) { append(pName, pParam, type, pDefault, false, extraInfo.toString()); qWarning("setType(QString pName, QString pParam, ParameterWidgetTypes type, QVariant pDefault, QVariant extraInfo) on parameterWidget is deprecated. " "Use appendQString pName, QString pParam, ParameterWidgetTypes type, QVariant pDefault, bool pRequired, QString extraInfo)."); } void ParameterWidget::setXComboBoxType(QString pName, QString pParam, XComboBox::XComboBoxTypes xType, QVariant pDefault) { appendComboBox(pName, pParam, xType, pDefault); qWarning("setType(QString pName, QString pParam, XComboBox::XComboBoxTypes xType, QVariant pDefault) is deprecated. " "Use appendComboBox(QString pName, QString pParam, XComboBox::XComboBoxTypes xType, QVariant pDefault)."); } void ParameterWidget::setXComboBoxType(QString pName, QString pParam, QString pQry, QVariant pDefault) { appendComboBox(pName, pParam, pQry, pDefault); qWarning("setXComboBoxType(QString pName, QString pParam, QString pQry, QVariant pDefault) is deprecated." "Use appendComboBox(QString pName, QString pParam, QString pQry, QVariant pDefault)."); } void ParameterWidget::sManageFilters() { ParameterList params; QString classname(parent()->objectName()); if (classname.isEmpty()) classname = parent()->metaObject()->className(); params.append("screen", classname); filterManager *newdlg = new filterManager(this, ""); newdlg->set(params); newdlg->exec(); } void ParameterWidget::toggleSave() { if (!_filterValues.isEmpty()) { _saveButton->setDisabled(false); } } // get the row number of a particular filter widget // this has to change if we change the way things get laid out int ParameterWidget::getFilterIndex(const QWidget *filterwidget) { int index = -1; for (int i = 1; i < _filtersLayout->rowCount(); i++) { QLayoutItem *rowLI = _filtersLayout->itemAtPosition(i, 1); if (rowLI) { QGridLayout *rowgrid = qobject_cast(rowLI->layout()); if (rowgrid) { QLayoutItem *childLI = rowgrid->itemAtPosition(0, 0); QHBoxLayout *filterlyt = qobject_cast(childLI->layout()->itemAt(0)->layout()); if (filterlyt) { for (int n = 0; n < filterlyt->count(); n++) { if (filterlyt->itemAt(n)->widget() == filterwidget) { index = i; break; } } } } } } return index; } // get the filter widget at a particular row // this has to change if we change the way things get laid out QWidget *ParameterWidget::getFilterWidget(const int index) { QWidget *filterwidget = 0; QGridLayout *rowgrid = _filtersLayout->findChild("topLayout" + QString::number(index)); QLayoutItem *childLI = rowgrid->itemAtPosition(0, 0)->layout()->itemAt(0); QHBoxLayout *datalyt = (QHBoxLayout *)childLI->layout(); QLayoutItem *filterLI = datalyt->itemAt(0); if (filterLI) filterwidget = filterLI->widget(); return filterwidget; } // stores the value of a filter object into the filtervalues map void ParameterWidget::storeFilterValue(int pId, QObject* filter) { if (DEBUG) qDebug("%s::storeFilterValue(%d, %p)", qPrintable(objectName()), pId, filter); QWidget *wfilter = qobject_cast(filter); if (! wfilter) wfilter = qobject_cast(sender()); if (! wfilter) { qWarning("%s::storeFilterValue(%d, %p) could not find filter", qPrintable(objectName()), pId, filter); return; } int foundRow = getFilterIndex(wfilter); if (foundRow < 0) { qWarning("%s::storeFilterValue(%d, %p) could not find filter index", qPrintable(objectName()), pId, filter); return; } QLayoutItem *selectorLI = _filtersLayout->itemAtPosition(foundRow, 0)->layout()->itemAt(0); XComboBox *selector = qobject_cast(selectorLI->widget()); QString currText = selector->currentText(); ParamProps *pp = (paramIndex(currText) >= 0) ? _params[paramIndex(currText)] : 0; if (! pp) return; QVariant newvalue; QString classname(wfilter->metaObject()->className()); // check usernamecluster before pid because we key off text value for users if (classname == "UsernameCluster") { UsernameCluster *usernameCluster = (UsernameCluster *)wfilter; newvalue.setValue(usernameCluster->username()); } else if (classname == "QCheckBox") { QCheckBox *checkBox = (QCheckBox *)wfilter; newvalue.setValue(checkBox->isChecked()); } else if (pId != -1) { newvalue.setValue(pId); } else if (classname == "QLineEdit") { QLineEdit *lineEdit = (QLineEdit *)wfilter; newvalue.setValue(lineEdit->text()); } else if (classname == "DLineEdit") { DLineEdit *dateedit = qobject_cast(wfilter); newvalue.setValue(dateedit->date()); } else if (classname == "QTableWidget") { QList selected = (qobject_cast(wfilter))->selectedItems(); QVariantList value; for (int i = 0; i < selected.size(); i++) value.append(selected.at(i)->data(Qt::UserRole)); newvalue.setValue(value); } else if (classname == "ProjectCluster") { ProjectCluster *projectCluster = (ProjectCluster *)wfilter; newvalue.setValue(projectCluster->id()); } _filterWidgets[foundRow] = wfilter; if (pp && ! newvalue.isNull()) { _filterValues[foundRow] = qMakePair(pp->param, newvalue); emit updated(); } if (!_usedTypes.isEmpty()) _usedTypes.remove(foundRow); _usedTypes[foundRow] = selector->currentText(); _addFilterRow->setDisabled(false); repopulateComboboxes(); emit filterChanged(); } QString ParameterWidget::getParameterTypeKey(QString pValue) { QMapIterator i(_params); while (i.hasNext()) { i.next(); ParamProps* pp = i.value(); if (pValue == pp->param) return pp->name; } return QString(); } /*! Returns the index of an appended parameter definition of @a pName. */ int ParameterWidget::paramIndex(QString pName) { QMapIterator i(_params); while (i.hasNext()) { i.next(); if (pName == i.value()->name) return i.key(); } return -1; } //updates selected filter set to be the default upon loading of the current screen //for the current user void ParameterWidget::setSelectedFilter(int filter_id) { XSqlQuery qry; QString classname(parent()->objectName()); if (classname.isEmpty()) classname = parent()->metaObject()->className(); QString query = "UPDATE filter SET filter_selected=false " "WHERE filter_screen=:screen AND filter_username=getEffectiveXtUser()"; QString query2 = "UPDATE filter SET filter_selected=true " "WHERE filter_screen=:screen AND filter_id=:id AND filter_username=getEffectiveXtUser()"; qry.prepare(query); qry.bindValue(":screen", classname); qry.exec(); qry.prepare(query2); qry.bindValue(":screen", classname); qry.bindValue(":id", filter_id); qry.exec(); } bool ParameterWidget::containsUsedType(QString value) { QMapIterator i(_usedTypes); while (i.hasNext()) { i.next(); if (i.value() == value) return true; } return false; } /*! Returns a text based list separated by line feeds of parameter names and selected values. Can be useful when passed to printed reports as a header description of what filter has been applied to the presented data. */ QString ParameterWidget::filter() { QStringList filters; QMapIterator > i(_filterValues); while (i.hasNext()) { i.next(); QPair tempPair = i.value(); QMapIterator p(_params); while (p.hasNext()) { p.next(); ParamProps *pp = p.value(); if (pp->param == tempPair.first && !pp->name.isEmpty()) { QString value = ": "; QWidget *w = _filterWidgets.value(i.key()); if (w->inherits("UsernameCluster")) { UsernameCluster *usernameCluster = (UsernameCluster *)w; value.append(usernameCluster->username()); } else if (w->inherits("ContactCluster")) { ContactCluster *contactCluster = (ContactCluster *)w; value.append(contactCluster->name()); } else if (w->inherits("ItemCluster")) { ItemCluster *itemCluster = (ItemCluster *)w; value.append(itemCluster->number() + " - " + itemCluster->description()); } else if (w->inherits("VirtualCluster")) { VirtualCluster *virtualCluster = (VirtualCluster *)w; value.append(virtualCluster->number() + " - " + virtualCluster->name()); } else if (w->inherits("XComboBox")) { XComboBox *comboBox = (XComboBox *)w; value.append(comboBox->currentText()); } else if (w->inherits("DLineEdit")) { DLineEdit *dlineEdit = (DLineEdit *)w; value.append(dlineEdit->date().toString()); } else if (w->inherits("QLineEdit")) { QLineEdit *lineEdit = (QLineEdit *)w; if (!w->isHidden()) value.append(lineEdit->text()); else value.clear(); } else if (w->inherits("QTableWidget")) { QTableWidget *table = (QTableWidget *)w; QList items = table->selectedItems(); QStringList rowvals; for (int i = 0; i < items.count(); i++) rowvals.append(items.at(i)->data(Qt::DisplayRole).toString()); value.append(rowvals.join(",")); } else if (w->inherits("QCheckBox")) { QCheckBox *checkBox = (QCheckBox *)w; if (checkBox->isChecked()) value.append(tr("True")); else value.append(tr("False")); } else value.clear(); filters.append(pp->name + value); break; } } } return filters.join("\n"); } // script exposure /////////////////////////////////////////////////////////// void ParameterWidgetfromScriptValue(const QScriptValue &obj, ParameterWidget* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue ParameterWidgettoScriptValue(QScriptEngine *engine, ParameterWidget* const &item) { return engine->newQObject(item); } QScriptValue constructParameterWidget(QScriptContext *context, QScriptEngine *engine) { ParameterWidget *obj = 0; if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new ParameterWidget(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() >= 2 && qscriptvalue_cast(context->argument(0))) obj = new ParameterWidget(qscriptvalue_cast(context->argument(0)), qPrintable(context->argument(1).toString())); return engine->toScriptValue(obj); } void setupParameterWidget(QScriptEngine *engine) { qScriptRegisterMetaType(engine, ParameterWidgettoScriptValue, ParameterWidgetfromScriptValue); QScriptValue widget = engine->newFunction(constructParameterWidget); widget.setProperty("Crmacct", QScriptValue(engine, ParameterWidget::Crmacct), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Customer", QScriptValue(engine, ParameterWidget::Customer), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Shipto", QScriptValue(engine, ParameterWidget::Shipto), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Vendor", QScriptValue(engine, ParameterWidget::Vendor), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("User", QScriptValue(engine, ParameterWidget::User), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Text", QScriptValue(engine, ParameterWidget::Text), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Date", QScriptValue(engine, ParameterWidget::Date), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("XComBox", QScriptValue(engine, ParameterWidget::XComBox), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Contact", QScriptValue(engine, ParameterWidget::Contact), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("GLAccount", QScriptValue(engine, ParameterWidget::GLAccount), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Multiselect", QScriptValue(engine, ParameterWidget::Multiselect), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Exists", QScriptValue(engine, ParameterWidget::Exists), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CheckBox", QScriptValue(engine, ParameterWidget::CheckBox), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Project", QScriptValue(engine, ParameterWidget::Project), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Item", QScriptValue(engine, ParameterWidget::Item), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Employee", QScriptValue(engine, ParameterWidget::Employee), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Site", QScriptValue(engine, ParameterWidget::Site), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesOrder", QScriptValue(engine, ParameterWidget::SalesOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WorkOrder", QScriptValue(engine, ParameterWidget::WorkOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PurchaseOrder", QScriptValue(engine, ParameterWidget::PurchaseOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TransferOrder", QScriptValue(engine, ParameterWidget::TransferOrder), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("ParameterWidget", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/parameterwidget.h000066400000000000000000000101001217451700100204050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef parameterwidget_h #define parameterwidget_h #include #include #include #include #include #include #include #include "widgets.h" #include "ui_parameterwidget.h" class ParameterList; class QTableWidgetItem; class XTUPLEWIDGETS_EXPORT ParameterWidget : public QWidget, public Ui::ParameterWidget { Q_OBJECT Q_ENUMS(ParameterWidgetTypes) public: enum ParameterWidgetTypes { Crmacct, User, Text, Date, XComBox, Contact, Multiselect, GLAccount, Exists, CheckBox, Project, Customer, Site, Vendor, Item, Employee, Shipto, SalesOrder, WorkOrder, PurchaseOrder, TransferOrder }; ParameterWidget(QWidget *pParent, const char * = 0); ~ParameterWidget(); void appendValue(ParameterList &); Q_INVOKABLE void applyDefaultFilterSet(); Q_INVOKABLE int paramIndex(QString pName); Q_INVOKABLE ParameterList parameters(); Q_INVOKABLE QString filter(); public slots: void addParam(); void append(QString pName, QString pParam, enum ParameterWidgetTypes pType = Text, QVariant pDefault = QVariant(), bool pRequired = false, QString pExtraInfo = QString()); void appendComboBox(QString pName, QString pParam, QString pQuery, QVariant pDefault = QVariant(), bool pRequired = false); void appendComboBox(QString pName, QString pParam, int pType, QVariant pDefault = QVariant(), bool pRequired = false); void applySaved(int pId = 0, int filter_id = 0); void changeFilterObject(int index); void clearFilters(); void removeParam(int); void save(); void setDefault(QString pName, QVariant pDefault = QVariant(), bool pAutoApply = false); void setEnabled(QString pName, bool pEnabled); void setFiltersVisible(bool visible); void setSavedFilters(int defaultId = -1); void setSavedFiltersIndex(QString); void setType(QString, QString, ParameterWidgetTypes = Text, QVariant pDefault = QVariant(), QVariant extraInfo = QVariant()); void setXComboBoxType(QString, QString, enum XComboBox::XComboBoxTypes, QVariant pDefault = QVariant()); void setXComboBoxType(QString, QString, QString, QVariant pDefault = QVariant()); void sManageFilters(); void storeFilterValue(int pId = -1, QObject* filter = 0); void setFiltersVisabiltyPreference(); void toggleSave(); void setFiltersDefault(); signals: void cleared(); void filterChanged(); void filterSetSaved(); void updated(); protected: virtual void showEvent(QShowEvent *); virtual void resetEmptyParameter(); private: enum ParameterWidgetTypes _type; QSignalMapper *_filterSignalMapper; QMap _usedTypes; QString _settingsName, _settingsName2; QMap _filterWidgets; QMap > _filterValues; bool _initialized; bool _shared; QString _name; struct ParamProps { QString name; QString param; ParameterWidgetTypes paramType; QVariant defaultValue; bool required; XComboBox::XComboBoxTypes comboType; QString query; bool enabled; }; QMap _params; protected: int getFilterIndex(const QWidget *filterwidget); QWidget *getFilterWidget(const int index); QString getParameterTypeKey(QString); void setSelectedFilter(int filter_id); bool containsUsedType(QString); private slots: void repopulateComboboxes(); void addUsedType(); protected slots: void resetMultiselect(QTableWidgetItem* item); }; Q_DECLARE_METATYPE(ParameterWidget*); void setupParameterWidget(QScriptEngine *engine); #endif qt-client-4.1.0/widgets/parameterwidget.ui000066400000000000000000000072041217451700100206060ustar00rootroot00000000000000 ParameterWidget 0 0 235 137 0 Filter: More true true Qt::Horizontal 40 0 QFrame::NoFrame QFrame::Raised Save Manage Qt::Horizontal 0 20 + Qt::Vertical 20 0 XComboBox QComboBox
    xcombobox.h
    qt-client-4.1.0/widgets/periodslistview.h000066400000000000000000000007271217451700100204730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include qt-client-4.1.0/widgets/plCluster.cpp000066400000000000000000000121031217451700100175360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include //#include //#include #include #include #include #include #include "plCluster.h" PlanOrdLineEdit::PlanOrdLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "planord", "planord_id", "formatPloNumber(planord_id)", "item_number", "(item_descrip1 ' ' item_descrip2)", 0, pName) { setTitles(tr("Planned Order"), tr("Planned Orders")); setUiName("plannedOrder"); setEditPriv("CreatePlannedOrders"); setViewPriv("ViewPlannedOrders"); setNewPriv("CreatePlannedOrders"); _query = "SELECT planord_id AS id," " formatPloNumber(planord_id) AS number, " " item_number AS name, " " (item_descrip1 || ' ' || item_descrip2) AS description, " " NULL AS active, " " warehous_code, item_number, uom_name," " item_descrip1, item_descrip2 " "FROM planord " " JOIN itemsite ON (planord_itemsite_id=itemsite_id) " " JOIN item ON (itemsite_item_id=item_id) " " JOIN whsinfo ON (itemsite_warehous_id=warehous_id) " " JOIN uom ON (item_inv_uom_id=uom_id) " "WHERE (true) "; } PlanOrdCluster::PlanOrdCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new PlanOrdLineEdit(this, pName)); qDebug("constructor number:%p",_number); setLabel("Planned Order #:"); QHBoxLayout *_firstLineLayout = new QHBoxLayout(0); QHBoxLayout *_orderLayout = new QHBoxLayout(0); QHBoxLayout *_warehouseLayout = new QHBoxLayout(0); QHBoxLayout *_itemLineLayout = new QHBoxLayout(0); QHBoxLayout *_itemNumberLayout = new QHBoxLayout(0); QHBoxLayout *_uomLayout = new QHBoxLayout(0); _firstLineLayout ->setContentsMargins(0, 0, 0, 0); _orderLayout ->setContentsMargins(0, 0, 0, 0); _warehouseLayout ->setContentsMargins(0, 0, 0, 0); _itemLineLayout ->setContentsMargins(0, 0, 0, 0); _itemNumberLayout ->setContentsMargins(0, 0, 0, 0); _uomLayout ->setContentsMargins(0, 0, 0, 0); _firstLineLayout->addLayout(_orderLayout); QLabel *_warehouseLit = new QLabel(tr("Whs.:"), this); _warehouseLit->setObjectName("_warehouseLit"); _warehouseLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _warehouseLayout->addWidget(_warehouseLit); _warehouse = new QLabel(this); _warehouse->setObjectName("_warehouse"); _warehouse->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _warehouseLayout->addWidget(_warehouse); _firstLineLayout->addLayout(_warehouseLayout); _grid->addLayout(_firstLineLayout,0,2,1,3,Qt::AlignLeft); QLabel *_itemNumberLit = new QLabel(tr("Item Number:"), this); _itemNumberLit->setObjectName("_itemNumberLit"); _itemNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _itemNumberLayout->addWidget(_itemNumberLit); _itemNumber = new QLabel(this); _itemNumber->setObjectName("_itemNumber"); _itemNumber->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _itemNumberLayout->addWidget(_itemNumber); _itemLineLayout->addLayout(_itemNumberLayout); QLabel *_uomLit = new QLabel(tr("UOM:"), this); _uomLit->setObjectName("_uomLit"); _uomLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _uomLayout->addWidget(_uomLit); _uom = new QLabel(this); _uom->setObjectName("_uom"); _uom->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _uomLayout->addWidget(_uom); _itemLineLayout->addLayout(_uomLayout); _grid->addLayout(_itemLineLayout,1,0,1,3,Qt::AlignLeft); _descrip1 = new QLabel(this); _descrip1->setObjectName("_descrip1"); _descrip1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _grid->addWidget(_descrip1,2,0,1,3,Qt::AlignLeft); _descrip2 = new QLabel(this); _descrip2->setObjectName("_descrip2"); _descrip2->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _grid->addWidget(_descrip2,3,0,1,3,Qt::AlignLeft); } void PlanOrdCluster::sRefresh() { if (_number->model()->rowCount()) { QAbstractItemModel* model = _number->model(); _warehouse->setText(model->data(model->index(0,WAREHOUSE)).toString()); _itemNumber->setText(model->data(model->index(0,ITEM_NUMBER)).toString()); _uom->setText(model->data(model->index(0,UOM)).toString()); _descrip1->setText(model->data(model->index(0,ITEM_DESCRIP1)).toString()); _descrip2->setText(model->data(model->index(0,ITEM_DESCRIP2)).toString()); } else { _warehouse->clear(); _itemNumber->clear(); _uom->clear(); _descrip1->clear(); _descrip2->clear(); } } qt-client-4.1.0/widgets/plCluster.h000066400000000000000000000023271217451700100172120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef plCluster_h #define plCluster_h #include "virtualCluster.h" #include "widgets.h" class QLabel; class QPushButton; class PlanOrdCluster; #define WAREHOUSE 5 #define ITEM_NUMBER 6 #define UOM 7 #define ITEM_DESCRIP1 8 #define ITEM_DESCRIP2 9 class XTUPLEWIDGETS_EXPORT PlanOrdLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: PlanOrdLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT PlanOrdCluster : public VirtualCluster { Q_OBJECT public: PlanOrdCluster(QWidget*, const char* = 0); public slots: void sRefresh(); private: QLabel *_warehouse; QLabel *_itemNumber; QLabel *_uom; QLabel *_descrip1; QLabel *_descrip2; }; #endif qt-client-4.1.0/widgets/plugins/000077500000000000000000000000001217451700100165415ustar00rootroot00000000000000qt-client-4.1.0/widgets/plugins/addressclusterplugin.h000066400000000000000000000031121217451700100231550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ADDRESSCLUSTERPLUGIN_H__ #define __ADDRESSCLUSTERPLUGIN_H__ #include "addresscluster.h" #include #include class AddressClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: AddressClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "addresscluster.h"; } QString name() const { return "AddressCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new AddressCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/alarmsplugin.h000066400000000000000000000027721217451700100214200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ALARMSPLUGIN_H__ #define __ALARMSPLUGIN_H__ #include "alarms.h" #include #include class AlarmsPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: AlarmsPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "alarms.h"; } QString name() const { return "Alarms"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new Alarms(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/aropenclusterplugin.h000066400000000000000000000031001217451700100230110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __AROPENCLUSTERPLUGIN_H__ #define __AROPENCLUSTERPLUGIN_H__ #include "aropencluster.h" #include #include class AropenClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: AropenClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "aropencluster.h"; } QString name() const { return "AropenCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new AropenCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/calendarcomboboxplugin.h000066400000000000000000000031301217451700100234300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CALENDARCOMBOBOXPLUGIN_H__ #define __CALENDARCOMBOBOXPLUGIN_H__ #include "calendarTools.h" #include #include class CalendarComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CalendarComboBoxPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "calendarTools.h"; } QString name() const { return "CalendarComboBox"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CalendarComboBox(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/clineeditplugin.h000066400000000000000000000030341217451700100220710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CLINEEDITPLUGIN_H__ #define __CLINEEDITPLUGIN_H__ #include "custcluster.h" #include #include class CLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "custcluster.h"; } QString name() const { return "CLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/cmheadclusterplugin.h000066400000000000000000000031001217451700100227460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CMHEADCLUSTERPLUGIN_H__ #define __CMHEADCLUSTERPLUGIN_H__ #include "cmheadcluster.h" #include #include class CmheadClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CmheadClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "cmheadcluster.h"; } QString name() const { return "CmheadCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CmheadCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/commentsplugin.h000066400000000000000000000030161217451700100217560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __COMMENTSPLUGIN_H__ #define __COMMENTSPLUGIN_H__ #include "comments.h" #include #include class CommentsPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CommentsPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "comments.h"; } QString name() const { return "Comments"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new Comments(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/contactclusterplugin.h000066400000000000000000000031121217451700100231630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CONTACTCLUSTERPLUGIN_H__ #define __CONTACTCLUSTERPLUGIN_H__ #include "contactcluster.h" #include #include class ContactClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ContactClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "contactcluster.h"; } QString name() const { return "ContactCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ContactCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/contactwidgetplugin.h000066400000000000000000000031001217451700100227620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CONTACTWIDGETPLUGIN_H__ #define __CONTACTWIDGETPLUGIN_H__ #include "contactwidget.h" #include #include class ContactWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ContactWidgetPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "contactwidget.h"; } QString name() const { return "ContactWidget"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ContactWidget(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/crmacctclusterplugin.h000066400000000000000000000031121217451700100231440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CRMACCTCLUSTERPLUGIN_H__ #define __CRMACCTCLUSTERPLUGIN_H__ #include "crmacctcluster.h" #include #include class CRMAcctClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CRMAcctClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "crmacctcluster.h"; } QString name() const { return "CRMAcctCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CRMAcctCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/currclusterplugin.h000066400000000000000000000030541217451700100225100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CURRCLUSTERPLUGIN_H__ #define __CURRCLUSTERPLUGIN_H__ #include "currcluster.h" #include #include class CurrClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CurrClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "currcluster.h"; } QString name() const { return "CurrCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CurrCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/currdisplayplugin.h000066400000000000000000000030541217451700100224740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CURRDISPLAYPLUGIN_H__ #define __CURRDISPLAYPLUGIN_H__ #include "currcluster.h" #include #include class CurrDisplayPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CurrDisplayPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "currcluster.h"; } QString name() const { return "CurrDisplay"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CurrDisplay(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/custclusterplugin.h000066400000000000000000000030541217451700100225130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CUSTCLUSTERPLUGIN_H__ #define __CUSTCLUSTERPLUGIN_H__ #include "custcluster.h" #include #include class CustClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CustClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "custcluster.h"; } QString name() const { return "CustCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CustCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/customerselectorplugin.h000066400000000000000000000031361217451700100235360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __CUSTOMERSELECTORPLUGIN_H__ #define __CUSTOMERSELECTORPLUGIN_H__ #include "customerselector.h" #include #include class CustomerSelectorPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: CustomerSelectorPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "customerselector.h"; } QString name() const { return "CustomerSelector"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new CustomerSelector(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/dateclusterplugin.h000066400000000000000000000030541217451700100224520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DATECLUSTERPLUGIN_H__ #define __DATECLUSTERPLUGIN_H__ #include "datecluster.h" #include #include class DateClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: DateClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "datecluster.h"; } QString name() const { return "DateCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new DateCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/deptclusterplugin.h000066400000000000000000000030541217451700100224710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DEPTCLUSTERPLUGIN_H__ #define __DEPTCLUSTERPLUGIN_H__ #include "deptcluster.h" #include #include class DeptClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: DeptClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "deptcluster.h"; } QString name() const { return "DeptCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new DeptCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/dlineeditplugin.h000066400000000000000000000030341217451700100220720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DLINEEDITPLUGIN_H__ #define __DLINEEDITPLUGIN_H__ #include "datecluster.h" #include #include class DLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: DLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "datecluster.h"; } QString name() const { return "DLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new DLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/documentsplugin.h000066400000000000000000000030301217451700100221260ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __DOCUMENTSPLUGIN_H__ #define __DOCUMENTSPLUGIN_H__ #include "documents.h" #include #include class DocumentsPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: DocumentsPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "documents.h"; } QString name() const { return "Documents"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new Documents(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/empclusterplugin.h000066400000000000000000000030421217451700100223130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __EMPCLUSTERPLUGIN_H__ #define __EMPCLUSTERPLUGIN_H__ #include "empcluster.h" #include #include class EmpClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: EmpClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "empcluster.h"; } QString name() const { return "EmpCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new EmpCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/empgroupclusterplugin.h000066400000000000000000000031241217451700100233710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __EMPGROUPCLUSTERPLUGIN_H__ #define __EMPGROUPCLUSTERPLUGIN_H__ #include "empgroupcluster.h" #include #include class EmpGroupClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: EmpGroupClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "empgroupcluster.h"; } QString name() const { return "EmpGroupCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new EmpGroupCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/expenseclusterplugin.h000066400000000000000000000031121217451700100231770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __EXPENSECLUSTERPLUGIN_H__ #define __EXPENSECLUSTERPLUGIN_H__ #include "expensecluster.h" #include #include class ExpenseClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ExpenseClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "expensecluster.h"; } QString name() const { return "ExpenseCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ExpenseCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/expenselineeditplugin.h000066400000000000000000000031221217451700100233140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __EXPENSELINEEDITPLUGIN_H__ #define __EXPENSELINEEDITPLUGIN_H__ #include "expensecluster.h" #include #include class ExpenseLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ExpenseLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "expensecluster.h"; } QString name() const { return "ExpenseLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ExpenseLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/fileclusterplugin.h000066400000000000000000000030541217451700100224540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __FILECLUSTERPLUGIN_H__ #define __FILECLUSTERPLUGIN_H__ #include "filecluster.h" #include #include class FileClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: FileClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "filecluster.h"; } QString name() const { return "FileCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new FileCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/filemoveselectorplugin.h000066400000000000000000000031361217451700100235030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __FILEMOVESELECTORPLUGIN_H__ #define __FILEMOVESELECTORPLUGIN_H__ #include "filemoveselector.h" #include #include class FileMoveSelectorPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: FileMoveSelectorPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "filemoveselector.h"; } QString name() const { return "FileMoveSelector"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new FileMoveSelector(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/filtermanagerplugin.h000066400000000000000000000031001217451700100227430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __FILTERMANAGERPLUGIN_H__ #define __FILTERMANAGERPLUGIN_H__ #include "filterManager.h" #include #include class filterManagerPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: filterManagerPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "filterManager.h"; } QString name() const { return "filterManager"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new filterManager(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/glclusterplugin.h000066400000000000000000000030301217451700100221310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __GLCLUSTERPLUGIN_H__ #define __GLCLUSTERPLUGIN_H__ #include "glcluster.h" #include #include class GLClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: GLClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "glcluster.h"; } QString name() const { return "GLCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new GLCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/imageclusterplugin.h000066400000000000000000000030661217451700100226220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __IMAGECLUSTERPLUGIN_H__ #define __IMAGECLUSTERPLUGIN_H__ #include "imagecluster.h" #include #include class ImageClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ImageClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "imagecluster.h"; } QString name() const { return "ImageCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ImageCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/incidentclusterplugin.h000066400000000000000000000031241217451700100233300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __INCIDENTCLUSTERPLUGIN_H__ #define __INCIDENTCLUSTERPLUGIN_H__ #include "incidentcluster.h" #include #include class IncidentClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: IncidentClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "incidentcluster.h"; } QString name() const { return "IncidentCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new IncidentCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/invoiceclusterplugin.h000066400000000000000000000031121217451700100231640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __INVOICECLUSTERPLUGIN_H__ #define __INVOICECLUSTERPLUGIN_H__ #include "invoiceCluster.h" #include #include class InvoiceClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: InvoiceClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "invoiceCluster.h"; } QString name() const { return "InvoiceCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new InvoiceCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/invoicelineeditplugin.h000066400000000000000000000031241217451700100233030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __INVOICELINEEDITPLUGIN_H__ #define __INVOICELINEEDITPLUGIN_H__ #include "invoicelineedit.h" #include #include class InvoiceLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: InvoiceLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "invoicelineedit.h"; } QString name() const { return "InvoiceLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new InvoiceLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/itemclusterplugin.h000066400000000000000000000030541217451700100224730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ITEMCLUSTERPLUGIN_H__ #define __ITEMCLUSTERPLUGIN_H__ #include "itemcluster.h" #include #include class ItemClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ItemClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "itemcluster.h"; } QString name() const { return "ItemCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ItemCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/itemlineeditplugin.h000066400000000000000000000030651217451700100226110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ITEMLINEEDITPLUGIN_H__ #define __ITEMLINEEDITPLUGIN_H__ #include "itemcluster.h" #include #include class ItemLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ItemLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "itemlineedit.h"; } QString name() const { return "ItemLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ItemLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/lotserialclusterplugin.h000066400000000000000000000031361217451700100235340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __LOTSERIALCLUSTERPLUGIN_H__ #define __LOTSERIALCLUSTERPLUGIN_H__ #include "lotserialcluster.h" #include #include class LotserialClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: LotserialClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "lotserialcluster.h"; } QString name() const { return "LotserialCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new LotserialCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/lotserialseqclusterplugin.h000066400000000000000000000031561217451700100242470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __LOTSERIALSEQPLUGIN_H__ #define __LOTSERIALSEQPLUGIN_H__ #include "lotserialseqcluster.h" #include #include class LotserialseqClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: LotserialseqClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "lotserialseqcluster.h"; } QString name() const { return "LotserialseqCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new LotserialseqCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/menubuttonplugin.h000077500000000000000000000030421217451700100223330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __MENUBUTTONPLUGIN_H__ #define __MENUBUTTONPLUGIN_H__ #include "menubutton.h" #include #include class MenuButtonPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: MenuButtonPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "menubutton.h"; } QString name() const { return "MenuButton"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new MenuButton(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/numbergencomboboxplugin.h000066400000000000000000000031501217451700100236430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __NUMBERGENCOMBOBOXPLUGIN_H__ #define __NUMBERGENCOMBOBOXPLUGIN_H__ #include "numbergencombobox.h" #include #include class NumberGenComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: NumberGenComboBoxPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "numbergencombobox.h"; } QString name() const { return "NumberGenComboBox"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new NumberGenComboBox(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/opportunityclusterplugin.h000066400000000000000000000031621217451700100241510ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __OPPORTUNITYCLUSTERPLUGIN_H__ #define __OPPORTUNITYCLUSTERPLUGIN_H__ #include "opportunitycluster.h" #include #include class OpportunityClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: OpportunityClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "opportunitycluster.h"; } QString name() const { return "OpportunityCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new OpportunityCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/orderclusterplugin.h000066400000000000000000000030661217451700100226530ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __ORDERCLUSTERPLUGIN_H__ #define __ORDERCLUSTERPLUGIN_H__ #include "ordercluster.h" #include #include class OrderClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: OrderClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "ordercluster.h"; } QString name() const { return "OrderCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new OrderCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/parametergroupplugin.h000066400000000000000000000031121217451700100231630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PARAMETERGROUPPLUGIN_H__ #define __PARAMETERGROUPPLUGIN_H__ #include "parametergroup.h" #include #include class ParameterGroupPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ParameterGroupPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "parametergroup.h"; } QString name() const { return "ParameterGroup"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ParameterGroup(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/parameterwidgetplugin.h000066400000000000000000000031241217451700100233150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PARAMETERWIDGETPLUGIN_H__ #define __PARAMETERWIDGETPLUGIN_H__ #include "parameterwidget.h" #include #include class ParameterWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ParameterWidgetPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "parameterwidget.h"; } QString name() const { return "ParameterWidget"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ParameterWidget(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/periodslistviewplugin.h000066400000000000000000000031201217451700100233610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PERIODSLISTVIEWPLUGIN_H__ #define __PERIODSLISTVIEWPLUGIN_H__ #include "calendarTools.h" #include #include class PeriodsListViewPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: PeriodsListViewPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "calendarTools.h"; } QString name() const { return "PeriodsListView"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new PeriodsListView(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/planordclusterplugin.h000066400000000000000000000031001217451700100231640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PLANORDCLUSTERPLUGIN_H__ #define __PLANORDCLUSTERPLUGIN_H__ #include "plCluster.h" #include #include class PlanOrdClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: PlanOrdClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "plCluster.h"; } QString name() const { return "PlanOrdCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new PlanOrdCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/planordlineeditplugin.h000066400000000000000000000031101217451700100233010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PLANORDLINEEDITPLUGIN_H__ #define __PLANORDLINEEDITPLUGIN_H__ #include "plCluster.h" #include #include class PlanOrdLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: PlanOrdLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "plCluster.h"; } QString name() const { return "PlanOrdLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new PlanOrdLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/projectclusterplugin.h000066400000000000000000000031121217451700100231760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PROJECTCLUSTERPLUGIN_H__ #define __PROJECTCLUSTERPLUGIN_H__ #include "projectcluster.h" #include #include class ProjectClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ProjectClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "projectcluster.h"; } QString name() const { return "ProjectCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ProjectCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/projectlineeditplugin.h000066400000000000000000000031221217451700100233130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __PROJECTLINEEDITPLUGIN_H__ #define __PROJECTLINEEDITPLUGIN_H__ #include "projectcluster.h" #include #include class ProjectLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ProjectLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "projectcluster.h"; } QString name() const { return "ProjectLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ProjectLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/querysetplugin.h000066400000000000000000000030161217451700100220120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QUERYSETPLUGIN_H__ #define __QUERYSETPLUGIN_H__ #include "queryset.h" #include #include class QuerySetPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: QuerySetPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "queryset.h"; } QString name() const { return "QuerySet"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new QuerySet(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/quoteclusterplugin.h000066400000000000000000000030661217451700100226750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QUOTECLUSTERPLUGIN_H__ #define __QUOTECLUSTERPLUGIN_H__ #include "quotecluster.h" #include #include class QuoteClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: QuoteClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "quotecluster.h"; } QString name() const { return "QuoteCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new QuoteCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/quotecontrolplugin.h000066400000000000000000000030661217451700100226740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QUOTECONTROLPLUGIN_H__ #define __QUOTECONTROLPLUGIN_H__ #include "quoteWidgets.h" #include #include class QuoteControlPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: QuoteControlPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "quoteWidgets.h"; } QString name() const { return "QuoteControl"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new QuoteControl(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/quotelineplugin.h000066400000000000000000000030361217451700100221400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __QUOTELINEPLUGIN_H__ #define __QUOTELINEPLUGIN_H__ #include "quoteWidgets.h" #include #include class QuoteLinePlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: QuoteLinePlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "quoteWidgets.h"; } QString name() const { return "QuoteLine"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new QuoteLine(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/raclusterplugin.h000066400000000000000000000030301217451700100221310ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __RACLUSTERPLUGIN_H__ #define __RACLUSTERPLUGIN_H__ #include "racluster.h" #include #include class RaClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: RaClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "racluster.h"; } QString name() const { return "RaCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new RaCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/recurrencewidgetplugin.h000066400000000000000000000031361217451700100234750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __RECURRENCEWIDGETPLUGIN_H__ #define __RECURRENCEWIDGETPLUGIN_H__ #include "recurrencewidget.h" #include #include class RecurrenceWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: RecurrenceWidgetPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "recurrencewidget.h"; } QString name() const { return "RecurrenceWidget"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new RecurrenceWidget(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/revisionclusterplugin.h000066400000000000000000000031241217451700100233710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __REVISIONCLUSTERPLUGIN_H__ #define __REVISIONCLUSTERPLUGIN_H__ #include "revisioncluster.h" #include #include class RevisionClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: RevisionClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "revisioncluster.h"; } QString name() const { return "RevisionCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new RevisionCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/screenplugin.h000066400000000000000000000027711217451700100214170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SCREENPLUGIN_H__ #define __SCREENPLUGIN_H__ #include "screen.h" #include #include class ScreenPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ScreenPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return true; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "screen.h"; } QString name() const { return "Screen"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new Screen(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/shiftclusterplugin.h000066400000000000000000000030661217451700100226550ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SHIFTCLUSTERPLUGIN_H__ #define __SHIFTCLUSTERPLUGIN_H__ #include "shiftcluster.h" #include #include class ShiftClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ShiftClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "shiftcluster.h"; } QString name() const { return "ShiftCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ShiftCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/shipmentclusterplugin.h000066400000000000000000000031241217451700100233620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SHIPMENTCLUSTERPLUGIN_H__ #define __SHIPMENTCLUSTERPLUGIN_H__ #include "shipmentcluster.h" #include #include class ShipmentClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ShipmentClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "shipmentcluster.h"; } QString name() const { return "ShipmentCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ShipmentCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/shiptoclusterplugin.h000066400000000000000000000031001217451700100230330ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SHIPTOCLUSTERPLUGIN_H__ #define __SHIPTOCLUSTERPLUGIN_H__ #include "shiptocluster.h" #include #include class ShiptoClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ShiptoClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "shiptocluster.h"; } QString name() const { return "ShiptoCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ShiptoCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/shiptoeditplugin.h000066400000000000000000000030501217451700100223030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __SHIPTOEDITPLUGIN_H__ #define __SHIPTOEDITPLUGIN_H__ #include "shiptocluster.h" #include #include class ShiptoEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: ShiptoEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "shittocluster.h"; } QString name() const { return "ShiptoEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new ShiptoEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/usernameclusterplugin.h000066400000000000000000000031241217451700100233520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __USERNAMECLUSTERPLUGIN_H__ #define __USERNAMECLUSTERPLUGIN_H__ #include "usernamecluster.h" #include #include class UsernameClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: UsernameClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "usernamecluster.h"; } QString name() const { return "UsernameCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new UsernameCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/usernamelineeditplugin.h000066400000000000000000000031341217451700100234670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __USERNAMELINEEDITPLUGIN_H__ #define __USERNAMELINEEDITPLUGIN_H__ #include "usernamecluster.h" #include #include class UsernameLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: UsernameLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "usernamecluster.h"; } QString name() const { return "UsernameLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new UsernameLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/vendorclusterplugin.h000066400000000000000000000031001217451700100230220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __VENDORCLUSTERPLUGIN_H__ #define __VENDORCLUSTERPLUGIN_H__ #include "vendorcluster.h" #include #include class VendorClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: VendorClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "vendorcluster.h"; } QString name() const { return "VendorCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new VendorCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/vendorgroupplugin.h000066400000000000000000000030541217451700100225050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __VENDORGROUPPLUGIN_H__ #define __VENDORGROUPPLUGIN_H__ #include "vendorgroup.h" #include #include class VendorGroupPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: VendorGroupPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "vendorgroup.h"; } QString name() const { return "VendorGroup"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new VendorGroup(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/vendorlineeditplugin.h000066400000000000000000000031111217451700100231400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __VENDORLINEEDITPLUGIN_H__ #define __VENDORLINEEDITPLUGIN_H__ #include "vendorcluster.h" #include #include class VendorLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: VendorLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "vendorlineedit.h"; } QString name() const { return "VendorLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new VendorLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/warehousegroupplugin.h000066400000000000000000000031121217451700100232050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WAREHOUSEGROUPPLUGIN_H__ #define __WAREHOUSEGROUPPLUGIN_H__ #include "warehousegroup.h" #include #include class WarehouseGroupPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: WarehouseGroupPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "warehousegroup.h"; } QString name() const { return "WarehouseGroup"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new WarehouseGroup(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/wcomboboxplugin.h000066400000000000000000000030301217451700100221240ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WCOMBOBOXPLUGIN_H__ #define __WCOMBOBOXPLUGIN_H__ #include "wcombobox.h" #include #include class WComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: WComboBoxPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "wcombobox.h"; } QString name() const { return "WComboBox"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new WComboBox(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/woclusterplugin.h000066400000000000000000000030301217451700100221540ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WOCLUSTERPLUGIN_H__ #define __WOCLUSTERPLUGIN_H__ #include "wocluster.h" #include #include class WoClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: WoClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "wocluster.h"; } QString name() const { return "WoCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new WoCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/wolineeditplugin.h000066400000000000000000000030401217451700100222710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WOLINEEDITPLUGIN_H__ #define __WOLINEEDITPLUGIN_H__ #include "wocluster.h" #include #include class WoLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: WoLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "wocluster.h"; } QString name() const { return "WoLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new WoLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/womatlclusterplugin.h000066400000000000000000000031001217451700100230300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WOMATLCLUSTERPLUGIN_H__ #define __WOCMATLLUSTERPLUGIN_H__ #include "womatlcluster.h" #include #include class WomatlClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: WomatlClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "womatlcluster.h"; } QString name() const { return "WomatlCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new WomatlCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/workcenterclusterplugin.h000066400000000000000000000031501217451700100237150ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WORKCENTERCLUSTERPLUGIN_H__ #define __WORKCENTERCLUSTERPLUGIN_H__ #include "workcentercluster.h" #include #include class WorkCenterClusterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: WorkCenterClusterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "workcentercluster.h"; } QString name() const { return "WorkCenterCluster"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new WorkCenterCluster(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/workcenterlineeditplugin.h000066400000000000000000000031601217451700100240320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WORKCENTERLINEEDITPLUGIN_H__ #define __WORKCENTERLINEEDITPLUGIN_H__ #include "workcentercluster.h" #include #include class WorkCenterLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: WorkCenterLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "workcentercluster.h"; } QString name() const { return "WorkCenterLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new WorkCenterLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xcheckboxplugin.h000066400000000000000000000030341217451700100221070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XCHECKBOBOXPLUGIN_H__ #define __XCHECKBOBOXPLUGIN_H__ #include "xcheckbox.h" #include #include class XCheckBoxPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XCheckBoxPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xcheckbox.h"; } QString name() const { return "XCheckBox"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XCheckBox(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xcomboboxplugin.h000066400000000000000000000030301217451700100221250ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XCOMBOBOXPLUGIN_H__ #define __XCOMBOBOXPLUGIN_H__ #include "xcombobox.h" #include #include class XComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XComboBoxPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xcombobox.h"; } QString name() const { return "XComboBox"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XComboBox(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xdoccopysetterplugin.h000066400000000000000000000031141217451700100232070ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XDOCCOPYSETTERPLUGIN_H__ #define __XDOCCOPYSETTERPLUGIN_H__ #include "xdoccopysetter.h" #include #include class XDocCopySetterPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XDocCopySetterPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xdoccopysetter.h"; } QString name() const { return "XDocCopySetter"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XDocCopySetter(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xlabelplugin.h000066400000000000000000000027721217451700100214100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XLABELPLUGIN_H__ #define __XLABELPLUGIN_H__ #include "xlabel.h" #include #include class XLabelPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XLabelPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xlabel.h"; } QString name() const { return "XLabel"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XLabel(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xlineeditplugin.h000066400000000000000000000030301217451700100221120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XLINEEDITPLUGIN_H__ #define __XLINEEDITPLUGIN_H__ #include "xlineedit.h" #include #include class XLineEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XLineEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xlineedit.h"; } QString name() const { return "XLineEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XLineEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xlistviewplugin.h000066400000000000000000000030301217451700100221630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XLISTVIEWPLUGIN_H__ #define __XLISTVIEWPLUGIN_H__ #include "xlistview.h" #include #include class XListViewPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XListViewPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xlistview.h"; } QString name() const { return "XListView"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XListView(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xspinboxplugin.h000066400000000000000000000030161217451700100220030ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XSPINBOXPLUGIN_H__ #define __XSPINBOXPLUGIN_H__ #include "xspinbox.h" #include #include class XSpinBoxPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XSpinBoxPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xspinbox.h"; } QString name() const { return "XSpinBox"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XSpinBox(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xtableviewplugin.h000066400000000000000000000030421217451700100223020ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTABLEVIEWPLUGIN_H__ #define __XTABLEVIEWPLUGIN_H__ #include "xtableview.h" #include #include class XTableViewPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XTableViewPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xtableview.h"; } QString name() const { return "XTableView"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XTableView(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xtexteditplugin.h000066400000000000000000000030301217451700100221470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTEXTEDITPLUGIN_H__ #define __XTEXTEDITPLUGIN_H__ #include "xtextedit.h" #include #include class XTextEditPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XTextEditPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xtextedit.h"; } QString name() const { return "XTextEdit"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XTextEdit(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xtreeviewplugin.h000066400000000000000000000030301217451700100221470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTREEVIEWPLUGIN_H__ #define __XTREEVIEWPLUGIN_H__ #include "xtreeview.h" #include #include class XTreeViewPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XTreeViewPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xtreeview.h"; } QString name() const { return "XTreeView"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XTreeView(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xtreewidgetplugin.h000066400000000000000000000030531217451700100224650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTREEWIDGETLUGIN_H__ #define __XTREEWIDGETPLUGIN_H__ #include "xtreewidget.h" #include #include class XTreeWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XTreeWidgetPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xtreewidget.h"; } QString name() const { return "XTreeWidget"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XTreeWidget(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/plugins/xurllabelplugin.h000066400000000000000000000030301217451700100221170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XURLLABELPLUGIN_H__ #define __XURLLABELPLUGIN_H__ #include "xurllabel.h" #include #include class XURLLabelPlugin : public QObject, public QDesignerCustomWidgetInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetInterface) public: XURLLabelPlugin(QObject *parent = 0) : QObject(parent), initialized(false) {} bool isContainer() const { return false; } bool isInitialized() const { return initialized; } QIcon icon() const { return QIcon(); } QString domXml() const { return "\n" "\n"; } QString group() const { return "xTuple Custom Widgets"; } QString includeFile() const { return "xurllabel.h"; } QString name() const { return "XURLLabel"; } QString toolTip() const { return ""; } QString whatsThis() const { return ""; } QWidget *createWidget(QWidget *parent) { return new XURLLabel(parent); } void initialize(QDesignerFormEditorInterface *) { initialized = true; } private: bool initialized; }; #endif qt-client-4.1.0/widgets/projectCluster.cpp000066400000000000000000000074071217451700100206040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "projectcluster.h" ProjectCluster::ProjectCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new ProjectLineEdit(this, pName)); _name->setVisible(true); setLabel(tr("Project #:")); } void ProjectCluster::setType(ProjectLineEdit::ProjectType ptype) { return (static_cast(_number))->setType(ptype); } ProjectLineEdit::ProjectStatuses ProjectCluster::allowedStatuses() const { return ((ProjectLineEdit*)_number)->allowedStatuses(); } void ProjectCluster::setAllowedStatuses(const ProjectLineEdit::ProjectStatuses p) { ((ProjectLineEdit*)_number)->setAllowedStatuses(p); } void ProjectCluster::setAllowedStatuses(const int p) { ((ProjectLineEdit*)_number)->setAllowedStatuses((ProjectLineEdit::ProjectStatuses)p); } ProjectLineEdit::ProjectType ProjectCluster::type() { return (static_cast(_number))->type(); } ProjectLineEdit::ProjectLineEdit(QWidget* pParent, const char* pName) : CrmClusterLineEdit(pParent, "prj", "prj_id", "prj_number", "prj_name", 0, "prj_owner_username", "prj_username", 0, pName) { _objtype = "J"; setTitles(tr("Project"), tr("Projects")); setUiName("project"); setEditPriv("MaintainAllProjects"); setNewPriv("MaintainAllProjects"); setViewPriv("ViewAllProjects"); setEditOwnPriv("MaintainPersonalProjects"); setViewOwnPriv("ViewPersonalProjects"); _type = Undefined; } ProjectLineEdit::ProjectLineEdit(enum ProjectType pPrjType, QWidget *pParent, const char *pName) : CrmClusterLineEdit(pParent, "prj()", "prj_id", "prj_number", "prj_name", 0, 0, pName) { setTitles(tr("Project"), tr("Projects")); setUiName("project"); setEditPriv("MaintainAllProjects"); setViewPriv("ViewAllProjects"); _type = pPrjType; _allowedStatuses = 0x00; } void ProjectLineEdit::buildExtraClause() { QString extraClause = _prjExtraClause; QString typeClause; QString statusClause; QStringList clauses; // Add in type clause if (_type & SalesOrder) clauses << "(prj_so)"; if (_type & WorkOrder) clauses << "(prj_wo)"; if (_type & PurchaseOrder) clauses << "(prj_po)"; if (clauses.count()) typeClause = "(" + clauses.join(" OR ") + ")"; if (!extraClause.isEmpty() && !typeClause.isEmpty()) extraClause.append(" AND "); if (!typeClause.isEmpty()) extraClause.append(typeClause); // Add in status clause if (_allowedStatuses && (_allowedStatuses != Concept + InProcess + Complete)) { QStringList statusList; if (_allowedStatuses & Concept) statusList << "'P'"; if (_allowedStatuses & InProcess) statusList << "'O'"; if (_allowedStatuses & Complete) statusList << "'C'"; statusClause = "(prj_status IN (" + statusList.join(", ") + "))"; } else statusClause = ""; if (!extraClause.isEmpty() && !statusClause.isEmpty()) extraClause.append(" AND "); if (!statusClause.isEmpty()) extraClause.append(statusClause); VirtualClusterLineEdit::setExtraClause(extraClause); } void ProjectLineEdit::setExtraClause(const QString& pExt) { _prjExtraClause = pExt; buildExtraClause(); } void ProjectLineEdit::setType(ProjectType ptype) { _type = ptype; buildExtraClause(); } void ProjectLineEdit::setAllowedStatuses(const ProjectStatuses p) { _allowedStatuses = p; buildExtraClause(); } qt-client-4.1.0/widgets/projectcluster.h000066400000000000000000000045541217451700100203110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _projectCluster_h #define _projectCluster_h #include "crmcluster.h" class XTUPLEWIDGETS_EXPORT ProjectLineEdit : public CrmClusterLineEdit { Q_OBJECT Q_ENUMS(ProjectType) Q_PROPERTY(ProjectType projectType READ type WRITE setType ) public: enum ProjectType { Undefined, SalesOrder, WorkOrder, PurchaseOrder, }; enum ProjectStatus { AnyStatus = 0x00, Concept = 0x01, InProcess = 0x02, Complete = 0x04 }; Q_DECLARE_FLAGS(ProjectStatuses, ProjectStatus) ProjectLineEdit(QWidget*, const char* = 0); ProjectLineEdit(enum ProjectType pPrjType, QWidget *pParent, const char *pName); Q_INVOKABLE virtual enum ProjectType type() const { return _type; } Q_INVOKABLE virtual ProjectStatuses allowedStatuses() const { return _allowedStatuses; } public slots: void setExtraClause(const QString &pExt); void setAllowedStatuses(const ProjectStatuses); void setType(enum ProjectType ptype); protected: void buildExtraClause(); QString _prjExtraClause; ProjectStatuses _allowedStatuses; private: enum ProjectType _type; }; Q_DECLARE_OPERATORS_FOR_FLAGS(ProjectLineEdit::ProjectStatuses) class XTUPLEWIDGETS_EXPORT ProjectCluster : public VirtualCluster { Q_OBJECT Q_ENUMS(ProjectLineEdit::ProjectType) Q_PROPERTY(ProjectLineEdit::ProjectType projectType READ type WRITE setType ) public: ProjectCluster(QWidget*, const char* = 0); Q_INVOKABLE virtual ProjectLineEdit::ProjectStatuses allowedStatuses() const; Q_INVOKABLE enum ProjectLineEdit::ProjectType type(); public slots: virtual void setAllowedStatuses(const ProjectLineEdit::ProjectStatuses); virtual void setAllowedStatuses(const int); virtual void setType(enum ProjectLineEdit::ProjectType ptype); }; #endif qt-client-4.1.0/widgets/purchaseOrderList.cpp000066400000000000000000000121661217451700100212340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "purchaseOrderList.h" #include #include #include #include #include #include #include #include #include #include "xtreewidget.h" #include "pocluster.h" purchaseOrderList::purchaseOrderList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl) : QDialog(parent, fl) { setObjectName(name ? name : "purchaseOrderList"); setModal(modal); _poheadid = -1; _type = (cPOUnposted | cPOOpen | cPOClosed); setWindowTitle(tr("Purchase Orders")); QHBoxLayout *purchaseOrderListLayout = new QHBoxLayout(this); QVBoxLayout *tableLayout = new QVBoxLayout(); QVBoxLayout *buttonLayout = new QVBoxLayout(); purchaseOrderListLayout->addLayout(tableLayout); purchaseOrderListLayout->addLayout(buttonLayout); QHBoxLayout *vendLayout = new QHBoxLayout(); _vend = new VendorCluster(this, "_vend"); vendLayout->addWidget(_vend); vendLayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); tableLayout->addLayout(vendLayout); QLabel *_poheadLit = new QLabel(tr("&Purchase Orders:"), this); _poheadLit->setObjectName("_poheadLit"); tableLayout->addWidget( _poheadLit ); _pohead = new XTreeWidget(this); _pohead->setObjectName("_pohead"); _poheadLit->setBuddy(_pohead); tableLayout->addWidget(_pohead); _close = new QPushButton(tr("&Cancel"), this); _close->setObjectName("_close"); buttonLayout->addWidget( _close ); _select = new QPushButton(tr("&Select"), this); _select->setObjectName("_select"); _select->setEnabled( FALSE ); _select->setDefault( TRUE ); buttonLayout->addWidget( _select ); QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); buttonLayout->addItem( spacer ); resize( QSize(550, 350).expandedTo(minimumSizeHint()) ); //clearWState( WState_Polished ); // signals and slots connections connect(_close, SIGNAL(clicked()), this, SLOT(sClose() )); connect(_pohead, SIGNAL(itemSelected(int)), _select, SLOT(animateClick() )); connect(_pohead, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_select, SIGNAL(clicked()), this, SLOT(sSelect() )); connect(_vend, SIGNAL(newId(int)), this, SLOT(sFillList() )); _type = 0; _pohead->addColumn(tr("Number"), _orderColumn, Qt::AlignRight, true, "pohead_number"); _pohead->addColumn(tr("Vendor"), -1, Qt::AlignLeft, true, "vend_name"); _pohead->addColumn(tr("Agent"), _itemColumn, Qt::AlignCenter,true, "pohead_agent_username"); _pohead->addColumn(tr("Order Date"),_dateColumn, Qt::AlignLeft, true, "pohead_orderdate"); _pohead->addColumn(tr("First Item"),_itemColumn, Qt::AlignLeft, true, "item_number"); _pohead->setFocus(); } void purchaseOrderList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("pohead_id", &valid); if (valid) _poheadid = param.toInt(); param = pParams.value("poType", &valid); if (valid) _type = param.toInt(); sFillList(); } void purchaseOrderList::sSelect() { done(_pohead->id()); } void purchaseOrderList::sClose() { done(_poheadid); } void purchaseOrderList::sFillList() { QString sql( "SELECT pohead_id, pohead_number," " vend_name, pohead_agent_username," " pohead_orderdate," " item_number " "FROM vendinfo, pohead LEFT OUTER JOIN" " poitem ON (poitem_pohead_id=pohead_id AND poitem_linenumber=1)" " LEFT OUTER JOIN itemsite ON (poitem_itemsite_id=itemsite_id)" " LEFT OUTER JOIN item ON (itemsite_item_id=item_id) " "WHERE ( (pohead_vend_id=vend_id)" "" " AND (pohead_status IN (" "" " " " ," " " " " "" " ))" "" "" " AND (pohead_vend_id=)" "" " ) " "ORDER BY pohead_number DESC;" ); ParameterList params; if (_vend->isValid()) params.append("vend_id", _vend->id()); QStringList typeList; if (_type & cPOUnposted) typeList += "U"; if (_type & cPOOpen) typeList += "O"; if (_type & cPOClosed) typeList += "C"; if (! typeList.isEmpty()) params.append("typeList", typeList); MetaSQLQuery mql(sql); XSqlQuery poheadq = mql.toQuery(params); _pohead->populate(poheadq, _poheadid); } qt-client-4.1.0/widgets/purchaseOrderList.h000066400000000000000000000021621217451700100206740ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef purchaseorderlist_h #define purchaseorderlist_h #include #include "widgets.h" #include "vendorcluster.h" class XTreeWidget; class QPushButton; class ParameterList; class XTUPLEWIDGETS_EXPORT purchaseOrderList : public QDialog { Q_OBJECT public: purchaseOrderList( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); XTreeWidget* _pohead; QPushButton* _close; QPushButton* _select; public slots: virtual void set(const ParameterList & pParams); virtual void sFillList(); virtual void sSelect(); virtual void sClose(); private: int _poheadid; int _type; VendorCluster *_vend; }; #endif qt-client-4.1.0/widgets/queryitem.cpp000066400000000000000000000232251217451700100176140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "queryitem.h" #include #include #include QueryItem::QueryItem(QWidget *parent, Qt::WindowFlags fl) : QWidget(parent, fl) { setupUi(this); // SelectMQL is not part of the widgets library so insert it manually QGridLayout *mqlLayout = new QGridLayout(_qryStack->widget(_qryStack->indexOf(_qryMQLPage))); _selectmql = new SelectMQL(this); //, Qt::Widget); _selectmql->setObjectName("_selectmql"); mqlLayout->addWidget(_selectmql, 0, 0); // MQLEdit is not part of the widgets library so insert it manually QGridLayout *customLayout = new QGridLayout(_qryStack->widget(_qryStack->indexOf(_qryCustomPage))); _mqledit = new MQLEdit(this); //, Qt::Widget); _mqledit->setObjectName("_mqledit"); _mqledit->forceTestMode(! _x_privileges || ! _x_privileges->check("ExecuteMetaSQL")); customLayout->addWidget(_mqledit, 0, 0); connect(_mqledit->_text,SIGNAL(textChanged()), this, SLOT(sHandleButtons())); connect(_qryName, SIGNAL(editingFinished()), this, SLOT(sHandleButtons())); connect(_qryRelation, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); connect(_qrySchema, SIGNAL(newID(int)), this, SLOT(sUpdateRelations())); connect(_qrySrc, SIGNAL(newID(int)), this, SLOT(sHandleButtons())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_selectmql,SIGNAL(selectedQuery(int)), this, SLOT(sHandleButtons())); _qrySrc->append(0, tr("Entire Table or View"), "REL"); _qrySrc->append(1, tr("Pre-defined MetaSQL"), "MQL"); _qrySrc->append(2, tr("Custom Query"), "CUSTOM"); _qrySchema->populate("SELECT pg_namespace.oid, nspname, nspname," " CASE nspname WHEN 'public' THEN ' '" " WHEN 'api' THEN ' '" " ELSE '' END || nspname AS orderby" " FROM pg_namespace " " JOIN pkghead ON (nspname IN (pkghead_name, 'api'," " 'public'))" " ORDER BY orderby;"); clear(); sUpdateRelations(); sHandleButtons(); } QueryItem::~QueryItem() { // no need to delete child widgets, Qt does it all for us } int QueryItem::id() const { return _qryitemid; } int QueryItem::parentId() const { return _qryheadid; } void QueryItem::clear() { _qryitemid = -1; _qryheadid = -1; _qryName->setText(""); _qryOrder->setValue(0); _qryNotes->setPlainText(""); _qrySrc->setId(-1); _qrySchema->setId(-1); _qryRelation->setId(-1); _selectmql->setId(-1); _mqledit->clear(); } void QueryItem::setId(int p) { XSqlQuery itemq; itemq.prepare("SELECT *" " FROM qryitem" " WHERE (qryitem_id=:id);"); itemq.bindValue(":id", p); itemq.exec(); if (itemq.first()) { _qryitemid = itemq.value("qryitem_id").toInt(); _qryheadid = itemq.value("qryitem_qryhead_id").toInt(); _qryName->setText(itemq.value("qryitem_name").toString()); _qryOrder->setValue(itemq.value("qryitem_order").toInt()); _qryNotes->setPlainText(itemq.value("qryitem_notes").toString()); _qrySrc->setCode(itemq.value("qryitem_src").toString()); switch (_qrySrc->id()) { case 0: _qrySchema->setCode(itemq.value("qryitem_group").toString()); _qryRelation->setCode(itemq.value("qryitem_detail").toString()); _qryStack->setCurrentWidget(_qryRelationPage); break; case 1: { XSqlQuery mqlq; mqlq.prepare("SELECT metasql_id" " FROM metasql" " WHERE ((metasql_group=:group)" " AND (metasql_name=:name))" " ORDER BY metasql_grade DESC" " LIMIT 1;"); mqlq.bindValue(":group", itemq.value("qryitem_group")); mqlq.bindValue(":name", itemq.value("qryitem_detail")); mqlq.exec(); if (mqlq.first()) { _selectmql->setId(mqlq.value("metasql_id").toInt()); _qryStack->setCurrentWidget(_qryMQLPage); } else if (mqlq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), mqlq.lastError().text()); return; } break; } case 2: _mqledit->_text->setPlainText(itemq.value("qryitem_detail").toString()); _qryStack->setCurrentWidget(_qryCustomPage); break; default: QMessageBox::warning(this, tr("Unknown Query Source"), tr("

    Could not populate this Query Item " "properly because the query source %1 " "is not recognized.") .arg(itemq.value("qryitem_src").toString())); _qryStack->setCurrentIndex(0); break; } } else if (itemq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), itemq.lastError().text()); return; } } void QueryItem::setParentId(int p) { _qryheadid = p; } void QueryItem::languageChange() { retranslateUi(this); } void QueryItem::sHandleButtons() { if (_qrySrc->code() == "REL") _save->setEnabled(! _qryName->text().isEmpty() && _qrySchema->id() > 0 && _qryRelation->id() > 0); else if (_qrySrc->code() == "MQL") _save->setEnabled(! _qryName->text().isEmpty() && _selectmql->id() > 0); else if (_qrySrc->code() == "CUSTOM") _save->setEnabled(! _qryName->text().isEmpty() && ! _mqledit->_text->toPlainText().isEmpty()); else _save->setEnabled(false); } void QueryItem::sSave() { XSqlQuery saveq; if (_qryitemid < 0) saveq.prepare("INSERT INTO qryitem (" " qryitem_qryhead_id, qryitem_order, qryitem_src," " qryitem_group, qryitem_detail, qryitem_notes," " qryitem_name" ") VALUES (" " :qryitem_qryhead_id, :qryitem_order, :qryitem_src," " :qryitem_group, :qryitem_detail, :qryitem_notes," " :qryitem_name" ") RETURNING qryitem_id;"); else { saveq.prepare("UPDATE qryitem SET" " qryitem_qryhead_id=:qryitem_qryhead_id," " qryitem_order=:qryitem_order," " qryitem_src=:qryitem_src," " qryitem_group=:qryitem_group," " qryitem_detail=:qryitem_detail," " qryitem_notes=:qryitem_notes," " qryitem_name=:qryitem_name" " WHERE qryitem_id=:qryitem_id" " RETURNING qryitem_id;"); saveq.bindValue(":qryitem_id", _qryitemid); } saveq.bindValue(":qryitem_qryhead_id", _qryheadid); saveq.bindValue(":qryitem_name", _qryName->text()); saveq.bindValue(":qryitem_order", _qryOrder->value()); saveq.bindValue(":qryitem_notes", _qryNotes->toPlainText()); saveq.bindValue(":qryitem_src", _qrySrc->code()); switch (_qrySrc->id()) { case 0: saveq.bindValue(":qryitem_group", _qrySchema->code()); saveq.bindValue(":qryitem_detail", _qryRelation->code()); break; case 1: saveq.bindValue(":qryitem_group", _selectmql->group()); saveq.bindValue(":qryitem_detail", _selectmql->name()); break; case 2: saveq.bindValue(":qryitem_detail", _mqledit->_text->toPlainText()); break; default: QMessageBox::warning(this, tr("Unknown Query Source"), tr("

    Could not save this Query Item " "because the query source %1 " "is not recognized.") .arg(_qrySrc->code())); return; } saveq.exec(); if (saveq.first()) _qryitemid = saveq.value("qryitem_id").toInt(); else if (saveq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), saveq.lastError().text()); return; } close(); emit saved(_qryitemid); emit closed(true); } void QueryItem::sUpdateRelations() { if (! _x_preferences) // don't query when loading in Qt Designer return; MetaSQLQuery mql("SELECT oid, relname, relname" " FROM pg_class" " WHERE ((relkind IN ('r', 'v'))" " " " AND (relnamespace=)" " " " )" " ORDER BY relname;"); ParameterList params; if (_qrySchema->id() > 0) params.append("oid", _qrySchema->id()); XSqlQuery popq = mql.toQuery(params); _qryRelation->populate(popq); if (popq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), popq.lastError().text()); return; } } void QueryItem::closeEvent(QCloseEvent *event) { clear(); QWidget::closeEvent(event); } qt-client-4.1.0/widgets/queryitem.h000066400000000000000000000025561217451700100172650ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef QUERYITEM_H #define QUERYITEM_H #include "widgets.h" #include #include #include #include "ui_queryitem.h" class QueryItem : public QWidget, public Ui::QueryItem { Q_OBJECT public: QueryItem(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~QueryItem(); Q_INVOKABLE virtual int id() const; Q_INVOKABLE virtual int parentId() const; public slots: virtual void clear(); virtual void setId(int p); virtual void setParentId(int p); signals: void saved(int queryitemid); void closed(bool ok); protected slots: virtual void languageChange(); virtual void sHandleButtons(); virtual void sSave(); virtual void sUpdateRelations(); protected: virtual void closeEvent(QCloseEvent *event); MQLEdit *_mqledit; int _qryheadid; int _qryitemid; SelectMQL *_selectmql; }; #endif // QUERYITEM_H qt-client-4.1.0/widgets/queryitem.ui000066400000000000000000000167031217451700100174520ustar00rootroot00000000000000 QueryItem 0 0 395 353 Query Item QFormLayout::FieldsStayAtSizeHint Order: _qryOrder Type of Query: true [ Pick a type of query ] Name: _qryName Cancel false Save Qt::Vertical 20 40 0 10 0 Schema or Package: _qrySchema true [ Select a schema ] Table or View: _qryRelation true [ Select a table or view ] Qt::Horizontal 40 20 0 7 Notes: _qryNotes Qt::Horizontal 40 20 XComboBox QComboBox

    xcombobox.h
    XLabel QLabel
    xlabel.h
    XSpinBox QSpinBox
    xspinbox.h
    XTextEdit QTextEdit
    xtextedit.h
    _qryName _qryOrder _qrySrc _qryNotes _save _cancel _qrySchema _qryRelation _qrySrc activated(int) _qryStack setCurrentIndex(int) 213 113 299 223 _cancel clicked() QueryItem close() 382 33 394 7 qt-client-4.1.0/widgets/queryset.cpp000066400000000000000000000200451217451700100174460ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "queryset.h" #include #include #include #include #include "queryitem.h" #define DEBUG false QuerySet::QuerySet(QWidget *parent, Qt::WindowFlags fl) : QWidget(parent, fl) { setupUi(this); // create child first so we can connect signals but not if we're in Designer if (_x_preferences) { _itemdlg = new QueryItem(0, Qt::Dialog); if (_itemdlg) { _itemdlg->setWindowModality(Qt::WindowModal); connect(_itemdlg, SIGNAL(closed(bool)), this, SLOT(sFillList())); } } else _itemdlg = 0; connect(_qryDelete, SIGNAL(clicked()), this, SLOT(sDelete())); connect(_qryEdit, SIGNAL(clicked()), this, SLOT(sEdit())); connect(_qryList, SIGNAL(itemSelected(int)), this, SLOT(sEdit())); connect(_qryNew, SIGNAL(clicked()), this, SLOT(sNew())); connect(_save, SIGNAL(clicked()), this, SLOT(sSave())); connect(_setName, SIGNAL(editingFinished()), this, SLOT(sHandleButtons())); _qryList->addColumn(tr("Order"), _seqColumn, Qt::AlignRight, true, "qryitem_order"); _qryList->addColumn(tr("Name"), _itemColumn, Qt::AlignLeft, true, "qryitem_name"); _qryList->addColumn(tr("Source"), _seqColumn, Qt::AlignLeft, true, "qryitem_src"); _qryList->addColumn(tr("Schema/Group"),_itemColumn, Qt::AlignLeft, true, "qryitem_group"); _qryList->addColumn(tr("Table/Name"), -1, Qt::AlignLeft, true, "qryitem_detail"); sHandleButtons(); _qryheadid = -1; } QuerySet::~QuerySet() { // no need to delete child widgets, Qt does it all for us // but _itemdlg isn't really a child if (_itemdlg) _itemdlg->deleteLater(); } int QuerySet::id() const { return _qryheadid; } void QuerySet::setId(int p) { XSqlQuery headq; headq.prepare("SELECT *" " FROM qryhead" " WHERE (qryhead_id=:id);"); headq.bindValue(":id", p); headq.exec(); if (headq.first()) { _qryheadid = headq.value("qryhead_id").toInt(); _setName->setText(headq.value("qryhead_name").toString()); _setDescrip->setText(headq.value("qryhead_descrip").toString()); _setNotes->setPlainText(headq.value("qryhead_notes").toString()); sFillList(); } else { _qryheadid = -1; _setName->setText(""); _setDescrip->setText(""); _qryList->clear(); if (headq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), headq.lastError().text()); return; } } } void QuerySet::languageChange() { retranslateUi(this); } void QuerySet::sDelete() { if (_qryList->id() > 0 && QMessageBox::question(this, tr("Delete Query Item?"), tr("

    Are you sure you want to delete this Query " "Item from the Query Set?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::Yes) { XSqlQuery delq; delq.prepare("DELETE FROM qryitem WHERE qryitem_id=:id;"); delq.bindValue(":id", _qryList->id()); delq.exec(); if (delq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), delq.lastError().text()); return; } } } void QuerySet::sEdit() { if (_itemdlg) { _itemdlg->setParentId(_qryheadid); _itemdlg->setId(_qryList->id()); _itemdlg->show(); } } void QuerySet::sFillList() { XSqlQuery itemq; itemq.prepare("SELECT qryitem_id, qryitem_name, qryitem_order, qryitem_src," " qryitem_group," " REGEXP_REPLACE(qryitem_detail, E'\\n.*', '...')" " AS qryitem_detail," " qryitem_detail AS qryitem_detail_qttooltiprole" " FROM qryitem" " WHERE (qryitem_qryhead_id=:id)" " ORDER BY qryitem_order;"); itemq.bindValue(":id", _qryheadid); itemq.exec(); _qryList->populate(itemq); if (itemq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), itemq.lastError().text()); return; } } void QuerySet::sHandleButtons() { _save->setEnabled(! _setName->text().isEmpty()); } void QuerySet::sNew() { if (_qryheadid < 0) { if (QMessageBox::question(this, tr("Save First?"), tr("

    The Query Set has not yet been saved to " "the database. You must save it before adding " "queries.

    Would you like to save before " "continuing?

    "), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes) == QMessageBox::No || ! sSave(false)) return; } if (_itemdlg) { _itemdlg->setParentId(_qryheadid); _itemdlg->setId(-1); _itemdlg->show(); } } bool QuerySet::sSave(bool done) { XSqlQuery saveq; if (_qryheadid < 0) saveq.prepare("INSERT INTO qryhead (" " qryhead_name, qryhead_descrip, qryhead_notes" ") VALUES (" " :qryhead_name, :qryhead_descrip, :qryhead_notes" ") RETURNING qryhead_id;"); else { saveq.prepare("UPDATE qryhead SET" " qryhead_id=:qryhead_id," " qryhead_name=:qryhead_name," " qryhead_descrip=:qryhead_descrip," " qryhead_notes=:qryhead_notes" " WHERE qryhead_id=:qryhead_id" " RETURNING qryhead_id;"); saveq.bindValue(":qryhead_id", _qryheadid); } saveq.bindValue(":qryhead_name", _setName->text()); saveq.bindValue(":qryhead_descrip", _setDescrip->text()); saveq.bindValue(":qryhead_notes", _setNotes->toPlainText()); saveq.exec(); if (saveq.first()) _qryheadid = saveq.value("qryhead_id").toInt(); else if (saveq.lastError().type() != QSqlError::NoError) { QMessageBox::warning(this, tr("Database Error"), saveq.lastError().text()); return false; } emit saved(_qryheadid); if (done) { close(); emit closed(true); } return true; } // script exposure //////////////////////////////////////////////////////////// void QuerySetfromScriptValue(const QScriptValue &obj, QuerySet* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue QuerySettoScriptValue(QScriptEngine *engine, QuerySet* const &item) { return engine->newQObject(item); } QScriptValue constructQuerySet(QScriptContext *context, QScriptEngine *engine) { QuerySet *obj = 0; if (context->argumentCount() == 1 && (context->argument(0).toInt32() == 0 || qscriptvalue_cast(context->argument(0)))) { if (DEBUG) qDebug("constructQuerySet got a QWidget*"); obj = new QuerySet(qscriptvalue_cast(context->argument(0))); } else if (context->argumentCount() >= 2 && (context->argument(0).toInt32() == 0 || qscriptvalue_cast(context->argument(0)))) { if (DEBUG) qDebug("constructQuerySet got a QWidget* and an int"); obj = new QuerySet(qscriptvalue_cast(context->argument(0)), (Qt::WindowFlags)(context->argument(1).toInt32())); } return engine->toScriptValue(obj); } void setupQuerySet(QScriptEngine *engine) { qScriptRegisterMetaType(engine, QuerySettoScriptValue, QuerySetfromScriptValue); QScriptValue widget = engine->newFunction(constructQuerySet); engine->globalObject().setProperty("QuerySet", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/queryset.h000066400000000000000000000025701217451700100171160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef QUERYSET_H #define QUERYSET_H #include "widgets.h" #include #include #include #include "ui_queryset.h" #include "queryitem.h" class QuerySet : public QWidget, public Ui::QuerySet { Q_OBJECT public: QuerySet(QWidget* parent = 0, Qt::WindowFlags fl = 0); ~QuerySet(); Q_INVOKABLE virtual int id() const; public slots: virtual void setId(int p); signals: void closed(bool ok); void saved(int id); protected slots: virtual void languageChange(); virtual void sDelete(); virtual void sEdit(); virtual void sFillList(); virtual void sHandleButtons(); virtual void sNew(); virtual bool sSave(bool done = true); protected: MQLEdit *_mqledit; int _qryheadid; QueryItem *_itemdlg; SelectMQL *_selectmql; }; Q_DECLARE_METATYPE(QuerySet*); void setupQuerySet(QScriptEngine *engine); #endif // QUERYSET_H qt-client-4.1.0/widgets/queryset.ui000066400000000000000000000140221217451700100172770ustar00rootroot00000000000000 QuerySet 0 0 441 375 Query Set Name: _setName Description: _setDescrip Cancel false Save Qt::Vertical 20 0 Queries in this set: _qryList New false Edit Qt::Vertical QSizePolicy::Fixed 20 20 false Delete Qt::Vertical 20 40 Notes: XLabel QLabel
    xlabel.h
    XLineEdit QLineEdit
    xlineedit.h
    XTreeWidget QTreeWidget
    xtreewidget.h
    XTextEdit QTextEdit
    xtextedit.h
    _setName _setDescrip _qryList _qryNew _qryEdit _qryDelete _setNotes _save _cancel _cancel clicked() QuerySet close() 436 21 499 15 _qryList valid(bool) _qryEdit setEnabled(bool) 338 146 426 149 _qryList valid(bool) _qryDelete setEnabled(bool) 356 221 424 221
    qt-client-4.1.0/widgets/quoteList.cpp000066400000000000000000000116341217451700100175620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "quoteList.h" #include #include #include #include #include #include #include "xtreewidget.h" #include "warehousegroup.h" #include "quotecluster.h" #include "xsqlquery.h" quoteList::quoteList( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog( parent, fl ) { setObjectName(name ? name : "quoteList" ); setModal(modal); _quheadid = -1; _custid = -1; _openOnly = false; setWindowTitle(tr("Quotes")); QVBoxLayout *mainLayout = new QVBoxLayout(this); mainLayout->setContentsMargins(5, 5, 5, 5); mainLayout->setSpacing(5); mainLayout->setObjectName("mainLayout"); QVBoxLayout *warehouseLayout = new QVBoxLayout(); warehouseLayout->setObjectName("warehouseLayout"); QHBoxLayout *topLayout = new QHBoxLayout(); topLayout->setSpacing(7); topLayout->setObjectName("topLayout"); QVBoxLayout *buttonsLayout = new QVBoxLayout(); buttonsLayout->setSpacing(5); buttonsLayout->setObjectName("buttonsLayout"); QVBoxLayout *listLayout = new QVBoxLayout(); listLayout->setObjectName("listLayout"); _warehouse = new WarehouseGroup(this, "_warehouse"); warehouseLayout->addWidget(_warehouse); QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Preferred); warehouseLayout->addItem(spacer); topLayout->addLayout(warehouseLayout); QSpacerItem* spacer_2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); topLayout->addItem(spacer_2); _close = new QPushButton(tr("&Cancel"), this); _close->setObjectName("_close"); buttonsLayout->addWidget(_close); _select = new QPushButton(tr("&Select"), this); _select->setObjectName("_select"); _select->setEnabled( FALSE ); _select->setDefault( TRUE ); buttonsLayout->addWidget(_select); buttonsLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding)); topLayout->addLayout(buttonsLayout); mainLayout->addLayout(topLayout); QLabel *_quotesLit = new QLabel(tr("Quotes:"), this); _quotesLit->setObjectName("_quotesLit"); listLayout->addWidget(_quotesLit); _qu = new XTreeWidget(this); _qu->setObjectName("_qu"); listLayout->addWidget(_qu, 1); mainLayout->addLayout(listLayout, 1); resize( QSize(490, 390).expandedTo(minimumSizeHint()) ); connect( _close, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) ); connect( _qu, SIGNAL( itemSelected(int) ), _select, SLOT( animateClick() ) ); connect( _qu, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) ); connect( _warehouse, SIGNAL(updated()), this, SLOT( sFillList() ) ); _qu->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "quhead_number"); _qu->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name"); _qu->addColumn(tr("Ordered"), _dateColumn, Qt::AlignCenter,true, "quhead_quotedate"); _qu->addColumn(tr("Scheduled"),_dateColumn, Qt::AlignCenter,true, "duedate"); setTabOrder(_warehouse, _qu); setTabOrder(_qu, _select); setTabOrder(_select, _close); setTabOrder(_close, _warehouse); _warehouse->setFocus(); } void quoteList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("quhead_id", &valid); if (valid) _quheadid = param.toInt(); param = pParams.value("quoteType", &valid); if (valid) _type = param.toInt(); param = pParams.value("openOnly", &valid); if (valid) _openOnly = param.toBool(); param = pParams.value("cust_id", &valid); if (valid) _custid = param.toInt(); sFillList(); } void quoteList::sSelect() { done(_qu->id()); } void quoteList::sFillList() { QString sql; sql = "SELECT DISTINCT quhead_id, quhead_number, cust_name, quhead_quotedate," " MIN(quitem_scheddate) AS duedate " "FROM quhead, quitem, itemsite, custinfo " "WHERE ((quhead_cust_id=cust_id)" " AND (quitem_quhead_id=quhead_id)" " AND (quitem_itemsite_id=itemsite_id)"; if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; if (_custid != -1) sql += " AND (quhead_cust_id=:cust_id)"; if (_openOnly) sql += " AND (quhead_status='O')"; sql += ") " "GROUP BY quhead_id, quhead_number, cust_name, quhead_quotedate " "ORDER BY quhead_number;"; XSqlQuery q; q.prepare(sql); _warehouse->bindValue(q); q.bindValue(":cust_id", _custid); q.exec(); _qu->populate(q, _quheadid); } qt-client-4.1.0/widgets/quoteList.h000066400000000000000000000021441217451700100172230ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef quotelist_h #define quotelist_h #include #include "widgets.h" class WarehouseGroup; class QPushButton; class XTreeWidget; class ParameterList; class XTUPLEWIDGETS_EXPORT quoteList : public QDialog { Q_OBJECT public: quoteList( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); WarehouseGroup *_warehouse; QPushButton *_close; QPushButton *_select; XTreeWidget *_qu; public slots: virtual void set(const ParameterList & pParams); virtual void sSelect(); virtual void sFillList(); private: int _quheadid; int _type; int _custid; bool _openOnly; }; #endif qt-client-4.1.0/widgets/quotecluster.cpp000066400000000000000000000126471217451700100203350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "quotecluster.h" #include QuoteList::QuoteList(QWidget *pParent, Qt::WindowFlags flags) : VirtualList(pParent, flags) { setObjectName("QuoteList"); _listTab->headerItem()->setText(0, tr("Quote Number")); _listTab->headerItem()->setText(1, tr("Customer/Prospect")); } QuoteSearch::QuoteSearch(QWidget *pParent, Qt::WindowFlags flags) : VirtualSearch(pParent, flags) { setObjectName("QuoteSearch"); _listTab->headerItem()->setText(0, tr("Quote Number")); _listTab->headerItem()->setText(1, tr("Customer/Prospect")); } QuoteCluster::QuoteCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new QuoteLineEdit(this, pName)); } bool QuoteCluster::forCustomer() { return ((QuoteLineEdit*)_number)->forCustomer(); } bool QuoteCluster::forProspect() { return ((QuoteLineEdit*)_number)->forProspect(); } int QuoteCluster::recipId() { return ((QuoteLineEdit*)_number)->recipId(); } void QuoteLineEdit::sSearch() { QuoteSearch *newdlg = new QuoteSearch(this); if (newdlg) { int id = newdlg->exec(); if (id != QDialog::Rejected) setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__).arg(__LINE__), tr("Could not instantiate a Quote Search Dialog")); } QuoteLineEdit::QuoteLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "quhead", "quhead_id", "quhead_number", "name", "quhead_billtoname", 0, pName) { setTitles(tr("Quote"), tr("Quotes")); _query = QString("SELECT quhead_id AS id, quhead_number AS number," " COALESCE(cust_number, prospect_number, '?') AS name," " quhead_billtoname AS description," " quhead_cust_id AS recip_id," " CASE WHEN cust_number IS NOT NULL THEN 'C'" " WHEN prospect_number IS NOT NULL THEN 'P'" " END AS recip_type " "FROM quhead" " LEFT OUTER JOIN custinfo ON (quhead_cust_id=cust_id)" " LEFT OUTER JOIN prospect ON (quhead_cust_id=prospect_id) " "WHERE TRUE "); _recip_id = 0; _recip_type = QString::null; } void QuoteLineEdit::clear() { VirtualClusterLineEdit::clear(); _id = -1; _recip_id = 0; _recip_type = QString::null; } void QuoteLineEdit::silentSetId(const int pId) { if (pId == -1 || pId == 0) clear(); else { XSqlQuery idq; idq.prepare(_query + _idClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + QString(";")); idq.bindValue(":id", pId); idq.exec(); if (idq.first()) { _id = pId; _valid = true; setText(idq.value("number").toString()); _name = idq.value("name").toString(); _description = idq.value("description").toString(); _recip_id = idq.value("recip_id").toInt(); _recip_type = idq.value("recip_type").toString(); } else if (idq.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__).arg(__LINE__), idq.lastError().databaseText()); } _parsed = true; emit parsed(); } // TODO: can we get _recip_id and _recip_type using the inherited sParse()? void QuoteLineEdit::sParse() { if (! _parsed) { QString stripped = text().trimmed().toUpper(); if (stripped.length() == 0) { _parsed = true; setId(-1); } else { XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + QString(";")); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if (numQ.first()) { _valid = true; setId(numQ.value("id").toInt()); if (_hasName) _name = numQ.value("name").toString(); if (_hasDescription) _description = numQ.value("description").toString(); _recip_id = numQ.value("recip_id").toInt(); _recip_type = numQ.value("recip_type").toString(); } else { setId(-1); if (numQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), numQ.lastError().databaseText()); } } emit valid(_valid); emit parsed(); } _parsed = true; sHandleNullStr(); } bool QuoteLineEdit::forCustomer() { return (_recip_type == "C"); } bool QuoteLineEdit::forProspect() { return (_recip_type == "P"); } int QuoteLineEdit::recipId() { return _recip_id; } qt-client-4.1.0/widgets/quotecluster.h000066400000000000000000000030251217451700100177700ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _quoteCluster_h #define _quoteCluster_h #include "virtualCluster.h" class QuoteList : public VirtualList { Q_OBJECT public: QuoteList(QWidget *pParent, Qt::WindowFlags flags); }; class QuoteSearch : public VirtualSearch { Q_OBJECT public: QuoteSearch(QWidget *pParent, Qt::WindowFlags flags = 0); }; class QuoteLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: QuoteLineEdit(QWidget*, const char* = 0); Q_INVOKABLE virtual bool forCustomer(); Q_INVOKABLE virtual bool forProspect(); Q_INVOKABLE virtual int recipId(); public slots: virtual void sSearch(); protected slots: virtual void clear(); virtual void sParse(); protected: virtual void silentSetId(const int pId); int _recip_id; QString _recip_type; }; class XTUPLEWIDGETS_EXPORT QuoteCluster : public VirtualCluster { Q_OBJECT public: QuoteCluster(QWidget*, const char* = 0); Q_INVOKABLE bool forCustomer(); Q_INVOKABLE bool forProspect(); Q_INVOKABLE int recipId(); }; #endif qt-client-4.1.0/widgets/racluster.cpp000066400000000000000000000114641217451700100175760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "xsqlquery.h" #include "racluster.h" RaCluster::RaCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new RaLineEdit(this, pName)); connect(_number, SIGNAL(numberChanged(const QString &)), this, SIGNAL(numberChanged(const QString &))); } RaLineEdit::RaStatuses RaCluster::allowedStatuses() const { return ((RaLineEdit*)_number)->allowedStatuses(); } void RaCluster::setAllowedStatuses(const RaLineEdit::RaStatuses p) { ((RaLineEdit*)_number)->setAllowedStatuses(p); } bool RaCluster::isClosed() const { return ((RaLineEdit*)_number)->isClosed(); } bool RaCluster::isOpen() const { return ((RaLineEdit*)_number)->isOpen(); } RaLineEdit::RaStatus RaCluster::status() const { return ((RaLineEdit*)_number)->status(); } // LineEdit /////////////////////////////////////////////////////////////////// RaLineEdit::RaLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "rahead", "rahead_id", "rahead_number", "rahead_billtoname", 0, pName) { setTitles(tr("Return Authorization"), tr("Return Authorizations")); setUiName("returnAuthorization"); setEditPriv("MaintainReturns"); setViewPriv("ViewReturns"); setValidator(new QIntValidator(0, 9999999, this)); connect(this, SIGNAL(textChanged(const QString &)), this, SIGNAL(numberChanged(const QString &))); } RaLineEdit::RaStatuses RaLineEdit::allowedStatuses() const { return _statuses; } void RaLineEdit::setId(const int pId) { if ((_x_preferences) && (pId != -1)) { if (_x_preferences->boolean("selectedSites")) { QString msql("SELECT raitem_id " "FROM raitem, itemsite " "WHERE ((raitem_rahead_id=) " " AND (raitem_itemsite_id=itemsite_id) " " AND (itemsite_warehous_id NOT IN (" " SELECT usrsite_warehous_id " " FROM usrsite " " WHERE (usrsite_username=getEffectiveXtUser())))) " "UNION " "SELECT raitem_id " "FROM raitem, itemsite " "WHERE ((raitem_rahead_id=) " " AND (raitem_coitem_itemsite_id=itemsite_id) " " AND (itemsite_warehous_id NOT IN (" " SELECT usrsite_warehous_id " " FROM usrsite " " WHERE (usrsite_username=getEffectiveXtUser()))));"); MetaSQLQuery mql(msql); ParameterList params; params.append("rahead_id", pId); XSqlQuery chk = mql.toQuery(params); if (chk.first()) { QMessageBox::critical(this, tr("Access Denied"), tr("You may not view or edit this Return Authorization as it references " "a warehouse for which you have not been granted privileges.")) ; VirtualClusterLineEdit::setId(-1); } else VirtualClusterLineEdit::setId(pId); } else VirtualClusterLineEdit::setId(pId); } else VirtualClusterLineEdit::setId(pId); } void RaLineEdit::setAllowedStatuses(const RaStatuses p) { if (p & (Open | Closed) || p == 0) clearExtraClause(); else if (p & Open) setExtraClause(" AND EXISTS ( SELECT raitem_id " " FROM ratiem " " WHERE ((raitem_status='O') " " AND (raitem_rahead_id=rahead_id)) "); else if (p & Closed) setExtraClause(" AND NOT EXISTS ( SELECT raitem_id " " FROM ratiem " " WHERE ((raitem_status='O') " " AND (raitem_rahead_id=rahead_id)) "); else clearExtraClause(); _statuses = p; } bool RaLineEdit::isClosed() const { return _description == "C"; } bool RaLineEdit::isOpen() const { return _description == "O"; } RaLineEdit::RaStatus RaLineEdit::status() const { if (_description == "C") return Closed; else if (_description == "O") return Open; else return AnyStatus; } // List /////////////////////////////////////////////////////////////////////// RaList::RaList(QWidget *pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { _listTab->headerItem()->setData(1, Qt::DisplayRole, tr("Disposition")); _listTab->headerItem()->setData(2, Qt::DisplayRole, tr("Status")); } qt-client-4.1.0/widgets/racluster.h000066400000000000000000000032731217451700100172420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _raCluster_h #define _raCluster_h #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT RaLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: RaLineEdit(QWidget*, const char* = 0); enum RaStatus { AnyStatus = 0x00, Open = 0x01, Closed = 0x02 }; Q_DECLARE_FLAGS(RaStatuses, RaStatus) virtual RaStatuses allowedStatuses() const; virtual void setAllowedStatuses(const RaStatuses); virtual bool isClosed() const; virtual bool isOpen() const; virtual RaStatus status() const; signals: void numberChanged(const QString &); public slots: virtual void setId(const int pId); protected: RaStatuses _statuses; }; class XTUPLEWIDGETS_EXPORT RaCluster : public VirtualCluster { Q_OBJECT public: RaCluster(QWidget*, const char* = 0); virtual RaLineEdit::RaStatuses allowedStatuses() const; virtual void setAllowedStatuses(const RaLineEdit::RaStatuses p); virtual bool isClosed() const; virtual bool isOpen() const; virtual RaLineEdit::RaStatus status() const; signals: void numberChanged(const QString &); }; class XTUPLEWIDGETS_EXPORT RaList : public VirtualList { Q_OBJECT public: RaList(QWidget*, Qt::WindowFlags = 0); }; #endif qt-client-4.1.0/widgets/recurrencewidget.cpp000066400000000000000000000733021217451700100211320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "recurrencewidget.h" #include #include #include #include #include "xsqlquery.h" #include "storedProcErrorLookup.h" #define DEBUG false /** \class RecurrenceWidget \brief The RecurrenceWidget gives the %user a unified interface for telling the system how often certain %events occur. In general recurrences are stored in the recur table, but this is not required. Two basic values describe a recurrence:
    • The period is the time unit of measure (hour, day, month).
    • The frequency is the number of periods between recurrences.
    A recurrence with the period set to W (= week) and frequency of 3 will repeat once every three weeks. To add a new kind of recurring event or %item, you need to change data in the database, stored procedures, triggers, and application code. We'll use Invoice in the examples here, with 'I' as the internal code value, even though %invoices already use this mechanism (xTuple ERP 3.5.1 and later). Add a column to the parent table to track the recurrence parent/child relationship. The column name must follow this pattern: \c [tablename]_recurring_[tablename]_id , e.g. \c invchead_recurring_invchead_id : \code ALTER TABLE invchead ADD COLUMN invchead_recurring_invchead_id INTEGER; COMMENT ON COLUMN invchead.invchead_recurring_invchead_id IS 'The first invchead record in the series if this is a recurring Invoice. If the invchead_recurring_invchead_id is the same as the invchead_id, this record is the first in the series.'; \endcode Add a RecurrenceWidget to the .ui for the window that will maintain data of this type (e.g. invoice.ui). Initialize the widget in the window's constructor: \code _recur->setParent(-1, 'I'); \endcode Update the widget again when the window gets an id for the object. This usually happens in either the %set(), %save(), or %sSave() method for new objects, depending on the class, and in %populate() when editing existing objects: \code // cNew case in invoice::set() _recur->setParent(_invcheadid, 'I'); ... // invoice::populate() _recur->setParent(q.value("invchead_recurring_invchead_id").toInt(), "I"); \endcode Ask the %user how to handle existing recurrences before saving the data and before starting a transaction. getChangePolicy will return RecurrenceWidget::NoPolicy) if the %user chooses to cancel. Then when preparing to insert or update the main record, make sure to set the recurrence parentage. Finally, after the insert/update, save the recurrence and check for errors: \code bool %save() { // error checking RecurrenceWidget::ChangePolicy cp = _recur->getChangePolicy(); if (cp == RecurrenceWidget::NoPolicy) return false; XSqlQuery beginq("BEGIN;"); XSqlQuery qry; ... // set up qry to insert or update if (_recur->isRecurring()) qry.bindValue(":invchead_recurring_invchead_id", _recur->parentId()); ... // execute the insert/update ... QString errmsg; if (! _recur->save(true, cp, &errmsg)) { rollbackq.exec(); systemError(this, errmsg, __FILE__, __LINE__); return false; } ... // finish processing XSqlQuery commitq("COMMIT;"); return true; } \endcode To maintain the recurrence relationships, there must be a function that copies an existing record based on its id and gives the copy a different timestamp or date. It must have a function signature like one of these:
    1. copy[tablename](INTEGER, TIMESTAMP WITH TIME ZONE)
    2. copy[tablename](INTEGER, TIMESTAMP WITHOUT TIME ZONE)
    3. copy[tablename](INTEGER, DATE)
    The copy function can take additional arguments as well, but they will be ignored by the recurrence maintenance functions. The data type of each argument must be listed in the recurtype table's recurtype_copyargs column (see below) so the appropriate casting can be done for the date or timestamp and an appropriate number of NULL arguments can be passed. The copy function must copy the \c [tablename]_recurring_[tablename]_id column. There can be a function to delete records of this type as well. If there is one, it must accept a single integer id of the record to delete. Add a row to the recurtype table to describe how the recurrence stored procedures interact with the events/items of this type ('I' == Invoice). \code INSERT INTO recurtype (recurtype_type, recurtype_table, recurtype_donecheck, recurtype_schedcol, recurtype_limit, recurtype_copyfunc, recurtype_copyargs, recurtype_delfunc ) VALUES ('I', 'invchead', 'invchead_posted', 'invchead_invcdate', NULL, 'copyinvoice', '{integer,date}', 'deleteinvoice'); \endcode If there isn't a delete function, set the recurtype_delfunc to NULL. Existing records will be deleted when necessary with an SQL DELETE statement. The DELETE trigger on the table should clean up the recurrence information: \code CREATE OR REPLACE FUNCTION _invcheadBeforeTrigger() RETURNS "trigger" AS $$ DECLARE _recurid INTEGER; _newparentid INTEGER; BEGIN IF (TG_OP = 'DELETE') THEN -- after other stuff not having to do with recurrence SELECT recur_id INTO _recurid FROM recur WHERE ((recur_parent_id=OLD.invchead_id) AND (recur_parent_type='I')); IF (_recurid IS NOT NULL) THEN SELECT invchead_id INTO _newparentid FROM invchead WHERE ((invchead_recurring_invchead_id=OLD.invchead_id) AND (invchead_id!=OLD.invchead_id)) ORDER BY invchead_invcdate LIMIT 1; IF (_newparentid IS NULL) THEN DELETE FROM recur WHERE recur_id=_recurid; ELSE UPDATE recur SET recur_parent_id=_newparentid WHERE recur_id=_recurid; UPDATE invchead SET invchead_recurring_invchead_id=_newparentid WHERE invchead_recurring_invchead_id=OLD.invchead_id AND invchead_id!=OLD.invchead_id; END IF; END IF; RETURN OLD; END IF; RETURN NEW; END; $$ LANGUAGE 'plpgsql'; \endcode \todo Simplify this so the developer of a new recurring item/event doesn't have to work so hard. There should be a way to (1) have the recurrence widget update the [tablename]_recurring_[tablename]_id column when saving the recurrence (this would save a couple of lines) and (2) there should be a way to simplify or eliminate the code in the DELETE triggers. Some of this stuff really belongs in an AFTER trigger instead of a before trigger. \see _invcheadBeforeTrigger \see copyInvoice \see createRecurringItems \see deleteInvoice \see deleteOpenRecurringItems \see invoice \see openRecurringItems \see recur \see recurtype \see splitRecurrence */ /* TODO: Add properties to set minimum/maximum periods? (e.g. it doesn't make sense for invoicing to recur hourly). The enum value Custom is intended for use by cases like Recur every Tuesday and Thursday Recur 1st of every month Recur every January and July It would be nice to have drag-n-drop using iCalendar (IETF RFC 5545) but this will have to be associated with the To-do or calendar item, not just the recurrence widget. */ RecurrenceWidget::RecurrenceWidget(QWidget *parent, const char *pName) : QWidget(parent) { setupUi(this); if(pName) setObjectName(pName); setMinPeriod(Minutely); if (minPeriod() < Weekly) _period->setCode("W"); _dates->setStartCaption(tr("From:")); _dates->setEndCaption(tr("Until:")); _dates->setStartNull(tr("Today"), QDate::currentDate(), true); setStartDateVisible(false); setEndTimeVisible(false); setStartTimeVisible(false); setMaxVisible(true); if (_x_preferences) { XSqlQuery eotq("SELECT endOfTime() AS eot;"); if (eotq.first()) { _eot = QDateTime(eotq.value("eot").toDate(), QTime(23, 59, 59, 999)); _dates->setEndNull(tr("Forever"), _eot.date(), true); } else qWarning("RecurrenceWidget could not get endOfTime()"); } _dates->setEndNull(tr("Forever"), _eot.date(), true); if (! _eot.isValid()) _eot = QDateTime(QDate(2100,12,31), QTime(23, 59, 59, 999)); clear(); } RecurrenceWidget::~RecurrenceWidget() { } void RecurrenceWidget::languageChange() { } /** \brief Set the RecurrenceWidget to its default state. */ void RecurrenceWidget::clear() { set(false, 1, "W", QDateTime::currentDateTime(), _eot, 1); _id = -1; _prevParentId = -1; _prevParentType = ""; _parentId = -1; _parentType = ""; } /** \brief Convert a string representation of the period to a RecurrencePeriod. This is used to convert between the values stored in the recur table and the enumerated values used internally by the RecurrenceWidget. It also accepts human-readable values, such as "Minutes" and "Hours". \param p The recur_period or human-readable period name to convert. This is case-sensitive. Currently accepted values are m or Minutes, H or Hours, D or Days, W or Weeks, M or Months, Y or Years, C or Custom. If current translation includes the period names, the translations are also accepted. \return The RecurrencePeriod that matches the input or Never if no match was found. */ RecurrenceWidget::RecurrencePeriod RecurrenceWidget::stringToPeriod(QString p) const { if (p == "m" || p == "Minutes" || p == tr("Minutes")) return Minutely; else if (p == "H" || p == "Hours" || p == tr("Hours") ) return Hourly; else if (p == "D" || p == "Days" || p == tr("Days") ) return Daily; else if (p == "W" || p == "Weeks" || p == tr("Weeks") ) return Weekly; else if (p == "M" || p == "Months" || p == tr("Months") ) return Monthly; else if (p == "Y" || p == "Years" || p == tr("Years") ) return Yearly; else if (p == "C" || p == "Custom" || p == tr("Custom") ) return Custom; else return Never; } /** \brief Return the date the recurrence is set to end. */ QDate RecurrenceWidget::endDate() const { return _dates->endDate(); } /** \brief Return the date and time the recurrence is set to end. */ QDateTime RecurrenceWidget::endDateTime() const { return QDateTime(_dates->endDate(), _endTime->time()); } /** \brief Return the time of day the recurrence is set to end. */ QTime RecurrenceWidget::endTime() const { return _endTime->time(); } /** \brief Return whether the end date field is visible. */ bool RecurrenceWidget::endDateVisible() const { return _dates->endVisible(); } /** \brief Return whether the end time field is visible. */ bool RecurrenceWidget::endTimeVisible() const { return _endTime->isVisible(); } /** \brief Return the frequency (number of periods) the recurrence is set to run. */ int RecurrenceWidget::frequency() const { return _frequency->value(); } RecurrenceWidget::RecurrenceChangePolicy RecurrenceWidget::getChangePolicy() { if (DEBUG) qDebug("%s::getChangePolicy() entered with id %d type %s", qPrintable(objectName()), _parentId, qPrintable(_parentType)); if (! modified()) return IgnoreFuture; RecurrenceChangePolicy ans; XSqlQuery futureq; futureq.prepare("SELECT openRecurringItems(:parent_id, :parent_type," " NULL) AS open;"); futureq.bindValue(":parent_id", _parentId); futureq.bindValue(":parent_type", _parentType); futureq.exec(); if (futureq.first()) { int open = futureq.value("open").toInt(); if (open < 0) { QMessageBox::critical(this, tr("Processing Error"), storedProcErrorLookup("openRecurringItems", open)); return NoPolicy; } else if (open == 0) return ChangeFuture; } else if (futureq.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("Database Error"), futureq.lastError().text()); return NoPolicy; } switch (QMessageBox::question(this, tr("Change Open Events?"), tr("

    This event is part of a recurring " "series. Do you want to change all open " "events in this series?"), QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes)) { case QMessageBox::Yes: ans = ChangeFuture; break; case QMessageBox::No: ans = IgnoreFuture; break; case QMessageBox::Cancel: default: ans = NoPolicy; break; }; return ans; } bool RecurrenceWidget::isRecurring() const { return _recurring->isChecked(); } int RecurrenceWidget::max() const { return _max->value(); } bool RecurrenceWidget::maxVisible() const { return _max->isVisible(); } RecurrenceWidget::RecurrencePeriod RecurrenceWidget::minPeriod() const { return (RecurrencePeriod)_period->id(0); } bool RecurrenceWidget::modified() const { if (DEBUG) qDebug() << "recurring:" << isRecurring() << _prevRecurring << "\n" << "period:" << period() << _prevPeriod << "\n" << "frequency:" << frequency() << _prevFrequency << "\n" << "startDateTime:" << startDateTime()<< _prevStartDateTime << "\n" << "endDateTime:" << endDateTime() << _prevEndDateTime << "\n" << "max:" << max() << _prevMax << "\n" << "_parentId:" << _parentId << _prevParentId << "\n" << "_parentType:" << _parentType << _prevParentType ; bool returnVal = (isRecurring() != _prevRecurring || period() != _prevPeriod || frequency() != _prevFrequency || startDateTime() != _prevStartDateTime|| endDateTime() != _prevEndDateTime || max() != _prevMax || _parentId != _prevParentId || _parentType != _prevParentType); return returnVal; } int RecurrenceWidget::parentId() const { return _parentId; } QString RecurrenceWidget::parentType() const { return _parentType; } RecurrenceWidget::RecurrencePeriod RecurrenceWidget::period() const { return (RecurrencePeriod)(_period->id()); } QString RecurrenceWidget::periodCode() const { return _period->code(); } bool RecurrenceWidget::save(bool externaltxn, RecurrenceChangePolicy cp, QString *message) { if (! message) message = new QString(); if (DEBUG) qDebug("%s::save(%d, %d, %p) entered with id %d type %s", qPrintable(objectName()), externaltxn, cp, message, _parentId, qPrintable(_parentType)); if (! modified()) return true; if (_parentId < 0 || _parentType.isEmpty()) { *message = tr("Could not save Recurrence information. The " "parent object/event has not been set."); if (! externaltxn) QMessageBox::warning(this, tr("Missing Data"), *message); else qWarning("%s", qPrintable(*message)); return false; } if (! externaltxn && cp == NoPolicy) { cp = getChangePolicy(); if (cp == NoPolicy) return false; } else if (externaltxn && cp == NoPolicy) { *message = tr("You must choose how open events are to be handled"); qWarning("%s", qPrintable(*message)); return false; } XSqlQuery rollbackq; if (! externaltxn) { XSqlQuery beginq("BEGIN;"); rollbackq.prepare("ROLLBACK;"); } XSqlQuery recurq; if (isRecurring()) { if (_id > 0) { if (cp == ChangeFuture) { XSqlQuery futureq; futureq.prepare("SELECT splitRecurrence(:parent_id, :parent_type," " :splitdate) AS newrecurid;"); futureq.bindValue(":parent_id", _parentId); futureq.bindValue(":parent_type", _parentType); futureq.bindValue(":splitdate", startDate()); futureq.exec(); if (futureq.first()) { int result = futureq.value("newrecurid").toInt(); if (result > 0) { _id = result; futureq.prepare("SELECT recur_parent_id" " FROM recur" " WHERE recur_id=:recur_id;"); futureq.bindValue(":recur_id", _id); futureq.exec(); if (futureq.first()) _parentId = futureq.value("recur_parent_id").toInt(); } else if (result < 0) { *message = storedProcErrorLookup("splitRecurrence", result); if (! externaltxn) { rollbackq.exec(); QMessageBox::warning(this, tr("Processing Error"), *message); } else qWarning("%s", qPrintable(*message)); return false; } } // one check for potentially 2 queries if (futureq.lastError().type() != QSqlError::NoError) { *message = futureq.lastError().text(); if (! externaltxn) { rollbackq.exec(); QMessageBox::warning(this, tr("Database Error"), *message); } else qWarning("%s", qPrintable(*message)); return false; } } recurq.prepare("UPDATE recur SET" " recur_parent_id=:recur_parent_id," " recur_parent_type=UPPER(:recur_parent_type)," " recur_period=:recur_period," " recur_freq=:recur_freq," " recur_start=:recur_start," " recur_end=:recur_end," " recur_max=:recur_max" " WHERE (recur_id=:recurid)" " RETURNING recur_id;"); recurq.bindValue(":recurid", _id); } else { recurq.prepare("INSERT INTO recur (" " recur_parent_id, recur_parent_type," " recur_period, recur_freq," " recur_start, recur_end," " recur_max" ") VALUES (" " :recur_parent_id, UPPER(:recur_parent_type)," " :recur_period, :recur_freq," " :recur_start, :recur_end," " :recur_max" ") RETURNING recur_id;"); } recurq.bindValue(":recur_parent_id", _parentId); recurq.bindValue(":recur_parent_type", _parentType); recurq.bindValue(":recur_period", periodCode()); recurq.bindValue(":recur_freq", frequency()); recurq.bindValue(":recur_start", startDateTime()); if (endDate() < _eot.date()) recurq.bindValue(":recur_end", endDateTime()); recurq.bindValue(":recur_max", max()); recurq.exec(); if (recurq.first()) { _id = recurq.value("recur_id").toInt(); _prevParentId = _parentId; _prevParentType = _parentType; _prevEndDateTime = endDateTime(); _prevFrequency = frequency(); _prevMax = max(); _prevPeriod = period(); _prevRecurring = isRecurring(); _prevStartDateTime = startDateTime(); } } else // ! isRecurring() { recurq.prepare("DELETE FROM recur" " WHERE ((recur_parent_id=:recur_parent_id)" " AND (UPPER(recur_parent_type)=UPPER(:recur_parent_type)));"); recurq.bindValue(":recur_parent_id", _parentId); recurq.bindValue(":recur_parent_type", _parentType); recurq.exec(); } if (recurq.lastError().type() != QSqlError::NoError) { *message = recurq.lastError().text(); if (! externaltxn) { rollbackq.exec(); QMessageBox::warning(this, tr("Database Error"), *message); } else qWarning("%s", qPrintable(*message)); return false; } if (cp == ChangeFuture) { int procresult = -1; QString procname = "deleteOpenRecurringItems"; XSqlQuery cfq; cfq.prepare("SELECT deleteOpenRecurringItems(:parentId, :parentType," " :splitdate, FALSE) AS result;"); cfq.bindValue(":parentId", _parentId); cfq.bindValue(":parentType", _parentType); cfq.bindValue(":splitdate", startDate()); cfq.exec(); if (cfq.first()) { procresult = cfq.value("result").toInt(); if (procresult >= 0) { QString procname = "createOpenRecurringItems"; cfq.prepare("SELECT createRecurringItems(:parentId, :parentType)" " AS result;"); cfq.bindValue(":parentId", _parentId); cfq.bindValue(":parentType", _parentType); cfq.exec(); if (cfq.first()) procresult = cfq.value("result").toInt(); } } // error handling for either 1 or 2 queries so not elseif // check cfq.lastError() first to avoid misreporting db errs as -1 if (cfq.lastError().type() != QSqlError::NoError) { *message = cfq.lastError().text(); if (! externaltxn) { rollbackq.exec(); QMessageBox::critical(this, tr("Database Error"), *message); } else qWarning("%s", qPrintable(*message)); return false; } else if (procresult < 0) { *message = storedProcErrorLookup(procname, procresult); if (! externaltxn) { rollbackq.exec(); QMessageBox::critical(this, tr("Processing Error"), *message); } else qWarning("%s", qPrintable(*message)); return false; } } if (! externaltxn) XSqlQuery commitq("COMMIT;"); return true; } void RecurrenceWidget::set(bool recurring, int frequency, QString period, QDate startDate, QDate endDate, int max) { if (DEBUG) qDebug() << objectName() << "::set(" << recurring << ", " << frequency << ", " << period << ", " << startDate << ", " << endDate << ", " << max << ") entered"; // run from the beginning of the start date to the end of the end date QDateTime startDateTime(startDate); QDateTime endDateTime(endDate.addDays(1)); endDateTime = endDateTime.addMSecs(-1); set(recurring, frequency, period, startDateTime, endDateTime, max); } void RecurrenceWidget::set(bool recurring, int frequency, QString period, QDateTime start, QDateTime end, int max) { if (DEBUG) qDebug() << objectName() << "::set(" << recurring << ", " << frequency << ", " << period << ", " << start << ", " << end << ", " << max << ") entered"; setRecurring(recurring); setPeriod(period); setFrequency(frequency); setStartDateTime(start); setEndDateTime(end); setMax(max); _prevEndDateTime = end.isValid() ? end : _eot ; _prevFrequency = frequency; _prevPeriod = stringToPeriod(period); _prevRecurring = recurring; _prevStartDateTime = start; _prevMax = max; } void RecurrenceWidget::setEndDate(QDate p) { _dates->setEndDate(p.isValid() ? p : _eot.date()); _endTime->setTime(QTime(23, 59, 59, 999)); } void RecurrenceWidget::setEndDateTime(QDateTime p) { if (DEBUG) qDebug("setEndDateTime(%s) entered, valid = %d", qPrintable(p.toString()), p.isValid()); if (p.isValid()) { _dates->setEndDate(p.date()); _endTime->setTime(p.time()); } else setEndDateTime(_eot); } void RecurrenceWidget::setEndDateVisible(bool p) { _dates->setEndVisible(p); } void RecurrenceWidget::setEndTime(QTime p) { _endTime->setTime(p); } void RecurrenceWidget::setEndTimeVisible(bool p) { _endTime->setVisible(p); } void RecurrenceWidget::setFrequency(int p) { _frequency->setValue(p); } void RecurrenceWidget::setMax(int p) { _max->setValue(p); } void RecurrenceWidget::setMaxVisible(bool p) { _max->setVisible(p); _maxLit->setVisible(p); } void RecurrenceWidget::setMinPeriod(RecurrencePeriod min) { _period->clear(); // fall through all cases in the switch switch (min) { default: // case Never: _period->append(Never, tr("Never"), ""); case Minutely: _period->append(Minutely, tr("Minutes"), "m"); case Hourly: _period->append(Hourly, tr("Hours"), "H"); case Daily: _period->append(Daily, tr("Days"), "D"); case Weekly: _period->append(Weekly, tr("Weeks"), "W"); case Monthly: _period->append(Monthly, tr("Months"), "M"); case Yearly: _period->append(Yearly, tr("Years"), "Y"); //case Custom: _period->append(Custom, tr("Custom"), "C"); } } bool RecurrenceWidget::setParent(int pid, QString ptype) { _parentId = pid; _parentType = ptype; XSqlQuery recurq; recurq.prepare("SELECT *" " FROM recur" " WHERE ((recur_parent_id=:parentid)" " AND (recur_parent_type=UPPER(:parenttype)));"); recurq.bindValue(":parentid", pid); recurq.bindValue(":parenttype", ptype); recurq.exec(); if (recurq.first()) { set(true, recurq.value("recur_freq").toInt(), recurq.value("recur_period").toString(), recurq.value("recur_start").toDateTime(), recurq.value("recur_end").toDateTime(), recurq.value("recur_max").toInt()); _id = recurq.value("recur_id").toInt(); _prevParentId = _parentId; _prevParentType = _parentType; return true; } else if (recurq.lastError().type() != QSqlError::NoError) QMessageBox::warning(this, tr("Database Error"), recurq.lastError().text()); else { clear(); _parentId = pid; _parentType = ptype; } return false; } void RecurrenceWidget::setPeriod(RecurrencePeriod p) { _period->setId((int)p); } void RecurrenceWidget::setPeriod(QString p) { _period->setCode(p); } void RecurrenceWidget::setRecurring(bool p) { _recurring->setChecked(p); } void RecurrenceWidget::setStartDate(QDate p) { _dates->setStartDate(p.isValid() ? p : QDate::currentDate()); _startTime->setTime(QTime(0, 0)); } void RecurrenceWidget::setStartDateTime(QDateTime p) { if (p.isValid()) { _dates->setStartDate(p.date()); _startTime->setTime(p.time()); } else setStartDate(QDate::currentDate()); } void RecurrenceWidget::setStartDateVisible(bool p) { _dates->setStartVisible(p); } void RecurrenceWidget::setStartTime(QTime p) { _startTime->setTime(p); } void RecurrenceWidget::setStartTimeVisible(bool p) { _startTime->setVisible(p); } QDate RecurrenceWidget::startDate() const { return _dates->startDate(); } QDateTime RecurrenceWidget::startDateTime() const { return QDateTime(_dates->startDate(), _startTime->time()); } bool RecurrenceWidget::startDateVisible() const { return _dates->startVisible(); } QTime RecurrenceWidget::startTime() const { return _startTime->time(); } bool RecurrenceWidget::startTimeVisible() const { return _startTime->isVisible(); } // scripting exposure ///////////////////////////////////////////////////////// QScriptValue RecurrenceWidgettoScriptValue(QScriptEngine *engine, RecurrenceWidget* const &item) { return engine->newQObject(item); } void RecurrenceWidgetfromScriptValue(const QScriptValue &obj, RecurrenceWidget* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructRecurrenceWidget(QScriptContext *context, QScriptEngine *engine) { QWidget *parent = (qscriptvalue_cast(context->argument(0))); const char *objname = "_recurrenceWidget"; if (context->argumentCount() > 1) objname = context->argument(1).toString().toAscii().data(); return engine->toScriptValue(new RecurrenceWidget(parent, objname)); } void setupRecurrenceWidget(QScriptEngine *engine) { QScriptValue::PropertyFlags stdflags = QScriptValue::ReadOnly | QScriptValue::Undeletable; qScriptRegisterMetaType(engine, RecurrenceWidgettoScriptValue, RecurrenceWidgetfromScriptValue); QScriptValue constructor = engine->newFunction(constructRecurrenceWidget); engine->globalObject().setProperty("RecurrenceWidget", constructor, stdflags); constructor.setProperty("Never", QScriptValue(engine, RecurrenceWidget::Never), stdflags); constructor.setProperty("Minutely",QScriptValue(engine, RecurrenceWidget::Minutely), stdflags); constructor.setProperty("Hourly", QScriptValue(engine, RecurrenceWidget::Hourly), stdflags); constructor.setProperty("Daily", QScriptValue(engine, RecurrenceWidget::Daily), stdflags); constructor.setProperty("Weekly", QScriptValue(engine, RecurrenceWidget::Weekly), stdflags); constructor.setProperty("Monthly", QScriptValue(engine, RecurrenceWidget::Monthly), stdflags); constructor.setProperty("Yearly", QScriptValue(engine, RecurrenceWidget::Yearly), stdflags); constructor.setProperty("Custom", QScriptValue(engine, RecurrenceWidget::Custom), stdflags); constructor.setProperty("NoPolicy", QScriptValue(engine, RecurrenceWidget::NoPolicy), stdflags); constructor.setProperty("IgnoreFuture", QScriptValue(engine, RecurrenceWidget::IgnoreFuture), stdflags); constructor.setProperty("ChangeFuture", QScriptValue(engine, RecurrenceWidget::ChangeFuture), stdflags); } qt-client-4.1.0/widgets/recurrencewidget.h000066400000000000000000000114351217451700100205760ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef RECURRENCEWIDGET_H #define RECURRENCEWIDGET_H #include "widgets.h" #include "ui_recurrencewidget.h" class QScriptEngine; void setupRecurrenceWidget(QScriptEngine *engine); class RecurrenceWidget : public QWidget, public Ui::RecurrenceWidget { Q_OBJECT Q_ENUMS(RecurrencePeriod) Q_ENUMS(RecurrenceChangePolicy) Q_PROPERTY(bool maxVisible READ maxVisible WRITE setMaxVisible DESIGNABLE false) Q_PROPERTY(bool endTimeVisible READ endTimeVisible WRITE setEndTimeVisible) Q_PROPERTY(bool endDateVisible READ endDateVisible WRITE setEndDateVisible) Q_PROPERTY(RecurrencePeriod minPeriod READ minPeriod WRITE setMinPeriod) Q_PROPERTY(bool startDateVisible READ startDateVisible WRITE setStartDateVisible) Q_PROPERTY(bool startTimeVisible READ startTimeVisible WRITE setStartTimeVisible) public: // Never must = XComboBox::id() when ! XComboBox::isValid() enum RecurrencePeriod { Never = -1, Minutely, Hourly, Daily, Weekly, Monthly, Yearly, Custom }; enum RecurrenceChangePolicy { NoPolicy = -1, IgnoreFuture, ChangeFuture }; RecurrenceWidget(QWidget* parent = 0, const char* name = 0); ~RecurrenceWidget(); Q_INVOKABLE virtual QDate endDate() const; Q_INVOKABLE virtual QDateTime endDateTime() const; Q_INVOKABLE virtual QTime endTime() const; Q_INVOKABLE virtual bool endDateVisible() const; Q_INVOKABLE virtual bool endTimeVisible() const; Q_INVOKABLE virtual int frequency() const; Q_INVOKABLE virtual RecurrenceChangePolicy getChangePolicy(); Q_INVOKABLE virtual bool isRecurring() const; Q_INVOKABLE virtual int max() const; /*useprop*/ virtual bool maxVisible() const; Q_INVOKABLE virtual RecurrencePeriod minPeriod() const; Q_INVOKABLE virtual bool modified() const; Q_INVOKABLE virtual int parentId() const; Q_INVOKABLE virtual QString parentType() const; Q_INVOKABLE virtual RecurrencePeriod period() const; Q_INVOKABLE virtual QString periodCode() const; Q_INVOKABLE virtual QDate startDate() const; Q_INVOKABLE virtual QDateTime startDateTime() const; /*useprop*/ virtual bool startDateVisible() const; Q_INVOKABLE virtual QTime startTime() const; Q_INVOKABLE virtual bool startTimeVisible() const; Q_INVOKABLE virtual RecurrencePeriod stringToPeriod(QString p) const; public slots: virtual void clear(); virtual bool save(bool intxn, RecurrenceChangePolicy cp, QString *msg = 0); virtual void set(bool recurring = false, int frequency = 1, QString period = QString("W"), QDate startDate = QDate::currentDate(), QDate endDate = QDate(), int max = 1); virtual void set(bool recurring, int frequency, QString period, QDateTime startDateTime, QDateTime endDateTime, int max); virtual void setEndDate(QDate p); virtual void setEndDateTime(QDateTime p); virtual void setEndDateVisible(bool p); virtual void setEndTime(QTime p); virtual void setEndTimeVisible(bool p); virtual void setFrequency(int p); virtual void setMax(int p); virtual void setMaxVisible(bool p); virtual void setMinPeriod(RecurrencePeriod minPeriod); virtual bool setParent(int pid, QString ptype); virtual void setPeriod(RecurrencePeriod p); virtual void setPeriod(QString p); virtual void setRecurring(bool p); virtual void setStartDate(QDate p); virtual void setStartDateTime(QDateTime p); virtual void setStartDateVisible(bool p); virtual void setStartTime(QTime p); virtual void setStartTimeVisible(bool p); protected slots: virtual void languageChange(); protected: QDateTime _eot; int _id; int _parentId; QString _parentType; QDateTime _prevEndDateTime; int _prevFrequency; int _prevMax; int _prevParentId; QString _prevParentType; RecurrencePeriod _prevPeriod; bool _prevRecurring; QDateTime _prevStartDateTime; private: }; Q_DECLARE_METATYPE(RecurrenceWidget*) #endif // RECURRENCEWIDGET_H qt-client-4.1.0/widgets/recurrencewidget.ui000066400000000000000000000104251217451700100207620ustar00rootroot00000000000000 RecurrenceWidget 0 0 372 191 Schedule Recurring Event 0 0 0 Recurring true false Every: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _frequency Qt::Horizontal 0 20 Qt::StrongFocus Create no more than: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter _max 1 Qt::Vertical 13 8 DateCluster QWidget

    datecluster.h
    XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    XSpinBox QSpinBox
    xspinbox.h
    _recurring _frequency _period _dates qt-client-4.1.0/widgets/revisionCluster.cpp000066400000000000000000000267761217451700100210060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "revisioncluster.h" QString RevisionLineEdit::typeText() { return _typeText; } RevisionCluster::RevisionCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { setLabel("Revision: "); addNumberWidget(new RevisionLineEdit(this, pName)); _description->show(); connect(_number, SIGNAL(modeChanged()), this, SLOT(sModeChanged())); connect(_number, SIGNAL(canActivate(bool)), this, SLOT(sCanActivate(bool))); } void RevisionCluster::activate() { return (static_cast(_number)->activate()); } void RevisionCluster::sCanActivate(bool p) { emit canActivate(p); } void RevisionCluster::setActive() { return (static_cast(_number))->setActive(); } void RevisionCluster::setMode(QString pmode) { return (static_cast(_number))->setMode(pmode); } void RevisionCluster::setMode(RevisionLineEdit::Modes pmode) { return (static_cast(_number))->setMode(pmode); } void RevisionCluster::setTargetId(int ptargetid) { return (static_cast(_number))->setTargetId(ptargetid); } void RevisionCluster::setType(QString ptype) { return (static_cast(_number))->setType(ptype); } void RevisionCluster::setType(RevisionLineEdit::RevisionTypes ptype) { return (static_cast(_number))->setType(ptype); } void RevisionCluster::sModeChanged() { bool canSearch = false; if (_x_privileges) { if (_x_metrics->boolean("RevControl")) { canSearch = ((RevisionLineEdit::View==(static_cast(_number))->mode()) && (_x_privileges->check("ViewInactiveRevisions") || _x_privileges->check("MaintainRevisions"))) || ((RevisionLineEdit::Use==(static_cast(_number))->mode()) && _x_privileges->check("UseInactiveRevisions")) || ((RevisionLineEdit::Maintain==(static_cast(_number))->mode()) && (_x_privileges->check("MaintainRevisions") || _x_privileges->check("ViewInactiveRevisions"))); (static_cast(_number))->setDisabled(((RevisionLineEdit::Maintain==(static_cast(_number))->mode()) && !_x_privileges->check("MaintainRevisions")) || ((RevisionLineEdit::Use==(static_cast(_number))->mode()) || (RevisionLineEdit::View==(static_cast(_number))->mode()))); } else (static_cast(_number))->setEnabled(TRUE); static_cast(_number)->_listAct->setEnabled(canSearch); static_cast(_number)->_searchAct->setEnabled(canSearch); static_cast(_number)->sUpdateMenu(); } } RevisionLineEdit::RevisionLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "rev", "rev_id", "rev_number", "rev_status", QString("case when rev_status='A' then '%1' when rev_status='P' then '%2' else '%3' end ").arg(tr("Active")).arg(tr("Pending")).arg(tr("Inactive")).toAscii(), 0, pName), _allowNew(false), _isRevControl(false), _mode(View), _type(All), _targetId(-1), _cachenum(""), _typeText(""), _status(Inactive), _activateSep(0), _activateAct(0) { setTitles(tr("Revision"), tr("Revisions")); if (_x_metrics) { _isRevControl=(_x_metrics->boolean("RevControl")); if (!_isRevControl) { _menuLabel->hide(); disconnect(this, SIGNAL(textEdited(QString)), this, SLOT(sHandleCompleter())); _listAct->disconnect(); _searchAct->disconnect(); } else { _activateSep = new QAction(this); _activateSep->setSeparator(true); _activateSep->setVisible(false); _activateAct = new QAction(tr("Activate"), this); _activateAct->setToolTip(tr("Activate revision")); _activateAct->setVisible(false); connect(_activateAct, SIGNAL(triggered()), this, SLOT(activate())); addAction(_activateAct); menu()->addAction(_activateSep); menu()->addAction(_activateAct); } } } RevisionLineEdit::RevisionTypes RevisionCluster::type() { return (static_cast(_number))->type(); } RevisionLineEdit::RevisionTypes RevisionLineEdit::type() { return _type; } RevisionLineEdit::Modes RevisionCluster::mode() { return (static_cast(_number))->mode(); } RevisionLineEdit::Modes RevisionLineEdit::mode() { return _mode; } RevisionLineEdit::Statuses RevisionLineEdit::status() { return _status; } void RevisionLineEdit::activate() { if (QMessageBox::question(this, tr("Activate Revision"), tr("This action will make this revision the system default for the" "item it belongs to and deactivate the currently active revision. " "Are you sure you want proceed?"), QMessageBox::Yes, QMessageBox::No | QMessageBox::Escape | QMessageBox::Default) == QMessageBox::No) return; XSqlQuery activate; activate.prepare("SELECT activateRev(:rev_id) AS result;"); activate.bindValue(":rev_id", id()); activate.exec(); if (activate.first()) setId(_id); // refresh else if (activate.lastError().type() != QSqlError::NoError) { QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), activate.lastError().databaseText()); return; } } void RevisionLineEdit::setMode(Modes pMode) { if (_mode!=pMode) { _mode = pMode; if (_x_privileges) _allowNew=((pMode=Maintain) && (_x_privileges->check("MaintainRevisions"))); emit modeChanged(); } } void RevisionLineEdit::setMode(QString pmode) { if (pmode == "View") setMode(View); else if (pmode == "Use") setMode(Use); else if (pmode == "Maintain") setMode(Maintain); else { QMessageBox::critical(this, tr("Invalid Mode"), tr("RevisionLineEdit::setMode received " "an invalid Mode %1").arg(pmode)); setMode(View); } } void RevisionLineEdit::setActive() { if (_isRevControl) { XSqlQuery revision; revision.prepare( "SELECT getActiveRevId(:target_type,:target_id) AS rev_id;" ); revision.bindValue(":target_type", typeText()); revision.bindValue(":target_id", _targetId); revision.exec(); if (revision.first()) { setId(revision.value("rev_id").toInt()); } else { setId(-1); } } } void RevisionLineEdit::setId(const int pId) { VirtualClusterLineEdit::setId(pId); _cachenum = text(); if (_name == "A") _status = Active; else if (_name == "P") _status = Pending; else _status = Inactive; if (_x_privileges) emit canActivate((_mode==Maintain) && (_x_privileges->check("MaintainRevisions")) && (_status==Pending)); } void RevisionLineEdit::setTargetId(int pItem) { if (_isRevControl) { _targetId = pItem; setExtraClause(QString(" ((rev_target_type='%1') AND (rev_target_id=%2)) ").arg(typeText()).arg(pItem)); setActive(); } } void RevisionLineEdit::setType(QString ptype) { if (ptype == "BOM") setType(BOM); else if (ptype == "BOO") setType(BOO); else { QMessageBox::critical(this, tr("Invalid Revision Type"), tr("RevisionLineEdit::setType received " "an invalid RevisionType %1").arg(ptype)); setType(All); } } void RevisionLineEdit::sUpdateMenu() { VirtualClusterLineEdit::sUpdateMenu(); if (_x_privileges && _activateSep && _activateAct) { if((_mode==Maintain) && (_status==Pending)) { _activateSep->setVisible(true); _activateAct->setVisible(true); _activateAct->setEnabled(_x_privileges->check("MaintainRevisions")); } else { _activateSep->setVisible(false); _activateAct->setVisible(false); } } } void RevisionLineEdit::setType(RevisionTypes pType) { _type = pType; switch (pType) { case BOM: _typeText="BOM"; break; case BOO: _typeText="BOO"; break; default: _typeText="All"; break; } } void RevisionLineEdit::sParse() { if ((_isRevControl) && (!_parsed)) { _parsed = TRUE; QString stripped = text().trimmed().toUpper(); if (stripped.length() == 0) { setId(-1); } else { XSqlQuery numQ; numQ.prepare("SELECT rev_id " "FROM rev " "WHERE ((rev_number=UPPER(:number))" " AND (rev_target_id=:target_id)" " AND (rev_target_type=:target_type));"); numQ.bindValue(":number", stripped); numQ.bindValue(":target_id",_targetId); numQ.bindValue(":target_type",typeText()); numQ.exec(); if (numQ.first()) { _valid = true; setId(numQ.value("rev_id").toInt()); } else { if (_allowNew) { if (QMessageBox::question(this, tr("Create New Revision?"), tr("Revision does not exist. Would you like to create a new one from the current active revision?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape) == QMessageBox::Yes) { XSqlQuery newrev; if (_type==BOM) newrev.prepare("SELECT createBomRev(:target_id,:revision) AS result;"); else if (_type==BOO) newrev.prepare("SELECT createBooRev(:target_id,:revision) AS result;"); newrev.bindValue(":target_id", _targetId); newrev.bindValue(":revision", text()); newrev.exec(); if (newrev.first()) setId(newrev.value("result").toInt()); else { setText(_cachenum); if (newrev.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), newrev.lastError().databaseText()); } } else setText(_cachenum); } else { setText(_cachenum); if (numQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), numQ.lastError().databaseText()); } } } } emit valid(_valid); emit parsed(); } qt-client-4.1.0/widgets/revisioncluster.h000066400000000000000000000052611217451700100204750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __REVISIONCLUSTER_H__ #define __REVISIONCLUSTER_H__ #include "widgets.h" #include "xlineedit.h" #include #include #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT RevisionLineEdit : public VirtualClusterLineEdit { Q_OBJECT friend class RevisionCluster; Q_ENUMS(Modes) Q_ENUMS(RevisionTypes) Q_PROPERTY(Modes mode READ mode WRITE setMode ) Q_PROPERTY(RevisionTypes type READ type WRITE setType ) public: RevisionLineEdit(QWidget *, const char * = 0); enum Modes { View, Use, Maintain }; enum RevisionTypes { All, BOM, BOO }; enum Statuses { Active, Pending, Inactive }; virtual Modes mode(); virtual RevisionTypes type(); virtual QString typeText(); virtual Statuses status(); protected slots: virtual void setId(const int); virtual void sParse(); virtual void sUpdateMenu(); public slots: void activate(); void setActive(); void setMode(QString); void setMode(Modes); void setTargetId(int pItem); void setType(QString); void setType(RevisionTypes); private: bool _allowNew; bool _isRevControl; enum Modes _mode; enum RevisionTypes _type; int _targetId; QString _cachenum; QString _typeText; Statuses _status; QAction *_activateSep; QAction *_activateAct; signals: void canActivate(bool); void modeChanged(); }; class XTUPLEWIDGETS_EXPORT RevisionCluster : public VirtualCluster { Q_OBJECT Q_ENUMS(RevisionLineEdit::Modes) Q_ENUMS(RevisionLineEdit::RevisionTypes) Q_PROPERTY(RevisionLineEdit::Modes mode READ mode WRITE setMode ) Q_PROPERTY(RevisionLineEdit::RevisionTypes type READ type WRITE setType ) public: RevisionCluster(QWidget *, const char * = 0); virtual RevisionLineEdit::Modes mode(); virtual RevisionLineEdit::RevisionTypes type(); private slots: void sModeChanged(); void sCanActivate(bool p); void setActive(); public slots: void activate(); virtual void setMode(QString); virtual void setMode(RevisionLineEdit::Modes); virtual void setType(QString); virtual void setType(RevisionLineEdit::RevisionTypes); virtual void setTargetId(int pItem); signals: void canActivate(bool); }; #endif qt-client-4.1.0/widgets/salesOrderList.cpp000066400000000000000000000147321217451700100205320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "salesOrderList.h" #include #include #include #include #include #include #include "xtreewidget.h" #include "warehousegroup.h" #include "xsqlquery.h" salesOrderList::salesOrderList( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog(parent, fl) { setObjectName(name ? name : "salesOrderList"); setModal(modal); _soheadid = -1; _type = (cSoOpen | cSoClosed | cSoReleased); setWindowTitle(tr("Sales Orders")); QVBoxLayout *mainLayout = new QVBoxLayout(this); QVBoxLayout *warehouseLayout = new QVBoxLayout(0); QHBoxLayout *topLayout = new QHBoxLayout(0); QVBoxLayout *buttonsLayout = new QVBoxLayout(0); QVBoxLayout *listLayout = new QVBoxLayout(0); mainLayout->setContentsMargins(5, 5, 5, 5); warehouseLayout->setContentsMargins(0, 0, 0, 0); topLayout->setContentsMargins(0, 0, 0, 0); buttonsLayout->setContentsMargins(0, 0, 0, 0); listLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setSpacing(5); warehouseLayout->setSpacing(0); topLayout->setSpacing(7); buttonsLayout->setSpacing(5); listLayout->setSpacing(0); _warehouse = new WarehouseGroup(this, "_warehouse"); warehouseLayout->addWidget(_warehouse); QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Preferred); warehouseLayout->addItem(spacer); topLayout->addLayout(warehouseLayout); QSpacerItem* spacer_2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); topLayout->addItem(spacer_2); _close = new QPushButton(tr("&Cancel"), this); _close->setObjectName("_close"); buttonsLayout->addWidget(_close); _select = new QPushButton(tr("&Select"), this); _select->setObjectName("_select"); _select->setEnabled( FALSE ); _select->setDefault( TRUE ); buttonsLayout->addWidget(_select); buttonsLayout->addSpacerItem(new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding)); topLayout->addLayout(buttonsLayout); mainLayout->addLayout(topLayout); QLabel *_salesOrdersLit = new QLabel(tr("Sales Orders:"), this); _salesOrdersLit->setObjectName("_salesOrdersLit"); listLayout->addWidget(_salesOrdersLit); _so = new XTreeWidget(this); _so->setObjectName("_so"); listLayout->addWidget(_so, 1); mainLayout->addLayout(listLayout, 1); resize( QSize(490, 390).expandedTo(minimumSizeHint()) ); connect( _close, SIGNAL( clicked() ), this, SLOT( reject() ) ); connect( _select, SIGNAL( clicked() ), this, SLOT( sSelect() ) ); connect( _so, SIGNAL( itemSelected(int) ), _select, SLOT( animateClick() ) ); connect( _so, SIGNAL( valid(bool) ), _select, SLOT( setEnabled(bool) ) ); connect( _warehouse, SIGNAL(updated()), this, SLOT( sFillList() ) ); _so->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "cohead_number"); _so->addColumn(tr("Customer"), -1, Qt::AlignLeft, true, "cust_name"); _so->addColumn(tr("P/O #"), _orderColumn, Qt::AlignLeft, true, "cohead_custponumber"); _so->addColumn(tr("Ordered"), _dateColumn, Qt::AlignCenter,true, "cohead_orderdate"); _so->addColumn(tr("Scheduled"),_dateColumn, Qt::AlignCenter,true, "duedate"); setTabOrder(_warehouse, _so); setTabOrder(_so, _select); setTabOrder(_select, _close); setTabOrder(_close, _warehouse); _warehouse->setFocus(); } void salesOrderList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("sohead_id", &valid); if (valid) _soheadid = param.toInt(); param = pParams.value("soType", &valid); if (valid) _type = param.toInt(); param = pParams.value("cust_id", &valid); if (valid) _custid = param.toInt(); sFillList(); } void salesOrderList::sSelect() { done(_so->id()); } void salesOrderList::sFillList() { QString sql; if (_type == cSoAtShipping) { sql = "SELECT DISTINCT cohead_id, cohead_number, cust_name, cohead_custponumber," " cohead_orderdate," " MIN(coitem_scheddate) AS duedate " "FROM shiphead, shipitem, cohead, coitem, itemsite, custinfo " "WHERE ((cohead_cust_id=cust_id)" " AND (coitem_cohead_id=cohead_id)" " AND (coitem_itemsite_id=itemsite_id)" " AND (shipitem_orderitem_id=coitem_id)" " AND (shipitem_shiphead_id=shiphead_id)" " AND (shiphead_order_type='SO')" " AND (NOT shiphead_shipped)"; if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ") " "GROUP BY cohead_id, cohead_number, cust_name," " cohead_custponumber, cohead_orderdate " "ORDER BY cohead_number;"; } else { bool statusCheck = FALSE; sql = "SELECT DISTINCT cohead_id, cohead_number, cust_name, cohead_custponumber," " cohead_orderdate," " MIN(coitem_scheddate) AS duedate " "FROM cohead, coitem, itemsite, custinfo " "WHERE ((cohead_cust_id=cust_id)" " AND (coitem_status <> 'X')" " AND (coitem_cohead_id=cohead_id)" " AND (coitem_itemsite_id=itemsite_id)"; if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += "AND ("; if (_type & cSoOpen) { sql += "(coitem_status='O')"; statusCheck = TRUE; } if (_type & cSoClosed) { if (statusCheck) sql += " OR "; sql += "(coitem_status='C')"; statusCheck = TRUE; } if (_type & cSoReleased) { if (statusCheck) sql += " AND "; sql += "(cohead_holdtype='N')"; statusCheck = TRUE; } if (_type & cSoCustomer) { if (statusCheck) sql += " AND "; sql += "(cohead_cust_id=:cust_id)"; } sql += ")) " "GROUP BY cohead_id, cohead_number, cust_name," " cohead_custponumber, cohead_orderdate " "ORDER BY cohead_number;"; } XSqlQuery q; q.prepare(sql); _warehouse->bindValue(q); q.bindValue(":cust_id", _custid); q.exec(); _so->populate(q, _soheadid); } qt-client-4.1.0/widgets/salesOrderList.h000066400000000000000000000024701217451700100201730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef salesorderlist_h #define salesorderlist_h #include #include "widgets.h" class WarehouseGroup; class QPushButton; class XTreeWidget; class ParameterList; // Possible Customer Order Status #define cSoOpen 0x01 #define cSoClosed 0x02 #define cSoAtShipping 0x04 #define cSoReleased 0x08 #define cSoCustomer 0x16 class XTUPLEWIDGETS_EXPORT salesOrderList : public QDialog { Q_OBJECT public: salesOrderList( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); WarehouseGroup *_warehouse; QPushButton *_close; QPushButton *_select; XTreeWidget *_so; public slots: virtual void set(const ParameterList & pParams); virtual void sSelect(); virtual void sFillList(); private: int _soheadid; int _type; int _custid; }; #endif qt-client-4.1.0/widgets/screen.cpp000066400000000000000000000236311217451700100170500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "screen.h" #include #include #include #include #include #include #include #include Screen::Screen(QWidget *parent) : QWidget(parent) { _keyColumns=1; _lock=false; _locked=false; _mode=Edit; _shown=false; _key=0; _model = new XSqlTableModel; _mapper = new XDataWidgetMapper; connect(_mapper, SIGNAL(currentIndexChanged(int)), this, SIGNAL(currentIndexChanged(int))); } Screen::~Screen() { unlock(); } Screen::Disposition Screen::check() { if (isDirty()) { if (QMessageBox::question(this, tr("Unsaved work"), tr("You have made changes that have not been saved. Would you like an opportunity to save your work?"), QMessageBox::Yes | QMessageBox::Default, QMessageBox::No ) == QMessageBox::Yes) return Save; else return Cancel; } else if (_mode == New) return Cancel; return NoChanges; } /* When the widget is first shown, set up table mappings if they exist*/ void Screen::showEvent(QShowEvent *event) { if(!_shown) { _shown = true; setTable(_schemaName, _tableName); } QWidget::showEvent(event); } Screen::Modes Screen::mode() { return _mode; } bool Screen::cancel() { switch (check()) { case Save: return false; case Cancel: revertRow(currentIndex()); return true; default: //No Change return true; } } bool Screen::isDirty() { if (_mode==New) //If New and nothing has been changed yet on new row, it's not really dirty { for (int i = 0; _mapper->model() && i < _mapper->model()->columnCount(); i++) if (_mapper->mappedWidgetAt(i)) { QString def = _mapper->mappedWidgetAt(i)->property(_mapper->mappedDefaultName(_mapper->mappedWidgetAt(i))).toString(); QString cur = _mapper->mappedWidgetAt(i)->property(_mapper->mappedPropertyName(_mapper->mappedWidgetAt(i))).toString(); if (!def.isEmpty() || !cur.isEmpty()) if (def != cur) return true; } } else if(_mode == View) { return false; } else //Use usual technique to determine if edits occured { for (int c = 0; c < _model->columnCount(); c++) if (_model->isDirty(_model->index(currentIndex(),c))) return true; } return false; } bool Screen::submit() { bool isSaved; disconnect(_mapper, SIGNAL(currentIndexChanged(int)), this, SIGNAL(currentIndexChanged(int))); int i=_mapper->currentIndex(); _mapper->submit(); // Make sure changes committed even if user hasn't tabbed off widget isSaved=_model->submitAll(); // Apply to the database _mapper->setCurrentIndex(i); if (!isSaved) { if(!throwScriptException(_model->lastError().databaseText())) QMessageBox::critical(this, tr("Error Saving %1").arg(_tableName), tr("Error saving %1 at %2::%3\n\n%4") .arg(_tableName).arg(__FILE__).arg(__LINE__) .arg(_model->lastError().databaseText())); } connect(_mapper, SIGNAL(currentIndexChanged(int)), this, SIGNAL(currentIndexChanged(int))); return isSaved; } bool Screen::throwScriptException(const QString &message) { QObject *ancestor = this; QScriptEngine *engine = 0; for ( ; ancestor; ancestor = ancestor->parent()) { engine = ancestor->findChild(); if (engine) break; } if (engine) { QScriptContext *ctx = engine->currentContext(); ctx->throwError(message); return true; } return false; } /* Build a uinque key, then attempt to lock on postgres */ bool Screen::tryLock() { if (locked()) unlock(); if (!lockRecords()) return false; if (_model && _mode != View) { QStringList keys; QSqlIndex idx=_model->primaryKey(); // Build a unique key string by concatenating primary key table name and column values keys.insert(0,idx.name()); for (int i = 0; i < idx.count(); ++i) keys.insert(i+1,_model->data(_model->index(currentIndex(),i)).toString()); // Convert to a uinque 128 bit number QString qkey = QMd5(keys.join(";")); // Have to get this number <= 64 bits. qkey.resize(15); bool ok; _key = qkey.toLongLong(&ok,16); if (!ok) qDebug("Conversion to LongLong failed"); // Split 64 bit key in two integers by shifting 32 bits to the right int upper = _key >> 32; int lower = _key; XSqlQuery lockQuery; lockQuery.prepare("SELECT tryLock(:upper,:lower) AS result;"); lockQuery.bindValue(":upper", upper); lockQuery.bindValue(":lower", lower); lockQuery.exec(); if (lockQuery.first()) _locked = lockQuery.value("result").toBool(); setWidgetsEnabled(_locked && _mode != View); if (!_locked) { _key = 0; QMessageBox::information(this, tr("Record locked"), tr("This record is currently in use by another user. It will be opened in view mode.")); } } emit lockGranted(_locked); return _locked; } int Screen::currentIndex() { return _mapper->currentIndex(); } void Screen::deleteCurrent() { if (!locked()) { removeCurrent(); save(); } else QMessageBox::information(this, tr("Record locked"), tr("This record is currently in use by another user. It may not be edited or deleted at this time.")); } void Screen::clear() { unlock(); _mapper->clear(); } void Screen::insert() { unlock(); if (_mapper->model()) { _mapper->model()->insertRows(_model->rowCount(),1); _mapper->toLast(); _mapper->clear(); } } void Screen::loadAll() { _model->loadAll(); if (_model->rowCount()) { _mapper->toFirst(); tryLock(); } } void Screen::newMappedWidget(QWidget *widget) { widget->setEnabled(_mode != View); } void Screen::removeCurrent() { unlock(); removeRows(_mapper->currentIndex(),1); } void Screen::removeRows(int row, int count) { _mapper->model()->removeRows(row, count); } void Screen::revert() { _mapper->revert(); emit reverted(currentIndex()); } void Screen::revertAll() { _model->revertAll(); emit revertedAll(); } void Screen::revertRow(int row) { _model->revertRow(row); } void Screen::save() { if (locked()) return; if (submit()) { emit saved(); if (_mode==New) insert(); } } void Screen::search(QString criteria) { QString filter; if (criteria.trimmed().length()) { QStringList parts; for (int i = 0; i < _model->columnCount(); i++) { if (_model->headerData(i,Qt::Horizontal,Qt::DisplayRole).toString().length()) parts.append("(CAST(" + _model->headerData(i,Qt::Horizontal,Qt::DisplayRole).toString() + " AS TEXT) ~* '" + criteria + "')"); } filter=parts.join(" OR "); } setFilter(filter); select(); } void Screen::select() { _model->select(); if (_model->rowCount()) { _mapper->toFirst(); tryLock(); } } void Screen::setLockRecords(bool lock) { if (primaryKeyColumns()) _lock = lock; else _lock = false; } void Screen::setMode(Modes p) { if (_mode == p) return; unlock(); _mode = p; if (_mode == New) insert(); if (_mode == Edit) tryLock(); else setWidgetsEnabled(_mode != View); } void Screen::setModel(XSqlTableModel *model) { _model=model; _model->setKeys(_keyColumns); _model->setEditStrategy(QSqlTableModel::OnManualSubmit); setDataWidgetMapper(_model); emit newModel(_model); } void Screen::setSortColumn(QString p) { _sortColumn = p; } void Screen::setCurrentIndex(int index) { _mode=Screen::Edit; _mapper->setCurrentIndex(index); if (lockRecords()) tryLock(); } void Screen::toNext() { if (_mapper->currentIndex() < _model->rowCount()-1) { _mapper->toNext(); if (lockRecords()) tryLock(); } } void Screen::toPrevious() { if (_mapper->currentIndex() > 0) { _mapper->toPrevious(); if (lockRecords()) tryLock(); } } void Screen::setSchemaName(QString schema) { _schemaName = schema; } void Screen::setTableName(QString table) { _tableName = table; } /* Pass in a schema name and a table name. If schema name is blank, it will be ignored. If there is a table name to set, data widget mappings will be set as well. */ void Screen::setTable(QString schema, QString table) { if (table.length()) { QString tablename=""; if (schema.length()) tablename=schema + "."; tablename+=table; if (_model->tableName() != tablename) { _model->setTable(tablename,_keyColumns); _model->setEditStrategy(QSqlTableModel::OnManualSubmit); setDataWidgetMapper(_model); emit newModel(_model); } } } void Screen::setDataWidgetMapper(XSqlTableModel *model) { _mapper->setModel(model); emit newDataWidgetMapper(_mapper); } void Screen::setWidgetsEnabled(bool enabled) { for (int i = 0; _mapper->model() && i < _mapper->model()->columnCount(); i++) if (_mapper->mappedWidgetAt(i)) _mapper->mappedWidgetAt(i)->setEnabled(enabled); } void Screen::unlock() { if (!locked()) return; if (_key) { int upper = _key >> 32; int lower = _key; XSqlQuery unlock; unlock.prepare("SELECT pg_advisory_unlock(:upper, :lower);"); unlock.bindValue(":upper", upper); unlock.bindValue(":lower", lower); unlock.exec(); _key = 0; } _locked = false; setWidgetsEnabled(_mode != View); emit lockGranted(false); } qt-client-4.1.0/widgets/screen.h000066400000000000000000000105661217451700100165200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef SCREEN_H #define SCREEN_H #include "widgets.h" #include "xdatawidgetmapper.h" #include "xsqltablemodel.h" #include #include #include #include #include class XTUPLEWIDGETS_EXPORT Screen : public QWidget { Q_OBJECT Q_ENUMS(Modes) Q_ENUMS(SearchTypes) Q_ENUMS(Disposition) Q_PROPERTY (QString schemaName READ schemaName WRITE setSchemaName) Q_PROPERTY (QString tableName READ tableName WRITE setTableName) Q_PROPERTY (int primaryKeyColumns READ primaryKeyColumns WRITE setPrimaryKeyColumns) Q_PROPERTY (Modes mode READ mode WRITE setMode) Q_PROPERTY (bool lockRecords READ lockRecords WRITE setLockRecords); public: Screen(QWidget * = 0); ~Screen(); bool throwScriptException(const QString &message); enum Modes { New, Edit, View }; enum Disposition { NoChanges, Save, Cancel }; Modes mode(); Q_INVOKABLE bool submit(); Q_INVOKABLE bool locked() { return _locked;} Q_INVOKABLE bool lockRecords() { return _lock;} Q_INVOKABLE Disposition check(); Q_INVOKABLE XDataWidgetMapper *mapper() { return _mapper;} Q_INVOKABLE XSqlTableModel *model() { return _model;} void showEvent ( QShowEvent * event ); public slots: bool cancel(); bool isDirty(); bool tryLock(); int currentIndex(); int primaryKeyColumns() const { return _keyColumns; } QString filter() const { return _model->filter(); } QString schemaName() const { return _schemaName; } QString sortColumn() const { return _sortColumn; } QString tableName() const { return _tableName; } void clear(); void deleteCurrent(); void insert(); void loadAll(); void newMappedWidget(QWidget *widget); void removeCurrent(); void removeRows(int row, int count); void revert(); void revertAll(); void revertRow(int row); void toNext(); void toPrevious(); void save(); void search(QString criteria); void select(); void setCurrentIndex(int index); void setFilter(QString filter) { _model->setFilter(filter); } void setLockRecords(bool lock); void setModel(XSqlTableModel *model); void setMode(Modes p); void setPrimaryKeyColumns(int count) { _keyColumns = count; } void setSchemaName(QString schema); void setSortColumn(QString p); void setTableName(QString table); void setTable(QString schema, QString table); void setDataWidgetMapper(XSqlTableModel *model); void setWidgetsEnabled(bool enabled); void unlock(); signals: void currentIndexChanged(int index); void lockGranted(bool); void newDataWidgetMapper(XDataWidgetMapper *mapper); void newModel(XSqlTableModel *model); void saved(); void revertedAll(); void reverted(int index); private: bool _shown; enum Modes _mode; int _keyColumns; bool _lock; bool _locked; qint64 _key; QString _schemaName; QString _sortColumn; QString _tableName; XDataWidgetMapper* _mapper; XSqlTableModel* _model; }; #endif // SCREEN_H qt-client-4.1.0/widgets/shiftCluster.cpp000066400000000000000000000015411217451700100202440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shiftcluster.h" ShiftCluster::ShiftCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new ShiftClusterLineEdit(this, pName)); } ShiftClusterLineEdit::ShiftClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "shift", "shift_id", "shift_number", "shift_name", 0, 0, pName) { setTitles(tr("Shift"), tr("Shifts")); } qt-client-4.1.0/widgets/shiftcluster.h000066400000000000000000000015131217451700100177500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _shiftCluster_h #define _shiftCluster_h #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT ShiftClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: ShiftClusterLineEdit(QWidget*, const char* = 0); }; class XTUPLEWIDGETS_EXPORT ShiftCluster : public VirtualCluster { Q_OBJECT public: ShiftCluster(QWidget*, const char* = 0); }; #endif qt-client-4.1.0/widgets/shipmentCluster.cpp000066400000000000000000000157461217451700100207720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "shipmentcluster.h" #include ShipmentCluster::ShipmentCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new ShipmentClusterLineEdit(this, pName)); } // should limitToOrder and removeOrderLimit be at the lineedit level? void ShipmentCluster::limitToOrder(const int head_id) { if (head_id > 0) { switch (static_cast(_number)->type()) { case ShipmentClusterLineEdit::SalesOrder: setExtraClause(QString(" ((shiphead_order_id=%1)" "AND (shiphead_order_type='SO')) ").arg(head_id)); break; case ShipmentClusterLineEdit::TransferOrder: setExtraClause(QString(" ((shiphead_order_id=%1)" "AND (shiphead_order_type='TO')) ").arg(head_id)); break; case ShipmentClusterLineEdit::All: default: setExtraClause(QString(" (shiphead_order_id=%1) ").arg(head_id)); break; } switch (static_cast(_number)->status()) { case ShipmentClusterLineEdit::Shipped: if (!extraClause().isEmpty()) setExtraClause(extraClause().append(" AND ")); setExtraClause(extraClause().append(" (shiphead_shipped = TRUE) ")); break; case ShipmentClusterLineEdit::Unshipped: if (!extraClause().isEmpty()) setExtraClause(extraClause().append(" AND ")); setExtraClause(extraClause().append(" (shiphead_shipped = FALSE) ")); break; case ShipmentClusterLineEdit::AllStatus: default: // do nothing; break; } } // else // removeOrderLimit(); } void ShipmentCluster::setId(const int pid) { // removeOrderLimit(); static_cast(_number)->setId(pid); } void ShipmentCluster::removeOrderLimit() { ShipmentClusterLineEdit::ShipmentType type = static_cast(_number)->type(); clearExtraClause(); setType(type); ShipmentClusterLineEdit::ShipmentStatus status = static_cast(_number)->status(); clearExtraClause(); setStatus(status); } void ShipmentClusterLineEdit::setId(const int pid) { //setType(All); VirtualClusterLineEdit::setId(pid); } ShipmentClusterLineEdit::ShipmentType ShipmentCluster::type() { return (static_cast(_number))->type(); } void ShipmentCluster::setType(QString ptype) { return (static_cast(_number))->setType(ptype); } void ShipmentCluster::setType(ShipmentClusterLineEdit::ShipmentType ptype) { return (static_cast(_number))->setType(ptype); } ShipmentClusterLineEdit::ShipmentStatus ShipmentCluster::status() { return (static_cast(_number))->status(); } void ShipmentCluster::setStatus(QString pstatus) { return (static_cast(_number))->setStatus(pstatus); } void ShipmentCluster::setStatus(ShipmentClusterLineEdit::ShipmentStatus pstatus) { return (static_cast(_number))->setStatus(pstatus); } ShipmentClusterLineEdit::ShipmentClusterLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "shiphead", "shiphead_id", "shiphead_number", "formatdate(shiphead_shipdate)", "shiphead_tracknum", 0, pName) { _type = All; _status = AllStatus; setStrict(false); setType(SalesOrder); setStatus(Shipped); setTitles(tr("Shipment"), tr("Shipments")); } ShipmentClusterLineEdit::ShipmentType ShipmentClusterLineEdit::type() { return _type; } void ShipmentClusterLineEdit::setType(ShipmentType ptype) { if (ptype != _type) { switch (ptype) { case All: clearExtraClause(); break; case SalesOrder: setExtraClause(" (shiphead_order_type='SO') "); break; case TransferOrder: setExtraClause(" (shiphead_order_type='TO') "); break; default: QMessageBox::critical(this, tr("Invalid Shipment Type"), tr("

    ShipmentClusterLineEdit::setType received " "an invalid ShipmentType %1").arg(ptype)); return; break; } } _type = ptype; } void ShipmentClusterLineEdit::setType(QString ptype) { if (ptype == "SO") setType(SalesOrder); else if (ptype == "TO") setType(TransferOrder); else { QMessageBox::critical(this, tr("Invalid Shipment Type"), tr("ShipmentClusterLineEdit::setType received " "an invalid ShipmentType %1").arg(ptype)); setType(All); } } ShipmentClusterLineEdit::ShipmentStatus ShipmentClusterLineEdit::status() { return _status; } void ShipmentClusterLineEdit::setStatus(ShipmentStatus pstatus) { if (pstatus != _status) { switch (pstatus) { case AllStatus: clearExtraClause(); break; case Shipped: setExtraClause(" (shiphead_shipped = TRUE) "); break; case Unshipped: setExtraClause(" (shiphead_shipped = FALSE) "); break; default: QMessageBox::critical(this, tr("Invalid Shipment Status"), tr("

    ShipmentClusterLineEdit::setStatus received " "an invalid ShipmentStatus %1").arg(pstatus)); return; break; } } _status = pstatus; } void ShipmentClusterLineEdit::setStatus(QString pstatus) { if (pstatus == "Shipped") setStatus(Shipped); else if (pstatus == "Unshipped") setStatus(Unshipped); else { QMessageBox::critical(this, tr("Invalid Shipment Status"), tr("ShipmentClusterLineEdit::setStatus received " "an invalid ShipmentStatus %1").arg(pstatus)); setStatus(AllStatus); } } VirtualList* ShipmentClusterLineEdit::listFactory() { return new ShipmentList(this); } VirtualSearch* ShipmentClusterLineEdit::searchFactory() { return new ShipmentSearch(this); } ShipmentList::ShipmentList(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { _listTab->headerItem()->setText(1, tr("Shipped Date")); _listTab->headerItem()->setText(2, tr("Tracking Number")); } ShipmentSearch::ShipmentSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { _listTab->headerItem()->setText(1, tr("Shipped Date")); _listTab->headerItem()->setText(2, tr("Tracking Number")); _searchName->setText(tr("Search through Shipped Date")); _searchDescrip->setText(tr("Search through Tracking Number")); } qt-client-4.1.0/widgets/shipmentcluster.h000066400000000000000000000046531217451700100204720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _shipmentCluster_h #define _shipmentCluster_h #include "virtualCluster.h" class ShipmentList : public VirtualList { Q_OBJECT public: ShipmentList(QWidget*, Qt::WindowFlags = 0); }; class ShipmentSearch : public VirtualSearch { Q_OBJECT public: ShipmentSearch(QWidget*, Qt::WindowFlags = 0); }; class XTUPLEWIDGETS_EXPORT ShipmentClusterLineEdit : public VirtualClusterLineEdit { Q_OBJECT Q_ENUMS(ShipmentType) Q_ENUMS(ShipmentStatus) Q_PROPERTY(ShipmentType type READ type WRITE setType ) Q_PROPERTY(ShipmentStatus status READ status WRITE setStatus ) public: // TODO: make these flags instead of a simple enum? enum ShipmentType { All, SalesOrder, TransferOrder }; ShipmentClusterLineEdit(QWidget*, const char* = 0); virtual ShipmentType type(); enum ShipmentStatus { AllStatus, Shipped, Unshipped }; virtual ShipmentStatus status(); public slots: virtual void setId(const int); virtual void setType(QString); virtual void setType(ShipmentType); virtual void setStatus(QString); virtual void setStatus(ShipmentStatus); protected slots: virtual VirtualList* listFactory(); virtual VirtualSearch* searchFactory(); private: ShipmentType _type; ShipmentStatus _status; }; class XTUPLEWIDGETS_EXPORT ShipmentCluster : public VirtualCluster { Q_OBJECT public: ShipmentCluster(QWidget*, const char* = 0); virtual ShipmentClusterLineEdit::ShipmentType type(); virtual ShipmentClusterLineEdit::ShipmentStatus status(); public slots: virtual void limitToOrder(const int); virtual void removeOrderLimit(); virtual void setId(const int); virtual void setType(QString); virtual void setType(ShipmentClusterLineEdit::ShipmentType); virtual void setStatus(QString); virtual void setStatus(ShipmentClusterLineEdit::ShipmentStatus); }; #endif qt-client-4.1.0/widgets/shiptoCluster.cpp000066400000000000000000000162321217451700100204400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include "shiptocluster.h" ShiptoEdit::ShiptoEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "shiptoinfo", "shipto_id", "shipto_num", "shipto_name", "addr_line1", " (false) ", pName, "shipto_active") { setTitles(tr("Ship To Address"), tr("Ship To Addresses")); setUiName("shipTo"); setEditPriv("MaintainShiptos"); setViewPriv("ViewShiptos"); setNewPriv("MaintainShiptos"); _custid = 0; setCustid(-1); _query = "SELECT shipto_id AS id, shipto_num AS number, shipto_name AS name, " " addr_line1 AS description, " " (addr_city || ', ' || addr_state || ' ' || addr_postalcode) AS csv," " shipto_active AS active " "FROM shiptoinfo " " LEFT OUTER JOIN addr ON (shipto_addr_id=addr_id) " "WHERE (true) "; } void ShiptoEdit::setId(int pId) { if (pId == _id) return; VirtualClusterLineEdit::setId(pId); if (pId != -1) { emit nameChanged(_name); emit address1Changed(_description); } else { _custid = -1; _extraClause = " (false) "; emit newCustid(_custid); } } void ShiptoEdit::setCustid(int pCustid) { if (pCustid == _custid) return; clear(); _custid = pCustid; if (_custid != -1) { _extraClause = QString(" (shipto_cust_id=%1) ").arg(_custid); setNewPriv("MaintainShiptos"); } else { _extraClause = " (false) "; setNewPriv(""); } sUpdateMenu(); emit newCustid(pCustid); emit disableList(_custid == -1); } void ShiptoEdit::sNew() { if (canOpen()) { if (!_x_privileges->check(_newPriv)) return; ParameterList params; params.append("mode", "new"); params.append("cust_id", _custid); QWidget* w = 0; if (parentWidget()->window()) { if (parentWidget()->window()->isModal()) w = _guiClientInterface->openWindow(_uiName, params, parentWidget()->window() , Qt::WindowModal, Qt::Dialog); else w = _guiClientInterface->openWindow(_uiName, params, parentWidget()->window() , Qt::NonModal, Qt::Window); } if (w->inherits("QDialog")) { QDialog* newdlg = qobject_cast(w); int id = newdlg->exec(); if (id != QDialog::Rejected) { silentSetId(id); emit newId(_id); emit valid(_id != -1); } } } } void ShiptoEdit::sList() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); shipToList* newdlg = listFactory(); if (newdlg) { ParameterList params; params.append("cust_id", _custid); newdlg->set(params); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sList() not yet defined") .arg(metaObject()->className())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void ShiptoEdit::sSearch() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); shipToSearch* newdlg = searchFactory(); if (newdlg) { ParameterList params; params.append("cust_id", _custid); newdlg->set(params); newdlg->setSearchText(text()); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sSearch() not yet defined") .arg(metaObject()->className())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } shipToList* ShiptoEdit::listFactory() { return new shipToList(this); } shipToSearch* ShiptoEdit::searchFactory() { return new shipToSearch(this); } /////////////////////////////// ShiptoCluster::ShiptoCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new ShiptoEdit(this, pName)); setLabel(tr("Ship To#")); setNameVisible(true); setDescriptionVisible(true); setCustid(-1); } void ShiptoCluster::setCustid(int pId) { static_cast(_number)->setCustid(pId); } /////////////////////////////////////////////////////////////////////////////// shipToList::shipToList(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { setMinimumWidth(600); QLabel* custNumberLit = new QLabel(tr("Customer #:"), this); QLabel* custNameLit = new QLabel(tr("Name:"), this); QLabel* custAddrLit = new QLabel(tr("Address:"), this); _custNumber = new QLabel(this); _custName = new QLabel(this); _custAddr = new QLabel(this); QGridLayout* grid = new QGridLayout(this); grid->addWidget(custNumberLit,0,0,1,1,Qt::AlignRight); grid->addWidget(custNameLit,1,0,1,1,Qt::AlignRight); grid->addWidget(custAddrLit,2,0,1,1,Qt::AlignRight); grid->addWidget(_custNumber,0,1,1,1,Qt::AlignLeft); grid->addWidget(_custName,1,1,1,1,Qt::AlignLeft); grid->addWidget(_custAddr,2,1,1,1,Qt::AlignLeft); QVBoxLayout* searchLayout = findChild("searchLyt"); searchLayout->insertLayout(0,grid); _listTab->setColumnCount(2); _listTab->addColumn(tr("Address"), 75, Qt::AlignLeft, true, "description"); _listTab->addColumn(tr("City, State, Zip"), 100, Qt::AlignLeft, true, "csv"); } void shipToList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) { XSqlQuery cust; cust.prepare("SELECT cust_number, cust_name, addr_line1 " "FROM custinfo " "LEFT OUTER JOIN cntct ON (cust_cntct_id=cntct_id) " "LEFT OUTER JOIN addr ON (cntct_addr_id=addr_id) " "WHERE (cust_id=:cust_id)"); cust.bindValue(":cust_id", param.toInt()); cust.exec(); if (cust.first()) { _custNumber->setText(cust.value("cust_number").toString()); _custName->setText(cust.value("cust_name").toString()); _custAddr->setText(cust.value("addr_line1").toString()); } } } /////////////////////////// shipToSearch::shipToSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { setMinimumWidth(600); _custid = -1; _listTab->setColumnCount(2); _listTab->addColumn(tr("Address"), 75, Qt::AlignLeft, true, "description"); _listTab->addColumn(tr("City, State, Zip"), 100, Qt::AlignLeft, true, "csv"); } void shipToSearch::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("cust_id", &valid); if (valid) _custid = param.toInt(); } qt-client-4.1.0/widgets/shiptocluster.h000066400000000000000000000037021217451700100201430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef shiptoCluster_h #define shiptoCluster_h #include "virtualCluster.h" #include "widgets.h" class QLabel; class QPushButton; class ShiptoCluster; class XTUPLEWIDGETS_EXPORT shipToList : public VirtualList { Q_OBJECT public: shipToList(QWidget*, Qt::WindowFlags = 0); void set(const ParameterList & pParams); private: QLabel* _custNumber; QLabel* _custName; QLabel* _custAddr; }; class XTUPLEWIDGETS_EXPORT shipToSearch : public VirtualSearch { Q_OBJECT public: shipToSearch(QWidget*, Qt::WindowFlags = 0); void set(const ParameterList & pParams); private: int _custid; }; class XTUPLEWIDGETS_EXPORT ShiptoEdit : public VirtualClusterLineEdit { Q_OBJECT public: ShiptoEdit(QWidget *, const char * = 0); inline int custid() { return _custid; }; signals: void nameChanged(const QString &); void address1Changed(const QString &); void requestList(); void newCustid(int); void disableList(bool); public slots: void setId(const int); void setCustid(int); void sNew(); void sList(); void sSearch(); protected slots: shipToList* listFactory(); shipToSearch* searchFactory(); private: int _custid; }; class XTUPLEWIDGETS_EXPORT ShiptoCluster : public VirtualCluster { Q_OBJECT public: ShiptoCluster(QWidget *, const char * = 0); inline int custid() { return static_cast(_number)->custid(); } signals: void newCustid(int); public slots: void setCustid(int); }; #endif qt-client-4.1.0/widgets/transferOrderList.cpp000066400000000000000000000142341217451700100212440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "transferOrderList.h" #include #include #include #include #include #include #include #include "xtreewidget.h" #include "warehousegroup.h" #include "salesOrderList.h" transferOrderList::transferOrderList( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) : QDialog(parent, fl) { setObjectName(name ? name : "transferOrderList"); setModal(modal); _toheadid = -1; _type = (cToOpen | cToClosed); setWindowTitle(tr("Transfer Orders")); QVBoxLayout *mainLayout = new QVBoxLayout(this); QHBoxLayout *warehouseLayout = new QHBoxLayout(0); QHBoxLayout *topLayout = new QHBoxLayout(0); QVBoxLayout *buttonsLayout = new QVBoxLayout(0); QVBoxLayout *listLayout = new QVBoxLayout(0); mainLayout->setContentsMargins(5, 5, 5, 5); warehouseLayout->setContentsMargins(0, 0, 0, 0); topLayout->setContentsMargins(0, 0, 0, 0); buttonsLayout->setContentsMargins(0, 0, 0, 0); listLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setSpacing(5); warehouseLayout->setSpacing(0); topLayout->setSpacing(7); buttonsLayout->setSpacing(5); listLayout->setSpacing(0); _srcwhs = new WarehouseGroup(this, "_srcwhs"); _srcwhs->setTitle(tr("From Site:")); _dstwhs = new WarehouseGroup(this, "_dstwhs"); _dstwhs->setTitle(tr("To Site:")); _dstwhs->setAll(); warehouseLayout->addWidget(_srcwhs); warehouseLayout->addWidget(_dstwhs); QSpacerItem* spacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Preferred); warehouseLayout->addItem(spacer); topLayout->addLayout(warehouseLayout); QSpacerItem* spacer_2 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); topLayout->addItem(spacer_2); _close = new QPushButton(tr("&Cancel"), this); _close->setObjectName("_close"); buttonsLayout->addWidget(_close); _select = new QPushButton(tr("&Select"), this); _select->setObjectName("_select"); _select->setEnabled( FALSE ); _select->setDefault( TRUE ); buttonsLayout->addWidget(_select); topLayout->addLayout(buttonsLayout); mainLayout->addLayout(topLayout); QLabel *_transferOrdersLit = new QLabel(tr("Transfer Orders:"), this); _transferOrdersLit->setObjectName("_transferOrdersLit"); listLayout->addWidget(_transferOrdersLit); _to = new XTreeWidget(this); _to->setObjectName("_to"); listLayout->addWidget(_to); mainLayout->addLayout(listLayout); resize( QSize(490, 390).expandedTo(minimumSizeHint()) ); connect(_close, SIGNAL(clicked()), this, SLOT( reject() ) ); connect(_dstwhs, SIGNAL(updated()), this, SLOT( sFillList() ) ); connect(_select, SIGNAL(clicked()), this, SLOT( sSelect() ) ); connect(_srcwhs, SIGNAL(updated()), this, SLOT( sFillList() ) ); connect(_to, SIGNAL(valid(bool)), _select, SLOT( setEnabled(bool) ) ); connect(_to, SIGNAL(itemSelected(int)), _select, SLOT( animateClick() ) ); _to->addColumn(tr("Order #"), _orderColumn, Qt::AlignLeft, true, "tohead_number"); _to->addColumn(tr("From Whs."), -1, Qt::AlignLeft, true, "tohead_srcname"); _to->addColumn(tr("To Whs."), _orderColumn, Qt::AlignLeft, true, "tohead_destname"); _to->addColumn(tr("Ordered"), _dateColumn, Qt::AlignCenter, true, "tohead_orderdate"); _to->addColumn(tr("Scheduled"),_dateColumn, Qt::AlignCenter,true, "scheddate"); setTabOrder(_srcwhs, _dstwhs); setTabOrder(_dstwhs, _to); setTabOrder(_to, _select); setTabOrder(_select, _close); setTabOrder(_close, _srcwhs); _srcwhs->setFocus(); } void transferOrderList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("tohead_id", &valid); if (valid) _toheadid = param.toInt(); param = pParams.value("toType", &valid); if (valid) _type = param.toInt(); sFillList(); } void transferOrderList::sSelect() { done(_to->id()); } void transferOrderList::sFillList() { QString sql; sql = "SELECT DISTINCT tohead_id, tohead_number, tohead_srcname, " " tohead_destname," " tohead_orderdate," " MIN(toitem_schedshipdate) AS scheddate " "" "FROM tohead, toitem, tosmisc, toship " "WHERE ((tohead_id=toitem_tohead_id)" " AND (toitem_status<>'X')" " AND (toitem_id=toship_toitem_id)" " AND (toship_tosmisc_id=tosmisc_id)" " AND (NOT tosmisc_shipped)" "" // not restricted to atshipping "FROM tohead, toitem " "WHERE ((tohead_id=toitem_tohead_id)" " AND (toitem_status<>'X')" " " " AND (toitem_status IN ())" " " "" "" " AND (tohead_src_warehous_id=)" "" "" " AND (tohead_dest_warehous_id=)" "" ") " "GROUP BY tohead_id, tohead_number, tohead_srcname," " tohead_destname, tohead_orderdate " "ORDER BY tohead_number;"; ParameterList params; if (_type == cToAtShipping) params.append("atshipping"); else { QString toitem_statuslist; bool statusCheck = FALSE; if (_type & cToOpen) { toitem_statuslist += "'O'"; statusCheck = TRUE; } if (_type & cToClosed) { if (statusCheck) toitem_statuslist += ", "; toitem_statuslist += "'C'"; statusCheck = TRUE; } if (statusCheck) params.append("toitem_statuslist", toitem_statuslist); } if (_srcwhs->isSelected()) params.append("srcwarehous_id", _srcwhs->id()); if (_dstwhs->isSelected()) params.append("dstwarehous_id", _dstwhs->id()); MetaSQLQuery mql(sql); XSqlQuery q = mql.toQuery(params); _to->populate(q, _toheadid); } qt-client-4.1.0/widgets/transferOrderList.h000066400000000000000000000024221217451700100207050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef TRANSFERORDERLIST_H #define TRANSFERORDERLIST_H #include #include "widgets.h" class WarehouseGroup; class QPushButton; class XTreeWidget; class ParameterList; // Transfer Order Statuses of interest #define cToOpen 0x01 #define cToClosed 0x02 #define cToAtShipping 0x04 class XTUPLEWIDGETS_EXPORT transferOrderList : public QDialog { Q_OBJECT public: transferOrderList( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 ); WarehouseGroup *_dstwhs; WarehouseGroup *_srcwhs; QPushButton *_close; QPushButton *_select; XTreeWidget *_to; public slots: virtual void set(const ParameterList & pParams ); virtual void sSelect(); virtual void sFillList(); private: int _toheadid; int _type; }; #endif qt-client-4.1.0/widgets/usernameCluster.cpp000066400000000000000000000202361217451700100207500ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include "usernamecluster.h" #include "format.h" UsernameLineEdit::UsernameLineEdit(QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "usr", "usr_id", "usr_username", "usr_propername", 0, 0, pName) { setTitles(tr("User Name"), tr("User Names")); setType(UsersAll); if (_x_preferences) { if (!_x_preferences->boolean("ClusterButtons")) { menu()->removeAction(_infoAct); menu()->removeAction(menu()->actions().at(2)); } } } void UsernameLineEdit::setId(const int pId) { QString sql("SELECT usr_username AS number, " " usr_propername AS name " " FROM usr" " WHERE ((usr_id=:id)"); if(UsersActive == _type) sql += " AND (usr_active)"; else if(UsersInactive == _type) sql += " AND (NOT usr_active)"; sql += " );"; XSqlQuery query; query.prepare(sql); query.bindValue(":id", pId); query.exec(); setStrikeOut(!query.size()); if(query.first()) { _id = pId; _valid = true; _username = query.value("number").toString(); setText(_username); _name = query.value("name").toString(); } else { _id = -1; _valid = false; _name = QString(); _description = QString(); } emit newId(_id); emit valid(_valid); emit parsed(); _parsed = true; } void UsernameLineEdit::setType(enum Type pType) { _type = pType; if(UsersActive == _type) _extraClause = " (usr_active)"; else if(UsersInactive == _type) _extraClause = " (NOT usr_active)"; } void UsernameLineEdit::clear() { setId(-1); _username = ""; setText(QString()); } void UsernameLineEdit::setUsername(const QString & pUsername) { if (!pUsername.trimmed().length()) { clear(); return; } XSqlQuery query; QString sql("SELECT usr_id, usr_username AS number " " FROM usr" " WHERE ((usr_username ~* :username) "); if(UsersActive == _type) sql += " AND (usr_active)"; else if(UsersInactive == _type) sql += " AND (NOT usr_active)"; sql += ") ORDER BY usr_username LIMIT 1;"; query.prepare(sql); query.bindValue(":username", QString(pUsername).prepend("^")); query.exec(); if(query.first()) setId(query.value("usr_id").toInt()); else { _username = pUsername; setText(_username); setId(-1); } } void UsernameLineEdit::sParse() { if(!_parsed) { _parsed = true; setUsername(text()); if (!_valid) clear(); } } int UsernameLineEdit::id() { if(hasFocus()) sParse(); return _id; } const QString & UsernameLineEdit::username() { if(hasFocus()) sParse(); return _username; } UsernameList* UsernameLineEdit::listFactory() { return new UsernameList(this); } UsernameSearch* UsernameLineEdit::searchFactory() { return new UsernameSearch(this); } /////////////////////////////////////// UsernameCluster::UsernameCluster(QWidget * parent, const char * name) : VirtualCluster(parent, name) { addNumberWidget(new UsernameLineEdit(this, name)); _name->setHidden(false); } void UsernameCluster::addNumberWidget(UsernameLineEdit* pNumberWidget) { _number = pNumberWidget; if (! _number) return; _grid->addWidget(_number, 0, 1); setFocusProxy(pNumberWidget); connect(_number, SIGNAL(newId(int)), this, SIGNAL(newId(int))); connect(_number, SIGNAL(parsed()), this, SLOT(sRefresh())); connect(_number, SIGNAL(valid(bool)), this, SIGNAL(valid(bool))); } void UsernameCluster::setReadOnly(const bool pReadOnly) { _number->setEnabled(!pReadOnly); } void UsernameCluster::setUsername(const QString & pUsername) { static_cast(_number)->setUsername(pUsername); } ////////////////////////////////////////////////////////////////////// UsernameList::UsernameList(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose); setObjectName( "usernameList" ); _listTab->setColumnCount(0); _listTab->addColumn(tr("User Name"), -1, Qt::AlignLeft, true, "number" ); } ////////////////////////////////////////////////////////////////////// UsernameSearch::UsernameSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose); setObjectName( "usernameSearch" ); _listTab->setColumnCount(0); _listTab->addColumn(tr("User Name"), -1, Qt::AlignLeft, true, "number" ); } // script exposure //////////////////////////////////////////////////////////// QScriptValue UsernameLineEdittoScriptValue(QScriptEngine *engine, UsernameLineEdit* const &item) { return engine->newQObject(item); } void UsernameLineEditfromScriptValue(const QScriptValue &obj, UsernameLineEdit* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructUsernameLineEdit(QScriptContext *context, QScriptEngine *engine) { UsernameLineEdit *obj = 0; if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new UsernameLineEdit(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() >= 2 && qscriptvalue_cast(context->argument(0))) obj = new UsernameLineEdit(qscriptvalue_cast(context->argument(0)), qPrintable(context->argument(1).toString())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate UsernameLineEdit constructor"); return engine->toScriptValue(obj); } void setupUsernameLineEdit(QScriptEngine *engine) { qScriptRegisterMetaType(engine, UsernameLineEdittoScriptValue, UsernameLineEditfromScriptValue); QScriptValue widget = engine->newFunction(constructUsernameLineEdit); widget.setProperty("UsersAll", QScriptValue(engine, UsernameLineEdit::UsersAll), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UsersActive", QScriptValue(engine, UsernameLineEdit::UsersActive), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UsersInactive",QScriptValue(engine, UsernameLineEdit::UsersInactive),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("UsernameLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } QScriptValue UsernameClustertoScriptValue(QScriptEngine *engine, UsernameCluster* const &item) { return engine->newQObject(item); } void UsernameClusterfromScriptValue(const QScriptValue &obj, UsernameCluster* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructUsernameCluster(QScriptContext *context, QScriptEngine *engine) { UsernameCluster *obj = 0; if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) obj = new UsernameCluster(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() >= 2 && qscriptvalue_cast(context->argument(0))) obj = new UsernameCluster(qscriptvalue_cast(context->argument(0)), qPrintable(context->argument(1).toString())); else context->throwError(QScriptContext::UnknownError, "could not find an appropriate UsernameCluster constructor"); return engine->toScriptValue(obj); } void setupUsernameCluster(QScriptEngine *engine) { qScriptRegisterMetaType(engine, UsernameClustertoScriptValue, UsernameClusterfromScriptValue); QScriptValue widget = engine->newFunction(constructUsernameCluster); engine->globalObject().setProperty("UsernameCluster", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/usernamecluster.h000066400000000000000000000052001217451700100204470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __USERNAMECLUSTER_H__ #define __USERNAMECLUSTER_H__ #include "virtualCluster.h" #include "widgets.h" class QLabel; class QPushButton; class QScriptEngine; class UsernameList; class UsernameSearch; class UsernameCluster; void setupUsernameLineEdit(QScriptEngine *engine); void setupUsernameCluster(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT UsernameList : public VirtualList { Q_OBJECT public: UsernameList(QWidget*, Qt::WindowFlags = 0); }; class XTUPLEWIDGETS_EXPORT UsernameSearch : public VirtualSearch { Q_OBJECT public: UsernameSearch(QWidget*, Qt::WindowFlags = 0); }; class XTUPLEWIDGETS_EXPORT UsernameLineEdit : public VirtualClusterLineEdit { Q_OBJECT friend class UsernameCluster; public: UsernameLineEdit(QWidget*, const char* = 0); enum Type { UsersAll = 0, UsersActive, UsersInactive }; Q_INVOKABLE inline enum Type type() const { return _type; } Q_INVOKABLE void setType(enum Type pType); Q_INVOKABLE int id(); Q_INVOKABLE const QString & username(); public slots: void setId(const int); void setUsername(const QString &); void clear(); void sParse(); protected: UsernameList* listFactory(); UsernameSearch* searchFactory(); private: enum Type _type; QString _username; }; class XTUPLEWIDGETS_EXPORT UsernameCluster : public VirtualCluster { Q_OBJECT Q_PROPERTY( QString label READ label WRITE setLabel ) public: UsernameCluster(QWidget*, const char* = 0); Q_INVOKABLE inline const QString username() const { return static_cast(_number)->username(); } Q_INVOKABLE inline UsernameLineEdit::Type type() const { return static_cast(_number)->type(); } Q_INVOKABLE inline void setType(UsernameLineEdit::Type pType) { static_cast(_number)->setType(pType); } public slots: void setUsername(const QString & pUsername); void setReadOnly(const bool); inline void setId(const int pId) { static_cast(_number)->setId(pId); } protected: void addNumberWidget(UsernameLineEdit* pNumberWidget); }; Q_DECLARE_METATYPE(UsernameLineEdit*) Q_DECLARE_METATYPE(UsernameCluster*) #endif qt-client-4.1.0/widgets/vendorcluster.cpp000066400000000000000000000033411217451700100204640ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorcluster.h" #include "crmacctcluster.h" VendorLineEdit::VendorLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "vendinfo", "vend_id", "vend_number", "vend_name", 0, 0, pName, "vend_active") { setTitles(tr("Vendor"), tr("Vendors")); setUiName("vendor"); setEditPriv("MaintainVendors"); setViewPriv("ViewVendors"); setNewPriv("MaintainVendors"); _query = "SELECT vend_id AS id, vend_number AS number, vend_name AS name, vendtype_code AS type," " addr.*," " formatAddr(addr_line1, addr_line2, addr_line3, '', '') AS street," " cntct.*, vend_active as active " " FROM vendtype JOIN vendinfo" " ON (vend_vendtype_id=vendtype_id) LEFT OUTER JOIN" " cntct ON (vend_cntct1_id=cntct_id) LEFT OUTER JOIN" " addr ON (vend_addr_id=addr_id)" " WHERE true "; } VirtualList *VendorLineEdit::listFactory() { return new CRMAcctList(this); } VirtualSearch *VendorLineEdit::searchFactory() { return new CRMAcctSearch(this); } VendorCluster::VendorCluster(QWidget *pParent, const char *pName) : VirtualCluster(pParent, pName) { addNumberWidget(new VendorLineEdit(this, pName)); setNameVisible(true); } qt-client-4.1.0/widgets/vendorcluster.h000066400000000000000000000016461217451700100201370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORCLUSTER_H #define VENDORCLUSTER_H #include "widgets.h" #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT VendorLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: VendorLineEdit(QWidget *, const char * = 0); protected slots: VirtualList *listFactory(); VirtualSearch *searchFactory(); }; class XTUPLEWIDGETS_EXPORT VendorCluster : public VirtualCluster { Q_OBJECT public: VendorCluster(QWidget *, const char * = 0); }; #endif qt-client-4.1.0/widgets/vendorgroup.cpp000066400000000000000000000077141217451700100201470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include "vendorgroup.h" VendorGroup::VendorGroup(QWidget *pParent, const char *pName) : QWidget(pParent) { setObjectName(pName); setupUi(this); setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); _select->setCurrentIndex(All); _vend->setId(-1); _vendorTypes->setId(-1); _vendorType->setText(""); connect(_select,SIGNAL(currentIndexChanged(int)), this, SIGNAL(updated())); connect(_select,SIGNAL(currentIndexChanged(int)), this, SIGNAL(newState(int))); connect(_vend, SIGNAL(newId(int)), this, SIGNAL(updated())); connect(_vend, SIGNAL(newId(int)), this, SIGNAL(newVendId(int))); connect(_vendorTypes, SIGNAL(newID(int)), this, SIGNAL(updated())); connect(_vendorTypes, SIGNAL(newID(int)), this, SIGNAL(newVendTypeId(int))); connect(_vendorType, SIGNAL(editingFinished()), this, SIGNAL(updated())); connect(_vendorType, SIGNAL(editingFinished()), this, SLOT(sTypePatternFinished())); connect(_vendorType,SIGNAL(textChanged(QString)), this, SIGNAL(newTypePattern(QString))); setFocusProxy(_select); } VendorGroup::~VendorGroup() { } void VendorGroup::languageChange() { retranslateUi(this); } void VendorGroup::appendValue(ParameterList &pParams) { switch (_select->currentIndex()) { case Selected: pParams.append("vend_id", _vend->id()); break; case SelectedType: pParams.append("vendtype_id", _vendorTypes->id()); break; case TypePattern: pParams.append("vendtype_pattern", _vendorType->text()); break; case All: default: ; // nothing } } void VendorGroup::bindValue(XSqlQuery &pQuery) { switch (_select->currentIndex()) { case Selected: pQuery.bindValue(":vend_id", _vend->id()); break; case SelectedType: pQuery.bindValue(":vendtype_id", _vendorTypes->id()); break; case TypePattern: pQuery.bindValue(":vendtype_pattern", _vendorType->text()); break; case All: default: ; // nothing } } bool VendorGroup::isValid() { switch (_select->currentIndex()) { case Selected: return _vend->isValid(); break; case SelectedType: return _vendorTypes->isValid(); break; case TypePattern: return ! _vendorType->text().trimmed().isEmpty(); break; case All: return true; break; } return false; } void VendorGroup::setVendId(int p) { _vend->setId(p); setState(Selected); } void VendorGroup::setVendTypeId(int p) { _vendorTypes->setId(p); setState(SelectedType); } void VendorGroup::setTypePattern(const QString &p) { _vendorType->setText(p); sTypePatternFinished(); setState(TypePattern); } void VendorGroup::setState(enum VendorGroupState p) { _select->setCurrentIndex(p); } void VendorGroup::sTypePatternFinished() { emit newTypePattern(_vendorType->text()); emit updated(); } /* keep the contents of another vendor group (p) synchronized with this in a manner which allows any changes on this to propagate to p and any objects listening for signals from p will respond to changes to this. hide p because it's superfluous. */ void VendorGroup::synchronize(VendorGroup *p) { connect(this, SIGNAL(newTypePattern(QString)), p, SLOT(setTypePattern(QString))); connect(this, SIGNAL(newState(int)), p, SLOT(setState(int))); connect(this, SIGNAL(newVendId(int)), p, SLOT(setVendId(int))); connect(this, SIGNAL(newVendTypeId(int)), p, SLOT(setVendTypeId(int))); p->hide(); } qt-client-4.1.0/widgets/vendorgroup.h000066400000000000000000000045131217451700100176060ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef VENDORGROUP_H #define VENDORGROUP_H #include "widgets.h" #include "ui_vendorgroup.h" class ParameterList; class XTUPLEWIDGETS_EXPORT VendorGroup : public QWidget, public Ui::VendorGroup { Q_OBJECT Q_ENUMS(VendorGroupState) Q_PROPERTY(enum VendorGroupState state READ state WRITE setState) public: VendorGroup(QWidget * = 0, const char * = 0); virtual ~VendorGroup(); virtual void synchronize(VendorGroup*); enum VendorGroupState { All, Selected, SelectedType, TypePattern }; Q_INVOKABLE virtual void appendValue(ParameterList &); Q_INVOKABLE virtual void bindValue(XSqlQuery &); Q_INVOKABLE virtual QString typePattern() { return _vendorType->text(); }; enum VendorGroupState state() { return (VendorGroupState)_select->currentIndex(); }; Q_INVOKABLE virtual int vendId() { return _vend->id(); }; Q_INVOKABLE virtual int vendTypeId() { return _vendorTypes->id(); }; Q_INVOKABLE inline bool isAll() { return _select->currentIndex() == All; }; Q_INVOKABLE inline bool isSelectedVend() { return _select->currentIndex() == Selected; }; Q_INVOKABLE inline bool isSelectedType() { return _select->currentIndex() == SelectedType; }; Q_INVOKABLE inline bool isTypePattern() { return _select->currentIndex() == TypePattern; }; Q_INVOKABLE virtual bool isValid(); public slots: virtual void setVendId(int p); virtual void setVendTypeId(int p); virtual void setTypePattern(const QString &p); virtual void setState(int p) { setState((VendorGroupState)p); } virtual void setState(enum VendorGroupState p); signals: void newTypePattern(QString); void newState(int); void newVendId(int); void newVendTypeId(int); void updated(); protected slots: virtual void languageChange(); virtual void sTypePatternFinished(); }; #endif qt-client-4.1.0/widgets/vendorgroup.ui000066400000000000000000000102051217451700100177670ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. VendorGroup 0 0 356 52 0 All Vendors Select Vendor Type Vendor Type Pattern 0 0 0 0 true Qt::Horizontal true XComboBox::VendorTypes true Qt::Horizontal 0 10 VendorCluster QWidget

    vendorcluster.h
    XComboBox QComboBox
    xcombobox.h
    XLineEdit QLineEdit
    xlineedit.h
    1
    _select currentIndexChanged(int) _selectStack setCurrentIndex(int) 112 20 265 23 qt-client-4.1.0/widgets/vendorlineedit.h000066400000000000000000000007271217451700100202520ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "vendorcluster.h" qt-client-4.1.0/widgets/virtualCluster.cpp000066400000000000000000001154651217451700100206300ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include "xlineedit.h" #include "xcheckbox.h" #include "xsqlquery.h" #include "xsqltablemodel.h" #include "shortcuts.h" #include "virtualCluster.h" #define DEBUG false void VirtualCluster::init() { _number = 0; setFocusPolicy(Qt::StrongFocus); _label = new QLabel(this); _label->setObjectName("_label"); _label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); _name = new QLabel(this); _name->setObjectName("_name"); _name->setVisible(false); _description = new QLabel(this); _description->setObjectName("_description"); _description->setVisible(false); if(!(_x_metrics && _x_metrics->boolean("VirtualClusterDisableMultiLineDesc"))) _description->setWordWrap(true); _grid = new QGridLayout(this); _grid->setMargin(0); _grid->setSpacing(6); if (!_label->text().isEmpty()) _grid->addWidget(_label, 0, 0); _hspcr = new QSpacerItem(0, 0, QSizePolicy::Expanding); _grid->addItem(_hspcr, 0, _grid->columnCount() + 1); _orientation = Qt::Horizontal; setOrientation(Qt::Vertical); _mapper = new XDataWidgetMapper(this); } VirtualCluster::VirtualCluster(QWidget* pParent, const char* pName) : QWidget(pParent) { setObjectName(pName ? pName : "VirtualCluster"); init(); } VirtualCluster::VirtualCluster(QWidget* pParent, VirtualClusterLineEdit* pNumberWidget, const char* pName) : QWidget(pParent) { setObjectName(pName); init(); if (pNumberWidget) addNumberWidget(pNumberWidget); } void VirtualCluster::clear() { if (DEBUG) qDebug("VC %s::clear()", qPrintable(objectName())); setId(-1); _number->clear(); _name->clear(); _description->clear(); } QString VirtualCluster::nullStr() const { if (_number) return _number->nullStr(); return QString(); } void VirtualCluster::setNullStr(const QString &text) { if (_number) _number->setNullStr(text); } void VirtualClusterLineEdit::sEllipses() { if (_x_preferences && _x_preferences->value("DefaultEllipsesAction") == "search") sSearch(); else sList(); } void VirtualCluster::setLabel(const QString& p) { _label->setText(p); if (p.isEmpty()) _grid->removeWidget(_label); else _grid->addWidget(_label,0,0); } void VirtualCluster::setDataWidgetMap(XDataWidgetMapper* m) { disconnect(_number, SIGNAL(newId(int)), this, SLOT(updateMapperData())); m->addMapping(this, _fieldName, "number", "defaultNumber"); _mapper=m; connect(_number, SIGNAL(newId(int)), this, SLOT(updateMapperData())); } void VirtualCluster::setEnabled(const bool p) { QList child = findChildren(); for (int i = 0; i < child.size(); i++) { if (child[i]->inherits("VirtualCluster")) ((VirtualCluster*)(child[i]))->setEnabled(p); else child[i]->setEnabled(p || child[i]->inherits("QLabel")); } } void VirtualCluster::setStrict(const bool b) { _number->setStrict(b); } void VirtualCluster::setShowInactive(const bool b) { _number->setShowInactive(b); } void VirtualCluster::addNumberWidget(VirtualClusterLineEdit* pNumberWidget) { _number = pNumberWidget; if (! _number) return; _grid->addWidget(_number, 0, 1); setFocusProxy(pNumberWidget); connect(_number, SIGNAL(newId(int)), this, SIGNAL(newId(int))); connect(_number, SIGNAL(parsed()), this, SLOT(sRefresh())); connect(_number, SIGNAL(valid(bool)), this, SIGNAL(valid(bool))); } void VirtualCluster::sInfo() { _number->sInfo(); } void VirtualCluster::sList() { _number->sList(); } void VirtualCluster::sSearch() { _number->sSearch(); } void VirtualCluster::sRefresh() { if (DEBUG) qDebug("VC %s::sRefresh() with id %d", qPrintable(objectName()), _number ? _number->_id : -1); _name->setText(_number->_name); _description->setText(_number->_description); } void VirtualCluster::setReadOnly(const bool b) { _readOnly = b; if (b) _number->setEnabled(false); else _number->setEnabled(true); } void VirtualCluster::updateMapperData() { if (_mapper->model() && _mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this))).toString() != number()) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this)), number()); } Qt::Orientation VirtualCluster::orientation() { return _orientation; } void VirtualCluster::setOrientation(Qt::Orientation orientation) { if (orientation == _orientation) return; _grid->removeWidget(_name); _grid->removeWidget(_description); _grid->removeItem(_hspcr); if (orientation == Qt::Vertical) { _grid->addWidget(_name, 1, 1, 1, -1); _grid->addWidget(_description, 2, 1, 1, -1); } else { _grid->addWidget(_name, 0, _grid->columnCount()); _grid->addWidget(_description, 0, _grid->columnCount()); } _grid->addItem(_hspcr,0, _grid->columnCount()); _orientation = orientation; } bool VirtualCluster::nameVisible() const { return _name && _name->isVisible(); } void VirtualCluster::setNameVisible(const bool p) { if (_name) _name->setHidden(!p); } bool VirtualCluster::descriptionVisible() const { return _description && _description->isVisible(); } void VirtualCluster::setDescriptionVisible(const bool p) { if (_description) _description->setHidden(!p); } /////////////////////////////////////////////////////////////////////////// GuiClientInterface* VirtualClusterLineEdit::_guiClientInterface = 0; VirtualClusterLineEdit::VirtualClusterLineEdit(QWidget* pParent, const char* pTabName, const char* pIdColumn, const char* pNumberColumn, const char* pNameColumn, const char* pDescripColumn, const char* pExtra, const char* pName, const char* pActiveColumn) : XLineEdit(pParent, pName) { if (DEBUG) qDebug("VirtualClusterLineEdit(%p, %s, %s, %s, %s, %s, %s, %s, %s)", pParent ? pParent : 0, pTabName ? pTabName : "", pIdColumn ? pIdColumn : "", pNumberColumn ? pNumberColumn : "", pNameColumn ? pNameColumn : "", pDescripColumn ? pDescripColumn : "", pExtra ? pExtra : "", pName ? pName : "", pActiveColumn ? pActiveColumn : ""); setObjectName(pName ? pName : "VirtualClusterLineEdit"); _valid = false; _parsed = true; _strict = true; _completer = 0; _showInactive = false; _completerId = 0; setTableAndColumnNames(pTabName, pIdColumn, pNumberColumn, pNameColumn, pDescripColumn, pActiveColumn); if (pExtra && QString(pExtra).trimmed().length()) _extraClause = pExtra; setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); clear(); _titleSingular = tr("Object"); _titlePlural = tr("Objects"); // Completer set up if (_x_metrics) { if (!_x_metrics->boolean("DisableAutoComplete")) { QSqlQueryModel* hints = new QSqlQueryModel(this); _completer = new QCompleter(hints,this); _completer->setWidget(this); QTreeView* view = new QTreeView(this); view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view->setHeaderHidden(true); view->setRootIsDecorated(false); _completer->setPopup(view); _completer->setCaseSensitivity(Qt::CaseInsensitive); _completer->setCompletionColumn(1); _completer->setModelSorting(QCompleter::CaseInsensitivelySortedModel); connect(this, SIGNAL(textEdited(QString)), this, SLOT(sHandleCompleter())); connect(_completer, SIGNAL(highlighted(QString)), this, SLOT(setText(QString))); connect(_completer, SIGNAL(highlighted(const QModelIndex &)), this, SLOT(completerHighlighted(const QModelIndex &))); } } // Set up actions connect(_listAct, SIGNAL(triggered()), this, SLOT(sList())); connect(_searchAct, SIGNAL(triggered()), this, SLOT(sSearch())); _infoAct = new QAction(tr("Info..."), this); _infoAct->setShortcut(QKeySequence(tr("Ctrl+Shift+I"))); _infoAct->setShortcutContext(Qt::WidgetWithChildrenShortcut); _infoAct->setToolTip(tr("View record information")); _infoAct->setEnabled(false); connect(_infoAct, SIGNAL(triggered()), this, SLOT(sInfo())); addAction(_infoAct); _openAct = new QAction(tr("Open..."), this); _openAct->setShortcut(QKeySequence(tr("Ctrl+Shift+O"))); _openAct->setShortcutContext(Qt::WidgetWithChildrenShortcut); _openAct->setToolTip(tr("Open record detail")); _openAct->setEnabled(false); connect(_openAct, SIGNAL(triggered()), this, SLOT(sOpen())); addAction(_openAct); _newAct = new QAction(tr("New..."), this); _newAct->setShortcut(QKeySequence(tr("Ctrl+Shift+N"))); _newAct->setShortcutContext(Qt::WidgetWithChildrenShortcut); _newAct->setToolTip(tr("Create new record")); _newAct->setEnabled(false); connect(_newAct, SIGNAL(triggered()), this, SLOT(sNew())); addAction(_newAct); connect(this, SIGNAL(valid(bool)), _infoAct, SLOT(setEnabled(bool))); _menuLabel = new QLabel(this); // Menu set up _menu = 0; _menuLabel->setPixmap(QPixmap(":/widgets/images/magnifier.png")); _menuLabel->installEventFilter(this); int height = minimumSizeHint().height(); QString sheet = QLatin1String("QLineEdit{ padding-right: "); sheet += QString::number(_menuLabel->pixmap()->width() + 6); sheet += QLatin1String(";}"); setStyleSheet(sheet); // Little hack. Somehow style sheet makes widget short. Put back height. setMinimumHeight(height); // Set default menu with standard actions QMenu* menu = new QMenu; menu->addAction(_listAct); menu->addAction(_searchAct); menu->addSeparator(); menu->addAction(_infoAct); setMenu(menu); connect(this, SIGNAL(valid(bool)), this, SLOT(sUpdateMenu())); connect(menu, SIGNAL(aboutToShow()), this, SLOT(sUpdateMenu())); } bool VirtualClusterLineEdit::eventFilter(QObject *obj, QEvent *event) { if (!_menu || obj != _menuLabel) return QObject::eventFilter(obj, event); switch (event->type()) { case QEvent::MouseButtonPress: { const QMouseEvent *me = static_cast(event); _menu->exec(me->globalPos()); return true; } default: break; } return QObject::eventFilter(obj, event); } void VirtualClusterLineEdit::focusInEvent(QFocusEvent * event) { sUpdateMenu(); XLineEdit::focusInEvent(event); } void VirtualClusterLineEdit::resizeEvent(QResizeEvent *) { positionMenuLabel(); } void VirtualClusterLineEdit::positionMenuLabel() { _menuLabel->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _menuLabel->setStyleSheet("QLabel { margin-right:6}"); _menuLabel->setGeometry(width() - _menuLabel->pixmap()->width() - 6, 0, _menuLabel->pixmap()->width() + 6, height()); } void VirtualClusterLineEdit::setShowInactive(const bool p) { _showInactive = p; } void VirtualClusterLineEdit::setUiName(const QString& name) { _uiName = name; sUpdateMenu(); } void VirtualClusterLineEdit::setEditPriv(const QString& priv) { _editPriv = priv; sUpdateMenu(); } void VirtualClusterLineEdit::setNewPriv(const QString& priv) { _newPriv = priv; sUpdateMenu(); } void VirtualClusterLineEdit::setViewPriv(const QString& priv) { _viewPriv = priv; sUpdateMenu(); } void VirtualClusterLineEdit::sUpdateMenu() { if (! _x_privileges) return; _listAct->setEnabled(isEnabled()); _searchAct->setEnabled(isEnabled()); _aliasAct->setEnabled(isEnabled()); _infoAct->setEnabled(_id != -1); _openAct->setEnabled((_x_privileges->check(_editPriv) || _x_privileges->check(_viewPriv)) && _id != -1); _newAct->setEnabled(_x_privileges->check(_newPriv) && isEnabled()); if (canOpen()) { if (!menu()->actions().contains(_openAct)) menu()->addAction(_openAct); if (!menu()->actions().contains(_newAct) && !_newPriv.isEmpty()) menu()->addAction(_newAct); } else { if (menu()->actions().contains(_openAct)) menu()->removeAction(_openAct); if (menu()->actions().contains(_newAct)) menu()->removeAction(_newAct); } } void VirtualClusterLineEdit::setMenu(QMenu *menu) { _menu = menu; } void VirtualClusterLineEdit::sHandleCompleter() { if (!hasFocus()) return; QString stripped = text().trimmed().toUpper(); if (stripped.isEmpty()) return; int width = 0; QSqlQueryModel* model = static_cast(_completer->model()); QTreeView * view = static_cast(_completer->popup()); _parsed = true; XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + ((_hasActive && ! _showInactive) ? _activeClause : "") + QString(" ORDER BY %1 LIMIT 10;").arg(_numColName)); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if (numQ.first()) { int numberCol = numQ.record().indexOf("number"); int nameCol = numQ.record().indexOf("name"); int descripCol = numQ.record().indexOf("description"); model->setQuery(numQ); _completer->setCompletionPrefix(stripped); for (int i = 0; i < model->columnCount(); i++) { if ( (i != numberCol) && (!_hasName || i != nameCol ) && (!_hasDescription || i != descripCol) ) { view->hideColumn(i); } } view->resizeColumnToContents(numberCol); width += view->columnWidth(numberCol); if (_hasName) { view->resizeColumnToContents(nameCol); width += view->columnWidth(nameCol); } if (_hasDescription) { view->resizeColumnToContents(descripCol); width += view->columnWidth(descripCol); } } else model->setQuery(QSqlQuery()); if (width > 350) width = 350; QRect rect; rect.setHeight(height()); rect.setWidth(width); rect.setBottomLeft(QPoint(0, height() - 2)); _completer->complete(rect); _parsed = false; } void VirtualClusterLineEdit::completerHighlighted(const QModelIndex & index) { _completerId = _completer->completionModel()->data(index.sibling(index.row(), 0)).toInt(); if (DEBUG) qDebug() << objectName() << "::completerHighlighted(" << index << ")" << "enterd with completerId" << _completerId; } void VirtualClusterLineEdit::sHandleNullStr() { if (_nullStr.isEmpty() || !_parsed) return; QString sheet = styleSheet(); QString nullStyle = " QLineEdit{ color: Grey; " " font: italic; " " font-size: 12px}"; if (!hasFocus() && text().isEmpty() && !_valid) { setText(_nullStr); sheet.append(nullStyle); } else if (hasFocus() && !_valid) { clear(); sheet.remove(nullStyle); } else if (_valid) sheet.remove(nullStyle); setStyleSheet(sheet); } void VirtualClusterLineEdit::setStrikeOut(bool enable) { if (font().strikeOut() == enable) return; QFont font = this->font(); font.setStrikeOut(enable); setFont(font); if (enable) connect(this, SIGNAL(textEdited(QString)), this, SLOT(setStrikeOut())); else disconnect(this, SIGNAL(textEdited(QString)), this, SLOT(setStrikeOut())); } void VirtualClusterLineEdit::setTableAndColumnNames(const char* pTabName, const char* pIdColumn, const char* pNumberColumn, const char* pNameColumn, const char* pDescripColumn, const char* pActiveColumn) { _idColName = QString(pIdColumn); _numColName = QString(pNumberColumn); _nameColName = QString(pNameColumn); _descripColName = QString(pDescripColumn); _activeColName = QString(pActiveColumn); _query = QString("SELECT %1 AS id, %2 AS number ") .arg(pIdColumn).arg(pNumberColumn); _hasName = (pNameColumn && QString(pNameColumn).trimmed().length()); if (_hasName) _query += QString(", %1 AS name ").arg(pNameColumn); _hasDescription = (pDescripColumn && QString(pDescripColumn).trimmed().length()); if (_hasDescription) _query += QString(", %1 AS description ").arg(pDescripColumn); _hasActive = (pActiveColumn && QString(pActiveColumn).trimmed().length()); if (_hasActive) _query += QString(", %1 AS active ").arg(pActiveColumn); _query += QString("FROM %1 WHERE (TRUE) ").arg(pTabName); _idClause = QString(" AND (%1=:id) ").arg(pIdColumn); _numClause = QString(" AND (%1 ~* :number) ").arg(pNumberColumn); if (_hasActive) _activeClause = QString(" AND (%1) ").arg(pActiveColumn); else _activeClause = ""; _extraClause = ""; _model = new QSqlQueryModel(this); } void VirtualClusterLineEdit::setTitles(const QString& s, const QString& p) { _titleSingular = s; _titlePlural = !p.isEmpty() ? p : s; } bool VirtualClusterLineEdit::canOpen() { if (!_uiName.isEmpty() && _guiClientInterface) return true; return false; } void VirtualClusterLineEdit::clear() { if (DEBUG) qDebug("VCLE %s::clear()", qPrintable(objectName())); int oldid = _id; bool oldvalid = _valid; XLineEdit::clear(); _description = ""; _name = ""; _id = -1; // calling setId() or silentSetId() is recursive _valid = false; _model = new QSqlQueryModel(this); if (oldvalid != _valid) emit valid(_valid); if (oldid != _id) emit newId(_id); } void VirtualClusterLineEdit::setId(const int pId) { if (DEBUG) qDebug("VCLE %s::setId(%d)", qPrintable(objectName()), pId); if (pId == -1 || pId == 0) { clear(); emit parsed(); } else { bool changed = (pId != _id); silentSetId(pId); if (changed) { emit newId(pId); emit valid(_valid); } } } void VirtualClusterLineEdit::silentSetId(const int pId) { if (DEBUG) qDebug("VCLE %s::silentSetId(%d)", qPrintable(objectName()), pId); if (pId == -1) { XLineEdit::clear(); _model = new QSqlQueryModel(this); } else { XSqlQuery idQ; idQ.prepare(_query + _idClause + QString(";")); idQ.bindValue(":id", pId); idQ.exec(); if (idQ.first()) { if (_completer) static_cast(_completer->model())->setQuery(QSqlQuery()); _id = pId; _valid = true; _model->setQuery(idQ); setText(idQ.value("number").toString()); if (_hasName) _name = (idQ.value("name").toString()); if (_hasDescription) _description = idQ.value("description").toString(); if (_hasActive) setStrikeOut(!idQ.value("active").toBool()); } else if (idQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), idQ.lastError().databaseText()); } _parsed = true; sHandleNullStr(); emit parsed(); } void VirtualClusterLineEdit::setNumber(const QString& pNumber) { _parsed = false; setText(pNumber); sParse(); } void VirtualClusterLineEdit::sParse() { if (DEBUG) qDebug("VCLE %s::sParse() entered with _parsed %d and text() %s", qPrintable(objectName()), _parsed, qPrintable(text())); if (_completerId) { setId(_completerId); _completerId = 0; } else if (! _parsed) { QString stripped = text().trimmed().toUpper(); if (stripped.length() == 0) { _parsed = true; setId(-1); } else { XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + ((_hasActive && ! _showInactive) ? _activeClause : "" ) + QString("ORDER BY %1 LIMIT 1;").arg(_numColName)); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if (numQ.first()) { _valid = true; setId(numQ.value("id").toInt()); if (_hasName) _name = (numQ.value("name").toString()); if (_hasDescription) _description = numQ.value("description").toString(); } else { setId(-1); if (numQ.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), numQ.lastError().databaseText()); } } emit valid(_valid); emit parsed(); } _parsed = true; sHandleNullStr(); } void VirtualClusterLineEdit::sList() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); VirtualList* newdlg = listFactory(); if (newdlg) { int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sList() not yet defined").arg(objectName())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void VirtualClusterLineEdit::sSearch() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); VirtualSearch* newdlg = searchFactory(); if (newdlg) { QString stripped = text().trimmed(); if(stripped.length()) { XSqlQuery numQ; numQ.prepare(_query + _numClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + ((_hasActive && ! _showInactive) ? _activeClause : "" ) + QString("ORDER BY %1;").arg(_numColName)); numQ.bindValue(":number", "^" + stripped); numQ.exec(); if (numQ.first()) newdlg->setQuery(numQ); } newdlg->setSearchText(text()); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sSearch() not yet defined").arg(objectName())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void VirtualCluster::sEllipses() { _number->sEllipses(); } void VirtualClusterLineEdit::sInfo() { VirtualInfo* newdlg = infoFactory(); if (newdlg) newdlg->exec(); else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sInfo() not yet defined").arg(objectName())); } void VirtualClusterLineEdit::sNew() { ParameterList params; params.append("mode", "new"); params.append("captive", true); sOpenWindow(_uiName, params); } void VirtualClusterLineEdit::sOpen() { ParameterList params; if (_x_privileges->check(_editPriv)) params.append("mode", "edit"); else params.append("mode", "view"); params.append(_idColName, id()); sOpenWindow(_uiName, params); } QWidget* VirtualClusterLineEdit::sOpenWindow(const QString &uiName, ParameterList ¶ms) { QWidget* w = 0; if (parentWidget()->window()) w = _guiClientInterface->openWindow(uiName, params, parentWidget()->window() , Qt::WindowModal, Qt::Dialog); if (w->inherits("QDialog")) { QDialog* newdlg = qobject_cast(w); int id = newdlg->exec(); if (id != QDialog::Rejected) { silentSetId(id); emit newId(_id); emit valid(_id != -1); } } else connect(w, SIGNAL(saved(int)), this, SLOT(setId(int))); return w; } void VirtualClusterLineEdit::setStrict(const bool b) { _strict = b; } VirtualInfo* VirtualClusterLineEdit::infoFactory() { return new VirtualInfo(this); } VirtualList* VirtualClusterLineEdit::listFactory() { return new VirtualList(this); } VirtualSearch* VirtualClusterLineEdit::searchFactory() { return new VirtualSearch(this); } /////////////////////////////////////////////////////////////////////////////// void VirtualList::init() { setWindowModality(Qt::ApplicationModal); setAttribute(Qt::WA_DeleteOnClose); _search = new QLineEdit(this); _search->setObjectName("_search"); _searchLit = new QLabel(tr("S&earch for:"), this); _searchLit->setBuddy(_search); _searchLit->setObjectName("_searchLit"); #ifdef Q_WS_MAC _search->setMinimumHeight(22); #endif _buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Vertical, this); _select = _buttonBox->button(QDialogButtonBox::Ok); _listTab = new XTreeWidget(this); _titleLit = new QLabel("", this); _titleLit->setBuddy(_listTab); _titleLit->setObjectName("_titleLit"); _listTab->setObjectName("_listTab"); _listTab->setPopulateLinear(false); _searchLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _select->setEnabled(false); //_listTab->setMinimumHeight(250); _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); _dialogLyt = new QVBoxLayout(this); _dialogLyt->setContentsMargins(5, 5, 5, 5); QHBoxLayout* topLyt = new QHBoxLayout(); QVBoxLayout* searchLyt = new QVBoxLayout(); QVBoxLayout* buttonsLyt = new QVBoxLayout(); QHBoxLayout* searchStrLyt = new QHBoxLayout(); QVBoxLayout* tableLyt = new QVBoxLayout(); topLyt->setObjectName("topLyt"); searchLyt->setObjectName("searchLyt"); buttonsLyt->setObjectName("buttonsLyt"); searchStrLyt->setObjectName("searchStrLyt"); tableLyt->setObjectName("tableLyt"); _dialogLyt->addLayout(topLyt); topLyt->addLayout(searchLyt); topLyt->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); topLyt->addLayout(buttonsLyt); searchLyt->addLayout(searchStrLyt); _dialogLyt->addLayout(tableLyt); searchStrLyt->addWidget(_searchLit); searchStrLyt->addWidget(_search); buttonsLyt->addWidget(_buttonBox); tableLyt->addWidget(_titleLit); tableLyt->addWidget(_listTab); topLyt->setStretchFactor(searchLyt, 0); _dialogLyt->setStretchFactor(topLyt, 0); _dialogLyt->setStretchFactor(tableLyt, 1); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_listTab, SIGNAL(itemSelected(int)), this, SLOT(sSelect())); connect(_listTab, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); connect(_search, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSelect())); } VirtualList::VirtualList() : QDialog() { init(); } VirtualList::VirtualList(QWidget* pParent, Qt::WindowFlags pFlags ) : QDialog(pParent, pFlags) { init(); setObjectName("virtualList"); if(pParent->inherits("ExpenseLineEdit")) _listTab->addColumn(tr("Category"), -1, Qt::AlignLeft, true, "number"); else _listTab->addColumn(tr("Number"), -1, Qt::AlignLeft, true, "number"); if (pParent->inherits("VirtualClusterLineEdit")) { _parent = (VirtualClusterLineEdit*)(pParent); setWindowTitle(_parent->_titlePlural); if (_parent->_hasName) { _listTab->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "name"); _listTab->setColumnWidth(_listTab->columnCount() - 1, 100); } if (_parent->_hasDescription) { _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); _listTab->setColumnWidth(_listTab->columnCount() - 1, 100); } _id = _parent->_id; _titleLit->setText(_parent->_titlePlural); } else { _parent = 0; _id = -1; } shortcuts::setStandardKeys(this); } void VirtualList::sClose() { done(_id); } void VirtualList::sSelect() { done(_listTab->id()); } void VirtualList::sSearch(const QString& pTarget) { for (int i = 0; i < _listTab->columnCount(); i++) { QList matches = _listTab->findItems(pTarget, Qt::MatchStartsWith, i); if (matches.size() > 0) { _listTab->setCurrentItem(matches[0]); _listTab->scrollToItem(matches[0]); return; } } } void VirtualList::sFillList() { if (! _parent) return; _listTab->clear(); XSqlQuery query(_parent->_query + (_parent->_extraClause.isEmpty() ? "" : " AND " + _parent->_extraClause) + ((_parent->_hasActive && ! _parent->_showInactive) ? _parent->_activeClause : "") + QString(" ORDER BY ") + QString((_parent->_hasName) ? "name" : "number")); _listTab->populate(query); } void VirtualList::showEvent(QShowEvent* e) { sFillList(); QDialog::showEvent(e); } /////////////////////////////////////////////////////////////////////////////// VirtualSearch::VirtualSearch(QWidget* pParent, Qt::WindowFlags pFlags) : QDialog(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose); setWindowModality(Qt::ApplicationModal); setObjectName("virtualSearch"); _search = new QLineEdit(this); _search->setObjectName("_search"); _searchLit = new QLabel(tr("S&earch for:"), this); _searchLit->setBuddy(_search); _searchLit->setObjectName("_searchLit"); _searchNumber = new XCheckBox(tr("Search through Numbers"), this); _searchNumber->setObjectName("_searchNumber"); _searchName = new XCheckBox(tr("Search through Names"), this); _searchName->setObjectName("_searchName"); _searchDescrip = new XCheckBox(tr("Search through Descriptions"), this); _searchDescrip->setObjectName("_searchDescrip"); _buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Vertical, this); _select = _buttonBox->button(QDialogButtonBox::Ok); _listTab = new XTreeWidget(this); _titleLit = new QLabel("", this); _titleLit->setBuddy(_listTab); _titleLit->setObjectName("_titleLit"); _listTab->setObjectName("_listTab"); _listTab->setPopulateLinear(false); _searchLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _select->setEnabled(false); //_listTab->setMinimumHeight(250); _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); _dialogLyt = new QVBoxLayout(this); _dialogLyt->setContentsMargins(5, 5, 5, 5); QHBoxLayout* topLyt = new QHBoxLayout(); searchLyt = new QVBoxLayout(); buttonsLyt = new QVBoxLayout(); searchStrLyt = new QHBoxLayout(); selectorsLyt = new QGridLayout(); tableLyt = new QVBoxLayout(); topLyt->setObjectName("topLyt"); searchLyt->setObjectName("searchLyt"); buttonsLyt->setObjectName("buttonsLyt"); searchStrLyt->setObjectName("searchStrLyt"); selectorsLyt->setObjectName("selectorsLyt"); tableLyt->setObjectName("tableLyt"); _dialogLyt->addLayout(topLyt); _dialogLyt->addLayout(tableLyt); topLyt->addLayout(searchLyt); topLyt->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); topLyt->addLayout(buttonsLyt); searchLyt->addItem(searchStrLyt); searchLyt->addItem(selectorsLyt); searchLyt->setObjectName("searchLyt"); searchStrLyt->addWidget(_searchLit); searchStrLyt->addWidget(_search); #ifdef Q_WS_MAC _search->setMinimumHeight(22); selectorsLyt->setVerticalSpacing(6); #else _search->setMinimumHeight(20); #endif selectorsLyt->addWidget(_searchNumber, 0, 0); selectorsLyt->addWidget(_searchName, 1, 0); selectorsLyt->addWidget(_searchDescrip, 2, 0); buttonsLyt->addWidget(_buttonBox); buttonsLyt->addItem(new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding)); tableLyt->addWidget(_titleLit); tableLyt->addWidget(_listTab); ((QBoxLayout*)topLyt)->setStretchFactor(searchLyt, 0); ((QBoxLayout*)_dialogLyt)->setStretchFactor(topLyt, 0); ((QBoxLayout*)_dialogLyt)->setStretchFactor(tableLyt, 1); connect(_listTab, SIGNAL(itemSelected(int)), this, SLOT(sSelect())); connect(_buttonBox, SIGNAL(accepted()), this, SLOT(sSelect())); connect(_buttonBox, SIGNAL(rejected()), this, SLOT(sClose())); connect(_searchNumber, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_searchDescrip, SIGNAL(clicked()), this, SLOT(sFillList())); connect(_search, SIGNAL(editingFinished()), this, SLOT(sFillList())); connect(_listTab, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool))); _listTab->addColumn(tr("Number"), -1, Qt::AlignLeft, true, "number"); if (pParent->inherits("VirtualClusterLineEdit")) { _parent = (VirtualClusterLineEdit*)(pParent); setWindowTitle(_parent->_titlePlural); if (_parent->_hasName) { _listTab->addColumn(tr("Name"), -1, Qt::AlignLeft, true, "name"); _listTab->setColumnWidth(_listTab->columnCount() - 1, 100); } if (_parent->_hasDescription) { _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description" ); _listTab->setColumnWidth(_listTab->columnCount() - 1, 100); } _searchName->setHidden(! _parent->_hasName); _searchDescrip->setHidden(! _parent->_hasDescription); _id = _parent->_id; _titleLit->setText(_parent->_titlePlural); } else { _parent = 0; _id = -1; } shortcuts::setStandardKeys(this); } void VirtualSearch::sClose() { done(_id); } void VirtualSearch::sSelect() { done(_listTab->id()); } void VirtualSearch::setQuery(QSqlQuery query) { _listTab->setFocus(); _listTab->populate(query); } void VirtualSearch::setSearchText(const QString& text) { _search->setText(text); } void VirtualSearch::sFillList() { if (! _parent) return; _listTab->clear(); _search->setText(_search->text().trimmed()); if (_search->text().length() == 0) return; QString search; if (_searchNumber->isChecked()) search += QString("%1~*'%2'").arg(_parent->_numColName).arg(_search->text()); if (_parent->_hasName && (_searchName->isChecked())) search += (search.isEmpty() ? QString("%1~*'%2'").arg(_parent->_nameColName).arg(_search->text()) : " OR " + QString("%1~'%2'").arg(_parent->_nameColName).arg(_search->text())); if (_parent->_hasDescription && (_searchDescrip->isChecked())) search += (search.isEmpty() ? QString("%1~*'%2'").arg(_parent->_descripColName).arg(_search->text()) : " OR " + QString("%1~*'%2'").arg(_parent->_descripColName).arg(_search->text())); if (!search.isEmpty()) { search.prepend("("); search.append(")"); } XSqlQuery qry(_parent->_query + (search.isEmpty() ? "" : " AND " + search) + (_parent->_extraClause.isEmpty() ? "" : " AND " + _parent->_extraClause) + ((_parent->_hasActive && ! _parent->_showInactive) ? _parent->_activeClause : "") + QString(" ORDER BY ") + QString((_parent->_hasName) ? "name" : "number")); _listTab->populate(qry); } /////////////////////////////////////////////////////////////////////////////// VirtualInfo::VirtualInfo(QWidget* pParent, Qt::WindowFlags pFlags) : QDialog(pParent, pFlags) { setAttribute(Qt::WA_DeleteOnClose); setWindowModality(Qt::WindowModal); _parent = (VirtualClusterLineEdit*)(pParent); setObjectName("virtualInfo"); setWindowTitle(_parent->_titleSingular); _id = _parent->_id; _titleLit = new QLabel(_parent->_titleSingular, this); _titleLit->setObjectName("_titleLit"); _numberLit = new QLabel(tr("Number:"), this); _numberLit->setObjectName("_numberLit"); _number = new QLabel(this); _number->setObjectName("_number"); _nameLit = new QLabel(tr("Name:"), this); _nameLit->setObjectName("_nameLit"); _name = new QLabel(this); _name->setObjectName("_name"); _descripLit = new QLabel(tr("Description:"), this); _descripLit->setObjectName("_descripLit"); _descrip = new QLabel(this); _descrip->setObjectName("_descrip"); _titleLit->setAlignment(Qt::AlignVCenter | Qt::AlignLeft); _numberLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _nameLit->setAlignment(Qt::AlignVCenter | Qt::AlignRight); _close = new QPushButton(tr("&Close"), this); _close->setObjectName("_close"); _close->setDefault(true); QHBoxLayout* dialogLyt = new QHBoxLayout(this); dialogLyt->setContentsMargins(5, 5, 5, 5); QVBoxLayout* titleLyt = new QVBoxLayout(); dialogLyt->addLayout(titleLyt); titleLyt->addWidget(_titleLit); QHBoxLayout* dataLyt = new QHBoxLayout(); titleLyt->addLayout(dataLyt); QVBoxLayout* litLyt = new QVBoxLayout(); dataLyt->addLayout(litLyt); litLyt->addWidget(_numberLit); litLyt->addWidget(_nameLit); litLyt->addWidget(_descripLit); QVBoxLayout* infoLyt = new QVBoxLayout(); dataLyt->addLayout(infoLyt); infoLyt->addWidget(_number); infoLyt->addWidget(_name); infoLyt->addWidget(_descrip); QSpacerItem* dataHtSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); titleLyt->addItem(dataHtSpacer); QHBoxLayout* buttonLyt = new QHBoxLayout(); dialogLyt->addLayout(buttonLyt); QSpacerItem* wdSpacer = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); buttonLyt->addItem(wdSpacer); QVBoxLayout* buttonColLyt = new QVBoxLayout(); buttonLyt->addLayout(buttonColLyt); buttonColLyt->addWidget(_close); QSpacerItem* htSpacer = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); buttonColLyt->addItem(htSpacer); connect(_close, SIGNAL(clicked()), this, SLOT(close())); _nameLit->setHidden(!_parent->_hasName); _name->setHidden(!_parent->_hasName); _descripLit->setHidden(!_parent->_hasDescription); _descrip->setHidden(!_parent->_hasDescription); sPopulate(); } void VirtualInfo::sPopulate() { XSqlQuery qry; qry.prepare(_parent->_query + _parent->_idClause + ";"); qry.bindValue(":id", _parent->_id); qry.exec(); if (qry.first()) { _number->setText(qry.value("number").toString()); if (_parent->_hasName) _name->setText(qry.value("name").toString()); if (_parent->_hasDescription) _descrip->setText(qry.value("description").toString()); } else if (qry.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), qry.lastError().databaseText()); } qt-client-4.1.0/widgets/virtualCluster.h000066400000000000000000000324731217451700100202720ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef virtCluster_h #define virtCluster_h #include "widgets.h" #include "guiclientinterface.h" #include "parameter.h" #include "xlineedit.h" #include "xtextedit.h" #include "xtreewidget.h" #include "xcheckbox.h" #include "xdatawidgetmapper.h" #include #include #include #include #include #include #include #include #include #include #include #include #include class QGridLayout; class VirtualClusterLineEdit; #define ID 1 #define NUMBER 2 #define DESCRIPTION 3 #define ACTIVE 4 class XTUPLEWIDGETS_EXPORT VirtualList : public QDialog { Q_OBJECT friend class VirtualClusterLineEdit; public: VirtualList(); VirtualList(QWidget*, Qt::WindowFlags = 0); public slots: virtual void sClose(); virtual void sFillList(); virtual void sSearch(const QString&); virtual void sSelect(); protected: virtual void init(); void showEvent(QShowEvent *); VirtualClusterLineEdit* _parent; QVBoxLayout* _dialogLyt; QLabel* _searchLit; QLineEdit* _search; QLabel* _titleLit; QDialogButtonBox* _buttonBox; QPushButton* _select; XTreeWidget* _listTab; int _id; }; class XTUPLEWIDGETS_EXPORT VirtualSearch : public QDialog { Q_OBJECT friend class VirtualClusterLineEdit; public: VirtualSearch(QWidget*, Qt::WindowFlags = 0); Q_INVOKABLE virtual void setQuery(QSqlQuery query); Q_INVOKABLE virtual void setSearchText(const QString& text); public slots: virtual void sClose(); virtual void sFillList(); virtual void sSelect(); protected: VirtualClusterLineEdit* _parent; QVBoxLayout* _dialogLyt; int _id; QLabel* _searchLit; QLineEdit* _search; XCheckBox* _searchNumber; XCheckBox* _searchName; XCheckBox* _searchDescrip; QLabel* _titleLit; QDialogButtonBox* _buttonBox; QPushButton* _select; XTreeWidget* _listTab; QLayout* dialogLyt; QLayout* searchLyt; QLayout* searchStrLyt; QGridLayout* selectorsLyt; QLayout* tableLyt; QLayout* buttonsLyt; }; class XTUPLEWIDGETS_EXPORT VirtualInfo : public QDialog { Q_OBJECT friend class VirtualClusterLineEdit; public: VirtualInfo(QWidget*, Qt::WindowFlags = 0); public slots: virtual void sPopulate(); protected: VirtualClusterLineEdit* _parent; QLabel* _titleLit; QLabel* _numberLit; QLabel* _number; QLabel* _nameLit; QLabel* _name; QLabel* _descripLit; QLabel* _descrip; QPushButton* _close; private: int _id; }; /* VirtualClusterLineEdit is an abstract class that encapsulates the basics of retrieving an ID given a NUMBER or a NUMBER given an ID. This class and its subclasses are intended to be used by VirtualCluster objects, not directly by an application. Users of this class need to supply the names of the table, its id column, and its number column (numbers are user-readable strings such as customer abbreviations or purchase order numbers). Subclasses must supply implementations for the sInfo(), sList(), and sSearch() slots. sInfo() is a distinct dialog that shows extended data from the record with table_id = id(). sList() and sSearch() are dialogs that let the user select a number/id pair value for the widget. */ class XTUPLEWIDGETS_EXPORT VirtualClusterLineEdit : public XLineEdit { Q_OBJECT friend class VirtualCluster; friend class VirtualInfo; friend class VirtualList; friend class VirtualSearch; public: VirtualClusterLineEdit(QWidget*, const char*, const char*, const char*, const char*, const char*, const char*, const char* = 0, const char* = 0); void setMenu(QMenu *menu); QMenu *menu() const { return _menu; } static GuiClientInterface *_guiClientInterface; Q_INVOKABLE virtual bool canOpen(); Q_INVOKABLE inline virtual QString uiName() const { return _uiName; } Q_INVOKABLE inline virtual QString editPriv() const { return _editPriv; } Q_INVOKABLE inline virtual QString viewPriv() const { return _viewPriv; } Q_INVOKABLE inline virtual QSqlQueryModel* model() const { return _model;} Q_INVOKABLE inline virtual QString name() const { return _name; } Q_INVOKABLE inline virtual QString description() const { return _description; } public slots: virtual void clear(); virtual QString extraClause() const { return _extraClause; } virtual void sEllipses(); virtual void sInfo(); virtual void sList(); virtual void sOpen(); virtual void sNew(); virtual void sSearch(); virtual void setId(const int); virtual void setNumber(const QString&); virtual void setShowInactive(const bool); virtual void setUiName(const QString& name); virtual void setEditPriv(const QString& priv); virtual void setNewPriv(const QString& priv); virtual void setViewPriv(const QString& priv); protected slots: inline virtual void clearExtraClause() { _extraClause = ""; } virtual VirtualList* listFactory(); virtual VirtualSearch* searchFactory(); virtual VirtualInfo* infoFactory(); virtual void setStrikeOut(bool enable = false); virtual void sHandleCompleter(); virtual void sHandleNullStr(); virtual void sParse(); virtual void sUpdateMenu(); virtual QWidget* sOpenWindow(const QString& uiName, ParameterList ¶ms); virtual void setTitles(const QString&, const QString& = 0); inline virtual void setExtraClause(const QString& pExt) { _extraClause = pExt; } virtual void setTableAndColumnNames(const char* pTabName, const char* pIdColumn, const char* pNumberColumn, const char* pNameColumn, const char* pDescripColumn, const char* pActiveColumn); void setStrict(bool); bool isStrict() const { return _strict; } virtual void completerHighlighted(const QModelIndex &); signals: void newId(int); void parsed(); void valid(bool); protected: virtual bool eventFilter(QObject *obj, QEvent* event); virtual void focusInEvent(QFocusEvent * event); virtual void resizeEvent(QResizeEvent *e); QAction* _infoAct; QAction* _openAct; QAction* _newAct; QCompleter* _completer; QLabel* _menuLabel; QMenu* _menu; QString _titleSingular; QString _titlePlural; QString _query; QString _activeClause; QString _idClause; QString _numClause; QString _extraClause; QString _name; QString _description; QString _idColName; QString _numColName; QString _nameColName; QString _descripColName; QString _activeColName; QString _uiName; QString _editPriv; QString _newPriv; QString _viewPriv; bool _hasDescription; bool _hasName; bool _hasActive; bool _strict; bool _showInactive; int _completerId; virtual void silentSetId(const int); QSqlQueryModel* _model; private: void positionMenuLabel(); QString _cText; }; /* VirtualCluster is a widget that contains a VirtualClusterLineEdit and surrounds it with a label and two buttons. One button lets the user invoke VirtualClusterLineEdit's sInfo slot while another button invokes either sSearch() or sList(), depending on the user's preferences. VirtualCluster provides a copy of much of the VirtualClusterLineEdit API to hide from the caller the fact that it contains one of these objects. It also lets the calling code set it as read-only. */ class XTUPLEWIDGETS_EXPORT VirtualCluster : public QWidget { Q_OBJECT Q_PROPERTY(QString label READ label WRITE setLabel) Q_PROPERTY(bool nameVisible READ nameVisible WRITE setNameVisible) Q_PROPERTY(bool descriptionVisible READ descriptionVisible WRITE setDescriptionVisible) Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly) Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation) Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) Q_PROPERTY(QString number READ number WRITE setNumber DESIGNABLE false) Q_PROPERTY(QString defaultNumber READ defaultNumber WRITE setDefaultNumber DESIGNABLE false) Q_PROPERTY(QString nullStr READ nullStr WRITE setNullStr) friend class VirtualClusterLineEdit; public: VirtualCluster(QWidget*, const char* = 0); VirtualCluster(QWidget*, VirtualClusterLineEdit* = 0, const char* = 0); Q_INVOKABLE inline virtual int id() const { return _number->id(); } inline virtual QString label() const { return _label->text(); } inline virtual QString number() const { return _number->text(); } Q_INVOKABLE inline virtual QString description() const { return _description->text(); } Q_INVOKABLE inline virtual bool isValid() const { return _number->isValid(); } Q_INVOKABLE virtual QString name() const { return _name->text(); } Q_INVOKABLE inline virtual bool isStrict() const { return _number->isStrict(); } inline virtual bool readOnly() const { return _readOnly; } virtual QString defaultNumber() const { return _default; } inline virtual QString fieldName() const { return _fieldName; } Q_INVOKABLE inline virtual QString extraClause() const { return _number->extraClause(); } virtual Qt::Orientation orientation(); virtual void setOrientation(Qt::Orientation orientation); virtual bool nameVisible() const; virtual void setNameVisible(const bool p); virtual bool descriptionVisible() const; virtual void setDescriptionVisible(const bool p); virtual QString nullStr() const; virtual void setNullStr(const QString &text); public slots: // most of the heavy lifting is done by VirtualClusterLineEdit _number virtual void clearExtraClause() { _number->clearExtraClause(); } virtual void setDefaultNumber(const QString& p){ _default=p;} virtual void setDescription(const QString& p) { _description->setText(p); } virtual void setExtraClause(const QString& p) { _number->setExtraClause(p); } virtual void setFieldName(QString p) { _fieldName = p; } virtual void setId(const int p) { _number->setId(p); } virtual void setName(const QString& p) { _name->setText(p); } virtual void setNumber(const int p) { _number->setNumber(QString::number(p)); } virtual void setNumber(const QString& p) { _number->setNumber(p); } virtual void clear(); virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setEnabled(const bool p); virtual void setLabel(const QString& p); virtual void setStrict(const bool b); virtual void setReadOnly(const bool b); virtual void setShowInactive(const bool); virtual void sRefresh(); virtual void updateMapperData(); virtual void sEllipses(); virtual void sInfo(); virtual void sList(); virtual void sSearch(); signals: void newId(int); void valid(bool); protected: virtual void addNumberWidget(VirtualClusterLineEdit* pNumberWidget); QGridLayout* _grid; QLabel* _label; VirtualClusterLineEdit* _number; QLabel* _description; QLabel* _name; QSpacerItem* _hspcr; bool _readOnly; QString _fieldName; QString _default; XDataWidgetMapper *_mapper; Qt::Orientation _orientation; private: virtual void init(); }; #endif qt-client-4.1.0/widgets/warehouseCluster.cpp000066400000000000000000000115361217451700100211360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include "widgets.h" #include "warehouseCluster.h" WComboBox::WComboBox(QWidget *parent, const char *name) : XComboBox(parent, name) { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); setMinimumWidth(80); setType(AllActive); } void WComboBox::setAllowNull(bool pAllowNull) { _allowNull = pAllowNull; setType(_type); } WComboBox::WComboBoxTypes WComboBox::type() { return _type; } void WComboBox::setType(WComboBoxTypes pType) { _type = pType; // If we're in Designer, don't populate QObject *ancestor = this; bool designMode; for ( ; ancestor; ancestor = ancestor->parent()) { designMode = ancestor->inherits("xTupleDesigner"); if (designMode) return; } int warehousid = ((_x_preferences) ? _x_preferences->value("PreferredWarehouse").toInt() : -1); QString whss("SELECT warehous_id, warehous_code, warehous_code " "FROM site() " "WHERE (true" " AND (warehous_active) " "AND (warehous_shipping)" "" " AND (warehous_transit) " "" " AND (NOT warehous_transit)" "" ") " "ORDER BY warehous_code;" ); ParameterList whsp; switch (_type) { case AllActive: whsp.append("active"); break; case Sold: case NonTransit: whsp.append("nottransit"); whsp.append("active"); break; case Shipping: whsp.append("shipping"); whsp.append("active"); break; case Supply: clear(); return; // yes, the previous version just had "clear(); return;" break; case Transit: whsp.append("transit"); whsp.append("active"); break; case All: default: break; } MetaSQLQuery whsm(whss); XSqlQuery whsq = whsm.toQuery(whsp); populate(whsq, warehousid); } void WComboBox::findItemsites(int pItemID) { if (pItemID != -1) { QString iss("SELECT warehous_id, warehous_code, warehous_code " "FROM site(), itemsite " "WHERE ((itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=) " " AND (warehous_active) " "AND (warehous_shipping)" "" " AND (warehous_transit) " "" " AND (NOT warehous_transit)" "" " AND (itemsite_active) " " AND (itemsite_sold) " " AND ( (itemsite_wosupply) OR (itemsite_posupply) OR (itemsite_supply_itemsite_id IS NOT NULL) ) " " AND (itemsite_controlmethod<>'N') " ") " "ORDER BY warehous_code;" ); ParameterList isp; isp.append("itemid", pItemID); switch (_type) { case AllActive: isp.append("active"); break; case AllActiveInventory: isp.append("active"); isp.append("inventory"); break; case NonTransit: isp.append("nottransit"); isp.append("active"); break; case Sold: isp.append("active"); isp.append("nottransit"); isp.append("soldIS"); break; /* TODO: ? previous version of this function didn't have Shipping case case Shipping: isp.append("shipping"); isp.append("active"); break; */ case Supply: isp.append("active"); isp.append("supplyIS"); break; case Transit: isp.append("transit"); isp.append("active"); break; case All: default: break; } MetaSQLQuery ism(iss); XSqlQuery isq = ism.toQuery(isp); populate(isq, ((_x_preferences) ? _x_preferences->value("PreferredWarehouse").toInt() : -1)); if (currentIndex() == -1) setCurrentIndex(0); } else clear(); } void WComboBox::setId(int pId) { XComboBox::setId(pId); } qt-client-4.1.0/widgets/warehouseCluster.h000066400000000000000000000021321217451700100205730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef warehouseCluster_h #define warehouseCluster_h #include "widgets.h" #include "xcombobox.h" class XTUPLEWIDGETS_EXPORT WComboBox : public XComboBox { Q_OBJECT Q_ENUMS(WComboBoxTypes) Q_PROPERTY(WComboBoxTypes type READ type WRITE setType ) public: WComboBox(QWidget *, const char * = 0); enum WComboBoxTypes { All, AllActive, NonTransit, Shipping, Sold, Supply, Transit, AllActiveInventory }; WComboBoxTypes type(); void setType(WComboBoxTypes); virtual void setAllowNull(bool); public slots: void findItemsites(int); void setId(int); private: enum WComboBoxTypes _type; }; #endif qt-client-4.1.0/widgets/warehousegroup.cpp000066400000000000000000000120201217451700100206360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include "warehouseCluster.h" #include "warehousegroup.h" WarehouseGroup::WarehouseGroup(QWidget *pParent, const char *pName) : QGroupBox(pParent) { _selectedOnly = false; if (_x_preferences) if (_x_preferences->boolean("selectedSites")) _selectedOnly=true; if(pName) setObjectName(pName); _fixed = true; _selectedGroup = new QWidget(this); QButtonGroup * buttonGroup = new QButtonGroup(this); _all = new QRadioButton(tr("All Sites"), this); _all->setObjectName("_all"); _site = new QLabel(tr("Site:"),this); _site->setObjectName("_site"); _selected = new QRadioButton(tr("Selected:"), _selectedGroup); _selected->setObjectName("_selected"); if (!_selectedOnly) { _all->setChecked(TRUE); buttonGroup->addButton(_all); buttonGroup->addButton(_selected); } _warehouses = new WComboBox(_selectedGroup, "_warehouses"); if(_selectedOnly) { QHBoxLayout *hLayout = new QHBoxLayout(_selectedGroup); hLayout->setContentsMargins(0, 0, 0, 0); hLayout->setSpacing(5); hLayout->addWidget(_site); hLayout->addWidget(_warehouses); hLayout->addStretch(); _selectedGroup->setLayout(hLayout); QVBoxLayout *vLayout = new QVBoxLayout(this); vLayout->setContentsMargins(5, 5, 5, 5); vLayout->setSpacing(0); vLayout->addWidget(_selectedGroup); setLayout(vLayout); _all->hide(); _selected->hide(); } else { _site->hide(); setFixedSize(false); } connect(_selected, SIGNAL(toggled(bool)), _warehouses, SLOT(setEnabled(bool))); connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SIGNAL(updated())); connect(_warehouses, SIGNAL(newID(int)), this, SIGNAL(updated())); if (((_x_preferences) ? _x_preferences->value("PreferredWarehouse").toInt() : -1) != -1) _selected->setChecked(TRUE); setTabOrder(_all, _selected); setTabOrder(_selected, _warehouses); setTabOrder(_warehouses, _all); setFocusProxy(_all); if (_x_metrics) { if (!_x_metrics->boolean("MultiWhs")) { this->hide(); setAll(); } } } void WarehouseGroup::setAll() { _all->setChecked(TRUE); } void WarehouseGroup::setFixedSize(bool pFixed) { if (pFixed == _fixed || _selectedOnly) return; if (layout()) delete layout(); if (_selectedGroup->layout()) delete _selectedGroup->layout(); if (pFixed) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QHBoxLayout *hLayout = new QHBoxLayout(_selectedGroup); hLayout->setMargin(0); hLayout->setSpacing(5); hLayout->addWidget(_selected); hLayout->addWidget(_warehouses); _selectedGroup->setLayout(hLayout); QVBoxLayout *vLayout = new QVBoxLayout(this); vLayout->setMargin(5); vLayout->setSpacing(0); vLayout->addWidget(_all); vLayout->addWidget(_selectedGroup); setLayout(vLayout); } else { setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); QGridLayout *gridLayout = new QGridLayout(); gridLayout->addWidget(_all,0,0); gridLayout->addWidget(_selected,1,0); gridLayout->addWidget(_warehouses,1,1); #if defined Q_OS_MAC gridLayout->setRowMinimumHeight(0,24); #endif QHBoxLayout *hLayout = new QHBoxLayout(); hLayout->addLayout(gridLayout); QSpacerItem * spacerItem = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); hLayout->addItem(spacerItem); QVBoxLayout *vLayout = new QVBoxLayout(); vLayout->addLayout(hLayout); QSpacerItem * spacerItem1 = new QSpacerItem(20, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); vLayout->addItem(spacerItem1); QGridLayout *siteLayout = new QGridLayout(this); siteLayout->addLayout(vLayout,0,0); } _warehouses->setEnabled(FALSE); _fixed = pFixed; } void WarehouseGroup::setId(int pId) { _selected->setChecked(TRUE); _warehouses->setId(pId); } void WarehouseGroup::appendValue(ParameterList &pParams) { if (_selected->isChecked()) pParams.append("warehous_id", _warehouses->id()); } void WarehouseGroup::bindValue(XSqlQuery &pQuery) { if (_selected->isChecked()) pQuery.bindValue(":warehous_id", _warehouses->id()); } void WarehouseGroup::findItemSites(int pItemid) { _warehouses->findItemsites(pItemid); } int WarehouseGroup::id() { if (_selected->isChecked()) return _warehouses->id(); else return -1; } bool WarehouseGroup::isAll() const { return _all->isChecked(); } bool WarehouseGroup::isSelected() const { return _selected->isChecked(); } qt-client-4.1.0/widgets/warehousegroup.h000066400000000000000000000026221217451700100203120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef warehousegroup_h #define warehousegroup_h #include #include #include #include "widgets.h" class WComboBox; class ParameterList; class XSqlQuery; class XTUPLEWIDGETS_EXPORT WarehouseGroup : public QGroupBox { Q_OBJECT Q_PROPERTY(bool fixedSize READ fixedSize WRITE setFixedSize) public: WarehouseGroup(QWidget * = 0, const char * = 0); bool fixedSize() {return _fixed;}; void appendValue(ParameterList &); void bindValue(XSqlQuery &); Q_INVOKABLE int id(); Q_INVOKABLE bool isAll() const; Q_INVOKABLE bool isSelected() const; public slots: void setFixedSize(bool); void setAll(); void setId(int); void findItemSites(int); signals: void updated(); private: bool _fixed; bool _selectedOnly; QLabel *_site; QRadioButton *_all; QRadioButton *_selected; QWidget *_selectedGroup; WComboBox *_warehouses; }; #endif qt-client-4.1.0/widgets/wcombobox.h000066400000000000000000000007321217451700100172320ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "warehouseCluster.h" qt-client-4.1.0/widgets/widgets.cpp000066400000000000000000000176511217451700100172440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "widgets.h" #include "xtupleplugin.h" #include "plugins/addressclusterplugin.h" #include "plugins/alarmsplugin.h" #include "plugins/aropenclusterplugin.h" #include "plugins/calendarcomboboxplugin.h" #include "plugins/clineeditplugin.h" #include "plugins/cmheadclusterplugin.h" #include "plugins/commentsplugin.h" #include "plugins/contactclusterplugin.h" #include "plugins/contactwidgetplugin.h" #include "plugins/crmacctclusterplugin.h" #include "plugins/currclusterplugin.h" #include "plugins/currdisplayplugin.h" #include "plugins/custclusterplugin.h" #include "plugins/customerselectorplugin.h" #include "plugins/dateclusterplugin.h" #include "plugins/deptclusterplugin.h" #include "plugins/dlineeditplugin.h" #include "plugins/documentsplugin.h" #include "plugins/empclusterplugin.h" #include "plugins/expenseclusterplugin.h" #include "plugins/expenselineeditplugin.h" #include "plugins/fileclusterplugin.h" #include "plugins/filemoveselectorplugin.h" #include "plugins/glclusterplugin.h" #include "plugins/imageclusterplugin.h" #include "plugins/invoiceclusterplugin.h" #include "plugins/invoicelineeditplugin.h" #include "plugins/incidentclusterplugin.h" #include "plugins/itemclusterplugin.h" #include "plugins/itemlineeditplugin.h" #include "plugins/lotserialclusterplugin.h" #include "plugins/lotserialseqclusterplugin.h" #include "plugins/numbergencomboboxplugin.h" #include "plugins/orderclusterplugin.h" #include "plugins/menubuttonplugin.h" #include "plugins/opportunityclusterplugin.h" #include "plugins/parametergroupplugin.h" #include "plugins/parameterwidgetplugin.h" #include "plugins/periodslistviewplugin.h" #include "plugins/planordclusterplugin.h" #include "plugins/planordlineeditplugin.h" #include "plugins/projectclusterplugin.h" #include "plugins/projectlineeditplugin.h" #include "plugins/querysetplugin.h" #include "plugins/quoteclusterplugin.h" #include "plugins/raclusterplugin.h" #include "plugins/recurrencewidgetplugin.h" #include "plugins/revisionclusterplugin.h" #include "plugins/screenplugin.h" #include "plugins/shiftclusterplugin.h" #include "plugins/shipmentclusterplugin.h" #include "plugins/shiptoclusterplugin.h" #include "plugins/shiptoeditplugin.h" #include "plugins/usernameclusterplugin.h" #include "plugins/usernamelineeditplugin.h" #include "plugins/vendorclusterplugin.h" #include "plugins/vendorgroupplugin.h" #include "plugins/vendorlineeditplugin.h" #include "plugins/warehousegroupplugin.h" #include "plugins/wcomboboxplugin.h" #include "plugins/woclusterplugin.h" #include "plugins/wolineeditplugin.h" #include "plugins/womatlclusterplugin.h" #include "plugins/workcenterclusterplugin.h" #include "plugins/workcenterlineeditplugin.h" #include "plugins/xcheckboxplugin.h" #include "plugins/xcomboboxplugin.h" #include "plugins/xdoccopysetterplugin.h" #include "plugins/xlabelplugin.h" #include "plugins/xlineeditplugin.h" #include "plugins/xtreewidgetplugin.h" #include "plugins/xtreeviewplugin.h" #include "plugins/xspinboxplugin.h" #include "plugins/xurllabelplugin.h" #include "plugins/xtexteditplugin.h" #include "plugins/xtableviewplugin.h" xTuplePlugin::xTuplePlugin(QObject * parent) : QObject(parent) { m_plugins.append(new AddressClusterPlugin(this)); m_plugins.append(new AlarmsPlugin(this)); m_plugins.append(new AropenClusterPlugin(this)); m_plugins.append(new CalendarComboBoxPlugin(this)); m_plugins.append(new CLineEditPlugin(this)); m_plugins.append(new CmheadClusterPlugin(this)); m_plugins.append(new CommentsPlugin(this)); m_plugins.append(new ContactClusterPlugin(this)); m_plugins.append(new ContactWidgetPlugin(this)); m_plugins.append(new CRMAcctClusterPlugin(this)); m_plugins.append(new CurrClusterPlugin(this)); m_plugins.append(new CurrDisplayPlugin(this)); m_plugins.append(new CustClusterPlugin(this)); m_plugins.append(new CustomerSelectorPlugin(this)); m_plugins.append(new DateClusterPlugin(this)); m_plugins.append(new DeptClusterPlugin(this)); m_plugins.append(new DLineEditPlugin(this)); m_plugins.append(new DocumentsPlugin(this)); m_plugins.append(new EmpClusterPlugin(this)); m_plugins.append(new ExpenseClusterPlugin(this)); m_plugins.append(new ExpenseLineEditPlugin(this)); m_plugins.append(new FileClusterPlugin(this)); m_plugins.append(new FileMoveSelectorPlugin(this)); m_plugins.append(new GLClusterPlugin(this)); m_plugins.append(new ImageClusterPlugin(this)); m_plugins.append(new InvoiceClusterPlugin(this)); m_plugins.append(new InvoiceLineEditPlugin(this)); m_plugins.append(new IncidentClusterPlugin(this)); m_plugins.append(new ItemClusterPlugin(this)); m_plugins.append(new ItemLineEditPlugin(this)); m_plugins.append(new LotserialClusterPlugin(this)); m_plugins.append(new LotserialseqClusterPlugin(this)); m_plugins.append(new MenuButtonPlugin(this)); m_plugins.append(new NumberGenComboBoxPlugin(this)); m_plugins.append(new OrderClusterPlugin(this)); m_plugins.append(new OpportunityClusterPlugin(this)); m_plugins.append(new ParameterGroupPlugin(this)); m_plugins.append(new ParameterWidgetPlugin(this)); m_plugins.append(new PeriodsListViewPlugin(this)); m_plugins.append(new PlanOrdClusterPlugin(this)); m_plugins.append(new PlanOrdLineEditPlugin(this)); m_plugins.append(new ProjectClusterPlugin(this)); m_plugins.append(new ProjectLineEditPlugin(this)); m_plugins.append(new QuerySetPlugin(this)); m_plugins.append(new QuoteClusterPlugin(this)); m_plugins.append(new RaClusterPlugin(this)); m_plugins.append(new RecurrenceWidgetPlugin(this)); m_plugins.append(new RevisionClusterPlugin(this)); m_plugins.append(new ScreenPlugin(this)); m_plugins.append(new ShiftClusterPlugin(this)); m_plugins.append(new ShipmentClusterPlugin(this)); m_plugins.append(new ShiptoClusterPlugin(this)); m_plugins.append(new ShiptoEditPlugin(this)); m_plugins.append(new UsernameClusterPlugin(this)); m_plugins.append(new UsernameLineEditPlugin(this)); m_plugins.append(new VendorClusterPlugin(this)); m_plugins.append(new VendorGroupPlugin(this)); m_plugins.append(new VendorLineEditPlugin(this)); m_plugins.append(new WarehouseGroupPlugin(this)); m_plugins.append(new WComboBoxPlugin(this)); m_plugins.append(new WoClusterPlugin(this)); m_plugins.append(new WoLineEditPlugin(this)); m_plugins.append(new WomatlClusterPlugin(this)); m_plugins.append(new WorkCenterClusterPlugin(this)); m_plugins.append(new WorkCenterLineEditPlugin(this)); m_plugins.append(new XCheckBoxPlugin(this)); m_plugins.append(new XComboBoxPlugin(this)); m_plugins.append(new XDocCopySetterPlugin(this)); m_plugins.append(new XLabelPlugin(this)); m_plugins.append(new XLineEditPlugin(this)); m_plugins.append(new XSpinBoxPlugin(this)); m_plugins.append(new XTreeWidgetPlugin(this)); m_plugins.append(new XTreeViewPlugin(this)); m_plugins.append(new XURLLabelPlugin(this)); m_plugins.append(new XTextEditPlugin(this)); m_plugins.append(new XTableViewPlugin(this)); } QList xTuplePlugin::customWidgets() const { return m_plugins; } #ifndef QT_STATICPLUGIN Q_EXPORT_PLUGIN2(xtuplewidgets, xTuplePlugin) #else Q_EXPORT_STATIC_PLUGIN(xTuplePlugin) #endif Preferences *_x_preferences = 0; Metrics *_x_metrics = 0; QMdiArea *_x_workspace = 0; Privileges *_x_privileges = 0; QString _x_username; void initializePlugin(Preferences *pPreferences, Metrics *pMetrics, Privileges *pPrivileges, QString pUsername, QMdiArea *pWorkspace) { _x_preferences = pPreferences; _x_metrics = pMetrics; _x_workspace = pWorkspace; _x_privileges = pPrivileges; _x_username = pUsername; } qt-client-4.1.0/widgets/widgets.h000066400000000000000000000020551217451700100167010ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef widgets_h #define widgets_h #define cNew 1 #define cEdit 2 #define cView 3 #include #include "parameter.h" #ifdef Q_WS_WIN #ifdef MAKEDLL #define XTUPLEWIDGETS_EXPORT __declspec(dllexport) #else #define XTUPLEWIDGETS_EXPORT #endif #else #define XTUPLEWIDGETS_EXPORT #endif class Preferences; class Metrics; class QMdiArea; class Privileges; class QWidget; extern Preferences *_x_preferences; extern Metrics *_x_metrics; extern QMdiArea *_x_workspace; extern Privileges *_x_privileges; extern QString _x_username; #endif qt-client-4.1.0/widgets/widgets.pro000066400000000000000000000174711217451700100172620ustar00rootroot00000000000000include( ../global.pri ) TARGET = xtuplewidgets TEMPLATE = lib CONFIG += qt \ warn_on \ designer \ plugin # INCLUDEPATH += $$QT_SOURCE_TREE/tools/designer/interfaces ../common . INCLUDEPATH += ../common \ . DBFILE = widgets.db LANGUAGE = C++ DEPENDPATH += ../common dynamic { CONFIG += dll # this is technically redundant as plugin implies dll however it fixes a cross-compile problem DESTDIR = $$[QT_INSTALL_PLUGINS]/designer LIBS += -L../lib \ -L../$$OPENRPT_BLD/lib \ -lxtuplecommon \ -lwrtembed \ -lrenderer \ -lMetaSQL \ -lcommon DEFINES += MAKEDLL MOC_DIR = tmp/dll OBJECTS_DIR = tmp/dll UI_DIR = tmp/dll } else { DESTDIR = ../lib CONFIG += staticlib MOC_DIR = tmp/lib OBJECTS_DIR = tmp/lib UI_DIR = tmp/lib } HEADERS += plugins/addressclusterplugin.h \ plugins/alarmsplugin.h \ plugins/cmheadclusterplugin.h \ plugins/calendarcomboboxplugin.h \ plugins/clineeditplugin.h \ plugins/aropenclusterplugin.h \ plugins/commentsplugin.h \ plugins/contactclusterplugin.h \ plugins/contactwidgetplugin.h \ plugins/crmacctclusterplugin.h \ plugins/currclusterplugin.h \ plugins/currdisplayplugin.h \ plugins/custclusterplugin.h \ plugins/customerselectorplugin.h \ plugins/dateclusterplugin.h \ plugins/deptclusterplugin.h \ plugins/dlineeditplugin.h \ plugins/documentsplugin.h \ plugins/empclusterplugin.h \ plugins/empgroupclusterplugin.h \ plugins/expenseclusterplugin.h \ plugins/expenselineeditplugin.h \ plugins/fileclusterplugin.h \ plugins/filemoveselectorplugin.h \ plugins/glclusterplugin.h \ plugins/imageclusterplugin.h \ plugins/invoiceclusterplugin.h \ plugins/invoicelineeditplugin.h \ plugins/incidentclusterplugin.h \ plugins/itemclusterplugin.h \ plugins/itemlineeditplugin.h \ plugins/lotserialclusterplugin.h \ plugins/lotserialseqclusterplugin.h \ plugins/menubuttonplugin.h \ plugins/numbergencomboboxplugin.h \ plugins/orderclusterplugin.h \ plugins/opportunityclusterplugin.h \ plugins/parametergroupplugin.h \ plugins/parameterwidgetplugin.h \ plugins/periodslistviewplugin.h \ plugins/planordclusterplugin.h \ plugins/planordlineeditplugin.h \ plugins/projectclusterplugin.h \ plugins/projectlineeditplugin.h \ plugins/querysetplugin.h \ plugins/quoteclusterplugin.h \ plugins/raclusterplugin.h \ plugins/recurrencewidgetplugin.h \ plugins/revisionclusterplugin.h \ plugins/shiftclusterplugin.h \ plugins/shipmentclusterplugin.h \ plugins/shiptoclusterplugin.h \ plugins/shiptoeditplugin.h \ plugins/usernameclusterplugin.h \ plugins/usernamelineeditplugin.h \ plugins/vendorclusterplugin.h \ plugins/vendorgroupplugin.h \ plugins/vendorlineeditplugin.h \ plugins/warehousegroupplugin.h \ plugins/wcomboboxplugin.h \ plugins/woclusterplugin.h \ plugins/wolineeditplugin.h \ plugins/womatlclusterplugin.h \ plugins/workcenterclusterplugin.h \ plugins/workcenterlineeditplugin.h \ plugins/xcheckboxplugin.h \ plugins/xcomboboxplugin.h \ plugins/xdoccopysetterplugin.h \ plugins/xlabelplugin.h \ plugins/xlineeditplugin.h \ plugins/xtreewidgetplugin.h \ plugins/xurllabelplugin.h \ plugins/xtexteditplugin.h \ plugins/screenplugin.h \ plugins/xtreeviewplugin.h \ plugins/xspinboxplugin.h \ plugins/xtableviewplugin.h \ SOURCES += widgets.cpp \ addressCluster.cpp \ alarmMaint.cpp \ alarms.cpp \ aropencluster.cpp \ calendarTools.cpp \ cmheadcluster.cpp \ comment.cpp \ comments.cpp \ contactCluster.cpp \ contactemail.cpp \ contactWidget.cpp \ crmacctCluster.cpp \ crmCluster.cpp \ currCluster.cpp \ custCluster.cpp \ customerselector.cpp \ datecluster.cpp \ deptCluster.cpp \ docAttach.cpp \ documents.cpp \ editwatermark.cpp \ empcluster.cpp \ empgroupcluster.cpp \ expensecluster.cpp \ filecluster.cpp \ filemoveselector.cpp \ filterManager.cpp \ filterSave.cpp \ glCluster.cpp \ imageAssignment.cpp \ imagecluster.cpp \ imageview.cpp \ incidentCluster.cpp \ invoiceCluster.cpp \ invoiceLineEdit.cpp \ itemAliasList.cpp \ itemCluster.cpp \ lotserialCluster.cpp \ lotserialseqcluster.cpp \ menubutton.cpp \ numbergencombobox.cpp \ opportunitycluster.cpp \ ordercluster.cpp \ parametergroup.cpp \ parameterwidget.cpp \ plCluster.cpp \ projectCluster.cpp \ queryitem.cpp \ queryset.cpp \ quoteList.cpp \ quotecluster.cpp \ racluster.cpp \ recurrencewidget.cpp \ revisionCluster.cpp \ salesOrderList.cpp \ screen.cpp \ shiftCluster.cpp \ shipmentCluster.cpp \ shiptoCluster.cpp \ transferOrderList.cpp \ usernameCluster.cpp \ vendorcluster.cpp \ vendorgroup.cpp \ virtualCluster.cpp \ warehouseCluster.cpp \ warehousegroup.cpp \ woCluster.cpp \ workcenterCluster.cpp \ xcheckbox.cpp \ xcombobox.cpp \ xdatawidgetmapper.cpp \ xdoccopysetter.cpp \ xdoublevalidator.cpp \ xitemdelegate.cpp \ xlabel.cpp \ xlineedit.cpp \ xlistbox.cpp \ xspinbox.cpp \ xsqltablemodel.cpp \ xtableview.cpp \ xtextedit.cpp \ xtreeview.cpp \ xtreewidget.cpp \ xtreewidgetprogress.cpp \ xurllabel.cpp \ HEADERS += widgets.h \ xtupleplugin.h \ guiclientinterface.h \ addresscluster.h \ alarmMaint.h \ alarms.h \ aropencluster.h \ calendarTools.h \ cmheadcluster.h \ comment.h \ comments.h \ contactcluster.h \ contactemail.h \ contactwidget.h \ crmacctcluster.h \ crmcluster.h \ currcluster.h \ custcluster.h \ customerselector.h \ datecluster.h \ dcalendarpopup.h \ deptcluster.h \ docAttach.h \ documents.h \ editwatermark.h \ empcluster.h \ empgroupcluster.h \ expensecluster.h \ filecluster.h \ filemoveselector.h \ filterManager.h \ filtersave.h \ glcluster.h \ imageAssignment.h \ imagecluster.h \ imageview.h \ incidentcluster.h \ invoicecluster.h \ invoicelineedit.h \ itemAliasList.h \ itemcluster.h \ lotserialCluster.h \ lotserialseqcluster.h \ menubutton.h \ numbergencombobox.h \ opportunitycluster.h \ ordercluster.h \ parametergroup.h \ parameterwidget.h \ plCluster.h \ projectcluster.h \ queryitem.h \ queryset.h \ quoteList.h \ quotecluster.h \ racluster.h \ recurrencewidget.h \ revisioncluster.h \ salesOrderList.h \ screen.h \ shiftcluster.h \ shipmentcluster.h \ shiptocluster.h \ transferOrderList.h \ usernamecluster.h \ vendorcluster.h \ vendorgroup.h \ virtualCluster.h \ warehouseCluster.h \ warehousegroup.h \ woCluster.h \ workcentercluster.h \ xcheckbox.h \ xcombobox.h \ xcomboboxprivate.h \ xdatawidgetmapper.h \ xdoccopysetter.h \ xdoublevalidator.h \ xitemdelegate.h \ xlabel.h \ xlineedit.h \ xlistbox.h \ xspinbox.h \ xsqltablemodel.h \ xtableview.h \ xtextedit.h \ xtreeview.h \ xtreewidget.h \ xtreewidgetprogress.h \ xurllabel.h \ FORMS += alarmMaint.ui \ alarms.ui \ contactemail.ui \ customerselector.ui \ docAttach.ui \ documents.ui \ editwatermark.ui \ filemoveselector.ui \ filterManager.ui \ filterSave.ui \ imageAssignment.ui \ imageview.ui \ menubutton.ui \ parameterwidget.ui \ queryitem.ui \ queryset.ui \ recurrencewidget.ui \ vendorgroup.ui \ womatlcluster.ui \ xdoccopysetter.ui RESOURCES += widgets.qrc QT += sql script qt-client-4.1.0/widgets/widgets.qrc000066400000000000000000000005541217451700100172410ustar00rootroot00000000000000 images/calendar_24.png images/xcheckbox.png images/magnifier.png images/folder_zoom_64.png images/edit.png images/credit_warn.png images/credit_hold.png qt-client-4.1.0/widgets/woCluster.cpp000066400000000000000000000765041217451700100175670ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include "warehousegroup.h" #include "xcombobox.h" #include "xlineedit.h" #include "wocluster.h" #include "../common/format.h" void setupWoCluster(QScriptEngine *engine) { QScriptValue widget = engine->newObject(); widget.setProperty("Open", QScriptValue(engine, WoLineEdit::Open), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Exploded", QScriptValue(engine, WoLineEdit::Exploded), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Issued", QScriptValue(engine, WoLineEdit::Issued), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Released", QScriptValue(engine, WoLineEdit::Released), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Closed", QScriptValue(engine, WoLineEdit::Closed), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("WoLineEdit", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } WoLineEdit::WoLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "wo", "wo_id", "wo_number::text || '-' || wo_subnumber::text", "item_number", "(item_descrip1 || ' ' || item_descrip2) ", 0, pName) { _woType = 0; init(); } WoLineEdit::WoLineEdit(int pWoType, QWidget* pParent, const char* pName) : VirtualClusterLineEdit(pParent, "wo", "wo_id", "wo_number::text || '-' || wo_subnumber::text", "item_number", "(item_descrip1 || ' ' || item_descrip2) ", 0, pName) { _woType = pWoType; init(); } void WoLineEdit::init() { setTitles(tr("Work Order"), tr("Work Orders")); setUiName("workOrder"); setEditPriv("MaintainWorkOrders"); setViewPriv("ViewWorkOrders"); setNewPriv("MaintainWorkOrders"); _warehouseid = -1; _qtyOrdered = 0.0; _qtyReceived = 0.0; _query = QString("SELECT wo_id AS id, " " wo_number::text || '-' || wo_subnumber::text AS number," " item_number AS name, " " (item_descrip1 || ' ' || item_descrip2) AS description, " " warehous_id," " warehous_code, item_id, item_number, uom_name," " item_descrip1, " " item_descrip2," " abs(wo_qtyord) AS wo_qtyord," " abs(wo_qtyrcv) AS wo_qtyrcv, " " CASE WHEN (wo_status = 'O') THEN '%3' " " WHEN (wo_status = 'E') THEN '%4' " " WHEN (wo_status = 'I') THEN '%5' " " WHEN (wo_status = 'R') THEN '%6' " " WHEN (wo_status = 'C') THEN '%7' " " END AS wo_status," " wo_duedate," " wo_startdate," " noNeg(abs(wo_qtyord) - abs(wo_qtyrcv)) AS balance, " " CASE WHEN (wo_qtyord >= 0) THEN " " '%1' " " ELSE " " '%2' " " END AS wo_method, " " CASE WHEN (wo_qtyord >= 0) THEN " " 'A' " " ELSE " " 'D' " " END AS method " "FROM wo " " JOIN itemsite ON (wo_itemsite_id=itemsite_id) " " JOIN item ON (itemsite_item_id=item_id) " " JOIN whsinfo ON (itemsite_warehous_id=warehous_id) " " JOIN uom ON (item_inv_uom_id=uom_id) " "WHERE (true) " ) .arg(tr("Assembly")) .arg(tr("Disassembly")) .arg(tr("Open")) .arg(tr("Exploded")) .arg(tr("In Process")) .arg(tr("Released")) .arg(tr("Closed")); } void WoLineEdit::silentSetId(const int pId) { if (pId != -1) { XSqlQuery wo; wo.prepare(_query + _idClause + (_extraClause.isEmpty() || !_strict ? "" : " AND " + _extraClause) + QString(";")); wo.bindValue(":id", pId); wo.exec(); if (wo.first()) { if (_completer) static_cast(_completer->model())->setQuery(QSqlQuery()); _id = pId; _valid = TRUE; setText(wo.value("number").toString()); _qtyOrdered = wo.value("wo_qtyord").toDouble(); _qtyReceived = wo.value("wo_qtyrcv").toDouble(); _method = wo.value("method").toString(); _currentWarehouseid = (wo.value("warehous_id").isNull()) ? -1 : wo.value("warehous_id").toInt(); emit newId(_id); emit newItemid(wo.value("item_id").toInt()); emit warehouseChanged(wo.value("warehous_code").toString()); emit itemNumberChanged(wo.value("item_number").toString()); emit uomChanged(wo.value("uom_name").toString()); emit itemDescrip1Changed(wo.value("item_descrip1").toString()); emit itemDescrip2Changed(wo.value("item_descrip2").toString()); emit startDateChanged(wo.value("wo_startdate").toDate()); emit dueDateChanged(wo.value("wo_duedate").toDate()); emit qtyOrderedChanged(wo.value("wo_qtyord").toDouble()); emit qtyReceivedChanged(wo.value("wo_qtyrcv").toDouble()); emit qtyBalanceChanged(wo.value("balance").toDouble()); emit statusChanged(wo.value("wo_status").toString()); emit methodChanged(wo.value("wo_method").toString()); emit valid(TRUE); } } else { _id = -1; _valid = FALSE; _currentWarehouseid = -1; XLineEdit::clear(); emit newId(-1); emit newItemid(-1); emit warehouseChanged(""); emit itemNumberChanged(""); emit uomChanged(""); emit itemDescrip1Changed(""); emit itemDescrip2Changed(""); emit startDateChanged(QDate()); emit dueDateChanged(QDate()); emit qtyOrderedChanged(0); emit qtyReceivedChanged(0); emit qtyBalanceChanged(0); emit statusChanged(""); emit methodChanged(""); emit valid(FALSE); _qtyOrdered = 0; _qtyReceived = 0; } _parsed = TRUE; emit parsed(); } void WoLineEdit::sList() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); woList* newdlg = listFactory(); if (newdlg) { ParameterList params; params.append("wo_id", _id); params.append("woType", _woType); if (_warehouseid != -1) params.append("warehous_id", _warehouseid); newdlg->set(params); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sList() not yet defined") .arg(metaObject()->className())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } void WoLineEdit::sSearch() { disconnect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); woSearch* newdlg = searchFactory(); if (newdlg) { ParameterList params; params.append("wo_id", _id); params.append("woType", _woType); if (_warehouseid != -1) params.append("warehous_id", _warehouseid); newdlg->set(params); int id = newdlg->exec(); setId(id); } else QMessageBox::critical(this, tr("A System Error Occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), tr("%1::sList() not yet defined") .arg(metaObject()->className())); connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); } woList* WoLineEdit::listFactory() { return new woList(this); } woSearch* WoLineEdit::searchFactory() { return new woSearch(this); } void WoLineEdit::setType(int pWoType) { if (_woType == pWoType) return; _woType = pWoType; buildExtraClause(); } void WoLineEdit::setWarehouse(int pWarehouseid) { if (_warehouseid == pWarehouseid) return; _warehouseid = pWarehouseid; buildExtraClause(); } void WoLineEdit::buildExtraClause() { if (!_woType && !_warehouseid) { _extraClause.clear(); return; } if (_woType) { QStringList statuses; if (_woType & cWoOpen) statuses << "'O'"; if (_woType & cWoExploded) statuses << "'E'"; if (_woType & cWoReleased) statuses << "'R'"; if (_woType & cWoIssued) statuses << "'I'"; if (_woType & cWoClosed) statuses << "'C'"; if(!statuses.isEmpty()) _extraClause = "(wo_status IN (" + statuses.join(",") + "))"; } if (!_extraClause.isEmpty() && _warehouseid > 0) _extraClause += " AND "; if (_warehouseid > 0) _extraClause += QString(" (warehous_id=%1) ").arg(_warehouseid); } ////////////////////////////////////////////////// WoCluster::WoCluster(QWidget *pParent, const char *name) : QWidget(pParent) { setObjectName(name); constructor(); } WoCluster::WoCluster(int pWoType, QWidget *pParent, const char *name) : QWidget(pParent) { setObjectName(name); constructor(); _woNumber->setType(pWoType); } void WoCluster::constructor() { _mainLayout = new QVBoxLayout(this); _woLayout = new QHBoxLayout(0); _warehouseLayout = new QHBoxLayout(0); _line1Layout = new QHBoxLayout(0); _itemLayout = new QHBoxLayout(0); _uomLayout = new QHBoxLayout(0); _line2Layout = new QHBoxLayout(0); _statusLayout = new QHBoxLayout(0); _mainLayout->setContentsMargins(0, 0, 0, 0); _woLayout->setContentsMargins(0, 0, 0, 0); _warehouseLayout->setContentsMargins(0, 0, 0, 0); _line1Layout->setContentsMargins(0, 0, 0, 0); _itemLayout->setContentsMargins(0, 0, 0, 0); _uomLayout->setContentsMargins(0, 0, 0, 0); _line2Layout->setContentsMargins(0, 0, 0, 0); _statusLayout->setContentsMargins(0, 0, 0, 0); _mainLayout->setSpacing(2); _woLayout->setSpacing(5); _warehouseLayout->setSpacing(5); _line1Layout->setSpacing(7); _itemLayout->setSpacing(5); _uomLayout->setSpacing(5); _line2Layout->setSpacing(7); _statusLayout->setSpacing(5); _woNumberLit = new QLabel(tr("Work Order #:"), this); _woNumberLit->setObjectName("woNumberLit"); _woNumberLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _woNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _woLayout->addWidget(_woNumberLit); _woNumber = new WoLineEdit(this); _woNumber->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _woLayout->addWidget(_woNumber); _line1Layout->addLayout(_woLayout); QLabel *warehouseLit = new QLabel(tr("Site:"), this); warehouseLit->setObjectName("warehouseLit"); _woNumber->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); warehouseLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _warehouseLayout->addWidget(warehouseLit); _warehouse = new QLabel(this); _warehouse->setObjectName("_warehouse"); _warehouse->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); _warehouse->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _warehouseLayout->addWidget(_warehouse); _line1Layout->addLayout(_warehouseLayout); _mainLayout->addLayout(_line1Layout); _itemNumberLit = new QLabel(tr("Item Number:"), this); _itemNumberLit->setObjectName("itemNumberLit"); _itemNumberLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _itemNumberLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _itemLayout->addWidget(_itemNumberLit); _itemNumber = new QLabel(this); _itemNumber->setObjectName("_itemNumber"); _itemNumber->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _itemNumber->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _itemLayout->addWidget(_itemNumber); _line2Layout->addLayout(_itemLayout); _uomLit = new QLabel(tr("UOM:"), this); _uomLit->setObjectName("uomLit"); _uomLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _uomLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _uomLayout->addWidget(_uomLit); _uom = new QLabel(this); _uom->setObjectName("_uom"); _uom->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); _uom->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _uomLayout->addWidget(_uom); _line2Layout->addLayout(_uomLayout); _mainLayout->addLayout(_line2Layout); _descrip1 = new QLabel(this); _descrip1->setObjectName("_descrip1"); _descrip1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _descrip1->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _mainLayout->addWidget(_descrip1); _descrip2 = new QLabel(this); _descrip2->setObjectName("_descrip2"); _descrip2->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _descrip2->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _mainLayout->addWidget(_descrip2); _statusLit = new QLabel(tr("Status:"), this); _statusLit->setObjectName("statusLit"); _statusLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _statusLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _statusLayout->addWidget(_statusLit); _status = new QLabel(this); _status->setObjectName("_status"); _status->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _status->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _statusLayout->addWidget(_status); _methodLit = new QLabel(tr("Method:"), this); _methodLit->setObjectName("methodLit"); _methodLit->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); _methodLit->setAlignment(Qt::AlignRight | Qt::AlignVCenter); _statusLayout->addWidget(_methodLit); _method = new QLabel(this); _method->setObjectName("_method"); _method->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); _method->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); _statusLayout->addWidget(_method); _mainLayout->addLayout(_statusLayout); _orientation = Qt::Horizontal; setOrientation(Qt::Vertical); // Make some internal connections connect(_woNumber, SIGNAL(itemNumberChanged(const QString &)), _itemNumber, SLOT(setText(const QString &))); connect(_woNumber, SIGNAL(uomChanged(const QString &)), _uom, SLOT(setText(const QString &))); connect(_woNumber, SIGNAL(itemDescrip1Changed(const QString &)), _descrip1, SLOT(setText(const QString &))); connect(_woNumber, SIGNAL(itemDescrip2Changed(const QString &)), _descrip2, SLOT(setText(const QString &))); connect(_woNumber, SIGNAL(warehouseChanged(const QString &)), _warehouse, SLOT(setText(const QString &))); connect(_woNumber, SIGNAL(statusChanged(const QString &)), _status, SLOT(setText(const QString &))); connect(_woNumber, SIGNAL(methodChanged(const QString &)), _method, SLOT(setText(const QString &))); connect(_woNumber, SIGNAL(newId(int)), this, SIGNAL(newId(int))); connect(_woNumber, SIGNAL(newItemid(int)), this, SIGNAL(newItemid(int))); connect(_woNumber, SIGNAL(startDateChanged(const QDate &)), this, SIGNAL(startDateChanged(const QDate &))); connect(_woNumber, SIGNAL(dueDateChanged(const QDate &)), this, SIGNAL(dueDateChanged(const QDate &))); connect(_woNumber, SIGNAL(qtyOrderedChanged(const double)), this, SIGNAL(qtyOrderedChanged(const double))); connect(_woNumber, SIGNAL(qtyReceivedChanged(const double)), this, SIGNAL(qtyReceivedChanged(const double))); connect(_woNumber, SIGNAL(qtyBalanceChanged(const double)), this, SIGNAL(qtyBalanceChanged(const double))); connect(_woNumber, SIGNAL(valid(bool)), this, SIGNAL(valid(bool))); setFocusProxy(_woNumber); } void WoCluster::setReadOnly(bool pReadOnly) { if (pReadOnly) _woNumber->setEnabled(FALSE); else _woNumber->setEnabled(TRUE); } void WoCluster::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(this, _fieldName, "number", "defaultNumber"); //_woNumber->_mapper=m; } void WoCluster::setWoNumber(const QString& number) { if (_woNumber->text() == number) return; _woNumber->setText(number); _woNumber->sParse(); } void WoCluster::setId(int pId) { _woNumber->setId(pId); } QString WoCluster::woNumber() const { return _woNumber->text(); } Qt::Orientation WoCluster::orientation() { return _orientation; } void WoCluster::setOrientation(Qt::Orientation orientation) { if (orientation == _orientation) return; if (orientation == Qt::Vertical) { _line1Layout->removeItem(_itemLayout); _line2Layout->addLayout(_itemLayout); _descrip1->setVisible(true); _descrip2->setVisible(true); _statusLit->setVisible(true); _status->setVisible(true); _uom->setVisible(true); _uomLit->setVisible(true); _method->setVisible(true); _methodLit->setVisible(true); } else { _line2Layout->removeItem(_itemLayout); _line1Layout->addLayout(_itemLayout); _descrip1->setVisible(false); _descrip2->setVisible(false); _statusLit->setVisible(false); _status->setVisible(false); _uom->setVisible(false); _uomLit->setVisible(false); _method->setVisible(false); _methodLit->setVisible(false); } _orientation = orientation; } QString WoCluster::label() { return _woNumberLit->text(); } void WoCluster::setLabel(const QString& p) { _woNumberLit->setText(p); } WomatlCluster::WomatlCluster(QWidget *parent, const char *name) : QWidget(parent) { setObjectName(name); constructor(); } WomatlCluster::WomatlCluster(WoCluster *wocParent, QWidget *parent, const char *name) : QWidget(parent) { setObjectName(name); constructor(); setGeometry(0, 0, parent->width(), parent->height()); _sense = 1; connect(wocParent, SIGNAL(newId(int)), SLOT(setWoid(int))); connect(this, SIGNAL(newId(int)), wocParent, SLOT(sPopulateInfo(int))); } void WomatlCluster::constructor() { setupUi(this); _valid = FALSE; _id = -1; _woid = -1; _type = (Push | Pull | Mixed); _source = WoMaterial; _sourceId = -1; _required = 0.0; _issued = 0.0; connect(_itemNumber, SIGNAL(newID(int)), SLOT(sPopulateInfo(int))); if(_x_metrics) { _qtyIssued->setPrecision(decimalPlaces("qty")); _qtyFxd->setPrecision(decimalPlaces("qty")); _qtyPer->setPrecision(decimalPlaces("qtyper")); _qtyRequired->setPrecision(decimalPlaces("qty")); _scrap->setPrecision(decimalPlaces("percent")); } setFocusProxy(_itemNumber); } void WomatlCluster::languageChange() { retranslateUi(this); } void WomatlCluster::setReadOnly(bool) { } void WomatlCluster::setWooperid(int pWooperid) { _source = Wooper; _sourceId = pWooperid; bool qual = FALSE; QString sql( "SELECT womatl_id AS womatlid, item_number," " wo_id, uom_name, item_descrip1, item_descrip2," " womatl_qtyfxd AS _qtyfxd, womatl_qtyreq AS _qtyreq, womatl_qtyiss AS _qtyiss," " formatQty(womatl_qtyfxd) AS qtyfxd," " formatQtyPer(womatl_qtyper) AS qtyper," " formatScrap(womatl_scrap) AS scrap," " formatQtyPer(womatl_qtyreq) AS qtyreq," " formatQtyPer(womatl_qtyiss) AS qtyiss," " formatQtyPer(womatl_qtywipscrap) AS qtywipscrap " "FROM womatl, wo, itemsite, item, uom " "WHERE ( (womatl_wo_id=wo_id)" " AND (womatl_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (womatl_uom_id=uom_id)" " AND (womatl_wooper_id=:wooper_id)" " AND (womatl_issuemethod IN (" ); if (_type & Push) { sql += "'S'"; qual = TRUE; } if (_type & Pull) { if (qual) sql += ","; else qual = TRUE; sql += "'L'"; } if (_type & Mixed) { if (qual) sql += ","; sql += "'M'"; } sql += ")) );"; XSqlQuery query; query.prepare(sql); query.bindValue(":wooper_id", pWooperid); query.exec(); if (query.first()) { _womatl.prepare(sql); _womatl.bindValue(":wooper_id", pWooperid); _womatl.exec(); _itemNumber->populate(query); } else { _id = -1; _woid = -1; _valid = FALSE; _required = 0.0; _issued = 0.0; emit newId(-1); emit newQtyRequired(0.0); emit newQtyIssued(0.0); emit newQtyScrappedFromWIP(0.0); _itemNumber->clear(); } } void WomatlCluster::setWoid(int pWoid) { _source = WorkOrder; _sourceId = pWoid; bool qual = FALSE; QString sql( "SELECT womatl_id AS womatlid, item_number," " wo_id, wo_qtyord, uom_name, item_descrip1, item_descrip2," " womatl_qtyreq AS _qtyreq, womatl_qtyiss AS _qtyiss," " womatl_qtyfxd AS qtyfxd, womatl_qtyper AS qtyper," " womatl_scrap * 100 AS scrap," " ABS(womatl_qtyreq) AS qtyreq," " ABS(womatl_qtyiss) AS qtyiss," " womatl_qtywipscrap AS qtywipscrap " "FROM womatl, wo, itemsite, item, uom " "WHERE ( (womatl_wo_id=wo_id)" " AND (womatl_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (womatl_uom_id=uom_id)" " AND (wo_id=:wo_id)" " AND (womatl_issuemethod IN (" ); if (_type & Push) { sql += "'S'"; qual = TRUE; } if (_type & Pull) { if (qual) sql += ","; else qual = TRUE; sql += "'L'"; } if (_type & Mixed) { if (qual) sql += ","; sql += "'M'"; } sql += ")) );"; _womatl.prepare(sql); _womatl.bindValue(":wo_id", pWoid); _womatl.exec(); _itemNumber->populate(_womatl); if (_womatl.first()) { if (_womatl.value("wo_qtyord").toDouble() < 0) { _qtyRequiredLit->setText("Qty. to Return:"); _qtyIssuedLit->setText("Qty. Returned:"); _sense = -1; } else { _qtyRequiredLit->setText("Qty. Required:"); _qtyIssuedLit->setText("Qty. Issued:"); _sense = 1; } } else { _id = -1; _woid = -1; _valid = FALSE; _required = 0.0; _issued = 0.0; emit newId(-1); emit newQtyRequired(0.0); emit newQtyIssued(0.0); emit newQtyScrappedFromWIP(0.0); _itemNumber->clear(); } } void WomatlCluster::setId(int pWomatlid) { _source = WoMaterial; _sourceId = pWomatlid; if (pWomatlid == -1) sPopulateInfo(-1); else { bool qual = FALSE; QString sql( "SELECT list.womatl_id AS womatlid, item_number, " " wo_id, uom_name, item_descrip1, item_descrip2," " ABS(list.womatl_qtyreq) AS _qtyreq, " " ABS(list.womatl_qtyiss) AS _qtyiss," " (list.womatl_qtyfxd) AS qtyfxd," " (list.womatl_qtyper) AS qtyper," " (list.womatl_scrap * 100) AS scrap," " (abs(list.womatl_qtyreq)) AS qtyreq, " " (abs(list.womatl_qtyiss)) AS qtyiss, " " (list.womatl_qtywipscrap) AS qtywipscrap " "FROM womatl AS list, womatl AS target, wo, itemsite, item, uom " "WHERE ( (list.womatl_wo_id=wo_id)" " AND (target.womatl_wo_id=wo_id)" " AND (list.womatl_itemsite_id=itemsite_id)" " AND (itemsite_item_id=item_id)" " AND (list.womatl_uom_id=uom_id)" " AND (target.womatl_id=:womatl_id)" " AND (list.womatl_issuemethod IN (" ); if (_type & Push) { sql += "'S'"; qual = TRUE; } if (_type & Pull) { if (qual) sql += ","; else qual = TRUE; sql += "'L'"; } if (_type & Mixed) { if (qual) sql += ","; sql += "'M'"; } sql += ")) );"; XSqlQuery query; query.prepare(sql); query.bindValue(":womatl_id", pWomatlid); query.exec(); if (query.first()) { _womatl.prepare(sql); _womatl.bindValue(":womatl_id", pWomatlid); _womatl.exec(); emit newId(pWomatlid); _valid = TRUE; _id = pWomatlid; _itemNumber->populate(query); _itemNumber->setId(pWomatlid); } else { _valid = FALSE; _woid = -1; _id = -1; emit newId(-1); emit valid(FALSE); _itemNumber->clear(); } } } void WomatlCluster::setType(int pType) { if (pType) _type = pType; } void WomatlCluster::sRefresh() { if (_source == WorkOrder) setWoid(_sourceId); else if (_source == Wooper) setWooperid(_sourceId); else if (_source == WoMaterial) setId(_sourceId); } void WomatlCluster::sPopulateInfo(int pWomatlid) { if (pWomatlid == -1) { _itemNumber->setCurrentIndex(0); _uom->setText(""); _descrip1->setText(""); _descrip2->setText(""); _qtyFxd->setText(""); _qtyPer->setText(""); _scrap->setText(""); _qtyRequired->setText(""); _qtyIssued->setText(""); _id = -1; _valid = FALSE; _required = 0; _issued = 0; emit newId(-1); emit newQtyScrappedFromWIP(0.0); emit valid(FALSE); } else if (_womatl.findFirst("womatlid", pWomatlid) != -1) { _uom->setText(_womatl.value("uom_name").toString()); _descrip1->setText(_womatl.value("item_descrip1").toString()); _descrip2->setText(_womatl.value("item_descrip2").toString()); _qtyFxd->setDouble(_womatl.value("qtyfxd").toDouble()); _qtyPer->setDouble(_womatl.value("qtyper").toDouble()); _scrap->setDouble(_womatl.value("scrap").toDouble()); _qtyRequired->setDouble(_womatl.value("qtyreq").toDouble()); _qtyIssued->setDouble(_womatl.value("qtyiss").toDouble()); _id = pWomatlid; _valid = TRUE; _required = _womatl.value("_qtyreq").toDouble(); _issued = _womatl.value("_qtyiss").toDouble(); emit newId(_id); emit newQtyScrappedFromWIP(_womatl.value("qtywipscrap").toDouble()); emit valid(TRUE); } } void WomatlCluster::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(_itemNumber, _fieldName, "code", "currentDefault"); } ///////////////////////////////////////////// woList::woList(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualList(pParent, pFlags) { setObjectName("woList"); setMinimumWidth(600); _search->hide(); _searchLit->hide(); disconnect(_search, SIGNAL(textChanged(const QString&)), this, SLOT(sSearch(const QString&))); _warehouse = new WarehouseGroup(this, "_warehouse"); QVBoxLayout* searchLyt = findChild("searchLyt"); searchLyt->addWidget(_warehouse); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); _listTab->setColumnCount(0); _listTab->addColumn(tr("Order#"), _orderColumn, Qt::AlignLeft, true, "number"); _listTab->addColumn(tr("Status"), 40, Qt::AlignCenter,true, "wo_status"); _listTab->addColumn(tr("Whs."), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _listTab->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "item_number"); _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); } void woList::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) _woid = param.toInt(); param = pParams.value("warehous_id", &valid); if (valid) _warehouse->setId(param.toInt()); param = pParams.value("woType", &valid); if (valid) _type = param.toInt(); } void woList::sFillList() { QString sql; sql = "SELECT wo_id," " formatWONumber(wo_id) AS number," " wo_status, warehous_code, item_number," " (item_descrip1 || ' ' || item_descrip2) AS description " "FROM wo, itemsite, whsinfo, item " "WHERE ( (wo_itemsite_id=itemsite_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=item_id)"; if (_type != 0) { QStringList statuslist; if (_type & cWoOpen) statuslist << "'O'"; if (_type & cWoExploded) statuslist << "'E'"; if (_type & cWoReleased) statuslist << "'R'"; if (_type & cWoIssued) statuslist << "'I'"; if (_type & cWoClosed) statuslist << "'C'"; sql += "AND (wo_status IN (" + statuslist.join(",") + "))"; } if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ") ORDER BY wo_number, wo_subnumber, warehous_code, item_number"; XSqlQuery wo; wo.prepare(sql); _warehouse->bindValue(wo); wo.exec(); _listTab->populate(wo, _woid); } /////////////////////////// woSearch::woSearch(QWidget* pParent, Qt::WindowFlags pFlags) : VirtualSearch(pParent, pFlags) { setObjectName( "woSearch" ); setMinimumWidth(600); _warehouse = new WarehouseGroup(this, "_warehouse"); QVBoxLayout* searchLyt = findChild("searchLyt"); searchLyt->addWidget(_warehouse); connect(_warehouse, SIGNAL(updated()), this, SLOT(sFillList())); _listTab->setColumnCount(0); _listTab->addColumn(tr("Order#"), _orderColumn, Qt::AlignLeft, true, "number"); _listTab->addColumn(tr("Status"), 40, Qt::AlignCenter,true, "wo_status"); _listTab->addColumn(tr("Whs."), _whsColumn, Qt::AlignCenter,true, "warehous_code"); _listTab->addColumn(tr("Item Number"),_itemColumn, Qt::AlignLeft, true, "item_number"); _listTab->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "description"); _searchName->hide(); } void woSearch::set(const ParameterList &pParams) { QVariant param; bool valid; param = pParams.value("wo_id", &valid); if (valid) _woid = param.toInt(); param = pParams.value("warehous_id", &valid); if (valid) _warehouse->setId(param.toInt()); param = pParams.value("woType", &valid); if (valid) _type = param.toInt(); } void woSearch::sFillList() { QString sql; sql = "SELECT wo_id," " formatWONumber(wo_id) AS number," " wo_status, warehous_code, item_number," " (item_descrip1 || ' ' || item_descrip2) AS description " "FROM wo, itemsite, whsinfo, item " "WHERE ( (wo_itemsite_id=itemsite_id)" " AND (itemsite_warehous_id=warehous_id)" " AND (itemsite_item_id=item_id)"; if (_type != 0) { QStringList statuslist; if (_type & cWoOpen) statuslist << "'O'"; if (_type & cWoExploded) statuslist << "'E'"; if (_type & cWoReleased) statuslist << "'R'"; if (_type & cWoIssued) statuslist << "'I'"; if (_type & cWoClosed) statuslist << "'C'"; sql += "AND (wo_status IN (" + statuslist.join(",") + "))"; } if (!_search->text().isEmpty()) { sql += " AND ((false) "; if (_searchNumber->isChecked()) { sql += " OR (formatWONumber(wo_id) ~* :search) " " OR (item_number ~* :search) "; } if (_searchDescrip->isChecked()) { sql += " OR (item_descrip1 ~* :search) " " OR (item_descrip2 ~* :search) "; } sql += ") "; } if (_warehouse->isSelected()) sql += " AND (itemsite_warehous_id=:warehous_id)"; sql += ") ORDER BY wo_number, wo_subnumber, warehous_code, item_number"; XSqlQuery wo; wo.prepare(sql); wo.bindValue(":search", _search->text()); _warehouse->bindValue(wo); wo.exec(); _listTab->populate(wo, _woid); } qt-client-4.1.0/widgets/wocluster.h000066400000000000000000000206401217451700100172620ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef woCluster_h #define woCluster_h #include "widgets.h" #include #include #include "virtualCluster.h" #include "ui_womatlcluster.h" class QLabel; class QPushButton; class WoCluster; class XComboBox; class WarehouseGroup; // Possible Work Order Status #define cWoOpen WoLineEdit::Open #define cWoExploded WoLineEdit::Exploded #define cWoIssued WoLineEdit::Issued #define cWoReleased WoLineEdit::Released #define cWoClosed WoLineEdit::Closed class QScriptEngine; void setupWoCluster(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT woList : public VirtualList { Q_OBJECT public: woList(QWidget*, Qt::WindowFlags = 0); public slots: virtual void set(const ParameterList & pParams); virtual void sFillList(); private: int _woid; int _type; WarehouseGroup* _warehouse; }; class XTUPLEWIDGETS_EXPORT woSearch : public VirtualSearch { Q_OBJECT public: woSearch(QWidget*, Qt::WindowFlags = 0); public slots: void set(const ParameterList & pParams); void sFillList(); private: int _woid; int _type; WarehouseGroup* _warehouse; }; class XTUPLEWIDGETS_EXPORT WoLineEdit : public VirtualClusterLineEdit { Q_OBJECT Q_ENUMS(WoStatus) Q_PROPERTY(int type READ type WRITE setType DESIGNABLE false) friend class WoCluster; public: WoLineEdit(QWidget *, const char * = 0); WoLineEdit(int, QWidget *, const char * = 0); enum WoStatus { Open = 0x01, Exploded = 0x02, Issued = 0x04, Released = 0x08, Closed = 0x10 }; Q_INVOKABLE inline int currentWarehouse() const { return _currentWarehouseid; } Q_INVOKABLE inline QString method() const { return _method; } Q_INVOKABLE void setType(int pWoType); Q_INVOKABLE void setWarehouse(int pWarehouseid); Q_INVOKABLE inline int type() const { return _woType; } Q_INVOKABLE inline int warehouse() const { return _warehouseid; } public slots: void silentSetId(const int); void sList(); void sSearch(); private: void init(); void buildExtraClause(); int _currentWarehouseid; int _woType; int _warehouseid; QChar _status; double _qtyOrdered; double _qtyReceived; QString _method; protected: woList* listFactory(); woSearch* searchFactory(); signals: void newId(int); void newItemid(int); void warehouseChanged(const QString &); void itemNumberChanged(const QString &); void uomChanged(const QString &); void itemDescrip1Changed(const QString &); void itemDescrip2Changed(const QString &); void startDateChanged(const QDate &); void dueDateChanged(const QDate &); void qtyOrderedChanged(const double); void qtyReceivedChanged(const double); void qtyBalanceChanged(const double); void statusChanged(const QString &); void methodChanged(const QString &); void valid(bool); }; class XTUPLEWIDGETS_EXPORT WoCluster : public QWidget { Q_OBJECT Q_PROPERTY(QString label READ label WRITE setLabel) Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) Q_PROPERTY(QString number READ woNumber WRITE setWoNumber DESIGNABLE false) Q_PROPERTY(QString defaultNumber READ defaultNumber DESIGNABLE false) Q_PROPERTY(int type READ type WRITE setType DESIGNABLE false) public: WoCluster(QWidget *, const char * = 0); WoCluster(int, QWidget *, const char * = 0); QString defaultNumber() { return QString(); } QString fieldName() { return _fieldName; } QString woNumber() const; virtual Qt::Orientation orientation(); virtual void setOrientation(Qt::Orientation orientation); virtual QString label(); virtual void setLabel(const QString& p); inline void setType(int pWoType) { _woNumber->setType(pWoType); } inline int type() const { return _woNumber->_woType; } inline void setWarehouse(int pWarehouseid) { _woNumber->setWarehouse(pWarehouseid); } Q_INVOKABLE inline int currentWarehouse() const { return _woNumber->currentWarehouse(); } Q_INVOKABLE inline int id() const { return _woNumber->_id; } Q_INVOKABLE inline bool isValid() const { return _woNumber->_valid; } Q_INVOKABLE inline char status() const { return _woNumber->_status.toAscii(); } Q_INVOKABLE inline QString method() const { return _woNumber->method(); } Q_INVOKABLE inline double qtyOrdered() const { return _woNumber->_qtyOrdered; } Q_INVOKABLE inline double qtyReceived() const { return _woNumber->_qtyReceived; } Q_INVOKABLE inline double qtyBalance() const { if (_woNumber->_qtyOrdered <= _woNumber->_qtyReceived) return 0; else return (_woNumber->_qtyOrdered - _woNumber->_qtyReceived); } Q_INVOKABLE inline int warehouse() const { return _woNumber->warehouse(); } public slots: void setDataWidgetMap(XDataWidgetMapper* m); void setFieldName(const QString& name) { _fieldName = name; } void setId(int); void setReadOnly(bool); void setWoNumber(const QString& number); private: void constructor(); WoLineEdit *_woNumber; QLabel *_woNumberLit; QLabel *_warehouse; QLabel *_itemNumber; QLabel *_itemNumberLit; QLabel *_uom; QLabel *_uomLit; QLabel *_descrip1; QLabel *_descrip2; QLabel *_status; QLabel *_statusLit; QLabel *_method; QLabel *_methodLit; QString _fieldName; QHBoxLayout *_line1Layout; QHBoxLayout *_line2Layout; QHBoxLayout *_itemLayout; QVBoxLayout *_mainLayout; QHBoxLayout *_statusLayout; QHBoxLayout *_uomLayout; QHBoxLayout *_warehouseLayout; QHBoxLayout *_woLayout; Qt::Orientation _orientation; signals: void newId(int); void newItemid(int); void startDateChanged(const QDate &); void dueDateChanged(const QDate &); void qtyOrderedChanged(const double &); void qtyReceivedChanged(const double &); void qtyBalanceChanged(const double &); void valid(bool); }; class XTUPLEWIDGETS_EXPORT WomatlCluster : public QWidget, public Ui::WomatlCluster { Q_OBJECT Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) public: enum SourceTypes { WorkOrder = 0x01, WoMaterial = 0x02, Wooper = 0x04 }; enum IssueTypes { Pull = 0x01, Push = 0x02, Mixed = 0x04 }; WomatlCluster(QWidget *, const char * = 0); WomatlCluster(WoCluster *, QWidget *, const char * = 0); void setReadOnly(bool); Q_INVOKABLE int id() { return _id; } Q_INVOKABLE int woid() { return _woid; } Q_INVOKABLE bool isValid() { return _valid; } Q_INVOKABLE double qtyRequired() { return _required; } Q_INVOKABLE double qtyIssued() { return _issued; } inline QString fieldName() { return _fieldName;} signals: void newId(int); void valid(bool); void newQtyRequired(const double); void newQtyIssued(const double); void newQtyScrappedFromWIP(const double); public slots: void setDataWidgetMap(XDataWidgetMapper* m); void setFieldName(const QString& name) { _fieldName = name; } void setId(int); void setType(int); void setWooperid(int); void setWoid(int); void sPopulateInfo(int); void sRefresh(); protected slots: virtual void languageChange(); private: void constructor(); XSqlQuery _womatl; int _id; int _woid; int _source; int _type; int _sourceId; int _sense; bool _valid; double _required; double _issued; QString _fieldName; }; #endif qt-client-4.1.0/widgets/womatlcluster.h000066400000000000000000000007231217451700100201400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "wocluster.h" qt-client-4.1.0/widgets/womatlcluster.ui000066400000000000000000000123001217451700100203200ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. WomatlCluster 0 0 484 153 Form 2 Component Item Number: Qty. Per: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qty. Issued: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter UOM: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true XComboBox::None Scrap %: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter Qty. Required: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Fxd. Qty.: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter XComboBox QComboBox
    xcombobox.h
    XLabel QLabel
    xlabel.h
    qt-client-4.1.0/widgets/workcenterCluster.cpp000066400000000000000000000017361217451700100213200ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "workcentercluster.h" WorkCenterCluster::WorkCenterCluster(QWidget* pParent, const char* pName) : VirtualCluster(pParent, pName) { addNumberWidget(new WorkCenterLineEdit(this, pName)); } WorkCenterLineEdit::WorkCenterLineEdit(QWidget *pParent, const char *pName) : VirtualClusterLineEdit(pParent, "xtmfg.wrkcnt", "wrkcnt_id", "wrkcnt_code", "wrkcnt_descrip", 0, 0, pName) { setTitles(tr("Work Center"), tr("Work Centers")); } void WorkCenterLineEdit::setWorkCenter(const QString & pWorkCenter) { setNumber(pWorkCenter); } qt-client-4.1.0/widgets/workcentercluster.h000066400000000000000000000020331217451700100210140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __WORKCENTERCLUSTER_H__ #define __WORKCENTERCLUSTER_H__ #include "virtualCluster.h" class XTUPLEWIDGETS_EXPORT WorkCenterLineEdit : public VirtualClusterLineEdit { Q_OBJECT public: WorkCenterLineEdit(QWidget*, const char* = 0); void setWorkCenter(const QString &); }; class XTUPLEWIDGETS_EXPORT WorkCenterCluster : public VirtualCluster { Q_OBJECT public: WorkCenterCluster(QWidget*, const char* = 0); inline void setWorkCenter(const QString & pWorkCenter) { setNumber(pWorkCenter); } inline const QString workcenter() const { return _number->text(); } }; #endif qt-client-4.1.0/widgets/xcheckbox.cpp000066400000000000000000000103101217451700100175350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xcheckbox.h" #include XCheckBox::XCheckBox(QWidget *pParent) : QCheckBox(pParent) { constructor(); } XCheckBox::XCheckBox(const QString &pText, QWidget *pParent) : QCheckBox(pText, pParent) { constructor(); } // can't make a static QPixmap 'cause Qt complains: // Must construct a QApplication before a QPaintDevice QPixmap *XCheckBox::_checkedIcon = 0; void XCheckBox::constructor() { _default=false; setForgetful(false); _initialized = false; _mapper = new XDataWidgetMapper(this); } void XCheckBox::setData() { if (_mapper->model() && _mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this))).toBool() != isChecked()) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this)), isChecked()); } void XCheckBox::init() { if(_initialized) return; QString pname; if(window()) pname = window()->objectName() + "/"; _settingsName = pname + objectName(); if(_x_preferences) { if (!_forgetful) setCheckState((Qt::CheckState)(_x_preferences->value(_settingsName + "/checked").toInt())); } _initialized = true; } void XCheckBox::setForgetful(bool p) { if (_x_preferences && !p) _forgetful = _x_preferences->value("XCheckBox/forgetful").startsWith("t", Qt::CaseInsensitive); else _forgetful = p; if (! _forgetful) { Q_INIT_RESOURCE(widgets); if (! _checkedIcon) _checkedIcon = new QPixmap(":/widgets/images/xcheckbox.png"); setIcon(*_checkedIcon); setIconSize(_checkedIcon->size()); } else setIcon(QPixmap()); } void XCheckBox::showEvent(QShowEvent * event) { init(); QCheckBox::showEvent(event); } XCheckBox::~XCheckBox() { if (!_settingsName.isEmpty() && _x_preferences) { if (_forgetful) _x_preferences->remove(_settingsName + "/checked"); else _x_preferences->set(_settingsName + "/checked", (int)checkState()); } } void XCheckBox::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(this, _fieldName, "checked", "defaultChecked"); _mapper=m; connect(this, SIGNAL(stateChanged(int)), this, SLOT(setData())); } // scripting exposure ///////////////////////////////////////////////////////// QScriptValue XCheckBoxtoScriptValue(QScriptEngine *engine, XCheckBox* const &item) { return engine->newQObject(item); } void XCheckBoxfromScriptValue(const QScriptValue &obj, XCheckBox* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructXCheckBox(QScriptContext *context, QScriptEngine *engine) { XCheckBox *cbox = 0; if (context->argumentCount() == 0) cbox = new XCheckBox(); else if (context->argumentCount() == 1 && context->argument(0).isString()) cbox = new XCheckBox(context->argument(0).toString()); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) cbox = new XCheckBox(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() == 2 && context->argument(0).isString() && qscriptvalue_cast(context->argument(1))) cbox = new XCheckBox(context->argument(0).toString(), qscriptvalue_cast(context->argument(1))); else context->throwError(QScriptContext::UnknownError, QString("Could not find an appropriate XCheckBox constructor")); return engine->toScriptValue(cbox); } void setupXCheckBox(QScriptEngine *engine) { qScriptRegisterMetaType(engine, XCheckBoxtoScriptValue, XCheckBoxfromScriptValue); QScriptValue widget = engine->newFunction(constructXCheckBox); engine->globalObject().setProperty("XCheckBox", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/xcheckbox.h000066400000000000000000000036171217451700100172160ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XCHECKBOX_H__ #define __XCHECKBOX_H__ #include #include #include "widgets.h" #include "xdatawidgetmapper.h" class QScriptEngine; void setupXCheckBox(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT XCheckBox : public QCheckBox { Q_OBJECT Q_PROPERTY(bool defaultChecked READ defaultChecked WRITE setDefaultChecked) Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) Q_PROPERTY(bool forgetful READ forgetful WRITE setForgetful) public: XCheckBox(QWidget * = 0); XCheckBox(const QString &, QWidget * = 0); ~XCheckBox(); virtual bool defaultChecked() const { return _default; }; virtual bool forgetful() const { return _forgetful; }; virtual QString fieldName() const { return _fieldName; }; public slots: virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setDefaultChecked(bool p) { _default = p; }; virtual void setFieldName(QString p) { _fieldName = p; }; virtual void setForgetful(bool p); virtual void setData(); virtual void init(); protected: virtual void showEvent(QShowEvent *); XDataWidgetMapper *_mapper; private: virtual void constructor(); bool _default; bool _forgetful; bool _initialized; QString _settingsName; QString _fieldName; static QPixmap *_checkedIcon; }; Q_DECLARE_METATYPE(XCheckBox*) #endif qt-client-4.1.0/widgets/xcombobox.cpp000066400000000000000000002070601217451700100175710ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xcombobox.h" #include "xcomboboxprivate.h" #include "xdatawidgetmapper.h" #include "xsqltablemodel.h" #define DEBUG false class XComboBoxEditorDescrip { public: XComboBoxEditorDescrip(int pType, const QString &pUi, const QString &pPriv) : obj(0), slot(0) { type = pType; uiName = pUi; priv = pPriv; } XComboBoxEditorDescrip(int pType, QObject *pObj, char *pSlot, const QString &pPriv) { type = pType; obj = pObj; slot = pSlot; priv = pPriv; } int type; // XComboBoxTypes + possible out-of-range QString priv; QString uiName; QObject *obj; char *slot; }; XComboBoxPrivate::XComboBoxPrivate(XComboBox *pParent) : QObject(pParent), _default(XComboBox::First), _editButton(0), _label(0), _lastId(-1), _parent(pParent), _popupCounter(0), _mapper(0) { _mapper = new XDataWidgetMapper(pParent); setType(XComboBox::Adhoc); } XComboBoxPrivate::~XComboBoxPrivate() { foreach (int key, _editorMap.keys()) delete _editorMap.take(key); } int XComboBoxPrivate::numberOfCurrencies() { // run the query no more than once per instance static int numberOfCurrencies = -1; if (numberOfCurrencies <= 0) { XSqlQuery currCounter("SELECT COUNT(*) AS count FROM curr_symbol;"); if (currCounter.first()) numberOfCurrencies = currCounter.value("count").toInt(); else numberOfCurrencies = 0; } return numberOfCurrencies; } void XComboBoxPrivate::sEdit() { if (_parent->_guiClientInterface && _parent->parentWidget()->window()) { XComboBoxEditorDescrip *editor = _editorMap.value(_parent->type()); ParameterList params; params.append("mode", "edit"); QWidget *w = _parent->_guiClientInterface->openWindow(editor->uiName, params, _parent->parentWidget()->window(), Qt::ApplicationModal, Qt::Dialog); connect(w, SIGNAL(destroyed()), _parent, SLOT(populate())); if (qobject_cast(w)) (qobject_cast(w))->exec(); } } /* let the user create/edit records of this XComboBoxType if s/he has privs */ void XComboBoxPrivate::setType(XComboBox::XComboBoxTypes ptype) { _type = ptype; XComboBoxEditorDescrip *editor = _editorMap.value(_type); if (_x_privileges && editor && (editor->priv.isEmpty() || _x_privileges->check(editor->priv))) { QAbstractItemView *view = _parent->view(); if (view && ! _editButton) { QWidget *vp = qobject_cast(view->parent()); if (vp && vp->layout()) { _editButton = new QPushButton(tr("Edit List"), _parent); vp->layout()->addWidget(_editButton); if (editor->obj) connect(_editButton, SIGNAL(clicked()), editor->obj, editor->slot); else connect(_editButton, SIGNAL(clicked()), this, SLOT(sEdit())); } } } else if (_editButton) { delete _editButton; // TODO: deletelater? _editButton = 0; } } GuiClientInterface* XComboBox::_guiClientInterface = 0; XComboBox::XComboBox(QWidget *pParent, const char *pName) : QComboBox(pParent), _data(0) { if(pName) setObjectName(pName); init(); } XComboBox::XComboBox(bool pEditable, QWidget *pParent, const char *pName) : QComboBox(pParent), _data(0) { if(pName) setObjectName(pName); init(); setEditable(pEditable); } XComboBox::~XComboBox() { } void XComboBox::init() { _data = new XComboBoxPrivate(this); setAllowNull(false); setMaximumWidth(200); connect(this, SIGNAL(activated(int)), this, SLOT(sHandleNewIndex(int))); #ifdef Q_WS_MAC QFont f = font(); f.setPointSize(f.pointSize() - 2); setFont(f); setMinimumHeight(26); #endif insertEditor(AddressCommentTypes,"commentTypes","MaintainCommentTypes"); // insertEditor(AdHoc,"",""); caller must insert this at the implementation insertEditor(APBankAccounts,"bankAccounts","MaintainBankAccounts"); insertEditor(APTerms,"termses","MaintainTerms"); insertEditor(ARBankAccounts,"bankAccounts","MaintainBankAccounts"); insertEditor(ARCMReasonCodes,"reasonCodes","MaintainReasonCodes"); insertEditor(ARDMReasonCodes,"reasonCodes","MaintainReasonCodes"); insertEditor(ARTerms,"termses","MaintainTerms"); insertEditor(AccountingPeriods,"accountingPeriods","MaintainAccountingPeriods"); insertEditor(Agent,"users","MaintainUsers"); insertEditor(AllCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(AllProjects,"projects","MaintainAllProjects"); insertEditor(BBOMHeadCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(BBOMItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(BOMHeadCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(BOMItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(BOOHeadCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(BOOItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(CRMAccounts,"crmaccounts","MaintainAllCRMAccounts"); insertEditor(CRMAccountCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(ClassCodes,"classCodes","MaintainClassCodes"); insertEditor(Companies,"companies","MaintainChartOfAccounts"); insertEditor(ContactCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(CostCategories,"costCategories","MaintainCostCategories"); insertEditor(Countries,"countries","MaintainCountries"); insertEditor(Currencies,"currencies","MaintainCurrencies"); insertEditor(CurrenciesNotBase,"currencies","MaintainCurrencies"); insertEditor(CustomerCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(CustomerGroups,"customerGroups","MaintainCustomerGroups"); insertEditor(CustomerTypes,"customerTypes","MaintainCustomerTypes"); insertEditor(EmployeeCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(ExpenseCategories,"expenseCategories","MaintainCustomerTypes"); insertEditor(FinancialLayouts,"financialLayouts","MaintainFinancialLayouts"); insertEditor(FiscalYears,"accountingYearPeriods","MaintainAccountingPeriods"); insertEditor(FreightClasses,"freightClasses","MaintainFreightClasses"); insertEditor(Honorifics,"honorifics","MaintainTitles"); insertEditor(IncidentCategory,"incidentCategories","MaintainIncidentCategories"); insertEditor(IncidentCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(IncidentPriority,"incidentPriorities","MaintainIncidentPriorities"); insertEditor(IncidentResolution,"incidentResolutions","MaintainIncidentResolutions"); insertEditor(IncidentSeverity,"incidentSeverities","MaintainIncidentSeverities"); insertEditor(ItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(ItemGroups,"itemGroups","MaintainItemGroups"); insertEditor(ItemSiteCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(ItemSourceCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(Locales,"locales","MaintainLocales"); // insertEditor(LocaleCountries,"",""); // This is based on Qt countries, can not be edited // insertEditor(LocaleLanguages,"",""); // This is based on Qt languages, no editor insertEditor(LocationCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(LotSerialCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(OpportunityCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(OpportunityStages,"opportunityStages","MaintainOpportunityStages"); insertEditor(OpportunitySources,"opportunitySources","MaintainOpportunitySources"); insertEditor(OpportunityTypes,"opportunityTypes","MaintainOpportunityTypes"); insertEditor(PlannerCodes,"plannerCodes","MaintainPlannerCodes"); insertEditor(PoProjects,"projects","MaintainAllProjects"); insertEditor(ProductCategories,"productCategories","MaintainProductCategories"); insertEditor(ProfitCenters,"profitCenters","MaintainChartOfAccounts"); insertEditor(ProjectCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(PurchaseOrderCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(PurchaseOrderItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(ReasonCodes,"reasonCodes","MaintainReasonCodes"); // insertEditor(RegistrationTypes,"",""); No editor currently exists insertEditor(Reports,"reports","MaintainReports"); insertEditor(ReturnReasonCodes,"reasonCodes","MaintainReasonCodes"); insertEditor(ReturnAuthCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(ReturnAuthItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(QuoteCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(QuoteItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(SalesOrderCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(SalesOrderItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(SalesCategories,"salesCategories","MaintainSalesCategories"); insertEditor(SalesCategoriesActive,"salesCategories","MaintainSalesCategories"); insertEditor(SalesReps,"salesReps","MaintainSalesReps"); insertEditor(SalesRepsActive,"salesReps","MaintainSalesReps"); insertEditor(SaleTypes,"saleTypes","MaintainSaleTypes"); insertEditor(ShipVias,"shipVias","MaintainShipVias"); insertEditor(ShippingCharges,"shippingChargeTypes","MaintainShippingChargeTypes"); insertEditor(ShippingForms,"shippingForms","MaintainShippingForms"); insertEditor(ShippingZones,"shippingZones","MaintainShippingZones"); insertEditor(SiteTypes,"siteTypes","MaintainSiteTypes"); insertEditor(SoProjects,"projects","MaintainAllProjects"); insertEditor(Subaccounts,"subaccounts","MaintainChartOfAccounts"); insertEditor(TaxAuths,"taxAuthorities","MaintainTaxAuthorities"); insertEditor(TaxClasses,"taxClasses","MaintainTaxClasses"); insertEditor(TaxCodes,"taxCodes","MaintainTaxCodes"); insertEditor(TaxZones,"taxZones","MaintainTaxZones"); insertEditor(TaxTypes,"taxTypes","MaintainTaxTypes"); insertEditor(Terms,"terms","MaintainTerms"); insertEditor(TaskCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(TodoItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(TransferOrderCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(TransferOrderItemCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(UOMs,"uoms","MaintainUOMs"); insertEditor(Users,"users","MaintainUsers"); insertEditor(ActiveUsers,"users","MaintainUsers"); insertEditor(VendorCommentTypes,"commentTypes","MaintainCommentTypes"); // insertEditor(VendorGroups,"",""); Not implemented yet insertEditor(VendorTypes,"vendorTypes","MaintainVendorTypes"); insertEditor(WarehouseCommentTypes,"commentTypes","MaintainCommentTypes"); insertEditor(WoProjects,"projects","MaintainAllProjects"); insertEditor(WorkCenters,"workCenters","MaintainWorkCenters"); insertEditor(WorkOrderCommentTypes,"commentTypes","MaintainCommentTypes"); } bool XComboBox::allowNull() const { return _allowNull; } XComboBox::Defaults XComboBox::defaultCode() const { return _data->_default; } QString XComboBox::fieldName() const { return _data->_fieldName; } QLabel* XComboBox::label() const { return _data->_label; } QString XComboBox::listDisplayFieldName() const { return _data->_listDisplayFieldName; } QString XComboBox::listIdFieldName() const { return _data->_listIdFieldName; } QString XComboBox::listSchemaName() const { return _data->_listSchemaName; } QString XComboBox::listTableName() const { return _data->_listTableName; } QString XComboBox::nullStr() const { return _data->_nullStr; } void XComboBox::setDefaultCode(Defaults p) { _data->_default = p; } void XComboBox::setFieldName(QString p) { _data->_fieldName = p; } void XComboBox::setListDisplayFieldName(QString p) { _data->_listDisplayFieldName = p; } void XComboBox::setListIdFieldName(QString p) { _data->_listIdFieldName = p; } // exists only for script exposure void XComboBox::removeItem(int idx) { QComboBox::removeItem(idx); } enum XComboBox::XComboBoxTypes XComboBox::type() { return _data->_type; } QString XComboBox::currentDefault() { if (_data->_codes.count()) { if (_data->_default == First) return _data->_codes.first(); else return code(); } else return QString(""); } void XComboBox::setDataWidgetMap(XDataWidgetMapper* m) { disconnect(this, SIGNAL(editTextChanged(QString)), this, SLOT(updateMapperData())); if (!_data->_listTableName.isEmpty()) { QString tableName=""; if (_data->_listSchemaName.length()) tableName = _data->_listSchemaName + "."; tableName+= _data->_listTableName; static_cast(m->model())->setRelation(static_cast(m->model())->fieldIndex(_data->_fieldName), QSqlRelation(tableName, _data->_listIdFieldName, _data->_listDisplayFieldName)); QSqlTableModel *rel =static_cast(m->model())->relationModel(static_cast(m->model())->fieldIndex(_data->_fieldName)); setModel(rel); setModelColumn(rel->fieldIndex(_data->_listDisplayFieldName)); m->setItemDelegate(new QSqlRelationalDelegate(this)); m->addMapping(this, _data->_fieldName); return; } else if (_data->_codes.count()) m->addMapping(this, _data->_fieldName, "code", "currentDefault"); else m->addMapping(this, _data->_fieldName, "text", "text"); _data->_mapper=m; connect(this, SIGNAL(editTextChanged(QString)), this, SLOT(updateMapperData())); } void XComboBox::setListSchemaName(QString p) { if (_data->_listSchemaName == p) return; if (!p.isEmpty()) setType(Adhoc); _data->_listSchemaName = p; } void XComboBox::setListTableName(QString p) { if (_data->_listTableName == p) return; _data->_listTableName = p; if (!p.isEmpty()) setType(Adhoc); } void XComboBox::setType(XComboBoxTypes pType) { if (pType != Adhoc) { setListSchemaName(""); setListTableName(""); } _data->setType(pType); if (_x_metrics == 0) return; // If we're in Designer, don't populate for (QObject *ancestor = this; ancestor; ancestor = ancestor->parent()) { if (ancestor->inherits("xTupleDesigner")) return; } XSqlQuery query; switch (pType) { case Adhoc: break; case UOMs: setAllowNull(TRUE); query.exec( "SELECT uom_id, uom_name, uom_name " "FROM uom " "ORDER BY uom_name;" ); break; case ClassCodes: query.exec( "SELECT classcode_id, (classcode_code || '-' || classcode_descrip), classcode_code " "FROM classcode " "ORDER BY classcode_code;" ); break; case ItemGroups: query.exec( "SELECT itemgrp_id, itemgrp_name, itemgrp_name " "FROM itemgrp " "ORDER BY itemgrp_name;" ); break; case CostCategories: query.exec( "SELECT costcat_id, (costcat_code || '-' || costcat_descrip), costcat_code " "FROM costcat " "ORDER BY costcat_code;" ); break; case ProductCategories: query.exec( "SELECT prodcat_id, (prodcat_code || ' - ' || prodcat_descrip), prodcat_code " "FROM prodcat " "ORDER BY prodcat_code;" ); break; case PlannerCodes: query.exec( "SELECT plancode_id, (plancode_code || '-' || plancode_name), plancode_code " "FROM plancode " "ORDER BY plancode_code;" ); break; case CustomerTypes: query.exec( "SELECT custtype_id, (custtype_code || '-' || custtype_descrip), custtype_code " "FROM custtype " "ORDER BY custtype_code;" ); break; case CustomerGroups: query.exec( "SELECT custgrp_id, custgrp_name, custgrp_name " "FROM custgrp " "ORDER BY custgrp_name;" ); break; case VendorTypes: query.exec( "SELECT vendtype_id, (vendtype_code || '-' || vendtype_descrip), vendtype_code " "FROM vendtype " "ORDER BY vendtype_code;" ); break; case VendorGroups: query.exec( "SELECT vendgrp_id, vendgrp_name, vendgrp_name " "FROM vendgrp " "ORDER BY vendgrp_name;" ); break; case Contracts: query.exec( "SELECT contrct_id, (vend_number || '-' || contrct_number), contrct_number " "FROM contrct JOIN vendinfo ON (vend_id=contrct_vend_id) " "ORDER BY vend_number, contrct_number;" ); break; case SalesRepsActive: query.exec( "SELECT salesrep_id, (salesrep_number || '-' || salesrep_name), salesrep_number " "FROM salesrep " "WHERE (salesrep_active) " "ORDER by salesrep_number;" ); break; case ShipVias: setAllowNull(TRUE); setEditable(TRUE); query.exec( "SELECT shipvia_id, (shipvia_code || '-' || shipvia_descrip), shipvia_code " "FROM shipvia " "ORDER BY shipvia_code;" ); break; case SalesReps: query.exec( "SELECT salesrep_id, (salesrep_number || '-' || salesrep_name), salesrep_number " "FROM salesrep " "ORDER by salesrep_number;" ); break; case SaleTypes: query.exec( "SELECT saletype_id, (saletype_code || '-' || saletype_descr), saletype_code " "FROM saletype " "ORDER BY saletype_code;" ); break; case ShippingCharges: query.exec( "SELECT shipchrg_id, (shipchrg_name || '-' || shipchrg_descrip), shipchrg_name " "FROM shipchrg " "ORDER by shipchrg_name;" ); break; case ShippingForms: query.exec( "SELECT shipform_id, shipform_name, shipform_name " "FROM shipform " "ORDER BY shipform_name;" ); break; case ShippingZones: query.exec( "SELECT shipzone_id, shipzone_name, shipzone_name " "FROM shipzone " "ORDER BY shipzone_name;" ); break; case Terms: query.exec( "SELECT terms_id, (terms_code || '-' || terms_descrip), terms_code " "FROM terms " "ORDER by terms_code;" ); break; case ARTerms: query.exec( "SELECT terms_id, (terms_code || '-' || terms_descrip), terms_code " "FROM terms " "WHERE (terms_ar) " "ORDER by terms_code;" ); break; case APTerms: query.exec( "SELECT terms_id, (terms_code || '-' || terms_descrip), terms_code " "FROM terms " "WHERE (terms_ap) " "ORDER by terms_code;" ); break; case ARBankAccounts: query.exec( "SELECT bankaccnt_id, (bankaccnt_name || '-' || bankaccnt_descrip), bankaccnt_name " "FROM bankaccnt " "WHERE (bankaccnt_ar) " "ORDER BY bankaccnt_name;" ); break; case APBankAccounts: query.exec( "SELECT bankaccnt_id, (bankaccnt_name || '-' || bankaccnt_descrip), bankaccnt_name " "FROM bankaccnt " "WHERE (bankaccnt_ap) " "ORDER BY bankaccnt_name;" ); break; case AccountingPeriods: query.exec( "SELECT period_id, (formatDate(period_start) || '-' || formatDate(period_end)), (formatDate(period_start) || '-' || formatDate(period_end)) " "FROM period " "ORDER BY period_start DESC;" ); break; case FinancialLayouts: query.exec( "SELECT flhead_id, flhead_name, flhead_name " "FROM flhead " "WHERE (flhead_active) " "ORDER BY flhead_name;" ); break; case FiscalYears: query.exec( "SELECT yearperiod_id, formatdate(yearperiod_start) || '-' || formatdate(yearperiod_end), formatdate(yearperiod_start) || '-' || formatdate(yearperiod_end)" " FROM yearperiod" " ORDER BY yearperiod_start DESC;" ); break; case SoProjects: setAllowNull(TRUE); query.exec( "SELECT prj_id, (prj_number || '-' || prj_name), prj_number " "FROM prj " "WHERE (prj_so) " "ORDER BY prj_name;" ); break; case WoProjects: setAllowNull(TRUE); query.exec( "SELECT prj_id, (prj_number || '-' || prj_name), prj_number " "FROM prj " "WHERE (prj_wo) " "ORDER BY prj_name;" ); break; case PoProjects: setAllowNull(TRUE); query.exec( "SELECT prj_id, (prj_number || '-' || prj_name), prj_number " "FROM prj " "WHERE (prj_po) " "ORDER BY prj_name;" ); break; case Currencies: query.exec( "SELECT curr_id, currConcat(curr_abbr, curr_symbol), curr_abbr" " FROM curr_symbol " "ORDER BY curr_base DESC, curr_abbr;" ); break; case CurrenciesNotBase: query.exec( "SELECT curr_id, currConcat(curr_abbr, curr_symbol), curr_abbr" " FROM curr_symbol " " WHERE curr_base = FALSE " "ORDER BY curr_abbr;" ); break; case Companies: query.exec( "SELECT company_id, company_number, company_number " "FROM company " "ORDER BY company_number;" ); break; case ProfitCenters: setEditable(_x_metrics->boolean("GLFFProfitCenters")); query.exec( "SELECT prftcntr_id, prftcntr_number, prftcntr_number " "FROM prftcntr " "ORDER BY prftcntr_number;" ); break; case Subaccounts: setEditable(_x_metrics->boolean("GLFFSubaccounts")); query.exec( "SELECT subaccnt_id, subaccnt_number, subaccnt_number " "FROM subaccnt " "ORDER BY subaccnt_number;" ); break; case AddressCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='ADDR')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case BBOMHeadCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='BBH')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case BBOMItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='BBI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case BOMHeadCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='BMH')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case BOMItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='BMI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case BOOHeadCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='BOH')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case BOOItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='BOI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case CRMAccountCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='CRMA')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case ContactCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='T')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case CustomerCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='C')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case EmployeeCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='EMP')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case IncidentCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='INCDT')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case ItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='I')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case ItemSiteCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='IS')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case ItemSourceCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='IR')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case LocationCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='L')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case LotSerialCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='LS')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case OpportunityCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='OPP')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case ProjectCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='J')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case PurchaseOrderCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='P')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case PurchaseOrderItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='PI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case ReturnAuthCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='RA')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case ReturnAuthItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='RI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case QuoteCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='Q')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case QuoteItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='QI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case SalesOrderCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='S')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case SalesOrderItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='SI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case TaskCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='TA')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case TodoItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='TD')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case TransferOrderCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='TO')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case TransferOrderItemCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='TI')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case VendorCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='V')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case WarehouseCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='WH')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case WorkOrderCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype JOIN cmnttypesource ON (cmnttypesource_cmnttype_id=cmnttype_id)" " JOIN source ON (source_id=cmnttypesource_source_id) " "WHERE (source_name='W')" "ORDER BY cmnttype_order, cmnttype_name;" ); break; case AllCommentTypes: query.exec( "SELECT cmnttype_id, cmnttype_name, cmnttype_name " "FROM cmnttype " "ORDER BY cmnttype_order, cmnttype_name;" ); break; case AllProjects: query.exec( "SELECT prj_id, prj_name, prj_name " "FROM prj " "ORDER BY prj_name;" ); break; case Users: query.exec( "SELECT usr_id, usr_username, usr_username " "FROM usr " "ORDER BY usr_username;" ); case ActiveUsers: query.exec( "SELECT usr_id, usr_username, usr_username " "FROM usr " "WHERE usr_active = true " "ORDER BY usr_username;" ); break; case SalesCategories: query.exec( "SELECT salescat_id, (salescat_name || '-' || salescat_descrip), salescat_name " "FROM salescat " "ORDER BY salescat_name;" ); break; case SalesCategoriesActive: query.exec( "SELECT salescat_id, (salescat_name || '-' || salescat_descrip), salescat_name " "FROM salescat " "WHERE (salescat_active) " "ORDER BY salescat_name;" ); break; case ExpenseCategories: query.exec( "SELECT expcat_id, (expcat_code || '-' || expcat_descrip), expcat_code " "FROM expcat " "ORDER BY expcat_code;" ); break; case ReasonCodes: query.exec( "SELECT rsncode_id, (rsncode_code || '-' || rsncode_descrip), rsncode_code" " FROM rsncode " "ORDER BY rsncode_code;" ); break; case ARCMReasonCodes: query.exec( "SELECT rsncode_id, (rsncode_code || '-' || rsncode_descrip), rsncode_code" " FROM rsncode " " WHERE ( (rsncode_doctype IS NULL) OR (rsncode_doctype='ARCM') ) " "ORDER BY rsncode_code;" ); break; case ARDMReasonCodes: query.exec( "SELECT rsncode_id, (rsncode_code || '-' || rsncode_descrip), rsncode_code" " FROM rsncode " " WHERE ( (rsncode_doctype IS NULL) OR (rsncode_doctype='ARDM') ) " "ORDER BY rsncode_code;" ); break; case ReturnReasonCodes: query.exec( "SELECT rsncode_id, (rsncode_code || '-' || rsncode_descrip), rsncode_code" " FROM rsncode " " WHERE ( (rsncode_doctype IS NULL) OR (rsncode_doctype='RA') ) " "ORDER BY rsncode_code;" ); break; case TaxCodes: query.exec( "SELECT tax_id, (tax_code || '-' || tax_descrip), tax_code" " FROM tax " "ORDER BY tax_code;" ); break; case WorkCenters: query.exec( "SELECT wrkcnt_id, (wrkcnt_code || '-' || wrkcnt_descrip), wrkcnt_code" " FROM xtmfg.wrkcnt " "ORDER BY wrkcnt_code;" ); break; case CRMAccounts: setAllowNull(TRUE); query.exec( "SELECT crmacct_id, (crmacct_number || '-' || crmacct_name), crmacct_number" " FROM crmacct " "ORDER BY crmacct_number;" ); break; case Honorifics: setAllowNull(TRUE); query.exec( "SELECT hnfc_id, hnfc_code, hnfc_code" " FROM hnfc " "ORDER BY hnfc_code;" ); break; case IncidentSeverity: query.exec( "SELECT incdtseverity_id, incdtseverity_name, incdtseverity_name" " FROM incdtseverity" " ORDER BY incdtseverity_order, incdtseverity_name;" ); break; case IncidentPriority: query.exec( "SELECT incdtpriority_id, incdtpriority_name, incdtpriority_name" " FROM incdtpriority" " ORDER BY incdtpriority_order, incdtpriority_name;" ); break; case IncidentResolution: query.exec( "SELECT incdtresolution_id, incdtresolution_name, incdtresolution_name" " FROM incdtresolution" " ORDER BY incdtresolution_order, incdtresolution_name;" ); break; case IncidentCategory: query.exec( "SELECT incdtcat_id, incdtcat_name, incdtcat_name" " FROM incdtcat" " ORDER BY incdtcat_order, incdtcat_name;" ); break; case TaxAuths: query.exec( "SELECT taxauth_id, taxauth_code, taxauth_code" " FROM taxauth" " ORDER BY taxauth_code;" ); break; case TaxTypes: query.exec( "SELECT taxtype_id, taxtype_name, taxtype_name" " FROM taxtype" " ORDER BY taxtype_name;" ); break; case Agent: query.exec( "SELECT usr_id, usr_username, usr_username " " FROM usr" " WHERE (usr_agent) " " ORDER BY usr_username;" ); break; case Reports: query.exec( "SELECT a.report_id, a.report_name, a.report_name " "FROM report a, " " (SELECT MIN(report_grade) AS report_grade, report_name " " FROM report " " GROUP BY report_name) b " "WHERE ((a.report_name=b.report_name)" " AND (a.report_grade=b.report_grade)) " "ORDER BY report_name;" ); break; case OpportunityStages: query.exec("SELECT opstage_id, opstage_name, opstage_name " " FROM opstage" " ORDER BY opstage_order;"); break; case OpportunitySources: query.exec("SELECT opsource_id, opsource_name, opsource_name " " FROM opsource;"); break; case OpportunityTypes: query.exec("SELECT optype_id, optype_name, optype_name " " FROM optype;"); break; case Locales: query.exec("SELECT locale_id, locale_code, locale_code " " FROM locale" " ORDER BY locale_code;"); break; case LocaleLanguages: query.exec("SELECT lang_id, lang_name, lang_name " " FROM lang" " WHERE lang_qt_number IS NOT NULL" " ORDER BY lang_name;"); break; case Countries: query.exec("SELECT country_id, country_name, country_name " " FROM country" " ORDER BY country_name;"); break; case LocaleCountries: query.exec("SELECT country_id, country_name, country_name " " FROM country" " WHERE country_qt_number IS NOT NULL" " ORDER BY country_name;"); break; case RegistrationTypes: query.exec("SELECT regtype_id, regtype_code, regtype_code " " FROM regtype" " ORDER BY regtype_code;"); break; case SiteTypes: query.exec("SELECT sitetype_id, sitetype_name, sitetype_name " " FROM sitetype" " ORDER BY sitetype_name;"); break; case FreightClasses: query.exec( "SELECT freightclass_id, (freightclass_code || '-' || freightclass_descrip), freightclass_code " "FROM freightclass " "ORDER BY freightclass_code;" ); break; case TaxClasses: query.exec( "SELECT taxclass_id, (taxclass_code || '-' || taxclass_descrip), taxclass_code " "FROM taxclass " "ORDER BY taxclass_code;" ); break; case TaxZones: query.exec( "SELECT taxzone_id, (taxzone_code || '-' || taxzone_descrip), taxzone_code " "FROM taxzone " "ORDER BY taxzone_code;" ); break; } populate(query); switch (pType) { case SoProjects: case WoProjects: case PoProjects: setEnabled(count() > 1); break; case Currencies: case CurrenciesNotBase: if (_data->numberOfCurrencies() <= 1) { hide(); if (_data->_label) _data->_label->hide(); } break; default: break; } } void XComboBox::setLabel(QLabel* pLab) { _data->_label = pLab; switch (_data->_type) { case Currencies: case CurrenciesNotBase: if (_data->numberOfCurrencies() <= 1) { hide(); if (_data->_label) _data->_label->hide(); } break; default: break; } } void XComboBox::setCode(const QString &pString) { if (DEBUG) qDebug("%s::setCode(%d %d %s) with _codes.count %d and _ids.count %d", objectName().toAscii().data(), pString.isNull(), pString.isEmpty(), pString.toAscii().data(), _data->_codes.count(), _data->_ids.count()); if (pString.isEmpty()) { setId(-1); setItemText(0, pString); } else if (_data->_codes.count()) { for (int counter = 0; counter < _data->_codes.count(); counter++) { if (_data->_codes.at(counter) == pString) { if (DEBUG) qDebug("%s::setCode(%s) found at %d with _ids.count %d & _lastId %d", objectName().toAscii().data(), pString.toAscii().data(), counter, _data->_ids.count(), _data->_lastId); setCurrentIndex(counter); if (_data->_ids.count() && _data->_lastId!=_data->_ids.at(counter)) setId(_data->_ids.at(counter)); return; } else if (DEBUG) qDebug("%s::setCode(%s) not found (%s)", qPrintable(objectName()), qPrintable(pString), qPrintable(_data->_codes.at(counter))); } } else // this is an ad-hoc combobox without a query behind it? { setCurrentIndex(findText(pString)); if (DEBUG) qDebug("%s::setCode(%s) set current item to %d using findData()", objectName().toAscii().data(), pString.toAscii().data(), currentIndex()); if (_data->_ids.count() > currentIndex()) setId(_data->_ids.at(currentIndex())); if (DEBUG) qDebug("%s::setCode(%s) current item is %d after setId", objectName().toAscii().data(), pString.toAscii().data(), currentIndex()); } if (isEditable()) { setId(-1); setItemText(0, pString); } } void XComboBox::setId(int pTarget) { // reports are a special case: they should really be stored by name, not id if (_data->_type == Reports) { XSqlQuery query; query.prepare("SELECT report_id " "FROM report " "WHERE (report_name IN (SELECT report_name " " FROM report " " WHERE (report_id=:report_id)));"); query.bindValue(":report_id", pTarget); query.exec(); while (query.next()) { int id = query.value("report_id").toInt(); for (int counter = 0; counter < count(); counter++) { if (_data->_ids.at(counter) == id) { setCurrentIndex(counter); if(_data->_lastId!=id) { _data->_lastId = id; updateMapperData(); emit newID(pTarget); emit valid(TRUE); if (allowNull()) emit notNull(TRUE); } return; } } } } else { for (int counter = 0; counter < _data->_ids.count(); counter++) { if (_data->_ids.at(counter) == pTarget) { setCurrentIndex(counter); if(_data->_lastId!=pTarget) { _data->_lastId = pTarget; updateMapperData(); emit newID(pTarget); emit valid(TRUE); if (allowNull()) emit notNull(TRUE); } return; } } } setNull(); } void XComboBox::setText(QVariant &pVariant) { XComboBox::setText(pVariant.toString()); } void XComboBox::setText(const QString &pString) { if (pString == currentText()) return; if (count()) { for (int counter = ((allowNull()) ? 1 : 0); counter < count(); counter++) { if (itemText(counter) == pString) { setCurrentIndex(counter); updateMapperData(); emit newID(id()); return; } } } if (isEditable()) { setId(-1); setItemText(0, pString); } } void XComboBox::setAllowNull(bool pAllowNull) { if (DEBUG) qDebug("%s::setAllowNull(%d)", qPrintable(objectName()), pAllowNull); _allowNull = pAllowNull; if (pAllowNull) { append(-1, _data->_nullStr); setItemText(0, _data->_nullStr); } } void XComboBox::setNull() { if (allowNull()) { _data->_lastId = -1; setCurrentIndex(0); updateMapperData(); emit newID(-1); emit valid(FALSE); emit notNull(FALSE); } } void XComboBox::setNullStr(const QString& pNullStr) { if (DEBUG) qDebug("%s::setNullStr(%s)", qPrintable(objectName()), qPrintable(pNullStr)); _data->_nullStr = pNullStr; if (allowNull()) { append(-1, _data->_nullStr); setItemText(0, pNullStr); } } void XComboBox::setText(const QVariant &pVariant) { setText(pVariant.toString()); } void XComboBox::clear() { QComboBox::clear(); if (_data->_ids.count()) _data->_ids.clear(); if (_data->_codes.count()) _data->_codes.clear(); if (allowNull()) append(-1, _data->_nullStr); } // allow repopulating after the underlying contents have changed (e.g. #3698) void XComboBox::populate() { setType(_data->_type); } void XComboBox::populate(XSqlQuery pQuery, int pSelected) { int selected = (pSelected >= 0) ? pSelected : id(); clear(); // strange if/loop construct allows multiple comboboxes to use the same query if (pQuery.first()) do { if (pQuery.record().count() < 3) append(pQuery.value(0).toInt(), pQuery.value(1).toString()); else append(pQuery.value(0).toInt(), pQuery.value(1).toString(), pQuery.value(2).toString()); } while (pQuery.next()); setId(selected); // TODO: why doesn't setId() handle the following as expected? { updateMapperData(); emit newID(_data->_lastId); emit valid((_data->_lastId != -1)); // } end why } void XComboBox::populate(const QString & pSql, int pSelected) { qApp->setOverrideCursor(Qt::WaitCursor); XSqlQuery query(pSql); populate(query, pSelected); qApp->restoreOverrideCursor(); } void XComboBox::append(int pId, const QString &pText) { append(pId,pText,pText); } void XComboBox::append(int pId, const QString &pText, const QString &pCode) { if (DEBUG) qDebug("%s::append(%d, %s, %s)", qPrintable(objectName()), pId, qPrintable(pText), qPrintable(pCode)); if (! _data->_ids.contains(pId)) { addItem(pText); _data->_ids.append(pId); _data->_codes.append(pCode); } } int XComboBox::id(int pIndex) const { if ((pIndex >= 0) && (pIndex < count())) { if ( (allowNull()) && (currentIndex() <= 0) ) return -1; else if(pIndex < _data->_ids.count()) return _data->_ids.at(pIndex); } return -1; } int XComboBox::id() const { if (_data->_ids.count() && currentIndex() != -1) { if ( (allowNull()) && (currentIndex() <= 0) ) return -1; else return _data->_ids.at(currentIndex()); } else return -1; } QString XComboBox::code() const { if (DEBUG) qDebug("%s::code() with currentIndex %d, allowNull %d, and _codes.count %d", objectName().toAscii().data(), currentIndex(), allowNull(), _data->_codes.count()); QString returnValue; if ( allowNull() && (currentIndex() <= 0) ) returnValue = QString::Null(); else if (currentIndex() >= 0 && _data->_codes.count() > currentIndex()) returnValue = _data->_codes.at(currentIndex()); else if (currentIndex() >= 0) returnValue = currentText(); else returnValue = QString::Null(); if (DEBUG) qDebug("%s::code() returning %s", objectName().toAscii().data(), returnValue.toAscii().data()); return returnValue; } bool XComboBox::isValid() const { if ((allowNull()) && (id() == -1)) return FALSE; else return TRUE; } void XComboBox::sHandleNewIndex(int pIndex) { if (DEBUG) qDebug("%s::sHandleNewIndex(%d)",objectName().toAscii().data(), pIndex); if ((pIndex >= 0) && (pIndex < _data->_ids.count()) && (_data->_ids.at(pIndex) != _data->_lastId)) { _data->_lastId = _data->_ids.at(pIndex); updateMapperData(); emit newID(_data->_lastId); if (DEBUG) qDebug("%s::sHandleNewIndex() emitted %d", objectName().toAscii().data(), _data->_lastId); if (allowNull()) { emit valid((pIndex != 0)); emit notNull((pIndex != 0)); } } if (DEBUG) qDebug("%s::sHandleNewIndex() returning", objectName().toAscii().data()); } void XComboBox::mousePressEvent(QMouseEvent *event) { emit clicked(); QComboBox::mousePressEvent(event); } void XComboBox::showPopup() { QComboBox::showPopup(); QAbstractItemView *itemView = view(); if (_data->_editButton && _data->_popupCounter == 0) { _data->_popupCounter++; itemView->setFixedHeight(itemView->height() + _data->_editButton->height() + 5); } } QSize XComboBox::sizeHint() const { QSize s = QComboBox::sizeHint(); #ifdef Q_WS_MAC s.setWidth(s.width() + 12); #endif return s; } void XComboBox::updateMapperData() { QString val; if (_data->_codes.count()) val = code(); else val = currentText(); if (_data->_mapper->model() && _data->_mapper->model()->data(_data->_mapper->model()->index(_data->_mapper->currentIndex(),_data->_mapper->mappedSection(this))).toString() != val) _data->_mapper->model()->setData(_data->_mapper->model()->index(_data->_mapper->currentIndex(),_data->_mapper->mappedSection(this)), val); } void XComboBox::insertEditor(XComboBoxTypes type, const QString &uiName, const QString &privilege) { _data->_editorMap.insert(type, new XComboBoxEditorDescrip(type, uiName, privilege)); if (_data->_type == type && ! _data->_editButton) // add edit button if needed _data->setType(type); } void XComboBox::insertEditor(XComboBoxTypes type, QObject *obj, char *slot, const QString &privilege) { _data->_editorMap.insert(type, new XComboBoxEditorDescrip(type, obj, slot, privilege)); if (_data->_type == type && ! _data->_editButton) // add edit button if needed _data->setType(type); } // scripting exposure ///////////////////////////////////////////////////////// QScriptValue XComboBoxtoScriptValue(QScriptEngine *engine, XComboBox* const &item) { return engine->newQObject(item); } void XComboBoxfromScriptValue(const QScriptValue &obj, XComboBox* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue XComboBoxDefaultstoScriptValue(QScriptEngine *engine, XComboBox::Defaults const &item) { return QScriptValue(engine, (int)item); } void XComboBoxDefaultsfromScriptValue(const QScriptValue &obj, XComboBox::Defaults &item) { item = (XComboBox::Defaults)(obj.toInt32()); } QScriptValue constructXComboBox(QScriptContext *context, QScriptEngine *engine) { XComboBox *cbox = 0; if (context->argumentCount() == 0) cbox = new XComboBox(); else if (context->argumentCount() == 1 && context->argument(0).isBool()) cbox = new XComboBox(context->argument(0).toBool()); else if (context->argumentCount() == 1 && qscriptvalue_cast(context->argument(0))) cbox = new XComboBox(qscriptvalue_cast(context->argument(0))); else if (context->argumentCount() == 2 && context->argument(0).isBool() && qscriptvalue_cast(context->argument(1))) cbox = new XComboBox(context->argument(0).toBool(), qscriptvalue_cast(context->argument(1))); else if (context->argumentCount() == 2 && qscriptvalue_cast(context->argument(0)) && context->argument(1).isString()) cbox = new XComboBox(qscriptvalue_cast(context->argument(0)), context->argument(1).toString().toAscii().data()); else if (context->argumentCount() >= 3 && context->argument(0).isBool() && qscriptvalue_cast(context->argument(1))) { cbox = new XComboBox(context->argument(0).toBool(), qscriptvalue_cast(context->argument(1)), context->argument(2).toString().toAscii().data()); } else context->throwError(QScriptContext::UnknownError, QString("Could not find an appropriate XComboBox constructor")); return engine->toScriptValue(cbox); } void setupXComboBox(QScriptEngine *engine) { qScriptRegisterMetaType(engine, XComboBoxtoScriptValue, XComboBoxfromScriptValue); //qScriptRegisterMetaType(engine, XComboBoxTypestoScriptValue, XComboBoxTypesfromScriptValue); qScriptRegisterMetaType(engine, XComboBoxDefaultstoScriptValue, XComboBoxDefaultsfromScriptValue); QScriptValue widget = engine->newFunction(constructXComboBox); widget.setProperty("First", QScriptValue(engine, XComboBox::First), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("None", QScriptValue(engine, XComboBox::None), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Adhoc", QScriptValue(engine, XComboBox::Adhoc), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("APBankAccounts", QScriptValue(engine, XComboBox::APBankAccounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("APTerms", QScriptValue(engine, XComboBox::APTerms), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ARBankAccounts", QScriptValue(engine, XComboBox::ARBankAccounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ARTerms", QScriptValue(engine, XComboBox::ARTerms), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AccountingPeriods", QScriptValue(engine, XComboBox::AccountingPeriods), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Agent", QScriptValue(engine, XComboBox::Agent), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllCommentTypes", QScriptValue(engine, XComboBox::AllCommentTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("AllProjects", QScriptValue(engine, XComboBox::AllProjects), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CRMAccounts", QScriptValue(engine, XComboBox::CRMAccounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ClassCodes", QScriptValue(engine, XComboBox::ClassCodes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Companies", QScriptValue(engine, XComboBox::Companies), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CostCategories", QScriptValue(engine, XComboBox::CostCategories), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Countries", QScriptValue(engine, XComboBox::Countries), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Currencies", QScriptValue(engine, XComboBox::Currencies), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CurrenciesNotBase", QScriptValue(engine, XComboBox::CurrenciesNotBase), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomerCommentTypes", QScriptValue(engine, XComboBox::CustomerCommentTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomerGroups", QScriptValue(engine, XComboBox::CustomerGroups), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("CustomerTypes", QScriptValue(engine, XComboBox::CustomerTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ExpenseCategories", QScriptValue(engine, XComboBox::ExpenseCategories), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FinancialLayouts", QScriptValue(engine, XComboBox::FinancialLayouts), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FiscalYears", QScriptValue(engine, XComboBox::FiscalYears), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("FreightClasses", QScriptValue(engine, XComboBox::FreightClasses), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Honorifics", QScriptValue(engine, XComboBox::Honorifics), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IncidentCategory", QScriptValue(engine, XComboBox::IncidentCategory), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IncidentPriority", QScriptValue(engine, XComboBox::IncidentPriority), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IncidentResolution", QScriptValue(engine, XComboBox::IncidentResolution), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("IncidentSeverity", QScriptValue(engine, XComboBox::IncidentSeverity), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemCommentTypes", QScriptValue(engine, XComboBox::ItemCommentTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ItemGroups", QScriptValue(engine, XComboBox::ItemGroups), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Locales", QScriptValue(engine, XComboBox::Locales), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LocaleCountries", QScriptValue(engine, XComboBox::LocaleCountries), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LocaleLanguages", QScriptValue(engine, XComboBox::LocaleLanguages), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("LotSerialCommentTypes",QScriptValue(engine, XComboBox::LotSerialCommentTypes),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OpportunityStages", QScriptValue(engine, XComboBox::OpportunityStages), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OpportunitySources", QScriptValue(engine, XComboBox::OpportunitySources), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("OpportunityTypes", QScriptValue(engine, XComboBox::OpportunityTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PlannerCodes", QScriptValue(engine, XComboBox::PlannerCodes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("PoProjects", QScriptValue(engine, XComboBox::PoProjects), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ProductCategories", QScriptValue(engine, XComboBox::ProductCategories), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ProfitCenters", QScriptValue(engine, XComboBox::ProfitCenters), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ProjectCommentTypes", QScriptValue(engine, XComboBox::ProjectCommentTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ReasonCodes", QScriptValue(engine, XComboBox::ReasonCodes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("RegistrationTypes", QScriptValue(engine, XComboBox::RegistrationTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Reports", QScriptValue(engine, XComboBox::Reports), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesCategories", QScriptValue(engine, XComboBox::SalesCategories), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesCategoriesActive",QScriptValue(engine, XComboBox::SalesCategoriesActive),QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesReps", QScriptValue(engine, XComboBox::SalesReps), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SalesRepsActive", QScriptValue(engine, XComboBox::SalesRepsActive), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SaleTypes", QScriptValue(engine, XComboBox::SaleTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ShipVias", QScriptValue(engine, XComboBox::ShipVias), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ShippingCharges", QScriptValue(engine, XComboBox::ShippingCharges), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ShippingForms", QScriptValue(engine, XComboBox::ShippingForms), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("ShippingZones", QScriptValue(engine, XComboBox::ShippingZones), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SiteTypes", QScriptValue(engine, XComboBox::SiteTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("SoProjects", QScriptValue(engine, XComboBox::SoProjects), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Subaccounts", QScriptValue(engine, XComboBox::Subaccounts), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TaxAuths", QScriptValue(engine, XComboBox::TaxAuths), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TaxCodes", QScriptValue(engine, XComboBox::TaxCodes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("TaxTypes", QScriptValue(engine, XComboBox::TaxTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Terms", QScriptValue(engine, XComboBox::Terms), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("UOMs", QScriptValue(engine, XComboBox::UOMs), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("Users", QScriptValue(engine, XComboBox::Users), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("VendorCommentTypes", QScriptValue(engine, XComboBox::VendorCommentTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("VendorGroups", QScriptValue(engine, XComboBox::VendorGroups), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("VendorTypes", QScriptValue(engine, XComboBox::VendorTypes), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WoProjects", QScriptValue(engine, XComboBox::WoProjects), QScriptValue::ReadOnly | QScriptValue::Undeletable); widget.setProperty("WorkCenters", QScriptValue(engine, XComboBox::WorkCenters), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("XComboBox", widget, QScriptValue::ReadOnly | QScriptValue::Undeletable); } qt-client-4.1.0/widgets/xcombobox.h000066400000000000000000000157511217451700100172420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef xcombobox_h #define xcombobox_h #include #include "guiclientinterface.h" #include "widgets.h" #include class QLabel; class QMouseEvent; class QScriptEngine; class XComboBoxPrivate; class XDataWidgetMapper; void setupXComboBox(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT XComboBox : public QComboBox { Q_OBJECT Q_ENUMS(Defaults) Q_ENUMS(XComboBoxTypes) Q_PROPERTY(bool allowNull READ allowNull WRITE setAllowNull ) Q_PROPERTY(QString nullStr READ nullStr WRITE setNullStr ) Q_PROPERTY(XComboBoxTypes type READ type WRITE setType ) Q_PROPERTY(QString code READ code WRITE setCode DESIGNABLE false) Q_PROPERTY(Defaults defaultCode READ defaultCode WRITE setDefaultCode ) Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName ) Q_PROPERTY(QString listSchemaName READ listSchemaName WRITE setListSchemaName ) Q_PROPERTY(QString listTableName READ listTableName WRITE setListTableName ) Q_PROPERTY(QString listIdFieldName READ listIdFieldName WRITE setListIdFieldName ) Q_PROPERTY(QString listDisplayFieldName READ listDisplayFieldName WRITE setListDisplayFieldName ) Q_PROPERTY(QString currentDefault READ currentDefault DESIGNABLE false) Q_PROPERTY(QString text READ currentText WRITE setText DESIGNABLE false) public: XComboBox(QWidget * = 0, const char * = 0); XComboBox(bool, QWidget * = 0, const char * = 0); virtual ~XComboBox(); enum Defaults { First, None }; enum XComboBoxTypes { AddressCommentTypes, Adhoc, APBankAccounts, APTerms, ARBankAccounts, ARCMReasonCodes, ARDMReasonCodes, ARTerms, AccountingPeriods, Agent, AllCommentTypes, AllProjects, BBOMHeadCommentTypes, BBOMItemCommentTypes, BOMHeadCommentTypes, BOMItemCommentTypes, BOOHeadCommentTypes, BOOItemCommentTypes, CRMAccounts, CRMAccountCommentTypes, ClassCodes, Companies, ContactCommentTypes, Contracts, CostCategories, Countries, Currencies, CurrenciesNotBase, CustomerCommentTypes, CustomerGroups, CustomerTypes, EmployeeCommentTypes, ExpenseCategories, FinancialLayouts, FiscalYears, FreightClasses, Honorifics, IncidentCategory, IncidentCommentTypes, IncidentPriority, IncidentResolution, IncidentSeverity, ItemCommentTypes, ItemGroups, ItemSiteCommentTypes, ItemSourceCommentTypes, Locales, LocaleCountries, LocaleLanguages, LocationCommentTypes, LotSerialCommentTypes, OpportunityCommentTypes, OpportunityStages, OpportunitySources, OpportunityTypes, PlannerCodes, PoProjects, ProductCategories, ProfitCenters, ProjectCommentTypes, PurchaseOrderCommentTypes, PurchaseOrderItemCommentTypes, ReasonCodes, RegistrationTypes, Reports, ReturnReasonCodes, ReturnAuthCommentTypes, ReturnAuthItemCommentTypes, QuoteCommentTypes, QuoteItemCommentTypes, SalesOrderCommentTypes, SalesOrderItemCommentTypes, SalesCategories, SalesCategoriesActive, SalesReps, SalesRepsActive, SaleTypes, ShipVias, ShippingCharges, ShippingForms, ShippingZones, SiteTypes, SoProjects, Subaccounts, TaxAuths, TaxClasses, TaxCodes, TaxZones, TaxTypes, Terms, TaskCommentTypes, TodoItemCommentTypes, TransferOrderCommentTypes, TransferOrderItemCommentTypes, UOMs, Users, ActiveUsers, VendorCommentTypes, VendorGroups, VendorTypes, WarehouseCommentTypes, WoProjects, WorkCenters, WorkOrderCommentTypes }; static GuiClientInterface *_guiClientInterface; XComboBoxTypes type(); void setType(XComboBoxTypes); void setCode(const QString&); virtual bool allowNull() const; virtual Defaults defaultCode() const; virtual void setAllowNull(bool); virtual void setNull(); QString nullStr() const; void setNullStr(const QString &); Q_INVOKABLE QLabel* label() const; Q_INVOKABLE void setLabel(QLabel* pLab); Q_INVOKABLE bool isValid() const; int id(int) const; Q_INVOKABLE int id() const; Q_INVOKABLE void insertEditor(XComboBoxTypes type, const QString &uiName, const QString& privilege); Q_INVOKABLE void insertEditor(XComboBoxTypes type, QObject *obj, char *slot, const QString &privilege = QString()); QString code() const; QString fieldName() const; QString listDisplayFieldName() const; QString listIdFieldName() const; QString listSchemaName() const; QString listTableName() const; virtual void showPopup(); QSize sizeHint() const; Q_INVOKABLE void removeItem(int idx); // exists only for script exposure public slots: void clear(); void append(int, const QString &); void append(int, const QString &, const QString &); void populate(XSqlQuery, int = -1); void populate(const QString &, int = -1); void populate(); void setDataWidgetMap(XDataWidgetMapper* m); void setDefaultCode(Defaults p); void setFieldName(QString p); void setListDisplayFieldName(QString p); void setListIdFieldName(QString p); void setListSchemaName(QString p); void setListTableName(QString p); void setId(int); void setText(QVariant &); void setText(const QString &); void setText(const QVariant &); void updateMapperData(); signals: void clicked(); void newID(int); void notNull(bool); void valid(bool); protected slots: void sHandleNewIndex(int); protected: QString currentDefault(); void mousePressEvent(QMouseEvent *); bool _allowNull; XComboBoxPrivate *_data; void init(); }; // TODO: is this necessary for script exposure? Q_DECLARE_METATYPE(XComboBox*) Q_DECLARE_METATYPE(enum XComboBox::XComboBoxTypes) Q_DECLARE_METATYPE(enum XComboBox::Defaults) #endif qt-client-4.1.0/widgets/xcomboboxprivate.h000066400000000000000000000034471217451700100206340ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XCOMBOBOXPRIVATE_H__ #define __XCOMBOBOXPRIVATE_H__ #include #include #include #include "xcombobox.h" class QLabel; class QPushButton; class XDataWidgetMapper; class XComboBoxEditorDescrip; class XComboBoxPrivate : public QObject { Q_OBJECT public: XComboBoxPrivate(XComboBox *parent); virtual ~XComboBoxPrivate(); int numberOfCurrencies(); public slots: void sEdit(); void setType(XComboBox::XComboBoxTypes ptype); public: QList _codes; enum XComboBox::Defaults _default; QMap _editorMap; QPushButton *_editButton; QList _ids; QLabel *_label; int _lastId; QString _nullStr; XComboBox *_parent; int _popupCounter; // a real hack enum XComboBox::XComboBoxTypes _type; // the following probably belong in an abstract interface superclass QString _fieldName; QString _listDisplayFieldName; QString _listIdFieldName; QString _listSchemaName; QString _listTableName; XDataWidgetMapper *_mapper; }; #endif qt-client-4.1.0/widgets/xdatawidgetmapper.cpp000066400000000000000000000046021217451700100213000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xdatawidgetmapper.h" XDataWidgetMapper::XDataWidgetMapper(QObject *parent) : QDataWidgetMapper(parent) { } XDataWidgetMapper::~XDataWidgetMapper() { } void XDataWidgetMapper::addMapping(QWidget *widget, QString fieldName) { QDataWidgetMapper::addMapping(widget, static_cast(model())->fieldIndex(fieldName)); emit newMapping(widget); } void XDataWidgetMapper::addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName) { QDataWidgetMapper::addMapping(widget, static_cast(model())->fieldIndex(fieldName), propertyName); emit newMapping(widget); } /* This overload allows for a default property that can mapped. The value of the property at that mapping will be used when clear() is called.*/ void XDataWidgetMapper::addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName, const QByteArray &defaultName) { QDataWidgetMapper::addMapping(widget, static_cast(model())->fieldIndex(fieldName), propertyName); removeDefault(widget); widgetMap.append(WidgetMapper(widget, static_cast(model())->fieldIndex(fieldName), defaultName)); emit newMapping(widget); } void XDataWidgetMapper::clear() { for (int i = 0; i < widgetMap.count(); ++i) clear(widgetMap[i]); } void XDataWidgetMapper::clear(WidgetMapper &m) { if (m.widget.isNull()) return; if (!m.property.isEmpty()) model()->setData(model()->index(currentIndex(),m.section),m.widget->property(m.property)); } QByteArray XDataWidgetMapper::mappedDefaultName(QWidget *widget) { for (int i = 0; i < widgetMap.count(); ++i) if (widgetMap.at(i).widget == widget) { return widgetMap.at(i).property; } return QByteArray(); } void XDataWidgetMapper::removeDefault(QWidget *widget) { for (int i = 0; i < widgetMap.count(); ++i) if (widgetMap.at(i).widget == widget) { widgetMap.removeAt(i); return; } } qt-client-4.1.0/widgets/xdatawidgetmapper.h000066400000000000000000000033051217451700100207440ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XDATAWIDGETMAPPER_H #define XDATAWIDGETMAPPER_H #include #include #include #include #include "widgets.h" class XTUPLEWIDGETS_EXPORT XDataWidgetMapper : public QDataWidgetMapper { Q_OBJECT public: XDataWidgetMapper(QObject *parent = 0); ~XDataWidgetMapper(); virtual QByteArray mappedDefaultName(QWidget *widget); virtual void addMapping(QWidget *widget, QString fieldName); virtual void addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName); virtual void addMapping(QWidget *widget, QString fieldName, const QByteArray &propertyName, const QByteArray &defaultName); virtual void removeDefault(QWidget *widget); public slots: virtual void clear(); signals: bool newMapping(QWidget *widget); private: struct WidgetMapper { inline WidgetMapper(QWidget *w, int c, const QByteArray &p) : widget(w), section(c), property(p) {} QPointer widget; int section; QPersistentModelIndex currentIndex; QByteArray property; }; QList widgetMap; virtual void clear(WidgetMapper &m); }; #endif qt-client-4.1.0/widgets/xdoccopysetter.cpp000066400000000000000000000153001217451700100206420ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xdoccopysetter.h" #include #include "editwatermark.h" static QString yesStr = QT_TRANSLATE_NOOP("XDocCopySetter", "Yes"); static QString noStr = QT_TRANSLATE_NOOP("XDocCopySetter", "No"); /** @class XDocCopySetter @brief The XDocCopySetter gives the %user a unified interface for telling the system how many copies of a particular document should be printed when it gets sent to a printer, what the watermark should be on the report, and whether the report should show prices or not. @see printInvoice */ XDocCopySetter::XDocCopySetter(QWidget *parent, const char *pName) : QWidget(parent) { setupUi(this); if(pName) setObjectName(pName); connect(_watermarks, SIGNAL(itemSelected(int)), this, SLOT(sEditWatermark())); connect(_numOfCopies, SIGNAL(valueChanged(int)), this, SLOT(setNumCopies(int))); _watermarks->addColumn(tr("Copy #"), 80, Qt::AlignRight); _watermarks->addColumn(tr("Watermark"), -1, Qt::AlignLeft); _watermarks->addColumn(tr("Show Prices"), 80, Qt::AlignCenter); } XDocCopySetter::~XDocCopySetter() { } void XDocCopySetter::languageChange() { } QString XDocCopySetter::labelText() const { return _copiesGroup->title();} int XDocCopySetter::numCopies() const { return _numOfCopies->value();} QString XDocCopySetter::numCopiesMetric() const { return _numCopiesMetric; } QString XDocCopySetter::showPriceMetric() const { return _showPriceMetric; } QString XDocCopySetter::watermarkMetric() const { return _watermarkMetric; } bool XDocCopySetter::showCosts(const int row) const { return (_watermarks->topLevelItem(row)->text(2) == yesStr); } QString XDocCopySetter::watermark(const int row) const { return _watermarks->topLevelItem(row)->text(1); } bool XDocCopySetter::save() { if (_x_metrics) { if (! _numCopiesMetric.isEmpty()) _x_metrics->set(_numCopiesMetric, _numOfCopies->value()); QString fullmetric("%1%2"); for (int i = 0; i < _watermarks->topLevelItemCount(); i++) { XTreeWidgetItem *item = _watermarks->topLevelItem(i); if (! _watermarkMetric.isEmpty()) _x_metrics->set(fullmetric.arg(_watermarkMetric).arg(i), item->text(1)); if (! _showPriceMetric.isEmpty()) _x_metrics->set(fullmetric.arg(_showPriceMetric).arg(i), (item->text(2) == yesStr)); } } return true; } void XDocCopySetter::setLabelText(const QString text) { _copiesGroup->setTitle(text); } void XDocCopySetter::setNumCopies(const int numCopies) { _numOfCopies->setValue(numCopies); while (_watermarks->topLevelItemCount() > numCopies) _watermarks->takeTopLevelItem(_watermarks->topLevelItemCount() - 1); for (int i = _watermarks->topLevelItemCount(); i < numCopies; i++) { QString watermark = _watermarkMetric.isEmpty() ? "" : _x_metrics->value(QString("%1%2").arg(_watermarkMetric).arg(i)); QString showprice; if (_showPriceMetric.isEmpty() || _x_metrics->boolean(QString("%1%2").arg(_showPriceMetric).arg(i)) || _x_metrics->value(QString("%1%2").arg(_showPriceMetric).arg(i)).isEmpty()) showprice = yesStr; else showprice = noStr; new XTreeWidgetItem(_watermarks, _watermarks->topLevelItem(_watermarks->topLevelItemCount() - 1), i, i, tr("Copy #%1").arg(i + 1), watermark, showprice); } } void XDocCopySetter::setNumCopiesMetric(const QString metric) { _numCopiesMetric = metric; // _numCopies->setValue cascades to setNumCopies if (! _numCopiesMetric.isEmpty() && _x_metrics) _numOfCopies->setValue(_x_metrics->value(metric).toInt()); } void XDocCopySetter::setShowPriceMetric(const QString metric) { _showPriceMetric = metric; if (! _showPriceMetric.isEmpty() && _x_metrics) { for (int i = 0; i < _watermarks->topLevelItemCount(); i++) { QString fullmetric = QString("%1%2").arg(metric).arg(i); if (_x_metrics->value(fullmetric).isEmpty() || _x_metrics->boolean(fullmetric)) _watermarks->topLevelItem(i)->setText(2, yesStr); else _watermarks->topLevelItem(i)->setText(2, noStr); } } } void XDocCopySetter::setWatermarkMetric(const QString metric) { _watermarkMetric = metric; if (! _watermarkMetric.isEmpty() && _x_metrics) { for (int i = 0; i < _watermarks->topLevelItemCount(); i++) { QString fullmetric = QString("%1%2").arg(metric).arg(i); if (! _x_metrics->value(fullmetric).isEmpty()) _watermarks->topLevelItem(i)->setText(1, _x_metrics->value(fullmetric)); } } } void XDocCopySetter::sEditWatermark() { QTreeWidgetItem *cursor = _watermarks->currentItem(); ParameterList params; params.append("watermark", cursor->text(1)); params.append("showPrices", (cursor->text(2) == yesStr)); EditWatermark newdlg(this); newdlg.set(params); if (newdlg.exec() == QDialog::Accepted) { cursor->setText(1, newdlg.watermark()); cursor->setText(2, ((newdlg.showPrices()) ? yesStr : noStr)); } } // scripting exposure ///////////////////////////////////////////////////////// QScriptValue XDocCopySettertoScriptValue(QScriptEngine *engine, XDocCopySetter* const &item) { return engine->newQObject(item); } void XDocCopySetterfromScriptValue(const QScriptValue &obj, XDocCopySetter* &item) { item = qobject_cast(obj.toQObject()); } QScriptValue constructXDocCopySetter(QScriptContext *context, QScriptEngine *engine) { QWidget *parent = (qscriptvalue_cast(context->argument(0))); const char *objname = "_xDocCopySetter"; if (context->argumentCount() > 1) objname = context->argument(1).toString().toAscii().data(); return engine->toScriptValue(new XDocCopySetter(parent, objname)); } void setupXDocCopySetter(QScriptEngine *engine) { QScriptValue::PropertyFlags stdflags = QScriptValue::ReadOnly | QScriptValue::Undeletable; qScriptRegisterMetaType(engine, XDocCopySettertoScriptValue, XDocCopySetterfromScriptValue); QScriptValue constructor = engine->newFunction(constructXDocCopySetter); engine->globalObject().setProperty("XDocCopySetter", constructor, stdflags); //constructor.setProperty("ChangeFuture", QScriptValue(engine, XDocCopySetter::ChangeFuture), stdflags); } qt-client-4.1.0/widgets/xdoccopysetter.h000066400000000000000000000041101217451700100203040ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XDOCCOPYSETTER_H #define XDOCCOPYSETTER_H #include "ui_xdoccopysetter.h" class QScriptEngine; void setupXDocCopySetter(QScriptEngine *engine); class XDocCopySetter : public QWidget, public Ui::XDocCopySetter { Q_OBJECT Q_PROPERTY(QString labelText READ labelText WRITE setLabelText) Q_PROPERTY(QString numCopiesMetric READ numCopiesMetric WRITE setNumCopiesMetric) Q_PROPERTY(QString showPriceMetric READ showPriceMetric WRITE setShowPriceMetric) Q_PROPERTY(QString watermarkMetric READ watermarkMetric WRITE setWatermarkMetric) public: XDocCopySetter(QWidget* parent = 0, const char* name = 0); ~XDocCopySetter(); virtual QString labelText() const; Q_INVOKABLE virtual int numCopies() const; virtual QString numCopiesMetric() const; Q_INVOKABLE virtual bool showCosts(const int row) const; virtual QString showPriceMetric() const; virtual QString watermarkMetric() const; Q_INVOKABLE virtual QString watermark(const int row) const; public slots: virtual bool save(); virtual void setLabelText(const QString text); virtual void setNumCopies(const int numCopies); virtual void setNumCopiesMetric(const QString metric); virtual void setShowPriceMetric(const QString metric); virtual void setWatermarkMetric(const QString metric); protected slots: virtual void languageChange(); virtual void sEditWatermark(); protected: QString _numCopiesMetric; QString _showPriceMetric; QString _watermarkMetric; private: }; Q_DECLARE_METATYPE(XDocCopySetter*) #endif // XDOCCOPYSETTER_H qt-client-4.1.0/widgets/xdoccopysetter.ui000066400000000000000000000056731217451700100205110ustar00rootroot00000000000000 This file is part of the xTuple ERP: PostBooks Edition, a free and open source Enterprise Resource Planning software suite, Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. It is licensed to you under the Common Public Attribution License version 1.0, the full text of which (including xTuple-specific Exhibits) is available at www.xtuple.com/CPAL. By using this software, you agree to be bound by its terms. XDocCopySetter 0 0 400 300 Configure Document Copies 0 0 Copies # of Copies: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter true 0 9 0 Qt::Horizontal QSizePolicy::Expanding 16 10 XTreeWidget QTreeWidget
    xtreewidget.h
    1
    qt-client-4.1.0/widgets/xdoublevalidator.cpp000066400000000000000000000015711217451700100211400ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xdoublevalidator.h" XDoubleValidator::XDoubleValidator(QObject * parent) : QDoubleValidator(parent) { } XDoubleValidator::XDoubleValidator(double bottom, double top, int decimals, QObject * parent) : QDoubleValidator(bottom, top, decimals, parent) { } QValidator::State XDoubleValidator::validate(QString &input , int &pos) const { input.remove(locale().groupSeparator()); return QDoubleValidator::validate(input, pos); } qt-client-4.1.0/widgets/xdoublevalidator.h000066400000000000000000000014361217451700100206050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XDOUBLEVALIDATOR_H__ #define __XDOUBLEVALIDATOR_H__ #include class XDoubleValidator: public QDoubleValidator { Q_OBJECT public: XDoubleValidator(QObject * parent); XDoubleValidator(double bottom, double top, int decimals, QObject * parent); QValidator::State validate(QString &, int &) const; }; #endif qt-client-4.1.0/widgets/xitemdelegate.cpp000066400000000000000000000023351217451700100204100ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xitemdelegate.h" #include #include #include #include #include #include #include "datecluster.h" #include "xsqltablemodel.h" #define DEBUG true XItemDelegate::XItemDelegate(QObject *parent) : QItemDelegate(parent) { QItemEditorFactory *editorfactory = new QItemEditorFactory(); if (editorfactory) { editorfactory->registerEditor(QVariant::Date, new QStandardItemEditorCreator()); setItemEditorFactory(editorfactory); editorfactory->registerEditor(QVariant::Bool, new QStandardItemEditorCreator()); setItemEditorFactory(editorfactory); } } XItemDelegate::~XItemDelegate() { } qt-client-4.1.0/widgets/xitemdelegate.h000066400000000000000000000012471217451700100200560ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef _XITEMDELEGATE_H_ #define _XITEMDELEGATE_H_ #include class QWidget; class XItemDelegate : public QItemDelegate { Q_OBJECT public: XItemDelegate(QObject *parent = 0); ~XItemDelegate(); }; #endif qt-client-4.1.0/widgets/xlabel.cpp000066400000000000000000000076101217451700100170370ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xlabel.h" #include #include #include #include #include "format.h" #include #include "xsqlquery.h" #define DEBUG false class XLabelPrivate { public: XLabelPrivate(XLabel *parent) : _precision(0) { Q_UNUSED(parent); } QString _image; QString _fieldName; int _precision; }; XLabel::XLabel(QWidget *parent, const char *name) : QLabel(parent) { if(name) setObjectName(name); _data = new XLabelPrivate(this); } QString XLabel::fieldName() const { return _data->_fieldName; } QString XLabel::image() const { return _data->_image; } int XLabel::precision() const { return _data->_precision; } XLabel::~XLabel() { if (_data) { delete _data; _data = 0; } } void XLabel::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(this, _data->_fieldName, QByteArray("text"), QByteArray("defaultText")); } void XLabel::setPrecision(int pPrec) { _data->_precision = pPrec; } void XLabel::setDouble(const double pDouble, const int pPrec) { QLabel::setText(formatNumber(pDouble, (pPrec < 0) ? _data->_precision : pPrec)); } void XLabel::setFieldName(QString p) { _data->_fieldName = p; } void XLabel::setImage(QString image) { if (_data->_image == image) return; _data->_image = image; XSqlQuery qry; qry.prepare("SELECT image_data " "FROM image " "WHERE (image_name=:image);"); qry.bindValue(":image", _data->_image); qry.exec(); if (qry.first()) { QImage img; img.loadFromData(QUUDecode(qry.value("image_data").toString())); setPixmap(QPixmap::fromImage(img)); return; } else if (qry.lastError().type() != QSqlError::NoError) QMessageBox::critical(this, tr("A System Error occurred at %1::%2.") .arg(__FILE__) .arg(__LINE__), qry.lastError().databaseText()); setPixmap(QPixmap()); } void XLabel::setPrecision(QValidator *pVal) { if (qobject_cast(pVal)) _data->_precision = (qobject_cast(pVal))->decimals(); else if (qobject_cast(pVal)) _data->_precision = 0; else qWarning("XLabel %s::setPrecision called with unexpected validator", qPrintable(objectName())); } void XLabel::setText(const QVariant &pVariant) { if (DEBUG) qDebug("XLabel::setText(const QVariant & = %s)", qPrintable(pVariant.toString())); if (pVariant.type() == QVariant::Double || pVariant.type() == QVariant::Int) QLabel::setText(formatNumber(pVariant.toDouble(), _data->_precision)); else QLabel::setText(pVariant.toString()); } void XLabel::setText(const char *pText) { if (DEBUG) qDebug("XLabel::setText(const char * = %s)", pText); setText(QString(pText)); } void XLabel::setText(const QString &pText) { if (DEBUG) qDebug("XLabel::setText(const QString & = %s)", qPrintable(pText)); if (_data->_precision == 0) QLabel::setText(pText); else { bool ok; double val = QLocale().toDouble(pText, &ok); if (DEBUG) qDebug("XLabel::setText() %f %d", val, ok); if (ok) setDouble(val); else QLabel::setText(pText); } } double XLabel::toDouble(bool *pIsValid) { return QLocale().toDouble(text(), pIsValid); } void XLabel::setTextColor(const QString &pColorName) { QColor c = namedColor(pColorName); QPalette p = palette(); p.setColor(foregroundRole(), c); setPalette(p); } qt-client-4.1.0/widgets/xlabel.h000066400000000000000000000033011217451700100164750ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef xlabel_h #define xlabel_h #include #include "widgets.h" #include "xdatawidgetmapper.h" class QValidator; class QVariant; class XLabelPrivate; class XTUPLEWIDGETS_EXPORT XLabel : public QLabel { Q_OBJECT Q_PROPERTY(QString image READ image WRITE setImage) Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) Q_PROPERTY(int precision READ precision WRITE setPrecision) public: XLabel(QWidget *, const char * = 0); virtual ~XLabel(); virtual QString fieldName() const; virtual QString image() const; virtual int precision() const; Q_INVOKABLE virtual void setPrecision(QValidator *pval); virtual void setPrecision(int p); Q_INVOKABLE virtual double toDouble(bool *pIsValid = 0); public slots: virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setDouble(const double, const int = -1); virtual void setFieldName(QString p); virtual void setImage(QString image); virtual void setText(const QString &); virtual void setText(const char *); virtual void setText(const QVariant &); virtual void setTextColor(const QString &); private: XLabelPrivate *_data; }; #endif qt-client-4.1.0/widgets/xlineedit.cpp000066400000000000000000000136601217451700100175570ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xlineedit.h" #include #include #include #include #include #include "format.h" #define DEBUG false XLineEdit::XLineEdit(QWidget *parent, const char *name) : QLineEdit(parent) { if (! name && objectName().isEmpty()) setObjectName("XLineEdit"); setAcceptDrops(FALSE); #ifdef Q_WS_MAC QFont f = font(); f.setPointSize(f.pointSize() - 2); setFont(f); #endif _parsed = true; _valid = false; _isNull = true; _id = -1; connect(this, SIGNAL(editingFinished()), this, SLOT(sParse())); _listAct = new QAction(tr("List..."), this); _listAct->setShortcut(QKeySequence(tr("Ctrl+Shift+L"))); _listAct->setShortcutContext(Qt::WidgetShortcut); _listAct->setToolTip(tr("List all records")); connect(_listAct, SIGNAL(triggered()), this, SIGNAL(requestList())); addAction(_listAct); _searchAct = new QAction(tr("Search..."), this); _searchAct->setShortcut(QKeySequence(tr("Ctrl+Shift+Space"))); _searchAct->setShortcutContext(Qt::WidgetShortcut); _searchAct->setToolTip(tr("Search on specific criteria")); connect(_searchAct, SIGNAL(triggered()), this, SIGNAL(requestSearch())); addAction(_searchAct); _aliasAct = new QAction(tr("Alias..."), this); _aliasAct->setShortcut(QKeySequence(tr("Ctrl+Shift+A"))); _aliasAct->setShortcutContext(Qt::WidgetShortcut); _aliasAct->setToolTip(tr("List of alias records")); connect(_aliasAct, SIGNAL(triggered()), this, SIGNAL(requestAlias())); addAction(_aliasAct); _mapper = new XDataWidgetMapper(this); } bool XLineEdit::isValid() { sParse(); return _valid; } int XLineEdit::id() { sParse(); return _id; } void XLineEdit::sParse() { if (validator() && validator()->inherits("QDoubleValidator")) { QRegExp zeroRegex(QString("^[0") + QLocale().groupSeparator() + "]*" + QLocale().decimalPoint() + "0*$"); if (! text().isEmpty() && toDouble() == 0 && ! text().contains(zeroRegex)) { _valid = false; setText(""); } else _valid = true; } if (DEBUG) qDebug("%s::sParse() _valid = %d", objectName().isEmpty() ? "XLineEdit" : qPrintable(objectName()), _valid); } double XLineEdit::toDouble(bool *pIsValid) { QString strippedText = text().remove(QLocale().groupSeparator()); double result = QLocale().toDouble(strippedText, pIsValid); _valid = pIsValid; if (DEBUG) qDebug("%s::toDouble() returning %f (%d) for %s (%s)", objectName().isEmpty() ? "XLineEdit" : qPrintable(objectName()), result, _valid, qPrintable(text()), qPrintable(strippedText)); return result; } void XLineEdit::setDataWidgetMap(XDataWidgetMapper* m) { _mapper=m; m->addMapping(this, _fieldName, QByteArray("text"), QByteArray("defaultText")); connect(this, SIGNAL(editingFinished()), this, SLOT(setData())); } void XLineEdit::setText(const QVariant &pVariant) { if (pVariant.type() == QVariant::Double) { const QValidator *v = validator(); int prec = 0; if (v && v->inherits("QDoubleValidator")) prec = ((QDoubleValidator*)v)->decimals(); else if (v && v->inherits("QIntValidator")) prec = 0; QLineEdit::setText(formatNumber(pVariant.toDouble(), prec)); } else QLineEdit::setText(pVariant.toString()); sHandleNullStr(); } void XLineEdit::setDouble(const double pDouble, const int pPrec) { const QValidator *v = validator(); int prec = pPrec; if (pPrec < 0 && v && v->inherits("QDoubleValidator")) prec = ((QDoubleValidator*)v)->decimals(); QLineEdit::setText(formatNumber(pDouble, prec)); } void XLineEdit::mouseDoubleClickEvent(QMouseEvent *event) { emit doubleClicked(); QLineEdit::mouseDoubleClickEvent(event); } void XLineEdit::mousePressEvent(QMouseEvent *event) { emit clicked(); QLineEdit::mousePressEvent(event); } void XLineEdit::keyPressEvent(QKeyEvent *event) { _parsed = false; QLineEdit::keyPressEvent(event); } void XLineEdit::setData() { setData(text()); } void XLineEdit::setData(const QString &text) { if (_mapper->model()) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(),_mapper->mappedSection(this)), text); } void XLineEdit::setNullStr(const QString &text) { if (_nullStr == text ) return; _nullStr = text; sHandleNullStr(); if (!_nullStr.isEmpty()) connect(this, SIGNAL(textChanged(QString)), this, SLOT(sHandleNullStr())); } void XLineEdit::sHandleNullStr() { if (_nullStr.isEmpty()) return; QString sheet = styleSheet(); QString nullStyle = " QLineEdit{ color: Grey; " " font: italic; " " font-size: 12px}"; if (!hasFocus() && text().isEmpty()) { setText(_nullStr); sheet.append(nullStyle); _isNull = true; } else if (hasFocus() && sheet.contains(nullStyle)) { clear(); sheet.remove(nullStyle); } else { _isNull = false; sheet.remove(nullStyle); } setStyleSheet(sheet); } void XLineEdit::focusInEvent(QFocusEvent * event) { if (!_nullStr.isEmpty()) { disconnect(this, SIGNAL(textChanged(QString)), this, SLOT(sHandleNullStr())); sHandleNullStr(); } QLineEdit::focusInEvent(event); } void XLineEdit::focusOutEvent(QFocusEvent * event) { if (!_nullStr.isEmpty()) { connect(this, SIGNAL(textChanged(QString)), this, SLOT(sHandleNullStr())); sHandleNullStr(); } QLineEdit::focusOutEvent(event); } bool XLineEdit::isNull() { if (_nullStr.isEmpty() || hasFocus()) return text().isEmpty(); return _isNull; } qt-client-4.1.0/widgets/xlineedit.h000066400000000000000000000050111217451700100172130ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef xlineedit_h #define xlineedit_h #include #include #include #include #include #include "widgets.h" #include "xdatawidgetmapper.h" class XTUPLEWIDGETS_EXPORT XLineEdit : public QLineEdit { Q_OBJECT Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) Q_PROPERTY(QString defaultText READ defaultText WRITE setDefaultText) public: XLineEdit(QWidget *, const char * = 0); Q_INVOKABLE bool isValid(); Q_INVOKABLE int id(); Q_INVOKABLE void setValidator(QValidator * v) { QLineEdit::setValidator(v); } Q_INVOKABLE double toDouble(bool * = 0); virtual QString defaultText() const { return _default; } virtual QString fieldName() const { return _fieldName; } virtual void setText(const QVariant &); Q_INVOKABLE virtual void setDouble(const double, const int = -1); Q_INVOKABLE inline virtual QString nullStr() const { return _nullStr; } Q_INVOKABLE virtual void setNullStr(const QString &text); Q_INVOKABLE bool isNull(); public slots: virtual void sParse(); virtual void setData(); virtual void setData(const QString &text); virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setDefaultText(QString p) { _default = p; } virtual void setFieldName(QString p) { _fieldName = p; } signals: void clicked(); void doubleClicked(); void requestList(); void requestSearch(); void requestInfo(); void requestAlias(); protected slots: virtual void sHandleNullStr(); protected: int _id; bool _valid; bool _parsed; QString _nullStr; QAction* _listAct; QAction* _searchAct; QAction* _aliasAct; virtual void focusInEvent(QFocusEvent * event); virtual void focusOutEvent(QFocusEvent * event); void mouseDoubleClickEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *); void keyPressEvent(QKeyEvent *); private: bool _isNull; QString _default; QString _fieldName; XDataWidgetMapper *_mapper; }; #endif qt-client-4.1.0/widgets/xlistbox.cpp000066400000000000000000000023731217451700100174450ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xlistbox.h" XListBoxText::XListBoxText(QListWidget* listbox, const QString &text, int id) : QListWidgetItem(text, listbox) { _id = id; } XListBoxText::XListBoxText(const QString & text, int id) : QListWidgetItem(text) { _id = id; } XListBoxText::XListBoxText(QListWidget* listbox, const QString &text, QListWidgetItem *after) : QListWidgetItem(text, listbox) { _id = -1; listbox->insertItem(listbox->row(after) + 1, this); } XListBoxText::XListBoxText(QListWidget* listbox, const QString & text, int id, QListWidgetItem *after) : QListWidgetItem(text, listbox) { _id = id; listbox->insertItem(listbox->row(after) + 1, this); } XListBoxText::~XListBoxText() { } void XListBoxText::setId(int id) { _id = id; } int XListBoxText::RTTI = 8152005; int XListBoxText::rtti() const { return RTTI; } qt-client-4.1.0/widgets/xlistbox.h000066400000000000000000000020711217451700100171050ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XLISTBOX_H__ #define __XLISTBOX_H__ #include class XListBoxText : public QListWidgetItem { public: XListBoxText(QListWidget* listbox, const QString & text=QString::null, int id=-1); XListBoxText(const QString & text=QString::null, int id=-1); XListBoxText(QListWidget* listbox, const QString & text, QListWidgetItem *after); XListBoxText(QListWidget* listbox, const QString & text, int id, QListWidgetItem *after); virtual ~XListBoxText(); void setId(int id); int id() const { return _id; } virtual int rtti() const; static int RTTI; private: int _id; }; #endif qt-client-4.1.0/widgets/xspinbox.cpp000066400000000000000000000012151217451700100174350ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xspinbox.h" XSpinBox::XSpinBox(QWidget *pParent) : QSpinBox(pParent) { } void XSpinBox::setDataWidgetMap(XDataWidgetMapper* m) { m->addMapping(this, _fieldName, "value", "defaultValue"); } qt-client-4.1.0/widgets/xspinbox.h000066400000000000000000000023021217451700100171000ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XSPINBOX_H__ #define __XSPINBOX_H__ #include #include "widgets.h" #include "xdatawidgetmapper.h" class XTUPLEWIDGETS_EXPORT XSpinBox : public QSpinBox { Q_OBJECT Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) Q_PROPERTY(QString defaultValue READ defaultValue WRITE setDefaultValue) public: XSpinBox(QWidget * = 0); virtual QString defaultValue() const { return _default; }; virtual QString fieldName() const { return _fieldName; }; public slots: virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setDefaultValue(QString p) { _default = p; }; virtual void setFieldName(QString p) { _fieldName = p; }; private: QString _default; QString _fieldName;}; #endif qt-client-4.1.0/widgets/xsqltablemodel.cpp000066400000000000000000000363451217451700100206170ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include #include #include #include #include "format.h" #include "xsqlquery.h" #include "xsqltablemodel.h" #define DEBUG false XSqlTableNode::XSqlTableNode(const QString tableName, ParameterList relations, XSqlTableNode *parent) : QObject(parent) { _tableName = tableName; _relations = relations; _parent = parent; } XSqlTableNode::~XSqlTableNode() { qDeleteAll(_children); } int XSqlTableNode::index() const { if (_parent) return _parent->children().indexOf(const_cast(this)); return 0; } XSqlTableNode* XSqlTableNode::appendChild(const QString &tableName, ParameterList &relations) { XSqlTableNode* child = new XSqlTableNode(tableName, relations, this); appendChild(child); return child; } XSqlTableNode* XSqlTableNode::child(const QString &tableName) { for (int i = 0; i < _children.count(); i++) { if (_children.at(i)->tableName() == tableName) return _children.at(i); } return 0; } XSqlTableModel* XSqlTableNode::model(XSqlTableModel* parent, int row) { QPair key; key.first = parent; key.second = row; return _modelMap.value(key); } /*! Clears the model map of the current node and recursively clears all child nodes */ void XSqlTableNode::clear() { for (int n = 0; n < _children.count(); n++) { _children.at(n)->clear(); _modelMap.clear(); } } void XSqlTableNode::load(QPair key) { XSqlTableModel* pmodel = key.first; int row = key.second; // Loop through each node and create a model parent model/row passed for (int n = 0; n < _children.count(); n++) { XSqlTableNode* node = _children.at(n); XSqlTableModel* cmodel = new XSqlTableModel(); cmodel->setTable(_tableName); ParameterList cparams = XSqlTableModel::buildParams(pmodel, row, _relations); cmodel->setFilter(XSqlTableModel::buildFilter(cparams)); cmodel->select(); node->modelMap().insert(key, cmodel); // Cascade recursively QPair ckey; ckey.first = cmodel; for (int r = 0; r < cmodel->rowCount(); r++) { key.second = r; node->load(ckey); } } } /* Saves the current model to the database*/ bool XSqlTableNode::save() { // Submit all models on this node QMapIterator, XSqlTableModel* > i(_modelMap); while (i.hasNext()) { i.next(); if (!i.value()->submitAll()) return false; } // Save child nodes for (int n = 0; n < _children.count(); n++) { if (!_children.at(n)->save()) return false; } return true; } //////////////////////////////////////// XSqlTableModel::XSqlTableModel(QObject *parent) : QSqlRelationalTableModel(parent) { _locales << "money" << "qty" << "curr" << "percent" << "cost" << "qtyper" << "salesprice" << "purchprice" << "uomratio" << "extprice" << "weight"; } XSqlTableModel::~XSqlTableModel() { qDeleteAll(_children); } bool XSqlTableModel::select() { if (DEBUG) qDebug("selecting "); bool result; result = QSqlRelationalTableModel::select(); applyColumnRoles(); if (result && rowCount()) emit dataChanged(index(0,0),index(rowCount()-1,columnCount()-1)); return result; } void XSqlTableModel::clear() { clearChildren(); QSqlRelationalTableModel::clear(); } void XSqlTableModel::applyColumnRole(int column, int role, QVariant value) { QSqlQuery qry = query(); // Apply to the model qry.first(); for (int row=0; row < qry.size(); ++row) { setData(index(row,column), value, role); qry.next(); } } void XSqlTableModel::applyColumnRoles() { QHashIterator > i(_columnRoles); while (i.hasNext()) { applyColumnRole(i.key(), i.value().second, i.value().first ); i.next(); } } void XSqlTableModel::applyColumnRoles(int row) { QHashIterator > i(_columnRoles); while (i.hasNext()) { setData(index(row,i.key()), i.value().first, i.value().second); i.next(); } } void XSqlTableModel::setColumnRole(int column, int role, const QVariant value) { QPair values; bool found = false; // Remove any previous value for this column/role pair QMultiHash >::iterator i = _columnRoles.find(column); while (i != _columnRoles.end() && i.key() == column && !found) { if (i.value().second == role) { values.first = i.value().first; values.second = i.value().second; _columnRoles.remove(column, values); found = true; break; } ++i; } // Insert new values.first = value; values.second = role; _columnRoles.insert(column, values); // Apply applyColumnRole(column, role, value); } void XSqlTableModel::setTable(const QString &tableName, int keyColumns) { QSqlRelationalTableModel::setTable(tableName); setKeys(keyColumns); } void XSqlTableModel::setKeys(int keyColumns) { if (keyColumns && tableName().length()) { QSqlRecord rec = database().record(tableName()); QSqlIndex idx(tableName()); for (int i = 0; i < keyColumns; i++) idx.append(rec.field(i)); idx.setName(tableName() + "_pkey"); QSqlRelationalTableModel::setPrimaryKey(idx); } } /* qAppendWhereClause() and XSqlTableModel::selectStatement() have been copied from qt-mac-commercial-src-4.4.3/src/sql/models/qsqlrelationaltablemodel.cpp and hacked to work around Qt bug 171541: It would be useful if the QRelationalSqlTableModel would display rows with unresolvavble foreign keys http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id=171541 Unfortunately the original Qt code is full of references to private data structures, so this really is a hack. */ static void qAppendWhereClause(QString &query, const QString &clause1, const QString &clause2) { if (clause1.isEmpty() && clause2.isEmpty()) return; if (clause1.isEmpty() || clause2.isEmpty()) query.append(QLatin1String(" WHERE (")).append(clause1).append(clause2); else query.append(QLatin1String(" WHERE (")).append(clause1).append( QLatin1String(") AND (")).append(clause2); query.append(QLatin1String(") ")); } QString XSqlTableModel::selectStatement() const { QString query; if (tableName().isEmpty()) return query; QString tList; QString fList; QString where; QSqlRecord rec = record(); QStringList tables; // Count how many times each field name occurs in the record int fkeycount = 0; QHash fieldNames; for (int i = 0; i < rec.count(); ++i) { QSqlRelation rel = relation(i); QString name; if (rel.isValid()) { // Count the display column name, not the original foreign key name = rel.displayColumn(); fkeycount++; } else name = rec.fieldName(i); fieldNames.insert(name, fieldNames.value(name, 0) + 1); } if (fkeycount == 0) return QSqlRelationalTableModel::selectStatement(); for (int i = 0; i < rec.count(); ++i) { QSqlRelation rel = relation(i); if (rel.isValid()) { QString relTableAlias = QString::fromLatin1("%1_%2") .arg(rel.tableName()).arg(i); fList.append(relTableAlias + "." + rel.displayColumn()); // If there are duplicate field names they must be aliased if (fieldNames.value(rel.displayColumn()) > 1) fList.append(QString::fromLatin1(" AS %1_%2") .arg(relTableAlias) .arg(rel.displayColumn())); fList.append(QLatin1Char(',')); if (!tables.contains(rel.tableName())) tables.append(QString(" LEFT OUTER JOIN %1 %2 ON (%3.%4 = %5.%6) ") .arg(rel.tableName()) .arg(relTableAlias) .arg(tableName()) .arg(rec.fieldName(i)) .arg(relTableAlias) .arg(rel.indexColumn())); } else { fList.append(tableName() + "." + rec.fieldName(i)); fList.append(QLatin1Char(',')); } } if (!tables.isEmpty()) tList.append(tables.join(QLatin1String(" "))).append(QLatin1String(" ")); if (fList.isEmpty()) return query; tList.prepend(QLatin1Char(' ')).prepend(database().driver()->escapeIdentifier(tableName(), QSqlDriver::TableName)); // truncate tailing comma tList.chop(1); fList.chop(1); query.append(QLatin1String("SELECT ")); query.append(fList).append(QLatin1String(" FROM ")).append(tList); if (!where.isEmpty()) where.chop(5); qAppendWhereClause(query, where, filter()); QString orderBy = orderByClause(); if (!orderBy.isEmpty()) query.append(QLatin1Char(' ')).append(orderBy); return query; } QVariant XSqlTableModel::data(const QModelIndex &index, int role) const { if (!index.isValid()) return QVariant(); switch (role) { case Qt::DisplayRole: { QVariant value = QSqlRelationalTableModel::data(index, Qt::DisplayRole); QVariant formatRole = data(index, FormatRole); if (formatRole.isValid()) return formatValue(value, formatRole); else if (value.type() == QVariant::Bool) return value.toBool() ? tr("Yes") : tr("No"); else return value; } break; case Qt::EditRole: { return QSqlRelationalTableModel::data(index); } break; case Qt::TextAlignmentRole: case Qt::ForegroundRole: case FormatRole: case EditorRole: case MenuRole: QPair key; key.first = index; key.second = role; if (roles.contains(key)) return roles.value(key); } return QVariant(); } bool XSqlTableModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (!index.isValid()) return false; switch (role) { case Qt::DisplayRole: case Qt::EditRole: { if (data(index, FormatRole).isValid()) QSqlRelationalTableModel::setData(index, formatValue(value, data(index, FormatRole)), role); else QSqlRelationalTableModel::setData(index, value, role); } break; case FormatRole: { QSqlRelationalTableModel::setData(index, formatValue(data(index), value)); } case Qt::TextAlignmentRole: case Qt::ForegroundRole: case EditorRole: case MenuRole: QPair key; key.first = index; key.second = role; if (roles.contains(key)) { if (roles.value(key) == value) return true; } roles.insert(key, value); emit dataChanged ( index, index ); } return true; } QVariant XSqlTableModel::formatValue(const QVariant &value, const QVariant &format) const { int scale = decimalPlaces(_locales.at(format.toInt())); double fval = value.toDouble(); if (format.toInt() == Percent) fval = fval * 100; return QVariant(QLocale().toString(fval, 'f', scale)); } /* tree stuff */ XSqlTableNode* XSqlTableModel::appendChild(const QString &tableName, ParameterList &relations) { XSqlTableNode* child = new XSqlTableNode(tableName, relations); appendChild(child); return child; } XSqlTableNode* XSqlTableModel::child(const QString &tableName) { for (int i = 0; i < _children.count(); i++) { if (_children.at(i)->tableName() == tableName) return _children.at(i); } return 0; } QString XSqlTableModel::buildFilter(ParameterList ¶ms) { QStringList clauses; for (int i = 0; i < params.count(); i++) { QString clause = QString(" (%1=%2) ").arg(params.at(i).name(), "%1"); QVariant::Type type = params.at(i).value().type(); switch (type) { case QVariant::Bool: if (params.at(i).value().toBool()) clauses.append(QString(" (%1) ").arg(params.at(i).name())); else clauses.append(QString(" (NOT %1) ").arg(params.at(i).name())); break; case QVariant::Date: clauses.append(clause.arg(params.at(i).value().toDate().toString(Qt::ISODate))); break; case QVariant::Int: case QVariant::Double: clauses.append(clause.arg(params.at(i).value().toDouble())); break; default: clauses.append(clause.arg(params.at(i).value().toString().prepend("'").append("'"))); } } return clauses.join(" AND "); } ParameterList XSqlTableModel::buildParams(XSqlTableModel* parent, int row, ParameterList relations) { ParameterList params; // Name = local column, Value parent column // Get the value of the parent for the specified row for (int i = 0; i < relations.count(); i++) { if (parent->query().seek(row)) { QSqlRecord record = parent->record(row); QString name = relations.at(i).name(); QVariant value = record.value(relations.at(i).value().toString()); params.append(name, value); } } return params; } void XSqlTableModel::clearChildren() { for (int i = 0; i < _children.count(); i++) _children.at(i)->clear(); } void XSqlTableModel::loadAll() { qDebug("filter: %s", qPrintable(buildFilter(_params))); setFilter(buildFilter(_params)); if (!query().isActive()) select(); // Reset all nodes for (int n = 0; n < _children.count(); n++) { qDebug("clearing node %d", n); XSqlTableNode* node = _children.at(n); QList mlist; node->clear(); } // Loop through and reload models for each row for (int r = 0; r < rowCount(); r++) { qDebug("Loading row %d", r); load(r); } } void XSqlTableModel::load(int row) { // Loop through each node to create models for (int n = 0; n < _children.count(); n++) { qDebug("loading child node %d", n); XSqlTableNode* node = _children.at(n); QPair key; key.first = this; key.second = row; // Generate child model for the row passed XSqlTableModel* model = new XSqlTableModel(this); qDebug("Setting table %s", qPrintable(node->tableName())); model->setTable(node->tableName()); ParameterList params = buildParams(this, row, node->relations()); qDebug("Filter is %s", qPrintable(buildFilter(params))); model->setFilter(buildFilter(params)); model->select(); node->modelMap().insert(key, model); // Cascade recursively key.first = model; for (int r = 0; r < model->rowCount(); r++) { key.second = r; node->load(key); } } } /*! Saves the current model and all of it's child node models to the database where a\ transact wraps all submissions in a database transaction. */ bool XSqlTableModel::save() { XSqlQuery trans; trans.exec("BEGIN"); if (submitAll()) { for ( int i = 0; i < _children.count(); i++ ) { if (!_children.at(i)->save()) { trans.exec("ROLLBACK"); return false; } } } else { trans.exec("ROLLBACK"); return false; } trans.exec("COMMIT"); return true; } qt-client-4.1.0/widgets/xsqltablemodel.h000066400000000000000000000102051217451700100202470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XSQLTABLEMODEL_H #define XSQLTABLEMODEL_H #include #include #include "widgets.h" class XSqlTableModel; class XTUPLEWIDGETS_EXPORT XSqlTableNode : public QObject { public: XSqlTableNode(const QString tableName, ParameterList relations, XSqlTableNode *parent = 0); ~XSqlTableNode(); int index() const; int count() const { return _children.count(); } void appendChild(XSqlTableNode *child) { _children.append(child); } void removeChild(int index) { _children.removeAt(index); } XSqlTableNode* appendChild(const QString &tableName, ParameterList &relations); QMap, XSqlTableModel* > modelMap() { return _modelMap; } QString tableName() const { return _tableName; } QList children() const { return _children; } ParameterList relations() const { return _relations; } XSqlTableNode* child(int index) { return _children.at(index); } XSqlTableNode* child(const QString &tableName); XSqlTableNode* parent() const { return _parent; } XSqlTableModel* model(XSqlTableModel* parent = 0, int row = 0); void clear(); void load(QPair key); bool save(); private: ParameterList _relations; QMap, XSqlTableModel* >_modelMap; QList _children; QString _filter; QString _tableName; XSqlTableNode *_parent; }; class XTUPLEWIDGETS_EXPORT XSqlTableModel : public QSqlRelationalTableModel { Q_OBJECT public: XSqlTableModel(QObject *parent = 0); ~XSqlTableModel(); enum itemDataRole { FormatRole = (Qt::UserRole + 1), EditorRole, MenuRole, /* Other roles for xtreewidget? RawRole, IdRole, RunningSetRole, RunningInitRole, TotalSetRole, TotalInitRole, IndentRole */ }; enum FormatFlags { Money, Qty, Curr, Percent, Cost, QtyPer, SalesPrice, PurchPrice, UOMRatio, ExtPrice, Weight }; void applyColumnRole(int column, int role, QVariant value); void applyColumnRoles(); void applyColumnRoles(int row); void clear(); void setColumnRole(int column, int role, QVariant value); QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QVariant formatValue(const QVariant &dataValue, const QVariant &formatValue) const; bool select(); bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); void setTable(const QString &tableName, int keyColumns = 0); void setKeys(int keyColumns); virtual QString selectStatement() const; // Table node functions static::QString buildFilter(ParameterList ¶ms); static::ParameterList buildParams(XSqlTableModel* parent, int row, ParameterList relations); int nodeCount() const { return _children.count(); } void appendChild(XSqlTableNode *child) { _children.append(child); } void clearChildren(); void removeChild(int index) { _children.removeAt(index); } XSqlTableNode* appendChild(const QString &tableName, ParameterList &relations); QList children() { return _children; } XSqlTableNode* child(int index) { return _children.at(index); } XSqlTableNode* child(const QString &tableName); void set(ParameterList params) { _params = params; } ParameterList parameters() { return _params; } void load(int row); void loadAll(); bool save(); private: QHash, QVariant> roles; QMultiHash > _columnRoles; QList _locales; QList _children; ParameterList _params; }; #endif qt-client-4.1.0/widgets/xt.cpp000066400000000000000000000064211217451700100162220ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xt.h" void setupXt(QScriptEngine *engine) { QScriptValue glob = engine->newObject(); glob.setProperty("RawRole", QScriptValue(engine, Xt::RawRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("ScaleRole", QScriptValue(engine, Xt::ScaleRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("IdRole", QScriptValue(engine, Xt::IdRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("RunningSetRole", QScriptValue(engine, Xt::RunningSetRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("RunningInitRole", QScriptValue(engine, Xt::RunningInitRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("TotalSetRole", QScriptValue(engine, Xt::TotalSetRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("TotalInitRole", QScriptValue(engine, Xt::TotalInitRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("IndentRole", QScriptValue(engine, Xt::IndentRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("DeletedRole", QScriptValue(engine, Xt::DeletedRole), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("AllModules", QScriptValue(engine, Xt::AllModules), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("AccountingModule", QScriptValue(engine, Xt::AccountingModule),QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("SalesModule", QScriptValue(engine, Xt::SalesModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("CRMModule", QScriptValue(engine, Xt::CRMModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("ManufactureModule", QScriptValue(engine, Xt::ManufactureModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("PurchaseModule", QScriptValue(engine, Xt::PurchaseModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("ScheduleModule", QScriptValue(engine, Xt::ScheduleModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("InventoryModule", QScriptValue(engine, Xt::InventoryModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("ProductsModule", QScriptValue(engine, Xt::ProductsModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("SystemModule", QScriptValue(engine, Xt::SystemModule), QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("Xt", glob, QScriptValue::ReadOnly | QScriptValue::Undeletable); } Q_DECLARE_METATYPE(enum Xt::ItemDataRole); Q_DECLARE_METATYPE(enum Xt::StandardModules); qt-client-4.1.0/widgets/xt.h000066400000000000000000000013241217451700100156640ustar00rootroot00000000000000#ifndef XT_H #define XT_H #include void setupXt(QScriptEngine *engine); class Xt { public: enum ItemDataRole { RawRole = (Qt::UserRole + 1), ScaleRole, IdRole, RunningSetRole, RunningInitRole, TotalSetRole, TotalInitRole, IndentRole, DeletedRole }; enum StandardModules { AllModules = 0x00000000, AccountingModule = 0x00000200, SalesModule = 0x00000400, CRMModule = 0x00000800, ManufactureModule = 0x00001000, PurchaseModule = 0x00002000, ScheduleModule = 0x00004000, InventoryModule = 0x00008000, ProductsModule = 0x00010000, SystemModule = 0x00020000 }; }; #endif // XT_H qt-client-4.1.0/widgets/xtableview.cpp000066400000000000000000000511171217451700100177430ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xtableview.h" #include "xsqltablemodel.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "format.h" #include "xtsettings.h" #include "xitemdelegate.h" #define DEBUG true XTableView::XTableView(QWidget *parent) : QTableView(parent) { _keyColumns = 1; _resizingInProcess = false; _settingsLoaded = false; _forgetful = false; _menu = new QMenu(this); _menu->setObjectName("_menu"); setContextMenuPolicy(Qt::CustomContextMenu); verticalHeader()->setDefaultSectionSize(20); horizontalHeader()->setStretchLastSection(false); horizontalHeader()->setClickable(true); horizontalHeader()->setContextMenuPolicy(Qt::CustomContextMenu); setAlternatingRowColors(true); QPalette muted = palette(); muted.setColor(QPalette::AlternateBase, QColor(0xEE, 0xEE, 0xEE)); setPalette(muted); _mapper = new XDataWidgetMapper(this); _model = new XSqlTableModel(this); _model->setEditStrategy(QSqlTableModel::OnManualSubmit); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(sShowMenu(const QPoint &))); connect(horizontalHeader(), SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(sShowHeaderMenu(const QPoint &))); connect(horizontalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(sColumnSizeChanged(int, int, int))); connect(_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(handleDataChanged(const QModelIndex, const QModelIndex))); _windowName = window()->objectName(); } XTableView::~XTableView() { if(_x_preferences) { // window()->objectName() isn't available here, at least for scripted windows! QString settingsPrefix = _windowName + "/" + objectName(); xtsettingsSetValue(settingsPrefix + "/isForgetful", _forgetful); QString savedString; if(!_forgetful) { savedString = ""; for(int i = 0; i < horizontalHeader()->count(); i++) { int w = -1; ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(i), 0); if (cp) { if (!cp->stretchy) w = cp->savedWidth; _columnByName.remove(cp->columnName); delete cp; } if (w >= 0 && ! horizontalHeader()->isSectionHidden(i)) savedString.append(QString::number(i) + "," + QString::number(horizontalHeader()->sectionSize(i)) + "|"); } xtsettingsSetValue(settingsPrefix + "/columnWidths", savedString); } savedString = ""; for(int i = 0; i < horizontalHeader()->count(); i++) { savedString.append(QString::number(i) + "," + (horizontalHeader()->isSectionHidden(i)?"off":"on") + "|"); } if(!savedString.isEmpty()) _x_preferences->set(settingsPrefix + "/columnsShown", savedString); else _x_preferences->remove(settingsPrefix + "/columnsShown"); } } int XTableView::columnIndex(const QString column) { for (int colnum = 0; colnum < horizontalHeader()->count(); colnum++) { if (column == QTableView::model()->headerData(colnum, Qt::Horizontal, Qt::UserRole).toString()) { return colnum; } } return -1; } QString XTableView::columnNameFromLogicalIndex(const int logicalIndex) const { for (QMap::const_iterator it = _columnByName.constBegin(); it != _columnByName.constEnd(); it++) { if (it.value()->logicalIndex == logicalIndex) return it.value()->columnName; } return QString(); } QString XTableView::filter() { return _model->filter(); } void XTableView::handleDataChanged(const QModelIndex topLeft, const QModelIndex lowerRight) { int col; int row; // Emit data changed signal for (col = topLeft.column(); col <= lowerRight.column(); col++) { for (row = topLeft.row(); row <= lowerRight.row(); row++) emit dataChanged(row, col); } } void XTableView::insert() { int row=_model->rowCount(); _model->insertRows(row,1); //Set default values for foreign keys for (int i = 0; i < _idx.count(); ++i) _model->setData(_model->index(row,i),_idx.value(i)); selectRow(row); } QAbstractItemDelegate* XTableView::itemDelegateForColumn(const QString column) { return itemDelegateForColumn(columnIndex(column)); } void XTableView::populate(int p) { XSqlTableModel *t=static_cast(_mapper->model()); if (t) { _idx=t->primaryKey(); for (int i = 0; i < _idx.count(); ++i) { _idx.setValue(i, t->data(t->index(p,i))); setColumnHidden(i,true); } QString clause = QString(_model->database().driver()->sqlStatement(QSqlDriver::WhereStatement, t->tableName(),_idx, false)).mid(6); _model->setFilter(clause); if (!_model->query().isActive()) { _model->select(); } } } void XTableView::popupMenuActionTriggered(QAction * pAction) { QMap m = pAction->data().toMap(); QString command = m.value("command").toString(); if("toggleColumnHidden" == command) setColumnVisible(m.value("column").toInt(), pAction->isChecked()); //else if (some other command to handle) } int XTableView::rowCount() { return _model->rowCount(); } int XTableView::rowCountVisible() { int counter = 0; for (int i = 0; i < _model->rowCount(); i++) { if (!isRowHidden(i)) counter++; } return counter; } void XTableView::select() { setTable(); _model->select(); emit valid(FALSE); } void XTableView::removeSelected() { QModelIndexList selected=selectedIndexes(); for (int i = selected.count() -1 ; i > -1; i--) { if (selected.value(i).column() == 1) { // Only once per row _model->removeRow(selected.value(i).row()); hideRow(selected.value(i).row()); } } } void XTableView::resizeEvent(QResizeEvent * e) { QTableView::resizeEvent(e); sColumnSizeChanged(-1, 0, 0); } void XTableView::revertAll() { _model->revertAll(); if (_mapper) populate(_mapper->currentIndex()); } void XTableView::save() { if(!_model->submitAll()) { if(!throwScriptException(_model->lastError().databaseText())) QMessageBox::critical(this, tr("Error Saving %1").arg(_tableName), tr("Error saving %1 at %2::%3\n\n%4") .arg(_tableName).arg(__FILE__).arg(__LINE__) .arg(_model->lastError().databaseText())); } else emit saved(); } QVariant XTableView::selectedValue(int column) { QModelIndexList selected=selectedIndexes(); return value(selected.first().row(),column); } void XTableView::selectionChanged(const QItemSelection & selected, const QItemSelection & deselected) { if (!selected.indexes().isEmpty()) { emit rowSelected(selected.indexes().first().row()); emit valid(true); } else emit valid(FALSE); QTableView::selectionChanged(selected, deselected); } void XTableView::selectRow(int index) { selectionModel()->select(QItemSelection(model()->index(index,0),model()->index(index,0)), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); } /* this is intended to be similar to XTreeWidget::addColumn(...) but differs in several important ways: - this doesn't actually add columns to the tree view, it only defines how they should appear by default if the model contains columns with the given colname. - as a result it has the opposite effect on visibility - any column not explicitly mentioned in a setColumn call /is visible/ in an XTableView - the alignment parameter only affects the header TODO: figure out how to set the alignment of individual elements */ void XTableView::setColumn(const QString &label, int width, int alignment, bool visible, const QString &colname) { ColumnProps *cp = _columnByName.value(colname, 0); if (! cp) { cp = new ColumnProps(); cp->columnName = colname; cp->fromSettings = false; _columnByName.insert(cp->columnName, cp); } cp->defaultWidth = width; cp->locked = false; cp->visible = visible; cp->label = label; cp->alignment = alignment; if (cp->fromSettings) cp->stretchy = (width == -1 || cp->savedWidth == -1); else { cp->savedWidth = -1; cp->stretchy = (width == -1); } cp->logicalIndex = -1; int colnum = -1; for (colnum = 0; colnum < horizontalHeader()->count(); colnum++) { if (colname == QTableView::model()->headerData(colnum, Qt::Horizontal, Qt::UserRole).toString()) { cp->logicalIndex = colnum; QTableView::model()->setHeaderData(colnum, Qt::Horizontal, colname, Qt::UserRole); QTableView::model()->setHeaderData(colnum, Qt::Horizontal, label, Qt::DisplayRole); QTableView::model()->setHeaderData(colnum, Qt::Horizontal, alignment, Qt::TextAlignmentRole); setColumnTextAlignment(colnum, alignment); break; } } horizontalHeader()->setResizeMode(colnum, QHeaderView::Interactive); if (! cp->fromSettings) setColumnVisible(colnum, visible); if (_forgetful || ! cp->fromSettings) horizontalHeader()->resizeSection(colnum, width); } void XTableView::setColumnEditor(int column, const QString editor) { _model->setColumnRole(column, XSqlTableModel::EditorRole, editor); } void XTableView::setColumnEditor(const QString column, const QString editor) { setColumnRole(column, XSqlTableModel::EditorRole, editor); } void XTableView::setColumnFormat(const QString column, int format) { setColumnRole(column, XSqlTableModel::FormatRole, QVariant(format)); } void XTableView::setColumnLocked(const QString &pColname, bool pLocked) { if (_columnByName.value(pColname)) _columnByName.value(pColname)->locked = pLocked; } void XTableView::setColumnLocked(int pColumn, bool pLocked) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(pColumn), 0); if (cp) cp->locked = pLocked; } void XTableView::setColumnRole(const QString column, int role, const QVariant value) { _model->setColumnRole(columnIndex(column), role, value); } void XTableView::setColumnTextAlignment(int column, int alignment) { _model->setColumnRole(column, Qt::TextAlignmentRole, QVariant(alignment)); } void XTableView::setColumnTextAlignment(const QString column, int alignment) { setColumnRole(column, Qt::TextAlignmentRole, QVariant(alignment)); } void XTableView::setColumnVisible(int pColumn, bool pVisible) { if(pVisible) horizontalHeader()->showSection(pColumn); else horizontalHeader()->hideSection(pColumn); ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(pColumn), 0); if (cp) cp->visible = pVisible; } void XTableView::setDataWidgetMap(XDataWidgetMapper* mapper) { setTable(); _mapper=mapper; } void XTableView::setItemDelegateForColumn(const QString column, QAbstractItemDelegate * delegate) { setItemDelegateForColumn(columnIndex(column), delegate); } void XTableView::setFilter(const QString filter) { _model->setFilter(filter); } void XTableView::setForegroundColor(int row, int col, QString color) { _model->setData(_model->index(row,col), namedColor(color), Qt::ForegroundRole); } void XTableView::setModel(XSqlTableModel * model) { QTableView::setModel(model); for (int i = 0; i < QTableView::model()->columnCount(); ++i) { QString h = QTableView::model()->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString(); QTableView::model()->setHeaderData(i, Qt::Horizontal, h, Qt::UserRole); ColumnProps *cp = _columnByName.value(h, 0); if (! cp) { cp = new ColumnProps; cp->columnName = h; cp->logicalIndex = i; cp->defaultWidth = -1; cp->savedWidth = -1; cp->stretchy = true; cp->locked = false; cp->visible = true; cp->label = h; cp->fromSettings = false; cp->alignment = QTableView::model()->headerData(i, Qt::Horizontal, Qt::TextAlignmentRole).toInt(); cp->label.replace(0, 1, cp->label.left(1).toUpper()); for (int j = 0; (j = cp->label.indexOf("_", j)) >= 0; /* empty */) { cp->label.replace(j, 1, " "); cp->label.replace(j + 1, 1, cp->label.mid(j + 1, 1).toUpper()); } _columnByName.insert(cp->columnName, cp); } QTableView::model()->setHeaderData(i, Qt::Horizontal, cp->label, Qt::DisplayRole); QTableView::model()->setHeaderData(i, Qt::Horizontal, cp->alignment, Qt::TextAlignmentRole); } if (! _settingsLoaded) { QString settingsPrefix = _windowName + "/" + objectName(); _settingsLoaded = true; _forgetful = xtsettingsValue(settingsPrefix + "/isForgetful").toBool(); QString savedString; QStringList savedParts; QString part, key, val; bool b1 = false, b2 = false; if(!_forgetful) { savedString = xtsettingsValue(settingsPrefix + "/columnWidths").toString(); savedParts = savedString.split("|", QString::SkipEmptyParts); for(int i = 0; i < savedParts.size(); i++) { part = savedParts.at(i); key = part.left(part.indexOf(",")); val = part.right(part.length() - part.indexOf(",") - 1); b1 = false; b2 = false; int k = key.toInt(&b1); int v = val.toInt(&b2); if(b1 && b2) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(k), 0); if (cp) { cp->savedWidth = v; cp->stretchy = false; cp->fromSettings = true; } horizontalHeader()->resizeSection(k, v); } } } // Load any previously saved column hidden/visible information if(_x_preferences) { savedString = _x_preferences->value(settingsPrefix + "/columnsShown"); savedParts = savedString.split("|", QString::SkipEmptyParts); for(int i = 0; i < savedParts.size(); i++) { part = savedParts.at(i); key = part.left(part.indexOf(",")); val = part.right(part.length() - part.indexOf(",") - 1); int c = key.toInt(&b1); if(b1 && (val == "on" || val == "off")) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(c), 0); if (cp) { cp->visible = (val == "on"); cp->fromSettings = true; } horizontalHeader()->setSectionHidden(c, (val != "on")); } } } } emit newModel(model); } void XTableView::setRowForegroundColor(int row, QString color) { for (int col = 0; col < _model->query().record().count(); col++) setForegroundColor(row, col, color); } void XTableView::setTable() { if (_model->tableName() == _tableName) return; if (!_tableName.isEmpty()) { QString tablename=_tableName; if (!_schemaName.isEmpty()) tablename = _schemaName + "." + tablename; _model->setTable(tablename,_keyColumns); setModel(_model); setItemDelegate(new XItemDelegate(this)); // setRelations(); } } void XTableView::setValue(int row, int column, QVariant value) { _model->setData(_model->index(row,column), value); } void XTableView::sColumnSizeChanged(int logicalIndex, int /*oldSize*/, int newSize) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(logicalIndex), 0); if (cp) { cp->savedWidth = newSize; if (newSize < 0) cp->stretchy = true; else if (! _resizingInProcess && cp->stretchy) cp->stretchy = false; } if (_resizingInProcess) return; _resizingInProcess = true; int usedSpace = 0; QVector stretch; for(int i = 0; i < horizontalHeader()->count(); i++) { ColumnProps *tmpcp = _columnByName.value(columnNameFromLogicalIndex(i), 0); if (horizontalHeader()->isSectionHidden(i)) continue; else if (logicalIndex == i && newSize < 0) stretch.append(i); else if (logicalIndex == i) usedSpace += newSize; else if (tmpcp && ! tmpcp->stretchy) usedSpace += horizontalHeader()->sectionSize(i); else stretch.append(i); } if(stretch.size() > 0) { int leftover = (viewport()->width() - usedSpace) / stretch.size(); if(leftover < 50) leftover = 50; for (int n = 0; n < stretch.size(); n++) horizontalHeader()->resizeSection(stretch.at(n), leftover); } _resizingInProcess = false; } void XTableView::sResetAllWidths() { bool autoSections = false; for (int i = 0; i < horizontalHeader()->length(); i++) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(i), 0); int width = cp ? cp->defaultWidth : -1; if (width >= 0) horizontalHeader()->resizeSection(i, width); else { if (cp) cp->stretchy = true; autoSections = true; } } if(autoSections) sColumnSizeChanged(-1, 0, 0); } void XTableView::sResetWidth() { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(_resetWhichWidth), 0); int w = cp ? cp->defaultWidth : -1; if(w >= 0) horizontalHeader()->resizeSection(_resetWhichWidth, w); else sColumnSizeChanged(-1, 0, 0); } void XTableView::sShowMenu(const QPoint &pntThis) { QModelIndex item = indexAt(pntThis); if (item.isValid()) { _menu->clear(); emit populateMenu(_menu, item); bool disableExport = FALSE; if(_x_preferences) disableExport = (_x_preferences->value("DisableExportContents")=="t"); if(!disableExport) _menu->addAction(tr("Export Contents..."), this, SLOT(sExport())); if(! _menu->isEmpty()) _menu->popup(mapToGlobal(pntThis)); } } void XTableView::sShowHeaderMenu(const QPoint &pntThis) { _menu->clear(); int logicalIndex = horizontalHeader()->logicalIndexAt(pntThis); int currentSize = horizontalHeader()->sectionSize(logicalIndex); // If we have a default value and the current size is not equal to that default value // then we want to show the menu items for resetting those values back to default ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(logicalIndex), 0); if (cp && (cp->defaultWidth > 0) && (cp->defaultWidth != currentSize) ) { _resetWhichWidth = logicalIndex; _menu->addAction(tr("Reset this Width"), this, SLOT(sResetWidth())); } _menu->addAction(tr("Reset all Widths"), this, SLOT(sResetAllWidths())); _menu->addSeparator(); if(_forgetful) _menu->addAction(tr("Remember Widths"), this, SLOT(sToggleForgetfulness())); else _menu->addAction(tr("Do Not Remember Widths"), this, SLOT(sToggleForgetfulness())); _menu->addSeparator(); for(int i = 0; i < horizontalHeader()->count(); i++) { QAction *act = _menu->addAction(QTableView::model()->headerData(i, Qt::Horizontal).toString()); act->setCheckable(true); act->setChecked(! horizontalHeader()->isSectionHidden(i)); ColumnProps *tmp = _columnByName.value(columnNameFromLogicalIndex(i), 0); act->setEnabled(tmp ? ! tmp->locked : true); QMap m; m.insert("command", QVariant("toggleColumnHidden")); m.insert("column", QVariant(i)); act->setData(m); connect(_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuActionTriggered(QAction*))); } if(! _menu->isEmpty()) _menu->popup(mapToGlobal(pntThis)); } void XTableView::sToggleForgetfulness() { _forgetful = !_forgetful; } bool XTableView::throwScriptException(const QString &message) { QObject *ancestor = this; QScriptEngine *engine = 0; for ( ; ancestor; ancestor = ancestor->parent()) { engine = ancestor->findChild(); if (engine) break; } if (engine) { QScriptContext *ctx = engine->currentContext(); ctx->throwError(message); return true; } return false; } QVariant XTableView::value(int row, int column) { return model()->data(model()->index(row,column)); } qt-client-4.1.0/widgets/xtableview.h000066400000000000000000000136311217451700100174070ustar00rootroot00000000000000 /* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XTABLEVIEW_H #define XTABLEVIEW_H #include #include #include #include #include "xdatawidgetmapper.h" #include "xsqltablemodel.h" #include "widgets.h" class XTUPLEWIDGETS_EXPORT XTableView : public QTableView { Q_OBJECT Q_PROPERTY(QString schemaName READ schemaName WRITE setSchemaName ) Q_PROPERTY(QString tableName READ tableName WRITE setTableName ) Q_PROPERTY(int primaryKeyCoulmns READ primaryKeyColumns WRITE setPrimaryKeyColumns) public: XTableView(QWidget *parent = 0); ~XTableView(); Q_INVOKABLE bool isRowHidden(int row) { return QTableView::isRowHidden(row); } int primaryKeyColumns() const { return _keyColumns; } QString schemaName() const { return _schemaName; } QString tableName() const { return _tableName; } bool throwScriptException(const QString &message); Q_INVOKABLE int columnIndex(const QString column); Q_INVOKABLE QString columnNameFromLogicalIndex(const int logicalIndex) const; Q_INVOKABLE void setColumn(const QString &label, int width, int alignment, bool visible, const QString &colname); Q_INVOKABLE virtual void setColumnLocked(const QString &pColname, bool pLocked); Q_INVOKABLE virtual void setColumnLocked(const int pColumn, bool pLocked); Q_INVOKABLE virtual void setColumnRole(const QString column, int role, QVariant value); Q_INVOKABLE virtual void setColumnVisible(int, bool); Q_INVOKABLE void setTable(); Q_INVOKABLE XDataWidgetMapper *mapper() { return _mapper;} Q_INVOKABLE XSqlTableModel *model() { return _model;} public slots: virtual int rowCount(); virtual int rowCountVisible(); virtual QString filter(); virtual QVariant value(int row, int column); virtual QVariant selectedValue(int column); virtual void insert(); virtual QAbstractItemDelegate *itemDelegateForColumn(int column) { return QTableView::itemDelegateForColumn(column); } virtual QAbstractItemDelegate *itemDelegateForColumn(const QString column); virtual void populate(int p); virtual void removeSelected(); virtual void revertAll(); virtual void save(); virtual void select(); virtual void selectRow(int index); virtual void setColumnEditor(int column, const QString editor); virtual void setColumnEditor(const QString column, const QString editor); virtual void setColumnFormat(const QString column, int format); virtual void setColumnTextAlignment(int column, int alignment); virtual void setColumnTextAlignment(const QString column, int alignment); virtual void setDataWidgetMap(XDataWidgetMapper* mapper); virtual void setItemDelegateForColumn(int column, QAbstractItemDelegate * delegate) { QTableView::setItemDelegateForColumn(column, delegate); } virtual void setItemDelegateForColumn(const QString column, QAbstractItemDelegate * delegate); virtual void setFilter(const QString filter); virtual void setForegroundColor(int row, int col, QString color); virtual void setModel(XSqlTableModel* model=0); virtual void setPrimaryKeyColumns(int p) { _keyColumns = p; } virtual void setRowForegroundColor(int row, QString color); virtual void setSchemaName(QString p) { _schemaName = p; } virtual void setTableName(QString p) { _tableName = p; } virtual void setValue(int row, int column, QVariant value); virtual void sShowMenu(const QPoint &); signals: void dataChanged(int row, int col); void newModel(XSqlTableModel *model); void rowSelected(int); void valid(bool); void saved(); void populateMenu(QMenu *, QModelIndex); protected: virtual void resizeEvent(QResizeEvent*); virtual void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected); // virtual void setRelations(); private slots: void handleDataChanged(const QModelIndex topLeft, const QModelIndex lowerRight); void popupMenuActionTriggered(QAction*); void sColumnSizeChanged(int, int, int); void sResetAllWidths(); void sResetWidth(); void sShowHeaderMenu(const QPoint &); void sToggleForgetfulness(); private: // QSqlDatabase *_db; bool _forgetful; // QMultiMap _idMap; QSqlRecord _idx; int _keyColumns; XDataWidgetMapper *_mapper; QMenu *_menu; XSqlTableModel *_model; int _resetWhichWidth; bool _resizingInProcess; QString _schemaName; // QItemSelectionModel *_selectModel; bool _settingsLoaded; QString _tableName; QString _windowName; struct ColumnProps { QString columnName; int logicalIndex; int defaultWidth; int savedWidth; bool stretchy; bool locked; bool visible; QString label; int alignment; bool fromSettings; }; QMap _columnByName; }; #endif qt-client-4.1.0/widgets/xtextedit.cpp000066400000000000000000000154131217451700100176120ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xtextedit.h" #include #include #include GuiClientInterface* XTextEditHighlighter::_guiClientInterface = 0; GuiClientInterface* XTextEdit::_guiClientInterface = 0; XTextEdit::XTextEdit(QWidget *pParent) : QTextEdit(pParent) { _spellStatus = true; _mapper = 0; _highlighter = 0; _highlighter = new XTextEditHighlighter(this); } XTextEdit::~XTextEdit() { } void XTextEdit::setDataWidgetMap(XDataWidgetMapper* m) { disconnect(this, SIGNAL(textChanged()), this, SLOT(updateMapperData())); if (acceptRichText()) m->addMapping(this, _fieldName, "html", "defaultText"); else m->addMapping(this, _fieldName, "plainText", "defaultText"); _mapper = m; connect(this, SIGNAL(textChanged()), this, SLOT(updateMapperData())); } void XTextEdit::updateMapperData() { if (_mapper->model() && _mapper->model()->data(_mapper->model()->index(_mapper->currentIndex(), _mapper->mappedSection(this))).toString() != toPlainText()) _mapper->model()->setData(_mapper->model()->index(_mapper->currentIndex(), _mapper->mappedSection(this)), toPlainText()); } void XTextEdit::contextMenuEvent(QContextMenuEvent *event) { QMenu *menu = createStandardContextMenu(); bool enableSpellPref = false; if(_x_preferences) enableSpellPref = (_x_preferences->value("SpellCheck")=="t"); if(_guiClientInterface && _guiClientInterface->hunspell_ready() && enableSpellPref && _spellStatus && this->isEnabled() && !this->isReadOnly()) { _lastPos=event->pos(); QTextCursor cursor = cursorForPosition(_lastPos); QString textBlock = cursor.block().text(); int pos = cursor.columnNumber(); int end = textBlock.indexOf(QRegExp("\\W+"),pos); int begin = textBlock.left(pos).lastIndexOf(QRegExp("\\W+"),pos); textBlock = textBlock.mid(begin+1,end-begin-1).trimmed(); QStringList wordList = _guiClientInterface->hunspell_suggest(textBlock); if (_guiClientInterface->hunspell_check(textBlock) < 1) { menu->addSeparator(); QAction *act; act = menu->addAction(tr("Add Word"), this, SLOT(sAddWord())); act = menu->addAction(tr("Ignore Word"), this, SLOT(sIgnoreWord())); if(!wordList.isEmpty()) { menu->addSeparator(); for (int menuActionCount = 0;menuActionCount < qMin(int(_MaxWords),wordList.size()); ++menuActionCount) { act = menu->addAction(wordList.at(menuActionCount).trimmed(), this, SLOT(sCorrectWord())); } } menu->addSeparator(); } } menu->exec(event->globalPos()); delete menu; } void XTextEdit::sCorrectWord() { QAction *action = qobject_cast(sender()); if (action) { QString replacement = action->text(); QTextCursor cursor = cursorForPosition(_lastPos); cursor.select(QTextCursor::WordUnderCursor); cursor.deleteChar(); cursor.insertText(replacement); _highlighter->rehighlight(); } } void XTextEdit::sAddWord() { QTextCursor cursor = cursorForPosition(_lastPos); QString textBlock = cursor.block().text(); int pos = cursor.columnNumber(); int end = textBlock.indexOf(QRegExp("\\W+"),pos); int begin = textBlock.left(pos).lastIndexOf(QRegExp("\\W+"),pos); textBlock = textBlock.mid(begin+1,end-begin-1); _guiClientInterface->hunspell_add(textBlock); _highlighter->rehighlight(); } void XTextEdit::sIgnoreWord() { QTextCursor cursor = cursorForPosition(_lastPos); QString textBlock = cursor.block().text(); int pos = cursor.columnNumber(); int end = textBlock.indexOf(QRegExp("\\W+"),pos); int begin = textBlock.left(pos).lastIndexOf(QRegExp("\\W+"),pos); textBlock = textBlock.mid(begin+1,end-begin-1); _guiClientInterface->hunspell_ignore(textBlock); _highlighter->rehighlight(); } XTextEditHighlighter::XTextEditHighlighter(QObject *parent) : QSyntaxHighlighter(parent) { HighlightingRule rule; _spellCheckFormat.setUnderlineColor(QColor(Qt::red)); _spellCheckFormat.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline); } XTextEditHighlighter::XTextEditHighlighter(QTextDocument *document) : QSyntaxHighlighter(document) { HighlightingRule rule; _spellCheckFormat.setUnderlineColor(QColor(Qt::red)); _spellCheckFormat.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline); } XTextEditHighlighter::XTextEditHighlighter(QTextEdit *editor) : QSyntaxHighlighter(editor) { HighlightingRule rule; _spellCheckFormat.setUnderlineColor(QColor(Qt::red)); _spellCheckFormat.setUnderlineStyle(QTextCharFormat::SpellCheckUnderline); } XTextEditHighlighter::~XTextEditHighlighter() { } void XTextEditHighlighter::highlightBlock(const QString &text) { XTextEdit* textEdit = qobject_cast(this->parent()); bool enableSpellPref = false; if(_x_preferences) enableSpellPref = (_x_preferences->value("SpellCheck")=="t"); if(_guiClientInterface && _guiClientInterface->hunspell_ready() && enableSpellPref && textEdit->spellEnabled() && textEdit->isEnabled() && !textEdit->isReadOnly()) { QString widgetText = text.simplified(); if (!widgetText.isEmpty()) { QStringList widgetWords = widgetText.split(QRegExp("([^\\w,^\\\\]|(?=\\\\))+"), QString::SkipEmptyParts); foreach(QString word, widgetWords) { if (word.length() > 1 && !word.startsWith('\\')) { if (_guiClientInterface->hunspell_check(word) < 1) { int wordCount = text.count(QRegExp("\\b" + word + "\\b")); //loop through all repeated words in Line Edit int wordStartPos=-1; for (int repeatCount=0;repeatCount < wordCount; ++repeatCount) { wordStartPos = text.indexOf(QRegExp("\\b" + word + "\\b"),wordStartPos+1); if (wordStartPos>=0) setFormat(wordStartPos, word.length(), _spellCheckFormat); } } } } } } } qt-client-4.1.0/widgets/xtextedit.h000066400000000000000000000054701217451700100172610ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTEXTEDIT_H__ #define __XTEXTEDIT_H__ #include #include #include #include #include "widgets.h" #include "xdatawidgetmapper.h" #include "guiclientinterface.h" class XTextEditHighlighter; class XTUPLEWIDGETS_EXPORT XTextEdit : public QTextEdit { Q_OBJECT Q_PROPERTY(QString fieldName READ fieldName WRITE setFieldName) Q_PROPERTY(QString defaultText READ defaultText WRITE setDefaultText) Q_PROPERTY(bool spellEnable READ spellEnabled WRITE setSpellEnable) public: XTextEdit(QWidget * = 0); ~XTextEdit(); virtual QString defaultText() const { return _default; }; virtual QString fieldName() const { return _fieldName; }; static GuiClientInterface *_guiClientInterface; Q_INVOKABLE bool spellEnabled() const { return _spellStatus; } public slots: virtual void setDataWidgetMap(XDataWidgetMapper* m); virtual void setDefaultText(QString p) { _default = p; }; virtual void setFieldName(QString p) { _fieldName = p; }; virtual void updateMapperData(); virtual void setSpellEnable(bool p) { _spellStatus = p; } private slots: void contextMenuEvent(QContextMenuEvent *event); void sCorrectWord(); void sAddWord(); void sIgnoreWord(); protected: XDataWidgetMapper *_mapper; private: QString _default; QString _fieldName; enum { _MaxWords = 5 }; QPoint _lastPos; XTextEditHighlighter *_highlighter; bool _spellStatus; }; class XTextEditHighlighter : public QSyntaxHighlighter { Q_OBJECT public: static GuiClientInterface *_guiClientInterface; XTextEditHighlighter(QObject *parent); XTextEditHighlighter(QTextDocument *document); XTextEditHighlighter(QTextEdit *editor); ~XTextEditHighlighter(); protected: virtual void highlightBlock(const QString &text); private: struct HighlightingRule { QRegExp _pattern; QTextCharFormat _format; }; QVector _highlightingRules; QRegExp _commentStartExpression; QRegExp _commentEndExpression; QTextCharFormat _keywordFormat; QTextCharFormat _classFormat; QTextCharFormat _singleLineCommentFormat; QTextCharFormat _multiLineCommentFormat; QTextCharFormat _quotationFormat; QTextCharFormat _functionFormat; QTextCharFormat _spellCheckFormat; }; // SPELLHIGHLIGHTER_H #endif qt-client-4.1.0/widgets/xtreeview.cpp000066400000000000000000000621611217451700100176140ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xtreeview.h" #include "xsqltablemodel.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "format.h" #include "xtsettings.h" #define DEBUG true XTreeView::XTreeView(QWidget *parent) : QTreeView(parent) { _keyColumns = 1; _resizingInProcess = false; _settingsLoaded = false; _forgetful = false; _ignoreSizing = false; _menu = new QMenu(this); _menu->setObjectName("_menu"); setContextMenuPolicy(Qt::CustomContextMenu); header()->setStretchLastSection(false); header()->setClickable(true); header()->setContextMenuPolicy(Qt::CustomContextMenu); if (_x_preferences) setAlternatingRowColors(!_x_preferences->boolean("NoAlternatingRowColors")); _mapper = new XDataWidgetMapper(this); _model = new XSqlTableModel(this); _model->setEditStrategy(QSqlTableModel::OnManualSubmit); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(sShowMenu(const QPoint &))); connect(header(), SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(sShowHeaderMenu(const QPoint &))); connect(header(), SIGNAL(sectionResized(int, int, int)), this, SLOT(sColumnSizeChanged(int, int, int))); connect(_model, SIGNAL(dataChanged(QModelIndex, QModelIndex)), this, SLOT(handleDataChanged(const QModelIndex, const QModelIndex))); _windowName = window()->objectName(); } XTreeView::~XTreeView() { if(_x_preferences) { // window()->objectName() isn't available here, at least for scripted windows! QString settingsPrefix = _windowName + "/" + objectName(); xtsettingsSetValue(settingsPrefix + "/isForgetful", _forgetful); QString savedString; if(!_forgetful) { savedString = ""; for(int i = 0; i < header()->count(); i++) { int w = -1; ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(i), 0); if (cp) { if (!cp->stretchy) w = cp->savedWidth; _columnByName.remove(cp->columnName); delete cp; } if (w >= 0 && ! header()->isSectionHidden(i)) savedString.append(QString::number(i) + "," + QString::number(header()->sectionSize(i)) + "|"); } xtsettingsSetValue(settingsPrefix + "/columnWidths", savedString); } savedString = ""; for(int i = 0; i < header()->count(); i++) { savedString.append(QString::number(i) + "," + (header()->isSectionHidden(i)?"off":"on") + "|"); } if(!savedString.isEmpty()) _x_preferences->set(settingsPrefix + "/columnsShown", savedString); else _x_preferences->remove(settingsPrefix + "/columnsShown"); } } int XTreeView::columnIndex(const QString column) { for (int colnum = 0; colnum < header()->count(); colnum++) { if (column == QTreeView::model()->headerData(colnum, Qt::Horizontal, Qt::UserRole).toString()) { return colnum; } } return -1; } QString XTreeView::columnNameFromLogicalIndex(const int logicalIndex) const { for (QMap::const_iterator it = _columnByName.constBegin(); it != _columnByName.constEnd(); it++) { if (it.value()->logicalIndex == logicalIndex) return it.value()->columnName; } return QString(); } int XTreeView::currentIndex() { QModelIndexList idx = selectedIndexes(); if(idx.isEmpty()) return -1; return idx.at(0).row(); } QString XTreeView::filter() { return _model->filter(); } void XTreeView::handleDataChanged(const QModelIndex topLeft, const QModelIndex lowerRight) { int col; int row; // Emit data changed signal for (col = topLeft.column(); col <= lowerRight.column(); col++) { for (row = topLeft.row(); row <= lowerRight.row(); row++) emit dataChanged(row, col); } } void XTreeView::insert() { int row=_model->rowCount(); _model->insertRows(row,1); //Set default values for foreign keys for (int i = 0; i < _idx.count(); ++i) _model->setData(_model->index(row,i),_idx.value(i)); selectRow(row); } bool XTreeView::isRowHidden(int row) { QModelIndex idx = _model->index(row,0); QModelIndex pidx = static_cast(_model)->parent(idx); return QTreeView::isRowHidden(row,pidx); } void XTreeView::populate(int p) { XSqlTableModel *t=static_cast(_mapper->model()); if (t) { _idx=t->primaryKey(); for (int i = 0; i < _idx.count(); ++i) { _idx.setValue(i, t->data(t->index(p,i))); setColumnHidden(i,true); } QString clause = QString(_model->database().driver()->sqlStatement(QSqlDriver::WhereStatement, t->tableName(),_idx, false)).mid(6); _model->setFilter(clause); if (!_model->query().isActive()) { _model->select(); } } } void XTreeView::popupMenuActionTriggered(QAction * pAction) { QMap m = pAction->data().toMap(); QString command = m.value("command").toString(); if("toggleColumnHidden" == command) setColumnVisible(m.value("column").toInt(), pAction->isChecked()); //else if (some other command to handle) } int XTreeView::rowCount() { return _model->rowCount(); } int XTreeView::rowCountVisible() { int counter = 0; for (int i = 0; i < _model->rowCount(); i++) { if (!isRowHidden(i)) counter++; } return counter; } void XTreeView::select() { setTable(); _model->select(); emit valid(FALSE); } void XTreeView::removeSelected() { QModelIndexList selected=selectedIndexes(); for (int i = selected.count() -1 ; i > -1; i--) { if (selected.value(i).column() == 1) { setRowHidden(selected.value(i).row(),selected.value(i).parent(),true); _model->removeRow(selected.value(i).row()); } } } void XTreeView::resizeEvent(QResizeEvent * e) { QTreeView::resizeEvent(e); sColumnSizeChanged(-1, 0, 0); } void XTreeView::revertAll() { _model->revertAll(); if (_mapper) populate(_mapper->currentIndex()); } void XTreeView::save() { if(!_model->submitAll()) { if(!throwScriptException(_model->lastError().databaseText())) QMessageBox::critical(this, tr("Error Saving %1").arg(_tableName), tr("Error saving %1 at %2::%3\n\n%4") .arg(_tableName).arg(__FILE__).arg(__LINE__) .arg(_model->lastError().databaseText())); } else emit saved(); } QVariant XTreeView::selectedValue(int column) { QModelIndexList selected=selectedIndexes(); return value(selected.first().row(),column); } void XTreeView::selectionChanged(const QItemSelection & selected, const QItemSelection & deselected) { if (!selected.indexes().isEmpty()) { emit rowSelected(selected.indexes().first().row()); emit valid(true); } else emit valid(FALSE); QTreeView::selectionChanged(selected, deselected); } void XTreeView::selectRow(int index) { selectionModel()->select(QItemSelection(model()->index(index,0),model()->index(index,0)), QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); } /* this is intended to be similar to XTreeWidget::addColumn(...) but differs in several important ways: - this doesn't actually add columns to the tree view, it only defines how they should appear by default if the model contains columns with the given colname. - as a result it has the opposite effect on visibility - any column not explicitly mentioned in a setColumn call /is visible/ in an XTreeView - the alignment parameter only affects the header TODO: figure out how to set the alignment of individual elements */ void XTreeView::setColumn(const QString &label, int width, int alignment, bool visible, const QString &colname) { ColumnProps *cp = _columnByName.value(colname, 0); if (! cp) { cp = new ColumnProps(); cp->columnName = colname; cp->fromSettings = false; _columnByName.insert(cp->columnName, cp); } cp->defaultWidth = width; cp->locked = false; cp->visible = visible; cp->label = label; cp->alignment = alignment; if (cp->fromSettings) cp->stretchy = (width == -1 || cp->savedWidth == -1); else { cp->savedWidth = -1; cp->stretchy = (width == -1); } cp->logicalIndex = -1; int colnum = -1; for (colnum = 0; colnum < header()->count(); colnum++) { if (colname == QTreeView::model()->headerData(colnum, Qt::Horizontal, Qt::UserRole).toString()) { cp->logicalIndex = colnum; QTreeView::model()->setHeaderData(colnum, Qt::Horizontal, colname, Qt::UserRole); QTreeView::model()->setHeaderData(colnum, Qt::Horizontal, label, Qt::DisplayRole); QTreeView::model()->setHeaderData(colnum, Qt::Horizontal, alignment, Qt::TextAlignmentRole); setColumnTextAlignment(colnum, alignment); break; } } header()->setResizeMode(colnum, QHeaderView::Interactive); if (! cp->fromSettings) setColumnVisible(colnum, visible); if (_forgetful || ! cp->fromSettings) header()->resizeSection(colnum, width); } void XTreeView::setColumnEditor(int column, const QString editor) { _model->setColumnRole(column, XSqlTableModel::EditorRole, editor); } void XTreeView::setColumnEditor(const QString column, const QString editor) { setColumnRole(column, XSqlTableModel::EditorRole, editor); } void XTreeView::setColumnFormat(const QString column, int format) { setColumnRole(column, XSqlTableModel::FormatRole, QVariant(format)); } void XTreeView::setColumnLocked(const QString &pColname, bool pLocked) { if (_columnByName.value(pColname)) _columnByName.value(pColname)->locked = pLocked; } void XTreeView::setColumnLocked(int pColumn, bool pLocked) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(pColumn), 0); if (cp) cp->locked = pLocked; } void XTreeView::setColumnRole(const QString column, int role, const QVariant value) { _model->setColumnRole(columnIndex(column), role, value); } void XTreeView::setColumnTextAlignment(int column, int alignment) { _model->setColumnRole(column, Qt::TextAlignmentRole, QVariant(alignment)); } void XTreeView::setColumnTextAlignment(const QString column, int alignment) { setColumnRole(column, Qt::TextAlignmentRole, QVariant(alignment)); } void XTreeView::setColumnVisible(int pColumn, bool pVisible) { if(pVisible) header()->showSection(pColumn); else header()->hideSection(pColumn); ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(pColumn), 0); if (cp) cp->visible = pVisible; } void XTreeView::setDataWidgetMap(XDataWidgetMapper* mapper) { setTable(); _mapper=mapper; } void XTreeView::setGeometry( int x, int y, int w, int h ) { if (_ignoreSizing) QTreeView::setGeometry( x, y, width(), height()); else QTreeView::setGeometry( x, y, w, h); } void XTreeView::setFilter(const QString filter) { _model->setFilter(filter); } void XTreeView::setForegroundColor(int row, int col, QString color) { _model->setData(_model->index(row,col), namedColor(color), Qt::ForegroundRole); } void XTreeView::setModel(XSqlTableModel * model) { QTreeView::setModel(model); for (int i = 0; i < QTreeView::model()->columnCount(); ++i) { QString h = QTreeView::model()->headerData(i, Qt::Horizontal, Qt::DisplayRole).toString(); QTreeView::model()->setHeaderData(i, Qt::Horizontal, h, Qt::UserRole); ColumnProps *cp = _columnByName.value(h, 0); if (! cp) { cp = new ColumnProps; cp->columnName = h; cp->logicalIndex = i; cp->defaultWidth = -1; cp->savedWidth = -1; cp->stretchy = true; cp->locked = false; cp->visible = true; cp->label = h; cp->fromSettings = false; cp->alignment = QTreeView::model()->headerData(i, Qt::Horizontal, Qt::TextAlignmentRole).toInt(); cp->label.replace(0, 1, cp->label.left(1).toUpper()); for (int j = 0; (j = cp->label.indexOf("_", j)) >= 0; /* empty */) { cp->label.replace(j, 1, " "); cp->label.replace(j + 1, 1, cp->label.mid(j + 1, 1).toUpper()); } _columnByName.insert(cp->columnName, cp); } QTreeView::model()->setHeaderData(i, Qt::Horizontal, cp->label, Qt::DisplayRole); QTreeView::model()->setHeaderData(i, Qt::Horizontal, cp->alignment, Qt::TextAlignmentRole); } if (! _settingsLoaded) { QString settingsPrefix = _windowName + "/" + objectName(); _settingsLoaded = true; _forgetful = xtsettingsValue(settingsPrefix + "/isForgetful").toBool(); QString savedString; QStringList savedParts; QString part, key, val; bool b1 = false, b2 = false; if(!_forgetful) { savedString = xtsettingsValue(settingsPrefix + "/columnWidths").toString(); savedParts = savedString.split("|", QString::SkipEmptyParts); for(int i = 0; i < savedParts.size(); i++) { part = savedParts.at(i); key = part.left(part.indexOf(",")); val = part.right(part.length() - part.indexOf(",") - 1); b1 = false; b2 = false; int k = key.toInt(&b1); int v = val.toInt(&b2); if(b1 && b2) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(k), 0); if (cp) { cp->savedWidth = v; cp->stretchy = false; cp->fromSettings = true; } header()->resizeSection(k, v); } } } // Load any previously saved column hidden/visible information if(_x_preferences) { savedString = _x_preferences->value(settingsPrefix + "/columnsShown"); savedParts = savedString.split("|", QString::SkipEmptyParts); for(int i = 0; i < savedParts.size(); i++) { part = savedParts.at(i); key = part.left(part.indexOf(",")); val = part.right(part.length() - part.indexOf(",") - 1); int c = key.toInt(&b1); if(b1 && (val == "on" || val == "off")) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(c), 0); if (cp) { cp->visible = (val == "on"); cp->fromSettings = true; } header()->setSectionHidden(c, (val != "on")); } } } } emit newModel(model); } void XTreeView::setRowForegroundColor(int row, QString color) { for (int col = 0; col < _model->query().record().count(); col++) setForegroundColor(row, col, color); } void XTreeView::setTable() { if (_model->tableName() == _tableName) return; if (!_tableName.isEmpty()) { QString tablename=_tableName; if (!_schemaName.isEmpty()) tablename = _schemaName + "." + tablename; _model->setTable(tablename,_keyColumns); setModel(_model); } } void XTreeView::setValue(int row, int column, QVariant value) { _model->setData(_model->index(row,column), value); } void XTreeView::sColumnSizeChanged(int logicalIndex, int /*oldSize*/, int newSize) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(logicalIndex), 0); if (cp) { cp->savedWidth = newSize; if (newSize < 0) cp->stretchy = true; else if (! _resizingInProcess && cp->stretchy) cp->stretchy = false; } if (_resizingInProcess) return; _resizingInProcess = true; int usedSpace = 0; QVector stretch; for(int i = 0; i < header()->count(); i++) { ColumnProps *tmpcp = _columnByName.value(columnNameFromLogicalIndex(i), 0); if (header()->isSectionHidden(i)) continue; else if (logicalIndex == i && newSize < 0) stretch.append(i); else if (logicalIndex == i) usedSpace += newSize; else if (tmpcp && ! tmpcp->stretchy) usedSpace += header()->sectionSize(i); else stretch.append(i); } if(stretch.size() > 0) { int leftover = (viewport()->width() - usedSpace) / stretch.size(); if(leftover < 50) leftover = 50; for (int n = 0; n < stretch.size(); n++) header()->resizeSection(stretch.at(n), leftover); } _resizingInProcess = false; } void XTreeView::sResetAllWidths() { bool autoSections = false; for (int i = 0; i < header()->length(); i++) { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(i), 0); int width = cp ? cp->defaultWidth : -1; if (width >= 0) header()->resizeSection(i, width); else { if (cp) cp->stretchy = true; autoSections = true; } } if(autoSections) sColumnSizeChanged(-1, 0, 0); } void XTreeView::sResetWidth() { ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(_resetWhichWidth), 0); int w = cp ? cp->defaultWidth : -1; if(w >= 0) header()->resizeSection(_resetWhichWidth, w); else sColumnSizeChanged(-1, 0, 0); } void XTreeView::sShowMenu(const QPoint &pntThis) { QModelIndex item = indexAt(pntThis); if (item.isValid()) { _menu->clear(); emit populateMenu(_menu, item); bool disableExport = FALSE; if(_x_preferences) disableExport = (_x_preferences->value("DisableExportContents")=="t"); if(!disableExport) { _menu->addSeparator(); _menu->addAction(tr("Export Contents..."), this, SLOT(sExport())); } if (! _menu->isEmpty()) _menu->popup(mapToGlobal(pntThis)); } } void XTreeView::sShowHeaderMenu(const QPoint &pntThis) { _menu->clear(); int logicalIndex = header()->logicalIndexAt(pntThis); int currentSize = header()->sectionSize(logicalIndex); // If we have a default value and the current size is not equal to that default value // then we want to show the menu items for resetting those values back to default ColumnProps *cp = _columnByName.value(columnNameFromLogicalIndex(logicalIndex), 0); if (cp && (cp->defaultWidth > 0) && (cp->defaultWidth != currentSize) ) { _resetWhichWidth = logicalIndex; _menu->addAction(tr("Reset this Width"), this, SLOT(sResetWidth())); } _menu->addAction(tr("Reset all Widths"), this, SLOT(sResetAllWidths())); _menu->addSeparator(); if(_forgetful) _menu->addAction(tr("Remember Widths"), this, SLOT(sToggleForgetfulness())); else _menu->addAction(tr("Do Not Remember Widths"), this, SLOT(sToggleForgetfulness())); _menu->addSeparator(); for(int i = 0; i < header()->count(); i++) { QAction *act = _menu->addAction(QTreeView::model()->headerData(i, Qt::Horizontal).toString()); act->setCheckable(true); act->setChecked(! header()->isSectionHidden(i)); ColumnProps *tmp = _columnByName.value(columnNameFromLogicalIndex(i), 0); act->setEnabled(tmp ? ! tmp->locked : true); QMap m; m.insert("command", QVariant("toggleColumnHidden")); m.insert("column", QVariant(i)); act->setData(m); connect(_menu, SIGNAL(triggered(QAction*)), this, SLOT(popupMenuActionTriggered(QAction*))); } if (! _menu->isEmpty()) _menu->popup(mapToGlobal(pntThis)); } void XTreeView::sExport() { QString currdir = xtsettingsValue(window()->objectName() + "/" + objectName() + "/exportPath").toString(); QString selectedFilter; QFile file(QFileDialog::getSaveFileName(this, tr("Export Save Filename"), currdir, tr("Text CSV (*.csv);;Text (*.txt);;ODF Text Document (*.odt);;HTML Document (*.html)"), &selectedFilter)); if (file.fileName().isEmpty()) return; QString suffix = ".txt"; QByteArray writerformat = "plaintext"; QIODevice::OpenMode mode= QIODevice::WriteOnly | QIODevice::Text; if (selectedFilter.contains("csv")) suffix = ".csv"; else if (selectedFilter.contains("odt")) { suffix = ".odt"; writerformat = "odf"; mode = QIODevice::WriteOnly; } else if (selectedFilter.contains("html")) { suffix = ".html"; writerformat = "HTML"; } if (! file.fileName().endsWith(suffix)) file.setFileName(file.fileName() + suffix); if (! file.open(mode)) return; xtsettingsSetValue(currdir, QFileInfo(file).path()); QTextDocument doc; if (populateTextDocument(&doc, suffix)) { QTextDocumentWriter writer(&file, writerformat); writer.write(&doc); } file.close(); } bool XTreeView::populateTextDocument(QTextDocument *doc, QString suffix) { QTextCursor cursor(doc); /* QTextDocumentWriter appears to put each table cell on its own line, so we need special handling of csv and txt to build full lines. */ if (suffix == ".csv" || suffix == ".txt") { QStringList fields; QString fieldWrapper = (suffix == ".csv") ? "\"%1\"" : "%1"; QString fieldSeparator = (suffix == ".csv") ? "," : "\t"; for (int col = 0; col < header()->count(); col++) if (! isColumnHidden(col)) fields << fieldWrapper.arg(model()->headerData(col, Qt::Horizontal, Qt::DisplayRole) .toString().replace(QRegExp("\\s+"), " ")); cursor.insertText(fields.join(fieldSeparator)); for (int row = 0; row < model()->rowCount(); row++) { fields.clear(); if (! isRowHidden(row)) { for (int col = 0; col < model()->columnCount(); col++) if (! isColumnHidden(col)) fields << fieldWrapper.arg(model()->index(row, col) .data(Qt::DisplayRole).toString() .replace(QRegExp("\\s+"), " ")); cursor.insertBlock(); cursor.insertText(fields.join(fieldSeparator)); } } } else { QTextTableFormat tableFormat; QTextTableCell cell; QTextCharFormat format; QString font; int colcnt = 0; int rowcnt = 0; tableFormat.setHeaderRowCount(1); for (int i = 0; i < header()->count(); i++) if (! isColumnHidden(i)) colcnt++; for (int i = 0; i < model()->rowCount(); i++) if (! isRowHidden(i)) rowcnt++; // presizing the table gives a huge performance gain over adding dynamically cursor.insertTable(rowcnt + 1, colcnt, tableFormat); for (int col = 0; col < header()->count(); col++) { if (! isColumnHidden(col)) { cell = cursor.currentTable()->cellAt(cursor.position()); format = cell.format(); format.setBackground(Qt::lightGray); cell.setFormat(format); cursor.insertText(model()->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString()); cursor.movePosition(QTextCursor::NextCell); } } for (int row = 0; row < model()->rowCount(); row++) { if (! isRowHidden(row)) { for (int col = 0; col < model()->columnCount(); col++) { if (! isColumnHidden(col)) { QModelIndex idx = model()->index(row, col); cell = cursor.currentTable()->cellAt(cursor.position()); format = cell.format(); if (idx.data(Qt::BackgroundRole).isValid()) format.setBackground(idx.data(Qt::BackgroundRole).value()); if (idx.data(Qt::ForegroundRole).isValid()) format.setForeground(idx.data(Qt::ForegroundRole).value()); // Qt::TextAlignmentRole? if (idx.data(Qt::FontRole).isValid()) { font = idx.data(Qt::FontRole).toString(); if (!font.isEmpty()) format.setFont(QFont(font)); } cell.setFormat(format); cursor.insertText(idx.data(Qt::DisplayRole).toString()); cursor.movePosition(QTextCursor::NextCell); } } } } } return true; } void XTreeView::sToggleForgetfulness() { _forgetful = !_forgetful; } bool XTreeView::throwScriptException(const QString &message) { QObject *ancestor = this; QScriptEngine *engine = 0; for ( ; ancestor; ancestor = ancestor->parent()) { engine = ancestor->findChild(); if (engine) break; } if (engine) { QScriptContext *ctx = engine->currentContext(); ctx->throwError(message); return true; } return false; } QVariant XTreeView::value(int row, int column) { return model()->data(model()->index(row,column)); } qt-client-4.1.0/widgets/xtreeview.h000066400000000000000000000132231217451700100172540ustar00rootroot00000000000000 /* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XTREEVIEW_H #define XTREEVIEW_H #include #include #include #include #include "xdatawidgetmapper.h" #include "xsqltablemodel.h" #include "widgets.h" class QTextDocument; class XTUPLEWIDGETS_EXPORT XTreeView : public QTreeView { Q_OBJECT Q_PROPERTY(QString schemaName READ schemaName WRITE setSchemaName ) Q_PROPERTY(QString tableName READ tableName WRITE setTableName ) Q_PROPERTY(int primaryKeyCoulmns READ primaryKeyColumns WRITE setPrimaryKeyColumns) public: XTreeView(QWidget *parent = 0); ~XTreeView(); Q_INVOKABLE bool isRowHidden(int row); int primaryKeyColumns() const { return _keyColumns; } QString schemaName() const { return _schemaName; } QString tableName() const { return _tableName; } bool throwScriptException(const QString &message); Q_INVOKABLE int columnIndex(const QString column); Q_INVOKABLE QString columnNameFromLogicalIndex(const int logicalIndex) const; Q_INVOKABLE void setColumn(const QString &label, int width, int alignment, bool visible, const QString &colname); Q_INVOKABLE virtual void setColumnLocked(const QString &pColname, bool pLocked); Q_INVOKABLE virtual void setColumnLocked(const int pColumn, bool pLocked); Q_INVOKABLE virtual void setColumnRole(const QString column, int role, QVariant value); Q_INVOKABLE virtual void setColumnVisible(int, bool); Q_INVOKABLE void setTable(); Q_INVOKABLE XDataWidgetMapper *mapper() { return _mapper;} Q_INVOKABLE XSqlTableModel *model() { return _model;} virtual bool ignoreGeometrySizing() { return _ignoreSizing; } virtual void setIgnoreGeometrySizing(bool ignore) { _ignoreSizing = ignore; } virtual void setGeometry( int x, int y, int w, int h ); public slots: virtual int currentIndex(); virtual int rowCount(); virtual int rowCountVisible(); virtual QString filter(); virtual QVariant value(int row, int column); virtual QVariant selectedValue(int column); virtual void insert(); virtual void populate(int p); virtual void removeSelected(); virtual void revertAll(); virtual void save(); virtual void select(); virtual void selectRow(int index); virtual void setColumnEditor(int column, const QString editor); virtual void setColumnEditor(const QString column, const QString editor); virtual void setColumnFormat(const QString column, int format); virtual void setColumnTextAlignment(int column, int alignment); virtual void setColumnTextAlignment(const QString column, int alignment); virtual void setDataWidgetMap(XDataWidgetMapper* mapper); virtual void setFilter(const QString filter); virtual void setForegroundColor(int row, int col, QString color); virtual void setModel(XSqlTableModel* model=0); virtual void setPrimaryKeyColumns(int p) { _keyColumns = p; } virtual void setRowForegroundColor(int row, QString color); virtual void setSchemaName(QString p) { _schemaName = p; } virtual void setTableName(QString p) { _tableName = p; } virtual void setValue(int row, int column, QVariant value); virtual void sShowMenu(const QPoint &); signals: void dataChanged(int row, int col); void newModel(XSqlTableModel *model); void rowSelected(int); void valid(bool); void saved(); void populateMenu(QMenu *, QModelIndex); protected: virtual void resizeEvent(QResizeEvent*); virtual void selectionChanged(const QItemSelection & selected, const QItemSelection & deselected); private slots: void handleDataChanged(const QModelIndex topLeft, const QModelIndex lowerRight); void popupMenuActionTriggered(QAction*); void sColumnSizeChanged(int, int, int); void sResetAllWidths(); void sResetWidth(); void sShowHeaderMenu(const QPoint &); void sExport(); void sToggleForgetfulness(); bool populateTextDocument(QTextDocument *doc, QString suffix); private: bool _forgetful; bool _ignoreSizing; QSqlRecord _idx; int _keyColumns; XDataWidgetMapper *_mapper; QMenu *_menu; XSqlTableModel *_model; int _resetWhichWidth; bool _resizingInProcess; QString _schemaName; bool _settingsLoaded; QString _tableName; QString _windowName; struct ColumnProps { QString columnName; int logicalIndex; int defaultWidth; int savedWidth; bool stretchy; bool locked; bool visible; QString label; int alignment; bool fromSettings; }; QMap _columnByName; }; #endif qt-client-4.1.0/widgets/xtreewidget.cpp000066400000000000000000002432771217451700100201360ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include #include "xtreewidget.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "xtreewidgetprogress.h" #include "xtsettings.h" #include "xsqlquery.h" #include "format.h" #define DEBUG false #define WORKERINTERVAL 0 #define WORKERROWS 500 /* make sure the colroles are kept in sync with QStringList knownroles in populate() below, both in count and order */ #define COLROLE_DISPLAY 0 #define COLROLE_TEXTALIGNMENT 1 #define COLROLE_BACKGROUND 2 #define COLROLE_FOREGROUND 3 #define COLROLE_TOOLTIP 4 #define COLROLE_STATUSTIP 5 #define COLROLE_FONT 6 #define COLROLE_KEY 7 #define COLROLE_RUNNING 8 #define COLROLE_RUNNINGINIT 9 #define COLROLE_GROUPRUNNING 10 #define COLROLE_TOTAL 11 #define COLROLE_NUMERIC 12 #define COLROLE_NULL 13 #define COLROLE_ID 14 // make sure COLROLE_COUNT = last COLROLE + 1 #define COLROLE_COUNT 15 #define yesStr QObject::tr("Yes") #define noStr QObject::tr("No") GuiClientInterface *XTreeWidget::_guiClientInterface = 0; static QTreeWidgetItem *searchChildren(XTreeWidgetItem *item, int pId); // cint() and round() regarding Issue #8897 #include static double cint(double x) { double intpart, fractpart; fractpart = modf(x, &intpart); if (fabs(fractpart) >= 0.5) return x>=0 ? ceil(x) : floor(x); else return x<0 ? ceil(x) : floor(x); } static double round(double r, int places) { double off=pow(10.0,places); return cint(r*off)/off; } XTreeWidget::XTreeWidget(QWidget *pParent) : QTreeWidget(pParent) { _resizingInProcess = false; _forgetful = false; _forgetfulOrder = false; _settingsLoaded = false; _menu = new QMenu(this); _menu->setObjectName("_menu"); _savedId = false; // was -1; _scol = -1; _sord = Qt::AscendingOrder; _linear = false; _alwaysLinear = true; _colIdx = 0; // querycol = _colIdx[xtreecol] _colRole = 0; // querycol = _colRole[xtreecol][roleid] _fieldCount = 0; _last = 0; for (int i = 0; i < ROWROLE_COUNT; i++) _rowRole[i] = 0; _progress = 0; _subtotals = 0; setUniformRowHeights(true); //#13439 speed improvement if all rows are known to be the same height setContextMenuPolicy(Qt::CustomContextMenu); setSelectionBehavior(QAbstractItemView::SelectRows); header()->setStretchLastSection(false); header()->setClickable(true); if (_x_preferences) setAlternatingRowColors(!_x_preferences->boolean("NoAlternatingRowColors")); connect(header(), SIGNAL(sectionClicked(int)), this, SLOT(sHeaderClicked(int))); connect(this, SIGNAL(itemSelectionChanged()), this, SLOT(sSelectionChanged())); connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(sItemSelected(QTreeWidgetItem *, int))); connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(sShowMenu(const QPoint &))); connect(header(), SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(sShowHeaderMenu(const QPoint &))); connect(header(), SIGNAL(sectionResized(int, int, int)), this, SLOT(sColumnSizeChanged(int, int, int))); connect(this, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem *)), SLOT(sCurrentItemChanged(QTreeWidgetItem*, QTreeWidgetItem *))); connect(this, SIGNAL(itemChanged(QTreeWidgetItem*, int)), SLOT(sItemChanged(QTreeWidgetItem*, int))); connect(this, SIGNAL(itemClicked(QTreeWidgetItem*, int)), SLOT(sItemClicked(QTreeWidgetItem*, int))); connect(&_workingTimer, SIGNAL(timeout()), this, SLOT(populateWorker())); emit valid(FALSE); setColumnCount(0); header()->setContextMenuPolicy(Qt::CustomContextMenu); #ifdef Q_WS_MAC QFont f = font(); f.setPointSize(f.pointSize() - 2); setFont(f); #endif // Shortcuts for xtreewidget QAction* menuAct = new QAction(this); menuAct->setShortcut(QKeySequence(tr("Ctrl+M"))); connect(menuAct, SIGNAL(triggered()), this, SLOT(sShowMenu())); addAction(menuAct); QAction* itemSelectedAct = new QAction(this); itemSelectedAct->setShortcut(QKeySequence(QKeySequence::InsertParagraphSeparator)); itemSelectedAct->setShortcutContext(Qt::WidgetShortcut); connect(itemSelectedAct, SIGNAL(triggered()), this, SLOT(sItemSelected())); addAction(itemSelectedAct); } XTreeWidget::~XTreeWidget() { qApp->restoreOverrideCursor(); cleanupAfterPopulate(); if (_subtotals) { for (int i = 0; i < _subtotals->size(); i++) { delete (*_subtotals)[i]; _subtotals->replace(i, 0); } delete _subtotals; _subtotals = 0; } if (_x_preferences) { xtsettingsSetValue( _settingsName + "/isForgetful", _forgetful); xtsettingsSetValue( _settingsName + "/isForgetfulOrder", _forgetfulOrder); QString savedString; if (!_forgetful) { savedString = ""; for (int i = 0; i < header()->count(); i++) { int w = -1; if (_defaultColumnWidths.contains(i)) w = _defaultColumnWidths.value(i); if (!_stretch.contains(i) && header()->sectionSize(i) != w && !header()->isSectionHidden(i)) savedString.append(QString::number(i) + "," + QString::number(header()->sectionSize(i)) + "|"); } xtsettingsSetValue(_settingsName + "/columnWidths", savedString); } if (!_forgetfulOrder && header()->isSortIndicatorShown()) savedString = QString::number(header()->sortIndicatorSection()) + " " + (header()->sortIndicatorOrder() == Qt::AscendingOrder ? "ASC" : "DESC" ); else savedString = "-1,ASC"; xtsettingsSetValue(_settingsName + "/sortOrder", savedString); } for (int i = 0; i < _roles.size(); i++) delete _roles.value(i); _roles.clear(); } void XTreeWidget::populate(const QString &pSql, bool pUseAltId) { XSqlQuery query(pSql); populate(query, pUseAltId); } void XTreeWidget::populate(const QString &pSql, int pIndex, bool pUseAltId) { XSqlQuery query(pSql); populate(query, pIndex, pUseAltId); } void XTreeWidget::populate(XSqlQuery pQuery, bool pUseAltId, PopulateStyle popstyle) { populate(pQuery, id(), pUseAltId, popstyle); } void XTreeWidget::populate(XSqlQuery pQuery, int pIndex, bool pUseAltId, PopulateStyle popstyle) { XTreeWidgetPopulateParams args; args._workingQuery = pQuery; args._workingIndex = pIndex; args._workingUseAlt = pUseAltId; args._workingPopstyle = popstyle; pQuery.seek(-1); if (popstyle == Replace) { clear(); _workingParams.clear(); } _workingParams.append(args); _linear = _alwaysLinear; if (_linear) populateWorker(); else if (! _workingTimer.isActive()) _workingTimer.start(WORKERINTERVAL); } void XTreeWidget::populateWorker() { if (_workingParams.isEmpty()) { if (DEBUG) qDebug("populateWorker called when no arguments were given."); if (_workingTimer.isActive()) _workingTimer.stop(); return; } XTreeWidgetPopulateParams args = _workingParams.first(); XSqlQuery pQuery = args._workingQuery; int pIndex = args._workingIndex; bool pUseAltId = args._workingUseAlt; //PopulateStyle popstyle = args._workingPopstyle; QList topLevelItems; //#13439 if (_linear) qApp->setOverrideCursor(Qt::WaitCursor); if (pIndex < 0) pIndex = id(); // TODO: remove this? i've only found one usage if (_roles.size() <= 0) // old-style populate by column/result order { if (DEBUG) qDebug("%s::populate() old-style", qPrintable(objectName())); if (pQuery.first()) { _fieldCount = pQuery.count(); do { if (pUseAltId) _last = new XTreeWidgetItem(this, _last, pQuery.value(0).toInt(), pQuery.value(1).toInt(), pQuery.value(2).toString()); else _last = new XTreeWidgetItem(this, _last, pQuery.value(0).toInt(), pQuery.value(1)); if (_fieldCount > ((pUseAltId) ? 3 : 2)) for (int col = ((pUseAltId) ? 3 : 2); col < _fieldCount; col++) _last->setText((col - ((pUseAltId) ? 2 : 1)), pQuery.value(col).toString()); } while (pQuery.next()); } } /* initialize if we haven't started reading data from the query, taking into account that some places call xsqlquery::first() before xtreewidget::populate() */ if (pQuery.at() == QSql::BeforeFirstRow || (pQuery.at() == 0 && ! _colIdx)) { if (pQuery.first()) { cleanupAfterPopulate(); // plug memory leaks if last populate() never finished _fieldCount = pQuery.count(); // TODO: rewrite code to use a qmap or some other structure that // doesn't require initializing a Vector or new'd array values _colIdx = new QVector(_roles.size()); _colRole = new QVector(_roles.size(), 0); for (int ref = 0; ref < _roles.size(); ++ref) (*_colRole)[ref] = new int[COLROLE_COUNT]; if (! _subtotals) { _subtotals = new QList *>(); for (int i = 0; i < _fieldCount; i++) _subtotals->append(new QMap()); } QSqlRecord currRecord = pQuery.record(); // apply indent, hidden and delete roles to col 0 if the caller requested them // keep synchronized with #define ROWROLE_* above if (rootIsDecorated()) { _rowRole[ROWROLE_INDENT] = currRecord.indexOf("xtindentrole"); if (_rowRole[ROWROLE_INDENT] < 0) _rowRole[ROWROLE_INDENT] = 0; } else _rowRole[ROWROLE_INDENT] = 0; _rowRole[ROWROLE_HIDDEN] = currRecord.indexOf("xthiddenrole"); if (_rowRole[ROWROLE_HIDDEN] < 0) _rowRole[ROWROLE_HIDDEN] = 0; _rowRole[ROWROLE_DELETED] = currRecord.indexOf("xtdeletedrole"); if (_rowRole[ROWROLE_DELETED] < 0) _rowRole[ROWROLE_DELETED] = 0; // keep synchronized with #define COLROLE_* above // TODO: get rid of COLROLE_* above and replace this QStringList // with a map or vector of known roles and their Qt:: role or Xt // enum values QStringList knownroles; knownroles << "qtdisplayrole" << "qttextalignmentrole"<< "qtbackgroundrole" << "qtforegroundrole"<< "qttooltiprole" << "qtstatustiprole"<< "qtfontrole" << "xtkeyrole"<< "xtrunningrole" << "xtrunninginit"<< "xtgrouprunningrole" << "xttotalrole"<< "xtnumericrole" << "xtnullrole"<< "xtidrole"; for (int wcol = 0; wcol < _roles.size(); wcol++) { QVariantMap *role = _roles.value(wcol); if (!role) { qWarning("XTreeWidget::populate() there is no role for column %d", wcol); continue; } QString colname = role->value("qteditrole").toString(); (*_colIdx)[wcol] = currRecord.indexOf(colname); for (int k = 0; k < knownroles.size(); k++) { // apply Qt roles to a whole row by applying to each column (*_colRole)[wcol][k] = knownroles.at(k).startsWith("qt") ? currRecord.indexOf(knownroles.at(k)) : 0; if ((*_colRole)[wcol][k] > 0) { role->insert(knownroles.at(k), QString(knownroles.at(k))); } else (*_colRole)[wcol][k] = 0; // apply column-specific roles second to override entire row settings if (currRecord.indexOf(colname + "_" + knownroles.at(k)) >=0) { (*_colRole)[wcol][k] = currRecord.indexOf(colname + "_" + knownroles.at(k)); role->insert(knownroles.at(k), QString(colname + "_" + knownroles.at(k))); if (knownroles.at(k) == "xtrunningrole") headerItem()->setData(wcol, Qt::UserRole, "xtrunningrole"); else if (knownroles.at(k) == "xttotalrole") headerItem()->setData(wcol, Qt::UserRole, "xttotalrole"); } } // Negative NUMERIC ROLE => default for column instead of column index // see below if (!(*_colRole)[wcol][COLROLE_NUMERIC] && headerItem()->data(wcol, Xt::ScaleRole).isValid()) { bool ok; int tmpscale = headerItem()->data(wcol, Xt::ScaleRole).toInt(&ok); if (ok) { if (DEBUG) qDebug("setting _colRole[%d][COLROLE_NUMERIC]: %d", wcol, 0-tmpscale); (*_colRole)[wcol][COLROLE_NUMERIC] = 0 - tmpscale; } } } if (_rowRole[ROWROLE_INDENT]) setIndentation( 10); else setIndentation( 0); if (! _linear && ! _progress) { _progress = new XTreeWidgetProgress(this); connect(_progress, SIGNAL(cancel()), &_workingTimer, SLOT(stop())); } if (_progress) { _progress->setValue(0); _progress->setMaximum(pQuery.size()); _progress->show(); } } } int defaultScale = decimalPlaces(""); int cnt = 0; if (pQuery.at() >= 0) // if the query returned any rows at all do { ++cnt; if (!_linear && cnt % WORKERROWS == 0) { this->addTopLevelItems(topLevelItems); //#13439 _progress->setValue(pQuery.at()); return; } int id = pQuery.value(0).toInt(); int altId = (pUseAltId) ? pQuery.value(1).toInt() : -1; int indent = 0; int lastindent = 0; if (_rowRole[ROWROLE_INDENT]) { indent = pQuery.value(_rowRole[ROWROLE_INDENT]).toInt(); if (indent < 0) indent = 0; if (_last) { lastindent = _last->data(0, Xt::IndentRole).toInt(); if (DEBUG) qDebug("getting Xt::IndentRole from %p of %d", _last, lastindent); } } if (DEBUG) qDebug("%s::populate() with id %d altId %d indent %d lastindent %d", qPrintable(objectName()), id, altId, indent, lastindent); QObject *parentItem = 0; XTreeWidgetItem *previousItem = _last; _last = new XTreeWidgetItem((XTreeWidgetItem*)0, id, altId); if (indent == 0) parentItem = this; else if (lastindent < indent) parentItem = previousItem; else if (lastindent == indent) parentItem = dynamic_cast(previousItem->QTreeWidgetItem::parent()); else if (lastindent > indent) { XTreeWidgetItem *prev = (XTreeWidgetItem *)(previousItem->QTreeWidgetItem::parent()); while (prev && prev->data(0, Xt::IndentRole).toInt() >= indent) prev = (XTreeWidgetItem *)(prev->QTreeWidgetItem::parent()); if (prev) parentItem = prev; else parentItem = this; } else parentItem = this; if (_rowRole[ROWROLE_INDENT]) _last->setData(0, Xt::IndentRole, indent); if (_rowRole[ROWROLE_HIDDEN]) { if (DEBUG) qDebug("%s::populate() found xthiddenrole, value = %s", qPrintable( objectName()), qPrintable( pQuery.value(_rowRole[ROWROLE_HIDDEN]).toString())); _last->setHidden(pQuery.value(_rowRole[ROWROLE_HIDDEN]).toBool()); } bool allNull = (indent > 0); for (int col = 0; col < _roles.size(); col++) { QVariantMap *role = _roles.value(col); if (!role) { qWarning("XTreeWidget::populate() there is no role for column %d", col); continue; } QVariant rawValue; if(_colIdx->at(col) >=0) //#13439 optimization - only try to retrieve value if index is valid rawValue = pQuery.value(_colIdx->at(col)); _last->setData(col, Xt::RawRole, rawValue); // TODO: this isn't necessary for all columns so do less often? int scale = defaultScale; QString numericrole = ""; if ((*_colRole)[col][COLROLE_NUMERIC]) { // Negative NUMERIC ROLE => default for column instead of column index // see above if ((*_colRole)[col][COLROLE_NUMERIC] < 0) scale = 0 - (*_colRole)[col][COLROLE_NUMERIC]; else { numericrole = pQuery.value((*_colRole)[col][COLROLE_NUMERIC]).toString(); scale = decimalPlaces(numericrole); } } if ((*_colRole)[col][COLROLE_NUMERIC] || (*_colRole)[col][COLROLE_RUNNING] || (*_colRole)[col][COLROLE_TOTAL]) _last->setData(col, Xt::ScaleRole, scale); /* if qtdisplayrole IS NULL then let the raw value shine through. this allows UNIONS to do interesting things, like put dates and text into the same visual column without SQL errors. */ if ((*_colRole)[col][COLROLE_DISPLAY] && !pQuery.value((*_colRole)[col][COLROLE_DISPLAY]).isNull()) { /* this might not handle PostgreSQL NUMERICs properly but at least it will try to handle INTEGERs and DOUBLEs and it will avoid formatting sales order numbers with decimal and group separators */ QVariant field = pQuery.value((*_colRole)[col][COLROLE_DISPLAY]); if (field.type() == QVariant::Int) _last->setData(col, Qt::DisplayRole, QLocale().toString(field.toInt())); else if (field.type() == QVariant::Double) _last->setData(col, Qt::DisplayRole, QLocale().toString(field.toDouble(), 'f', scale)); else _last->setData(col, Qt::DisplayRole, field.toString()); } else if (rawValue.isNull()) { _last->setData(col, Qt::DisplayRole, (*_colRole)[col][COLROLE_NULL] ? pQuery.value((*_colRole)[col][COLROLE_NULL]).toString() : ""); } else if ((*_colRole)[col][COLROLE_NUMERIC] && ((numericrole == "percent") || (numericrole == "scrap"))) { _last->setData(col, Qt::DisplayRole, QLocale().toString(rawValue.toDouble() * 100.0, 'f', scale)); } else if ((*_colRole)[col][COLROLE_NUMERIC] || rawValue.type() == QVariant::Double) { // Issue #8897 _last->setData(col, Qt::DisplayRole, QLocale().toString(round(rawValue.toDouble(), scale), 'f', scale)); } else if (rawValue.type() == QVariant::Bool) { _last->setData(col, Qt::DisplayRole, rawValue.toBool() ? yesStr : noStr); } else { _last->setData(col, Qt::EditRole, rawValue); } if (indent) { if (!(*_colRole)[col][COLROLE_DISPLAY] || ((*_colRole)[col][COLROLE_DISPLAY] && pQuery.value((*_colRole)[col][COLROLE_DISPLAY]).isNull())) allNull &= (rawValue.isNull() || rawValue.toString().isEmpty()); else allNull &= pQuery.value((*_colRole)[col][COLROLE_DISPLAY]).isNull() || pQuery.value((*_colRole)[col][COLROLE_DISPLAY]).toString().isEmpty(); if (DEBUG) qDebug("%s::populate() allNull = %d at %d for rawValue %s", qPrintable( objectName()), allNull, col, qPrintable( rawValue.toString())); } if ((*_colRole)[col][COLROLE_FOREGROUND]) { QVariant fg = pQuery.value((*_colRole)[col][COLROLE_FOREGROUND]); if (!fg.isNull()) _last->setData(col, Qt::ForegroundRole, namedColor(fg.toString())); } if ((*_colRole)[col][COLROLE_BACKGROUND]) { QVariant bg = pQuery.value((*_colRole)[col][COLROLE_BACKGROUND]); if (!bg.isNull()) _last->setData(col, Qt::BackgroundRole, namedColor(bg.toString())); } if ((*_colRole)[col][COLROLE_TEXTALIGNMENT]) { QVariant alignment = pQuery.value((*_colRole)[col][COLROLE_TEXTALIGNMENT]); if (!alignment.isNull()) _last->setData(col, Qt::TextAlignmentRole, alignment); } else _last->setData(col, Qt::TextAlignmentRole, headerItem()->textAlignment(col)); if ((*_colRole)[col][COLROLE_TOOLTIP]) { QVariant tooltip = pQuery.value((*_colRole)[col][COLROLE_TOOLTIP]); if (!tooltip.isNull() ) _last->setData(col, Qt::ToolTipRole, tooltip); } if ((*_colRole)[col][COLROLE_STATUSTIP]) { QVariant statustip = pQuery.value((*_colRole)[col][COLROLE_STATUSTIP]); if (!statustip.isNull()) _last->setData(col, Qt::StatusTipRole, statustip); } if ((*_colRole)[col][COLROLE_FONT]) { QVariant font = pQuery.value((*_colRole)[col][COLROLE_FONT]); if (!font.isNull()) _last->setData(col, Qt::FontRole, font); } if ((*_colRole)[col][COLROLE_RUNNINGINIT]) { QVariant runninginit = pQuery.value((*_colRole)[col][COLROLE_RUNNINGINIT]); if (!runninginit.isNull()) _last->setData(col, Xt::RunningInitRole, runninginit); } if ((*_colRole)[col][COLROLE_ID]) { QVariant id = pQuery.value((*_colRole)[col][COLROLE_ID]); if (!id.isNull()) _last->setData(col, Xt::IdRole, id); } if ((*_colRole)[col][COLROLE_RUNNING]) { int set = pQuery.value((*_colRole)[col][COLROLE_RUNNING]).toInt(); _last->setData(col, Xt::RunningSetRole, set); /* performance hack - populateCalculatedColumns will repeat this but only redraw if necessary. redraw is much slower than recalc. */ if (! _subtotals->at(col)->contains(set)) { if ((*_colRole)[col][COLROLE_RUNNINGINIT]) (*_subtotals)[col]->insert(set, pQuery.value((*_colRole)[col][COLROLE_RUNNINGINIT]).toDouble()); else (*_subtotals)[col]->insert(set, 0.0); } (*(*_subtotals)[col])[set] += rawValue.toDouble(); _last->setData(col, Qt::DisplayRole, QLocale().toString((*_subtotals)[col]->value(set), 'f', scale)); } if ((*_colRole)[col][COLROLE_TOTAL]) { _last->setData(col, Xt::TotalSetRole, pQuery.value((*_colRole)[col][COLROLE_TOTAL]).toInt()); } if (_rowRole[ROWROLE_DELETED]) { if (DEBUG) qDebug("%s::populate() found xtdeleterole, value = %s", qPrintable( objectName()), qPrintable( pQuery.value(_rowRole[ROWROLE_DELETED]).toString())); if (pQuery.value(_rowRole[ROWROLE_DELETED]).toBool()) { _last->setData(col,Xt::DeletedRole, QVariant(true)); QFont font = _last->font(col); font.setStrikeOut(true); _last->setFont(col, font); _last->setTextColor(Qt::gray); } } /* if ((*_colRole)[col][COLROLE_KEY]) _last->setData(col, KeyRole, pQuery.value((*_colRole)[col][COLROLE_KEY])); if ((*_colRole)[col][COLROLE_GROUPRUNNING]) _last->setData(col, GroupRunningRole, pQuery.value((*_colRole)[col][COLROLE_GROUPRUNNING])); */ } if (allNull && indent > 0) { qWarning("%s::populate() hiding indented row because it's empty", qPrintable(objectName())); _last->setHidden(true); } if (qobject_cast(parentItem)) { //#13439 optimization - do not add items to 'this' until the very end if(parentItem == this) topLevelItems.append(_last); else qobject_cast(parentItem)->addTopLevelItem(_last); } else if (qobject_cast(parentItem)) qobject_cast(parentItem)->addChild(_last); } while (pQuery.next()); this->addTopLevelItems(topLevelItems); //#13439 setId(pIndex); emit valid(currentItem() != 0); // clean up. we won't reach here until the query is done, even if ! _linear { _workingTimer.stop(); if (_workingParams.size()) _workingParams.takeFirst(); cleanupAfterPopulate(); populateCalculatedColumns(); if (sortColumn() >= 0 && header()->isSortIndicatorShown()) sortItems(sortColumn(), header()->sortIndicatorOrder()); if (DEBUG) qDebug("%s::populateWorker() done", qPrintable(objectName())); emit populated(); } if (_linear) qApp->restoreOverrideCursor(); } void XTreeWidget::cleanupAfterPopulate() { if (_progress) _progress->hide(); for (unsigned int i = 0; i < sizeof(_rowRole) / sizeof(_rowRole[0]); i++) _rowRole[i] = 0; _last = 0; // TODO: get rid of this when the code is rewritten // as per above's todo about the QVector if (_colRole) { for (int ref = 0; ref < _roles.size(); ++ref) { if ((*_colRole)[ref]) delete [] (*_colRole)[ref]; } delete _colRole; _colRole = 0; } if (_colIdx) delete _colIdx; _colIdx = 0; _fieldCount = 0; } void XTreeWidget::addColumn(const QString &pString, int pWidth, int pAlignment, bool pVisible, const QString pEditColumn, const QString pDisplayColumn, const int scale) { if (!_settingsLoaded) { _settingsLoaded = true; QString pname; if (window()) { pname = window()->objectName() + "/"; if (parentWidget()) { if (parentWidget()->objectName() != window()->objectName()) pname += parentWidget()->objectName() + "/"; } } _settingsName = pname + objectName(); // Load any previously saved information about column widths _forgetful = xtsettingsValue(_settingsName + "/isForgetful").toBool(); _forgetfulOrder = xtsettingsValue(_settingsName + "/isForgetfulOrder").toBool(); QString savedString; QStringList savedParts; QString part, key, val; bool b1 = false, b2 = false; if (!_forgetful) { savedString = xtsettingsValue(_settingsName + "/columnWidths").toString(); savedParts = savedString.split("|", QString::SkipEmptyParts); for (int i = 0; i < savedParts.size(); i++) { part = savedParts.at(i); key = part.left(part.indexOf(",")); val = part.right(part.length() - part.indexOf(",") - 1); b1 = false; b2 = false; int k = key.toInt(&b1); int v = val.toInt(&b2); if (b1 && b2) _savedColumnWidths.insert(k, v); } } if (!_forgetfulOrder) { part = xtsettingsValue(_settingsName + "/sortOrder", "-1,ASC").toString(); key = part.left(part.indexOf(" ")); val = part.right(part.length() - part.indexOf(" ") - 1); b1 = false; int k = key.toInt(&b1); if (b1) { _scol = k; _sord = ("ASC" == val ? Qt::AscendingOrder : Qt::DescendingOrder); } } // Load any previously saved column hidden/visible information if (_x_preferences) { savedString = _x_preferences->value(_settingsName + "/columnsShown"); if (!savedString.contains("on")) savedString = ""; savedParts = savedString.split("|", QString::SkipEmptyParts); for (int i = 0; i < savedParts.size(); i++) { part = savedParts.at(i); key = part.left(part.indexOf(",")); val = part.right(part.length() - part.indexOf(",") - 1); int c = key.toInt(&b1); if (b1 && (val == "on" || val == "off")) _savedVisibleColumns.insert(c, (val == "on" ? true : false)); } } } int column = columnCount(); setColumnCount(column + 1); QTreeWidgetItem *hitem = headerItem(); hitem->setText(column, pString); hitem->setTextAlignment(column, pAlignment); hitem->setData(column, Xt::ScaleRole, scale); if (!pEditColumn.isEmpty()) { QVariantMap *roles = new QVariantMap(); roles->insert("qteditrole", pEditColumn); if (!pDisplayColumn.isEmpty()) roles->insert("qtdisplayrole", pDisplayColumn); _roles.insert(column, roles); } _defaultColumnWidths.insert(column, pWidth); if (_savedColumnWidths.contains(column)) pWidth = _savedColumnWidths.value(column); if (pWidth >= 0) { header()->resizeSection(column, pWidth); header()->setResizeMode(column, QHeaderView::Interactive); } else { header()->setResizeMode(column, QHeaderView::Interactive); _stretch.append(column); } bool forgetCache = _forgetful; _forgetful = true; setColumnVisible(column, _savedVisibleColumns.value(column, pVisible)); _forgetful = forgetCache; if (_scol >= 0 && column == _scol) { if (!header()->isSortIndicatorShown()) header()->setSortIndicatorShown(true); sortItems(_scol, _sord); } } int XTreeWidget::column(const QString pName) const { int colIdx = -1; for (int i = 0; i < _roles.size(); i++) { if (_roles.value(i)->value("qteditrole").toString() == pName) { colIdx = i; break; } } return colIdx; } XTreeWidgetItem *XTreeWidget::currentItem() const { return (XTreeWidgetItem *)QTreeWidget::currentItem(); } void XTreeWidget::hideColumn(const QString &pColumn) { int colnum = column(pColumn); if (colnum >= 0) QTreeWidget::hideColumn(colnum); } void XTreeWidget::showColumn(const QString &pColumn) { int colnum = column(pColumn); if (colnum >= 0) QTreeWidget::showColumn(colnum); } XTreeWidgetItem *XTreeWidget::topLevelItem(int idx) const { return (XTreeWidgetItem *)QTreeWidget::topLevelItem(idx); } QString XTreeWidgetItem::toString() const { return QString(id()); } bool XTreeWidgetItem::operator<(const XTreeWidgetItem &other) const { QVariant v1 = data(treeWidget()->sortColumn(), Xt::RawRole); QVariant v2 = other.data(other.treeWidget()->sortColumn(), Xt::RawRole); bool returnVal = false; switch (v1.type()) { case QVariant::Bool: returnVal = (!v1.toBool() && v1 != v2); break; case QVariant::Date: returnVal = (v1.toDate() < v2.toDate()); break; case QVariant::DateTime: returnVal = (v1.toDateTime() < v2.toDateTime()); break; case QVariant::Double: returnVal = (v1.toDouble() < v2.toDouble()); break; case QVariant::Int: returnVal = (v1.toInt() < v2.toInt()); break; case QVariant::LongLong: returnVal = (v1.toLongLong() < v2.toLongLong()); break; case QVariant::String: bool ok; if (v1.toString().toDouble() == 0.0 && v2.toDouble() == 0.0) returnVal = (v1.toString() < v2.toString()); else if (v1.toString().toDouble() == 0.0 && v2.toDouble(&ok)) //v1 is string, v2 is number returnVal = false; //the number should always be treated as greater than a string else if (v1.toDouble(&ok) && v2.toString().toDouble() == 0.0) returnVal = true; else returnVal = (v1.toDouble() < v2.toDouble()); break; default: returnVal = false; } if (DEBUG) qDebug("returning %d for %s < %s", returnVal, qPrintable(v1.toString()), qPrintable(v2.toString())); return returnVal; } bool XTreeWidgetItem::operator==(const XTreeWidgetItem &other) const { QVariant v1 = data(treeWidget()->sortColumn(), Xt::RawRole); QVariant v2 = other.data(other.treeWidget()->sortColumn(), Xt::RawRole); bool returnVal = false; switch (v1.type()) { case QVariant::Bool: returnVal = (v1.toBool() && v1 == v2); break; case QVariant::Date: returnVal = (v1.toDate() == v2.toDate()); break; case QVariant::DateTime: returnVal = (v1.toDateTime() == v2.toDateTime()); break; case QVariant::Double: returnVal = (v1.toDouble() == v2.toDouble()); break; case QVariant::Int: returnVal = (v1.toInt() == v2.toInt()); break; case QVariant::LongLong: returnVal = (v1.toLongLong() == v2.toLongLong()); break; case QVariant::String: if (v1.toString().toDouble() == 0.0 && v2.toDouble() == 0.0) returnVal = (v1.toString() == v2.toString()); else returnVal = (v1.toDouble() == v2.toDouble()); break; default: returnVal = false; } if (DEBUG) qDebug("returning %d for %s == %s", returnVal, qPrintable(v1.toString()), qPrintable(v2.toString())); return returnVal; } /* don't need this yet bool XTreeWidgetItem::operator>(const XTreeWidgetItem &other) const { return !(this < other || this == other); } */ void XTreeWidget::sortItems(int column, Qt::SortOrder order) { int previd = id(); // if old style then maintain backwards compatibility if (_roles.size() <= 0) { QTreeWidget::sortItems(column, order); return; } if (column < 0 || column >= columnCount() || headerItem()->data(column, Qt::UserRole).toString() == "xtrunningrole") return; header()->setSortIndicator(column, order); // simple insertion sort using binary search to find the right insertion pt QString totalrole("totalrole"); int itemcount = topLevelItemCount(); XTreeWidgetItem *prev = dynamic_cast(topLevelItem(0)); for (int i = 1; i < itemcount; i++) { XTreeWidgetItem *item = dynamic_cast(topLevelItem(i)); if (!item) { qWarning("removing a non-XTreWidgetItem from an XTreeWidget"); takeTopLevelItem(i); itemcount--; i--; } else if (item->data(0, Qt::UserRole).toString() == totalrole) { if (DEBUG) qDebug("sortItems() removing row %d because it's a totalrole", i); takeTopLevelItem(i); itemcount--; i--; } else if (*item < *prev && order == Qt::AscendingOrder) { int left = 0; int right = i; int middle = 0; XTreeWidgetItem *test = 0; while (left <= right) { middle = (left + right) / 2; test = static_cast(topLevelItem(middle)); if (*test == *item) break; else if (*test < *item) { if (*item < *(static_cast(topLevelItem(middle + 1)))) break; else left = middle + 1; } else right = middle - 1; } // can't call takeTopLevelItem() until after < and == are done if (*item < *test || *item == *test) { if (DEBUG) qDebug("<= so moving %d to %d", i, middle); takeTopLevelItem(i); insertTopLevelItem(middle, item); } else { if (DEBUG) qDebug("> so moving %d to %d", i, middle + 1); takeTopLevelItem(i); insertTopLevelItem(middle + 1, item); } } else if (*item == *prev) { ; // nothing to do - make the > case easier to write } else if (!(*item < *prev) && order == Qt::DescendingOrder) { int left = 0; int right = i; int middle = 0; XTreeWidgetItem *test = 0; while (left <= right) { middle = (left + right) / 2; test = static_cast(topLevelItem(middle)); if (*test == *item) break; else if (!(*test < *item)) { if (!(*item < *(static_cast(topLevelItem(middle + 1))))) break; else left = middle + 1; } else right = middle - 1; } // can't call takeTopLevelItem() until after < and == are done if (!(*item < *test) || *item == *test) { if (DEBUG) qDebug(">= so moving %d to %d", i, middle); takeTopLevelItem(i); insertTopLevelItem(middle, item); } else { if (DEBUG) qDebug("< so moving %d to %d", i, middle + 1); takeTopLevelItem(i); insertTopLevelItem(middle + 1, item); } } // can't reuse item because the thing in position i may have changed prev = static_cast(topLevelItem(i)); } populateCalculatedColumns(); setId(previd); emit resorted(); } void XTreeWidget::populateCalculatedColumns() { QMap > totals; // > QMap scales; // keep scale for the col, not col[totalset] for (int col = 0; topLevelItem(0) && col < topLevelItem(0)->columnCount(); col++) { if (headerItem()->data(col, Qt::UserRole).toString() == "xtrunningrole") { QMap subtotals; // assume that Xt::RunningSetRole exists if xtrunningrole exists for (int row = 0; row < topLevelItemCount(); row++) { int set = topLevelItem(row)->data(col, Xt::RunningSetRole).toInt(); if (!subtotals.contains(set)) subtotals[set] = topLevelItem(row)->data(col, Xt::RunningInitRole).toDouble(); subtotals[set] += topLevelItem(row)->data(col, Xt::RawRole).toDouble(); // setData apparently knows if the value hasn't changed topLevelItem(row)->setData(col, Qt::DisplayRole, QLocale().toString(subtotals[set], 'f', topLevelItem(row)->data(col, Xt::ScaleRole).toInt())); } } else if (headerItem()->data(col, Qt::UserRole).toString() == "xttotalrole") { QMap totalset; int colscale = -99999; // assume that Xt::TotalSetRole exists if xttotalrole exists for (int row = 0; row < topLevelItemCount(); row++) { int set = topLevelItem(row)->data(col, Xt::TotalSetRole).toInt(); if (!totalset.contains(set)) totalset[set] = topLevelItem(row)->data(col, Xt::TotalInitRole).toInt(); totalset[set] += topLevelItem(row)->totalForItem(col, set); if (topLevelItem(row)->data(col, Xt::ScaleRole).toInt() > colscale) colscale = topLevelItem(row)->data(col, Xt::ScaleRole).toInt(); } totals.insert(col, totalset); scales.insert(col, colscale); } } // punt: for now only report values of totalset[0] for each totaled col // TODO: figure out how to handle multiple totalsets if (totals.size() > 0) { XTreeWidgetItem *last = new XTreeWidgetItem(this, -1, -1, (totals.size() == 1) ? tr("Total") : tr("Totals")); last->setData(0, Qt::UserRole, "totalrole"); QMapIterator > it(totals); while (it.hasNext()) { it.next(); last->setData(it.key(), Qt::DisplayRole, QLocale().toString(it.value().value(0), 'f', scales.value(it.key()))); } } } int XTreeWidget::id() const { QList items = selectedItems(); if (items.count() > 0) { XTreeWidgetItem *item = items.at(0); return item->_id; } return -1; } int XTreeWidget::id(const QString p) const { QList items = selectedItems(); if (items.count() > 0) { int id = items.at(0)->data(column(p), Xt::IdRole).toInt(); if (DEBUG) qDebug("XTreeWidget::id(%s - column %d) returning %d", qPrintable(p), column(p), id); return id; } return -1; } int XTreeWidget::altId() const { QList items = selectedItems(); if (items.count() > 0) { XTreeWidgetItem *item = items.at(0); return item->_altId; } return -1; } /*! Selects a row with a matching value \a pId on the first column in the result set. If \a pClear is true then any previous selections are cleared. */ void XTreeWidget::setId(int pId, bool pClear) { if (pId < 0) return; QItemSelectionModel::SelectionFlag flag; if (pClear) flag = QItemSelectionModel::ClearAndSelect; else flag = QItemSelectionModel::Select; XTreeWidgetItem *item = (XTreeWidgetItem *)topLevelItem(0); QTreeWidgetItem *found = 0; while (item) { if (item && item->id() == pId) found = item; else if (item && item->childCount() > 0) found = searchChildren(item, pId); if (found) break; item = (XTreeWidgetItem *)itemBelow(item); } if (found) { scrollToItem(found); QModelIndex i = indexFromItem(found); selectionModel()->setCurrentIndex(i, flag | QItemSelectionModel::Rows); } } // This is a static local function to help searching children recursively QTreeWidgetItem *searchChildren(XTreeWidgetItem *parent, int pId) { if (!parent) return 0; XTreeWidgetItem *item = 0; QTreeWidgetItem *found = 0; for (int i = 0; i < parent->childCount(); ++i) { item = (XTreeWidgetItem *)parent->child(i); if (item && item->id() == pId) found = item; else if (item && item->childCount() > 0) found = searchChildren(item, pId); if (found) return found; } return 0; } /*! Selects a row with a matching values \a pId and \a pAltId on the first and second columns respectively in the result set. If \a pClear is true then any previous selections are cleared. */ void XTreeWidget::setId(int pId, int pAltId, bool pClear) { if (pId < 0) return; QItemSelectionModel::SelectionFlag flag; if (pClear) flag = QItemSelectionModel::ClearAndSelect; else flag = QItemSelectionModel::Select; for (QModelIndex i = indexFromItem(topLevelItem(0)); i.isValid(); i = indexBelow(i)) { XTreeWidgetItem *item = (XTreeWidgetItem *)itemFromIndex(i); if (item && item->id() == pId && item->altId() == pAltId) { selectionModel()->setCurrentIndex(i, flag | QItemSelectionModel::Rows); return; } } } QString XTreeWidget:: dragString() const { return _dragString; } void XTreeWidget:: setDragString(QString pDragString) { _dragString = pDragString; } QString XTreeWidget:: altDragString() const { return _altDragString; } void XTreeWidget:: setAltDragString(QString pAltDragString) { _altDragString = pAltDragString; } bool XTreeWidget::populateLinear() { return _alwaysLinear; } void XTreeWidget::setPopulateLinear(bool alwaysLinear) { _alwaysLinear = alwaysLinear; } void XTreeWidget::clear() { if (DEBUG) qDebug("%s::clear()", qPrintable(objectName())); if (! _workingTimer.isActive()) _workingParams.clear(); if (_subtotals) { for (int i = 0; i < _subtotals->size(); i++) { delete (*_subtotals)[i]; _subtotals->replace(i, 0); } delete _subtotals; _subtotals = 0; } emit valid(FALSE); _savedId = false; // was -1; QTreeWidget::clear(); } void XTreeWidget::sSelectionChanged() { QList items = selectedItems(); if (items.count() > 0) { XTreeWidgetItem *item = items.at(0); emit valid(true); emit newId(item->_id); } else { emit valid(false); emit newId(-1); } } void XTreeWidget::sItemSelected() { QList selected = selectedItems(); if (selected.count()) sItemSelected(selected.at(0), 0); } void XTreeWidget::sItemSelected(QTreeWidgetItem *pSelected, int) { if (pSelected) emit itemSelected(((XTreeWidgetItem *)pSelected)->_id); } void XTreeWidget::sShowMenu() { QList selected = selectedItems(); if (selected.count()) { QRect rect = this->visualItemRect(selected.at(0)); QPoint point = rect.bottomRight(); sShowMenu(point); } } void XTreeWidget::sShowMenu(const QPoint &pntThis) { XTreeWidgetItem *item = (XTreeWidgetItem *)itemAt(pntThis); int logicalColumn = indexAt(pntThis).column(); if (item) { _menu->clear(); if (item->data(0, Qt::UserRole).toString() != "totalrole") { emit populateMenu(_menu, (QTreeWidgetItem *)item); emit populateMenu(_menu, (QTreeWidgetItem *)item, logicalColumn); emit populateMenu(_menu, item); emit populateMenu(_menu, item, logicalColumn); } bool disableExport = FALSE; if (_x_preferences) disableExport = (_x_preferences->value("DisableExportContents")=="t"); if (!disableExport) { _menu->addSeparator(); QMenu* copyMenu = _menu->addMenu(tr("Copy to Clipboard")); copyMenu->addAction(tr("All"), this, SLOT(sCopyVisibleToClipboard())); copyMenu->addAction(tr("Row"), this, SLOT(sCopyRowToClipboard())); copyMenu->addAction(tr("Cell"), this, SLOT(sCopyCellToClipboard())); _menu->addSeparator(); _menu->addAction(tr("Export As..."), this, SLOT(sExport())); } if(! _menu->isEmpty()) _menu->popup(mapToGlobal(pntThis)); } } void XTreeWidget::sShowHeaderMenu(const QPoint &pntThis) { _menu->clear(); int logicalIndex = header()->logicalIndexAt(pntThis); int currentSize = header()->sectionSize(logicalIndex); // If we have a default value and the current size is not equal to that default value // then we want to show the menu items for resetting those values back to default if (_defaultColumnWidths.contains(logicalIndex) && (!_stretch.contains(logicalIndex)) && (_defaultColumnWidths.value(logicalIndex) != currentSize) ) { _resetWhichWidth = logicalIndex; _menu->addAction(tr("Reset this Width"), this, SLOT(sResetWidth())); } _menu->addAction(tr("Reset all Widths"), this, SLOT(sResetAllWidths())); _menu->addSeparator(); if (_forgetful) _menu->addAction(tr("Remember Widths"), this, SLOT(sToggleForgetfulness())); else _menu->addAction(tr("Do Not Remember Widths"), this, SLOT(sToggleForgetfulness())); if (_forgetfulOrder) _menu->addAction(tr("Remember Sort Order"), this, SLOT(sToggleForgetfulnessOrder())); else _menu->addAction(tr("Do Not Remember Sort Order"), this, SLOT(sToggleForgetfulnessOrder())); _menu->addSeparator(); QTreeWidgetItem *hitem = headerItem(); for (int i = 0; i < header()->count(); i++) { QAction *act = _menu->addAction(hitem->text(i)); act->setCheckable(true); act->setChecked(!header()->isSectionHidden(i)); act->setEnabled(!_lockedColumns.contains(i)); QMap m; m.insert("command", QVariant("toggleColumnHidden")); m.insert("column", QVariant(i)); act->setData(m); connect(_menu, SIGNAL(triggered(QAction *)), this, SLOT(popupMenuActionTriggered(QAction *))); } if(! _menu->isEmpty()) _menu->popup(mapToGlobal(pntThis)); } void XTreeWidget::sExport() { QString path = xtsettingsValue(_settingsName + "/exportPath").toString(); QString selectedFilter; QFileInfo fi(QFileDialog::getSaveFileName(this, tr("Export Save Filename"), path, tr("Text CSV (*.csv);;Text (*.txt);;ODF Text Document (*.odt);;HTML Document (*.html)"), &selectedFilter)); QString defaultSuffix; if(selectedFilter.contains("csv")) defaultSuffix = ".csv"; else if(selectedFilter.contains("odt")) defaultSuffix = ".odt"; else if(selectedFilter.contains("html")) defaultSuffix = ".html"; else defaultSuffix = ".txt"; if (!fi.filePath().isEmpty()) { QTextDocument *doc = new QTextDocument(); QTextDocumentWriter writer; if (fi.suffix().isEmpty()) fi.setFile(fi.filePath() += defaultSuffix); xtsettingsSetValue(_settingsName + "/exportPath", fi.path()); writer.setFileName(fi.filePath()); if (fi.suffix() == "txt") { doc->setPlainText(toTxt()); writer.setFormat("plaintext"); } else if (fi.suffix() == "csv") { doc->setPlainText(toCsv()); writer.setFormat("plaintext"); } else if (fi.suffix() == "odt") { doc->setHtml(toHtml()); writer.setFormat("odf"); } else if (fi.suffix() == "html") { doc->setHtml(toHtml()); writer.setFormat("HTML"); } writer.write(doc); } } void XTreeWidget::mousePressEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) dragStartPosition = event->pos(); QTreeWidget::mousePressEvent(event); } void XTreeWidget::mouseMoveEvent(QMouseEvent *event) { if (!(event->buttons() & Qt::LeftButton) || (_dragString.isEmpty() && _altDragString.isEmpty())) return; if ((event->pos() - dragStartPosition).manhattanLength()< QApplication::startDragDistance()) return; QString dragDescription; if (_dragString.length()) dragDescription = _dragString + QString("%1").arg(id()); if (_altDragString.length()) { if (dragDescription.length()) dragDescription += ","; dragDescription += _altDragString + QString("%1").arg(altId()); } QDrag *drag = new QDrag(this); QMimeData *mimeData = new QMimeData; // mimeData->setData("text/plain", dragDescription.toLatin1()); mimeData->setText(dragDescription); drag->setMimeData(mimeData); /*Qt::DropAction dropAction =*/ drag->start(Qt::CopyAction); QTreeWidget::mouseMoveEvent(event); } void XTreeWidget::sHeaderClicked(int column) { // Qt::SortOrder sortOrder = Qt::DescendingOrder; if (!header()->isSortIndicatorShown()) header()->setSortIndicatorShown(true); sortItems(column, header()->sortIndicatorOrder()); } void XTreeWidget::sColumnSizeChanged(int logicalIndex, int /*oldSize*/, int /*newSize*/) { if (_resizingInProcess || _stretch.count() < 1) return; if (_stretch.contains(logicalIndex)) _stretch.remove(_stretch.indexOf(logicalIndex)); _resizingInProcess = true; int usedSpace = 0; int stretchCount = 0; for (int i = 0; i < header()->count(); i++) { if (logicalIndex == i || !_stretch.contains(i)) usedSpace += header()->sectionSize(i); else stretchCount++; } int w = viewport()->width(); if (stretchCount > 0) { int leftover = (w - usedSpace) / stretchCount; if (leftover < 50) leftover = 50; for (int n = 0; n < _stretch.count(); n++) if (_stretch.at(n) != logicalIndex) header()->resizeSection(_stretch.at(n), leftover); } _resizingInProcess = false; } void XTreeWidget::resizeEvent(QResizeEvent *e) { QTreeWidget::resizeEvent(e); sColumnSizeChanged(-1, 0, 0); } void XTreeWidget::sResetWidth() { int w = _defaultColumnWidths.value(_resetWhichWidth); if (w >= 0) header()->resizeSection(_resetWhichWidth, w); else { if (!_stretch.contains(_resetWhichWidth)) _stretch.append(_resetWhichWidth); sColumnSizeChanged(-1, 0, 0); } } void XTreeWidget::sResetAllWidths() { QMapIterator it(_defaultColumnWidths); bool autoSections = false; while (it.hasNext()) { it.next(); if (it.value() >= 0) header()->resizeSection(it.key(), it.value()); else { if (!_stretch.contains(it.key())) { _stretch.append(it.key()); autoSections = true; } } } if (autoSections) sColumnSizeChanged(-1, 0, 0); } void XTreeWidget::sToggleForgetfulness() { _forgetful = !_forgetful; } void XTreeWidget::sToggleForgetfulnessOrder() { _forgetfulOrder = !_forgetfulOrder; } void XTreeWidget::setColumnVisible(int pColumn, bool pVisible) { if (pVisible) header()->showSection(pColumn); else header()->hideSection(pColumn); // Save changes to db if (!_forgetful) { QString savedString = ""; for (int i = 0; i < header()->count(); i++) { savedString.append(QString::number(i) + "," + (header()->isSectionHidden(i) ? "off" : "on") + "|"); } if (!savedString.isEmpty()) _x_preferences->set(_settingsName + "/columnsShown", savedString); else _x_preferences->remove(_settingsName + "/columnsShown"); } } void XTreeWidget::popupMenuActionTriggered(QAction *pAction) { QMap m = pAction->data().toMap(); QString command = m.value("command").toString(); if ("toggleColumnHidden" == command) { setColumnVisible(m.value("column").toInt(), pAction->isChecked()); } // else if (some other command to handle) } void XTreeWidget::setColumnCount(int p) { for (int i = columnCount(); i > p; i--) _roles.remove(i - 1); QTreeWidget::setColumnCount(p); } void XTreeWidget::setColumnLocked(int pColumn, bool pLocked) { if (pLocked) { if (!_lockedColumns.contains(pColumn)) _lockedColumns.append(pColumn); } else _lockedColumns.removeAll(pColumn); } XTreeWidgetItem *XTreeWidget::findXTreeWidgetItemWithId(const XTreeWidget *ptree, const int pid) { if (pid < 0) return 0; for (int i = 0; i < ptree->topLevelItemCount(); i++) { XTreeWidgetItem *item = ptree->topLevelItem(i); if (item->id() == pid) return item; else { item = findXTreeWidgetItemWithId(item, pid); if (item) return item; } } return 0; } XTreeWidgetItem *XTreeWidget::findXTreeWidgetItemWithId(const XTreeWidgetItem *ptreeitem, const int pid) { if (pid < 0) return 0; for (int i = 0; i < ptreeitem->childCount(); i++) { XTreeWidgetItem *item = ptreeitem->child(i); if (item->id() == pid) return item; else { item = findXTreeWidgetItemWithId(item, pid); if (item) return item; } } return 0; } XTreeWidgetItem::XTreeWidgetItem( XTreeWidgetItem *itm, int pId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(itm) { constructor(pId, -1, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } XTreeWidgetItem::XTreeWidgetItem( XTreeWidgetItem *itm, int pId, int pAltId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(itm) { constructor(pId, pAltId, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } XTreeWidgetItem::XTreeWidgetItem( XTreeWidget *pParent, int pId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(pParent) { constructor(pId, -1, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } XTreeWidgetItem::XTreeWidgetItem( XTreeWidget *pParent, int pId, int pAltId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(pParent) { constructor(pId, pAltId, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } XTreeWidgetItem::XTreeWidgetItem( XTreeWidget *pParent, XTreeWidgetItem *itm, int pId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(pParent, itm) { constructor(pId, -1, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } XTreeWidgetItem::XTreeWidgetItem( XTreeWidget *pParent, XTreeWidgetItem *itm, int pId, int pAltId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(pParent, itm) { constructor(pId, pAltId, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } XTreeWidgetItem::XTreeWidgetItem( XTreeWidgetItem *pParent, XTreeWidgetItem *itm, int pId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(pParent, itm) { constructor(pId, -1, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } XTreeWidgetItem::XTreeWidgetItem( XTreeWidgetItem *pParent, XTreeWidgetItem *itm, int pId, int pAltId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) : QObject(), QTreeWidgetItem(pParent, itm) { constructor(pId, pAltId, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10); } void XTreeWidgetItem::constructor(int pId, int pAltId, QVariant v0,QVariant v1, QVariant v2,QVariant v3, QVariant v4,QVariant v5, QVariant v6,QVariant v7, QVariant v8,QVariant v9, QVariant v10 ) { _id = pId; _altId = pAltId; if (!v0.isNull()) setText(0, v0); if (!v1.isNull()) setText(1, v1); if (!v2.isNull()) setText(2, v2); if (!v3.isNull()) setText(3, v3); if (!v4.isNull()) setText(4, v4); if (!v5.isNull()) setText(5, v5); if (!v6.isNull()) setText(6, v6); if (!v7.isNull()) setText(7, v7); if (!v8.isNull()) setText(8, v8); if (!v9.isNull()) setText(9, v9); if (!v10.isNull()) setText(10, v10); if (treeWidget()) { QTreeWidgetItem *header = treeWidget()->headerItem(); for (int i = 0; i < header->columnCount(); i++) setTextAlignment(i, header->textAlignment(i)); } } int XTreeWidgetItem::id(const QString p) { int id = data(((XTreeWidget *)treeWidget())->column(p), Xt::IdRole).toInt(); if (DEBUG) qDebug("XTreeWidgetItem::id(%s - column %d) returning %d", qPrintable(p), ((XTreeWidget *)treeWidget())->column(p), id); return id; } void XTreeWidgetItem::setTextColor(const QColor &pColor) { for (int cursor = 0; cursor < columnCount(); cursor++) QTreeWidgetItem::setTextColor(cursor, pColor); } void XTreeWidgetItem::setText(int pColumn, const QVariant &pVariant) { QTreeWidgetItem::setText(pColumn, pVariant.toString()); } QString XTreeWidgetItem::text(const QString &pColumn) const { return text(((XTreeWidget *)treeWidget())->column(pColumn)); } QVariant XTreeWidgetItem::rawValue(const QString pName) { int colIdx = ((XTreeWidget *)treeWidget())->column(pName); if (colIdx < 0) return QVariant(); else return data(colIdx, Xt::RawRole); } /* Calculate the total for a particular XTreeWidgetItem, including any children. pcol is the column for which we want the total. prole is the value of xttotalrole for which we want the total. See elsewhere for the meaning of xttotalrole values. */ double XTreeWidgetItem::totalForItem(const int pcol, const int pset) const { double total = 0.0; if (pset == data(pcol, Xt::TotalSetRole).toInt()) total += data(pcol, Xt::RawRole).toDouble(); for (int i = 0; i < childCount(); i++) total += child(i)->totalForItem(pcol, pset); return total; } QScriptValue XTreeWidgetItemtoScriptValue(QScriptEngine *engine, XTreeWidgetItem *const &item) { return engine->newQObject(item); } void XTreeWidgetItemfromScriptValue(const QScriptValue &obj, XTreeWidgetItem * &item) { item = qobject_cast(obj.toQObject()); } QScriptValue XTreeWidgetItemListtoScriptValue(QScriptEngine *engine, QList const &cpplist) { QScriptValue scriptlist = engine->newArray(cpplist.size()); for (int i = 0; i < cpplist.size(); i++) scriptlist.setProperty(i, engine->newQObject(cpplist.at(i))); return scriptlist; } void XTreeWidgetItemListfromScriptValue(const QScriptValue &scriptlist, QList &cpplist) { cpplist.clear(); int listlen = scriptlist.property("length").toInt32(); for (int i = 0; i < listlen; i++) { XTreeWidgetItem *tmp = qobject_cast(scriptlist.property(i).toQObject()); cpplist.append(tmp); } } QScriptValue XTreeWidgettoScriptValue(QScriptEngine *engine, XTreeWidget *const &item) { return engine->newQObject(item); } void XTreeWidgetfromScriptValue(const QScriptValue &obj, XTreeWidget * &item) { item = qobject_cast(obj.toQObject()); } // script exposure of xtreewidgetitem ///////////////////////////////////////// Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(QList) QScriptValue constructXTreeWidgetItem(QScriptContext *context,QScriptEngine *engine) { XTreeWidget *tree = qscriptvalue_cast(context->argument(0)); XTreeWidgetItem *obj = 0; int variantidx = 0; // index in arg list of first qvariant if (tree && context->argument(1).isNumber()) { if (DEBUG) qDebug("constructXTreeWidgetItem(tree, id)"); obj = new XTreeWidgetItem(tree, context->argument(1).toInt32()); variantidx = 2; } else if (qscriptvalue_cast(context->argument(0)) && context->argument(1).isNumber()) { if (DEBUG) qDebug("constructXTreeWidgetItem(item, id)"); obj = new XTreeWidgetItem(qscriptvalue_cast(context->argument(0)), context->argument(1).toInt32()); variantidx = 2; } else if (qscriptvalue_cast(context->argument(0)) && qscriptvalue_cast(context->argument(1)) && context->argument(2).isNumber()) { if (DEBUG) qDebug("constructXTreeWidgetItem(item, item, id)"); obj = new XTreeWidgetItem(qscriptvalue_cast(context->argument(0)), qscriptvalue_cast(context->argument(1)), context->argument(2).toInt32()); variantidx = 3; } else if (tree && qscriptvalue_cast(context->argument(1)) && context->argument(2).isNumber()) { if (DEBUG) qDebug("constructXTreeWidgetItem(tree, item, id)"); obj = new XTreeWidgetItem(tree, qscriptvalue_cast(context->argument(1)), context->argument(2).toInt32()); variantidx = 3; } if (obj) { if (context->argument(variantidx).isNumber()) { if (DEBUG) qDebug("constructXTreeWidgetItem found altId"); obj->setAltId(context->argument(variantidx).toInt32()); variantidx++; } if (DEBUG) qDebug("constructXTreeWidgetItem variantidx %d with %d total args", variantidx, context->argumentCount()); QTreeWidgetItem *header = tree ? tree->headerItem() : 0; for (int i = 0; variantidx < context->argumentCount(); variantidx++, i++) { QVariant var = context->argument(variantidx).toVariant(); if (DEBUG) qDebug("constructXTreeWidgetItem variant %d: type %d, value %s", i, var.type(), qPrintable(var.toString())); obj->setData(i, Xt::RawRole, var); if (var.type() == QVariant::Int) obj->setData(i, Qt::DisplayRole, QLocale().toString(var.toInt())); else if (var.type() == QVariant::Double) { int scale = header ? header->data(i, Xt::ScaleRole).toInt() : decimalPlaces("unknown"); if (DEBUG) qDebug("constructXTreeWidgetItem header %p Xt::ScaleRole %d(%d) result %d", header, header ? header->data(i, Xt::ScaleRole).toInt() : -1, decimalPlaces("unknown"), scale); obj->setData(i, Qt::DisplayRole, QLocale().toString(var.toDouble(), 'f', scale)); } else if (var.type() == QVariant::Bool) obj->setData(i, Qt::DisplayRole, var.toBool() ? yesStr : noStr); else obj->setData(i, Qt::DisplayRole, var); } } return engine->toScriptValue(obj); } void setupXTreeWidgetItem(QScriptEngine *engine) { qScriptRegisterMetaType(engine, XTreeWidgetItemtoScriptValue, XTreeWidgetItemfromScriptValue); qScriptRegisterMetaType(engine, XTreeWidgetItemListtoScriptValue, XTreeWidgetItemListfromScriptValue); QScriptValue constructor = engine->newFunction(constructXTreeWidgetItem); engine->globalObject().setProperty("XTreeWidgetItem", constructor, QScriptValue::ReadOnly | QScriptValue::Undeletable); } // xtreewidget //////////////////////////////////////////////////////////////// void setupXTreeWidget(QScriptEngine *engine) { QScriptValue glob = engine->newObject(); qScriptRegisterMetaType(engine, XTreeWidgettoScriptValue, XTreeWidgetfromScriptValue); glob.setProperty("Replace", QScriptValue(engine, XTreeWidget::Replace), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("Append", QScriptValue(engine, XTreeWidget::Append), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("itemColumn", QScriptValue(engine, _itemColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("whsColumn", QScriptValue(engine, _whsColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("userColumn", QScriptValue(engine, _userColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("dateColumn", QScriptValue(engine, _dateColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("timeDateColumn", QScriptValue(engine, _timeDateColumn),QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("timeColumn", QScriptValue(engine, _timeColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("qtyColumn", QScriptValue(engine, _qtyColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("priceColumn", QScriptValue(engine, _priceColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("moneyColumn", QScriptValue(engine, _moneyColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("bigMoneyColumn", QScriptValue(engine, _bigMoneyColumn),QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("costColumn", QScriptValue(engine, _costColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("prcntColumn", QScriptValue(engine, _prcntColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("transColumn", QScriptValue(engine, _transColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("uomColumn", QScriptValue(engine, _uomColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("orderColumn", QScriptValue(engine, _orderColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("statusColumn", QScriptValue(engine, _statusColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("seqColumn", QScriptValue(engine, _seqColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("ynColumn", QScriptValue(engine, _ynColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("docTypeColumn", QScriptValue(engine, _docTypeColumn), QScriptValue::ReadOnly | QScriptValue::Undeletable); glob.setProperty("currencyColumn", QScriptValue(engine, _currencyColumn),QScriptValue::ReadOnly | QScriptValue::Undeletable); engine->globalObject().setProperty("XTreeWidget", glob, QScriptValue::ReadOnly | QScriptValue::Undeletable); } Q_DECLARE_METATYPE(XTreeWidget *) void XTreeWidget::sCopyRowToClipboard() { QMimeData *mime = new QMimeData(); QClipboard *clipboard = QApplication::clipboard(); QTextDocument *doc = new QTextDocument(); QTextCursor *cursor = new QTextCursor(doc); QTextTableFormat tableFormat; QTextTableCell cell; QTextCharFormat format; QString color; QString font; XTreeWidgetItem *item = currentItem(); int counter; int colcnt = 0; if (_x_preferences->boolean("CopyListsPlainText")) { QString line = ""; for (int counter = 0; counter < item->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) line = line + item->text(counter) + "\t"; } clipboard->setText(line); return; } cursor->insertTable(1, 1,tableFormat); if (item) { for (counter = 0; counter < item->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) { colcnt++; if (colcnt > 1) { cursor->currentTable()->appendColumns(1); cursor->movePosition(QTextCursor::NextCell); } cell = cursor->currentTable()->cellAt(cursor->position()); format = cell.format(); if (item->data(counter, Qt::BackgroundRole).isValid()) format.setBackground(item->data(counter, Qt::BackgroundRole).value()); if (item->data(counter, Qt::ForegroundRole).isValid()) format.setForeground(item->data(counter, Qt::ForegroundRole).value()); if (item->data(counter,Qt::FontRole).isValid()) { font = item->data(counter,Qt::FontRole).toString(); if (!font.isEmpty()) format.setFont(QFont(font)); } cell.setFormat(format); cursor->insertText(item->text(counter)); } } mime->setHtml(doc->toHtml()); clipboard->setMimeData(mime); } } void XTreeWidget::sCopyCellToClipboard() { QTextEdit text; QMimeData *mime = new QMimeData(); QTreeWidgetItem *item = currentItem(); QClipboard *clipboard = QApplication::clipboard(); QString color; QString font; int column = currentColumn(); if (column > -1) { if (item->data(column, Qt::BackgroundRole).isValid()) text.setTextBackgroundColor(item->data(column, Qt::BackgroundRole).value()); if (item->data(column, Qt::ForegroundRole).isValid()) text.setTextColor(item->data(column, Qt::ForegroundRole).value()); if (item->data(column,Qt::FontRole).isValid()) { font = item->data(column,Qt::FontRole).toString(); if (!font.isEmpty()) text.setFont(QFont(font)); } text.setText(item->text(column)); if (_x_preferences->boolean("CopyListsPlainText")) mime->setText(text.toPlainText()); else mime->setHtml(text.toHtml()); clipboard->setMimeData(mime); } } void XTreeWidget::sCopyVisibleToClipboard() { QMimeData *mime = new QMimeData(); QClipboard *clipboard = QApplication::clipboard(); if (_x_preferences->boolean("CopyListsPlainText")) mime->setText(toTxt()); else mime->setHtml(toHtml()); clipboard->setMimeData(mime); } void XTreeWidget::sSearch(const QString &pTarget) { clearSelection(); int i; for (i = 0; i < topLevelItemCount(); i++) { // Currently this only looks at the first column if (topLevelItem(i)->text(0).contains(pTarget, Qt::CaseInsensitive)) break; } if (i < topLevelItemCount()) { setCurrentItem(topLevelItem(i)); scrollToItem(topLevelItem(i)); } } QString XTreeWidget::toTxt() const { QString line; QString opText; int counter; QTreeWidgetItem *header = headerItem(); for (counter = 0; counter < header->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) line = line + header->text(counter).replace("\r\n"," ") + "\t"; } opText = line + "\r\n"; XTreeWidgetItem *item = topLevelItem(0); if (item) { QModelIndex idx = indexFromItem(item); while (idx.isValid()) { item = (XTreeWidgetItem *)itemFromIndex(idx); if (item) { line = ""; for (counter = 0; counter < item->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) line = line + item->text(counter) + "\t"; } } opText = opText + line + "\r\n"; idx = indexBelow(idx); } } return opText; } QString XTreeWidget::toCsv() const { QString line; QString opText; int counter; int colcount = 0; QTreeWidgetItem *header = headerItem(); for (counter = 0; counter < header->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) { if (colcount) line = line + ","; line = line + header->text(counter).replace("\"","\"\"").replace("\r\n"," ").replace("\n"," "); colcount++; } } opText = line + "\r\n"; XTreeWidgetItem *item = topLevelItem(0); if (item) { QModelIndex idx = indexFromItem(item); while (idx.isValid()) { colcount = 0; item = (XTreeWidgetItem *)itemFromIndex(idx); if (item) { line = ""; for (counter = 0; counter < item->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) { if (colcount) line = line + ","; if (item->data(counter,Qt::DisplayRole).type() == QVariant::String) line = line + "\""; line = line + item->text(counter).replace("\"","\"\""); if (item->data(counter,Qt::DisplayRole).type() == QVariant::String) line = line + "\""; colcount++; } } } opText = opText + line + "\r\n"; idx = indexBelow(idx); } } return opText; } QString XTreeWidget::toHtml() const { QTextDocument *doc = new QTextDocument(); QTextCursor *cursor = new QTextCursor(doc); QTextTableFormat tableFormat; QTextTableCell cell; QTextCharFormat format; QString font; int colcnt = 0; int rowcnt = 0; tableFormat.setHeaderRowCount(1); QTreeWidgetItem *header = headerItem(); for (int i = 0; i < header->columnCount(); i++) if (!QTreeWidget::isColumnHidden(i)) colcnt++; XTreeWidgetItem *item = topLevelItem(0); if (item) { QModelIndex idx = indexFromItem(item); while (idx.isValid()) { item = (XTreeWidgetItem *)itemFromIndex(idx); if (item) rowcnt++; idx = indexBelow(idx); } } cursor->insertTable(rowcnt + 1, colcnt, tableFormat); for (int counter = 0; counter < header->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) { cell = cursor->currentTable()->cellAt(cursor->position()); format = cell.format(); format.setBackground(Qt::lightGray); cell.setFormat(format); cursor->insertText(header->text(counter)); cursor->movePosition(QTextCursor::NextCell); } } item = topLevelItem(0); if (item) { QModelIndex idx = indexFromItem(item); while (idx.isValid()) { item = (XTreeWidgetItem *)itemFromIndex(idx); if (item) { for (int counter = 0; counter < item->columnCount(); counter++) { if (!QTreeWidget::isColumnHidden(counter)) { cell = cursor->currentTable()->cellAt(cursor->position()); format = cell.format(); if (item->data(counter, Qt::BackgroundRole).isValid()) format.setBackground(item->data(counter, Qt::BackgroundRole).value()); if (item->data(counter, Qt::ForegroundRole).isValid()) format.setForeground(item->data(counter, Qt::ForegroundRole).value()); if (item->data(counter,Qt::FontRole).isValid()) { font = item->data(counter,Qt::FontRole).toString(); if (!font.isEmpty()) format.setFont(QFont(font)); } cell.setFormat(format); cursor->insertText(item->text(counter)); cursor->movePosition(QTextCursor::NextCell); } } } idx = indexBelow(idx); } } return doc->toHtml(); } QList XTreeWidget::selectedItems() const { QList xlist; foreach (QTreeWidgetItem *qitem, QTreeWidget::selectedItems()) { if (dynamic_cast(qitem)) xlist.append(dynamic_cast(qitem)); } return xlist; } void XTreeWidget::addTopLevelItems(const QList &items) { QList qlist = QTreeWidget::selectedItems(); for (int i = 0; i < items.size(); i++) qlist.append(items.at(i)); QTreeWidget::addTopLevelItems(qlist); } XTreeWidgetItem *XTreeWidget::itemAbove(const XTreeWidgetItem *item) const { return dynamic_cast(QTreeWidget::itemAbove(item)); } QList XTreeWidget::findItems(const QString &text, Qt::MatchFlags flags, int column, int role) const { QModelIndexList indexes = model()->match(model()->index(0, column, QModelIndex()), role, text, -1, flags); QList *xlist = new QList(); for (int i = 0; i < indexes.size(); ++i) { if (dynamic_cast(itemFromIndex(indexes.at(i)))) xlist->append(dynamic_cast(itemFromIndex(indexes.at(i)))); } return *xlist; } void XTreeWidget::insertTopLevelItems(int index, const QList &items) { QList qlist = QTreeWidget::selectedItems(); for (int i = 0; i < items.size(); i++) qlist.append(items.at(i)); QTreeWidget::insertTopLevelItems(index, qlist); } XTreeWidgetItem *XTreeWidget::invisibleRootItem() const { return dynamic_cast(QTreeWidget::invisibleRootItem()); } void XTreeWidget::sCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous) { if (dynamic_cast(current) && (dynamic_cast(previous) || previous == 0)) emit currentItemChanged(dynamic_cast(current), dynamic_cast(previous)); } void XTreeWidget::sItemActivated(QTreeWidgetItem *item, int column) { if (dynamic_cast(item)) emit itemActivated(dynamic_cast(item), column); } void XTreeWidget::sItemChanged(QTreeWidgetItem *item, int column) { if (dynamic_cast(item)) emit itemChanged(dynamic_cast(item), column); } void XTreeWidget::sItemClicked(QTreeWidgetItem *item, int column) { if (dynamic_cast(item)) emit itemClicked(dynamic_cast(item), column); } void XTreeWidget::sItemCollapsed(QTreeWidgetItem *item) { if (dynamic_cast(item)) emit itemCollapsed(dynamic_cast(item)); } void XTreeWidget::sItemDoubleClicked(QTreeWidgetItem *item, int column) { if (dynamic_cast(item)) emit itemDoubleClicked(dynamic_cast(item), column); } void XTreeWidget::sItemEntered(QTreeWidgetItem *item, int column) { if (dynamic_cast(item)) emit itemEntered(dynamic_cast(item), column); } void XTreeWidget::sItemExpanded(QTreeWidgetItem *item) { if (dynamic_cast(item)) emit itemExpanded(dynamic_cast(item)); } void XTreeWidget::sItemPressed(QTreeWidgetItem *item, int column) { if (dynamic_cast(item)) emit itemPressed(dynamic_cast(item), column); } /*! Returns the Raw Value of the first selected row on \a colname */ QVariant XTreeWidget::rawValue(const QString colname) const { QList items = selectedItems(); if (items.count() > 0) { XTreeWidgetItem *item = items.at(0); return item->rawValue(colname); } return QVariant(); } qt-client-4.1.0/widgets/xtreewidget.h000066400000000000000000000430461217451700100175730ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef __XTREEWIDGET_H__ #define __XTREEWIDGET_H__ #include #include #include #include #include #include //#13251 #include "widgets.h" #include "guiclientinterface.h" #include "xt.h" // Table Column Widths #define _itemColumn 100 #define _whsColumn 35 #define _userColumn 80 #define _dateColumn 80 #define _timeDateColumn 160 #define _timeColumn 80 #define _qtyColumn 80 #define _priceColumn 60 #define _moneyColumn 60 #define _bigMoneyColumn 100 #define _costColumn 70 #define _prcntColumn 55 #define _transColumn 35 #define _uomColumn 45 #define _orderColumn 60 #define _statusColumn 45 #define _seqColumn 40 #define _ynColumn 45 #define _docTypeColumn 80 #define _currencyColumn 80 // TODO: would these be better placed in an enum in xt.h? #define ROWROLE_INDENT 0 #define ROWROLE_HIDDEN 1 #define ROWROLE_DELETED 2 // make sure ROWROLE_COUNT = last ROWROLE + 1 #define ROWROLE_COUNT 3 #include "xsqlquery.h" class QAction; class QMenu; class QScriptEngine; class XTreeWidget; class XTreeWidgetProgress; void setupXTreeWidgetItem(QScriptEngine *engine); void setupXTreeWidget(QScriptEngine *engine); class XTUPLEWIDGETS_EXPORT XTreeWidgetItem : public QObject, public QTreeWidgetItem { Q_OBJECT friend class XTreeWidget; public: XTreeWidgetItem(XTreeWidgetItem *, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); XTreeWidgetItem(XTreeWidgetItem *, int, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); XTreeWidgetItem(XTreeWidget *, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); XTreeWidgetItem(XTreeWidget *, int, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); XTreeWidgetItem(XTreeWidget *, XTreeWidgetItem *, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); XTreeWidgetItem(XTreeWidget *, XTreeWidgetItem *, int, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); XTreeWidgetItem(XTreeWidgetItem *, XTreeWidgetItem *, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); XTreeWidgetItem(XTreeWidgetItem *, XTreeWidgetItem *, int, int, QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant(), QVariant = QVariant() ); Q_INVOKABLE virtual void setText(int, const QVariant&); Q_INVOKABLE virtual QString text(int p) const { return QTreeWidgetItem::text(p); } Q_INVOKABLE virtual QString text(const QString&) const; Q_INVOKABLE inline void setTextColor(int column, const QColor &color) { QTreeWidgetItem::setTextColor(column, color); } Q_INVOKABLE void setTextColor(const QColor&); Q_INVOKABLE inline int id() const { return _id; } Q_INVOKABLE inline int altId() const { return _altId; } Q_INVOKABLE inline void setId(int pId) { _id = pId; } Q_INVOKABLE inline void setAltId(int pId) { _altId = pId; } Q_INVOKABLE inline QVariant data(int colidx, int role) const { return QTreeWidgetItem::data(colidx, role); } Q_INVOKABLE inline void setData(int colidx, int role, const QVariant &val) { QTreeWidgetItem::setData(colidx, role, val); } Q_INVOKABLE virtual QVariant rawValue(const QString colname); Q_INVOKABLE virtual int id(const QString); virtual bool operator <(const XTreeWidgetItem &other) const; virtual bool operator ==(const XTreeWidgetItem &other) const; Q_INVOKABLE inline XTreeWidgetItem *child(int idx) const { QTreeWidgetItem *item = QTreeWidgetItem::child(idx); return ((XTreeWidgetItem *)item); } virtual QString toString() const; protected: virtual double totalForItem(const int, const int) const; private: void constructor( int, int, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant ); int _id; int _altId; }; Q_DECLARE_METATYPE(XTreeWidgetItem *) // Q_DECLARE_METATYPE(XTreeWidgetItem) class XTreeWidgetPopulateParams; class XTUPLEWIDGETS_EXPORT XTreeWidget : public QTreeWidget { Q_OBJECT Q_PROPERTY(QString dragString READ dragString WRITE setDragString) Q_PROPERTY( QString altDragString READ altDragString WRITE setAltDragString) Q_PROPERTY( bool populateLinear READ populateLinear WRITE setPopulateLinear) Q_ENUMS(PopulateStyle) public : enum PopulateStyle { Replace, Append }; XTreeWidget(QWidget *); ~XTreeWidget(); Q_INVOKABLE void populate(XSqlQuery, bool = FALSE, PopulateStyle = Replace); Q_INVOKABLE void populate(XSqlQuery, int, bool = FALSE, PopulateStyle = Replace); void populate(const QString&, bool = FALSE); void populate(const QString&, int, bool = FALSE); QString dragString() const; void setDragString(QString); QString altDragString() const; void setAltDragString(QString); bool populateLinear(); void setPopulateLinear(bool alwaysLinear = true); Q_INVOKABLE int altId() const; Q_INVOKABLE int id() const; Q_INVOKABLE int id(const QString) const; Q_INVOKABLE void setId(int pId, bool pClear = true); Q_INVOKABLE void setId(int pId,int pAltId, bool pClear = true); Q_INVOKABLE virtual int column(const QString) const; Q_INVOKABLE virtual XTreeWidgetItem *currentItem() const; Q_INVOKABLE virtual void setColumnCount(int columns); Q_INVOKABLE virtual void setColumnLocked(int, bool); Q_INVOKABLE virtual void setColumnVisible(int, bool); Q_INVOKABLE virtual void sortItems(int column, Qt::SortOrder order); Q_INVOKABLE virtual XTreeWidgetItem *topLevelItem(int idx) const; Q_INVOKABLE XTreeWidgetItem *findXTreeWidgetItemWithId(const XTreeWidget *ptree, const int pid); Q_INVOKABLE XTreeWidgetItem *findXTreeWidgetItemWithId(const XTreeWidgetItem *ptreeitem, const int pid); Q_INVOKABLE QString toTxt() const; Q_INVOKABLE QString toCsv() const; Q_INVOKABLE QString toHtml() const; // just for scripting exposure: Q_INVOKABLE inline void addTopLevelItem(XTreeWidgetItem *item) { QTreeWidget::addTopLevelItem(item); } Q_INVOKABLE void addTopLevelItems(const QList &items); Q_INVOKABLE inline void closePersistentEditor(XTreeWidgetItem *item, int column = 0) { QTreeWidget::closePersistentEditor(item, column); } Q_INVOKABLE inline int columnCount() const { return QTreeWidget::columnCount(); } Q_INVOKABLE inline int currentColumn() const { return QTreeWidget::currentColumn(); } Q_INVOKABLE inline void editItem(XTreeWidgetItem *item, int column = 0) { QTreeWidget::editItem(item, column); } Q_INVOKABLE QList findItems(const QString &text, Qt::MatchFlags flags, int column = 0, int role = 0) const; Q_INVOKABLE inline QTreeWidgetItem *headerItem() const { return QTreeWidget::headerItem(); } Q_INVOKABLE inline int indexOfTopLevelItem(XTreeWidgetItem *item) const { return QTreeWidget::indexOfTopLevelItem(item); } Q_INVOKABLE inline void insertTopLevelItem(int index, XTreeWidgetItem *item) { QTreeWidget::insertTopLevelItem(index, item); } Q_INVOKABLE void insertTopLevelItems(int index, const QList &items); Q_INVOKABLE XTreeWidgetItem *invisibleRootItem() const; Q_INVOKABLE inline bool isFirstItemColumnSpanned(const XTreeWidgetItem *item) const { return QTreeWidget::isFirstItemColumnSpanned(item); } Q_INVOKABLE XTreeWidgetItem *itemAbove(const XTreeWidgetItem *item) const; Q_INVOKABLE inline QTreeWidgetItem *itemAt(const QPoint &p) const { return QTreeWidget::itemAt(p); } Q_INVOKABLE inline QTreeWidgetItem *itemAt(int x, int y) const { return QTreeWidget::itemAt(x, y); } Q_INVOKABLE inline QTreeWidgetItem *itemBelow(const XTreeWidgetItem *item) const { return QTreeWidget::itemBelow(item); } Q_INVOKABLE inline QWidget *itemWidget(XTreeWidgetItem *item, int column) const { return QTreeWidget::itemWidget(item, column); } Q_INVOKABLE inline void openPersistentEditor(XTreeWidgetItem *item, int column = 0) { QTreeWidget::openPersistentEditor(item, column); } Q_INVOKABLE QVariant rawValue(const QString colname) const; Q_INVOKABLE inline void removeItemWidget(XTreeWidgetItem *item, int column) { QTreeWidget::removeItemWidget(item, column); } Q_INVOKABLE QList selectedItems() const; Q_INVOKABLE inline void setCurrentItem(XTreeWidgetItem *item) { QTreeWidget::setCurrentItem(item); } Q_INVOKABLE inline void setCurrentItem(XTreeWidgetItem *item, int column) { QTreeWidget::setCurrentItem(item, column); } Q_INVOKABLE inline void setCurrentItem(XTreeWidgetItem *item, int column, QItemSelectionModel::SelectionFlags command) { QTreeWidget::setCurrentItem(item, column, command); } Q_INVOKABLE inline void setFirstItemColumnSpanned(const XTreeWidgetItem *item, bool span) { QTreeWidget::setFirstItemColumnSpanned(item, span); } Q_INVOKABLE inline void setHeaderItem(XTreeWidgetItem *item) { QTreeWidget::setHeaderItem(item); } Q_INVOKABLE inline void setHeaderLabel(const QString &label) { QTreeWidget::setHeaderLabel(label); } Q_INVOKABLE inline void setHeaderLabels(const QStringList &labels) { QTreeWidget::setHeaderLabels(labels); } Q_INVOKABLE inline void setItemWidget(XTreeWidgetItem *item, int column, QWidget *widget) { QTreeWidget::setItemWidget(item, column, widget); } Q_INVOKABLE inline int sortColumn() const { return QTreeWidget::sortColumn(); } Q_INVOKABLE inline Qt::SortOrder sortOrder() const { return header()->sortIndicatorOrder(); } // temporary(?) until we expose all of qt Q_INVOKABLE inline QTreeWidgetItem *takeTopLevelItem(int index) { return QTreeWidget::takeTopLevelItem(index); } Q_INVOKABLE inline int topLevelItemCount() const { return QTreeWidget::topLevelItemCount(); } Q_INVOKABLE inline QRect visualItemRect(const XTreeWidgetItem *item) const { return QTreeWidget::visualItemRect(item); } Q_INVOKABLE inline void moveColumn(int from, int to) { header()->moveSection(from, to); } //#13251 // end of scripting exposure static GuiClientInterface *_guiClientInterface; public slots: void addColumn(const QString&, int, int, bool = true, const QString = QString(), const QString = QString(), const int scale = 0); void clear(); void hideColumn(int colnum) { QTreeWidget::hideColumn(colnum); }; void hideColumn(const QString&); void showColumn(int colnum) { QTreeWidget::showColumn(colnum); }; void showColumn(const QString&); void sExport(); void sCopyVisibleToClipboard(); void sCopyRowToClipboard(); void sCopyCellToClipboard(); void sSearch(const QString&); signals: void valid(bool); void newId(int); void currentItemChanged(XTreeWidgetItem *, XTreeWidgetItem *); void itemActivated(XTreeWidgetItem *item, int column); void itemChanged(XTreeWidgetItem *item, int column); void itemClicked(XTreeWidgetItem *item, int column); void itemCollapsed(XTreeWidgetItem *item); void itemDoubleClicked(XTreeWidgetItem *item, int column); void itemEntered(XTreeWidgetItem *item, int column); void itemExpanded(XTreeWidgetItem *item); void itemPressed(XTreeWidgetItem *item, int column); void itemSelected(int); void populateMenu(QMenu *, QTreeWidgetItem *); void populateMenu(QMenu *, QTreeWidgetItem *, int); void populateMenu(QMenu *, XTreeWidgetItem *); void populateMenu(QMenu *, XTreeWidgetItem *, int); void resorted(); void populated(); protected slots: void sHeaderClicked(int); void populateCalculatedColumns(); void sCurrentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous); void sItemActivated(QTreeWidgetItem *item, int column); void sItemChanged(QTreeWidgetItem *item, int column); void sItemClicked(QTreeWidgetItem *item, int column); void sItemCollapsed(QTreeWidgetItem *item); void sItemDoubleClicked(QTreeWidgetItem *item, int column); void sItemEntered(QTreeWidgetItem *item, int column); void sItemExpanded(QTreeWidgetItem *item); void sItemPressed(QTreeWidgetItem *item, int column); void populateWorker(); protected: QPoint dragStartPosition; virtual void mousePressEvent(QMouseEvent *); virtual void mouseMoveEvent(QMouseEvent *); virtual void resizeEvent(QResizeEvent *); private: QString _dragString; QString _altDragString; QMenu *_menu; QMap _defaultColumnWidths; QMap _savedColumnWidths; QMap _savedVisibleColumns; QMap _roles; QList _lockedColumns; QVector _stretch; bool _resizingInProcess; bool _forgetful; bool _forgetfulOrder; bool _savedId; bool _settingsLoaded; QString _settingsName; int _resetWhichWidth; int _scol; Qt::SortOrder _sord; static void loadLocale(); QList _workingParams; QTimer _workingTimer; bool _alwaysLinear; bool _linear; QVector *_colIdx; QVector *_colRole; int _fieldCount; XTreeWidgetItem *_last; int _rowRole[ROWROLE_COUNT]; void cleanupAfterPopulate(); XTreeWidgetProgress *_progress; QList *> *_subtotals; private slots: void sSelectionChanged(); void sItemSelected(); void sItemSelected(QTreeWidgetItem *, int); void sShowMenu(); void sShowMenu(const QPoint&); void sShowHeaderMenu(const QPoint&); // void sStartDrag(QTreeWidgetItem *, int); void sColumnSizeChanged(int, int, int); void sResetWidth(); void sResetAllWidths(); void sToggleForgetfulness(); void sToggleForgetfulnessOrder(); void popupMenuActionTriggered(QAction *); }; class XTreeWidgetPopulateParams { public: XSqlQuery _workingQuery; int _workingIndex; bool _workingUseAlt; XTreeWidget::PopulateStyle _workingPopstyle; }; #endif qt-client-4.1.0/widgets/xtreewidgetprogress.cpp000066400000000000000000000072241217451700100217110ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xtreewidgetprogress.h" #include #include #include #include #include #include #include "xtreewidget.h" #define DEBUG false XTreeWidgetProgress::XTreeWidgetProgress(XTreeWidget *parent) : QWidget(parent), _cancel(0), _lyt(0), _pb(0) { setObjectName("XTreeWidgetProgress"); if (DEBUG) qDebug("%s::XTreeWidgetProgress(%p (%s))", qPrintable(objectName()), parent, qPrintable(parent->objectName())); if (parent) { _pb = new QProgressBar(this); _pb->setMinimum(0); _cancel = new QPushButton(tr("Stop"), this); connect(_cancel, SIGNAL(clicked()), this, SIGNAL(cancel())); connect(_cancel, SIGNAL(clicked()), this, SLOT(hide())); _lyt = new QHBoxLayout(); _lyt->addWidget(_pb); _lyt->addWidget(_cancel); QLayout *parentlyt = 0; int lytindex = -1; for (QObject *ancestor = parent; ancestor && ! parentlyt; ancestor = ancestor->parent()) { QList list = ancestor->findChildren(); for (int i = 0; i < list.size(); i++) { lytindex = list.at(i)->indexOf(parent); if (lytindex != -1) { if (DEBUG) qDebug("%s::XTreeWidgetProgress() found parent layout", qPrintable(objectName())); parentlyt = list.at(i); break; } } } if (parentlyt) { if (QGridLayout *g = qobject_cast(parentlyt)) { int row = 0; int col = 0; int rowspan = 0; int colspan = 0; g->getItemPosition(lytindex, &row, &col, &rowspan, &colspan); g->addLayout(_lyt, row + 1, col, rowspan, colspan); if (DEBUG) qDebug("%s::XTreeWidgetProgress() inserted into grid layout", qPrintable(objectName())); } else if (QBoxLayout *b = qobject_cast(parentlyt)) { b->insertLayout(lytindex + 1, _lyt); _pb->setOrientation(qobject_cast(parentlyt) ? Qt::Horizontal : Qt::Vertical); if (DEBUG) qDebug("%s::XTreeWidgetProgress() inserted into box layout (%d)", qPrintable(objectName()), _pb->orientation()); } } else if (DEBUG) qDebug("%s::XTreeWidgetProgress() could not find parent layout", qPrintable(objectName())); } } void XTreeWidgetProgress::setMaximum(int max) { _pb->setMaximum(max); } void XTreeWidgetProgress::setOrientation(Qt::Orientation o) { if (DEBUG) qDebug("%s::setOrientation(%d)", qPrintable(objectName()), o); _pb->setOrientation(o); } void XTreeWidgetProgress::setValue(int val) { if (DEBUG) qDebug("%s::setValue(%d)", qPrintable(objectName()), val); _pb->setValue(val); } void XTreeWidgetProgress::hideEvent(QHideEvent *event) { _cancel->hide(); _pb->hide(); QWidget::hideEvent(event); } void XTreeWidgetProgress::showEvent(QShowEvent *event) { _cancel->show(); _pb->show(); QWidget::showEvent(event); } qt-client-4.1.0/widgets/xtreewidgetprogress.h000066400000000000000000000021411217451700100213470ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef XTREEWIDGETPROGRESS_H #define XTREEWIDGETPROGRESS_H #include "xtreewidget.h" class QLayout; class QProgressBar; class QPushButton; class XTreeWidgetProgress : public QWidget { Q_OBJECT public: XTreeWidgetProgress(XTreeWidget *parent); public slots: virtual void setMaximum(int max); virtual void setOrientation(Qt::Orientation o); virtual void setValue(int val); signals: void cancel(); protected: virtual void hideEvent(QHideEvent *event); virtual void showEvent(QShowEvent *event); private: QPushButton *_cancel; QLayout *_lyt; QProgressBar *_pb; }; #endif qt-client-4.1.0/widgets/xtupleplugin.h000066400000000000000000000017621217451700100177770ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef xtupleplugin_h #define xtupleplugin_h #include "widgets.h" #include class xTuplePlugin : public QObject, public QDesignerCustomWidgetCollectionInterface { Q_OBJECT Q_INTERFACES(QDesignerCustomWidgetCollectionInterface) public: xTuplePlugin(QObject *parent = 0); virtual QList customWidgets() const; private: QList m_plugins; }; void XTUPLEWIDGETS_EXPORT initializePlugin(Preferences *, Metrics *, Privileges *, QString, QMdiArea *); #endif qt-client-4.1.0/widgets/xurllabel.cpp000066400000000000000000000026611217451700100175630ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #include "xurllabel.h" #include #include XURLLabel::XURLLabel(QWidget * parent, const char * name) : QLabel(parent) { setObjectName(name ? name : "XUrlLabel"); QPalette p = palette(); p.setColor(QPalette::Foreground, Qt::blue); setPalette(p); setFont(font()); } XURLLabel::~XURLLabel() {} void XURLLabel::mouseReleaseEvent(QMouseEvent * e) { QLabel::mouseReleaseEvent(e); switch(e->button()) { case Qt::LeftButton: e->accept(); emit leftClickedURL(_url); break; case Qt::MidButton: e->accept(); emit middleClickedURL(_url); break; case Qt::RightButton: e->accept(); emit rightClickedURL(_url); break; default: e->ignore(); break; } } void XURLLabel::setFont(const QFont & f) { QFont newFont = f; newFont.setUnderline(TRUE); QLabel::setFont(newFont); } void XURLLabel::setURL(const QString & url) { _url = url; } const QString & XURLLabel::url() const { return _url; } qt-client-4.1.0/widgets/xurllabel.h000066400000000000000000000021411217451700100172210ustar00rootroot00000000000000/* * This file is part of the xTuple ERP: PostBooks Edition, a free and * open source Enterprise Resource Planning software suite, * Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. * It is licensed to you under the Common Public Attribution License * version 1.0, the full text of which (including xTuple-specific Exhibits) * is available at www.xtuple.com/CPAL. By using this software, you agree * to be bound by its terms. */ #ifndef xurllabel_h #define xurllabel_h #include #include #include "widgets.h" class XTUPLEWIDGETS_EXPORT XURLLabel : public QLabel { Q_OBJECT Q_PROPERTY (QString url READ url WRITE setURL) public: XURLLabel(QWidget * parent = 0, const char* name = 0); virtual ~XURLLabel(); const QString & url() const; public slots: void setURL(const QString&); void setFont(const QFont&); signals: void leftClickedURL(const QString&); void rightClickedURL(const QString&); void middleClickedURL(const QString&); protected: virtual void mouseReleaseEvent(QMouseEvent*); private: QString _url; }; #endif qt-client-4.1.0/xtlib/000077500000000000000000000000001217451700100145345ustar00rootroot00000000000000qt-client-4.1.0/xtuple.pro000066400000000000000000000011041217451700100154510ustar00rootroot00000000000000# # This file is part of the xTuple ERP: PostBooks Edition, a free and # open source Enterprise Resource Planning software suite, # Copyright (c) 1999-2012 by OpenMFG LLC, d/b/a xTuple. # It is licensed to you under the Common Public Attribution License # version 1.0, the full text of which (including xTuple-specific Exhibits) # is available at www.xtuple.com/CPAL. By using this software, you agree # to be bound by its terms. # TEMPLATE = subdirs SUBDIRS = common \ widgets/dll.pro \ widgets \ scriptapi \ guiclient CONFIG += ordered